diff --git a/eng/versioning/version_client.txt b/eng/versioning/version_client.txt index 465ec35312f8..3109bdcd3540 100644 --- a/eng/versioning/version_client.txt +++ b/eng/versioning/version_client.txt @@ -474,6 +474,7 @@ com.azure.resourcemanager:azure-resourcemanager-redhatopenshift;1.0.0-beta.1;1.0 com.azure.resourcemanager:azure-resourcemanager-fabric;1.0.0-beta.1;1.0.0-beta.2 com.azure.resourcemanager:azure-resourcemanager-computeschedule;1.0.0-beta.1;1.0.0-beta.2 com.azure.resourcemanager:azure-resourcemanager-trustedsigning;1.0.0-beta.1;1.0.0-beta.2 +com.azure.resourcemanager:azure-resourcemanager-awsconnector;1.0.0-beta.1;1.0.0-beta.1 com.azure.tools:azure-sdk-archetype;1.0.0;1.2.0-beta.1 com.azure.tools:azure-sdk-build-tool;1.0.0;1.1.0-beta.1 io.clientcore:clientcore-parent;1.0.0-beta.1;1.0.0-beta.1 diff --git a/pom.xml b/pom.xml index 33109fb1c4a9..eb473dc03a82 100644 --- a/pom.xml +++ b/pom.xml @@ -28,6 +28,7 @@ sdk/automanage sdk/automation sdk/avs + sdk/awsconnector sdk/azureadexternalidentities sdk/azurearcdata sdk/azurestack diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/CHANGELOG.md b/sdk/awsconnector/azure-resourcemanager-awsconnector/CHANGELOG.md new file mode 100644 index 000000000000..d380b3bcd051 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/CHANGELOG.md @@ -0,0 +1,8 @@ +# Release History + +## 1.0.0-beta.1 (2024-10-09) + +- Azure Resource Manager awsconnector client library for Java. This package contains Microsoft Azure SDK for awsconnector Management SDK. Microsoft.AwsConnector Resource Provider management API. Package tag package-2024-12-01. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt). +### Features Added + +- Initial release for the azure-resourcemanager-awsconnector Java SDK. diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/README.md b/sdk/awsconnector/azure-resourcemanager-awsconnector/README.md new file mode 100644 index 000000000000..ad6480acd570 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/README.md @@ -0,0 +1,104 @@ +# Azure Resource Manager awsconnector client library for Java + +Azure Resource Manager awsconnector client library for Java. + +This package contains Microsoft Azure SDK for awsconnector Management SDK. Microsoft.AwsConnector Resource Provider management API. Package tag package-2024-12-01. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt). + +## We'd love to hear your feedback + +We're always working on improving our products and the way we communicate with our users. So we'd love to learn what's working and how we can do better. + +If you haven't already, please take a few minutes to [complete this short survey][survey] we have put together. + +Thank you in advance for your collaboration. We really appreciate your time! + +## Documentation + +Various documentation is available to help you get started + +- [API reference documentation][docs] + +## Getting started + +### Prerequisites + +- [Java Development Kit (JDK)][jdk] with version 8 or above +- [Azure Subscription][azure_subscription] + +### Adding the package to your product + +[//]: # ({x-version-update-start;com.azure.resourcemanager:azure-resourcemanager-awsconnector;current}) +```xml + + com.azure.resourcemanager + azure-resourcemanager-awsconnector + 1.0.0-beta.1 + +``` +[//]: # ({x-version-update-end}) + +### Include the recommended packages + +Azure Management Libraries require a `TokenCredential` implementation for authentication and an `HttpClient` implementation for HTTP client. + +[Azure Identity][azure_identity] and [Azure Core Netty HTTP][azure_core_http_netty] packages provide the default implementation. + +### Authentication + +Microsoft Entra ID token authentication relies on the [credential class][azure_identity_credentials] from [Azure Identity][azure_identity] package. + +Azure subscription ID can be configured via `AZURE_SUBSCRIPTION_ID` environment variable. + +Assuming the use of the `DefaultAzureCredential` credential class, the client can be authenticated using the following code: + +```java +AzureProfile profile = new AzureProfile(AzureEnvironment.AZURE); +TokenCredential credential = new DefaultAzureCredentialBuilder() + .authorityHost(profile.getEnvironment().getActiveDirectoryEndpoint()) + .build(); +AwsconnectorManager manager = AwsconnectorManager + .authenticate(credential, profile); +``` + +The sample code assumes global Azure. Please change `AzureEnvironment.AZURE` variable if otherwise. + +See [Authentication][authenticate] for more options. + +## Key concepts + +See [API design][design] for general introduction on design and key concepts on Azure Management Libraries. + +## Examples + +[Code snippets and samples](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/awsconnector/azure-resourcemanager-awsconnector/SAMPLE.md) + + +## Troubleshooting + +## Next steps + +## Contributing + +For details on contributing to this repository, see the [contributing guide][cg]. + +This project welcomes contributions and suggestions. Most contributions require you to agree to a Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us the rights to use your contribution. For details, visit . + +When you submit a pull request, a CLA-bot will automatically determine whether you need to provide a CLA and decorate the PR appropriately (e.g., label, comment). Simply follow the instructions provided by the bot. You will only need to do this once across all repositories using our CLA. + +This project has adopted the [Microsoft Open Source Code of Conduct][coc]. For more information see the [Code of Conduct FAQ][coc_faq] or contact with any additional questions or comments. + + +[survey]: https://microsoft.qualtrics.com/jfe/form/SV_ehN0lIk2FKEBkwd?Q_CHL=DOCS +[docs]: https://azure.github.io/azure-sdk-for-java/ +[jdk]: https://learn.microsoft.com/azure/developer/java/fundamentals/ +[azure_subscription]: https://azure.microsoft.com/free/ +[azure_identity]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/identity/azure-identity +[azure_identity_credentials]: https://github.com/Azure/azure-sdk-for-java/tree/main/sdk/identity/azure-identity#credentials +[azure_core_http_netty]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/core/azure-core-http-netty +[authenticate]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/resourcemanager/docs/AUTH.md +[design]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/resourcemanager/docs/DESIGN.md +[cg]: https://github.com/Azure/azure-sdk-for-java/blob/main/CONTRIBUTING.md +[coc]: https://opensource.microsoft.com/codeofconduct/ +[coc_faq]: https://opensource.microsoft.com/codeofconduct/faq/ + +![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-java%2Fsdk%2Fawsconnector%2Fazure-resourcemanager-awsconnector%2FREADME.png) diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/SAMPLE.md b/sdk/awsconnector/azure-resourcemanager-awsconnector/SAMPLE.md new file mode 100644 index 000000000000..8557385edce4 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/SAMPLE.md @@ -0,0 +1,27403 @@ +# Code snippets and samples + + +## AccessAnalyzerAnalyzers + +- [CreateOrReplace](#accessanalyzeranalyzers_createorreplace) +- [Delete](#accessanalyzeranalyzers_delete) +- [GetByResourceGroup](#accessanalyzeranalyzers_getbyresourcegroup) +- [List](#accessanalyzeranalyzers_list) +- [ListByResourceGroup](#accessanalyzeranalyzers_listbyresourcegroup) +- [Update](#accessanalyzeranalyzers_update) + +## AcmCertificateSummaries + +- [CreateOrReplace](#acmcertificatesummaries_createorreplace) +- [Delete](#acmcertificatesummaries_delete) +- [GetByResourceGroup](#acmcertificatesummaries_getbyresourcegroup) +- [List](#acmcertificatesummaries_list) +- [ListByResourceGroup](#acmcertificatesummaries_listbyresourcegroup) +- [Update](#acmcertificatesummaries_update) + +## ApiGatewayRestApis + +- [CreateOrReplace](#apigatewayrestapis_createorreplace) +- [Delete](#apigatewayrestapis_delete) +- [GetByResourceGroup](#apigatewayrestapis_getbyresourcegroup) +- [List](#apigatewayrestapis_list) +- [ListByResourceGroup](#apigatewayrestapis_listbyresourcegroup) +- [Update](#apigatewayrestapis_update) + +## ApiGatewayStages + +- [CreateOrReplace](#apigatewaystages_createorreplace) +- [Delete](#apigatewaystages_delete) +- [GetByResourceGroup](#apigatewaystages_getbyresourcegroup) +- [List](#apigatewaystages_list) +- [ListByResourceGroup](#apigatewaystages_listbyresourcegroup) +- [Update](#apigatewaystages_update) + +## AppSyncGraphqlApis + +- [CreateOrReplace](#appsyncgraphqlapis_createorreplace) +- [Delete](#appsyncgraphqlapis_delete) +- [GetByResourceGroup](#appsyncgraphqlapis_getbyresourcegroup) +- [List](#appsyncgraphqlapis_list) +- [ListByResourceGroup](#appsyncgraphqlapis_listbyresourcegroup) +- [Update](#appsyncgraphqlapis_update) + +## AutoScalingAutoScalingGroups + +- [CreateOrReplace](#autoscalingautoscalinggroups_createorreplace) +- [Delete](#autoscalingautoscalinggroups_delete) +- [GetByResourceGroup](#autoscalingautoscalinggroups_getbyresourcegroup) +- [List](#autoscalingautoscalinggroups_list) +- [ListByResourceGroup](#autoscalingautoscalinggroups_listbyresourcegroup) +- [Update](#autoscalingautoscalinggroups_update) + +## CloudFormationStackSets + +- [CreateOrReplace](#cloudformationstacksets_createorreplace) +- [Delete](#cloudformationstacksets_delete) +- [GetByResourceGroup](#cloudformationstacksets_getbyresourcegroup) +- [List](#cloudformationstacksets_list) +- [ListByResourceGroup](#cloudformationstacksets_listbyresourcegroup) +- [Update](#cloudformationstacksets_update) + +## CloudFormationStacks + +- [CreateOrReplace](#cloudformationstacks_createorreplace) +- [Delete](#cloudformationstacks_delete) +- [GetByResourceGroup](#cloudformationstacks_getbyresourcegroup) +- [List](#cloudformationstacks_list) +- [ListByResourceGroup](#cloudformationstacks_listbyresourcegroup) +- [Update](#cloudformationstacks_update) + +## CloudFrontDistributions + +- [CreateOrReplace](#cloudfrontdistributions_createorreplace) +- [Delete](#cloudfrontdistributions_delete) +- [GetByResourceGroup](#cloudfrontdistributions_getbyresourcegroup) +- [List](#cloudfrontdistributions_list) +- [ListByResourceGroup](#cloudfrontdistributions_listbyresourcegroup) +- [Update](#cloudfrontdistributions_update) + +## CloudTrailTrails + +- [CreateOrReplace](#cloudtrailtrails_createorreplace) +- [Delete](#cloudtrailtrails_delete) +- [GetByResourceGroup](#cloudtrailtrails_getbyresourcegroup) +- [List](#cloudtrailtrails_list) +- [ListByResourceGroup](#cloudtrailtrails_listbyresourcegroup) +- [Update](#cloudtrailtrails_update) + +## CloudWatchAlarms + +- [CreateOrReplace](#cloudwatchalarms_createorreplace) +- [Delete](#cloudwatchalarms_delete) +- [GetByResourceGroup](#cloudwatchalarms_getbyresourcegroup) +- [List](#cloudwatchalarms_list) +- [ListByResourceGroup](#cloudwatchalarms_listbyresourcegroup) +- [Update](#cloudwatchalarms_update) + +## CodeBuildProjects + +- [CreateOrReplace](#codebuildprojects_createorreplace) +- [Delete](#codebuildprojects_delete) +- [GetByResourceGroup](#codebuildprojects_getbyresourcegroup) +- [List](#codebuildprojects_list) +- [ListByResourceGroup](#codebuildprojects_listbyresourcegroup) +- [Update](#codebuildprojects_update) + +## CodeBuildSourceCredentialsInfos + +- [CreateOrReplace](#codebuildsourcecredentialsinfos_createorreplace) +- [Delete](#codebuildsourcecredentialsinfos_delete) +- [GetByResourceGroup](#codebuildsourcecredentialsinfos_getbyresourcegroup) +- [List](#codebuildsourcecredentialsinfos_list) +- [ListByResourceGroup](#codebuildsourcecredentialsinfos_listbyresourcegroup) +- [Update](#codebuildsourcecredentialsinfos_update) + +## ConfigServiceConfigurationRecorderStatuses + +- [CreateOrReplace](#configserviceconfigurationrecorderstatuses_createorreplace) +- [Delete](#configserviceconfigurationrecorderstatuses_delete) +- [GetByResourceGroup](#configserviceconfigurationrecorderstatuses_getbyresourcegroup) +- [List](#configserviceconfigurationrecorderstatuses_list) +- [ListByResourceGroup](#configserviceconfigurationrecorderstatuses_listbyresourcegroup) +- [Update](#configserviceconfigurationrecorderstatuses_update) + +## ConfigServiceConfigurationRecorders + +- [CreateOrReplace](#configserviceconfigurationrecorders_createorreplace) +- [Delete](#configserviceconfigurationrecorders_delete) +- [GetByResourceGroup](#configserviceconfigurationrecorders_getbyresourcegroup) +- [List](#configserviceconfigurationrecorders_list) +- [ListByResourceGroup](#configserviceconfigurationrecorders_listbyresourcegroup) +- [Update](#configserviceconfigurationrecorders_update) + +## ConfigServiceDeliveryChannels + +- [CreateOrReplace](#configservicedeliverychannels_createorreplace) +- [Delete](#configservicedeliverychannels_delete) +- [GetByResourceGroup](#configservicedeliverychannels_getbyresourcegroup) +- [List](#configservicedeliverychannels_list) +- [ListByResourceGroup](#configservicedeliverychannels_listbyresourcegroup) +- [Update](#configservicedeliverychannels_update) + +## DatabaseMigrationServiceReplicationInstances + +- [CreateOrReplace](#databasemigrationservicereplicationinstances_createorreplace) +- [Delete](#databasemigrationservicereplicationinstances_delete) +- [GetByResourceGroup](#databasemigrationservicereplicationinstances_getbyresourcegroup) +- [List](#databasemigrationservicereplicationinstances_list) +- [ListByResourceGroup](#databasemigrationservicereplicationinstances_listbyresourcegroup) +- [Update](#databasemigrationservicereplicationinstances_update) + +## DaxClusters + +- [CreateOrReplace](#daxclusters_createorreplace) +- [Delete](#daxclusters_delete) +- [GetByResourceGroup](#daxclusters_getbyresourcegroup) +- [List](#daxclusters_list) +- [ListByResourceGroup](#daxclusters_listbyresourcegroup) +- [Update](#daxclusters_update) + +## DynamoDbContinuousBackupsDescriptions + +- [CreateOrReplace](#dynamodbcontinuousbackupsdescriptions_createorreplace) +- [Delete](#dynamodbcontinuousbackupsdescriptions_delete) +- [GetByResourceGroup](#dynamodbcontinuousbackupsdescriptions_getbyresourcegroup) +- [List](#dynamodbcontinuousbackupsdescriptions_list) +- [ListByResourceGroup](#dynamodbcontinuousbackupsdescriptions_listbyresourcegroup) +- [Update](#dynamodbcontinuousbackupsdescriptions_update) + +## DynamoDbTables + +- [CreateOrReplace](#dynamodbtables_createorreplace) +- [Delete](#dynamodbtables_delete) +- [GetByResourceGroup](#dynamodbtables_getbyresourcegroup) +- [List](#dynamodbtables_list) +- [ListByResourceGroup](#dynamodbtables_listbyresourcegroup) +- [Update](#dynamodbtables_update) + +## Ec2AccountAttributes + +- [CreateOrReplace](#ec2accountattributes_createorreplace) +- [Delete](#ec2accountattributes_delete) +- [GetByResourceGroup](#ec2accountattributes_getbyresourcegroup) +- [List](#ec2accountattributes_list) +- [ListByResourceGroup](#ec2accountattributes_listbyresourcegroup) +- [Update](#ec2accountattributes_update) + +## Ec2Addresses + +- [CreateOrReplace](#ec2addresses_createorreplace) +- [Delete](#ec2addresses_delete) +- [GetByResourceGroup](#ec2addresses_getbyresourcegroup) +- [List](#ec2addresses_list) +- [ListByResourceGroup](#ec2addresses_listbyresourcegroup) +- [Update](#ec2addresses_update) + +## Ec2FlowLogs + +- [CreateOrReplace](#ec2flowlogs_createorreplace) +- [Delete](#ec2flowlogs_delete) +- [GetByResourceGroup](#ec2flowlogs_getbyresourcegroup) +- [List](#ec2flowlogs_list) +- [ListByResourceGroup](#ec2flowlogs_listbyresourcegroup) +- [Update](#ec2flowlogs_update) + +## Ec2Images + +- [CreateOrReplace](#ec2images_createorreplace) +- [Delete](#ec2images_delete) +- [GetByResourceGroup](#ec2images_getbyresourcegroup) +- [List](#ec2images_list) +- [ListByResourceGroup](#ec2images_listbyresourcegroup) +- [Update](#ec2images_update) + +## Ec2InstanceStatuses + +- [CreateOrReplace](#ec2instancestatuses_createorreplace) +- [Delete](#ec2instancestatuses_delete) +- [GetByResourceGroup](#ec2instancestatuses_getbyresourcegroup) +- [List](#ec2instancestatuses_list) +- [ListByResourceGroup](#ec2instancestatuses_listbyresourcegroup) +- [Update](#ec2instancestatuses_update) + +## Ec2Instances + +- [CreateOrReplace](#ec2instances_createorreplace) +- [Delete](#ec2instances_delete) +- [Get](#ec2instances_get) +- [List](#ec2instances_list) +- [Start](#ec2instances_start) +- [Stop](#ec2instances_stop) + +## Ec2Ipams + +- [CreateOrReplace](#ec2ipams_createorreplace) +- [Delete](#ec2ipams_delete) +- [GetByResourceGroup](#ec2ipams_getbyresourcegroup) +- [List](#ec2ipams_list) +- [ListByResourceGroup](#ec2ipams_listbyresourcegroup) +- [Update](#ec2ipams_update) + +## Ec2KeyPairs + +- [CreateOrReplace](#ec2keypairs_createorreplace) +- [Delete](#ec2keypairs_delete) +- [GetByResourceGroup](#ec2keypairs_getbyresourcegroup) +- [List](#ec2keypairs_list) +- [ListByResourceGroup](#ec2keypairs_listbyresourcegroup) +- [Update](#ec2keypairs_update) + +## Ec2NetworkAcls + +- [CreateOrReplace](#ec2networkacls_createorreplace) +- [Delete](#ec2networkacls_delete) +- [GetByResourceGroup](#ec2networkacls_getbyresourcegroup) +- [List](#ec2networkacls_list) +- [ListByResourceGroup](#ec2networkacls_listbyresourcegroup) +- [Update](#ec2networkacls_update) + +## Ec2NetworkInterfaces + +- [CreateOrReplace](#ec2networkinterfaces_createorreplace) +- [Delete](#ec2networkinterfaces_delete) +- [GetByResourceGroup](#ec2networkinterfaces_getbyresourcegroup) +- [List](#ec2networkinterfaces_list) +- [ListByResourceGroup](#ec2networkinterfaces_listbyresourcegroup) +- [Update](#ec2networkinterfaces_update) + +## Ec2RouteTables + +- [CreateOrReplace](#ec2routetables_createorreplace) +- [Delete](#ec2routetables_delete) +- [GetByResourceGroup](#ec2routetables_getbyresourcegroup) +- [List](#ec2routetables_list) +- [ListByResourceGroup](#ec2routetables_listbyresourcegroup) +- [Update](#ec2routetables_update) + +## Ec2SecurityGroups + +- [CreateOrReplace](#ec2securitygroups_createorreplace) +- [Delete](#ec2securitygroups_delete) +- [GetByResourceGroup](#ec2securitygroups_getbyresourcegroup) +- [List](#ec2securitygroups_list) +- [ListByResourceGroup](#ec2securitygroups_listbyresourcegroup) +- [Update](#ec2securitygroups_update) + +## Ec2Snapshots + +- [CreateOrReplace](#ec2snapshots_createorreplace) +- [Delete](#ec2snapshots_delete) +- [GetByResourceGroup](#ec2snapshots_getbyresourcegroup) +- [List](#ec2snapshots_list) +- [ListByResourceGroup](#ec2snapshots_listbyresourcegroup) +- [Update](#ec2snapshots_update) + +## Ec2Subnets + +- [CreateOrReplace](#ec2subnets_createorreplace) +- [Delete](#ec2subnets_delete) +- [GetByResourceGroup](#ec2subnets_getbyresourcegroup) +- [List](#ec2subnets_list) +- [ListByResourceGroup](#ec2subnets_listbyresourcegroup) +- [Update](#ec2subnets_update) + +## Ec2Volumes + +- [CreateOrReplace](#ec2volumes_createorreplace) +- [Delete](#ec2volumes_delete) +- [GetByResourceGroup](#ec2volumes_getbyresourcegroup) +- [List](#ec2volumes_list) +- [ListByResourceGroup](#ec2volumes_listbyresourcegroup) +- [Update](#ec2volumes_update) + +## Ec2VpcEndpoints + +- [CreateOrReplace](#ec2vpcendpoints_createorreplace) +- [Delete](#ec2vpcendpoints_delete) +- [GetByResourceGroup](#ec2vpcendpoints_getbyresourcegroup) +- [List](#ec2vpcendpoints_list) +- [ListByResourceGroup](#ec2vpcendpoints_listbyresourcegroup) +- [Update](#ec2vpcendpoints_update) + +## Ec2VpcPeeringConnections + +- [CreateOrReplace](#ec2vpcpeeringconnections_createorreplace) +- [Delete](#ec2vpcpeeringconnections_delete) +- [GetByResourceGroup](#ec2vpcpeeringconnections_getbyresourcegroup) +- [List](#ec2vpcpeeringconnections_list) +- [ListByResourceGroup](#ec2vpcpeeringconnections_listbyresourcegroup) +- [Update](#ec2vpcpeeringconnections_update) + +## Ec2Vpcs + +- [CreateOrReplace](#ec2vpcs_createorreplace) +- [Delete](#ec2vpcs_delete) +- [GetByResourceGroup](#ec2vpcs_getbyresourcegroup) +- [List](#ec2vpcs_list) +- [ListByResourceGroup](#ec2vpcs_listbyresourcegroup) +- [Update](#ec2vpcs_update) + +## EcrImageDetails + +- [CreateOrReplace](#ecrimagedetails_createorreplace) +- [Delete](#ecrimagedetails_delete) +- [GetByResourceGroup](#ecrimagedetails_getbyresourcegroup) +- [List](#ecrimagedetails_list) +- [ListByResourceGroup](#ecrimagedetails_listbyresourcegroup) +- [Update](#ecrimagedetails_update) + +## EcrRepositories + +- [CreateOrReplace](#ecrrepositories_createorreplace) +- [Delete](#ecrrepositories_delete) +- [GetByResourceGroup](#ecrrepositories_getbyresourcegroup) +- [List](#ecrrepositories_list) +- [ListByResourceGroup](#ecrrepositories_listbyresourcegroup) +- [Update](#ecrrepositories_update) + +## EcsClusters + +- [CreateOrReplace](#ecsclusters_createorreplace) +- [Delete](#ecsclusters_delete) +- [GetByResourceGroup](#ecsclusters_getbyresourcegroup) +- [List](#ecsclusters_list) +- [ListByResourceGroup](#ecsclusters_listbyresourcegroup) +- [Update](#ecsclusters_update) + +## EcsServices + +- [CreateOrReplace](#ecsservices_createorreplace) +- [Delete](#ecsservices_delete) +- [GetByResourceGroup](#ecsservices_getbyresourcegroup) +- [List](#ecsservices_list) +- [ListByResourceGroup](#ecsservices_listbyresourcegroup) +- [Update](#ecsservices_update) + +## EcsTaskDefinitions + +- [CreateOrReplace](#ecstaskdefinitions_createorreplace) +- [Delete](#ecstaskdefinitions_delete) +- [GetByResourceGroup](#ecstaskdefinitions_getbyresourcegroup) +- [List](#ecstaskdefinitions_list) +- [ListByResourceGroup](#ecstaskdefinitions_listbyresourcegroup) +- [Update](#ecstaskdefinitions_update) + +## EfsFileSystems + +- [CreateOrReplace](#efsfilesystems_createorreplace) +- [Delete](#efsfilesystems_delete) +- [GetByResourceGroup](#efsfilesystems_getbyresourcegroup) +- [List](#efsfilesystems_list) +- [ListByResourceGroup](#efsfilesystems_listbyresourcegroup) +- [Update](#efsfilesystems_update) + +## EfsMountTargets + +- [CreateOrReplace](#efsmounttargets_createorreplace) +- [Delete](#efsmounttargets_delete) +- [GetByResourceGroup](#efsmounttargets_getbyresourcegroup) +- [List](#efsmounttargets_list) +- [ListByResourceGroup](#efsmounttargets_listbyresourcegroup) +- [Update](#efsmounttargets_update) + +## EksClusters + +- [CreateOrReplace](#eksclusters_createorreplace) +- [Delete](#eksclusters_delete) +- [Get](#eksclusters_get) +- [List](#eksclusters_list) + +## EksNodegroups + +- [CreateOrReplace](#eksnodegroups_createorreplace) +- [Delete](#eksnodegroups_delete) +- [GetByResourceGroup](#eksnodegroups_getbyresourcegroup) +- [List](#eksnodegroups_list) +- [ListByResourceGroup](#eksnodegroups_listbyresourcegroup) +- [Update](#eksnodegroups_update) + +## ElasticBeanstalkApplications + +- [CreateOrReplace](#elasticbeanstalkapplications_createorreplace) +- [Delete](#elasticbeanstalkapplications_delete) +- [GetByResourceGroup](#elasticbeanstalkapplications_getbyresourcegroup) +- [List](#elasticbeanstalkapplications_list) +- [ListByResourceGroup](#elasticbeanstalkapplications_listbyresourcegroup) +- [Update](#elasticbeanstalkapplications_update) + +## ElasticBeanstalkConfigurationTemplates + +- [CreateOrReplace](#elasticbeanstalkconfigurationtemplates_createorreplace) +- [Delete](#elasticbeanstalkconfigurationtemplates_delete) +- [GetByResourceGroup](#elasticbeanstalkconfigurationtemplates_getbyresourcegroup) +- [List](#elasticbeanstalkconfigurationtemplates_list) +- [ListByResourceGroup](#elasticbeanstalkconfigurationtemplates_listbyresourcegroup) +- [Update](#elasticbeanstalkconfigurationtemplates_update) + +## ElasticBeanstalkEnvironments + +- [CreateOrReplace](#elasticbeanstalkenvironments_createorreplace) +- [Delete](#elasticbeanstalkenvironments_delete) +- [GetByResourceGroup](#elasticbeanstalkenvironments_getbyresourcegroup) +- [List](#elasticbeanstalkenvironments_list) +- [ListByResourceGroup](#elasticbeanstalkenvironments_listbyresourcegroup) +- [Update](#elasticbeanstalkenvironments_update) + +## ElasticLoadBalancingV2Listeners + +- [CreateOrReplace](#elasticloadbalancingv2listeners_createorreplace) +- [Delete](#elasticloadbalancingv2listeners_delete) +- [GetByResourceGroup](#elasticloadbalancingv2listeners_getbyresourcegroup) +- [List](#elasticloadbalancingv2listeners_list) +- [ListByResourceGroup](#elasticloadbalancingv2listeners_listbyresourcegroup) +- [Update](#elasticloadbalancingv2listeners_update) + +## ElasticLoadBalancingV2LoadBalancers + +- [CreateOrReplace](#elasticloadbalancingv2loadbalancers_createorreplace) +- [Delete](#elasticloadbalancingv2loadbalancers_delete) +- [GetByResourceGroup](#elasticloadbalancingv2loadbalancers_getbyresourcegroup) +- [List](#elasticloadbalancingv2loadbalancers_list) +- [ListByResourceGroup](#elasticloadbalancingv2loadbalancers_listbyresourcegroup) +- [Update](#elasticloadbalancingv2loadbalancers_update) + +## ElasticLoadBalancingV2TargetGroups + +- [CreateOrReplace](#elasticloadbalancingv2targetgroups_createorreplace) +- [Delete](#elasticloadbalancingv2targetgroups_delete) +- [GetByResourceGroup](#elasticloadbalancingv2targetgroups_getbyresourcegroup) +- [List](#elasticloadbalancingv2targetgroups_list) +- [ListByResourceGroup](#elasticloadbalancingv2targetgroups_listbyresourcegroup) +- [Update](#elasticloadbalancingv2targetgroups_update) + +## ElasticLoadBalancingv2TargetHealthDescriptions + +- [CreateOrReplace](#elasticloadbalancingv2targethealthdescriptions_createorreplace) +- [Delete](#elasticloadbalancingv2targethealthdescriptions_delete) +- [GetByResourceGroup](#elasticloadbalancingv2targethealthdescriptions_getbyresourcegroup) +- [List](#elasticloadbalancingv2targethealthdescriptions_list) +- [ListByResourceGroup](#elasticloadbalancingv2targethealthdescriptions_listbyresourcegroup) +- [Update](#elasticloadbalancingv2targethealthdescriptions_update) + +## EmrClusterSummaries + +- [CreateOrReplace](#emrclustersummaries_createorreplace) +- [Delete](#emrclustersummaries_delete) +- [GetByResourceGroup](#emrclustersummaries_getbyresourcegroup) +- [List](#emrclustersummaries_list) +- [ListByResourceGroup](#emrclustersummaries_listbyresourcegroup) +- [Update](#emrclustersummaries_update) + +## EmrClusters + +- [CreateOrReplace](#emrclusters_createorreplace) +- [Delete](#emrclusters_delete) +- [GetByResourceGroup](#emrclusters_getbyresourcegroup) +- [List](#emrclusters_list) +- [ListByResourceGroup](#emrclusters_listbyresourcegroup) +- [Update](#emrclusters_update) + +## GuardDutyDetectors + +- [CreateOrReplace](#guarddutydetectors_createorreplace) +- [Delete](#guarddutydetectors_delete) +- [GetByResourceGroup](#guarddutydetectors_getbyresourcegroup) +- [List](#guarddutydetectors_list) +- [ListByResourceGroup](#guarddutydetectors_listbyresourcegroup) +- [Update](#guarddutydetectors_update) + +## IamAccessKeyLastUseds + +- [CreateOrReplace](#iamaccesskeylastuseds_createorreplace) +- [Delete](#iamaccesskeylastuseds_delete) +- [GetByResourceGroup](#iamaccesskeylastuseds_getbyresourcegroup) +- [List](#iamaccesskeylastuseds_list) +- [ListByResourceGroup](#iamaccesskeylastuseds_listbyresourcegroup) +- [Update](#iamaccesskeylastuseds_update) + +## IamAccessKeyMetadataInfo + +- [CreateOrReplace](#iamaccesskeymetadatainfo_createorreplace) +- [Delete](#iamaccesskeymetadatainfo_delete) +- [GetByResourceGroup](#iamaccesskeymetadatainfo_getbyresourcegroup) +- [List](#iamaccesskeymetadatainfo_list) +- [ListByResourceGroup](#iamaccesskeymetadatainfo_listbyresourcegroup) +- [Update](#iamaccesskeymetadatainfo_update) + +## IamGroups + +- [CreateOrReplace](#iamgroups_createorreplace) +- [Delete](#iamgroups_delete) +- [GetByResourceGroup](#iamgroups_getbyresourcegroup) +- [List](#iamgroups_list) +- [ListByResourceGroup](#iamgroups_listbyresourcegroup) +- [Update](#iamgroups_update) + +## IamInstanceProfiles + +- [CreateOrUpdate](#iaminstanceprofiles_createorupdate) +- [Delete](#iaminstanceprofiles_delete) +- [GetByResourceGroup](#iaminstanceprofiles_getbyresourcegroup) +- [List](#iaminstanceprofiles_list) +- [ListByResourceGroup](#iaminstanceprofiles_listbyresourcegroup) +- [Update](#iaminstanceprofiles_update) + +## IamMfaDevices + +- [CreateOrReplace](#iammfadevices_createorreplace) +- [Delete](#iammfadevices_delete) +- [GetByResourceGroup](#iammfadevices_getbyresourcegroup) +- [List](#iammfadevices_list) +- [ListByResourceGroup](#iammfadevices_listbyresourcegroup) +- [Update](#iammfadevices_update) + +## IamPasswordPolicies + +- [CreateOrReplace](#iampasswordpolicies_createorreplace) +- [Delete](#iampasswordpolicies_delete) +- [GetByResourceGroup](#iampasswordpolicies_getbyresourcegroup) +- [List](#iampasswordpolicies_list) +- [ListByResourceGroup](#iampasswordpolicies_listbyresourcegroup) +- [Update](#iampasswordpolicies_update) + +## IamPolicyVersions + +- [CreateOrReplace](#iampolicyversions_createorreplace) +- [Delete](#iampolicyversions_delete) +- [GetByResourceGroup](#iampolicyversions_getbyresourcegroup) +- [List](#iampolicyversions_list) +- [ListByResourceGroup](#iampolicyversions_listbyresourcegroup) +- [Update](#iampolicyversions_update) + +## IamRoles + +- [CreateOrReplace](#iamroles_createorreplace) +- [Delete](#iamroles_delete) +- [GetByResourceGroup](#iamroles_getbyresourcegroup) +- [List](#iamroles_list) +- [ListByResourceGroup](#iamroles_listbyresourcegroup) +- [Update](#iamroles_update) + +## IamServerCertificates + +- [CreateOrReplace](#iamservercertificates_createorreplace) +- [Delete](#iamservercertificates_delete) +- [GetByResourceGroup](#iamservercertificates_getbyresourcegroup) +- [List](#iamservercertificates_list) +- [ListByResourceGroup](#iamservercertificates_listbyresourcegroup) +- [Update](#iamservercertificates_update) + +## IamVirtualMfaDevices + +- [CreateOrReplace](#iamvirtualmfadevices_createorreplace) +- [Delete](#iamvirtualmfadevices_delete) +- [GetByResourceGroup](#iamvirtualmfadevices_getbyresourcegroup) +- [List](#iamvirtualmfadevices_list) +- [ListByResourceGroup](#iamvirtualmfadevices_listbyresourcegroup) +- [Update](#iamvirtualmfadevices_update) + +## KmsAliases + +- [CreateOrReplace](#kmsaliases_createorreplace) +- [Delete](#kmsaliases_delete) +- [GetByResourceGroup](#kmsaliases_getbyresourcegroup) +- [List](#kmsaliases_list) +- [ListByResourceGroup](#kmsaliases_listbyresourcegroup) +- [Update](#kmsaliases_update) + +## KmsKeys + +- [CreateOrReplace](#kmskeys_createorreplace) +- [Delete](#kmskeys_delete) +- [GetByResourceGroup](#kmskeys_getbyresourcegroup) +- [List](#kmskeys_list) +- [ListByResourceGroup](#kmskeys_listbyresourcegroup) +- [Update](#kmskeys_update) + +## LambdaFunctionCodeLocations + +- [CreateOrReplace](#lambdafunctioncodelocations_createorreplace) +- [Delete](#lambdafunctioncodelocations_delete) +- [GetByResourceGroup](#lambdafunctioncodelocations_getbyresourcegroup) +- [List](#lambdafunctioncodelocations_list) +- [ListByResourceGroup](#lambdafunctioncodelocations_listbyresourcegroup) +- [Update](#lambdafunctioncodelocations_update) + +## LambdaFunctions + +- [CreateOrReplace](#lambdafunctions_createorreplace) +- [Delete](#lambdafunctions_delete) +- [GetByResourceGroup](#lambdafunctions_getbyresourcegroup) +- [List](#lambdafunctions_list) +- [ListByResourceGroup](#lambdafunctions_listbyresourcegroup) +- [Update](#lambdafunctions_update) + +## LightsailBuckets + +- [CreateOrReplace](#lightsailbuckets_createorreplace) +- [Delete](#lightsailbuckets_delete) +- [GetByResourceGroup](#lightsailbuckets_getbyresourcegroup) +- [List](#lightsailbuckets_list) +- [ListByResourceGroup](#lightsailbuckets_listbyresourcegroup) +- [Update](#lightsailbuckets_update) + +## LightsailInstances + +- [CreateOrReplace](#lightsailinstances_createorreplace) +- [Delete](#lightsailinstances_delete) +- [GetByResourceGroup](#lightsailinstances_getbyresourcegroup) +- [List](#lightsailinstances_list) +- [ListByResourceGroup](#lightsailinstances_listbyresourcegroup) +- [Update](#lightsailinstances_update) + +## LogsLogGroups + +- [CreateOrReplace](#logsloggroups_createorreplace) +- [Delete](#logsloggroups_delete) +- [GetByResourceGroup](#logsloggroups_getbyresourcegroup) +- [List](#logsloggroups_list) +- [ListByResourceGroup](#logsloggroups_listbyresourcegroup) +- [Update](#logsloggroups_update) + +## LogsLogStreams + +- [CreateOrReplace](#logslogstreams_createorreplace) +- [Delete](#logslogstreams_delete) +- [GetByResourceGroup](#logslogstreams_getbyresourcegroup) +- [List](#logslogstreams_list) +- [ListByResourceGroup](#logslogstreams_listbyresourcegroup) +- [Update](#logslogstreams_update) + +## LogsMetricFilters + +- [CreateOrReplace](#logsmetricfilters_createorreplace) +- [Delete](#logsmetricfilters_delete) +- [GetByResourceGroup](#logsmetricfilters_getbyresourcegroup) +- [List](#logsmetricfilters_list) +- [ListByResourceGroup](#logsmetricfilters_listbyresourcegroup) +- [Update](#logsmetricfilters_update) + +## LogsSubscriptionFilters + +- [CreateOrReplace](#logssubscriptionfilters_createorreplace) +- [Delete](#logssubscriptionfilters_delete) +- [GetByResourceGroup](#logssubscriptionfilters_getbyresourcegroup) +- [List](#logssubscriptionfilters_list) +- [ListByResourceGroup](#logssubscriptionfilters_listbyresourcegroup) +- [Update](#logssubscriptionfilters_update) + +## Macie2JobSummaries + +- [CreateOrReplace](#macie2jobsummaries_createorreplace) +- [Delete](#macie2jobsummaries_delete) +- [GetByResourceGroup](#macie2jobsummaries_getbyresourcegroup) +- [List](#macie2jobsummaries_list) +- [ListByResourceGroup](#macie2jobsummaries_listbyresourcegroup) +- [Update](#macie2jobsummaries_update) + +## MacieAllowLists + +- [CreateOrReplace](#macieallowlists_createorreplace) +- [Delete](#macieallowlists_delete) +- [GetByResourceGroup](#macieallowlists_getbyresourcegroup) +- [List](#macieallowlists_list) +- [ListByResourceGroup](#macieallowlists_listbyresourcegroup) +- [Update](#macieallowlists_update) + +## NetworkFirewallFirewallPolicies + +- [CreateOrReplace](#networkfirewallfirewallpolicies_createorreplace) +- [Delete](#networkfirewallfirewallpolicies_delete) +- [GetByResourceGroup](#networkfirewallfirewallpolicies_getbyresourcegroup) +- [List](#networkfirewallfirewallpolicies_list) +- [ListByResourceGroup](#networkfirewallfirewallpolicies_listbyresourcegroup) +- [Update](#networkfirewallfirewallpolicies_update) + +## NetworkFirewallFirewalls + +- [CreateOrReplace](#networkfirewallfirewalls_createorreplace) +- [Delete](#networkfirewallfirewalls_delete) +- [GetByResourceGroup](#networkfirewallfirewalls_getbyresourcegroup) +- [List](#networkfirewallfirewalls_list) +- [ListByResourceGroup](#networkfirewallfirewalls_listbyresourcegroup) +- [Update](#networkfirewallfirewalls_update) + +## NetworkFirewallRuleGroups + +- [CreateOrReplace](#networkfirewallrulegroups_createorreplace) +- [Delete](#networkfirewallrulegroups_delete) +- [GetByResourceGroup](#networkfirewallrulegroups_getbyresourcegroup) +- [List](#networkfirewallrulegroups_list) +- [ListByResourceGroup](#networkfirewallrulegroups_listbyresourcegroup) +- [Update](#networkfirewallrulegroups_update) + +## OpenSearchDomainStatuses + +- [CreateOrReplace](#opensearchdomainstatuses_createorreplace) +- [Delete](#opensearchdomainstatuses_delete) +- [GetByResourceGroup](#opensearchdomainstatuses_getbyresourcegroup) +- [List](#opensearchdomainstatuses_list) +- [ListByResourceGroup](#opensearchdomainstatuses_listbyresourcegroup) +- [Update](#opensearchdomainstatuses_update) + +## Operations + +- [List](#operations_list) + +## OrganizationsAccounts + +- [CreateOrReplace](#organizationsaccounts_createorreplace) +- [Delete](#organizationsaccounts_delete) +- [GetByResourceGroup](#organizationsaccounts_getbyresourcegroup) +- [List](#organizationsaccounts_list) +- [ListByResourceGroup](#organizationsaccounts_listbyresourcegroup) +- [Update](#organizationsaccounts_update) + +## OrganizationsOrganizations + +- [CreateOrReplace](#organizationsorganizations_createorreplace) +- [Delete](#organizationsorganizations_delete) +- [GetByResourceGroup](#organizationsorganizations_getbyresourcegroup) +- [List](#organizationsorganizations_list) +- [ListByResourceGroup](#organizationsorganizations_listbyresourcegroup) +- [Update](#organizationsorganizations_update) + +## RdsDbClusters + +- [CreateOrReplace](#rdsdbclusters_createorreplace) +- [Delete](#rdsdbclusters_delete) +- [GetByResourceGroup](#rdsdbclusters_getbyresourcegroup) +- [List](#rdsdbclusters_list) +- [ListByResourceGroup](#rdsdbclusters_listbyresourcegroup) +- [Update](#rdsdbclusters_update) + +## RdsDbInstances + +- [CreateOrReplace](#rdsdbinstances_createorreplace) +- [Delete](#rdsdbinstances_delete) +- [GetByResourceGroup](#rdsdbinstances_getbyresourcegroup) +- [List](#rdsdbinstances_list) +- [ListByResourceGroup](#rdsdbinstances_listbyresourcegroup) +- [Update](#rdsdbinstances_update) + +## RdsDbSnapshotAttributesResults + +- [CreateOrReplace](#rdsdbsnapshotattributesresults_createorreplace) +- [Delete](#rdsdbsnapshotattributesresults_delete) +- [GetByResourceGroup](#rdsdbsnapshotattributesresults_getbyresourcegroup) +- [List](#rdsdbsnapshotattributesresults_list) +- [ListByResourceGroup](#rdsdbsnapshotattributesresults_listbyresourcegroup) +- [Update](#rdsdbsnapshotattributesresults_update) + +## RdsDbSnapshots + +- [CreateOrReplace](#rdsdbsnapshots_createorreplace) +- [Delete](#rdsdbsnapshots_delete) +- [GetByResourceGroup](#rdsdbsnapshots_getbyresourcegroup) +- [List](#rdsdbsnapshots_list) +- [ListByResourceGroup](#rdsdbsnapshots_listbyresourcegroup) +- [Update](#rdsdbsnapshots_update) + +## RdsEventSubscriptions + +- [CreateOrReplace](#rdseventsubscriptions_createorreplace) +- [Delete](#rdseventsubscriptions_delete) +- [GetByResourceGroup](#rdseventsubscriptions_getbyresourcegroup) +- [List](#rdseventsubscriptions_list) +- [ListByResourceGroup](#rdseventsubscriptions_listbyresourcegroup) +- [Update](#rdseventsubscriptions_update) + +## RdsExportTasks + +- [CreateOrReplace](#rdsexporttasks_createorreplace) +- [Delete](#rdsexporttasks_delete) +- [GetByResourceGroup](#rdsexporttasks_getbyresourcegroup) +- [List](#rdsexporttasks_list) +- [ListByResourceGroup](#rdsexporttasks_listbyresourcegroup) +- [Update](#rdsexporttasks_update) + +## RedshiftClusterParameterGroups + +- [CreateOrReplace](#redshiftclusterparametergroups_createorreplace) +- [Delete](#redshiftclusterparametergroups_delete) +- [GetByResourceGroup](#redshiftclusterparametergroups_getbyresourcegroup) +- [List](#redshiftclusterparametergroups_list) +- [ListByResourceGroup](#redshiftclusterparametergroups_listbyresourcegroup) +- [Update](#redshiftclusterparametergroups_update) + +## RedshiftClusters + +- [CreateOrReplace](#redshiftclusters_createorreplace) +- [Delete](#redshiftclusters_delete) +- [GetByResourceGroup](#redshiftclusters_getbyresourcegroup) +- [List](#redshiftclusters_list) +- [ListByResourceGroup](#redshiftclusters_listbyresourcegroup) +- [Update](#redshiftclusters_update) + +## Route53DomainsDomainSummaries + +- [CreateOrReplace](#route53domainsdomainsummaries_createorreplace) +- [Delete](#route53domainsdomainsummaries_delete) +- [GetByResourceGroup](#route53domainsdomainsummaries_getbyresourcegroup) +- [List](#route53domainsdomainsummaries_list) +- [ListByResourceGroup](#route53domainsdomainsummaries_listbyresourcegroup) +- [Update](#route53domainsdomainsummaries_update) + +## Route53HostedZones + +- [CreateOrReplace](#route53hostedzones_createorreplace) +- [Delete](#route53hostedzones_delete) +- [GetByResourceGroup](#route53hostedzones_getbyresourcegroup) +- [List](#route53hostedzones_list) +- [ListByResourceGroup](#route53hostedzones_listbyresourcegroup) +- [Update](#route53hostedzones_update) + +## Route53ResourceRecordSets + +- [CreateOrReplace](#route53resourcerecordsets_createorreplace) +- [Delete](#route53resourcerecordsets_delete) +- [GetByResourceGroup](#route53resourcerecordsets_getbyresourcegroup) +- [List](#route53resourcerecordsets_list) +- [ListByResourceGroup](#route53resourcerecordsets_listbyresourcegroup) +- [Update](#route53resourcerecordsets_update) + +## S3AccessPoints + +- [CreateOrReplace](#s3accesspoints_createorreplace) +- [Delete](#s3accesspoints_delete) +- [GetByResourceGroup](#s3accesspoints_getbyresourcegroup) +- [List](#s3accesspoints_list) +- [ListByResourceGroup](#s3accesspoints_listbyresourcegroup) +- [Update](#s3accesspoints_update) + +## S3BucketPolicies + +- [CreateOrReplace](#s3bucketpolicies_createorreplace) +- [Delete](#s3bucketpolicies_delete) +- [GetByResourceGroup](#s3bucketpolicies_getbyresourcegroup) +- [List](#s3bucketpolicies_list) +- [ListByResourceGroup](#s3bucketpolicies_listbyresourcegroup) +- [Update](#s3bucketpolicies_update) + +## S3Buckets + +- [CreateOrReplace](#s3buckets_createorreplace) +- [Delete](#s3buckets_delete) +- [GetByResourceGroup](#s3buckets_getbyresourcegroup) +- [List](#s3buckets_list) +- [ListByResourceGroup](#s3buckets_listbyresourcegroup) +- [Update](#s3buckets_update) + +## S3ControlMultiRegionAccessPointPolicyDocuments + +- [CreateOrReplace](#s3controlmultiregionaccesspointpolicydocuments_createorreplace) +- [Delete](#s3controlmultiregionaccesspointpolicydocuments_delete) +- [GetByResourceGroup](#s3controlmultiregionaccesspointpolicydocuments_getbyresourcegroup) +- [List](#s3controlmultiregionaccesspointpolicydocuments_list) +- [ListByResourceGroup](#s3controlmultiregionaccesspointpolicydocuments_listbyresourcegroup) +- [Update](#s3controlmultiregionaccesspointpolicydocuments_update) + +## SageMakerApps + +- [CreateOrReplace](#sagemakerapps_createorreplace) +- [Delete](#sagemakerapps_delete) +- [GetByResourceGroup](#sagemakerapps_getbyresourcegroup) +- [List](#sagemakerapps_list) +- [ListByResourceGroup](#sagemakerapps_listbyresourcegroup) +- [Update](#sagemakerapps_update) + +## SageMakerNotebookInstanceSummaries + +- [CreateOrReplace](#sagemakernotebookinstancesummaries_createorreplace) +- [Delete](#sagemakernotebookinstancesummaries_delete) +- [GetByResourceGroup](#sagemakernotebookinstancesummaries_getbyresourcegroup) +- [List](#sagemakernotebookinstancesummaries_list) +- [ListByResourceGroup](#sagemakernotebookinstancesummaries_listbyresourcegroup) +- [Update](#sagemakernotebookinstancesummaries_update) + +## SecretsManagerResourcePolicies + +- [CreateOrReplace](#secretsmanagerresourcepolicies_createorreplace) +- [Delete](#secretsmanagerresourcepolicies_delete) +- [GetByResourceGroup](#secretsmanagerresourcepolicies_getbyresourcegroup) +- [List](#secretsmanagerresourcepolicies_list) +- [ListByResourceGroup](#secretsmanagerresourcepolicies_listbyresourcegroup) +- [Update](#secretsmanagerresourcepolicies_update) + +## SecretsManagerSecrets + +- [CreateOrReplace](#secretsmanagersecrets_createorreplace) +- [Delete](#secretsmanagersecrets_delete) +- [GetByResourceGroup](#secretsmanagersecrets_getbyresourcegroup) +- [List](#secretsmanagersecrets_list) +- [ListByResourceGroup](#secretsmanagersecrets_listbyresourcegroup) +- [Update](#secretsmanagersecrets_update) + +## SnsSubscriptions + +- [CreateOrReplace](#snssubscriptions_createorreplace) +- [Delete](#snssubscriptions_delete) +- [GetByResourceGroup](#snssubscriptions_getbyresourcegroup) +- [List](#snssubscriptions_list) +- [ListByResourceGroup](#snssubscriptions_listbyresourcegroup) +- [Update](#snssubscriptions_update) + +## SnsTopics + +- [CreateOrReplace](#snstopics_createorreplace) +- [Delete](#snstopics_delete) +- [GetByResourceGroup](#snstopics_getbyresourcegroup) +- [List](#snstopics_list) +- [ListByResourceGroup](#snstopics_listbyresourcegroup) +- [Update](#snstopics_update) + +## SqsQueues + +- [CreateOrReplace](#sqsqueues_createorreplace) +- [Delete](#sqsqueues_delete) +- [GetByResourceGroup](#sqsqueues_getbyresourcegroup) +- [List](#sqsqueues_list) +- [ListByResourceGroup](#sqsqueues_listbyresourcegroup) +- [Update](#sqsqueues_update) + +## SsmInstanceInformations + +- [CreateOrReplace](#ssminstanceinformations_createorreplace) +- [Delete](#ssminstanceinformations_delete) +- [GetByResourceGroup](#ssminstanceinformations_getbyresourcegroup) +- [List](#ssminstanceinformations_list) +- [ListByResourceGroup](#ssminstanceinformations_listbyresourcegroup) +- [Update](#ssminstanceinformations_update) + +## SsmParameters + +- [CreateOrReplace](#ssmparameters_createorreplace) +- [Delete](#ssmparameters_delete) +- [GetByResourceGroup](#ssmparameters_getbyresourcegroup) +- [List](#ssmparameters_list) +- [ListByResourceGroup](#ssmparameters_listbyresourcegroup) +- [Update](#ssmparameters_update) + +## SsmResourceComplianceSummaryItems + +- [CreateOrReplace](#ssmresourcecompliancesummaryitems_createorreplace) +- [Delete](#ssmresourcecompliancesummaryitems_delete) +- [GetByResourceGroup](#ssmresourcecompliancesummaryitems_getbyresourcegroup) +- [List](#ssmresourcecompliancesummaryitems_list) +- [ListByResourceGroup](#ssmresourcecompliancesummaryitems_listbyresourcegroup) +- [Update](#ssmresourcecompliancesummaryitems_update) + +## WafWebAclSummaries + +- [CreateOrReplace](#wafwebaclsummaries_createorreplace) +- [Delete](#wafwebaclsummaries_delete) +- [GetByResourceGroup](#wafwebaclsummaries_getbyresourcegroup) +- [List](#wafwebaclsummaries_list) +- [ListByResourceGroup](#wafwebaclsummaries_listbyresourcegroup) +- [Update](#wafwebaclsummaries_update) + +## Wafv2LoggingConfigurations + +- [CreateOrReplace](#wafv2loggingconfigurations_createorreplace) +- [Delete](#wafv2loggingconfigurations_delete) +- [GetByResourceGroup](#wafv2loggingconfigurations_getbyresourcegroup) +- [List](#wafv2loggingconfigurations_list) +- [ListByResourceGroup](#wafv2loggingconfigurations_listbyresourcegroup) +- [Update](#wafv2loggingconfigurations_update) +### AccessAnalyzerAnalyzers_CreateOrReplace + +```java +import com.azure.resourcemanager.awsconnector.models.AccessAnalyzerProperties; +import com.azure.resourcemanager.awsconnector.models.ArchiveRule; +import com.azure.resourcemanager.awsconnector.models.AwsAccessAnalyzerProperties; +import com.azure.resourcemanager.awsconnector.models.Filter; +import com.azure.resourcemanager.awsconnector.models.Tag; +import com.azure.resourcemanager.awsconnector.models.UnusedAccessConfiguration; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for AccessAnalyzerAnalyzers CreateOrReplace. + */ +public final class AccessAnalyzerAnalyzersCreateOrReplaceSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * AccessAnalyzerAnalyzers_CreateOrReplace.json + */ + /** + * Sample code: AccessAnalyzerAnalyzers_CreateOrReplace. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + accessAnalyzerAnalyzersCreateOrReplace(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.accessAnalyzerAnalyzers() + .define("Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])") + .withRegion("jpcbvhsspnqhnreartkjyr") + .withExistingResourceGroup("rgaccessAnalyzerAnalyzer") + .withTags(mapOf("key5531", "fakeTokenPlaceholder")) + .withProperties( + new AccessAnalyzerProperties() + .withAwsProperties( + new AwsAccessAnalyzerProperties() + .withAnalyzerConfiguration(new UnusedAccessConfiguration().withUnusedAccessAge(29)) + .withAnalyzerName("owom") + .withArchiveRules( + Arrays.asList(new ArchiveRule() + .withFilter(Arrays.asList(new Filter().withContains(Arrays.asList("hpzoliradchznu")) + .withEq(Arrays.asList("vlrqwrfkkwxvyxmqpbmwkxig")) + .withExists(true) + .withNeq(Arrays.asList("ro")) + .withProperty("pzndukmteempygtvmsrcrjulphe"))) + .withRuleName("hvfnklcbuefkibrtayx"))) + .withArn("bmt") + .withTags(Arrays + .asList(new Tag().withKey("fakeTokenPlaceholder").withValue("mtcjrbabaynnrmqttjf"))) + .withType("vswmvhmkyxepqkvvksbglssmrgg")) + .withPublicCloudConnectorsResourceId("qfefhuzrkvg") + .withAwsAccountId("pvsawejgihtmvcjqnob") + .withArn("dgzbebaorvepu") + .withPublicCloudResourceName("euuddejz") + .withAwsSourceSchema("ur") + .withAwsRegion("edosnsqdwcvgl") + .withAwsTags(mapOf("key746", "fakeTokenPlaceholder"))) + .create(); + } + + // Use "Map.of" if available + @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; + } +} +``` + +### AccessAnalyzerAnalyzers_Delete + +```java +/** + * Samples for AccessAnalyzerAnalyzers Delete. + */ +public final class AccessAnalyzerAnalyzersDeleteSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * AccessAnalyzerAnalyzers_Delete.json + */ + /** + * Sample code: AccessAnalyzerAnalyzers_Delete. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + accessAnalyzerAnalyzersDelete(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.accessAnalyzerAnalyzers() + .delete("rgaccessAnalyzerAnalyzer", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE); + } +} +``` + +### AccessAnalyzerAnalyzers_GetByResourceGroup + +```java +/** + * Samples for AccessAnalyzerAnalyzers GetByResourceGroup. + */ +public final class AccessAnalyzerAnalyzersGetByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * AccessAnalyzerAnalyzers_Get.json + */ + /** + * Sample code: AccessAnalyzerAnalyzers_Get. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void accessAnalyzerAnalyzersGet(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.accessAnalyzerAnalyzers() + .getByResourceGroupWithResponse("rgaccessAnalyzerAnalyzer", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE); + } +} +``` + +### AccessAnalyzerAnalyzers_List + +```java +/** + * Samples for AccessAnalyzerAnalyzers List. + */ +public final class AccessAnalyzerAnalyzersListSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * AccessAnalyzerAnalyzers_ListBySubscription.json + */ + /** + * Sample code: AccessAnalyzerAnalyzers_ListBySubscription. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + accessAnalyzerAnalyzersListBySubscription(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.accessAnalyzerAnalyzers().list(com.azure.core.util.Context.NONE); + } +} +``` + +### AccessAnalyzerAnalyzers_ListByResourceGroup + +```java +/** + * Samples for AccessAnalyzerAnalyzers ListByResourceGroup. + */ +public final class AccessAnalyzerAnalyzersListByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * AccessAnalyzerAnalyzers_ListByResourceGroup.json + */ + /** + * Sample code: AccessAnalyzerAnalyzers_ListByResourceGroup. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + accessAnalyzerAnalyzersListByResourceGroup(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.accessAnalyzerAnalyzers() + .listByResourceGroup("rgaccessAnalyzerAnalyzer", com.azure.core.util.Context.NONE); + } +} +``` + +### AccessAnalyzerAnalyzers_Update + +```java +import com.azure.resourcemanager.awsconnector.models.AccessAnalyzer; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for AccessAnalyzerAnalyzers Update. + */ +public final class AccessAnalyzerAnalyzersUpdateSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * AccessAnalyzerAnalyzers_Update.json + */ + /** + * Sample code: AccessAnalyzerAnalyzers_Update. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + accessAnalyzerAnalyzersUpdate(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + AccessAnalyzer resource = manager.accessAnalyzerAnalyzers() + .getByResourceGroupWithResponse("rgaccessAnalyzerAnalyzer", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE) + .getValue(); + resource.update().withTags(mapOf("key1003", "fakeTokenPlaceholder")).apply(); + } + + // Use "Map.of" if available + @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; + } +} +``` + +### AcmCertificateSummaries_CreateOrReplace + +```java +import com.azure.resourcemanager.awsconnector.models.AcmCertificateSummaryProperties; +import com.azure.resourcemanager.awsconnector.models.AwsAcmCertificateSummaryProperties; +import com.azure.resourcemanager.awsconnector.models.CertificateStatus; +import com.azure.resourcemanager.awsconnector.models.CertificateStatusEnumValue; +import com.azure.resourcemanager.awsconnector.models.CertificateType; +import com.azure.resourcemanager.awsconnector.models.CertificateTypeEnumValue; +import com.azure.resourcemanager.awsconnector.models.ExtendedKeyUsageName; +import com.azure.resourcemanager.awsconnector.models.KeyAlgorithm; +import com.azure.resourcemanager.awsconnector.models.KeyAlgorithmEnumValue; +import com.azure.resourcemanager.awsconnector.models.KeyUsageName; +import com.azure.resourcemanager.awsconnector.models.RenewalEligibility; +import com.azure.resourcemanager.awsconnector.models.RenewalEligibilityEnumValue; +import java.time.OffsetDateTime; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for AcmCertificateSummaries CreateOrReplace. + */ +public final class AcmCertificateSummariesCreateOrReplaceSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * AcmCertificateSummaries_CreateOrReplace.json + */ + /** + * Sample code: AcmCertificateSummaries_CreateOrReplace. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + acmCertificateSummariesCreateOrReplace(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.acmCertificateSummaries() + .define("Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])") + .withRegion("eqfgreyihqzkrcyaxvy") + .withExistingResourceGroup("rgacmCertificateSummary") + .withTags(mapOf("key9243", "fakeTokenPlaceholder")) + .withProperties( + new AcmCertificateSummaryProperties() + .withAwsProperties( + new AwsAcmCertificateSummaryProperties().withCertificateArn("vhqvrajxbcvstwiktrdilktqiwnsij") + .withCreatedAt(OffsetDateTime.parse("2024-10-08T03:50:37.721Z")) + .withDomainName("fiqx") + .withExported(true) + .withExtendedKeyUsages(Arrays.asList(ExtendedKeyUsageName.ANY)) + .withHasAdditionalSubjectAlternativeNames(true) + .withImportedAt(OffsetDateTime.parse("2024-10-08T03:50:37.721Z")) + .withInUse(true) + .withIssuedAt(OffsetDateTime.parse("2024-10-08T03:50:37.721Z")) + .withKeyAlgorithm(new KeyAlgorithmEnumValue().withValue(KeyAlgorithm.EC_PRIME256V1)) + .withKeyUsages(Arrays.asList(KeyUsageName.ANY)) + .withNotAfter(OffsetDateTime.parse("2024-10-08T03:50:37.721Z")) + .withNotBefore(OffsetDateTime.parse("2024-10-08T03:50:37.721Z")) + .withRenewalEligibility( + new RenewalEligibilityEnumValue().withValue(RenewalEligibility.ELIGIBLE)) + .withRevokedAt(OffsetDateTime.parse("2024-10-08T03:50:37.722Z")) + .withStatus(new CertificateStatusEnumValue().withValue(CertificateStatus.EXPIRED)) + .withSubjectAlternativeNameSummaries(Arrays.asList("oqoukflpt")) + .withType(new CertificateTypeEnumValue().withValue(CertificateType.AMAZON_ISSUED))) + .withPublicCloudConnectorsResourceId("xljncqoovqhqla") + .withAwsAccountId("mmihqxcdhmlvxmnbgspuxddg") + .withArn("smalkenxqfohwtuwomvsiijg") + .withPublicCloudResourceName("qdwfldkrmzyifdlfjpxducgue") + .withAwsSourceSchema("llzijlhflcpnbwpp") + .withAwsRegion("vkxrwhsmzwvxzraytkujjlrzxdpbz") + .withAwsTags(mapOf("key6233", "fakeTokenPlaceholder"))) + .create(); + } + + // Use "Map.of" if available + @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; + } +} +``` + +### AcmCertificateSummaries_Delete + +```java +/** + * Samples for AcmCertificateSummaries Delete. + */ +public final class AcmCertificateSummariesDeleteSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * AcmCertificateSummaries_Delete.json + */ + /** + * Sample code: AcmCertificateSummaries_Delete. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + acmCertificateSummariesDelete(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.acmCertificateSummaries() + .delete("rgacmCertificateSummary", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE); + } +} +``` + +### AcmCertificateSummaries_GetByResourceGroup + +```java +/** + * Samples for AcmCertificateSummaries GetByResourceGroup. + */ +public final class AcmCertificateSummariesGetByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * AcmCertificateSummaries_Get.json + */ + /** + * Sample code: AcmCertificateSummaries_Get. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void acmCertificateSummariesGet(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.acmCertificateSummaries() + .getByResourceGroupWithResponse("rgacmCertificateSummary", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE); + } +} +``` + +### AcmCertificateSummaries_List + +```java +/** + * Samples for AcmCertificateSummaries List. + */ +public final class AcmCertificateSummariesListSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * AcmCertificateSummaries_ListBySubscription.json + */ + /** + * Sample code: AcmCertificateSummaries_ListBySubscription. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + acmCertificateSummariesListBySubscription(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.acmCertificateSummaries().list(com.azure.core.util.Context.NONE); + } +} +``` + +### AcmCertificateSummaries_ListByResourceGroup + +```java +/** + * Samples for AcmCertificateSummaries ListByResourceGroup. + */ +public final class AcmCertificateSummariesListByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * AcmCertificateSummaries_ListByResourceGroup.json + */ + /** + * Sample code: AcmCertificateSummaries_ListByResourceGroup. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + acmCertificateSummariesListByResourceGroup(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.acmCertificateSummaries() + .listByResourceGroup("rgacmCertificateSummary", com.azure.core.util.Context.NONE); + } +} +``` + +### AcmCertificateSummaries_Update + +```java +import com.azure.resourcemanager.awsconnector.models.AcmCertificateSummary; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for AcmCertificateSummaries Update. + */ +public final class AcmCertificateSummariesUpdateSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * AcmCertificateSummaries_Update.json + */ + /** + * Sample code: AcmCertificateSummaries_Update. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + acmCertificateSummariesUpdate(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + AcmCertificateSummary resource = manager.acmCertificateSummaries() + .getByResourceGroupWithResponse("rgacmCertificateSummary", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE) + .getValue(); + resource.update().withTags(mapOf("key3895", "fakeTokenPlaceholder")).apply(); + } + + // Use "Map.of" if available + @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; + } +} +``` + +### ApiGatewayRestApis_CreateOrReplace + +```java +import com.azure.resourcemanager.awsconnector.models.ApiGatewayRestApiProperties; +import com.azure.resourcemanager.awsconnector.models.AwsApiGatewayRestApiProperties; +import com.azure.resourcemanager.awsconnector.models.EndpointConfiguration; +import com.azure.resourcemanager.awsconnector.models.S3Location; +import com.azure.resourcemanager.awsconnector.models.TagAutoGenerated; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for ApiGatewayRestApis CreateOrReplace. + */ +public final class ApiGatewayRestApisCreateOrReplaceSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * ApiGatewayRestApis_CreateOrReplace.json + */ + /** + * Sample code: ApiGatewayRestApis_CreateOrReplace. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + apiGatewayRestApisCreateOrReplace(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.apiGatewayRestApis() + .define("Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])") + .withRegion("lvqczthlir") + .withExistingResourceGroup("rgapiGatewayRestApi") + .withTags(mapOf("key4163", "fakeTokenPlaceholder")) + .withProperties( + new ApiGatewayRestApiProperties() + .withAwsProperties(new AwsApiGatewayRestApiProperties().withApiKeySourceType("fakeTokenPlaceholder") + .withBinaryMediaTypes(Arrays.asList("ahebgkheozatj")) + .withBody(mapOf()) + .withBodyS3Location(new S3Location().withBucket("oyosqpl") + .withEtag("uuzlkbqlua") + .withKey("fakeTokenPlaceholder") + .withVersion("lxbmxdrsftqwazmgxlokuvf")) + .withCloneFrom("boxfqilij") + .withDescription("ngqhnoniiohuwofr") + .withDisableExecuteApiEndpoint(true) + .withEndpointConfiguration( + new EndpointConfiguration().withTypes(Arrays.asList("dfhdcsvbasfadeuneaz")) + .withVpcEndpointIds(Arrays.asList("evzbafcpdpklwppge"))) + .withFailOnWarnings(true) + .withMinimumCompressionSize(11) + .withMode("odjmjlcgkmskasrasoegyxnuqr") + .withName("ioyxag") + .withParameters(mapOf("key9886", "fakeTokenPlaceholder")) + .withPolicy("jefpbspvgtinulqfyjxuxcunzkpgvw") + .withRestApiId("hlyfcdcgknhbjezdxgbg") + .withRootResourceId("jfmgp") + .withTags(Arrays + .asList(new TagAutoGenerated().withKey("fakeTokenPlaceholder").withValue("uozcrgrc")))) + .withPublicCloudConnectorsResourceId("diszsfnljduoshvzzgcyypsjnxs") + .withAwsAccountId("qjcvyhdegwhvzsiuqjwnvdqs") + .withArn("mjkvrfpgenxbfozh") + .withPublicCloudResourceName("tvtpphxonsvnvtmccbpcsvvvslbxxc") + .withAwsSourceSchema("oagqktjiz") + .withAwsRegion("bzj") + .withAwsTags(mapOf("key5478", "fakeTokenPlaceholder"))) + .create(); + } + + // Use "Map.of" if available + @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; + } +} +``` + +### ApiGatewayRestApis_Delete + +```java +/** + * Samples for ApiGatewayRestApis Delete. + */ +public final class ApiGatewayRestApisDeleteSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * ApiGatewayRestApis_Delete.json + */ + /** + * Sample code: ApiGatewayRestApis_Delete. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void apiGatewayRestApisDelete(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.apiGatewayRestApis() + .delete("rgapiGatewayRestApi", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE); + } +} +``` + +### ApiGatewayRestApis_GetByResourceGroup + +```java +/** + * Samples for ApiGatewayRestApis GetByResourceGroup. + */ +public final class ApiGatewayRestApisGetByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * ApiGatewayRestApis_Get.json + */ + /** + * Sample code: ApiGatewayRestApis_Get. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void apiGatewayRestApisGet(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.apiGatewayRestApis() + .getByResourceGroupWithResponse("rgapiGatewayRestApi", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE); + } +} +``` + +### ApiGatewayRestApis_List + +```java +/** + * Samples for ApiGatewayRestApis List. + */ +public final class ApiGatewayRestApisListSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * ApiGatewayRestApis_ListBySubscription.json + */ + /** + * Sample code: ApiGatewayRestApis_ListBySubscription. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + apiGatewayRestApisListBySubscription(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.apiGatewayRestApis().list(com.azure.core.util.Context.NONE); + } +} +``` + +### ApiGatewayRestApis_ListByResourceGroup + +```java +/** + * Samples for ApiGatewayRestApis ListByResourceGroup. + */ +public final class ApiGatewayRestApisListByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * ApiGatewayRestApis_ListByResourceGroup.json + */ + /** + * Sample code: ApiGatewayRestApis_ListByResourceGroup. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + apiGatewayRestApisListByResourceGroup(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.apiGatewayRestApis().listByResourceGroup("rgapiGatewayRestApi", com.azure.core.util.Context.NONE); + } +} +``` + +### ApiGatewayRestApis_Update + +```java +import com.azure.resourcemanager.awsconnector.models.ApiGatewayRestApi; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for ApiGatewayRestApis Update. + */ +public final class ApiGatewayRestApisUpdateSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * ApiGatewayRestApis_Update.json + */ + /** + * Sample code: ApiGatewayRestApis_Update. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void apiGatewayRestApisUpdate(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + ApiGatewayRestApi resource = manager.apiGatewayRestApis() + .getByResourceGroupWithResponse("rgapiGatewayRestApi", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE) + .getValue(); + resource.update().withTags(mapOf("key2677", "fakeTokenPlaceholder")).apply(); + } + + // Use "Map.of" if available + @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; + } +} +``` + +### ApiGatewayStages_CreateOrReplace + +```java +import com.azure.resourcemanager.awsconnector.models.AccessLogSetting; +import com.azure.resourcemanager.awsconnector.models.ApiGatewayStageProperties; +import com.azure.resourcemanager.awsconnector.models.AwsApiGatewayStageProperties; +import com.azure.resourcemanager.awsconnector.models.CanarySetting; +import com.azure.resourcemanager.awsconnector.models.MethodSetting; +import com.azure.resourcemanager.awsconnector.models.TagAutoGenerated2; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for ApiGatewayStages CreateOrReplace. + */ +public final class ApiGatewayStagesCreateOrReplaceSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * ApiGatewayStages_CreateOrReplace.json + */ + /** + * Sample code: ApiGatewayStages_CreateOrReplace. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + apiGatewayStagesCreateOrReplace(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.apiGatewayStages() + .define("Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])") + .withRegion("ixsfvcwygoceaaydsgkvubn") + .withExistingResourceGroup("rgapiGatewayStage") + .withTags(mapOf("key72", "fakeTokenPlaceholder")) + .withProperties(new ApiGatewayStageProperties() + .withAwsProperties(new AwsApiGatewayStageProperties() + .withAccessLogSetting( + new AccessLogSetting().withDestinationArn("bjnehkhrjvy").withFormat("jyhhqidjew")) + .withCacheClusterEnabled(true) + .withCacheClusterSize("tqpsxptkwagykhry") + .withCanarySetting(new CanarySetting().withDeploymentId("jgfflpjviovk") + .withPercentTraffic(30) + .withStageVariableOverrides(mapOf("key989", "fakeTokenPlaceholder")) + .withUseStageCache(true)) + .withClientCertificateId("lcqbeactfdarpess") + .withDeploymentId("muwatddsfb") + .withDescription("dmxblpsncciutbbmfihkloqaxuab") + .withDocumentationVersion("fltvrg") + .withMethodSettings(Arrays.asList(new MethodSetting().withCacheDataEncrypted(true) + .withCacheTtlInSeconds(15) + .withCachingEnabled(true) + .withDataTraceEnabled(true) + .withHttpMethod("wojjxwrlnmnertmfkstofcoekjxd") + .withLoggingLevel("cezcwkojlmp") + .withMetricsEnabled(true) + .withResourcePath("fsaykfuxsfvultpnnpjjbak") + .withThrottlingBurstLimit(3) + .withThrottlingRateLimit(28))) + .withRestApiId("cycztypxndrdmstjwi") + .withStageName("iukgreicaikhlooycykkql") + .withTags(Arrays.asList(new TagAutoGenerated2().withKey("fakeTokenPlaceholder").withValue("x"))) + .withTracingEnabled(true) + .withVariables(mapOf("key3007", "fakeTokenPlaceholder"))) + .withPublicCloudConnectorsResourceId("mvvltlx") + .withAwsAccountId("umvnhbnjqbgppgipyiuxvyt") + .withArn("aitrzss") + .withPublicCloudResourceName("hxgdpqw") + .withAwsSourceSchema("ttwdzidmknfow") + .withAwsRegion("qkjxqupbneeuooyrfnblmwlrpmjsiu") + .withAwsTags(mapOf("key1607", "fakeTokenPlaceholder"))) + .create(); + } + + // Use "Map.of" if available + @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; + } +} +``` + +### ApiGatewayStages_Delete + +```java +/** + * Samples for ApiGatewayStages Delete. + */ +public final class ApiGatewayStagesDeleteSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * ApiGatewayStages_Delete.json + */ + /** + * Sample code: ApiGatewayStages_Delete. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void apiGatewayStagesDelete(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.apiGatewayStages() + .delete("rgapiGatewayStage", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE); + } +} +``` + +### ApiGatewayStages_GetByResourceGroup + +```java +/** + * Samples for ApiGatewayStages GetByResourceGroup. + */ +public final class ApiGatewayStagesGetByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * ApiGatewayStages_Get.json + */ + /** + * Sample code: ApiGatewayStages_Get. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void apiGatewayStagesGet(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.apiGatewayStages() + .getByResourceGroupWithResponse("rgapiGatewayStage", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE); + } +} +``` + +### ApiGatewayStages_List + +```java +/** + * Samples for ApiGatewayStages List. + */ +public final class ApiGatewayStagesListSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * ApiGatewayStages_ListBySubscription.json + */ + /** + * Sample code: ApiGatewayStages_ListBySubscription. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + apiGatewayStagesListBySubscription(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.apiGatewayStages().list(com.azure.core.util.Context.NONE); + } +} +``` + +### ApiGatewayStages_ListByResourceGroup + +```java +/** + * Samples for ApiGatewayStages ListByResourceGroup. + */ +public final class ApiGatewayStagesListByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * ApiGatewayStages_ListByResourceGroup.json + */ + /** + * Sample code: ApiGatewayStages_ListByResourceGroup. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + apiGatewayStagesListByResourceGroup(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.apiGatewayStages().listByResourceGroup("rgapiGatewayStage", com.azure.core.util.Context.NONE); + } +} +``` + +### ApiGatewayStages_Update + +```java +import com.azure.resourcemanager.awsconnector.models.ApiGatewayStage; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for ApiGatewayStages Update. + */ +public final class ApiGatewayStagesUpdateSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * ApiGatewayStages_Update.json + */ + /** + * Sample code: ApiGatewayStages_Update. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void apiGatewayStagesUpdate(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + ApiGatewayStage resource = manager.apiGatewayStages() + .getByResourceGroupWithResponse("rgapiGatewayStage", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE) + .getValue(); + resource.update().withTags(mapOf("key149", "fakeTokenPlaceholder")).apply(); + } + + // Use "Map.of" if available + @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; + } +} +``` + +### AppSyncGraphqlApis_CreateOrReplace + +```java +import com.azure.resourcemanager.awsconnector.models.AdditionalAuthenticationProvider; +import com.azure.resourcemanager.awsconnector.models.AppSyncGraphqlApiProperties; +import com.azure.resourcemanager.awsconnector.models.AuthenticationType; +import com.azure.resourcemanager.awsconnector.models.AuthenticationTypeEnumValue; +import com.azure.resourcemanager.awsconnector.models.AwsAppSyncGraphqlApiProperties; +import com.azure.resourcemanager.awsconnector.models.CognitoUserPoolConfig; +import com.azure.resourcemanager.awsconnector.models.DataSourceLevelMetricsBehavior; +import com.azure.resourcemanager.awsconnector.models.DataSourceLevelMetricsBehaviorEnumValue; +import com.azure.resourcemanager.awsconnector.models.DefaultAction; +import com.azure.resourcemanager.awsconnector.models.DefaultActionEnumValue; +import com.azure.resourcemanager.awsconnector.models.EnhancedMetricsConfig; +import com.azure.resourcemanager.awsconnector.models.FieldLogLevel; +import com.azure.resourcemanager.awsconnector.models.FieldLogLevelEnumValue; +import com.azure.resourcemanager.awsconnector.models.GraphQLApiIntrospectionConfig; +import com.azure.resourcemanager.awsconnector.models.GraphQLApiIntrospectionConfigEnumValue; +import com.azure.resourcemanager.awsconnector.models.GraphQLApiType; +import com.azure.resourcemanager.awsconnector.models.GraphQLApiTypeEnumValue; +import com.azure.resourcemanager.awsconnector.models.GraphQLApiVisibility; +import com.azure.resourcemanager.awsconnector.models.GraphQLApiVisibilityEnumValue; +import com.azure.resourcemanager.awsconnector.models.LambdaAuthorizerConfig; +import com.azure.resourcemanager.awsconnector.models.LogConfig; +import com.azure.resourcemanager.awsconnector.models.OpenIdConnectConfig; +import com.azure.resourcemanager.awsconnector.models.OperationLevelMetricsConfig; +import com.azure.resourcemanager.awsconnector.models.OperationLevelMetricsConfigEnumValue; +import com.azure.resourcemanager.awsconnector.models.ResolverLevelMetricsBehavior; +import com.azure.resourcemanager.awsconnector.models.ResolverLevelMetricsBehaviorEnumValue; +import com.azure.resourcemanager.awsconnector.models.UserPoolConfig; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for AppSyncGraphqlApis CreateOrReplace. + */ +public final class AppSyncGraphqlApisCreateOrReplaceSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * AppSyncGraphqlApis_CreateOrReplace.json + */ + /** + * Sample code: AppSyncGraphqlApis_CreateOrReplace. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + appSyncGraphqlApisCreateOrReplace(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.appSyncGraphqlApis() + .define("Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])") + .withRegion("fgdkdvbltlygm") + .withExistingResourceGroup("rgappSyncGraphqlApi") + .withTags(mapOf("key1836", "fakeTokenPlaceholder")) + .withProperties( + new AppSyncGraphqlApiProperties() + .withAwsProperties(new AwsAppSyncGraphqlApiProperties() + .withAdditionalAuthenticationProviders(Arrays.asList(new AdditionalAuthenticationProvider() + .withAuthenticationType(new AuthenticationTypeEnumValue() + .withValue(AuthenticationType.AMAZON_COGNITO_USER_POOLS)) + .withLambdaAuthorizerConfig( + new LambdaAuthorizerConfig().withAuthorizerResultTtlInSeconds(30) + .withAuthorizerUri("hupypfpuanzvftlniinspu") + .withIdentityValidationExpression("hspldtc")) + .withOpenIdConnectConfig(new OpenIdConnectConfig().withAuthTtl(22L) + .withClientId("luiqpcaoupuxlkhifmjmssaujivibq") + .withIatTtl(12L) + .withIssuer("gxglhkdfnvrrtsalksedpcukpk")) + .withUserPoolConfig(new CognitoUserPoolConfig().withAppIdClientRegex("qpfpcfsunn") + .withAwsRegion("nmpxe") + .withUserPoolId("jelygyotigqdtvomkxwllisaodzpme")))) + .withApiId("czvdzpkqmu") + .withApiType(new GraphQLApiTypeEnumValue().withValue(GraphQLApiType.GRAPHQL)) + .withArn("oasogwqjupaovgjaimqwyvcevu") + .withAuthenticationType( + new AuthenticationTypeEnumValue().withValue(AuthenticationType.AMAZON_COGNITO_USER_POOLS)) + .withDns(mapOf("key7870", "fakeTokenPlaceholder")) + .withEnhancedMetricsConfig(new EnhancedMetricsConfig() + .withDataSourceLevelMetricsBehavior(new DataSourceLevelMetricsBehaviorEnumValue() + .withValue(DataSourceLevelMetricsBehavior.FULL_REQUEST_DATA_SOURCE_METRICS)) + .withOperationLevelMetricsConfig(new OperationLevelMetricsConfigEnumValue() + .withValue(OperationLevelMetricsConfig.DISABLED)) + .withResolverLevelMetricsBehavior(new ResolverLevelMetricsBehaviorEnumValue() + .withValue(ResolverLevelMetricsBehavior.FULL_REQUEST_RESOLVER_METRICS))) + .withIntrospectionConfig(new GraphQLApiIntrospectionConfigEnumValue() + .withValue(GraphQLApiIntrospectionConfig.DISABLED)) + .withLambdaAuthorizerConfig(new LambdaAuthorizerConfig().withAuthorizerResultTtlInSeconds(30) + .withAuthorizerUri("hupypfpuanzvftlniinspu") + .withIdentityValidationExpression("hspldtc")) + .withLogConfig(new LogConfig().withCloudWatchLogsRoleArn("gsfpxvghd") + .withExcludeVerboseContent(true) + .withFieldLogLevel(new FieldLogLevelEnumValue().withValue(FieldLogLevel.ALL))) + .withMergedApiExecutionRoleArn("ehtdxecdhgxhmtqhpneaqzgdtivz") + .withName("ahvfu") + .withOpenIdConnectConfig(new OpenIdConnectConfig().withAuthTtl(22L) + .withClientId("luiqpcaoupuxlkhifmjmssaujivibq") + .withIatTtl(12L) + .withIssuer("gxglhkdfnvrrtsalksedpcukpk")) + .withOwner("pdudimkqozuoczxvlgmj") + .withOwnerContact("qkvw") + .withQueryDepthLimit(14) + .withResolverCountLimit(15) + .withTags(mapOf("key7170", "fakeTokenPlaceholder")) + .withUris(mapOf("key6507", "fakeTokenPlaceholder")) + .withUserPoolConfig(new UserPoolConfig().withAppIdClientRegex("kjfgmmyyzmsywex") + .withAwsRegion("knaq") + .withDefaultAction(new DefaultActionEnumValue().withValue(DefaultAction.ALLOW)) + .withUserPoolId("tbbntrreowxutvnasgmcdupsaxoooz")) + .withVisibility(new GraphQLApiVisibilityEnumValue().withValue(GraphQLApiVisibility.GLOBAL)) + .withWafWebAclArn("fpy") + .withXrayEnabled(true)) + .withPublicCloudConnectorsResourceId("ljxfphaevwpkqtymdowsbhw") + .withAwsAccountId("cbznxz") + .withArn("yozrofizgppbrqqingfk") + .withPublicCloudResourceName("xqnxjggrhseymoklvqpreiucveuev") + .withAwsSourceSchema("hldvwyk") + .withAwsRegion("ponyxnfudopabngrux") + .withAwsTags(mapOf("key8377", "fakeTokenPlaceholder"))) + .create(); + } + + // Use "Map.of" if available + @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; + } +} +``` + +### AppSyncGraphqlApis_Delete + +```java +/** + * Samples for AppSyncGraphqlApis Delete. + */ +public final class AppSyncGraphqlApisDeleteSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * AppSyncGraphqlApis_Delete.json + */ + /** + * Sample code: AppSyncGraphqlApis_Delete. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void appSyncGraphqlApisDelete(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.appSyncGraphqlApis() + .delete("rgappSyncGraphqlApi", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE); + } +} +``` + +### AppSyncGraphqlApis_GetByResourceGroup + +```java +/** + * Samples for AppSyncGraphqlApis GetByResourceGroup. + */ +public final class AppSyncGraphqlApisGetByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * AppSyncGraphqlApis_Get.json + */ + /** + * Sample code: AppSyncGraphqlApis_Get. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void appSyncGraphqlApisGet(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.appSyncGraphqlApis() + .getByResourceGroupWithResponse("rgappSyncGraphqlApi", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE); + } +} +``` + +### AppSyncGraphqlApis_List + +```java +/** + * Samples for AppSyncGraphqlApis List. + */ +public final class AppSyncGraphqlApisListSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * AppSyncGraphqlApis_ListBySubscription.json + */ + /** + * Sample code: AppSyncGraphqlApis_ListBySubscription. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + appSyncGraphqlApisListBySubscription(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.appSyncGraphqlApis().list(com.azure.core.util.Context.NONE); + } +} +``` + +### AppSyncGraphqlApis_ListByResourceGroup + +```java +/** + * Samples for AppSyncGraphqlApis ListByResourceGroup. + */ +public final class AppSyncGraphqlApisListByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * AppSyncGraphqlApis_ListByResourceGroup.json + */ + /** + * Sample code: AppSyncGraphqlApis_ListByResourceGroup. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + appSyncGraphqlApisListByResourceGroup(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.appSyncGraphqlApis().listByResourceGroup("rgappSyncGraphqlApi", com.azure.core.util.Context.NONE); + } +} +``` + +### AppSyncGraphqlApis_Update + +```java +import com.azure.resourcemanager.awsconnector.models.AppSyncGraphqlApi; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for AppSyncGraphqlApis Update. + */ +public final class AppSyncGraphqlApisUpdateSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * AppSyncGraphqlApis_Update.json + */ + /** + * Sample code: AppSyncGraphqlApis_Update. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void appSyncGraphqlApisUpdate(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + AppSyncGraphqlApi resource = manager.appSyncGraphqlApis() + .getByResourceGroupWithResponse("rgappSyncGraphqlApi", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE) + .getValue(); + resource.update().withTags(mapOf("key3768", "fakeTokenPlaceholder")).apply(); + } + + // Use "Map.of" if available + @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; + } +} +``` + +### AutoScalingAutoScalingGroups_CreateOrReplace + +```java +import com.azure.resourcemanager.awsconnector.models.AcceleratorCountRequest; +import com.azure.resourcemanager.awsconnector.models.AcceleratorTotalMemoryMiBRequest; +import com.azure.resourcemanager.awsconnector.models.AutoScalingGroupProperties; +import com.azure.resourcemanager.awsconnector.models.AwsAutoScalingGroupProperties; +import com.azure.resourcemanager.awsconnector.models.BaselineEbsBandwidthMbpsRequest; +import com.azure.resourcemanager.awsconnector.models.InstanceMaintenancePolicy; +import com.azure.resourcemanager.awsconnector.models.InstanceRequirements; +import com.azure.resourcemanager.awsconnector.models.InstancesDistribution; +import com.azure.resourcemanager.awsconnector.models.LaunchTemplate; +import com.azure.resourcemanager.awsconnector.models.LaunchTemplateOverrides; +import com.azure.resourcemanager.awsconnector.models.LaunchTemplateSpecification; +import com.azure.resourcemanager.awsconnector.models.LifecycleHookSpecification; +import com.azure.resourcemanager.awsconnector.models.MemoryGiBPerVCpuRequest; +import com.azure.resourcemanager.awsconnector.models.MemoryMiBRequest; +import com.azure.resourcemanager.awsconnector.models.MetricsCollection; +import com.azure.resourcemanager.awsconnector.models.MixedInstancesPolicy; +import com.azure.resourcemanager.awsconnector.models.NetworkBandwidthGbpsRequest; +import com.azure.resourcemanager.awsconnector.models.NetworkInterfaceCountRequest; +import com.azure.resourcemanager.awsconnector.models.NotificationConfiguration; +import com.azure.resourcemanager.awsconnector.models.TagProperty; +import com.azure.resourcemanager.awsconnector.models.TotalLocalStorageGBRequest; +import com.azure.resourcemanager.awsconnector.models.VCpuCountRequest; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for AutoScalingAutoScalingGroups CreateOrReplace. + */ +public final class AutoScalingAutoScalingGroupsCreateOrReplaceSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * AutoScalingAutoScalingGroups_CreateOrReplace.json + */ + /** + * Sample code: AutoScalingAutoScalingGroups_CreateOrReplace. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void autoScalingAutoScalingGroupsCreateOrReplace( + com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.autoScalingAutoScalingGroups() + .define("Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])") + .withRegion("vfitxfllzgknmbaqgpsv") + .withExistingResourceGroup("rgautoScalingAutoScalingGroup") + .withTags(mapOf("key2337", "fakeTokenPlaceholder")) + .withProperties(new AutoScalingGroupProperties() + .withAwsProperties( + new AwsAutoScalingGroupProperties().withAutoScalingGroupName("zvp") + .withAvailabilityZones(Arrays.asList("bvcnltgekeqrzklsnfieubhugr")) + .withCapacityRebalance(true) + .withContext("dnmovg") + .withCooldown("r") + .withDefaultInstanceWarmup(24) + .withDesiredCapacity("xtu") + .withDesiredCapacityType("wncmimbdveox") + .withHealthCheckGracePeriod(9) + .withHealthCheckType("ustkoarefpvnhxrtqua") + .withInstanceId("noghdbfliygsadtjosovasxq") + .withInstanceMaintenancePolicy( + new InstanceMaintenancePolicy().withMaxHealthyPercentage(23).withMinHealthyPercentage(6)) + .withLaunchConfigurationName("rgadwyrtzaxbfkbsbjaygujtc") + .withLaunchTemplate( + new LaunchTemplateSpecification().withLaunchTemplateId("zpcgiqsftmwjzwqifodopjuvfoxed") + .withLaunchTemplateName("jq") + .withVersion("kdlpart")) + .withLifecycleHookSpecificationList( + Arrays.asList(new LifecycleHookSpecification().withDefaultResult("qbeojpqbpnhst") + .withHeartbeatTimeout(14) + .withLifecycleHookName("xeqfmdmthyzrdxjbmdkyy") + .withLifecycleTransition("xsufodhykhlutvc") + .withNotificationMetadata("bknbkafxdozjlnprrlkrqstgwchxl") + .withNotificationTargetArn("dkeqhlwuifyfamkufdryfiybxnle") + .withRoleArn("bhenujqtabiiryjgl"))) + .withLoadBalancerNames(Arrays.asList("qsgaefmtltksmmwswpdfmnlwvovi")) + .withMaxInstanceLifetime(25) + .withMaxSize("vqxfpkdyusfijwc") + .withMetricsCollection(Arrays.asList(new MetricsCollection().withGranularity("ygxetadl") + .withMetrics(Arrays.asList("hwukwnkctznjelut")))) + .withMinSize("rfdwflldttnzph") + .withMixedInstancesPolicy( + new MixedInstancesPolicy() + .withInstancesDistribution( + new InstancesDistribution().withOnDemandAllocationStrategy("s") + .withOnDemandBaseCapacity(11) + .withOnDemandPercentageAboveBaseCapacity(13) + .withSpotAllocationStrategy("mdqoylvmdfgnktujkkgcargpzgejts") + .withSpotInstancePools(21) + .withSpotMaxPrice("civdjpljorkrvqganofneu")) + .withLaunchTemplate( + new LaunchTemplate() + .withLaunchTemplateSpecification(new LaunchTemplateSpecification() + .withLaunchTemplateId("zpcgiqsftmwjzwqifodopjuvfoxed") + .withLaunchTemplateName("jq") + .withVersion("kdlpart")) + .withOverrides(Arrays.asList(new LaunchTemplateOverrides() + .withInstanceRequirements(new InstanceRequirements() + .withAcceleratorCount( + new AcceleratorCountRequest().withMax(22).withMin(12)) + .withAcceleratorManufacturers( + Arrays.asList("yrnnynorjjxvzppzrgpahymhm")) + .withAcceleratorNames(Arrays.asList("iqmentbrnypcxv")) + .withAcceleratorTotalMemoryMiB( + new AcceleratorTotalMemoryMiBRequest().withMax(7).withMin(29)) + .withAcceleratorTypes(Arrays.asList("kmvwibkxxklqitqxqqlpvfifvo")) + .withAllowedInstanceTypes(Arrays.asList("tzrxlaofwygbqglbwdxnqjy")) + .withBareMetal("kugjpzsjreywlvvzkebv") + .withBaselineEbsBandwidthMbps( + new BaselineEbsBandwidthMbpsRequest().withMax(2).withMin(19)) + .withBurstablePerformance("jpwudasuoonf") + .withCpuManufacturers(Arrays.asList("scbxthzijnmur")) + .withExcludedInstanceTypes(Arrays.asList("edadlo")) + .withInstanceGenerations(Arrays.asList("f")) + .withLocalStorage("wglfmvquwice") + .withLocalStorageTypes(Arrays.asList("talnjrldmventgtzlwpaxfcenp")) + .withMaxSpotPriceAsPercentageOfOptimalOnDemandPrice(15) + .withMemoryGiBPerVCpu( + new MemoryGiBPerVCpuRequest().withMax(23).withMin(29)) + .withMemoryMiB(new MemoryMiBRequest().withMax(27).withMin(27)) + .withNetworkBandwidthGbps( + new NetworkBandwidthGbpsRequest().withMax(18).withMin(29)) + .withNetworkInterfaceCount( + new NetworkInterfaceCountRequest().withMax(14).withMin(26)) + .withOnDemandMaxPricePercentageOverLowestPrice(8) + .withRequireHibernateSupport(true) + .withSpotMaxPricePercentageOverLowestPrice(9) + .withTotalLocalStorageGB( + new TotalLocalStorageGBRequest().withMax(19).withMin(7)) + .withVCpuCount(new VCpuCountRequest().withMax(9).withMin(26))) + .withInstanceType("phudgcnbis") + .withLaunchTemplateSpecification(new LaunchTemplateSpecification() + .withLaunchTemplateId("zpcgiqsftmwjzwqifodopjuvfoxed") + .withLaunchTemplateName("jq") + .withVersion("kdlpart")) + .withWeightedCapacity("iqa"))))) + .withNewInstancesProtectedFromScaleIn(true) + .withNotificationConfiguration( + new NotificationConfiguration().withNotificationTypes(Arrays.asList("jzepnjbwtsw")) + .withTopicArn("hndjrwrlqssgciezop")) + .withNotificationConfigurations(Arrays + .asList(new NotificationConfiguration().withNotificationTypes(Arrays.asList("jzepnjbwtsw")) + .withTopicArn("hndjrwrlqssgciezop"))) + .withPlacementGroup("pmanetwktlujhykhxtcekv") + .withServiceLinkedRoleArn("ffqtfkdv") + .withTags(Arrays.asList(new TagProperty().withKey("fakeTokenPlaceholder") + .withPropagateAtLaunch(true) + .withValue("xoncdkvjanxdfklvixodkyg"))) + .withTargetGroupARNs(Arrays.asList("ttxjwgboopxrdiqxyqjdujw")) + .withTerminationPolicies(Arrays.asList("jvwpdujegrgjbdrxbvcjgs")) + .withVpcZoneIdentifier(Arrays.asList("fmqvstmohqtmjslrnsiuodevi"))) + .withPublicCloudConnectorsResourceId("q") + .withAwsAccountId("eogdcteuaaazi") + .withArn("gsso") + .withPublicCloudResourceName("blomfowfltqwzdghycehvvdnr") + .withAwsSourceSchema("koleijkwf") + .withAwsRegion("cfqguizvjpckdsvetalwo") + .withAwsTags(mapOf("key6990", "fakeTokenPlaceholder"))) + .create(); + } + + // Use "Map.of" if available + @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; + } +} +``` + +### AutoScalingAutoScalingGroups_Delete + +```java +/** + * Samples for AutoScalingAutoScalingGroups Delete. + */ +public final class AutoScalingAutoScalingGroupsDeleteSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * AutoScalingAutoScalingGroups_Delete.json + */ + /** + * Sample code: AutoScalingAutoScalingGroups_Delete. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + autoScalingAutoScalingGroupsDelete(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.autoScalingAutoScalingGroups() + .delete("rgautoScalingAutoScalingGroup", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE); + } +} +``` + +### AutoScalingAutoScalingGroups_GetByResourceGroup + +```java +/** + * Samples for AutoScalingAutoScalingGroups GetByResourceGroup. + */ +public final class AutoScalingAutoScalingGroupsGetByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * AutoScalingAutoScalingGroups_Get.json + */ + /** + * Sample code: AutoScalingAutoScalingGroups_Get. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + autoScalingAutoScalingGroupsGet(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.autoScalingAutoScalingGroups() + .getByResourceGroupWithResponse("rgautoScalingAutoScalingGroup", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE); + } +} +``` + +### AutoScalingAutoScalingGroups_List + +```java +/** + * Samples for AutoScalingAutoScalingGroups List. + */ +public final class AutoScalingAutoScalingGroupsListSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * AutoScalingAutoScalingGroups_ListBySubscription.json + */ + /** + * Sample code: AutoScalingAutoScalingGroups_ListBySubscription. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void autoScalingAutoScalingGroupsListBySubscription( + com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.autoScalingAutoScalingGroups().list(com.azure.core.util.Context.NONE); + } +} +``` + +### AutoScalingAutoScalingGroups_ListByResourceGroup + +```java +/** + * Samples for AutoScalingAutoScalingGroups ListByResourceGroup. + */ +public final class AutoScalingAutoScalingGroupsListByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * AutoScalingAutoScalingGroups_ListByResourceGroup.json + */ + /** + * Sample code: AutoScalingAutoScalingGroups_ListByResourceGroup. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void autoScalingAutoScalingGroupsListByResourceGroup( + com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.autoScalingAutoScalingGroups() + .listByResourceGroup("rgautoScalingAutoScalingGroup", com.azure.core.util.Context.NONE); + } +} +``` + +### AutoScalingAutoScalingGroups_Update + +```java +import com.azure.resourcemanager.awsconnector.models.AutoScalingGroup; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for AutoScalingAutoScalingGroups Update. + */ +public final class AutoScalingAutoScalingGroupsUpdateSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * AutoScalingAutoScalingGroups_Update.json + */ + /** + * Sample code: AutoScalingAutoScalingGroups_Update. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + autoScalingAutoScalingGroupsUpdate(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + AutoScalingGroup resource = manager.autoScalingAutoScalingGroups() + .getByResourceGroupWithResponse("rgautoScalingAutoScalingGroup", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE) + .getValue(); + resource.update().withTags(mapOf("key9673", "fakeTokenPlaceholder")).apply(); + } + + // Use "Map.of" if available + @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; + } +} +``` + +### CloudFormationStackSets_CreateOrReplace + +```java +import com.azure.resourcemanager.awsconnector.models.ActiveModel; +import com.azure.resourcemanager.awsconnector.models.AutoDeployment; +import com.azure.resourcemanager.awsconnector.models.AwsCloudFormationStackSetProperties; +import com.azure.resourcemanager.awsconnector.models.CallAs; +import com.azure.resourcemanager.awsconnector.models.CloudFormationStackSetProperties; +import com.azure.resourcemanager.awsconnector.models.DeploymentTargets; +import com.azure.resourcemanager.awsconnector.models.DeploymentTargetsAccountFilterType; +import com.azure.resourcemanager.awsconnector.models.OperationPreferences; +import com.azure.resourcemanager.awsconnector.models.OperationPreferencesRegionConcurrencyType; +import com.azure.resourcemanager.awsconnector.models.Parameter; +import com.azure.resourcemanager.awsconnector.models.PermissionModel; +import com.azure.resourcemanager.awsconnector.models.StackInstances; +import com.azure.resourcemanager.awsconnector.models.TagAutoGenerated4; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for CloudFormationStackSets CreateOrReplace. + */ +public final class CloudFormationStackSetsCreateOrReplaceSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * CloudFormationStackSets_CreateOrReplace.json + */ + /** + * Sample code: CloudFormationStackSets_CreateOrReplace. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + cloudFormationStackSetsCreateOrReplace(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.cloudFormationStackSets() + .define("Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])") + .withRegion("oubo") + .withExistingResourceGroup("rgcloudFormationStackSet") + .withTags(mapOf("key307", "fakeTokenPlaceholder")) + .withProperties( + new CloudFormationStackSetProperties() + .withAwsProperties(new AwsCloudFormationStackSetProperties().withAdministrationRoleArn("ybtuoky") + .withAutoDeployment( + new AutoDeployment().withEnabled(true).withRetainStacksOnAccountRemoval(true)) + .withCallAs(CallAs.DELEGATED_ADMIN) + .withCapabilities(Arrays.asList("begwecrhvitloplqjhhydjwhve")) + .withDescription("czkasvectlrpghrjojr") + .withExecutionRoleName("fclmt") + .withManagedExecution(new ActiveModel().withActive(true)) + .withOperationPreferences(new OperationPreferences().withFailureToleranceCount(30) + .withFailureTolerancePercentage(16) + .withMaxConcurrentCount(11) + .withMaxConcurrentPercentage(15) + .withRegionConcurrencyType(OperationPreferencesRegionConcurrencyType.PARALLEL) + .withRegionOrder(Arrays.asList("gwaceriunclgehhoue"))) + .withParameters(Arrays + .asList(new Parameter().withParameterKey("fakeTokenPlaceholder") + .withParameterValue("lldiqsjfqukysjecb"))) + .withPermissionModel(PermissionModel.SELF_MANAGED) + .withStackInstancesGroup(Arrays.asList(new StackInstances() + .withDeploymentTargets(new DeploymentTargets() + .withAccountFilterType(DeploymentTargetsAccountFilterType.DIFFERENCE) + .withAccounts(Arrays.asList("xc")) + .withAccountsUrl("nvixaunvovhintyelj") + .withOrganizationalUnitIds(Arrays.asList("gnnzuj"))) + .withParameterOverrides( + Arrays.asList(new Parameter().withParameterKey("fakeTokenPlaceholder") + .withParameterValue("lldiqsjfqukysjecb"))) + .withRegions(Arrays.asList("eyondljwt")))) + .withStackSetId("ypfkcclgbgzikkjqfeiq") + .withStackSetName("bkfqkuqedspfb") + .withTags( + Arrays.asList(new TagAutoGenerated4().withKey("fakeTokenPlaceholder").withValue("ntm"))) + .withTemplateBody("no") + .withTemplateUrl("icoki")) + .withPublicCloudConnectorsResourceId("eqapackzslaofkx") + .withAwsAccountId("jtdycoxjyvqvrxyy") + .withArn("sldueqvlzdilykrozxapbb") + .withPublicCloudResourceName("dyaxkuzcwhqspayuipml") + .withAwsSourceSchema("wpvatxlrosokkyqsq") + .withAwsRegion("drpqdznyarlwjnjslcrmvm") + .withAwsTags(mapOf("key7598", "fakeTokenPlaceholder"))) + .create(); + } + + // Use "Map.of" if available + @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; + } +} +``` + +### CloudFormationStackSets_Delete + +```java +/** + * Samples for CloudFormationStackSets Delete. + */ +public final class CloudFormationStackSetsDeleteSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * CloudFormationStackSets_Delete.json + */ + /** + * Sample code: CloudFormationStackSets_Delete. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + cloudFormationStackSetsDelete(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.cloudFormationStackSets() + .delete("rgcloudFormationStackSet", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE); + } +} +``` + +### CloudFormationStackSets_GetByResourceGroup + +```java +/** + * Samples for CloudFormationStackSets GetByResourceGroup. + */ +public final class CloudFormationStackSetsGetByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * CloudFormationStackSets_Get.json + */ + /** + * Sample code: CloudFormationStackSets_Get. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void cloudFormationStackSetsGet(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.cloudFormationStackSets() + .getByResourceGroupWithResponse("rgcloudFormationStackSet", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE); + } +} +``` + +### CloudFormationStackSets_List + +```java +/** + * Samples for CloudFormationStackSets List. + */ +public final class CloudFormationStackSetsListSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * CloudFormationStackSets_ListBySubscription.json + */ + /** + * Sample code: CloudFormationStackSets_ListBySubscription. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + cloudFormationStackSetsListBySubscription(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.cloudFormationStackSets().list(com.azure.core.util.Context.NONE); + } +} +``` + +### CloudFormationStackSets_ListByResourceGroup + +```java +/** + * Samples for CloudFormationStackSets ListByResourceGroup. + */ +public final class CloudFormationStackSetsListByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * CloudFormationStackSets_ListByResourceGroup.json + */ + /** + * Sample code: CloudFormationStackSets_ListByResourceGroup. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + cloudFormationStackSetsListByResourceGroup(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.cloudFormationStackSets() + .listByResourceGroup("rgcloudFormationStackSet", com.azure.core.util.Context.NONE); + } +} +``` + +### CloudFormationStackSets_Update + +```java +import com.azure.resourcemanager.awsconnector.models.CloudFormationStackSet; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for CloudFormationStackSets Update. + */ +public final class CloudFormationStackSetsUpdateSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * CloudFormationStackSets_Update.json + */ + /** + * Sample code: CloudFormationStackSets_Update. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + cloudFormationStackSetsUpdate(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + CloudFormationStackSet resource = manager.cloudFormationStackSets() + .getByResourceGroupWithResponse("rgcloudFormationStackSet", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE) + .getValue(); + resource.update().withTags(mapOf("key6480", "fakeTokenPlaceholder")).apply(); + } + + // Use "Map.of" if available + @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; + } +} +``` + +### CloudFormationStacks_CreateOrReplace + +```java +import com.azure.resourcemanager.awsconnector.models.AwsCloudFormationStackProperties; +import com.azure.resourcemanager.awsconnector.models.Capabilities; +import com.azure.resourcemanager.awsconnector.models.CloudFormationStackProperties; +import com.azure.resourcemanager.awsconnector.models.Output; +import com.azure.resourcemanager.awsconnector.models.StackStatus; +import com.azure.resourcemanager.awsconnector.models.TagAutoGenerated3; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for CloudFormationStacks CreateOrReplace. + */ +public final class CloudFormationStacksCreateOrReplaceSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * CloudFormationStacks_CreateOrReplace.json + */ + /** + * Sample code: CloudFormationStacks_CreateOrReplace. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + cloudFormationStacksCreateOrReplace(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.cloudFormationStacks() + .define("Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])") + .withRegion("igidmxpchpipflxgxqkge") + .withExistingResourceGroup("rgcloudFormationStack") + .withTags(mapOf("key8740", "fakeTokenPlaceholder")) + .withProperties(new CloudFormationStackProperties() + .withAwsProperties(new AwsCloudFormationStackProperties() + .withCapabilities(Arrays.asList(Capabilities.CAPABILITY_AUTO_EXPAND)) + .withChangeSetId("diebgdscxgdrjl") + .withCreationTime("rbzmujrpza") + .withDescription("qgthunuomcbskx") + .withDisableRollback(true) + .withEnableTerminationProtection(true) + .withLastUpdateTime("ziwluvridlkgt") + .withNotificationARNs(Arrays.asList("hiumjcobumu")) + .withOutputs(Arrays.asList(new Output().withDescription("yr") + .withExportName("inzgbtgxtlkmbsthsiqyaownydl") + .withOutputKey("fakeTokenPlaceholder") + .withOutputValue("xrkebm"))) + .withParameters(mapOf("key3924", "fakeTokenPlaceholder")) + .withParentId("spfnpubjgnn") + .withRoleArn("chneost") + .withRootId("dm") + .withStackId("pfdvktglgjlp") + .withStackName("kcpmjgjmtil") + .withStackPolicyUrl("azff") + .withStackStatus(StackStatus.CREATE_COMPLETE) + .withStackStatusReason("oashauqgm") + .withTags(Arrays + .asList(new TagAutoGenerated3().withKey("fakeTokenPlaceholder").withValue("xapmapwprakmhlboq"))) + .withTemplateUrl("prpgfhggbaglqposmnlkc") + .withTimeoutInMinutes(21)) + .withPublicCloudConnectorsResourceId("ccuizanjtbypcrcdmoelfyjkx") + .withAwsAccountId("yuzdhawgkrzzmppqjebmyzrqzsxbgh") + .withArn("wnbcxhzurwtzqcoirs") + .withPublicCloudResourceName("vjnhdxpreaebeaxeqmrhfuro") + .withAwsSourceSchema("ascbhyeewelekovixg") + .withAwsRegion("ovumxnjlsoffpzxyegazwgujni") + .withAwsTags(mapOf("key6002", "fakeTokenPlaceholder"))) + .create(); + } + + // Use "Map.of" if available + @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; + } +} +``` + +### CloudFormationStacks_Delete + +```java +/** + * Samples for CloudFormationStacks Delete. + */ +public final class CloudFormationStacksDeleteSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * CloudFormationStacks_Delete.json + */ + /** + * Sample code: CloudFormationStacks_Delete. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void cloudFormationStacksDelete(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.cloudFormationStacks() + .delete("rgcloudFormationStack", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE); + } +} +``` + +### CloudFormationStacks_GetByResourceGroup + +```java +/** + * Samples for CloudFormationStacks GetByResourceGroup. + */ +public final class CloudFormationStacksGetByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * CloudFormationStacks_Get.json + */ + /** + * Sample code: CloudFormationStacks_Get. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void cloudFormationStacksGet(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.cloudFormationStacks() + .getByResourceGroupWithResponse("rgcloudFormationStack", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE); + } +} +``` + +### CloudFormationStacks_List + +```java +/** + * Samples for CloudFormationStacks List. + */ +public final class CloudFormationStacksListSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * CloudFormationStacks_ListBySubscription.json + */ + /** + * Sample code: CloudFormationStacks_ListBySubscription. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + cloudFormationStacksListBySubscription(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.cloudFormationStacks().list(com.azure.core.util.Context.NONE); + } +} +``` + +### CloudFormationStacks_ListByResourceGroup + +```java +/** + * Samples for CloudFormationStacks ListByResourceGroup. + */ +public final class CloudFormationStacksListByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * CloudFormationStacks_ListByResourceGroup.json + */ + /** + * Sample code: CloudFormationStacks_ListByResourceGroup. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + cloudFormationStacksListByResourceGroup(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.cloudFormationStacks().listByResourceGroup("rgcloudFormationStack", com.azure.core.util.Context.NONE); + } +} +``` + +### CloudFormationStacks_Update + +```java +import com.azure.resourcemanager.awsconnector.models.CloudFormationStack; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for CloudFormationStacks Update. + */ +public final class CloudFormationStacksUpdateSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * CloudFormationStacks_Update.json + */ + /** + * Sample code: CloudFormationStacks_Update. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void cloudFormationStacksUpdate(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + CloudFormationStack resource = manager.cloudFormationStacks() + .getByResourceGroupWithResponse("rgcloudFormationStack", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE) + .getValue(); + resource.update().withTags(mapOf("key4726", "fakeTokenPlaceholder")).apply(); + } + + // Use "Map.of" if available + @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; + } +} +``` + +### CloudFrontDistributions_CreateOrReplace + +```java +import com.azure.resourcemanager.awsconnector.models.AwsCloudFrontDistributionProperties; +import com.azure.resourcemanager.awsconnector.models.CacheBehavior; +import com.azure.resourcemanager.awsconnector.models.CloudFrontDistributionProperties; +import com.azure.resourcemanager.awsconnector.models.Cookies; +import com.azure.resourcemanager.awsconnector.models.CustomErrorResponse; +import com.azure.resourcemanager.awsconnector.models.CustomOriginConfig; +import com.azure.resourcemanager.awsconnector.models.DefaultCacheBehavior; +import com.azure.resourcemanager.awsconnector.models.DistributionConfig; +import com.azure.resourcemanager.awsconnector.models.ForwardedValues; +import com.azure.resourcemanager.awsconnector.models.FunctionAssociation; +import com.azure.resourcemanager.awsconnector.models.GeoRestriction; +import com.azure.resourcemanager.awsconnector.models.LambdaFunctionAssociation; +import com.azure.resourcemanager.awsconnector.models.LegacyCustomOrigin; +import com.azure.resourcemanager.awsconnector.models.LegacyS3Origin; +import com.azure.resourcemanager.awsconnector.models.Logging; +import com.azure.resourcemanager.awsconnector.models.OriginAutoGenerated; +import com.azure.resourcemanager.awsconnector.models.OriginCustomHeader; +import com.azure.resourcemanager.awsconnector.models.OriginGroup; +import com.azure.resourcemanager.awsconnector.models.OriginGroupFailoverCriteria; +import com.azure.resourcemanager.awsconnector.models.OriginGroupMember; +import com.azure.resourcemanager.awsconnector.models.OriginGroupMembers; +import com.azure.resourcemanager.awsconnector.models.OriginGroups; +import com.azure.resourcemanager.awsconnector.models.OriginShield; +import com.azure.resourcemanager.awsconnector.models.Restrictions; +import com.azure.resourcemanager.awsconnector.models.S3OriginConfig; +import com.azure.resourcemanager.awsconnector.models.StatusCodes; +import com.azure.resourcemanager.awsconnector.models.TagAutoGenerated5; +import com.azure.resourcemanager.awsconnector.models.ViewerCertificate; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for CloudFrontDistributions CreateOrReplace. + */ +public final class CloudFrontDistributionsCreateOrReplaceSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * CloudFrontDistributions_CreateOrReplace.json + */ + /** + * Sample code: CloudFrontDistributions_CreateOrReplace. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + cloudFrontDistributionsCreateOrReplace(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.cloudFrontDistributions() + .define("Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])") + .withRegion("nprgvufyhs") + .withExistingResourceGroup("rgcloudFrontDistribution") + .withTags(mapOf("key6544", "fakeTokenPlaceholder")) + .withProperties(new CloudFrontDistributionProperties() + .withAwsProperties(new AwsCloudFrontDistributionProperties() + .withDistributionConfig( + new DistributionConfig().withAliases(Arrays.asList("gibhsrynakjqasnexklzyr")) + .withCnamEs(Arrays.asList("qczbolddtyqh")) + .withCacheBehaviors(Arrays.asList(new CacheBehavior() + .withAllowedMethods(Arrays.asList("mgilninyxzl")) + .withCachePolicyId("jgthzlgddcq") + .withCachedMethods(Arrays.asList("mocyvkoubxnhxggwiguxclll")) + .withCompress(true) + .withDefaultTtl(12) + .withFieldLevelEncryptionId("egdaxlmmafenvmeeiyendhzfgb") + .withForwardedValues(new ForwardedValues() + .withCookies(new Cookies().withForward("vgdw") + .withWhitelistedNames(Arrays.asList("dyyppccyzusjttwxsvtauzikzpcic"))) + .withHeaders(Arrays.asList("wthyef")) + .withQueryString(true) + .withQueryStringCacheKeys(Arrays.asList("ovsbbyypovwzfd"))) + .withFunctionAssociations( + Arrays.asList(new FunctionAssociation().withEventType("rabilo") + .withFunctionArn("xqjivwlwegwmcpxpbdxlxwfkkoy"))) + .withLambdaFunctionAssociations( + Arrays.asList(new LambdaFunctionAssociation().withEventType("adgevfqgfrqxotodrywqn") + .withIncludeBody(true) + .withLambdaFunctionArn("ofaqozmfhyrnzijzqjc"))) + .withMaxTtl(22) + .withMinTtl(14) + .withOriginRequestPolicyId("mmggy") + .withPathPattern("dblpru") + .withRealtimeLogConfigArn("hlpmy") + .withResponseHeadersPolicyId("mexazovhbvttjpndsx") + .withSmoothStreaming(true) + .withTargetOriginId("muilt") + .withTrustedKeyGroups(Arrays.asList("rtoknopsknpyux")) + .withTrustedSigners(Arrays.asList("dqxymkhclbsojvcwgczgtw")) + .withViewerProtocolPolicy("tadcgla"))) + .withComment("eqgjcikzog") + .withContinuousDeploymentPolicyId("jpzap") + .withCustomErrorResponses(Arrays.asList(new CustomErrorResponse().withErrorCachingMinTtl(16) + .withErrorCode(14) + .withResponseCode(26) + .withResponsePagePath("fgjymf"))) + .withCustomOrigin(new LegacyCustomOrigin().withDnsName("dijgqalflftbtatmydfk") + .withHttpPort(3) + .withHttpsPort(26) + .withOriginProtocolPolicy("unrjgcwzebjixqsjmmzdwm") + .withOriginSslProtocols(Arrays.asList("clriolammhrzrrhmyovvmbxowayz"))) + .withDefaultCacheBehavior(new DefaultCacheBehavior() + .withAllowedMethods(Arrays.asList("gtvgkaxaocaozvybswnfgud")) + .withCachePolicyId("txppezvfdbpaewlehepeycrdj") + .withCachedMethods(Arrays.asList("bpptfnqcsypifnydxpkjxaek")) + .withCompress(true) + .withDefaultTtl(16) + .withFieldLevelEncryptionId("adpzriyfhcj") + .withForwardedValues(new ForwardedValues() + .withCookies(new Cookies().withForward("vgdw") + .withWhitelistedNames(Arrays.asList("dyyppccyzusjttwxsvtauzikzpcic"))) + .withHeaders(Arrays.asList("wthyef")) + .withQueryString(true) + .withQueryStringCacheKeys(Arrays.asList("ovsbbyypovwzfd"))) + .withFunctionAssociations( + Arrays.asList(new FunctionAssociation().withEventType("rabilo") + .withFunctionArn("xqjivwlwegwmcpxpbdxlxwfkkoy"))) + .withLambdaFunctionAssociations( + Arrays.asList(new LambdaFunctionAssociation().withEventType("adgevfqgfrqxotodrywqn") + .withIncludeBody(true) + .withLambdaFunctionArn("ofaqozmfhyrnzijzqjc"))) + .withMaxTtl(11) + .withMinTtl(22) + .withOriginRequestPolicyId("vfi") + .withRealtimeLogConfigArn("gdfhajmumlspefunqlznktqzn") + .withResponseHeadersPolicyId("xnvjmk") + .withSmoothStreaming(true) + .withTargetOriginId("satcfgygtio") + .withTrustedKeyGroups(Arrays.asList("glzecp")) + .withTrustedSigners(Arrays.asList("yeheiezaavurjdn")) + .withViewerProtocolPolicy("vmvahgz")) + .withDefaultRootObject("qqacdjhmnrgxzg") + .withEnabled(true) + .withHttpVersion("jujxztvywwzj") + .withIpV6Enabled(true) + .withLogging(new Logging().withBucket("staluexfxdlonreqbr") + .withIncludeCookies(true) + .withPrefix("mzugdqzcjqfkxbyxwaho")) + .withOriginGroups( + new OriginGroups() + .withItems(Arrays.asList(new OriginGroup() + .withFailoverCriteria(new OriginGroupFailoverCriteria().withStatusCodes( + new StatusCodes().withItems(Arrays.asList(24)).withQuantity(13))) + .withId("cppcwh") + .withMembers(new OriginGroupMembers() + .withItems(Arrays.asList(new OriginGroupMember().withOriginId("ju"))) + .withQuantity(19)))) + .withQuantity(15)) + .withOrigins(Arrays.asList(new OriginAutoGenerated().withConnectionAttempts(17) + .withConnectionTimeout(13) + .withCustomOriginConfig(new CustomOriginConfig().withHttpPort(6) + .withHttpsPort(10) + .withOriginKeepaliveTimeout(29) + .withOriginProtocolPolicy("utekqcjzgxdogmvyfxxzehzpcbhgu") + .withOriginReadTimeout(11) + .withOriginSslProtocols(Arrays.asList("lplnjynxpyxbrbyq"))) + .withDomainName("tdvwmcxajsiushniomugxjkroqih") + .withId("jsvocvlfluxmig") + .withOriginAccessControlId("uwoxzymxpzbiohjphusuywrbri") + .withOriginCustomHeaders( + Arrays.asList(new OriginCustomHeader().withHeaderName("kdbkguzvgqpjinhenlsw") + .withHeaderValue("glzvvmflrrab"))) + .withOriginPath("qhkjzdzxipwguohspfmkqtmp") + .withOriginShield(new OriginShield().withEnabled(true).withOriginShieldRegion("ubhpk")) + .withS3OriginConfig(new S3OriginConfig().withOriginAccessIdentity("sexllpdop")))) + .withPriceClass("wltams") + .withRestrictions(new Restrictions().withGeoRestriction( + new GeoRestriction().withLocations(Arrays.asList("qfbhxln")).withRestrictionType("ry"))) + .withS3Origin(new LegacyS3Origin().withDnsName("bgxohpxhcml") + .withOriginAccessIdentity("itatexxuwwvgnusaleemttplfhx")) + .withStaging(true) + .withViewerCertificate(new ViewerCertificate().withAcmCertificateArn("oooavlkhe") + .withCloudFrontDefaultCertificate(true) + .withIamCertificateId("orcqmznytymzmiqg") + .withMinimumProtocolVersion("fjodeffknxcdqfz") + .withSslSupportMethod("ceibl")) + .withWebAclId("oycfjrylckkuampmezlerj")) + .withDomainName("cwbirqnkovujza") + .withId("ud") + .withTags(Arrays.asList( + new TagAutoGenerated5().withKey("fakeTokenPlaceholder").withValue("eelgljsxedmzhdwwp")))) + .withPublicCloudConnectorsResourceId("quzwvcijedi") + .withAwsAccountId("npsedngekfchphqo") + .withArn("mlluf") + .withPublicCloudResourceName("uquecem") + .withAwsSourceSchema("nuhdditribzbvzfnixuibhjwyo") + .withAwsRegion("gumvgalmzjsgtlvv") + .withAwsTags(mapOf("key3003", "fakeTokenPlaceholder"))) + .create(); + } + + // Use "Map.of" if available + @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; + } +} +``` + +### CloudFrontDistributions_Delete + +```java +/** + * Samples for CloudFrontDistributions Delete. + */ +public final class CloudFrontDistributionsDeleteSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * CloudFrontDistributions_Delete.json + */ + /** + * Sample code: CloudFrontDistributions_Delete. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + cloudFrontDistributionsDelete(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.cloudFrontDistributions() + .delete("rgcloudFrontDistribution", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE); + } +} +``` + +### CloudFrontDistributions_GetByResourceGroup + +```java +/** + * Samples for CloudFrontDistributions GetByResourceGroup. + */ +public final class CloudFrontDistributionsGetByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * CloudFrontDistributions_Get.json + */ + /** + * Sample code: CloudFrontDistributions_Get. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void cloudFrontDistributionsGet(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.cloudFrontDistributions() + .getByResourceGroupWithResponse("rgcloudFrontDistribution", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE); + } +} +``` + +### CloudFrontDistributions_List + +```java +/** + * Samples for CloudFrontDistributions List. + */ +public final class CloudFrontDistributionsListSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * CloudFrontDistributions_ListBySubscription.json + */ + /** + * Sample code: CloudFrontDistributions_ListBySubscription. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + cloudFrontDistributionsListBySubscription(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.cloudFrontDistributions().list(com.azure.core.util.Context.NONE); + } +} +``` + +### CloudFrontDistributions_ListByResourceGroup + +```java +/** + * Samples for CloudFrontDistributions ListByResourceGroup. + */ +public final class CloudFrontDistributionsListByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * CloudFrontDistributions_ListByResourceGroup.json + */ + /** + * Sample code: CloudFrontDistributions_ListByResourceGroup. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + cloudFrontDistributionsListByResourceGroup(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.cloudFrontDistributions() + .listByResourceGroup("rgcloudFrontDistribution", com.azure.core.util.Context.NONE); + } +} +``` + +### CloudFrontDistributions_Update + +```java +import com.azure.resourcemanager.awsconnector.models.CloudFrontDistribution; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for CloudFrontDistributions Update. + */ +public final class CloudFrontDistributionsUpdateSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * CloudFrontDistributions_Update.json + */ + /** + * Sample code: CloudFrontDistributions_Update. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + cloudFrontDistributionsUpdate(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + CloudFrontDistribution resource = manager.cloudFrontDistributions() + .getByResourceGroupWithResponse("rgcloudFrontDistribution", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE) + .getValue(); + resource.update().withTags(mapOf("key3727", "fakeTokenPlaceholder")).apply(); + } + + // Use "Map.of" if available + @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; + } +} +``` + +### CloudTrailTrails_CreateOrReplace + +```java +import com.azure.resourcemanager.awsconnector.models.AdvancedEventSelector; +import com.azure.resourcemanager.awsconnector.models.AdvancedFieldSelector; +import com.azure.resourcemanager.awsconnector.models.AwsCloudTrailProperties; +import com.azure.resourcemanager.awsconnector.models.CloudTrailProperties; +import com.azure.resourcemanager.awsconnector.models.DataResource; +import com.azure.resourcemanager.awsconnector.models.EventSelector; +import com.azure.resourcemanager.awsconnector.models.EventSelectorReadWriteType; +import com.azure.resourcemanager.awsconnector.models.InsightSelector; +import com.azure.resourcemanager.awsconnector.models.Tag; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for CloudTrailTrails CreateOrReplace. + */ +public final class CloudTrailTrailsCreateOrReplaceSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * CloudTrailTrails_CreateOrReplace.json + */ + /** + * Sample code: CloudTrailTrails_CreateOrReplace. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + cloudTrailTrailsCreateOrReplace(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.cloudTrailTrails() + .define("Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])") + .withRegion("lectoohspiqh") + .withExistingResourceGroup("rgcloudTrailTrail") + .withTags(mapOf("key8112", "fakeTokenPlaceholder")) + .withProperties( + new CloudTrailProperties() + .withAwsProperties(new AwsCloudTrailProperties() + .withAdvancedEventSelectors(Arrays.asList(new AdvancedEventSelector() + .withFieldSelectors( + Arrays.asList(new AdvancedFieldSelector().withEndsWith(Arrays.asList("xvhm")) + .withEquals(Arrays.asList("wxznrgvwsjlxdvssmmse")) + .withField("mq") + .withNotEndsWith(Arrays.asList("x")) + .withNotEquals(Arrays.asList("vglmmoivfeqg")) + .withNotStartsWith(Arrays.asList("pojptcfcw")) + .withStartsWith(Arrays.asList("fvldfltesnmpieljtehsvxudvxdujk")))) + .withName("ee"))) + .withArn("gbcn") + .withCloudWatchLogsLogGroupArn("nznfnuyxarmdmdtgjiougqgq") + .withCloudWatchLogsRoleArn("umhmpx") + .withEnableLogFileValidation(true) + .withEventSelectors(Arrays.asList(new EventSelector() + .withDataResources(Arrays.asList(new DataResource().withType("txxrjncwohiohorurqdxzabre") + .withValues(Arrays.asList("xhlnkujkbtpptbwchhh")))) + .withExcludeManagementEventSources(Arrays.asList("r")) + .withIncludeManagementEvents(true) + .withReadWriteType(EventSelectorReadWriteType.ALL))) + .withIncludeGlobalServiceEvents(true) + .withInsightSelectors( + Arrays.asList(new InsightSelector().withInsightType("brwlpasadlbwolsysta"))) + .withIsLogging(true) + .withIsMultiRegionTrail(true) + .withIsOrganizationTrail(true) + .withKmsKeyId("fakeTokenPlaceholder") + .withS3BucketName("iknyfgvujttyxsralujehxb") + .withS3KeyPrefix("fakeTokenPlaceholder") + .withSnsTopicArn("owdxqmsrqylekull") + .withSnsTopicName("goknthoxfekdccclolilvnyacvcop") + .withTags(Arrays.asList(new Tag().withKey("fakeTokenPlaceholder").withValue("vnsgm"))) + .withTrailName("oawneexezdnuouxdykllsflq")) + .withPublicCloudConnectorsResourceId("i") + .withAwsAccountId("mynelopf") + .withArn("jlwqroammottlyguyzu") + .withPublicCloudResourceName("aidwpmbkjspiucpvmzgg") + .withAwsSourceSchema("tvnaxpvricaiyoucpeauofeibwrk") + .withAwsRegion("dfvobbnupacpqsgexblxjlw") + .withAwsTags(mapOf("key5810", "fakeTokenPlaceholder"))) + .create(); + } + + // Use "Map.of" if available + @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; + } +} +``` + +### CloudTrailTrails_Delete + +```java +/** + * Samples for CloudTrailTrails Delete. + */ +public final class CloudTrailTrailsDeleteSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * CloudTrailTrails_Delete.json + */ + /** + * Sample code: CloudTrailTrails_Delete. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void cloudTrailTrailsDelete(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.cloudTrailTrails() + .delete("rgcloudTrailTrail", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE); + } +} +``` + +### CloudTrailTrails_GetByResourceGroup + +```java +/** + * Samples for CloudTrailTrails GetByResourceGroup. + */ +public final class CloudTrailTrailsGetByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * CloudTrailTrails_Get.json + */ + /** + * Sample code: CloudTrailTrails_Get. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void cloudTrailTrailsGet(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.cloudTrailTrails() + .getByResourceGroupWithResponse("rgcloudTrailTrail", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE); + } +} +``` + +### CloudTrailTrails_List + +```java +/** + * Samples for CloudTrailTrails List. + */ +public final class CloudTrailTrailsListSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * CloudTrailTrails_ListBySubscription.json + */ + /** + * Sample code: CloudTrailTrails_ListBySubscription. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + cloudTrailTrailsListBySubscription(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.cloudTrailTrails().list(com.azure.core.util.Context.NONE); + } +} +``` + +### CloudTrailTrails_ListByResourceGroup + +```java +/** + * Samples for CloudTrailTrails ListByResourceGroup. + */ +public final class CloudTrailTrailsListByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * CloudTrailTrails_ListByResourceGroup.json + */ + /** + * Sample code: CloudTrailTrails_ListByResourceGroup. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + cloudTrailTrailsListByResourceGroup(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.cloudTrailTrails().listByResourceGroup("rgcloudTrailTrail", com.azure.core.util.Context.NONE); + } +} +``` + +### CloudTrailTrails_Update + +```java +import com.azure.resourcemanager.awsconnector.models.CloudTrail; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for CloudTrailTrails Update. + */ +public final class CloudTrailTrailsUpdateSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * CloudTrailTrails_Update.json + */ + /** + * Sample code: CloudTrailTrails_Update. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void cloudTrailTrailsUpdate(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + CloudTrail resource = manager.cloudTrailTrails() + .getByResourceGroupWithResponse("rgcloudTrailTrail", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE) + .getValue(); + resource.update().withTags(mapOf("key1706", "fakeTokenPlaceholder")).apply(); + } + + // Use "Map.of" if available + @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; + } +} +``` + +### CloudWatchAlarms_CreateOrReplace + +```java +import com.azure.resourcemanager.awsconnector.models.AwsCloudWatchAlarmProperties; +import com.azure.resourcemanager.awsconnector.models.CloudWatchAlarmProperties; +import com.azure.resourcemanager.awsconnector.models.Dimension; +import com.azure.resourcemanager.awsconnector.models.Metric; +import com.azure.resourcemanager.awsconnector.models.MetricDataQuery; +import com.azure.resourcemanager.awsconnector.models.MetricStat; +import com.azure.resourcemanager.awsconnector.models.TagAutoGenerated6; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for CloudWatchAlarms CreateOrReplace. + */ +public final class CloudWatchAlarmsCreateOrReplaceSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * CloudWatchAlarms_CreateOrReplace.json + */ + /** + * Sample code: CloudWatchAlarms_CreateOrReplace. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + cloudWatchAlarmsCreateOrReplace(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.cloudWatchAlarms() + .define("Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])") + .withRegion("nbymldrgacokglzmyglynjohhnj") + .withExistingResourceGroup("rgcloudWatchAlarm") + .withTags(mapOf("key7594", "fakeTokenPlaceholder")) + .withProperties( + new CloudWatchAlarmProperties() + .withAwsProperties( + new AwsCloudWatchAlarmProperties().withActionsEnabled(true) + .withAlarmActions(Arrays.asList("ydnvbaggrnyxwzika")) + .withAlarmDescription("idvyiwmbllvlfvjcibommfbp") + .withAlarmName("ooriavzb") + .withArn("twsifnftkdrfzflvvsuka") + .withComparisonOperator("qo") + .withDatapointsToAlarm(30) + .withDimensions( + Arrays.asList(new Dimension().withName("bfnmnqiewf").withValue("lnphxdrevivdil"))) + .withEvaluateLowSampleCountPercentile("oihpnjstsw") + .withEvaluationPeriods(15) + .withExtendedStatistic("czkqsxjyzryvvkzoshk") + .withInsufficientDataActions(Arrays.asList("dfkb")) + .withMetricName("bkdkskukix") + .withMetrics( + Arrays + .asList( + new MetricDataQuery().withAccountId("rbtogpxgrissdcvqupcuhqqesz") + .withExpression("hhxrpieqtbvafrujybxxa") + .withId("zcevmcxhujphx") + .withLabel("jmeaobrgk") + .withMetricStat(new MetricStat() + .withMetric(new Metric() + .withDimensions(Arrays.asList(new Dimension().withName("bfnmnqiewf") + .withValue("lnphxdrevivdil"))) + .withMetricName("mabmwxjydr") + .withNamespace("wwoppcactqawdnkpxvjlo")) + .withPeriod(22) + .withStat("znmppqcobugvvlzccemylhxzsfsg") + .withUnit("vu")) + .withPeriod(27) + .withReturnData(true))) + .withNamespace("ptrnxovqoagxfepnjkpewbbusjkkzr") + .withOkActions(Arrays.asList("afskbnaohvdlb")) + .withPeriod(5) + .withStatistic("yrrnvsfpyvhnzlmw") + .withTags(Arrays + .asList(new TagAutoGenerated6().withKey("fakeTokenPlaceholder").withValue("zswuuw"))) + .withThreshold(17.0F) + .withThresholdMetricId("sqtfzityufokpxbthucjitcljvo") + .withTreatMissingData("iqrbyvljxufjwybtkjc") + .withUnit("vbjipwqqaobwlyebv")) + .withPublicCloudConnectorsResourceId("upovlpslvvatbmxiuwhvj") + .withAwsAccountId("qcoqhrkbfdowqmkzarqbtwcprj") + .withArn("uhqszqzfmdpnmiwu") + .withPublicCloudResourceName("sjxcsoycs") + .withAwsSourceSchema("drehzmurfidpdlcf") + .withAwsRegion("afpgkhpukllavze") + .withAwsTags(mapOf("key6400", "fakeTokenPlaceholder"))) + .create(); + } + + // Use "Map.of" if available + @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; + } +} +``` + +### CloudWatchAlarms_Delete + +```java +/** + * Samples for CloudWatchAlarms Delete. + */ +public final class CloudWatchAlarmsDeleteSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * CloudWatchAlarms_Delete.json + */ + /** + * Sample code: CloudWatchAlarms_Delete. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void cloudWatchAlarmsDelete(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.cloudWatchAlarms() + .delete("rgcloudWatchAlarm", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE); + } +} +``` + +### CloudWatchAlarms_GetByResourceGroup + +```java +/** + * Samples for CloudWatchAlarms GetByResourceGroup. + */ +public final class CloudWatchAlarmsGetByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * CloudWatchAlarms_Get.json + */ + /** + * Sample code: CloudWatchAlarms_Get. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void cloudWatchAlarmsGet(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.cloudWatchAlarms() + .getByResourceGroupWithResponse("rgcloudWatchAlarm", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE); + } +} +``` + +### CloudWatchAlarms_List + +```java +/** + * Samples for CloudWatchAlarms List. + */ +public final class CloudWatchAlarmsListSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * CloudWatchAlarms_ListBySubscription.json + */ + /** + * Sample code: CloudWatchAlarms_ListBySubscription. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + cloudWatchAlarmsListBySubscription(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.cloudWatchAlarms().list(com.azure.core.util.Context.NONE); + } +} +``` + +### CloudWatchAlarms_ListByResourceGroup + +```java +/** + * Samples for CloudWatchAlarms ListByResourceGroup. + */ +public final class CloudWatchAlarmsListByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * CloudWatchAlarms_ListByResourceGroup.json + */ + /** + * Sample code: CloudWatchAlarms_ListByResourceGroup. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + cloudWatchAlarmsListByResourceGroup(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.cloudWatchAlarms().listByResourceGroup("rgcloudWatchAlarm", com.azure.core.util.Context.NONE); + } +} +``` + +### CloudWatchAlarms_Update + +```java +import com.azure.resourcemanager.awsconnector.models.CloudWatchAlarm; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for CloudWatchAlarms Update. + */ +public final class CloudWatchAlarmsUpdateSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * CloudWatchAlarms_Update.json + */ + /** + * Sample code: CloudWatchAlarms_Update. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void cloudWatchAlarmsUpdate(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + CloudWatchAlarm resource = manager.cloudWatchAlarms() + .getByResourceGroupWithResponse("rgcloudWatchAlarm", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE) + .getValue(); + resource.update().withTags(mapOf("key5472", "fakeTokenPlaceholder")).apply(); + } + + // Use "Map.of" if available + @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; + } +} +``` + +### CodeBuildProjects_CreateOrReplace + +```java +import com.azure.resourcemanager.awsconnector.models.ArtifactNamespace; +import com.azure.resourcemanager.awsconnector.models.ArtifactNamespaceEnumValue; +import com.azure.resourcemanager.awsconnector.models.ArtifactPackaging; +import com.azure.resourcemanager.awsconnector.models.ArtifactPackagingEnumValue; +import com.azure.resourcemanager.awsconnector.models.ArtifactsType; +import com.azure.resourcemanager.awsconnector.models.ArtifactsTypeEnumValue; +import com.azure.resourcemanager.awsconnector.models.AwsCodeBuildProjectProperties; +import com.azure.resourcemanager.awsconnector.models.BatchReportModeType; +import com.azure.resourcemanager.awsconnector.models.BatchReportModeTypeEnumValue; +import com.azure.resourcemanager.awsconnector.models.BatchRestrictions; +import com.azure.resourcemanager.awsconnector.models.BucketOwnerAccess; +import com.azure.resourcemanager.awsconnector.models.BucketOwnerAccessEnumValue; +import com.azure.resourcemanager.awsconnector.models.BuildStatusConfig; +import com.azure.resourcemanager.awsconnector.models.CacheMode; +import com.azure.resourcemanager.awsconnector.models.CacheType; +import com.azure.resourcemanager.awsconnector.models.CacheTypeEnumValue; +import com.azure.resourcemanager.awsconnector.models.CloudWatchLogsConfig; +import com.azure.resourcemanager.awsconnector.models.CodeBuildProjectProperties; +import com.azure.resourcemanager.awsconnector.models.ComputeType; +import com.azure.resourcemanager.awsconnector.models.ComputeTypeEnumValue; +import com.azure.resourcemanager.awsconnector.models.CredentialProviderType; +import com.azure.resourcemanager.awsconnector.models.CredentialProviderTypeEnumValue; +import com.azure.resourcemanager.awsconnector.models.EnvironmentType; +import com.azure.resourcemanager.awsconnector.models.EnvironmentTypeEnumValue; +import com.azure.resourcemanager.awsconnector.models.EnvironmentVariable; +import com.azure.resourcemanager.awsconnector.models.EnvironmentVariableType; +import com.azure.resourcemanager.awsconnector.models.EnvironmentVariableTypeEnumValue; +import com.azure.resourcemanager.awsconnector.models.FileSystemType; +import com.azure.resourcemanager.awsconnector.models.FileSystemTypeEnumValue; +import com.azure.resourcemanager.awsconnector.models.FilterGroup; +import com.azure.resourcemanager.awsconnector.models.GitSubmodulesConfig; +import com.azure.resourcemanager.awsconnector.models.ImagePullCredentialsType; +import com.azure.resourcemanager.awsconnector.models.ImagePullCredentialsTypeEnumValue; +import com.azure.resourcemanager.awsconnector.models.LogsConfig; +import com.azure.resourcemanager.awsconnector.models.LogsConfigStatusType; +import com.azure.resourcemanager.awsconnector.models.LogsConfigStatusTypeEnumValue; +import com.azure.resourcemanager.awsconnector.models.ProjectArtifacts; +import com.azure.resourcemanager.awsconnector.models.ProjectBadge; +import com.azure.resourcemanager.awsconnector.models.ProjectBuildBatchConfig; +import com.azure.resourcemanager.awsconnector.models.ProjectCache; +import com.azure.resourcemanager.awsconnector.models.ProjectEnvironment; +import com.azure.resourcemanager.awsconnector.models.ProjectFileSystemLocation; +import com.azure.resourcemanager.awsconnector.models.ProjectFleet; +import com.azure.resourcemanager.awsconnector.models.ProjectSource; +import com.azure.resourcemanager.awsconnector.models.ProjectSourceVersion; +import com.azure.resourcemanager.awsconnector.models.ProjectVisibilityType; +import com.azure.resourcemanager.awsconnector.models.ProjectVisibilityTypeEnumValue; +import com.azure.resourcemanager.awsconnector.models.RegistryCredential; +import com.azure.resourcemanager.awsconnector.models.S3LogsConfig; +import com.azure.resourcemanager.awsconnector.models.SourceAuth; +import com.azure.resourcemanager.awsconnector.models.SourceAuthType; +import com.azure.resourcemanager.awsconnector.models.SourceAuthTypeEnumValue; +import com.azure.resourcemanager.awsconnector.models.SourceType; +import com.azure.resourcemanager.awsconnector.models.SourceTypeEnumValue; +import com.azure.resourcemanager.awsconnector.models.TagAutoGenerated7; +import com.azure.resourcemanager.awsconnector.models.VpcConfig; +import com.azure.resourcemanager.awsconnector.models.Webhook; +import com.azure.resourcemanager.awsconnector.models.WebhookBuildType; +import com.azure.resourcemanager.awsconnector.models.WebhookBuildTypeEnumValue; +import com.azure.resourcemanager.awsconnector.models.WebhookFilter; +import com.azure.resourcemanager.awsconnector.models.WebhookFilterType; +import com.azure.resourcemanager.awsconnector.models.WebhookFilterTypeEnumValue; +import java.time.OffsetDateTime; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for CodeBuildProjects CreateOrReplace. + */ +public final class CodeBuildProjectsCreateOrReplaceSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * CodeBuildProjects_CreateOrReplace.json + */ + /** + * Sample code: CodeBuildProjects_CreateOrReplace. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + codeBuildProjectsCreateOrReplace(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.codeBuildProjects() + .define("Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])") + .withRegion("fpjpnhlms") + .withExistingResourceGroup("rgcodeBuildProject") + .withTags(mapOf("key4761", "fakeTokenPlaceholder")) + .withProperties(new CodeBuildProjectProperties() + .withAwsProperties(new AwsCodeBuildProjectProperties().withArn("wwhfeljvmnwnqcgxusgnvoq") + .withArtifacts(new ProjectArtifacts() + .withArtifactIdentifier("hcfdqzwleorpe") + .withBucketOwnerAccess(new BucketOwnerAccessEnumValue().withValue(BucketOwnerAccess.FULL)) + .withEncryptionDisabled(true) + .withLocation("zvhsfl") + .withName("dsqyinskfvabyktgjbszny") + .withNamespaceType(new ArtifactNamespaceEnumValue().withValue(ArtifactNamespace.BUILD_ID)) + .withOverrideArtifactName(true) + .withPackaging(new ArtifactPackagingEnumValue().withValue(ArtifactPackaging.NONE)) + .withPath("zbsfhzkoet") + .withType(new ArtifactsTypeEnumValue().withValue(ArtifactsType.CODEPIPELINE))) + .withBadge(new ProjectBadge().withBadgeEnabled(true).withBadgeRequestUrl("ulpdsdbgtwm")) + .withBuildBatchConfig(new ProjectBuildBatchConfig() + .withBatchReportMode( + new BatchReportModeTypeEnumValue().withValue(BatchReportModeType.REPORT_AGGREGATED_BATCH)) + .withCombineArtifacts(true) + .withRestrictions( + new BatchRestrictions().withComputeTypesAllowed(Arrays.asList("ievoltoldfrhkpv")) + .withMaximumBuildsAllowed(15)) + .withServiceRole("lceqjutffrykpuzjxvijbzpames") + .withTimeoutInMins(3)) + .withCache(new ProjectCache().withLocation("wgmqyjzlxsazecszvdkfr") + .withModes(Arrays.asList(CacheMode.LOCAL_CUSTOM_CACHE)) + .withType(new CacheTypeEnumValue().withValue(CacheType.LOCAL))) + .withConcurrentBuildLimit(19) + .withCreated(OffsetDateTime.parse("2024-10-08T03:48:48.570Z")) + .withDescription("adnfxoh") + .withEncryptionKey("fakeTokenPlaceholder") + .withEnvironment( + new ProjectEnvironment().withCertificate("olzbdlydjqzkzlflzxcdjjjv") + .withComputeType(new ComputeTypeEnumValue().withValue(ComputeType.BUILD_GENERAL1_2XLARGE)) + .withEnvironmentVariables( + Arrays.asList(new EnvironmentVariable().withName("bmzlnmjzuxrxeemxfutykrlvemt") + .withType(new EnvironmentVariableTypeEnumValue() + .withValue(EnvironmentVariableType.PARAMETER_STORE)) + .withValue("eakfsmirkkwnizotyqqgmgjthn"))) + .withFleet(new ProjectFleet().withFleetArn("brslcsjgupcpeistg")) + .withImage("kkmioknmuhxurahmnjg") + .withImagePullCredentialsType( + new ImagePullCredentialsTypeEnumValue().withValue(ImagePullCredentialsType.CODEBUILD)) + .withPrivilegedMode(true) + .withRegistryCredential(new RegistryCredential().withCredential("fakeTokenPlaceholder") + .withCredentialProvider(new CredentialProviderTypeEnumValue() + .withValue(CredentialProviderType.SECRETS_MANAGER))) + .withType(new EnvironmentTypeEnumValue().withValue(EnvironmentType.ARM_CONTAINER))) + .withFileSystemLocations(Arrays.asList(new ProjectFileSystemLocation().withIdentifier("tdquc") + .withLocation("yeaotrzuhjtdtbfrlpvmlmaoqyioin") + .withMountOptions("tocdlorjekugjotphpxuyebjj") + .withMountPoint("fctmorvlmplsmeqvmavw") + .withType(new FileSystemTypeEnumValue().withValue(FileSystemType.EFS)))) + .withLastModified(OffsetDateTime.parse("2024-10-08T03:48:48.571Z")) + .withLogsConfig( + new LogsConfig() + .withCloudWatchLogs(new CloudWatchLogsConfig().withGroupName("t") + .withStatus( + new LogsConfigStatusTypeEnumValue().withValue(LogsConfigStatusType.DISABLED)) + .withStreamName("rrqzbaaicbiblat")) + .withS3Logs(new S3LogsConfig() + .withBucketOwnerAccess( + new BucketOwnerAccessEnumValue().withValue(BucketOwnerAccess.FULL)) + .withEncryptionDisabled(true) + .withLocation("zuepwokmlymlvsvzjawzxe") + .withStatus( + new LogsConfigStatusTypeEnumValue().withValue(LogsConfigStatusType.DISABLED)))) + .withName("budzhvktdvhxxy") + .withProjectVisibility(new ProjectVisibilityTypeEnumValue().withValue( + ProjectVisibilityType.PRIVATE)) + .withPublicProjectAlias("vstmzamjxtasdipcehcuwvfef") + .withQueuedTimeoutInMinutes(30) + .withResourceAccessRole("st") + .withSecondaryArtifacts(Arrays.asList(new ProjectArtifacts().withArtifactIdentifier("hcfdqzwleorpe") + .withBucketOwnerAccess(new BucketOwnerAccessEnumValue().withValue(BucketOwnerAccess.FULL)) + .withEncryptionDisabled(true) + .withLocation("zvhsfl") + .withName("dsqyinskfvabyktgjbszny") + .withNamespaceType(new ArtifactNamespaceEnumValue().withValue(ArtifactNamespace.BUILD_ID)) + .withOverrideArtifactName(true) + .withPackaging(new ArtifactPackagingEnumValue().withValue(ArtifactPackaging.NONE)) + .withPath("zbsfhzkoet") + .withType(new ArtifactsTypeEnumValue().withValue(ArtifactsType.CODEPIPELINE)))) + .withSecondarySourceVersions(Arrays.asList( + new ProjectSourceVersion() + .withSourceIdentifier("kiyezlaophakaslamcsxpkzggoj") + .withSourceVersion("zy"))) + .withSecondarySources( + Arrays + .asList( + new ProjectSource() + .withAuth( + new SourceAuth().withResource("oyfwquyzyjklbxlyjyddpmhmjgsgk") + .withType(new SourceAuthTypeEnumValue() + .withValue(SourceAuthType.CODECONNECTIONS))) + .withBuildStatusConfig( + new BuildStatusConfig().withContext("zoghbponrxfhugrjzdheibkada") + .withTargetUrl("ooonrchy")) + .withBuildspec("xxcoigvstisdhlfkfiblrgqhbtoqd") + .withGitCloneDepth(9) + .withGitSubmodulesConfig(new GitSubmodulesConfig().withFetchSubmodules(true)) + .withInsecureSsl(true) + .withLocation("owijjqkiwwegfcrynqcypho") + .withReportBuildStatus(true) + .withSourceIdentifier("lnhelescdeif") + .withType(new SourceTypeEnumValue().withValue(SourceType.BITBUCKET)))) + .withServiceRole("pydzdifzkz") + .withSource(new ProjectSource() + .withAuth(new SourceAuth().withResource("oyfwquyzyjklbxlyjyddpmhmjgsgk") + .withType(new SourceAuthTypeEnumValue().withValue(SourceAuthType.CODECONNECTIONS))) + .withBuildStatusConfig( + new BuildStatusConfig().withContext("zoghbponrxfhugrjzdheibkada").withTargetUrl("ooonrchy")) + .withBuildspec("xxcoigvstisdhlfkfiblrgqhbtoqd") + .withGitCloneDepth(9) + .withGitSubmodulesConfig(new GitSubmodulesConfig().withFetchSubmodules(true)) + .withInsecureSsl(true) + .withLocation("owijjqkiwwegfcrynqcypho") + .withReportBuildStatus(true) + .withSourceIdentifier("lnhelescdeif") + .withType(new SourceTypeEnumValue().withValue(SourceType.BITBUCKET))) + .withSourceVersion("idpngofzedxghp") + .withTags(Arrays + .asList(new TagAutoGenerated7().withKey("fakeTokenPlaceholder").withValue("iqwximmqwgsjlwdgv"))) + .withTimeoutInMinutes(7) + .withVpcConfig(new VpcConfig() + .withSecurityGroupIds(Arrays.asList("gcsqntkatjbigzj")) + .withSubnets(Arrays.asList("vxxzlquh")) + .withVpcId("dhjvrtrqgdb")) + .withWebhook( + new Webhook().withBranchFilter("fpfnqs") + .withBuildType(new WebhookBuildTypeEnumValue().withValue(WebhookBuildType.BUILD)) + .withFilterGroups(Arrays.asList( + new FilterGroup().withWebhookFilter(new WebhookFilter().withExcludeMatchedPattern(true) + .withPattern("ozqghxeblvksllu") + .withType(new WebhookFilterTypeEnumValue() + .withValue(WebhookFilterType.ACTOR_ACCOUNT_ID))))) + .withLastModifiedSecret(OffsetDateTime.parse("2024-10-08T03:48:48.574Z")) + .withPayloadUrl("wzalmmzopccsfbgwhxjneakxazu") + .withSecret("fakeTokenPlaceholder") + .withUrl("lwkywiwhmmdrirvajnxo"))) + .withPublicCloudConnectorsResourceId("azzcclgcodhtl") + .withAwsAccountId("caiac") + .withArn("ae") + .withPublicCloudResourceName("tzylnhhjwtzngucgrkvklav") + .withAwsSourceSchema("ujnztglujzqehsvvd") + .withAwsRegion("rakioiwqsjhpjqekyjft") + .withAwsTags(mapOf("key9822", "fakeTokenPlaceholder"))) + .create(); + } + + // Use "Map.of" if available + @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; + } +} +``` + +### CodeBuildProjects_Delete + +```java +/** + * Samples for CodeBuildProjects Delete. + */ +public final class CodeBuildProjectsDeleteSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * CodeBuildProjects_Delete.json + */ + /** + * Sample code: CodeBuildProjects_Delete. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void codeBuildProjectsDelete(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.codeBuildProjects() + .delete("rgcodeBuildProject", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE); + } +} +``` + +### CodeBuildProjects_GetByResourceGroup + +```java +/** + * Samples for CodeBuildProjects GetByResourceGroup. + */ +public final class CodeBuildProjectsGetByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * CodeBuildProjects_Get.json + */ + /** + * Sample code: CodeBuildProjects_Get. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void codeBuildProjectsGet(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.codeBuildProjects() + .getByResourceGroupWithResponse("rgcodeBuildProject", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE); + } +} +``` + +### CodeBuildProjects_List + +```java +/** + * Samples for CodeBuildProjects List. + */ +public final class CodeBuildProjectsListSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * CodeBuildProjects_ListBySubscription.json + */ + /** + * Sample code: CodeBuildProjects_ListBySubscription. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + codeBuildProjectsListBySubscription(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.codeBuildProjects().list(com.azure.core.util.Context.NONE); + } +} +``` + +### CodeBuildProjects_ListByResourceGroup + +```java +/** + * Samples for CodeBuildProjects ListByResourceGroup. + */ +public final class CodeBuildProjectsListByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * CodeBuildProjects_ListByResourceGroup.json + */ + /** + * Sample code: CodeBuildProjects_ListByResourceGroup. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + codeBuildProjectsListByResourceGroup(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.codeBuildProjects().listByResourceGroup("rgcodeBuildProject", com.azure.core.util.Context.NONE); + } +} +``` + +### CodeBuildProjects_Update + +```java +import com.azure.resourcemanager.awsconnector.models.CodeBuildProject; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for CodeBuildProjects Update. + */ +public final class CodeBuildProjectsUpdateSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * CodeBuildProjects_Update.json + */ + /** + * Sample code: CodeBuildProjects_Update. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void codeBuildProjectsUpdate(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + CodeBuildProject resource = manager.codeBuildProjects() + .getByResourceGroupWithResponse("rgcodeBuildProject", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE) + .getValue(); + resource.update().withTags(mapOf("key2639", "fakeTokenPlaceholder")).apply(); + } + + // Use "Map.of" if available + @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; + } +} +``` + +### CodeBuildSourceCredentialsInfos_CreateOrReplace + +```java +import com.azure.resourcemanager.awsconnector.models.AuthType; +import com.azure.resourcemanager.awsconnector.models.AuthTypeEnumValue; +import com.azure.resourcemanager.awsconnector.models.AwsCodeBuildSourceCredentialsInfoProperties; +import com.azure.resourcemanager.awsconnector.models.CodeBuildSourceCredentialsInfoProperties; +import com.azure.resourcemanager.awsconnector.models.ServerType; +import com.azure.resourcemanager.awsconnector.models.ServerTypeEnumValue; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for CodeBuildSourceCredentialsInfos CreateOrReplace. + */ +public final class CodeBuildSourceCredentialsInfosCreateOrReplaceSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * CodeBuildSourceCredentialsInfos_CreateOrReplace.json + */ + /** + * Sample code: CodeBuildSourceCredentialsInfos_CreateOrReplace. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void codeBuildSourceCredentialsInfosCreateOrReplace( + com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.codeBuildSourceCredentialsInfos() + .define("Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])") + .withRegion("ckmgfv") + .withExistingResourceGroup("rgcodeBuildSourceCredentialsInfo") + .withTags(mapOf("key9473", "fakeTokenPlaceholder")) + .withProperties(new CodeBuildSourceCredentialsInfoProperties() + .withAwsProperties(new AwsCodeBuildSourceCredentialsInfoProperties().withArn("ewe") + .withAuthType(new AuthTypeEnumValue().withValue(AuthType.BASIC_AUTH)) + .withResource("cnzfvgfcneqgffgfclggx") + .withServerType(new ServerTypeEnumValue().withValue(ServerType.BITBUCKET))) + .withPublicCloudConnectorsResourceId("cidijgvkoos") + .withAwsAccountId("bgwhzakphzjipkxqwy") + .withArn("wdxdkxuukdnrlpqgkmmvfagzrwom") + .withPublicCloudResourceName("uazcojlwlavznbfsrjzbtthat") + .withAwsSourceSchema("rhibtnvrfkidnqhyynub") + .withAwsRegion("vywlxfetnso") + .withAwsTags(mapOf("key3224", "fakeTokenPlaceholder"))) + .create(); + } + + // Use "Map.of" if available + @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; + } +} +``` + +### CodeBuildSourceCredentialsInfos_Delete + +```java +/** + * Samples for CodeBuildSourceCredentialsInfos Delete. + */ +public final class CodeBuildSourceCredentialsInfosDeleteSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * CodeBuildSourceCredentialsInfos_Delete.json + */ + /** + * Sample code: CodeBuildSourceCredentialsInfos_Delete. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + codeBuildSourceCredentialsInfosDelete(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.codeBuildSourceCredentialsInfos() + .delete("rgcodeBuildSourceCredentialsInfo", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE); + } +} +``` + +### CodeBuildSourceCredentialsInfos_GetByResourceGroup + +```java +/** + * Samples for CodeBuildSourceCredentialsInfos GetByResourceGroup. + */ +public final class CodeBuildSourceCredentialsInfosGetByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * CodeBuildSourceCredentialsInfos_Get.json + */ + /** + * Sample code: CodeBuildSourceCredentialsInfos_Get. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + codeBuildSourceCredentialsInfosGet(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.codeBuildSourceCredentialsInfos() + .getByResourceGroupWithResponse("rgcodeBuildSourceCredentialsInfo", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE); + } +} +``` + +### CodeBuildSourceCredentialsInfos_List + +```java +/** + * Samples for CodeBuildSourceCredentialsInfos List. + */ +public final class CodeBuildSourceCredentialsInfosListSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * CodeBuildSourceCredentialsInfos_ListBySubscription.json + */ + /** + * Sample code: CodeBuildSourceCredentialsInfos_ListBySubscription. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void codeBuildSourceCredentialsInfosListBySubscription( + com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.codeBuildSourceCredentialsInfos().list(com.azure.core.util.Context.NONE); + } +} +``` + +### CodeBuildSourceCredentialsInfos_ListByResourceGroup + +```java +/** + * Samples for CodeBuildSourceCredentialsInfos ListByResourceGroup. + */ +public final class CodeBuildSourceCredentialsInfosListByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * CodeBuildSourceCredentialsInfos_ListByResourceGroup.json + */ + /** + * Sample code: CodeBuildSourceCredentialsInfos_ListByResourceGroup. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void codeBuildSourceCredentialsInfosListByResourceGroup( + com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.codeBuildSourceCredentialsInfos() + .listByResourceGroup("rgcodeBuildSourceCredentialsInfo", com.azure.core.util.Context.NONE); + } +} +``` + +### CodeBuildSourceCredentialsInfos_Update + +```java +import com.azure.resourcemanager.awsconnector.models.CodeBuildSourceCredentialsInfo; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for CodeBuildSourceCredentialsInfos Update. + */ +public final class CodeBuildSourceCredentialsInfosUpdateSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * CodeBuildSourceCredentialsInfos_Update.json + */ + /** + * Sample code: CodeBuildSourceCredentialsInfos_Update. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + codeBuildSourceCredentialsInfosUpdate(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + CodeBuildSourceCredentialsInfo resource = manager.codeBuildSourceCredentialsInfos() + .getByResourceGroupWithResponse("rgcodeBuildSourceCredentialsInfo", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE) + .getValue(); + resource.update().withTags(mapOf("key7809", "fakeTokenPlaceholder")).apply(); + } + + // Use "Map.of" if available + @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; + } +} +``` + +### ConfigServiceConfigurationRecorderStatuses_CreateOrReplace + +```java +import com.azure.resourcemanager.awsconnector.models.AwsConfigServiceConfigurationRecorderStatusProperties; +import com.azure.resourcemanager.awsconnector.models.ConfigServiceConfigurationRecorderStatusProperties; +import com.azure.resourcemanager.awsconnector.models.RecorderStatus; +import com.azure.resourcemanager.awsconnector.models.RecorderStatusEnumValue; +import java.time.OffsetDateTime; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for ConfigServiceConfigurationRecorderStatuses CreateOrReplace. + */ +public final class ConfigServiceConfigurationRecorderStatusesCreateOrReplaceSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * ConfigServiceConfigurationRecorderStatuses_CreateOrReplace.json + */ + /** + * Sample code: ConfigServiceConfigurationRecorderStatuses_CreateOrReplace. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void configServiceConfigurationRecorderStatusesCreateOrReplace( + com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.configServiceConfigurationRecorderStatuses() + .define("Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])") + .withRegion("aanagogcqgqikndwcsiwpf") + .withExistingResourceGroup("rgconfigServiceConfigurationRecorderStatus") + .withTags(mapOf("key333", "fakeTokenPlaceholder")) + .withProperties(new ConfigServiceConfigurationRecorderStatusProperties() + .withAwsProperties(new AwsConfigServiceConfigurationRecorderStatusProperties() + .withLastErrorCode("fakeTokenPlaceholder") + .withLastErrorMessage("qcopqdjuuwuwdvdjmupwgrnxux") + .withLastStartTime(OffsetDateTime.parse("2024-10-08T03:54:51.026Z")) + .withLastStatus(new RecorderStatusEnumValue().withValue(RecorderStatus.FAILURE)) + .withLastStatusChangeTime(OffsetDateTime.parse("2024-10-08T03:54:51.038Z")) + .withLastStopTime(OffsetDateTime.parse("2024-10-08T03:54:51.038Z")) + .withName("mvnralcjhhrhhczxctukeumhnhhsvs") + .withRecording(true)) + .withPublicCloudConnectorsResourceId("fzembqicafznmnrvzudikggimnls") + .withAwsAccountId("dnnbcuuhaxys") + .withArn("iwxslgken") + .withPublicCloudResourceName("stvqbbbupeyrxdfrdlslkxbi") + .withAwsSourceSchema("qprhkzdetwvsaznwugwruaned") + .withAwsRegion("pffplccggyknjkyebtjepdzwbim") + .withAwsTags(mapOf("key2618", "fakeTokenPlaceholder"))) + .create(); + } + + // Use "Map.of" if available + @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; + } +} +``` + +### ConfigServiceConfigurationRecorderStatuses_Delete + +```java +/** + * Samples for ConfigServiceConfigurationRecorderStatuses Delete. + */ +public final class ConfigServiceConfigurationRecorderStatusesDeleteSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * ConfigServiceConfigurationRecorderStatuses_Delete.json + */ + /** + * Sample code: ConfigServiceConfigurationRecorderStatuses_Delete. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void configServiceConfigurationRecorderStatusesDelete( + com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.configServiceConfigurationRecorderStatuses() + .delete("rgconfigServiceConfigurationRecorderStatus", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE); + } +} +``` + +### ConfigServiceConfigurationRecorderStatuses_GetByResourceGroup + +```java +/** + * Samples for ConfigServiceConfigurationRecorderStatuses GetByResourceGroup. + */ +public final class ConfigServiceConfigurationRecorderStatusesGetByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * ConfigServiceConfigurationRecorderStatuses_Get.json + */ + /** + * Sample code: ConfigServiceConfigurationRecorderStatuses_Get. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void configServiceConfigurationRecorderStatusesGet( + com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.configServiceConfigurationRecorderStatuses() + .getByResourceGroupWithResponse("rgconfigServiceConfigurationRecorderStatus", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE); + } +} +``` + +### ConfigServiceConfigurationRecorderStatuses_List + +```java +/** + * Samples for ConfigServiceConfigurationRecorderStatuses List. + */ +public final class ConfigServiceConfigurationRecorderStatusesListSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * ConfigServiceConfigurationRecorderStatuses_ListBySubscription.json + */ + /** + * Sample code: ConfigServiceConfigurationRecorderStatuses_ListBySubscription. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void configServiceConfigurationRecorderStatusesListBySubscription( + com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.configServiceConfigurationRecorderStatuses().list(com.azure.core.util.Context.NONE); + } +} +``` + +### ConfigServiceConfigurationRecorderStatuses_ListByResourceGroup + +```java +/** + * Samples for ConfigServiceConfigurationRecorderStatuses ListByResourceGroup. + */ +public final class ConfigServiceConfigurationRecorderStatusesListByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * ConfigServiceConfigurationRecorderStatuses_ListByResourceGroup.json + */ + /** + * Sample code: ConfigServiceConfigurationRecorderStatuses_ListByResourceGroup. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void configServiceConfigurationRecorderStatusesListByResourceGroup( + com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.configServiceConfigurationRecorderStatuses() + .listByResourceGroup("rgconfigServiceConfigurationRecorderStatus", com.azure.core.util.Context.NONE); + } +} +``` + +### ConfigServiceConfigurationRecorderStatuses_Update + +```java +import com.azure.resourcemanager.awsconnector.models.ConfigServiceConfigurationRecorderStatus; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for ConfigServiceConfigurationRecorderStatuses Update. + */ +public final class ConfigServiceConfigurationRecorderStatusesUpdateSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * ConfigServiceConfigurationRecorderStatuses_Update.json + */ + /** + * Sample code: ConfigServiceConfigurationRecorderStatuses_Update. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void configServiceConfigurationRecorderStatusesUpdate( + com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + ConfigServiceConfigurationRecorderStatus resource = manager.configServiceConfigurationRecorderStatuses() + .getByResourceGroupWithResponse("rgconfigServiceConfigurationRecorderStatus", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE) + .getValue(); + resource.update().withTags(mapOf("key4598", "fakeTokenPlaceholder")).apply(); + } + + // Use "Map.of" if available + @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; + } +} +``` + +### ConfigServiceConfigurationRecorders_CreateOrReplace + +```java +import com.azure.resourcemanager.awsconnector.models.AwsConfigServiceConfigurationRecorderProperties; +import com.azure.resourcemanager.awsconnector.models.ConfigServiceConfigurationRecorderProperties; +import com.azure.resourcemanager.awsconnector.models.ExclusionByResourceTypes; +import com.azure.resourcemanager.awsconnector.models.RecordingFrequency; +import com.azure.resourcemanager.awsconnector.models.RecordingFrequencyEnumValue; +import com.azure.resourcemanager.awsconnector.models.RecordingGroup; +import com.azure.resourcemanager.awsconnector.models.RecordingMode; +import com.azure.resourcemanager.awsconnector.models.RecordingModeOverride; +import com.azure.resourcemanager.awsconnector.models.RecordingStrategy; +import com.azure.resourcemanager.awsconnector.models.RecordingStrategyType; +import com.azure.resourcemanager.awsconnector.models.RecordingStrategyTypeEnumValue; +import com.azure.resourcemanager.awsconnector.models.ResourceType; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for ConfigServiceConfigurationRecorders CreateOrReplace. + */ +public final class ConfigServiceConfigurationRecordersCreateOrReplaceSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * ConfigServiceConfigurationRecorders_CreateOrReplace.json + */ + /** + * Sample code: ConfigServiceConfigurationRecorders_CreateOrReplace. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void configServiceConfigurationRecordersCreateOrReplace( + com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.configServiceConfigurationRecorders() + .define("Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])") + .withRegion("uhzzvapzjrmbzxfxdqyczgmcq") + .withExistingResourceGroup("rgconfigServiceConfigurationRecorder") + .withTags(mapOf("key1719", "fakeTokenPlaceholder")) + .withProperties(new ConfigServiceConfigurationRecorderProperties() + .withAwsProperties(new AwsConfigServiceConfigurationRecorderProperties().withName("umkcdjmciwgorjwxtm") + .withRecordingGroup(new RecordingGroup().withAllSupported(true) + .withExclusionByResourceTypes(new ExclusionByResourceTypes() + .withResourceTypes(Arrays.asList(ResourceType.AWS_ACM_CERTIFICATE))) + .withIncludeGlobalResourceTypes(true) + .withRecordingStrategy(new RecordingStrategy().withUseOnly(new RecordingStrategyTypeEnumValue() + .withValue(RecordingStrategyType.ALL_SUPPORTED_RESOURCE_TYPES))) + .withResourceTypes(Arrays.asList(ResourceType.AWS_ACM_CERTIFICATE))) + .withRecordingMode(new RecordingMode() + .withRecordingFrequency( + new RecordingFrequencyEnumValue().withValue(RecordingFrequency.CONTINUOUS)) + .withRecordingModeOverrides( + Arrays.asList(new RecordingModeOverride().withDescription("fxclcxlsumaur") + .withRecordingFrequency( + new RecordingFrequencyEnumValue().withValue(RecordingFrequency.CONTINUOUS)) + .withResourceTypes(Arrays.asList(ResourceType.AWS_ACM_CERTIFICATE))))) + .withRoleArn("alfppyafyrtgacngfxckcioci")) + .withPublicCloudConnectorsResourceId("ofuen") + .withAwsAccountId("pxxfgnveimxacjnvjtionuq") + .withArn("jdsihdzklcqjurvrxp") + .withPublicCloudResourceName("sieljn") + .withAwsSourceSchema("eolodykekuepfruwphifvo") + .withAwsRegion("xvzbwkxfmww") + .withAwsTags(mapOf("key7810", "fakeTokenPlaceholder"))) + .create(); + } + + // Use "Map.of" if available + @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; + } +} +``` + +### ConfigServiceConfigurationRecorders_Delete + +```java +/** + * Samples for ConfigServiceConfigurationRecorders Delete. + */ +public final class ConfigServiceConfigurationRecordersDeleteSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * ConfigServiceConfigurationRecorders_Delete.json + */ + /** + * Sample code: ConfigServiceConfigurationRecorders_Delete. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + configServiceConfigurationRecordersDelete(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.configServiceConfigurationRecorders() + .delete("rgconfigServiceConfigurationRecorder", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE); + } +} +``` + +### ConfigServiceConfigurationRecorders_GetByResourceGroup + +```java +/** + * Samples for ConfigServiceConfigurationRecorders GetByResourceGroup. + */ +public final class ConfigServiceConfigurationRecordersGetByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * ConfigServiceConfigurationRecorders_Get.json + */ + /** + * Sample code: ConfigServiceConfigurationRecorders_Get. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + configServiceConfigurationRecordersGet(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.configServiceConfigurationRecorders() + .getByResourceGroupWithResponse("rgconfigServiceConfigurationRecorder", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE); + } +} +``` + +### ConfigServiceConfigurationRecorders_List + +```java +/** + * Samples for ConfigServiceConfigurationRecorders List. + */ +public final class ConfigServiceConfigurationRecordersListSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * ConfigServiceConfigurationRecorders_ListBySubscription.json + */ + /** + * Sample code: ConfigServiceConfigurationRecorders_ListBySubscription. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void configServiceConfigurationRecordersListBySubscription( + com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.configServiceConfigurationRecorders().list(com.azure.core.util.Context.NONE); + } +} +``` + +### ConfigServiceConfigurationRecorders_ListByResourceGroup + +```java +/** + * Samples for ConfigServiceConfigurationRecorders ListByResourceGroup. + */ +public final class ConfigServiceConfigurationRecordersListByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * ConfigServiceConfigurationRecorders_ListByResourceGroup.json + */ + /** + * Sample code: ConfigServiceConfigurationRecorders_ListByResourceGroup. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void configServiceConfigurationRecordersListByResourceGroup( + com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.configServiceConfigurationRecorders() + .listByResourceGroup("rgconfigServiceConfigurationRecorder", com.azure.core.util.Context.NONE); + } +} +``` + +### ConfigServiceConfigurationRecorders_Update + +```java +import com.azure.resourcemanager.awsconnector.models.ConfigServiceConfigurationRecorder; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for ConfigServiceConfigurationRecorders Update. + */ +public final class ConfigServiceConfigurationRecordersUpdateSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * ConfigServiceConfigurationRecorders_Update.json + */ + /** + * Sample code: ConfigServiceConfigurationRecorders_Update. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + configServiceConfigurationRecordersUpdate(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + ConfigServiceConfigurationRecorder resource = manager.configServiceConfigurationRecorders() + .getByResourceGroupWithResponse("rgconfigServiceConfigurationRecorder", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE) + .getValue(); + resource.update().withTags(mapOf("key455", "fakeTokenPlaceholder")).apply(); + } + + // Use "Map.of" if available + @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; + } +} +``` + +### ConfigServiceDeliveryChannels_CreateOrReplace + +```java +import com.azure.resourcemanager.awsconnector.models.AwsConfigServiceDeliveryChannelProperties; +import com.azure.resourcemanager.awsconnector.models.ConfigServiceDeliveryChannelProperties; +import com.azure.resourcemanager.awsconnector.models.ConfigSnapshotDeliveryProperties; +import com.azure.resourcemanager.awsconnector.models.MaximumExecutionFrequency; +import com.azure.resourcemanager.awsconnector.models.MaximumExecutionFrequencyEnumValue; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for ConfigServiceDeliveryChannels CreateOrReplace. + */ +public final class ConfigServiceDeliveryChannelsCreateOrReplaceSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * ConfigServiceDeliveryChannels_CreateOrReplace.json + */ + /** + * Sample code: ConfigServiceDeliveryChannels_CreateOrReplace. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void configServiceDeliveryChannelsCreateOrReplace( + com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.configServiceDeliveryChannels() + .define("Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])") + .withRegion("djcnfaicagptxk") + .withExistingResourceGroup("rgconfigServiceDeliveryChannel") + .withTags(mapOf("key6889", "fakeTokenPlaceholder")) + .withProperties(new ConfigServiceDeliveryChannelProperties() + .withAwsProperties(new AwsConfigServiceDeliveryChannelProperties() + .withConfigSnapshotDeliveryProperties(new ConfigSnapshotDeliveryProperties().withDeliveryFrequency( + new MaximumExecutionFrequencyEnumValue().withValue(MaximumExecutionFrequency.ONE_HOUR))) + .withName("pfdwjyiaypjjedltuphpz") + .withS3BucketName("kcgtpxhibekwygxkybv") + .withS3KeyPrefix("fakeTokenPlaceholder") + .withS3KmsKeyArn("fakeTokenPlaceholder") + .withSnsTopicArn("qsxejnowkzljayrlhzyyppaya")) + .withPublicCloudConnectorsResourceId("kzdkfyjjgkoolslydcmbms") + .withAwsAccountId("xiyydxsyykydvymn") + .withArn("eevsmaokvzzbqwpfm") + .withPublicCloudResourceName("idxxguxjmvrzjnruzz") + .withAwsSourceSchema("ged") + .withAwsRegion("kngfw") + .withAwsTags(mapOf("key5086", "fakeTokenPlaceholder"))) + .create(); + } + + // Use "Map.of" if available + @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; + } +} +``` + +### ConfigServiceDeliveryChannels_Delete + +```java +/** + * Samples for ConfigServiceDeliveryChannels Delete. + */ +public final class ConfigServiceDeliveryChannelsDeleteSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * ConfigServiceDeliveryChannels_Delete.json + */ + /** + * Sample code: ConfigServiceDeliveryChannels_Delete. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + configServiceDeliveryChannelsDelete(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.configServiceDeliveryChannels() + .delete("rgconfigServiceDeliveryChannel", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE); + } +} +``` + +### ConfigServiceDeliveryChannels_GetByResourceGroup + +```java +/** + * Samples for ConfigServiceDeliveryChannels GetByResourceGroup. + */ +public final class ConfigServiceDeliveryChannelsGetByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * ConfigServiceDeliveryChannels_Get.json + */ + /** + * Sample code: ConfigServiceDeliveryChannels_Get. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + configServiceDeliveryChannelsGet(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.configServiceDeliveryChannels() + .getByResourceGroupWithResponse("rgconfigServiceDeliveryChannel", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE); + } +} +``` + +### ConfigServiceDeliveryChannels_List + +```java +/** + * Samples for ConfigServiceDeliveryChannels List. + */ +public final class ConfigServiceDeliveryChannelsListSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * ConfigServiceDeliveryChannels_ListBySubscription.json + */ + /** + * Sample code: ConfigServiceDeliveryChannels_ListBySubscription. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void configServiceDeliveryChannelsListBySubscription( + com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.configServiceDeliveryChannels().list(com.azure.core.util.Context.NONE); + } +} +``` + +### ConfigServiceDeliveryChannels_ListByResourceGroup + +```java +/** + * Samples for ConfigServiceDeliveryChannels ListByResourceGroup. + */ +public final class ConfigServiceDeliveryChannelsListByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * ConfigServiceDeliveryChannels_ListByResourceGroup.json + */ + /** + * Sample code: ConfigServiceDeliveryChannels_ListByResourceGroup. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void configServiceDeliveryChannelsListByResourceGroup( + com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.configServiceDeliveryChannels() + .listByResourceGroup("rgconfigServiceDeliveryChannel", com.azure.core.util.Context.NONE); + } +} +``` + +### ConfigServiceDeliveryChannels_Update + +```java +import com.azure.resourcemanager.awsconnector.models.ConfigServiceDeliveryChannel; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for ConfigServiceDeliveryChannels Update. + */ +public final class ConfigServiceDeliveryChannelsUpdateSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * ConfigServiceDeliveryChannels_Update.json + */ + /** + * Sample code: ConfigServiceDeliveryChannels_Update. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + configServiceDeliveryChannelsUpdate(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + ConfigServiceDeliveryChannel resource = manager.configServiceDeliveryChannels() + .getByResourceGroupWithResponse("rgconfigServiceDeliveryChannel", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE) + .getValue(); + resource.update().withTags(mapOf("key7397", "fakeTokenPlaceholder")).apply(); + } + + // Use "Map.of" if available + @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; + } +} +``` + +### DatabaseMigrationServiceReplicationInstances_CreateOrReplace + +```java +import com.azure.resourcemanager.awsconnector.models.AvailabilityZone; +import com.azure.resourcemanager.awsconnector.models.AwsDatabaseMigrationServiceReplicationInstanceProperties; +import com.azure.resourcemanager.awsconnector.models.DatabaseMigrationServiceReplicationInstanceProperties; +import com.azure.resourcemanager.awsconnector.models.ReplicationPendingModifiedValues; +import com.azure.resourcemanager.awsconnector.models.ReplicationSubnetGroup; +import com.azure.resourcemanager.awsconnector.models.Subnet; +import com.azure.resourcemanager.awsconnector.models.VpcSecurityGroupMembership; +import java.time.OffsetDateTime; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for DatabaseMigrationServiceReplicationInstances CreateOrReplace. + */ +public final class DatabaseMigrationServiceReplicationInstancesCreateOrReplaceSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * DatabaseMigrationServiceReplicationInstances_CreateOrReplace.json + */ + /** + * Sample code: DatabaseMigrationServiceReplicationInstances_CreateOrReplace. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void databaseMigrationServiceReplicationInstancesCreateOrReplace( + com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.databaseMigrationServiceReplicationInstances() + .define("Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])") + .withRegion("pkvlgucpnkkigflvahztr") + .withExistingResourceGroup("rgdatabaseMigrationServiceReplicationInstance") + .withTags(mapOf("key2694", "fakeTokenPlaceholder")) + .withProperties( + new DatabaseMigrationServiceReplicationInstanceProperties() + .withAwsProperties( + new AwsDatabaseMigrationServiceReplicationInstanceProperties().withAllocatedStorage(15) + .withAutoMinorVersionUpgrade(true) + .withAvailabilityZone("ufwkddqfhigljgpouncfjtwjhcm") + .withDnsNameServers("gjlforgdkkjubyetzafznct") + .withEngineVersion("ugfhxgag") + .withFreeUntil(OffsetDateTime.parse("2024-10-08T03:53:04.775Z")) + .withInstanceCreateTime(OffsetDateTime.parse("2024-10-08T03:53:04.776Z")) + .withKmsKeyId("fakeTokenPlaceholder") + .withMultiAZ(true) + .withNetworkType("ognalkhwgr") + .withPendingModifiedValues(new ReplicationPendingModifiedValues().withAllocatedStorage(24) + .withEngineVersion("ljjlnnkamqo") + .withMultiAZ(true) + .withNetworkType("xgynwurnwuqfirccmedvhphptwx") + .withReplicationInstanceClass("nah")) + .withPreferredMaintenanceWindow("cjhj") + .withPubliclyAccessible(true) + .withReplicationInstanceArn("kkuagugx") + .withReplicationInstanceClass("nrejgjvmp") + .withReplicationInstanceIdentifier("kmkhuvkgshmfnqrkh") + .withReplicationInstanceIpv6Addresses(Arrays.asList("chankbhtkfgmmql")) + .withReplicationInstancePrivateIpAddress("kzpeupvtv") + .withReplicationInstancePrivateIpAddresses(Arrays.asList("wpvurjepdvyqsut")) + .withReplicationInstancePublicIpAddress("cgolgdimqmrtbs") + .withReplicationInstancePublicIpAddresses(Arrays.asList("laguuyhnutmqr")) + .withReplicationInstanceStatus("prkwehbwglimljckrujss") + .withReplicationSubnetGroup(new ReplicationSubnetGroup() + .withReplicationSubnetGroupDescription("octprj") + .withReplicationSubnetGroupIdentifier("lp") + .withSubnetGroupStatus("u") + .withSubnets(Arrays.asList(new Subnet() + .withSubnetAvailabilityZone(new AvailabilityZone().withName("zkqyndrxrxjgvbcwycfd")) + .withSubnetIdentifier("bbjyuchlt") + .withSubnetStatus("pzsp"))) + .withSupportedNetworkTypes(Arrays.asList("flrojgbtzlv")) + .withVpcId("zsg")) + .withSecondaryAvailabilityZone("gfricycigffhmqcwzxxzwevrwf") + .withVpcSecurityGroups(Arrays.asList(new VpcSecurityGroupMembership().withStatus("tioerjd") + .withVpcSecurityGroupId("szupfofnwyrfpcpwi")))) + .withPublicCloudConnectorsResourceId("oafkmlxerdytgq") + .withAwsAccountId("zkpbtrjskcsejrxvaulidr") + .withArn("hgieneplknqcgzbvoj") + .withPublicCloudResourceName("ajrdejnsykvcfzomaktse") + .withAwsSourceSchema("aj") + .withAwsRegion("xflnvjqertqoawntyvmyorzemmx") + .withAwsTags(mapOf("key1826", "fakeTokenPlaceholder"))) + .create(); + } + + // Use "Map.of" if available + @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; + } +} +``` + +### DatabaseMigrationServiceReplicationInstances_Delete + +```java +/** + * Samples for DatabaseMigrationServiceReplicationInstances Delete. + */ +public final class DatabaseMigrationServiceReplicationInstancesDeleteSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * DatabaseMigrationServiceReplicationInstances_Delete.json + */ + /** + * Sample code: DatabaseMigrationServiceReplicationInstances_Delete. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void databaseMigrationServiceReplicationInstancesDelete( + com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.databaseMigrationServiceReplicationInstances() + .delete("rgdatabaseMigrationServiceReplicationInstance", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE); + } +} +``` + +### DatabaseMigrationServiceReplicationInstances_GetByResourceGroup + +```java +/** + * Samples for DatabaseMigrationServiceReplicationInstances GetByResourceGroup. + */ +public final class DatabaseMigrationServiceReplicationInstancesGetByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * DatabaseMigrationServiceReplicationInstances_Get.json + */ + /** + * Sample code: DatabaseMigrationServiceReplicationInstances_Get. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void databaseMigrationServiceReplicationInstancesGet( + com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.databaseMigrationServiceReplicationInstances() + .getByResourceGroupWithResponse("rgdatabaseMigrationServiceReplicationInstance", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE); + } +} +``` + +### DatabaseMigrationServiceReplicationInstances_List + +```java +/** + * Samples for DatabaseMigrationServiceReplicationInstances List. + */ +public final class DatabaseMigrationServiceReplicationInstancesListSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * DatabaseMigrationServiceReplicationInstances_ListBySubscription.json + */ + /** + * Sample code: DatabaseMigrationServiceReplicationInstances_ListBySubscription. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void databaseMigrationServiceReplicationInstancesListBySubscription( + com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.databaseMigrationServiceReplicationInstances().list(com.azure.core.util.Context.NONE); + } +} +``` + +### DatabaseMigrationServiceReplicationInstances_ListByResourceGroup + +```java +/** + * Samples for DatabaseMigrationServiceReplicationInstances ListByResourceGroup. + */ +public final class DatabaseMigrationServiceReplicationInstancesListByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * DatabaseMigrationServiceReplicationInstances_ListByResourceGroup.json + */ + /** + * Sample code: DatabaseMigrationServiceReplicationInstances_ListByResourceGroup. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void databaseMigrationServiceReplicationInstancesListByResourceGroup( + com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.databaseMigrationServiceReplicationInstances() + .listByResourceGroup("rgdatabaseMigrationServiceReplicationInstance", com.azure.core.util.Context.NONE); + } +} +``` + +### DatabaseMigrationServiceReplicationInstances_Update + +```java +import com.azure.resourcemanager.awsconnector.models.DatabaseMigrationServiceReplicationInstance; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for DatabaseMigrationServiceReplicationInstances Update. + */ +public final class DatabaseMigrationServiceReplicationInstancesUpdateSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * DatabaseMigrationServiceReplicationInstances_Update.json + */ + /** + * Sample code: DatabaseMigrationServiceReplicationInstances_Update. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void databaseMigrationServiceReplicationInstancesUpdate( + com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + DatabaseMigrationServiceReplicationInstance resource = manager.databaseMigrationServiceReplicationInstances() + .getByResourceGroupWithResponse("rgdatabaseMigrationServiceReplicationInstance", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE) + .getValue(); + resource.update().withTags(mapOf("key4401", "fakeTokenPlaceholder")).apply(); + } + + // Use "Map.of" if available + @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; + } +} +``` + +### DaxClusters_CreateOrReplace + +```java +import com.azure.resourcemanager.awsconnector.models.AwsDaxClusterProperties; +import com.azure.resourcemanager.awsconnector.models.ClusterEndpointEncryptionType; +import com.azure.resourcemanager.awsconnector.models.ClusterEndpointEncryptionTypeEnumValue; +import com.azure.resourcemanager.awsconnector.models.DaxClusterProperties; +import com.azure.resourcemanager.awsconnector.models.Endpoint; +import com.azure.resourcemanager.awsconnector.models.Node; +import com.azure.resourcemanager.awsconnector.models.NotificationConfigurationAutoGenerated; +import com.azure.resourcemanager.awsconnector.models.ParameterGroupStatus; +import com.azure.resourcemanager.awsconnector.models.SecurityGroupMembership; +import com.azure.resourcemanager.awsconnector.models.SseDescription; +import com.azure.resourcemanager.awsconnector.models.SseStatus; +import com.azure.resourcemanager.awsconnector.models.SseStatusEnumValue; +import java.time.OffsetDateTime; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for DaxClusters CreateOrReplace. + */ +public final class DaxClustersCreateOrReplaceSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * DaxClusters_CreateOrReplace.json + */ + /** + * Sample code: DaxClusters_CreateOrReplace. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void daxClustersCreateOrReplace(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.daxClusters() + .define("Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])") + .withRegion("vmw") + .withExistingResourceGroup("rgdaxCluster") + .withTags(mapOf("key1674", "fakeTokenPlaceholder")) + .withProperties(new DaxClusterProperties() + .withAwsProperties(new AwsDaxClusterProperties().withActiveNodes(18) + .withClusterArn("drxcjkivmlrtslbwoykkohay") + .withClusterDiscoveryEndpoint(new Endpoint().withAddress("piabfnkoscysceufovcpffxl") + .withPort(13) + .withUrl("bcwzfeebgdzlvoafvyddknwzaih")) + .withClusterEndpointEncryptionType( + new ClusterEndpointEncryptionTypeEnumValue().withValue(ClusterEndpointEncryptionType.NONE)) + .withClusterName("zobzejccpfjaqcvzutazmzjbl") + .withDescription("q") + .withIamRoleArn("epmvlmhygrgjvx") + .withNodeIdsToRemove(Arrays.asList("uzzbmymlnrssuuqf")) + .withNodeType("vwyypkakaevefciygrniikfpyul") + .withNodes(Arrays.asList(new Node().withAvailabilityZone("j") + .withEndpoint(new Endpoint().withAddress("piabfnkoscysceufovcpffxl") + .withPort(13) + .withUrl("bcwzfeebgdzlvoafvyddknwzaih")) + .withNodeCreateTime(OffsetDateTime.parse("2024-10-08T03:51:45.186Z")) + .withNodeId("stfvsn") + .withNodeStatus("cvxigvbkflormrnhzzjp") + .withParameterGroupStatus("ywehlocxyzqprjzljpwluyd"))) + .withNotificationConfiguration( + new NotificationConfigurationAutoGenerated().withTopicArn("phhrllxlsvtkodsyamltvoypqoj") + .withTopicStatus("dfjjkb")) + .withParameterGroup(new ParameterGroupStatus().withNodeIdsToReboot(Arrays.asList("idyqnyv")) + .withParameterApplyStatus("jrxbdxqellqqtknz") + .withParameterGroupName("ezciyomlrtvgjq")) + .withPreferredMaintenanceWindow("gnqllhurfpmhsujlnznvuhtnacwfe") + .withSseDescription( + new SseDescription().withStatus(new SseStatusEnumValue().withValue(SseStatus.DISABLED))) + .withSecurityGroups( + Arrays.asList(new SecurityGroupMembership().withSecurityGroupIdentifier("ehbvorabecsniiea") + .withStatus("ymc"))) + .withStatus("mpwpseuoxrzbpamqwtibhochip") + .withSubnetGroup("tzsrvhfugpjrwm") + .withTotalNodes(26)) + .withPublicCloudConnectorsResourceId("jzzs") + .withAwsAccountId("xgeehpujhnyfhspdaqcugx") + .withArn("eqibkrig") + .withPublicCloudResourceName("rdpgjpjzbwahajy") + .withAwsSourceSchema("ukv") + .withAwsRegion("kyjdudcmqspnbb") + .withAwsTags(mapOf("key1821", "fakeTokenPlaceholder"))) + .create(); + } + + // Use "Map.of" if available + @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; + } +} +``` + +### DaxClusters_Delete + +```java +/** + * Samples for DaxClusters Delete. + */ +public final class DaxClustersDeleteSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/DaxClusters_Delete. + * json + */ + /** + * Sample code: DaxClusters_Delete. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void daxClustersDelete(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.daxClusters() + .delete("rgdaxCluster", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE); + } +} +``` + +### DaxClusters_GetByResourceGroup + +```java +/** + * Samples for DaxClusters GetByResourceGroup. + */ +public final class DaxClustersGetByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/DaxClusters_Get. + * json + */ + /** + * Sample code: DaxClusters_Get. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void daxClustersGet(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.daxClusters() + .getByResourceGroupWithResponse("rgdaxCluster", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE); + } +} +``` + +### DaxClusters_List + +```java +/** + * Samples for DaxClusters List. + */ +public final class DaxClustersListSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * DaxClusters_ListBySubscription.json + */ + /** + * Sample code: DaxClusters_ListBySubscription. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + daxClustersListBySubscription(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.daxClusters().list(com.azure.core.util.Context.NONE); + } +} +``` + +### DaxClusters_ListByResourceGroup + +```java +/** + * Samples for DaxClusters ListByResourceGroup. + */ +public final class DaxClustersListByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * DaxClusters_ListByResourceGroup.json + */ + /** + * Sample code: DaxClusters_ListByResourceGroup. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + daxClustersListByResourceGroup(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.daxClusters().listByResourceGroup("rgdaxCluster", com.azure.core.util.Context.NONE); + } +} +``` + +### DaxClusters_Update + +```java +import com.azure.resourcemanager.awsconnector.models.DaxCluster; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for DaxClusters Update. + */ +public final class DaxClustersUpdateSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/DaxClusters_Update. + * json + */ + /** + * Sample code: DaxClusters_Update. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void daxClustersUpdate(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + DaxCluster resource = manager.daxClusters() + .getByResourceGroupWithResponse("rgdaxCluster", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE) + .getValue(); + resource.update().withTags(mapOf("key3464", "fakeTokenPlaceholder")).apply(); + } + + // Use "Map.of" if available + @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; + } +} +``` + +### DynamoDbContinuousBackupsDescriptions_CreateOrReplace + +```java +import com.azure.resourcemanager.awsconnector.models.AwsDynamoDBContinuousBackupsDescriptionProperties; +import com.azure.resourcemanager.awsconnector.models.ContinuousBackupsStatus; +import com.azure.resourcemanager.awsconnector.models.ContinuousBackupsStatusEnumValue; +import com.azure.resourcemanager.awsconnector.models.DynamoDBContinuousBackupsDescriptionProperties; +import com.azure.resourcemanager.awsconnector.models.PointInTimeRecoveryDescription; +import com.azure.resourcemanager.awsconnector.models.PointInTimeRecoveryStatus; +import com.azure.resourcemanager.awsconnector.models.PointInTimeRecoveryStatusEnumValue; +import java.time.OffsetDateTime; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for DynamoDbContinuousBackupsDescriptions CreateOrReplace. + */ +public final class DynamoDbContinuousBackupsDescriptionsCreateOrReplaceSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * DynamoDbContinuousBackupsDescriptions_CreateOrReplace.json + */ + /** + * Sample code: DynamoDbContinuousBackupsDescriptions_CreateOrReplace. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void dynamoDbContinuousBackupsDescriptionsCreateOrReplace( + com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.dynamoDbContinuousBackupsDescriptions() + .define("Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])") + .withRegion("zlepfxe") + .withExistingResourceGroup("rgdynamoDBContinuousBackupsDescription") + .withTags(mapOf("key6182", "fakeTokenPlaceholder")) + .withProperties( + new DynamoDBContinuousBackupsDescriptionProperties() + .withAwsProperties(new AwsDynamoDBContinuousBackupsDescriptionProperties() + .withContinuousBackupsStatus( + new ContinuousBackupsStatusEnumValue().withValue(ContinuousBackupsStatus.DISABLED)) + .withPointInTimeRecoveryDescription(new PointInTimeRecoveryDescription() + .withEarliestRestorableDateTime(OffsetDateTime.parse("2024-10-08T03:52:00.281Z")) + .withLatestRestorableDateTime(OffsetDateTime.parse("2024-10-08T03:52:00.281Z")) + .withPointInTimeRecoveryStatus(new PointInTimeRecoveryStatusEnumValue() + .withValue(PointInTimeRecoveryStatus.DISABLED)))) + .withPublicCloudConnectorsResourceId("cmxfprcuzlfsuapudqgzmyrz") + .withAwsAccountId("mf") + .withArn("ftscqdgahea") + .withPublicCloudResourceName("y") + .withAwsSourceSchema("qdkzzibfkzzsphoguehj") + .withAwsRegion("vvdgggbbnkqfqlawtbkkxhtn") + .withAwsTags(mapOf("key4982", "fakeTokenPlaceholder"))) + .create(); + } + + // Use "Map.of" if available + @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; + } +} +``` + +### DynamoDbContinuousBackupsDescriptions_Delete + +```java +/** + * Samples for DynamoDbContinuousBackupsDescriptions Delete. + */ +public final class DynamoDbContinuousBackupsDescriptionsDeleteSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * DynamoDbContinuousBackupsDescriptions_Delete.json + */ + /** + * Sample code: DynamoDbContinuousBackupsDescriptions_Delete. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void dynamoDbContinuousBackupsDescriptionsDelete( + com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.dynamoDbContinuousBackupsDescriptions() + .delete("rgdynamoDBContinuousBackupsDescription", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE); + } +} +``` + +### DynamoDbContinuousBackupsDescriptions_GetByResourceGroup + +```java +/** + * Samples for DynamoDbContinuousBackupsDescriptions GetByResourceGroup. + */ +public final class DynamoDbContinuousBackupsDescriptionsGetByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * DynamoDbContinuousBackupsDescriptions_Get.json + */ + /** + * Sample code: DynamoDbContinuousBackupsDescriptions_Get. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + dynamoDbContinuousBackupsDescriptionsGet(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.dynamoDbContinuousBackupsDescriptions() + .getByResourceGroupWithResponse("rgdynamoDBContinuousBackupsDescription", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE); + } +} +``` + +### DynamoDbContinuousBackupsDescriptions_List + +```java +/** + * Samples for DynamoDbContinuousBackupsDescriptions List. + */ +public final class DynamoDbContinuousBackupsDescriptionsListSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * DynamoDbContinuousBackupsDescriptions_ListBySubscription.json + */ + /** + * Sample code: DynamoDbContinuousBackupsDescriptions_ListBySubscription. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void dynamoDbContinuousBackupsDescriptionsListBySubscription( + com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.dynamoDbContinuousBackupsDescriptions().list(com.azure.core.util.Context.NONE); + } +} +``` + +### DynamoDbContinuousBackupsDescriptions_ListByResourceGroup + +```java +/** + * Samples for DynamoDbContinuousBackupsDescriptions ListByResourceGroup. + */ +public final class DynamoDbContinuousBackupsDescriptionsListByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * DynamoDbContinuousBackupsDescriptions_ListByResourceGroup.json + */ + /** + * Sample code: DynamoDbContinuousBackupsDescriptions_ListByResourceGroup. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void dynamoDbContinuousBackupsDescriptionsListByResourceGroup( + com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.dynamoDbContinuousBackupsDescriptions() + .listByResourceGroup("rgdynamoDBContinuousBackupsDescription", com.azure.core.util.Context.NONE); + } +} +``` + +### DynamoDbContinuousBackupsDescriptions_Update + +```java +import com.azure.resourcemanager.awsconnector.models.DynamoDBContinuousBackupsDescription; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for DynamoDbContinuousBackupsDescriptions Update. + */ +public final class DynamoDbContinuousBackupsDescriptionsUpdateSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * DynamoDbContinuousBackupsDescriptions_Update.json + */ + /** + * Sample code: DynamoDbContinuousBackupsDescriptions_Update. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void dynamoDbContinuousBackupsDescriptionsUpdate( + com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + DynamoDBContinuousBackupsDescription resource = manager.dynamoDbContinuousBackupsDescriptions() + .getByResourceGroupWithResponse("rgdynamoDBContinuousBackupsDescription", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE) + .getValue(); + resource.update().withTags(mapOf("key5810", "fakeTokenPlaceholder")).apply(); + } + + // Use "Map.of" if available + @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; + } +} +``` + +### DynamoDbTables_CreateOrReplace + +```java +import com.azure.resourcemanager.awsconnector.models.AttributeDefinition; +import com.azure.resourcemanager.awsconnector.models.AwsDynamoDBTableProperties; +import com.azure.resourcemanager.awsconnector.models.ContributorInsightsSpecification; +import com.azure.resourcemanager.awsconnector.models.Csv; +import com.azure.resourcemanager.awsconnector.models.DynamoDBTableProperties; +import com.azure.resourcemanager.awsconnector.models.GlobalSecondaryIndex; +import com.azure.resourcemanager.awsconnector.models.ImportSourceSpecification; +import com.azure.resourcemanager.awsconnector.models.InputFormatOptions; +import com.azure.resourcemanager.awsconnector.models.KeySchema; +import com.azure.resourcemanager.awsconnector.models.KinesisStreamSpecification; +import com.azure.resourcemanager.awsconnector.models.KinesisStreamSpecificationApproximateCreationDateTimePrecision; +import com.azure.resourcemanager.awsconnector.models.LocalSecondaryIndex; +import com.azure.resourcemanager.awsconnector.models.PointInTimeRecoverySpecification; +import com.azure.resourcemanager.awsconnector.models.Projection; +import com.azure.resourcemanager.awsconnector.models.ProvisionedThroughput; +import com.azure.resourcemanager.awsconnector.models.ResourcePolicy; +import com.azure.resourcemanager.awsconnector.models.S3BucketSource; +import com.azure.resourcemanager.awsconnector.models.SseSpecification; +import com.azure.resourcemanager.awsconnector.models.StreamSpecification; +import com.azure.resourcemanager.awsconnector.models.TagAutoGenerated8; +import com.azure.resourcemanager.awsconnector.models.TimeToLiveSpecification; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for DynamoDbTables CreateOrReplace. + */ +public final class DynamoDbTablesCreateOrReplaceSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * DynamoDbTables_CreateOrReplace.json + */ + /** + * Sample code: DynamoDbTables_CreateOrReplace. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + dynamoDbTablesCreateOrReplace(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.dynamoDbTables() + .define("Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])") + .withRegion("fmkjilswdjyisfuwxuj") + .withExistingResourceGroup("rgdynamoDBTable") + .withTags(mapOf("key2178", "fakeTokenPlaceholder")) + .withProperties(new DynamoDBTableProperties().withAwsProperties(new AwsDynamoDBTableProperties() + .withArn("qbvqgymuxfzuwybdspdhcuvfouwnet") + .withAttributeDefinitions(Arrays.asList(new AttributeDefinition().withAttributeName("caryhpofnkqtoc") + .withAttributeType("bcmjgzaljcemcrswr"))) + .withBillingMode("pwxrsjcybdcidejuhvrckvxyxad") + .withContributorInsightsSpecification(new ContributorInsightsSpecification().withEnabled(true)) + .withDeletionProtectionEnabled(true) + .withGlobalSecondaryIndexes(Arrays.asList(new GlobalSecondaryIndex() + .withContributorInsightsSpecification(new ContributorInsightsSpecification().withEnabled(true)) + .withIndexName("uqlzacnvsvayrvirrwwttb") + .withKeySchema(Arrays.asList( + new KeySchema().withAttributeName("wisgqkyoouaxivtrtay").withKeyType("fakeTokenPlaceholder"))) + .withProjection(new Projection().withNonKeyAttributes(Arrays.asList("loqmvohtjsscueegam")) + .withProjectionType("atbzepkydpgudoaqi")) + .withProvisionedThroughput( + new ProvisionedThroughput().withReadCapacityUnits(10).withWriteCapacityUnits(28)))) + .withImportSourceSpecification( + new ImportSourceSpecification().withInputCompressionType("bjswmnwxleqmcth") + .withInputFormat("grnhhysgejvbnecrqoynjomz") + .withInputFormatOptions( + new InputFormatOptions().withCsv(new Csv().withDelimiter("qzowvvpwwhptthlgvrtnpyjszetrt") + .withHeaderList(Arrays.asList("gminuylhgebpjx")))) + .withS3BucketSource(new S3BucketSource().withS3Bucket("exulhkspgmo") + .withS3BucketOwner("pyawhaxbwqhgarz") + .withS3KeyPrefix("fakeTokenPlaceholder"))) + .withKeySchema(Arrays.asList( + new KeySchema().withAttributeName("wisgqkyoouaxivtrtay").withKeyType("fakeTokenPlaceholder"))) + .withKinesisStreamSpecification(new KinesisStreamSpecification() + .withApproximateCreationDateTimePrecision( + KinesisStreamSpecificationApproximateCreationDateTimePrecision.MICROSECOND) + .withStreamArn("qldltl")) + .withLocalSecondaryIndexes(Arrays.asList(new LocalSecondaryIndex().withIndexName("gintyosxvkjqpe") + .withKeySchema(Arrays.asList( + new KeySchema().withAttributeName("wisgqkyoouaxivtrtay").withKeyType("fakeTokenPlaceholder"))) + .withProjection(new Projection().withNonKeyAttributes(Arrays.asList("loqmvohtjsscueegam")) + .withProjectionType("atbzepkydpgudoaqi")))) + .withPointInTimeRecoverySpecification( + new PointInTimeRecoverySpecification().withPointInTimeRecoveryEnabled(true)) + .withProvisionedThroughput( + new ProvisionedThroughput().withReadCapacityUnits(10).withWriteCapacityUnits(28)) + .withResourcePolicy(new ResourcePolicy()) + .withSseSpecification(new SseSpecification().withKmsMasterKeyId("fakeTokenPlaceholder") + .withSseEnabled(true) + .withSseType("osjalywculjbrystezvjojxe")) + .withStreamArn("xvkrzs") + .withStreamSpecification( + new StreamSpecification().withResourcePolicy(new ResourcePolicy()).withStreamViewType("wemod")) + .withTableClass("tmbfrfbppwhjpm") + .withTableName("mqvlcdboopn") + .withTags(Arrays.asList(new TagAutoGenerated8().withKey("fakeTokenPlaceholder").withValue("dkgweupnz"))) + .withTimeToLiveSpecification( + new TimeToLiveSpecification().withAttributeName("sxbfejubturdtyusqywguqni").withEnabled(true))) + .withPublicCloudConnectorsResourceId("nugnoqcknmrrminwvfvloqsporjd") + .withAwsAccountId("dejqcxb") + .withArn("gimtbcfiznraniycjyalnwrfstm") + .withPublicCloudResourceName("lkbwyvnzooydbnembmykhmw") + .withAwsSourceSchema("sqkkuxwamzevkp") + .withAwsRegion("rdzrhtbydhmaxzuwe") + .withAwsTags(mapOf("key3791", "fakeTokenPlaceholder"))) + .create(); + } + + // Use "Map.of" if available + @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; + } +} +``` + +### DynamoDbTables_Delete + +```java +/** + * Samples for DynamoDbTables Delete. + */ +public final class DynamoDbTablesDeleteSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * DynamoDbTables_Delete.json + */ + /** + * Sample code: DynamoDbTables_Delete. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void dynamoDbTablesDelete(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.dynamoDbTables() + .delete("rgdynamoDBTable", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE); + } +} +``` + +### DynamoDbTables_GetByResourceGroup + +```java +/** + * Samples for DynamoDbTables GetByResourceGroup. + */ +public final class DynamoDbTablesGetByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/DynamoDbTables_Get. + * json + */ + /** + * Sample code: DynamoDbTables_Get. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void dynamoDbTablesGet(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.dynamoDbTables() + .getByResourceGroupWithResponse("rgdynamoDBTable", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE); + } +} +``` + +### DynamoDbTables_List + +```java +/** + * Samples for DynamoDbTables List. + */ +public final class DynamoDbTablesListSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * DynamoDbTables_ListBySubscription.json + */ + /** + * Sample code: DynamoDbTables_ListBySubscription. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + dynamoDbTablesListBySubscription(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.dynamoDbTables().list(com.azure.core.util.Context.NONE); + } +} +``` + +### DynamoDbTables_ListByResourceGroup + +```java +/** + * Samples for DynamoDbTables ListByResourceGroup. + */ +public final class DynamoDbTablesListByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * DynamoDbTables_ListByResourceGroup.json + */ + /** + * Sample code: DynamoDbTables_ListByResourceGroup. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + dynamoDbTablesListByResourceGroup(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.dynamoDbTables().listByResourceGroup("rgdynamoDBTable", com.azure.core.util.Context.NONE); + } +} +``` + +### DynamoDbTables_Update + +```java +import com.azure.resourcemanager.awsconnector.models.DynamoDBTable; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for DynamoDbTables Update. + */ +public final class DynamoDbTablesUpdateSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * DynamoDbTables_Update.json + */ + /** + * Sample code: DynamoDbTables_Update. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void dynamoDbTablesUpdate(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + DynamoDBTable resource = manager.dynamoDbTables() + .getByResourceGroupWithResponse("rgdynamoDBTable", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE) + .getValue(); + resource.update().withTags(mapOf("key6429", "fakeTokenPlaceholder")).apply(); + } + + // Use "Map.of" if available + @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; + } +} +``` + +### Ec2AccountAttributes_CreateOrReplace + +```java +import com.azure.resourcemanager.awsconnector.models.AccountAttributeValue; +import com.azure.resourcemanager.awsconnector.models.AwsEc2AccountAttributeProperties; +import com.azure.resourcemanager.awsconnector.models.Ec2AccountAttributeProperties; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for Ec2AccountAttributes CreateOrReplace. + */ +public final class Ec2AccountAttributesCreateOrReplaceSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * Ec2AccountAttributes_CreateOrReplace.json + */ + /** + * Sample code: Ec2AccountAttributes_CreateOrReplace. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + ec2AccountAttributesCreateOrReplace(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.ec2AccountAttributes() + .define("Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])") + .withRegion("mxywielgbokfdxxwuudnbwzjcf") + .withExistingResourceGroup("rgec2AccountAttribute") + .withTags(mapOf("key6022", "fakeTokenPlaceholder")) + .withProperties(new Ec2AccountAttributeProperties() + .withAwsProperties(new AwsEc2AccountAttributeProperties().withAttributeName("vsrccnoksnxyyisrlfzkuj") + .withAttributeValues( + Arrays.asList(new AccountAttributeValue().withAttributeValue("lvlyhjnivtpgkbt")))) + .withPublicCloudConnectorsResourceId("rmmqxjdxoe") + .withAwsAccountId("jzeepmbcwiwakwsvqakkaz") + .withArn("ttwi") + .withPublicCloudResourceName("lhdzqjxtfagnhbdjev") + .withAwsSourceSchema("njukzwmmwgmvurer") + .withAwsRegion("ojtquhkurhjtoocjpjyibb") + .withAwsTags(mapOf("key2779", "fakeTokenPlaceholder"))) + .create(); + } + + // Use "Map.of" if available + @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; + } +} +``` + +### Ec2AccountAttributes_Delete + +```java +/** + * Samples for Ec2AccountAttributes Delete. + */ +public final class Ec2AccountAttributesDeleteSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * Ec2AccountAttributes_Delete.json + */ + /** + * Sample code: Ec2AccountAttributes_Delete. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void ec2AccountAttributesDelete(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.ec2AccountAttributes() + .delete("rgec2AccountAttribute", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE); + } +} +``` + +### Ec2AccountAttributes_GetByResourceGroup + +```java +/** + * Samples for Ec2AccountAttributes GetByResourceGroup. + */ +public final class Ec2AccountAttributesGetByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * Ec2AccountAttributes_Get.json + */ + /** + * Sample code: Ec2AccountAttributes_Get. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void ec2AccountAttributesGet(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.ec2AccountAttributes() + .getByResourceGroupWithResponse("rgec2AccountAttribute", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE); + } +} +``` + +### Ec2AccountAttributes_List + +```java +/** + * Samples for Ec2AccountAttributes List. + */ +public final class Ec2AccountAttributesListSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * Ec2AccountAttributes_ListBySubscription.json + */ + /** + * Sample code: Ec2AccountAttributes_ListBySubscription. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + ec2AccountAttributesListBySubscription(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.ec2AccountAttributes().list(com.azure.core.util.Context.NONE); + } +} +``` + +### Ec2AccountAttributes_ListByResourceGroup + +```java +/** + * Samples for Ec2AccountAttributes ListByResourceGroup. + */ +public final class Ec2AccountAttributesListByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * Ec2AccountAttributes_ListByResourceGroup.json + */ + /** + * Sample code: Ec2AccountAttributes_ListByResourceGroup. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + ec2AccountAttributesListByResourceGroup(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.ec2AccountAttributes().listByResourceGroup("rgec2AccountAttribute", com.azure.core.util.Context.NONE); + } +} +``` + +### Ec2AccountAttributes_Update + +```java +import com.azure.resourcemanager.awsconnector.models.Ec2AccountAttribute; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for Ec2AccountAttributes Update. + */ +public final class Ec2AccountAttributesUpdateSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * Ec2AccountAttributes_Update.json + */ + /** + * Sample code: Ec2AccountAttributes_Update. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void ec2AccountAttributesUpdate(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + Ec2AccountAttribute resource = manager.ec2AccountAttributes() + .getByResourceGroupWithResponse("rgec2AccountAttribute", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE) + .getValue(); + resource.update().withTags(mapOf("key675", "fakeTokenPlaceholder")).apply(); + } + + // Use "Map.of" if available + @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; + } +} +``` + +### Ec2Addresses_CreateOrReplace + +```java +import com.azure.resourcemanager.awsconnector.models.AwsEc2AddressProperties; +import com.azure.resourcemanager.awsconnector.models.DomainType; +import com.azure.resourcemanager.awsconnector.models.DomainTypeEnumValue; +import com.azure.resourcemanager.awsconnector.models.Ec2AddressProperties; +import com.azure.resourcemanager.awsconnector.models.TagAutoGenerated9; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for Ec2Addresses CreateOrReplace. + */ +public final class Ec2AddressesCreateOrReplaceSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * Ec2Addresses_CreateOrReplace.json + */ + /** + * Sample code: Ec2Addresses_CreateOrReplace. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void ec2AddressesCreateOrReplace(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.ec2Addresses() + .define("Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])") + .withRegion("uwbmdjhaqaqz") + .withExistingResourceGroup("rgec2Address") + .withTags(mapOf("key991", "fakeTokenPlaceholder")) + .withProperties(new Ec2AddressProperties() + .withAwsProperties(new AwsEc2AddressProperties().withAllocationId("lakfpwuipmqvwqzpiojxgxjrh") + .withAssociationId("wwgugzolrxtpvpaxafaqi") + .withCarrierIp("tpwlxdfmqhkr") + .withCustomerOwnedIp("qpvlzqkbksm") + .withCustomerOwnedIpv4Pool("sbzgaydiiwsnarhj") + .withDomain(new DomainTypeEnumValue().withValue(DomainType.STANDARD)) + .withInstanceId("lcw") + .withNetworkBorderGroup("cvmuzymwrwriouiziwwhybkwv") + .withNetworkInterfaceId("pundetxxybkvjkwhenmdlxzoji") + .withNetworkInterfaceOwnerId("mxcypkkbqs") + .withPrivateIpAddress("syfgrbvaucqkmkakjhez") + .withPublicIp("uzkzeonfghtefuulqaev") + .withPublicIpv4Pool("dlv") + .withTags(Arrays.asList(new TagAutoGenerated9().withKey("fakeTokenPlaceholder") + .withValue("tcahesrhkpnaonjnhbfsmiyhypjmw")))) + .withPublicCloudConnectorsResourceId("eytnpsrqhczygcelqjky") + .withAwsAccountId("nfzczrgklte") + .withArn("kgqnwrdoqeqjraczlznfiu") + .withPublicCloudResourceName("xongligvmdxe") + .withAwsSourceSchema("uachsjdkxtczamkh") + .withAwsRegion("qocfydee") + .withAwsTags(mapOf("key6276", "fakeTokenPlaceholder"))) + .create(); + } + + // Use "Map.of" if available + @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; + } +} +``` + +### Ec2Addresses_Delete + +```java +/** + * Samples for Ec2Addresses Delete. + */ +public final class Ec2AddressesDeleteSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/Ec2Addresses_Delete + * .json + */ + /** + * Sample code: Ec2Addresses_Delete. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void ec2AddressesDelete(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.ec2Addresses() + .delete("rgec2Address", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE); + } +} +``` + +### Ec2Addresses_GetByResourceGroup + +```java +/** + * Samples for Ec2Addresses GetByResourceGroup. + */ +public final class Ec2AddressesGetByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/Ec2Addresses_Get. + * json + */ + /** + * Sample code: Ec2Addresses_Get. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void ec2AddressesGet(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.ec2Addresses() + .getByResourceGroupWithResponse("rgec2Address", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE); + } +} +``` + +### Ec2Addresses_List + +```java +/** + * Samples for Ec2Addresses List. + */ +public final class Ec2AddressesListSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * Ec2Addresses_ListBySubscription.json + */ + /** + * Sample code: Ec2Addresses_ListBySubscription. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + ec2AddressesListBySubscription(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.ec2Addresses().list(com.azure.core.util.Context.NONE); + } +} +``` + +### Ec2Addresses_ListByResourceGroup + +```java +/** + * Samples for Ec2Addresses ListByResourceGroup. + */ +public final class Ec2AddressesListByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * Ec2Addresses_ListByResourceGroup.json + */ + /** + * Sample code: Ec2Addresses_ListByResourceGroup. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + ec2AddressesListByResourceGroup(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.ec2Addresses().listByResourceGroup("rgec2Address", com.azure.core.util.Context.NONE); + } +} +``` + +### Ec2Addresses_Update + +```java +import com.azure.resourcemanager.awsconnector.models.Ec2Address; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for Ec2Addresses Update. + */ +public final class Ec2AddressesUpdateSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/Ec2Addresses_Update + * .json + */ + /** + * Sample code: Ec2Addresses_Update. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void ec2AddressesUpdate(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + Ec2Address resource = manager.ec2Addresses() + .getByResourceGroupWithResponse("rgec2Address", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE) + .getValue(); + resource.update().withTags(mapOf("key976", "fakeTokenPlaceholder")).apply(); + } + + // Use "Map.of" if available + @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; + } +} +``` + +### Ec2FlowLogs_CreateOrReplace + +```java +import com.azure.resourcemanager.awsconnector.models.AwsEc2FlowLogProperties; +import com.azure.resourcemanager.awsconnector.models.DestinationOptionsModelProperties; +import com.azure.resourcemanager.awsconnector.models.Ec2FlowLogProperties; +import com.azure.resourcemanager.awsconnector.models.FileFormat; +import com.azure.resourcemanager.awsconnector.models.LogDestinationType; +import com.azure.resourcemanager.awsconnector.models.ResourceType; +import com.azure.resourcemanager.awsconnector.models.TagAutoGenerated10; +import com.azure.resourcemanager.awsconnector.models.TrafficType; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for Ec2FlowLogs CreateOrReplace. + */ +public final class Ec2FlowLogsCreateOrReplaceSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * Ec2FlowLogs_CreateOrReplace.json + */ + /** + * Sample code: Ec2FlowLogs_CreateOrReplace. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void ec2FlowLogsCreateOrReplace(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.ec2FlowLogs() + .define("Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])") + .withRegion("iheortzyczwfplyjuuqwhdtpscn") + .withExistingResourceGroup("rgec2FlowLog") + .withTags(mapOf("key8783", "fakeTokenPlaceholder")) + .withProperties(new Ec2FlowLogProperties() + .withAwsProperties(new AwsEc2FlowLogProperties().withDeliverCrossAccountRole("upu") + .withDeliverLogsPermissionArn("sfhmarwniuptmkaegsplmsozsmc") + .withDestinationOptions(new DestinationOptionsModelProperties().withFileFormat(FileFormat.PARQUET) + .withHiveCompatiblePartitions(true) + .withPerHourPartition(true)) + .withId("idflwxdxpu") + .withLogDestination("ztqhcrirplxmgncvubutyzqefvd") + .withLogDestinationType(LogDestinationType.CLOUD_WATCH_LOGS) + .withLogFormat("miqwrkvqyq") + .withLogGroupName("gptervjekilsbzqokcmrbumaie") + .withMaxAggregationInterval(15) + .withResourceId("mokmavuqvq") + .withResourceType(ResourceType.fromString("NetworkInterface")) + .withTags(Arrays.asList(new TagAutoGenerated10().withKey("fakeTokenPlaceholder") + .withValue("qdqsngozfinennzbilnzeemjzilpb"))) + .withTrafficType(TrafficType.ACCEPT)) + .withPublicCloudConnectorsResourceId("djh") + .withAwsAccountId("shsomlkgpjnxnonvrv") + .withArn("ilajcrcqxitnhyhorqitssmvsfwen") + .withPublicCloudResourceName("ymv") + .withAwsSourceSchema("pnjgqxqhnwhcs") + .withAwsRegion("stazvnpsmrpkoxyyzngdkkuif") + .withAwsTags(mapOf("key3000", "fakeTokenPlaceholder"))) + .create(); + } + + // Use "Map.of" if available + @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; + } +} +``` + +### Ec2FlowLogs_Delete + +```java +/** + * Samples for Ec2FlowLogs Delete. + */ +public final class Ec2FlowLogsDeleteSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/Ec2FlowLogs_Delete. + * json + */ + /** + * Sample code: Ec2FlowLogs_Delete. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void ec2FlowLogsDelete(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.ec2FlowLogs() + .delete("rgec2FlowLog", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE); + } +} +``` + +### Ec2FlowLogs_GetByResourceGroup + +```java +/** + * Samples for Ec2FlowLogs GetByResourceGroup. + */ +public final class Ec2FlowLogsGetByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/Ec2FlowLogs_Get. + * json + */ + /** + * Sample code: Ec2FlowLogs_Get. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void ec2FlowLogsGet(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.ec2FlowLogs() + .getByResourceGroupWithResponse("rgec2FlowLog", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE); + } +} +``` + +### Ec2FlowLogs_List + +```java +/** + * Samples for Ec2FlowLogs List. + */ +public final class Ec2FlowLogsListSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * Ec2FlowLogs_ListBySubscription.json + */ + /** + * Sample code: Ec2FlowLogs_ListBySubscription. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + ec2FlowLogsListBySubscription(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.ec2FlowLogs().list(com.azure.core.util.Context.NONE); + } +} +``` + +### Ec2FlowLogs_ListByResourceGroup + +```java +/** + * Samples for Ec2FlowLogs ListByResourceGroup. + */ +public final class Ec2FlowLogsListByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * Ec2FlowLogs_ListByResourceGroup.json + */ + /** + * Sample code: Ec2FlowLogs_ListByResourceGroup. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + ec2FlowLogsListByResourceGroup(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.ec2FlowLogs().listByResourceGroup("rgec2FlowLog", com.azure.core.util.Context.NONE); + } +} +``` + +### Ec2FlowLogs_Update + +```java +import com.azure.resourcemanager.awsconnector.models.Ec2FlowLog; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for Ec2FlowLogs Update. + */ +public final class Ec2FlowLogsUpdateSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/Ec2FlowLogs_Update. + * json + */ + /** + * Sample code: Ec2FlowLogs_Update. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void ec2FlowLogsUpdate(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + Ec2FlowLog resource = manager.ec2FlowLogs() + .getByResourceGroupWithResponse("rgec2FlowLog", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE) + .getValue(); + resource.update().withTags(mapOf("key6176", "fakeTokenPlaceholder")).apply(); + } + + // Use "Map.of" if available + @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; + } +} +``` + +### Ec2Images_CreateOrReplace + +```java +import com.azure.resourcemanager.awsconnector.models.ArchitectureValues; +import com.azure.resourcemanager.awsconnector.models.ArchitectureValuesEnumValue; +import com.azure.resourcemanager.awsconnector.models.AwsEc2ImageProperties; +import com.azure.resourcemanager.awsconnector.models.BlockDeviceMapping; +import com.azure.resourcemanager.awsconnector.models.BootModeValues; +import com.azure.resourcemanager.awsconnector.models.BootModeValuesEnumValue; +import com.azure.resourcemanager.awsconnector.models.DeviceType; +import com.azure.resourcemanager.awsconnector.models.DeviceTypeEnumValue; +import com.azure.resourcemanager.awsconnector.models.EbsBlockDevice; +import com.azure.resourcemanager.awsconnector.models.Ec2ImageProperties; +import com.azure.resourcemanager.awsconnector.models.HypervisorType; +import com.azure.resourcemanager.awsconnector.models.HypervisorTypeEnumValue; +import com.azure.resourcemanager.awsconnector.models.ImageState; +import com.azure.resourcemanager.awsconnector.models.ImageStateEnumValue; +import com.azure.resourcemanager.awsconnector.models.ImageTypeValues; +import com.azure.resourcemanager.awsconnector.models.ImageTypeValuesEnumValue; +import com.azure.resourcemanager.awsconnector.models.ImdsSupportValues; +import com.azure.resourcemanager.awsconnector.models.ImdsSupportValuesEnumValue; +import com.azure.resourcemanager.awsconnector.models.PlatformValues; +import com.azure.resourcemanager.awsconnector.models.PlatformValuesEnumValue; +import com.azure.resourcemanager.awsconnector.models.ProductCode; +import com.azure.resourcemanager.awsconnector.models.ProductCodeValues; +import com.azure.resourcemanager.awsconnector.models.ProductCodeValuesEnumValue; +import com.azure.resourcemanager.awsconnector.models.StateReason; +import com.azure.resourcemanager.awsconnector.models.TagAutoGenerated11; +import com.azure.resourcemanager.awsconnector.models.TpmSupportValues; +import com.azure.resourcemanager.awsconnector.models.TpmSupportValuesEnumValue; +import com.azure.resourcemanager.awsconnector.models.VirtualizationType; +import com.azure.resourcemanager.awsconnector.models.VirtualizationTypeEnumValue; +import com.azure.resourcemanager.awsconnector.models.VolumeType; +import com.azure.resourcemanager.awsconnector.models.VolumeTypeEnumValue; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for Ec2Images CreateOrReplace. + */ +public final class Ec2ImagesCreateOrReplaceSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * Ec2Images_CreateOrReplace.json + */ + /** + * Sample code: Ec2Images_CreateOrReplace. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void ec2ImagesCreateOrReplace(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.ec2Images() + .define("Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])") + .withRegion("rskzngterhbdzpdgzthkwkfsim") + .withExistingResourceGroup("rgec2Image") + .withTags(mapOf("key733", "fakeTokenPlaceholder")) + .withProperties(new Ec2ImageProperties() + .withAwsProperties(new AwsEc2ImageProperties() + .withArchitecture(new ArchitectureValuesEnumValue().withValue(ArchitectureValues.ARM64)) + .withBlockDeviceMappings(Arrays.asList(new BlockDeviceMapping().withDeviceName("foqeiqkjrwirhz") + .withEbs(new EbsBlockDevice().withDeleteOnTermination(true) + .withEncrypted(true) + .withIops(6) + .withKmsKeyId("fakeTokenPlaceholder") + .withOutpostArn("yzyqckzzbmbeimvwrvckybpdil") + .withSnapshotId("yjsctqicabclgsmtr") + .withThroughput(29) + .withVolumeSize(15) + .withVolumeType(new VolumeTypeEnumValue().withValue(VolumeType.GP2))) + .withNoDevice("rs") + .withVirtualName("lgrpmrjfdvrwmfghttgcdgqsfum"))) + .withBootMode(new BootModeValuesEnumValue().withValue(BootModeValues.LEGACY_BIOS)) + .withCreationDate("iri") + .withDeprecationTime("rjbfczermuljog") + .withDeregistrationProtection("qgzillhrsaoasehpuum") + .withDescription("xcucajel") + .withEnaSupport(true) + .withHypervisor(new HypervisorTypeEnumValue().withValue(HypervisorType.OVM)) + .withImageId("abwaglkivomqynfncjesal") + .withImageLocation("pgjapgkiakctxcpfpmvk") + .withImageOwnerAlias("sqvaqlxrlzhlzbczv") + .withImageType(new ImageTypeValuesEnumValue().withValue(ImageTypeValues.KERNEL)) + .withImdsSupport(new ImdsSupportValuesEnumValue().withValue(ImdsSupportValues.V2_0)) + .withKernelId("mfsmykrvrtbosarfpfuwahchz") + .withLastLaunchedTime("syfznkavvtio") + .withName("secemuogxgahtxnpthro") + .withOwnerId("nhuhifhzxvkdxxvaiaibzihkyvbrwh") + .withPlatform(new PlatformValuesEnumValue().withValue(PlatformValues.WINDOWS)) + .withPlatformDetails("lisborjwdvhfnwsziqhfnxiqdmdynp") + .withProductCodes(Arrays.asList(new ProductCode().withProductCodeId("fakeTokenPlaceholder") + .withProductCodeType(new ProductCodeValuesEnumValue().withValue(ProductCodeValues.DEVPAY)))) + .withPublicProperty(true) + .withRamdiskId("xrcwfszijxclkazpcletlaoca") + .withRootDeviceName("jjgzjpjxtlhvqyvdrnqelzasdmn") + .withRootDeviceType(new DeviceTypeEnumValue().withValue(DeviceType.EBS)) + .withSourceInstanceId("g") + .withSriovNetSupport("sbnokjesjjkngdixqtiijn") + .withState(new ImageStateEnumValue().withValue(ImageState.AVAILABLE)) + .withStateReason(new StateReason().withCode("fakeTokenPlaceholder").withMessage("qgjrouiqrxyqi")) + .withTags(Arrays.asList(new TagAutoGenerated11().withKey("fakeTokenPlaceholder") + .withValue("ehismpwetbakkwkjtngdrofhipjlko"))) + .withTpmSupport(new TpmSupportValuesEnumValue().withValue(TpmSupportValues.V2_0)) + .withUsageOperation("gdlrmqiw") + .withVirtualizationType(new VirtualizationTypeEnumValue().withValue(VirtualizationType.HVM))) + .withPublicCloudConnectorsResourceId("dth") + .withAwsAccountId("yvwtilsspffh") + .withArn("qaahwnaabcqlufiiwhkwhv") + .withPublicCloudResourceName("iwvkviywiipsmvxpemnivpyqwnp") + .withAwsSourceSchema("zpslskfplbejouiomrfkp") + .withAwsRegion("chnagdbgxpnwsklnknirzcmbyhif") + .withAwsTags(mapOf("key3097", "fakeTokenPlaceholder"))) + .create(); + } + + // Use "Map.of" if available + @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; + } +} +``` + +### Ec2Images_Delete + +```java +/** + * Samples for Ec2Images Delete. + */ +public final class Ec2ImagesDeleteSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/Ec2Images_Delete. + * json + */ + /** + * Sample code: Ec2Images_Delete. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void ec2ImagesDelete(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.ec2Images() + .delete("rgec2Image", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE); + } +} +``` + +### Ec2Images_GetByResourceGroup + +```java +/** + * Samples for Ec2Images GetByResourceGroup. + */ +public final class Ec2ImagesGetByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/Ec2Images_Get.json + */ + /** + * Sample code: Ec2Images_Get. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void ec2ImagesGet(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.ec2Images() + .getByResourceGroupWithResponse("rgec2Image", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE); + } +} +``` + +### Ec2Images_List + +```java +/** + * Samples for Ec2Images List. + */ +public final class Ec2ImagesListSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * Ec2Images_ListBySubscription.json + */ + /** + * Sample code: Ec2Images_ListBySubscription. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void ec2ImagesListBySubscription(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.ec2Images().list(com.azure.core.util.Context.NONE); + } +} +``` + +### Ec2Images_ListByResourceGroup + +```java +/** + * Samples for Ec2Images ListByResourceGroup. + */ +public final class Ec2ImagesListByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * Ec2Images_ListByResourceGroup.json + */ + /** + * Sample code: Ec2Images_ListByResourceGroup. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + ec2ImagesListByResourceGroup(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.ec2Images().listByResourceGroup("rgec2Image", com.azure.core.util.Context.NONE); + } +} +``` + +### Ec2Images_Update + +```java +import com.azure.resourcemanager.awsconnector.models.Ec2Image; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for Ec2Images Update. + */ +public final class Ec2ImagesUpdateSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/Ec2Images_Update. + * json + */ + /** + * Sample code: Ec2Images_Update. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void ec2ImagesUpdate(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + Ec2Image resource = manager.ec2Images() + .getByResourceGroupWithResponse("rgec2Image", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE) + .getValue(); + resource.update().withTags(mapOf("key1684", "fakeTokenPlaceholder")).apply(); + } + + // Use "Map.of" if available + @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; + } +} +``` + +### Ec2InstanceStatuses_CreateOrReplace + +```java +import com.azure.resourcemanager.awsconnector.models.AwsEc2InstanceStatusProperties; +import com.azure.resourcemanager.awsconnector.models.Ec2InstanceStatusProperties; +import com.azure.resourcemanager.awsconnector.models.EventCode; +import com.azure.resourcemanager.awsconnector.models.EventCodeEnumValue; +import com.azure.resourcemanager.awsconnector.models.InstanceState; +import com.azure.resourcemanager.awsconnector.models.InstanceStateName; +import com.azure.resourcemanager.awsconnector.models.InstanceStateNameEnumValue; +import com.azure.resourcemanager.awsconnector.models.InstanceStatusDetails; +import com.azure.resourcemanager.awsconnector.models.InstanceStatusEvent; +import com.azure.resourcemanager.awsconnector.models.InstanceStatusSummary; +import com.azure.resourcemanager.awsconnector.models.StatusName; +import com.azure.resourcemanager.awsconnector.models.StatusNameEnumValue; +import com.azure.resourcemanager.awsconnector.models.StatusType; +import com.azure.resourcemanager.awsconnector.models.StatusTypeEnumValue; +import com.azure.resourcemanager.awsconnector.models.SummaryStatus; +import com.azure.resourcemanager.awsconnector.models.SummaryStatusEnumValue; +import java.time.OffsetDateTime; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for Ec2InstanceStatuses CreateOrReplace. + */ +public final class Ec2InstanceStatusesCreateOrReplaceSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * Ec2InstanceStatuses_CreateOrReplace.json + */ + /** + * Sample code: Ec2InstanceStatuses_CreateOrReplace. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + ec2InstanceStatusesCreateOrReplace(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.ec2InstanceStatuses() + .define("Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])") + .withRegion("pgcnqdiaetxhtdrimhlcwthap") + .withExistingResourceGroup("rgec2InstanceStatus") + .withTags(mapOf("key1363", "fakeTokenPlaceholder")) + .withProperties(new Ec2InstanceStatusProperties() + .withAwsProperties(new AwsEc2InstanceStatusProperties().withAvailabilityZone("ytnhdkisucgzas") + .withEvents(Arrays.asList(new InstanceStatusEvent() + .withCode(new EventCodeEnumValue().withValue(EventCode.INSTANCE_REBOOT)) + .withDescription("hgvqagwss") + .withInstanceEventId("rnbshnkjo") + .withNotAfter(OffsetDateTime.parse("2024-10-08T03:53:26.681Z")) + .withNotBefore(OffsetDateTime.parse("2024-10-08T03:53:26.681Z")) + .withNotBeforeDeadline(OffsetDateTime.parse("2024-10-08T03:53:26.681Z")))) + .withInstanceId("aoffpxifvwnouuzzpkqc") + .withInstanceState(new InstanceState() + .withCode(9) + .withName(new InstanceStateNameEnumValue().withValue(InstanceStateName.PENDING))) + .withInstanceStatus(new InstanceStatusSummary() + .withDetails(Arrays.asList(new InstanceStatusDetails() + .withImpairedSince(OffsetDateTime.parse("2024-10-08T03:53:26.682Z")) + .withName(new StatusNameEnumValue().withValue(StatusName.REACHABILITY)) + .withStatus(new StatusTypeEnumValue().withValue(StatusType.FAILED)))) + .withStatus(new SummaryStatusEnumValue().withValue(SummaryStatus.IMPAIRED))) + .withOutpostArn("pprqpuqeokryiz") + .withSystemStatus(new InstanceStatusSummary() + .withDetails(Arrays.asList(new InstanceStatusDetails() + .withImpairedSince(OffsetDateTime.parse("2024-10-08T03:53:26.682Z")) + .withName(new StatusNameEnumValue().withValue(StatusName.REACHABILITY)) + .withStatus(new StatusTypeEnumValue().withValue(StatusType.FAILED)))) + .withStatus(new SummaryStatusEnumValue().withValue(SummaryStatus.IMPAIRED)))) + .withPublicCloudConnectorsResourceId("ouhnawwxmqjpfsmz") + .withAwsAccountId("pjfvkzfpdqdiweudknutyey") + .withArn("nnkvtshcitbzvtrcwybizpxfznrsyg") + .withPublicCloudResourceName("mqygrsmavjlivhliidvrmopovsba") + .withAwsSourceSchema("zvcrlmc") + .withAwsRegion("uxchexljsahdlvcecpckwevokhvd") + .withAwsTags(mapOf("key8745", "fakeTokenPlaceholder"))) + .create(); + } + + // Use "Map.of" if available + @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; + } +} +``` + +### Ec2InstanceStatuses_Delete + +```java +/** + * Samples for Ec2InstanceStatuses Delete. + */ +public final class Ec2InstanceStatusesDeleteSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * Ec2InstanceStatuses_Delete.json + */ + /** + * Sample code: Ec2InstanceStatuses_Delete. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void ec2InstanceStatusesDelete(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.ec2InstanceStatuses() + .delete("rgec2InstanceStatus", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE); + } +} +``` + +### Ec2InstanceStatuses_GetByResourceGroup + +```java +/** + * Samples for Ec2InstanceStatuses GetByResourceGroup. + */ +public final class Ec2InstanceStatusesGetByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * Ec2InstanceStatuses_Get.json + */ + /** + * Sample code: Ec2InstanceStatuses_Get. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void ec2InstanceStatusesGet(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.ec2InstanceStatuses() + .getByResourceGroupWithResponse("rgec2InstanceStatus", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE); + } +} +``` + +### Ec2InstanceStatuses_List + +```java +/** + * Samples for Ec2InstanceStatuses List. + */ +public final class Ec2InstanceStatusesListSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * Ec2InstanceStatuses_ListBySubscription.json + */ + /** + * Sample code: Ec2InstanceStatuses_ListBySubscription. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + ec2InstanceStatusesListBySubscription(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.ec2InstanceStatuses().list(com.azure.core.util.Context.NONE); + } +} +``` + +### Ec2InstanceStatuses_ListByResourceGroup + +```java +/** + * Samples for Ec2InstanceStatuses ListByResourceGroup. + */ +public final class Ec2InstanceStatusesListByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * Ec2InstanceStatuses_ListByResourceGroup.json + */ + /** + * Sample code: Ec2InstanceStatuses_ListByResourceGroup. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + ec2InstanceStatusesListByResourceGroup(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.ec2InstanceStatuses().listByResourceGroup("rgec2InstanceStatus", com.azure.core.util.Context.NONE); + } +} +``` + +### Ec2InstanceStatuses_Update + +```java +import com.azure.resourcemanager.awsconnector.models.Ec2InstanceStatus; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for Ec2InstanceStatuses Update. + */ +public final class Ec2InstanceStatusesUpdateSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * Ec2InstanceStatuses_Update.json + */ + /** + * Sample code: Ec2InstanceStatuses_Update. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void ec2InstanceStatusesUpdate(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + Ec2InstanceStatus resource = manager.ec2InstanceStatuses() + .getByResourceGroupWithResponse("rgec2InstanceStatus", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE) + .getValue(); + resource.update().withTags(mapOf("key3283", "fakeTokenPlaceholder")).apply(); + } + + // Use "Map.of" if available + @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; + } +} +``` + +### Ec2Instances_CreateOrReplace + +```java +import com.azure.resourcemanager.awsconnector.fluent.models.Ec2InstanceInner; +import com.azure.resourcemanager.awsconnector.models.AmdSevSnpSpecification; +import com.azure.resourcemanager.awsconnector.models.AmdSevSnpSpecificationEnumValue; +import com.azure.resourcemanager.awsconnector.models.ArchitectureValues; +import com.azure.resourcemanager.awsconnector.models.ArchitectureValuesEnumValue; +import com.azure.resourcemanager.awsconnector.models.AttachmentStatus; +import com.azure.resourcemanager.awsconnector.models.AttachmentStatusEnumValue; +import com.azure.resourcemanager.awsconnector.models.AwsEc2InstanceProperties; +import com.azure.resourcemanager.awsconnector.models.BootModeValues; +import com.azure.resourcemanager.awsconnector.models.BootModeValuesEnumValue; +import com.azure.resourcemanager.awsconnector.models.CapacityReservationPreference; +import com.azure.resourcemanager.awsconnector.models.CapacityReservationPreferenceEnumValue; +import com.azure.resourcemanager.awsconnector.models.CapacityReservationSpecificationResponse; +import com.azure.resourcemanager.awsconnector.models.CapacityReservationTargetResponse; +import com.azure.resourcemanager.awsconnector.models.ConnectionTrackingSpecificationResponse; +import com.azure.resourcemanager.awsconnector.models.CpuOptions; +import com.azure.resourcemanager.awsconnector.models.DeviceType; +import com.azure.resourcemanager.awsconnector.models.DeviceTypeEnumValue; +import com.azure.resourcemanager.awsconnector.models.EbsInstanceBlockDevice; +import com.azure.resourcemanager.awsconnector.models.Ec2InstanceProperties; +import com.azure.resourcemanager.awsconnector.models.ElasticGpuAssociation; +import com.azure.resourcemanager.awsconnector.models.ElasticInferenceAcceleratorAssociation; +import com.azure.resourcemanager.awsconnector.models.EnclaveOptions; +import com.azure.resourcemanager.awsconnector.models.GroupIdentifier; +import com.azure.resourcemanager.awsconnector.models.HibernationOptions; +import com.azure.resourcemanager.awsconnector.models.HostnameType; +import com.azure.resourcemanager.awsconnector.models.HostnameTypeEnumValue; +import com.azure.resourcemanager.awsconnector.models.HttpTokensState; +import com.azure.resourcemanager.awsconnector.models.HttpTokensStateEnumValue; +import com.azure.resourcemanager.awsconnector.models.HypervisorType; +import com.azure.resourcemanager.awsconnector.models.HypervisorTypeEnumValue; +import com.azure.resourcemanager.awsconnector.models.IamInstanceProfile; +import com.azure.resourcemanager.awsconnector.models.InstanceAttachmentEnaSrdSpecification; +import com.azure.resourcemanager.awsconnector.models.InstanceAttachmentEnaSrdUdpSpecification; +import com.azure.resourcemanager.awsconnector.models.InstanceAutoRecoveryState; +import com.azure.resourcemanager.awsconnector.models.InstanceAutoRecoveryStateEnumValue; +import com.azure.resourcemanager.awsconnector.models.InstanceBlockDeviceMapping; +import com.azure.resourcemanager.awsconnector.models.InstanceBootModeValues; +import com.azure.resourcemanager.awsconnector.models.InstanceBootModeValuesEnumValue; +import com.azure.resourcemanager.awsconnector.models.InstanceIpv4Prefix; +import com.azure.resourcemanager.awsconnector.models.InstanceIpv6Address; +import com.azure.resourcemanager.awsconnector.models.InstanceIpv6Prefix; +import com.azure.resourcemanager.awsconnector.models.InstanceLifecycleType; +import com.azure.resourcemanager.awsconnector.models.InstanceLifecycleTypeEnumValue; +import com.azure.resourcemanager.awsconnector.models.InstanceMaintenanceOptions; +import com.azure.resourcemanager.awsconnector.models.InstanceMetadataEndpointState; +import com.azure.resourcemanager.awsconnector.models.InstanceMetadataEndpointStateEnumValue; +import com.azure.resourcemanager.awsconnector.models.InstanceMetadataOptionsResponse; +import com.azure.resourcemanager.awsconnector.models.InstanceMetadataOptionsState; +import com.azure.resourcemanager.awsconnector.models.InstanceMetadataOptionsStateEnumValue; +import com.azure.resourcemanager.awsconnector.models.InstanceMetadataProtocolState; +import com.azure.resourcemanager.awsconnector.models.InstanceMetadataProtocolStateEnumValue; +import com.azure.resourcemanager.awsconnector.models.InstanceMetadataTagsState; +import com.azure.resourcemanager.awsconnector.models.InstanceMetadataTagsStateEnumValue; +import com.azure.resourcemanager.awsconnector.models.InstanceNetworkInterface; +import com.azure.resourcemanager.awsconnector.models.InstanceNetworkInterfaceAssociation; +import com.azure.resourcemanager.awsconnector.models.InstanceNetworkInterfaceAttachment; +import com.azure.resourcemanager.awsconnector.models.InstancePrivateIpAddress; +import com.azure.resourcemanager.awsconnector.models.InstanceState; +import com.azure.resourcemanager.awsconnector.models.InstanceStateName; +import com.azure.resourcemanager.awsconnector.models.InstanceStateNameEnumValue; +import com.azure.resourcemanager.awsconnector.models.InstanceType; +import com.azure.resourcemanager.awsconnector.models.InstanceTypeEnumValue; +import com.azure.resourcemanager.awsconnector.models.LicenseConfiguration; +import com.azure.resourcemanager.awsconnector.models.Monitoring; +import com.azure.resourcemanager.awsconnector.models.MonitoringState; +import com.azure.resourcemanager.awsconnector.models.MonitoringStateEnumValue; +import com.azure.resourcemanager.awsconnector.models.NetworkInterfaceStatus; +import com.azure.resourcemanager.awsconnector.models.NetworkInterfaceStatusEnumValue; +import com.azure.resourcemanager.awsconnector.models.Placement; +import com.azure.resourcemanager.awsconnector.models.PlatformValues; +import com.azure.resourcemanager.awsconnector.models.PlatformValuesEnumValue; +import com.azure.resourcemanager.awsconnector.models.PrivateDnsNameOptionsResponse; +import com.azure.resourcemanager.awsconnector.models.ProductCode; +import com.azure.resourcemanager.awsconnector.models.ProductCodeValues; +import com.azure.resourcemanager.awsconnector.models.ProductCodeValuesEnumValue; +import com.azure.resourcemanager.awsconnector.models.StateReason; +import com.azure.resourcemanager.awsconnector.models.TagAutoGenerated12; +import com.azure.resourcemanager.awsconnector.models.Tenancy; +import com.azure.resourcemanager.awsconnector.models.TenancyEnumValue; +import com.azure.resourcemanager.awsconnector.models.VirtualizationType; +import com.azure.resourcemanager.awsconnector.models.VirtualizationTypeEnumValue; +import java.time.OffsetDateTime; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for Ec2Instances CreateOrReplace. + */ +public final class Ec2InstancesCreateOrReplaceSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * Ec2Instances_CreateOrReplace.json + */ + /** + * Sample code: Ec2Instances_CreateOrReplace. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void ec2InstancesCreateOrReplace(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.ec2Instances() + .createOrReplace("c", + new Ec2InstanceInner() + .withProperties( + new Ec2InstanceProperties() + .withAwsProperties(new AwsEc2InstanceProperties().withAmiLaunchIndex(27) + .withArchitecture(new ArchitectureValuesEnumValue().withValue(ArchitectureValues.ARM64)) + .withBlockDeviceMappings( + Arrays.asList(new InstanceBlockDeviceMapping().withDeviceName("tfaglaaaklzilxzmk") + .withEbs(new EbsInstanceBlockDevice() + .withAssociatedResource("pgkczdagxihtrkzzaiuzennp") + .withAttachTime(OffsetDateTime.parse("2024-10-08T03:49:10.616Z")) + .withDeleteOnTermination(true) + .withStatus( + new AttachmentStatusEnumValue().withValue(AttachmentStatus.ATTACHED)) + .withVolumeId("ilihhdgfhpylwqnaglcmj") + .withVolumeOwnerId("ruylzxnmlundujqdqkqocknldkttka")))) + .withBootMode(new BootModeValuesEnumValue().withValue(BootModeValues.LEGACY_BIOS)) + .withCapacityReservationId("rgxeywdieyjfmp") + .withCapacityReservationSpecification(new CapacityReservationSpecificationResponse() + .withCapacityReservationPreference(new CapacityReservationPreferenceEnumValue() + .withValue(CapacityReservationPreference.NONE)) + .withCapacityReservationTarget(new CapacityReservationTargetResponse() + .withCapacityReservationId("dvdusvbgjrkkuqrelloyysinnzpjb") + .withCapacityReservationResourceGroupArn("itnyqqrlujfkasgzbrvljlbh"))) + .withClientToken("fakeTokenPlaceholder") + .withCpuOptions(new CpuOptions() + .withAmdSevSnp(new AmdSevSnpSpecificationEnumValue() + .withValue(AmdSevSnpSpecification.DISABLED)) + .withCoreCount(27) + .withThreadsPerCore(11)) + .withCurrentInstanceBootMode( + new InstanceBootModeValuesEnumValue().withValue(InstanceBootModeValues.LEGACY_BIOS)) + .withEbsOptimized(true) + .withElasticGpuAssociations(Arrays.asList( + new ElasticGpuAssociation().withElasticGpuAssociationId("jmxqiqiyocefwrivbcumzx") + .withElasticGpuAssociationState("mkteimwlzs") + .withElasticGpuAssociationTime("sosasrnqg") + .withElasticGpuId("dnpmhib"))) + .withElasticInferenceAcceleratorAssociations( + Arrays.asList(new ElasticInferenceAcceleratorAssociation() + .withElasticInferenceAcceleratorArn("pnbrdzuzjxuwrtpdc") + .withElasticInferenceAcceleratorAssociationId("uoout") + .withElasticInferenceAcceleratorAssociationState("bwbmjkusisjrxxdonwtxkbgbaxk") + .withElasticInferenceAcceleratorAssociationTime( + OffsetDateTime.parse("2024-10-08T03:49:10.617Z")))) + .withEnaSupport(true) + .withEnclaveOptions(new EnclaveOptions().withEnabled(true)) + .withHibernationOptions(new HibernationOptions().withConfigured(true)) + .withHypervisor(new HypervisorTypeEnumValue().withValue(HypervisorType.OVM)) + .withIamInstanceProfile( + new IamInstanceProfile().withArn("jvju").withId("kdzthqdiqjcknesajpbplmkynzokr")) + .withImageId("oemhjwhbzkbcwocprtn") + .withInstanceId("czyyyovcqwce") + .withInstanceLifecycle(new InstanceLifecycleTypeEnumValue() + .withValue(InstanceLifecycleType.CAPACITY_BLOCK)) + .withInstanceType(new InstanceTypeEnumValue().withValue(InstanceType.A1_2XLARGE)) + .withIpv6Address("kuzwkpvttqtjxowkisga") + .withKernelId("qqehgoolsvuh") + .withKeyName("fakeTokenPlaceholder") + .withLaunchTime(OffsetDateTime.parse("2024-10-08T03:49:10.618Z")) + .withLicenses( + Arrays.asList(new LicenseConfiguration().withLicenseConfigurationArn("q"))) + .withMaintenanceOptions(new InstanceMaintenanceOptions() + .withAutoRecovery(new InstanceAutoRecoveryStateEnumValue() + .withValue(InstanceAutoRecoveryState.DEFAULT))) + .withMetadataOptions(new InstanceMetadataOptionsResponse() + .withHttpEndpoint(new InstanceMetadataEndpointStateEnumValue() + .withValue(InstanceMetadataEndpointState.DISABLED)) + .withHttpProtocolIpv6(new InstanceMetadataProtocolStateEnumValue() + .withValue(InstanceMetadataProtocolState.DISABLED)) + .withHttpPutResponseHopLimit(3) + .withHttpTokens(new HttpTokensStateEnumValue().withValue(HttpTokensState.OPTIONAL)) + .withInstanceMetadataTags(new InstanceMetadataTagsStateEnumValue() + .withValue(InstanceMetadataTagsState.DISABLED)) + .withState(new InstanceMetadataOptionsStateEnumValue() + .withValue(InstanceMetadataOptionsState.APPLIED))) + .withMonitoring(new Monitoring() + .withState(new MonitoringStateEnumValue().withValue(MonitoringState.DISABLED))) + .withNetworkInterfaces( + Arrays.asList(new InstanceNetworkInterface() + .withAssociation(new InstanceNetworkInterfaceAssociation() + .withCarrierIp("gyqfkluecfuwebntnygczb") + .withCustomerOwnedIp("sw") + .withIpOwnerId("fbrkixipyqjnao") + .withPublicDnsName("oivnzjavxqmctzvhgmsavgwesabny") + .withPublicIp("tojjymqqjmschjp")) + .withAttachment( + new InstanceNetworkInterfaceAttachment() + .withAttachTime(OffsetDateTime.parse("2024-10-08T03:49:10.618Z")) + .withAttachmentId("lsqnlzd") + .withDeleteOnTermination(true) + .withDeviceIndex(11) + .withEnaSrdSpecification( + new InstanceAttachmentEnaSrdSpecification().withEnaSrdEnabled(true) + .withEnaSrdUdpSpecification( + new InstanceAttachmentEnaSrdUdpSpecification() + .withEnaSrdUdpEnabled(true))) + .withNetworkCardIndex(9) + .withStatus(new AttachmentStatusEnumValue() + .withValue(AttachmentStatus.ATTACHED))) + .withConnectionTrackingConfiguration( + new ConnectionTrackingSpecificationResponse().withTcpEstablishedTimeout(23) + .withUdpStreamTimeout(24) + .withUdpTimeout(30)) + .withDescription("wcdguczvqhelvbuhnx") + .withGroups(Arrays + .asList(new GroupIdentifier().withGroupId("nwupmxpxrzdroizfewqupyddewi") + .withGroupName("gvsaaqihzfcwdmeocclatfqm"))) + .withInterfaceType("mphomintds") + .withIpv4Prefixes( + Arrays.asList(new InstanceIpv4Prefix().withIpv4Prefix("ortyghjrffqjz"))) + .withIpv6Addresses(Arrays.asList( + new InstanceIpv6Address().withIpv6Address("z").withIsPrimaryIpv6(true))) + .withIpv6Prefixes(Arrays + .asList(new InstanceIpv6Prefix().withIpv6Prefix("cstrptdpvmberviuvuqfd"))) + .withMacAddress("k") + .withNetworkInterfaceId("qythf") + .withOwnerId("fvjysbetbyrzccspcenkpvi") + .withPrivateDnsName("yvorusnuuigavdcqqdxecrkmjmhrf") + .withPrivateIpAddress("m") + .withPrivateIpAddresses(Arrays.asList(new InstancePrivateIpAddress() + .withAssociation(new InstanceNetworkInterfaceAssociation() + .withCarrierIp("gyqfkluecfuwebntnygczb") + .withCustomerOwnedIp("sw") + .withIpOwnerId("fbrkixipyqjnao") + .withPublicDnsName("oivnzjavxqmctzvhgmsavgwesabny") + .withPublicIp("tojjymqqjmschjp")) + .withPrimary(true) + .withPrivateDnsName("bdezhkhwoerivtfwgqelrsyiphf") + .withPrivateIpAddress("xcqnyrs"))) + .withSourceDestCheck(true) + .withStatus(new NetworkInterfaceStatusEnumValue() + .withValue(NetworkInterfaceStatus.ASSOCIATED)) + .withSubnetId("euocsemlw") + .withVpcId("grahbrhjelkewder"))) + .withOutpostArn("godjddxeidxe") + .withPlacement(new Placement().withAffinity("xzseileq") + .withAvailabilityZone("vsfvyosolmnchbavxfvtizqptgmeg") + .withGroupId("davwvkjoij") + .withGroupName("txqgn") + .withHostId("mvbshbhxclztfwffsu") + .withHostResourceGroupArn("zl") + .withPartitionNumber(24) + .withSpreadDomain("t") + .withTenancy(new TenancyEnumValue().withValue(Tenancy.DEDICATED))) + .withPlatform(new PlatformValuesEnumValue().withValue(PlatformValues.WINDOWS)) + .withPlatformDetails("rcwqyqgcruqjcvzcto") + .withPrivateDnsName("ieuhntvllhoojakokyt") + .withPrivateDnsNameOptions( + new PrivateDnsNameOptionsResponse().withEnableResourceNameDnsAaaaRecord(true) + .withEnableResourceNameDnsARecord(true) + .withHostnameType(new HostnameTypeEnumValue().withValue(HostnameType.IP_NAME))) + .withPrivateIpAddress("uosximzwwopktgyzlathmorgqah") + .withProductCodes( + Arrays.asList(new ProductCode().withProductCodeId("fakeTokenPlaceholder") + .withProductCodeType( + new ProductCodeValuesEnumValue().withValue(ProductCodeValues.DEVPAY)))) + .withPublicDnsName("qkucqmeldgiumuzribitahwft") + .withPublicIpAddress("ialohsszgtpuycimtqi") + .withRamdiskId("ggkfkl") + .withRootDeviceName("dbfwarbazrbzcjnh") + .withRootDeviceType(new DeviceTypeEnumValue().withValue(DeviceType.EBS)) + .withSecurityGroups( + Arrays.asList(new GroupIdentifier().withGroupId("nwupmxpxrzdroizfewqupyddewi") + .withGroupName("gvsaaqihzfcwdmeocclatfqm"))) + .withSourceDestCheck(true) + .withSpotInstanceRequestId("qiylxsuuinwyq") + .withSriovNetSupport("kiffwvajczdtzwcfeefqespn") + .withState(new InstanceState().withCode(18) + .withName(new InstanceStateNameEnumValue().withValue(InstanceStateName.PENDING))) + .withStateReason( + new StateReason().withCode("fakeTokenPlaceholder").withMessage("dvgendvpuuzx")) + .withStateTransitionReason("arenmfmnvv") + .withSubnetId("mgnibedayjllwaidbjh") + .withTags(Arrays.asList(new TagAutoGenerated12().withKey("fakeTokenPlaceholder") + .withValue("zztbwjxzwgmnjqhegktznmdrqferd"))) + .withTpmSupport("fvxtckturm") + .withUsageOperation("xrctwrcgpcrhlfjzhdvhiovdlcqafq") + .withUsageOperationUpdateTime(OffsetDateTime.parse("2024-10-08T03:49:10.619Z")) + .withVirtualizationType( + new VirtualizationTypeEnumValue().withValue(VirtualizationType.HVM)) + .withVpcId("g")) + .withPublicCloudConnectorsResourceId("shnvqmmslrarjuzdpyhlnfxxp") + .withAwsAccountId("hhrjjrfopsrebnklxmr") + .withArn("noxwkahrsrcnrpz") + .withPublicCloudResourceName("sffqiavopmcwltotrpubudq") + .withAwsSourceSchema("tncjfmwlkponefezhigbyno") + .withAwsRegion("tcaqttnhykcej") + .withAwsTags(mapOf("key2934", "fakeTokenPlaceholder"))), + com.azure.core.util.Context.NONE); + } + + // Use "Map.of" if available + @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; + } +} +``` + +### Ec2Instances_Delete + +```java +/** + * Samples for Ec2Instances Delete. + */ +public final class Ec2InstancesDeleteSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/Ec2Instances_Delete + * .json + */ + /** + * Sample code: Ec2Instances_Delete. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void ec2InstancesDelete(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.ec2Instances().delete("c", com.azure.core.util.Context.NONE); + } +} +``` + +### Ec2Instances_Get + +```java +/** + * Samples for Ec2Instances Get. + */ +public final class Ec2InstancesGetSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/Ec2Instances_Get. + * json + */ + /** + * Sample code: Ec2Instances_Get. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void ec2InstancesGet(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.ec2Instances().getWithResponse("c", com.azure.core.util.Context.NONE); + } +} +``` + +### Ec2Instances_List + +```java +/** + * Samples for Ec2Instances List. + */ +public final class Ec2InstancesListSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/Ec2Instances_List. + * json + */ + /** + * Sample code: Ec2Instances_List. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void ec2InstancesList(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.ec2Instances().list("c", com.azure.core.util.Context.NONE); + } +} +``` + +### Ec2Instances_Start + +```java +/** + * Samples for Ec2Instances Start. + */ +public final class Ec2InstancesStartSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/Ec2Instances_Start. + * json + */ + /** + * Sample code: Ec2Instances_Start. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void ec2InstancesStart(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.ec2Instances().start("c", com.azure.core.util.Context.NONE); + } +} +``` + +### Ec2Instances_Stop + +```java +import com.azure.resourcemanager.awsconnector.models.StopEc2InstanceOptions; + +/** + * Samples for Ec2Instances Stop. + */ +public final class Ec2InstancesStopSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/Ec2Instances_Stop. + * json + */ + /** + * Sample code: Ec2Instances_Stop. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void ec2InstancesStop(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.ec2Instances() + .stop("c", new StopEc2InstanceOptions().withForce(true).withHibernate(true), + com.azure.core.util.Context.NONE); + } +} +``` + +### Ec2Ipams_CreateOrReplace + +```java +import com.azure.resourcemanager.awsconnector.models.AwsEc2IpamProperties; +import com.azure.resourcemanager.awsconnector.models.Ec2IpamProperties; +import com.azure.resourcemanager.awsconnector.models.IpamOperatingRegion; +import com.azure.resourcemanager.awsconnector.models.IpamState; +import com.azure.resourcemanager.awsconnector.models.IpamStateEnumValue; +import com.azure.resourcemanager.awsconnector.models.IpamTier; +import com.azure.resourcemanager.awsconnector.models.IpamTierEnumValue; +import com.azure.resourcemanager.awsconnector.models.TagAutoGenerated13; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for Ec2Ipams CreateOrReplace. + */ +public final class Ec2IpamsCreateOrReplaceSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * Ec2Ipams_CreateOrReplace.json + */ + /** + * Sample code: Ec2Ipams_CreateOrReplace. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void ec2IpamsCreateOrReplace(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.ec2Ipams() + .define("Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])") + .withRegion("lhjepajysvu") + .withExistingResourceGroup("rgec2Ipam") + .withTags(mapOf("key6845", "fakeTokenPlaceholder")) + .withProperties(new Ec2IpamProperties() + .withAwsProperties( + new AwsEc2IpamProperties().withDefaultResourceDiscoveryAssociationId("upvbhujajpxidvdneaxudp") + .withDefaultResourceDiscoveryId("vmatfdwggwysxz") + .withDescription("suxncf") + .withIpamArn("ounjgxqwlmalbxgwqepaivhpqm") + .withIpamId("baiefjd") + .withIpamRegion("dfdcpbefpcajoep") + .withOperatingRegions(Arrays.asList(new IpamOperatingRegion().withRegionName("racqmjs"))) + .withOwnerId("sbcvakmustluzumdv") + .withPrivateDefaultScopeId("sgytzjkrmsnzccmbos") + .withPublicDefaultScopeId("uqxvzoqzwfiaerfqkufw") + .withResourceDiscoveryAssociationCount(28) + .withScopeCount(8) + .withState(new IpamStateEnumValue().withValue(IpamState.CREATE_COMPLETE)) + .withStateMessage("wehaarwg") + .withTags(Arrays.asList( + new TagAutoGenerated13().withKey("fakeTokenPlaceholder").withValue("jnzubqdwmuxxyakaosx"))) + .withTier(new IpamTierEnumValue().withValue(IpamTier.ADVANCED))) + .withPublicCloudConnectorsResourceId("irfihvsxrgyhmubmuieufe") + .withAwsAccountId("fyceaucatzscmtkaw") + .withArn("gcjcnzkmoauyi") + .withPublicCloudResourceName("y") + .withAwsSourceSchema("ivdglskrjwzg") + .withAwsRegion("rvtevmqvjnnignaaojkgqgzrsi") + .withAwsTags(mapOf("key4146", "fakeTokenPlaceholder"))) + .create(); + } + + // Use "Map.of" if available + @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; + } +} +``` + +### Ec2Ipams_Delete + +```java +/** + * Samples for Ec2Ipams Delete. + */ +public final class Ec2IpamsDeleteSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/Ec2Ipams_Delete. + * json + */ + /** + * Sample code: Ec2Ipams_Delete. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void ec2IpamsDelete(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.ec2Ipams() + .delete("rgec2Ipam", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE); + } +} +``` + +### Ec2Ipams_GetByResourceGroup + +```java +/** + * Samples for Ec2Ipams GetByResourceGroup. + */ +public final class Ec2IpamsGetByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/Ec2Ipams_Get.json + */ + /** + * Sample code: Ec2Ipams_Get. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void ec2IpamsGet(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.ec2Ipams() + .getByResourceGroupWithResponse("rgec2Ipam", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE); + } +} +``` + +### Ec2Ipams_List + +```java +/** + * Samples for Ec2Ipams List. + */ +public final class Ec2IpamsListSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * Ec2Ipams_ListBySubscription.json + */ + /** + * Sample code: Ec2Ipams_ListBySubscription. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void ec2IpamsListBySubscription(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.ec2Ipams().list(com.azure.core.util.Context.NONE); + } +} +``` + +### Ec2Ipams_ListByResourceGroup + +```java +/** + * Samples for Ec2Ipams ListByResourceGroup. + */ +public final class Ec2IpamsListByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * Ec2Ipams_ListByResourceGroup.json + */ + /** + * Sample code: Ec2Ipams_ListByResourceGroup. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void ec2IpamsListByResourceGroup(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.ec2Ipams().listByResourceGroup("rgec2Ipam", com.azure.core.util.Context.NONE); + } +} +``` + +### Ec2Ipams_Update + +```java +import com.azure.resourcemanager.awsconnector.models.Ec2Ipam; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for Ec2Ipams Update. + */ +public final class Ec2IpamsUpdateSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/Ec2Ipams_Update. + * json + */ + /** + * Sample code: Ec2Ipams_Update. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void ec2IpamsUpdate(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + Ec2Ipam resource = manager.ec2Ipams() + .getByResourceGroupWithResponse("rgec2Ipam", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE) + .getValue(); + resource.update().withTags(mapOf("key1619", "fakeTokenPlaceholder")).apply(); + } + + // Use "Map.of" if available + @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; + } +} +``` + +### Ec2KeyPairs_CreateOrReplace + +```java +import com.azure.resourcemanager.awsconnector.models.AwsEc2KeyPairProperties; +import com.azure.resourcemanager.awsconnector.models.Ec2KeyPairProperties; +import com.azure.resourcemanager.awsconnector.models.KeyFormat; +import com.azure.resourcemanager.awsconnector.models.KeyType; +import com.azure.resourcemanager.awsconnector.models.TagAutoGenerated14; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for Ec2KeyPairs CreateOrReplace. + */ +public final class Ec2KeyPairsCreateOrReplaceSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * Ec2KeyPairs_CreateOrReplace.json + */ + /** + * Sample code: Ec2KeyPairs_CreateOrReplace. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void ec2KeyPairsCreateOrReplace(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.ec2KeyPairs() + .define("Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])") + .withRegion("okgykmqgdqfktczzwnisgblxjor") + .withExistingResourceGroup("rgec2KeyPair") + .withTags(mapOf("key7076", "fakeTokenPlaceholder")) + .withProperties( + new Ec2KeyPairProperties() + .withAwsProperties(new AwsEc2KeyPairProperties().withKeyFingerprint("fakeTokenPlaceholder") + .withKeyFormat(KeyFormat.PEM) + .withKeyName("fakeTokenPlaceholder") + .withKeyPairId("fakeTokenPlaceholder") + .withKeyType(KeyType.ED25519) + .withPublicKeyMaterial("fakeTokenPlaceholder") + .withTags(Arrays.asList(new TagAutoGenerated14().withKey("fakeTokenPlaceholder") + .withValue("fcqkvmxnvgkszsjglbmc")))) + .withPublicCloudConnectorsResourceId("dtqfffijdvwrjascztihbhcjfo") + .withAwsAccountId("iamyich") + .withArn("hbplblilwwscgwiaifygy") + .withPublicCloudResourceName("nyywppatxodspls") + .withAwsSourceSchema("qbl") + .withAwsRegion("zkxhveyqnzcmihgmancphtwumisld") + .withAwsTags(mapOf("key6629", "fakeTokenPlaceholder"))) + .create(); + } + + // Use "Map.of" if available + @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; + } +} +``` + +### Ec2KeyPairs_Delete + +```java +/** + * Samples for Ec2KeyPairs Delete. + */ +public final class Ec2KeyPairsDeleteSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/Ec2KeyPairs_Delete. + * json + */ + /** + * Sample code: Ec2KeyPairs_Delete. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void ec2KeyPairsDelete(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.ec2KeyPairs() + .delete("rgec2KeyPair", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE); + } +} +``` + +### Ec2KeyPairs_GetByResourceGroup + +```java +/** + * Samples for Ec2KeyPairs GetByResourceGroup. + */ +public final class Ec2KeyPairsGetByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/Ec2KeyPairs_Get. + * json + */ + /** + * Sample code: Ec2KeyPairs_Get. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void ec2KeyPairsGet(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.ec2KeyPairs() + .getByResourceGroupWithResponse("rgec2KeyPair", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE); + } +} +``` + +### Ec2KeyPairs_List + +```java +/** + * Samples for Ec2KeyPairs List. + */ +public final class Ec2KeyPairsListSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * Ec2KeyPairs_ListBySubscription.json + */ + /** + * Sample code: Ec2KeyPairs_ListBySubscription. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + ec2KeyPairsListBySubscription(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.ec2KeyPairs().list(com.azure.core.util.Context.NONE); + } +} +``` + +### Ec2KeyPairs_ListByResourceGroup + +```java +/** + * Samples for Ec2KeyPairs ListByResourceGroup. + */ +public final class Ec2KeyPairsListByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * Ec2KeyPairs_ListByResourceGroup.json + */ + /** + * Sample code: Ec2KeyPairs_ListByResourceGroup. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + ec2KeyPairsListByResourceGroup(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.ec2KeyPairs().listByResourceGroup("rgec2KeyPair", com.azure.core.util.Context.NONE); + } +} +``` + +### Ec2KeyPairs_Update + +```java +import com.azure.resourcemanager.awsconnector.models.Ec2KeyPair; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for Ec2KeyPairs Update. + */ +public final class Ec2KeyPairsUpdateSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/Ec2KeyPairs_Update. + * json + */ + /** + * Sample code: Ec2KeyPairs_Update. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void ec2KeyPairsUpdate(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + Ec2KeyPair resource = manager.ec2KeyPairs() + .getByResourceGroupWithResponse("rgec2KeyPair", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE) + .getValue(); + resource.update().withTags(mapOf("key7068", "fakeTokenPlaceholder")).apply(); + } + + // Use "Map.of" if available + @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; + } +} +``` + +### Ec2NetworkAcls_CreateOrReplace + +```java +import com.azure.resourcemanager.awsconnector.models.AwsEc2NetworkAclProperties; +import com.azure.resourcemanager.awsconnector.models.Ec2NetworkAclProperties; +import com.azure.resourcemanager.awsconnector.models.TagAutoGenerated15; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for Ec2NetworkAcls CreateOrReplace. + */ +public final class Ec2NetworkAclsCreateOrReplaceSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * Ec2NetworkAcls_CreateOrReplace.json + */ + /** + * Sample code: Ec2NetworkAcls_CreateOrReplace. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + ec2NetworkAclsCreateOrReplace(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.ec2NetworkAcls() + .define("Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])") + .withRegion("fshtit") + .withExistingResourceGroup("rgec2NetworkAcl") + .withTags(mapOf("key7602", "fakeTokenPlaceholder")) + .withProperties( + new Ec2NetworkAclProperties() + .withAwsProperties(new AwsEc2NetworkAclProperties().withId("qgxcaonshnjzgtrwpbtgtnec") + .withTags(Arrays.asList( + new TagAutoGenerated15().withKey("fakeTokenPlaceholder").withValue("szjckvzlsvasj"))) + .withVpcId("wifperjiuulltgxcljqwnaeyscd")) + .withPublicCloudConnectorsResourceId("thejbzeletryigazixejsz") + .withAwsAccountId("nwnjrjumgvvtfndyaxyiwbugmdk") + .withArn("mwwchyidvtcm") + .withPublicCloudResourceName("dniirwtrtuvjlcdcjq") + .withAwsSourceSchema("hqiutsyaxzitfwtekhw") + .withAwsRegion("zmntebskjciytwfcjyj") + .withAwsTags(mapOf("key8049", "fakeTokenPlaceholder"))) + .create(); + } + + // Use "Map.of" if available + @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; + } +} +``` + +### Ec2NetworkAcls_Delete + +```java +/** + * Samples for Ec2NetworkAcls Delete. + */ +public final class Ec2NetworkAclsDeleteSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * Ec2NetworkAcls_Delete.json + */ + /** + * Sample code: Ec2NetworkAcls_Delete. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void ec2NetworkAclsDelete(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.ec2NetworkAcls() + .delete("rgec2NetworkAcl", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE); + } +} +``` + +### Ec2NetworkAcls_GetByResourceGroup + +```java +/** + * Samples for Ec2NetworkAcls GetByResourceGroup. + */ +public final class Ec2NetworkAclsGetByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/Ec2NetworkAcls_Get. + * json + */ + /** + * Sample code: Ec2NetworkAcls_Get. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void ec2NetworkAclsGet(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.ec2NetworkAcls() + .getByResourceGroupWithResponse("rgec2NetworkAcl", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE); + } +} +``` + +### Ec2NetworkAcls_List + +```java +/** + * Samples for Ec2NetworkAcls List. + */ +public final class Ec2NetworkAclsListSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * Ec2NetworkAcls_ListBySubscription.json + */ + /** + * Sample code: Ec2NetworkAcls_ListBySubscription. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + ec2NetworkAclsListBySubscription(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.ec2NetworkAcls().list(com.azure.core.util.Context.NONE); + } +} +``` + +### Ec2NetworkAcls_ListByResourceGroup + +```java +/** + * Samples for Ec2NetworkAcls ListByResourceGroup. + */ +public final class Ec2NetworkAclsListByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * Ec2NetworkAcls_ListByResourceGroup.json + */ + /** + * Sample code: Ec2NetworkAcls_ListByResourceGroup. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + ec2NetworkAclsListByResourceGroup(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.ec2NetworkAcls().listByResourceGroup("rgec2NetworkAcl", com.azure.core.util.Context.NONE); + } +} +``` + +### Ec2NetworkAcls_Update + +```java +import com.azure.resourcemanager.awsconnector.models.Ec2NetworkAcl; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for Ec2NetworkAcls Update. + */ +public final class Ec2NetworkAclsUpdateSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * Ec2NetworkAcls_Update.json + */ + /** + * Sample code: Ec2NetworkAcls_Update. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void ec2NetworkAclsUpdate(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + Ec2NetworkAcl resource = manager.ec2NetworkAcls() + .getByResourceGroupWithResponse("rgec2NetworkAcl", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE) + .getValue(); + resource.update().withTags(mapOf("key5032", "fakeTokenPlaceholder")).apply(); + } + + // Use "Map.of" if available + @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; + } +} +``` + +### Ec2NetworkInterfaces_CreateOrReplace + +```java +import com.azure.resourcemanager.awsconnector.models.AwsEc2NetworkInterfaceProperties; +import com.azure.resourcemanager.awsconnector.models.ConnectionTrackingSpecification; +import com.azure.resourcemanager.awsconnector.models.Ec2NetworkInterfaceProperties; +import com.azure.resourcemanager.awsconnector.models.InstanceIpv6AddressAutoGenerated; +import com.azure.resourcemanager.awsconnector.models.Ipv4PrefixSpecification; +import com.azure.resourcemanager.awsconnector.models.Ipv6PrefixSpecification; +import com.azure.resourcemanager.awsconnector.models.PrivateIpAddressSpecification; +import com.azure.resourcemanager.awsconnector.models.TagAutoGenerated16; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for Ec2NetworkInterfaces CreateOrReplace. + */ +public final class Ec2NetworkInterfacesCreateOrReplaceSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * Ec2NetworkInterfaces_CreateOrReplace.json + */ + /** + * Sample code: Ec2NetworkInterfaces_CreateOrReplace. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + ec2NetworkInterfacesCreateOrReplace(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.ec2NetworkInterfaces() + .define("Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])") + .withRegion("lagtstrmaffl") + .withExistingResourceGroup("rgec2NetworkInterface") + .withTags(mapOf("key2520", "fakeTokenPlaceholder")) + .withProperties(new Ec2NetworkInterfaceProperties() + .withAwsProperties(new AwsEc2NetworkInterfaceProperties() + .withConnectionTrackingSpecification( + new ConnectionTrackingSpecification().withTcpEstablishedTimeout(17) + .withUdpStreamTimeout(8) + .withUdpTimeout(23)) + .withDescription("rjfmatpnlpzafpjsvdifepkeompzpz") + .withEnablePrimaryIpv6(true) + .withGroupSet(Arrays.asList("dqnxzfzzixpqqapipgobuepnptfi")) + .withId("djkpriel") + .withInterfaceType("osohhzoujznxwq") + .withIpv4PrefixCount(18) + .withIpv4Prefixes(Arrays.asList(new Ipv4PrefixSpecification().withIpv4Prefix("gptczjajfvxavzpalq"))) + .withIpv6AddressCount(21) + .withIpv6Addresses( + Arrays.asList(new InstanceIpv6AddressAutoGenerated().withIpv6Address("yltzjtkgfhbhokimzn"))) + .withIpv6PrefixCount(1) + .withIpv6Prefixes( + Arrays.asList(new Ipv6PrefixSpecification().withIpv6Prefix("srpldhvaafcozyarpechevrnxlf"))) + .withPrimaryIpv6Address("uoblo") + .withPrimaryPrivateIpAddress("qyowqxftdeptwmjwfa") + .withPrivateIpAddress("qicwhumw") + .withPrivateIpAddresses(Arrays.asList(new PrivateIpAddressSpecification().withPrimary(true) + .withPrivateIpAddress("mmkedmvsclcwfvlvx"))) + .withSecondaryPrivateIpAddressCount(9) + .withSecondaryPrivateIpAddresses(Arrays.asList("mkvwjalereuiy")) + .withSourceDestCheck(true) + .withSubnetId("wfyytldstgkdpoffxak") + .withTags(Arrays + .asList(new TagAutoGenerated16().withKey("fakeTokenPlaceholder").withValue("zlzzwcqgyuoe"))) + .withVpcId("ykqkegxxhqsw")) + .withPublicCloudConnectorsResourceId("ottcocnvajfifabmlw") + .withAwsAccountId("gjylibjqfzkkx") + .withArn("nmgqcimbhzksweqtns") + .withPublicCloudResourceName("pjjwxtuejzskysxlytlrcqegfkuydf") + .withAwsSourceSchema("smaakwcpvp") + .withAwsRegion("dpghaxzupmkfwbvir") + .withAwsTags(mapOf("key190", "fakeTokenPlaceholder"))) + .create(); + } + + // Use "Map.of" if available + @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; + } +} +``` + +### Ec2NetworkInterfaces_Delete + +```java +/** + * Samples for Ec2NetworkInterfaces Delete. + */ +public final class Ec2NetworkInterfacesDeleteSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * Ec2NetworkInterfaces_Delete.json + */ + /** + * Sample code: Ec2NetworkInterfaces_Delete. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void ec2NetworkInterfacesDelete(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.ec2NetworkInterfaces() + .delete("rgec2NetworkInterface", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE); + } +} +``` + +### Ec2NetworkInterfaces_GetByResourceGroup + +```java +/** + * Samples for Ec2NetworkInterfaces GetByResourceGroup. + */ +public final class Ec2NetworkInterfacesGetByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * Ec2NetworkInterfaces_Get.json + */ + /** + * Sample code: Ec2NetworkInterfaces_Get. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void ec2NetworkInterfacesGet(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.ec2NetworkInterfaces() + .getByResourceGroupWithResponse("rgec2NetworkInterface", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE); + } +} +``` + +### Ec2NetworkInterfaces_List + +```java +/** + * Samples for Ec2NetworkInterfaces List. + */ +public final class Ec2NetworkInterfacesListSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * Ec2NetworkInterfaces_ListBySubscription.json + */ + /** + * Sample code: Ec2NetworkInterfaces_ListBySubscription. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + ec2NetworkInterfacesListBySubscription(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.ec2NetworkInterfaces().list(com.azure.core.util.Context.NONE); + } +} +``` + +### Ec2NetworkInterfaces_ListByResourceGroup + +```java +/** + * Samples for Ec2NetworkInterfaces ListByResourceGroup. + */ +public final class Ec2NetworkInterfacesListByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * Ec2NetworkInterfaces_ListByResourceGroup.json + */ + /** + * Sample code: Ec2NetworkInterfaces_ListByResourceGroup. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + ec2NetworkInterfacesListByResourceGroup(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.ec2NetworkInterfaces().listByResourceGroup("rgec2NetworkInterface", com.azure.core.util.Context.NONE); + } +} +``` + +### Ec2NetworkInterfaces_Update + +```java +import com.azure.resourcemanager.awsconnector.models.Ec2NetworkInterface; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for Ec2NetworkInterfaces Update. + */ +public final class Ec2NetworkInterfacesUpdateSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * Ec2NetworkInterfaces_Update.json + */ + /** + * Sample code: Ec2NetworkInterfaces_Update. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void ec2NetworkInterfacesUpdate(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + Ec2NetworkInterface resource = manager.ec2NetworkInterfaces() + .getByResourceGroupWithResponse("rgec2NetworkInterface", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE) + .getValue(); + resource.update().withTags(mapOf("key6326", "fakeTokenPlaceholder")).apply(); + } + + // Use "Map.of" if available + @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; + } +} +``` + +### Ec2RouteTables_CreateOrReplace + +```java +import com.azure.resourcemanager.awsconnector.models.AwsEc2RouteTableProperties; +import com.azure.resourcemanager.awsconnector.models.Ec2RouteTableProperties; +import com.azure.resourcemanager.awsconnector.models.TagAutoGenerated17; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for Ec2RouteTables CreateOrReplace. + */ +public final class Ec2RouteTablesCreateOrReplaceSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * Ec2RouteTables_CreateOrReplace.json + */ + /** + * Sample code: Ec2RouteTables_CreateOrReplace. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + ec2RouteTablesCreateOrReplace(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.ec2RouteTables() + .define("Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])") + .withRegion("hovrzjhgmyvotekfhnhfmvlcak") + .withExistingResourceGroup("rgec2RouteTable") + .withTags(mapOf("key8794", "fakeTokenPlaceholder")) + .withProperties(new Ec2RouteTableProperties() + .withAwsProperties(new AwsEc2RouteTableProperties().withRouteTableId("wjkircnwaktkmbnrmuglladvcdghmn") + .withTags(Arrays.asList(new TagAutoGenerated17().withKey("fakeTokenPlaceholder") + .withValue("ywbmagghbowtrgxkmnquatuohxj"))) + .withVpcId("ndnaspemjnmztnyriemuybzp")) + .withPublicCloudConnectorsResourceId("kaqsj") + .withAwsAccountId("xlalfcqnhp") + .withArn("eyazamslrmbbffijotyuugdepfsn") + .withPublicCloudResourceName("ierypwmwselkslavwkgcmz") + .withAwsSourceSchema("usgtqolcmcjynbdhavnneb") + .withAwsRegion("tmqwjtpadpygxhke") + .withAwsTags(mapOf("key7743", "fakeTokenPlaceholder"))) + .create(); + } + + // Use "Map.of" if available + @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; + } +} +``` + +### Ec2RouteTables_Delete + +```java +/** + * Samples for Ec2RouteTables Delete. + */ +public final class Ec2RouteTablesDeleteSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * Ec2RouteTables_Delete.json + */ + /** + * Sample code: Ec2RouteTables_Delete. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void ec2RouteTablesDelete(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.ec2RouteTables() + .delete("rgec2RouteTable", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE); + } +} +``` + +### Ec2RouteTables_GetByResourceGroup + +```java +/** + * Samples for Ec2RouteTables GetByResourceGroup. + */ +public final class Ec2RouteTablesGetByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/Ec2RouteTables_Get. + * json + */ + /** + * Sample code: Ec2RouteTables_Get. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void ec2RouteTablesGet(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.ec2RouteTables() + .getByResourceGroupWithResponse("rgec2RouteTable", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE); + } +} +``` + +### Ec2RouteTables_List + +```java +/** + * Samples for Ec2RouteTables List. + */ +public final class Ec2RouteTablesListSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * Ec2RouteTables_ListBySubscription.json + */ + /** + * Sample code: Ec2RouteTables_ListBySubscription. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + ec2RouteTablesListBySubscription(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.ec2RouteTables().list(com.azure.core.util.Context.NONE); + } +} +``` + +### Ec2RouteTables_ListByResourceGroup + +```java +/** + * Samples for Ec2RouteTables ListByResourceGroup. + */ +public final class Ec2RouteTablesListByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * Ec2RouteTables_ListByResourceGroup.json + */ + /** + * Sample code: Ec2RouteTables_ListByResourceGroup. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + ec2RouteTablesListByResourceGroup(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.ec2RouteTables().listByResourceGroup("rgec2RouteTable", com.azure.core.util.Context.NONE); + } +} +``` + +### Ec2RouteTables_Update + +```java +import com.azure.resourcemanager.awsconnector.models.Ec2RouteTable; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for Ec2RouteTables Update. + */ +public final class Ec2RouteTablesUpdateSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * Ec2RouteTables_Update.json + */ + /** + * Sample code: Ec2RouteTables_Update. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void ec2RouteTablesUpdate(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + Ec2RouteTable resource = manager.ec2RouteTables() + .getByResourceGroupWithResponse("rgec2RouteTable", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE) + .getValue(); + resource.update().withTags(mapOf("key9656", "fakeTokenPlaceholder")).apply(); + } + + // Use "Map.of" if available + @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; + } +} +``` + +### Ec2SecurityGroups_CreateOrReplace + +```java +import com.azure.resourcemanager.awsconnector.models.AwsEc2SecurityGroupProperties; +import com.azure.resourcemanager.awsconnector.models.Ec2SecurityGroupProperties; +import com.azure.resourcemanager.awsconnector.models.IpPermission; +import com.azure.resourcemanager.awsconnector.models.IpRange; +import com.azure.resourcemanager.awsconnector.models.Ipv6Range; +import com.azure.resourcemanager.awsconnector.models.PrefixListId; +import com.azure.resourcemanager.awsconnector.models.TagAutoGenerated18; +import com.azure.resourcemanager.awsconnector.models.UserIdGroupPair; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for Ec2SecurityGroups CreateOrReplace. + */ +public final class Ec2SecurityGroupsCreateOrReplaceSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * Ec2SecurityGroups_CreateOrReplace.json + */ + /** + * Sample code: Ec2SecurityGroups_CreateOrReplace. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + ec2SecurityGroupsCreateOrReplace(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.ec2SecurityGroups() + .define("Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])") + .withRegion("vzuwiygrafixnatwfk") + .withExistingResourceGroup("rgec2SecurityGroup") + .withTags(mapOf("key9265", "fakeTokenPlaceholder")) + .withProperties(new Ec2SecurityGroupProperties() + .withAwsProperties(new AwsEc2SecurityGroupProperties().withDescription("hrrgskumwbylhgekdhngxjvwdnwt") + .withGroupId("ljankmjnfyn") + .withGroupName("btdfjlqbavbhlssltk") + .withIpPermissions(Arrays.asList(new IpPermission().withFromPort(20) + .withIpProtocol("kgjdillfenc") + .withIpRanges(Arrays.asList(new IpRange().withCidrIp("bvmbvmljqvxtixhffwasjzntbuc") + .withDescription("shzjegnqjhifwjai"))) + .withIpv6Ranges(Arrays.asList( + new Ipv6Range().withCidrIpv6("uxlvmqqyfplqdqzolxmmnclvmtd").withDescription("iqaupyjrvko"))) + .withPrefixListIds(Arrays.asList(new PrefixListId().withDescription("chukmrsgeaica") + .withPrefixListId("abvyhxeqhgiuwfmdproas"))) + .withToPort(22) + .withUserIdGroupPairs( + Arrays.asList(new UserIdGroupPair().withDescription("ltskpjkztpi") + .withGroupId("laktgsfwgfj") + .withGroupName("rrnebynwgsv") + .withPeeringStatus("t") + .withUserId("chhl") + .withVpcId("jxcofqkxxcehakoymxojgpra") + .withVpcPeeringConnectionId("vdqrycsnfuwkgftprwierfwv"))))) + .withIpPermissionsEgress(Arrays.asList(new IpPermission().withFromPort(20) + .withIpProtocol("kgjdillfenc") + .withIpRanges(Arrays.asList(new IpRange().withCidrIp("bvmbvmljqvxtixhffwasjzntbuc") + .withDescription("shzjegnqjhifwjai"))) + .withIpv6Ranges(Arrays.asList( + new Ipv6Range().withCidrIpv6("uxlvmqqyfplqdqzolxmmnclvmtd").withDescription("iqaupyjrvko"))) + .withPrefixListIds(Arrays.asList(new PrefixListId().withDescription("chukmrsgeaica") + .withPrefixListId("abvyhxeqhgiuwfmdproas"))) + .withToPort(22) + .withUserIdGroupPairs(Arrays.asList(new UserIdGroupPair().withDescription("ltskpjkztpi") + .withGroupId("laktgsfwgfj") + .withGroupName("rrnebynwgsv") + .withPeeringStatus("t") + .withUserId("chhl") + .withVpcId("jxcofqkxxcehakoymxojgpra") + .withVpcPeeringConnectionId("vdqrycsnfuwkgftprwierfwv"))))) + .withOwnerId("zjetpuydwcwvcujxzfp") + .withTags( + Arrays.asList(new TagAutoGenerated18().withKey("fakeTokenPlaceholder").withValue("jflpondfk"))) + .withVpcId("prgpmjbyqcuinimbjrzfmpmme")) + .withPublicCloudConnectorsResourceId("fuzo") + .withAwsAccountId("opjbipitrztwvqiwhvypn") + .withArn("wmn") + .withPublicCloudResourceName("laxwpziyjookzz") + .withAwsSourceSchema("qdcuf") + .withAwsRegion("hqrasnkghl") + .withAwsTags(mapOf("key5646", "fakeTokenPlaceholder"))) + .create(); + } + + // Use "Map.of" if available + @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; + } +} +``` + +### Ec2SecurityGroups_Delete + +```java +/** + * Samples for Ec2SecurityGroups Delete. + */ +public final class Ec2SecurityGroupsDeleteSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * Ec2SecurityGroups_Delete.json + */ + /** + * Sample code: Ec2SecurityGroups_Delete. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void ec2SecurityGroupsDelete(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.ec2SecurityGroups() + .delete("rgec2SecurityGroup", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE); + } +} +``` + +### Ec2SecurityGroups_GetByResourceGroup + +```java +/** + * Samples for Ec2SecurityGroups GetByResourceGroup. + */ +public final class Ec2SecurityGroupsGetByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * Ec2SecurityGroups_Get.json + */ + /** + * Sample code: Ec2SecurityGroups_Get. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void ec2SecurityGroupsGet(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.ec2SecurityGroups() + .getByResourceGroupWithResponse("rgec2SecurityGroup", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE); + } +} +``` + +### Ec2SecurityGroups_List + +```java +/** + * Samples for Ec2SecurityGroups List. + */ +public final class Ec2SecurityGroupsListSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * Ec2SecurityGroups_ListBySubscription.json + */ + /** + * Sample code: Ec2SecurityGroups_ListBySubscription. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + ec2SecurityGroupsListBySubscription(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.ec2SecurityGroups().list(com.azure.core.util.Context.NONE); + } +} +``` + +### Ec2SecurityGroups_ListByResourceGroup + +```java +/** + * Samples for Ec2SecurityGroups ListByResourceGroup. + */ +public final class Ec2SecurityGroupsListByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * Ec2SecurityGroups_ListByResourceGroup.json + */ + /** + * Sample code: Ec2SecurityGroups_ListByResourceGroup. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + ec2SecurityGroupsListByResourceGroup(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.ec2SecurityGroups().listByResourceGroup("rgec2SecurityGroup", com.azure.core.util.Context.NONE); + } +} +``` + +### Ec2SecurityGroups_Update + +```java +import com.azure.resourcemanager.awsconnector.models.Ec2SecurityGroup; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for Ec2SecurityGroups Update. + */ +public final class Ec2SecurityGroupsUpdateSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * Ec2SecurityGroups_Update.json + */ + /** + * Sample code: Ec2SecurityGroups_Update. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void ec2SecurityGroupsUpdate(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + Ec2SecurityGroup resource = manager.ec2SecurityGroups() + .getByResourceGroupWithResponse("rgec2SecurityGroup", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE) + .getValue(); + resource.update().withTags(mapOf("key3161", "fakeTokenPlaceholder")).apply(); + } + + // Use "Map.of" if available + @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; + } +} +``` + +### Ec2Snapshots_CreateOrReplace + +```java +import com.azure.resourcemanager.awsconnector.models.AwsEc2SnapshotProperties; +import com.azure.resourcemanager.awsconnector.models.Ec2SnapshotProperties; +import com.azure.resourcemanager.awsconnector.models.SnapshotState; +import com.azure.resourcemanager.awsconnector.models.SnapshotStateEnumValue; +import com.azure.resourcemanager.awsconnector.models.SseType; +import com.azure.resourcemanager.awsconnector.models.SseTypeEnumValue; +import com.azure.resourcemanager.awsconnector.models.StorageTier; +import com.azure.resourcemanager.awsconnector.models.StorageTierEnumValue; +import com.azure.resourcemanager.awsconnector.models.TagAutoGenerated19; +import java.time.OffsetDateTime; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for Ec2Snapshots CreateOrReplace. + */ +public final class Ec2SnapshotsCreateOrReplaceSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * Ec2Snapshots_CreateOrReplace.json + */ + /** + * Sample code: Ec2Snapshots_CreateOrReplace. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void ec2SnapshotsCreateOrReplace(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.ec2Snapshots() + .define("Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])") + .withRegion("kqbtvnmdasfajwylafmkah") + .withExistingResourceGroup("rgec2Snapshot") + .withTags(mapOf("key9392", "fakeTokenPlaceholder")) + .withProperties( + new Ec2SnapshotProperties() + .withAwsProperties(new AwsEc2SnapshotProperties().withDataEncryptionKeyId("fakeTokenPlaceholder") + .withDescription("tsduasxksmdr") + .withEncrypted(true) + .withKmsKeyId("fakeTokenPlaceholder") + .withOutpostArn("vpqkamzadulbg") + .withOwnerAlias("bmfwdqpzxg") + .withOwnerId("xudlgprkedlmxatpupwvaknlkxfs") + .withProgress("ecdblvtjkixoklgjh") + .withRestoreExpiryTime(OffsetDateTime.parse("2024-10-08T03:53:51.251Z")) + .withSnapshotId("lpcr") + .withSseType(new SseTypeEnumValue().withValue(SseType.NONE)) + .withStartTime(OffsetDateTime.parse("2024-10-08T03:53:51.251Z")) + .withState(new SnapshotStateEnumValue().withValue(SnapshotState.COMPLETED)) + .withStateMessage("nogwovxkgpjylsijzipkpqzxpvjh") + .withStorageTier(new StorageTierEnumValue().withValue(StorageTier.ARCHIVE)) + .withTags( + Arrays.asList(new TagAutoGenerated19().withKey("fakeTokenPlaceholder").withValue("vjhh"))) + .withVolumeId("rzepawgzsvqncqbpjxnijhwofbgc") + .withVolumeSize(3)) + .withPublicCloudConnectorsResourceId("bfcselosmakgrkibu") + .withAwsAccountId("iizqmtavivxapbfqrqqrauezng") + .withArn("z") + .withPublicCloudResourceName("eyltdaumfqmdgmnlwpgjhjlavikc") + .withAwsSourceSchema("gmzpssyyjoqqnqjxwcluwnyrswywcv") + .withAwsRegion("yylufbdgujuqmqwhscnglwsa") + .withAwsTags(mapOf("key9124", "fakeTokenPlaceholder"))) + .create(); + } + + // Use "Map.of" if available + @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; + } +} +``` + +### Ec2Snapshots_Delete + +```java +/** + * Samples for Ec2Snapshots Delete. + */ +public final class Ec2SnapshotsDeleteSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/Ec2Snapshots_Delete + * .json + */ + /** + * Sample code: Ec2Snapshots_Delete. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void ec2SnapshotsDelete(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.ec2Snapshots() + .delete("rgec2Snapshot", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE); + } +} +``` + +### Ec2Snapshots_GetByResourceGroup + +```java +/** + * Samples for Ec2Snapshots GetByResourceGroup. + */ +public final class Ec2SnapshotsGetByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/Ec2Snapshots_Get. + * json + */ + /** + * Sample code: Ec2Snapshots_Get. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void ec2SnapshotsGet(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.ec2Snapshots() + .getByResourceGroupWithResponse("rgec2Snapshot", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE); + } +} +``` + +### Ec2Snapshots_List + +```java +/** + * Samples for Ec2Snapshots List. + */ +public final class Ec2SnapshotsListSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * Ec2Snapshots_ListBySubscription.json + */ + /** + * Sample code: Ec2Snapshots_ListBySubscription. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + ec2SnapshotsListBySubscription(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.ec2Snapshots().list(com.azure.core.util.Context.NONE); + } +} +``` + +### Ec2Snapshots_ListByResourceGroup + +```java +/** + * Samples for Ec2Snapshots ListByResourceGroup. + */ +public final class Ec2SnapshotsListByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * Ec2Snapshots_ListByResourceGroup.json + */ + /** + * Sample code: Ec2Snapshots_ListByResourceGroup. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + ec2SnapshotsListByResourceGroup(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.ec2Snapshots().listByResourceGroup("rgec2Snapshot", com.azure.core.util.Context.NONE); + } +} +``` + +### Ec2Snapshots_Update + +```java +import com.azure.resourcemanager.awsconnector.models.Ec2Snapshot; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for Ec2Snapshots Update. + */ +public final class Ec2SnapshotsUpdateSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/Ec2Snapshots_Update + * .json + */ + /** + * Sample code: Ec2Snapshots_Update. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void ec2SnapshotsUpdate(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + Ec2Snapshot resource = manager.ec2Snapshots() + .getByResourceGroupWithResponse("rgec2Snapshot", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE) + .getValue(); + resource.update().withTags(mapOf("key9290", "fakeTokenPlaceholder")).apply(); + } + + // Use "Map.of" if available + @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; + } +} +``` + +### Ec2Subnets_CreateOrReplace + +```java +import com.azure.resourcemanager.awsconnector.models.AwsEc2SubnetProperties; +import com.azure.resourcemanager.awsconnector.models.Ec2SubnetProperties; +import com.azure.resourcemanager.awsconnector.models.PrivateDnsNameOptionsOnLaunchModelProperties; +import com.azure.resourcemanager.awsconnector.models.TagAutoGenerated20; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for Ec2Subnets CreateOrReplace. + */ +public final class Ec2SubnetsCreateOrReplaceSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * Ec2Subnets_CreateOrReplace.json + */ + /** + * Sample code: Ec2Subnets_CreateOrReplace. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void ec2SubnetsCreateOrReplace(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.ec2Subnets() + .define("Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])") + .withRegion("zlyeymkfsbtninhfrnvrhxprr") + .withExistingResourceGroup("rgec2Subnet") + .withTags(mapOf("key8525", "fakeTokenPlaceholder")) + .withProperties( + new Ec2SubnetProperties() + .withAwsProperties( + new AwsEc2SubnetProperties().withAssignIpv6AddressOnCreation(true) + .withAvailabilityZone("forrknmiozum") + .withAvailabilityZoneId("gbjfdurjqxgejgwo") + .withCidrBlock("sisksglodnipqskrsfsvkpcrrcy") + .withEnableDns64(true) + .withEnableLniAtDeviceIndex(1) + .withIpv4IpamPoolId("jdpbqiv") + .withIpv4NetmaskLength(18) + .withIpv6CidrBlock("ayzvyvftxekjogtumuln") + .withIpv6CidrBlocks(Arrays.asList("amuwewdpaadfixhakcdaqrjzlskguz")) + .withIpv6IpamPoolId("lenenhwtwwet") + .withIpv6Native(true) + .withIpv6NetmaskLength(16) + .withMapPublicIpOnLaunch(true) + .withNetworkAclAssociationId("saevhbbbzksuojanmdoizrhyxo") + .withOutpostArn("qzuvnwxqc") + .withPrivateDnsNameOptionsOnLaunch(new PrivateDnsNameOptionsOnLaunchModelProperties() + .withEnableResourceNameDnsAaaaRecord(true) + .withEnableResourceNameDnsARecord(true) + .withHostnameType("cbuc")) + .withSubnetId("vxxbkvimjzmcfoxur") + .withTags(Arrays.asList(new TagAutoGenerated20().withKey("fakeTokenPlaceholder") + .withValue("bfgzdnenxrviyueqzftrrvu"))) + .withVpcId("aqqzsoyvmaxfyqddvthvxlhdti")) + .withPublicCloudConnectorsResourceId("svkjfvphtfxopebxrcdvwyj") + .withAwsAccountId("mmlzefobqbimxcbqwrkitlgfu") + .withArn("swrduvxfquidiycxlrijjixfbwb") + .withPublicCloudResourceName("p") + .withAwsSourceSchema("wyjdcprcwjbw") + .withAwsRegion("huifdbndfvqyztfwfclpqlxupzib") + .withAwsTags(mapOf("key3667", "fakeTokenPlaceholder"))) + .create(); + } + + // Use "Map.of" if available + @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; + } +} +``` + +### Ec2Subnets_Delete + +```java +/** + * Samples for Ec2Subnets Delete. + */ +public final class Ec2SubnetsDeleteSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/Ec2Subnets_Delete. + * json + */ + /** + * Sample code: Ec2Subnets_Delete. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void ec2SubnetsDelete(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.ec2Subnets() + .delete("rgec2Subnet", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE); + } +} +``` + +### Ec2Subnets_GetByResourceGroup + +```java +/** + * Samples for Ec2Subnets GetByResourceGroup. + */ +public final class Ec2SubnetsGetByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/Ec2Subnets_Get.json + */ + /** + * Sample code: Ec2Subnets_Get. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void ec2SubnetsGet(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.ec2Subnets() + .getByResourceGroupWithResponse("rgec2Subnet", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE); + } +} +``` + +### Ec2Subnets_List + +```java +/** + * Samples for Ec2Subnets List. + */ +public final class Ec2SubnetsListSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * Ec2Subnets_ListBySubscription.json + */ + /** + * Sample code: Ec2Subnets_ListBySubscription. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + ec2SubnetsListBySubscription(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.ec2Subnets().list(com.azure.core.util.Context.NONE); + } +} +``` + +### Ec2Subnets_ListByResourceGroup + +```java +/** + * Samples for Ec2Subnets ListByResourceGroup. + */ +public final class Ec2SubnetsListByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * Ec2Subnets_ListByResourceGroup.json + */ + /** + * Sample code: Ec2Subnets_ListByResourceGroup. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + ec2SubnetsListByResourceGroup(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.ec2Subnets().listByResourceGroup("rgec2Subnet", com.azure.core.util.Context.NONE); + } +} +``` + +### Ec2Subnets_Update + +```java +import com.azure.resourcemanager.awsconnector.models.Ec2Subnet; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for Ec2Subnets Update. + */ +public final class Ec2SubnetsUpdateSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/Ec2Subnets_Update. + * json + */ + /** + * Sample code: Ec2Subnets_Update. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void ec2SubnetsUpdate(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + Ec2Subnet resource = manager.ec2Subnets() + .getByResourceGroupWithResponse("rgec2Subnet", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE) + .getValue(); + resource.update().withTags(mapOf("key1062", "fakeTokenPlaceholder")).apply(); + } + + // Use "Map.of" if available + @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; + } +} +``` + +### Ec2Volumes_CreateOrReplace + +```java +import com.azure.resourcemanager.awsconnector.models.AwsEc2VolumeProperties; +import com.azure.resourcemanager.awsconnector.models.Ec2VolumeProperties; +import com.azure.resourcemanager.awsconnector.models.TagAutoGenerated21; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for Ec2Volumes CreateOrReplace. + */ +public final class Ec2VolumesCreateOrReplaceSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * Ec2Volumes_CreateOrReplace.json + */ + /** + * Sample code: Ec2Volumes_CreateOrReplace. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void ec2VolumesCreateOrReplace(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.ec2Volumes() + .define("Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])") + .withRegion("tvdnvkrfzxnahsvnguhrcancxusw") + .withExistingResourceGroup("rgec2Volume") + .withTags(mapOf("key271", "fakeTokenPlaceholder")) + .withProperties( + new Ec2VolumeProperties() + .withAwsProperties(new AwsEc2VolumeProperties().withAutoEnableIO(true) + .withAvailabilityZone("wtzdrwiuscqtvxwi") + .withEncrypted(true) + .withIops(3) + .withKmsKeyId("fakeTokenPlaceholder") + .withMultiAttachEnabled(true) + .withOutpostArn("umrirqwmsnmeeknbjkph") + .withSize(2) + .withSnapshotId("upwukogzrkqcaea") + .withTags(Arrays.asList( + new TagAutoGenerated21().withKey("fakeTokenPlaceholder").withValue("hnfhwndsnhbpnwfv"))) + .withThroughput(20) + .withVolumeId("rdcojpg") + .withVolumeType("otkmglqvqws")) + .withPublicCloudConnectorsResourceId("fw") + .withAwsAccountId("zoosbunhmv") + .withArn("evx") + .withPublicCloudResourceName("xowgb") + .withAwsSourceSchema("wlglq") + .withAwsRegion("cw") + .withAwsTags(mapOf("key2425", "fakeTokenPlaceholder"))) + .create(); + } + + // Use "Map.of" if available + @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; + } +} +``` + +### Ec2Volumes_Delete + +```java +/** + * Samples for Ec2Volumes Delete. + */ +public final class Ec2VolumesDeleteSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/Ec2Volumes_Delete. + * json + */ + /** + * Sample code: Ec2Volumes_Delete. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void ec2VolumesDelete(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.ec2Volumes() + .delete("rgec2Volume", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE); + } +} +``` + +### Ec2Volumes_GetByResourceGroup + +```java +/** + * Samples for Ec2Volumes GetByResourceGroup. + */ +public final class Ec2VolumesGetByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/Ec2Volumes_Get.json + */ + /** + * Sample code: Ec2Volumes_Get. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void ec2VolumesGet(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.ec2Volumes() + .getByResourceGroupWithResponse("rgec2Volume", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE); + } +} +``` + +### Ec2Volumes_List + +```java +/** + * Samples for Ec2Volumes List. + */ +public final class Ec2VolumesListSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * Ec2Volumes_ListBySubscription.json + */ + /** + * Sample code: Ec2Volumes_ListBySubscription. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + ec2VolumesListBySubscription(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.ec2Volumes().list(com.azure.core.util.Context.NONE); + } +} +``` + +### Ec2Volumes_ListByResourceGroup + +```java +/** + * Samples for Ec2Volumes ListByResourceGroup. + */ +public final class Ec2VolumesListByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * Ec2Volumes_ListByResourceGroup.json + */ + /** + * Sample code: Ec2Volumes_ListByResourceGroup. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + ec2VolumesListByResourceGroup(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.ec2Volumes().listByResourceGroup("rgec2Volume", com.azure.core.util.Context.NONE); + } +} +``` + +### Ec2Volumes_Update + +```java +import com.azure.resourcemanager.awsconnector.models.Ec2Volume; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for Ec2Volumes Update. + */ +public final class Ec2VolumesUpdateSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/Ec2Volumes_Update. + * json + */ + /** + * Sample code: Ec2Volumes_Update. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void ec2VolumesUpdate(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + Ec2Volume resource = manager.ec2Volumes() + .getByResourceGroupWithResponse("rgec2Volume", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE) + .getValue(); + resource.update().withTags(mapOf("key2751", "fakeTokenPlaceholder")).apply(); + } + + // Use "Map.of" if available + @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; + } +} +``` + +### Ec2VpcEndpoints_CreateOrReplace + +```java +import com.azure.resourcemanager.awsconnector.models.AwsEc2VpcEndpointProperties; +import com.azure.resourcemanager.awsconnector.models.Ec2VpcEndpointProperties; +import com.azure.resourcemanager.awsconnector.models.VpcEndpointType; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for Ec2VpcEndpoints CreateOrReplace. + */ +public final class Ec2VpcEndpointsCreateOrReplaceSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * Ec2VpcEndpoints_CreateOrReplace.json + */ + /** + * Sample code: Ec2VpcEndpoints_CreateOrReplace. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + ec2VpcEndpointsCreateOrReplace(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.ec2VpcEndpoints() + .define("Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])") + .withRegion("kkohg") + .withExistingResourceGroup("rgec2VPCEndpoint") + .withTags(mapOf("key8512", "fakeTokenPlaceholder")) + .withProperties(new Ec2VpcEndpointProperties() + .withAwsProperties(new AwsEc2VpcEndpointProperties().withCreationTimestamp("wmawquyzuhbnkrveo") + .withDnsEntries(Arrays.asList("kenhegadrd")) + .withId("xfylmv") + .withNetworkInterfaceIds(Arrays.asList("uvzbeqj")) + .withPolicyDocument(mapOf()) + .withPrivateDnsEnabled(true) + .withRouteTableIds(Arrays.asList("ybkagmpjwuixbpltpabcrwewbjgj")) + .withSecurityGroupIds(Arrays.asList("swfhjyallivwkmzqdyqsgitfilel")) + .withServiceName("bltgximadajrfctijpznsmxgy") + .withSubnetIds(Arrays.asList("oyfzvlrnugigsjyadmdpjblsgpcxkr")) + .withVpcEndpointType(VpcEndpointType.GATEWAY) + .withVpcId("ebbnplgbjkbqfifbmbrii")) + .withPublicCloudConnectorsResourceId("lyxajxyfvrugpvxchbigrlulomftou") + .withAwsAccountId("wtjkq") + .withArn("cxdwblbwakjiwxs") + .withPublicCloudResourceName("zwgwsjbodssxgzq") + .withAwsSourceSchema("mpgbtkugoucwqsqzzchrl") + .withAwsRegion("hmnjtlhnkmnlwcuykbighvnvnjc") + .withAwsTags(mapOf("key7370", "fakeTokenPlaceholder"))) + .create(); + } + + // Use "Map.of" if available + @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; + } +} +``` + +### Ec2VpcEndpoints_Delete + +```java +/** + * Samples for Ec2VpcEndpoints Delete. + */ +public final class Ec2VpcEndpointsDeleteSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * Ec2VpcEndpoints_Delete.json + */ + /** + * Sample code: Ec2VpcEndpoints_Delete. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void ec2VpcEndpointsDelete(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.ec2VpcEndpoints() + .delete("rgec2VPCEndpoint", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE); + } +} +``` + +### Ec2VpcEndpoints_GetByResourceGroup + +```java +/** + * Samples for Ec2VpcEndpoints GetByResourceGroup. + */ +public final class Ec2VpcEndpointsGetByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/Ec2VpcEndpoints_Get + * .json + */ + /** + * Sample code: Ec2VpcEndpoints_Get. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void ec2VpcEndpointsGet(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.ec2VpcEndpoints() + .getByResourceGroupWithResponse("rgec2VPCEndpoint", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE); + } +} +``` + +### Ec2VpcEndpoints_List + +```java +/** + * Samples for Ec2VpcEndpoints List. + */ +public final class Ec2VpcEndpointsListSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * Ec2VpcEndpoints_ListBySubscription.json + */ + /** + * Sample code: Ec2VpcEndpoints_ListBySubscription. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + ec2VpcEndpointsListBySubscription(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.ec2VpcEndpoints().list(com.azure.core.util.Context.NONE); + } +} +``` + +### Ec2VpcEndpoints_ListByResourceGroup + +```java +/** + * Samples for Ec2VpcEndpoints ListByResourceGroup. + */ +public final class Ec2VpcEndpointsListByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * Ec2VpcEndpoints_ListByResourceGroup.json + */ + /** + * Sample code: Ec2VpcEndpoints_ListByResourceGroup. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + ec2VpcEndpointsListByResourceGroup(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.ec2VpcEndpoints().listByResourceGroup("rgec2VPCEndpoint", com.azure.core.util.Context.NONE); + } +} +``` + +### Ec2VpcEndpoints_Update + +```java +import com.azure.resourcemanager.awsconnector.models.Ec2VpcEndpoint; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for Ec2VpcEndpoints Update. + */ +public final class Ec2VpcEndpointsUpdateSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * Ec2VpcEndpoints_Update.json + */ + /** + * Sample code: Ec2VpcEndpoints_Update. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void ec2VpcEndpointsUpdate(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + Ec2VpcEndpoint resource = manager.ec2VpcEndpoints() + .getByResourceGroupWithResponse("rgec2VPCEndpoint", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE) + .getValue(); + resource.update().withTags(mapOf("key7567", "fakeTokenPlaceholder")).apply(); + } + + // Use "Map.of" if available + @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; + } +} +``` + +### Ec2VpcPeeringConnections_CreateOrReplace + +```java +import com.azure.resourcemanager.awsconnector.models.AwsEc2VpcPeeringConnectionProperties; +import com.azure.resourcemanager.awsconnector.models.Ec2VpcPeeringConnectionProperties; +import com.azure.resourcemanager.awsconnector.models.TagAutoGenerated23; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for Ec2VpcPeeringConnections CreateOrReplace. + */ +public final class Ec2VpcPeeringConnectionsCreateOrReplaceSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * Ec2VpcPeeringConnections_CreateOrReplace.json + */ + /** + * Sample code: Ec2VpcPeeringConnections_CreateOrReplace. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + ec2VpcPeeringConnectionsCreateOrReplace(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.ec2VpcPeeringConnections() + .define("Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])") + .withRegion("lqfmwbb") + .withExistingResourceGroup("rgec2VPCPeeringConnection") + .withTags(mapOf("key6160", "fakeTokenPlaceholder")) + .withProperties(new Ec2VpcPeeringConnectionProperties() + .withAwsProperties(new AwsEc2VpcPeeringConnectionProperties().withId("emsfznbbfejdwouyracpg") + .withPeerOwnerId("ddjymdvquwsrdt") + .withPeerRegion("qcbhjmbddzbcs") + .withPeerRoleArn("kaophgngiqxorpifcluz") + .withPeerVpcId("ccurncyuawhicumwcxxnmuq") + .withTags(Arrays + .asList(new TagAutoGenerated23().withKey("fakeTokenPlaceholder").withValue("xgzluroiobmj"))) + .withVpcId("lkitywfkos")) + .withPublicCloudConnectorsResourceId("jlenaffdnxswiytzyfvbfjfghuf") + .withAwsAccountId("digeyffuemunjngxz") + .withArn("dxhchlgpyvhsexomfqaj") + .withPublicCloudResourceName("ackzpztj") + .withAwsSourceSchema("pfevychrftkuamvlorm") + .withAwsRegion("qgrfrceaszbzvo") + .withAwsTags(mapOf("key8493", "fakeTokenPlaceholder"))) + .create(); + } + + // Use "Map.of" if available + @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; + } +} +``` + +### Ec2VpcPeeringConnections_Delete + +```java +/** + * Samples for Ec2VpcPeeringConnections Delete. + */ +public final class Ec2VpcPeeringConnectionsDeleteSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * Ec2VpcPeeringConnections_Delete.json + */ + /** + * Sample code: Ec2VpcPeeringConnections_Delete. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + ec2VpcPeeringConnectionsDelete(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.ec2VpcPeeringConnections() + .delete("rgec2VPCPeeringConnection", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE); + } +} +``` + +### Ec2VpcPeeringConnections_GetByResourceGroup + +```java +/** + * Samples for Ec2VpcPeeringConnections GetByResourceGroup. + */ +public final class Ec2VpcPeeringConnectionsGetByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * Ec2VpcPeeringConnections_Get.json + */ + /** + * Sample code: Ec2VpcPeeringConnections_Get. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void ec2VpcPeeringConnectionsGet(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.ec2VpcPeeringConnections() + .getByResourceGroupWithResponse("rgec2VPCPeeringConnection", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE); + } +} +``` + +### Ec2VpcPeeringConnections_List + +```java +/** + * Samples for Ec2VpcPeeringConnections List. + */ +public final class Ec2VpcPeeringConnectionsListSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * Ec2VpcPeeringConnections_ListBySubscription.json + */ + /** + * Sample code: Ec2VpcPeeringConnections_ListBySubscription. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + ec2VpcPeeringConnectionsListBySubscription(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.ec2VpcPeeringConnections().list(com.azure.core.util.Context.NONE); + } +} +``` + +### Ec2VpcPeeringConnections_ListByResourceGroup + +```java +/** + * Samples for Ec2VpcPeeringConnections ListByResourceGroup. + */ +public final class Ec2VpcPeeringConnectionsListByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * Ec2VpcPeeringConnections_ListByResourceGroup.json + */ + /** + * Sample code: Ec2VpcPeeringConnections_ListByResourceGroup. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void ec2VpcPeeringConnectionsListByResourceGroup( + com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.ec2VpcPeeringConnections() + .listByResourceGroup("rgec2VPCPeeringConnection", com.azure.core.util.Context.NONE); + } +} +``` + +### Ec2VpcPeeringConnections_Update + +```java +import com.azure.resourcemanager.awsconnector.models.Ec2VpcPeeringConnection; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for Ec2VpcPeeringConnections Update. + */ +public final class Ec2VpcPeeringConnectionsUpdateSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * Ec2VpcPeeringConnections_Update.json + */ + /** + * Sample code: Ec2VpcPeeringConnections_Update. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + ec2VpcPeeringConnectionsUpdate(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + Ec2VpcPeeringConnection resource = manager.ec2VpcPeeringConnections() + .getByResourceGroupWithResponse("rgec2VPCPeeringConnection", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE) + .getValue(); + resource.update().withTags(mapOf("key4874", "fakeTokenPlaceholder")).apply(); + } + + // Use "Map.of" if available + @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; + } +} +``` + +### Ec2Vpcs_CreateOrReplace + +```java +import com.azure.resourcemanager.awsconnector.models.AwsEc2VpcProperties; +import com.azure.resourcemanager.awsconnector.models.Ec2VpcProperties; +import com.azure.resourcemanager.awsconnector.models.TagAutoGenerated22; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for Ec2Vpcs CreateOrReplace. + */ +public final class Ec2VpcsCreateOrReplaceSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * Ec2Vpcs_CreateOrReplace.json + */ + /** + * Sample code: Ec2Vpcs_CreateOrReplace. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void ec2VpcsCreateOrReplace(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.ec2Vpcs() + .define("Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])") + .withRegion("bcrtgodiyozdsiqbhdvsaaog") + .withExistingResourceGroup("rgec2Vpc") + .withTags(mapOf("key2430", "fakeTokenPlaceholder")) + .withProperties(new Ec2VpcProperties() + .withAwsProperties(new AwsEc2VpcProperties().withCidrBlock("amstuguadqkmlmofdszmxhgssf") + .withCidrBlockAssociations(Arrays.asList("ykwdexxzxjxowuuawym")) + .withDefaultNetworkAcl("lhtepidfpfsyxksnvekueeyvw") + .withDefaultSecurityGroup("qtqgizvsvzdqxmbwwpmtcnqlfuh") + .withEnableDnsHostnames(true) + .withEnableDnsSupport(true) + .withInstanceTenancy("haqdsdkgbjmnwdgamqs") + .withIpv4IpamPoolId("ldzbfvpzpwudqtdyb") + .withIpv4NetmaskLength(21) + .withIpv6CidrBlocks(Arrays.asList("q")) + .withTags(Arrays.asList( + new TagAutoGenerated22().withKey("fakeTokenPlaceholder").withValue("tqvkxdrwsaxvxwckrpqk"))) + .withVpcId("wqqqqmtbgzmdfmkiaoyjdkavuzzzzw")) + .withPublicCloudConnectorsResourceId("hpzdeuzmjfwatmynigq") + .withAwsAccountId("vskthos") + .withArn("isskkecektndkosbruasgvkakzf") + .withPublicCloudResourceName("qjwdilmlbbam") + .withAwsSourceSchema("vnjplxwhapuaydjjdqiaqfvbfjam") + .withAwsRegion("paraxj") + .withAwsTags(mapOf("key96", "fakeTokenPlaceholder"))) + .create(); + } + + // Use "Map.of" if available + @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; + } +} +``` + +### Ec2Vpcs_Delete + +```java +/** + * Samples for Ec2Vpcs Delete. + */ +public final class Ec2VpcsDeleteSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/Ec2Vpcs_Delete.json + */ + /** + * Sample code: Ec2Vpcs_Delete. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void ec2VpcsDelete(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.ec2Vpcs() + .delete("rgec2Vpc", "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE); + } +} +``` + +### Ec2Vpcs_GetByResourceGroup + +```java +/** + * Samples for Ec2Vpcs GetByResourceGroup. + */ +public final class Ec2VpcsGetByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/Ec2Vpcs_Get.json + */ + /** + * Sample code: Ec2Vpcs_Get. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void ec2VpcsGet(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.ec2Vpcs() + .getByResourceGroupWithResponse("rgec2Vpc", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE); + } +} +``` + +### Ec2Vpcs_List + +```java +/** + * Samples for Ec2Vpcs List. + */ +public final class Ec2VpcsListSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * Ec2Vpcs_ListBySubscription.json + */ + /** + * Sample code: Ec2Vpcs_ListBySubscription. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void ec2VpcsListBySubscription(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.ec2Vpcs().list(com.azure.core.util.Context.NONE); + } +} +``` + +### Ec2Vpcs_ListByResourceGroup + +```java +/** + * Samples for Ec2Vpcs ListByResourceGroup. + */ +public final class Ec2VpcsListByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * Ec2Vpcs_ListByResourceGroup.json + */ + /** + * Sample code: Ec2Vpcs_ListByResourceGroup. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void ec2VpcsListByResourceGroup(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.ec2Vpcs().listByResourceGroup("rgec2Vpc", com.azure.core.util.Context.NONE); + } +} +``` + +### Ec2Vpcs_Update + +```java +import com.azure.resourcemanager.awsconnector.models.Ec2Vpc; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for Ec2Vpcs Update. + */ +public final class Ec2VpcsUpdateSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/Ec2Vpcs_Update.json + */ + /** + * Sample code: Ec2Vpcs_Update. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void ec2VpcsUpdate(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + Ec2Vpc resource = manager.ec2Vpcs() + .getByResourceGroupWithResponse("rgec2Vpc", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE) + .getValue(); + resource.update().withTags(mapOf("key5864", "fakeTokenPlaceholder")).apply(); + } + + // Use "Map.of" if available + @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; + } +} +``` + +### EcrImageDetails_CreateOrReplace + +```java +import com.azure.resourcemanager.awsconnector.models.AwsEcrImageDetailProperties; +import com.azure.resourcemanager.awsconnector.models.EcrImageDetailProperties; +import com.azure.resourcemanager.awsconnector.models.ImageScanFindingsSummary; +import com.azure.resourcemanager.awsconnector.models.ImageScanStatus; +import com.azure.resourcemanager.awsconnector.models.ScanStatus; +import com.azure.resourcemanager.awsconnector.models.ScanStatusEnumValue; +import java.time.OffsetDateTime; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for EcrImageDetails CreateOrReplace. + */ +public final class EcrImageDetailsCreateOrReplaceSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * EcrImageDetails_CreateOrReplace.json + */ + /** + * Sample code: EcrImageDetails_CreateOrReplace. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + ecrImageDetailsCreateOrReplace(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.ecrImageDetails() + .define("Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])") + .withRegion("mpxszpyclsniahaoqerqewrzxyzcdt") + .withExistingResourceGroup("rgecrImageDetail") + .withTags(mapOf("key9132", "fakeTokenPlaceholder")) + .withProperties(new EcrImageDetailProperties() + .withAwsProperties(new AwsEcrImageDetailProperties().withArtifactMediaType("ciuahpzw") + .withImageDigest("mfgr") + .withImageManifestMediaType("arzsyssziqvvryqc") + .withImagePushedAt(OffsetDateTime.parse("2024-10-08T03:51:24.487Z")) + .withImageScanFindingsSummary( + new ImageScanFindingsSummary().withFindingSeverityCounts(mapOf("key9764", 10)) + .withImageScanCompletedAt(OffsetDateTime.parse("2024-10-08T03:51:24.488Z")) + .withVulnerabilitySourceUpdatedAt(OffsetDateTime.parse("2024-10-08T03:51:24.488Z"))) + .withImageScanStatus(new ImageScanStatus().withDescription("kvsqwhxzrnciqybnl") + .withStatus(new ScanStatusEnumValue().withValue(ScanStatus.ACTIVE))) + .withImageSizeInBytes(18L) + .withImageTags(Arrays.asList("bwikpoljnmaoewepiunoltcxlyxd")) + .withLastRecordedPullTime(OffsetDateTime.parse("2024-10-08T03:51:24.488Z")) + .withRegistryId("xpxtbbeejeosvtcvq") + .withRepositoryName("abftxvvazyfekkcpo")) + .withPublicCloudConnectorsResourceId("glrdicxdaktwlkvgvxurgww") + .withAwsAccountId("yqyxjsfibyscdhyofmyu") + .withArn("dhvgwgtedzuiqdvgc") + .withPublicCloudResourceName("gijthpfhduauuus") + .withAwsSourceSchema("ibsdsdpuiqcwsdxqfn") + .withAwsRegion("atlamkemuqwaezwdsuavhaqo") + .withAwsTags(mapOf("key4659", "fakeTokenPlaceholder"))) + .create(); + } + + // Use "Map.of" if available + @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; + } +} +``` + +### EcrImageDetails_Delete + +```java +/** + * Samples for EcrImageDetails Delete. + */ +public final class EcrImageDetailsDeleteSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * EcrImageDetails_Delete.json + */ + /** + * Sample code: EcrImageDetails_Delete. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void ecrImageDetailsDelete(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.ecrImageDetails() + .delete("rgecrImageDetail", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE); + } +} +``` + +### EcrImageDetails_GetByResourceGroup + +```java +/** + * Samples for EcrImageDetails GetByResourceGroup. + */ +public final class EcrImageDetailsGetByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/EcrImageDetails_Get + * .json + */ + /** + * Sample code: EcrImageDetails_Get. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void ecrImageDetailsGet(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.ecrImageDetails() + .getByResourceGroupWithResponse("rgecrImageDetail", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE); + } +} +``` + +### EcrImageDetails_List + +```java +/** + * Samples for EcrImageDetails List. + */ +public final class EcrImageDetailsListSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * EcrImageDetails_ListBySubscription.json + */ + /** + * Sample code: EcrImageDetails_ListBySubscription. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + ecrImageDetailsListBySubscription(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.ecrImageDetails().list(com.azure.core.util.Context.NONE); + } +} +``` + +### EcrImageDetails_ListByResourceGroup + +```java +/** + * Samples for EcrImageDetails ListByResourceGroup. + */ +public final class EcrImageDetailsListByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * EcrImageDetails_ListByResourceGroup.json + */ + /** + * Sample code: EcrImageDetails_ListByResourceGroup. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + ecrImageDetailsListByResourceGroup(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.ecrImageDetails().listByResourceGroup("rgecrImageDetail", com.azure.core.util.Context.NONE); + } +} +``` + +### EcrImageDetails_Update + +```java +import com.azure.resourcemanager.awsconnector.models.EcrImageDetail; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for EcrImageDetails Update. + */ +public final class EcrImageDetailsUpdateSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * EcrImageDetails_Update.json + */ + /** + * Sample code: EcrImageDetails_Update. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void ecrImageDetailsUpdate(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + EcrImageDetail resource = manager.ecrImageDetails() + .getByResourceGroupWithResponse("rgecrImageDetail", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE) + .getValue(); + resource.update().withTags(mapOf("key5066", "fakeTokenPlaceholder")).apply(); + } + + // Use "Map.of" if available + @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; + } +} +``` + +### EcrRepositories_CreateOrReplace + +```java +import com.azure.resourcemanager.awsconnector.models.AwsEcrRepositoryProperties; +import com.azure.resourcemanager.awsconnector.models.EcrRepositoryProperties; +import com.azure.resourcemanager.awsconnector.models.EncryptionConfiguration; +import com.azure.resourcemanager.awsconnector.models.EncryptionConfigurationEncryptionType; +import com.azure.resourcemanager.awsconnector.models.ImageScanningConfiguration; +import com.azure.resourcemanager.awsconnector.models.ImageTagMutability; +import com.azure.resourcemanager.awsconnector.models.LifecyclePolicy; +import com.azure.resourcemanager.awsconnector.models.TagAutoGenerated24; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for EcrRepositories CreateOrReplace. + */ +public final class EcrRepositoriesCreateOrReplaceSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * EcrRepositories_CreateOrReplace.json + */ + /** + * Sample code: EcrRepositories_CreateOrReplace. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + ecrRepositoriesCreateOrReplace(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.ecrRepositories() + .define("Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])") + .withRegion("uxqfbijfanljas") + .withExistingResourceGroup("rgecrRepository") + .withTags(mapOf("key2390", "fakeTokenPlaceholder")) + .withProperties( + new EcrRepositoryProperties() + .withAwsProperties( + new AwsEcrRepositoryProperties().withArn("su") + .withEmptyOnDelete(true) + .withEncryptionConfiguration(new EncryptionConfiguration() + .withEncryptionType(EncryptionConfigurationEncryptionType.AES256) + .withKmsKey("fakeTokenPlaceholder")) + .withImageScanningConfiguration(new ImageScanningConfiguration().withScanOnPush(true)) + .withImageTagMutability(ImageTagMutability.IMMUTABLE) + .withLifecyclePolicy(new LifecyclePolicy().withLifecyclePolicyText("xvazgvi") + .withRegistryId("oluqsenexubjydpyaw")) + .withRepositoryName("iuhxuyfxygvumphlcwhnsscudjez") + .withRepositoryPolicyText(mapOf()) + .withRepositoryUri("vmljyfyskxbyjczax") + .withTags(Arrays + .asList(new TagAutoGenerated24().withKey("fakeTokenPlaceholder").withValue("qu")))) + .withPublicCloudConnectorsResourceId("ohtcynikymmfceroreix") + .withAwsAccountId("iuomdzpobqirucabbxz") + .withArn("djb") + .withPublicCloudResourceName("bymfiroqkcgssnop") + .withAwsSourceSchema("olwqyujnmxxhxwyp") + .withAwsRegion("wliyvzjqcxbpwtgjae") + .withAwsTags(mapOf("key7950", "fakeTokenPlaceholder"))) + .create(); + } + + // Use "Map.of" if available + @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; + } +} +``` + +### EcrRepositories_Delete + +```java +/** + * Samples for EcrRepositories Delete. + */ +public final class EcrRepositoriesDeleteSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * EcrRepositories_Delete.json + */ + /** + * Sample code: EcrRepositories_Delete. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void ecrRepositoriesDelete(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.ecrRepositories() + .delete("rgecrRepository", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE); + } +} +``` + +### EcrRepositories_GetByResourceGroup + +```java +/** + * Samples for EcrRepositories GetByResourceGroup. + */ +public final class EcrRepositoriesGetByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/EcrRepositories_Get + * .json + */ + /** + * Sample code: EcrRepositories_Get. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void ecrRepositoriesGet(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.ecrRepositories() + .getByResourceGroupWithResponse("rgecrRepository", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE); + } +} +``` + +### EcrRepositories_List + +```java +/** + * Samples for EcrRepositories List. + */ +public final class EcrRepositoriesListSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * EcrRepositories_ListBySubscription.json + */ + /** + * Sample code: EcrRepositories_ListBySubscription. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + ecrRepositoriesListBySubscription(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.ecrRepositories().list(com.azure.core.util.Context.NONE); + } +} +``` + +### EcrRepositories_ListByResourceGroup + +```java +/** + * Samples for EcrRepositories ListByResourceGroup. + */ +public final class EcrRepositoriesListByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * EcrRepositories_ListByResourceGroup.json + */ + /** + * Sample code: EcrRepositories_ListByResourceGroup. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + ecrRepositoriesListByResourceGroup(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.ecrRepositories().listByResourceGroup("rgecrRepository", com.azure.core.util.Context.NONE); + } +} +``` + +### EcrRepositories_Update + +```java +import com.azure.resourcemanager.awsconnector.models.EcrRepository; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for EcrRepositories Update. + */ +public final class EcrRepositoriesUpdateSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * EcrRepositories_Update.json + */ + /** + * Sample code: EcrRepositories_Update. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void ecrRepositoriesUpdate(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + EcrRepository resource = manager.ecrRepositories() + .getByResourceGroupWithResponse("rgecrRepository", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE) + .getValue(); + resource.update().withTags(mapOf("key2760", "fakeTokenPlaceholder")).apply(); + } + + // Use "Map.of" if available + @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; + } +} +``` + +### EcsClusters_CreateOrReplace + +```java +import com.azure.resourcemanager.awsconnector.models.AwsEcsClusterProperties; +import com.azure.resourcemanager.awsconnector.models.CapacityProviderStrategyItem; +import com.azure.resourcemanager.awsconnector.models.ClusterConfiguration; +import com.azure.resourcemanager.awsconnector.models.ClusterSettings; +import com.azure.resourcemanager.awsconnector.models.EcsClusterProperties; +import com.azure.resourcemanager.awsconnector.models.ExecuteCommandConfiguration; +import com.azure.resourcemanager.awsconnector.models.ExecuteCommandLogConfiguration; +import com.azure.resourcemanager.awsconnector.models.ServiceConnectDefaults; +import com.azure.resourcemanager.awsconnector.models.TagAutoGenerated25; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for EcsClusters CreateOrReplace. + */ +public final class EcsClustersCreateOrReplaceSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * EcsClusters_CreateOrReplace.json + */ + /** + * Sample code: EcsClusters_CreateOrReplace. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void ecsClustersCreateOrReplace(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.ecsClusters() + .define("Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])") + .withRegion("jvggofkffzhlultqukgoqtb") + .withExistingResourceGroup("rgecsCluster") + .withTags(mapOf("key1755", "fakeTokenPlaceholder")) + .withProperties(new EcsClusterProperties().withAwsProperties(new AwsEcsClusterProperties() + .withArn("mgzeckagdmmepybkhhylkhxzv") + .withCapacityProviders(Arrays.asList("rqrmclul")) + .withClusterName("eavbe") + .withClusterSettings( + Arrays.asList(new ClusterSettings().withName("elsikbbzpkzaghwtqd").withValue("gbnpceuced"))) + .withConfiguration(new ClusterConfiguration().withExecuteCommandConfiguration( + new ExecuteCommandConfiguration().withKmsKeyId("fakeTokenPlaceholder") + .withLogConfiguration(new ExecuteCommandLogConfiguration().withCloudWatchEncryptionEnabled(true) + .withCloudWatchLogGroupName("eiskop") + .withS3BucketName("sfcsij") + .withS3EncryptionEnabled(true) + .withS3KeyPrefix("fakeTokenPlaceholder")) + .withLogging("rspegmyokypfqdocdrothsgivaqf"))) + .withDefaultCapacityProviderStrategy(Arrays.asList(new CapacityProviderStrategyItem().withBase(16) + .withCapacityProvider("kttxptzsaauhguaygucxzzvrbriev") + .withWeight(1))) + .withServiceConnectDefaults(new ServiceConnectDefaults().withNamespace("mwpjrqkazpcetkgyfplp")) + .withTags(Arrays + .asList(new TagAutoGenerated25().withKey("fakeTokenPlaceholder").withValue("dsvfiamfdrnwqretfcu")))) + .withPublicCloudConnectorsResourceId("jbtlcmxmtlcgoxfktpqbi") + .withAwsAccountId("emdtbelvualaeqexsrbhvczjsy") + .withArn("mpaxeywurctxasgtrtckgeoeqmeec") + .withPublicCloudResourceName("nquaerebgaopkptxxbreyhr") + .withAwsSourceSchema("dnbeeswitidsf") + .withAwsRegion("qwurftmiaqdjvlbsxtmdosiauw") + .withAwsTags(mapOf("key3315", "fakeTokenPlaceholder"))) + .create(); + } + + // Use "Map.of" if available + @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; + } +} +``` + +### EcsClusters_Delete + +```java +/** + * Samples for EcsClusters Delete. + */ +public final class EcsClustersDeleteSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/EcsClusters_Delete. + * json + */ + /** + * Sample code: EcsClusters_Delete. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void ecsClustersDelete(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.ecsClusters() + .delete("rgecsCluster", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE); + } +} +``` + +### EcsClusters_GetByResourceGroup + +```java +/** + * Samples for EcsClusters GetByResourceGroup. + */ +public final class EcsClustersGetByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/EcsClusters_Get. + * json + */ + /** + * Sample code: EcsClusters_Get. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void ecsClustersGet(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.ecsClusters() + .getByResourceGroupWithResponse("rgecsCluster", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE); + } +} +``` + +### EcsClusters_List + +```java +/** + * Samples for EcsClusters List. + */ +public final class EcsClustersListSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * EcsClusters_ListBySubscription.json + */ + /** + * Sample code: EcsClusters_ListBySubscription. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + ecsClustersListBySubscription(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.ecsClusters().list(com.azure.core.util.Context.NONE); + } +} +``` + +### EcsClusters_ListByResourceGroup + +```java +/** + * Samples for EcsClusters ListByResourceGroup. + */ +public final class EcsClustersListByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * EcsClusters_ListByResourceGroup.json + */ + /** + * Sample code: EcsClusters_ListByResourceGroup. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + ecsClustersListByResourceGroup(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.ecsClusters().listByResourceGroup("rgecsCluster", com.azure.core.util.Context.NONE); + } +} +``` + +### EcsClusters_Update + +```java +import com.azure.resourcemanager.awsconnector.models.EcsCluster; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for EcsClusters Update. + */ +public final class EcsClustersUpdateSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/EcsClusters_Update. + * json + */ + /** + * Sample code: EcsClusters_Update. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void ecsClustersUpdate(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + EcsCluster resource = manager.ecsClusters() + .getByResourceGroupWithResponse("rgecsCluster", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE) + .getValue(); + resource.update().withTags(mapOf("key657", "fakeTokenPlaceholder")).apply(); + } + + // Use "Map.of" if available + @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; + } +} +``` + +### EcsServices_CreateOrReplace + +```java +import com.azure.resourcemanager.awsconnector.models.AwsEcsServiceProperties; +import com.azure.resourcemanager.awsconnector.models.AwsVpcConfiguration; +import com.azure.resourcemanager.awsconnector.models.AwsVpcConfigurationAssignPublicIp; +import com.azure.resourcemanager.awsconnector.models.CapacityProviderStrategyItem; +import com.azure.resourcemanager.awsconnector.models.DeploymentAlarms; +import com.azure.resourcemanager.awsconnector.models.DeploymentCircuitBreaker; +import com.azure.resourcemanager.awsconnector.models.DeploymentConfiguration; +import com.azure.resourcemanager.awsconnector.models.DeploymentController; +import com.azure.resourcemanager.awsconnector.models.DeploymentControllerType; +import com.azure.resourcemanager.awsconnector.models.EbsTagSpecification; +import com.azure.resourcemanager.awsconnector.models.EbsTagSpecificationPropagateTags; +import com.azure.resourcemanager.awsconnector.models.EcsServiceProperties; +import com.azure.resourcemanager.awsconnector.models.LaunchType; +import com.azure.resourcemanager.awsconnector.models.LoadBalancer; +import com.azure.resourcemanager.awsconnector.models.LogConfiguration; +import com.azure.resourcemanager.awsconnector.models.NetworkConfiguration; +import com.azure.resourcemanager.awsconnector.models.PlacementConstraint; +import com.azure.resourcemanager.awsconnector.models.PlacementConstraintType; +import com.azure.resourcemanager.awsconnector.models.PlacementStrategy; +import com.azure.resourcemanager.awsconnector.models.PlacementStrategyType; +import com.azure.resourcemanager.awsconnector.models.PropagateTags; +import com.azure.resourcemanager.awsconnector.models.SchedulingStrategy; +import com.azure.resourcemanager.awsconnector.models.Secret; +import com.azure.resourcemanager.awsconnector.models.ServiceConnectClientAlias; +import com.azure.resourcemanager.awsconnector.models.ServiceConnectConfiguration; +import com.azure.resourcemanager.awsconnector.models.ServiceConnectService; +import com.azure.resourcemanager.awsconnector.models.ServiceConnectTlsCertificateAuthority; +import com.azure.resourcemanager.awsconnector.models.ServiceConnectTlsConfiguration; +import com.azure.resourcemanager.awsconnector.models.ServiceManagedEbsVolumeConfiguration; +import com.azure.resourcemanager.awsconnector.models.ServiceRegistry; +import com.azure.resourcemanager.awsconnector.models.ServiceVolumeConfiguration; +import com.azure.resourcemanager.awsconnector.models.TagAutoGenerated26; +import com.azure.resourcemanager.awsconnector.models.TimeoutConfiguration; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for EcsServices CreateOrReplace. + */ +public final class EcsServicesCreateOrReplaceSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * EcsServices_CreateOrReplace.json + */ + /** + * Sample code: EcsServices_CreateOrReplace. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void ecsServicesCreateOrReplace(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.ecsServices() + .define("Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])") + .withRegion("xqpjwxermnqxbnitxykbnjhw") + .withExistingResourceGroup("rgecsService") + .withTags(mapOf("key8484", "fakeTokenPlaceholder")) + .withProperties(new EcsServiceProperties() + .withAwsProperties(new AwsEcsServiceProperties() + .withCapacityProviderStrategy(Arrays + .asList(new CapacityProviderStrategyItem().withBase(4) + .withCapacityProvider("wlfpynlwozihqvkgynmdqqmojbs") + .withWeight(28))) + .withCluster("rdbkmvsugiuvbwkuzagsnrx") + .withDeploymentConfiguration(new DeploymentConfiguration() + .withAlarms(new DeploymentAlarms().withAlarmNames(Arrays.asList("cibbvixciizruhpdxhpkifpwsaq")) + .withEnable(true) + .withRollback(true)) + .withDeploymentCircuitBreaker( + new DeploymentCircuitBreaker().withEnable(true).withRollback(true)) + .withMaximumPercent(14) + .withMinimumHealthyPercent(21)) + .withDeploymentController(new DeploymentController().withType(DeploymentControllerType.CODE_DEPLOY)) + .withDesiredCount(21) + .withEnableEcsManagedTags(true) + .withEnableExecuteCommand(true) + .withHealthCheckGracePeriodSeconds(1) + .withLaunchType(LaunchType.EC2) + .withLoadBalancers(Arrays.asList(new LoadBalancer().withContainerName("vjvntpnuzyftbm") + .withContainerPort(17) + .withLoadBalancerName("eryjxwmbfkms") + .withTargetGroupArn("woxbyyccpmqyiy"))) + .withName("vo") + .withNetworkConfiguration(new NetworkConfiguration().withAwsvpcConfiguration( + new AwsVpcConfiguration().withAssignPublicIp(AwsVpcConfigurationAssignPublicIp.DISABLED) + .withSecurityGroups(Arrays.asList("uoauevqyxylmvje")) + .withSubnets(Arrays.asList("gkqxeakxvyw")))) + .withPlacementConstraints(Arrays + .asList(new PlacementConstraint().withExpression("hxzfzxbfmqqiwgbpgn") + .withType(PlacementConstraintType.DISTINCT_INSTANCE))) + .withPlacementStrategies(Arrays.asList(new PlacementStrategy().withField("tyrqdzgjrkwfhzwebvqld") + .withType(PlacementStrategyType.BINPACK))) + .withPlatformVersion("sfsqyvslsustugopfnnzssjli") + .withPropagateTags(PropagateTags.SERVICE) + .withRole("te") + .withSchedulingStrategy(SchedulingStrategy.DAEMON) + .withServiceArn("zuuoanjk") + .withServiceConnectConfiguration(new ServiceConnectConfiguration().withEnabled(true) + .withLogConfiguration(new LogConfiguration() + .withLogDriver("xwshxwanyuqrfzboxwfv") + .withSecretOptions( + Arrays.asList(new Secret().withName("uxsxwquwbafmsmbyyivhsjrjmfpmim") + .withValueFrom("jnygsbiroyjlgrhs")))) + .withNamespace("tlewpbulbuguuuvq") + .withServices(Arrays.asList(new ServiceConnectService() + .withClientAliases(Arrays.asList( + new ServiceConnectClientAlias().withDnsName("hnnavbjclqhbdebomjoqzo").withPort(16))) + .withDiscoveryName("zuhijazofg") + .withIngressPortOverride(26) + .withPortName("q") + .withTimeout( + new TimeoutConfiguration().withIdleTimeoutSeconds(11).withPerRequestTimeoutSeconds(22)) + .withTls(new ServiceConnectTlsConfiguration() + .withIssuerCertificateAuthority( + new ServiceConnectTlsCertificateAuthority().withAwsPcaAuthorityArn("fqrmk")) + .withKmsKey("fakeTokenPlaceholder") + .withRoleArn("stdhwuiylmutipeonkolqjnbqelds"))))) + .withServiceName("lyblywxxfszkgaaornuxliolfbft") + .withServiceRegistries(Arrays.asList(new ServiceRegistry().withContainerName("ppbxlxmpdbri") + .withContainerPort(7) + .withPort(6) + .withRegistryArn("qmfm"))) + .withTags(Arrays.asList(new TagAutoGenerated26().withKey("fakeTokenPlaceholder").withValue("qukd"))) + .withTaskDefinition("fozrumijzejhpjxeqkmthsswwuden") + .withVolumeConfigurations( + Arrays + .asList(new ServiceVolumeConfiguration() + .withManagedEbsVolume(new ServiceManagedEbsVolumeConfiguration().withEncrypted(true) + .withFilesystemType("ugwxqcjnrqonyao") + .withIops(10) + .withKmsKeyId("fakeTokenPlaceholder") + .withRoleArn("gdudzczxymgopjjzqubzphgdi") + .withSizeInGiB(15) + .withSnapshotId("yff") + .withTagSpecifications(Arrays.asList(new EbsTagSpecification() + .withPropagateTags(EbsTagSpecificationPropagateTags.SERVICE) + .withResourceType("tocxgkuiblcccawaenqv") + .withTags(Arrays.asList(new TagAutoGenerated26().withKey("fakeTokenPlaceholder") + .withValue("qukd"))))) + .withThroughput(3) + .withVolumeType("uwvjfmuzpksfpnfsukbunbuqcwxslx")) + .withName("zkqnipaoexthwwot")))) + .withPublicCloudConnectorsResourceId("ghyukpeo") + .withAwsAccountId("egkrtzylfud") + .withArn("advapj") + .withPublicCloudResourceName("jumpzlzalckrkaqg") + .withAwsSourceSchema("woodigpcfntomkursi") + .withAwsRegion("pwmulwhqhosmbthwzammshywxzaxhi") + .withAwsTags(mapOf("key3094", "fakeTokenPlaceholder"))) + .create(); + } + + // Use "Map.of" if available + @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; + } +} +``` + +### EcsServices_Delete + +```java +/** + * Samples for EcsServices Delete. + */ +public final class EcsServicesDeleteSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/EcsServices_Delete. + * json + */ + /** + * Sample code: EcsServices_Delete. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void ecsServicesDelete(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.ecsServices() + .delete("rgecsService", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE); + } +} +``` + +### EcsServices_GetByResourceGroup + +```java +/** + * Samples for EcsServices GetByResourceGroup. + */ +public final class EcsServicesGetByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/EcsServices_Get. + * json + */ + /** + * Sample code: EcsServices_Get. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void ecsServicesGet(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.ecsServices() + .getByResourceGroupWithResponse("rgecsService", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE); + } +} +``` + +### EcsServices_List + +```java +/** + * Samples for EcsServices List. + */ +public final class EcsServicesListSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * EcsServices_ListBySubscription.json + */ + /** + * Sample code: EcsServices_ListBySubscription. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + ecsServicesListBySubscription(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.ecsServices().list(com.azure.core.util.Context.NONE); + } +} +``` + +### EcsServices_ListByResourceGroup + +```java +/** + * Samples for EcsServices ListByResourceGroup. + */ +public final class EcsServicesListByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * EcsServices_ListByResourceGroup.json + */ + /** + * Sample code: EcsServices_ListByResourceGroup. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + ecsServicesListByResourceGroup(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.ecsServices().listByResourceGroup("rgecsService", com.azure.core.util.Context.NONE); + } +} +``` + +### EcsServices_Update + +```java +import com.azure.resourcemanager.awsconnector.models.EcsService; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for EcsServices Update. + */ +public final class EcsServicesUpdateSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/EcsServices_Update. + * json + */ + /** + * Sample code: EcsServices_Update. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void ecsServicesUpdate(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + EcsService resource = manager.ecsServices() + .getByResourceGroupWithResponse("rgecsService", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE) + .getValue(); + resource.update().withTags(mapOf("key8601", "fakeTokenPlaceholder")).apply(); + } + + // Use "Map.of" if available + @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; + } +} +``` + +### EcsTaskDefinitions_CreateOrReplace + +```java +import com.azure.resourcemanager.awsconnector.models.AuthorizationConfig; +import com.azure.resourcemanager.awsconnector.models.AuthorizationConfigIam; +import com.azure.resourcemanager.awsconnector.models.AwsEcsTaskDefinitionProperties; +import com.azure.resourcemanager.awsconnector.models.ContainerDefinition; +import com.azure.resourcemanager.awsconnector.models.ContainerDependency; +import com.azure.resourcemanager.awsconnector.models.Device; +import com.azure.resourcemanager.awsconnector.models.DockerVolumeConfiguration; +import com.azure.resourcemanager.awsconnector.models.EcsTaskDefinitionProperties; +import com.azure.resourcemanager.awsconnector.models.EfsVolumeConfiguration; +import com.azure.resourcemanager.awsconnector.models.EfsVolumeConfigurationTransitEncryption; +import com.azure.resourcemanager.awsconnector.models.EnvironmentFile; +import com.azure.resourcemanager.awsconnector.models.EphemeralStorage; +import com.azure.resourcemanager.awsconnector.models.FSxAuthorizationConfig; +import com.azure.resourcemanager.awsconnector.models.FSxWindowsFileServerVolumeConfiguration; +import com.azure.resourcemanager.awsconnector.models.FirelensConfiguration; +import com.azure.resourcemanager.awsconnector.models.HealthCheck; +import com.azure.resourcemanager.awsconnector.models.HostEntry; +import com.azure.resourcemanager.awsconnector.models.HostVolumeProperties; +import com.azure.resourcemanager.awsconnector.models.InferenceAccelerator; +import com.azure.resourcemanager.awsconnector.models.KernelCapabilities; +import com.azure.resourcemanager.awsconnector.models.KeyValuePair; +import com.azure.resourcemanager.awsconnector.models.LinuxParameters; +import com.azure.resourcemanager.awsconnector.models.LogConfiguration; +import com.azure.resourcemanager.awsconnector.models.MountPoint; +import com.azure.resourcemanager.awsconnector.models.PortMapping; +import com.azure.resourcemanager.awsconnector.models.PortMappingAppProtocol; +import com.azure.resourcemanager.awsconnector.models.ProxyConfiguration; +import com.azure.resourcemanager.awsconnector.models.RepositoryCredentials; +import com.azure.resourcemanager.awsconnector.models.ResourceRequirement; +import com.azure.resourcemanager.awsconnector.models.RuntimePlatform; +import com.azure.resourcemanager.awsconnector.models.Secret; +import com.azure.resourcemanager.awsconnector.models.SystemControl; +import com.azure.resourcemanager.awsconnector.models.TagAutoGenerated27; +import com.azure.resourcemanager.awsconnector.models.TaskDefinitionPlacementConstraint; +import com.azure.resourcemanager.awsconnector.models.Tmpfs; +import com.azure.resourcemanager.awsconnector.models.Ulimit; +import com.azure.resourcemanager.awsconnector.models.Volume; +import com.azure.resourcemanager.awsconnector.models.VolumeFrom; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for EcsTaskDefinitions CreateOrReplace. + */ +public final class EcsTaskDefinitionsCreateOrReplaceSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * EcsTaskDefinitions_CreateOrReplace.json + */ + /** + * Sample code: EcsTaskDefinitions_CreateOrReplace. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + ecsTaskDefinitionsCreateOrReplace(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.ecsTaskDefinitions() + .define("Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])") + .withRegion("hideafehihasfzxdxuqiqubhhzg") + .withExistingResourceGroup("rgecsTaskDefinition") + .withTags(mapOf("key6626", "fakeTokenPlaceholder")) + .withProperties(new EcsTaskDefinitionProperties() + .withAwsProperties(new AwsEcsTaskDefinitionProperties() + .withContainerDefinitions(Arrays.asList(new ContainerDefinition() + .withCommand(Arrays.asList("jowixdtkttvhtvcluhzsqkcszit")) + .withCpu(17) + .withCredentialSpecs(Arrays.asList("ooravv")) + .withDependsOn( + Arrays.asList(new ContainerDependency().withCondition("xpmiwcexgnrimsrqyrdlvyyquiccp") + .withContainerName("wzcyhuwwutzttwwaopqed"))) + .withDisableNetworking(true) + .withDnsSearchDomains(Arrays.asList("ggzzwoziotxloooklwdsveul")) + .withDnsServers(Arrays.asList("ngggprelehukiysguto")) + .withDockerSecurityOptions(Arrays.asList("famtfjusztdnyrdzupruqpxufhxp")) + .withEntryPoint(Arrays.asList("oaiompurpnjswlqkmvgraiaj")) + .withEnvironment(Arrays.asList(new KeyValuePair().withName("edrmixvb").withValue("vdms"))) + .withEnvironmentFiles( + Arrays.asList(new EnvironmentFile().withType("psgsoavpms").withValue("ydkrwlbkbzqdm"))) + .withEssential(true) + .withExtraHosts(Arrays.asList( + new HostEntry().withHostname("unpwutrc").withIpAddress("mcsjkhhqbwqesxwcpnnasbzamixath"))) + .withFirelensConfiguration(new FirelensConfiguration().withType("uuwlwegjjeoorvbgtyzoaeeucp")) + .withHealthCheck(new HealthCheck().withCommand(Arrays.asList("ppgfrdhjiytbzqtwkumhmnpsk")) + .withInterval(1) + .withRetries(11) + .withStartPeriod(21) + .withTimeout(22)) + .withHostname("qjkxoayeojuesqmrhe") + .withImage("lmgx") + .withInteractive(true) + .withLinks(Arrays.asList("awgsbfcuoynoomjr")) + .withLinuxParameters(new LinuxParameters() + .withCapabilities(new KernelCapabilities().withAdd(Arrays.asList("xnobooaglhooafh")) + .withDrop(Arrays.asList("uscfx"))) + .withDevices(Arrays.asList(new Device().withContainerPath("fveecgcpepimcqufoswgvjibavi") + .withHostPath("hvwxdqfcbt") + .withPermissions(Arrays.asList("yqev")))) + .withInitProcessEnabled(true) + .withMaxSwap(24) + .withSharedMemorySize(1) + .withSwappiness(27) + .withTmpfs(Arrays.asList(new Tmpfs().withContainerPath("kxvhyrbeu") + .withMountOptions(Arrays.asList("lylxsszvvczykn")) + .withSize(24)))) + .withLogConfiguration(new LogConfiguration().withLogDriver("zgkgcxxggqdvrfngjbdapez") + .withSecretOptions( + Arrays.asList(new Secret().withName("knumytlyulndziptjvgvcpd").withValueFrom("z")))) + .withMemory(27) + .withMemoryReservation(9) + .withMountPoints(Arrays.asList(new MountPoint().withContainerPath("zjtchyyfjv") + .withReadOnly(true) + .withSourceVolume("mrimyrhpxx"))) + .withName("tfseewfqlgwjqbkjikv") + .withPortMappings(Arrays.asList(new PortMapping().withAppProtocol(PortMappingAppProtocol.GRPC) + .withContainerPort(17) + .withContainerPortRange("hwshvyttesxemvlis") + .withHostPort(13) + .withName("nbxxumpmur") + .withProtocol("llczx"))) + .withPrivileged(true) + .withPseudoTerminal(true) + .withReadonlyRootFilesystem(true) + .withRepositoryCredentials( + new RepositoryCredentials().withCredentialsParameter("fakeTokenPlaceholder")) + .withResourceRequirements(Arrays.asList( + new ResourceRequirement().withType("yhtgxyeazgtpygnamvgtrt").withValue("msamplxjlrq"))) + .withSecrets(Arrays.asList(new Secret().withName("knumytlyulndziptjvgvcpd").withValueFrom("z"))) + .withStartTimeout(10) + .withStopTimeout(24) + .withSystemControls(Arrays.asList( + new SystemControl().withNamespace("hcwgpftfycwhenxygrbczcyqxh").withValue("zzjkfgz"))) + .withUlimits(Arrays.asList( + new Ulimit().withHardLimit(16).withName("zswtamsvbvaxlueyfkklzaz").withSoftLimit(2))) + .withUser("hosruyaojhjbh") + .withVolumesFrom( + Arrays.asList(new VolumeFrom().withReadOnly(true).withSourceContainer("ktlxxpz"))) + .withWorkingDirectory("jpdgsckyvfez"))) + .withCpu("hijyr") + .withEphemeralStorage(new EphemeralStorage().withSizeInGiB(17)) + .withExecutionRoleArn("qqqfakequmccjxadppbeamxuwsitta") + .withFamily("atzptqetfqeczglfyn") + .withInferenceAccelerators( + Arrays.asList(new InferenceAccelerator().withDeviceName("mh").withDeviceType("zfkvyer"))) + .withIpcMode("bynxyc") + .withMemory("vwthlhlwlmwyoxowrumsld") + .withNetworkMode("vrvk") + .withPidMode("pthtbdouatcrybmke") + .withPlacementConstraints( + Arrays.asList(new TaskDefinitionPlacementConstraint().withExpression("skxfvhirrtaegdaujr") + .withType("qnklizvyidxybjmtkgdzdls"))) + .withProxyConfiguration(new ProxyConfiguration().withContainerName("tykmharv") + .withProxyConfigurationProperties( + Arrays.asList(new KeyValuePair().withName("edrmixvb").withValue("vdms"))) + .withType("htnvhyjaffhosgiq")) + .withRequiresCompatibilities(Arrays.asList("lmugnbkpcgvmibqmoyeicudqghukxl")) + .withRuntimePlatform(new RuntimePlatform() + .withCpuArchitecture("zcetkrsfadbflliirh") + .withOperatingSystemFamily("topzpehesx")) + .withTags( + Arrays.asList(new TagAutoGenerated27().withKey("fakeTokenPlaceholder").withValue("glazi"))) + .withTaskDefinitionArn("fpexhci") + .withTaskRoleArn("vvebkfiglrktpmn") + .withVolumes(Arrays.asList(new Volume().withConfiguredAtLaunch(true) + .withDockerVolumeConfiguration(new DockerVolumeConfiguration() + .withAutoprovision(true) + .withDriver("fdypjooligpeypyjkojhhnstigr") + .withScope("wourdwnfkwgitfhzywc")) + .withEfsVolumeConfiguration(new EfsVolumeConfiguration() + .withAuthorizationConfig(new AuthorizationConfig().withAccessPointId("ipf") + .withIam(AuthorizationConfigIam.DISABLED)) + .withFilesystemId("kyluffayszoviyute") + .withRootDirectory("vqogypwzwvlqikbwdhvy") + .withTransitEncryption(EfsVolumeConfigurationTransitEncryption.DISABLED) + .withTransitEncryptionPort(27)) + .withFSxWindowsFileServerVolumeConfiguration(new FSxWindowsFileServerVolumeConfiguration() + .withAuthorizationConfig( + new FSxAuthorizationConfig().withCredentialsParameter("fakeTokenPlaceholder") + .withDomain("igiaaxjfjdstgiwmurfycdsss")) + .withFileSystemId("gxcjekzhsm") + .withRootDirectory("bkbhxkwlfnslgnapevzhyvmfcdaup")) + .withHost(new HostVolumeProperties().withSourcePath("kgadnbxtebvbppaiqqkcmwcipqs")) + .withName("qslxsptvrywosrsnrdvo")))) + .withPublicCloudConnectorsResourceId("zrnabgyobuzozcbzvgu") + .withAwsAccountId("efgvyahxivjf") + .withArn("mkr") + .withPublicCloudResourceName("mmhr") + .withAwsSourceSchema("mvndrea") + .withAwsRegion("vdwjcoqcepgcfqjeedexacghbqhz") + .withAwsTags(mapOf("key1568", "fakeTokenPlaceholder"))) + .create(); + } + + // Use "Map.of" if available + @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; + } +} +``` + +### EcsTaskDefinitions_Delete + +```java +/** + * Samples for EcsTaskDefinitions Delete. + */ +public final class EcsTaskDefinitionsDeleteSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * EcsTaskDefinitions_Delete.json + */ + /** + * Sample code: EcsTaskDefinitions_Delete. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void ecsTaskDefinitionsDelete(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.ecsTaskDefinitions() + .delete("rgecsTaskDefinition", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE); + } +} +``` + +### EcsTaskDefinitions_GetByResourceGroup + +```java +/** + * Samples for EcsTaskDefinitions GetByResourceGroup. + */ +public final class EcsTaskDefinitionsGetByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * EcsTaskDefinitions_Get.json + */ + /** + * Sample code: EcsTaskDefinitions_Get. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void ecsTaskDefinitionsGet(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.ecsTaskDefinitions() + .getByResourceGroupWithResponse("rgecsTaskDefinition", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE); + } +} +``` + +### EcsTaskDefinitions_List + +```java +/** + * Samples for EcsTaskDefinitions List. + */ +public final class EcsTaskDefinitionsListSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * EcsTaskDefinitions_ListBySubscription.json + */ + /** + * Sample code: EcsTaskDefinitions_ListBySubscription. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + ecsTaskDefinitionsListBySubscription(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.ecsTaskDefinitions().list(com.azure.core.util.Context.NONE); + } +} +``` + +### EcsTaskDefinitions_ListByResourceGroup + +```java +/** + * Samples for EcsTaskDefinitions ListByResourceGroup. + */ +public final class EcsTaskDefinitionsListByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * EcsTaskDefinitions_ListByResourceGroup.json + */ + /** + * Sample code: EcsTaskDefinitions_ListByResourceGroup. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + ecsTaskDefinitionsListByResourceGroup(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.ecsTaskDefinitions().listByResourceGroup("rgecsTaskDefinition", com.azure.core.util.Context.NONE); + } +} +``` + +### EcsTaskDefinitions_Update + +```java +import com.azure.resourcemanager.awsconnector.models.EcsTaskDefinition; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for EcsTaskDefinitions Update. + */ +public final class EcsTaskDefinitionsUpdateSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * EcsTaskDefinitions_Update.json + */ + /** + * Sample code: EcsTaskDefinitions_Update. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void ecsTaskDefinitionsUpdate(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + EcsTaskDefinition resource = manager.ecsTaskDefinitions() + .getByResourceGroupWithResponse("rgecsTaskDefinition", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE) + .getValue(); + resource.update().withTags(mapOf("key2531", "fakeTokenPlaceholder")).apply(); + } + + // Use "Map.of" if available + @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; + } +} +``` + +### EfsFileSystems_CreateOrReplace + +```java +import com.azure.resourcemanager.awsconnector.models.AwsEfsFileSystemProperties; +import com.azure.resourcemanager.awsconnector.models.BackupPolicy; +import com.azure.resourcemanager.awsconnector.models.BackupPolicyStatus; +import com.azure.resourcemanager.awsconnector.models.EfsFileSystemProperties; +import com.azure.resourcemanager.awsconnector.models.ElasticFileSystemTag; +import com.azure.resourcemanager.awsconnector.models.FileSystemProtection; +import com.azure.resourcemanager.awsconnector.models.FileSystemProtectionReplicationOverwriteProtection; +import com.azure.resourcemanager.awsconnector.models.LifecyclePolicyAutoGenerated; +import com.azure.resourcemanager.awsconnector.models.ReplicationConfiguration; +import com.azure.resourcemanager.awsconnector.models.ReplicationDestination; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for EfsFileSystems CreateOrReplace. + */ +public final class EfsFileSystemsCreateOrReplaceSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * EfsFileSystems_CreateOrReplace.json + */ + /** + * Sample code: EfsFileSystems_CreateOrReplace. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + efsFileSystemsCreateOrReplace(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.efsFileSystems() + .define("Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])") + .withRegion("phxoujlvsqavkckotussgpnjgexvq") + .withExistingResourceGroup("rgefsFileSystem") + .withTags(mapOf("key8058", "fakeTokenPlaceholder")) + .withProperties(new EfsFileSystemProperties() + .withAwsProperties(new AwsEfsFileSystemProperties().withArn("hptcgar") + .withAvailabilityZoneName("wnn") + .withBackupPolicy(new BackupPolicy().withStatus(BackupPolicyStatus.DISABLED)) + .withBypassPolicyLockoutSafetyCheck(true) + .withEncrypted(true) + .withFileSystemId("kublwmniiobukjozju") + .withFileSystemProtection(new FileSystemProtection().withReplicationOverwriteProtection( + FileSystemProtectionReplicationOverwriteProtection.DISABLED)) + .withFileSystemTags( + Arrays.asList(new ElasticFileSystemTag().withKey("fakeTokenPlaceholder").withValue("gcz"))) + .withKmsKeyId("fakeTokenPlaceholder") + .withLifecyclePolicies(Arrays.asList( + new LifecyclePolicyAutoGenerated().withTransitionToArchive("xsnpjovpiazmhefijlflijjycbugv") + .withTransitionToIA("lslpvdwwgc") + .withTransitionToPrimaryStorageClass("migoeoowupavauvyrljegu"))) + .withPerformanceMode("gtcuhloqhqjvztxoqvnzhwejwqg") + .withProvisionedThroughputInMibps(6) + .withReplicationConfiguration(new ReplicationConfiguration().withDestinations( + Arrays.asList(new ReplicationDestination().withAvailabilityZoneName("ymqufkisnklobowewikkugs") + .withFileSystemId("utzycscycyiunvfnsjwz") + .withKmsKeyId("fakeTokenPlaceholder") + .withRegion("bakyknetpfqoqpltuuxkauokslotb")))) + .withThroughputMode("qiroscdbdjqkhezgxhfjiqd")) + .withPublicCloudConnectorsResourceId("mhovamuukkqswmro") + .withAwsAccountId("jkixa") + .withArn("pewusdrkpcuvxtmjhvzmakefatinq") + .withPublicCloudResourceName("nhvnekfp") + .withAwsSourceSchema("txcarqgbqzzvg") + .withAwsRegion("quxdhbvdpdedfzbfp") + .withAwsTags(mapOf("key3062", "fakeTokenPlaceholder"))) + .create(); + } + + // Use "Map.of" if available + @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; + } +} +``` + +### EfsFileSystems_Delete + +```java +/** + * Samples for EfsFileSystems Delete. + */ +public final class EfsFileSystemsDeleteSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * EfsFileSystems_Delete.json + */ + /** + * Sample code: EfsFileSystems_Delete. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void efsFileSystemsDelete(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.efsFileSystems() + .delete("rgefsFileSystem", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE); + } +} +``` + +### EfsFileSystems_GetByResourceGroup + +```java +/** + * Samples for EfsFileSystems GetByResourceGroup. + */ +public final class EfsFileSystemsGetByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/EfsFileSystems_Get. + * json + */ + /** + * Sample code: EfsFileSystems_Get. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void efsFileSystemsGet(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.efsFileSystems() + .getByResourceGroupWithResponse("rgefsFileSystem", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE); + } +} +``` + +### EfsFileSystems_List + +```java +/** + * Samples for EfsFileSystems List. + */ +public final class EfsFileSystemsListSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * EfsFileSystems_ListBySubscription.json + */ + /** + * Sample code: EfsFileSystems_ListBySubscription. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + efsFileSystemsListBySubscription(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.efsFileSystems().list(com.azure.core.util.Context.NONE); + } +} +``` + +### EfsFileSystems_ListByResourceGroup + +```java +/** + * Samples for EfsFileSystems ListByResourceGroup. + */ +public final class EfsFileSystemsListByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * EfsFileSystems_ListByResourceGroup.json + */ + /** + * Sample code: EfsFileSystems_ListByResourceGroup. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + efsFileSystemsListByResourceGroup(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.efsFileSystems().listByResourceGroup("rgefsFileSystem", com.azure.core.util.Context.NONE); + } +} +``` + +### EfsFileSystems_Update + +```java +import com.azure.resourcemanager.awsconnector.models.EfsFileSystem; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for EfsFileSystems Update. + */ +public final class EfsFileSystemsUpdateSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * EfsFileSystems_Update.json + */ + /** + * Sample code: EfsFileSystems_Update. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void efsFileSystemsUpdate(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + EfsFileSystem resource = manager.efsFileSystems() + .getByResourceGroupWithResponse("rgefsFileSystem", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE) + .getValue(); + resource.update().withTags(mapOf("key5392", "fakeTokenPlaceholder")).apply(); + } + + // Use "Map.of" if available + @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; + } +} +``` + +### EfsMountTargets_CreateOrReplace + +```java +import com.azure.resourcemanager.awsconnector.models.AwsEfsMountTargetProperties; +import com.azure.resourcemanager.awsconnector.models.EfsMountTargetProperties; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for EfsMountTargets CreateOrReplace. + */ +public final class EfsMountTargetsCreateOrReplaceSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * EfsMountTargets_CreateOrReplace.json + */ + /** + * Sample code: EfsMountTargets_CreateOrReplace. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + efsMountTargetsCreateOrReplace(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.efsMountTargets() + .define("Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])") + .withRegion("xaybj") + .withExistingResourceGroup("rgefsMountTarget") + .withTags(mapOf("key3687", "fakeTokenPlaceholder")) + .withProperties(new EfsMountTargetProperties() + .withAwsProperties(new AwsEfsMountTargetProperties().withFileSystemId("yyzhtbwsscfcaxuvdvmswchhxapky") + .withId("micgyhibjdexozpicbfsmpclu") + .withIpAddress("unspxdyqhrhlkstzmdrd") + .withSecurityGroups(Arrays.asList("zxkzjhcwszqzfeogafiaub")) + .withSubnetId("xbeontn")) + .withPublicCloudConnectorsResourceId("rwszhgqustirkxkbk") + .withAwsAccountId("iwvssztfldgfir") + .withArn("dtpqhenvexdxqcqscosxk") + .withPublicCloudResourceName("bezmotdonashggkeobrc") + .withAwsSourceSchema("gpkfqbbpywdedvyabzy") + .withAwsRegion("lyvbqubwsgdvarrauygfhw") + .withAwsTags(mapOf("key5226", "fakeTokenPlaceholder"))) + .create(); + } + + // Use "Map.of" if available + @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; + } +} +``` + +### EfsMountTargets_Delete + +```java +/** + * Samples for EfsMountTargets Delete. + */ +public final class EfsMountTargetsDeleteSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * EfsMountTargets_Delete.json + */ + /** + * Sample code: EfsMountTargets_Delete. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void efsMountTargetsDelete(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.efsMountTargets() + .delete("rgefsMountTarget", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE); + } +} +``` + +### EfsMountTargets_GetByResourceGroup + +```java +/** + * Samples for EfsMountTargets GetByResourceGroup. + */ +public final class EfsMountTargetsGetByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/EfsMountTargets_Get + * .json + */ + /** + * Sample code: EfsMountTargets_Get. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void efsMountTargetsGet(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.efsMountTargets() + .getByResourceGroupWithResponse("rgefsMountTarget", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE); + } +} +``` + +### EfsMountTargets_List + +```java +/** + * Samples for EfsMountTargets List. + */ +public final class EfsMountTargetsListSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * EfsMountTargets_ListBySubscription.json + */ + /** + * Sample code: EfsMountTargets_ListBySubscription. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + efsMountTargetsListBySubscription(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.efsMountTargets().list(com.azure.core.util.Context.NONE); + } +} +``` + +### EfsMountTargets_ListByResourceGroup + +```java +/** + * Samples for EfsMountTargets ListByResourceGroup. + */ +public final class EfsMountTargetsListByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * EfsMountTargets_ListByResourceGroup.json + */ + /** + * Sample code: EfsMountTargets_ListByResourceGroup. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + efsMountTargetsListByResourceGroup(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.efsMountTargets().listByResourceGroup("rgefsMountTarget", com.azure.core.util.Context.NONE); + } +} +``` + +### EfsMountTargets_Update + +```java +import com.azure.resourcemanager.awsconnector.models.EfsMountTarget; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for EfsMountTargets Update. + */ +public final class EfsMountTargetsUpdateSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * EfsMountTargets_Update.json + */ + /** + * Sample code: EfsMountTargets_Update. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void efsMountTargetsUpdate(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + EfsMountTarget resource = manager.efsMountTargets() + .getByResourceGroupWithResponse("rgefsMountTarget", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE) + .getValue(); + resource.update().withTags(mapOf("key7998", "fakeTokenPlaceholder")).apply(); + } + + // Use "Map.of" if available + @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; + } +} +``` + +### EksClusters_CreateOrReplace + +```java +import com.azure.resourcemanager.awsconnector.fluent.models.EksClusterInner; +import com.azure.resourcemanager.awsconnector.models.AccessConfigResponse; +import com.azure.resourcemanager.awsconnector.models.AuthenticationMode; +import com.azure.resourcemanager.awsconnector.models.AuthenticationModeEnumValue; +import com.azure.resourcemanager.awsconnector.models.AwsEksClusterProperties; +import com.azure.resourcemanager.awsconnector.models.Certificate; +import com.azure.resourcemanager.awsconnector.models.ClusterHealth; +import com.azure.resourcemanager.awsconnector.models.ClusterIssue; +import com.azure.resourcemanager.awsconnector.models.ClusterIssueCode; +import com.azure.resourcemanager.awsconnector.models.ClusterIssueCodeEnumValue; +import com.azure.resourcemanager.awsconnector.models.ClusterStatus; +import com.azure.resourcemanager.awsconnector.models.ClusterStatusEnumValue; +import com.azure.resourcemanager.awsconnector.models.ConnectorConfigResponse; +import com.azure.resourcemanager.awsconnector.models.ControlPlanePlacementResponse; +import com.azure.resourcemanager.awsconnector.models.EksClusterProperties; +import com.azure.resourcemanager.awsconnector.models.EncryptionConfig; +import com.azure.resourcemanager.awsconnector.models.Identity; +import com.azure.resourcemanager.awsconnector.models.IpFamily; +import com.azure.resourcemanager.awsconnector.models.IpFamilyEnumValue; +import com.azure.resourcemanager.awsconnector.models.KubernetesNetworkConfigResponse; +import com.azure.resourcemanager.awsconnector.models.LogSetup; +import com.azure.resourcemanager.awsconnector.models.LogType; +import com.azure.resourcemanager.awsconnector.models.LoggingAutoGenerated; +import com.azure.resourcemanager.awsconnector.models.Oidc; +import com.azure.resourcemanager.awsconnector.models.OutpostConfigResponse; +import com.azure.resourcemanager.awsconnector.models.Provider; +import com.azure.resourcemanager.awsconnector.models.VpcConfigResponse; +import java.time.OffsetDateTime; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for EksClusters CreateOrReplace. + */ +public final class EksClustersCreateOrReplaceSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * EksClusters_CreateOrReplace.json + */ + /** + * Sample code: EksClusters_CreateOrReplace. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void eksClustersCreateOrReplace(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.eksClusters() + .createOrReplace("vutdhhavszx", + new EksClusterInner() + .withProperties( + new EksClusterProperties() + .withAwsProperties(new AwsEksClusterProperties() + .withAccessConfig(new AccessConfigResponse() + .withAuthenticationMode( + new AuthenticationModeEnumValue().withValue(AuthenticationMode.API)) + .withBootstrapClusterCreatorAdminPermissions(true)) + .withArn("hcepxlffwylmwulxcktedclqczlia") + .withCertificateAuthority(new Certificate().withData("tlchvarrjfhilsdtsgqshctlli")) + .withClientRequestToken("fakeTokenPlaceholder") + .withConnectorConfig( + new ConnectorConfigResponse().withActivationCode("fakeTokenPlaceholder") + .withActivationExpiry(OffsetDateTime.parse("2024-10-08T03:50:52.459Z")) + .withActivationId("vmvmutvfuygzczgtsutkls") + .withProvider("ngrakrrq") + .withRoleArn("jcu")) + .withCreatedAt(OffsetDateTime.parse("2024-10-08T03:50:52.460Z")) + .withEncryptionConfig(Arrays.asList(new EncryptionConfig() + .withProvider(new Provider().withKeyArn("fakeTokenPlaceholder")) + .withResources(Arrays.asList("luiywwdjzfsrozikidayeump")))) + .withEndpoint("bvdvtunxiggcpmncdeflirifck") + .withHealth(new ClusterHealth().withIssues(Arrays.asList(new ClusterIssue() + .withCode(new ClusterIssueCodeEnumValue().withValue(ClusterIssueCode.ACCESS_DENIED)) + .withMessage("mwtvogjihbqys") + .withResourceIds(Arrays.asList("gnfkewljeibgooftzbraahnxysx"))))) + .withId("zmnyjrmqynglvrhpkkqkpazfyv") + .withIdentity( + new Identity().withOidc(new Oidc().withIssuer("otiqmbvjucermteuonkxgdftf"))) + .withKubernetesNetworkConfig(new KubernetesNetworkConfigResponse() + .withIpFamily(new IpFamilyEnumValue().withValue(IpFamily.IPV4)) + .withServiceIpv4Cidr("llpoqidqkuhvzzwbkiynhrucvgglk") + .withServiceIpv6Cidr("nfdslge")) + .withLogging(new LoggingAutoGenerated().withClusterLogging(Arrays + .asList(new LogSetup().withEnabled(true).withTypes(Arrays.asList(LogType.API))))) + .withName("fjvxhqvmvbshnltkuozc") + .withOutpostConfig( + new OutpostConfigResponse().withControlPlaneInstanceType("dbqfhwaxdzegqxqopkhaevcs") + .withControlPlanePlacement( + new ControlPlanePlacementResponse().withGroupName("qrpyvhb")) + .withOutpostArns(Arrays.asList("lkvzvf"))) + .withPlatformVersion("ezmalzlqyiuhsxxdribckieg") + .withResourcesVpcConfig( + new VpcConfigResponse().withClusterSecurityGroupId("bkhbpbwyholvjxqzgxngfqvfim") + .withEndpointPrivateAccess(true) + .withEndpointPublicAccess(true) + .withPublicAccessCidrs(Arrays.asList("wjznm")) + .withSecurityGroupIds(Arrays.asList("ljodkq")) + .withSubnetIds(Arrays.asList("pmazpgqowrfoi")) + .withVpcId("eoosrmen")) + .withRoleArn("uvceqehkmdtkxgakuckm") + .withStatus(new ClusterStatusEnumValue().withValue(ClusterStatus.ACTIVE)) + .withTags(mapOf("key783", "fakeTokenPlaceholder")) + .withVersion("ngoffoetqqgv")) + .withPublicCloudConnectorsResourceId("uadwidkemgzwde") + .withAwsAccountId("sebsvgbgzb") + .withArn("xhoylvamhuqnvruh") + .withPublicCloudResourceName("kqeiozkswbnhscn") + .withAwsSourceSchema("gkfmtslfbglu") + .withAwsRegion("urhi") + .withAwsTags(mapOf("key7789", "fakeTokenPlaceholder"))), + com.azure.core.util.Context.NONE); + } + + // Use "Map.of" if available + @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; + } +} +``` + +### EksClusters_Delete + +```java +/** + * Samples for EksClusters Delete. + */ +public final class EksClustersDeleteSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/EksClusters_Delete. + * json + */ + /** + * Sample code: EksClusters_Delete. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void eksClustersDelete(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.eksClusters().delete("vutdhhavszx", com.azure.core.util.Context.NONE); + } +} +``` + +### EksClusters_Get + +```java +/** + * Samples for EksClusters Get. + */ +public final class EksClustersGetSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/EksClusters_Get. + * json + */ + /** + * Sample code: EksClusters_Get. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void eksClustersGet(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.eksClusters().getWithResponse("vutdhhavszx", com.azure.core.util.Context.NONE); + } +} +``` + +### EksClusters_List + +```java +/** + * Samples for EksClusters List. + */ +public final class EksClustersListSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/EksClusters_List. + * json + */ + /** + * Sample code: EksClusters_List. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void eksClustersList(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.eksClusters().list("vutdhhavszx", com.azure.core.util.Context.NONE); + } +} +``` + +### EksNodegroups_CreateOrReplace + +```java +import com.azure.resourcemanager.awsconnector.models.AwsEksNodegroupProperties; +import com.azure.resourcemanager.awsconnector.models.EksNodegroupProperties; +import com.azure.resourcemanager.awsconnector.models.LaunchTemplateSpecificationAutoGenerated; +import com.azure.resourcemanager.awsconnector.models.RemoteAccess; +import com.azure.resourcemanager.awsconnector.models.ScalingConfig; +import com.azure.resourcemanager.awsconnector.models.Taint; +import com.azure.resourcemanager.awsconnector.models.UpdateConfig; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for EksNodegroups CreateOrReplace. + */ +public final class EksNodegroupsCreateOrReplaceSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * EksNodegroups_CreateOrReplace.json + */ + /** + * Sample code: EksNodegroups_CreateOrReplace. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + eksNodegroupsCreateOrReplace(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.eksNodegroups() + .define("Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])") + .withRegion("qfzxiflpnxiua") + .withExistingResourceGroup("rgeksNodegroup") + .withTags(mapOf("key3889", "fakeTokenPlaceholder")) + .withProperties(new EksNodegroupProperties() + .withAwsProperties(new AwsEksNodegroupProperties().withAmiType("cupzyobvolczhkenpdfcfcqb") + .withArn("shesuqduavivrddwgrqtaukjv") + .withCapacityType("pkzjnsykbn") + .withClusterName("qcbbidlhrczzbp") + .withDiskSize(14) + .withForceUpdateEnabled(true) + .withId("y") + .withInstanceTypes(Arrays.asList("gfy")) + .withLabels(mapOf("key8269", "fakeTokenPlaceholder")) + .withLaunchTemplate(new LaunchTemplateSpecificationAutoGenerated().withId("si") + .withName("gdqcgfql") + .withVersion("lonea")) + .withNodeRole("rzscoljnrtiueunqg") + .withNodegroupName("wipo") + .withReleaseVersion("wbgbpvjsrkscfxkcbuatuirn") + .withRemoteAccess(new RemoteAccess().withEc2SshKey("fakeTokenPlaceholder") + .withSourceSecurityGroups(Arrays.asList("jv"))) + .withScalingConfig(new ScalingConfig().withDesiredSize(2).withMaxSize(22).withMinSize(18)) + .withSubnets(Arrays.asList("jtzrxn")) + .withTags(mapOf("key1070", "fakeTokenPlaceholder")) + .withTaints(Arrays.asList(new Taint().withEffect("cqyaskimdnuadazzlnzdgwjbg") + .withKey("fakeTokenPlaceholder") + .withValue("hfdagmnrdomthxavrf"))) + .withUpdateConfig(new UpdateConfig().withMaxUnavailable(24).withMaxUnavailablePercentage(18)) + .withVersion("pzblimbasgkqgyknilzxktqx")) + .withPublicCloudConnectorsResourceId("val") + .withAwsAccountId("vfdqtwvbpgxbhqwrbowcnz") + .withArn("ckgekeh") + .withPublicCloudResourceName("aybzphomshbbtslocleyyvgcfu") + .withAwsSourceSchema("cizsekmbzwzgaklajexx") + .withAwsRegion("glvfswwditueizhrpfvhiwm") + .withAwsTags(mapOf("key7151", "fakeTokenPlaceholder"))) + .create(); + } + + // Use "Map.of" if available + @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; + } +} +``` + +### EksNodegroups_Delete + +```java +/** + * Samples for EksNodegroups Delete. + */ +public final class EksNodegroupsDeleteSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * EksNodegroups_Delete.json + */ + /** + * Sample code: EksNodegroups_Delete. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void eksNodegroupsDelete(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.eksNodegroups() + .delete("rgeksNodegroup", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE); + } +} +``` + +### EksNodegroups_GetByResourceGroup + +```java +/** + * Samples for EksNodegroups GetByResourceGroup. + */ +public final class EksNodegroupsGetByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/EksNodegroups_Get. + * json + */ + /** + * Sample code: EksNodegroups_Get. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void eksNodegroupsGet(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.eksNodegroups() + .getByResourceGroupWithResponse("rgeksNodegroup", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE); + } +} +``` + +### EksNodegroups_List + +```java +/** + * Samples for EksNodegroups List. + */ +public final class EksNodegroupsListSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * EksNodegroups_ListBySubscription.json + */ + /** + * Sample code: EksNodegroups_ListBySubscription. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + eksNodegroupsListBySubscription(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.eksNodegroups().list(com.azure.core.util.Context.NONE); + } +} +``` + +### EksNodegroups_ListByResourceGroup + +```java +/** + * Samples for EksNodegroups ListByResourceGroup. + */ +public final class EksNodegroupsListByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * EksNodegroups_ListByResourceGroup.json + */ + /** + * Sample code: EksNodegroups_ListByResourceGroup. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + eksNodegroupsListByResourceGroup(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.eksNodegroups().listByResourceGroup("rgeksNodegroup", com.azure.core.util.Context.NONE); + } +} +``` + +### EksNodegroups_Update + +```java +import com.azure.resourcemanager.awsconnector.models.EksNodegroup; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for EksNodegroups Update. + */ +public final class EksNodegroupsUpdateSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * EksNodegroups_Update.json + */ + /** + * Sample code: EksNodegroups_Update. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void eksNodegroupsUpdate(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + EksNodegroup resource = manager.eksNodegroups() + .getByResourceGroupWithResponse("rgeksNodegroup", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE) + .getValue(); + resource.update().withTags(mapOf("key2267", "fakeTokenPlaceholder")).apply(); + } + + // Use "Map.of" if available + @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; + } +} +``` + +### ElasticBeanstalkApplications_CreateOrReplace + +```java +import com.azure.resourcemanager.awsconnector.models.ApplicationResourceLifecycleConfig; +import com.azure.resourcemanager.awsconnector.models.ApplicationVersionLifecycleConfig; +import com.azure.resourcemanager.awsconnector.models.AwsElasticBeanstalkApplicationProperties; +import com.azure.resourcemanager.awsconnector.models.ElasticBeanstalkApplicationProperties; +import com.azure.resourcemanager.awsconnector.models.MaxAgeRule; +import com.azure.resourcemanager.awsconnector.models.MaxCountRule; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for ElasticBeanstalkApplications CreateOrReplace. + */ +public final class ElasticBeanstalkApplicationsCreateOrReplaceSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * ElasticBeanstalkApplications_CreateOrReplace.json + */ + /** + * Sample code: ElasticBeanstalkApplications_CreateOrReplace. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void elasticBeanstalkApplicationsCreateOrReplace( + com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.elasticBeanstalkApplications() + .define("Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])") + .withRegion("iiedtydxzeyayiwanytnqwn") + .withExistingResourceGroup("rgelasticBeanstalkApplication") + .withTags(mapOf("key8088", "fakeTokenPlaceholder")) + .withProperties(new ElasticBeanstalkApplicationProperties() + .withAwsProperties(new AwsElasticBeanstalkApplicationProperties() + .withApplicationName("lrxgvxoicfhhixebp") + .withDescription("a") + .withResourceLifecycleConfig(new ApplicationResourceLifecycleConfig().withServiceRole("buibidzp") + .withVersionLifecycleConfig(new ApplicationVersionLifecycleConfig() + .withMaxAgeRule( + new MaxAgeRule().withDeleteSourceFromS3(true).withEnabled(true).withMaxAgeInDays(5)) + .withMaxCountRule( + new MaxCountRule().withDeleteSourceFromS3(true).withEnabled(true).withMaxCount(14))))) + .withPublicCloudConnectorsResourceId("echppxwpbpqnasbem") + .withAwsAccountId("xrjnzzimbdnoqnbzpppxas") + .withArn("yautrhxbrmk") + .withPublicCloudResourceName("nkyqyjvezjhltbpdnnxr") + .withAwsSourceSchema("or") + .withAwsRegion("wxoiinzpqpanl") + .withAwsTags(mapOf("key4469", "fakeTokenPlaceholder"))) + .create(); + } + + // Use "Map.of" if available + @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; + } +} +``` + +### ElasticBeanstalkApplications_Delete + +```java +/** + * Samples for ElasticBeanstalkApplications Delete. + */ +public final class ElasticBeanstalkApplicationsDeleteSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * ElasticBeanstalkApplications_Delete.json + */ + /** + * Sample code: ElasticBeanstalkApplications_Delete. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + elasticBeanstalkApplicationsDelete(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.elasticBeanstalkApplications() + .delete("rgelasticBeanstalkApplication", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE); + } +} +``` + +### ElasticBeanstalkApplications_GetByResourceGroup + +```java +/** + * Samples for ElasticBeanstalkApplications GetByResourceGroup. + */ +public final class ElasticBeanstalkApplicationsGetByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * ElasticBeanstalkApplications_Get.json + */ + /** + * Sample code: ElasticBeanstalkApplications_Get. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + elasticBeanstalkApplicationsGet(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.elasticBeanstalkApplications() + .getByResourceGroupWithResponse("rgelasticBeanstalkApplication", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE); + } +} +``` + +### ElasticBeanstalkApplications_List + +```java +/** + * Samples for ElasticBeanstalkApplications List. + */ +public final class ElasticBeanstalkApplicationsListSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * ElasticBeanstalkApplications_ListBySubscription.json + */ + /** + * Sample code: ElasticBeanstalkApplications_ListBySubscription. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void elasticBeanstalkApplicationsListBySubscription( + com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.elasticBeanstalkApplications().list(com.azure.core.util.Context.NONE); + } +} +``` + +### ElasticBeanstalkApplications_ListByResourceGroup + +```java +/** + * Samples for ElasticBeanstalkApplications ListByResourceGroup. + */ +public final class ElasticBeanstalkApplicationsListByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * ElasticBeanstalkApplications_ListByResourceGroup.json + */ + /** + * Sample code: ElasticBeanstalkApplications_ListByResourceGroup. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void elasticBeanstalkApplicationsListByResourceGroup( + com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.elasticBeanstalkApplications() + .listByResourceGroup("rgelasticBeanstalkApplication", com.azure.core.util.Context.NONE); + } +} +``` + +### ElasticBeanstalkApplications_Update + +```java +import com.azure.resourcemanager.awsconnector.models.ElasticBeanstalkApplication; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for ElasticBeanstalkApplications Update. + */ +public final class ElasticBeanstalkApplicationsUpdateSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * ElasticBeanstalkApplications_Update.json + */ + /** + * Sample code: ElasticBeanstalkApplications_Update. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + elasticBeanstalkApplicationsUpdate(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + ElasticBeanstalkApplication resource = manager.elasticBeanstalkApplications() + .getByResourceGroupWithResponse("rgelasticBeanstalkApplication", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE) + .getValue(); + resource.update().withTags(mapOf("key483", "fakeTokenPlaceholder")).apply(); + } + + // Use "Map.of" if available + @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; + } +} +``` + +### ElasticBeanstalkConfigurationTemplates_CreateOrReplace + +```java +import com.azure.resourcemanager.awsconnector.models.AwsElasticBeanstalkConfigurationTemplateProperties; +import com.azure.resourcemanager.awsconnector.models.ConfigurationOptionSetting; +import com.azure.resourcemanager.awsconnector.models.ElasticBeanstalkConfigurationTemplateProperties; +import com.azure.resourcemanager.awsconnector.models.SourceConfiguration; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for ElasticBeanstalkConfigurationTemplates CreateOrReplace. + */ +public final class ElasticBeanstalkConfigurationTemplatesCreateOrReplaceSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * ElasticBeanstalkConfigurationTemplates_CreateOrReplace.json + */ + /** + * Sample code: ElasticBeanstalkConfigurationTemplates_CreateOrReplace. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void elasticBeanstalkConfigurationTemplatesCreateOrReplace( + com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.elasticBeanstalkConfigurationTemplates() + .define("Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])") + .withRegion("zzrrrcfibirqbvvfobbhmdfw") + .withExistingResourceGroup("rgelasticBeanstalkConfigurationTemplate") + .withTags(mapOf("key9826", "fakeTokenPlaceholder")) + .withProperties(new ElasticBeanstalkConfigurationTemplateProperties() + .withAwsProperties( + new AwsElasticBeanstalkConfigurationTemplateProperties().withApplicationName("cectxkagk") + .withDescription("f") + .withEnvironmentId("irk") + .withOptionSettings( + Arrays.asList(new ConfigurationOptionSetting().withNamespace("wqnwnaqljiuphwrslzv") + .withOptionName("jutnzi") + .withResourceName("cxxafxqqeda") + .withValue("auojwoarknbok"))) + .withPlatformArn("shxv") + .withSolutionStackName("ytiftttvorpjlkspzoqxnv") + .withSourceConfiguration(new SourceConfiguration().withApplicationName("gxvqqvuzcufyvzeguns") + .withTemplateName("eajnqnevlyqrtelgeur")) + .withTemplateName("fjixtzihey")) + .withPublicCloudConnectorsResourceId("ezxdkcckcqzvdvfjkioqer") + .withAwsAccountId("eedsjtwxrqaahfnsjwvrxnzerudq") + .withArn("jnsnkdqnxzjvxlitgjtzledfqpwd") + .withPublicCloudResourceName("lgdolpeaabdfynczxxux") + .withAwsSourceSchema("ehzbquzqlgoysykmpkmfu") + .withAwsRegion("timidysdqvjb") + .withAwsTags(mapOf("key1871", "fakeTokenPlaceholder"))) + .create(); + } + + // Use "Map.of" if available + @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; + } +} +``` + +### ElasticBeanstalkConfigurationTemplates_Delete + +```java +/** + * Samples for ElasticBeanstalkConfigurationTemplates Delete. + */ +public final class ElasticBeanstalkConfigurationTemplatesDeleteSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * ElasticBeanstalkConfigurationTemplates_Delete.json + */ + /** + * Sample code: ElasticBeanstalkConfigurationTemplates_Delete. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void elasticBeanstalkConfigurationTemplatesDelete( + com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.elasticBeanstalkConfigurationTemplates() + .delete("rgelasticBeanstalkConfigurationTemplate", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE); + } +} +``` + +### ElasticBeanstalkConfigurationTemplates_GetByResourceGroup + +```java +/** + * Samples for ElasticBeanstalkConfigurationTemplates GetByResourceGroup. + */ +public final class ElasticBeanstalkConfigurationTemplatesGetByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * ElasticBeanstalkConfigurationTemplates_Get.json + */ + /** + * Sample code: ElasticBeanstalkConfigurationTemplates_Get. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + elasticBeanstalkConfigurationTemplatesGet(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.elasticBeanstalkConfigurationTemplates() + .getByResourceGroupWithResponse("rgelasticBeanstalkConfigurationTemplate", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE); + } +} +``` + +### ElasticBeanstalkConfigurationTemplates_List + +```java +/** + * Samples for ElasticBeanstalkConfigurationTemplates List. + */ +public final class ElasticBeanstalkConfigurationTemplatesListSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * ElasticBeanstalkConfigurationTemplates_ListBySubscription.json + */ + /** + * Sample code: ElasticBeanstalkConfigurationTemplates_ListBySubscription. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void elasticBeanstalkConfigurationTemplatesListBySubscription( + com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.elasticBeanstalkConfigurationTemplates().list(com.azure.core.util.Context.NONE); + } +} +``` + +### ElasticBeanstalkConfigurationTemplates_ListByResourceGroup + +```java +/** + * Samples for ElasticBeanstalkConfigurationTemplates ListByResourceGroup. + */ +public final class ElasticBeanstalkConfigurationTemplatesListByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * ElasticBeanstalkConfigurationTemplates_ListByResourceGroup.json + */ + /** + * Sample code: ElasticBeanstalkConfigurationTemplates_ListByResourceGroup. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void elasticBeanstalkConfigurationTemplatesListByResourceGroup( + com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.elasticBeanstalkConfigurationTemplates() + .listByResourceGroup("rgelasticBeanstalkConfigurationTemplate", com.azure.core.util.Context.NONE); + } +} +``` + +### ElasticBeanstalkConfigurationTemplates_Update + +```java +import com.azure.resourcemanager.awsconnector.models.ElasticBeanstalkConfigurationTemplate; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for ElasticBeanstalkConfigurationTemplates Update. + */ +public final class ElasticBeanstalkConfigurationTemplatesUpdateSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * ElasticBeanstalkConfigurationTemplates_Update.json + */ + /** + * Sample code: ElasticBeanstalkConfigurationTemplates_Update. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void elasticBeanstalkConfigurationTemplatesUpdate( + com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + ElasticBeanstalkConfigurationTemplate resource = manager.elasticBeanstalkConfigurationTemplates() + .getByResourceGroupWithResponse("rgelasticBeanstalkConfigurationTemplate", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE) + .getValue(); + resource.update().withTags(mapOf("key5550", "fakeTokenPlaceholder")).apply(); + } + + // Use "Map.of" if available + @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; + } +} +``` + +### ElasticBeanstalkEnvironments_CreateOrReplace + +```java +import com.azure.resourcemanager.awsconnector.models.AwsElasticBeanstalkEnvironmentProperties; +import com.azure.resourcemanager.awsconnector.models.ElasticBeanstalkEnvironmentProperties; +import com.azure.resourcemanager.awsconnector.models.OptionSetting; +import com.azure.resourcemanager.awsconnector.models.TagAutoGenerated28; +import com.azure.resourcemanager.awsconnector.models.TierAutoGenerated; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for ElasticBeanstalkEnvironments CreateOrReplace. + */ +public final class ElasticBeanstalkEnvironmentsCreateOrReplaceSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * ElasticBeanstalkEnvironments_CreateOrReplace.json + */ + /** + * Sample code: ElasticBeanstalkEnvironments_CreateOrReplace. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void elasticBeanstalkEnvironmentsCreateOrReplace( + com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.elasticBeanstalkEnvironments() + .define("Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])") + .withRegion("rcicwrhnehybtulvvctkoqfjwtknlq") + .withExistingResourceGroup("rgelasticBeanstalkEnvironment") + .withTags(mapOf("key2096", "fakeTokenPlaceholder")) + .withProperties(new ElasticBeanstalkEnvironmentProperties() + .withAwsProperties( + new AwsElasticBeanstalkEnvironmentProperties().withApplicationName("zymlvasjtynhgbrykr") + .withCnamePrefix("evct") + .withDescription("uofhhpwsesygrtmyfvurdgtuncytpq") + .withEndpointUrl("thvydn") + .withEnvironmentName("kpogmhzunuicnzwhvcwybzmj") + .withOperationsRole("awulopnqdubztsjuoqwcebjgf") + .withOptionSettings(Arrays.asList(new OptionSetting().withNamespace("fvkbdiiopsoi") + .withOptionName("nmgnqhutdmmirjbbbhdrgba") + .withResourceName("qobeconagmalvwfyfrnx") + .withValue("ucdijfyhnuwhsuqo"))) + .withPlatformArn("ectglmsyrgcycywivrpuxvm") + .withSolutionStackName("gctjcbflipsc") + .withTags(Arrays.asList(new TagAutoGenerated28().withKey("fakeTokenPlaceholder") + .withValue("hhfcrfaprtppmnzutomhlsnyoxalm"))) + .withTemplateName("fnmdsebgrdkpatpiic") + .withTier(new TierAutoGenerated().withName("gxxmgofbfkkvxbrrxxuhnpqortbs") + .withType("qxjdncodnwucwrbgx") + .withVersion("viernervectbejorfdi")) + .withVersionLabel("xkovoldnwteogliidadchizalspob")) + .withPublicCloudConnectorsResourceId("ms") + .withAwsAccountId("ckcntjjdjmmpwsiaecavfwo") + .withArn("zmjeppob") + .withPublicCloudResourceName("dmmydqwtpsruhsd") + .withAwsSourceSchema("jkxtmyhfrvbuoheuscaxhmlm") + .withAwsRegion("mvc") + .withAwsTags(mapOf("key2939", "fakeTokenPlaceholder"))) + .create(); + } + + // Use "Map.of" if available + @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; + } +} +``` + +### ElasticBeanstalkEnvironments_Delete + +```java +/** + * Samples for ElasticBeanstalkEnvironments Delete. + */ +public final class ElasticBeanstalkEnvironmentsDeleteSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * ElasticBeanstalkEnvironments_Delete.json + */ + /** + * Sample code: ElasticBeanstalkEnvironments_Delete. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + elasticBeanstalkEnvironmentsDelete(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.elasticBeanstalkEnvironments() + .delete("rgelasticBeanstalkEnvironment", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE); + } +} +``` + +### ElasticBeanstalkEnvironments_GetByResourceGroup + +```java +/** + * Samples for ElasticBeanstalkEnvironments GetByResourceGroup. + */ +public final class ElasticBeanstalkEnvironmentsGetByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * ElasticBeanstalkEnvironments_Get.json + */ + /** + * Sample code: ElasticBeanstalkEnvironments_Get. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + elasticBeanstalkEnvironmentsGet(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.elasticBeanstalkEnvironments() + .getByResourceGroupWithResponse("rgelasticBeanstalkEnvironment", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE); + } +} +``` + +### ElasticBeanstalkEnvironments_List + +```java +/** + * Samples for ElasticBeanstalkEnvironments List. + */ +public final class ElasticBeanstalkEnvironmentsListSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * ElasticBeanstalkEnvironments_ListBySubscription.json + */ + /** + * Sample code: ElasticBeanstalkEnvironments_ListBySubscription. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void elasticBeanstalkEnvironmentsListBySubscription( + com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.elasticBeanstalkEnvironments().list(com.azure.core.util.Context.NONE); + } +} +``` + +### ElasticBeanstalkEnvironments_ListByResourceGroup + +```java +/** + * Samples for ElasticBeanstalkEnvironments ListByResourceGroup. + */ +public final class ElasticBeanstalkEnvironmentsListByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * ElasticBeanstalkEnvironments_ListByResourceGroup.json + */ + /** + * Sample code: ElasticBeanstalkEnvironments_ListByResourceGroup. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void elasticBeanstalkEnvironmentsListByResourceGroup( + com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.elasticBeanstalkEnvironments() + .listByResourceGroup("rgelasticBeanstalkEnvironment", com.azure.core.util.Context.NONE); + } +} +``` + +### ElasticBeanstalkEnvironments_Update + +```java +import com.azure.resourcemanager.awsconnector.models.ElasticBeanstalkEnvironment; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for ElasticBeanstalkEnvironments Update. + */ +public final class ElasticBeanstalkEnvironmentsUpdateSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * ElasticBeanstalkEnvironments_Update.json + */ + /** + * Sample code: ElasticBeanstalkEnvironments_Update. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + elasticBeanstalkEnvironmentsUpdate(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + ElasticBeanstalkEnvironment resource = manager.elasticBeanstalkEnvironments() + .getByResourceGroupWithResponse("rgelasticBeanstalkEnvironment", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE) + .getValue(); + resource.update().withTags(mapOf("key4897", "fakeTokenPlaceholder")).apply(); + } + + // Use "Map.of" if available + @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; + } +} +``` + +### ElasticLoadBalancingV2Listeners_CreateOrReplace + +```java +import com.azure.resourcemanager.awsconnector.models.ActionAutoGenerated; +import com.azure.resourcemanager.awsconnector.models.AuthenticateCognitoConfig; +import com.azure.resourcemanager.awsconnector.models.AuthenticateOidcConfig; +import com.azure.resourcemanager.awsconnector.models.AwsElasticLoadBalancingV2ListenerProperties; +import com.azure.resourcemanager.awsconnector.models.CertificateAutoGenerated; +import com.azure.resourcemanager.awsconnector.models.ElasticLoadBalancingV2ListenerProperties; +import com.azure.resourcemanager.awsconnector.models.FixedResponseConfig; +import com.azure.resourcemanager.awsconnector.models.ForwardConfig; +import com.azure.resourcemanager.awsconnector.models.MutualAuthentication; +import com.azure.resourcemanager.awsconnector.models.RedirectConfig; +import com.azure.resourcemanager.awsconnector.models.TargetGroupStickinessConfig; +import com.azure.resourcemanager.awsconnector.models.TargetGroupTuple; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for ElasticLoadBalancingV2Listeners CreateOrReplace. + */ +public final class ElasticLoadBalancingV2ListenersCreateOrReplaceSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * ElasticLoadBalancingV2Listeners_CreateOrReplace.json + */ + /** + * Sample code: ElasticLoadBalancingV2Listeners_CreateOrReplace. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void elasticLoadBalancingV2ListenersCreateOrReplace( + com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.elasticLoadBalancingV2Listeners() + .define("Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])") + .withRegion("ynyltffflqszrlkr") + .withExistingResourceGroup("rgelasticLoadBalancingV2Listener") + .withTags(mapOf("key1120", "fakeTokenPlaceholder")) + .withProperties( + new ElasticLoadBalancingV2ListenerProperties() + .withAwsProperties( + new AwsElasticLoadBalancingV2ListenerProperties() + .withAlpnPolicy(Arrays.asList("tznuapvprovrolljpcrptvkhjpl")) + .withCertificates(Arrays + .asList(new CertificateAutoGenerated().withCertificateArn("mfdqcjinbzrxinpbkmpjj"))) + .withDefaultActions( + Arrays + .asList(new ActionAutoGenerated() + .withAuthenticateCognitoConfig(new AuthenticateCognitoConfig() + .withAuthenticationRequestExtraParams( + mapOf("key2864", "fakeTokenPlaceholder")) + .withOnUnauthenticatedRequest("ewqmcevolmfvchwcrm") + .withScope("wtpexcocbnkypesnfwkvyxetj") + .withSessionCookieName("whrieoypkjqsclmgqsiuohq") + .withSessionTimeout("ujvfjimalwitusxfyglnihdh") + .withUserPoolArn("ilqdawi") + .withUserPoolClientId("dmzhlfrfqmoa") + .withUserPoolDomain("jkxwfnqp")) + .withAuthenticateOidcConfig(new AuthenticateOidcConfig() + .withAuthenticationRequestExtraParams( + mapOf("key4917", "fakeTokenPlaceholder")) + .withAuthorizationEndpoint("fakeTokenPlaceholder") + .withClientId("u") + .withClientSecret("fakeTokenPlaceholder") + .withIssuer("jkfpddkgzwiakaobaydiwrztixoef") + .withOnUnauthenticatedRequest("yppxrruimvmjjajglsmxnwlif") + .withScope("loh") + .withSessionCookieName("tmhjastblgrrlqnxqeiccoez") + .withSessionTimeout("rkwdmahwrhgsxev") + .withTokenEndpoint("fakeTokenPlaceholder") + .withUseExistingClientSecret(true) + .withUserInfoEndpoint("kbv")) + .withFixedResponseConfig(new FixedResponseConfig() + .withContentType("xxmkkjulvromwbljdvzinagjmmvizg") + .withMessageBody("u") + .withStatusCode("fakeTokenPlaceholder")) + .withForwardConfig(new ForwardConfig().withTargetGroupStickinessConfig( + new TargetGroupStickinessConfig().withDurationSeconds(25).withEnabled(true)) + .withTargetGroups(Arrays.asList(new TargetGroupTuple() + .withTargetGroupArn("tqmikgktkjddfsirlrzderquhjmlsj") + .withWeight(30)))) + .withOrder(1) + .withRedirectConfig( + new RedirectConfig().withHost("zbwhrrxamywhpcrcwnlftloenhgubz") + .withPath("uifuyulnhelvgkkgzohuzn") + .withPort("objmskuxfeanqv") + .withProtocol("zmhfuhzhytveuveux") + .withQuery("kdbtsctjnajoummjgyigqnnuhnmjk") + .withStatusCode("fakeTokenPlaceholder")) + .withTargetGroupArn("sqtnjzhlqyavpkkxqky") + .withType("yqmcnd"))) + .withListenerArn("nbgkbxgvqooycwaj") + .withLoadBalancerArn("yktlh") + .withMutualAuthentication(new MutualAuthentication().withIgnoreClientCertificateExpiry(true) + .withMode("byoxnzjdbatjjyheiqtxy") + .withTrustStoreArn("mxmhj")) + .withPort(26) + .withProtocol("vac") + .withSslPolicy("oqzcjbvjkvuleoixcyfexaam")) + .withPublicCloudConnectorsResourceId("c") + .withAwsAccountId("ikmnykytjq") + .withArn("cxn") + .withPublicCloudResourceName("ukdphfdtbdvfyuswafgdhapeioe") + .withAwsSourceSchema("fj") + .withAwsRegion("uwrcdgkifqubmtwrzvuvfmeaaght") + .withAwsTags(mapOf("key9655", "fakeTokenPlaceholder"))) + .create(); + } + + // Use "Map.of" if available + @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; + } +} +``` + +### ElasticLoadBalancingV2Listeners_Delete + +```java +/** + * Samples for ElasticLoadBalancingV2Listeners Delete. + */ +public final class ElasticLoadBalancingV2ListenersDeleteSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * ElasticLoadBalancingV2Listeners_Delete.json + */ + /** + * Sample code: ElasticLoadBalancingV2Listeners_Delete. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + elasticLoadBalancingV2ListenersDelete(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.elasticLoadBalancingV2Listeners() + .delete("rgelasticLoadBalancingV2Listener", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE); + } +} +``` + +### ElasticLoadBalancingV2Listeners_GetByResourceGroup + +```java +/** + * Samples for ElasticLoadBalancingV2Listeners GetByResourceGroup. + */ +public final class ElasticLoadBalancingV2ListenersGetByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * ElasticLoadBalancingV2Listeners_Get.json + */ + /** + * Sample code: ElasticLoadBalancingV2Listeners_Get. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + elasticLoadBalancingV2ListenersGet(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.elasticLoadBalancingV2Listeners() + .getByResourceGroupWithResponse("rgelasticLoadBalancingV2Listener", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE); + } +} +``` + +### ElasticLoadBalancingV2Listeners_List + +```java +/** + * Samples for ElasticLoadBalancingV2Listeners List. + */ +public final class ElasticLoadBalancingV2ListenersListSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * ElasticLoadBalancingV2Listeners_ListBySubscription.json + */ + /** + * Sample code: ElasticLoadBalancingV2Listeners_ListBySubscription. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void elasticLoadBalancingV2ListenersListBySubscription( + com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.elasticLoadBalancingV2Listeners().list(com.azure.core.util.Context.NONE); + } +} +``` + +### ElasticLoadBalancingV2Listeners_ListByResourceGroup + +```java +/** + * Samples for ElasticLoadBalancingV2Listeners ListByResourceGroup. + */ +public final class ElasticLoadBalancingV2ListenersListByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * ElasticLoadBalancingV2Listeners_ListByResourceGroup.json + */ + /** + * Sample code: ElasticLoadBalancingV2Listeners_ListByResourceGroup. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void elasticLoadBalancingV2ListenersListByResourceGroup( + com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.elasticLoadBalancingV2Listeners() + .listByResourceGroup("rgelasticLoadBalancingV2Listener", com.azure.core.util.Context.NONE); + } +} +``` + +### ElasticLoadBalancingV2Listeners_Update + +```java +import com.azure.resourcemanager.awsconnector.models.ElasticLoadBalancingV2Listener; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for ElasticLoadBalancingV2Listeners Update. + */ +public final class ElasticLoadBalancingV2ListenersUpdateSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * ElasticLoadBalancingV2Listeners_Update.json + */ + /** + * Sample code: ElasticLoadBalancingV2Listeners_Update. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + elasticLoadBalancingV2ListenersUpdate(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + ElasticLoadBalancingV2Listener resource = manager.elasticLoadBalancingV2Listeners() + .getByResourceGroupWithResponse("rgelasticLoadBalancingV2Listener", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE) + .getValue(); + resource.update().withTags(mapOf("key1036", "fakeTokenPlaceholder")).apply(); + } + + // Use "Map.of" if available + @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; + } +} +``` + +### ElasticLoadBalancingV2LoadBalancers_CreateOrReplace + +```java +import com.azure.resourcemanager.awsconnector.models.AwsElasticLoadBalancingV2LoadBalancerProperties; +import com.azure.resourcemanager.awsconnector.models.ElasticLoadBalancingV2LoadBalancerProperties; +import com.azure.resourcemanager.awsconnector.models.LoadBalancerAttribute; +import com.azure.resourcemanager.awsconnector.models.SubnetMapping; +import com.azure.resourcemanager.awsconnector.models.TagAutoGenerated29; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for ElasticLoadBalancingV2LoadBalancers CreateOrReplace. + */ +public final class ElasticLoadBalancingV2LoadBalancersCreateOrReplaceSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * ElasticLoadBalancingV2LoadBalancers_CreateOrReplace.json + */ + /** + * Sample code: ElasticLoadBalancingV2LoadBalancers_CreateOrReplace. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void elasticLoadBalancingV2LoadBalancersCreateOrReplace( + com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.elasticLoadBalancingV2LoadBalancers() + .define("Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])") + .withRegion("zrpnzixidbktdxtkovhvkklslaw") + .withExistingResourceGroup("rgelasticLoadBalancingV2LoadBalancer") + .withTags(mapOf("key4383", "fakeTokenPlaceholder")) + .withProperties(new ElasticLoadBalancingV2LoadBalancerProperties() + .withAwsProperties(new AwsElasticLoadBalancingV2LoadBalancerProperties() + .withCanonicalHostedZoneId("cpniwdbqzfxrbtnzkthjyohnbtq") + .withDnsName("mafoyhxa") + .withEnforceSecurityGroupInboundRulesOnPrivateLinkTraffic("gsefdpgmvnyizvpidgxdedsusstsmi") + .withIpAddressType("ghelcjykqvyqrwtwydiwleni") + .withLoadBalancerArn("tswueurcdm") + .withLoadBalancerAttributes(Arrays.asList( + new LoadBalancerAttribute().withKey("fakeTokenPlaceholder").withValue("cbsgvwtlyhuclvjpye"))) + .withLoadBalancerFullName("kmxzisdeike") + .withLoadBalancerName("bdspilcwdpibhmnlbygrgaebhvbz") + .withName("erwqxzfowfkksnodfytvnnyefbdsc") + .withScheme("nqjwo") + .withSecurityGroups(Arrays.asList("tavqrnlv")) + .withSubnetMappings(Arrays.asList(new SubnetMapping().withAllocationId("dkrqwrzo") + .withIPv6Address("mglejntagkkkioov") + .withPrivateIPv4Address("furnpiatzewmpnhapicnfy") + .withSubnetId("igo"))) + .withSubnets(Arrays.asList("xqblkoljy")) + .withTags(Arrays.asList( + new TagAutoGenerated29().withKey("fakeTokenPlaceholder").withValue("vxqjrslimcsyqfkfmjiqjcht"))) + .withType("ywggrkrojayvb")) + .withPublicCloudConnectorsResourceId("udwcmojnxevoeyr") + .withAwsAccountId("eopxqyapnygxz") + .withArn("kojgsx") + .withPublicCloudResourceName("oicaxqhgvlybdl") + .withAwsSourceSchema("lnmi") + .withAwsRegion("dplxwlbvhvz") + .withAwsTags(mapOf("key1771", "fakeTokenPlaceholder"))) + .create(); + } + + // Use "Map.of" if available + @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; + } +} +``` + +### ElasticLoadBalancingV2LoadBalancers_Delete + +```java +/** + * Samples for ElasticLoadBalancingV2LoadBalancers Delete. + */ +public final class ElasticLoadBalancingV2LoadBalancersDeleteSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * ElasticLoadBalancingV2LoadBalancers_Delete.json + */ + /** + * Sample code: ElasticLoadBalancingV2LoadBalancers_Delete. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + elasticLoadBalancingV2LoadBalancersDelete(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.elasticLoadBalancingV2LoadBalancers() + .delete("rgelasticLoadBalancingV2LoadBalancer", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE); + } +} +``` + +### ElasticLoadBalancingV2LoadBalancers_GetByResourceGroup + +```java +/** + * Samples for ElasticLoadBalancingV2LoadBalancers GetByResourceGroup. + */ +public final class ElasticLoadBalancingV2LoadBalancersGetByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * ElasticLoadBalancingV2LoadBalancers_Get.json + */ + /** + * Sample code: ElasticLoadBalancingV2LoadBalancers_Get. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + elasticLoadBalancingV2LoadBalancersGet(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.elasticLoadBalancingV2LoadBalancers() + .getByResourceGroupWithResponse("rgelasticLoadBalancingV2LoadBalancer", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE); + } +} +``` + +### ElasticLoadBalancingV2LoadBalancers_List + +```java +/** + * Samples for ElasticLoadBalancingV2LoadBalancers List. + */ +public final class ElasticLoadBalancingV2LoadBalancersListSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * ElasticLoadBalancingV2LoadBalancers_ListBySubscription.json + */ + /** + * Sample code: ElasticLoadBalancingV2LoadBalancers_ListBySubscription. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void elasticLoadBalancingV2LoadBalancersListBySubscription( + com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.elasticLoadBalancingV2LoadBalancers().list(com.azure.core.util.Context.NONE); + } +} +``` + +### ElasticLoadBalancingV2LoadBalancers_ListByResourceGroup + +```java +/** + * Samples for ElasticLoadBalancingV2LoadBalancers ListByResourceGroup. + */ +public final class ElasticLoadBalancingV2LoadBalancersListByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * ElasticLoadBalancingV2LoadBalancers_ListByResourceGroup.json + */ + /** + * Sample code: ElasticLoadBalancingV2LoadBalancers_ListByResourceGroup. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void elasticLoadBalancingV2LoadBalancersListByResourceGroup( + com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.elasticLoadBalancingV2LoadBalancers() + .listByResourceGroup("rgelasticLoadBalancingV2LoadBalancer", com.azure.core.util.Context.NONE); + } +} +``` + +### ElasticLoadBalancingV2LoadBalancers_Update + +```java +import com.azure.resourcemanager.awsconnector.models.ElasticLoadBalancingV2LoadBalancer; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for ElasticLoadBalancingV2LoadBalancers Update. + */ +public final class ElasticLoadBalancingV2LoadBalancersUpdateSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * ElasticLoadBalancingV2LoadBalancers_Update.json + */ + /** + * Sample code: ElasticLoadBalancingV2LoadBalancers_Update. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + elasticLoadBalancingV2LoadBalancersUpdate(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + ElasticLoadBalancingV2LoadBalancer resource = manager.elasticLoadBalancingV2LoadBalancers() + .getByResourceGroupWithResponse("rgelasticLoadBalancingV2LoadBalancer", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE) + .getValue(); + resource.update().withTags(mapOf("key3447", "fakeTokenPlaceholder")).apply(); + } + + // Use "Map.of" if available + @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; + } +} +``` + +### ElasticLoadBalancingV2TargetGroups_CreateOrReplace + +```java +import com.azure.resourcemanager.awsconnector.models.AwsElasticLoadBalancingV2TargetGroupProperties; +import com.azure.resourcemanager.awsconnector.models.ElasticLoadBalancingV2TargetGroupProperties; +import com.azure.resourcemanager.awsconnector.models.Matcher; +import com.azure.resourcemanager.awsconnector.models.TagAutoGenerated30; +import com.azure.resourcemanager.awsconnector.models.TargetDescription; +import com.azure.resourcemanager.awsconnector.models.TargetGroupAttribute; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for ElasticLoadBalancingV2TargetGroups CreateOrReplace. + */ +public final class ElasticLoadBalancingV2TargetGroupsCreateOrReplaceSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * ElasticLoadBalancingV2TargetGroups_CreateOrReplace.json + */ + /** + * Sample code: ElasticLoadBalancingV2TargetGroups_CreateOrReplace. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void elasticLoadBalancingV2TargetGroupsCreateOrReplace( + com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.elasticLoadBalancingV2TargetGroups() + .define("Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])") + .withRegion("uyngtpdaililbq") + .withExistingResourceGroup("rgelasticLoadBalancingV2TargetGroup") + .withTags(mapOf("key6050", "fakeTokenPlaceholder")) + .withProperties(new ElasticLoadBalancingV2TargetGroupProperties() + .withAwsProperties(new AwsElasticLoadBalancingV2TargetGroupProperties().withHealthCheckEnabled(true) + .withHealthCheckIntervalSeconds(16) + .withHealthCheckPath("exmwepsqjmnvppxuwwvineim") + .withHealthCheckPort("cjuqka") + .withHealthCheckProtocol("vkarvxh") + .withHealthCheckTimeoutSeconds(13) + .withHealthyThresholdCount(21) + .withIpAddressType("da") + .withLoadBalancerArns(Arrays.asList("tzafgmrxzoifkxbmzsivajwdwedjw")) + .withMatcher( + new Matcher().withGrpcCode("fakeTokenPlaceholder").withHttpCode("fakeTokenPlaceholder")) + .withName("ruyunzpgs") + .withPort(9) + .withProtocol("cltdmqhlrmrhgdamynxpmnbshrth") + .withProtocolVersion("rpqn") + .withTags(Arrays.asList(new TagAutoGenerated30().withKey("fakeTokenPlaceholder") + .withValue("ivjhgawgxhfvwiyaeruurbpkyx"))) + .withTargetGroupArn("nlyfkpaomu") + .withTargetGroupAttributes( + Arrays.asList(new TargetGroupAttribute().withKey("fakeTokenPlaceholder").withValue("fiffi"))) + .withTargetGroupFullName("xhghbskmnfhkswoncku") + .withTargetGroupName("b") + .withTargetType("eekpandbuoghdxtg") + .withTargets(Arrays.asList( + new TargetDescription().withAvailabilityZone("degmktltnufhywqic").withId("dpaky").withPort(13))) + .withUnhealthyThresholdCount(14) + .withVpcId("leubklsppgcmljbowvzpwvwya")) + .withPublicCloudConnectorsResourceId("agzteeghhpawmqbjrdkgduq") + .withAwsAccountId("vjdgbgqisnvysonxlwjoczc") + .withArn("avccwbbipudnfjximva") + .withPublicCloudResourceName("muortngxuegbngvcemmzovetqah") + .withAwsSourceSchema("cljfeojrexeruhvjklisrmf") + .withAwsRegion("qlfglghejmmlo") + .withAwsTags(mapOf("key5023", "fakeTokenPlaceholder"))) + .create(); + } + + // Use "Map.of" if available + @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; + } +} +``` + +### ElasticLoadBalancingV2TargetGroups_Delete + +```java +/** + * Samples for ElasticLoadBalancingV2TargetGroups Delete. + */ +public final class ElasticLoadBalancingV2TargetGroupsDeleteSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * ElasticLoadBalancingV2TargetGroups_Delete.json + */ + /** + * Sample code: ElasticLoadBalancingV2TargetGroups_Delete. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + elasticLoadBalancingV2TargetGroupsDelete(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.elasticLoadBalancingV2TargetGroups() + .delete("rgelasticLoadBalancingV2TargetGroup", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE); + } +} +``` + +### ElasticLoadBalancingV2TargetGroups_GetByResourceGroup + +```java +/** + * Samples for ElasticLoadBalancingV2TargetGroups GetByResourceGroup. + */ +public final class ElasticLoadBalancingV2TargetGroupsGetByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * ElasticLoadBalancingV2TargetGroups_Get.json + */ + /** + * Sample code: ElasticLoadBalancingV2TargetGroups_Get. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + elasticLoadBalancingV2TargetGroupsGet(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.elasticLoadBalancingV2TargetGroups() + .getByResourceGroupWithResponse("rgelasticLoadBalancingV2TargetGroup", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE); + } +} +``` + +### ElasticLoadBalancingV2TargetGroups_List + +```java +/** + * Samples for ElasticLoadBalancingV2TargetGroups List. + */ +public final class ElasticLoadBalancingV2TargetGroupsListSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * ElasticLoadBalancingV2TargetGroups_ListBySubscription.json + */ + /** + * Sample code: ElasticLoadBalancingV2TargetGroups_ListBySubscription. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void elasticLoadBalancingV2TargetGroupsListBySubscription( + com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.elasticLoadBalancingV2TargetGroups().list(com.azure.core.util.Context.NONE); + } +} +``` + +### ElasticLoadBalancingV2TargetGroups_ListByResourceGroup + +```java +/** + * Samples for ElasticLoadBalancingV2TargetGroups ListByResourceGroup. + */ +public final class ElasticLoadBalancingV2TargetGroupsListByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * ElasticLoadBalancingV2TargetGroups_ListByResourceGroup.json + */ + /** + * Sample code: ElasticLoadBalancingV2TargetGroups_ListByResourceGroup. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void elasticLoadBalancingV2TargetGroupsListByResourceGroup( + com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.elasticLoadBalancingV2TargetGroups() + .listByResourceGroup("rgelasticLoadBalancingV2TargetGroup", com.azure.core.util.Context.NONE); + } +} +``` + +### ElasticLoadBalancingV2TargetGroups_Update + +```java +import com.azure.resourcemanager.awsconnector.models.ElasticLoadBalancingV2TargetGroup; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for ElasticLoadBalancingV2TargetGroups Update. + */ +public final class ElasticLoadBalancingV2TargetGroupsUpdateSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * ElasticLoadBalancingV2TargetGroups_Update.json + */ + /** + * Sample code: ElasticLoadBalancingV2TargetGroups_Update. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + elasticLoadBalancingV2TargetGroupsUpdate(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + ElasticLoadBalancingV2TargetGroup resource = manager.elasticLoadBalancingV2TargetGroups() + .getByResourceGroupWithResponse("rgelasticLoadBalancingV2TargetGroup", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE) + .getValue(); + resource.update().withTags(mapOf("key2200", "fakeTokenPlaceholder")).apply(); + } + + // Use "Map.of" if available + @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; + } +} +``` + +### ElasticLoadBalancingv2TargetHealthDescriptions_CreateOrReplace + +```java +import com.azure.resourcemanager.awsconnector.models.AnomalyDetection; +import com.azure.resourcemanager.awsconnector.models.AnomalyResultEnum; +import com.azure.resourcemanager.awsconnector.models.AnomalyResultEnumValue; +import com.azure.resourcemanager.awsconnector.models.AwsElasticLoadBalancingv2TargetHealthDescriptionProperties; +import com.azure.resourcemanager.awsconnector.models.ElasticLoadBalancingv2TargetHealthDescriptionProperties; +import com.azure.resourcemanager.awsconnector.models.MitigationInEffectEnum; +import com.azure.resourcemanager.awsconnector.models.MitigationInEffectEnumValue; +import com.azure.resourcemanager.awsconnector.models.TargetDescriptionAutoGenerated; +import com.azure.resourcemanager.awsconnector.models.TargetHealth; +import com.azure.resourcemanager.awsconnector.models.TargetHealthReasonEnum; +import com.azure.resourcemanager.awsconnector.models.TargetHealthReasonEnumValue; +import com.azure.resourcemanager.awsconnector.models.TargetHealthStateEnum; +import com.azure.resourcemanager.awsconnector.models.TargetHealthStateEnumValue; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for ElasticLoadBalancingv2TargetHealthDescriptions CreateOrReplace. + */ +public final class ElasticLoadBalancingv2TargetHealthDescriptionsCreateOrReplaceSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * ElasticLoadBalancingv2TargetHealthDescriptions_CreateOrReplace.json + */ + /** + * Sample code: ElasticLoadBalancingv2TargetHealthDescriptions_CreateOrReplace. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void elasticLoadBalancingv2TargetHealthDescriptionsCreateOrReplace( + com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.elasticLoadBalancingv2TargetHealthDescriptions() + .define("Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])") + .withRegion("fjdx") + .withExistingResourceGroup("rgelasticLoadBalancingV2TargetHealthDescription") + .withTags(mapOf("key7243", "fakeTokenPlaceholder")) + .withProperties( + new ElasticLoadBalancingv2TargetHealthDescriptionProperties() + .withAwsProperties(new AwsElasticLoadBalancingv2TargetHealthDescriptionProperties() + .withAnomalyDetection(new AnomalyDetection() + .withMitigationInEffect( + new MitigationInEffectEnumValue().withValue(MitigationInEffectEnum.NO)) + .withResult(new AnomalyResultEnumValue().withValue(AnomalyResultEnum.ANOMALOUS))) + .withHealthCheckPort("wncbdhbdrxjzdwg") + .withTarget(new TargetDescriptionAutoGenerated().withAvailabilityZone("lopqxsnyhbsjjqaj") + .withId("wrhggxodbbktxivhn") + .withPort(29)) + .withTargetHealth(new TargetHealth().withDescription("v") + .withReason(new TargetHealthReasonEnumValue() + .withValue(TargetHealthReasonEnum.ELB_INITIAL_HEALTH_CHECKING)) + .withState(new TargetHealthStateEnumValue().withValue(TargetHealthStateEnum.DRAINING)))) + .withPublicCloudConnectorsResourceId("zwes") + .withAwsAccountId("nqhdoshumaulzimktuhfyzbokepnin") + .withArn("hwxzsqacyslkcfypjntjeecsgic") + .withPublicCloudResourceName("dwtgooliytsuedlhhauisu") + .withAwsSourceSchema("kqowwthevk") + .withAwsRegion("jhbryqdcp") + .withAwsTags(mapOf("key1547", "fakeTokenPlaceholder"))) + .create(); + } + + // Use "Map.of" if available + @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; + } +} +``` + +### ElasticLoadBalancingv2TargetHealthDescriptions_Delete + +```java +/** + * Samples for ElasticLoadBalancingv2TargetHealthDescriptions Delete. + */ +public final class ElasticLoadBalancingv2TargetHealthDescriptionsDeleteSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * ElasticLoadBalancingv2TargetHealthDescriptions_Delete.json + */ + /** + * Sample code: ElasticLoadBalancingv2TargetHealthDescriptions_Delete. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void elasticLoadBalancingv2TargetHealthDescriptionsDelete( + com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.elasticLoadBalancingv2TargetHealthDescriptions() + .delete("rgelasticLoadBalancingV2TargetHealthDescription", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE); + } +} +``` + +### ElasticLoadBalancingv2TargetHealthDescriptions_GetByResourceGroup + +```java +/** + * Samples for ElasticLoadBalancingv2TargetHealthDescriptions GetByResourceGroup. + */ +public final class ElasticLoadBalancingv2TargetHealthDescriptionsGetByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * ElasticLoadBalancingv2TargetHealthDescriptions_Get.json + */ + /** + * Sample code: ElasticLoadBalancingv2TargetHealthDescriptions_Get. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void elasticLoadBalancingv2TargetHealthDescriptionsGet( + com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.elasticLoadBalancingv2TargetHealthDescriptions() + .getByResourceGroupWithResponse("rgelasticLoadBalancingV2TargetHealthDescription", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE); + } +} +``` + +### ElasticLoadBalancingv2TargetHealthDescriptions_List + +```java +/** + * Samples for ElasticLoadBalancingv2TargetHealthDescriptions List. + */ +public final class ElasticLoadBalancingv2TargetHealthDescriptionsListSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * ElasticLoadBalancingv2TargetHealthDescriptions_ListBySubscription.json + */ + /** + * Sample code: ElasticLoadBalancingv2TargetHealthDescriptions_ListBySubscription. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void elasticLoadBalancingv2TargetHealthDescriptionsListBySubscription( + com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.elasticLoadBalancingv2TargetHealthDescriptions().list(com.azure.core.util.Context.NONE); + } +} +``` + +### ElasticLoadBalancingv2TargetHealthDescriptions_ListByResourceGroup + +```java +/** + * Samples for ElasticLoadBalancingv2TargetHealthDescriptions ListByResourceGroup. + */ +public final class ElasticLoadBalancingv2TargetHealthDescriptionsListByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * ElasticLoadBalancingv2TargetHealthDescriptions_ListByResourceGroup.json + */ + /** + * Sample code: ElasticLoadBalancingv2TargetHealthDescriptions_ListByResourceGroup. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void elasticLoadBalancingv2TargetHealthDescriptionsListByResourceGroup( + com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.elasticLoadBalancingv2TargetHealthDescriptions() + .listByResourceGroup("rgelasticLoadBalancingV2TargetHealthDescription", com.azure.core.util.Context.NONE); + } +} +``` + +### ElasticLoadBalancingv2TargetHealthDescriptions_Update + +```java +import com.azure.resourcemanager.awsconnector.models.ElasticLoadBalancingv2TargetHealthDescription; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for ElasticLoadBalancingv2TargetHealthDescriptions Update. + */ +public final class ElasticLoadBalancingv2TargetHealthDescriptionsUpdateSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * ElasticLoadBalancingv2TargetHealthDescriptions_Update.json + */ + /** + * Sample code: ElasticLoadBalancingv2TargetHealthDescriptions_Update. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void elasticLoadBalancingv2TargetHealthDescriptionsUpdate( + com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + ElasticLoadBalancingv2TargetHealthDescription resource + = manager.elasticLoadBalancingv2TargetHealthDescriptions() + .getByResourceGroupWithResponse("rgelasticLoadBalancingV2TargetHealthDescription", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE) + .getValue(); + resource.update().withTags(mapOf("key5261", "fakeTokenPlaceholder")).apply(); + } + + // Use "Map.of" if available + @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; + } +} +``` + +### EmrClusterSummaries_CreateOrReplace + +```java +import com.azure.core.management.serializer.SerializerFactory; +import com.azure.core.util.serializer.SerializerEncoding; +import com.azure.resourcemanager.awsconnector.models.AwsEmrClusterSummaryProperties; +import com.azure.resourcemanager.awsconnector.models.ClusterState; +import com.azure.resourcemanager.awsconnector.models.ClusterStateChangeReason; +import com.azure.resourcemanager.awsconnector.models.ClusterStateChangeReasonCode; +import com.azure.resourcemanager.awsconnector.models.ClusterStateChangeReasonCodeEnumValue; +import com.azure.resourcemanager.awsconnector.models.ClusterStateEnumValue; +import com.azure.resourcemanager.awsconnector.models.ClusterStatusAutoGenerated; +import com.azure.resourcemanager.awsconnector.models.ClusterTimeline; +import com.azure.resourcemanager.awsconnector.models.EmrClusterSummaryProperties; +import com.azure.resourcemanager.awsconnector.models.ErrorDetailAutoGenerated; +import java.io.IOException; +import java.time.OffsetDateTime; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for EmrClusterSummaries CreateOrReplace. + */ +public final class EmrClusterSummariesCreateOrReplaceSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * EmrClusterSummaries_CreateOrReplace.json + */ + /** + * Sample code: EmrClusterSummaries_CreateOrReplace. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void emrClusterSummariesCreateOrReplace( + com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) throws IOException { + manager.emrClusterSummaries() + .define("Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])") + .withRegion("ph") + .withExistingResourceGroup("rgemrClusterSummary") + .withTags(mapOf("key7639", "fakeTokenPlaceholder")) + .withProperties(new EmrClusterSummaryProperties() + .withAwsProperties(new AwsEmrClusterSummaryProperties().withClusterArn("hcwmiaqea") + .withId("hfxlzvrbygylot") + .withName("nefubxfisrkqoalhovdvlsu") + .withNormalizedInstanceHours(27) + .withOutpostArn("sbsolrzktgrkmhwjfdmayp") + .withStatus(new ClusterStatusAutoGenerated() + .withErrorDetails(Arrays.asList(new ErrorDetailAutoGenerated() + .withErrorCode("fakeTokenPlaceholder") + .withErrorData(Arrays.asList(SerializerFactory.createDefaultManagementSerializerAdapter() + .deserialize("{}", Object.class, SerializerEncoding.JSON))) + .withErrorMessage("wqhugncreg"))) + .withState(new ClusterStateEnumValue().withValue(ClusterState.BOOTSTRAPPING)) + .withStateChangeReason( + new ClusterStateChangeReason() + .withCode(new ClusterStateChangeReasonCodeEnumValue() + .withValue(ClusterStateChangeReasonCode.ALL_STEPS_COMPLETED)) + .withMessage("lapcxpryl")) + .withTimeline( + new ClusterTimeline().withCreationDateTime(OffsetDateTime.parse("2024-10-08T03:48:22.614Z")) + .withEndDateTime(OffsetDateTime.parse("2024-10-08T03:48:22.614Z")) + .withReadyDateTime(OffsetDateTime.parse("2024-10-08T03:48:22.614Z"))))) + .withPublicCloudConnectorsResourceId("xkwvywwdhplifzryewofkfixmin") + .withAwsAccountId("bgsinuonrubuushkssenel") + .withArn("ivrscnhxemak") + .withPublicCloudResourceName("dirislun") + .withAwsSourceSchema("ertwddsdgnkc") + .withAwsRegion("zvqejnwqwbwclnslkhgteqamuvfdi") + .withAwsTags(mapOf("key1466", "fakeTokenPlaceholder"))) + .create(); + } + + // Use "Map.of" if available + @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; + } +} +``` + +### EmrClusterSummaries_Delete + +```java +/** + * Samples for EmrClusterSummaries Delete. + */ +public final class EmrClusterSummariesDeleteSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * EmrClusterSummaries_Delete.json + */ + /** + * Sample code: EmrClusterSummaries_Delete. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void emrClusterSummariesDelete(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.emrClusterSummaries() + .delete("rgemrClusterSummary", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE); + } +} +``` + +### EmrClusterSummaries_GetByResourceGroup + +```java +/** + * Samples for EmrClusterSummaries GetByResourceGroup. + */ +public final class EmrClusterSummariesGetByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * EmrClusterSummaries_Get.json + */ + /** + * Sample code: EmrClusterSummaries_Get. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void emrClusterSummariesGet(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.emrClusterSummaries() + .getByResourceGroupWithResponse("rgemrClusterSummary", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE); + } +} +``` + +### EmrClusterSummaries_List + +```java +/** + * Samples for EmrClusterSummaries List. + */ +public final class EmrClusterSummariesListSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * EmrClusterSummaries_ListBySubscription.json + */ + /** + * Sample code: EmrClusterSummaries_ListBySubscription. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + emrClusterSummariesListBySubscription(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.emrClusterSummaries().list(com.azure.core.util.Context.NONE); + } +} +``` + +### EmrClusterSummaries_ListByResourceGroup + +```java +/** + * Samples for EmrClusterSummaries ListByResourceGroup. + */ +public final class EmrClusterSummariesListByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * EmrClusterSummaries_ListByResourceGroup.json + */ + /** + * Sample code: EmrClusterSummaries_ListByResourceGroup. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + emrClusterSummariesListByResourceGroup(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.emrClusterSummaries().listByResourceGroup("rgemrClusterSummary", com.azure.core.util.Context.NONE); + } +} +``` + +### EmrClusterSummaries_Update + +```java +import com.azure.resourcemanager.awsconnector.models.EmrClusterSummary; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for EmrClusterSummaries Update. + */ +public final class EmrClusterSummariesUpdateSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * EmrClusterSummaries_Update.json + */ + /** + * Sample code: EmrClusterSummaries_Update. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void emrClusterSummariesUpdate(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + EmrClusterSummary resource = manager.emrClusterSummaries() + .getByResourceGroupWithResponse("rgemrClusterSummary", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE) + .getValue(); + resource.update().withTags(mapOf("key1151", "fakeTokenPlaceholder")).apply(); + } + + // Use "Map.of" if available + @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; + } +} +``` + +### EmrClusters_CreateOrReplace + +```java +import com.azure.core.management.serializer.SerializerFactory; +import com.azure.core.util.serializer.SerializerEncoding; +import com.azure.resourcemanager.awsconnector.models.Application; +import com.azure.resourcemanager.awsconnector.models.AwsEmrClusterProperties; +import com.azure.resourcemanager.awsconnector.models.ClusterState; +import com.azure.resourcemanager.awsconnector.models.ClusterStateChangeReason; +import com.azure.resourcemanager.awsconnector.models.ClusterStateChangeReasonCode; +import com.azure.resourcemanager.awsconnector.models.ClusterStateChangeReasonCodeEnumValue; +import com.azure.resourcemanager.awsconnector.models.ClusterStateEnumValue; +import com.azure.resourcemanager.awsconnector.models.ClusterStatusAutoGenerated; +import com.azure.resourcemanager.awsconnector.models.ClusterTimeline; +import com.azure.resourcemanager.awsconnector.models.Configuration; +import com.azure.resourcemanager.awsconnector.models.Ec2InstanceAttributes; +import com.azure.resourcemanager.awsconnector.models.EmrClusterProperties; +import com.azure.resourcemanager.awsconnector.models.ErrorDetailAutoGenerated; +import com.azure.resourcemanager.awsconnector.models.InstanceCollectionType; +import com.azure.resourcemanager.awsconnector.models.InstanceCollectionTypeEnumValue; +import com.azure.resourcemanager.awsconnector.models.InstanceRoleType; +import com.azure.resourcemanager.awsconnector.models.InstanceRoleTypeEnumValue; +import com.azure.resourcemanager.awsconnector.models.KerberosAttributes; +import com.azure.resourcemanager.awsconnector.models.PlacementGroupConfig; +import com.azure.resourcemanager.awsconnector.models.PlacementGroupStrategy; +import com.azure.resourcemanager.awsconnector.models.PlacementGroupStrategyEnumValue; +import com.azure.resourcemanager.awsconnector.models.RepoUpgradeOnBoot; +import com.azure.resourcemanager.awsconnector.models.RepoUpgradeOnBootEnumValue; +import com.azure.resourcemanager.awsconnector.models.ScaleDownBehavior; +import com.azure.resourcemanager.awsconnector.models.ScaleDownBehaviorEnumValue; +import com.azure.resourcemanager.awsconnector.models.TagAutoGenerated31; +import java.io.IOException; +import java.time.OffsetDateTime; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for EmrClusters CreateOrReplace. + */ +public final class EmrClustersCreateOrReplaceSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * EmrClusters_CreateOrReplace.json + */ + /** + * Sample code: EmrClusters_CreateOrReplace. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void emrClustersCreateOrReplace(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) + throws IOException { + manager.emrClusters() + .define("Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])") + .withRegion("gxjyaumpubnajcudsqwk") + .withExistingResourceGroup("rgemrCluster") + .withTags(mapOf("key4944", "fakeTokenPlaceholder")) + .withProperties(new EmrClusterProperties() + .withAwsProperties(new AwsEmrClusterProperties() + .withApplications( + Arrays.asList(new Application().withAdditionalInfo(mapOf("key299", "fakeTokenPlaceholder")) + .withArgs(Arrays.asList("sumnqhhlrszgzznshwr")) + .withName("kapcvpwdf") + .withVersion("yccwkryikpyu"))) + .withAutoScalingRole("yuplht") + .withAutoTerminate(true) + .withClusterArn("bwnxmqzwlykxvewsdujzovqs") + .withConfigurations(Arrays.asList(new Configuration().withClassification("ahweyaesthmgtdiv") + .withConfigurations(Arrays.asList()) + .withProperties(mapOf("key6744", "fakeTokenPlaceholder")))) + .withCustomAmiId("iwlvorsznjsaunx") + .withEbsRootVolumeIops(28) + .withEbsRootVolumeSize(25) + .withEbsRootVolumeThroughput(17) + .withEc2InstanceAttributes(new Ec2InstanceAttributes() + .withAdditionalMasterSecurityGroups(Arrays.asList("pzihpojfcoxrdcrosktssgf")) + .withAdditionalSlaveSecurityGroups(Arrays.asList("rdaccocuctxwwzt")) + .withEc2AvailabilityZone("bwaaomtre") + .withEc2KeyName("fakeTokenPlaceholder") + .withEc2SubnetId("ykhysdwgksrwehd") + .withEmrManagedMasterSecurityGroup("rjwslxsygj") + .withEmrManagedSlaveSecurityGroup("hvmxzsjgkhxnimtofmzlpkf") + .withIamInstanceProfile("wxgp") + .withRequestedEc2AvailabilityZones(Arrays.asList("wjzsvq")) + .withRequestedEc2SubnetIds(Arrays.asList("nliztbuhuhkve")) + .withServiceAccessSecurityGroup("supzzejzwqetvnebvhefvwofww")) + .withId("usolewchtbnpfarqidjcaetetbbnww") + .withInstanceCollectionType( + new InstanceCollectionTypeEnumValue().withValue(InstanceCollectionType.INSTANCE_FLEET)) + .withKerberosAttributes(new KerberosAttributes().withAdDomainJoinPassword("fakeTokenPlaceholder") + .withAdDomainJoinUser("ezsezwfzesdunmtiegxbsomqqk") + .withCrossRealmTrustPrincipalPassword("fakeTokenPlaceholder") + .withKdcAdminPassword("fakeTokenPlaceholder") + .withRealm("rraygrjruzeqrozds")) + .withLogEncryptionKmsKeyId("fakeTokenPlaceholder") + .withLogUri("xrdeudkf") + .withMasterPublicDnsName("ztuajioptfwewm") + .withName("bhkvffeitkj") + .withNormalizedInstanceHours(16) + .withOsReleaseLabel("huxdgdaqkknvleyvhgydjbidn") + .withOutpostArn("wnoxdzcyqfbreqnkorlwtfvmzpcu") + .withPlacementGroups(Arrays.asList(new PlacementGroupConfig() + .withInstanceRole(new InstanceRoleTypeEnumValue().withValue(InstanceRoleType.CORE)) + .withPlacementStrategy( + new PlacementGroupStrategyEnumValue().withValue(PlacementGroupStrategy.CLUSTER)))) + .withReleaseLabel("lpmpniehmkeuwyyh") + .withRepoUpgradeOnBoot(new RepoUpgradeOnBootEnumValue().withValue(RepoUpgradeOnBoot.NONE)) + .withRequestedAmiVersion("kwlohrrhuxcgnok") + .withRunningAmiVersion("wd") + .withScaleDownBehavior( + new ScaleDownBehaviorEnumValue().withValue(ScaleDownBehavior.TERMINATE_AT_INSTANCE_HOUR)) + .withSecurityConfiguration("njgb") + .withServiceRole("msbrnoepcyrbaazxsmwbhmqrzubm") + .withStatus(new ClusterStatusAutoGenerated() + .withErrorDetails(Arrays.asList(new ErrorDetailAutoGenerated() + .withErrorCode("fakeTokenPlaceholder") + .withErrorData(Arrays.asList(SerializerFactory.createDefaultManagementSerializerAdapter() + .deserialize("{}", Object.class, SerializerEncoding.JSON))) + .withErrorMessage("hhoucsczmnnflofzyxt"))) + .withState(new ClusterStateEnumValue().withValue(ClusterState.BOOTSTRAPPING)) + .withStateChangeReason(new ClusterStateChangeReason() + .withCode(new ClusterStateChangeReasonCodeEnumValue() + .withValue(ClusterStateChangeReasonCode.ALL_STEPS_COMPLETED)) + .withMessage("sxjkazmayqtbqnbaslxpxun")) + .withTimeline( + new ClusterTimeline().withCreationDateTime(OffsetDateTime.parse("2024-10-08T03:51:42.281Z")) + .withEndDateTime(OffsetDateTime.parse("2024-10-08T03:51:42.281Z")) + .withReadyDateTime(OffsetDateTime.parse("2024-10-08T03:51:42.281Z")))) + .withStepConcurrencyLevel(8) + .withTags(Arrays.asList( + new TagAutoGenerated31().withKey("fakeTokenPlaceholder").withValue("gibogfcbfiielvixdxeb"))) + .withTerminationProtected(true) + .withUnhealthyNodeReplacement(true) + .withVisibleToAllUsers(true)) + .withPublicCloudConnectorsResourceId("gjirecopxmcdpdljkxexxoawwd") + .withAwsAccountId("tsnkbdcacnozmtgvxjflzydxeu") + .withArn("hvhwzh") + .withPublicCloudResourceName("aulznvgpxpjdvghbszbwxycew") + .withAwsSourceSchema("sexomixwzozkllipdmi") + .withAwsRegion("rbbkoztkjhvdu") + .withAwsTags(mapOf("key6409", "fakeTokenPlaceholder"))) + .create(); + } + + // Use "Map.of" if available + @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; + } +} +``` + +### EmrClusters_Delete + +```java +/** + * Samples for EmrClusters Delete. + */ +public final class EmrClustersDeleteSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/EmrClusters_Delete. + * json + */ + /** + * Sample code: EmrClusters_Delete. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void emrClustersDelete(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.emrClusters() + .delete("rgemrCluster", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE); + } +} +``` + +### EmrClusters_GetByResourceGroup + +```java +/** + * Samples for EmrClusters GetByResourceGroup. + */ +public final class EmrClustersGetByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/EmrClusters_Get. + * json + */ + /** + * Sample code: EmrClusters_Get. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void emrClustersGet(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.emrClusters() + .getByResourceGroupWithResponse("rgemrCluster", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE); + } +} +``` + +### EmrClusters_List + +```java +/** + * Samples for EmrClusters List. + */ +public final class EmrClustersListSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * EmrClusters_ListBySubscription.json + */ + /** + * Sample code: EmrClusters_ListBySubscription. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + emrClustersListBySubscription(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.emrClusters().list(com.azure.core.util.Context.NONE); + } +} +``` + +### EmrClusters_ListByResourceGroup + +```java +/** + * Samples for EmrClusters ListByResourceGroup. + */ +public final class EmrClustersListByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * EmrClusters_ListByResourceGroup.json + */ + /** + * Sample code: EmrClusters_ListByResourceGroup. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + emrClustersListByResourceGroup(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.emrClusters().listByResourceGroup("rgemrCluster", com.azure.core.util.Context.NONE); + } +} +``` + +### EmrClusters_Update + +```java +import com.azure.resourcemanager.awsconnector.models.EmrCluster; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for EmrClusters Update. + */ +public final class EmrClustersUpdateSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/EmrClusters_Update. + * json + */ + /** + * Sample code: EmrClusters_Update. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void emrClustersUpdate(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + EmrCluster resource = manager.emrClusters() + .getByResourceGroupWithResponse("rgemrCluster", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE) + .getValue(); + resource.update().withTags(mapOf("key1560", "fakeTokenPlaceholder")).apply(); + } + + // Use "Map.of" if available + @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; + } +} +``` + +### GuardDutyDetectors_CreateOrReplace + +```java +import com.azure.resourcemanager.awsconnector.models.AwsGuardDutyDetectorProperties; +import com.azure.resourcemanager.awsconnector.models.CfnDataSourceConfigurations; +import com.azure.resourcemanager.awsconnector.models.CfnFeatureAdditionalConfiguration; +import com.azure.resourcemanager.awsconnector.models.CfnFeatureConfiguration; +import com.azure.resourcemanager.awsconnector.models.CfnFeatureConfigurationStatus; +import com.azure.resourcemanager.awsconnector.models.CfnKubernetesAuditLogsConfiguration; +import com.azure.resourcemanager.awsconnector.models.CfnKubernetesConfiguration; +import com.azure.resourcemanager.awsconnector.models.CfnMalwareProtectionConfiguration; +import com.azure.resourcemanager.awsconnector.models.CfnScanEc2InstanceWithFindingsConfiguration; +import com.azure.resourcemanager.awsconnector.models.Cfns3LogsConfiguration; +import com.azure.resourcemanager.awsconnector.models.GuardDutyDetectorProperties; +import com.azure.resourcemanager.awsconnector.models.TagItem; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for GuardDutyDetectors CreateOrReplace. + */ +public final class GuardDutyDetectorsCreateOrReplaceSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * GuardDutyDetectors_CreateOrReplace.json + */ + /** + * Sample code: GuardDutyDetectors_CreateOrReplace. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + guardDutyDetectorsCreateOrReplace(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.guardDutyDetectors() + .define("Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])") + .withRegion("sxpvpkjhhmcssseznufvqer") + .withExistingResourceGroup("rgguardDutyDetector") + .withTags(mapOf("key3628", "fakeTokenPlaceholder")) + .withProperties(new GuardDutyDetectorProperties() + .withAwsProperties(new AwsGuardDutyDetectorProperties() + .withDataSources(new CfnDataSourceConfigurations() + .withKubernetes(new CfnKubernetesConfiguration() + .withAuditLogs(new CfnKubernetesAuditLogsConfiguration().withEnable(true))) + .withMalwareProtection(new CfnMalwareProtectionConfiguration().withScanEc2InstanceWithFindings( + new CfnScanEc2InstanceWithFindingsConfiguration().withEbsVolumes(true))) + .withS3Logs(new Cfns3LogsConfiguration().withEnable(true))) + .withEnable(true) + .withFeatures(Arrays.asList(new CfnFeatureConfiguration() + .withAdditionalConfiguration( + Arrays.asList(new CfnFeatureAdditionalConfiguration().withName("lkkifsmqcaujhderxjzcmezjh") + .withStatus("wbjikrlaxrtwpwiexknat"))) + .withName("aoocmexbklfmzmglxopv") + .withStatus(CfnFeatureConfigurationStatus.DISABLED))) + .withFindingPublishingFrequency("ed") + .withId("vakfpotktucclwwqxkczvzrw") + .withTags(Arrays.asList(new TagItem().withKey("fakeTokenPlaceholder").withValue("edlendjmyszkw")))) + .withPublicCloudConnectorsResourceId("infmmygcbbjb") + .withAwsAccountId("lgyellrapjphgbfhni") + .withArn("bdql") + .withPublicCloudResourceName("hkdypyaxoeszbx") + .withAwsSourceSchema("coaitkvmjezenllwmaouhnwfmjjbxa") + .withAwsRegion("wtiiifsewygmgbdcebhl") + .withAwsTags(mapOf("key6130", "fakeTokenPlaceholder"))) + .create(); + } + + // Use "Map.of" if available + @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; + } +} +``` + +### GuardDutyDetectors_Delete + +```java +/** + * Samples for GuardDutyDetectors Delete. + */ +public final class GuardDutyDetectorsDeleteSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * GuardDutyDetectors_Delete.json + */ + /** + * Sample code: GuardDutyDetectors_Delete. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void guardDutyDetectorsDelete(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.guardDutyDetectors() + .delete("rgguardDutyDetector", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE); + } +} +``` + +### GuardDutyDetectors_GetByResourceGroup + +```java +/** + * Samples for GuardDutyDetectors GetByResourceGroup. + */ +public final class GuardDutyDetectorsGetByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * GuardDutyDetectors_Get.json + */ + /** + * Sample code: GuardDutyDetectors_Get. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void guardDutyDetectorsGet(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.guardDutyDetectors() + .getByResourceGroupWithResponse("rgguardDutyDetector", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE); + } +} +``` + +### GuardDutyDetectors_List + +```java +/** + * Samples for GuardDutyDetectors List. + */ +public final class GuardDutyDetectorsListSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * GuardDutyDetectors_ListBySubscription.json + */ + /** + * Sample code: GuardDutyDetectors_ListBySubscription. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + guardDutyDetectorsListBySubscription(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.guardDutyDetectors().list(com.azure.core.util.Context.NONE); + } +} +``` + +### GuardDutyDetectors_ListByResourceGroup + +```java +/** + * Samples for GuardDutyDetectors ListByResourceGroup. + */ +public final class GuardDutyDetectorsListByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * GuardDutyDetectors_ListByResourceGroup.json + */ + /** + * Sample code: GuardDutyDetectors_ListByResourceGroup. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + guardDutyDetectorsListByResourceGroup(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.guardDutyDetectors().listByResourceGroup("rgguardDutyDetector", com.azure.core.util.Context.NONE); + } +} +``` + +### GuardDutyDetectors_Update + +```java +import com.azure.resourcemanager.awsconnector.models.GuardDutyDetector; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for GuardDutyDetectors Update. + */ +public final class GuardDutyDetectorsUpdateSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * GuardDutyDetectors_Update.json + */ + /** + * Sample code: GuardDutyDetectors_Update. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void guardDutyDetectorsUpdate(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + GuardDutyDetector resource = manager.guardDutyDetectors() + .getByResourceGroupWithResponse("rgguardDutyDetector", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE) + .getValue(); + resource.update().withTags(mapOf("key2754", "fakeTokenPlaceholder")).apply(); + } + + // Use "Map.of" if available + @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; + } +} +``` + +### IamAccessKeyLastUseds_CreateOrReplace + +```java +import com.azure.resourcemanager.awsconnector.models.AwsIamAccessKeyLastUsedProperties; +import com.azure.resourcemanager.awsconnector.models.IamAccessKeyLastUsedProperties; +import java.time.OffsetDateTime; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for IamAccessKeyLastUseds CreateOrReplace. + */ +public final class IamAccessKeyLastUsedsCreateOrReplaceSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * IamAccessKeyLastUseds_CreateOrReplace.json + */ + /** + * Sample code: IamAccessKeyLastUseds_CreateOrReplace. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + iamAccessKeyLastUsedsCreateOrReplace(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.iamAccessKeyLastUseds() + .define("Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])") + .withRegion("rdt") + .withExistingResourceGroup("rgiamAccessKeyLastUsed") + .withTags(mapOf("key2981", "fakeTokenPlaceholder")) + .withProperties(new IamAccessKeyLastUsedProperties() + .withAwsProperties(new AwsIamAccessKeyLastUsedProperties() + .withLastUsedDate(OffsetDateTime.parse("2024-10-08T03:48:57.755Z")) + .withRegion("av") + .withServiceName("vhyurov")) + .withPublicCloudConnectorsResourceId("rwbbz") + .withAwsAccountId("lturmpd") + .withArn("xfaoulngosrepqegvmfzqcmenfiwv") + .withPublicCloudResourceName("cttx") + .withAwsSourceSchema("enepzx") + .withAwsRegion("epaxtviqtrqqnghkgfkqhuqee") + .withAwsTags(mapOf("key9162", "fakeTokenPlaceholder"))) + .create(); + } + + // Use "Map.of" if available + @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; + } +} +``` + +### IamAccessKeyLastUseds_Delete + +```java +/** + * Samples for IamAccessKeyLastUseds Delete. + */ +public final class IamAccessKeyLastUsedsDeleteSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * IamAccessKeyLastUseds_Delete.json + */ + /** + * Sample code: IamAccessKeyLastUseds_Delete. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void iamAccessKeyLastUsedsDelete(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.iamAccessKeyLastUseds() + .delete("rgiamAccessKeyLastUsed", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE); + } +} +``` + +### IamAccessKeyLastUseds_GetByResourceGroup + +```java +/** + * Samples for IamAccessKeyLastUseds GetByResourceGroup. + */ +public final class IamAccessKeyLastUsedsGetByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * IamAccessKeyLastUseds_Get.json + */ + /** + * Sample code: IamAccessKeyLastUseds_Get. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void iamAccessKeyLastUsedsGet(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.iamAccessKeyLastUseds() + .getByResourceGroupWithResponse("rgiamAccessKeyLastUsed", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE); + } +} +``` + +### IamAccessKeyLastUseds_List + +```java +/** + * Samples for IamAccessKeyLastUseds List. + */ +public final class IamAccessKeyLastUsedsListSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * IamAccessKeyLastUseds_ListBySubscription.json + */ + /** + * Sample code: IamAccessKeyLastUseds_ListBySubscription. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + iamAccessKeyLastUsedsListBySubscription(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.iamAccessKeyLastUseds().list(com.azure.core.util.Context.NONE); + } +} +``` + +### IamAccessKeyLastUseds_ListByResourceGroup + +```java +/** + * Samples for IamAccessKeyLastUseds ListByResourceGroup. + */ +public final class IamAccessKeyLastUsedsListByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * IamAccessKeyLastUseds_ListByResourceGroup.json + */ + /** + * Sample code: IamAccessKeyLastUseds_ListByResourceGroup. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + iamAccessKeyLastUsedsListByResourceGroup(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.iamAccessKeyLastUseds().listByResourceGroup("rgiamAccessKeyLastUsed", com.azure.core.util.Context.NONE); + } +} +``` + +### IamAccessKeyLastUseds_Update + +```java +import com.azure.resourcemanager.awsconnector.models.IamAccessKeyLastUsed; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for IamAccessKeyLastUseds Update. + */ +public final class IamAccessKeyLastUsedsUpdateSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * IamAccessKeyLastUseds_Update.json + */ + /** + * Sample code: IamAccessKeyLastUseds_Update. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void iamAccessKeyLastUsedsUpdate(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + IamAccessKeyLastUsed resource = manager.iamAccessKeyLastUseds() + .getByResourceGroupWithResponse("rgiamAccessKeyLastUsed", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE) + .getValue(); + resource.update().withTags(mapOf("key2474", "fakeTokenPlaceholder")).apply(); + } + + // Use "Map.of" if available + @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; + } +} +``` + +### IamAccessKeyMetadataInfo_CreateOrReplace + +```java +import com.azure.resourcemanager.awsconnector.models.AwsIamAccessKeyMetadataProperties; +import com.azure.resourcemanager.awsconnector.models.IamAccessKeyMetadataProperties; +import com.azure.resourcemanager.awsconnector.models.StatusType; +import com.azure.resourcemanager.awsconnector.models.StatusTypeEnumValueAutoGenerated; +import java.time.OffsetDateTime; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for IamAccessKeyMetadataInfo CreateOrReplace. + */ +public final class IamAccessKeyMetadataInfoCreateOrReplaceSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * IamAccessKeyMetadataInfo_CreateOrReplace.json + */ + /** + * Sample code: IamAccessKeyMetadataInfo_CreateOrReplace. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + iamAccessKeyMetadataInfoCreateOrReplace(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.iamAccessKeyMetadataInfoes() + .define("Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])") + .withRegion("dqubptgcoomyzlodtswea") + .withExistingResourceGroup("rgiamAccessKeyMetadata") + .withTags(mapOf("key4454", "fakeTokenPlaceholder")) + .withProperties(new IamAccessKeyMetadataProperties() + .withAwsProperties(new AwsIamAccessKeyMetadataProperties().withAccessKeyId("fakeTokenPlaceholder") + .withCreateDate(OffsetDateTime.parse("2024-10-08T03:50:53.022Z")) + .withStatus(new StatusTypeEnumValueAutoGenerated().withValue(StatusType.fromString("Active"))) + .withUsername("obogutgiddo")) + .withPublicCloudConnectorsResourceId("iwcumigpcnebbhmwmaerblylcgdtt") + .withAwsAccountId("i") + .withArn("gcbewovmmukvp") + .withPublicCloudResourceName("ctvpxuzxqwzhmtivtftc") + .withAwsSourceSchema("bcflc") + .withAwsRegion("e") + .withAwsTags(mapOf("key5899", "fakeTokenPlaceholder"))) + .create(); + } + + // Use "Map.of" if available + @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; + } +} +``` + +### IamAccessKeyMetadataInfo_Delete + +```java +/** + * Samples for IamAccessKeyMetadataInfo Delete. + */ +public final class IamAccessKeyMetadataInfoDeleteSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * IamAccessKeyMetadataInfo_Delete.json + */ + /** + * Sample code: IamAccessKeyMetadataInfo_Delete. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + iamAccessKeyMetadataInfoDelete(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.iamAccessKeyMetadataInfoes() + .delete("rgiamAccessKeyMetadata", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE); + } +} +``` + +### IamAccessKeyMetadataInfo_GetByResourceGroup + +```java +/** + * Samples for IamAccessKeyMetadataInfo GetByResourceGroup. + */ +public final class IamAccessKeyMetadataInfoGetByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * IamAccessKeyMetadataInfo_Get.json + */ + /** + * Sample code: IamAccessKeyMetadataInfo_Get. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void iamAccessKeyMetadataInfoGet(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.iamAccessKeyMetadataInfoes() + .getByResourceGroupWithResponse("rgiamAccessKeyMetadata", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE); + } +} +``` + +### IamAccessKeyMetadataInfo_List + +```java +/** + * Samples for IamAccessKeyMetadataInfo List. + */ +public final class IamAccessKeyMetadataInfoListSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * IamAccessKeyMetadataInfo_ListBySubscription.json + */ + /** + * Sample code: IamAccessKeyMetadataInfo_ListBySubscription. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + iamAccessKeyMetadataInfoListBySubscription(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.iamAccessKeyMetadataInfoes().list(com.azure.core.util.Context.NONE); + } +} +``` + +### IamAccessKeyMetadataInfo_ListByResourceGroup + +```java +/** + * Samples for IamAccessKeyMetadataInfo ListByResourceGroup. + */ +public final class IamAccessKeyMetadataInfoListByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * IamAccessKeyMetadataInfo_ListByResourceGroup.json + */ + /** + * Sample code: IamAccessKeyMetadataInfo_ListByResourceGroup. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void iamAccessKeyMetadataInfoListByResourceGroup( + com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.iamAccessKeyMetadataInfoes() + .listByResourceGroup("rgiamAccessKeyMetadata", com.azure.core.util.Context.NONE); + } +} +``` + +### IamAccessKeyMetadataInfo_Update + +```java +import com.azure.resourcemanager.awsconnector.models.IamAccessKeyMetadata; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for IamAccessKeyMetadataInfo Update. + */ +public final class IamAccessKeyMetadataInfoUpdateSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * IamAccessKeyMetadataInfo_Update.json + */ + /** + * Sample code: IamAccessKeyMetadataInfo_Update. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + iamAccessKeyMetadataInfoUpdate(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + IamAccessKeyMetadata resource = manager.iamAccessKeyMetadataInfoes() + .getByResourceGroupWithResponse("rgiamAccessKeyMetadata", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE) + .getValue(); + resource.update().withTags(mapOf("key2001", "fakeTokenPlaceholder")).apply(); + } + + // Use "Map.of" if available + @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; + } +} +``` + +### IamGroups_CreateOrReplace + +```java +import com.azure.resourcemanager.awsconnector.models.AwsIamGroupProperties; +import com.azure.resourcemanager.awsconnector.models.IamGroupProperties; +import com.azure.resourcemanager.awsconnector.models.Policy; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for IamGroups CreateOrReplace. + */ +public final class IamGroupsCreateOrReplaceSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * IamGroups_CreateOrReplace.json + */ + /** + * Sample code: IamGroups_CreateOrReplace. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void iamGroupsCreateOrReplace(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.iamGroups() + .define("Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])") + .withRegion("badqu") + .withExistingResourceGroup("rgiamGroup") + .withTags(mapOf("key3844", "fakeTokenPlaceholder")) + .withProperties( + new IamGroupProperties() + .withAwsProperties(new AwsIamGroupProperties().withArn("qaymkzqiwzdilzpmfapwpudc") + .withGroupName("zcmfl") + .withManagedPolicyArns(Arrays.asList("uqek")) + .withPath("liuneeastp") + .withPolicies(Arrays.asList( + new Policy().withPolicyDocument(mapOf()).withPolicyName("cokejufrpuszoopjjywwxopal")))) + .withPublicCloudConnectorsResourceId("fjfneaczmcscofgdjnxw") + .withAwsAccountId("obfwwcnhlgytlanolsfrdn") + .withArn("yvnnjydmrptjbytuyca") + .withPublicCloudResourceName("hj") + .withAwsSourceSchema("kprcuajdxtfckwviyxpajstzdjeb") + .withAwsRegion("uqzi") + .withAwsTags(mapOf("key9078", "fakeTokenPlaceholder"))) + .create(); + } + + // Use "Map.of" if available + @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; + } +} +``` + +### IamGroups_Delete + +```java +/** + * Samples for IamGroups Delete. + */ +public final class IamGroupsDeleteSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/IamGroups_Delete. + * json + */ + /** + * Sample code: IamGroups_Delete. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void iamGroupsDelete(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.iamGroups() + .delete("rgiamGroup", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE); + } +} +``` + +### IamGroups_GetByResourceGroup + +```java +/** + * Samples for IamGroups GetByResourceGroup. + */ +public final class IamGroupsGetByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/IamGroups_Get.json + */ + /** + * Sample code: IamGroups_Get. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void iamGroupsGet(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.iamGroups() + .getByResourceGroupWithResponse("rgiamGroup", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE); + } +} +``` + +### IamGroups_List + +```java +/** + * Samples for IamGroups List. + */ +public final class IamGroupsListSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * IamGroups_ListBySubscription.json + */ + /** + * Sample code: IamGroups_ListBySubscription. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void iamGroupsListBySubscription(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.iamGroups().list(com.azure.core.util.Context.NONE); + } +} +``` + +### IamGroups_ListByResourceGroup + +```java +/** + * Samples for IamGroups ListByResourceGroup. + */ +public final class IamGroupsListByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * IamGroups_ListByResourceGroup.json + */ + /** + * Sample code: IamGroups_ListByResourceGroup. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + iamGroupsListByResourceGroup(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.iamGroups().listByResourceGroup("rgiamGroup", com.azure.core.util.Context.NONE); + } +} +``` + +### IamGroups_Update + +```java +import com.azure.resourcemanager.awsconnector.models.IamGroup; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for IamGroups Update. + */ +public final class IamGroupsUpdateSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/IamGroups_Update. + * json + */ + /** + * Sample code: IamGroups_Update. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void iamGroupsUpdate(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + IamGroup resource = manager.iamGroups() + .getByResourceGroupWithResponse("rgiamGroup", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE) + .getValue(); + resource.update().withTags(mapOf("key6243", "fakeTokenPlaceholder")).apply(); + } + + // Use "Map.of" if available + @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; + } +} +``` + +### IamInstanceProfiles_CreateOrUpdate + +```java +import com.azure.resourcemanager.awsconnector.models.AwsIamInstanceProfileProperties; +import com.azure.resourcemanager.awsconnector.models.IamInstanceProfileProperties; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for IamInstanceProfiles CreateOrUpdate. + */ +public final class IamInstanceProfilesCreateOrUpdateSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * IamInstanceProfiles_CreateOrUpdate.json + */ + /** + * Sample code: IamInstanceProfiles_CreateOrUpdate. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + iamInstanceProfilesCreateOrUpdate(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.iamInstanceProfiles() + .define("Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])") + .withRegion("unn") + .withExistingResourceGroup("rgiamInstanceProfile") + .withTags(mapOf("key6049", "fakeTokenPlaceholder")) + .withProperties(new IamInstanceProfileProperties() + .withAwsProperties(new AwsIamInstanceProfileProperties().withArn("xfilqplkerenzrkykjnnoj") + .withInstanceProfileName("ccstflwsxmpatrvscwxoukagqblzt") + .withPath("edfwubhvvye") + .withRoles(Arrays.asList("nrvsijvbwdodraufvsxmbcbnm"))) + .withPublicCloudConnectorsResourceId("opbcrtwimfuirxph") + .withAwsAccountId("zhhymhiivdmwoidycnqdtzarowwjm") + .withArn("djpzkfxattxqgrwdgl") + .withPublicCloudResourceName("qbxqhspttfymekhofojyqu") + .withAwsSourceSchema("vitibwpeaozvgjcibxrqodn") + .withAwsRegion("dwnkitebqhhqjrkjjlhtjryvhsuz") + .withAwsTags(mapOf("key3394", "fakeTokenPlaceholder"))) + .create(); + } + + // Use "Map.of" if available + @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; + } +} +``` + +### IamInstanceProfiles_Delete + +```java +/** + * Samples for IamInstanceProfiles Delete. + */ +public final class IamInstanceProfilesDeleteSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * IamInstanceProfiles_Delete.json + */ + /** + * Sample code: IamInstanceProfiles_Delete. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void iamInstanceProfilesDelete(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.iamInstanceProfiles() + .delete("rgiamInstanceProfile", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE); + } +} +``` + +### IamInstanceProfiles_GetByResourceGroup + +```java +/** + * Samples for IamInstanceProfiles GetByResourceGroup. + */ +public final class IamInstanceProfilesGetByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * IamInstanceProfiles_Get.json + */ + /** + * Sample code: IamInstanceProfiles_Get. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void iamInstanceProfilesGet(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.iamInstanceProfiles() + .getByResourceGroupWithResponse("rgiamInstanceProfile", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE); + } +} +``` + +### IamInstanceProfiles_List + +```java +/** + * Samples for IamInstanceProfiles List. + */ +public final class IamInstanceProfilesListSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * IamInstanceProfiles_ListBySubscription.json + */ + /** + * Sample code: IamInstanceProfiles_ListBySubscription. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + iamInstanceProfilesListBySubscription(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.iamInstanceProfiles().list(com.azure.core.util.Context.NONE); + } +} +``` + +### IamInstanceProfiles_ListByResourceGroup + +```java +/** + * Samples for IamInstanceProfiles ListByResourceGroup. + */ +public final class IamInstanceProfilesListByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * IamInstanceProfiles_ListByResourceGroup.json + */ + /** + * Sample code: IamInstanceProfiles_ListByResourceGroup. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + iamInstanceProfilesListByResourceGroup(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.iamInstanceProfiles().listByResourceGroup("rgiamInstanceProfile", com.azure.core.util.Context.NONE); + } +} +``` + +### IamInstanceProfiles_Update + +```java +import com.azure.resourcemanager.awsconnector.models.IamInstanceProfileAutoGenerated; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for IamInstanceProfiles Update. + */ +public final class IamInstanceProfilesUpdateSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * IamInstanceProfiles_Update.json + */ + /** + * Sample code: IamInstanceProfiles_Update. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void iamInstanceProfilesUpdate(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + IamInstanceProfileAutoGenerated resource = manager.iamInstanceProfiles() + .getByResourceGroupWithResponse("rgiamInstanceProfile", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE) + .getValue(); + resource.update().withTags(mapOf("key5002", "fakeTokenPlaceholder")).apply(); + } + + // Use "Map.of" if available + @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; + } +} +``` + +### IamMfaDevices_CreateOrReplace + +```java +import com.azure.resourcemanager.awsconnector.models.AwsIamMfaDeviceProperties; +import com.azure.resourcemanager.awsconnector.models.IamMfaDeviceProperties; +import java.time.OffsetDateTime; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for IamMfaDevices CreateOrReplace. + */ +public final class IamMfaDevicesCreateOrReplaceSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * IamMfaDevices_CreateOrReplace.json + */ + /** + * Sample code: IamMfaDevices_CreateOrReplace. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + iamMfaDevicesCreateOrReplace(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.iamMfaDevices() + .define("Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])") + .withRegion("ytpxpjmmspx") + .withExistingResourceGroup("rgiamMFADevice") + .withTags(mapOf("key9234", "fakeTokenPlaceholder")) + .withProperties(new IamMfaDeviceProperties() + .withAwsProperties( + new AwsIamMfaDeviceProperties().withEnableDate(OffsetDateTime.parse("2024-10-08T03:50:03.364Z")) + .withSerialNumber("ifphqcwiounuuootrnmxmm") + .withUsername("jyjbnteckbccmmhbxjdk")) + .withPublicCloudConnectorsResourceId("jmcknwcktcj") + .withAwsAccountId("tdapkqeuuvrrasue") + .withArn("hbymjvsaxodse") + .withPublicCloudResourceName("vexrvwqtzdijlzwecmljscwepj") + .withAwsSourceSchema("ibnflrkwkaswdrsmaqtegtnky") + .withAwsRegion("uwyckzldxxj") + .withAwsTags(mapOf("key581", "fakeTokenPlaceholder"))) + .create(); + } + + // Use "Map.of" if available + @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; + } +} +``` + +### IamMfaDevices_Delete + +```java +/** + * Samples for IamMfaDevices Delete. + */ +public final class IamMfaDevicesDeleteSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * IamMfaDevices_Delete.json + */ + /** + * Sample code: IamMfaDevices_Delete. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void iamMfaDevicesDelete(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.iamMfaDevices() + .delete("rgiamMFADevice", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE); + } +} +``` + +### IamMfaDevices_GetByResourceGroup + +```java +/** + * Samples for IamMfaDevices GetByResourceGroup. + */ +public final class IamMfaDevicesGetByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/IamMfaDevices_Get. + * json + */ + /** + * Sample code: IamMfaDevices_Get. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void iamMfaDevicesGet(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.iamMfaDevices() + .getByResourceGroupWithResponse("rgiamMFADevice", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE); + } +} +``` + +### IamMfaDevices_List + +```java +/** + * Samples for IamMfaDevices List. + */ +public final class IamMfaDevicesListSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * IamMfaDevices_ListBySubscription.json + */ + /** + * Sample code: IamMfaDevices_ListBySubscription. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + iamMfaDevicesListBySubscription(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.iamMfaDevices().list(com.azure.core.util.Context.NONE); + } +} +``` + +### IamMfaDevices_ListByResourceGroup + +```java +/** + * Samples for IamMfaDevices ListByResourceGroup. + */ +public final class IamMfaDevicesListByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * IamMfaDevices_ListByResourceGroup.json + */ + /** + * Sample code: IamMfaDevices_ListByResourceGroup. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + iamMfaDevicesListByResourceGroup(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.iamMfaDevices().listByResourceGroup("rgiamMFADevice", com.azure.core.util.Context.NONE); + } +} +``` + +### IamMfaDevices_Update + +```java +import com.azure.resourcemanager.awsconnector.models.IamMfaDevice; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for IamMfaDevices Update. + */ +public final class IamMfaDevicesUpdateSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * IamMfaDevices_Update.json + */ + /** + * Sample code: IamMfaDevices_Update. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void iamMfaDevicesUpdate(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + IamMfaDevice resource = manager.iamMfaDevices() + .getByResourceGroupWithResponse("rgiamMFADevice", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE) + .getValue(); + resource.update().withTags(mapOf("key2615", "fakeTokenPlaceholder")).apply(); + } + + // Use "Map.of" if available + @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; + } +} +``` + +### IamPasswordPolicies_CreateOrReplace + +```java +import com.azure.resourcemanager.awsconnector.models.AwsIamPasswordPolicyProperties; +import com.azure.resourcemanager.awsconnector.models.IamPasswordPolicyProperties; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for IamPasswordPolicies CreateOrReplace. + */ +public final class IamPasswordPoliciesCreateOrReplaceSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * IamPasswordPolicies_CreateOrReplace.json + */ + /** + * Sample code: IamPasswordPolicies_CreateOrReplace. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + iamPasswordPoliciesCreateOrReplace(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.iamPasswordPolicies() + .define("Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])") + .withRegion("zirvnbwoooczkma") + .withExistingResourceGroup("rgiamPasswordPolicy") + .withTags(mapOf("key5111", "fakeTokenPlaceholder")) + .withProperties(new IamPasswordPolicyProperties() + .withAwsProperties(new AwsIamPasswordPolicyProperties().withAllowUsersToChangePassword(true) + .withExpirePasswords(true) + .withHardExpiry(true) + .withMaxPasswordAge(1) + .withMinimumPasswordLength(17) + .withPasswordReusePrevention(30) + .withRequireLowercaseCharacters(true) + .withRequireNumbers(true) + .withRequireSymbols(true) + .withRequireUppercaseCharacters(true)) + .withPublicCloudConnectorsResourceId("zsyi") + .withAwsAccountId("iiripspbzbqibqazbnef") + .withArn("irgrdslydjpuoyb") + .withPublicCloudResourceName("zuwprynvflpuik") + .withAwsSourceSchema("gud") + .withAwsRegion("mqpdjjdzdwew") + .withAwsTags(mapOf("key6748", "fakeTokenPlaceholder"))) + .create(); + } + + // Use "Map.of" if available + @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; + } +} +``` + +### IamPasswordPolicies_Delete + +```java +/** + * Samples for IamPasswordPolicies Delete. + */ +public final class IamPasswordPoliciesDeleteSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * IamPasswordPolicies_Delete.json + */ + /** + * Sample code: IamPasswordPolicies_Delete. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void iamPasswordPoliciesDelete(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.iamPasswordPolicies() + .delete("rgiamPasswordPolicy", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE); + } +} +``` + +### IamPasswordPolicies_GetByResourceGroup + +```java +/** + * Samples for IamPasswordPolicies GetByResourceGroup. + */ +public final class IamPasswordPoliciesGetByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * IamPasswordPolicies_Get.json + */ + /** + * Sample code: IamPasswordPolicies_Get. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void iamPasswordPoliciesGet(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.iamPasswordPolicies() + .getByResourceGroupWithResponse("rgiamPasswordPolicy", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE); + } +} +``` + +### IamPasswordPolicies_List + +```java +/** + * Samples for IamPasswordPolicies List. + */ +public final class IamPasswordPoliciesListSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * IamPasswordPolicies_ListBySubscription.json + */ + /** + * Sample code: IamPasswordPolicies_ListBySubscription. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + iamPasswordPoliciesListBySubscription(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.iamPasswordPolicies().list(com.azure.core.util.Context.NONE); + } +} +``` + +### IamPasswordPolicies_ListByResourceGroup + +```java +/** + * Samples for IamPasswordPolicies ListByResourceGroup. + */ +public final class IamPasswordPoliciesListByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * IamPasswordPolicies_ListByResourceGroup.json + */ + /** + * Sample code: IamPasswordPolicies_ListByResourceGroup. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + iamPasswordPoliciesListByResourceGroup(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.iamPasswordPolicies().listByResourceGroup("rgiamPasswordPolicy", com.azure.core.util.Context.NONE); + } +} +``` + +### IamPasswordPolicies_Update + +```java +import com.azure.resourcemanager.awsconnector.models.IamPasswordPolicy; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for IamPasswordPolicies Update. + */ +public final class IamPasswordPoliciesUpdateSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * IamPasswordPolicies_Update.json + */ + /** + * Sample code: IamPasswordPolicies_Update. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void iamPasswordPoliciesUpdate(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + IamPasswordPolicy resource = manager.iamPasswordPolicies() + .getByResourceGroupWithResponse("rgiamPasswordPolicy", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE) + .getValue(); + resource.update().withTags(mapOf("key6732", "fakeTokenPlaceholder")).apply(); + } + + // Use "Map.of" if available + @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; + } +} +``` + +### IamPolicyVersions_CreateOrReplace + +```java +import com.azure.resourcemanager.awsconnector.models.AwsIamPolicyVersionProperties; +import com.azure.resourcemanager.awsconnector.models.IamPolicyVersionProperties; +import java.time.OffsetDateTime; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for IamPolicyVersions CreateOrReplace. + */ +public final class IamPolicyVersionsCreateOrReplaceSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * IamPolicyVersions_CreateOrReplace.json + */ + /** + * Sample code: IamPolicyVersions_CreateOrReplace. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + iamPolicyVersionsCreateOrReplace(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.iamPolicyVersions() + .define("Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])") + .withRegion("wtyx") + .withExistingResourceGroup("rgiamPolicyVersion") + .withTags(mapOf("key6034", "fakeTokenPlaceholder")) + .withProperties(new IamPolicyVersionProperties() + .withAwsProperties( + new AwsIamPolicyVersionProperties().withCreateDate(OffsetDateTime.parse("2024-10-08T03:54:21.310Z")) + .withDocument("bpzfzhilykgroobhu") + .withIsDefaultVersion(true) + .withVersionId("mjxbhpksrctdbegeyhrsyveoyre")) + .withPublicCloudConnectorsResourceId("hqotja") + .withAwsAccountId("xiv") + .withArn("mszogqxtswvseqggugfxstkwivx") + .withPublicCloudResourceName("mphznssuferlzunnbjbl") + .withAwsSourceSchema("ljldtynekavvptoqhcvqdklc") + .withAwsRegion("bhdamksbkmvjl") + .withAwsTags(mapOf("key2871", "fakeTokenPlaceholder"))) + .create(); + } + + // Use "Map.of" if available + @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; + } +} +``` + +### IamPolicyVersions_Delete + +```java +/** + * Samples for IamPolicyVersions Delete. + */ +public final class IamPolicyVersionsDeleteSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * IamPolicyVersions_Delete.json + */ + /** + * Sample code: IamPolicyVersions_Delete. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void iamPolicyVersionsDelete(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.iamPolicyVersions() + .delete("rgiamPolicyVersion", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE); + } +} +``` + +### IamPolicyVersions_GetByResourceGroup + +```java +/** + * Samples for IamPolicyVersions GetByResourceGroup. + */ +public final class IamPolicyVersionsGetByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * IamPolicyVersions_Get.json + */ + /** + * Sample code: IamPolicyVersions_Get. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void iamPolicyVersionsGet(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.iamPolicyVersions() + .getByResourceGroupWithResponse("rgiamPolicyVersion", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE); + } +} +``` + +### IamPolicyVersions_List + +```java +/** + * Samples for IamPolicyVersions List. + */ +public final class IamPolicyVersionsListSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * IamPolicyVersions_ListBySubscription.json + */ + /** + * Sample code: IamPolicyVersions_ListBySubscription. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + iamPolicyVersionsListBySubscription(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.iamPolicyVersions().list(com.azure.core.util.Context.NONE); + } +} +``` + +### IamPolicyVersions_ListByResourceGroup + +```java +/** + * Samples for IamPolicyVersions ListByResourceGroup. + */ +public final class IamPolicyVersionsListByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * IamPolicyVersions_ListByResourceGroup.json + */ + /** + * Sample code: IamPolicyVersions_ListByResourceGroup. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + iamPolicyVersionsListByResourceGroup(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.iamPolicyVersions().listByResourceGroup("rgiamPolicyVersion", com.azure.core.util.Context.NONE); + } +} +``` + +### IamPolicyVersions_Update + +```java +import com.azure.resourcemanager.awsconnector.models.IamPolicyVersion; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for IamPolicyVersions Update. + */ +public final class IamPolicyVersionsUpdateSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * IamPolicyVersions_Update.json + */ + /** + * Sample code: IamPolicyVersions_Update. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void iamPolicyVersionsUpdate(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + IamPolicyVersion resource = manager.iamPolicyVersions() + .getByResourceGroupWithResponse("rgiamPolicyVersion", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE) + .getValue(); + resource.update().withTags(mapOf("key2276", "fakeTokenPlaceholder")).apply(); + } + + // Use "Map.of" if available + @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; + } +} +``` + +### IamRoles_CreateOrReplace + +```java +import com.azure.resourcemanager.awsconnector.models.AwsIamRoleProperties; +import com.azure.resourcemanager.awsconnector.models.IamRoleProperties; +import com.azure.resourcemanager.awsconnector.models.PolicyAutoGenerated; +import com.azure.resourcemanager.awsconnector.models.TagAutoGenerated32; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for IamRoles CreateOrReplace. + */ +public final class IamRolesCreateOrReplaceSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * IamRoles_CreateOrReplace.json + */ + /** + * Sample code: IamRoles_CreateOrReplace. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void iamRolesCreateOrReplace(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.iamRoles() + .define("Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])") + .withRegion("vkzeblhpdgxwu") + .withExistingResourceGroup("rgiamRole") + .withTags(mapOf("key3308", "fakeTokenPlaceholder")) + .withProperties(new IamRoleProperties() + .withAwsProperties(new AwsIamRoleProperties().withArn("iqe") + .withAssumeRolePolicyDocument(mapOf()) + .withDescription("spayefp") + .withManagedPolicyArns(Arrays.asList("twfombcdqlzq")) + .withMaxSessionDuration(16) + .withPath("qxfdn") + .withPermissionsBoundary("wofktscexalvotvxaxsq") + .withPolicies(Arrays.asList(new PolicyAutoGenerated().withPolicyDocument(mapOf()) + .withPolicyName("bpqsmdhzxaruuvctyddrcedbf"))) + .withRoleId("l") + .withRoleName("vpczljoyhnvybvtyagxaxaraogzdyx") + .withTags(Arrays.asList( + new TagAutoGenerated32().withKey("fakeTokenPlaceholder").withValue("jcpberdkjmspmjbzyewyhyd")))) + .withPublicCloudConnectorsResourceId("cchmzoxsgytenwavdwoarear") + .withAwsAccountId("qlndbvxbvf") + .withArn("cllfeatxzjqiqr") + .withPublicCloudResourceName("qn") + .withAwsSourceSchema("onnjxuscupomucwhpltcnogwhxllm") + .withAwsRegion("yqtvmgzsvcgtehapncinnqvsql") + .withAwsTags(mapOf("key9018", "fakeTokenPlaceholder"))) + .create(); + } + + // Use "Map.of" if available + @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; + } +} +``` + +### IamRoles_Delete + +```java +/** + * Samples for IamRoles Delete. + */ +public final class IamRolesDeleteSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/IamRoles_Delete. + * json + */ + /** + * Sample code: IamRoles_Delete. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void iamRolesDelete(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.iamRoles() + .delete("rgiamRole", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE); + } +} +``` + +### IamRoles_GetByResourceGroup + +```java +/** + * Samples for IamRoles GetByResourceGroup. + */ +public final class IamRolesGetByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/IamRoles_Get.json + */ + /** + * Sample code: IamRoles_Get. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void iamRolesGet(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.iamRoles() + .getByResourceGroupWithResponse("rgiamRole", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE); + } +} +``` + +### IamRoles_List + +```java +/** + * Samples for IamRoles List. + */ +public final class IamRolesListSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * IamRoles_ListBySubscription.json + */ + /** + * Sample code: IamRoles_ListBySubscription. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void iamRolesListBySubscription(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.iamRoles().list(com.azure.core.util.Context.NONE); + } +} +``` + +### IamRoles_ListByResourceGroup + +```java +/** + * Samples for IamRoles ListByResourceGroup. + */ +public final class IamRolesListByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * IamRoles_ListByResourceGroup.json + */ + /** + * Sample code: IamRoles_ListByResourceGroup. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void iamRolesListByResourceGroup(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.iamRoles().listByResourceGroup("rgiamRole", com.azure.core.util.Context.NONE); + } +} +``` + +### IamRoles_Update + +```java +import com.azure.resourcemanager.awsconnector.models.IamRole; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for IamRoles Update. + */ +public final class IamRolesUpdateSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/IamRoles_Update. + * json + */ + /** + * Sample code: IamRoles_Update. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void iamRolesUpdate(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + IamRole resource = manager.iamRoles() + .getByResourceGroupWithResponse("rgiamRole", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE) + .getValue(); + resource.update().withTags(mapOf("key3141", "fakeTokenPlaceholder")).apply(); + } + + // Use "Map.of" if available + @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; + } +} +``` + +### IamServerCertificates_CreateOrReplace + +```java +import com.azure.resourcemanager.awsconnector.models.AwsIamServerCertificateProperties; +import com.azure.resourcemanager.awsconnector.models.IamServerCertificateProperties; +import com.azure.resourcemanager.awsconnector.models.TagAutoGenerated33; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for IamServerCertificates CreateOrReplace. + */ +public final class IamServerCertificatesCreateOrReplaceSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * IamServerCertificates_CreateOrReplace.json + */ + /** + * Sample code: IamServerCertificates_CreateOrReplace. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + iamServerCertificatesCreateOrReplace(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.iamServerCertificates() + .define("Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])") + .withRegion("ddjdvyseqfbfufjoxr") + .withExistingResourceGroup("rgiamServerCertificate") + .withTags(mapOf("key6646", "fakeTokenPlaceholder")) + .withProperties(new IamServerCertificateProperties() + .withAwsProperties(new AwsIamServerCertificateProperties().withArn("ahekoegi") + .withCertificateBody("fagqepujrwsvkhdrvofvmkderig") + .withCertificateChain("ozzjlnmjijy") + .withPath("qvvxpzaoshpkkvncguxmv") + .withPrivateKey("fakeTokenPlaceholder") + .withServerCertificateName("yblyjjfteysombtxapaqjkrqo") + .withTags(Arrays.asList( + new TagAutoGenerated33().withKey("fakeTokenPlaceholder").withValue("jstuopgodfwmzigjbb")))) + .withPublicCloudConnectorsResourceId("iqnmafujozzlwfnhamvbhfjcuob") + .withAwsAccountId("egfew") + .withArn("fkbemnwycxjjjxwievb") + .withPublicCloudResourceName("g") + .withAwsSourceSchema("hlvxmkdmh") + .withAwsRegion("gflixuzdblwuy") + .withAwsTags(mapOf("key1989", "fakeTokenPlaceholder"))) + .create(); + } + + // Use "Map.of" if available + @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; + } +} +``` + +### IamServerCertificates_Delete + +```java +/** + * Samples for IamServerCertificates Delete. + */ +public final class IamServerCertificatesDeleteSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * IamServerCertificates_Delete.json + */ + /** + * Sample code: IamServerCertificates_Delete. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void iamServerCertificatesDelete(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.iamServerCertificates() + .delete("rgiamServerCertificate", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE); + } +} +``` + +### IamServerCertificates_GetByResourceGroup + +```java +/** + * Samples for IamServerCertificates GetByResourceGroup. + */ +public final class IamServerCertificatesGetByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * IamServerCertificates_Get.json + */ + /** + * Sample code: IamServerCertificates_Get. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void iamServerCertificatesGet(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.iamServerCertificates() + .getByResourceGroupWithResponse("rgiamServerCertificate", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE); + } +} +``` + +### IamServerCertificates_List + +```java +/** + * Samples for IamServerCertificates List. + */ +public final class IamServerCertificatesListSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * IamServerCertificates_ListBySubscription.json + */ + /** + * Sample code: IamServerCertificates_ListBySubscription. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + iamServerCertificatesListBySubscription(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.iamServerCertificates().list(com.azure.core.util.Context.NONE); + } +} +``` + +### IamServerCertificates_ListByResourceGroup + +```java +/** + * Samples for IamServerCertificates ListByResourceGroup. + */ +public final class IamServerCertificatesListByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * IamServerCertificates_ListByResourceGroup.json + */ + /** + * Sample code: IamServerCertificates_ListByResourceGroup. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + iamServerCertificatesListByResourceGroup(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.iamServerCertificates().listByResourceGroup("rgiamServerCertificate", com.azure.core.util.Context.NONE); + } +} +``` + +### IamServerCertificates_Update + +```java +import com.azure.resourcemanager.awsconnector.models.IamServerCertificate; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for IamServerCertificates Update. + */ +public final class IamServerCertificatesUpdateSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * IamServerCertificates_Update.json + */ + /** + * Sample code: IamServerCertificates_Update. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void iamServerCertificatesUpdate(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + IamServerCertificate resource = manager.iamServerCertificates() + .getByResourceGroupWithResponse("rgiamServerCertificate", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE) + .getValue(); + resource.update().withTags(mapOf("key4287", "fakeTokenPlaceholder")).apply(); + } + + // Use "Map.of" if available + @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; + } +} +``` + +### IamVirtualMfaDevices_CreateOrReplace + +```java +import com.azure.resourcemanager.awsconnector.models.AwsIamVirtualMfaDeviceProperties; +import com.azure.resourcemanager.awsconnector.models.IamVirtualMfaDeviceProperties; +import com.azure.resourcemanager.awsconnector.models.TagAutoGenerated34; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for IamVirtualMfaDevices CreateOrReplace. + */ +public final class IamVirtualMfaDevicesCreateOrReplaceSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * IamVirtualMfaDevices_CreateOrReplace.json + */ + /** + * Sample code: IamVirtualMfaDevices_CreateOrReplace. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + iamVirtualMfaDevicesCreateOrReplace(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.iamVirtualMfaDevices() + .define("Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])") + .withRegion("ixkqwzfnsthfshdlvsvh") + .withExistingResourceGroup("rgiamVirtualMFADevice") + .withTags(mapOf("key2474", "fakeTokenPlaceholder")) + .withProperties(new IamVirtualMfaDeviceProperties() + .withAwsProperties(new AwsIamVirtualMfaDeviceProperties().withPath("iuiajbhehzagt") + .withSerialNumber("zbsulwrnmmhdwuelwbybavq") + .withTags(Arrays.asList( + new TagAutoGenerated34().withKey("fakeTokenPlaceholder").withValue("kpmtbersaovhycdipca"))) + .withUsers(Arrays.asList("pzktvxysprnhhivbnuuutllcomxp")) + .withVirtualMfaDeviceName("m")) + .withPublicCloudConnectorsResourceId("chegzvubkwsrhocspiedvdrzuhkjo") + .withAwsAccountId("deoktff") + .withArn("soptozsivfaghgr") + .withPublicCloudResourceName("uktgscbqvuprtkj") + .withAwsSourceSchema("iotqvkkgxaoeewgxegimnri") + .withAwsRegion("h") + .withAwsTags(mapOf("key1965", "fakeTokenPlaceholder"))) + .create(); + } + + // Use "Map.of" if available + @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; + } +} +``` + +### IamVirtualMfaDevices_Delete + +```java +/** + * Samples for IamVirtualMfaDevices Delete. + */ +public final class IamVirtualMfaDevicesDeleteSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * IamVirtualMfaDevices_Delete.json + */ + /** + * Sample code: IamVirtualMfaDevices_Delete. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void iamVirtualMfaDevicesDelete(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.iamVirtualMfaDevices() + .delete("rgiamVirtualMFADevice", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE); + } +} +``` + +### IamVirtualMfaDevices_GetByResourceGroup + +```java +/** + * Samples for IamVirtualMfaDevices GetByResourceGroup. + */ +public final class IamVirtualMfaDevicesGetByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * IamVirtualMfaDevices_Get.json + */ + /** + * Sample code: IamVirtualMfaDevices_Get. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void iamVirtualMfaDevicesGet(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.iamVirtualMfaDevices() + .getByResourceGroupWithResponse("rgiamVirtualMFADevice", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE); + } +} +``` + +### IamVirtualMfaDevices_List + +```java +/** + * Samples for IamVirtualMfaDevices List. + */ +public final class IamVirtualMfaDevicesListSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * IamVirtualMfaDevices_ListBySubscription.json + */ + /** + * Sample code: IamVirtualMfaDevices_ListBySubscription. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + iamVirtualMfaDevicesListBySubscription(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.iamVirtualMfaDevices().list(com.azure.core.util.Context.NONE); + } +} +``` + +### IamVirtualMfaDevices_ListByResourceGroup + +```java +/** + * Samples for IamVirtualMfaDevices ListByResourceGroup. + */ +public final class IamVirtualMfaDevicesListByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * IamVirtualMfaDevices_ListByResourceGroup.json + */ + /** + * Sample code: IamVirtualMfaDevices_ListByResourceGroup. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + iamVirtualMfaDevicesListByResourceGroup(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.iamVirtualMfaDevices().listByResourceGroup("rgiamVirtualMFADevice", com.azure.core.util.Context.NONE); + } +} +``` + +### IamVirtualMfaDevices_Update + +```java +import com.azure.resourcemanager.awsconnector.models.IamVirtualMfaDevice; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for IamVirtualMfaDevices Update. + */ +public final class IamVirtualMfaDevicesUpdateSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * IamVirtualMfaDevices_Update.json + */ + /** + * Sample code: IamVirtualMfaDevices_Update. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void iamVirtualMfaDevicesUpdate(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + IamVirtualMfaDevice resource = manager.iamVirtualMfaDevices() + .getByResourceGroupWithResponse("rgiamVirtualMFADevice", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE) + .getValue(); + resource.update().withTags(mapOf("key1836", "fakeTokenPlaceholder")).apply(); + } + + // Use "Map.of" if available + @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; + } +} +``` + +### KmsAliases_CreateOrReplace + +```java +import com.azure.resourcemanager.awsconnector.models.AwsKmsAliasProperties; +import com.azure.resourcemanager.awsconnector.models.KmsAliasProperties; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for KmsAliases CreateOrReplace. + */ +public final class KmsAliasesCreateOrReplaceSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * KmsAliases_CreateOrReplace.json + */ + /** + * Sample code: KmsAliases_CreateOrReplace. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void kmsAliasesCreateOrReplace(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.kmsAliases() + .define("Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])") + .withRegion("zsrefx") + .withExistingResourceGroup("rgkmsAlias") + .withTags(mapOf("key1437", "fakeTokenPlaceholder")) + .withProperties(new KmsAliasProperties() + .withAwsProperties(new AwsKmsAliasProperties().withAliasName("qpqfyfsgzbqqqwohdqogpksketglb") + .withTargetKeyId("fakeTokenPlaceholder")) + .withPublicCloudConnectorsResourceId("n") + .withAwsAccountId("mi") + .withArn("seecdsob") + .withPublicCloudResourceName("qrdvkbofzddttwvcfunr") + .withAwsSourceSchema("iwkqjxnfjutfnhhocco") + .withAwsRegion("zofqccwhxvtaeqhhtqwmruhcjkro") + .withAwsTags(mapOf("key6582", "fakeTokenPlaceholder"))) + .create(); + } + + // Use "Map.of" if available + @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; + } +} +``` + +### KmsAliases_Delete + +```java +/** + * Samples for KmsAliases Delete. + */ +public final class KmsAliasesDeleteSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/KmsAliases_Delete. + * json + */ + /** + * Sample code: KmsAliases_Delete. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void kmsAliasesDelete(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.kmsAliases() + .delete("rgkmsAlias", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE); + } +} +``` + +### KmsAliases_GetByResourceGroup + +```java +/** + * Samples for KmsAliases GetByResourceGroup. + */ +public final class KmsAliasesGetByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/KmsAliases_Get.json + */ + /** + * Sample code: KmsAliases_Get. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void kmsAliasesGet(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.kmsAliases() + .getByResourceGroupWithResponse("rgkmsAlias", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE); + } +} +``` + +### KmsAliases_List + +```java +/** + * Samples for KmsAliases List. + */ +public final class KmsAliasesListSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * KmsAliases_ListBySubscription.json + */ + /** + * Sample code: KmsAliases_ListBySubscription. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + kmsAliasesListBySubscription(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.kmsAliases().list(com.azure.core.util.Context.NONE); + } +} +``` + +### KmsAliases_ListByResourceGroup + +```java +/** + * Samples for KmsAliases ListByResourceGroup. + */ +public final class KmsAliasesListByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * KmsAliases_ListByResourceGroup.json + */ + /** + * Sample code: KmsAliases_ListByResourceGroup. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + kmsAliasesListByResourceGroup(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.kmsAliases().listByResourceGroup("rgkmsAlias", com.azure.core.util.Context.NONE); + } +} +``` + +### KmsAliases_Update + +```java +import com.azure.resourcemanager.awsconnector.models.KmsAlias; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for KmsAliases Update. + */ +public final class KmsAliasesUpdateSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/KmsAliases_Update. + * json + */ + /** + * Sample code: KmsAliases_Update. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void kmsAliasesUpdate(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + KmsAlias resource = manager.kmsAliases() + .getByResourceGroupWithResponse("rgkmsAlias", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE) + .getValue(); + resource.update().withTags(mapOf("key4840", "fakeTokenPlaceholder")).apply(); + } + + // Use "Map.of" if available + @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; + } +} +``` + +### KmsKeys_CreateOrReplace + +```java +import com.azure.resourcemanager.awsconnector.models.AwsKmsKeyProperties; +import com.azure.resourcemanager.awsconnector.models.KeySpec; +import com.azure.resourcemanager.awsconnector.models.KeyUsage; +import com.azure.resourcemanager.awsconnector.models.KmsKeyProperties; +import com.azure.resourcemanager.awsconnector.models.Origin; +import com.azure.resourcemanager.awsconnector.models.TagAutoGenerated35; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for KmsKeys CreateOrReplace. + */ +public final class KmsKeysCreateOrReplaceSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * KmsKeys_CreateOrReplace.json + */ + /** + * Sample code: KmsKeys_CreateOrReplace. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void kmsKeysCreateOrReplace(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.kmsKeys() + .define("Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])") + .withRegion("qozbasr") + .withExistingResourceGroup("rgkmsKey") + .withTags(mapOf("key3909", "fakeTokenPlaceholder")) + .withProperties(new KmsKeyProperties() + .withAwsProperties(new AwsKmsKeyProperties().withArn("qglsfyxssylnrh") + .withBypassPolicyLockoutSafetyCheck(true) + .withDescription("mjtmquqbhnvjw") + .withEnableKeyRotation(true) + .withEnabled(true) + .withKeyId("fakeTokenPlaceholder") + .withKeyPolicy(mapOf()) + .withKeySpec(KeySpec.ECC_NIST_P256) + .withKeyUsage(KeyUsage.ENCRYPT_DECRYPT) + .withMultiRegion(true) + .withOrigin(Origin.AWS_KMS) + .withPendingWindowInDays(7) + .withRotationPeriodInDays(4) + .withTags(Arrays.asList( + new TagAutoGenerated35().withKey("fakeTokenPlaceholder").withValue("lcaeaqxughlzgzhbbi")))) + .withPublicCloudConnectorsResourceId("tsbeayhnreovxnkbtbrvnuielziq") + .withAwsAccountId("rvkcvpmljvwdryvsugsuc") + .withArn("qszqxzva") + .withPublicCloudResourceName("edkcxntzxplnpl") + .withAwsSourceSchema("cvatoa") + .withAwsRegion("hvyzzutginnqrhgkyyripyqhqkofm") + .withAwsTags(mapOf("key8656", "fakeTokenPlaceholder"))) + .create(); + } + + // Use "Map.of" if available + @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; + } +} +``` + +### KmsKeys_Delete + +```java +/** + * Samples for KmsKeys Delete. + */ +public final class KmsKeysDeleteSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/KmsKeys_Delete.json + */ + /** + * Sample code: KmsKeys_Delete. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void kmsKeysDelete(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.kmsKeys() + .delete("rgkmsKey", "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE); + } +} +``` + +### KmsKeys_GetByResourceGroup + +```java +/** + * Samples for KmsKeys GetByResourceGroup. + */ +public final class KmsKeysGetByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/KmsKeys_Get.json + */ + /** + * Sample code: KmsKeys_Get. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void kmsKeysGet(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.kmsKeys() + .getByResourceGroupWithResponse("rgkmsKey", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE); + } +} +``` + +### KmsKeys_List + +```java +/** + * Samples for KmsKeys List. + */ +public final class KmsKeysListSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * KmsKeys_ListBySubscription.json + */ + /** + * Sample code: KmsKeys_ListBySubscription. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void kmsKeysListBySubscription(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.kmsKeys().list(com.azure.core.util.Context.NONE); + } +} +``` + +### KmsKeys_ListByResourceGroup + +```java +/** + * Samples for KmsKeys ListByResourceGroup. + */ +public final class KmsKeysListByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * KmsKeys_ListByResourceGroup.json + */ + /** + * Sample code: KmsKeys_ListByResourceGroup. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void kmsKeysListByResourceGroup(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.kmsKeys().listByResourceGroup("rgkmsKey", com.azure.core.util.Context.NONE); + } +} +``` + +### KmsKeys_Update + +```java +import com.azure.resourcemanager.awsconnector.models.KmsKey; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for KmsKeys Update. + */ +public final class KmsKeysUpdateSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/KmsKeys_Update.json + */ + /** + * Sample code: KmsKeys_Update. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void kmsKeysUpdate(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + KmsKey resource = manager.kmsKeys() + .getByResourceGroupWithResponse("rgkmsKey", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE) + .getValue(); + resource.update().withTags(mapOf("key2630", "fakeTokenPlaceholder")).apply(); + } + + // Use "Map.of" if available + @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; + } +} +``` + +### LambdaFunctionCodeLocations_CreateOrReplace + +```java +import com.azure.resourcemanager.awsconnector.models.AwsLambdaFunctionCodeLocationProperties; +import com.azure.resourcemanager.awsconnector.models.LambdaFunctionCodeLocationProperties; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for LambdaFunctionCodeLocations CreateOrReplace. + */ +public final class LambdaFunctionCodeLocationsCreateOrReplaceSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * LambdaFunctionCodeLocations_CreateOrReplace.json + */ + /** + * Sample code: LambdaFunctionCodeLocations_CreateOrReplace. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + lambdaFunctionCodeLocationsCreateOrReplace(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.lambdaFunctionCodeLocations() + .define("Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])") + .withRegion("qkuouoekvqfxgj") + .withExistingResourceGroup("rglambdaFunctionCodeLocation") + .withTags(mapOf("key5879", "fakeTokenPlaceholder")) + .withProperties(new LambdaFunctionCodeLocationProperties() + .withAwsProperties( + new AwsLambdaFunctionCodeLocationProperties().withImageUri("vgxgdgxjcgxywrlgksntztsti") + .withLocation("wntythncasjf") + .withRepositoryType("rokpwfiqhiulnmmyjxfwchgk") + .withResolvedImageUri("forzmeqdjmd")) + .withPublicCloudConnectorsResourceId("hqutrljrwdofyqxdprvsolekoxh") + .withAwsAccountId("kddvcdwz") + .withArn("cavnxpszexpsxi") + .withPublicCloudResourceName("zqervnldc") + .withAwsSourceSchema("dqmxkbgxzzurnbdbrodipprola") + .withAwsRegion("gpffqddhhsxbkcblgd") + .withAwsTags(mapOf("key6065", "fakeTokenPlaceholder"))) + .create(); + } + + // Use "Map.of" if available + @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; + } +} +``` + +### LambdaFunctionCodeLocations_Delete + +```java +/** + * Samples for LambdaFunctionCodeLocations Delete. + */ +public final class LambdaFunctionCodeLocationsDeleteSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * LambdaFunctionCodeLocations_Delete.json + */ + /** + * Sample code: LambdaFunctionCodeLocations_Delete. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + lambdaFunctionCodeLocationsDelete(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.lambdaFunctionCodeLocations() + .delete("rglambdaFunctionCodeLocation", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE); + } +} +``` + +### LambdaFunctionCodeLocations_GetByResourceGroup + +```java +/** + * Samples for LambdaFunctionCodeLocations GetByResourceGroup. + */ +public final class LambdaFunctionCodeLocationsGetByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * LambdaFunctionCodeLocations_Get.json + */ + /** + * Sample code: LambdaFunctionCodeLocations_Get. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + lambdaFunctionCodeLocationsGet(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.lambdaFunctionCodeLocations() + .getByResourceGroupWithResponse("rglambdaFunctionCodeLocation", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE); + } +} +``` + +### LambdaFunctionCodeLocations_List + +```java +/** + * Samples for LambdaFunctionCodeLocations List. + */ +public final class LambdaFunctionCodeLocationsListSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * LambdaFunctionCodeLocations_ListBySubscription.json + */ + /** + * Sample code: LambdaFunctionCodeLocations_ListBySubscription. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void lambdaFunctionCodeLocationsListBySubscription( + com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.lambdaFunctionCodeLocations().list(com.azure.core.util.Context.NONE); + } +} +``` + +### LambdaFunctionCodeLocations_ListByResourceGroup + +```java +/** + * Samples for LambdaFunctionCodeLocations ListByResourceGroup. + */ +public final class LambdaFunctionCodeLocationsListByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * LambdaFunctionCodeLocations_ListByResourceGroup.json + */ + /** + * Sample code: LambdaFunctionCodeLocations_ListByResourceGroup. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void lambdaFunctionCodeLocationsListByResourceGroup( + com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.lambdaFunctionCodeLocations() + .listByResourceGroup("rglambdaFunctionCodeLocation", com.azure.core.util.Context.NONE); + } +} +``` + +### LambdaFunctionCodeLocations_Update + +```java +import com.azure.resourcemanager.awsconnector.models.LambdaFunctionCodeLocation; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for LambdaFunctionCodeLocations Update. + */ +public final class LambdaFunctionCodeLocationsUpdateSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * LambdaFunctionCodeLocations_Update.json + */ + /** + * Sample code: LambdaFunctionCodeLocations_Update. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + lambdaFunctionCodeLocationsUpdate(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + LambdaFunctionCodeLocation resource = manager.lambdaFunctionCodeLocations() + .getByResourceGroupWithResponse("rglambdaFunctionCodeLocation", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE) + .getValue(); + resource.update().withTags(mapOf("key2617", "fakeTokenPlaceholder")).apply(); + } + + // Use "Map.of" if available + @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; + } +} +``` + +### LambdaFunctions_CreateOrReplace + +```java +import com.azure.resourcemanager.awsconnector.models.Architectures; +import com.azure.resourcemanager.awsconnector.models.AwsLambdaFunctionProperties; +import com.azure.resourcemanager.awsconnector.models.Code; +import com.azure.resourcemanager.awsconnector.models.DeadLetterConfig; +import com.azure.resourcemanager.awsconnector.models.Environment; +import com.azure.resourcemanager.awsconnector.models.EphemeralStorageAutoGenerated; +import com.azure.resourcemanager.awsconnector.models.FileSystemConfig; +import com.azure.resourcemanager.awsconnector.models.ImageConfig; +import com.azure.resourcemanager.awsconnector.models.LambdaFunctionProperties; +import com.azure.resourcemanager.awsconnector.models.LoggingConfig; +import com.azure.resourcemanager.awsconnector.models.LoggingConfigApplicationLogLevel; +import com.azure.resourcemanager.awsconnector.models.LoggingConfigLogFormat; +import com.azure.resourcemanager.awsconnector.models.LoggingConfigSystemLogLevel; +import com.azure.resourcemanager.awsconnector.models.PackageType; +import com.azure.resourcemanager.awsconnector.models.RuntimeManagementConfig; +import com.azure.resourcemanager.awsconnector.models.RuntimeManagementConfigUpdateRuntimeOn; +import com.azure.resourcemanager.awsconnector.models.SnapStart; +import com.azure.resourcemanager.awsconnector.models.SnapStartApplyOn; +import com.azure.resourcemanager.awsconnector.models.SnapStartResponse; +import com.azure.resourcemanager.awsconnector.models.SnapStartResponseApplyOn; +import com.azure.resourcemanager.awsconnector.models.SnapStartResponseOptimizationStatus; +import com.azure.resourcemanager.awsconnector.models.TagAutoGenerated36; +import com.azure.resourcemanager.awsconnector.models.TracingConfig; +import com.azure.resourcemanager.awsconnector.models.TracingConfigMode; +import com.azure.resourcemanager.awsconnector.models.VpcConfigAutoGenerated; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for LambdaFunctions CreateOrReplace. + */ +public final class LambdaFunctionsCreateOrReplaceSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * LambdaFunctions_CreateOrReplace.json + */ + /** + * Sample code: LambdaFunctions_CreateOrReplace. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + lambdaFunctionsCreateOrReplace(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.lambdaFunctions() + .define("Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])") + .withRegion("pipiphijlvjolohsfpmym") + .withExistingResourceGroup("rglambdaFunction") + .withTags(mapOf("key9520", "fakeTokenPlaceholder")) + .withProperties(new LambdaFunctionProperties() + .withAwsProperties(new AwsLambdaFunctionProperties() + .withArchitectures(Arrays.asList(Architectures.ARM64)) + .withArn("stgpeog") + .withCode(new Code().withImageUri("mumnivivaclgokdozsqygicoz") + .withS3Bucket("iqxcjanbelhti") + .withS3Key("fakeTokenPlaceholder") + .withS3ObjectVersion("ixwkaazvqllwohxjwjtivxy") + .withZipFile("cashtgbjnebsmmyijmbuerim")) + .withCodeSigningConfigArn("fakeTokenPlaceholder") + .withDeadLetterConfig(new DeadLetterConfig().withTargetArn("yfmmazkodblnhgalpsnx")) + .withDescription("yvdoxaozwjzszqnt") + .withEnvironment(new Environment().withVariables(mapOf("key999", "fakeTokenPlaceholder"))) + .withEphemeralStorage(new EphemeralStorageAutoGenerated().withSize(21)) + .withFileSystemConfigs( + Arrays.asList(new FileSystemConfig().withArn("lgaajhamrjhiw").withLocalMountPath("ctjvtoy"))) + .withFunctionName("fkv") + .withHandler("penuepcuxqvyjozfpxcxkujpeiib") + .withImageConfig(new ImageConfig().withCommand(Arrays.asList("ypqwmituqujgxriqqe")) + .withEntryPoint(Arrays.asList("vfnpuvvmmxttsaolsfocwhrhvaycbd")) + .withWorkingDirectory("gnpkvohajxgtqcweloswwofgev")) + .withKmsKeyArn("fakeTokenPlaceholder") + .withLayers(Arrays.asList("bwczxgdagr")) + .withLoggingConfig( + new LoggingConfig().withApplicationLogLevel(LoggingConfigApplicationLogLevel.DEBUG) + .withLogFormat(LoggingConfigLogFormat.JSON) + .withLogGroup("zrsmuig") + .withSystemLogLevel(LoggingConfigSystemLogLevel.DEBUG)) + .withMemorySize(21) + .withPackageType(PackageType.IMAGE) + .withReservedConcurrentExecutions(28) + .withRole("tuoem") + .withRuntime("srxhlxqifkewuflrxzjauzdqqkoatl") + .withRuntimeManagementConfig( + new RuntimeManagementConfig().withRuntimeVersionArn("lqpuhdoaicnpryovplogsolsacxbk") + .withUpdateRuntimeOn(RuntimeManagementConfigUpdateRuntimeOn.AUTO)) + .withSnapStart(new SnapStart().withApplyOn(SnapStartApplyOn.NONE)) + .withSnapStartResponse(new SnapStartResponse().withApplyOn(SnapStartResponseApplyOn.NONE) + .withOptimizationStatus(SnapStartResponseOptimizationStatus.OFF)) + .withTags(Arrays + .asList(new TagAutoGenerated36().withKey("fakeTokenPlaceholder").withValue("qctpnmjttccpi"))) + .withTimeout(28) + .withTracingConfig(new TracingConfig().withMode(TracingConfigMode.ACTIVE)) + .withVpcConfig(new VpcConfigAutoGenerated().withIpv6AllowedForDualStack(true) + .withSecurityGroupIds(Arrays.asList("ovxbygrfhfhno")) + .withSubnetIds(Arrays.asList("inqatpkusunkgccviubzkijhrgslec")))) + .withPublicCloudConnectorsResourceId("izvoucedmqtsihfjz") + .withAwsAccountId("jhircduhthqiztp") + .withArn("wksjbkhocigdctupfiheutlmloir") + .withPublicCloudResourceName("odptbducplnqaqoeleidffnyqfcipg") + .withAwsSourceSchema("joyfyjrulh") + .withAwsRegion("nat") + .withAwsTags(mapOf("key4553", "fakeTokenPlaceholder"))) + .create(); + } + + // Use "Map.of" if available + @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; + } +} +``` + +### LambdaFunctions_Delete + +```java +/** + * Samples for LambdaFunctions Delete. + */ +public final class LambdaFunctionsDeleteSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * LambdaFunctions_Delete.json + */ + /** + * Sample code: LambdaFunctions_Delete. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void lambdaFunctionsDelete(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.lambdaFunctions() + .delete("rglambdaFunction", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE); + } +} +``` + +### LambdaFunctions_GetByResourceGroup + +```java +/** + * Samples for LambdaFunctions GetByResourceGroup. + */ +public final class LambdaFunctionsGetByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/LambdaFunctions_Get + * .json + */ + /** + * Sample code: LambdaFunctions_Get. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void lambdaFunctionsGet(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.lambdaFunctions() + .getByResourceGroupWithResponse("rglambdaFunction", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE); + } +} +``` + +### LambdaFunctions_List + +```java +/** + * Samples for LambdaFunctions List. + */ +public final class LambdaFunctionsListSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * LambdaFunctions_ListBySubscription.json + */ + /** + * Sample code: LambdaFunctions_ListBySubscription. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + lambdaFunctionsListBySubscription(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.lambdaFunctions().list(com.azure.core.util.Context.NONE); + } +} +``` + +### LambdaFunctions_ListByResourceGroup + +```java +/** + * Samples for LambdaFunctions ListByResourceGroup. + */ +public final class LambdaFunctionsListByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * LambdaFunctions_ListByResourceGroup.json + */ + /** + * Sample code: LambdaFunctions_ListByResourceGroup. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + lambdaFunctionsListByResourceGroup(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.lambdaFunctions().listByResourceGroup("rglambdaFunction", com.azure.core.util.Context.NONE); + } +} +``` + +### LambdaFunctions_Update + +```java +import com.azure.resourcemanager.awsconnector.models.LambdaFunction; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for LambdaFunctions Update. + */ +public final class LambdaFunctionsUpdateSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * LambdaFunctions_Update.json + */ + /** + * Sample code: LambdaFunctions_Update. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void lambdaFunctionsUpdate(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + LambdaFunction resource = manager.lambdaFunctions() + .getByResourceGroupWithResponse("rglambdaFunction", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE) + .getValue(); + resource.update().withTags(mapOf("key6434", "fakeTokenPlaceholder")).apply(); + } + + // Use "Map.of" if available + @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; + } +} +``` + +### LightsailBuckets_CreateOrReplace + +```java +import com.azure.resourcemanager.awsconnector.models.AccessRules; +import com.azure.resourcemanager.awsconnector.models.AwsLightsailBucketProperties; +import com.azure.resourcemanager.awsconnector.models.LightsailBucketProperties; +import com.azure.resourcemanager.awsconnector.models.TagAutoGenerated37; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for LightsailBuckets CreateOrReplace. + */ +public final class LightsailBucketsCreateOrReplaceSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * LightsailBuckets_CreateOrReplace.json + */ + /** + * Sample code: LightsailBuckets_CreateOrReplace. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + lightsailBucketsCreateOrReplace(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.lightsailBuckets() + .define("Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])") + .withRegion("ctcjoqkhbmgwtqztn") + .withExistingResourceGroup("rglightsailBucket") + .withTags(mapOf("key4407", "fakeTokenPlaceholder")) + .withProperties( + new LightsailBucketProperties() + .withAwsProperties(new AwsLightsailBucketProperties().withAbleToUpdateBundle(true) + .withAccessRules(new AccessRules().withAllowPublicOverrides(true) + .withGetObject("rzsbxpoywnkypgcjndwgjxurwaggf")) + .withBucketArn("khrxjzjloawhlsscrupp") + .withBucketName("rbqqhyugkapyxigvfygdmmsig") + .withBundleId("s") + .withObjectVersioning(true) + .withReadOnlyAccessAccounts(Arrays.asList("yptmppbxsgfmbvcoourx")) + .withResourcesReceivingAccess(Arrays.asList("abmltbmvfqgzha")) + .withTags(Arrays.asList(new TagAutoGenerated37().withKey("fakeTokenPlaceholder") + .withValue("onksgozpshqfschbsuyhhui"))) + .withUrl("dzofeppuoqkmehqcpzpezbmbvrvqbn")) + .withPublicCloudConnectorsResourceId("vcenimpnlashmiz") + .withAwsAccountId("wqlujalgyyyfgmedzj") + .withArn("uoyqkdsfok") + .withPublicCloudResourceName("aqpayfdjm") + .withAwsSourceSchema("kcjmzaxkkbztlm") + .withAwsRegion("kozgryjoinum") + .withAwsTags(mapOf("key7074", "fakeTokenPlaceholder"))) + .create(); + } + + // Use "Map.of" if available + @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; + } +} +``` + +### LightsailBuckets_Delete + +```java +/** + * Samples for LightsailBuckets Delete. + */ +public final class LightsailBucketsDeleteSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * LightsailBuckets_Delete.json + */ + /** + * Sample code: LightsailBuckets_Delete. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void lightsailBucketsDelete(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.lightsailBuckets() + .delete("rglightsailBucket", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE); + } +} +``` + +### LightsailBuckets_GetByResourceGroup + +```java +/** + * Samples for LightsailBuckets GetByResourceGroup. + */ +public final class LightsailBucketsGetByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * LightsailBuckets_Get.json + */ + /** + * Sample code: LightsailBuckets_Get. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void lightsailBucketsGet(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.lightsailBuckets() + .getByResourceGroupWithResponse("rglightsailBucket", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE); + } +} +``` + +### LightsailBuckets_List + +```java +/** + * Samples for LightsailBuckets List. + */ +public final class LightsailBucketsListSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * LightsailBuckets_ListBySubscription.json + */ + /** + * Sample code: LightsailBuckets_ListBySubscription. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + lightsailBucketsListBySubscription(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.lightsailBuckets().list(com.azure.core.util.Context.NONE); + } +} +``` + +### LightsailBuckets_ListByResourceGroup + +```java +/** + * Samples for LightsailBuckets ListByResourceGroup. + */ +public final class LightsailBucketsListByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * LightsailBuckets_ListByResourceGroup.json + */ + /** + * Sample code: LightsailBuckets_ListByResourceGroup. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + lightsailBucketsListByResourceGroup(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.lightsailBuckets().listByResourceGroup("rglightsailBucket", com.azure.core.util.Context.NONE); + } +} +``` + +### LightsailBuckets_Update + +```java +import com.azure.resourcemanager.awsconnector.models.LightsailBucket; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for LightsailBuckets Update. + */ +public final class LightsailBucketsUpdateSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * LightsailBuckets_Update.json + */ + /** + * Sample code: LightsailBuckets_Update. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void lightsailBucketsUpdate(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + LightsailBucket resource = manager.lightsailBuckets() + .getByResourceGroupWithResponse("rglightsailBucket", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE) + .getValue(); + resource.update().withTags(mapOf("key1875", "fakeTokenPlaceholder")).apply(); + } + + // Use "Map.of" if available + @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; + } +} +``` + +### LightsailInstances_CreateOrReplace + +```java +import com.azure.resourcemanager.awsconnector.models.AddOn; +import com.azure.resourcemanager.awsconnector.models.AddOnStatus; +import com.azure.resourcemanager.awsconnector.models.AutoSnapshotAddOn; +import com.azure.resourcemanager.awsconnector.models.AwsLightsailInstanceProperties; +import com.azure.resourcemanager.awsconnector.models.Disk; +import com.azure.resourcemanager.awsconnector.models.Hardware; +import com.azure.resourcemanager.awsconnector.models.LightsailInstanceProperties; +import com.azure.resourcemanager.awsconnector.models.Location; +import com.azure.resourcemanager.awsconnector.models.MonthlyTransfer; +import com.azure.resourcemanager.awsconnector.models.Networking; +import com.azure.resourcemanager.awsconnector.models.Port; +import com.azure.resourcemanager.awsconnector.models.State; +import com.azure.resourcemanager.awsconnector.models.TagAutoGenerated38; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for LightsailInstances CreateOrReplace. + */ +public final class LightsailInstancesCreateOrReplaceSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * LightsailInstances_CreateOrReplace.json + */ + /** + * Sample code: LightsailInstances_CreateOrReplace. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + lightsailInstancesCreateOrReplace(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.lightsailInstances() + .define("Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])") + .withRegion("cry") + .withExistingResourceGroup("rglightsailInstance") + .withTags(mapOf("key2601", "fakeTokenPlaceholder")) + .withProperties(new LightsailInstanceProperties() + .withAwsProperties(new AwsLightsailInstanceProperties() + .withAddOns(Arrays.asList(new AddOn().withAddOnType("dk") + .withAutoSnapshotAddOnRequest( + new AutoSnapshotAddOn().withSnapshotTimeOfDay("mnthrtsoittlqrvxnwvrbaxaazh")) + .withStatus(AddOnStatus.DISABLED))) + .withAvailabilityZone("an") + .withBlueprintId("fcezpmlwqhchkvmrdnywpr") + .withBundleId("yckqxqitrffsidmdxkrmaulfgmrj") + .withHardware(new Hardware().withCpuCount(30) + .withDisks(Arrays.asList(new Disk().withAttachedTo("qoievao") + .withAttachmentState("ujinucmjcnzuosaqycrkndh") + .withDiskName("tmfpjhluaytgmpxxqtccohpge") + .withIops(11) + .withIsSystemDisk(true) + .withPath("urbubhyieizmbnyddjkyaadmod") + .withSizeInGb("vpd"))) + .withRamSizeInGb(4)) + .withInstanceArn("mnodcgqlejrhlctqngwxyoqewk") + .withInstanceName("xfxnlievrppfrt") + .withIsStaticIp(true) + .withKeyPairName("fakeTokenPlaceholder") + .withLocation(new Location().withAvailabilityZone("t").withRegionName("zgmew")) + .withNetworking( + new Networking().withMonthlyTransfer(new MonthlyTransfer().withGbPerMonthAllocated("dvbefi")) + .withPorts(Arrays.asList(new Port().withAccessDirection("bybrpghkgcvx") + .withAccessFrom("kslf") + .withAccessType("dcqaucgpbxngw") + .withCidrListAliases(Arrays.asList("btgxaahlpibcqefsgcghfd")) + .withCidrs(Arrays.asList("lhmvhnh")) + .withCommonName("t") + .withFromPort(23) + .withIpv6Cidrs(Arrays.asList("qladlrdxfiad")) + .withProtocol("bzikwazzeydyrukrjhsaogkkxua") + .withToPort(13)))) + .withPrivateIpAddress("ieeqsrklgnc") + .withPublicIpAddress("vonneqx") + .withResourceType("obxjqk") + .withSshKeyName("fakeTokenPlaceholder") + .withState(new State().withCode(29).withName("xdtssqcrsvaqphv")) + .withSupportCode("fakeTokenPlaceholder") + .withTags(Arrays + .asList(new TagAutoGenerated38().withKey("fakeTokenPlaceholder").withValue("vbybagbqynriyix"))) + .withUserData("f") + .withUsername("rhivoaleeqwog")) + .withPublicCloudConnectorsResourceId("vsgxzwhzepjvcjjoqj") + .withAwsAccountId("bclcfxetkkugpyilojpvoypui") + .withArn("dcvwurrexherolt") + .withPublicCloudResourceName("ibkgqwotzyy") + .withAwsSourceSchema("zzcfeeoutptp") + .withAwsRegion("zjxqlmimpqxec") + .withAwsTags(mapOf("key8646", "fakeTokenPlaceholder"))) + .create(); + } + + // Use "Map.of" if available + @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; + } +} +``` + +### LightsailInstances_Delete + +```java +/** + * Samples for LightsailInstances Delete. + */ +public final class LightsailInstancesDeleteSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * LightsailInstances_Delete.json + */ + /** + * Sample code: LightsailInstances_Delete. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void lightsailInstancesDelete(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.lightsailInstances() + .delete("rglightsailInstance", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE); + } +} +``` + +### LightsailInstances_GetByResourceGroup + +```java +/** + * Samples for LightsailInstances GetByResourceGroup. + */ +public final class LightsailInstancesGetByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * LightsailInstances_Get.json + */ + /** + * Sample code: LightsailInstances_Get. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void lightsailInstancesGet(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.lightsailInstances() + .getByResourceGroupWithResponse("rglightsailInstance", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE); + } +} +``` + +### LightsailInstances_List + +```java +/** + * Samples for LightsailInstances List. + */ +public final class LightsailInstancesListSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * LightsailInstances_ListBySubscription.json + */ + /** + * Sample code: LightsailInstances_ListBySubscription. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + lightsailInstancesListBySubscription(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.lightsailInstances().list(com.azure.core.util.Context.NONE); + } +} +``` + +### LightsailInstances_ListByResourceGroup + +```java +/** + * Samples for LightsailInstances ListByResourceGroup. + */ +public final class LightsailInstancesListByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * LightsailInstances_ListByResourceGroup.json + */ + /** + * Sample code: LightsailInstances_ListByResourceGroup. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + lightsailInstancesListByResourceGroup(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.lightsailInstances().listByResourceGroup("rglightsailInstance", com.azure.core.util.Context.NONE); + } +} +``` + +### LightsailInstances_Update + +```java +import com.azure.resourcemanager.awsconnector.models.LightsailInstance; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for LightsailInstances Update. + */ +public final class LightsailInstancesUpdateSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * LightsailInstances_Update.json + */ + /** + * Sample code: LightsailInstances_Update. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void lightsailInstancesUpdate(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + LightsailInstance resource = manager.lightsailInstances() + .getByResourceGroupWithResponse("rglightsailInstance", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE) + .getValue(); + resource.update().withTags(mapOf("key7201", "fakeTokenPlaceholder")).apply(); + } + + // Use "Map.of" if available + @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; + } +} +``` + +### LogsLogGroups_CreateOrReplace + +```java +import com.azure.resourcemanager.awsconnector.models.AwsLogsLogGroupProperties; +import com.azure.resourcemanager.awsconnector.models.LogGroupClass; +import com.azure.resourcemanager.awsconnector.models.LogsLogGroupProperties; +import com.azure.resourcemanager.awsconnector.models.TagAutoGenerated39; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for LogsLogGroups CreateOrReplace. + */ +public final class LogsLogGroupsCreateOrReplaceSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * LogsLogGroups_CreateOrReplace.json + */ + /** + * Sample code: LogsLogGroups_CreateOrReplace. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + logsLogGroupsCreateOrReplace(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.logsLogGroups() + .define("Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])") + .withRegion("phnyiqu") + .withExistingResourceGroup("rglogsLogGroup") + .withTags(mapOf("key9158", "fakeTokenPlaceholder")) + .withProperties(new LogsLogGroupProperties() + .withAwsProperties(new AwsLogsLogGroupProperties().withArn("nyrge") + .withKmsKeyId("fakeTokenPlaceholder") + .withLogGroupClass(LogGroupClass.INFREQUENT_ACCESS) + .withLogGroupName("ekbugjqparpxebzmfaykh") + .withRetentionInDays(17) + .withTags(Arrays.asList(new TagAutoGenerated39().withKey("fakeTokenPlaceholder").withValue("x")))) + .withPublicCloudConnectorsResourceId("ascstrkrmxqtxw") + .withAwsAccountId("jgnahcwppywqceisitgmjsw") + .withArn("seajw") + .withPublicCloudResourceName("ldqwutaylcywem") + .withAwsSourceSchema("ryhknij") + .withAwsRegion("vejderqihcaeihktrpgsuizcp") + .withAwsTags(mapOf("key2050", "fakeTokenPlaceholder"))) + .create(); + } + + // Use "Map.of" if available + @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; + } +} +``` + +### LogsLogGroups_Delete + +```java +/** + * Samples for LogsLogGroups Delete. + */ +public final class LogsLogGroupsDeleteSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * LogsLogGroups_Delete.json + */ + /** + * Sample code: LogsLogGroups_Delete. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void logsLogGroupsDelete(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.logsLogGroups() + .delete("rglogsLogGroup", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE); + } +} +``` + +### LogsLogGroups_GetByResourceGroup + +```java +/** + * Samples for LogsLogGroups GetByResourceGroup. + */ +public final class LogsLogGroupsGetByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/LogsLogGroups_Get. + * json + */ + /** + * Sample code: LogsLogGroups_Get. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void logsLogGroupsGet(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.logsLogGroups() + .getByResourceGroupWithResponse("rglogsLogGroup", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE); + } +} +``` + +### LogsLogGroups_List + +```java +/** + * Samples for LogsLogGroups List. + */ +public final class LogsLogGroupsListSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * LogsLogGroups_ListBySubscription.json + */ + /** + * Sample code: LogsLogGroups_ListBySubscription. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + logsLogGroupsListBySubscription(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.logsLogGroups().list(com.azure.core.util.Context.NONE); + } +} +``` + +### LogsLogGroups_ListByResourceGroup + +```java +/** + * Samples for LogsLogGroups ListByResourceGroup. + */ +public final class LogsLogGroupsListByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * LogsLogGroups_ListByResourceGroup.json + */ + /** + * Sample code: LogsLogGroups_ListByResourceGroup. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + logsLogGroupsListByResourceGroup(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.logsLogGroups().listByResourceGroup("rglogsLogGroup", com.azure.core.util.Context.NONE); + } +} +``` + +### LogsLogGroups_Update + +```java +import com.azure.resourcemanager.awsconnector.models.LogsLogGroup; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for LogsLogGroups Update. + */ +public final class LogsLogGroupsUpdateSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * LogsLogGroups_Update.json + */ + /** + * Sample code: LogsLogGroups_Update. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void logsLogGroupsUpdate(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + LogsLogGroup resource = manager.logsLogGroups() + .getByResourceGroupWithResponse("rglogsLogGroup", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE) + .getValue(); + resource.update().withTags(mapOf("key1200", "fakeTokenPlaceholder")).apply(); + } + + // Use "Map.of" if available + @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; + } +} +``` + +### LogsLogStreams_CreateOrReplace + +```java +import com.azure.resourcemanager.awsconnector.models.AwsLogsLogStreamProperties; +import com.azure.resourcemanager.awsconnector.models.LogsLogStreamProperties; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for LogsLogStreams CreateOrReplace. + */ +public final class LogsLogStreamsCreateOrReplaceSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * LogsLogStreams_CreateOrReplace.json + */ + /** + * Sample code: LogsLogStreams_CreateOrReplace. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + logsLogStreamsCreateOrReplace(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.logsLogStreams() + .define("Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])") + .withRegion("kptftndcymfuhgrknmxtkeqwlpjun") + .withExistingResourceGroup("rglogsLogStream") + .withTags(mapOf("key6354", "fakeTokenPlaceholder")) + .withProperties(new LogsLogStreamProperties() + .withAwsProperties(new AwsLogsLogStreamProperties().withLogGroupName("bfwnrdojlqlwrmih") + .withLogStreamName("pbtlxfgftiixnduazjvqezmnpwbr")) + .withPublicCloudConnectorsResourceId("lihllkk") + .withAwsAccountId("wdatjpiqtspvmqdqquuhipephuthnh") + .withArn("lzfqztmbbgeu") + .withPublicCloudResourceName("wftlmsgyanjghqoyfkzoqgqxrcdkq") + .withAwsSourceSchema("ffgsbwzxveleoxawcyogkiigworq") + .withAwsRegion("dzyiblunsedfhiq") + .withAwsTags(mapOf("key9843", "fakeTokenPlaceholder"))) + .create(); + } + + // Use "Map.of" if available + @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; + } +} +``` + +### LogsLogStreams_Delete + +```java +/** + * Samples for LogsLogStreams Delete. + */ +public final class LogsLogStreamsDeleteSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * LogsLogStreams_Delete.json + */ + /** + * Sample code: LogsLogStreams_Delete. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void logsLogStreamsDelete(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.logsLogStreams() + .delete("rglogsLogStream", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE); + } +} +``` + +### LogsLogStreams_GetByResourceGroup + +```java +/** + * Samples for LogsLogStreams GetByResourceGroup. + */ +public final class LogsLogStreamsGetByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/LogsLogStreams_Get. + * json + */ + /** + * Sample code: LogsLogStreams_Get. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void logsLogStreamsGet(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.logsLogStreams() + .getByResourceGroupWithResponse("rglogsLogStream", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE); + } +} +``` + +### LogsLogStreams_List + +```java +/** + * Samples for LogsLogStreams List. + */ +public final class LogsLogStreamsListSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * LogsLogStreams_ListBySubscription.json + */ + /** + * Sample code: LogsLogStreams_ListBySubscription. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + logsLogStreamsListBySubscription(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.logsLogStreams().list(com.azure.core.util.Context.NONE); + } +} +``` + +### LogsLogStreams_ListByResourceGroup + +```java +/** + * Samples for LogsLogStreams ListByResourceGroup. + */ +public final class LogsLogStreamsListByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * LogsLogStreams_ListByResourceGroup.json + */ + /** + * Sample code: LogsLogStreams_ListByResourceGroup. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + logsLogStreamsListByResourceGroup(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.logsLogStreams().listByResourceGroup("rglogsLogStream", com.azure.core.util.Context.NONE); + } +} +``` + +### LogsLogStreams_Update + +```java +import com.azure.resourcemanager.awsconnector.models.LogsLogStream; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for LogsLogStreams Update. + */ +public final class LogsLogStreamsUpdateSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * LogsLogStreams_Update.json + */ + /** + * Sample code: LogsLogStreams_Update. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void logsLogStreamsUpdate(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + LogsLogStream resource = manager.logsLogStreams() + .getByResourceGroupWithResponse("rglogsLogStream", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE) + .getValue(); + resource.update().withTags(mapOf("key5713", "fakeTokenPlaceholder")).apply(); + } + + // Use "Map.of" if available + @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; + } +} +``` + +### LogsMetricFilters_CreateOrReplace + +```java +import com.azure.resourcemanager.awsconnector.models.AwsLogsMetricFilterProperties; +import com.azure.resourcemanager.awsconnector.models.DimensionAutoGenerated; +import com.azure.resourcemanager.awsconnector.models.LogsMetricFilterProperties; +import com.azure.resourcemanager.awsconnector.models.MetricTransformation; +import com.azure.resourcemanager.awsconnector.models.MetricTransformationUnit; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for LogsMetricFilters CreateOrReplace. + */ +public final class LogsMetricFiltersCreateOrReplaceSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * LogsMetricFilters_CreateOrReplace.json + */ + /** + * Sample code: LogsMetricFilters_CreateOrReplace. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + logsMetricFiltersCreateOrReplace(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.logsMetricFilters() + .define("Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])") + .withRegion("hvjoetfjcwqioibnqqj") + .withExistingResourceGroup("rglogsMetricFilter") + .withTags(mapOf("key5537", "fakeTokenPlaceholder")) + .withProperties(new LogsMetricFilterProperties() + .withAwsProperties(new AwsLogsMetricFilterProperties().withFilterName("xexgsguaaqmkiteqgc") + .withFilterPattern("xkejasx") + .withLogGroupName("cugxyp") + .withMetricTransformations(Arrays.asList(new MetricTransformation().withDefaultValue(7) + .withDimensions(Arrays.asList(new DimensionAutoGenerated().withKey("fakeTokenPlaceholder") + .withValue("rosnaljwmrdesiticsc"))) + .withMetricName("oybfr") + .withMetricNamespace("iabzdcxljvduduha") + .withMetricValue("rpkrrqxywciyvedsvrlbujqjenrlpr") + .withUnit(MetricTransformationUnit.BITS)))) + .withPublicCloudConnectorsResourceId("dabxbsdvufxltivnlbpft") + .withAwsAccountId("z") + .withArn("cjjfhzeoyddkfmdmwsl") + .withPublicCloudResourceName("ljjatut") + .withAwsSourceSchema("tekgcey") + .withAwsRegion("qjqubwwtlycfy") + .withAwsTags(mapOf("key5547", "fakeTokenPlaceholder"))) + .create(); + } + + // Use "Map.of" if available + @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; + } +} +``` + +### LogsMetricFilters_Delete + +```java +/** + * Samples for LogsMetricFilters Delete. + */ +public final class LogsMetricFiltersDeleteSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * LogsMetricFilters_Delete.json + */ + /** + * Sample code: LogsMetricFilters_Delete. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void logsMetricFiltersDelete(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.logsMetricFilters() + .delete("rglogsMetricFilter", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE); + } +} +``` + +### LogsMetricFilters_GetByResourceGroup + +```java +/** + * Samples for LogsMetricFilters GetByResourceGroup. + */ +public final class LogsMetricFiltersGetByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * LogsMetricFilters_Get.json + */ + /** + * Sample code: LogsMetricFilters_Get. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void logsMetricFiltersGet(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.logsMetricFilters() + .getByResourceGroupWithResponse("rglogsMetricFilter", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE); + } +} +``` + +### LogsMetricFilters_List + +```java +/** + * Samples for LogsMetricFilters List. + */ +public final class LogsMetricFiltersListSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * LogsMetricFilters_ListBySubscription.json + */ + /** + * Sample code: LogsMetricFilters_ListBySubscription. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + logsMetricFiltersListBySubscription(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.logsMetricFilters().list(com.azure.core.util.Context.NONE); + } +} +``` + +### LogsMetricFilters_ListByResourceGroup + +```java +/** + * Samples for LogsMetricFilters ListByResourceGroup. + */ +public final class LogsMetricFiltersListByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * LogsMetricFilters_ListByResourceGroup.json + */ + /** + * Sample code: LogsMetricFilters_ListByResourceGroup. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + logsMetricFiltersListByResourceGroup(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.logsMetricFilters().listByResourceGroup("rglogsMetricFilter", com.azure.core.util.Context.NONE); + } +} +``` + +### LogsMetricFilters_Update + +```java +import com.azure.resourcemanager.awsconnector.models.LogsMetricFilter; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for LogsMetricFilters Update. + */ +public final class LogsMetricFiltersUpdateSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * LogsMetricFilters_Update.json + */ + /** + * Sample code: LogsMetricFilters_Update. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void logsMetricFiltersUpdate(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + LogsMetricFilter resource = manager.logsMetricFilters() + .getByResourceGroupWithResponse("rglogsMetricFilter", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE) + .getValue(); + resource.update().withTags(mapOf("key75", "fakeTokenPlaceholder")).apply(); + } + + // Use "Map.of" if available + @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; + } +} +``` + +### LogsSubscriptionFilters_CreateOrReplace + +```java +import com.azure.resourcemanager.awsconnector.models.AwsLogsSubscriptionFilterProperties; +import com.azure.resourcemanager.awsconnector.models.Distribution; +import com.azure.resourcemanager.awsconnector.models.LogsSubscriptionFilterProperties; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for LogsSubscriptionFilters CreateOrReplace. + */ +public final class LogsSubscriptionFiltersCreateOrReplaceSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * LogsSubscriptionFilters_CreateOrReplace.json + */ + /** + * Sample code: LogsSubscriptionFilters_CreateOrReplace. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + logsSubscriptionFiltersCreateOrReplace(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.logsSubscriptionFilters() + .define("Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])") + .withRegion("chliijcrgqpxjf") + .withExistingResourceGroup("rglogsSubscriptionFilter") + .withTags(mapOf("key9410", "fakeTokenPlaceholder")) + .withProperties(new LogsSubscriptionFilterProperties() + .withAwsProperties(new AwsLogsSubscriptionFilterProperties().withDestinationArn("k") + .withDistribution(Distribution.BY_LOG_STREAM) + .withFilterName("tboamjix") + .withFilterPattern("ui") + .withLogGroupName("ku") + .withRoleArn("qgjbnrzdeigsxsfrkkfiaf")) + .withPublicCloudConnectorsResourceId("ywjmogqrbdroewncecotnxyijemqjz") + .withAwsAccountId("fckvzypgfibfyknjwyrvmez") + .withArn("sbvdldikixyoalpxj") + .withPublicCloudResourceName("gilkw") + .withAwsSourceSchema("anvmszmmknfesvacxje") + .withAwsRegion("oogmbpnzqlvdmcntbzbsi") + .withAwsTags(mapOf("key7628", "fakeTokenPlaceholder"))) + .create(); + } + + // Use "Map.of" if available + @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; + } +} +``` + +### LogsSubscriptionFilters_Delete + +```java +/** + * Samples for LogsSubscriptionFilters Delete. + */ +public final class LogsSubscriptionFiltersDeleteSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * LogsSubscriptionFilters_Delete.json + */ + /** + * Sample code: LogsSubscriptionFilters_Delete. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + logsSubscriptionFiltersDelete(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.logsSubscriptionFilters() + .delete("rglogsSubscriptionFilter", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE); + } +} +``` + +### LogsSubscriptionFilters_GetByResourceGroup + +```java +/** + * Samples for LogsSubscriptionFilters GetByResourceGroup. + */ +public final class LogsSubscriptionFiltersGetByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * LogsSubscriptionFilters_Get.json + */ + /** + * Sample code: LogsSubscriptionFilters_Get. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void logsSubscriptionFiltersGet(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.logsSubscriptionFilters() + .getByResourceGroupWithResponse("rglogsSubscriptionFilter", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE); + } +} +``` + +### LogsSubscriptionFilters_List + +```java +/** + * Samples for LogsSubscriptionFilters List. + */ +public final class LogsSubscriptionFiltersListSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * LogsSubscriptionFilters_ListBySubscription.json + */ + /** + * Sample code: LogsSubscriptionFilters_ListBySubscription. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + logsSubscriptionFiltersListBySubscription(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.logsSubscriptionFilters().list(com.azure.core.util.Context.NONE); + } +} +``` + +### LogsSubscriptionFilters_ListByResourceGroup + +```java +/** + * Samples for LogsSubscriptionFilters ListByResourceGroup. + */ +public final class LogsSubscriptionFiltersListByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * LogsSubscriptionFilters_ListByResourceGroup.json + */ + /** + * Sample code: LogsSubscriptionFilters_ListByResourceGroup. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + logsSubscriptionFiltersListByResourceGroup(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.logsSubscriptionFilters() + .listByResourceGroup("rglogsSubscriptionFilter", com.azure.core.util.Context.NONE); + } +} +``` + +### LogsSubscriptionFilters_Update + +```java +import com.azure.resourcemanager.awsconnector.models.LogsSubscriptionFilter; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for LogsSubscriptionFilters Update. + */ +public final class LogsSubscriptionFiltersUpdateSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * LogsSubscriptionFilters_Update.json + */ + /** + * Sample code: LogsSubscriptionFilters_Update. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + logsSubscriptionFiltersUpdate(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + LogsSubscriptionFilter resource = manager.logsSubscriptionFilters() + .getByResourceGroupWithResponse("rglogsSubscriptionFilter", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE) + .getValue(); + resource.update().withTags(mapOf("key6314", "fakeTokenPlaceholder")).apply(); + } + + // Use "Map.of" if available + @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; + } +} +``` + +### Macie2JobSummaries_CreateOrReplace + +```java +import com.azure.resourcemanager.awsconnector.models.AwsMacie2JobSummaryProperties; +import com.azure.resourcemanager.awsconnector.models.CriteriaBlockForJob; +import com.azure.resourcemanager.awsconnector.models.CriteriaForJob; +import com.azure.resourcemanager.awsconnector.models.JobComparator; +import com.azure.resourcemanager.awsconnector.models.JobComparatorEnumValue; +import com.azure.resourcemanager.awsconnector.models.JobStatus; +import com.azure.resourcemanager.awsconnector.models.JobStatusEnumValue; +import com.azure.resourcemanager.awsconnector.models.JobType; +import com.azure.resourcemanager.awsconnector.models.JobTypeEnumValue; +import com.azure.resourcemanager.awsconnector.models.LastRunErrorStatus; +import com.azure.resourcemanager.awsconnector.models.LastRunErrorStatusCode; +import com.azure.resourcemanager.awsconnector.models.LastRunErrorStatusCodeEnumValue; +import com.azure.resourcemanager.awsconnector.models.Macie2JobSummaryProperties; +import com.azure.resourcemanager.awsconnector.models.S3BucketCriteriaForJob; +import com.azure.resourcemanager.awsconnector.models.S3BucketDefinitionForJob; +import com.azure.resourcemanager.awsconnector.models.SimpleCriterionForJob; +import com.azure.resourcemanager.awsconnector.models.SimpleCriterionKeyForJob; +import com.azure.resourcemanager.awsconnector.models.SimpleCriterionKeyForJobEnumValue; +import com.azure.resourcemanager.awsconnector.models.TagCriterionForJob; +import com.azure.resourcemanager.awsconnector.models.TagCriterionPairForJob; +import com.azure.resourcemanager.awsconnector.models.UserPausedDetails; +import java.time.OffsetDateTime; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for Macie2JobSummaries CreateOrReplace. + */ +public final class Macie2JobSummariesCreateOrReplaceSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * Macie2JobSummaries_CreateOrReplace.json + */ + /** + * Sample code: Macie2JobSummaries_CreateOrReplace. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + macie2JobSummariesCreateOrReplace(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.macie2JobSummaries() + .define("Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])") + .withRegion("sxbjamusvyf") + .withExistingResourceGroup("rgmacie2JobSummary") + .withTags(mapOf("key7937", "fakeTokenPlaceholder")) + .withProperties( + new Macie2JobSummaryProperties() + .withAwsProperties( + new AwsMacie2JobSummaryProperties() + .withBucketCriteria( + new S3BucketCriteriaForJob() + .withExcludes( + new CriteriaBlockForJob() + .withAnd( + Arrays.asList(new CriteriaForJob() + .withSimpleCriterion(new SimpleCriterionForJob() + .withComparator(new JobComparatorEnumValue() + .withValue(JobComparator.CONTAINS)) + .withKey(new SimpleCriterionKeyForJobEnumValue() + .withValue(SimpleCriterionKeyForJob.ACCOUNT_ID)) + .withValues(Arrays.asList("jtymirlxjxhaohkasaozlwag"))) + .withTagCriterion(new TagCriterionForJob() + .withComparator(new JobComparatorEnumValue() + .withValue(JobComparator.CONTAINS)) + .withTagValues(Arrays.asList( + new TagCriterionPairForJob().withKey("fakeTokenPlaceholder") + .withValue("yfiitptbkmgpsdnnhvfc"))))))) + .withIncludes( + new CriteriaBlockForJob() + .withAnd( + Arrays.asList(new CriteriaForJob() + .withSimpleCriterion(new SimpleCriterionForJob() + .withComparator(new JobComparatorEnumValue() + .withValue(JobComparator.CONTAINS)) + .withKey(new SimpleCriterionKeyForJobEnumValue() + .withValue(SimpleCriterionKeyForJob.ACCOUNT_ID)) + .withValues(Arrays.asList("jtymirlxjxhaohkasaozlwag"))) + .withTagCriterion(new TagCriterionForJob() + .withComparator(new JobComparatorEnumValue() + .withValue(JobComparator.CONTAINS)) + .withTagValues(Arrays.asList( + new TagCriterionPairForJob().withKey("fakeTokenPlaceholder") + .withValue("yfiitptbkmgpsdnnhvfc")))))))) + .withBucketDefinitions( + Arrays.asList(new S3BucketDefinitionForJob().withAccountId("eprxunabacgebqtyyff") + .withBuckets(Arrays.asList("nxnhxjevimwkagh")))) + .withCreatedAt(OffsetDateTime.parse("2024-10-08T03:51:31.106Z")) + .withJobId("jtjrvg") + .withJobStatus(new JobStatusEnumValue().withValue(JobStatus.CANCELLED)) + .withJobType(new JobTypeEnumValue().withValue(JobType.ONE_TIME)) + .withLastRunErrorStatus(new LastRunErrorStatus().withCode( + new LastRunErrorStatusCodeEnumValue().withValue(LastRunErrorStatusCode.ERROR))) + .withName("hjsakzgyfymsxrppmgaqz") + .withUserPausedDetails(new UserPausedDetails() + .withJobExpiresAt(OffsetDateTime.parse("2024-10-08T03:51:31.107Z")) + .withJobImminentExpirationHealthEventArn("tildeulhgl") + .withJobPausedAt(OffsetDateTime.parse("2024-10-08T03:51:31.107Z")))) + .withPublicCloudConnectorsResourceId("pwacjrxitwye") + .withAwsAccountId("foqcspfycfsvpqbfbcjutxvsaswla") + .withArn("gdmxefbzkonlgcinjivhec") + .withPublicCloudResourceName("xxlvdlekmm") + .withAwsSourceSchema("ucjahtqlqosuutn") + .withAwsRegion("lvgptsi") + .withAwsTags(mapOf("key5346", "fakeTokenPlaceholder"))) + .create(); + } + + // Use "Map.of" if available + @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; + } +} +``` + +### Macie2JobSummaries_Delete + +```java +/** + * Samples for Macie2JobSummaries Delete. + */ +public final class Macie2JobSummariesDeleteSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * Macie2JobSummaries_Delete.json + */ + /** + * Sample code: Macie2JobSummaries_Delete. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void macie2JobSummariesDelete(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.macie2JobSummaries() + .delete("rgmacie2JobSummary", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE); + } +} +``` + +### Macie2JobSummaries_GetByResourceGroup + +```java +/** + * Samples for Macie2JobSummaries GetByResourceGroup. + */ +public final class Macie2JobSummariesGetByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * Macie2JobSummaries_Get.json + */ + /** + * Sample code: Macie2JobSummaries_Get. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void macie2JobSummariesGet(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.macie2JobSummaries() + .getByResourceGroupWithResponse("rgmacie2JobSummary", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE); + } +} +``` + +### Macie2JobSummaries_List + +```java +/** + * Samples for Macie2JobSummaries List. + */ +public final class Macie2JobSummariesListSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * Macie2JobSummaries_ListBySubscription.json + */ + /** + * Sample code: Macie2JobSummaries_ListBySubscription. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + macie2JobSummariesListBySubscription(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.macie2JobSummaries().list(com.azure.core.util.Context.NONE); + } +} +``` + +### Macie2JobSummaries_ListByResourceGroup + +```java +/** + * Samples for Macie2JobSummaries ListByResourceGroup. + */ +public final class Macie2JobSummariesListByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * Macie2JobSummaries_ListByResourceGroup.json + */ + /** + * Sample code: Macie2JobSummaries_ListByResourceGroup. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + macie2JobSummariesListByResourceGroup(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.macie2JobSummaries().listByResourceGroup("rgmacie2JobSummary", com.azure.core.util.Context.NONE); + } +} +``` + +### Macie2JobSummaries_Update + +```java +import com.azure.resourcemanager.awsconnector.models.Macie2JobSummary; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for Macie2JobSummaries Update. + */ +public final class Macie2JobSummariesUpdateSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * Macie2JobSummaries_Update.json + */ + /** + * Sample code: Macie2JobSummaries_Update. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void macie2JobSummariesUpdate(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + Macie2JobSummary resource = manager.macie2JobSummaries() + .getByResourceGroupWithResponse("rgmacie2JobSummary", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE) + .getValue(); + resource.update().withTags(mapOf("key4316", "fakeTokenPlaceholder")).apply(); + } + + // Use "Map.of" if available + @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; + } +} +``` + +### MacieAllowLists_CreateOrReplace + +```java +import com.azure.resourcemanager.awsconnector.models.AwsMacieAllowListProperties; +import com.azure.resourcemanager.awsconnector.models.Criteria; +import com.azure.resourcemanager.awsconnector.models.MacieAllowListProperties; +import com.azure.resourcemanager.awsconnector.models.S3WordsList; +import com.azure.resourcemanager.awsconnector.models.Status; +import com.azure.resourcemanager.awsconnector.models.TagAutoGenerated40; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for MacieAllowLists CreateOrReplace. + */ +public final class MacieAllowListsCreateOrReplaceSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * MacieAllowLists_CreateOrReplace.json + */ + /** + * Sample code: MacieAllowLists_CreateOrReplace. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + macieAllowListsCreateOrReplace(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.macieAllowLists() + .define("Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])") + .withRegion("ljfzlbopfuubipqzi") + .withExistingResourceGroup("rgmacieAllowList") + .withTags(mapOf("key2466", "fakeTokenPlaceholder")) + .withProperties( + new MacieAllowListProperties() + .withAwsProperties(new AwsMacieAllowListProperties().withArn("xdvleyfipecptdivylwygmlsaua") + .withCriteria(new Criteria().withRegex("lixefi") + .withS3WordsList(new S3WordsList().withBucketName("nfztmnzebbxtnmqmrmyqnuho") + .withObjectKey("fakeTokenPlaceholder"))) + .withDescription("wvwzsjgqyvyjbb") + .withId("ssesuxsvbo") + .withName("nkimocnjypmzr") + .withStatus(Status.OK) + .withTags(Arrays + .asList(new TagAutoGenerated40().withKey("fakeTokenPlaceholder").withValue("hipfzph")))) + .withPublicCloudConnectorsResourceId("rqoahjiblmrymixvgegzwfqdq") + .withAwsAccountId("jf") + .withArn("iuotvbrnfqcexaumxdelcobenu") + .withPublicCloudResourceName("ggubisvuvunhxrj") + .withAwsSourceSchema("vviqkggctwa") + .withAwsRegion("x") + .withAwsTags(mapOf("key6335", "fakeTokenPlaceholder"))) + .create(); + } + + // Use "Map.of" if available + @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; + } +} +``` + +### MacieAllowLists_Delete + +```java +/** + * Samples for MacieAllowLists Delete. + */ +public final class MacieAllowListsDeleteSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * MacieAllowLists_Delete.json + */ + /** + * Sample code: MacieAllowLists_Delete. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void macieAllowListsDelete(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.macieAllowLists() + .delete("rgmacieAllowList", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE); + } +} +``` + +### MacieAllowLists_GetByResourceGroup + +```java +/** + * Samples for MacieAllowLists GetByResourceGroup. + */ +public final class MacieAllowListsGetByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/MacieAllowLists_Get + * .json + */ + /** + * Sample code: MacieAllowLists_Get. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void macieAllowListsGet(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.macieAllowLists() + .getByResourceGroupWithResponse("rgmacieAllowList", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE); + } +} +``` + +### MacieAllowLists_List + +```java +/** + * Samples for MacieAllowLists List. + */ +public final class MacieAllowListsListSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * MacieAllowLists_ListBySubscription.json + */ + /** + * Sample code: MacieAllowLists_ListBySubscription. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + macieAllowListsListBySubscription(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.macieAllowLists().list(com.azure.core.util.Context.NONE); + } +} +``` + +### MacieAllowLists_ListByResourceGroup + +```java +/** + * Samples for MacieAllowLists ListByResourceGroup. + */ +public final class MacieAllowListsListByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * MacieAllowLists_ListByResourceGroup.json + */ + /** + * Sample code: MacieAllowLists_ListByResourceGroup. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + macieAllowListsListByResourceGroup(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.macieAllowLists().listByResourceGroup("rgmacieAllowList", com.azure.core.util.Context.NONE); + } +} +``` + +### MacieAllowLists_Update + +```java +import com.azure.resourcemanager.awsconnector.models.MacieAllowList; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for MacieAllowLists Update. + */ +public final class MacieAllowListsUpdateSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * MacieAllowLists_Update.json + */ + /** + * Sample code: MacieAllowLists_Update. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void macieAllowListsUpdate(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + MacieAllowList resource = manager.macieAllowLists() + .getByResourceGroupWithResponse("rgmacieAllowList", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE) + .getValue(); + resource.update().withTags(mapOf("key3904", "fakeTokenPlaceholder")).apply(); + } + + // Use "Map.of" if available + @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; + } +} +``` + +### NetworkFirewallFirewallPolicies_CreateOrReplace + +```java +import com.azure.resourcemanager.awsconnector.models.ActionDefinition; +import com.azure.resourcemanager.awsconnector.models.AwsNetworkFirewallPolicyProperties; +import com.azure.resourcemanager.awsconnector.models.CustomAction; +import com.azure.resourcemanager.awsconnector.models.DimensionAutoGenerated2; +import com.azure.resourcemanager.awsconnector.models.FirewallPolicy; +import com.azure.resourcemanager.awsconnector.models.IpSet; +import com.azure.resourcemanager.awsconnector.models.NetworkFirewallPolicyProperties; +import com.azure.resourcemanager.awsconnector.models.PublishMetricAction; +import com.azure.resourcemanager.awsconnector.models.RuleVariablesModel; +import com.azure.resourcemanager.awsconnector.models.StatefulEngineOptions; +import com.azure.resourcemanager.awsconnector.models.StatefulEngineOptionsRuleOrder; +import com.azure.resourcemanager.awsconnector.models.StatefulEngineOptionsStreamExceptionPolicy; +import com.azure.resourcemanager.awsconnector.models.StatefulRuleGroupOverride; +import com.azure.resourcemanager.awsconnector.models.StatefulRuleGroupOverrideAction; +import com.azure.resourcemanager.awsconnector.models.StatefulRuleGroupReference; +import com.azure.resourcemanager.awsconnector.models.StatelessRuleGroupReference; +import com.azure.resourcemanager.awsconnector.models.TagAutoGenerated42; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for NetworkFirewallFirewallPolicies CreateOrReplace. + */ +public final class NetworkFirewallFirewallPoliciesCreateOrReplaceSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * NetworkFirewallFirewallPolicies_CreateOrReplace.json + */ + /** + * Sample code: NetworkFirewallFirewallPolicies_CreateOrReplace. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void networkFirewallFirewallPoliciesCreateOrReplace( + com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.networkFirewallFirewallPolicies() + .define("Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])") + .withRegion("jmirflesx") + .withExistingResourceGroup("rgnetworkFirewallFirewallPolicy") + .withTags(mapOf("key2040", "fakeTokenPlaceholder")) + .withProperties(new NetworkFirewallPolicyProperties() + .withAwsProperties(new AwsNetworkFirewallPolicyProperties().withDescription("lgkmdcxkddlt") + .withFirewallPolicy(new FirewallPolicy() + .withPolicyVariables(new RuleVariablesModel() + .withRuleVariables(mapOf("key6441", new IpSet().withDefinition(Arrays.asList("nwcsmd"))))) + .withStatefulDefaultActions(Arrays.asList("rhluwzzqiehteaka")) + .withStatefulEngineOptions(new StatefulEngineOptions() + .withRuleOrder(StatefulEngineOptionsRuleOrder.DEFAULT_ACTION_ORDER) + .withStreamExceptionPolicy(StatefulEngineOptionsStreamExceptionPolicy.CONTINUE)) + .withStatefulRuleGroupReferences(Arrays.asList(new StatefulRuleGroupReference() + .withOverride(new StatefulRuleGroupOverride() + .withAction(StatefulRuleGroupOverrideAction.DROP_TO_ALERT)) + .withPriority(24) + .withResourceArn("mjmcihwfckvrmkqo"))) + .withStatelessCustomActions(Arrays.asList(new CustomAction() + .withActionDefinition(new ActionDefinition() + .withPublishMetricAction(new PublishMetricAction().withDimensions(Arrays + .asList(new DimensionAutoGenerated2().withValue("kpelhvywxyvfwbkxeepdvujwrlywy"))))) + .withActionName("vzrqjgluyejlinwxxhuljye"))) + .withStatelessDefaultActions(Arrays.asList("bhojbxqneam")) + .withStatelessFragmentDefaultActions(Arrays.asList("lnpufwfpveptbxocevsbt")) + .withStatelessRuleGroupReferences( + Arrays.asList(new StatelessRuleGroupReference().withPriority(11) + .withResourceArn("kjggnkcabwynhgqkoryqzbkwz"))) + .withTlsInspectionConfigurationArn("qrdcssdykfcsxjdimv")) + .withFirewallPolicyArn("xpoahy") + .withFirewallPolicyId("ofrzbmefsngq") + .withFirewallPolicyName("xasgbvm") + .withTags(Arrays + .asList(new TagAutoGenerated42().withKey("fakeTokenPlaceholder").withValue("lrpynqejzy")))) + .withPublicCloudConnectorsResourceId("jgglyugkzlbqyphcmiuchfpzd") + .withAwsAccountId("fvglwybfwcjydvshvpaqacdtncc") + .withArn("rwqxtqealkkjplaoauziyt") + .withPublicCloudResourceName("txlbnhchqhqamo") + .withAwsSourceSchema("tupxubxwdvvlcxhmjn") + .withAwsRegion("ujnhepy") + .withAwsTags(mapOf("key2264", "fakeTokenPlaceholder"))) + .create(); + } + + // Use "Map.of" if available + @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; + } +} +``` + +### NetworkFirewallFirewallPolicies_Delete + +```java +/** + * Samples for NetworkFirewallFirewallPolicies Delete. + */ +public final class NetworkFirewallFirewallPoliciesDeleteSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * NetworkFirewallFirewallPolicies_Delete.json + */ + /** + * Sample code: NetworkFirewallFirewallPolicies_Delete. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + networkFirewallFirewallPoliciesDelete(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.networkFirewallFirewallPolicies() + .delete("rgnetworkFirewallFirewallPolicy", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE); + } +} +``` + +### NetworkFirewallFirewallPolicies_GetByResourceGroup + +```java +/** + * Samples for NetworkFirewallFirewallPolicies GetByResourceGroup. + */ +public final class NetworkFirewallFirewallPoliciesGetByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * NetworkFirewallFirewallPolicies_Get.json + */ + /** + * Sample code: NetworkFirewallFirewallPolicies_Get. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + networkFirewallFirewallPoliciesGet(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.networkFirewallFirewallPolicies() + .getByResourceGroupWithResponse("rgnetworkFirewallFirewallPolicy", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE); + } +} +``` + +### NetworkFirewallFirewallPolicies_List + +```java +/** + * Samples for NetworkFirewallFirewallPolicies List. + */ +public final class NetworkFirewallFirewallPoliciesListSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * NetworkFirewallFirewallPolicies_ListBySubscription.json + */ + /** + * Sample code: NetworkFirewallFirewallPolicies_ListBySubscription. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void networkFirewallFirewallPoliciesListBySubscription( + com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.networkFirewallFirewallPolicies().list(com.azure.core.util.Context.NONE); + } +} +``` + +### NetworkFirewallFirewallPolicies_ListByResourceGroup + +```java +/** + * Samples for NetworkFirewallFirewallPolicies ListByResourceGroup. + */ +public final class NetworkFirewallFirewallPoliciesListByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * NetworkFirewallFirewallPolicies_ListByResourceGroup.json + */ + /** + * Sample code: NetworkFirewallFirewallPolicies_ListByResourceGroup. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void networkFirewallFirewallPoliciesListByResourceGroup( + com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.networkFirewallFirewallPolicies() + .listByResourceGroup("rgnetworkFirewallFirewallPolicy", com.azure.core.util.Context.NONE); + } +} +``` + +### NetworkFirewallFirewallPolicies_Update + +```java +import com.azure.resourcemanager.awsconnector.models.NetworkFirewallPolicy; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for NetworkFirewallFirewallPolicies Update. + */ +public final class NetworkFirewallFirewallPoliciesUpdateSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * NetworkFirewallFirewallPolicies_Update.json + */ + /** + * Sample code: NetworkFirewallFirewallPolicies_Update. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + networkFirewallFirewallPoliciesUpdate(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + NetworkFirewallPolicy resource = manager.networkFirewallFirewallPolicies() + .getByResourceGroupWithResponse("rgnetworkFirewallFirewallPolicy", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE) + .getValue(); + resource.update().withTags(mapOf("key1616", "fakeTokenPlaceholder")).apply(); + } + + // Use "Map.of" if available + @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; + } +} +``` + +### NetworkFirewallFirewalls_CreateOrReplace + +```java +import com.azure.resourcemanager.awsconnector.models.AwsNetworkFirewallProperties; +import com.azure.resourcemanager.awsconnector.models.NetworkFirewallProperties; +import com.azure.resourcemanager.awsconnector.models.SubnetMappingAutoGenerated; +import com.azure.resourcemanager.awsconnector.models.TagAutoGenerated41; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for NetworkFirewallFirewalls CreateOrReplace. + */ +public final class NetworkFirewallFirewallsCreateOrReplaceSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * NetworkFirewallFirewalls_CreateOrReplace.json + */ + /** + * Sample code: NetworkFirewallFirewalls_CreateOrReplace. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + networkFirewallFirewallsCreateOrReplace(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.networkFirewallFirewalls() + .define("Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])") + .withRegion("shwlgihd") + .withExistingResourceGroup("rgnetworkFirewallFirewall") + .withTags(mapOf("key1029", "fakeTokenPlaceholder")) + .withProperties(new NetworkFirewallProperties().withAwsProperties(new AwsNetworkFirewallProperties() + .withDeleteProtection(true) + .withDescription("yjsjz") + .withEndpointIds(Arrays.asList("ivgfubgdwmucvasgqbxyoxs")) + .withFirewallArn("eukqjtyapnpaslgpyrjsuuuvrja") + .withFirewallId("ecwdwcfmctxuqrpliya") + .withFirewallName("rbcjdcahhnsogdcoklk") + .withFirewallPolicyArn("evdxwcayrnvbn") + .withFirewallPolicyChangeProtection(true) + .withSubnetChangeProtection(true) + .withSubnetMappings(Arrays.asList( + new SubnetMappingAutoGenerated().withIpAddressType("gkcalzfxwkomabldynmunz").withSubnetId("kmo"))) + .withTags(Arrays.asList( + new TagAutoGenerated41().withKey("fakeTokenPlaceholder").withValue("fnavszvtxyetugcmqvandzxjawuq"))) + .withVpcId("cxrvqz")) + .withPublicCloudConnectorsResourceId("qjo") + .withAwsAccountId("tcfbgbhrgcpvphfftvjmhjqg") + .withArn("zc") + .withPublicCloudResourceName("hloidqb") + .withAwsSourceSchema("syydqlqovymaflzph") + .withAwsRegion("ctyppkrhygaywzprynu") + .withAwsTags(mapOf("key9022", "fakeTokenPlaceholder"))) + .create(); + } + + // Use "Map.of" if available + @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; + } +} +``` + +### NetworkFirewallFirewalls_Delete + +```java +/** + * Samples for NetworkFirewallFirewalls Delete. + */ +public final class NetworkFirewallFirewallsDeleteSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * NetworkFirewallFirewalls_Delete.json + */ + /** + * Sample code: NetworkFirewallFirewalls_Delete. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + networkFirewallFirewallsDelete(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.networkFirewallFirewalls() + .delete("rgnetworkFirewallFirewall", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE); + } +} +``` + +### NetworkFirewallFirewalls_GetByResourceGroup + +```java +/** + * Samples for NetworkFirewallFirewalls GetByResourceGroup. + */ +public final class NetworkFirewallFirewallsGetByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * NetworkFirewallFirewalls_Get.json + */ + /** + * Sample code: NetworkFirewallFirewalls_Get. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void networkFirewallFirewallsGet(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.networkFirewallFirewalls() + .getByResourceGroupWithResponse("rgnetworkFirewallFirewall", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE); + } +} +``` + +### NetworkFirewallFirewalls_List + +```java +/** + * Samples for NetworkFirewallFirewalls List. + */ +public final class NetworkFirewallFirewallsListSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * NetworkFirewallFirewalls_ListBySubscription.json + */ + /** + * Sample code: NetworkFirewallFirewalls_ListBySubscription. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + networkFirewallFirewallsListBySubscription(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.networkFirewallFirewalls().list(com.azure.core.util.Context.NONE); + } +} +``` + +### NetworkFirewallFirewalls_ListByResourceGroup + +```java +/** + * Samples for NetworkFirewallFirewalls ListByResourceGroup. + */ +public final class NetworkFirewallFirewallsListByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * NetworkFirewallFirewalls_ListByResourceGroup.json + */ + /** + * Sample code: NetworkFirewallFirewalls_ListByResourceGroup. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void networkFirewallFirewallsListByResourceGroup( + com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.networkFirewallFirewalls() + .listByResourceGroup("rgnetworkFirewallFirewall", com.azure.core.util.Context.NONE); + } +} +``` + +### NetworkFirewallFirewalls_Update + +```java +import com.azure.resourcemanager.awsconnector.models.NetworkFirewall; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for NetworkFirewallFirewalls Update. + */ +public final class NetworkFirewallFirewallsUpdateSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * NetworkFirewallFirewalls_Update.json + */ + /** + * Sample code: NetworkFirewallFirewalls_Update. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + networkFirewallFirewallsUpdate(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + NetworkFirewall resource = manager.networkFirewallFirewalls() + .getByResourceGroupWithResponse("rgnetworkFirewallFirewall", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE) + .getValue(); + resource.update().withTags(mapOf("key3088", "fakeTokenPlaceholder")).apply(); + } + + // Use "Map.of" if available + @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; + } +} +``` + +### NetworkFirewallRuleGroups_CreateOrReplace + +```java +import com.azure.resourcemanager.awsconnector.models.ActionDefinitionAutoGenerated; +import com.azure.resourcemanager.awsconnector.models.Address; +import com.azure.resourcemanager.awsconnector.models.AwsNetworkFirewallRuleGroupProperties; +import com.azure.resourcemanager.awsconnector.models.CustomActionAutoGenerated; +import com.azure.resourcemanager.awsconnector.models.DimensionAutoGenerated3; +import com.azure.resourcemanager.awsconnector.models.Header; +import com.azure.resourcemanager.awsconnector.models.HeaderDirection; +import com.azure.resourcemanager.awsconnector.models.HeaderProtocol; +import com.azure.resourcemanager.awsconnector.models.IpSet; +import com.azure.resourcemanager.awsconnector.models.IpSetReference; +import com.azure.resourcemanager.awsconnector.models.MatchAttributes; +import com.azure.resourcemanager.awsconnector.models.NetworkFirewallRuleGroupProperties; +import com.azure.resourcemanager.awsconnector.models.PortRange; +import com.azure.resourcemanager.awsconnector.models.PortSet; +import com.azure.resourcemanager.awsconnector.models.PublishMetricActionAutoGenerated; +import com.azure.resourcemanager.awsconnector.models.ReferenceSets; +import com.azure.resourcemanager.awsconnector.models.RuleDefinition; +import com.azure.resourcemanager.awsconnector.models.RuleGroup; +import com.azure.resourcemanager.awsconnector.models.RuleOption; +import com.azure.resourcemanager.awsconnector.models.RuleVariables; +import com.azure.resourcemanager.awsconnector.models.RulesSource; +import com.azure.resourcemanager.awsconnector.models.RulesSourceList; +import com.azure.resourcemanager.awsconnector.models.RulesSourceListGeneratedRulesType; +import com.azure.resourcemanager.awsconnector.models.StatefulRule; +import com.azure.resourcemanager.awsconnector.models.StatefulRuleAction; +import com.azure.resourcemanager.awsconnector.models.StatefulRuleOptions; +import com.azure.resourcemanager.awsconnector.models.StatefulRuleOptionsRuleOrder; +import com.azure.resourcemanager.awsconnector.models.StatelessRule; +import com.azure.resourcemanager.awsconnector.models.StatelessRulesAndCustomActions; +import com.azure.resourcemanager.awsconnector.models.TagAutoGenerated43; +import com.azure.resourcemanager.awsconnector.models.TcpFlagField; +import com.azure.resourcemanager.awsconnector.models.Type; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for NetworkFirewallRuleGroups CreateOrReplace. + */ +public final class NetworkFirewallRuleGroupsCreateOrReplaceSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * NetworkFirewallRuleGroups_CreateOrReplace.json + */ + /** + * Sample code: NetworkFirewallRuleGroups_CreateOrReplace. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + networkFirewallRuleGroupsCreateOrReplace(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.networkFirewallRuleGroups() + .define("Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])") + .withRegion("npjhzlsmeqnuoj") + .withExistingResourceGroup("rgnetworkFirewallRuleGroup") + .withTags(mapOf("key4955", "fakeTokenPlaceholder")) + .withProperties(new NetworkFirewallRuleGroupProperties() + .withAwsProperties(new AwsNetworkFirewallRuleGroupProperties().withCapacity(13) + .withDescription("zlkovsdkoamizsf") + .withRuleGroup(new RuleGroup() + .withReferenceSets(new ReferenceSets().withIpSetReferences( + mapOf("key2227", new IpSetReference().withReferenceArn("oytryvxnweahmshhucxpblpuc")))) + .withRuleVariables(new RuleVariables() + .withIpSets(mapOf("key2970", new IpSet().withDefinition(Arrays.asList("aizprahgi")))) + .withPortSets( + mapOf("key1199", new PortSet().withDefinition(Arrays.asList("wwayyzoztulbvq"))))) + .withRulesSource(new RulesSource() + .withRulesSourceList(new RulesSourceList() + .withGeneratedRulesType(RulesSourceListGeneratedRulesType.ALLOWLIST) + .withTargetTypes(Arrays.asList("efuuy")) + .withTargets(Arrays.asList("pnecsfopd"))) + .withRulesString("xujqqtutwcprdqudsnalep") + .withStatefulRules(Arrays.asList(new StatefulRule().withAction(StatefulRuleAction.ALERT) + .withHeaderProperty(new Header().withDestination("monehvupaofeakgppr") + .withDestinationPort("qlhyfsewpdlrpkxbdwfojdz") + .withDirection(HeaderDirection.ANY) + .withProtocol(HeaderProtocol.DCERPC) + .withSource("bmxmxcbelcmrkaigfwwbtbakerp") + .withSourcePort("ieimsyntk")) + .withRuleOptions(Arrays.asList(new RuleOption().withKeyword("fakeTokenPlaceholder") + .withSettings(Arrays.asList("xflxrtoyhczflnevdftw")))))) + .withStatelessRulesAndCustomActions( + new StatelessRulesAndCustomActions() + .withCustomActions(Arrays.asList(new CustomActionAutoGenerated() + .withActionDefinition(new ActionDefinitionAutoGenerated() + .withPublishMetricAction(new PublishMetricActionAutoGenerated() + .withDimensions(Arrays.asList(new DimensionAutoGenerated3() + .withValue("wninrpqzvmeovspprohpjge"))))) + .withActionName("kcfqhtt"))) + .withStatelessRules(Arrays.asList(new StatelessRule().withPriority(11) + .withRuleDefinition(new RuleDefinition() + .withActions(Arrays.asList("ofwytyaxwaoxjuhfror")) + .withMatchAttributes(new MatchAttributes() + .withDestinationPorts( + Arrays.asList(new PortRange().withFromPort(15).withToPort(3))) + .withDestinations(Arrays + .asList(new Address().withAddressDefinition("upxiaznlcwpjgrahrg"))) + .withProtocols(Arrays.asList(27)) + .withSourcePorts( + Arrays.asList(new PortRange().withFromPort(15).withToPort(3))) + .withSources(Arrays + .asList(new Address().withAddressDefinition("upxiaznlcwpjgrahrg"))) + .withTcpFlags( + Arrays.asList(new TcpFlagField().withFlags(Arrays.asList("hc")) + .withMasks(Arrays.asList("yycdx")))))))))) + .withStatefulRuleOptions( + new StatefulRuleOptions().withRuleOrder(StatefulRuleOptionsRuleOrder.DEFAULT_ACTION_ORDER))) + .withRuleGroupArn("ncyehiokafjeadkrhonngdvqgtmdm") + .withRuleGroupId("qfdxbisrqddn") + .withRuleGroupName("dypivpjvrdiecto") + .withTags(Arrays.asList( + new TagAutoGenerated43().withKey("fakeTokenPlaceholder").withValue("pbppqwfrbdysivibwbk"))) + .withType(Type.STATEFUL)) + .withPublicCloudConnectorsResourceId("zholufsqpqkxgirpxvvr") + .withAwsAccountId("lbmcidte") + .withArn("uzwseilcphanlymsepokkjnzich") + .withPublicCloudResourceName("gpndbetnqj") + .withAwsSourceSchema("ymsi") + .withAwsRegion("vnwwozbuhjsi") + .withAwsTags(mapOf("key4273", "fakeTokenPlaceholder"))) + .create(); + } + + // Use "Map.of" if available + @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; + } +} +``` + +### NetworkFirewallRuleGroups_Delete + +```java +/** + * Samples for NetworkFirewallRuleGroups Delete. + */ +public final class NetworkFirewallRuleGroupsDeleteSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * NetworkFirewallRuleGroups_Delete.json + */ + /** + * Sample code: NetworkFirewallRuleGroups_Delete. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + networkFirewallRuleGroupsDelete(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.networkFirewallRuleGroups() + .delete("rgnetworkFirewallRuleGroup", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE); + } +} +``` + +### NetworkFirewallRuleGroups_GetByResourceGroup + +```java +/** + * Samples for NetworkFirewallRuleGroups GetByResourceGroup. + */ +public final class NetworkFirewallRuleGroupsGetByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * NetworkFirewallRuleGroups_Get.json + */ + /** + * Sample code: NetworkFirewallRuleGroups_Get. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + networkFirewallRuleGroupsGet(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.networkFirewallRuleGroups() + .getByResourceGroupWithResponse("rgnetworkFirewallRuleGroup", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE); + } +} +``` + +### NetworkFirewallRuleGroups_List + +```java +/** + * Samples for NetworkFirewallRuleGroups List. + */ +public final class NetworkFirewallRuleGroupsListSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * NetworkFirewallRuleGroups_ListBySubscription.json + */ + /** + * Sample code: NetworkFirewallRuleGroups_ListBySubscription. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void networkFirewallRuleGroupsListBySubscription( + com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.networkFirewallRuleGroups().list(com.azure.core.util.Context.NONE); + } +} +``` + +### NetworkFirewallRuleGroups_ListByResourceGroup + +```java +/** + * Samples for NetworkFirewallRuleGroups ListByResourceGroup. + */ +public final class NetworkFirewallRuleGroupsListByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * NetworkFirewallRuleGroups_ListByResourceGroup.json + */ + /** + * Sample code: NetworkFirewallRuleGroups_ListByResourceGroup. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void networkFirewallRuleGroupsListByResourceGroup( + com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.networkFirewallRuleGroups() + .listByResourceGroup("rgnetworkFirewallRuleGroup", com.azure.core.util.Context.NONE); + } +} +``` + +### NetworkFirewallRuleGroups_Update + +```java +import com.azure.resourcemanager.awsconnector.models.NetworkFirewallRuleGroup; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for NetworkFirewallRuleGroups Update. + */ +public final class NetworkFirewallRuleGroupsUpdateSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * NetworkFirewallRuleGroups_Update.json + */ + /** + * Sample code: NetworkFirewallRuleGroups_Update. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + networkFirewallRuleGroupsUpdate(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + NetworkFirewallRuleGroup resource = manager.networkFirewallRuleGroups() + .getByResourceGroupWithResponse("rgnetworkFirewallRuleGroup", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE) + .getValue(); + resource.update().withTags(mapOf("key6654", "fakeTokenPlaceholder")).apply(); + } + + // Use "Map.of" if available + @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; + } +} +``` + +### OpenSearchDomainStatuses_CreateOrReplace + +```java +import com.azure.resourcemanager.awsconnector.models.AdvancedSecurityOptions; +import com.azure.resourcemanager.awsconnector.models.AutoTuneOptionsOutput; +import com.azure.resourcemanager.awsconnector.models.AutoTuneState; +import com.azure.resourcemanager.awsconnector.models.AutoTuneStateEnumValue; +import com.azure.resourcemanager.awsconnector.models.AwsOpenSearchDomainStatusProperties; +import com.azure.resourcemanager.awsconnector.models.ChangeProgressDetails; +import com.azure.resourcemanager.awsconnector.models.ClusterConfig; +import com.azure.resourcemanager.awsconnector.models.CognitoOptions; +import com.azure.resourcemanager.awsconnector.models.ColdStorageOptions; +import com.azure.resourcemanager.awsconnector.models.ConfigChangeStatus; +import com.azure.resourcemanager.awsconnector.models.ConfigChangeStatusEnumValue; +import com.azure.resourcemanager.awsconnector.models.DeploymentStatus; +import com.azure.resourcemanager.awsconnector.models.DeploymentStatusEnumValue; +import com.azure.resourcemanager.awsconnector.models.DomainEndpointOptions; +import com.azure.resourcemanager.awsconnector.models.DomainProcessingStatusType; +import com.azure.resourcemanager.awsconnector.models.DomainProcessingStatusTypeEnumValue; +import com.azure.resourcemanager.awsconnector.models.EbsOptions; +import com.azure.resourcemanager.awsconnector.models.EncryptionAtRestOptions; +import com.azure.resourcemanager.awsconnector.models.InitiatedBy; +import com.azure.resourcemanager.awsconnector.models.InitiatedByEnumValue; +import com.azure.resourcemanager.awsconnector.models.IpAddressType; +import com.azure.resourcemanager.awsconnector.models.IpAddressTypeEnumValue; +import com.azure.resourcemanager.awsconnector.models.LogPublishingOption; +import com.azure.resourcemanager.awsconnector.models.ModifyingProperties; +import com.azure.resourcemanager.awsconnector.models.NodeToNodeEncryptionOptions; +import com.azure.resourcemanager.awsconnector.models.OffPeakWindow; +import com.azure.resourcemanager.awsconnector.models.OffPeakWindowOptions; +import com.azure.resourcemanager.awsconnector.models.OpenSearchDomainStatusProperties; +import com.azure.resourcemanager.awsconnector.models.OpenSearchPartitionInstanceType; +import com.azure.resourcemanager.awsconnector.models.OpenSearchPartitionInstanceTypeEnumValue; +import com.azure.resourcemanager.awsconnector.models.OpenSearchWarmPartitionInstanceType; +import com.azure.resourcemanager.awsconnector.models.OpenSearchWarmPartitionInstanceTypeEnumValue; +import com.azure.resourcemanager.awsconnector.models.PropertyValueType; +import com.azure.resourcemanager.awsconnector.models.PropertyValueTypeEnumValue; +import com.azure.resourcemanager.awsconnector.models.SamlIdp; +import com.azure.resourcemanager.awsconnector.models.SamlOptionsOutput; +import com.azure.resourcemanager.awsconnector.models.ServiceSoftwareOptions; +import com.azure.resourcemanager.awsconnector.models.SnapshotOptions; +import com.azure.resourcemanager.awsconnector.models.SoftwareUpdateOptions; +import com.azure.resourcemanager.awsconnector.models.TlsSecurityPolicy; +import com.azure.resourcemanager.awsconnector.models.TlsSecurityPolicyEnumValue; +import com.azure.resourcemanager.awsconnector.models.VolumeType; +import com.azure.resourcemanager.awsconnector.models.VolumeTypeEnumValue; +import com.azure.resourcemanager.awsconnector.models.VpcDerivedInfo; +import com.azure.resourcemanager.awsconnector.models.WindowStartTime; +import com.azure.resourcemanager.awsconnector.models.ZoneAwarenessConfig; +import java.time.OffsetDateTime; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for OpenSearchDomainStatuses CreateOrReplace. + */ +public final class OpenSearchDomainStatusesCreateOrReplaceSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * OpenSearchDomainStatuses_CreateOrReplace.json + */ + /** + * Sample code: OpenSearchDomainStatuses_CreateOrReplace. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + openSearchDomainStatusesCreateOrReplace(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.openSearchDomainStatuses() + .define("Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])") + .withRegion("cjnfjucekzuxbrhfzskptnxmy") + .withExistingResourceGroup("rgopenSearchDomainStatus") + .withTags(mapOf("key9493", "fakeTokenPlaceholder")) + .withProperties(new OpenSearchDomainStatusProperties() + .withAwsProperties(new AwsOpenSearchDomainStatusProperties().withArn("svblrdkqxeghxc") + .withAccessPolicies("zmizapetmvhfuhnuevg") + .withAdvancedOptions(mapOf("key5855", "fakeTokenPlaceholder")) + .withAdvancedSecurityOptions(new AdvancedSecurityOptions() + .withAnonymousAuthDisableDate(OffsetDateTime.parse("2024-10-08T03:49:18.317Z")) + .withAnonymousAuthEnabled(true) + .withEnabled(true) + .withInternalUserDatabaseEnabled(true) + .withSamlOptions(new SamlOptionsOutput().withEnabled(true) + .withIdp( + new SamlIdp().withEntityId("ujb").withMetadataContent("ncvlnvyvuwdkmspvvynhbjwzzerkl")) + .withRolesKey("fakeTokenPlaceholder") + .withSessionTimeoutMinutes(22) + .withSubjectKey("fakeTokenPlaceholder"))) + .withAutoTuneOptions(new AutoTuneOptionsOutput().withErrorMessage("gdouqrr") + .withState(new AutoTuneStateEnumValue().withValue(AutoTuneState.DISABLED)) + .withUseOffPeakWindow(true)) + .withChangeProgressDetails(new ChangeProgressDetails().withChangeId("acuqzpomrpdxccssgsjtftt") + .withConfigChangeStatus( + new ConfigChangeStatusEnumValue().withValue(ConfigChangeStatus.APPLYING_CHANGES)) + .withInitiatedBy(new InitiatedByEnumValue().withValue(InitiatedBy.CUSTOMER)) + .withLastUpdatedTime(OffsetDateTime.parse("2024-10-08T03:49:18.319Z")) + .withMessage("netweglaakukislhan") + .withStartTime(OffsetDateTime.parse("2024-10-08T03:49:18.319Z"))) + .withClusterConfig( + new ClusterConfig().withColdStorageOptions(new ColdStorageOptions().withEnabled(true)) + .withDedicatedMasterCount(15) + .withDedicatedMasterEnabled(true) + .withDedicatedMasterType(new OpenSearchPartitionInstanceTypeEnumValue() + .withValue(OpenSearchPartitionInstanceType.C4_2XLARGE_SEARCH)) + .withInstanceCount(6) + .withInstanceType(new OpenSearchPartitionInstanceTypeEnumValue() + .withValue(OpenSearchPartitionInstanceType.C4_2XLARGE_SEARCH)) + .withMultiAZWithStandbyEnabled(true) + .withWarmCount(29) + .withWarmEnabled(true) + .withWarmType(new OpenSearchWarmPartitionInstanceTypeEnumValue() + .withValue(OpenSearchWarmPartitionInstanceType.ULTRAWARM1_LARGE_SEARCH)) + .withZoneAwarenessConfig(new ZoneAwarenessConfig().withAvailabilityZoneCount(20)) + .withZoneAwarenessEnabled(true)) + .withCognitoOptions(new CognitoOptions().withEnabled(true) + .withIdentityPoolId("dcpqrbpnpihpqvibpysnhi") + .withRoleArn("wdpsbg") + .withUserPoolId("oeiqtnpxt")) + .withCreated(true) + .withDeleted(true) + .withDomainEndpointOptions( + new DomainEndpointOptions().withCustomEndpoint("pkalvbtpzxwdwtzlhet") + .withCustomEndpointCertificateArn("bmcnynq") + .withCustomEndpointEnabled(true) + .withEnforceHttps(true) + .withTlsSecurityPolicy(new TlsSecurityPolicyEnumValue() + .withValue(TlsSecurityPolicy.POLICY_MIN_TLS_1_0_2019_07))) + .withDomainId("vdvjabmtsxndtepulmirzlkxjc") + .withDomainName("zmweyexy") + .withDomainProcessingStatus( + new DomainProcessingStatusTypeEnumValue().withValue(DomainProcessingStatusType.ACTIVE)) + .withEbsOptions(new EbsOptions().withEbsEnabled(true) + .withIops(1) + .withThroughput(6) + .withVolumeSize(16) + .withVolumeType(new VolumeTypeEnumValue().withValue(VolumeType.GP2))) + .withEncryptionAtRestOptions( + new EncryptionAtRestOptions().withEnabled(true).withKmsKeyId("fakeTokenPlaceholder")) + .withEndpoint("y") + .withEndpointV2("lnmdhcvptzovtjrggoqef") + .withEndpoints(mapOf("key7016", "fakeTokenPlaceholder")) + .withEngineVersion("nafwkgnvpagjlvctspjtgg") + .withIpAddressType(new IpAddressTypeEnumValue().withValue(IpAddressType.DUALSTACK)) + .withLogPublishingOptions(mapOf("key1257", + new LogPublishingOption().withCloudWatchLogsLogGroupArn("yflaoiiuhbxlodpwh").withEnabled(true))) + .withModifyingProperties( + Arrays.asList(new ModifyingProperties().withActiveValue("igvntcixfgeammklivfvtjjxfka") + .withName("wbfqxsudlhdpidezy") + .withPendingValue("n") + .withValueType(new PropertyValueTypeEnumValue().withValue(PropertyValueType.PLAIN_TEXT)))) + .withNodeToNodeEncryptionOptions(new NodeToNodeEncryptionOptions().withEnabled(true)) + .withOffPeakWindowOptions(new OffPeakWindowOptions().withEnabled(true) + .withOffPeakWindow(new OffPeakWindow() + .withWindowStartTime(new WindowStartTime().withHours(19L).withMinutes(7L)))) + .withProcessing(true) + .withServiceSoftwareOptions(new ServiceSoftwareOptions() + .withAutomatedUpdateDate(OffsetDateTime.parse("2024-10-08T03:49:18.320Z")) + .withCancellable(true) + .withCurrentVersion("ugdoxim") + .withDescription("moodysfsdplowtykjopgnlgeodxt") + .withNewVersion("awqdkyicwktzdn") + .withOptionalDeployment(true) + .withUpdateAvailable(true) + .withUpdateStatus(new DeploymentStatusEnumValue().withValue(DeploymentStatus.COMPLETED))) + .withSnapshotOptions(new SnapshotOptions().withAutomatedSnapshotStartHour(9)) + .withSoftwareUpdateOptions(new SoftwareUpdateOptions().withAutoSoftwareUpdateEnabled(true)) + .withUpgradeProcessing(true) + .withVpcOptions(new VpcDerivedInfo().withAvailabilityZones(Arrays.asList("laxoeorkeojjhcnoji")) + .withSecurityGroupIds(Arrays.asList("ap")) + .withSubnetIds(Arrays.asList("oric")) + .withVpcId("jffbtwxjojtqphtd"))) + .withPublicCloudConnectorsResourceId("g") + .withAwsAccountId("l") + .withArn("xxoyruemlfezddeqgvpfvbvqrmmhzk") + .withPublicCloudResourceName("sntfjznnaylmvehihglcoyqpcyacz") + .withAwsSourceSchema("qrkamtxqjfb") + .withAwsRegion("mpszpnxbznm") + .withAwsTags(mapOf("key5895", "fakeTokenPlaceholder"))) + .create(); + } + + // Use "Map.of" if available + @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; + } +} +``` + +### OpenSearchDomainStatuses_Delete + +```java +/** + * Samples for OpenSearchDomainStatuses Delete. + */ +public final class OpenSearchDomainStatusesDeleteSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * OpenSearchDomainStatuses_Delete.json + */ + /** + * Sample code: OpenSearchDomainStatuses_Delete. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + openSearchDomainStatusesDelete(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.openSearchDomainStatuses() + .delete("rgopenSearchDomainStatus", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE); + } +} +``` + +### OpenSearchDomainStatuses_GetByResourceGroup + +```java +/** + * Samples for OpenSearchDomainStatuses GetByResourceGroup. + */ +public final class OpenSearchDomainStatusesGetByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * OpenSearchDomainStatuses_Get.json + */ + /** + * Sample code: OpenSearchDomainStatuses_Get. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void openSearchDomainStatusesGet(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.openSearchDomainStatuses() + .getByResourceGroupWithResponse("rgopenSearchDomainStatus", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE); + } +} +``` + +### OpenSearchDomainStatuses_List + +```java +/** + * Samples for OpenSearchDomainStatuses List. + */ +public final class OpenSearchDomainStatusesListSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * OpenSearchDomainStatuses_ListBySubscription.json + */ + /** + * Sample code: OpenSearchDomainStatuses_ListBySubscription. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + openSearchDomainStatusesListBySubscription(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.openSearchDomainStatuses().list(com.azure.core.util.Context.NONE); + } +} +``` + +### OpenSearchDomainStatuses_ListByResourceGroup + +```java +/** + * Samples for OpenSearchDomainStatuses ListByResourceGroup. + */ +public final class OpenSearchDomainStatusesListByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * OpenSearchDomainStatuses_ListByResourceGroup.json + */ + /** + * Sample code: OpenSearchDomainStatuses_ListByResourceGroup. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void openSearchDomainStatusesListByResourceGroup( + com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.openSearchDomainStatuses() + .listByResourceGroup("rgopenSearchDomainStatus", com.azure.core.util.Context.NONE); + } +} +``` + +### OpenSearchDomainStatuses_Update + +```java +import com.azure.resourcemanager.awsconnector.models.OpenSearchDomainStatus; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for OpenSearchDomainStatuses Update. + */ +public final class OpenSearchDomainStatusesUpdateSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * OpenSearchDomainStatuses_Update.json + */ + /** + * Sample code: OpenSearchDomainStatuses_Update. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + openSearchDomainStatusesUpdate(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + OpenSearchDomainStatus resource = manager.openSearchDomainStatuses() + .getByResourceGroupWithResponse("rgopenSearchDomainStatus", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE) + .getValue(); + resource.update().withTags(mapOf("key7395", "fakeTokenPlaceholder")).apply(); + } + + // Use "Map.of" if available + @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; + } +} +``` + +### Operations_List + +```java +/** + * Samples for Operations List. + */ +public final class OperationsListSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/Operations_List. + * json + */ + /** + * Sample code: Operations_List. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void operationsList(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.operations().list(com.azure.core.util.Context.NONE); + } +} +``` + +### OrganizationsAccounts_CreateOrReplace + +```java +import com.azure.resourcemanager.awsconnector.models.AwsOrganizationsAccountProperties; +import com.azure.resourcemanager.awsconnector.models.JoinedMethod; +import com.azure.resourcemanager.awsconnector.models.OrganizationsAccountProperties; +import com.azure.resourcemanager.awsconnector.models.Status; +import com.azure.resourcemanager.awsconnector.models.TagAutoGenerated44; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for OrganizationsAccounts CreateOrReplace. + */ +public final class OrganizationsAccountsCreateOrReplaceSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * OrganizationsAccounts_CreateOrReplace.json + */ + /** + * Sample code: OrganizationsAccounts_CreateOrReplace. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + organizationsAccountsCreateOrReplace(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.organizationsAccounts() + .define("Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])") + .withRegion("wyzamnearzlajcvzhj") + .withExistingResourceGroup("rgorganizationsAccount") + .withTags(mapOf("key9774", "fakeTokenPlaceholder")) + .withProperties(new OrganizationsAccountProperties() + .withAwsProperties( + new AwsOrganizationsAccountProperties().withAccountId("kkdjvhtsvtqybdxezywfojndmjpou") + .withAccountName("vegcsgzymnbxry") + .withArn("ffkjxnnwpewiiudycadgtyrztehy") + .withEmail("bwriakvcvyhklvulzwvlddeevj") + .withJoinedMethod(JoinedMethod.CREATED) + .withJoinedTimestamp("xdxxffzfzxgewxyavjim") + .withParentIds(Arrays.asList("xxzonolej")) + .withRoleName("izpxv") + .withStatus(Status.fromString("ACTIVE")) + .withTags(Arrays.asList( + new TagAutoGenerated44().withKey("fakeTokenPlaceholder").withValue("esqhxwyrftlxbuab")))) + .withPublicCloudConnectorsResourceId("zbgkie") + .withAwsAccountId("ggnntqdpbcdtbjxaiabsgxxmtunblo") + .withArn("zdirlutwidghhfrufpjhexxbsrfxwl") + .withPublicCloudResourceName("tmmwrgytiyucnzokuiq") + .withAwsSourceSchema("emcozgsikaryx") + .withAwsRegion("yvslwciyhnwwnxxrv") + .withAwsTags(mapOf("key907", "fakeTokenPlaceholder"))) + .create(); + } + + // Use "Map.of" if available + @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; + } +} +``` + +### OrganizationsAccounts_Delete + +```java +/** + * Samples for OrganizationsAccounts Delete. + */ +public final class OrganizationsAccountsDeleteSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * OrganizationsAccounts_Delete.json + */ + /** + * Sample code: OrganizationsAccounts_Delete. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void organizationsAccountsDelete(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.organizationsAccounts() + .delete("rgorganizationsAccount", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE); + } +} +``` + +### OrganizationsAccounts_GetByResourceGroup + +```java +/** + * Samples for OrganizationsAccounts GetByResourceGroup. + */ +public final class OrganizationsAccountsGetByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * OrganizationsAccounts_Get.json + */ + /** + * Sample code: OrganizationsAccounts_Get. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void organizationsAccountsGet(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.organizationsAccounts() + .getByResourceGroupWithResponse("rgorganizationsAccount", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE); + } +} +``` + +### OrganizationsAccounts_List + +```java +/** + * Samples for OrganizationsAccounts List. + */ +public final class OrganizationsAccountsListSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * OrganizationsAccounts_ListBySubscription.json + */ + /** + * Sample code: OrganizationsAccounts_ListBySubscription. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + organizationsAccountsListBySubscription(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.organizationsAccounts().list(com.azure.core.util.Context.NONE); + } +} +``` + +### OrganizationsAccounts_ListByResourceGroup + +```java +/** + * Samples for OrganizationsAccounts ListByResourceGroup. + */ +public final class OrganizationsAccountsListByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * OrganizationsAccounts_ListByResourceGroup.json + */ + /** + * Sample code: OrganizationsAccounts_ListByResourceGroup. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + organizationsAccountsListByResourceGroup(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.organizationsAccounts().listByResourceGroup("rgorganizationsAccount", com.azure.core.util.Context.NONE); + } +} +``` + +### OrganizationsAccounts_Update + +```java +import com.azure.resourcemanager.awsconnector.models.OrganizationsAccount; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for OrganizationsAccounts Update. + */ +public final class OrganizationsAccountsUpdateSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * OrganizationsAccounts_Update.json + */ + /** + * Sample code: OrganizationsAccounts_Update. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void organizationsAccountsUpdate(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + OrganizationsAccount resource = manager.organizationsAccounts() + .getByResourceGroupWithResponse("rgorganizationsAccount", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE) + .getValue(); + resource.update().withTags(mapOf("key8859", "fakeTokenPlaceholder")).apply(); + } + + // Use "Map.of" if available + @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; + } +} +``` + +### OrganizationsOrganizations_CreateOrReplace + +```java +import com.azure.resourcemanager.awsconnector.models.AwsOrganizationsOrganizationProperties; +import com.azure.resourcemanager.awsconnector.models.FeatureSet; +import com.azure.resourcemanager.awsconnector.models.OrganizationsOrganizationProperties; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for OrganizationsOrganizations CreateOrReplace. + */ +public final class OrganizationsOrganizationsCreateOrReplaceSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * OrganizationsOrganizations_CreateOrReplace.json + */ + /** + * Sample code: OrganizationsOrganizations_CreateOrReplace. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + organizationsOrganizationsCreateOrReplace(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.organizationsOrganizations() + .define("Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])") + .withRegion("fnzfxrkfm") + .withExistingResourceGroup("rgorganizationsOrganization") + .withTags(mapOf("key6745", "fakeTokenPlaceholder")) + .withProperties(new OrganizationsOrganizationProperties() + .withAwsProperties(new AwsOrganizationsOrganizationProperties().withArn("fzkwsgtciqziilbltckzwq") + .withFeatureSet(FeatureSet.ALL) + .withId("tqnrsqnzkqywpecutoxisdogfsu") + .withManagementAccountArn("aobzot") + .withManagementAccountEmail("vvcketnvinjxxhqabioa") + .withManagementAccountId("bvkksaokvmucejmtqhlwqoiuluet") + .withRootId("jtmupzgyvqhoiag")) + .withPublicCloudConnectorsResourceId("xdnn") + .withAwsAccountId("jusgdaxywgsswam") + .withArn("zitrzzdipihyovymdibklklp") + .withPublicCloudResourceName("vvwkbodgowhbhletjswxg") + .withAwsSourceSchema("pdqllbj") + .withAwsRegion("gogfumxcpzmqfcpynwlbjhjax") + .withAwsTags(mapOf("key8866", "fakeTokenPlaceholder"))) + .create(); + } + + // Use "Map.of" if available + @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; + } +} +``` + +### OrganizationsOrganizations_Delete + +```java +/** + * Samples for OrganizationsOrganizations Delete. + */ +public final class OrganizationsOrganizationsDeleteSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * OrganizationsOrganizations_Delete.json + */ + /** + * Sample code: OrganizationsOrganizations_Delete. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + organizationsOrganizationsDelete(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.organizationsOrganizations() + .delete("rgorganizationsOrganization", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE); + } +} +``` + +### OrganizationsOrganizations_GetByResourceGroup + +```java +/** + * Samples for OrganizationsOrganizations GetByResourceGroup. + */ +public final class OrganizationsOrganizationsGetByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * OrganizationsOrganizations_Get.json + */ + /** + * Sample code: OrganizationsOrganizations_Get. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + organizationsOrganizationsGet(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.organizationsOrganizations() + .getByResourceGroupWithResponse("rgorganizationsOrganization", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE); + } +} +``` + +### OrganizationsOrganizations_List + +```java +/** + * Samples for OrganizationsOrganizations List. + */ +public final class OrganizationsOrganizationsListSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * OrganizationsOrganizations_ListBySubscription.json + */ + /** + * Sample code: OrganizationsOrganizations_ListBySubscription. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void organizationsOrganizationsListBySubscription( + com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.organizationsOrganizations().list(com.azure.core.util.Context.NONE); + } +} +``` + +### OrganizationsOrganizations_ListByResourceGroup + +```java +/** + * Samples for OrganizationsOrganizations ListByResourceGroup. + */ +public final class OrganizationsOrganizationsListByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * OrganizationsOrganizations_ListByResourceGroup.json + */ + /** + * Sample code: OrganizationsOrganizations_ListByResourceGroup. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void organizationsOrganizationsListByResourceGroup( + com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.organizationsOrganizations() + .listByResourceGroup("rgorganizationsOrganization", com.azure.core.util.Context.NONE); + } +} +``` + +### OrganizationsOrganizations_Update + +```java +import com.azure.resourcemanager.awsconnector.models.OrganizationsOrganization; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for OrganizationsOrganizations Update. + */ +public final class OrganizationsOrganizationsUpdateSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * OrganizationsOrganizations_Update.json + */ + /** + * Sample code: OrganizationsOrganizations_Update. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + organizationsOrganizationsUpdate(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + OrganizationsOrganization resource = manager.organizationsOrganizations() + .getByResourceGroupWithResponse("rgorganizationsOrganization", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE) + .getValue(); + resource.update().withTags(mapOf("key5330", "fakeTokenPlaceholder")).apply(); + } + + // Use "Map.of" if available + @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; + } +} +``` + +### RdsDbClusters_CreateOrReplace + +```java +import com.azure.resourcemanager.awsconnector.models.AwsRdsDBClusterProperties; +import com.azure.resourcemanager.awsconnector.models.DBClusterRole; +import com.azure.resourcemanager.awsconnector.models.EndpointAutoGenerated; +import com.azure.resourcemanager.awsconnector.models.MasterUserSecret; +import com.azure.resourcemanager.awsconnector.models.RdsDBClusterProperties; +import com.azure.resourcemanager.awsconnector.models.ReadEndpoint; +import com.azure.resourcemanager.awsconnector.models.ScalingConfiguration; +import com.azure.resourcemanager.awsconnector.models.ServerlessV2ScalingConfiguration; +import com.azure.resourcemanager.awsconnector.models.TagAutoGenerated45; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for RdsDbClusters CreateOrReplace. + */ +public final class RdsDbClustersCreateOrReplaceSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * RdsDbClusters_CreateOrReplace.json + */ + /** + * Sample code: RdsDbClusters_CreateOrReplace. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + rdsDbClustersCreateOrReplace(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.rdsDbClusters() + .define("Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])") + .withRegion("di") + .withExistingResourceGroup("rgrdsDBCluster") + .withTags(mapOf("key1769", "fakeTokenPlaceholder")) + .withProperties(new RdsDBClusterProperties() + .withAwsProperties(new AwsRdsDBClusterProperties().withAllocatedStorage(12) + .withAssociatedRoles(Arrays + .asList(new DBClusterRole().withFeatureName("yupxlegnstbpoght").withRoleArn("pcilcosyud"))) + .withAutoMinorVersionUpgrade(true) + .withAvailabilityZones(Arrays.asList("xbabqekpowoz")) + .withBacktrackWindow(18) + .withBackupRetentionPeriod(11) + .withCopyTagsToSnapshot(true) + .withDbClusterArn("zdohcaiqsymzj") + .withDbClusterIdentifier("euvcyppvvutbntragfptjnmzhg") + .withDbClusterInstanceClass("suufjmxymxlrberbqtknmsvzrsajw") + .withDbClusterParameterGroupName("sokiordelmtviobobxrdsw") + .withDbClusterResourceId("vnwlcfxokdrjitagoefxrsf") + .withDbInstanceParameterGroupName("cwhdxixjtyfziflvod") + .withDbSubnetGroupName("ajeipefwih") + .withDbSystemId("exockxknyjqihmhxjuin") + .withDatabaseName("ttn") + .withDeletionProtection(true) + .withDomain("qzpcprovksxsiuithxqu") + .withDomainIamRoleName("psubmwhsowirjcnv") + .withEnableCloudwatchLogsExports(Arrays.asList("lytydxlnpduhnvmifkneiu")) + .withEnableGlobalWriteForwarding(true) + .withEnableHttpEndpoint(true) + .withEnableIamDatabaseAuthentication(true) + .withEndpoint(new EndpointAutoGenerated().withAddress("pwliordavkhwfklfzwxic").withPort("nagvki")) + .withEngine("cehuc") + .withEngineMode("iokki") + .withEngineVersion("ziindzjpzdrbcmtougdffweh") + .withGlobalClusterIdentifier("jqoiwozrdbnumywlieglbpzzx") + .withIops(26) + .withKmsKeyId("fakeTokenPlaceholder") + .withManageMasterUserPassword(true) + .withMasterUserPassword("fakeTokenPlaceholder") + .withMasterUserSecret(new MasterUserSecret().withKmsKeyId("fakeTokenPlaceholder") + .withSecretArn("fakeTokenPlaceholder")) + .withMasterUsername("lusozmpnihhahsioubedg") + .withMonitoringInterval(17) + .withMonitoringRoleArn("pqckluqmxqazvvi") + .withNetworkType("mnsuyqfkeqg") + .withPerformanceInsightsEnabled(true) + .withPerformanceInsightsKmsKeyId("fakeTokenPlaceholder") + .withPerformanceInsightsRetentionPeriod(2) + .withPort(23) + .withPreferredBackupWindow("shjtwjtugyols") + .withPreferredMaintenanceWindow("fuuieyvfhfcanzgutwcdbtbenk") + .withPubliclyAccessible(true) + .withReadEndpoint(new ReadEndpoint().withAddress("ca")) + .withReplicationSourceIdentifier("sdohltrpdqsszpptdh") + .withRestoreToTime("srbuhavl") + .withRestoreType("tnsdjgvzcnnsjxw") + .withScalingConfiguration(new ScalingConfiguration().withAutoPause(true) + .withMaxCapacity(3) + .withMinCapacity(5) + .withSecondsBeforeTimeout(28) + .withSecondsUntilAutoPause(25) + .withTimeoutAction("cqgyqshpkcyblfsqmujyxpfiyv")) + .withServerlessV2ScalingConfiguration( + new ServerlessV2ScalingConfiguration().withMaxCapacity(23.0F).withMinCapacity(16.0F)) + .withSnapshotIdentifier("vqowgxcqbclzjexvyigvdzlpcdluvv") + .withSourceDBClusterIdentifier("jtvnbddzyqf") + .withSourceRegion("vrzpezvwoszraxdi") + .withStorageEncrypted(true) + .withStorageThroughput(6) + .withStorageType("iiwkeunemifyewevpcvcrbs") + .withTags(Arrays.asList( + new TagAutoGenerated45().withKey("fakeTokenPlaceholder").withValue("szbfittyghldzvnflsglc"))) + .withUseLatestRestorableTime(true) + .withVpcSecurityGroupIds(Arrays.asList("jdkxpjhsibvgvorizsuzta"))) + .withPublicCloudConnectorsResourceId("pexhjqkygfiozfsvo") + .withAwsAccountId("rpxoebfhnpwagqqgk") + .withArn("lllohvlgyg") + .withPublicCloudResourceName("quyqfarecht") + .withAwsSourceSchema("wrucexqlrnssoxvtczytcslheth") + .withAwsRegion("fulsvqpnagyrsirhnuxdsppl") + .withAwsTags(mapOf("key4409", "fakeTokenPlaceholder"))) + .create(); + } + + // Use "Map.of" if available + @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; + } +} +``` + +### RdsDbClusters_Delete + +```java +/** + * Samples for RdsDbClusters Delete. + */ +public final class RdsDbClustersDeleteSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * RdsDbClusters_Delete.json + */ + /** + * Sample code: RdsDbClusters_Delete. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void rdsDbClustersDelete(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.rdsDbClusters() + .delete("rgrdsDBCluster", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE); + } +} +``` + +### RdsDbClusters_GetByResourceGroup + +```java +/** + * Samples for RdsDbClusters GetByResourceGroup. + */ +public final class RdsDbClustersGetByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/RdsDbClusters_Get. + * json + */ + /** + * Sample code: RdsDbClusters_Get. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void rdsDbClustersGet(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.rdsDbClusters() + .getByResourceGroupWithResponse("rgrdsDBCluster", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE); + } +} +``` + +### RdsDbClusters_List + +```java +/** + * Samples for RdsDbClusters List. + */ +public final class RdsDbClustersListSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * RdsDbClusters_ListBySubscription.json + */ + /** + * Sample code: RdsDbClusters_ListBySubscription. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + rdsDbClustersListBySubscription(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.rdsDbClusters().list(com.azure.core.util.Context.NONE); + } +} +``` + +### RdsDbClusters_ListByResourceGroup + +```java +/** + * Samples for RdsDbClusters ListByResourceGroup. + */ +public final class RdsDbClustersListByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * RdsDbClusters_ListByResourceGroup.json + */ + /** + * Sample code: RdsDbClusters_ListByResourceGroup. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + rdsDbClustersListByResourceGroup(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.rdsDbClusters().listByResourceGroup("rgrdsDBCluster", com.azure.core.util.Context.NONE); + } +} +``` + +### RdsDbClusters_Update + +```java +import com.azure.resourcemanager.awsconnector.models.RdsDBCluster; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for RdsDbClusters Update. + */ +public final class RdsDbClustersUpdateSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * RdsDbClusters_Update.json + */ + /** + * Sample code: RdsDbClusters_Update. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void rdsDbClustersUpdate(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + RdsDBCluster resource = manager.rdsDbClusters() + .getByResourceGroupWithResponse("rgrdsDBCluster", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE) + .getValue(); + resource.update().withTags(mapOf("key7248", "fakeTokenPlaceholder")).apply(); + } + + // Use "Map.of" if available + @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; + } +} +``` + +### RdsDbInstances_CreateOrReplace + +```java +import com.azure.resourcemanager.awsconnector.models.AwsRdsDBInstanceProperties; +import com.azure.resourcemanager.awsconnector.models.CertificateDetails; +import com.azure.resourcemanager.awsconnector.models.DBInstanceRole; +import com.azure.resourcemanager.awsconnector.models.EndpointAutoGenerated2; +import com.azure.resourcemanager.awsconnector.models.MasterUserSecret; +import com.azure.resourcemanager.awsconnector.models.ProcessorFeature; +import com.azure.resourcemanager.awsconnector.models.ProcessorFeatureName; +import com.azure.resourcemanager.awsconnector.models.RdsDBInstanceProperties; +import com.azure.resourcemanager.awsconnector.models.TagAutoGenerated46; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for RdsDbInstances CreateOrReplace. + */ +public final class RdsDbInstancesCreateOrReplaceSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * RdsDbInstances_CreateOrReplace.json + */ + /** + * Sample code: RdsDbInstances_CreateOrReplace. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + rdsDbInstancesCreateOrReplace(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.rdsDbInstances() + .define("Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])") + .withRegion("pktn") + .withExistingResourceGroup("rgrdsDBInstance") + .withTags(mapOf("key7306", "fakeTokenPlaceholder")) + .withProperties( + new RdsDBInstanceProperties() + .withAwsProperties(new AwsRdsDBInstanceProperties().withAllocatedStorage("ryhixfujuvwifznymxbze") + .withAllowMajorVersionUpgrade(true) + .withAssociatedRoles(Arrays.asList(new DBInstanceRole().withFeatureName("jyivqbpnmvg") + .withRoleArn("jblmzpmkcvnkvsxkswtmfqlwttf"))) + .withAutoMinorVersionUpgrade(true) + .withAutomaticBackupReplicationKmsKeyId("fakeTokenPlaceholder") + .withAutomaticBackupReplicationRegion("h") + .withAvailabilityZone("ccdhbiqvvdxbszpuhcvsvpuqfrkosf") + .withBackupRetentionPeriod(6) + .withCaCertificateIdentifier("dp") + .withCertificateDetails(new CertificateDetails().withCaIdentifier("jathtqegixcwxcwmnrlrsycxvyp") + .withValidTill("nclrurexsnhed")) + .withCertificateRotationRestart(true) + .withCharacterSetName("bapraruogdpspvewmd") + .withCopyTagsToSnapshot(true) + .withCustomIamInstanceProfile("ronoghiguflpqdlwef") + .withDbClusterIdentifier("mi") + .withDbClusterSnapshotIdentifier("biqdaekgjeyopntgrx") + .withDbInstanceArn("xxk") + .withDbInstanceClass("xvgbsmhvq") + .withDbInstanceIdentifier("svbefulaqhcsf") + .withDbName("yryxlwvdmghqcfdlhdyykzejtyep") + .withDbParameterGroupName("keuvtxklarpjmikkuwqqfanv") + .withDbSecurityGroups(Arrays.asList("mgcichzarguqhevlwubzgbvs")) + .withDbSnapshotIdentifier("coykeofgbcwpjeihmmajttm") + .withDbSubnetGroupName("yxd") + .withDbSystemId("rlbhsqhwmezvevqsme") + .withDbiResourceId("nlqlrrljz") + .withDedicatedLogVolume(true) + .withDeleteAutomatedBackups(true) + .withDeletionProtection(true) + .withDomain("mkboglzqbejwwfplkhpiwsvndwphik") + .withDomainAuthSecretArn("fakeTokenPlaceholder") + .withDomainDnsIps(Arrays.asList("celohfbruu")) + .withDomainFqdn("txgpdsxlpqbasbbmpzzkdztlfphm") + .withDomainIamRoleName("ljnyfnuzyqodzawuu") + .withDomainOu("yhtbsdxktvxrtweyoo") + .withEnableCloudwatchLogsExports(Arrays.asList("anqxngk")) + .withEnableIamDatabaseAuthentication(true) + .withEnablePerformanceInsights(true) + .withEndpoint(new EndpointAutoGenerated2().withAddress("rmsxn") + .withHostedZoneId("mvsioevf") + .withPort("gfpslsfdtnmrahrfppdwaf")) + .withEngine("jztlgxuyyhlwrjkgree") + .withEngineVersion("fwmhfzboltipjkflr") + .withIops(6) + .withKmsKeyId("fakeTokenPlaceholder") + .withLicenseModel("qcmsltdkpdsznfotmqdvnntnfor") + .withManageMasterUserPassword(true) + .withMasterUserPassword("fakeTokenPlaceholder") + .withMasterUserSecret(new MasterUserSecret().withKmsKeyId("fakeTokenPlaceholder") + .withSecretArn("fakeTokenPlaceholder")) + .withMasterUsername("lfitzeghwpzjhcbje") + .withMaxAllocatedStorage(9) + .withMonitoringInterval(17) + .withMonitoringRoleArn("a") + .withMultiAZ(true) + .withNcharCharacterSetName("cc") + .withNetworkType("bccgoqncxrhuwvgwvwta") + .withOptionGroupName("mftqhqogtwleqvlpjpbabps") + .withPerformanceInsightsKmsKeyId("fakeTokenPlaceholder") + .withPerformanceInsightsRetentionPeriod(27) + .withPort("g") + .withPreferredBackupWindow("wesxjihubbcfgwqebebkzmmfoipd") + .withPreferredMaintenanceWindow("gtmzlucaagottcm") + .withProcessorFeatures( + Arrays.asList(new ProcessorFeature().withName(ProcessorFeatureName.CORE_COUNT) + .withValue("qhhoewgkcuvttcihy"))) + .withPromotionTier(12) + .withPubliclyAccessible(true) + .withReplicaMode("poucyygmqhpztshwupms") + .withRestoreTime("nokteyfkzzvhgjtpmiwxajseiavtbk") + .withSourceDBClusterIdentifier("gkdeeipcvhmgoabz") + .withSourceDBInstanceAutomatedBackupsArn("lisujvucnvopgkehpacmkjshk") + .withSourceDBInstanceIdentifier("ypufdzwdqxkygzmrp") + .withSourceDbiResourceId("btzodcuervx") + .withSourceRegion("ez") + .withStorageEncrypted(true) + .withStorageThroughput(16) + .withStorageType("ywcy") + .withTags(Arrays + .asList(new TagAutoGenerated46().withKey("fakeTokenPlaceholder").withValue("rdhflka"))) + .withTdeCredentialArn("fakeTokenPlaceholder") + .withTdeCredentialPassword("fakeTokenPlaceholder") + .withTimezone("euyueykvptytmbnfj") + .withUseDefaultProcessorFeatures(true) + .withUseLatestRestorableTime(true) + .withVpcSecurityGroups(Arrays.asList("nxllphmorxutzaym"))) + .withPublicCloudConnectorsResourceId("etsvehjovtdbgzuwnmgw") + .withAwsAccountId("xjspz") + .withArn("ikxozbmzhxy") + .withPublicCloudResourceName("bvkzujojjsvihxyajddbqxygffaqm") + .withAwsSourceSchema("cjfztsurj") + .withAwsRegion("dmudtaomgrfchc") + .withAwsTags(mapOf("key3142", "fakeTokenPlaceholder"))) + .create(); + } + + // Use "Map.of" if available + @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; + } +} +``` + +### RdsDbInstances_Delete + +```java +/** + * Samples for RdsDbInstances Delete. + */ +public final class RdsDbInstancesDeleteSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * RdsDbInstances_Delete.json + */ + /** + * Sample code: RdsDbInstances_Delete. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void rdsDbInstancesDelete(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.rdsDbInstances() + .delete("rgrdsDBInstance", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE); + } +} +``` + +### RdsDbInstances_GetByResourceGroup + +```java +/** + * Samples for RdsDbInstances GetByResourceGroup. + */ +public final class RdsDbInstancesGetByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/RdsDbInstances_Get. + * json + */ + /** + * Sample code: RdsDbInstances_Get. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void rdsDbInstancesGet(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.rdsDbInstances() + .getByResourceGroupWithResponse("rgrdsDBInstance", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE); + } +} +``` + +### RdsDbInstances_List + +```java +/** + * Samples for RdsDbInstances List. + */ +public final class RdsDbInstancesListSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * RdsDbInstances_ListBySubscription.json + */ + /** + * Sample code: RdsDbInstances_ListBySubscription. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + rdsDbInstancesListBySubscription(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.rdsDbInstances().list(com.azure.core.util.Context.NONE); + } +} +``` + +### RdsDbInstances_ListByResourceGroup + +```java +/** + * Samples for RdsDbInstances ListByResourceGroup. + */ +public final class RdsDbInstancesListByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * RdsDbInstances_ListByResourceGroup.json + */ + /** + * Sample code: RdsDbInstances_ListByResourceGroup. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + rdsDbInstancesListByResourceGroup(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.rdsDbInstances().listByResourceGroup("rgrdsDBInstance", com.azure.core.util.Context.NONE); + } +} +``` + +### RdsDbInstances_Update + +```java +import com.azure.resourcemanager.awsconnector.models.RdsDBInstance; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for RdsDbInstances Update. + */ +public final class RdsDbInstancesUpdateSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * RdsDbInstances_Update.json + */ + /** + * Sample code: RdsDbInstances_Update. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void rdsDbInstancesUpdate(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + RdsDBInstance resource = manager.rdsDbInstances() + .getByResourceGroupWithResponse("rgrdsDBInstance", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE) + .getValue(); + resource.update().withTags(mapOf("key9889", "fakeTokenPlaceholder")).apply(); + } + + // Use "Map.of" if available + @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; + } +} +``` + +### RdsDbSnapshotAttributesResults_CreateOrReplace + +```java +import com.azure.resourcemanager.awsconnector.models.AwsRdsDBSnapshotAttributesResultProperties; +import com.azure.resourcemanager.awsconnector.models.DBSnapshotAttribute; +import com.azure.resourcemanager.awsconnector.models.RdsDBSnapshotAttributesResultProperties; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for RdsDbSnapshotAttributesResults CreateOrReplace. + */ +public final class RdsDbSnapshotAttributesResultsCreateOrReplaceSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * RdsDbSnapshotAttributesResults_CreateOrReplace.json + */ + /** + * Sample code: RdsDbSnapshotAttributesResults_CreateOrReplace. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void rdsDbSnapshotAttributesResultsCreateOrReplace( + com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.rdsDbSnapshotAttributesResults() + .define("Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])") + .withRegion("luzcqukssqazokzghltlzp") + .withExistingResourceGroup("rgrdsDBSnapshotAttributesResult") + .withTags(mapOf("key3873", "fakeTokenPlaceholder")) + .withProperties(new RdsDBSnapshotAttributesResultProperties() + .withAwsProperties(new AwsRdsDBSnapshotAttributesResultProperties() + .withDbSnapshotAttributes(Arrays.asList(new DBSnapshotAttribute().withAttributeName("yszcujemf") + .withAttributeValues(Arrays.asList("cffn")))) + .withDbSnapshotIdentifier("hgeztauvapideyaajrbafqyup")) + .withPublicCloudConnectorsResourceId("bmzbcvocakxlkqxmewfdruhn") + .withAwsAccountId("za") + .withArn("wctkioaluqun") + .withPublicCloudResourceName("kuhhovfpzvgapi") + .withAwsSourceSchema("w") + .withAwsRegion("ndsijffpilnosnrldocuqrlxitjpv") + .withAwsTags(mapOf("key3566", "fakeTokenPlaceholder"))) + .create(); + } + + // Use "Map.of" if available + @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; + } +} +``` + +### RdsDbSnapshotAttributesResults_Delete + +```java +/** + * Samples for RdsDbSnapshotAttributesResults Delete. + */ +public final class RdsDbSnapshotAttributesResultsDeleteSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * RdsDbSnapshotAttributesResults_Delete.json + */ + /** + * Sample code: RdsDbSnapshotAttributesResults_Delete. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + rdsDbSnapshotAttributesResultsDelete(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.rdsDbSnapshotAttributesResults() + .delete("rgrdsDBSnapshotAttributesResult", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE); + } +} +``` + +### RdsDbSnapshotAttributesResults_GetByResourceGroup + +```java +/** + * Samples for RdsDbSnapshotAttributesResults GetByResourceGroup. + */ +public final class RdsDbSnapshotAttributesResultsGetByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * RdsDbSnapshotAttributesResults_Get.json + */ + /** + * Sample code: RdsDbSnapshotAttributesResults_Get. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + rdsDbSnapshotAttributesResultsGet(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.rdsDbSnapshotAttributesResults() + .getByResourceGroupWithResponse("rgrdsDBSnapshotAttributesResult", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE); + } +} +``` + +### RdsDbSnapshotAttributesResults_List + +```java +/** + * Samples for RdsDbSnapshotAttributesResults List. + */ +public final class RdsDbSnapshotAttributesResultsListSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * RdsDbSnapshotAttributesResults_ListBySubscription.json + */ + /** + * Sample code: RdsDbSnapshotAttributesResults_ListBySubscription. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void rdsDbSnapshotAttributesResultsListBySubscription( + com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.rdsDbSnapshotAttributesResults().list(com.azure.core.util.Context.NONE); + } +} +``` + +### RdsDbSnapshotAttributesResults_ListByResourceGroup + +```java +/** + * Samples for RdsDbSnapshotAttributesResults ListByResourceGroup. + */ +public final class RdsDbSnapshotAttributesResultsListByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * RdsDbSnapshotAttributesResults_ListByResourceGroup.json + */ + /** + * Sample code: RdsDbSnapshotAttributesResults_ListByResourceGroup. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void rdsDbSnapshotAttributesResultsListByResourceGroup( + com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.rdsDbSnapshotAttributesResults() + .listByResourceGroup("rgrdsDBSnapshotAttributesResult", com.azure.core.util.Context.NONE); + } +} +``` + +### RdsDbSnapshotAttributesResults_Update + +```java +import com.azure.resourcemanager.awsconnector.models.RdsDBSnapshotAttributesResult; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for RdsDbSnapshotAttributesResults Update. + */ +public final class RdsDbSnapshotAttributesResultsUpdateSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * RdsDbSnapshotAttributesResults_Update.json + */ + /** + * Sample code: RdsDbSnapshotAttributesResults_Update. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + rdsDbSnapshotAttributesResultsUpdate(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + RdsDBSnapshotAttributesResult resource = manager.rdsDbSnapshotAttributesResults() + .getByResourceGroupWithResponse("rgrdsDBSnapshotAttributesResult", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE) + .getValue(); + resource.update().withTags(mapOf("key7927", "fakeTokenPlaceholder")).apply(); + } + + // Use "Map.of" if available + @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; + } +} +``` + +### RdsDbSnapshots_CreateOrReplace + +```java +import com.azure.resourcemanager.awsconnector.models.AwsRdsDBSnapshotProperties; +import com.azure.resourcemanager.awsconnector.models.ProcessorFeatureAutoGenerated; +import com.azure.resourcemanager.awsconnector.models.RdsDBSnapshotProperties; +import com.azure.resourcemanager.awsconnector.models.TagAutoGenerated47; +import java.time.OffsetDateTime; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for RdsDbSnapshots CreateOrReplace. + */ +public final class RdsDbSnapshotsCreateOrReplaceSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * RdsDbSnapshots_CreateOrReplace.json + */ + /** + * Sample code: RdsDbSnapshots_CreateOrReplace. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + rdsDbSnapshotsCreateOrReplace(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.rdsDbSnapshots() + .define("Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])") + .withRegion("ojgfpymabvdpgvknjfvaecf") + .withExistingResourceGroup("rgrdsDBSnapshot") + .withTags(mapOf("key752", "fakeTokenPlaceholder")) + .withProperties(new RdsDBSnapshotProperties() + .withAwsProperties(new AwsRdsDBSnapshotProperties().withAllocatedStorage(10) + .withAvailabilityZone("kayjlaciv") + .withDbInstanceIdentifier("sgszwrakxshyzice") + .withDbSnapshotArn("xdjclnyyjohzhbe") + .withDbSnapshotIdentifier("yeju") + .withDbSystemId("fzavlejrrugjcdxaetdvvhg") + .withDbiResourceId("jwxsvn") + .withDedicatedLogVolume(true) + .withEncrypted(true) + .withEngine("xkjeovmjwpoycteiloodhzsyly") + .withEngineVersion("ycrrezzqweeassrgalnqmcuhnk") + .withIamDatabaseAuthenticationEnabled(true) + .withInstanceCreateTime(OffsetDateTime.parse("2024-10-08T03:49:38.588Z")) + .withIops(7) + .withKmsKeyId("fakeTokenPlaceholder") + .withLicenseModel("wbcqlk") + .withMasterUsername("ahyhxkpctusl") + .withMultiTenant(true) + .withOptionGroupName("zxrglvxvd") + .withOriginalSnapshotCreateTime(OffsetDateTime.parse("2024-10-08T03:49:38.589Z")) + .withPercentProgress(19) + .withPort(11) + .withProcessorFeatures(Arrays.asList(new ProcessorFeatureAutoGenerated().withName("sidrqdpoqaeon") + .withValue("elyxiifmhltlaxelehotutvcfcmqii"))) + .withSnapshotCreateTime(OffsetDateTime.parse("2024-10-08T03:49:38.589Z")) + .withSnapshotDatabaseTime(OffsetDateTime.parse("2024-10-08T03:49:38.589Z")) + .withSnapshotTarget("uvkzzwcpvrfjw") + .withSnapshotType("iiydwpezfwmejabymfqpelcifgzng") + .withSourceDBSnapshotIdentifier("awxakkqcvryuhqdbunoz") + .withSourceRegion("vrldyuopcfabthhgxvpnybgtfdi") + .withStatus("mwktzwjlfzywwkgrjhl") + .withStorageThroughput(1) + .withStorageType("i") + .withTagList( + Arrays.asList(new TagAutoGenerated47().withKey("fakeTokenPlaceholder").withValue("gbyocywzau"))) + .withTdeCredentialArn("fakeTokenPlaceholder") + .withTimezone("coraguclwgryiiynjhpes") + .withVpcId("fpweamshtdzkrbhcqenn")) + .withPublicCloudConnectorsResourceId("ptkmloddhzkiphtdnmdhlx") + .withAwsAccountId("gimhekqewbnatvrjiewxszwd") + .withArn("nqbzizmcdbvsukdqhrdcg") + .withPublicCloudResourceName("uoecdcxuxiu") + .withAwsSourceSchema("sfaw") + .withAwsRegion("qk") + .withAwsTags(mapOf("key7020", "fakeTokenPlaceholder"))) + .create(); + } + + // Use "Map.of" if available + @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; + } +} +``` + +### RdsDbSnapshots_Delete + +```java +/** + * Samples for RdsDbSnapshots Delete. + */ +public final class RdsDbSnapshotsDeleteSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * RdsDbSnapshots_Delete.json + */ + /** + * Sample code: RdsDbSnapshots_Delete. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void rdsDbSnapshotsDelete(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.rdsDbSnapshots() + .delete("rgrdsDBSnapshot", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE); + } +} +``` + +### RdsDbSnapshots_GetByResourceGroup + +```java +/** + * Samples for RdsDbSnapshots GetByResourceGroup. + */ +public final class RdsDbSnapshotsGetByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/RdsDbSnapshots_Get. + * json + */ + /** + * Sample code: RdsDbSnapshots_Get. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void rdsDbSnapshotsGet(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.rdsDbSnapshots() + .getByResourceGroupWithResponse("rgrdsDBSnapshot", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE); + } +} +``` + +### RdsDbSnapshots_List + +```java +/** + * Samples for RdsDbSnapshots List. + */ +public final class RdsDbSnapshotsListSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * RdsDbSnapshots_ListBySubscription.json + */ + /** + * Sample code: RdsDbSnapshots_ListBySubscription. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + rdsDbSnapshotsListBySubscription(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.rdsDbSnapshots().list(com.azure.core.util.Context.NONE); + } +} +``` + +### RdsDbSnapshots_ListByResourceGroup + +```java +/** + * Samples for RdsDbSnapshots ListByResourceGroup. + */ +public final class RdsDbSnapshotsListByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * RdsDbSnapshots_ListByResourceGroup.json + */ + /** + * Sample code: RdsDbSnapshots_ListByResourceGroup. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + rdsDbSnapshotsListByResourceGroup(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.rdsDbSnapshots().listByResourceGroup("rgrdsDBSnapshot", com.azure.core.util.Context.NONE); + } +} +``` + +### RdsDbSnapshots_Update + +```java +import com.azure.resourcemanager.awsconnector.models.RdsDBSnapshot; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for RdsDbSnapshots Update. + */ +public final class RdsDbSnapshotsUpdateSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * RdsDbSnapshots_Update.json + */ + /** + * Sample code: RdsDbSnapshots_Update. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void rdsDbSnapshotsUpdate(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + RdsDBSnapshot resource = manager.rdsDbSnapshots() + .getByResourceGroupWithResponse("rgrdsDBSnapshot", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE) + .getValue(); + resource.update().withTags(mapOf("key4303", "fakeTokenPlaceholder")).apply(); + } + + // Use "Map.of" if available + @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; + } +} +``` + +### RdsEventSubscriptions_CreateOrReplace + +```java +import com.azure.resourcemanager.awsconnector.models.AwsRdsEventSubscriptionProperties; +import com.azure.resourcemanager.awsconnector.models.RdsEventSubscriptionProperties; +import com.azure.resourcemanager.awsconnector.models.TagAutoGenerated48; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for RdsEventSubscriptions CreateOrReplace. + */ +public final class RdsEventSubscriptionsCreateOrReplaceSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * RdsEventSubscriptions_CreateOrReplace.json + */ + /** + * Sample code: RdsEventSubscriptions_CreateOrReplace. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + rdsEventSubscriptionsCreateOrReplace(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.rdsEventSubscriptions() + .define("Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])") + .withRegion("zw") + .withExistingResourceGroup("rgrdsEventSubscription") + .withTags(mapOf("key9661", "fakeTokenPlaceholder")) + .withProperties( + new RdsEventSubscriptionProperties() + .withAwsProperties(new AwsRdsEventSubscriptionProperties().withEnabled(true) + .withEventCategories(Arrays.asList("lvuizykyfm")) + .withSnsTopicArn("bztzoygofaokcwvheylcjtyhzumi") + .withSourceIds(Arrays.asList("yhyohxasdyzulieniumz")) + .withSourceType("tvb") + .withSubscriptionName("we") + .withTags(Arrays.asList( + new TagAutoGenerated48().withKey("fakeTokenPlaceholder").withValue("mfwztutpnzzxe")))) + .withPublicCloudConnectorsResourceId("iyeipvkxsknmro") + .withAwsAccountId("zfsrgkfzsvgfonnvm") + .withArn("thfrxqrzoqkdimx") + .withPublicCloudResourceName("shpjwd") + .withAwsSourceSchema("ymnxhmzxhihjztmgswvngnhiuzw") + .withAwsRegion("sxpprlqqhjuob") + .withAwsTags(mapOf("key3613", "fakeTokenPlaceholder"))) + .create(); + } + + // Use "Map.of" if available + @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; + } +} +``` + +### RdsEventSubscriptions_Delete + +```java +/** + * Samples for RdsEventSubscriptions Delete. + */ +public final class RdsEventSubscriptionsDeleteSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * RdsEventSubscriptions_Delete.json + */ + /** + * Sample code: RdsEventSubscriptions_Delete. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void rdsEventSubscriptionsDelete(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.rdsEventSubscriptions() + .delete("rgrdsEventSubscription", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE); + } +} +``` + +### RdsEventSubscriptions_GetByResourceGroup + +```java +/** + * Samples for RdsEventSubscriptions GetByResourceGroup. + */ +public final class RdsEventSubscriptionsGetByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * RdsEventSubscriptions_Get.json + */ + /** + * Sample code: RdsEventSubscriptions_Get. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void rdsEventSubscriptionsGet(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.rdsEventSubscriptions() + .getByResourceGroupWithResponse("rgrdsEventSubscription", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE); + } +} +``` + +### RdsEventSubscriptions_List + +```java +/** + * Samples for RdsEventSubscriptions List. + */ +public final class RdsEventSubscriptionsListSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * RdsEventSubscriptions_ListBySubscription.json + */ + /** + * Sample code: RdsEventSubscriptions_ListBySubscription. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + rdsEventSubscriptionsListBySubscription(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.rdsEventSubscriptions().list(com.azure.core.util.Context.NONE); + } +} +``` + +### RdsEventSubscriptions_ListByResourceGroup + +```java +/** + * Samples for RdsEventSubscriptions ListByResourceGroup. + */ +public final class RdsEventSubscriptionsListByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * RdsEventSubscriptions_ListByResourceGroup.json + */ + /** + * Sample code: RdsEventSubscriptions_ListByResourceGroup. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + rdsEventSubscriptionsListByResourceGroup(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.rdsEventSubscriptions().listByResourceGroup("rgrdsEventSubscription", com.azure.core.util.Context.NONE); + } +} +``` + +### RdsEventSubscriptions_Update + +```java +import com.azure.resourcemanager.awsconnector.models.RdsEventSubscription; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for RdsEventSubscriptions Update. + */ +public final class RdsEventSubscriptionsUpdateSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * RdsEventSubscriptions_Update.json + */ + /** + * Sample code: RdsEventSubscriptions_Update. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void rdsEventSubscriptionsUpdate(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + RdsEventSubscription resource = manager.rdsEventSubscriptions() + .getByResourceGroupWithResponse("rgrdsEventSubscription", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE) + .getValue(); + resource.update().withTags(mapOf("key3694", "fakeTokenPlaceholder")).apply(); + } + + // Use "Map.of" if available + @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; + } +} +``` + +### RdsExportTasks_CreateOrReplace + +```java +import com.azure.resourcemanager.awsconnector.models.AwsRdsExportTaskProperties; +import com.azure.resourcemanager.awsconnector.models.ExportSourceType; +import com.azure.resourcemanager.awsconnector.models.ExportSourceTypeEnumValue; +import com.azure.resourcemanager.awsconnector.models.RdsExportTaskProperties; +import java.time.OffsetDateTime; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for RdsExportTasks CreateOrReplace. + */ +public final class RdsExportTasksCreateOrReplaceSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * RdsExportTasks_CreateOrReplace.json + */ + /** + * Sample code: RdsExportTasks_CreateOrReplace. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + rdsExportTasksCreateOrReplace(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.rdsExportTasks() + .define("Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])") + .withRegion("ijwmlpipjiyjjldyoytyluf") + .withExistingResourceGroup("rgrdsExportTask") + .withTags(mapOf("key6517", "fakeTokenPlaceholder")) + .withProperties(new RdsExportTaskProperties() + .withAwsProperties( + new AwsRdsExportTaskProperties().withExportOnly(Arrays.asList("tgbwsfhgnayugsqipjaogglzrm")) + .withExportTaskIdentifier("miwmgyeweeibkjbwagqc") + .withFailureCause("mnjjuzhtylheweav") + .withIamRoleArn("fexryvrii") + .withKmsKeyId("fakeTokenPlaceholder") + .withPercentProgress(5) + .withS3Bucket("zwwzvtjvoadrnmvvidwl") + .withS3Prefix("vgo") + .withSnapshotTime(OffsetDateTime.parse("2024-10-08T03:51:37.230Z")) + .withSourceArn("mojassuswxqincuqhoonftpslnqh") + .withSourceType(new ExportSourceTypeEnumValue().withValue(ExportSourceType.CLUSTER)) + .withStatus("cjaqynzkqtyptrbwud") + .withTaskEndTime(OffsetDateTime.parse("2024-10-08T03:51:37.231Z")) + .withTaskStartTime(OffsetDateTime.parse("2024-10-08T03:51:37.231Z")) + .withTotalExtractedDataInGB(7) + .withWarningMessage("hugvgitctxgsxkvywhlldbqe")) + .withPublicCloudConnectorsResourceId("xugphqsqnlgtlne") + .withAwsAccountId("oaxdvv") + .withArn("baufqssokdhluztwcuatl") + .withPublicCloudResourceName("exprhkzxutckvlwxawcqfy") + .withAwsSourceSchema("eopblwzcihujlmoctzvwfoirhqkbx") + .withAwsRegion("bnpl") + .withAwsTags(mapOf("key353", "fakeTokenPlaceholder"))) + .create(); + } + + // Use "Map.of" if available + @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; + } +} +``` + +### RdsExportTasks_Delete + +```java +/** + * Samples for RdsExportTasks Delete. + */ +public final class RdsExportTasksDeleteSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * RdsExportTasks_Delete.json + */ + /** + * Sample code: RdsExportTasks_Delete. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void rdsExportTasksDelete(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.rdsExportTasks() + .delete("rgrdsExportTask", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE); + } +} +``` + +### RdsExportTasks_GetByResourceGroup + +```java +/** + * Samples for RdsExportTasks GetByResourceGroup. + */ +public final class RdsExportTasksGetByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/RdsExportTasks_Get. + * json + */ + /** + * Sample code: RdsExportTasks_Get. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void rdsExportTasksGet(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.rdsExportTasks() + .getByResourceGroupWithResponse("rgrdsExportTask", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE); + } +} +``` + +### RdsExportTasks_List + +```java +/** + * Samples for RdsExportTasks List. + */ +public final class RdsExportTasksListSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * RdsExportTasks_ListBySubscription.json + */ + /** + * Sample code: RdsExportTasks_ListBySubscription. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + rdsExportTasksListBySubscription(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.rdsExportTasks().list(com.azure.core.util.Context.NONE); + } +} +``` + +### RdsExportTasks_ListByResourceGroup + +```java +/** + * Samples for RdsExportTasks ListByResourceGroup. + */ +public final class RdsExportTasksListByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * RdsExportTasks_ListByResourceGroup.json + */ + /** + * Sample code: RdsExportTasks_ListByResourceGroup. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + rdsExportTasksListByResourceGroup(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.rdsExportTasks().listByResourceGroup("rgrdsExportTask", com.azure.core.util.Context.NONE); + } +} +``` + +### RdsExportTasks_Update + +```java +import com.azure.resourcemanager.awsconnector.models.RdsExportTask; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for RdsExportTasks Update. + */ +public final class RdsExportTasksUpdateSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * RdsExportTasks_Update.json + */ + /** + * Sample code: RdsExportTasks_Update. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void rdsExportTasksUpdate(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + RdsExportTask resource = manager.rdsExportTasks() + .getByResourceGroupWithResponse("rgrdsExportTask", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE) + .getValue(); + resource.update().withTags(mapOf("key8327", "fakeTokenPlaceholder")).apply(); + } + + // Use "Map.of" if available + @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; + } +} +``` + +### RedshiftClusterParameterGroups_CreateOrReplace + +```java +import com.azure.resourcemanager.awsconnector.models.AwsRedshiftClusterParameterGroupProperties; +import com.azure.resourcemanager.awsconnector.models.ParameterAutoGenerated; +import com.azure.resourcemanager.awsconnector.models.RedshiftClusterParameterGroupProperties; +import com.azure.resourcemanager.awsconnector.models.TagAutoGenerated49; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for RedshiftClusterParameterGroups CreateOrReplace. + */ +public final class RedshiftClusterParameterGroupsCreateOrReplaceSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * RedshiftClusterParameterGroups_CreateOrReplace.json + */ + /** + * Sample code: RedshiftClusterParameterGroups_CreateOrReplace. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void redshiftClusterParameterGroupsCreateOrReplace( + com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.redshiftClusterParameterGroups() + .define("Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])") + .withRegion("gskgxjliwptm") + .withExistingResourceGroup("rgredshiftClusterParameterGroup") + .withTags(mapOf("key4322", "fakeTokenPlaceholder")) + .withProperties(new RedshiftClusterParameterGroupProperties() + .withAwsProperties(new AwsRedshiftClusterParameterGroupProperties().withDescription("gvl") + .withParameterGroupFamily("bbhnqerzrhqtinntphvuim") + .withParameterGroupName("tiqxhqigpmuckmnpgijvnpwzb") + .withParameters(Arrays.asList(new ParameterAutoGenerated().withParameterName("jxeucnajvjzv") + .withParameterValue("ubxmwmoxeslbruenu"))) + .withTags( + Arrays.asList(new TagAutoGenerated49().withKey("fakeTokenPlaceholder").withValue("qpznlj")))) + .withPublicCloudConnectorsResourceId("nrs") + .withAwsAccountId("fdljzalgig") + .withArn("whliokkrefhwytv") + .withPublicCloudResourceName("xnrwtxesebdfzrqiamebczhoyjbqeq") + .withAwsSourceSchema("nkdbqnqvsdnvogwatfxlubppr") + .withAwsRegion("wrhyhrmwhdmlnjjbrl") + .withAwsTags(mapOf("key6090", "fakeTokenPlaceholder"))) + .create(); + } + + // Use "Map.of" if available + @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; + } +} +``` + +### RedshiftClusterParameterGroups_Delete + +```java +/** + * Samples for RedshiftClusterParameterGroups Delete. + */ +public final class RedshiftClusterParameterGroupsDeleteSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * RedshiftClusterParameterGroups_Delete.json + */ + /** + * Sample code: RedshiftClusterParameterGroups_Delete. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + redshiftClusterParameterGroupsDelete(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.redshiftClusterParameterGroups() + .delete("rgredshiftClusterParameterGroup", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE); + } +} +``` + +### RedshiftClusterParameterGroups_GetByResourceGroup + +```java +/** + * Samples for RedshiftClusterParameterGroups GetByResourceGroup. + */ +public final class RedshiftClusterParameterGroupsGetByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * RedshiftClusterParameterGroups_Get.json + */ + /** + * Sample code: RedshiftClusterParameterGroups_Get. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + redshiftClusterParameterGroupsGet(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.redshiftClusterParameterGroups() + .getByResourceGroupWithResponse("rgredshiftClusterParameterGroup", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE); + } +} +``` + +### RedshiftClusterParameterGroups_List + +```java +/** + * Samples for RedshiftClusterParameterGroups List. + */ +public final class RedshiftClusterParameterGroupsListSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * RedshiftClusterParameterGroups_ListBySubscription.json + */ + /** + * Sample code: RedshiftClusterParameterGroups_ListBySubscription. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void redshiftClusterParameterGroupsListBySubscription( + com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.redshiftClusterParameterGroups().list(com.azure.core.util.Context.NONE); + } +} +``` + +### RedshiftClusterParameterGroups_ListByResourceGroup + +```java +/** + * Samples for RedshiftClusterParameterGroups ListByResourceGroup. + */ +public final class RedshiftClusterParameterGroupsListByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * RedshiftClusterParameterGroups_ListByResourceGroup.json + */ + /** + * Sample code: RedshiftClusterParameterGroups_ListByResourceGroup. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void redshiftClusterParameterGroupsListByResourceGroup( + com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.redshiftClusterParameterGroups() + .listByResourceGroup("rgredshiftClusterParameterGroup", com.azure.core.util.Context.NONE); + } +} +``` + +### RedshiftClusterParameterGroups_Update + +```java +import com.azure.resourcemanager.awsconnector.models.RedshiftClusterParameterGroup; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for RedshiftClusterParameterGroups Update. + */ +public final class RedshiftClusterParameterGroupsUpdateSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * RedshiftClusterParameterGroups_Update.json + */ + /** + * Sample code: RedshiftClusterParameterGroups_Update. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + redshiftClusterParameterGroupsUpdate(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + RedshiftClusterParameterGroup resource = manager.redshiftClusterParameterGroups() + .getByResourceGroupWithResponse("rgredshiftClusterParameterGroup", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE) + .getValue(); + resource.update().withTags(mapOf("key900", "fakeTokenPlaceholder")).apply(); + } + + // Use "Map.of" if available + @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; + } +} +``` + +### RedshiftClusters_CreateOrReplace + +```java +import com.azure.resourcemanager.awsconnector.models.AwsRedshiftClusterProperties; +import com.azure.resourcemanager.awsconnector.models.EndpointAutoGenerated3; +import com.azure.resourcemanager.awsconnector.models.LoggingProperties; +import com.azure.resourcemanager.awsconnector.models.RedshiftClusterProperties; +import com.azure.resourcemanager.awsconnector.models.Tag; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for RedshiftClusters CreateOrReplace. + */ +public final class RedshiftClustersCreateOrReplaceSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * RedshiftClusters_CreateOrReplace.json + */ + /** + * Sample code: RedshiftClusters_CreateOrReplace. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + redshiftClustersCreateOrReplace(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.redshiftClusters() + .define("Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])") + .withRegion("jvkejlkfwoynldopbqhnt") + .withExistingResourceGroup("rgredshiftCluster") + .withTags(mapOf("key5296", "fakeTokenPlaceholder")) + .withProperties( + new RedshiftClusterProperties() + .withAwsProperties(new AwsRedshiftClusterProperties().withAllowVersionUpgrade(true) + .withAquaConfigurationStatus("tegpcduavwdyuubx") + .withAutomatedSnapshotRetentionPeriod(25) + .withAvailabilityZone("pltpsjmmvhfmsecqjjweuxgloitbor") + .withAvailabilityZoneRelocation(true) + .withAvailabilityZoneRelocationStatus("kcuxuluzsnuoag") + .withClassic(true) + .withClusterIdentifier("cxlflpabmavbfbcvsew") + .withClusterNamespaceArn("vqeqeacmkdhmzgwd") + .withClusterParameterGroupName("whpcckoms") + .withClusterSecurityGroups(Arrays.asList("q")) + .withClusterSubnetGroupName("abxmcpkzazgxtuoliedvam") + .withClusterType("nvbzlybkkhuyklhhywuofwczf") + .withClusterVersion("slmurdmhpiuakdwrqdthvlrpovqb") + .withDbName("jsbtuqgydkydraogl") + .withDeferMaintenance(true) + .withDeferMaintenanceDuration(14) + .withDeferMaintenanceEndTime("oluxv") + .withDeferMaintenanceIdentifier("icu") + .withDeferMaintenanceStartTime("muevcssxlqrrmwxvazpsrq") + .withDestinationRegion("cnklawqwbweklmlrhr") + .withElasticIp("ljpfzxzciavjuxk") + .withEncrypted(true) + .withEndpoint( + new EndpointAutoGenerated3().withAddress("imgtktlniedocmgatpyzycge").withPort("gm")) + .withEnhancedVpcRouting(true) + .withHsmClientCertificateIdentifier("uguhqzduujaf") + .withHsmConfigurationIdentifier("cznipmuxibdjvmteim") + .withIamRoles(Arrays.asList("qmy")) + .withKmsKeyId("fakeTokenPlaceholder") + .withLoggingProperties(new LoggingProperties().withBucketName("mozpscmusdfzk") + .withS3KeyPrefix("fakeTokenPlaceholder")) + .withMaintenanceTrackName("etjeimmqcipuyxiobrnsnd") + .withManageMasterPassword(true) + .withManualSnapshotRetentionPeriod(15) + .withMasterPasswordSecretArn("fakeTokenPlaceholder") + .withMasterPasswordSecretKmsKeyId("fakeTokenPlaceholder") + .withMasterUserPassword("fakeTokenPlaceholder") + .withMasterUsername("wleeglygnhojusagxryuk") + .withMultiAZ(true) + .withNodeType("cudgc") + .withNumberOfNodes(23) + .withOwnerAccount("drvv") + .withPort(8) + .withPreferredMaintenanceWindow("xpuhqwidzbn") + .withPubliclyAccessible(true) + .withResourceAction("nyhkwgrtf") + .withRevisionTarget("dreawjciiytkiuywtwttqyhojh") + .withRotateEncryptionKey(true) + .withSnapshotClusterIdentifier("gu") + .withSnapshotCopyGrantName("mwuomnttvwhduluhwnfkiwkaeztbmd") + .withSnapshotCopyManual(true) + .withSnapshotCopyRetentionPeriod(2) + .withSnapshotIdentifier("viproibmlhehvlszhxkqbbgl") + .withTags( + Arrays.asList(new Tag().withKey("fakeTokenPlaceholder").withValue("zawcpsgqfgrsjexrbo"))) + .withVpcSecurityGroupIds(Arrays.asList("grbkothiifmuwwrme"))) + .withPublicCloudConnectorsResourceId("r") + .withAwsAccountId("lnlhkk") + .withArn("egooffvtlbzyvp") + .withPublicCloudResourceName("ck") + .withAwsSourceSchema("zdadxraykcjparteiye") + .withAwsRegion("lablaxpspbxzhnbsrqz") + .withAwsTags(mapOf("key9665", "fakeTokenPlaceholder"))) + .create(); + } + + // Use "Map.of" if available + @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; + } +} +``` + +### RedshiftClusters_Delete + +```java +/** + * Samples for RedshiftClusters Delete. + */ +public final class RedshiftClustersDeleteSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * RedshiftClusters_Delete.json + */ + /** + * Sample code: RedshiftClusters_Delete. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void redshiftClustersDelete(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.redshiftClusters() + .delete("rgredshiftCluster", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE); + } +} +``` + +### RedshiftClusters_GetByResourceGroup + +```java +/** + * Samples for RedshiftClusters GetByResourceGroup. + */ +public final class RedshiftClustersGetByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * RedshiftClusters_Get.json + */ + /** + * Sample code: RedshiftClusters_Get. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void redshiftClustersGet(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.redshiftClusters() + .getByResourceGroupWithResponse("rgredshiftCluster", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE); + } +} +``` + +### RedshiftClusters_List + +```java +/** + * Samples for RedshiftClusters List. + */ +public final class RedshiftClustersListSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * RedshiftClusters_ListBySubscription.json + */ + /** + * Sample code: RedshiftClusters_ListBySubscription. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + redshiftClustersListBySubscription(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.redshiftClusters().list(com.azure.core.util.Context.NONE); + } +} +``` + +### RedshiftClusters_ListByResourceGroup + +```java +/** + * Samples for RedshiftClusters ListByResourceGroup. + */ +public final class RedshiftClustersListByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * RedshiftClusters_ListByResourceGroup.json + */ + /** + * Sample code: RedshiftClusters_ListByResourceGroup. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + redshiftClustersListByResourceGroup(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.redshiftClusters().listByResourceGroup("rgredshiftCluster", com.azure.core.util.Context.NONE); + } +} +``` + +### RedshiftClusters_Update + +```java +import com.azure.resourcemanager.awsconnector.models.RedshiftCluster; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for RedshiftClusters Update. + */ +public final class RedshiftClustersUpdateSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * RedshiftClusters_Update.json + */ + /** + * Sample code: RedshiftClusters_Update. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void redshiftClustersUpdate(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + RedshiftCluster resource = manager.redshiftClusters() + .getByResourceGroupWithResponse("rgredshiftCluster", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE) + .getValue(); + resource.update().withTags(mapOf("key9218", "fakeTokenPlaceholder")).apply(); + } + + // Use "Map.of" if available + @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; + } +} +``` + +### Route53DomainsDomainSummaries_CreateOrReplace + +```java +import com.azure.resourcemanager.awsconnector.models.AwsRoute53DomainsDomainSummaryProperties; +import com.azure.resourcemanager.awsconnector.models.Route53DomainsDomainSummaryProperties; +import java.time.OffsetDateTime; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for Route53DomainsDomainSummaries CreateOrReplace. + */ +public final class Route53DomainsDomainSummariesCreateOrReplaceSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * Route53DomainsDomainSummaries_CreateOrReplace.json + */ + /** + * Sample code: Route53DomainsDomainSummaries_CreateOrReplace. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void route53DomainsDomainSummariesCreateOrReplace( + com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.route53DomainsDomainSummaries() + .define("Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])") + .withRegion("yuzdde") + .withExistingResourceGroup("rgroute53DomainsDomainSummary") + .withTags(mapOf("key9394", "fakeTokenPlaceholder")) + .withProperties(new Route53DomainsDomainSummaryProperties() + .withAwsProperties(new AwsRoute53DomainsDomainSummaryProperties().withAutoRenew(true) + .withDomainName("zvofrrcpsq") + .withExpiry(OffsetDateTime.parse("2024-10-08T03:54:06.143Z")) + .withTransferLock(true)) + .withPublicCloudConnectorsResourceId("xghzjqidhyawkmjgmcylp") + .withAwsAccountId("vcuytljgzjlxqbqafyjyotrm") + .withArn("wrwdlajgtnvqtehqwjewdams") + .withPublicCloudResourceName("l") + .withAwsSourceSchema("tmisqqzyhunvwrvagqsndin") + .withAwsRegion("kfqnxegwwlydcxbrps") + .withAwsTags(mapOf("key3432", "fakeTokenPlaceholder"))) + .create(); + } + + // Use "Map.of" if available + @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; + } +} +``` + +### Route53DomainsDomainSummaries_Delete + +```java +/** + * Samples for Route53DomainsDomainSummaries Delete. + */ +public final class Route53DomainsDomainSummariesDeleteSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * Route53DomainsDomainSummaries_Delete.json + */ + /** + * Sample code: Route53DomainsDomainSummaries_Delete. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + route53DomainsDomainSummariesDelete(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.route53DomainsDomainSummaries() + .delete("rgroute53DomainsDomainSummary", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE); + } +} +``` + +### Route53DomainsDomainSummaries_GetByResourceGroup + +```java +/** + * Samples for Route53DomainsDomainSummaries GetByResourceGroup. + */ +public final class Route53DomainsDomainSummariesGetByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * Route53DomainsDomainSummaries_Get.json + */ + /** + * Sample code: Route53DomainsDomainSummaries_Get. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + route53DomainsDomainSummariesGet(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.route53DomainsDomainSummaries() + .getByResourceGroupWithResponse("rgroute53DomainsDomainSummary", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE); + } +} +``` + +### Route53DomainsDomainSummaries_List + +```java +/** + * Samples for Route53DomainsDomainSummaries List. + */ +public final class Route53DomainsDomainSummariesListSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * Route53DomainsDomainSummaries_ListBySubscription.json + */ + /** + * Sample code: Route53DomainsDomainSummaries_ListBySubscription. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void route53DomainsDomainSummariesListBySubscription( + com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.route53DomainsDomainSummaries().list(com.azure.core.util.Context.NONE); + } +} +``` + +### Route53DomainsDomainSummaries_ListByResourceGroup + +```java +/** + * Samples for Route53DomainsDomainSummaries ListByResourceGroup. + */ +public final class Route53DomainsDomainSummariesListByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * Route53DomainsDomainSummaries_ListByResourceGroup.json + */ + /** + * Sample code: Route53DomainsDomainSummaries_ListByResourceGroup. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void route53DomainsDomainSummariesListByResourceGroup( + com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.route53DomainsDomainSummaries() + .listByResourceGroup("rgroute53DomainsDomainSummary", com.azure.core.util.Context.NONE); + } +} +``` + +### Route53DomainsDomainSummaries_Update + +```java +import com.azure.resourcemanager.awsconnector.models.Route53DomainsDomainSummary; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for Route53DomainsDomainSummaries Update. + */ +public final class Route53DomainsDomainSummariesUpdateSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * Route53DomainsDomainSummaries_Update.json + */ + /** + * Sample code: Route53DomainsDomainSummaries_Update. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + route53DomainsDomainSummariesUpdate(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + Route53DomainsDomainSummary resource = manager.route53DomainsDomainSummaries() + .getByResourceGroupWithResponse("rgroute53DomainsDomainSummary", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE) + .getValue(); + resource.update().withTags(mapOf("key8975", "fakeTokenPlaceholder")).apply(); + } + + // Use "Map.of" if available + @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; + } +} +``` + +### Route53HostedZones_CreateOrReplace + +```java +import com.azure.resourcemanager.awsconnector.models.AwsRoute53HostedZoneProperties; +import com.azure.resourcemanager.awsconnector.models.HostedZoneConfig; +import com.azure.resourcemanager.awsconnector.models.HostedZoneTag; +import com.azure.resourcemanager.awsconnector.models.QueryLoggingConfig; +import com.azure.resourcemanager.awsconnector.models.Route53HostedZoneProperties; +import com.azure.resourcemanager.awsconnector.models.Vpc; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for Route53HostedZones CreateOrReplace. + */ +public final class Route53HostedZonesCreateOrReplaceSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * Route53HostedZones_CreateOrReplace.json + */ + /** + * Sample code: Route53HostedZones_CreateOrReplace. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + route53HostedZonesCreateOrReplace(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.route53HostedZones() + .define("Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])") + .withRegion("fohhkmxasqynkojwigmrzyhydfpdrd") + .withExistingResourceGroup("rgroute53HostedZone") + .withTags(mapOf("key8226", "fakeTokenPlaceholder")) + .withProperties( + new Route53HostedZoneProperties() + .withAwsProperties(new AwsRoute53HostedZoneProperties() + .withHostedZoneConfig(new HostedZoneConfig().withComment("vanhfd")) + .withHostedZoneTags(Arrays.asList( + new HostedZoneTag().withKey("fakeTokenPlaceholder").withValue("ptsrmgayfujrfvjwyxoi"))) + .withId("dwezucqqxsyhynebuyflyc") + .withName("koqhelfps") + .withNameServers(Arrays.asList("qizlbjltglpbdpxcsriu")) + .withQueryLoggingConfig( + new QueryLoggingConfig().withCloudWatchLogsLogGroupArn("magynetpgpdveymgnonjicfoxzxfp")) + .withVpCs(Arrays.asList(new Vpc().withVpcId("nxfxsb").withVpcRegion("y")))) + .withPublicCloudConnectorsResourceId("qugbrritrvssrcwtib") + .withAwsAccountId("rcvmulzibfebvzgooms") + .withArn("vohjyzjtvd") + .withPublicCloudResourceName("edufxpyvryjxbnwulifcrwuezu") + .withAwsSourceSchema("a") + .withAwsRegion("nthjzqxrrqsducmjudhrcdiqioy") + .withAwsTags(mapOf("key625", "fakeTokenPlaceholder"))) + .create(); + } + + // Use "Map.of" if available + @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; + } +} +``` + +### Route53HostedZones_Delete + +```java +/** + * Samples for Route53HostedZones Delete. + */ +public final class Route53HostedZonesDeleteSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * Route53HostedZones_Delete.json + */ + /** + * Sample code: Route53HostedZones_Delete. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void route53HostedZonesDelete(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.route53HostedZones() + .delete("rgroute53HostedZone", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE); + } +} +``` + +### Route53HostedZones_GetByResourceGroup + +```java +/** + * Samples for Route53HostedZones GetByResourceGroup. + */ +public final class Route53HostedZonesGetByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * Route53HostedZones_Get.json + */ + /** + * Sample code: Route53HostedZones_Get. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void route53HostedZonesGet(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.route53HostedZones() + .getByResourceGroupWithResponse("rgroute53HostedZone", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE); + } +} +``` + +### Route53HostedZones_List + +```java +/** + * Samples for Route53HostedZones List. + */ +public final class Route53HostedZonesListSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * Route53HostedZones_ListBySubscription.json + */ + /** + * Sample code: Route53HostedZones_ListBySubscription. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + route53HostedZonesListBySubscription(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.route53HostedZones().list(com.azure.core.util.Context.NONE); + } +} +``` + +### Route53HostedZones_ListByResourceGroup + +```java +/** + * Samples for Route53HostedZones ListByResourceGroup. + */ +public final class Route53HostedZonesListByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * Route53HostedZones_ListByResourceGroup.json + */ + /** + * Sample code: Route53HostedZones_ListByResourceGroup. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + route53HostedZonesListByResourceGroup(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.route53HostedZones().listByResourceGroup("rgroute53HostedZone", com.azure.core.util.Context.NONE); + } +} +``` + +### Route53HostedZones_Update + +```java +import com.azure.resourcemanager.awsconnector.models.Route53HostedZone; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for Route53HostedZones Update. + */ +public final class Route53HostedZonesUpdateSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * Route53HostedZones_Update.json + */ + /** + * Sample code: Route53HostedZones_Update. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void route53HostedZonesUpdate(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + Route53HostedZone resource = manager.route53HostedZones() + .getByResourceGroupWithResponse("rgroute53HostedZone", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE) + .getValue(); + resource.update().withTags(mapOf("key8195", "fakeTokenPlaceholder")).apply(); + } + + // Use "Map.of" if available + @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; + } +} +``` + +### Route53ResourceRecordSets_CreateOrReplace + +```java +import com.azure.resourcemanager.awsconnector.models.AliasTarget; +import com.azure.resourcemanager.awsconnector.models.AwsRoute53ResourceRecordSetProperties; +import com.azure.resourcemanager.awsconnector.models.CidrRoutingConfig; +import com.azure.resourcemanager.awsconnector.models.Coordinates; +import com.azure.resourcemanager.awsconnector.models.GeoLocation; +import com.azure.resourcemanager.awsconnector.models.GeoProximityLocation; +import com.azure.resourcemanager.awsconnector.models.RRType; +import com.azure.resourcemanager.awsconnector.models.RRTypeEnumValue; +import com.azure.resourcemanager.awsconnector.models.ResourceRecord; +import com.azure.resourcemanager.awsconnector.models.ResourceRecordSetFailover; +import com.azure.resourcemanager.awsconnector.models.ResourceRecordSetFailoverEnumValue; +import com.azure.resourcemanager.awsconnector.models.ResourceRecordSetRegion; +import com.azure.resourcemanager.awsconnector.models.ResourceRecordSetRegionEnumValue; +import com.azure.resourcemanager.awsconnector.models.Route53ResourceRecordSetProperties; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for Route53ResourceRecordSets CreateOrReplace. + */ +public final class Route53ResourceRecordSetsCreateOrReplaceSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * Route53ResourceRecordSets_CreateOrReplace.json + */ + /** + * Sample code: Route53ResourceRecordSets_CreateOrReplace. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + route53ResourceRecordSetsCreateOrReplace(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.route53ResourceRecordSets() + .define("Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])") + .withRegion("fjdvlwthtamvmempnqmew") + .withExistingResourceGroup("rgroute53ResourceRecordSet") + .withTags(mapOf("key3468", "fakeTokenPlaceholder")) + .withProperties(new Route53ResourceRecordSetProperties() + .withAwsProperties(new AwsRoute53ResourceRecordSetProperties() + .withAliasTarget(new AliasTarget().withDnsName("waeiyiiaifbfgjkifiehgpvdssxp") + .withEvaluateTargetHealth(true) + .withHostedZoneId("hyjpvho")) + .withCidrRoutingConfig( + new CidrRoutingConfig().withCollectionId("yzvizqbgbmivdawr").withLocationName("ajghwvabvx")) + .withFailover(new ResourceRecordSetFailoverEnumValue().withValue(ResourceRecordSetFailover.PRIMARY)) + .withGeoLocation(new GeoLocation().withContinentCode("fakeTokenPlaceholder") + .withCountryCode("fakeTokenPlaceholder") + .withSubdivisionCode("fakeTokenPlaceholder")) + .withGeoProximityLocation(new GeoProximityLocation().withAwsRegion("ughqvzy") + .withBias(15) + .withCoordinates(new Coordinates().withLatitude("eijexao").withLongitude("krewjxmtnbo")) + .withLocalZoneGroup("ksejwbcwmouldiasoybmm")) + .withHealthCheckId("tz") + .withMultiValueAnswer(true) + .withName("tmjfllnntbaiyvbzzfivmhgyj") + .withRegion(new ResourceRecordSetRegionEnumValue().withValue(ResourceRecordSetRegion.AF_SOUTH_1)) + .withResourceRecords(Arrays.asList(new ResourceRecord().withValue("joiqyrlrpntv"))) + .withSetIdentifier("rmgriiqkzi") + .withTtl(18L) + .withTrafficPolicyInstanceId("nttbthvurnpsjgshknlxpamzymcgno") + .withType(new RRTypeEnumValue().withValue(RRType.A)) + .withWeight(16L)) + .withPublicCloudConnectorsResourceId("xglniymkrzvonhdikhhxue") + .withAwsAccountId("ktpknwetzcdkadwzokqsphnw") + .withArn("bvuvtjvkmzr") + .withPublicCloudResourceName("xctgrwojlyvrzlx") + .withAwsSourceSchema("w") + .withAwsRegion("bccacstjducrajieglqbivvq") + .withAwsTags(mapOf("key1343", "fakeTokenPlaceholder"))) + .create(); + } + + // Use "Map.of" if available + @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; + } +} +``` + +### Route53ResourceRecordSets_Delete + +```java +/** + * Samples for Route53ResourceRecordSets Delete. + */ +public final class Route53ResourceRecordSetsDeleteSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * Route53ResourceRecordSets_Delete.json + */ + /** + * Sample code: Route53ResourceRecordSets_Delete. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + route53ResourceRecordSetsDelete(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.route53ResourceRecordSets() + .delete("rgroute53ResourceRecordSet", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE); + } +} +``` + +### Route53ResourceRecordSets_GetByResourceGroup + +```java +/** + * Samples for Route53ResourceRecordSets GetByResourceGroup. + */ +public final class Route53ResourceRecordSetsGetByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * Route53ResourceRecordSets_Get.json + */ + /** + * Sample code: Route53ResourceRecordSets_Get. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + route53ResourceRecordSetsGet(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.route53ResourceRecordSets() + .getByResourceGroupWithResponse("rgroute53ResourceRecordSet", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE); + } +} +``` + +### Route53ResourceRecordSets_List + +```java +/** + * Samples for Route53ResourceRecordSets List. + */ +public final class Route53ResourceRecordSetsListSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * Route53ResourceRecordSets_ListBySubscription.json + */ + /** + * Sample code: Route53ResourceRecordSets_ListBySubscription. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void route53ResourceRecordSetsListBySubscription( + com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.route53ResourceRecordSets().list(com.azure.core.util.Context.NONE); + } +} +``` + +### Route53ResourceRecordSets_ListByResourceGroup + +```java +/** + * Samples for Route53ResourceRecordSets ListByResourceGroup. + */ +public final class Route53ResourceRecordSetsListByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * Route53ResourceRecordSets_ListByResourceGroup.json + */ + /** + * Sample code: Route53ResourceRecordSets_ListByResourceGroup. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void route53ResourceRecordSetsListByResourceGroup( + com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.route53ResourceRecordSets() + .listByResourceGroup("rgroute53ResourceRecordSet", com.azure.core.util.Context.NONE); + } +} +``` + +### Route53ResourceRecordSets_Update + +```java +import com.azure.resourcemanager.awsconnector.models.Route53ResourceRecordSet; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for Route53ResourceRecordSets Update. + */ +public final class Route53ResourceRecordSetsUpdateSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * Route53ResourceRecordSets_Update.json + */ + /** + * Sample code: Route53ResourceRecordSets_Update. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + route53ResourceRecordSetsUpdate(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + Route53ResourceRecordSet resource = manager.route53ResourceRecordSets() + .getByResourceGroupWithResponse("rgroute53ResourceRecordSet", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE) + .getValue(); + resource.update().withTags(mapOf("key3023", "fakeTokenPlaceholder")).apply(); + } + + // Use "Map.of" if available + @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; + } +} +``` + +### S3AccessPoints_CreateOrReplace + +```java +import com.azure.resourcemanager.awsconnector.models.AwsS3AccessPointProperties; +import com.azure.resourcemanager.awsconnector.models.NetworkOrigin; +import com.azure.resourcemanager.awsconnector.models.PublicAccessBlockConfiguration; +import com.azure.resourcemanager.awsconnector.models.S3AccessPointProperties; +import com.azure.resourcemanager.awsconnector.models.VpcConfiguration; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for S3AccessPoints CreateOrReplace. + */ +public final class S3AccessPointsCreateOrReplaceSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * S3AccessPoints_CreateOrReplace.json + */ + /** + * Sample code: S3AccessPoints_CreateOrReplace. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + s3AccessPointsCreateOrReplace(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.s3AccessPoints() + .define("Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])") + .withRegion("azmnzomeh") + .withExistingResourceGroup("rgs3AccessPoint") + .withTags(mapOf("key2363", "fakeTokenPlaceholder")) + .withProperties(new S3AccessPointProperties() + .withAwsProperties(new AwsS3AccessPointProperties().withAlias("sv") + .withArn("sizkkllnnrgdfkaov") + .withBucket("hsqprhqjtcqrizzbhao") + .withBucketAccountId("bmjnxdssnshenybwnws") + .withName("ve") + .withNetworkOrigin(NetworkOrigin.INTERNET) + .withPublicAccessBlockConfiguration(new PublicAccessBlockConfiguration().withBlockPublicAcls(true) + .withBlockPublicPolicy(true) + .withIgnorePublicAcls(true) + .withRestrictPublicBuckets(true)) + .withVpcConfiguration(new VpcConfiguration().withVpcId("hhzyvprnlxearagzmfsg"))) + .withPublicCloudConnectorsResourceId("ixhnqrsogifbzagpdzakwjxqlt") + .withAwsAccountId("rqzqzkncomjg") + .withArn("dputejthukqrofpuygrkatazvamcge") + .withPublicCloudResourceName("swojnpzcxwqfvhrikxhgu") + .withAwsSourceSchema("utriogwvkzanqypvldgboyemujg") + .withAwsRegion("elrkktihogsptpwwazywnyyzs") + .withAwsTags(mapOf("key2658", "fakeTokenPlaceholder"))) + .create(); + } + + // Use "Map.of" if available + @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; + } +} +``` + +### S3AccessPoints_Delete + +```java +/** + * Samples for S3AccessPoints Delete. + */ +public final class S3AccessPointsDeleteSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * S3AccessPoints_Delete.json + */ + /** + * Sample code: S3AccessPoints_Delete. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void s3AccessPointsDelete(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.s3AccessPoints() + .delete("rgs3AccessPoint", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE); + } +} +``` + +### S3AccessPoints_GetByResourceGroup + +```java +/** + * Samples for S3AccessPoints GetByResourceGroup. + */ +public final class S3AccessPointsGetByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/S3AccessPoints_Get. + * json + */ + /** + * Sample code: S3AccessPoints_Get. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void s3AccessPointsGet(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.s3AccessPoints() + .getByResourceGroupWithResponse("rgs3AccessPoint", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE); + } +} +``` + +### S3AccessPoints_List + +```java +/** + * Samples for S3AccessPoints List. + */ +public final class S3AccessPointsListSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * S3AccessPoints_ListBySubscription.json + */ + /** + * Sample code: S3AccessPoints_ListBySubscription. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + s3AccessPointsListBySubscription(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.s3AccessPoints().list(com.azure.core.util.Context.NONE); + } +} +``` + +### S3AccessPoints_ListByResourceGroup + +```java +/** + * Samples for S3AccessPoints ListByResourceGroup. + */ +public final class S3AccessPointsListByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * S3AccessPoints_ListByResourceGroup.json + */ + /** + * Sample code: S3AccessPoints_ListByResourceGroup. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + s3AccessPointsListByResourceGroup(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.s3AccessPoints().listByResourceGroup("rgs3AccessPoint", com.azure.core.util.Context.NONE); + } +} +``` + +### S3AccessPoints_Update + +```java +import com.azure.resourcemanager.awsconnector.models.S3AccessPoint; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for S3AccessPoints Update. + */ +public final class S3AccessPointsUpdateSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * S3AccessPoints_Update.json + */ + /** + * Sample code: S3AccessPoints_Update. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void s3AccessPointsUpdate(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + S3AccessPoint resource = manager.s3AccessPoints() + .getByResourceGroupWithResponse("rgs3AccessPoint", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE) + .getValue(); + resource.update().withTags(mapOf("key1063", "fakeTokenPlaceholder")).apply(); + } + + // Use "Map.of" if available + @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; + } +} +``` + +### S3BucketPolicies_CreateOrReplace + +```java +import com.azure.resourcemanager.awsconnector.models.AwsS3BucketPolicyProperties; +import com.azure.resourcemanager.awsconnector.models.S3BucketPolicyProperties; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for S3BucketPolicies CreateOrReplace. + */ +public final class S3BucketPoliciesCreateOrReplaceSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * S3BucketPolicies_CreateOrReplace.json + */ + /** + * Sample code: S3BucketPolicies_CreateOrReplace. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + s3BucketPoliciesCreateOrReplace(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.s3BucketPolicies() + .define("Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])") + .withRegion("hsbqwwdspecsoigxusdbqgilaa") + .withExistingResourceGroup("rgs3BucketPolicy") + .withTags(mapOf("key9799", "fakeTokenPlaceholder")) + .withProperties(new S3BucketPolicyProperties() + .withAwsProperties(new AwsS3BucketPolicyProperties().withPolicy("fifgvjoxnidoedtzm")) + .withPublicCloudConnectorsResourceId("n") + .withAwsAccountId("czyyfhht") + .withArn("ebpwjamccadznftkixikeutdjacadm") + .withPublicCloudResourceName("suksqtvhtayjy") + .withAwsSourceSchema("wdyfvmrsshlyadt") + .withAwsRegion("mlepmxnkxjgtrqhtbaaoxuaj") + .withAwsTags(mapOf("key5637", "fakeTokenPlaceholder"))) + .create(); + } + + // Use "Map.of" if available + @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; + } +} +``` + +### S3BucketPolicies_Delete + +```java +/** + * Samples for S3BucketPolicies Delete. + */ +public final class S3BucketPoliciesDeleteSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * S3BucketPolicies_Delete.json + */ + /** + * Sample code: S3BucketPolicies_Delete. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void s3BucketPoliciesDelete(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.s3BucketPolicies() + .delete("rgs3BucketPolicy", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE); + } +} +``` + +### S3BucketPolicies_GetByResourceGroup + +```java +/** + * Samples for S3BucketPolicies GetByResourceGroup. + */ +public final class S3BucketPoliciesGetByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * S3BucketPolicies_Get.json + */ + /** + * Sample code: S3BucketPolicies_Get. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void s3BucketPoliciesGet(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.s3BucketPolicies() + .getByResourceGroupWithResponse("rgs3BucketPolicy", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE); + } +} +``` + +### S3BucketPolicies_List + +```java +/** + * Samples for S3BucketPolicies List. + */ +public final class S3BucketPoliciesListSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * S3BucketPolicies_ListBySubscription.json + */ + /** + * Sample code: S3BucketPolicies_ListBySubscription. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + s3BucketPoliciesListBySubscription(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.s3BucketPolicies().list(com.azure.core.util.Context.NONE); + } +} +``` + +### S3BucketPolicies_ListByResourceGroup + +```java +/** + * Samples for S3BucketPolicies ListByResourceGroup. + */ +public final class S3BucketPoliciesListByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * S3BucketPolicies_ListByResourceGroup.json + */ + /** + * Sample code: S3BucketPolicies_ListByResourceGroup. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + s3BucketPoliciesListByResourceGroup(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.s3BucketPolicies().listByResourceGroup("rgs3BucketPolicy", com.azure.core.util.Context.NONE); + } +} +``` + +### S3BucketPolicies_Update + +```java +import com.azure.resourcemanager.awsconnector.models.S3BucketPolicy; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for S3BucketPolicies Update. + */ +public final class S3BucketPoliciesUpdateSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * S3BucketPolicies_Update.json + */ + /** + * Sample code: S3BucketPolicies_Update. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void s3BucketPoliciesUpdate(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + S3BucketPolicy resource = manager.s3BucketPolicies() + .getByResourceGroupWithResponse("rgs3BucketPolicy", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE) + .getValue(); + resource.update().withTags(mapOf("key3408", "fakeTokenPlaceholder")).apply(); + } + + // Use "Map.of" if available + @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; + } +} +``` + +### S3Buckets_CreateOrReplace + +```java +import com.azure.resourcemanager.awsconnector.models.AbortIncompleteMultipartUpload; +import com.azure.resourcemanager.awsconnector.models.AccelerateConfiguration; +import com.azure.resourcemanager.awsconnector.models.AccelerateConfigurationAccelerationStatus; +import com.azure.resourcemanager.awsconnector.models.AccessControl; +import com.azure.resourcemanager.awsconnector.models.AccessControlTranslation; +import com.azure.resourcemanager.awsconnector.models.AnalyticsConfiguration; +import com.azure.resourcemanager.awsconnector.models.AwsS3BucketProperties; +import com.azure.resourcemanager.awsconnector.models.BucketEncryption; +import com.azure.resourcemanager.awsconnector.models.CorsConfiguration; +import com.azure.resourcemanager.awsconnector.models.CorsRule; +import com.azure.resourcemanager.awsconnector.models.CorsRuleAllowedMethods; +import com.azure.resourcemanager.awsconnector.models.DataExport; +import com.azure.resourcemanager.awsconnector.models.DefaultRetention; +import com.azure.resourcemanager.awsconnector.models.DefaultRetentionMode; +import com.azure.resourcemanager.awsconnector.models.DeleteMarkerReplication; +import com.azure.resourcemanager.awsconnector.models.DeleteMarkerReplicationStatus; +import com.azure.resourcemanager.awsconnector.models.Destination; +import com.azure.resourcemanager.awsconnector.models.DestinationFormat; +import com.azure.resourcemanager.awsconnector.models.EncryptionConfigurationAutoGenerated; +import com.azure.resourcemanager.awsconnector.models.EventBridgeConfiguration; +import com.azure.resourcemanager.awsconnector.models.FilterRule; +import com.azure.resourcemanager.awsconnector.models.IntelligentTieringConfiguration; +import com.azure.resourcemanager.awsconnector.models.IntelligentTieringConfigurationStatus; +import com.azure.resourcemanager.awsconnector.models.InventoryConfiguration; +import com.azure.resourcemanager.awsconnector.models.InventoryConfigurationIncludedObjectVersions; +import com.azure.resourcemanager.awsconnector.models.InventoryConfigurationOptionalFields; +import com.azure.resourcemanager.awsconnector.models.InventoryConfigurationScheduleFrequency; +import com.azure.resourcemanager.awsconnector.models.LambdaConfiguration; +import com.azure.resourcemanager.awsconnector.models.LifecycleConfiguration; +import com.azure.resourcemanager.awsconnector.models.LoggingConfiguration; +import com.azure.resourcemanager.awsconnector.models.Metrics; +import com.azure.resourcemanager.awsconnector.models.MetricsConfiguration; +import com.azure.resourcemanager.awsconnector.models.MetricsStatus; +import com.azure.resourcemanager.awsconnector.models.NoncurrentVersionExpiration; +import com.azure.resourcemanager.awsconnector.models.NoncurrentVersionTransition; +import com.azure.resourcemanager.awsconnector.models.NoncurrentVersionTransitionStorageClass; +import com.azure.resourcemanager.awsconnector.models.NotificationConfigurationAutoGenerated2; +import com.azure.resourcemanager.awsconnector.models.NotificationFilter; +import com.azure.resourcemanager.awsconnector.models.ObjectLockConfiguration; +import com.azure.resourcemanager.awsconnector.models.ObjectLockRule; +import com.azure.resourcemanager.awsconnector.models.OwnershipControls; +import com.azure.resourcemanager.awsconnector.models.OwnershipControlsRule; +import com.azure.resourcemanager.awsconnector.models.OwnershipControlsRuleObjectOwnership; +import com.azure.resourcemanager.awsconnector.models.PartitionedPrefix; +import com.azure.resourcemanager.awsconnector.models.PartitionedPrefixPartitionDateSource; +import com.azure.resourcemanager.awsconnector.models.PublicAccessBlockConfigurationAutoGenerated; +import com.azure.resourcemanager.awsconnector.models.QueueConfiguration; +import com.azure.resourcemanager.awsconnector.models.RedirectAllRequestsTo; +import com.azure.resourcemanager.awsconnector.models.RedirectAllRequestsToProtocol; +import com.azure.resourcemanager.awsconnector.models.RedirectRule; +import com.azure.resourcemanager.awsconnector.models.RedirectRuleProtocol; +import com.azure.resourcemanager.awsconnector.models.ReplicaModifications; +import com.azure.resourcemanager.awsconnector.models.ReplicaModificationsStatus; +import com.azure.resourcemanager.awsconnector.models.ReplicationConfigurationAutoGenerated; +import com.azure.resourcemanager.awsconnector.models.ReplicationDestinationAutoGenerated; +import com.azure.resourcemanager.awsconnector.models.ReplicationDestinationStorageClass; +import com.azure.resourcemanager.awsconnector.models.ReplicationRule; +import com.azure.resourcemanager.awsconnector.models.ReplicationRuleAndOperator; +import com.azure.resourcemanager.awsconnector.models.ReplicationRuleFilter; +import com.azure.resourcemanager.awsconnector.models.ReplicationRuleStatus; +import com.azure.resourcemanager.awsconnector.models.ReplicationTime; +import com.azure.resourcemanager.awsconnector.models.ReplicationTimeStatus; +import com.azure.resourcemanager.awsconnector.models.ReplicationTimeValue; +import com.azure.resourcemanager.awsconnector.models.RoutingRule; +import com.azure.resourcemanager.awsconnector.models.RoutingRuleCondition; +import com.azure.resourcemanager.awsconnector.models.Rule; +import com.azure.resourcemanager.awsconnector.models.RuleStatus; +import com.azure.resourcemanager.awsconnector.models.S3BucketProperties; +import com.azure.resourcemanager.awsconnector.models.S3KeyFilter; +import com.azure.resourcemanager.awsconnector.models.ServerSideEncryptionByDefault; +import com.azure.resourcemanager.awsconnector.models.ServerSideEncryptionByDefaultSseAlgorithm; +import com.azure.resourcemanager.awsconnector.models.ServerSideEncryptionRule; +import com.azure.resourcemanager.awsconnector.models.SourceSelectionCriteria; +import com.azure.resourcemanager.awsconnector.models.SseKmsEncryptedObjects; +import com.azure.resourcemanager.awsconnector.models.SseKmsEncryptedObjectsStatus; +import com.azure.resourcemanager.awsconnector.models.StorageClassAnalysis; +import com.azure.resourcemanager.awsconnector.models.TagAutoGenerated50; +import com.azure.resourcemanager.awsconnector.models.TagFilter; +import com.azure.resourcemanager.awsconnector.models.TargetObjectKeyFormat; +import com.azure.resourcemanager.awsconnector.models.Tiering; +import com.azure.resourcemanager.awsconnector.models.TieringAccessTier; +import com.azure.resourcemanager.awsconnector.models.TopicConfiguration; +import com.azure.resourcemanager.awsconnector.models.Transition; +import com.azure.resourcemanager.awsconnector.models.TransitionStorageClass; +import com.azure.resourcemanager.awsconnector.models.VersioningConfiguration; +import com.azure.resourcemanager.awsconnector.models.VersioningConfigurationStatus; +import com.azure.resourcemanager.awsconnector.models.WebsiteConfiguration; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for S3Buckets CreateOrReplace. + */ +public final class S3BucketsCreateOrReplaceSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * S3Buckets_CreateOrReplace.json + */ + /** + * Sample code: S3Buckets_CreateOrReplace. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void s3BucketsCreateOrReplace(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.s3Buckets() + .define("Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])") + .withRegion("pesmjbocvf") + .withExistingResourceGroup("rgs3Bucket") + .withTags(mapOf("key8605", "fakeTokenPlaceholder")) + .withProperties( + new S3BucketProperties() + .withAwsProperties( + new AwsS3BucketProperties() + .withAccelerateConfiguration(new AccelerateConfiguration() + .withAccelerationStatus(AccelerateConfigurationAccelerationStatus.ENABLED)) + .withAccessControl(AccessControl.AUTHENTICATED_READ) + .withAnalyticsConfigurations(Arrays.asList(new AnalyticsConfiguration().withId("ioxkjkuclx") + .withPrefix("errquicjtmxuidndown") + .withStorageClassAnalysis(new StorageClassAnalysis().withDataExport(new DataExport() + .withDestination(new Destination().withBucketAccountId("sfgcxqtuacvejulm") + .withBucketArn("iuwuakbkkh") + .withFormat(DestinationFormat.CSV) + .withPrefix("bnbqkueiiffpl")) + .withOutputSchemaVersion("ojzzqnkekust"))) + .withTagFilters( + Arrays.asList(new TagFilter().withKey("fakeTokenPlaceholder").withValue("fsby"))))) + .withArn("wdn") + .withBucketEncryption( + new BucketEncryption().withServerSideEncryptionConfiguration( + Arrays.asList(new ServerSideEncryptionRule().withBucketKeyEnabled(true) + .withServerSideEncryptionByDefault(new ServerSideEncryptionByDefault() + .withKmsMasterKeyId("fakeTokenPlaceholder") + .withSseAlgorithm(ServerSideEncryptionByDefaultSseAlgorithm.AES256))))) + .withBucketName("qapantghvzujpa") + .withCorsConfiguration(new CorsConfiguration().withCorsRules( + Arrays.asList(new CorsRule().withAllowedHeaders(Arrays.asList("zzooekoypz")) + .withAllowedMethods(Arrays.asList(CorsRuleAllowedMethods.DELETE)) + .withAllowedOrigins(Arrays.asList("tqldxbbws")) + .withExposedHeaders(Arrays.asList("wjlikohhmisfgumcfzrnvg")) + .withId("zvasxfnbnbpftihvtosdnlmskv") + .withMaxAge(9)))) + .withDomainName("vbhotuxputambztq") + .withDualStackDomainName("sryuphsbzszrwamvrcsihe") + .withIntelligentTieringConfigurations( + Arrays.asList(new IntelligentTieringConfiguration().withId("dbqsgaw") + .withPrefix("lhizynvczgfiqwaiyuqpvnd") + .withStatus(IntelligentTieringConfigurationStatus.DISABLED) + .withTagFilters(Arrays + .asList(new TagFilter().withKey("fakeTokenPlaceholder").withValue("fsby"))) + .withTierings(Arrays.asList( + new Tiering().withAccessTier(TieringAccessTier.ARCHIVE_ACCESS).withDays(6))))) + .withInventoryConfigurations(Arrays.asList(new InventoryConfiguration() + .withDestination(new Destination().withBucketAccountId("sfgcxqtuacvejulm") + .withBucketArn("iuwuakbkkh") + .withFormat(DestinationFormat.CSV) + .withPrefix("bnbqkueiiffpl")) + .withEnabled(true) + .withId("yqyorzlpsfzzycfeqmdgtsstdze") + .withIncludedObjectVersions(InventoryConfigurationIncludedObjectVersions.ALL) + .withOptionalFields( + Arrays.asList(InventoryConfigurationOptionalFields.BUCKET_KEY_STATUS)) + .withPrefix("tuzwyujzrv") + .withScheduleFrequency(InventoryConfigurationScheduleFrequency.DAILY))) + .withLifecycleConfiguration(new LifecycleConfiguration().withRules(Arrays.asList(new Rule() + .withAbortIncompleteMultipartUpload( + new AbortIncompleteMultipartUpload().withDaysAfterInitiation(20)) + .withExpirationDate("ruijzosqnherfgwbgzbiwau") + .withExpirationInDays(8) + .withExpiredObjectDeleteMarker(true) + .withId("aofbidgki") + .withNoncurrentVersionExpiration( + new NoncurrentVersionExpiration().withNewerNoncurrentVersions(4) + .withNoncurrentDays(17)) + .withNoncurrentVersionExpirationInDays(4) + .withNoncurrentVersionTransition( + new NoncurrentVersionTransition().withNewerNoncurrentVersions(6) + .withStorageClass(NoncurrentVersionTransitionStorageClass.DEEP_ARCHIVE) + .withTransitionInDays(8)) + .withNoncurrentVersionTransitions( + Arrays.asList(new NoncurrentVersionTransition().withNewerNoncurrentVersions(6) + .withStorageClass(NoncurrentVersionTransitionStorageClass.DEEP_ARCHIVE) + .withTransitionInDays(8))) + .withObjectSizeGreaterThan("hfifjfbqvmtatza") + .withObjectSizeLessThan("ew") + .withPrefix("kbsmshvpardhxehfjgszomvekk") + .withStatus(RuleStatus.DISABLED) + .withTagFilters( + Arrays.asList(new TagFilter().withKey("fakeTokenPlaceholder").withValue("fsby"))) + .withTransition(new Transition().withStorageClass(TransitionStorageClass.DEEP_ARCHIVE) + .withTransitionDate("cqdrkqznucygxbnccuvxqbtnm") + .withTransitionInDays(14)) + .withTransitions( + Arrays.asList(new Transition().withStorageClass(TransitionStorageClass.DEEP_ARCHIVE) + .withTransitionDate("cqdrkqznucygxbnccuvxqbtnm") + .withTransitionInDays(14)))))) + .withLoggingConfiguration(new LoggingConfiguration().withDestinationBucketName("aujj") + .withLogFilePrefix("vdmmbfnvymowpvmhbsagekbokzvp") + .withTargetObjectKeyFormat( + new TargetObjectKeyFormat().withPartitionedPrefix(new PartitionedPrefix() + .withPartitionDateSource(PartitionedPrefixPartitionDateSource.DELIVERY_TIME)))) + .withMetricsConfigurations( + Arrays.asList(new MetricsConfiguration() + .withAccessPointArn("tkhjqpjfplj") + .withId("ggheleujxadbvbjogd") + .withPrefix("zg") + .withTagFilters(Arrays + .asList(new TagFilter().withKey("fakeTokenPlaceholder").withValue("fsby"))))) + .withNotificationConfiguration(new NotificationConfigurationAutoGenerated2() + .withEventBridgeConfiguration( + new EventBridgeConfiguration().withEventBridgeEnabled(true)) + .withLambdaConfigurations( + Arrays.asList(new LambdaConfiguration().withEvent("zpvewswtoarduycggotzdneptucwix") + .withFilter(new NotificationFilter().withS3Key(new S3KeyFilter().withRules( + Arrays.asList(new FilterRule().withName("ohgjzuamjncbifvbkldogxjuxvhvz") + .withValue("dauvnhzxpkpqutnrl"))))) + .withFunction("zmyzygfaojliiryslfyuyme"))) + .withQueueConfigurations( + Arrays.asList(new QueueConfiguration().withEvent("qgcdpcvmkvjivvpvmmaeqrictlznb") + .withFilter(new NotificationFilter().withS3Key(new S3KeyFilter().withRules( + Arrays.asList(new FilterRule().withName("ohgjzuamjncbifvbkldogxjuxvhvz") + .withValue("dauvnhzxpkpqutnrl"))))) + .withQueue("qwlbvlgmwiaegulyybqggopf"))) + .withTopicConfigurations(Arrays.asList(new TopicConfiguration().withEvent("kxl") + .withFilter(new NotificationFilter().withS3Key(new S3KeyFilter().withRules( + Arrays.asList(new FilterRule().withName("ohgjzuamjncbifvbkldogxjuxvhvz") + .withValue("dauvnhzxpkpqutnrl"))))) + .withTopic("cj")))) + .withObjectLockConfiguration(new ObjectLockConfiguration().withObjectLockEnabled("aiocf") + .withRule(new ObjectLockRule().withDefaultRetention(new DefaultRetention().withDays(22) + .withMode(DefaultRetentionMode.COMPLIANCE) + .withYears(11)))) + .withObjectLockEnabled(true) + .withOwnershipControls(new OwnershipControls().withRules(Arrays + .asList(new OwnershipControlsRule() + .withObjectOwnership(OwnershipControlsRuleObjectOwnership.BUCKET_OWNER_ENFORCED)))) + .withPublicAccessBlockConfiguration( + new PublicAccessBlockConfigurationAutoGenerated().withBlockPublicAcls(true) + .withBlockPublicPolicy(true) + .withIgnorePublicAcls(true) + .withRestrictPublicBuckets(true)) + .withRegionalDomainName("xdbzcoemgixrqq") + .withReplicationConfiguration(new ReplicationConfigurationAutoGenerated() + .withRole("rqafufwtmuflkqet") + .withRules(Arrays.asList(new ReplicationRule() + .withDeleteMarkerReplication(new DeleteMarkerReplication() + .withStatus(DeleteMarkerReplicationStatus.DISABLED)) + .withDestination(new ReplicationDestinationAutoGenerated() + .withAccessControlTranslation( + new AccessControlTranslation().withOwner("smyptov")) + .withAccount("hwqiekzz") + .withBucket("prjlsmdhkwrputvpdavgn") + .withEncryptionConfiguration(new EncryptionConfigurationAutoGenerated() + .withReplicaKmsKeyId("fakeTokenPlaceholder")) + .withMetrics( + new Metrics().withEventThreshold(new ReplicationTimeValue().withMinutes(18)) + .withStatus(MetricsStatus.DISABLED)) + .withReplicationTime( + new ReplicationTime().withStatus(ReplicationTimeStatus.DISABLED) + .withTime(new ReplicationTimeValue().withMinutes(18))) + .withStorageClass(ReplicationDestinationStorageClass.DEEP_ARCHIVE)) + .withFilter(new ReplicationRuleFilter() + .withAnd( + new ReplicationRuleAndOperator().withPrefix("rlralilpznxqfpcseysvvxmfaor") + .withTagFilters(Arrays.asList( + new TagFilter().withKey("fakeTokenPlaceholder").withValue("fsby")))) + .withPrefix("etzfeufdxmcvjzpvxbjmzikok") + .withTagFilter( + new TagFilter().withKey("fakeTokenPlaceholder").withValue("fsby"))) + .withId("fjcfzahlddm") + .withPrefix("agykvphwwnfevfucrxugxejv") + .withPriority(20) + .withSourceSelectionCriteria(new SourceSelectionCriteria() + .withReplicaModifications( + new ReplicaModifications().withStatus(ReplicaModificationsStatus.DISABLED)) + .withSseKmsEncryptedObjects(new SseKmsEncryptedObjects() + .withStatus(SseKmsEncryptedObjectsStatus.DISABLED))) + .withStatus(ReplicationRuleStatus.DISABLED)))) + .withTags(Arrays.asList(new TagAutoGenerated50().withKey("fakeTokenPlaceholder") + .withValue("otwjdamxqdydqwujwyfh"))) + .withVersioningConfiguration( + new VersioningConfiguration().withStatus(VersioningConfigurationStatus.ENABLED)) + .withWebsiteConfiguration(new WebsiteConfiguration() + .withErrorDocument("zxifnrlbyapkasrrhamdkdsqk") + .withIndexDocument("umbhsxlihqldbh") + .withRedirectAllRequestsTo(new RedirectAllRequestsTo() + .withHostname("sxmd") + .withProtocol(RedirectAllRequestsToProtocol.HTTP)) + .withRoutingRules(Arrays.asList(new RoutingRule() + .withRedirectRule(new RedirectRule().withHostname("odmugwc") + .withHttpRedirectCode("fakeTokenPlaceholder") + .withProtocol(RedirectRuleProtocol.HTTP) + .withReplaceKeyPrefixWith("fakeTokenPlaceholder") + .withReplaceKeyWith("fakeTokenPlaceholder")) + .withRoutingRuleCondition(new RoutingRuleCondition() + .withHttpErrorCodeReturnedEquals("fakeTokenPlaceholder") + .withKeyPrefixEquals("fakeTokenPlaceholder"))))) + .withWebsiteUrl("vtlwozcgstjkkmgfywinjoreomvw")) + .withPublicCloudConnectorsResourceId("i") + .withAwsAccountId("rfckvyuni") + .withArn("qoufjwcexyvk") + .withPublicCloudResourceName("fmugqeeykklaccblyqplo") + .withAwsSourceSchema("kywnqkadqm") + .withAwsRegion("kckriyydtrwdlelcuztzfeptvcbwj") + .withAwsTags(mapOf("key1337", "fakeTokenPlaceholder"))) + .create(); + } + + // Use "Map.of" if available + @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; + } +} +``` + +### S3Buckets_Delete + +```java +/** + * Samples for S3Buckets Delete. + */ +public final class S3BucketsDeleteSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/S3Buckets_Delete. + * json + */ + /** + * Sample code: S3Buckets_Delete. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void s3BucketsDelete(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.s3Buckets() + .delete("rgs3Bucket", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE); + } +} +``` + +### S3Buckets_GetByResourceGroup + +```java +/** + * Samples for S3Buckets GetByResourceGroup. + */ +public final class S3BucketsGetByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/S3Buckets_Get.json + */ + /** + * Sample code: S3Buckets_Get. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void s3BucketsGet(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.s3Buckets() + .getByResourceGroupWithResponse("rgs3Bucket", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE); + } +} +``` + +### S3Buckets_List + +```java +/** + * Samples for S3Buckets List. + */ +public final class S3BucketsListSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * S3Buckets_ListBySubscription.json + */ + /** + * Sample code: S3Buckets_ListBySubscription. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void s3BucketsListBySubscription(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.s3Buckets().list(com.azure.core.util.Context.NONE); + } +} +``` + +### S3Buckets_ListByResourceGroup + +```java +/** + * Samples for S3Buckets ListByResourceGroup. + */ +public final class S3BucketsListByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * S3Buckets_ListByResourceGroup.json + */ + /** + * Sample code: S3Buckets_ListByResourceGroup. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + s3BucketsListByResourceGroup(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.s3Buckets().listByResourceGroup("rgs3Bucket", com.azure.core.util.Context.NONE); + } +} +``` + +### S3Buckets_Update + +```java +import com.azure.resourcemanager.awsconnector.models.S3Bucket; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for S3Buckets Update. + */ +public final class S3BucketsUpdateSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/S3Buckets_Update. + * json + */ + /** + * Sample code: S3Buckets_Update. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void s3BucketsUpdate(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + S3Bucket resource = manager.s3Buckets() + .getByResourceGroupWithResponse("rgs3Bucket", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE) + .getValue(); + resource.update().withTags(mapOf("key6199", "fakeTokenPlaceholder")).apply(); + } + + // Use "Map.of" if available + @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; + } +} +``` + +### S3ControlMultiRegionAccessPointPolicyDocuments_CreateOrReplace + +```java +import com.azure.resourcemanager.awsconnector.models.AwsS3ControlMultiRegionAccessPointPolicyDocumentProperties; +import com.azure.resourcemanager.awsconnector.models.EstablishedMultiRegionAccessPointPolicy; +import com.azure.resourcemanager.awsconnector.models.ProposedMultiRegionAccessPointPolicy; +import com.azure.resourcemanager.awsconnector.models.S3ControlMultiRegionAccessPointPolicyDocumentProperties; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for S3ControlMultiRegionAccessPointPolicyDocuments CreateOrReplace. + */ +public final class S3ControlMultiRegionAccessPointPolicyDocumentsCreateOrReplaceSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * S3ControlMultiRegionAccessPointPolicyDocuments_CreateOrReplace.json + */ + /** + * Sample code: S3ControlMultiRegionAccessPointPolicyDocuments_CreateOrReplace. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void s3ControlMultiRegionAccessPointPolicyDocumentsCreateOrReplace( + com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.s3ControlMultiRegionAccessPointPolicyDocuments() + .define("Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])") + .withRegion("mfqwu") + .withExistingResourceGroup("rgs3ControlMultiRegionAccessPointPolicyDocument") + .withTags(mapOf("key9846", "fakeTokenPlaceholder")) + .withProperties(new S3ControlMultiRegionAccessPointPolicyDocumentProperties() + .withAwsProperties(new AwsS3ControlMultiRegionAccessPointPolicyDocumentProperties() + .withEstablished(new EstablishedMultiRegionAccessPointPolicy().withPolicy("amcyzzkmwbyuxnbqop")) + .withProposed(new ProposedMultiRegionAccessPointPolicy().withPolicy("lbmaqmlw"))) + .withPublicCloudConnectorsResourceId("yyfwlodyfhgbzyfgsl") + .withAwsAccountId("wotmizsy") + .withArn("ugqgpzuzhxnknuancpvpckccl") + .withPublicCloudResourceName("ks") + .withAwsSourceSchema("qntzhuq") + .withAwsRegion("pshllexnortomzvgcjnsxeoo") + .withAwsTags(mapOf("key788", "fakeTokenPlaceholder"))) + .create(); + } + + // Use "Map.of" if available + @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; + } +} +``` + +### S3ControlMultiRegionAccessPointPolicyDocuments_Delete + +```java +/** + * Samples for S3ControlMultiRegionAccessPointPolicyDocuments Delete. + */ +public final class S3ControlMultiRegionAccessPointPolicyDocumentsDeleteSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * S3ControlMultiRegionAccessPointPolicyDocuments_Delete.json + */ + /** + * Sample code: S3ControlMultiRegionAccessPointPolicyDocuments_Delete. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void s3ControlMultiRegionAccessPointPolicyDocumentsDelete( + com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.s3ControlMultiRegionAccessPointPolicyDocuments() + .delete("rgs3ControlMultiRegionAccessPointPolicyDocument", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE); + } +} +``` + +### S3ControlMultiRegionAccessPointPolicyDocuments_GetByResourceGroup + +```java +/** + * Samples for S3ControlMultiRegionAccessPointPolicyDocuments GetByResourceGroup. + */ +public final class S3ControlMultiRegionAccessPointPolicyDocumentsGetByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * S3ControlMultiRegionAccessPointPolicyDocuments_Get.json + */ + /** + * Sample code: S3ControlMultiRegionAccessPointPolicyDocuments_Get. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void s3ControlMultiRegionAccessPointPolicyDocumentsGet( + com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.s3ControlMultiRegionAccessPointPolicyDocuments() + .getByResourceGroupWithResponse("rgs3ControlMultiRegionAccessPointPolicyDocument", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE); + } +} +``` + +### S3ControlMultiRegionAccessPointPolicyDocuments_List + +```java +/** + * Samples for S3ControlMultiRegionAccessPointPolicyDocuments List. + */ +public final class S3ControlMultiRegionAccessPointPolicyDocumentsListSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * S3ControlMultiRegionAccessPointPolicyDocuments_ListBySubscription.json + */ + /** + * Sample code: S3ControlMultiRegionAccessPointPolicyDocuments_ListBySubscription. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void s3ControlMultiRegionAccessPointPolicyDocumentsListBySubscription( + com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.s3ControlMultiRegionAccessPointPolicyDocuments().list(com.azure.core.util.Context.NONE); + } +} +``` + +### S3ControlMultiRegionAccessPointPolicyDocuments_ListByResourceGroup + +```java +/** + * Samples for S3ControlMultiRegionAccessPointPolicyDocuments ListByResourceGroup. + */ +public final class S3ControlMultiRegionAccessPointPolicyDocumentsListByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * S3ControlMultiRegionAccessPointPolicyDocuments_ListByResourceGroup.json + */ + /** + * Sample code: S3ControlMultiRegionAccessPointPolicyDocuments_ListByResourceGroup. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void s3ControlMultiRegionAccessPointPolicyDocumentsListByResourceGroup( + com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.s3ControlMultiRegionAccessPointPolicyDocuments() + .listByResourceGroup("rgs3ControlMultiRegionAccessPointPolicyDocument", com.azure.core.util.Context.NONE); + } +} +``` + +### S3ControlMultiRegionAccessPointPolicyDocuments_Update + +```java +import com.azure.resourcemanager.awsconnector.models.S3ControlMultiRegionAccessPointPolicyDocument; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for S3ControlMultiRegionAccessPointPolicyDocuments Update. + */ +public final class S3ControlMultiRegionAccessPointPolicyDocumentsUpdateSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * S3ControlMultiRegionAccessPointPolicyDocuments_Update.json + */ + /** + * Sample code: S3ControlMultiRegionAccessPointPolicyDocuments_Update. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void s3ControlMultiRegionAccessPointPolicyDocumentsUpdate( + com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + S3ControlMultiRegionAccessPointPolicyDocument resource + = manager.s3ControlMultiRegionAccessPointPolicyDocuments() + .getByResourceGroupWithResponse("rgs3ControlMultiRegionAccessPointPolicyDocument", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE) + .getValue(); + resource.update().withTags(mapOf("key9280", "fakeTokenPlaceholder")).apply(); + } + + // Use "Map.of" if available + @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; + } +} +``` + +### SageMakerApps_CreateOrReplace + +```java +import com.azure.resourcemanager.awsconnector.models.AppType; +import com.azure.resourcemanager.awsconnector.models.AwsSageMakerAppProperties; +import com.azure.resourcemanager.awsconnector.models.ResourceSpec; +import com.azure.resourcemanager.awsconnector.models.ResourceSpecInstanceType; +import com.azure.resourcemanager.awsconnector.models.SageMakerAppProperties; +import com.azure.resourcemanager.awsconnector.models.TagAutoGenerated51; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for SageMakerApps CreateOrReplace. + */ +public final class SageMakerAppsCreateOrReplaceSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * SageMakerApps_CreateOrReplace.json + */ + /** + * Sample code: SageMakerApps_CreateOrReplace. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + sageMakerAppsCreateOrReplace(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.sageMakerApps() + .define("Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])") + .withRegion("wnlhgbkbelgwiwhnismoau") + .withExistingResourceGroup("rgsageMakerApp") + .withTags(mapOf("key3532", "fakeTokenPlaceholder")) + .withProperties(new SageMakerAppProperties() + .withAwsProperties(new AwsSageMakerAppProperties().withAppArn("gher") + .withAppName("evzkcyynebo") + .withAppType(AppType.CANVAS) + .withDomainId("dkqxukvimzaw") + .withResourceSpec(new ResourceSpec().withInstanceType(ResourceSpecInstanceType.ML_C5_12XLARGE) + .withSageMakerImageArn("pgukixbhpruaz") + .withSageMakerImageVersionArn("juqpu")) + .withTags( + Arrays.asList(new TagAutoGenerated51().withKey("fakeTokenPlaceholder").withValue("oiirwwaoqv"))) + .withUserProfileName("hqjtakkgaetxvrmswgdzfbnna")) + .withPublicCloudConnectorsResourceId("vaphifjjavrvy") + .withAwsAccountId("lgqcehdauhqdqezactw") + .withArn("jlzaozimvtjn") + .withPublicCloudResourceName("ptlnykuziapscweekj") + .withAwsSourceSchema("xshoewjusdxuy") + .withAwsRegion("tnogtlqasqlenkt") + .withAwsTags(mapOf("key2126", "fakeTokenPlaceholder"))) + .create(); + } + + // Use "Map.of" if available + @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; + } +} +``` + +### SageMakerApps_Delete + +```java +/** + * Samples for SageMakerApps Delete. + */ +public final class SageMakerAppsDeleteSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * SageMakerApps_Delete.json + */ + /** + * Sample code: SageMakerApps_Delete. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void sageMakerAppsDelete(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.sageMakerApps() + .delete("rgsageMakerApp", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE); + } +} +``` + +### SageMakerApps_GetByResourceGroup + +```java +/** + * Samples for SageMakerApps GetByResourceGroup. + */ +public final class SageMakerAppsGetByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/SageMakerApps_Get. + * json + */ + /** + * Sample code: SageMakerApps_Get. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void sageMakerAppsGet(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.sageMakerApps() + .getByResourceGroupWithResponse("rgsageMakerApp", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE); + } +} +``` + +### SageMakerApps_List + +```java +/** + * Samples for SageMakerApps List. + */ +public final class SageMakerAppsListSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * SageMakerApps_ListBySubscription.json + */ + /** + * Sample code: SageMakerApps_ListBySubscription. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + sageMakerAppsListBySubscription(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.sageMakerApps().list(com.azure.core.util.Context.NONE); + } +} +``` + +### SageMakerApps_ListByResourceGroup + +```java +/** + * Samples for SageMakerApps ListByResourceGroup. + */ +public final class SageMakerAppsListByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * SageMakerApps_ListByResourceGroup.json + */ + /** + * Sample code: SageMakerApps_ListByResourceGroup. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + sageMakerAppsListByResourceGroup(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.sageMakerApps().listByResourceGroup("rgsageMakerApp", com.azure.core.util.Context.NONE); + } +} +``` + +### SageMakerApps_Update + +```java +import com.azure.resourcemanager.awsconnector.models.SageMakerApp; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for SageMakerApps Update. + */ +public final class SageMakerAppsUpdateSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * SageMakerApps_Update.json + */ + /** + * Sample code: SageMakerApps_Update. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void sageMakerAppsUpdate(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + SageMakerApp resource = manager.sageMakerApps() + .getByResourceGroupWithResponse("rgsageMakerApp", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE) + .getValue(); + resource.update().withTags(mapOf("key854", "fakeTokenPlaceholder")).apply(); + } + + // Use "Map.of" if available + @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; + } +} +``` + +### SageMakerNotebookInstanceSummaries_CreateOrReplace + +```java +import com.azure.resourcemanager.awsconnector.models.AwsSageMakerNotebookInstanceSummaryProperties; +import com.azure.resourcemanager.awsconnector.models.InstanceType; +import com.azure.resourcemanager.awsconnector.models.InstanceTypeEnumValue; +import com.azure.resourcemanager.awsconnector.models.NotebookInstanceStatus; +import com.azure.resourcemanager.awsconnector.models.NotebookInstanceStatusEnumValue; +import com.azure.resourcemanager.awsconnector.models.SageMakerNotebookInstanceSummaryProperties; +import java.time.OffsetDateTime; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for SageMakerNotebookInstanceSummaries CreateOrReplace. + */ +public final class SageMakerNotebookInstanceSummariesCreateOrReplaceSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * SageMakerNotebookInstanceSummaries_CreateOrReplace.json + */ + /** + * Sample code: SageMakerNotebookInstanceSummaries_CreateOrReplace. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void sageMakerNotebookInstanceSummariesCreateOrReplace( + com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.sageMakerNotebookInstanceSummaries() + .define("Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])") + .withRegion("khdjmafoabcvhksslfjtzlyh") + .withExistingResourceGroup("rgsageMakerNotebookInstanceSummary") + .withTags(mapOf("key9470", "fakeTokenPlaceholder")) + .withProperties( + new SageMakerNotebookInstanceSummaryProperties() + .withAwsProperties(new AwsSageMakerNotebookInstanceSummaryProperties() + .withAdditionalCodeRepositories(Arrays.asList("pkjwtq")) + .withCreationTime(OffsetDateTime.parse("2024-10-08T03:50:00.672Z")) + .withDefaultCodeRepository("fakeTokenPlaceholder") + .withInstanceType( + new InstanceTypeEnumValue().withValue(InstanceType.fromString("ml.c4.2xlarge"))) + .withLastModifiedTime(OffsetDateTime.parse("2024-10-08T03:50:00.673Z")) + .withNotebookInstanceArn("wxrcvukcvvtd") + .withNotebookInstanceLifecycleConfigName("t") + .withNotebookInstanceName("nwemhcydnbtwmti") + .withNotebookInstanceStatus( + new NotebookInstanceStatusEnumValue().withValue(NotebookInstanceStatus.DELETING)) + .withUrl("ricclxhpsojfujeolzbg")) + .withPublicCloudConnectorsResourceId("khlyjmgts") + .withAwsAccountId("ymlnxodvrwztwew") + .withArn("ncvgnrtwmjxungpgrodvsy") + .withPublicCloudResourceName("ocd") + .withAwsSourceSchema("gqddonfcsn") + .withAwsRegion("oqykvfkrsmwkvszj") + .withAwsTags(mapOf("key4152", "fakeTokenPlaceholder"))) + .create(); + } + + // Use "Map.of" if available + @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; + } +} +``` + +### SageMakerNotebookInstanceSummaries_Delete + +```java +/** + * Samples for SageMakerNotebookInstanceSummaries Delete. + */ +public final class SageMakerNotebookInstanceSummariesDeleteSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * SageMakerNotebookInstanceSummaries_Delete.json + */ + /** + * Sample code: SageMakerNotebookInstanceSummaries_Delete. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + sageMakerNotebookInstanceSummariesDelete(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.sageMakerNotebookInstanceSummaries() + .delete("rgsageMakerNotebookInstanceSummary", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE); + } +} +``` + +### SageMakerNotebookInstanceSummaries_GetByResourceGroup + +```java +/** + * Samples for SageMakerNotebookInstanceSummaries GetByResourceGroup. + */ +public final class SageMakerNotebookInstanceSummariesGetByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * SageMakerNotebookInstanceSummaries_Get.json + */ + /** + * Sample code: SageMakerNotebookInstanceSummaries_Get. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + sageMakerNotebookInstanceSummariesGet(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.sageMakerNotebookInstanceSummaries() + .getByResourceGroupWithResponse("rgsageMakerNotebookInstanceSummary", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE); + } +} +``` + +### SageMakerNotebookInstanceSummaries_List + +```java +/** + * Samples for SageMakerNotebookInstanceSummaries List. + */ +public final class SageMakerNotebookInstanceSummariesListSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * SageMakerNotebookInstanceSummaries_ListBySubscription.json + */ + /** + * Sample code: SageMakerNotebookInstanceSummaries_ListBySubscription. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void sageMakerNotebookInstanceSummariesListBySubscription( + com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.sageMakerNotebookInstanceSummaries().list(com.azure.core.util.Context.NONE); + } +} +``` + +### SageMakerNotebookInstanceSummaries_ListByResourceGroup + +```java +/** + * Samples for SageMakerNotebookInstanceSummaries ListByResourceGroup. + */ +public final class SageMakerNotebookInstanceSummariesListByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * SageMakerNotebookInstanceSummaries_ListByResourceGroup.json + */ + /** + * Sample code: SageMakerNotebookInstanceSummaries_ListByResourceGroup. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void sageMakerNotebookInstanceSummariesListByResourceGroup( + com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.sageMakerNotebookInstanceSummaries() + .listByResourceGroup("rgsageMakerNotebookInstanceSummary", com.azure.core.util.Context.NONE); + } +} +``` + +### SageMakerNotebookInstanceSummaries_Update + +```java +import com.azure.resourcemanager.awsconnector.models.SageMakerNotebookInstanceSummary; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for SageMakerNotebookInstanceSummaries Update. + */ +public final class SageMakerNotebookInstanceSummariesUpdateSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * SageMakerNotebookInstanceSummaries_Update.json + */ + /** + * Sample code: SageMakerNotebookInstanceSummaries_Update. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + sageMakerNotebookInstanceSummariesUpdate(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + SageMakerNotebookInstanceSummary resource = manager.sageMakerNotebookInstanceSummaries() + .getByResourceGroupWithResponse("rgsageMakerNotebookInstanceSummary", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE) + .getValue(); + resource.update().withTags(mapOf("key9780", "fakeTokenPlaceholder")).apply(); + } + + // Use "Map.of" if available + @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; + } +} +``` + +### SecretsManagerResourcePolicies_CreateOrReplace + +```java +import com.azure.resourcemanager.awsconnector.models.AwsSecretsManagerResourcePolicyProperties; +import com.azure.resourcemanager.awsconnector.models.SecretsManagerResourcePolicyProperties; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for SecretsManagerResourcePolicies CreateOrReplace. + */ +public final class SecretsManagerResourcePoliciesCreateOrReplaceSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * SecretsManagerResourcePolicies_CreateOrReplace.json + */ + /** + * Sample code: SecretsManagerResourcePolicies_CreateOrReplace. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void secretsManagerResourcePoliciesCreateOrReplace( + com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.secretsManagerResourcePolicies() + .define("Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])") + .withRegion("znrmqmz") + .withExistingResourceGroup("rgsecretsManagerResourcePolicy") + .withTags(mapOf("key6501", "fakeTokenPlaceholder")) + .withProperties(new SecretsManagerResourcePolicyProperties() + .withAwsProperties(new AwsSecretsManagerResourcePolicyProperties().withBlockPublicPolicy(true) + .withId("hrvehsjtj") + .withSecretId("fakeTokenPlaceholder")) + .withPublicCloudConnectorsResourceId("isvozhenarlkfvvrujywfu") + .withAwsAccountId("bswnezmdsuirkrgzmxxjsjo") + .withArn("cvtearqpmshhlnuxxvmsejrzpqsekj") + .withPublicCloudResourceName("vtrpmkekofucehtns") + .withAwsSourceSchema("gkmussnnnguicaskcuprrkexb") + .withAwsRegion("kpcxxfwomoxngnrmkpregcz") + .withAwsTags(mapOf("key958", "fakeTokenPlaceholder"))) + .create(); + } + + // Use "Map.of" if available + @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; + } +} +``` + +### SecretsManagerResourcePolicies_Delete + +```java +/** + * Samples for SecretsManagerResourcePolicies Delete. + */ +public final class SecretsManagerResourcePoliciesDeleteSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * SecretsManagerResourcePolicies_Delete.json + */ + /** + * Sample code: SecretsManagerResourcePolicies_Delete. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + secretsManagerResourcePoliciesDelete(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.secretsManagerResourcePolicies() + .delete("rgsecretsManagerResourcePolicy", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE); + } +} +``` + +### SecretsManagerResourcePolicies_GetByResourceGroup + +```java +/** + * Samples for SecretsManagerResourcePolicies GetByResourceGroup. + */ +public final class SecretsManagerResourcePoliciesGetByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * SecretsManagerResourcePolicies_Get.json + */ + /** + * Sample code: SecretsManagerResourcePolicies_Get. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + secretsManagerResourcePoliciesGet(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.secretsManagerResourcePolicies() + .getByResourceGroupWithResponse("rgsecretsManagerResourcePolicy", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE); + } +} +``` + +### SecretsManagerResourcePolicies_List + +```java +/** + * Samples for SecretsManagerResourcePolicies List. + */ +public final class SecretsManagerResourcePoliciesListSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * SecretsManagerResourcePolicies_ListBySubscription.json + */ + /** + * Sample code: SecretsManagerResourcePolicies_ListBySubscription. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void secretsManagerResourcePoliciesListBySubscription( + com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.secretsManagerResourcePolicies().list(com.azure.core.util.Context.NONE); + } +} +``` + +### SecretsManagerResourcePolicies_ListByResourceGroup + +```java +/** + * Samples for SecretsManagerResourcePolicies ListByResourceGroup. + */ +public final class SecretsManagerResourcePoliciesListByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * SecretsManagerResourcePolicies_ListByResourceGroup.json + */ + /** + * Sample code: SecretsManagerResourcePolicies_ListByResourceGroup. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void secretsManagerResourcePoliciesListByResourceGroup( + com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.secretsManagerResourcePolicies() + .listByResourceGroup("rgsecretsManagerResourcePolicy", com.azure.core.util.Context.NONE); + } +} +``` + +### SecretsManagerResourcePolicies_Update + +```java +import com.azure.resourcemanager.awsconnector.models.SecretsManagerResourcePolicy; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for SecretsManagerResourcePolicies Update. + */ +public final class SecretsManagerResourcePoliciesUpdateSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * SecretsManagerResourcePolicies_Update.json + */ + /** + * Sample code: SecretsManagerResourcePolicies_Update. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + secretsManagerResourcePoliciesUpdate(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + SecretsManagerResourcePolicy resource = manager.secretsManagerResourcePolicies() + .getByResourceGroupWithResponse("rgsecretsManagerResourcePolicy", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE) + .getValue(); + resource.update().withTags(mapOf("key8052", "fakeTokenPlaceholder")).apply(); + } + + // Use "Map.of" if available + @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; + } +} +``` + +### SecretsManagerSecrets_CreateOrReplace + +```java +import com.azure.resourcemanager.awsconnector.models.AwsSecretsManagerSecretProperties; +import com.azure.resourcemanager.awsconnector.models.GenerateSecretString; +import com.azure.resourcemanager.awsconnector.models.ReplicaRegion; +import com.azure.resourcemanager.awsconnector.models.SecretsManagerSecretProperties; +import com.azure.resourcemanager.awsconnector.models.TagAutoGenerated52; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for SecretsManagerSecrets CreateOrReplace. + */ +public final class SecretsManagerSecretsCreateOrReplaceSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * SecretsManagerSecrets_CreateOrReplace.json + */ + /** + * Sample code: SecretsManagerSecrets_CreateOrReplace. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + secretsManagerSecretsCreateOrReplace(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.secretsManagerSecrets() + .define("Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])") + .withRegion("balqdxuifwdmtcinyxjit") + .withExistingResourceGroup("rgsecretsManagerSecret") + .withTags(mapOf("key1461", "fakeTokenPlaceholder")) + .withProperties( + new SecretsManagerSecretProperties() + .withAwsProperties( + new AwsSecretsManagerSecretProperties().withDescription("esljjbmcrcqe") + .withGenerateSecretString(new GenerateSecretString().withExcludeCharacters("hsixzpgawn") + .withExcludeLowercase(true) + .withExcludeNumbers(true) + .withExcludePunctuation(true) + .withExcludeUppercase(true) + .withGenerateStringKey("fakeTokenPlaceholder") + .withIncludeSpace(true) + .withPasswordLength(17) + .withRequireEachIncludedType(true) + .withSecretStringTemplate("fakeTokenPlaceholder")) + .withId("vpnzmovjfbrltixnsgeml") + .withKmsKeyId("fakeTokenPlaceholder") + .withName("jqmtr") + .withReplicaRegions( + Arrays.asList(new ReplicaRegion().withKmsKeyId("fakeTokenPlaceholder").withRegion("m"))) + .withSecretString("fakeTokenPlaceholder") + .withTags(Arrays + .asList(new TagAutoGenerated52().withKey("fakeTokenPlaceholder").withValue("wrci")))) + .withPublicCloudConnectorsResourceId("osnofxgmgmrsc") + .withAwsAccountId("wtxdsgybisrqopffdhreyacjrysd") + .withArn("qxrdtehsmibehk") + .withPublicCloudResourceName("wj") + .withAwsSourceSchema("whhfrjfzgejfasbcycqe") + .withAwsRegion("mw") + .withAwsTags(mapOf("key4141", "fakeTokenPlaceholder"))) + .create(); + } + + // Use "Map.of" if available + @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; + } +} +``` + +### SecretsManagerSecrets_Delete + +```java +/** + * Samples for SecretsManagerSecrets Delete. + */ +public final class SecretsManagerSecretsDeleteSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * SecretsManagerSecrets_Delete.json + */ + /** + * Sample code: SecretsManagerSecrets_Delete. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void secretsManagerSecretsDelete(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.secretsManagerSecrets() + .delete("rgsecretsManagerSecret", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE); + } +} +``` + +### SecretsManagerSecrets_GetByResourceGroup + +```java +/** + * Samples for SecretsManagerSecrets GetByResourceGroup. + */ +public final class SecretsManagerSecretsGetByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * SecretsManagerSecrets_Get.json + */ + /** + * Sample code: SecretsManagerSecrets_Get. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void secretsManagerSecretsGet(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.secretsManagerSecrets() + .getByResourceGroupWithResponse("rgsecretsManagerSecret", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE); + } +} +``` + +### SecretsManagerSecrets_List + +```java +/** + * Samples for SecretsManagerSecrets List. + */ +public final class SecretsManagerSecretsListSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * SecretsManagerSecrets_ListBySubscription.json + */ + /** + * Sample code: SecretsManagerSecrets_ListBySubscription. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + secretsManagerSecretsListBySubscription(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.secretsManagerSecrets().list(com.azure.core.util.Context.NONE); + } +} +``` + +### SecretsManagerSecrets_ListByResourceGroup + +```java +/** + * Samples for SecretsManagerSecrets ListByResourceGroup. + */ +public final class SecretsManagerSecretsListByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * SecretsManagerSecrets_ListByResourceGroup.json + */ + /** + * Sample code: SecretsManagerSecrets_ListByResourceGroup. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + secretsManagerSecretsListByResourceGroup(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.secretsManagerSecrets().listByResourceGroup("rgsecretsManagerSecret", com.azure.core.util.Context.NONE); + } +} +``` + +### SecretsManagerSecrets_Update + +```java +import com.azure.resourcemanager.awsconnector.models.SecretsManagerSecret; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for SecretsManagerSecrets Update. + */ +public final class SecretsManagerSecretsUpdateSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * SecretsManagerSecrets_Update.json + */ + /** + * Sample code: SecretsManagerSecrets_Update. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void secretsManagerSecretsUpdate(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + SecretsManagerSecret resource = manager.secretsManagerSecrets() + .getByResourceGroupWithResponse("rgsecretsManagerSecret", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE) + .getValue(); + resource.update().withTags(mapOf("key5629", "fakeTokenPlaceholder")).apply(); + } + + // Use "Map.of" if available + @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; + } +} +``` + +### SnsSubscriptions_CreateOrReplace + +```java +import com.azure.resourcemanager.awsconnector.models.AwsSnsSubscriptionProperties; +import com.azure.resourcemanager.awsconnector.models.SnsSubscriptionProperties; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for SnsSubscriptions CreateOrReplace. + */ +public final class SnsSubscriptionsCreateOrReplaceSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * SnsSubscriptions_CreateOrReplace.json + */ + /** + * Sample code: SnsSubscriptions_CreateOrReplace. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + snsSubscriptionsCreateOrReplace(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.snsSubscriptions() + .define("Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])") + .withRegion("rteaofwy") + .withExistingResourceGroup("rgsnsSubscription") + .withTags(mapOf("key2041", "fakeTokenPlaceholder")) + .withProperties(new SnsSubscriptionProperties() + .withAwsProperties(new AwsSnsSubscriptionProperties().withEndpoint("ydbnfs") + .withOwner("vhrbkplsbvszhibsvziz") + .withProtocol("lcsebez") + .withSubscriptionArn("bis") + .withTopicArn("pdwndjemgtmwwnyvtjmveblsyq")) + .withPublicCloudConnectorsResourceId("zokwlgincdzvjml") + .withAwsAccountId("jehvmisbfwgnpihgfrkslaee") + .withArn("gnkqmddvoxalgskfwispx") + .withPublicCloudResourceName("si") + .withAwsSourceSchema("ikrkjsw") + .withAwsRegion("bkkaopxcwtfmxemxuilfhllcsixga") + .withAwsTags(mapOf("key588", "fakeTokenPlaceholder"))) + .create(); + } + + // Use "Map.of" if available + @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; + } +} +``` + +### SnsSubscriptions_Delete + +```java +/** + * Samples for SnsSubscriptions Delete. + */ +public final class SnsSubscriptionsDeleteSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * SnsSubscriptions_Delete.json + */ + /** + * Sample code: SnsSubscriptions_Delete. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void snsSubscriptionsDelete(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.snsSubscriptions() + .delete("rgsnsSubscription", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE); + } +} +``` + +### SnsSubscriptions_GetByResourceGroup + +```java +/** + * Samples for SnsSubscriptions GetByResourceGroup. + */ +public final class SnsSubscriptionsGetByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * SnsSubscriptions_Get.json + */ + /** + * Sample code: SnsSubscriptions_Get. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void snsSubscriptionsGet(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.snsSubscriptions() + .getByResourceGroupWithResponse("rgsnsSubscription", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE); + } +} +``` + +### SnsSubscriptions_List + +```java +/** + * Samples for SnsSubscriptions List. + */ +public final class SnsSubscriptionsListSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * SnsSubscriptions_ListBySubscription.json + */ + /** + * Sample code: SnsSubscriptions_ListBySubscription. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + snsSubscriptionsListBySubscription(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.snsSubscriptions().list(com.azure.core.util.Context.NONE); + } +} +``` + +### SnsSubscriptions_ListByResourceGroup + +```java +/** + * Samples for SnsSubscriptions ListByResourceGroup. + */ +public final class SnsSubscriptionsListByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * SnsSubscriptions_ListByResourceGroup.json + */ + /** + * Sample code: SnsSubscriptions_ListByResourceGroup. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + snsSubscriptionsListByResourceGroup(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.snsSubscriptions().listByResourceGroup("rgsnsSubscription", com.azure.core.util.Context.NONE); + } +} +``` + +### SnsSubscriptions_Update + +```java +import com.azure.resourcemanager.awsconnector.models.SnsSubscription; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for SnsSubscriptions Update. + */ +public final class SnsSubscriptionsUpdateSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * SnsSubscriptions_Update.json + */ + /** + * Sample code: SnsSubscriptions_Update. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void snsSubscriptionsUpdate(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + SnsSubscription resource = manager.snsSubscriptions() + .getByResourceGroupWithResponse("rgsnsSubscription", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE) + .getValue(); + resource.update().withTags(mapOf("key2758", "fakeTokenPlaceholder")).apply(); + } + + // Use "Map.of" if available + @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; + } +} +``` + +### SnsTopics_CreateOrReplace + +```java +import com.azure.resourcemanager.awsconnector.models.AwsSnsTopicProperties; +import com.azure.resourcemanager.awsconnector.models.LoggingConfigAutoGenerated; +import com.azure.resourcemanager.awsconnector.models.LoggingConfigProtocol; +import com.azure.resourcemanager.awsconnector.models.SnsTopicProperties; +import com.azure.resourcemanager.awsconnector.models.Subscription; +import com.azure.resourcemanager.awsconnector.models.TagAutoGenerated53; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for SnsTopics CreateOrReplace. + */ +public final class SnsTopicsCreateOrReplaceSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * SnsTopics_CreateOrReplace.json + */ + /** + * Sample code: SnsTopics_CreateOrReplace. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void snsTopicsCreateOrReplace(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.snsTopics() + .define("Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])") + .withRegion("vzzjtyjhqbty") + .withExistingResourceGroup("rgsnsTopic") + .withTags(mapOf("key5456", "fakeTokenPlaceholder")) + .withProperties(new SnsTopicProperties() + .withAwsProperties(new AwsSnsTopicProperties().withContentBasedDeduplication(true) + .withDeliveryStatusLogging(Arrays + .asList(new LoggingConfigAutoGenerated().withFailureFeedbackRoleArn("ygtlmetldtzqhoasmdit") + .withProtocol(LoggingConfigProtocol.APPLICATION) + .withSuccessFeedbackRoleArn("ersgnxrmfnrqhmyilsomcxxlza") + .withSuccessFeedbackSampleRate("iudedzrjawqzroytyyonpydzjzzmlj"))) + .withDisplayName("sanmplpvkvcorlhraijepxftlyeqwj") + .withFifoTopic(true) + .withKmsMasterKeyId("fakeTokenPlaceholder") + .withSignatureVersion("lpfgizlw") + .withSubscription(Arrays.asList( + new Subscription().withEndpoint("yuvwciasnlpnswnynse").withProtocol("zohpkxrrouufioztdmkw"))) + .withTags(Arrays.asList(new TagAutoGenerated53().withKey("fakeTokenPlaceholder") + .withValue("bxdamnevuybindqttmfvzotzqboj"))) + .withTopicArn("owersxkcdlhhnawxkmqlcjlzqlxtmj") + .withTopicName("lijmdexuvnfby") + .withTracingConfig("yrpvxmefnaexobhqvtdrj")) + .withPublicCloudConnectorsResourceId("didnyoylzwmnsjudmfwojgtjqsuypn") + .withAwsAccountId("wndmunvvkmoyxlrbsnowo") + .withArn("jjhuxiyhej") + .withPublicCloudResourceName("vwncs") + .withAwsSourceSchema("sxholwzdshjzccfoioytctdmjrmlpo") + .withAwsRegion("qbpwpfnzmmkh") + .withAwsTags(mapOf("key2577", "fakeTokenPlaceholder"))) + .create(); + } + + // Use "Map.of" if available + @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; + } +} +``` + +### SnsTopics_Delete + +```java +/** + * Samples for SnsTopics Delete. + */ +public final class SnsTopicsDeleteSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/SnsTopics_Delete. + * json + */ + /** + * Sample code: SnsTopics_Delete. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void snsTopicsDelete(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.snsTopics() + .delete("rgsnsTopic", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE); + } +} +``` + +### SnsTopics_GetByResourceGroup + +```java +/** + * Samples for SnsTopics GetByResourceGroup. + */ +public final class SnsTopicsGetByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/SnsTopics_Get.json + */ + /** + * Sample code: SnsTopics_Get. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void snsTopicsGet(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.snsTopics() + .getByResourceGroupWithResponse("rgsnsTopic", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE); + } +} +``` + +### SnsTopics_List + +```java +/** + * Samples for SnsTopics List. + */ +public final class SnsTopicsListSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * SnsTopics_ListBySubscription.json + */ + /** + * Sample code: SnsTopics_ListBySubscription. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void snsTopicsListBySubscription(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.snsTopics().list(com.azure.core.util.Context.NONE); + } +} +``` + +### SnsTopics_ListByResourceGroup + +```java +/** + * Samples for SnsTopics ListByResourceGroup. + */ +public final class SnsTopicsListByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * SnsTopics_ListByResourceGroup.json + */ + /** + * Sample code: SnsTopics_ListByResourceGroup. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + snsTopicsListByResourceGroup(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.snsTopics().listByResourceGroup("rgsnsTopic", com.azure.core.util.Context.NONE); + } +} +``` + +### SnsTopics_Update + +```java +import com.azure.resourcemanager.awsconnector.models.SnsTopic; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for SnsTopics Update. + */ +public final class SnsTopicsUpdateSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/SnsTopics_Update. + * json + */ + /** + * Sample code: SnsTopics_Update. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void snsTopicsUpdate(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + SnsTopic resource = manager.snsTopics() + .getByResourceGroupWithResponse("rgsnsTopic", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE) + .getValue(); + resource.update().withTags(mapOf("key169", "fakeTokenPlaceholder")).apply(); + } + + // Use "Map.of" if available + @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; + } +} +``` + +### SqsQueues_CreateOrReplace + +```java +import com.azure.resourcemanager.awsconnector.models.AwsSqsQueueProperties; +import com.azure.resourcemanager.awsconnector.models.SqsQueueProperties; +import com.azure.resourcemanager.awsconnector.models.TagAutoGenerated54; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for SqsQueues CreateOrReplace. + */ +public final class SqsQueuesCreateOrReplaceSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * SqsQueues_CreateOrReplace.json + */ + /** + * Sample code: SqsQueues_CreateOrReplace. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void sqsQueuesCreateOrReplace(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.sqsQueues() + .define("Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])") + .withRegion("fqdcgrb") + .withExistingResourceGroup("rgsqsQueue") + .withTags(mapOf("key7215", "fakeTokenPlaceholder")) + .withProperties( + new SqsQueueProperties() + .withAwsProperties(new AwsSqsQueueProperties().withArn("inbbhuaqgvjzwgepxaejncp") + .withContentBasedDeduplication(true) + .withDeduplicationScope("chijpjniyonhtrbqaojc") + .withDelaySeconds(22) + .withFifoQueue(true) + .withFifoThroughputLimit("vzanxuahrdoqizyblwtvse") + .withKmsDataKeyReusePeriodSeconds(1) + .withKmsMasterKeyId("fakeTokenPlaceholder") + .withMaximumMessageSize(19) + .withMessageRetentionPeriod(29) + .withQueueName("wfzhdsdzszyxfgptplvduwr") + .withQueueUrl("drfgltnvn") + .withReceiveMessageWaitTimeSeconds(4) + .withRedriveAllowPolicy(mapOf()) + .withRedrivePolicy(mapOf()) + .withSqsManagedSseEnabled(true) + .withTags(Arrays + .asList(new TagAutoGenerated54().withKey("fakeTokenPlaceholder").withValue("nxjcfolrd"))) + .withVisibilityTimeout(2)) + .withPublicCloudConnectorsResourceId("uvqyizhqjdsnemqktjsgfmjhyw") + .withAwsAccountId("bzpgnzvrnsakbglgcvaalyaiocj") + .withArn("jalxzvcntv") + .withPublicCloudResourceName("izckbeceljsvepm") + .withAwsSourceSchema("jnthvapvjtoexig") + .withAwsRegion("ffdlbwzdurjlolipnjsycrmeqsg") + .withAwsTags(mapOf("key9800", "fakeTokenPlaceholder"))) + .create(); + } + + // Use "Map.of" if available + @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; + } +} +``` + +### SqsQueues_Delete + +```java +/** + * Samples for SqsQueues Delete. + */ +public final class SqsQueuesDeleteSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/SqsQueues_Delete. + * json + */ + /** + * Sample code: SqsQueues_Delete. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void sqsQueuesDelete(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.sqsQueues() + .delete("rgsqsQueue", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE); + } +} +``` + +### SqsQueues_GetByResourceGroup + +```java +/** + * Samples for SqsQueues GetByResourceGroup. + */ +public final class SqsQueuesGetByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/SqsQueues_Get.json + */ + /** + * Sample code: SqsQueues_Get. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void sqsQueuesGet(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.sqsQueues() + .getByResourceGroupWithResponse("rgsqsQueue", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE); + } +} +``` + +### SqsQueues_List + +```java +/** + * Samples for SqsQueues List. + */ +public final class SqsQueuesListSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * SqsQueues_ListBySubscription.json + */ + /** + * Sample code: SqsQueues_ListBySubscription. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void sqsQueuesListBySubscription(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.sqsQueues().list(com.azure.core.util.Context.NONE); + } +} +``` + +### SqsQueues_ListByResourceGroup + +```java +/** + * Samples for SqsQueues ListByResourceGroup. + */ +public final class SqsQueuesListByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * SqsQueues_ListByResourceGroup.json + */ + /** + * Sample code: SqsQueues_ListByResourceGroup. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + sqsQueuesListByResourceGroup(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.sqsQueues().listByResourceGroup("rgsqsQueue", com.azure.core.util.Context.NONE); + } +} +``` + +### SqsQueues_Update + +```java +import com.azure.resourcemanager.awsconnector.models.SqsQueue; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for SqsQueues Update. + */ +public final class SqsQueuesUpdateSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/SqsQueues_Update. + * json + */ + /** + * Sample code: SqsQueues_Update. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void sqsQueuesUpdate(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + SqsQueue resource = manager.sqsQueues() + .getByResourceGroupWithResponse("rgsqsQueue", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE) + .getValue(); + resource.update().withTags(mapOf("key7679", "fakeTokenPlaceholder")).apply(); + } + + // Use "Map.of" if available + @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; + } +} +``` + +### SsmInstanceInformations_CreateOrReplace + +```java +import com.azure.resourcemanager.awsconnector.models.AwsSsmInstanceInformationProperties; +import com.azure.resourcemanager.awsconnector.models.InstanceAggregatedAssociationOverview; +import com.azure.resourcemanager.awsconnector.models.PingStatus; +import com.azure.resourcemanager.awsconnector.models.PingStatusEnumValue; +import com.azure.resourcemanager.awsconnector.models.PlatformType; +import com.azure.resourcemanager.awsconnector.models.PlatformTypeEnumValue; +import com.azure.resourcemanager.awsconnector.models.ResourceType; +import com.azure.resourcemanager.awsconnector.models.ResourceTypeEnumValue; +import com.azure.resourcemanager.awsconnector.models.SourceType; +import com.azure.resourcemanager.awsconnector.models.SourceTypeEnumValue; +import com.azure.resourcemanager.awsconnector.models.SsmInstanceInformationProperties; +import java.time.OffsetDateTime; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for SsmInstanceInformations CreateOrReplace. + */ +public final class SsmInstanceInformationsCreateOrReplaceSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * SsmInstanceInformations_CreateOrReplace.json + */ + /** + * Sample code: SsmInstanceInformations_CreateOrReplace. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + ssmInstanceInformationsCreateOrReplace(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.ssmInstanceInformations() + .define("Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])") + .withRegion("ermywoyxbvekjsddbgxzdiqctiy") + .withExistingResourceGroup("rgssmInstanceInformation") + .withTags(mapOf("key678", "fakeTokenPlaceholder")) + .withProperties( + new SsmInstanceInformationProperties() + .withAwsProperties( + new AwsSsmInstanceInformationProperties().withActivationId("wqzon") + .withAgentVersion("bnfjsoeipnlc") + .withAssociationOverview(new InstanceAggregatedAssociationOverview() + .withDetailedStatus("cbudhnfwcqmapsmzmdvjbnobfp") + .withInstanceAssociationStatusAggregatedCount(mapOf("key8401", 17))) + .withAssociationStatus("elhplvmlvhpwuyovunmrlynmhejdw") + .withComputerName("wweceaymirkelywqbxapvxzr") + .withIpAddress("httjvosg") + .withIamRole("izwdzmlugehvtmnssak") + .withInstanceId("iubqpfcejhxieuegbecgpkzanri") + .withIsLatestVersion(true) + .withLastAssociationExecutionDate(OffsetDateTime.parse("2024-10-08T03:53:10.068Z")) + .withLastPingDateTime(OffsetDateTime.parse("2024-10-08T03:53:10.068Z")) + .withLastSuccessfulAssociationExecutionDate( + OffsetDateTime.parse("2024-10-08T03:53:10.068Z")) + .withName("iubm") + .withPingStatus(new PingStatusEnumValue().withValue(PingStatus.CONNECTION_LOST)) + .withPlatformName("cbiheizlbfmmcdrsntrldk") + .withPlatformType(new PlatformTypeEnumValue().withValue(PlatformType.LINUX)) + .withPlatformVersion("eiopeklxdbhzvyxg") + .withRegistrationDate(OffsetDateTime.parse("2024-10-08T03:53:10.069Z")) + .withResourceType( + new ResourceTypeEnumValue().withValue(ResourceType.fromString("EC2Instance"))) + .withSourceId("mfupyczzkgmebrayfgrmxcdouve") + .withSourceType( + new SourceTypeEnumValue().withValue(SourceType.fromString("AWS::EC2::Instance")))) + .withPublicCloudConnectorsResourceId("hsdju") + .withAwsAccountId("pjfy") + .withArn("oxfqehraraycsdhslhhkjdu") + .withPublicCloudResourceName("nmnanlhecnocoemxsevyl") + .withAwsSourceSchema("wetpdek") + .withAwsRegion("mzethaciakqyywjomklr") + .withAwsTags(mapOf("key8309", "fakeTokenPlaceholder"))) + .create(); + } + + // Use "Map.of" if available + @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; + } +} +``` + +### SsmInstanceInformations_Delete + +```java +/** + * Samples for SsmInstanceInformations Delete. + */ +public final class SsmInstanceInformationsDeleteSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * SsmInstanceInformations_Delete.json + */ + /** + * Sample code: SsmInstanceInformations_Delete. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + ssmInstanceInformationsDelete(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.ssmInstanceInformations() + .delete("rgssmInstanceInformation", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE); + } +} +``` + +### SsmInstanceInformations_GetByResourceGroup + +```java +/** + * Samples for SsmInstanceInformations GetByResourceGroup. + */ +public final class SsmInstanceInformationsGetByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * SsmInstanceInformations_Get.json + */ + /** + * Sample code: SsmInstanceInformations_Get. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void ssmInstanceInformationsGet(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.ssmInstanceInformations() + .getByResourceGroupWithResponse("rgssmInstanceInformation", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE); + } +} +``` + +### SsmInstanceInformations_List + +```java +/** + * Samples for SsmInstanceInformations List. + */ +public final class SsmInstanceInformationsListSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * SsmInstanceInformations_ListBySubscription.json + */ + /** + * Sample code: SsmInstanceInformations_ListBySubscription. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + ssmInstanceInformationsListBySubscription(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.ssmInstanceInformations().list(com.azure.core.util.Context.NONE); + } +} +``` + +### SsmInstanceInformations_ListByResourceGroup + +```java +/** + * Samples for SsmInstanceInformations ListByResourceGroup. + */ +public final class SsmInstanceInformationsListByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * SsmInstanceInformations_ListByResourceGroup.json + */ + /** + * Sample code: SsmInstanceInformations_ListByResourceGroup. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + ssmInstanceInformationsListByResourceGroup(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.ssmInstanceInformations() + .listByResourceGroup("rgssmInstanceInformation", com.azure.core.util.Context.NONE); + } +} +``` + +### SsmInstanceInformations_Update + +```java +import com.azure.resourcemanager.awsconnector.models.SsmInstanceInformation; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for SsmInstanceInformations Update. + */ +public final class SsmInstanceInformationsUpdateSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * SsmInstanceInformations_Update.json + */ + /** + * Sample code: SsmInstanceInformations_Update. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + ssmInstanceInformationsUpdate(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + SsmInstanceInformation resource = manager.ssmInstanceInformations() + .getByResourceGroupWithResponse("rgssmInstanceInformation", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE) + .getValue(); + resource.update().withTags(mapOf("key2080", "fakeTokenPlaceholder")).apply(); + } + + // Use "Map.of" if available + @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; + } +} +``` + +### SsmParameters_CreateOrReplace + +```java +import com.azure.resourcemanager.awsconnector.models.AwsSsmParameterProperties; +import com.azure.resourcemanager.awsconnector.models.DataType; +import com.azure.resourcemanager.awsconnector.models.SsmParameterProperties; +import com.azure.resourcemanager.awsconnector.models.Tier; +import com.azure.resourcemanager.awsconnector.models.Type; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for SsmParameters CreateOrReplace. + */ +public final class SsmParametersCreateOrReplaceSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * SsmParameters_CreateOrReplace.json + */ + /** + * Sample code: SsmParameters_CreateOrReplace. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + ssmParametersCreateOrReplace(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.ssmParameters() + .define("Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])") + .withRegion("ymzdygzdzd") + .withExistingResourceGroup("rgssmParameter") + .withTags(mapOf("key8492", "fakeTokenPlaceholder")) + .withProperties(new SsmParameterProperties() + .withAwsProperties(new AwsSsmParameterProperties().withAllowedPattern("fzyaodp") + .withDataType(DataType.AWS_EC2_IMAGE) + .withDescription("aygihzeaxvodxejsnmnkp") + .withName("wvvx") + .withPolicies("ahuep") + .withTier(Tier.ADVANCED) + .withType(Type.fromString("String")) + .withValue("wecofehml")) + .withPublicCloudConnectorsResourceId("mhesebimtvrlvvbkiswfalddqhilrp") + .withAwsAccountId("kxxdlwjrdytmfznuxkd") + .withArn("rzxpagnscd") + .withPublicCloudResourceName("sdtc") + .withAwsSourceSchema("yuexfxhmpunhdtxzdrkz") + .withAwsRegion("ujrrnxtayjeezffngymhkfhtrgjvpz") + .withAwsTags(mapOf("key8903", "fakeTokenPlaceholder"))) + .create(); + } + + // Use "Map.of" if available + @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; + } +} +``` + +### SsmParameters_Delete + +```java +/** + * Samples for SsmParameters Delete. + */ +public final class SsmParametersDeleteSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * SsmParameters_Delete.json + */ + /** + * Sample code: SsmParameters_Delete. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void ssmParametersDelete(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.ssmParameters() + .delete("rgssmParameter", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE); + } +} +``` + +### SsmParameters_GetByResourceGroup + +```java +/** + * Samples for SsmParameters GetByResourceGroup. + */ +public final class SsmParametersGetByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/SsmParameters_Get. + * json + */ + /** + * Sample code: SsmParameters_Get. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void ssmParametersGet(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.ssmParameters() + .getByResourceGroupWithResponse("rgssmParameter", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE); + } +} +``` + +### SsmParameters_List + +```java +/** + * Samples for SsmParameters List. + */ +public final class SsmParametersListSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * SsmParameters_ListBySubscription.json + */ + /** + * Sample code: SsmParameters_ListBySubscription. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + ssmParametersListBySubscription(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.ssmParameters().list(com.azure.core.util.Context.NONE); + } +} +``` + +### SsmParameters_ListByResourceGroup + +```java +/** + * Samples for SsmParameters ListByResourceGroup. + */ +public final class SsmParametersListByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * SsmParameters_ListByResourceGroup.json + */ + /** + * Sample code: SsmParameters_ListByResourceGroup. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + ssmParametersListByResourceGroup(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.ssmParameters().listByResourceGroup("rgssmParameter", com.azure.core.util.Context.NONE); + } +} +``` + +### SsmParameters_Update + +```java +import com.azure.resourcemanager.awsconnector.models.SsmParameter; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for SsmParameters Update. + */ +public final class SsmParametersUpdateSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * SsmParameters_Update.json + */ + /** + * Sample code: SsmParameters_Update. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void ssmParametersUpdate(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + SsmParameter resource = manager.ssmParameters() + .getByResourceGroupWithResponse("rgssmParameter", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE) + .getValue(); + resource.update().withTags(mapOf("key4464", "fakeTokenPlaceholder")).apply(); + } + + // Use "Map.of" if available + @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; + } +} +``` + +### SsmResourceComplianceSummaryItems_CreateOrReplace + +```java +import com.azure.resourcemanager.awsconnector.models.AwsSsmResourceComplianceSummaryItemProperties; +import com.azure.resourcemanager.awsconnector.models.ComplianceExecutionSummary; +import com.azure.resourcemanager.awsconnector.models.ComplianceSeverity; +import com.azure.resourcemanager.awsconnector.models.ComplianceSeverityEnumValue; +import com.azure.resourcemanager.awsconnector.models.ComplianceStatus; +import com.azure.resourcemanager.awsconnector.models.ComplianceStatusEnumValue; +import com.azure.resourcemanager.awsconnector.models.CompliantSummary; +import com.azure.resourcemanager.awsconnector.models.NonCompliantSummary; +import com.azure.resourcemanager.awsconnector.models.SeveritySummary; +import com.azure.resourcemanager.awsconnector.models.SsmResourceComplianceSummaryItemProperties; +import java.time.OffsetDateTime; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for SsmResourceComplianceSummaryItems CreateOrReplace. + */ +public final class SsmResourceComplianceSummaryItemsCreateOrReplaceSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * SsmResourceComplianceSummaryItems_CreateOrReplace.json + */ + /** + * Sample code: SsmResourceComplianceSummaryItems_CreateOrReplace. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void ssmResourceComplianceSummaryItemsCreateOrReplace( + com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.ssmResourceComplianceSummaryItems() + .define("Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])") + .withRegion("kr") + .withExistingResourceGroup("rgssmResourceComplianceSummaryItem") + .withTags(mapOf("key3147", "fakeTokenPlaceholder")) + .withProperties(new SsmResourceComplianceSummaryItemProperties() + .withAwsProperties(new AwsSsmResourceComplianceSummaryItemProperties().withComplianceType("fblmjhswva") + .withCompliantSummary(new CompliantSummary().withCompliantCount(2) + .withSeveritySummary(new SeveritySummary().withCriticalCount(7) + .withHighCount(18) + .withInformationalCount(17) + .withLowCount(19) + .withMediumCount(20) + .withUnspecifiedCount(11))) + .withExecutionSummary(new ComplianceExecutionSummary().withExecutionId("ngwakxvtdysew") + .withExecutionTime(OffsetDateTime.parse("2024-10-08T03:48:53.913Z")) + .withExecutionType("wjneewwqlrtdntdsot")) + .withNonCompliantSummary(new NonCompliantSummary().withNonCompliantCount(18) + .withSeveritySummary(new SeveritySummary().withCriticalCount(7) + .withHighCount(18) + .withInformationalCount(17) + .withLowCount(19) + .withMediumCount(20) + .withUnspecifiedCount(11))) + .withOverallSeverity(new ComplianceSeverityEnumValue().withValue(ComplianceSeverity.CRITICAL)) + .withResourceId("muhsukivzcqvnlxiyrudvdymmii") + .withResourceType("rphjdvzvwasngsqoozoivduj") + .withStatus(new ComplianceStatusEnumValue().withValue(ComplianceStatus.COMPLIANT))) + .withPublicCloudConnectorsResourceId("lghqnauuu") + .withAwsAccountId("taqkptjbkqarwksdmfumdyi") + .withArn("s") + .withPublicCloudResourceName("qvohsbyuajd") + .withAwsSourceSchema("ppxlpfsm") + .withAwsRegion("hkemdhobdaxfwcvdjohvqtwpmjezu") + .withAwsTags(mapOf("key3567", "fakeTokenPlaceholder"))) + .create(); + } + + // Use "Map.of" if available + @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; + } +} +``` + +### SsmResourceComplianceSummaryItems_Delete + +```java +/** + * Samples for SsmResourceComplianceSummaryItems Delete. + */ +public final class SsmResourceComplianceSummaryItemsDeleteSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * SsmResourceComplianceSummaryItems_Delete.json + */ + /** + * Sample code: SsmResourceComplianceSummaryItems_Delete. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + ssmResourceComplianceSummaryItemsDelete(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.ssmResourceComplianceSummaryItems() + .delete("rgssmResourceComplianceSummaryItem", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE); + } +} +``` + +### SsmResourceComplianceSummaryItems_GetByResourceGroup + +```java +/** + * Samples for SsmResourceComplianceSummaryItems GetByResourceGroup. + */ +public final class SsmResourceComplianceSummaryItemsGetByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * SsmResourceComplianceSummaryItems_Get.json + */ + /** + * Sample code: SsmResourceComplianceSummaryItems_Get. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + ssmResourceComplianceSummaryItemsGet(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.ssmResourceComplianceSummaryItems() + .getByResourceGroupWithResponse("rgssmResourceComplianceSummaryItem", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE); + } +} +``` + +### SsmResourceComplianceSummaryItems_List + +```java +/** + * Samples for SsmResourceComplianceSummaryItems List. + */ +public final class SsmResourceComplianceSummaryItemsListSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * SsmResourceComplianceSummaryItems_ListBySubscription.json + */ + /** + * Sample code: SsmResourceComplianceSummaryItems_ListBySubscription. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void ssmResourceComplianceSummaryItemsListBySubscription( + com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.ssmResourceComplianceSummaryItems().list(com.azure.core.util.Context.NONE); + } +} +``` + +### SsmResourceComplianceSummaryItems_ListByResourceGroup + +```java +/** + * Samples for SsmResourceComplianceSummaryItems ListByResourceGroup. + */ +public final class SsmResourceComplianceSummaryItemsListByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * SsmResourceComplianceSummaryItems_ListByResourceGroup.json + */ + /** + * Sample code: SsmResourceComplianceSummaryItems_ListByResourceGroup. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void ssmResourceComplianceSummaryItemsListByResourceGroup( + com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.ssmResourceComplianceSummaryItems() + .listByResourceGroup("rgssmResourceComplianceSummaryItem", com.azure.core.util.Context.NONE); + } +} +``` + +### SsmResourceComplianceSummaryItems_Update + +```java +import com.azure.resourcemanager.awsconnector.models.SsmResourceComplianceSummaryItem; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for SsmResourceComplianceSummaryItems Update. + */ +public final class SsmResourceComplianceSummaryItemsUpdateSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * SsmResourceComplianceSummaryItems_Update.json + */ + /** + * Sample code: SsmResourceComplianceSummaryItems_Update. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + ssmResourceComplianceSummaryItemsUpdate(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + SsmResourceComplianceSummaryItem resource = manager.ssmResourceComplianceSummaryItems() + .getByResourceGroupWithResponse("rgssmResourceComplianceSummaryItem", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE) + .getValue(); + resource.update().withTags(mapOf("key7866", "fakeTokenPlaceholder")).apply(); + } + + // Use "Map.of" if available + @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; + } +} +``` + +### WafWebAclSummaries_CreateOrReplace + +```java +import com.azure.resourcemanager.awsconnector.models.AwsWafWebAclSummaryProperties; +import com.azure.resourcemanager.awsconnector.models.WafWebAclSummaryProperties; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for WafWebAclSummaries CreateOrReplace. + */ +public final class WafWebAclSummariesCreateOrReplaceSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * WafWebAclSummaries_CreateOrReplace.json + */ + /** + * Sample code: WafWebAclSummaries_CreateOrReplace. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + wafWebAclSummariesCreateOrReplace(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.wafWebAclSummaries() + .define("Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])") + .withRegion("bpposymcoxqcolyqmtfpvoh") + .withExistingResourceGroup("rgwafWebACLSummary") + .withTags(mapOf("key2706", "fakeTokenPlaceholder")) + .withProperties(new WafWebAclSummaryProperties() + .withAwsProperties( + new AwsWafWebAclSummaryProperties().withName("rrwaevjnkowkxlccaw").withWebAclId("hh")) + .withPublicCloudConnectorsResourceId("kzgpy") + .withAwsAccountId("ovompqprisse") + .withArn("gorpeccxrhf") + .withPublicCloudResourceName("lejvxofzybufrazktgotrowforlsrp") + .withAwsSourceSchema("afgujkvjwspbbruhwbeji") + .withAwsRegion("nnnmvzddsej") + .withAwsTags(mapOf("key8890", "fakeTokenPlaceholder"))) + .create(); + } + + // Use "Map.of" if available + @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; + } +} +``` + +### WafWebAclSummaries_Delete + +```java +/** + * Samples for WafWebAclSummaries Delete. + */ +public final class WafWebAclSummariesDeleteSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * WafWebAclSummaries_Delete.json + */ + /** + * Sample code: WafWebAclSummaries_Delete. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void wafWebAclSummariesDelete(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.wafWebAclSummaries() + .delete("rgwafWebACLSummary", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE); + } +} +``` + +### WafWebAclSummaries_GetByResourceGroup + +```java +/** + * Samples for WafWebAclSummaries GetByResourceGroup. + */ +public final class WafWebAclSummariesGetByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * WafWebAclSummaries_Get.json + */ + /** + * Sample code: WafWebAclSummaries_Get. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void wafWebAclSummariesGet(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.wafWebAclSummaries() + .getByResourceGroupWithResponse("rgwafWebACLSummary", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE); + } +} +``` + +### WafWebAclSummaries_List + +```java +/** + * Samples for WafWebAclSummaries List. + */ +public final class WafWebAclSummariesListSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * WafWebAclSummaries_ListBySubscription.json + */ + /** + * Sample code: WafWebAclSummaries_ListBySubscription. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + wafWebAclSummariesListBySubscription(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.wafWebAclSummaries().list(com.azure.core.util.Context.NONE); + } +} +``` + +### WafWebAclSummaries_ListByResourceGroup + +```java +/** + * Samples for WafWebAclSummaries ListByResourceGroup. + */ +public final class WafWebAclSummariesListByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * WafWebAclSummaries_ListByResourceGroup.json + */ + /** + * Sample code: WafWebAclSummaries_ListByResourceGroup. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + wafWebAclSummariesListByResourceGroup(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.wafWebAclSummaries().listByResourceGroup("rgwafWebACLSummary", com.azure.core.util.Context.NONE); + } +} +``` + +### WafWebAclSummaries_Update + +```java +import com.azure.resourcemanager.awsconnector.models.WafWebAclSummary; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for WafWebAclSummaries Update. + */ +public final class WafWebAclSummariesUpdateSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * WafWebAclSummaries_Update.json + */ + /** + * Sample code: WafWebAclSummaries_Update. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void wafWebAclSummariesUpdate(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + WafWebAclSummary resource = manager.wafWebAclSummaries() + .getByResourceGroupWithResponse("rgwafWebACLSummary", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE) + .getValue(); + resource.update().withTags(mapOf("key7911", "fakeTokenPlaceholder")).apply(); + } + + // Use "Map.of" if available + @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; + } +} +``` + +### Wafv2LoggingConfigurations_CreateOrReplace + +```java +import com.azure.resourcemanager.awsconnector.models.Action; +import com.azure.resourcemanager.awsconnector.models.ActionConditionModelProperties; +import com.azure.resourcemanager.awsconnector.models.AwsWafv2LoggingConfigurationProperties; +import com.azure.resourcemanager.awsconnector.models.Condition; +import com.azure.resourcemanager.awsconnector.models.DefaultBehavior; +import com.azure.resourcemanager.awsconnector.models.FieldToMatch; +import com.azure.resourcemanager.awsconnector.models.FilterAutoGenerated; +import com.azure.resourcemanager.awsconnector.models.FilterBehavior; +import com.azure.resourcemanager.awsconnector.models.FilterRequirement; +import com.azure.resourcemanager.awsconnector.models.LabelNameConditionModelProperties; +import com.azure.resourcemanager.awsconnector.models.LoggingFilterModelProperties; +import com.azure.resourcemanager.awsconnector.models.SingleHeaderModelProperties; +import com.azure.resourcemanager.awsconnector.models.Wafv2LoggingConfigurationProperties; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for Wafv2LoggingConfigurations CreateOrReplace. + */ +public final class Wafv2LoggingConfigurationsCreateOrReplaceSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * Wafv2LoggingConfigurations_CreateOrReplace.json + */ + /** + * Sample code: Wafv2LoggingConfigurations_CreateOrReplace. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + wafv2LoggingConfigurationsCreateOrReplace(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.wafv2LoggingConfigurations() + .define("Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])") + .withRegion("miqjaa") + .withExistingResourceGroup("rgwafv2LoggingConfiguration") + .withTags(mapOf("key643", "fakeTokenPlaceholder")) + .withProperties( + new Wafv2LoggingConfigurationProperties() + .withAwsProperties(new AwsWafv2LoggingConfigurationProperties() + .withLogDestinationConfigs(Arrays.asList("lyxpldjogdqpffwthdto")) + .withLoggingFilter(new LoggingFilterModelProperties().withDefaultBehavior(DefaultBehavior.DROP) + .withFilters(Arrays.asList(new FilterAutoGenerated().withBehavior(FilterBehavior.DROP) + .withConditions(Arrays.asList(new Condition() + .withActionCondition(new ActionConditionModelProperties().withAction(Action.ALLOW)) + .withLabelNameCondition(new LabelNameConditionModelProperties() + .withLabelName("oypkvstyighnjavknhfon")))) + .withRequirement(FilterRequirement.MEETS_ALL)))) + .withManagedByFirewallManager(true) + .withRedactedFields(Arrays.asList( + new FieldToMatch().withSingleHeader(new SingleHeaderModelProperties().withName("bfqodp")))) + .withResourceArn("bnozeamipjgc")) + .withPublicCloudConnectorsResourceId("towziecfnbhswtodyqkkqrtatogbl") + .withAwsAccountId("opcrasgtswrifmkonwy") + .withArn("vvamx") + .withPublicCloudResourceName("eniprewwy") + .withAwsSourceSchema("ywgazosjmcwothayguih") + .withAwsRegion("kkwxoqqqiadksrmfpvopq") + .withAwsTags(mapOf("key5392", "fakeTokenPlaceholder"))) + .create(); + } + + // Use "Map.of" if available + @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; + } +} +``` + +### Wafv2LoggingConfigurations_Delete + +```java +/** + * Samples for Wafv2LoggingConfigurations Delete. + */ +public final class Wafv2LoggingConfigurationsDeleteSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * Wafv2LoggingConfigurations_Delete.json + */ + /** + * Sample code: Wafv2LoggingConfigurations_Delete. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + wafv2LoggingConfigurationsDelete(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.wafv2LoggingConfigurations() + .delete("rgwafv2LoggingConfiguration", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE); + } +} +``` + +### Wafv2LoggingConfigurations_GetByResourceGroup + +```java +/** + * Samples for Wafv2LoggingConfigurations GetByResourceGroup. + */ +public final class Wafv2LoggingConfigurationsGetByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * Wafv2LoggingConfigurations_Get.json + */ + /** + * Sample code: Wafv2LoggingConfigurations_Get. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + wafv2LoggingConfigurationsGet(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.wafv2LoggingConfigurations() + .getByResourceGroupWithResponse("rgwafv2LoggingConfiguration", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE); + } +} +``` + +### Wafv2LoggingConfigurations_List + +```java +/** + * Samples for Wafv2LoggingConfigurations List. + */ +public final class Wafv2LoggingConfigurationsListSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * Wafv2LoggingConfigurations_ListBySubscription.json + */ + /** + * Sample code: Wafv2LoggingConfigurations_ListBySubscription. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void wafv2LoggingConfigurationsListBySubscription( + com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.wafv2LoggingConfigurations().list(com.azure.core.util.Context.NONE); + } +} +``` + +### Wafv2LoggingConfigurations_ListByResourceGroup + +```java +/** + * Samples for Wafv2LoggingConfigurations ListByResourceGroup. + */ +public final class Wafv2LoggingConfigurationsListByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * Wafv2LoggingConfigurations_ListByResourceGroup.json + */ + /** + * Sample code: Wafv2LoggingConfigurations_ListByResourceGroup. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void wafv2LoggingConfigurationsListByResourceGroup( + com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.wafv2LoggingConfigurations() + .listByResourceGroup("rgwafv2LoggingConfiguration", com.azure.core.util.Context.NONE); + } +} +``` + +### Wafv2LoggingConfigurations_Update + +```java +import com.azure.resourcemanager.awsconnector.models.Wafv2LoggingConfiguration; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for Wafv2LoggingConfigurations Update. + */ +public final class Wafv2LoggingConfigurationsUpdateSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * Wafv2LoggingConfigurations_Update.json + */ + /** + * Sample code: Wafv2LoggingConfigurations_Update. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + wafv2LoggingConfigurationsUpdate(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + Wafv2LoggingConfiguration resource = manager.wafv2LoggingConfigurations() + .getByResourceGroupWithResponse("rgwafv2LoggingConfiguration", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE) + .getValue(); + resource.update().withTags(mapOf("key6151", "fakeTokenPlaceholder")).apply(); + } + + // Use "Map.of" if available + @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/awsconnector/azure-resourcemanager-awsconnector/pom.xml b/sdk/awsconnector/azure-resourcemanager-awsconnector/pom.xml new file mode 100644 index 000000000000..8f66ff55d72c --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/pom.xml @@ -0,0 +1,63 @@ + + + 4.0.0 + + com.azure + azure-client-sdk-parent + 1.7.0 + ../../parents/azure-client-sdk-parent + + + com.azure.resourcemanager + azure-resourcemanager-awsconnector + 1.0.0-beta.1 + jar + + Microsoft Azure SDK for awsconnector Management + This package contains Microsoft Azure SDK for awsconnector Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt. Microsoft.AwsConnector Resource Provider management API. Package tag package-2024-12-01. + https://github.com/Azure/azure-sdk-for-java + + + + 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 + 0 + 0 + true + false + + + + com.azure + azure-core + 1.53.0 + + + com.azure + azure-core-management + 1.15.4 + + + diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/AwsconnectorManager.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/AwsconnectorManager.java new file mode 100644 index 000000000000..b29943c59260 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/AwsconnectorManager.java @@ -0,0 +1,2117 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector; + +import com.azure.core.credential.TokenCredential; +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.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; +import com.azure.resourcemanager.awsconnector.fluent.MicrosoftAwsConnector; +import com.azure.resourcemanager.awsconnector.implementation.AccessAnalyzerAnalyzersImpl; +import com.azure.resourcemanager.awsconnector.implementation.AcmCertificateSummariesImpl; +import com.azure.resourcemanager.awsconnector.implementation.ApiGatewayRestApisImpl; +import com.azure.resourcemanager.awsconnector.implementation.ApiGatewayStagesImpl; +import com.azure.resourcemanager.awsconnector.implementation.AppSyncGraphqlApisImpl; +import com.azure.resourcemanager.awsconnector.implementation.AutoScalingAutoScalingGroupsImpl; +import com.azure.resourcemanager.awsconnector.implementation.CloudFormationStackSetsImpl; +import com.azure.resourcemanager.awsconnector.implementation.CloudFormationStacksImpl; +import com.azure.resourcemanager.awsconnector.implementation.CloudFrontDistributionsImpl; +import com.azure.resourcemanager.awsconnector.implementation.CloudTrailTrailsImpl; +import com.azure.resourcemanager.awsconnector.implementation.CloudWatchAlarmsImpl; +import com.azure.resourcemanager.awsconnector.implementation.CodeBuildProjectsImpl; +import com.azure.resourcemanager.awsconnector.implementation.CodeBuildSourceCredentialsInfosImpl; +import com.azure.resourcemanager.awsconnector.implementation.ConfigServiceConfigurationRecorderStatusesImpl; +import com.azure.resourcemanager.awsconnector.implementation.ConfigServiceConfigurationRecordersImpl; +import com.azure.resourcemanager.awsconnector.implementation.ConfigServiceDeliveryChannelsImpl; +import com.azure.resourcemanager.awsconnector.implementation.DatabaseMigrationServiceReplicationInstancesImpl; +import com.azure.resourcemanager.awsconnector.implementation.DaxClustersImpl; +import com.azure.resourcemanager.awsconnector.implementation.DynamoDbContinuousBackupsDescriptionsImpl; +import com.azure.resourcemanager.awsconnector.implementation.DynamoDbTablesImpl; +import com.azure.resourcemanager.awsconnector.implementation.Ec2AccountAttributesImpl; +import com.azure.resourcemanager.awsconnector.implementation.Ec2AddressesImpl; +import com.azure.resourcemanager.awsconnector.implementation.Ec2FlowLogsImpl; +import com.azure.resourcemanager.awsconnector.implementation.Ec2ImagesImpl; +import com.azure.resourcemanager.awsconnector.implementation.Ec2InstanceStatusesImpl; +import com.azure.resourcemanager.awsconnector.implementation.Ec2InstancesImpl; +import com.azure.resourcemanager.awsconnector.implementation.Ec2IpamsImpl; +import com.azure.resourcemanager.awsconnector.implementation.Ec2KeyPairsImpl; +import com.azure.resourcemanager.awsconnector.implementation.Ec2NetworkAclsImpl; +import com.azure.resourcemanager.awsconnector.implementation.Ec2NetworkInterfacesImpl; +import com.azure.resourcemanager.awsconnector.implementation.Ec2RouteTablesImpl; +import com.azure.resourcemanager.awsconnector.implementation.Ec2SecurityGroupsImpl; +import com.azure.resourcemanager.awsconnector.implementation.Ec2SnapshotsImpl; +import com.azure.resourcemanager.awsconnector.implementation.Ec2SubnetsImpl; +import com.azure.resourcemanager.awsconnector.implementation.Ec2VolumesImpl; +import com.azure.resourcemanager.awsconnector.implementation.Ec2VpcEndpointsImpl; +import com.azure.resourcemanager.awsconnector.implementation.Ec2VpcPeeringConnectionsImpl; +import com.azure.resourcemanager.awsconnector.implementation.Ec2VpcsImpl; +import com.azure.resourcemanager.awsconnector.implementation.EcrImageDetailsImpl; +import com.azure.resourcemanager.awsconnector.implementation.EcrRepositoriesImpl; +import com.azure.resourcemanager.awsconnector.implementation.EcsClustersImpl; +import com.azure.resourcemanager.awsconnector.implementation.EcsServicesImpl; +import com.azure.resourcemanager.awsconnector.implementation.EcsTaskDefinitionsImpl; +import com.azure.resourcemanager.awsconnector.implementation.EfsFileSystemsImpl; +import com.azure.resourcemanager.awsconnector.implementation.EfsMountTargetsImpl; +import com.azure.resourcemanager.awsconnector.implementation.EksClustersImpl; +import com.azure.resourcemanager.awsconnector.implementation.EksNodegroupsImpl; +import com.azure.resourcemanager.awsconnector.implementation.ElasticBeanstalkApplicationsImpl; +import com.azure.resourcemanager.awsconnector.implementation.ElasticBeanstalkConfigurationTemplatesImpl; +import com.azure.resourcemanager.awsconnector.implementation.ElasticBeanstalkEnvironmentsImpl; +import com.azure.resourcemanager.awsconnector.implementation.ElasticLoadBalancingV2ListenersImpl; +import com.azure.resourcemanager.awsconnector.implementation.ElasticLoadBalancingV2LoadBalancersImpl; +import com.azure.resourcemanager.awsconnector.implementation.ElasticLoadBalancingV2TargetGroupsImpl; +import com.azure.resourcemanager.awsconnector.implementation.ElasticLoadBalancingv2TargetHealthDescriptionsImpl; +import com.azure.resourcemanager.awsconnector.implementation.EmrClusterSummariesImpl; +import com.azure.resourcemanager.awsconnector.implementation.EmrClustersImpl; +import com.azure.resourcemanager.awsconnector.implementation.GuardDutyDetectorsImpl; +import com.azure.resourcemanager.awsconnector.implementation.IamAccessKeyLastUsedsImpl; +import com.azure.resourcemanager.awsconnector.implementation.IamAccessKeyMetadataInfoesImpl; +import com.azure.resourcemanager.awsconnector.implementation.IamGroupsImpl; +import com.azure.resourcemanager.awsconnector.implementation.IamInstanceProfilesImpl; +import com.azure.resourcemanager.awsconnector.implementation.IamMfaDevicesImpl; +import com.azure.resourcemanager.awsconnector.implementation.IamPasswordPoliciesImpl; +import com.azure.resourcemanager.awsconnector.implementation.IamPolicyVersionsImpl; +import com.azure.resourcemanager.awsconnector.implementation.IamRolesImpl; +import com.azure.resourcemanager.awsconnector.implementation.IamServerCertificatesImpl; +import com.azure.resourcemanager.awsconnector.implementation.IamVirtualMfaDevicesImpl; +import com.azure.resourcemanager.awsconnector.implementation.KmsAliasesImpl; +import com.azure.resourcemanager.awsconnector.implementation.KmsKeysImpl; +import com.azure.resourcemanager.awsconnector.implementation.LambdaFunctionCodeLocationsImpl; +import com.azure.resourcemanager.awsconnector.implementation.LambdaFunctionsImpl; +import com.azure.resourcemanager.awsconnector.implementation.LightsailBucketsImpl; +import com.azure.resourcemanager.awsconnector.implementation.LightsailInstancesImpl; +import com.azure.resourcemanager.awsconnector.implementation.LogsLogGroupsImpl; +import com.azure.resourcemanager.awsconnector.implementation.LogsLogStreamsImpl; +import com.azure.resourcemanager.awsconnector.implementation.LogsMetricFiltersImpl; +import com.azure.resourcemanager.awsconnector.implementation.LogsSubscriptionFiltersImpl; +import com.azure.resourcemanager.awsconnector.implementation.Macie2JobSummariesImpl; +import com.azure.resourcemanager.awsconnector.implementation.MacieAllowListsImpl; +import com.azure.resourcemanager.awsconnector.implementation.MicrosoftAwsConnectorBuilder; +import com.azure.resourcemanager.awsconnector.implementation.NetworkFirewallFirewallPoliciesImpl; +import com.azure.resourcemanager.awsconnector.implementation.NetworkFirewallFirewallsImpl; +import com.azure.resourcemanager.awsconnector.implementation.NetworkFirewallRuleGroupsImpl; +import com.azure.resourcemanager.awsconnector.implementation.OpenSearchDomainStatusesImpl; +import com.azure.resourcemanager.awsconnector.implementation.OperationsImpl; +import com.azure.resourcemanager.awsconnector.implementation.OrganizationsAccountsImpl; +import com.azure.resourcemanager.awsconnector.implementation.OrganizationsOrganizationsImpl; +import com.azure.resourcemanager.awsconnector.implementation.RdsDbClustersImpl; +import com.azure.resourcemanager.awsconnector.implementation.RdsDbInstancesImpl; +import com.azure.resourcemanager.awsconnector.implementation.RdsDbSnapshotAttributesResultsImpl; +import com.azure.resourcemanager.awsconnector.implementation.RdsDbSnapshotsImpl; +import com.azure.resourcemanager.awsconnector.implementation.RdsEventSubscriptionsImpl; +import com.azure.resourcemanager.awsconnector.implementation.RdsExportTasksImpl; +import com.azure.resourcemanager.awsconnector.implementation.RedshiftClusterParameterGroupsImpl; +import com.azure.resourcemanager.awsconnector.implementation.RedshiftClustersImpl; +import com.azure.resourcemanager.awsconnector.implementation.Route53DomainsDomainSummariesImpl; +import com.azure.resourcemanager.awsconnector.implementation.Route53HostedZonesImpl; +import com.azure.resourcemanager.awsconnector.implementation.Route53ResourceRecordSetsImpl; +import com.azure.resourcemanager.awsconnector.implementation.S3AccessPointsImpl; +import com.azure.resourcemanager.awsconnector.implementation.S3BucketPoliciesImpl; +import com.azure.resourcemanager.awsconnector.implementation.S3BucketsImpl; +import com.azure.resourcemanager.awsconnector.implementation.S3ControlMultiRegionAccessPointPolicyDocumentsImpl; +import com.azure.resourcemanager.awsconnector.implementation.SageMakerAppsImpl; +import com.azure.resourcemanager.awsconnector.implementation.SageMakerNotebookInstanceSummariesImpl; +import com.azure.resourcemanager.awsconnector.implementation.SecretsManagerResourcePoliciesImpl; +import com.azure.resourcemanager.awsconnector.implementation.SecretsManagerSecretsImpl; +import com.azure.resourcemanager.awsconnector.implementation.SnsSubscriptionsImpl; +import com.azure.resourcemanager.awsconnector.implementation.SnsTopicsImpl; +import com.azure.resourcemanager.awsconnector.implementation.SqsQueuesImpl; +import com.azure.resourcemanager.awsconnector.implementation.SsmInstanceInformationsImpl; +import com.azure.resourcemanager.awsconnector.implementation.SsmParametersImpl; +import com.azure.resourcemanager.awsconnector.implementation.SsmResourceComplianceSummaryItemsImpl; +import com.azure.resourcemanager.awsconnector.implementation.WafWebAclSummariesImpl; +import com.azure.resourcemanager.awsconnector.implementation.Wafv2LoggingConfigurationsImpl; +import com.azure.resourcemanager.awsconnector.models.AccessAnalyzerAnalyzers; +import com.azure.resourcemanager.awsconnector.models.AcmCertificateSummaries; +import com.azure.resourcemanager.awsconnector.models.ApiGatewayRestApis; +import com.azure.resourcemanager.awsconnector.models.ApiGatewayStages; +import com.azure.resourcemanager.awsconnector.models.AppSyncGraphqlApis; +import com.azure.resourcemanager.awsconnector.models.AutoScalingAutoScalingGroups; +import com.azure.resourcemanager.awsconnector.models.CloudFormationStackSets; +import com.azure.resourcemanager.awsconnector.models.CloudFormationStacks; +import com.azure.resourcemanager.awsconnector.models.CloudFrontDistributions; +import com.azure.resourcemanager.awsconnector.models.CloudTrailTrails; +import com.azure.resourcemanager.awsconnector.models.CloudWatchAlarms; +import com.azure.resourcemanager.awsconnector.models.CodeBuildProjects; +import com.azure.resourcemanager.awsconnector.models.CodeBuildSourceCredentialsInfos; +import com.azure.resourcemanager.awsconnector.models.ConfigServiceConfigurationRecorderStatuses; +import com.azure.resourcemanager.awsconnector.models.ConfigServiceConfigurationRecorders; +import com.azure.resourcemanager.awsconnector.models.ConfigServiceDeliveryChannels; +import com.azure.resourcemanager.awsconnector.models.DatabaseMigrationServiceReplicationInstances; +import com.azure.resourcemanager.awsconnector.models.DaxClusters; +import com.azure.resourcemanager.awsconnector.models.DynamoDbContinuousBackupsDescriptions; +import com.azure.resourcemanager.awsconnector.models.DynamoDbTables; +import com.azure.resourcemanager.awsconnector.models.Ec2AccountAttributes; +import com.azure.resourcemanager.awsconnector.models.Ec2Addresses; +import com.azure.resourcemanager.awsconnector.models.Ec2FlowLogs; +import com.azure.resourcemanager.awsconnector.models.Ec2Images; +import com.azure.resourcemanager.awsconnector.models.Ec2InstanceStatuses; +import com.azure.resourcemanager.awsconnector.models.Ec2Instances; +import com.azure.resourcemanager.awsconnector.models.Ec2Ipams; +import com.azure.resourcemanager.awsconnector.models.Ec2KeyPairs; +import com.azure.resourcemanager.awsconnector.models.Ec2NetworkAcls; +import com.azure.resourcemanager.awsconnector.models.Ec2NetworkInterfaces; +import com.azure.resourcemanager.awsconnector.models.Ec2RouteTables; +import com.azure.resourcemanager.awsconnector.models.Ec2SecurityGroups; +import com.azure.resourcemanager.awsconnector.models.Ec2Snapshots; +import com.azure.resourcemanager.awsconnector.models.Ec2Subnets; +import com.azure.resourcemanager.awsconnector.models.Ec2Volumes; +import com.azure.resourcemanager.awsconnector.models.Ec2VpcEndpoints; +import com.azure.resourcemanager.awsconnector.models.Ec2VpcPeeringConnections; +import com.azure.resourcemanager.awsconnector.models.Ec2Vpcs; +import com.azure.resourcemanager.awsconnector.models.EcrImageDetails; +import com.azure.resourcemanager.awsconnector.models.EcrRepositories; +import com.azure.resourcemanager.awsconnector.models.EcsClusters; +import com.azure.resourcemanager.awsconnector.models.EcsServices; +import com.azure.resourcemanager.awsconnector.models.EcsTaskDefinitions; +import com.azure.resourcemanager.awsconnector.models.EfsFileSystems; +import com.azure.resourcemanager.awsconnector.models.EfsMountTargets; +import com.azure.resourcemanager.awsconnector.models.EksClusters; +import com.azure.resourcemanager.awsconnector.models.EksNodegroups; +import com.azure.resourcemanager.awsconnector.models.ElasticBeanstalkApplications; +import com.azure.resourcemanager.awsconnector.models.ElasticBeanstalkConfigurationTemplates; +import com.azure.resourcemanager.awsconnector.models.ElasticBeanstalkEnvironments; +import com.azure.resourcemanager.awsconnector.models.ElasticLoadBalancingV2Listeners; +import com.azure.resourcemanager.awsconnector.models.ElasticLoadBalancingV2LoadBalancers; +import com.azure.resourcemanager.awsconnector.models.ElasticLoadBalancingV2TargetGroups; +import com.azure.resourcemanager.awsconnector.models.ElasticLoadBalancingv2TargetHealthDescriptions; +import com.azure.resourcemanager.awsconnector.models.EmrClusterSummaries; +import com.azure.resourcemanager.awsconnector.models.EmrClusters; +import com.azure.resourcemanager.awsconnector.models.GuardDutyDetectors; +import com.azure.resourcemanager.awsconnector.models.IamAccessKeyLastUseds; +import com.azure.resourcemanager.awsconnector.models.IamAccessKeyMetadataInfoes; +import com.azure.resourcemanager.awsconnector.models.IamGroups; +import com.azure.resourcemanager.awsconnector.models.IamInstanceProfiles; +import com.azure.resourcemanager.awsconnector.models.IamMfaDevices; +import com.azure.resourcemanager.awsconnector.models.IamPasswordPolicies; +import com.azure.resourcemanager.awsconnector.models.IamPolicyVersions; +import com.azure.resourcemanager.awsconnector.models.IamRoles; +import com.azure.resourcemanager.awsconnector.models.IamServerCertificates; +import com.azure.resourcemanager.awsconnector.models.IamVirtualMfaDevices; +import com.azure.resourcemanager.awsconnector.models.KmsAliases; +import com.azure.resourcemanager.awsconnector.models.KmsKeys; +import com.azure.resourcemanager.awsconnector.models.LambdaFunctionCodeLocations; +import com.azure.resourcemanager.awsconnector.models.LambdaFunctions; +import com.azure.resourcemanager.awsconnector.models.LightsailBuckets; +import com.azure.resourcemanager.awsconnector.models.LightsailInstances; +import com.azure.resourcemanager.awsconnector.models.LogsLogGroups; +import com.azure.resourcemanager.awsconnector.models.LogsLogStreams; +import com.azure.resourcemanager.awsconnector.models.LogsMetricFilters; +import com.azure.resourcemanager.awsconnector.models.LogsSubscriptionFilters; +import com.azure.resourcemanager.awsconnector.models.Macie2JobSummaries; +import com.azure.resourcemanager.awsconnector.models.MacieAllowLists; +import com.azure.resourcemanager.awsconnector.models.NetworkFirewallFirewallPolicies; +import com.azure.resourcemanager.awsconnector.models.NetworkFirewallFirewalls; +import com.azure.resourcemanager.awsconnector.models.NetworkFirewallRuleGroups; +import com.azure.resourcemanager.awsconnector.models.OpenSearchDomainStatuses; +import com.azure.resourcemanager.awsconnector.models.Operations; +import com.azure.resourcemanager.awsconnector.models.OrganizationsAccounts; +import com.azure.resourcemanager.awsconnector.models.OrganizationsOrganizations; +import com.azure.resourcemanager.awsconnector.models.RdsDbClusters; +import com.azure.resourcemanager.awsconnector.models.RdsDbInstances; +import com.azure.resourcemanager.awsconnector.models.RdsDbSnapshotAttributesResults; +import com.azure.resourcemanager.awsconnector.models.RdsDbSnapshots; +import com.azure.resourcemanager.awsconnector.models.RdsEventSubscriptions; +import com.azure.resourcemanager.awsconnector.models.RdsExportTasks; +import com.azure.resourcemanager.awsconnector.models.RedshiftClusterParameterGroups; +import com.azure.resourcemanager.awsconnector.models.RedshiftClusters; +import com.azure.resourcemanager.awsconnector.models.Route53DomainsDomainSummaries; +import com.azure.resourcemanager.awsconnector.models.Route53HostedZones; +import com.azure.resourcemanager.awsconnector.models.Route53ResourceRecordSets; +import com.azure.resourcemanager.awsconnector.models.S3AccessPoints; +import com.azure.resourcemanager.awsconnector.models.S3BucketPolicies; +import com.azure.resourcemanager.awsconnector.models.S3Buckets; +import com.azure.resourcemanager.awsconnector.models.S3ControlMultiRegionAccessPointPolicyDocuments; +import com.azure.resourcemanager.awsconnector.models.SageMakerApps; +import com.azure.resourcemanager.awsconnector.models.SageMakerNotebookInstanceSummaries; +import com.azure.resourcemanager.awsconnector.models.SecretsManagerResourcePolicies; +import com.azure.resourcemanager.awsconnector.models.SecretsManagerSecrets; +import com.azure.resourcemanager.awsconnector.models.SnsSubscriptions; +import com.azure.resourcemanager.awsconnector.models.SnsTopics; +import com.azure.resourcemanager.awsconnector.models.SqsQueues; +import com.azure.resourcemanager.awsconnector.models.SsmInstanceInformations; +import com.azure.resourcemanager.awsconnector.models.SsmParameters; +import com.azure.resourcemanager.awsconnector.models.SsmResourceComplianceSummaryItems; +import com.azure.resourcemanager.awsconnector.models.WafWebAclSummaries; +import com.azure.resourcemanager.awsconnector.models.Wafv2LoggingConfigurations; +import java.time.Duration; +import java.time.temporal.ChronoUnit; +import java.util.ArrayList; +import java.util.List; +import java.util.Objects; +import java.util.stream.Collectors; + +/** + * Entry point to AwsconnectorManager. + * Microsoft.AwsConnector Resource Provider management API. + */ +public final class AwsconnectorManager { + private AccessAnalyzerAnalyzers accessAnalyzerAnalyzers; + + private AcmCertificateSummaries acmCertificateSummaries; + + private ApiGatewayRestApis apiGatewayRestApis; + + private ApiGatewayStages apiGatewayStages; + + private AppSyncGraphqlApis appSyncGraphqlApis; + + private AutoScalingAutoScalingGroups autoScalingAutoScalingGroups; + + private CloudFormationStacks cloudFormationStacks; + + private CloudFormationStackSets cloudFormationStackSets; + + private CloudFrontDistributions cloudFrontDistributions; + + private CloudTrailTrails cloudTrailTrails; + + private CloudWatchAlarms cloudWatchAlarms; + + private CodeBuildProjects codeBuildProjects; + + private CodeBuildSourceCredentialsInfos codeBuildSourceCredentialsInfos; + + private ConfigServiceConfigurationRecorders configServiceConfigurationRecorders; + + private ConfigServiceConfigurationRecorderStatuses configServiceConfigurationRecorderStatuses; + + private ConfigServiceDeliveryChannels configServiceDeliveryChannels; + + private DatabaseMigrationServiceReplicationInstances databaseMigrationServiceReplicationInstances; + + private DaxClusters daxClusters; + + private DynamoDbContinuousBackupsDescriptions dynamoDbContinuousBackupsDescriptions; + + private DynamoDbTables dynamoDbTables; + + private Ec2AccountAttributes ec2AccountAttributes; + + private Ec2Addresses ec2Addresses; + + private Ec2FlowLogs ec2FlowLogs; + + private Ec2Images ec2Images; + + private Ec2Instances ec2Instances; + + private Ec2InstanceStatuses ec2InstanceStatuses; + + private Ec2Ipams ec2Ipams; + + private Ec2KeyPairs ec2KeyPairs; + + private Ec2NetworkAcls ec2NetworkAcls; + + private Ec2NetworkInterfaces ec2NetworkInterfaces; + + private Ec2RouteTables ec2RouteTables; + + private Ec2SecurityGroups ec2SecurityGroups; + + private Ec2Snapshots ec2Snapshots; + + private Ec2Subnets ec2Subnets; + + private Ec2Volumes ec2Volumes; + + private Ec2Vpcs ec2Vpcs; + + private Ec2VpcEndpoints ec2VpcEndpoints; + + private Ec2VpcPeeringConnections ec2VpcPeeringConnections; + + private EcrImageDetails ecrImageDetails; + + private EcrRepositories ecrRepositories; + + private EcsClusters ecsClusters; + + private EcsServices ecsServices; + + private EcsTaskDefinitions ecsTaskDefinitions; + + private EfsFileSystems efsFileSystems; + + private EfsMountTargets efsMountTargets; + + private EksClusters eksClusters; + + private EksNodegroups eksNodegroups; + + private ElasticBeanstalkApplications elasticBeanstalkApplications; + + private ElasticBeanstalkConfigurationTemplates elasticBeanstalkConfigurationTemplates; + + private ElasticBeanstalkEnvironments elasticBeanstalkEnvironments; + + private ElasticLoadBalancingV2Listeners elasticLoadBalancingV2Listeners; + + private ElasticLoadBalancingV2LoadBalancers elasticLoadBalancingV2LoadBalancers; + + private ElasticLoadBalancingV2TargetGroups elasticLoadBalancingV2TargetGroups; + + private ElasticLoadBalancingv2TargetHealthDescriptions elasticLoadBalancingv2TargetHealthDescriptions; + + private EmrClusters emrClusters; + + private EmrClusterSummaries emrClusterSummaries; + + private GuardDutyDetectors guardDutyDetectors; + + private IamAccessKeyLastUseds iamAccessKeyLastUseds; + + private IamAccessKeyMetadataInfoes iamAccessKeyMetadataInfoes; + + private IamGroups iamGroups; + + private IamInstanceProfiles iamInstanceProfiles; + + private IamMfaDevices iamMfaDevices; + + private IamPasswordPolicies iamPasswordPolicies; + + private IamPolicyVersions iamPolicyVersions; + + private IamRoles iamRoles; + + private IamServerCertificates iamServerCertificates; + + private IamVirtualMfaDevices iamVirtualMfaDevices; + + private KmsAliases kmsAliases; + + private KmsKeys kmsKeys; + + private LambdaFunctions lambdaFunctions; + + private LambdaFunctionCodeLocations lambdaFunctionCodeLocations; + + private LightsailBuckets lightsailBuckets; + + private LightsailInstances lightsailInstances; + + private LogsLogGroups logsLogGroups; + + private LogsLogStreams logsLogStreams; + + private LogsMetricFilters logsMetricFilters; + + private LogsSubscriptionFilters logsSubscriptionFilters; + + private Macie2JobSummaries macie2JobSummaries; + + private MacieAllowLists macieAllowLists; + + private NetworkFirewallFirewalls networkFirewallFirewalls; + + private NetworkFirewallFirewallPolicies networkFirewallFirewallPolicies; + + private NetworkFirewallRuleGroups networkFirewallRuleGroups; + + private OpenSearchDomainStatuses openSearchDomainStatuses; + + private Operations operations; + + private OrganizationsAccounts organizationsAccounts; + + private OrganizationsOrganizations organizationsOrganizations; + + private RdsDbClusters rdsDbClusters; + + private RdsDbInstances rdsDbInstances; + + private RdsDbSnapshots rdsDbSnapshots; + + private RdsDbSnapshotAttributesResults rdsDbSnapshotAttributesResults; + + private RdsEventSubscriptions rdsEventSubscriptions; + + private RdsExportTasks rdsExportTasks; + + private RedshiftClusters redshiftClusters; + + private RedshiftClusterParameterGroups redshiftClusterParameterGroups; + + private Route53DomainsDomainSummaries route53DomainsDomainSummaries; + + private Route53HostedZones route53HostedZones; + + private Route53ResourceRecordSets route53ResourceRecordSets; + + private S3AccessPoints s3AccessPoints; + + private S3Buckets s3Buckets; + + private S3BucketPolicies s3BucketPolicies; + + private S3ControlMultiRegionAccessPointPolicyDocuments s3ControlMultiRegionAccessPointPolicyDocuments; + + private SageMakerApps sageMakerApps; + + private SageMakerNotebookInstanceSummaries sageMakerNotebookInstanceSummaries; + + private SecretsManagerResourcePolicies secretsManagerResourcePolicies; + + private SecretsManagerSecrets secretsManagerSecrets; + + private SnsSubscriptions snsSubscriptions; + + private SnsTopics snsTopics; + + private SqsQueues sqsQueues; + + private SsmInstanceInformations ssmInstanceInformations; + + private SsmParameters ssmParameters; + + private SsmResourceComplianceSummaryItems ssmResourceComplianceSummaryItems; + + private Wafv2LoggingConfigurations wafv2LoggingConfigurations; + + private WafWebAclSummaries wafWebAclSummaries; + + private final MicrosoftAwsConnector clientObject; + + private AwsconnectorManager(HttpPipeline httpPipeline, AzureProfile profile, Duration defaultPollInterval) { + Objects.requireNonNull(httpPipeline, "'httpPipeline' cannot be null."); + Objects.requireNonNull(profile, "'profile' cannot be null."); + this.clientObject = new MicrosoftAwsConnectorBuilder().pipeline(httpPipeline) + .endpoint(profile.getEnvironment().getResourceManagerEndpoint()) + .subscriptionId(profile.getSubscriptionId()) + .defaultPollInterval(defaultPollInterval) + .buildClient(); + } + + /** + * Creates an instance of awsconnector service API entry point. + * + * @param credential the credential to use. + * @param profile the Azure profile for client. + * @return the awsconnector service API instance. + */ + public static AwsconnectorManager authenticate(TokenCredential credential, AzureProfile profile) { + Objects.requireNonNull(credential, "'credential' cannot be null."); + Objects.requireNonNull(profile, "'profile' cannot be null."); + return configure().authenticate(credential, profile); + } + + /** + * Creates an instance of awsconnector service API entry point. + * + * @param httpPipeline the {@link HttpPipeline} configured with Azure authentication credential. + * @param profile the Azure profile for client. + * @return the awsconnector service API instance. + */ + public static AwsconnectorManager authenticate(HttpPipeline httpPipeline, AzureProfile profile) { + Objects.requireNonNull(httpPipeline, "'httpPipeline' cannot be null."); + Objects.requireNonNull(profile, "'profile' cannot be null."); + return new AwsconnectorManager(httpPipeline, profile, null); + } + + /** + * Gets a Configurable instance that can be used to create AwsconnectorManager with optional configuration. + * + * @return the Configurable instance allowing configurations. + */ + public static Configurable configure() { + return new AwsconnectorManager.Configurable(); + } + + /** + * The Configurable allowing configurations to be set. + */ + public static final class Configurable { + 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() { + } + + /** + * Sets the http client. + * + * @param httpClient the HTTP client. + * @return the configurable object itself. + */ + public Configurable withHttpClient(HttpClient httpClient) { + this.httpClient = Objects.requireNonNull(httpClient, "'httpClient' cannot be null."); + return this; + } + + /** + * Sets the logging options to the HTTP pipeline. + * + * @param httpLogOptions the HTTP log options. + * @return the configurable object itself. + */ + public Configurable withLogOptions(HttpLogOptions httpLogOptions) { + this.httpLogOptions = Objects.requireNonNull(httpLogOptions, "'httpLogOptions' cannot be null."); + return this; + } + + /** + * Adds the pipeline policy to the HTTP pipeline. + * + * @param policy the HTTP pipeline policy. + * @return the configurable object itself. + */ + public Configurable withPolicy(HttpPipelinePolicy policy) { + this.policies.add(Objects.requireNonNull(policy, "'policy' cannot be null.")); + 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. + * + * @param retryPolicy the HTTP pipeline retry policy. + * @return the configurable object itself. + */ + public Configurable withRetryPolicy(RetryPolicy retryPolicy) { + this.retryPolicy = Objects.requireNonNull(retryPolicy, "'retryPolicy' cannot be null."); + 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. + * + * @param defaultPollInterval the default poll interval. + * @return the configurable object itself. + */ + public Configurable withDefaultPollInterval(Duration defaultPollInterval) { + this.defaultPollInterval + = Objects.requireNonNull(defaultPollInterval, "'defaultPollInterval' cannot be null."); + if (this.defaultPollInterval.isNegative()) { + throw LOGGER + .logExceptionAsError(new IllegalArgumentException("'defaultPollInterval' cannot be negative")); + } + return this; + } + + /** + * Creates an instance of awsconnector service API entry point. + * + * @param credential the credential to use. + * @param profile the Azure profile for client. + * @return the awsconnector service API instance. + */ + public AwsconnectorManager authenticate(TokenCredential credential, AzureProfile profile) { + Objects.requireNonNull(credential, "'credential' cannot be null."); + Objects.requireNonNull(profile, "'profile' cannot be null."); + + StringBuilder userAgentBuilder = new StringBuilder(); + userAgentBuilder.append("azsdk-java") + .append("-") + .append("com.azure.resourcemanager.awsconnector") + .append("/") + .append("1.0.0-beta.1"); + if (!Configuration.getGlobalConfiguration().get("AZURE_TELEMETRY_DISABLED", false)) { + userAgentBuilder.append(" (") + .append(Configuration.getGlobalConfiguration().get("java.version")) + .append("; ") + .append(Configuration.getGlobalConfiguration().get("os.name")) + .append("; ") + .append(Configuration.getGlobalConfiguration().get("os.version")) + .append("; auto-generated)"); + } else { + userAgentBuilder.append(" (auto-generated)"); + } + + if (scopes.isEmpty()) { + scopes.add(profile.getEnvironment().getManagementEndpoint() + "/.default"); + } + if (retryPolicy == null) { + 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.addAll(this.policies.stream() + .filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_RETRY) + .collect(Collectors.toList())); + HttpPolicyProviders.addAfterRetryPolicies(policies); + policies.add(new HttpLoggingPolicy(httpLogOptions)); + HttpPipeline httpPipeline = new HttpPipelineBuilder().httpClient(httpClient) + .policies(policies.toArray(new HttpPipelinePolicy[0])) + .build(); + return new AwsconnectorManager(httpPipeline, profile, defaultPollInterval); + } + } + + /** + * Gets the resource collection API of AccessAnalyzerAnalyzers. It manages AccessAnalyzer. + * + * @return Resource collection API of AccessAnalyzerAnalyzers. + */ + public AccessAnalyzerAnalyzers accessAnalyzerAnalyzers() { + if (this.accessAnalyzerAnalyzers == null) { + this.accessAnalyzerAnalyzers + = new AccessAnalyzerAnalyzersImpl(clientObject.getAccessAnalyzerAnalyzers(), this); + } + return accessAnalyzerAnalyzers; + } + + /** + * Gets the resource collection API of AcmCertificateSummaries. It manages AcmCertificateSummary. + * + * @return Resource collection API of AcmCertificateSummaries. + */ + public AcmCertificateSummaries acmCertificateSummaries() { + if (this.acmCertificateSummaries == null) { + this.acmCertificateSummaries + = new AcmCertificateSummariesImpl(clientObject.getAcmCertificateSummaries(), this); + } + return acmCertificateSummaries; + } + + /** + * Gets the resource collection API of ApiGatewayRestApis. It manages ApiGatewayRestApi. + * + * @return Resource collection API of ApiGatewayRestApis. + */ + public ApiGatewayRestApis apiGatewayRestApis() { + if (this.apiGatewayRestApis == null) { + this.apiGatewayRestApis = new ApiGatewayRestApisImpl(clientObject.getApiGatewayRestApis(), this); + } + return apiGatewayRestApis; + } + + /** + * Gets the resource collection API of ApiGatewayStages. It manages ApiGatewayStage. + * + * @return Resource collection API of ApiGatewayStages. + */ + public ApiGatewayStages apiGatewayStages() { + if (this.apiGatewayStages == null) { + this.apiGatewayStages = new ApiGatewayStagesImpl(clientObject.getApiGatewayStages(), this); + } + return apiGatewayStages; + } + + /** + * Gets the resource collection API of AppSyncGraphqlApis. It manages AppSyncGraphqlApi. + * + * @return Resource collection API of AppSyncGraphqlApis. + */ + public AppSyncGraphqlApis appSyncGraphqlApis() { + if (this.appSyncGraphqlApis == null) { + this.appSyncGraphqlApis = new AppSyncGraphqlApisImpl(clientObject.getAppSyncGraphqlApis(), this); + } + return appSyncGraphqlApis; + } + + /** + * Gets the resource collection API of AutoScalingAutoScalingGroups. It manages AutoScalingGroup. + * + * @return Resource collection API of AutoScalingAutoScalingGroups. + */ + public AutoScalingAutoScalingGroups autoScalingAutoScalingGroups() { + if (this.autoScalingAutoScalingGroups == null) { + this.autoScalingAutoScalingGroups + = new AutoScalingAutoScalingGroupsImpl(clientObject.getAutoScalingAutoScalingGroups(), this); + } + return autoScalingAutoScalingGroups; + } + + /** + * Gets the resource collection API of CloudFormationStacks. It manages CloudFormationStack. + * + * @return Resource collection API of CloudFormationStacks. + */ + public CloudFormationStacks cloudFormationStacks() { + if (this.cloudFormationStacks == null) { + this.cloudFormationStacks = new CloudFormationStacksImpl(clientObject.getCloudFormationStacks(), this); + } + return cloudFormationStacks; + } + + /** + * Gets the resource collection API of CloudFormationStackSets. It manages CloudFormationStackSet. + * + * @return Resource collection API of CloudFormationStackSets. + */ + public CloudFormationStackSets cloudFormationStackSets() { + if (this.cloudFormationStackSets == null) { + this.cloudFormationStackSets + = new CloudFormationStackSetsImpl(clientObject.getCloudFormationStackSets(), this); + } + return cloudFormationStackSets; + } + + /** + * Gets the resource collection API of CloudFrontDistributions. It manages CloudFrontDistribution. + * + * @return Resource collection API of CloudFrontDistributions. + */ + public CloudFrontDistributions cloudFrontDistributions() { + if (this.cloudFrontDistributions == null) { + this.cloudFrontDistributions + = new CloudFrontDistributionsImpl(clientObject.getCloudFrontDistributions(), this); + } + return cloudFrontDistributions; + } + + /** + * Gets the resource collection API of CloudTrailTrails. It manages CloudTrail. + * + * @return Resource collection API of CloudTrailTrails. + */ + public CloudTrailTrails cloudTrailTrails() { + if (this.cloudTrailTrails == null) { + this.cloudTrailTrails = new CloudTrailTrailsImpl(clientObject.getCloudTrailTrails(), this); + } + return cloudTrailTrails; + } + + /** + * Gets the resource collection API of CloudWatchAlarms. It manages CloudWatchAlarm. + * + * @return Resource collection API of CloudWatchAlarms. + */ + public CloudWatchAlarms cloudWatchAlarms() { + if (this.cloudWatchAlarms == null) { + this.cloudWatchAlarms = new CloudWatchAlarmsImpl(clientObject.getCloudWatchAlarms(), this); + } + return cloudWatchAlarms; + } + + /** + * Gets the resource collection API of CodeBuildProjects. It manages CodeBuildProject. + * + * @return Resource collection API of CodeBuildProjects. + */ + public CodeBuildProjects codeBuildProjects() { + if (this.codeBuildProjects == null) { + this.codeBuildProjects = new CodeBuildProjectsImpl(clientObject.getCodeBuildProjects(), this); + } + return codeBuildProjects; + } + + /** + * Gets the resource collection API of CodeBuildSourceCredentialsInfos. It manages CodeBuildSourceCredentialsInfo. + * + * @return Resource collection API of CodeBuildSourceCredentialsInfos. + */ + public CodeBuildSourceCredentialsInfos codeBuildSourceCredentialsInfos() { + if (this.codeBuildSourceCredentialsInfos == null) { + this.codeBuildSourceCredentialsInfos + = new CodeBuildSourceCredentialsInfosImpl(clientObject.getCodeBuildSourceCredentialsInfos(), this); + } + return codeBuildSourceCredentialsInfos; + } + + /** + * Gets the resource collection API of ConfigServiceConfigurationRecorders. It manages + * ConfigServiceConfigurationRecorder. + * + * @return Resource collection API of ConfigServiceConfigurationRecorders. + */ + public ConfigServiceConfigurationRecorders configServiceConfigurationRecorders() { + if (this.configServiceConfigurationRecorders == null) { + this.configServiceConfigurationRecorders = new ConfigServiceConfigurationRecordersImpl( + clientObject.getConfigServiceConfigurationRecorders(), this); + } + return configServiceConfigurationRecorders; + } + + /** + * Gets the resource collection API of ConfigServiceConfigurationRecorderStatuses. It manages + * ConfigServiceConfigurationRecorderStatus. + * + * @return Resource collection API of ConfigServiceConfigurationRecorderStatuses. + */ + public ConfigServiceConfigurationRecorderStatuses configServiceConfigurationRecorderStatuses() { + if (this.configServiceConfigurationRecorderStatuses == null) { + this.configServiceConfigurationRecorderStatuses = new ConfigServiceConfigurationRecorderStatusesImpl( + clientObject.getConfigServiceConfigurationRecorderStatuses(), this); + } + return configServiceConfigurationRecorderStatuses; + } + + /** + * Gets the resource collection API of ConfigServiceDeliveryChannels. It manages ConfigServiceDeliveryChannel. + * + * @return Resource collection API of ConfigServiceDeliveryChannels. + */ + public ConfigServiceDeliveryChannels configServiceDeliveryChannels() { + if (this.configServiceDeliveryChannels == null) { + this.configServiceDeliveryChannels + = new ConfigServiceDeliveryChannelsImpl(clientObject.getConfigServiceDeliveryChannels(), this); + } + return configServiceDeliveryChannels; + } + + /** + * Gets the resource collection API of DatabaseMigrationServiceReplicationInstances. It manages + * DatabaseMigrationServiceReplicationInstance. + * + * @return Resource collection API of DatabaseMigrationServiceReplicationInstances. + */ + public DatabaseMigrationServiceReplicationInstances databaseMigrationServiceReplicationInstances() { + if (this.databaseMigrationServiceReplicationInstances == null) { + this.databaseMigrationServiceReplicationInstances = new DatabaseMigrationServiceReplicationInstancesImpl( + clientObject.getDatabaseMigrationServiceReplicationInstances(), this); + } + return databaseMigrationServiceReplicationInstances; + } + + /** + * Gets the resource collection API of DaxClusters. It manages DaxCluster. + * + * @return Resource collection API of DaxClusters. + */ + public DaxClusters daxClusters() { + if (this.daxClusters == null) { + this.daxClusters = new DaxClustersImpl(clientObject.getDaxClusters(), this); + } + return daxClusters; + } + + /** + * Gets the resource collection API of DynamoDbContinuousBackupsDescriptions. It manages + * DynamoDBContinuousBackupsDescription. + * + * @return Resource collection API of DynamoDbContinuousBackupsDescriptions. + */ + public DynamoDbContinuousBackupsDescriptions dynamoDbContinuousBackupsDescriptions() { + if (this.dynamoDbContinuousBackupsDescriptions == null) { + this.dynamoDbContinuousBackupsDescriptions = new DynamoDbContinuousBackupsDescriptionsImpl( + clientObject.getDynamoDbContinuousBackupsDescriptions(), this); + } + return dynamoDbContinuousBackupsDescriptions; + } + + /** + * Gets the resource collection API of DynamoDbTables. It manages DynamoDBTable. + * + * @return Resource collection API of DynamoDbTables. + */ + public DynamoDbTables dynamoDbTables() { + if (this.dynamoDbTables == null) { + this.dynamoDbTables = new DynamoDbTablesImpl(clientObject.getDynamoDbTables(), this); + } + return dynamoDbTables; + } + + /** + * Gets the resource collection API of Ec2AccountAttributes. It manages Ec2AccountAttribute. + * + * @return Resource collection API of Ec2AccountAttributes. + */ + public Ec2AccountAttributes ec2AccountAttributes() { + if (this.ec2AccountAttributes == null) { + this.ec2AccountAttributes = new Ec2AccountAttributesImpl(clientObject.getEc2AccountAttributes(), this); + } + return ec2AccountAttributes; + } + + /** + * Gets the resource collection API of Ec2Addresses. It manages Ec2Address. + * + * @return Resource collection API of Ec2Addresses. + */ + public Ec2Addresses ec2Addresses() { + if (this.ec2Addresses == null) { + this.ec2Addresses = new Ec2AddressesImpl(clientObject.getEc2Addresses(), this); + } + return ec2Addresses; + } + + /** + * Gets the resource collection API of Ec2FlowLogs. It manages Ec2FlowLog. + * + * @return Resource collection API of Ec2FlowLogs. + */ + public Ec2FlowLogs ec2FlowLogs() { + if (this.ec2FlowLogs == null) { + this.ec2FlowLogs = new Ec2FlowLogsImpl(clientObject.getEc2FlowLogs(), this); + } + return ec2FlowLogs; + } + + /** + * Gets the resource collection API of Ec2Images. It manages Ec2Image. + * + * @return Resource collection API of Ec2Images. + */ + public Ec2Images ec2Images() { + if (this.ec2Images == null) { + this.ec2Images = new Ec2ImagesImpl(clientObject.getEc2Images(), this); + } + return ec2Images; + } + + /** + * Gets the resource collection API of Ec2Instances. + * + * @return Resource collection API of Ec2Instances. + */ + public Ec2Instances ec2Instances() { + if (this.ec2Instances == null) { + this.ec2Instances = new Ec2InstancesImpl(clientObject.getEc2Instances(), this); + } + return ec2Instances; + } + + /** + * Gets the resource collection API of Ec2InstanceStatuses. It manages Ec2InstanceStatus. + * + * @return Resource collection API of Ec2InstanceStatuses. + */ + public Ec2InstanceStatuses ec2InstanceStatuses() { + if (this.ec2InstanceStatuses == null) { + this.ec2InstanceStatuses = new Ec2InstanceStatusesImpl(clientObject.getEc2InstanceStatuses(), this); + } + return ec2InstanceStatuses; + } + + /** + * Gets the resource collection API of Ec2Ipams. It manages Ec2Ipam. + * + * @return Resource collection API of Ec2Ipams. + */ + public Ec2Ipams ec2Ipams() { + if (this.ec2Ipams == null) { + this.ec2Ipams = new Ec2IpamsImpl(clientObject.getEc2Ipams(), this); + } + return ec2Ipams; + } + + /** + * Gets the resource collection API of Ec2KeyPairs. It manages Ec2KeyPair. + * + * @return Resource collection API of Ec2KeyPairs. + */ + public Ec2KeyPairs ec2KeyPairs() { + if (this.ec2KeyPairs == null) { + this.ec2KeyPairs = new Ec2KeyPairsImpl(clientObject.getEc2KeyPairs(), this); + } + return ec2KeyPairs; + } + + /** + * Gets the resource collection API of Ec2NetworkAcls. It manages Ec2NetworkAcl. + * + * @return Resource collection API of Ec2NetworkAcls. + */ + public Ec2NetworkAcls ec2NetworkAcls() { + if (this.ec2NetworkAcls == null) { + this.ec2NetworkAcls = new Ec2NetworkAclsImpl(clientObject.getEc2NetworkAcls(), this); + } + return ec2NetworkAcls; + } + + /** + * Gets the resource collection API of Ec2NetworkInterfaces. It manages Ec2NetworkInterface. + * + * @return Resource collection API of Ec2NetworkInterfaces. + */ + public Ec2NetworkInterfaces ec2NetworkInterfaces() { + if (this.ec2NetworkInterfaces == null) { + this.ec2NetworkInterfaces = new Ec2NetworkInterfacesImpl(clientObject.getEc2NetworkInterfaces(), this); + } + return ec2NetworkInterfaces; + } + + /** + * Gets the resource collection API of Ec2RouteTables. It manages Ec2RouteTable. + * + * @return Resource collection API of Ec2RouteTables. + */ + public Ec2RouteTables ec2RouteTables() { + if (this.ec2RouteTables == null) { + this.ec2RouteTables = new Ec2RouteTablesImpl(clientObject.getEc2RouteTables(), this); + } + return ec2RouteTables; + } + + /** + * Gets the resource collection API of Ec2SecurityGroups. It manages Ec2SecurityGroup. + * + * @return Resource collection API of Ec2SecurityGroups. + */ + public Ec2SecurityGroups ec2SecurityGroups() { + if (this.ec2SecurityGroups == null) { + this.ec2SecurityGroups = new Ec2SecurityGroupsImpl(clientObject.getEc2SecurityGroups(), this); + } + return ec2SecurityGroups; + } + + /** + * Gets the resource collection API of Ec2Snapshots. It manages Ec2Snapshot. + * + * @return Resource collection API of Ec2Snapshots. + */ + public Ec2Snapshots ec2Snapshots() { + if (this.ec2Snapshots == null) { + this.ec2Snapshots = new Ec2SnapshotsImpl(clientObject.getEc2Snapshots(), this); + } + return ec2Snapshots; + } + + /** + * Gets the resource collection API of Ec2Subnets. It manages Ec2Subnet. + * + * @return Resource collection API of Ec2Subnets. + */ + public Ec2Subnets ec2Subnets() { + if (this.ec2Subnets == null) { + this.ec2Subnets = new Ec2SubnetsImpl(clientObject.getEc2Subnets(), this); + } + return ec2Subnets; + } + + /** + * Gets the resource collection API of Ec2Volumes. It manages Ec2Volume. + * + * @return Resource collection API of Ec2Volumes. + */ + public Ec2Volumes ec2Volumes() { + if (this.ec2Volumes == null) { + this.ec2Volumes = new Ec2VolumesImpl(clientObject.getEc2Volumes(), this); + } + return ec2Volumes; + } + + /** + * Gets the resource collection API of Ec2Vpcs. It manages Ec2Vpc. + * + * @return Resource collection API of Ec2Vpcs. + */ + public Ec2Vpcs ec2Vpcs() { + if (this.ec2Vpcs == null) { + this.ec2Vpcs = new Ec2VpcsImpl(clientObject.getEc2Vpcs(), this); + } + return ec2Vpcs; + } + + /** + * Gets the resource collection API of Ec2VpcEndpoints. It manages Ec2VpcEndpoint. + * + * @return Resource collection API of Ec2VpcEndpoints. + */ + public Ec2VpcEndpoints ec2VpcEndpoints() { + if (this.ec2VpcEndpoints == null) { + this.ec2VpcEndpoints = new Ec2VpcEndpointsImpl(clientObject.getEc2VpcEndpoints(), this); + } + return ec2VpcEndpoints; + } + + /** + * Gets the resource collection API of Ec2VpcPeeringConnections. It manages Ec2VpcPeeringConnection. + * + * @return Resource collection API of Ec2VpcPeeringConnections. + */ + public Ec2VpcPeeringConnections ec2VpcPeeringConnections() { + if (this.ec2VpcPeeringConnections == null) { + this.ec2VpcPeeringConnections + = new Ec2VpcPeeringConnectionsImpl(clientObject.getEc2VpcPeeringConnections(), this); + } + return ec2VpcPeeringConnections; + } + + /** + * Gets the resource collection API of EcrImageDetails. It manages EcrImageDetail. + * + * @return Resource collection API of EcrImageDetails. + */ + public EcrImageDetails ecrImageDetails() { + if (this.ecrImageDetails == null) { + this.ecrImageDetails = new EcrImageDetailsImpl(clientObject.getEcrImageDetails(), this); + } + return ecrImageDetails; + } + + /** + * Gets the resource collection API of EcrRepositories. It manages EcrRepository. + * + * @return Resource collection API of EcrRepositories. + */ + public EcrRepositories ecrRepositories() { + if (this.ecrRepositories == null) { + this.ecrRepositories = new EcrRepositoriesImpl(clientObject.getEcrRepositories(), this); + } + return ecrRepositories; + } + + /** + * Gets the resource collection API of EcsClusters. It manages EcsCluster. + * + * @return Resource collection API of EcsClusters. + */ + public EcsClusters ecsClusters() { + if (this.ecsClusters == null) { + this.ecsClusters = new EcsClustersImpl(clientObject.getEcsClusters(), this); + } + return ecsClusters; + } + + /** + * Gets the resource collection API of EcsServices. It manages EcsService. + * + * @return Resource collection API of EcsServices. + */ + public EcsServices ecsServices() { + if (this.ecsServices == null) { + this.ecsServices = new EcsServicesImpl(clientObject.getEcsServices(), this); + } + return ecsServices; + } + + /** + * Gets the resource collection API of EcsTaskDefinitions. It manages EcsTaskDefinition. + * + * @return Resource collection API of EcsTaskDefinitions. + */ + public EcsTaskDefinitions ecsTaskDefinitions() { + if (this.ecsTaskDefinitions == null) { + this.ecsTaskDefinitions = new EcsTaskDefinitionsImpl(clientObject.getEcsTaskDefinitions(), this); + } + return ecsTaskDefinitions; + } + + /** + * Gets the resource collection API of EfsFileSystems. It manages EfsFileSystem. + * + * @return Resource collection API of EfsFileSystems. + */ + public EfsFileSystems efsFileSystems() { + if (this.efsFileSystems == null) { + this.efsFileSystems = new EfsFileSystemsImpl(clientObject.getEfsFileSystems(), this); + } + return efsFileSystems; + } + + /** + * Gets the resource collection API of EfsMountTargets. It manages EfsMountTarget. + * + * @return Resource collection API of EfsMountTargets. + */ + public EfsMountTargets efsMountTargets() { + if (this.efsMountTargets == null) { + this.efsMountTargets = new EfsMountTargetsImpl(clientObject.getEfsMountTargets(), this); + } + return efsMountTargets; + } + + /** + * Gets the resource collection API of EksClusters. + * + * @return Resource collection API of EksClusters. + */ + public EksClusters eksClusters() { + if (this.eksClusters == null) { + this.eksClusters = new EksClustersImpl(clientObject.getEksClusters(), this); + } + return eksClusters; + } + + /** + * Gets the resource collection API of EksNodegroups. It manages EksNodegroup. + * + * @return Resource collection API of EksNodegroups. + */ + public EksNodegroups eksNodegroups() { + if (this.eksNodegroups == null) { + this.eksNodegroups = new EksNodegroupsImpl(clientObject.getEksNodegroups(), this); + } + return eksNodegroups; + } + + /** + * Gets the resource collection API of ElasticBeanstalkApplications. It manages ElasticBeanstalkApplication. + * + * @return Resource collection API of ElasticBeanstalkApplications. + */ + public ElasticBeanstalkApplications elasticBeanstalkApplications() { + if (this.elasticBeanstalkApplications == null) { + this.elasticBeanstalkApplications + = new ElasticBeanstalkApplicationsImpl(clientObject.getElasticBeanstalkApplications(), this); + } + return elasticBeanstalkApplications; + } + + /** + * Gets the resource collection API of ElasticBeanstalkConfigurationTemplates. It manages + * ElasticBeanstalkConfigurationTemplate. + * + * @return Resource collection API of ElasticBeanstalkConfigurationTemplates. + */ + public ElasticBeanstalkConfigurationTemplates elasticBeanstalkConfigurationTemplates() { + if (this.elasticBeanstalkConfigurationTemplates == null) { + this.elasticBeanstalkConfigurationTemplates = new ElasticBeanstalkConfigurationTemplatesImpl( + clientObject.getElasticBeanstalkConfigurationTemplates(), this); + } + return elasticBeanstalkConfigurationTemplates; + } + + /** + * Gets the resource collection API of ElasticBeanstalkEnvironments. It manages ElasticBeanstalkEnvironment. + * + * @return Resource collection API of ElasticBeanstalkEnvironments. + */ + public ElasticBeanstalkEnvironments elasticBeanstalkEnvironments() { + if (this.elasticBeanstalkEnvironments == null) { + this.elasticBeanstalkEnvironments + = new ElasticBeanstalkEnvironmentsImpl(clientObject.getElasticBeanstalkEnvironments(), this); + } + return elasticBeanstalkEnvironments; + } + + /** + * Gets the resource collection API of ElasticLoadBalancingV2Listeners. It manages ElasticLoadBalancingV2Listener. + * + * @return Resource collection API of ElasticLoadBalancingV2Listeners. + */ + public ElasticLoadBalancingV2Listeners elasticLoadBalancingV2Listeners() { + if (this.elasticLoadBalancingV2Listeners == null) { + this.elasticLoadBalancingV2Listeners + = new ElasticLoadBalancingV2ListenersImpl(clientObject.getElasticLoadBalancingV2Listeners(), this); + } + return elasticLoadBalancingV2Listeners; + } + + /** + * Gets the resource collection API of ElasticLoadBalancingV2LoadBalancers. It manages + * ElasticLoadBalancingV2LoadBalancer. + * + * @return Resource collection API of ElasticLoadBalancingV2LoadBalancers. + */ + public ElasticLoadBalancingV2LoadBalancers elasticLoadBalancingV2LoadBalancers() { + if (this.elasticLoadBalancingV2LoadBalancers == null) { + this.elasticLoadBalancingV2LoadBalancers = new ElasticLoadBalancingV2LoadBalancersImpl( + clientObject.getElasticLoadBalancingV2LoadBalancers(), this); + } + return elasticLoadBalancingV2LoadBalancers; + } + + /** + * Gets the resource collection API of ElasticLoadBalancingV2TargetGroups. It manages + * ElasticLoadBalancingV2TargetGroup. + * + * @return Resource collection API of ElasticLoadBalancingV2TargetGroups. + */ + public ElasticLoadBalancingV2TargetGroups elasticLoadBalancingV2TargetGroups() { + if (this.elasticLoadBalancingV2TargetGroups == null) { + this.elasticLoadBalancingV2TargetGroups = new ElasticLoadBalancingV2TargetGroupsImpl( + clientObject.getElasticLoadBalancingV2TargetGroups(), this); + } + return elasticLoadBalancingV2TargetGroups; + } + + /** + * Gets the resource collection API of ElasticLoadBalancingv2TargetHealthDescriptions. It manages + * ElasticLoadBalancingv2TargetHealthDescription. + * + * @return Resource collection API of ElasticLoadBalancingv2TargetHealthDescriptions. + */ + public ElasticLoadBalancingv2TargetHealthDescriptions elasticLoadBalancingv2TargetHealthDescriptions() { + if (this.elasticLoadBalancingv2TargetHealthDescriptions == null) { + this.elasticLoadBalancingv2TargetHealthDescriptions + = new ElasticLoadBalancingv2TargetHealthDescriptionsImpl( + clientObject.getElasticLoadBalancingv2TargetHealthDescriptions(), this); + } + return elasticLoadBalancingv2TargetHealthDescriptions; + } + + /** + * Gets the resource collection API of EmrClusters. It manages EmrCluster. + * + * @return Resource collection API of EmrClusters. + */ + public EmrClusters emrClusters() { + if (this.emrClusters == null) { + this.emrClusters = new EmrClustersImpl(clientObject.getEmrClusters(), this); + } + return emrClusters; + } + + /** + * Gets the resource collection API of EmrClusterSummaries. It manages EmrClusterSummary. + * + * @return Resource collection API of EmrClusterSummaries. + */ + public EmrClusterSummaries emrClusterSummaries() { + if (this.emrClusterSummaries == null) { + this.emrClusterSummaries = new EmrClusterSummariesImpl(clientObject.getEmrClusterSummaries(), this); + } + return emrClusterSummaries; + } + + /** + * Gets the resource collection API of GuardDutyDetectors. It manages GuardDutyDetector. + * + * @return Resource collection API of GuardDutyDetectors. + */ + public GuardDutyDetectors guardDutyDetectors() { + if (this.guardDutyDetectors == null) { + this.guardDutyDetectors = new GuardDutyDetectorsImpl(clientObject.getGuardDutyDetectors(), this); + } + return guardDutyDetectors; + } + + /** + * Gets the resource collection API of IamAccessKeyLastUseds. It manages IamAccessKeyLastUsed. + * + * @return Resource collection API of IamAccessKeyLastUseds. + */ + public IamAccessKeyLastUseds iamAccessKeyLastUseds() { + if (this.iamAccessKeyLastUseds == null) { + this.iamAccessKeyLastUseds = new IamAccessKeyLastUsedsImpl(clientObject.getIamAccessKeyLastUseds(), this); + } + return iamAccessKeyLastUseds; + } + + /** + * Gets the resource collection API of IamAccessKeyMetadataInfoes. It manages IamAccessKeyMetadata. + * + * @return Resource collection API of IamAccessKeyMetadataInfoes. + */ + public IamAccessKeyMetadataInfoes iamAccessKeyMetadataInfoes() { + if (this.iamAccessKeyMetadataInfoes == null) { + this.iamAccessKeyMetadataInfoes + = new IamAccessKeyMetadataInfoesImpl(clientObject.getIamAccessKeyMetadataInfoes(), this); + } + return iamAccessKeyMetadataInfoes; + } + + /** + * Gets the resource collection API of IamGroups. It manages IamGroup. + * + * @return Resource collection API of IamGroups. + */ + public IamGroups iamGroups() { + if (this.iamGroups == null) { + this.iamGroups = new IamGroupsImpl(clientObject.getIamGroups(), this); + } + return iamGroups; + } + + /** + * Gets the resource collection API of IamInstanceProfiles. It manages IamInstanceProfileAutoGenerated. + * + * @return Resource collection API of IamInstanceProfiles. + */ + public IamInstanceProfiles iamInstanceProfiles() { + if (this.iamInstanceProfiles == null) { + this.iamInstanceProfiles = new IamInstanceProfilesImpl(clientObject.getIamInstanceProfiles(), this); + } + return iamInstanceProfiles; + } + + /** + * Gets the resource collection API of IamMfaDevices. It manages IamMfaDevice. + * + * @return Resource collection API of IamMfaDevices. + */ + public IamMfaDevices iamMfaDevices() { + if (this.iamMfaDevices == null) { + this.iamMfaDevices = new IamMfaDevicesImpl(clientObject.getIamMfaDevices(), this); + } + return iamMfaDevices; + } + + /** + * Gets the resource collection API of IamPasswordPolicies. It manages IamPasswordPolicy. + * + * @return Resource collection API of IamPasswordPolicies. + */ + public IamPasswordPolicies iamPasswordPolicies() { + if (this.iamPasswordPolicies == null) { + this.iamPasswordPolicies = new IamPasswordPoliciesImpl(clientObject.getIamPasswordPolicies(), this); + } + return iamPasswordPolicies; + } + + /** + * Gets the resource collection API of IamPolicyVersions. It manages IamPolicyVersion. + * + * @return Resource collection API of IamPolicyVersions. + */ + public IamPolicyVersions iamPolicyVersions() { + if (this.iamPolicyVersions == null) { + this.iamPolicyVersions = new IamPolicyVersionsImpl(clientObject.getIamPolicyVersions(), this); + } + return iamPolicyVersions; + } + + /** + * Gets the resource collection API of IamRoles. It manages IamRole. + * + * @return Resource collection API of IamRoles. + */ + public IamRoles iamRoles() { + if (this.iamRoles == null) { + this.iamRoles = new IamRolesImpl(clientObject.getIamRoles(), this); + } + return iamRoles; + } + + /** + * Gets the resource collection API of IamServerCertificates. It manages IamServerCertificate. + * + * @return Resource collection API of IamServerCertificates. + */ + public IamServerCertificates iamServerCertificates() { + if (this.iamServerCertificates == null) { + this.iamServerCertificates = new IamServerCertificatesImpl(clientObject.getIamServerCertificates(), this); + } + return iamServerCertificates; + } + + /** + * Gets the resource collection API of IamVirtualMfaDevices. It manages IamVirtualMfaDevice. + * + * @return Resource collection API of IamVirtualMfaDevices. + */ + public IamVirtualMfaDevices iamVirtualMfaDevices() { + if (this.iamVirtualMfaDevices == null) { + this.iamVirtualMfaDevices = new IamVirtualMfaDevicesImpl(clientObject.getIamVirtualMfaDevices(), this); + } + return iamVirtualMfaDevices; + } + + /** + * Gets the resource collection API of KmsAliases. It manages KmsAlias. + * + * @return Resource collection API of KmsAliases. + */ + public KmsAliases kmsAliases() { + if (this.kmsAliases == null) { + this.kmsAliases = new KmsAliasesImpl(clientObject.getKmsAliases(), this); + } + return kmsAliases; + } + + /** + * Gets the resource collection API of KmsKeys. It manages KmsKey. + * + * @return Resource collection API of KmsKeys. + */ + public KmsKeys kmsKeys() { + if (this.kmsKeys == null) { + this.kmsKeys = new KmsKeysImpl(clientObject.getKmsKeys(), this); + } + return kmsKeys; + } + + /** + * Gets the resource collection API of LambdaFunctions. It manages LambdaFunction. + * + * @return Resource collection API of LambdaFunctions. + */ + public LambdaFunctions lambdaFunctions() { + if (this.lambdaFunctions == null) { + this.lambdaFunctions = new LambdaFunctionsImpl(clientObject.getLambdaFunctions(), this); + } + return lambdaFunctions; + } + + /** + * Gets the resource collection API of LambdaFunctionCodeLocations. It manages LambdaFunctionCodeLocation. + * + * @return Resource collection API of LambdaFunctionCodeLocations. + */ + public LambdaFunctionCodeLocations lambdaFunctionCodeLocations() { + if (this.lambdaFunctionCodeLocations == null) { + this.lambdaFunctionCodeLocations + = new LambdaFunctionCodeLocationsImpl(clientObject.getLambdaFunctionCodeLocations(), this); + } + return lambdaFunctionCodeLocations; + } + + /** + * Gets the resource collection API of LightsailBuckets. It manages LightsailBucket. + * + * @return Resource collection API of LightsailBuckets. + */ + public LightsailBuckets lightsailBuckets() { + if (this.lightsailBuckets == null) { + this.lightsailBuckets = new LightsailBucketsImpl(clientObject.getLightsailBuckets(), this); + } + return lightsailBuckets; + } + + /** + * Gets the resource collection API of LightsailInstances. It manages LightsailInstance. + * + * @return Resource collection API of LightsailInstances. + */ + public LightsailInstances lightsailInstances() { + if (this.lightsailInstances == null) { + this.lightsailInstances = new LightsailInstancesImpl(clientObject.getLightsailInstances(), this); + } + return lightsailInstances; + } + + /** + * Gets the resource collection API of LogsLogGroups. It manages LogsLogGroup. + * + * @return Resource collection API of LogsLogGroups. + */ + public LogsLogGroups logsLogGroups() { + if (this.logsLogGroups == null) { + this.logsLogGroups = new LogsLogGroupsImpl(clientObject.getLogsLogGroups(), this); + } + return logsLogGroups; + } + + /** + * Gets the resource collection API of LogsLogStreams. It manages LogsLogStream. + * + * @return Resource collection API of LogsLogStreams. + */ + public LogsLogStreams logsLogStreams() { + if (this.logsLogStreams == null) { + this.logsLogStreams = new LogsLogStreamsImpl(clientObject.getLogsLogStreams(), this); + } + return logsLogStreams; + } + + /** + * Gets the resource collection API of LogsMetricFilters. It manages LogsMetricFilter. + * + * @return Resource collection API of LogsMetricFilters. + */ + public LogsMetricFilters logsMetricFilters() { + if (this.logsMetricFilters == null) { + this.logsMetricFilters = new LogsMetricFiltersImpl(clientObject.getLogsMetricFilters(), this); + } + return logsMetricFilters; + } + + /** + * Gets the resource collection API of LogsSubscriptionFilters. It manages LogsSubscriptionFilter. + * + * @return Resource collection API of LogsSubscriptionFilters. + */ + public LogsSubscriptionFilters logsSubscriptionFilters() { + if (this.logsSubscriptionFilters == null) { + this.logsSubscriptionFilters + = new LogsSubscriptionFiltersImpl(clientObject.getLogsSubscriptionFilters(), this); + } + return logsSubscriptionFilters; + } + + /** + * Gets the resource collection API of Macie2JobSummaries. It manages Macie2JobSummary. + * + * @return Resource collection API of Macie2JobSummaries. + */ + public Macie2JobSummaries macie2JobSummaries() { + if (this.macie2JobSummaries == null) { + this.macie2JobSummaries = new Macie2JobSummariesImpl(clientObject.getMacie2JobSummaries(), this); + } + return macie2JobSummaries; + } + + /** + * Gets the resource collection API of MacieAllowLists. It manages MacieAllowList. + * + * @return Resource collection API of MacieAllowLists. + */ + public MacieAllowLists macieAllowLists() { + if (this.macieAllowLists == null) { + this.macieAllowLists = new MacieAllowListsImpl(clientObject.getMacieAllowLists(), this); + } + return macieAllowLists; + } + + /** + * Gets the resource collection API of NetworkFirewallFirewalls. It manages NetworkFirewall. + * + * @return Resource collection API of NetworkFirewallFirewalls. + */ + public NetworkFirewallFirewalls networkFirewallFirewalls() { + if (this.networkFirewallFirewalls == null) { + this.networkFirewallFirewalls + = new NetworkFirewallFirewallsImpl(clientObject.getNetworkFirewallFirewalls(), this); + } + return networkFirewallFirewalls; + } + + /** + * Gets the resource collection API of NetworkFirewallFirewallPolicies. It manages NetworkFirewallPolicy. + * + * @return Resource collection API of NetworkFirewallFirewallPolicies. + */ + public NetworkFirewallFirewallPolicies networkFirewallFirewallPolicies() { + if (this.networkFirewallFirewallPolicies == null) { + this.networkFirewallFirewallPolicies + = new NetworkFirewallFirewallPoliciesImpl(clientObject.getNetworkFirewallFirewallPolicies(), this); + } + return networkFirewallFirewallPolicies; + } + + /** + * Gets the resource collection API of NetworkFirewallRuleGroups. It manages NetworkFirewallRuleGroup. + * + * @return Resource collection API of NetworkFirewallRuleGroups. + */ + public NetworkFirewallRuleGroups networkFirewallRuleGroups() { + if (this.networkFirewallRuleGroups == null) { + this.networkFirewallRuleGroups + = new NetworkFirewallRuleGroupsImpl(clientObject.getNetworkFirewallRuleGroups(), this); + } + return networkFirewallRuleGroups; + } + + /** + * Gets the resource collection API of OpenSearchDomainStatuses. It manages OpenSearchDomainStatus. + * + * @return Resource collection API of OpenSearchDomainStatuses. + */ + public OpenSearchDomainStatuses openSearchDomainStatuses() { + if (this.openSearchDomainStatuses == null) { + this.openSearchDomainStatuses + = new OpenSearchDomainStatusesImpl(clientObject.getOpenSearchDomainStatuses(), this); + } + return openSearchDomainStatuses; + } + + /** + * 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); + } + return operations; + } + + /** + * Gets the resource collection API of OrganizationsAccounts. It manages OrganizationsAccount. + * + * @return Resource collection API of OrganizationsAccounts. + */ + public OrganizationsAccounts organizationsAccounts() { + if (this.organizationsAccounts == null) { + this.organizationsAccounts = new OrganizationsAccountsImpl(clientObject.getOrganizationsAccounts(), this); + } + return organizationsAccounts; + } + + /** + * Gets the resource collection API of OrganizationsOrganizations. It manages OrganizationsOrganization. + * + * @return Resource collection API of OrganizationsOrganizations. + */ + public OrganizationsOrganizations organizationsOrganizations() { + if (this.organizationsOrganizations == null) { + this.organizationsOrganizations + = new OrganizationsOrganizationsImpl(clientObject.getOrganizationsOrganizations(), this); + } + return organizationsOrganizations; + } + + /** + * Gets the resource collection API of RdsDbClusters. It manages RdsDBCluster. + * + * @return Resource collection API of RdsDbClusters. + */ + public RdsDbClusters rdsDbClusters() { + if (this.rdsDbClusters == null) { + this.rdsDbClusters = new RdsDbClustersImpl(clientObject.getRdsDbClusters(), this); + } + return rdsDbClusters; + } + + /** + * Gets the resource collection API of RdsDbInstances. It manages RdsDBInstance. + * + * @return Resource collection API of RdsDbInstances. + */ + public RdsDbInstances rdsDbInstances() { + if (this.rdsDbInstances == null) { + this.rdsDbInstances = new RdsDbInstancesImpl(clientObject.getRdsDbInstances(), this); + } + return rdsDbInstances; + } + + /** + * Gets the resource collection API of RdsDbSnapshots. It manages RdsDBSnapshot. + * + * @return Resource collection API of RdsDbSnapshots. + */ + public RdsDbSnapshots rdsDbSnapshots() { + if (this.rdsDbSnapshots == null) { + this.rdsDbSnapshots = new RdsDbSnapshotsImpl(clientObject.getRdsDbSnapshots(), this); + } + return rdsDbSnapshots; + } + + /** + * Gets the resource collection API of RdsDbSnapshotAttributesResults. It manages RdsDBSnapshotAttributesResult. + * + * @return Resource collection API of RdsDbSnapshotAttributesResults. + */ + public RdsDbSnapshotAttributesResults rdsDbSnapshotAttributesResults() { + if (this.rdsDbSnapshotAttributesResults == null) { + this.rdsDbSnapshotAttributesResults + = new RdsDbSnapshotAttributesResultsImpl(clientObject.getRdsDbSnapshotAttributesResults(), this); + } + return rdsDbSnapshotAttributesResults; + } + + /** + * Gets the resource collection API of RdsEventSubscriptions. It manages RdsEventSubscription. + * + * @return Resource collection API of RdsEventSubscriptions. + */ + public RdsEventSubscriptions rdsEventSubscriptions() { + if (this.rdsEventSubscriptions == null) { + this.rdsEventSubscriptions = new RdsEventSubscriptionsImpl(clientObject.getRdsEventSubscriptions(), this); + } + return rdsEventSubscriptions; + } + + /** + * Gets the resource collection API of RdsExportTasks. It manages RdsExportTask. + * + * @return Resource collection API of RdsExportTasks. + */ + public RdsExportTasks rdsExportTasks() { + if (this.rdsExportTasks == null) { + this.rdsExportTasks = new RdsExportTasksImpl(clientObject.getRdsExportTasks(), this); + } + return rdsExportTasks; + } + + /** + * Gets the resource collection API of RedshiftClusters. It manages RedshiftCluster. + * + * @return Resource collection API of RedshiftClusters. + */ + public RedshiftClusters redshiftClusters() { + if (this.redshiftClusters == null) { + this.redshiftClusters = new RedshiftClustersImpl(clientObject.getRedshiftClusters(), this); + } + return redshiftClusters; + } + + /** + * Gets the resource collection API of RedshiftClusterParameterGroups. It manages RedshiftClusterParameterGroup. + * + * @return Resource collection API of RedshiftClusterParameterGroups. + */ + public RedshiftClusterParameterGroups redshiftClusterParameterGroups() { + if (this.redshiftClusterParameterGroups == null) { + this.redshiftClusterParameterGroups + = new RedshiftClusterParameterGroupsImpl(clientObject.getRedshiftClusterParameterGroups(), this); + } + return redshiftClusterParameterGroups; + } + + /** + * Gets the resource collection API of Route53DomainsDomainSummaries. It manages Route53DomainsDomainSummary. + * + * @return Resource collection API of Route53DomainsDomainSummaries. + */ + public Route53DomainsDomainSummaries route53DomainsDomainSummaries() { + if (this.route53DomainsDomainSummaries == null) { + this.route53DomainsDomainSummaries + = new Route53DomainsDomainSummariesImpl(clientObject.getRoute53DomainsDomainSummaries(), this); + } + return route53DomainsDomainSummaries; + } + + /** + * Gets the resource collection API of Route53HostedZones. It manages Route53HostedZone. + * + * @return Resource collection API of Route53HostedZones. + */ + public Route53HostedZones route53HostedZones() { + if (this.route53HostedZones == null) { + this.route53HostedZones = new Route53HostedZonesImpl(clientObject.getRoute53HostedZones(), this); + } + return route53HostedZones; + } + + /** + * Gets the resource collection API of Route53ResourceRecordSets. It manages Route53ResourceRecordSet. + * + * @return Resource collection API of Route53ResourceRecordSets. + */ + public Route53ResourceRecordSets route53ResourceRecordSets() { + if (this.route53ResourceRecordSets == null) { + this.route53ResourceRecordSets + = new Route53ResourceRecordSetsImpl(clientObject.getRoute53ResourceRecordSets(), this); + } + return route53ResourceRecordSets; + } + + /** + * Gets the resource collection API of S3AccessPoints. It manages S3AccessPoint. + * + * @return Resource collection API of S3AccessPoints. + */ + public S3AccessPoints s3AccessPoints() { + if (this.s3AccessPoints == null) { + this.s3AccessPoints = new S3AccessPointsImpl(clientObject.getS3AccessPoints(), this); + } + return s3AccessPoints; + } + + /** + * Gets the resource collection API of S3Buckets. It manages S3Bucket. + * + * @return Resource collection API of S3Buckets. + */ + public S3Buckets s3Buckets() { + if (this.s3Buckets == null) { + this.s3Buckets = new S3BucketsImpl(clientObject.getS3Buckets(), this); + } + return s3Buckets; + } + + /** + * Gets the resource collection API of S3BucketPolicies. It manages S3BucketPolicy. + * + * @return Resource collection API of S3BucketPolicies. + */ + public S3BucketPolicies s3BucketPolicies() { + if (this.s3BucketPolicies == null) { + this.s3BucketPolicies = new S3BucketPoliciesImpl(clientObject.getS3BucketPolicies(), this); + } + return s3BucketPolicies; + } + + /** + * Gets the resource collection API of S3ControlMultiRegionAccessPointPolicyDocuments. It manages + * S3ControlMultiRegionAccessPointPolicyDocument. + * + * @return Resource collection API of S3ControlMultiRegionAccessPointPolicyDocuments. + */ + public S3ControlMultiRegionAccessPointPolicyDocuments s3ControlMultiRegionAccessPointPolicyDocuments() { + if (this.s3ControlMultiRegionAccessPointPolicyDocuments == null) { + this.s3ControlMultiRegionAccessPointPolicyDocuments + = new S3ControlMultiRegionAccessPointPolicyDocumentsImpl( + clientObject.getS3ControlMultiRegionAccessPointPolicyDocuments(), this); + } + return s3ControlMultiRegionAccessPointPolicyDocuments; + } + + /** + * Gets the resource collection API of SageMakerApps. It manages SageMakerApp. + * + * @return Resource collection API of SageMakerApps. + */ + public SageMakerApps sageMakerApps() { + if (this.sageMakerApps == null) { + this.sageMakerApps = new SageMakerAppsImpl(clientObject.getSageMakerApps(), this); + } + return sageMakerApps; + } + + /** + * Gets the resource collection API of SageMakerNotebookInstanceSummaries. It manages + * SageMakerNotebookInstanceSummary. + * + * @return Resource collection API of SageMakerNotebookInstanceSummaries. + */ + public SageMakerNotebookInstanceSummaries sageMakerNotebookInstanceSummaries() { + if (this.sageMakerNotebookInstanceSummaries == null) { + this.sageMakerNotebookInstanceSummaries = new SageMakerNotebookInstanceSummariesImpl( + clientObject.getSageMakerNotebookInstanceSummaries(), this); + } + return sageMakerNotebookInstanceSummaries; + } + + /** + * Gets the resource collection API of SecretsManagerResourcePolicies. It manages SecretsManagerResourcePolicy. + * + * @return Resource collection API of SecretsManagerResourcePolicies. + */ + public SecretsManagerResourcePolicies secretsManagerResourcePolicies() { + if (this.secretsManagerResourcePolicies == null) { + this.secretsManagerResourcePolicies + = new SecretsManagerResourcePoliciesImpl(clientObject.getSecretsManagerResourcePolicies(), this); + } + return secretsManagerResourcePolicies; + } + + /** + * Gets the resource collection API of SecretsManagerSecrets. It manages SecretsManagerSecret. + * + * @return Resource collection API of SecretsManagerSecrets. + */ + public SecretsManagerSecrets secretsManagerSecrets() { + if (this.secretsManagerSecrets == null) { + this.secretsManagerSecrets = new SecretsManagerSecretsImpl(clientObject.getSecretsManagerSecrets(), this); + } + return secretsManagerSecrets; + } + + /** + * Gets the resource collection API of SnsSubscriptions. It manages SnsSubscription. + * + * @return Resource collection API of SnsSubscriptions. + */ + public SnsSubscriptions snsSubscriptions() { + if (this.snsSubscriptions == null) { + this.snsSubscriptions = new SnsSubscriptionsImpl(clientObject.getSnsSubscriptions(), this); + } + return snsSubscriptions; + } + + /** + * Gets the resource collection API of SnsTopics. It manages SnsTopic. + * + * @return Resource collection API of SnsTopics. + */ + public SnsTopics snsTopics() { + if (this.snsTopics == null) { + this.snsTopics = new SnsTopicsImpl(clientObject.getSnsTopics(), this); + } + return snsTopics; + } + + /** + * Gets the resource collection API of SqsQueues. It manages SqsQueue. + * + * @return Resource collection API of SqsQueues. + */ + public SqsQueues sqsQueues() { + if (this.sqsQueues == null) { + this.sqsQueues = new SqsQueuesImpl(clientObject.getSqsQueues(), this); + } + return sqsQueues; + } + + /** + * Gets the resource collection API of SsmInstanceInformations. It manages SsmInstanceInformation. + * + * @return Resource collection API of SsmInstanceInformations. + */ + public SsmInstanceInformations ssmInstanceInformations() { + if (this.ssmInstanceInformations == null) { + this.ssmInstanceInformations + = new SsmInstanceInformationsImpl(clientObject.getSsmInstanceInformations(), this); + } + return ssmInstanceInformations; + } + + /** + * Gets the resource collection API of SsmParameters. It manages SsmParameter. + * + * @return Resource collection API of SsmParameters. + */ + public SsmParameters ssmParameters() { + if (this.ssmParameters == null) { + this.ssmParameters = new SsmParametersImpl(clientObject.getSsmParameters(), this); + } + return ssmParameters; + } + + /** + * Gets the resource collection API of SsmResourceComplianceSummaryItems. It manages + * SsmResourceComplianceSummaryItem. + * + * @return Resource collection API of SsmResourceComplianceSummaryItems. + */ + public SsmResourceComplianceSummaryItems ssmResourceComplianceSummaryItems() { + if (this.ssmResourceComplianceSummaryItems == null) { + this.ssmResourceComplianceSummaryItems + = new SsmResourceComplianceSummaryItemsImpl(clientObject.getSsmResourceComplianceSummaryItems(), this); + } + return ssmResourceComplianceSummaryItems; + } + + /** + * Gets the resource collection API of Wafv2LoggingConfigurations. It manages Wafv2LoggingConfiguration. + * + * @return Resource collection API of Wafv2LoggingConfigurations. + */ + public Wafv2LoggingConfigurations wafv2LoggingConfigurations() { + if (this.wafv2LoggingConfigurations == null) { + this.wafv2LoggingConfigurations + = new Wafv2LoggingConfigurationsImpl(clientObject.getWafv2LoggingConfigurations(), this); + } + return wafv2LoggingConfigurations; + } + + /** + * Gets the resource collection API of WafWebAclSummaries. It manages WafWebAclSummary. + * + * @return Resource collection API of WafWebAclSummaries. + */ + public WafWebAclSummaries wafWebAclSummaries() { + if (this.wafWebAclSummaries == null) { + this.wafWebAclSummaries = new WafWebAclSummariesImpl(clientObject.getWafWebAclSummaries(), this); + } + return wafWebAclSummaries; + } + + /** + * Gets wrapped service client MicrosoftAwsConnector providing direct access to the underlying auto-generated API + * implementation, based on Azure REST API. + * + * @return Wrapped service client MicrosoftAwsConnector. + */ + public MicrosoftAwsConnector serviceClient() { + return this.clientObject; + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/AccessAnalyzerAnalyzersClient.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/AccessAnalyzerAnalyzersClient.java new file mode 100644 index 000000000000..1871033cfc9e --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/AccessAnalyzerAnalyzersClient.java @@ -0,0 +1,273 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.awsconnector.fluent.models.AccessAnalyzerInner; +import com.azure.resourcemanager.awsconnector.models.AccessAnalyzerTagsUpdate; + +/** + * An instance of this class provides access to all the operations defined in AccessAnalyzerAnalyzersClient. + */ +public interface AccessAnalyzerAnalyzersClient { + /** + * List AccessAnalyzerAnalyzer resources by subscription ID. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a AccessAnalyzerAnalyzer list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * List AccessAnalyzerAnalyzer resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a AccessAnalyzerAnalyzer list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(Context context); + + /** + * List AccessAnalyzerAnalyzer resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a AccessAnalyzerAnalyzer list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * List AccessAnalyzerAnalyzer resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a AccessAnalyzerAnalyzer list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Get a AccessAnalyzerAnalyzer. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of AccessAnalyzerAnalyzer. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a AccessAnalyzerAnalyzer along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getByResourceGroupWithResponse(String resourceGroupName, String name, + Context context); + + /** + * Get a AccessAnalyzerAnalyzer. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of AccessAnalyzerAnalyzer. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a AccessAnalyzerAnalyzer. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + AccessAnalyzerInner getByResourceGroup(String resourceGroupName, String name); + + /** + * Create a AccessAnalyzerAnalyzer. Please note that end user resource creation is currently restricted, but it will + * be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of AccessAnalyzerAnalyzer. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, AccessAnalyzerInner> beginCreateOrReplace(String resourceGroupName, + String name, AccessAnalyzerInner resource); + + /** + * Create a AccessAnalyzerAnalyzer. Please note that end user resource creation is currently restricted, but it will + * be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of AccessAnalyzerAnalyzer. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, AccessAnalyzerInner> beginCreateOrReplace(String resourceGroupName, + String name, AccessAnalyzerInner resource, Context context); + + /** + * Create a AccessAnalyzerAnalyzer. Please note that end user resource creation is currently restricted, but it will + * be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of AccessAnalyzerAnalyzer. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + AccessAnalyzerInner createOrReplace(String resourceGroupName, String name, AccessAnalyzerInner resource); + + /** + * Create a AccessAnalyzerAnalyzer. Please note that end user resource creation is currently restricted, but it will + * be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of AccessAnalyzerAnalyzer. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + AccessAnalyzerInner createOrReplace(String resourceGroupName, String name, AccessAnalyzerInner resource, + Context context); + + /** + * Update a AccessAnalyzerAnalyzer. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of AccessAnalyzerAnalyzer. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, AccessAnalyzerInner> beginUpdate(String resourceGroupName, String name, + AccessAnalyzerTagsUpdate properties); + + /** + * Update a AccessAnalyzerAnalyzer. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of AccessAnalyzerAnalyzer. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, AccessAnalyzerInner> beginUpdate(String resourceGroupName, String name, + AccessAnalyzerTagsUpdate properties, Context context); + + /** + * Update a AccessAnalyzerAnalyzer. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of AccessAnalyzerAnalyzer. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + AccessAnalyzerInner update(String resourceGroupName, String name, AccessAnalyzerTagsUpdate properties); + + /** + * Update a AccessAnalyzerAnalyzer. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of AccessAnalyzerAnalyzer. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + AccessAnalyzerInner update(String resourceGroupName, String name, AccessAnalyzerTagsUpdate properties, + Context context); + + /** + * Delete a AccessAnalyzerAnalyzer. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of AccessAnalyzerAnalyzer. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String name); + + /** + * Delete a AccessAnalyzerAnalyzer. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of AccessAnalyzerAnalyzer. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String name, Context context); + + /** + * Delete a AccessAnalyzerAnalyzer. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of AccessAnalyzerAnalyzer. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String name); + + /** + * Delete a AccessAnalyzerAnalyzer. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of AccessAnalyzerAnalyzer. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String name, Context context); +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/AcmCertificateSummariesClient.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/AcmCertificateSummariesClient.java new file mode 100644 index 000000000000..73d30e1eeb59 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/AcmCertificateSummariesClient.java @@ -0,0 +1,275 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.awsconnector.fluent.models.AcmCertificateSummaryInner; +import com.azure.resourcemanager.awsconnector.models.AcmCertificateSummaryTagsUpdate; + +/** + * An instance of this class provides access to all the operations defined in AcmCertificateSummariesClient. + */ +public interface AcmCertificateSummariesClient { + /** + * List AcmCertificateSummary resources by subscription ID. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a AcmCertificateSummary list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * List AcmCertificateSummary resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a AcmCertificateSummary list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(Context context); + + /** + * List AcmCertificateSummary resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a AcmCertificateSummary list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * List AcmCertificateSummary resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a AcmCertificateSummary list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Get a AcmCertificateSummary. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of AcmCertificateSummary. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a AcmCertificateSummary along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getByResourceGroupWithResponse(String resourceGroupName, String name, + Context context); + + /** + * Get a AcmCertificateSummary. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of AcmCertificateSummary. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a AcmCertificateSummary. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + AcmCertificateSummaryInner getByResourceGroup(String resourceGroupName, String name); + + /** + * Create a AcmCertificateSummary. Please note that end user resource creation is currently restricted, but it will + * be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of AcmCertificateSummary. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, AcmCertificateSummaryInner> + beginCreateOrReplace(String resourceGroupName, String name, AcmCertificateSummaryInner resource); + + /** + * Create a AcmCertificateSummary. Please note that end user resource creation is currently restricted, but it will + * be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of AcmCertificateSummary. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, AcmCertificateSummaryInner> beginCreateOrReplace( + String resourceGroupName, String name, AcmCertificateSummaryInner resource, Context context); + + /** + * Create a AcmCertificateSummary. Please note that end user resource creation is currently restricted, but it will + * be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of AcmCertificateSummary. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + AcmCertificateSummaryInner createOrReplace(String resourceGroupName, String name, + AcmCertificateSummaryInner resource); + + /** + * Create a AcmCertificateSummary. Please note that end user resource creation is currently restricted, but it will + * be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of AcmCertificateSummary. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + AcmCertificateSummaryInner createOrReplace(String resourceGroupName, String name, + AcmCertificateSummaryInner resource, Context context); + + /** + * Update a AcmCertificateSummary. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of AcmCertificateSummary. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, AcmCertificateSummaryInner> beginUpdate(String resourceGroupName, + String name, AcmCertificateSummaryTagsUpdate properties); + + /** + * Update a AcmCertificateSummary. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of AcmCertificateSummary. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, AcmCertificateSummaryInner> beginUpdate(String resourceGroupName, + String name, AcmCertificateSummaryTagsUpdate properties, Context context); + + /** + * Update a AcmCertificateSummary. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of AcmCertificateSummary. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + AcmCertificateSummaryInner update(String resourceGroupName, String name, + AcmCertificateSummaryTagsUpdate properties); + + /** + * Update a AcmCertificateSummary. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of AcmCertificateSummary. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + AcmCertificateSummaryInner update(String resourceGroupName, String name, AcmCertificateSummaryTagsUpdate properties, + Context context); + + /** + * Delete a AcmCertificateSummary. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of AcmCertificateSummary. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String name); + + /** + * Delete a AcmCertificateSummary. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of AcmCertificateSummary. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String name, Context context); + + /** + * Delete a AcmCertificateSummary. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of AcmCertificateSummary. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String name); + + /** + * Delete a AcmCertificateSummary. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of AcmCertificateSummary. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String name, Context context); +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/ApiGatewayRestApisClient.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/ApiGatewayRestApisClient.java new file mode 100644 index 000000000000..b07d1552b187 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/ApiGatewayRestApisClient.java @@ -0,0 +1,273 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.awsconnector.fluent.models.ApiGatewayRestApiInner; +import com.azure.resourcemanager.awsconnector.models.ApiGatewayRestApiTagsUpdate; + +/** + * An instance of this class provides access to all the operations defined in ApiGatewayRestApisClient. + */ +public interface ApiGatewayRestApisClient { + /** + * List ApiGatewayRestApi resources by subscription ID. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a ApiGatewayRestApi list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * List ApiGatewayRestApi resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a ApiGatewayRestApi list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(Context context); + + /** + * List ApiGatewayRestApi resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a ApiGatewayRestApi list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * List ApiGatewayRestApi resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a ApiGatewayRestApi list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Get a ApiGatewayRestApi. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ApiGatewayRestApi. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a ApiGatewayRestApi along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getByResourceGroupWithResponse(String resourceGroupName, String name, + Context context); + + /** + * Get a ApiGatewayRestApi. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ApiGatewayRestApi. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a ApiGatewayRestApi. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ApiGatewayRestApiInner getByResourceGroup(String resourceGroupName, String name); + + /** + * Create a ApiGatewayRestApi. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ApiGatewayRestApi. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, ApiGatewayRestApiInner> + beginCreateOrReplace(String resourceGroupName, String name, ApiGatewayRestApiInner resource); + + /** + * Create a ApiGatewayRestApi. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ApiGatewayRestApi. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, ApiGatewayRestApiInner> + beginCreateOrReplace(String resourceGroupName, String name, ApiGatewayRestApiInner resource, Context context); + + /** + * Create a ApiGatewayRestApi. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ApiGatewayRestApi. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ApiGatewayRestApiInner createOrReplace(String resourceGroupName, String name, ApiGatewayRestApiInner resource); + + /** + * Create a ApiGatewayRestApi. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ApiGatewayRestApi. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ApiGatewayRestApiInner createOrReplace(String resourceGroupName, String name, ApiGatewayRestApiInner resource, + Context context); + + /** + * Update a ApiGatewayRestApi. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ApiGatewayRestApi. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, ApiGatewayRestApiInner> beginUpdate(String resourceGroupName, + String name, ApiGatewayRestApiTagsUpdate properties); + + /** + * Update a ApiGatewayRestApi. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ApiGatewayRestApi. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, ApiGatewayRestApiInner> beginUpdate(String resourceGroupName, + String name, ApiGatewayRestApiTagsUpdate properties, Context context); + + /** + * Update a ApiGatewayRestApi. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ApiGatewayRestApi. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ApiGatewayRestApiInner update(String resourceGroupName, String name, ApiGatewayRestApiTagsUpdate properties); + + /** + * Update a ApiGatewayRestApi. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ApiGatewayRestApi. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ApiGatewayRestApiInner update(String resourceGroupName, String name, ApiGatewayRestApiTagsUpdate properties, + Context context); + + /** + * Delete a ApiGatewayRestApi. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ApiGatewayRestApi. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String name); + + /** + * Delete a ApiGatewayRestApi. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ApiGatewayRestApi. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String name, Context context); + + /** + * Delete a ApiGatewayRestApi. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ApiGatewayRestApi. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String name); + + /** + * Delete a ApiGatewayRestApi. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ApiGatewayRestApi. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String name, Context context); +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/ApiGatewayStagesClient.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/ApiGatewayStagesClient.java new file mode 100644 index 000000000000..b2b56745b306 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/ApiGatewayStagesClient.java @@ -0,0 +1,273 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.awsconnector.fluent.models.ApiGatewayStageInner; +import com.azure.resourcemanager.awsconnector.models.ApiGatewayStageTagsUpdate; + +/** + * An instance of this class provides access to all the operations defined in ApiGatewayStagesClient. + */ +public interface ApiGatewayStagesClient { + /** + * List ApiGatewayStage resources by subscription ID. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a ApiGatewayStage list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * List ApiGatewayStage resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a ApiGatewayStage list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(Context context); + + /** + * List ApiGatewayStage resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a ApiGatewayStage list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * List ApiGatewayStage resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a ApiGatewayStage list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Get a ApiGatewayStage. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ApiGatewayStage. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a ApiGatewayStage along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getByResourceGroupWithResponse(String resourceGroupName, String name, + Context context); + + /** + * Get a ApiGatewayStage. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ApiGatewayStage. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a ApiGatewayStage. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ApiGatewayStageInner getByResourceGroup(String resourceGroupName, String name); + + /** + * Create a ApiGatewayStage. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ApiGatewayStage. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, ApiGatewayStageInner> beginCreateOrReplace(String resourceGroupName, + String name, ApiGatewayStageInner resource); + + /** + * Create a ApiGatewayStage. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ApiGatewayStage. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, ApiGatewayStageInner> beginCreateOrReplace(String resourceGroupName, + String name, ApiGatewayStageInner resource, Context context); + + /** + * Create a ApiGatewayStage. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ApiGatewayStage. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ApiGatewayStageInner createOrReplace(String resourceGroupName, String name, ApiGatewayStageInner resource); + + /** + * Create a ApiGatewayStage. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ApiGatewayStage. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ApiGatewayStageInner createOrReplace(String resourceGroupName, String name, ApiGatewayStageInner resource, + Context context); + + /** + * Update a ApiGatewayStage. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ApiGatewayStage. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, ApiGatewayStageInner> beginUpdate(String resourceGroupName, + String name, ApiGatewayStageTagsUpdate properties); + + /** + * Update a ApiGatewayStage. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ApiGatewayStage. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, ApiGatewayStageInner> beginUpdate(String resourceGroupName, + String name, ApiGatewayStageTagsUpdate properties, Context context); + + /** + * Update a ApiGatewayStage. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ApiGatewayStage. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ApiGatewayStageInner update(String resourceGroupName, String name, ApiGatewayStageTagsUpdate properties); + + /** + * Update a ApiGatewayStage. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ApiGatewayStage. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ApiGatewayStageInner update(String resourceGroupName, String name, ApiGatewayStageTagsUpdate properties, + Context context); + + /** + * Delete a ApiGatewayStage. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ApiGatewayStage. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String name); + + /** + * Delete a ApiGatewayStage. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ApiGatewayStage. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String name, Context context); + + /** + * Delete a ApiGatewayStage. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ApiGatewayStage. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String name); + + /** + * Delete a ApiGatewayStage. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ApiGatewayStage. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String name, Context context); +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/AppSyncGraphqlApisClient.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/AppSyncGraphqlApisClient.java new file mode 100644 index 000000000000..8d480774de6b --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/AppSyncGraphqlApisClient.java @@ -0,0 +1,273 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.awsconnector.fluent.models.AppSyncGraphqlApiInner; +import com.azure.resourcemanager.awsconnector.models.AppSyncGraphqlApiTagsUpdate; + +/** + * An instance of this class provides access to all the operations defined in AppSyncGraphqlApisClient. + */ +public interface AppSyncGraphqlApisClient { + /** + * List AppSyncGraphqlApi resources by subscription ID. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a AppSyncGraphqlApi list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * List AppSyncGraphqlApi resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a AppSyncGraphqlApi list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(Context context); + + /** + * List AppSyncGraphqlApi resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a AppSyncGraphqlApi list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * List AppSyncGraphqlApi resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a AppSyncGraphqlApi list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Get a AppSyncGraphqlApi. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of AppSyncGraphqlApi. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a AppSyncGraphqlApi along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getByResourceGroupWithResponse(String resourceGroupName, String name, + Context context); + + /** + * Get a AppSyncGraphqlApi. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of AppSyncGraphqlApi. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a AppSyncGraphqlApi. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + AppSyncGraphqlApiInner getByResourceGroup(String resourceGroupName, String name); + + /** + * Create a AppSyncGraphqlApi. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of AppSyncGraphqlApi. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, AppSyncGraphqlApiInner> + beginCreateOrReplace(String resourceGroupName, String name, AppSyncGraphqlApiInner resource); + + /** + * Create a AppSyncGraphqlApi. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of AppSyncGraphqlApi. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, AppSyncGraphqlApiInner> + beginCreateOrReplace(String resourceGroupName, String name, AppSyncGraphqlApiInner resource, Context context); + + /** + * Create a AppSyncGraphqlApi. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of AppSyncGraphqlApi. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + AppSyncGraphqlApiInner createOrReplace(String resourceGroupName, String name, AppSyncGraphqlApiInner resource); + + /** + * Create a AppSyncGraphqlApi. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of AppSyncGraphqlApi. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + AppSyncGraphqlApiInner createOrReplace(String resourceGroupName, String name, AppSyncGraphqlApiInner resource, + Context context); + + /** + * Update a AppSyncGraphqlApi. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of AppSyncGraphqlApi. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, AppSyncGraphqlApiInner> beginUpdate(String resourceGroupName, + String name, AppSyncGraphqlApiTagsUpdate properties); + + /** + * Update a AppSyncGraphqlApi. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of AppSyncGraphqlApi. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, AppSyncGraphqlApiInner> beginUpdate(String resourceGroupName, + String name, AppSyncGraphqlApiTagsUpdate properties, Context context); + + /** + * Update a AppSyncGraphqlApi. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of AppSyncGraphqlApi. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + AppSyncGraphqlApiInner update(String resourceGroupName, String name, AppSyncGraphqlApiTagsUpdate properties); + + /** + * Update a AppSyncGraphqlApi. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of AppSyncGraphqlApi. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + AppSyncGraphqlApiInner update(String resourceGroupName, String name, AppSyncGraphqlApiTagsUpdate properties, + Context context); + + /** + * Delete a AppSyncGraphqlApi. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of AppSyncGraphqlApi. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String name); + + /** + * Delete a AppSyncGraphqlApi. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of AppSyncGraphqlApi. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String name, Context context); + + /** + * Delete a AppSyncGraphqlApi. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of AppSyncGraphqlApi. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String name); + + /** + * Delete a AppSyncGraphqlApi. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of AppSyncGraphqlApi. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String name, Context context); +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/AutoScalingAutoScalingGroupsClient.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/AutoScalingAutoScalingGroupsClient.java new file mode 100644 index 000000000000..da2ad76be825 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/AutoScalingAutoScalingGroupsClient.java @@ -0,0 +1,277 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.awsconnector.fluent.models.AutoScalingGroupInner; +import com.azure.resourcemanager.awsconnector.models.AutoScalingGroupTagsUpdate; + +/** + * An instance of this class provides access to all the operations defined in AutoScalingAutoScalingGroupsClient. + */ +public interface AutoScalingAutoScalingGroupsClient { + /** + * List AutoScalingAutoScalingGroup resources by subscription ID. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a AutoScalingAutoScalingGroup list operation as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * List AutoScalingAutoScalingGroup resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a AutoScalingAutoScalingGroup list operation as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(Context context); + + /** + * List AutoScalingAutoScalingGroup resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a AutoScalingAutoScalingGroup list operation as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * List AutoScalingAutoScalingGroup resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a AutoScalingAutoScalingGroup list operation as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Get a AutoScalingAutoScalingGroup. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of AutoScalingAutoScalingGroup. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a AutoScalingAutoScalingGroup along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getByResourceGroupWithResponse(String resourceGroupName, String name, + Context context); + + /** + * Get a AutoScalingAutoScalingGroup. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of AutoScalingAutoScalingGroup. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a AutoScalingAutoScalingGroup. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + AutoScalingGroupInner getByResourceGroup(String resourceGroupName, String name); + + /** + * Create a AutoScalingAutoScalingGroup. Please note that end user resource creation is currently restricted, but it + * will be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of AutoScalingAutoScalingGroup. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, AutoScalingGroupInner> beginCreateOrReplace(String resourceGroupName, + String name, AutoScalingGroupInner resource); + + /** + * Create a AutoScalingAutoScalingGroup. Please note that end user resource creation is currently restricted, but it + * will be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of AutoScalingAutoScalingGroup. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, AutoScalingGroupInner> beginCreateOrReplace(String resourceGroupName, + String name, AutoScalingGroupInner resource, Context context); + + /** + * Create a AutoScalingAutoScalingGroup. Please note that end user resource creation is currently restricted, but it + * will be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of AutoScalingAutoScalingGroup. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + AutoScalingGroupInner createOrReplace(String resourceGroupName, String name, AutoScalingGroupInner resource); + + /** + * Create a AutoScalingAutoScalingGroup. Please note that end user resource creation is currently restricted, but it + * will be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of AutoScalingAutoScalingGroup. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + AutoScalingGroupInner createOrReplace(String resourceGroupName, String name, AutoScalingGroupInner resource, + Context context); + + /** + * Update a AutoScalingAutoScalingGroup. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of AutoScalingAutoScalingGroup. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, AutoScalingGroupInner> beginUpdate(String resourceGroupName, + String name, AutoScalingGroupTagsUpdate properties); + + /** + * Update a AutoScalingAutoScalingGroup. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of AutoScalingAutoScalingGroup. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, AutoScalingGroupInner> beginUpdate(String resourceGroupName, + String name, AutoScalingGroupTagsUpdate properties, Context context); + + /** + * Update a AutoScalingAutoScalingGroup. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of AutoScalingAutoScalingGroup. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + AutoScalingGroupInner update(String resourceGroupName, String name, AutoScalingGroupTagsUpdate properties); + + /** + * Update a AutoScalingAutoScalingGroup. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of AutoScalingAutoScalingGroup. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + AutoScalingGroupInner update(String resourceGroupName, String name, AutoScalingGroupTagsUpdate properties, + Context context); + + /** + * Delete a AutoScalingAutoScalingGroup. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of AutoScalingAutoScalingGroup. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String name); + + /** + * Delete a AutoScalingAutoScalingGroup. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of AutoScalingAutoScalingGroup. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String name, Context context); + + /** + * Delete a AutoScalingAutoScalingGroup. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of AutoScalingAutoScalingGroup. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String name); + + /** + * Delete a AutoScalingAutoScalingGroup. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of AutoScalingAutoScalingGroup. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String name, Context context); +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/CloudFormationStackSetsClient.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/CloudFormationStackSetsClient.java new file mode 100644 index 000000000000..1b783132fb4f --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/CloudFormationStackSetsClient.java @@ -0,0 +1,275 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.awsconnector.fluent.models.CloudFormationStackSetInner; +import com.azure.resourcemanager.awsconnector.models.CloudFormationStackSetTagsUpdate; + +/** + * An instance of this class provides access to all the operations defined in CloudFormationStackSetsClient. + */ +public interface CloudFormationStackSetsClient { + /** + * List CloudFormationStackSet resources by subscription ID. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a CloudFormationStackSet list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * List CloudFormationStackSet resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a CloudFormationStackSet list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(Context context); + + /** + * List CloudFormationStackSet resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a CloudFormationStackSet list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * List CloudFormationStackSet resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a CloudFormationStackSet list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Get a CloudFormationStackSet. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of CloudFormationStackSet. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a CloudFormationStackSet along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getByResourceGroupWithResponse(String resourceGroupName, String name, + Context context); + + /** + * Get a CloudFormationStackSet. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of CloudFormationStackSet. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a CloudFormationStackSet. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + CloudFormationStackSetInner getByResourceGroup(String resourceGroupName, String name); + + /** + * Create a CloudFormationStackSet. Please note that end user resource creation is currently restricted, but it will + * be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of CloudFormationStackSet. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, CloudFormationStackSetInner> + beginCreateOrReplace(String resourceGroupName, String name, CloudFormationStackSetInner resource); + + /** + * Create a CloudFormationStackSet. Please note that end user resource creation is currently restricted, but it will + * be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of CloudFormationStackSet. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, CloudFormationStackSetInner> beginCreateOrReplace( + String resourceGroupName, String name, CloudFormationStackSetInner resource, Context context); + + /** + * Create a CloudFormationStackSet. Please note that end user resource creation is currently restricted, but it will + * be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of CloudFormationStackSet. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + CloudFormationStackSetInner createOrReplace(String resourceGroupName, String name, + CloudFormationStackSetInner resource); + + /** + * Create a CloudFormationStackSet. Please note that end user resource creation is currently restricted, but it will + * be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of CloudFormationStackSet. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + CloudFormationStackSetInner createOrReplace(String resourceGroupName, String name, + CloudFormationStackSetInner resource, Context context); + + /** + * Update a CloudFormationStackSet. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of CloudFormationStackSet. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, CloudFormationStackSetInner> + beginUpdate(String resourceGroupName, String name, CloudFormationStackSetTagsUpdate properties); + + /** + * Update a CloudFormationStackSet. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of CloudFormationStackSet. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, CloudFormationStackSetInner> beginUpdate( + String resourceGroupName, String name, CloudFormationStackSetTagsUpdate properties, Context context); + + /** + * Update a CloudFormationStackSet. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of CloudFormationStackSet. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + CloudFormationStackSetInner update(String resourceGroupName, String name, + CloudFormationStackSetTagsUpdate properties); + + /** + * Update a CloudFormationStackSet. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of CloudFormationStackSet. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + CloudFormationStackSetInner update(String resourceGroupName, String name, + CloudFormationStackSetTagsUpdate properties, Context context); + + /** + * Delete a CloudFormationStackSet. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of CloudFormationStackSet. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String name); + + /** + * Delete a CloudFormationStackSet. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of CloudFormationStackSet. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String name, Context context); + + /** + * Delete a CloudFormationStackSet. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of CloudFormationStackSet. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String name); + + /** + * Delete a CloudFormationStackSet. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of CloudFormationStackSet. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String name, Context context); +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/CloudFormationStacksClient.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/CloudFormationStacksClient.java new file mode 100644 index 000000000000..9d04d003ad8b --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/CloudFormationStacksClient.java @@ -0,0 +1,273 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.awsconnector.fluent.models.CloudFormationStackInner; +import com.azure.resourcemanager.awsconnector.models.CloudFormationStackTagsUpdate; + +/** + * An instance of this class provides access to all the operations defined in CloudFormationStacksClient. + */ +public interface CloudFormationStacksClient { + /** + * List CloudFormationStack resources by subscription ID. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a CloudFormationStack list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * List CloudFormationStack resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a CloudFormationStack list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(Context context); + + /** + * List CloudFormationStack resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a CloudFormationStack list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * List CloudFormationStack resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a CloudFormationStack list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Get a CloudFormationStack. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of CloudFormationStack. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a CloudFormationStack along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getByResourceGroupWithResponse(String resourceGroupName, String name, + Context context); + + /** + * Get a CloudFormationStack. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of CloudFormationStack. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a CloudFormationStack. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + CloudFormationStackInner getByResourceGroup(String resourceGroupName, String name); + + /** + * Create a CloudFormationStack. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of CloudFormationStack. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, CloudFormationStackInner> + beginCreateOrReplace(String resourceGroupName, String name, CloudFormationStackInner resource); + + /** + * Create a CloudFormationStack. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of CloudFormationStack. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, CloudFormationStackInner> + beginCreateOrReplace(String resourceGroupName, String name, CloudFormationStackInner resource, Context context); + + /** + * Create a CloudFormationStack. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of CloudFormationStack. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + CloudFormationStackInner createOrReplace(String resourceGroupName, String name, CloudFormationStackInner resource); + + /** + * Create a CloudFormationStack. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of CloudFormationStack. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + CloudFormationStackInner createOrReplace(String resourceGroupName, String name, CloudFormationStackInner resource, + Context context); + + /** + * Update a CloudFormationStack. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of CloudFormationStack. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, CloudFormationStackInner> beginUpdate(String resourceGroupName, + String name, CloudFormationStackTagsUpdate properties); + + /** + * Update a CloudFormationStack. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of CloudFormationStack. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, CloudFormationStackInner> beginUpdate(String resourceGroupName, + String name, CloudFormationStackTagsUpdate properties, Context context); + + /** + * Update a CloudFormationStack. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of CloudFormationStack. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + CloudFormationStackInner update(String resourceGroupName, String name, CloudFormationStackTagsUpdate properties); + + /** + * Update a CloudFormationStack. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of CloudFormationStack. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + CloudFormationStackInner update(String resourceGroupName, String name, CloudFormationStackTagsUpdate properties, + Context context); + + /** + * Delete a CloudFormationStack. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of CloudFormationStack. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String name); + + /** + * Delete a CloudFormationStack. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of CloudFormationStack. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String name, Context context); + + /** + * Delete a CloudFormationStack. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of CloudFormationStack. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String name); + + /** + * Delete a CloudFormationStack. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of CloudFormationStack. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String name, Context context); +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/CloudFrontDistributionsClient.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/CloudFrontDistributionsClient.java new file mode 100644 index 000000000000..aa0bb38a1695 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/CloudFrontDistributionsClient.java @@ -0,0 +1,275 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.awsconnector.fluent.models.CloudFrontDistributionInner; +import com.azure.resourcemanager.awsconnector.models.CloudFrontDistributionTagsUpdate; + +/** + * An instance of this class provides access to all the operations defined in CloudFrontDistributionsClient. + */ +public interface CloudFrontDistributionsClient { + /** + * List CloudFrontDistribution resources by subscription ID. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a CloudFrontDistribution list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * List CloudFrontDistribution resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a CloudFrontDistribution list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(Context context); + + /** + * List CloudFrontDistribution resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a CloudFrontDistribution list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * List CloudFrontDistribution resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a CloudFrontDistribution list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Get a CloudFrontDistribution. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of CloudFrontDistribution. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a CloudFrontDistribution along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getByResourceGroupWithResponse(String resourceGroupName, String name, + Context context); + + /** + * Get a CloudFrontDistribution. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of CloudFrontDistribution. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a CloudFrontDistribution. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + CloudFrontDistributionInner getByResourceGroup(String resourceGroupName, String name); + + /** + * Create a CloudFrontDistribution. Please note that end user resource creation is currently restricted, but it will + * be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of CloudFrontDistribution. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, CloudFrontDistributionInner> + beginCreateOrReplace(String resourceGroupName, String name, CloudFrontDistributionInner resource); + + /** + * Create a CloudFrontDistribution. Please note that end user resource creation is currently restricted, but it will + * be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of CloudFrontDistribution. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, CloudFrontDistributionInner> beginCreateOrReplace( + String resourceGroupName, String name, CloudFrontDistributionInner resource, Context context); + + /** + * Create a CloudFrontDistribution. Please note that end user resource creation is currently restricted, but it will + * be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of CloudFrontDistribution. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + CloudFrontDistributionInner createOrReplace(String resourceGroupName, String name, + CloudFrontDistributionInner resource); + + /** + * Create a CloudFrontDistribution. Please note that end user resource creation is currently restricted, but it will + * be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of CloudFrontDistribution. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + CloudFrontDistributionInner createOrReplace(String resourceGroupName, String name, + CloudFrontDistributionInner resource, Context context); + + /** + * Update a CloudFrontDistribution. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of CloudFrontDistribution. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, CloudFrontDistributionInner> + beginUpdate(String resourceGroupName, String name, CloudFrontDistributionTagsUpdate properties); + + /** + * Update a CloudFrontDistribution. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of CloudFrontDistribution. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, CloudFrontDistributionInner> beginUpdate( + String resourceGroupName, String name, CloudFrontDistributionTagsUpdate properties, Context context); + + /** + * Update a CloudFrontDistribution. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of CloudFrontDistribution. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + CloudFrontDistributionInner update(String resourceGroupName, String name, + CloudFrontDistributionTagsUpdate properties); + + /** + * Update a CloudFrontDistribution. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of CloudFrontDistribution. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + CloudFrontDistributionInner update(String resourceGroupName, String name, + CloudFrontDistributionTagsUpdate properties, Context context); + + /** + * Delete a CloudFrontDistribution. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of CloudFrontDistribution. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String name); + + /** + * Delete a CloudFrontDistribution. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of CloudFrontDistribution. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String name, Context context); + + /** + * Delete a CloudFrontDistribution. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of CloudFrontDistribution. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String name); + + /** + * Delete a CloudFrontDistribution. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of CloudFrontDistribution. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String name, Context context); +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/CloudTrailTrailsClient.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/CloudTrailTrailsClient.java new file mode 100644 index 000000000000..247c892aa329 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/CloudTrailTrailsClient.java @@ -0,0 +1,270 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.awsconnector.fluent.models.CloudTrailInner; +import com.azure.resourcemanager.awsconnector.models.CloudTrailTagsUpdate; + +/** + * An instance of this class provides access to all the operations defined in CloudTrailTrailsClient. + */ +public interface CloudTrailTrailsClient { + /** + * List CloudTrailTrail resources by subscription ID. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a CloudTrailTrail list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * List CloudTrailTrail resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a CloudTrailTrail list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(Context context); + + /** + * List CloudTrailTrail resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a CloudTrailTrail list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * List CloudTrailTrail resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a CloudTrailTrail list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Get a CloudTrailTrail. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of CloudTrailTrail. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a CloudTrailTrail along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getByResourceGroupWithResponse(String resourceGroupName, String name, Context context); + + /** + * Get a CloudTrailTrail. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of CloudTrailTrail. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a CloudTrailTrail. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + CloudTrailInner getByResourceGroup(String resourceGroupName, String name); + + /** + * Create a CloudTrailTrail. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of CloudTrailTrail. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, CloudTrailInner> beginCreateOrReplace(String resourceGroupName, String name, + CloudTrailInner resource); + + /** + * Create a CloudTrailTrail. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of CloudTrailTrail. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, CloudTrailInner> beginCreateOrReplace(String resourceGroupName, String name, + CloudTrailInner resource, Context context); + + /** + * Create a CloudTrailTrail. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of CloudTrailTrail. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + CloudTrailInner createOrReplace(String resourceGroupName, String name, CloudTrailInner resource); + + /** + * Create a CloudTrailTrail. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of CloudTrailTrail. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + CloudTrailInner createOrReplace(String resourceGroupName, String name, CloudTrailInner resource, Context context); + + /** + * Update a CloudTrailTrail. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of CloudTrailTrail. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, CloudTrailInner> beginUpdate(String resourceGroupName, String name, + CloudTrailTagsUpdate properties); + + /** + * Update a CloudTrailTrail. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of CloudTrailTrail. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, CloudTrailInner> beginUpdate(String resourceGroupName, String name, + CloudTrailTagsUpdate properties, Context context); + + /** + * Update a CloudTrailTrail. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of CloudTrailTrail. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + CloudTrailInner update(String resourceGroupName, String name, CloudTrailTagsUpdate properties); + + /** + * Update a CloudTrailTrail. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of CloudTrailTrail. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + CloudTrailInner update(String resourceGroupName, String name, CloudTrailTagsUpdate properties, Context context); + + /** + * Delete a CloudTrailTrail. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of CloudTrailTrail. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String name); + + /** + * Delete a CloudTrailTrail. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of CloudTrailTrail. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String name, Context context); + + /** + * Delete a CloudTrailTrail. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of CloudTrailTrail. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String name); + + /** + * Delete a CloudTrailTrail. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of CloudTrailTrail. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String name, Context context); +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/CloudWatchAlarmsClient.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/CloudWatchAlarmsClient.java new file mode 100644 index 000000000000..86d1ddf10536 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/CloudWatchAlarmsClient.java @@ -0,0 +1,273 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.awsconnector.fluent.models.CloudWatchAlarmInner; +import com.azure.resourcemanager.awsconnector.models.CloudWatchAlarmTagsUpdate; + +/** + * An instance of this class provides access to all the operations defined in CloudWatchAlarmsClient. + */ +public interface CloudWatchAlarmsClient { + /** + * List CloudWatchAlarm resources by subscription ID. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a CloudWatchAlarm list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * List CloudWatchAlarm resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a CloudWatchAlarm list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(Context context); + + /** + * List CloudWatchAlarm resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a CloudWatchAlarm list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * List CloudWatchAlarm resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a CloudWatchAlarm list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Get a CloudWatchAlarm. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of CloudWatchAlarm. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a CloudWatchAlarm along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getByResourceGroupWithResponse(String resourceGroupName, String name, + Context context); + + /** + * Get a CloudWatchAlarm. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of CloudWatchAlarm. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a CloudWatchAlarm. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + CloudWatchAlarmInner getByResourceGroup(String resourceGroupName, String name); + + /** + * Create a CloudWatchAlarm. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of CloudWatchAlarm. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, CloudWatchAlarmInner> beginCreateOrReplace(String resourceGroupName, + String name, CloudWatchAlarmInner resource); + + /** + * Create a CloudWatchAlarm. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of CloudWatchAlarm. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, CloudWatchAlarmInner> beginCreateOrReplace(String resourceGroupName, + String name, CloudWatchAlarmInner resource, Context context); + + /** + * Create a CloudWatchAlarm. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of CloudWatchAlarm. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + CloudWatchAlarmInner createOrReplace(String resourceGroupName, String name, CloudWatchAlarmInner resource); + + /** + * Create a CloudWatchAlarm. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of CloudWatchAlarm. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + CloudWatchAlarmInner createOrReplace(String resourceGroupName, String name, CloudWatchAlarmInner resource, + Context context); + + /** + * Update a CloudWatchAlarm. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of CloudWatchAlarm. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, CloudWatchAlarmInner> beginUpdate(String resourceGroupName, + String name, CloudWatchAlarmTagsUpdate properties); + + /** + * Update a CloudWatchAlarm. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of CloudWatchAlarm. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, CloudWatchAlarmInner> beginUpdate(String resourceGroupName, + String name, CloudWatchAlarmTagsUpdate properties, Context context); + + /** + * Update a CloudWatchAlarm. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of CloudWatchAlarm. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + CloudWatchAlarmInner update(String resourceGroupName, String name, CloudWatchAlarmTagsUpdate properties); + + /** + * Update a CloudWatchAlarm. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of CloudWatchAlarm. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + CloudWatchAlarmInner update(String resourceGroupName, String name, CloudWatchAlarmTagsUpdate properties, + Context context); + + /** + * Delete a CloudWatchAlarm. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of CloudWatchAlarm. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String name); + + /** + * Delete a CloudWatchAlarm. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of CloudWatchAlarm. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String name, Context context); + + /** + * Delete a CloudWatchAlarm. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of CloudWatchAlarm. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String name); + + /** + * Delete a CloudWatchAlarm. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of CloudWatchAlarm. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String name, Context context); +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/CodeBuildProjectsClient.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/CodeBuildProjectsClient.java new file mode 100644 index 000000000000..71c8b8c004f0 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/CodeBuildProjectsClient.java @@ -0,0 +1,273 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.awsconnector.fluent.models.CodeBuildProjectInner; +import com.azure.resourcemanager.awsconnector.models.CodeBuildProjectTagsUpdate; + +/** + * An instance of this class provides access to all the operations defined in CodeBuildProjectsClient. + */ +public interface CodeBuildProjectsClient { + /** + * List CodeBuildProject resources by subscription ID. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a CodeBuildProject list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * List CodeBuildProject resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a CodeBuildProject list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(Context context); + + /** + * List CodeBuildProject resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a CodeBuildProject list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * List CodeBuildProject resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a CodeBuildProject list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Get a CodeBuildProject. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of CodeBuildProject. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a CodeBuildProject along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getByResourceGroupWithResponse(String resourceGroupName, String name, + Context context); + + /** + * Get a CodeBuildProject. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of CodeBuildProject. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a CodeBuildProject. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + CodeBuildProjectInner getByResourceGroup(String resourceGroupName, String name); + + /** + * Create a CodeBuildProject. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of CodeBuildProject. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, CodeBuildProjectInner> beginCreateOrReplace(String resourceGroupName, + String name, CodeBuildProjectInner resource); + + /** + * Create a CodeBuildProject. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of CodeBuildProject. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, CodeBuildProjectInner> beginCreateOrReplace(String resourceGroupName, + String name, CodeBuildProjectInner resource, Context context); + + /** + * Create a CodeBuildProject. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of CodeBuildProject. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + CodeBuildProjectInner createOrReplace(String resourceGroupName, String name, CodeBuildProjectInner resource); + + /** + * Create a CodeBuildProject. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of CodeBuildProject. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + CodeBuildProjectInner createOrReplace(String resourceGroupName, String name, CodeBuildProjectInner resource, + Context context); + + /** + * Update a CodeBuildProject. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of CodeBuildProject. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, CodeBuildProjectInner> beginUpdate(String resourceGroupName, + String name, CodeBuildProjectTagsUpdate properties); + + /** + * Update a CodeBuildProject. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of CodeBuildProject. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, CodeBuildProjectInner> beginUpdate(String resourceGroupName, + String name, CodeBuildProjectTagsUpdate properties, Context context); + + /** + * Update a CodeBuildProject. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of CodeBuildProject. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + CodeBuildProjectInner update(String resourceGroupName, String name, CodeBuildProjectTagsUpdate properties); + + /** + * Update a CodeBuildProject. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of CodeBuildProject. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + CodeBuildProjectInner update(String resourceGroupName, String name, CodeBuildProjectTagsUpdate properties, + Context context); + + /** + * Delete a CodeBuildProject. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of CodeBuildProject. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String name); + + /** + * Delete a CodeBuildProject. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of CodeBuildProject. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String name, Context context); + + /** + * Delete a CodeBuildProject. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of CodeBuildProject. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String name); + + /** + * Delete a CodeBuildProject. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of CodeBuildProject. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String name, Context context); +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/CodeBuildSourceCredentialsInfosClient.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/CodeBuildSourceCredentialsInfosClient.java new file mode 100644 index 000000000000..71189bdb142c --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/CodeBuildSourceCredentialsInfosClient.java @@ -0,0 +1,280 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.awsconnector.fluent.models.CodeBuildSourceCredentialsInfoInner; +import com.azure.resourcemanager.awsconnector.models.CodeBuildSourceCredentialsInfoTagsUpdate; + +/** + * An instance of this class provides access to all the operations defined in CodeBuildSourceCredentialsInfosClient. + */ +public interface CodeBuildSourceCredentialsInfosClient { + /** + * List CodeBuildSourceCredentialsInfo resources by subscription ID. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a CodeBuildSourceCredentialsInfo list operation as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * List CodeBuildSourceCredentialsInfo resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a CodeBuildSourceCredentialsInfo list operation as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(Context context); + + /** + * List CodeBuildSourceCredentialsInfo resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a CodeBuildSourceCredentialsInfo list operation as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * List CodeBuildSourceCredentialsInfo resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a CodeBuildSourceCredentialsInfo list operation as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Get a CodeBuildSourceCredentialsInfo. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of CodeBuildSourceCredentialsInfo. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a CodeBuildSourceCredentialsInfo along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getByResourceGroupWithResponse(String resourceGroupName, String name, + Context context); + + /** + * Get a CodeBuildSourceCredentialsInfo. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of CodeBuildSourceCredentialsInfo. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a CodeBuildSourceCredentialsInfo. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + CodeBuildSourceCredentialsInfoInner getByResourceGroup(String resourceGroupName, String name); + + /** + * Create a CodeBuildSourceCredentialsInfo. Please note that end user resource creation is currently restricted, but + * it will be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of CodeBuildSourceCredentialsInfo. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, CodeBuildSourceCredentialsInfoInner> + beginCreateOrReplace(String resourceGroupName, String name, CodeBuildSourceCredentialsInfoInner resource); + + /** + * Create a CodeBuildSourceCredentialsInfo. Please note that end user resource creation is currently restricted, but + * it will be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of CodeBuildSourceCredentialsInfo. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, CodeBuildSourceCredentialsInfoInner> + beginCreateOrReplace(String resourceGroupName, String name, CodeBuildSourceCredentialsInfoInner resource, + Context context); + + /** + * Create a CodeBuildSourceCredentialsInfo. Please note that end user resource creation is currently restricted, but + * it will be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of CodeBuildSourceCredentialsInfo. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + CodeBuildSourceCredentialsInfoInner createOrReplace(String resourceGroupName, String name, + CodeBuildSourceCredentialsInfoInner resource); + + /** + * Create a CodeBuildSourceCredentialsInfo. Please note that end user resource creation is currently restricted, but + * it will be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of CodeBuildSourceCredentialsInfo. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + CodeBuildSourceCredentialsInfoInner createOrReplace(String resourceGroupName, String name, + CodeBuildSourceCredentialsInfoInner resource, Context context); + + /** + * Update a CodeBuildSourceCredentialsInfo. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of CodeBuildSourceCredentialsInfo. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, CodeBuildSourceCredentialsInfoInner> + beginUpdate(String resourceGroupName, String name, CodeBuildSourceCredentialsInfoTagsUpdate properties); + + /** + * Update a CodeBuildSourceCredentialsInfo. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of CodeBuildSourceCredentialsInfo. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, CodeBuildSourceCredentialsInfoInner> beginUpdate( + String resourceGroupName, String name, CodeBuildSourceCredentialsInfoTagsUpdate properties, Context context); + + /** + * Update a CodeBuildSourceCredentialsInfo. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of CodeBuildSourceCredentialsInfo. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + CodeBuildSourceCredentialsInfoInner update(String resourceGroupName, String name, + CodeBuildSourceCredentialsInfoTagsUpdate properties); + + /** + * Update a CodeBuildSourceCredentialsInfo. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of CodeBuildSourceCredentialsInfo. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + CodeBuildSourceCredentialsInfoInner update(String resourceGroupName, String name, + CodeBuildSourceCredentialsInfoTagsUpdate properties, Context context); + + /** + * Delete a CodeBuildSourceCredentialsInfo. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of CodeBuildSourceCredentialsInfo. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String name); + + /** + * Delete a CodeBuildSourceCredentialsInfo. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of CodeBuildSourceCredentialsInfo. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String name, Context context); + + /** + * Delete a CodeBuildSourceCredentialsInfo. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of CodeBuildSourceCredentialsInfo. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String name); + + /** + * Delete a CodeBuildSourceCredentialsInfo. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of CodeBuildSourceCredentialsInfo. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String name, Context context); +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/ConfigServiceConfigurationRecorderStatusesClient.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/ConfigServiceConfigurationRecorderStatusesClient.java new file mode 100644 index 000000000000..fbd2d222c285 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/ConfigServiceConfigurationRecorderStatusesClient.java @@ -0,0 +1,285 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.awsconnector.fluent.models.ConfigServiceConfigurationRecorderStatusInner; +import com.azure.resourcemanager.awsconnector.models.ConfigServiceConfigurationRecorderStatusTagsUpdate; + +/** + * An instance of this class provides access to all the operations defined in + * ConfigServiceConfigurationRecorderStatusesClient. + */ +public interface ConfigServiceConfigurationRecorderStatusesClient { + /** + * List ConfigServiceConfigurationRecorderStatus resources by subscription ID. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a ConfigServiceConfigurationRecorderStatus list operation as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * List ConfigServiceConfigurationRecorderStatus resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a ConfigServiceConfigurationRecorderStatus list operation as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(Context context); + + /** + * List ConfigServiceConfigurationRecorderStatus resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a ConfigServiceConfigurationRecorderStatus list operation as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * List ConfigServiceConfigurationRecorderStatus resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a ConfigServiceConfigurationRecorderStatus list operation as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName, + Context context); + + /** + * Get a ConfigServiceConfigurationRecorderStatus. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ConfigServiceConfigurationRecorderStatus. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a ConfigServiceConfigurationRecorderStatus along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getByResourceGroupWithResponse(String resourceGroupName, + String name, Context context); + + /** + * Get a ConfigServiceConfigurationRecorderStatus. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ConfigServiceConfigurationRecorderStatus. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a ConfigServiceConfigurationRecorderStatus. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ConfigServiceConfigurationRecorderStatusInner getByResourceGroup(String resourceGroupName, String name); + + /** + * Create a ConfigServiceConfigurationRecorderStatus. Please note that end user resource creation is currently + * restricted, but it will be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ConfigServiceConfigurationRecorderStatus. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, ConfigServiceConfigurationRecorderStatusInner> + beginCreateOrReplace(String resourceGroupName, String name, + ConfigServiceConfigurationRecorderStatusInner resource); + + /** + * Create a ConfigServiceConfigurationRecorderStatus. Please note that end user resource creation is currently + * restricted, but it will be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ConfigServiceConfigurationRecorderStatus. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, ConfigServiceConfigurationRecorderStatusInner> + beginCreateOrReplace(String resourceGroupName, String name, + ConfigServiceConfigurationRecorderStatusInner resource, Context context); + + /** + * Create a ConfigServiceConfigurationRecorderStatus. Please note that end user resource creation is currently + * restricted, but it will be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ConfigServiceConfigurationRecorderStatus. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ConfigServiceConfigurationRecorderStatusInner createOrReplace(String resourceGroupName, String name, + ConfigServiceConfigurationRecorderStatusInner resource); + + /** + * Create a ConfigServiceConfigurationRecorderStatus. Please note that end user resource creation is currently + * restricted, but it will be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ConfigServiceConfigurationRecorderStatus. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ConfigServiceConfigurationRecorderStatusInner createOrReplace(String resourceGroupName, String name, + ConfigServiceConfigurationRecorderStatusInner resource, Context context); + + /** + * Update a ConfigServiceConfigurationRecorderStatus. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ConfigServiceConfigurationRecorderStatus. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, ConfigServiceConfigurationRecorderStatusInner> + beginUpdate(String resourceGroupName, String name, + ConfigServiceConfigurationRecorderStatusTagsUpdate properties); + + /** + * Update a ConfigServiceConfigurationRecorderStatus. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ConfigServiceConfigurationRecorderStatus. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, ConfigServiceConfigurationRecorderStatusInner> + beginUpdate(String resourceGroupName, String name, + ConfigServiceConfigurationRecorderStatusTagsUpdate properties, Context context); + + /** + * Update a ConfigServiceConfigurationRecorderStatus. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ConfigServiceConfigurationRecorderStatus. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ConfigServiceConfigurationRecorderStatusInner update(String resourceGroupName, String name, + ConfigServiceConfigurationRecorderStatusTagsUpdate properties); + + /** + * Update a ConfigServiceConfigurationRecorderStatus. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ConfigServiceConfigurationRecorderStatus. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ConfigServiceConfigurationRecorderStatusInner update(String resourceGroupName, String name, + ConfigServiceConfigurationRecorderStatusTagsUpdate properties, Context context); + + /** + * Delete a ConfigServiceConfigurationRecorderStatus. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ConfigServiceConfigurationRecorderStatus. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String name); + + /** + * Delete a ConfigServiceConfigurationRecorderStatus. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ConfigServiceConfigurationRecorderStatus. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String name, Context context); + + /** + * Delete a ConfigServiceConfigurationRecorderStatus. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ConfigServiceConfigurationRecorderStatus. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String name); + + /** + * Delete a ConfigServiceConfigurationRecorderStatus. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ConfigServiceConfigurationRecorderStatus. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String name, Context context); +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/ConfigServiceConfigurationRecordersClient.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/ConfigServiceConfigurationRecordersClient.java new file mode 100644 index 000000000000..c66c245653e4 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/ConfigServiceConfigurationRecordersClient.java @@ -0,0 +1,282 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.awsconnector.fluent.models.ConfigServiceConfigurationRecorderInner; +import com.azure.resourcemanager.awsconnector.models.ConfigServiceConfigurationRecorderTagsUpdate; + +/** + * An instance of this class provides access to all the operations defined in ConfigServiceConfigurationRecordersClient. + */ +public interface ConfigServiceConfigurationRecordersClient { + /** + * List ConfigServiceConfigurationRecorder resources by subscription ID. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a ConfigServiceConfigurationRecorder list operation as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * List ConfigServiceConfigurationRecorder resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a ConfigServiceConfigurationRecorder list operation as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(Context context); + + /** + * List ConfigServiceConfigurationRecorder resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a ConfigServiceConfigurationRecorder list operation as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * List ConfigServiceConfigurationRecorder resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a ConfigServiceConfigurationRecorder list operation as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName, + Context context); + + /** + * Get a ConfigServiceConfigurationRecorder. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ConfigServiceConfigurationRecorder. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a ConfigServiceConfigurationRecorder along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getByResourceGroupWithResponse(String resourceGroupName, + String name, Context context); + + /** + * Get a ConfigServiceConfigurationRecorder. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ConfigServiceConfigurationRecorder. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a ConfigServiceConfigurationRecorder. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ConfigServiceConfigurationRecorderInner getByResourceGroup(String resourceGroupName, String name); + + /** + * Create a ConfigServiceConfigurationRecorder. Please note that end user resource creation is currently restricted, + * but it will be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ConfigServiceConfigurationRecorder. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, ConfigServiceConfigurationRecorderInner> + beginCreateOrReplace(String resourceGroupName, String name, ConfigServiceConfigurationRecorderInner resource); + + /** + * Create a ConfigServiceConfigurationRecorder. Please note that end user resource creation is currently restricted, + * but it will be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ConfigServiceConfigurationRecorder. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, ConfigServiceConfigurationRecorderInner> + beginCreateOrReplace(String resourceGroupName, String name, ConfigServiceConfigurationRecorderInner resource, + Context context); + + /** + * Create a ConfigServiceConfigurationRecorder. Please note that end user resource creation is currently restricted, + * but it will be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ConfigServiceConfigurationRecorder. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ConfigServiceConfigurationRecorderInner createOrReplace(String resourceGroupName, String name, + ConfigServiceConfigurationRecorderInner resource); + + /** + * Create a ConfigServiceConfigurationRecorder. Please note that end user resource creation is currently restricted, + * but it will be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ConfigServiceConfigurationRecorder. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ConfigServiceConfigurationRecorderInner createOrReplace(String resourceGroupName, String name, + ConfigServiceConfigurationRecorderInner resource, Context context); + + /** + * Update a ConfigServiceConfigurationRecorder. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ConfigServiceConfigurationRecorder. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, ConfigServiceConfigurationRecorderInner> + beginUpdate(String resourceGroupName, String name, ConfigServiceConfigurationRecorderTagsUpdate properties); + + /** + * Update a ConfigServiceConfigurationRecorder. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ConfigServiceConfigurationRecorder. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, ConfigServiceConfigurationRecorderInner> + beginUpdate(String resourceGroupName, String name, ConfigServiceConfigurationRecorderTagsUpdate properties, + Context context); + + /** + * Update a ConfigServiceConfigurationRecorder. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ConfigServiceConfigurationRecorder. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ConfigServiceConfigurationRecorderInner update(String resourceGroupName, String name, + ConfigServiceConfigurationRecorderTagsUpdate properties); + + /** + * Update a ConfigServiceConfigurationRecorder. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ConfigServiceConfigurationRecorder. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ConfigServiceConfigurationRecorderInner update(String resourceGroupName, String name, + ConfigServiceConfigurationRecorderTagsUpdate properties, Context context); + + /** + * Delete a ConfigServiceConfigurationRecorder. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ConfigServiceConfigurationRecorder. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String name); + + /** + * Delete a ConfigServiceConfigurationRecorder. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ConfigServiceConfigurationRecorder. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String name, Context context); + + /** + * Delete a ConfigServiceConfigurationRecorder. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ConfigServiceConfigurationRecorder. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String name); + + /** + * Delete a ConfigServiceConfigurationRecorder. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ConfigServiceConfigurationRecorder. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String name, Context context); +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/ConfigServiceDeliveryChannelsClient.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/ConfigServiceDeliveryChannelsClient.java new file mode 100644 index 000000000000..64e83af56519 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/ConfigServiceDeliveryChannelsClient.java @@ -0,0 +1,279 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.awsconnector.fluent.models.ConfigServiceDeliveryChannelInner; +import com.azure.resourcemanager.awsconnector.models.ConfigServiceDeliveryChannelTagsUpdate; + +/** + * An instance of this class provides access to all the operations defined in ConfigServiceDeliveryChannelsClient. + */ +public interface ConfigServiceDeliveryChannelsClient { + /** + * List ConfigServiceDeliveryChannel resources by subscription ID. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a ConfigServiceDeliveryChannel list operation as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * List ConfigServiceDeliveryChannel resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a ConfigServiceDeliveryChannel list operation as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(Context context); + + /** + * List ConfigServiceDeliveryChannel resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a ConfigServiceDeliveryChannel list operation as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * List ConfigServiceDeliveryChannel resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a ConfigServiceDeliveryChannel list operation as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Get a ConfigServiceDeliveryChannel. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ConfigServiceDeliveryChannel. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a ConfigServiceDeliveryChannel along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getByResourceGroupWithResponse(String resourceGroupName, String name, + Context context); + + /** + * Get a ConfigServiceDeliveryChannel. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ConfigServiceDeliveryChannel. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a ConfigServiceDeliveryChannel. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ConfigServiceDeliveryChannelInner getByResourceGroup(String resourceGroupName, String name); + + /** + * Create a ConfigServiceDeliveryChannel. Please note that end user resource creation is currently restricted, but + * it will be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ConfigServiceDeliveryChannel. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, ConfigServiceDeliveryChannelInner> + beginCreateOrReplace(String resourceGroupName, String name, ConfigServiceDeliveryChannelInner resource); + + /** + * Create a ConfigServiceDeliveryChannel. Please note that end user resource creation is currently restricted, but + * it will be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ConfigServiceDeliveryChannel. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, ConfigServiceDeliveryChannelInner> beginCreateOrReplace( + String resourceGroupName, String name, ConfigServiceDeliveryChannelInner resource, Context context); + + /** + * Create a ConfigServiceDeliveryChannel. Please note that end user resource creation is currently restricted, but + * it will be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ConfigServiceDeliveryChannel. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ConfigServiceDeliveryChannelInner createOrReplace(String resourceGroupName, String name, + ConfigServiceDeliveryChannelInner resource); + + /** + * Create a ConfigServiceDeliveryChannel. Please note that end user resource creation is currently restricted, but + * it will be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ConfigServiceDeliveryChannel. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ConfigServiceDeliveryChannelInner createOrReplace(String resourceGroupName, String name, + ConfigServiceDeliveryChannelInner resource, Context context); + + /** + * Update a ConfigServiceDeliveryChannel. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ConfigServiceDeliveryChannel. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, ConfigServiceDeliveryChannelInner> + beginUpdate(String resourceGroupName, String name, ConfigServiceDeliveryChannelTagsUpdate properties); + + /** + * Update a ConfigServiceDeliveryChannel. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ConfigServiceDeliveryChannel. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, ConfigServiceDeliveryChannelInner> beginUpdate( + String resourceGroupName, String name, ConfigServiceDeliveryChannelTagsUpdate properties, Context context); + + /** + * Update a ConfigServiceDeliveryChannel. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ConfigServiceDeliveryChannel. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ConfigServiceDeliveryChannelInner update(String resourceGroupName, String name, + ConfigServiceDeliveryChannelTagsUpdate properties); + + /** + * Update a ConfigServiceDeliveryChannel. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ConfigServiceDeliveryChannel. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ConfigServiceDeliveryChannelInner update(String resourceGroupName, String name, + ConfigServiceDeliveryChannelTagsUpdate properties, Context context); + + /** + * Delete a ConfigServiceDeliveryChannel. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ConfigServiceDeliveryChannel. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String name); + + /** + * Delete a ConfigServiceDeliveryChannel. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ConfigServiceDeliveryChannel. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String name, Context context); + + /** + * Delete a ConfigServiceDeliveryChannel. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ConfigServiceDeliveryChannel. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String name); + + /** + * Delete a ConfigServiceDeliveryChannel. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ConfigServiceDeliveryChannel. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String name, Context context); +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/DatabaseMigrationServiceReplicationInstancesClient.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/DatabaseMigrationServiceReplicationInstancesClient.java new file mode 100644 index 000000000000..7b25a203f97a --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/DatabaseMigrationServiceReplicationInstancesClient.java @@ -0,0 +1,285 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.awsconnector.fluent.models.DatabaseMigrationServiceReplicationInstanceInner; +import com.azure.resourcemanager.awsconnector.models.DatabaseMigrationServiceReplicationInstanceTagsUpdate; + +/** + * An instance of this class provides access to all the operations defined in + * DatabaseMigrationServiceReplicationInstancesClient. + */ +public interface DatabaseMigrationServiceReplicationInstancesClient { + /** + * List DatabaseMigrationServiceReplicationInstance resources by subscription ID. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a DatabaseMigrationServiceReplicationInstance list operation as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * List DatabaseMigrationServiceReplicationInstance resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a DatabaseMigrationServiceReplicationInstance list operation as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(Context context); + + /** + * List DatabaseMigrationServiceReplicationInstance resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a DatabaseMigrationServiceReplicationInstance list operation as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * List DatabaseMigrationServiceReplicationInstance resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a DatabaseMigrationServiceReplicationInstance list operation as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName, + Context context); + + /** + * Get a DatabaseMigrationServiceReplicationInstance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of DatabaseMigrationServiceReplicationInstance. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a DatabaseMigrationServiceReplicationInstance along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getByResourceGroupWithResponse(String resourceGroupName, + String name, Context context); + + /** + * Get a DatabaseMigrationServiceReplicationInstance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of DatabaseMigrationServiceReplicationInstance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a DatabaseMigrationServiceReplicationInstance. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + DatabaseMigrationServiceReplicationInstanceInner getByResourceGroup(String resourceGroupName, String name); + + /** + * Create a DatabaseMigrationServiceReplicationInstance. Please note that end user resource creation is currently + * restricted, but it will be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of DatabaseMigrationServiceReplicationInstance. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, DatabaseMigrationServiceReplicationInstanceInner> + beginCreateOrReplace(String resourceGroupName, String name, + DatabaseMigrationServiceReplicationInstanceInner resource); + + /** + * Create a DatabaseMigrationServiceReplicationInstance. Please note that end user resource creation is currently + * restricted, but it will be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of DatabaseMigrationServiceReplicationInstance. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, DatabaseMigrationServiceReplicationInstanceInner> + beginCreateOrReplace(String resourceGroupName, String name, + DatabaseMigrationServiceReplicationInstanceInner resource, Context context); + + /** + * Create a DatabaseMigrationServiceReplicationInstance. Please note that end user resource creation is currently + * restricted, but it will be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of DatabaseMigrationServiceReplicationInstance. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + DatabaseMigrationServiceReplicationInstanceInner createOrReplace(String resourceGroupName, String name, + DatabaseMigrationServiceReplicationInstanceInner resource); + + /** + * Create a DatabaseMigrationServiceReplicationInstance. Please note that end user resource creation is currently + * restricted, but it will be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of DatabaseMigrationServiceReplicationInstance. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + DatabaseMigrationServiceReplicationInstanceInner createOrReplace(String resourceGroupName, String name, + DatabaseMigrationServiceReplicationInstanceInner resource, Context context); + + /** + * Update a DatabaseMigrationServiceReplicationInstance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of DatabaseMigrationServiceReplicationInstance. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, DatabaseMigrationServiceReplicationInstanceInner> + beginUpdate(String resourceGroupName, String name, + DatabaseMigrationServiceReplicationInstanceTagsUpdate properties); + + /** + * Update a DatabaseMigrationServiceReplicationInstance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of DatabaseMigrationServiceReplicationInstance. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, DatabaseMigrationServiceReplicationInstanceInner> + beginUpdate(String resourceGroupName, String name, + DatabaseMigrationServiceReplicationInstanceTagsUpdate properties, Context context); + + /** + * Update a DatabaseMigrationServiceReplicationInstance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of DatabaseMigrationServiceReplicationInstance. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + DatabaseMigrationServiceReplicationInstanceInner update(String resourceGroupName, String name, + DatabaseMigrationServiceReplicationInstanceTagsUpdate properties); + + /** + * Update a DatabaseMigrationServiceReplicationInstance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of DatabaseMigrationServiceReplicationInstance. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + DatabaseMigrationServiceReplicationInstanceInner update(String resourceGroupName, String name, + DatabaseMigrationServiceReplicationInstanceTagsUpdate properties, Context context); + + /** + * Delete a DatabaseMigrationServiceReplicationInstance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of DatabaseMigrationServiceReplicationInstance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String name); + + /** + * Delete a DatabaseMigrationServiceReplicationInstance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of DatabaseMigrationServiceReplicationInstance. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String name, Context context); + + /** + * Delete a DatabaseMigrationServiceReplicationInstance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of DatabaseMigrationServiceReplicationInstance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String name); + + /** + * Delete a DatabaseMigrationServiceReplicationInstance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of DatabaseMigrationServiceReplicationInstance. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String name, Context context); +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/DaxClustersClient.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/DaxClustersClient.java new file mode 100644 index 000000000000..6c067f655245 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/DaxClustersClient.java @@ -0,0 +1,270 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.awsconnector.fluent.models.DaxClusterInner; +import com.azure.resourcemanager.awsconnector.models.DaxClusterTagsUpdate; + +/** + * An instance of this class provides access to all the operations defined in DaxClustersClient. + */ +public interface DaxClustersClient { + /** + * List DaxCluster resources by subscription ID. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a DaxCluster list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * List DaxCluster resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a DaxCluster list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(Context context); + + /** + * List DaxCluster resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a DaxCluster list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * List DaxCluster resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a DaxCluster list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Get a DaxCluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of DaxCluster. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a DaxCluster along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getByResourceGroupWithResponse(String resourceGroupName, String name, Context context); + + /** + * Get a DaxCluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of DaxCluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a DaxCluster. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + DaxClusterInner getByResourceGroup(String resourceGroupName, String name); + + /** + * Create a DaxCluster. Please note that end user resource creation is currently restricted, but it will be enabled + * in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of DaxCluster. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, DaxClusterInner> beginCreateOrReplace(String resourceGroupName, String name, + DaxClusterInner resource); + + /** + * Create a DaxCluster. Please note that end user resource creation is currently restricted, but it will be enabled + * in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of DaxCluster. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, DaxClusterInner> beginCreateOrReplace(String resourceGroupName, String name, + DaxClusterInner resource, Context context); + + /** + * Create a DaxCluster. Please note that end user resource creation is currently restricted, but it will be enabled + * in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of DaxCluster. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + DaxClusterInner createOrReplace(String resourceGroupName, String name, DaxClusterInner resource); + + /** + * Create a DaxCluster. Please note that end user resource creation is currently restricted, but it will be enabled + * in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of DaxCluster. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + DaxClusterInner createOrReplace(String resourceGroupName, String name, DaxClusterInner resource, Context context); + + /** + * Update a DaxCluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of DaxCluster. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, DaxClusterInner> beginUpdate(String resourceGroupName, String name, + DaxClusterTagsUpdate properties); + + /** + * Update a DaxCluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of DaxCluster. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, DaxClusterInner> beginUpdate(String resourceGroupName, String name, + DaxClusterTagsUpdate properties, Context context); + + /** + * Update a DaxCluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of DaxCluster. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + DaxClusterInner update(String resourceGroupName, String name, DaxClusterTagsUpdate properties); + + /** + * Update a DaxCluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of DaxCluster. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + DaxClusterInner update(String resourceGroupName, String name, DaxClusterTagsUpdate properties, Context context); + + /** + * Delete a DaxCluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of DaxCluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String name); + + /** + * Delete a DaxCluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of DaxCluster. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String name, Context context); + + /** + * Delete a DaxCluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of DaxCluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String name); + + /** + * Delete a DaxCluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of DaxCluster. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String name, Context context); +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/DynamoDbContinuousBackupsDescriptionsClient.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/DynamoDbContinuousBackupsDescriptionsClient.java new file mode 100644 index 000000000000..2451b5630a43 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/DynamoDbContinuousBackupsDescriptionsClient.java @@ -0,0 +1,283 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.awsconnector.fluent.models.DynamoDBContinuousBackupsDescriptionInner; +import com.azure.resourcemanager.awsconnector.models.DynamoDBContinuousBackupsDescriptionTagsUpdate; + +/** + * An instance of this class provides access to all the operations defined in + * DynamoDbContinuousBackupsDescriptionsClient. + */ +public interface DynamoDbContinuousBackupsDescriptionsClient { + /** + * List DynamoDBContinuousBackupsDescription resources by subscription ID. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a DynamoDBContinuousBackupsDescription list operation as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * List DynamoDBContinuousBackupsDescription resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a DynamoDBContinuousBackupsDescription list operation as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(Context context); + + /** + * List DynamoDBContinuousBackupsDescription resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a DynamoDBContinuousBackupsDescription list operation as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * List DynamoDBContinuousBackupsDescription resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a DynamoDBContinuousBackupsDescription list operation as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName, + Context context); + + /** + * Get a DynamoDBContinuousBackupsDescription. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of DynamoDBContinuousBackupsDescription. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a DynamoDBContinuousBackupsDescription along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getByResourceGroupWithResponse(String resourceGroupName, + String name, Context context); + + /** + * Get a DynamoDBContinuousBackupsDescription. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of DynamoDBContinuousBackupsDescription. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a DynamoDBContinuousBackupsDescription. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + DynamoDBContinuousBackupsDescriptionInner getByResourceGroup(String resourceGroupName, String name); + + /** + * Create a DynamoDBContinuousBackupsDescription. Please note that end user resource creation is currently + * restricted, but it will be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of DynamoDBContinuousBackupsDescription. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, DynamoDBContinuousBackupsDescriptionInner> + beginCreateOrReplace(String resourceGroupName, String name, DynamoDBContinuousBackupsDescriptionInner resource); + + /** + * Create a DynamoDBContinuousBackupsDescription. Please note that end user resource creation is currently + * restricted, but it will be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of DynamoDBContinuousBackupsDescription. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, DynamoDBContinuousBackupsDescriptionInner> + beginCreateOrReplace(String resourceGroupName, String name, DynamoDBContinuousBackupsDescriptionInner resource, + Context context); + + /** + * Create a DynamoDBContinuousBackupsDescription. Please note that end user resource creation is currently + * restricted, but it will be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of DynamoDBContinuousBackupsDescription. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + DynamoDBContinuousBackupsDescriptionInner createOrReplace(String resourceGroupName, String name, + DynamoDBContinuousBackupsDescriptionInner resource); + + /** + * Create a DynamoDBContinuousBackupsDescription. Please note that end user resource creation is currently + * restricted, but it will be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of DynamoDBContinuousBackupsDescription. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + DynamoDBContinuousBackupsDescriptionInner createOrReplace(String resourceGroupName, String name, + DynamoDBContinuousBackupsDescriptionInner resource, Context context); + + /** + * Update a DynamoDBContinuousBackupsDescription. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of DynamoDBContinuousBackupsDescription. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, DynamoDBContinuousBackupsDescriptionInner> + beginUpdate(String resourceGroupName, String name, DynamoDBContinuousBackupsDescriptionTagsUpdate properties); + + /** + * Update a DynamoDBContinuousBackupsDescription. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of DynamoDBContinuousBackupsDescription. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, DynamoDBContinuousBackupsDescriptionInner> + beginUpdate(String resourceGroupName, String name, DynamoDBContinuousBackupsDescriptionTagsUpdate properties, + Context context); + + /** + * Update a DynamoDBContinuousBackupsDescription. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of DynamoDBContinuousBackupsDescription. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + DynamoDBContinuousBackupsDescriptionInner update(String resourceGroupName, String name, + DynamoDBContinuousBackupsDescriptionTagsUpdate properties); + + /** + * Update a DynamoDBContinuousBackupsDescription. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of DynamoDBContinuousBackupsDescription. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + DynamoDBContinuousBackupsDescriptionInner update(String resourceGroupName, String name, + DynamoDBContinuousBackupsDescriptionTagsUpdate properties, Context context); + + /** + * Delete a DynamoDBContinuousBackupsDescription. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of DynamoDBContinuousBackupsDescription. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String name); + + /** + * Delete a DynamoDBContinuousBackupsDescription. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of DynamoDBContinuousBackupsDescription. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String name, Context context); + + /** + * Delete a DynamoDBContinuousBackupsDescription. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of DynamoDBContinuousBackupsDescription. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String name); + + /** + * Delete a DynamoDBContinuousBackupsDescription. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of DynamoDBContinuousBackupsDescription. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String name, Context context); +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/DynamoDbTablesClient.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/DynamoDbTablesClient.java new file mode 100644 index 000000000000..b2c3bb036a53 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/DynamoDbTablesClient.java @@ -0,0 +1,272 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.awsconnector.fluent.models.DynamoDBTableInner; +import com.azure.resourcemanager.awsconnector.models.DynamoDBTableTagsUpdate; + +/** + * An instance of this class provides access to all the operations defined in DynamoDbTablesClient. + */ +public interface DynamoDbTablesClient { + /** + * List DynamoDBTable resources by subscription ID. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a DynamoDBTable list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * List DynamoDBTable resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a DynamoDBTable list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(Context context); + + /** + * List DynamoDBTable resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a DynamoDBTable list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * List DynamoDBTable resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a DynamoDBTable list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Get a DynamoDBTable. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of DynamoDBTable. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a DynamoDBTable along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getByResourceGroupWithResponse(String resourceGroupName, String name, Context context); + + /** + * Get a DynamoDBTable. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of DynamoDBTable. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a DynamoDBTable. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + DynamoDBTableInner getByResourceGroup(String resourceGroupName, String name); + + /** + * Create a DynamoDBTable. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of DynamoDBTable. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, DynamoDBTableInner> beginCreateOrReplace(String resourceGroupName, + String name, DynamoDBTableInner resource); + + /** + * Create a DynamoDBTable. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of DynamoDBTable. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, DynamoDBTableInner> beginCreateOrReplace(String resourceGroupName, + String name, DynamoDBTableInner resource, Context context); + + /** + * Create a DynamoDBTable. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of DynamoDBTable. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + DynamoDBTableInner createOrReplace(String resourceGroupName, String name, DynamoDBTableInner resource); + + /** + * Create a DynamoDBTable. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of DynamoDBTable. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + DynamoDBTableInner createOrReplace(String resourceGroupName, String name, DynamoDBTableInner resource, + Context context); + + /** + * Update a DynamoDBTable. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of DynamoDBTable. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, DynamoDBTableInner> beginUpdate(String resourceGroupName, String name, + DynamoDBTableTagsUpdate properties); + + /** + * Update a DynamoDBTable. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of DynamoDBTable. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, DynamoDBTableInner> beginUpdate(String resourceGroupName, String name, + DynamoDBTableTagsUpdate properties, Context context); + + /** + * Update a DynamoDBTable. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of DynamoDBTable. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + DynamoDBTableInner update(String resourceGroupName, String name, DynamoDBTableTagsUpdate properties); + + /** + * Update a DynamoDBTable. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of DynamoDBTable. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + DynamoDBTableInner update(String resourceGroupName, String name, DynamoDBTableTagsUpdate properties, + Context context); + + /** + * Delete a DynamoDBTable. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of DynamoDBTable. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String name); + + /** + * Delete a DynamoDBTable. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of DynamoDBTable. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String name, Context context); + + /** + * Delete a DynamoDBTable. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of DynamoDBTable. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String name); + + /** + * Delete a DynamoDBTable. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of DynamoDBTable. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String name, Context context); +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/Ec2AccountAttributesClient.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/Ec2AccountAttributesClient.java new file mode 100644 index 000000000000..343d98c5c789 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/Ec2AccountAttributesClient.java @@ -0,0 +1,273 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.awsconnector.fluent.models.Ec2AccountAttributeInner; +import com.azure.resourcemanager.awsconnector.models.Ec2AccountAttributeTagsUpdate; + +/** + * An instance of this class provides access to all the operations defined in Ec2AccountAttributesClient. + */ +public interface Ec2AccountAttributesClient { + /** + * List Ec2AccountAttribute resources by subscription ID. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Ec2AccountAttribute list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * List Ec2AccountAttribute resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Ec2AccountAttribute list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(Context context); + + /** + * List Ec2AccountAttribute resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Ec2AccountAttribute list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * List Ec2AccountAttribute resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Ec2AccountAttribute list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Get a Ec2AccountAttribute. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2AccountAttribute. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Ec2AccountAttribute along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getByResourceGroupWithResponse(String resourceGroupName, String name, + Context context); + + /** + * Get a Ec2AccountAttribute. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2AccountAttribute. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Ec2AccountAttribute. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Ec2AccountAttributeInner getByResourceGroup(String resourceGroupName, String name); + + /** + * Create a Ec2AccountAttribute. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2AccountAttribute. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Ec2AccountAttributeInner> + beginCreateOrReplace(String resourceGroupName, String name, Ec2AccountAttributeInner resource); + + /** + * Create a Ec2AccountAttribute. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2AccountAttribute. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Ec2AccountAttributeInner> + beginCreateOrReplace(String resourceGroupName, String name, Ec2AccountAttributeInner resource, Context context); + + /** + * Create a Ec2AccountAttribute. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2AccountAttribute. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Ec2AccountAttributeInner createOrReplace(String resourceGroupName, String name, Ec2AccountAttributeInner resource); + + /** + * Create a Ec2AccountAttribute. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2AccountAttribute. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Ec2AccountAttributeInner createOrReplace(String resourceGroupName, String name, Ec2AccountAttributeInner resource, + Context context); + + /** + * Update a Ec2AccountAttribute. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2AccountAttribute. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Ec2AccountAttributeInner> beginUpdate(String resourceGroupName, + String name, Ec2AccountAttributeTagsUpdate properties); + + /** + * Update a Ec2AccountAttribute. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2AccountAttribute. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Ec2AccountAttributeInner> beginUpdate(String resourceGroupName, + String name, Ec2AccountAttributeTagsUpdate properties, Context context); + + /** + * Update a Ec2AccountAttribute. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2AccountAttribute. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Ec2AccountAttributeInner update(String resourceGroupName, String name, Ec2AccountAttributeTagsUpdate properties); + + /** + * Update a Ec2AccountAttribute. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2AccountAttribute. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Ec2AccountAttributeInner update(String resourceGroupName, String name, Ec2AccountAttributeTagsUpdate properties, + Context context); + + /** + * Delete a Ec2AccountAttribute. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2AccountAttribute. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String name); + + /** + * Delete a Ec2AccountAttribute. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2AccountAttribute. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String name, Context context); + + /** + * Delete a Ec2AccountAttribute. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2AccountAttribute. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String name); + + /** + * Delete a Ec2AccountAttribute. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2AccountAttribute. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String name, Context context); +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/Ec2AddressesClient.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/Ec2AddressesClient.java new file mode 100644 index 000000000000..43ec93c58664 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/Ec2AddressesClient.java @@ -0,0 +1,270 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.awsconnector.fluent.models.Ec2AddressInner; +import com.azure.resourcemanager.awsconnector.models.Ec2AddressTagsUpdate; + +/** + * An instance of this class provides access to all the operations defined in Ec2AddressesClient. + */ +public interface Ec2AddressesClient { + /** + * List Ec2Address resources by subscription ID. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Ec2Address list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * List Ec2Address resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Ec2Address list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(Context context); + + /** + * List Ec2Address resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Ec2Address list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * List Ec2Address resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Ec2Address list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Get a Ec2Address. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2Address. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Ec2Address along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getByResourceGroupWithResponse(String resourceGroupName, String name, Context context); + + /** + * Get a Ec2Address. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2Address. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Ec2Address. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Ec2AddressInner getByResourceGroup(String resourceGroupName, String name); + + /** + * Create a Ec2Address. Please note that end user resource creation is currently restricted, but it will be enabled + * in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2Address. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Ec2AddressInner> beginCreateOrReplace(String resourceGroupName, String name, + Ec2AddressInner resource); + + /** + * Create a Ec2Address. Please note that end user resource creation is currently restricted, but it will be enabled + * in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2Address. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Ec2AddressInner> beginCreateOrReplace(String resourceGroupName, String name, + Ec2AddressInner resource, Context context); + + /** + * Create a Ec2Address. Please note that end user resource creation is currently restricted, but it will be enabled + * in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2Address. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Ec2AddressInner createOrReplace(String resourceGroupName, String name, Ec2AddressInner resource); + + /** + * Create a Ec2Address. Please note that end user resource creation is currently restricted, but it will be enabled + * in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2Address. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Ec2AddressInner createOrReplace(String resourceGroupName, String name, Ec2AddressInner resource, Context context); + + /** + * Update a Ec2Address. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2Address. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Ec2AddressInner> beginUpdate(String resourceGroupName, String name, + Ec2AddressTagsUpdate properties); + + /** + * Update a Ec2Address. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2Address. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Ec2AddressInner> beginUpdate(String resourceGroupName, String name, + Ec2AddressTagsUpdate properties, Context context); + + /** + * Update a Ec2Address. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2Address. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Ec2AddressInner update(String resourceGroupName, String name, Ec2AddressTagsUpdate properties); + + /** + * Update a Ec2Address. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2Address. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Ec2AddressInner update(String resourceGroupName, String name, Ec2AddressTagsUpdate properties, Context context); + + /** + * Delete a Ec2Address. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2Address. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String name); + + /** + * Delete a Ec2Address. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2Address. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String name, Context context); + + /** + * Delete a Ec2Address. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2Address. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String name); + + /** + * Delete a Ec2Address. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2Address. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String name, Context context); +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/Ec2FlowLogsClient.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/Ec2FlowLogsClient.java new file mode 100644 index 000000000000..83fca9328d5e --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/Ec2FlowLogsClient.java @@ -0,0 +1,270 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.awsconnector.fluent.models.Ec2FlowLogInner; +import com.azure.resourcemanager.awsconnector.models.Ec2FlowLogTagsUpdate; + +/** + * An instance of this class provides access to all the operations defined in Ec2FlowLogsClient. + */ +public interface Ec2FlowLogsClient { + /** + * List Ec2FlowLog resources by subscription ID. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Ec2FlowLog list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * List Ec2FlowLog resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Ec2FlowLog list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(Context context); + + /** + * List Ec2FlowLog resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Ec2FlowLog list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * List Ec2FlowLog resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Ec2FlowLog list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Get a Ec2FlowLog. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2FlowLog. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Ec2FlowLog along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getByResourceGroupWithResponse(String resourceGroupName, String name, Context context); + + /** + * Get a Ec2FlowLog. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2FlowLog. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Ec2FlowLog. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Ec2FlowLogInner getByResourceGroup(String resourceGroupName, String name); + + /** + * Create a Ec2FlowLog. Please note that end user resource creation is currently restricted, but it will be enabled + * in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2FlowLog. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Ec2FlowLogInner> beginCreateOrReplace(String resourceGroupName, String name, + Ec2FlowLogInner resource); + + /** + * Create a Ec2FlowLog. Please note that end user resource creation is currently restricted, but it will be enabled + * in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2FlowLog. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Ec2FlowLogInner> beginCreateOrReplace(String resourceGroupName, String name, + Ec2FlowLogInner resource, Context context); + + /** + * Create a Ec2FlowLog. Please note that end user resource creation is currently restricted, but it will be enabled + * in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2FlowLog. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Ec2FlowLogInner createOrReplace(String resourceGroupName, String name, Ec2FlowLogInner resource); + + /** + * Create a Ec2FlowLog. Please note that end user resource creation is currently restricted, but it will be enabled + * in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2FlowLog. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Ec2FlowLogInner createOrReplace(String resourceGroupName, String name, Ec2FlowLogInner resource, Context context); + + /** + * Update a Ec2FlowLog. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2FlowLog. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Ec2FlowLogInner> beginUpdate(String resourceGroupName, String name, + Ec2FlowLogTagsUpdate properties); + + /** + * Update a Ec2FlowLog. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2FlowLog. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Ec2FlowLogInner> beginUpdate(String resourceGroupName, String name, + Ec2FlowLogTagsUpdate properties, Context context); + + /** + * Update a Ec2FlowLog. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2FlowLog. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Ec2FlowLogInner update(String resourceGroupName, String name, Ec2FlowLogTagsUpdate properties); + + /** + * Update a Ec2FlowLog. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2FlowLog. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Ec2FlowLogInner update(String resourceGroupName, String name, Ec2FlowLogTagsUpdate properties, Context context); + + /** + * Delete a Ec2FlowLog. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2FlowLog. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String name); + + /** + * Delete a Ec2FlowLog. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2FlowLog. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String name, Context context); + + /** + * Delete a Ec2FlowLog. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2FlowLog. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String name); + + /** + * Delete a Ec2FlowLog. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2FlowLog. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String name, Context context); +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/Ec2ImagesClient.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/Ec2ImagesClient.java new file mode 100644 index 000000000000..418f8ebb4054 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/Ec2ImagesClient.java @@ -0,0 +1,270 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.awsconnector.fluent.models.Ec2ImageInner; +import com.azure.resourcemanager.awsconnector.models.Ec2ImageTagsUpdate; + +/** + * An instance of this class provides access to all the operations defined in Ec2ImagesClient. + */ +public interface Ec2ImagesClient { + /** + * List Ec2Image resources by subscription ID. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Ec2Image list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * List Ec2Image resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Ec2Image list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(Context context); + + /** + * List Ec2Image resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Ec2Image list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * List Ec2Image resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Ec2Image list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Get a Ec2Image. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2Image. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Ec2Image along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getByResourceGroupWithResponse(String resourceGroupName, String name, Context context); + + /** + * Get a Ec2Image. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2Image. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Ec2Image. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Ec2ImageInner getByResourceGroup(String resourceGroupName, String name); + + /** + * Create a Ec2Image. Please note that end user resource creation is currently restricted, but it will be enabled in + * the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2Image. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Ec2ImageInner> beginCreateOrReplace(String resourceGroupName, String name, + Ec2ImageInner resource); + + /** + * Create a Ec2Image. Please note that end user resource creation is currently restricted, but it will be enabled in + * the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2Image. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Ec2ImageInner> beginCreateOrReplace(String resourceGroupName, String name, + Ec2ImageInner resource, Context context); + + /** + * Create a Ec2Image. Please note that end user resource creation is currently restricted, but it will be enabled in + * the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2Image. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Ec2ImageInner createOrReplace(String resourceGroupName, String name, Ec2ImageInner resource); + + /** + * Create a Ec2Image. Please note that end user resource creation is currently restricted, but it will be enabled in + * the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2Image. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Ec2ImageInner createOrReplace(String resourceGroupName, String name, Ec2ImageInner resource, Context context); + + /** + * Update a Ec2Image. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2Image. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Ec2ImageInner> beginUpdate(String resourceGroupName, String name, + Ec2ImageTagsUpdate properties); + + /** + * Update a Ec2Image. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2Image. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Ec2ImageInner> beginUpdate(String resourceGroupName, String name, + Ec2ImageTagsUpdate properties, Context context); + + /** + * Update a Ec2Image. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2Image. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Ec2ImageInner update(String resourceGroupName, String name, Ec2ImageTagsUpdate properties); + + /** + * Update a Ec2Image. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2Image. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Ec2ImageInner update(String resourceGroupName, String name, Ec2ImageTagsUpdate properties, Context context); + + /** + * Delete a Ec2Image. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2Image. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String name); + + /** + * Delete a Ec2Image. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2Image. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String name, Context context); + + /** + * Delete a Ec2Image. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2Image. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String name); + + /** + * Delete a Ec2Image. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2Image. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String name, Context context); +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/Ec2InstanceStatusesClient.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/Ec2InstanceStatusesClient.java new file mode 100644 index 000000000000..d834eeb318e3 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/Ec2InstanceStatusesClient.java @@ -0,0 +1,273 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.awsconnector.fluent.models.Ec2InstanceStatusInner; +import com.azure.resourcemanager.awsconnector.models.Ec2InstanceStatusTagsUpdate; + +/** + * An instance of this class provides access to all the operations defined in Ec2InstanceStatusesClient. + */ +public interface Ec2InstanceStatusesClient { + /** + * List Ec2InstanceStatus resources by subscription ID. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Ec2InstanceStatus list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * List Ec2InstanceStatus resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Ec2InstanceStatus list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(Context context); + + /** + * List Ec2InstanceStatus resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Ec2InstanceStatus list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * List Ec2InstanceStatus resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Ec2InstanceStatus list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Get a Ec2InstanceStatus. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2InstanceStatus. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Ec2InstanceStatus along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getByResourceGroupWithResponse(String resourceGroupName, String name, + Context context); + + /** + * Get a Ec2InstanceStatus. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2InstanceStatus. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Ec2InstanceStatus. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Ec2InstanceStatusInner getByResourceGroup(String resourceGroupName, String name); + + /** + * Create a Ec2InstanceStatus. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2InstanceStatus. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Ec2InstanceStatusInner> + beginCreateOrReplace(String resourceGroupName, String name, Ec2InstanceStatusInner resource); + + /** + * Create a Ec2InstanceStatus. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2InstanceStatus. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Ec2InstanceStatusInner> + beginCreateOrReplace(String resourceGroupName, String name, Ec2InstanceStatusInner resource, Context context); + + /** + * Create a Ec2InstanceStatus. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2InstanceStatus. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Ec2InstanceStatusInner createOrReplace(String resourceGroupName, String name, Ec2InstanceStatusInner resource); + + /** + * Create a Ec2InstanceStatus. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2InstanceStatus. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Ec2InstanceStatusInner createOrReplace(String resourceGroupName, String name, Ec2InstanceStatusInner resource, + Context context); + + /** + * Update a Ec2InstanceStatus. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2InstanceStatus. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Ec2InstanceStatusInner> beginUpdate(String resourceGroupName, + String name, Ec2InstanceStatusTagsUpdate properties); + + /** + * Update a Ec2InstanceStatus. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2InstanceStatus. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Ec2InstanceStatusInner> beginUpdate(String resourceGroupName, + String name, Ec2InstanceStatusTagsUpdate properties, Context context); + + /** + * Update a Ec2InstanceStatus. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2InstanceStatus. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Ec2InstanceStatusInner update(String resourceGroupName, String name, Ec2InstanceStatusTagsUpdate properties); + + /** + * Update a Ec2InstanceStatus. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2InstanceStatus. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Ec2InstanceStatusInner update(String resourceGroupName, String name, Ec2InstanceStatusTagsUpdate properties, + Context context); + + /** + * Delete a Ec2InstanceStatus. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2InstanceStatus. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String name); + + /** + * Delete a Ec2InstanceStatus. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2InstanceStatus. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String name, Context context); + + /** + * Delete a Ec2InstanceStatus. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2InstanceStatus. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String name); + + /** + * Delete a Ec2InstanceStatus. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2InstanceStatus. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String name, Context context); +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/Ec2InstancesClient.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/Ec2InstancesClient.java new file mode 100644 index 000000000000..b9dbab78f7c7 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/Ec2InstancesClient.java @@ -0,0 +1,286 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.awsconnector.fluent.models.Ec2InstanceInner; +import com.azure.resourcemanager.awsconnector.fluent.models.OperationStatusResultInner; +import com.azure.resourcemanager.awsconnector.models.StopEc2InstanceOptions; + +/** + * An instance of this class provides access to all the operations defined in Ec2InstancesClient. + */ +public interface Ec2InstancesClient { + /** + * List Ec2Instance resources by parent. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Ec2Instance list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceUri); + + /** + * List Ec2Instance resources by parent. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Ec2Instance list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceUri, Context context); + + /** + * Get a Ec2Instance. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Ec2Instance along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse(String resourceUri, Context context); + + /** + * Get a Ec2Instance. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Ec2Instance. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Ec2InstanceInner get(String resourceUri); + + /** + * Create a Ec2Instance. Please note that end user resource creation is currently restricted, but it will be enabled + * in the future. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Ec2InstanceInner> beginCreateOrReplace(String resourceUri, + Ec2InstanceInner resource); + + /** + * Create a Ec2Instance. Please note that end user resource creation is currently restricted, but it will be enabled + * in the future. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Ec2InstanceInner> beginCreateOrReplace(String resourceUri, + Ec2InstanceInner resource, Context context); + + /** + * Create a Ec2Instance. Please note that end user resource creation is currently restricted, but it will be enabled + * in the future. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Ec2InstanceInner createOrReplace(String resourceUri, Ec2InstanceInner resource); + + /** + * Create a Ec2Instance. Please note that end user resource creation is currently restricted, but it will be enabled + * in the future. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Ec2InstanceInner createOrReplace(String resourceUri, Ec2InstanceInner resource, Context context); + + /** + * Delete a Ec2Instance. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceUri); + + /** + * Delete a Ec2Instance. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceUri, Context context); + + /** + * Delete a Ec2Instance. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceUri); + + /** + * Delete a Ec2Instance. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceUri, Context context); + + /** + * A long-running resource action. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of the current status of an async operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, OperationStatusResultInner> beginStart(String resourceUri); + + /** + * A long-running resource action. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of the current status of an async operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, OperationStatusResultInner> beginStart(String resourceUri, + Context context); + + /** + * A long-running resource action. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the current status of an async operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + OperationStatusResultInner start(String resourceUri); + + /** + * A long-running resource action. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the current status of an async operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + OperationStatusResultInner start(String resourceUri, Context context); + + /** + * A long-running resource action. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. + * @param body The content of the action request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of the current status of an async operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, OperationStatusResultInner> beginStop(String resourceUri, + StopEc2InstanceOptions body); + + /** + * A long-running resource action. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. + * @param body The content of the action request. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of the current status of an async operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, OperationStatusResultInner> beginStop(String resourceUri, + StopEc2InstanceOptions body, Context context); + + /** + * A long-running resource action. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. + * @param body The content of the action request. + * @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 current status of an async operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + OperationStatusResultInner stop(String resourceUri, StopEc2InstanceOptions body); + + /** + * A long-running resource action. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. + * @param body The content of the action request. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the current status of an async operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + OperationStatusResultInner stop(String resourceUri, StopEc2InstanceOptions body, Context context); +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/Ec2IpamsClient.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/Ec2IpamsClient.java new file mode 100644 index 000000000000..3f133bf36655 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/Ec2IpamsClient.java @@ -0,0 +1,270 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.awsconnector.fluent.models.Ec2IpamInner; +import com.azure.resourcemanager.awsconnector.models.Ec2IpamTagsUpdate; + +/** + * An instance of this class provides access to all the operations defined in Ec2IpamsClient. + */ +public interface Ec2IpamsClient { + /** + * List Ec2Ipam resources by subscription ID. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Ec2Ipam list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * List Ec2Ipam resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Ec2Ipam list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(Context context); + + /** + * List Ec2Ipam resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Ec2Ipam list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * List Ec2Ipam resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Ec2Ipam list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Get a Ec2Ipam. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2Ipam. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Ec2Ipam along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getByResourceGroupWithResponse(String resourceGroupName, String name, Context context); + + /** + * Get a Ec2Ipam. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2Ipam. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Ec2Ipam. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Ec2IpamInner getByResourceGroup(String resourceGroupName, String name); + + /** + * Create a Ec2Ipam. Please note that end user resource creation is currently restricted, but it will be enabled in + * the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2Ipam. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Ec2IpamInner> beginCreateOrReplace(String resourceGroupName, String name, + Ec2IpamInner resource); + + /** + * Create a Ec2Ipam. Please note that end user resource creation is currently restricted, but it will be enabled in + * the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2Ipam. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Ec2IpamInner> beginCreateOrReplace(String resourceGroupName, String name, + Ec2IpamInner resource, Context context); + + /** + * Create a Ec2Ipam. Please note that end user resource creation is currently restricted, but it will be enabled in + * the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2Ipam. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Ec2IpamInner createOrReplace(String resourceGroupName, String name, Ec2IpamInner resource); + + /** + * Create a Ec2Ipam. Please note that end user resource creation is currently restricted, but it will be enabled in + * the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2Ipam. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Ec2IpamInner createOrReplace(String resourceGroupName, String name, Ec2IpamInner resource, Context context); + + /** + * Update a Ec2Ipam. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2Ipam. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Ec2IpamInner> beginUpdate(String resourceGroupName, String name, + Ec2IpamTagsUpdate properties); + + /** + * Update a Ec2Ipam. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2Ipam. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Ec2IpamInner> beginUpdate(String resourceGroupName, String name, + Ec2IpamTagsUpdate properties, Context context); + + /** + * Update a Ec2Ipam. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2Ipam. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Ec2IpamInner update(String resourceGroupName, String name, Ec2IpamTagsUpdate properties); + + /** + * Update a Ec2Ipam. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2Ipam. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Ec2IpamInner update(String resourceGroupName, String name, Ec2IpamTagsUpdate properties, Context context); + + /** + * Delete a Ec2Ipam. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2Ipam. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String name); + + /** + * Delete a Ec2Ipam. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2Ipam. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String name, Context context); + + /** + * Delete a Ec2Ipam. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2Ipam. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String name); + + /** + * Delete a Ec2Ipam. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2Ipam. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String name, Context context); +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/Ec2KeyPairsClient.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/Ec2KeyPairsClient.java new file mode 100644 index 000000000000..30728333f953 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/Ec2KeyPairsClient.java @@ -0,0 +1,270 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.awsconnector.fluent.models.Ec2KeyPairInner; +import com.azure.resourcemanager.awsconnector.models.Ec2KeyPairTagsUpdate; + +/** + * An instance of this class provides access to all the operations defined in Ec2KeyPairsClient. + */ +public interface Ec2KeyPairsClient { + /** + * List Ec2KeyPair resources by subscription ID. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Ec2KeyPair list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * List Ec2KeyPair resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Ec2KeyPair list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(Context context); + + /** + * List Ec2KeyPair resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Ec2KeyPair list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * List Ec2KeyPair resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Ec2KeyPair list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Get a Ec2KeyPair. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2KeyPair. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Ec2KeyPair along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getByResourceGroupWithResponse(String resourceGroupName, String name, Context context); + + /** + * Get a Ec2KeyPair. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2KeyPair. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Ec2KeyPair. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Ec2KeyPairInner getByResourceGroup(String resourceGroupName, String name); + + /** + * Create a Ec2KeyPair. Please note that end user resource creation is currently restricted, but it will be enabled + * in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2KeyPair. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Ec2KeyPairInner> beginCreateOrReplace(String resourceGroupName, String name, + Ec2KeyPairInner resource); + + /** + * Create a Ec2KeyPair. Please note that end user resource creation is currently restricted, but it will be enabled + * in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2KeyPair. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Ec2KeyPairInner> beginCreateOrReplace(String resourceGroupName, String name, + Ec2KeyPairInner resource, Context context); + + /** + * Create a Ec2KeyPair. Please note that end user resource creation is currently restricted, but it will be enabled + * in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2KeyPair. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Ec2KeyPairInner createOrReplace(String resourceGroupName, String name, Ec2KeyPairInner resource); + + /** + * Create a Ec2KeyPair. Please note that end user resource creation is currently restricted, but it will be enabled + * in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2KeyPair. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Ec2KeyPairInner createOrReplace(String resourceGroupName, String name, Ec2KeyPairInner resource, Context context); + + /** + * Update a Ec2KeyPair. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2KeyPair. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Ec2KeyPairInner> beginUpdate(String resourceGroupName, String name, + Ec2KeyPairTagsUpdate properties); + + /** + * Update a Ec2KeyPair. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2KeyPair. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Ec2KeyPairInner> beginUpdate(String resourceGroupName, String name, + Ec2KeyPairTagsUpdate properties, Context context); + + /** + * Update a Ec2KeyPair. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2KeyPair. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Ec2KeyPairInner update(String resourceGroupName, String name, Ec2KeyPairTagsUpdate properties); + + /** + * Update a Ec2KeyPair. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2KeyPair. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Ec2KeyPairInner update(String resourceGroupName, String name, Ec2KeyPairTagsUpdate properties, Context context); + + /** + * Delete a Ec2KeyPair. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2KeyPair. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String name); + + /** + * Delete a Ec2KeyPair. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2KeyPair. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String name, Context context); + + /** + * Delete a Ec2KeyPair. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2KeyPair. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String name); + + /** + * Delete a Ec2KeyPair. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2KeyPair. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String name, Context context); +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/Ec2NetworkAclsClient.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/Ec2NetworkAclsClient.java new file mode 100644 index 000000000000..128478e42d2f --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/Ec2NetworkAclsClient.java @@ -0,0 +1,272 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.awsconnector.fluent.models.Ec2NetworkAclInner; +import com.azure.resourcemanager.awsconnector.models.Ec2NetworkAclTagsUpdate; + +/** + * An instance of this class provides access to all the operations defined in Ec2NetworkAclsClient. + */ +public interface Ec2NetworkAclsClient { + /** + * List Ec2NetworkAcl resources by subscription ID. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Ec2NetworkAcl list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * List Ec2NetworkAcl resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Ec2NetworkAcl list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(Context context); + + /** + * List Ec2NetworkAcl resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Ec2NetworkAcl list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * List Ec2NetworkAcl resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Ec2NetworkAcl list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Get a Ec2NetworkAcl. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2NetworkAcl. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Ec2NetworkAcl along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getByResourceGroupWithResponse(String resourceGroupName, String name, Context context); + + /** + * Get a Ec2NetworkAcl. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2NetworkAcl. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Ec2NetworkAcl. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Ec2NetworkAclInner getByResourceGroup(String resourceGroupName, String name); + + /** + * Create a Ec2NetworkAcl. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2NetworkAcl. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Ec2NetworkAclInner> beginCreateOrReplace(String resourceGroupName, + String name, Ec2NetworkAclInner resource); + + /** + * Create a Ec2NetworkAcl. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2NetworkAcl. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Ec2NetworkAclInner> beginCreateOrReplace(String resourceGroupName, + String name, Ec2NetworkAclInner resource, Context context); + + /** + * Create a Ec2NetworkAcl. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2NetworkAcl. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Ec2NetworkAclInner createOrReplace(String resourceGroupName, String name, Ec2NetworkAclInner resource); + + /** + * Create a Ec2NetworkAcl. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2NetworkAcl. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Ec2NetworkAclInner createOrReplace(String resourceGroupName, String name, Ec2NetworkAclInner resource, + Context context); + + /** + * Update a Ec2NetworkAcl. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2NetworkAcl. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Ec2NetworkAclInner> beginUpdate(String resourceGroupName, String name, + Ec2NetworkAclTagsUpdate properties); + + /** + * Update a Ec2NetworkAcl. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2NetworkAcl. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Ec2NetworkAclInner> beginUpdate(String resourceGroupName, String name, + Ec2NetworkAclTagsUpdate properties, Context context); + + /** + * Update a Ec2NetworkAcl. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2NetworkAcl. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Ec2NetworkAclInner update(String resourceGroupName, String name, Ec2NetworkAclTagsUpdate properties); + + /** + * Update a Ec2NetworkAcl. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2NetworkAcl. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Ec2NetworkAclInner update(String resourceGroupName, String name, Ec2NetworkAclTagsUpdate properties, + Context context); + + /** + * Delete a Ec2NetworkAcl. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2NetworkAcl. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String name); + + /** + * Delete a Ec2NetworkAcl. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2NetworkAcl. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String name, Context context); + + /** + * Delete a Ec2NetworkAcl. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2NetworkAcl. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String name); + + /** + * Delete a Ec2NetworkAcl. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2NetworkAcl. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String name, Context context); +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/Ec2NetworkInterfacesClient.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/Ec2NetworkInterfacesClient.java new file mode 100644 index 000000000000..ab3e7c9a7559 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/Ec2NetworkInterfacesClient.java @@ -0,0 +1,273 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.awsconnector.fluent.models.Ec2NetworkInterfaceInner; +import com.azure.resourcemanager.awsconnector.models.Ec2NetworkInterfaceTagsUpdate; + +/** + * An instance of this class provides access to all the operations defined in Ec2NetworkInterfacesClient. + */ +public interface Ec2NetworkInterfacesClient { + /** + * List Ec2NetworkInterface resources by subscription ID. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Ec2NetworkInterface list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * List Ec2NetworkInterface resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Ec2NetworkInterface list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(Context context); + + /** + * List Ec2NetworkInterface resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Ec2NetworkInterface list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * List Ec2NetworkInterface resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Ec2NetworkInterface list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Get a Ec2NetworkInterface. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2NetworkInterface. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Ec2NetworkInterface along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getByResourceGroupWithResponse(String resourceGroupName, String name, + Context context); + + /** + * Get a Ec2NetworkInterface. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2NetworkInterface. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Ec2NetworkInterface. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Ec2NetworkInterfaceInner getByResourceGroup(String resourceGroupName, String name); + + /** + * Create a Ec2NetworkInterface. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2NetworkInterface. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Ec2NetworkInterfaceInner> + beginCreateOrReplace(String resourceGroupName, String name, Ec2NetworkInterfaceInner resource); + + /** + * Create a Ec2NetworkInterface. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2NetworkInterface. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Ec2NetworkInterfaceInner> + beginCreateOrReplace(String resourceGroupName, String name, Ec2NetworkInterfaceInner resource, Context context); + + /** + * Create a Ec2NetworkInterface. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2NetworkInterface. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Ec2NetworkInterfaceInner createOrReplace(String resourceGroupName, String name, Ec2NetworkInterfaceInner resource); + + /** + * Create a Ec2NetworkInterface. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2NetworkInterface. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Ec2NetworkInterfaceInner createOrReplace(String resourceGroupName, String name, Ec2NetworkInterfaceInner resource, + Context context); + + /** + * Update a Ec2NetworkInterface. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2NetworkInterface. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Ec2NetworkInterfaceInner> beginUpdate(String resourceGroupName, + String name, Ec2NetworkInterfaceTagsUpdate properties); + + /** + * Update a Ec2NetworkInterface. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2NetworkInterface. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Ec2NetworkInterfaceInner> beginUpdate(String resourceGroupName, + String name, Ec2NetworkInterfaceTagsUpdate properties, Context context); + + /** + * Update a Ec2NetworkInterface. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2NetworkInterface. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Ec2NetworkInterfaceInner update(String resourceGroupName, String name, Ec2NetworkInterfaceTagsUpdate properties); + + /** + * Update a Ec2NetworkInterface. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2NetworkInterface. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Ec2NetworkInterfaceInner update(String resourceGroupName, String name, Ec2NetworkInterfaceTagsUpdate properties, + Context context); + + /** + * Delete a Ec2NetworkInterface. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2NetworkInterface. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String name); + + /** + * Delete a Ec2NetworkInterface. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2NetworkInterface. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String name, Context context); + + /** + * Delete a Ec2NetworkInterface. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2NetworkInterface. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String name); + + /** + * Delete a Ec2NetworkInterface. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2NetworkInterface. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String name, Context context); +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/Ec2RouteTablesClient.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/Ec2RouteTablesClient.java new file mode 100644 index 000000000000..1a3bf5a961cb --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/Ec2RouteTablesClient.java @@ -0,0 +1,272 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.awsconnector.fluent.models.Ec2RouteTableInner; +import com.azure.resourcemanager.awsconnector.models.Ec2RouteTableTagsUpdate; + +/** + * An instance of this class provides access to all the operations defined in Ec2RouteTablesClient. + */ +public interface Ec2RouteTablesClient { + /** + * List Ec2RouteTable resources by subscription ID. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Ec2RouteTable list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * List Ec2RouteTable resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Ec2RouteTable list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(Context context); + + /** + * List Ec2RouteTable resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Ec2RouteTable list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * List Ec2RouteTable resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Ec2RouteTable list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Get a Ec2RouteTable. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2RouteTable. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Ec2RouteTable along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getByResourceGroupWithResponse(String resourceGroupName, String name, Context context); + + /** + * Get a Ec2RouteTable. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2RouteTable. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Ec2RouteTable. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Ec2RouteTableInner getByResourceGroup(String resourceGroupName, String name); + + /** + * Create a Ec2RouteTable. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2RouteTable. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Ec2RouteTableInner> beginCreateOrReplace(String resourceGroupName, + String name, Ec2RouteTableInner resource); + + /** + * Create a Ec2RouteTable. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2RouteTable. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Ec2RouteTableInner> beginCreateOrReplace(String resourceGroupName, + String name, Ec2RouteTableInner resource, Context context); + + /** + * Create a Ec2RouteTable. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2RouteTable. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Ec2RouteTableInner createOrReplace(String resourceGroupName, String name, Ec2RouteTableInner resource); + + /** + * Create a Ec2RouteTable. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2RouteTable. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Ec2RouteTableInner createOrReplace(String resourceGroupName, String name, Ec2RouteTableInner resource, + Context context); + + /** + * Update a Ec2RouteTable. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2RouteTable. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Ec2RouteTableInner> beginUpdate(String resourceGroupName, String name, + Ec2RouteTableTagsUpdate properties); + + /** + * Update a Ec2RouteTable. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2RouteTable. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Ec2RouteTableInner> beginUpdate(String resourceGroupName, String name, + Ec2RouteTableTagsUpdate properties, Context context); + + /** + * Update a Ec2RouteTable. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2RouteTable. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Ec2RouteTableInner update(String resourceGroupName, String name, Ec2RouteTableTagsUpdate properties); + + /** + * Update a Ec2RouteTable. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2RouteTable. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Ec2RouteTableInner update(String resourceGroupName, String name, Ec2RouteTableTagsUpdate properties, + Context context); + + /** + * Delete a Ec2RouteTable. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2RouteTable. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String name); + + /** + * Delete a Ec2RouteTable. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2RouteTable. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String name, Context context); + + /** + * Delete a Ec2RouteTable. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2RouteTable. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String name); + + /** + * Delete a Ec2RouteTable. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2RouteTable. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String name, Context context); +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/Ec2SecurityGroupsClient.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/Ec2SecurityGroupsClient.java new file mode 100644 index 000000000000..2f7126a4cadd --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/Ec2SecurityGroupsClient.java @@ -0,0 +1,273 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.awsconnector.fluent.models.Ec2SecurityGroupInner; +import com.azure.resourcemanager.awsconnector.models.Ec2SecurityGroupTagsUpdate; + +/** + * An instance of this class provides access to all the operations defined in Ec2SecurityGroupsClient. + */ +public interface Ec2SecurityGroupsClient { + /** + * List Ec2SecurityGroup resources by subscription ID. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Ec2SecurityGroup list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * List Ec2SecurityGroup resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Ec2SecurityGroup list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(Context context); + + /** + * List Ec2SecurityGroup resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Ec2SecurityGroup list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * List Ec2SecurityGroup resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Ec2SecurityGroup list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Get a Ec2SecurityGroup. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2SecurityGroup. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Ec2SecurityGroup along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getByResourceGroupWithResponse(String resourceGroupName, String name, + Context context); + + /** + * Get a Ec2SecurityGroup. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2SecurityGroup. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Ec2SecurityGroup. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Ec2SecurityGroupInner getByResourceGroup(String resourceGroupName, String name); + + /** + * Create a Ec2SecurityGroup. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2SecurityGroup. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Ec2SecurityGroupInner> beginCreateOrReplace(String resourceGroupName, + String name, Ec2SecurityGroupInner resource); + + /** + * Create a Ec2SecurityGroup. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2SecurityGroup. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Ec2SecurityGroupInner> beginCreateOrReplace(String resourceGroupName, + String name, Ec2SecurityGroupInner resource, Context context); + + /** + * Create a Ec2SecurityGroup. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2SecurityGroup. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Ec2SecurityGroupInner createOrReplace(String resourceGroupName, String name, Ec2SecurityGroupInner resource); + + /** + * Create a Ec2SecurityGroup. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2SecurityGroup. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Ec2SecurityGroupInner createOrReplace(String resourceGroupName, String name, Ec2SecurityGroupInner resource, + Context context); + + /** + * Update a Ec2SecurityGroup. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2SecurityGroup. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Ec2SecurityGroupInner> beginUpdate(String resourceGroupName, + String name, Ec2SecurityGroupTagsUpdate properties); + + /** + * Update a Ec2SecurityGroup. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2SecurityGroup. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Ec2SecurityGroupInner> beginUpdate(String resourceGroupName, + String name, Ec2SecurityGroupTagsUpdate properties, Context context); + + /** + * Update a Ec2SecurityGroup. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2SecurityGroup. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Ec2SecurityGroupInner update(String resourceGroupName, String name, Ec2SecurityGroupTagsUpdate properties); + + /** + * Update a Ec2SecurityGroup. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2SecurityGroup. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Ec2SecurityGroupInner update(String resourceGroupName, String name, Ec2SecurityGroupTagsUpdate properties, + Context context); + + /** + * Delete a Ec2SecurityGroup. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2SecurityGroup. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String name); + + /** + * Delete a Ec2SecurityGroup. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2SecurityGroup. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String name, Context context); + + /** + * Delete a Ec2SecurityGroup. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2SecurityGroup. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String name); + + /** + * Delete a Ec2SecurityGroup. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2SecurityGroup. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String name, Context context); +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/Ec2SnapshotsClient.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/Ec2SnapshotsClient.java new file mode 100644 index 000000000000..7e887818cda1 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/Ec2SnapshotsClient.java @@ -0,0 +1,270 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.awsconnector.fluent.models.Ec2SnapshotInner; +import com.azure.resourcemanager.awsconnector.models.Ec2SnapshotTagsUpdate; + +/** + * An instance of this class provides access to all the operations defined in Ec2SnapshotsClient. + */ +public interface Ec2SnapshotsClient { + /** + * List Ec2Snapshot resources by subscription ID. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Ec2Snapshot list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * List Ec2Snapshot resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Ec2Snapshot list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(Context context); + + /** + * List Ec2Snapshot resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Ec2Snapshot list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * List Ec2Snapshot resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Ec2Snapshot list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Get a Ec2Snapshot. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2Snapshot. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Ec2Snapshot along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getByResourceGroupWithResponse(String resourceGroupName, String name, Context context); + + /** + * Get a Ec2Snapshot. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2Snapshot. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Ec2Snapshot. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Ec2SnapshotInner getByResourceGroup(String resourceGroupName, String name); + + /** + * Create a Ec2Snapshot. Please note that end user resource creation is currently restricted, but it will be enabled + * in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2Snapshot. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Ec2SnapshotInner> beginCreateOrReplace(String resourceGroupName, + String name, Ec2SnapshotInner resource); + + /** + * Create a Ec2Snapshot. Please note that end user resource creation is currently restricted, but it will be enabled + * in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2Snapshot. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Ec2SnapshotInner> beginCreateOrReplace(String resourceGroupName, + String name, Ec2SnapshotInner resource, Context context); + + /** + * Create a Ec2Snapshot. Please note that end user resource creation is currently restricted, but it will be enabled + * in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2Snapshot. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Ec2SnapshotInner createOrReplace(String resourceGroupName, String name, Ec2SnapshotInner resource); + + /** + * Create a Ec2Snapshot. Please note that end user resource creation is currently restricted, but it will be enabled + * in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2Snapshot. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Ec2SnapshotInner createOrReplace(String resourceGroupName, String name, Ec2SnapshotInner resource, Context context); + + /** + * Update a Ec2Snapshot. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2Snapshot. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Ec2SnapshotInner> beginUpdate(String resourceGroupName, String name, + Ec2SnapshotTagsUpdate properties); + + /** + * Update a Ec2Snapshot. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2Snapshot. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Ec2SnapshotInner> beginUpdate(String resourceGroupName, String name, + Ec2SnapshotTagsUpdate properties, Context context); + + /** + * Update a Ec2Snapshot. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2Snapshot. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Ec2SnapshotInner update(String resourceGroupName, String name, Ec2SnapshotTagsUpdate properties); + + /** + * Update a Ec2Snapshot. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2Snapshot. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Ec2SnapshotInner update(String resourceGroupName, String name, Ec2SnapshotTagsUpdate properties, Context context); + + /** + * Delete a Ec2Snapshot. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2Snapshot. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String name); + + /** + * Delete a Ec2Snapshot. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2Snapshot. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String name, Context context); + + /** + * Delete a Ec2Snapshot. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2Snapshot. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String name); + + /** + * Delete a Ec2Snapshot. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2Snapshot. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String name, Context context); +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/Ec2SubnetsClient.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/Ec2SubnetsClient.java new file mode 100644 index 000000000000..0fea2f18fb32 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/Ec2SubnetsClient.java @@ -0,0 +1,270 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.awsconnector.fluent.models.Ec2SubnetInner; +import com.azure.resourcemanager.awsconnector.models.Ec2SubnetTagsUpdate; + +/** + * An instance of this class provides access to all the operations defined in Ec2SubnetsClient. + */ +public interface Ec2SubnetsClient { + /** + * List Ec2Subnet resources by subscription ID. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Ec2Subnet list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * List Ec2Subnet resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Ec2Subnet list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(Context context); + + /** + * List Ec2Subnet resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Ec2Subnet list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * List Ec2Subnet resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Ec2Subnet list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Get a Ec2Subnet. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2Subnet. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Ec2Subnet along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getByResourceGroupWithResponse(String resourceGroupName, String name, Context context); + + /** + * Get a Ec2Subnet. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2Subnet. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Ec2Subnet. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Ec2SubnetInner getByResourceGroup(String resourceGroupName, String name); + + /** + * Create a Ec2Subnet. Please note that end user resource creation is currently restricted, but it will be enabled + * in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2Subnet. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Ec2SubnetInner> beginCreateOrReplace(String resourceGroupName, String name, + Ec2SubnetInner resource); + + /** + * Create a Ec2Subnet. Please note that end user resource creation is currently restricted, but it will be enabled + * in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2Subnet. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Ec2SubnetInner> beginCreateOrReplace(String resourceGroupName, String name, + Ec2SubnetInner resource, Context context); + + /** + * Create a Ec2Subnet. Please note that end user resource creation is currently restricted, but it will be enabled + * in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2Subnet. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Ec2SubnetInner createOrReplace(String resourceGroupName, String name, Ec2SubnetInner resource); + + /** + * Create a Ec2Subnet. Please note that end user resource creation is currently restricted, but it will be enabled + * in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2Subnet. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Ec2SubnetInner createOrReplace(String resourceGroupName, String name, Ec2SubnetInner resource, Context context); + + /** + * Update a Ec2Subnet. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2Subnet. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Ec2SubnetInner> beginUpdate(String resourceGroupName, String name, + Ec2SubnetTagsUpdate properties); + + /** + * Update a Ec2Subnet. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2Subnet. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Ec2SubnetInner> beginUpdate(String resourceGroupName, String name, + Ec2SubnetTagsUpdate properties, Context context); + + /** + * Update a Ec2Subnet. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2Subnet. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Ec2SubnetInner update(String resourceGroupName, String name, Ec2SubnetTagsUpdate properties); + + /** + * Update a Ec2Subnet. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2Subnet. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Ec2SubnetInner update(String resourceGroupName, String name, Ec2SubnetTagsUpdate properties, Context context); + + /** + * Delete a Ec2Subnet. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2Subnet. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String name); + + /** + * Delete a Ec2Subnet. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2Subnet. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String name, Context context); + + /** + * Delete a Ec2Subnet. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2Subnet. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String name); + + /** + * Delete a Ec2Subnet. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2Subnet. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String name, Context context); +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/Ec2VolumesClient.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/Ec2VolumesClient.java new file mode 100644 index 000000000000..aa9cb0536e73 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/Ec2VolumesClient.java @@ -0,0 +1,270 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.awsconnector.fluent.models.Ec2VolumeInner; +import com.azure.resourcemanager.awsconnector.models.Ec2VolumeTagsUpdate; + +/** + * An instance of this class provides access to all the operations defined in Ec2VolumesClient. + */ +public interface Ec2VolumesClient { + /** + * List Ec2Volume resources by subscription ID. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Ec2Volume list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * List Ec2Volume resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Ec2Volume list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(Context context); + + /** + * List Ec2Volume resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Ec2Volume list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * List Ec2Volume resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Ec2Volume list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Get a Ec2Volume. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2Volume. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Ec2Volume along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getByResourceGroupWithResponse(String resourceGroupName, String name, Context context); + + /** + * Get a Ec2Volume. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2Volume. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Ec2Volume. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Ec2VolumeInner getByResourceGroup(String resourceGroupName, String name); + + /** + * Create a Ec2Volume. Please note that end user resource creation is currently restricted, but it will be enabled + * in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2Volume. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Ec2VolumeInner> beginCreateOrReplace(String resourceGroupName, String name, + Ec2VolumeInner resource); + + /** + * Create a Ec2Volume. Please note that end user resource creation is currently restricted, but it will be enabled + * in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2Volume. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Ec2VolumeInner> beginCreateOrReplace(String resourceGroupName, String name, + Ec2VolumeInner resource, Context context); + + /** + * Create a Ec2Volume. Please note that end user resource creation is currently restricted, but it will be enabled + * in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2Volume. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Ec2VolumeInner createOrReplace(String resourceGroupName, String name, Ec2VolumeInner resource); + + /** + * Create a Ec2Volume. Please note that end user resource creation is currently restricted, but it will be enabled + * in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2Volume. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Ec2VolumeInner createOrReplace(String resourceGroupName, String name, Ec2VolumeInner resource, Context context); + + /** + * Update a Ec2Volume. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2Volume. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Ec2VolumeInner> beginUpdate(String resourceGroupName, String name, + Ec2VolumeTagsUpdate properties); + + /** + * Update a Ec2Volume. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2Volume. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Ec2VolumeInner> beginUpdate(String resourceGroupName, String name, + Ec2VolumeTagsUpdate properties, Context context); + + /** + * Update a Ec2Volume. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2Volume. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Ec2VolumeInner update(String resourceGroupName, String name, Ec2VolumeTagsUpdate properties); + + /** + * Update a Ec2Volume. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2Volume. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Ec2VolumeInner update(String resourceGroupName, String name, Ec2VolumeTagsUpdate properties, Context context); + + /** + * Delete a Ec2Volume. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2Volume. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String name); + + /** + * Delete a Ec2Volume. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2Volume. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String name, Context context); + + /** + * Delete a Ec2Volume. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2Volume. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String name); + + /** + * Delete a Ec2Volume. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2Volume. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String name, Context context); +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/Ec2VpcEndpointsClient.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/Ec2VpcEndpointsClient.java new file mode 100644 index 000000000000..a85ecc306692 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/Ec2VpcEndpointsClient.java @@ -0,0 +1,273 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.awsconnector.fluent.models.Ec2VpcEndpointInner; +import com.azure.resourcemanager.awsconnector.models.Ec2VpcEndpointTagsUpdate; + +/** + * An instance of this class provides access to all the operations defined in Ec2VpcEndpointsClient. + */ +public interface Ec2VpcEndpointsClient { + /** + * List Ec2VPCEndpoint resources by subscription ID. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Ec2VPCEndpoint list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * List Ec2VPCEndpoint resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Ec2VPCEndpoint list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(Context context); + + /** + * List Ec2VPCEndpoint resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Ec2VPCEndpoint list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * List Ec2VPCEndpoint resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Ec2VPCEndpoint list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Get a Ec2VPCEndpoint. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2VPCEndpoint. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Ec2VPCEndpoint along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getByResourceGroupWithResponse(String resourceGroupName, String name, + Context context); + + /** + * Get a Ec2VPCEndpoint. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2VPCEndpoint. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Ec2VPCEndpoint. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Ec2VpcEndpointInner getByResourceGroup(String resourceGroupName, String name); + + /** + * Create a Ec2VPCEndpoint. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2VPCEndpoint. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Ec2VpcEndpointInner> beginCreateOrReplace(String resourceGroupName, + String name, Ec2VpcEndpointInner resource); + + /** + * Create a Ec2VPCEndpoint. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2VPCEndpoint. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Ec2VpcEndpointInner> beginCreateOrReplace(String resourceGroupName, + String name, Ec2VpcEndpointInner resource, Context context); + + /** + * Create a Ec2VPCEndpoint. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2VPCEndpoint. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Ec2VpcEndpointInner createOrReplace(String resourceGroupName, String name, Ec2VpcEndpointInner resource); + + /** + * Create a Ec2VPCEndpoint. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2VPCEndpoint. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Ec2VpcEndpointInner createOrReplace(String resourceGroupName, String name, Ec2VpcEndpointInner resource, + Context context); + + /** + * Update a Ec2VPCEndpoint. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2VPCEndpoint. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Ec2VpcEndpointInner> beginUpdate(String resourceGroupName, String name, + Ec2VpcEndpointTagsUpdate properties); + + /** + * Update a Ec2VPCEndpoint. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2VPCEndpoint. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Ec2VpcEndpointInner> beginUpdate(String resourceGroupName, String name, + Ec2VpcEndpointTagsUpdate properties, Context context); + + /** + * Update a Ec2VPCEndpoint. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2VPCEndpoint. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Ec2VpcEndpointInner update(String resourceGroupName, String name, Ec2VpcEndpointTagsUpdate properties); + + /** + * Update a Ec2VPCEndpoint. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2VPCEndpoint. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Ec2VpcEndpointInner update(String resourceGroupName, String name, Ec2VpcEndpointTagsUpdate properties, + Context context); + + /** + * Delete a Ec2VPCEndpoint. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2VPCEndpoint. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String name); + + /** + * Delete a Ec2VPCEndpoint. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2VPCEndpoint. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String name, Context context); + + /** + * Delete a Ec2VPCEndpoint. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2VPCEndpoint. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String name); + + /** + * Delete a Ec2VPCEndpoint. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2VPCEndpoint. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String name, Context context); +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/Ec2VpcPeeringConnectionsClient.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/Ec2VpcPeeringConnectionsClient.java new file mode 100644 index 000000000000..fc216bd9fdef --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/Ec2VpcPeeringConnectionsClient.java @@ -0,0 +1,279 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.awsconnector.fluent.models.Ec2VpcPeeringConnectionInner; +import com.azure.resourcemanager.awsconnector.models.Ec2VpcPeeringConnectionTagsUpdate; + +/** + * An instance of this class provides access to all the operations defined in Ec2VpcPeeringConnectionsClient. + */ +public interface Ec2VpcPeeringConnectionsClient { + /** + * List Ec2VPCPeeringConnection resources by subscription ID. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Ec2VPCPeeringConnection list operation as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * List Ec2VPCPeeringConnection resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Ec2VPCPeeringConnection list operation as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(Context context); + + /** + * List Ec2VPCPeeringConnection resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Ec2VPCPeeringConnection list operation as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * List Ec2VPCPeeringConnection resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Ec2VPCPeeringConnection list operation as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Get a Ec2VPCPeeringConnection. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2VPCPeeringConnection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Ec2VPCPeeringConnection along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getByResourceGroupWithResponse(String resourceGroupName, String name, + Context context); + + /** + * Get a Ec2VPCPeeringConnection. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2VPCPeeringConnection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Ec2VPCPeeringConnection. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Ec2VpcPeeringConnectionInner getByResourceGroup(String resourceGroupName, String name); + + /** + * Create a Ec2VPCPeeringConnection. Please note that end user resource creation is currently restricted, but it + * will be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2VPCPeeringConnection. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Ec2VpcPeeringConnectionInner> + beginCreateOrReplace(String resourceGroupName, String name, Ec2VpcPeeringConnectionInner resource); + + /** + * Create a Ec2VPCPeeringConnection. Please note that end user resource creation is currently restricted, but it + * will be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2VPCPeeringConnection. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Ec2VpcPeeringConnectionInner> beginCreateOrReplace( + String resourceGroupName, String name, Ec2VpcPeeringConnectionInner resource, Context context); + + /** + * Create a Ec2VPCPeeringConnection. Please note that end user resource creation is currently restricted, but it + * will be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2VPCPeeringConnection. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Ec2VpcPeeringConnectionInner createOrReplace(String resourceGroupName, String name, + Ec2VpcPeeringConnectionInner resource); + + /** + * Create a Ec2VPCPeeringConnection. Please note that end user resource creation is currently restricted, but it + * will be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2VPCPeeringConnection. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Ec2VpcPeeringConnectionInner createOrReplace(String resourceGroupName, String name, + Ec2VpcPeeringConnectionInner resource, Context context); + + /** + * Update a Ec2VPCPeeringConnection. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2VPCPeeringConnection. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Ec2VpcPeeringConnectionInner> + beginUpdate(String resourceGroupName, String name, Ec2VpcPeeringConnectionTagsUpdate properties); + + /** + * Update a Ec2VPCPeeringConnection. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2VPCPeeringConnection. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Ec2VpcPeeringConnectionInner> beginUpdate( + String resourceGroupName, String name, Ec2VpcPeeringConnectionTagsUpdate properties, Context context); + + /** + * Update a Ec2VPCPeeringConnection. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2VPCPeeringConnection. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Ec2VpcPeeringConnectionInner update(String resourceGroupName, String name, + Ec2VpcPeeringConnectionTagsUpdate properties); + + /** + * Update a Ec2VPCPeeringConnection. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2VPCPeeringConnection. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Ec2VpcPeeringConnectionInner update(String resourceGroupName, String name, + Ec2VpcPeeringConnectionTagsUpdate properties, Context context); + + /** + * Delete a Ec2VPCPeeringConnection. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2VPCPeeringConnection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String name); + + /** + * Delete a Ec2VPCPeeringConnection. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2VPCPeeringConnection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String name, Context context); + + /** + * Delete a Ec2VPCPeeringConnection. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2VPCPeeringConnection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String name); + + /** + * Delete a Ec2VPCPeeringConnection. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2VPCPeeringConnection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String name, Context context); +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/Ec2VpcsClient.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/Ec2VpcsClient.java new file mode 100644 index 000000000000..372c4e84ed36 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/Ec2VpcsClient.java @@ -0,0 +1,270 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.awsconnector.fluent.models.Ec2VpcInner; +import com.azure.resourcemanager.awsconnector.models.Ec2VpcTagsUpdate; + +/** + * An instance of this class provides access to all the operations defined in Ec2VpcsClient. + */ +public interface Ec2VpcsClient { + /** + * List Ec2Vpc resources by subscription ID. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Ec2Vpc list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * List Ec2Vpc resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Ec2Vpc list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(Context context); + + /** + * List Ec2Vpc resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Ec2Vpc list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * List Ec2Vpc resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Ec2Vpc list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Get a Ec2Vpc. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2Vpc. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Ec2Vpc along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getByResourceGroupWithResponse(String resourceGroupName, String name, Context context); + + /** + * Get a Ec2Vpc. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2Vpc. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Ec2Vpc. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Ec2VpcInner getByResourceGroup(String resourceGroupName, String name); + + /** + * Create a Ec2Vpc. Please note that end user resource creation is currently restricted, but it will be enabled in + * the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2Vpc. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Ec2VpcInner> beginCreateOrReplace(String resourceGroupName, String name, + Ec2VpcInner resource); + + /** + * Create a Ec2Vpc. Please note that end user resource creation is currently restricted, but it will be enabled in + * the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2Vpc. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Ec2VpcInner> beginCreateOrReplace(String resourceGroupName, String name, + Ec2VpcInner resource, Context context); + + /** + * Create a Ec2Vpc. Please note that end user resource creation is currently restricted, but it will be enabled in + * the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2Vpc. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Ec2VpcInner createOrReplace(String resourceGroupName, String name, Ec2VpcInner resource); + + /** + * Create a Ec2Vpc. Please note that end user resource creation is currently restricted, but it will be enabled in + * the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2Vpc. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Ec2VpcInner createOrReplace(String resourceGroupName, String name, Ec2VpcInner resource, Context context); + + /** + * Update a Ec2Vpc. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2Vpc. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Ec2VpcInner> beginUpdate(String resourceGroupName, String name, + Ec2VpcTagsUpdate properties); + + /** + * Update a Ec2Vpc. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2Vpc. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Ec2VpcInner> beginUpdate(String resourceGroupName, String name, + Ec2VpcTagsUpdate properties, Context context); + + /** + * Update a Ec2Vpc. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2Vpc. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Ec2VpcInner update(String resourceGroupName, String name, Ec2VpcTagsUpdate properties); + + /** + * Update a Ec2Vpc. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2Vpc. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Ec2VpcInner update(String resourceGroupName, String name, Ec2VpcTagsUpdate properties, Context context); + + /** + * Delete a Ec2Vpc. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2Vpc. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String name); + + /** + * Delete a Ec2Vpc. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2Vpc. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String name, Context context); + + /** + * Delete a Ec2Vpc. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2Vpc. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String name); + + /** + * Delete a Ec2Vpc. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2Vpc. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String name, Context context); +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/EcrImageDetailsClient.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/EcrImageDetailsClient.java new file mode 100644 index 000000000000..1ecbb04d4abd --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/EcrImageDetailsClient.java @@ -0,0 +1,273 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.awsconnector.fluent.models.EcrImageDetailInner; +import com.azure.resourcemanager.awsconnector.models.EcrImageDetailTagsUpdate; + +/** + * An instance of this class provides access to all the operations defined in EcrImageDetailsClient. + */ +public interface EcrImageDetailsClient { + /** + * List EcrImageDetail resources by subscription ID. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a EcrImageDetail list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * List EcrImageDetail resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a EcrImageDetail list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(Context context); + + /** + * List EcrImageDetail resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a EcrImageDetail list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * List EcrImageDetail resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a EcrImageDetail list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Get a EcrImageDetail. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of EcrImageDetail. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a EcrImageDetail along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getByResourceGroupWithResponse(String resourceGroupName, String name, + Context context); + + /** + * Get a EcrImageDetail. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of EcrImageDetail. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a EcrImageDetail. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + EcrImageDetailInner getByResourceGroup(String resourceGroupName, String name); + + /** + * Create a EcrImageDetail. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of EcrImageDetail. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, EcrImageDetailInner> beginCreateOrReplace(String resourceGroupName, + String name, EcrImageDetailInner resource); + + /** + * Create a EcrImageDetail. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of EcrImageDetail. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, EcrImageDetailInner> beginCreateOrReplace(String resourceGroupName, + String name, EcrImageDetailInner resource, Context context); + + /** + * Create a EcrImageDetail. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of EcrImageDetail. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + EcrImageDetailInner createOrReplace(String resourceGroupName, String name, EcrImageDetailInner resource); + + /** + * Create a EcrImageDetail. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of EcrImageDetail. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + EcrImageDetailInner createOrReplace(String resourceGroupName, String name, EcrImageDetailInner resource, + Context context); + + /** + * Update a EcrImageDetail. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of EcrImageDetail. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, EcrImageDetailInner> beginUpdate(String resourceGroupName, String name, + EcrImageDetailTagsUpdate properties); + + /** + * Update a EcrImageDetail. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of EcrImageDetail. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, EcrImageDetailInner> beginUpdate(String resourceGroupName, String name, + EcrImageDetailTagsUpdate properties, Context context); + + /** + * Update a EcrImageDetail. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of EcrImageDetail. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + EcrImageDetailInner update(String resourceGroupName, String name, EcrImageDetailTagsUpdate properties); + + /** + * Update a EcrImageDetail. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of EcrImageDetail. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + EcrImageDetailInner update(String resourceGroupName, String name, EcrImageDetailTagsUpdate properties, + Context context); + + /** + * Delete a EcrImageDetail. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of EcrImageDetail. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String name); + + /** + * Delete a EcrImageDetail. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of EcrImageDetail. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String name, Context context); + + /** + * Delete a EcrImageDetail. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of EcrImageDetail. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String name); + + /** + * Delete a EcrImageDetail. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of EcrImageDetail. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String name, Context context); +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/EcrRepositoriesClient.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/EcrRepositoriesClient.java new file mode 100644 index 000000000000..6b382da2aa21 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/EcrRepositoriesClient.java @@ -0,0 +1,272 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.awsconnector.fluent.models.EcrRepositoryInner; +import com.azure.resourcemanager.awsconnector.models.EcrRepositoryTagsUpdate; + +/** + * An instance of this class provides access to all the operations defined in EcrRepositoriesClient. + */ +public interface EcrRepositoriesClient { + /** + * List EcrRepository resources by subscription ID. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a EcrRepository list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * List EcrRepository resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a EcrRepository list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(Context context); + + /** + * List EcrRepository resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a EcrRepository list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * List EcrRepository resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a EcrRepository list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Get a EcrRepository. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of EcrRepository. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a EcrRepository along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getByResourceGroupWithResponse(String resourceGroupName, String name, Context context); + + /** + * Get a EcrRepository. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of EcrRepository. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a EcrRepository. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + EcrRepositoryInner getByResourceGroup(String resourceGroupName, String name); + + /** + * Create a EcrRepository. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of EcrRepository. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, EcrRepositoryInner> beginCreateOrReplace(String resourceGroupName, + String name, EcrRepositoryInner resource); + + /** + * Create a EcrRepository. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of EcrRepository. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, EcrRepositoryInner> beginCreateOrReplace(String resourceGroupName, + String name, EcrRepositoryInner resource, Context context); + + /** + * Create a EcrRepository. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of EcrRepository. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + EcrRepositoryInner createOrReplace(String resourceGroupName, String name, EcrRepositoryInner resource); + + /** + * Create a EcrRepository. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of EcrRepository. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + EcrRepositoryInner createOrReplace(String resourceGroupName, String name, EcrRepositoryInner resource, + Context context); + + /** + * Update a EcrRepository. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of EcrRepository. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, EcrRepositoryInner> beginUpdate(String resourceGroupName, String name, + EcrRepositoryTagsUpdate properties); + + /** + * Update a EcrRepository. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of EcrRepository. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, EcrRepositoryInner> beginUpdate(String resourceGroupName, String name, + EcrRepositoryTagsUpdate properties, Context context); + + /** + * Update a EcrRepository. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of EcrRepository. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + EcrRepositoryInner update(String resourceGroupName, String name, EcrRepositoryTagsUpdate properties); + + /** + * Update a EcrRepository. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of EcrRepository. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + EcrRepositoryInner update(String resourceGroupName, String name, EcrRepositoryTagsUpdate properties, + Context context); + + /** + * Delete a EcrRepository. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of EcrRepository. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String name); + + /** + * Delete a EcrRepository. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of EcrRepository. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String name, Context context); + + /** + * Delete a EcrRepository. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of EcrRepository. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String name); + + /** + * Delete a EcrRepository. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of EcrRepository. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String name, Context context); +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/EcsClustersClient.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/EcsClustersClient.java new file mode 100644 index 000000000000..6a12c6daeb23 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/EcsClustersClient.java @@ -0,0 +1,270 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.awsconnector.fluent.models.EcsClusterInner; +import com.azure.resourcemanager.awsconnector.models.EcsClusterTagsUpdate; + +/** + * An instance of this class provides access to all the operations defined in EcsClustersClient. + */ +public interface EcsClustersClient { + /** + * List EcsCluster resources by subscription ID. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a EcsCluster list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * List EcsCluster resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a EcsCluster list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(Context context); + + /** + * List EcsCluster resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a EcsCluster list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * List EcsCluster resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a EcsCluster list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Get a EcsCluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of EcsCluster. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a EcsCluster along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getByResourceGroupWithResponse(String resourceGroupName, String name, Context context); + + /** + * Get a EcsCluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of EcsCluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a EcsCluster. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + EcsClusterInner getByResourceGroup(String resourceGroupName, String name); + + /** + * Create a EcsCluster. Please note that end user resource creation is currently restricted, but it will be enabled + * in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of EcsCluster. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, EcsClusterInner> beginCreateOrReplace(String resourceGroupName, String name, + EcsClusterInner resource); + + /** + * Create a EcsCluster. Please note that end user resource creation is currently restricted, but it will be enabled + * in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of EcsCluster. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, EcsClusterInner> beginCreateOrReplace(String resourceGroupName, String name, + EcsClusterInner resource, Context context); + + /** + * Create a EcsCluster. Please note that end user resource creation is currently restricted, but it will be enabled + * in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of EcsCluster. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + EcsClusterInner createOrReplace(String resourceGroupName, String name, EcsClusterInner resource); + + /** + * Create a EcsCluster. Please note that end user resource creation is currently restricted, but it will be enabled + * in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of EcsCluster. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + EcsClusterInner createOrReplace(String resourceGroupName, String name, EcsClusterInner resource, Context context); + + /** + * Update a EcsCluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of EcsCluster. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, EcsClusterInner> beginUpdate(String resourceGroupName, String name, + EcsClusterTagsUpdate properties); + + /** + * Update a EcsCluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of EcsCluster. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, EcsClusterInner> beginUpdate(String resourceGroupName, String name, + EcsClusterTagsUpdate properties, Context context); + + /** + * Update a EcsCluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of EcsCluster. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + EcsClusterInner update(String resourceGroupName, String name, EcsClusterTagsUpdate properties); + + /** + * Update a EcsCluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of EcsCluster. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + EcsClusterInner update(String resourceGroupName, String name, EcsClusterTagsUpdate properties, Context context); + + /** + * Delete a EcsCluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of EcsCluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String name); + + /** + * Delete a EcsCluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of EcsCluster. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String name, Context context); + + /** + * Delete a EcsCluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of EcsCluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String name); + + /** + * Delete a EcsCluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of EcsCluster. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String name, Context context); +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/EcsServicesClient.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/EcsServicesClient.java new file mode 100644 index 000000000000..74863532d37f --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/EcsServicesClient.java @@ -0,0 +1,270 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.awsconnector.fluent.models.EcsServiceInner; +import com.azure.resourcemanager.awsconnector.models.EcsServiceTagsUpdate; + +/** + * An instance of this class provides access to all the operations defined in EcsServicesClient. + */ +public interface EcsServicesClient { + /** + * List EcsService resources by subscription ID. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a EcsService list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * List EcsService resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a EcsService list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(Context context); + + /** + * List EcsService resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a EcsService list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * List EcsService resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a EcsService list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Get a EcsService. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of EcsService. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a EcsService along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getByResourceGroupWithResponse(String resourceGroupName, String name, Context context); + + /** + * Get a EcsService. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of EcsService. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a EcsService. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + EcsServiceInner getByResourceGroup(String resourceGroupName, String name); + + /** + * Create a EcsService. Please note that end user resource creation is currently restricted, but it will be enabled + * in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of EcsService. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, EcsServiceInner> beginCreateOrReplace(String resourceGroupName, String name, + EcsServiceInner resource); + + /** + * Create a EcsService. Please note that end user resource creation is currently restricted, but it will be enabled + * in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of EcsService. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, EcsServiceInner> beginCreateOrReplace(String resourceGroupName, String name, + EcsServiceInner resource, Context context); + + /** + * Create a EcsService. Please note that end user resource creation is currently restricted, but it will be enabled + * in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of EcsService. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + EcsServiceInner createOrReplace(String resourceGroupName, String name, EcsServiceInner resource); + + /** + * Create a EcsService. Please note that end user resource creation is currently restricted, but it will be enabled + * in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of EcsService. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + EcsServiceInner createOrReplace(String resourceGroupName, String name, EcsServiceInner resource, Context context); + + /** + * Update a EcsService. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of EcsService. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, EcsServiceInner> beginUpdate(String resourceGroupName, String name, + EcsServiceTagsUpdate properties); + + /** + * Update a EcsService. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of EcsService. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, EcsServiceInner> beginUpdate(String resourceGroupName, String name, + EcsServiceTagsUpdate properties, Context context); + + /** + * Update a EcsService. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of EcsService. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + EcsServiceInner update(String resourceGroupName, String name, EcsServiceTagsUpdate properties); + + /** + * Update a EcsService. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of EcsService. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + EcsServiceInner update(String resourceGroupName, String name, EcsServiceTagsUpdate properties, Context context); + + /** + * Delete a EcsService. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of EcsService. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String name); + + /** + * Delete a EcsService. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of EcsService. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String name, Context context); + + /** + * Delete a EcsService. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of EcsService. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String name); + + /** + * Delete a EcsService. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of EcsService. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String name, Context context); +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/EcsTaskDefinitionsClient.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/EcsTaskDefinitionsClient.java new file mode 100644 index 000000000000..8e520ff9624a --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/EcsTaskDefinitionsClient.java @@ -0,0 +1,273 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.awsconnector.fluent.models.EcsTaskDefinitionInner; +import com.azure.resourcemanager.awsconnector.models.EcsTaskDefinitionTagsUpdate; + +/** + * An instance of this class provides access to all the operations defined in EcsTaskDefinitionsClient. + */ +public interface EcsTaskDefinitionsClient { + /** + * List EcsTaskDefinition resources by subscription ID. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a EcsTaskDefinition list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * List EcsTaskDefinition resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a EcsTaskDefinition list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(Context context); + + /** + * List EcsTaskDefinition resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a EcsTaskDefinition list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * List EcsTaskDefinition resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a EcsTaskDefinition list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Get a EcsTaskDefinition. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of EcsTaskDefinition. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a EcsTaskDefinition along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getByResourceGroupWithResponse(String resourceGroupName, String name, + Context context); + + /** + * Get a EcsTaskDefinition. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of EcsTaskDefinition. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a EcsTaskDefinition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + EcsTaskDefinitionInner getByResourceGroup(String resourceGroupName, String name); + + /** + * Create a EcsTaskDefinition. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of EcsTaskDefinition. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, EcsTaskDefinitionInner> + beginCreateOrReplace(String resourceGroupName, String name, EcsTaskDefinitionInner resource); + + /** + * Create a EcsTaskDefinition. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of EcsTaskDefinition. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, EcsTaskDefinitionInner> + beginCreateOrReplace(String resourceGroupName, String name, EcsTaskDefinitionInner resource, Context context); + + /** + * Create a EcsTaskDefinition. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of EcsTaskDefinition. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + EcsTaskDefinitionInner createOrReplace(String resourceGroupName, String name, EcsTaskDefinitionInner resource); + + /** + * Create a EcsTaskDefinition. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of EcsTaskDefinition. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + EcsTaskDefinitionInner createOrReplace(String resourceGroupName, String name, EcsTaskDefinitionInner resource, + Context context); + + /** + * Update a EcsTaskDefinition. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of EcsTaskDefinition. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, EcsTaskDefinitionInner> beginUpdate(String resourceGroupName, + String name, EcsTaskDefinitionTagsUpdate properties); + + /** + * Update a EcsTaskDefinition. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of EcsTaskDefinition. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, EcsTaskDefinitionInner> beginUpdate(String resourceGroupName, + String name, EcsTaskDefinitionTagsUpdate properties, Context context); + + /** + * Update a EcsTaskDefinition. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of EcsTaskDefinition. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + EcsTaskDefinitionInner update(String resourceGroupName, String name, EcsTaskDefinitionTagsUpdate properties); + + /** + * Update a EcsTaskDefinition. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of EcsTaskDefinition. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + EcsTaskDefinitionInner update(String resourceGroupName, String name, EcsTaskDefinitionTagsUpdate properties, + Context context); + + /** + * Delete a EcsTaskDefinition. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of EcsTaskDefinition. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String name); + + /** + * Delete a EcsTaskDefinition. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of EcsTaskDefinition. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String name, Context context); + + /** + * Delete a EcsTaskDefinition. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of EcsTaskDefinition. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String name); + + /** + * Delete a EcsTaskDefinition. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of EcsTaskDefinition. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String name, Context context); +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/EfsFileSystemsClient.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/EfsFileSystemsClient.java new file mode 100644 index 000000000000..e5eb534423d6 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/EfsFileSystemsClient.java @@ -0,0 +1,272 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.awsconnector.fluent.models.EfsFileSystemInner; +import com.azure.resourcemanager.awsconnector.models.EfsFileSystemTagsUpdate; + +/** + * An instance of this class provides access to all the operations defined in EfsFileSystemsClient. + */ +public interface EfsFileSystemsClient { + /** + * List EfsFileSystem resources by subscription ID. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a EfsFileSystem list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * List EfsFileSystem resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a EfsFileSystem list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(Context context); + + /** + * List EfsFileSystem resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a EfsFileSystem list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * List EfsFileSystem resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a EfsFileSystem list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Get a EfsFileSystem. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of EfsFileSystem. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a EfsFileSystem along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getByResourceGroupWithResponse(String resourceGroupName, String name, Context context); + + /** + * Get a EfsFileSystem. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of EfsFileSystem. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a EfsFileSystem. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + EfsFileSystemInner getByResourceGroup(String resourceGroupName, String name); + + /** + * Create a EfsFileSystem. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of EfsFileSystem. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, EfsFileSystemInner> beginCreateOrReplace(String resourceGroupName, + String name, EfsFileSystemInner resource); + + /** + * Create a EfsFileSystem. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of EfsFileSystem. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, EfsFileSystemInner> beginCreateOrReplace(String resourceGroupName, + String name, EfsFileSystemInner resource, Context context); + + /** + * Create a EfsFileSystem. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of EfsFileSystem. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + EfsFileSystemInner createOrReplace(String resourceGroupName, String name, EfsFileSystemInner resource); + + /** + * Create a EfsFileSystem. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of EfsFileSystem. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + EfsFileSystemInner createOrReplace(String resourceGroupName, String name, EfsFileSystemInner resource, + Context context); + + /** + * Update a EfsFileSystem. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of EfsFileSystem. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, EfsFileSystemInner> beginUpdate(String resourceGroupName, String name, + EfsFileSystemTagsUpdate properties); + + /** + * Update a EfsFileSystem. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of EfsFileSystem. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, EfsFileSystemInner> beginUpdate(String resourceGroupName, String name, + EfsFileSystemTagsUpdate properties, Context context); + + /** + * Update a EfsFileSystem. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of EfsFileSystem. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + EfsFileSystemInner update(String resourceGroupName, String name, EfsFileSystemTagsUpdate properties); + + /** + * Update a EfsFileSystem. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of EfsFileSystem. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + EfsFileSystemInner update(String resourceGroupName, String name, EfsFileSystemTagsUpdate properties, + Context context); + + /** + * Delete a EfsFileSystem. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of EfsFileSystem. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String name); + + /** + * Delete a EfsFileSystem. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of EfsFileSystem. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String name, Context context); + + /** + * Delete a EfsFileSystem. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of EfsFileSystem. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String name); + + /** + * Delete a EfsFileSystem. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of EfsFileSystem. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String name, Context context); +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/EfsMountTargetsClient.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/EfsMountTargetsClient.java new file mode 100644 index 000000000000..65f292547aef --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/EfsMountTargetsClient.java @@ -0,0 +1,273 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.awsconnector.fluent.models.EfsMountTargetInner; +import com.azure.resourcemanager.awsconnector.models.EfsMountTargetTagsUpdate; + +/** + * An instance of this class provides access to all the operations defined in EfsMountTargetsClient. + */ +public interface EfsMountTargetsClient { + /** + * List EfsMountTarget resources by subscription ID. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a EfsMountTarget list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * List EfsMountTarget resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a EfsMountTarget list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(Context context); + + /** + * List EfsMountTarget resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a EfsMountTarget list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * List EfsMountTarget resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a EfsMountTarget list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Get a EfsMountTarget. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of EfsMountTarget. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a EfsMountTarget along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getByResourceGroupWithResponse(String resourceGroupName, String name, + Context context); + + /** + * Get a EfsMountTarget. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of EfsMountTarget. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a EfsMountTarget. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + EfsMountTargetInner getByResourceGroup(String resourceGroupName, String name); + + /** + * Create a EfsMountTarget. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of EfsMountTarget. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, EfsMountTargetInner> beginCreateOrReplace(String resourceGroupName, + String name, EfsMountTargetInner resource); + + /** + * Create a EfsMountTarget. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of EfsMountTarget. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, EfsMountTargetInner> beginCreateOrReplace(String resourceGroupName, + String name, EfsMountTargetInner resource, Context context); + + /** + * Create a EfsMountTarget. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of EfsMountTarget. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + EfsMountTargetInner createOrReplace(String resourceGroupName, String name, EfsMountTargetInner resource); + + /** + * Create a EfsMountTarget. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of EfsMountTarget. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + EfsMountTargetInner createOrReplace(String resourceGroupName, String name, EfsMountTargetInner resource, + Context context); + + /** + * Update a EfsMountTarget. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of EfsMountTarget. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, EfsMountTargetInner> beginUpdate(String resourceGroupName, String name, + EfsMountTargetTagsUpdate properties); + + /** + * Update a EfsMountTarget. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of EfsMountTarget. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, EfsMountTargetInner> beginUpdate(String resourceGroupName, String name, + EfsMountTargetTagsUpdate properties, Context context); + + /** + * Update a EfsMountTarget. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of EfsMountTarget. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + EfsMountTargetInner update(String resourceGroupName, String name, EfsMountTargetTagsUpdate properties); + + /** + * Update a EfsMountTarget. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of EfsMountTarget. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + EfsMountTargetInner update(String resourceGroupName, String name, EfsMountTargetTagsUpdate properties, + Context context); + + /** + * Delete a EfsMountTarget. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of EfsMountTarget. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String name); + + /** + * Delete a EfsMountTarget. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of EfsMountTarget. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String name, Context context); + + /** + * Delete a EfsMountTarget. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of EfsMountTarget. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String name); + + /** + * Delete a EfsMountTarget. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of EfsMountTarget. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String name, Context context); +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/EksClustersClient.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/EksClustersClient.java new file mode 100644 index 000000000000..c4f081987053 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/EksClustersClient.java @@ -0,0 +1,177 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.awsconnector.fluent.models.EksClusterInner; + +/** + * An instance of this class provides access to all the operations defined in EksClustersClient. + */ +public interface EksClustersClient { + /** + * List EksCluster resources by parent. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a EksCluster list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceUri); + + /** + * List EksCluster resources by parent. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a EksCluster list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceUri, Context context); + + /** + * Get a EksCluster. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a EksCluster along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse(String resourceUri, Context context); + + /** + * Get a EksCluster. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a EksCluster. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + EksClusterInner get(String resourceUri); + + /** + * Create a EksCluster. Please note that end user resource creation is currently restricted, but it will be enabled + * in the future. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, EksClusterInner> beginCreateOrReplace(String resourceUri, + EksClusterInner resource); + + /** + * Create a EksCluster. Please note that end user resource creation is currently restricted, but it will be enabled + * in the future. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, EksClusterInner> beginCreateOrReplace(String resourceUri, + EksClusterInner resource, Context context); + + /** + * Create a EksCluster. Please note that end user resource creation is currently restricted, but it will be enabled + * in the future. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + EksClusterInner createOrReplace(String resourceUri, EksClusterInner resource); + + /** + * Create a EksCluster. Please note that end user resource creation is currently restricted, but it will be enabled + * in the future. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + EksClusterInner createOrReplace(String resourceUri, EksClusterInner resource, Context context); + + /** + * Delete a EksCluster. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceUri); + + /** + * Delete a EksCluster. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceUri, Context context); + + /** + * Delete a EksCluster. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceUri); + + /** + * Delete a EksCluster. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceUri, Context context); +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/EksNodegroupsClient.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/EksNodegroupsClient.java new file mode 100644 index 000000000000..281d321e4d1b --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/EksNodegroupsClient.java @@ -0,0 +1,271 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.awsconnector.fluent.models.EksNodegroupInner; +import com.azure.resourcemanager.awsconnector.models.EksNodegroupTagsUpdate; + +/** + * An instance of this class provides access to all the operations defined in EksNodegroupsClient. + */ +public interface EksNodegroupsClient { + /** + * List EksNodegroup resources by subscription ID. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a EksNodegroup list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * List EksNodegroup resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a EksNodegroup list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(Context context); + + /** + * List EksNodegroup resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a EksNodegroup list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * List EksNodegroup resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a EksNodegroup list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Get a EksNodegroup. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of EksNodegroup. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a EksNodegroup along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getByResourceGroupWithResponse(String resourceGroupName, String name, Context context); + + /** + * Get a EksNodegroup. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of EksNodegroup. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a EksNodegroup. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + EksNodegroupInner getByResourceGroup(String resourceGroupName, String name); + + /** + * Create a EksNodegroup. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of EksNodegroup. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, EksNodegroupInner> beginCreateOrReplace(String resourceGroupName, + String name, EksNodegroupInner resource); + + /** + * Create a EksNodegroup. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of EksNodegroup. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, EksNodegroupInner> beginCreateOrReplace(String resourceGroupName, + String name, EksNodegroupInner resource, Context context); + + /** + * Create a EksNodegroup. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of EksNodegroup. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + EksNodegroupInner createOrReplace(String resourceGroupName, String name, EksNodegroupInner resource); + + /** + * Create a EksNodegroup. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of EksNodegroup. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + EksNodegroupInner createOrReplace(String resourceGroupName, String name, EksNodegroupInner resource, + Context context); + + /** + * Update a EksNodegroup. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of EksNodegroup. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, EksNodegroupInner> beginUpdate(String resourceGroupName, String name, + EksNodegroupTagsUpdate properties); + + /** + * Update a EksNodegroup. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of EksNodegroup. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, EksNodegroupInner> beginUpdate(String resourceGroupName, String name, + EksNodegroupTagsUpdate properties, Context context); + + /** + * Update a EksNodegroup. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of EksNodegroup. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + EksNodegroupInner update(String resourceGroupName, String name, EksNodegroupTagsUpdate properties); + + /** + * Update a EksNodegroup. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of EksNodegroup. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + EksNodegroupInner update(String resourceGroupName, String name, EksNodegroupTagsUpdate properties, Context context); + + /** + * Delete a EksNodegroup. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of EksNodegroup. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String name); + + /** + * Delete a EksNodegroup. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of EksNodegroup. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String name, Context context); + + /** + * Delete a EksNodegroup. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of EksNodegroup. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String name); + + /** + * Delete a EksNodegroup. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of EksNodegroup. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String name, Context context); +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/ElasticBeanstalkApplicationsClient.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/ElasticBeanstalkApplicationsClient.java new file mode 100644 index 000000000000..9fdea924ae9d --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/ElasticBeanstalkApplicationsClient.java @@ -0,0 +1,279 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.awsconnector.fluent.models.ElasticBeanstalkApplicationInner; +import com.azure.resourcemanager.awsconnector.models.ElasticBeanstalkApplicationTagsUpdate; + +/** + * An instance of this class provides access to all the operations defined in ElasticBeanstalkApplicationsClient. + */ +public interface ElasticBeanstalkApplicationsClient { + /** + * List ElasticBeanstalkApplication resources by subscription ID. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a ElasticBeanstalkApplication list operation as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * List ElasticBeanstalkApplication resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a ElasticBeanstalkApplication list operation as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(Context context); + + /** + * List ElasticBeanstalkApplication resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a ElasticBeanstalkApplication list operation as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * List ElasticBeanstalkApplication resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a ElasticBeanstalkApplication list operation as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Get a ElasticBeanstalkApplication. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ElasticBeanstalkApplication. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a ElasticBeanstalkApplication along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getByResourceGroupWithResponse(String resourceGroupName, String name, + Context context); + + /** + * Get a ElasticBeanstalkApplication. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ElasticBeanstalkApplication. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a ElasticBeanstalkApplication. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ElasticBeanstalkApplicationInner getByResourceGroup(String resourceGroupName, String name); + + /** + * Create a ElasticBeanstalkApplication. Please note that end user resource creation is currently restricted, but it + * will be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ElasticBeanstalkApplication. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, ElasticBeanstalkApplicationInner> + beginCreateOrReplace(String resourceGroupName, String name, ElasticBeanstalkApplicationInner resource); + + /** + * Create a ElasticBeanstalkApplication. Please note that end user resource creation is currently restricted, but it + * will be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ElasticBeanstalkApplication. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, ElasticBeanstalkApplicationInner> beginCreateOrReplace( + String resourceGroupName, String name, ElasticBeanstalkApplicationInner resource, Context context); + + /** + * Create a ElasticBeanstalkApplication. Please note that end user resource creation is currently restricted, but it + * will be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ElasticBeanstalkApplication. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ElasticBeanstalkApplicationInner createOrReplace(String resourceGroupName, String name, + ElasticBeanstalkApplicationInner resource); + + /** + * Create a ElasticBeanstalkApplication. Please note that end user resource creation is currently restricted, but it + * will be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ElasticBeanstalkApplication. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ElasticBeanstalkApplicationInner createOrReplace(String resourceGroupName, String name, + ElasticBeanstalkApplicationInner resource, Context context); + + /** + * Update a ElasticBeanstalkApplication. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ElasticBeanstalkApplication. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, ElasticBeanstalkApplicationInner> + beginUpdate(String resourceGroupName, String name, ElasticBeanstalkApplicationTagsUpdate properties); + + /** + * Update a ElasticBeanstalkApplication. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ElasticBeanstalkApplication. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, ElasticBeanstalkApplicationInner> beginUpdate( + String resourceGroupName, String name, ElasticBeanstalkApplicationTagsUpdate properties, Context context); + + /** + * Update a ElasticBeanstalkApplication. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ElasticBeanstalkApplication. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ElasticBeanstalkApplicationInner update(String resourceGroupName, String name, + ElasticBeanstalkApplicationTagsUpdate properties); + + /** + * Update a ElasticBeanstalkApplication. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ElasticBeanstalkApplication. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ElasticBeanstalkApplicationInner update(String resourceGroupName, String name, + ElasticBeanstalkApplicationTagsUpdate properties, Context context); + + /** + * Delete a ElasticBeanstalkApplication. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ElasticBeanstalkApplication. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String name); + + /** + * Delete a ElasticBeanstalkApplication. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ElasticBeanstalkApplication. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String name, Context context); + + /** + * Delete a ElasticBeanstalkApplication. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ElasticBeanstalkApplication. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String name); + + /** + * Delete a ElasticBeanstalkApplication. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ElasticBeanstalkApplication. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String name, Context context); +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/ElasticBeanstalkConfigurationTemplatesClient.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/ElasticBeanstalkConfigurationTemplatesClient.java new file mode 100644 index 000000000000..5c05fe99d270 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/ElasticBeanstalkConfigurationTemplatesClient.java @@ -0,0 +1,284 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.awsconnector.fluent.models.ElasticBeanstalkConfigurationTemplateInner; +import com.azure.resourcemanager.awsconnector.models.ElasticBeanstalkConfigurationTemplateTagsUpdate; + +/** + * An instance of this class provides access to all the operations defined in + * ElasticBeanstalkConfigurationTemplatesClient. + */ +public interface ElasticBeanstalkConfigurationTemplatesClient { + /** + * List ElasticBeanstalkConfigurationTemplate resources by subscription ID. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a ElasticBeanstalkConfigurationTemplate list operation as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * List ElasticBeanstalkConfigurationTemplate resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a ElasticBeanstalkConfigurationTemplate list operation as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(Context context); + + /** + * List ElasticBeanstalkConfigurationTemplate resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a ElasticBeanstalkConfigurationTemplate list operation as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * List ElasticBeanstalkConfigurationTemplate resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a ElasticBeanstalkConfigurationTemplate list operation as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName, + Context context); + + /** + * Get a ElasticBeanstalkConfigurationTemplate. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ElasticBeanstalkConfigurationTemplate. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a ElasticBeanstalkConfigurationTemplate along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getByResourceGroupWithResponse(String resourceGroupName, + String name, Context context); + + /** + * Get a ElasticBeanstalkConfigurationTemplate. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ElasticBeanstalkConfigurationTemplate. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a ElasticBeanstalkConfigurationTemplate. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ElasticBeanstalkConfigurationTemplateInner getByResourceGroup(String resourceGroupName, String name); + + /** + * Create a ElasticBeanstalkConfigurationTemplate. Please note that end user resource creation is currently + * restricted, but it will be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ElasticBeanstalkConfigurationTemplate. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, ElasticBeanstalkConfigurationTemplateInner> + beginCreateOrReplace(String resourceGroupName, String name, + ElasticBeanstalkConfigurationTemplateInner resource); + + /** + * Create a ElasticBeanstalkConfigurationTemplate. Please note that end user resource creation is currently + * restricted, but it will be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ElasticBeanstalkConfigurationTemplate. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, ElasticBeanstalkConfigurationTemplateInner> + beginCreateOrReplace(String resourceGroupName, String name, ElasticBeanstalkConfigurationTemplateInner resource, + Context context); + + /** + * Create a ElasticBeanstalkConfigurationTemplate. Please note that end user resource creation is currently + * restricted, but it will be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ElasticBeanstalkConfigurationTemplate. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ElasticBeanstalkConfigurationTemplateInner createOrReplace(String resourceGroupName, String name, + ElasticBeanstalkConfigurationTemplateInner resource); + + /** + * Create a ElasticBeanstalkConfigurationTemplate. Please note that end user resource creation is currently + * restricted, but it will be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ElasticBeanstalkConfigurationTemplate. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ElasticBeanstalkConfigurationTemplateInner createOrReplace(String resourceGroupName, String name, + ElasticBeanstalkConfigurationTemplateInner resource, Context context); + + /** + * Update a ElasticBeanstalkConfigurationTemplate. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ElasticBeanstalkConfigurationTemplate. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, ElasticBeanstalkConfigurationTemplateInner> + beginUpdate(String resourceGroupName, String name, ElasticBeanstalkConfigurationTemplateTagsUpdate properties); + + /** + * Update a ElasticBeanstalkConfigurationTemplate. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ElasticBeanstalkConfigurationTemplate. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, ElasticBeanstalkConfigurationTemplateInner> + beginUpdate(String resourceGroupName, String name, ElasticBeanstalkConfigurationTemplateTagsUpdate properties, + Context context); + + /** + * Update a ElasticBeanstalkConfigurationTemplate. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ElasticBeanstalkConfigurationTemplate. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ElasticBeanstalkConfigurationTemplateInner update(String resourceGroupName, String name, + ElasticBeanstalkConfigurationTemplateTagsUpdate properties); + + /** + * Update a ElasticBeanstalkConfigurationTemplate. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ElasticBeanstalkConfigurationTemplate. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ElasticBeanstalkConfigurationTemplateInner update(String resourceGroupName, String name, + ElasticBeanstalkConfigurationTemplateTagsUpdate properties, Context context); + + /** + * Delete a ElasticBeanstalkConfigurationTemplate. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ElasticBeanstalkConfigurationTemplate. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String name); + + /** + * Delete a ElasticBeanstalkConfigurationTemplate. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ElasticBeanstalkConfigurationTemplate. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String name, Context context); + + /** + * Delete a ElasticBeanstalkConfigurationTemplate. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ElasticBeanstalkConfigurationTemplate. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String name); + + /** + * Delete a ElasticBeanstalkConfigurationTemplate. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ElasticBeanstalkConfigurationTemplate. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String name, Context context); +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/ElasticBeanstalkEnvironmentsClient.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/ElasticBeanstalkEnvironmentsClient.java new file mode 100644 index 000000000000..989455f3f708 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/ElasticBeanstalkEnvironmentsClient.java @@ -0,0 +1,279 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.awsconnector.fluent.models.ElasticBeanstalkEnvironmentInner; +import com.azure.resourcemanager.awsconnector.models.ElasticBeanstalkEnvironmentTagsUpdate; + +/** + * An instance of this class provides access to all the operations defined in ElasticBeanstalkEnvironmentsClient. + */ +public interface ElasticBeanstalkEnvironmentsClient { + /** + * List ElasticBeanstalkEnvironment resources by subscription ID. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a ElasticBeanstalkEnvironment list operation as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * List ElasticBeanstalkEnvironment resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a ElasticBeanstalkEnvironment list operation as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(Context context); + + /** + * List ElasticBeanstalkEnvironment resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a ElasticBeanstalkEnvironment list operation as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * List ElasticBeanstalkEnvironment resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a ElasticBeanstalkEnvironment list operation as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Get a ElasticBeanstalkEnvironment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ElasticBeanstalkEnvironment. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a ElasticBeanstalkEnvironment along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getByResourceGroupWithResponse(String resourceGroupName, String name, + Context context); + + /** + * Get a ElasticBeanstalkEnvironment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ElasticBeanstalkEnvironment. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a ElasticBeanstalkEnvironment. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ElasticBeanstalkEnvironmentInner getByResourceGroup(String resourceGroupName, String name); + + /** + * Create a ElasticBeanstalkEnvironment. Please note that end user resource creation is currently restricted, but it + * will be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ElasticBeanstalkEnvironment. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, ElasticBeanstalkEnvironmentInner> + beginCreateOrReplace(String resourceGroupName, String name, ElasticBeanstalkEnvironmentInner resource); + + /** + * Create a ElasticBeanstalkEnvironment. Please note that end user resource creation is currently restricted, but it + * will be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ElasticBeanstalkEnvironment. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, ElasticBeanstalkEnvironmentInner> beginCreateOrReplace( + String resourceGroupName, String name, ElasticBeanstalkEnvironmentInner resource, Context context); + + /** + * Create a ElasticBeanstalkEnvironment. Please note that end user resource creation is currently restricted, but it + * will be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ElasticBeanstalkEnvironment. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ElasticBeanstalkEnvironmentInner createOrReplace(String resourceGroupName, String name, + ElasticBeanstalkEnvironmentInner resource); + + /** + * Create a ElasticBeanstalkEnvironment. Please note that end user resource creation is currently restricted, but it + * will be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ElasticBeanstalkEnvironment. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ElasticBeanstalkEnvironmentInner createOrReplace(String resourceGroupName, String name, + ElasticBeanstalkEnvironmentInner resource, Context context); + + /** + * Update a ElasticBeanstalkEnvironment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ElasticBeanstalkEnvironment. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, ElasticBeanstalkEnvironmentInner> + beginUpdate(String resourceGroupName, String name, ElasticBeanstalkEnvironmentTagsUpdate properties); + + /** + * Update a ElasticBeanstalkEnvironment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ElasticBeanstalkEnvironment. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, ElasticBeanstalkEnvironmentInner> beginUpdate( + String resourceGroupName, String name, ElasticBeanstalkEnvironmentTagsUpdate properties, Context context); + + /** + * Update a ElasticBeanstalkEnvironment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ElasticBeanstalkEnvironment. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ElasticBeanstalkEnvironmentInner update(String resourceGroupName, String name, + ElasticBeanstalkEnvironmentTagsUpdate properties); + + /** + * Update a ElasticBeanstalkEnvironment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ElasticBeanstalkEnvironment. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ElasticBeanstalkEnvironmentInner update(String resourceGroupName, String name, + ElasticBeanstalkEnvironmentTagsUpdate properties, Context context); + + /** + * Delete a ElasticBeanstalkEnvironment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ElasticBeanstalkEnvironment. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String name); + + /** + * Delete a ElasticBeanstalkEnvironment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ElasticBeanstalkEnvironment. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String name, Context context); + + /** + * Delete a ElasticBeanstalkEnvironment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ElasticBeanstalkEnvironment. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String name); + + /** + * Delete a ElasticBeanstalkEnvironment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ElasticBeanstalkEnvironment. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String name, Context context); +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/ElasticLoadBalancingV2ListenersClient.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/ElasticLoadBalancingV2ListenersClient.java new file mode 100644 index 000000000000..6633ababca5a --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/ElasticLoadBalancingV2ListenersClient.java @@ -0,0 +1,280 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.awsconnector.fluent.models.ElasticLoadBalancingV2ListenerInner; +import com.azure.resourcemanager.awsconnector.models.ElasticLoadBalancingV2ListenerTagsUpdate; + +/** + * An instance of this class provides access to all the operations defined in ElasticLoadBalancingV2ListenersClient. + */ +public interface ElasticLoadBalancingV2ListenersClient { + /** + * List ElasticLoadBalancingV2Listener resources by subscription ID. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a ElasticLoadBalancingV2Listener list operation as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * List ElasticLoadBalancingV2Listener resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a ElasticLoadBalancingV2Listener list operation as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(Context context); + + /** + * List ElasticLoadBalancingV2Listener resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a ElasticLoadBalancingV2Listener list operation as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * List ElasticLoadBalancingV2Listener resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a ElasticLoadBalancingV2Listener list operation as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Get a ElasticLoadBalancingV2Listener. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ElasticLoadBalancingV2Listener. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a ElasticLoadBalancingV2Listener along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getByResourceGroupWithResponse(String resourceGroupName, String name, + Context context); + + /** + * Get a ElasticLoadBalancingV2Listener. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ElasticLoadBalancingV2Listener. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a ElasticLoadBalancingV2Listener. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ElasticLoadBalancingV2ListenerInner getByResourceGroup(String resourceGroupName, String name); + + /** + * Create a ElasticLoadBalancingV2Listener. Please note that end user resource creation is currently restricted, but + * it will be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ElasticLoadBalancingV2Listener. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, ElasticLoadBalancingV2ListenerInner> + beginCreateOrReplace(String resourceGroupName, String name, ElasticLoadBalancingV2ListenerInner resource); + + /** + * Create a ElasticLoadBalancingV2Listener. Please note that end user resource creation is currently restricted, but + * it will be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ElasticLoadBalancingV2Listener. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, ElasticLoadBalancingV2ListenerInner> + beginCreateOrReplace(String resourceGroupName, String name, ElasticLoadBalancingV2ListenerInner resource, + Context context); + + /** + * Create a ElasticLoadBalancingV2Listener. Please note that end user resource creation is currently restricted, but + * it will be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ElasticLoadBalancingV2Listener. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ElasticLoadBalancingV2ListenerInner createOrReplace(String resourceGroupName, String name, + ElasticLoadBalancingV2ListenerInner resource); + + /** + * Create a ElasticLoadBalancingV2Listener. Please note that end user resource creation is currently restricted, but + * it will be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ElasticLoadBalancingV2Listener. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ElasticLoadBalancingV2ListenerInner createOrReplace(String resourceGroupName, String name, + ElasticLoadBalancingV2ListenerInner resource, Context context); + + /** + * Update a ElasticLoadBalancingV2Listener. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ElasticLoadBalancingV2Listener. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, ElasticLoadBalancingV2ListenerInner> + beginUpdate(String resourceGroupName, String name, ElasticLoadBalancingV2ListenerTagsUpdate properties); + + /** + * Update a ElasticLoadBalancingV2Listener. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ElasticLoadBalancingV2Listener. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, ElasticLoadBalancingV2ListenerInner> beginUpdate( + String resourceGroupName, String name, ElasticLoadBalancingV2ListenerTagsUpdate properties, Context context); + + /** + * Update a ElasticLoadBalancingV2Listener. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ElasticLoadBalancingV2Listener. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ElasticLoadBalancingV2ListenerInner update(String resourceGroupName, String name, + ElasticLoadBalancingV2ListenerTagsUpdate properties); + + /** + * Update a ElasticLoadBalancingV2Listener. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ElasticLoadBalancingV2Listener. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ElasticLoadBalancingV2ListenerInner update(String resourceGroupName, String name, + ElasticLoadBalancingV2ListenerTagsUpdate properties, Context context); + + /** + * Delete a ElasticLoadBalancingV2Listener. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ElasticLoadBalancingV2Listener. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String name); + + /** + * Delete a ElasticLoadBalancingV2Listener. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ElasticLoadBalancingV2Listener. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String name, Context context); + + /** + * Delete a ElasticLoadBalancingV2Listener. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ElasticLoadBalancingV2Listener. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String name); + + /** + * Delete a ElasticLoadBalancingV2Listener. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ElasticLoadBalancingV2Listener. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String name, Context context); +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/ElasticLoadBalancingV2LoadBalancersClient.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/ElasticLoadBalancingV2LoadBalancersClient.java new file mode 100644 index 000000000000..eda0f4590f34 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/ElasticLoadBalancingV2LoadBalancersClient.java @@ -0,0 +1,282 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.awsconnector.fluent.models.ElasticLoadBalancingV2LoadBalancerInner; +import com.azure.resourcemanager.awsconnector.models.ElasticLoadBalancingV2LoadBalancerTagsUpdate; + +/** + * An instance of this class provides access to all the operations defined in ElasticLoadBalancingV2LoadBalancersClient. + */ +public interface ElasticLoadBalancingV2LoadBalancersClient { + /** + * List ElasticLoadBalancingV2LoadBalancer resources by subscription ID. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a ElasticLoadBalancingV2LoadBalancer list operation as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * List ElasticLoadBalancingV2LoadBalancer resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a ElasticLoadBalancingV2LoadBalancer list operation as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(Context context); + + /** + * List ElasticLoadBalancingV2LoadBalancer resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a ElasticLoadBalancingV2LoadBalancer list operation as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * List ElasticLoadBalancingV2LoadBalancer resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a ElasticLoadBalancingV2LoadBalancer list operation as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName, + Context context); + + /** + * Get a ElasticLoadBalancingV2LoadBalancer. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ElasticLoadBalancingV2LoadBalancer. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a ElasticLoadBalancingV2LoadBalancer along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getByResourceGroupWithResponse(String resourceGroupName, + String name, Context context); + + /** + * Get a ElasticLoadBalancingV2LoadBalancer. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ElasticLoadBalancingV2LoadBalancer. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a ElasticLoadBalancingV2LoadBalancer. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ElasticLoadBalancingV2LoadBalancerInner getByResourceGroup(String resourceGroupName, String name); + + /** + * Create a ElasticLoadBalancingV2LoadBalancer. Please note that end user resource creation is currently restricted, + * but it will be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ElasticLoadBalancingV2LoadBalancer. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, ElasticLoadBalancingV2LoadBalancerInner> + beginCreateOrReplace(String resourceGroupName, String name, ElasticLoadBalancingV2LoadBalancerInner resource); + + /** + * Create a ElasticLoadBalancingV2LoadBalancer. Please note that end user resource creation is currently restricted, + * but it will be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ElasticLoadBalancingV2LoadBalancer. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, ElasticLoadBalancingV2LoadBalancerInner> + beginCreateOrReplace(String resourceGroupName, String name, ElasticLoadBalancingV2LoadBalancerInner resource, + Context context); + + /** + * Create a ElasticLoadBalancingV2LoadBalancer. Please note that end user resource creation is currently restricted, + * but it will be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ElasticLoadBalancingV2LoadBalancer. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ElasticLoadBalancingV2LoadBalancerInner createOrReplace(String resourceGroupName, String name, + ElasticLoadBalancingV2LoadBalancerInner resource); + + /** + * Create a ElasticLoadBalancingV2LoadBalancer. Please note that end user resource creation is currently restricted, + * but it will be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ElasticLoadBalancingV2LoadBalancer. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ElasticLoadBalancingV2LoadBalancerInner createOrReplace(String resourceGroupName, String name, + ElasticLoadBalancingV2LoadBalancerInner resource, Context context); + + /** + * Update a ElasticLoadBalancingV2LoadBalancer. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ElasticLoadBalancingV2LoadBalancer. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, ElasticLoadBalancingV2LoadBalancerInner> + beginUpdate(String resourceGroupName, String name, ElasticLoadBalancingV2LoadBalancerTagsUpdate properties); + + /** + * Update a ElasticLoadBalancingV2LoadBalancer. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ElasticLoadBalancingV2LoadBalancer. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, ElasticLoadBalancingV2LoadBalancerInner> + beginUpdate(String resourceGroupName, String name, ElasticLoadBalancingV2LoadBalancerTagsUpdate properties, + Context context); + + /** + * Update a ElasticLoadBalancingV2LoadBalancer. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ElasticLoadBalancingV2LoadBalancer. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ElasticLoadBalancingV2LoadBalancerInner update(String resourceGroupName, String name, + ElasticLoadBalancingV2LoadBalancerTagsUpdate properties); + + /** + * Update a ElasticLoadBalancingV2LoadBalancer. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ElasticLoadBalancingV2LoadBalancer. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ElasticLoadBalancingV2LoadBalancerInner update(String resourceGroupName, String name, + ElasticLoadBalancingV2LoadBalancerTagsUpdate properties, Context context); + + /** + * Delete a ElasticLoadBalancingV2LoadBalancer. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ElasticLoadBalancingV2LoadBalancer. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String name); + + /** + * Delete a ElasticLoadBalancingV2LoadBalancer. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ElasticLoadBalancingV2LoadBalancer. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String name, Context context); + + /** + * Delete a ElasticLoadBalancingV2LoadBalancer. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ElasticLoadBalancingV2LoadBalancer. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String name); + + /** + * Delete a ElasticLoadBalancingV2LoadBalancer. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ElasticLoadBalancingV2LoadBalancer. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String name, Context context); +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/ElasticLoadBalancingV2TargetGroupsClient.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/ElasticLoadBalancingV2TargetGroupsClient.java new file mode 100644 index 000000000000..20fd3aa0efcb --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/ElasticLoadBalancingV2TargetGroupsClient.java @@ -0,0 +1,281 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.awsconnector.fluent.models.ElasticLoadBalancingV2TargetGroupInner; +import com.azure.resourcemanager.awsconnector.models.ElasticLoadBalancingV2TargetGroupTagsUpdate; + +/** + * An instance of this class provides access to all the operations defined in ElasticLoadBalancingV2TargetGroupsClient. + */ +public interface ElasticLoadBalancingV2TargetGroupsClient { + /** + * List ElasticLoadBalancingV2TargetGroup resources by subscription ID. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a ElasticLoadBalancingV2TargetGroup list operation as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * List ElasticLoadBalancingV2TargetGroup resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a ElasticLoadBalancingV2TargetGroup list operation as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(Context context); + + /** + * List ElasticLoadBalancingV2TargetGroup resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a ElasticLoadBalancingV2TargetGroup list operation as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * List ElasticLoadBalancingV2TargetGroup resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a ElasticLoadBalancingV2TargetGroup list operation as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName, + Context context); + + /** + * Get a ElasticLoadBalancingV2TargetGroup. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ElasticLoadBalancingV2TargetGroup. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a ElasticLoadBalancingV2TargetGroup along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getByResourceGroupWithResponse(String resourceGroupName, + String name, Context context); + + /** + * Get a ElasticLoadBalancingV2TargetGroup. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ElasticLoadBalancingV2TargetGroup. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a ElasticLoadBalancingV2TargetGroup. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ElasticLoadBalancingV2TargetGroupInner getByResourceGroup(String resourceGroupName, String name); + + /** + * Create a ElasticLoadBalancingV2TargetGroup. Please note that end user resource creation is currently restricted, + * but it will be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ElasticLoadBalancingV2TargetGroup. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, ElasticLoadBalancingV2TargetGroupInner> + beginCreateOrReplace(String resourceGroupName, String name, ElasticLoadBalancingV2TargetGroupInner resource); + + /** + * Create a ElasticLoadBalancingV2TargetGroup. Please note that end user resource creation is currently restricted, + * but it will be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ElasticLoadBalancingV2TargetGroup. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, ElasticLoadBalancingV2TargetGroupInner> + beginCreateOrReplace(String resourceGroupName, String name, ElasticLoadBalancingV2TargetGroupInner resource, + Context context); + + /** + * Create a ElasticLoadBalancingV2TargetGroup. Please note that end user resource creation is currently restricted, + * but it will be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ElasticLoadBalancingV2TargetGroup. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ElasticLoadBalancingV2TargetGroupInner createOrReplace(String resourceGroupName, String name, + ElasticLoadBalancingV2TargetGroupInner resource); + + /** + * Create a ElasticLoadBalancingV2TargetGroup. Please note that end user resource creation is currently restricted, + * but it will be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ElasticLoadBalancingV2TargetGroup. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ElasticLoadBalancingV2TargetGroupInner createOrReplace(String resourceGroupName, String name, + ElasticLoadBalancingV2TargetGroupInner resource, Context context); + + /** + * Update a ElasticLoadBalancingV2TargetGroup. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ElasticLoadBalancingV2TargetGroup. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, ElasticLoadBalancingV2TargetGroupInner> + beginUpdate(String resourceGroupName, String name, ElasticLoadBalancingV2TargetGroupTagsUpdate properties); + + /** + * Update a ElasticLoadBalancingV2TargetGroup. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ElasticLoadBalancingV2TargetGroup. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, ElasticLoadBalancingV2TargetGroupInner> beginUpdate( + String resourceGroupName, String name, ElasticLoadBalancingV2TargetGroupTagsUpdate properties, Context context); + + /** + * Update a ElasticLoadBalancingV2TargetGroup. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ElasticLoadBalancingV2TargetGroup. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ElasticLoadBalancingV2TargetGroupInner update(String resourceGroupName, String name, + ElasticLoadBalancingV2TargetGroupTagsUpdate properties); + + /** + * Update a ElasticLoadBalancingV2TargetGroup. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ElasticLoadBalancingV2TargetGroup. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ElasticLoadBalancingV2TargetGroupInner update(String resourceGroupName, String name, + ElasticLoadBalancingV2TargetGroupTagsUpdate properties, Context context); + + /** + * Delete a ElasticLoadBalancingV2TargetGroup. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ElasticLoadBalancingV2TargetGroup. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String name); + + /** + * Delete a ElasticLoadBalancingV2TargetGroup. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ElasticLoadBalancingV2TargetGroup. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String name, Context context); + + /** + * Delete a ElasticLoadBalancingV2TargetGroup. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ElasticLoadBalancingV2TargetGroup. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String name); + + /** + * Delete a ElasticLoadBalancingV2TargetGroup. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ElasticLoadBalancingV2TargetGroup. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String name, Context context); +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/ElasticLoadBalancingv2TargetHealthDescriptionsClient.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/ElasticLoadBalancingv2TargetHealthDescriptionsClient.java new file mode 100644 index 000000000000..d9d4578b4a80 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/ElasticLoadBalancingv2TargetHealthDescriptionsClient.java @@ -0,0 +1,285 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.awsconnector.fluent.models.ElasticLoadBalancingv2TargetHealthDescriptionInner; +import com.azure.resourcemanager.awsconnector.models.ElasticLoadBalancingv2TargetHealthDescriptionTagsUpdate; + +/** + * An instance of this class provides access to all the operations defined in + * ElasticLoadBalancingv2TargetHealthDescriptionsClient. + */ +public interface ElasticLoadBalancingv2TargetHealthDescriptionsClient { + /** + * List ElasticLoadBalancingv2TargetHealthDescription resources by subscription ID. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a ElasticLoadBalancingv2TargetHealthDescription list operation as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * List ElasticLoadBalancingv2TargetHealthDescription resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a ElasticLoadBalancingv2TargetHealthDescription list operation as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(Context context); + + /** + * List ElasticLoadBalancingv2TargetHealthDescription resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a ElasticLoadBalancingv2TargetHealthDescription list operation as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * List ElasticLoadBalancingv2TargetHealthDescription resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a ElasticLoadBalancingv2TargetHealthDescription list operation as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName, + Context context); + + /** + * Get a ElasticLoadBalancingv2TargetHealthDescription. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ElasticLoadBalancingv2TargetHealthDescription. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a ElasticLoadBalancingv2TargetHealthDescription along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response + getByResourceGroupWithResponse(String resourceGroupName, String name, Context context); + + /** + * Get a ElasticLoadBalancingv2TargetHealthDescription. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ElasticLoadBalancingv2TargetHealthDescription. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a ElasticLoadBalancingv2TargetHealthDescription. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ElasticLoadBalancingv2TargetHealthDescriptionInner getByResourceGroup(String resourceGroupName, String name); + + /** + * Create a ElasticLoadBalancingv2TargetHealthDescription. Please note that end user resource creation is currently + * restricted, but it will be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ElasticLoadBalancingv2TargetHealthDescription. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, ElasticLoadBalancingv2TargetHealthDescriptionInner> + beginCreateOrReplace(String resourceGroupName, String name, + ElasticLoadBalancingv2TargetHealthDescriptionInner resource); + + /** + * Create a ElasticLoadBalancingv2TargetHealthDescription. Please note that end user resource creation is currently + * restricted, but it will be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ElasticLoadBalancingv2TargetHealthDescription. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, ElasticLoadBalancingv2TargetHealthDescriptionInner> + beginCreateOrReplace(String resourceGroupName, String name, + ElasticLoadBalancingv2TargetHealthDescriptionInner resource, Context context); + + /** + * Create a ElasticLoadBalancingv2TargetHealthDescription. Please note that end user resource creation is currently + * restricted, but it will be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ElasticLoadBalancingv2TargetHealthDescription. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ElasticLoadBalancingv2TargetHealthDescriptionInner createOrReplace(String resourceGroupName, String name, + ElasticLoadBalancingv2TargetHealthDescriptionInner resource); + + /** + * Create a ElasticLoadBalancingv2TargetHealthDescription. Please note that end user resource creation is currently + * restricted, but it will be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ElasticLoadBalancingv2TargetHealthDescription. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ElasticLoadBalancingv2TargetHealthDescriptionInner createOrReplace(String resourceGroupName, String name, + ElasticLoadBalancingv2TargetHealthDescriptionInner resource, Context context); + + /** + * Update a ElasticLoadBalancingv2TargetHealthDescription. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ElasticLoadBalancingv2TargetHealthDescription. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, ElasticLoadBalancingv2TargetHealthDescriptionInner> + beginUpdate(String resourceGroupName, String name, + ElasticLoadBalancingv2TargetHealthDescriptionTagsUpdate properties); + + /** + * Update a ElasticLoadBalancingv2TargetHealthDescription. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ElasticLoadBalancingv2TargetHealthDescription. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, ElasticLoadBalancingv2TargetHealthDescriptionInner> + beginUpdate(String resourceGroupName, String name, + ElasticLoadBalancingv2TargetHealthDescriptionTagsUpdate properties, Context context); + + /** + * Update a ElasticLoadBalancingv2TargetHealthDescription. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ElasticLoadBalancingv2TargetHealthDescription. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ElasticLoadBalancingv2TargetHealthDescriptionInner update(String resourceGroupName, String name, + ElasticLoadBalancingv2TargetHealthDescriptionTagsUpdate properties); + + /** + * Update a ElasticLoadBalancingv2TargetHealthDescription. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ElasticLoadBalancingv2TargetHealthDescription. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ElasticLoadBalancingv2TargetHealthDescriptionInner update(String resourceGroupName, String name, + ElasticLoadBalancingv2TargetHealthDescriptionTagsUpdate properties, Context context); + + /** + * Delete a ElasticLoadBalancingv2TargetHealthDescription. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ElasticLoadBalancingv2TargetHealthDescription. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String name); + + /** + * Delete a ElasticLoadBalancingv2TargetHealthDescription. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ElasticLoadBalancingv2TargetHealthDescription. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String name, Context context); + + /** + * Delete a ElasticLoadBalancingv2TargetHealthDescription. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ElasticLoadBalancingv2TargetHealthDescription. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String name); + + /** + * Delete a ElasticLoadBalancingv2TargetHealthDescription. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ElasticLoadBalancingv2TargetHealthDescription. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String name, Context context); +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/EmrClusterSummariesClient.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/EmrClusterSummariesClient.java new file mode 100644 index 000000000000..acac1444e157 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/EmrClusterSummariesClient.java @@ -0,0 +1,273 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.awsconnector.fluent.models.EmrClusterSummaryInner; +import com.azure.resourcemanager.awsconnector.models.EmrClusterSummaryTagsUpdate; + +/** + * An instance of this class provides access to all the operations defined in EmrClusterSummariesClient. + */ +public interface EmrClusterSummariesClient { + /** + * List EmrClusterSummary resources by subscription ID. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a EmrClusterSummary list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * List EmrClusterSummary resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a EmrClusterSummary list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(Context context); + + /** + * List EmrClusterSummary resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a EmrClusterSummary list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * List EmrClusterSummary resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a EmrClusterSummary list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Get a EmrClusterSummary. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of EmrClusterSummary. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a EmrClusterSummary along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getByResourceGroupWithResponse(String resourceGroupName, String name, + Context context); + + /** + * Get a EmrClusterSummary. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of EmrClusterSummary. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a EmrClusterSummary. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + EmrClusterSummaryInner getByResourceGroup(String resourceGroupName, String name); + + /** + * Create a EmrClusterSummary. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of EmrClusterSummary. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, EmrClusterSummaryInner> + beginCreateOrReplace(String resourceGroupName, String name, EmrClusterSummaryInner resource); + + /** + * Create a EmrClusterSummary. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of EmrClusterSummary. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, EmrClusterSummaryInner> + beginCreateOrReplace(String resourceGroupName, String name, EmrClusterSummaryInner resource, Context context); + + /** + * Create a EmrClusterSummary. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of EmrClusterSummary. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + EmrClusterSummaryInner createOrReplace(String resourceGroupName, String name, EmrClusterSummaryInner resource); + + /** + * Create a EmrClusterSummary. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of EmrClusterSummary. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + EmrClusterSummaryInner createOrReplace(String resourceGroupName, String name, EmrClusterSummaryInner resource, + Context context); + + /** + * Update a EmrClusterSummary. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of EmrClusterSummary. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, EmrClusterSummaryInner> beginUpdate(String resourceGroupName, + String name, EmrClusterSummaryTagsUpdate properties); + + /** + * Update a EmrClusterSummary. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of EmrClusterSummary. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, EmrClusterSummaryInner> beginUpdate(String resourceGroupName, + String name, EmrClusterSummaryTagsUpdate properties, Context context); + + /** + * Update a EmrClusterSummary. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of EmrClusterSummary. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + EmrClusterSummaryInner update(String resourceGroupName, String name, EmrClusterSummaryTagsUpdate properties); + + /** + * Update a EmrClusterSummary. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of EmrClusterSummary. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + EmrClusterSummaryInner update(String resourceGroupName, String name, EmrClusterSummaryTagsUpdate properties, + Context context); + + /** + * Delete a EmrClusterSummary. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of EmrClusterSummary. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String name); + + /** + * Delete a EmrClusterSummary. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of EmrClusterSummary. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String name, Context context); + + /** + * Delete a EmrClusterSummary. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of EmrClusterSummary. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String name); + + /** + * Delete a EmrClusterSummary. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of EmrClusterSummary. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String name, Context context); +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/EmrClustersClient.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/EmrClustersClient.java new file mode 100644 index 000000000000..95b6b269d844 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/EmrClustersClient.java @@ -0,0 +1,270 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.awsconnector.fluent.models.EmrClusterInner; +import com.azure.resourcemanager.awsconnector.models.EmrClusterTagsUpdate; + +/** + * An instance of this class provides access to all the operations defined in EmrClustersClient. + */ +public interface EmrClustersClient { + /** + * List EmrCluster resources by subscription ID. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a EmrCluster list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * List EmrCluster resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a EmrCluster list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(Context context); + + /** + * List EmrCluster resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a EmrCluster list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * List EmrCluster resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a EmrCluster list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Get a EmrCluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of EmrCluster. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a EmrCluster along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getByResourceGroupWithResponse(String resourceGroupName, String name, Context context); + + /** + * Get a EmrCluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of EmrCluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a EmrCluster. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + EmrClusterInner getByResourceGroup(String resourceGroupName, String name); + + /** + * Create a EmrCluster. Please note that end user resource creation is currently restricted, but it will be enabled + * in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of EmrCluster. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, EmrClusterInner> beginCreateOrReplace(String resourceGroupName, String name, + EmrClusterInner resource); + + /** + * Create a EmrCluster. Please note that end user resource creation is currently restricted, but it will be enabled + * in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of EmrCluster. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, EmrClusterInner> beginCreateOrReplace(String resourceGroupName, String name, + EmrClusterInner resource, Context context); + + /** + * Create a EmrCluster. Please note that end user resource creation is currently restricted, but it will be enabled + * in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of EmrCluster. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + EmrClusterInner createOrReplace(String resourceGroupName, String name, EmrClusterInner resource); + + /** + * Create a EmrCluster. Please note that end user resource creation is currently restricted, but it will be enabled + * in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of EmrCluster. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + EmrClusterInner createOrReplace(String resourceGroupName, String name, EmrClusterInner resource, Context context); + + /** + * Update a EmrCluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of EmrCluster. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, EmrClusterInner> beginUpdate(String resourceGroupName, String name, + EmrClusterTagsUpdate properties); + + /** + * Update a EmrCluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of EmrCluster. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, EmrClusterInner> beginUpdate(String resourceGroupName, String name, + EmrClusterTagsUpdate properties, Context context); + + /** + * Update a EmrCluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of EmrCluster. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + EmrClusterInner update(String resourceGroupName, String name, EmrClusterTagsUpdate properties); + + /** + * Update a EmrCluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of EmrCluster. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + EmrClusterInner update(String resourceGroupName, String name, EmrClusterTagsUpdate properties, Context context); + + /** + * Delete a EmrCluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of EmrCluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String name); + + /** + * Delete a EmrCluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of EmrCluster. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String name, Context context); + + /** + * Delete a EmrCluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of EmrCluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String name); + + /** + * Delete a EmrCluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of EmrCluster. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String name, Context context); +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/GuardDutyDetectorsClient.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/GuardDutyDetectorsClient.java new file mode 100644 index 000000000000..20d3dfbff4e1 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/GuardDutyDetectorsClient.java @@ -0,0 +1,273 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.awsconnector.fluent.models.GuardDutyDetectorInner; +import com.azure.resourcemanager.awsconnector.models.GuardDutyDetectorTagsUpdate; + +/** + * An instance of this class provides access to all the operations defined in GuardDutyDetectorsClient. + */ +public interface GuardDutyDetectorsClient { + /** + * List GuardDutyDetector resources by subscription ID. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a GuardDutyDetector list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * List GuardDutyDetector resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a GuardDutyDetector list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(Context context); + + /** + * List GuardDutyDetector resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a GuardDutyDetector list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * List GuardDutyDetector resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a GuardDutyDetector list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Get a GuardDutyDetector. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of GuardDutyDetector. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a GuardDutyDetector along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getByResourceGroupWithResponse(String resourceGroupName, String name, + Context context); + + /** + * Get a GuardDutyDetector. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of GuardDutyDetector. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a GuardDutyDetector. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + GuardDutyDetectorInner getByResourceGroup(String resourceGroupName, String name); + + /** + * Create a GuardDutyDetector. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of GuardDutyDetector. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, GuardDutyDetectorInner> + beginCreateOrReplace(String resourceGroupName, String name, GuardDutyDetectorInner resource); + + /** + * Create a GuardDutyDetector. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of GuardDutyDetector. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, GuardDutyDetectorInner> + beginCreateOrReplace(String resourceGroupName, String name, GuardDutyDetectorInner resource, Context context); + + /** + * Create a GuardDutyDetector. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of GuardDutyDetector. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + GuardDutyDetectorInner createOrReplace(String resourceGroupName, String name, GuardDutyDetectorInner resource); + + /** + * Create a GuardDutyDetector. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of GuardDutyDetector. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + GuardDutyDetectorInner createOrReplace(String resourceGroupName, String name, GuardDutyDetectorInner resource, + Context context); + + /** + * Update a GuardDutyDetector. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of GuardDutyDetector. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, GuardDutyDetectorInner> beginUpdate(String resourceGroupName, + String name, GuardDutyDetectorTagsUpdate properties); + + /** + * Update a GuardDutyDetector. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of GuardDutyDetector. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, GuardDutyDetectorInner> beginUpdate(String resourceGroupName, + String name, GuardDutyDetectorTagsUpdate properties, Context context); + + /** + * Update a GuardDutyDetector. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of GuardDutyDetector. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + GuardDutyDetectorInner update(String resourceGroupName, String name, GuardDutyDetectorTagsUpdate properties); + + /** + * Update a GuardDutyDetector. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of GuardDutyDetector. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + GuardDutyDetectorInner update(String resourceGroupName, String name, GuardDutyDetectorTagsUpdate properties, + Context context); + + /** + * Delete a GuardDutyDetector. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of GuardDutyDetector. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String name); + + /** + * Delete a GuardDutyDetector. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of GuardDutyDetector. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String name, Context context); + + /** + * Delete a GuardDutyDetector. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of GuardDutyDetector. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String name); + + /** + * Delete a GuardDutyDetector. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of GuardDutyDetector. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String name, Context context); +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/IamAccessKeyLastUsedsClient.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/IamAccessKeyLastUsedsClient.java new file mode 100644 index 000000000000..8b7d0db53ebf --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/IamAccessKeyLastUsedsClient.java @@ -0,0 +1,274 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.awsconnector.fluent.models.IamAccessKeyLastUsedInner; +import com.azure.resourcemanager.awsconnector.models.IamAccessKeyLastUsedTagsUpdate; + +/** + * An instance of this class provides access to all the operations defined in IamAccessKeyLastUsedsClient. + */ +public interface IamAccessKeyLastUsedsClient { + /** + * List IamAccessKeyLastUsed resources by subscription ID. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a IamAccessKeyLastUsed list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * List IamAccessKeyLastUsed resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a IamAccessKeyLastUsed list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(Context context); + + /** + * List IamAccessKeyLastUsed resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a IamAccessKeyLastUsed list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * List IamAccessKeyLastUsed resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a IamAccessKeyLastUsed list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Get a IamAccessKeyLastUsed. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of IamAccessKeyLastUsed. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a IamAccessKeyLastUsed along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getByResourceGroupWithResponse(String resourceGroupName, String name, + Context context); + + /** + * Get a IamAccessKeyLastUsed. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of IamAccessKeyLastUsed. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a IamAccessKeyLastUsed. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + IamAccessKeyLastUsedInner getByResourceGroup(String resourceGroupName, String name); + + /** + * Create a IamAccessKeyLastUsed. Please note that end user resource creation is currently restricted, but it will + * be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of IamAccessKeyLastUsed. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, IamAccessKeyLastUsedInner> + beginCreateOrReplace(String resourceGroupName, String name, IamAccessKeyLastUsedInner resource); + + /** + * Create a IamAccessKeyLastUsed. Please note that end user resource creation is currently restricted, but it will + * be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of IamAccessKeyLastUsed. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, IamAccessKeyLastUsedInner> beginCreateOrReplace( + String resourceGroupName, String name, IamAccessKeyLastUsedInner resource, Context context); + + /** + * Create a IamAccessKeyLastUsed. Please note that end user resource creation is currently restricted, but it will + * be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of IamAccessKeyLastUsed. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + IamAccessKeyLastUsedInner createOrReplace(String resourceGroupName, String name, + IamAccessKeyLastUsedInner resource); + + /** + * Create a IamAccessKeyLastUsed. Please note that end user resource creation is currently restricted, but it will + * be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of IamAccessKeyLastUsed. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + IamAccessKeyLastUsedInner createOrReplace(String resourceGroupName, String name, IamAccessKeyLastUsedInner resource, + Context context); + + /** + * Update a IamAccessKeyLastUsed. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of IamAccessKeyLastUsed. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, IamAccessKeyLastUsedInner> beginUpdate(String resourceGroupName, + String name, IamAccessKeyLastUsedTagsUpdate properties); + + /** + * Update a IamAccessKeyLastUsed. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of IamAccessKeyLastUsed. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, IamAccessKeyLastUsedInner> beginUpdate(String resourceGroupName, + String name, IamAccessKeyLastUsedTagsUpdate properties, Context context); + + /** + * Update a IamAccessKeyLastUsed. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of IamAccessKeyLastUsed. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + IamAccessKeyLastUsedInner update(String resourceGroupName, String name, IamAccessKeyLastUsedTagsUpdate properties); + + /** + * Update a IamAccessKeyLastUsed. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of IamAccessKeyLastUsed. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + IamAccessKeyLastUsedInner update(String resourceGroupName, String name, IamAccessKeyLastUsedTagsUpdate properties, + Context context); + + /** + * Delete a IamAccessKeyLastUsed. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of IamAccessKeyLastUsed. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String name); + + /** + * Delete a IamAccessKeyLastUsed. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of IamAccessKeyLastUsed. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String name, Context context); + + /** + * Delete a IamAccessKeyLastUsed. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of IamAccessKeyLastUsed. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String name); + + /** + * Delete a IamAccessKeyLastUsed. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of IamAccessKeyLastUsed. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String name, Context context); +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/IamAccessKeyMetadataInfoesClient.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/IamAccessKeyMetadataInfoesClient.java new file mode 100644 index 000000000000..228aa62ea4fd --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/IamAccessKeyMetadataInfoesClient.java @@ -0,0 +1,274 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.awsconnector.fluent.models.IamAccessKeyMetadataInner; +import com.azure.resourcemanager.awsconnector.models.IamAccessKeyMetadataTagsUpdate; + +/** + * An instance of this class provides access to all the operations defined in IamAccessKeyMetadataInfoesClient. + */ +public interface IamAccessKeyMetadataInfoesClient { + /** + * List IamAccessKeyMetadata resources by subscription ID. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a IamAccessKeyMetadata list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * List IamAccessKeyMetadata resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a IamAccessKeyMetadata list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(Context context); + + /** + * List IamAccessKeyMetadata resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a IamAccessKeyMetadata list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * List IamAccessKeyMetadata resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a IamAccessKeyMetadata list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Get a IamAccessKeyMetadata. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of IamAccessKeyMetadata. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a IamAccessKeyMetadata along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getByResourceGroupWithResponse(String resourceGroupName, String name, + Context context); + + /** + * Get a IamAccessKeyMetadata. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of IamAccessKeyMetadata. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a IamAccessKeyMetadata. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + IamAccessKeyMetadataInner getByResourceGroup(String resourceGroupName, String name); + + /** + * Create a IamAccessKeyMetadata. Please note that end user resource creation is currently restricted, but it will + * be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of IamAccessKeyMetadata. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, IamAccessKeyMetadataInner> + beginCreateOrReplace(String resourceGroupName, String name, IamAccessKeyMetadataInner resource); + + /** + * Create a IamAccessKeyMetadata. Please note that end user resource creation is currently restricted, but it will + * be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of IamAccessKeyMetadata. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, IamAccessKeyMetadataInner> beginCreateOrReplace( + String resourceGroupName, String name, IamAccessKeyMetadataInner resource, Context context); + + /** + * Create a IamAccessKeyMetadata. Please note that end user resource creation is currently restricted, but it will + * be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of IamAccessKeyMetadata. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + IamAccessKeyMetadataInner createOrReplace(String resourceGroupName, String name, + IamAccessKeyMetadataInner resource); + + /** + * Create a IamAccessKeyMetadata. Please note that end user resource creation is currently restricted, but it will + * be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of IamAccessKeyMetadata. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + IamAccessKeyMetadataInner createOrReplace(String resourceGroupName, String name, IamAccessKeyMetadataInner resource, + Context context); + + /** + * Update a IamAccessKeyMetadata. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of IamAccessKeyMetadata. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, IamAccessKeyMetadataInner> beginUpdate(String resourceGroupName, + String name, IamAccessKeyMetadataTagsUpdate properties); + + /** + * Update a IamAccessKeyMetadata. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of IamAccessKeyMetadata. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, IamAccessKeyMetadataInner> beginUpdate(String resourceGroupName, + String name, IamAccessKeyMetadataTagsUpdate properties, Context context); + + /** + * Update a IamAccessKeyMetadata. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of IamAccessKeyMetadata. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + IamAccessKeyMetadataInner update(String resourceGroupName, String name, IamAccessKeyMetadataTagsUpdate properties); + + /** + * Update a IamAccessKeyMetadata. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of IamAccessKeyMetadata. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + IamAccessKeyMetadataInner update(String resourceGroupName, String name, IamAccessKeyMetadataTagsUpdate properties, + Context context); + + /** + * Delete a IamAccessKeyMetadata. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of IamAccessKeyMetadata. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String name); + + /** + * Delete a IamAccessKeyMetadata. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of IamAccessKeyMetadata. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String name, Context context); + + /** + * Delete a IamAccessKeyMetadata. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of IamAccessKeyMetadata. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String name); + + /** + * Delete a IamAccessKeyMetadata. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of IamAccessKeyMetadata. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String name, Context context); +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/IamGroupsClient.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/IamGroupsClient.java new file mode 100644 index 000000000000..e1d3a208a205 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/IamGroupsClient.java @@ -0,0 +1,270 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.awsconnector.fluent.models.IamGroupInner; +import com.azure.resourcemanager.awsconnector.models.IamGroupTagsUpdate; + +/** + * An instance of this class provides access to all the operations defined in IamGroupsClient. + */ +public interface IamGroupsClient { + /** + * List IamGroup resources by subscription ID. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a IamGroup list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * List IamGroup resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a IamGroup list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(Context context); + + /** + * List IamGroup resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a IamGroup list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * List IamGroup resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a IamGroup list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Get a IamGroup. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of IamGroup. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a IamGroup along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getByResourceGroupWithResponse(String resourceGroupName, String name, Context context); + + /** + * Get a IamGroup. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of IamGroup. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a IamGroup. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + IamGroupInner getByResourceGroup(String resourceGroupName, String name); + + /** + * Create a IamGroup. Please note that end user resource creation is currently restricted, but it will be enabled in + * the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of IamGroup. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, IamGroupInner> beginCreateOrReplace(String resourceGroupName, String name, + IamGroupInner resource); + + /** + * Create a IamGroup. Please note that end user resource creation is currently restricted, but it will be enabled in + * the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of IamGroup. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, IamGroupInner> beginCreateOrReplace(String resourceGroupName, String name, + IamGroupInner resource, Context context); + + /** + * Create a IamGroup. Please note that end user resource creation is currently restricted, but it will be enabled in + * the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of IamGroup. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + IamGroupInner createOrReplace(String resourceGroupName, String name, IamGroupInner resource); + + /** + * Create a IamGroup. Please note that end user resource creation is currently restricted, but it will be enabled in + * the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of IamGroup. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + IamGroupInner createOrReplace(String resourceGroupName, String name, IamGroupInner resource, Context context); + + /** + * Update a IamGroup. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of IamGroup. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, IamGroupInner> beginUpdate(String resourceGroupName, String name, + IamGroupTagsUpdate properties); + + /** + * Update a IamGroup. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of IamGroup. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, IamGroupInner> beginUpdate(String resourceGroupName, String name, + IamGroupTagsUpdate properties, Context context); + + /** + * Update a IamGroup. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of IamGroup. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + IamGroupInner update(String resourceGroupName, String name, IamGroupTagsUpdate properties); + + /** + * Update a IamGroup. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of IamGroup. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + IamGroupInner update(String resourceGroupName, String name, IamGroupTagsUpdate properties, Context context); + + /** + * Delete a IamGroup. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of IamGroup. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String name); + + /** + * Delete a IamGroup. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of IamGroup. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String name, Context context); + + /** + * Delete a IamGroup. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of IamGroup. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String name); + + /** + * Delete a IamGroup. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of IamGroup. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String name, Context context); +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/IamInstanceProfilesClient.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/IamInstanceProfilesClient.java new file mode 100644 index 000000000000..1077f089993b --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/IamInstanceProfilesClient.java @@ -0,0 +1,276 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.awsconnector.fluent.models.IamInstanceProfileAutoGeneratedInner; +import com.azure.resourcemanager.awsconnector.models.IamInstanceProfileTagsUpdate; + +/** + * An instance of this class provides access to all the operations defined in IamInstanceProfilesClient. + */ +public interface IamInstanceProfilesClient { + /** + * List IamInstanceProfile resources by subscription ID. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a IamInstanceProfile list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * List IamInstanceProfile resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a IamInstanceProfile list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(Context context); + + /** + * List IamInstanceProfile resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a IamInstanceProfile list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * List IamInstanceProfile resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a IamInstanceProfile list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Get a IamInstanceProfile. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of IamInstanceProfile. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a IamInstanceProfile along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getByResourceGroupWithResponse(String resourceGroupName, String name, + Context context); + + /** + * Get a IamInstanceProfile. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of IamInstanceProfile. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a IamInstanceProfile. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + IamInstanceProfileAutoGeneratedInner getByResourceGroup(String resourceGroupName, String name); + + /** + * Create a IamInstanceProfile. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of IamInstanceProfile. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, IamInstanceProfileAutoGeneratedInner> + beginCreateOrUpdate(String resourceGroupName, String name, IamInstanceProfileAutoGeneratedInner resource); + + /** + * Create a IamInstanceProfile. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of IamInstanceProfile. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, IamInstanceProfileAutoGeneratedInner> + beginCreateOrUpdate(String resourceGroupName, String name, IamInstanceProfileAutoGeneratedInner resource, + Context context); + + /** + * Create a IamInstanceProfile. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of IamInstanceProfile. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + IamInstanceProfileAutoGeneratedInner createOrUpdate(String resourceGroupName, String name, + IamInstanceProfileAutoGeneratedInner resource); + + /** + * Create a IamInstanceProfile. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of IamInstanceProfile. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + IamInstanceProfileAutoGeneratedInner createOrUpdate(String resourceGroupName, String name, + IamInstanceProfileAutoGeneratedInner resource, Context context); + + /** + * Update a IamInstanceProfile. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of IamInstanceProfile. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, IamInstanceProfileAutoGeneratedInner> + beginUpdate(String resourceGroupName, String name, IamInstanceProfileTagsUpdate properties); + + /** + * Update a IamInstanceProfile. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of IamInstanceProfile. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, IamInstanceProfileAutoGeneratedInner> + beginUpdate(String resourceGroupName, String name, IamInstanceProfileTagsUpdate properties, Context context); + + /** + * Update a IamInstanceProfile. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of IamInstanceProfile. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + IamInstanceProfileAutoGeneratedInner update(String resourceGroupName, String name, + IamInstanceProfileTagsUpdate properties); + + /** + * Update a IamInstanceProfile. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of IamInstanceProfile. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + IamInstanceProfileAutoGeneratedInner update(String resourceGroupName, String name, + IamInstanceProfileTagsUpdate properties, Context context); + + /** + * Delete a IamInstanceProfile. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of IamInstanceProfile. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String name); + + /** + * Delete a IamInstanceProfile. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of IamInstanceProfile. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String name, Context context); + + /** + * Delete a IamInstanceProfile. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of IamInstanceProfile. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String name); + + /** + * Delete a IamInstanceProfile. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of IamInstanceProfile. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String name, Context context); +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/IamMfaDevicesClient.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/IamMfaDevicesClient.java new file mode 100644 index 000000000000..6d32a7bd160d --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/IamMfaDevicesClient.java @@ -0,0 +1,271 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.awsconnector.fluent.models.IamMfaDeviceInner; +import com.azure.resourcemanager.awsconnector.models.IamMfaDeviceTagsUpdate; + +/** + * An instance of this class provides access to all the operations defined in IamMfaDevicesClient. + */ +public interface IamMfaDevicesClient { + /** + * List IamMFADevice resources by subscription ID. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a IamMFADevice list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * List IamMFADevice resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a IamMFADevice list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(Context context); + + /** + * List IamMFADevice resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a IamMFADevice list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * List IamMFADevice resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a IamMFADevice list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Get a IamMFADevice. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of IamMFADevice. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a IamMFADevice along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getByResourceGroupWithResponse(String resourceGroupName, String name, Context context); + + /** + * Get a IamMFADevice. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of IamMFADevice. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a IamMFADevice. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + IamMfaDeviceInner getByResourceGroup(String resourceGroupName, String name); + + /** + * Create a IamMFADevice. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of IamMFADevice. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, IamMfaDeviceInner> beginCreateOrReplace(String resourceGroupName, + String name, IamMfaDeviceInner resource); + + /** + * Create a IamMFADevice. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of IamMFADevice. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, IamMfaDeviceInner> beginCreateOrReplace(String resourceGroupName, + String name, IamMfaDeviceInner resource, Context context); + + /** + * Create a IamMFADevice. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of IamMFADevice. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + IamMfaDeviceInner createOrReplace(String resourceGroupName, String name, IamMfaDeviceInner resource); + + /** + * Create a IamMFADevice. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of IamMFADevice. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + IamMfaDeviceInner createOrReplace(String resourceGroupName, String name, IamMfaDeviceInner resource, + Context context); + + /** + * Update a IamMFADevice. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of IamMFADevice. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, IamMfaDeviceInner> beginUpdate(String resourceGroupName, String name, + IamMfaDeviceTagsUpdate properties); + + /** + * Update a IamMFADevice. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of IamMFADevice. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, IamMfaDeviceInner> beginUpdate(String resourceGroupName, String name, + IamMfaDeviceTagsUpdate properties, Context context); + + /** + * Update a IamMFADevice. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of IamMFADevice. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + IamMfaDeviceInner update(String resourceGroupName, String name, IamMfaDeviceTagsUpdate properties); + + /** + * Update a IamMFADevice. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of IamMFADevice. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + IamMfaDeviceInner update(String resourceGroupName, String name, IamMfaDeviceTagsUpdate properties, Context context); + + /** + * Delete a IamMFADevice. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of IamMFADevice. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String name); + + /** + * Delete a IamMFADevice. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of IamMFADevice. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String name, Context context); + + /** + * Delete a IamMFADevice. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of IamMFADevice. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String name); + + /** + * Delete a IamMFADevice. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of IamMFADevice. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String name, Context context); +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/IamPasswordPoliciesClient.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/IamPasswordPoliciesClient.java new file mode 100644 index 000000000000..d058615337a0 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/IamPasswordPoliciesClient.java @@ -0,0 +1,273 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.awsconnector.fluent.models.IamPasswordPolicyInner; +import com.azure.resourcemanager.awsconnector.models.IamPasswordPolicyTagsUpdate; + +/** + * An instance of this class provides access to all the operations defined in IamPasswordPoliciesClient. + */ +public interface IamPasswordPoliciesClient { + /** + * List IamPasswordPolicy resources by subscription ID. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a IamPasswordPolicy list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * List IamPasswordPolicy resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a IamPasswordPolicy list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(Context context); + + /** + * List IamPasswordPolicy resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a IamPasswordPolicy list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * List IamPasswordPolicy resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a IamPasswordPolicy list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Get a IamPasswordPolicy. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of IamPasswordPolicy. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a IamPasswordPolicy along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getByResourceGroupWithResponse(String resourceGroupName, String name, + Context context); + + /** + * Get a IamPasswordPolicy. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of IamPasswordPolicy. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a IamPasswordPolicy. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + IamPasswordPolicyInner getByResourceGroup(String resourceGroupName, String name); + + /** + * Create a IamPasswordPolicy. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of IamPasswordPolicy. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, IamPasswordPolicyInner> + beginCreateOrReplace(String resourceGroupName, String name, IamPasswordPolicyInner resource); + + /** + * Create a IamPasswordPolicy. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of IamPasswordPolicy. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, IamPasswordPolicyInner> + beginCreateOrReplace(String resourceGroupName, String name, IamPasswordPolicyInner resource, Context context); + + /** + * Create a IamPasswordPolicy. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of IamPasswordPolicy. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + IamPasswordPolicyInner createOrReplace(String resourceGroupName, String name, IamPasswordPolicyInner resource); + + /** + * Create a IamPasswordPolicy. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of IamPasswordPolicy. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + IamPasswordPolicyInner createOrReplace(String resourceGroupName, String name, IamPasswordPolicyInner resource, + Context context); + + /** + * Update a IamPasswordPolicy. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of IamPasswordPolicy. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, IamPasswordPolicyInner> beginUpdate(String resourceGroupName, + String name, IamPasswordPolicyTagsUpdate properties); + + /** + * Update a IamPasswordPolicy. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of IamPasswordPolicy. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, IamPasswordPolicyInner> beginUpdate(String resourceGroupName, + String name, IamPasswordPolicyTagsUpdate properties, Context context); + + /** + * Update a IamPasswordPolicy. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of IamPasswordPolicy. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + IamPasswordPolicyInner update(String resourceGroupName, String name, IamPasswordPolicyTagsUpdate properties); + + /** + * Update a IamPasswordPolicy. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of IamPasswordPolicy. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + IamPasswordPolicyInner update(String resourceGroupName, String name, IamPasswordPolicyTagsUpdate properties, + Context context); + + /** + * Delete a IamPasswordPolicy. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of IamPasswordPolicy. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String name); + + /** + * Delete a IamPasswordPolicy. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of IamPasswordPolicy. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String name, Context context); + + /** + * Delete a IamPasswordPolicy. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of IamPasswordPolicy. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String name); + + /** + * Delete a IamPasswordPolicy. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of IamPasswordPolicy. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String name, Context context); +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/IamPolicyVersionsClient.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/IamPolicyVersionsClient.java new file mode 100644 index 000000000000..a3c7b4de7e19 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/IamPolicyVersionsClient.java @@ -0,0 +1,273 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.awsconnector.fluent.models.IamPolicyVersionInner; +import com.azure.resourcemanager.awsconnector.models.IamPolicyVersionTagsUpdate; + +/** + * An instance of this class provides access to all the operations defined in IamPolicyVersionsClient. + */ +public interface IamPolicyVersionsClient { + /** + * List IamPolicyVersion resources by subscription ID. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a IamPolicyVersion list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * List IamPolicyVersion resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a IamPolicyVersion list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(Context context); + + /** + * List IamPolicyVersion resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a IamPolicyVersion list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * List IamPolicyVersion resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a IamPolicyVersion list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Get a IamPolicyVersion. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of IamPolicyVersion. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a IamPolicyVersion along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getByResourceGroupWithResponse(String resourceGroupName, String name, + Context context); + + /** + * Get a IamPolicyVersion. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of IamPolicyVersion. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a IamPolicyVersion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + IamPolicyVersionInner getByResourceGroup(String resourceGroupName, String name); + + /** + * Create a IamPolicyVersion. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of IamPolicyVersion. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, IamPolicyVersionInner> beginCreateOrReplace(String resourceGroupName, + String name, IamPolicyVersionInner resource); + + /** + * Create a IamPolicyVersion. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of IamPolicyVersion. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, IamPolicyVersionInner> beginCreateOrReplace(String resourceGroupName, + String name, IamPolicyVersionInner resource, Context context); + + /** + * Create a IamPolicyVersion. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of IamPolicyVersion. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + IamPolicyVersionInner createOrReplace(String resourceGroupName, String name, IamPolicyVersionInner resource); + + /** + * Create a IamPolicyVersion. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of IamPolicyVersion. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + IamPolicyVersionInner createOrReplace(String resourceGroupName, String name, IamPolicyVersionInner resource, + Context context); + + /** + * Update a IamPolicyVersion. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of IamPolicyVersion. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, IamPolicyVersionInner> beginUpdate(String resourceGroupName, + String name, IamPolicyVersionTagsUpdate properties); + + /** + * Update a IamPolicyVersion. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of IamPolicyVersion. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, IamPolicyVersionInner> beginUpdate(String resourceGroupName, + String name, IamPolicyVersionTagsUpdate properties, Context context); + + /** + * Update a IamPolicyVersion. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of IamPolicyVersion. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + IamPolicyVersionInner update(String resourceGroupName, String name, IamPolicyVersionTagsUpdate properties); + + /** + * Update a IamPolicyVersion. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of IamPolicyVersion. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + IamPolicyVersionInner update(String resourceGroupName, String name, IamPolicyVersionTagsUpdate properties, + Context context); + + /** + * Delete a IamPolicyVersion. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of IamPolicyVersion. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String name); + + /** + * Delete a IamPolicyVersion. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of IamPolicyVersion. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String name, Context context); + + /** + * Delete a IamPolicyVersion. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of IamPolicyVersion. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String name); + + /** + * Delete a IamPolicyVersion. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of IamPolicyVersion. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String name, Context context); +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/IamRolesClient.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/IamRolesClient.java new file mode 100644 index 000000000000..4a24b33b1d7c --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/IamRolesClient.java @@ -0,0 +1,270 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.awsconnector.fluent.models.IamRoleInner; +import com.azure.resourcemanager.awsconnector.models.IamRoleTagsUpdate; + +/** + * An instance of this class provides access to all the operations defined in IamRolesClient. + */ +public interface IamRolesClient { + /** + * List IamRole resources by subscription ID. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a IamRole list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * List IamRole resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a IamRole list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(Context context); + + /** + * List IamRole resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a IamRole list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * List IamRole resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a IamRole list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Get a IamRole. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of IamRole. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a IamRole along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getByResourceGroupWithResponse(String resourceGroupName, String name, Context context); + + /** + * Get a IamRole. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of IamRole. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a IamRole. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + IamRoleInner getByResourceGroup(String resourceGroupName, String name); + + /** + * Create a IamRole. Please note that end user resource creation is currently restricted, but it will be enabled in + * the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of IamRole. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, IamRoleInner> beginCreateOrReplace(String resourceGroupName, String name, + IamRoleInner resource); + + /** + * Create a IamRole. Please note that end user resource creation is currently restricted, but it will be enabled in + * the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of IamRole. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, IamRoleInner> beginCreateOrReplace(String resourceGroupName, String name, + IamRoleInner resource, Context context); + + /** + * Create a IamRole. Please note that end user resource creation is currently restricted, but it will be enabled in + * the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of IamRole. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + IamRoleInner createOrReplace(String resourceGroupName, String name, IamRoleInner resource); + + /** + * Create a IamRole. Please note that end user resource creation is currently restricted, but it will be enabled in + * the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of IamRole. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + IamRoleInner createOrReplace(String resourceGroupName, String name, IamRoleInner resource, Context context); + + /** + * Update a IamRole. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of IamRole. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, IamRoleInner> beginUpdate(String resourceGroupName, String name, + IamRoleTagsUpdate properties); + + /** + * Update a IamRole. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of IamRole. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, IamRoleInner> beginUpdate(String resourceGroupName, String name, + IamRoleTagsUpdate properties, Context context); + + /** + * Update a IamRole. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of IamRole. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + IamRoleInner update(String resourceGroupName, String name, IamRoleTagsUpdate properties); + + /** + * Update a IamRole. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of IamRole. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + IamRoleInner update(String resourceGroupName, String name, IamRoleTagsUpdate properties, Context context); + + /** + * Delete a IamRole. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of IamRole. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String name); + + /** + * Delete a IamRole. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of IamRole. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String name, Context context); + + /** + * Delete a IamRole. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of IamRole. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String name); + + /** + * Delete a IamRole. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of IamRole. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String name, Context context); +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/IamServerCertificatesClient.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/IamServerCertificatesClient.java new file mode 100644 index 000000000000..0cd6344d37a9 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/IamServerCertificatesClient.java @@ -0,0 +1,274 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.awsconnector.fluent.models.IamServerCertificateInner; +import com.azure.resourcemanager.awsconnector.models.IamServerCertificateTagsUpdate; + +/** + * An instance of this class provides access to all the operations defined in IamServerCertificatesClient. + */ +public interface IamServerCertificatesClient { + /** + * List IamServerCertificate resources by subscription ID. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a IamServerCertificate list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * List IamServerCertificate resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a IamServerCertificate list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(Context context); + + /** + * List IamServerCertificate resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a IamServerCertificate list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * List IamServerCertificate resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a IamServerCertificate list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Get a IamServerCertificate. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of IamServerCertificate. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a IamServerCertificate along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getByResourceGroupWithResponse(String resourceGroupName, String name, + Context context); + + /** + * Get a IamServerCertificate. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of IamServerCertificate. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a IamServerCertificate. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + IamServerCertificateInner getByResourceGroup(String resourceGroupName, String name); + + /** + * Create a IamServerCertificate. Please note that end user resource creation is currently restricted, but it will + * be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of IamServerCertificate. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, IamServerCertificateInner> + beginCreateOrReplace(String resourceGroupName, String name, IamServerCertificateInner resource); + + /** + * Create a IamServerCertificate. Please note that end user resource creation is currently restricted, but it will + * be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of IamServerCertificate. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, IamServerCertificateInner> beginCreateOrReplace( + String resourceGroupName, String name, IamServerCertificateInner resource, Context context); + + /** + * Create a IamServerCertificate. Please note that end user resource creation is currently restricted, but it will + * be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of IamServerCertificate. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + IamServerCertificateInner createOrReplace(String resourceGroupName, String name, + IamServerCertificateInner resource); + + /** + * Create a IamServerCertificate. Please note that end user resource creation is currently restricted, but it will + * be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of IamServerCertificate. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + IamServerCertificateInner createOrReplace(String resourceGroupName, String name, IamServerCertificateInner resource, + Context context); + + /** + * Update a IamServerCertificate. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of IamServerCertificate. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, IamServerCertificateInner> beginUpdate(String resourceGroupName, + String name, IamServerCertificateTagsUpdate properties); + + /** + * Update a IamServerCertificate. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of IamServerCertificate. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, IamServerCertificateInner> beginUpdate(String resourceGroupName, + String name, IamServerCertificateTagsUpdate properties, Context context); + + /** + * Update a IamServerCertificate. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of IamServerCertificate. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + IamServerCertificateInner update(String resourceGroupName, String name, IamServerCertificateTagsUpdate properties); + + /** + * Update a IamServerCertificate. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of IamServerCertificate. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + IamServerCertificateInner update(String resourceGroupName, String name, IamServerCertificateTagsUpdate properties, + Context context); + + /** + * Delete a IamServerCertificate. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of IamServerCertificate. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String name); + + /** + * Delete a IamServerCertificate. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of IamServerCertificate. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String name, Context context); + + /** + * Delete a IamServerCertificate. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of IamServerCertificate. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String name); + + /** + * Delete a IamServerCertificate. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of IamServerCertificate. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String name, Context context); +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/IamVirtualMfaDevicesClient.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/IamVirtualMfaDevicesClient.java new file mode 100644 index 000000000000..3137b9e96f2e --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/IamVirtualMfaDevicesClient.java @@ -0,0 +1,273 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.awsconnector.fluent.models.IamVirtualMfaDeviceInner; +import com.azure.resourcemanager.awsconnector.models.IamVirtualMfaDeviceTagsUpdate; + +/** + * An instance of this class provides access to all the operations defined in IamVirtualMfaDevicesClient. + */ +public interface IamVirtualMfaDevicesClient { + /** + * List IamVirtualMFADevice resources by subscription ID. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a IamVirtualMFADevice list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * List IamVirtualMFADevice resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a IamVirtualMFADevice list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(Context context); + + /** + * List IamVirtualMFADevice resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a IamVirtualMFADevice list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * List IamVirtualMFADevice resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a IamVirtualMFADevice list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Get a IamVirtualMFADevice. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of IamVirtualMFADevice. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a IamVirtualMFADevice along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getByResourceGroupWithResponse(String resourceGroupName, String name, + Context context); + + /** + * Get a IamVirtualMFADevice. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of IamVirtualMFADevice. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a IamVirtualMFADevice. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + IamVirtualMfaDeviceInner getByResourceGroup(String resourceGroupName, String name); + + /** + * Create a IamVirtualMFADevice. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of IamVirtualMFADevice. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, IamVirtualMfaDeviceInner> + beginCreateOrReplace(String resourceGroupName, String name, IamVirtualMfaDeviceInner resource); + + /** + * Create a IamVirtualMFADevice. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of IamVirtualMFADevice. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, IamVirtualMfaDeviceInner> + beginCreateOrReplace(String resourceGroupName, String name, IamVirtualMfaDeviceInner resource, Context context); + + /** + * Create a IamVirtualMFADevice. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of IamVirtualMFADevice. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + IamVirtualMfaDeviceInner createOrReplace(String resourceGroupName, String name, IamVirtualMfaDeviceInner resource); + + /** + * Create a IamVirtualMFADevice. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of IamVirtualMFADevice. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + IamVirtualMfaDeviceInner createOrReplace(String resourceGroupName, String name, IamVirtualMfaDeviceInner resource, + Context context); + + /** + * Update a IamVirtualMFADevice. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of IamVirtualMFADevice. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, IamVirtualMfaDeviceInner> beginUpdate(String resourceGroupName, + String name, IamVirtualMfaDeviceTagsUpdate properties); + + /** + * Update a IamVirtualMFADevice. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of IamVirtualMFADevice. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, IamVirtualMfaDeviceInner> beginUpdate(String resourceGroupName, + String name, IamVirtualMfaDeviceTagsUpdate properties, Context context); + + /** + * Update a IamVirtualMFADevice. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of IamVirtualMFADevice. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + IamVirtualMfaDeviceInner update(String resourceGroupName, String name, IamVirtualMfaDeviceTagsUpdate properties); + + /** + * Update a IamVirtualMFADevice. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of IamVirtualMFADevice. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + IamVirtualMfaDeviceInner update(String resourceGroupName, String name, IamVirtualMfaDeviceTagsUpdate properties, + Context context); + + /** + * Delete a IamVirtualMFADevice. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of IamVirtualMFADevice. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String name); + + /** + * Delete a IamVirtualMFADevice. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of IamVirtualMFADevice. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String name, Context context); + + /** + * Delete a IamVirtualMFADevice. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of IamVirtualMFADevice. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String name); + + /** + * Delete a IamVirtualMFADevice. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of IamVirtualMFADevice. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String name, Context context); +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/KmsAliasesClient.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/KmsAliasesClient.java new file mode 100644 index 000000000000..136c323e97a9 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/KmsAliasesClient.java @@ -0,0 +1,270 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.awsconnector.fluent.models.KmsAliasInner; +import com.azure.resourcemanager.awsconnector.models.KmsAliasTagsUpdate; + +/** + * An instance of this class provides access to all the operations defined in KmsAliasesClient. + */ +public interface KmsAliasesClient { + /** + * List KmsAlias resources by subscription ID. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a KmsAlias list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * List KmsAlias resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a KmsAlias list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(Context context); + + /** + * List KmsAlias resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a KmsAlias list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * List KmsAlias resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a KmsAlias list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Get a KmsAlias. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of KmsAlias. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a KmsAlias along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getByResourceGroupWithResponse(String resourceGroupName, String name, Context context); + + /** + * Get a KmsAlias. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of KmsAlias. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a KmsAlias. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + KmsAliasInner getByResourceGroup(String resourceGroupName, String name); + + /** + * Create a KmsAlias. Please note that end user resource creation is currently restricted, but it will be enabled in + * the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of KmsAlias. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, KmsAliasInner> beginCreateOrReplace(String resourceGroupName, String name, + KmsAliasInner resource); + + /** + * Create a KmsAlias. Please note that end user resource creation is currently restricted, but it will be enabled in + * the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of KmsAlias. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, KmsAliasInner> beginCreateOrReplace(String resourceGroupName, String name, + KmsAliasInner resource, Context context); + + /** + * Create a KmsAlias. Please note that end user resource creation is currently restricted, but it will be enabled in + * the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of KmsAlias. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + KmsAliasInner createOrReplace(String resourceGroupName, String name, KmsAliasInner resource); + + /** + * Create a KmsAlias. Please note that end user resource creation is currently restricted, but it will be enabled in + * the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of KmsAlias. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + KmsAliasInner createOrReplace(String resourceGroupName, String name, KmsAliasInner resource, Context context); + + /** + * Update a KmsAlias. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of KmsAlias. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, KmsAliasInner> beginUpdate(String resourceGroupName, String name, + KmsAliasTagsUpdate properties); + + /** + * Update a KmsAlias. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of KmsAlias. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, KmsAliasInner> beginUpdate(String resourceGroupName, String name, + KmsAliasTagsUpdate properties, Context context); + + /** + * Update a KmsAlias. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of KmsAlias. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + KmsAliasInner update(String resourceGroupName, String name, KmsAliasTagsUpdate properties); + + /** + * Update a KmsAlias. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of KmsAlias. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + KmsAliasInner update(String resourceGroupName, String name, KmsAliasTagsUpdate properties, Context context); + + /** + * Delete a KmsAlias. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of KmsAlias. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String name); + + /** + * Delete a KmsAlias. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of KmsAlias. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String name, Context context); + + /** + * Delete a KmsAlias. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of KmsAlias. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String name); + + /** + * Delete a KmsAlias. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of KmsAlias. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String name, Context context); +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/KmsKeysClient.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/KmsKeysClient.java new file mode 100644 index 000000000000..a4d1669c54b4 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/KmsKeysClient.java @@ -0,0 +1,270 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.awsconnector.fluent.models.KmsKeyInner; +import com.azure.resourcemanager.awsconnector.models.KmsKeyTagsUpdate; + +/** + * An instance of this class provides access to all the operations defined in KmsKeysClient. + */ +public interface KmsKeysClient { + /** + * List KmsKey resources by subscription ID. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a KmsKey list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * List KmsKey resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a KmsKey list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(Context context); + + /** + * List KmsKey resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a KmsKey list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * List KmsKey resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a KmsKey list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Get a KmsKey. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of KmsKey. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a KmsKey along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getByResourceGroupWithResponse(String resourceGroupName, String name, Context context); + + /** + * Get a KmsKey. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of KmsKey. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a KmsKey. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + KmsKeyInner getByResourceGroup(String resourceGroupName, String name); + + /** + * Create a KmsKey. Please note that end user resource creation is currently restricted, but it will be enabled in + * the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of KmsKey. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, KmsKeyInner> beginCreateOrReplace(String resourceGroupName, String name, + KmsKeyInner resource); + + /** + * Create a KmsKey. Please note that end user resource creation is currently restricted, but it will be enabled in + * the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of KmsKey. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, KmsKeyInner> beginCreateOrReplace(String resourceGroupName, String name, + KmsKeyInner resource, Context context); + + /** + * Create a KmsKey. Please note that end user resource creation is currently restricted, but it will be enabled in + * the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of KmsKey. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + KmsKeyInner createOrReplace(String resourceGroupName, String name, KmsKeyInner resource); + + /** + * Create a KmsKey. Please note that end user resource creation is currently restricted, but it will be enabled in + * the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of KmsKey. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + KmsKeyInner createOrReplace(String resourceGroupName, String name, KmsKeyInner resource, Context context); + + /** + * Update a KmsKey. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of KmsKey. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, KmsKeyInner> beginUpdate(String resourceGroupName, String name, + KmsKeyTagsUpdate properties); + + /** + * Update a KmsKey. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of KmsKey. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, KmsKeyInner> beginUpdate(String resourceGroupName, String name, + KmsKeyTagsUpdate properties, Context context); + + /** + * Update a KmsKey. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of KmsKey. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + KmsKeyInner update(String resourceGroupName, String name, KmsKeyTagsUpdate properties); + + /** + * Update a KmsKey. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of KmsKey. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + KmsKeyInner update(String resourceGroupName, String name, KmsKeyTagsUpdate properties, Context context); + + /** + * Delete a KmsKey. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of KmsKey. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String name); + + /** + * Delete a KmsKey. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of KmsKey. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String name, Context context); + + /** + * Delete a KmsKey. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of KmsKey. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String name); + + /** + * Delete a KmsKey. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of KmsKey. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String name, Context context); +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/LambdaFunctionCodeLocationsClient.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/LambdaFunctionCodeLocationsClient.java new file mode 100644 index 000000000000..788fefffd9a1 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/LambdaFunctionCodeLocationsClient.java @@ -0,0 +1,279 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.awsconnector.fluent.models.LambdaFunctionCodeLocationInner; +import com.azure.resourcemanager.awsconnector.models.LambdaFunctionCodeLocationTagsUpdate; + +/** + * An instance of this class provides access to all the operations defined in LambdaFunctionCodeLocationsClient. + */ +public interface LambdaFunctionCodeLocationsClient { + /** + * List LambdaFunctionCodeLocation resources by subscription ID. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a LambdaFunctionCodeLocation list operation as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * List LambdaFunctionCodeLocation resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a LambdaFunctionCodeLocation list operation as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(Context context); + + /** + * List LambdaFunctionCodeLocation resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a LambdaFunctionCodeLocation list operation as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * List LambdaFunctionCodeLocation resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a LambdaFunctionCodeLocation list operation as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Get a LambdaFunctionCodeLocation. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of LambdaFunctionCodeLocation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a LambdaFunctionCodeLocation along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getByResourceGroupWithResponse(String resourceGroupName, String name, + Context context); + + /** + * Get a LambdaFunctionCodeLocation. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of LambdaFunctionCodeLocation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a LambdaFunctionCodeLocation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + LambdaFunctionCodeLocationInner getByResourceGroup(String resourceGroupName, String name); + + /** + * Create a LambdaFunctionCodeLocation. Please note that end user resource creation is currently restricted, but it + * will be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of LambdaFunctionCodeLocation. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, LambdaFunctionCodeLocationInner> + beginCreateOrReplace(String resourceGroupName, String name, LambdaFunctionCodeLocationInner resource); + + /** + * Create a LambdaFunctionCodeLocation. Please note that end user resource creation is currently restricted, but it + * will be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of LambdaFunctionCodeLocation. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, LambdaFunctionCodeLocationInner> beginCreateOrReplace( + String resourceGroupName, String name, LambdaFunctionCodeLocationInner resource, Context context); + + /** + * Create a LambdaFunctionCodeLocation. Please note that end user resource creation is currently restricted, but it + * will be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of LambdaFunctionCodeLocation. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + LambdaFunctionCodeLocationInner createOrReplace(String resourceGroupName, String name, + LambdaFunctionCodeLocationInner resource); + + /** + * Create a LambdaFunctionCodeLocation. Please note that end user resource creation is currently restricted, but it + * will be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of LambdaFunctionCodeLocation. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + LambdaFunctionCodeLocationInner createOrReplace(String resourceGroupName, String name, + LambdaFunctionCodeLocationInner resource, Context context); + + /** + * Update a LambdaFunctionCodeLocation. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of LambdaFunctionCodeLocation. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, LambdaFunctionCodeLocationInner> + beginUpdate(String resourceGroupName, String name, LambdaFunctionCodeLocationTagsUpdate properties); + + /** + * Update a LambdaFunctionCodeLocation. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of LambdaFunctionCodeLocation. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, LambdaFunctionCodeLocationInner> beginUpdate( + String resourceGroupName, String name, LambdaFunctionCodeLocationTagsUpdate properties, Context context); + + /** + * Update a LambdaFunctionCodeLocation. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of LambdaFunctionCodeLocation. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + LambdaFunctionCodeLocationInner update(String resourceGroupName, String name, + LambdaFunctionCodeLocationTagsUpdate properties); + + /** + * Update a LambdaFunctionCodeLocation. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of LambdaFunctionCodeLocation. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + LambdaFunctionCodeLocationInner update(String resourceGroupName, String name, + LambdaFunctionCodeLocationTagsUpdate properties, Context context); + + /** + * Delete a LambdaFunctionCodeLocation. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of LambdaFunctionCodeLocation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String name); + + /** + * Delete a LambdaFunctionCodeLocation. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of LambdaFunctionCodeLocation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String name, Context context); + + /** + * Delete a LambdaFunctionCodeLocation. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of LambdaFunctionCodeLocation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String name); + + /** + * Delete a LambdaFunctionCodeLocation. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of LambdaFunctionCodeLocation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String name, Context context); +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/LambdaFunctionsClient.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/LambdaFunctionsClient.java new file mode 100644 index 000000000000..ab0984cd6e1e --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/LambdaFunctionsClient.java @@ -0,0 +1,273 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.awsconnector.fluent.models.LambdaFunctionInner; +import com.azure.resourcemanager.awsconnector.models.LambdaFunctionTagsUpdate; + +/** + * An instance of this class provides access to all the operations defined in LambdaFunctionsClient. + */ +public interface LambdaFunctionsClient { + /** + * List LambdaFunction resources by subscription ID. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a LambdaFunction list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * List LambdaFunction resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a LambdaFunction list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(Context context); + + /** + * List LambdaFunction resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a LambdaFunction list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * List LambdaFunction resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a LambdaFunction list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Get a LambdaFunction. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of LambdaFunction. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a LambdaFunction along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getByResourceGroupWithResponse(String resourceGroupName, String name, + Context context); + + /** + * Get a LambdaFunction. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of LambdaFunction. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a LambdaFunction. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + LambdaFunctionInner getByResourceGroup(String resourceGroupName, String name); + + /** + * Create a LambdaFunction. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of LambdaFunction. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, LambdaFunctionInner> beginCreateOrReplace(String resourceGroupName, + String name, LambdaFunctionInner resource); + + /** + * Create a LambdaFunction. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of LambdaFunction. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, LambdaFunctionInner> beginCreateOrReplace(String resourceGroupName, + String name, LambdaFunctionInner resource, Context context); + + /** + * Create a LambdaFunction. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of LambdaFunction. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + LambdaFunctionInner createOrReplace(String resourceGroupName, String name, LambdaFunctionInner resource); + + /** + * Create a LambdaFunction. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of LambdaFunction. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + LambdaFunctionInner createOrReplace(String resourceGroupName, String name, LambdaFunctionInner resource, + Context context); + + /** + * Update a LambdaFunction. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of LambdaFunction. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, LambdaFunctionInner> beginUpdate(String resourceGroupName, String name, + LambdaFunctionTagsUpdate properties); + + /** + * Update a LambdaFunction. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of LambdaFunction. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, LambdaFunctionInner> beginUpdate(String resourceGroupName, String name, + LambdaFunctionTagsUpdate properties, Context context); + + /** + * Update a LambdaFunction. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of LambdaFunction. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + LambdaFunctionInner update(String resourceGroupName, String name, LambdaFunctionTagsUpdate properties); + + /** + * Update a LambdaFunction. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of LambdaFunction. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + LambdaFunctionInner update(String resourceGroupName, String name, LambdaFunctionTagsUpdate properties, + Context context); + + /** + * Delete a LambdaFunction. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of LambdaFunction. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String name); + + /** + * Delete a LambdaFunction. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of LambdaFunction. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String name, Context context); + + /** + * Delete a LambdaFunction. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of LambdaFunction. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String name); + + /** + * Delete a LambdaFunction. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of LambdaFunction. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String name, Context context); +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/LightsailBucketsClient.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/LightsailBucketsClient.java new file mode 100644 index 000000000000..70ab0d41f026 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/LightsailBucketsClient.java @@ -0,0 +1,273 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.awsconnector.fluent.models.LightsailBucketInner; +import com.azure.resourcemanager.awsconnector.models.LightsailBucketTagsUpdate; + +/** + * An instance of this class provides access to all the operations defined in LightsailBucketsClient. + */ +public interface LightsailBucketsClient { + /** + * List LightsailBucket resources by subscription ID. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a LightsailBucket list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * List LightsailBucket resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a LightsailBucket list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(Context context); + + /** + * List LightsailBucket resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a LightsailBucket list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * List LightsailBucket resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a LightsailBucket list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Get a LightsailBucket. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of LightsailBucket. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a LightsailBucket along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getByResourceGroupWithResponse(String resourceGroupName, String name, + Context context); + + /** + * Get a LightsailBucket. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of LightsailBucket. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a LightsailBucket. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + LightsailBucketInner getByResourceGroup(String resourceGroupName, String name); + + /** + * Create a LightsailBucket. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of LightsailBucket. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, LightsailBucketInner> beginCreateOrReplace(String resourceGroupName, + String name, LightsailBucketInner resource); + + /** + * Create a LightsailBucket. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of LightsailBucket. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, LightsailBucketInner> beginCreateOrReplace(String resourceGroupName, + String name, LightsailBucketInner resource, Context context); + + /** + * Create a LightsailBucket. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of LightsailBucket. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + LightsailBucketInner createOrReplace(String resourceGroupName, String name, LightsailBucketInner resource); + + /** + * Create a LightsailBucket. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of LightsailBucket. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + LightsailBucketInner createOrReplace(String resourceGroupName, String name, LightsailBucketInner resource, + Context context); + + /** + * Update a LightsailBucket. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of LightsailBucket. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, LightsailBucketInner> beginUpdate(String resourceGroupName, + String name, LightsailBucketTagsUpdate properties); + + /** + * Update a LightsailBucket. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of LightsailBucket. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, LightsailBucketInner> beginUpdate(String resourceGroupName, + String name, LightsailBucketTagsUpdate properties, Context context); + + /** + * Update a LightsailBucket. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of LightsailBucket. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + LightsailBucketInner update(String resourceGroupName, String name, LightsailBucketTagsUpdate properties); + + /** + * Update a LightsailBucket. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of LightsailBucket. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + LightsailBucketInner update(String resourceGroupName, String name, LightsailBucketTagsUpdate properties, + Context context); + + /** + * Delete a LightsailBucket. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of LightsailBucket. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String name); + + /** + * Delete a LightsailBucket. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of LightsailBucket. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String name, Context context); + + /** + * Delete a LightsailBucket. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of LightsailBucket. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String name); + + /** + * Delete a LightsailBucket. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of LightsailBucket. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String name, Context context); +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/LightsailInstancesClient.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/LightsailInstancesClient.java new file mode 100644 index 000000000000..eec24d29cb2e --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/LightsailInstancesClient.java @@ -0,0 +1,273 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.awsconnector.fluent.models.LightsailInstanceInner; +import com.azure.resourcemanager.awsconnector.models.LightsailInstanceTagsUpdate; + +/** + * An instance of this class provides access to all the operations defined in LightsailInstancesClient. + */ +public interface LightsailInstancesClient { + /** + * List LightsailInstance resources by subscription ID. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a LightsailInstance list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * List LightsailInstance resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a LightsailInstance list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(Context context); + + /** + * List LightsailInstance resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a LightsailInstance list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * List LightsailInstance resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a LightsailInstance list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Get a LightsailInstance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of LightsailInstance. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a LightsailInstance along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getByResourceGroupWithResponse(String resourceGroupName, String name, + Context context); + + /** + * Get a LightsailInstance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of LightsailInstance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a LightsailInstance. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + LightsailInstanceInner getByResourceGroup(String resourceGroupName, String name); + + /** + * Create a LightsailInstance. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of LightsailInstance. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, LightsailInstanceInner> + beginCreateOrReplace(String resourceGroupName, String name, LightsailInstanceInner resource); + + /** + * Create a LightsailInstance. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of LightsailInstance. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, LightsailInstanceInner> + beginCreateOrReplace(String resourceGroupName, String name, LightsailInstanceInner resource, Context context); + + /** + * Create a LightsailInstance. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of LightsailInstance. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + LightsailInstanceInner createOrReplace(String resourceGroupName, String name, LightsailInstanceInner resource); + + /** + * Create a LightsailInstance. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of LightsailInstance. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + LightsailInstanceInner createOrReplace(String resourceGroupName, String name, LightsailInstanceInner resource, + Context context); + + /** + * Update a LightsailInstance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of LightsailInstance. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, LightsailInstanceInner> beginUpdate(String resourceGroupName, + String name, LightsailInstanceTagsUpdate properties); + + /** + * Update a LightsailInstance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of LightsailInstance. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, LightsailInstanceInner> beginUpdate(String resourceGroupName, + String name, LightsailInstanceTagsUpdate properties, Context context); + + /** + * Update a LightsailInstance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of LightsailInstance. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + LightsailInstanceInner update(String resourceGroupName, String name, LightsailInstanceTagsUpdate properties); + + /** + * Update a LightsailInstance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of LightsailInstance. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + LightsailInstanceInner update(String resourceGroupName, String name, LightsailInstanceTagsUpdate properties, + Context context); + + /** + * Delete a LightsailInstance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of LightsailInstance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String name); + + /** + * Delete a LightsailInstance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of LightsailInstance. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String name, Context context); + + /** + * Delete a LightsailInstance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of LightsailInstance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String name); + + /** + * Delete a LightsailInstance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of LightsailInstance. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String name, Context context); +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/LogsLogGroupsClient.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/LogsLogGroupsClient.java new file mode 100644 index 000000000000..81a149125983 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/LogsLogGroupsClient.java @@ -0,0 +1,271 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.awsconnector.fluent.models.LogsLogGroupInner; +import com.azure.resourcemanager.awsconnector.models.LogsLogGroupTagsUpdate; + +/** + * An instance of this class provides access to all the operations defined in LogsLogGroupsClient. + */ +public interface LogsLogGroupsClient { + /** + * List LogsLogGroup resources by subscription ID. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a LogsLogGroup list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * List LogsLogGroup resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a LogsLogGroup list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(Context context); + + /** + * List LogsLogGroup resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a LogsLogGroup list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * List LogsLogGroup resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a LogsLogGroup list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Get a LogsLogGroup. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of LogsLogGroup. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a LogsLogGroup along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getByResourceGroupWithResponse(String resourceGroupName, String name, Context context); + + /** + * Get a LogsLogGroup. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of LogsLogGroup. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a LogsLogGroup. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + LogsLogGroupInner getByResourceGroup(String resourceGroupName, String name); + + /** + * Create a LogsLogGroup. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of LogsLogGroup. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, LogsLogGroupInner> beginCreateOrReplace(String resourceGroupName, + String name, LogsLogGroupInner resource); + + /** + * Create a LogsLogGroup. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of LogsLogGroup. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, LogsLogGroupInner> beginCreateOrReplace(String resourceGroupName, + String name, LogsLogGroupInner resource, Context context); + + /** + * Create a LogsLogGroup. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of LogsLogGroup. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + LogsLogGroupInner createOrReplace(String resourceGroupName, String name, LogsLogGroupInner resource); + + /** + * Create a LogsLogGroup. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of LogsLogGroup. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + LogsLogGroupInner createOrReplace(String resourceGroupName, String name, LogsLogGroupInner resource, + Context context); + + /** + * Update a LogsLogGroup. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of LogsLogGroup. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, LogsLogGroupInner> beginUpdate(String resourceGroupName, String name, + LogsLogGroupTagsUpdate properties); + + /** + * Update a LogsLogGroup. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of LogsLogGroup. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, LogsLogGroupInner> beginUpdate(String resourceGroupName, String name, + LogsLogGroupTagsUpdate properties, Context context); + + /** + * Update a LogsLogGroup. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of LogsLogGroup. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + LogsLogGroupInner update(String resourceGroupName, String name, LogsLogGroupTagsUpdate properties); + + /** + * Update a LogsLogGroup. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of LogsLogGroup. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + LogsLogGroupInner update(String resourceGroupName, String name, LogsLogGroupTagsUpdate properties, Context context); + + /** + * Delete a LogsLogGroup. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of LogsLogGroup. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String name); + + /** + * Delete a LogsLogGroup. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of LogsLogGroup. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String name, Context context); + + /** + * Delete a LogsLogGroup. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of LogsLogGroup. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String name); + + /** + * Delete a LogsLogGroup. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of LogsLogGroup. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String name, Context context); +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/LogsLogStreamsClient.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/LogsLogStreamsClient.java new file mode 100644 index 000000000000..5fd3c33bf02d --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/LogsLogStreamsClient.java @@ -0,0 +1,272 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.awsconnector.fluent.models.LogsLogStreamInner; +import com.azure.resourcemanager.awsconnector.models.LogsLogStreamTagsUpdate; + +/** + * An instance of this class provides access to all the operations defined in LogsLogStreamsClient. + */ +public interface LogsLogStreamsClient { + /** + * List LogsLogStream resources by subscription ID. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a LogsLogStream list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * List LogsLogStream resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a LogsLogStream list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(Context context); + + /** + * List LogsLogStream resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a LogsLogStream list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * List LogsLogStream resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a LogsLogStream list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Get a LogsLogStream. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of LogsLogStream. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a LogsLogStream along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getByResourceGroupWithResponse(String resourceGroupName, String name, Context context); + + /** + * Get a LogsLogStream. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of LogsLogStream. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a LogsLogStream. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + LogsLogStreamInner getByResourceGroup(String resourceGroupName, String name); + + /** + * Create a LogsLogStream. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of LogsLogStream. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, LogsLogStreamInner> beginCreateOrReplace(String resourceGroupName, + String name, LogsLogStreamInner resource); + + /** + * Create a LogsLogStream. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of LogsLogStream. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, LogsLogStreamInner> beginCreateOrReplace(String resourceGroupName, + String name, LogsLogStreamInner resource, Context context); + + /** + * Create a LogsLogStream. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of LogsLogStream. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + LogsLogStreamInner createOrReplace(String resourceGroupName, String name, LogsLogStreamInner resource); + + /** + * Create a LogsLogStream. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of LogsLogStream. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + LogsLogStreamInner createOrReplace(String resourceGroupName, String name, LogsLogStreamInner resource, + Context context); + + /** + * Update a LogsLogStream. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of LogsLogStream. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, LogsLogStreamInner> beginUpdate(String resourceGroupName, String name, + LogsLogStreamTagsUpdate properties); + + /** + * Update a LogsLogStream. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of LogsLogStream. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, LogsLogStreamInner> beginUpdate(String resourceGroupName, String name, + LogsLogStreamTagsUpdate properties, Context context); + + /** + * Update a LogsLogStream. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of LogsLogStream. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + LogsLogStreamInner update(String resourceGroupName, String name, LogsLogStreamTagsUpdate properties); + + /** + * Update a LogsLogStream. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of LogsLogStream. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + LogsLogStreamInner update(String resourceGroupName, String name, LogsLogStreamTagsUpdate properties, + Context context); + + /** + * Delete a LogsLogStream. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of LogsLogStream. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String name); + + /** + * Delete a LogsLogStream. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of LogsLogStream. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String name, Context context); + + /** + * Delete a LogsLogStream. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of LogsLogStream. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String name); + + /** + * Delete a LogsLogStream. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of LogsLogStream. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String name, Context context); +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/LogsMetricFiltersClient.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/LogsMetricFiltersClient.java new file mode 100644 index 000000000000..0f252b2badf6 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/LogsMetricFiltersClient.java @@ -0,0 +1,273 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.awsconnector.fluent.models.LogsMetricFilterInner; +import com.azure.resourcemanager.awsconnector.models.LogsMetricFilterTagsUpdate; + +/** + * An instance of this class provides access to all the operations defined in LogsMetricFiltersClient. + */ +public interface LogsMetricFiltersClient { + /** + * List LogsMetricFilter resources by subscription ID. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a LogsMetricFilter list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * List LogsMetricFilter resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a LogsMetricFilter list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(Context context); + + /** + * List LogsMetricFilter resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a LogsMetricFilter list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * List LogsMetricFilter resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a LogsMetricFilter list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Get a LogsMetricFilter. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of LogsMetricFilter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a LogsMetricFilter along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getByResourceGroupWithResponse(String resourceGroupName, String name, + Context context); + + /** + * Get a LogsMetricFilter. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of LogsMetricFilter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a LogsMetricFilter. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + LogsMetricFilterInner getByResourceGroup(String resourceGroupName, String name); + + /** + * Create a LogsMetricFilter. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of LogsMetricFilter. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, LogsMetricFilterInner> beginCreateOrReplace(String resourceGroupName, + String name, LogsMetricFilterInner resource); + + /** + * Create a LogsMetricFilter. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of LogsMetricFilter. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, LogsMetricFilterInner> beginCreateOrReplace(String resourceGroupName, + String name, LogsMetricFilterInner resource, Context context); + + /** + * Create a LogsMetricFilter. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of LogsMetricFilter. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + LogsMetricFilterInner createOrReplace(String resourceGroupName, String name, LogsMetricFilterInner resource); + + /** + * Create a LogsMetricFilter. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of LogsMetricFilter. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + LogsMetricFilterInner createOrReplace(String resourceGroupName, String name, LogsMetricFilterInner resource, + Context context); + + /** + * Update a LogsMetricFilter. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of LogsMetricFilter. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, LogsMetricFilterInner> beginUpdate(String resourceGroupName, + String name, LogsMetricFilterTagsUpdate properties); + + /** + * Update a LogsMetricFilter. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of LogsMetricFilter. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, LogsMetricFilterInner> beginUpdate(String resourceGroupName, + String name, LogsMetricFilterTagsUpdate properties, Context context); + + /** + * Update a LogsMetricFilter. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of LogsMetricFilter. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + LogsMetricFilterInner update(String resourceGroupName, String name, LogsMetricFilterTagsUpdate properties); + + /** + * Update a LogsMetricFilter. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of LogsMetricFilter. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + LogsMetricFilterInner update(String resourceGroupName, String name, LogsMetricFilterTagsUpdate properties, + Context context); + + /** + * Delete a LogsMetricFilter. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of LogsMetricFilter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String name); + + /** + * Delete a LogsMetricFilter. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of LogsMetricFilter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String name, Context context); + + /** + * Delete a LogsMetricFilter. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of LogsMetricFilter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String name); + + /** + * Delete a LogsMetricFilter. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of LogsMetricFilter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String name, Context context); +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/LogsSubscriptionFiltersClient.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/LogsSubscriptionFiltersClient.java new file mode 100644 index 000000000000..bd6a67cb220b --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/LogsSubscriptionFiltersClient.java @@ -0,0 +1,275 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.awsconnector.fluent.models.LogsSubscriptionFilterInner; +import com.azure.resourcemanager.awsconnector.models.LogsSubscriptionFilterTagsUpdate; + +/** + * An instance of this class provides access to all the operations defined in LogsSubscriptionFiltersClient. + */ +public interface LogsSubscriptionFiltersClient { + /** + * List LogsSubscriptionFilter resources by subscription ID. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a LogsSubscriptionFilter list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * List LogsSubscriptionFilter resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a LogsSubscriptionFilter list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(Context context); + + /** + * List LogsSubscriptionFilter resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a LogsSubscriptionFilter list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * List LogsSubscriptionFilter resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a LogsSubscriptionFilter list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Get a LogsSubscriptionFilter. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of LogsSubscriptionFilter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a LogsSubscriptionFilter along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getByResourceGroupWithResponse(String resourceGroupName, String name, + Context context); + + /** + * Get a LogsSubscriptionFilter. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of LogsSubscriptionFilter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a LogsSubscriptionFilter. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + LogsSubscriptionFilterInner getByResourceGroup(String resourceGroupName, String name); + + /** + * Create a LogsSubscriptionFilter. Please note that end user resource creation is currently restricted, but it will + * be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of LogsSubscriptionFilter. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, LogsSubscriptionFilterInner> + beginCreateOrReplace(String resourceGroupName, String name, LogsSubscriptionFilterInner resource); + + /** + * Create a LogsSubscriptionFilter. Please note that end user resource creation is currently restricted, but it will + * be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of LogsSubscriptionFilter. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, LogsSubscriptionFilterInner> beginCreateOrReplace( + String resourceGroupName, String name, LogsSubscriptionFilterInner resource, Context context); + + /** + * Create a LogsSubscriptionFilter. Please note that end user resource creation is currently restricted, but it will + * be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of LogsSubscriptionFilter. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + LogsSubscriptionFilterInner createOrReplace(String resourceGroupName, String name, + LogsSubscriptionFilterInner resource); + + /** + * Create a LogsSubscriptionFilter. Please note that end user resource creation is currently restricted, but it will + * be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of LogsSubscriptionFilter. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + LogsSubscriptionFilterInner createOrReplace(String resourceGroupName, String name, + LogsSubscriptionFilterInner resource, Context context); + + /** + * Update a LogsSubscriptionFilter. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of LogsSubscriptionFilter. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, LogsSubscriptionFilterInner> + beginUpdate(String resourceGroupName, String name, LogsSubscriptionFilterTagsUpdate properties); + + /** + * Update a LogsSubscriptionFilter. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of LogsSubscriptionFilter. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, LogsSubscriptionFilterInner> beginUpdate( + String resourceGroupName, String name, LogsSubscriptionFilterTagsUpdate properties, Context context); + + /** + * Update a LogsSubscriptionFilter. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of LogsSubscriptionFilter. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + LogsSubscriptionFilterInner update(String resourceGroupName, String name, + LogsSubscriptionFilterTagsUpdate properties); + + /** + * Update a LogsSubscriptionFilter. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of LogsSubscriptionFilter. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + LogsSubscriptionFilterInner update(String resourceGroupName, String name, + LogsSubscriptionFilterTagsUpdate properties, Context context); + + /** + * Delete a LogsSubscriptionFilter. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of LogsSubscriptionFilter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String name); + + /** + * Delete a LogsSubscriptionFilter. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of LogsSubscriptionFilter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String name, Context context); + + /** + * Delete a LogsSubscriptionFilter. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of LogsSubscriptionFilter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String name); + + /** + * Delete a LogsSubscriptionFilter. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of LogsSubscriptionFilter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String name, Context context); +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/Macie2JobSummariesClient.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/Macie2JobSummariesClient.java new file mode 100644 index 000000000000..b8355e236d74 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/Macie2JobSummariesClient.java @@ -0,0 +1,273 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.awsconnector.fluent.models.Macie2JobSummaryInner; +import com.azure.resourcemanager.awsconnector.models.Macie2JobSummaryTagsUpdate; + +/** + * An instance of this class provides access to all the operations defined in Macie2JobSummariesClient. + */ +public interface Macie2JobSummariesClient { + /** + * List Macie2JobSummary resources by subscription ID. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Macie2JobSummary list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * List Macie2JobSummary resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Macie2JobSummary list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(Context context); + + /** + * List Macie2JobSummary resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Macie2JobSummary list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * List Macie2JobSummary resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Macie2JobSummary list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Get a Macie2JobSummary. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Macie2JobSummary. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Macie2JobSummary along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getByResourceGroupWithResponse(String resourceGroupName, String name, + Context context); + + /** + * Get a Macie2JobSummary. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Macie2JobSummary. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Macie2JobSummary. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Macie2JobSummaryInner getByResourceGroup(String resourceGroupName, String name); + + /** + * Create a Macie2JobSummary. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Macie2JobSummary. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Macie2JobSummaryInner> beginCreateOrReplace(String resourceGroupName, + String name, Macie2JobSummaryInner resource); + + /** + * Create a Macie2JobSummary. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Macie2JobSummary. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Macie2JobSummaryInner> beginCreateOrReplace(String resourceGroupName, + String name, Macie2JobSummaryInner resource, Context context); + + /** + * Create a Macie2JobSummary. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Macie2JobSummary. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Macie2JobSummaryInner createOrReplace(String resourceGroupName, String name, Macie2JobSummaryInner resource); + + /** + * Create a Macie2JobSummary. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Macie2JobSummary. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Macie2JobSummaryInner createOrReplace(String resourceGroupName, String name, Macie2JobSummaryInner resource, + Context context); + + /** + * Update a Macie2JobSummary. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Macie2JobSummary. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Macie2JobSummaryInner> beginUpdate(String resourceGroupName, + String name, Macie2JobSummaryTagsUpdate properties); + + /** + * Update a Macie2JobSummary. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Macie2JobSummary. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Macie2JobSummaryInner> beginUpdate(String resourceGroupName, + String name, Macie2JobSummaryTagsUpdate properties, Context context); + + /** + * Update a Macie2JobSummary. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Macie2JobSummary. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Macie2JobSummaryInner update(String resourceGroupName, String name, Macie2JobSummaryTagsUpdate properties); + + /** + * Update a Macie2JobSummary. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Macie2JobSummary. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Macie2JobSummaryInner update(String resourceGroupName, String name, Macie2JobSummaryTagsUpdate properties, + Context context); + + /** + * Delete a Macie2JobSummary. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Macie2JobSummary. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String name); + + /** + * Delete a Macie2JobSummary. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Macie2JobSummary. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String name, Context context); + + /** + * Delete a Macie2JobSummary. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Macie2JobSummary. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String name); + + /** + * Delete a Macie2JobSummary. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Macie2JobSummary. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String name, Context context); +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/MacieAllowListsClient.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/MacieAllowListsClient.java new file mode 100644 index 000000000000..15b4df9e4654 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/MacieAllowListsClient.java @@ -0,0 +1,273 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.awsconnector.fluent.models.MacieAllowListInner; +import com.azure.resourcemanager.awsconnector.models.MacieAllowListTagsUpdate; + +/** + * An instance of this class provides access to all the operations defined in MacieAllowListsClient. + */ +public interface MacieAllowListsClient { + /** + * List MacieAllowList resources by subscription ID. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a MacieAllowList list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * List MacieAllowList resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a MacieAllowList list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(Context context); + + /** + * List MacieAllowList resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a MacieAllowList list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * List MacieAllowList resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a MacieAllowList list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Get a MacieAllowList. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of MacieAllowList. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a MacieAllowList along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getByResourceGroupWithResponse(String resourceGroupName, String name, + Context context); + + /** + * Get a MacieAllowList. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of MacieAllowList. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a MacieAllowList. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + MacieAllowListInner getByResourceGroup(String resourceGroupName, String name); + + /** + * Create a MacieAllowList. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of MacieAllowList. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, MacieAllowListInner> beginCreateOrReplace(String resourceGroupName, + String name, MacieAllowListInner resource); + + /** + * Create a MacieAllowList. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of MacieAllowList. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, MacieAllowListInner> beginCreateOrReplace(String resourceGroupName, + String name, MacieAllowListInner resource, Context context); + + /** + * Create a MacieAllowList. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of MacieAllowList. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + MacieAllowListInner createOrReplace(String resourceGroupName, String name, MacieAllowListInner resource); + + /** + * Create a MacieAllowList. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of MacieAllowList. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + MacieAllowListInner createOrReplace(String resourceGroupName, String name, MacieAllowListInner resource, + Context context); + + /** + * Update a MacieAllowList. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of MacieAllowList. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, MacieAllowListInner> beginUpdate(String resourceGroupName, String name, + MacieAllowListTagsUpdate properties); + + /** + * Update a MacieAllowList. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of MacieAllowList. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, MacieAllowListInner> beginUpdate(String resourceGroupName, String name, + MacieAllowListTagsUpdate properties, Context context); + + /** + * Update a MacieAllowList. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of MacieAllowList. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + MacieAllowListInner update(String resourceGroupName, String name, MacieAllowListTagsUpdate properties); + + /** + * Update a MacieAllowList. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of MacieAllowList. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + MacieAllowListInner update(String resourceGroupName, String name, MacieAllowListTagsUpdate properties, + Context context); + + /** + * Delete a MacieAllowList. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of MacieAllowList. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String name); + + /** + * Delete a MacieAllowList. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of MacieAllowList. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String name, Context context); + + /** + * Delete a MacieAllowList. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of MacieAllowList. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String name); + + /** + * Delete a MacieAllowList. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of MacieAllowList. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String name, Context context); +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/MicrosoftAwsConnector.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/MicrosoftAwsConnector.java new file mode 100644 index 000000000000..40a424fd832e --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/MicrosoftAwsConnector.java @@ -0,0 +1,839 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.fluent; + +import com.azure.core.http.HttpPipeline; +import java.time.Duration; + +/** + * The interface for MicrosoftAwsConnector class. + */ +public interface MicrosoftAwsConnector { + /** + * Gets The ID of the target subscription. The value must be an UUID. + * + * @return the subscriptionId value. + */ + String getSubscriptionId(); + + /** + * Gets server parameter. + * + * @return the endpoint value. + */ + String getEndpoint(); + + /** + * Gets Api Version. + * + * @return the apiVersion value. + */ + String getApiVersion(); + + /** + * Gets The HTTP pipeline to send requests through. + * + * @return the httpPipeline value. + */ + HttpPipeline getHttpPipeline(); + + /** + * Gets The default poll interval for long-running operation. + * + * @return the defaultPollInterval value. + */ + Duration getDefaultPollInterval(); + + /** + * Gets the AccessAnalyzerAnalyzersClient object to access its operations. + * + * @return the AccessAnalyzerAnalyzersClient object. + */ + AccessAnalyzerAnalyzersClient getAccessAnalyzerAnalyzers(); + + /** + * Gets the AcmCertificateSummariesClient object to access its operations. + * + * @return the AcmCertificateSummariesClient object. + */ + AcmCertificateSummariesClient getAcmCertificateSummaries(); + + /** + * Gets the ApiGatewayRestApisClient object to access its operations. + * + * @return the ApiGatewayRestApisClient object. + */ + ApiGatewayRestApisClient getApiGatewayRestApis(); + + /** + * Gets the ApiGatewayStagesClient object to access its operations. + * + * @return the ApiGatewayStagesClient object. + */ + ApiGatewayStagesClient getApiGatewayStages(); + + /** + * Gets the AppSyncGraphqlApisClient object to access its operations. + * + * @return the AppSyncGraphqlApisClient object. + */ + AppSyncGraphqlApisClient getAppSyncGraphqlApis(); + + /** + * Gets the AutoScalingAutoScalingGroupsClient object to access its operations. + * + * @return the AutoScalingAutoScalingGroupsClient object. + */ + AutoScalingAutoScalingGroupsClient getAutoScalingAutoScalingGroups(); + + /** + * Gets the CloudFormationStacksClient object to access its operations. + * + * @return the CloudFormationStacksClient object. + */ + CloudFormationStacksClient getCloudFormationStacks(); + + /** + * Gets the CloudFormationStackSetsClient object to access its operations. + * + * @return the CloudFormationStackSetsClient object. + */ + CloudFormationStackSetsClient getCloudFormationStackSets(); + + /** + * Gets the CloudFrontDistributionsClient object to access its operations. + * + * @return the CloudFrontDistributionsClient object. + */ + CloudFrontDistributionsClient getCloudFrontDistributions(); + + /** + * Gets the CloudTrailTrailsClient object to access its operations. + * + * @return the CloudTrailTrailsClient object. + */ + CloudTrailTrailsClient getCloudTrailTrails(); + + /** + * Gets the CloudWatchAlarmsClient object to access its operations. + * + * @return the CloudWatchAlarmsClient object. + */ + CloudWatchAlarmsClient getCloudWatchAlarms(); + + /** + * Gets the CodeBuildProjectsClient object to access its operations. + * + * @return the CodeBuildProjectsClient object. + */ + CodeBuildProjectsClient getCodeBuildProjects(); + + /** + * Gets the CodeBuildSourceCredentialsInfosClient object to access its operations. + * + * @return the CodeBuildSourceCredentialsInfosClient object. + */ + CodeBuildSourceCredentialsInfosClient getCodeBuildSourceCredentialsInfos(); + + /** + * Gets the ConfigServiceConfigurationRecordersClient object to access its operations. + * + * @return the ConfigServiceConfigurationRecordersClient object. + */ + ConfigServiceConfigurationRecordersClient getConfigServiceConfigurationRecorders(); + + /** + * Gets the ConfigServiceConfigurationRecorderStatusesClient object to access its operations. + * + * @return the ConfigServiceConfigurationRecorderStatusesClient object. + */ + ConfigServiceConfigurationRecorderStatusesClient getConfigServiceConfigurationRecorderStatuses(); + + /** + * Gets the ConfigServiceDeliveryChannelsClient object to access its operations. + * + * @return the ConfigServiceDeliveryChannelsClient object. + */ + ConfigServiceDeliveryChannelsClient getConfigServiceDeliveryChannels(); + + /** + * Gets the DatabaseMigrationServiceReplicationInstancesClient object to access its operations. + * + * @return the DatabaseMigrationServiceReplicationInstancesClient object. + */ + DatabaseMigrationServiceReplicationInstancesClient getDatabaseMigrationServiceReplicationInstances(); + + /** + * Gets the DaxClustersClient object to access its operations. + * + * @return the DaxClustersClient object. + */ + DaxClustersClient getDaxClusters(); + + /** + * Gets the DynamoDbContinuousBackupsDescriptionsClient object to access its operations. + * + * @return the DynamoDbContinuousBackupsDescriptionsClient object. + */ + DynamoDbContinuousBackupsDescriptionsClient getDynamoDbContinuousBackupsDescriptions(); + + /** + * Gets the DynamoDbTablesClient object to access its operations. + * + * @return the DynamoDbTablesClient object. + */ + DynamoDbTablesClient getDynamoDbTables(); + + /** + * Gets the Ec2AccountAttributesClient object to access its operations. + * + * @return the Ec2AccountAttributesClient object. + */ + Ec2AccountAttributesClient getEc2AccountAttributes(); + + /** + * Gets the Ec2AddressesClient object to access its operations. + * + * @return the Ec2AddressesClient object. + */ + Ec2AddressesClient getEc2Addresses(); + + /** + * Gets the Ec2FlowLogsClient object to access its operations. + * + * @return the Ec2FlowLogsClient object. + */ + Ec2FlowLogsClient getEc2FlowLogs(); + + /** + * Gets the Ec2ImagesClient object to access its operations. + * + * @return the Ec2ImagesClient object. + */ + Ec2ImagesClient getEc2Images(); + + /** + * Gets the Ec2InstancesClient object to access its operations. + * + * @return the Ec2InstancesClient object. + */ + Ec2InstancesClient getEc2Instances(); + + /** + * Gets the Ec2InstanceStatusesClient object to access its operations. + * + * @return the Ec2InstanceStatusesClient object. + */ + Ec2InstanceStatusesClient getEc2InstanceStatuses(); + + /** + * Gets the Ec2IpamsClient object to access its operations. + * + * @return the Ec2IpamsClient object. + */ + Ec2IpamsClient getEc2Ipams(); + + /** + * Gets the Ec2KeyPairsClient object to access its operations. + * + * @return the Ec2KeyPairsClient object. + */ + Ec2KeyPairsClient getEc2KeyPairs(); + + /** + * Gets the Ec2NetworkAclsClient object to access its operations. + * + * @return the Ec2NetworkAclsClient object. + */ + Ec2NetworkAclsClient getEc2NetworkAcls(); + + /** + * Gets the Ec2NetworkInterfacesClient object to access its operations. + * + * @return the Ec2NetworkInterfacesClient object. + */ + Ec2NetworkInterfacesClient getEc2NetworkInterfaces(); + + /** + * Gets the Ec2RouteTablesClient object to access its operations. + * + * @return the Ec2RouteTablesClient object. + */ + Ec2RouteTablesClient getEc2RouteTables(); + + /** + * Gets the Ec2SecurityGroupsClient object to access its operations. + * + * @return the Ec2SecurityGroupsClient object. + */ + Ec2SecurityGroupsClient getEc2SecurityGroups(); + + /** + * Gets the Ec2SnapshotsClient object to access its operations. + * + * @return the Ec2SnapshotsClient object. + */ + Ec2SnapshotsClient getEc2Snapshots(); + + /** + * Gets the Ec2SubnetsClient object to access its operations. + * + * @return the Ec2SubnetsClient object. + */ + Ec2SubnetsClient getEc2Subnets(); + + /** + * Gets the Ec2VolumesClient object to access its operations. + * + * @return the Ec2VolumesClient object. + */ + Ec2VolumesClient getEc2Volumes(); + + /** + * Gets the Ec2VpcsClient object to access its operations. + * + * @return the Ec2VpcsClient object. + */ + Ec2VpcsClient getEc2Vpcs(); + + /** + * Gets the Ec2VpcEndpointsClient object to access its operations. + * + * @return the Ec2VpcEndpointsClient object. + */ + Ec2VpcEndpointsClient getEc2VpcEndpoints(); + + /** + * Gets the Ec2VpcPeeringConnectionsClient object to access its operations. + * + * @return the Ec2VpcPeeringConnectionsClient object. + */ + Ec2VpcPeeringConnectionsClient getEc2VpcPeeringConnections(); + + /** + * Gets the EcrImageDetailsClient object to access its operations. + * + * @return the EcrImageDetailsClient object. + */ + EcrImageDetailsClient getEcrImageDetails(); + + /** + * Gets the EcrRepositoriesClient object to access its operations. + * + * @return the EcrRepositoriesClient object. + */ + EcrRepositoriesClient getEcrRepositories(); + + /** + * Gets the EcsClustersClient object to access its operations. + * + * @return the EcsClustersClient object. + */ + EcsClustersClient getEcsClusters(); + + /** + * Gets the EcsServicesClient object to access its operations. + * + * @return the EcsServicesClient object. + */ + EcsServicesClient getEcsServices(); + + /** + * Gets the EcsTaskDefinitionsClient object to access its operations. + * + * @return the EcsTaskDefinitionsClient object. + */ + EcsTaskDefinitionsClient getEcsTaskDefinitions(); + + /** + * Gets the EfsFileSystemsClient object to access its operations. + * + * @return the EfsFileSystemsClient object. + */ + EfsFileSystemsClient getEfsFileSystems(); + + /** + * Gets the EfsMountTargetsClient object to access its operations. + * + * @return the EfsMountTargetsClient object. + */ + EfsMountTargetsClient getEfsMountTargets(); + + /** + * Gets the EksClustersClient object to access its operations. + * + * @return the EksClustersClient object. + */ + EksClustersClient getEksClusters(); + + /** + * Gets the EksNodegroupsClient object to access its operations. + * + * @return the EksNodegroupsClient object. + */ + EksNodegroupsClient getEksNodegroups(); + + /** + * Gets the ElasticBeanstalkApplicationsClient object to access its operations. + * + * @return the ElasticBeanstalkApplicationsClient object. + */ + ElasticBeanstalkApplicationsClient getElasticBeanstalkApplications(); + + /** + * Gets the ElasticBeanstalkConfigurationTemplatesClient object to access its operations. + * + * @return the ElasticBeanstalkConfigurationTemplatesClient object. + */ + ElasticBeanstalkConfigurationTemplatesClient getElasticBeanstalkConfigurationTemplates(); + + /** + * Gets the ElasticBeanstalkEnvironmentsClient object to access its operations. + * + * @return the ElasticBeanstalkEnvironmentsClient object. + */ + ElasticBeanstalkEnvironmentsClient getElasticBeanstalkEnvironments(); + + /** + * Gets the ElasticLoadBalancingV2ListenersClient object to access its operations. + * + * @return the ElasticLoadBalancingV2ListenersClient object. + */ + ElasticLoadBalancingV2ListenersClient getElasticLoadBalancingV2Listeners(); + + /** + * Gets the ElasticLoadBalancingV2LoadBalancersClient object to access its operations. + * + * @return the ElasticLoadBalancingV2LoadBalancersClient object. + */ + ElasticLoadBalancingV2LoadBalancersClient getElasticLoadBalancingV2LoadBalancers(); + + /** + * Gets the ElasticLoadBalancingV2TargetGroupsClient object to access its operations. + * + * @return the ElasticLoadBalancingV2TargetGroupsClient object. + */ + ElasticLoadBalancingV2TargetGroupsClient getElasticLoadBalancingV2TargetGroups(); + + /** + * Gets the ElasticLoadBalancingv2TargetHealthDescriptionsClient object to access its operations. + * + * @return the ElasticLoadBalancingv2TargetHealthDescriptionsClient object. + */ + ElasticLoadBalancingv2TargetHealthDescriptionsClient getElasticLoadBalancingv2TargetHealthDescriptions(); + + /** + * Gets the EmrClustersClient object to access its operations. + * + * @return the EmrClustersClient object. + */ + EmrClustersClient getEmrClusters(); + + /** + * Gets the EmrClusterSummariesClient object to access its operations. + * + * @return the EmrClusterSummariesClient object. + */ + EmrClusterSummariesClient getEmrClusterSummaries(); + + /** + * Gets the GuardDutyDetectorsClient object to access its operations. + * + * @return the GuardDutyDetectorsClient object. + */ + GuardDutyDetectorsClient getGuardDutyDetectors(); + + /** + * Gets the IamAccessKeyLastUsedsClient object to access its operations. + * + * @return the IamAccessKeyLastUsedsClient object. + */ + IamAccessKeyLastUsedsClient getIamAccessKeyLastUseds(); + + /** + * Gets the IamAccessKeyMetadataInfoesClient object to access its operations. + * + * @return the IamAccessKeyMetadataInfoesClient object. + */ + IamAccessKeyMetadataInfoesClient getIamAccessKeyMetadataInfoes(); + + /** + * Gets the IamGroupsClient object to access its operations. + * + * @return the IamGroupsClient object. + */ + IamGroupsClient getIamGroups(); + + /** + * Gets the IamInstanceProfilesClient object to access its operations. + * + * @return the IamInstanceProfilesClient object. + */ + IamInstanceProfilesClient getIamInstanceProfiles(); + + /** + * Gets the IamMfaDevicesClient object to access its operations. + * + * @return the IamMfaDevicesClient object. + */ + IamMfaDevicesClient getIamMfaDevices(); + + /** + * Gets the IamPasswordPoliciesClient object to access its operations. + * + * @return the IamPasswordPoliciesClient object. + */ + IamPasswordPoliciesClient getIamPasswordPolicies(); + + /** + * Gets the IamPolicyVersionsClient object to access its operations. + * + * @return the IamPolicyVersionsClient object. + */ + IamPolicyVersionsClient getIamPolicyVersions(); + + /** + * Gets the IamRolesClient object to access its operations. + * + * @return the IamRolesClient object. + */ + IamRolesClient getIamRoles(); + + /** + * Gets the IamServerCertificatesClient object to access its operations. + * + * @return the IamServerCertificatesClient object. + */ + IamServerCertificatesClient getIamServerCertificates(); + + /** + * Gets the IamVirtualMfaDevicesClient object to access its operations. + * + * @return the IamVirtualMfaDevicesClient object. + */ + IamVirtualMfaDevicesClient getIamVirtualMfaDevices(); + + /** + * Gets the KmsAliasesClient object to access its operations. + * + * @return the KmsAliasesClient object. + */ + KmsAliasesClient getKmsAliases(); + + /** + * Gets the KmsKeysClient object to access its operations. + * + * @return the KmsKeysClient object. + */ + KmsKeysClient getKmsKeys(); + + /** + * Gets the LambdaFunctionsClient object to access its operations. + * + * @return the LambdaFunctionsClient object. + */ + LambdaFunctionsClient getLambdaFunctions(); + + /** + * Gets the LambdaFunctionCodeLocationsClient object to access its operations. + * + * @return the LambdaFunctionCodeLocationsClient object. + */ + LambdaFunctionCodeLocationsClient getLambdaFunctionCodeLocations(); + + /** + * Gets the LightsailBucketsClient object to access its operations. + * + * @return the LightsailBucketsClient object. + */ + LightsailBucketsClient getLightsailBuckets(); + + /** + * Gets the LightsailInstancesClient object to access its operations. + * + * @return the LightsailInstancesClient object. + */ + LightsailInstancesClient getLightsailInstances(); + + /** + * Gets the LogsLogGroupsClient object to access its operations. + * + * @return the LogsLogGroupsClient object. + */ + LogsLogGroupsClient getLogsLogGroups(); + + /** + * Gets the LogsLogStreamsClient object to access its operations. + * + * @return the LogsLogStreamsClient object. + */ + LogsLogStreamsClient getLogsLogStreams(); + + /** + * Gets the LogsMetricFiltersClient object to access its operations. + * + * @return the LogsMetricFiltersClient object. + */ + LogsMetricFiltersClient getLogsMetricFilters(); + + /** + * Gets the LogsSubscriptionFiltersClient object to access its operations. + * + * @return the LogsSubscriptionFiltersClient object. + */ + LogsSubscriptionFiltersClient getLogsSubscriptionFilters(); + + /** + * Gets the Macie2JobSummariesClient object to access its operations. + * + * @return the Macie2JobSummariesClient object. + */ + Macie2JobSummariesClient getMacie2JobSummaries(); + + /** + * Gets the MacieAllowListsClient object to access its operations. + * + * @return the MacieAllowListsClient object. + */ + MacieAllowListsClient getMacieAllowLists(); + + /** + * Gets the NetworkFirewallFirewallsClient object to access its operations. + * + * @return the NetworkFirewallFirewallsClient object. + */ + NetworkFirewallFirewallsClient getNetworkFirewallFirewalls(); + + /** + * Gets the NetworkFirewallFirewallPoliciesClient object to access its operations. + * + * @return the NetworkFirewallFirewallPoliciesClient object. + */ + NetworkFirewallFirewallPoliciesClient getNetworkFirewallFirewallPolicies(); + + /** + * Gets the NetworkFirewallRuleGroupsClient object to access its operations. + * + * @return the NetworkFirewallRuleGroupsClient object. + */ + NetworkFirewallRuleGroupsClient getNetworkFirewallRuleGroups(); + + /** + * Gets the OpenSearchDomainStatusesClient object to access its operations. + * + * @return the OpenSearchDomainStatusesClient object. + */ + OpenSearchDomainStatusesClient getOpenSearchDomainStatuses(); + + /** + * Gets the OperationsClient object to access its operations. + * + * @return the OperationsClient object. + */ + OperationsClient getOperations(); + + /** + * Gets the OrganizationsAccountsClient object to access its operations. + * + * @return the OrganizationsAccountsClient object. + */ + OrganizationsAccountsClient getOrganizationsAccounts(); + + /** + * Gets the OrganizationsOrganizationsClient object to access its operations. + * + * @return the OrganizationsOrganizationsClient object. + */ + OrganizationsOrganizationsClient getOrganizationsOrganizations(); + + /** + * Gets the RdsDbClustersClient object to access its operations. + * + * @return the RdsDbClustersClient object. + */ + RdsDbClustersClient getRdsDbClusters(); + + /** + * Gets the RdsDbInstancesClient object to access its operations. + * + * @return the RdsDbInstancesClient object. + */ + RdsDbInstancesClient getRdsDbInstances(); + + /** + * Gets the RdsDbSnapshotsClient object to access its operations. + * + * @return the RdsDbSnapshotsClient object. + */ + RdsDbSnapshotsClient getRdsDbSnapshots(); + + /** + * Gets the RdsDbSnapshotAttributesResultsClient object to access its operations. + * + * @return the RdsDbSnapshotAttributesResultsClient object. + */ + RdsDbSnapshotAttributesResultsClient getRdsDbSnapshotAttributesResults(); + + /** + * Gets the RdsEventSubscriptionsClient object to access its operations. + * + * @return the RdsEventSubscriptionsClient object. + */ + RdsEventSubscriptionsClient getRdsEventSubscriptions(); + + /** + * Gets the RdsExportTasksClient object to access its operations. + * + * @return the RdsExportTasksClient object. + */ + RdsExportTasksClient getRdsExportTasks(); + + /** + * Gets the RedshiftClustersClient object to access its operations. + * + * @return the RedshiftClustersClient object. + */ + RedshiftClustersClient getRedshiftClusters(); + + /** + * Gets the RedshiftClusterParameterGroupsClient object to access its operations. + * + * @return the RedshiftClusterParameterGroupsClient object. + */ + RedshiftClusterParameterGroupsClient getRedshiftClusterParameterGroups(); + + /** + * Gets the Route53DomainsDomainSummariesClient object to access its operations. + * + * @return the Route53DomainsDomainSummariesClient object. + */ + Route53DomainsDomainSummariesClient getRoute53DomainsDomainSummaries(); + + /** + * Gets the Route53HostedZonesClient object to access its operations. + * + * @return the Route53HostedZonesClient object. + */ + Route53HostedZonesClient getRoute53HostedZones(); + + /** + * Gets the Route53ResourceRecordSetsClient object to access its operations. + * + * @return the Route53ResourceRecordSetsClient object. + */ + Route53ResourceRecordSetsClient getRoute53ResourceRecordSets(); + + /** + * Gets the S3AccessPointsClient object to access its operations. + * + * @return the S3AccessPointsClient object. + */ + S3AccessPointsClient getS3AccessPoints(); + + /** + * Gets the S3BucketsClient object to access its operations. + * + * @return the S3BucketsClient object. + */ + S3BucketsClient getS3Buckets(); + + /** + * Gets the S3BucketPoliciesClient object to access its operations. + * + * @return the S3BucketPoliciesClient object. + */ + S3BucketPoliciesClient getS3BucketPolicies(); + + /** + * Gets the S3ControlMultiRegionAccessPointPolicyDocumentsClient object to access its operations. + * + * @return the S3ControlMultiRegionAccessPointPolicyDocumentsClient object. + */ + S3ControlMultiRegionAccessPointPolicyDocumentsClient getS3ControlMultiRegionAccessPointPolicyDocuments(); + + /** + * Gets the SageMakerAppsClient object to access its operations. + * + * @return the SageMakerAppsClient object. + */ + SageMakerAppsClient getSageMakerApps(); + + /** + * Gets the SageMakerNotebookInstanceSummariesClient object to access its operations. + * + * @return the SageMakerNotebookInstanceSummariesClient object. + */ + SageMakerNotebookInstanceSummariesClient getSageMakerNotebookInstanceSummaries(); + + /** + * Gets the SecretsManagerResourcePoliciesClient object to access its operations. + * + * @return the SecretsManagerResourcePoliciesClient object. + */ + SecretsManagerResourcePoliciesClient getSecretsManagerResourcePolicies(); + + /** + * Gets the SecretsManagerSecretsClient object to access its operations. + * + * @return the SecretsManagerSecretsClient object. + */ + SecretsManagerSecretsClient getSecretsManagerSecrets(); + + /** + * Gets the SnsSubscriptionsClient object to access its operations. + * + * @return the SnsSubscriptionsClient object. + */ + SnsSubscriptionsClient getSnsSubscriptions(); + + /** + * Gets the SnsTopicsClient object to access its operations. + * + * @return the SnsTopicsClient object. + */ + SnsTopicsClient getSnsTopics(); + + /** + * Gets the SqsQueuesClient object to access its operations. + * + * @return the SqsQueuesClient object. + */ + SqsQueuesClient getSqsQueues(); + + /** + * Gets the SsmInstanceInformationsClient object to access its operations. + * + * @return the SsmInstanceInformationsClient object. + */ + SsmInstanceInformationsClient getSsmInstanceInformations(); + + /** + * Gets the SsmParametersClient object to access its operations. + * + * @return the SsmParametersClient object. + */ + SsmParametersClient getSsmParameters(); + + /** + * Gets the SsmResourceComplianceSummaryItemsClient object to access its operations. + * + * @return the SsmResourceComplianceSummaryItemsClient object. + */ + SsmResourceComplianceSummaryItemsClient getSsmResourceComplianceSummaryItems(); + + /** + * Gets the Wafv2LoggingConfigurationsClient object to access its operations. + * + * @return the Wafv2LoggingConfigurationsClient object. + */ + Wafv2LoggingConfigurationsClient getWafv2LoggingConfigurations(); + + /** + * Gets the WafWebAclSummariesClient object to access its operations. + * + * @return the WafWebAclSummariesClient object. + */ + WafWebAclSummariesClient getWafWebAclSummaries(); +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/NetworkFirewallFirewallPoliciesClient.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/NetworkFirewallFirewallPoliciesClient.java new file mode 100644 index 000000000000..06ef4696c479 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/NetworkFirewallFirewallPoliciesClient.java @@ -0,0 +1,279 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.awsconnector.fluent.models.NetworkFirewallPolicyInner; +import com.azure.resourcemanager.awsconnector.models.NetworkFirewallPolicyTagsUpdate; + +/** + * An instance of this class provides access to all the operations defined in NetworkFirewallFirewallPoliciesClient. + */ +public interface NetworkFirewallFirewallPoliciesClient { + /** + * List NetworkFirewallFirewallPolicy resources by subscription ID. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a NetworkFirewallFirewallPolicy list operation as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * List NetworkFirewallFirewallPolicy resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a NetworkFirewallFirewallPolicy list operation as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(Context context); + + /** + * List NetworkFirewallFirewallPolicy resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a NetworkFirewallFirewallPolicy list operation as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * List NetworkFirewallFirewallPolicy resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a NetworkFirewallFirewallPolicy list operation as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Get a NetworkFirewallFirewallPolicy. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of NetworkFirewallFirewallPolicy. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a NetworkFirewallFirewallPolicy along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getByResourceGroupWithResponse(String resourceGroupName, String name, + Context context); + + /** + * Get a NetworkFirewallFirewallPolicy. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of NetworkFirewallFirewallPolicy. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a NetworkFirewallFirewallPolicy. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + NetworkFirewallPolicyInner getByResourceGroup(String resourceGroupName, String name); + + /** + * Create a NetworkFirewallFirewallPolicy. Please note that end user resource creation is currently restricted, but + * it will be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of NetworkFirewallFirewallPolicy. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, NetworkFirewallPolicyInner> + beginCreateOrReplace(String resourceGroupName, String name, NetworkFirewallPolicyInner resource); + + /** + * Create a NetworkFirewallFirewallPolicy. Please note that end user resource creation is currently restricted, but + * it will be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of NetworkFirewallFirewallPolicy. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, NetworkFirewallPolicyInner> beginCreateOrReplace( + String resourceGroupName, String name, NetworkFirewallPolicyInner resource, Context context); + + /** + * Create a NetworkFirewallFirewallPolicy. Please note that end user resource creation is currently restricted, but + * it will be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of NetworkFirewallFirewallPolicy. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + NetworkFirewallPolicyInner createOrReplace(String resourceGroupName, String name, + NetworkFirewallPolicyInner resource); + + /** + * Create a NetworkFirewallFirewallPolicy. Please note that end user resource creation is currently restricted, but + * it will be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of NetworkFirewallFirewallPolicy. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + NetworkFirewallPolicyInner createOrReplace(String resourceGroupName, String name, + NetworkFirewallPolicyInner resource, Context context); + + /** + * Update a NetworkFirewallFirewallPolicy. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of NetworkFirewallFirewallPolicy. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, NetworkFirewallPolicyInner> beginUpdate(String resourceGroupName, + String name, NetworkFirewallPolicyTagsUpdate properties); + + /** + * Update a NetworkFirewallFirewallPolicy. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of NetworkFirewallFirewallPolicy. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, NetworkFirewallPolicyInner> beginUpdate(String resourceGroupName, + String name, NetworkFirewallPolicyTagsUpdate properties, Context context); + + /** + * Update a NetworkFirewallFirewallPolicy. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of NetworkFirewallFirewallPolicy. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + NetworkFirewallPolicyInner update(String resourceGroupName, String name, + NetworkFirewallPolicyTagsUpdate properties); + + /** + * Update a NetworkFirewallFirewallPolicy. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of NetworkFirewallFirewallPolicy. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + NetworkFirewallPolicyInner update(String resourceGroupName, String name, NetworkFirewallPolicyTagsUpdate properties, + Context context); + + /** + * Delete a NetworkFirewallFirewallPolicy. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of NetworkFirewallFirewallPolicy. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String name); + + /** + * Delete a NetworkFirewallFirewallPolicy. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of NetworkFirewallFirewallPolicy. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String name, Context context); + + /** + * Delete a NetworkFirewallFirewallPolicy. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of NetworkFirewallFirewallPolicy. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String name); + + /** + * Delete a NetworkFirewallFirewallPolicy. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of NetworkFirewallFirewallPolicy. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String name, Context context); +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/NetworkFirewallFirewallsClient.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/NetworkFirewallFirewallsClient.java new file mode 100644 index 000000000000..73ae308cfff7 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/NetworkFirewallFirewallsClient.java @@ -0,0 +1,277 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.awsconnector.fluent.models.NetworkFirewallInner; +import com.azure.resourcemanager.awsconnector.models.NetworkFirewallTagsUpdate; + +/** + * An instance of this class provides access to all the operations defined in NetworkFirewallFirewallsClient. + */ +public interface NetworkFirewallFirewallsClient { + /** + * List NetworkFirewallFirewall resources by subscription ID. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a NetworkFirewallFirewall list operation as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * List NetworkFirewallFirewall resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a NetworkFirewallFirewall list operation as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(Context context); + + /** + * List NetworkFirewallFirewall resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a NetworkFirewallFirewall list operation as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * List NetworkFirewallFirewall resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a NetworkFirewallFirewall list operation as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Get a NetworkFirewallFirewall. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of NetworkFirewallFirewall. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a NetworkFirewallFirewall along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getByResourceGroupWithResponse(String resourceGroupName, String name, + Context context); + + /** + * Get a NetworkFirewallFirewall. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of NetworkFirewallFirewall. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a NetworkFirewallFirewall. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + NetworkFirewallInner getByResourceGroup(String resourceGroupName, String name); + + /** + * Create a NetworkFirewallFirewall. Please note that end user resource creation is currently restricted, but it + * will be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of NetworkFirewallFirewall. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, NetworkFirewallInner> beginCreateOrReplace(String resourceGroupName, + String name, NetworkFirewallInner resource); + + /** + * Create a NetworkFirewallFirewall. Please note that end user resource creation is currently restricted, but it + * will be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of NetworkFirewallFirewall. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, NetworkFirewallInner> beginCreateOrReplace(String resourceGroupName, + String name, NetworkFirewallInner resource, Context context); + + /** + * Create a NetworkFirewallFirewall. Please note that end user resource creation is currently restricted, but it + * will be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of NetworkFirewallFirewall. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + NetworkFirewallInner createOrReplace(String resourceGroupName, String name, NetworkFirewallInner resource); + + /** + * Create a NetworkFirewallFirewall. Please note that end user resource creation is currently restricted, but it + * will be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of NetworkFirewallFirewall. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + NetworkFirewallInner createOrReplace(String resourceGroupName, String name, NetworkFirewallInner resource, + Context context); + + /** + * Update a NetworkFirewallFirewall. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of NetworkFirewallFirewall. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, NetworkFirewallInner> beginUpdate(String resourceGroupName, + String name, NetworkFirewallTagsUpdate properties); + + /** + * Update a NetworkFirewallFirewall. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of NetworkFirewallFirewall. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, NetworkFirewallInner> beginUpdate(String resourceGroupName, + String name, NetworkFirewallTagsUpdate properties, Context context); + + /** + * Update a NetworkFirewallFirewall. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of NetworkFirewallFirewall. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + NetworkFirewallInner update(String resourceGroupName, String name, NetworkFirewallTagsUpdate properties); + + /** + * Update a NetworkFirewallFirewall. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of NetworkFirewallFirewall. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + NetworkFirewallInner update(String resourceGroupName, String name, NetworkFirewallTagsUpdate properties, + Context context); + + /** + * Delete a NetworkFirewallFirewall. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of NetworkFirewallFirewall. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String name); + + /** + * Delete a NetworkFirewallFirewall. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of NetworkFirewallFirewall. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String name, Context context); + + /** + * Delete a NetworkFirewallFirewall. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of NetworkFirewallFirewall. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String name); + + /** + * Delete a NetworkFirewallFirewall. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of NetworkFirewallFirewall. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String name, Context context); +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/NetworkFirewallRuleGroupsClient.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/NetworkFirewallRuleGroupsClient.java new file mode 100644 index 000000000000..17fae6421c2d --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/NetworkFirewallRuleGroupsClient.java @@ -0,0 +1,279 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.awsconnector.fluent.models.NetworkFirewallRuleGroupInner; +import com.azure.resourcemanager.awsconnector.models.NetworkFirewallRuleGroupTagsUpdate; + +/** + * An instance of this class provides access to all the operations defined in NetworkFirewallRuleGroupsClient. + */ +public interface NetworkFirewallRuleGroupsClient { + /** + * List NetworkFirewallRuleGroup resources by subscription ID. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a NetworkFirewallRuleGroup list operation as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * List NetworkFirewallRuleGroup resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a NetworkFirewallRuleGroup list operation as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(Context context); + + /** + * List NetworkFirewallRuleGroup resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a NetworkFirewallRuleGroup list operation as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * List NetworkFirewallRuleGroup resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a NetworkFirewallRuleGroup list operation as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Get a NetworkFirewallRuleGroup. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of NetworkFirewallRuleGroup. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a NetworkFirewallRuleGroup along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getByResourceGroupWithResponse(String resourceGroupName, String name, + Context context); + + /** + * Get a NetworkFirewallRuleGroup. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of NetworkFirewallRuleGroup. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a NetworkFirewallRuleGroup. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + NetworkFirewallRuleGroupInner getByResourceGroup(String resourceGroupName, String name); + + /** + * Create a NetworkFirewallRuleGroup. Please note that end user resource creation is currently restricted, but it + * will be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of NetworkFirewallRuleGroup. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, NetworkFirewallRuleGroupInner> + beginCreateOrReplace(String resourceGroupName, String name, NetworkFirewallRuleGroupInner resource); + + /** + * Create a NetworkFirewallRuleGroup. Please note that end user resource creation is currently restricted, but it + * will be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of NetworkFirewallRuleGroup. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, NetworkFirewallRuleGroupInner> beginCreateOrReplace( + String resourceGroupName, String name, NetworkFirewallRuleGroupInner resource, Context context); + + /** + * Create a NetworkFirewallRuleGroup. Please note that end user resource creation is currently restricted, but it + * will be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of NetworkFirewallRuleGroup. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + NetworkFirewallRuleGroupInner createOrReplace(String resourceGroupName, String name, + NetworkFirewallRuleGroupInner resource); + + /** + * Create a NetworkFirewallRuleGroup. Please note that end user resource creation is currently restricted, but it + * will be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of NetworkFirewallRuleGroup. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + NetworkFirewallRuleGroupInner createOrReplace(String resourceGroupName, String name, + NetworkFirewallRuleGroupInner resource, Context context); + + /** + * Update a NetworkFirewallRuleGroup. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of NetworkFirewallRuleGroup. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, NetworkFirewallRuleGroupInner> + beginUpdate(String resourceGroupName, String name, NetworkFirewallRuleGroupTagsUpdate properties); + + /** + * Update a NetworkFirewallRuleGroup. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of NetworkFirewallRuleGroup. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, NetworkFirewallRuleGroupInner> beginUpdate( + String resourceGroupName, String name, NetworkFirewallRuleGroupTagsUpdate properties, Context context); + + /** + * Update a NetworkFirewallRuleGroup. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of NetworkFirewallRuleGroup. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + NetworkFirewallRuleGroupInner update(String resourceGroupName, String name, + NetworkFirewallRuleGroupTagsUpdate properties); + + /** + * Update a NetworkFirewallRuleGroup. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of NetworkFirewallRuleGroup. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + NetworkFirewallRuleGroupInner update(String resourceGroupName, String name, + NetworkFirewallRuleGroupTagsUpdate properties, Context context); + + /** + * Delete a NetworkFirewallRuleGroup. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of NetworkFirewallRuleGroup. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String name); + + /** + * Delete a NetworkFirewallRuleGroup. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of NetworkFirewallRuleGroup. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String name, Context context); + + /** + * Delete a NetworkFirewallRuleGroup. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of NetworkFirewallRuleGroup. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String name); + + /** + * Delete a NetworkFirewallRuleGroup. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of NetworkFirewallRuleGroup. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String name, Context context); +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/OpenSearchDomainStatusesClient.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/OpenSearchDomainStatusesClient.java new file mode 100644 index 000000000000..354c7bf38c21 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/OpenSearchDomainStatusesClient.java @@ -0,0 +1,275 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.awsconnector.fluent.models.OpenSearchDomainStatusInner; +import com.azure.resourcemanager.awsconnector.models.OpenSearchDomainStatusTagsUpdate; + +/** + * An instance of this class provides access to all the operations defined in OpenSearchDomainStatusesClient. + */ +public interface OpenSearchDomainStatusesClient { + /** + * List OpenSearchDomainStatus resources by subscription ID. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a OpenSearchDomainStatus list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * List OpenSearchDomainStatus resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a OpenSearchDomainStatus list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(Context context); + + /** + * List OpenSearchDomainStatus resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a OpenSearchDomainStatus list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * List OpenSearchDomainStatus resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a OpenSearchDomainStatus list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Get a OpenSearchDomainStatus. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of OpenSearchDomainStatus. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a OpenSearchDomainStatus along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getByResourceGroupWithResponse(String resourceGroupName, String name, + Context context); + + /** + * Get a OpenSearchDomainStatus. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of OpenSearchDomainStatus. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a OpenSearchDomainStatus. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + OpenSearchDomainStatusInner getByResourceGroup(String resourceGroupName, String name); + + /** + * Create a OpenSearchDomainStatus. Please note that end user resource creation is currently restricted, but it will + * be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of OpenSearchDomainStatus. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, OpenSearchDomainStatusInner> + beginCreateOrReplace(String resourceGroupName, String name, OpenSearchDomainStatusInner resource); + + /** + * Create a OpenSearchDomainStatus. Please note that end user resource creation is currently restricted, but it will + * be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of OpenSearchDomainStatus. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, OpenSearchDomainStatusInner> beginCreateOrReplace( + String resourceGroupName, String name, OpenSearchDomainStatusInner resource, Context context); + + /** + * Create a OpenSearchDomainStatus. Please note that end user resource creation is currently restricted, but it will + * be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of OpenSearchDomainStatus. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + OpenSearchDomainStatusInner createOrReplace(String resourceGroupName, String name, + OpenSearchDomainStatusInner resource); + + /** + * Create a OpenSearchDomainStatus. Please note that end user resource creation is currently restricted, but it will + * be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of OpenSearchDomainStatus. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + OpenSearchDomainStatusInner createOrReplace(String resourceGroupName, String name, + OpenSearchDomainStatusInner resource, Context context); + + /** + * Update a OpenSearchDomainStatus. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of OpenSearchDomainStatus. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, OpenSearchDomainStatusInner> + beginUpdate(String resourceGroupName, String name, OpenSearchDomainStatusTagsUpdate properties); + + /** + * Update a OpenSearchDomainStatus. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of OpenSearchDomainStatus. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, OpenSearchDomainStatusInner> beginUpdate( + String resourceGroupName, String name, OpenSearchDomainStatusTagsUpdate properties, Context context); + + /** + * Update a OpenSearchDomainStatus. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of OpenSearchDomainStatus. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + OpenSearchDomainStatusInner update(String resourceGroupName, String name, + OpenSearchDomainStatusTagsUpdate properties); + + /** + * Update a OpenSearchDomainStatus. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of OpenSearchDomainStatus. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + OpenSearchDomainStatusInner update(String resourceGroupName, String name, + OpenSearchDomainStatusTagsUpdate properties, Context context); + + /** + * Delete a OpenSearchDomainStatus. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of OpenSearchDomainStatus. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String name); + + /** + * Delete a OpenSearchDomainStatus. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of OpenSearchDomainStatus. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String name, Context context); + + /** + * Delete a OpenSearchDomainStatus. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of OpenSearchDomainStatus. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String name); + + /** + * Delete a OpenSearchDomainStatus. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of OpenSearchDomainStatus. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String name, Context context); +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/OperationsClient.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/OperationsClient.java new file mode 100644 index 000000000000..ec47c1658727 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/OperationsClient.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.awsconnector.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; +import com.azure.resourcemanager.awsconnector.fluent.models.OperationInner; + +/** + * An instance of this class provides access to all the operations defined in OperationsClient. + */ +public interface OperationsClient { + /** + * List the operations for the provider. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of REST API operations supported by an Azure Resource Provider as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * List the operations for the provider. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of REST API operations supported by an Azure Resource Provider as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(Context context); +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/OrganizationsAccountsClient.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/OrganizationsAccountsClient.java new file mode 100644 index 000000000000..96547a010586 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/OrganizationsAccountsClient.java @@ -0,0 +1,274 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.awsconnector.fluent.models.OrganizationsAccountInner; +import com.azure.resourcemanager.awsconnector.models.OrganizationsAccountTagsUpdate; + +/** + * An instance of this class provides access to all the operations defined in OrganizationsAccountsClient. + */ +public interface OrganizationsAccountsClient { + /** + * List OrganizationsAccount resources by subscription ID. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a OrganizationsAccount list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * List OrganizationsAccount resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a OrganizationsAccount list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(Context context); + + /** + * List OrganizationsAccount resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a OrganizationsAccount list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * List OrganizationsAccount resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a OrganizationsAccount list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Get a OrganizationsAccount. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of OrganizationsAccount. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a OrganizationsAccount along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getByResourceGroupWithResponse(String resourceGroupName, String name, + Context context); + + /** + * Get a OrganizationsAccount. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of OrganizationsAccount. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a OrganizationsAccount. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + OrganizationsAccountInner getByResourceGroup(String resourceGroupName, String name); + + /** + * Create a OrganizationsAccount. Please note that end user resource creation is currently restricted, but it will + * be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of OrganizationsAccount. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, OrganizationsAccountInner> + beginCreateOrReplace(String resourceGroupName, String name, OrganizationsAccountInner resource); + + /** + * Create a OrganizationsAccount. Please note that end user resource creation is currently restricted, but it will + * be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of OrganizationsAccount. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, OrganizationsAccountInner> beginCreateOrReplace( + String resourceGroupName, String name, OrganizationsAccountInner resource, Context context); + + /** + * Create a OrganizationsAccount. Please note that end user resource creation is currently restricted, but it will + * be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of OrganizationsAccount. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + OrganizationsAccountInner createOrReplace(String resourceGroupName, String name, + OrganizationsAccountInner resource); + + /** + * Create a OrganizationsAccount. Please note that end user resource creation is currently restricted, but it will + * be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of OrganizationsAccount. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + OrganizationsAccountInner createOrReplace(String resourceGroupName, String name, OrganizationsAccountInner resource, + Context context); + + /** + * Update a OrganizationsAccount. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of OrganizationsAccount. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, OrganizationsAccountInner> beginUpdate(String resourceGroupName, + String name, OrganizationsAccountTagsUpdate properties); + + /** + * Update a OrganizationsAccount. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of OrganizationsAccount. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, OrganizationsAccountInner> beginUpdate(String resourceGroupName, + String name, OrganizationsAccountTagsUpdate properties, Context context); + + /** + * Update a OrganizationsAccount. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of OrganizationsAccount. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + OrganizationsAccountInner update(String resourceGroupName, String name, OrganizationsAccountTagsUpdate properties); + + /** + * Update a OrganizationsAccount. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of OrganizationsAccount. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + OrganizationsAccountInner update(String resourceGroupName, String name, OrganizationsAccountTagsUpdate properties, + Context context); + + /** + * Delete a OrganizationsAccount. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of OrganizationsAccount. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String name); + + /** + * Delete a OrganizationsAccount. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of OrganizationsAccount. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String name, Context context); + + /** + * Delete a OrganizationsAccount. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of OrganizationsAccount. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String name); + + /** + * Delete a OrganizationsAccount. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of OrganizationsAccount. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String name, Context context); +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/OrganizationsOrganizationsClient.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/OrganizationsOrganizationsClient.java new file mode 100644 index 000000000000..ef89cbfbd181 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/OrganizationsOrganizationsClient.java @@ -0,0 +1,279 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.awsconnector.fluent.models.OrganizationsOrganizationInner; +import com.azure.resourcemanager.awsconnector.models.OrganizationsOrganizationTagsUpdate; + +/** + * An instance of this class provides access to all the operations defined in OrganizationsOrganizationsClient. + */ +public interface OrganizationsOrganizationsClient { + /** + * List OrganizationsOrganization resources by subscription ID. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a OrganizationsOrganization list operation as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * List OrganizationsOrganization resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a OrganizationsOrganization list operation as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(Context context); + + /** + * List OrganizationsOrganization resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a OrganizationsOrganization list operation as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * List OrganizationsOrganization resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a OrganizationsOrganization list operation as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Get a OrganizationsOrganization. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of OrganizationsOrganization. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a OrganizationsOrganization along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getByResourceGroupWithResponse(String resourceGroupName, String name, + Context context); + + /** + * Get a OrganizationsOrganization. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of OrganizationsOrganization. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a OrganizationsOrganization. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + OrganizationsOrganizationInner getByResourceGroup(String resourceGroupName, String name); + + /** + * Create a OrganizationsOrganization. Please note that end user resource creation is currently restricted, but it + * will be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of OrganizationsOrganization. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, OrganizationsOrganizationInner> + beginCreateOrReplace(String resourceGroupName, String name, OrganizationsOrganizationInner resource); + + /** + * Create a OrganizationsOrganization. Please note that end user resource creation is currently restricted, but it + * will be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of OrganizationsOrganization. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, OrganizationsOrganizationInner> beginCreateOrReplace( + String resourceGroupName, String name, OrganizationsOrganizationInner resource, Context context); + + /** + * Create a OrganizationsOrganization. Please note that end user resource creation is currently restricted, but it + * will be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of OrganizationsOrganization. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + OrganizationsOrganizationInner createOrReplace(String resourceGroupName, String name, + OrganizationsOrganizationInner resource); + + /** + * Create a OrganizationsOrganization. Please note that end user resource creation is currently restricted, but it + * will be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of OrganizationsOrganization. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + OrganizationsOrganizationInner createOrReplace(String resourceGroupName, String name, + OrganizationsOrganizationInner resource, Context context); + + /** + * Update a OrganizationsOrganization. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of OrganizationsOrganization. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, OrganizationsOrganizationInner> + beginUpdate(String resourceGroupName, String name, OrganizationsOrganizationTagsUpdate properties); + + /** + * Update a OrganizationsOrganization. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of OrganizationsOrganization. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, OrganizationsOrganizationInner> beginUpdate( + String resourceGroupName, String name, OrganizationsOrganizationTagsUpdate properties, Context context); + + /** + * Update a OrganizationsOrganization. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of OrganizationsOrganization. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + OrganizationsOrganizationInner update(String resourceGroupName, String name, + OrganizationsOrganizationTagsUpdate properties); + + /** + * Update a OrganizationsOrganization. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of OrganizationsOrganization. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + OrganizationsOrganizationInner update(String resourceGroupName, String name, + OrganizationsOrganizationTagsUpdate properties, Context context); + + /** + * Delete a OrganizationsOrganization. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of OrganizationsOrganization. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String name); + + /** + * Delete a OrganizationsOrganization. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of OrganizationsOrganization. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String name, Context context); + + /** + * Delete a OrganizationsOrganization. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of OrganizationsOrganization. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String name); + + /** + * Delete a OrganizationsOrganization. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of OrganizationsOrganization. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String name, Context context); +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/RdsDbClustersClient.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/RdsDbClustersClient.java new file mode 100644 index 000000000000..8e6f31d3cacb --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/RdsDbClustersClient.java @@ -0,0 +1,271 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.awsconnector.fluent.models.RdsDBClusterInner; +import com.azure.resourcemanager.awsconnector.models.RdsDBClusterTagsUpdate; + +/** + * An instance of this class provides access to all the operations defined in RdsDbClustersClient. + */ +public interface RdsDbClustersClient { + /** + * List RdsDBCluster resources by subscription ID. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a RdsDBCluster list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * List RdsDBCluster resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a RdsDBCluster list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(Context context); + + /** + * List RdsDBCluster resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a RdsDBCluster list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * List RdsDBCluster resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a RdsDBCluster list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Get a RdsDBCluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of RdsDBCluster. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a RdsDBCluster along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getByResourceGroupWithResponse(String resourceGroupName, String name, Context context); + + /** + * Get a RdsDBCluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of RdsDBCluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a RdsDBCluster. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + RdsDBClusterInner getByResourceGroup(String resourceGroupName, String name); + + /** + * Create a RdsDBCluster. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of RdsDBCluster. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, RdsDBClusterInner> beginCreateOrReplace(String resourceGroupName, + String name, RdsDBClusterInner resource); + + /** + * Create a RdsDBCluster. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of RdsDBCluster. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, RdsDBClusterInner> beginCreateOrReplace(String resourceGroupName, + String name, RdsDBClusterInner resource, Context context); + + /** + * Create a RdsDBCluster. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of RdsDBCluster. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + RdsDBClusterInner createOrReplace(String resourceGroupName, String name, RdsDBClusterInner resource); + + /** + * Create a RdsDBCluster. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of RdsDBCluster. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + RdsDBClusterInner createOrReplace(String resourceGroupName, String name, RdsDBClusterInner resource, + Context context); + + /** + * Update a RdsDBCluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of RdsDBCluster. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, RdsDBClusterInner> beginUpdate(String resourceGroupName, String name, + RdsDBClusterTagsUpdate properties); + + /** + * Update a RdsDBCluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of RdsDBCluster. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, RdsDBClusterInner> beginUpdate(String resourceGroupName, String name, + RdsDBClusterTagsUpdate properties, Context context); + + /** + * Update a RdsDBCluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of RdsDBCluster. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + RdsDBClusterInner update(String resourceGroupName, String name, RdsDBClusterTagsUpdate properties); + + /** + * Update a RdsDBCluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of RdsDBCluster. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + RdsDBClusterInner update(String resourceGroupName, String name, RdsDBClusterTagsUpdate properties, Context context); + + /** + * Delete a RdsDBCluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of RdsDBCluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String name); + + /** + * Delete a RdsDBCluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of RdsDBCluster. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String name, Context context); + + /** + * Delete a RdsDBCluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of RdsDBCluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String name); + + /** + * Delete a RdsDBCluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of RdsDBCluster. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String name, Context context); +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/RdsDbInstancesClient.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/RdsDbInstancesClient.java new file mode 100644 index 000000000000..8e6bcb5cbc03 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/RdsDbInstancesClient.java @@ -0,0 +1,272 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.awsconnector.fluent.models.RdsDBInstanceInner; +import com.azure.resourcemanager.awsconnector.models.RdsDBInstanceTagsUpdate; + +/** + * An instance of this class provides access to all the operations defined in RdsDbInstancesClient. + */ +public interface RdsDbInstancesClient { + /** + * List RdsDBInstance resources by subscription ID. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a RdsDBInstance list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * List RdsDBInstance resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a RdsDBInstance list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(Context context); + + /** + * List RdsDBInstance resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a RdsDBInstance list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * List RdsDBInstance resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a RdsDBInstance list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Get a RdsDBInstance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of RdsDBInstance. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a RdsDBInstance along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getByResourceGroupWithResponse(String resourceGroupName, String name, Context context); + + /** + * Get a RdsDBInstance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of RdsDBInstance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a RdsDBInstance. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + RdsDBInstanceInner getByResourceGroup(String resourceGroupName, String name); + + /** + * Create a RdsDBInstance. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of RdsDBInstance. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, RdsDBInstanceInner> beginCreateOrReplace(String resourceGroupName, + String name, RdsDBInstanceInner resource); + + /** + * Create a RdsDBInstance. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of RdsDBInstance. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, RdsDBInstanceInner> beginCreateOrReplace(String resourceGroupName, + String name, RdsDBInstanceInner resource, Context context); + + /** + * Create a RdsDBInstance. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of RdsDBInstance. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + RdsDBInstanceInner createOrReplace(String resourceGroupName, String name, RdsDBInstanceInner resource); + + /** + * Create a RdsDBInstance. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of RdsDBInstance. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + RdsDBInstanceInner createOrReplace(String resourceGroupName, String name, RdsDBInstanceInner resource, + Context context); + + /** + * Update a RdsDBInstance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of RdsDBInstance. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, RdsDBInstanceInner> beginUpdate(String resourceGroupName, String name, + RdsDBInstanceTagsUpdate properties); + + /** + * Update a RdsDBInstance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of RdsDBInstance. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, RdsDBInstanceInner> beginUpdate(String resourceGroupName, String name, + RdsDBInstanceTagsUpdate properties, Context context); + + /** + * Update a RdsDBInstance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of RdsDBInstance. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + RdsDBInstanceInner update(String resourceGroupName, String name, RdsDBInstanceTagsUpdate properties); + + /** + * Update a RdsDBInstance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of RdsDBInstance. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + RdsDBInstanceInner update(String resourceGroupName, String name, RdsDBInstanceTagsUpdate properties, + Context context); + + /** + * Delete a RdsDBInstance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of RdsDBInstance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String name); + + /** + * Delete a RdsDBInstance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of RdsDBInstance. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String name, Context context); + + /** + * Delete a RdsDBInstance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of RdsDBInstance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String name); + + /** + * Delete a RdsDBInstance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of RdsDBInstance. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String name, Context context); +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/RdsDbSnapshotAttributesResultsClient.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/RdsDbSnapshotAttributesResultsClient.java new file mode 100644 index 000000000000..2b660b7e857e --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/RdsDbSnapshotAttributesResultsClient.java @@ -0,0 +1,279 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.awsconnector.fluent.models.RdsDBSnapshotAttributesResultInner; +import com.azure.resourcemanager.awsconnector.models.RdsDBSnapshotAttributesResultTagsUpdate; + +/** + * An instance of this class provides access to all the operations defined in RdsDbSnapshotAttributesResultsClient. + */ +public interface RdsDbSnapshotAttributesResultsClient { + /** + * List RdsDBSnapshotAttributesResult resources by subscription ID. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a RdsDBSnapshotAttributesResult list operation as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * List RdsDBSnapshotAttributesResult resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a RdsDBSnapshotAttributesResult list operation as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(Context context); + + /** + * List RdsDBSnapshotAttributesResult resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a RdsDBSnapshotAttributesResult list operation as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * List RdsDBSnapshotAttributesResult resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a RdsDBSnapshotAttributesResult list operation as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Get a RdsDBSnapshotAttributesResult. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of RdsDBSnapshotAttributesResult. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a RdsDBSnapshotAttributesResult along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getByResourceGroupWithResponse(String resourceGroupName, String name, + Context context); + + /** + * Get a RdsDBSnapshotAttributesResult. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of RdsDBSnapshotAttributesResult. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a RdsDBSnapshotAttributesResult. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + RdsDBSnapshotAttributesResultInner getByResourceGroup(String resourceGroupName, String name); + + /** + * Create a RdsDBSnapshotAttributesResult. Please note that end user resource creation is currently restricted, but + * it will be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of RdsDBSnapshotAttributesResult. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, RdsDBSnapshotAttributesResultInner> + beginCreateOrReplace(String resourceGroupName, String name, RdsDBSnapshotAttributesResultInner resource); + + /** + * Create a RdsDBSnapshotAttributesResult. Please note that end user resource creation is currently restricted, but + * it will be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of RdsDBSnapshotAttributesResult. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, RdsDBSnapshotAttributesResultInner> beginCreateOrReplace( + String resourceGroupName, String name, RdsDBSnapshotAttributesResultInner resource, Context context); + + /** + * Create a RdsDBSnapshotAttributesResult. Please note that end user resource creation is currently restricted, but + * it will be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of RdsDBSnapshotAttributesResult. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + RdsDBSnapshotAttributesResultInner createOrReplace(String resourceGroupName, String name, + RdsDBSnapshotAttributesResultInner resource); + + /** + * Create a RdsDBSnapshotAttributesResult. Please note that end user resource creation is currently restricted, but + * it will be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of RdsDBSnapshotAttributesResult. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + RdsDBSnapshotAttributesResultInner createOrReplace(String resourceGroupName, String name, + RdsDBSnapshotAttributesResultInner resource, Context context); + + /** + * Update a RdsDBSnapshotAttributesResult. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of RdsDBSnapshotAttributesResult. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, RdsDBSnapshotAttributesResultInner> + beginUpdate(String resourceGroupName, String name, RdsDBSnapshotAttributesResultTagsUpdate properties); + + /** + * Update a RdsDBSnapshotAttributesResult. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of RdsDBSnapshotAttributesResult. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, RdsDBSnapshotAttributesResultInner> beginUpdate( + String resourceGroupName, String name, RdsDBSnapshotAttributesResultTagsUpdate properties, Context context); + + /** + * Update a RdsDBSnapshotAttributesResult. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of RdsDBSnapshotAttributesResult. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + RdsDBSnapshotAttributesResultInner update(String resourceGroupName, String name, + RdsDBSnapshotAttributesResultTagsUpdate properties); + + /** + * Update a RdsDBSnapshotAttributesResult. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of RdsDBSnapshotAttributesResult. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + RdsDBSnapshotAttributesResultInner update(String resourceGroupName, String name, + RdsDBSnapshotAttributesResultTagsUpdate properties, Context context); + + /** + * Delete a RdsDBSnapshotAttributesResult. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of RdsDBSnapshotAttributesResult. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String name); + + /** + * Delete a RdsDBSnapshotAttributesResult. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of RdsDBSnapshotAttributesResult. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String name, Context context); + + /** + * Delete a RdsDBSnapshotAttributesResult. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of RdsDBSnapshotAttributesResult. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String name); + + /** + * Delete a RdsDBSnapshotAttributesResult. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of RdsDBSnapshotAttributesResult. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String name, Context context); +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/RdsDbSnapshotsClient.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/RdsDbSnapshotsClient.java new file mode 100644 index 000000000000..a970a76c433e --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/RdsDbSnapshotsClient.java @@ -0,0 +1,272 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.awsconnector.fluent.models.RdsDBSnapshotInner; +import com.azure.resourcemanager.awsconnector.models.RdsDBSnapshotTagsUpdate; + +/** + * An instance of this class provides access to all the operations defined in RdsDbSnapshotsClient. + */ +public interface RdsDbSnapshotsClient { + /** + * List RdsDBSnapshot resources by subscription ID. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a RdsDBSnapshot list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * List RdsDBSnapshot resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a RdsDBSnapshot list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(Context context); + + /** + * List RdsDBSnapshot resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a RdsDBSnapshot list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * List RdsDBSnapshot resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a RdsDBSnapshot list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Get a RdsDBSnapshot. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of RdsDBSnapshot. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a RdsDBSnapshot along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getByResourceGroupWithResponse(String resourceGroupName, String name, Context context); + + /** + * Get a RdsDBSnapshot. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of RdsDBSnapshot. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a RdsDBSnapshot. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + RdsDBSnapshotInner getByResourceGroup(String resourceGroupName, String name); + + /** + * Create a RdsDBSnapshot. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of RdsDBSnapshot. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, RdsDBSnapshotInner> beginCreateOrReplace(String resourceGroupName, + String name, RdsDBSnapshotInner resource); + + /** + * Create a RdsDBSnapshot. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of RdsDBSnapshot. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, RdsDBSnapshotInner> beginCreateOrReplace(String resourceGroupName, + String name, RdsDBSnapshotInner resource, Context context); + + /** + * Create a RdsDBSnapshot. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of RdsDBSnapshot. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + RdsDBSnapshotInner createOrReplace(String resourceGroupName, String name, RdsDBSnapshotInner resource); + + /** + * Create a RdsDBSnapshot. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of RdsDBSnapshot. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + RdsDBSnapshotInner createOrReplace(String resourceGroupName, String name, RdsDBSnapshotInner resource, + Context context); + + /** + * Update a RdsDBSnapshot. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of RdsDBSnapshot. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, RdsDBSnapshotInner> beginUpdate(String resourceGroupName, String name, + RdsDBSnapshotTagsUpdate properties); + + /** + * Update a RdsDBSnapshot. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of RdsDBSnapshot. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, RdsDBSnapshotInner> beginUpdate(String resourceGroupName, String name, + RdsDBSnapshotTagsUpdate properties, Context context); + + /** + * Update a RdsDBSnapshot. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of RdsDBSnapshot. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + RdsDBSnapshotInner update(String resourceGroupName, String name, RdsDBSnapshotTagsUpdate properties); + + /** + * Update a RdsDBSnapshot. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of RdsDBSnapshot. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + RdsDBSnapshotInner update(String resourceGroupName, String name, RdsDBSnapshotTagsUpdate properties, + Context context); + + /** + * Delete a RdsDBSnapshot. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of RdsDBSnapshot. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String name); + + /** + * Delete a RdsDBSnapshot. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of RdsDBSnapshot. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String name, Context context); + + /** + * Delete a RdsDBSnapshot. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of RdsDBSnapshot. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String name); + + /** + * Delete a RdsDBSnapshot. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of RdsDBSnapshot. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String name, Context context); +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/RdsEventSubscriptionsClient.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/RdsEventSubscriptionsClient.java new file mode 100644 index 000000000000..f02c4552e541 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/RdsEventSubscriptionsClient.java @@ -0,0 +1,274 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.awsconnector.fluent.models.RdsEventSubscriptionInner; +import com.azure.resourcemanager.awsconnector.models.RdsEventSubscriptionTagsUpdate; + +/** + * An instance of this class provides access to all the operations defined in RdsEventSubscriptionsClient. + */ +public interface RdsEventSubscriptionsClient { + /** + * List RdsEventSubscription resources by subscription ID. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a RdsEventSubscription list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * List RdsEventSubscription resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a RdsEventSubscription list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(Context context); + + /** + * List RdsEventSubscription resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a RdsEventSubscription list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * List RdsEventSubscription resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a RdsEventSubscription list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Get a RdsEventSubscription. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of RdsEventSubscription. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a RdsEventSubscription along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getByResourceGroupWithResponse(String resourceGroupName, String name, + Context context); + + /** + * Get a RdsEventSubscription. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of RdsEventSubscription. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a RdsEventSubscription. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + RdsEventSubscriptionInner getByResourceGroup(String resourceGroupName, String name); + + /** + * Create a RdsEventSubscription. Please note that end user resource creation is currently restricted, but it will + * be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of RdsEventSubscription. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, RdsEventSubscriptionInner> + beginCreateOrReplace(String resourceGroupName, String name, RdsEventSubscriptionInner resource); + + /** + * Create a RdsEventSubscription. Please note that end user resource creation is currently restricted, but it will + * be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of RdsEventSubscription. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, RdsEventSubscriptionInner> beginCreateOrReplace( + String resourceGroupName, String name, RdsEventSubscriptionInner resource, Context context); + + /** + * Create a RdsEventSubscription. Please note that end user resource creation is currently restricted, but it will + * be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of RdsEventSubscription. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + RdsEventSubscriptionInner createOrReplace(String resourceGroupName, String name, + RdsEventSubscriptionInner resource); + + /** + * Create a RdsEventSubscription. Please note that end user resource creation is currently restricted, but it will + * be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of RdsEventSubscription. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + RdsEventSubscriptionInner createOrReplace(String resourceGroupName, String name, RdsEventSubscriptionInner resource, + Context context); + + /** + * Update a RdsEventSubscription. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of RdsEventSubscription. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, RdsEventSubscriptionInner> beginUpdate(String resourceGroupName, + String name, RdsEventSubscriptionTagsUpdate properties); + + /** + * Update a RdsEventSubscription. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of RdsEventSubscription. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, RdsEventSubscriptionInner> beginUpdate(String resourceGroupName, + String name, RdsEventSubscriptionTagsUpdate properties, Context context); + + /** + * Update a RdsEventSubscription. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of RdsEventSubscription. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + RdsEventSubscriptionInner update(String resourceGroupName, String name, RdsEventSubscriptionTagsUpdate properties); + + /** + * Update a RdsEventSubscription. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of RdsEventSubscription. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + RdsEventSubscriptionInner update(String resourceGroupName, String name, RdsEventSubscriptionTagsUpdate properties, + Context context); + + /** + * Delete a RdsEventSubscription. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of RdsEventSubscription. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String name); + + /** + * Delete a RdsEventSubscription. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of RdsEventSubscription. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String name, Context context); + + /** + * Delete a RdsEventSubscription. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of RdsEventSubscription. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String name); + + /** + * Delete a RdsEventSubscription. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of RdsEventSubscription. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String name, Context context); +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/RdsExportTasksClient.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/RdsExportTasksClient.java new file mode 100644 index 000000000000..abf594e26a05 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/RdsExportTasksClient.java @@ -0,0 +1,272 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.awsconnector.fluent.models.RdsExportTaskInner; +import com.azure.resourcemanager.awsconnector.models.RdsExportTaskTagsUpdate; + +/** + * An instance of this class provides access to all the operations defined in RdsExportTasksClient. + */ +public interface RdsExportTasksClient { + /** + * List RdsExportTask resources by subscription ID. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a RdsExportTask list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * List RdsExportTask resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a RdsExportTask list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(Context context); + + /** + * List RdsExportTask resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a RdsExportTask list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * List RdsExportTask resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a RdsExportTask list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Get a RdsExportTask. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of RdsExportTask. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a RdsExportTask along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getByResourceGroupWithResponse(String resourceGroupName, String name, Context context); + + /** + * Get a RdsExportTask. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of RdsExportTask. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a RdsExportTask. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + RdsExportTaskInner getByResourceGroup(String resourceGroupName, String name); + + /** + * Create a RdsExportTask. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of RdsExportTask. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, RdsExportTaskInner> beginCreateOrReplace(String resourceGroupName, + String name, RdsExportTaskInner resource); + + /** + * Create a RdsExportTask. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of RdsExportTask. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, RdsExportTaskInner> beginCreateOrReplace(String resourceGroupName, + String name, RdsExportTaskInner resource, Context context); + + /** + * Create a RdsExportTask. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of RdsExportTask. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + RdsExportTaskInner createOrReplace(String resourceGroupName, String name, RdsExportTaskInner resource); + + /** + * Create a RdsExportTask. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of RdsExportTask. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + RdsExportTaskInner createOrReplace(String resourceGroupName, String name, RdsExportTaskInner resource, + Context context); + + /** + * Update a RdsExportTask. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of RdsExportTask. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, RdsExportTaskInner> beginUpdate(String resourceGroupName, String name, + RdsExportTaskTagsUpdate properties); + + /** + * Update a RdsExportTask. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of RdsExportTask. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, RdsExportTaskInner> beginUpdate(String resourceGroupName, String name, + RdsExportTaskTagsUpdate properties, Context context); + + /** + * Update a RdsExportTask. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of RdsExportTask. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + RdsExportTaskInner update(String resourceGroupName, String name, RdsExportTaskTagsUpdate properties); + + /** + * Update a RdsExportTask. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of RdsExportTask. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + RdsExportTaskInner update(String resourceGroupName, String name, RdsExportTaskTagsUpdate properties, + Context context); + + /** + * Delete a RdsExportTask. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of RdsExportTask. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String name); + + /** + * Delete a RdsExportTask. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of RdsExportTask. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String name, Context context); + + /** + * Delete a RdsExportTask. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of RdsExportTask. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String name); + + /** + * Delete a RdsExportTask. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of RdsExportTask. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String name, Context context); +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/RedshiftClusterParameterGroupsClient.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/RedshiftClusterParameterGroupsClient.java new file mode 100644 index 000000000000..7528b25742d4 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/RedshiftClusterParameterGroupsClient.java @@ -0,0 +1,279 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.awsconnector.fluent.models.RedshiftClusterParameterGroupInner; +import com.azure.resourcemanager.awsconnector.models.RedshiftClusterParameterGroupTagsUpdate; + +/** + * An instance of this class provides access to all the operations defined in RedshiftClusterParameterGroupsClient. + */ +public interface RedshiftClusterParameterGroupsClient { + /** + * List RedshiftClusterParameterGroup resources by subscription ID. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a RedshiftClusterParameterGroup list operation as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * List RedshiftClusterParameterGroup resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a RedshiftClusterParameterGroup list operation as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(Context context); + + /** + * List RedshiftClusterParameterGroup resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a RedshiftClusterParameterGroup list operation as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * List RedshiftClusterParameterGroup resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a RedshiftClusterParameterGroup list operation as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Get a RedshiftClusterParameterGroup. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of RedshiftClusterParameterGroup. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a RedshiftClusterParameterGroup along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getByResourceGroupWithResponse(String resourceGroupName, String name, + Context context); + + /** + * Get a RedshiftClusterParameterGroup. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of RedshiftClusterParameterGroup. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a RedshiftClusterParameterGroup. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + RedshiftClusterParameterGroupInner getByResourceGroup(String resourceGroupName, String name); + + /** + * Create a RedshiftClusterParameterGroup. Please note that end user resource creation is currently restricted, but + * it will be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of RedshiftClusterParameterGroup. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, RedshiftClusterParameterGroupInner> + beginCreateOrReplace(String resourceGroupName, String name, RedshiftClusterParameterGroupInner resource); + + /** + * Create a RedshiftClusterParameterGroup. Please note that end user resource creation is currently restricted, but + * it will be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of RedshiftClusterParameterGroup. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, RedshiftClusterParameterGroupInner> beginCreateOrReplace( + String resourceGroupName, String name, RedshiftClusterParameterGroupInner resource, Context context); + + /** + * Create a RedshiftClusterParameterGroup. Please note that end user resource creation is currently restricted, but + * it will be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of RedshiftClusterParameterGroup. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + RedshiftClusterParameterGroupInner createOrReplace(String resourceGroupName, String name, + RedshiftClusterParameterGroupInner resource); + + /** + * Create a RedshiftClusterParameterGroup. Please note that end user resource creation is currently restricted, but + * it will be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of RedshiftClusterParameterGroup. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + RedshiftClusterParameterGroupInner createOrReplace(String resourceGroupName, String name, + RedshiftClusterParameterGroupInner resource, Context context); + + /** + * Update a RedshiftClusterParameterGroup. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of RedshiftClusterParameterGroup. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, RedshiftClusterParameterGroupInner> + beginUpdate(String resourceGroupName, String name, RedshiftClusterParameterGroupTagsUpdate properties); + + /** + * Update a RedshiftClusterParameterGroup. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of RedshiftClusterParameterGroup. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, RedshiftClusterParameterGroupInner> beginUpdate( + String resourceGroupName, String name, RedshiftClusterParameterGroupTagsUpdate properties, Context context); + + /** + * Update a RedshiftClusterParameterGroup. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of RedshiftClusterParameterGroup. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + RedshiftClusterParameterGroupInner update(String resourceGroupName, String name, + RedshiftClusterParameterGroupTagsUpdate properties); + + /** + * Update a RedshiftClusterParameterGroup. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of RedshiftClusterParameterGroup. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + RedshiftClusterParameterGroupInner update(String resourceGroupName, String name, + RedshiftClusterParameterGroupTagsUpdate properties, Context context); + + /** + * Delete a RedshiftClusterParameterGroup. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of RedshiftClusterParameterGroup. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String name); + + /** + * Delete a RedshiftClusterParameterGroup. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of RedshiftClusterParameterGroup. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String name, Context context); + + /** + * Delete a RedshiftClusterParameterGroup. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of RedshiftClusterParameterGroup. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String name); + + /** + * Delete a RedshiftClusterParameterGroup. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of RedshiftClusterParameterGroup. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String name, Context context); +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/RedshiftClustersClient.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/RedshiftClustersClient.java new file mode 100644 index 000000000000..07a6f528c362 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/RedshiftClustersClient.java @@ -0,0 +1,273 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.awsconnector.fluent.models.RedshiftClusterInner; +import com.azure.resourcemanager.awsconnector.models.RedshiftClusterTagsUpdate; + +/** + * An instance of this class provides access to all the operations defined in RedshiftClustersClient. + */ +public interface RedshiftClustersClient { + /** + * List RedshiftCluster resources by subscription ID. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a RedshiftCluster list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * List RedshiftCluster resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a RedshiftCluster list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(Context context); + + /** + * List RedshiftCluster resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a RedshiftCluster list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * List RedshiftCluster resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a RedshiftCluster list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Get a RedshiftCluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of RedshiftCluster. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a RedshiftCluster along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getByResourceGroupWithResponse(String resourceGroupName, String name, + Context context); + + /** + * Get a RedshiftCluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of RedshiftCluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a RedshiftCluster. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + RedshiftClusterInner getByResourceGroup(String resourceGroupName, String name); + + /** + * Create a RedshiftCluster. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of RedshiftCluster. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, RedshiftClusterInner> beginCreateOrReplace(String resourceGroupName, + String name, RedshiftClusterInner resource); + + /** + * Create a RedshiftCluster. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of RedshiftCluster. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, RedshiftClusterInner> beginCreateOrReplace(String resourceGroupName, + String name, RedshiftClusterInner resource, Context context); + + /** + * Create a RedshiftCluster. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of RedshiftCluster. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + RedshiftClusterInner createOrReplace(String resourceGroupName, String name, RedshiftClusterInner resource); + + /** + * Create a RedshiftCluster. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of RedshiftCluster. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + RedshiftClusterInner createOrReplace(String resourceGroupName, String name, RedshiftClusterInner resource, + Context context); + + /** + * Update a RedshiftCluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of RedshiftCluster. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, RedshiftClusterInner> beginUpdate(String resourceGroupName, + String name, RedshiftClusterTagsUpdate properties); + + /** + * Update a RedshiftCluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of RedshiftCluster. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, RedshiftClusterInner> beginUpdate(String resourceGroupName, + String name, RedshiftClusterTagsUpdate properties, Context context); + + /** + * Update a RedshiftCluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of RedshiftCluster. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + RedshiftClusterInner update(String resourceGroupName, String name, RedshiftClusterTagsUpdate properties); + + /** + * Update a RedshiftCluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of RedshiftCluster. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + RedshiftClusterInner update(String resourceGroupName, String name, RedshiftClusterTagsUpdate properties, + Context context); + + /** + * Delete a RedshiftCluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of RedshiftCluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String name); + + /** + * Delete a RedshiftCluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of RedshiftCluster. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String name, Context context); + + /** + * Delete a RedshiftCluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of RedshiftCluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String name); + + /** + * Delete a RedshiftCluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of RedshiftCluster. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String name, Context context); +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/Route53DomainsDomainSummariesClient.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/Route53DomainsDomainSummariesClient.java new file mode 100644 index 000000000000..d8bc3d47b26b --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/Route53DomainsDomainSummariesClient.java @@ -0,0 +1,279 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.awsconnector.fluent.models.Route53DomainsDomainSummaryInner; +import com.azure.resourcemanager.awsconnector.models.Route53DomainsDomainSummaryTagsUpdate; + +/** + * An instance of this class provides access to all the operations defined in Route53DomainsDomainSummariesClient. + */ +public interface Route53DomainsDomainSummariesClient { + /** + * List Route53DomainsDomainSummary resources by subscription ID. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Route53DomainsDomainSummary list operation as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * List Route53DomainsDomainSummary resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Route53DomainsDomainSummary list operation as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(Context context); + + /** + * List Route53DomainsDomainSummary resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Route53DomainsDomainSummary list operation as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * List Route53DomainsDomainSummary resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Route53DomainsDomainSummary list operation as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Get a Route53DomainsDomainSummary. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Route53DomainsDomainSummary. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Route53DomainsDomainSummary along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getByResourceGroupWithResponse(String resourceGroupName, String name, + Context context); + + /** + * Get a Route53DomainsDomainSummary. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Route53DomainsDomainSummary. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Route53DomainsDomainSummary. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Route53DomainsDomainSummaryInner getByResourceGroup(String resourceGroupName, String name); + + /** + * Create a Route53DomainsDomainSummary. Please note that end user resource creation is currently restricted, but it + * will be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Route53DomainsDomainSummary. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Route53DomainsDomainSummaryInner> + beginCreateOrReplace(String resourceGroupName, String name, Route53DomainsDomainSummaryInner resource); + + /** + * Create a Route53DomainsDomainSummary. Please note that end user resource creation is currently restricted, but it + * will be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Route53DomainsDomainSummary. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Route53DomainsDomainSummaryInner> beginCreateOrReplace( + String resourceGroupName, String name, Route53DomainsDomainSummaryInner resource, Context context); + + /** + * Create a Route53DomainsDomainSummary. Please note that end user resource creation is currently restricted, but it + * will be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Route53DomainsDomainSummary. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Route53DomainsDomainSummaryInner createOrReplace(String resourceGroupName, String name, + Route53DomainsDomainSummaryInner resource); + + /** + * Create a Route53DomainsDomainSummary. Please note that end user resource creation is currently restricted, but it + * will be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Route53DomainsDomainSummary. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Route53DomainsDomainSummaryInner createOrReplace(String resourceGroupName, String name, + Route53DomainsDomainSummaryInner resource, Context context); + + /** + * Update a Route53DomainsDomainSummary. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Route53DomainsDomainSummary. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Route53DomainsDomainSummaryInner> + beginUpdate(String resourceGroupName, String name, Route53DomainsDomainSummaryTagsUpdate properties); + + /** + * Update a Route53DomainsDomainSummary. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Route53DomainsDomainSummary. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Route53DomainsDomainSummaryInner> beginUpdate( + String resourceGroupName, String name, Route53DomainsDomainSummaryTagsUpdate properties, Context context); + + /** + * Update a Route53DomainsDomainSummary. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Route53DomainsDomainSummary. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Route53DomainsDomainSummaryInner update(String resourceGroupName, String name, + Route53DomainsDomainSummaryTagsUpdate properties); + + /** + * Update a Route53DomainsDomainSummary. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Route53DomainsDomainSummary. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Route53DomainsDomainSummaryInner update(String resourceGroupName, String name, + Route53DomainsDomainSummaryTagsUpdate properties, Context context); + + /** + * Delete a Route53DomainsDomainSummary. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Route53DomainsDomainSummary. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String name); + + /** + * Delete a Route53DomainsDomainSummary. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Route53DomainsDomainSummary. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String name, Context context); + + /** + * Delete a Route53DomainsDomainSummary. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Route53DomainsDomainSummary. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String name); + + /** + * Delete a Route53DomainsDomainSummary. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Route53DomainsDomainSummary. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String name, Context context); +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/Route53HostedZonesClient.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/Route53HostedZonesClient.java new file mode 100644 index 000000000000..5731b360e394 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/Route53HostedZonesClient.java @@ -0,0 +1,273 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.awsconnector.fluent.models.Route53HostedZoneInner; +import com.azure.resourcemanager.awsconnector.models.Route53HostedZoneTagsUpdate; + +/** + * An instance of this class provides access to all the operations defined in Route53HostedZonesClient. + */ +public interface Route53HostedZonesClient { + /** + * List Route53HostedZone resources by subscription ID. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Route53HostedZone list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * List Route53HostedZone resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Route53HostedZone list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(Context context); + + /** + * List Route53HostedZone resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Route53HostedZone list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * List Route53HostedZone resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Route53HostedZone list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Get a Route53HostedZone. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Route53HostedZone. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Route53HostedZone along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getByResourceGroupWithResponse(String resourceGroupName, String name, + Context context); + + /** + * Get a Route53HostedZone. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Route53HostedZone. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Route53HostedZone. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Route53HostedZoneInner getByResourceGroup(String resourceGroupName, String name); + + /** + * Create a Route53HostedZone. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Route53HostedZone. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Route53HostedZoneInner> + beginCreateOrReplace(String resourceGroupName, String name, Route53HostedZoneInner resource); + + /** + * Create a Route53HostedZone. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Route53HostedZone. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Route53HostedZoneInner> + beginCreateOrReplace(String resourceGroupName, String name, Route53HostedZoneInner resource, Context context); + + /** + * Create a Route53HostedZone. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Route53HostedZone. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Route53HostedZoneInner createOrReplace(String resourceGroupName, String name, Route53HostedZoneInner resource); + + /** + * Create a Route53HostedZone. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Route53HostedZone. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Route53HostedZoneInner createOrReplace(String resourceGroupName, String name, Route53HostedZoneInner resource, + Context context); + + /** + * Update a Route53HostedZone. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Route53HostedZone. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Route53HostedZoneInner> beginUpdate(String resourceGroupName, + String name, Route53HostedZoneTagsUpdate properties); + + /** + * Update a Route53HostedZone. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Route53HostedZone. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Route53HostedZoneInner> beginUpdate(String resourceGroupName, + String name, Route53HostedZoneTagsUpdate properties, Context context); + + /** + * Update a Route53HostedZone. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Route53HostedZone. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Route53HostedZoneInner update(String resourceGroupName, String name, Route53HostedZoneTagsUpdate properties); + + /** + * Update a Route53HostedZone. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Route53HostedZone. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Route53HostedZoneInner update(String resourceGroupName, String name, Route53HostedZoneTagsUpdate properties, + Context context); + + /** + * Delete a Route53HostedZone. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Route53HostedZone. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String name); + + /** + * Delete a Route53HostedZone. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Route53HostedZone. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String name, Context context); + + /** + * Delete a Route53HostedZone. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Route53HostedZone. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String name); + + /** + * Delete a Route53HostedZone. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Route53HostedZone. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String name, Context context); +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/Route53ResourceRecordSetsClient.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/Route53ResourceRecordSetsClient.java new file mode 100644 index 000000000000..c4aee568a43b --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/Route53ResourceRecordSetsClient.java @@ -0,0 +1,279 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.awsconnector.fluent.models.Route53ResourceRecordSetInner; +import com.azure.resourcemanager.awsconnector.models.Route53ResourceRecordSetTagsUpdate; + +/** + * An instance of this class provides access to all the operations defined in Route53ResourceRecordSetsClient. + */ +public interface Route53ResourceRecordSetsClient { + /** + * List Route53ResourceRecordSet resources by subscription ID. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Route53ResourceRecordSet list operation as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * List Route53ResourceRecordSet resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Route53ResourceRecordSet list operation as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(Context context); + + /** + * List Route53ResourceRecordSet resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Route53ResourceRecordSet list operation as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * List Route53ResourceRecordSet resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Route53ResourceRecordSet list operation as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Get a Route53ResourceRecordSet. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Route53ResourceRecordSet. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Route53ResourceRecordSet along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getByResourceGroupWithResponse(String resourceGroupName, String name, + Context context); + + /** + * Get a Route53ResourceRecordSet. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Route53ResourceRecordSet. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Route53ResourceRecordSet. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Route53ResourceRecordSetInner getByResourceGroup(String resourceGroupName, String name); + + /** + * Create a Route53ResourceRecordSet. Please note that end user resource creation is currently restricted, but it + * will be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Route53ResourceRecordSet. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Route53ResourceRecordSetInner> + beginCreateOrReplace(String resourceGroupName, String name, Route53ResourceRecordSetInner resource); + + /** + * Create a Route53ResourceRecordSet. Please note that end user resource creation is currently restricted, but it + * will be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Route53ResourceRecordSet. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Route53ResourceRecordSetInner> beginCreateOrReplace( + String resourceGroupName, String name, Route53ResourceRecordSetInner resource, Context context); + + /** + * Create a Route53ResourceRecordSet. Please note that end user resource creation is currently restricted, but it + * will be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Route53ResourceRecordSet. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Route53ResourceRecordSetInner createOrReplace(String resourceGroupName, String name, + Route53ResourceRecordSetInner resource); + + /** + * Create a Route53ResourceRecordSet. Please note that end user resource creation is currently restricted, but it + * will be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Route53ResourceRecordSet. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Route53ResourceRecordSetInner createOrReplace(String resourceGroupName, String name, + Route53ResourceRecordSetInner resource, Context context); + + /** + * Update a Route53ResourceRecordSet. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Route53ResourceRecordSet. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Route53ResourceRecordSetInner> + beginUpdate(String resourceGroupName, String name, Route53ResourceRecordSetTagsUpdate properties); + + /** + * Update a Route53ResourceRecordSet. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Route53ResourceRecordSet. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Route53ResourceRecordSetInner> beginUpdate( + String resourceGroupName, String name, Route53ResourceRecordSetTagsUpdate properties, Context context); + + /** + * Update a Route53ResourceRecordSet. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Route53ResourceRecordSet. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Route53ResourceRecordSetInner update(String resourceGroupName, String name, + Route53ResourceRecordSetTagsUpdate properties); + + /** + * Update a Route53ResourceRecordSet. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Route53ResourceRecordSet. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Route53ResourceRecordSetInner update(String resourceGroupName, String name, + Route53ResourceRecordSetTagsUpdate properties, Context context); + + /** + * Delete a Route53ResourceRecordSet. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Route53ResourceRecordSet. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String name); + + /** + * Delete a Route53ResourceRecordSet. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Route53ResourceRecordSet. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String name, Context context); + + /** + * Delete a Route53ResourceRecordSet. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Route53ResourceRecordSet. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String name); + + /** + * Delete a Route53ResourceRecordSet. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Route53ResourceRecordSet. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String name, Context context); +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/S3AccessPointsClient.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/S3AccessPointsClient.java new file mode 100644 index 000000000000..fa9f96ba1b55 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/S3AccessPointsClient.java @@ -0,0 +1,272 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.awsconnector.fluent.models.S3AccessPointInner; +import com.azure.resourcemanager.awsconnector.models.S3AccessPointTagsUpdate; + +/** + * An instance of this class provides access to all the operations defined in S3AccessPointsClient. + */ +public interface S3AccessPointsClient { + /** + * List S3AccessPoint resources by subscription ID. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a S3AccessPoint list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * List S3AccessPoint resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a S3AccessPoint list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(Context context); + + /** + * List S3AccessPoint resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a S3AccessPoint list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * List S3AccessPoint resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a S3AccessPoint list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Get a S3AccessPoint. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of S3AccessPoint. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a S3AccessPoint along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getByResourceGroupWithResponse(String resourceGroupName, String name, Context context); + + /** + * Get a S3AccessPoint. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of S3AccessPoint. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a S3AccessPoint. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + S3AccessPointInner getByResourceGroup(String resourceGroupName, String name); + + /** + * Create a S3AccessPoint. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of S3AccessPoint. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, S3AccessPointInner> beginCreateOrReplace(String resourceGroupName, + String name, S3AccessPointInner resource); + + /** + * Create a S3AccessPoint. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of S3AccessPoint. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, S3AccessPointInner> beginCreateOrReplace(String resourceGroupName, + String name, S3AccessPointInner resource, Context context); + + /** + * Create a S3AccessPoint. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of S3AccessPoint. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + S3AccessPointInner createOrReplace(String resourceGroupName, String name, S3AccessPointInner resource); + + /** + * Create a S3AccessPoint. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of S3AccessPoint. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + S3AccessPointInner createOrReplace(String resourceGroupName, String name, S3AccessPointInner resource, + Context context); + + /** + * Update a S3AccessPoint. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of S3AccessPoint. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, S3AccessPointInner> beginUpdate(String resourceGroupName, String name, + S3AccessPointTagsUpdate properties); + + /** + * Update a S3AccessPoint. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of S3AccessPoint. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, S3AccessPointInner> beginUpdate(String resourceGroupName, String name, + S3AccessPointTagsUpdate properties, Context context); + + /** + * Update a S3AccessPoint. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of S3AccessPoint. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + S3AccessPointInner update(String resourceGroupName, String name, S3AccessPointTagsUpdate properties); + + /** + * Update a S3AccessPoint. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of S3AccessPoint. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + S3AccessPointInner update(String resourceGroupName, String name, S3AccessPointTagsUpdate properties, + Context context); + + /** + * Delete a S3AccessPoint. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of S3AccessPoint. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String name); + + /** + * Delete a S3AccessPoint. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of S3AccessPoint. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String name, Context context); + + /** + * Delete a S3AccessPoint. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of S3AccessPoint. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String name); + + /** + * Delete a S3AccessPoint. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of S3AccessPoint. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String name, Context context); +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/S3BucketPoliciesClient.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/S3BucketPoliciesClient.java new file mode 100644 index 000000000000..6a4ff4edeb09 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/S3BucketPoliciesClient.java @@ -0,0 +1,273 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.awsconnector.fluent.models.S3BucketPolicyInner; +import com.azure.resourcemanager.awsconnector.models.S3BucketPolicyTagsUpdate; + +/** + * An instance of this class provides access to all the operations defined in S3BucketPoliciesClient. + */ +public interface S3BucketPoliciesClient { + /** + * List S3BucketPolicy resources by subscription ID. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a S3BucketPolicy list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * List S3BucketPolicy resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a S3BucketPolicy list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(Context context); + + /** + * List S3BucketPolicy resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a S3BucketPolicy list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * List S3BucketPolicy resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a S3BucketPolicy list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Get a S3BucketPolicy. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of S3BucketPolicy. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a S3BucketPolicy along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getByResourceGroupWithResponse(String resourceGroupName, String name, + Context context); + + /** + * Get a S3BucketPolicy. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of S3BucketPolicy. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a S3BucketPolicy. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + S3BucketPolicyInner getByResourceGroup(String resourceGroupName, String name); + + /** + * Create a S3BucketPolicy. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of S3BucketPolicy. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, S3BucketPolicyInner> beginCreateOrReplace(String resourceGroupName, + String name, S3BucketPolicyInner resource); + + /** + * Create a S3BucketPolicy. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of S3BucketPolicy. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, S3BucketPolicyInner> beginCreateOrReplace(String resourceGroupName, + String name, S3BucketPolicyInner resource, Context context); + + /** + * Create a S3BucketPolicy. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of S3BucketPolicy. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + S3BucketPolicyInner createOrReplace(String resourceGroupName, String name, S3BucketPolicyInner resource); + + /** + * Create a S3BucketPolicy. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of S3BucketPolicy. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + S3BucketPolicyInner createOrReplace(String resourceGroupName, String name, S3BucketPolicyInner resource, + Context context); + + /** + * Update a S3BucketPolicy. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of S3BucketPolicy. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, S3BucketPolicyInner> beginUpdate(String resourceGroupName, String name, + S3BucketPolicyTagsUpdate properties); + + /** + * Update a S3BucketPolicy. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of S3BucketPolicy. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, S3BucketPolicyInner> beginUpdate(String resourceGroupName, String name, + S3BucketPolicyTagsUpdate properties, Context context); + + /** + * Update a S3BucketPolicy. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of S3BucketPolicy. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + S3BucketPolicyInner update(String resourceGroupName, String name, S3BucketPolicyTagsUpdate properties); + + /** + * Update a S3BucketPolicy. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of S3BucketPolicy. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + S3BucketPolicyInner update(String resourceGroupName, String name, S3BucketPolicyTagsUpdate properties, + Context context); + + /** + * Delete a S3BucketPolicy. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of S3BucketPolicy. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String name); + + /** + * Delete a S3BucketPolicy. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of S3BucketPolicy. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String name, Context context); + + /** + * Delete a S3BucketPolicy. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of S3BucketPolicy. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String name); + + /** + * Delete a S3BucketPolicy. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of S3BucketPolicy. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String name, Context context); +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/S3BucketsClient.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/S3BucketsClient.java new file mode 100644 index 000000000000..2b4bf7dbf0d9 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/S3BucketsClient.java @@ -0,0 +1,270 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.awsconnector.fluent.models.S3BucketInner; +import com.azure.resourcemanager.awsconnector.models.S3BucketTagsUpdate; + +/** + * An instance of this class provides access to all the operations defined in S3BucketsClient. + */ +public interface S3BucketsClient { + /** + * List S3Bucket resources by subscription ID. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a S3Bucket list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * List S3Bucket resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a S3Bucket list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(Context context); + + /** + * List S3Bucket resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a S3Bucket list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * List S3Bucket resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a S3Bucket list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Get a S3Bucket. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of S3Bucket. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a S3Bucket along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getByResourceGroupWithResponse(String resourceGroupName, String name, Context context); + + /** + * Get a S3Bucket. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of S3Bucket. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a S3Bucket. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + S3BucketInner getByResourceGroup(String resourceGroupName, String name); + + /** + * Create a S3Bucket. Please note that end user resource creation is currently restricted, but it will be enabled in + * the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of S3Bucket. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, S3BucketInner> beginCreateOrReplace(String resourceGroupName, String name, + S3BucketInner resource); + + /** + * Create a S3Bucket. Please note that end user resource creation is currently restricted, but it will be enabled in + * the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of S3Bucket. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, S3BucketInner> beginCreateOrReplace(String resourceGroupName, String name, + S3BucketInner resource, Context context); + + /** + * Create a S3Bucket. Please note that end user resource creation is currently restricted, but it will be enabled in + * the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of S3Bucket. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + S3BucketInner createOrReplace(String resourceGroupName, String name, S3BucketInner resource); + + /** + * Create a S3Bucket. Please note that end user resource creation is currently restricted, but it will be enabled in + * the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of S3Bucket. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + S3BucketInner createOrReplace(String resourceGroupName, String name, S3BucketInner resource, Context context); + + /** + * Update a S3Bucket. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of S3Bucket. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, S3BucketInner> beginUpdate(String resourceGroupName, String name, + S3BucketTagsUpdate properties); + + /** + * Update a S3Bucket. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of S3Bucket. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, S3BucketInner> beginUpdate(String resourceGroupName, String name, + S3BucketTagsUpdate properties, Context context); + + /** + * Update a S3Bucket. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of S3Bucket. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + S3BucketInner update(String resourceGroupName, String name, S3BucketTagsUpdate properties); + + /** + * Update a S3Bucket. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of S3Bucket. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + S3BucketInner update(String resourceGroupName, String name, S3BucketTagsUpdate properties, Context context); + + /** + * Delete a S3Bucket. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of S3Bucket. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String name); + + /** + * Delete a S3Bucket. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of S3Bucket. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String name, Context context); + + /** + * Delete a S3Bucket. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of S3Bucket. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String name); + + /** + * Delete a S3Bucket. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of S3Bucket. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String name, Context context); +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/S3ControlMultiRegionAccessPointPolicyDocumentsClient.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/S3ControlMultiRegionAccessPointPolicyDocumentsClient.java new file mode 100644 index 000000000000..8d60c09ce4de --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/S3ControlMultiRegionAccessPointPolicyDocumentsClient.java @@ -0,0 +1,285 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.awsconnector.fluent.models.S3ControlMultiRegionAccessPointPolicyDocumentInner; +import com.azure.resourcemanager.awsconnector.models.S3ControlMultiRegionAccessPointPolicyDocumentTagsUpdate; + +/** + * An instance of this class provides access to all the operations defined in + * S3ControlMultiRegionAccessPointPolicyDocumentsClient. + */ +public interface S3ControlMultiRegionAccessPointPolicyDocumentsClient { + /** + * List S3ControlMultiRegionAccessPointPolicyDocument resources by subscription ID. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a S3ControlMultiRegionAccessPointPolicyDocument list operation as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * List S3ControlMultiRegionAccessPointPolicyDocument resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a S3ControlMultiRegionAccessPointPolicyDocument list operation as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(Context context); + + /** + * List S3ControlMultiRegionAccessPointPolicyDocument resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a S3ControlMultiRegionAccessPointPolicyDocument list operation as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * List S3ControlMultiRegionAccessPointPolicyDocument resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a S3ControlMultiRegionAccessPointPolicyDocument list operation as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName, + Context context); + + /** + * Get a S3ControlMultiRegionAccessPointPolicyDocument. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of S3ControlMultiRegionAccessPointPolicyDocument. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a S3ControlMultiRegionAccessPointPolicyDocument along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response + getByResourceGroupWithResponse(String resourceGroupName, String name, Context context); + + /** + * Get a S3ControlMultiRegionAccessPointPolicyDocument. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of S3ControlMultiRegionAccessPointPolicyDocument. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a S3ControlMultiRegionAccessPointPolicyDocument. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + S3ControlMultiRegionAccessPointPolicyDocumentInner getByResourceGroup(String resourceGroupName, String name); + + /** + * Create a S3ControlMultiRegionAccessPointPolicyDocument. Please note that end user resource creation is currently + * restricted, but it will be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of S3ControlMultiRegionAccessPointPolicyDocument. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, S3ControlMultiRegionAccessPointPolicyDocumentInner> + beginCreateOrReplace(String resourceGroupName, String name, + S3ControlMultiRegionAccessPointPolicyDocumentInner resource); + + /** + * Create a S3ControlMultiRegionAccessPointPolicyDocument. Please note that end user resource creation is currently + * restricted, but it will be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of S3ControlMultiRegionAccessPointPolicyDocument. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, S3ControlMultiRegionAccessPointPolicyDocumentInner> + beginCreateOrReplace(String resourceGroupName, String name, + S3ControlMultiRegionAccessPointPolicyDocumentInner resource, Context context); + + /** + * Create a S3ControlMultiRegionAccessPointPolicyDocument. Please note that end user resource creation is currently + * restricted, but it will be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of S3ControlMultiRegionAccessPointPolicyDocument. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + S3ControlMultiRegionAccessPointPolicyDocumentInner createOrReplace(String resourceGroupName, String name, + S3ControlMultiRegionAccessPointPolicyDocumentInner resource); + + /** + * Create a S3ControlMultiRegionAccessPointPolicyDocument. Please note that end user resource creation is currently + * restricted, but it will be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of S3ControlMultiRegionAccessPointPolicyDocument. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + S3ControlMultiRegionAccessPointPolicyDocumentInner createOrReplace(String resourceGroupName, String name, + S3ControlMultiRegionAccessPointPolicyDocumentInner resource, Context context); + + /** + * Update a S3ControlMultiRegionAccessPointPolicyDocument. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of S3ControlMultiRegionAccessPointPolicyDocument. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, S3ControlMultiRegionAccessPointPolicyDocumentInner> + beginUpdate(String resourceGroupName, String name, + S3ControlMultiRegionAccessPointPolicyDocumentTagsUpdate properties); + + /** + * Update a S3ControlMultiRegionAccessPointPolicyDocument. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of S3ControlMultiRegionAccessPointPolicyDocument. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, S3ControlMultiRegionAccessPointPolicyDocumentInner> + beginUpdate(String resourceGroupName, String name, + S3ControlMultiRegionAccessPointPolicyDocumentTagsUpdate properties, Context context); + + /** + * Update a S3ControlMultiRegionAccessPointPolicyDocument. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of S3ControlMultiRegionAccessPointPolicyDocument. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + S3ControlMultiRegionAccessPointPolicyDocumentInner update(String resourceGroupName, String name, + S3ControlMultiRegionAccessPointPolicyDocumentTagsUpdate properties); + + /** + * Update a S3ControlMultiRegionAccessPointPolicyDocument. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of S3ControlMultiRegionAccessPointPolicyDocument. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + S3ControlMultiRegionAccessPointPolicyDocumentInner update(String resourceGroupName, String name, + S3ControlMultiRegionAccessPointPolicyDocumentTagsUpdate properties, Context context); + + /** + * Delete a S3ControlMultiRegionAccessPointPolicyDocument. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of S3ControlMultiRegionAccessPointPolicyDocument. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String name); + + /** + * Delete a S3ControlMultiRegionAccessPointPolicyDocument. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of S3ControlMultiRegionAccessPointPolicyDocument. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String name, Context context); + + /** + * Delete a S3ControlMultiRegionAccessPointPolicyDocument. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of S3ControlMultiRegionAccessPointPolicyDocument. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String name); + + /** + * Delete a S3ControlMultiRegionAccessPointPolicyDocument. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of S3ControlMultiRegionAccessPointPolicyDocument. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String name, Context context); +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/SageMakerAppsClient.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/SageMakerAppsClient.java new file mode 100644 index 000000000000..168851b42c62 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/SageMakerAppsClient.java @@ -0,0 +1,271 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.awsconnector.fluent.models.SageMakerAppInner; +import com.azure.resourcemanager.awsconnector.models.SageMakerAppTagsUpdate; + +/** + * An instance of this class provides access to all the operations defined in SageMakerAppsClient. + */ +public interface SageMakerAppsClient { + /** + * List SageMakerApp resources by subscription ID. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a SageMakerApp list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * List SageMakerApp resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a SageMakerApp list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(Context context); + + /** + * List SageMakerApp resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a SageMakerApp list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * List SageMakerApp resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a SageMakerApp list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Get a SageMakerApp. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of SageMakerApp. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a SageMakerApp along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getByResourceGroupWithResponse(String resourceGroupName, String name, Context context); + + /** + * Get a SageMakerApp. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of SageMakerApp. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a SageMakerApp. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SageMakerAppInner getByResourceGroup(String resourceGroupName, String name); + + /** + * Create a SageMakerApp. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of SageMakerApp. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, SageMakerAppInner> beginCreateOrReplace(String resourceGroupName, + String name, SageMakerAppInner resource); + + /** + * Create a SageMakerApp. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of SageMakerApp. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, SageMakerAppInner> beginCreateOrReplace(String resourceGroupName, + String name, SageMakerAppInner resource, Context context); + + /** + * Create a SageMakerApp. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of SageMakerApp. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SageMakerAppInner createOrReplace(String resourceGroupName, String name, SageMakerAppInner resource); + + /** + * Create a SageMakerApp. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of SageMakerApp. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SageMakerAppInner createOrReplace(String resourceGroupName, String name, SageMakerAppInner resource, + Context context); + + /** + * Update a SageMakerApp. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of SageMakerApp. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, SageMakerAppInner> beginUpdate(String resourceGroupName, String name, + SageMakerAppTagsUpdate properties); + + /** + * Update a SageMakerApp. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of SageMakerApp. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, SageMakerAppInner> beginUpdate(String resourceGroupName, String name, + SageMakerAppTagsUpdate properties, Context context); + + /** + * Update a SageMakerApp. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of SageMakerApp. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SageMakerAppInner update(String resourceGroupName, String name, SageMakerAppTagsUpdate properties); + + /** + * Update a SageMakerApp. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of SageMakerApp. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SageMakerAppInner update(String resourceGroupName, String name, SageMakerAppTagsUpdate properties, Context context); + + /** + * Delete a SageMakerApp. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of SageMakerApp. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String name); + + /** + * Delete a SageMakerApp. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of SageMakerApp. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String name, Context context); + + /** + * Delete a SageMakerApp. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of SageMakerApp. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String name); + + /** + * Delete a SageMakerApp. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of SageMakerApp. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String name, Context context); +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/SageMakerNotebookInstanceSummariesClient.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/SageMakerNotebookInstanceSummariesClient.java new file mode 100644 index 000000000000..a879c9ff9869 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/SageMakerNotebookInstanceSummariesClient.java @@ -0,0 +1,280 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.awsconnector.fluent.models.SageMakerNotebookInstanceSummaryInner; +import com.azure.resourcemanager.awsconnector.models.SageMakerNotebookInstanceSummaryTagsUpdate; + +/** + * An instance of this class provides access to all the operations defined in SageMakerNotebookInstanceSummariesClient. + */ +public interface SageMakerNotebookInstanceSummariesClient { + /** + * List SageMakerNotebookInstanceSummary resources by subscription ID. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a SageMakerNotebookInstanceSummary list operation as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * List SageMakerNotebookInstanceSummary resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a SageMakerNotebookInstanceSummary list operation as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(Context context); + + /** + * List SageMakerNotebookInstanceSummary resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a SageMakerNotebookInstanceSummary list operation as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * List SageMakerNotebookInstanceSummary resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a SageMakerNotebookInstanceSummary list operation as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Get a SageMakerNotebookInstanceSummary. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of SageMakerNotebookInstanceSummary. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a SageMakerNotebookInstanceSummary along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getByResourceGroupWithResponse(String resourceGroupName, + String name, Context context); + + /** + * Get a SageMakerNotebookInstanceSummary. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of SageMakerNotebookInstanceSummary. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a SageMakerNotebookInstanceSummary. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SageMakerNotebookInstanceSummaryInner getByResourceGroup(String resourceGroupName, String name); + + /** + * Create a SageMakerNotebookInstanceSummary. Please note that end user resource creation is currently restricted, + * but it will be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of SageMakerNotebookInstanceSummary. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, SageMakerNotebookInstanceSummaryInner> + beginCreateOrReplace(String resourceGroupName, String name, SageMakerNotebookInstanceSummaryInner resource); + + /** + * Create a SageMakerNotebookInstanceSummary. Please note that end user resource creation is currently restricted, + * but it will be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of SageMakerNotebookInstanceSummary. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, SageMakerNotebookInstanceSummaryInner> + beginCreateOrReplace(String resourceGroupName, String name, SageMakerNotebookInstanceSummaryInner resource, + Context context); + + /** + * Create a SageMakerNotebookInstanceSummary. Please note that end user resource creation is currently restricted, + * but it will be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of SageMakerNotebookInstanceSummary. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SageMakerNotebookInstanceSummaryInner createOrReplace(String resourceGroupName, String name, + SageMakerNotebookInstanceSummaryInner resource); + + /** + * Create a SageMakerNotebookInstanceSummary. Please note that end user resource creation is currently restricted, + * but it will be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of SageMakerNotebookInstanceSummary. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SageMakerNotebookInstanceSummaryInner createOrReplace(String resourceGroupName, String name, + SageMakerNotebookInstanceSummaryInner resource, Context context); + + /** + * Update a SageMakerNotebookInstanceSummary. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of SageMakerNotebookInstanceSummary. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, SageMakerNotebookInstanceSummaryInner> + beginUpdate(String resourceGroupName, String name, SageMakerNotebookInstanceSummaryTagsUpdate properties); + + /** + * Update a SageMakerNotebookInstanceSummary. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of SageMakerNotebookInstanceSummary. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, SageMakerNotebookInstanceSummaryInner> beginUpdate( + String resourceGroupName, String name, SageMakerNotebookInstanceSummaryTagsUpdate properties, Context context); + + /** + * Update a SageMakerNotebookInstanceSummary. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of SageMakerNotebookInstanceSummary. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SageMakerNotebookInstanceSummaryInner update(String resourceGroupName, String name, + SageMakerNotebookInstanceSummaryTagsUpdate properties); + + /** + * Update a SageMakerNotebookInstanceSummary. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of SageMakerNotebookInstanceSummary. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SageMakerNotebookInstanceSummaryInner update(String resourceGroupName, String name, + SageMakerNotebookInstanceSummaryTagsUpdate properties, Context context); + + /** + * Delete a SageMakerNotebookInstanceSummary. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of SageMakerNotebookInstanceSummary. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String name); + + /** + * Delete a SageMakerNotebookInstanceSummary. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of SageMakerNotebookInstanceSummary. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String name, Context context); + + /** + * Delete a SageMakerNotebookInstanceSummary. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of SageMakerNotebookInstanceSummary. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String name); + + /** + * Delete a SageMakerNotebookInstanceSummary. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of SageMakerNotebookInstanceSummary. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String name, Context context); +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/SecretsManagerResourcePoliciesClient.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/SecretsManagerResourcePoliciesClient.java new file mode 100644 index 000000000000..2b4687ca6d98 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/SecretsManagerResourcePoliciesClient.java @@ -0,0 +1,279 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.awsconnector.fluent.models.SecretsManagerResourcePolicyInner; +import com.azure.resourcemanager.awsconnector.models.SecretsManagerResourcePolicyTagsUpdate; + +/** + * An instance of this class provides access to all the operations defined in SecretsManagerResourcePoliciesClient. + */ +public interface SecretsManagerResourcePoliciesClient { + /** + * List SecretsManagerResourcePolicy resources by subscription ID. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a SecretsManagerResourcePolicy list operation as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * List SecretsManagerResourcePolicy resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a SecretsManagerResourcePolicy list operation as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(Context context); + + /** + * List SecretsManagerResourcePolicy resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a SecretsManagerResourcePolicy list operation as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * List SecretsManagerResourcePolicy resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a SecretsManagerResourcePolicy list operation as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Get a SecretsManagerResourcePolicy. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of SecretsManagerResourcePolicy. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a SecretsManagerResourcePolicy along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getByResourceGroupWithResponse(String resourceGroupName, String name, + Context context); + + /** + * Get a SecretsManagerResourcePolicy. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of SecretsManagerResourcePolicy. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a SecretsManagerResourcePolicy. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SecretsManagerResourcePolicyInner getByResourceGroup(String resourceGroupName, String name); + + /** + * Create a SecretsManagerResourcePolicy. Please note that end user resource creation is currently restricted, but + * it will be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of SecretsManagerResourcePolicy. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, SecretsManagerResourcePolicyInner> + beginCreateOrReplace(String resourceGroupName, String name, SecretsManagerResourcePolicyInner resource); + + /** + * Create a SecretsManagerResourcePolicy. Please note that end user resource creation is currently restricted, but + * it will be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of SecretsManagerResourcePolicy. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, SecretsManagerResourcePolicyInner> beginCreateOrReplace( + String resourceGroupName, String name, SecretsManagerResourcePolicyInner resource, Context context); + + /** + * Create a SecretsManagerResourcePolicy. Please note that end user resource creation is currently restricted, but + * it will be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of SecretsManagerResourcePolicy. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SecretsManagerResourcePolicyInner createOrReplace(String resourceGroupName, String name, + SecretsManagerResourcePolicyInner resource); + + /** + * Create a SecretsManagerResourcePolicy. Please note that end user resource creation is currently restricted, but + * it will be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of SecretsManagerResourcePolicy. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SecretsManagerResourcePolicyInner createOrReplace(String resourceGroupName, String name, + SecretsManagerResourcePolicyInner resource, Context context); + + /** + * Update a SecretsManagerResourcePolicy. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of SecretsManagerResourcePolicy. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, SecretsManagerResourcePolicyInner> + beginUpdate(String resourceGroupName, String name, SecretsManagerResourcePolicyTagsUpdate properties); + + /** + * Update a SecretsManagerResourcePolicy. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of SecretsManagerResourcePolicy. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, SecretsManagerResourcePolicyInner> beginUpdate( + String resourceGroupName, String name, SecretsManagerResourcePolicyTagsUpdate properties, Context context); + + /** + * Update a SecretsManagerResourcePolicy. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of SecretsManagerResourcePolicy. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SecretsManagerResourcePolicyInner update(String resourceGroupName, String name, + SecretsManagerResourcePolicyTagsUpdate properties); + + /** + * Update a SecretsManagerResourcePolicy. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of SecretsManagerResourcePolicy. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SecretsManagerResourcePolicyInner update(String resourceGroupName, String name, + SecretsManagerResourcePolicyTagsUpdate properties, Context context); + + /** + * Delete a SecretsManagerResourcePolicy. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of SecretsManagerResourcePolicy. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String name); + + /** + * Delete a SecretsManagerResourcePolicy. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of SecretsManagerResourcePolicy. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String name, Context context); + + /** + * Delete a SecretsManagerResourcePolicy. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of SecretsManagerResourcePolicy. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String name); + + /** + * Delete a SecretsManagerResourcePolicy. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of SecretsManagerResourcePolicy. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String name, Context context); +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/SecretsManagerSecretsClient.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/SecretsManagerSecretsClient.java new file mode 100644 index 000000000000..adc25ca3b7d9 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/SecretsManagerSecretsClient.java @@ -0,0 +1,274 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.awsconnector.fluent.models.SecretsManagerSecretInner; +import com.azure.resourcemanager.awsconnector.models.SecretsManagerSecretTagsUpdate; + +/** + * An instance of this class provides access to all the operations defined in SecretsManagerSecretsClient. + */ +public interface SecretsManagerSecretsClient { + /** + * List SecretsManagerSecret resources by subscription ID. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a SecretsManagerSecret list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * List SecretsManagerSecret resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a SecretsManagerSecret list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(Context context); + + /** + * List SecretsManagerSecret resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a SecretsManagerSecret list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * List SecretsManagerSecret resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a SecretsManagerSecret list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Get a SecretsManagerSecret. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of SecretsManagerSecret. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a SecretsManagerSecret along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getByResourceGroupWithResponse(String resourceGroupName, String name, + Context context); + + /** + * Get a SecretsManagerSecret. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of SecretsManagerSecret. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a SecretsManagerSecret. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SecretsManagerSecretInner getByResourceGroup(String resourceGroupName, String name); + + /** + * Create a SecretsManagerSecret. Please note that end user resource creation is currently restricted, but it will + * be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of SecretsManagerSecret. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, SecretsManagerSecretInner> + beginCreateOrReplace(String resourceGroupName, String name, SecretsManagerSecretInner resource); + + /** + * Create a SecretsManagerSecret. Please note that end user resource creation is currently restricted, but it will + * be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of SecretsManagerSecret. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, SecretsManagerSecretInner> beginCreateOrReplace( + String resourceGroupName, String name, SecretsManagerSecretInner resource, Context context); + + /** + * Create a SecretsManagerSecret. Please note that end user resource creation is currently restricted, but it will + * be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of SecretsManagerSecret. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SecretsManagerSecretInner createOrReplace(String resourceGroupName, String name, + SecretsManagerSecretInner resource); + + /** + * Create a SecretsManagerSecret. Please note that end user resource creation is currently restricted, but it will + * be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of SecretsManagerSecret. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SecretsManagerSecretInner createOrReplace(String resourceGroupName, String name, SecretsManagerSecretInner resource, + Context context); + + /** + * Update a SecretsManagerSecret. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of SecretsManagerSecret. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, SecretsManagerSecretInner> beginUpdate(String resourceGroupName, + String name, SecretsManagerSecretTagsUpdate properties); + + /** + * Update a SecretsManagerSecret. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of SecretsManagerSecret. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, SecretsManagerSecretInner> beginUpdate(String resourceGroupName, + String name, SecretsManagerSecretTagsUpdate properties, Context context); + + /** + * Update a SecretsManagerSecret. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of SecretsManagerSecret. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SecretsManagerSecretInner update(String resourceGroupName, String name, SecretsManagerSecretTagsUpdate properties); + + /** + * Update a SecretsManagerSecret. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of SecretsManagerSecret. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SecretsManagerSecretInner update(String resourceGroupName, String name, SecretsManagerSecretTagsUpdate properties, + Context context); + + /** + * Delete a SecretsManagerSecret. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of SecretsManagerSecret. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String name); + + /** + * Delete a SecretsManagerSecret. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of SecretsManagerSecret. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String name, Context context); + + /** + * Delete a SecretsManagerSecret. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of SecretsManagerSecret. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String name); + + /** + * Delete a SecretsManagerSecret. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of SecretsManagerSecret. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String name, Context context); +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/SnsSubscriptionsClient.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/SnsSubscriptionsClient.java new file mode 100644 index 000000000000..d86fc5b7f5e7 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/SnsSubscriptionsClient.java @@ -0,0 +1,273 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.awsconnector.fluent.models.SnsSubscriptionInner; +import com.azure.resourcemanager.awsconnector.models.SnsSubscriptionTagsUpdate; + +/** + * An instance of this class provides access to all the operations defined in SnsSubscriptionsClient. + */ +public interface SnsSubscriptionsClient { + /** + * List SnsSubscription resources by subscription ID. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a SnsSubscription list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * List SnsSubscription resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a SnsSubscription list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(Context context); + + /** + * List SnsSubscription resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a SnsSubscription list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * List SnsSubscription resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a SnsSubscription list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Get a SnsSubscription. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of SnsSubscription. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a SnsSubscription along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getByResourceGroupWithResponse(String resourceGroupName, String name, + Context context); + + /** + * Get a SnsSubscription. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of SnsSubscription. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a SnsSubscription. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SnsSubscriptionInner getByResourceGroup(String resourceGroupName, String name); + + /** + * Create a SnsSubscription. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of SnsSubscription. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, SnsSubscriptionInner> beginCreateOrReplace(String resourceGroupName, + String name, SnsSubscriptionInner resource); + + /** + * Create a SnsSubscription. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of SnsSubscription. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, SnsSubscriptionInner> beginCreateOrReplace(String resourceGroupName, + String name, SnsSubscriptionInner resource, Context context); + + /** + * Create a SnsSubscription. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of SnsSubscription. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SnsSubscriptionInner createOrReplace(String resourceGroupName, String name, SnsSubscriptionInner resource); + + /** + * Create a SnsSubscription. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of SnsSubscription. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SnsSubscriptionInner createOrReplace(String resourceGroupName, String name, SnsSubscriptionInner resource, + Context context); + + /** + * Update a SnsSubscription. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of SnsSubscription. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, SnsSubscriptionInner> beginUpdate(String resourceGroupName, + String name, SnsSubscriptionTagsUpdate properties); + + /** + * Update a SnsSubscription. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of SnsSubscription. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, SnsSubscriptionInner> beginUpdate(String resourceGroupName, + String name, SnsSubscriptionTagsUpdate properties, Context context); + + /** + * Update a SnsSubscription. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of SnsSubscription. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SnsSubscriptionInner update(String resourceGroupName, String name, SnsSubscriptionTagsUpdate properties); + + /** + * Update a SnsSubscription. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of SnsSubscription. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SnsSubscriptionInner update(String resourceGroupName, String name, SnsSubscriptionTagsUpdate properties, + Context context); + + /** + * Delete a SnsSubscription. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of SnsSubscription. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String name); + + /** + * Delete a SnsSubscription. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of SnsSubscription. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String name, Context context); + + /** + * Delete a SnsSubscription. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of SnsSubscription. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String name); + + /** + * Delete a SnsSubscription. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of SnsSubscription. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String name, Context context); +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/SnsTopicsClient.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/SnsTopicsClient.java new file mode 100644 index 000000000000..c461a4570afa --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/SnsTopicsClient.java @@ -0,0 +1,270 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.awsconnector.fluent.models.SnsTopicInner; +import com.azure.resourcemanager.awsconnector.models.SnsTopicTagsUpdate; + +/** + * An instance of this class provides access to all the operations defined in SnsTopicsClient. + */ +public interface SnsTopicsClient { + /** + * List SnsTopic resources by subscription ID. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a SnsTopic list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * List SnsTopic resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a SnsTopic list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(Context context); + + /** + * List SnsTopic resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a SnsTopic list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * List SnsTopic resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a SnsTopic list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Get a SnsTopic. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of SnsTopic. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a SnsTopic along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getByResourceGroupWithResponse(String resourceGroupName, String name, Context context); + + /** + * Get a SnsTopic. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of SnsTopic. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a SnsTopic. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SnsTopicInner getByResourceGroup(String resourceGroupName, String name); + + /** + * Create a SnsTopic. Please note that end user resource creation is currently restricted, but it will be enabled in + * the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of SnsTopic. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, SnsTopicInner> beginCreateOrReplace(String resourceGroupName, String name, + SnsTopicInner resource); + + /** + * Create a SnsTopic. Please note that end user resource creation is currently restricted, but it will be enabled in + * the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of SnsTopic. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, SnsTopicInner> beginCreateOrReplace(String resourceGroupName, String name, + SnsTopicInner resource, Context context); + + /** + * Create a SnsTopic. Please note that end user resource creation is currently restricted, but it will be enabled in + * the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of SnsTopic. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SnsTopicInner createOrReplace(String resourceGroupName, String name, SnsTopicInner resource); + + /** + * Create a SnsTopic. Please note that end user resource creation is currently restricted, but it will be enabled in + * the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of SnsTopic. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SnsTopicInner createOrReplace(String resourceGroupName, String name, SnsTopicInner resource, Context context); + + /** + * Update a SnsTopic. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of SnsTopic. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, SnsTopicInner> beginUpdate(String resourceGroupName, String name, + SnsTopicTagsUpdate properties); + + /** + * Update a SnsTopic. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of SnsTopic. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, SnsTopicInner> beginUpdate(String resourceGroupName, String name, + SnsTopicTagsUpdate properties, Context context); + + /** + * Update a SnsTopic. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of SnsTopic. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SnsTopicInner update(String resourceGroupName, String name, SnsTopicTagsUpdate properties); + + /** + * Update a SnsTopic. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of SnsTopic. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SnsTopicInner update(String resourceGroupName, String name, SnsTopicTagsUpdate properties, Context context); + + /** + * Delete a SnsTopic. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of SnsTopic. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String name); + + /** + * Delete a SnsTopic. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of SnsTopic. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String name, Context context); + + /** + * Delete a SnsTopic. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of SnsTopic. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String name); + + /** + * Delete a SnsTopic. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of SnsTopic. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String name, Context context); +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/SqsQueuesClient.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/SqsQueuesClient.java new file mode 100644 index 000000000000..47c7c1f46129 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/SqsQueuesClient.java @@ -0,0 +1,270 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.awsconnector.fluent.models.SqsQueueInner; +import com.azure.resourcemanager.awsconnector.models.SqsQueueTagsUpdate; + +/** + * An instance of this class provides access to all the operations defined in SqsQueuesClient. + */ +public interface SqsQueuesClient { + /** + * List SqsQueue resources by subscription ID. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a SqsQueue list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * List SqsQueue resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a SqsQueue list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(Context context); + + /** + * List SqsQueue resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a SqsQueue list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * List SqsQueue resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a SqsQueue list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Get a SqsQueue. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of SqsQueue. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a SqsQueue along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getByResourceGroupWithResponse(String resourceGroupName, String name, Context context); + + /** + * Get a SqsQueue. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of SqsQueue. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a SqsQueue. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SqsQueueInner getByResourceGroup(String resourceGroupName, String name); + + /** + * Create a SqsQueue. Please note that end user resource creation is currently restricted, but it will be enabled in + * the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of SqsQueue. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, SqsQueueInner> beginCreateOrReplace(String resourceGroupName, String name, + SqsQueueInner resource); + + /** + * Create a SqsQueue. Please note that end user resource creation is currently restricted, but it will be enabled in + * the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of SqsQueue. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, SqsQueueInner> beginCreateOrReplace(String resourceGroupName, String name, + SqsQueueInner resource, Context context); + + /** + * Create a SqsQueue. Please note that end user resource creation is currently restricted, but it will be enabled in + * the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of SqsQueue. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SqsQueueInner createOrReplace(String resourceGroupName, String name, SqsQueueInner resource); + + /** + * Create a SqsQueue. Please note that end user resource creation is currently restricted, but it will be enabled in + * the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of SqsQueue. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SqsQueueInner createOrReplace(String resourceGroupName, String name, SqsQueueInner resource, Context context); + + /** + * Update a SqsQueue. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of SqsQueue. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, SqsQueueInner> beginUpdate(String resourceGroupName, String name, + SqsQueueTagsUpdate properties); + + /** + * Update a SqsQueue. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of SqsQueue. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, SqsQueueInner> beginUpdate(String resourceGroupName, String name, + SqsQueueTagsUpdate properties, Context context); + + /** + * Update a SqsQueue. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of SqsQueue. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SqsQueueInner update(String resourceGroupName, String name, SqsQueueTagsUpdate properties); + + /** + * Update a SqsQueue. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of SqsQueue. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SqsQueueInner update(String resourceGroupName, String name, SqsQueueTagsUpdate properties, Context context); + + /** + * Delete a SqsQueue. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of SqsQueue. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String name); + + /** + * Delete a SqsQueue. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of SqsQueue. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String name, Context context); + + /** + * Delete a SqsQueue. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of SqsQueue. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String name); + + /** + * Delete a SqsQueue. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of SqsQueue. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String name, Context context); +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/SsmInstanceInformationsClient.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/SsmInstanceInformationsClient.java new file mode 100644 index 000000000000..295faf44985e --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/SsmInstanceInformationsClient.java @@ -0,0 +1,275 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.awsconnector.fluent.models.SsmInstanceInformationInner; +import com.azure.resourcemanager.awsconnector.models.SsmInstanceInformationTagsUpdate; + +/** + * An instance of this class provides access to all the operations defined in SsmInstanceInformationsClient. + */ +public interface SsmInstanceInformationsClient { + /** + * List SsmInstanceInformation resources by subscription ID. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a SsmInstanceInformation list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * List SsmInstanceInformation resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a SsmInstanceInformation list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(Context context); + + /** + * List SsmInstanceInformation resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a SsmInstanceInformation list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * List SsmInstanceInformation resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a SsmInstanceInformation list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Get a SsmInstanceInformation. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of SsmInstanceInformation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a SsmInstanceInformation along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getByResourceGroupWithResponse(String resourceGroupName, String name, + Context context); + + /** + * Get a SsmInstanceInformation. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of SsmInstanceInformation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a SsmInstanceInformation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SsmInstanceInformationInner getByResourceGroup(String resourceGroupName, String name); + + /** + * Create a SsmInstanceInformation. Please note that end user resource creation is currently restricted, but it will + * be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of SsmInstanceInformation. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, SsmInstanceInformationInner> + beginCreateOrReplace(String resourceGroupName, String name, SsmInstanceInformationInner resource); + + /** + * Create a SsmInstanceInformation. Please note that end user resource creation is currently restricted, but it will + * be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of SsmInstanceInformation. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, SsmInstanceInformationInner> beginCreateOrReplace( + String resourceGroupName, String name, SsmInstanceInformationInner resource, Context context); + + /** + * Create a SsmInstanceInformation. Please note that end user resource creation is currently restricted, but it will + * be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of SsmInstanceInformation. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SsmInstanceInformationInner createOrReplace(String resourceGroupName, String name, + SsmInstanceInformationInner resource); + + /** + * Create a SsmInstanceInformation. Please note that end user resource creation is currently restricted, but it will + * be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of SsmInstanceInformation. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SsmInstanceInformationInner createOrReplace(String resourceGroupName, String name, + SsmInstanceInformationInner resource, Context context); + + /** + * Update a SsmInstanceInformation. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of SsmInstanceInformation. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, SsmInstanceInformationInner> + beginUpdate(String resourceGroupName, String name, SsmInstanceInformationTagsUpdate properties); + + /** + * Update a SsmInstanceInformation. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of SsmInstanceInformation. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, SsmInstanceInformationInner> beginUpdate( + String resourceGroupName, String name, SsmInstanceInformationTagsUpdate properties, Context context); + + /** + * Update a SsmInstanceInformation. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of SsmInstanceInformation. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SsmInstanceInformationInner update(String resourceGroupName, String name, + SsmInstanceInformationTagsUpdate properties); + + /** + * Update a SsmInstanceInformation. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of SsmInstanceInformation. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SsmInstanceInformationInner update(String resourceGroupName, String name, + SsmInstanceInformationTagsUpdate properties, Context context); + + /** + * Delete a SsmInstanceInformation. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of SsmInstanceInformation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String name); + + /** + * Delete a SsmInstanceInformation. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of SsmInstanceInformation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String name, Context context); + + /** + * Delete a SsmInstanceInformation. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of SsmInstanceInformation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String name); + + /** + * Delete a SsmInstanceInformation. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of SsmInstanceInformation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String name, Context context); +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/SsmParametersClient.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/SsmParametersClient.java new file mode 100644 index 000000000000..cc6ab22f3501 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/SsmParametersClient.java @@ -0,0 +1,271 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.awsconnector.fluent.models.SsmParameterInner; +import com.azure.resourcemanager.awsconnector.models.SsmParameterTagsUpdate; + +/** + * An instance of this class provides access to all the operations defined in SsmParametersClient. + */ +public interface SsmParametersClient { + /** + * List SsmParameter resources by subscription ID. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a SsmParameter list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * List SsmParameter resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a SsmParameter list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(Context context); + + /** + * List SsmParameter resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a SsmParameter list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * List SsmParameter resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a SsmParameter list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Get a SsmParameter. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of SsmParameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a SsmParameter along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getByResourceGroupWithResponse(String resourceGroupName, String name, Context context); + + /** + * Get a SsmParameter. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of SsmParameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a SsmParameter. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SsmParameterInner getByResourceGroup(String resourceGroupName, String name); + + /** + * Create a SsmParameter. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of SsmParameter. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, SsmParameterInner> beginCreateOrReplace(String resourceGroupName, + String name, SsmParameterInner resource); + + /** + * Create a SsmParameter. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of SsmParameter. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, SsmParameterInner> beginCreateOrReplace(String resourceGroupName, + String name, SsmParameterInner resource, Context context); + + /** + * Create a SsmParameter. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of SsmParameter. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SsmParameterInner createOrReplace(String resourceGroupName, String name, SsmParameterInner resource); + + /** + * Create a SsmParameter. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of SsmParameter. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SsmParameterInner createOrReplace(String resourceGroupName, String name, SsmParameterInner resource, + Context context); + + /** + * Update a SsmParameter. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of SsmParameter. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, SsmParameterInner> beginUpdate(String resourceGroupName, String name, + SsmParameterTagsUpdate properties); + + /** + * Update a SsmParameter. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of SsmParameter. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, SsmParameterInner> beginUpdate(String resourceGroupName, String name, + SsmParameterTagsUpdate properties, Context context); + + /** + * Update a SsmParameter. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of SsmParameter. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SsmParameterInner update(String resourceGroupName, String name, SsmParameterTagsUpdate properties); + + /** + * Update a SsmParameter. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of SsmParameter. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SsmParameterInner update(String resourceGroupName, String name, SsmParameterTagsUpdate properties, Context context); + + /** + * Delete a SsmParameter. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of SsmParameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String name); + + /** + * Delete a SsmParameter. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of SsmParameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String name, Context context); + + /** + * Delete a SsmParameter. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of SsmParameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String name); + + /** + * Delete a SsmParameter. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of SsmParameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String name, Context context); +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/SsmResourceComplianceSummaryItemsClient.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/SsmResourceComplianceSummaryItemsClient.java new file mode 100644 index 000000000000..c9f721dbbc13 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/SsmResourceComplianceSummaryItemsClient.java @@ -0,0 +1,280 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.awsconnector.fluent.models.SsmResourceComplianceSummaryItemInner; +import com.azure.resourcemanager.awsconnector.models.SsmResourceComplianceSummaryItemTagsUpdate; + +/** + * An instance of this class provides access to all the operations defined in SsmResourceComplianceSummaryItemsClient. + */ +public interface SsmResourceComplianceSummaryItemsClient { + /** + * List SsmResourceComplianceSummaryItem resources by subscription ID. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a SsmResourceComplianceSummaryItem list operation as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * List SsmResourceComplianceSummaryItem resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a SsmResourceComplianceSummaryItem list operation as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(Context context); + + /** + * List SsmResourceComplianceSummaryItem resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a SsmResourceComplianceSummaryItem list operation as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * List SsmResourceComplianceSummaryItem resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a SsmResourceComplianceSummaryItem list operation as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Get a SsmResourceComplianceSummaryItem. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of SsmResourceComplianceSummaryItem. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a SsmResourceComplianceSummaryItem along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getByResourceGroupWithResponse(String resourceGroupName, + String name, Context context); + + /** + * Get a SsmResourceComplianceSummaryItem. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of SsmResourceComplianceSummaryItem. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a SsmResourceComplianceSummaryItem. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SsmResourceComplianceSummaryItemInner getByResourceGroup(String resourceGroupName, String name); + + /** + * Create a SsmResourceComplianceSummaryItem. Please note that end user resource creation is currently restricted, + * but it will be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of SsmResourceComplianceSummaryItem. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, SsmResourceComplianceSummaryItemInner> + beginCreateOrReplace(String resourceGroupName, String name, SsmResourceComplianceSummaryItemInner resource); + + /** + * Create a SsmResourceComplianceSummaryItem. Please note that end user resource creation is currently restricted, + * but it will be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of SsmResourceComplianceSummaryItem. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, SsmResourceComplianceSummaryItemInner> + beginCreateOrReplace(String resourceGroupName, String name, SsmResourceComplianceSummaryItemInner resource, + Context context); + + /** + * Create a SsmResourceComplianceSummaryItem. Please note that end user resource creation is currently restricted, + * but it will be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of SsmResourceComplianceSummaryItem. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SsmResourceComplianceSummaryItemInner createOrReplace(String resourceGroupName, String name, + SsmResourceComplianceSummaryItemInner resource); + + /** + * Create a SsmResourceComplianceSummaryItem. Please note that end user resource creation is currently restricted, + * but it will be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of SsmResourceComplianceSummaryItem. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SsmResourceComplianceSummaryItemInner createOrReplace(String resourceGroupName, String name, + SsmResourceComplianceSummaryItemInner resource, Context context); + + /** + * Update a SsmResourceComplianceSummaryItem. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of SsmResourceComplianceSummaryItem. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, SsmResourceComplianceSummaryItemInner> + beginUpdate(String resourceGroupName, String name, SsmResourceComplianceSummaryItemTagsUpdate properties); + + /** + * Update a SsmResourceComplianceSummaryItem. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of SsmResourceComplianceSummaryItem. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, SsmResourceComplianceSummaryItemInner> beginUpdate( + String resourceGroupName, String name, SsmResourceComplianceSummaryItemTagsUpdate properties, Context context); + + /** + * Update a SsmResourceComplianceSummaryItem. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of SsmResourceComplianceSummaryItem. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SsmResourceComplianceSummaryItemInner update(String resourceGroupName, String name, + SsmResourceComplianceSummaryItemTagsUpdate properties); + + /** + * Update a SsmResourceComplianceSummaryItem. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of SsmResourceComplianceSummaryItem. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SsmResourceComplianceSummaryItemInner update(String resourceGroupName, String name, + SsmResourceComplianceSummaryItemTagsUpdate properties, Context context); + + /** + * Delete a SsmResourceComplianceSummaryItem. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of SsmResourceComplianceSummaryItem. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String name); + + /** + * Delete a SsmResourceComplianceSummaryItem. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of SsmResourceComplianceSummaryItem. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String name, Context context); + + /** + * Delete a SsmResourceComplianceSummaryItem. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of SsmResourceComplianceSummaryItem. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String name); + + /** + * Delete a SsmResourceComplianceSummaryItem. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of SsmResourceComplianceSummaryItem. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String name, Context context); +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/WafWebAclSummariesClient.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/WafWebAclSummariesClient.java new file mode 100644 index 000000000000..fb3263e2d79e --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/WafWebAclSummariesClient.java @@ -0,0 +1,273 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.awsconnector.fluent.models.WafWebAclSummaryInner; +import com.azure.resourcemanager.awsconnector.models.WafWebAclSummaryTagsUpdate; + +/** + * An instance of this class provides access to all the operations defined in WafWebAclSummariesClient. + */ +public interface WafWebAclSummariesClient { + /** + * List WafWebACLSummary resources by subscription ID. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a WafWebACLSummary list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * List WafWebACLSummary resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a WafWebACLSummary list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(Context context); + + /** + * List WafWebACLSummary resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a WafWebACLSummary list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * List WafWebACLSummary resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a WafWebACLSummary list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Get a WafWebACLSummary. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of WafWebACLSummary. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a WafWebACLSummary along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getByResourceGroupWithResponse(String resourceGroupName, String name, + Context context); + + /** + * Get a WafWebACLSummary. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of WafWebACLSummary. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a WafWebACLSummary. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + WafWebAclSummaryInner getByResourceGroup(String resourceGroupName, String name); + + /** + * Create a WafWebACLSummary. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of WafWebACLSummary. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, WafWebAclSummaryInner> beginCreateOrReplace(String resourceGroupName, + String name, WafWebAclSummaryInner resource); + + /** + * Create a WafWebACLSummary. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of WafWebACLSummary. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, WafWebAclSummaryInner> beginCreateOrReplace(String resourceGroupName, + String name, WafWebAclSummaryInner resource, Context context); + + /** + * Create a WafWebACLSummary. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of WafWebACLSummary. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + WafWebAclSummaryInner createOrReplace(String resourceGroupName, String name, WafWebAclSummaryInner resource); + + /** + * Create a WafWebACLSummary. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of WafWebACLSummary. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + WafWebAclSummaryInner createOrReplace(String resourceGroupName, String name, WafWebAclSummaryInner resource, + Context context); + + /** + * Update a WafWebACLSummary. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of WafWebACLSummary. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, WafWebAclSummaryInner> beginUpdate(String resourceGroupName, + String name, WafWebAclSummaryTagsUpdate properties); + + /** + * Update a WafWebACLSummary. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of WafWebACLSummary. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, WafWebAclSummaryInner> beginUpdate(String resourceGroupName, + String name, WafWebAclSummaryTagsUpdate properties, Context context); + + /** + * Update a WafWebACLSummary. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of WafWebACLSummary. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + WafWebAclSummaryInner update(String resourceGroupName, String name, WafWebAclSummaryTagsUpdate properties); + + /** + * Update a WafWebACLSummary. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of WafWebACLSummary. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + WafWebAclSummaryInner update(String resourceGroupName, String name, WafWebAclSummaryTagsUpdate properties, + Context context); + + /** + * Delete a WafWebACLSummary. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of WafWebACLSummary. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String name); + + /** + * Delete a WafWebACLSummary. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of WafWebACLSummary. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String name, Context context); + + /** + * Delete a WafWebACLSummary. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of WafWebACLSummary. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String name); + + /** + * Delete a WafWebACLSummary. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of WafWebACLSummary. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String name, Context context); +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/Wafv2LoggingConfigurationsClient.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/Wafv2LoggingConfigurationsClient.java new file mode 100644 index 000000000000..2e53125011a9 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/Wafv2LoggingConfigurationsClient.java @@ -0,0 +1,279 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.awsconnector.fluent.models.Wafv2LoggingConfigurationInner; +import com.azure.resourcemanager.awsconnector.models.Wafv2LoggingConfigurationTagsUpdate; + +/** + * An instance of this class provides access to all the operations defined in Wafv2LoggingConfigurationsClient. + */ +public interface Wafv2LoggingConfigurationsClient { + /** + * List Wafv2LoggingConfiguration resources by subscription ID. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Wafv2LoggingConfiguration list operation as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * List Wafv2LoggingConfiguration resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Wafv2LoggingConfiguration list operation as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(Context context); + + /** + * List Wafv2LoggingConfiguration resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Wafv2LoggingConfiguration list operation as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * List Wafv2LoggingConfiguration resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Wafv2LoggingConfiguration list operation as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Get a Wafv2LoggingConfiguration. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Wafv2LoggingConfiguration. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Wafv2LoggingConfiguration along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getByResourceGroupWithResponse(String resourceGroupName, String name, + Context context); + + /** + * Get a Wafv2LoggingConfiguration. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Wafv2LoggingConfiguration. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Wafv2LoggingConfiguration. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Wafv2LoggingConfigurationInner getByResourceGroup(String resourceGroupName, String name); + + /** + * Create a Wafv2LoggingConfiguration. Please note that end user resource creation is currently restricted, but it + * will be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Wafv2LoggingConfiguration. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Wafv2LoggingConfigurationInner> + beginCreateOrReplace(String resourceGroupName, String name, Wafv2LoggingConfigurationInner resource); + + /** + * Create a Wafv2LoggingConfiguration. Please note that end user resource creation is currently restricted, but it + * will be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Wafv2LoggingConfiguration. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Wafv2LoggingConfigurationInner> beginCreateOrReplace( + String resourceGroupName, String name, Wafv2LoggingConfigurationInner resource, Context context); + + /** + * Create a Wafv2LoggingConfiguration. Please note that end user resource creation is currently restricted, but it + * will be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Wafv2LoggingConfiguration. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Wafv2LoggingConfigurationInner createOrReplace(String resourceGroupName, String name, + Wafv2LoggingConfigurationInner resource); + + /** + * Create a Wafv2LoggingConfiguration. Please note that end user resource creation is currently restricted, but it + * will be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Wafv2LoggingConfiguration. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Wafv2LoggingConfigurationInner createOrReplace(String resourceGroupName, String name, + Wafv2LoggingConfigurationInner resource, Context context); + + /** + * Update a Wafv2LoggingConfiguration. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Wafv2LoggingConfiguration. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Wafv2LoggingConfigurationInner> + beginUpdate(String resourceGroupName, String name, Wafv2LoggingConfigurationTagsUpdate properties); + + /** + * Update a Wafv2LoggingConfiguration. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Wafv2LoggingConfiguration. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Wafv2LoggingConfigurationInner> beginUpdate( + String resourceGroupName, String name, Wafv2LoggingConfigurationTagsUpdate properties, Context context); + + /** + * Update a Wafv2LoggingConfiguration. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Wafv2LoggingConfiguration. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Wafv2LoggingConfigurationInner update(String resourceGroupName, String name, + Wafv2LoggingConfigurationTagsUpdate properties); + + /** + * Update a Wafv2LoggingConfiguration. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Wafv2LoggingConfiguration. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Wafv2LoggingConfigurationInner update(String resourceGroupName, String name, + Wafv2LoggingConfigurationTagsUpdate properties, Context context); + + /** + * Delete a Wafv2LoggingConfiguration. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Wafv2LoggingConfiguration. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String name); + + /** + * Delete a Wafv2LoggingConfiguration. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Wafv2LoggingConfiguration. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String name, Context context); + + /** + * Delete a Wafv2LoggingConfiguration. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Wafv2LoggingConfiguration. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String name); + + /** + * Delete a Wafv2LoggingConfiguration. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Wafv2LoggingConfiguration. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String name, Context context); +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/models/AccessAnalyzerInner.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/models/AccessAnalyzerInner.java new file mode 100644 index 000000000000..2ac6706f9229 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/models/AccessAnalyzerInner.java @@ -0,0 +1,192 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.Resource; +import com.azure.core.management.SystemData; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.awsconnector.models.AccessAnalyzerProperties; +import java.io.IOException; +import java.util.Map; + +/** + * A Microsoft.AwsConnector resource. + */ +@Fluent +public final class AccessAnalyzerInner extends Resource { + /* + * The resource-specific properties for this resource. + */ + private AccessAnalyzerProperties properties; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + private SystemData systemData; + + /* + * The type of the resource. + */ + private String type; + + /* + * The name of the resource. + */ + private String name; + + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /** + * Creates an instance of AccessAnalyzerInner class. + */ + public AccessAnalyzerInner() { + } + + /** + * Get the properties property: The resource-specific properties for this resource. + * + * @return the properties value. + */ + public AccessAnalyzerProperties properties() { + return this.properties; + } + + /** + * Set the properties property: The resource-specific properties for this resource. + * + * @param properties the properties value to set. + * @return the AccessAnalyzerInner object itself. + */ + public AccessAnalyzerInner withProperties(AccessAnalyzerProperties properties) { + this.properties = properties; + return this; + } + + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * {@inheritDoc} + */ + @Override + public AccessAnalyzerInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public AccessAnalyzerInner withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (properties() != null) { + properties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("location", location()); + jsonWriter.writeMapField("tags", tags(), (writer, element) -> writer.writeString(element)); + jsonWriter.writeJsonField("properties", this.properties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AccessAnalyzerInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AccessAnalyzerInner if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the AccessAnalyzerInner. + */ + public static AccessAnalyzerInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AccessAnalyzerInner deserializedAccessAnalyzerInner = new AccessAnalyzerInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedAccessAnalyzerInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedAccessAnalyzerInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedAccessAnalyzerInner.type = reader.getString(); + } else if ("location".equals(fieldName)) { + deserializedAccessAnalyzerInner.withLocation(reader.getString()); + } else if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedAccessAnalyzerInner.withTags(tags); + } else if ("properties".equals(fieldName)) { + deserializedAccessAnalyzerInner.properties = AccessAnalyzerProperties.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedAccessAnalyzerInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedAccessAnalyzerInner; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/models/AcmCertificateSummaryInner.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/models/AcmCertificateSummaryInner.java new file mode 100644 index 000000000000..4145e44e229a --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/models/AcmCertificateSummaryInner.java @@ -0,0 +1,193 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.Resource; +import com.azure.core.management.SystemData; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.awsconnector.models.AcmCertificateSummaryProperties; +import java.io.IOException; +import java.util.Map; + +/** + * A Microsoft.AwsConnector resource. + */ +@Fluent +public final class AcmCertificateSummaryInner extends Resource { + /* + * The resource-specific properties for this resource. + */ + private AcmCertificateSummaryProperties properties; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + private SystemData systemData; + + /* + * The type of the resource. + */ + private String type; + + /* + * The name of the resource. + */ + private String name; + + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /** + * Creates an instance of AcmCertificateSummaryInner class. + */ + public AcmCertificateSummaryInner() { + } + + /** + * Get the properties property: The resource-specific properties for this resource. + * + * @return the properties value. + */ + public AcmCertificateSummaryProperties properties() { + return this.properties; + } + + /** + * Set the properties property: The resource-specific properties for this resource. + * + * @param properties the properties value to set. + * @return the AcmCertificateSummaryInner object itself. + */ + public AcmCertificateSummaryInner withProperties(AcmCertificateSummaryProperties properties) { + this.properties = properties; + return this; + } + + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * {@inheritDoc} + */ + @Override + public AcmCertificateSummaryInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public AcmCertificateSummaryInner withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (properties() != null) { + properties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("location", location()); + jsonWriter.writeMapField("tags", tags(), (writer, element) -> writer.writeString(element)); + jsonWriter.writeJsonField("properties", this.properties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AcmCertificateSummaryInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AcmCertificateSummaryInner if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the AcmCertificateSummaryInner. + */ + public static AcmCertificateSummaryInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AcmCertificateSummaryInner deserializedAcmCertificateSummaryInner = new AcmCertificateSummaryInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedAcmCertificateSummaryInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedAcmCertificateSummaryInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedAcmCertificateSummaryInner.type = reader.getString(); + } else if ("location".equals(fieldName)) { + deserializedAcmCertificateSummaryInner.withLocation(reader.getString()); + } else if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedAcmCertificateSummaryInner.withTags(tags); + } else if ("properties".equals(fieldName)) { + deserializedAcmCertificateSummaryInner.properties + = AcmCertificateSummaryProperties.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedAcmCertificateSummaryInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedAcmCertificateSummaryInner; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/models/ApiGatewayRestApiInner.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/models/ApiGatewayRestApiInner.java new file mode 100644 index 000000000000..9d534a48b1fe --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/models/ApiGatewayRestApiInner.java @@ -0,0 +1,192 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.Resource; +import com.azure.core.management.SystemData; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.awsconnector.models.ApiGatewayRestApiProperties; +import java.io.IOException; +import java.util.Map; + +/** + * A Microsoft.AwsConnector resource. + */ +@Fluent +public final class ApiGatewayRestApiInner extends Resource { + /* + * The resource-specific properties for this resource. + */ + private ApiGatewayRestApiProperties properties; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + private SystemData systemData; + + /* + * The type of the resource. + */ + private String type; + + /* + * The name of the resource. + */ + private String name; + + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /** + * Creates an instance of ApiGatewayRestApiInner class. + */ + public ApiGatewayRestApiInner() { + } + + /** + * Get the properties property: The resource-specific properties for this resource. + * + * @return the properties value. + */ + public ApiGatewayRestApiProperties properties() { + return this.properties; + } + + /** + * Set the properties property: The resource-specific properties for this resource. + * + * @param properties the properties value to set. + * @return the ApiGatewayRestApiInner object itself. + */ + public ApiGatewayRestApiInner withProperties(ApiGatewayRestApiProperties properties) { + this.properties = properties; + return this; + } + + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * {@inheritDoc} + */ + @Override + public ApiGatewayRestApiInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public ApiGatewayRestApiInner withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (properties() != null) { + properties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("location", location()); + jsonWriter.writeMapField("tags", tags(), (writer, element) -> writer.writeString(element)); + jsonWriter.writeJsonField("properties", this.properties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ApiGatewayRestApiInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ApiGatewayRestApiInner if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the ApiGatewayRestApiInner. + */ + public static ApiGatewayRestApiInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ApiGatewayRestApiInner deserializedApiGatewayRestApiInner = new ApiGatewayRestApiInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedApiGatewayRestApiInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedApiGatewayRestApiInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedApiGatewayRestApiInner.type = reader.getString(); + } else if ("location".equals(fieldName)) { + deserializedApiGatewayRestApiInner.withLocation(reader.getString()); + } else if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedApiGatewayRestApiInner.withTags(tags); + } else if ("properties".equals(fieldName)) { + deserializedApiGatewayRestApiInner.properties = ApiGatewayRestApiProperties.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedApiGatewayRestApiInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedApiGatewayRestApiInner; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/models/ApiGatewayStageInner.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/models/ApiGatewayStageInner.java new file mode 100644 index 000000000000..3ea213d043f0 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/models/ApiGatewayStageInner.java @@ -0,0 +1,192 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.Resource; +import com.azure.core.management.SystemData; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.awsconnector.models.ApiGatewayStageProperties; +import java.io.IOException; +import java.util.Map; + +/** + * A Microsoft.AwsConnector resource. + */ +@Fluent +public final class ApiGatewayStageInner extends Resource { + /* + * The resource-specific properties for this resource. + */ + private ApiGatewayStageProperties properties; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + private SystemData systemData; + + /* + * The type of the resource. + */ + private String type; + + /* + * The name of the resource. + */ + private String name; + + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /** + * Creates an instance of ApiGatewayStageInner class. + */ + public ApiGatewayStageInner() { + } + + /** + * Get the properties property: The resource-specific properties for this resource. + * + * @return the properties value. + */ + public ApiGatewayStageProperties properties() { + return this.properties; + } + + /** + * Set the properties property: The resource-specific properties for this resource. + * + * @param properties the properties value to set. + * @return the ApiGatewayStageInner object itself. + */ + public ApiGatewayStageInner withProperties(ApiGatewayStageProperties properties) { + this.properties = properties; + return this; + } + + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * {@inheritDoc} + */ + @Override + public ApiGatewayStageInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public ApiGatewayStageInner withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (properties() != null) { + properties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("location", location()); + jsonWriter.writeMapField("tags", tags(), (writer, element) -> writer.writeString(element)); + jsonWriter.writeJsonField("properties", this.properties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ApiGatewayStageInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ApiGatewayStageInner if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the ApiGatewayStageInner. + */ + public static ApiGatewayStageInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ApiGatewayStageInner deserializedApiGatewayStageInner = new ApiGatewayStageInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedApiGatewayStageInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedApiGatewayStageInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedApiGatewayStageInner.type = reader.getString(); + } else if ("location".equals(fieldName)) { + deserializedApiGatewayStageInner.withLocation(reader.getString()); + } else if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedApiGatewayStageInner.withTags(tags); + } else if ("properties".equals(fieldName)) { + deserializedApiGatewayStageInner.properties = ApiGatewayStageProperties.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedApiGatewayStageInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedApiGatewayStageInner; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/models/AppSyncGraphqlApiInner.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/models/AppSyncGraphqlApiInner.java new file mode 100644 index 000000000000..5c371e7e7dbc --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/models/AppSyncGraphqlApiInner.java @@ -0,0 +1,192 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.Resource; +import com.azure.core.management.SystemData; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.awsconnector.models.AppSyncGraphqlApiProperties; +import java.io.IOException; +import java.util.Map; + +/** + * A Microsoft.AwsConnector resource. + */ +@Fluent +public final class AppSyncGraphqlApiInner extends Resource { + /* + * The resource-specific properties for this resource. + */ + private AppSyncGraphqlApiProperties properties; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + private SystemData systemData; + + /* + * The type of the resource. + */ + private String type; + + /* + * The name of the resource. + */ + private String name; + + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /** + * Creates an instance of AppSyncGraphqlApiInner class. + */ + public AppSyncGraphqlApiInner() { + } + + /** + * Get the properties property: The resource-specific properties for this resource. + * + * @return the properties value. + */ + public AppSyncGraphqlApiProperties properties() { + return this.properties; + } + + /** + * Set the properties property: The resource-specific properties for this resource. + * + * @param properties the properties value to set. + * @return the AppSyncGraphqlApiInner object itself. + */ + public AppSyncGraphqlApiInner withProperties(AppSyncGraphqlApiProperties properties) { + this.properties = properties; + return this; + } + + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * {@inheritDoc} + */ + @Override + public AppSyncGraphqlApiInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public AppSyncGraphqlApiInner withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (properties() != null) { + properties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("location", location()); + jsonWriter.writeMapField("tags", tags(), (writer, element) -> writer.writeString(element)); + jsonWriter.writeJsonField("properties", this.properties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AppSyncGraphqlApiInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AppSyncGraphqlApiInner if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the AppSyncGraphqlApiInner. + */ + public static AppSyncGraphqlApiInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AppSyncGraphqlApiInner deserializedAppSyncGraphqlApiInner = new AppSyncGraphqlApiInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedAppSyncGraphqlApiInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedAppSyncGraphqlApiInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedAppSyncGraphqlApiInner.type = reader.getString(); + } else if ("location".equals(fieldName)) { + deserializedAppSyncGraphqlApiInner.withLocation(reader.getString()); + } else if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedAppSyncGraphqlApiInner.withTags(tags); + } else if ("properties".equals(fieldName)) { + deserializedAppSyncGraphqlApiInner.properties = AppSyncGraphqlApiProperties.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedAppSyncGraphqlApiInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedAppSyncGraphqlApiInner; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/models/AutoScalingGroupInner.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/models/AutoScalingGroupInner.java new file mode 100644 index 000000000000..77a6816496be --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/models/AutoScalingGroupInner.java @@ -0,0 +1,192 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.Resource; +import com.azure.core.management.SystemData; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.awsconnector.models.AutoScalingGroupProperties; +import java.io.IOException; +import java.util.Map; + +/** + * A Microsoft.AwsConnector resource. + */ +@Fluent +public final class AutoScalingGroupInner extends Resource { + /* + * The resource-specific properties for this resource. + */ + private AutoScalingGroupProperties properties; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + private SystemData systemData; + + /* + * The type of the resource. + */ + private String type; + + /* + * The name of the resource. + */ + private String name; + + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /** + * Creates an instance of AutoScalingGroupInner class. + */ + public AutoScalingGroupInner() { + } + + /** + * Get the properties property: The resource-specific properties for this resource. + * + * @return the properties value. + */ + public AutoScalingGroupProperties properties() { + return this.properties; + } + + /** + * Set the properties property: The resource-specific properties for this resource. + * + * @param properties the properties value to set. + * @return the AutoScalingGroupInner object itself. + */ + public AutoScalingGroupInner withProperties(AutoScalingGroupProperties properties) { + this.properties = properties; + return this; + } + + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * {@inheritDoc} + */ + @Override + public AutoScalingGroupInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public AutoScalingGroupInner withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (properties() != null) { + properties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("location", location()); + jsonWriter.writeMapField("tags", tags(), (writer, element) -> writer.writeString(element)); + jsonWriter.writeJsonField("properties", this.properties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AutoScalingGroupInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AutoScalingGroupInner if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the AutoScalingGroupInner. + */ + public static AutoScalingGroupInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AutoScalingGroupInner deserializedAutoScalingGroupInner = new AutoScalingGroupInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedAutoScalingGroupInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedAutoScalingGroupInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedAutoScalingGroupInner.type = reader.getString(); + } else if ("location".equals(fieldName)) { + deserializedAutoScalingGroupInner.withLocation(reader.getString()); + } else if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedAutoScalingGroupInner.withTags(tags); + } else if ("properties".equals(fieldName)) { + deserializedAutoScalingGroupInner.properties = AutoScalingGroupProperties.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedAutoScalingGroupInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedAutoScalingGroupInner; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/models/CloudFormationStackInner.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/models/CloudFormationStackInner.java new file mode 100644 index 000000000000..c758402f59c2 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/models/CloudFormationStackInner.java @@ -0,0 +1,192 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.Resource; +import com.azure.core.management.SystemData; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.awsconnector.models.CloudFormationStackProperties; +import java.io.IOException; +import java.util.Map; + +/** + * A Microsoft.AwsConnector resource. + */ +@Fluent +public final class CloudFormationStackInner extends Resource { + /* + * The resource-specific properties for this resource. + */ + private CloudFormationStackProperties properties; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + private SystemData systemData; + + /* + * The type of the resource. + */ + private String type; + + /* + * The name of the resource. + */ + private String name; + + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /** + * Creates an instance of CloudFormationStackInner class. + */ + public CloudFormationStackInner() { + } + + /** + * Get the properties property: The resource-specific properties for this resource. + * + * @return the properties value. + */ + public CloudFormationStackProperties properties() { + return this.properties; + } + + /** + * Set the properties property: The resource-specific properties for this resource. + * + * @param properties the properties value to set. + * @return the CloudFormationStackInner object itself. + */ + public CloudFormationStackInner withProperties(CloudFormationStackProperties properties) { + this.properties = properties; + return this; + } + + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * {@inheritDoc} + */ + @Override + public CloudFormationStackInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public CloudFormationStackInner withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (properties() != null) { + properties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("location", location()); + jsonWriter.writeMapField("tags", tags(), (writer, element) -> writer.writeString(element)); + jsonWriter.writeJsonField("properties", this.properties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of CloudFormationStackInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of CloudFormationStackInner if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the CloudFormationStackInner. + */ + public static CloudFormationStackInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + CloudFormationStackInner deserializedCloudFormationStackInner = new CloudFormationStackInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedCloudFormationStackInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedCloudFormationStackInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedCloudFormationStackInner.type = reader.getString(); + } else if ("location".equals(fieldName)) { + deserializedCloudFormationStackInner.withLocation(reader.getString()); + } else if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedCloudFormationStackInner.withTags(tags); + } else if ("properties".equals(fieldName)) { + deserializedCloudFormationStackInner.properties = CloudFormationStackProperties.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedCloudFormationStackInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedCloudFormationStackInner; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/models/CloudFormationStackSetInner.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/models/CloudFormationStackSetInner.java new file mode 100644 index 000000000000..1988b0115dc6 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/models/CloudFormationStackSetInner.java @@ -0,0 +1,193 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.Resource; +import com.azure.core.management.SystemData; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.awsconnector.models.CloudFormationStackSetProperties; +import java.io.IOException; +import java.util.Map; + +/** + * A Microsoft.AwsConnector resource. + */ +@Fluent +public final class CloudFormationStackSetInner extends Resource { + /* + * The resource-specific properties for this resource. + */ + private CloudFormationStackSetProperties properties; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + private SystemData systemData; + + /* + * The type of the resource. + */ + private String type; + + /* + * The name of the resource. + */ + private String name; + + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /** + * Creates an instance of CloudFormationStackSetInner class. + */ + public CloudFormationStackSetInner() { + } + + /** + * Get the properties property: The resource-specific properties for this resource. + * + * @return the properties value. + */ + public CloudFormationStackSetProperties properties() { + return this.properties; + } + + /** + * Set the properties property: The resource-specific properties for this resource. + * + * @param properties the properties value to set. + * @return the CloudFormationStackSetInner object itself. + */ + public CloudFormationStackSetInner withProperties(CloudFormationStackSetProperties properties) { + this.properties = properties; + return this; + } + + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * {@inheritDoc} + */ + @Override + public CloudFormationStackSetInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public CloudFormationStackSetInner withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (properties() != null) { + properties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("location", location()); + jsonWriter.writeMapField("tags", tags(), (writer, element) -> writer.writeString(element)); + jsonWriter.writeJsonField("properties", this.properties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of CloudFormationStackSetInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of CloudFormationStackSetInner if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the CloudFormationStackSetInner. + */ + public static CloudFormationStackSetInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + CloudFormationStackSetInner deserializedCloudFormationStackSetInner = new CloudFormationStackSetInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedCloudFormationStackSetInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedCloudFormationStackSetInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedCloudFormationStackSetInner.type = reader.getString(); + } else if ("location".equals(fieldName)) { + deserializedCloudFormationStackSetInner.withLocation(reader.getString()); + } else if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedCloudFormationStackSetInner.withTags(tags); + } else if ("properties".equals(fieldName)) { + deserializedCloudFormationStackSetInner.properties + = CloudFormationStackSetProperties.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedCloudFormationStackSetInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedCloudFormationStackSetInner; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/models/CloudFrontDistributionInner.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/models/CloudFrontDistributionInner.java new file mode 100644 index 000000000000..c87001de0d05 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/models/CloudFrontDistributionInner.java @@ -0,0 +1,193 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.Resource; +import com.azure.core.management.SystemData; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.awsconnector.models.CloudFrontDistributionProperties; +import java.io.IOException; +import java.util.Map; + +/** + * A Microsoft.AwsConnector resource. + */ +@Fluent +public final class CloudFrontDistributionInner extends Resource { + /* + * The resource-specific properties for this resource. + */ + private CloudFrontDistributionProperties properties; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + private SystemData systemData; + + /* + * The type of the resource. + */ + private String type; + + /* + * The name of the resource. + */ + private String name; + + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /** + * Creates an instance of CloudFrontDistributionInner class. + */ + public CloudFrontDistributionInner() { + } + + /** + * Get the properties property: The resource-specific properties for this resource. + * + * @return the properties value. + */ + public CloudFrontDistributionProperties properties() { + return this.properties; + } + + /** + * Set the properties property: The resource-specific properties for this resource. + * + * @param properties the properties value to set. + * @return the CloudFrontDistributionInner object itself. + */ + public CloudFrontDistributionInner withProperties(CloudFrontDistributionProperties properties) { + this.properties = properties; + return this; + } + + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * {@inheritDoc} + */ + @Override + public CloudFrontDistributionInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public CloudFrontDistributionInner withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (properties() != null) { + properties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("location", location()); + jsonWriter.writeMapField("tags", tags(), (writer, element) -> writer.writeString(element)); + jsonWriter.writeJsonField("properties", this.properties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of CloudFrontDistributionInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of CloudFrontDistributionInner if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the CloudFrontDistributionInner. + */ + public static CloudFrontDistributionInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + CloudFrontDistributionInner deserializedCloudFrontDistributionInner = new CloudFrontDistributionInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedCloudFrontDistributionInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedCloudFrontDistributionInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedCloudFrontDistributionInner.type = reader.getString(); + } else if ("location".equals(fieldName)) { + deserializedCloudFrontDistributionInner.withLocation(reader.getString()); + } else if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedCloudFrontDistributionInner.withTags(tags); + } else if ("properties".equals(fieldName)) { + deserializedCloudFrontDistributionInner.properties + = CloudFrontDistributionProperties.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedCloudFrontDistributionInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedCloudFrontDistributionInner; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/models/CloudTrailInner.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/models/CloudTrailInner.java new file mode 100644 index 000000000000..1ab045d2cf70 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/models/CloudTrailInner.java @@ -0,0 +1,192 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.Resource; +import com.azure.core.management.SystemData; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.awsconnector.models.CloudTrailProperties; +import java.io.IOException; +import java.util.Map; + +/** + * A Microsoft.AwsConnector resource. + */ +@Fluent +public final class CloudTrailInner extends Resource { + /* + * The resource-specific properties for this resource. + */ + private CloudTrailProperties properties; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + private SystemData systemData; + + /* + * The type of the resource. + */ + private String type; + + /* + * The name of the resource. + */ + private String name; + + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /** + * Creates an instance of CloudTrailInner class. + */ + public CloudTrailInner() { + } + + /** + * Get the properties property: The resource-specific properties for this resource. + * + * @return the properties value. + */ + public CloudTrailProperties properties() { + return this.properties; + } + + /** + * Set the properties property: The resource-specific properties for this resource. + * + * @param properties the properties value to set. + * @return the CloudTrailInner object itself. + */ + public CloudTrailInner withProperties(CloudTrailProperties properties) { + this.properties = properties; + return this; + } + + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * {@inheritDoc} + */ + @Override + public CloudTrailInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public CloudTrailInner withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (properties() != null) { + properties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("location", location()); + jsonWriter.writeMapField("tags", tags(), (writer, element) -> writer.writeString(element)); + jsonWriter.writeJsonField("properties", this.properties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of CloudTrailInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of CloudTrailInner if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the CloudTrailInner. + */ + public static CloudTrailInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + CloudTrailInner deserializedCloudTrailInner = new CloudTrailInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedCloudTrailInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedCloudTrailInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedCloudTrailInner.type = reader.getString(); + } else if ("location".equals(fieldName)) { + deserializedCloudTrailInner.withLocation(reader.getString()); + } else if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedCloudTrailInner.withTags(tags); + } else if ("properties".equals(fieldName)) { + deserializedCloudTrailInner.properties = CloudTrailProperties.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedCloudTrailInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedCloudTrailInner; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/models/CloudWatchAlarmInner.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/models/CloudWatchAlarmInner.java new file mode 100644 index 000000000000..04c9c95ed84c --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/models/CloudWatchAlarmInner.java @@ -0,0 +1,192 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.Resource; +import com.azure.core.management.SystemData; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.awsconnector.models.CloudWatchAlarmProperties; +import java.io.IOException; +import java.util.Map; + +/** + * A Microsoft.AwsConnector resource. + */ +@Fluent +public final class CloudWatchAlarmInner extends Resource { + /* + * The resource-specific properties for this resource. + */ + private CloudWatchAlarmProperties properties; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + private SystemData systemData; + + /* + * The type of the resource. + */ + private String type; + + /* + * The name of the resource. + */ + private String name; + + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /** + * Creates an instance of CloudWatchAlarmInner class. + */ + public CloudWatchAlarmInner() { + } + + /** + * Get the properties property: The resource-specific properties for this resource. + * + * @return the properties value. + */ + public CloudWatchAlarmProperties properties() { + return this.properties; + } + + /** + * Set the properties property: The resource-specific properties for this resource. + * + * @param properties the properties value to set. + * @return the CloudWatchAlarmInner object itself. + */ + public CloudWatchAlarmInner withProperties(CloudWatchAlarmProperties properties) { + this.properties = properties; + return this; + } + + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * {@inheritDoc} + */ + @Override + public CloudWatchAlarmInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public CloudWatchAlarmInner withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (properties() != null) { + properties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("location", location()); + jsonWriter.writeMapField("tags", tags(), (writer, element) -> writer.writeString(element)); + jsonWriter.writeJsonField("properties", this.properties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of CloudWatchAlarmInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of CloudWatchAlarmInner if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the CloudWatchAlarmInner. + */ + public static CloudWatchAlarmInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + CloudWatchAlarmInner deserializedCloudWatchAlarmInner = new CloudWatchAlarmInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedCloudWatchAlarmInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedCloudWatchAlarmInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedCloudWatchAlarmInner.type = reader.getString(); + } else if ("location".equals(fieldName)) { + deserializedCloudWatchAlarmInner.withLocation(reader.getString()); + } else if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedCloudWatchAlarmInner.withTags(tags); + } else if ("properties".equals(fieldName)) { + deserializedCloudWatchAlarmInner.properties = CloudWatchAlarmProperties.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedCloudWatchAlarmInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedCloudWatchAlarmInner; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/models/CodeBuildProjectInner.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/models/CodeBuildProjectInner.java new file mode 100644 index 000000000000..6302af805737 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/models/CodeBuildProjectInner.java @@ -0,0 +1,192 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.Resource; +import com.azure.core.management.SystemData; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.awsconnector.models.CodeBuildProjectProperties; +import java.io.IOException; +import java.util.Map; + +/** + * A Microsoft.AwsConnector resource. + */ +@Fluent +public final class CodeBuildProjectInner extends Resource { + /* + * The resource-specific properties for this resource. + */ + private CodeBuildProjectProperties properties; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + private SystemData systemData; + + /* + * The type of the resource. + */ + private String type; + + /* + * The name of the resource. + */ + private String name; + + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /** + * Creates an instance of CodeBuildProjectInner class. + */ + public CodeBuildProjectInner() { + } + + /** + * Get the properties property: The resource-specific properties for this resource. + * + * @return the properties value. + */ + public CodeBuildProjectProperties properties() { + return this.properties; + } + + /** + * Set the properties property: The resource-specific properties for this resource. + * + * @param properties the properties value to set. + * @return the CodeBuildProjectInner object itself. + */ + public CodeBuildProjectInner withProperties(CodeBuildProjectProperties properties) { + this.properties = properties; + return this; + } + + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * {@inheritDoc} + */ + @Override + public CodeBuildProjectInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public CodeBuildProjectInner withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (properties() != null) { + properties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("location", location()); + jsonWriter.writeMapField("tags", tags(), (writer, element) -> writer.writeString(element)); + jsonWriter.writeJsonField("properties", this.properties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of CodeBuildProjectInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of CodeBuildProjectInner if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the CodeBuildProjectInner. + */ + public static CodeBuildProjectInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + CodeBuildProjectInner deserializedCodeBuildProjectInner = new CodeBuildProjectInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedCodeBuildProjectInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedCodeBuildProjectInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedCodeBuildProjectInner.type = reader.getString(); + } else if ("location".equals(fieldName)) { + deserializedCodeBuildProjectInner.withLocation(reader.getString()); + } else if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedCodeBuildProjectInner.withTags(tags); + } else if ("properties".equals(fieldName)) { + deserializedCodeBuildProjectInner.properties = CodeBuildProjectProperties.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedCodeBuildProjectInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedCodeBuildProjectInner; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/models/CodeBuildSourceCredentialsInfoInner.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/models/CodeBuildSourceCredentialsInfoInner.java new file mode 100644 index 000000000000..27197e271de4 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/models/CodeBuildSourceCredentialsInfoInner.java @@ -0,0 +1,194 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.Resource; +import com.azure.core.management.SystemData; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.awsconnector.models.CodeBuildSourceCredentialsInfoProperties; +import java.io.IOException; +import java.util.Map; + +/** + * A Microsoft.AwsConnector resource. + */ +@Fluent +public final class CodeBuildSourceCredentialsInfoInner extends Resource { + /* + * The resource-specific properties for this resource. + */ + private CodeBuildSourceCredentialsInfoProperties properties; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + private SystemData systemData; + + /* + * The type of the resource. + */ + private String type; + + /* + * The name of the resource. + */ + private String name; + + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /** + * Creates an instance of CodeBuildSourceCredentialsInfoInner class. + */ + public CodeBuildSourceCredentialsInfoInner() { + } + + /** + * Get the properties property: The resource-specific properties for this resource. + * + * @return the properties value. + */ + public CodeBuildSourceCredentialsInfoProperties properties() { + return this.properties; + } + + /** + * Set the properties property: The resource-specific properties for this resource. + * + * @param properties the properties value to set. + * @return the CodeBuildSourceCredentialsInfoInner object itself. + */ + public CodeBuildSourceCredentialsInfoInner withProperties(CodeBuildSourceCredentialsInfoProperties properties) { + this.properties = properties; + return this; + } + + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * {@inheritDoc} + */ + @Override + public CodeBuildSourceCredentialsInfoInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public CodeBuildSourceCredentialsInfoInner withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (properties() != null) { + properties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("location", location()); + jsonWriter.writeMapField("tags", tags(), (writer, element) -> writer.writeString(element)); + jsonWriter.writeJsonField("properties", this.properties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of CodeBuildSourceCredentialsInfoInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of CodeBuildSourceCredentialsInfoInner if the JsonReader was pointing to an instance of it, + * or null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the CodeBuildSourceCredentialsInfoInner. + */ + public static CodeBuildSourceCredentialsInfoInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + CodeBuildSourceCredentialsInfoInner deserializedCodeBuildSourceCredentialsInfoInner + = new CodeBuildSourceCredentialsInfoInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedCodeBuildSourceCredentialsInfoInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedCodeBuildSourceCredentialsInfoInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedCodeBuildSourceCredentialsInfoInner.type = reader.getString(); + } else if ("location".equals(fieldName)) { + deserializedCodeBuildSourceCredentialsInfoInner.withLocation(reader.getString()); + } else if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedCodeBuildSourceCredentialsInfoInner.withTags(tags); + } else if ("properties".equals(fieldName)) { + deserializedCodeBuildSourceCredentialsInfoInner.properties + = CodeBuildSourceCredentialsInfoProperties.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedCodeBuildSourceCredentialsInfoInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedCodeBuildSourceCredentialsInfoInner; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/models/ConfigServiceConfigurationRecorderInner.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/models/ConfigServiceConfigurationRecorderInner.java new file mode 100644 index 000000000000..84d94c39bda6 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/models/ConfigServiceConfigurationRecorderInner.java @@ -0,0 +1,195 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.Resource; +import com.azure.core.management.SystemData; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.awsconnector.models.ConfigServiceConfigurationRecorderProperties; +import java.io.IOException; +import java.util.Map; + +/** + * A Microsoft.AwsConnector resource. + */ +@Fluent +public final class ConfigServiceConfigurationRecorderInner extends Resource { + /* + * The resource-specific properties for this resource. + */ + private ConfigServiceConfigurationRecorderProperties properties; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + private SystemData systemData; + + /* + * The type of the resource. + */ + private String type; + + /* + * The name of the resource. + */ + private String name; + + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /** + * Creates an instance of ConfigServiceConfigurationRecorderInner class. + */ + public ConfigServiceConfigurationRecorderInner() { + } + + /** + * Get the properties property: The resource-specific properties for this resource. + * + * @return the properties value. + */ + public ConfigServiceConfigurationRecorderProperties properties() { + return this.properties; + } + + /** + * Set the properties property: The resource-specific properties for this resource. + * + * @param properties the properties value to set. + * @return the ConfigServiceConfigurationRecorderInner object itself. + */ + public ConfigServiceConfigurationRecorderInner + withProperties(ConfigServiceConfigurationRecorderProperties properties) { + this.properties = properties; + return this; + } + + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * {@inheritDoc} + */ + @Override + public ConfigServiceConfigurationRecorderInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public ConfigServiceConfigurationRecorderInner withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (properties() != null) { + properties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("location", location()); + jsonWriter.writeMapField("tags", tags(), (writer, element) -> writer.writeString(element)); + jsonWriter.writeJsonField("properties", this.properties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ConfigServiceConfigurationRecorderInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ConfigServiceConfigurationRecorderInner if the JsonReader was pointing to an instance of + * it, or null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the ConfigServiceConfigurationRecorderInner. + */ + public static ConfigServiceConfigurationRecorderInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ConfigServiceConfigurationRecorderInner deserializedConfigServiceConfigurationRecorderInner + = new ConfigServiceConfigurationRecorderInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedConfigServiceConfigurationRecorderInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedConfigServiceConfigurationRecorderInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedConfigServiceConfigurationRecorderInner.type = reader.getString(); + } else if ("location".equals(fieldName)) { + deserializedConfigServiceConfigurationRecorderInner.withLocation(reader.getString()); + } else if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedConfigServiceConfigurationRecorderInner.withTags(tags); + } else if ("properties".equals(fieldName)) { + deserializedConfigServiceConfigurationRecorderInner.properties + = ConfigServiceConfigurationRecorderProperties.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedConfigServiceConfigurationRecorderInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedConfigServiceConfigurationRecorderInner; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/models/ConfigServiceConfigurationRecorderStatusInner.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/models/ConfigServiceConfigurationRecorderStatusInner.java new file mode 100644 index 000000000000..32d0a52e5cbc --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/models/ConfigServiceConfigurationRecorderStatusInner.java @@ -0,0 +1,195 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.Resource; +import com.azure.core.management.SystemData; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.awsconnector.models.ConfigServiceConfigurationRecorderStatusProperties; +import java.io.IOException; +import java.util.Map; + +/** + * A Microsoft.AwsConnector resource. + */ +@Fluent +public final class ConfigServiceConfigurationRecorderStatusInner extends Resource { + /* + * The resource-specific properties for this resource. + */ + private ConfigServiceConfigurationRecorderStatusProperties properties; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + private SystemData systemData; + + /* + * The type of the resource. + */ + private String type; + + /* + * The name of the resource. + */ + private String name; + + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /** + * Creates an instance of ConfigServiceConfigurationRecorderStatusInner class. + */ + public ConfigServiceConfigurationRecorderStatusInner() { + } + + /** + * Get the properties property: The resource-specific properties for this resource. + * + * @return the properties value. + */ + public ConfigServiceConfigurationRecorderStatusProperties properties() { + return this.properties; + } + + /** + * Set the properties property: The resource-specific properties for this resource. + * + * @param properties the properties value to set. + * @return the ConfigServiceConfigurationRecorderStatusInner object itself. + */ + public ConfigServiceConfigurationRecorderStatusInner + withProperties(ConfigServiceConfigurationRecorderStatusProperties properties) { + this.properties = properties; + return this; + } + + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * {@inheritDoc} + */ + @Override + public ConfigServiceConfigurationRecorderStatusInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public ConfigServiceConfigurationRecorderStatusInner withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (properties() != null) { + properties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("location", location()); + jsonWriter.writeMapField("tags", tags(), (writer, element) -> writer.writeString(element)); + jsonWriter.writeJsonField("properties", this.properties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ConfigServiceConfigurationRecorderStatusInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ConfigServiceConfigurationRecorderStatusInner if the JsonReader was pointing to an + * instance of it, or null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the ConfigServiceConfigurationRecorderStatusInner. + */ + public static ConfigServiceConfigurationRecorderStatusInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ConfigServiceConfigurationRecorderStatusInner deserializedConfigServiceConfigurationRecorderStatusInner + = new ConfigServiceConfigurationRecorderStatusInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedConfigServiceConfigurationRecorderStatusInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedConfigServiceConfigurationRecorderStatusInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedConfigServiceConfigurationRecorderStatusInner.type = reader.getString(); + } else if ("location".equals(fieldName)) { + deserializedConfigServiceConfigurationRecorderStatusInner.withLocation(reader.getString()); + } else if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedConfigServiceConfigurationRecorderStatusInner.withTags(tags); + } else if ("properties".equals(fieldName)) { + deserializedConfigServiceConfigurationRecorderStatusInner.properties + = ConfigServiceConfigurationRecorderStatusProperties.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedConfigServiceConfigurationRecorderStatusInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedConfigServiceConfigurationRecorderStatusInner; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/models/ConfigServiceDeliveryChannelInner.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/models/ConfigServiceDeliveryChannelInner.java new file mode 100644 index 000000000000..dbf8a4a3e7e2 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/models/ConfigServiceDeliveryChannelInner.java @@ -0,0 +1,194 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.Resource; +import com.azure.core.management.SystemData; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.awsconnector.models.ConfigServiceDeliveryChannelProperties; +import java.io.IOException; +import java.util.Map; + +/** + * A Microsoft.AwsConnector resource. + */ +@Fluent +public final class ConfigServiceDeliveryChannelInner extends Resource { + /* + * The resource-specific properties for this resource. + */ + private ConfigServiceDeliveryChannelProperties properties; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + private SystemData systemData; + + /* + * The type of the resource. + */ + private String type; + + /* + * The name of the resource. + */ + private String name; + + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /** + * Creates an instance of ConfigServiceDeliveryChannelInner class. + */ + public ConfigServiceDeliveryChannelInner() { + } + + /** + * Get the properties property: The resource-specific properties for this resource. + * + * @return the properties value. + */ + public ConfigServiceDeliveryChannelProperties properties() { + return this.properties; + } + + /** + * Set the properties property: The resource-specific properties for this resource. + * + * @param properties the properties value to set. + * @return the ConfigServiceDeliveryChannelInner object itself. + */ + public ConfigServiceDeliveryChannelInner withProperties(ConfigServiceDeliveryChannelProperties properties) { + this.properties = properties; + return this; + } + + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * {@inheritDoc} + */ + @Override + public ConfigServiceDeliveryChannelInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public ConfigServiceDeliveryChannelInner withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (properties() != null) { + properties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("location", location()); + jsonWriter.writeMapField("tags", tags(), (writer, element) -> writer.writeString(element)); + jsonWriter.writeJsonField("properties", this.properties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ConfigServiceDeliveryChannelInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ConfigServiceDeliveryChannelInner if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the ConfigServiceDeliveryChannelInner. + */ + public static ConfigServiceDeliveryChannelInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ConfigServiceDeliveryChannelInner deserializedConfigServiceDeliveryChannelInner + = new ConfigServiceDeliveryChannelInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedConfigServiceDeliveryChannelInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedConfigServiceDeliveryChannelInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedConfigServiceDeliveryChannelInner.type = reader.getString(); + } else if ("location".equals(fieldName)) { + deserializedConfigServiceDeliveryChannelInner.withLocation(reader.getString()); + } else if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedConfigServiceDeliveryChannelInner.withTags(tags); + } else if ("properties".equals(fieldName)) { + deserializedConfigServiceDeliveryChannelInner.properties + = ConfigServiceDeliveryChannelProperties.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedConfigServiceDeliveryChannelInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedConfigServiceDeliveryChannelInner; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/models/DatabaseMigrationServiceReplicationInstanceInner.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/models/DatabaseMigrationServiceReplicationInstanceInner.java new file mode 100644 index 000000000000..14af51c7bec2 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/models/DatabaseMigrationServiceReplicationInstanceInner.java @@ -0,0 +1,196 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.Resource; +import com.azure.core.management.SystemData; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.awsconnector.models.DatabaseMigrationServiceReplicationInstanceProperties; +import java.io.IOException; +import java.util.Map; + +/** + * A Microsoft.AwsConnector resource. + */ +@Fluent +public final class DatabaseMigrationServiceReplicationInstanceInner extends Resource { + /* + * The resource-specific properties for this resource. + */ + private DatabaseMigrationServiceReplicationInstanceProperties properties; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + private SystemData systemData; + + /* + * The type of the resource. + */ + private String type; + + /* + * The name of the resource. + */ + private String name; + + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /** + * Creates an instance of DatabaseMigrationServiceReplicationInstanceInner class. + */ + public DatabaseMigrationServiceReplicationInstanceInner() { + } + + /** + * Get the properties property: The resource-specific properties for this resource. + * + * @return the properties value. + */ + public DatabaseMigrationServiceReplicationInstanceProperties properties() { + return this.properties; + } + + /** + * Set the properties property: The resource-specific properties for this resource. + * + * @param properties the properties value to set. + * @return the DatabaseMigrationServiceReplicationInstanceInner object itself. + */ + public DatabaseMigrationServiceReplicationInstanceInner + withProperties(DatabaseMigrationServiceReplicationInstanceProperties properties) { + this.properties = properties; + return this; + } + + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * {@inheritDoc} + */ + @Override + public DatabaseMigrationServiceReplicationInstanceInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public DatabaseMigrationServiceReplicationInstanceInner withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (properties() != null) { + properties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("location", location()); + jsonWriter.writeMapField("tags", tags(), (writer, element) -> writer.writeString(element)); + jsonWriter.writeJsonField("properties", this.properties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of DatabaseMigrationServiceReplicationInstanceInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of DatabaseMigrationServiceReplicationInstanceInner if the JsonReader was pointing to an + * instance of it, or null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the DatabaseMigrationServiceReplicationInstanceInner. + */ + public static DatabaseMigrationServiceReplicationInstanceInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + DatabaseMigrationServiceReplicationInstanceInner deserializedDatabaseMigrationServiceReplicationInstanceInner + = new DatabaseMigrationServiceReplicationInstanceInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedDatabaseMigrationServiceReplicationInstanceInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedDatabaseMigrationServiceReplicationInstanceInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedDatabaseMigrationServiceReplicationInstanceInner.type = reader.getString(); + } else if ("location".equals(fieldName)) { + deserializedDatabaseMigrationServiceReplicationInstanceInner.withLocation(reader.getString()); + } else if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedDatabaseMigrationServiceReplicationInstanceInner.withTags(tags); + } else if ("properties".equals(fieldName)) { + deserializedDatabaseMigrationServiceReplicationInstanceInner.properties + = DatabaseMigrationServiceReplicationInstanceProperties.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedDatabaseMigrationServiceReplicationInstanceInner.systemData + = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedDatabaseMigrationServiceReplicationInstanceInner; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/models/DaxClusterInner.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/models/DaxClusterInner.java new file mode 100644 index 000000000000..cea8fb9917ea --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/models/DaxClusterInner.java @@ -0,0 +1,192 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.Resource; +import com.azure.core.management.SystemData; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.awsconnector.models.DaxClusterProperties; +import java.io.IOException; +import java.util.Map; + +/** + * A Microsoft.AwsConnector resource. + */ +@Fluent +public final class DaxClusterInner extends Resource { + /* + * The resource-specific properties for this resource. + */ + private DaxClusterProperties properties; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + private SystemData systemData; + + /* + * The type of the resource. + */ + private String type; + + /* + * The name of the resource. + */ + private String name; + + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /** + * Creates an instance of DaxClusterInner class. + */ + public DaxClusterInner() { + } + + /** + * Get the properties property: The resource-specific properties for this resource. + * + * @return the properties value. + */ + public DaxClusterProperties properties() { + return this.properties; + } + + /** + * Set the properties property: The resource-specific properties for this resource. + * + * @param properties the properties value to set. + * @return the DaxClusterInner object itself. + */ + public DaxClusterInner withProperties(DaxClusterProperties properties) { + this.properties = properties; + return this; + } + + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * {@inheritDoc} + */ + @Override + public DaxClusterInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public DaxClusterInner withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (properties() != null) { + properties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("location", location()); + jsonWriter.writeMapField("tags", tags(), (writer, element) -> writer.writeString(element)); + jsonWriter.writeJsonField("properties", this.properties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of DaxClusterInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of DaxClusterInner if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the DaxClusterInner. + */ + public static DaxClusterInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + DaxClusterInner deserializedDaxClusterInner = new DaxClusterInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedDaxClusterInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedDaxClusterInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedDaxClusterInner.type = reader.getString(); + } else if ("location".equals(fieldName)) { + deserializedDaxClusterInner.withLocation(reader.getString()); + } else if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedDaxClusterInner.withTags(tags); + } else if ("properties".equals(fieldName)) { + deserializedDaxClusterInner.properties = DaxClusterProperties.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedDaxClusterInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedDaxClusterInner; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/models/DynamoDBContinuousBackupsDescriptionInner.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/models/DynamoDBContinuousBackupsDescriptionInner.java new file mode 100644 index 000000000000..e677480b3e84 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/models/DynamoDBContinuousBackupsDescriptionInner.java @@ -0,0 +1,195 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.Resource; +import com.azure.core.management.SystemData; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.awsconnector.models.DynamoDBContinuousBackupsDescriptionProperties; +import java.io.IOException; +import java.util.Map; + +/** + * A Microsoft.AwsConnector resource. + */ +@Fluent +public final class DynamoDBContinuousBackupsDescriptionInner extends Resource { + /* + * The resource-specific properties for this resource. + */ + private DynamoDBContinuousBackupsDescriptionProperties properties; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + private SystemData systemData; + + /* + * The type of the resource. + */ + private String type; + + /* + * The name of the resource. + */ + private String name; + + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /** + * Creates an instance of DynamoDBContinuousBackupsDescriptionInner class. + */ + public DynamoDBContinuousBackupsDescriptionInner() { + } + + /** + * Get the properties property: The resource-specific properties for this resource. + * + * @return the properties value. + */ + public DynamoDBContinuousBackupsDescriptionProperties properties() { + return this.properties; + } + + /** + * Set the properties property: The resource-specific properties for this resource. + * + * @param properties the properties value to set. + * @return the DynamoDBContinuousBackupsDescriptionInner object itself. + */ + public DynamoDBContinuousBackupsDescriptionInner + withProperties(DynamoDBContinuousBackupsDescriptionProperties properties) { + this.properties = properties; + return this; + } + + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * {@inheritDoc} + */ + @Override + public DynamoDBContinuousBackupsDescriptionInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public DynamoDBContinuousBackupsDescriptionInner withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (properties() != null) { + properties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("location", location()); + jsonWriter.writeMapField("tags", tags(), (writer, element) -> writer.writeString(element)); + jsonWriter.writeJsonField("properties", this.properties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of DynamoDBContinuousBackupsDescriptionInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of DynamoDBContinuousBackupsDescriptionInner if the JsonReader was pointing to an instance of + * it, or null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the DynamoDBContinuousBackupsDescriptionInner. + */ + public static DynamoDBContinuousBackupsDescriptionInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + DynamoDBContinuousBackupsDescriptionInner deserializedDynamoDBContinuousBackupsDescriptionInner + = new DynamoDBContinuousBackupsDescriptionInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedDynamoDBContinuousBackupsDescriptionInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedDynamoDBContinuousBackupsDescriptionInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedDynamoDBContinuousBackupsDescriptionInner.type = reader.getString(); + } else if ("location".equals(fieldName)) { + deserializedDynamoDBContinuousBackupsDescriptionInner.withLocation(reader.getString()); + } else if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedDynamoDBContinuousBackupsDescriptionInner.withTags(tags); + } else if ("properties".equals(fieldName)) { + deserializedDynamoDBContinuousBackupsDescriptionInner.properties + = DynamoDBContinuousBackupsDescriptionProperties.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedDynamoDBContinuousBackupsDescriptionInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedDynamoDBContinuousBackupsDescriptionInner; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/models/DynamoDBTableInner.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/models/DynamoDBTableInner.java new file mode 100644 index 000000000000..2964c57520ac --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/models/DynamoDBTableInner.java @@ -0,0 +1,192 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.Resource; +import com.azure.core.management.SystemData; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.awsconnector.models.DynamoDBTableProperties; +import java.io.IOException; +import java.util.Map; + +/** + * A Microsoft.AwsConnector resource. + */ +@Fluent +public final class DynamoDBTableInner extends Resource { + /* + * The resource-specific properties for this resource. + */ + private DynamoDBTableProperties properties; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + private SystemData systemData; + + /* + * The type of the resource. + */ + private String type; + + /* + * The name of the resource. + */ + private String name; + + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /** + * Creates an instance of DynamoDBTableInner class. + */ + public DynamoDBTableInner() { + } + + /** + * Get the properties property: The resource-specific properties for this resource. + * + * @return the properties value. + */ + public DynamoDBTableProperties properties() { + return this.properties; + } + + /** + * Set the properties property: The resource-specific properties for this resource. + * + * @param properties the properties value to set. + * @return the DynamoDBTableInner object itself. + */ + public DynamoDBTableInner withProperties(DynamoDBTableProperties properties) { + this.properties = properties; + return this; + } + + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * {@inheritDoc} + */ + @Override + public DynamoDBTableInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public DynamoDBTableInner withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (properties() != null) { + properties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("location", location()); + jsonWriter.writeMapField("tags", tags(), (writer, element) -> writer.writeString(element)); + jsonWriter.writeJsonField("properties", this.properties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of DynamoDBTableInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of DynamoDBTableInner if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the DynamoDBTableInner. + */ + public static DynamoDBTableInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + DynamoDBTableInner deserializedDynamoDBTableInner = new DynamoDBTableInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedDynamoDBTableInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedDynamoDBTableInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedDynamoDBTableInner.type = reader.getString(); + } else if ("location".equals(fieldName)) { + deserializedDynamoDBTableInner.withLocation(reader.getString()); + } else if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedDynamoDBTableInner.withTags(tags); + } else if ("properties".equals(fieldName)) { + deserializedDynamoDBTableInner.properties = DynamoDBTableProperties.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedDynamoDBTableInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedDynamoDBTableInner; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/models/Ec2AccountAttributeInner.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/models/Ec2AccountAttributeInner.java new file mode 100644 index 000000000000..8fc21db58118 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/models/Ec2AccountAttributeInner.java @@ -0,0 +1,192 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.Resource; +import com.azure.core.management.SystemData; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.awsconnector.models.Ec2AccountAttributeProperties; +import java.io.IOException; +import java.util.Map; + +/** + * A Microsoft.AwsConnector resource. + */ +@Fluent +public final class Ec2AccountAttributeInner extends Resource { + /* + * The resource-specific properties for this resource. + */ + private Ec2AccountAttributeProperties properties; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + private SystemData systemData; + + /* + * The type of the resource. + */ + private String type; + + /* + * The name of the resource. + */ + private String name; + + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /** + * Creates an instance of Ec2AccountAttributeInner class. + */ + public Ec2AccountAttributeInner() { + } + + /** + * Get the properties property: The resource-specific properties for this resource. + * + * @return the properties value. + */ + public Ec2AccountAttributeProperties properties() { + return this.properties; + } + + /** + * Set the properties property: The resource-specific properties for this resource. + * + * @param properties the properties value to set. + * @return the Ec2AccountAttributeInner object itself. + */ + public Ec2AccountAttributeInner withProperties(Ec2AccountAttributeProperties properties) { + this.properties = properties; + return this; + } + + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * {@inheritDoc} + */ + @Override + public Ec2AccountAttributeInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public Ec2AccountAttributeInner withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (properties() != null) { + properties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("location", location()); + jsonWriter.writeMapField("tags", tags(), (writer, element) -> writer.writeString(element)); + jsonWriter.writeJsonField("properties", this.properties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of Ec2AccountAttributeInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of Ec2AccountAttributeInner if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the Ec2AccountAttributeInner. + */ + public static Ec2AccountAttributeInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + Ec2AccountAttributeInner deserializedEc2AccountAttributeInner = new Ec2AccountAttributeInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedEc2AccountAttributeInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedEc2AccountAttributeInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedEc2AccountAttributeInner.type = reader.getString(); + } else if ("location".equals(fieldName)) { + deserializedEc2AccountAttributeInner.withLocation(reader.getString()); + } else if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedEc2AccountAttributeInner.withTags(tags); + } else if ("properties".equals(fieldName)) { + deserializedEc2AccountAttributeInner.properties = Ec2AccountAttributeProperties.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedEc2AccountAttributeInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedEc2AccountAttributeInner; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/models/Ec2AddressInner.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/models/Ec2AddressInner.java new file mode 100644 index 000000000000..7b7f8aac594c --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/models/Ec2AddressInner.java @@ -0,0 +1,192 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.Resource; +import com.azure.core.management.SystemData; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.awsconnector.models.Ec2AddressProperties; +import java.io.IOException; +import java.util.Map; + +/** + * A Microsoft.AwsConnector resource. + */ +@Fluent +public final class Ec2AddressInner extends Resource { + /* + * The resource-specific properties for this resource. + */ + private Ec2AddressProperties properties; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + private SystemData systemData; + + /* + * The type of the resource. + */ + private String type; + + /* + * The name of the resource. + */ + private String name; + + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /** + * Creates an instance of Ec2AddressInner class. + */ + public Ec2AddressInner() { + } + + /** + * Get the properties property: The resource-specific properties for this resource. + * + * @return the properties value. + */ + public Ec2AddressProperties properties() { + return this.properties; + } + + /** + * Set the properties property: The resource-specific properties for this resource. + * + * @param properties the properties value to set. + * @return the Ec2AddressInner object itself. + */ + public Ec2AddressInner withProperties(Ec2AddressProperties properties) { + this.properties = properties; + return this; + } + + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * {@inheritDoc} + */ + @Override + public Ec2AddressInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public Ec2AddressInner withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (properties() != null) { + properties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("location", location()); + jsonWriter.writeMapField("tags", tags(), (writer, element) -> writer.writeString(element)); + jsonWriter.writeJsonField("properties", this.properties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of Ec2AddressInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of Ec2AddressInner if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the Ec2AddressInner. + */ + public static Ec2AddressInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + Ec2AddressInner deserializedEc2AddressInner = new Ec2AddressInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedEc2AddressInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedEc2AddressInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedEc2AddressInner.type = reader.getString(); + } else if ("location".equals(fieldName)) { + deserializedEc2AddressInner.withLocation(reader.getString()); + } else if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedEc2AddressInner.withTags(tags); + } else if ("properties".equals(fieldName)) { + deserializedEc2AddressInner.properties = Ec2AddressProperties.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedEc2AddressInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedEc2AddressInner; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/models/Ec2FlowLogInner.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/models/Ec2FlowLogInner.java new file mode 100644 index 000000000000..77acf19df647 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/models/Ec2FlowLogInner.java @@ -0,0 +1,192 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.Resource; +import com.azure.core.management.SystemData; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.awsconnector.models.Ec2FlowLogProperties; +import java.io.IOException; +import java.util.Map; + +/** + * A Microsoft.AwsConnector resource. + */ +@Fluent +public final class Ec2FlowLogInner extends Resource { + /* + * The resource-specific properties for this resource. + */ + private Ec2FlowLogProperties properties; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + private SystemData systemData; + + /* + * The type of the resource. + */ + private String type; + + /* + * The name of the resource. + */ + private String name; + + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /** + * Creates an instance of Ec2FlowLogInner class. + */ + public Ec2FlowLogInner() { + } + + /** + * Get the properties property: The resource-specific properties for this resource. + * + * @return the properties value. + */ + public Ec2FlowLogProperties properties() { + return this.properties; + } + + /** + * Set the properties property: The resource-specific properties for this resource. + * + * @param properties the properties value to set. + * @return the Ec2FlowLogInner object itself. + */ + public Ec2FlowLogInner withProperties(Ec2FlowLogProperties properties) { + this.properties = properties; + return this; + } + + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * {@inheritDoc} + */ + @Override + public Ec2FlowLogInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public Ec2FlowLogInner withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (properties() != null) { + properties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("location", location()); + jsonWriter.writeMapField("tags", tags(), (writer, element) -> writer.writeString(element)); + jsonWriter.writeJsonField("properties", this.properties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of Ec2FlowLogInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of Ec2FlowLogInner if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the Ec2FlowLogInner. + */ + public static Ec2FlowLogInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + Ec2FlowLogInner deserializedEc2FlowLogInner = new Ec2FlowLogInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedEc2FlowLogInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedEc2FlowLogInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedEc2FlowLogInner.type = reader.getString(); + } else if ("location".equals(fieldName)) { + deserializedEc2FlowLogInner.withLocation(reader.getString()); + } else if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedEc2FlowLogInner.withTags(tags); + } else if ("properties".equals(fieldName)) { + deserializedEc2FlowLogInner.properties = Ec2FlowLogProperties.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedEc2FlowLogInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedEc2FlowLogInner; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/models/Ec2ImageInner.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/models/Ec2ImageInner.java new file mode 100644 index 000000000000..4f788d4d6042 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/models/Ec2ImageInner.java @@ -0,0 +1,192 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.Resource; +import com.azure.core.management.SystemData; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.awsconnector.models.Ec2ImageProperties; +import java.io.IOException; +import java.util.Map; + +/** + * A Microsoft.AwsConnector resource. + */ +@Fluent +public final class Ec2ImageInner extends Resource { + /* + * The resource-specific properties for this resource. + */ + private Ec2ImageProperties properties; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + private SystemData systemData; + + /* + * The type of the resource. + */ + private String type; + + /* + * The name of the resource. + */ + private String name; + + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /** + * Creates an instance of Ec2ImageInner class. + */ + public Ec2ImageInner() { + } + + /** + * Get the properties property: The resource-specific properties for this resource. + * + * @return the properties value. + */ + public Ec2ImageProperties properties() { + return this.properties; + } + + /** + * Set the properties property: The resource-specific properties for this resource. + * + * @param properties the properties value to set. + * @return the Ec2ImageInner object itself. + */ + public Ec2ImageInner withProperties(Ec2ImageProperties properties) { + this.properties = properties; + return this; + } + + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * {@inheritDoc} + */ + @Override + public Ec2ImageInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public Ec2ImageInner withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (properties() != null) { + properties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("location", location()); + jsonWriter.writeMapField("tags", tags(), (writer, element) -> writer.writeString(element)); + jsonWriter.writeJsonField("properties", this.properties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of Ec2ImageInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of Ec2ImageInner if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the Ec2ImageInner. + */ + public static Ec2ImageInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + Ec2ImageInner deserializedEc2ImageInner = new Ec2ImageInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedEc2ImageInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedEc2ImageInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedEc2ImageInner.type = reader.getString(); + } else if ("location".equals(fieldName)) { + deserializedEc2ImageInner.withLocation(reader.getString()); + } else if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedEc2ImageInner.withTags(tags); + } else if ("properties".equals(fieldName)) { + deserializedEc2ImageInner.properties = Ec2ImageProperties.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedEc2ImageInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedEc2ImageInner; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/models/Ec2InstanceInner.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/models/Ec2InstanceInner.java new file mode 100644 index 000000000000..abee8943aa52 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/models/Ec2InstanceInner.java @@ -0,0 +1,166 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.ProxyResource; +import com.azure.core.management.SystemData; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.awsconnector.models.Ec2InstanceProperties; +import java.io.IOException; + +/** + * A Microsoft.AwsConnector resource. + */ +@Fluent +public final class Ec2InstanceInner extends ProxyResource { + /* + * The resource-specific properties for this resource. + */ + private Ec2InstanceProperties properties; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + private SystemData systemData; + + /* + * The type of the resource. + */ + private String type; + + /* + * The name of the resource. + */ + private String name; + + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /** + * Creates an instance of Ec2InstanceInner class. + */ + public Ec2InstanceInner() { + } + + /** + * Get the properties property: The resource-specific properties for this resource. + * + * @return the properties value. + */ + public Ec2InstanceProperties properties() { + return this.properties; + } + + /** + * Set the properties property: The resource-specific properties for this resource. + * + * @param properties the properties value to set. + * @return the Ec2InstanceInner object itself. + */ + public Ec2InstanceInner withProperties(Ec2InstanceProperties properties) { + this.properties = properties; + return this; + } + + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (properties() != null) { + properties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("properties", this.properties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of Ec2InstanceInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of Ec2InstanceInner if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the Ec2InstanceInner. + */ + public static Ec2InstanceInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + Ec2InstanceInner deserializedEc2InstanceInner = new Ec2InstanceInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedEc2InstanceInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedEc2InstanceInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedEc2InstanceInner.type = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedEc2InstanceInner.properties = Ec2InstanceProperties.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedEc2InstanceInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedEc2InstanceInner; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/models/Ec2InstanceStatusInner.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/models/Ec2InstanceStatusInner.java new file mode 100644 index 000000000000..4c6c77d5b061 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/models/Ec2InstanceStatusInner.java @@ -0,0 +1,192 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.Resource; +import com.azure.core.management.SystemData; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.awsconnector.models.Ec2InstanceStatusProperties; +import java.io.IOException; +import java.util.Map; + +/** + * A Microsoft.AwsConnector resource. + */ +@Fluent +public final class Ec2InstanceStatusInner extends Resource { + /* + * The resource-specific properties for this resource. + */ + private Ec2InstanceStatusProperties properties; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + private SystemData systemData; + + /* + * The type of the resource. + */ + private String type; + + /* + * The name of the resource. + */ + private String name; + + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /** + * Creates an instance of Ec2InstanceStatusInner class. + */ + public Ec2InstanceStatusInner() { + } + + /** + * Get the properties property: The resource-specific properties for this resource. + * + * @return the properties value. + */ + public Ec2InstanceStatusProperties properties() { + return this.properties; + } + + /** + * Set the properties property: The resource-specific properties for this resource. + * + * @param properties the properties value to set. + * @return the Ec2InstanceStatusInner object itself. + */ + public Ec2InstanceStatusInner withProperties(Ec2InstanceStatusProperties properties) { + this.properties = properties; + return this; + } + + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * {@inheritDoc} + */ + @Override + public Ec2InstanceStatusInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public Ec2InstanceStatusInner withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (properties() != null) { + properties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("location", location()); + jsonWriter.writeMapField("tags", tags(), (writer, element) -> writer.writeString(element)); + jsonWriter.writeJsonField("properties", this.properties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of Ec2InstanceStatusInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of Ec2InstanceStatusInner if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the Ec2InstanceStatusInner. + */ + public static Ec2InstanceStatusInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + Ec2InstanceStatusInner deserializedEc2InstanceStatusInner = new Ec2InstanceStatusInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedEc2InstanceStatusInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedEc2InstanceStatusInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedEc2InstanceStatusInner.type = reader.getString(); + } else if ("location".equals(fieldName)) { + deserializedEc2InstanceStatusInner.withLocation(reader.getString()); + } else if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedEc2InstanceStatusInner.withTags(tags); + } else if ("properties".equals(fieldName)) { + deserializedEc2InstanceStatusInner.properties = Ec2InstanceStatusProperties.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedEc2InstanceStatusInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedEc2InstanceStatusInner; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/models/Ec2IpamInner.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/models/Ec2IpamInner.java new file mode 100644 index 000000000000..352c89019d98 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/models/Ec2IpamInner.java @@ -0,0 +1,192 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.Resource; +import com.azure.core.management.SystemData; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.awsconnector.models.Ec2IpamProperties; +import java.io.IOException; +import java.util.Map; + +/** + * A Microsoft.AwsConnector resource. + */ +@Fluent +public final class Ec2IpamInner extends Resource { + /* + * The resource-specific properties for this resource. + */ + private Ec2IpamProperties properties; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + private SystemData systemData; + + /* + * The type of the resource. + */ + private String type; + + /* + * The name of the resource. + */ + private String name; + + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /** + * Creates an instance of Ec2IpamInner class. + */ + public Ec2IpamInner() { + } + + /** + * Get the properties property: The resource-specific properties for this resource. + * + * @return the properties value. + */ + public Ec2IpamProperties properties() { + return this.properties; + } + + /** + * Set the properties property: The resource-specific properties for this resource. + * + * @param properties the properties value to set. + * @return the Ec2IpamInner object itself. + */ + public Ec2IpamInner withProperties(Ec2IpamProperties properties) { + this.properties = properties; + return this; + } + + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * {@inheritDoc} + */ + @Override + public Ec2IpamInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public Ec2IpamInner withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (properties() != null) { + properties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("location", location()); + jsonWriter.writeMapField("tags", tags(), (writer, element) -> writer.writeString(element)); + jsonWriter.writeJsonField("properties", this.properties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of Ec2IpamInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of Ec2IpamInner if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the Ec2IpamInner. + */ + public static Ec2IpamInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + Ec2IpamInner deserializedEc2IpamInner = new Ec2IpamInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedEc2IpamInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedEc2IpamInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedEc2IpamInner.type = reader.getString(); + } else if ("location".equals(fieldName)) { + deserializedEc2IpamInner.withLocation(reader.getString()); + } else if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedEc2IpamInner.withTags(tags); + } else if ("properties".equals(fieldName)) { + deserializedEc2IpamInner.properties = Ec2IpamProperties.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedEc2IpamInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedEc2IpamInner; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/models/Ec2KeyPairInner.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/models/Ec2KeyPairInner.java new file mode 100644 index 000000000000..754fcf36ad89 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/models/Ec2KeyPairInner.java @@ -0,0 +1,192 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.Resource; +import com.azure.core.management.SystemData; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.awsconnector.models.Ec2KeyPairProperties; +import java.io.IOException; +import java.util.Map; + +/** + * A Microsoft.AwsConnector resource. + */ +@Fluent +public final class Ec2KeyPairInner extends Resource { + /* + * The resource-specific properties for this resource. + */ + private Ec2KeyPairProperties properties; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + private SystemData systemData; + + /* + * The type of the resource. + */ + private String type; + + /* + * The name of the resource. + */ + private String name; + + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /** + * Creates an instance of Ec2KeyPairInner class. + */ + public Ec2KeyPairInner() { + } + + /** + * Get the properties property: The resource-specific properties for this resource. + * + * @return the properties value. + */ + public Ec2KeyPairProperties properties() { + return this.properties; + } + + /** + * Set the properties property: The resource-specific properties for this resource. + * + * @param properties the properties value to set. + * @return the Ec2KeyPairInner object itself. + */ + public Ec2KeyPairInner withProperties(Ec2KeyPairProperties properties) { + this.properties = properties; + return this; + } + + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * {@inheritDoc} + */ + @Override + public Ec2KeyPairInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public Ec2KeyPairInner withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (properties() != null) { + properties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("location", location()); + jsonWriter.writeMapField("tags", tags(), (writer, element) -> writer.writeString(element)); + jsonWriter.writeJsonField("properties", this.properties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of Ec2KeyPairInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of Ec2KeyPairInner if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the Ec2KeyPairInner. + */ + public static Ec2KeyPairInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + Ec2KeyPairInner deserializedEc2KeyPairInner = new Ec2KeyPairInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedEc2KeyPairInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedEc2KeyPairInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedEc2KeyPairInner.type = reader.getString(); + } else if ("location".equals(fieldName)) { + deserializedEc2KeyPairInner.withLocation(reader.getString()); + } else if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedEc2KeyPairInner.withTags(tags); + } else if ("properties".equals(fieldName)) { + deserializedEc2KeyPairInner.properties = Ec2KeyPairProperties.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedEc2KeyPairInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedEc2KeyPairInner; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/models/Ec2NetworkAclInner.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/models/Ec2NetworkAclInner.java new file mode 100644 index 000000000000..df02e44b3194 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/models/Ec2NetworkAclInner.java @@ -0,0 +1,192 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.Resource; +import com.azure.core.management.SystemData; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.awsconnector.models.Ec2NetworkAclProperties; +import java.io.IOException; +import java.util.Map; + +/** + * A Microsoft.AwsConnector resource. + */ +@Fluent +public final class Ec2NetworkAclInner extends Resource { + /* + * The resource-specific properties for this resource. + */ + private Ec2NetworkAclProperties properties; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + private SystemData systemData; + + /* + * The type of the resource. + */ + private String type; + + /* + * The name of the resource. + */ + private String name; + + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /** + * Creates an instance of Ec2NetworkAclInner class. + */ + public Ec2NetworkAclInner() { + } + + /** + * Get the properties property: The resource-specific properties for this resource. + * + * @return the properties value. + */ + public Ec2NetworkAclProperties properties() { + return this.properties; + } + + /** + * Set the properties property: The resource-specific properties for this resource. + * + * @param properties the properties value to set. + * @return the Ec2NetworkAclInner object itself. + */ + public Ec2NetworkAclInner withProperties(Ec2NetworkAclProperties properties) { + this.properties = properties; + return this; + } + + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * {@inheritDoc} + */ + @Override + public Ec2NetworkAclInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public Ec2NetworkAclInner withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (properties() != null) { + properties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("location", location()); + jsonWriter.writeMapField("tags", tags(), (writer, element) -> writer.writeString(element)); + jsonWriter.writeJsonField("properties", this.properties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of Ec2NetworkAclInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of Ec2NetworkAclInner if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the Ec2NetworkAclInner. + */ + public static Ec2NetworkAclInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + Ec2NetworkAclInner deserializedEc2NetworkAclInner = new Ec2NetworkAclInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedEc2NetworkAclInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedEc2NetworkAclInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedEc2NetworkAclInner.type = reader.getString(); + } else if ("location".equals(fieldName)) { + deserializedEc2NetworkAclInner.withLocation(reader.getString()); + } else if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedEc2NetworkAclInner.withTags(tags); + } else if ("properties".equals(fieldName)) { + deserializedEc2NetworkAclInner.properties = Ec2NetworkAclProperties.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedEc2NetworkAclInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedEc2NetworkAclInner; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/models/Ec2NetworkInterfaceInner.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/models/Ec2NetworkInterfaceInner.java new file mode 100644 index 000000000000..65c4a560f81c --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/models/Ec2NetworkInterfaceInner.java @@ -0,0 +1,192 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.Resource; +import com.azure.core.management.SystemData; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.awsconnector.models.Ec2NetworkInterfaceProperties; +import java.io.IOException; +import java.util.Map; + +/** + * A Microsoft.AwsConnector resource. + */ +@Fluent +public final class Ec2NetworkInterfaceInner extends Resource { + /* + * The resource-specific properties for this resource. + */ + private Ec2NetworkInterfaceProperties properties; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + private SystemData systemData; + + /* + * The type of the resource. + */ + private String type; + + /* + * The name of the resource. + */ + private String name; + + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /** + * Creates an instance of Ec2NetworkInterfaceInner class. + */ + public Ec2NetworkInterfaceInner() { + } + + /** + * Get the properties property: The resource-specific properties for this resource. + * + * @return the properties value. + */ + public Ec2NetworkInterfaceProperties properties() { + return this.properties; + } + + /** + * Set the properties property: The resource-specific properties for this resource. + * + * @param properties the properties value to set. + * @return the Ec2NetworkInterfaceInner object itself. + */ + public Ec2NetworkInterfaceInner withProperties(Ec2NetworkInterfaceProperties properties) { + this.properties = properties; + return this; + } + + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * {@inheritDoc} + */ + @Override + public Ec2NetworkInterfaceInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public Ec2NetworkInterfaceInner withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (properties() != null) { + properties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("location", location()); + jsonWriter.writeMapField("tags", tags(), (writer, element) -> writer.writeString(element)); + jsonWriter.writeJsonField("properties", this.properties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of Ec2NetworkInterfaceInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of Ec2NetworkInterfaceInner if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the Ec2NetworkInterfaceInner. + */ + public static Ec2NetworkInterfaceInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + Ec2NetworkInterfaceInner deserializedEc2NetworkInterfaceInner = new Ec2NetworkInterfaceInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedEc2NetworkInterfaceInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedEc2NetworkInterfaceInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedEc2NetworkInterfaceInner.type = reader.getString(); + } else if ("location".equals(fieldName)) { + deserializedEc2NetworkInterfaceInner.withLocation(reader.getString()); + } else if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedEc2NetworkInterfaceInner.withTags(tags); + } else if ("properties".equals(fieldName)) { + deserializedEc2NetworkInterfaceInner.properties = Ec2NetworkInterfaceProperties.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedEc2NetworkInterfaceInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedEc2NetworkInterfaceInner; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/models/Ec2RouteTableInner.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/models/Ec2RouteTableInner.java new file mode 100644 index 000000000000..ebf783259e24 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/models/Ec2RouteTableInner.java @@ -0,0 +1,192 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.Resource; +import com.azure.core.management.SystemData; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.awsconnector.models.Ec2RouteTableProperties; +import java.io.IOException; +import java.util.Map; + +/** + * A Microsoft.AwsConnector resource. + */ +@Fluent +public final class Ec2RouteTableInner extends Resource { + /* + * The resource-specific properties for this resource. + */ + private Ec2RouteTableProperties properties; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + private SystemData systemData; + + /* + * The type of the resource. + */ + private String type; + + /* + * The name of the resource. + */ + private String name; + + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /** + * Creates an instance of Ec2RouteTableInner class. + */ + public Ec2RouteTableInner() { + } + + /** + * Get the properties property: The resource-specific properties for this resource. + * + * @return the properties value. + */ + public Ec2RouteTableProperties properties() { + return this.properties; + } + + /** + * Set the properties property: The resource-specific properties for this resource. + * + * @param properties the properties value to set. + * @return the Ec2RouteTableInner object itself. + */ + public Ec2RouteTableInner withProperties(Ec2RouteTableProperties properties) { + this.properties = properties; + return this; + } + + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * {@inheritDoc} + */ + @Override + public Ec2RouteTableInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public Ec2RouteTableInner withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (properties() != null) { + properties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("location", location()); + jsonWriter.writeMapField("tags", tags(), (writer, element) -> writer.writeString(element)); + jsonWriter.writeJsonField("properties", this.properties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of Ec2RouteTableInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of Ec2RouteTableInner if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the Ec2RouteTableInner. + */ + public static Ec2RouteTableInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + Ec2RouteTableInner deserializedEc2RouteTableInner = new Ec2RouteTableInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedEc2RouteTableInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedEc2RouteTableInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedEc2RouteTableInner.type = reader.getString(); + } else if ("location".equals(fieldName)) { + deserializedEc2RouteTableInner.withLocation(reader.getString()); + } else if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedEc2RouteTableInner.withTags(tags); + } else if ("properties".equals(fieldName)) { + deserializedEc2RouteTableInner.properties = Ec2RouteTableProperties.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedEc2RouteTableInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedEc2RouteTableInner; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/models/Ec2SecurityGroupInner.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/models/Ec2SecurityGroupInner.java new file mode 100644 index 000000000000..9fb8c15277e1 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/models/Ec2SecurityGroupInner.java @@ -0,0 +1,192 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.Resource; +import com.azure.core.management.SystemData; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.awsconnector.models.Ec2SecurityGroupProperties; +import java.io.IOException; +import java.util.Map; + +/** + * A Microsoft.AwsConnector resource. + */ +@Fluent +public final class Ec2SecurityGroupInner extends Resource { + /* + * The resource-specific properties for this resource. + */ + private Ec2SecurityGroupProperties properties; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + private SystemData systemData; + + /* + * The type of the resource. + */ + private String type; + + /* + * The name of the resource. + */ + private String name; + + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /** + * Creates an instance of Ec2SecurityGroupInner class. + */ + public Ec2SecurityGroupInner() { + } + + /** + * Get the properties property: The resource-specific properties for this resource. + * + * @return the properties value. + */ + public Ec2SecurityGroupProperties properties() { + return this.properties; + } + + /** + * Set the properties property: The resource-specific properties for this resource. + * + * @param properties the properties value to set. + * @return the Ec2SecurityGroupInner object itself. + */ + public Ec2SecurityGroupInner withProperties(Ec2SecurityGroupProperties properties) { + this.properties = properties; + return this; + } + + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * {@inheritDoc} + */ + @Override + public Ec2SecurityGroupInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public Ec2SecurityGroupInner withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (properties() != null) { + properties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("location", location()); + jsonWriter.writeMapField("tags", tags(), (writer, element) -> writer.writeString(element)); + jsonWriter.writeJsonField("properties", this.properties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of Ec2SecurityGroupInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of Ec2SecurityGroupInner if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the Ec2SecurityGroupInner. + */ + public static Ec2SecurityGroupInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + Ec2SecurityGroupInner deserializedEc2SecurityGroupInner = new Ec2SecurityGroupInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedEc2SecurityGroupInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedEc2SecurityGroupInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedEc2SecurityGroupInner.type = reader.getString(); + } else if ("location".equals(fieldName)) { + deserializedEc2SecurityGroupInner.withLocation(reader.getString()); + } else if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedEc2SecurityGroupInner.withTags(tags); + } else if ("properties".equals(fieldName)) { + deserializedEc2SecurityGroupInner.properties = Ec2SecurityGroupProperties.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedEc2SecurityGroupInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedEc2SecurityGroupInner; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/models/Ec2SnapshotInner.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/models/Ec2SnapshotInner.java new file mode 100644 index 000000000000..76288f602d22 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/models/Ec2SnapshotInner.java @@ -0,0 +1,192 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.Resource; +import com.azure.core.management.SystemData; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.awsconnector.models.Ec2SnapshotProperties; +import java.io.IOException; +import java.util.Map; + +/** + * A Microsoft.AwsConnector resource. + */ +@Fluent +public final class Ec2SnapshotInner extends Resource { + /* + * The resource-specific properties for this resource. + */ + private Ec2SnapshotProperties properties; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + private SystemData systemData; + + /* + * The type of the resource. + */ + private String type; + + /* + * The name of the resource. + */ + private String name; + + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /** + * Creates an instance of Ec2SnapshotInner class. + */ + public Ec2SnapshotInner() { + } + + /** + * Get the properties property: The resource-specific properties for this resource. + * + * @return the properties value. + */ + public Ec2SnapshotProperties properties() { + return this.properties; + } + + /** + * Set the properties property: The resource-specific properties for this resource. + * + * @param properties the properties value to set. + * @return the Ec2SnapshotInner object itself. + */ + public Ec2SnapshotInner withProperties(Ec2SnapshotProperties properties) { + this.properties = properties; + return this; + } + + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * {@inheritDoc} + */ + @Override + public Ec2SnapshotInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public Ec2SnapshotInner withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (properties() != null) { + properties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("location", location()); + jsonWriter.writeMapField("tags", tags(), (writer, element) -> writer.writeString(element)); + jsonWriter.writeJsonField("properties", this.properties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of Ec2SnapshotInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of Ec2SnapshotInner if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the Ec2SnapshotInner. + */ + public static Ec2SnapshotInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + Ec2SnapshotInner deserializedEc2SnapshotInner = new Ec2SnapshotInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedEc2SnapshotInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedEc2SnapshotInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedEc2SnapshotInner.type = reader.getString(); + } else if ("location".equals(fieldName)) { + deserializedEc2SnapshotInner.withLocation(reader.getString()); + } else if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedEc2SnapshotInner.withTags(tags); + } else if ("properties".equals(fieldName)) { + deserializedEc2SnapshotInner.properties = Ec2SnapshotProperties.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedEc2SnapshotInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedEc2SnapshotInner; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/models/Ec2SubnetInner.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/models/Ec2SubnetInner.java new file mode 100644 index 000000000000..6ef0feacca84 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/models/Ec2SubnetInner.java @@ -0,0 +1,192 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.Resource; +import com.azure.core.management.SystemData; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.awsconnector.models.Ec2SubnetProperties; +import java.io.IOException; +import java.util.Map; + +/** + * A Microsoft.AwsConnector resource. + */ +@Fluent +public final class Ec2SubnetInner extends Resource { + /* + * The resource-specific properties for this resource. + */ + private Ec2SubnetProperties properties; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + private SystemData systemData; + + /* + * The type of the resource. + */ + private String type; + + /* + * The name of the resource. + */ + private String name; + + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /** + * Creates an instance of Ec2SubnetInner class. + */ + public Ec2SubnetInner() { + } + + /** + * Get the properties property: The resource-specific properties for this resource. + * + * @return the properties value. + */ + public Ec2SubnetProperties properties() { + return this.properties; + } + + /** + * Set the properties property: The resource-specific properties for this resource. + * + * @param properties the properties value to set. + * @return the Ec2SubnetInner object itself. + */ + public Ec2SubnetInner withProperties(Ec2SubnetProperties properties) { + this.properties = properties; + return this; + } + + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * {@inheritDoc} + */ + @Override + public Ec2SubnetInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public Ec2SubnetInner withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (properties() != null) { + properties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("location", location()); + jsonWriter.writeMapField("tags", tags(), (writer, element) -> writer.writeString(element)); + jsonWriter.writeJsonField("properties", this.properties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of Ec2SubnetInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of Ec2SubnetInner if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the Ec2SubnetInner. + */ + public static Ec2SubnetInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + Ec2SubnetInner deserializedEc2SubnetInner = new Ec2SubnetInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedEc2SubnetInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedEc2SubnetInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedEc2SubnetInner.type = reader.getString(); + } else if ("location".equals(fieldName)) { + deserializedEc2SubnetInner.withLocation(reader.getString()); + } else if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedEc2SubnetInner.withTags(tags); + } else if ("properties".equals(fieldName)) { + deserializedEc2SubnetInner.properties = Ec2SubnetProperties.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedEc2SubnetInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedEc2SubnetInner; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/models/Ec2VolumeInner.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/models/Ec2VolumeInner.java new file mode 100644 index 000000000000..8e8a3ed119f6 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/models/Ec2VolumeInner.java @@ -0,0 +1,192 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.Resource; +import com.azure.core.management.SystemData; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.awsconnector.models.Ec2VolumeProperties; +import java.io.IOException; +import java.util.Map; + +/** + * A Microsoft.AwsConnector resource. + */ +@Fluent +public final class Ec2VolumeInner extends Resource { + /* + * The resource-specific properties for this resource. + */ + private Ec2VolumeProperties properties; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + private SystemData systemData; + + /* + * The type of the resource. + */ + private String type; + + /* + * The name of the resource. + */ + private String name; + + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /** + * Creates an instance of Ec2VolumeInner class. + */ + public Ec2VolumeInner() { + } + + /** + * Get the properties property: The resource-specific properties for this resource. + * + * @return the properties value. + */ + public Ec2VolumeProperties properties() { + return this.properties; + } + + /** + * Set the properties property: The resource-specific properties for this resource. + * + * @param properties the properties value to set. + * @return the Ec2VolumeInner object itself. + */ + public Ec2VolumeInner withProperties(Ec2VolumeProperties properties) { + this.properties = properties; + return this; + } + + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * {@inheritDoc} + */ + @Override + public Ec2VolumeInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public Ec2VolumeInner withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (properties() != null) { + properties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("location", location()); + jsonWriter.writeMapField("tags", tags(), (writer, element) -> writer.writeString(element)); + jsonWriter.writeJsonField("properties", this.properties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of Ec2VolumeInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of Ec2VolumeInner if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the Ec2VolumeInner. + */ + public static Ec2VolumeInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + Ec2VolumeInner deserializedEc2VolumeInner = new Ec2VolumeInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedEc2VolumeInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedEc2VolumeInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedEc2VolumeInner.type = reader.getString(); + } else if ("location".equals(fieldName)) { + deserializedEc2VolumeInner.withLocation(reader.getString()); + } else if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedEc2VolumeInner.withTags(tags); + } else if ("properties".equals(fieldName)) { + deserializedEc2VolumeInner.properties = Ec2VolumeProperties.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedEc2VolumeInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedEc2VolumeInner; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/models/Ec2VpcEndpointInner.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/models/Ec2VpcEndpointInner.java new file mode 100644 index 000000000000..82cb23fa1198 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/models/Ec2VpcEndpointInner.java @@ -0,0 +1,192 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.Resource; +import com.azure.core.management.SystemData; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.awsconnector.models.Ec2VpcEndpointProperties; +import java.io.IOException; +import java.util.Map; + +/** + * A Microsoft.AwsConnector resource. + */ +@Fluent +public final class Ec2VpcEndpointInner extends Resource { + /* + * The resource-specific properties for this resource. + */ + private Ec2VpcEndpointProperties properties; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + private SystemData systemData; + + /* + * The type of the resource. + */ + private String type; + + /* + * The name of the resource. + */ + private String name; + + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /** + * Creates an instance of Ec2VpcEndpointInner class. + */ + public Ec2VpcEndpointInner() { + } + + /** + * Get the properties property: The resource-specific properties for this resource. + * + * @return the properties value. + */ + public Ec2VpcEndpointProperties properties() { + return this.properties; + } + + /** + * Set the properties property: The resource-specific properties for this resource. + * + * @param properties the properties value to set. + * @return the Ec2VpcEndpointInner object itself. + */ + public Ec2VpcEndpointInner withProperties(Ec2VpcEndpointProperties properties) { + this.properties = properties; + return this; + } + + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * {@inheritDoc} + */ + @Override + public Ec2VpcEndpointInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public Ec2VpcEndpointInner withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (properties() != null) { + properties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("location", location()); + jsonWriter.writeMapField("tags", tags(), (writer, element) -> writer.writeString(element)); + jsonWriter.writeJsonField("properties", this.properties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of Ec2VpcEndpointInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of Ec2VpcEndpointInner if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the Ec2VpcEndpointInner. + */ + public static Ec2VpcEndpointInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + Ec2VpcEndpointInner deserializedEc2VpcEndpointInner = new Ec2VpcEndpointInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedEc2VpcEndpointInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedEc2VpcEndpointInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedEc2VpcEndpointInner.type = reader.getString(); + } else if ("location".equals(fieldName)) { + deserializedEc2VpcEndpointInner.withLocation(reader.getString()); + } else if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedEc2VpcEndpointInner.withTags(tags); + } else if ("properties".equals(fieldName)) { + deserializedEc2VpcEndpointInner.properties = Ec2VpcEndpointProperties.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedEc2VpcEndpointInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedEc2VpcEndpointInner; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/models/Ec2VpcInner.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/models/Ec2VpcInner.java new file mode 100644 index 000000000000..ac2d019608d1 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/models/Ec2VpcInner.java @@ -0,0 +1,192 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.Resource; +import com.azure.core.management.SystemData; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.awsconnector.models.Ec2VpcProperties; +import java.io.IOException; +import java.util.Map; + +/** + * A Microsoft.AwsConnector resource. + */ +@Fluent +public final class Ec2VpcInner extends Resource { + /* + * The resource-specific properties for this resource. + */ + private Ec2VpcProperties properties; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + private SystemData systemData; + + /* + * The type of the resource. + */ + private String type; + + /* + * The name of the resource. + */ + private String name; + + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /** + * Creates an instance of Ec2VpcInner class. + */ + public Ec2VpcInner() { + } + + /** + * Get the properties property: The resource-specific properties for this resource. + * + * @return the properties value. + */ + public Ec2VpcProperties properties() { + return this.properties; + } + + /** + * Set the properties property: The resource-specific properties for this resource. + * + * @param properties the properties value to set. + * @return the Ec2VpcInner object itself. + */ + public Ec2VpcInner withProperties(Ec2VpcProperties properties) { + this.properties = properties; + return this; + } + + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * {@inheritDoc} + */ + @Override + public Ec2VpcInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public Ec2VpcInner withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (properties() != null) { + properties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("location", location()); + jsonWriter.writeMapField("tags", tags(), (writer, element) -> writer.writeString(element)); + jsonWriter.writeJsonField("properties", this.properties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of Ec2VpcInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of Ec2VpcInner if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the Ec2VpcInner. + */ + public static Ec2VpcInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + Ec2VpcInner deserializedEc2VpcInner = new Ec2VpcInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedEc2VpcInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedEc2VpcInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedEc2VpcInner.type = reader.getString(); + } else if ("location".equals(fieldName)) { + deserializedEc2VpcInner.withLocation(reader.getString()); + } else if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedEc2VpcInner.withTags(tags); + } else if ("properties".equals(fieldName)) { + deserializedEc2VpcInner.properties = Ec2VpcProperties.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedEc2VpcInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedEc2VpcInner; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/models/Ec2VpcPeeringConnectionInner.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/models/Ec2VpcPeeringConnectionInner.java new file mode 100644 index 000000000000..b47ce984eb26 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/models/Ec2VpcPeeringConnectionInner.java @@ -0,0 +1,193 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.Resource; +import com.azure.core.management.SystemData; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.awsconnector.models.Ec2VpcPeeringConnectionProperties; +import java.io.IOException; +import java.util.Map; + +/** + * A Microsoft.AwsConnector resource. + */ +@Fluent +public final class Ec2VpcPeeringConnectionInner extends Resource { + /* + * The resource-specific properties for this resource. + */ + private Ec2VpcPeeringConnectionProperties properties; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + private SystemData systemData; + + /* + * The type of the resource. + */ + private String type; + + /* + * The name of the resource. + */ + private String name; + + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /** + * Creates an instance of Ec2VpcPeeringConnectionInner class. + */ + public Ec2VpcPeeringConnectionInner() { + } + + /** + * Get the properties property: The resource-specific properties for this resource. + * + * @return the properties value. + */ + public Ec2VpcPeeringConnectionProperties properties() { + return this.properties; + } + + /** + * Set the properties property: The resource-specific properties for this resource. + * + * @param properties the properties value to set. + * @return the Ec2VpcPeeringConnectionInner object itself. + */ + public Ec2VpcPeeringConnectionInner withProperties(Ec2VpcPeeringConnectionProperties properties) { + this.properties = properties; + return this; + } + + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * {@inheritDoc} + */ + @Override + public Ec2VpcPeeringConnectionInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public Ec2VpcPeeringConnectionInner withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (properties() != null) { + properties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("location", location()); + jsonWriter.writeMapField("tags", tags(), (writer, element) -> writer.writeString(element)); + jsonWriter.writeJsonField("properties", this.properties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of Ec2VpcPeeringConnectionInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of Ec2VpcPeeringConnectionInner if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the Ec2VpcPeeringConnectionInner. + */ + public static Ec2VpcPeeringConnectionInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + Ec2VpcPeeringConnectionInner deserializedEc2VpcPeeringConnectionInner = new Ec2VpcPeeringConnectionInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedEc2VpcPeeringConnectionInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedEc2VpcPeeringConnectionInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedEc2VpcPeeringConnectionInner.type = reader.getString(); + } else if ("location".equals(fieldName)) { + deserializedEc2VpcPeeringConnectionInner.withLocation(reader.getString()); + } else if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedEc2VpcPeeringConnectionInner.withTags(tags); + } else if ("properties".equals(fieldName)) { + deserializedEc2VpcPeeringConnectionInner.properties + = Ec2VpcPeeringConnectionProperties.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedEc2VpcPeeringConnectionInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedEc2VpcPeeringConnectionInner; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/models/EcrImageDetailInner.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/models/EcrImageDetailInner.java new file mode 100644 index 000000000000..57a9ff0f78f1 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/models/EcrImageDetailInner.java @@ -0,0 +1,192 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.Resource; +import com.azure.core.management.SystemData; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.awsconnector.models.EcrImageDetailProperties; +import java.io.IOException; +import java.util.Map; + +/** + * A Microsoft.AwsConnector resource. + */ +@Fluent +public final class EcrImageDetailInner extends Resource { + /* + * The resource-specific properties for this resource. + */ + private EcrImageDetailProperties properties; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + private SystemData systemData; + + /* + * The type of the resource. + */ + private String type; + + /* + * The name of the resource. + */ + private String name; + + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /** + * Creates an instance of EcrImageDetailInner class. + */ + public EcrImageDetailInner() { + } + + /** + * Get the properties property: The resource-specific properties for this resource. + * + * @return the properties value. + */ + public EcrImageDetailProperties properties() { + return this.properties; + } + + /** + * Set the properties property: The resource-specific properties for this resource. + * + * @param properties the properties value to set. + * @return the EcrImageDetailInner object itself. + */ + public EcrImageDetailInner withProperties(EcrImageDetailProperties properties) { + this.properties = properties; + return this; + } + + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * {@inheritDoc} + */ + @Override + public EcrImageDetailInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public EcrImageDetailInner withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (properties() != null) { + properties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("location", location()); + jsonWriter.writeMapField("tags", tags(), (writer, element) -> writer.writeString(element)); + jsonWriter.writeJsonField("properties", this.properties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of EcrImageDetailInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of EcrImageDetailInner if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the EcrImageDetailInner. + */ + public static EcrImageDetailInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + EcrImageDetailInner deserializedEcrImageDetailInner = new EcrImageDetailInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedEcrImageDetailInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedEcrImageDetailInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedEcrImageDetailInner.type = reader.getString(); + } else if ("location".equals(fieldName)) { + deserializedEcrImageDetailInner.withLocation(reader.getString()); + } else if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedEcrImageDetailInner.withTags(tags); + } else if ("properties".equals(fieldName)) { + deserializedEcrImageDetailInner.properties = EcrImageDetailProperties.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedEcrImageDetailInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedEcrImageDetailInner; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/models/EcrRepositoryInner.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/models/EcrRepositoryInner.java new file mode 100644 index 000000000000..977f75710204 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/models/EcrRepositoryInner.java @@ -0,0 +1,192 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.Resource; +import com.azure.core.management.SystemData; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.awsconnector.models.EcrRepositoryProperties; +import java.io.IOException; +import java.util.Map; + +/** + * A Microsoft.AwsConnector resource. + */ +@Fluent +public final class EcrRepositoryInner extends Resource { + /* + * The resource-specific properties for this resource. + */ + private EcrRepositoryProperties properties; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + private SystemData systemData; + + /* + * The type of the resource. + */ + private String type; + + /* + * The name of the resource. + */ + private String name; + + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /** + * Creates an instance of EcrRepositoryInner class. + */ + public EcrRepositoryInner() { + } + + /** + * Get the properties property: The resource-specific properties for this resource. + * + * @return the properties value. + */ + public EcrRepositoryProperties properties() { + return this.properties; + } + + /** + * Set the properties property: The resource-specific properties for this resource. + * + * @param properties the properties value to set. + * @return the EcrRepositoryInner object itself. + */ + public EcrRepositoryInner withProperties(EcrRepositoryProperties properties) { + this.properties = properties; + return this; + } + + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * {@inheritDoc} + */ + @Override + public EcrRepositoryInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public EcrRepositoryInner withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (properties() != null) { + properties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("location", location()); + jsonWriter.writeMapField("tags", tags(), (writer, element) -> writer.writeString(element)); + jsonWriter.writeJsonField("properties", this.properties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of EcrRepositoryInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of EcrRepositoryInner if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the EcrRepositoryInner. + */ + public static EcrRepositoryInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + EcrRepositoryInner deserializedEcrRepositoryInner = new EcrRepositoryInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedEcrRepositoryInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedEcrRepositoryInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedEcrRepositoryInner.type = reader.getString(); + } else if ("location".equals(fieldName)) { + deserializedEcrRepositoryInner.withLocation(reader.getString()); + } else if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedEcrRepositoryInner.withTags(tags); + } else if ("properties".equals(fieldName)) { + deserializedEcrRepositoryInner.properties = EcrRepositoryProperties.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedEcrRepositoryInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedEcrRepositoryInner; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/models/EcsClusterInner.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/models/EcsClusterInner.java new file mode 100644 index 000000000000..2c690ab513cf --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/models/EcsClusterInner.java @@ -0,0 +1,192 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.Resource; +import com.azure.core.management.SystemData; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.awsconnector.models.EcsClusterProperties; +import java.io.IOException; +import java.util.Map; + +/** + * A Microsoft.AwsConnector resource. + */ +@Fluent +public final class EcsClusterInner extends Resource { + /* + * The resource-specific properties for this resource. + */ + private EcsClusterProperties properties; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + private SystemData systemData; + + /* + * The type of the resource. + */ + private String type; + + /* + * The name of the resource. + */ + private String name; + + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /** + * Creates an instance of EcsClusterInner class. + */ + public EcsClusterInner() { + } + + /** + * Get the properties property: The resource-specific properties for this resource. + * + * @return the properties value. + */ + public EcsClusterProperties properties() { + return this.properties; + } + + /** + * Set the properties property: The resource-specific properties for this resource. + * + * @param properties the properties value to set. + * @return the EcsClusterInner object itself. + */ + public EcsClusterInner withProperties(EcsClusterProperties properties) { + this.properties = properties; + return this; + } + + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * {@inheritDoc} + */ + @Override + public EcsClusterInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public EcsClusterInner withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (properties() != null) { + properties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("location", location()); + jsonWriter.writeMapField("tags", tags(), (writer, element) -> writer.writeString(element)); + jsonWriter.writeJsonField("properties", this.properties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of EcsClusterInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of EcsClusterInner if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the EcsClusterInner. + */ + public static EcsClusterInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + EcsClusterInner deserializedEcsClusterInner = new EcsClusterInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedEcsClusterInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedEcsClusterInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedEcsClusterInner.type = reader.getString(); + } else if ("location".equals(fieldName)) { + deserializedEcsClusterInner.withLocation(reader.getString()); + } else if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedEcsClusterInner.withTags(tags); + } else if ("properties".equals(fieldName)) { + deserializedEcsClusterInner.properties = EcsClusterProperties.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedEcsClusterInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedEcsClusterInner; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/models/EcsServiceInner.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/models/EcsServiceInner.java new file mode 100644 index 000000000000..a2dc8eb12d2d --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/models/EcsServiceInner.java @@ -0,0 +1,192 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.Resource; +import com.azure.core.management.SystemData; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.awsconnector.models.EcsServiceProperties; +import java.io.IOException; +import java.util.Map; + +/** + * A Microsoft.AwsConnector resource. + */ +@Fluent +public final class EcsServiceInner extends Resource { + /* + * The resource-specific properties for this resource. + */ + private EcsServiceProperties properties; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + private SystemData systemData; + + /* + * The type of the resource. + */ + private String type; + + /* + * The name of the resource. + */ + private String name; + + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /** + * Creates an instance of EcsServiceInner class. + */ + public EcsServiceInner() { + } + + /** + * Get the properties property: The resource-specific properties for this resource. + * + * @return the properties value. + */ + public EcsServiceProperties properties() { + return this.properties; + } + + /** + * Set the properties property: The resource-specific properties for this resource. + * + * @param properties the properties value to set. + * @return the EcsServiceInner object itself. + */ + public EcsServiceInner withProperties(EcsServiceProperties properties) { + this.properties = properties; + return this; + } + + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * {@inheritDoc} + */ + @Override + public EcsServiceInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public EcsServiceInner withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (properties() != null) { + properties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("location", location()); + jsonWriter.writeMapField("tags", tags(), (writer, element) -> writer.writeString(element)); + jsonWriter.writeJsonField("properties", this.properties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of EcsServiceInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of EcsServiceInner if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the EcsServiceInner. + */ + public static EcsServiceInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + EcsServiceInner deserializedEcsServiceInner = new EcsServiceInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedEcsServiceInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedEcsServiceInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedEcsServiceInner.type = reader.getString(); + } else if ("location".equals(fieldName)) { + deserializedEcsServiceInner.withLocation(reader.getString()); + } else if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedEcsServiceInner.withTags(tags); + } else if ("properties".equals(fieldName)) { + deserializedEcsServiceInner.properties = EcsServiceProperties.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedEcsServiceInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedEcsServiceInner; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/models/EcsTaskDefinitionInner.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/models/EcsTaskDefinitionInner.java new file mode 100644 index 000000000000..da5a0cae8ea2 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/models/EcsTaskDefinitionInner.java @@ -0,0 +1,192 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.Resource; +import com.azure.core.management.SystemData; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.awsconnector.models.EcsTaskDefinitionProperties; +import java.io.IOException; +import java.util.Map; + +/** + * A Microsoft.AwsConnector resource. + */ +@Fluent +public final class EcsTaskDefinitionInner extends Resource { + /* + * The resource-specific properties for this resource. + */ + private EcsTaskDefinitionProperties properties; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + private SystemData systemData; + + /* + * The type of the resource. + */ + private String type; + + /* + * The name of the resource. + */ + private String name; + + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /** + * Creates an instance of EcsTaskDefinitionInner class. + */ + public EcsTaskDefinitionInner() { + } + + /** + * Get the properties property: The resource-specific properties for this resource. + * + * @return the properties value. + */ + public EcsTaskDefinitionProperties properties() { + return this.properties; + } + + /** + * Set the properties property: The resource-specific properties for this resource. + * + * @param properties the properties value to set. + * @return the EcsTaskDefinitionInner object itself. + */ + public EcsTaskDefinitionInner withProperties(EcsTaskDefinitionProperties properties) { + this.properties = properties; + return this; + } + + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * {@inheritDoc} + */ + @Override + public EcsTaskDefinitionInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public EcsTaskDefinitionInner withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (properties() != null) { + properties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("location", location()); + jsonWriter.writeMapField("tags", tags(), (writer, element) -> writer.writeString(element)); + jsonWriter.writeJsonField("properties", this.properties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of EcsTaskDefinitionInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of EcsTaskDefinitionInner if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the EcsTaskDefinitionInner. + */ + public static EcsTaskDefinitionInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + EcsTaskDefinitionInner deserializedEcsTaskDefinitionInner = new EcsTaskDefinitionInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedEcsTaskDefinitionInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedEcsTaskDefinitionInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedEcsTaskDefinitionInner.type = reader.getString(); + } else if ("location".equals(fieldName)) { + deserializedEcsTaskDefinitionInner.withLocation(reader.getString()); + } else if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedEcsTaskDefinitionInner.withTags(tags); + } else if ("properties".equals(fieldName)) { + deserializedEcsTaskDefinitionInner.properties = EcsTaskDefinitionProperties.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedEcsTaskDefinitionInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedEcsTaskDefinitionInner; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/models/EfsFileSystemInner.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/models/EfsFileSystemInner.java new file mode 100644 index 000000000000..dbf5977d8f0e --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/models/EfsFileSystemInner.java @@ -0,0 +1,192 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.Resource; +import com.azure.core.management.SystemData; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.awsconnector.models.EfsFileSystemProperties; +import java.io.IOException; +import java.util.Map; + +/** + * A Microsoft.AwsConnector resource. + */ +@Fluent +public final class EfsFileSystemInner extends Resource { + /* + * The resource-specific properties for this resource. + */ + private EfsFileSystemProperties properties; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + private SystemData systemData; + + /* + * The type of the resource. + */ + private String type; + + /* + * The name of the resource. + */ + private String name; + + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /** + * Creates an instance of EfsFileSystemInner class. + */ + public EfsFileSystemInner() { + } + + /** + * Get the properties property: The resource-specific properties for this resource. + * + * @return the properties value. + */ + public EfsFileSystemProperties properties() { + return this.properties; + } + + /** + * Set the properties property: The resource-specific properties for this resource. + * + * @param properties the properties value to set. + * @return the EfsFileSystemInner object itself. + */ + public EfsFileSystemInner withProperties(EfsFileSystemProperties properties) { + this.properties = properties; + return this; + } + + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * {@inheritDoc} + */ + @Override + public EfsFileSystemInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public EfsFileSystemInner withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (properties() != null) { + properties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("location", location()); + jsonWriter.writeMapField("tags", tags(), (writer, element) -> writer.writeString(element)); + jsonWriter.writeJsonField("properties", this.properties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of EfsFileSystemInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of EfsFileSystemInner if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the EfsFileSystemInner. + */ + public static EfsFileSystemInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + EfsFileSystemInner deserializedEfsFileSystemInner = new EfsFileSystemInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedEfsFileSystemInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedEfsFileSystemInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedEfsFileSystemInner.type = reader.getString(); + } else if ("location".equals(fieldName)) { + deserializedEfsFileSystemInner.withLocation(reader.getString()); + } else if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedEfsFileSystemInner.withTags(tags); + } else if ("properties".equals(fieldName)) { + deserializedEfsFileSystemInner.properties = EfsFileSystemProperties.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedEfsFileSystemInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedEfsFileSystemInner; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/models/EfsMountTargetInner.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/models/EfsMountTargetInner.java new file mode 100644 index 000000000000..0ecebcbc35b0 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/models/EfsMountTargetInner.java @@ -0,0 +1,192 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.Resource; +import com.azure.core.management.SystemData; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.awsconnector.models.EfsMountTargetProperties; +import java.io.IOException; +import java.util.Map; + +/** + * A Microsoft.AwsConnector resource. + */ +@Fluent +public final class EfsMountTargetInner extends Resource { + /* + * The resource-specific properties for this resource. + */ + private EfsMountTargetProperties properties; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + private SystemData systemData; + + /* + * The type of the resource. + */ + private String type; + + /* + * The name of the resource. + */ + private String name; + + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /** + * Creates an instance of EfsMountTargetInner class. + */ + public EfsMountTargetInner() { + } + + /** + * Get the properties property: The resource-specific properties for this resource. + * + * @return the properties value. + */ + public EfsMountTargetProperties properties() { + return this.properties; + } + + /** + * Set the properties property: The resource-specific properties for this resource. + * + * @param properties the properties value to set. + * @return the EfsMountTargetInner object itself. + */ + public EfsMountTargetInner withProperties(EfsMountTargetProperties properties) { + this.properties = properties; + return this; + } + + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * {@inheritDoc} + */ + @Override + public EfsMountTargetInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public EfsMountTargetInner withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (properties() != null) { + properties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("location", location()); + jsonWriter.writeMapField("tags", tags(), (writer, element) -> writer.writeString(element)); + jsonWriter.writeJsonField("properties", this.properties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of EfsMountTargetInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of EfsMountTargetInner if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the EfsMountTargetInner. + */ + public static EfsMountTargetInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + EfsMountTargetInner deserializedEfsMountTargetInner = new EfsMountTargetInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedEfsMountTargetInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedEfsMountTargetInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedEfsMountTargetInner.type = reader.getString(); + } else if ("location".equals(fieldName)) { + deserializedEfsMountTargetInner.withLocation(reader.getString()); + } else if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedEfsMountTargetInner.withTags(tags); + } else if ("properties".equals(fieldName)) { + deserializedEfsMountTargetInner.properties = EfsMountTargetProperties.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedEfsMountTargetInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedEfsMountTargetInner; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/models/EksClusterInner.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/models/EksClusterInner.java new file mode 100644 index 000000000000..5b2bf62c65a2 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/models/EksClusterInner.java @@ -0,0 +1,166 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.ProxyResource; +import com.azure.core.management.SystemData; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.awsconnector.models.EksClusterProperties; +import java.io.IOException; + +/** + * A Microsoft.AwsConnector resource. + */ +@Fluent +public final class EksClusterInner extends ProxyResource { + /* + * The resource-specific properties for this resource. + */ + private EksClusterProperties properties; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + private SystemData systemData; + + /* + * The type of the resource. + */ + private String type; + + /* + * The name of the resource. + */ + private String name; + + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /** + * Creates an instance of EksClusterInner class. + */ + public EksClusterInner() { + } + + /** + * Get the properties property: The resource-specific properties for this resource. + * + * @return the properties value. + */ + public EksClusterProperties properties() { + return this.properties; + } + + /** + * Set the properties property: The resource-specific properties for this resource. + * + * @param properties the properties value to set. + * @return the EksClusterInner object itself. + */ + public EksClusterInner withProperties(EksClusterProperties properties) { + this.properties = properties; + return this; + } + + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (properties() != null) { + properties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("properties", this.properties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of EksClusterInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of EksClusterInner if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the EksClusterInner. + */ + public static EksClusterInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + EksClusterInner deserializedEksClusterInner = new EksClusterInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedEksClusterInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedEksClusterInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedEksClusterInner.type = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedEksClusterInner.properties = EksClusterProperties.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedEksClusterInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedEksClusterInner; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/models/EksNodegroupInner.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/models/EksNodegroupInner.java new file mode 100644 index 000000000000..35397f0c6832 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/models/EksNodegroupInner.java @@ -0,0 +1,192 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.Resource; +import com.azure.core.management.SystemData; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.awsconnector.models.EksNodegroupProperties; +import java.io.IOException; +import java.util.Map; + +/** + * A Microsoft.AwsConnector resource. + */ +@Fluent +public final class EksNodegroupInner extends Resource { + /* + * The resource-specific properties for this resource. + */ + private EksNodegroupProperties properties; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + private SystemData systemData; + + /* + * The type of the resource. + */ + private String type; + + /* + * The name of the resource. + */ + private String name; + + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /** + * Creates an instance of EksNodegroupInner class. + */ + public EksNodegroupInner() { + } + + /** + * Get the properties property: The resource-specific properties for this resource. + * + * @return the properties value. + */ + public EksNodegroupProperties properties() { + return this.properties; + } + + /** + * Set the properties property: The resource-specific properties for this resource. + * + * @param properties the properties value to set. + * @return the EksNodegroupInner object itself. + */ + public EksNodegroupInner withProperties(EksNodegroupProperties properties) { + this.properties = properties; + return this; + } + + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * {@inheritDoc} + */ + @Override + public EksNodegroupInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public EksNodegroupInner withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (properties() != null) { + properties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("location", location()); + jsonWriter.writeMapField("tags", tags(), (writer, element) -> writer.writeString(element)); + jsonWriter.writeJsonField("properties", this.properties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of EksNodegroupInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of EksNodegroupInner if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the EksNodegroupInner. + */ + public static EksNodegroupInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + EksNodegroupInner deserializedEksNodegroupInner = new EksNodegroupInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedEksNodegroupInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedEksNodegroupInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedEksNodegroupInner.type = reader.getString(); + } else if ("location".equals(fieldName)) { + deserializedEksNodegroupInner.withLocation(reader.getString()); + } else if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedEksNodegroupInner.withTags(tags); + } else if ("properties".equals(fieldName)) { + deserializedEksNodegroupInner.properties = EksNodegroupProperties.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedEksNodegroupInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedEksNodegroupInner; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/models/ElasticBeanstalkApplicationInner.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/models/ElasticBeanstalkApplicationInner.java new file mode 100644 index 000000000000..8a45d9d18afa --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/models/ElasticBeanstalkApplicationInner.java @@ -0,0 +1,194 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.Resource; +import com.azure.core.management.SystemData; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.awsconnector.models.ElasticBeanstalkApplicationProperties; +import java.io.IOException; +import java.util.Map; + +/** + * A Microsoft.AwsConnector resource. + */ +@Fluent +public final class ElasticBeanstalkApplicationInner extends Resource { + /* + * The resource-specific properties for this resource. + */ + private ElasticBeanstalkApplicationProperties properties; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + private SystemData systemData; + + /* + * The type of the resource. + */ + private String type; + + /* + * The name of the resource. + */ + private String name; + + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /** + * Creates an instance of ElasticBeanstalkApplicationInner class. + */ + public ElasticBeanstalkApplicationInner() { + } + + /** + * Get the properties property: The resource-specific properties for this resource. + * + * @return the properties value. + */ + public ElasticBeanstalkApplicationProperties properties() { + return this.properties; + } + + /** + * Set the properties property: The resource-specific properties for this resource. + * + * @param properties the properties value to set. + * @return the ElasticBeanstalkApplicationInner object itself. + */ + public ElasticBeanstalkApplicationInner withProperties(ElasticBeanstalkApplicationProperties properties) { + this.properties = properties; + return this; + } + + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * {@inheritDoc} + */ + @Override + public ElasticBeanstalkApplicationInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public ElasticBeanstalkApplicationInner withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (properties() != null) { + properties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("location", location()); + jsonWriter.writeMapField("tags", tags(), (writer, element) -> writer.writeString(element)); + jsonWriter.writeJsonField("properties", this.properties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ElasticBeanstalkApplicationInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ElasticBeanstalkApplicationInner if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the ElasticBeanstalkApplicationInner. + */ + public static ElasticBeanstalkApplicationInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ElasticBeanstalkApplicationInner deserializedElasticBeanstalkApplicationInner + = new ElasticBeanstalkApplicationInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedElasticBeanstalkApplicationInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedElasticBeanstalkApplicationInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedElasticBeanstalkApplicationInner.type = reader.getString(); + } else if ("location".equals(fieldName)) { + deserializedElasticBeanstalkApplicationInner.withLocation(reader.getString()); + } else if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedElasticBeanstalkApplicationInner.withTags(tags); + } else if ("properties".equals(fieldName)) { + deserializedElasticBeanstalkApplicationInner.properties + = ElasticBeanstalkApplicationProperties.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedElasticBeanstalkApplicationInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedElasticBeanstalkApplicationInner; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/models/ElasticBeanstalkConfigurationTemplateInner.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/models/ElasticBeanstalkConfigurationTemplateInner.java new file mode 100644 index 000000000000..12e64f82d85f --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/models/ElasticBeanstalkConfigurationTemplateInner.java @@ -0,0 +1,195 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.Resource; +import com.azure.core.management.SystemData; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.awsconnector.models.ElasticBeanstalkConfigurationTemplateProperties; +import java.io.IOException; +import java.util.Map; + +/** + * A Microsoft.AwsConnector resource. + */ +@Fluent +public final class ElasticBeanstalkConfigurationTemplateInner extends Resource { + /* + * The resource-specific properties for this resource. + */ + private ElasticBeanstalkConfigurationTemplateProperties properties; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + private SystemData systemData; + + /* + * The type of the resource. + */ + private String type; + + /* + * The name of the resource. + */ + private String name; + + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /** + * Creates an instance of ElasticBeanstalkConfigurationTemplateInner class. + */ + public ElasticBeanstalkConfigurationTemplateInner() { + } + + /** + * Get the properties property: The resource-specific properties for this resource. + * + * @return the properties value. + */ + public ElasticBeanstalkConfigurationTemplateProperties properties() { + return this.properties; + } + + /** + * Set the properties property: The resource-specific properties for this resource. + * + * @param properties the properties value to set. + * @return the ElasticBeanstalkConfigurationTemplateInner object itself. + */ + public ElasticBeanstalkConfigurationTemplateInner + withProperties(ElasticBeanstalkConfigurationTemplateProperties properties) { + this.properties = properties; + return this; + } + + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * {@inheritDoc} + */ + @Override + public ElasticBeanstalkConfigurationTemplateInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public ElasticBeanstalkConfigurationTemplateInner withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (properties() != null) { + properties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("location", location()); + jsonWriter.writeMapField("tags", tags(), (writer, element) -> writer.writeString(element)); + jsonWriter.writeJsonField("properties", this.properties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ElasticBeanstalkConfigurationTemplateInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ElasticBeanstalkConfigurationTemplateInner if the JsonReader was pointing to an instance + * of it, or null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the ElasticBeanstalkConfigurationTemplateInner. + */ + public static ElasticBeanstalkConfigurationTemplateInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ElasticBeanstalkConfigurationTemplateInner deserializedElasticBeanstalkConfigurationTemplateInner + = new ElasticBeanstalkConfigurationTemplateInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedElasticBeanstalkConfigurationTemplateInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedElasticBeanstalkConfigurationTemplateInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedElasticBeanstalkConfigurationTemplateInner.type = reader.getString(); + } else if ("location".equals(fieldName)) { + deserializedElasticBeanstalkConfigurationTemplateInner.withLocation(reader.getString()); + } else if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedElasticBeanstalkConfigurationTemplateInner.withTags(tags); + } else if ("properties".equals(fieldName)) { + deserializedElasticBeanstalkConfigurationTemplateInner.properties + = ElasticBeanstalkConfigurationTemplateProperties.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedElasticBeanstalkConfigurationTemplateInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedElasticBeanstalkConfigurationTemplateInner; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/models/ElasticBeanstalkEnvironmentInner.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/models/ElasticBeanstalkEnvironmentInner.java new file mode 100644 index 000000000000..7d32c3cbc0af --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/models/ElasticBeanstalkEnvironmentInner.java @@ -0,0 +1,194 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.Resource; +import com.azure.core.management.SystemData; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.awsconnector.models.ElasticBeanstalkEnvironmentProperties; +import java.io.IOException; +import java.util.Map; + +/** + * A Microsoft.AwsConnector resource. + */ +@Fluent +public final class ElasticBeanstalkEnvironmentInner extends Resource { + /* + * The resource-specific properties for this resource. + */ + private ElasticBeanstalkEnvironmentProperties properties; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + private SystemData systemData; + + /* + * The type of the resource. + */ + private String type; + + /* + * The name of the resource. + */ + private String name; + + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /** + * Creates an instance of ElasticBeanstalkEnvironmentInner class. + */ + public ElasticBeanstalkEnvironmentInner() { + } + + /** + * Get the properties property: The resource-specific properties for this resource. + * + * @return the properties value. + */ + public ElasticBeanstalkEnvironmentProperties properties() { + return this.properties; + } + + /** + * Set the properties property: The resource-specific properties for this resource. + * + * @param properties the properties value to set. + * @return the ElasticBeanstalkEnvironmentInner object itself. + */ + public ElasticBeanstalkEnvironmentInner withProperties(ElasticBeanstalkEnvironmentProperties properties) { + this.properties = properties; + return this; + } + + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * {@inheritDoc} + */ + @Override + public ElasticBeanstalkEnvironmentInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public ElasticBeanstalkEnvironmentInner withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (properties() != null) { + properties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("location", location()); + jsonWriter.writeMapField("tags", tags(), (writer, element) -> writer.writeString(element)); + jsonWriter.writeJsonField("properties", this.properties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ElasticBeanstalkEnvironmentInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ElasticBeanstalkEnvironmentInner if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the ElasticBeanstalkEnvironmentInner. + */ + public static ElasticBeanstalkEnvironmentInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ElasticBeanstalkEnvironmentInner deserializedElasticBeanstalkEnvironmentInner + = new ElasticBeanstalkEnvironmentInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedElasticBeanstalkEnvironmentInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedElasticBeanstalkEnvironmentInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedElasticBeanstalkEnvironmentInner.type = reader.getString(); + } else if ("location".equals(fieldName)) { + deserializedElasticBeanstalkEnvironmentInner.withLocation(reader.getString()); + } else if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedElasticBeanstalkEnvironmentInner.withTags(tags); + } else if ("properties".equals(fieldName)) { + deserializedElasticBeanstalkEnvironmentInner.properties + = ElasticBeanstalkEnvironmentProperties.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedElasticBeanstalkEnvironmentInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedElasticBeanstalkEnvironmentInner; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/models/ElasticLoadBalancingV2ListenerInner.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/models/ElasticLoadBalancingV2ListenerInner.java new file mode 100644 index 000000000000..31e12234f41e --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/models/ElasticLoadBalancingV2ListenerInner.java @@ -0,0 +1,194 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.Resource; +import com.azure.core.management.SystemData; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.awsconnector.models.ElasticLoadBalancingV2ListenerProperties; +import java.io.IOException; +import java.util.Map; + +/** + * A Microsoft.AwsConnector resource. + */ +@Fluent +public final class ElasticLoadBalancingV2ListenerInner extends Resource { + /* + * The resource-specific properties for this resource. + */ + private ElasticLoadBalancingV2ListenerProperties properties; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + private SystemData systemData; + + /* + * The type of the resource. + */ + private String type; + + /* + * The name of the resource. + */ + private String name; + + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /** + * Creates an instance of ElasticLoadBalancingV2ListenerInner class. + */ + public ElasticLoadBalancingV2ListenerInner() { + } + + /** + * Get the properties property: The resource-specific properties for this resource. + * + * @return the properties value. + */ + public ElasticLoadBalancingV2ListenerProperties properties() { + return this.properties; + } + + /** + * Set the properties property: The resource-specific properties for this resource. + * + * @param properties the properties value to set. + * @return the ElasticLoadBalancingV2ListenerInner object itself. + */ + public ElasticLoadBalancingV2ListenerInner withProperties(ElasticLoadBalancingV2ListenerProperties properties) { + this.properties = properties; + return this; + } + + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * {@inheritDoc} + */ + @Override + public ElasticLoadBalancingV2ListenerInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public ElasticLoadBalancingV2ListenerInner withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (properties() != null) { + properties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("location", location()); + jsonWriter.writeMapField("tags", tags(), (writer, element) -> writer.writeString(element)); + jsonWriter.writeJsonField("properties", this.properties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ElasticLoadBalancingV2ListenerInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ElasticLoadBalancingV2ListenerInner if the JsonReader was pointing to an instance of it, + * or null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the ElasticLoadBalancingV2ListenerInner. + */ + public static ElasticLoadBalancingV2ListenerInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ElasticLoadBalancingV2ListenerInner deserializedElasticLoadBalancingV2ListenerInner + = new ElasticLoadBalancingV2ListenerInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedElasticLoadBalancingV2ListenerInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedElasticLoadBalancingV2ListenerInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedElasticLoadBalancingV2ListenerInner.type = reader.getString(); + } else if ("location".equals(fieldName)) { + deserializedElasticLoadBalancingV2ListenerInner.withLocation(reader.getString()); + } else if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedElasticLoadBalancingV2ListenerInner.withTags(tags); + } else if ("properties".equals(fieldName)) { + deserializedElasticLoadBalancingV2ListenerInner.properties + = ElasticLoadBalancingV2ListenerProperties.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedElasticLoadBalancingV2ListenerInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedElasticLoadBalancingV2ListenerInner; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/models/ElasticLoadBalancingV2LoadBalancerInner.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/models/ElasticLoadBalancingV2LoadBalancerInner.java new file mode 100644 index 000000000000..5bf9050433d9 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/models/ElasticLoadBalancingV2LoadBalancerInner.java @@ -0,0 +1,195 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.Resource; +import com.azure.core.management.SystemData; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.awsconnector.models.ElasticLoadBalancingV2LoadBalancerProperties; +import java.io.IOException; +import java.util.Map; + +/** + * A Microsoft.AwsConnector resource. + */ +@Fluent +public final class ElasticLoadBalancingV2LoadBalancerInner extends Resource { + /* + * The resource-specific properties for this resource. + */ + private ElasticLoadBalancingV2LoadBalancerProperties properties; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + private SystemData systemData; + + /* + * The type of the resource. + */ + private String type; + + /* + * The name of the resource. + */ + private String name; + + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /** + * Creates an instance of ElasticLoadBalancingV2LoadBalancerInner class. + */ + public ElasticLoadBalancingV2LoadBalancerInner() { + } + + /** + * Get the properties property: The resource-specific properties for this resource. + * + * @return the properties value. + */ + public ElasticLoadBalancingV2LoadBalancerProperties properties() { + return this.properties; + } + + /** + * Set the properties property: The resource-specific properties for this resource. + * + * @param properties the properties value to set. + * @return the ElasticLoadBalancingV2LoadBalancerInner object itself. + */ + public ElasticLoadBalancingV2LoadBalancerInner + withProperties(ElasticLoadBalancingV2LoadBalancerProperties properties) { + this.properties = properties; + return this; + } + + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * {@inheritDoc} + */ + @Override + public ElasticLoadBalancingV2LoadBalancerInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public ElasticLoadBalancingV2LoadBalancerInner withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (properties() != null) { + properties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("location", location()); + jsonWriter.writeMapField("tags", tags(), (writer, element) -> writer.writeString(element)); + jsonWriter.writeJsonField("properties", this.properties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ElasticLoadBalancingV2LoadBalancerInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ElasticLoadBalancingV2LoadBalancerInner if the JsonReader was pointing to an instance of + * it, or null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the ElasticLoadBalancingV2LoadBalancerInner. + */ + public static ElasticLoadBalancingV2LoadBalancerInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ElasticLoadBalancingV2LoadBalancerInner deserializedElasticLoadBalancingV2LoadBalancerInner + = new ElasticLoadBalancingV2LoadBalancerInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedElasticLoadBalancingV2LoadBalancerInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedElasticLoadBalancingV2LoadBalancerInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedElasticLoadBalancingV2LoadBalancerInner.type = reader.getString(); + } else if ("location".equals(fieldName)) { + deserializedElasticLoadBalancingV2LoadBalancerInner.withLocation(reader.getString()); + } else if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedElasticLoadBalancingV2LoadBalancerInner.withTags(tags); + } else if ("properties".equals(fieldName)) { + deserializedElasticLoadBalancingV2LoadBalancerInner.properties + = ElasticLoadBalancingV2LoadBalancerProperties.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedElasticLoadBalancingV2LoadBalancerInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedElasticLoadBalancingV2LoadBalancerInner; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/models/ElasticLoadBalancingV2TargetGroupInner.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/models/ElasticLoadBalancingV2TargetGroupInner.java new file mode 100644 index 000000000000..f54ca7142a08 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/models/ElasticLoadBalancingV2TargetGroupInner.java @@ -0,0 +1,195 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.Resource; +import com.azure.core.management.SystemData; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.awsconnector.models.ElasticLoadBalancingV2TargetGroupProperties; +import java.io.IOException; +import java.util.Map; + +/** + * A Microsoft.AwsConnector resource. + */ +@Fluent +public final class ElasticLoadBalancingV2TargetGroupInner extends Resource { + /* + * The resource-specific properties for this resource. + */ + private ElasticLoadBalancingV2TargetGroupProperties properties; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + private SystemData systemData; + + /* + * The type of the resource. + */ + private String type; + + /* + * The name of the resource. + */ + private String name; + + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /** + * Creates an instance of ElasticLoadBalancingV2TargetGroupInner class. + */ + public ElasticLoadBalancingV2TargetGroupInner() { + } + + /** + * Get the properties property: The resource-specific properties for this resource. + * + * @return the properties value. + */ + public ElasticLoadBalancingV2TargetGroupProperties properties() { + return this.properties; + } + + /** + * Set the properties property: The resource-specific properties for this resource. + * + * @param properties the properties value to set. + * @return the ElasticLoadBalancingV2TargetGroupInner object itself. + */ + public ElasticLoadBalancingV2TargetGroupInner + withProperties(ElasticLoadBalancingV2TargetGroupProperties properties) { + this.properties = properties; + return this; + } + + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * {@inheritDoc} + */ + @Override + public ElasticLoadBalancingV2TargetGroupInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public ElasticLoadBalancingV2TargetGroupInner withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (properties() != null) { + properties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("location", location()); + jsonWriter.writeMapField("tags", tags(), (writer, element) -> writer.writeString(element)); + jsonWriter.writeJsonField("properties", this.properties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ElasticLoadBalancingV2TargetGroupInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ElasticLoadBalancingV2TargetGroupInner if the JsonReader was pointing to an instance of + * it, or null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the ElasticLoadBalancingV2TargetGroupInner. + */ + public static ElasticLoadBalancingV2TargetGroupInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ElasticLoadBalancingV2TargetGroupInner deserializedElasticLoadBalancingV2TargetGroupInner + = new ElasticLoadBalancingV2TargetGroupInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedElasticLoadBalancingV2TargetGroupInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedElasticLoadBalancingV2TargetGroupInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedElasticLoadBalancingV2TargetGroupInner.type = reader.getString(); + } else if ("location".equals(fieldName)) { + deserializedElasticLoadBalancingV2TargetGroupInner.withLocation(reader.getString()); + } else if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedElasticLoadBalancingV2TargetGroupInner.withTags(tags); + } else if ("properties".equals(fieldName)) { + deserializedElasticLoadBalancingV2TargetGroupInner.properties + = ElasticLoadBalancingV2TargetGroupProperties.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedElasticLoadBalancingV2TargetGroupInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedElasticLoadBalancingV2TargetGroupInner; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/models/ElasticLoadBalancingv2TargetHealthDescriptionInner.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/models/ElasticLoadBalancingv2TargetHealthDescriptionInner.java new file mode 100644 index 000000000000..3bd23af6f557 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/models/ElasticLoadBalancingv2TargetHealthDescriptionInner.java @@ -0,0 +1,197 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.Resource; +import com.azure.core.management.SystemData; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.awsconnector.models.ElasticLoadBalancingv2TargetHealthDescriptionProperties; +import java.io.IOException; +import java.util.Map; + +/** + * A Microsoft.AwsConnector resource. + */ +@Fluent +public final class ElasticLoadBalancingv2TargetHealthDescriptionInner extends Resource { + /* + * The resource-specific properties for this resource. + */ + private ElasticLoadBalancingv2TargetHealthDescriptionProperties properties; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + private SystemData systemData; + + /* + * The type of the resource. + */ + private String type; + + /* + * The name of the resource. + */ + private String name; + + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /** + * Creates an instance of ElasticLoadBalancingv2TargetHealthDescriptionInner class. + */ + public ElasticLoadBalancingv2TargetHealthDescriptionInner() { + } + + /** + * Get the properties property: The resource-specific properties for this resource. + * + * @return the properties value. + */ + public ElasticLoadBalancingv2TargetHealthDescriptionProperties properties() { + return this.properties; + } + + /** + * Set the properties property: The resource-specific properties for this resource. + * + * @param properties the properties value to set. + * @return the ElasticLoadBalancingv2TargetHealthDescriptionInner object itself. + */ + public ElasticLoadBalancingv2TargetHealthDescriptionInner + withProperties(ElasticLoadBalancingv2TargetHealthDescriptionProperties properties) { + this.properties = properties; + return this; + } + + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * {@inheritDoc} + */ + @Override + public ElasticLoadBalancingv2TargetHealthDescriptionInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public ElasticLoadBalancingv2TargetHealthDescriptionInner withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (properties() != null) { + properties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("location", location()); + jsonWriter.writeMapField("tags", tags(), (writer, element) -> writer.writeString(element)); + jsonWriter.writeJsonField("properties", this.properties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ElasticLoadBalancingv2TargetHealthDescriptionInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ElasticLoadBalancingv2TargetHealthDescriptionInner if the JsonReader was pointing to an + * instance of it, or null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the ElasticLoadBalancingv2TargetHealthDescriptionInner. + */ + public static ElasticLoadBalancingv2TargetHealthDescriptionInner fromJson(JsonReader jsonReader) + throws IOException { + return jsonReader.readObject(reader -> { + ElasticLoadBalancingv2TargetHealthDescriptionInner deserializedElasticLoadBalancingv2TargetHealthDescriptionInner + = new ElasticLoadBalancingv2TargetHealthDescriptionInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedElasticLoadBalancingv2TargetHealthDescriptionInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedElasticLoadBalancingv2TargetHealthDescriptionInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedElasticLoadBalancingv2TargetHealthDescriptionInner.type = reader.getString(); + } else if ("location".equals(fieldName)) { + deserializedElasticLoadBalancingv2TargetHealthDescriptionInner.withLocation(reader.getString()); + } else if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedElasticLoadBalancingv2TargetHealthDescriptionInner.withTags(tags); + } else if ("properties".equals(fieldName)) { + deserializedElasticLoadBalancingv2TargetHealthDescriptionInner.properties + = ElasticLoadBalancingv2TargetHealthDescriptionProperties.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedElasticLoadBalancingv2TargetHealthDescriptionInner.systemData + = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedElasticLoadBalancingv2TargetHealthDescriptionInner; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/models/EmrClusterInner.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/models/EmrClusterInner.java new file mode 100644 index 000000000000..b3681b87dbdc --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/models/EmrClusterInner.java @@ -0,0 +1,192 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.Resource; +import com.azure.core.management.SystemData; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.awsconnector.models.EmrClusterProperties; +import java.io.IOException; +import java.util.Map; + +/** + * A Microsoft.AwsConnector resource. + */ +@Fluent +public final class EmrClusterInner extends Resource { + /* + * The resource-specific properties for this resource. + */ + private EmrClusterProperties properties; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + private SystemData systemData; + + /* + * The type of the resource. + */ + private String type; + + /* + * The name of the resource. + */ + private String name; + + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /** + * Creates an instance of EmrClusterInner class. + */ + public EmrClusterInner() { + } + + /** + * Get the properties property: The resource-specific properties for this resource. + * + * @return the properties value. + */ + public EmrClusterProperties properties() { + return this.properties; + } + + /** + * Set the properties property: The resource-specific properties for this resource. + * + * @param properties the properties value to set. + * @return the EmrClusterInner object itself. + */ + public EmrClusterInner withProperties(EmrClusterProperties properties) { + this.properties = properties; + return this; + } + + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * {@inheritDoc} + */ + @Override + public EmrClusterInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public EmrClusterInner withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (properties() != null) { + properties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("location", location()); + jsonWriter.writeMapField("tags", tags(), (writer, element) -> writer.writeString(element)); + jsonWriter.writeJsonField("properties", this.properties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of EmrClusterInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of EmrClusterInner if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the EmrClusterInner. + */ + public static EmrClusterInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + EmrClusterInner deserializedEmrClusterInner = new EmrClusterInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedEmrClusterInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedEmrClusterInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedEmrClusterInner.type = reader.getString(); + } else if ("location".equals(fieldName)) { + deserializedEmrClusterInner.withLocation(reader.getString()); + } else if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedEmrClusterInner.withTags(tags); + } else if ("properties".equals(fieldName)) { + deserializedEmrClusterInner.properties = EmrClusterProperties.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedEmrClusterInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedEmrClusterInner; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/models/EmrClusterSummaryInner.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/models/EmrClusterSummaryInner.java new file mode 100644 index 000000000000..d1cf55a75cfd --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/models/EmrClusterSummaryInner.java @@ -0,0 +1,192 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.Resource; +import com.azure.core.management.SystemData; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.awsconnector.models.EmrClusterSummaryProperties; +import java.io.IOException; +import java.util.Map; + +/** + * A Microsoft.AwsConnector resource. + */ +@Fluent +public final class EmrClusterSummaryInner extends Resource { + /* + * The resource-specific properties for this resource. + */ + private EmrClusterSummaryProperties properties; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + private SystemData systemData; + + /* + * The type of the resource. + */ + private String type; + + /* + * The name of the resource. + */ + private String name; + + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /** + * Creates an instance of EmrClusterSummaryInner class. + */ + public EmrClusterSummaryInner() { + } + + /** + * Get the properties property: The resource-specific properties for this resource. + * + * @return the properties value. + */ + public EmrClusterSummaryProperties properties() { + return this.properties; + } + + /** + * Set the properties property: The resource-specific properties for this resource. + * + * @param properties the properties value to set. + * @return the EmrClusterSummaryInner object itself. + */ + public EmrClusterSummaryInner withProperties(EmrClusterSummaryProperties properties) { + this.properties = properties; + return this; + } + + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * {@inheritDoc} + */ + @Override + public EmrClusterSummaryInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public EmrClusterSummaryInner withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (properties() != null) { + properties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("location", location()); + jsonWriter.writeMapField("tags", tags(), (writer, element) -> writer.writeString(element)); + jsonWriter.writeJsonField("properties", this.properties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of EmrClusterSummaryInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of EmrClusterSummaryInner if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the EmrClusterSummaryInner. + */ + public static EmrClusterSummaryInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + EmrClusterSummaryInner deserializedEmrClusterSummaryInner = new EmrClusterSummaryInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedEmrClusterSummaryInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedEmrClusterSummaryInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedEmrClusterSummaryInner.type = reader.getString(); + } else if ("location".equals(fieldName)) { + deserializedEmrClusterSummaryInner.withLocation(reader.getString()); + } else if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedEmrClusterSummaryInner.withTags(tags); + } else if ("properties".equals(fieldName)) { + deserializedEmrClusterSummaryInner.properties = EmrClusterSummaryProperties.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedEmrClusterSummaryInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedEmrClusterSummaryInner; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/models/GuardDutyDetectorInner.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/models/GuardDutyDetectorInner.java new file mode 100644 index 000000000000..e020771782d2 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/models/GuardDutyDetectorInner.java @@ -0,0 +1,192 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.Resource; +import com.azure.core.management.SystemData; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.awsconnector.models.GuardDutyDetectorProperties; +import java.io.IOException; +import java.util.Map; + +/** + * A Microsoft.AwsConnector resource. + */ +@Fluent +public final class GuardDutyDetectorInner extends Resource { + /* + * The resource-specific properties for this resource. + */ + private GuardDutyDetectorProperties properties; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + private SystemData systemData; + + /* + * The type of the resource. + */ + private String type; + + /* + * The name of the resource. + */ + private String name; + + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /** + * Creates an instance of GuardDutyDetectorInner class. + */ + public GuardDutyDetectorInner() { + } + + /** + * Get the properties property: The resource-specific properties for this resource. + * + * @return the properties value. + */ + public GuardDutyDetectorProperties properties() { + return this.properties; + } + + /** + * Set the properties property: The resource-specific properties for this resource. + * + * @param properties the properties value to set. + * @return the GuardDutyDetectorInner object itself. + */ + public GuardDutyDetectorInner withProperties(GuardDutyDetectorProperties properties) { + this.properties = properties; + return this; + } + + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * {@inheritDoc} + */ + @Override + public GuardDutyDetectorInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public GuardDutyDetectorInner withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (properties() != null) { + properties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("location", location()); + jsonWriter.writeMapField("tags", tags(), (writer, element) -> writer.writeString(element)); + jsonWriter.writeJsonField("properties", this.properties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of GuardDutyDetectorInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of GuardDutyDetectorInner if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the GuardDutyDetectorInner. + */ + public static GuardDutyDetectorInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + GuardDutyDetectorInner deserializedGuardDutyDetectorInner = new GuardDutyDetectorInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedGuardDutyDetectorInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedGuardDutyDetectorInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedGuardDutyDetectorInner.type = reader.getString(); + } else if ("location".equals(fieldName)) { + deserializedGuardDutyDetectorInner.withLocation(reader.getString()); + } else if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedGuardDutyDetectorInner.withTags(tags); + } else if ("properties".equals(fieldName)) { + deserializedGuardDutyDetectorInner.properties = GuardDutyDetectorProperties.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedGuardDutyDetectorInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedGuardDutyDetectorInner; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/models/IamAccessKeyLastUsedInner.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/models/IamAccessKeyLastUsedInner.java new file mode 100644 index 000000000000..40ec1d0e0eb5 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/models/IamAccessKeyLastUsedInner.java @@ -0,0 +1,192 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.Resource; +import com.azure.core.management.SystemData; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.awsconnector.models.IamAccessKeyLastUsedProperties; +import java.io.IOException; +import java.util.Map; + +/** + * A Microsoft.AwsConnector resource. + */ +@Fluent +public final class IamAccessKeyLastUsedInner extends Resource { + /* + * The resource-specific properties for this resource. + */ + private IamAccessKeyLastUsedProperties properties; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + private SystemData systemData; + + /* + * The type of the resource. + */ + private String type; + + /* + * The name of the resource. + */ + private String name; + + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /** + * Creates an instance of IamAccessKeyLastUsedInner class. + */ + public IamAccessKeyLastUsedInner() { + } + + /** + * Get the properties property: The resource-specific properties for this resource. + * + * @return the properties value. + */ + public IamAccessKeyLastUsedProperties properties() { + return this.properties; + } + + /** + * Set the properties property: The resource-specific properties for this resource. + * + * @param properties the properties value to set. + * @return the IamAccessKeyLastUsedInner object itself. + */ + public IamAccessKeyLastUsedInner withProperties(IamAccessKeyLastUsedProperties properties) { + this.properties = properties; + return this; + } + + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * {@inheritDoc} + */ + @Override + public IamAccessKeyLastUsedInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public IamAccessKeyLastUsedInner withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (properties() != null) { + properties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("location", location()); + jsonWriter.writeMapField("tags", tags(), (writer, element) -> writer.writeString(element)); + jsonWriter.writeJsonField("properties", this.properties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of IamAccessKeyLastUsedInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of IamAccessKeyLastUsedInner if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the IamAccessKeyLastUsedInner. + */ + public static IamAccessKeyLastUsedInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + IamAccessKeyLastUsedInner deserializedIamAccessKeyLastUsedInner = new IamAccessKeyLastUsedInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedIamAccessKeyLastUsedInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedIamAccessKeyLastUsedInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedIamAccessKeyLastUsedInner.type = reader.getString(); + } else if ("location".equals(fieldName)) { + deserializedIamAccessKeyLastUsedInner.withLocation(reader.getString()); + } else if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedIamAccessKeyLastUsedInner.withTags(tags); + } else if ("properties".equals(fieldName)) { + deserializedIamAccessKeyLastUsedInner.properties = IamAccessKeyLastUsedProperties.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedIamAccessKeyLastUsedInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedIamAccessKeyLastUsedInner; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/models/IamAccessKeyMetadataInner.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/models/IamAccessKeyMetadataInner.java new file mode 100644 index 000000000000..6d86a1cb7e10 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/models/IamAccessKeyMetadataInner.java @@ -0,0 +1,192 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.Resource; +import com.azure.core.management.SystemData; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.awsconnector.models.IamAccessKeyMetadataProperties; +import java.io.IOException; +import java.util.Map; + +/** + * A Microsoft.AwsConnector resource. + */ +@Fluent +public final class IamAccessKeyMetadataInner extends Resource { + /* + * The resource-specific properties for this resource. + */ + private IamAccessKeyMetadataProperties properties; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + private SystemData systemData; + + /* + * The type of the resource. + */ + private String type; + + /* + * The name of the resource. + */ + private String name; + + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /** + * Creates an instance of IamAccessKeyMetadataInner class. + */ + public IamAccessKeyMetadataInner() { + } + + /** + * Get the properties property: The resource-specific properties for this resource. + * + * @return the properties value. + */ + public IamAccessKeyMetadataProperties properties() { + return this.properties; + } + + /** + * Set the properties property: The resource-specific properties for this resource. + * + * @param properties the properties value to set. + * @return the IamAccessKeyMetadataInner object itself. + */ + public IamAccessKeyMetadataInner withProperties(IamAccessKeyMetadataProperties properties) { + this.properties = properties; + return this; + } + + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * {@inheritDoc} + */ + @Override + public IamAccessKeyMetadataInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public IamAccessKeyMetadataInner withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (properties() != null) { + properties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("location", location()); + jsonWriter.writeMapField("tags", tags(), (writer, element) -> writer.writeString(element)); + jsonWriter.writeJsonField("properties", this.properties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of IamAccessKeyMetadataInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of IamAccessKeyMetadataInner if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the IamAccessKeyMetadataInner. + */ + public static IamAccessKeyMetadataInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + IamAccessKeyMetadataInner deserializedIamAccessKeyMetadataInner = new IamAccessKeyMetadataInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedIamAccessKeyMetadataInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedIamAccessKeyMetadataInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedIamAccessKeyMetadataInner.type = reader.getString(); + } else if ("location".equals(fieldName)) { + deserializedIamAccessKeyMetadataInner.withLocation(reader.getString()); + } else if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedIamAccessKeyMetadataInner.withTags(tags); + } else if ("properties".equals(fieldName)) { + deserializedIamAccessKeyMetadataInner.properties = IamAccessKeyMetadataProperties.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedIamAccessKeyMetadataInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedIamAccessKeyMetadataInner; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/models/IamGroupInner.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/models/IamGroupInner.java new file mode 100644 index 000000000000..6c084a7df239 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/models/IamGroupInner.java @@ -0,0 +1,192 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.Resource; +import com.azure.core.management.SystemData; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.awsconnector.models.IamGroupProperties; +import java.io.IOException; +import java.util.Map; + +/** + * A Microsoft.AwsConnector resource. + */ +@Fluent +public final class IamGroupInner extends Resource { + /* + * The resource-specific properties for this resource. + */ + private IamGroupProperties properties; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + private SystemData systemData; + + /* + * The type of the resource. + */ + private String type; + + /* + * The name of the resource. + */ + private String name; + + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /** + * Creates an instance of IamGroupInner class. + */ + public IamGroupInner() { + } + + /** + * Get the properties property: The resource-specific properties for this resource. + * + * @return the properties value. + */ + public IamGroupProperties properties() { + return this.properties; + } + + /** + * Set the properties property: The resource-specific properties for this resource. + * + * @param properties the properties value to set. + * @return the IamGroupInner object itself. + */ + public IamGroupInner withProperties(IamGroupProperties properties) { + this.properties = properties; + return this; + } + + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * {@inheritDoc} + */ + @Override + public IamGroupInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public IamGroupInner withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (properties() != null) { + properties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("location", location()); + jsonWriter.writeMapField("tags", tags(), (writer, element) -> writer.writeString(element)); + jsonWriter.writeJsonField("properties", this.properties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of IamGroupInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of IamGroupInner if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the IamGroupInner. + */ + public static IamGroupInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + IamGroupInner deserializedIamGroupInner = new IamGroupInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedIamGroupInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedIamGroupInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedIamGroupInner.type = reader.getString(); + } else if ("location".equals(fieldName)) { + deserializedIamGroupInner.withLocation(reader.getString()); + } else if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedIamGroupInner.withTags(tags); + } else if ("properties".equals(fieldName)) { + deserializedIamGroupInner.properties = IamGroupProperties.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedIamGroupInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedIamGroupInner; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/models/IamInstanceProfileAutoGeneratedInner.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/models/IamInstanceProfileAutoGeneratedInner.java new file mode 100644 index 000000000000..dc6138b33c39 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/models/IamInstanceProfileAutoGeneratedInner.java @@ -0,0 +1,194 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.Resource; +import com.azure.core.management.SystemData; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.awsconnector.models.IamInstanceProfileProperties; +import java.io.IOException; +import java.util.Map; + +/** + * A Microsoft.AwsConnector resource. + */ +@Fluent +public final class IamInstanceProfileAutoGeneratedInner extends Resource { + /* + * The resource-specific properties for this resource. + */ + private IamInstanceProfileProperties properties; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + private SystemData systemData; + + /* + * The type of the resource. + */ + private String type; + + /* + * The name of the resource. + */ + private String name; + + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /** + * Creates an instance of IamInstanceProfileAutoGeneratedInner class. + */ + public IamInstanceProfileAutoGeneratedInner() { + } + + /** + * Get the properties property: The resource-specific properties for this resource. + * + * @return the properties value. + */ + public IamInstanceProfileProperties properties() { + return this.properties; + } + + /** + * Set the properties property: The resource-specific properties for this resource. + * + * @param properties the properties value to set. + * @return the IamInstanceProfileAutoGeneratedInner object itself. + */ + public IamInstanceProfileAutoGeneratedInner withProperties(IamInstanceProfileProperties properties) { + this.properties = properties; + return this; + } + + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * {@inheritDoc} + */ + @Override + public IamInstanceProfileAutoGeneratedInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public IamInstanceProfileAutoGeneratedInner withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (properties() != null) { + properties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("location", location()); + jsonWriter.writeMapField("tags", tags(), (writer, element) -> writer.writeString(element)); + jsonWriter.writeJsonField("properties", this.properties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of IamInstanceProfileAutoGeneratedInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of IamInstanceProfileAutoGeneratedInner if the JsonReader was pointing to an instance of it, + * or null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the IamInstanceProfileAutoGeneratedInner. + */ + public static IamInstanceProfileAutoGeneratedInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + IamInstanceProfileAutoGeneratedInner deserializedIamInstanceProfileAutoGeneratedInner + = new IamInstanceProfileAutoGeneratedInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedIamInstanceProfileAutoGeneratedInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedIamInstanceProfileAutoGeneratedInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedIamInstanceProfileAutoGeneratedInner.type = reader.getString(); + } else if ("location".equals(fieldName)) { + deserializedIamInstanceProfileAutoGeneratedInner.withLocation(reader.getString()); + } else if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedIamInstanceProfileAutoGeneratedInner.withTags(tags); + } else if ("properties".equals(fieldName)) { + deserializedIamInstanceProfileAutoGeneratedInner.properties + = IamInstanceProfileProperties.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedIamInstanceProfileAutoGeneratedInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedIamInstanceProfileAutoGeneratedInner; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/models/IamMfaDeviceInner.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/models/IamMfaDeviceInner.java new file mode 100644 index 000000000000..2585b0699f02 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/models/IamMfaDeviceInner.java @@ -0,0 +1,192 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.Resource; +import com.azure.core.management.SystemData; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.awsconnector.models.IamMfaDeviceProperties; +import java.io.IOException; +import java.util.Map; + +/** + * A Microsoft.AwsConnector resource. + */ +@Fluent +public final class IamMfaDeviceInner extends Resource { + /* + * The resource-specific properties for this resource. + */ + private IamMfaDeviceProperties properties; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + private SystemData systemData; + + /* + * The type of the resource. + */ + private String type; + + /* + * The name of the resource. + */ + private String name; + + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /** + * Creates an instance of IamMfaDeviceInner class. + */ + public IamMfaDeviceInner() { + } + + /** + * Get the properties property: The resource-specific properties for this resource. + * + * @return the properties value. + */ + public IamMfaDeviceProperties properties() { + return this.properties; + } + + /** + * Set the properties property: The resource-specific properties for this resource. + * + * @param properties the properties value to set. + * @return the IamMfaDeviceInner object itself. + */ + public IamMfaDeviceInner withProperties(IamMfaDeviceProperties properties) { + this.properties = properties; + return this; + } + + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * {@inheritDoc} + */ + @Override + public IamMfaDeviceInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public IamMfaDeviceInner withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (properties() != null) { + properties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("location", location()); + jsonWriter.writeMapField("tags", tags(), (writer, element) -> writer.writeString(element)); + jsonWriter.writeJsonField("properties", this.properties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of IamMfaDeviceInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of IamMfaDeviceInner if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the IamMfaDeviceInner. + */ + public static IamMfaDeviceInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + IamMfaDeviceInner deserializedIamMfaDeviceInner = new IamMfaDeviceInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedIamMfaDeviceInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedIamMfaDeviceInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedIamMfaDeviceInner.type = reader.getString(); + } else if ("location".equals(fieldName)) { + deserializedIamMfaDeviceInner.withLocation(reader.getString()); + } else if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedIamMfaDeviceInner.withTags(tags); + } else if ("properties".equals(fieldName)) { + deserializedIamMfaDeviceInner.properties = IamMfaDeviceProperties.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedIamMfaDeviceInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedIamMfaDeviceInner; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/models/IamPasswordPolicyInner.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/models/IamPasswordPolicyInner.java new file mode 100644 index 000000000000..48921a0946e0 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/models/IamPasswordPolicyInner.java @@ -0,0 +1,192 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.Resource; +import com.azure.core.management.SystemData; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.awsconnector.models.IamPasswordPolicyProperties; +import java.io.IOException; +import java.util.Map; + +/** + * A Microsoft.AwsConnector resource. + */ +@Fluent +public final class IamPasswordPolicyInner extends Resource { + /* + * The resource-specific properties for this resource. + */ + private IamPasswordPolicyProperties properties; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + private SystemData systemData; + + /* + * The type of the resource. + */ + private String type; + + /* + * The name of the resource. + */ + private String name; + + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /** + * Creates an instance of IamPasswordPolicyInner class. + */ + public IamPasswordPolicyInner() { + } + + /** + * Get the properties property: The resource-specific properties for this resource. + * + * @return the properties value. + */ + public IamPasswordPolicyProperties properties() { + return this.properties; + } + + /** + * Set the properties property: The resource-specific properties for this resource. + * + * @param properties the properties value to set. + * @return the IamPasswordPolicyInner object itself. + */ + public IamPasswordPolicyInner withProperties(IamPasswordPolicyProperties properties) { + this.properties = properties; + return this; + } + + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * {@inheritDoc} + */ + @Override + public IamPasswordPolicyInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public IamPasswordPolicyInner withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (properties() != null) { + properties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("location", location()); + jsonWriter.writeMapField("tags", tags(), (writer, element) -> writer.writeString(element)); + jsonWriter.writeJsonField("properties", this.properties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of IamPasswordPolicyInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of IamPasswordPolicyInner if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the IamPasswordPolicyInner. + */ + public static IamPasswordPolicyInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + IamPasswordPolicyInner deserializedIamPasswordPolicyInner = new IamPasswordPolicyInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedIamPasswordPolicyInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedIamPasswordPolicyInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedIamPasswordPolicyInner.type = reader.getString(); + } else if ("location".equals(fieldName)) { + deserializedIamPasswordPolicyInner.withLocation(reader.getString()); + } else if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedIamPasswordPolicyInner.withTags(tags); + } else if ("properties".equals(fieldName)) { + deserializedIamPasswordPolicyInner.properties = IamPasswordPolicyProperties.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedIamPasswordPolicyInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedIamPasswordPolicyInner; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/models/IamPolicyVersionInner.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/models/IamPolicyVersionInner.java new file mode 100644 index 000000000000..74de224fce65 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/models/IamPolicyVersionInner.java @@ -0,0 +1,192 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.Resource; +import com.azure.core.management.SystemData; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.awsconnector.models.IamPolicyVersionProperties; +import java.io.IOException; +import java.util.Map; + +/** + * A Microsoft.AwsConnector resource. + */ +@Fluent +public final class IamPolicyVersionInner extends Resource { + /* + * The resource-specific properties for this resource. + */ + private IamPolicyVersionProperties properties; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + private SystemData systemData; + + /* + * The type of the resource. + */ + private String type; + + /* + * The name of the resource. + */ + private String name; + + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /** + * Creates an instance of IamPolicyVersionInner class. + */ + public IamPolicyVersionInner() { + } + + /** + * Get the properties property: The resource-specific properties for this resource. + * + * @return the properties value. + */ + public IamPolicyVersionProperties properties() { + return this.properties; + } + + /** + * Set the properties property: The resource-specific properties for this resource. + * + * @param properties the properties value to set. + * @return the IamPolicyVersionInner object itself. + */ + public IamPolicyVersionInner withProperties(IamPolicyVersionProperties properties) { + this.properties = properties; + return this; + } + + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * {@inheritDoc} + */ + @Override + public IamPolicyVersionInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public IamPolicyVersionInner withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (properties() != null) { + properties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("location", location()); + jsonWriter.writeMapField("tags", tags(), (writer, element) -> writer.writeString(element)); + jsonWriter.writeJsonField("properties", this.properties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of IamPolicyVersionInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of IamPolicyVersionInner if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the IamPolicyVersionInner. + */ + public static IamPolicyVersionInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + IamPolicyVersionInner deserializedIamPolicyVersionInner = new IamPolicyVersionInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedIamPolicyVersionInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedIamPolicyVersionInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedIamPolicyVersionInner.type = reader.getString(); + } else if ("location".equals(fieldName)) { + deserializedIamPolicyVersionInner.withLocation(reader.getString()); + } else if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedIamPolicyVersionInner.withTags(tags); + } else if ("properties".equals(fieldName)) { + deserializedIamPolicyVersionInner.properties = IamPolicyVersionProperties.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedIamPolicyVersionInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedIamPolicyVersionInner; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/models/IamRoleInner.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/models/IamRoleInner.java new file mode 100644 index 000000000000..e12f0ae9e5c9 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/models/IamRoleInner.java @@ -0,0 +1,192 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.Resource; +import com.azure.core.management.SystemData; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.awsconnector.models.IamRoleProperties; +import java.io.IOException; +import java.util.Map; + +/** + * A Microsoft.AwsConnector resource. + */ +@Fluent +public final class IamRoleInner extends Resource { + /* + * The resource-specific properties for this resource. + */ + private IamRoleProperties properties; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + private SystemData systemData; + + /* + * The type of the resource. + */ + private String type; + + /* + * The name of the resource. + */ + private String name; + + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /** + * Creates an instance of IamRoleInner class. + */ + public IamRoleInner() { + } + + /** + * Get the properties property: The resource-specific properties for this resource. + * + * @return the properties value. + */ + public IamRoleProperties properties() { + return this.properties; + } + + /** + * Set the properties property: The resource-specific properties for this resource. + * + * @param properties the properties value to set. + * @return the IamRoleInner object itself. + */ + public IamRoleInner withProperties(IamRoleProperties properties) { + this.properties = properties; + return this; + } + + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * {@inheritDoc} + */ + @Override + public IamRoleInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public IamRoleInner withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (properties() != null) { + properties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("location", location()); + jsonWriter.writeMapField("tags", tags(), (writer, element) -> writer.writeString(element)); + jsonWriter.writeJsonField("properties", this.properties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of IamRoleInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of IamRoleInner if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the IamRoleInner. + */ + public static IamRoleInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + IamRoleInner deserializedIamRoleInner = new IamRoleInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedIamRoleInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedIamRoleInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedIamRoleInner.type = reader.getString(); + } else if ("location".equals(fieldName)) { + deserializedIamRoleInner.withLocation(reader.getString()); + } else if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedIamRoleInner.withTags(tags); + } else if ("properties".equals(fieldName)) { + deserializedIamRoleInner.properties = IamRoleProperties.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedIamRoleInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedIamRoleInner; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/models/IamServerCertificateInner.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/models/IamServerCertificateInner.java new file mode 100644 index 000000000000..f07ca866b733 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/models/IamServerCertificateInner.java @@ -0,0 +1,192 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.Resource; +import com.azure.core.management.SystemData; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.awsconnector.models.IamServerCertificateProperties; +import java.io.IOException; +import java.util.Map; + +/** + * A Microsoft.AwsConnector resource. + */ +@Fluent +public final class IamServerCertificateInner extends Resource { + /* + * The resource-specific properties for this resource. + */ + private IamServerCertificateProperties properties; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + private SystemData systemData; + + /* + * The type of the resource. + */ + private String type; + + /* + * The name of the resource. + */ + private String name; + + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /** + * Creates an instance of IamServerCertificateInner class. + */ + public IamServerCertificateInner() { + } + + /** + * Get the properties property: The resource-specific properties for this resource. + * + * @return the properties value. + */ + public IamServerCertificateProperties properties() { + return this.properties; + } + + /** + * Set the properties property: The resource-specific properties for this resource. + * + * @param properties the properties value to set. + * @return the IamServerCertificateInner object itself. + */ + public IamServerCertificateInner withProperties(IamServerCertificateProperties properties) { + this.properties = properties; + return this; + } + + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * {@inheritDoc} + */ + @Override + public IamServerCertificateInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public IamServerCertificateInner withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (properties() != null) { + properties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("location", location()); + jsonWriter.writeMapField("tags", tags(), (writer, element) -> writer.writeString(element)); + jsonWriter.writeJsonField("properties", this.properties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of IamServerCertificateInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of IamServerCertificateInner if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the IamServerCertificateInner. + */ + public static IamServerCertificateInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + IamServerCertificateInner deserializedIamServerCertificateInner = new IamServerCertificateInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedIamServerCertificateInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedIamServerCertificateInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedIamServerCertificateInner.type = reader.getString(); + } else if ("location".equals(fieldName)) { + deserializedIamServerCertificateInner.withLocation(reader.getString()); + } else if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedIamServerCertificateInner.withTags(tags); + } else if ("properties".equals(fieldName)) { + deserializedIamServerCertificateInner.properties = IamServerCertificateProperties.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedIamServerCertificateInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedIamServerCertificateInner; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/models/IamVirtualMfaDeviceInner.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/models/IamVirtualMfaDeviceInner.java new file mode 100644 index 000000000000..552e71bba1fb --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/models/IamVirtualMfaDeviceInner.java @@ -0,0 +1,192 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.Resource; +import com.azure.core.management.SystemData; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.awsconnector.models.IamVirtualMfaDeviceProperties; +import java.io.IOException; +import java.util.Map; + +/** + * A Microsoft.AwsConnector resource. + */ +@Fluent +public final class IamVirtualMfaDeviceInner extends Resource { + /* + * The resource-specific properties for this resource. + */ + private IamVirtualMfaDeviceProperties properties; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + private SystemData systemData; + + /* + * The type of the resource. + */ + private String type; + + /* + * The name of the resource. + */ + private String name; + + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /** + * Creates an instance of IamVirtualMfaDeviceInner class. + */ + public IamVirtualMfaDeviceInner() { + } + + /** + * Get the properties property: The resource-specific properties for this resource. + * + * @return the properties value. + */ + public IamVirtualMfaDeviceProperties properties() { + return this.properties; + } + + /** + * Set the properties property: The resource-specific properties for this resource. + * + * @param properties the properties value to set. + * @return the IamVirtualMfaDeviceInner object itself. + */ + public IamVirtualMfaDeviceInner withProperties(IamVirtualMfaDeviceProperties properties) { + this.properties = properties; + return this; + } + + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * {@inheritDoc} + */ + @Override + public IamVirtualMfaDeviceInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public IamVirtualMfaDeviceInner withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (properties() != null) { + properties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("location", location()); + jsonWriter.writeMapField("tags", tags(), (writer, element) -> writer.writeString(element)); + jsonWriter.writeJsonField("properties", this.properties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of IamVirtualMfaDeviceInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of IamVirtualMfaDeviceInner if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the IamVirtualMfaDeviceInner. + */ + public static IamVirtualMfaDeviceInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + IamVirtualMfaDeviceInner deserializedIamVirtualMfaDeviceInner = new IamVirtualMfaDeviceInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedIamVirtualMfaDeviceInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedIamVirtualMfaDeviceInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedIamVirtualMfaDeviceInner.type = reader.getString(); + } else if ("location".equals(fieldName)) { + deserializedIamVirtualMfaDeviceInner.withLocation(reader.getString()); + } else if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedIamVirtualMfaDeviceInner.withTags(tags); + } else if ("properties".equals(fieldName)) { + deserializedIamVirtualMfaDeviceInner.properties = IamVirtualMfaDeviceProperties.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedIamVirtualMfaDeviceInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedIamVirtualMfaDeviceInner; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/models/KmsAliasInner.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/models/KmsAliasInner.java new file mode 100644 index 000000000000..01c277fa4250 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/models/KmsAliasInner.java @@ -0,0 +1,192 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.Resource; +import com.azure.core.management.SystemData; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.awsconnector.models.KmsAliasProperties; +import java.io.IOException; +import java.util.Map; + +/** + * A Microsoft.AwsConnector resource. + */ +@Fluent +public final class KmsAliasInner extends Resource { + /* + * The resource-specific properties for this resource. + */ + private KmsAliasProperties properties; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + private SystemData systemData; + + /* + * The type of the resource. + */ + private String type; + + /* + * The name of the resource. + */ + private String name; + + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /** + * Creates an instance of KmsAliasInner class. + */ + public KmsAliasInner() { + } + + /** + * Get the properties property: The resource-specific properties for this resource. + * + * @return the properties value. + */ + public KmsAliasProperties properties() { + return this.properties; + } + + /** + * Set the properties property: The resource-specific properties for this resource. + * + * @param properties the properties value to set. + * @return the KmsAliasInner object itself. + */ + public KmsAliasInner withProperties(KmsAliasProperties properties) { + this.properties = properties; + return this; + } + + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * {@inheritDoc} + */ + @Override + public KmsAliasInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public KmsAliasInner withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (properties() != null) { + properties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("location", location()); + jsonWriter.writeMapField("tags", tags(), (writer, element) -> writer.writeString(element)); + jsonWriter.writeJsonField("properties", this.properties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of KmsAliasInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of KmsAliasInner if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the KmsAliasInner. + */ + public static KmsAliasInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + KmsAliasInner deserializedKmsAliasInner = new KmsAliasInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedKmsAliasInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedKmsAliasInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedKmsAliasInner.type = reader.getString(); + } else if ("location".equals(fieldName)) { + deserializedKmsAliasInner.withLocation(reader.getString()); + } else if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedKmsAliasInner.withTags(tags); + } else if ("properties".equals(fieldName)) { + deserializedKmsAliasInner.properties = KmsAliasProperties.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedKmsAliasInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedKmsAliasInner; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/models/KmsKeyInner.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/models/KmsKeyInner.java new file mode 100644 index 000000000000..ff7de67368c8 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/models/KmsKeyInner.java @@ -0,0 +1,192 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.Resource; +import com.azure.core.management.SystemData; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.awsconnector.models.KmsKeyProperties; +import java.io.IOException; +import java.util.Map; + +/** + * A Microsoft.AwsConnector resource. + */ +@Fluent +public final class KmsKeyInner extends Resource { + /* + * The resource-specific properties for this resource. + */ + private KmsKeyProperties properties; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + private SystemData systemData; + + /* + * The type of the resource. + */ + private String type; + + /* + * The name of the resource. + */ + private String name; + + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /** + * Creates an instance of KmsKeyInner class. + */ + public KmsKeyInner() { + } + + /** + * Get the properties property: The resource-specific properties for this resource. + * + * @return the properties value. + */ + public KmsKeyProperties properties() { + return this.properties; + } + + /** + * Set the properties property: The resource-specific properties for this resource. + * + * @param properties the properties value to set. + * @return the KmsKeyInner object itself. + */ + public KmsKeyInner withProperties(KmsKeyProperties properties) { + this.properties = properties; + return this; + } + + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * {@inheritDoc} + */ + @Override + public KmsKeyInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public KmsKeyInner withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (properties() != null) { + properties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("location", location()); + jsonWriter.writeMapField("tags", tags(), (writer, element) -> writer.writeString(element)); + jsonWriter.writeJsonField("properties", this.properties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of KmsKeyInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of KmsKeyInner if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the KmsKeyInner. + */ + public static KmsKeyInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + KmsKeyInner deserializedKmsKeyInner = new KmsKeyInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedKmsKeyInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedKmsKeyInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedKmsKeyInner.type = reader.getString(); + } else if ("location".equals(fieldName)) { + deserializedKmsKeyInner.withLocation(reader.getString()); + } else if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedKmsKeyInner.withTags(tags); + } else if ("properties".equals(fieldName)) { + deserializedKmsKeyInner.properties = KmsKeyProperties.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedKmsKeyInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedKmsKeyInner; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/models/LambdaFunctionCodeLocationInner.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/models/LambdaFunctionCodeLocationInner.java new file mode 100644 index 000000000000..c1bf2e8e6de0 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/models/LambdaFunctionCodeLocationInner.java @@ -0,0 +1,194 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.Resource; +import com.azure.core.management.SystemData; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.awsconnector.models.LambdaFunctionCodeLocationProperties; +import java.io.IOException; +import java.util.Map; + +/** + * A Microsoft.AwsConnector resource. + */ +@Fluent +public final class LambdaFunctionCodeLocationInner extends Resource { + /* + * The resource-specific properties for this resource. + */ + private LambdaFunctionCodeLocationProperties properties; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + private SystemData systemData; + + /* + * The type of the resource. + */ + private String type; + + /* + * The name of the resource. + */ + private String name; + + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /** + * Creates an instance of LambdaFunctionCodeLocationInner class. + */ + public LambdaFunctionCodeLocationInner() { + } + + /** + * Get the properties property: The resource-specific properties for this resource. + * + * @return the properties value. + */ + public LambdaFunctionCodeLocationProperties properties() { + return this.properties; + } + + /** + * Set the properties property: The resource-specific properties for this resource. + * + * @param properties the properties value to set. + * @return the LambdaFunctionCodeLocationInner object itself. + */ + public LambdaFunctionCodeLocationInner withProperties(LambdaFunctionCodeLocationProperties properties) { + this.properties = properties; + return this; + } + + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * {@inheritDoc} + */ + @Override + public LambdaFunctionCodeLocationInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public LambdaFunctionCodeLocationInner withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (properties() != null) { + properties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("location", location()); + jsonWriter.writeMapField("tags", tags(), (writer, element) -> writer.writeString(element)); + jsonWriter.writeJsonField("properties", this.properties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of LambdaFunctionCodeLocationInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of LambdaFunctionCodeLocationInner if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the LambdaFunctionCodeLocationInner. + */ + public static LambdaFunctionCodeLocationInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + LambdaFunctionCodeLocationInner deserializedLambdaFunctionCodeLocationInner + = new LambdaFunctionCodeLocationInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedLambdaFunctionCodeLocationInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedLambdaFunctionCodeLocationInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedLambdaFunctionCodeLocationInner.type = reader.getString(); + } else if ("location".equals(fieldName)) { + deserializedLambdaFunctionCodeLocationInner.withLocation(reader.getString()); + } else if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedLambdaFunctionCodeLocationInner.withTags(tags); + } else if ("properties".equals(fieldName)) { + deserializedLambdaFunctionCodeLocationInner.properties + = LambdaFunctionCodeLocationProperties.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedLambdaFunctionCodeLocationInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedLambdaFunctionCodeLocationInner; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/models/LambdaFunctionInner.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/models/LambdaFunctionInner.java new file mode 100644 index 000000000000..3a4bbdaa36fc --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/models/LambdaFunctionInner.java @@ -0,0 +1,192 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.Resource; +import com.azure.core.management.SystemData; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.awsconnector.models.LambdaFunctionProperties; +import java.io.IOException; +import java.util.Map; + +/** + * A Microsoft.AwsConnector resource. + */ +@Fluent +public final class LambdaFunctionInner extends Resource { + /* + * The resource-specific properties for this resource. + */ + private LambdaFunctionProperties properties; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + private SystemData systemData; + + /* + * The type of the resource. + */ + private String type; + + /* + * The name of the resource. + */ + private String name; + + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /** + * Creates an instance of LambdaFunctionInner class. + */ + public LambdaFunctionInner() { + } + + /** + * Get the properties property: The resource-specific properties for this resource. + * + * @return the properties value. + */ + public LambdaFunctionProperties properties() { + return this.properties; + } + + /** + * Set the properties property: The resource-specific properties for this resource. + * + * @param properties the properties value to set. + * @return the LambdaFunctionInner object itself. + */ + public LambdaFunctionInner withProperties(LambdaFunctionProperties properties) { + this.properties = properties; + return this; + } + + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * {@inheritDoc} + */ + @Override + public LambdaFunctionInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public LambdaFunctionInner withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (properties() != null) { + properties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("location", location()); + jsonWriter.writeMapField("tags", tags(), (writer, element) -> writer.writeString(element)); + jsonWriter.writeJsonField("properties", this.properties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of LambdaFunctionInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of LambdaFunctionInner if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the LambdaFunctionInner. + */ + public static LambdaFunctionInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + LambdaFunctionInner deserializedLambdaFunctionInner = new LambdaFunctionInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedLambdaFunctionInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedLambdaFunctionInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedLambdaFunctionInner.type = reader.getString(); + } else if ("location".equals(fieldName)) { + deserializedLambdaFunctionInner.withLocation(reader.getString()); + } else if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedLambdaFunctionInner.withTags(tags); + } else if ("properties".equals(fieldName)) { + deserializedLambdaFunctionInner.properties = LambdaFunctionProperties.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedLambdaFunctionInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedLambdaFunctionInner; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/models/LightsailBucketInner.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/models/LightsailBucketInner.java new file mode 100644 index 000000000000..149997c646c0 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/models/LightsailBucketInner.java @@ -0,0 +1,192 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.Resource; +import com.azure.core.management.SystemData; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.awsconnector.models.LightsailBucketProperties; +import java.io.IOException; +import java.util.Map; + +/** + * A Microsoft.AwsConnector resource. + */ +@Fluent +public final class LightsailBucketInner extends Resource { + /* + * The resource-specific properties for this resource. + */ + private LightsailBucketProperties properties; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + private SystemData systemData; + + /* + * The type of the resource. + */ + private String type; + + /* + * The name of the resource. + */ + private String name; + + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /** + * Creates an instance of LightsailBucketInner class. + */ + public LightsailBucketInner() { + } + + /** + * Get the properties property: The resource-specific properties for this resource. + * + * @return the properties value. + */ + public LightsailBucketProperties properties() { + return this.properties; + } + + /** + * Set the properties property: The resource-specific properties for this resource. + * + * @param properties the properties value to set. + * @return the LightsailBucketInner object itself. + */ + public LightsailBucketInner withProperties(LightsailBucketProperties properties) { + this.properties = properties; + return this; + } + + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * {@inheritDoc} + */ + @Override + public LightsailBucketInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public LightsailBucketInner withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (properties() != null) { + properties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("location", location()); + jsonWriter.writeMapField("tags", tags(), (writer, element) -> writer.writeString(element)); + jsonWriter.writeJsonField("properties", this.properties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of LightsailBucketInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of LightsailBucketInner if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the LightsailBucketInner. + */ + public static LightsailBucketInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + LightsailBucketInner deserializedLightsailBucketInner = new LightsailBucketInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedLightsailBucketInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedLightsailBucketInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedLightsailBucketInner.type = reader.getString(); + } else if ("location".equals(fieldName)) { + deserializedLightsailBucketInner.withLocation(reader.getString()); + } else if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedLightsailBucketInner.withTags(tags); + } else if ("properties".equals(fieldName)) { + deserializedLightsailBucketInner.properties = LightsailBucketProperties.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedLightsailBucketInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedLightsailBucketInner; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/models/LightsailInstanceInner.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/models/LightsailInstanceInner.java new file mode 100644 index 000000000000..34f8bab475bc --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/models/LightsailInstanceInner.java @@ -0,0 +1,192 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.Resource; +import com.azure.core.management.SystemData; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.awsconnector.models.LightsailInstanceProperties; +import java.io.IOException; +import java.util.Map; + +/** + * A Microsoft.AwsConnector resource. + */ +@Fluent +public final class LightsailInstanceInner extends Resource { + /* + * The resource-specific properties for this resource. + */ + private LightsailInstanceProperties properties; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + private SystemData systemData; + + /* + * The type of the resource. + */ + private String type; + + /* + * The name of the resource. + */ + private String name; + + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /** + * Creates an instance of LightsailInstanceInner class. + */ + public LightsailInstanceInner() { + } + + /** + * Get the properties property: The resource-specific properties for this resource. + * + * @return the properties value. + */ + public LightsailInstanceProperties properties() { + return this.properties; + } + + /** + * Set the properties property: The resource-specific properties for this resource. + * + * @param properties the properties value to set. + * @return the LightsailInstanceInner object itself. + */ + public LightsailInstanceInner withProperties(LightsailInstanceProperties properties) { + this.properties = properties; + return this; + } + + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * {@inheritDoc} + */ + @Override + public LightsailInstanceInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public LightsailInstanceInner withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (properties() != null) { + properties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("location", location()); + jsonWriter.writeMapField("tags", tags(), (writer, element) -> writer.writeString(element)); + jsonWriter.writeJsonField("properties", this.properties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of LightsailInstanceInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of LightsailInstanceInner if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the LightsailInstanceInner. + */ + public static LightsailInstanceInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + LightsailInstanceInner deserializedLightsailInstanceInner = new LightsailInstanceInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedLightsailInstanceInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedLightsailInstanceInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedLightsailInstanceInner.type = reader.getString(); + } else if ("location".equals(fieldName)) { + deserializedLightsailInstanceInner.withLocation(reader.getString()); + } else if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedLightsailInstanceInner.withTags(tags); + } else if ("properties".equals(fieldName)) { + deserializedLightsailInstanceInner.properties = LightsailInstanceProperties.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedLightsailInstanceInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedLightsailInstanceInner; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/models/LogsLogGroupInner.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/models/LogsLogGroupInner.java new file mode 100644 index 000000000000..0e69d73f78fe --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/models/LogsLogGroupInner.java @@ -0,0 +1,192 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.Resource; +import com.azure.core.management.SystemData; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.awsconnector.models.LogsLogGroupProperties; +import java.io.IOException; +import java.util.Map; + +/** + * A Microsoft.AwsConnector resource. + */ +@Fluent +public final class LogsLogGroupInner extends Resource { + /* + * The resource-specific properties for this resource. + */ + private LogsLogGroupProperties properties; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + private SystemData systemData; + + /* + * The type of the resource. + */ + private String type; + + /* + * The name of the resource. + */ + private String name; + + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /** + * Creates an instance of LogsLogGroupInner class. + */ + public LogsLogGroupInner() { + } + + /** + * Get the properties property: The resource-specific properties for this resource. + * + * @return the properties value. + */ + public LogsLogGroupProperties properties() { + return this.properties; + } + + /** + * Set the properties property: The resource-specific properties for this resource. + * + * @param properties the properties value to set. + * @return the LogsLogGroupInner object itself. + */ + public LogsLogGroupInner withProperties(LogsLogGroupProperties properties) { + this.properties = properties; + return this; + } + + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * {@inheritDoc} + */ + @Override + public LogsLogGroupInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public LogsLogGroupInner withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (properties() != null) { + properties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("location", location()); + jsonWriter.writeMapField("tags", tags(), (writer, element) -> writer.writeString(element)); + jsonWriter.writeJsonField("properties", this.properties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of LogsLogGroupInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of LogsLogGroupInner if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the LogsLogGroupInner. + */ + public static LogsLogGroupInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + LogsLogGroupInner deserializedLogsLogGroupInner = new LogsLogGroupInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedLogsLogGroupInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedLogsLogGroupInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedLogsLogGroupInner.type = reader.getString(); + } else if ("location".equals(fieldName)) { + deserializedLogsLogGroupInner.withLocation(reader.getString()); + } else if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedLogsLogGroupInner.withTags(tags); + } else if ("properties".equals(fieldName)) { + deserializedLogsLogGroupInner.properties = LogsLogGroupProperties.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedLogsLogGroupInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedLogsLogGroupInner; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/models/LogsLogStreamInner.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/models/LogsLogStreamInner.java new file mode 100644 index 000000000000..084a7f0d63ea --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/models/LogsLogStreamInner.java @@ -0,0 +1,192 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.Resource; +import com.azure.core.management.SystemData; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.awsconnector.models.LogsLogStreamProperties; +import java.io.IOException; +import java.util.Map; + +/** + * A Microsoft.AwsConnector resource. + */ +@Fluent +public final class LogsLogStreamInner extends Resource { + /* + * The resource-specific properties for this resource. + */ + private LogsLogStreamProperties properties; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + private SystemData systemData; + + /* + * The type of the resource. + */ + private String type; + + /* + * The name of the resource. + */ + private String name; + + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /** + * Creates an instance of LogsLogStreamInner class. + */ + public LogsLogStreamInner() { + } + + /** + * Get the properties property: The resource-specific properties for this resource. + * + * @return the properties value. + */ + public LogsLogStreamProperties properties() { + return this.properties; + } + + /** + * Set the properties property: The resource-specific properties for this resource. + * + * @param properties the properties value to set. + * @return the LogsLogStreamInner object itself. + */ + public LogsLogStreamInner withProperties(LogsLogStreamProperties properties) { + this.properties = properties; + return this; + } + + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * {@inheritDoc} + */ + @Override + public LogsLogStreamInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public LogsLogStreamInner withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (properties() != null) { + properties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("location", location()); + jsonWriter.writeMapField("tags", tags(), (writer, element) -> writer.writeString(element)); + jsonWriter.writeJsonField("properties", this.properties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of LogsLogStreamInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of LogsLogStreamInner if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the LogsLogStreamInner. + */ + public static LogsLogStreamInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + LogsLogStreamInner deserializedLogsLogStreamInner = new LogsLogStreamInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedLogsLogStreamInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedLogsLogStreamInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedLogsLogStreamInner.type = reader.getString(); + } else if ("location".equals(fieldName)) { + deserializedLogsLogStreamInner.withLocation(reader.getString()); + } else if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedLogsLogStreamInner.withTags(tags); + } else if ("properties".equals(fieldName)) { + deserializedLogsLogStreamInner.properties = LogsLogStreamProperties.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedLogsLogStreamInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedLogsLogStreamInner; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/models/LogsMetricFilterInner.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/models/LogsMetricFilterInner.java new file mode 100644 index 000000000000..422a805c5696 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/models/LogsMetricFilterInner.java @@ -0,0 +1,192 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.Resource; +import com.azure.core.management.SystemData; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.awsconnector.models.LogsMetricFilterProperties; +import java.io.IOException; +import java.util.Map; + +/** + * A Microsoft.AwsConnector resource. + */ +@Fluent +public final class LogsMetricFilterInner extends Resource { + /* + * The resource-specific properties for this resource. + */ + private LogsMetricFilterProperties properties; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + private SystemData systemData; + + /* + * The type of the resource. + */ + private String type; + + /* + * The name of the resource. + */ + private String name; + + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /** + * Creates an instance of LogsMetricFilterInner class. + */ + public LogsMetricFilterInner() { + } + + /** + * Get the properties property: The resource-specific properties for this resource. + * + * @return the properties value. + */ + public LogsMetricFilterProperties properties() { + return this.properties; + } + + /** + * Set the properties property: The resource-specific properties for this resource. + * + * @param properties the properties value to set. + * @return the LogsMetricFilterInner object itself. + */ + public LogsMetricFilterInner withProperties(LogsMetricFilterProperties properties) { + this.properties = properties; + return this; + } + + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * {@inheritDoc} + */ + @Override + public LogsMetricFilterInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public LogsMetricFilterInner withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (properties() != null) { + properties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("location", location()); + jsonWriter.writeMapField("tags", tags(), (writer, element) -> writer.writeString(element)); + jsonWriter.writeJsonField("properties", this.properties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of LogsMetricFilterInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of LogsMetricFilterInner if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the LogsMetricFilterInner. + */ + public static LogsMetricFilterInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + LogsMetricFilterInner deserializedLogsMetricFilterInner = new LogsMetricFilterInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedLogsMetricFilterInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedLogsMetricFilterInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedLogsMetricFilterInner.type = reader.getString(); + } else if ("location".equals(fieldName)) { + deserializedLogsMetricFilterInner.withLocation(reader.getString()); + } else if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedLogsMetricFilterInner.withTags(tags); + } else if ("properties".equals(fieldName)) { + deserializedLogsMetricFilterInner.properties = LogsMetricFilterProperties.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedLogsMetricFilterInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedLogsMetricFilterInner; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/models/LogsSubscriptionFilterInner.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/models/LogsSubscriptionFilterInner.java new file mode 100644 index 000000000000..cb4fb5425800 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/models/LogsSubscriptionFilterInner.java @@ -0,0 +1,193 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.Resource; +import com.azure.core.management.SystemData; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.awsconnector.models.LogsSubscriptionFilterProperties; +import java.io.IOException; +import java.util.Map; + +/** + * A Microsoft.AwsConnector resource. + */ +@Fluent +public final class LogsSubscriptionFilterInner extends Resource { + /* + * The resource-specific properties for this resource. + */ + private LogsSubscriptionFilterProperties properties; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + private SystemData systemData; + + /* + * The type of the resource. + */ + private String type; + + /* + * The name of the resource. + */ + private String name; + + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /** + * Creates an instance of LogsSubscriptionFilterInner class. + */ + public LogsSubscriptionFilterInner() { + } + + /** + * Get the properties property: The resource-specific properties for this resource. + * + * @return the properties value. + */ + public LogsSubscriptionFilterProperties properties() { + return this.properties; + } + + /** + * Set the properties property: The resource-specific properties for this resource. + * + * @param properties the properties value to set. + * @return the LogsSubscriptionFilterInner object itself. + */ + public LogsSubscriptionFilterInner withProperties(LogsSubscriptionFilterProperties properties) { + this.properties = properties; + return this; + } + + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * {@inheritDoc} + */ + @Override + public LogsSubscriptionFilterInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public LogsSubscriptionFilterInner withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (properties() != null) { + properties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("location", location()); + jsonWriter.writeMapField("tags", tags(), (writer, element) -> writer.writeString(element)); + jsonWriter.writeJsonField("properties", this.properties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of LogsSubscriptionFilterInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of LogsSubscriptionFilterInner if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the LogsSubscriptionFilterInner. + */ + public static LogsSubscriptionFilterInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + LogsSubscriptionFilterInner deserializedLogsSubscriptionFilterInner = new LogsSubscriptionFilterInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedLogsSubscriptionFilterInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedLogsSubscriptionFilterInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedLogsSubscriptionFilterInner.type = reader.getString(); + } else if ("location".equals(fieldName)) { + deserializedLogsSubscriptionFilterInner.withLocation(reader.getString()); + } else if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedLogsSubscriptionFilterInner.withTags(tags); + } else if ("properties".equals(fieldName)) { + deserializedLogsSubscriptionFilterInner.properties + = LogsSubscriptionFilterProperties.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedLogsSubscriptionFilterInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedLogsSubscriptionFilterInner; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/models/Macie2JobSummaryInner.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/models/Macie2JobSummaryInner.java new file mode 100644 index 000000000000..520282d973f2 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/models/Macie2JobSummaryInner.java @@ -0,0 +1,192 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.Resource; +import com.azure.core.management.SystemData; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.awsconnector.models.Macie2JobSummaryProperties; +import java.io.IOException; +import java.util.Map; + +/** + * A Microsoft.AwsConnector resource. + */ +@Fluent +public final class Macie2JobSummaryInner extends Resource { + /* + * The resource-specific properties for this resource. + */ + private Macie2JobSummaryProperties properties; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + private SystemData systemData; + + /* + * The type of the resource. + */ + private String type; + + /* + * The name of the resource. + */ + private String name; + + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /** + * Creates an instance of Macie2JobSummaryInner class. + */ + public Macie2JobSummaryInner() { + } + + /** + * Get the properties property: The resource-specific properties for this resource. + * + * @return the properties value. + */ + public Macie2JobSummaryProperties properties() { + return this.properties; + } + + /** + * Set the properties property: The resource-specific properties for this resource. + * + * @param properties the properties value to set. + * @return the Macie2JobSummaryInner object itself. + */ + public Macie2JobSummaryInner withProperties(Macie2JobSummaryProperties properties) { + this.properties = properties; + return this; + } + + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * {@inheritDoc} + */ + @Override + public Macie2JobSummaryInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public Macie2JobSummaryInner withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (properties() != null) { + properties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("location", location()); + jsonWriter.writeMapField("tags", tags(), (writer, element) -> writer.writeString(element)); + jsonWriter.writeJsonField("properties", this.properties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of Macie2JobSummaryInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of Macie2JobSummaryInner if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the Macie2JobSummaryInner. + */ + public static Macie2JobSummaryInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + Macie2JobSummaryInner deserializedMacie2JobSummaryInner = new Macie2JobSummaryInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedMacie2JobSummaryInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedMacie2JobSummaryInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedMacie2JobSummaryInner.type = reader.getString(); + } else if ("location".equals(fieldName)) { + deserializedMacie2JobSummaryInner.withLocation(reader.getString()); + } else if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedMacie2JobSummaryInner.withTags(tags); + } else if ("properties".equals(fieldName)) { + deserializedMacie2JobSummaryInner.properties = Macie2JobSummaryProperties.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedMacie2JobSummaryInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedMacie2JobSummaryInner; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/models/MacieAllowListInner.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/models/MacieAllowListInner.java new file mode 100644 index 000000000000..62e5c1d664d0 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/models/MacieAllowListInner.java @@ -0,0 +1,192 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.Resource; +import com.azure.core.management.SystemData; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.awsconnector.models.MacieAllowListProperties; +import java.io.IOException; +import java.util.Map; + +/** + * A Microsoft.AwsConnector resource. + */ +@Fluent +public final class MacieAllowListInner extends Resource { + /* + * The resource-specific properties for this resource. + */ + private MacieAllowListProperties properties; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + private SystemData systemData; + + /* + * The type of the resource. + */ + private String type; + + /* + * The name of the resource. + */ + private String name; + + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /** + * Creates an instance of MacieAllowListInner class. + */ + public MacieAllowListInner() { + } + + /** + * Get the properties property: The resource-specific properties for this resource. + * + * @return the properties value. + */ + public MacieAllowListProperties properties() { + return this.properties; + } + + /** + * Set the properties property: The resource-specific properties for this resource. + * + * @param properties the properties value to set. + * @return the MacieAllowListInner object itself. + */ + public MacieAllowListInner withProperties(MacieAllowListProperties properties) { + this.properties = properties; + return this; + } + + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * {@inheritDoc} + */ + @Override + public MacieAllowListInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public MacieAllowListInner withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (properties() != null) { + properties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("location", location()); + jsonWriter.writeMapField("tags", tags(), (writer, element) -> writer.writeString(element)); + jsonWriter.writeJsonField("properties", this.properties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MacieAllowListInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MacieAllowListInner if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the MacieAllowListInner. + */ + public static MacieAllowListInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MacieAllowListInner deserializedMacieAllowListInner = new MacieAllowListInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedMacieAllowListInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedMacieAllowListInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedMacieAllowListInner.type = reader.getString(); + } else if ("location".equals(fieldName)) { + deserializedMacieAllowListInner.withLocation(reader.getString()); + } else if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedMacieAllowListInner.withTags(tags); + } else if ("properties".equals(fieldName)) { + deserializedMacieAllowListInner.properties = MacieAllowListProperties.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedMacieAllowListInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedMacieAllowListInner; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/models/NetworkFirewallInner.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/models/NetworkFirewallInner.java new file mode 100644 index 000000000000..83e831e8a5fe --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/models/NetworkFirewallInner.java @@ -0,0 +1,192 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.Resource; +import com.azure.core.management.SystemData; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.awsconnector.models.NetworkFirewallProperties; +import java.io.IOException; +import java.util.Map; + +/** + * A Microsoft.AwsConnector resource. + */ +@Fluent +public final class NetworkFirewallInner extends Resource { + /* + * The resource-specific properties for this resource. + */ + private NetworkFirewallProperties properties; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + private SystemData systemData; + + /* + * The type of the resource. + */ + private String type; + + /* + * The name of the resource. + */ + private String name; + + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /** + * Creates an instance of NetworkFirewallInner class. + */ + public NetworkFirewallInner() { + } + + /** + * Get the properties property: The resource-specific properties for this resource. + * + * @return the properties value. + */ + public NetworkFirewallProperties properties() { + return this.properties; + } + + /** + * Set the properties property: The resource-specific properties for this resource. + * + * @param properties the properties value to set. + * @return the NetworkFirewallInner object itself. + */ + public NetworkFirewallInner withProperties(NetworkFirewallProperties properties) { + this.properties = properties; + return this; + } + + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * {@inheritDoc} + */ + @Override + public NetworkFirewallInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public NetworkFirewallInner withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (properties() != null) { + properties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("location", location()); + jsonWriter.writeMapField("tags", tags(), (writer, element) -> writer.writeString(element)); + jsonWriter.writeJsonField("properties", this.properties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of NetworkFirewallInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of NetworkFirewallInner if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the NetworkFirewallInner. + */ + public static NetworkFirewallInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + NetworkFirewallInner deserializedNetworkFirewallInner = new NetworkFirewallInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedNetworkFirewallInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedNetworkFirewallInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedNetworkFirewallInner.type = reader.getString(); + } else if ("location".equals(fieldName)) { + deserializedNetworkFirewallInner.withLocation(reader.getString()); + } else if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedNetworkFirewallInner.withTags(tags); + } else if ("properties".equals(fieldName)) { + deserializedNetworkFirewallInner.properties = NetworkFirewallProperties.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedNetworkFirewallInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedNetworkFirewallInner; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/models/NetworkFirewallPolicyInner.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/models/NetworkFirewallPolicyInner.java new file mode 100644 index 000000000000..c23134b12c08 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/models/NetworkFirewallPolicyInner.java @@ -0,0 +1,193 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.Resource; +import com.azure.core.management.SystemData; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.awsconnector.models.NetworkFirewallPolicyProperties; +import java.io.IOException; +import java.util.Map; + +/** + * A Microsoft.AwsConnector resource. + */ +@Fluent +public final class NetworkFirewallPolicyInner extends Resource { + /* + * The resource-specific properties for this resource. + */ + private NetworkFirewallPolicyProperties properties; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + private SystemData systemData; + + /* + * The type of the resource. + */ + private String type; + + /* + * The name of the resource. + */ + private String name; + + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /** + * Creates an instance of NetworkFirewallPolicyInner class. + */ + public NetworkFirewallPolicyInner() { + } + + /** + * Get the properties property: The resource-specific properties for this resource. + * + * @return the properties value. + */ + public NetworkFirewallPolicyProperties properties() { + return this.properties; + } + + /** + * Set the properties property: The resource-specific properties for this resource. + * + * @param properties the properties value to set. + * @return the NetworkFirewallPolicyInner object itself. + */ + public NetworkFirewallPolicyInner withProperties(NetworkFirewallPolicyProperties properties) { + this.properties = properties; + return this; + } + + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * {@inheritDoc} + */ + @Override + public NetworkFirewallPolicyInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public NetworkFirewallPolicyInner withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (properties() != null) { + properties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("location", location()); + jsonWriter.writeMapField("tags", tags(), (writer, element) -> writer.writeString(element)); + jsonWriter.writeJsonField("properties", this.properties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of NetworkFirewallPolicyInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of NetworkFirewallPolicyInner if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the NetworkFirewallPolicyInner. + */ + public static NetworkFirewallPolicyInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + NetworkFirewallPolicyInner deserializedNetworkFirewallPolicyInner = new NetworkFirewallPolicyInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedNetworkFirewallPolicyInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedNetworkFirewallPolicyInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedNetworkFirewallPolicyInner.type = reader.getString(); + } else if ("location".equals(fieldName)) { + deserializedNetworkFirewallPolicyInner.withLocation(reader.getString()); + } else if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedNetworkFirewallPolicyInner.withTags(tags); + } else if ("properties".equals(fieldName)) { + deserializedNetworkFirewallPolicyInner.properties + = NetworkFirewallPolicyProperties.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedNetworkFirewallPolicyInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedNetworkFirewallPolicyInner; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/models/NetworkFirewallRuleGroupInner.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/models/NetworkFirewallRuleGroupInner.java new file mode 100644 index 000000000000..469a781c608f --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/models/NetworkFirewallRuleGroupInner.java @@ -0,0 +1,194 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.Resource; +import com.azure.core.management.SystemData; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.awsconnector.models.NetworkFirewallRuleGroupProperties; +import java.io.IOException; +import java.util.Map; + +/** + * A Microsoft.AwsConnector resource. + */ +@Fluent +public final class NetworkFirewallRuleGroupInner extends Resource { + /* + * The resource-specific properties for this resource. + */ + private NetworkFirewallRuleGroupProperties properties; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + private SystemData systemData; + + /* + * The type of the resource. + */ + private String type; + + /* + * The name of the resource. + */ + private String name; + + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /** + * Creates an instance of NetworkFirewallRuleGroupInner class. + */ + public NetworkFirewallRuleGroupInner() { + } + + /** + * Get the properties property: The resource-specific properties for this resource. + * + * @return the properties value. + */ + public NetworkFirewallRuleGroupProperties properties() { + return this.properties; + } + + /** + * Set the properties property: The resource-specific properties for this resource. + * + * @param properties the properties value to set. + * @return the NetworkFirewallRuleGroupInner object itself. + */ + public NetworkFirewallRuleGroupInner withProperties(NetworkFirewallRuleGroupProperties properties) { + this.properties = properties; + return this; + } + + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * {@inheritDoc} + */ + @Override + public NetworkFirewallRuleGroupInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public NetworkFirewallRuleGroupInner withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (properties() != null) { + properties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("location", location()); + jsonWriter.writeMapField("tags", tags(), (writer, element) -> writer.writeString(element)); + jsonWriter.writeJsonField("properties", this.properties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of NetworkFirewallRuleGroupInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of NetworkFirewallRuleGroupInner if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the NetworkFirewallRuleGroupInner. + */ + public static NetworkFirewallRuleGroupInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + NetworkFirewallRuleGroupInner deserializedNetworkFirewallRuleGroupInner + = new NetworkFirewallRuleGroupInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedNetworkFirewallRuleGroupInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedNetworkFirewallRuleGroupInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedNetworkFirewallRuleGroupInner.type = reader.getString(); + } else if ("location".equals(fieldName)) { + deserializedNetworkFirewallRuleGroupInner.withLocation(reader.getString()); + } else if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedNetworkFirewallRuleGroupInner.withTags(tags); + } else if ("properties".equals(fieldName)) { + deserializedNetworkFirewallRuleGroupInner.properties + = NetworkFirewallRuleGroupProperties.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedNetworkFirewallRuleGroupInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedNetworkFirewallRuleGroupInner; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/models/OpenSearchDomainStatusInner.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/models/OpenSearchDomainStatusInner.java new file mode 100644 index 000000000000..1ff887ecb038 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/models/OpenSearchDomainStatusInner.java @@ -0,0 +1,193 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.Resource; +import com.azure.core.management.SystemData; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.awsconnector.models.OpenSearchDomainStatusProperties; +import java.io.IOException; +import java.util.Map; + +/** + * A Microsoft.AwsConnector resource. + */ +@Fluent +public final class OpenSearchDomainStatusInner extends Resource { + /* + * The resource-specific properties for this resource. + */ + private OpenSearchDomainStatusProperties properties; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + private SystemData systemData; + + /* + * The type of the resource. + */ + private String type; + + /* + * The name of the resource. + */ + private String name; + + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /** + * Creates an instance of OpenSearchDomainStatusInner class. + */ + public OpenSearchDomainStatusInner() { + } + + /** + * Get the properties property: The resource-specific properties for this resource. + * + * @return the properties value. + */ + public OpenSearchDomainStatusProperties properties() { + return this.properties; + } + + /** + * Set the properties property: The resource-specific properties for this resource. + * + * @param properties the properties value to set. + * @return the OpenSearchDomainStatusInner object itself. + */ + public OpenSearchDomainStatusInner withProperties(OpenSearchDomainStatusProperties properties) { + this.properties = properties; + return this; + } + + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * {@inheritDoc} + */ + @Override + public OpenSearchDomainStatusInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public OpenSearchDomainStatusInner withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (properties() != null) { + properties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("location", location()); + jsonWriter.writeMapField("tags", tags(), (writer, element) -> writer.writeString(element)); + jsonWriter.writeJsonField("properties", this.properties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of OpenSearchDomainStatusInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of OpenSearchDomainStatusInner if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the OpenSearchDomainStatusInner. + */ + public static OpenSearchDomainStatusInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + OpenSearchDomainStatusInner deserializedOpenSearchDomainStatusInner = new OpenSearchDomainStatusInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedOpenSearchDomainStatusInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedOpenSearchDomainStatusInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedOpenSearchDomainStatusInner.type = reader.getString(); + } else if ("location".equals(fieldName)) { + deserializedOpenSearchDomainStatusInner.withLocation(reader.getString()); + } else if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedOpenSearchDomainStatusInner.withTags(tags); + } else if ("properties".equals(fieldName)) { + deserializedOpenSearchDomainStatusInner.properties + = OpenSearchDomainStatusProperties.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedOpenSearchDomainStatusInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedOpenSearchDomainStatusInner; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/models/OperationInner.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/models/OperationInner.java new file mode 100644 index 000000000000..925df672c963 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/models/OperationInner.java @@ -0,0 +1,172 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.awsconnector.models.ActionType; +import com.azure.resourcemanager.awsconnector.models.OperationDisplay; +import com.azure.resourcemanager.awsconnector.models.Origin; +import java.io.IOException; + +/** + * REST API Operation + * + * Details of a REST API operation, returned from the Resource Provider Operations API. + */ +@Fluent +public final class OperationInner implements JsonSerializable { + /* + * The name of the operation, as per Resource-Based Access Control (RBAC). Examples: + * "Microsoft.Compute/virtualMachines/write", "Microsoft.Compute/virtualMachines/capture/action" + */ + private String name; + + /* + * Whether the operation applies to data-plane. This is "true" for data-plane operations and "false" for + * ARM/control-plane operations. + */ + private Boolean isDataAction; + + /* + * Localized display information for this particular operation. + */ + private OperationDisplay display; + + /* + * The intended executor of the operation; as in Resource Based Access Control (RBAC) and audit logs UX. Default + * value is "user,system" + */ + private Origin origin; + + /* + * Enum. Indicates the action type. "Internal" refers to actions that are for internal only APIs. + */ + private ActionType actionType; + + /** + * Creates an instance of OperationInner class. + */ + public OperationInner() { + } + + /** + * Get the name property: The name of the operation, as per Resource-Based Access Control (RBAC). Examples: + * "Microsoft.Compute/virtualMachines/write", "Microsoft.Compute/virtualMachines/capture/action". + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Get the isDataAction property: Whether the operation applies to data-plane. This is "true" for data-plane + * operations and "false" for ARM/control-plane operations. + * + * @return the isDataAction value. + */ + public Boolean isDataAction() { + return this.isDataAction; + } + + /** + * Get the display property: Localized display information for this particular operation. + * + * @return the display value. + */ + public OperationDisplay display() { + return this.display; + } + + /** + * Set the display property: Localized display information for this particular operation. + * + * @param display the display value to set. + * @return the OperationInner object itself. + */ + public OperationInner withDisplay(OperationDisplay display) { + this.display = display; + return this; + } + + /** + * Get the origin property: The intended executor of the operation; as in Resource Based Access Control (RBAC) and + * audit logs UX. Default value is "user,system". + * + * @return the origin value. + */ + public Origin origin() { + return this.origin; + } + + /** + * Get the actionType property: Enum. Indicates the action type. "Internal" refers to actions that are for internal + * only APIs. + * + * @return the actionType value. + */ + public ActionType actionType() { + return this.actionType; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (display() != null) { + display().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("display", this.display); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of OperationInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of OperationInner if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the OperationInner. + */ + public static OperationInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + OperationInner deserializedOperationInner = new OperationInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("name".equals(fieldName)) { + deserializedOperationInner.name = reader.getString(); + } else if ("isDataAction".equals(fieldName)) { + deserializedOperationInner.isDataAction = reader.getNullable(JsonReader::getBoolean); + } else if ("display".equals(fieldName)) { + deserializedOperationInner.display = OperationDisplay.fromJson(reader); + } else if ("origin".equals(fieldName)) { + deserializedOperationInner.origin = Origin.fromString(reader.getString()); + } else if ("actionType".equals(fieldName)) { + deserializedOperationInner.actionType = ActionType.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedOperationInner; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/models/OperationStatusResultInner.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/models/OperationStatusResultInner.java new file mode 100644 index 000000000000..50b5523121dd --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/models/OperationStatusResultInner.java @@ -0,0 +1,329 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.exception.ManagementError; +import com.azure.core.util.CoreUtils; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.time.OffsetDateTime; +import java.time.format.DateTimeFormatter; +import java.util.List; + +/** + * The current status of an async operation. + */ +@Fluent +public final class OperationStatusResultInner implements JsonSerializable { + /* + * Fully qualified ID for the async operation. + */ + private String id; + + /* + * Fully qualified ID of the resource against which the original async operation was started. + */ + private String resourceId; + + /* + * Name of the async operation. + */ + private String name; + + /* + * Operation status. + */ + private String status; + + /* + * Percent of the operation that is complete. + */ + private Float percentComplete; + + /* + * The start time of the operation. + */ + private OffsetDateTime startTime; + + /* + * The end time of the operation. + */ + private OffsetDateTime endTime; + + /* + * The operations list. + */ + private List operations; + + /* + * If present, details of the operation error. + */ + private ManagementError error; + + /** + * Creates an instance of OperationStatusResultInner class. + */ + public OperationStatusResultInner() { + } + + /** + * Get the id property: Fully qualified ID for the async operation. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Set the id property: Fully qualified ID for the async operation. + * + * @param id the id value to set. + * @return the OperationStatusResultInner object itself. + */ + public OperationStatusResultInner withId(String id) { + this.id = id; + return this; + } + + /** + * Get the resourceId property: Fully qualified ID of the resource against which the original async operation was + * started. + * + * @return the resourceId value. + */ + public String resourceId() { + return this.resourceId; + } + + /** + * Get the name property: Name of the async operation. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: Name of the async operation. + * + * @param name the name value to set. + * @return the OperationStatusResultInner object itself. + */ + public OperationStatusResultInner withName(String name) { + this.name = name; + return this; + } + + /** + * Get the status property: Operation status. + * + * @return the status value. + */ + public String status() { + return this.status; + } + + /** + * Set the status property: Operation status. + * + * @param status the status value to set. + * @return the OperationStatusResultInner object itself. + */ + public OperationStatusResultInner withStatus(String status) { + this.status = status; + return this; + } + + /** + * Get the percentComplete property: Percent of the operation that is complete. + * + * @return the percentComplete value. + */ + public Float percentComplete() { + return this.percentComplete; + } + + /** + * Set the percentComplete property: Percent of the operation that is complete. + * + * @param percentComplete the percentComplete value to set. + * @return the OperationStatusResultInner object itself. + */ + public OperationStatusResultInner withPercentComplete(Float percentComplete) { + this.percentComplete = percentComplete; + return this; + } + + /** + * Get the startTime property: The start time of the operation. + * + * @return the startTime value. + */ + public OffsetDateTime startTime() { + return this.startTime; + } + + /** + * Set the startTime property: The start time of the operation. + * + * @param startTime the startTime value to set. + * @return the OperationStatusResultInner object itself. + */ + public OperationStatusResultInner withStartTime(OffsetDateTime startTime) { + this.startTime = startTime; + return this; + } + + /** + * Get the endTime property: The end time of the operation. + * + * @return the endTime value. + */ + public OffsetDateTime endTime() { + return this.endTime; + } + + /** + * Set the endTime property: The end time of the operation. + * + * @param endTime the endTime value to set. + * @return the OperationStatusResultInner object itself. + */ + public OperationStatusResultInner withEndTime(OffsetDateTime endTime) { + this.endTime = endTime; + return this; + } + + /** + * Get the operations property: The operations list. + * + * @return the operations value. + */ + public List operations() { + return this.operations; + } + + /** + * Set the operations property: The operations list. + * + * @param operations the operations value to set. + * @return the OperationStatusResultInner object itself. + */ + public OperationStatusResultInner withOperations(List operations) { + this.operations = operations; + return this; + } + + /** + * Get the error property: If present, details of the operation error. + * + * @return the error value. + */ + public ManagementError error() { + return this.error; + } + + /** + * Set the error property: If present, details of the operation error. + * + * @param error the error value to set. + * @return the OperationStatusResultInner object itself. + */ + public OperationStatusResultInner withError(ManagementError error) { + this.error = error; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (status() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property status in model OperationStatusResultInner")); + } + if (operations() != null) { + operations().forEach(e -> e.validate()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(OperationStatusResultInner.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("status", this.status); + jsonWriter.writeStringField("id", this.id); + jsonWriter.writeStringField("name", this.name); + jsonWriter.writeNumberField("percentComplete", this.percentComplete); + jsonWriter.writeStringField("startTime", + this.startTime == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.startTime)); + jsonWriter.writeStringField("endTime", + this.endTime == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.endTime)); + jsonWriter.writeArrayField("operations", this.operations, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeJsonField("error", this.error); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of OperationStatusResultInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of OperationStatusResultInner if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the OperationStatusResultInner. + */ + public static OperationStatusResultInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + OperationStatusResultInner deserializedOperationStatusResultInner = new OperationStatusResultInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("status".equals(fieldName)) { + deserializedOperationStatusResultInner.status = reader.getString(); + } else if ("id".equals(fieldName)) { + deserializedOperationStatusResultInner.id = reader.getString(); + } else if ("resourceId".equals(fieldName)) { + deserializedOperationStatusResultInner.resourceId = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedOperationStatusResultInner.name = reader.getString(); + } else if ("percentComplete".equals(fieldName)) { + deserializedOperationStatusResultInner.percentComplete = reader.getNullable(JsonReader::getFloat); + } else if ("startTime".equals(fieldName)) { + deserializedOperationStatusResultInner.startTime = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("endTime".equals(fieldName)) { + deserializedOperationStatusResultInner.endTime = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("operations".equals(fieldName)) { + List operations + = reader.readArray(reader1 -> OperationStatusResultInner.fromJson(reader1)); + deserializedOperationStatusResultInner.operations = operations; + } else if ("error".equals(fieldName)) { + deserializedOperationStatusResultInner.error = ManagementError.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedOperationStatusResultInner; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/models/OrganizationsAccountInner.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/models/OrganizationsAccountInner.java new file mode 100644 index 000000000000..a72b7452be69 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/models/OrganizationsAccountInner.java @@ -0,0 +1,192 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.Resource; +import com.azure.core.management.SystemData; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.awsconnector.models.OrganizationsAccountProperties; +import java.io.IOException; +import java.util.Map; + +/** + * A Microsoft.AwsConnector resource. + */ +@Fluent +public final class OrganizationsAccountInner extends Resource { + /* + * The resource-specific properties for this resource. + */ + private OrganizationsAccountProperties properties; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + private SystemData systemData; + + /* + * The type of the resource. + */ + private String type; + + /* + * The name of the resource. + */ + private String name; + + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /** + * Creates an instance of OrganizationsAccountInner class. + */ + public OrganizationsAccountInner() { + } + + /** + * Get the properties property: The resource-specific properties for this resource. + * + * @return the properties value. + */ + public OrganizationsAccountProperties properties() { + return this.properties; + } + + /** + * Set the properties property: The resource-specific properties for this resource. + * + * @param properties the properties value to set. + * @return the OrganizationsAccountInner object itself. + */ + public OrganizationsAccountInner withProperties(OrganizationsAccountProperties properties) { + this.properties = properties; + return this; + } + + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * {@inheritDoc} + */ + @Override + public OrganizationsAccountInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public OrganizationsAccountInner withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (properties() != null) { + properties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("location", location()); + jsonWriter.writeMapField("tags", tags(), (writer, element) -> writer.writeString(element)); + jsonWriter.writeJsonField("properties", this.properties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of OrganizationsAccountInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of OrganizationsAccountInner if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the OrganizationsAccountInner. + */ + public static OrganizationsAccountInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + OrganizationsAccountInner deserializedOrganizationsAccountInner = new OrganizationsAccountInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedOrganizationsAccountInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedOrganizationsAccountInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedOrganizationsAccountInner.type = reader.getString(); + } else if ("location".equals(fieldName)) { + deserializedOrganizationsAccountInner.withLocation(reader.getString()); + } else if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedOrganizationsAccountInner.withTags(tags); + } else if ("properties".equals(fieldName)) { + deserializedOrganizationsAccountInner.properties = OrganizationsAccountProperties.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedOrganizationsAccountInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedOrganizationsAccountInner; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/models/OrganizationsOrganizationInner.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/models/OrganizationsOrganizationInner.java new file mode 100644 index 000000000000..e13764b774f8 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/models/OrganizationsOrganizationInner.java @@ -0,0 +1,194 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.Resource; +import com.azure.core.management.SystemData; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.awsconnector.models.OrganizationsOrganizationProperties; +import java.io.IOException; +import java.util.Map; + +/** + * A Microsoft.AwsConnector resource. + */ +@Fluent +public final class OrganizationsOrganizationInner extends Resource { + /* + * The resource-specific properties for this resource. + */ + private OrganizationsOrganizationProperties properties; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + private SystemData systemData; + + /* + * The type of the resource. + */ + private String type; + + /* + * The name of the resource. + */ + private String name; + + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /** + * Creates an instance of OrganizationsOrganizationInner class. + */ + public OrganizationsOrganizationInner() { + } + + /** + * Get the properties property: The resource-specific properties for this resource. + * + * @return the properties value. + */ + public OrganizationsOrganizationProperties properties() { + return this.properties; + } + + /** + * Set the properties property: The resource-specific properties for this resource. + * + * @param properties the properties value to set. + * @return the OrganizationsOrganizationInner object itself. + */ + public OrganizationsOrganizationInner withProperties(OrganizationsOrganizationProperties properties) { + this.properties = properties; + return this; + } + + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * {@inheritDoc} + */ + @Override + public OrganizationsOrganizationInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public OrganizationsOrganizationInner withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (properties() != null) { + properties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("location", location()); + jsonWriter.writeMapField("tags", tags(), (writer, element) -> writer.writeString(element)); + jsonWriter.writeJsonField("properties", this.properties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of OrganizationsOrganizationInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of OrganizationsOrganizationInner if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the OrganizationsOrganizationInner. + */ + public static OrganizationsOrganizationInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + OrganizationsOrganizationInner deserializedOrganizationsOrganizationInner + = new OrganizationsOrganizationInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedOrganizationsOrganizationInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedOrganizationsOrganizationInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedOrganizationsOrganizationInner.type = reader.getString(); + } else if ("location".equals(fieldName)) { + deserializedOrganizationsOrganizationInner.withLocation(reader.getString()); + } else if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedOrganizationsOrganizationInner.withTags(tags); + } else if ("properties".equals(fieldName)) { + deserializedOrganizationsOrganizationInner.properties + = OrganizationsOrganizationProperties.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedOrganizationsOrganizationInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedOrganizationsOrganizationInner; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/models/RdsDBClusterInner.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/models/RdsDBClusterInner.java new file mode 100644 index 000000000000..f653ff10141e --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/models/RdsDBClusterInner.java @@ -0,0 +1,192 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.Resource; +import com.azure.core.management.SystemData; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.awsconnector.models.RdsDBClusterProperties; +import java.io.IOException; +import java.util.Map; + +/** + * A Microsoft.AwsConnector resource. + */ +@Fluent +public final class RdsDBClusterInner extends Resource { + /* + * The resource-specific properties for this resource. + */ + private RdsDBClusterProperties properties; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + private SystemData systemData; + + /* + * The type of the resource. + */ + private String type; + + /* + * The name of the resource. + */ + private String name; + + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /** + * Creates an instance of RdsDBClusterInner class. + */ + public RdsDBClusterInner() { + } + + /** + * Get the properties property: The resource-specific properties for this resource. + * + * @return the properties value. + */ + public RdsDBClusterProperties properties() { + return this.properties; + } + + /** + * Set the properties property: The resource-specific properties for this resource. + * + * @param properties the properties value to set. + * @return the RdsDBClusterInner object itself. + */ + public RdsDBClusterInner withProperties(RdsDBClusterProperties properties) { + this.properties = properties; + return this; + } + + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * {@inheritDoc} + */ + @Override + public RdsDBClusterInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public RdsDBClusterInner withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (properties() != null) { + properties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("location", location()); + jsonWriter.writeMapField("tags", tags(), (writer, element) -> writer.writeString(element)); + jsonWriter.writeJsonField("properties", this.properties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of RdsDBClusterInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of RdsDBClusterInner if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the RdsDBClusterInner. + */ + public static RdsDBClusterInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + RdsDBClusterInner deserializedRdsDBClusterInner = new RdsDBClusterInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedRdsDBClusterInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedRdsDBClusterInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedRdsDBClusterInner.type = reader.getString(); + } else if ("location".equals(fieldName)) { + deserializedRdsDBClusterInner.withLocation(reader.getString()); + } else if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedRdsDBClusterInner.withTags(tags); + } else if ("properties".equals(fieldName)) { + deserializedRdsDBClusterInner.properties = RdsDBClusterProperties.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedRdsDBClusterInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedRdsDBClusterInner; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/models/RdsDBInstanceInner.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/models/RdsDBInstanceInner.java new file mode 100644 index 000000000000..1b3238e0bf50 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/models/RdsDBInstanceInner.java @@ -0,0 +1,192 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.Resource; +import com.azure.core.management.SystemData; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.awsconnector.models.RdsDBInstanceProperties; +import java.io.IOException; +import java.util.Map; + +/** + * A Microsoft.AwsConnector resource. + */ +@Fluent +public final class RdsDBInstanceInner extends Resource { + /* + * The resource-specific properties for this resource. + */ + private RdsDBInstanceProperties properties; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + private SystemData systemData; + + /* + * The type of the resource. + */ + private String type; + + /* + * The name of the resource. + */ + private String name; + + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /** + * Creates an instance of RdsDBInstanceInner class. + */ + public RdsDBInstanceInner() { + } + + /** + * Get the properties property: The resource-specific properties for this resource. + * + * @return the properties value. + */ + public RdsDBInstanceProperties properties() { + return this.properties; + } + + /** + * Set the properties property: The resource-specific properties for this resource. + * + * @param properties the properties value to set. + * @return the RdsDBInstanceInner object itself. + */ + public RdsDBInstanceInner withProperties(RdsDBInstanceProperties properties) { + this.properties = properties; + return this; + } + + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * {@inheritDoc} + */ + @Override + public RdsDBInstanceInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public RdsDBInstanceInner withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (properties() != null) { + properties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("location", location()); + jsonWriter.writeMapField("tags", tags(), (writer, element) -> writer.writeString(element)); + jsonWriter.writeJsonField("properties", this.properties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of RdsDBInstanceInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of RdsDBInstanceInner if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the RdsDBInstanceInner. + */ + public static RdsDBInstanceInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + RdsDBInstanceInner deserializedRdsDBInstanceInner = new RdsDBInstanceInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedRdsDBInstanceInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedRdsDBInstanceInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedRdsDBInstanceInner.type = reader.getString(); + } else if ("location".equals(fieldName)) { + deserializedRdsDBInstanceInner.withLocation(reader.getString()); + } else if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedRdsDBInstanceInner.withTags(tags); + } else if ("properties".equals(fieldName)) { + deserializedRdsDBInstanceInner.properties = RdsDBInstanceProperties.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedRdsDBInstanceInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedRdsDBInstanceInner; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/models/RdsDBSnapshotAttributesResultInner.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/models/RdsDBSnapshotAttributesResultInner.java new file mode 100644 index 000000000000..429dc3dd259a --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/models/RdsDBSnapshotAttributesResultInner.java @@ -0,0 +1,194 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.Resource; +import com.azure.core.management.SystemData; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.awsconnector.models.RdsDBSnapshotAttributesResultProperties; +import java.io.IOException; +import java.util.Map; + +/** + * A Microsoft.AwsConnector resource. + */ +@Fluent +public final class RdsDBSnapshotAttributesResultInner extends Resource { + /* + * The resource-specific properties for this resource. + */ + private RdsDBSnapshotAttributesResultProperties properties; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + private SystemData systemData; + + /* + * The type of the resource. + */ + private String type; + + /* + * The name of the resource. + */ + private String name; + + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /** + * Creates an instance of RdsDBSnapshotAttributesResultInner class. + */ + public RdsDBSnapshotAttributesResultInner() { + } + + /** + * Get the properties property: The resource-specific properties for this resource. + * + * @return the properties value. + */ + public RdsDBSnapshotAttributesResultProperties properties() { + return this.properties; + } + + /** + * Set the properties property: The resource-specific properties for this resource. + * + * @param properties the properties value to set. + * @return the RdsDBSnapshotAttributesResultInner object itself. + */ + public RdsDBSnapshotAttributesResultInner withProperties(RdsDBSnapshotAttributesResultProperties properties) { + this.properties = properties; + return this; + } + + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * {@inheritDoc} + */ + @Override + public RdsDBSnapshotAttributesResultInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public RdsDBSnapshotAttributesResultInner withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (properties() != null) { + properties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("location", location()); + jsonWriter.writeMapField("tags", tags(), (writer, element) -> writer.writeString(element)); + jsonWriter.writeJsonField("properties", this.properties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of RdsDBSnapshotAttributesResultInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of RdsDBSnapshotAttributesResultInner if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the RdsDBSnapshotAttributesResultInner. + */ + public static RdsDBSnapshotAttributesResultInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + RdsDBSnapshotAttributesResultInner deserializedRdsDBSnapshotAttributesResultInner + = new RdsDBSnapshotAttributesResultInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedRdsDBSnapshotAttributesResultInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedRdsDBSnapshotAttributesResultInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedRdsDBSnapshotAttributesResultInner.type = reader.getString(); + } else if ("location".equals(fieldName)) { + deserializedRdsDBSnapshotAttributesResultInner.withLocation(reader.getString()); + } else if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedRdsDBSnapshotAttributesResultInner.withTags(tags); + } else if ("properties".equals(fieldName)) { + deserializedRdsDBSnapshotAttributesResultInner.properties + = RdsDBSnapshotAttributesResultProperties.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedRdsDBSnapshotAttributesResultInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedRdsDBSnapshotAttributesResultInner; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/models/RdsDBSnapshotInner.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/models/RdsDBSnapshotInner.java new file mode 100644 index 000000000000..8e202019b569 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/models/RdsDBSnapshotInner.java @@ -0,0 +1,192 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.Resource; +import com.azure.core.management.SystemData; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.awsconnector.models.RdsDBSnapshotProperties; +import java.io.IOException; +import java.util.Map; + +/** + * A Microsoft.AwsConnector resource. + */ +@Fluent +public final class RdsDBSnapshotInner extends Resource { + /* + * The resource-specific properties for this resource. + */ + private RdsDBSnapshotProperties properties; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + private SystemData systemData; + + /* + * The type of the resource. + */ + private String type; + + /* + * The name of the resource. + */ + private String name; + + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /** + * Creates an instance of RdsDBSnapshotInner class. + */ + public RdsDBSnapshotInner() { + } + + /** + * Get the properties property: The resource-specific properties for this resource. + * + * @return the properties value. + */ + public RdsDBSnapshotProperties properties() { + return this.properties; + } + + /** + * Set the properties property: The resource-specific properties for this resource. + * + * @param properties the properties value to set. + * @return the RdsDBSnapshotInner object itself. + */ + public RdsDBSnapshotInner withProperties(RdsDBSnapshotProperties properties) { + this.properties = properties; + return this; + } + + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * {@inheritDoc} + */ + @Override + public RdsDBSnapshotInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public RdsDBSnapshotInner withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (properties() != null) { + properties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("location", location()); + jsonWriter.writeMapField("tags", tags(), (writer, element) -> writer.writeString(element)); + jsonWriter.writeJsonField("properties", this.properties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of RdsDBSnapshotInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of RdsDBSnapshotInner if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the RdsDBSnapshotInner. + */ + public static RdsDBSnapshotInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + RdsDBSnapshotInner deserializedRdsDBSnapshotInner = new RdsDBSnapshotInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedRdsDBSnapshotInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedRdsDBSnapshotInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedRdsDBSnapshotInner.type = reader.getString(); + } else if ("location".equals(fieldName)) { + deserializedRdsDBSnapshotInner.withLocation(reader.getString()); + } else if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedRdsDBSnapshotInner.withTags(tags); + } else if ("properties".equals(fieldName)) { + deserializedRdsDBSnapshotInner.properties = RdsDBSnapshotProperties.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedRdsDBSnapshotInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedRdsDBSnapshotInner; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/models/RdsEventSubscriptionInner.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/models/RdsEventSubscriptionInner.java new file mode 100644 index 000000000000..fef3ced07a29 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/models/RdsEventSubscriptionInner.java @@ -0,0 +1,192 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.Resource; +import com.azure.core.management.SystemData; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.awsconnector.models.RdsEventSubscriptionProperties; +import java.io.IOException; +import java.util.Map; + +/** + * A Microsoft.AwsConnector resource. + */ +@Fluent +public final class RdsEventSubscriptionInner extends Resource { + /* + * The resource-specific properties for this resource. + */ + private RdsEventSubscriptionProperties properties; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + private SystemData systemData; + + /* + * The type of the resource. + */ + private String type; + + /* + * The name of the resource. + */ + private String name; + + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /** + * Creates an instance of RdsEventSubscriptionInner class. + */ + public RdsEventSubscriptionInner() { + } + + /** + * Get the properties property: The resource-specific properties for this resource. + * + * @return the properties value. + */ + public RdsEventSubscriptionProperties properties() { + return this.properties; + } + + /** + * Set the properties property: The resource-specific properties for this resource. + * + * @param properties the properties value to set. + * @return the RdsEventSubscriptionInner object itself. + */ + public RdsEventSubscriptionInner withProperties(RdsEventSubscriptionProperties properties) { + this.properties = properties; + return this; + } + + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * {@inheritDoc} + */ + @Override + public RdsEventSubscriptionInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public RdsEventSubscriptionInner withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (properties() != null) { + properties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("location", location()); + jsonWriter.writeMapField("tags", tags(), (writer, element) -> writer.writeString(element)); + jsonWriter.writeJsonField("properties", this.properties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of RdsEventSubscriptionInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of RdsEventSubscriptionInner if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the RdsEventSubscriptionInner. + */ + public static RdsEventSubscriptionInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + RdsEventSubscriptionInner deserializedRdsEventSubscriptionInner = new RdsEventSubscriptionInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedRdsEventSubscriptionInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedRdsEventSubscriptionInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedRdsEventSubscriptionInner.type = reader.getString(); + } else if ("location".equals(fieldName)) { + deserializedRdsEventSubscriptionInner.withLocation(reader.getString()); + } else if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedRdsEventSubscriptionInner.withTags(tags); + } else if ("properties".equals(fieldName)) { + deserializedRdsEventSubscriptionInner.properties = RdsEventSubscriptionProperties.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedRdsEventSubscriptionInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedRdsEventSubscriptionInner; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/models/RdsExportTaskInner.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/models/RdsExportTaskInner.java new file mode 100644 index 000000000000..dcf65b91fb30 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/models/RdsExportTaskInner.java @@ -0,0 +1,192 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.Resource; +import com.azure.core.management.SystemData; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.awsconnector.models.RdsExportTaskProperties; +import java.io.IOException; +import java.util.Map; + +/** + * A Microsoft.AwsConnector resource. + */ +@Fluent +public final class RdsExportTaskInner extends Resource { + /* + * The resource-specific properties for this resource. + */ + private RdsExportTaskProperties properties; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + private SystemData systemData; + + /* + * The type of the resource. + */ + private String type; + + /* + * The name of the resource. + */ + private String name; + + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /** + * Creates an instance of RdsExportTaskInner class. + */ + public RdsExportTaskInner() { + } + + /** + * Get the properties property: The resource-specific properties for this resource. + * + * @return the properties value. + */ + public RdsExportTaskProperties properties() { + return this.properties; + } + + /** + * Set the properties property: The resource-specific properties for this resource. + * + * @param properties the properties value to set. + * @return the RdsExportTaskInner object itself. + */ + public RdsExportTaskInner withProperties(RdsExportTaskProperties properties) { + this.properties = properties; + return this; + } + + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * {@inheritDoc} + */ + @Override + public RdsExportTaskInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public RdsExportTaskInner withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (properties() != null) { + properties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("location", location()); + jsonWriter.writeMapField("tags", tags(), (writer, element) -> writer.writeString(element)); + jsonWriter.writeJsonField("properties", this.properties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of RdsExportTaskInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of RdsExportTaskInner if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the RdsExportTaskInner. + */ + public static RdsExportTaskInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + RdsExportTaskInner deserializedRdsExportTaskInner = new RdsExportTaskInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedRdsExportTaskInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedRdsExportTaskInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedRdsExportTaskInner.type = reader.getString(); + } else if ("location".equals(fieldName)) { + deserializedRdsExportTaskInner.withLocation(reader.getString()); + } else if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedRdsExportTaskInner.withTags(tags); + } else if ("properties".equals(fieldName)) { + deserializedRdsExportTaskInner.properties = RdsExportTaskProperties.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedRdsExportTaskInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedRdsExportTaskInner; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/models/RedshiftClusterInner.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/models/RedshiftClusterInner.java new file mode 100644 index 000000000000..f0fd11d4b41d --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/models/RedshiftClusterInner.java @@ -0,0 +1,192 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.Resource; +import com.azure.core.management.SystemData; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.awsconnector.models.RedshiftClusterProperties; +import java.io.IOException; +import java.util.Map; + +/** + * A Microsoft.AwsConnector resource. + */ +@Fluent +public final class RedshiftClusterInner extends Resource { + /* + * The resource-specific properties for this resource. + */ + private RedshiftClusterProperties properties; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + private SystemData systemData; + + /* + * The type of the resource. + */ + private String type; + + /* + * The name of the resource. + */ + private String name; + + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /** + * Creates an instance of RedshiftClusterInner class. + */ + public RedshiftClusterInner() { + } + + /** + * Get the properties property: The resource-specific properties for this resource. + * + * @return the properties value. + */ + public RedshiftClusterProperties properties() { + return this.properties; + } + + /** + * Set the properties property: The resource-specific properties for this resource. + * + * @param properties the properties value to set. + * @return the RedshiftClusterInner object itself. + */ + public RedshiftClusterInner withProperties(RedshiftClusterProperties properties) { + this.properties = properties; + return this; + } + + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * {@inheritDoc} + */ + @Override + public RedshiftClusterInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public RedshiftClusterInner withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (properties() != null) { + properties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("location", location()); + jsonWriter.writeMapField("tags", tags(), (writer, element) -> writer.writeString(element)); + jsonWriter.writeJsonField("properties", this.properties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of RedshiftClusterInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of RedshiftClusterInner if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the RedshiftClusterInner. + */ + public static RedshiftClusterInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + RedshiftClusterInner deserializedRedshiftClusterInner = new RedshiftClusterInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedRedshiftClusterInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedRedshiftClusterInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedRedshiftClusterInner.type = reader.getString(); + } else if ("location".equals(fieldName)) { + deserializedRedshiftClusterInner.withLocation(reader.getString()); + } else if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedRedshiftClusterInner.withTags(tags); + } else if ("properties".equals(fieldName)) { + deserializedRedshiftClusterInner.properties = RedshiftClusterProperties.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedRedshiftClusterInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedRedshiftClusterInner; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/models/RedshiftClusterParameterGroupInner.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/models/RedshiftClusterParameterGroupInner.java new file mode 100644 index 000000000000..a7fde0a4ba85 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/models/RedshiftClusterParameterGroupInner.java @@ -0,0 +1,194 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.Resource; +import com.azure.core.management.SystemData; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.awsconnector.models.RedshiftClusterParameterGroupProperties; +import java.io.IOException; +import java.util.Map; + +/** + * A Microsoft.AwsConnector resource. + */ +@Fluent +public final class RedshiftClusterParameterGroupInner extends Resource { + /* + * The resource-specific properties for this resource. + */ + private RedshiftClusterParameterGroupProperties properties; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + private SystemData systemData; + + /* + * The type of the resource. + */ + private String type; + + /* + * The name of the resource. + */ + private String name; + + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /** + * Creates an instance of RedshiftClusterParameterGroupInner class. + */ + public RedshiftClusterParameterGroupInner() { + } + + /** + * Get the properties property: The resource-specific properties for this resource. + * + * @return the properties value. + */ + public RedshiftClusterParameterGroupProperties properties() { + return this.properties; + } + + /** + * Set the properties property: The resource-specific properties for this resource. + * + * @param properties the properties value to set. + * @return the RedshiftClusterParameterGroupInner object itself. + */ + public RedshiftClusterParameterGroupInner withProperties(RedshiftClusterParameterGroupProperties properties) { + this.properties = properties; + return this; + } + + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * {@inheritDoc} + */ + @Override + public RedshiftClusterParameterGroupInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public RedshiftClusterParameterGroupInner withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (properties() != null) { + properties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("location", location()); + jsonWriter.writeMapField("tags", tags(), (writer, element) -> writer.writeString(element)); + jsonWriter.writeJsonField("properties", this.properties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of RedshiftClusterParameterGroupInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of RedshiftClusterParameterGroupInner if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the RedshiftClusterParameterGroupInner. + */ + public static RedshiftClusterParameterGroupInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + RedshiftClusterParameterGroupInner deserializedRedshiftClusterParameterGroupInner + = new RedshiftClusterParameterGroupInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedRedshiftClusterParameterGroupInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedRedshiftClusterParameterGroupInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedRedshiftClusterParameterGroupInner.type = reader.getString(); + } else if ("location".equals(fieldName)) { + deserializedRedshiftClusterParameterGroupInner.withLocation(reader.getString()); + } else if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedRedshiftClusterParameterGroupInner.withTags(tags); + } else if ("properties".equals(fieldName)) { + deserializedRedshiftClusterParameterGroupInner.properties + = RedshiftClusterParameterGroupProperties.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedRedshiftClusterParameterGroupInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedRedshiftClusterParameterGroupInner; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/models/Route53DomainsDomainSummaryInner.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/models/Route53DomainsDomainSummaryInner.java new file mode 100644 index 000000000000..3b2161595b79 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/models/Route53DomainsDomainSummaryInner.java @@ -0,0 +1,194 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.Resource; +import com.azure.core.management.SystemData; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.awsconnector.models.Route53DomainsDomainSummaryProperties; +import java.io.IOException; +import java.util.Map; + +/** + * A Microsoft.AwsConnector resource. + */ +@Fluent +public final class Route53DomainsDomainSummaryInner extends Resource { + /* + * The resource-specific properties for this resource. + */ + private Route53DomainsDomainSummaryProperties properties; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + private SystemData systemData; + + /* + * The type of the resource. + */ + private String type; + + /* + * The name of the resource. + */ + private String name; + + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /** + * Creates an instance of Route53DomainsDomainSummaryInner class. + */ + public Route53DomainsDomainSummaryInner() { + } + + /** + * Get the properties property: The resource-specific properties for this resource. + * + * @return the properties value. + */ + public Route53DomainsDomainSummaryProperties properties() { + return this.properties; + } + + /** + * Set the properties property: The resource-specific properties for this resource. + * + * @param properties the properties value to set. + * @return the Route53DomainsDomainSummaryInner object itself. + */ + public Route53DomainsDomainSummaryInner withProperties(Route53DomainsDomainSummaryProperties properties) { + this.properties = properties; + return this; + } + + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * {@inheritDoc} + */ + @Override + public Route53DomainsDomainSummaryInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public Route53DomainsDomainSummaryInner withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (properties() != null) { + properties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("location", location()); + jsonWriter.writeMapField("tags", tags(), (writer, element) -> writer.writeString(element)); + jsonWriter.writeJsonField("properties", this.properties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of Route53DomainsDomainSummaryInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of Route53DomainsDomainSummaryInner if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the Route53DomainsDomainSummaryInner. + */ + public static Route53DomainsDomainSummaryInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + Route53DomainsDomainSummaryInner deserializedRoute53DomainsDomainSummaryInner + = new Route53DomainsDomainSummaryInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedRoute53DomainsDomainSummaryInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedRoute53DomainsDomainSummaryInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedRoute53DomainsDomainSummaryInner.type = reader.getString(); + } else if ("location".equals(fieldName)) { + deserializedRoute53DomainsDomainSummaryInner.withLocation(reader.getString()); + } else if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedRoute53DomainsDomainSummaryInner.withTags(tags); + } else if ("properties".equals(fieldName)) { + deserializedRoute53DomainsDomainSummaryInner.properties + = Route53DomainsDomainSummaryProperties.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedRoute53DomainsDomainSummaryInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedRoute53DomainsDomainSummaryInner; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/models/Route53HostedZoneInner.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/models/Route53HostedZoneInner.java new file mode 100644 index 000000000000..cccdae27f97f --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/models/Route53HostedZoneInner.java @@ -0,0 +1,192 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.Resource; +import com.azure.core.management.SystemData; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.awsconnector.models.Route53HostedZoneProperties; +import java.io.IOException; +import java.util.Map; + +/** + * A Microsoft.AwsConnector resource. + */ +@Fluent +public final class Route53HostedZoneInner extends Resource { + /* + * The resource-specific properties for this resource. + */ + private Route53HostedZoneProperties properties; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + private SystemData systemData; + + /* + * The type of the resource. + */ + private String type; + + /* + * The name of the resource. + */ + private String name; + + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /** + * Creates an instance of Route53HostedZoneInner class. + */ + public Route53HostedZoneInner() { + } + + /** + * Get the properties property: The resource-specific properties for this resource. + * + * @return the properties value. + */ + public Route53HostedZoneProperties properties() { + return this.properties; + } + + /** + * Set the properties property: The resource-specific properties for this resource. + * + * @param properties the properties value to set. + * @return the Route53HostedZoneInner object itself. + */ + public Route53HostedZoneInner withProperties(Route53HostedZoneProperties properties) { + this.properties = properties; + return this; + } + + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * {@inheritDoc} + */ + @Override + public Route53HostedZoneInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public Route53HostedZoneInner withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (properties() != null) { + properties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("location", location()); + jsonWriter.writeMapField("tags", tags(), (writer, element) -> writer.writeString(element)); + jsonWriter.writeJsonField("properties", this.properties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of Route53HostedZoneInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of Route53HostedZoneInner if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the Route53HostedZoneInner. + */ + public static Route53HostedZoneInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + Route53HostedZoneInner deserializedRoute53HostedZoneInner = new Route53HostedZoneInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedRoute53HostedZoneInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedRoute53HostedZoneInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedRoute53HostedZoneInner.type = reader.getString(); + } else if ("location".equals(fieldName)) { + deserializedRoute53HostedZoneInner.withLocation(reader.getString()); + } else if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedRoute53HostedZoneInner.withTags(tags); + } else if ("properties".equals(fieldName)) { + deserializedRoute53HostedZoneInner.properties = Route53HostedZoneProperties.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedRoute53HostedZoneInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedRoute53HostedZoneInner; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/models/Route53ResourceRecordSetInner.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/models/Route53ResourceRecordSetInner.java new file mode 100644 index 000000000000..3a1328e5744f --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/models/Route53ResourceRecordSetInner.java @@ -0,0 +1,194 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.Resource; +import com.azure.core.management.SystemData; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.awsconnector.models.Route53ResourceRecordSetProperties; +import java.io.IOException; +import java.util.Map; + +/** + * A Microsoft.AwsConnector resource. + */ +@Fluent +public final class Route53ResourceRecordSetInner extends Resource { + /* + * The resource-specific properties for this resource. + */ + private Route53ResourceRecordSetProperties properties; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + private SystemData systemData; + + /* + * The type of the resource. + */ + private String type; + + /* + * The name of the resource. + */ + private String name; + + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /** + * Creates an instance of Route53ResourceRecordSetInner class. + */ + public Route53ResourceRecordSetInner() { + } + + /** + * Get the properties property: The resource-specific properties for this resource. + * + * @return the properties value. + */ + public Route53ResourceRecordSetProperties properties() { + return this.properties; + } + + /** + * Set the properties property: The resource-specific properties for this resource. + * + * @param properties the properties value to set. + * @return the Route53ResourceRecordSetInner object itself. + */ + public Route53ResourceRecordSetInner withProperties(Route53ResourceRecordSetProperties properties) { + this.properties = properties; + return this; + } + + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * {@inheritDoc} + */ + @Override + public Route53ResourceRecordSetInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public Route53ResourceRecordSetInner withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (properties() != null) { + properties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("location", location()); + jsonWriter.writeMapField("tags", tags(), (writer, element) -> writer.writeString(element)); + jsonWriter.writeJsonField("properties", this.properties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of Route53ResourceRecordSetInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of Route53ResourceRecordSetInner if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the Route53ResourceRecordSetInner. + */ + public static Route53ResourceRecordSetInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + Route53ResourceRecordSetInner deserializedRoute53ResourceRecordSetInner + = new Route53ResourceRecordSetInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedRoute53ResourceRecordSetInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedRoute53ResourceRecordSetInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedRoute53ResourceRecordSetInner.type = reader.getString(); + } else if ("location".equals(fieldName)) { + deserializedRoute53ResourceRecordSetInner.withLocation(reader.getString()); + } else if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedRoute53ResourceRecordSetInner.withTags(tags); + } else if ("properties".equals(fieldName)) { + deserializedRoute53ResourceRecordSetInner.properties + = Route53ResourceRecordSetProperties.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedRoute53ResourceRecordSetInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedRoute53ResourceRecordSetInner; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/models/S3AccessPointInner.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/models/S3AccessPointInner.java new file mode 100644 index 000000000000..95f45bbab320 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/models/S3AccessPointInner.java @@ -0,0 +1,192 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.Resource; +import com.azure.core.management.SystemData; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.awsconnector.models.S3AccessPointProperties; +import java.io.IOException; +import java.util.Map; + +/** + * A Microsoft.AwsConnector resource. + */ +@Fluent +public final class S3AccessPointInner extends Resource { + /* + * The resource-specific properties for this resource. + */ + private S3AccessPointProperties properties; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + private SystemData systemData; + + /* + * The type of the resource. + */ + private String type; + + /* + * The name of the resource. + */ + private String name; + + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /** + * Creates an instance of S3AccessPointInner class. + */ + public S3AccessPointInner() { + } + + /** + * Get the properties property: The resource-specific properties for this resource. + * + * @return the properties value. + */ + public S3AccessPointProperties properties() { + return this.properties; + } + + /** + * Set the properties property: The resource-specific properties for this resource. + * + * @param properties the properties value to set. + * @return the S3AccessPointInner object itself. + */ + public S3AccessPointInner withProperties(S3AccessPointProperties properties) { + this.properties = properties; + return this; + } + + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * {@inheritDoc} + */ + @Override + public S3AccessPointInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public S3AccessPointInner withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (properties() != null) { + properties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("location", location()); + jsonWriter.writeMapField("tags", tags(), (writer, element) -> writer.writeString(element)); + jsonWriter.writeJsonField("properties", this.properties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of S3AccessPointInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of S3AccessPointInner if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the S3AccessPointInner. + */ + public static S3AccessPointInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + S3AccessPointInner deserializedS3AccessPointInner = new S3AccessPointInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedS3AccessPointInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedS3AccessPointInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedS3AccessPointInner.type = reader.getString(); + } else if ("location".equals(fieldName)) { + deserializedS3AccessPointInner.withLocation(reader.getString()); + } else if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedS3AccessPointInner.withTags(tags); + } else if ("properties".equals(fieldName)) { + deserializedS3AccessPointInner.properties = S3AccessPointProperties.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedS3AccessPointInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedS3AccessPointInner; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/models/S3BucketInner.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/models/S3BucketInner.java new file mode 100644 index 000000000000..18d978af5635 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/models/S3BucketInner.java @@ -0,0 +1,192 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.Resource; +import com.azure.core.management.SystemData; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.awsconnector.models.S3BucketProperties; +import java.io.IOException; +import java.util.Map; + +/** + * A Microsoft.AwsConnector resource. + */ +@Fluent +public final class S3BucketInner extends Resource { + /* + * The resource-specific properties for this resource. + */ + private S3BucketProperties properties; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + private SystemData systemData; + + /* + * The type of the resource. + */ + private String type; + + /* + * The name of the resource. + */ + private String name; + + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /** + * Creates an instance of S3BucketInner class. + */ + public S3BucketInner() { + } + + /** + * Get the properties property: The resource-specific properties for this resource. + * + * @return the properties value. + */ + public S3BucketProperties properties() { + return this.properties; + } + + /** + * Set the properties property: The resource-specific properties for this resource. + * + * @param properties the properties value to set. + * @return the S3BucketInner object itself. + */ + public S3BucketInner withProperties(S3BucketProperties properties) { + this.properties = properties; + return this; + } + + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * {@inheritDoc} + */ + @Override + public S3BucketInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public S3BucketInner withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (properties() != null) { + properties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("location", location()); + jsonWriter.writeMapField("tags", tags(), (writer, element) -> writer.writeString(element)); + jsonWriter.writeJsonField("properties", this.properties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of S3BucketInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of S3BucketInner if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the S3BucketInner. + */ + public static S3BucketInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + S3BucketInner deserializedS3BucketInner = new S3BucketInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedS3BucketInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedS3BucketInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedS3BucketInner.type = reader.getString(); + } else if ("location".equals(fieldName)) { + deserializedS3BucketInner.withLocation(reader.getString()); + } else if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedS3BucketInner.withTags(tags); + } else if ("properties".equals(fieldName)) { + deserializedS3BucketInner.properties = S3BucketProperties.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedS3BucketInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedS3BucketInner; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/models/S3BucketPolicyInner.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/models/S3BucketPolicyInner.java new file mode 100644 index 000000000000..10375e042f1b --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/models/S3BucketPolicyInner.java @@ -0,0 +1,192 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.Resource; +import com.azure.core.management.SystemData; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.awsconnector.models.S3BucketPolicyProperties; +import java.io.IOException; +import java.util.Map; + +/** + * A Microsoft.AwsConnector resource. + */ +@Fluent +public final class S3BucketPolicyInner extends Resource { + /* + * The resource-specific properties for this resource. + */ + private S3BucketPolicyProperties properties; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + private SystemData systemData; + + /* + * The type of the resource. + */ + private String type; + + /* + * The name of the resource. + */ + private String name; + + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /** + * Creates an instance of S3BucketPolicyInner class. + */ + public S3BucketPolicyInner() { + } + + /** + * Get the properties property: The resource-specific properties for this resource. + * + * @return the properties value. + */ + public S3BucketPolicyProperties properties() { + return this.properties; + } + + /** + * Set the properties property: The resource-specific properties for this resource. + * + * @param properties the properties value to set. + * @return the S3BucketPolicyInner object itself. + */ + public S3BucketPolicyInner withProperties(S3BucketPolicyProperties properties) { + this.properties = properties; + return this; + } + + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * {@inheritDoc} + */ + @Override + public S3BucketPolicyInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public S3BucketPolicyInner withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (properties() != null) { + properties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("location", location()); + jsonWriter.writeMapField("tags", tags(), (writer, element) -> writer.writeString(element)); + jsonWriter.writeJsonField("properties", this.properties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of S3BucketPolicyInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of S3BucketPolicyInner if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the S3BucketPolicyInner. + */ + public static S3BucketPolicyInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + S3BucketPolicyInner deserializedS3BucketPolicyInner = new S3BucketPolicyInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedS3BucketPolicyInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedS3BucketPolicyInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedS3BucketPolicyInner.type = reader.getString(); + } else if ("location".equals(fieldName)) { + deserializedS3BucketPolicyInner.withLocation(reader.getString()); + } else if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedS3BucketPolicyInner.withTags(tags); + } else if ("properties".equals(fieldName)) { + deserializedS3BucketPolicyInner.properties = S3BucketPolicyProperties.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedS3BucketPolicyInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedS3BucketPolicyInner; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/models/S3ControlMultiRegionAccessPointPolicyDocumentInner.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/models/S3ControlMultiRegionAccessPointPolicyDocumentInner.java new file mode 100644 index 000000000000..d93a80938cfc --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/models/S3ControlMultiRegionAccessPointPolicyDocumentInner.java @@ -0,0 +1,197 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.Resource; +import com.azure.core.management.SystemData; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.awsconnector.models.S3ControlMultiRegionAccessPointPolicyDocumentProperties; +import java.io.IOException; +import java.util.Map; + +/** + * A Microsoft.AwsConnector resource. + */ +@Fluent +public final class S3ControlMultiRegionAccessPointPolicyDocumentInner extends Resource { + /* + * The resource-specific properties for this resource. + */ + private S3ControlMultiRegionAccessPointPolicyDocumentProperties properties; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + private SystemData systemData; + + /* + * The type of the resource. + */ + private String type; + + /* + * The name of the resource. + */ + private String name; + + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /** + * Creates an instance of S3ControlMultiRegionAccessPointPolicyDocumentInner class. + */ + public S3ControlMultiRegionAccessPointPolicyDocumentInner() { + } + + /** + * Get the properties property: The resource-specific properties for this resource. + * + * @return the properties value. + */ + public S3ControlMultiRegionAccessPointPolicyDocumentProperties properties() { + return this.properties; + } + + /** + * Set the properties property: The resource-specific properties for this resource. + * + * @param properties the properties value to set. + * @return the S3ControlMultiRegionAccessPointPolicyDocumentInner object itself. + */ + public S3ControlMultiRegionAccessPointPolicyDocumentInner + withProperties(S3ControlMultiRegionAccessPointPolicyDocumentProperties properties) { + this.properties = properties; + return this; + } + + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * {@inheritDoc} + */ + @Override + public S3ControlMultiRegionAccessPointPolicyDocumentInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public S3ControlMultiRegionAccessPointPolicyDocumentInner withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (properties() != null) { + properties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("location", location()); + jsonWriter.writeMapField("tags", tags(), (writer, element) -> writer.writeString(element)); + jsonWriter.writeJsonField("properties", this.properties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of S3ControlMultiRegionAccessPointPolicyDocumentInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of S3ControlMultiRegionAccessPointPolicyDocumentInner if the JsonReader was pointing to an + * instance of it, or null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the S3ControlMultiRegionAccessPointPolicyDocumentInner. + */ + public static S3ControlMultiRegionAccessPointPolicyDocumentInner fromJson(JsonReader jsonReader) + throws IOException { + return jsonReader.readObject(reader -> { + S3ControlMultiRegionAccessPointPolicyDocumentInner deserializedS3ControlMultiRegionAccessPointPolicyDocumentInner + = new S3ControlMultiRegionAccessPointPolicyDocumentInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedS3ControlMultiRegionAccessPointPolicyDocumentInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedS3ControlMultiRegionAccessPointPolicyDocumentInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedS3ControlMultiRegionAccessPointPolicyDocumentInner.type = reader.getString(); + } else if ("location".equals(fieldName)) { + deserializedS3ControlMultiRegionAccessPointPolicyDocumentInner.withLocation(reader.getString()); + } else if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedS3ControlMultiRegionAccessPointPolicyDocumentInner.withTags(tags); + } else if ("properties".equals(fieldName)) { + deserializedS3ControlMultiRegionAccessPointPolicyDocumentInner.properties + = S3ControlMultiRegionAccessPointPolicyDocumentProperties.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedS3ControlMultiRegionAccessPointPolicyDocumentInner.systemData + = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedS3ControlMultiRegionAccessPointPolicyDocumentInner; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/models/SageMakerAppInner.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/models/SageMakerAppInner.java new file mode 100644 index 000000000000..2a2f94c7471a --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/models/SageMakerAppInner.java @@ -0,0 +1,192 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.Resource; +import com.azure.core.management.SystemData; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.awsconnector.models.SageMakerAppProperties; +import java.io.IOException; +import java.util.Map; + +/** + * A Microsoft.AwsConnector resource. + */ +@Fluent +public final class SageMakerAppInner extends Resource { + /* + * The resource-specific properties for this resource. + */ + private SageMakerAppProperties properties; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + private SystemData systemData; + + /* + * The type of the resource. + */ + private String type; + + /* + * The name of the resource. + */ + private String name; + + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /** + * Creates an instance of SageMakerAppInner class. + */ + public SageMakerAppInner() { + } + + /** + * Get the properties property: The resource-specific properties for this resource. + * + * @return the properties value. + */ + public SageMakerAppProperties properties() { + return this.properties; + } + + /** + * Set the properties property: The resource-specific properties for this resource. + * + * @param properties the properties value to set. + * @return the SageMakerAppInner object itself. + */ + public SageMakerAppInner withProperties(SageMakerAppProperties properties) { + this.properties = properties; + return this; + } + + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * {@inheritDoc} + */ + @Override + public SageMakerAppInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public SageMakerAppInner withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (properties() != null) { + properties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("location", location()); + jsonWriter.writeMapField("tags", tags(), (writer, element) -> writer.writeString(element)); + jsonWriter.writeJsonField("properties", this.properties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of SageMakerAppInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of SageMakerAppInner if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the SageMakerAppInner. + */ + public static SageMakerAppInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + SageMakerAppInner deserializedSageMakerAppInner = new SageMakerAppInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedSageMakerAppInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedSageMakerAppInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedSageMakerAppInner.type = reader.getString(); + } else if ("location".equals(fieldName)) { + deserializedSageMakerAppInner.withLocation(reader.getString()); + } else if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedSageMakerAppInner.withTags(tags); + } else if ("properties".equals(fieldName)) { + deserializedSageMakerAppInner.properties = SageMakerAppProperties.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedSageMakerAppInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedSageMakerAppInner; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/models/SageMakerNotebookInstanceSummaryInner.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/models/SageMakerNotebookInstanceSummaryInner.java new file mode 100644 index 000000000000..f0c397ff378e --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/models/SageMakerNotebookInstanceSummaryInner.java @@ -0,0 +1,194 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.Resource; +import com.azure.core.management.SystemData; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.awsconnector.models.SageMakerNotebookInstanceSummaryProperties; +import java.io.IOException; +import java.util.Map; + +/** + * A Microsoft.AwsConnector resource. + */ +@Fluent +public final class SageMakerNotebookInstanceSummaryInner extends Resource { + /* + * The resource-specific properties for this resource. + */ + private SageMakerNotebookInstanceSummaryProperties properties; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + private SystemData systemData; + + /* + * The type of the resource. + */ + private String type; + + /* + * The name of the resource. + */ + private String name; + + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /** + * Creates an instance of SageMakerNotebookInstanceSummaryInner class. + */ + public SageMakerNotebookInstanceSummaryInner() { + } + + /** + * Get the properties property: The resource-specific properties for this resource. + * + * @return the properties value. + */ + public SageMakerNotebookInstanceSummaryProperties properties() { + return this.properties; + } + + /** + * Set the properties property: The resource-specific properties for this resource. + * + * @param properties the properties value to set. + * @return the SageMakerNotebookInstanceSummaryInner object itself. + */ + public SageMakerNotebookInstanceSummaryInner withProperties(SageMakerNotebookInstanceSummaryProperties properties) { + this.properties = properties; + return this; + } + + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * {@inheritDoc} + */ + @Override + public SageMakerNotebookInstanceSummaryInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public SageMakerNotebookInstanceSummaryInner withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (properties() != null) { + properties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("location", location()); + jsonWriter.writeMapField("tags", tags(), (writer, element) -> writer.writeString(element)); + jsonWriter.writeJsonField("properties", this.properties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of SageMakerNotebookInstanceSummaryInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of SageMakerNotebookInstanceSummaryInner if the JsonReader was pointing to an instance of it, + * or null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the SageMakerNotebookInstanceSummaryInner. + */ + public static SageMakerNotebookInstanceSummaryInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + SageMakerNotebookInstanceSummaryInner deserializedSageMakerNotebookInstanceSummaryInner + = new SageMakerNotebookInstanceSummaryInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedSageMakerNotebookInstanceSummaryInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedSageMakerNotebookInstanceSummaryInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedSageMakerNotebookInstanceSummaryInner.type = reader.getString(); + } else if ("location".equals(fieldName)) { + deserializedSageMakerNotebookInstanceSummaryInner.withLocation(reader.getString()); + } else if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedSageMakerNotebookInstanceSummaryInner.withTags(tags); + } else if ("properties".equals(fieldName)) { + deserializedSageMakerNotebookInstanceSummaryInner.properties + = SageMakerNotebookInstanceSummaryProperties.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedSageMakerNotebookInstanceSummaryInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedSageMakerNotebookInstanceSummaryInner; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/models/SecretsManagerResourcePolicyInner.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/models/SecretsManagerResourcePolicyInner.java new file mode 100644 index 000000000000..ca0e9f98fd32 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/models/SecretsManagerResourcePolicyInner.java @@ -0,0 +1,194 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.Resource; +import com.azure.core.management.SystemData; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.awsconnector.models.SecretsManagerResourcePolicyProperties; +import java.io.IOException; +import java.util.Map; + +/** + * A Microsoft.AwsConnector resource. + */ +@Fluent +public final class SecretsManagerResourcePolicyInner extends Resource { + /* + * The resource-specific properties for this resource. + */ + private SecretsManagerResourcePolicyProperties properties; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + private SystemData systemData; + + /* + * The type of the resource. + */ + private String type; + + /* + * The name of the resource. + */ + private String name; + + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /** + * Creates an instance of SecretsManagerResourcePolicyInner class. + */ + public SecretsManagerResourcePolicyInner() { + } + + /** + * Get the properties property: The resource-specific properties for this resource. + * + * @return the properties value. + */ + public SecretsManagerResourcePolicyProperties properties() { + return this.properties; + } + + /** + * Set the properties property: The resource-specific properties for this resource. + * + * @param properties the properties value to set. + * @return the SecretsManagerResourcePolicyInner object itself. + */ + public SecretsManagerResourcePolicyInner withProperties(SecretsManagerResourcePolicyProperties properties) { + this.properties = properties; + return this; + } + + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * {@inheritDoc} + */ + @Override + public SecretsManagerResourcePolicyInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public SecretsManagerResourcePolicyInner withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (properties() != null) { + properties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("location", location()); + jsonWriter.writeMapField("tags", tags(), (writer, element) -> writer.writeString(element)); + jsonWriter.writeJsonField("properties", this.properties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of SecretsManagerResourcePolicyInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of SecretsManagerResourcePolicyInner if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the SecretsManagerResourcePolicyInner. + */ + public static SecretsManagerResourcePolicyInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + SecretsManagerResourcePolicyInner deserializedSecretsManagerResourcePolicyInner + = new SecretsManagerResourcePolicyInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedSecretsManagerResourcePolicyInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedSecretsManagerResourcePolicyInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedSecretsManagerResourcePolicyInner.type = reader.getString(); + } else if ("location".equals(fieldName)) { + deserializedSecretsManagerResourcePolicyInner.withLocation(reader.getString()); + } else if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedSecretsManagerResourcePolicyInner.withTags(tags); + } else if ("properties".equals(fieldName)) { + deserializedSecretsManagerResourcePolicyInner.properties + = SecretsManagerResourcePolicyProperties.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedSecretsManagerResourcePolicyInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedSecretsManagerResourcePolicyInner; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/models/SecretsManagerSecretInner.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/models/SecretsManagerSecretInner.java new file mode 100644 index 000000000000..304a29ee9bc3 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/models/SecretsManagerSecretInner.java @@ -0,0 +1,192 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.Resource; +import com.azure.core.management.SystemData; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.awsconnector.models.SecretsManagerSecretProperties; +import java.io.IOException; +import java.util.Map; + +/** + * A Microsoft.AwsConnector resource. + */ +@Fluent +public final class SecretsManagerSecretInner extends Resource { + /* + * The resource-specific properties for this resource. + */ + private SecretsManagerSecretProperties properties; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + private SystemData systemData; + + /* + * The type of the resource. + */ + private String type; + + /* + * The name of the resource. + */ + private String name; + + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /** + * Creates an instance of SecretsManagerSecretInner class. + */ + public SecretsManagerSecretInner() { + } + + /** + * Get the properties property: The resource-specific properties for this resource. + * + * @return the properties value. + */ + public SecretsManagerSecretProperties properties() { + return this.properties; + } + + /** + * Set the properties property: The resource-specific properties for this resource. + * + * @param properties the properties value to set. + * @return the SecretsManagerSecretInner object itself. + */ + public SecretsManagerSecretInner withProperties(SecretsManagerSecretProperties properties) { + this.properties = properties; + return this; + } + + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * {@inheritDoc} + */ + @Override + public SecretsManagerSecretInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public SecretsManagerSecretInner withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (properties() != null) { + properties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("location", location()); + jsonWriter.writeMapField("tags", tags(), (writer, element) -> writer.writeString(element)); + jsonWriter.writeJsonField("properties", this.properties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of SecretsManagerSecretInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of SecretsManagerSecretInner if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the SecretsManagerSecretInner. + */ + public static SecretsManagerSecretInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + SecretsManagerSecretInner deserializedSecretsManagerSecretInner = new SecretsManagerSecretInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedSecretsManagerSecretInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedSecretsManagerSecretInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedSecretsManagerSecretInner.type = reader.getString(); + } else if ("location".equals(fieldName)) { + deserializedSecretsManagerSecretInner.withLocation(reader.getString()); + } else if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedSecretsManagerSecretInner.withTags(tags); + } else if ("properties".equals(fieldName)) { + deserializedSecretsManagerSecretInner.properties = SecretsManagerSecretProperties.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedSecretsManagerSecretInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedSecretsManagerSecretInner; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/models/SnsSubscriptionInner.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/models/SnsSubscriptionInner.java new file mode 100644 index 000000000000..67dc4921774c --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/models/SnsSubscriptionInner.java @@ -0,0 +1,192 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.Resource; +import com.azure.core.management.SystemData; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.awsconnector.models.SnsSubscriptionProperties; +import java.io.IOException; +import java.util.Map; + +/** + * A Microsoft.AwsConnector resource. + */ +@Fluent +public final class SnsSubscriptionInner extends Resource { + /* + * The resource-specific properties for this resource. + */ + private SnsSubscriptionProperties properties; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + private SystemData systemData; + + /* + * The type of the resource. + */ + private String type; + + /* + * The name of the resource. + */ + private String name; + + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /** + * Creates an instance of SnsSubscriptionInner class. + */ + public SnsSubscriptionInner() { + } + + /** + * Get the properties property: The resource-specific properties for this resource. + * + * @return the properties value. + */ + public SnsSubscriptionProperties properties() { + return this.properties; + } + + /** + * Set the properties property: The resource-specific properties for this resource. + * + * @param properties the properties value to set. + * @return the SnsSubscriptionInner object itself. + */ + public SnsSubscriptionInner withProperties(SnsSubscriptionProperties properties) { + this.properties = properties; + return this; + } + + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * {@inheritDoc} + */ + @Override + public SnsSubscriptionInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public SnsSubscriptionInner withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (properties() != null) { + properties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("location", location()); + jsonWriter.writeMapField("tags", tags(), (writer, element) -> writer.writeString(element)); + jsonWriter.writeJsonField("properties", this.properties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of SnsSubscriptionInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of SnsSubscriptionInner if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the SnsSubscriptionInner. + */ + public static SnsSubscriptionInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + SnsSubscriptionInner deserializedSnsSubscriptionInner = new SnsSubscriptionInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedSnsSubscriptionInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedSnsSubscriptionInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedSnsSubscriptionInner.type = reader.getString(); + } else if ("location".equals(fieldName)) { + deserializedSnsSubscriptionInner.withLocation(reader.getString()); + } else if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedSnsSubscriptionInner.withTags(tags); + } else if ("properties".equals(fieldName)) { + deserializedSnsSubscriptionInner.properties = SnsSubscriptionProperties.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedSnsSubscriptionInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedSnsSubscriptionInner; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/models/SnsTopicInner.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/models/SnsTopicInner.java new file mode 100644 index 000000000000..fbac1f2d6a3c --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/models/SnsTopicInner.java @@ -0,0 +1,192 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.Resource; +import com.azure.core.management.SystemData; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.awsconnector.models.SnsTopicProperties; +import java.io.IOException; +import java.util.Map; + +/** + * A Microsoft.AwsConnector resource. + */ +@Fluent +public final class SnsTopicInner extends Resource { + /* + * The resource-specific properties for this resource. + */ + private SnsTopicProperties properties; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + private SystemData systemData; + + /* + * The type of the resource. + */ + private String type; + + /* + * The name of the resource. + */ + private String name; + + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /** + * Creates an instance of SnsTopicInner class. + */ + public SnsTopicInner() { + } + + /** + * Get the properties property: The resource-specific properties for this resource. + * + * @return the properties value. + */ + public SnsTopicProperties properties() { + return this.properties; + } + + /** + * Set the properties property: The resource-specific properties for this resource. + * + * @param properties the properties value to set. + * @return the SnsTopicInner object itself. + */ + public SnsTopicInner withProperties(SnsTopicProperties properties) { + this.properties = properties; + return this; + } + + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * {@inheritDoc} + */ + @Override + public SnsTopicInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public SnsTopicInner withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (properties() != null) { + properties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("location", location()); + jsonWriter.writeMapField("tags", tags(), (writer, element) -> writer.writeString(element)); + jsonWriter.writeJsonField("properties", this.properties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of SnsTopicInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of SnsTopicInner if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the SnsTopicInner. + */ + public static SnsTopicInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + SnsTopicInner deserializedSnsTopicInner = new SnsTopicInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedSnsTopicInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedSnsTopicInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedSnsTopicInner.type = reader.getString(); + } else if ("location".equals(fieldName)) { + deserializedSnsTopicInner.withLocation(reader.getString()); + } else if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedSnsTopicInner.withTags(tags); + } else if ("properties".equals(fieldName)) { + deserializedSnsTopicInner.properties = SnsTopicProperties.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedSnsTopicInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedSnsTopicInner; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/models/SqsQueueInner.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/models/SqsQueueInner.java new file mode 100644 index 000000000000..7f1cfa2ed3df --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/models/SqsQueueInner.java @@ -0,0 +1,192 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.Resource; +import com.azure.core.management.SystemData; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.awsconnector.models.SqsQueueProperties; +import java.io.IOException; +import java.util.Map; + +/** + * A Microsoft.AwsConnector resource. + */ +@Fluent +public final class SqsQueueInner extends Resource { + /* + * The resource-specific properties for this resource. + */ + private SqsQueueProperties properties; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + private SystemData systemData; + + /* + * The type of the resource. + */ + private String type; + + /* + * The name of the resource. + */ + private String name; + + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /** + * Creates an instance of SqsQueueInner class. + */ + public SqsQueueInner() { + } + + /** + * Get the properties property: The resource-specific properties for this resource. + * + * @return the properties value. + */ + public SqsQueueProperties properties() { + return this.properties; + } + + /** + * Set the properties property: The resource-specific properties for this resource. + * + * @param properties the properties value to set. + * @return the SqsQueueInner object itself. + */ + public SqsQueueInner withProperties(SqsQueueProperties properties) { + this.properties = properties; + return this; + } + + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * {@inheritDoc} + */ + @Override + public SqsQueueInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public SqsQueueInner withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (properties() != null) { + properties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("location", location()); + jsonWriter.writeMapField("tags", tags(), (writer, element) -> writer.writeString(element)); + jsonWriter.writeJsonField("properties", this.properties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of SqsQueueInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of SqsQueueInner if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the SqsQueueInner. + */ + public static SqsQueueInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + SqsQueueInner deserializedSqsQueueInner = new SqsQueueInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedSqsQueueInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedSqsQueueInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedSqsQueueInner.type = reader.getString(); + } else if ("location".equals(fieldName)) { + deserializedSqsQueueInner.withLocation(reader.getString()); + } else if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedSqsQueueInner.withTags(tags); + } else if ("properties".equals(fieldName)) { + deserializedSqsQueueInner.properties = SqsQueueProperties.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedSqsQueueInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedSqsQueueInner; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/models/SsmInstanceInformationInner.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/models/SsmInstanceInformationInner.java new file mode 100644 index 000000000000..fe3933d71a97 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/models/SsmInstanceInformationInner.java @@ -0,0 +1,193 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.Resource; +import com.azure.core.management.SystemData; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.awsconnector.models.SsmInstanceInformationProperties; +import java.io.IOException; +import java.util.Map; + +/** + * A Microsoft.AwsConnector resource. + */ +@Fluent +public final class SsmInstanceInformationInner extends Resource { + /* + * The resource-specific properties for this resource. + */ + private SsmInstanceInformationProperties properties; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + private SystemData systemData; + + /* + * The type of the resource. + */ + private String type; + + /* + * The name of the resource. + */ + private String name; + + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /** + * Creates an instance of SsmInstanceInformationInner class. + */ + public SsmInstanceInformationInner() { + } + + /** + * Get the properties property: The resource-specific properties for this resource. + * + * @return the properties value. + */ + public SsmInstanceInformationProperties properties() { + return this.properties; + } + + /** + * Set the properties property: The resource-specific properties for this resource. + * + * @param properties the properties value to set. + * @return the SsmInstanceInformationInner object itself. + */ + public SsmInstanceInformationInner withProperties(SsmInstanceInformationProperties properties) { + this.properties = properties; + return this; + } + + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * {@inheritDoc} + */ + @Override + public SsmInstanceInformationInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public SsmInstanceInformationInner withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (properties() != null) { + properties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("location", location()); + jsonWriter.writeMapField("tags", tags(), (writer, element) -> writer.writeString(element)); + jsonWriter.writeJsonField("properties", this.properties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of SsmInstanceInformationInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of SsmInstanceInformationInner if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the SsmInstanceInformationInner. + */ + public static SsmInstanceInformationInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + SsmInstanceInformationInner deserializedSsmInstanceInformationInner = new SsmInstanceInformationInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedSsmInstanceInformationInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedSsmInstanceInformationInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedSsmInstanceInformationInner.type = reader.getString(); + } else if ("location".equals(fieldName)) { + deserializedSsmInstanceInformationInner.withLocation(reader.getString()); + } else if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedSsmInstanceInformationInner.withTags(tags); + } else if ("properties".equals(fieldName)) { + deserializedSsmInstanceInformationInner.properties + = SsmInstanceInformationProperties.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedSsmInstanceInformationInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedSsmInstanceInformationInner; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/models/SsmParameterInner.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/models/SsmParameterInner.java new file mode 100644 index 000000000000..177fefdb695f --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/models/SsmParameterInner.java @@ -0,0 +1,192 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.Resource; +import com.azure.core.management.SystemData; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.awsconnector.models.SsmParameterProperties; +import java.io.IOException; +import java.util.Map; + +/** + * A Microsoft.AwsConnector resource. + */ +@Fluent +public final class SsmParameterInner extends Resource { + /* + * The resource-specific properties for this resource. + */ + private SsmParameterProperties properties; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + private SystemData systemData; + + /* + * The type of the resource. + */ + private String type; + + /* + * The name of the resource. + */ + private String name; + + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /** + * Creates an instance of SsmParameterInner class. + */ + public SsmParameterInner() { + } + + /** + * Get the properties property: The resource-specific properties for this resource. + * + * @return the properties value. + */ + public SsmParameterProperties properties() { + return this.properties; + } + + /** + * Set the properties property: The resource-specific properties for this resource. + * + * @param properties the properties value to set. + * @return the SsmParameterInner object itself. + */ + public SsmParameterInner withProperties(SsmParameterProperties properties) { + this.properties = properties; + return this; + } + + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * {@inheritDoc} + */ + @Override + public SsmParameterInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public SsmParameterInner withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (properties() != null) { + properties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("location", location()); + jsonWriter.writeMapField("tags", tags(), (writer, element) -> writer.writeString(element)); + jsonWriter.writeJsonField("properties", this.properties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of SsmParameterInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of SsmParameterInner if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the SsmParameterInner. + */ + public static SsmParameterInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + SsmParameterInner deserializedSsmParameterInner = new SsmParameterInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedSsmParameterInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedSsmParameterInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedSsmParameterInner.type = reader.getString(); + } else if ("location".equals(fieldName)) { + deserializedSsmParameterInner.withLocation(reader.getString()); + } else if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedSsmParameterInner.withTags(tags); + } else if ("properties".equals(fieldName)) { + deserializedSsmParameterInner.properties = SsmParameterProperties.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedSsmParameterInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedSsmParameterInner; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/models/SsmResourceComplianceSummaryItemInner.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/models/SsmResourceComplianceSummaryItemInner.java new file mode 100644 index 000000000000..bb24c5db6e88 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/models/SsmResourceComplianceSummaryItemInner.java @@ -0,0 +1,194 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.Resource; +import com.azure.core.management.SystemData; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.awsconnector.models.SsmResourceComplianceSummaryItemProperties; +import java.io.IOException; +import java.util.Map; + +/** + * A Microsoft.AwsConnector resource. + */ +@Fluent +public final class SsmResourceComplianceSummaryItemInner extends Resource { + /* + * The resource-specific properties for this resource. + */ + private SsmResourceComplianceSummaryItemProperties properties; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + private SystemData systemData; + + /* + * The type of the resource. + */ + private String type; + + /* + * The name of the resource. + */ + private String name; + + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /** + * Creates an instance of SsmResourceComplianceSummaryItemInner class. + */ + public SsmResourceComplianceSummaryItemInner() { + } + + /** + * Get the properties property: The resource-specific properties for this resource. + * + * @return the properties value. + */ + public SsmResourceComplianceSummaryItemProperties properties() { + return this.properties; + } + + /** + * Set the properties property: The resource-specific properties for this resource. + * + * @param properties the properties value to set. + * @return the SsmResourceComplianceSummaryItemInner object itself. + */ + public SsmResourceComplianceSummaryItemInner withProperties(SsmResourceComplianceSummaryItemProperties properties) { + this.properties = properties; + return this; + } + + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * {@inheritDoc} + */ + @Override + public SsmResourceComplianceSummaryItemInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public SsmResourceComplianceSummaryItemInner withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (properties() != null) { + properties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("location", location()); + jsonWriter.writeMapField("tags", tags(), (writer, element) -> writer.writeString(element)); + jsonWriter.writeJsonField("properties", this.properties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of SsmResourceComplianceSummaryItemInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of SsmResourceComplianceSummaryItemInner if the JsonReader was pointing to an instance of it, + * or null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the SsmResourceComplianceSummaryItemInner. + */ + public static SsmResourceComplianceSummaryItemInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + SsmResourceComplianceSummaryItemInner deserializedSsmResourceComplianceSummaryItemInner + = new SsmResourceComplianceSummaryItemInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedSsmResourceComplianceSummaryItemInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedSsmResourceComplianceSummaryItemInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedSsmResourceComplianceSummaryItemInner.type = reader.getString(); + } else if ("location".equals(fieldName)) { + deserializedSsmResourceComplianceSummaryItemInner.withLocation(reader.getString()); + } else if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedSsmResourceComplianceSummaryItemInner.withTags(tags); + } else if ("properties".equals(fieldName)) { + deserializedSsmResourceComplianceSummaryItemInner.properties + = SsmResourceComplianceSummaryItemProperties.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedSsmResourceComplianceSummaryItemInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedSsmResourceComplianceSummaryItemInner; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/models/WafWebAclSummaryInner.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/models/WafWebAclSummaryInner.java new file mode 100644 index 000000000000..1a93b11776a9 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/models/WafWebAclSummaryInner.java @@ -0,0 +1,192 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.Resource; +import com.azure.core.management.SystemData; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.awsconnector.models.WafWebAclSummaryProperties; +import java.io.IOException; +import java.util.Map; + +/** + * A Microsoft.AwsConnector resource. + */ +@Fluent +public final class WafWebAclSummaryInner extends Resource { + /* + * The resource-specific properties for this resource. + */ + private WafWebAclSummaryProperties properties; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + private SystemData systemData; + + /* + * The type of the resource. + */ + private String type; + + /* + * The name of the resource. + */ + private String name; + + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /** + * Creates an instance of WafWebAclSummaryInner class. + */ + public WafWebAclSummaryInner() { + } + + /** + * Get the properties property: The resource-specific properties for this resource. + * + * @return the properties value. + */ + public WafWebAclSummaryProperties properties() { + return this.properties; + } + + /** + * Set the properties property: The resource-specific properties for this resource. + * + * @param properties the properties value to set. + * @return the WafWebAclSummaryInner object itself. + */ + public WafWebAclSummaryInner withProperties(WafWebAclSummaryProperties properties) { + this.properties = properties; + return this; + } + + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * {@inheritDoc} + */ + @Override + public WafWebAclSummaryInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public WafWebAclSummaryInner withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (properties() != null) { + properties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("location", location()); + jsonWriter.writeMapField("tags", tags(), (writer, element) -> writer.writeString(element)); + jsonWriter.writeJsonField("properties", this.properties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of WafWebAclSummaryInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of WafWebAclSummaryInner if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the WafWebAclSummaryInner. + */ + public static WafWebAclSummaryInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + WafWebAclSummaryInner deserializedWafWebAclSummaryInner = new WafWebAclSummaryInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedWafWebAclSummaryInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedWafWebAclSummaryInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedWafWebAclSummaryInner.type = reader.getString(); + } else if ("location".equals(fieldName)) { + deserializedWafWebAclSummaryInner.withLocation(reader.getString()); + } else if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedWafWebAclSummaryInner.withTags(tags); + } else if ("properties".equals(fieldName)) { + deserializedWafWebAclSummaryInner.properties = WafWebAclSummaryProperties.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedWafWebAclSummaryInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedWafWebAclSummaryInner; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/models/Wafv2LoggingConfigurationInner.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/models/Wafv2LoggingConfigurationInner.java new file mode 100644 index 000000000000..54f161f185eb --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/models/Wafv2LoggingConfigurationInner.java @@ -0,0 +1,194 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.Resource; +import com.azure.core.management.SystemData; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.awsconnector.models.Wafv2LoggingConfigurationProperties; +import java.io.IOException; +import java.util.Map; + +/** + * A Microsoft.AwsConnector resource. + */ +@Fluent +public final class Wafv2LoggingConfigurationInner extends Resource { + /* + * The resource-specific properties for this resource. + */ + private Wafv2LoggingConfigurationProperties properties; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + private SystemData systemData; + + /* + * The type of the resource. + */ + private String type; + + /* + * The name of the resource. + */ + private String name; + + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /** + * Creates an instance of Wafv2LoggingConfigurationInner class. + */ + public Wafv2LoggingConfigurationInner() { + } + + /** + * Get the properties property: The resource-specific properties for this resource. + * + * @return the properties value. + */ + public Wafv2LoggingConfigurationProperties properties() { + return this.properties; + } + + /** + * Set the properties property: The resource-specific properties for this resource. + * + * @param properties the properties value to set. + * @return the Wafv2LoggingConfigurationInner object itself. + */ + public Wafv2LoggingConfigurationInner withProperties(Wafv2LoggingConfigurationProperties properties) { + this.properties = properties; + return this; + } + + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * {@inheritDoc} + */ + @Override + public Wafv2LoggingConfigurationInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public Wafv2LoggingConfigurationInner withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (properties() != null) { + properties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("location", location()); + jsonWriter.writeMapField("tags", tags(), (writer, element) -> writer.writeString(element)); + jsonWriter.writeJsonField("properties", this.properties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of Wafv2LoggingConfigurationInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of Wafv2LoggingConfigurationInner if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the Wafv2LoggingConfigurationInner. + */ + public static Wafv2LoggingConfigurationInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + Wafv2LoggingConfigurationInner deserializedWafv2LoggingConfigurationInner + = new Wafv2LoggingConfigurationInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedWafv2LoggingConfigurationInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedWafv2LoggingConfigurationInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedWafv2LoggingConfigurationInner.type = reader.getString(); + } else if ("location".equals(fieldName)) { + deserializedWafv2LoggingConfigurationInner.withLocation(reader.getString()); + } else if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedWafv2LoggingConfigurationInner.withTags(tags); + } else if ("properties".equals(fieldName)) { + deserializedWafv2LoggingConfigurationInner.properties + = Wafv2LoggingConfigurationProperties.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedWafv2LoggingConfigurationInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedWafv2LoggingConfigurationInner; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/models/package-info.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/models/package-info.java new file mode 100644 index 000000000000..9acaf9b3698b --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/models/package-info.java @@ -0,0 +1,9 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +/** + * Package containing the inner data models for MicrosoftAwsConnector. + * Microsoft.AwsConnector Resource Provider management API. + */ +package com.azure.resourcemanager.awsconnector.fluent.models; diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/package-info.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/package-info.java new file mode 100644 index 000000000000..f4bb8bdd79dc --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/fluent/package-info.java @@ -0,0 +1,9 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +/** + * Package containing the service clients for MicrosoftAwsConnector. + * Microsoft.AwsConnector Resource Provider management API. + */ +package com.azure.resourcemanager.awsconnector.fluent; diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/AccessAnalyzerAnalyzersClientImpl.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/AccessAnalyzerAnalyzersClientImpl.java new file mode 100644 index 000000000000..a716224f383e --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/AccessAnalyzerAnalyzersClientImpl.java @@ -0,0 +1,1278 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.Patch; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.awsconnector.fluent.AccessAnalyzerAnalyzersClient; +import com.azure.resourcemanager.awsconnector.fluent.models.AccessAnalyzerInner; +import com.azure.resourcemanager.awsconnector.models.AccessAnalyzerListResult; +import com.azure.resourcemanager.awsconnector.models.AccessAnalyzerTagsUpdate; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in AccessAnalyzerAnalyzersClient. + */ +public final class AccessAnalyzerAnalyzersClientImpl implements AccessAnalyzerAnalyzersClient { + /** + * The proxy service used to perform REST calls. + */ + private final AccessAnalyzerAnalyzersService service; + + /** + * The service client containing this operation class. + */ + private final MicrosoftAwsConnectorImpl client; + + /** + * Initializes an instance of AccessAnalyzerAnalyzersClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + AccessAnalyzerAnalyzersClientImpl(MicrosoftAwsConnectorImpl client) { + this.service = RestProxy.create(AccessAnalyzerAnalyzersService.class, client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for MicrosoftAwsConnectorAccessAnalyzerAnalyzers to be used by the proxy + * service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "MicrosoftAwsConnecto") + public interface AccessAnalyzerAnalyzersService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.AwsConnector/accessAnalyzerAnalyzers") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/accessAnalyzerAnalyzers") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroup(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/accessAnalyzerAnalyzers/{name}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getByResourceGroup(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("name") String name, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/accessAnalyzerAnalyzers/{name}") + @ExpectedResponses({ 200, 201 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrReplace(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("name") String name, + @BodyParam("application/json") AccessAnalyzerInner resource, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/accessAnalyzerAnalyzers/{name}") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> update(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("name") String name, + @BodyParam("application/json") AccessAnalyzerTagsUpdate properties, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/accessAnalyzerAnalyzers/{name}") + @ExpectedResponses({ 202, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("name") String name, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listBySubscriptionNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroupNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); + } + + /** + * List AccessAnalyzerAnalyzer resources by subscription ID. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a AccessAnalyzerAnalyzer list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync() { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List AccessAnalyzerAnalyzer resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a AccessAnalyzerAnalyzer list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), accept, + context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * List AccessAnalyzerAnalyzer resources by subscription ID. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a AccessAnalyzerAnalyzer list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>(() -> listSinglePageAsync(), + nextLink -> listBySubscriptionNextSinglePageAsync(nextLink)); + } + + /** + * List AccessAnalyzerAnalyzer resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a AccessAnalyzerAnalyzer list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(Context context) { + return new PagedFlux<>(() -> listSinglePageAsync(context), + nextLink -> listBySubscriptionNextSinglePageAsync(nextLink, context)); + } + + /** + * List AccessAnalyzerAnalyzer resources by subscription ID. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a AccessAnalyzerAnalyzer list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + return new PagedIterable<>(listAsync()); + } + + /** + * List AccessAnalyzerAnalyzer resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a AccessAnalyzerAnalyzer list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Context context) { + return new PagedIterable<>(listAsync(context)); + } + + /** + * List AccessAnalyzerAnalyzer resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a AccessAnalyzerAnalyzer list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List AccessAnalyzerAnalyzer resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a AccessAnalyzerAnalyzer list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * List AccessAnalyzerAnalyzer resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a AccessAnalyzerAnalyzer list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName) { + return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); + } + + /** + * List AccessAnalyzerAnalyzer resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a AccessAnalyzerAnalyzer list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName, Context context) { + return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName, context), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink, context)); + } + + /** + * List AccessAnalyzerAnalyzer resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a AccessAnalyzerAnalyzer list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName)); + } + + /** + * List AccessAnalyzerAnalyzer resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a AccessAnalyzerAnalyzer list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, context)); + } + + /** + * Get a AccessAnalyzerAnalyzer. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of AccessAnalyzerAnalyzer. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a AccessAnalyzerAnalyzer along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync(String resourceGroupName, + String name) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.getByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get a AccessAnalyzerAnalyzer. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of AccessAnalyzerAnalyzer. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a AccessAnalyzerAnalyzer along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync(String resourceGroupName, + String name, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.getByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, accept, context); + } + + /** + * Get a AccessAnalyzerAnalyzer. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of AccessAnalyzerAnalyzer. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a AccessAnalyzerAnalyzer on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getByResourceGroupAsync(String resourceGroupName, String name) { + return getByResourceGroupWithResponseAsync(resourceGroupName, name) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Get a AccessAnalyzerAnalyzer. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of AccessAnalyzerAnalyzer. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a AccessAnalyzerAnalyzer along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getByResourceGroupWithResponse(String resourceGroupName, String name, + Context context) { + return getByResourceGroupWithResponseAsync(resourceGroupName, name, context).block(); + } + + /** + * Get a AccessAnalyzerAnalyzer. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of AccessAnalyzerAnalyzer. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a AccessAnalyzerAnalyzer. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public AccessAnalyzerInner getByResourceGroup(String resourceGroupName, String name) { + return getByResourceGroupWithResponse(resourceGroupName, name, Context.NONE).getValue(); + } + + /** + * Create a AccessAnalyzerAnalyzer. Please note that end user resource creation is currently restricted, but it will + * be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of AccessAnalyzerAnalyzer. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrReplaceWithResponseAsync(String resourceGroupName, String name, + AccessAnalyzerInner resource) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (resource == null) { + return Mono.error(new IllegalArgumentException("Parameter resource is required and cannot be null.")); + } else { + resource.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.createOrReplace(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, resource, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Create a AccessAnalyzerAnalyzer. Please note that end user resource creation is currently restricted, but it will + * be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of AccessAnalyzerAnalyzer. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrReplaceWithResponseAsync(String resourceGroupName, String name, + AccessAnalyzerInner resource, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (resource == null) { + return Mono.error(new IllegalArgumentException("Parameter resource is required and cannot be null.")); + } else { + resource.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.createOrReplace(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, resource, accept, context); + } + + /** + * Create a AccessAnalyzerAnalyzer. Please note that end user resource creation is currently restricted, but it will + * be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of AccessAnalyzerAnalyzer. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, AccessAnalyzerInner> + beginCreateOrReplaceAsync(String resourceGroupName, String name, AccessAnalyzerInner resource) { + Mono>> mono = createOrReplaceWithResponseAsync(resourceGroupName, name, resource); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + AccessAnalyzerInner.class, AccessAnalyzerInner.class, this.client.getContext()); + } + + /** + * Create a AccessAnalyzerAnalyzer. Please note that end user resource creation is currently restricted, but it will + * be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of AccessAnalyzerAnalyzer. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, AccessAnalyzerInner> beginCreateOrReplaceAsync( + String resourceGroupName, String name, AccessAnalyzerInner resource, Context context) { + context = this.client.mergeContext(context); + Mono>> mono + = createOrReplaceWithResponseAsync(resourceGroupName, name, resource, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + AccessAnalyzerInner.class, AccessAnalyzerInner.class, context); + } + + /** + * Create a AccessAnalyzerAnalyzer. Please note that end user resource creation is currently restricted, but it will + * be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of AccessAnalyzerAnalyzer. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, AccessAnalyzerInner> + beginCreateOrReplace(String resourceGroupName, String name, AccessAnalyzerInner resource) { + return this.beginCreateOrReplaceAsync(resourceGroupName, name, resource).getSyncPoller(); + } + + /** + * Create a AccessAnalyzerAnalyzer. Please note that end user resource creation is currently restricted, but it will + * be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of AccessAnalyzerAnalyzer. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, AccessAnalyzerInner> + beginCreateOrReplace(String resourceGroupName, String name, AccessAnalyzerInner resource, Context context) { + return this.beginCreateOrReplaceAsync(resourceGroupName, name, resource, context).getSyncPoller(); + } + + /** + * Create a AccessAnalyzerAnalyzer. Please note that end user resource creation is currently restricted, but it will + * be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of AccessAnalyzerAnalyzer. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrReplaceAsync(String resourceGroupName, String name, + AccessAnalyzerInner resource) { + return beginCreateOrReplaceAsync(resourceGroupName, name, resource).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create a AccessAnalyzerAnalyzer. Please note that end user resource creation is currently restricted, but it will + * be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of AccessAnalyzerAnalyzer. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrReplaceAsync(String resourceGroupName, String name, + AccessAnalyzerInner resource, Context context) { + return beginCreateOrReplaceAsync(resourceGroupName, name, resource, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create a AccessAnalyzerAnalyzer. Please note that end user resource creation is currently restricted, but it will + * be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of AccessAnalyzerAnalyzer. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public AccessAnalyzerInner createOrReplace(String resourceGroupName, String name, AccessAnalyzerInner resource) { + return createOrReplaceAsync(resourceGroupName, name, resource).block(); + } + + /** + * Create a AccessAnalyzerAnalyzer. Please note that end user resource creation is currently restricted, but it will + * be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of AccessAnalyzerAnalyzer. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public AccessAnalyzerInner createOrReplace(String resourceGroupName, String name, AccessAnalyzerInner resource, + Context context) { + return createOrReplaceAsync(resourceGroupName, name, resource, context).block(); + } + + /** + * Update a AccessAnalyzerAnalyzer. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of AccessAnalyzerAnalyzer. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync(String resourceGroupName, String name, + AccessAnalyzerTagsUpdate properties) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (properties == null) { + return Mono.error(new IllegalArgumentException("Parameter properties is required and cannot be null.")); + } else { + properties.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.update(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, properties, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Update a AccessAnalyzerAnalyzer. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of AccessAnalyzerAnalyzer. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync(String resourceGroupName, String name, + AccessAnalyzerTagsUpdate properties, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (properties == null) { + return Mono.error(new IllegalArgumentException("Parameter properties is required and cannot be null.")); + } else { + properties.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.update(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, name, properties, accept, context); + } + + /** + * Update a AccessAnalyzerAnalyzer. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of AccessAnalyzerAnalyzer. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, AccessAnalyzerInner> beginUpdateAsync(String resourceGroupName, + String name, AccessAnalyzerTagsUpdate properties) { + Mono>> mono = updateWithResponseAsync(resourceGroupName, name, properties); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + AccessAnalyzerInner.class, AccessAnalyzerInner.class, this.client.getContext()); + } + + /** + * Update a AccessAnalyzerAnalyzer. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of AccessAnalyzerAnalyzer. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, AccessAnalyzerInner> beginUpdateAsync(String resourceGroupName, + String name, AccessAnalyzerTagsUpdate properties, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = updateWithResponseAsync(resourceGroupName, name, properties, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + AccessAnalyzerInner.class, AccessAnalyzerInner.class, context); + } + + /** + * Update a AccessAnalyzerAnalyzer. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of AccessAnalyzerAnalyzer. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, AccessAnalyzerInner> beginUpdate(String resourceGroupName, + String name, AccessAnalyzerTagsUpdate properties) { + return this.beginUpdateAsync(resourceGroupName, name, properties).getSyncPoller(); + } + + /** + * Update a AccessAnalyzerAnalyzer. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of AccessAnalyzerAnalyzer. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, AccessAnalyzerInner> beginUpdate(String resourceGroupName, + String name, AccessAnalyzerTagsUpdate properties, Context context) { + return this.beginUpdateAsync(resourceGroupName, name, properties, context).getSyncPoller(); + } + + /** + * Update a AccessAnalyzerAnalyzer. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of AccessAnalyzerAnalyzer. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync(String resourceGroupName, String name, + AccessAnalyzerTagsUpdate properties) { + return beginUpdateAsync(resourceGroupName, name, properties).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Update a AccessAnalyzerAnalyzer. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of AccessAnalyzerAnalyzer. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync(String resourceGroupName, String name, + AccessAnalyzerTagsUpdate properties, Context context) { + return beginUpdateAsync(resourceGroupName, name, properties, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Update a AccessAnalyzerAnalyzer. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of AccessAnalyzerAnalyzer. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public AccessAnalyzerInner update(String resourceGroupName, String name, AccessAnalyzerTagsUpdate properties) { + return updateAsync(resourceGroupName, name, properties).block(); + } + + /** + * Update a AccessAnalyzerAnalyzer. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of AccessAnalyzerAnalyzer. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public AccessAnalyzerInner update(String resourceGroupName, String name, AccessAnalyzerTagsUpdate properties, + Context context) { + return updateAsync(resourceGroupName, name, properties, context).block(); + } + + /** + * Delete a AccessAnalyzerAnalyzer. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of AccessAnalyzerAnalyzer. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync(String resourceGroupName, String name) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Delete a AccessAnalyzerAnalyzer. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of AccessAnalyzerAnalyzer. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync(String resourceGroupName, String name, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.delete(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, name, accept, context); + } + + /** + * Delete a AccessAnalyzerAnalyzer. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of AccessAnalyzerAnalyzer. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String name) { + Mono>> mono = deleteWithResponseAsync(resourceGroupName, name); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); + } + + /** + * Delete a AccessAnalyzerAnalyzer. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of AccessAnalyzerAnalyzer. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String name, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = deleteWithResponseAsync(resourceGroupName, name, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + context); + } + + /** + * Delete a AccessAnalyzerAnalyzer. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of AccessAnalyzerAnalyzer. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String name) { + return this.beginDeleteAsync(resourceGroupName, name).getSyncPoller(); + } + + /** + * Delete a AccessAnalyzerAnalyzer. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of AccessAnalyzerAnalyzer. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String name, Context context) { + return this.beginDeleteAsync(resourceGroupName, name, context).getSyncPoller(); + } + + /** + * Delete a AccessAnalyzerAnalyzer. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of AccessAnalyzerAnalyzer. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String name) { + return beginDeleteAsync(resourceGroupName, name).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete a AccessAnalyzerAnalyzer. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of AccessAnalyzerAnalyzer. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String name, Context context) { + return beginDeleteAsync(resourceGroupName, name, context).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete a AccessAnalyzerAnalyzer. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of AccessAnalyzerAnalyzer. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String name) { + deleteAsync(resourceGroupName, name).block(); + } + + /** + * Delete a AccessAnalyzerAnalyzer. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of AccessAnalyzerAnalyzer. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String name, Context context) { + deleteAsync(resourceGroupName, name, context).block(); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a AccessAnalyzerAnalyzer list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listBySubscriptionNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a AccessAnalyzerAnalyzer list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listBySubscriptionNextSinglePageAsync(String nextLink, + Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a AccessAnalyzerAnalyzer list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a AccessAnalyzerAnalyzer list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupNextSinglePageAsync(String nextLink, + Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/AccessAnalyzerAnalyzersImpl.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/AccessAnalyzerAnalyzersImpl.java new file mode 100644 index 000000000000..a46b06ccf47f --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/AccessAnalyzerAnalyzersImpl.java @@ -0,0 +1,146 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.awsconnector.fluent.AccessAnalyzerAnalyzersClient; +import com.azure.resourcemanager.awsconnector.fluent.models.AccessAnalyzerInner; +import com.azure.resourcemanager.awsconnector.models.AccessAnalyzer; +import com.azure.resourcemanager.awsconnector.models.AccessAnalyzerAnalyzers; + +public final class AccessAnalyzerAnalyzersImpl implements AccessAnalyzerAnalyzers { + private static final ClientLogger LOGGER = new ClientLogger(AccessAnalyzerAnalyzersImpl.class); + + private final AccessAnalyzerAnalyzersClient innerClient; + + private final com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager; + + public AccessAnalyzerAnalyzersImpl(AccessAnalyzerAnalyzersClient innerClient, + com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return ResourceManagerUtils.mapPage(inner, inner1 -> new AccessAnalyzerImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new AccessAnalyzerImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName); + return ResourceManagerUtils.mapPage(inner, inner1 -> new AccessAnalyzerImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new AccessAnalyzerImpl(inner1, this.manager())); + } + + public Response getByResourceGroupWithResponse(String resourceGroupName, String name, + Context context) { + Response inner + = this.serviceClient().getByResourceGroupWithResponse(resourceGroupName, name, context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new AccessAnalyzerImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public AccessAnalyzer getByResourceGroup(String resourceGroupName, String name) { + AccessAnalyzerInner inner = this.serviceClient().getByResourceGroup(resourceGroupName, name); + if (inner != null) { + return new AccessAnalyzerImpl(inner, this.manager()); + } else { + return null; + } + } + + public void deleteByResourceGroup(String resourceGroupName, String name) { + this.serviceClient().delete(resourceGroupName, name); + } + + public void delete(String resourceGroupName, String name, Context context) { + this.serviceClient().delete(resourceGroupName, name, context); + } + + public AccessAnalyzer getById(String id) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String name = ResourceManagerUtils.getValueFromIdByName(id, "accessAnalyzerAnalyzers"); + if (name == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException(String + .format("The resource ID '%s' is not valid. Missing path segment 'accessAnalyzerAnalyzers'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, name, Context.NONE).getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String name = ResourceManagerUtils.getValueFromIdByName(id, "accessAnalyzerAnalyzers"); + if (name == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException(String + .format("The resource ID '%s' is not valid. Missing path segment 'accessAnalyzerAnalyzers'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, name, context); + } + + public void deleteById(String id) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String name = ResourceManagerUtils.getValueFromIdByName(id, "accessAnalyzerAnalyzers"); + if (name == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException(String + .format("The resource ID '%s' is not valid. Missing path segment 'accessAnalyzerAnalyzers'.", id))); + } + this.delete(resourceGroupName, name, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String name = ResourceManagerUtils.getValueFromIdByName(id, "accessAnalyzerAnalyzers"); + if (name == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException(String + .format("The resource ID '%s' is not valid. Missing path segment 'accessAnalyzerAnalyzers'.", id))); + } + this.delete(resourceGroupName, name, context); + } + + private AccessAnalyzerAnalyzersClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.awsconnector.AwsconnectorManager manager() { + return this.serviceManager; + } + + public AccessAnalyzerImpl define(String name) { + return new AccessAnalyzerImpl(name, this.manager()); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/AccessAnalyzerImpl.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/AccessAnalyzerImpl.java new file mode 100644 index 000000000000..f82a2b4b559a --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/AccessAnalyzerImpl.java @@ -0,0 +1,177 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.implementation; + +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.awsconnector.fluent.models.AccessAnalyzerInner; +import com.azure.resourcemanager.awsconnector.models.AccessAnalyzer; +import com.azure.resourcemanager.awsconnector.models.AccessAnalyzerProperties; +import com.azure.resourcemanager.awsconnector.models.AccessAnalyzerTagsUpdate; +import java.util.Collections; +import java.util.Map; + +public final class AccessAnalyzerImpl implements AccessAnalyzer, AccessAnalyzer.Definition, AccessAnalyzer.Update { + private AccessAnalyzerInner innerObject; + + private final com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public String location() { + return this.innerModel().location(); + } + + public Map tags() { + Map inner = this.innerModel().tags(); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } + } + + public AccessAnalyzerProperties properties() { + return this.innerModel().properties(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public String resourceGroupName() { + return resourceGroupName; + } + + public AccessAnalyzerInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.awsconnector.AwsconnectorManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String name; + + private AccessAnalyzerTagsUpdate updateProperties; + + public AccessAnalyzerImpl withExistingResourceGroup(String resourceGroupName) { + this.resourceGroupName = resourceGroupName; + return this; + } + + public AccessAnalyzer create() { + this.innerObject = serviceManager.serviceClient() + .getAccessAnalyzerAnalyzers() + .createOrReplace(resourceGroupName, name, this.innerModel(), Context.NONE); + return this; + } + + public AccessAnalyzer create(Context context) { + this.innerObject = serviceManager.serviceClient() + .getAccessAnalyzerAnalyzers() + .createOrReplace(resourceGroupName, name, this.innerModel(), context); + return this; + } + + AccessAnalyzerImpl(String name, com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager) { + this.innerObject = new AccessAnalyzerInner(); + this.serviceManager = serviceManager; + this.name = name; + } + + public AccessAnalyzerImpl update() { + this.updateProperties = new AccessAnalyzerTagsUpdate(); + return this; + } + + public AccessAnalyzer apply() { + this.innerObject = serviceManager.serviceClient() + .getAccessAnalyzerAnalyzers() + .update(resourceGroupName, name, updateProperties, Context.NONE); + return this; + } + + public AccessAnalyzer apply(Context context) { + this.innerObject = serviceManager.serviceClient() + .getAccessAnalyzerAnalyzers() + .update(resourceGroupName, name, updateProperties, context); + return this; + } + + AccessAnalyzerImpl(AccessAnalyzerInner innerObject, + com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.name = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "accessAnalyzerAnalyzers"); + } + + public AccessAnalyzer refresh() { + this.innerObject = serviceManager.serviceClient() + .getAccessAnalyzerAnalyzers() + .getByResourceGroupWithResponse(resourceGroupName, name, Context.NONE) + .getValue(); + return this; + } + + public AccessAnalyzer refresh(Context context) { + this.innerObject = serviceManager.serviceClient() + .getAccessAnalyzerAnalyzers() + .getByResourceGroupWithResponse(resourceGroupName, name, context) + .getValue(); + return this; + } + + public AccessAnalyzerImpl withRegion(Region location) { + this.innerModel().withLocation(location.toString()); + return this; + } + + public AccessAnalyzerImpl withRegion(String location) { + this.innerModel().withLocation(location); + return this; + } + + public AccessAnalyzerImpl withTags(Map tags) { + if (isInCreateMode()) { + this.innerModel().withTags(tags); + return this; + } else { + this.updateProperties.withTags(tags); + return this; + } + } + + public AccessAnalyzerImpl withProperties(AccessAnalyzerProperties properties) { + this.innerModel().withProperties(properties); + return this; + } + + private boolean isInCreateMode() { + return this.innerModel().id() == null; + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/AcmCertificateSummariesClientImpl.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/AcmCertificateSummariesClientImpl.java new file mode 100644 index 000000000000..8cc13ec9493e --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/AcmCertificateSummariesClientImpl.java @@ -0,0 +1,1283 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.Patch; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.awsconnector.fluent.AcmCertificateSummariesClient; +import com.azure.resourcemanager.awsconnector.fluent.models.AcmCertificateSummaryInner; +import com.azure.resourcemanager.awsconnector.models.AcmCertificateSummaryListResult; +import com.azure.resourcemanager.awsconnector.models.AcmCertificateSummaryTagsUpdate; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in AcmCertificateSummariesClient. + */ +public final class AcmCertificateSummariesClientImpl implements AcmCertificateSummariesClient { + /** + * The proxy service used to perform REST calls. + */ + private final AcmCertificateSummariesService service; + + /** + * The service client containing this operation class. + */ + private final MicrosoftAwsConnectorImpl client; + + /** + * Initializes an instance of AcmCertificateSummariesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + AcmCertificateSummariesClientImpl(MicrosoftAwsConnectorImpl client) { + this.service = RestProxy.create(AcmCertificateSummariesService.class, client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for MicrosoftAwsConnectorAcmCertificateSummaries to be used by the proxy + * service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "MicrosoftAwsConnecto") + public interface AcmCertificateSummariesService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.AwsConnector/acmCertificateSummaries") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/acmCertificateSummaries") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroup(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/acmCertificateSummaries/{name}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getByResourceGroup(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("name") String name, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/acmCertificateSummaries/{name}") + @ExpectedResponses({ 200, 201 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrReplace(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("name") String name, + @BodyParam("application/json") AcmCertificateSummaryInner resource, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/acmCertificateSummaries/{name}") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> update(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("name") String name, + @BodyParam("application/json") AcmCertificateSummaryTagsUpdate properties, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/acmCertificateSummaries/{name}") + @ExpectedResponses({ 202, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("name") String name, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listBySubscriptionNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroupNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); + } + + /** + * List AcmCertificateSummary resources by subscription ID. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a AcmCertificateSummary list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync() { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List AcmCertificateSummary resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a AcmCertificateSummary list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), accept, + context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * List AcmCertificateSummary resources by subscription ID. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a AcmCertificateSummary list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>(() -> listSinglePageAsync(), + nextLink -> listBySubscriptionNextSinglePageAsync(nextLink)); + } + + /** + * List AcmCertificateSummary resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a AcmCertificateSummary list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(Context context) { + return new PagedFlux<>(() -> listSinglePageAsync(context), + nextLink -> listBySubscriptionNextSinglePageAsync(nextLink, context)); + } + + /** + * List AcmCertificateSummary resources by subscription ID. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a AcmCertificateSummary list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + return new PagedIterable<>(listAsync()); + } + + /** + * List AcmCertificateSummary resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a AcmCertificateSummary list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Context context) { + return new PagedIterable<>(listAsync(context)); + } + + /** + * List AcmCertificateSummary resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a AcmCertificateSummary list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> + listByResourceGroupSinglePageAsync(String resourceGroupName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List AcmCertificateSummary resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a AcmCertificateSummary list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * List AcmCertificateSummary resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a AcmCertificateSummary list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName) { + return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); + } + + /** + * List AcmCertificateSummary resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a AcmCertificateSummary list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName, Context context) { + return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName, context), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink, context)); + } + + /** + * List AcmCertificateSummary resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a AcmCertificateSummary list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName)); + } + + /** + * List AcmCertificateSummary resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a AcmCertificateSummary list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, context)); + } + + /** + * Get a AcmCertificateSummary. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of AcmCertificateSummary. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a AcmCertificateSummary along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync(String resourceGroupName, + String name) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.getByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get a AcmCertificateSummary. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of AcmCertificateSummary. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a AcmCertificateSummary along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync(String resourceGroupName, + String name, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.getByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, accept, context); + } + + /** + * Get a AcmCertificateSummary. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of AcmCertificateSummary. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a AcmCertificateSummary on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getByResourceGroupAsync(String resourceGroupName, String name) { + return getByResourceGroupWithResponseAsync(resourceGroupName, name) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Get a AcmCertificateSummary. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of AcmCertificateSummary. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a AcmCertificateSummary along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getByResourceGroupWithResponse(String resourceGroupName, String name, + Context context) { + return getByResourceGroupWithResponseAsync(resourceGroupName, name, context).block(); + } + + /** + * Get a AcmCertificateSummary. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of AcmCertificateSummary. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a AcmCertificateSummary. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public AcmCertificateSummaryInner getByResourceGroup(String resourceGroupName, String name) { + return getByResourceGroupWithResponse(resourceGroupName, name, Context.NONE).getValue(); + } + + /** + * Create a AcmCertificateSummary. Please note that end user resource creation is currently restricted, but it will + * be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of AcmCertificateSummary. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrReplaceWithResponseAsync(String resourceGroupName, String name, + AcmCertificateSummaryInner resource) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (resource == null) { + return Mono.error(new IllegalArgumentException("Parameter resource is required and cannot be null.")); + } else { + resource.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.createOrReplace(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, resource, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Create a AcmCertificateSummary. Please note that end user resource creation is currently restricted, but it will + * be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of AcmCertificateSummary. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrReplaceWithResponseAsync(String resourceGroupName, String name, + AcmCertificateSummaryInner resource, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (resource == null) { + return Mono.error(new IllegalArgumentException("Parameter resource is required and cannot be null.")); + } else { + resource.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.createOrReplace(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, resource, accept, context); + } + + /** + * Create a AcmCertificateSummary. Please note that end user resource creation is currently restricted, but it will + * be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of AcmCertificateSummary. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, AcmCertificateSummaryInner> + beginCreateOrReplaceAsync(String resourceGroupName, String name, AcmCertificateSummaryInner resource) { + Mono>> mono = createOrReplaceWithResponseAsync(resourceGroupName, name, resource); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), AcmCertificateSummaryInner.class, AcmCertificateSummaryInner.class, + this.client.getContext()); + } + + /** + * Create a AcmCertificateSummary. Please note that end user resource creation is currently restricted, but it will + * be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of AcmCertificateSummary. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, AcmCertificateSummaryInner> beginCreateOrReplaceAsync( + String resourceGroupName, String name, AcmCertificateSummaryInner resource, Context context) { + context = this.client.mergeContext(context); + Mono>> mono + = createOrReplaceWithResponseAsync(resourceGroupName, name, resource, context); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), AcmCertificateSummaryInner.class, AcmCertificateSummaryInner.class, context); + } + + /** + * Create a AcmCertificateSummary. Please note that end user resource creation is currently restricted, but it will + * be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of AcmCertificateSummary. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, AcmCertificateSummaryInner> + beginCreateOrReplace(String resourceGroupName, String name, AcmCertificateSummaryInner resource) { + return this.beginCreateOrReplaceAsync(resourceGroupName, name, resource).getSyncPoller(); + } + + /** + * Create a AcmCertificateSummary. Please note that end user resource creation is currently restricted, but it will + * be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of AcmCertificateSummary. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, AcmCertificateSummaryInner> beginCreateOrReplace( + String resourceGroupName, String name, AcmCertificateSummaryInner resource, Context context) { + return this.beginCreateOrReplaceAsync(resourceGroupName, name, resource, context).getSyncPoller(); + } + + /** + * Create a AcmCertificateSummary. Please note that end user resource creation is currently restricted, but it will + * be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of AcmCertificateSummary. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrReplaceAsync(String resourceGroupName, String name, + AcmCertificateSummaryInner resource) { + return beginCreateOrReplaceAsync(resourceGroupName, name, resource).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create a AcmCertificateSummary. Please note that end user resource creation is currently restricted, but it will + * be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of AcmCertificateSummary. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrReplaceAsync(String resourceGroupName, String name, + AcmCertificateSummaryInner resource, Context context) { + return beginCreateOrReplaceAsync(resourceGroupName, name, resource, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create a AcmCertificateSummary. Please note that end user resource creation is currently restricted, but it will + * be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of AcmCertificateSummary. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public AcmCertificateSummaryInner createOrReplace(String resourceGroupName, String name, + AcmCertificateSummaryInner resource) { + return createOrReplaceAsync(resourceGroupName, name, resource).block(); + } + + /** + * Create a AcmCertificateSummary. Please note that end user resource creation is currently restricted, but it will + * be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of AcmCertificateSummary. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public AcmCertificateSummaryInner createOrReplace(String resourceGroupName, String name, + AcmCertificateSummaryInner resource, Context context) { + return createOrReplaceAsync(resourceGroupName, name, resource, context).block(); + } + + /** + * Update a AcmCertificateSummary. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of AcmCertificateSummary. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync(String resourceGroupName, String name, + AcmCertificateSummaryTagsUpdate properties) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (properties == null) { + return Mono.error(new IllegalArgumentException("Parameter properties is required and cannot be null.")); + } else { + properties.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.update(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, properties, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Update a AcmCertificateSummary. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of AcmCertificateSummary. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync(String resourceGroupName, String name, + AcmCertificateSummaryTagsUpdate properties, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (properties == null) { + return Mono.error(new IllegalArgumentException("Parameter properties is required and cannot be null.")); + } else { + properties.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.update(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, name, properties, accept, context); + } + + /** + * Update a AcmCertificateSummary. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of AcmCertificateSummary. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, AcmCertificateSummaryInner> + beginUpdateAsync(String resourceGroupName, String name, AcmCertificateSummaryTagsUpdate properties) { + Mono>> mono = updateWithResponseAsync(resourceGroupName, name, properties); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), AcmCertificateSummaryInner.class, AcmCertificateSummaryInner.class, + this.client.getContext()); + } + + /** + * Update a AcmCertificateSummary. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of AcmCertificateSummary. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, AcmCertificateSummaryInner> beginUpdateAsync( + String resourceGroupName, String name, AcmCertificateSummaryTagsUpdate properties, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = updateWithResponseAsync(resourceGroupName, name, properties, context); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), AcmCertificateSummaryInner.class, AcmCertificateSummaryInner.class, context); + } + + /** + * Update a AcmCertificateSummary. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of AcmCertificateSummary. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, AcmCertificateSummaryInner> + beginUpdate(String resourceGroupName, String name, AcmCertificateSummaryTagsUpdate properties) { + return this.beginUpdateAsync(resourceGroupName, name, properties).getSyncPoller(); + } + + /** + * Update a AcmCertificateSummary. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of AcmCertificateSummary. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, AcmCertificateSummaryInner> beginUpdate( + String resourceGroupName, String name, AcmCertificateSummaryTagsUpdate properties, Context context) { + return this.beginUpdateAsync(resourceGroupName, name, properties, context).getSyncPoller(); + } + + /** + * Update a AcmCertificateSummary. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of AcmCertificateSummary. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync(String resourceGroupName, String name, + AcmCertificateSummaryTagsUpdate properties) { + return beginUpdateAsync(resourceGroupName, name, properties).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Update a AcmCertificateSummary. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of AcmCertificateSummary. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync(String resourceGroupName, String name, + AcmCertificateSummaryTagsUpdate properties, Context context) { + return beginUpdateAsync(resourceGroupName, name, properties, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Update a AcmCertificateSummary. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of AcmCertificateSummary. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public AcmCertificateSummaryInner update(String resourceGroupName, String name, + AcmCertificateSummaryTagsUpdate properties) { + return updateAsync(resourceGroupName, name, properties).block(); + } + + /** + * Update a AcmCertificateSummary. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of AcmCertificateSummary. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public AcmCertificateSummaryInner update(String resourceGroupName, String name, + AcmCertificateSummaryTagsUpdate properties, Context context) { + return updateAsync(resourceGroupName, name, properties, context).block(); + } + + /** + * Delete a AcmCertificateSummary. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of AcmCertificateSummary. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync(String resourceGroupName, String name) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Delete a AcmCertificateSummary. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of AcmCertificateSummary. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync(String resourceGroupName, String name, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.delete(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, name, accept, context); + } + + /** + * Delete a AcmCertificateSummary. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of AcmCertificateSummary. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String name) { + Mono>> mono = deleteWithResponseAsync(resourceGroupName, name); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); + } + + /** + * Delete a AcmCertificateSummary. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of AcmCertificateSummary. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String name, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = deleteWithResponseAsync(resourceGroupName, name, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + context); + } + + /** + * Delete a AcmCertificateSummary. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of AcmCertificateSummary. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String name) { + return this.beginDeleteAsync(resourceGroupName, name).getSyncPoller(); + } + + /** + * Delete a AcmCertificateSummary. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of AcmCertificateSummary. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String name, Context context) { + return this.beginDeleteAsync(resourceGroupName, name, context).getSyncPoller(); + } + + /** + * Delete a AcmCertificateSummary. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of AcmCertificateSummary. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String name) { + return beginDeleteAsync(resourceGroupName, name).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete a AcmCertificateSummary. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of AcmCertificateSummary. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String name, Context context) { + return beginDeleteAsync(resourceGroupName, name, context).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete a AcmCertificateSummary. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of AcmCertificateSummary. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String name) { + deleteAsync(resourceGroupName, name).block(); + } + + /** + * Delete a AcmCertificateSummary. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of AcmCertificateSummary. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String name, Context context) { + deleteAsync(resourceGroupName, name, context).block(); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a AcmCertificateSummary list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listBySubscriptionNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a AcmCertificateSummary list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listBySubscriptionNextSinglePageAsync(String nextLink, + Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a AcmCertificateSummary list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a AcmCertificateSummary list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupNextSinglePageAsync(String nextLink, + Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/AcmCertificateSummariesImpl.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/AcmCertificateSummariesImpl.java new file mode 100644 index 000000000000..cf9ef92ef45f --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/AcmCertificateSummariesImpl.java @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.awsconnector.fluent.AcmCertificateSummariesClient; +import com.azure.resourcemanager.awsconnector.fluent.models.AcmCertificateSummaryInner; +import com.azure.resourcemanager.awsconnector.models.AcmCertificateSummaries; +import com.azure.resourcemanager.awsconnector.models.AcmCertificateSummary; + +public final class AcmCertificateSummariesImpl implements AcmCertificateSummaries { + private static final ClientLogger LOGGER = new ClientLogger(AcmCertificateSummariesImpl.class); + + private final AcmCertificateSummariesClient innerClient; + + private final com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager; + + public AcmCertificateSummariesImpl(AcmCertificateSummariesClient innerClient, + com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return ResourceManagerUtils.mapPage(inner, inner1 -> new AcmCertificateSummaryImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new AcmCertificateSummaryImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName); + return ResourceManagerUtils.mapPage(inner, inner1 -> new AcmCertificateSummaryImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + PagedIterable inner + = this.serviceClient().listByResourceGroup(resourceGroupName, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new AcmCertificateSummaryImpl(inner1, this.manager())); + } + + public Response getByResourceGroupWithResponse(String resourceGroupName, String name, + Context context) { + Response inner + = this.serviceClient().getByResourceGroupWithResponse(resourceGroupName, name, context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new AcmCertificateSummaryImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public AcmCertificateSummary getByResourceGroup(String resourceGroupName, String name) { + AcmCertificateSummaryInner inner = this.serviceClient().getByResourceGroup(resourceGroupName, name); + if (inner != null) { + return new AcmCertificateSummaryImpl(inner, this.manager()); + } else { + return null; + } + } + + public void deleteByResourceGroup(String resourceGroupName, String name) { + this.serviceClient().delete(resourceGroupName, name); + } + + public void delete(String resourceGroupName, String name, Context context) { + this.serviceClient().delete(resourceGroupName, name, context); + } + + public AcmCertificateSummary getById(String id) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String name = ResourceManagerUtils.getValueFromIdByName(id, "acmCertificateSummaries"); + if (name == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException(String + .format("The resource ID '%s' is not valid. Missing path segment 'acmCertificateSummaries'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, name, Context.NONE).getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String name = ResourceManagerUtils.getValueFromIdByName(id, "acmCertificateSummaries"); + if (name == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException(String + .format("The resource ID '%s' is not valid. Missing path segment 'acmCertificateSummaries'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, name, context); + } + + public void deleteById(String id) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String name = ResourceManagerUtils.getValueFromIdByName(id, "acmCertificateSummaries"); + if (name == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException(String + .format("The resource ID '%s' is not valid. Missing path segment 'acmCertificateSummaries'.", id))); + } + this.delete(resourceGroupName, name, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String name = ResourceManagerUtils.getValueFromIdByName(id, "acmCertificateSummaries"); + if (name == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException(String + .format("The resource ID '%s' is not valid. Missing path segment 'acmCertificateSummaries'.", id))); + } + this.delete(resourceGroupName, name, context); + } + + private AcmCertificateSummariesClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.awsconnector.AwsconnectorManager manager() { + return this.serviceManager; + } + + public AcmCertificateSummaryImpl define(String name) { + return new AcmCertificateSummaryImpl(name, this.manager()); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/AcmCertificateSummaryImpl.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/AcmCertificateSummaryImpl.java new file mode 100644 index 000000000000..25eeeea76b1a --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/AcmCertificateSummaryImpl.java @@ -0,0 +1,178 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.implementation; + +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.awsconnector.fluent.models.AcmCertificateSummaryInner; +import com.azure.resourcemanager.awsconnector.models.AcmCertificateSummary; +import com.azure.resourcemanager.awsconnector.models.AcmCertificateSummaryProperties; +import com.azure.resourcemanager.awsconnector.models.AcmCertificateSummaryTagsUpdate; +import java.util.Collections; +import java.util.Map; + +public final class AcmCertificateSummaryImpl + implements AcmCertificateSummary, AcmCertificateSummary.Definition, AcmCertificateSummary.Update { + private AcmCertificateSummaryInner innerObject; + + private final com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public String location() { + return this.innerModel().location(); + } + + public Map tags() { + Map inner = this.innerModel().tags(); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } + } + + public AcmCertificateSummaryProperties properties() { + return this.innerModel().properties(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public String resourceGroupName() { + return resourceGroupName; + } + + public AcmCertificateSummaryInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.awsconnector.AwsconnectorManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String name; + + private AcmCertificateSummaryTagsUpdate updateProperties; + + public AcmCertificateSummaryImpl withExistingResourceGroup(String resourceGroupName) { + this.resourceGroupName = resourceGroupName; + return this; + } + + public AcmCertificateSummary create() { + this.innerObject = serviceManager.serviceClient() + .getAcmCertificateSummaries() + .createOrReplace(resourceGroupName, name, this.innerModel(), Context.NONE); + return this; + } + + public AcmCertificateSummary create(Context context) { + this.innerObject = serviceManager.serviceClient() + .getAcmCertificateSummaries() + .createOrReplace(resourceGroupName, name, this.innerModel(), context); + return this; + } + + AcmCertificateSummaryImpl(String name, com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager) { + this.innerObject = new AcmCertificateSummaryInner(); + this.serviceManager = serviceManager; + this.name = name; + } + + public AcmCertificateSummaryImpl update() { + this.updateProperties = new AcmCertificateSummaryTagsUpdate(); + return this; + } + + public AcmCertificateSummary apply() { + this.innerObject = serviceManager.serviceClient() + .getAcmCertificateSummaries() + .update(resourceGroupName, name, updateProperties, Context.NONE); + return this; + } + + public AcmCertificateSummary apply(Context context) { + this.innerObject = serviceManager.serviceClient() + .getAcmCertificateSummaries() + .update(resourceGroupName, name, updateProperties, context); + return this; + } + + AcmCertificateSummaryImpl(AcmCertificateSummaryInner innerObject, + com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.name = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "acmCertificateSummaries"); + } + + public AcmCertificateSummary refresh() { + this.innerObject = serviceManager.serviceClient() + .getAcmCertificateSummaries() + .getByResourceGroupWithResponse(resourceGroupName, name, Context.NONE) + .getValue(); + return this; + } + + public AcmCertificateSummary refresh(Context context) { + this.innerObject = serviceManager.serviceClient() + .getAcmCertificateSummaries() + .getByResourceGroupWithResponse(resourceGroupName, name, context) + .getValue(); + return this; + } + + public AcmCertificateSummaryImpl withRegion(Region location) { + this.innerModel().withLocation(location.toString()); + return this; + } + + public AcmCertificateSummaryImpl withRegion(String location) { + this.innerModel().withLocation(location); + return this; + } + + public AcmCertificateSummaryImpl withTags(Map tags) { + if (isInCreateMode()) { + this.innerModel().withTags(tags); + return this; + } else { + this.updateProperties.withTags(tags); + return this; + } + } + + public AcmCertificateSummaryImpl withProperties(AcmCertificateSummaryProperties properties) { + this.innerModel().withProperties(properties); + return this; + } + + private boolean isInCreateMode() { + return this.innerModel().id() == null; + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/ApiGatewayRestApiImpl.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/ApiGatewayRestApiImpl.java new file mode 100644 index 000000000000..68f8dcf8821c --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/ApiGatewayRestApiImpl.java @@ -0,0 +1,178 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.implementation; + +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.awsconnector.fluent.models.ApiGatewayRestApiInner; +import com.azure.resourcemanager.awsconnector.models.ApiGatewayRestApi; +import com.azure.resourcemanager.awsconnector.models.ApiGatewayRestApiProperties; +import com.azure.resourcemanager.awsconnector.models.ApiGatewayRestApiTagsUpdate; +import java.util.Collections; +import java.util.Map; + +public final class ApiGatewayRestApiImpl + implements ApiGatewayRestApi, ApiGatewayRestApi.Definition, ApiGatewayRestApi.Update { + private ApiGatewayRestApiInner innerObject; + + private final com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public String location() { + return this.innerModel().location(); + } + + public Map tags() { + Map inner = this.innerModel().tags(); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } + } + + public ApiGatewayRestApiProperties properties() { + return this.innerModel().properties(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public String resourceGroupName() { + return resourceGroupName; + } + + public ApiGatewayRestApiInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.awsconnector.AwsconnectorManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String name; + + private ApiGatewayRestApiTagsUpdate updateProperties; + + public ApiGatewayRestApiImpl withExistingResourceGroup(String resourceGroupName) { + this.resourceGroupName = resourceGroupName; + return this; + } + + public ApiGatewayRestApi create() { + this.innerObject = serviceManager.serviceClient() + .getApiGatewayRestApis() + .createOrReplace(resourceGroupName, name, this.innerModel(), Context.NONE); + return this; + } + + public ApiGatewayRestApi create(Context context) { + this.innerObject = serviceManager.serviceClient() + .getApiGatewayRestApis() + .createOrReplace(resourceGroupName, name, this.innerModel(), context); + return this; + } + + ApiGatewayRestApiImpl(String name, com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager) { + this.innerObject = new ApiGatewayRestApiInner(); + this.serviceManager = serviceManager; + this.name = name; + } + + public ApiGatewayRestApiImpl update() { + this.updateProperties = new ApiGatewayRestApiTagsUpdate(); + return this; + } + + public ApiGatewayRestApi apply() { + this.innerObject = serviceManager.serviceClient() + .getApiGatewayRestApis() + .update(resourceGroupName, name, updateProperties, Context.NONE); + return this; + } + + public ApiGatewayRestApi apply(Context context) { + this.innerObject = serviceManager.serviceClient() + .getApiGatewayRestApis() + .update(resourceGroupName, name, updateProperties, context); + return this; + } + + ApiGatewayRestApiImpl(ApiGatewayRestApiInner innerObject, + com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.name = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "apiGatewayRestApis"); + } + + public ApiGatewayRestApi refresh() { + this.innerObject = serviceManager.serviceClient() + .getApiGatewayRestApis() + .getByResourceGroupWithResponse(resourceGroupName, name, Context.NONE) + .getValue(); + return this; + } + + public ApiGatewayRestApi refresh(Context context) { + this.innerObject = serviceManager.serviceClient() + .getApiGatewayRestApis() + .getByResourceGroupWithResponse(resourceGroupName, name, context) + .getValue(); + return this; + } + + public ApiGatewayRestApiImpl withRegion(Region location) { + this.innerModel().withLocation(location.toString()); + return this; + } + + public ApiGatewayRestApiImpl withRegion(String location) { + this.innerModel().withLocation(location); + return this; + } + + public ApiGatewayRestApiImpl withTags(Map tags) { + if (isInCreateMode()) { + this.innerModel().withTags(tags); + return this; + } else { + this.updateProperties.withTags(tags); + return this; + } + } + + public ApiGatewayRestApiImpl withProperties(ApiGatewayRestApiProperties properties) { + this.innerModel().withProperties(properties); + return this; + } + + private boolean isInCreateMode() { + return this.innerModel().id() == null; + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/ApiGatewayRestApisClientImpl.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/ApiGatewayRestApisClientImpl.java new file mode 100644 index 000000000000..faf553ea7175 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/ApiGatewayRestApisClientImpl.java @@ -0,0 +1,1282 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.Patch; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.awsconnector.fluent.ApiGatewayRestApisClient; +import com.azure.resourcemanager.awsconnector.fluent.models.ApiGatewayRestApiInner; +import com.azure.resourcemanager.awsconnector.models.ApiGatewayRestApiListResult; +import com.azure.resourcemanager.awsconnector.models.ApiGatewayRestApiTagsUpdate; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in ApiGatewayRestApisClient. + */ +public final class ApiGatewayRestApisClientImpl implements ApiGatewayRestApisClient { + /** + * The proxy service used to perform REST calls. + */ + private final ApiGatewayRestApisService service; + + /** + * The service client containing this operation class. + */ + private final MicrosoftAwsConnectorImpl client; + + /** + * Initializes an instance of ApiGatewayRestApisClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + ApiGatewayRestApisClientImpl(MicrosoftAwsConnectorImpl client) { + this.service = RestProxy.create(ApiGatewayRestApisService.class, client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for MicrosoftAwsConnectorApiGatewayRestApis to be used by the proxy + * service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "MicrosoftAwsConnecto") + public interface ApiGatewayRestApisService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.AwsConnector/apiGatewayRestApis") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/apiGatewayRestApis") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroup(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/apiGatewayRestApis/{name}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getByResourceGroup(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("name") String name, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/apiGatewayRestApis/{name}") + @ExpectedResponses({ 200, 201 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrReplace(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("name") String name, + @BodyParam("application/json") ApiGatewayRestApiInner resource, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/apiGatewayRestApis/{name}") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> update(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("name") String name, + @BodyParam("application/json") ApiGatewayRestApiTagsUpdate properties, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/apiGatewayRestApis/{name}") + @ExpectedResponses({ 202, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("name") String name, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listBySubscriptionNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroupNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); + } + + /** + * List ApiGatewayRestApi resources by subscription ID. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a ApiGatewayRestApi list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync() { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List ApiGatewayRestApi resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a ApiGatewayRestApi list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), accept, + context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * List ApiGatewayRestApi resources by subscription ID. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a ApiGatewayRestApi list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>(() -> listSinglePageAsync(), + nextLink -> listBySubscriptionNextSinglePageAsync(nextLink)); + } + + /** + * List ApiGatewayRestApi resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a ApiGatewayRestApi list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(Context context) { + return new PagedFlux<>(() -> listSinglePageAsync(context), + nextLink -> listBySubscriptionNextSinglePageAsync(nextLink, context)); + } + + /** + * List ApiGatewayRestApi resources by subscription ID. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a ApiGatewayRestApi list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + return new PagedIterable<>(listAsync()); + } + + /** + * List ApiGatewayRestApi resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a ApiGatewayRestApi list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Context context) { + return new PagedIterable<>(listAsync(context)); + } + + /** + * List ApiGatewayRestApi resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a ApiGatewayRestApi list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List ApiGatewayRestApi resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a ApiGatewayRestApi list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * List ApiGatewayRestApi resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a ApiGatewayRestApi list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName) { + return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); + } + + /** + * List ApiGatewayRestApi resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a ApiGatewayRestApi list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName, Context context) { + return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName, context), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink, context)); + } + + /** + * List ApiGatewayRestApi resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a ApiGatewayRestApi list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName)); + } + + /** + * List ApiGatewayRestApi resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a ApiGatewayRestApi list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, context)); + } + + /** + * Get a ApiGatewayRestApi. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ApiGatewayRestApi. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a ApiGatewayRestApi along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync(String resourceGroupName, + String name) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.getByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get a ApiGatewayRestApi. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ApiGatewayRestApi. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a ApiGatewayRestApi along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync(String resourceGroupName, + String name, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.getByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, accept, context); + } + + /** + * Get a ApiGatewayRestApi. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ApiGatewayRestApi. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a ApiGatewayRestApi on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getByResourceGroupAsync(String resourceGroupName, String name) { + return getByResourceGroupWithResponseAsync(resourceGroupName, name) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Get a ApiGatewayRestApi. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ApiGatewayRestApi. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a ApiGatewayRestApi along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getByResourceGroupWithResponse(String resourceGroupName, String name, + Context context) { + return getByResourceGroupWithResponseAsync(resourceGroupName, name, context).block(); + } + + /** + * Get a ApiGatewayRestApi. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ApiGatewayRestApi. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a ApiGatewayRestApi. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ApiGatewayRestApiInner getByResourceGroup(String resourceGroupName, String name) { + return getByResourceGroupWithResponse(resourceGroupName, name, Context.NONE).getValue(); + } + + /** + * Create a ApiGatewayRestApi. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ApiGatewayRestApi. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrReplaceWithResponseAsync(String resourceGroupName, String name, + ApiGatewayRestApiInner resource) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (resource == null) { + return Mono.error(new IllegalArgumentException("Parameter resource is required and cannot be null.")); + } else { + resource.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.createOrReplace(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, resource, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Create a ApiGatewayRestApi. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ApiGatewayRestApi. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrReplaceWithResponseAsync(String resourceGroupName, String name, + ApiGatewayRestApiInner resource, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (resource == null) { + return Mono.error(new IllegalArgumentException("Parameter resource is required and cannot be null.")); + } else { + resource.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.createOrReplace(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, resource, accept, context); + } + + /** + * Create a ApiGatewayRestApi. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ApiGatewayRestApi. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, ApiGatewayRestApiInner> + beginCreateOrReplaceAsync(String resourceGroupName, String name, ApiGatewayRestApiInner resource) { + Mono>> mono = createOrReplaceWithResponseAsync(resourceGroupName, name, resource); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), ApiGatewayRestApiInner.class, ApiGatewayRestApiInner.class, + this.client.getContext()); + } + + /** + * Create a ApiGatewayRestApi. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ApiGatewayRestApi. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, ApiGatewayRestApiInner> beginCreateOrReplaceAsync( + String resourceGroupName, String name, ApiGatewayRestApiInner resource, Context context) { + context = this.client.mergeContext(context); + Mono>> mono + = createOrReplaceWithResponseAsync(resourceGroupName, name, resource, context); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), ApiGatewayRestApiInner.class, ApiGatewayRestApiInner.class, context); + } + + /** + * Create a ApiGatewayRestApi. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ApiGatewayRestApi. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ApiGatewayRestApiInner> + beginCreateOrReplace(String resourceGroupName, String name, ApiGatewayRestApiInner resource) { + return this.beginCreateOrReplaceAsync(resourceGroupName, name, resource).getSyncPoller(); + } + + /** + * Create a ApiGatewayRestApi. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ApiGatewayRestApi. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ApiGatewayRestApiInner> + beginCreateOrReplace(String resourceGroupName, String name, ApiGatewayRestApiInner resource, Context context) { + return this.beginCreateOrReplaceAsync(resourceGroupName, name, resource, context).getSyncPoller(); + } + + /** + * Create a ApiGatewayRestApi. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ApiGatewayRestApi. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrReplaceAsync(String resourceGroupName, String name, + ApiGatewayRestApiInner resource) { + return beginCreateOrReplaceAsync(resourceGroupName, name, resource).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create a ApiGatewayRestApi. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ApiGatewayRestApi. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrReplaceAsync(String resourceGroupName, String name, + ApiGatewayRestApiInner resource, Context context) { + return beginCreateOrReplaceAsync(resourceGroupName, name, resource, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create a ApiGatewayRestApi. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ApiGatewayRestApi. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ApiGatewayRestApiInner createOrReplace(String resourceGroupName, String name, + ApiGatewayRestApiInner resource) { + return createOrReplaceAsync(resourceGroupName, name, resource).block(); + } + + /** + * Create a ApiGatewayRestApi. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ApiGatewayRestApi. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ApiGatewayRestApiInner createOrReplace(String resourceGroupName, String name, + ApiGatewayRestApiInner resource, Context context) { + return createOrReplaceAsync(resourceGroupName, name, resource, context).block(); + } + + /** + * Update a ApiGatewayRestApi. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ApiGatewayRestApi. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync(String resourceGroupName, String name, + ApiGatewayRestApiTagsUpdate properties) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (properties == null) { + return Mono.error(new IllegalArgumentException("Parameter properties is required and cannot be null.")); + } else { + properties.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.update(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, properties, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Update a ApiGatewayRestApi. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ApiGatewayRestApi. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync(String resourceGroupName, String name, + ApiGatewayRestApiTagsUpdate properties, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (properties == null) { + return Mono.error(new IllegalArgumentException("Parameter properties is required and cannot be null.")); + } else { + properties.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.update(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, name, properties, accept, context); + } + + /** + * Update a ApiGatewayRestApi. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ApiGatewayRestApi. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, ApiGatewayRestApiInner> + beginUpdateAsync(String resourceGroupName, String name, ApiGatewayRestApiTagsUpdate properties) { + Mono>> mono = updateWithResponseAsync(resourceGroupName, name, properties); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), ApiGatewayRestApiInner.class, ApiGatewayRestApiInner.class, + this.client.getContext()); + } + + /** + * Update a ApiGatewayRestApi. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ApiGatewayRestApi. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, ApiGatewayRestApiInner> beginUpdateAsync( + String resourceGroupName, String name, ApiGatewayRestApiTagsUpdate properties, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = updateWithResponseAsync(resourceGroupName, name, properties, context); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), ApiGatewayRestApiInner.class, ApiGatewayRestApiInner.class, context); + } + + /** + * Update a ApiGatewayRestApi. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ApiGatewayRestApi. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ApiGatewayRestApiInner> beginUpdate(String resourceGroupName, + String name, ApiGatewayRestApiTagsUpdate properties) { + return this.beginUpdateAsync(resourceGroupName, name, properties).getSyncPoller(); + } + + /** + * Update a ApiGatewayRestApi. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ApiGatewayRestApi. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ApiGatewayRestApiInner> beginUpdate(String resourceGroupName, + String name, ApiGatewayRestApiTagsUpdate properties, Context context) { + return this.beginUpdateAsync(resourceGroupName, name, properties, context).getSyncPoller(); + } + + /** + * Update a ApiGatewayRestApi. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ApiGatewayRestApi. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync(String resourceGroupName, String name, + ApiGatewayRestApiTagsUpdate properties) { + return beginUpdateAsync(resourceGroupName, name, properties).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Update a ApiGatewayRestApi. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ApiGatewayRestApi. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync(String resourceGroupName, String name, + ApiGatewayRestApiTagsUpdate properties, Context context) { + return beginUpdateAsync(resourceGroupName, name, properties, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Update a ApiGatewayRestApi. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ApiGatewayRestApi. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ApiGatewayRestApiInner update(String resourceGroupName, String name, + ApiGatewayRestApiTagsUpdate properties) { + return updateAsync(resourceGroupName, name, properties).block(); + } + + /** + * Update a ApiGatewayRestApi. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ApiGatewayRestApi. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ApiGatewayRestApiInner update(String resourceGroupName, String name, ApiGatewayRestApiTagsUpdate properties, + Context context) { + return updateAsync(resourceGroupName, name, properties, context).block(); + } + + /** + * Delete a ApiGatewayRestApi. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ApiGatewayRestApi. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync(String resourceGroupName, String name) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Delete a ApiGatewayRestApi. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ApiGatewayRestApi. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync(String resourceGroupName, String name, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.delete(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, name, accept, context); + } + + /** + * Delete a ApiGatewayRestApi. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ApiGatewayRestApi. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String name) { + Mono>> mono = deleteWithResponseAsync(resourceGroupName, name); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); + } + + /** + * Delete a ApiGatewayRestApi. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ApiGatewayRestApi. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String name, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = deleteWithResponseAsync(resourceGroupName, name, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + context); + } + + /** + * Delete a ApiGatewayRestApi. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ApiGatewayRestApi. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String name) { + return this.beginDeleteAsync(resourceGroupName, name).getSyncPoller(); + } + + /** + * Delete a ApiGatewayRestApi. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ApiGatewayRestApi. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String name, Context context) { + return this.beginDeleteAsync(resourceGroupName, name, context).getSyncPoller(); + } + + /** + * Delete a ApiGatewayRestApi. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ApiGatewayRestApi. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String name) { + return beginDeleteAsync(resourceGroupName, name).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete a ApiGatewayRestApi. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ApiGatewayRestApi. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String name, Context context) { + return beginDeleteAsync(resourceGroupName, name, context).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete a ApiGatewayRestApi. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ApiGatewayRestApi. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String name) { + deleteAsync(resourceGroupName, name).block(); + } + + /** + * Delete a ApiGatewayRestApi. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ApiGatewayRestApi. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String name, Context context) { + deleteAsync(resourceGroupName, name, context).block(); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a ApiGatewayRestApi list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listBySubscriptionNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a ApiGatewayRestApi list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listBySubscriptionNextSinglePageAsync(String nextLink, + Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a ApiGatewayRestApi list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a ApiGatewayRestApi list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupNextSinglePageAsync(String nextLink, + Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/ApiGatewayRestApisImpl.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/ApiGatewayRestApisImpl.java new file mode 100644 index 000000000000..b93f17ef0b4e --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/ApiGatewayRestApisImpl.java @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.awsconnector.fluent.ApiGatewayRestApisClient; +import com.azure.resourcemanager.awsconnector.fluent.models.ApiGatewayRestApiInner; +import com.azure.resourcemanager.awsconnector.models.ApiGatewayRestApi; +import com.azure.resourcemanager.awsconnector.models.ApiGatewayRestApis; + +public final class ApiGatewayRestApisImpl implements ApiGatewayRestApis { + private static final ClientLogger LOGGER = new ClientLogger(ApiGatewayRestApisImpl.class); + + private final ApiGatewayRestApisClient innerClient; + + private final com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager; + + public ApiGatewayRestApisImpl(ApiGatewayRestApisClient innerClient, + com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return ResourceManagerUtils.mapPage(inner, inner1 -> new ApiGatewayRestApiImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new ApiGatewayRestApiImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName); + return ResourceManagerUtils.mapPage(inner, inner1 -> new ApiGatewayRestApiImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + PagedIterable inner + = this.serviceClient().listByResourceGroup(resourceGroupName, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new ApiGatewayRestApiImpl(inner1, this.manager())); + } + + public Response getByResourceGroupWithResponse(String resourceGroupName, String name, + Context context) { + Response inner + = this.serviceClient().getByResourceGroupWithResponse(resourceGroupName, name, context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new ApiGatewayRestApiImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public ApiGatewayRestApi getByResourceGroup(String resourceGroupName, String name) { + ApiGatewayRestApiInner inner = this.serviceClient().getByResourceGroup(resourceGroupName, name); + if (inner != null) { + return new ApiGatewayRestApiImpl(inner, this.manager()); + } else { + return null; + } + } + + public void deleteByResourceGroup(String resourceGroupName, String name) { + this.serviceClient().delete(resourceGroupName, name); + } + + public void delete(String resourceGroupName, String name, Context context) { + this.serviceClient().delete(resourceGroupName, name, context); + } + + public ApiGatewayRestApi getById(String id) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String name = ResourceManagerUtils.getValueFromIdByName(id, "apiGatewayRestApis"); + if (name == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'apiGatewayRestApis'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, name, Context.NONE).getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String name = ResourceManagerUtils.getValueFromIdByName(id, "apiGatewayRestApis"); + if (name == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'apiGatewayRestApis'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, name, context); + } + + public void deleteById(String id) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String name = ResourceManagerUtils.getValueFromIdByName(id, "apiGatewayRestApis"); + if (name == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'apiGatewayRestApis'.", id))); + } + this.delete(resourceGroupName, name, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String name = ResourceManagerUtils.getValueFromIdByName(id, "apiGatewayRestApis"); + if (name == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'apiGatewayRestApis'.", id))); + } + this.delete(resourceGroupName, name, context); + } + + private ApiGatewayRestApisClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.awsconnector.AwsconnectorManager manager() { + return this.serviceManager; + } + + public ApiGatewayRestApiImpl define(String name) { + return new ApiGatewayRestApiImpl(name, this.manager()); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/ApiGatewayStageImpl.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/ApiGatewayStageImpl.java new file mode 100644 index 000000000000..14307eb8ccb1 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/ApiGatewayStageImpl.java @@ -0,0 +1,177 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.implementation; + +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.awsconnector.fluent.models.ApiGatewayStageInner; +import com.azure.resourcemanager.awsconnector.models.ApiGatewayStage; +import com.azure.resourcemanager.awsconnector.models.ApiGatewayStageProperties; +import com.azure.resourcemanager.awsconnector.models.ApiGatewayStageTagsUpdate; +import java.util.Collections; +import java.util.Map; + +public final class ApiGatewayStageImpl implements ApiGatewayStage, ApiGatewayStage.Definition, ApiGatewayStage.Update { + private ApiGatewayStageInner innerObject; + + private final com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public String location() { + return this.innerModel().location(); + } + + public Map tags() { + Map inner = this.innerModel().tags(); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } + } + + public ApiGatewayStageProperties properties() { + return this.innerModel().properties(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public String resourceGroupName() { + return resourceGroupName; + } + + public ApiGatewayStageInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.awsconnector.AwsconnectorManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String name; + + private ApiGatewayStageTagsUpdate updateProperties; + + public ApiGatewayStageImpl withExistingResourceGroup(String resourceGroupName) { + this.resourceGroupName = resourceGroupName; + return this; + } + + public ApiGatewayStage create() { + this.innerObject = serviceManager.serviceClient() + .getApiGatewayStages() + .createOrReplace(resourceGroupName, name, this.innerModel(), Context.NONE); + return this; + } + + public ApiGatewayStage create(Context context) { + this.innerObject = serviceManager.serviceClient() + .getApiGatewayStages() + .createOrReplace(resourceGroupName, name, this.innerModel(), context); + return this; + } + + ApiGatewayStageImpl(String name, com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager) { + this.innerObject = new ApiGatewayStageInner(); + this.serviceManager = serviceManager; + this.name = name; + } + + public ApiGatewayStageImpl update() { + this.updateProperties = new ApiGatewayStageTagsUpdate(); + return this; + } + + public ApiGatewayStage apply() { + this.innerObject = serviceManager.serviceClient() + .getApiGatewayStages() + .update(resourceGroupName, name, updateProperties, Context.NONE); + return this; + } + + public ApiGatewayStage apply(Context context) { + this.innerObject = serviceManager.serviceClient() + .getApiGatewayStages() + .update(resourceGroupName, name, updateProperties, context); + return this; + } + + ApiGatewayStageImpl(ApiGatewayStageInner innerObject, + com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.name = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "apiGatewayStages"); + } + + public ApiGatewayStage refresh() { + this.innerObject = serviceManager.serviceClient() + .getApiGatewayStages() + .getByResourceGroupWithResponse(resourceGroupName, name, Context.NONE) + .getValue(); + return this; + } + + public ApiGatewayStage refresh(Context context) { + this.innerObject = serviceManager.serviceClient() + .getApiGatewayStages() + .getByResourceGroupWithResponse(resourceGroupName, name, context) + .getValue(); + return this; + } + + public ApiGatewayStageImpl withRegion(Region location) { + this.innerModel().withLocation(location.toString()); + return this; + } + + public ApiGatewayStageImpl withRegion(String location) { + this.innerModel().withLocation(location); + return this; + } + + public ApiGatewayStageImpl withTags(Map tags) { + if (isInCreateMode()) { + this.innerModel().withTags(tags); + return this; + } else { + this.updateProperties.withTags(tags); + return this; + } + } + + public ApiGatewayStageImpl withProperties(ApiGatewayStageProperties properties) { + this.innerModel().withProperties(properties); + return this; + } + + private boolean isInCreateMode() { + return this.innerModel().id() == null; + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/ApiGatewayStagesClientImpl.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/ApiGatewayStagesClientImpl.java new file mode 100644 index 000000000000..40caa796965d --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/ApiGatewayStagesClientImpl.java @@ -0,0 +1,1278 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.Patch; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.awsconnector.fluent.ApiGatewayStagesClient; +import com.azure.resourcemanager.awsconnector.fluent.models.ApiGatewayStageInner; +import com.azure.resourcemanager.awsconnector.models.ApiGatewayStageListResult; +import com.azure.resourcemanager.awsconnector.models.ApiGatewayStageTagsUpdate; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in ApiGatewayStagesClient. + */ +public final class ApiGatewayStagesClientImpl implements ApiGatewayStagesClient { + /** + * The proxy service used to perform REST calls. + */ + private final ApiGatewayStagesService service; + + /** + * The service client containing this operation class. + */ + private final MicrosoftAwsConnectorImpl client; + + /** + * Initializes an instance of ApiGatewayStagesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + ApiGatewayStagesClientImpl(MicrosoftAwsConnectorImpl client) { + this.service + = RestProxy.create(ApiGatewayStagesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for MicrosoftAwsConnectorApiGatewayStages to be used by the proxy service + * to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "MicrosoftAwsConnecto") + public interface ApiGatewayStagesService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.AwsConnector/apiGatewayStages") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/apiGatewayStages") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroup(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/apiGatewayStages/{name}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getByResourceGroup(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("name") String name, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/apiGatewayStages/{name}") + @ExpectedResponses({ 200, 201 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrReplace(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("name") String name, + @BodyParam("application/json") ApiGatewayStageInner resource, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/apiGatewayStages/{name}") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> update(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("name") String name, + @BodyParam("application/json") ApiGatewayStageTagsUpdate properties, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/apiGatewayStages/{name}") + @ExpectedResponses({ 202, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("name") String name, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listBySubscriptionNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroupNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); + } + + /** + * List ApiGatewayStage resources by subscription ID. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a ApiGatewayStage list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync() { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List ApiGatewayStage resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a ApiGatewayStage list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), accept, + context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * List ApiGatewayStage resources by subscription ID. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a ApiGatewayStage list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>(() -> listSinglePageAsync(), + nextLink -> listBySubscriptionNextSinglePageAsync(nextLink)); + } + + /** + * List ApiGatewayStage resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a ApiGatewayStage list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(Context context) { + return new PagedFlux<>(() -> listSinglePageAsync(context), + nextLink -> listBySubscriptionNextSinglePageAsync(nextLink, context)); + } + + /** + * List ApiGatewayStage resources by subscription ID. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a ApiGatewayStage list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + return new PagedIterable<>(listAsync()); + } + + /** + * List ApiGatewayStage resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a ApiGatewayStage list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Context context) { + return new PagedIterable<>(listAsync(context)); + } + + /** + * List ApiGatewayStage resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a ApiGatewayStage list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List ApiGatewayStage resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a ApiGatewayStage list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * List ApiGatewayStage resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a ApiGatewayStage list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName) { + return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); + } + + /** + * List ApiGatewayStage resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a ApiGatewayStage list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName, Context context) { + return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName, context), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink, context)); + } + + /** + * List ApiGatewayStage resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a ApiGatewayStage list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName)); + } + + /** + * List ApiGatewayStage resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a ApiGatewayStage list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, context)); + } + + /** + * Get a ApiGatewayStage. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ApiGatewayStage. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a ApiGatewayStage along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync(String resourceGroupName, + String name) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.getByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get a ApiGatewayStage. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ApiGatewayStage. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a ApiGatewayStage along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync(String resourceGroupName, + String name, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.getByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, accept, context); + } + + /** + * Get a ApiGatewayStage. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ApiGatewayStage. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a ApiGatewayStage on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getByResourceGroupAsync(String resourceGroupName, String name) { + return getByResourceGroupWithResponseAsync(resourceGroupName, name) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Get a ApiGatewayStage. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ApiGatewayStage. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a ApiGatewayStage along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getByResourceGroupWithResponse(String resourceGroupName, String name, + Context context) { + return getByResourceGroupWithResponseAsync(resourceGroupName, name, context).block(); + } + + /** + * Get a ApiGatewayStage. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ApiGatewayStage. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a ApiGatewayStage. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ApiGatewayStageInner getByResourceGroup(String resourceGroupName, String name) { + return getByResourceGroupWithResponse(resourceGroupName, name, Context.NONE).getValue(); + } + + /** + * Create a ApiGatewayStage. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ApiGatewayStage. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrReplaceWithResponseAsync(String resourceGroupName, String name, + ApiGatewayStageInner resource) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (resource == null) { + return Mono.error(new IllegalArgumentException("Parameter resource is required and cannot be null.")); + } else { + resource.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.createOrReplace(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, resource, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Create a ApiGatewayStage. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ApiGatewayStage. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrReplaceWithResponseAsync(String resourceGroupName, String name, + ApiGatewayStageInner resource, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (resource == null) { + return Mono.error(new IllegalArgumentException("Parameter resource is required and cannot be null.")); + } else { + resource.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.createOrReplace(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, resource, accept, context); + } + + /** + * Create a ApiGatewayStage. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ApiGatewayStage. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, ApiGatewayStageInner> + beginCreateOrReplaceAsync(String resourceGroupName, String name, ApiGatewayStageInner resource) { + Mono>> mono = createOrReplaceWithResponseAsync(resourceGroupName, name, resource); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + ApiGatewayStageInner.class, ApiGatewayStageInner.class, this.client.getContext()); + } + + /** + * Create a ApiGatewayStage. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ApiGatewayStage. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, ApiGatewayStageInner> beginCreateOrReplaceAsync( + String resourceGroupName, String name, ApiGatewayStageInner resource, Context context) { + context = this.client.mergeContext(context); + Mono>> mono + = createOrReplaceWithResponseAsync(resourceGroupName, name, resource, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + ApiGatewayStageInner.class, ApiGatewayStageInner.class, context); + } + + /** + * Create a ApiGatewayStage. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ApiGatewayStage. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ApiGatewayStageInner> + beginCreateOrReplace(String resourceGroupName, String name, ApiGatewayStageInner resource) { + return this.beginCreateOrReplaceAsync(resourceGroupName, name, resource).getSyncPoller(); + } + + /** + * Create a ApiGatewayStage. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ApiGatewayStage. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ApiGatewayStageInner> + beginCreateOrReplace(String resourceGroupName, String name, ApiGatewayStageInner resource, Context context) { + return this.beginCreateOrReplaceAsync(resourceGroupName, name, resource, context).getSyncPoller(); + } + + /** + * Create a ApiGatewayStage. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ApiGatewayStage. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrReplaceAsync(String resourceGroupName, String name, + ApiGatewayStageInner resource) { + return beginCreateOrReplaceAsync(resourceGroupName, name, resource).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create a ApiGatewayStage. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ApiGatewayStage. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrReplaceAsync(String resourceGroupName, String name, + ApiGatewayStageInner resource, Context context) { + return beginCreateOrReplaceAsync(resourceGroupName, name, resource, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create a ApiGatewayStage. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ApiGatewayStage. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ApiGatewayStageInner createOrReplace(String resourceGroupName, String name, ApiGatewayStageInner resource) { + return createOrReplaceAsync(resourceGroupName, name, resource).block(); + } + + /** + * Create a ApiGatewayStage. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ApiGatewayStage. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ApiGatewayStageInner createOrReplace(String resourceGroupName, String name, ApiGatewayStageInner resource, + Context context) { + return createOrReplaceAsync(resourceGroupName, name, resource, context).block(); + } + + /** + * Update a ApiGatewayStage. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ApiGatewayStage. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync(String resourceGroupName, String name, + ApiGatewayStageTagsUpdate properties) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (properties == null) { + return Mono.error(new IllegalArgumentException("Parameter properties is required and cannot be null.")); + } else { + properties.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.update(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, properties, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Update a ApiGatewayStage. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ApiGatewayStage. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync(String resourceGroupName, String name, + ApiGatewayStageTagsUpdate properties, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (properties == null) { + return Mono.error(new IllegalArgumentException("Parameter properties is required and cannot be null.")); + } else { + properties.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.update(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, name, properties, accept, context); + } + + /** + * Update a ApiGatewayStage. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ApiGatewayStage. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, ApiGatewayStageInner> + beginUpdateAsync(String resourceGroupName, String name, ApiGatewayStageTagsUpdate properties) { + Mono>> mono = updateWithResponseAsync(resourceGroupName, name, properties); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + ApiGatewayStageInner.class, ApiGatewayStageInner.class, this.client.getContext()); + } + + /** + * Update a ApiGatewayStage. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ApiGatewayStage. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, ApiGatewayStageInner> + beginUpdateAsync(String resourceGroupName, String name, ApiGatewayStageTagsUpdate properties, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = updateWithResponseAsync(resourceGroupName, name, properties, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + ApiGatewayStageInner.class, ApiGatewayStageInner.class, context); + } + + /** + * Update a ApiGatewayStage. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ApiGatewayStage. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ApiGatewayStageInner> beginUpdate(String resourceGroupName, + String name, ApiGatewayStageTagsUpdate properties) { + return this.beginUpdateAsync(resourceGroupName, name, properties).getSyncPoller(); + } + + /** + * Update a ApiGatewayStage. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ApiGatewayStage. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ApiGatewayStageInner> beginUpdate(String resourceGroupName, + String name, ApiGatewayStageTagsUpdate properties, Context context) { + return this.beginUpdateAsync(resourceGroupName, name, properties, context).getSyncPoller(); + } + + /** + * Update a ApiGatewayStage. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ApiGatewayStage. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync(String resourceGroupName, String name, + ApiGatewayStageTagsUpdate properties) { + return beginUpdateAsync(resourceGroupName, name, properties).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Update a ApiGatewayStage. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ApiGatewayStage. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync(String resourceGroupName, String name, + ApiGatewayStageTagsUpdate properties, Context context) { + return beginUpdateAsync(resourceGroupName, name, properties, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Update a ApiGatewayStage. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ApiGatewayStage. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ApiGatewayStageInner update(String resourceGroupName, String name, ApiGatewayStageTagsUpdate properties) { + return updateAsync(resourceGroupName, name, properties).block(); + } + + /** + * Update a ApiGatewayStage. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ApiGatewayStage. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ApiGatewayStageInner update(String resourceGroupName, String name, ApiGatewayStageTagsUpdate properties, + Context context) { + return updateAsync(resourceGroupName, name, properties, context).block(); + } + + /** + * Delete a ApiGatewayStage. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ApiGatewayStage. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync(String resourceGroupName, String name) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Delete a ApiGatewayStage. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ApiGatewayStage. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync(String resourceGroupName, String name, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.delete(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, name, accept, context); + } + + /** + * Delete a ApiGatewayStage. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ApiGatewayStage. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String name) { + Mono>> mono = deleteWithResponseAsync(resourceGroupName, name); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); + } + + /** + * Delete a ApiGatewayStage. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ApiGatewayStage. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String name, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = deleteWithResponseAsync(resourceGroupName, name, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + context); + } + + /** + * Delete a ApiGatewayStage. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ApiGatewayStage. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String name) { + return this.beginDeleteAsync(resourceGroupName, name).getSyncPoller(); + } + + /** + * Delete a ApiGatewayStage. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ApiGatewayStage. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String name, Context context) { + return this.beginDeleteAsync(resourceGroupName, name, context).getSyncPoller(); + } + + /** + * Delete a ApiGatewayStage. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ApiGatewayStage. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String name) { + return beginDeleteAsync(resourceGroupName, name).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete a ApiGatewayStage. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ApiGatewayStage. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String name, Context context) { + return beginDeleteAsync(resourceGroupName, name, context).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete a ApiGatewayStage. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ApiGatewayStage. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String name) { + deleteAsync(resourceGroupName, name).block(); + } + + /** + * Delete a ApiGatewayStage. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ApiGatewayStage. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String name, Context context) { + deleteAsync(resourceGroupName, name, context).block(); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a ApiGatewayStage list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listBySubscriptionNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a ApiGatewayStage list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listBySubscriptionNextSinglePageAsync(String nextLink, + Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a ApiGatewayStage list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a ApiGatewayStage list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupNextSinglePageAsync(String nextLink, + Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/ApiGatewayStagesImpl.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/ApiGatewayStagesImpl.java new file mode 100644 index 000000000000..29c0fd22ba93 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/ApiGatewayStagesImpl.java @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.awsconnector.fluent.ApiGatewayStagesClient; +import com.azure.resourcemanager.awsconnector.fluent.models.ApiGatewayStageInner; +import com.azure.resourcemanager.awsconnector.models.ApiGatewayStage; +import com.azure.resourcemanager.awsconnector.models.ApiGatewayStages; + +public final class ApiGatewayStagesImpl implements ApiGatewayStages { + private static final ClientLogger LOGGER = new ClientLogger(ApiGatewayStagesImpl.class); + + private final ApiGatewayStagesClient innerClient; + + private final com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager; + + public ApiGatewayStagesImpl(ApiGatewayStagesClient innerClient, + com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return ResourceManagerUtils.mapPage(inner, inner1 -> new ApiGatewayStageImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new ApiGatewayStageImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName); + return ResourceManagerUtils.mapPage(inner, inner1 -> new ApiGatewayStageImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + PagedIterable inner + = this.serviceClient().listByResourceGroup(resourceGroupName, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new ApiGatewayStageImpl(inner1, this.manager())); + } + + public Response getByResourceGroupWithResponse(String resourceGroupName, String name, + Context context) { + Response inner + = this.serviceClient().getByResourceGroupWithResponse(resourceGroupName, name, context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new ApiGatewayStageImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public ApiGatewayStage getByResourceGroup(String resourceGroupName, String name) { + ApiGatewayStageInner inner = this.serviceClient().getByResourceGroup(resourceGroupName, name); + if (inner != null) { + return new ApiGatewayStageImpl(inner, this.manager()); + } else { + return null; + } + } + + public void deleteByResourceGroup(String resourceGroupName, String name) { + this.serviceClient().delete(resourceGroupName, name); + } + + public void delete(String resourceGroupName, String name, Context context) { + this.serviceClient().delete(resourceGroupName, name, context); + } + + public ApiGatewayStage getById(String id) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String name = ResourceManagerUtils.getValueFromIdByName(id, "apiGatewayStages"); + if (name == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'apiGatewayStages'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, name, Context.NONE).getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String name = ResourceManagerUtils.getValueFromIdByName(id, "apiGatewayStages"); + if (name == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'apiGatewayStages'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, name, context); + } + + public void deleteById(String id) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String name = ResourceManagerUtils.getValueFromIdByName(id, "apiGatewayStages"); + if (name == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'apiGatewayStages'.", id))); + } + this.delete(resourceGroupName, name, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String name = ResourceManagerUtils.getValueFromIdByName(id, "apiGatewayStages"); + if (name == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'apiGatewayStages'.", id))); + } + this.delete(resourceGroupName, name, context); + } + + private ApiGatewayStagesClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.awsconnector.AwsconnectorManager manager() { + return this.serviceManager; + } + + public ApiGatewayStageImpl define(String name) { + return new ApiGatewayStageImpl(name, this.manager()); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/AppSyncGraphqlApiImpl.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/AppSyncGraphqlApiImpl.java new file mode 100644 index 000000000000..6f68f70b4aaa --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/AppSyncGraphqlApiImpl.java @@ -0,0 +1,178 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.implementation; + +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.awsconnector.fluent.models.AppSyncGraphqlApiInner; +import com.azure.resourcemanager.awsconnector.models.AppSyncGraphqlApi; +import com.azure.resourcemanager.awsconnector.models.AppSyncGraphqlApiProperties; +import com.azure.resourcemanager.awsconnector.models.AppSyncGraphqlApiTagsUpdate; +import java.util.Collections; +import java.util.Map; + +public final class AppSyncGraphqlApiImpl + implements AppSyncGraphqlApi, AppSyncGraphqlApi.Definition, AppSyncGraphqlApi.Update { + private AppSyncGraphqlApiInner innerObject; + + private final com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public String location() { + return this.innerModel().location(); + } + + public Map tags() { + Map inner = this.innerModel().tags(); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } + } + + public AppSyncGraphqlApiProperties properties() { + return this.innerModel().properties(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public String resourceGroupName() { + return resourceGroupName; + } + + public AppSyncGraphqlApiInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.awsconnector.AwsconnectorManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String name; + + private AppSyncGraphqlApiTagsUpdate updateProperties; + + public AppSyncGraphqlApiImpl withExistingResourceGroup(String resourceGroupName) { + this.resourceGroupName = resourceGroupName; + return this; + } + + public AppSyncGraphqlApi create() { + this.innerObject = serviceManager.serviceClient() + .getAppSyncGraphqlApis() + .createOrReplace(resourceGroupName, name, this.innerModel(), Context.NONE); + return this; + } + + public AppSyncGraphqlApi create(Context context) { + this.innerObject = serviceManager.serviceClient() + .getAppSyncGraphqlApis() + .createOrReplace(resourceGroupName, name, this.innerModel(), context); + return this; + } + + AppSyncGraphqlApiImpl(String name, com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager) { + this.innerObject = new AppSyncGraphqlApiInner(); + this.serviceManager = serviceManager; + this.name = name; + } + + public AppSyncGraphqlApiImpl update() { + this.updateProperties = new AppSyncGraphqlApiTagsUpdate(); + return this; + } + + public AppSyncGraphqlApi apply() { + this.innerObject = serviceManager.serviceClient() + .getAppSyncGraphqlApis() + .update(resourceGroupName, name, updateProperties, Context.NONE); + return this; + } + + public AppSyncGraphqlApi apply(Context context) { + this.innerObject = serviceManager.serviceClient() + .getAppSyncGraphqlApis() + .update(resourceGroupName, name, updateProperties, context); + return this; + } + + AppSyncGraphqlApiImpl(AppSyncGraphqlApiInner innerObject, + com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.name = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "appSyncGraphqlApis"); + } + + public AppSyncGraphqlApi refresh() { + this.innerObject = serviceManager.serviceClient() + .getAppSyncGraphqlApis() + .getByResourceGroupWithResponse(resourceGroupName, name, Context.NONE) + .getValue(); + return this; + } + + public AppSyncGraphqlApi refresh(Context context) { + this.innerObject = serviceManager.serviceClient() + .getAppSyncGraphqlApis() + .getByResourceGroupWithResponse(resourceGroupName, name, context) + .getValue(); + return this; + } + + public AppSyncGraphqlApiImpl withRegion(Region location) { + this.innerModel().withLocation(location.toString()); + return this; + } + + public AppSyncGraphqlApiImpl withRegion(String location) { + this.innerModel().withLocation(location); + return this; + } + + public AppSyncGraphqlApiImpl withTags(Map tags) { + if (isInCreateMode()) { + this.innerModel().withTags(tags); + return this; + } else { + this.updateProperties.withTags(tags); + return this; + } + } + + public AppSyncGraphqlApiImpl withProperties(AppSyncGraphqlApiProperties properties) { + this.innerModel().withProperties(properties); + return this; + } + + private boolean isInCreateMode() { + return this.innerModel().id() == null; + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/AppSyncGraphqlApisClientImpl.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/AppSyncGraphqlApisClientImpl.java new file mode 100644 index 000000000000..8e63769d785d --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/AppSyncGraphqlApisClientImpl.java @@ -0,0 +1,1282 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.Patch; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.awsconnector.fluent.AppSyncGraphqlApisClient; +import com.azure.resourcemanager.awsconnector.fluent.models.AppSyncGraphqlApiInner; +import com.azure.resourcemanager.awsconnector.models.AppSyncGraphqlApiListResult; +import com.azure.resourcemanager.awsconnector.models.AppSyncGraphqlApiTagsUpdate; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in AppSyncGraphqlApisClient. + */ +public final class AppSyncGraphqlApisClientImpl implements AppSyncGraphqlApisClient { + /** + * The proxy service used to perform REST calls. + */ + private final AppSyncGraphqlApisService service; + + /** + * The service client containing this operation class. + */ + private final MicrosoftAwsConnectorImpl client; + + /** + * Initializes an instance of AppSyncGraphqlApisClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + AppSyncGraphqlApisClientImpl(MicrosoftAwsConnectorImpl client) { + this.service = RestProxy.create(AppSyncGraphqlApisService.class, client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for MicrosoftAwsConnectorAppSyncGraphqlApis to be used by the proxy + * service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "MicrosoftAwsConnecto") + public interface AppSyncGraphqlApisService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.AwsConnector/appSyncGraphqlApis") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/appSyncGraphqlApis") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroup(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/appSyncGraphqlApis/{name}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getByResourceGroup(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("name") String name, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/appSyncGraphqlApis/{name}") + @ExpectedResponses({ 200, 201 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrReplace(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("name") String name, + @BodyParam("application/json") AppSyncGraphqlApiInner resource, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/appSyncGraphqlApis/{name}") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> update(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("name") String name, + @BodyParam("application/json") AppSyncGraphqlApiTagsUpdate properties, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/appSyncGraphqlApis/{name}") + @ExpectedResponses({ 202, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("name") String name, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listBySubscriptionNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroupNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); + } + + /** + * List AppSyncGraphqlApi resources by subscription ID. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a AppSyncGraphqlApi list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync() { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List AppSyncGraphqlApi resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a AppSyncGraphqlApi list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), accept, + context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * List AppSyncGraphqlApi resources by subscription ID. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a AppSyncGraphqlApi list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>(() -> listSinglePageAsync(), + nextLink -> listBySubscriptionNextSinglePageAsync(nextLink)); + } + + /** + * List AppSyncGraphqlApi resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a AppSyncGraphqlApi list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(Context context) { + return new PagedFlux<>(() -> listSinglePageAsync(context), + nextLink -> listBySubscriptionNextSinglePageAsync(nextLink, context)); + } + + /** + * List AppSyncGraphqlApi resources by subscription ID. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a AppSyncGraphqlApi list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + return new PagedIterable<>(listAsync()); + } + + /** + * List AppSyncGraphqlApi resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a AppSyncGraphqlApi list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Context context) { + return new PagedIterable<>(listAsync(context)); + } + + /** + * List AppSyncGraphqlApi resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a AppSyncGraphqlApi list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List AppSyncGraphqlApi resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a AppSyncGraphqlApi list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * List AppSyncGraphqlApi resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a AppSyncGraphqlApi list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName) { + return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); + } + + /** + * List AppSyncGraphqlApi resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a AppSyncGraphqlApi list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName, Context context) { + return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName, context), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink, context)); + } + + /** + * List AppSyncGraphqlApi resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a AppSyncGraphqlApi list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName)); + } + + /** + * List AppSyncGraphqlApi resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a AppSyncGraphqlApi list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, context)); + } + + /** + * Get a AppSyncGraphqlApi. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of AppSyncGraphqlApi. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a AppSyncGraphqlApi along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync(String resourceGroupName, + String name) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.getByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get a AppSyncGraphqlApi. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of AppSyncGraphqlApi. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a AppSyncGraphqlApi along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync(String resourceGroupName, + String name, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.getByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, accept, context); + } + + /** + * Get a AppSyncGraphqlApi. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of AppSyncGraphqlApi. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a AppSyncGraphqlApi on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getByResourceGroupAsync(String resourceGroupName, String name) { + return getByResourceGroupWithResponseAsync(resourceGroupName, name) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Get a AppSyncGraphqlApi. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of AppSyncGraphqlApi. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a AppSyncGraphqlApi along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getByResourceGroupWithResponse(String resourceGroupName, String name, + Context context) { + return getByResourceGroupWithResponseAsync(resourceGroupName, name, context).block(); + } + + /** + * Get a AppSyncGraphqlApi. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of AppSyncGraphqlApi. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a AppSyncGraphqlApi. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public AppSyncGraphqlApiInner getByResourceGroup(String resourceGroupName, String name) { + return getByResourceGroupWithResponse(resourceGroupName, name, Context.NONE).getValue(); + } + + /** + * Create a AppSyncGraphqlApi. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of AppSyncGraphqlApi. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrReplaceWithResponseAsync(String resourceGroupName, String name, + AppSyncGraphqlApiInner resource) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (resource == null) { + return Mono.error(new IllegalArgumentException("Parameter resource is required and cannot be null.")); + } else { + resource.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.createOrReplace(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, resource, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Create a AppSyncGraphqlApi. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of AppSyncGraphqlApi. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrReplaceWithResponseAsync(String resourceGroupName, String name, + AppSyncGraphqlApiInner resource, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (resource == null) { + return Mono.error(new IllegalArgumentException("Parameter resource is required and cannot be null.")); + } else { + resource.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.createOrReplace(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, resource, accept, context); + } + + /** + * Create a AppSyncGraphqlApi. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of AppSyncGraphqlApi. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, AppSyncGraphqlApiInner> + beginCreateOrReplaceAsync(String resourceGroupName, String name, AppSyncGraphqlApiInner resource) { + Mono>> mono = createOrReplaceWithResponseAsync(resourceGroupName, name, resource); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), AppSyncGraphqlApiInner.class, AppSyncGraphqlApiInner.class, + this.client.getContext()); + } + + /** + * Create a AppSyncGraphqlApi. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of AppSyncGraphqlApi. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, AppSyncGraphqlApiInner> beginCreateOrReplaceAsync( + String resourceGroupName, String name, AppSyncGraphqlApiInner resource, Context context) { + context = this.client.mergeContext(context); + Mono>> mono + = createOrReplaceWithResponseAsync(resourceGroupName, name, resource, context); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), AppSyncGraphqlApiInner.class, AppSyncGraphqlApiInner.class, context); + } + + /** + * Create a AppSyncGraphqlApi. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of AppSyncGraphqlApi. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, AppSyncGraphqlApiInner> + beginCreateOrReplace(String resourceGroupName, String name, AppSyncGraphqlApiInner resource) { + return this.beginCreateOrReplaceAsync(resourceGroupName, name, resource).getSyncPoller(); + } + + /** + * Create a AppSyncGraphqlApi. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of AppSyncGraphqlApi. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, AppSyncGraphqlApiInner> + beginCreateOrReplace(String resourceGroupName, String name, AppSyncGraphqlApiInner resource, Context context) { + return this.beginCreateOrReplaceAsync(resourceGroupName, name, resource, context).getSyncPoller(); + } + + /** + * Create a AppSyncGraphqlApi. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of AppSyncGraphqlApi. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrReplaceAsync(String resourceGroupName, String name, + AppSyncGraphqlApiInner resource) { + return beginCreateOrReplaceAsync(resourceGroupName, name, resource).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create a AppSyncGraphqlApi. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of AppSyncGraphqlApi. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrReplaceAsync(String resourceGroupName, String name, + AppSyncGraphqlApiInner resource, Context context) { + return beginCreateOrReplaceAsync(resourceGroupName, name, resource, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create a AppSyncGraphqlApi. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of AppSyncGraphqlApi. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public AppSyncGraphqlApiInner createOrReplace(String resourceGroupName, String name, + AppSyncGraphqlApiInner resource) { + return createOrReplaceAsync(resourceGroupName, name, resource).block(); + } + + /** + * Create a AppSyncGraphqlApi. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of AppSyncGraphqlApi. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public AppSyncGraphqlApiInner createOrReplace(String resourceGroupName, String name, + AppSyncGraphqlApiInner resource, Context context) { + return createOrReplaceAsync(resourceGroupName, name, resource, context).block(); + } + + /** + * Update a AppSyncGraphqlApi. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of AppSyncGraphqlApi. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync(String resourceGroupName, String name, + AppSyncGraphqlApiTagsUpdate properties) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (properties == null) { + return Mono.error(new IllegalArgumentException("Parameter properties is required and cannot be null.")); + } else { + properties.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.update(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, properties, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Update a AppSyncGraphqlApi. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of AppSyncGraphqlApi. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync(String resourceGroupName, String name, + AppSyncGraphqlApiTagsUpdate properties, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (properties == null) { + return Mono.error(new IllegalArgumentException("Parameter properties is required and cannot be null.")); + } else { + properties.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.update(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, name, properties, accept, context); + } + + /** + * Update a AppSyncGraphqlApi. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of AppSyncGraphqlApi. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, AppSyncGraphqlApiInner> + beginUpdateAsync(String resourceGroupName, String name, AppSyncGraphqlApiTagsUpdate properties) { + Mono>> mono = updateWithResponseAsync(resourceGroupName, name, properties); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), AppSyncGraphqlApiInner.class, AppSyncGraphqlApiInner.class, + this.client.getContext()); + } + + /** + * Update a AppSyncGraphqlApi. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of AppSyncGraphqlApi. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, AppSyncGraphqlApiInner> beginUpdateAsync( + String resourceGroupName, String name, AppSyncGraphqlApiTagsUpdate properties, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = updateWithResponseAsync(resourceGroupName, name, properties, context); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), AppSyncGraphqlApiInner.class, AppSyncGraphqlApiInner.class, context); + } + + /** + * Update a AppSyncGraphqlApi. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of AppSyncGraphqlApi. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, AppSyncGraphqlApiInner> beginUpdate(String resourceGroupName, + String name, AppSyncGraphqlApiTagsUpdate properties) { + return this.beginUpdateAsync(resourceGroupName, name, properties).getSyncPoller(); + } + + /** + * Update a AppSyncGraphqlApi. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of AppSyncGraphqlApi. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, AppSyncGraphqlApiInner> beginUpdate(String resourceGroupName, + String name, AppSyncGraphqlApiTagsUpdate properties, Context context) { + return this.beginUpdateAsync(resourceGroupName, name, properties, context).getSyncPoller(); + } + + /** + * Update a AppSyncGraphqlApi. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of AppSyncGraphqlApi. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync(String resourceGroupName, String name, + AppSyncGraphqlApiTagsUpdate properties) { + return beginUpdateAsync(resourceGroupName, name, properties).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Update a AppSyncGraphqlApi. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of AppSyncGraphqlApi. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync(String resourceGroupName, String name, + AppSyncGraphqlApiTagsUpdate properties, Context context) { + return beginUpdateAsync(resourceGroupName, name, properties, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Update a AppSyncGraphqlApi. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of AppSyncGraphqlApi. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public AppSyncGraphqlApiInner update(String resourceGroupName, String name, + AppSyncGraphqlApiTagsUpdate properties) { + return updateAsync(resourceGroupName, name, properties).block(); + } + + /** + * Update a AppSyncGraphqlApi. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of AppSyncGraphqlApi. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public AppSyncGraphqlApiInner update(String resourceGroupName, String name, AppSyncGraphqlApiTagsUpdate properties, + Context context) { + return updateAsync(resourceGroupName, name, properties, context).block(); + } + + /** + * Delete a AppSyncGraphqlApi. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of AppSyncGraphqlApi. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync(String resourceGroupName, String name) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Delete a AppSyncGraphqlApi. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of AppSyncGraphqlApi. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync(String resourceGroupName, String name, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.delete(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, name, accept, context); + } + + /** + * Delete a AppSyncGraphqlApi. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of AppSyncGraphqlApi. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String name) { + Mono>> mono = deleteWithResponseAsync(resourceGroupName, name); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); + } + + /** + * Delete a AppSyncGraphqlApi. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of AppSyncGraphqlApi. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String name, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = deleteWithResponseAsync(resourceGroupName, name, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + context); + } + + /** + * Delete a AppSyncGraphqlApi. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of AppSyncGraphqlApi. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String name) { + return this.beginDeleteAsync(resourceGroupName, name).getSyncPoller(); + } + + /** + * Delete a AppSyncGraphqlApi. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of AppSyncGraphqlApi. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String name, Context context) { + return this.beginDeleteAsync(resourceGroupName, name, context).getSyncPoller(); + } + + /** + * Delete a AppSyncGraphqlApi. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of AppSyncGraphqlApi. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String name) { + return beginDeleteAsync(resourceGroupName, name).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete a AppSyncGraphqlApi. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of AppSyncGraphqlApi. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String name, Context context) { + return beginDeleteAsync(resourceGroupName, name, context).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete a AppSyncGraphqlApi. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of AppSyncGraphqlApi. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String name) { + deleteAsync(resourceGroupName, name).block(); + } + + /** + * Delete a AppSyncGraphqlApi. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of AppSyncGraphqlApi. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String name, Context context) { + deleteAsync(resourceGroupName, name, context).block(); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a AppSyncGraphqlApi list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listBySubscriptionNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a AppSyncGraphqlApi list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listBySubscriptionNextSinglePageAsync(String nextLink, + Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a AppSyncGraphqlApi list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a AppSyncGraphqlApi list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupNextSinglePageAsync(String nextLink, + Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/AppSyncGraphqlApisImpl.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/AppSyncGraphqlApisImpl.java new file mode 100644 index 000000000000..6cb6f53415f5 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/AppSyncGraphqlApisImpl.java @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.awsconnector.fluent.AppSyncGraphqlApisClient; +import com.azure.resourcemanager.awsconnector.fluent.models.AppSyncGraphqlApiInner; +import com.azure.resourcemanager.awsconnector.models.AppSyncGraphqlApi; +import com.azure.resourcemanager.awsconnector.models.AppSyncGraphqlApis; + +public final class AppSyncGraphqlApisImpl implements AppSyncGraphqlApis { + private static final ClientLogger LOGGER = new ClientLogger(AppSyncGraphqlApisImpl.class); + + private final AppSyncGraphqlApisClient innerClient; + + private final com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager; + + public AppSyncGraphqlApisImpl(AppSyncGraphqlApisClient innerClient, + com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return ResourceManagerUtils.mapPage(inner, inner1 -> new AppSyncGraphqlApiImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new AppSyncGraphqlApiImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName); + return ResourceManagerUtils.mapPage(inner, inner1 -> new AppSyncGraphqlApiImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + PagedIterable inner + = this.serviceClient().listByResourceGroup(resourceGroupName, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new AppSyncGraphqlApiImpl(inner1, this.manager())); + } + + public Response getByResourceGroupWithResponse(String resourceGroupName, String name, + Context context) { + Response inner + = this.serviceClient().getByResourceGroupWithResponse(resourceGroupName, name, context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new AppSyncGraphqlApiImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public AppSyncGraphqlApi getByResourceGroup(String resourceGroupName, String name) { + AppSyncGraphqlApiInner inner = this.serviceClient().getByResourceGroup(resourceGroupName, name); + if (inner != null) { + return new AppSyncGraphqlApiImpl(inner, this.manager()); + } else { + return null; + } + } + + public void deleteByResourceGroup(String resourceGroupName, String name) { + this.serviceClient().delete(resourceGroupName, name); + } + + public void delete(String resourceGroupName, String name, Context context) { + this.serviceClient().delete(resourceGroupName, name, context); + } + + public AppSyncGraphqlApi getById(String id) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String name = ResourceManagerUtils.getValueFromIdByName(id, "appSyncGraphqlApis"); + if (name == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'appSyncGraphqlApis'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, name, Context.NONE).getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String name = ResourceManagerUtils.getValueFromIdByName(id, "appSyncGraphqlApis"); + if (name == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'appSyncGraphqlApis'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, name, context); + } + + public void deleteById(String id) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String name = ResourceManagerUtils.getValueFromIdByName(id, "appSyncGraphqlApis"); + if (name == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'appSyncGraphqlApis'.", id))); + } + this.delete(resourceGroupName, name, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String name = ResourceManagerUtils.getValueFromIdByName(id, "appSyncGraphqlApis"); + if (name == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'appSyncGraphqlApis'.", id))); + } + this.delete(resourceGroupName, name, context); + } + + private AppSyncGraphqlApisClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.awsconnector.AwsconnectorManager manager() { + return this.serviceManager; + } + + public AppSyncGraphqlApiImpl define(String name) { + return new AppSyncGraphqlApiImpl(name, this.manager()); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/AutoScalingAutoScalingGroupsClientImpl.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/AutoScalingAutoScalingGroupsClientImpl.java new file mode 100644 index 000000000000..ae9eb3c23713 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/AutoScalingAutoScalingGroupsClientImpl.java @@ -0,0 +1,1289 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.Patch; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.awsconnector.fluent.AutoScalingAutoScalingGroupsClient; +import com.azure.resourcemanager.awsconnector.fluent.models.AutoScalingGroupInner; +import com.azure.resourcemanager.awsconnector.models.AutoScalingGroupListResult; +import com.azure.resourcemanager.awsconnector.models.AutoScalingGroupTagsUpdate; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in AutoScalingAutoScalingGroupsClient. + */ +public final class AutoScalingAutoScalingGroupsClientImpl implements AutoScalingAutoScalingGroupsClient { + /** + * The proxy service used to perform REST calls. + */ + private final AutoScalingAutoScalingGroupsService service; + + /** + * The service client containing this operation class. + */ + private final MicrosoftAwsConnectorImpl client; + + /** + * Initializes an instance of AutoScalingAutoScalingGroupsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + AutoScalingAutoScalingGroupsClientImpl(MicrosoftAwsConnectorImpl client) { + this.service = RestProxy.create(AutoScalingAutoScalingGroupsService.class, client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for MicrosoftAwsConnectorAutoScalingAutoScalingGroups to be used by the + * proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "MicrosoftAwsConnecto") + public interface AutoScalingAutoScalingGroupsService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.AwsConnector/autoScalingAutoScalingGroups") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/autoScalingAutoScalingGroups") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroup(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/autoScalingAutoScalingGroups/{name}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getByResourceGroup(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("name") String name, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/autoScalingAutoScalingGroups/{name}") + @ExpectedResponses({ 200, 201 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrReplace(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("name") String name, + @BodyParam("application/json") AutoScalingGroupInner resource, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/autoScalingAutoScalingGroups/{name}") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> update(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("name") String name, + @BodyParam("application/json") AutoScalingGroupTagsUpdate properties, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/autoScalingAutoScalingGroups/{name}") + @ExpectedResponses({ 202, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("name") String name, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listBySubscriptionNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroupNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); + } + + /** + * List AutoScalingAutoScalingGroup resources by subscription ID. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a AutoScalingAutoScalingGroup list operation along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync() { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List AutoScalingAutoScalingGroup resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a AutoScalingAutoScalingGroup list operation along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), accept, + context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * List AutoScalingAutoScalingGroup resources by subscription ID. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a AutoScalingAutoScalingGroup list operation as paginated response with + * {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>(() -> listSinglePageAsync(), + nextLink -> listBySubscriptionNextSinglePageAsync(nextLink)); + } + + /** + * List AutoScalingAutoScalingGroup resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a AutoScalingAutoScalingGroup list operation as paginated response with + * {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(Context context) { + return new PagedFlux<>(() -> listSinglePageAsync(context), + nextLink -> listBySubscriptionNextSinglePageAsync(nextLink, context)); + } + + /** + * List AutoScalingAutoScalingGroup resources by subscription ID. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a AutoScalingAutoScalingGroup list operation as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + return new PagedIterable<>(listAsync()); + } + + /** + * List AutoScalingAutoScalingGroup resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a AutoScalingAutoScalingGroup list operation as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Context context) { + return new PagedIterable<>(listAsync(context)); + } + + /** + * List AutoScalingAutoScalingGroup resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a AutoScalingAutoScalingGroup list operation along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List AutoScalingAutoScalingGroup resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a AutoScalingAutoScalingGroup list operation along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * List AutoScalingAutoScalingGroup resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a AutoScalingAutoScalingGroup list operation as paginated response with + * {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName) { + return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); + } + + /** + * List AutoScalingAutoScalingGroup resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a AutoScalingAutoScalingGroup list operation as paginated response with + * {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName, Context context) { + return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName, context), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink, context)); + } + + /** + * List AutoScalingAutoScalingGroup resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a AutoScalingAutoScalingGroup list operation as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName)); + } + + /** + * List AutoScalingAutoScalingGroup resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a AutoScalingAutoScalingGroup list operation as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, context)); + } + + /** + * Get a AutoScalingAutoScalingGroup. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of AutoScalingAutoScalingGroup. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a AutoScalingAutoScalingGroup along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync(String resourceGroupName, + String name) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.getByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get a AutoScalingAutoScalingGroup. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of AutoScalingAutoScalingGroup. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a AutoScalingAutoScalingGroup along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync(String resourceGroupName, + String name, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.getByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, accept, context); + } + + /** + * Get a AutoScalingAutoScalingGroup. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of AutoScalingAutoScalingGroup. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a AutoScalingAutoScalingGroup on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getByResourceGroupAsync(String resourceGroupName, String name) { + return getByResourceGroupWithResponseAsync(resourceGroupName, name) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Get a AutoScalingAutoScalingGroup. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of AutoScalingAutoScalingGroup. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a AutoScalingAutoScalingGroup along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getByResourceGroupWithResponse(String resourceGroupName, String name, + Context context) { + return getByResourceGroupWithResponseAsync(resourceGroupName, name, context).block(); + } + + /** + * Get a AutoScalingAutoScalingGroup. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of AutoScalingAutoScalingGroup. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a AutoScalingAutoScalingGroup. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public AutoScalingGroupInner getByResourceGroup(String resourceGroupName, String name) { + return getByResourceGroupWithResponse(resourceGroupName, name, Context.NONE).getValue(); + } + + /** + * Create a AutoScalingAutoScalingGroup. Please note that end user resource creation is currently restricted, but it + * will be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of AutoScalingAutoScalingGroup. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrReplaceWithResponseAsync(String resourceGroupName, String name, + AutoScalingGroupInner resource) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (resource == null) { + return Mono.error(new IllegalArgumentException("Parameter resource is required and cannot be null.")); + } else { + resource.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.createOrReplace(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, resource, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Create a AutoScalingAutoScalingGroup. Please note that end user resource creation is currently restricted, but it + * will be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of AutoScalingAutoScalingGroup. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrReplaceWithResponseAsync(String resourceGroupName, String name, + AutoScalingGroupInner resource, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (resource == null) { + return Mono.error(new IllegalArgumentException("Parameter resource is required and cannot be null.")); + } else { + resource.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.createOrReplace(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, resource, accept, context); + } + + /** + * Create a AutoScalingAutoScalingGroup. Please note that end user resource creation is currently restricted, but it + * will be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of AutoScalingAutoScalingGroup. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, AutoScalingGroupInner> + beginCreateOrReplaceAsync(String resourceGroupName, String name, AutoScalingGroupInner resource) { + Mono>> mono = createOrReplaceWithResponseAsync(resourceGroupName, name, resource); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), AutoScalingGroupInner.class, AutoScalingGroupInner.class, + this.client.getContext()); + } + + /** + * Create a AutoScalingAutoScalingGroup. Please note that end user resource creation is currently restricted, but it + * will be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of AutoScalingAutoScalingGroup. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, AutoScalingGroupInner> beginCreateOrReplaceAsync( + String resourceGroupName, String name, AutoScalingGroupInner resource, Context context) { + context = this.client.mergeContext(context); + Mono>> mono + = createOrReplaceWithResponseAsync(resourceGroupName, name, resource, context); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), AutoScalingGroupInner.class, AutoScalingGroupInner.class, context); + } + + /** + * Create a AutoScalingAutoScalingGroup. Please note that end user resource creation is currently restricted, but it + * will be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of AutoScalingAutoScalingGroup. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, AutoScalingGroupInner> + beginCreateOrReplace(String resourceGroupName, String name, AutoScalingGroupInner resource) { + return this.beginCreateOrReplaceAsync(resourceGroupName, name, resource).getSyncPoller(); + } + + /** + * Create a AutoScalingAutoScalingGroup. Please note that end user resource creation is currently restricted, but it + * will be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of AutoScalingAutoScalingGroup. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, AutoScalingGroupInner> + beginCreateOrReplace(String resourceGroupName, String name, AutoScalingGroupInner resource, Context context) { + return this.beginCreateOrReplaceAsync(resourceGroupName, name, resource, context).getSyncPoller(); + } + + /** + * Create a AutoScalingAutoScalingGroup. Please note that end user resource creation is currently restricted, but it + * will be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of AutoScalingAutoScalingGroup. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrReplaceAsync(String resourceGroupName, String name, + AutoScalingGroupInner resource) { + return beginCreateOrReplaceAsync(resourceGroupName, name, resource).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create a AutoScalingAutoScalingGroup. Please note that end user resource creation is currently restricted, but it + * will be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of AutoScalingAutoScalingGroup. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrReplaceAsync(String resourceGroupName, String name, + AutoScalingGroupInner resource, Context context) { + return beginCreateOrReplaceAsync(resourceGroupName, name, resource, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create a AutoScalingAutoScalingGroup. Please note that end user resource creation is currently restricted, but it + * will be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of AutoScalingAutoScalingGroup. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public AutoScalingGroupInner createOrReplace(String resourceGroupName, String name, + AutoScalingGroupInner resource) { + return createOrReplaceAsync(resourceGroupName, name, resource).block(); + } + + /** + * Create a AutoScalingAutoScalingGroup. Please note that end user resource creation is currently restricted, but it + * will be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of AutoScalingAutoScalingGroup. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public AutoScalingGroupInner createOrReplace(String resourceGroupName, String name, AutoScalingGroupInner resource, + Context context) { + return createOrReplaceAsync(resourceGroupName, name, resource, context).block(); + } + + /** + * Update a AutoScalingAutoScalingGroup. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of AutoScalingAutoScalingGroup. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync(String resourceGroupName, String name, + AutoScalingGroupTagsUpdate properties) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (properties == null) { + return Mono.error(new IllegalArgumentException("Parameter properties is required and cannot be null.")); + } else { + properties.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.update(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, properties, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Update a AutoScalingAutoScalingGroup. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of AutoScalingAutoScalingGroup. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync(String resourceGroupName, String name, + AutoScalingGroupTagsUpdate properties, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (properties == null) { + return Mono.error(new IllegalArgumentException("Parameter properties is required and cannot be null.")); + } else { + properties.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.update(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, name, properties, accept, context); + } + + /** + * Update a AutoScalingAutoScalingGroup. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of AutoScalingAutoScalingGroup. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, AutoScalingGroupInner> + beginUpdateAsync(String resourceGroupName, String name, AutoScalingGroupTagsUpdate properties) { + Mono>> mono = updateWithResponseAsync(resourceGroupName, name, properties); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), AutoScalingGroupInner.class, AutoScalingGroupInner.class, + this.client.getContext()); + } + + /** + * Update a AutoScalingAutoScalingGroup. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of AutoScalingAutoScalingGroup. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, AutoScalingGroupInner> beginUpdateAsync( + String resourceGroupName, String name, AutoScalingGroupTagsUpdate properties, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = updateWithResponseAsync(resourceGroupName, name, properties, context); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), AutoScalingGroupInner.class, AutoScalingGroupInner.class, context); + } + + /** + * Update a AutoScalingAutoScalingGroup. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of AutoScalingAutoScalingGroup. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, AutoScalingGroupInner> beginUpdate(String resourceGroupName, + String name, AutoScalingGroupTagsUpdate properties) { + return this.beginUpdateAsync(resourceGroupName, name, properties).getSyncPoller(); + } + + /** + * Update a AutoScalingAutoScalingGroup. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of AutoScalingAutoScalingGroup. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, AutoScalingGroupInner> beginUpdate(String resourceGroupName, + String name, AutoScalingGroupTagsUpdate properties, Context context) { + return this.beginUpdateAsync(resourceGroupName, name, properties, context).getSyncPoller(); + } + + /** + * Update a AutoScalingAutoScalingGroup. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of AutoScalingAutoScalingGroup. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync(String resourceGroupName, String name, + AutoScalingGroupTagsUpdate properties) { + return beginUpdateAsync(resourceGroupName, name, properties).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Update a AutoScalingAutoScalingGroup. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of AutoScalingAutoScalingGroup. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync(String resourceGroupName, String name, + AutoScalingGroupTagsUpdate properties, Context context) { + return beginUpdateAsync(resourceGroupName, name, properties, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Update a AutoScalingAutoScalingGroup. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of AutoScalingAutoScalingGroup. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public AutoScalingGroupInner update(String resourceGroupName, String name, AutoScalingGroupTagsUpdate properties) { + return updateAsync(resourceGroupName, name, properties).block(); + } + + /** + * Update a AutoScalingAutoScalingGroup. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of AutoScalingAutoScalingGroup. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public AutoScalingGroupInner update(String resourceGroupName, String name, AutoScalingGroupTagsUpdate properties, + Context context) { + return updateAsync(resourceGroupName, name, properties, context).block(); + } + + /** + * Delete a AutoScalingAutoScalingGroup. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of AutoScalingAutoScalingGroup. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync(String resourceGroupName, String name) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Delete a AutoScalingAutoScalingGroup. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of AutoScalingAutoScalingGroup. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync(String resourceGroupName, String name, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.delete(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, name, accept, context); + } + + /** + * Delete a AutoScalingAutoScalingGroup. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of AutoScalingAutoScalingGroup. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String name) { + Mono>> mono = deleteWithResponseAsync(resourceGroupName, name); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); + } + + /** + * Delete a AutoScalingAutoScalingGroup. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of AutoScalingAutoScalingGroup. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String name, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = deleteWithResponseAsync(resourceGroupName, name, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + context); + } + + /** + * Delete a AutoScalingAutoScalingGroup. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of AutoScalingAutoScalingGroup. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String name) { + return this.beginDeleteAsync(resourceGroupName, name).getSyncPoller(); + } + + /** + * Delete a AutoScalingAutoScalingGroup. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of AutoScalingAutoScalingGroup. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String name, Context context) { + return this.beginDeleteAsync(resourceGroupName, name, context).getSyncPoller(); + } + + /** + * Delete a AutoScalingAutoScalingGroup. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of AutoScalingAutoScalingGroup. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String name) { + return beginDeleteAsync(resourceGroupName, name).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete a AutoScalingAutoScalingGroup. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of AutoScalingAutoScalingGroup. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String name, Context context) { + return beginDeleteAsync(resourceGroupName, name, context).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete a AutoScalingAutoScalingGroup. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of AutoScalingAutoScalingGroup. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String name) { + deleteAsync(resourceGroupName, name).block(); + } + + /** + * Delete a AutoScalingAutoScalingGroup. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of AutoScalingAutoScalingGroup. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String name, Context context) { + deleteAsync(resourceGroupName, name, context).block(); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a AutoScalingAutoScalingGroup list operation along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listBySubscriptionNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a AutoScalingAutoScalingGroup list operation along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listBySubscriptionNextSinglePageAsync(String nextLink, + Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a AutoScalingAutoScalingGroup list operation along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a AutoScalingAutoScalingGroup list operation along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupNextSinglePageAsync(String nextLink, + Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/AutoScalingAutoScalingGroupsImpl.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/AutoScalingAutoScalingGroupsImpl.java new file mode 100644 index 000000000000..ddae0aa44ef8 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/AutoScalingAutoScalingGroupsImpl.java @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.awsconnector.fluent.AutoScalingAutoScalingGroupsClient; +import com.azure.resourcemanager.awsconnector.fluent.models.AutoScalingGroupInner; +import com.azure.resourcemanager.awsconnector.models.AutoScalingAutoScalingGroups; +import com.azure.resourcemanager.awsconnector.models.AutoScalingGroup; + +public final class AutoScalingAutoScalingGroupsImpl implements AutoScalingAutoScalingGroups { + private static final ClientLogger LOGGER = new ClientLogger(AutoScalingAutoScalingGroupsImpl.class); + + private final AutoScalingAutoScalingGroupsClient innerClient; + + private final com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager; + + public AutoScalingAutoScalingGroupsImpl(AutoScalingAutoScalingGroupsClient innerClient, + com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return ResourceManagerUtils.mapPage(inner, inner1 -> new AutoScalingGroupImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new AutoScalingGroupImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName); + return ResourceManagerUtils.mapPage(inner, inner1 -> new AutoScalingGroupImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + PagedIterable inner + = this.serviceClient().listByResourceGroup(resourceGroupName, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new AutoScalingGroupImpl(inner1, this.manager())); + } + + public Response getByResourceGroupWithResponse(String resourceGroupName, String name, + Context context) { + Response inner + = this.serviceClient().getByResourceGroupWithResponse(resourceGroupName, name, context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new AutoScalingGroupImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public AutoScalingGroup getByResourceGroup(String resourceGroupName, String name) { + AutoScalingGroupInner inner = this.serviceClient().getByResourceGroup(resourceGroupName, name); + if (inner != null) { + return new AutoScalingGroupImpl(inner, this.manager()); + } else { + return null; + } + } + + public void deleteByResourceGroup(String resourceGroupName, String name) { + this.serviceClient().delete(resourceGroupName, name); + } + + public void delete(String resourceGroupName, String name, Context context) { + this.serviceClient().delete(resourceGroupName, name, context); + } + + public AutoScalingGroup getById(String id) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String name = ResourceManagerUtils.getValueFromIdByName(id, "autoScalingAutoScalingGroups"); + if (name == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException(String.format( + "The resource ID '%s' is not valid. Missing path segment 'autoScalingAutoScalingGroups'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, name, Context.NONE).getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String name = ResourceManagerUtils.getValueFromIdByName(id, "autoScalingAutoScalingGroups"); + if (name == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException(String.format( + "The resource ID '%s' is not valid. Missing path segment 'autoScalingAutoScalingGroups'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, name, context); + } + + public void deleteById(String id) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String name = ResourceManagerUtils.getValueFromIdByName(id, "autoScalingAutoScalingGroups"); + if (name == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException(String.format( + "The resource ID '%s' is not valid. Missing path segment 'autoScalingAutoScalingGroups'.", id))); + } + this.delete(resourceGroupName, name, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String name = ResourceManagerUtils.getValueFromIdByName(id, "autoScalingAutoScalingGroups"); + if (name == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException(String.format( + "The resource ID '%s' is not valid. Missing path segment 'autoScalingAutoScalingGroups'.", id))); + } + this.delete(resourceGroupName, name, context); + } + + private AutoScalingAutoScalingGroupsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.awsconnector.AwsconnectorManager manager() { + return this.serviceManager; + } + + public AutoScalingGroupImpl define(String name) { + return new AutoScalingGroupImpl(name, this.manager()); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/AutoScalingGroupImpl.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/AutoScalingGroupImpl.java new file mode 100644 index 000000000000..f8feeec14031 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/AutoScalingGroupImpl.java @@ -0,0 +1,178 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.implementation; + +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.awsconnector.fluent.models.AutoScalingGroupInner; +import com.azure.resourcemanager.awsconnector.models.AutoScalingGroup; +import com.azure.resourcemanager.awsconnector.models.AutoScalingGroupProperties; +import com.azure.resourcemanager.awsconnector.models.AutoScalingGroupTagsUpdate; +import java.util.Collections; +import java.util.Map; + +public final class AutoScalingGroupImpl + implements AutoScalingGroup, AutoScalingGroup.Definition, AutoScalingGroup.Update { + private AutoScalingGroupInner innerObject; + + private final com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public String location() { + return this.innerModel().location(); + } + + public Map tags() { + Map inner = this.innerModel().tags(); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } + } + + public AutoScalingGroupProperties properties() { + return this.innerModel().properties(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public String resourceGroupName() { + return resourceGroupName; + } + + public AutoScalingGroupInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.awsconnector.AwsconnectorManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String name; + + private AutoScalingGroupTagsUpdate updateProperties; + + public AutoScalingGroupImpl withExistingResourceGroup(String resourceGroupName) { + this.resourceGroupName = resourceGroupName; + return this; + } + + public AutoScalingGroup create() { + this.innerObject = serviceManager.serviceClient() + .getAutoScalingAutoScalingGroups() + .createOrReplace(resourceGroupName, name, this.innerModel(), Context.NONE); + return this; + } + + public AutoScalingGroup create(Context context) { + this.innerObject = serviceManager.serviceClient() + .getAutoScalingAutoScalingGroups() + .createOrReplace(resourceGroupName, name, this.innerModel(), context); + return this; + } + + AutoScalingGroupImpl(String name, com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager) { + this.innerObject = new AutoScalingGroupInner(); + this.serviceManager = serviceManager; + this.name = name; + } + + public AutoScalingGroupImpl update() { + this.updateProperties = new AutoScalingGroupTagsUpdate(); + return this; + } + + public AutoScalingGroup apply() { + this.innerObject = serviceManager.serviceClient() + .getAutoScalingAutoScalingGroups() + .update(resourceGroupName, name, updateProperties, Context.NONE); + return this; + } + + public AutoScalingGroup apply(Context context) { + this.innerObject = serviceManager.serviceClient() + .getAutoScalingAutoScalingGroups() + .update(resourceGroupName, name, updateProperties, context); + return this; + } + + AutoScalingGroupImpl(AutoScalingGroupInner innerObject, + com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.name = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "autoScalingAutoScalingGroups"); + } + + public AutoScalingGroup refresh() { + this.innerObject = serviceManager.serviceClient() + .getAutoScalingAutoScalingGroups() + .getByResourceGroupWithResponse(resourceGroupName, name, Context.NONE) + .getValue(); + return this; + } + + public AutoScalingGroup refresh(Context context) { + this.innerObject = serviceManager.serviceClient() + .getAutoScalingAutoScalingGroups() + .getByResourceGroupWithResponse(resourceGroupName, name, context) + .getValue(); + return this; + } + + public AutoScalingGroupImpl withRegion(Region location) { + this.innerModel().withLocation(location.toString()); + return this; + } + + public AutoScalingGroupImpl withRegion(String location) { + this.innerModel().withLocation(location); + return this; + } + + public AutoScalingGroupImpl withTags(Map tags) { + if (isInCreateMode()) { + this.innerModel().withTags(tags); + return this; + } else { + this.updateProperties.withTags(tags); + return this; + } + } + + public AutoScalingGroupImpl withProperties(AutoScalingGroupProperties properties) { + this.innerModel().withProperties(properties); + return this; + } + + private boolean isInCreateMode() { + return this.innerModel().id() == null; + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/CloudFormationStackImpl.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/CloudFormationStackImpl.java new file mode 100644 index 000000000000..dfd8ea40c10f --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/CloudFormationStackImpl.java @@ -0,0 +1,178 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.implementation; + +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.awsconnector.fluent.models.CloudFormationStackInner; +import com.azure.resourcemanager.awsconnector.models.CloudFormationStack; +import com.azure.resourcemanager.awsconnector.models.CloudFormationStackProperties; +import com.azure.resourcemanager.awsconnector.models.CloudFormationStackTagsUpdate; +import java.util.Collections; +import java.util.Map; + +public final class CloudFormationStackImpl + implements CloudFormationStack, CloudFormationStack.Definition, CloudFormationStack.Update { + private CloudFormationStackInner innerObject; + + private final com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public String location() { + return this.innerModel().location(); + } + + public Map tags() { + Map inner = this.innerModel().tags(); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } + } + + public CloudFormationStackProperties properties() { + return this.innerModel().properties(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public String resourceGroupName() { + return resourceGroupName; + } + + public CloudFormationStackInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.awsconnector.AwsconnectorManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String name; + + private CloudFormationStackTagsUpdate updateProperties; + + public CloudFormationStackImpl withExistingResourceGroup(String resourceGroupName) { + this.resourceGroupName = resourceGroupName; + return this; + } + + public CloudFormationStack create() { + this.innerObject = serviceManager.serviceClient() + .getCloudFormationStacks() + .createOrReplace(resourceGroupName, name, this.innerModel(), Context.NONE); + return this; + } + + public CloudFormationStack create(Context context) { + this.innerObject = serviceManager.serviceClient() + .getCloudFormationStacks() + .createOrReplace(resourceGroupName, name, this.innerModel(), context); + return this; + } + + CloudFormationStackImpl(String name, com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager) { + this.innerObject = new CloudFormationStackInner(); + this.serviceManager = serviceManager; + this.name = name; + } + + public CloudFormationStackImpl update() { + this.updateProperties = new CloudFormationStackTagsUpdate(); + return this; + } + + public CloudFormationStack apply() { + this.innerObject = serviceManager.serviceClient() + .getCloudFormationStacks() + .update(resourceGroupName, name, updateProperties, Context.NONE); + return this; + } + + public CloudFormationStack apply(Context context) { + this.innerObject = serviceManager.serviceClient() + .getCloudFormationStacks() + .update(resourceGroupName, name, updateProperties, context); + return this; + } + + CloudFormationStackImpl(CloudFormationStackInner innerObject, + com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.name = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "cloudFormationStacks"); + } + + public CloudFormationStack refresh() { + this.innerObject = serviceManager.serviceClient() + .getCloudFormationStacks() + .getByResourceGroupWithResponse(resourceGroupName, name, Context.NONE) + .getValue(); + return this; + } + + public CloudFormationStack refresh(Context context) { + this.innerObject = serviceManager.serviceClient() + .getCloudFormationStacks() + .getByResourceGroupWithResponse(resourceGroupName, name, context) + .getValue(); + return this; + } + + public CloudFormationStackImpl withRegion(Region location) { + this.innerModel().withLocation(location.toString()); + return this; + } + + public CloudFormationStackImpl withRegion(String location) { + this.innerModel().withLocation(location); + return this; + } + + public CloudFormationStackImpl withTags(Map tags) { + if (isInCreateMode()) { + this.innerModel().withTags(tags); + return this; + } else { + this.updateProperties.withTags(tags); + return this; + } + } + + public CloudFormationStackImpl withProperties(CloudFormationStackProperties properties) { + this.innerModel().withProperties(properties); + return this; + } + + private boolean isInCreateMode() { + return this.innerModel().id() == null; + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/CloudFormationStackSetImpl.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/CloudFormationStackSetImpl.java new file mode 100644 index 000000000000..9e683ea9643a --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/CloudFormationStackSetImpl.java @@ -0,0 +1,178 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.implementation; + +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.awsconnector.fluent.models.CloudFormationStackSetInner; +import com.azure.resourcemanager.awsconnector.models.CloudFormationStackSet; +import com.azure.resourcemanager.awsconnector.models.CloudFormationStackSetProperties; +import com.azure.resourcemanager.awsconnector.models.CloudFormationStackSetTagsUpdate; +import java.util.Collections; +import java.util.Map; + +public final class CloudFormationStackSetImpl + implements CloudFormationStackSet, CloudFormationStackSet.Definition, CloudFormationStackSet.Update { + private CloudFormationStackSetInner innerObject; + + private final com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public String location() { + return this.innerModel().location(); + } + + public Map tags() { + Map inner = this.innerModel().tags(); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } + } + + public CloudFormationStackSetProperties properties() { + return this.innerModel().properties(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public String resourceGroupName() { + return resourceGroupName; + } + + public CloudFormationStackSetInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.awsconnector.AwsconnectorManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String name; + + private CloudFormationStackSetTagsUpdate updateProperties; + + public CloudFormationStackSetImpl withExistingResourceGroup(String resourceGroupName) { + this.resourceGroupName = resourceGroupName; + return this; + } + + public CloudFormationStackSet create() { + this.innerObject = serviceManager.serviceClient() + .getCloudFormationStackSets() + .createOrReplace(resourceGroupName, name, this.innerModel(), Context.NONE); + return this; + } + + public CloudFormationStackSet create(Context context) { + this.innerObject = serviceManager.serviceClient() + .getCloudFormationStackSets() + .createOrReplace(resourceGroupName, name, this.innerModel(), context); + return this; + } + + CloudFormationStackSetImpl(String name, com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager) { + this.innerObject = new CloudFormationStackSetInner(); + this.serviceManager = serviceManager; + this.name = name; + } + + public CloudFormationStackSetImpl update() { + this.updateProperties = new CloudFormationStackSetTagsUpdate(); + return this; + } + + public CloudFormationStackSet apply() { + this.innerObject = serviceManager.serviceClient() + .getCloudFormationStackSets() + .update(resourceGroupName, name, updateProperties, Context.NONE); + return this; + } + + public CloudFormationStackSet apply(Context context) { + this.innerObject = serviceManager.serviceClient() + .getCloudFormationStackSets() + .update(resourceGroupName, name, updateProperties, context); + return this; + } + + CloudFormationStackSetImpl(CloudFormationStackSetInner innerObject, + com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.name = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "cloudFormationStackSets"); + } + + public CloudFormationStackSet refresh() { + this.innerObject = serviceManager.serviceClient() + .getCloudFormationStackSets() + .getByResourceGroupWithResponse(resourceGroupName, name, Context.NONE) + .getValue(); + return this; + } + + public CloudFormationStackSet refresh(Context context) { + this.innerObject = serviceManager.serviceClient() + .getCloudFormationStackSets() + .getByResourceGroupWithResponse(resourceGroupName, name, context) + .getValue(); + return this; + } + + public CloudFormationStackSetImpl withRegion(Region location) { + this.innerModel().withLocation(location.toString()); + return this; + } + + public CloudFormationStackSetImpl withRegion(String location) { + this.innerModel().withLocation(location); + return this; + } + + public CloudFormationStackSetImpl withTags(Map tags) { + if (isInCreateMode()) { + this.innerModel().withTags(tags); + return this; + } else { + this.updateProperties.withTags(tags); + return this; + } + } + + public CloudFormationStackSetImpl withProperties(CloudFormationStackSetProperties properties) { + this.innerModel().withProperties(properties); + return this; + } + + private boolean isInCreateMode() { + return this.innerModel().id() == null; + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/CloudFormationStackSetsClientImpl.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/CloudFormationStackSetsClientImpl.java new file mode 100644 index 000000000000..b069bb595a4e --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/CloudFormationStackSetsClientImpl.java @@ -0,0 +1,1285 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.Patch; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.awsconnector.fluent.CloudFormationStackSetsClient; +import com.azure.resourcemanager.awsconnector.fluent.models.CloudFormationStackSetInner; +import com.azure.resourcemanager.awsconnector.models.CloudFormationStackSetListResult; +import com.azure.resourcemanager.awsconnector.models.CloudFormationStackSetTagsUpdate; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in CloudFormationStackSetsClient. + */ +public final class CloudFormationStackSetsClientImpl implements CloudFormationStackSetsClient { + /** + * The proxy service used to perform REST calls. + */ + private final CloudFormationStackSetsService service; + + /** + * The service client containing this operation class. + */ + private final MicrosoftAwsConnectorImpl client; + + /** + * Initializes an instance of CloudFormationStackSetsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + CloudFormationStackSetsClientImpl(MicrosoftAwsConnectorImpl client) { + this.service = RestProxy.create(CloudFormationStackSetsService.class, client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for MicrosoftAwsConnectorCloudFormationStackSets to be used by the proxy + * service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "MicrosoftAwsConnecto") + public interface CloudFormationStackSetsService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.AwsConnector/cloudFormationStackSets") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/cloudFormationStackSets") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroup(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/cloudFormationStackSets/{name}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getByResourceGroup(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("name") String name, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/cloudFormationStackSets/{name}") + @ExpectedResponses({ 200, 201 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrReplace(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("name") String name, + @BodyParam("application/json") CloudFormationStackSetInner resource, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/cloudFormationStackSets/{name}") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> update(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("name") String name, + @BodyParam("application/json") CloudFormationStackSetTagsUpdate properties, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/cloudFormationStackSets/{name}") + @ExpectedResponses({ 202, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("name") String name, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listBySubscriptionNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroupNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); + } + + /** + * List CloudFormationStackSet resources by subscription ID. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a CloudFormationStackSet list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync() { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List CloudFormationStackSet resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a CloudFormationStackSet list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), accept, + context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * List CloudFormationStackSet resources by subscription ID. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a CloudFormationStackSet list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>(() -> listSinglePageAsync(), + nextLink -> listBySubscriptionNextSinglePageAsync(nextLink)); + } + + /** + * List CloudFormationStackSet resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a CloudFormationStackSet list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(Context context) { + return new PagedFlux<>(() -> listSinglePageAsync(context), + nextLink -> listBySubscriptionNextSinglePageAsync(nextLink, context)); + } + + /** + * List CloudFormationStackSet resources by subscription ID. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a CloudFormationStackSet list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + return new PagedIterable<>(listAsync()); + } + + /** + * List CloudFormationStackSet resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a CloudFormationStackSet list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Context context) { + return new PagedIterable<>(listAsync(context)); + } + + /** + * List CloudFormationStackSet resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a CloudFormationStackSet list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> + listByResourceGroupSinglePageAsync(String resourceGroupName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List CloudFormationStackSet resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a CloudFormationStackSet list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> + listByResourceGroupSinglePageAsync(String resourceGroupName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * List CloudFormationStackSet resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a CloudFormationStackSet list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName) { + return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); + } + + /** + * List CloudFormationStackSet resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a CloudFormationStackSet list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName, Context context) { + return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName, context), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink, context)); + } + + /** + * List CloudFormationStackSet resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a CloudFormationStackSet list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName)); + } + + /** + * List CloudFormationStackSet resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a CloudFormationStackSet list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, context)); + } + + /** + * Get a CloudFormationStackSet. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of CloudFormationStackSet. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a CloudFormationStackSet along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync(String resourceGroupName, + String name) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.getByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get a CloudFormationStackSet. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of CloudFormationStackSet. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a CloudFormationStackSet along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync(String resourceGroupName, + String name, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.getByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, accept, context); + } + + /** + * Get a CloudFormationStackSet. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of CloudFormationStackSet. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a CloudFormationStackSet on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getByResourceGroupAsync(String resourceGroupName, String name) { + return getByResourceGroupWithResponseAsync(resourceGroupName, name) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Get a CloudFormationStackSet. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of CloudFormationStackSet. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a CloudFormationStackSet along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getByResourceGroupWithResponse(String resourceGroupName, String name, + Context context) { + return getByResourceGroupWithResponseAsync(resourceGroupName, name, context).block(); + } + + /** + * Get a CloudFormationStackSet. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of CloudFormationStackSet. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a CloudFormationStackSet. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public CloudFormationStackSetInner getByResourceGroup(String resourceGroupName, String name) { + return getByResourceGroupWithResponse(resourceGroupName, name, Context.NONE).getValue(); + } + + /** + * Create a CloudFormationStackSet. Please note that end user resource creation is currently restricted, but it will + * be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of CloudFormationStackSet. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrReplaceWithResponseAsync(String resourceGroupName, String name, + CloudFormationStackSetInner resource) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (resource == null) { + return Mono.error(new IllegalArgumentException("Parameter resource is required and cannot be null.")); + } else { + resource.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.createOrReplace(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, resource, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Create a CloudFormationStackSet. Please note that end user resource creation is currently restricted, but it will + * be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of CloudFormationStackSet. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrReplaceWithResponseAsync(String resourceGroupName, String name, + CloudFormationStackSetInner resource, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (resource == null) { + return Mono.error(new IllegalArgumentException("Parameter resource is required and cannot be null.")); + } else { + resource.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.createOrReplace(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, resource, accept, context); + } + + /** + * Create a CloudFormationStackSet. Please note that end user resource creation is currently restricted, but it will + * be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of CloudFormationStackSet. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, CloudFormationStackSetInner> + beginCreateOrReplaceAsync(String resourceGroupName, String name, CloudFormationStackSetInner resource) { + Mono>> mono = createOrReplaceWithResponseAsync(resourceGroupName, name, resource); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), CloudFormationStackSetInner.class, CloudFormationStackSetInner.class, + this.client.getContext()); + } + + /** + * Create a CloudFormationStackSet. Please note that end user resource creation is currently restricted, but it will + * be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of CloudFormationStackSet. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, CloudFormationStackSetInner> beginCreateOrReplaceAsync( + String resourceGroupName, String name, CloudFormationStackSetInner resource, Context context) { + context = this.client.mergeContext(context); + Mono>> mono + = createOrReplaceWithResponseAsync(resourceGroupName, name, resource, context); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), CloudFormationStackSetInner.class, CloudFormationStackSetInner.class, + context); + } + + /** + * Create a CloudFormationStackSet. Please note that end user resource creation is currently restricted, but it will + * be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of CloudFormationStackSet. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, CloudFormationStackSetInner> + beginCreateOrReplace(String resourceGroupName, String name, CloudFormationStackSetInner resource) { + return this.beginCreateOrReplaceAsync(resourceGroupName, name, resource).getSyncPoller(); + } + + /** + * Create a CloudFormationStackSet. Please note that end user resource creation is currently restricted, but it will + * be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of CloudFormationStackSet. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, CloudFormationStackSetInner> beginCreateOrReplace( + String resourceGroupName, String name, CloudFormationStackSetInner resource, Context context) { + return this.beginCreateOrReplaceAsync(resourceGroupName, name, resource, context).getSyncPoller(); + } + + /** + * Create a CloudFormationStackSet. Please note that end user resource creation is currently restricted, but it will + * be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of CloudFormationStackSet. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrReplaceAsync(String resourceGroupName, String name, + CloudFormationStackSetInner resource) { + return beginCreateOrReplaceAsync(resourceGroupName, name, resource).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create a CloudFormationStackSet. Please note that end user resource creation is currently restricted, but it will + * be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of CloudFormationStackSet. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrReplaceAsync(String resourceGroupName, String name, + CloudFormationStackSetInner resource, Context context) { + return beginCreateOrReplaceAsync(resourceGroupName, name, resource, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create a CloudFormationStackSet. Please note that end user resource creation is currently restricted, but it will + * be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of CloudFormationStackSet. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public CloudFormationStackSetInner createOrReplace(String resourceGroupName, String name, + CloudFormationStackSetInner resource) { + return createOrReplaceAsync(resourceGroupName, name, resource).block(); + } + + /** + * Create a CloudFormationStackSet. Please note that end user resource creation is currently restricted, but it will + * be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of CloudFormationStackSet. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public CloudFormationStackSetInner createOrReplace(String resourceGroupName, String name, + CloudFormationStackSetInner resource, Context context) { + return createOrReplaceAsync(resourceGroupName, name, resource, context).block(); + } + + /** + * Update a CloudFormationStackSet. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of CloudFormationStackSet. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync(String resourceGroupName, String name, + CloudFormationStackSetTagsUpdate properties) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (properties == null) { + return Mono.error(new IllegalArgumentException("Parameter properties is required and cannot be null.")); + } else { + properties.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.update(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, properties, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Update a CloudFormationStackSet. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of CloudFormationStackSet. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync(String resourceGroupName, String name, + CloudFormationStackSetTagsUpdate properties, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (properties == null) { + return Mono.error(new IllegalArgumentException("Parameter properties is required and cannot be null.")); + } else { + properties.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.update(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, name, properties, accept, context); + } + + /** + * Update a CloudFormationStackSet. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of CloudFormationStackSet. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, CloudFormationStackSetInner> + beginUpdateAsync(String resourceGroupName, String name, CloudFormationStackSetTagsUpdate properties) { + Mono>> mono = updateWithResponseAsync(resourceGroupName, name, properties); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), CloudFormationStackSetInner.class, CloudFormationStackSetInner.class, + this.client.getContext()); + } + + /** + * Update a CloudFormationStackSet. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of CloudFormationStackSet. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, CloudFormationStackSetInner> beginUpdateAsync( + String resourceGroupName, String name, CloudFormationStackSetTagsUpdate properties, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = updateWithResponseAsync(resourceGroupName, name, properties, context); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), CloudFormationStackSetInner.class, CloudFormationStackSetInner.class, + context); + } + + /** + * Update a CloudFormationStackSet. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of CloudFormationStackSet. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, CloudFormationStackSetInner> + beginUpdate(String resourceGroupName, String name, CloudFormationStackSetTagsUpdate properties) { + return this.beginUpdateAsync(resourceGroupName, name, properties).getSyncPoller(); + } + + /** + * Update a CloudFormationStackSet. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of CloudFormationStackSet. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, CloudFormationStackSetInner> beginUpdate( + String resourceGroupName, String name, CloudFormationStackSetTagsUpdate properties, Context context) { + return this.beginUpdateAsync(resourceGroupName, name, properties, context).getSyncPoller(); + } + + /** + * Update a CloudFormationStackSet. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of CloudFormationStackSet. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync(String resourceGroupName, String name, + CloudFormationStackSetTagsUpdate properties) { + return beginUpdateAsync(resourceGroupName, name, properties).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Update a CloudFormationStackSet. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of CloudFormationStackSet. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync(String resourceGroupName, String name, + CloudFormationStackSetTagsUpdate properties, Context context) { + return beginUpdateAsync(resourceGroupName, name, properties, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Update a CloudFormationStackSet. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of CloudFormationStackSet. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public CloudFormationStackSetInner update(String resourceGroupName, String name, + CloudFormationStackSetTagsUpdate properties) { + return updateAsync(resourceGroupName, name, properties).block(); + } + + /** + * Update a CloudFormationStackSet. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of CloudFormationStackSet. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public CloudFormationStackSetInner update(String resourceGroupName, String name, + CloudFormationStackSetTagsUpdate properties, Context context) { + return updateAsync(resourceGroupName, name, properties, context).block(); + } + + /** + * Delete a CloudFormationStackSet. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of CloudFormationStackSet. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync(String resourceGroupName, String name) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Delete a CloudFormationStackSet. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of CloudFormationStackSet. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync(String resourceGroupName, String name, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.delete(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, name, accept, context); + } + + /** + * Delete a CloudFormationStackSet. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of CloudFormationStackSet. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String name) { + Mono>> mono = deleteWithResponseAsync(resourceGroupName, name); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); + } + + /** + * Delete a CloudFormationStackSet. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of CloudFormationStackSet. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String name, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = deleteWithResponseAsync(resourceGroupName, name, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + context); + } + + /** + * Delete a CloudFormationStackSet. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of CloudFormationStackSet. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String name) { + return this.beginDeleteAsync(resourceGroupName, name).getSyncPoller(); + } + + /** + * Delete a CloudFormationStackSet. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of CloudFormationStackSet. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String name, Context context) { + return this.beginDeleteAsync(resourceGroupName, name, context).getSyncPoller(); + } + + /** + * Delete a CloudFormationStackSet. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of CloudFormationStackSet. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String name) { + return beginDeleteAsync(resourceGroupName, name).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete a CloudFormationStackSet. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of CloudFormationStackSet. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String name, Context context) { + return beginDeleteAsync(resourceGroupName, name, context).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete a CloudFormationStackSet. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of CloudFormationStackSet. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String name) { + deleteAsync(resourceGroupName, name).block(); + } + + /** + * Delete a CloudFormationStackSet. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of CloudFormationStackSet. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String name, Context context) { + deleteAsync(resourceGroupName, name, context).block(); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a CloudFormationStackSet list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listBySubscriptionNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a CloudFormationStackSet list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listBySubscriptionNextSinglePageAsync(String nextLink, + Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a CloudFormationStackSet list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a CloudFormationStackSet list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupNextSinglePageAsync(String nextLink, + Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/CloudFormationStackSetsImpl.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/CloudFormationStackSetsImpl.java new file mode 100644 index 000000000000..3c9620f1a149 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/CloudFormationStackSetsImpl.java @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.awsconnector.fluent.CloudFormationStackSetsClient; +import com.azure.resourcemanager.awsconnector.fluent.models.CloudFormationStackSetInner; +import com.azure.resourcemanager.awsconnector.models.CloudFormationStackSet; +import com.azure.resourcemanager.awsconnector.models.CloudFormationStackSets; + +public final class CloudFormationStackSetsImpl implements CloudFormationStackSets { + private static final ClientLogger LOGGER = new ClientLogger(CloudFormationStackSetsImpl.class); + + private final CloudFormationStackSetsClient innerClient; + + private final com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager; + + public CloudFormationStackSetsImpl(CloudFormationStackSetsClient innerClient, + com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return ResourceManagerUtils.mapPage(inner, inner1 -> new CloudFormationStackSetImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new CloudFormationStackSetImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName); + return ResourceManagerUtils.mapPage(inner, inner1 -> new CloudFormationStackSetImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + PagedIterable inner + = this.serviceClient().listByResourceGroup(resourceGroupName, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new CloudFormationStackSetImpl(inner1, this.manager())); + } + + public Response getByResourceGroupWithResponse(String resourceGroupName, String name, + Context context) { + Response inner + = this.serviceClient().getByResourceGroupWithResponse(resourceGroupName, name, context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new CloudFormationStackSetImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public CloudFormationStackSet getByResourceGroup(String resourceGroupName, String name) { + CloudFormationStackSetInner inner = this.serviceClient().getByResourceGroup(resourceGroupName, name); + if (inner != null) { + return new CloudFormationStackSetImpl(inner, this.manager()); + } else { + return null; + } + } + + public void deleteByResourceGroup(String resourceGroupName, String name) { + this.serviceClient().delete(resourceGroupName, name); + } + + public void delete(String resourceGroupName, String name, Context context) { + this.serviceClient().delete(resourceGroupName, name, context); + } + + public CloudFormationStackSet getById(String id) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String name = ResourceManagerUtils.getValueFromIdByName(id, "cloudFormationStackSets"); + if (name == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException(String + .format("The resource ID '%s' is not valid. Missing path segment 'cloudFormationStackSets'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, name, Context.NONE).getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String name = ResourceManagerUtils.getValueFromIdByName(id, "cloudFormationStackSets"); + if (name == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException(String + .format("The resource ID '%s' is not valid. Missing path segment 'cloudFormationStackSets'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, name, context); + } + + public void deleteById(String id) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String name = ResourceManagerUtils.getValueFromIdByName(id, "cloudFormationStackSets"); + if (name == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException(String + .format("The resource ID '%s' is not valid. Missing path segment 'cloudFormationStackSets'.", id))); + } + this.delete(resourceGroupName, name, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String name = ResourceManagerUtils.getValueFromIdByName(id, "cloudFormationStackSets"); + if (name == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException(String + .format("The resource ID '%s' is not valid. Missing path segment 'cloudFormationStackSets'.", id))); + } + this.delete(resourceGroupName, name, context); + } + + private CloudFormationStackSetsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.awsconnector.AwsconnectorManager manager() { + return this.serviceManager; + } + + public CloudFormationStackSetImpl define(String name) { + return new CloudFormationStackSetImpl(name, this.manager()); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/CloudFormationStacksClientImpl.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/CloudFormationStacksClientImpl.java new file mode 100644 index 000000000000..b1e410c07a28 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/CloudFormationStacksClientImpl.java @@ -0,0 +1,1282 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.Patch; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.awsconnector.fluent.CloudFormationStacksClient; +import com.azure.resourcemanager.awsconnector.fluent.models.CloudFormationStackInner; +import com.azure.resourcemanager.awsconnector.models.CloudFormationStackListResult; +import com.azure.resourcemanager.awsconnector.models.CloudFormationStackTagsUpdate; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in CloudFormationStacksClient. + */ +public final class CloudFormationStacksClientImpl implements CloudFormationStacksClient { + /** + * The proxy service used to perform REST calls. + */ + private final CloudFormationStacksService service; + + /** + * The service client containing this operation class. + */ + private final MicrosoftAwsConnectorImpl client; + + /** + * Initializes an instance of CloudFormationStacksClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + CloudFormationStacksClientImpl(MicrosoftAwsConnectorImpl client) { + this.service = RestProxy.create(CloudFormationStacksService.class, client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for MicrosoftAwsConnectorCloudFormationStacks to be used by the proxy + * service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "MicrosoftAwsConnecto") + public interface CloudFormationStacksService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.AwsConnector/cloudFormationStacks") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/cloudFormationStacks") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroup(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/cloudFormationStacks/{name}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getByResourceGroup(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("name") String name, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/cloudFormationStacks/{name}") + @ExpectedResponses({ 200, 201 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrReplace(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("name") String name, + @BodyParam("application/json") CloudFormationStackInner resource, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/cloudFormationStacks/{name}") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> update(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("name") String name, + @BodyParam("application/json") CloudFormationStackTagsUpdate properties, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/cloudFormationStacks/{name}") + @ExpectedResponses({ 202, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("name") String name, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listBySubscriptionNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroupNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); + } + + /** + * List CloudFormationStack resources by subscription ID. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a CloudFormationStack list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync() { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List CloudFormationStack resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a CloudFormationStack list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), accept, + context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * List CloudFormationStack resources by subscription ID. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a CloudFormationStack list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>(() -> listSinglePageAsync(), + nextLink -> listBySubscriptionNextSinglePageAsync(nextLink)); + } + + /** + * List CloudFormationStack resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a CloudFormationStack list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(Context context) { + return new PagedFlux<>(() -> listSinglePageAsync(context), + nextLink -> listBySubscriptionNextSinglePageAsync(nextLink, context)); + } + + /** + * List CloudFormationStack resources by subscription ID. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a CloudFormationStack list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + return new PagedIterable<>(listAsync()); + } + + /** + * List CloudFormationStack resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a CloudFormationStack list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Context context) { + return new PagedIterable<>(listAsync(context)); + } + + /** + * List CloudFormationStack resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a CloudFormationStack list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List CloudFormationStack resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a CloudFormationStack list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * List CloudFormationStack resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a CloudFormationStack list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName) { + return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); + } + + /** + * List CloudFormationStack resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a CloudFormationStack list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName, Context context) { + return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName, context), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink, context)); + } + + /** + * List CloudFormationStack resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a CloudFormationStack list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName)); + } + + /** + * List CloudFormationStack resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a CloudFormationStack list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, context)); + } + + /** + * Get a CloudFormationStack. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of CloudFormationStack. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a CloudFormationStack along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync(String resourceGroupName, + String name) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.getByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get a CloudFormationStack. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of CloudFormationStack. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a CloudFormationStack along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync(String resourceGroupName, + String name, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.getByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, accept, context); + } + + /** + * Get a CloudFormationStack. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of CloudFormationStack. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a CloudFormationStack on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getByResourceGroupAsync(String resourceGroupName, String name) { + return getByResourceGroupWithResponseAsync(resourceGroupName, name) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Get a CloudFormationStack. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of CloudFormationStack. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a CloudFormationStack along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getByResourceGroupWithResponse(String resourceGroupName, String name, + Context context) { + return getByResourceGroupWithResponseAsync(resourceGroupName, name, context).block(); + } + + /** + * Get a CloudFormationStack. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of CloudFormationStack. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a CloudFormationStack. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public CloudFormationStackInner getByResourceGroup(String resourceGroupName, String name) { + return getByResourceGroupWithResponse(resourceGroupName, name, Context.NONE).getValue(); + } + + /** + * Create a CloudFormationStack. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of CloudFormationStack. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrReplaceWithResponseAsync(String resourceGroupName, String name, + CloudFormationStackInner resource) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (resource == null) { + return Mono.error(new IllegalArgumentException("Parameter resource is required and cannot be null.")); + } else { + resource.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.createOrReplace(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, resource, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Create a CloudFormationStack. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of CloudFormationStack. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrReplaceWithResponseAsync(String resourceGroupName, String name, + CloudFormationStackInner resource, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (resource == null) { + return Mono.error(new IllegalArgumentException("Parameter resource is required and cannot be null.")); + } else { + resource.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.createOrReplace(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, resource, accept, context); + } + + /** + * Create a CloudFormationStack. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of CloudFormationStack. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, CloudFormationStackInner> + beginCreateOrReplaceAsync(String resourceGroupName, String name, CloudFormationStackInner resource) { + Mono>> mono = createOrReplaceWithResponseAsync(resourceGroupName, name, resource); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), CloudFormationStackInner.class, CloudFormationStackInner.class, + this.client.getContext()); + } + + /** + * Create a CloudFormationStack. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of CloudFormationStack. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, CloudFormationStackInner> beginCreateOrReplaceAsync( + String resourceGroupName, String name, CloudFormationStackInner resource, Context context) { + context = this.client.mergeContext(context); + Mono>> mono + = createOrReplaceWithResponseAsync(resourceGroupName, name, resource, context); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), CloudFormationStackInner.class, CloudFormationStackInner.class, context); + } + + /** + * Create a CloudFormationStack. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of CloudFormationStack. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, CloudFormationStackInner> + beginCreateOrReplace(String resourceGroupName, String name, CloudFormationStackInner resource) { + return this.beginCreateOrReplaceAsync(resourceGroupName, name, resource).getSyncPoller(); + } + + /** + * Create a CloudFormationStack. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of CloudFormationStack. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, CloudFormationStackInner> beginCreateOrReplace( + String resourceGroupName, String name, CloudFormationStackInner resource, Context context) { + return this.beginCreateOrReplaceAsync(resourceGroupName, name, resource, context).getSyncPoller(); + } + + /** + * Create a CloudFormationStack. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of CloudFormationStack. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrReplaceAsync(String resourceGroupName, String name, + CloudFormationStackInner resource) { + return beginCreateOrReplaceAsync(resourceGroupName, name, resource).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create a CloudFormationStack. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of CloudFormationStack. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrReplaceAsync(String resourceGroupName, String name, + CloudFormationStackInner resource, Context context) { + return beginCreateOrReplaceAsync(resourceGroupName, name, resource, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create a CloudFormationStack. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of CloudFormationStack. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public CloudFormationStackInner createOrReplace(String resourceGroupName, String name, + CloudFormationStackInner resource) { + return createOrReplaceAsync(resourceGroupName, name, resource).block(); + } + + /** + * Create a CloudFormationStack. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of CloudFormationStack. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public CloudFormationStackInner createOrReplace(String resourceGroupName, String name, + CloudFormationStackInner resource, Context context) { + return createOrReplaceAsync(resourceGroupName, name, resource, context).block(); + } + + /** + * Update a CloudFormationStack. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of CloudFormationStack. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync(String resourceGroupName, String name, + CloudFormationStackTagsUpdate properties) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (properties == null) { + return Mono.error(new IllegalArgumentException("Parameter properties is required and cannot be null.")); + } else { + properties.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.update(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, properties, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Update a CloudFormationStack. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of CloudFormationStack. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync(String resourceGroupName, String name, + CloudFormationStackTagsUpdate properties, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (properties == null) { + return Mono.error(new IllegalArgumentException("Parameter properties is required and cannot be null.")); + } else { + properties.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.update(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, name, properties, accept, context); + } + + /** + * Update a CloudFormationStack. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of CloudFormationStack. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, CloudFormationStackInner> + beginUpdateAsync(String resourceGroupName, String name, CloudFormationStackTagsUpdate properties) { + Mono>> mono = updateWithResponseAsync(resourceGroupName, name, properties); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), CloudFormationStackInner.class, CloudFormationStackInner.class, + this.client.getContext()); + } + + /** + * Update a CloudFormationStack. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of CloudFormationStack. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, CloudFormationStackInner> beginUpdateAsync( + String resourceGroupName, String name, CloudFormationStackTagsUpdate properties, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = updateWithResponseAsync(resourceGroupName, name, properties, context); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), CloudFormationStackInner.class, CloudFormationStackInner.class, context); + } + + /** + * Update a CloudFormationStack. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of CloudFormationStack. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, CloudFormationStackInner> + beginUpdate(String resourceGroupName, String name, CloudFormationStackTagsUpdate properties) { + return this.beginUpdateAsync(resourceGroupName, name, properties).getSyncPoller(); + } + + /** + * Update a CloudFormationStack. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of CloudFormationStack. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, CloudFormationStackInner> + beginUpdate(String resourceGroupName, String name, CloudFormationStackTagsUpdate properties, Context context) { + return this.beginUpdateAsync(resourceGroupName, name, properties, context).getSyncPoller(); + } + + /** + * Update a CloudFormationStack. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of CloudFormationStack. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync(String resourceGroupName, String name, + CloudFormationStackTagsUpdate properties) { + return beginUpdateAsync(resourceGroupName, name, properties).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Update a CloudFormationStack. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of CloudFormationStack. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync(String resourceGroupName, String name, + CloudFormationStackTagsUpdate properties, Context context) { + return beginUpdateAsync(resourceGroupName, name, properties, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Update a CloudFormationStack. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of CloudFormationStack. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public CloudFormationStackInner update(String resourceGroupName, String name, + CloudFormationStackTagsUpdate properties) { + return updateAsync(resourceGroupName, name, properties).block(); + } + + /** + * Update a CloudFormationStack. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of CloudFormationStack. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public CloudFormationStackInner update(String resourceGroupName, String name, + CloudFormationStackTagsUpdate properties, Context context) { + return updateAsync(resourceGroupName, name, properties, context).block(); + } + + /** + * Delete a CloudFormationStack. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of CloudFormationStack. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync(String resourceGroupName, String name) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Delete a CloudFormationStack. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of CloudFormationStack. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync(String resourceGroupName, String name, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.delete(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, name, accept, context); + } + + /** + * Delete a CloudFormationStack. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of CloudFormationStack. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String name) { + Mono>> mono = deleteWithResponseAsync(resourceGroupName, name); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); + } + + /** + * Delete a CloudFormationStack. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of CloudFormationStack. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String name, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = deleteWithResponseAsync(resourceGroupName, name, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + context); + } + + /** + * Delete a CloudFormationStack. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of CloudFormationStack. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String name) { + return this.beginDeleteAsync(resourceGroupName, name).getSyncPoller(); + } + + /** + * Delete a CloudFormationStack. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of CloudFormationStack. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String name, Context context) { + return this.beginDeleteAsync(resourceGroupName, name, context).getSyncPoller(); + } + + /** + * Delete a CloudFormationStack. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of CloudFormationStack. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String name) { + return beginDeleteAsync(resourceGroupName, name).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete a CloudFormationStack. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of CloudFormationStack. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String name, Context context) { + return beginDeleteAsync(resourceGroupName, name, context).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete a CloudFormationStack. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of CloudFormationStack. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String name) { + deleteAsync(resourceGroupName, name).block(); + } + + /** + * Delete a CloudFormationStack. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of CloudFormationStack. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String name, Context context) { + deleteAsync(resourceGroupName, name, context).block(); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a CloudFormationStack list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listBySubscriptionNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a CloudFormationStack list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listBySubscriptionNextSinglePageAsync(String nextLink, + Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a CloudFormationStack list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a CloudFormationStack list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupNextSinglePageAsync(String nextLink, + Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/CloudFormationStacksImpl.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/CloudFormationStacksImpl.java new file mode 100644 index 000000000000..31a76a35682c --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/CloudFormationStacksImpl.java @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.awsconnector.fluent.CloudFormationStacksClient; +import com.azure.resourcemanager.awsconnector.fluent.models.CloudFormationStackInner; +import com.azure.resourcemanager.awsconnector.models.CloudFormationStack; +import com.azure.resourcemanager.awsconnector.models.CloudFormationStacks; + +public final class CloudFormationStacksImpl implements CloudFormationStacks { + private static final ClientLogger LOGGER = new ClientLogger(CloudFormationStacksImpl.class); + + private final CloudFormationStacksClient innerClient; + + private final com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager; + + public CloudFormationStacksImpl(CloudFormationStacksClient innerClient, + com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return ResourceManagerUtils.mapPage(inner, inner1 -> new CloudFormationStackImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new CloudFormationStackImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName); + return ResourceManagerUtils.mapPage(inner, inner1 -> new CloudFormationStackImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + PagedIterable inner + = this.serviceClient().listByResourceGroup(resourceGroupName, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new CloudFormationStackImpl(inner1, this.manager())); + } + + public Response getByResourceGroupWithResponse(String resourceGroupName, String name, + Context context) { + Response inner + = this.serviceClient().getByResourceGroupWithResponse(resourceGroupName, name, context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new CloudFormationStackImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public CloudFormationStack getByResourceGroup(String resourceGroupName, String name) { + CloudFormationStackInner inner = this.serviceClient().getByResourceGroup(resourceGroupName, name); + if (inner != null) { + return new CloudFormationStackImpl(inner, this.manager()); + } else { + return null; + } + } + + public void deleteByResourceGroup(String resourceGroupName, String name) { + this.serviceClient().delete(resourceGroupName, name); + } + + public void delete(String resourceGroupName, String name, Context context) { + this.serviceClient().delete(resourceGroupName, name, context); + } + + public CloudFormationStack getById(String id) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String name = ResourceManagerUtils.getValueFromIdByName(id, "cloudFormationStacks"); + if (name == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'cloudFormationStacks'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, name, Context.NONE).getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String name = ResourceManagerUtils.getValueFromIdByName(id, "cloudFormationStacks"); + if (name == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'cloudFormationStacks'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, name, context); + } + + public void deleteById(String id) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String name = ResourceManagerUtils.getValueFromIdByName(id, "cloudFormationStacks"); + if (name == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'cloudFormationStacks'.", id))); + } + this.delete(resourceGroupName, name, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String name = ResourceManagerUtils.getValueFromIdByName(id, "cloudFormationStacks"); + if (name == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'cloudFormationStacks'.", id))); + } + this.delete(resourceGroupName, name, context); + } + + private CloudFormationStacksClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.awsconnector.AwsconnectorManager manager() { + return this.serviceManager; + } + + public CloudFormationStackImpl define(String name) { + return new CloudFormationStackImpl(name, this.manager()); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/CloudFrontDistributionImpl.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/CloudFrontDistributionImpl.java new file mode 100644 index 000000000000..fa067c801582 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/CloudFrontDistributionImpl.java @@ -0,0 +1,178 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.implementation; + +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.awsconnector.fluent.models.CloudFrontDistributionInner; +import com.azure.resourcemanager.awsconnector.models.CloudFrontDistribution; +import com.azure.resourcemanager.awsconnector.models.CloudFrontDistributionProperties; +import com.azure.resourcemanager.awsconnector.models.CloudFrontDistributionTagsUpdate; +import java.util.Collections; +import java.util.Map; + +public final class CloudFrontDistributionImpl + implements CloudFrontDistribution, CloudFrontDistribution.Definition, CloudFrontDistribution.Update { + private CloudFrontDistributionInner innerObject; + + private final com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public String location() { + return this.innerModel().location(); + } + + public Map tags() { + Map inner = this.innerModel().tags(); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } + } + + public CloudFrontDistributionProperties properties() { + return this.innerModel().properties(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public String resourceGroupName() { + return resourceGroupName; + } + + public CloudFrontDistributionInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.awsconnector.AwsconnectorManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String name; + + private CloudFrontDistributionTagsUpdate updateProperties; + + public CloudFrontDistributionImpl withExistingResourceGroup(String resourceGroupName) { + this.resourceGroupName = resourceGroupName; + return this; + } + + public CloudFrontDistribution create() { + this.innerObject = serviceManager.serviceClient() + .getCloudFrontDistributions() + .createOrReplace(resourceGroupName, name, this.innerModel(), Context.NONE); + return this; + } + + public CloudFrontDistribution create(Context context) { + this.innerObject = serviceManager.serviceClient() + .getCloudFrontDistributions() + .createOrReplace(resourceGroupName, name, this.innerModel(), context); + return this; + } + + CloudFrontDistributionImpl(String name, com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager) { + this.innerObject = new CloudFrontDistributionInner(); + this.serviceManager = serviceManager; + this.name = name; + } + + public CloudFrontDistributionImpl update() { + this.updateProperties = new CloudFrontDistributionTagsUpdate(); + return this; + } + + public CloudFrontDistribution apply() { + this.innerObject = serviceManager.serviceClient() + .getCloudFrontDistributions() + .update(resourceGroupName, name, updateProperties, Context.NONE); + return this; + } + + public CloudFrontDistribution apply(Context context) { + this.innerObject = serviceManager.serviceClient() + .getCloudFrontDistributions() + .update(resourceGroupName, name, updateProperties, context); + return this; + } + + CloudFrontDistributionImpl(CloudFrontDistributionInner innerObject, + com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.name = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "cloudFrontDistributions"); + } + + public CloudFrontDistribution refresh() { + this.innerObject = serviceManager.serviceClient() + .getCloudFrontDistributions() + .getByResourceGroupWithResponse(resourceGroupName, name, Context.NONE) + .getValue(); + return this; + } + + public CloudFrontDistribution refresh(Context context) { + this.innerObject = serviceManager.serviceClient() + .getCloudFrontDistributions() + .getByResourceGroupWithResponse(resourceGroupName, name, context) + .getValue(); + return this; + } + + public CloudFrontDistributionImpl withRegion(Region location) { + this.innerModel().withLocation(location.toString()); + return this; + } + + public CloudFrontDistributionImpl withRegion(String location) { + this.innerModel().withLocation(location); + return this; + } + + public CloudFrontDistributionImpl withTags(Map tags) { + if (isInCreateMode()) { + this.innerModel().withTags(tags); + return this; + } else { + this.updateProperties.withTags(tags); + return this; + } + } + + public CloudFrontDistributionImpl withProperties(CloudFrontDistributionProperties properties) { + this.innerModel().withProperties(properties); + return this; + } + + private boolean isInCreateMode() { + return this.innerModel().id() == null; + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/CloudFrontDistributionsClientImpl.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/CloudFrontDistributionsClientImpl.java new file mode 100644 index 000000000000..a602f82c8669 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/CloudFrontDistributionsClientImpl.java @@ -0,0 +1,1285 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.Patch; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.awsconnector.fluent.CloudFrontDistributionsClient; +import com.azure.resourcemanager.awsconnector.fluent.models.CloudFrontDistributionInner; +import com.azure.resourcemanager.awsconnector.models.CloudFrontDistributionListResult; +import com.azure.resourcemanager.awsconnector.models.CloudFrontDistributionTagsUpdate; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in CloudFrontDistributionsClient. + */ +public final class CloudFrontDistributionsClientImpl implements CloudFrontDistributionsClient { + /** + * The proxy service used to perform REST calls. + */ + private final CloudFrontDistributionsService service; + + /** + * The service client containing this operation class. + */ + private final MicrosoftAwsConnectorImpl client; + + /** + * Initializes an instance of CloudFrontDistributionsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + CloudFrontDistributionsClientImpl(MicrosoftAwsConnectorImpl client) { + this.service = RestProxy.create(CloudFrontDistributionsService.class, client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for MicrosoftAwsConnectorCloudFrontDistributions to be used by the proxy + * service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "MicrosoftAwsConnecto") + public interface CloudFrontDistributionsService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.AwsConnector/cloudFrontDistributions") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/cloudFrontDistributions") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroup(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/cloudFrontDistributions/{name}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getByResourceGroup(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("name") String name, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/cloudFrontDistributions/{name}") + @ExpectedResponses({ 200, 201 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrReplace(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("name") String name, + @BodyParam("application/json") CloudFrontDistributionInner resource, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/cloudFrontDistributions/{name}") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> update(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("name") String name, + @BodyParam("application/json") CloudFrontDistributionTagsUpdate properties, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/cloudFrontDistributions/{name}") + @ExpectedResponses({ 202, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("name") String name, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listBySubscriptionNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroupNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); + } + + /** + * List CloudFrontDistribution resources by subscription ID. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a CloudFrontDistribution list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync() { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List CloudFrontDistribution resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a CloudFrontDistribution list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), accept, + context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * List CloudFrontDistribution resources by subscription ID. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a CloudFrontDistribution list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>(() -> listSinglePageAsync(), + nextLink -> listBySubscriptionNextSinglePageAsync(nextLink)); + } + + /** + * List CloudFrontDistribution resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a CloudFrontDistribution list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(Context context) { + return new PagedFlux<>(() -> listSinglePageAsync(context), + nextLink -> listBySubscriptionNextSinglePageAsync(nextLink, context)); + } + + /** + * List CloudFrontDistribution resources by subscription ID. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a CloudFrontDistribution list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + return new PagedIterable<>(listAsync()); + } + + /** + * List CloudFrontDistribution resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a CloudFrontDistribution list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Context context) { + return new PagedIterable<>(listAsync(context)); + } + + /** + * List CloudFrontDistribution resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a CloudFrontDistribution list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> + listByResourceGroupSinglePageAsync(String resourceGroupName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List CloudFrontDistribution resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a CloudFrontDistribution list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> + listByResourceGroupSinglePageAsync(String resourceGroupName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * List CloudFrontDistribution resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a CloudFrontDistribution list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName) { + return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); + } + + /** + * List CloudFrontDistribution resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a CloudFrontDistribution list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName, Context context) { + return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName, context), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink, context)); + } + + /** + * List CloudFrontDistribution resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a CloudFrontDistribution list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName)); + } + + /** + * List CloudFrontDistribution resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a CloudFrontDistribution list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, context)); + } + + /** + * Get a CloudFrontDistribution. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of CloudFrontDistribution. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a CloudFrontDistribution along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync(String resourceGroupName, + String name) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.getByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get a CloudFrontDistribution. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of CloudFrontDistribution. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a CloudFrontDistribution along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync(String resourceGroupName, + String name, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.getByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, accept, context); + } + + /** + * Get a CloudFrontDistribution. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of CloudFrontDistribution. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a CloudFrontDistribution on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getByResourceGroupAsync(String resourceGroupName, String name) { + return getByResourceGroupWithResponseAsync(resourceGroupName, name) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Get a CloudFrontDistribution. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of CloudFrontDistribution. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a CloudFrontDistribution along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getByResourceGroupWithResponse(String resourceGroupName, String name, + Context context) { + return getByResourceGroupWithResponseAsync(resourceGroupName, name, context).block(); + } + + /** + * Get a CloudFrontDistribution. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of CloudFrontDistribution. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a CloudFrontDistribution. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public CloudFrontDistributionInner getByResourceGroup(String resourceGroupName, String name) { + return getByResourceGroupWithResponse(resourceGroupName, name, Context.NONE).getValue(); + } + + /** + * Create a CloudFrontDistribution. Please note that end user resource creation is currently restricted, but it will + * be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of CloudFrontDistribution. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrReplaceWithResponseAsync(String resourceGroupName, String name, + CloudFrontDistributionInner resource) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (resource == null) { + return Mono.error(new IllegalArgumentException("Parameter resource is required and cannot be null.")); + } else { + resource.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.createOrReplace(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, resource, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Create a CloudFrontDistribution. Please note that end user resource creation is currently restricted, but it will + * be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of CloudFrontDistribution. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrReplaceWithResponseAsync(String resourceGroupName, String name, + CloudFrontDistributionInner resource, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (resource == null) { + return Mono.error(new IllegalArgumentException("Parameter resource is required and cannot be null.")); + } else { + resource.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.createOrReplace(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, resource, accept, context); + } + + /** + * Create a CloudFrontDistribution. Please note that end user resource creation is currently restricted, but it will + * be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of CloudFrontDistribution. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, CloudFrontDistributionInner> + beginCreateOrReplaceAsync(String resourceGroupName, String name, CloudFrontDistributionInner resource) { + Mono>> mono = createOrReplaceWithResponseAsync(resourceGroupName, name, resource); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), CloudFrontDistributionInner.class, CloudFrontDistributionInner.class, + this.client.getContext()); + } + + /** + * Create a CloudFrontDistribution. Please note that end user resource creation is currently restricted, but it will + * be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of CloudFrontDistribution. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, CloudFrontDistributionInner> beginCreateOrReplaceAsync( + String resourceGroupName, String name, CloudFrontDistributionInner resource, Context context) { + context = this.client.mergeContext(context); + Mono>> mono + = createOrReplaceWithResponseAsync(resourceGroupName, name, resource, context); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), CloudFrontDistributionInner.class, CloudFrontDistributionInner.class, + context); + } + + /** + * Create a CloudFrontDistribution. Please note that end user resource creation is currently restricted, but it will + * be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of CloudFrontDistribution. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, CloudFrontDistributionInner> + beginCreateOrReplace(String resourceGroupName, String name, CloudFrontDistributionInner resource) { + return this.beginCreateOrReplaceAsync(resourceGroupName, name, resource).getSyncPoller(); + } + + /** + * Create a CloudFrontDistribution. Please note that end user resource creation is currently restricted, but it will + * be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of CloudFrontDistribution. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, CloudFrontDistributionInner> beginCreateOrReplace( + String resourceGroupName, String name, CloudFrontDistributionInner resource, Context context) { + return this.beginCreateOrReplaceAsync(resourceGroupName, name, resource, context).getSyncPoller(); + } + + /** + * Create a CloudFrontDistribution. Please note that end user resource creation is currently restricted, but it will + * be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of CloudFrontDistribution. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrReplaceAsync(String resourceGroupName, String name, + CloudFrontDistributionInner resource) { + return beginCreateOrReplaceAsync(resourceGroupName, name, resource).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create a CloudFrontDistribution. Please note that end user resource creation is currently restricted, but it will + * be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of CloudFrontDistribution. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrReplaceAsync(String resourceGroupName, String name, + CloudFrontDistributionInner resource, Context context) { + return beginCreateOrReplaceAsync(resourceGroupName, name, resource, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create a CloudFrontDistribution. Please note that end user resource creation is currently restricted, but it will + * be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of CloudFrontDistribution. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public CloudFrontDistributionInner createOrReplace(String resourceGroupName, String name, + CloudFrontDistributionInner resource) { + return createOrReplaceAsync(resourceGroupName, name, resource).block(); + } + + /** + * Create a CloudFrontDistribution. Please note that end user resource creation is currently restricted, but it will + * be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of CloudFrontDistribution. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public CloudFrontDistributionInner createOrReplace(String resourceGroupName, String name, + CloudFrontDistributionInner resource, Context context) { + return createOrReplaceAsync(resourceGroupName, name, resource, context).block(); + } + + /** + * Update a CloudFrontDistribution. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of CloudFrontDistribution. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync(String resourceGroupName, String name, + CloudFrontDistributionTagsUpdate properties) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (properties == null) { + return Mono.error(new IllegalArgumentException("Parameter properties is required and cannot be null.")); + } else { + properties.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.update(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, properties, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Update a CloudFrontDistribution. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of CloudFrontDistribution. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync(String resourceGroupName, String name, + CloudFrontDistributionTagsUpdate properties, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (properties == null) { + return Mono.error(new IllegalArgumentException("Parameter properties is required and cannot be null.")); + } else { + properties.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.update(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, name, properties, accept, context); + } + + /** + * Update a CloudFrontDistribution. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of CloudFrontDistribution. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, CloudFrontDistributionInner> + beginUpdateAsync(String resourceGroupName, String name, CloudFrontDistributionTagsUpdate properties) { + Mono>> mono = updateWithResponseAsync(resourceGroupName, name, properties); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), CloudFrontDistributionInner.class, CloudFrontDistributionInner.class, + this.client.getContext()); + } + + /** + * Update a CloudFrontDistribution. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of CloudFrontDistribution. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, CloudFrontDistributionInner> beginUpdateAsync( + String resourceGroupName, String name, CloudFrontDistributionTagsUpdate properties, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = updateWithResponseAsync(resourceGroupName, name, properties, context); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), CloudFrontDistributionInner.class, CloudFrontDistributionInner.class, + context); + } + + /** + * Update a CloudFrontDistribution. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of CloudFrontDistribution. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, CloudFrontDistributionInner> + beginUpdate(String resourceGroupName, String name, CloudFrontDistributionTagsUpdate properties) { + return this.beginUpdateAsync(resourceGroupName, name, properties).getSyncPoller(); + } + + /** + * Update a CloudFrontDistribution. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of CloudFrontDistribution. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, CloudFrontDistributionInner> beginUpdate( + String resourceGroupName, String name, CloudFrontDistributionTagsUpdate properties, Context context) { + return this.beginUpdateAsync(resourceGroupName, name, properties, context).getSyncPoller(); + } + + /** + * Update a CloudFrontDistribution. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of CloudFrontDistribution. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync(String resourceGroupName, String name, + CloudFrontDistributionTagsUpdate properties) { + return beginUpdateAsync(resourceGroupName, name, properties).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Update a CloudFrontDistribution. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of CloudFrontDistribution. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync(String resourceGroupName, String name, + CloudFrontDistributionTagsUpdate properties, Context context) { + return beginUpdateAsync(resourceGroupName, name, properties, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Update a CloudFrontDistribution. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of CloudFrontDistribution. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public CloudFrontDistributionInner update(String resourceGroupName, String name, + CloudFrontDistributionTagsUpdate properties) { + return updateAsync(resourceGroupName, name, properties).block(); + } + + /** + * Update a CloudFrontDistribution. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of CloudFrontDistribution. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public CloudFrontDistributionInner update(String resourceGroupName, String name, + CloudFrontDistributionTagsUpdate properties, Context context) { + return updateAsync(resourceGroupName, name, properties, context).block(); + } + + /** + * Delete a CloudFrontDistribution. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of CloudFrontDistribution. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync(String resourceGroupName, String name) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Delete a CloudFrontDistribution. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of CloudFrontDistribution. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync(String resourceGroupName, String name, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.delete(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, name, accept, context); + } + + /** + * Delete a CloudFrontDistribution. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of CloudFrontDistribution. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String name) { + Mono>> mono = deleteWithResponseAsync(resourceGroupName, name); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); + } + + /** + * Delete a CloudFrontDistribution. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of CloudFrontDistribution. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String name, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = deleteWithResponseAsync(resourceGroupName, name, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + context); + } + + /** + * Delete a CloudFrontDistribution. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of CloudFrontDistribution. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String name) { + return this.beginDeleteAsync(resourceGroupName, name).getSyncPoller(); + } + + /** + * Delete a CloudFrontDistribution. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of CloudFrontDistribution. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String name, Context context) { + return this.beginDeleteAsync(resourceGroupName, name, context).getSyncPoller(); + } + + /** + * Delete a CloudFrontDistribution. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of CloudFrontDistribution. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String name) { + return beginDeleteAsync(resourceGroupName, name).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete a CloudFrontDistribution. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of CloudFrontDistribution. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String name, Context context) { + return beginDeleteAsync(resourceGroupName, name, context).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete a CloudFrontDistribution. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of CloudFrontDistribution. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String name) { + deleteAsync(resourceGroupName, name).block(); + } + + /** + * Delete a CloudFrontDistribution. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of CloudFrontDistribution. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String name, Context context) { + deleteAsync(resourceGroupName, name, context).block(); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a CloudFrontDistribution list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listBySubscriptionNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a CloudFrontDistribution list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listBySubscriptionNextSinglePageAsync(String nextLink, + Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a CloudFrontDistribution list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a CloudFrontDistribution list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupNextSinglePageAsync(String nextLink, + Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/CloudFrontDistributionsImpl.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/CloudFrontDistributionsImpl.java new file mode 100644 index 000000000000..ba3375dc632f --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/CloudFrontDistributionsImpl.java @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.awsconnector.fluent.CloudFrontDistributionsClient; +import com.azure.resourcemanager.awsconnector.fluent.models.CloudFrontDistributionInner; +import com.azure.resourcemanager.awsconnector.models.CloudFrontDistribution; +import com.azure.resourcemanager.awsconnector.models.CloudFrontDistributions; + +public final class CloudFrontDistributionsImpl implements CloudFrontDistributions { + private static final ClientLogger LOGGER = new ClientLogger(CloudFrontDistributionsImpl.class); + + private final CloudFrontDistributionsClient innerClient; + + private final com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager; + + public CloudFrontDistributionsImpl(CloudFrontDistributionsClient innerClient, + com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return ResourceManagerUtils.mapPage(inner, inner1 -> new CloudFrontDistributionImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new CloudFrontDistributionImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName); + return ResourceManagerUtils.mapPage(inner, inner1 -> new CloudFrontDistributionImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + PagedIterable inner + = this.serviceClient().listByResourceGroup(resourceGroupName, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new CloudFrontDistributionImpl(inner1, this.manager())); + } + + public Response getByResourceGroupWithResponse(String resourceGroupName, String name, + Context context) { + Response inner + = this.serviceClient().getByResourceGroupWithResponse(resourceGroupName, name, context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new CloudFrontDistributionImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public CloudFrontDistribution getByResourceGroup(String resourceGroupName, String name) { + CloudFrontDistributionInner inner = this.serviceClient().getByResourceGroup(resourceGroupName, name); + if (inner != null) { + return new CloudFrontDistributionImpl(inner, this.manager()); + } else { + return null; + } + } + + public void deleteByResourceGroup(String resourceGroupName, String name) { + this.serviceClient().delete(resourceGroupName, name); + } + + public void delete(String resourceGroupName, String name, Context context) { + this.serviceClient().delete(resourceGroupName, name, context); + } + + public CloudFrontDistribution getById(String id) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String name = ResourceManagerUtils.getValueFromIdByName(id, "cloudFrontDistributions"); + if (name == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException(String + .format("The resource ID '%s' is not valid. Missing path segment 'cloudFrontDistributions'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, name, Context.NONE).getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String name = ResourceManagerUtils.getValueFromIdByName(id, "cloudFrontDistributions"); + if (name == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException(String + .format("The resource ID '%s' is not valid. Missing path segment 'cloudFrontDistributions'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, name, context); + } + + public void deleteById(String id) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String name = ResourceManagerUtils.getValueFromIdByName(id, "cloudFrontDistributions"); + if (name == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException(String + .format("The resource ID '%s' is not valid. Missing path segment 'cloudFrontDistributions'.", id))); + } + this.delete(resourceGroupName, name, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String name = ResourceManagerUtils.getValueFromIdByName(id, "cloudFrontDistributions"); + if (name == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException(String + .format("The resource ID '%s' is not valid. Missing path segment 'cloudFrontDistributions'.", id))); + } + this.delete(resourceGroupName, name, context); + } + + private CloudFrontDistributionsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.awsconnector.AwsconnectorManager manager() { + return this.serviceManager; + } + + public CloudFrontDistributionImpl define(String name) { + return new CloudFrontDistributionImpl(name, this.manager()); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/CloudTrailImpl.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/CloudTrailImpl.java new file mode 100644 index 000000000000..6561f7e6c926 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/CloudTrailImpl.java @@ -0,0 +1,177 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.implementation; + +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.awsconnector.fluent.models.CloudTrailInner; +import com.azure.resourcemanager.awsconnector.models.CloudTrail; +import com.azure.resourcemanager.awsconnector.models.CloudTrailProperties; +import com.azure.resourcemanager.awsconnector.models.CloudTrailTagsUpdate; +import java.util.Collections; +import java.util.Map; + +public final class CloudTrailImpl implements CloudTrail, CloudTrail.Definition, CloudTrail.Update { + private CloudTrailInner innerObject; + + private final com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public String location() { + return this.innerModel().location(); + } + + public Map tags() { + Map inner = this.innerModel().tags(); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } + } + + public CloudTrailProperties properties() { + return this.innerModel().properties(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public String resourceGroupName() { + return resourceGroupName; + } + + public CloudTrailInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.awsconnector.AwsconnectorManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String name; + + private CloudTrailTagsUpdate updateProperties; + + public CloudTrailImpl withExistingResourceGroup(String resourceGroupName) { + this.resourceGroupName = resourceGroupName; + return this; + } + + public CloudTrail create() { + this.innerObject = serviceManager.serviceClient() + .getCloudTrailTrails() + .createOrReplace(resourceGroupName, name, this.innerModel(), Context.NONE); + return this; + } + + public CloudTrail create(Context context) { + this.innerObject = serviceManager.serviceClient() + .getCloudTrailTrails() + .createOrReplace(resourceGroupName, name, this.innerModel(), context); + return this; + } + + CloudTrailImpl(String name, com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager) { + this.innerObject = new CloudTrailInner(); + this.serviceManager = serviceManager; + this.name = name; + } + + public CloudTrailImpl update() { + this.updateProperties = new CloudTrailTagsUpdate(); + return this; + } + + public CloudTrail apply() { + this.innerObject = serviceManager.serviceClient() + .getCloudTrailTrails() + .update(resourceGroupName, name, updateProperties, Context.NONE); + return this; + } + + public CloudTrail apply(Context context) { + this.innerObject = serviceManager.serviceClient() + .getCloudTrailTrails() + .update(resourceGroupName, name, updateProperties, context); + return this; + } + + CloudTrailImpl(CloudTrailInner innerObject, + com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.name = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "cloudTrailTrails"); + } + + public CloudTrail refresh() { + this.innerObject = serviceManager.serviceClient() + .getCloudTrailTrails() + .getByResourceGroupWithResponse(resourceGroupName, name, Context.NONE) + .getValue(); + return this; + } + + public CloudTrail refresh(Context context) { + this.innerObject = serviceManager.serviceClient() + .getCloudTrailTrails() + .getByResourceGroupWithResponse(resourceGroupName, name, context) + .getValue(); + return this; + } + + public CloudTrailImpl withRegion(Region location) { + this.innerModel().withLocation(location.toString()); + return this; + } + + public CloudTrailImpl withRegion(String location) { + this.innerModel().withLocation(location); + return this; + } + + public CloudTrailImpl withTags(Map tags) { + if (isInCreateMode()) { + this.innerModel().withTags(tags); + return this; + } else { + this.updateProperties.withTags(tags); + return this; + } + } + + public CloudTrailImpl withProperties(CloudTrailProperties properties) { + this.innerModel().withProperties(properties); + return this; + } + + private boolean isInCreateMode() { + return this.innerModel().id() == null; + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/CloudTrailTrailsClientImpl.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/CloudTrailTrailsClientImpl.java new file mode 100644 index 000000000000..e8d3eeb3bd6c --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/CloudTrailTrailsClientImpl.java @@ -0,0 +1,1276 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.Patch; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.awsconnector.fluent.CloudTrailTrailsClient; +import com.azure.resourcemanager.awsconnector.fluent.models.CloudTrailInner; +import com.azure.resourcemanager.awsconnector.models.CloudTrailListResult; +import com.azure.resourcemanager.awsconnector.models.CloudTrailTagsUpdate; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in CloudTrailTrailsClient. + */ +public final class CloudTrailTrailsClientImpl implements CloudTrailTrailsClient { + /** + * The proxy service used to perform REST calls. + */ + private final CloudTrailTrailsService service; + + /** + * The service client containing this operation class. + */ + private final MicrosoftAwsConnectorImpl client; + + /** + * Initializes an instance of CloudTrailTrailsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + CloudTrailTrailsClientImpl(MicrosoftAwsConnectorImpl client) { + this.service + = RestProxy.create(CloudTrailTrailsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for MicrosoftAwsConnectorCloudTrailTrails to be used by the proxy service + * to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "MicrosoftAwsConnecto") + public interface CloudTrailTrailsService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.AwsConnector/cloudTrailTrails") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/cloudTrailTrails") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroup(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/cloudTrailTrails/{name}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getByResourceGroup(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("name") String name, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/cloudTrailTrails/{name}") + @ExpectedResponses({ 200, 201 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrReplace(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("name") String name, + @BodyParam("application/json") CloudTrailInner resource, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/cloudTrailTrails/{name}") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> update(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("name") String name, + @BodyParam("application/json") CloudTrailTagsUpdate properties, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/cloudTrailTrails/{name}") + @ExpectedResponses({ 202, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("name") String name, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listBySubscriptionNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroupNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); + } + + /** + * List CloudTrailTrail resources by subscription ID. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a CloudTrailTrail list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync() { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), + res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List CloudTrailTrail resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a CloudTrailTrail list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), accept, + context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * List CloudTrailTrail resources by subscription ID. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a CloudTrailTrail list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>(() -> listSinglePageAsync(), + nextLink -> listBySubscriptionNextSinglePageAsync(nextLink)); + } + + /** + * List CloudTrailTrail resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a CloudTrailTrail list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(Context context) { + return new PagedFlux<>(() -> listSinglePageAsync(context), + nextLink -> listBySubscriptionNextSinglePageAsync(nextLink, context)); + } + + /** + * List CloudTrailTrail resources by subscription ID. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a CloudTrailTrail list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + return new PagedIterable<>(listAsync()); + } + + /** + * List CloudTrailTrail resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a CloudTrailTrail list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Context context) { + return new PagedIterable<>(listAsync(context)); + } + + /** + * List CloudTrailTrail resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a CloudTrailTrail list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), + res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List CloudTrailTrail resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a CloudTrailTrail list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * List CloudTrailTrail resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a CloudTrailTrail list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName) { + return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); + } + + /** + * List CloudTrailTrail resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a CloudTrailTrail list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName, Context context) { + return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName, context), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink, context)); + } + + /** + * List CloudTrailTrail resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a CloudTrailTrail list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName)); + } + + /** + * List CloudTrailTrail resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a CloudTrailTrail list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, context)); + } + + /** + * Get a CloudTrailTrail. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of CloudTrailTrail. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a CloudTrailTrail along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync(String resourceGroupName, String name) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.getByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get a CloudTrailTrail. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of CloudTrailTrail. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a CloudTrailTrail along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync(String resourceGroupName, String name, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.getByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, accept, context); + } + + /** + * Get a CloudTrailTrail. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of CloudTrailTrail. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a CloudTrailTrail on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getByResourceGroupAsync(String resourceGroupName, String name) { + return getByResourceGroupWithResponseAsync(resourceGroupName, name) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Get a CloudTrailTrail. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of CloudTrailTrail. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a CloudTrailTrail along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getByResourceGroupWithResponse(String resourceGroupName, String name, + Context context) { + return getByResourceGroupWithResponseAsync(resourceGroupName, name, context).block(); + } + + /** + * Get a CloudTrailTrail. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of CloudTrailTrail. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a CloudTrailTrail. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public CloudTrailInner getByResourceGroup(String resourceGroupName, String name) { + return getByResourceGroupWithResponse(resourceGroupName, name, Context.NONE).getValue(); + } + + /** + * Create a CloudTrailTrail. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of CloudTrailTrail. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrReplaceWithResponseAsync(String resourceGroupName, String name, + CloudTrailInner resource) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (resource == null) { + return Mono.error(new IllegalArgumentException("Parameter resource is required and cannot be null.")); + } else { + resource.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.createOrReplace(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, resource, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Create a CloudTrailTrail. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of CloudTrailTrail. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrReplaceWithResponseAsync(String resourceGroupName, String name, + CloudTrailInner resource, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (resource == null) { + return Mono.error(new IllegalArgumentException("Parameter resource is required and cannot be null.")); + } else { + resource.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.createOrReplace(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, resource, accept, context); + } + + /** + * Create a CloudTrailTrail. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of CloudTrailTrail. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, CloudTrailInner> beginCreateOrReplaceAsync(String resourceGroupName, + String name, CloudTrailInner resource) { + Mono>> mono = createOrReplaceWithResponseAsync(resourceGroupName, name, resource); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + CloudTrailInner.class, CloudTrailInner.class, this.client.getContext()); + } + + /** + * Create a CloudTrailTrail. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of CloudTrailTrail. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, CloudTrailInner> beginCreateOrReplaceAsync(String resourceGroupName, + String name, CloudTrailInner resource, Context context) { + context = this.client.mergeContext(context); + Mono>> mono + = createOrReplaceWithResponseAsync(resourceGroupName, name, resource, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + CloudTrailInner.class, CloudTrailInner.class, context); + } + + /** + * Create a CloudTrailTrail. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of CloudTrailTrail. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, CloudTrailInner> beginCreateOrReplace(String resourceGroupName, + String name, CloudTrailInner resource) { + return this.beginCreateOrReplaceAsync(resourceGroupName, name, resource).getSyncPoller(); + } + + /** + * Create a CloudTrailTrail. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of CloudTrailTrail. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, CloudTrailInner> beginCreateOrReplace(String resourceGroupName, + String name, CloudTrailInner resource, Context context) { + return this.beginCreateOrReplaceAsync(resourceGroupName, name, resource, context).getSyncPoller(); + } + + /** + * Create a CloudTrailTrail. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of CloudTrailTrail. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrReplaceAsync(String resourceGroupName, String name, + CloudTrailInner resource) { + return beginCreateOrReplaceAsync(resourceGroupName, name, resource).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create a CloudTrailTrail. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of CloudTrailTrail. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrReplaceAsync(String resourceGroupName, String name, CloudTrailInner resource, + Context context) { + return beginCreateOrReplaceAsync(resourceGroupName, name, resource, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create a CloudTrailTrail. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of CloudTrailTrail. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public CloudTrailInner createOrReplace(String resourceGroupName, String name, CloudTrailInner resource) { + return createOrReplaceAsync(resourceGroupName, name, resource).block(); + } + + /** + * Create a CloudTrailTrail. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of CloudTrailTrail. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public CloudTrailInner createOrReplace(String resourceGroupName, String name, CloudTrailInner resource, + Context context) { + return createOrReplaceAsync(resourceGroupName, name, resource, context).block(); + } + + /** + * Update a CloudTrailTrail. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of CloudTrailTrail. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync(String resourceGroupName, String name, + CloudTrailTagsUpdate properties) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (properties == null) { + return Mono.error(new IllegalArgumentException("Parameter properties is required and cannot be null.")); + } else { + properties.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.update(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, properties, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Update a CloudTrailTrail. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of CloudTrailTrail. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync(String resourceGroupName, String name, + CloudTrailTagsUpdate properties, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (properties == null) { + return Mono.error(new IllegalArgumentException("Parameter properties is required and cannot be null.")); + } else { + properties.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.update(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, name, properties, accept, context); + } + + /** + * Update a CloudTrailTrail. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of CloudTrailTrail. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, CloudTrailInner> beginUpdateAsync(String resourceGroupName, + String name, CloudTrailTagsUpdate properties) { + Mono>> mono = updateWithResponseAsync(resourceGroupName, name, properties); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + CloudTrailInner.class, CloudTrailInner.class, this.client.getContext()); + } + + /** + * Update a CloudTrailTrail. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of CloudTrailTrail. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, CloudTrailInner> beginUpdateAsync(String resourceGroupName, + String name, CloudTrailTagsUpdate properties, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = updateWithResponseAsync(resourceGroupName, name, properties, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + CloudTrailInner.class, CloudTrailInner.class, context); + } + + /** + * Update a CloudTrailTrail. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of CloudTrailTrail. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, CloudTrailInner> beginUpdate(String resourceGroupName, String name, + CloudTrailTagsUpdate properties) { + return this.beginUpdateAsync(resourceGroupName, name, properties).getSyncPoller(); + } + + /** + * Update a CloudTrailTrail. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of CloudTrailTrail. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, CloudTrailInner> beginUpdate(String resourceGroupName, String name, + CloudTrailTagsUpdate properties, Context context) { + return this.beginUpdateAsync(resourceGroupName, name, properties, context).getSyncPoller(); + } + + /** + * Update a CloudTrailTrail. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of CloudTrailTrail. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync(String resourceGroupName, String name, CloudTrailTagsUpdate properties) { + return beginUpdateAsync(resourceGroupName, name, properties).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Update a CloudTrailTrail. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of CloudTrailTrail. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync(String resourceGroupName, String name, CloudTrailTagsUpdate properties, + Context context) { + return beginUpdateAsync(resourceGroupName, name, properties, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Update a CloudTrailTrail. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of CloudTrailTrail. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public CloudTrailInner update(String resourceGroupName, String name, CloudTrailTagsUpdate properties) { + return updateAsync(resourceGroupName, name, properties).block(); + } + + /** + * Update a CloudTrailTrail. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of CloudTrailTrail. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public CloudTrailInner update(String resourceGroupName, String name, CloudTrailTagsUpdate properties, + Context context) { + return updateAsync(resourceGroupName, name, properties, context).block(); + } + + /** + * Delete a CloudTrailTrail. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of CloudTrailTrail. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync(String resourceGroupName, String name) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Delete a CloudTrailTrail. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of CloudTrailTrail. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync(String resourceGroupName, String name, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.delete(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, name, accept, context); + } + + /** + * Delete a CloudTrailTrail. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of CloudTrailTrail. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String name) { + Mono>> mono = deleteWithResponseAsync(resourceGroupName, name); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); + } + + /** + * Delete a CloudTrailTrail. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of CloudTrailTrail. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String name, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = deleteWithResponseAsync(resourceGroupName, name, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + context); + } + + /** + * Delete a CloudTrailTrail. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of CloudTrailTrail. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String name) { + return this.beginDeleteAsync(resourceGroupName, name).getSyncPoller(); + } + + /** + * Delete a CloudTrailTrail. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of CloudTrailTrail. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String name, Context context) { + return this.beginDeleteAsync(resourceGroupName, name, context).getSyncPoller(); + } + + /** + * Delete a CloudTrailTrail. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of CloudTrailTrail. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String name) { + return beginDeleteAsync(resourceGroupName, name).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete a CloudTrailTrail. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of CloudTrailTrail. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String name, Context context) { + return beginDeleteAsync(resourceGroupName, name, context).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete a CloudTrailTrail. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of CloudTrailTrail. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String name) { + deleteAsync(resourceGroupName, name).block(); + } + + /** + * Delete a CloudTrailTrail. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of CloudTrailTrail. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String name, Context context) { + deleteAsync(resourceGroupName, name, context).block(); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a CloudTrailTrail list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listBySubscriptionNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), + res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a CloudTrailTrail list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listBySubscriptionNextSinglePageAsync(String nextLink, + Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a CloudTrailTrail list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), + res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a CloudTrailTrail list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupNextSinglePageAsync(String nextLink, + Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/CloudTrailTrailsImpl.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/CloudTrailTrailsImpl.java new file mode 100644 index 000000000000..dd842d1c554a --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/CloudTrailTrailsImpl.java @@ -0,0 +1,145 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.awsconnector.fluent.CloudTrailTrailsClient; +import com.azure.resourcemanager.awsconnector.fluent.models.CloudTrailInner; +import com.azure.resourcemanager.awsconnector.models.CloudTrail; +import com.azure.resourcemanager.awsconnector.models.CloudTrailTrails; + +public final class CloudTrailTrailsImpl implements CloudTrailTrails { + private static final ClientLogger LOGGER = new ClientLogger(CloudTrailTrailsImpl.class); + + private final CloudTrailTrailsClient innerClient; + + private final com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager; + + public CloudTrailTrailsImpl(CloudTrailTrailsClient innerClient, + com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return ResourceManagerUtils.mapPage(inner, inner1 -> new CloudTrailImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new CloudTrailImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName); + return ResourceManagerUtils.mapPage(inner, inner1 -> new CloudTrailImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new CloudTrailImpl(inner1, this.manager())); + } + + public Response getByResourceGroupWithResponse(String resourceGroupName, String name, Context context) { + Response inner + = this.serviceClient().getByResourceGroupWithResponse(resourceGroupName, name, context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new CloudTrailImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public CloudTrail getByResourceGroup(String resourceGroupName, String name) { + CloudTrailInner inner = this.serviceClient().getByResourceGroup(resourceGroupName, name); + if (inner != null) { + return new CloudTrailImpl(inner, this.manager()); + } else { + return null; + } + } + + public void deleteByResourceGroup(String resourceGroupName, String name) { + this.serviceClient().delete(resourceGroupName, name); + } + + public void delete(String resourceGroupName, String name, Context context) { + this.serviceClient().delete(resourceGroupName, name, context); + } + + public CloudTrail getById(String id) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String name = ResourceManagerUtils.getValueFromIdByName(id, "cloudTrailTrails"); + if (name == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'cloudTrailTrails'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, name, Context.NONE).getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String name = ResourceManagerUtils.getValueFromIdByName(id, "cloudTrailTrails"); + if (name == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'cloudTrailTrails'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, name, context); + } + + public void deleteById(String id) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String name = ResourceManagerUtils.getValueFromIdByName(id, "cloudTrailTrails"); + if (name == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'cloudTrailTrails'.", id))); + } + this.delete(resourceGroupName, name, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String name = ResourceManagerUtils.getValueFromIdByName(id, "cloudTrailTrails"); + if (name == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'cloudTrailTrails'.", id))); + } + this.delete(resourceGroupName, name, context); + } + + private CloudTrailTrailsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.awsconnector.AwsconnectorManager manager() { + return this.serviceManager; + } + + public CloudTrailImpl define(String name) { + return new CloudTrailImpl(name, this.manager()); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/CloudWatchAlarmImpl.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/CloudWatchAlarmImpl.java new file mode 100644 index 000000000000..2231e8cf7e56 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/CloudWatchAlarmImpl.java @@ -0,0 +1,177 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.implementation; + +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.awsconnector.fluent.models.CloudWatchAlarmInner; +import com.azure.resourcemanager.awsconnector.models.CloudWatchAlarm; +import com.azure.resourcemanager.awsconnector.models.CloudWatchAlarmProperties; +import com.azure.resourcemanager.awsconnector.models.CloudWatchAlarmTagsUpdate; +import java.util.Collections; +import java.util.Map; + +public final class CloudWatchAlarmImpl implements CloudWatchAlarm, CloudWatchAlarm.Definition, CloudWatchAlarm.Update { + private CloudWatchAlarmInner innerObject; + + private final com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public String location() { + return this.innerModel().location(); + } + + public Map tags() { + Map inner = this.innerModel().tags(); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } + } + + public CloudWatchAlarmProperties properties() { + return this.innerModel().properties(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public String resourceGroupName() { + return resourceGroupName; + } + + public CloudWatchAlarmInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.awsconnector.AwsconnectorManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String name; + + private CloudWatchAlarmTagsUpdate updateProperties; + + public CloudWatchAlarmImpl withExistingResourceGroup(String resourceGroupName) { + this.resourceGroupName = resourceGroupName; + return this; + } + + public CloudWatchAlarm create() { + this.innerObject = serviceManager.serviceClient() + .getCloudWatchAlarms() + .createOrReplace(resourceGroupName, name, this.innerModel(), Context.NONE); + return this; + } + + public CloudWatchAlarm create(Context context) { + this.innerObject = serviceManager.serviceClient() + .getCloudWatchAlarms() + .createOrReplace(resourceGroupName, name, this.innerModel(), context); + return this; + } + + CloudWatchAlarmImpl(String name, com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager) { + this.innerObject = new CloudWatchAlarmInner(); + this.serviceManager = serviceManager; + this.name = name; + } + + public CloudWatchAlarmImpl update() { + this.updateProperties = new CloudWatchAlarmTagsUpdate(); + return this; + } + + public CloudWatchAlarm apply() { + this.innerObject = serviceManager.serviceClient() + .getCloudWatchAlarms() + .update(resourceGroupName, name, updateProperties, Context.NONE); + return this; + } + + public CloudWatchAlarm apply(Context context) { + this.innerObject = serviceManager.serviceClient() + .getCloudWatchAlarms() + .update(resourceGroupName, name, updateProperties, context); + return this; + } + + CloudWatchAlarmImpl(CloudWatchAlarmInner innerObject, + com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.name = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "cloudWatchAlarms"); + } + + public CloudWatchAlarm refresh() { + this.innerObject = serviceManager.serviceClient() + .getCloudWatchAlarms() + .getByResourceGroupWithResponse(resourceGroupName, name, Context.NONE) + .getValue(); + return this; + } + + public CloudWatchAlarm refresh(Context context) { + this.innerObject = serviceManager.serviceClient() + .getCloudWatchAlarms() + .getByResourceGroupWithResponse(resourceGroupName, name, context) + .getValue(); + return this; + } + + public CloudWatchAlarmImpl withRegion(Region location) { + this.innerModel().withLocation(location.toString()); + return this; + } + + public CloudWatchAlarmImpl withRegion(String location) { + this.innerModel().withLocation(location); + return this; + } + + public CloudWatchAlarmImpl withTags(Map tags) { + if (isInCreateMode()) { + this.innerModel().withTags(tags); + return this; + } else { + this.updateProperties.withTags(tags); + return this; + } + } + + public CloudWatchAlarmImpl withProperties(CloudWatchAlarmProperties properties) { + this.innerModel().withProperties(properties); + return this; + } + + private boolean isInCreateMode() { + return this.innerModel().id() == null; + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/CloudWatchAlarmsClientImpl.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/CloudWatchAlarmsClientImpl.java new file mode 100644 index 000000000000..1180009c7a50 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/CloudWatchAlarmsClientImpl.java @@ -0,0 +1,1278 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.Patch; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.awsconnector.fluent.CloudWatchAlarmsClient; +import com.azure.resourcemanager.awsconnector.fluent.models.CloudWatchAlarmInner; +import com.azure.resourcemanager.awsconnector.models.CloudWatchAlarmListResult; +import com.azure.resourcemanager.awsconnector.models.CloudWatchAlarmTagsUpdate; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in CloudWatchAlarmsClient. + */ +public final class CloudWatchAlarmsClientImpl implements CloudWatchAlarmsClient { + /** + * The proxy service used to perform REST calls. + */ + private final CloudWatchAlarmsService service; + + /** + * The service client containing this operation class. + */ + private final MicrosoftAwsConnectorImpl client; + + /** + * Initializes an instance of CloudWatchAlarmsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + CloudWatchAlarmsClientImpl(MicrosoftAwsConnectorImpl client) { + this.service + = RestProxy.create(CloudWatchAlarmsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for MicrosoftAwsConnectorCloudWatchAlarms to be used by the proxy service + * to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "MicrosoftAwsConnecto") + public interface CloudWatchAlarmsService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.AwsConnector/cloudWatchAlarms") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/cloudWatchAlarms") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroup(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/cloudWatchAlarms/{name}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getByResourceGroup(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("name") String name, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/cloudWatchAlarms/{name}") + @ExpectedResponses({ 200, 201 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrReplace(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("name") String name, + @BodyParam("application/json") CloudWatchAlarmInner resource, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/cloudWatchAlarms/{name}") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> update(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("name") String name, + @BodyParam("application/json") CloudWatchAlarmTagsUpdate properties, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/cloudWatchAlarms/{name}") + @ExpectedResponses({ 202, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("name") String name, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listBySubscriptionNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroupNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); + } + + /** + * List CloudWatchAlarm resources by subscription ID. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a CloudWatchAlarm list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync() { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List CloudWatchAlarm resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a CloudWatchAlarm list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), accept, + context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * List CloudWatchAlarm resources by subscription ID. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a CloudWatchAlarm list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>(() -> listSinglePageAsync(), + nextLink -> listBySubscriptionNextSinglePageAsync(nextLink)); + } + + /** + * List CloudWatchAlarm resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a CloudWatchAlarm list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(Context context) { + return new PagedFlux<>(() -> listSinglePageAsync(context), + nextLink -> listBySubscriptionNextSinglePageAsync(nextLink, context)); + } + + /** + * List CloudWatchAlarm resources by subscription ID. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a CloudWatchAlarm list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + return new PagedIterable<>(listAsync()); + } + + /** + * List CloudWatchAlarm resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a CloudWatchAlarm list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Context context) { + return new PagedIterable<>(listAsync(context)); + } + + /** + * List CloudWatchAlarm resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a CloudWatchAlarm list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List CloudWatchAlarm resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a CloudWatchAlarm list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * List CloudWatchAlarm resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a CloudWatchAlarm list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName) { + return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); + } + + /** + * List CloudWatchAlarm resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a CloudWatchAlarm list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName, Context context) { + return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName, context), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink, context)); + } + + /** + * List CloudWatchAlarm resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a CloudWatchAlarm list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName)); + } + + /** + * List CloudWatchAlarm resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a CloudWatchAlarm list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, context)); + } + + /** + * Get a CloudWatchAlarm. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of CloudWatchAlarm. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a CloudWatchAlarm along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync(String resourceGroupName, + String name) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.getByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get a CloudWatchAlarm. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of CloudWatchAlarm. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a CloudWatchAlarm along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync(String resourceGroupName, + String name, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.getByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, accept, context); + } + + /** + * Get a CloudWatchAlarm. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of CloudWatchAlarm. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a CloudWatchAlarm on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getByResourceGroupAsync(String resourceGroupName, String name) { + return getByResourceGroupWithResponseAsync(resourceGroupName, name) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Get a CloudWatchAlarm. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of CloudWatchAlarm. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a CloudWatchAlarm along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getByResourceGroupWithResponse(String resourceGroupName, String name, + Context context) { + return getByResourceGroupWithResponseAsync(resourceGroupName, name, context).block(); + } + + /** + * Get a CloudWatchAlarm. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of CloudWatchAlarm. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a CloudWatchAlarm. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public CloudWatchAlarmInner getByResourceGroup(String resourceGroupName, String name) { + return getByResourceGroupWithResponse(resourceGroupName, name, Context.NONE).getValue(); + } + + /** + * Create a CloudWatchAlarm. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of CloudWatchAlarm. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrReplaceWithResponseAsync(String resourceGroupName, String name, + CloudWatchAlarmInner resource) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (resource == null) { + return Mono.error(new IllegalArgumentException("Parameter resource is required and cannot be null.")); + } else { + resource.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.createOrReplace(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, resource, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Create a CloudWatchAlarm. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of CloudWatchAlarm. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrReplaceWithResponseAsync(String resourceGroupName, String name, + CloudWatchAlarmInner resource, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (resource == null) { + return Mono.error(new IllegalArgumentException("Parameter resource is required and cannot be null.")); + } else { + resource.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.createOrReplace(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, resource, accept, context); + } + + /** + * Create a CloudWatchAlarm. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of CloudWatchAlarm. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, CloudWatchAlarmInner> + beginCreateOrReplaceAsync(String resourceGroupName, String name, CloudWatchAlarmInner resource) { + Mono>> mono = createOrReplaceWithResponseAsync(resourceGroupName, name, resource); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + CloudWatchAlarmInner.class, CloudWatchAlarmInner.class, this.client.getContext()); + } + + /** + * Create a CloudWatchAlarm. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of CloudWatchAlarm. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, CloudWatchAlarmInner> beginCreateOrReplaceAsync( + String resourceGroupName, String name, CloudWatchAlarmInner resource, Context context) { + context = this.client.mergeContext(context); + Mono>> mono + = createOrReplaceWithResponseAsync(resourceGroupName, name, resource, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + CloudWatchAlarmInner.class, CloudWatchAlarmInner.class, context); + } + + /** + * Create a CloudWatchAlarm. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of CloudWatchAlarm. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, CloudWatchAlarmInner> + beginCreateOrReplace(String resourceGroupName, String name, CloudWatchAlarmInner resource) { + return this.beginCreateOrReplaceAsync(resourceGroupName, name, resource).getSyncPoller(); + } + + /** + * Create a CloudWatchAlarm. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of CloudWatchAlarm. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, CloudWatchAlarmInner> + beginCreateOrReplace(String resourceGroupName, String name, CloudWatchAlarmInner resource, Context context) { + return this.beginCreateOrReplaceAsync(resourceGroupName, name, resource, context).getSyncPoller(); + } + + /** + * Create a CloudWatchAlarm. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of CloudWatchAlarm. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrReplaceAsync(String resourceGroupName, String name, + CloudWatchAlarmInner resource) { + return beginCreateOrReplaceAsync(resourceGroupName, name, resource).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create a CloudWatchAlarm. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of CloudWatchAlarm. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrReplaceAsync(String resourceGroupName, String name, + CloudWatchAlarmInner resource, Context context) { + return beginCreateOrReplaceAsync(resourceGroupName, name, resource, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create a CloudWatchAlarm. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of CloudWatchAlarm. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public CloudWatchAlarmInner createOrReplace(String resourceGroupName, String name, CloudWatchAlarmInner resource) { + return createOrReplaceAsync(resourceGroupName, name, resource).block(); + } + + /** + * Create a CloudWatchAlarm. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of CloudWatchAlarm. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public CloudWatchAlarmInner createOrReplace(String resourceGroupName, String name, CloudWatchAlarmInner resource, + Context context) { + return createOrReplaceAsync(resourceGroupName, name, resource, context).block(); + } + + /** + * Update a CloudWatchAlarm. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of CloudWatchAlarm. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync(String resourceGroupName, String name, + CloudWatchAlarmTagsUpdate properties) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (properties == null) { + return Mono.error(new IllegalArgumentException("Parameter properties is required and cannot be null.")); + } else { + properties.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.update(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, properties, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Update a CloudWatchAlarm. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of CloudWatchAlarm. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync(String resourceGroupName, String name, + CloudWatchAlarmTagsUpdate properties, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (properties == null) { + return Mono.error(new IllegalArgumentException("Parameter properties is required and cannot be null.")); + } else { + properties.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.update(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, name, properties, accept, context); + } + + /** + * Update a CloudWatchAlarm. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of CloudWatchAlarm. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, CloudWatchAlarmInner> + beginUpdateAsync(String resourceGroupName, String name, CloudWatchAlarmTagsUpdate properties) { + Mono>> mono = updateWithResponseAsync(resourceGroupName, name, properties); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + CloudWatchAlarmInner.class, CloudWatchAlarmInner.class, this.client.getContext()); + } + + /** + * Update a CloudWatchAlarm. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of CloudWatchAlarm. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, CloudWatchAlarmInner> + beginUpdateAsync(String resourceGroupName, String name, CloudWatchAlarmTagsUpdate properties, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = updateWithResponseAsync(resourceGroupName, name, properties, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + CloudWatchAlarmInner.class, CloudWatchAlarmInner.class, context); + } + + /** + * Update a CloudWatchAlarm. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of CloudWatchAlarm. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, CloudWatchAlarmInner> beginUpdate(String resourceGroupName, + String name, CloudWatchAlarmTagsUpdate properties) { + return this.beginUpdateAsync(resourceGroupName, name, properties).getSyncPoller(); + } + + /** + * Update a CloudWatchAlarm. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of CloudWatchAlarm. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, CloudWatchAlarmInner> beginUpdate(String resourceGroupName, + String name, CloudWatchAlarmTagsUpdate properties, Context context) { + return this.beginUpdateAsync(resourceGroupName, name, properties, context).getSyncPoller(); + } + + /** + * Update a CloudWatchAlarm. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of CloudWatchAlarm. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync(String resourceGroupName, String name, + CloudWatchAlarmTagsUpdate properties) { + return beginUpdateAsync(resourceGroupName, name, properties).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Update a CloudWatchAlarm. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of CloudWatchAlarm. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync(String resourceGroupName, String name, + CloudWatchAlarmTagsUpdate properties, Context context) { + return beginUpdateAsync(resourceGroupName, name, properties, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Update a CloudWatchAlarm. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of CloudWatchAlarm. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public CloudWatchAlarmInner update(String resourceGroupName, String name, CloudWatchAlarmTagsUpdate properties) { + return updateAsync(resourceGroupName, name, properties).block(); + } + + /** + * Update a CloudWatchAlarm. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of CloudWatchAlarm. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public CloudWatchAlarmInner update(String resourceGroupName, String name, CloudWatchAlarmTagsUpdate properties, + Context context) { + return updateAsync(resourceGroupName, name, properties, context).block(); + } + + /** + * Delete a CloudWatchAlarm. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of CloudWatchAlarm. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync(String resourceGroupName, String name) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Delete a CloudWatchAlarm. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of CloudWatchAlarm. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync(String resourceGroupName, String name, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.delete(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, name, accept, context); + } + + /** + * Delete a CloudWatchAlarm. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of CloudWatchAlarm. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String name) { + Mono>> mono = deleteWithResponseAsync(resourceGroupName, name); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); + } + + /** + * Delete a CloudWatchAlarm. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of CloudWatchAlarm. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String name, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = deleteWithResponseAsync(resourceGroupName, name, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + context); + } + + /** + * Delete a CloudWatchAlarm. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of CloudWatchAlarm. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String name) { + return this.beginDeleteAsync(resourceGroupName, name).getSyncPoller(); + } + + /** + * Delete a CloudWatchAlarm. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of CloudWatchAlarm. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String name, Context context) { + return this.beginDeleteAsync(resourceGroupName, name, context).getSyncPoller(); + } + + /** + * Delete a CloudWatchAlarm. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of CloudWatchAlarm. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String name) { + return beginDeleteAsync(resourceGroupName, name).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete a CloudWatchAlarm. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of CloudWatchAlarm. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String name, Context context) { + return beginDeleteAsync(resourceGroupName, name, context).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete a CloudWatchAlarm. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of CloudWatchAlarm. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String name) { + deleteAsync(resourceGroupName, name).block(); + } + + /** + * Delete a CloudWatchAlarm. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of CloudWatchAlarm. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String name, Context context) { + deleteAsync(resourceGroupName, name, context).block(); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a CloudWatchAlarm list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listBySubscriptionNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a CloudWatchAlarm list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listBySubscriptionNextSinglePageAsync(String nextLink, + Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a CloudWatchAlarm list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a CloudWatchAlarm list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupNextSinglePageAsync(String nextLink, + Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/CloudWatchAlarmsImpl.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/CloudWatchAlarmsImpl.java new file mode 100644 index 000000000000..9ef9cc873c5c --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/CloudWatchAlarmsImpl.java @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.awsconnector.fluent.CloudWatchAlarmsClient; +import com.azure.resourcemanager.awsconnector.fluent.models.CloudWatchAlarmInner; +import com.azure.resourcemanager.awsconnector.models.CloudWatchAlarm; +import com.azure.resourcemanager.awsconnector.models.CloudWatchAlarms; + +public final class CloudWatchAlarmsImpl implements CloudWatchAlarms { + private static final ClientLogger LOGGER = new ClientLogger(CloudWatchAlarmsImpl.class); + + private final CloudWatchAlarmsClient innerClient; + + private final com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager; + + public CloudWatchAlarmsImpl(CloudWatchAlarmsClient innerClient, + com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return ResourceManagerUtils.mapPage(inner, inner1 -> new CloudWatchAlarmImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new CloudWatchAlarmImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName); + return ResourceManagerUtils.mapPage(inner, inner1 -> new CloudWatchAlarmImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + PagedIterable inner + = this.serviceClient().listByResourceGroup(resourceGroupName, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new CloudWatchAlarmImpl(inner1, this.manager())); + } + + public Response getByResourceGroupWithResponse(String resourceGroupName, String name, + Context context) { + Response inner + = this.serviceClient().getByResourceGroupWithResponse(resourceGroupName, name, context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new CloudWatchAlarmImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public CloudWatchAlarm getByResourceGroup(String resourceGroupName, String name) { + CloudWatchAlarmInner inner = this.serviceClient().getByResourceGroup(resourceGroupName, name); + if (inner != null) { + return new CloudWatchAlarmImpl(inner, this.manager()); + } else { + return null; + } + } + + public void deleteByResourceGroup(String resourceGroupName, String name) { + this.serviceClient().delete(resourceGroupName, name); + } + + public void delete(String resourceGroupName, String name, Context context) { + this.serviceClient().delete(resourceGroupName, name, context); + } + + public CloudWatchAlarm getById(String id) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String name = ResourceManagerUtils.getValueFromIdByName(id, "cloudWatchAlarms"); + if (name == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'cloudWatchAlarms'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, name, Context.NONE).getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String name = ResourceManagerUtils.getValueFromIdByName(id, "cloudWatchAlarms"); + if (name == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'cloudWatchAlarms'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, name, context); + } + + public void deleteById(String id) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String name = ResourceManagerUtils.getValueFromIdByName(id, "cloudWatchAlarms"); + if (name == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'cloudWatchAlarms'.", id))); + } + this.delete(resourceGroupName, name, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String name = ResourceManagerUtils.getValueFromIdByName(id, "cloudWatchAlarms"); + if (name == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'cloudWatchAlarms'.", id))); + } + this.delete(resourceGroupName, name, context); + } + + private CloudWatchAlarmsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.awsconnector.AwsconnectorManager manager() { + return this.serviceManager; + } + + public CloudWatchAlarmImpl define(String name) { + return new CloudWatchAlarmImpl(name, this.manager()); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/CodeBuildProjectImpl.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/CodeBuildProjectImpl.java new file mode 100644 index 000000000000..acceb5d4d3d9 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/CodeBuildProjectImpl.java @@ -0,0 +1,178 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.implementation; + +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.awsconnector.fluent.models.CodeBuildProjectInner; +import com.azure.resourcemanager.awsconnector.models.CodeBuildProject; +import com.azure.resourcemanager.awsconnector.models.CodeBuildProjectProperties; +import com.azure.resourcemanager.awsconnector.models.CodeBuildProjectTagsUpdate; +import java.util.Collections; +import java.util.Map; + +public final class CodeBuildProjectImpl + implements CodeBuildProject, CodeBuildProject.Definition, CodeBuildProject.Update { + private CodeBuildProjectInner innerObject; + + private final com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public String location() { + return this.innerModel().location(); + } + + public Map tags() { + Map inner = this.innerModel().tags(); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } + } + + public CodeBuildProjectProperties properties() { + return this.innerModel().properties(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public String resourceGroupName() { + return resourceGroupName; + } + + public CodeBuildProjectInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.awsconnector.AwsconnectorManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String name; + + private CodeBuildProjectTagsUpdate updateProperties; + + public CodeBuildProjectImpl withExistingResourceGroup(String resourceGroupName) { + this.resourceGroupName = resourceGroupName; + return this; + } + + public CodeBuildProject create() { + this.innerObject = serviceManager.serviceClient() + .getCodeBuildProjects() + .createOrReplace(resourceGroupName, name, this.innerModel(), Context.NONE); + return this; + } + + public CodeBuildProject create(Context context) { + this.innerObject = serviceManager.serviceClient() + .getCodeBuildProjects() + .createOrReplace(resourceGroupName, name, this.innerModel(), context); + return this; + } + + CodeBuildProjectImpl(String name, com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager) { + this.innerObject = new CodeBuildProjectInner(); + this.serviceManager = serviceManager; + this.name = name; + } + + public CodeBuildProjectImpl update() { + this.updateProperties = new CodeBuildProjectTagsUpdate(); + return this; + } + + public CodeBuildProject apply() { + this.innerObject = serviceManager.serviceClient() + .getCodeBuildProjects() + .update(resourceGroupName, name, updateProperties, Context.NONE); + return this; + } + + public CodeBuildProject apply(Context context) { + this.innerObject = serviceManager.serviceClient() + .getCodeBuildProjects() + .update(resourceGroupName, name, updateProperties, context); + return this; + } + + CodeBuildProjectImpl(CodeBuildProjectInner innerObject, + com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.name = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "codeBuildProjects"); + } + + public CodeBuildProject refresh() { + this.innerObject = serviceManager.serviceClient() + .getCodeBuildProjects() + .getByResourceGroupWithResponse(resourceGroupName, name, Context.NONE) + .getValue(); + return this; + } + + public CodeBuildProject refresh(Context context) { + this.innerObject = serviceManager.serviceClient() + .getCodeBuildProjects() + .getByResourceGroupWithResponse(resourceGroupName, name, context) + .getValue(); + return this; + } + + public CodeBuildProjectImpl withRegion(Region location) { + this.innerModel().withLocation(location.toString()); + return this; + } + + public CodeBuildProjectImpl withRegion(String location) { + this.innerModel().withLocation(location); + return this; + } + + public CodeBuildProjectImpl withTags(Map tags) { + if (isInCreateMode()) { + this.innerModel().withTags(tags); + return this; + } else { + this.updateProperties.withTags(tags); + return this; + } + } + + public CodeBuildProjectImpl withProperties(CodeBuildProjectProperties properties) { + this.innerModel().withProperties(properties); + return this; + } + + private boolean isInCreateMode() { + return this.innerModel().id() == null; + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/CodeBuildProjectsClientImpl.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/CodeBuildProjectsClientImpl.java new file mode 100644 index 000000000000..ac67623e5bfe --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/CodeBuildProjectsClientImpl.java @@ -0,0 +1,1281 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.Patch; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.awsconnector.fluent.CodeBuildProjectsClient; +import com.azure.resourcemanager.awsconnector.fluent.models.CodeBuildProjectInner; +import com.azure.resourcemanager.awsconnector.models.CodeBuildProjectListResult; +import com.azure.resourcemanager.awsconnector.models.CodeBuildProjectTagsUpdate; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in CodeBuildProjectsClient. + */ +public final class CodeBuildProjectsClientImpl implements CodeBuildProjectsClient { + /** + * The proxy service used to perform REST calls. + */ + private final CodeBuildProjectsService service; + + /** + * The service client containing this operation class. + */ + private final MicrosoftAwsConnectorImpl client; + + /** + * Initializes an instance of CodeBuildProjectsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + CodeBuildProjectsClientImpl(MicrosoftAwsConnectorImpl client) { + this.service + = RestProxy.create(CodeBuildProjectsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for MicrosoftAwsConnectorCodeBuildProjects to be used by the proxy + * service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "MicrosoftAwsConnecto") + public interface CodeBuildProjectsService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.AwsConnector/codeBuildProjects") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/codeBuildProjects") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroup(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/codeBuildProjects/{name}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getByResourceGroup(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("name") String name, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/codeBuildProjects/{name}") + @ExpectedResponses({ 200, 201 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrReplace(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("name") String name, + @BodyParam("application/json") CodeBuildProjectInner resource, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/codeBuildProjects/{name}") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> update(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("name") String name, + @BodyParam("application/json") CodeBuildProjectTagsUpdate properties, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/codeBuildProjects/{name}") + @ExpectedResponses({ 202, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("name") String name, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listBySubscriptionNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroupNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); + } + + /** + * List CodeBuildProject resources by subscription ID. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a CodeBuildProject list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync() { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List CodeBuildProject resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a CodeBuildProject list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), accept, + context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * List CodeBuildProject resources by subscription ID. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a CodeBuildProject list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>(() -> listSinglePageAsync(), + nextLink -> listBySubscriptionNextSinglePageAsync(nextLink)); + } + + /** + * List CodeBuildProject resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a CodeBuildProject list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(Context context) { + return new PagedFlux<>(() -> listSinglePageAsync(context), + nextLink -> listBySubscriptionNextSinglePageAsync(nextLink, context)); + } + + /** + * List CodeBuildProject resources by subscription ID. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a CodeBuildProject list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + return new PagedIterable<>(listAsync()); + } + + /** + * List CodeBuildProject resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a CodeBuildProject list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Context context) { + return new PagedIterable<>(listAsync(context)); + } + + /** + * List CodeBuildProject resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a CodeBuildProject list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List CodeBuildProject resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a CodeBuildProject list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * List CodeBuildProject resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a CodeBuildProject list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName) { + return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); + } + + /** + * List CodeBuildProject resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a CodeBuildProject list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName, Context context) { + return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName, context), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink, context)); + } + + /** + * List CodeBuildProject resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a CodeBuildProject list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName)); + } + + /** + * List CodeBuildProject resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a CodeBuildProject list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, context)); + } + + /** + * Get a CodeBuildProject. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of CodeBuildProject. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a CodeBuildProject along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync(String resourceGroupName, + String name) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.getByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get a CodeBuildProject. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of CodeBuildProject. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a CodeBuildProject along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync(String resourceGroupName, + String name, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.getByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, accept, context); + } + + /** + * Get a CodeBuildProject. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of CodeBuildProject. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a CodeBuildProject on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getByResourceGroupAsync(String resourceGroupName, String name) { + return getByResourceGroupWithResponseAsync(resourceGroupName, name) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Get a CodeBuildProject. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of CodeBuildProject. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a CodeBuildProject along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getByResourceGroupWithResponse(String resourceGroupName, String name, + Context context) { + return getByResourceGroupWithResponseAsync(resourceGroupName, name, context).block(); + } + + /** + * Get a CodeBuildProject. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of CodeBuildProject. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a CodeBuildProject. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public CodeBuildProjectInner getByResourceGroup(String resourceGroupName, String name) { + return getByResourceGroupWithResponse(resourceGroupName, name, Context.NONE).getValue(); + } + + /** + * Create a CodeBuildProject. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of CodeBuildProject. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrReplaceWithResponseAsync(String resourceGroupName, String name, + CodeBuildProjectInner resource) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (resource == null) { + return Mono.error(new IllegalArgumentException("Parameter resource is required and cannot be null.")); + } else { + resource.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.createOrReplace(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, resource, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Create a CodeBuildProject. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of CodeBuildProject. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrReplaceWithResponseAsync(String resourceGroupName, String name, + CodeBuildProjectInner resource, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (resource == null) { + return Mono.error(new IllegalArgumentException("Parameter resource is required and cannot be null.")); + } else { + resource.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.createOrReplace(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, resource, accept, context); + } + + /** + * Create a CodeBuildProject. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of CodeBuildProject. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, CodeBuildProjectInner> + beginCreateOrReplaceAsync(String resourceGroupName, String name, CodeBuildProjectInner resource) { + Mono>> mono = createOrReplaceWithResponseAsync(resourceGroupName, name, resource); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), CodeBuildProjectInner.class, CodeBuildProjectInner.class, + this.client.getContext()); + } + + /** + * Create a CodeBuildProject. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of CodeBuildProject. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, CodeBuildProjectInner> beginCreateOrReplaceAsync( + String resourceGroupName, String name, CodeBuildProjectInner resource, Context context) { + context = this.client.mergeContext(context); + Mono>> mono + = createOrReplaceWithResponseAsync(resourceGroupName, name, resource, context); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), CodeBuildProjectInner.class, CodeBuildProjectInner.class, context); + } + + /** + * Create a CodeBuildProject. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of CodeBuildProject. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, CodeBuildProjectInner> + beginCreateOrReplace(String resourceGroupName, String name, CodeBuildProjectInner resource) { + return this.beginCreateOrReplaceAsync(resourceGroupName, name, resource).getSyncPoller(); + } + + /** + * Create a CodeBuildProject. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of CodeBuildProject. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, CodeBuildProjectInner> + beginCreateOrReplace(String resourceGroupName, String name, CodeBuildProjectInner resource, Context context) { + return this.beginCreateOrReplaceAsync(resourceGroupName, name, resource, context).getSyncPoller(); + } + + /** + * Create a CodeBuildProject. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of CodeBuildProject. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrReplaceAsync(String resourceGroupName, String name, + CodeBuildProjectInner resource) { + return beginCreateOrReplaceAsync(resourceGroupName, name, resource).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create a CodeBuildProject. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of CodeBuildProject. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrReplaceAsync(String resourceGroupName, String name, + CodeBuildProjectInner resource, Context context) { + return beginCreateOrReplaceAsync(resourceGroupName, name, resource, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create a CodeBuildProject. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of CodeBuildProject. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public CodeBuildProjectInner createOrReplace(String resourceGroupName, String name, + CodeBuildProjectInner resource) { + return createOrReplaceAsync(resourceGroupName, name, resource).block(); + } + + /** + * Create a CodeBuildProject. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of CodeBuildProject. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public CodeBuildProjectInner createOrReplace(String resourceGroupName, String name, CodeBuildProjectInner resource, + Context context) { + return createOrReplaceAsync(resourceGroupName, name, resource, context).block(); + } + + /** + * Update a CodeBuildProject. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of CodeBuildProject. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync(String resourceGroupName, String name, + CodeBuildProjectTagsUpdate properties) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (properties == null) { + return Mono.error(new IllegalArgumentException("Parameter properties is required and cannot be null.")); + } else { + properties.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.update(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, properties, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Update a CodeBuildProject. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of CodeBuildProject. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync(String resourceGroupName, String name, + CodeBuildProjectTagsUpdate properties, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (properties == null) { + return Mono.error(new IllegalArgumentException("Parameter properties is required and cannot be null.")); + } else { + properties.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.update(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, name, properties, accept, context); + } + + /** + * Update a CodeBuildProject. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of CodeBuildProject. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, CodeBuildProjectInner> + beginUpdateAsync(String resourceGroupName, String name, CodeBuildProjectTagsUpdate properties) { + Mono>> mono = updateWithResponseAsync(resourceGroupName, name, properties); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), CodeBuildProjectInner.class, CodeBuildProjectInner.class, + this.client.getContext()); + } + + /** + * Update a CodeBuildProject. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of CodeBuildProject. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, CodeBuildProjectInner> beginUpdateAsync( + String resourceGroupName, String name, CodeBuildProjectTagsUpdate properties, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = updateWithResponseAsync(resourceGroupName, name, properties, context); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), CodeBuildProjectInner.class, CodeBuildProjectInner.class, context); + } + + /** + * Update a CodeBuildProject. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of CodeBuildProject. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, CodeBuildProjectInner> beginUpdate(String resourceGroupName, + String name, CodeBuildProjectTagsUpdate properties) { + return this.beginUpdateAsync(resourceGroupName, name, properties).getSyncPoller(); + } + + /** + * Update a CodeBuildProject. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of CodeBuildProject. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, CodeBuildProjectInner> beginUpdate(String resourceGroupName, + String name, CodeBuildProjectTagsUpdate properties, Context context) { + return this.beginUpdateAsync(resourceGroupName, name, properties, context).getSyncPoller(); + } + + /** + * Update a CodeBuildProject. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of CodeBuildProject. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync(String resourceGroupName, String name, + CodeBuildProjectTagsUpdate properties) { + return beginUpdateAsync(resourceGroupName, name, properties).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Update a CodeBuildProject. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of CodeBuildProject. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync(String resourceGroupName, String name, + CodeBuildProjectTagsUpdate properties, Context context) { + return beginUpdateAsync(resourceGroupName, name, properties, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Update a CodeBuildProject. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of CodeBuildProject. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public CodeBuildProjectInner update(String resourceGroupName, String name, CodeBuildProjectTagsUpdate properties) { + return updateAsync(resourceGroupName, name, properties).block(); + } + + /** + * Update a CodeBuildProject. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of CodeBuildProject. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public CodeBuildProjectInner update(String resourceGroupName, String name, CodeBuildProjectTagsUpdate properties, + Context context) { + return updateAsync(resourceGroupName, name, properties, context).block(); + } + + /** + * Delete a CodeBuildProject. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of CodeBuildProject. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync(String resourceGroupName, String name) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Delete a CodeBuildProject. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of CodeBuildProject. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync(String resourceGroupName, String name, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.delete(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, name, accept, context); + } + + /** + * Delete a CodeBuildProject. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of CodeBuildProject. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String name) { + Mono>> mono = deleteWithResponseAsync(resourceGroupName, name); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); + } + + /** + * Delete a CodeBuildProject. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of CodeBuildProject. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String name, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = deleteWithResponseAsync(resourceGroupName, name, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + context); + } + + /** + * Delete a CodeBuildProject. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of CodeBuildProject. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String name) { + return this.beginDeleteAsync(resourceGroupName, name).getSyncPoller(); + } + + /** + * Delete a CodeBuildProject. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of CodeBuildProject. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String name, Context context) { + return this.beginDeleteAsync(resourceGroupName, name, context).getSyncPoller(); + } + + /** + * Delete a CodeBuildProject. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of CodeBuildProject. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String name) { + return beginDeleteAsync(resourceGroupName, name).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete a CodeBuildProject. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of CodeBuildProject. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String name, Context context) { + return beginDeleteAsync(resourceGroupName, name, context).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete a CodeBuildProject. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of CodeBuildProject. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String name) { + deleteAsync(resourceGroupName, name).block(); + } + + /** + * Delete a CodeBuildProject. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of CodeBuildProject. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String name, Context context) { + deleteAsync(resourceGroupName, name, context).block(); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a CodeBuildProject list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listBySubscriptionNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a CodeBuildProject list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listBySubscriptionNextSinglePageAsync(String nextLink, + Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a CodeBuildProject list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a CodeBuildProject list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupNextSinglePageAsync(String nextLink, + Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/CodeBuildProjectsImpl.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/CodeBuildProjectsImpl.java new file mode 100644 index 000000000000..0c94d35fec48 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/CodeBuildProjectsImpl.java @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.awsconnector.fluent.CodeBuildProjectsClient; +import com.azure.resourcemanager.awsconnector.fluent.models.CodeBuildProjectInner; +import com.azure.resourcemanager.awsconnector.models.CodeBuildProject; +import com.azure.resourcemanager.awsconnector.models.CodeBuildProjects; + +public final class CodeBuildProjectsImpl implements CodeBuildProjects { + private static final ClientLogger LOGGER = new ClientLogger(CodeBuildProjectsImpl.class); + + private final CodeBuildProjectsClient innerClient; + + private final com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager; + + public CodeBuildProjectsImpl(CodeBuildProjectsClient innerClient, + com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return ResourceManagerUtils.mapPage(inner, inner1 -> new CodeBuildProjectImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new CodeBuildProjectImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName); + return ResourceManagerUtils.mapPage(inner, inner1 -> new CodeBuildProjectImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + PagedIterable inner + = this.serviceClient().listByResourceGroup(resourceGroupName, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new CodeBuildProjectImpl(inner1, this.manager())); + } + + public Response getByResourceGroupWithResponse(String resourceGroupName, String name, + Context context) { + Response inner + = this.serviceClient().getByResourceGroupWithResponse(resourceGroupName, name, context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new CodeBuildProjectImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public CodeBuildProject getByResourceGroup(String resourceGroupName, String name) { + CodeBuildProjectInner inner = this.serviceClient().getByResourceGroup(resourceGroupName, name); + if (inner != null) { + return new CodeBuildProjectImpl(inner, this.manager()); + } else { + return null; + } + } + + public void deleteByResourceGroup(String resourceGroupName, String name) { + this.serviceClient().delete(resourceGroupName, name); + } + + public void delete(String resourceGroupName, String name, Context context) { + this.serviceClient().delete(resourceGroupName, name, context); + } + + public CodeBuildProject getById(String id) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String name = ResourceManagerUtils.getValueFromIdByName(id, "codeBuildProjects"); + if (name == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'codeBuildProjects'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, name, Context.NONE).getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String name = ResourceManagerUtils.getValueFromIdByName(id, "codeBuildProjects"); + if (name == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'codeBuildProjects'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, name, context); + } + + public void deleteById(String id) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String name = ResourceManagerUtils.getValueFromIdByName(id, "codeBuildProjects"); + if (name == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'codeBuildProjects'.", id))); + } + this.delete(resourceGroupName, name, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String name = ResourceManagerUtils.getValueFromIdByName(id, "codeBuildProjects"); + if (name == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'codeBuildProjects'.", id))); + } + this.delete(resourceGroupName, name, context); + } + + private CodeBuildProjectsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.awsconnector.AwsconnectorManager manager() { + return this.serviceManager; + } + + public CodeBuildProjectImpl define(String name) { + return new CodeBuildProjectImpl(name, this.manager()); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/CodeBuildSourceCredentialsInfoImpl.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/CodeBuildSourceCredentialsInfoImpl.java new file mode 100644 index 000000000000..92adb696db3a --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/CodeBuildSourceCredentialsInfoImpl.java @@ -0,0 +1,179 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.implementation; + +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.awsconnector.fluent.models.CodeBuildSourceCredentialsInfoInner; +import com.azure.resourcemanager.awsconnector.models.CodeBuildSourceCredentialsInfo; +import com.azure.resourcemanager.awsconnector.models.CodeBuildSourceCredentialsInfoProperties; +import com.azure.resourcemanager.awsconnector.models.CodeBuildSourceCredentialsInfoTagsUpdate; +import java.util.Collections; +import java.util.Map; + +public final class CodeBuildSourceCredentialsInfoImpl implements CodeBuildSourceCredentialsInfo, + CodeBuildSourceCredentialsInfo.Definition, CodeBuildSourceCredentialsInfo.Update { + private CodeBuildSourceCredentialsInfoInner innerObject; + + private final com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public String location() { + return this.innerModel().location(); + } + + public Map tags() { + Map inner = this.innerModel().tags(); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } + } + + public CodeBuildSourceCredentialsInfoProperties properties() { + return this.innerModel().properties(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public String resourceGroupName() { + return resourceGroupName; + } + + public CodeBuildSourceCredentialsInfoInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.awsconnector.AwsconnectorManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String name; + + private CodeBuildSourceCredentialsInfoTagsUpdate updateProperties; + + public CodeBuildSourceCredentialsInfoImpl withExistingResourceGroup(String resourceGroupName) { + this.resourceGroupName = resourceGroupName; + return this; + } + + public CodeBuildSourceCredentialsInfo create() { + this.innerObject = serviceManager.serviceClient() + .getCodeBuildSourceCredentialsInfos() + .createOrReplace(resourceGroupName, name, this.innerModel(), Context.NONE); + return this; + } + + public CodeBuildSourceCredentialsInfo create(Context context) { + this.innerObject = serviceManager.serviceClient() + .getCodeBuildSourceCredentialsInfos() + .createOrReplace(resourceGroupName, name, this.innerModel(), context); + return this; + } + + CodeBuildSourceCredentialsInfoImpl(String name, + com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager) { + this.innerObject = new CodeBuildSourceCredentialsInfoInner(); + this.serviceManager = serviceManager; + this.name = name; + } + + public CodeBuildSourceCredentialsInfoImpl update() { + this.updateProperties = new CodeBuildSourceCredentialsInfoTagsUpdate(); + return this; + } + + public CodeBuildSourceCredentialsInfo apply() { + this.innerObject = serviceManager.serviceClient() + .getCodeBuildSourceCredentialsInfos() + .update(resourceGroupName, name, updateProperties, Context.NONE); + return this; + } + + public CodeBuildSourceCredentialsInfo apply(Context context) { + this.innerObject = serviceManager.serviceClient() + .getCodeBuildSourceCredentialsInfos() + .update(resourceGroupName, name, updateProperties, context); + return this; + } + + CodeBuildSourceCredentialsInfoImpl(CodeBuildSourceCredentialsInfoInner innerObject, + com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.name = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "codeBuildSourceCredentialsInfos"); + } + + public CodeBuildSourceCredentialsInfo refresh() { + this.innerObject = serviceManager.serviceClient() + .getCodeBuildSourceCredentialsInfos() + .getByResourceGroupWithResponse(resourceGroupName, name, Context.NONE) + .getValue(); + return this; + } + + public CodeBuildSourceCredentialsInfo refresh(Context context) { + this.innerObject = serviceManager.serviceClient() + .getCodeBuildSourceCredentialsInfos() + .getByResourceGroupWithResponse(resourceGroupName, name, context) + .getValue(); + return this; + } + + public CodeBuildSourceCredentialsInfoImpl withRegion(Region location) { + this.innerModel().withLocation(location.toString()); + return this; + } + + public CodeBuildSourceCredentialsInfoImpl withRegion(String location) { + this.innerModel().withLocation(location); + return this; + } + + public CodeBuildSourceCredentialsInfoImpl withTags(Map tags) { + if (isInCreateMode()) { + this.innerModel().withTags(tags); + return this; + } else { + this.updateProperties.withTags(tags); + return this; + } + } + + public CodeBuildSourceCredentialsInfoImpl withProperties(CodeBuildSourceCredentialsInfoProperties properties) { + this.innerModel().withProperties(properties); + return this; + } + + private boolean isInCreateMode() { + return this.innerModel().id() == null; + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/CodeBuildSourceCredentialsInfosClientImpl.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/CodeBuildSourceCredentialsInfosClientImpl.java new file mode 100644 index 000000000000..174f81a6ea9d --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/CodeBuildSourceCredentialsInfosClientImpl.java @@ -0,0 +1,1301 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.Patch; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.awsconnector.fluent.CodeBuildSourceCredentialsInfosClient; +import com.azure.resourcemanager.awsconnector.fluent.models.CodeBuildSourceCredentialsInfoInner; +import com.azure.resourcemanager.awsconnector.models.CodeBuildSourceCredentialsInfoListResult; +import com.azure.resourcemanager.awsconnector.models.CodeBuildSourceCredentialsInfoTagsUpdate; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in CodeBuildSourceCredentialsInfosClient. + */ +public final class CodeBuildSourceCredentialsInfosClientImpl implements CodeBuildSourceCredentialsInfosClient { + /** + * The proxy service used to perform REST calls. + */ + private final CodeBuildSourceCredentialsInfosService service; + + /** + * The service client containing this operation class. + */ + private final MicrosoftAwsConnectorImpl client; + + /** + * Initializes an instance of CodeBuildSourceCredentialsInfosClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + CodeBuildSourceCredentialsInfosClientImpl(MicrosoftAwsConnectorImpl client) { + this.service = RestProxy.create(CodeBuildSourceCredentialsInfosService.class, client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for MicrosoftAwsConnectorCodeBuildSourceCredentialsInfos to be used by + * the proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "MicrosoftAwsConnecto") + public interface CodeBuildSourceCredentialsInfosService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.AwsConnector/codeBuildSourceCredentialsInfos") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/codeBuildSourceCredentialsInfos") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroup( + @HostParam("$host") String endpoint, @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/codeBuildSourceCredentialsInfos/{name}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getByResourceGroup(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("name") String name, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/codeBuildSourceCredentialsInfos/{name}") + @ExpectedResponses({ 200, 201 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrReplace(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("name") String name, + @BodyParam("application/json") CodeBuildSourceCredentialsInfoInner resource, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/codeBuildSourceCredentialsInfos/{name}") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> update(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("name") String name, + @BodyParam("application/json") CodeBuildSourceCredentialsInfoTagsUpdate properties, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/codeBuildSourceCredentialsInfos/{name}") + @ExpectedResponses({ 202, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("name") String name, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listBySubscriptionNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroupNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); + } + + /** + * List CodeBuildSourceCredentialsInfo resources by subscription ID. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a CodeBuildSourceCredentialsInfo list operation along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync() { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List CodeBuildSourceCredentialsInfo resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a CodeBuildSourceCredentialsInfo list operation along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), accept, + context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * List CodeBuildSourceCredentialsInfo resources by subscription ID. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a CodeBuildSourceCredentialsInfo list operation as paginated response with + * {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>(() -> listSinglePageAsync(), + nextLink -> listBySubscriptionNextSinglePageAsync(nextLink)); + } + + /** + * List CodeBuildSourceCredentialsInfo resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a CodeBuildSourceCredentialsInfo list operation as paginated response with + * {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(Context context) { + return new PagedFlux<>(() -> listSinglePageAsync(context), + nextLink -> listBySubscriptionNextSinglePageAsync(nextLink, context)); + } + + /** + * List CodeBuildSourceCredentialsInfo resources by subscription ID. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a CodeBuildSourceCredentialsInfo list operation as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + return new PagedIterable<>(listAsync()); + } + + /** + * List CodeBuildSourceCredentialsInfo resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a CodeBuildSourceCredentialsInfo list operation as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Context context) { + return new PagedIterable<>(listAsync(context)); + } + + /** + * List CodeBuildSourceCredentialsInfo resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a CodeBuildSourceCredentialsInfo list operation along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> + listByResourceGroupSinglePageAsync(String resourceGroupName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List CodeBuildSourceCredentialsInfo resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a CodeBuildSourceCredentialsInfo list operation along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> + listByResourceGroupSinglePageAsync(String resourceGroupName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * List CodeBuildSourceCredentialsInfo resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a CodeBuildSourceCredentialsInfo list operation as paginated response with + * {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName) { + return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); + } + + /** + * List CodeBuildSourceCredentialsInfo resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a CodeBuildSourceCredentialsInfo list operation as paginated response with + * {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName, + Context context) { + return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName, context), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink, context)); + } + + /** + * List CodeBuildSourceCredentialsInfo resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a CodeBuildSourceCredentialsInfo list operation as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName)); + } + + /** + * List CodeBuildSourceCredentialsInfo resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a CodeBuildSourceCredentialsInfo list operation as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName, + Context context) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, context)); + } + + /** + * Get a CodeBuildSourceCredentialsInfo. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of CodeBuildSourceCredentialsInfo. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a CodeBuildSourceCredentialsInfo along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> + getByResourceGroupWithResponseAsync(String resourceGroupName, String name) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.getByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get a CodeBuildSourceCredentialsInfo. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of CodeBuildSourceCredentialsInfo. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a CodeBuildSourceCredentialsInfo along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> + getByResourceGroupWithResponseAsync(String resourceGroupName, String name, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.getByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, accept, context); + } + + /** + * Get a CodeBuildSourceCredentialsInfo. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of CodeBuildSourceCredentialsInfo. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a CodeBuildSourceCredentialsInfo on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getByResourceGroupAsync(String resourceGroupName, String name) { + return getByResourceGroupWithResponseAsync(resourceGroupName, name) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Get a CodeBuildSourceCredentialsInfo. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of CodeBuildSourceCredentialsInfo. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a CodeBuildSourceCredentialsInfo along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getByResourceGroupWithResponse(String resourceGroupName, + String name, Context context) { + return getByResourceGroupWithResponseAsync(resourceGroupName, name, context).block(); + } + + /** + * Get a CodeBuildSourceCredentialsInfo. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of CodeBuildSourceCredentialsInfo. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a CodeBuildSourceCredentialsInfo. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public CodeBuildSourceCredentialsInfoInner getByResourceGroup(String resourceGroupName, String name) { + return getByResourceGroupWithResponse(resourceGroupName, name, Context.NONE).getValue(); + } + + /** + * Create a CodeBuildSourceCredentialsInfo. Please note that end user resource creation is currently restricted, but + * it will be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of CodeBuildSourceCredentialsInfo. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrReplaceWithResponseAsync(String resourceGroupName, String name, + CodeBuildSourceCredentialsInfoInner resource) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (resource == null) { + return Mono.error(new IllegalArgumentException("Parameter resource is required and cannot be null.")); + } else { + resource.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.createOrReplace(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, resource, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Create a CodeBuildSourceCredentialsInfo. Please note that end user resource creation is currently restricted, but + * it will be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of CodeBuildSourceCredentialsInfo. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrReplaceWithResponseAsync(String resourceGroupName, String name, + CodeBuildSourceCredentialsInfoInner resource, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (resource == null) { + return Mono.error(new IllegalArgumentException("Parameter resource is required and cannot be null.")); + } else { + resource.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.createOrReplace(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, resource, accept, context); + } + + /** + * Create a CodeBuildSourceCredentialsInfo. Please note that end user resource creation is currently restricted, but + * it will be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of CodeBuildSourceCredentialsInfo. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, CodeBuildSourceCredentialsInfoInner> + beginCreateOrReplaceAsync(String resourceGroupName, String name, CodeBuildSourceCredentialsInfoInner resource) { + Mono>> mono = createOrReplaceWithResponseAsync(resourceGroupName, name, resource); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), CodeBuildSourceCredentialsInfoInner.class, + CodeBuildSourceCredentialsInfoInner.class, this.client.getContext()); + } + + /** + * Create a CodeBuildSourceCredentialsInfo. Please note that end user resource creation is currently restricted, but + * it will be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of CodeBuildSourceCredentialsInfo. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, CodeBuildSourceCredentialsInfoInner> + beginCreateOrReplaceAsync(String resourceGroupName, String name, CodeBuildSourceCredentialsInfoInner resource, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono + = createOrReplaceWithResponseAsync(resourceGroupName, name, resource, context); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), CodeBuildSourceCredentialsInfoInner.class, + CodeBuildSourceCredentialsInfoInner.class, context); + } + + /** + * Create a CodeBuildSourceCredentialsInfo. Please note that end user resource creation is currently restricted, but + * it will be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of CodeBuildSourceCredentialsInfo. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, CodeBuildSourceCredentialsInfoInner> + beginCreateOrReplace(String resourceGroupName, String name, CodeBuildSourceCredentialsInfoInner resource) { + return this.beginCreateOrReplaceAsync(resourceGroupName, name, resource).getSyncPoller(); + } + + /** + * Create a CodeBuildSourceCredentialsInfo. Please note that end user resource creation is currently restricted, but + * it will be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of CodeBuildSourceCredentialsInfo. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, CodeBuildSourceCredentialsInfoInner> + beginCreateOrReplace(String resourceGroupName, String name, CodeBuildSourceCredentialsInfoInner resource, + Context context) { + return this.beginCreateOrReplaceAsync(resourceGroupName, name, resource, context).getSyncPoller(); + } + + /** + * Create a CodeBuildSourceCredentialsInfo. Please note that end user resource creation is currently restricted, but + * it will be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of CodeBuildSourceCredentialsInfo. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrReplaceAsync(String resourceGroupName, String name, + CodeBuildSourceCredentialsInfoInner resource) { + return beginCreateOrReplaceAsync(resourceGroupName, name, resource).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create a CodeBuildSourceCredentialsInfo. Please note that end user resource creation is currently restricted, but + * it will be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of CodeBuildSourceCredentialsInfo. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrReplaceAsync(String resourceGroupName, String name, + CodeBuildSourceCredentialsInfoInner resource, Context context) { + return beginCreateOrReplaceAsync(resourceGroupName, name, resource, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create a CodeBuildSourceCredentialsInfo. Please note that end user resource creation is currently restricted, but + * it will be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of CodeBuildSourceCredentialsInfo. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public CodeBuildSourceCredentialsInfoInner createOrReplace(String resourceGroupName, String name, + CodeBuildSourceCredentialsInfoInner resource) { + return createOrReplaceAsync(resourceGroupName, name, resource).block(); + } + + /** + * Create a CodeBuildSourceCredentialsInfo. Please note that end user resource creation is currently restricted, but + * it will be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of CodeBuildSourceCredentialsInfo. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public CodeBuildSourceCredentialsInfoInner createOrReplace(String resourceGroupName, String name, + CodeBuildSourceCredentialsInfoInner resource, Context context) { + return createOrReplaceAsync(resourceGroupName, name, resource, context).block(); + } + + /** + * Update a CodeBuildSourceCredentialsInfo. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of CodeBuildSourceCredentialsInfo. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync(String resourceGroupName, String name, + CodeBuildSourceCredentialsInfoTagsUpdate properties) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (properties == null) { + return Mono.error(new IllegalArgumentException("Parameter properties is required and cannot be null.")); + } else { + properties.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.update(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, properties, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Update a CodeBuildSourceCredentialsInfo. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of CodeBuildSourceCredentialsInfo. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync(String resourceGroupName, String name, + CodeBuildSourceCredentialsInfoTagsUpdate properties, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (properties == null) { + return Mono.error(new IllegalArgumentException("Parameter properties is required and cannot be null.")); + } else { + properties.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.update(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, name, properties, accept, context); + } + + /** + * Update a CodeBuildSourceCredentialsInfo. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of CodeBuildSourceCredentialsInfo. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, CodeBuildSourceCredentialsInfoInner> + beginUpdateAsync(String resourceGroupName, String name, CodeBuildSourceCredentialsInfoTagsUpdate properties) { + Mono>> mono = updateWithResponseAsync(resourceGroupName, name, properties); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), CodeBuildSourceCredentialsInfoInner.class, + CodeBuildSourceCredentialsInfoInner.class, this.client.getContext()); + } + + /** + * Update a CodeBuildSourceCredentialsInfo. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of CodeBuildSourceCredentialsInfo. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, CodeBuildSourceCredentialsInfoInner> + beginUpdateAsync(String resourceGroupName, String name, CodeBuildSourceCredentialsInfoTagsUpdate properties, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = updateWithResponseAsync(resourceGroupName, name, properties, context); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), CodeBuildSourceCredentialsInfoInner.class, + CodeBuildSourceCredentialsInfoInner.class, context); + } + + /** + * Update a CodeBuildSourceCredentialsInfo. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of CodeBuildSourceCredentialsInfo. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, CodeBuildSourceCredentialsInfoInner> + beginUpdate(String resourceGroupName, String name, CodeBuildSourceCredentialsInfoTagsUpdate properties) { + return this.beginUpdateAsync(resourceGroupName, name, properties).getSyncPoller(); + } + + /** + * Update a CodeBuildSourceCredentialsInfo. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of CodeBuildSourceCredentialsInfo. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, CodeBuildSourceCredentialsInfoInner> beginUpdate( + String resourceGroupName, String name, CodeBuildSourceCredentialsInfoTagsUpdate properties, Context context) { + return this.beginUpdateAsync(resourceGroupName, name, properties, context).getSyncPoller(); + } + + /** + * Update a CodeBuildSourceCredentialsInfo. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of CodeBuildSourceCredentialsInfo. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync(String resourceGroupName, String name, + CodeBuildSourceCredentialsInfoTagsUpdate properties) { + return beginUpdateAsync(resourceGroupName, name, properties).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Update a CodeBuildSourceCredentialsInfo. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of CodeBuildSourceCredentialsInfo. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync(String resourceGroupName, String name, + CodeBuildSourceCredentialsInfoTagsUpdate properties, Context context) { + return beginUpdateAsync(resourceGroupName, name, properties, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Update a CodeBuildSourceCredentialsInfo. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of CodeBuildSourceCredentialsInfo. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public CodeBuildSourceCredentialsInfoInner update(String resourceGroupName, String name, + CodeBuildSourceCredentialsInfoTagsUpdate properties) { + return updateAsync(resourceGroupName, name, properties).block(); + } + + /** + * Update a CodeBuildSourceCredentialsInfo. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of CodeBuildSourceCredentialsInfo. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public CodeBuildSourceCredentialsInfoInner update(String resourceGroupName, String name, + CodeBuildSourceCredentialsInfoTagsUpdate properties, Context context) { + return updateAsync(resourceGroupName, name, properties, context).block(); + } + + /** + * Delete a CodeBuildSourceCredentialsInfo. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of CodeBuildSourceCredentialsInfo. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync(String resourceGroupName, String name) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Delete a CodeBuildSourceCredentialsInfo. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of CodeBuildSourceCredentialsInfo. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync(String resourceGroupName, String name, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.delete(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, name, accept, context); + } + + /** + * Delete a CodeBuildSourceCredentialsInfo. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of CodeBuildSourceCredentialsInfo. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String name) { + Mono>> mono = deleteWithResponseAsync(resourceGroupName, name); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); + } + + /** + * Delete a CodeBuildSourceCredentialsInfo. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of CodeBuildSourceCredentialsInfo. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String name, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = deleteWithResponseAsync(resourceGroupName, name, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + context); + } + + /** + * Delete a CodeBuildSourceCredentialsInfo. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of CodeBuildSourceCredentialsInfo. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String name) { + return this.beginDeleteAsync(resourceGroupName, name).getSyncPoller(); + } + + /** + * Delete a CodeBuildSourceCredentialsInfo. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of CodeBuildSourceCredentialsInfo. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String name, Context context) { + return this.beginDeleteAsync(resourceGroupName, name, context).getSyncPoller(); + } + + /** + * Delete a CodeBuildSourceCredentialsInfo. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of CodeBuildSourceCredentialsInfo. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String name) { + return beginDeleteAsync(resourceGroupName, name).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete a CodeBuildSourceCredentialsInfo. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of CodeBuildSourceCredentialsInfo. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String name, Context context) { + return beginDeleteAsync(resourceGroupName, name, context).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete a CodeBuildSourceCredentialsInfo. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of CodeBuildSourceCredentialsInfo. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String name) { + deleteAsync(resourceGroupName, name).block(); + } + + /** + * Delete a CodeBuildSourceCredentialsInfo. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of CodeBuildSourceCredentialsInfo. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String name, Context context) { + deleteAsync(resourceGroupName, name, context).block(); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a CodeBuildSourceCredentialsInfo list operation along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> + listBySubscriptionNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a CodeBuildSourceCredentialsInfo list operation along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> + listBySubscriptionNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a CodeBuildSourceCredentialsInfo list operation along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> + listByResourceGroupNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a CodeBuildSourceCredentialsInfo list operation along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> + listByResourceGroupNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/CodeBuildSourceCredentialsInfosImpl.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/CodeBuildSourceCredentialsInfosImpl.java new file mode 100644 index 000000000000..5196e8c006ad --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/CodeBuildSourceCredentialsInfosImpl.java @@ -0,0 +1,153 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.awsconnector.fluent.CodeBuildSourceCredentialsInfosClient; +import com.azure.resourcemanager.awsconnector.fluent.models.CodeBuildSourceCredentialsInfoInner; +import com.azure.resourcemanager.awsconnector.models.CodeBuildSourceCredentialsInfo; +import com.azure.resourcemanager.awsconnector.models.CodeBuildSourceCredentialsInfos; + +public final class CodeBuildSourceCredentialsInfosImpl implements CodeBuildSourceCredentialsInfos { + private static final ClientLogger LOGGER = new ClientLogger(CodeBuildSourceCredentialsInfosImpl.class); + + private final CodeBuildSourceCredentialsInfosClient innerClient; + + private final com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager; + + public CodeBuildSourceCredentialsInfosImpl(CodeBuildSourceCredentialsInfosClient innerClient, + com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return ResourceManagerUtils.mapPage(inner, + inner1 -> new CodeBuildSourceCredentialsInfoImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return ResourceManagerUtils.mapPage(inner, + inner1 -> new CodeBuildSourceCredentialsInfoImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName) { + PagedIterable inner + = this.serviceClient().listByResourceGroup(resourceGroupName); + return ResourceManagerUtils.mapPage(inner, + inner1 -> new CodeBuildSourceCredentialsInfoImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName, + Context context) { + PagedIterable inner + = this.serviceClient().listByResourceGroup(resourceGroupName, context); + return ResourceManagerUtils.mapPage(inner, + inner1 -> new CodeBuildSourceCredentialsInfoImpl(inner1, this.manager())); + } + + public Response getByResourceGroupWithResponse(String resourceGroupName, + String name, Context context) { + Response inner + = this.serviceClient().getByResourceGroupWithResponse(resourceGroupName, name, context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new CodeBuildSourceCredentialsInfoImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public CodeBuildSourceCredentialsInfo getByResourceGroup(String resourceGroupName, String name) { + CodeBuildSourceCredentialsInfoInner inner = this.serviceClient().getByResourceGroup(resourceGroupName, name); + if (inner != null) { + return new CodeBuildSourceCredentialsInfoImpl(inner, this.manager()); + } else { + return null; + } + } + + public void deleteByResourceGroup(String resourceGroupName, String name) { + this.serviceClient().delete(resourceGroupName, name); + } + + public void delete(String resourceGroupName, String name, Context context) { + this.serviceClient().delete(resourceGroupName, name, context); + } + + public CodeBuildSourceCredentialsInfo getById(String id) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String name = ResourceManagerUtils.getValueFromIdByName(id, "codeBuildSourceCredentialsInfos"); + if (name == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException(String.format( + "The resource ID '%s' is not valid. Missing path segment 'codeBuildSourceCredentialsInfos'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, name, Context.NONE).getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String name = ResourceManagerUtils.getValueFromIdByName(id, "codeBuildSourceCredentialsInfos"); + if (name == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException(String.format( + "The resource ID '%s' is not valid. Missing path segment 'codeBuildSourceCredentialsInfos'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, name, context); + } + + public void deleteById(String id) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String name = ResourceManagerUtils.getValueFromIdByName(id, "codeBuildSourceCredentialsInfos"); + if (name == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException(String.format( + "The resource ID '%s' is not valid. Missing path segment 'codeBuildSourceCredentialsInfos'.", id))); + } + this.delete(resourceGroupName, name, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String name = ResourceManagerUtils.getValueFromIdByName(id, "codeBuildSourceCredentialsInfos"); + if (name == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException(String.format( + "The resource ID '%s' is not valid. Missing path segment 'codeBuildSourceCredentialsInfos'.", id))); + } + this.delete(resourceGroupName, name, context); + } + + private CodeBuildSourceCredentialsInfosClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.awsconnector.AwsconnectorManager manager() { + return this.serviceManager; + } + + public CodeBuildSourceCredentialsInfoImpl define(String name) { + return new CodeBuildSourceCredentialsInfoImpl(name, this.manager()); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/ConfigServiceConfigurationRecorderImpl.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/ConfigServiceConfigurationRecorderImpl.java new file mode 100644 index 000000000000..452013edfd72 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/ConfigServiceConfigurationRecorderImpl.java @@ -0,0 +1,180 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.implementation; + +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.awsconnector.fluent.models.ConfigServiceConfigurationRecorderInner; +import com.azure.resourcemanager.awsconnector.models.ConfigServiceConfigurationRecorder; +import com.azure.resourcemanager.awsconnector.models.ConfigServiceConfigurationRecorderProperties; +import com.azure.resourcemanager.awsconnector.models.ConfigServiceConfigurationRecorderTagsUpdate; +import java.util.Collections; +import java.util.Map; + +public final class ConfigServiceConfigurationRecorderImpl implements ConfigServiceConfigurationRecorder, + ConfigServiceConfigurationRecorder.Definition, ConfigServiceConfigurationRecorder.Update { + private ConfigServiceConfigurationRecorderInner innerObject; + + private final com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public String location() { + return this.innerModel().location(); + } + + public Map tags() { + Map inner = this.innerModel().tags(); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } + } + + public ConfigServiceConfigurationRecorderProperties properties() { + return this.innerModel().properties(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public String resourceGroupName() { + return resourceGroupName; + } + + public ConfigServiceConfigurationRecorderInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.awsconnector.AwsconnectorManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String name; + + private ConfigServiceConfigurationRecorderTagsUpdate updateProperties; + + public ConfigServiceConfigurationRecorderImpl withExistingResourceGroup(String resourceGroupName) { + this.resourceGroupName = resourceGroupName; + return this; + } + + public ConfigServiceConfigurationRecorder create() { + this.innerObject = serviceManager.serviceClient() + .getConfigServiceConfigurationRecorders() + .createOrReplace(resourceGroupName, name, this.innerModel(), Context.NONE); + return this; + } + + public ConfigServiceConfigurationRecorder create(Context context) { + this.innerObject = serviceManager.serviceClient() + .getConfigServiceConfigurationRecorders() + .createOrReplace(resourceGroupName, name, this.innerModel(), context); + return this; + } + + ConfigServiceConfigurationRecorderImpl(String name, + com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager) { + this.innerObject = new ConfigServiceConfigurationRecorderInner(); + this.serviceManager = serviceManager; + this.name = name; + } + + public ConfigServiceConfigurationRecorderImpl update() { + this.updateProperties = new ConfigServiceConfigurationRecorderTagsUpdate(); + return this; + } + + public ConfigServiceConfigurationRecorder apply() { + this.innerObject = serviceManager.serviceClient() + .getConfigServiceConfigurationRecorders() + .update(resourceGroupName, name, updateProperties, Context.NONE); + return this; + } + + public ConfigServiceConfigurationRecorder apply(Context context) { + this.innerObject = serviceManager.serviceClient() + .getConfigServiceConfigurationRecorders() + .update(resourceGroupName, name, updateProperties, context); + return this; + } + + ConfigServiceConfigurationRecorderImpl(ConfigServiceConfigurationRecorderInner innerObject, + com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.name = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "configServiceConfigurationRecorders"); + } + + public ConfigServiceConfigurationRecorder refresh() { + this.innerObject = serviceManager.serviceClient() + .getConfigServiceConfigurationRecorders() + .getByResourceGroupWithResponse(resourceGroupName, name, Context.NONE) + .getValue(); + return this; + } + + public ConfigServiceConfigurationRecorder refresh(Context context) { + this.innerObject = serviceManager.serviceClient() + .getConfigServiceConfigurationRecorders() + .getByResourceGroupWithResponse(resourceGroupName, name, context) + .getValue(); + return this; + } + + public ConfigServiceConfigurationRecorderImpl withRegion(Region location) { + this.innerModel().withLocation(location.toString()); + return this; + } + + public ConfigServiceConfigurationRecorderImpl withRegion(String location) { + this.innerModel().withLocation(location); + return this; + } + + public ConfigServiceConfigurationRecorderImpl withTags(Map tags) { + if (isInCreateMode()) { + this.innerModel().withTags(tags); + return this; + } else { + this.updateProperties.withTags(tags); + return this; + } + } + + public ConfigServiceConfigurationRecorderImpl + withProperties(ConfigServiceConfigurationRecorderProperties properties) { + this.innerModel().withProperties(properties); + return this; + } + + private boolean isInCreateMode() { + return this.innerModel().id() == null; + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/ConfigServiceConfigurationRecorderStatusImpl.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/ConfigServiceConfigurationRecorderStatusImpl.java new file mode 100644 index 000000000000..49468bd27545 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/ConfigServiceConfigurationRecorderStatusImpl.java @@ -0,0 +1,181 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.implementation; + +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.awsconnector.fluent.models.ConfigServiceConfigurationRecorderStatusInner; +import com.azure.resourcemanager.awsconnector.models.ConfigServiceConfigurationRecorderStatus; +import com.azure.resourcemanager.awsconnector.models.ConfigServiceConfigurationRecorderStatusProperties; +import com.azure.resourcemanager.awsconnector.models.ConfigServiceConfigurationRecorderStatusTagsUpdate; +import java.util.Collections; +import java.util.Map; + +public final class ConfigServiceConfigurationRecorderStatusImpl implements ConfigServiceConfigurationRecorderStatus, + ConfigServiceConfigurationRecorderStatus.Definition, ConfigServiceConfigurationRecorderStatus.Update { + private ConfigServiceConfigurationRecorderStatusInner innerObject; + + private final com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public String location() { + return this.innerModel().location(); + } + + public Map tags() { + Map inner = this.innerModel().tags(); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } + } + + public ConfigServiceConfigurationRecorderStatusProperties properties() { + return this.innerModel().properties(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public String resourceGroupName() { + return resourceGroupName; + } + + public ConfigServiceConfigurationRecorderStatusInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.awsconnector.AwsconnectorManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String name; + + private ConfigServiceConfigurationRecorderStatusTagsUpdate updateProperties; + + public ConfigServiceConfigurationRecorderStatusImpl withExistingResourceGroup(String resourceGroupName) { + this.resourceGroupName = resourceGroupName; + return this; + } + + public ConfigServiceConfigurationRecorderStatus create() { + this.innerObject = serviceManager.serviceClient() + .getConfigServiceConfigurationRecorderStatuses() + .createOrReplace(resourceGroupName, name, this.innerModel(), Context.NONE); + return this; + } + + public ConfigServiceConfigurationRecorderStatus create(Context context) { + this.innerObject = serviceManager.serviceClient() + .getConfigServiceConfigurationRecorderStatuses() + .createOrReplace(resourceGroupName, name, this.innerModel(), context); + return this; + } + + ConfigServiceConfigurationRecorderStatusImpl(String name, + com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager) { + this.innerObject = new ConfigServiceConfigurationRecorderStatusInner(); + this.serviceManager = serviceManager; + this.name = name; + } + + public ConfigServiceConfigurationRecorderStatusImpl update() { + this.updateProperties = new ConfigServiceConfigurationRecorderStatusTagsUpdate(); + return this; + } + + public ConfigServiceConfigurationRecorderStatus apply() { + this.innerObject = serviceManager.serviceClient() + .getConfigServiceConfigurationRecorderStatuses() + .update(resourceGroupName, name, updateProperties, Context.NONE); + return this; + } + + public ConfigServiceConfigurationRecorderStatus apply(Context context) { + this.innerObject = serviceManager.serviceClient() + .getConfigServiceConfigurationRecorderStatuses() + .update(resourceGroupName, name, updateProperties, context); + return this; + } + + ConfigServiceConfigurationRecorderStatusImpl(ConfigServiceConfigurationRecorderStatusInner innerObject, + com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.name + = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "configServiceConfigurationRecorderStatuses"); + } + + public ConfigServiceConfigurationRecorderStatus refresh() { + this.innerObject = serviceManager.serviceClient() + .getConfigServiceConfigurationRecorderStatuses() + .getByResourceGroupWithResponse(resourceGroupName, name, Context.NONE) + .getValue(); + return this; + } + + public ConfigServiceConfigurationRecorderStatus refresh(Context context) { + this.innerObject = serviceManager.serviceClient() + .getConfigServiceConfigurationRecorderStatuses() + .getByResourceGroupWithResponse(resourceGroupName, name, context) + .getValue(); + return this; + } + + public ConfigServiceConfigurationRecorderStatusImpl withRegion(Region location) { + this.innerModel().withLocation(location.toString()); + return this; + } + + public ConfigServiceConfigurationRecorderStatusImpl withRegion(String location) { + this.innerModel().withLocation(location); + return this; + } + + public ConfigServiceConfigurationRecorderStatusImpl withTags(Map tags) { + if (isInCreateMode()) { + this.innerModel().withTags(tags); + return this; + } else { + this.updateProperties.withTags(tags); + return this; + } + } + + public ConfigServiceConfigurationRecorderStatusImpl + withProperties(ConfigServiceConfigurationRecorderStatusProperties properties) { + this.innerModel().withProperties(properties); + return this; + } + + private boolean isInCreateMode() { + return this.innerModel().id() == null; + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/ConfigServiceConfigurationRecorderStatusesClientImpl.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/ConfigServiceConfigurationRecorderStatusesClientImpl.java new file mode 100644 index 000000000000..43057aa86e5b --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/ConfigServiceConfigurationRecorderStatusesClientImpl.java @@ -0,0 +1,1329 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.Patch; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.awsconnector.fluent.ConfigServiceConfigurationRecorderStatusesClient; +import com.azure.resourcemanager.awsconnector.fluent.models.ConfigServiceConfigurationRecorderStatusInner; +import com.azure.resourcemanager.awsconnector.models.ConfigServiceConfigurationRecorderStatusListResult; +import com.azure.resourcemanager.awsconnector.models.ConfigServiceConfigurationRecorderStatusTagsUpdate; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in + * ConfigServiceConfigurationRecorderStatusesClient. + */ +public final class ConfigServiceConfigurationRecorderStatusesClientImpl + implements ConfigServiceConfigurationRecorderStatusesClient { + /** + * The proxy service used to perform REST calls. + */ + private final ConfigServiceConfigurationRecorderStatusesService service; + + /** + * The service client containing this operation class. + */ + private final MicrosoftAwsConnectorImpl client; + + /** + * Initializes an instance of ConfigServiceConfigurationRecorderStatusesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + ConfigServiceConfigurationRecorderStatusesClientImpl(MicrosoftAwsConnectorImpl client) { + this.service = RestProxy.create(ConfigServiceConfigurationRecorderStatusesService.class, + client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for MicrosoftAwsConnectorConfigServiceConfigurationRecorderStatuses to be + * used by the proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "MicrosoftAwsConnecto") + public interface ConfigServiceConfigurationRecorderStatusesService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.AwsConnector/configServiceConfigurationRecorderStatuses") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/configServiceConfigurationRecorderStatuses") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroup( + @HostParam("$host") String endpoint, @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/configServiceConfigurationRecorderStatuses/{name}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getByResourceGroup( + @HostParam("$host") String endpoint, @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("name") String name, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/configServiceConfigurationRecorderStatuses/{name}") + @ExpectedResponses({ 200, 201 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrReplace(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("name") String name, + @BodyParam("application/json") ConfigServiceConfigurationRecorderStatusInner resource, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/configServiceConfigurationRecorderStatuses/{name}") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> update(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("name") String name, + @BodyParam("application/json") ConfigServiceConfigurationRecorderStatusTagsUpdate properties, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/configServiceConfigurationRecorderStatuses/{name}") + @ExpectedResponses({ 202, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("name") String name, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listBySubscriptionNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroupNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); + } + + /** + * List ConfigServiceConfigurationRecorderStatus resources by subscription ID. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a ConfigServiceConfigurationRecorderStatus list operation along with + * {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync() { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), accept, context)) + .>map( + res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List ConfigServiceConfigurationRecorderStatus resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a ConfigServiceConfigurationRecorderStatus list operation along with + * {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), accept, + context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * List ConfigServiceConfigurationRecorderStatus resources by subscription ID. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a ConfigServiceConfigurationRecorderStatus list operation as paginated response with + * {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>(() -> listSinglePageAsync(), + nextLink -> listBySubscriptionNextSinglePageAsync(nextLink)); + } + + /** + * List ConfigServiceConfigurationRecorderStatus resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a ConfigServiceConfigurationRecorderStatus list operation as paginated response with + * {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(Context context) { + return new PagedFlux<>(() -> listSinglePageAsync(context), + nextLink -> listBySubscriptionNextSinglePageAsync(nextLink, context)); + } + + /** + * List ConfigServiceConfigurationRecorderStatus resources by subscription ID. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a ConfigServiceConfigurationRecorderStatus list operation as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + return new PagedIterable<>(listAsync()); + } + + /** + * List ConfigServiceConfigurationRecorderStatus resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a ConfigServiceConfigurationRecorderStatus list operation as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Context context) { + return new PagedIterable<>(listAsync(context)); + } + + /** + * List ConfigServiceConfigurationRecorderStatus resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a ConfigServiceConfigurationRecorderStatus list operation along with + * {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> + listByResourceGroupSinglePageAsync(String resourceGroupName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accept, context)) + .>map( + res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List ConfigServiceConfigurationRecorderStatus resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a ConfigServiceConfigurationRecorderStatus list operation along with + * {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> + listByResourceGroupSinglePageAsync(String resourceGroupName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * List ConfigServiceConfigurationRecorderStatus resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a ConfigServiceConfigurationRecorderStatus list operation as paginated response with + * {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux + listByResourceGroupAsync(String resourceGroupName) { + return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); + } + + /** + * List ConfigServiceConfigurationRecorderStatus resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a ConfigServiceConfigurationRecorderStatus list operation as paginated response with + * {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName, + Context context) { + return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName, context), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink, context)); + } + + /** + * List ConfigServiceConfigurationRecorderStatus resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a ConfigServiceConfigurationRecorderStatus list operation as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName)); + } + + /** + * List ConfigServiceConfigurationRecorderStatus resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a ConfigServiceConfigurationRecorderStatus list operation as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName, + Context context) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, context)); + } + + /** + * Get a ConfigServiceConfigurationRecorderStatus. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ConfigServiceConfigurationRecorderStatus. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a ConfigServiceConfigurationRecorderStatus along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> + getByResourceGroupWithResponseAsync(String resourceGroupName, String name) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.getByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get a ConfigServiceConfigurationRecorderStatus. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ConfigServiceConfigurationRecorderStatus. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a ConfigServiceConfigurationRecorderStatus along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> + getByResourceGroupWithResponseAsync(String resourceGroupName, String name, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.getByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, accept, context); + } + + /** + * Get a ConfigServiceConfigurationRecorderStatus. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ConfigServiceConfigurationRecorderStatus. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a ConfigServiceConfigurationRecorderStatus on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getByResourceGroupAsync(String resourceGroupName, + String name) { + return getByResourceGroupWithResponseAsync(resourceGroupName, name) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Get a ConfigServiceConfigurationRecorderStatus. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ConfigServiceConfigurationRecorderStatus. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a ConfigServiceConfigurationRecorderStatus along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response + getByResourceGroupWithResponse(String resourceGroupName, String name, Context context) { + return getByResourceGroupWithResponseAsync(resourceGroupName, name, context).block(); + } + + /** + * Get a ConfigServiceConfigurationRecorderStatus. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ConfigServiceConfigurationRecorderStatus. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a ConfigServiceConfigurationRecorderStatus. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ConfigServiceConfigurationRecorderStatusInner getByResourceGroup(String resourceGroupName, String name) { + return getByResourceGroupWithResponse(resourceGroupName, name, Context.NONE).getValue(); + } + + /** + * Create a ConfigServiceConfigurationRecorderStatus. Please note that end user resource creation is currently + * restricted, but it will be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ConfigServiceConfigurationRecorderStatus. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrReplaceWithResponseAsync(String resourceGroupName, String name, + ConfigServiceConfigurationRecorderStatusInner resource) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (resource == null) { + return Mono.error(new IllegalArgumentException("Parameter resource is required and cannot be null.")); + } else { + resource.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.createOrReplace(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, resource, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Create a ConfigServiceConfigurationRecorderStatus. Please note that end user resource creation is currently + * restricted, but it will be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ConfigServiceConfigurationRecorderStatus. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrReplaceWithResponseAsync(String resourceGroupName, String name, + ConfigServiceConfigurationRecorderStatusInner resource, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (resource == null) { + return Mono.error(new IllegalArgumentException("Parameter resource is required and cannot be null.")); + } else { + resource.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.createOrReplace(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, resource, accept, context); + } + + /** + * Create a ConfigServiceConfigurationRecorderStatus. Please note that end user resource creation is currently + * restricted, but it will be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ConfigServiceConfigurationRecorderStatus. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private + PollerFlux, ConfigServiceConfigurationRecorderStatusInner> + beginCreateOrReplaceAsync(String resourceGroupName, String name, + ConfigServiceConfigurationRecorderStatusInner resource) { + Mono>> mono = createOrReplaceWithResponseAsync(resourceGroupName, name, resource); + return this.client + .getLroResult( + mono, this.client.getHttpPipeline(), ConfigServiceConfigurationRecorderStatusInner.class, + ConfigServiceConfigurationRecorderStatusInner.class, this.client.getContext()); + } + + /** + * Create a ConfigServiceConfigurationRecorderStatus. Please note that end user resource creation is currently + * restricted, but it will be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ConfigServiceConfigurationRecorderStatus. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private + PollerFlux, ConfigServiceConfigurationRecorderStatusInner> + beginCreateOrReplaceAsync(String resourceGroupName, String name, + ConfigServiceConfigurationRecorderStatusInner resource, Context context) { + context = this.client.mergeContext(context); + Mono>> mono + = createOrReplaceWithResponseAsync(resourceGroupName, name, resource, context); + return this.client + .getLroResult( + mono, this.client.getHttpPipeline(), ConfigServiceConfigurationRecorderStatusInner.class, + ConfigServiceConfigurationRecorderStatusInner.class, context); + } + + /** + * Create a ConfigServiceConfigurationRecorderStatus. Please note that end user resource creation is currently + * restricted, but it will be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ConfigServiceConfigurationRecorderStatus. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public + SyncPoller, ConfigServiceConfigurationRecorderStatusInner> + beginCreateOrReplace(String resourceGroupName, String name, + ConfigServiceConfigurationRecorderStatusInner resource) { + return this.beginCreateOrReplaceAsync(resourceGroupName, name, resource).getSyncPoller(); + } + + /** + * Create a ConfigServiceConfigurationRecorderStatus. Please note that end user resource creation is currently + * restricted, but it will be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ConfigServiceConfigurationRecorderStatus. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public + SyncPoller, ConfigServiceConfigurationRecorderStatusInner> + beginCreateOrReplace(String resourceGroupName, String name, + ConfigServiceConfigurationRecorderStatusInner resource, Context context) { + return this.beginCreateOrReplaceAsync(resourceGroupName, name, resource, context).getSyncPoller(); + } + + /** + * Create a ConfigServiceConfigurationRecorderStatus. Please note that end user resource creation is currently + * restricted, but it will be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ConfigServiceConfigurationRecorderStatus. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrReplaceAsync(String resourceGroupName, + String name, ConfigServiceConfigurationRecorderStatusInner resource) { + return beginCreateOrReplaceAsync(resourceGroupName, name, resource).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create a ConfigServiceConfigurationRecorderStatus. Please note that end user resource creation is currently + * restricted, but it will be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ConfigServiceConfigurationRecorderStatus. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrReplaceAsync(String resourceGroupName, + String name, ConfigServiceConfigurationRecorderStatusInner resource, Context context) { + return beginCreateOrReplaceAsync(resourceGroupName, name, resource, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create a ConfigServiceConfigurationRecorderStatus. Please note that end user resource creation is currently + * restricted, but it will be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ConfigServiceConfigurationRecorderStatus. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ConfigServiceConfigurationRecorderStatusInner createOrReplace(String resourceGroupName, String name, + ConfigServiceConfigurationRecorderStatusInner resource) { + return createOrReplaceAsync(resourceGroupName, name, resource).block(); + } + + /** + * Create a ConfigServiceConfigurationRecorderStatus. Please note that end user resource creation is currently + * restricted, but it will be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ConfigServiceConfigurationRecorderStatus. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ConfigServiceConfigurationRecorderStatusInner createOrReplace(String resourceGroupName, String name, + ConfigServiceConfigurationRecorderStatusInner resource, Context context) { + return createOrReplaceAsync(resourceGroupName, name, resource, context).block(); + } + + /** + * Update a ConfigServiceConfigurationRecorderStatus. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ConfigServiceConfigurationRecorderStatus. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync(String resourceGroupName, String name, + ConfigServiceConfigurationRecorderStatusTagsUpdate properties) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (properties == null) { + return Mono.error(new IllegalArgumentException("Parameter properties is required and cannot be null.")); + } else { + properties.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.update(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, properties, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Update a ConfigServiceConfigurationRecorderStatus. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ConfigServiceConfigurationRecorderStatus. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync(String resourceGroupName, String name, + ConfigServiceConfigurationRecorderStatusTagsUpdate properties, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (properties == null) { + return Mono.error(new IllegalArgumentException("Parameter properties is required and cannot be null.")); + } else { + properties.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.update(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, name, properties, accept, context); + } + + /** + * Update a ConfigServiceConfigurationRecorderStatus. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ConfigServiceConfigurationRecorderStatus. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private + PollerFlux, ConfigServiceConfigurationRecorderStatusInner> + beginUpdateAsync(String resourceGroupName, String name, + ConfigServiceConfigurationRecorderStatusTagsUpdate properties) { + Mono>> mono = updateWithResponseAsync(resourceGroupName, name, properties); + return this.client + .getLroResult( + mono, this.client.getHttpPipeline(), ConfigServiceConfigurationRecorderStatusInner.class, + ConfigServiceConfigurationRecorderStatusInner.class, this.client.getContext()); + } + + /** + * Update a ConfigServiceConfigurationRecorderStatus. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ConfigServiceConfigurationRecorderStatus. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private + PollerFlux, ConfigServiceConfigurationRecorderStatusInner> + beginUpdateAsync(String resourceGroupName, String name, + ConfigServiceConfigurationRecorderStatusTagsUpdate properties, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = updateWithResponseAsync(resourceGroupName, name, properties, context); + return this.client + .getLroResult( + mono, this.client.getHttpPipeline(), ConfigServiceConfigurationRecorderStatusInner.class, + ConfigServiceConfigurationRecorderStatusInner.class, context); + } + + /** + * Update a ConfigServiceConfigurationRecorderStatus. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ConfigServiceConfigurationRecorderStatus. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public + SyncPoller, ConfigServiceConfigurationRecorderStatusInner> + beginUpdate(String resourceGroupName, String name, + ConfigServiceConfigurationRecorderStatusTagsUpdate properties) { + return this.beginUpdateAsync(resourceGroupName, name, properties).getSyncPoller(); + } + + /** + * Update a ConfigServiceConfigurationRecorderStatus. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ConfigServiceConfigurationRecorderStatus. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public + SyncPoller, ConfigServiceConfigurationRecorderStatusInner> + beginUpdate(String resourceGroupName, String name, + ConfigServiceConfigurationRecorderStatusTagsUpdate properties, Context context) { + return this.beginUpdateAsync(resourceGroupName, name, properties, context).getSyncPoller(); + } + + /** + * Update a ConfigServiceConfigurationRecorderStatus. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ConfigServiceConfigurationRecorderStatus. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync(String resourceGroupName, String name, + ConfigServiceConfigurationRecorderStatusTagsUpdate properties) { + return beginUpdateAsync(resourceGroupName, name, properties).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Update a ConfigServiceConfigurationRecorderStatus. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ConfigServiceConfigurationRecorderStatus. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync(String resourceGroupName, String name, + ConfigServiceConfigurationRecorderStatusTagsUpdate properties, Context context) { + return beginUpdateAsync(resourceGroupName, name, properties, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Update a ConfigServiceConfigurationRecorderStatus. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ConfigServiceConfigurationRecorderStatus. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ConfigServiceConfigurationRecorderStatusInner update(String resourceGroupName, String name, + ConfigServiceConfigurationRecorderStatusTagsUpdate properties) { + return updateAsync(resourceGroupName, name, properties).block(); + } + + /** + * Update a ConfigServiceConfigurationRecorderStatus. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ConfigServiceConfigurationRecorderStatus. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ConfigServiceConfigurationRecorderStatusInner update(String resourceGroupName, String name, + ConfigServiceConfigurationRecorderStatusTagsUpdate properties, Context context) { + return updateAsync(resourceGroupName, name, properties, context).block(); + } + + /** + * Delete a ConfigServiceConfigurationRecorderStatus. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ConfigServiceConfigurationRecorderStatus. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync(String resourceGroupName, String name) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Delete a ConfigServiceConfigurationRecorderStatus. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ConfigServiceConfigurationRecorderStatus. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync(String resourceGroupName, String name, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.delete(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, name, accept, context); + } + + /** + * Delete a ConfigServiceConfigurationRecorderStatus. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ConfigServiceConfigurationRecorderStatus. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String name) { + Mono>> mono = deleteWithResponseAsync(resourceGroupName, name); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); + } + + /** + * Delete a ConfigServiceConfigurationRecorderStatus. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ConfigServiceConfigurationRecorderStatus. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String name, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = deleteWithResponseAsync(resourceGroupName, name, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + context); + } + + /** + * Delete a ConfigServiceConfigurationRecorderStatus. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ConfigServiceConfigurationRecorderStatus. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String name) { + return this.beginDeleteAsync(resourceGroupName, name).getSyncPoller(); + } + + /** + * Delete a ConfigServiceConfigurationRecorderStatus. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ConfigServiceConfigurationRecorderStatus. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String name, Context context) { + return this.beginDeleteAsync(resourceGroupName, name, context).getSyncPoller(); + } + + /** + * Delete a ConfigServiceConfigurationRecorderStatus. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ConfigServiceConfigurationRecorderStatus. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String name) { + return beginDeleteAsync(resourceGroupName, name).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete a ConfigServiceConfigurationRecorderStatus. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ConfigServiceConfigurationRecorderStatus. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String name, Context context) { + return beginDeleteAsync(resourceGroupName, name, context).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete a ConfigServiceConfigurationRecorderStatus. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ConfigServiceConfigurationRecorderStatus. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String name) { + deleteAsync(resourceGroupName, name).block(); + } + + /** + * Delete a ConfigServiceConfigurationRecorderStatus. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ConfigServiceConfigurationRecorderStatus. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String name, Context context) { + deleteAsync(resourceGroupName, name, context).block(); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a ConfigServiceConfigurationRecorderStatus list operation along with + * {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> + listBySubscriptionNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a ConfigServiceConfigurationRecorderStatus list operation along with + * {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> + listBySubscriptionNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a ConfigServiceConfigurationRecorderStatus list operation along with + * {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> + listByResourceGroupNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a ConfigServiceConfigurationRecorderStatus list operation along with + * {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> + listByResourceGroupNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/ConfigServiceConfigurationRecorderStatusesImpl.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/ConfigServiceConfigurationRecorderStatusesImpl.java new file mode 100644 index 000000000000..2e8c19eaf394 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/ConfigServiceConfigurationRecorderStatusesImpl.java @@ -0,0 +1,159 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.awsconnector.fluent.ConfigServiceConfigurationRecorderStatusesClient; +import com.azure.resourcemanager.awsconnector.fluent.models.ConfigServiceConfigurationRecorderStatusInner; +import com.azure.resourcemanager.awsconnector.models.ConfigServiceConfigurationRecorderStatus; +import com.azure.resourcemanager.awsconnector.models.ConfigServiceConfigurationRecorderStatuses; + +public final class ConfigServiceConfigurationRecorderStatusesImpl + implements ConfigServiceConfigurationRecorderStatuses { + private static final ClientLogger LOGGER = new ClientLogger(ConfigServiceConfigurationRecorderStatusesImpl.class); + + private final ConfigServiceConfigurationRecorderStatusesClient innerClient; + + private final com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager; + + public ConfigServiceConfigurationRecorderStatusesImpl(ConfigServiceConfigurationRecorderStatusesClient innerClient, + com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return ResourceManagerUtils.mapPage(inner, + inner1 -> new ConfigServiceConfigurationRecorderStatusImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return ResourceManagerUtils.mapPage(inner, + inner1 -> new ConfigServiceConfigurationRecorderStatusImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName) { + PagedIterable inner + = this.serviceClient().listByResourceGroup(resourceGroupName); + return ResourceManagerUtils.mapPage(inner, + inner1 -> new ConfigServiceConfigurationRecorderStatusImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName, + Context context) { + PagedIterable inner + = this.serviceClient().listByResourceGroup(resourceGroupName, context); + return ResourceManagerUtils.mapPage(inner, + inner1 -> new ConfigServiceConfigurationRecorderStatusImpl(inner1, this.manager())); + } + + public Response getByResourceGroupWithResponse(String resourceGroupName, + String name, Context context) { + Response inner + = this.serviceClient().getByResourceGroupWithResponse(resourceGroupName, name, context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new ConfigServiceConfigurationRecorderStatusImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public ConfigServiceConfigurationRecorderStatus getByResourceGroup(String resourceGroupName, String name) { + ConfigServiceConfigurationRecorderStatusInner inner + = this.serviceClient().getByResourceGroup(resourceGroupName, name); + if (inner != null) { + return new ConfigServiceConfigurationRecorderStatusImpl(inner, this.manager()); + } else { + return null; + } + } + + public void deleteByResourceGroup(String resourceGroupName, String name) { + this.serviceClient().delete(resourceGroupName, name); + } + + public void delete(String resourceGroupName, String name, Context context) { + this.serviceClient().delete(resourceGroupName, name, context); + } + + public ConfigServiceConfigurationRecorderStatus getById(String id) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String name = ResourceManagerUtils.getValueFromIdByName(id, "configServiceConfigurationRecorderStatuses"); + if (name == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException(String.format( + "The resource ID '%s' is not valid. Missing path segment 'configServiceConfigurationRecorderStatuses'.", + id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, name, Context.NONE).getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String name = ResourceManagerUtils.getValueFromIdByName(id, "configServiceConfigurationRecorderStatuses"); + if (name == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException(String.format( + "The resource ID '%s' is not valid. Missing path segment 'configServiceConfigurationRecorderStatuses'.", + id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, name, context); + } + + public void deleteById(String id) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String name = ResourceManagerUtils.getValueFromIdByName(id, "configServiceConfigurationRecorderStatuses"); + if (name == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException(String.format( + "The resource ID '%s' is not valid. Missing path segment 'configServiceConfigurationRecorderStatuses'.", + id))); + } + this.delete(resourceGroupName, name, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String name = ResourceManagerUtils.getValueFromIdByName(id, "configServiceConfigurationRecorderStatuses"); + if (name == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException(String.format( + "The resource ID '%s' is not valid. Missing path segment 'configServiceConfigurationRecorderStatuses'.", + id))); + } + this.delete(resourceGroupName, name, context); + } + + private ConfigServiceConfigurationRecorderStatusesClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.awsconnector.AwsconnectorManager manager() { + return this.serviceManager; + } + + public ConfigServiceConfigurationRecorderStatusImpl define(String name) { + return new ConfigServiceConfigurationRecorderStatusImpl(name, this.manager()); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/ConfigServiceConfigurationRecordersClientImpl.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/ConfigServiceConfigurationRecordersClientImpl.java new file mode 100644 index 000000000000..91b0e4215267 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/ConfigServiceConfigurationRecordersClientImpl.java @@ -0,0 +1,1315 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.Patch; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.awsconnector.fluent.ConfigServiceConfigurationRecordersClient; +import com.azure.resourcemanager.awsconnector.fluent.models.ConfigServiceConfigurationRecorderInner; +import com.azure.resourcemanager.awsconnector.models.ConfigServiceConfigurationRecorderListResult; +import com.azure.resourcemanager.awsconnector.models.ConfigServiceConfigurationRecorderTagsUpdate; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in ConfigServiceConfigurationRecordersClient. + */ +public final class ConfigServiceConfigurationRecordersClientImpl implements ConfigServiceConfigurationRecordersClient { + /** + * The proxy service used to perform REST calls. + */ + private final ConfigServiceConfigurationRecordersService service; + + /** + * The service client containing this operation class. + */ + private final MicrosoftAwsConnectorImpl client; + + /** + * Initializes an instance of ConfigServiceConfigurationRecordersClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + ConfigServiceConfigurationRecordersClientImpl(MicrosoftAwsConnectorImpl client) { + this.service = RestProxy.create(ConfigServiceConfigurationRecordersService.class, client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for MicrosoftAwsConnectorConfigServiceConfigurationRecorders to be used + * by the proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "MicrosoftAwsConnecto") + public interface ConfigServiceConfigurationRecordersService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.AwsConnector/configServiceConfigurationRecorders") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/configServiceConfigurationRecorders") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroup( + @HostParam("$host") String endpoint, @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/configServiceConfigurationRecorders/{name}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getByResourceGroup(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("name") String name, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/configServiceConfigurationRecorders/{name}") + @ExpectedResponses({ 200, 201 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrReplace(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("name") String name, + @BodyParam("application/json") ConfigServiceConfigurationRecorderInner resource, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/configServiceConfigurationRecorders/{name}") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> update(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("name") String name, + @BodyParam("application/json") ConfigServiceConfigurationRecorderTagsUpdate properties, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/configServiceConfigurationRecorders/{name}") + @ExpectedResponses({ 202, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("name") String name, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listBySubscriptionNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroupNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); + } + + /** + * List ConfigServiceConfigurationRecorder resources by subscription ID. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a ConfigServiceConfigurationRecorder list operation along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync() { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), accept, context)) + .>map( + res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List ConfigServiceConfigurationRecorder resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a ConfigServiceConfigurationRecorder list operation along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), accept, + context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * List ConfigServiceConfigurationRecorder resources by subscription ID. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a ConfigServiceConfigurationRecorder list operation as paginated response with + * {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>(() -> listSinglePageAsync(), + nextLink -> listBySubscriptionNextSinglePageAsync(nextLink)); + } + + /** + * List ConfigServiceConfigurationRecorder resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a ConfigServiceConfigurationRecorder list operation as paginated response with + * {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(Context context) { + return new PagedFlux<>(() -> listSinglePageAsync(context), + nextLink -> listBySubscriptionNextSinglePageAsync(nextLink, context)); + } + + /** + * List ConfigServiceConfigurationRecorder resources by subscription ID. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a ConfigServiceConfigurationRecorder list operation as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + return new PagedIterable<>(listAsync()); + } + + /** + * List ConfigServiceConfigurationRecorder resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a ConfigServiceConfigurationRecorder list operation as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Context context) { + return new PagedIterable<>(listAsync(context)); + } + + /** + * List ConfigServiceConfigurationRecorder resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a ConfigServiceConfigurationRecorder list operation along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> + listByResourceGroupSinglePageAsync(String resourceGroupName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accept, context)) + .>map( + res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List ConfigServiceConfigurationRecorder resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a ConfigServiceConfigurationRecorder list operation along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> + listByResourceGroupSinglePageAsync(String resourceGroupName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * List ConfigServiceConfigurationRecorder resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a ConfigServiceConfigurationRecorder list operation as paginated response with + * {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName) { + return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); + } + + /** + * List ConfigServiceConfigurationRecorder resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a ConfigServiceConfigurationRecorder list operation as paginated response with + * {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName, + Context context) { + return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName, context), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink, context)); + } + + /** + * List ConfigServiceConfigurationRecorder resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a ConfigServiceConfigurationRecorder list operation as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName)); + } + + /** + * List ConfigServiceConfigurationRecorder resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a ConfigServiceConfigurationRecorder list operation as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName, + Context context) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, context)); + } + + /** + * Get a ConfigServiceConfigurationRecorder. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ConfigServiceConfigurationRecorder. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a ConfigServiceConfigurationRecorder along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> + getByResourceGroupWithResponseAsync(String resourceGroupName, String name) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.getByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get a ConfigServiceConfigurationRecorder. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ConfigServiceConfigurationRecorder. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a ConfigServiceConfigurationRecorder along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> + getByResourceGroupWithResponseAsync(String resourceGroupName, String name, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.getByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, accept, context); + } + + /** + * Get a ConfigServiceConfigurationRecorder. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ConfigServiceConfigurationRecorder. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a ConfigServiceConfigurationRecorder on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getByResourceGroupAsync(String resourceGroupName, + String name) { + return getByResourceGroupWithResponseAsync(resourceGroupName, name) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Get a ConfigServiceConfigurationRecorder. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ConfigServiceConfigurationRecorder. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a ConfigServiceConfigurationRecorder along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getByResourceGroupWithResponse(String resourceGroupName, + String name, Context context) { + return getByResourceGroupWithResponseAsync(resourceGroupName, name, context).block(); + } + + /** + * Get a ConfigServiceConfigurationRecorder. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ConfigServiceConfigurationRecorder. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a ConfigServiceConfigurationRecorder. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ConfigServiceConfigurationRecorderInner getByResourceGroup(String resourceGroupName, String name) { + return getByResourceGroupWithResponse(resourceGroupName, name, Context.NONE).getValue(); + } + + /** + * Create a ConfigServiceConfigurationRecorder. Please note that end user resource creation is currently restricted, + * but it will be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ConfigServiceConfigurationRecorder. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrReplaceWithResponseAsync(String resourceGroupName, String name, + ConfigServiceConfigurationRecorderInner resource) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (resource == null) { + return Mono.error(new IllegalArgumentException("Parameter resource is required and cannot be null.")); + } else { + resource.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.createOrReplace(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, resource, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Create a ConfigServiceConfigurationRecorder. Please note that end user resource creation is currently restricted, + * but it will be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ConfigServiceConfigurationRecorder. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrReplaceWithResponseAsync(String resourceGroupName, String name, + ConfigServiceConfigurationRecorderInner resource, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (resource == null) { + return Mono.error(new IllegalArgumentException("Parameter resource is required and cannot be null.")); + } else { + resource.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.createOrReplace(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, resource, accept, context); + } + + /** + * Create a ConfigServiceConfigurationRecorder. Please note that end user resource creation is currently restricted, + * but it will be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ConfigServiceConfigurationRecorder. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, ConfigServiceConfigurationRecorderInner> + beginCreateOrReplaceAsync(String resourceGroupName, String name, + ConfigServiceConfigurationRecorderInner resource) { + Mono>> mono = createOrReplaceWithResponseAsync(resourceGroupName, name, resource); + return this.client + .getLroResult(mono, + this.client.getHttpPipeline(), ConfigServiceConfigurationRecorderInner.class, + ConfigServiceConfigurationRecorderInner.class, this.client.getContext()); + } + + /** + * Create a ConfigServiceConfigurationRecorder. Please note that end user resource creation is currently restricted, + * but it will be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ConfigServiceConfigurationRecorder. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, ConfigServiceConfigurationRecorderInner> + beginCreateOrReplaceAsync(String resourceGroupName, String name, + ConfigServiceConfigurationRecorderInner resource, Context context) { + context = this.client.mergeContext(context); + Mono>> mono + = createOrReplaceWithResponseAsync(resourceGroupName, name, resource, context); + return this.client + .getLroResult(mono, + this.client.getHttpPipeline(), ConfigServiceConfigurationRecorderInner.class, + ConfigServiceConfigurationRecorderInner.class, context); + } + + /** + * Create a ConfigServiceConfigurationRecorder. Please note that end user resource creation is currently restricted, + * but it will be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ConfigServiceConfigurationRecorder. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ConfigServiceConfigurationRecorderInner> + beginCreateOrReplace(String resourceGroupName, String name, ConfigServiceConfigurationRecorderInner resource) { + return this.beginCreateOrReplaceAsync(resourceGroupName, name, resource).getSyncPoller(); + } + + /** + * Create a ConfigServiceConfigurationRecorder. Please note that end user resource creation is currently restricted, + * but it will be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ConfigServiceConfigurationRecorder. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ConfigServiceConfigurationRecorderInner> + beginCreateOrReplace(String resourceGroupName, String name, ConfigServiceConfigurationRecorderInner resource, + Context context) { + return this.beginCreateOrReplaceAsync(resourceGroupName, name, resource, context).getSyncPoller(); + } + + /** + * Create a ConfigServiceConfigurationRecorder. Please note that end user resource creation is currently restricted, + * but it will be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ConfigServiceConfigurationRecorder. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrReplaceAsync(String resourceGroupName, String name, + ConfigServiceConfigurationRecorderInner resource) { + return beginCreateOrReplaceAsync(resourceGroupName, name, resource).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create a ConfigServiceConfigurationRecorder. Please note that end user resource creation is currently restricted, + * but it will be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ConfigServiceConfigurationRecorder. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrReplaceAsync(String resourceGroupName, String name, + ConfigServiceConfigurationRecorderInner resource, Context context) { + return beginCreateOrReplaceAsync(resourceGroupName, name, resource, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create a ConfigServiceConfigurationRecorder. Please note that end user resource creation is currently restricted, + * but it will be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ConfigServiceConfigurationRecorder. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ConfigServiceConfigurationRecorderInner createOrReplace(String resourceGroupName, String name, + ConfigServiceConfigurationRecorderInner resource) { + return createOrReplaceAsync(resourceGroupName, name, resource).block(); + } + + /** + * Create a ConfigServiceConfigurationRecorder. Please note that end user resource creation is currently restricted, + * but it will be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ConfigServiceConfigurationRecorder. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ConfigServiceConfigurationRecorderInner createOrReplace(String resourceGroupName, String name, + ConfigServiceConfigurationRecorderInner resource, Context context) { + return createOrReplaceAsync(resourceGroupName, name, resource, context).block(); + } + + /** + * Update a ConfigServiceConfigurationRecorder. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ConfigServiceConfigurationRecorder. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync(String resourceGroupName, String name, + ConfigServiceConfigurationRecorderTagsUpdate properties) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (properties == null) { + return Mono.error(new IllegalArgumentException("Parameter properties is required and cannot be null.")); + } else { + properties.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.update(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, properties, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Update a ConfigServiceConfigurationRecorder. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ConfigServiceConfigurationRecorder. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync(String resourceGroupName, String name, + ConfigServiceConfigurationRecorderTagsUpdate properties, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (properties == null) { + return Mono.error(new IllegalArgumentException("Parameter properties is required and cannot be null.")); + } else { + properties.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.update(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, name, properties, accept, context); + } + + /** + * Update a ConfigServiceConfigurationRecorder. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ConfigServiceConfigurationRecorder. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, ConfigServiceConfigurationRecorderInner> + beginUpdateAsync(String resourceGroupName, String name, + ConfigServiceConfigurationRecorderTagsUpdate properties) { + Mono>> mono = updateWithResponseAsync(resourceGroupName, name, properties); + return this.client + .getLroResult(mono, + this.client.getHttpPipeline(), ConfigServiceConfigurationRecorderInner.class, + ConfigServiceConfigurationRecorderInner.class, this.client.getContext()); + } + + /** + * Update a ConfigServiceConfigurationRecorder. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ConfigServiceConfigurationRecorder. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, ConfigServiceConfigurationRecorderInner> + beginUpdateAsync(String resourceGroupName, String name, ConfigServiceConfigurationRecorderTagsUpdate properties, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = updateWithResponseAsync(resourceGroupName, name, properties, context); + return this.client + .getLroResult(mono, + this.client.getHttpPipeline(), ConfigServiceConfigurationRecorderInner.class, + ConfigServiceConfigurationRecorderInner.class, context); + } + + /** + * Update a ConfigServiceConfigurationRecorder. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ConfigServiceConfigurationRecorder. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ConfigServiceConfigurationRecorderInner> + beginUpdate(String resourceGroupName, String name, ConfigServiceConfigurationRecorderTagsUpdate properties) { + return this.beginUpdateAsync(resourceGroupName, name, properties).getSyncPoller(); + } + + /** + * Update a ConfigServiceConfigurationRecorder. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ConfigServiceConfigurationRecorder. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ConfigServiceConfigurationRecorderInner> + beginUpdate(String resourceGroupName, String name, ConfigServiceConfigurationRecorderTagsUpdate properties, + Context context) { + return this.beginUpdateAsync(resourceGroupName, name, properties, context).getSyncPoller(); + } + + /** + * Update a ConfigServiceConfigurationRecorder. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ConfigServiceConfigurationRecorder. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync(String resourceGroupName, String name, + ConfigServiceConfigurationRecorderTagsUpdate properties) { + return beginUpdateAsync(resourceGroupName, name, properties).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Update a ConfigServiceConfigurationRecorder. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ConfigServiceConfigurationRecorder. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync(String resourceGroupName, String name, + ConfigServiceConfigurationRecorderTagsUpdate properties, Context context) { + return beginUpdateAsync(resourceGroupName, name, properties, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Update a ConfigServiceConfigurationRecorder. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ConfigServiceConfigurationRecorder. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ConfigServiceConfigurationRecorderInner update(String resourceGroupName, String name, + ConfigServiceConfigurationRecorderTagsUpdate properties) { + return updateAsync(resourceGroupName, name, properties).block(); + } + + /** + * Update a ConfigServiceConfigurationRecorder. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ConfigServiceConfigurationRecorder. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ConfigServiceConfigurationRecorderInner update(String resourceGroupName, String name, + ConfigServiceConfigurationRecorderTagsUpdate properties, Context context) { + return updateAsync(resourceGroupName, name, properties, context).block(); + } + + /** + * Delete a ConfigServiceConfigurationRecorder. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ConfigServiceConfigurationRecorder. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync(String resourceGroupName, String name) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Delete a ConfigServiceConfigurationRecorder. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ConfigServiceConfigurationRecorder. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync(String resourceGroupName, String name, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.delete(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, name, accept, context); + } + + /** + * Delete a ConfigServiceConfigurationRecorder. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ConfigServiceConfigurationRecorder. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String name) { + Mono>> mono = deleteWithResponseAsync(resourceGroupName, name); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); + } + + /** + * Delete a ConfigServiceConfigurationRecorder. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ConfigServiceConfigurationRecorder. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String name, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = deleteWithResponseAsync(resourceGroupName, name, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + context); + } + + /** + * Delete a ConfigServiceConfigurationRecorder. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ConfigServiceConfigurationRecorder. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String name) { + return this.beginDeleteAsync(resourceGroupName, name).getSyncPoller(); + } + + /** + * Delete a ConfigServiceConfigurationRecorder. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ConfigServiceConfigurationRecorder. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String name, Context context) { + return this.beginDeleteAsync(resourceGroupName, name, context).getSyncPoller(); + } + + /** + * Delete a ConfigServiceConfigurationRecorder. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ConfigServiceConfigurationRecorder. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String name) { + return beginDeleteAsync(resourceGroupName, name).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete a ConfigServiceConfigurationRecorder. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ConfigServiceConfigurationRecorder. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String name, Context context) { + return beginDeleteAsync(resourceGroupName, name, context).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete a ConfigServiceConfigurationRecorder. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ConfigServiceConfigurationRecorder. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String name) { + deleteAsync(resourceGroupName, name).block(); + } + + /** + * Delete a ConfigServiceConfigurationRecorder. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ConfigServiceConfigurationRecorder. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String name, Context context) { + deleteAsync(resourceGroupName, name, context).block(); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a ConfigServiceConfigurationRecorder list operation along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> + listBySubscriptionNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a ConfigServiceConfigurationRecorder list operation along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> + listBySubscriptionNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a ConfigServiceConfigurationRecorder list operation along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> + listByResourceGroupNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a ConfigServiceConfigurationRecorder list operation along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> + listByResourceGroupNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/ConfigServiceConfigurationRecordersImpl.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/ConfigServiceConfigurationRecordersImpl.java new file mode 100644 index 000000000000..bab25aae5ebe --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/ConfigServiceConfigurationRecordersImpl.java @@ -0,0 +1,154 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.awsconnector.fluent.ConfigServiceConfigurationRecordersClient; +import com.azure.resourcemanager.awsconnector.fluent.models.ConfigServiceConfigurationRecorderInner; +import com.azure.resourcemanager.awsconnector.models.ConfigServiceConfigurationRecorder; +import com.azure.resourcemanager.awsconnector.models.ConfigServiceConfigurationRecorders; + +public final class ConfigServiceConfigurationRecordersImpl implements ConfigServiceConfigurationRecorders { + private static final ClientLogger LOGGER = new ClientLogger(ConfigServiceConfigurationRecordersImpl.class); + + private final ConfigServiceConfigurationRecordersClient innerClient; + + private final com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager; + + public ConfigServiceConfigurationRecordersImpl(ConfigServiceConfigurationRecordersClient innerClient, + com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return ResourceManagerUtils.mapPage(inner, + inner1 -> new ConfigServiceConfigurationRecorderImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return ResourceManagerUtils.mapPage(inner, + inner1 -> new ConfigServiceConfigurationRecorderImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName) { + PagedIterable inner + = this.serviceClient().listByResourceGroup(resourceGroupName); + return ResourceManagerUtils.mapPage(inner, + inner1 -> new ConfigServiceConfigurationRecorderImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName, + Context context) { + PagedIterable inner + = this.serviceClient().listByResourceGroup(resourceGroupName, context); + return ResourceManagerUtils.mapPage(inner, + inner1 -> new ConfigServiceConfigurationRecorderImpl(inner1, this.manager())); + } + + public Response getByResourceGroupWithResponse(String resourceGroupName, + String name, Context context) { + Response inner + = this.serviceClient().getByResourceGroupWithResponse(resourceGroupName, name, context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new ConfigServiceConfigurationRecorderImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public ConfigServiceConfigurationRecorder getByResourceGroup(String resourceGroupName, String name) { + ConfigServiceConfigurationRecorderInner inner + = this.serviceClient().getByResourceGroup(resourceGroupName, name); + if (inner != null) { + return new ConfigServiceConfigurationRecorderImpl(inner, this.manager()); + } else { + return null; + } + } + + public void deleteByResourceGroup(String resourceGroupName, String name) { + this.serviceClient().delete(resourceGroupName, name); + } + + public void delete(String resourceGroupName, String name, Context context) { + this.serviceClient().delete(resourceGroupName, name, context); + } + + public ConfigServiceConfigurationRecorder getById(String id) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String name = ResourceManagerUtils.getValueFromIdByName(id, "configServiceConfigurationRecorders"); + if (name == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException(String.format( + "The resource ID '%s' is not valid. Missing path segment 'configServiceConfigurationRecorders'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, name, Context.NONE).getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String name = ResourceManagerUtils.getValueFromIdByName(id, "configServiceConfigurationRecorders"); + if (name == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException(String.format( + "The resource ID '%s' is not valid. Missing path segment 'configServiceConfigurationRecorders'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, name, context); + } + + public void deleteById(String id) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String name = ResourceManagerUtils.getValueFromIdByName(id, "configServiceConfigurationRecorders"); + if (name == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException(String.format( + "The resource ID '%s' is not valid. Missing path segment 'configServiceConfigurationRecorders'.", id))); + } + this.delete(resourceGroupName, name, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String name = ResourceManagerUtils.getValueFromIdByName(id, "configServiceConfigurationRecorders"); + if (name == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException(String.format( + "The resource ID '%s' is not valid. Missing path segment 'configServiceConfigurationRecorders'.", id))); + } + this.delete(resourceGroupName, name, context); + } + + private ConfigServiceConfigurationRecordersClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.awsconnector.AwsconnectorManager manager() { + return this.serviceManager; + } + + public ConfigServiceConfigurationRecorderImpl define(String name) { + return new ConfigServiceConfigurationRecorderImpl(name, this.manager()); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/ConfigServiceDeliveryChannelImpl.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/ConfigServiceDeliveryChannelImpl.java new file mode 100644 index 000000000000..f5c77bbfab86 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/ConfigServiceDeliveryChannelImpl.java @@ -0,0 +1,179 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.implementation; + +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.awsconnector.fluent.models.ConfigServiceDeliveryChannelInner; +import com.azure.resourcemanager.awsconnector.models.ConfigServiceDeliveryChannel; +import com.azure.resourcemanager.awsconnector.models.ConfigServiceDeliveryChannelProperties; +import com.azure.resourcemanager.awsconnector.models.ConfigServiceDeliveryChannelTagsUpdate; +import java.util.Collections; +import java.util.Map; + +public final class ConfigServiceDeliveryChannelImpl implements ConfigServiceDeliveryChannel, + ConfigServiceDeliveryChannel.Definition, ConfigServiceDeliveryChannel.Update { + private ConfigServiceDeliveryChannelInner innerObject; + + private final com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public String location() { + return this.innerModel().location(); + } + + public Map tags() { + Map inner = this.innerModel().tags(); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } + } + + public ConfigServiceDeliveryChannelProperties properties() { + return this.innerModel().properties(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public String resourceGroupName() { + return resourceGroupName; + } + + public ConfigServiceDeliveryChannelInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.awsconnector.AwsconnectorManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String name; + + private ConfigServiceDeliveryChannelTagsUpdate updateProperties; + + public ConfigServiceDeliveryChannelImpl withExistingResourceGroup(String resourceGroupName) { + this.resourceGroupName = resourceGroupName; + return this; + } + + public ConfigServiceDeliveryChannel create() { + this.innerObject = serviceManager.serviceClient() + .getConfigServiceDeliveryChannels() + .createOrReplace(resourceGroupName, name, this.innerModel(), Context.NONE); + return this; + } + + public ConfigServiceDeliveryChannel create(Context context) { + this.innerObject = serviceManager.serviceClient() + .getConfigServiceDeliveryChannels() + .createOrReplace(resourceGroupName, name, this.innerModel(), context); + return this; + } + + ConfigServiceDeliveryChannelImpl(String name, + com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager) { + this.innerObject = new ConfigServiceDeliveryChannelInner(); + this.serviceManager = serviceManager; + this.name = name; + } + + public ConfigServiceDeliveryChannelImpl update() { + this.updateProperties = new ConfigServiceDeliveryChannelTagsUpdate(); + return this; + } + + public ConfigServiceDeliveryChannel apply() { + this.innerObject = serviceManager.serviceClient() + .getConfigServiceDeliveryChannels() + .update(resourceGroupName, name, updateProperties, Context.NONE); + return this; + } + + public ConfigServiceDeliveryChannel apply(Context context) { + this.innerObject = serviceManager.serviceClient() + .getConfigServiceDeliveryChannels() + .update(resourceGroupName, name, updateProperties, context); + return this; + } + + ConfigServiceDeliveryChannelImpl(ConfigServiceDeliveryChannelInner innerObject, + com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.name = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "configServiceDeliveryChannels"); + } + + public ConfigServiceDeliveryChannel refresh() { + this.innerObject = serviceManager.serviceClient() + .getConfigServiceDeliveryChannels() + .getByResourceGroupWithResponse(resourceGroupName, name, Context.NONE) + .getValue(); + return this; + } + + public ConfigServiceDeliveryChannel refresh(Context context) { + this.innerObject = serviceManager.serviceClient() + .getConfigServiceDeliveryChannels() + .getByResourceGroupWithResponse(resourceGroupName, name, context) + .getValue(); + return this; + } + + public ConfigServiceDeliveryChannelImpl withRegion(Region location) { + this.innerModel().withLocation(location.toString()); + return this; + } + + public ConfigServiceDeliveryChannelImpl withRegion(String location) { + this.innerModel().withLocation(location); + return this; + } + + public ConfigServiceDeliveryChannelImpl withTags(Map tags) { + if (isInCreateMode()) { + this.innerModel().withTags(tags); + return this; + } else { + this.updateProperties.withTags(tags); + return this; + } + } + + public ConfigServiceDeliveryChannelImpl withProperties(ConfigServiceDeliveryChannelProperties properties) { + this.innerModel().withProperties(properties); + return this; + } + + private boolean isInCreateMode() { + return this.innerModel().id() == null; + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/ConfigServiceDeliveryChannelsClientImpl.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/ConfigServiceDeliveryChannelsClientImpl.java new file mode 100644 index 000000000000..51503c5f95a9 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/ConfigServiceDeliveryChannelsClientImpl.java @@ -0,0 +1,1300 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.Patch; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.awsconnector.fluent.ConfigServiceDeliveryChannelsClient; +import com.azure.resourcemanager.awsconnector.fluent.models.ConfigServiceDeliveryChannelInner; +import com.azure.resourcemanager.awsconnector.models.ConfigServiceDeliveryChannelListResult; +import com.azure.resourcemanager.awsconnector.models.ConfigServiceDeliveryChannelTagsUpdate; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in ConfigServiceDeliveryChannelsClient. + */ +public final class ConfigServiceDeliveryChannelsClientImpl implements ConfigServiceDeliveryChannelsClient { + /** + * The proxy service used to perform REST calls. + */ + private final ConfigServiceDeliveryChannelsService service; + + /** + * The service client containing this operation class. + */ + private final MicrosoftAwsConnectorImpl client; + + /** + * Initializes an instance of ConfigServiceDeliveryChannelsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + ConfigServiceDeliveryChannelsClientImpl(MicrosoftAwsConnectorImpl client) { + this.service = RestProxy.create(ConfigServiceDeliveryChannelsService.class, client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for MicrosoftAwsConnectorConfigServiceDeliveryChannels to be used by the + * proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "MicrosoftAwsConnecto") + public interface ConfigServiceDeliveryChannelsService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.AwsConnector/configServiceDeliveryChannels") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/configServiceDeliveryChannels") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroup(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/configServiceDeliveryChannels/{name}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getByResourceGroup(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("name") String name, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/configServiceDeliveryChannels/{name}") + @ExpectedResponses({ 200, 201 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrReplace(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("name") String name, + @BodyParam("application/json") ConfigServiceDeliveryChannelInner resource, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/configServiceDeliveryChannels/{name}") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> update(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("name") String name, + @BodyParam("application/json") ConfigServiceDeliveryChannelTagsUpdate properties, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/configServiceDeliveryChannels/{name}") + @ExpectedResponses({ 202, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("name") String name, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listBySubscriptionNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroupNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); + } + + /** + * List ConfigServiceDeliveryChannel resources by subscription ID. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a ConfigServiceDeliveryChannel list operation along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync() { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List ConfigServiceDeliveryChannel resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a ConfigServiceDeliveryChannel list operation along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), accept, + context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * List ConfigServiceDeliveryChannel resources by subscription ID. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a ConfigServiceDeliveryChannel list operation as paginated response with + * {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>(() -> listSinglePageAsync(), + nextLink -> listBySubscriptionNextSinglePageAsync(nextLink)); + } + + /** + * List ConfigServiceDeliveryChannel resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a ConfigServiceDeliveryChannel list operation as paginated response with + * {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(Context context) { + return new PagedFlux<>(() -> listSinglePageAsync(context), + nextLink -> listBySubscriptionNextSinglePageAsync(nextLink, context)); + } + + /** + * List ConfigServiceDeliveryChannel resources by subscription ID. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a ConfigServiceDeliveryChannel list operation as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + return new PagedIterable<>(listAsync()); + } + + /** + * List ConfigServiceDeliveryChannel resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a ConfigServiceDeliveryChannel list operation as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Context context) { + return new PagedIterable<>(listAsync(context)); + } + + /** + * List ConfigServiceDeliveryChannel resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a ConfigServiceDeliveryChannel list operation along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> + listByResourceGroupSinglePageAsync(String resourceGroupName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List ConfigServiceDeliveryChannel resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a ConfigServiceDeliveryChannel list operation along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> + listByResourceGroupSinglePageAsync(String resourceGroupName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * List ConfigServiceDeliveryChannel resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a ConfigServiceDeliveryChannel list operation as paginated response with + * {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName) { + return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); + } + + /** + * List ConfigServiceDeliveryChannel resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a ConfigServiceDeliveryChannel list operation as paginated response with + * {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName, + Context context) { + return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName, context), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink, context)); + } + + /** + * List ConfigServiceDeliveryChannel resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a ConfigServiceDeliveryChannel list operation as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName)); + } + + /** + * List ConfigServiceDeliveryChannel resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a ConfigServiceDeliveryChannel list operation as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName, + Context context) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, context)); + } + + /** + * Get a ConfigServiceDeliveryChannel. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ConfigServiceDeliveryChannel. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a ConfigServiceDeliveryChannel along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> + getByResourceGroupWithResponseAsync(String resourceGroupName, String name) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.getByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get a ConfigServiceDeliveryChannel. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ConfigServiceDeliveryChannel. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a ConfigServiceDeliveryChannel along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> + getByResourceGroupWithResponseAsync(String resourceGroupName, String name, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.getByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, accept, context); + } + + /** + * Get a ConfigServiceDeliveryChannel. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ConfigServiceDeliveryChannel. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a ConfigServiceDeliveryChannel on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getByResourceGroupAsync(String resourceGroupName, String name) { + return getByResourceGroupWithResponseAsync(resourceGroupName, name) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Get a ConfigServiceDeliveryChannel. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ConfigServiceDeliveryChannel. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a ConfigServiceDeliveryChannel along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getByResourceGroupWithResponse(String resourceGroupName, + String name, Context context) { + return getByResourceGroupWithResponseAsync(resourceGroupName, name, context).block(); + } + + /** + * Get a ConfigServiceDeliveryChannel. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ConfigServiceDeliveryChannel. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a ConfigServiceDeliveryChannel. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ConfigServiceDeliveryChannelInner getByResourceGroup(String resourceGroupName, String name) { + return getByResourceGroupWithResponse(resourceGroupName, name, Context.NONE).getValue(); + } + + /** + * Create a ConfigServiceDeliveryChannel. Please note that end user resource creation is currently restricted, but + * it will be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ConfigServiceDeliveryChannel. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrReplaceWithResponseAsync(String resourceGroupName, String name, + ConfigServiceDeliveryChannelInner resource) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (resource == null) { + return Mono.error(new IllegalArgumentException("Parameter resource is required and cannot be null.")); + } else { + resource.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.createOrReplace(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, resource, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Create a ConfigServiceDeliveryChannel. Please note that end user resource creation is currently restricted, but + * it will be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ConfigServiceDeliveryChannel. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrReplaceWithResponseAsync(String resourceGroupName, String name, + ConfigServiceDeliveryChannelInner resource, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (resource == null) { + return Mono.error(new IllegalArgumentException("Parameter resource is required and cannot be null.")); + } else { + resource.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.createOrReplace(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, resource, accept, context); + } + + /** + * Create a ConfigServiceDeliveryChannel. Please note that end user resource creation is currently restricted, but + * it will be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ConfigServiceDeliveryChannel. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, ConfigServiceDeliveryChannelInner> + beginCreateOrReplaceAsync(String resourceGroupName, String name, ConfigServiceDeliveryChannelInner resource) { + Mono>> mono = createOrReplaceWithResponseAsync(resourceGroupName, name, resource); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), ConfigServiceDeliveryChannelInner.class, + ConfigServiceDeliveryChannelInner.class, this.client.getContext()); + } + + /** + * Create a ConfigServiceDeliveryChannel. Please note that end user resource creation is currently restricted, but + * it will be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ConfigServiceDeliveryChannel. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, ConfigServiceDeliveryChannelInner> + beginCreateOrReplaceAsync(String resourceGroupName, String name, ConfigServiceDeliveryChannelInner resource, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono + = createOrReplaceWithResponseAsync(resourceGroupName, name, resource, context); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), ConfigServiceDeliveryChannelInner.class, + ConfigServiceDeliveryChannelInner.class, context); + } + + /** + * Create a ConfigServiceDeliveryChannel. Please note that end user resource creation is currently restricted, but + * it will be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ConfigServiceDeliveryChannel. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ConfigServiceDeliveryChannelInner> + beginCreateOrReplace(String resourceGroupName, String name, ConfigServiceDeliveryChannelInner resource) { + return this.beginCreateOrReplaceAsync(resourceGroupName, name, resource).getSyncPoller(); + } + + /** + * Create a ConfigServiceDeliveryChannel. Please note that end user resource creation is currently restricted, but + * it will be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ConfigServiceDeliveryChannel. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ConfigServiceDeliveryChannelInner> + beginCreateOrReplace(String resourceGroupName, String name, ConfigServiceDeliveryChannelInner resource, + Context context) { + return this.beginCreateOrReplaceAsync(resourceGroupName, name, resource, context).getSyncPoller(); + } + + /** + * Create a ConfigServiceDeliveryChannel. Please note that end user resource creation is currently restricted, but + * it will be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ConfigServiceDeliveryChannel. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrReplaceAsync(String resourceGroupName, String name, + ConfigServiceDeliveryChannelInner resource) { + return beginCreateOrReplaceAsync(resourceGroupName, name, resource).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create a ConfigServiceDeliveryChannel. Please note that end user resource creation is currently restricted, but + * it will be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ConfigServiceDeliveryChannel. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrReplaceAsync(String resourceGroupName, String name, + ConfigServiceDeliveryChannelInner resource, Context context) { + return beginCreateOrReplaceAsync(resourceGroupName, name, resource, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create a ConfigServiceDeliveryChannel. Please note that end user resource creation is currently restricted, but + * it will be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ConfigServiceDeliveryChannel. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ConfigServiceDeliveryChannelInner createOrReplace(String resourceGroupName, String name, + ConfigServiceDeliveryChannelInner resource) { + return createOrReplaceAsync(resourceGroupName, name, resource).block(); + } + + /** + * Create a ConfigServiceDeliveryChannel. Please note that end user resource creation is currently restricted, but + * it will be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ConfigServiceDeliveryChannel. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ConfigServiceDeliveryChannelInner createOrReplace(String resourceGroupName, String name, + ConfigServiceDeliveryChannelInner resource, Context context) { + return createOrReplaceAsync(resourceGroupName, name, resource, context).block(); + } + + /** + * Update a ConfigServiceDeliveryChannel. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ConfigServiceDeliveryChannel. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync(String resourceGroupName, String name, + ConfigServiceDeliveryChannelTagsUpdate properties) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (properties == null) { + return Mono.error(new IllegalArgumentException("Parameter properties is required and cannot be null.")); + } else { + properties.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.update(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, properties, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Update a ConfigServiceDeliveryChannel. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ConfigServiceDeliveryChannel. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync(String resourceGroupName, String name, + ConfigServiceDeliveryChannelTagsUpdate properties, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (properties == null) { + return Mono.error(new IllegalArgumentException("Parameter properties is required and cannot be null.")); + } else { + properties.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.update(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, name, properties, accept, context); + } + + /** + * Update a ConfigServiceDeliveryChannel. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ConfigServiceDeliveryChannel. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, ConfigServiceDeliveryChannelInner> + beginUpdateAsync(String resourceGroupName, String name, ConfigServiceDeliveryChannelTagsUpdate properties) { + Mono>> mono = updateWithResponseAsync(resourceGroupName, name, properties); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), ConfigServiceDeliveryChannelInner.class, + ConfigServiceDeliveryChannelInner.class, this.client.getContext()); + } + + /** + * Update a ConfigServiceDeliveryChannel. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ConfigServiceDeliveryChannel. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, ConfigServiceDeliveryChannelInner> + beginUpdateAsync(String resourceGroupName, String name, ConfigServiceDeliveryChannelTagsUpdate properties, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = updateWithResponseAsync(resourceGroupName, name, properties, context); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), ConfigServiceDeliveryChannelInner.class, + ConfigServiceDeliveryChannelInner.class, context); + } + + /** + * Update a ConfigServiceDeliveryChannel. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ConfigServiceDeliveryChannel. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ConfigServiceDeliveryChannelInner> + beginUpdate(String resourceGroupName, String name, ConfigServiceDeliveryChannelTagsUpdate properties) { + return this.beginUpdateAsync(resourceGroupName, name, properties).getSyncPoller(); + } + + /** + * Update a ConfigServiceDeliveryChannel. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ConfigServiceDeliveryChannel. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ConfigServiceDeliveryChannelInner> beginUpdate( + String resourceGroupName, String name, ConfigServiceDeliveryChannelTagsUpdate properties, Context context) { + return this.beginUpdateAsync(resourceGroupName, name, properties, context).getSyncPoller(); + } + + /** + * Update a ConfigServiceDeliveryChannel. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ConfigServiceDeliveryChannel. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync(String resourceGroupName, String name, + ConfigServiceDeliveryChannelTagsUpdate properties) { + return beginUpdateAsync(resourceGroupName, name, properties).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Update a ConfigServiceDeliveryChannel. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ConfigServiceDeliveryChannel. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync(String resourceGroupName, String name, + ConfigServiceDeliveryChannelTagsUpdate properties, Context context) { + return beginUpdateAsync(resourceGroupName, name, properties, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Update a ConfigServiceDeliveryChannel. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ConfigServiceDeliveryChannel. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ConfigServiceDeliveryChannelInner update(String resourceGroupName, String name, + ConfigServiceDeliveryChannelTagsUpdate properties) { + return updateAsync(resourceGroupName, name, properties).block(); + } + + /** + * Update a ConfigServiceDeliveryChannel. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ConfigServiceDeliveryChannel. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ConfigServiceDeliveryChannelInner update(String resourceGroupName, String name, + ConfigServiceDeliveryChannelTagsUpdate properties, Context context) { + return updateAsync(resourceGroupName, name, properties, context).block(); + } + + /** + * Delete a ConfigServiceDeliveryChannel. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ConfigServiceDeliveryChannel. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync(String resourceGroupName, String name) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Delete a ConfigServiceDeliveryChannel. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ConfigServiceDeliveryChannel. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync(String resourceGroupName, String name, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.delete(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, name, accept, context); + } + + /** + * Delete a ConfigServiceDeliveryChannel. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ConfigServiceDeliveryChannel. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String name) { + Mono>> mono = deleteWithResponseAsync(resourceGroupName, name); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); + } + + /** + * Delete a ConfigServiceDeliveryChannel. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ConfigServiceDeliveryChannel. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String name, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = deleteWithResponseAsync(resourceGroupName, name, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + context); + } + + /** + * Delete a ConfigServiceDeliveryChannel. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ConfigServiceDeliveryChannel. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String name) { + return this.beginDeleteAsync(resourceGroupName, name).getSyncPoller(); + } + + /** + * Delete a ConfigServiceDeliveryChannel. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ConfigServiceDeliveryChannel. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String name, Context context) { + return this.beginDeleteAsync(resourceGroupName, name, context).getSyncPoller(); + } + + /** + * Delete a ConfigServiceDeliveryChannel. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ConfigServiceDeliveryChannel. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String name) { + return beginDeleteAsync(resourceGroupName, name).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete a ConfigServiceDeliveryChannel. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ConfigServiceDeliveryChannel. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String name, Context context) { + return beginDeleteAsync(resourceGroupName, name, context).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete a ConfigServiceDeliveryChannel. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ConfigServiceDeliveryChannel. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String name) { + deleteAsync(resourceGroupName, name).block(); + } + + /** + * Delete a ConfigServiceDeliveryChannel. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ConfigServiceDeliveryChannel. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String name, Context context) { + deleteAsync(resourceGroupName, name, context).block(); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a ConfigServiceDeliveryChannel list operation along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> + listBySubscriptionNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a ConfigServiceDeliveryChannel list operation along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> + listBySubscriptionNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a ConfigServiceDeliveryChannel list operation along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> + listByResourceGroupNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a ConfigServiceDeliveryChannel list operation along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> + listByResourceGroupNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/ConfigServiceDeliveryChannelsImpl.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/ConfigServiceDeliveryChannelsImpl.java new file mode 100644 index 000000000000..67708026a239 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/ConfigServiceDeliveryChannelsImpl.java @@ -0,0 +1,152 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.awsconnector.fluent.ConfigServiceDeliveryChannelsClient; +import com.azure.resourcemanager.awsconnector.fluent.models.ConfigServiceDeliveryChannelInner; +import com.azure.resourcemanager.awsconnector.models.ConfigServiceDeliveryChannel; +import com.azure.resourcemanager.awsconnector.models.ConfigServiceDeliveryChannels; + +public final class ConfigServiceDeliveryChannelsImpl implements ConfigServiceDeliveryChannels { + private static final ClientLogger LOGGER = new ClientLogger(ConfigServiceDeliveryChannelsImpl.class); + + private final ConfigServiceDeliveryChannelsClient innerClient; + + private final com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager; + + public ConfigServiceDeliveryChannelsImpl(ConfigServiceDeliveryChannelsClient innerClient, + com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return ResourceManagerUtils.mapPage(inner, + inner1 -> new ConfigServiceDeliveryChannelImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return ResourceManagerUtils.mapPage(inner, + inner1 -> new ConfigServiceDeliveryChannelImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName) { + PagedIterable inner + = this.serviceClient().listByResourceGroup(resourceGroupName); + return ResourceManagerUtils.mapPage(inner, + inner1 -> new ConfigServiceDeliveryChannelImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + PagedIterable inner + = this.serviceClient().listByResourceGroup(resourceGroupName, context); + return ResourceManagerUtils.mapPage(inner, + inner1 -> new ConfigServiceDeliveryChannelImpl(inner1, this.manager())); + } + + public Response getByResourceGroupWithResponse(String resourceGroupName, String name, + Context context) { + Response inner + = this.serviceClient().getByResourceGroupWithResponse(resourceGroupName, name, context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new ConfigServiceDeliveryChannelImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public ConfigServiceDeliveryChannel getByResourceGroup(String resourceGroupName, String name) { + ConfigServiceDeliveryChannelInner inner = this.serviceClient().getByResourceGroup(resourceGroupName, name); + if (inner != null) { + return new ConfigServiceDeliveryChannelImpl(inner, this.manager()); + } else { + return null; + } + } + + public void deleteByResourceGroup(String resourceGroupName, String name) { + this.serviceClient().delete(resourceGroupName, name); + } + + public void delete(String resourceGroupName, String name, Context context) { + this.serviceClient().delete(resourceGroupName, name, context); + } + + public ConfigServiceDeliveryChannel getById(String id) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String name = ResourceManagerUtils.getValueFromIdByName(id, "configServiceDeliveryChannels"); + if (name == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException(String.format( + "The resource ID '%s' is not valid. Missing path segment 'configServiceDeliveryChannels'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, name, Context.NONE).getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String name = ResourceManagerUtils.getValueFromIdByName(id, "configServiceDeliveryChannels"); + if (name == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException(String.format( + "The resource ID '%s' is not valid. Missing path segment 'configServiceDeliveryChannels'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, name, context); + } + + public void deleteById(String id) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String name = ResourceManagerUtils.getValueFromIdByName(id, "configServiceDeliveryChannels"); + if (name == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException(String.format( + "The resource ID '%s' is not valid. Missing path segment 'configServiceDeliveryChannels'.", id))); + } + this.delete(resourceGroupName, name, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String name = ResourceManagerUtils.getValueFromIdByName(id, "configServiceDeliveryChannels"); + if (name == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException(String.format( + "The resource ID '%s' is not valid. Missing path segment 'configServiceDeliveryChannels'.", id))); + } + this.delete(resourceGroupName, name, context); + } + + private ConfigServiceDeliveryChannelsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.awsconnector.AwsconnectorManager manager() { + return this.serviceManager; + } + + public ConfigServiceDeliveryChannelImpl define(String name) { + return new ConfigServiceDeliveryChannelImpl(name, this.manager()); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/DatabaseMigrationServiceReplicationInstanceImpl.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/DatabaseMigrationServiceReplicationInstanceImpl.java new file mode 100644 index 000000000000..6dc4e06ff1e9 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/DatabaseMigrationServiceReplicationInstanceImpl.java @@ -0,0 +1,182 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.implementation; + +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.awsconnector.fluent.models.DatabaseMigrationServiceReplicationInstanceInner; +import com.azure.resourcemanager.awsconnector.models.DatabaseMigrationServiceReplicationInstance; +import com.azure.resourcemanager.awsconnector.models.DatabaseMigrationServiceReplicationInstanceProperties; +import com.azure.resourcemanager.awsconnector.models.DatabaseMigrationServiceReplicationInstanceTagsUpdate; +import java.util.Collections; +import java.util.Map; + +public final class DatabaseMigrationServiceReplicationInstanceImpl + implements DatabaseMigrationServiceReplicationInstance, DatabaseMigrationServiceReplicationInstance.Definition, + DatabaseMigrationServiceReplicationInstance.Update { + private DatabaseMigrationServiceReplicationInstanceInner innerObject; + + private final com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public String location() { + return this.innerModel().location(); + } + + public Map tags() { + Map inner = this.innerModel().tags(); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } + } + + public DatabaseMigrationServiceReplicationInstanceProperties properties() { + return this.innerModel().properties(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public String resourceGroupName() { + return resourceGroupName; + } + + public DatabaseMigrationServiceReplicationInstanceInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.awsconnector.AwsconnectorManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String name; + + private DatabaseMigrationServiceReplicationInstanceTagsUpdate updateProperties; + + public DatabaseMigrationServiceReplicationInstanceImpl withExistingResourceGroup(String resourceGroupName) { + this.resourceGroupName = resourceGroupName; + return this; + } + + public DatabaseMigrationServiceReplicationInstance create() { + this.innerObject = serviceManager.serviceClient() + .getDatabaseMigrationServiceReplicationInstances() + .createOrReplace(resourceGroupName, name, this.innerModel(), Context.NONE); + return this; + } + + public DatabaseMigrationServiceReplicationInstance create(Context context) { + this.innerObject = serviceManager.serviceClient() + .getDatabaseMigrationServiceReplicationInstances() + .createOrReplace(resourceGroupName, name, this.innerModel(), context); + return this; + } + + DatabaseMigrationServiceReplicationInstanceImpl(String name, + com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager) { + this.innerObject = new DatabaseMigrationServiceReplicationInstanceInner(); + this.serviceManager = serviceManager; + this.name = name; + } + + public DatabaseMigrationServiceReplicationInstanceImpl update() { + this.updateProperties = new DatabaseMigrationServiceReplicationInstanceTagsUpdate(); + return this; + } + + public DatabaseMigrationServiceReplicationInstance apply() { + this.innerObject = serviceManager.serviceClient() + .getDatabaseMigrationServiceReplicationInstances() + .update(resourceGroupName, name, updateProperties, Context.NONE); + return this; + } + + public DatabaseMigrationServiceReplicationInstance apply(Context context) { + this.innerObject = serviceManager.serviceClient() + .getDatabaseMigrationServiceReplicationInstances() + .update(resourceGroupName, name, updateProperties, context); + return this; + } + + DatabaseMigrationServiceReplicationInstanceImpl(DatabaseMigrationServiceReplicationInstanceInner innerObject, + com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.name = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), + "databaseMigrationServiceReplicationInstances"); + } + + public DatabaseMigrationServiceReplicationInstance refresh() { + this.innerObject = serviceManager.serviceClient() + .getDatabaseMigrationServiceReplicationInstances() + .getByResourceGroupWithResponse(resourceGroupName, name, Context.NONE) + .getValue(); + return this; + } + + public DatabaseMigrationServiceReplicationInstance refresh(Context context) { + this.innerObject = serviceManager.serviceClient() + .getDatabaseMigrationServiceReplicationInstances() + .getByResourceGroupWithResponse(resourceGroupName, name, context) + .getValue(); + return this; + } + + public DatabaseMigrationServiceReplicationInstanceImpl withRegion(Region location) { + this.innerModel().withLocation(location.toString()); + return this; + } + + public DatabaseMigrationServiceReplicationInstanceImpl withRegion(String location) { + this.innerModel().withLocation(location); + return this; + } + + public DatabaseMigrationServiceReplicationInstanceImpl withTags(Map tags) { + if (isInCreateMode()) { + this.innerModel().withTags(tags); + return this; + } else { + this.updateProperties.withTags(tags); + return this; + } + } + + public DatabaseMigrationServiceReplicationInstanceImpl + withProperties(DatabaseMigrationServiceReplicationInstanceProperties properties) { + this.innerModel().withProperties(properties); + return this; + } + + private boolean isInCreateMode() { + return this.innerModel().id() == null; + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/DatabaseMigrationServiceReplicationInstancesClientImpl.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/DatabaseMigrationServiceReplicationInstancesClientImpl.java new file mode 100644 index 000000000000..bcea6baf6722 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/DatabaseMigrationServiceReplicationInstancesClientImpl.java @@ -0,0 +1,1330 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.Patch; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.awsconnector.fluent.DatabaseMigrationServiceReplicationInstancesClient; +import com.azure.resourcemanager.awsconnector.fluent.models.DatabaseMigrationServiceReplicationInstanceInner; +import com.azure.resourcemanager.awsconnector.models.DatabaseMigrationServiceReplicationInstanceListResult; +import com.azure.resourcemanager.awsconnector.models.DatabaseMigrationServiceReplicationInstanceTagsUpdate; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in + * DatabaseMigrationServiceReplicationInstancesClient. + */ +public final class DatabaseMigrationServiceReplicationInstancesClientImpl + implements DatabaseMigrationServiceReplicationInstancesClient { + /** + * The proxy service used to perform REST calls. + */ + private final DatabaseMigrationServiceReplicationInstancesService service; + + /** + * The service client containing this operation class. + */ + private final MicrosoftAwsConnectorImpl client; + + /** + * Initializes an instance of DatabaseMigrationServiceReplicationInstancesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + DatabaseMigrationServiceReplicationInstancesClientImpl(MicrosoftAwsConnectorImpl client) { + this.service = RestProxy.create(DatabaseMigrationServiceReplicationInstancesService.class, + client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for MicrosoftAwsConnectorDatabaseMigrationServiceReplicationInstances to + * be used by the proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "MicrosoftAwsConnecto") + public interface DatabaseMigrationServiceReplicationInstancesService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.AwsConnector/databaseMigrationServiceReplicationInstances") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/databaseMigrationServiceReplicationInstances") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroup( + @HostParam("$host") String endpoint, @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/databaseMigrationServiceReplicationInstances/{name}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getByResourceGroup( + @HostParam("$host") String endpoint, @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("name") String name, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/databaseMigrationServiceReplicationInstances/{name}") + @ExpectedResponses({ 200, 201 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrReplace(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("name") String name, + @BodyParam("application/json") DatabaseMigrationServiceReplicationInstanceInner resource, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/databaseMigrationServiceReplicationInstances/{name}") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> update(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("name") String name, + @BodyParam("application/json") DatabaseMigrationServiceReplicationInstanceTagsUpdate properties, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/databaseMigrationServiceReplicationInstances/{name}") + @ExpectedResponses({ 202, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("name") String name, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listBySubscriptionNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroupNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); + } + + /** + * List DatabaseMigrationServiceReplicationInstance resources by subscription ID. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a DatabaseMigrationServiceReplicationInstance list operation along with + * {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync() { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), accept, context)) + .>map( + res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List DatabaseMigrationServiceReplicationInstance resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a DatabaseMigrationServiceReplicationInstance list operation along with + * {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), accept, + context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * List DatabaseMigrationServiceReplicationInstance resources by subscription ID. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a DatabaseMigrationServiceReplicationInstance list operation as paginated response with + * {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>(() -> listSinglePageAsync(), + nextLink -> listBySubscriptionNextSinglePageAsync(nextLink)); + } + + /** + * List DatabaseMigrationServiceReplicationInstance resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a DatabaseMigrationServiceReplicationInstance list operation as paginated response with + * {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(Context context) { + return new PagedFlux<>(() -> listSinglePageAsync(context), + nextLink -> listBySubscriptionNextSinglePageAsync(nextLink, context)); + } + + /** + * List DatabaseMigrationServiceReplicationInstance resources by subscription ID. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a DatabaseMigrationServiceReplicationInstance list operation as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + return new PagedIterable<>(listAsync()); + } + + /** + * List DatabaseMigrationServiceReplicationInstance resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a DatabaseMigrationServiceReplicationInstance list operation as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Context context) { + return new PagedIterable<>(listAsync(context)); + } + + /** + * List DatabaseMigrationServiceReplicationInstance resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a DatabaseMigrationServiceReplicationInstance list operation along with + * {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> + listByResourceGroupSinglePageAsync(String resourceGroupName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accept, context)) + .>map( + res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List DatabaseMigrationServiceReplicationInstance resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a DatabaseMigrationServiceReplicationInstance list operation along with + * {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> + listByResourceGroupSinglePageAsync(String resourceGroupName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * List DatabaseMigrationServiceReplicationInstance resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a DatabaseMigrationServiceReplicationInstance list operation as paginated response with + * {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux + listByResourceGroupAsync(String resourceGroupName) { + return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); + } + + /** + * List DatabaseMigrationServiceReplicationInstance resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a DatabaseMigrationServiceReplicationInstance list operation as paginated response with + * {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux + listByResourceGroupAsync(String resourceGroupName, Context context) { + return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName, context), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink, context)); + } + + /** + * List DatabaseMigrationServiceReplicationInstance resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a DatabaseMigrationServiceReplicationInstance list operation as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable + listByResourceGroup(String resourceGroupName) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName)); + } + + /** + * List DatabaseMigrationServiceReplicationInstance resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a DatabaseMigrationServiceReplicationInstance list operation as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName, + Context context) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, context)); + } + + /** + * Get a DatabaseMigrationServiceReplicationInstance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of DatabaseMigrationServiceReplicationInstance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a DatabaseMigrationServiceReplicationInstance along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> + getByResourceGroupWithResponseAsync(String resourceGroupName, String name) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.getByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get a DatabaseMigrationServiceReplicationInstance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of DatabaseMigrationServiceReplicationInstance. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a DatabaseMigrationServiceReplicationInstance along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> + getByResourceGroupWithResponseAsync(String resourceGroupName, String name, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.getByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, accept, context); + } + + /** + * Get a DatabaseMigrationServiceReplicationInstance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of DatabaseMigrationServiceReplicationInstance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a DatabaseMigrationServiceReplicationInstance on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getByResourceGroupAsync(String resourceGroupName, + String name) { + return getByResourceGroupWithResponseAsync(resourceGroupName, name) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Get a DatabaseMigrationServiceReplicationInstance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of DatabaseMigrationServiceReplicationInstance. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a DatabaseMigrationServiceReplicationInstance along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response + getByResourceGroupWithResponse(String resourceGroupName, String name, Context context) { + return getByResourceGroupWithResponseAsync(resourceGroupName, name, context).block(); + } + + /** + * Get a DatabaseMigrationServiceReplicationInstance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of DatabaseMigrationServiceReplicationInstance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a DatabaseMigrationServiceReplicationInstance. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public DatabaseMigrationServiceReplicationInstanceInner getByResourceGroup(String resourceGroupName, String name) { + return getByResourceGroupWithResponse(resourceGroupName, name, Context.NONE).getValue(); + } + + /** + * Create a DatabaseMigrationServiceReplicationInstance. Please note that end user resource creation is currently + * restricted, but it will be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of DatabaseMigrationServiceReplicationInstance. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrReplaceWithResponseAsync(String resourceGroupName, String name, + DatabaseMigrationServiceReplicationInstanceInner resource) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (resource == null) { + return Mono.error(new IllegalArgumentException("Parameter resource is required and cannot be null.")); + } else { + resource.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.createOrReplace(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, resource, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Create a DatabaseMigrationServiceReplicationInstance. Please note that end user resource creation is currently + * restricted, but it will be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of DatabaseMigrationServiceReplicationInstance. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrReplaceWithResponseAsync(String resourceGroupName, String name, + DatabaseMigrationServiceReplicationInstanceInner resource, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (resource == null) { + return Mono.error(new IllegalArgumentException("Parameter resource is required and cannot be null.")); + } else { + resource.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.createOrReplace(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, resource, accept, context); + } + + /** + * Create a DatabaseMigrationServiceReplicationInstance. Please note that end user resource creation is currently + * restricted, but it will be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of DatabaseMigrationServiceReplicationInstance. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private + PollerFlux, DatabaseMigrationServiceReplicationInstanceInner> + beginCreateOrReplaceAsync(String resourceGroupName, String name, + DatabaseMigrationServiceReplicationInstanceInner resource) { + Mono>> mono = createOrReplaceWithResponseAsync(resourceGroupName, name, resource); + return this.client + .getLroResult( + mono, this.client.getHttpPipeline(), DatabaseMigrationServiceReplicationInstanceInner.class, + DatabaseMigrationServiceReplicationInstanceInner.class, this.client.getContext()); + } + + /** + * Create a DatabaseMigrationServiceReplicationInstance. Please note that end user resource creation is currently + * restricted, but it will be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of DatabaseMigrationServiceReplicationInstance. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private + PollerFlux, DatabaseMigrationServiceReplicationInstanceInner> + beginCreateOrReplaceAsync(String resourceGroupName, String name, + DatabaseMigrationServiceReplicationInstanceInner resource, Context context) { + context = this.client.mergeContext(context); + Mono>> mono + = createOrReplaceWithResponseAsync(resourceGroupName, name, resource, context); + return this.client + .getLroResult( + mono, this.client.getHttpPipeline(), DatabaseMigrationServiceReplicationInstanceInner.class, + DatabaseMigrationServiceReplicationInstanceInner.class, context); + } + + /** + * Create a DatabaseMigrationServiceReplicationInstance. Please note that end user resource creation is currently + * restricted, but it will be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of DatabaseMigrationServiceReplicationInstance. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public + SyncPoller, DatabaseMigrationServiceReplicationInstanceInner> + beginCreateOrReplace(String resourceGroupName, String name, + DatabaseMigrationServiceReplicationInstanceInner resource) { + return this.beginCreateOrReplaceAsync(resourceGroupName, name, resource).getSyncPoller(); + } + + /** + * Create a DatabaseMigrationServiceReplicationInstance. Please note that end user resource creation is currently + * restricted, but it will be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of DatabaseMigrationServiceReplicationInstance. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public + SyncPoller, DatabaseMigrationServiceReplicationInstanceInner> + beginCreateOrReplace(String resourceGroupName, String name, + DatabaseMigrationServiceReplicationInstanceInner resource, Context context) { + return this.beginCreateOrReplaceAsync(resourceGroupName, name, resource, context).getSyncPoller(); + } + + /** + * Create a DatabaseMigrationServiceReplicationInstance. Please note that end user resource creation is currently + * restricted, but it will be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of DatabaseMigrationServiceReplicationInstance. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrReplaceAsync(String resourceGroupName, + String name, DatabaseMigrationServiceReplicationInstanceInner resource) { + return beginCreateOrReplaceAsync(resourceGroupName, name, resource).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create a DatabaseMigrationServiceReplicationInstance. Please note that end user resource creation is currently + * restricted, but it will be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of DatabaseMigrationServiceReplicationInstance. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrReplaceAsync(String resourceGroupName, + String name, DatabaseMigrationServiceReplicationInstanceInner resource, Context context) { + return beginCreateOrReplaceAsync(resourceGroupName, name, resource, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create a DatabaseMigrationServiceReplicationInstance. Please note that end user resource creation is currently + * restricted, but it will be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of DatabaseMigrationServiceReplicationInstance. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public DatabaseMigrationServiceReplicationInstanceInner createOrReplace(String resourceGroupName, String name, + DatabaseMigrationServiceReplicationInstanceInner resource) { + return createOrReplaceAsync(resourceGroupName, name, resource).block(); + } + + /** + * Create a DatabaseMigrationServiceReplicationInstance. Please note that end user resource creation is currently + * restricted, but it will be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of DatabaseMigrationServiceReplicationInstance. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public DatabaseMigrationServiceReplicationInstanceInner createOrReplace(String resourceGroupName, String name, + DatabaseMigrationServiceReplicationInstanceInner resource, Context context) { + return createOrReplaceAsync(resourceGroupName, name, resource, context).block(); + } + + /** + * Update a DatabaseMigrationServiceReplicationInstance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of DatabaseMigrationServiceReplicationInstance. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync(String resourceGroupName, String name, + DatabaseMigrationServiceReplicationInstanceTagsUpdate properties) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (properties == null) { + return Mono.error(new IllegalArgumentException("Parameter properties is required and cannot be null.")); + } else { + properties.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.update(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, properties, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Update a DatabaseMigrationServiceReplicationInstance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of DatabaseMigrationServiceReplicationInstance. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync(String resourceGroupName, String name, + DatabaseMigrationServiceReplicationInstanceTagsUpdate properties, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (properties == null) { + return Mono.error(new IllegalArgumentException("Parameter properties is required and cannot be null.")); + } else { + properties.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.update(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, name, properties, accept, context); + } + + /** + * Update a DatabaseMigrationServiceReplicationInstance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of DatabaseMigrationServiceReplicationInstance. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private + PollerFlux, DatabaseMigrationServiceReplicationInstanceInner> + beginUpdateAsync(String resourceGroupName, String name, + DatabaseMigrationServiceReplicationInstanceTagsUpdate properties) { + Mono>> mono = updateWithResponseAsync(resourceGroupName, name, properties); + return this.client + .getLroResult( + mono, this.client.getHttpPipeline(), DatabaseMigrationServiceReplicationInstanceInner.class, + DatabaseMigrationServiceReplicationInstanceInner.class, this.client.getContext()); + } + + /** + * Update a DatabaseMigrationServiceReplicationInstance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of DatabaseMigrationServiceReplicationInstance. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private + PollerFlux, DatabaseMigrationServiceReplicationInstanceInner> + beginUpdateAsync(String resourceGroupName, String name, + DatabaseMigrationServiceReplicationInstanceTagsUpdate properties, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = updateWithResponseAsync(resourceGroupName, name, properties, context); + return this.client + .getLroResult( + mono, this.client.getHttpPipeline(), DatabaseMigrationServiceReplicationInstanceInner.class, + DatabaseMigrationServiceReplicationInstanceInner.class, context); + } + + /** + * Update a DatabaseMigrationServiceReplicationInstance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of DatabaseMigrationServiceReplicationInstance. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public + SyncPoller, DatabaseMigrationServiceReplicationInstanceInner> + beginUpdate(String resourceGroupName, String name, + DatabaseMigrationServiceReplicationInstanceTagsUpdate properties) { + return this.beginUpdateAsync(resourceGroupName, name, properties).getSyncPoller(); + } + + /** + * Update a DatabaseMigrationServiceReplicationInstance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of DatabaseMigrationServiceReplicationInstance. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public + SyncPoller, DatabaseMigrationServiceReplicationInstanceInner> + beginUpdate(String resourceGroupName, String name, + DatabaseMigrationServiceReplicationInstanceTagsUpdate properties, Context context) { + return this.beginUpdateAsync(resourceGroupName, name, properties, context).getSyncPoller(); + } + + /** + * Update a DatabaseMigrationServiceReplicationInstance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of DatabaseMigrationServiceReplicationInstance. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync(String resourceGroupName, String name, + DatabaseMigrationServiceReplicationInstanceTagsUpdate properties) { + return beginUpdateAsync(resourceGroupName, name, properties).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Update a DatabaseMigrationServiceReplicationInstance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of DatabaseMigrationServiceReplicationInstance. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync(String resourceGroupName, String name, + DatabaseMigrationServiceReplicationInstanceTagsUpdate properties, Context context) { + return beginUpdateAsync(resourceGroupName, name, properties, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Update a DatabaseMigrationServiceReplicationInstance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of DatabaseMigrationServiceReplicationInstance. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public DatabaseMigrationServiceReplicationInstanceInner update(String resourceGroupName, String name, + DatabaseMigrationServiceReplicationInstanceTagsUpdate properties) { + return updateAsync(resourceGroupName, name, properties).block(); + } + + /** + * Update a DatabaseMigrationServiceReplicationInstance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of DatabaseMigrationServiceReplicationInstance. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public DatabaseMigrationServiceReplicationInstanceInner update(String resourceGroupName, String name, + DatabaseMigrationServiceReplicationInstanceTagsUpdate properties, Context context) { + return updateAsync(resourceGroupName, name, properties, context).block(); + } + + /** + * Delete a DatabaseMigrationServiceReplicationInstance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of DatabaseMigrationServiceReplicationInstance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync(String resourceGroupName, String name) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Delete a DatabaseMigrationServiceReplicationInstance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of DatabaseMigrationServiceReplicationInstance. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync(String resourceGroupName, String name, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.delete(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, name, accept, context); + } + + /** + * Delete a DatabaseMigrationServiceReplicationInstance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of DatabaseMigrationServiceReplicationInstance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String name) { + Mono>> mono = deleteWithResponseAsync(resourceGroupName, name); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); + } + + /** + * Delete a DatabaseMigrationServiceReplicationInstance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of DatabaseMigrationServiceReplicationInstance. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String name, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = deleteWithResponseAsync(resourceGroupName, name, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + context); + } + + /** + * Delete a DatabaseMigrationServiceReplicationInstance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of DatabaseMigrationServiceReplicationInstance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String name) { + return this.beginDeleteAsync(resourceGroupName, name).getSyncPoller(); + } + + /** + * Delete a DatabaseMigrationServiceReplicationInstance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of DatabaseMigrationServiceReplicationInstance. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String name, Context context) { + return this.beginDeleteAsync(resourceGroupName, name, context).getSyncPoller(); + } + + /** + * Delete a DatabaseMigrationServiceReplicationInstance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of DatabaseMigrationServiceReplicationInstance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String name) { + return beginDeleteAsync(resourceGroupName, name).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete a DatabaseMigrationServiceReplicationInstance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of DatabaseMigrationServiceReplicationInstance. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String name, Context context) { + return beginDeleteAsync(resourceGroupName, name, context).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete a DatabaseMigrationServiceReplicationInstance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of DatabaseMigrationServiceReplicationInstance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String name) { + deleteAsync(resourceGroupName, name).block(); + } + + /** + * Delete a DatabaseMigrationServiceReplicationInstance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of DatabaseMigrationServiceReplicationInstance. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String name, Context context) { + deleteAsync(resourceGroupName, name, context).block(); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a DatabaseMigrationServiceReplicationInstance list operation along with + * {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> + listBySubscriptionNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a DatabaseMigrationServiceReplicationInstance list operation along with + * {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> + listBySubscriptionNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a DatabaseMigrationServiceReplicationInstance list operation along with + * {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> + listByResourceGroupNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a DatabaseMigrationServiceReplicationInstance list operation along with + * {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> + listByResourceGroupNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/DatabaseMigrationServiceReplicationInstancesImpl.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/DatabaseMigrationServiceReplicationInstancesImpl.java new file mode 100644 index 000000000000..48397a09d0b8 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/DatabaseMigrationServiceReplicationInstancesImpl.java @@ -0,0 +1,160 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.awsconnector.fluent.DatabaseMigrationServiceReplicationInstancesClient; +import com.azure.resourcemanager.awsconnector.fluent.models.DatabaseMigrationServiceReplicationInstanceInner; +import com.azure.resourcemanager.awsconnector.models.DatabaseMigrationServiceReplicationInstance; +import com.azure.resourcemanager.awsconnector.models.DatabaseMigrationServiceReplicationInstances; + +public final class DatabaseMigrationServiceReplicationInstancesImpl + implements DatabaseMigrationServiceReplicationInstances { + private static final ClientLogger LOGGER = new ClientLogger(DatabaseMigrationServiceReplicationInstancesImpl.class); + + private final DatabaseMigrationServiceReplicationInstancesClient innerClient; + + private final com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager; + + public DatabaseMigrationServiceReplicationInstancesImpl( + DatabaseMigrationServiceReplicationInstancesClient innerClient, + com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return ResourceManagerUtils.mapPage(inner, + inner1 -> new DatabaseMigrationServiceReplicationInstanceImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return ResourceManagerUtils.mapPage(inner, + inner1 -> new DatabaseMigrationServiceReplicationInstanceImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName) { + PagedIterable inner + = this.serviceClient().listByResourceGroup(resourceGroupName); + return ResourceManagerUtils.mapPage(inner, + inner1 -> new DatabaseMigrationServiceReplicationInstanceImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName, + Context context) { + PagedIterable inner + = this.serviceClient().listByResourceGroup(resourceGroupName, context); + return ResourceManagerUtils.mapPage(inner, + inner1 -> new DatabaseMigrationServiceReplicationInstanceImpl(inner1, this.manager())); + } + + public Response + getByResourceGroupWithResponse(String resourceGroupName, String name, Context context) { + Response inner + = this.serviceClient().getByResourceGroupWithResponse(resourceGroupName, name, context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new DatabaseMigrationServiceReplicationInstanceImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public DatabaseMigrationServiceReplicationInstance getByResourceGroup(String resourceGroupName, String name) { + DatabaseMigrationServiceReplicationInstanceInner inner + = this.serviceClient().getByResourceGroup(resourceGroupName, name); + if (inner != null) { + return new DatabaseMigrationServiceReplicationInstanceImpl(inner, this.manager()); + } else { + return null; + } + } + + public void deleteByResourceGroup(String resourceGroupName, String name) { + this.serviceClient().delete(resourceGroupName, name); + } + + public void delete(String resourceGroupName, String name, Context context) { + this.serviceClient().delete(resourceGroupName, name, context); + } + + public DatabaseMigrationServiceReplicationInstance getById(String id) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String name = ResourceManagerUtils.getValueFromIdByName(id, "databaseMigrationServiceReplicationInstances"); + if (name == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException(String.format( + "The resource ID '%s' is not valid. Missing path segment 'databaseMigrationServiceReplicationInstances'.", + id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, name, Context.NONE).getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String name = ResourceManagerUtils.getValueFromIdByName(id, "databaseMigrationServiceReplicationInstances"); + if (name == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException(String.format( + "The resource ID '%s' is not valid. Missing path segment 'databaseMigrationServiceReplicationInstances'.", + id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, name, context); + } + + public void deleteById(String id) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String name = ResourceManagerUtils.getValueFromIdByName(id, "databaseMigrationServiceReplicationInstances"); + if (name == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException(String.format( + "The resource ID '%s' is not valid. Missing path segment 'databaseMigrationServiceReplicationInstances'.", + id))); + } + this.delete(resourceGroupName, name, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String name = ResourceManagerUtils.getValueFromIdByName(id, "databaseMigrationServiceReplicationInstances"); + if (name == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException(String.format( + "The resource ID '%s' is not valid. Missing path segment 'databaseMigrationServiceReplicationInstances'.", + id))); + } + this.delete(resourceGroupName, name, context); + } + + private DatabaseMigrationServiceReplicationInstancesClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.awsconnector.AwsconnectorManager manager() { + return this.serviceManager; + } + + public DatabaseMigrationServiceReplicationInstanceImpl define(String name) { + return new DatabaseMigrationServiceReplicationInstanceImpl(name, this.manager()); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/DaxClusterImpl.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/DaxClusterImpl.java new file mode 100644 index 000000000000..e292360a449a --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/DaxClusterImpl.java @@ -0,0 +1,177 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.implementation; + +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.awsconnector.fluent.models.DaxClusterInner; +import com.azure.resourcemanager.awsconnector.models.DaxCluster; +import com.azure.resourcemanager.awsconnector.models.DaxClusterProperties; +import com.azure.resourcemanager.awsconnector.models.DaxClusterTagsUpdate; +import java.util.Collections; +import java.util.Map; + +public final class DaxClusterImpl implements DaxCluster, DaxCluster.Definition, DaxCluster.Update { + private DaxClusterInner innerObject; + + private final com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public String location() { + return this.innerModel().location(); + } + + public Map tags() { + Map inner = this.innerModel().tags(); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } + } + + public DaxClusterProperties properties() { + return this.innerModel().properties(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public String resourceGroupName() { + return resourceGroupName; + } + + public DaxClusterInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.awsconnector.AwsconnectorManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String name; + + private DaxClusterTagsUpdate updateProperties; + + public DaxClusterImpl withExistingResourceGroup(String resourceGroupName) { + this.resourceGroupName = resourceGroupName; + return this; + } + + public DaxCluster create() { + this.innerObject = serviceManager.serviceClient() + .getDaxClusters() + .createOrReplace(resourceGroupName, name, this.innerModel(), Context.NONE); + return this; + } + + public DaxCluster create(Context context) { + this.innerObject = serviceManager.serviceClient() + .getDaxClusters() + .createOrReplace(resourceGroupName, name, this.innerModel(), context); + return this; + } + + DaxClusterImpl(String name, com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager) { + this.innerObject = new DaxClusterInner(); + this.serviceManager = serviceManager; + this.name = name; + } + + public DaxClusterImpl update() { + this.updateProperties = new DaxClusterTagsUpdate(); + return this; + } + + public DaxCluster apply() { + this.innerObject = serviceManager.serviceClient() + .getDaxClusters() + .update(resourceGroupName, name, updateProperties, Context.NONE); + return this; + } + + public DaxCluster apply(Context context) { + this.innerObject = serviceManager.serviceClient() + .getDaxClusters() + .update(resourceGroupName, name, updateProperties, context); + return this; + } + + DaxClusterImpl(DaxClusterInner innerObject, + com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.name = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "daxClusters"); + } + + public DaxCluster refresh() { + this.innerObject = serviceManager.serviceClient() + .getDaxClusters() + .getByResourceGroupWithResponse(resourceGroupName, name, Context.NONE) + .getValue(); + return this; + } + + public DaxCluster refresh(Context context) { + this.innerObject = serviceManager.serviceClient() + .getDaxClusters() + .getByResourceGroupWithResponse(resourceGroupName, name, context) + .getValue(); + return this; + } + + public DaxClusterImpl withRegion(Region location) { + this.innerModel().withLocation(location.toString()); + return this; + } + + public DaxClusterImpl withRegion(String location) { + this.innerModel().withLocation(location); + return this; + } + + public DaxClusterImpl withTags(Map tags) { + if (isInCreateMode()) { + this.innerModel().withTags(tags); + return this; + } else { + this.updateProperties.withTags(tags); + return this; + } + } + + public DaxClusterImpl withProperties(DaxClusterProperties properties) { + this.innerModel().withProperties(properties); + return this; + } + + private boolean isInCreateMode() { + return this.innerModel().id() == null; + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/DaxClustersClientImpl.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/DaxClustersClientImpl.java new file mode 100644 index 000000000000..13981f3c56b0 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/DaxClustersClientImpl.java @@ -0,0 +1,1276 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.Patch; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.awsconnector.fluent.DaxClustersClient; +import com.azure.resourcemanager.awsconnector.fluent.models.DaxClusterInner; +import com.azure.resourcemanager.awsconnector.models.DaxClusterListResult; +import com.azure.resourcemanager.awsconnector.models.DaxClusterTagsUpdate; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in DaxClustersClient. + */ +public final class DaxClustersClientImpl implements DaxClustersClient { + /** + * The proxy service used to perform REST calls. + */ + private final DaxClustersService service; + + /** + * The service client containing this operation class. + */ + private final MicrosoftAwsConnectorImpl client; + + /** + * Initializes an instance of DaxClustersClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + DaxClustersClientImpl(MicrosoftAwsConnectorImpl client) { + this.service + = RestProxy.create(DaxClustersService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for MicrosoftAwsConnectorDaxClusters to be used by the proxy service to + * perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "MicrosoftAwsConnecto") + public interface DaxClustersService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.AwsConnector/daxClusters") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/daxClusters") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroup(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/daxClusters/{name}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getByResourceGroup(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("name") String name, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/daxClusters/{name}") + @ExpectedResponses({ 200, 201 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrReplace(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("name") String name, + @BodyParam("application/json") DaxClusterInner resource, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/daxClusters/{name}") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> update(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("name") String name, + @BodyParam("application/json") DaxClusterTagsUpdate properties, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/daxClusters/{name}") + @ExpectedResponses({ 202, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("name") String name, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listBySubscriptionNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroupNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); + } + + /** + * List DaxCluster resources by subscription ID. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a DaxCluster list operation along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync() { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), + res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List DaxCluster resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a DaxCluster list operation along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), accept, + context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * List DaxCluster resources by subscription ID. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a DaxCluster list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>(() -> listSinglePageAsync(), + nextLink -> listBySubscriptionNextSinglePageAsync(nextLink)); + } + + /** + * List DaxCluster resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a DaxCluster list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(Context context) { + return new PagedFlux<>(() -> listSinglePageAsync(context), + nextLink -> listBySubscriptionNextSinglePageAsync(nextLink, context)); + } + + /** + * List DaxCluster resources by subscription ID. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a DaxCluster list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + return new PagedIterable<>(listAsync()); + } + + /** + * List DaxCluster resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a DaxCluster list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Context context) { + return new PagedIterable<>(listAsync(context)); + } + + /** + * List DaxCluster resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a DaxCluster list operation along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), + res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List DaxCluster resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a DaxCluster list operation along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * List DaxCluster resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a DaxCluster list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName) { + return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); + } + + /** + * List DaxCluster resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a DaxCluster list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName, Context context) { + return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName, context), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink, context)); + } + + /** + * List DaxCluster resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a DaxCluster list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName)); + } + + /** + * List DaxCluster resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a DaxCluster list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, context)); + } + + /** + * Get a DaxCluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of DaxCluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a DaxCluster along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync(String resourceGroupName, String name) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.getByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get a DaxCluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of DaxCluster. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a DaxCluster along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync(String resourceGroupName, String name, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.getByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, accept, context); + } + + /** + * Get a DaxCluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of DaxCluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a DaxCluster on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getByResourceGroupAsync(String resourceGroupName, String name) { + return getByResourceGroupWithResponseAsync(resourceGroupName, name) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Get a DaxCluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of DaxCluster. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a DaxCluster along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getByResourceGroupWithResponse(String resourceGroupName, String name, + Context context) { + return getByResourceGroupWithResponseAsync(resourceGroupName, name, context).block(); + } + + /** + * Get a DaxCluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of DaxCluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a DaxCluster. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public DaxClusterInner getByResourceGroup(String resourceGroupName, String name) { + return getByResourceGroupWithResponse(resourceGroupName, name, Context.NONE).getValue(); + } + + /** + * Create a DaxCluster. Please note that end user resource creation is currently restricted, but it will be enabled + * in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of DaxCluster. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrReplaceWithResponseAsync(String resourceGroupName, String name, + DaxClusterInner resource) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (resource == null) { + return Mono.error(new IllegalArgumentException("Parameter resource is required and cannot be null.")); + } else { + resource.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.createOrReplace(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, resource, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Create a DaxCluster. Please note that end user resource creation is currently restricted, but it will be enabled + * in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of DaxCluster. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrReplaceWithResponseAsync(String resourceGroupName, String name, + DaxClusterInner resource, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (resource == null) { + return Mono.error(new IllegalArgumentException("Parameter resource is required and cannot be null.")); + } else { + resource.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.createOrReplace(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, resource, accept, context); + } + + /** + * Create a DaxCluster. Please note that end user resource creation is currently restricted, but it will be enabled + * in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of DaxCluster. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, DaxClusterInner> beginCreateOrReplaceAsync(String resourceGroupName, + String name, DaxClusterInner resource) { + Mono>> mono = createOrReplaceWithResponseAsync(resourceGroupName, name, resource); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + DaxClusterInner.class, DaxClusterInner.class, this.client.getContext()); + } + + /** + * Create a DaxCluster. Please note that end user resource creation is currently restricted, but it will be enabled + * in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of DaxCluster. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, DaxClusterInner> beginCreateOrReplaceAsync(String resourceGroupName, + String name, DaxClusterInner resource, Context context) { + context = this.client.mergeContext(context); + Mono>> mono + = createOrReplaceWithResponseAsync(resourceGroupName, name, resource, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + DaxClusterInner.class, DaxClusterInner.class, context); + } + + /** + * Create a DaxCluster. Please note that end user resource creation is currently restricted, but it will be enabled + * in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of DaxCluster. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, DaxClusterInner> beginCreateOrReplace(String resourceGroupName, + String name, DaxClusterInner resource) { + return this.beginCreateOrReplaceAsync(resourceGroupName, name, resource).getSyncPoller(); + } + + /** + * Create a DaxCluster. Please note that end user resource creation is currently restricted, but it will be enabled + * in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of DaxCluster. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, DaxClusterInner> beginCreateOrReplace(String resourceGroupName, + String name, DaxClusterInner resource, Context context) { + return this.beginCreateOrReplaceAsync(resourceGroupName, name, resource, context).getSyncPoller(); + } + + /** + * Create a DaxCluster. Please note that end user resource creation is currently restricted, but it will be enabled + * in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of DaxCluster. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrReplaceAsync(String resourceGroupName, String name, + DaxClusterInner resource) { + return beginCreateOrReplaceAsync(resourceGroupName, name, resource).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create a DaxCluster. Please note that end user resource creation is currently restricted, but it will be enabled + * in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of DaxCluster. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrReplaceAsync(String resourceGroupName, String name, DaxClusterInner resource, + Context context) { + return beginCreateOrReplaceAsync(resourceGroupName, name, resource, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create a DaxCluster. Please note that end user resource creation is currently restricted, but it will be enabled + * in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of DaxCluster. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public DaxClusterInner createOrReplace(String resourceGroupName, String name, DaxClusterInner resource) { + return createOrReplaceAsync(resourceGroupName, name, resource).block(); + } + + /** + * Create a DaxCluster. Please note that end user resource creation is currently restricted, but it will be enabled + * in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of DaxCluster. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public DaxClusterInner createOrReplace(String resourceGroupName, String name, DaxClusterInner resource, + Context context) { + return createOrReplaceAsync(resourceGroupName, name, resource, context).block(); + } + + /** + * Update a DaxCluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of DaxCluster. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync(String resourceGroupName, String name, + DaxClusterTagsUpdate properties) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (properties == null) { + return Mono.error(new IllegalArgumentException("Parameter properties is required and cannot be null.")); + } else { + properties.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.update(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, properties, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Update a DaxCluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of DaxCluster. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync(String resourceGroupName, String name, + DaxClusterTagsUpdate properties, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (properties == null) { + return Mono.error(new IllegalArgumentException("Parameter properties is required and cannot be null.")); + } else { + properties.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.update(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, name, properties, accept, context); + } + + /** + * Update a DaxCluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of DaxCluster. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, DaxClusterInner> beginUpdateAsync(String resourceGroupName, + String name, DaxClusterTagsUpdate properties) { + Mono>> mono = updateWithResponseAsync(resourceGroupName, name, properties); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + DaxClusterInner.class, DaxClusterInner.class, this.client.getContext()); + } + + /** + * Update a DaxCluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of DaxCluster. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, DaxClusterInner> beginUpdateAsync(String resourceGroupName, + String name, DaxClusterTagsUpdate properties, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = updateWithResponseAsync(resourceGroupName, name, properties, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + DaxClusterInner.class, DaxClusterInner.class, context); + } + + /** + * Update a DaxCluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of DaxCluster. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, DaxClusterInner> beginUpdate(String resourceGroupName, String name, + DaxClusterTagsUpdate properties) { + return this.beginUpdateAsync(resourceGroupName, name, properties).getSyncPoller(); + } + + /** + * Update a DaxCluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of DaxCluster. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, DaxClusterInner> beginUpdate(String resourceGroupName, String name, + DaxClusterTagsUpdate properties, Context context) { + return this.beginUpdateAsync(resourceGroupName, name, properties, context).getSyncPoller(); + } + + /** + * Update a DaxCluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of DaxCluster. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync(String resourceGroupName, String name, DaxClusterTagsUpdate properties) { + return beginUpdateAsync(resourceGroupName, name, properties).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Update a DaxCluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of DaxCluster. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync(String resourceGroupName, String name, DaxClusterTagsUpdate properties, + Context context) { + return beginUpdateAsync(resourceGroupName, name, properties, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Update a DaxCluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of DaxCluster. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public DaxClusterInner update(String resourceGroupName, String name, DaxClusterTagsUpdate properties) { + return updateAsync(resourceGroupName, name, properties).block(); + } + + /** + * Update a DaxCluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of DaxCluster. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public DaxClusterInner update(String resourceGroupName, String name, DaxClusterTagsUpdate properties, + Context context) { + return updateAsync(resourceGroupName, name, properties, context).block(); + } + + /** + * Delete a DaxCluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of DaxCluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync(String resourceGroupName, String name) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Delete a DaxCluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of DaxCluster. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync(String resourceGroupName, String name, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.delete(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, name, accept, context); + } + + /** + * Delete a DaxCluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of DaxCluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String name) { + Mono>> mono = deleteWithResponseAsync(resourceGroupName, name); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); + } + + /** + * Delete a DaxCluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of DaxCluster. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String name, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = deleteWithResponseAsync(resourceGroupName, name, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + context); + } + + /** + * Delete a DaxCluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of DaxCluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String name) { + return this.beginDeleteAsync(resourceGroupName, name).getSyncPoller(); + } + + /** + * Delete a DaxCluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of DaxCluster. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String name, Context context) { + return this.beginDeleteAsync(resourceGroupName, name, context).getSyncPoller(); + } + + /** + * Delete a DaxCluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of DaxCluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String name) { + return beginDeleteAsync(resourceGroupName, name).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete a DaxCluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of DaxCluster. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String name, Context context) { + return beginDeleteAsync(resourceGroupName, name, context).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete a DaxCluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of DaxCluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String name) { + deleteAsync(resourceGroupName, name).block(); + } + + /** + * Delete a DaxCluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of DaxCluster. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String name, Context context) { + deleteAsync(resourceGroupName, name, context).block(); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a DaxCluster list operation along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listBySubscriptionNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), + res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a DaxCluster list operation along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listBySubscriptionNextSinglePageAsync(String nextLink, + Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a DaxCluster list operation along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), + res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a DaxCluster list operation along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupNextSinglePageAsync(String nextLink, + Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/DaxClustersImpl.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/DaxClustersImpl.java new file mode 100644 index 000000000000..b87c96fd7571 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/DaxClustersImpl.java @@ -0,0 +1,145 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.awsconnector.fluent.DaxClustersClient; +import com.azure.resourcemanager.awsconnector.fluent.models.DaxClusterInner; +import com.azure.resourcemanager.awsconnector.models.DaxCluster; +import com.azure.resourcemanager.awsconnector.models.DaxClusters; + +public final class DaxClustersImpl implements DaxClusters { + private static final ClientLogger LOGGER = new ClientLogger(DaxClustersImpl.class); + + private final DaxClustersClient innerClient; + + private final com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager; + + public DaxClustersImpl(DaxClustersClient innerClient, + com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return ResourceManagerUtils.mapPage(inner, inner1 -> new DaxClusterImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new DaxClusterImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName); + return ResourceManagerUtils.mapPage(inner, inner1 -> new DaxClusterImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new DaxClusterImpl(inner1, this.manager())); + } + + public Response getByResourceGroupWithResponse(String resourceGroupName, String name, Context context) { + Response inner + = this.serviceClient().getByResourceGroupWithResponse(resourceGroupName, name, context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new DaxClusterImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public DaxCluster getByResourceGroup(String resourceGroupName, String name) { + DaxClusterInner inner = this.serviceClient().getByResourceGroup(resourceGroupName, name); + if (inner != null) { + return new DaxClusterImpl(inner, this.manager()); + } else { + return null; + } + } + + public void deleteByResourceGroup(String resourceGroupName, String name) { + this.serviceClient().delete(resourceGroupName, name); + } + + public void delete(String resourceGroupName, String name, Context context) { + this.serviceClient().delete(resourceGroupName, name, context); + } + + public DaxCluster getById(String id) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String name = ResourceManagerUtils.getValueFromIdByName(id, "daxClusters"); + if (name == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'daxClusters'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, name, Context.NONE).getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String name = ResourceManagerUtils.getValueFromIdByName(id, "daxClusters"); + if (name == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'daxClusters'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, name, context); + } + + public void deleteById(String id) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String name = ResourceManagerUtils.getValueFromIdByName(id, "daxClusters"); + if (name == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'daxClusters'.", id))); + } + this.delete(resourceGroupName, name, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String name = ResourceManagerUtils.getValueFromIdByName(id, "daxClusters"); + if (name == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'daxClusters'.", id))); + } + this.delete(resourceGroupName, name, context); + } + + private DaxClustersClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.awsconnector.AwsconnectorManager manager() { + return this.serviceManager; + } + + public DaxClusterImpl define(String name) { + return new DaxClusterImpl(name, this.manager()); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/DynamoDBContinuousBackupsDescriptionImpl.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/DynamoDBContinuousBackupsDescriptionImpl.java new file mode 100644 index 000000000000..eefb72e088e1 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/DynamoDBContinuousBackupsDescriptionImpl.java @@ -0,0 +1,181 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.implementation; + +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.awsconnector.fluent.models.DynamoDBContinuousBackupsDescriptionInner; +import com.azure.resourcemanager.awsconnector.models.DynamoDBContinuousBackupsDescription; +import com.azure.resourcemanager.awsconnector.models.DynamoDBContinuousBackupsDescriptionProperties; +import com.azure.resourcemanager.awsconnector.models.DynamoDBContinuousBackupsDescriptionTagsUpdate; +import java.util.Collections; +import java.util.Map; + +public final class DynamoDBContinuousBackupsDescriptionImpl implements DynamoDBContinuousBackupsDescription, + DynamoDBContinuousBackupsDescription.Definition, DynamoDBContinuousBackupsDescription.Update { + private DynamoDBContinuousBackupsDescriptionInner innerObject; + + private final com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public String location() { + return this.innerModel().location(); + } + + public Map tags() { + Map inner = this.innerModel().tags(); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } + } + + public DynamoDBContinuousBackupsDescriptionProperties properties() { + return this.innerModel().properties(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public String resourceGroupName() { + return resourceGroupName; + } + + public DynamoDBContinuousBackupsDescriptionInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.awsconnector.AwsconnectorManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String name; + + private DynamoDBContinuousBackupsDescriptionTagsUpdate updateProperties; + + public DynamoDBContinuousBackupsDescriptionImpl withExistingResourceGroup(String resourceGroupName) { + this.resourceGroupName = resourceGroupName; + return this; + } + + public DynamoDBContinuousBackupsDescription create() { + this.innerObject = serviceManager.serviceClient() + .getDynamoDbContinuousBackupsDescriptions() + .createOrReplace(resourceGroupName, name, this.innerModel(), Context.NONE); + return this; + } + + public DynamoDBContinuousBackupsDescription create(Context context) { + this.innerObject = serviceManager.serviceClient() + .getDynamoDbContinuousBackupsDescriptions() + .createOrReplace(resourceGroupName, name, this.innerModel(), context); + return this; + } + + DynamoDBContinuousBackupsDescriptionImpl(String name, + com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager) { + this.innerObject = new DynamoDBContinuousBackupsDescriptionInner(); + this.serviceManager = serviceManager; + this.name = name; + } + + public DynamoDBContinuousBackupsDescriptionImpl update() { + this.updateProperties = new DynamoDBContinuousBackupsDescriptionTagsUpdate(); + return this; + } + + public DynamoDBContinuousBackupsDescription apply() { + this.innerObject = serviceManager.serviceClient() + .getDynamoDbContinuousBackupsDescriptions() + .update(resourceGroupName, name, updateProperties, Context.NONE); + return this; + } + + public DynamoDBContinuousBackupsDescription apply(Context context) { + this.innerObject = serviceManager.serviceClient() + .getDynamoDbContinuousBackupsDescriptions() + .update(resourceGroupName, name, updateProperties, context); + return this; + } + + DynamoDBContinuousBackupsDescriptionImpl(DynamoDBContinuousBackupsDescriptionInner innerObject, + com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.name + = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "dynamoDBContinuousBackupsDescriptions"); + } + + public DynamoDBContinuousBackupsDescription refresh() { + this.innerObject = serviceManager.serviceClient() + .getDynamoDbContinuousBackupsDescriptions() + .getByResourceGroupWithResponse(resourceGroupName, name, Context.NONE) + .getValue(); + return this; + } + + public DynamoDBContinuousBackupsDescription refresh(Context context) { + this.innerObject = serviceManager.serviceClient() + .getDynamoDbContinuousBackupsDescriptions() + .getByResourceGroupWithResponse(resourceGroupName, name, context) + .getValue(); + return this; + } + + public DynamoDBContinuousBackupsDescriptionImpl withRegion(Region location) { + this.innerModel().withLocation(location.toString()); + return this; + } + + public DynamoDBContinuousBackupsDescriptionImpl withRegion(String location) { + this.innerModel().withLocation(location); + return this; + } + + public DynamoDBContinuousBackupsDescriptionImpl withTags(Map tags) { + if (isInCreateMode()) { + this.innerModel().withTags(tags); + return this; + } else { + this.updateProperties.withTags(tags); + return this; + } + } + + public DynamoDBContinuousBackupsDescriptionImpl + withProperties(DynamoDBContinuousBackupsDescriptionProperties properties) { + this.innerModel().withProperties(properties); + return this; + } + + private boolean isInCreateMode() { + return this.innerModel().id() == null; + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/DynamoDBTableImpl.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/DynamoDBTableImpl.java new file mode 100644 index 000000000000..4d6aa53fbb93 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/DynamoDBTableImpl.java @@ -0,0 +1,177 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.implementation; + +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.awsconnector.fluent.models.DynamoDBTableInner; +import com.azure.resourcemanager.awsconnector.models.DynamoDBTable; +import com.azure.resourcemanager.awsconnector.models.DynamoDBTableProperties; +import com.azure.resourcemanager.awsconnector.models.DynamoDBTableTagsUpdate; +import java.util.Collections; +import java.util.Map; + +public final class DynamoDBTableImpl implements DynamoDBTable, DynamoDBTable.Definition, DynamoDBTable.Update { + private DynamoDBTableInner innerObject; + + private final com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public String location() { + return this.innerModel().location(); + } + + public Map tags() { + Map inner = this.innerModel().tags(); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } + } + + public DynamoDBTableProperties properties() { + return this.innerModel().properties(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public String resourceGroupName() { + return resourceGroupName; + } + + public DynamoDBTableInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.awsconnector.AwsconnectorManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String name; + + private DynamoDBTableTagsUpdate updateProperties; + + public DynamoDBTableImpl withExistingResourceGroup(String resourceGroupName) { + this.resourceGroupName = resourceGroupName; + return this; + } + + public DynamoDBTable create() { + this.innerObject = serviceManager.serviceClient() + .getDynamoDbTables() + .createOrReplace(resourceGroupName, name, this.innerModel(), Context.NONE); + return this; + } + + public DynamoDBTable create(Context context) { + this.innerObject = serviceManager.serviceClient() + .getDynamoDbTables() + .createOrReplace(resourceGroupName, name, this.innerModel(), context); + return this; + } + + DynamoDBTableImpl(String name, com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager) { + this.innerObject = new DynamoDBTableInner(); + this.serviceManager = serviceManager; + this.name = name; + } + + public DynamoDBTableImpl update() { + this.updateProperties = new DynamoDBTableTagsUpdate(); + return this; + } + + public DynamoDBTable apply() { + this.innerObject = serviceManager.serviceClient() + .getDynamoDbTables() + .update(resourceGroupName, name, updateProperties, Context.NONE); + return this; + } + + public DynamoDBTable apply(Context context) { + this.innerObject = serviceManager.serviceClient() + .getDynamoDbTables() + .update(resourceGroupName, name, updateProperties, context); + return this; + } + + DynamoDBTableImpl(DynamoDBTableInner innerObject, + com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.name = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "dynamoDBTables"); + } + + public DynamoDBTable refresh() { + this.innerObject = serviceManager.serviceClient() + .getDynamoDbTables() + .getByResourceGroupWithResponse(resourceGroupName, name, Context.NONE) + .getValue(); + return this; + } + + public DynamoDBTable refresh(Context context) { + this.innerObject = serviceManager.serviceClient() + .getDynamoDbTables() + .getByResourceGroupWithResponse(resourceGroupName, name, context) + .getValue(); + return this; + } + + public DynamoDBTableImpl withRegion(Region location) { + this.innerModel().withLocation(location.toString()); + return this; + } + + public DynamoDBTableImpl withRegion(String location) { + this.innerModel().withLocation(location); + return this; + } + + public DynamoDBTableImpl withTags(Map tags) { + if (isInCreateMode()) { + this.innerModel().withTags(tags); + return this; + } else { + this.updateProperties.withTags(tags); + return this; + } + } + + public DynamoDBTableImpl withProperties(DynamoDBTableProperties properties) { + this.innerModel().withProperties(properties); + return this; + } + + private boolean isInCreateMode() { + return this.innerModel().id() == null; + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/DynamoDbContinuousBackupsDescriptionsClientImpl.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/DynamoDbContinuousBackupsDescriptionsClientImpl.java new file mode 100644 index 000000000000..9b8c03978b51 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/DynamoDbContinuousBackupsDescriptionsClientImpl.java @@ -0,0 +1,1319 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.Patch; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.awsconnector.fluent.DynamoDbContinuousBackupsDescriptionsClient; +import com.azure.resourcemanager.awsconnector.fluent.models.DynamoDBContinuousBackupsDescriptionInner; +import com.azure.resourcemanager.awsconnector.models.DynamoDBContinuousBackupsDescriptionListResult; +import com.azure.resourcemanager.awsconnector.models.DynamoDBContinuousBackupsDescriptionTagsUpdate; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in + * DynamoDbContinuousBackupsDescriptionsClient. + */ +public final class DynamoDbContinuousBackupsDescriptionsClientImpl + implements DynamoDbContinuousBackupsDescriptionsClient { + /** + * The proxy service used to perform REST calls. + */ + private final DynamoDbContinuousBackupsDescriptionsService service; + + /** + * The service client containing this operation class. + */ + private final MicrosoftAwsConnectorImpl client; + + /** + * Initializes an instance of DynamoDbContinuousBackupsDescriptionsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + DynamoDbContinuousBackupsDescriptionsClientImpl(MicrosoftAwsConnectorImpl client) { + this.service = RestProxy.create(DynamoDbContinuousBackupsDescriptionsService.class, client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for MicrosoftAwsConnectorDynamoDbContinuousBackupsDescriptions to be used + * by the proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "MicrosoftAwsConnecto") + public interface DynamoDbContinuousBackupsDescriptionsService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.AwsConnector/dynamoDBContinuousBackupsDescriptions") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/dynamoDBContinuousBackupsDescriptions") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroup( + @HostParam("$host") String endpoint, @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/dynamoDBContinuousBackupsDescriptions/{name}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getByResourceGroup( + @HostParam("$host") String endpoint, @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("name") String name, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/dynamoDBContinuousBackupsDescriptions/{name}") + @ExpectedResponses({ 200, 201 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrReplace(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("name") String name, + @BodyParam("application/json") DynamoDBContinuousBackupsDescriptionInner resource, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/dynamoDBContinuousBackupsDescriptions/{name}") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> update(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("name") String name, + @BodyParam("application/json") DynamoDBContinuousBackupsDescriptionTagsUpdate properties, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/dynamoDBContinuousBackupsDescriptions/{name}") + @ExpectedResponses({ 202, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("name") String name, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listBySubscriptionNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroupNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); + } + + /** + * List DynamoDBContinuousBackupsDescription resources by subscription ID. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a DynamoDBContinuousBackupsDescription list operation along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync() { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), accept, context)) + .>map( + res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List DynamoDBContinuousBackupsDescription resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a DynamoDBContinuousBackupsDescription list operation along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), accept, + context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * List DynamoDBContinuousBackupsDescription resources by subscription ID. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a DynamoDBContinuousBackupsDescription list operation as paginated response with + * {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>(() -> listSinglePageAsync(), + nextLink -> listBySubscriptionNextSinglePageAsync(nextLink)); + } + + /** + * List DynamoDBContinuousBackupsDescription resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a DynamoDBContinuousBackupsDescription list operation as paginated response with + * {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(Context context) { + return new PagedFlux<>(() -> listSinglePageAsync(context), + nextLink -> listBySubscriptionNextSinglePageAsync(nextLink, context)); + } + + /** + * List DynamoDBContinuousBackupsDescription resources by subscription ID. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a DynamoDBContinuousBackupsDescription list operation as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + return new PagedIterable<>(listAsync()); + } + + /** + * List DynamoDBContinuousBackupsDescription resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a DynamoDBContinuousBackupsDescription list operation as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Context context) { + return new PagedIterable<>(listAsync(context)); + } + + /** + * List DynamoDBContinuousBackupsDescription resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a DynamoDBContinuousBackupsDescription list operation along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> + listByResourceGroupSinglePageAsync(String resourceGroupName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accept, context)) + .>map( + res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List DynamoDBContinuousBackupsDescription resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a DynamoDBContinuousBackupsDescription list operation along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> + listByResourceGroupSinglePageAsync(String resourceGroupName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * List DynamoDBContinuousBackupsDescription resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a DynamoDBContinuousBackupsDescription list operation as paginated response with + * {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName) { + return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); + } + + /** + * List DynamoDBContinuousBackupsDescription resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a DynamoDBContinuousBackupsDescription list operation as paginated response with + * {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName, + Context context) { + return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName, context), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink, context)); + } + + /** + * List DynamoDBContinuousBackupsDescription resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a DynamoDBContinuousBackupsDescription list operation as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName)); + } + + /** + * List DynamoDBContinuousBackupsDescription resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a DynamoDBContinuousBackupsDescription list operation as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName, + Context context) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, context)); + } + + /** + * Get a DynamoDBContinuousBackupsDescription. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of DynamoDBContinuousBackupsDescription. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a DynamoDBContinuousBackupsDescription along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> + getByResourceGroupWithResponseAsync(String resourceGroupName, String name) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.getByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get a DynamoDBContinuousBackupsDescription. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of DynamoDBContinuousBackupsDescription. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a DynamoDBContinuousBackupsDescription along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> + getByResourceGroupWithResponseAsync(String resourceGroupName, String name, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.getByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, accept, context); + } + + /** + * Get a DynamoDBContinuousBackupsDescription. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of DynamoDBContinuousBackupsDescription. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a DynamoDBContinuousBackupsDescription on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getByResourceGroupAsync(String resourceGroupName, + String name) { + return getByResourceGroupWithResponseAsync(resourceGroupName, name) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Get a DynamoDBContinuousBackupsDescription. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of DynamoDBContinuousBackupsDescription. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a DynamoDBContinuousBackupsDescription along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getByResourceGroupWithResponse(String resourceGroupName, + String name, Context context) { + return getByResourceGroupWithResponseAsync(resourceGroupName, name, context).block(); + } + + /** + * Get a DynamoDBContinuousBackupsDescription. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of DynamoDBContinuousBackupsDescription. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a DynamoDBContinuousBackupsDescription. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public DynamoDBContinuousBackupsDescriptionInner getByResourceGroup(String resourceGroupName, String name) { + return getByResourceGroupWithResponse(resourceGroupName, name, Context.NONE).getValue(); + } + + /** + * Create a DynamoDBContinuousBackupsDescription. Please note that end user resource creation is currently + * restricted, but it will be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of DynamoDBContinuousBackupsDescription. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrReplaceWithResponseAsync(String resourceGroupName, String name, + DynamoDBContinuousBackupsDescriptionInner resource) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (resource == null) { + return Mono.error(new IllegalArgumentException("Parameter resource is required and cannot be null.")); + } else { + resource.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.createOrReplace(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, resource, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Create a DynamoDBContinuousBackupsDescription. Please note that end user resource creation is currently + * restricted, but it will be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of DynamoDBContinuousBackupsDescription. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrReplaceWithResponseAsync(String resourceGroupName, String name, + DynamoDBContinuousBackupsDescriptionInner resource, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (resource == null) { + return Mono.error(new IllegalArgumentException("Parameter resource is required and cannot be null.")); + } else { + resource.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.createOrReplace(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, resource, accept, context); + } + + /** + * Create a DynamoDBContinuousBackupsDescription. Please note that end user resource creation is currently + * restricted, but it will be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of DynamoDBContinuousBackupsDescription. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, DynamoDBContinuousBackupsDescriptionInner> + beginCreateOrReplaceAsync(String resourceGroupName, String name, + DynamoDBContinuousBackupsDescriptionInner resource) { + Mono>> mono = createOrReplaceWithResponseAsync(resourceGroupName, name, resource); + return this.client + .getLroResult(mono, + this.client.getHttpPipeline(), DynamoDBContinuousBackupsDescriptionInner.class, + DynamoDBContinuousBackupsDescriptionInner.class, this.client.getContext()); + } + + /** + * Create a DynamoDBContinuousBackupsDescription. Please note that end user resource creation is currently + * restricted, but it will be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of DynamoDBContinuousBackupsDescription. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, DynamoDBContinuousBackupsDescriptionInner> + beginCreateOrReplaceAsync(String resourceGroupName, String name, + DynamoDBContinuousBackupsDescriptionInner resource, Context context) { + context = this.client.mergeContext(context); + Mono>> mono + = createOrReplaceWithResponseAsync(resourceGroupName, name, resource, context); + return this.client + .getLroResult(mono, + this.client.getHttpPipeline(), DynamoDBContinuousBackupsDescriptionInner.class, + DynamoDBContinuousBackupsDescriptionInner.class, context); + } + + /** + * Create a DynamoDBContinuousBackupsDescription. Please note that end user resource creation is currently + * restricted, but it will be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of DynamoDBContinuousBackupsDescription. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, DynamoDBContinuousBackupsDescriptionInner> + beginCreateOrReplace(String resourceGroupName, String name, + DynamoDBContinuousBackupsDescriptionInner resource) { + return this.beginCreateOrReplaceAsync(resourceGroupName, name, resource).getSyncPoller(); + } + + /** + * Create a DynamoDBContinuousBackupsDescription. Please note that end user resource creation is currently + * restricted, but it will be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of DynamoDBContinuousBackupsDescription. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, DynamoDBContinuousBackupsDescriptionInner> + beginCreateOrReplace(String resourceGroupName, String name, DynamoDBContinuousBackupsDescriptionInner resource, + Context context) { + return this.beginCreateOrReplaceAsync(resourceGroupName, name, resource, context).getSyncPoller(); + } + + /** + * Create a DynamoDBContinuousBackupsDescription. Please note that end user resource creation is currently + * restricted, but it will be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of DynamoDBContinuousBackupsDescription. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrReplaceAsync(String resourceGroupName, String name, + DynamoDBContinuousBackupsDescriptionInner resource) { + return beginCreateOrReplaceAsync(resourceGroupName, name, resource).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create a DynamoDBContinuousBackupsDescription. Please note that end user resource creation is currently + * restricted, but it will be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of DynamoDBContinuousBackupsDescription. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrReplaceAsync(String resourceGroupName, String name, + DynamoDBContinuousBackupsDescriptionInner resource, Context context) { + return beginCreateOrReplaceAsync(resourceGroupName, name, resource, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create a DynamoDBContinuousBackupsDescription. Please note that end user resource creation is currently + * restricted, but it will be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of DynamoDBContinuousBackupsDescription. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public DynamoDBContinuousBackupsDescriptionInner createOrReplace(String resourceGroupName, String name, + DynamoDBContinuousBackupsDescriptionInner resource) { + return createOrReplaceAsync(resourceGroupName, name, resource).block(); + } + + /** + * Create a DynamoDBContinuousBackupsDescription. Please note that end user resource creation is currently + * restricted, but it will be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of DynamoDBContinuousBackupsDescription. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public DynamoDBContinuousBackupsDescriptionInner createOrReplace(String resourceGroupName, String name, + DynamoDBContinuousBackupsDescriptionInner resource, Context context) { + return createOrReplaceAsync(resourceGroupName, name, resource, context).block(); + } + + /** + * Update a DynamoDBContinuousBackupsDescription. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of DynamoDBContinuousBackupsDescription. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync(String resourceGroupName, String name, + DynamoDBContinuousBackupsDescriptionTagsUpdate properties) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (properties == null) { + return Mono.error(new IllegalArgumentException("Parameter properties is required and cannot be null.")); + } else { + properties.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.update(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, properties, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Update a DynamoDBContinuousBackupsDescription. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of DynamoDBContinuousBackupsDescription. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync(String resourceGroupName, String name, + DynamoDBContinuousBackupsDescriptionTagsUpdate properties, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (properties == null) { + return Mono.error(new IllegalArgumentException("Parameter properties is required and cannot be null.")); + } else { + properties.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.update(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, name, properties, accept, context); + } + + /** + * Update a DynamoDBContinuousBackupsDescription. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of DynamoDBContinuousBackupsDescription. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, DynamoDBContinuousBackupsDescriptionInner> + beginUpdateAsync(String resourceGroupName, String name, + DynamoDBContinuousBackupsDescriptionTagsUpdate properties) { + Mono>> mono = updateWithResponseAsync(resourceGroupName, name, properties); + return this.client + .getLroResult(mono, + this.client.getHttpPipeline(), DynamoDBContinuousBackupsDescriptionInner.class, + DynamoDBContinuousBackupsDescriptionInner.class, this.client.getContext()); + } + + /** + * Update a DynamoDBContinuousBackupsDescription. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of DynamoDBContinuousBackupsDescription. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, DynamoDBContinuousBackupsDescriptionInner> + beginUpdateAsync(String resourceGroupName, String name, + DynamoDBContinuousBackupsDescriptionTagsUpdate properties, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = updateWithResponseAsync(resourceGroupName, name, properties, context); + return this.client + .getLroResult(mono, + this.client.getHttpPipeline(), DynamoDBContinuousBackupsDescriptionInner.class, + DynamoDBContinuousBackupsDescriptionInner.class, context); + } + + /** + * Update a DynamoDBContinuousBackupsDescription. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of DynamoDBContinuousBackupsDescription. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, DynamoDBContinuousBackupsDescriptionInner> + beginUpdate(String resourceGroupName, String name, DynamoDBContinuousBackupsDescriptionTagsUpdate properties) { + return this.beginUpdateAsync(resourceGroupName, name, properties).getSyncPoller(); + } + + /** + * Update a DynamoDBContinuousBackupsDescription. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of DynamoDBContinuousBackupsDescription. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, DynamoDBContinuousBackupsDescriptionInner> + beginUpdate(String resourceGroupName, String name, DynamoDBContinuousBackupsDescriptionTagsUpdate properties, + Context context) { + return this.beginUpdateAsync(resourceGroupName, name, properties, context).getSyncPoller(); + } + + /** + * Update a DynamoDBContinuousBackupsDescription. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of DynamoDBContinuousBackupsDescription. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync(String resourceGroupName, String name, + DynamoDBContinuousBackupsDescriptionTagsUpdate properties) { + return beginUpdateAsync(resourceGroupName, name, properties).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Update a DynamoDBContinuousBackupsDescription. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of DynamoDBContinuousBackupsDescription. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync(String resourceGroupName, String name, + DynamoDBContinuousBackupsDescriptionTagsUpdate properties, Context context) { + return beginUpdateAsync(resourceGroupName, name, properties, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Update a DynamoDBContinuousBackupsDescription. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of DynamoDBContinuousBackupsDescription. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public DynamoDBContinuousBackupsDescriptionInner update(String resourceGroupName, String name, + DynamoDBContinuousBackupsDescriptionTagsUpdate properties) { + return updateAsync(resourceGroupName, name, properties).block(); + } + + /** + * Update a DynamoDBContinuousBackupsDescription. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of DynamoDBContinuousBackupsDescription. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public DynamoDBContinuousBackupsDescriptionInner update(String resourceGroupName, String name, + DynamoDBContinuousBackupsDescriptionTagsUpdate properties, Context context) { + return updateAsync(resourceGroupName, name, properties, context).block(); + } + + /** + * Delete a DynamoDBContinuousBackupsDescription. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of DynamoDBContinuousBackupsDescription. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync(String resourceGroupName, String name) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Delete a DynamoDBContinuousBackupsDescription. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of DynamoDBContinuousBackupsDescription. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync(String resourceGroupName, String name, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.delete(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, name, accept, context); + } + + /** + * Delete a DynamoDBContinuousBackupsDescription. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of DynamoDBContinuousBackupsDescription. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String name) { + Mono>> mono = deleteWithResponseAsync(resourceGroupName, name); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); + } + + /** + * Delete a DynamoDBContinuousBackupsDescription. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of DynamoDBContinuousBackupsDescription. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String name, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = deleteWithResponseAsync(resourceGroupName, name, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + context); + } + + /** + * Delete a DynamoDBContinuousBackupsDescription. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of DynamoDBContinuousBackupsDescription. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String name) { + return this.beginDeleteAsync(resourceGroupName, name).getSyncPoller(); + } + + /** + * Delete a DynamoDBContinuousBackupsDescription. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of DynamoDBContinuousBackupsDescription. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String name, Context context) { + return this.beginDeleteAsync(resourceGroupName, name, context).getSyncPoller(); + } + + /** + * Delete a DynamoDBContinuousBackupsDescription. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of DynamoDBContinuousBackupsDescription. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String name) { + return beginDeleteAsync(resourceGroupName, name).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete a DynamoDBContinuousBackupsDescription. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of DynamoDBContinuousBackupsDescription. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String name, Context context) { + return beginDeleteAsync(resourceGroupName, name, context).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete a DynamoDBContinuousBackupsDescription. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of DynamoDBContinuousBackupsDescription. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String name) { + deleteAsync(resourceGroupName, name).block(); + } + + /** + * Delete a DynamoDBContinuousBackupsDescription. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of DynamoDBContinuousBackupsDescription. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String name, Context context) { + deleteAsync(resourceGroupName, name, context).block(); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a DynamoDBContinuousBackupsDescription list operation along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> + listBySubscriptionNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a DynamoDBContinuousBackupsDescription list operation along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> + listBySubscriptionNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a DynamoDBContinuousBackupsDescription list operation along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> + listByResourceGroupNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a DynamoDBContinuousBackupsDescription list operation along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> + listByResourceGroupNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/DynamoDbContinuousBackupsDescriptionsImpl.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/DynamoDbContinuousBackupsDescriptionsImpl.java new file mode 100644 index 000000000000..e04dd740bd56 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/DynamoDbContinuousBackupsDescriptionsImpl.java @@ -0,0 +1,158 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.awsconnector.fluent.DynamoDbContinuousBackupsDescriptionsClient; +import com.azure.resourcemanager.awsconnector.fluent.models.DynamoDBContinuousBackupsDescriptionInner; +import com.azure.resourcemanager.awsconnector.models.DynamoDBContinuousBackupsDescription; +import com.azure.resourcemanager.awsconnector.models.DynamoDbContinuousBackupsDescriptions; + +public final class DynamoDbContinuousBackupsDescriptionsImpl implements DynamoDbContinuousBackupsDescriptions { + private static final ClientLogger LOGGER = new ClientLogger(DynamoDbContinuousBackupsDescriptionsImpl.class); + + private final DynamoDbContinuousBackupsDescriptionsClient innerClient; + + private final com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager; + + public DynamoDbContinuousBackupsDescriptionsImpl(DynamoDbContinuousBackupsDescriptionsClient innerClient, + com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return ResourceManagerUtils.mapPage(inner, + inner1 -> new DynamoDBContinuousBackupsDescriptionImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return ResourceManagerUtils.mapPage(inner, + inner1 -> new DynamoDBContinuousBackupsDescriptionImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName) { + PagedIterable inner + = this.serviceClient().listByResourceGroup(resourceGroupName); + return ResourceManagerUtils.mapPage(inner, + inner1 -> new DynamoDBContinuousBackupsDescriptionImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName, + Context context) { + PagedIterable inner + = this.serviceClient().listByResourceGroup(resourceGroupName, context); + return ResourceManagerUtils.mapPage(inner, + inner1 -> new DynamoDBContinuousBackupsDescriptionImpl(inner1, this.manager())); + } + + public Response getByResourceGroupWithResponse(String resourceGroupName, + String name, Context context) { + Response inner + = this.serviceClient().getByResourceGroupWithResponse(resourceGroupName, name, context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new DynamoDBContinuousBackupsDescriptionImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public DynamoDBContinuousBackupsDescription getByResourceGroup(String resourceGroupName, String name) { + DynamoDBContinuousBackupsDescriptionInner inner + = this.serviceClient().getByResourceGroup(resourceGroupName, name); + if (inner != null) { + return new DynamoDBContinuousBackupsDescriptionImpl(inner, this.manager()); + } else { + return null; + } + } + + public void deleteByResourceGroup(String resourceGroupName, String name) { + this.serviceClient().delete(resourceGroupName, name); + } + + public void delete(String resourceGroupName, String name, Context context) { + this.serviceClient().delete(resourceGroupName, name, context); + } + + public DynamoDBContinuousBackupsDescription getById(String id) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String name = ResourceManagerUtils.getValueFromIdByName(id, "dynamoDBContinuousBackupsDescriptions"); + if (name == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException(String.format( + "The resource ID '%s' is not valid. Missing path segment 'dynamoDBContinuousBackupsDescriptions'.", + id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, name, Context.NONE).getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String name = ResourceManagerUtils.getValueFromIdByName(id, "dynamoDBContinuousBackupsDescriptions"); + if (name == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException(String.format( + "The resource ID '%s' is not valid. Missing path segment 'dynamoDBContinuousBackupsDescriptions'.", + id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, name, context); + } + + public void deleteById(String id) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String name = ResourceManagerUtils.getValueFromIdByName(id, "dynamoDBContinuousBackupsDescriptions"); + if (name == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException(String.format( + "The resource ID '%s' is not valid. Missing path segment 'dynamoDBContinuousBackupsDescriptions'.", + id))); + } + this.delete(resourceGroupName, name, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String name = ResourceManagerUtils.getValueFromIdByName(id, "dynamoDBContinuousBackupsDescriptions"); + if (name == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException(String.format( + "The resource ID '%s' is not valid. Missing path segment 'dynamoDBContinuousBackupsDescriptions'.", + id))); + } + this.delete(resourceGroupName, name, context); + } + + private DynamoDbContinuousBackupsDescriptionsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.awsconnector.AwsconnectorManager manager() { + return this.serviceManager; + } + + public DynamoDBContinuousBackupsDescriptionImpl define(String name) { + return new DynamoDBContinuousBackupsDescriptionImpl(name, this.manager()); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/DynamoDbTablesClientImpl.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/DynamoDbTablesClientImpl.java new file mode 100644 index 000000000000..01506744e9d3 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/DynamoDbTablesClientImpl.java @@ -0,0 +1,1278 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.Patch; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.awsconnector.fluent.DynamoDbTablesClient; +import com.azure.resourcemanager.awsconnector.fluent.models.DynamoDBTableInner; +import com.azure.resourcemanager.awsconnector.models.DynamoDBTableListResult; +import com.azure.resourcemanager.awsconnector.models.DynamoDBTableTagsUpdate; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in DynamoDbTablesClient. + */ +public final class DynamoDbTablesClientImpl implements DynamoDbTablesClient { + /** + * The proxy service used to perform REST calls. + */ + private final DynamoDbTablesService service; + + /** + * The service client containing this operation class. + */ + private final MicrosoftAwsConnectorImpl client; + + /** + * Initializes an instance of DynamoDbTablesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + DynamoDbTablesClientImpl(MicrosoftAwsConnectorImpl client) { + this.service + = RestProxy.create(DynamoDbTablesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for MicrosoftAwsConnectorDynamoDbTables to be used by the proxy service + * to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "MicrosoftAwsConnecto") + public interface DynamoDbTablesService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.AwsConnector/dynamoDBTables") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/dynamoDBTables") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroup(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/dynamoDBTables/{name}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getByResourceGroup(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("name") String name, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/dynamoDBTables/{name}") + @ExpectedResponses({ 200, 201 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrReplace(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("name") String name, + @BodyParam("application/json") DynamoDBTableInner resource, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/dynamoDBTables/{name}") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> update(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("name") String name, + @BodyParam("application/json") DynamoDBTableTagsUpdate properties, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/dynamoDBTables/{name}") + @ExpectedResponses({ 202, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("name") String name, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listBySubscriptionNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroupNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); + } + + /** + * List DynamoDBTable resources by subscription ID. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a DynamoDBTable list operation along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync() { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List DynamoDBTable resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a DynamoDBTable list operation along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), accept, + context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * List DynamoDBTable resources by subscription ID. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a DynamoDBTable list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>(() -> listSinglePageAsync(), + nextLink -> listBySubscriptionNextSinglePageAsync(nextLink)); + } + + /** + * List DynamoDBTable resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a DynamoDBTable list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(Context context) { + return new PagedFlux<>(() -> listSinglePageAsync(context), + nextLink -> listBySubscriptionNextSinglePageAsync(nextLink, context)); + } + + /** + * List DynamoDBTable resources by subscription ID. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a DynamoDBTable list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + return new PagedIterable<>(listAsync()); + } + + /** + * List DynamoDBTable resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a DynamoDBTable list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Context context) { + return new PagedIterable<>(listAsync(context)); + } + + /** + * List DynamoDBTable resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a DynamoDBTable list operation along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List DynamoDBTable resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a DynamoDBTable list operation along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * List DynamoDBTable resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a DynamoDBTable list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName) { + return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); + } + + /** + * List DynamoDBTable resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a DynamoDBTable list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName, Context context) { + return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName, context), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink, context)); + } + + /** + * List DynamoDBTable resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a DynamoDBTable list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName)); + } + + /** + * List DynamoDBTable resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a DynamoDBTable list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, context)); + } + + /** + * Get a DynamoDBTable. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of DynamoDBTable. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a DynamoDBTable along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync(String resourceGroupName, + String name) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.getByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get a DynamoDBTable. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of DynamoDBTable. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a DynamoDBTable along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync(String resourceGroupName, + String name, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.getByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, accept, context); + } + + /** + * Get a DynamoDBTable. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of DynamoDBTable. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a DynamoDBTable on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getByResourceGroupAsync(String resourceGroupName, String name) { + return getByResourceGroupWithResponseAsync(resourceGroupName, name) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Get a DynamoDBTable. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of DynamoDBTable. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a DynamoDBTable along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getByResourceGroupWithResponse(String resourceGroupName, String name, + Context context) { + return getByResourceGroupWithResponseAsync(resourceGroupName, name, context).block(); + } + + /** + * Get a DynamoDBTable. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of DynamoDBTable. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a DynamoDBTable. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public DynamoDBTableInner getByResourceGroup(String resourceGroupName, String name) { + return getByResourceGroupWithResponse(resourceGroupName, name, Context.NONE).getValue(); + } + + /** + * Create a DynamoDBTable. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of DynamoDBTable. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrReplaceWithResponseAsync(String resourceGroupName, String name, + DynamoDBTableInner resource) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (resource == null) { + return Mono.error(new IllegalArgumentException("Parameter resource is required and cannot be null.")); + } else { + resource.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.createOrReplace(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, resource, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Create a DynamoDBTable. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of DynamoDBTable. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrReplaceWithResponseAsync(String resourceGroupName, String name, + DynamoDBTableInner resource, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (resource == null) { + return Mono.error(new IllegalArgumentException("Parameter resource is required and cannot be null.")); + } else { + resource.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.createOrReplace(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, resource, accept, context); + } + + /** + * Create a DynamoDBTable. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of DynamoDBTable. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, DynamoDBTableInner> + beginCreateOrReplaceAsync(String resourceGroupName, String name, DynamoDBTableInner resource) { + Mono>> mono = createOrReplaceWithResponseAsync(resourceGroupName, name, resource); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + DynamoDBTableInner.class, DynamoDBTableInner.class, this.client.getContext()); + } + + /** + * Create a DynamoDBTable. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of DynamoDBTable. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, DynamoDBTableInner> + beginCreateOrReplaceAsync(String resourceGroupName, String name, DynamoDBTableInner resource, Context context) { + context = this.client.mergeContext(context); + Mono>> mono + = createOrReplaceWithResponseAsync(resourceGroupName, name, resource, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + DynamoDBTableInner.class, DynamoDBTableInner.class, context); + } + + /** + * Create a DynamoDBTable. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of DynamoDBTable. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, DynamoDBTableInner> beginCreateOrReplace(String resourceGroupName, + String name, DynamoDBTableInner resource) { + return this.beginCreateOrReplaceAsync(resourceGroupName, name, resource).getSyncPoller(); + } + + /** + * Create a DynamoDBTable. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of DynamoDBTable. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, DynamoDBTableInner> beginCreateOrReplace(String resourceGroupName, + String name, DynamoDBTableInner resource, Context context) { + return this.beginCreateOrReplaceAsync(resourceGroupName, name, resource, context).getSyncPoller(); + } + + /** + * Create a DynamoDBTable. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of DynamoDBTable. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrReplaceAsync(String resourceGroupName, String name, + DynamoDBTableInner resource) { + return beginCreateOrReplaceAsync(resourceGroupName, name, resource).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create a DynamoDBTable. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of DynamoDBTable. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrReplaceAsync(String resourceGroupName, String name, + DynamoDBTableInner resource, Context context) { + return beginCreateOrReplaceAsync(resourceGroupName, name, resource, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create a DynamoDBTable. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of DynamoDBTable. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public DynamoDBTableInner createOrReplace(String resourceGroupName, String name, DynamoDBTableInner resource) { + return createOrReplaceAsync(resourceGroupName, name, resource).block(); + } + + /** + * Create a DynamoDBTable. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of DynamoDBTable. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public DynamoDBTableInner createOrReplace(String resourceGroupName, String name, DynamoDBTableInner resource, + Context context) { + return createOrReplaceAsync(resourceGroupName, name, resource, context).block(); + } + + /** + * Update a DynamoDBTable. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of DynamoDBTable. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync(String resourceGroupName, String name, + DynamoDBTableTagsUpdate properties) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (properties == null) { + return Mono.error(new IllegalArgumentException("Parameter properties is required and cannot be null.")); + } else { + properties.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.update(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, properties, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Update a DynamoDBTable. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of DynamoDBTable. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync(String resourceGroupName, String name, + DynamoDBTableTagsUpdate properties, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (properties == null) { + return Mono.error(new IllegalArgumentException("Parameter properties is required and cannot be null.")); + } else { + properties.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.update(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, name, properties, accept, context); + } + + /** + * Update a DynamoDBTable. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of DynamoDBTable. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, DynamoDBTableInner> beginUpdateAsync(String resourceGroupName, + String name, DynamoDBTableTagsUpdate properties) { + Mono>> mono = updateWithResponseAsync(resourceGroupName, name, properties); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + DynamoDBTableInner.class, DynamoDBTableInner.class, this.client.getContext()); + } + + /** + * Update a DynamoDBTable. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of DynamoDBTable. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, DynamoDBTableInner> beginUpdateAsync(String resourceGroupName, + String name, DynamoDBTableTagsUpdate properties, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = updateWithResponseAsync(resourceGroupName, name, properties, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + DynamoDBTableInner.class, DynamoDBTableInner.class, context); + } + + /** + * Update a DynamoDBTable. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of DynamoDBTable. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, DynamoDBTableInner> beginUpdate(String resourceGroupName, + String name, DynamoDBTableTagsUpdate properties) { + return this.beginUpdateAsync(resourceGroupName, name, properties).getSyncPoller(); + } + + /** + * Update a DynamoDBTable. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of DynamoDBTable. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, DynamoDBTableInner> beginUpdate(String resourceGroupName, + String name, DynamoDBTableTagsUpdate properties, Context context) { + return this.beginUpdateAsync(resourceGroupName, name, properties, context).getSyncPoller(); + } + + /** + * Update a DynamoDBTable. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of DynamoDBTable. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync(String resourceGroupName, String name, + DynamoDBTableTagsUpdate properties) { + return beginUpdateAsync(resourceGroupName, name, properties).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Update a DynamoDBTable. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of DynamoDBTable. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync(String resourceGroupName, String name, + DynamoDBTableTagsUpdate properties, Context context) { + return beginUpdateAsync(resourceGroupName, name, properties, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Update a DynamoDBTable. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of DynamoDBTable. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public DynamoDBTableInner update(String resourceGroupName, String name, DynamoDBTableTagsUpdate properties) { + return updateAsync(resourceGroupName, name, properties).block(); + } + + /** + * Update a DynamoDBTable. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of DynamoDBTable. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public DynamoDBTableInner update(String resourceGroupName, String name, DynamoDBTableTagsUpdate properties, + Context context) { + return updateAsync(resourceGroupName, name, properties, context).block(); + } + + /** + * Delete a DynamoDBTable. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of DynamoDBTable. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync(String resourceGroupName, String name) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Delete a DynamoDBTable. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of DynamoDBTable. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync(String resourceGroupName, String name, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.delete(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, name, accept, context); + } + + /** + * Delete a DynamoDBTable. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of DynamoDBTable. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String name) { + Mono>> mono = deleteWithResponseAsync(resourceGroupName, name); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); + } + + /** + * Delete a DynamoDBTable. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of DynamoDBTable. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String name, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = deleteWithResponseAsync(resourceGroupName, name, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + context); + } + + /** + * Delete a DynamoDBTable. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of DynamoDBTable. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String name) { + return this.beginDeleteAsync(resourceGroupName, name).getSyncPoller(); + } + + /** + * Delete a DynamoDBTable. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of DynamoDBTable. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String name, Context context) { + return this.beginDeleteAsync(resourceGroupName, name, context).getSyncPoller(); + } + + /** + * Delete a DynamoDBTable. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of DynamoDBTable. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String name) { + return beginDeleteAsync(resourceGroupName, name).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete a DynamoDBTable. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of DynamoDBTable. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String name, Context context) { + return beginDeleteAsync(resourceGroupName, name, context).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete a DynamoDBTable. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of DynamoDBTable. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String name) { + deleteAsync(resourceGroupName, name).block(); + } + + /** + * Delete a DynamoDBTable. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of DynamoDBTable. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String name, Context context) { + deleteAsync(resourceGroupName, name, context).block(); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a DynamoDBTable list operation along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listBySubscriptionNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a DynamoDBTable list operation along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listBySubscriptionNextSinglePageAsync(String nextLink, + Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a DynamoDBTable list operation along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a DynamoDBTable list operation along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupNextSinglePageAsync(String nextLink, + Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/DynamoDbTablesImpl.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/DynamoDbTablesImpl.java new file mode 100644 index 000000000000..60f4e68346e2 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/DynamoDbTablesImpl.java @@ -0,0 +1,146 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.awsconnector.fluent.DynamoDbTablesClient; +import com.azure.resourcemanager.awsconnector.fluent.models.DynamoDBTableInner; +import com.azure.resourcemanager.awsconnector.models.DynamoDBTable; +import com.azure.resourcemanager.awsconnector.models.DynamoDbTables; + +public final class DynamoDbTablesImpl implements DynamoDbTables { + private static final ClientLogger LOGGER = new ClientLogger(DynamoDbTablesImpl.class); + + private final DynamoDbTablesClient innerClient; + + private final com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager; + + public DynamoDbTablesImpl(DynamoDbTablesClient innerClient, + com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return ResourceManagerUtils.mapPage(inner, inner1 -> new DynamoDBTableImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new DynamoDBTableImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName); + return ResourceManagerUtils.mapPage(inner, inner1 -> new DynamoDBTableImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new DynamoDBTableImpl(inner1, this.manager())); + } + + public Response getByResourceGroupWithResponse(String resourceGroupName, String name, + Context context) { + Response inner + = this.serviceClient().getByResourceGroupWithResponse(resourceGroupName, name, context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new DynamoDBTableImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public DynamoDBTable getByResourceGroup(String resourceGroupName, String name) { + DynamoDBTableInner inner = this.serviceClient().getByResourceGroup(resourceGroupName, name); + if (inner != null) { + return new DynamoDBTableImpl(inner, this.manager()); + } else { + return null; + } + } + + public void deleteByResourceGroup(String resourceGroupName, String name) { + this.serviceClient().delete(resourceGroupName, name); + } + + public void delete(String resourceGroupName, String name, Context context) { + this.serviceClient().delete(resourceGroupName, name, context); + } + + public DynamoDBTable getById(String id) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String name = ResourceManagerUtils.getValueFromIdByName(id, "dynamoDBTables"); + if (name == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'dynamoDBTables'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, name, Context.NONE).getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String name = ResourceManagerUtils.getValueFromIdByName(id, "dynamoDBTables"); + if (name == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'dynamoDBTables'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, name, context); + } + + public void deleteById(String id) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String name = ResourceManagerUtils.getValueFromIdByName(id, "dynamoDBTables"); + if (name == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'dynamoDBTables'.", id))); + } + this.delete(resourceGroupName, name, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String name = ResourceManagerUtils.getValueFromIdByName(id, "dynamoDBTables"); + if (name == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'dynamoDBTables'.", id))); + } + this.delete(resourceGroupName, name, context); + } + + private DynamoDbTablesClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.awsconnector.AwsconnectorManager manager() { + return this.serviceManager; + } + + public DynamoDBTableImpl define(String name) { + return new DynamoDBTableImpl(name, this.manager()); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/Ec2AccountAttributeImpl.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/Ec2AccountAttributeImpl.java new file mode 100644 index 000000000000..56efb6a5a845 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/Ec2AccountAttributeImpl.java @@ -0,0 +1,178 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.implementation; + +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.awsconnector.fluent.models.Ec2AccountAttributeInner; +import com.azure.resourcemanager.awsconnector.models.Ec2AccountAttribute; +import com.azure.resourcemanager.awsconnector.models.Ec2AccountAttributeProperties; +import com.azure.resourcemanager.awsconnector.models.Ec2AccountAttributeTagsUpdate; +import java.util.Collections; +import java.util.Map; + +public final class Ec2AccountAttributeImpl + implements Ec2AccountAttribute, Ec2AccountAttribute.Definition, Ec2AccountAttribute.Update { + private Ec2AccountAttributeInner innerObject; + + private final com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public String location() { + return this.innerModel().location(); + } + + public Map tags() { + Map inner = this.innerModel().tags(); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } + } + + public Ec2AccountAttributeProperties properties() { + return this.innerModel().properties(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public String resourceGroupName() { + return resourceGroupName; + } + + public Ec2AccountAttributeInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.awsconnector.AwsconnectorManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String name; + + private Ec2AccountAttributeTagsUpdate updateProperties; + + public Ec2AccountAttributeImpl withExistingResourceGroup(String resourceGroupName) { + this.resourceGroupName = resourceGroupName; + return this; + } + + public Ec2AccountAttribute create() { + this.innerObject = serviceManager.serviceClient() + .getEc2AccountAttributes() + .createOrReplace(resourceGroupName, name, this.innerModel(), Context.NONE); + return this; + } + + public Ec2AccountAttribute create(Context context) { + this.innerObject = serviceManager.serviceClient() + .getEc2AccountAttributes() + .createOrReplace(resourceGroupName, name, this.innerModel(), context); + return this; + } + + Ec2AccountAttributeImpl(String name, com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager) { + this.innerObject = new Ec2AccountAttributeInner(); + this.serviceManager = serviceManager; + this.name = name; + } + + public Ec2AccountAttributeImpl update() { + this.updateProperties = new Ec2AccountAttributeTagsUpdate(); + return this; + } + + public Ec2AccountAttribute apply() { + this.innerObject = serviceManager.serviceClient() + .getEc2AccountAttributes() + .update(resourceGroupName, name, updateProperties, Context.NONE); + return this; + } + + public Ec2AccountAttribute apply(Context context) { + this.innerObject = serviceManager.serviceClient() + .getEc2AccountAttributes() + .update(resourceGroupName, name, updateProperties, context); + return this; + } + + Ec2AccountAttributeImpl(Ec2AccountAttributeInner innerObject, + com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.name = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "ec2AccountAttributes"); + } + + public Ec2AccountAttribute refresh() { + this.innerObject = serviceManager.serviceClient() + .getEc2AccountAttributes() + .getByResourceGroupWithResponse(resourceGroupName, name, Context.NONE) + .getValue(); + return this; + } + + public Ec2AccountAttribute refresh(Context context) { + this.innerObject = serviceManager.serviceClient() + .getEc2AccountAttributes() + .getByResourceGroupWithResponse(resourceGroupName, name, context) + .getValue(); + return this; + } + + public Ec2AccountAttributeImpl withRegion(Region location) { + this.innerModel().withLocation(location.toString()); + return this; + } + + public Ec2AccountAttributeImpl withRegion(String location) { + this.innerModel().withLocation(location); + return this; + } + + public Ec2AccountAttributeImpl withTags(Map tags) { + if (isInCreateMode()) { + this.innerModel().withTags(tags); + return this; + } else { + this.updateProperties.withTags(tags); + return this; + } + } + + public Ec2AccountAttributeImpl withProperties(Ec2AccountAttributeProperties properties) { + this.innerModel().withProperties(properties); + return this; + } + + private boolean isInCreateMode() { + return this.innerModel().id() == null; + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/Ec2AccountAttributesClientImpl.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/Ec2AccountAttributesClientImpl.java new file mode 100644 index 000000000000..9d76ced5461b --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/Ec2AccountAttributesClientImpl.java @@ -0,0 +1,1282 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.Patch; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.awsconnector.fluent.Ec2AccountAttributesClient; +import com.azure.resourcemanager.awsconnector.fluent.models.Ec2AccountAttributeInner; +import com.azure.resourcemanager.awsconnector.models.Ec2AccountAttributeListResult; +import com.azure.resourcemanager.awsconnector.models.Ec2AccountAttributeTagsUpdate; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in Ec2AccountAttributesClient. + */ +public final class Ec2AccountAttributesClientImpl implements Ec2AccountAttributesClient { + /** + * The proxy service used to perform REST calls. + */ + private final Ec2AccountAttributesService service; + + /** + * The service client containing this operation class. + */ + private final MicrosoftAwsConnectorImpl client; + + /** + * Initializes an instance of Ec2AccountAttributesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + Ec2AccountAttributesClientImpl(MicrosoftAwsConnectorImpl client) { + this.service = RestProxy.create(Ec2AccountAttributesService.class, client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for MicrosoftAwsConnectorEc2AccountAttributes to be used by the proxy + * service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "MicrosoftAwsConnecto") + public interface Ec2AccountAttributesService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.AwsConnector/ec2AccountAttributes") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/ec2AccountAttributes") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroup(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/ec2AccountAttributes/{name}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getByResourceGroup(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("name") String name, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/ec2AccountAttributes/{name}") + @ExpectedResponses({ 200, 201 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrReplace(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("name") String name, + @BodyParam("application/json") Ec2AccountAttributeInner resource, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/ec2AccountAttributes/{name}") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> update(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("name") String name, + @BodyParam("application/json") Ec2AccountAttributeTagsUpdate properties, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/ec2AccountAttributes/{name}") + @ExpectedResponses({ 202, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("name") String name, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listBySubscriptionNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroupNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); + } + + /** + * List Ec2AccountAttribute resources by subscription ID. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Ec2AccountAttribute list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync() { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List Ec2AccountAttribute resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Ec2AccountAttribute list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), accept, + context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * List Ec2AccountAttribute resources by subscription ID. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Ec2AccountAttribute list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>(() -> listSinglePageAsync(), + nextLink -> listBySubscriptionNextSinglePageAsync(nextLink)); + } + + /** + * List Ec2AccountAttribute resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Ec2AccountAttribute list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(Context context) { + return new PagedFlux<>(() -> listSinglePageAsync(context), + nextLink -> listBySubscriptionNextSinglePageAsync(nextLink, context)); + } + + /** + * List Ec2AccountAttribute resources by subscription ID. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Ec2AccountAttribute list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + return new PagedIterable<>(listAsync()); + } + + /** + * List Ec2AccountAttribute resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Ec2AccountAttribute list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Context context) { + return new PagedIterable<>(listAsync(context)); + } + + /** + * List Ec2AccountAttribute resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Ec2AccountAttribute list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List Ec2AccountAttribute resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Ec2AccountAttribute list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * List Ec2AccountAttribute resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Ec2AccountAttribute list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName) { + return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); + } + + /** + * List Ec2AccountAttribute resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Ec2AccountAttribute list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName, Context context) { + return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName, context), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink, context)); + } + + /** + * List Ec2AccountAttribute resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Ec2AccountAttribute list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName)); + } + + /** + * List Ec2AccountAttribute resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Ec2AccountAttribute list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, context)); + } + + /** + * Get a Ec2AccountAttribute. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2AccountAttribute. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Ec2AccountAttribute along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync(String resourceGroupName, + String name) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.getByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get a Ec2AccountAttribute. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2AccountAttribute. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Ec2AccountAttribute along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync(String resourceGroupName, + String name, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.getByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, accept, context); + } + + /** + * Get a Ec2AccountAttribute. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2AccountAttribute. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Ec2AccountAttribute on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getByResourceGroupAsync(String resourceGroupName, String name) { + return getByResourceGroupWithResponseAsync(resourceGroupName, name) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Get a Ec2AccountAttribute. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2AccountAttribute. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Ec2AccountAttribute along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getByResourceGroupWithResponse(String resourceGroupName, String name, + Context context) { + return getByResourceGroupWithResponseAsync(resourceGroupName, name, context).block(); + } + + /** + * Get a Ec2AccountAttribute. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2AccountAttribute. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Ec2AccountAttribute. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Ec2AccountAttributeInner getByResourceGroup(String resourceGroupName, String name) { + return getByResourceGroupWithResponse(resourceGroupName, name, Context.NONE).getValue(); + } + + /** + * Create a Ec2AccountAttribute. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2AccountAttribute. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrReplaceWithResponseAsync(String resourceGroupName, String name, + Ec2AccountAttributeInner resource) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (resource == null) { + return Mono.error(new IllegalArgumentException("Parameter resource is required and cannot be null.")); + } else { + resource.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.createOrReplace(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, resource, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Create a Ec2AccountAttribute. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2AccountAttribute. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrReplaceWithResponseAsync(String resourceGroupName, String name, + Ec2AccountAttributeInner resource, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (resource == null) { + return Mono.error(new IllegalArgumentException("Parameter resource is required and cannot be null.")); + } else { + resource.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.createOrReplace(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, resource, accept, context); + } + + /** + * Create a Ec2AccountAttribute. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2AccountAttribute. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Ec2AccountAttributeInner> + beginCreateOrReplaceAsync(String resourceGroupName, String name, Ec2AccountAttributeInner resource) { + Mono>> mono = createOrReplaceWithResponseAsync(resourceGroupName, name, resource); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), Ec2AccountAttributeInner.class, Ec2AccountAttributeInner.class, + this.client.getContext()); + } + + /** + * Create a Ec2AccountAttribute. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2AccountAttribute. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Ec2AccountAttributeInner> beginCreateOrReplaceAsync( + String resourceGroupName, String name, Ec2AccountAttributeInner resource, Context context) { + context = this.client.mergeContext(context); + Mono>> mono + = createOrReplaceWithResponseAsync(resourceGroupName, name, resource, context); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), Ec2AccountAttributeInner.class, Ec2AccountAttributeInner.class, context); + } + + /** + * Create a Ec2AccountAttribute. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2AccountAttribute. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Ec2AccountAttributeInner> + beginCreateOrReplace(String resourceGroupName, String name, Ec2AccountAttributeInner resource) { + return this.beginCreateOrReplaceAsync(resourceGroupName, name, resource).getSyncPoller(); + } + + /** + * Create a Ec2AccountAttribute. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2AccountAttribute. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Ec2AccountAttributeInner> beginCreateOrReplace( + String resourceGroupName, String name, Ec2AccountAttributeInner resource, Context context) { + return this.beginCreateOrReplaceAsync(resourceGroupName, name, resource, context).getSyncPoller(); + } + + /** + * Create a Ec2AccountAttribute. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2AccountAttribute. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrReplaceAsync(String resourceGroupName, String name, + Ec2AccountAttributeInner resource) { + return beginCreateOrReplaceAsync(resourceGroupName, name, resource).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create a Ec2AccountAttribute. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2AccountAttribute. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrReplaceAsync(String resourceGroupName, String name, + Ec2AccountAttributeInner resource, Context context) { + return beginCreateOrReplaceAsync(resourceGroupName, name, resource, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create a Ec2AccountAttribute. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2AccountAttribute. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Ec2AccountAttributeInner createOrReplace(String resourceGroupName, String name, + Ec2AccountAttributeInner resource) { + return createOrReplaceAsync(resourceGroupName, name, resource).block(); + } + + /** + * Create a Ec2AccountAttribute. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2AccountAttribute. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Ec2AccountAttributeInner createOrReplace(String resourceGroupName, String name, + Ec2AccountAttributeInner resource, Context context) { + return createOrReplaceAsync(resourceGroupName, name, resource, context).block(); + } + + /** + * Update a Ec2AccountAttribute. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2AccountAttribute. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync(String resourceGroupName, String name, + Ec2AccountAttributeTagsUpdate properties) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (properties == null) { + return Mono.error(new IllegalArgumentException("Parameter properties is required and cannot be null.")); + } else { + properties.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.update(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, properties, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Update a Ec2AccountAttribute. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2AccountAttribute. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync(String resourceGroupName, String name, + Ec2AccountAttributeTagsUpdate properties, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (properties == null) { + return Mono.error(new IllegalArgumentException("Parameter properties is required and cannot be null.")); + } else { + properties.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.update(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, name, properties, accept, context); + } + + /** + * Update a Ec2AccountAttribute. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2AccountAttribute. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Ec2AccountAttributeInner> + beginUpdateAsync(String resourceGroupName, String name, Ec2AccountAttributeTagsUpdate properties) { + Mono>> mono = updateWithResponseAsync(resourceGroupName, name, properties); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), Ec2AccountAttributeInner.class, Ec2AccountAttributeInner.class, + this.client.getContext()); + } + + /** + * Update a Ec2AccountAttribute. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2AccountAttribute. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Ec2AccountAttributeInner> beginUpdateAsync( + String resourceGroupName, String name, Ec2AccountAttributeTagsUpdate properties, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = updateWithResponseAsync(resourceGroupName, name, properties, context); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), Ec2AccountAttributeInner.class, Ec2AccountAttributeInner.class, context); + } + + /** + * Update a Ec2AccountAttribute. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2AccountAttribute. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Ec2AccountAttributeInner> + beginUpdate(String resourceGroupName, String name, Ec2AccountAttributeTagsUpdate properties) { + return this.beginUpdateAsync(resourceGroupName, name, properties).getSyncPoller(); + } + + /** + * Update a Ec2AccountAttribute. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2AccountAttribute. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Ec2AccountAttributeInner> + beginUpdate(String resourceGroupName, String name, Ec2AccountAttributeTagsUpdate properties, Context context) { + return this.beginUpdateAsync(resourceGroupName, name, properties, context).getSyncPoller(); + } + + /** + * Update a Ec2AccountAttribute. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2AccountAttribute. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync(String resourceGroupName, String name, + Ec2AccountAttributeTagsUpdate properties) { + return beginUpdateAsync(resourceGroupName, name, properties).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Update a Ec2AccountAttribute. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2AccountAttribute. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync(String resourceGroupName, String name, + Ec2AccountAttributeTagsUpdate properties, Context context) { + return beginUpdateAsync(resourceGroupName, name, properties, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Update a Ec2AccountAttribute. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2AccountAttribute. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Ec2AccountAttributeInner update(String resourceGroupName, String name, + Ec2AccountAttributeTagsUpdate properties) { + return updateAsync(resourceGroupName, name, properties).block(); + } + + /** + * Update a Ec2AccountAttribute. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2AccountAttribute. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Ec2AccountAttributeInner update(String resourceGroupName, String name, + Ec2AccountAttributeTagsUpdate properties, Context context) { + return updateAsync(resourceGroupName, name, properties, context).block(); + } + + /** + * Delete a Ec2AccountAttribute. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2AccountAttribute. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync(String resourceGroupName, String name) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Delete a Ec2AccountAttribute. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2AccountAttribute. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync(String resourceGroupName, String name, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.delete(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, name, accept, context); + } + + /** + * Delete a Ec2AccountAttribute. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2AccountAttribute. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String name) { + Mono>> mono = deleteWithResponseAsync(resourceGroupName, name); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); + } + + /** + * Delete a Ec2AccountAttribute. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2AccountAttribute. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String name, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = deleteWithResponseAsync(resourceGroupName, name, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + context); + } + + /** + * Delete a Ec2AccountAttribute. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2AccountAttribute. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String name) { + return this.beginDeleteAsync(resourceGroupName, name).getSyncPoller(); + } + + /** + * Delete a Ec2AccountAttribute. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2AccountAttribute. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String name, Context context) { + return this.beginDeleteAsync(resourceGroupName, name, context).getSyncPoller(); + } + + /** + * Delete a Ec2AccountAttribute. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2AccountAttribute. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String name) { + return beginDeleteAsync(resourceGroupName, name).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete a Ec2AccountAttribute. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2AccountAttribute. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String name, Context context) { + return beginDeleteAsync(resourceGroupName, name, context).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete a Ec2AccountAttribute. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2AccountAttribute. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String name) { + deleteAsync(resourceGroupName, name).block(); + } + + /** + * Delete a Ec2AccountAttribute. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2AccountAttribute. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String name, Context context) { + deleteAsync(resourceGroupName, name, context).block(); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Ec2AccountAttribute list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listBySubscriptionNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Ec2AccountAttribute list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listBySubscriptionNextSinglePageAsync(String nextLink, + Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Ec2AccountAttribute list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Ec2AccountAttribute list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupNextSinglePageAsync(String nextLink, + Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/Ec2AccountAttributesImpl.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/Ec2AccountAttributesImpl.java new file mode 100644 index 000000000000..343102cc630c --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/Ec2AccountAttributesImpl.java @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.awsconnector.fluent.Ec2AccountAttributesClient; +import com.azure.resourcemanager.awsconnector.fluent.models.Ec2AccountAttributeInner; +import com.azure.resourcemanager.awsconnector.models.Ec2AccountAttribute; +import com.azure.resourcemanager.awsconnector.models.Ec2AccountAttributes; + +public final class Ec2AccountAttributesImpl implements Ec2AccountAttributes { + private static final ClientLogger LOGGER = new ClientLogger(Ec2AccountAttributesImpl.class); + + private final Ec2AccountAttributesClient innerClient; + + private final com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager; + + public Ec2AccountAttributesImpl(Ec2AccountAttributesClient innerClient, + com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return ResourceManagerUtils.mapPage(inner, inner1 -> new Ec2AccountAttributeImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new Ec2AccountAttributeImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName); + return ResourceManagerUtils.mapPage(inner, inner1 -> new Ec2AccountAttributeImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + PagedIterable inner + = this.serviceClient().listByResourceGroup(resourceGroupName, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new Ec2AccountAttributeImpl(inner1, this.manager())); + } + + public Response getByResourceGroupWithResponse(String resourceGroupName, String name, + Context context) { + Response inner + = this.serviceClient().getByResourceGroupWithResponse(resourceGroupName, name, context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new Ec2AccountAttributeImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public Ec2AccountAttribute getByResourceGroup(String resourceGroupName, String name) { + Ec2AccountAttributeInner inner = this.serviceClient().getByResourceGroup(resourceGroupName, name); + if (inner != null) { + return new Ec2AccountAttributeImpl(inner, this.manager()); + } else { + return null; + } + } + + public void deleteByResourceGroup(String resourceGroupName, String name) { + this.serviceClient().delete(resourceGroupName, name); + } + + public void delete(String resourceGroupName, String name, Context context) { + this.serviceClient().delete(resourceGroupName, name, context); + } + + public Ec2AccountAttribute getById(String id) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String name = ResourceManagerUtils.getValueFromIdByName(id, "ec2AccountAttributes"); + if (name == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'ec2AccountAttributes'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, name, Context.NONE).getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String name = ResourceManagerUtils.getValueFromIdByName(id, "ec2AccountAttributes"); + if (name == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'ec2AccountAttributes'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, name, context); + } + + public void deleteById(String id) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String name = ResourceManagerUtils.getValueFromIdByName(id, "ec2AccountAttributes"); + if (name == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'ec2AccountAttributes'.", id))); + } + this.delete(resourceGroupName, name, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String name = ResourceManagerUtils.getValueFromIdByName(id, "ec2AccountAttributes"); + if (name == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'ec2AccountAttributes'.", id))); + } + this.delete(resourceGroupName, name, context); + } + + private Ec2AccountAttributesClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.awsconnector.AwsconnectorManager manager() { + return this.serviceManager; + } + + public Ec2AccountAttributeImpl define(String name) { + return new Ec2AccountAttributeImpl(name, this.manager()); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/Ec2AddressImpl.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/Ec2AddressImpl.java new file mode 100644 index 000000000000..b4af5708cef6 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/Ec2AddressImpl.java @@ -0,0 +1,177 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.implementation; + +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.awsconnector.fluent.models.Ec2AddressInner; +import com.azure.resourcemanager.awsconnector.models.Ec2Address; +import com.azure.resourcemanager.awsconnector.models.Ec2AddressProperties; +import com.azure.resourcemanager.awsconnector.models.Ec2AddressTagsUpdate; +import java.util.Collections; +import java.util.Map; + +public final class Ec2AddressImpl implements Ec2Address, Ec2Address.Definition, Ec2Address.Update { + private Ec2AddressInner innerObject; + + private final com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public String location() { + return this.innerModel().location(); + } + + public Map tags() { + Map inner = this.innerModel().tags(); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } + } + + public Ec2AddressProperties properties() { + return this.innerModel().properties(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public String resourceGroupName() { + return resourceGroupName; + } + + public Ec2AddressInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.awsconnector.AwsconnectorManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String name; + + private Ec2AddressTagsUpdate updateProperties; + + public Ec2AddressImpl withExistingResourceGroup(String resourceGroupName) { + this.resourceGroupName = resourceGroupName; + return this; + } + + public Ec2Address create() { + this.innerObject = serviceManager.serviceClient() + .getEc2Addresses() + .createOrReplace(resourceGroupName, name, this.innerModel(), Context.NONE); + return this; + } + + public Ec2Address create(Context context) { + this.innerObject = serviceManager.serviceClient() + .getEc2Addresses() + .createOrReplace(resourceGroupName, name, this.innerModel(), context); + return this; + } + + Ec2AddressImpl(String name, com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager) { + this.innerObject = new Ec2AddressInner(); + this.serviceManager = serviceManager; + this.name = name; + } + + public Ec2AddressImpl update() { + this.updateProperties = new Ec2AddressTagsUpdate(); + return this; + } + + public Ec2Address apply() { + this.innerObject = serviceManager.serviceClient() + .getEc2Addresses() + .update(resourceGroupName, name, updateProperties, Context.NONE); + return this; + } + + public Ec2Address apply(Context context) { + this.innerObject = serviceManager.serviceClient() + .getEc2Addresses() + .update(resourceGroupName, name, updateProperties, context); + return this; + } + + Ec2AddressImpl(Ec2AddressInner innerObject, + com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.name = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "ec2Addresses"); + } + + public Ec2Address refresh() { + this.innerObject = serviceManager.serviceClient() + .getEc2Addresses() + .getByResourceGroupWithResponse(resourceGroupName, name, Context.NONE) + .getValue(); + return this; + } + + public Ec2Address refresh(Context context) { + this.innerObject = serviceManager.serviceClient() + .getEc2Addresses() + .getByResourceGroupWithResponse(resourceGroupName, name, context) + .getValue(); + return this; + } + + public Ec2AddressImpl withRegion(Region location) { + this.innerModel().withLocation(location.toString()); + return this; + } + + public Ec2AddressImpl withRegion(String location) { + this.innerModel().withLocation(location); + return this; + } + + public Ec2AddressImpl withTags(Map tags) { + if (isInCreateMode()) { + this.innerModel().withTags(tags); + return this; + } else { + this.updateProperties.withTags(tags); + return this; + } + } + + public Ec2AddressImpl withProperties(Ec2AddressProperties properties) { + this.innerModel().withProperties(properties); + return this; + } + + private boolean isInCreateMode() { + return this.innerModel().id() == null; + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/Ec2AddressesClientImpl.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/Ec2AddressesClientImpl.java new file mode 100644 index 000000000000..e2c425a68973 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/Ec2AddressesClientImpl.java @@ -0,0 +1,1276 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.Patch; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.awsconnector.fluent.Ec2AddressesClient; +import com.azure.resourcemanager.awsconnector.fluent.models.Ec2AddressInner; +import com.azure.resourcemanager.awsconnector.models.Ec2AddressListResult; +import com.azure.resourcemanager.awsconnector.models.Ec2AddressTagsUpdate; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in Ec2AddressesClient. + */ +public final class Ec2AddressesClientImpl implements Ec2AddressesClient { + /** + * The proxy service used to perform REST calls. + */ + private final Ec2AddressesService service; + + /** + * The service client containing this operation class. + */ + private final MicrosoftAwsConnectorImpl client; + + /** + * Initializes an instance of Ec2AddressesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + Ec2AddressesClientImpl(MicrosoftAwsConnectorImpl client) { + this.service + = RestProxy.create(Ec2AddressesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for MicrosoftAwsConnectorEc2Addresses to be used by the proxy service to + * perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "MicrosoftAwsConnecto") + public interface Ec2AddressesService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.AwsConnector/ec2Addresses") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/ec2Addresses") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroup(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/ec2Addresses/{name}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getByResourceGroup(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("name") String name, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/ec2Addresses/{name}") + @ExpectedResponses({ 200, 201 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrReplace(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("name") String name, + @BodyParam("application/json") Ec2AddressInner resource, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/ec2Addresses/{name}") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> update(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("name") String name, + @BodyParam("application/json") Ec2AddressTagsUpdate properties, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/ec2Addresses/{name}") + @ExpectedResponses({ 202, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("name") String name, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listBySubscriptionNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroupNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); + } + + /** + * List Ec2Address resources by subscription ID. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Ec2Address list operation along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync() { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), + res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List Ec2Address resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Ec2Address list operation along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), accept, + context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * List Ec2Address resources by subscription ID. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Ec2Address list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>(() -> listSinglePageAsync(), + nextLink -> listBySubscriptionNextSinglePageAsync(nextLink)); + } + + /** + * List Ec2Address resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Ec2Address list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(Context context) { + return new PagedFlux<>(() -> listSinglePageAsync(context), + nextLink -> listBySubscriptionNextSinglePageAsync(nextLink, context)); + } + + /** + * List Ec2Address resources by subscription ID. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Ec2Address list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + return new PagedIterable<>(listAsync()); + } + + /** + * List Ec2Address resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Ec2Address list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Context context) { + return new PagedIterable<>(listAsync(context)); + } + + /** + * List Ec2Address resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Ec2Address list operation along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), + res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List Ec2Address resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Ec2Address list operation along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * List Ec2Address resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Ec2Address list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName) { + return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); + } + + /** + * List Ec2Address resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Ec2Address list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName, Context context) { + return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName, context), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink, context)); + } + + /** + * List Ec2Address resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Ec2Address list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName)); + } + + /** + * List Ec2Address resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Ec2Address list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, context)); + } + + /** + * Get a Ec2Address. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2Address. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Ec2Address along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync(String resourceGroupName, String name) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.getByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get a Ec2Address. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2Address. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Ec2Address along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync(String resourceGroupName, String name, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.getByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, accept, context); + } + + /** + * Get a Ec2Address. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2Address. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Ec2Address on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getByResourceGroupAsync(String resourceGroupName, String name) { + return getByResourceGroupWithResponseAsync(resourceGroupName, name) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Get a Ec2Address. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2Address. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Ec2Address along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getByResourceGroupWithResponse(String resourceGroupName, String name, + Context context) { + return getByResourceGroupWithResponseAsync(resourceGroupName, name, context).block(); + } + + /** + * Get a Ec2Address. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2Address. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Ec2Address. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Ec2AddressInner getByResourceGroup(String resourceGroupName, String name) { + return getByResourceGroupWithResponse(resourceGroupName, name, Context.NONE).getValue(); + } + + /** + * Create a Ec2Address. Please note that end user resource creation is currently restricted, but it will be enabled + * in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2Address. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrReplaceWithResponseAsync(String resourceGroupName, String name, + Ec2AddressInner resource) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (resource == null) { + return Mono.error(new IllegalArgumentException("Parameter resource is required and cannot be null.")); + } else { + resource.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.createOrReplace(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, resource, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Create a Ec2Address. Please note that end user resource creation is currently restricted, but it will be enabled + * in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2Address. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrReplaceWithResponseAsync(String resourceGroupName, String name, + Ec2AddressInner resource, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (resource == null) { + return Mono.error(new IllegalArgumentException("Parameter resource is required and cannot be null.")); + } else { + resource.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.createOrReplace(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, resource, accept, context); + } + + /** + * Create a Ec2Address. Please note that end user resource creation is currently restricted, but it will be enabled + * in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2Address. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Ec2AddressInner> beginCreateOrReplaceAsync(String resourceGroupName, + String name, Ec2AddressInner resource) { + Mono>> mono = createOrReplaceWithResponseAsync(resourceGroupName, name, resource); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + Ec2AddressInner.class, Ec2AddressInner.class, this.client.getContext()); + } + + /** + * Create a Ec2Address. Please note that end user resource creation is currently restricted, but it will be enabled + * in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2Address. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Ec2AddressInner> beginCreateOrReplaceAsync(String resourceGroupName, + String name, Ec2AddressInner resource, Context context) { + context = this.client.mergeContext(context); + Mono>> mono + = createOrReplaceWithResponseAsync(resourceGroupName, name, resource, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + Ec2AddressInner.class, Ec2AddressInner.class, context); + } + + /** + * Create a Ec2Address. Please note that end user resource creation is currently restricted, but it will be enabled + * in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2Address. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Ec2AddressInner> beginCreateOrReplace(String resourceGroupName, + String name, Ec2AddressInner resource) { + return this.beginCreateOrReplaceAsync(resourceGroupName, name, resource).getSyncPoller(); + } + + /** + * Create a Ec2Address. Please note that end user resource creation is currently restricted, but it will be enabled + * in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2Address. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Ec2AddressInner> beginCreateOrReplace(String resourceGroupName, + String name, Ec2AddressInner resource, Context context) { + return this.beginCreateOrReplaceAsync(resourceGroupName, name, resource, context).getSyncPoller(); + } + + /** + * Create a Ec2Address. Please note that end user resource creation is currently restricted, but it will be enabled + * in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2Address. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrReplaceAsync(String resourceGroupName, String name, + Ec2AddressInner resource) { + return beginCreateOrReplaceAsync(resourceGroupName, name, resource).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create a Ec2Address. Please note that end user resource creation is currently restricted, but it will be enabled + * in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2Address. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrReplaceAsync(String resourceGroupName, String name, Ec2AddressInner resource, + Context context) { + return beginCreateOrReplaceAsync(resourceGroupName, name, resource, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create a Ec2Address. Please note that end user resource creation is currently restricted, but it will be enabled + * in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2Address. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Ec2AddressInner createOrReplace(String resourceGroupName, String name, Ec2AddressInner resource) { + return createOrReplaceAsync(resourceGroupName, name, resource).block(); + } + + /** + * Create a Ec2Address. Please note that end user resource creation is currently restricted, but it will be enabled + * in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2Address. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Ec2AddressInner createOrReplace(String resourceGroupName, String name, Ec2AddressInner resource, + Context context) { + return createOrReplaceAsync(resourceGroupName, name, resource, context).block(); + } + + /** + * Update a Ec2Address. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2Address. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync(String resourceGroupName, String name, + Ec2AddressTagsUpdate properties) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (properties == null) { + return Mono.error(new IllegalArgumentException("Parameter properties is required and cannot be null.")); + } else { + properties.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.update(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, properties, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Update a Ec2Address. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2Address. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync(String resourceGroupName, String name, + Ec2AddressTagsUpdate properties, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (properties == null) { + return Mono.error(new IllegalArgumentException("Parameter properties is required and cannot be null.")); + } else { + properties.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.update(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, name, properties, accept, context); + } + + /** + * Update a Ec2Address. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2Address. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Ec2AddressInner> beginUpdateAsync(String resourceGroupName, + String name, Ec2AddressTagsUpdate properties) { + Mono>> mono = updateWithResponseAsync(resourceGroupName, name, properties); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + Ec2AddressInner.class, Ec2AddressInner.class, this.client.getContext()); + } + + /** + * Update a Ec2Address. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2Address. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Ec2AddressInner> beginUpdateAsync(String resourceGroupName, + String name, Ec2AddressTagsUpdate properties, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = updateWithResponseAsync(resourceGroupName, name, properties, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + Ec2AddressInner.class, Ec2AddressInner.class, context); + } + + /** + * Update a Ec2Address. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2Address. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Ec2AddressInner> beginUpdate(String resourceGroupName, String name, + Ec2AddressTagsUpdate properties) { + return this.beginUpdateAsync(resourceGroupName, name, properties).getSyncPoller(); + } + + /** + * Update a Ec2Address. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2Address. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Ec2AddressInner> beginUpdate(String resourceGroupName, String name, + Ec2AddressTagsUpdate properties, Context context) { + return this.beginUpdateAsync(resourceGroupName, name, properties, context).getSyncPoller(); + } + + /** + * Update a Ec2Address. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2Address. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync(String resourceGroupName, String name, Ec2AddressTagsUpdate properties) { + return beginUpdateAsync(resourceGroupName, name, properties).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Update a Ec2Address. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2Address. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync(String resourceGroupName, String name, Ec2AddressTagsUpdate properties, + Context context) { + return beginUpdateAsync(resourceGroupName, name, properties, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Update a Ec2Address. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2Address. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Ec2AddressInner update(String resourceGroupName, String name, Ec2AddressTagsUpdate properties) { + return updateAsync(resourceGroupName, name, properties).block(); + } + + /** + * Update a Ec2Address. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2Address. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Ec2AddressInner update(String resourceGroupName, String name, Ec2AddressTagsUpdate properties, + Context context) { + return updateAsync(resourceGroupName, name, properties, context).block(); + } + + /** + * Delete a Ec2Address. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2Address. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync(String resourceGroupName, String name) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Delete a Ec2Address. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2Address. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync(String resourceGroupName, String name, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.delete(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, name, accept, context); + } + + /** + * Delete a Ec2Address. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2Address. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String name) { + Mono>> mono = deleteWithResponseAsync(resourceGroupName, name); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); + } + + /** + * Delete a Ec2Address. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2Address. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String name, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = deleteWithResponseAsync(resourceGroupName, name, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + context); + } + + /** + * Delete a Ec2Address. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2Address. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String name) { + return this.beginDeleteAsync(resourceGroupName, name).getSyncPoller(); + } + + /** + * Delete a Ec2Address. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2Address. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String name, Context context) { + return this.beginDeleteAsync(resourceGroupName, name, context).getSyncPoller(); + } + + /** + * Delete a Ec2Address. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2Address. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String name) { + return beginDeleteAsync(resourceGroupName, name).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete a Ec2Address. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2Address. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String name, Context context) { + return beginDeleteAsync(resourceGroupName, name, context).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete a Ec2Address. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2Address. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String name) { + deleteAsync(resourceGroupName, name).block(); + } + + /** + * Delete a Ec2Address. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2Address. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String name, Context context) { + deleteAsync(resourceGroupName, name, context).block(); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Ec2Address list operation along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listBySubscriptionNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), + res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Ec2Address list operation along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listBySubscriptionNextSinglePageAsync(String nextLink, + Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Ec2Address list operation along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), + res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Ec2Address list operation along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupNextSinglePageAsync(String nextLink, + Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/Ec2AddressesImpl.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/Ec2AddressesImpl.java new file mode 100644 index 000000000000..af7641ee7fb6 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/Ec2AddressesImpl.java @@ -0,0 +1,145 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.awsconnector.fluent.Ec2AddressesClient; +import com.azure.resourcemanager.awsconnector.fluent.models.Ec2AddressInner; +import com.azure.resourcemanager.awsconnector.models.Ec2Address; +import com.azure.resourcemanager.awsconnector.models.Ec2Addresses; + +public final class Ec2AddressesImpl implements Ec2Addresses { + private static final ClientLogger LOGGER = new ClientLogger(Ec2AddressesImpl.class); + + private final Ec2AddressesClient innerClient; + + private final com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager; + + public Ec2AddressesImpl(Ec2AddressesClient innerClient, + com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return ResourceManagerUtils.mapPage(inner, inner1 -> new Ec2AddressImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new Ec2AddressImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName); + return ResourceManagerUtils.mapPage(inner, inner1 -> new Ec2AddressImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new Ec2AddressImpl(inner1, this.manager())); + } + + public Response getByResourceGroupWithResponse(String resourceGroupName, String name, Context context) { + Response inner + = this.serviceClient().getByResourceGroupWithResponse(resourceGroupName, name, context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new Ec2AddressImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public Ec2Address getByResourceGroup(String resourceGroupName, String name) { + Ec2AddressInner inner = this.serviceClient().getByResourceGroup(resourceGroupName, name); + if (inner != null) { + return new Ec2AddressImpl(inner, this.manager()); + } else { + return null; + } + } + + public void deleteByResourceGroup(String resourceGroupName, String name) { + this.serviceClient().delete(resourceGroupName, name); + } + + public void delete(String resourceGroupName, String name, Context context) { + this.serviceClient().delete(resourceGroupName, name, context); + } + + public Ec2Address getById(String id) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String name = ResourceManagerUtils.getValueFromIdByName(id, "ec2Addresses"); + if (name == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'ec2Addresses'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, name, Context.NONE).getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String name = ResourceManagerUtils.getValueFromIdByName(id, "ec2Addresses"); + if (name == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'ec2Addresses'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, name, context); + } + + public void deleteById(String id) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String name = ResourceManagerUtils.getValueFromIdByName(id, "ec2Addresses"); + if (name == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'ec2Addresses'.", id))); + } + this.delete(resourceGroupName, name, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String name = ResourceManagerUtils.getValueFromIdByName(id, "ec2Addresses"); + if (name == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'ec2Addresses'.", id))); + } + this.delete(resourceGroupName, name, context); + } + + private Ec2AddressesClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.awsconnector.AwsconnectorManager manager() { + return this.serviceManager; + } + + public Ec2AddressImpl define(String name) { + return new Ec2AddressImpl(name, this.manager()); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/Ec2FlowLogImpl.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/Ec2FlowLogImpl.java new file mode 100644 index 000000000000..ce79790acc63 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/Ec2FlowLogImpl.java @@ -0,0 +1,177 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.implementation; + +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.awsconnector.fluent.models.Ec2FlowLogInner; +import com.azure.resourcemanager.awsconnector.models.Ec2FlowLog; +import com.azure.resourcemanager.awsconnector.models.Ec2FlowLogProperties; +import com.azure.resourcemanager.awsconnector.models.Ec2FlowLogTagsUpdate; +import java.util.Collections; +import java.util.Map; + +public final class Ec2FlowLogImpl implements Ec2FlowLog, Ec2FlowLog.Definition, Ec2FlowLog.Update { + private Ec2FlowLogInner innerObject; + + private final com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public String location() { + return this.innerModel().location(); + } + + public Map tags() { + Map inner = this.innerModel().tags(); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } + } + + public Ec2FlowLogProperties properties() { + return this.innerModel().properties(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public String resourceGroupName() { + return resourceGroupName; + } + + public Ec2FlowLogInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.awsconnector.AwsconnectorManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String name; + + private Ec2FlowLogTagsUpdate updateProperties; + + public Ec2FlowLogImpl withExistingResourceGroup(String resourceGroupName) { + this.resourceGroupName = resourceGroupName; + return this; + } + + public Ec2FlowLog create() { + this.innerObject = serviceManager.serviceClient() + .getEc2FlowLogs() + .createOrReplace(resourceGroupName, name, this.innerModel(), Context.NONE); + return this; + } + + public Ec2FlowLog create(Context context) { + this.innerObject = serviceManager.serviceClient() + .getEc2FlowLogs() + .createOrReplace(resourceGroupName, name, this.innerModel(), context); + return this; + } + + Ec2FlowLogImpl(String name, com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager) { + this.innerObject = new Ec2FlowLogInner(); + this.serviceManager = serviceManager; + this.name = name; + } + + public Ec2FlowLogImpl update() { + this.updateProperties = new Ec2FlowLogTagsUpdate(); + return this; + } + + public Ec2FlowLog apply() { + this.innerObject = serviceManager.serviceClient() + .getEc2FlowLogs() + .update(resourceGroupName, name, updateProperties, Context.NONE); + return this; + } + + public Ec2FlowLog apply(Context context) { + this.innerObject = serviceManager.serviceClient() + .getEc2FlowLogs() + .update(resourceGroupName, name, updateProperties, context); + return this; + } + + Ec2FlowLogImpl(Ec2FlowLogInner innerObject, + com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.name = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "ec2FlowLogs"); + } + + public Ec2FlowLog refresh() { + this.innerObject = serviceManager.serviceClient() + .getEc2FlowLogs() + .getByResourceGroupWithResponse(resourceGroupName, name, Context.NONE) + .getValue(); + return this; + } + + public Ec2FlowLog refresh(Context context) { + this.innerObject = serviceManager.serviceClient() + .getEc2FlowLogs() + .getByResourceGroupWithResponse(resourceGroupName, name, context) + .getValue(); + return this; + } + + public Ec2FlowLogImpl withRegion(Region location) { + this.innerModel().withLocation(location.toString()); + return this; + } + + public Ec2FlowLogImpl withRegion(String location) { + this.innerModel().withLocation(location); + return this; + } + + public Ec2FlowLogImpl withTags(Map tags) { + if (isInCreateMode()) { + this.innerModel().withTags(tags); + return this; + } else { + this.updateProperties.withTags(tags); + return this; + } + } + + public Ec2FlowLogImpl withProperties(Ec2FlowLogProperties properties) { + this.innerModel().withProperties(properties); + return this; + } + + private boolean isInCreateMode() { + return this.innerModel().id() == null; + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/Ec2FlowLogsClientImpl.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/Ec2FlowLogsClientImpl.java new file mode 100644 index 000000000000..ab4d4837ac4e --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/Ec2FlowLogsClientImpl.java @@ -0,0 +1,1276 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.Patch; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.awsconnector.fluent.Ec2FlowLogsClient; +import com.azure.resourcemanager.awsconnector.fluent.models.Ec2FlowLogInner; +import com.azure.resourcemanager.awsconnector.models.Ec2FlowLogListResult; +import com.azure.resourcemanager.awsconnector.models.Ec2FlowLogTagsUpdate; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in Ec2FlowLogsClient. + */ +public final class Ec2FlowLogsClientImpl implements Ec2FlowLogsClient { + /** + * The proxy service used to perform REST calls. + */ + private final Ec2FlowLogsService service; + + /** + * The service client containing this operation class. + */ + private final MicrosoftAwsConnectorImpl client; + + /** + * Initializes an instance of Ec2FlowLogsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + Ec2FlowLogsClientImpl(MicrosoftAwsConnectorImpl client) { + this.service + = RestProxy.create(Ec2FlowLogsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for MicrosoftAwsConnectorEc2FlowLogs to be used by the proxy service to + * perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "MicrosoftAwsConnecto") + public interface Ec2FlowLogsService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.AwsConnector/ec2FlowLogs") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/ec2FlowLogs") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroup(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/ec2FlowLogs/{name}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getByResourceGroup(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("name") String name, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/ec2FlowLogs/{name}") + @ExpectedResponses({ 200, 201 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrReplace(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("name") String name, + @BodyParam("application/json") Ec2FlowLogInner resource, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/ec2FlowLogs/{name}") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> update(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("name") String name, + @BodyParam("application/json") Ec2FlowLogTagsUpdate properties, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/ec2FlowLogs/{name}") + @ExpectedResponses({ 202, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("name") String name, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listBySubscriptionNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroupNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); + } + + /** + * List Ec2FlowLog resources by subscription ID. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Ec2FlowLog list operation along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync() { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), + res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List Ec2FlowLog resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Ec2FlowLog list operation along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), accept, + context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * List Ec2FlowLog resources by subscription ID. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Ec2FlowLog list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>(() -> listSinglePageAsync(), + nextLink -> listBySubscriptionNextSinglePageAsync(nextLink)); + } + + /** + * List Ec2FlowLog resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Ec2FlowLog list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(Context context) { + return new PagedFlux<>(() -> listSinglePageAsync(context), + nextLink -> listBySubscriptionNextSinglePageAsync(nextLink, context)); + } + + /** + * List Ec2FlowLog resources by subscription ID. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Ec2FlowLog list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + return new PagedIterable<>(listAsync()); + } + + /** + * List Ec2FlowLog resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Ec2FlowLog list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Context context) { + return new PagedIterable<>(listAsync(context)); + } + + /** + * List Ec2FlowLog resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Ec2FlowLog list operation along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), + res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List Ec2FlowLog resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Ec2FlowLog list operation along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * List Ec2FlowLog resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Ec2FlowLog list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName) { + return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); + } + + /** + * List Ec2FlowLog resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Ec2FlowLog list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName, Context context) { + return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName, context), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink, context)); + } + + /** + * List Ec2FlowLog resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Ec2FlowLog list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName)); + } + + /** + * List Ec2FlowLog resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Ec2FlowLog list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, context)); + } + + /** + * Get a Ec2FlowLog. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2FlowLog. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Ec2FlowLog along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync(String resourceGroupName, String name) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.getByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get a Ec2FlowLog. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2FlowLog. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Ec2FlowLog along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync(String resourceGroupName, String name, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.getByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, accept, context); + } + + /** + * Get a Ec2FlowLog. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2FlowLog. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Ec2FlowLog on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getByResourceGroupAsync(String resourceGroupName, String name) { + return getByResourceGroupWithResponseAsync(resourceGroupName, name) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Get a Ec2FlowLog. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2FlowLog. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Ec2FlowLog along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getByResourceGroupWithResponse(String resourceGroupName, String name, + Context context) { + return getByResourceGroupWithResponseAsync(resourceGroupName, name, context).block(); + } + + /** + * Get a Ec2FlowLog. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2FlowLog. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Ec2FlowLog. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Ec2FlowLogInner getByResourceGroup(String resourceGroupName, String name) { + return getByResourceGroupWithResponse(resourceGroupName, name, Context.NONE).getValue(); + } + + /** + * Create a Ec2FlowLog. Please note that end user resource creation is currently restricted, but it will be enabled + * in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2FlowLog. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrReplaceWithResponseAsync(String resourceGroupName, String name, + Ec2FlowLogInner resource) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (resource == null) { + return Mono.error(new IllegalArgumentException("Parameter resource is required and cannot be null.")); + } else { + resource.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.createOrReplace(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, resource, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Create a Ec2FlowLog. Please note that end user resource creation is currently restricted, but it will be enabled + * in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2FlowLog. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrReplaceWithResponseAsync(String resourceGroupName, String name, + Ec2FlowLogInner resource, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (resource == null) { + return Mono.error(new IllegalArgumentException("Parameter resource is required and cannot be null.")); + } else { + resource.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.createOrReplace(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, resource, accept, context); + } + + /** + * Create a Ec2FlowLog. Please note that end user resource creation is currently restricted, but it will be enabled + * in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2FlowLog. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Ec2FlowLogInner> beginCreateOrReplaceAsync(String resourceGroupName, + String name, Ec2FlowLogInner resource) { + Mono>> mono = createOrReplaceWithResponseAsync(resourceGroupName, name, resource); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + Ec2FlowLogInner.class, Ec2FlowLogInner.class, this.client.getContext()); + } + + /** + * Create a Ec2FlowLog. Please note that end user resource creation is currently restricted, but it will be enabled + * in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2FlowLog. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Ec2FlowLogInner> beginCreateOrReplaceAsync(String resourceGroupName, + String name, Ec2FlowLogInner resource, Context context) { + context = this.client.mergeContext(context); + Mono>> mono + = createOrReplaceWithResponseAsync(resourceGroupName, name, resource, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + Ec2FlowLogInner.class, Ec2FlowLogInner.class, context); + } + + /** + * Create a Ec2FlowLog. Please note that end user resource creation is currently restricted, but it will be enabled + * in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2FlowLog. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Ec2FlowLogInner> beginCreateOrReplace(String resourceGroupName, + String name, Ec2FlowLogInner resource) { + return this.beginCreateOrReplaceAsync(resourceGroupName, name, resource).getSyncPoller(); + } + + /** + * Create a Ec2FlowLog. Please note that end user resource creation is currently restricted, but it will be enabled + * in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2FlowLog. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Ec2FlowLogInner> beginCreateOrReplace(String resourceGroupName, + String name, Ec2FlowLogInner resource, Context context) { + return this.beginCreateOrReplaceAsync(resourceGroupName, name, resource, context).getSyncPoller(); + } + + /** + * Create a Ec2FlowLog. Please note that end user resource creation is currently restricted, but it will be enabled + * in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2FlowLog. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrReplaceAsync(String resourceGroupName, String name, + Ec2FlowLogInner resource) { + return beginCreateOrReplaceAsync(resourceGroupName, name, resource).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create a Ec2FlowLog. Please note that end user resource creation is currently restricted, but it will be enabled + * in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2FlowLog. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrReplaceAsync(String resourceGroupName, String name, Ec2FlowLogInner resource, + Context context) { + return beginCreateOrReplaceAsync(resourceGroupName, name, resource, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create a Ec2FlowLog. Please note that end user resource creation is currently restricted, but it will be enabled + * in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2FlowLog. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Ec2FlowLogInner createOrReplace(String resourceGroupName, String name, Ec2FlowLogInner resource) { + return createOrReplaceAsync(resourceGroupName, name, resource).block(); + } + + /** + * Create a Ec2FlowLog. Please note that end user resource creation is currently restricted, but it will be enabled + * in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2FlowLog. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Ec2FlowLogInner createOrReplace(String resourceGroupName, String name, Ec2FlowLogInner resource, + Context context) { + return createOrReplaceAsync(resourceGroupName, name, resource, context).block(); + } + + /** + * Update a Ec2FlowLog. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2FlowLog. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync(String resourceGroupName, String name, + Ec2FlowLogTagsUpdate properties) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (properties == null) { + return Mono.error(new IllegalArgumentException("Parameter properties is required and cannot be null.")); + } else { + properties.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.update(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, properties, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Update a Ec2FlowLog. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2FlowLog. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync(String resourceGroupName, String name, + Ec2FlowLogTagsUpdate properties, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (properties == null) { + return Mono.error(new IllegalArgumentException("Parameter properties is required and cannot be null.")); + } else { + properties.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.update(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, name, properties, accept, context); + } + + /** + * Update a Ec2FlowLog. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2FlowLog. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Ec2FlowLogInner> beginUpdateAsync(String resourceGroupName, + String name, Ec2FlowLogTagsUpdate properties) { + Mono>> mono = updateWithResponseAsync(resourceGroupName, name, properties); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + Ec2FlowLogInner.class, Ec2FlowLogInner.class, this.client.getContext()); + } + + /** + * Update a Ec2FlowLog. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2FlowLog. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Ec2FlowLogInner> beginUpdateAsync(String resourceGroupName, + String name, Ec2FlowLogTagsUpdate properties, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = updateWithResponseAsync(resourceGroupName, name, properties, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + Ec2FlowLogInner.class, Ec2FlowLogInner.class, context); + } + + /** + * Update a Ec2FlowLog. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2FlowLog. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Ec2FlowLogInner> beginUpdate(String resourceGroupName, String name, + Ec2FlowLogTagsUpdate properties) { + return this.beginUpdateAsync(resourceGroupName, name, properties).getSyncPoller(); + } + + /** + * Update a Ec2FlowLog. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2FlowLog. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Ec2FlowLogInner> beginUpdate(String resourceGroupName, String name, + Ec2FlowLogTagsUpdate properties, Context context) { + return this.beginUpdateAsync(resourceGroupName, name, properties, context).getSyncPoller(); + } + + /** + * Update a Ec2FlowLog. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2FlowLog. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync(String resourceGroupName, String name, Ec2FlowLogTagsUpdate properties) { + return beginUpdateAsync(resourceGroupName, name, properties).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Update a Ec2FlowLog. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2FlowLog. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync(String resourceGroupName, String name, Ec2FlowLogTagsUpdate properties, + Context context) { + return beginUpdateAsync(resourceGroupName, name, properties, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Update a Ec2FlowLog. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2FlowLog. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Ec2FlowLogInner update(String resourceGroupName, String name, Ec2FlowLogTagsUpdate properties) { + return updateAsync(resourceGroupName, name, properties).block(); + } + + /** + * Update a Ec2FlowLog. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2FlowLog. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Ec2FlowLogInner update(String resourceGroupName, String name, Ec2FlowLogTagsUpdate properties, + Context context) { + return updateAsync(resourceGroupName, name, properties, context).block(); + } + + /** + * Delete a Ec2FlowLog. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2FlowLog. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync(String resourceGroupName, String name) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Delete a Ec2FlowLog. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2FlowLog. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync(String resourceGroupName, String name, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.delete(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, name, accept, context); + } + + /** + * Delete a Ec2FlowLog. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2FlowLog. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String name) { + Mono>> mono = deleteWithResponseAsync(resourceGroupName, name); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); + } + + /** + * Delete a Ec2FlowLog. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2FlowLog. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String name, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = deleteWithResponseAsync(resourceGroupName, name, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + context); + } + + /** + * Delete a Ec2FlowLog. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2FlowLog. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String name) { + return this.beginDeleteAsync(resourceGroupName, name).getSyncPoller(); + } + + /** + * Delete a Ec2FlowLog. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2FlowLog. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String name, Context context) { + return this.beginDeleteAsync(resourceGroupName, name, context).getSyncPoller(); + } + + /** + * Delete a Ec2FlowLog. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2FlowLog. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String name) { + return beginDeleteAsync(resourceGroupName, name).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete a Ec2FlowLog. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2FlowLog. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String name, Context context) { + return beginDeleteAsync(resourceGroupName, name, context).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete a Ec2FlowLog. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2FlowLog. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String name) { + deleteAsync(resourceGroupName, name).block(); + } + + /** + * Delete a Ec2FlowLog. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2FlowLog. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String name, Context context) { + deleteAsync(resourceGroupName, name, context).block(); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Ec2FlowLog list operation along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listBySubscriptionNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), + res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Ec2FlowLog list operation along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listBySubscriptionNextSinglePageAsync(String nextLink, + Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Ec2FlowLog list operation along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), + res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Ec2FlowLog list operation along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupNextSinglePageAsync(String nextLink, + Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/Ec2FlowLogsImpl.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/Ec2FlowLogsImpl.java new file mode 100644 index 000000000000..ebdd2a5c969a --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/Ec2FlowLogsImpl.java @@ -0,0 +1,145 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.awsconnector.fluent.Ec2FlowLogsClient; +import com.azure.resourcemanager.awsconnector.fluent.models.Ec2FlowLogInner; +import com.azure.resourcemanager.awsconnector.models.Ec2FlowLog; +import com.azure.resourcemanager.awsconnector.models.Ec2FlowLogs; + +public final class Ec2FlowLogsImpl implements Ec2FlowLogs { + private static final ClientLogger LOGGER = new ClientLogger(Ec2FlowLogsImpl.class); + + private final Ec2FlowLogsClient innerClient; + + private final com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager; + + public Ec2FlowLogsImpl(Ec2FlowLogsClient innerClient, + com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return ResourceManagerUtils.mapPage(inner, inner1 -> new Ec2FlowLogImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new Ec2FlowLogImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName); + return ResourceManagerUtils.mapPage(inner, inner1 -> new Ec2FlowLogImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new Ec2FlowLogImpl(inner1, this.manager())); + } + + public Response getByResourceGroupWithResponse(String resourceGroupName, String name, Context context) { + Response inner + = this.serviceClient().getByResourceGroupWithResponse(resourceGroupName, name, context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new Ec2FlowLogImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public Ec2FlowLog getByResourceGroup(String resourceGroupName, String name) { + Ec2FlowLogInner inner = this.serviceClient().getByResourceGroup(resourceGroupName, name); + if (inner != null) { + return new Ec2FlowLogImpl(inner, this.manager()); + } else { + return null; + } + } + + public void deleteByResourceGroup(String resourceGroupName, String name) { + this.serviceClient().delete(resourceGroupName, name); + } + + public void delete(String resourceGroupName, String name, Context context) { + this.serviceClient().delete(resourceGroupName, name, context); + } + + public Ec2FlowLog getById(String id) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String name = ResourceManagerUtils.getValueFromIdByName(id, "ec2FlowLogs"); + if (name == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'ec2FlowLogs'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, name, Context.NONE).getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String name = ResourceManagerUtils.getValueFromIdByName(id, "ec2FlowLogs"); + if (name == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'ec2FlowLogs'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, name, context); + } + + public void deleteById(String id) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String name = ResourceManagerUtils.getValueFromIdByName(id, "ec2FlowLogs"); + if (name == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'ec2FlowLogs'.", id))); + } + this.delete(resourceGroupName, name, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String name = ResourceManagerUtils.getValueFromIdByName(id, "ec2FlowLogs"); + if (name == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'ec2FlowLogs'.", id))); + } + this.delete(resourceGroupName, name, context); + } + + private Ec2FlowLogsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.awsconnector.AwsconnectorManager manager() { + return this.serviceManager; + } + + public Ec2FlowLogImpl define(String name) { + return new Ec2FlowLogImpl(name, this.manager()); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/Ec2ImageImpl.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/Ec2ImageImpl.java new file mode 100644 index 000000000000..0ad167199296 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/Ec2ImageImpl.java @@ -0,0 +1,175 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.implementation; + +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.awsconnector.fluent.models.Ec2ImageInner; +import com.azure.resourcemanager.awsconnector.models.Ec2Image; +import com.azure.resourcemanager.awsconnector.models.Ec2ImageProperties; +import com.azure.resourcemanager.awsconnector.models.Ec2ImageTagsUpdate; +import java.util.Collections; +import java.util.Map; + +public final class Ec2ImageImpl implements Ec2Image, Ec2Image.Definition, Ec2Image.Update { + private Ec2ImageInner innerObject; + + private final com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public String location() { + return this.innerModel().location(); + } + + public Map tags() { + Map inner = this.innerModel().tags(); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } + } + + public Ec2ImageProperties properties() { + return this.innerModel().properties(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public String resourceGroupName() { + return resourceGroupName; + } + + public Ec2ImageInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.awsconnector.AwsconnectorManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String name; + + private Ec2ImageTagsUpdate updateProperties; + + public Ec2ImageImpl withExistingResourceGroup(String resourceGroupName) { + this.resourceGroupName = resourceGroupName; + return this; + } + + public Ec2Image create() { + this.innerObject = serviceManager.serviceClient() + .getEc2Images() + .createOrReplace(resourceGroupName, name, this.innerModel(), Context.NONE); + return this; + } + + public Ec2Image create(Context context) { + this.innerObject = serviceManager.serviceClient() + .getEc2Images() + .createOrReplace(resourceGroupName, name, this.innerModel(), context); + return this; + } + + Ec2ImageImpl(String name, com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager) { + this.innerObject = new Ec2ImageInner(); + this.serviceManager = serviceManager; + this.name = name; + } + + public Ec2ImageImpl update() { + this.updateProperties = new Ec2ImageTagsUpdate(); + return this; + } + + public Ec2Image apply() { + this.innerObject = serviceManager.serviceClient() + .getEc2Images() + .update(resourceGroupName, name, updateProperties, Context.NONE); + return this; + } + + public Ec2Image apply(Context context) { + this.innerObject + = serviceManager.serviceClient().getEc2Images().update(resourceGroupName, name, updateProperties, context); + return this; + } + + Ec2ImageImpl(Ec2ImageInner innerObject, com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.name = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "ec2Images"); + } + + public Ec2Image refresh() { + this.innerObject = serviceManager.serviceClient() + .getEc2Images() + .getByResourceGroupWithResponse(resourceGroupName, name, Context.NONE) + .getValue(); + return this; + } + + public Ec2Image refresh(Context context) { + this.innerObject = serviceManager.serviceClient() + .getEc2Images() + .getByResourceGroupWithResponse(resourceGroupName, name, context) + .getValue(); + return this; + } + + public Ec2ImageImpl withRegion(Region location) { + this.innerModel().withLocation(location.toString()); + return this; + } + + public Ec2ImageImpl withRegion(String location) { + this.innerModel().withLocation(location); + return this; + } + + public Ec2ImageImpl withTags(Map tags) { + if (isInCreateMode()) { + this.innerModel().withTags(tags); + return this; + } else { + this.updateProperties.withTags(tags); + return this; + } + } + + public Ec2ImageImpl withProperties(Ec2ImageProperties properties) { + this.innerModel().withProperties(properties); + return this; + } + + private boolean isInCreateMode() { + return this.innerModel().id() == null; + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/Ec2ImagesClientImpl.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/Ec2ImagesClientImpl.java new file mode 100644 index 000000000000..1a6789c391a1 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/Ec2ImagesClientImpl.java @@ -0,0 +1,1273 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.Patch; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.awsconnector.fluent.Ec2ImagesClient; +import com.azure.resourcemanager.awsconnector.fluent.models.Ec2ImageInner; +import com.azure.resourcemanager.awsconnector.models.Ec2ImageListResult; +import com.azure.resourcemanager.awsconnector.models.Ec2ImageTagsUpdate; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in Ec2ImagesClient. + */ +public final class Ec2ImagesClientImpl implements Ec2ImagesClient { + /** + * The proxy service used to perform REST calls. + */ + private final Ec2ImagesService service; + + /** + * The service client containing this operation class. + */ + private final MicrosoftAwsConnectorImpl client; + + /** + * Initializes an instance of Ec2ImagesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + Ec2ImagesClientImpl(MicrosoftAwsConnectorImpl client) { + this.service + = RestProxy.create(Ec2ImagesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for MicrosoftAwsConnectorEc2Images to be used by the proxy service to + * perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "MicrosoftAwsConnecto") + public interface Ec2ImagesService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.AwsConnector/ec2Images") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/ec2Images") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroup(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/ec2Images/{name}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getByResourceGroup(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("name") String name, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/ec2Images/{name}") + @ExpectedResponses({ 200, 201 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrReplace(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("name") String name, + @BodyParam("application/json") Ec2ImageInner resource, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/ec2Images/{name}") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> update(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("name") String name, + @BodyParam("application/json") Ec2ImageTagsUpdate properties, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/ec2Images/{name}") + @ExpectedResponses({ 202, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("name") String name, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listBySubscriptionNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroupNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); + } + + /** + * List Ec2Image resources by subscription ID. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Ec2Image list operation along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync() { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), + res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List Ec2Image resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Ec2Image list operation along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), accept, + context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * List Ec2Image resources by subscription ID. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Ec2Image list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>(() -> listSinglePageAsync(), + nextLink -> listBySubscriptionNextSinglePageAsync(nextLink)); + } + + /** + * List Ec2Image resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Ec2Image list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(Context context) { + return new PagedFlux<>(() -> listSinglePageAsync(context), + nextLink -> listBySubscriptionNextSinglePageAsync(nextLink, context)); + } + + /** + * List Ec2Image resources by subscription ID. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Ec2Image list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + return new PagedIterable<>(listAsync()); + } + + /** + * List Ec2Image resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Ec2Image list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Context context) { + return new PagedIterable<>(listAsync(context)); + } + + /** + * List Ec2Image resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Ec2Image list operation along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), + res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List Ec2Image resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Ec2Image list operation along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * List Ec2Image resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Ec2Image list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName) { + return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); + } + + /** + * List Ec2Image resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Ec2Image list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName, Context context) { + return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName, context), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink, context)); + } + + /** + * List Ec2Image resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Ec2Image list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName)); + } + + /** + * List Ec2Image resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Ec2Image list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, context)); + } + + /** + * Get a Ec2Image. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2Image. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Ec2Image along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync(String resourceGroupName, String name) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.getByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get a Ec2Image. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2Image. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Ec2Image along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync(String resourceGroupName, String name, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.getByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, accept, context); + } + + /** + * Get a Ec2Image. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2Image. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Ec2Image on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getByResourceGroupAsync(String resourceGroupName, String name) { + return getByResourceGroupWithResponseAsync(resourceGroupName, name) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Get a Ec2Image. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2Image. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Ec2Image along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getByResourceGroupWithResponse(String resourceGroupName, String name, + Context context) { + return getByResourceGroupWithResponseAsync(resourceGroupName, name, context).block(); + } + + /** + * Get a Ec2Image. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2Image. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Ec2Image. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Ec2ImageInner getByResourceGroup(String resourceGroupName, String name) { + return getByResourceGroupWithResponse(resourceGroupName, name, Context.NONE).getValue(); + } + + /** + * Create a Ec2Image. Please note that end user resource creation is currently restricted, but it will be enabled in + * the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2Image. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrReplaceWithResponseAsync(String resourceGroupName, String name, + Ec2ImageInner resource) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (resource == null) { + return Mono.error(new IllegalArgumentException("Parameter resource is required and cannot be null.")); + } else { + resource.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.createOrReplace(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, resource, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Create a Ec2Image. Please note that end user resource creation is currently restricted, but it will be enabled in + * the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2Image. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrReplaceWithResponseAsync(String resourceGroupName, String name, + Ec2ImageInner resource, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (resource == null) { + return Mono.error(new IllegalArgumentException("Parameter resource is required and cannot be null.")); + } else { + resource.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.createOrReplace(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, resource, accept, context); + } + + /** + * Create a Ec2Image. Please note that end user resource creation is currently restricted, but it will be enabled in + * the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2Image. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Ec2ImageInner> beginCreateOrReplaceAsync(String resourceGroupName, + String name, Ec2ImageInner resource) { + Mono>> mono = createOrReplaceWithResponseAsync(resourceGroupName, name, resource); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + Ec2ImageInner.class, Ec2ImageInner.class, this.client.getContext()); + } + + /** + * Create a Ec2Image. Please note that end user resource creation is currently restricted, but it will be enabled in + * the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2Image. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Ec2ImageInner> beginCreateOrReplaceAsync(String resourceGroupName, + String name, Ec2ImageInner resource, Context context) { + context = this.client.mergeContext(context); + Mono>> mono + = createOrReplaceWithResponseAsync(resourceGroupName, name, resource, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + Ec2ImageInner.class, Ec2ImageInner.class, context); + } + + /** + * Create a Ec2Image. Please note that end user resource creation is currently restricted, but it will be enabled in + * the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2Image. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Ec2ImageInner> beginCreateOrReplace(String resourceGroupName, + String name, Ec2ImageInner resource) { + return this.beginCreateOrReplaceAsync(resourceGroupName, name, resource).getSyncPoller(); + } + + /** + * Create a Ec2Image. Please note that end user resource creation is currently restricted, but it will be enabled in + * the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2Image. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Ec2ImageInner> beginCreateOrReplace(String resourceGroupName, + String name, Ec2ImageInner resource, Context context) { + return this.beginCreateOrReplaceAsync(resourceGroupName, name, resource, context).getSyncPoller(); + } + + /** + * Create a Ec2Image. Please note that end user resource creation is currently restricted, but it will be enabled in + * the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2Image. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrReplaceAsync(String resourceGroupName, String name, Ec2ImageInner resource) { + return beginCreateOrReplaceAsync(resourceGroupName, name, resource).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create a Ec2Image. Please note that end user resource creation is currently restricted, but it will be enabled in + * the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2Image. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrReplaceAsync(String resourceGroupName, String name, Ec2ImageInner resource, + Context context) { + return beginCreateOrReplaceAsync(resourceGroupName, name, resource, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create a Ec2Image. Please note that end user resource creation is currently restricted, but it will be enabled in + * the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2Image. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Ec2ImageInner createOrReplace(String resourceGroupName, String name, Ec2ImageInner resource) { + return createOrReplaceAsync(resourceGroupName, name, resource).block(); + } + + /** + * Create a Ec2Image. Please note that end user resource creation is currently restricted, but it will be enabled in + * the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2Image. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Ec2ImageInner createOrReplace(String resourceGroupName, String name, Ec2ImageInner resource, + Context context) { + return createOrReplaceAsync(resourceGroupName, name, resource, context).block(); + } + + /** + * Update a Ec2Image. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2Image. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync(String resourceGroupName, String name, + Ec2ImageTagsUpdate properties) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (properties == null) { + return Mono.error(new IllegalArgumentException("Parameter properties is required and cannot be null.")); + } else { + properties.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.update(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, properties, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Update a Ec2Image. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2Image. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync(String resourceGroupName, String name, + Ec2ImageTagsUpdate properties, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (properties == null) { + return Mono.error(new IllegalArgumentException("Parameter properties is required and cannot be null.")); + } else { + properties.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.update(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, name, properties, accept, context); + } + + /** + * Update a Ec2Image. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2Image. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Ec2ImageInner> beginUpdateAsync(String resourceGroupName, String name, + Ec2ImageTagsUpdate properties) { + Mono>> mono = updateWithResponseAsync(resourceGroupName, name, properties); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + Ec2ImageInner.class, Ec2ImageInner.class, this.client.getContext()); + } + + /** + * Update a Ec2Image. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2Image. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Ec2ImageInner> beginUpdateAsync(String resourceGroupName, String name, + Ec2ImageTagsUpdate properties, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = updateWithResponseAsync(resourceGroupName, name, properties, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + Ec2ImageInner.class, Ec2ImageInner.class, context); + } + + /** + * Update a Ec2Image. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2Image. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Ec2ImageInner> beginUpdate(String resourceGroupName, String name, + Ec2ImageTagsUpdate properties) { + return this.beginUpdateAsync(resourceGroupName, name, properties).getSyncPoller(); + } + + /** + * Update a Ec2Image. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2Image. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Ec2ImageInner> beginUpdate(String resourceGroupName, String name, + Ec2ImageTagsUpdate properties, Context context) { + return this.beginUpdateAsync(resourceGroupName, name, properties, context).getSyncPoller(); + } + + /** + * Update a Ec2Image. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2Image. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync(String resourceGroupName, String name, Ec2ImageTagsUpdate properties) { + return beginUpdateAsync(resourceGroupName, name, properties).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Update a Ec2Image. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2Image. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync(String resourceGroupName, String name, Ec2ImageTagsUpdate properties, + Context context) { + return beginUpdateAsync(resourceGroupName, name, properties, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Update a Ec2Image. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2Image. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Ec2ImageInner update(String resourceGroupName, String name, Ec2ImageTagsUpdate properties) { + return updateAsync(resourceGroupName, name, properties).block(); + } + + /** + * Update a Ec2Image. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2Image. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Ec2ImageInner update(String resourceGroupName, String name, Ec2ImageTagsUpdate properties, Context context) { + return updateAsync(resourceGroupName, name, properties, context).block(); + } + + /** + * Delete a Ec2Image. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2Image. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync(String resourceGroupName, String name) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Delete a Ec2Image. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2Image. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync(String resourceGroupName, String name, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.delete(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, name, accept, context); + } + + /** + * Delete a Ec2Image. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2Image. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String name) { + Mono>> mono = deleteWithResponseAsync(resourceGroupName, name); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); + } + + /** + * Delete a Ec2Image. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2Image. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String name, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = deleteWithResponseAsync(resourceGroupName, name, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + context); + } + + /** + * Delete a Ec2Image. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2Image. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String name) { + return this.beginDeleteAsync(resourceGroupName, name).getSyncPoller(); + } + + /** + * Delete a Ec2Image. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2Image. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String name, Context context) { + return this.beginDeleteAsync(resourceGroupName, name, context).getSyncPoller(); + } + + /** + * Delete a Ec2Image. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2Image. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String name) { + return beginDeleteAsync(resourceGroupName, name).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete a Ec2Image. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2Image. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String name, Context context) { + return beginDeleteAsync(resourceGroupName, name, context).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete a Ec2Image. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2Image. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String name) { + deleteAsync(resourceGroupName, name).block(); + } + + /** + * Delete a Ec2Image. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2Image. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String name, Context context) { + deleteAsync(resourceGroupName, name, context).block(); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Ec2Image list operation along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listBySubscriptionNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), + res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Ec2Image list operation along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listBySubscriptionNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Ec2Image list operation along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), + res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Ec2Image list operation along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupNextSinglePageAsync(String nextLink, + Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/Ec2ImagesImpl.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/Ec2ImagesImpl.java new file mode 100644 index 000000000000..1a0689bfe61d --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/Ec2ImagesImpl.java @@ -0,0 +1,145 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.awsconnector.fluent.Ec2ImagesClient; +import com.azure.resourcemanager.awsconnector.fluent.models.Ec2ImageInner; +import com.azure.resourcemanager.awsconnector.models.Ec2Image; +import com.azure.resourcemanager.awsconnector.models.Ec2Images; + +public final class Ec2ImagesImpl implements Ec2Images { + private static final ClientLogger LOGGER = new ClientLogger(Ec2ImagesImpl.class); + + private final Ec2ImagesClient innerClient; + + private final com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager; + + public Ec2ImagesImpl(Ec2ImagesClient innerClient, + com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return ResourceManagerUtils.mapPage(inner, inner1 -> new Ec2ImageImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new Ec2ImageImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName); + return ResourceManagerUtils.mapPage(inner, inner1 -> new Ec2ImageImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new Ec2ImageImpl(inner1, this.manager())); + } + + public Response getByResourceGroupWithResponse(String resourceGroupName, String name, Context context) { + Response inner + = this.serviceClient().getByResourceGroupWithResponse(resourceGroupName, name, context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new Ec2ImageImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public Ec2Image getByResourceGroup(String resourceGroupName, String name) { + Ec2ImageInner inner = this.serviceClient().getByResourceGroup(resourceGroupName, name); + if (inner != null) { + return new Ec2ImageImpl(inner, this.manager()); + } else { + return null; + } + } + + public void deleteByResourceGroup(String resourceGroupName, String name) { + this.serviceClient().delete(resourceGroupName, name); + } + + public void delete(String resourceGroupName, String name, Context context) { + this.serviceClient().delete(resourceGroupName, name, context); + } + + public Ec2Image getById(String id) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String name = ResourceManagerUtils.getValueFromIdByName(id, "ec2Images"); + if (name == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'ec2Images'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, name, Context.NONE).getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String name = ResourceManagerUtils.getValueFromIdByName(id, "ec2Images"); + if (name == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'ec2Images'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, name, context); + } + + public void deleteById(String id) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String name = ResourceManagerUtils.getValueFromIdByName(id, "ec2Images"); + if (name == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'ec2Images'.", id))); + } + this.delete(resourceGroupName, name, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String name = ResourceManagerUtils.getValueFromIdByName(id, "ec2Images"); + if (name == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'ec2Images'.", id))); + } + this.delete(resourceGroupName, name, context); + } + + private Ec2ImagesClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.awsconnector.AwsconnectorManager manager() { + return this.serviceManager; + } + + public Ec2ImageImpl define(String name) { + return new Ec2ImageImpl(name, this.manager()); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/Ec2InstanceImpl.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/Ec2InstanceImpl.java new file mode 100644 index 000000000000..bdbdd5b268c0 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/Ec2InstanceImpl.java @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.implementation; + +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.awsconnector.fluent.models.Ec2InstanceInner; +import com.azure.resourcemanager.awsconnector.models.Ec2Instance; +import com.azure.resourcemanager.awsconnector.models.Ec2InstanceProperties; + +public final class Ec2InstanceImpl implements Ec2Instance { + private Ec2InstanceInner innerObject; + + private final com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager; + + Ec2InstanceImpl(Ec2InstanceInner innerObject, + com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public Ec2InstanceProperties properties() { + return this.innerModel().properties(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public Ec2InstanceInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.awsconnector.AwsconnectorManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/Ec2InstanceStatusImpl.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/Ec2InstanceStatusImpl.java new file mode 100644 index 000000000000..30be04483a0e --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/Ec2InstanceStatusImpl.java @@ -0,0 +1,178 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.implementation; + +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.awsconnector.fluent.models.Ec2InstanceStatusInner; +import com.azure.resourcemanager.awsconnector.models.Ec2InstanceStatus; +import com.azure.resourcemanager.awsconnector.models.Ec2InstanceStatusProperties; +import com.azure.resourcemanager.awsconnector.models.Ec2InstanceStatusTagsUpdate; +import java.util.Collections; +import java.util.Map; + +public final class Ec2InstanceStatusImpl + implements Ec2InstanceStatus, Ec2InstanceStatus.Definition, Ec2InstanceStatus.Update { + private Ec2InstanceStatusInner innerObject; + + private final com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public String location() { + return this.innerModel().location(); + } + + public Map tags() { + Map inner = this.innerModel().tags(); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } + } + + public Ec2InstanceStatusProperties properties() { + return this.innerModel().properties(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public String resourceGroupName() { + return resourceGroupName; + } + + public Ec2InstanceStatusInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.awsconnector.AwsconnectorManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String name; + + private Ec2InstanceStatusTagsUpdate updateProperties; + + public Ec2InstanceStatusImpl withExistingResourceGroup(String resourceGroupName) { + this.resourceGroupName = resourceGroupName; + return this; + } + + public Ec2InstanceStatus create() { + this.innerObject = serviceManager.serviceClient() + .getEc2InstanceStatuses() + .createOrReplace(resourceGroupName, name, this.innerModel(), Context.NONE); + return this; + } + + public Ec2InstanceStatus create(Context context) { + this.innerObject = serviceManager.serviceClient() + .getEc2InstanceStatuses() + .createOrReplace(resourceGroupName, name, this.innerModel(), context); + return this; + } + + Ec2InstanceStatusImpl(String name, com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager) { + this.innerObject = new Ec2InstanceStatusInner(); + this.serviceManager = serviceManager; + this.name = name; + } + + public Ec2InstanceStatusImpl update() { + this.updateProperties = new Ec2InstanceStatusTagsUpdate(); + return this; + } + + public Ec2InstanceStatus apply() { + this.innerObject = serviceManager.serviceClient() + .getEc2InstanceStatuses() + .update(resourceGroupName, name, updateProperties, Context.NONE); + return this; + } + + public Ec2InstanceStatus apply(Context context) { + this.innerObject = serviceManager.serviceClient() + .getEc2InstanceStatuses() + .update(resourceGroupName, name, updateProperties, context); + return this; + } + + Ec2InstanceStatusImpl(Ec2InstanceStatusInner innerObject, + com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.name = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "ec2InstanceStatuses"); + } + + public Ec2InstanceStatus refresh() { + this.innerObject = serviceManager.serviceClient() + .getEc2InstanceStatuses() + .getByResourceGroupWithResponse(resourceGroupName, name, Context.NONE) + .getValue(); + return this; + } + + public Ec2InstanceStatus refresh(Context context) { + this.innerObject = serviceManager.serviceClient() + .getEc2InstanceStatuses() + .getByResourceGroupWithResponse(resourceGroupName, name, context) + .getValue(); + return this; + } + + public Ec2InstanceStatusImpl withRegion(Region location) { + this.innerModel().withLocation(location.toString()); + return this; + } + + public Ec2InstanceStatusImpl withRegion(String location) { + this.innerModel().withLocation(location); + return this; + } + + public Ec2InstanceStatusImpl withTags(Map tags) { + if (isInCreateMode()) { + this.innerModel().withTags(tags); + return this; + } else { + this.updateProperties.withTags(tags); + return this; + } + } + + public Ec2InstanceStatusImpl withProperties(Ec2InstanceStatusProperties properties) { + this.innerModel().withProperties(properties); + return this; + } + + private boolean isInCreateMode() { + return this.innerModel().id() == null; + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/Ec2InstanceStatusesClientImpl.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/Ec2InstanceStatusesClientImpl.java new file mode 100644 index 000000000000..75928964dfd7 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/Ec2InstanceStatusesClientImpl.java @@ -0,0 +1,1282 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.Patch; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.awsconnector.fluent.Ec2InstanceStatusesClient; +import com.azure.resourcemanager.awsconnector.fluent.models.Ec2InstanceStatusInner; +import com.azure.resourcemanager.awsconnector.models.Ec2InstanceStatusListResult; +import com.azure.resourcemanager.awsconnector.models.Ec2InstanceStatusTagsUpdate; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in Ec2InstanceStatusesClient. + */ +public final class Ec2InstanceStatusesClientImpl implements Ec2InstanceStatusesClient { + /** + * The proxy service used to perform REST calls. + */ + private final Ec2InstanceStatusesService service; + + /** + * The service client containing this operation class. + */ + private final MicrosoftAwsConnectorImpl client; + + /** + * Initializes an instance of Ec2InstanceStatusesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + Ec2InstanceStatusesClientImpl(MicrosoftAwsConnectorImpl client) { + this.service = RestProxy.create(Ec2InstanceStatusesService.class, client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for MicrosoftAwsConnectorEc2InstanceStatuses to be used by the proxy + * service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "MicrosoftAwsConnecto") + public interface Ec2InstanceStatusesService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.AwsConnector/ec2InstanceStatuses") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/ec2InstanceStatuses") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroup(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/ec2InstanceStatuses/{name}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getByResourceGroup(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("name") String name, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/ec2InstanceStatuses/{name}") + @ExpectedResponses({ 200, 201 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrReplace(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("name") String name, + @BodyParam("application/json") Ec2InstanceStatusInner resource, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/ec2InstanceStatuses/{name}") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> update(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("name") String name, + @BodyParam("application/json") Ec2InstanceStatusTagsUpdate properties, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/ec2InstanceStatuses/{name}") + @ExpectedResponses({ 202, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("name") String name, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listBySubscriptionNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroupNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); + } + + /** + * List Ec2InstanceStatus resources by subscription ID. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Ec2InstanceStatus list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync() { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List Ec2InstanceStatus resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Ec2InstanceStatus list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), accept, + context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * List Ec2InstanceStatus resources by subscription ID. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Ec2InstanceStatus list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>(() -> listSinglePageAsync(), + nextLink -> listBySubscriptionNextSinglePageAsync(nextLink)); + } + + /** + * List Ec2InstanceStatus resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Ec2InstanceStatus list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(Context context) { + return new PagedFlux<>(() -> listSinglePageAsync(context), + nextLink -> listBySubscriptionNextSinglePageAsync(nextLink, context)); + } + + /** + * List Ec2InstanceStatus resources by subscription ID. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Ec2InstanceStatus list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + return new PagedIterable<>(listAsync()); + } + + /** + * List Ec2InstanceStatus resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Ec2InstanceStatus list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Context context) { + return new PagedIterable<>(listAsync(context)); + } + + /** + * List Ec2InstanceStatus resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Ec2InstanceStatus list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List Ec2InstanceStatus resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Ec2InstanceStatus list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * List Ec2InstanceStatus resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Ec2InstanceStatus list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName) { + return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); + } + + /** + * List Ec2InstanceStatus resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Ec2InstanceStatus list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName, Context context) { + return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName, context), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink, context)); + } + + /** + * List Ec2InstanceStatus resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Ec2InstanceStatus list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName)); + } + + /** + * List Ec2InstanceStatus resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Ec2InstanceStatus list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, context)); + } + + /** + * Get a Ec2InstanceStatus. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2InstanceStatus. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Ec2InstanceStatus along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync(String resourceGroupName, + String name) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.getByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get a Ec2InstanceStatus. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2InstanceStatus. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Ec2InstanceStatus along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync(String resourceGroupName, + String name, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.getByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, accept, context); + } + + /** + * Get a Ec2InstanceStatus. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2InstanceStatus. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Ec2InstanceStatus on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getByResourceGroupAsync(String resourceGroupName, String name) { + return getByResourceGroupWithResponseAsync(resourceGroupName, name) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Get a Ec2InstanceStatus. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2InstanceStatus. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Ec2InstanceStatus along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getByResourceGroupWithResponse(String resourceGroupName, String name, + Context context) { + return getByResourceGroupWithResponseAsync(resourceGroupName, name, context).block(); + } + + /** + * Get a Ec2InstanceStatus. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2InstanceStatus. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Ec2InstanceStatus. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Ec2InstanceStatusInner getByResourceGroup(String resourceGroupName, String name) { + return getByResourceGroupWithResponse(resourceGroupName, name, Context.NONE).getValue(); + } + + /** + * Create a Ec2InstanceStatus. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2InstanceStatus. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrReplaceWithResponseAsync(String resourceGroupName, String name, + Ec2InstanceStatusInner resource) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (resource == null) { + return Mono.error(new IllegalArgumentException("Parameter resource is required and cannot be null.")); + } else { + resource.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.createOrReplace(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, resource, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Create a Ec2InstanceStatus. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2InstanceStatus. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrReplaceWithResponseAsync(String resourceGroupName, String name, + Ec2InstanceStatusInner resource, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (resource == null) { + return Mono.error(new IllegalArgumentException("Parameter resource is required and cannot be null.")); + } else { + resource.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.createOrReplace(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, resource, accept, context); + } + + /** + * Create a Ec2InstanceStatus. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2InstanceStatus. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Ec2InstanceStatusInner> + beginCreateOrReplaceAsync(String resourceGroupName, String name, Ec2InstanceStatusInner resource) { + Mono>> mono = createOrReplaceWithResponseAsync(resourceGroupName, name, resource); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), Ec2InstanceStatusInner.class, Ec2InstanceStatusInner.class, + this.client.getContext()); + } + + /** + * Create a Ec2InstanceStatus. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2InstanceStatus. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Ec2InstanceStatusInner> beginCreateOrReplaceAsync( + String resourceGroupName, String name, Ec2InstanceStatusInner resource, Context context) { + context = this.client.mergeContext(context); + Mono>> mono + = createOrReplaceWithResponseAsync(resourceGroupName, name, resource, context); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), Ec2InstanceStatusInner.class, Ec2InstanceStatusInner.class, context); + } + + /** + * Create a Ec2InstanceStatus. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2InstanceStatus. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Ec2InstanceStatusInner> + beginCreateOrReplace(String resourceGroupName, String name, Ec2InstanceStatusInner resource) { + return this.beginCreateOrReplaceAsync(resourceGroupName, name, resource).getSyncPoller(); + } + + /** + * Create a Ec2InstanceStatus. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2InstanceStatus. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Ec2InstanceStatusInner> + beginCreateOrReplace(String resourceGroupName, String name, Ec2InstanceStatusInner resource, Context context) { + return this.beginCreateOrReplaceAsync(resourceGroupName, name, resource, context).getSyncPoller(); + } + + /** + * Create a Ec2InstanceStatus. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2InstanceStatus. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrReplaceAsync(String resourceGroupName, String name, + Ec2InstanceStatusInner resource) { + return beginCreateOrReplaceAsync(resourceGroupName, name, resource).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create a Ec2InstanceStatus. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2InstanceStatus. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrReplaceAsync(String resourceGroupName, String name, + Ec2InstanceStatusInner resource, Context context) { + return beginCreateOrReplaceAsync(resourceGroupName, name, resource, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create a Ec2InstanceStatus. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2InstanceStatus. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Ec2InstanceStatusInner createOrReplace(String resourceGroupName, String name, + Ec2InstanceStatusInner resource) { + return createOrReplaceAsync(resourceGroupName, name, resource).block(); + } + + /** + * Create a Ec2InstanceStatus. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2InstanceStatus. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Ec2InstanceStatusInner createOrReplace(String resourceGroupName, String name, + Ec2InstanceStatusInner resource, Context context) { + return createOrReplaceAsync(resourceGroupName, name, resource, context).block(); + } + + /** + * Update a Ec2InstanceStatus. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2InstanceStatus. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync(String resourceGroupName, String name, + Ec2InstanceStatusTagsUpdate properties) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (properties == null) { + return Mono.error(new IllegalArgumentException("Parameter properties is required and cannot be null.")); + } else { + properties.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.update(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, properties, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Update a Ec2InstanceStatus. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2InstanceStatus. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync(String resourceGroupName, String name, + Ec2InstanceStatusTagsUpdate properties, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (properties == null) { + return Mono.error(new IllegalArgumentException("Parameter properties is required and cannot be null.")); + } else { + properties.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.update(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, name, properties, accept, context); + } + + /** + * Update a Ec2InstanceStatus. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2InstanceStatus. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Ec2InstanceStatusInner> + beginUpdateAsync(String resourceGroupName, String name, Ec2InstanceStatusTagsUpdate properties) { + Mono>> mono = updateWithResponseAsync(resourceGroupName, name, properties); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), Ec2InstanceStatusInner.class, Ec2InstanceStatusInner.class, + this.client.getContext()); + } + + /** + * Update a Ec2InstanceStatus. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2InstanceStatus. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Ec2InstanceStatusInner> beginUpdateAsync( + String resourceGroupName, String name, Ec2InstanceStatusTagsUpdate properties, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = updateWithResponseAsync(resourceGroupName, name, properties, context); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), Ec2InstanceStatusInner.class, Ec2InstanceStatusInner.class, context); + } + + /** + * Update a Ec2InstanceStatus. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2InstanceStatus. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Ec2InstanceStatusInner> beginUpdate(String resourceGroupName, + String name, Ec2InstanceStatusTagsUpdate properties) { + return this.beginUpdateAsync(resourceGroupName, name, properties).getSyncPoller(); + } + + /** + * Update a Ec2InstanceStatus. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2InstanceStatus. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Ec2InstanceStatusInner> beginUpdate(String resourceGroupName, + String name, Ec2InstanceStatusTagsUpdate properties, Context context) { + return this.beginUpdateAsync(resourceGroupName, name, properties, context).getSyncPoller(); + } + + /** + * Update a Ec2InstanceStatus. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2InstanceStatus. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync(String resourceGroupName, String name, + Ec2InstanceStatusTagsUpdate properties) { + return beginUpdateAsync(resourceGroupName, name, properties).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Update a Ec2InstanceStatus. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2InstanceStatus. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync(String resourceGroupName, String name, + Ec2InstanceStatusTagsUpdate properties, Context context) { + return beginUpdateAsync(resourceGroupName, name, properties, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Update a Ec2InstanceStatus. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2InstanceStatus. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Ec2InstanceStatusInner update(String resourceGroupName, String name, + Ec2InstanceStatusTagsUpdate properties) { + return updateAsync(resourceGroupName, name, properties).block(); + } + + /** + * Update a Ec2InstanceStatus. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2InstanceStatus. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Ec2InstanceStatusInner update(String resourceGroupName, String name, Ec2InstanceStatusTagsUpdate properties, + Context context) { + return updateAsync(resourceGroupName, name, properties, context).block(); + } + + /** + * Delete a Ec2InstanceStatus. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2InstanceStatus. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync(String resourceGroupName, String name) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Delete a Ec2InstanceStatus. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2InstanceStatus. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync(String resourceGroupName, String name, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.delete(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, name, accept, context); + } + + /** + * Delete a Ec2InstanceStatus. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2InstanceStatus. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String name) { + Mono>> mono = deleteWithResponseAsync(resourceGroupName, name); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); + } + + /** + * Delete a Ec2InstanceStatus. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2InstanceStatus. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String name, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = deleteWithResponseAsync(resourceGroupName, name, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + context); + } + + /** + * Delete a Ec2InstanceStatus. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2InstanceStatus. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String name) { + return this.beginDeleteAsync(resourceGroupName, name).getSyncPoller(); + } + + /** + * Delete a Ec2InstanceStatus. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2InstanceStatus. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String name, Context context) { + return this.beginDeleteAsync(resourceGroupName, name, context).getSyncPoller(); + } + + /** + * Delete a Ec2InstanceStatus. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2InstanceStatus. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String name) { + return beginDeleteAsync(resourceGroupName, name).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete a Ec2InstanceStatus. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2InstanceStatus. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String name, Context context) { + return beginDeleteAsync(resourceGroupName, name, context).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete a Ec2InstanceStatus. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2InstanceStatus. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String name) { + deleteAsync(resourceGroupName, name).block(); + } + + /** + * Delete a Ec2InstanceStatus. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2InstanceStatus. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String name, Context context) { + deleteAsync(resourceGroupName, name, context).block(); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Ec2InstanceStatus list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listBySubscriptionNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Ec2InstanceStatus list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listBySubscriptionNextSinglePageAsync(String nextLink, + Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Ec2InstanceStatus list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Ec2InstanceStatus list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupNextSinglePageAsync(String nextLink, + Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/Ec2InstanceStatusesImpl.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/Ec2InstanceStatusesImpl.java new file mode 100644 index 000000000000..61c99f2c7c26 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/Ec2InstanceStatusesImpl.java @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.awsconnector.fluent.Ec2InstanceStatusesClient; +import com.azure.resourcemanager.awsconnector.fluent.models.Ec2InstanceStatusInner; +import com.azure.resourcemanager.awsconnector.models.Ec2InstanceStatus; +import com.azure.resourcemanager.awsconnector.models.Ec2InstanceStatuses; + +public final class Ec2InstanceStatusesImpl implements Ec2InstanceStatuses { + private static final ClientLogger LOGGER = new ClientLogger(Ec2InstanceStatusesImpl.class); + + private final Ec2InstanceStatusesClient innerClient; + + private final com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager; + + public Ec2InstanceStatusesImpl(Ec2InstanceStatusesClient innerClient, + com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return ResourceManagerUtils.mapPage(inner, inner1 -> new Ec2InstanceStatusImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new Ec2InstanceStatusImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName); + return ResourceManagerUtils.mapPage(inner, inner1 -> new Ec2InstanceStatusImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + PagedIterable inner + = this.serviceClient().listByResourceGroup(resourceGroupName, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new Ec2InstanceStatusImpl(inner1, this.manager())); + } + + public Response getByResourceGroupWithResponse(String resourceGroupName, String name, + Context context) { + Response inner + = this.serviceClient().getByResourceGroupWithResponse(resourceGroupName, name, context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new Ec2InstanceStatusImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public Ec2InstanceStatus getByResourceGroup(String resourceGroupName, String name) { + Ec2InstanceStatusInner inner = this.serviceClient().getByResourceGroup(resourceGroupName, name); + if (inner != null) { + return new Ec2InstanceStatusImpl(inner, this.manager()); + } else { + return null; + } + } + + public void deleteByResourceGroup(String resourceGroupName, String name) { + this.serviceClient().delete(resourceGroupName, name); + } + + public void delete(String resourceGroupName, String name, Context context) { + this.serviceClient().delete(resourceGroupName, name, context); + } + + public Ec2InstanceStatus getById(String id) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String name = ResourceManagerUtils.getValueFromIdByName(id, "ec2InstanceStatuses"); + if (name == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'ec2InstanceStatuses'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, name, Context.NONE).getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String name = ResourceManagerUtils.getValueFromIdByName(id, "ec2InstanceStatuses"); + if (name == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'ec2InstanceStatuses'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, name, context); + } + + public void deleteById(String id) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String name = ResourceManagerUtils.getValueFromIdByName(id, "ec2InstanceStatuses"); + if (name == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'ec2InstanceStatuses'.", id))); + } + this.delete(resourceGroupName, name, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String name = ResourceManagerUtils.getValueFromIdByName(id, "ec2InstanceStatuses"); + if (name == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'ec2InstanceStatuses'.", id))); + } + this.delete(resourceGroupName, name, context); + } + + private Ec2InstanceStatusesClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.awsconnector.AwsconnectorManager manager() { + return this.serviceManager; + } + + public Ec2InstanceStatusImpl define(String name) { + return new Ec2InstanceStatusImpl(name, this.manager()); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/Ec2InstancesClientImpl.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/Ec2InstancesClientImpl.java new file mode 100644 index 000000000000..6f87cbf07c1d --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/Ec2InstancesClientImpl.java @@ -0,0 +1,1151 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Post; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.awsconnector.fluent.Ec2InstancesClient; +import com.azure.resourcemanager.awsconnector.fluent.models.Ec2InstanceInner; +import com.azure.resourcemanager.awsconnector.fluent.models.OperationStatusResultInner; +import com.azure.resourcemanager.awsconnector.models.Ec2InstanceListResult; +import com.azure.resourcemanager.awsconnector.models.StopEc2InstanceOptions; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in Ec2InstancesClient. + */ +public final class Ec2InstancesClientImpl implements Ec2InstancesClient { + /** + * The proxy service used to perform REST calls. + */ + private final Ec2InstancesService service; + + /** + * The service client containing this operation class. + */ + private final MicrosoftAwsConnectorImpl client; + + /** + * Initializes an instance of Ec2InstancesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + Ec2InstancesClientImpl(MicrosoftAwsConnectorImpl client) { + this.service + = RestProxy.create(Ec2InstancesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for MicrosoftAwsConnectorEc2Instances to be used by the proxy service to + * perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "MicrosoftAwsConnecto") + public interface Ec2InstancesService { + @Headers({ "Content-Type: application/json" }) + @Get("/{resourceUri}/providers/Microsoft.AwsConnector/ec2Instances") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam(value = "resourceUri", encoded = true) String resourceUri, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/{resourceUri}/providers/Microsoft.AwsConnector/ec2Instances/default") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam(value = "resourceUri", encoded = true) String resourceUri, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Put("/{resourceUri}/providers/Microsoft.AwsConnector/ec2Instances/default") + @ExpectedResponses({ 200, 201 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrReplace(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam(value = "resourceUri", encoded = true) String resourceUri, + @BodyParam("application/json") Ec2InstanceInner resource, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Delete("/{resourceUri}/providers/Microsoft.AwsConnector/ec2Instances/default") + @ExpectedResponses({ 202, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam(value = "resourceUri", encoded = true) String resourceUri, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Post("/{resourceUri}/providers/Microsoft.AwsConnector/ec2Instances/default/start") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> start(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam(value = "resourceUri", encoded = true) String resourceUri, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Post("/{resourceUri}/providers/Microsoft.AwsConnector/ec2Instances/default/stop") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> stop(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam(value = "resourceUri", encoded = true) String resourceUri, + @BodyParam("application/json") StopEc2InstanceOptions body, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext(@PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, @HeaderParam("Accept") String accept, Context context); + } + + /** + * List Ec2Instance resources by parent. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Ec2Instance list operation along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(String resourceUri) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceUri == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceUri is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), resourceUri, + accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), + res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List Ec2Instance resources by parent. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Ec2Instance list operation along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(String resourceUri, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceUri == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceUri is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.list(this.client.getEndpoint(), this.client.getApiVersion(), resourceUri, accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * List Ec2Instance resources by parent. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Ec2Instance list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceUri) { + return new PagedFlux<>(() -> listSinglePageAsync(resourceUri), nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * List Ec2Instance resources by parent. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Ec2Instance list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceUri, Context context) { + return new PagedFlux<>(() -> listSinglePageAsync(resourceUri, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * List Ec2Instance resources by parent. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Ec2Instance list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceUri) { + return new PagedIterable<>(listAsync(resourceUri)); + } + + /** + * List Ec2Instance resources by parent. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Ec2Instance list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceUri, Context context) { + return new PagedIterable<>(listAsync(resourceUri, context)); + } + + /** + * Get a Ec2Instance. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the 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 a Ec2Instance along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String resourceUri) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceUri == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceUri is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.get(this.client.getEndpoint(), this.client.getApiVersion(), resourceUri, + accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get a Ec2Instance. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Ec2Instance along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String resourceUri, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceUri == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceUri is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.get(this.client.getEndpoint(), this.client.getApiVersion(), resourceUri, accept, context); + } + + /** + * Get a Ec2Instance. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the 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 a Ec2Instance on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String resourceUri) { + return getWithResponseAsync(resourceUri).flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Get a Ec2Instance. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Ec2Instance along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(String resourceUri, Context context) { + return getWithResponseAsync(resourceUri, context).block(); + } + + /** + * Get a Ec2Instance. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the 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 a Ec2Instance. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Ec2InstanceInner get(String resourceUri) { + return getWithResponse(resourceUri, Context.NONE).getValue(); + } + + /** + * Create a Ec2Instance. Please note that end user resource creation is currently restricted, but it will be enabled + * in the future. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrReplaceWithResponseAsync(String resourceUri, + Ec2InstanceInner resource) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceUri == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceUri is required and cannot be null.")); + } + if (resource == null) { + return Mono.error(new IllegalArgumentException("Parameter resource is required and cannot be null.")); + } else { + resource.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.createOrReplace(this.client.getEndpoint(), this.client.getApiVersion(), + resourceUri, resource, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Create a Ec2Instance. Please note that end user resource creation is currently restricted, but it will be enabled + * in the future. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrReplaceWithResponseAsync(String resourceUri, + Ec2InstanceInner resource, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceUri == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceUri is required and cannot be null.")); + } + if (resource == null) { + return Mono.error(new IllegalArgumentException("Parameter resource is required and cannot be null.")); + } else { + resource.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.createOrReplace(this.client.getEndpoint(), this.client.getApiVersion(), resourceUri, resource, + accept, context); + } + + /** + * Create a Ec2Instance. Please note that end user resource creation is currently restricted, but it will be enabled + * in the future. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Ec2InstanceInner> beginCreateOrReplaceAsync(String resourceUri, + Ec2InstanceInner resource) { + Mono>> mono = createOrReplaceWithResponseAsync(resourceUri, resource); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + Ec2InstanceInner.class, Ec2InstanceInner.class, this.client.getContext()); + } + + /** + * Create a Ec2Instance. Please note that end user resource creation is currently restricted, but it will be enabled + * in the future. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Ec2InstanceInner> beginCreateOrReplaceAsync(String resourceUri, + Ec2InstanceInner resource, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = createOrReplaceWithResponseAsync(resourceUri, resource, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + Ec2InstanceInner.class, Ec2InstanceInner.class, context); + } + + /** + * Create a Ec2Instance. Please note that end user resource creation is currently restricted, but it will be enabled + * in the future. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Ec2InstanceInner> beginCreateOrReplace(String resourceUri, + Ec2InstanceInner resource) { + return this.beginCreateOrReplaceAsync(resourceUri, resource).getSyncPoller(); + } + + /** + * Create a Ec2Instance. Please note that end user resource creation is currently restricted, but it will be enabled + * in the future. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Ec2InstanceInner> beginCreateOrReplace(String resourceUri, + Ec2InstanceInner resource, Context context) { + return this.beginCreateOrReplaceAsync(resourceUri, resource, context).getSyncPoller(); + } + + /** + * Create a Ec2Instance. Please note that end user resource creation is currently restricted, but it will be enabled + * in the future. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrReplaceAsync(String resourceUri, Ec2InstanceInner resource) { + return beginCreateOrReplaceAsync(resourceUri, resource).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create a Ec2Instance. Please note that end user resource creation is currently restricted, but it will be enabled + * in the future. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrReplaceAsync(String resourceUri, Ec2InstanceInner resource, + Context context) { + return beginCreateOrReplaceAsync(resourceUri, resource, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create a Ec2Instance. Please note that end user resource creation is currently restricted, but it will be enabled + * in the future. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Ec2InstanceInner createOrReplace(String resourceUri, Ec2InstanceInner resource) { + return createOrReplaceAsync(resourceUri, resource).block(); + } + + /** + * Create a Ec2Instance. Please note that end user resource creation is currently restricted, but it will be enabled + * in the future. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Ec2InstanceInner createOrReplace(String resourceUri, Ec2InstanceInner resource, Context context) { + return createOrReplaceAsync(resourceUri, resource, context).block(); + } + + /** + * Delete a Ec2Instance. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync(String resourceUri) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceUri == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceUri is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), resourceUri, + accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Delete a Ec2Instance. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync(String resourceUri, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceUri == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceUri is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.delete(this.client.getEndpoint(), this.client.getApiVersion(), resourceUri, accept, context); + } + + /** + * Delete a Ec2Instance. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync(String resourceUri) { + Mono>> mono = deleteWithResponseAsync(resourceUri); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); + } + + /** + * Delete a Ec2Instance. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync(String resourceUri, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = deleteWithResponseAsync(resourceUri, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + context); + } + + /** + * Delete a Ec2Instance. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceUri) { + return this.beginDeleteAsync(resourceUri).getSyncPoller(); + } + + /** + * Delete a Ec2Instance. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceUri, Context context) { + return this.beginDeleteAsync(resourceUri, context).getSyncPoller(); + } + + /** + * Delete a Ec2Instance. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the 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 A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceUri) { + return beginDeleteAsync(resourceUri).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete a Ec2Instance. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceUri, Context context) { + return beginDeleteAsync(resourceUri, context).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete a Ec2Instance. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceUri) { + deleteAsync(resourceUri).block(); + } + + /** + * Delete a Ec2Instance. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceUri, Context context) { + deleteAsync(resourceUri, context).block(); + } + + /** + * A long-running resource action. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the 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 current status of an async operation along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> startWithResponseAsync(String resourceUri) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceUri == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceUri is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.start(this.client.getEndpoint(), this.client.getApiVersion(), resourceUri, + accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * A long-running resource action. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the current status of an async operation along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> startWithResponseAsync(String resourceUri, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceUri == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceUri is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.start(this.client.getEndpoint(), this.client.getApiVersion(), resourceUri, accept, context); + } + + /** + * A long-running resource action. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of the current status of an async operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, OperationStatusResultInner> + beginStartAsync(String resourceUri) { + Mono>> mono = startWithResponseAsync(resourceUri); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), OperationStatusResultInner.class, OperationStatusResultInner.class, + this.client.getContext()); + } + + /** + * A long-running resource action. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of the current status of an async operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, OperationStatusResultInner> + beginStartAsync(String resourceUri, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = startWithResponseAsync(resourceUri, context); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), OperationStatusResultInner.class, OperationStatusResultInner.class, context); + } + + /** + * A long-running resource action. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of the current status of an async operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, OperationStatusResultInner> + beginStart(String resourceUri) { + return this.beginStartAsync(resourceUri).getSyncPoller(); + } + + /** + * A long-running resource action. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of the current status of an async operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, OperationStatusResultInner> beginStart(String resourceUri, + Context context) { + return this.beginStartAsync(resourceUri, context).getSyncPoller(); + } + + /** + * A long-running resource action. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the 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 current status of an async operation on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono startAsync(String resourceUri) { + return beginStartAsync(resourceUri).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * A long-running resource action. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the current status of an async operation on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono startAsync(String resourceUri, Context context) { + return beginStartAsync(resourceUri, context).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * A long-running resource action. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the 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 current status of an async operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public OperationStatusResultInner start(String resourceUri) { + return startAsync(resourceUri).block(); + } + + /** + * A long-running resource action. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the current status of an async operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public OperationStatusResultInner start(String resourceUri, Context context) { + return startAsync(resourceUri, context).block(); + } + + /** + * A long-running resource action. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. + * @param body The content of the action request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the current status of an async operation along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> stopWithResponseAsync(String resourceUri, StopEc2InstanceOptions body) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceUri == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceUri is required and cannot be null.")); + } + if (body == null) { + return Mono.error(new IllegalArgumentException("Parameter body is required and cannot be null.")); + } else { + body.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.stop(this.client.getEndpoint(), this.client.getApiVersion(), resourceUri, + body, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * A long-running resource action. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. + * @param body The content of the action request. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the current status of an async operation along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> stopWithResponseAsync(String resourceUri, StopEc2InstanceOptions body, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceUri == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceUri is required and cannot be null.")); + } + if (body == null) { + return Mono.error(new IllegalArgumentException("Parameter body is required and cannot be null.")); + } else { + body.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.stop(this.client.getEndpoint(), this.client.getApiVersion(), resourceUri, body, accept, context); + } + + /** + * A long-running resource action. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. + * @param body The content of the action request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of the current status of an async operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, OperationStatusResultInner> + beginStopAsync(String resourceUri, StopEc2InstanceOptions body) { + Mono>> mono = stopWithResponseAsync(resourceUri, body); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), OperationStatusResultInner.class, OperationStatusResultInner.class, + this.client.getContext()); + } + + /** + * A long-running resource action. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. + * @param body The content of the action request. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of the current status of an async operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, OperationStatusResultInner> + beginStopAsync(String resourceUri, StopEc2InstanceOptions body, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = stopWithResponseAsync(resourceUri, body, context); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), OperationStatusResultInner.class, OperationStatusResultInner.class, context); + } + + /** + * A long-running resource action. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. + * @param body The content of the action request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of the current status of an async operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, OperationStatusResultInner> beginStop(String resourceUri, + StopEc2InstanceOptions body) { + return this.beginStopAsync(resourceUri, body).getSyncPoller(); + } + + /** + * A long-running resource action. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. + * @param body The content of the action request. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of the current status of an async operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, OperationStatusResultInner> beginStop(String resourceUri, + StopEc2InstanceOptions body, Context context) { + return this.beginStopAsync(resourceUri, body, context).getSyncPoller(); + } + + /** + * A long-running resource action. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. + * @param body The content of the action request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the current status of an async operation on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono stopAsync(String resourceUri, StopEc2InstanceOptions body) { + return beginStopAsync(resourceUri, body).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * A long-running resource action. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. + * @param body The content of the action request. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the current status of an async operation on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono stopAsync(String resourceUri, StopEc2InstanceOptions body, + Context context) { + return beginStopAsync(resourceUri, body, context).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * A long-running resource action. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. + * @param body The content of the action request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the current status of an async operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public OperationStatusResultInner stop(String resourceUri, StopEc2InstanceOptions body) { + return stopAsync(resourceUri, body).block(); + } + + /** + * A long-running resource action. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. + * @param body The content of the action request. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the current status of an async operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public OperationStatusResultInner stop(String resourceUri, StopEc2InstanceOptions body, Context context) { + return stopAsync(resourceUri, body, context).block(); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Ec2Instance list operation along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), + res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Ec2Instance list operation along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/Ec2InstancesImpl.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/Ec2InstancesImpl.java new file mode 100644 index 000000000000..ff0eb610d224 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/Ec2InstancesImpl.java @@ -0,0 +1,131 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.awsconnector.fluent.Ec2InstancesClient; +import com.azure.resourcemanager.awsconnector.fluent.models.Ec2InstanceInner; +import com.azure.resourcemanager.awsconnector.fluent.models.OperationStatusResultInner; +import com.azure.resourcemanager.awsconnector.models.Ec2Instance; +import com.azure.resourcemanager.awsconnector.models.Ec2Instances; +import com.azure.resourcemanager.awsconnector.models.OperationStatusResult; +import com.azure.resourcemanager.awsconnector.models.StopEc2InstanceOptions; + +public final class Ec2InstancesImpl implements Ec2Instances { + private static final ClientLogger LOGGER = new ClientLogger(Ec2InstancesImpl.class); + + private final Ec2InstancesClient innerClient; + + private final com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager; + + public Ec2InstancesImpl(Ec2InstancesClient innerClient, + com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list(String resourceUri) { + PagedIterable inner = this.serviceClient().list(resourceUri); + return ResourceManagerUtils.mapPage(inner, inner1 -> new Ec2InstanceImpl(inner1, this.manager())); + } + + public PagedIterable list(String resourceUri, Context context) { + PagedIterable inner = this.serviceClient().list(resourceUri, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new Ec2InstanceImpl(inner1, this.manager())); + } + + public Response getWithResponse(String resourceUri, Context context) { + Response inner = this.serviceClient().getWithResponse(resourceUri, context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new Ec2InstanceImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public Ec2Instance get(String resourceUri) { + Ec2InstanceInner inner = this.serviceClient().get(resourceUri); + if (inner != null) { + return new Ec2InstanceImpl(inner, this.manager()); + } else { + return null; + } + } + + public Ec2Instance createOrReplace(String resourceUri, Ec2InstanceInner resource) { + Ec2InstanceInner inner = this.serviceClient().createOrReplace(resourceUri, resource); + if (inner != null) { + return new Ec2InstanceImpl(inner, this.manager()); + } else { + return null; + } + } + + public Ec2Instance createOrReplace(String resourceUri, Ec2InstanceInner resource, Context context) { + Ec2InstanceInner inner = this.serviceClient().createOrReplace(resourceUri, resource, context); + if (inner != null) { + return new Ec2InstanceImpl(inner, this.manager()); + } else { + return null; + } + } + + public void delete(String resourceUri) { + this.serviceClient().delete(resourceUri); + } + + public void delete(String resourceUri, Context context) { + this.serviceClient().delete(resourceUri, context); + } + + public OperationStatusResult start(String resourceUri) { + OperationStatusResultInner inner = this.serviceClient().start(resourceUri); + if (inner != null) { + return new OperationStatusResultImpl(inner, this.manager()); + } else { + return null; + } + } + + public OperationStatusResult start(String resourceUri, Context context) { + OperationStatusResultInner inner = this.serviceClient().start(resourceUri, context); + if (inner != null) { + return new OperationStatusResultImpl(inner, this.manager()); + } else { + return null; + } + } + + public OperationStatusResult stop(String resourceUri, StopEc2InstanceOptions body) { + OperationStatusResultInner inner = this.serviceClient().stop(resourceUri, body); + if (inner != null) { + return new OperationStatusResultImpl(inner, this.manager()); + } else { + return null; + } + } + + public OperationStatusResult stop(String resourceUri, StopEc2InstanceOptions body, Context context) { + OperationStatusResultInner inner = this.serviceClient().stop(resourceUri, body, context); + if (inner != null) { + return new OperationStatusResultImpl(inner, this.manager()); + } else { + return null; + } + } + + private Ec2InstancesClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.awsconnector.AwsconnectorManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/Ec2IpamImpl.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/Ec2IpamImpl.java new file mode 100644 index 000000000000..689b1a3c5b39 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/Ec2IpamImpl.java @@ -0,0 +1,175 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.implementation; + +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.awsconnector.fluent.models.Ec2IpamInner; +import com.azure.resourcemanager.awsconnector.models.Ec2Ipam; +import com.azure.resourcemanager.awsconnector.models.Ec2IpamProperties; +import com.azure.resourcemanager.awsconnector.models.Ec2IpamTagsUpdate; +import java.util.Collections; +import java.util.Map; + +public final class Ec2IpamImpl implements Ec2Ipam, Ec2Ipam.Definition, Ec2Ipam.Update { + private Ec2IpamInner innerObject; + + private final com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public String location() { + return this.innerModel().location(); + } + + public Map tags() { + Map inner = this.innerModel().tags(); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } + } + + public Ec2IpamProperties properties() { + return this.innerModel().properties(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public String resourceGroupName() { + return resourceGroupName; + } + + public Ec2IpamInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.awsconnector.AwsconnectorManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String name; + + private Ec2IpamTagsUpdate updateProperties; + + public Ec2IpamImpl withExistingResourceGroup(String resourceGroupName) { + this.resourceGroupName = resourceGroupName; + return this; + } + + public Ec2Ipam create() { + this.innerObject = serviceManager.serviceClient() + .getEc2Ipams() + .createOrReplace(resourceGroupName, name, this.innerModel(), Context.NONE); + return this; + } + + public Ec2Ipam create(Context context) { + this.innerObject = serviceManager.serviceClient() + .getEc2Ipams() + .createOrReplace(resourceGroupName, name, this.innerModel(), context); + return this; + } + + Ec2IpamImpl(String name, com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager) { + this.innerObject = new Ec2IpamInner(); + this.serviceManager = serviceManager; + this.name = name; + } + + public Ec2IpamImpl update() { + this.updateProperties = new Ec2IpamTagsUpdate(); + return this; + } + + public Ec2Ipam apply() { + this.innerObject = serviceManager.serviceClient() + .getEc2Ipams() + .update(resourceGroupName, name, updateProperties, Context.NONE); + return this; + } + + public Ec2Ipam apply(Context context) { + this.innerObject + = serviceManager.serviceClient().getEc2Ipams().update(resourceGroupName, name, updateProperties, context); + return this; + } + + Ec2IpamImpl(Ec2IpamInner innerObject, com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.name = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "ec2Ipams"); + } + + public Ec2Ipam refresh() { + this.innerObject = serviceManager.serviceClient() + .getEc2Ipams() + .getByResourceGroupWithResponse(resourceGroupName, name, Context.NONE) + .getValue(); + return this; + } + + public Ec2Ipam refresh(Context context) { + this.innerObject = serviceManager.serviceClient() + .getEc2Ipams() + .getByResourceGroupWithResponse(resourceGroupName, name, context) + .getValue(); + return this; + } + + public Ec2IpamImpl withRegion(Region location) { + this.innerModel().withLocation(location.toString()); + return this; + } + + public Ec2IpamImpl withRegion(String location) { + this.innerModel().withLocation(location); + return this; + } + + public Ec2IpamImpl withTags(Map tags) { + if (isInCreateMode()) { + this.innerModel().withTags(tags); + return this; + } else { + this.updateProperties.withTags(tags); + return this; + } + } + + public Ec2IpamImpl withProperties(Ec2IpamProperties properties) { + this.innerModel().withProperties(properties); + return this; + } + + private boolean isInCreateMode() { + return this.innerModel().id() == null; + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/Ec2IpamsClientImpl.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/Ec2IpamsClientImpl.java new file mode 100644 index 000000000000..074dd52cef87 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/Ec2IpamsClientImpl.java @@ -0,0 +1,1270 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.Patch; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.awsconnector.fluent.Ec2IpamsClient; +import com.azure.resourcemanager.awsconnector.fluent.models.Ec2IpamInner; +import com.azure.resourcemanager.awsconnector.models.Ec2IpamListResult; +import com.azure.resourcemanager.awsconnector.models.Ec2IpamTagsUpdate; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in Ec2IpamsClient. + */ +public final class Ec2IpamsClientImpl implements Ec2IpamsClient { + /** + * The proxy service used to perform REST calls. + */ + private final Ec2IpamsService service; + + /** + * The service client containing this operation class. + */ + private final MicrosoftAwsConnectorImpl client; + + /** + * Initializes an instance of Ec2IpamsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + Ec2IpamsClientImpl(MicrosoftAwsConnectorImpl client) { + this.service = RestProxy.create(Ec2IpamsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for MicrosoftAwsConnectorEc2Ipams to be used by the proxy service to + * perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "MicrosoftAwsConnecto") + public interface Ec2IpamsService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.AwsConnector/ec2Ipams") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/ec2Ipams") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroup(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/ec2Ipams/{name}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getByResourceGroup(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("name") String name, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/ec2Ipams/{name}") + @ExpectedResponses({ 200, 201 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrReplace(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("name") String name, + @BodyParam("application/json") Ec2IpamInner resource, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/ec2Ipams/{name}") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> update(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("name") String name, + @BodyParam("application/json") Ec2IpamTagsUpdate properties, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/ec2Ipams/{name}") + @ExpectedResponses({ 202, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("name") String name, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listBySubscriptionNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroupNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); + } + + /** + * List Ec2Ipam resources by subscription ID. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Ec2Ipam list operation along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync() { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), + res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List Ec2Ipam resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Ec2Ipam list operation along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), accept, + context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * List Ec2Ipam resources by subscription ID. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Ec2Ipam list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>(() -> listSinglePageAsync(), + nextLink -> listBySubscriptionNextSinglePageAsync(nextLink)); + } + + /** + * List Ec2Ipam resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Ec2Ipam list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(Context context) { + return new PagedFlux<>(() -> listSinglePageAsync(context), + nextLink -> listBySubscriptionNextSinglePageAsync(nextLink, context)); + } + + /** + * List Ec2Ipam resources by subscription ID. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Ec2Ipam list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + return new PagedIterable<>(listAsync()); + } + + /** + * List Ec2Ipam resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Ec2Ipam list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Context context) { + return new PagedIterable<>(listAsync(context)); + } + + /** + * List Ec2Ipam resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Ec2Ipam list operation along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), + res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List Ec2Ipam resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Ec2Ipam list operation along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * List Ec2Ipam resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Ec2Ipam list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName) { + return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); + } + + /** + * List Ec2Ipam resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Ec2Ipam list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName, Context context) { + return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName, context), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink, context)); + } + + /** + * List Ec2Ipam resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Ec2Ipam list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName)); + } + + /** + * List Ec2Ipam resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Ec2Ipam list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, context)); + } + + /** + * Get a Ec2Ipam. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2Ipam. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Ec2Ipam along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync(String resourceGroupName, String name) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.getByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get a Ec2Ipam. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2Ipam. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Ec2Ipam along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync(String resourceGroupName, String name, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.getByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, accept, context); + } + + /** + * Get a Ec2Ipam. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2Ipam. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Ec2Ipam on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getByResourceGroupAsync(String resourceGroupName, String name) { + return getByResourceGroupWithResponseAsync(resourceGroupName, name) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Get a Ec2Ipam. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2Ipam. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Ec2Ipam along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getByResourceGroupWithResponse(String resourceGroupName, String name, + Context context) { + return getByResourceGroupWithResponseAsync(resourceGroupName, name, context).block(); + } + + /** + * Get a Ec2Ipam. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2Ipam. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Ec2Ipam. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Ec2IpamInner getByResourceGroup(String resourceGroupName, String name) { + return getByResourceGroupWithResponse(resourceGroupName, name, Context.NONE).getValue(); + } + + /** + * Create a Ec2Ipam. Please note that end user resource creation is currently restricted, but it will be enabled in + * the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2Ipam. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrReplaceWithResponseAsync(String resourceGroupName, String name, + Ec2IpamInner resource) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (resource == null) { + return Mono.error(new IllegalArgumentException("Parameter resource is required and cannot be null.")); + } else { + resource.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.createOrReplace(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, resource, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Create a Ec2Ipam. Please note that end user resource creation is currently restricted, but it will be enabled in + * the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2Ipam. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrReplaceWithResponseAsync(String resourceGroupName, String name, + Ec2IpamInner resource, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (resource == null) { + return Mono.error(new IllegalArgumentException("Parameter resource is required and cannot be null.")); + } else { + resource.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.createOrReplace(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, resource, accept, context); + } + + /** + * Create a Ec2Ipam. Please note that end user resource creation is currently restricted, but it will be enabled in + * the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2Ipam. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Ec2IpamInner> beginCreateOrReplaceAsync(String resourceGroupName, + String name, Ec2IpamInner resource) { + Mono>> mono = createOrReplaceWithResponseAsync(resourceGroupName, name, resource); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + Ec2IpamInner.class, Ec2IpamInner.class, this.client.getContext()); + } + + /** + * Create a Ec2Ipam. Please note that end user resource creation is currently restricted, but it will be enabled in + * the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2Ipam. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Ec2IpamInner> beginCreateOrReplaceAsync(String resourceGroupName, + String name, Ec2IpamInner resource, Context context) { + context = this.client.mergeContext(context); + Mono>> mono + = createOrReplaceWithResponseAsync(resourceGroupName, name, resource, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + Ec2IpamInner.class, Ec2IpamInner.class, context); + } + + /** + * Create a Ec2Ipam. Please note that end user resource creation is currently restricted, but it will be enabled in + * the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2Ipam. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Ec2IpamInner> beginCreateOrReplace(String resourceGroupName, + String name, Ec2IpamInner resource) { + return this.beginCreateOrReplaceAsync(resourceGroupName, name, resource).getSyncPoller(); + } + + /** + * Create a Ec2Ipam. Please note that end user resource creation is currently restricted, but it will be enabled in + * the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2Ipam. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Ec2IpamInner> beginCreateOrReplace(String resourceGroupName, + String name, Ec2IpamInner resource, Context context) { + return this.beginCreateOrReplaceAsync(resourceGroupName, name, resource, context).getSyncPoller(); + } + + /** + * Create a Ec2Ipam. Please note that end user resource creation is currently restricted, but it will be enabled in + * the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2Ipam. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrReplaceAsync(String resourceGroupName, String name, Ec2IpamInner resource) { + return beginCreateOrReplaceAsync(resourceGroupName, name, resource).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create a Ec2Ipam. Please note that end user resource creation is currently restricted, but it will be enabled in + * the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2Ipam. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrReplaceAsync(String resourceGroupName, String name, Ec2IpamInner resource, + Context context) { + return beginCreateOrReplaceAsync(resourceGroupName, name, resource, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create a Ec2Ipam. Please note that end user resource creation is currently restricted, but it will be enabled in + * the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2Ipam. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Ec2IpamInner createOrReplace(String resourceGroupName, String name, Ec2IpamInner resource) { + return createOrReplaceAsync(resourceGroupName, name, resource).block(); + } + + /** + * Create a Ec2Ipam. Please note that end user resource creation is currently restricted, but it will be enabled in + * the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2Ipam. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Ec2IpamInner createOrReplace(String resourceGroupName, String name, Ec2IpamInner resource, Context context) { + return createOrReplaceAsync(resourceGroupName, name, resource, context).block(); + } + + /** + * Update a Ec2Ipam. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2Ipam. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync(String resourceGroupName, String name, + Ec2IpamTagsUpdate properties) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (properties == null) { + return Mono.error(new IllegalArgumentException("Parameter properties is required and cannot be null.")); + } else { + properties.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.update(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, properties, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Update a Ec2Ipam. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2Ipam. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync(String resourceGroupName, String name, + Ec2IpamTagsUpdate properties, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (properties == null) { + return Mono.error(new IllegalArgumentException("Parameter properties is required and cannot be null.")); + } else { + properties.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.update(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, name, properties, accept, context); + } + + /** + * Update a Ec2Ipam. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2Ipam. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Ec2IpamInner> beginUpdateAsync(String resourceGroupName, String name, + Ec2IpamTagsUpdate properties) { + Mono>> mono = updateWithResponseAsync(resourceGroupName, name, properties); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + Ec2IpamInner.class, Ec2IpamInner.class, this.client.getContext()); + } + + /** + * Update a Ec2Ipam. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2Ipam. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Ec2IpamInner> beginUpdateAsync(String resourceGroupName, String name, + Ec2IpamTagsUpdate properties, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = updateWithResponseAsync(resourceGroupName, name, properties, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + Ec2IpamInner.class, Ec2IpamInner.class, context); + } + + /** + * Update a Ec2Ipam. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2Ipam. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Ec2IpamInner> beginUpdate(String resourceGroupName, String name, + Ec2IpamTagsUpdate properties) { + return this.beginUpdateAsync(resourceGroupName, name, properties).getSyncPoller(); + } + + /** + * Update a Ec2Ipam. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2Ipam. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Ec2IpamInner> beginUpdate(String resourceGroupName, String name, + Ec2IpamTagsUpdate properties, Context context) { + return this.beginUpdateAsync(resourceGroupName, name, properties, context).getSyncPoller(); + } + + /** + * Update a Ec2Ipam. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2Ipam. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync(String resourceGroupName, String name, Ec2IpamTagsUpdate properties) { + return beginUpdateAsync(resourceGroupName, name, properties).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Update a Ec2Ipam. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2Ipam. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync(String resourceGroupName, String name, Ec2IpamTagsUpdate properties, + Context context) { + return beginUpdateAsync(resourceGroupName, name, properties, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Update a Ec2Ipam. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2Ipam. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Ec2IpamInner update(String resourceGroupName, String name, Ec2IpamTagsUpdate properties) { + return updateAsync(resourceGroupName, name, properties).block(); + } + + /** + * Update a Ec2Ipam. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2Ipam. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Ec2IpamInner update(String resourceGroupName, String name, Ec2IpamTagsUpdate properties, Context context) { + return updateAsync(resourceGroupName, name, properties, context).block(); + } + + /** + * Delete a Ec2Ipam. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2Ipam. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync(String resourceGroupName, String name) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Delete a Ec2Ipam. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2Ipam. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync(String resourceGroupName, String name, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.delete(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, name, accept, context); + } + + /** + * Delete a Ec2Ipam. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2Ipam. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String name) { + Mono>> mono = deleteWithResponseAsync(resourceGroupName, name); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); + } + + /** + * Delete a Ec2Ipam. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2Ipam. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String name, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = deleteWithResponseAsync(resourceGroupName, name, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + context); + } + + /** + * Delete a Ec2Ipam. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2Ipam. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String name) { + return this.beginDeleteAsync(resourceGroupName, name).getSyncPoller(); + } + + /** + * Delete a Ec2Ipam. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2Ipam. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String name, Context context) { + return this.beginDeleteAsync(resourceGroupName, name, context).getSyncPoller(); + } + + /** + * Delete a Ec2Ipam. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2Ipam. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String name) { + return beginDeleteAsync(resourceGroupName, name).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete a Ec2Ipam. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2Ipam. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String name, Context context) { + return beginDeleteAsync(resourceGroupName, name, context).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete a Ec2Ipam. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2Ipam. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String name) { + deleteAsync(resourceGroupName, name).block(); + } + + /** + * Delete a Ec2Ipam. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2Ipam. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String name, Context context) { + deleteAsync(resourceGroupName, name, context).block(); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Ec2Ipam list operation along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listBySubscriptionNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), + res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Ec2Ipam list operation along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listBySubscriptionNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Ec2Ipam list operation along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), + res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Ec2Ipam list operation along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/Ec2IpamsImpl.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/Ec2IpamsImpl.java new file mode 100644 index 000000000000..9512979fa560 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/Ec2IpamsImpl.java @@ -0,0 +1,145 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.awsconnector.fluent.Ec2IpamsClient; +import com.azure.resourcemanager.awsconnector.fluent.models.Ec2IpamInner; +import com.azure.resourcemanager.awsconnector.models.Ec2Ipam; +import com.azure.resourcemanager.awsconnector.models.Ec2Ipams; + +public final class Ec2IpamsImpl implements Ec2Ipams { + private static final ClientLogger LOGGER = new ClientLogger(Ec2IpamsImpl.class); + + private final Ec2IpamsClient innerClient; + + private final com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager; + + public Ec2IpamsImpl(Ec2IpamsClient innerClient, + com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return ResourceManagerUtils.mapPage(inner, inner1 -> new Ec2IpamImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new Ec2IpamImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName); + return ResourceManagerUtils.mapPage(inner, inner1 -> new Ec2IpamImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new Ec2IpamImpl(inner1, this.manager())); + } + + public Response getByResourceGroupWithResponse(String resourceGroupName, String name, Context context) { + Response inner + = this.serviceClient().getByResourceGroupWithResponse(resourceGroupName, name, context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new Ec2IpamImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public Ec2Ipam getByResourceGroup(String resourceGroupName, String name) { + Ec2IpamInner inner = this.serviceClient().getByResourceGroup(resourceGroupName, name); + if (inner != null) { + return new Ec2IpamImpl(inner, this.manager()); + } else { + return null; + } + } + + public void deleteByResourceGroup(String resourceGroupName, String name) { + this.serviceClient().delete(resourceGroupName, name); + } + + public void delete(String resourceGroupName, String name, Context context) { + this.serviceClient().delete(resourceGroupName, name, context); + } + + public Ec2Ipam getById(String id) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String name = ResourceManagerUtils.getValueFromIdByName(id, "ec2Ipams"); + if (name == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'ec2Ipams'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, name, Context.NONE).getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String name = ResourceManagerUtils.getValueFromIdByName(id, "ec2Ipams"); + if (name == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'ec2Ipams'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, name, context); + } + + public void deleteById(String id) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String name = ResourceManagerUtils.getValueFromIdByName(id, "ec2Ipams"); + if (name == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'ec2Ipams'.", id))); + } + this.delete(resourceGroupName, name, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String name = ResourceManagerUtils.getValueFromIdByName(id, "ec2Ipams"); + if (name == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'ec2Ipams'.", id))); + } + this.delete(resourceGroupName, name, context); + } + + private Ec2IpamsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.awsconnector.AwsconnectorManager manager() { + return this.serviceManager; + } + + public Ec2IpamImpl define(String name) { + return new Ec2IpamImpl(name, this.manager()); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/Ec2KeyPairImpl.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/Ec2KeyPairImpl.java new file mode 100644 index 000000000000..8eb105d163de --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/Ec2KeyPairImpl.java @@ -0,0 +1,177 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.implementation; + +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.awsconnector.fluent.models.Ec2KeyPairInner; +import com.azure.resourcemanager.awsconnector.models.Ec2KeyPair; +import com.azure.resourcemanager.awsconnector.models.Ec2KeyPairProperties; +import com.azure.resourcemanager.awsconnector.models.Ec2KeyPairTagsUpdate; +import java.util.Collections; +import java.util.Map; + +public final class Ec2KeyPairImpl implements Ec2KeyPair, Ec2KeyPair.Definition, Ec2KeyPair.Update { + private Ec2KeyPairInner innerObject; + + private final com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public String location() { + return this.innerModel().location(); + } + + public Map tags() { + Map inner = this.innerModel().tags(); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } + } + + public Ec2KeyPairProperties properties() { + return this.innerModel().properties(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public String resourceGroupName() { + return resourceGroupName; + } + + public Ec2KeyPairInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.awsconnector.AwsconnectorManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String name; + + private Ec2KeyPairTagsUpdate updateProperties; + + public Ec2KeyPairImpl withExistingResourceGroup(String resourceGroupName) { + this.resourceGroupName = resourceGroupName; + return this; + } + + public Ec2KeyPair create() { + this.innerObject = serviceManager.serviceClient() + .getEc2KeyPairs() + .createOrReplace(resourceGroupName, name, this.innerModel(), Context.NONE); + return this; + } + + public Ec2KeyPair create(Context context) { + this.innerObject = serviceManager.serviceClient() + .getEc2KeyPairs() + .createOrReplace(resourceGroupName, name, this.innerModel(), context); + return this; + } + + Ec2KeyPairImpl(String name, com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager) { + this.innerObject = new Ec2KeyPairInner(); + this.serviceManager = serviceManager; + this.name = name; + } + + public Ec2KeyPairImpl update() { + this.updateProperties = new Ec2KeyPairTagsUpdate(); + return this; + } + + public Ec2KeyPair apply() { + this.innerObject = serviceManager.serviceClient() + .getEc2KeyPairs() + .update(resourceGroupName, name, updateProperties, Context.NONE); + return this; + } + + public Ec2KeyPair apply(Context context) { + this.innerObject = serviceManager.serviceClient() + .getEc2KeyPairs() + .update(resourceGroupName, name, updateProperties, context); + return this; + } + + Ec2KeyPairImpl(Ec2KeyPairInner innerObject, + com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.name = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "ec2KeyPairs"); + } + + public Ec2KeyPair refresh() { + this.innerObject = serviceManager.serviceClient() + .getEc2KeyPairs() + .getByResourceGroupWithResponse(resourceGroupName, name, Context.NONE) + .getValue(); + return this; + } + + public Ec2KeyPair refresh(Context context) { + this.innerObject = serviceManager.serviceClient() + .getEc2KeyPairs() + .getByResourceGroupWithResponse(resourceGroupName, name, context) + .getValue(); + return this; + } + + public Ec2KeyPairImpl withRegion(Region location) { + this.innerModel().withLocation(location.toString()); + return this; + } + + public Ec2KeyPairImpl withRegion(String location) { + this.innerModel().withLocation(location); + return this; + } + + public Ec2KeyPairImpl withTags(Map tags) { + if (isInCreateMode()) { + this.innerModel().withTags(tags); + return this; + } else { + this.updateProperties.withTags(tags); + return this; + } + } + + public Ec2KeyPairImpl withProperties(Ec2KeyPairProperties properties) { + this.innerModel().withProperties(properties); + return this; + } + + private boolean isInCreateMode() { + return this.innerModel().id() == null; + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/Ec2KeyPairsClientImpl.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/Ec2KeyPairsClientImpl.java new file mode 100644 index 000000000000..e96e3c07c466 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/Ec2KeyPairsClientImpl.java @@ -0,0 +1,1276 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.Patch; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.awsconnector.fluent.Ec2KeyPairsClient; +import com.azure.resourcemanager.awsconnector.fluent.models.Ec2KeyPairInner; +import com.azure.resourcemanager.awsconnector.models.Ec2KeyPairListResult; +import com.azure.resourcemanager.awsconnector.models.Ec2KeyPairTagsUpdate; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in Ec2KeyPairsClient. + */ +public final class Ec2KeyPairsClientImpl implements Ec2KeyPairsClient { + /** + * The proxy service used to perform REST calls. + */ + private final Ec2KeyPairsService service; + + /** + * The service client containing this operation class. + */ + private final MicrosoftAwsConnectorImpl client; + + /** + * Initializes an instance of Ec2KeyPairsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + Ec2KeyPairsClientImpl(MicrosoftAwsConnectorImpl client) { + this.service + = RestProxy.create(Ec2KeyPairsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for MicrosoftAwsConnectorEc2KeyPairs to be used by the proxy service to + * perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "MicrosoftAwsConnecto") + public interface Ec2KeyPairsService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.AwsConnector/ec2KeyPairs") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/ec2KeyPairs") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroup(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/ec2KeyPairs/{name}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getByResourceGroup(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("name") String name, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/ec2KeyPairs/{name}") + @ExpectedResponses({ 200, 201 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrReplace(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("name") String name, + @BodyParam("application/json") Ec2KeyPairInner resource, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/ec2KeyPairs/{name}") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> update(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("name") String name, + @BodyParam("application/json") Ec2KeyPairTagsUpdate properties, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/ec2KeyPairs/{name}") + @ExpectedResponses({ 202, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("name") String name, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listBySubscriptionNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroupNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); + } + + /** + * List Ec2KeyPair resources by subscription ID. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Ec2KeyPair list operation along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync() { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), + res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List Ec2KeyPair resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Ec2KeyPair list operation along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), accept, + context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * List Ec2KeyPair resources by subscription ID. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Ec2KeyPair list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>(() -> listSinglePageAsync(), + nextLink -> listBySubscriptionNextSinglePageAsync(nextLink)); + } + + /** + * List Ec2KeyPair resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Ec2KeyPair list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(Context context) { + return new PagedFlux<>(() -> listSinglePageAsync(context), + nextLink -> listBySubscriptionNextSinglePageAsync(nextLink, context)); + } + + /** + * List Ec2KeyPair resources by subscription ID. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Ec2KeyPair list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + return new PagedIterable<>(listAsync()); + } + + /** + * List Ec2KeyPair resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Ec2KeyPair list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Context context) { + return new PagedIterable<>(listAsync(context)); + } + + /** + * List Ec2KeyPair resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Ec2KeyPair list operation along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), + res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List Ec2KeyPair resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Ec2KeyPair list operation along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * List Ec2KeyPair resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Ec2KeyPair list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName) { + return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); + } + + /** + * List Ec2KeyPair resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Ec2KeyPair list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName, Context context) { + return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName, context), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink, context)); + } + + /** + * List Ec2KeyPair resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Ec2KeyPair list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName)); + } + + /** + * List Ec2KeyPair resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Ec2KeyPair list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, context)); + } + + /** + * Get a Ec2KeyPair. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2KeyPair. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Ec2KeyPair along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync(String resourceGroupName, String name) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.getByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get a Ec2KeyPair. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2KeyPair. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Ec2KeyPair along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync(String resourceGroupName, String name, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.getByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, accept, context); + } + + /** + * Get a Ec2KeyPair. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2KeyPair. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Ec2KeyPair on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getByResourceGroupAsync(String resourceGroupName, String name) { + return getByResourceGroupWithResponseAsync(resourceGroupName, name) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Get a Ec2KeyPair. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2KeyPair. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Ec2KeyPair along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getByResourceGroupWithResponse(String resourceGroupName, String name, + Context context) { + return getByResourceGroupWithResponseAsync(resourceGroupName, name, context).block(); + } + + /** + * Get a Ec2KeyPair. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2KeyPair. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Ec2KeyPair. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Ec2KeyPairInner getByResourceGroup(String resourceGroupName, String name) { + return getByResourceGroupWithResponse(resourceGroupName, name, Context.NONE).getValue(); + } + + /** + * Create a Ec2KeyPair. Please note that end user resource creation is currently restricted, but it will be enabled + * in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2KeyPair. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrReplaceWithResponseAsync(String resourceGroupName, String name, + Ec2KeyPairInner resource) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (resource == null) { + return Mono.error(new IllegalArgumentException("Parameter resource is required and cannot be null.")); + } else { + resource.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.createOrReplace(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, resource, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Create a Ec2KeyPair. Please note that end user resource creation is currently restricted, but it will be enabled + * in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2KeyPair. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrReplaceWithResponseAsync(String resourceGroupName, String name, + Ec2KeyPairInner resource, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (resource == null) { + return Mono.error(new IllegalArgumentException("Parameter resource is required and cannot be null.")); + } else { + resource.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.createOrReplace(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, resource, accept, context); + } + + /** + * Create a Ec2KeyPair. Please note that end user resource creation is currently restricted, but it will be enabled + * in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2KeyPair. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Ec2KeyPairInner> beginCreateOrReplaceAsync(String resourceGroupName, + String name, Ec2KeyPairInner resource) { + Mono>> mono = createOrReplaceWithResponseAsync(resourceGroupName, name, resource); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + Ec2KeyPairInner.class, Ec2KeyPairInner.class, this.client.getContext()); + } + + /** + * Create a Ec2KeyPair. Please note that end user resource creation is currently restricted, but it will be enabled + * in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2KeyPair. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Ec2KeyPairInner> beginCreateOrReplaceAsync(String resourceGroupName, + String name, Ec2KeyPairInner resource, Context context) { + context = this.client.mergeContext(context); + Mono>> mono + = createOrReplaceWithResponseAsync(resourceGroupName, name, resource, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + Ec2KeyPairInner.class, Ec2KeyPairInner.class, context); + } + + /** + * Create a Ec2KeyPair. Please note that end user resource creation is currently restricted, but it will be enabled + * in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2KeyPair. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Ec2KeyPairInner> beginCreateOrReplace(String resourceGroupName, + String name, Ec2KeyPairInner resource) { + return this.beginCreateOrReplaceAsync(resourceGroupName, name, resource).getSyncPoller(); + } + + /** + * Create a Ec2KeyPair. Please note that end user resource creation is currently restricted, but it will be enabled + * in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2KeyPair. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Ec2KeyPairInner> beginCreateOrReplace(String resourceGroupName, + String name, Ec2KeyPairInner resource, Context context) { + return this.beginCreateOrReplaceAsync(resourceGroupName, name, resource, context).getSyncPoller(); + } + + /** + * Create a Ec2KeyPair. Please note that end user resource creation is currently restricted, but it will be enabled + * in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2KeyPair. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrReplaceAsync(String resourceGroupName, String name, + Ec2KeyPairInner resource) { + return beginCreateOrReplaceAsync(resourceGroupName, name, resource).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create a Ec2KeyPair. Please note that end user resource creation is currently restricted, but it will be enabled + * in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2KeyPair. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrReplaceAsync(String resourceGroupName, String name, Ec2KeyPairInner resource, + Context context) { + return beginCreateOrReplaceAsync(resourceGroupName, name, resource, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create a Ec2KeyPair. Please note that end user resource creation is currently restricted, but it will be enabled + * in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2KeyPair. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Ec2KeyPairInner createOrReplace(String resourceGroupName, String name, Ec2KeyPairInner resource) { + return createOrReplaceAsync(resourceGroupName, name, resource).block(); + } + + /** + * Create a Ec2KeyPair. Please note that end user resource creation is currently restricted, but it will be enabled + * in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2KeyPair. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Ec2KeyPairInner createOrReplace(String resourceGroupName, String name, Ec2KeyPairInner resource, + Context context) { + return createOrReplaceAsync(resourceGroupName, name, resource, context).block(); + } + + /** + * Update a Ec2KeyPair. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2KeyPair. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync(String resourceGroupName, String name, + Ec2KeyPairTagsUpdate properties) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (properties == null) { + return Mono.error(new IllegalArgumentException("Parameter properties is required and cannot be null.")); + } else { + properties.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.update(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, properties, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Update a Ec2KeyPair. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2KeyPair. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync(String resourceGroupName, String name, + Ec2KeyPairTagsUpdate properties, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (properties == null) { + return Mono.error(new IllegalArgumentException("Parameter properties is required and cannot be null.")); + } else { + properties.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.update(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, name, properties, accept, context); + } + + /** + * Update a Ec2KeyPair. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2KeyPair. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Ec2KeyPairInner> beginUpdateAsync(String resourceGroupName, + String name, Ec2KeyPairTagsUpdate properties) { + Mono>> mono = updateWithResponseAsync(resourceGroupName, name, properties); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + Ec2KeyPairInner.class, Ec2KeyPairInner.class, this.client.getContext()); + } + + /** + * Update a Ec2KeyPair. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2KeyPair. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Ec2KeyPairInner> beginUpdateAsync(String resourceGroupName, + String name, Ec2KeyPairTagsUpdate properties, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = updateWithResponseAsync(resourceGroupName, name, properties, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + Ec2KeyPairInner.class, Ec2KeyPairInner.class, context); + } + + /** + * Update a Ec2KeyPair. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2KeyPair. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Ec2KeyPairInner> beginUpdate(String resourceGroupName, String name, + Ec2KeyPairTagsUpdate properties) { + return this.beginUpdateAsync(resourceGroupName, name, properties).getSyncPoller(); + } + + /** + * Update a Ec2KeyPair. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2KeyPair. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Ec2KeyPairInner> beginUpdate(String resourceGroupName, String name, + Ec2KeyPairTagsUpdate properties, Context context) { + return this.beginUpdateAsync(resourceGroupName, name, properties, context).getSyncPoller(); + } + + /** + * Update a Ec2KeyPair. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2KeyPair. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync(String resourceGroupName, String name, Ec2KeyPairTagsUpdate properties) { + return beginUpdateAsync(resourceGroupName, name, properties).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Update a Ec2KeyPair. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2KeyPair. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync(String resourceGroupName, String name, Ec2KeyPairTagsUpdate properties, + Context context) { + return beginUpdateAsync(resourceGroupName, name, properties, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Update a Ec2KeyPair. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2KeyPair. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Ec2KeyPairInner update(String resourceGroupName, String name, Ec2KeyPairTagsUpdate properties) { + return updateAsync(resourceGroupName, name, properties).block(); + } + + /** + * Update a Ec2KeyPair. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2KeyPair. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Ec2KeyPairInner update(String resourceGroupName, String name, Ec2KeyPairTagsUpdate properties, + Context context) { + return updateAsync(resourceGroupName, name, properties, context).block(); + } + + /** + * Delete a Ec2KeyPair. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2KeyPair. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync(String resourceGroupName, String name) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Delete a Ec2KeyPair. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2KeyPair. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync(String resourceGroupName, String name, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.delete(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, name, accept, context); + } + + /** + * Delete a Ec2KeyPair. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2KeyPair. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String name) { + Mono>> mono = deleteWithResponseAsync(resourceGroupName, name); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); + } + + /** + * Delete a Ec2KeyPair. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2KeyPair. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String name, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = deleteWithResponseAsync(resourceGroupName, name, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + context); + } + + /** + * Delete a Ec2KeyPair. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2KeyPair. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String name) { + return this.beginDeleteAsync(resourceGroupName, name).getSyncPoller(); + } + + /** + * Delete a Ec2KeyPair. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2KeyPair. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String name, Context context) { + return this.beginDeleteAsync(resourceGroupName, name, context).getSyncPoller(); + } + + /** + * Delete a Ec2KeyPair. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2KeyPair. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String name) { + return beginDeleteAsync(resourceGroupName, name).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete a Ec2KeyPair. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2KeyPair. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String name, Context context) { + return beginDeleteAsync(resourceGroupName, name, context).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete a Ec2KeyPair. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2KeyPair. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String name) { + deleteAsync(resourceGroupName, name).block(); + } + + /** + * Delete a Ec2KeyPair. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2KeyPair. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String name, Context context) { + deleteAsync(resourceGroupName, name, context).block(); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Ec2KeyPair list operation along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listBySubscriptionNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), + res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Ec2KeyPair list operation along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listBySubscriptionNextSinglePageAsync(String nextLink, + Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Ec2KeyPair list operation along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), + res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Ec2KeyPair list operation along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupNextSinglePageAsync(String nextLink, + Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/Ec2KeyPairsImpl.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/Ec2KeyPairsImpl.java new file mode 100644 index 000000000000..8645d35ad622 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/Ec2KeyPairsImpl.java @@ -0,0 +1,145 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.awsconnector.fluent.Ec2KeyPairsClient; +import com.azure.resourcemanager.awsconnector.fluent.models.Ec2KeyPairInner; +import com.azure.resourcemanager.awsconnector.models.Ec2KeyPair; +import com.azure.resourcemanager.awsconnector.models.Ec2KeyPairs; + +public final class Ec2KeyPairsImpl implements Ec2KeyPairs { + private static final ClientLogger LOGGER = new ClientLogger(Ec2KeyPairsImpl.class); + + private final Ec2KeyPairsClient innerClient; + + private final com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager; + + public Ec2KeyPairsImpl(Ec2KeyPairsClient innerClient, + com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return ResourceManagerUtils.mapPage(inner, inner1 -> new Ec2KeyPairImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new Ec2KeyPairImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName); + return ResourceManagerUtils.mapPage(inner, inner1 -> new Ec2KeyPairImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new Ec2KeyPairImpl(inner1, this.manager())); + } + + public Response getByResourceGroupWithResponse(String resourceGroupName, String name, Context context) { + Response inner + = this.serviceClient().getByResourceGroupWithResponse(resourceGroupName, name, context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new Ec2KeyPairImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public Ec2KeyPair getByResourceGroup(String resourceGroupName, String name) { + Ec2KeyPairInner inner = this.serviceClient().getByResourceGroup(resourceGroupName, name); + if (inner != null) { + return new Ec2KeyPairImpl(inner, this.manager()); + } else { + return null; + } + } + + public void deleteByResourceGroup(String resourceGroupName, String name) { + this.serviceClient().delete(resourceGroupName, name); + } + + public void delete(String resourceGroupName, String name, Context context) { + this.serviceClient().delete(resourceGroupName, name, context); + } + + public Ec2KeyPair getById(String id) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String name = ResourceManagerUtils.getValueFromIdByName(id, "ec2KeyPairs"); + if (name == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'ec2KeyPairs'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, name, Context.NONE).getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String name = ResourceManagerUtils.getValueFromIdByName(id, "ec2KeyPairs"); + if (name == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'ec2KeyPairs'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, name, context); + } + + public void deleteById(String id) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String name = ResourceManagerUtils.getValueFromIdByName(id, "ec2KeyPairs"); + if (name == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'ec2KeyPairs'.", id))); + } + this.delete(resourceGroupName, name, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String name = ResourceManagerUtils.getValueFromIdByName(id, "ec2KeyPairs"); + if (name == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'ec2KeyPairs'.", id))); + } + this.delete(resourceGroupName, name, context); + } + + private Ec2KeyPairsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.awsconnector.AwsconnectorManager manager() { + return this.serviceManager; + } + + public Ec2KeyPairImpl define(String name) { + return new Ec2KeyPairImpl(name, this.manager()); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/Ec2NetworkAclImpl.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/Ec2NetworkAclImpl.java new file mode 100644 index 000000000000..627c1898b755 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/Ec2NetworkAclImpl.java @@ -0,0 +1,177 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.implementation; + +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.awsconnector.fluent.models.Ec2NetworkAclInner; +import com.azure.resourcemanager.awsconnector.models.Ec2NetworkAcl; +import com.azure.resourcemanager.awsconnector.models.Ec2NetworkAclProperties; +import com.azure.resourcemanager.awsconnector.models.Ec2NetworkAclTagsUpdate; +import java.util.Collections; +import java.util.Map; + +public final class Ec2NetworkAclImpl implements Ec2NetworkAcl, Ec2NetworkAcl.Definition, Ec2NetworkAcl.Update { + private Ec2NetworkAclInner innerObject; + + private final com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public String location() { + return this.innerModel().location(); + } + + public Map tags() { + Map inner = this.innerModel().tags(); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } + } + + public Ec2NetworkAclProperties properties() { + return this.innerModel().properties(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public String resourceGroupName() { + return resourceGroupName; + } + + public Ec2NetworkAclInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.awsconnector.AwsconnectorManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String name; + + private Ec2NetworkAclTagsUpdate updateProperties; + + public Ec2NetworkAclImpl withExistingResourceGroup(String resourceGroupName) { + this.resourceGroupName = resourceGroupName; + return this; + } + + public Ec2NetworkAcl create() { + this.innerObject = serviceManager.serviceClient() + .getEc2NetworkAcls() + .createOrReplace(resourceGroupName, name, this.innerModel(), Context.NONE); + return this; + } + + public Ec2NetworkAcl create(Context context) { + this.innerObject = serviceManager.serviceClient() + .getEc2NetworkAcls() + .createOrReplace(resourceGroupName, name, this.innerModel(), context); + return this; + } + + Ec2NetworkAclImpl(String name, com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager) { + this.innerObject = new Ec2NetworkAclInner(); + this.serviceManager = serviceManager; + this.name = name; + } + + public Ec2NetworkAclImpl update() { + this.updateProperties = new Ec2NetworkAclTagsUpdate(); + return this; + } + + public Ec2NetworkAcl apply() { + this.innerObject = serviceManager.serviceClient() + .getEc2NetworkAcls() + .update(resourceGroupName, name, updateProperties, Context.NONE); + return this; + } + + public Ec2NetworkAcl apply(Context context) { + this.innerObject = serviceManager.serviceClient() + .getEc2NetworkAcls() + .update(resourceGroupName, name, updateProperties, context); + return this; + } + + Ec2NetworkAclImpl(Ec2NetworkAclInner innerObject, + com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.name = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "ec2NetworkAcls"); + } + + public Ec2NetworkAcl refresh() { + this.innerObject = serviceManager.serviceClient() + .getEc2NetworkAcls() + .getByResourceGroupWithResponse(resourceGroupName, name, Context.NONE) + .getValue(); + return this; + } + + public Ec2NetworkAcl refresh(Context context) { + this.innerObject = serviceManager.serviceClient() + .getEc2NetworkAcls() + .getByResourceGroupWithResponse(resourceGroupName, name, context) + .getValue(); + return this; + } + + public Ec2NetworkAclImpl withRegion(Region location) { + this.innerModel().withLocation(location.toString()); + return this; + } + + public Ec2NetworkAclImpl withRegion(String location) { + this.innerModel().withLocation(location); + return this; + } + + public Ec2NetworkAclImpl withTags(Map tags) { + if (isInCreateMode()) { + this.innerModel().withTags(tags); + return this; + } else { + this.updateProperties.withTags(tags); + return this; + } + } + + public Ec2NetworkAclImpl withProperties(Ec2NetworkAclProperties properties) { + this.innerModel().withProperties(properties); + return this; + } + + private boolean isInCreateMode() { + return this.innerModel().id() == null; + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/Ec2NetworkAclsClientImpl.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/Ec2NetworkAclsClientImpl.java new file mode 100644 index 000000000000..39f7ee165a32 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/Ec2NetworkAclsClientImpl.java @@ -0,0 +1,1278 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.Patch; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.awsconnector.fluent.Ec2NetworkAclsClient; +import com.azure.resourcemanager.awsconnector.fluent.models.Ec2NetworkAclInner; +import com.azure.resourcemanager.awsconnector.models.Ec2NetworkAclListResult; +import com.azure.resourcemanager.awsconnector.models.Ec2NetworkAclTagsUpdate; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in Ec2NetworkAclsClient. + */ +public final class Ec2NetworkAclsClientImpl implements Ec2NetworkAclsClient { + /** + * The proxy service used to perform REST calls. + */ + private final Ec2NetworkAclsService service; + + /** + * The service client containing this operation class. + */ + private final MicrosoftAwsConnectorImpl client; + + /** + * Initializes an instance of Ec2NetworkAclsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + Ec2NetworkAclsClientImpl(MicrosoftAwsConnectorImpl client) { + this.service + = RestProxy.create(Ec2NetworkAclsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for MicrosoftAwsConnectorEc2NetworkAcls to be used by the proxy service + * to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "MicrosoftAwsConnecto") + public interface Ec2NetworkAclsService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.AwsConnector/ec2NetworkAcls") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/ec2NetworkAcls") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroup(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/ec2NetworkAcls/{name}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getByResourceGroup(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("name") String name, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/ec2NetworkAcls/{name}") + @ExpectedResponses({ 200, 201 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrReplace(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("name") String name, + @BodyParam("application/json") Ec2NetworkAclInner resource, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/ec2NetworkAcls/{name}") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> update(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("name") String name, + @BodyParam("application/json") Ec2NetworkAclTagsUpdate properties, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/ec2NetworkAcls/{name}") + @ExpectedResponses({ 202, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("name") String name, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listBySubscriptionNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroupNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); + } + + /** + * List Ec2NetworkAcl resources by subscription ID. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Ec2NetworkAcl list operation along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync() { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List Ec2NetworkAcl resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Ec2NetworkAcl list operation along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), accept, + context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * List Ec2NetworkAcl resources by subscription ID. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Ec2NetworkAcl list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>(() -> listSinglePageAsync(), + nextLink -> listBySubscriptionNextSinglePageAsync(nextLink)); + } + + /** + * List Ec2NetworkAcl resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Ec2NetworkAcl list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(Context context) { + return new PagedFlux<>(() -> listSinglePageAsync(context), + nextLink -> listBySubscriptionNextSinglePageAsync(nextLink, context)); + } + + /** + * List Ec2NetworkAcl resources by subscription ID. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Ec2NetworkAcl list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + return new PagedIterable<>(listAsync()); + } + + /** + * List Ec2NetworkAcl resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Ec2NetworkAcl list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Context context) { + return new PagedIterable<>(listAsync(context)); + } + + /** + * List Ec2NetworkAcl resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Ec2NetworkAcl list operation along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List Ec2NetworkAcl resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Ec2NetworkAcl list operation along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * List Ec2NetworkAcl resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Ec2NetworkAcl list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName) { + return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); + } + + /** + * List Ec2NetworkAcl resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Ec2NetworkAcl list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName, Context context) { + return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName, context), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink, context)); + } + + /** + * List Ec2NetworkAcl resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Ec2NetworkAcl list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName)); + } + + /** + * List Ec2NetworkAcl resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Ec2NetworkAcl list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, context)); + } + + /** + * Get a Ec2NetworkAcl. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2NetworkAcl. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Ec2NetworkAcl along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync(String resourceGroupName, + String name) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.getByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get a Ec2NetworkAcl. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2NetworkAcl. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Ec2NetworkAcl along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync(String resourceGroupName, + String name, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.getByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, accept, context); + } + + /** + * Get a Ec2NetworkAcl. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2NetworkAcl. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Ec2NetworkAcl on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getByResourceGroupAsync(String resourceGroupName, String name) { + return getByResourceGroupWithResponseAsync(resourceGroupName, name) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Get a Ec2NetworkAcl. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2NetworkAcl. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Ec2NetworkAcl along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getByResourceGroupWithResponse(String resourceGroupName, String name, + Context context) { + return getByResourceGroupWithResponseAsync(resourceGroupName, name, context).block(); + } + + /** + * Get a Ec2NetworkAcl. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2NetworkAcl. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Ec2NetworkAcl. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Ec2NetworkAclInner getByResourceGroup(String resourceGroupName, String name) { + return getByResourceGroupWithResponse(resourceGroupName, name, Context.NONE).getValue(); + } + + /** + * Create a Ec2NetworkAcl. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2NetworkAcl. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrReplaceWithResponseAsync(String resourceGroupName, String name, + Ec2NetworkAclInner resource) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (resource == null) { + return Mono.error(new IllegalArgumentException("Parameter resource is required and cannot be null.")); + } else { + resource.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.createOrReplace(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, resource, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Create a Ec2NetworkAcl. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2NetworkAcl. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrReplaceWithResponseAsync(String resourceGroupName, String name, + Ec2NetworkAclInner resource, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (resource == null) { + return Mono.error(new IllegalArgumentException("Parameter resource is required and cannot be null.")); + } else { + resource.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.createOrReplace(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, resource, accept, context); + } + + /** + * Create a Ec2NetworkAcl. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2NetworkAcl. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Ec2NetworkAclInner> + beginCreateOrReplaceAsync(String resourceGroupName, String name, Ec2NetworkAclInner resource) { + Mono>> mono = createOrReplaceWithResponseAsync(resourceGroupName, name, resource); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + Ec2NetworkAclInner.class, Ec2NetworkAclInner.class, this.client.getContext()); + } + + /** + * Create a Ec2NetworkAcl. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2NetworkAcl. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Ec2NetworkAclInner> + beginCreateOrReplaceAsync(String resourceGroupName, String name, Ec2NetworkAclInner resource, Context context) { + context = this.client.mergeContext(context); + Mono>> mono + = createOrReplaceWithResponseAsync(resourceGroupName, name, resource, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + Ec2NetworkAclInner.class, Ec2NetworkAclInner.class, context); + } + + /** + * Create a Ec2NetworkAcl. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2NetworkAcl. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Ec2NetworkAclInner> beginCreateOrReplace(String resourceGroupName, + String name, Ec2NetworkAclInner resource) { + return this.beginCreateOrReplaceAsync(resourceGroupName, name, resource).getSyncPoller(); + } + + /** + * Create a Ec2NetworkAcl. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2NetworkAcl. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Ec2NetworkAclInner> beginCreateOrReplace(String resourceGroupName, + String name, Ec2NetworkAclInner resource, Context context) { + return this.beginCreateOrReplaceAsync(resourceGroupName, name, resource, context).getSyncPoller(); + } + + /** + * Create a Ec2NetworkAcl. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2NetworkAcl. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrReplaceAsync(String resourceGroupName, String name, + Ec2NetworkAclInner resource) { + return beginCreateOrReplaceAsync(resourceGroupName, name, resource).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create a Ec2NetworkAcl. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2NetworkAcl. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrReplaceAsync(String resourceGroupName, String name, + Ec2NetworkAclInner resource, Context context) { + return beginCreateOrReplaceAsync(resourceGroupName, name, resource, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create a Ec2NetworkAcl. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2NetworkAcl. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Ec2NetworkAclInner createOrReplace(String resourceGroupName, String name, Ec2NetworkAclInner resource) { + return createOrReplaceAsync(resourceGroupName, name, resource).block(); + } + + /** + * Create a Ec2NetworkAcl. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2NetworkAcl. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Ec2NetworkAclInner createOrReplace(String resourceGroupName, String name, Ec2NetworkAclInner resource, + Context context) { + return createOrReplaceAsync(resourceGroupName, name, resource, context).block(); + } + + /** + * Update a Ec2NetworkAcl. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2NetworkAcl. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync(String resourceGroupName, String name, + Ec2NetworkAclTagsUpdate properties) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (properties == null) { + return Mono.error(new IllegalArgumentException("Parameter properties is required and cannot be null.")); + } else { + properties.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.update(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, properties, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Update a Ec2NetworkAcl. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2NetworkAcl. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync(String resourceGroupName, String name, + Ec2NetworkAclTagsUpdate properties, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (properties == null) { + return Mono.error(new IllegalArgumentException("Parameter properties is required and cannot be null.")); + } else { + properties.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.update(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, name, properties, accept, context); + } + + /** + * Update a Ec2NetworkAcl. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2NetworkAcl. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Ec2NetworkAclInner> beginUpdateAsync(String resourceGroupName, + String name, Ec2NetworkAclTagsUpdate properties) { + Mono>> mono = updateWithResponseAsync(resourceGroupName, name, properties); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + Ec2NetworkAclInner.class, Ec2NetworkAclInner.class, this.client.getContext()); + } + + /** + * Update a Ec2NetworkAcl. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2NetworkAcl. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Ec2NetworkAclInner> beginUpdateAsync(String resourceGroupName, + String name, Ec2NetworkAclTagsUpdate properties, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = updateWithResponseAsync(resourceGroupName, name, properties, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + Ec2NetworkAclInner.class, Ec2NetworkAclInner.class, context); + } + + /** + * Update a Ec2NetworkAcl. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2NetworkAcl. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Ec2NetworkAclInner> beginUpdate(String resourceGroupName, + String name, Ec2NetworkAclTagsUpdate properties) { + return this.beginUpdateAsync(resourceGroupName, name, properties).getSyncPoller(); + } + + /** + * Update a Ec2NetworkAcl. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2NetworkAcl. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Ec2NetworkAclInner> beginUpdate(String resourceGroupName, + String name, Ec2NetworkAclTagsUpdate properties, Context context) { + return this.beginUpdateAsync(resourceGroupName, name, properties, context).getSyncPoller(); + } + + /** + * Update a Ec2NetworkAcl. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2NetworkAcl. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync(String resourceGroupName, String name, + Ec2NetworkAclTagsUpdate properties) { + return beginUpdateAsync(resourceGroupName, name, properties).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Update a Ec2NetworkAcl. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2NetworkAcl. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync(String resourceGroupName, String name, + Ec2NetworkAclTagsUpdate properties, Context context) { + return beginUpdateAsync(resourceGroupName, name, properties, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Update a Ec2NetworkAcl. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2NetworkAcl. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Ec2NetworkAclInner update(String resourceGroupName, String name, Ec2NetworkAclTagsUpdate properties) { + return updateAsync(resourceGroupName, name, properties).block(); + } + + /** + * Update a Ec2NetworkAcl. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2NetworkAcl. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Ec2NetworkAclInner update(String resourceGroupName, String name, Ec2NetworkAclTagsUpdate properties, + Context context) { + return updateAsync(resourceGroupName, name, properties, context).block(); + } + + /** + * Delete a Ec2NetworkAcl. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2NetworkAcl. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync(String resourceGroupName, String name) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Delete a Ec2NetworkAcl. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2NetworkAcl. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync(String resourceGroupName, String name, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.delete(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, name, accept, context); + } + + /** + * Delete a Ec2NetworkAcl. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2NetworkAcl. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String name) { + Mono>> mono = deleteWithResponseAsync(resourceGroupName, name); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); + } + + /** + * Delete a Ec2NetworkAcl. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2NetworkAcl. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String name, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = deleteWithResponseAsync(resourceGroupName, name, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + context); + } + + /** + * Delete a Ec2NetworkAcl. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2NetworkAcl. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String name) { + return this.beginDeleteAsync(resourceGroupName, name).getSyncPoller(); + } + + /** + * Delete a Ec2NetworkAcl. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2NetworkAcl. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String name, Context context) { + return this.beginDeleteAsync(resourceGroupName, name, context).getSyncPoller(); + } + + /** + * Delete a Ec2NetworkAcl. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2NetworkAcl. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String name) { + return beginDeleteAsync(resourceGroupName, name).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete a Ec2NetworkAcl. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2NetworkAcl. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String name, Context context) { + return beginDeleteAsync(resourceGroupName, name, context).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete a Ec2NetworkAcl. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2NetworkAcl. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String name) { + deleteAsync(resourceGroupName, name).block(); + } + + /** + * Delete a Ec2NetworkAcl. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2NetworkAcl. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String name, Context context) { + deleteAsync(resourceGroupName, name, context).block(); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Ec2NetworkAcl list operation along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listBySubscriptionNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Ec2NetworkAcl list operation along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listBySubscriptionNextSinglePageAsync(String nextLink, + Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Ec2NetworkAcl list operation along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Ec2NetworkAcl list operation along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupNextSinglePageAsync(String nextLink, + Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/Ec2NetworkAclsImpl.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/Ec2NetworkAclsImpl.java new file mode 100644 index 000000000000..1ef6834747f0 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/Ec2NetworkAclsImpl.java @@ -0,0 +1,146 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.awsconnector.fluent.Ec2NetworkAclsClient; +import com.azure.resourcemanager.awsconnector.fluent.models.Ec2NetworkAclInner; +import com.azure.resourcemanager.awsconnector.models.Ec2NetworkAcl; +import com.azure.resourcemanager.awsconnector.models.Ec2NetworkAcls; + +public final class Ec2NetworkAclsImpl implements Ec2NetworkAcls { + private static final ClientLogger LOGGER = new ClientLogger(Ec2NetworkAclsImpl.class); + + private final Ec2NetworkAclsClient innerClient; + + private final com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager; + + public Ec2NetworkAclsImpl(Ec2NetworkAclsClient innerClient, + com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return ResourceManagerUtils.mapPage(inner, inner1 -> new Ec2NetworkAclImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new Ec2NetworkAclImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName); + return ResourceManagerUtils.mapPage(inner, inner1 -> new Ec2NetworkAclImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new Ec2NetworkAclImpl(inner1, this.manager())); + } + + public Response getByResourceGroupWithResponse(String resourceGroupName, String name, + Context context) { + Response inner + = this.serviceClient().getByResourceGroupWithResponse(resourceGroupName, name, context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new Ec2NetworkAclImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public Ec2NetworkAcl getByResourceGroup(String resourceGroupName, String name) { + Ec2NetworkAclInner inner = this.serviceClient().getByResourceGroup(resourceGroupName, name); + if (inner != null) { + return new Ec2NetworkAclImpl(inner, this.manager()); + } else { + return null; + } + } + + public void deleteByResourceGroup(String resourceGroupName, String name) { + this.serviceClient().delete(resourceGroupName, name); + } + + public void delete(String resourceGroupName, String name, Context context) { + this.serviceClient().delete(resourceGroupName, name, context); + } + + public Ec2NetworkAcl getById(String id) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String name = ResourceManagerUtils.getValueFromIdByName(id, "ec2NetworkAcls"); + if (name == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'ec2NetworkAcls'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, name, Context.NONE).getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String name = ResourceManagerUtils.getValueFromIdByName(id, "ec2NetworkAcls"); + if (name == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'ec2NetworkAcls'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, name, context); + } + + public void deleteById(String id) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String name = ResourceManagerUtils.getValueFromIdByName(id, "ec2NetworkAcls"); + if (name == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'ec2NetworkAcls'.", id))); + } + this.delete(resourceGroupName, name, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String name = ResourceManagerUtils.getValueFromIdByName(id, "ec2NetworkAcls"); + if (name == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'ec2NetworkAcls'.", id))); + } + this.delete(resourceGroupName, name, context); + } + + private Ec2NetworkAclsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.awsconnector.AwsconnectorManager manager() { + return this.serviceManager; + } + + public Ec2NetworkAclImpl define(String name) { + return new Ec2NetworkAclImpl(name, this.manager()); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/Ec2NetworkInterfaceImpl.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/Ec2NetworkInterfaceImpl.java new file mode 100644 index 000000000000..003f6c1750a9 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/Ec2NetworkInterfaceImpl.java @@ -0,0 +1,178 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.implementation; + +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.awsconnector.fluent.models.Ec2NetworkInterfaceInner; +import com.azure.resourcemanager.awsconnector.models.Ec2NetworkInterface; +import com.azure.resourcemanager.awsconnector.models.Ec2NetworkInterfaceProperties; +import com.azure.resourcemanager.awsconnector.models.Ec2NetworkInterfaceTagsUpdate; +import java.util.Collections; +import java.util.Map; + +public final class Ec2NetworkInterfaceImpl + implements Ec2NetworkInterface, Ec2NetworkInterface.Definition, Ec2NetworkInterface.Update { + private Ec2NetworkInterfaceInner innerObject; + + private final com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public String location() { + return this.innerModel().location(); + } + + public Map tags() { + Map inner = this.innerModel().tags(); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } + } + + public Ec2NetworkInterfaceProperties properties() { + return this.innerModel().properties(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public String resourceGroupName() { + return resourceGroupName; + } + + public Ec2NetworkInterfaceInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.awsconnector.AwsconnectorManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String name; + + private Ec2NetworkInterfaceTagsUpdate updateProperties; + + public Ec2NetworkInterfaceImpl withExistingResourceGroup(String resourceGroupName) { + this.resourceGroupName = resourceGroupName; + return this; + } + + public Ec2NetworkInterface create() { + this.innerObject = serviceManager.serviceClient() + .getEc2NetworkInterfaces() + .createOrReplace(resourceGroupName, name, this.innerModel(), Context.NONE); + return this; + } + + public Ec2NetworkInterface create(Context context) { + this.innerObject = serviceManager.serviceClient() + .getEc2NetworkInterfaces() + .createOrReplace(resourceGroupName, name, this.innerModel(), context); + return this; + } + + Ec2NetworkInterfaceImpl(String name, com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager) { + this.innerObject = new Ec2NetworkInterfaceInner(); + this.serviceManager = serviceManager; + this.name = name; + } + + public Ec2NetworkInterfaceImpl update() { + this.updateProperties = new Ec2NetworkInterfaceTagsUpdate(); + return this; + } + + public Ec2NetworkInterface apply() { + this.innerObject = serviceManager.serviceClient() + .getEc2NetworkInterfaces() + .update(resourceGroupName, name, updateProperties, Context.NONE); + return this; + } + + public Ec2NetworkInterface apply(Context context) { + this.innerObject = serviceManager.serviceClient() + .getEc2NetworkInterfaces() + .update(resourceGroupName, name, updateProperties, context); + return this; + } + + Ec2NetworkInterfaceImpl(Ec2NetworkInterfaceInner innerObject, + com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.name = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "ec2NetworkInterfaces"); + } + + public Ec2NetworkInterface refresh() { + this.innerObject = serviceManager.serviceClient() + .getEc2NetworkInterfaces() + .getByResourceGroupWithResponse(resourceGroupName, name, Context.NONE) + .getValue(); + return this; + } + + public Ec2NetworkInterface refresh(Context context) { + this.innerObject = serviceManager.serviceClient() + .getEc2NetworkInterfaces() + .getByResourceGroupWithResponse(resourceGroupName, name, context) + .getValue(); + return this; + } + + public Ec2NetworkInterfaceImpl withRegion(Region location) { + this.innerModel().withLocation(location.toString()); + return this; + } + + public Ec2NetworkInterfaceImpl withRegion(String location) { + this.innerModel().withLocation(location); + return this; + } + + public Ec2NetworkInterfaceImpl withTags(Map tags) { + if (isInCreateMode()) { + this.innerModel().withTags(tags); + return this; + } else { + this.updateProperties.withTags(tags); + return this; + } + } + + public Ec2NetworkInterfaceImpl withProperties(Ec2NetworkInterfaceProperties properties) { + this.innerModel().withProperties(properties); + return this; + } + + private boolean isInCreateMode() { + return this.innerModel().id() == null; + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/Ec2NetworkInterfacesClientImpl.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/Ec2NetworkInterfacesClientImpl.java new file mode 100644 index 000000000000..29cf7a022372 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/Ec2NetworkInterfacesClientImpl.java @@ -0,0 +1,1282 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.Patch; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.awsconnector.fluent.Ec2NetworkInterfacesClient; +import com.azure.resourcemanager.awsconnector.fluent.models.Ec2NetworkInterfaceInner; +import com.azure.resourcemanager.awsconnector.models.Ec2NetworkInterfaceListResult; +import com.azure.resourcemanager.awsconnector.models.Ec2NetworkInterfaceTagsUpdate; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in Ec2NetworkInterfacesClient. + */ +public final class Ec2NetworkInterfacesClientImpl implements Ec2NetworkInterfacesClient { + /** + * The proxy service used to perform REST calls. + */ + private final Ec2NetworkInterfacesService service; + + /** + * The service client containing this operation class. + */ + private final MicrosoftAwsConnectorImpl client; + + /** + * Initializes an instance of Ec2NetworkInterfacesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + Ec2NetworkInterfacesClientImpl(MicrosoftAwsConnectorImpl client) { + this.service = RestProxy.create(Ec2NetworkInterfacesService.class, client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for MicrosoftAwsConnectorEc2NetworkInterfaces to be used by the proxy + * service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "MicrosoftAwsConnecto") + public interface Ec2NetworkInterfacesService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.AwsConnector/ec2NetworkInterfaces") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/ec2NetworkInterfaces") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroup(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/ec2NetworkInterfaces/{name}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getByResourceGroup(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("name") String name, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/ec2NetworkInterfaces/{name}") + @ExpectedResponses({ 200, 201 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrReplace(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("name") String name, + @BodyParam("application/json") Ec2NetworkInterfaceInner resource, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/ec2NetworkInterfaces/{name}") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> update(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("name") String name, + @BodyParam("application/json") Ec2NetworkInterfaceTagsUpdate properties, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/ec2NetworkInterfaces/{name}") + @ExpectedResponses({ 202, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("name") String name, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listBySubscriptionNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroupNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); + } + + /** + * List Ec2NetworkInterface resources by subscription ID. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Ec2NetworkInterface list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync() { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List Ec2NetworkInterface resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Ec2NetworkInterface list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), accept, + context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * List Ec2NetworkInterface resources by subscription ID. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Ec2NetworkInterface list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>(() -> listSinglePageAsync(), + nextLink -> listBySubscriptionNextSinglePageAsync(nextLink)); + } + + /** + * List Ec2NetworkInterface resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Ec2NetworkInterface list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(Context context) { + return new PagedFlux<>(() -> listSinglePageAsync(context), + nextLink -> listBySubscriptionNextSinglePageAsync(nextLink, context)); + } + + /** + * List Ec2NetworkInterface resources by subscription ID. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Ec2NetworkInterface list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + return new PagedIterable<>(listAsync()); + } + + /** + * List Ec2NetworkInterface resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Ec2NetworkInterface list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Context context) { + return new PagedIterable<>(listAsync(context)); + } + + /** + * List Ec2NetworkInterface resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Ec2NetworkInterface list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List Ec2NetworkInterface resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Ec2NetworkInterface list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * List Ec2NetworkInterface resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Ec2NetworkInterface list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName) { + return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); + } + + /** + * List Ec2NetworkInterface resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Ec2NetworkInterface list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName, Context context) { + return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName, context), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink, context)); + } + + /** + * List Ec2NetworkInterface resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Ec2NetworkInterface list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName)); + } + + /** + * List Ec2NetworkInterface resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Ec2NetworkInterface list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, context)); + } + + /** + * Get a Ec2NetworkInterface. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2NetworkInterface. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Ec2NetworkInterface along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync(String resourceGroupName, + String name) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.getByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get a Ec2NetworkInterface. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2NetworkInterface. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Ec2NetworkInterface along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync(String resourceGroupName, + String name, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.getByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, accept, context); + } + + /** + * Get a Ec2NetworkInterface. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2NetworkInterface. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Ec2NetworkInterface on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getByResourceGroupAsync(String resourceGroupName, String name) { + return getByResourceGroupWithResponseAsync(resourceGroupName, name) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Get a Ec2NetworkInterface. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2NetworkInterface. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Ec2NetworkInterface along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getByResourceGroupWithResponse(String resourceGroupName, String name, + Context context) { + return getByResourceGroupWithResponseAsync(resourceGroupName, name, context).block(); + } + + /** + * Get a Ec2NetworkInterface. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2NetworkInterface. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Ec2NetworkInterface. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Ec2NetworkInterfaceInner getByResourceGroup(String resourceGroupName, String name) { + return getByResourceGroupWithResponse(resourceGroupName, name, Context.NONE).getValue(); + } + + /** + * Create a Ec2NetworkInterface. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2NetworkInterface. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrReplaceWithResponseAsync(String resourceGroupName, String name, + Ec2NetworkInterfaceInner resource) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (resource == null) { + return Mono.error(new IllegalArgumentException("Parameter resource is required and cannot be null.")); + } else { + resource.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.createOrReplace(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, resource, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Create a Ec2NetworkInterface. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2NetworkInterface. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrReplaceWithResponseAsync(String resourceGroupName, String name, + Ec2NetworkInterfaceInner resource, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (resource == null) { + return Mono.error(new IllegalArgumentException("Parameter resource is required and cannot be null.")); + } else { + resource.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.createOrReplace(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, resource, accept, context); + } + + /** + * Create a Ec2NetworkInterface. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2NetworkInterface. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Ec2NetworkInterfaceInner> + beginCreateOrReplaceAsync(String resourceGroupName, String name, Ec2NetworkInterfaceInner resource) { + Mono>> mono = createOrReplaceWithResponseAsync(resourceGroupName, name, resource); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), Ec2NetworkInterfaceInner.class, Ec2NetworkInterfaceInner.class, + this.client.getContext()); + } + + /** + * Create a Ec2NetworkInterface. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2NetworkInterface. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Ec2NetworkInterfaceInner> beginCreateOrReplaceAsync( + String resourceGroupName, String name, Ec2NetworkInterfaceInner resource, Context context) { + context = this.client.mergeContext(context); + Mono>> mono + = createOrReplaceWithResponseAsync(resourceGroupName, name, resource, context); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), Ec2NetworkInterfaceInner.class, Ec2NetworkInterfaceInner.class, context); + } + + /** + * Create a Ec2NetworkInterface. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2NetworkInterface. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Ec2NetworkInterfaceInner> + beginCreateOrReplace(String resourceGroupName, String name, Ec2NetworkInterfaceInner resource) { + return this.beginCreateOrReplaceAsync(resourceGroupName, name, resource).getSyncPoller(); + } + + /** + * Create a Ec2NetworkInterface. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2NetworkInterface. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Ec2NetworkInterfaceInner> beginCreateOrReplace( + String resourceGroupName, String name, Ec2NetworkInterfaceInner resource, Context context) { + return this.beginCreateOrReplaceAsync(resourceGroupName, name, resource, context).getSyncPoller(); + } + + /** + * Create a Ec2NetworkInterface. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2NetworkInterface. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrReplaceAsync(String resourceGroupName, String name, + Ec2NetworkInterfaceInner resource) { + return beginCreateOrReplaceAsync(resourceGroupName, name, resource).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create a Ec2NetworkInterface. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2NetworkInterface. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrReplaceAsync(String resourceGroupName, String name, + Ec2NetworkInterfaceInner resource, Context context) { + return beginCreateOrReplaceAsync(resourceGroupName, name, resource, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create a Ec2NetworkInterface. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2NetworkInterface. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Ec2NetworkInterfaceInner createOrReplace(String resourceGroupName, String name, + Ec2NetworkInterfaceInner resource) { + return createOrReplaceAsync(resourceGroupName, name, resource).block(); + } + + /** + * Create a Ec2NetworkInterface. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2NetworkInterface. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Ec2NetworkInterfaceInner createOrReplace(String resourceGroupName, String name, + Ec2NetworkInterfaceInner resource, Context context) { + return createOrReplaceAsync(resourceGroupName, name, resource, context).block(); + } + + /** + * Update a Ec2NetworkInterface. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2NetworkInterface. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync(String resourceGroupName, String name, + Ec2NetworkInterfaceTagsUpdate properties) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (properties == null) { + return Mono.error(new IllegalArgumentException("Parameter properties is required and cannot be null.")); + } else { + properties.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.update(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, properties, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Update a Ec2NetworkInterface. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2NetworkInterface. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync(String resourceGroupName, String name, + Ec2NetworkInterfaceTagsUpdate properties, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (properties == null) { + return Mono.error(new IllegalArgumentException("Parameter properties is required and cannot be null.")); + } else { + properties.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.update(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, name, properties, accept, context); + } + + /** + * Update a Ec2NetworkInterface. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2NetworkInterface. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Ec2NetworkInterfaceInner> + beginUpdateAsync(String resourceGroupName, String name, Ec2NetworkInterfaceTagsUpdate properties) { + Mono>> mono = updateWithResponseAsync(resourceGroupName, name, properties); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), Ec2NetworkInterfaceInner.class, Ec2NetworkInterfaceInner.class, + this.client.getContext()); + } + + /** + * Update a Ec2NetworkInterface. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2NetworkInterface. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Ec2NetworkInterfaceInner> beginUpdateAsync( + String resourceGroupName, String name, Ec2NetworkInterfaceTagsUpdate properties, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = updateWithResponseAsync(resourceGroupName, name, properties, context); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), Ec2NetworkInterfaceInner.class, Ec2NetworkInterfaceInner.class, context); + } + + /** + * Update a Ec2NetworkInterface. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2NetworkInterface. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Ec2NetworkInterfaceInner> + beginUpdate(String resourceGroupName, String name, Ec2NetworkInterfaceTagsUpdate properties) { + return this.beginUpdateAsync(resourceGroupName, name, properties).getSyncPoller(); + } + + /** + * Update a Ec2NetworkInterface. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2NetworkInterface. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Ec2NetworkInterfaceInner> + beginUpdate(String resourceGroupName, String name, Ec2NetworkInterfaceTagsUpdate properties, Context context) { + return this.beginUpdateAsync(resourceGroupName, name, properties, context).getSyncPoller(); + } + + /** + * Update a Ec2NetworkInterface. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2NetworkInterface. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync(String resourceGroupName, String name, + Ec2NetworkInterfaceTagsUpdate properties) { + return beginUpdateAsync(resourceGroupName, name, properties).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Update a Ec2NetworkInterface. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2NetworkInterface. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync(String resourceGroupName, String name, + Ec2NetworkInterfaceTagsUpdate properties, Context context) { + return beginUpdateAsync(resourceGroupName, name, properties, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Update a Ec2NetworkInterface. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2NetworkInterface. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Ec2NetworkInterfaceInner update(String resourceGroupName, String name, + Ec2NetworkInterfaceTagsUpdate properties) { + return updateAsync(resourceGroupName, name, properties).block(); + } + + /** + * Update a Ec2NetworkInterface. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2NetworkInterface. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Ec2NetworkInterfaceInner update(String resourceGroupName, String name, + Ec2NetworkInterfaceTagsUpdate properties, Context context) { + return updateAsync(resourceGroupName, name, properties, context).block(); + } + + /** + * Delete a Ec2NetworkInterface. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2NetworkInterface. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync(String resourceGroupName, String name) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Delete a Ec2NetworkInterface. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2NetworkInterface. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync(String resourceGroupName, String name, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.delete(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, name, accept, context); + } + + /** + * Delete a Ec2NetworkInterface. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2NetworkInterface. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String name) { + Mono>> mono = deleteWithResponseAsync(resourceGroupName, name); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); + } + + /** + * Delete a Ec2NetworkInterface. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2NetworkInterface. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String name, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = deleteWithResponseAsync(resourceGroupName, name, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + context); + } + + /** + * Delete a Ec2NetworkInterface. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2NetworkInterface. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String name) { + return this.beginDeleteAsync(resourceGroupName, name).getSyncPoller(); + } + + /** + * Delete a Ec2NetworkInterface. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2NetworkInterface. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String name, Context context) { + return this.beginDeleteAsync(resourceGroupName, name, context).getSyncPoller(); + } + + /** + * Delete a Ec2NetworkInterface. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2NetworkInterface. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String name) { + return beginDeleteAsync(resourceGroupName, name).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete a Ec2NetworkInterface. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2NetworkInterface. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String name, Context context) { + return beginDeleteAsync(resourceGroupName, name, context).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete a Ec2NetworkInterface. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2NetworkInterface. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String name) { + deleteAsync(resourceGroupName, name).block(); + } + + /** + * Delete a Ec2NetworkInterface. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2NetworkInterface. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String name, Context context) { + deleteAsync(resourceGroupName, name, context).block(); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Ec2NetworkInterface list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listBySubscriptionNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Ec2NetworkInterface list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listBySubscriptionNextSinglePageAsync(String nextLink, + Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Ec2NetworkInterface list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Ec2NetworkInterface list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupNextSinglePageAsync(String nextLink, + Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/Ec2NetworkInterfacesImpl.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/Ec2NetworkInterfacesImpl.java new file mode 100644 index 000000000000..3849cb7383e7 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/Ec2NetworkInterfacesImpl.java @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.awsconnector.fluent.Ec2NetworkInterfacesClient; +import com.azure.resourcemanager.awsconnector.fluent.models.Ec2NetworkInterfaceInner; +import com.azure.resourcemanager.awsconnector.models.Ec2NetworkInterface; +import com.azure.resourcemanager.awsconnector.models.Ec2NetworkInterfaces; + +public final class Ec2NetworkInterfacesImpl implements Ec2NetworkInterfaces { + private static final ClientLogger LOGGER = new ClientLogger(Ec2NetworkInterfacesImpl.class); + + private final Ec2NetworkInterfacesClient innerClient; + + private final com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager; + + public Ec2NetworkInterfacesImpl(Ec2NetworkInterfacesClient innerClient, + com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return ResourceManagerUtils.mapPage(inner, inner1 -> new Ec2NetworkInterfaceImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new Ec2NetworkInterfaceImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName); + return ResourceManagerUtils.mapPage(inner, inner1 -> new Ec2NetworkInterfaceImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + PagedIterable inner + = this.serviceClient().listByResourceGroup(resourceGroupName, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new Ec2NetworkInterfaceImpl(inner1, this.manager())); + } + + public Response getByResourceGroupWithResponse(String resourceGroupName, String name, + Context context) { + Response inner + = this.serviceClient().getByResourceGroupWithResponse(resourceGroupName, name, context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new Ec2NetworkInterfaceImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public Ec2NetworkInterface getByResourceGroup(String resourceGroupName, String name) { + Ec2NetworkInterfaceInner inner = this.serviceClient().getByResourceGroup(resourceGroupName, name); + if (inner != null) { + return new Ec2NetworkInterfaceImpl(inner, this.manager()); + } else { + return null; + } + } + + public void deleteByResourceGroup(String resourceGroupName, String name) { + this.serviceClient().delete(resourceGroupName, name); + } + + public void delete(String resourceGroupName, String name, Context context) { + this.serviceClient().delete(resourceGroupName, name, context); + } + + public Ec2NetworkInterface getById(String id) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String name = ResourceManagerUtils.getValueFromIdByName(id, "ec2NetworkInterfaces"); + if (name == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'ec2NetworkInterfaces'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, name, Context.NONE).getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String name = ResourceManagerUtils.getValueFromIdByName(id, "ec2NetworkInterfaces"); + if (name == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'ec2NetworkInterfaces'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, name, context); + } + + public void deleteById(String id) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String name = ResourceManagerUtils.getValueFromIdByName(id, "ec2NetworkInterfaces"); + if (name == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'ec2NetworkInterfaces'.", id))); + } + this.delete(resourceGroupName, name, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String name = ResourceManagerUtils.getValueFromIdByName(id, "ec2NetworkInterfaces"); + if (name == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'ec2NetworkInterfaces'.", id))); + } + this.delete(resourceGroupName, name, context); + } + + private Ec2NetworkInterfacesClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.awsconnector.AwsconnectorManager manager() { + return this.serviceManager; + } + + public Ec2NetworkInterfaceImpl define(String name) { + return new Ec2NetworkInterfaceImpl(name, this.manager()); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/Ec2RouteTableImpl.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/Ec2RouteTableImpl.java new file mode 100644 index 000000000000..add6f1351570 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/Ec2RouteTableImpl.java @@ -0,0 +1,177 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.implementation; + +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.awsconnector.fluent.models.Ec2RouteTableInner; +import com.azure.resourcemanager.awsconnector.models.Ec2RouteTable; +import com.azure.resourcemanager.awsconnector.models.Ec2RouteTableProperties; +import com.azure.resourcemanager.awsconnector.models.Ec2RouteTableTagsUpdate; +import java.util.Collections; +import java.util.Map; + +public final class Ec2RouteTableImpl implements Ec2RouteTable, Ec2RouteTable.Definition, Ec2RouteTable.Update { + private Ec2RouteTableInner innerObject; + + private final com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public String location() { + return this.innerModel().location(); + } + + public Map tags() { + Map inner = this.innerModel().tags(); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } + } + + public Ec2RouteTableProperties properties() { + return this.innerModel().properties(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public String resourceGroupName() { + return resourceGroupName; + } + + public Ec2RouteTableInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.awsconnector.AwsconnectorManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String name; + + private Ec2RouteTableTagsUpdate updateProperties; + + public Ec2RouteTableImpl withExistingResourceGroup(String resourceGroupName) { + this.resourceGroupName = resourceGroupName; + return this; + } + + public Ec2RouteTable create() { + this.innerObject = serviceManager.serviceClient() + .getEc2RouteTables() + .createOrReplace(resourceGroupName, name, this.innerModel(), Context.NONE); + return this; + } + + public Ec2RouteTable create(Context context) { + this.innerObject = serviceManager.serviceClient() + .getEc2RouteTables() + .createOrReplace(resourceGroupName, name, this.innerModel(), context); + return this; + } + + Ec2RouteTableImpl(String name, com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager) { + this.innerObject = new Ec2RouteTableInner(); + this.serviceManager = serviceManager; + this.name = name; + } + + public Ec2RouteTableImpl update() { + this.updateProperties = new Ec2RouteTableTagsUpdate(); + return this; + } + + public Ec2RouteTable apply() { + this.innerObject = serviceManager.serviceClient() + .getEc2RouteTables() + .update(resourceGroupName, name, updateProperties, Context.NONE); + return this; + } + + public Ec2RouteTable apply(Context context) { + this.innerObject = serviceManager.serviceClient() + .getEc2RouteTables() + .update(resourceGroupName, name, updateProperties, context); + return this; + } + + Ec2RouteTableImpl(Ec2RouteTableInner innerObject, + com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.name = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "ec2RouteTables"); + } + + public Ec2RouteTable refresh() { + this.innerObject = serviceManager.serviceClient() + .getEc2RouteTables() + .getByResourceGroupWithResponse(resourceGroupName, name, Context.NONE) + .getValue(); + return this; + } + + public Ec2RouteTable refresh(Context context) { + this.innerObject = serviceManager.serviceClient() + .getEc2RouteTables() + .getByResourceGroupWithResponse(resourceGroupName, name, context) + .getValue(); + return this; + } + + public Ec2RouteTableImpl withRegion(Region location) { + this.innerModel().withLocation(location.toString()); + return this; + } + + public Ec2RouteTableImpl withRegion(String location) { + this.innerModel().withLocation(location); + return this; + } + + public Ec2RouteTableImpl withTags(Map tags) { + if (isInCreateMode()) { + this.innerModel().withTags(tags); + return this; + } else { + this.updateProperties.withTags(tags); + return this; + } + } + + public Ec2RouteTableImpl withProperties(Ec2RouteTableProperties properties) { + this.innerModel().withProperties(properties); + return this; + } + + private boolean isInCreateMode() { + return this.innerModel().id() == null; + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/Ec2RouteTablesClientImpl.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/Ec2RouteTablesClientImpl.java new file mode 100644 index 000000000000..46decd7af926 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/Ec2RouteTablesClientImpl.java @@ -0,0 +1,1278 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.Patch; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.awsconnector.fluent.Ec2RouteTablesClient; +import com.azure.resourcemanager.awsconnector.fluent.models.Ec2RouteTableInner; +import com.azure.resourcemanager.awsconnector.models.Ec2RouteTableListResult; +import com.azure.resourcemanager.awsconnector.models.Ec2RouteTableTagsUpdate; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in Ec2RouteTablesClient. + */ +public final class Ec2RouteTablesClientImpl implements Ec2RouteTablesClient { + /** + * The proxy service used to perform REST calls. + */ + private final Ec2RouteTablesService service; + + /** + * The service client containing this operation class. + */ + private final MicrosoftAwsConnectorImpl client; + + /** + * Initializes an instance of Ec2RouteTablesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + Ec2RouteTablesClientImpl(MicrosoftAwsConnectorImpl client) { + this.service + = RestProxy.create(Ec2RouteTablesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for MicrosoftAwsConnectorEc2RouteTables to be used by the proxy service + * to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "MicrosoftAwsConnecto") + public interface Ec2RouteTablesService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.AwsConnector/ec2RouteTables") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/ec2RouteTables") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroup(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/ec2RouteTables/{name}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getByResourceGroup(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("name") String name, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/ec2RouteTables/{name}") + @ExpectedResponses({ 200, 201 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrReplace(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("name") String name, + @BodyParam("application/json") Ec2RouteTableInner resource, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/ec2RouteTables/{name}") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> update(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("name") String name, + @BodyParam("application/json") Ec2RouteTableTagsUpdate properties, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/ec2RouteTables/{name}") + @ExpectedResponses({ 202, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("name") String name, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listBySubscriptionNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroupNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); + } + + /** + * List Ec2RouteTable resources by subscription ID. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Ec2RouteTable list operation along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync() { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List Ec2RouteTable resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Ec2RouteTable list operation along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), accept, + context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * List Ec2RouteTable resources by subscription ID. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Ec2RouteTable list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>(() -> listSinglePageAsync(), + nextLink -> listBySubscriptionNextSinglePageAsync(nextLink)); + } + + /** + * List Ec2RouteTable resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Ec2RouteTable list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(Context context) { + return new PagedFlux<>(() -> listSinglePageAsync(context), + nextLink -> listBySubscriptionNextSinglePageAsync(nextLink, context)); + } + + /** + * List Ec2RouteTable resources by subscription ID. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Ec2RouteTable list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + return new PagedIterable<>(listAsync()); + } + + /** + * List Ec2RouteTable resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Ec2RouteTable list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Context context) { + return new PagedIterable<>(listAsync(context)); + } + + /** + * List Ec2RouteTable resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Ec2RouteTable list operation along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List Ec2RouteTable resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Ec2RouteTable list operation along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * List Ec2RouteTable resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Ec2RouteTable list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName) { + return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); + } + + /** + * List Ec2RouteTable resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Ec2RouteTable list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName, Context context) { + return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName, context), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink, context)); + } + + /** + * List Ec2RouteTable resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Ec2RouteTable list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName)); + } + + /** + * List Ec2RouteTable resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Ec2RouteTable list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, context)); + } + + /** + * Get a Ec2RouteTable. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2RouteTable. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Ec2RouteTable along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync(String resourceGroupName, + String name) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.getByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get a Ec2RouteTable. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2RouteTable. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Ec2RouteTable along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync(String resourceGroupName, + String name, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.getByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, accept, context); + } + + /** + * Get a Ec2RouteTable. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2RouteTable. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Ec2RouteTable on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getByResourceGroupAsync(String resourceGroupName, String name) { + return getByResourceGroupWithResponseAsync(resourceGroupName, name) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Get a Ec2RouteTable. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2RouteTable. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Ec2RouteTable along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getByResourceGroupWithResponse(String resourceGroupName, String name, + Context context) { + return getByResourceGroupWithResponseAsync(resourceGroupName, name, context).block(); + } + + /** + * Get a Ec2RouteTable. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2RouteTable. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Ec2RouteTable. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Ec2RouteTableInner getByResourceGroup(String resourceGroupName, String name) { + return getByResourceGroupWithResponse(resourceGroupName, name, Context.NONE).getValue(); + } + + /** + * Create a Ec2RouteTable. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2RouteTable. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrReplaceWithResponseAsync(String resourceGroupName, String name, + Ec2RouteTableInner resource) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (resource == null) { + return Mono.error(new IllegalArgumentException("Parameter resource is required and cannot be null.")); + } else { + resource.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.createOrReplace(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, resource, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Create a Ec2RouteTable. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2RouteTable. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrReplaceWithResponseAsync(String resourceGroupName, String name, + Ec2RouteTableInner resource, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (resource == null) { + return Mono.error(new IllegalArgumentException("Parameter resource is required and cannot be null.")); + } else { + resource.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.createOrReplace(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, resource, accept, context); + } + + /** + * Create a Ec2RouteTable. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2RouteTable. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Ec2RouteTableInner> + beginCreateOrReplaceAsync(String resourceGroupName, String name, Ec2RouteTableInner resource) { + Mono>> mono = createOrReplaceWithResponseAsync(resourceGroupName, name, resource); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + Ec2RouteTableInner.class, Ec2RouteTableInner.class, this.client.getContext()); + } + + /** + * Create a Ec2RouteTable. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2RouteTable. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Ec2RouteTableInner> + beginCreateOrReplaceAsync(String resourceGroupName, String name, Ec2RouteTableInner resource, Context context) { + context = this.client.mergeContext(context); + Mono>> mono + = createOrReplaceWithResponseAsync(resourceGroupName, name, resource, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + Ec2RouteTableInner.class, Ec2RouteTableInner.class, context); + } + + /** + * Create a Ec2RouteTable. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2RouteTable. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Ec2RouteTableInner> beginCreateOrReplace(String resourceGroupName, + String name, Ec2RouteTableInner resource) { + return this.beginCreateOrReplaceAsync(resourceGroupName, name, resource).getSyncPoller(); + } + + /** + * Create a Ec2RouteTable. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2RouteTable. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Ec2RouteTableInner> beginCreateOrReplace(String resourceGroupName, + String name, Ec2RouteTableInner resource, Context context) { + return this.beginCreateOrReplaceAsync(resourceGroupName, name, resource, context).getSyncPoller(); + } + + /** + * Create a Ec2RouteTable. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2RouteTable. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrReplaceAsync(String resourceGroupName, String name, + Ec2RouteTableInner resource) { + return beginCreateOrReplaceAsync(resourceGroupName, name, resource).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create a Ec2RouteTable. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2RouteTable. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrReplaceAsync(String resourceGroupName, String name, + Ec2RouteTableInner resource, Context context) { + return beginCreateOrReplaceAsync(resourceGroupName, name, resource, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create a Ec2RouteTable. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2RouteTable. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Ec2RouteTableInner createOrReplace(String resourceGroupName, String name, Ec2RouteTableInner resource) { + return createOrReplaceAsync(resourceGroupName, name, resource).block(); + } + + /** + * Create a Ec2RouteTable. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2RouteTable. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Ec2RouteTableInner createOrReplace(String resourceGroupName, String name, Ec2RouteTableInner resource, + Context context) { + return createOrReplaceAsync(resourceGroupName, name, resource, context).block(); + } + + /** + * Update a Ec2RouteTable. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2RouteTable. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync(String resourceGroupName, String name, + Ec2RouteTableTagsUpdate properties) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (properties == null) { + return Mono.error(new IllegalArgumentException("Parameter properties is required and cannot be null.")); + } else { + properties.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.update(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, properties, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Update a Ec2RouteTable. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2RouteTable. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync(String resourceGroupName, String name, + Ec2RouteTableTagsUpdate properties, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (properties == null) { + return Mono.error(new IllegalArgumentException("Parameter properties is required and cannot be null.")); + } else { + properties.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.update(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, name, properties, accept, context); + } + + /** + * Update a Ec2RouteTable. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2RouteTable. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Ec2RouteTableInner> beginUpdateAsync(String resourceGroupName, + String name, Ec2RouteTableTagsUpdate properties) { + Mono>> mono = updateWithResponseAsync(resourceGroupName, name, properties); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + Ec2RouteTableInner.class, Ec2RouteTableInner.class, this.client.getContext()); + } + + /** + * Update a Ec2RouteTable. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2RouteTable. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Ec2RouteTableInner> beginUpdateAsync(String resourceGroupName, + String name, Ec2RouteTableTagsUpdate properties, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = updateWithResponseAsync(resourceGroupName, name, properties, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + Ec2RouteTableInner.class, Ec2RouteTableInner.class, context); + } + + /** + * Update a Ec2RouteTable. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2RouteTable. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Ec2RouteTableInner> beginUpdate(String resourceGroupName, + String name, Ec2RouteTableTagsUpdate properties) { + return this.beginUpdateAsync(resourceGroupName, name, properties).getSyncPoller(); + } + + /** + * Update a Ec2RouteTable. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2RouteTable. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Ec2RouteTableInner> beginUpdate(String resourceGroupName, + String name, Ec2RouteTableTagsUpdate properties, Context context) { + return this.beginUpdateAsync(resourceGroupName, name, properties, context).getSyncPoller(); + } + + /** + * Update a Ec2RouteTable. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2RouteTable. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync(String resourceGroupName, String name, + Ec2RouteTableTagsUpdate properties) { + return beginUpdateAsync(resourceGroupName, name, properties).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Update a Ec2RouteTable. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2RouteTable. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync(String resourceGroupName, String name, + Ec2RouteTableTagsUpdate properties, Context context) { + return beginUpdateAsync(resourceGroupName, name, properties, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Update a Ec2RouteTable. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2RouteTable. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Ec2RouteTableInner update(String resourceGroupName, String name, Ec2RouteTableTagsUpdate properties) { + return updateAsync(resourceGroupName, name, properties).block(); + } + + /** + * Update a Ec2RouteTable. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2RouteTable. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Ec2RouteTableInner update(String resourceGroupName, String name, Ec2RouteTableTagsUpdate properties, + Context context) { + return updateAsync(resourceGroupName, name, properties, context).block(); + } + + /** + * Delete a Ec2RouteTable. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2RouteTable. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync(String resourceGroupName, String name) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Delete a Ec2RouteTable. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2RouteTable. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync(String resourceGroupName, String name, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.delete(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, name, accept, context); + } + + /** + * Delete a Ec2RouteTable. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2RouteTable. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String name) { + Mono>> mono = deleteWithResponseAsync(resourceGroupName, name); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); + } + + /** + * Delete a Ec2RouteTable. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2RouteTable. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String name, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = deleteWithResponseAsync(resourceGroupName, name, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + context); + } + + /** + * Delete a Ec2RouteTable. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2RouteTable. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String name) { + return this.beginDeleteAsync(resourceGroupName, name).getSyncPoller(); + } + + /** + * Delete a Ec2RouteTable. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2RouteTable. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String name, Context context) { + return this.beginDeleteAsync(resourceGroupName, name, context).getSyncPoller(); + } + + /** + * Delete a Ec2RouteTable. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2RouteTable. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String name) { + return beginDeleteAsync(resourceGroupName, name).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete a Ec2RouteTable. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2RouteTable. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String name, Context context) { + return beginDeleteAsync(resourceGroupName, name, context).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete a Ec2RouteTable. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2RouteTable. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String name) { + deleteAsync(resourceGroupName, name).block(); + } + + /** + * Delete a Ec2RouteTable. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2RouteTable. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String name, Context context) { + deleteAsync(resourceGroupName, name, context).block(); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Ec2RouteTable list operation along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listBySubscriptionNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Ec2RouteTable list operation along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listBySubscriptionNextSinglePageAsync(String nextLink, + Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Ec2RouteTable list operation along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Ec2RouteTable list operation along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupNextSinglePageAsync(String nextLink, + Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/Ec2RouteTablesImpl.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/Ec2RouteTablesImpl.java new file mode 100644 index 000000000000..0104aa7826cb --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/Ec2RouteTablesImpl.java @@ -0,0 +1,146 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.awsconnector.fluent.Ec2RouteTablesClient; +import com.azure.resourcemanager.awsconnector.fluent.models.Ec2RouteTableInner; +import com.azure.resourcemanager.awsconnector.models.Ec2RouteTable; +import com.azure.resourcemanager.awsconnector.models.Ec2RouteTables; + +public final class Ec2RouteTablesImpl implements Ec2RouteTables { + private static final ClientLogger LOGGER = new ClientLogger(Ec2RouteTablesImpl.class); + + private final Ec2RouteTablesClient innerClient; + + private final com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager; + + public Ec2RouteTablesImpl(Ec2RouteTablesClient innerClient, + com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return ResourceManagerUtils.mapPage(inner, inner1 -> new Ec2RouteTableImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new Ec2RouteTableImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName); + return ResourceManagerUtils.mapPage(inner, inner1 -> new Ec2RouteTableImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new Ec2RouteTableImpl(inner1, this.manager())); + } + + public Response getByResourceGroupWithResponse(String resourceGroupName, String name, + Context context) { + Response inner + = this.serviceClient().getByResourceGroupWithResponse(resourceGroupName, name, context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new Ec2RouteTableImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public Ec2RouteTable getByResourceGroup(String resourceGroupName, String name) { + Ec2RouteTableInner inner = this.serviceClient().getByResourceGroup(resourceGroupName, name); + if (inner != null) { + return new Ec2RouteTableImpl(inner, this.manager()); + } else { + return null; + } + } + + public void deleteByResourceGroup(String resourceGroupName, String name) { + this.serviceClient().delete(resourceGroupName, name); + } + + public void delete(String resourceGroupName, String name, Context context) { + this.serviceClient().delete(resourceGroupName, name, context); + } + + public Ec2RouteTable getById(String id) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String name = ResourceManagerUtils.getValueFromIdByName(id, "ec2RouteTables"); + if (name == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'ec2RouteTables'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, name, Context.NONE).getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String name = ResourceManagerUtils.getValueFromIdByName(id, "ec2RouteTables"); + if (name == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'ec2RouteTables'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, name, context); + } + + public void deleteById(String id) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String name = ResourceManagerUtils.getValueFromIdByName(id, "ec2RouteTables"); + if (name == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'ec2RouteTables'.", id))); + } + this.delete(resourceGroupName, name, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String name = ResourceManagerUtils.getValueFromIdByName(id, "ec2RouteTables"); + if (name == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'ec2RouteTables'.", id))); + } + this.delete(resourceGroupName, name, context); + } + + private Ec2RouteTablesClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.awsconnector.AwsconnectorManager manager() { + return this.serviceManager; + } + + public Ec2RouteTableImpl define(String name) { + return new Ec2RouteTableImpl(name, this.manager()); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/Ec2SecurityGroupImpl.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/Ec2SecurityGroupImpl.java new file mode 100644 index 000000000000..b1bb2cde373c --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/Ec2SecurityGroupImpl.java @@ -0,0 +1,178 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.implementation; + +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.awsconnector.fluent.models.Ec2SecurityGroupInner; +import com.azure.resourcemanager.awsconnector.models.Ec2SecurityGroup; +import com.azure.resourcemanager.awsconnector.models.Ec2SecurityGroupProperties; +import com.azure.resourcemanager.awsconnector.models.Ec2SecurityGroupTagsUpdate; +import java.util.Collections; +import java.util.Map; + +public final class Ec2SecurityGroupImpl + implements Ec2SecurityGroup, Ec2SecurityGroup.Definition, Ec2SecurityGroup.Update { + private Ec2SecurityGroupInner innerObject; + + private final com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public String location() { + return this.innerModel().location(); + } + + public Map tags() { + Map inner = this.innerModel().tags(); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } + } + + public Ec2SecurityGroupProperties properties() { + return this.innerModel().properties(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public String resourceGroupName() { + return resourceGroupName; + } + + public Ec2SecurityGroupInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.awsconnector.AwsconnectorManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String name; + + private Ec2SecurityGroupTagsUpdate updateProperties; + + public Ec2SecurityGroupImpl withExistingResourceGroup(String resourceGroupName) { + this.resourceGroupName = resourceGroupName; + return this; + } + + public Ec2SecurityGroup create() { + this.innerObject = serviceManager.serviceClient() + .getEc2SecurityGroups() + .createOrReplace(resourceGroupName, name, this.innerModel(), Context.NONE); + return this; + } + + public Ec2SecurityGroup create(Context context) { + this.innerObject = serviceManager.serviceClient() + .getEc2SecurityGroups() + .createOrReplace(resourceGroupName, name, this.innerModel(), context); + return this; + } + + Ec2SecurityGroupImpl(String name, com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager) { + this.innerObject = new Ec2SecurityGroupInner(); + this.serviceManager = serviceManager; + this.name = name; + } + + public Ec2SecurityGroupImpl update() { + this.updateProperties = new Ec2SecurityGroupTagsUpdate(); + return this; + } + + public Ec2SecurityGroup apply() { + this.innerObject = serviceManager.serviceClient() + .getEc2SecurityGroups() + .update(resourceGroupName, name, updateProperties, Context.NONE); + return this; + } + + public Ec2SecurityGroup apply(Context context) { + this.innerObject = serviceManager.serviceClient() + .getEc2SecurityGroups() + .update(resourceGroupName, name, updateProperties, context); + return this; + } + + Ec2SecurityGroupImpl(Ec2SecurityGroupInner innerObject, + com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.name = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "ec2SecurityGroups"); + } + + public Ec2SecurityGroup refresh() { + this.innerObject = serviceManager.serviceClient() + .getEc2SecurityGroups() + .getByResourceGroupWithResponse(resourceGroupName, name, Context.NONE) + .getValue(); + return this; + } + + public Ec2SecurityGroup refresh(Context context) { + this.innerObject = serviceManager.serviceClient() + .getEc2SecurityGroups() + .getByResourceGroupWithResponse(resourceGroupName, name, context) + .getValue(); + return this; + } + + public Ec2SecurityGroupImpl withRegion(Region location) { + this.innerModel().withLocation(location.toString()); + return this; + } + + public Ec2SecurityGroupImpl withRegion(String location) { + this.innerModel().withLocation(location); + return this; + } + + public Ec2SecurityGroupImpl withTags(Map tags) { + if (isInCreateMode()) { + this.innerModel().withTags(tags); + return this; + } else { + this.updateProperties.withTags(tags); + return this; + } + } + + public Ec2SecurityGroupImpl withProperties(Ec2SecurityGroupProperties properties) { + this.innerModel().withProperties(properties); + return this; + } + + private boolean isInCreateMode() { + return this.innerModel().id() == null; + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/Ec2SecurityGroupsClientImpl.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/Ec2SecurityGroupsClientImpl.java new file mode 100644 index 000000000000..04d9880c7924 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/Ec2SecurityGroupsClientImpl.java @@ -0,0 +1,1281 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.Patch; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.awsconnector.fluent.Ec2SecurityGroupsClient; +import com.azure.resourcemanager.awsconnector.fluent.models.Ec2SecurityGroupInner; +import com.azure.resourcemanager.awsconnector.models.Ec2SecurityGroupListResult; +import com.azure.resourcemanager.awsconnector.models.Ec2SecurityGroupTagsUpdate; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in Ec2SecurityGroupsClient. + */ +public final class Ec2SecurityGroupsClientImpl implements Ec2SecurityGroupsClient { + /** + * The proxy service used to perform REST calls. + */ + private final Ec2SecurityGroupsService service; + + /** + * The service client containing this operation class. + */ + private final MicrosoftAwsConnectorImpl client; + + /** + * Initializes an instance of Ec2SecurityGroupsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + Ec2SecurityGroupsClientImpl(MicrosoftAwsConnectorImpl client) { + this.service + = RestProxy.create(Ec2SecurityGroupsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for MicrosoftAwsConnectorEc2SecurityGroups to be used by the proxy + * service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "MicrosoftAwsConnecto") + public interface Ec2SecurityGroupsService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.AwsConnector/ec2SecurityGroups") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/ec2SecurityGroups") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroup(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/ec2SecurityGroups/{name}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getByResourceGroup(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("name") String name, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/ec2SecurityGroups/{name}") + @ExpectedResponses({ 200, 201 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrReplace(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("name") String name, + @BodyParam("application/json") Ec2SecurityGroupInner resource, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/ec2SecurityGroups/{name}") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> update(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("name") String name, + @BodyParam("application/json") Ec2SecurityGroupTagsUpdate properties, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/ec2SecurityGroups/{name}") + @ExpectedResponses({ 202, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("name") String name, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listBySubscriptionNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroupNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); + } + + /** + * List Ec2SecurityGroup resources by subscription ID. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Ec2SecurityGroup list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync() { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List Ec2SecurityGroup resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Ec2SecurityGroup list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), accept, + context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * List Ec2SecurityGroup resources by subscription ID. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Ec2SecurityGroup list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>(() -> listSinglePageAsync(), + nextLink -> listBySubscriptionNextSinglePageAsync(nextLink)); + } + + /** + * List Ec2SecurityGroup resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Ec2SecurityGroup list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(Context context) { + return new PagedFlux<>(() -> listSinglePageAsync(context), + nextLink -> listBySubscriptionNextSinglePageAsync(nextLink, context)); + } + + /** + * List Ec2SecurityGroup resources by subscription ID. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Ec2SecurityGroup list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + return new PagedIterable<>(listAsync()); + } + + /** + * List Ec2SecurityGroup resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Ec2SecurityGroup list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Context context) { + return new PagedIterable<>(listAsync(context)); + } + + /** + * List Ec2SecurityGroup resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Ec2SecurityGroup list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List Ec2SecurityGroup resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Ec2SecurityGroup list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * List Ec2SecurityGroup resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Ec2SecurityGroup list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName) { + return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); + } + + /** + * List Ec2SecurityGroup resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Ec2SecurityGroup list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName, Context context) { + return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName, context), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink, context)); + } + + /** + * List Ec2SecurityGroup resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Ec2SecurityGroup list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName)); + } + + /** + * List Ec2SecurityGroup resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Ec2SecurityGroup list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, context)); + } + + /** + * Get a Ec2SecurityGroup. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2SecurityGroup. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Ec2SecurityGroup along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync(String resourceGroupName, + String name) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.getByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get a Ec2SecurityGroup. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2SecurityGroup. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Ec2SecurityGroup along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync(String resourceGroupName, + String name, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.getByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, accept, context); + } + + /** + * Get a Ec2SecurityGroup. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2SecurityGroup. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Ec2SecurityGroup on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getByResourceGroupAsync(String resourceGroupName, String name) { + return getByResourceGroupWithResponseAsync(resourceGroupName, name) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Get a Ec2SecurityGroup. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2SecurityGroup. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Ec2SecurityGroup along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getByResourceGroupWithResponse(String resourceGroupName, String name, + Context context) { + return getByResourceGroupWithResponseAsync(resourceGroupName, name, context).block(); + } + + /** + * Get a Ec2SecurityGroup. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2SecurityGroup. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Ec2SecurityGroup. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Ec2SecurityGroupInner getByResourceGroup(String resourceGroupName, String name) { + return getByResourceGroupWithResponse(resourceGroupName, name, Context.NONE).getValue(); + } + + /** + * Create a Ec2SecurityGroup. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2SecurityGroup. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrReplaceWithResponseAsync(String resourceGroupName, String name, + Ec2SecurityGroupInner resource) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (resource == null) { + return Mono.error(new IllegalArgumentException("Parameter resource is required and cannot be null.")); + } else { + resource.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.createOrReplace(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, resource, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Create a Ec2SecurityGroup. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2SecurityGroup. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrReplaceWithResponseAsync(String resourceGroupName, String name, + Ec2SecurityGroupInner resource, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (resource == null) { + return Mono.error(new IllegalArgumentException("Parameter resource is required and cannot be null.")); + } else { + resource.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.createOrReplace(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, resource, accept, context); + } + + /** + * Create a Ec2SecurityGroup. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2SecurityGroup. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Ec2SecurityGroupInner> + beginCreateOrReplaceAsync(String resourceGroupName, String name, Ec2SecurityGroupInner resource) { + Mono>> mono = createOrReplaceWithResponseAsync(resourceGroupName, name, resource); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), Ec2SecurityGroupInner.class, Ec2SecurityGroupInner.class, + this.client.getContext()); + } + + /** + * Create a Ec2SecurityGroup. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2SecurityGroup. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Ec2SecurityGroupInner> beginCreateOrReplaceAsync( + String resourceGroupName, String name, Ec2SecurityGroupInner resource, Context context) { + context = this.client.mergeContext(context); + Mono>> mono + = createOrReplaceWithResponseAsync(resourceGroupName, name, resource, context); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), Ec2SecurityGroupInner.class, Ec2SecurityGroupInner.class, context); + } + + /** + * Create a Ec2SecurityGroup. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2SecurityGroup. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Ec2SecurityGroupInner> + beginCreateOrReplace(String resourceGroupName, String name, Ec2SecurityGroupInner resource) { + return this.beginCreateOrReplaceAsync(resourceGroupName, name, resource).getSyncPoller(); + } + + /** + * Create a Ec2SecurityGroup. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2SecurityGroup. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Ec2SecurityGroupInner> + beginCreateOrReplace(String resourceGroupName, String name, Ec2SecurityGroupInner resource, Context context) { + return this.beginCreateOrReplaceAsync(resourceGroupName, name, resource, context).getSyncPoller(); + } + + /** + * Create a Ec2SecurityGroup. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2SecurityGroup. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrReplaceAsync(String resourceGroupName, String name, + Ec2SecurityGroupInner resource) { + return beginCreateOrReplaceAsync(resourceGroupName, name, resource).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create a Ec2SecurityGroup. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2SecurityGroup. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrReplaceAsync(String resourceGroupName, String name, + Ec2SecurityGroupInner resource, Context context) { + return beginCreateOrReplaceAsync(resourceGroupName, name, resource, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create a Ec2SecurityGroup. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2SecurityGroup. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Ec2SecurityGroupInner createOrReplace(String resourceGroupName, String name, + Ec2SecurityGroupInner resource) { + return createOrReplaceAsync(resourceGroupName, name, resource).block(); + } + + /** + * Create a Ec2SecurityGroup. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2SecurityGroup. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Ec2SecurityGroupInner createOrReplace(String resourceGroupName, String name, Ec2SecurityGroupInner resource, + Context context) { + return createOrReplaceAsync(resourceGroupName, name, resource, context).block(); + } + + /** + * Update a Ec2SecurityGroup. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2SecurityGroup. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync(String resourceGroupName, String name, + Ec2SecurityGroupTagsUpdate properties) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (properties == null) { + return Mono.error(new IllegalArgumentException("Parameter properties is required and cannot be null.")); + } else { + properties.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.update(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, properties, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Update a Ec2SecurityGroup. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2SecurityGroup. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync(String resourceGroupName, String name, + Ec2SecurityGroupTagsUpdate properties, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (properties == null) { + return Mono.error(new IllegalArgumentException("Parameter properties is required and cannot be null.")); + } else { + properties.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.update(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, name, properties, accept, context); + } + + /** + * Update a Ec2SecurityGroup. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2SecurityGroup. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Ec2SecurityGroupInner> + beginUpdateAsync(String resourceGroupName, String name, Ec2SecurityGroupTagsUpdate properties) { + Mono>> mono = updateWithResponseAsync(resourceGroupName, name, properties); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), Ec2SecurityGroupInner.class, Ec2SecurityGroupInner.class, + this.client.getContext()); + } + + /** + * Update a Ec2SecurityGroup. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2SecurityGroup. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Ec2SecurityGroupInner> beginUpdateAsync( + String resourceGroupName, String name, Ec2SecurityGroupTagsUpdate properties, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = updateWithResponseAsync(resourceGroupName, name, properties, context); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), Ec2SecurityGroupInner.class, Ec2SecurityGroupInner.class, context); + } + + /** + * Update a Ec2SecurityGroup. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2SecurityGroup. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Ec2SecurityGroupInner> beginUpdate(String resourceGroupName, + String name, Ec2SecurityGroupTagsUpdate properties) { + return this.beginUpdateAsync(resourceGroupName, name, properties).getSyncPoller(); + } + + /** + * Update a Ec2SecurityGroup. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2SecurityGroup. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Ec2SecurityGroupInner> beginUpdate(String resourceGroupName, + String name, Ec2SecurityGroupTagsUpdate properties, Context context) { + return this.beginUpdateAsync(resourceGroupName, name, properties, context).getSyncPoller(); + } + + /** + * Update a Ec2SecurityGroup. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2SecurityGroup. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync(String resourceGroupName, String name, + Ec2SecurityGroupTagsUpdate properties) { + return beginUpdateAsync(resourceGroupName, name, properties).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Update a Ec2SecurityGroup. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2SecurityGroup. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync(String resourceGroupName, String name, + Ec2SecurityGroupTagsUpdate properties, Context context) { + return beginUpdateAsync(resourceGroupName, name, properties, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Update a Ec2SecurityGroup. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2SecurityGroup. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Ec2SecurityGroupInner update(String resourceGroupName, String name, Ec2SecurityGroupTagsUpdate properties) { + return updateAsync(resourceGroupName, name, properties).block(); + } + + /** + * Update a Ec2SecurityGroup. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2SecurityGroup. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Ec2SecurityGroupInner update(String resourceGroupName, String name, Ec2SecurityGroupTagsUpdate properties, + Context context) { + return updateAsync(resourceGroupName, name, properties, context).block(); + } + + /** + * Delete a Ec2SecurityGroup. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2SecurityGroup. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync(String resourceGroupName, String name) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Delete a Ec2SecurityGroup. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2SecurityGroup. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync(String resourceGroupName, String name, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.delete(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, name, accept, context); + } + + /** + * Delete a Ec2SecurityGroup. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2SecurityGroup. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String name) { + Mono>> mono = deleteWithResponseAsync(resourceGroupName, name); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); + } + + /** + * Delete a Ec2SecurityGroup. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2SecurityGroup. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String name, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = deleteWithResponseAsync(resourceGroupName, name, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + context); + } + + /** + * Delete a Ec2SecurityGroup. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2SecurityGroup. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String name) { + return this.beginDeleteAsync(resourceGroupName, name).getSyncPoller(); + } + + /** + * Delete a Ec2SecurityGroup. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2SecurityGroup. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String name, Context context) { + return this.beginDeleteAsync(resourceGroupName, name, context).getSyncPoller(); + } + + /** + * Delete a Ec2SecurityGroup. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2SecurityGroup. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String name) { + return beginDeleteAsync(resourceGroupName, name).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete a Ec2SecurityGroup. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2SecurityGroup. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String name, Context context) { + return beginDeleteAsync(resourceGroupName, name, context).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete a Ec2SecurityGroup. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2SecurityGroup. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String name) { + deleteAsync(resourceGroupName, name).block(); + } + + /** + * Delete a Ec2SecurityGroup. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2SecurityGroup. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String name, Context context) { + deleteAsync(resourceGroupName, name, context).block(); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Ec2SecurityGroup list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listBySubscriptionNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Ec2SecurityGroup list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listBySubscriptionNextSinglePageAsync(String nextLink, + Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Ec2SecurityGroup list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Ec2SecurityGroup list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupNextSinglePageAsync(String nextLink, + Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/Ec2SecurityGroupsImpl.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/Ec2SecurityGroupsImpl.java new file mode 100644 index 000000000000..63790a1a7fe5 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/Ec2SecurityGroupsImpl.java @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.awsconnector.fluent.Ec2SecurityGroupsClient; +import com.azure.resourcemanager.awsconnector.fluent.models.Ec2SecurityGroupInner; +import com.azure.resourcemanager.awsconnector.models.Ec2SecurityGroup; +import com.azure.resourcemanager.awsconnector.models.Ec2SecurityGroups; + +public final class Ec2SecurityGroupsImpl implements Ec2SecurityGroups { + private static final ClientLogger LOGGER = new ClientLogger(Ec2SecurityGroupsImpl.class); + + private final Ec2SecurityGroupsClient innerClient; + + private final com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager; + + public Ec2SecurityGroupsImpl(Ec2SecurityGroupsClient innerClient, + com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return ResourceManagerUtils.mapPage(inner, inner1 -> new Ec2SecurityGroupImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new Ec2SecurityGroupImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName); + return ResourceManagerUtils.mapPage(inner, inner1 -> new Ec2SecurityGroupImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + PagedIterable inner + = this.serviceClient().listByResourceGroup(resourceGroupName, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new Ec2SecurityGroupImpl(inner1, this.manager())); + } + + public Response getByResourceGroupWithResponse(String resourceGroupName, String name, + Context context) { + Response inner + = this.serviceClient().getByResourceGroupWithResponse(resourceGroupName, name, context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new Ec2SecurityGroupImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public Ec2SecurityGroup getByResourceGroup(String resourceGroupName, String name) { + Ec2SecurityGroupInner inner = this.serviceClient().getByResourceGroup(resourceGroupName, name); + if (inner != null) { + return new Ec2SecurityGroupImpl(inner, this.manager()); + } else { + return null; + } + } + + public void deleteByResourceGroup(String resourceGroupName, String name) { + this.serviceClient().delete(resourceGroupName, name); + } + + public void delete(String resourceGroupName, String name, Context context) { + this.serviceClient().delete(resourceGroupName, name, context); + } + + public Ec2SecurityGroup getById(String id) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String name = ResourceManagerUtils.getValueFromIdByName(id, "ec2SecurityGroups"); + if (name == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'ec2SecurityGroups'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, name, Context.NONE).getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String name = ResourceManagerUtils.getValueFromIdByName(id, "ec2SecurityGroups"); + if (name == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'ec2SecurityGroups'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, name, context); + } + + public void deleteById(String id) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String name = ResourceManagerUtils.getValueFromIdByName(id, "ec2SecurityGroups"); + if (name == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'ec2SecurityGroups'.", id))); + } + this.delete(resourceGroupName, name, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String name = ResourceManagerUtils.getValueFromIdByName(id, "ec2SecurityGroups"); + if (name == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'ec2SecurityGroups'.", id))); + } + this.delete(resourceGroupName, name, context); + } + + private Ec2SecurityGroupsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.awsconnector.AwsconnectorManager manager() { + return this.serviceManager; + } + + public Ec2SecurityGroupImpl define(String name) { + return new Ec2SecurityGroupImpl(name, this.manager()); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/Ec2SnapshotImpl.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/Ec2SnapshotImpl.java new file mode 100644 index 000000000000..510c9a3a29ab --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/Ec2SnapshotImpl.java @@ -0,0 +1,177 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.implementation; + +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.awsconnector.fluent.models.Ec2SnapshotInner; +import com.azure.resourcemanager.awsconnector.models.Ec2Snapshot; +import com.azure.resourcemanager.awsconnector.models.Ec2SnapshotProperties; +import com.azure.resourcemanager.awsconnector.models.Ec2SnapshotTagsUpdate; +import java.util.Collections; +import java.util.Map; + +public final class Ec2SnapshotImpl implements Ec2Snapshot, Ec2Snapshot.Definition, Ec2Snapshot.Update { + private Ec2SnapshotInner innerObject; + + private final com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public String location() { + return this.innerModel().location(); + } + + public Map tags() { + Map inner = this.innerModel().tags(); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } + } + + public Ec2SnapshotProperties properties() { + return this.innerModel().properties(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public String resourceGroupName() { + return resourceGroupName; + } + + public Ec2SnapshotInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.awsconnector.AwsconnectorManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String name; + + private Ec2SnapshotTagsUpdate updateProperties; + + public Ec2SnapshotImpl withExistingResourceGroup(String resourceGroupName) { + this.resourceGroupName = resourceGroupName; + return this; + } + + public Ec2Snapshot create() { + this.innerObject = serviceManager.serviceClient() + .getEc2Snapshots() + .createOrReplace(resourceGroupName, name, this.innerModel(), Context.NONE); + return this; + } + + public Ec2Snapshot create(Context context) { + this.innerObject = serviceManager.serviceClient() + .getEc2Snapshots() + .createOrReplace(resourceGroupName, name, this.innerModel(), context); + return this; + } + + Ec2SnapshotImpl(String name, com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager) { + this.innerObject = new Ec2SnapshotInner(); + this.serviceManager = serviceManager; + this.name = name; + } + + public Ec2SnapshotImpl update() { + this.updateProperties = new Ec2SnapshotTagsUpdate(); + return this; + } + + public Ec2Snapshot apply() { + this.innerObject = serviceManager.serviceClient() + .getEc2Snapshots() + .update(resourceGroupName, name, updateProperties, Context.NONE); + return this; + } + + public Ec2Snapshot apply(Context context) { + this.innerObject = serviceManager.serviceClient() + .getEc2Snapshots() + .update(resourceGroupName, name, updateProperties, context); + return this; + } + + Ec2SnapshotImpl(Ec2SnapshotInner innerObject, + com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.name = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "ec2Snapshots"); + } + + public Ec2Snapshot refresh() { + this.innerObject = serviceManager.serviceClient() + .getEc2Snapshots() + .getByResourceGroupWithResponse(resourceGroupName, name, Context.NONE) + .getValue(); + return this; + } + + public Ec2Snapshot refresh(Context context) { + this.innerObject = serviceManager.serviceClient() + .getEc2Snapshots() + .getByResourceGroupWithResponse(resourceGroupName, name, context) + .getValue(); + return this; + } + + public Ec2SnapshotImpl withRegion(Region location) { + this.innerModel().withLocation(location.toString()); + return this; + } + + public Ec2SnapshotImpl withRegion(String location) { + this.innerModel().withLocation(location); + return this; + } + + public Ec2SnapshotImpl withTags(Map tags) { + if (isInCreateMode()) { + this.innerModel().withTags(tags); + return this; + } else { + this.updateProperties.withTags(tags); + return this; + } + } + + public Ec2SnapshotImpl withProperties(Ec2SnapshotProperties properties) { + this.innerModel().withProperties(properties); + return this; + } + + private boolean isInCreateMode() { + return this.innerModel().id() == null; + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/Ec2SnapshotsClientImpl.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/Ec2SnapshotsClientImpl.java new file mode 100644 index 000000000000..cf78505ad185 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/Ec2SnapshotsClientImpl.java @@ -0,0 +1,1278 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.Patch; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.awsconnector.fluent.Ec2SnapshotsClient; +import com.azure.resourcemanager.awsconnector.fluent.models.Ec2SnapshotInner; +import com.azure.resourcemanager.awsconnector.models.Ec2SnapshotListResult; +import com.azure.resourcemanager.awsconnector.models.Ec2SnapshotTagsUpdate; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in Ec2SnapshotsClient. + */ +public final class Ec2SnapshotsClientImpl implements Ec2SnapshotsClient { + /** + * The proxy service used to perform REST calls. + */ + private final Ec2SnapshotsService service; + + /** + * The service client containing this operation class. + */ + private final MicrosoftAwsConnectorImpl client; + + /** + * Initializes an instance of Ec2SnapshotsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + Ec2SnapshotsClientImpl(MicrosoftAwsConnectorImpl client) { + this.service + = RestProxy.create(Ec2SnapshotsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for MicrosoftAwsConnectorEc2Snapshots to be used by the proxy service to + * perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "MicrosoftAwsConnecto") + public interface Ec2SnapshotsService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.AwsConnector/ec2Snapshots") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/ec2Snapshots") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroup(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/ec2Snapshots/{name}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getByResourceGroup(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("name") String name, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/ec2Snapshots/{name}") + @ExpectedResponses({ 200, 201 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrReplace(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("name") String name, + @BodyParam("application/json") Ec2SnapshotInner resource, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/ec2Snapshots/{name}") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> update(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("name") String name, + @BodyParam("application/json") Ec2SnapshotTagsUpdate properties, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/ec2Snapshots/{name}") + @ExpectedResponses({ 202, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("name") String name, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listBySubscriptionNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroupNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); + } + + /** + * List Ec2Snapshot resources by subscription ID. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Ec2Snapshot list operation along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync() { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), + res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List Ec2Snapshot resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Ec2Snapshot list operation along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), accept, + context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * List Ec2Snapshot resources by subscription ID. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Ec2Snapshot list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>(() -> listSinglePageAsync(), + nextLink -> listBySubscriptionNextSinglePageAsync(nextLink)); + } + + /** + * List Ec2Snapshot resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Ec2Snapshot list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(Context context) { + return new PagedFlux<>(() -> listSinglePageAsync(context), + nextLink -> listBySubscriptionNextSinglePageAsync(nextLink, context)); + } + + /** + * List Ec2Snapshot resources by subscription ID. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Ec2Snapshot list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + return new PagedIterable<>(listAsync()); + } + + /** + * List Ec2Snapshot resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Ec2Snapshot list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Context context) { + return new PagedIterable<>(listAsync(context)); + } + + /** + * List Ec2Snapshot resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Ec2Snapshot list operation along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), + res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List Ec2Snapshot resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Ec2Snapshot list operation along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * List Ec2Snapshot resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Ec2Snapshot list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName) { + return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); + } + + /** + * List Ec2Snapshot resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Ec2Snapshot list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName, Context context) { + return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName, context), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink, context)); + } + + /** + * List Ec2Snapshot resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Ec2Snapshot list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName)); + } + + /** + * List Ec2Snapshot resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Ec2Snapshot list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, context)); + } + + /** + * Get a Ec2Snapshot. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2Snapshot. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Ec2Snapshot along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync(String resourceGroupName, + String name) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.getByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get a Ec2Snapshot. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2Snapshot. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Ec2Snapshot along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync(String resourceGroupName, String name, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.getByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, accept, context); + } + + /** + * Get a Ec2Snapshot. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2Snapshot. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Ec2Snapshot on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getByResourceGroupAsync(String resourceGroupName, String name) { + return getByResourceGroupWithResponseAsync(resourceGroupName, name) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Get a Ec2Snapshot. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2Snapshot. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Ec2Snapshot along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getByResourceGroupWithResponse(String resourceGroupName, String name, + Context context) { + return getByResourceGroupWithResponseAsync(resourceGroupName, name, context).block(); + } + + /** + * Get a Ec2Snapshot. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2Snapshot. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Ec2Snapshot. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Ec2SnapshotInner getByResourceGroup(String resourceGroupName, String name) { + return getByResourceGroupWithResponse(resourceGroupName, name, Context.NONE).getValue(); + } + + /** + * Create a Ec2Snapshot. Please note that end user resource creation is currently restricted, but it will be enabled + * in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2Snapshot. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrReplaceWithResponseAsync(String resourceGroupName, String name, + Ec2SnapshotInner resource) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (resource == null) { + return Mono.error(new IllegalArgumentException("Parameter resource is required and cannot be null.")); + } else { + resource.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.createOrReplace(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, resource, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Create a Ec2Snapshot. Please note that end user resource creation is currently restricted, but it will be enabled + * in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2Snapshot. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrReplaceWithResponseAsync(String resourceGroupName, String name, + Ec2SnapshotInner resource, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (resource == null) { + return Mono.error(new IllegalArgumentException("Parameter resource is required and cannot be null.")); + } else { + resource.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.createOrReplace(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, resource, accept, context); + } + + /** + * Create a Ec2Snapshot. Please note that end user resource creation is currently restricted, but it will be enabled + * in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2Snapshot. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Ec2SnapshotInner> + beginCreateOrReplaceAsync(String resourceGroupName, String name, Ec2SnapshotInner resource) { + Mono>> mono = createOrReplaceWithResponseAsync(resourceGroupName, name, resource); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + Ec2SnapshotInner.class, Ec2SnapshotInner.class, this.client.getContext()); + } + + /** + * Create a Ec2Snapshot. Please note that end user resource creation is currently restricted, but it will be enabled + * in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2Snapshot. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Ec2SnapshotInner> + beginCreateOrReplaceAsync(String resourceGroupName, String name, Ec2SnapshotInner resource, Context context) { + context = this.client.mergeContext(context); + Mono>> mono + = createOrReplaceWithResponseAsync(resourceGroupName, name, resource, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + Ec2SnapshotInner.class, Ec2SnapshotInner.class, context); + } + + /** + * Create a Ec2Snapshot. Please note that end user resource creation is currently restricted, but it will be enabled + * in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2Snapshot. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Ec2SnapshotInner> beginCreateOrReplace(String resourceGroupName, + String name, Ec2SnapshotInner resource) { + return this.beginCreateOrReplaceAsync(resourceGroupName, name, resource).getSyncPoller(); + } + + /** + * Create a Ec2Snapshot. Please note that end user resource creation is currently restricted, but it will be enabled + * in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2Snapshot. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Ec2SnapshotInner> beginCreateOrReplace(String resourceGroupName, + String name, Ec2SnapshotInner resource, Context context) { + return this.beginCreateOrReplaceAsync(resourceGroupName, name, resource, context).getSyncPoller(); + } + + /** + * Create a Ec2Snapshot. Please note that end user resource creation is currently restricted, but it will be enabled + * in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2Snapshot. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrReplaceAsync(String resourceGroupName, String name, + Ec2SnapshotInner resource) { + return beginCreateOrReplaceAsync(resourceGroupName, name, resource).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create a Ec2Snapshot. Please note that end user resource creation is currently restricted, but it will be enabled + * in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2Snapshot. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrReplaceAsync(String resourceGroupName, String name, + Ec2SnapshotInner resource, Context context) { + return beginCreateOrReplaceAsync(resourceGroupName, name, resource, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create a Ec2Snapshot. Please note that end user resource creation is currently restricted, but it will be enabled + * in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2Snapshot. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Ec2SnapshotInner createOrReplace(String resourceGroupName, String name, Ec2SnapshotInner resource) { + return createOrReplaceAsync(resourceGroupName, name, resource).block(); + } + + /** + * Create a Ec2Snapshot. Please note that end user resource creation is currently restricted, but it will be enabled + * in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2Snapshot. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Ec2SnapshotInner createOrReplace(String resourceGroupName, String name, Ec2SnapshotInner resource, + Context context) { + return createOrReplaceAsync(resourceGroupName, name, resource, context).block(); + } + + /** + * Update a Ec2Snapshot. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2Snapshot. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync(String resourceGroupName, String name, + Ec2SnapshotTagsUpdate properties) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (properties == null) { + return Mono.error(new IllegalArgumentException("Parameter properties is required and cannot be null.")); + } else { + properties.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.update(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, properties, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Update a Ec2Snapshot. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2Snapshot. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync(String resourceGroupName, String name, + Ec2SnapshotTagsUpdate properties, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (properties == null) { + return Mono.error(new IllegalArgumentException("Parameter properties is required and cannot be null.")); + } else { + properties.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.update(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, name, properties, accept, context); + } + + /** + * Update a Ec2Snapshot. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2Snapshot. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Ec2SnapshotInner> beginUpdateAsync(String resourceGroupName, + String name, Ec2SnapshotTagsUpdate properties) { + Mono>> mono = updateWithResponseAsync(resourceGroupName, name, properties); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + Ec2SnapshotInner.class, Ec2SnapshotInner.class, this.client.getContext()); + } + + /** + * Update a Ec2Snapshot. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2Snapshot. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Ec2SnapshotInner> beginUpdateAsync(String resourceGroupName, + String name, Ec2SnapshotTagsUpdate properties, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = updateWithResponseAsync(resourceGroupName, name, properties, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + Ec2SnapshotInner.class, Ec2SnapshotInner.class, context); + } + + /** + * Update a Ec2Snapshot. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2Snapshot. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Ec2SnapshotInner> beginUpdate(String resourceGroupName, String name, + Ec2SnapshotTagsUpdate properties) { + return this.beginUpdateAsync(resourceGroupName, name, properties).getSyncPoller(); + } + + /** + * Update a Ec2Snapshot. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2Snapshot. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Ec2SnapshotInner> beginUpdate(String resourceGroupName, String name, + Ec2SnapshotTagsUpdate properties, Context context) { + return this.beginUpdateAsync(resourceGroupName, name, properties, context).getSyncPoller(); + } + + /** + * Update a Ec2Snapshot. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2Snapshot. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync(String resourceGroupName, String name, + Ec2SnapshotTagsUpdate properties) { + return beginUpdateAsync(resourceGroupName, name, properties).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Update a Ec2Snapshot. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2Snapshot. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync(String resourceGroupName, String name, Ec2SnapshotTagsUpdate properties, + Context context) { + return beginUpdateAsync(resourceGroupName, name, properties, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Update a Ec2Snapshot. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2Snapshot. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Ec2SnapshotInner update(String resourceGroupName, String name, Ec2SnapshotTagsUpdate properties) { + return updateAsync(resourceGroupName, name, properties).block(); + } + + /** + * Update a Ec2Snapshot. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2Snapshot. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Ec2SnapshotInner update(String resourceGroupName, String name, Ec2SnapshotTagsUpdate properties, + Context context) { + return updateAsync(resourceGroupName, name, properties, context).block(); + } + + /** + * Delete a Ec2Snapshot. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2Snapshot. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync(String resourceGroupName, String name) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Delete a Ec2Snapshot. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2Snapshot. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync(String resourceGroupName, String name, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.delete(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, name, accept, context); + } + + /** + * Delete a Ec2Snapshot. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2Snapshot. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String name) { + Mono>> mono = deleteWithResponseAsync(resourceGroupName, name); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); + } + + /** + * Delete a Ec2Snapshot. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2Snapshot. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String name, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = deleteWithResponseAsync(resourceGroupName, name, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + context); + } + + /** + * Delete a Ec2Snapshot. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2Snapshot. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String name) { + return this.beginDeleteAsync(resourceGroupName, name).getSyncPoller(); + } + + /** + * Delete a Ec2Snapshot. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2Snapshot. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String name, Context context) { + return this.beginDeleteAsync(resourceGroupName, name, context).getSyncPoller(); + } + + /** + * Delete a Ec2Snapshot. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2Snapshot. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String name) { + return beginDeleteAsync(resourceGroupName, name).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete a Ec2Snapshot. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2Snapshot. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String name, Context context) { + return beginDeleteAsync(resourceGroupName, name, context).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete a Ec2Snapshot. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2Snapshot. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String name) { + deleteAsync(resourceGroupName, name).block(); + } + + /** + * Delete a Ec2Snapshot. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2Snapshot. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String name, Context context) { + deleteAsync(resourceGroupName, name, context).block(); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Ec2Snapshot list operation along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listBySubscriptionNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), + res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Ec2Snapshot list operation along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listBySubscriptionNextSinglePageAsync(String nextLink, + Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Ec2Snapshot list operation along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), + res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Ec2Snapshot list operation along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupNextSinglePageAsync(String nextLink, + Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/Ec2SnapshotsImpl.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/Ec2SnapshotsImpl.java new file mode 100644 index 000000000000..0d9eaf55e1a9 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/Ec2SnapshotsImpl.java @@ -0,0 +1,146 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.awsconnector.fluent.Ec2SnapshotsClient; +import com.azure.resourcemanager.awsconnector.fluent.models.Ec2SnapshotInner; +import com.azure.resourcemanager.awsconnector.models.Ec2Snapshot; +import com.azure.resourcemanager.awsconnector.models.Ec2Snapshots; + +public final class Ec2SnapshotsImpl implements Ec2Snapshots { + private static final ClientLogger LOGGER = new ClientLogger(Ec2SnapshotsImpl.class); + + private final Ec2SnapshotsClient innerClient; + + private final com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager; + + public Ec2SnapshotsImpl(Ec2SnapshotsClient innerClient, + com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return ResourceManagerUtils.mapPage(inner, inner1 -> new Ec2SnapshotImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new Ec2SnapshotImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName); + return ResourceManagerUtils.mapPage(inner, inner1 -> new Ec2SnapshotImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new Ec2SnapshotImpl(inner1, this.manager())); + } + + public Response getByResourceGroupWithResponse(String resourceGroupName, String name, + Context context) { + Response inner + = this.serviceClient().getByResourceGroupWithResponse(resourceGroupName, name, context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new Ec2SnapshotImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public Ec2Snapshot getByResourceGroup(String resourceGroupName, String name) { + Ec2SnapshotInner inner = this.serviceClient().getByResourceGroup(resourceGroupName, name); + if (inner != null) { + return new Ec2SnapshotImpl(inner, this.manager()); + } else { + return null; + } + } + + public void deleteByResourceGroup(String resourceGroupName, String name) { + this.serviceClient().delete(resourceGroupName, name); + } + + public void delete(String resourceGroupName, String name, Context context) { + this.serviceClient().delete(resourceGroupName, name, context); + } + + public Ec2Snapshot getById(String id) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String name = ResourceManagerUtils.getValueFromIdByName(id, "ec2Snapshots"); + if (name == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'ec2Snapshots'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, name, Context.NONE).getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String name = ResourceManagerUtils.getValueFromIdByName(id, "ec2Snapshots"); + if (name == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'ec2Snapshots'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, name, context); + } + + public void deleteById(String id) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String name = ResourceManagerUtils.getValueFromIdByName(id, "ec2Snapshots"); + if (name == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'ec2Snapshots'.", id))); + } + this.delete(resourceGroupName, name, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String name = ResourceManagerUtils.getValueFromIdByName(id, "ec2Snapshots"); + if (name == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'ec2Snapshots'.", id))); + } + this.delete(resourceGroupName, name, context); + } + + private Ec2SnapshotsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.awsconnector.AwsconnectorManager manager() { + return this.serviceManager; + } + + public Ec2SnapshotImpl define(String name) { + return new Ec2SnapshotImpl(name, this.manager()); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/Ec2SubnetImpl.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/Ec2SubnetImpl.java new file mode 100644 index 000000000000..04a9559900d2 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/Ec2SubnetImpl.java @@ -0,0 +1,176 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.implementation; + +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.awsconnector.fluent.models.Ec2SubnetInner; +import com.azure.resourcemanager.awsconnector.models.Ec2Subnet; +import com.azure.resourcemanager.awsconnector.models.Ec2SubnetProperties; +import com.azure.resourcemanager.awsconnector.models.Ec2SubnetTagsUpdate; +import java.util.Collections; +import java.util.Map; + +public final class Ec2SubnetImpl implements Ec2Subnet, Ec2Subnet.Definition, Ec2Subnet.Update { + private Ec2SubnetInner innerObject; + + private final com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public String location() { + return this.innerModel().location(); + } + + public Map tags() { + Map inner = this.innerModel().tags(); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } + } + + public Ec2SubnetProperties properties() { + return this.innerModel().properties(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public String resourceGroupName() { + return resourceGroupName; + } + + public Ec2SubnetInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.awsconnector.AwsconnectorManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String name; + + private Ec2SubnetTagsUpdate updateProperties; + + public Ec2SubnetImpl withExistingResourceGroup(String resourceGroupName) { + this.resourceGroupName = resourceGroupName; + return this; + } + + public Ec2Subnet create() { + this.innerObject = serviceManager.serviceClient() + .getEc2Subnets() + .createOrReplace(resourceGroupName, name, this.innerModel(), Context.NONE); + return this; + } + + public Ec2Subnet create(Context context) { + this.innerObject = serviceManager.serviceClient() + .getEc2Subnets() + .createOrReplace(resourceGroupName, name, this.innerModel(), context); + return this; + } + + Ec2SubnetImpl(String name, com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager) { + this.innerObject = new Ec2SubnetInner(); + this.serviceManager = serviceManager; + this.name = name; + } + + public Ec2SubnetImpl update() { + this.updateProperties = new Ec2SubnetTagsUpdate(); + return this; + } + + public Ec2Subnet apply() { + this.innerObject = serviceManager.serviceClient() + .getEc2Subnets() + .update(resourceGroupName, name, updateProperties, Context.NONE); + return this; + } + + public Ec2Subnet apply(Context context) { + this.innerObject + = serviceManager.serviceClient().getEc2Subnets().update(resourceGroupName, name, updateProperties, context); + return this; + } + + Ec2SubnetImpl(Ec2SubnetInner innerObject, + com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.name = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "ec2Subnets"); + } + + public Ec2Subnet refresh() { + this.innerObject = serviceManager.serviceClient() + .getEc2Subnets() + .getByResourceGroupWithResponse(resourceGroupName, name, Context.NONE) + .getValue(); + return this; + } + + public Ec2Subnet refresh(Context context) { + this.innerObject = serviceManager.serviceClient() + .getEc2Subnets() + .getByResourceGroupWithResponse(resourceGroupName, name, context) + .getValue(); + return this; + } + + public Ec2SubnetImpl withRegion(Region location) { + this.innerModel().withLocation(location.toString()); + return this; + } + + public Ec2SubnetImpl withRegion(String location) { + this.innerModel().withLocation(location); + return this; + } + + public Ec2SubnetImpl withTags(Map tags) { + if (isInCreateMode()) { + this.innerModel().withTags(tags); + return this; + } else { + this.updateProperties.withTags(tags); + return this; + } + } + + public Ec2SubnetImpl withProperties(Ec2SubnetProperties properties) { + this.innerModel().withProperties(properties); + return this; + } + + private boolean isInCreateMode() { + return this.innerModel().id() == null; + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/Ec2SubnetsClientImpl.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/Ec2SubnetsClientImpl.java new file mode 100644 index 000000000000..8620549fb7ef --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/Ec2SubnetsClientImpl.java @@ -0,0 +1,1275 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.Patch; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.awsconnector.fluent.Ec2SubnetsClient; +import com.azure.resourcemanager.awsconnector.fluent.models.Ec2SubnetInner; +import com.azure.resourcemanager.awsconnector.models.Ec2SubnetListResult; +import com.azure.resourcemanager.awsconnector.models.Ec2SubnetTagsUpdate; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in Ec2SubnetsClient. + */ +public final class Ec2SubnetsClientImpl implements Ec2SubnetsClient { + /** + * The proxy service used to perform REST calls. + */ + private final Ec2SubnetsService service; + + /** + * The service client containing this operation class. + */ + private final MicrosoftAwsConnectorImpl client; + + /** + * Initializes an instance of Ec2SubnetsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + Ec2SubnetsClientImpl(MicrosoftAwsConnectorImpl client) { + this.service + = RestProxy.create(Ec2SubnetsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for MicrosoftAwsConnectorEc2Subnets to be used by the proxy service to + * perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "MicrosoftAwsConnecto") + public interface Ec2SubnetsService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.AwsConnector/ec2Subnets") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/ec2Subnets") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroup(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/ec2Subnets/{name}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getByResourceGroup(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("name") String name, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/ec2Subnets/{name}") + @ExpectedResponses({ 200, 201 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrReplace(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("name") String name, + @BodyParam("application/json") Ec2SubnetInner resource, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/ec2Subnets/{name}") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> update(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("name") String name, + @BodyParam("application/json") Ec2SubnetTagsUpdate properties, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/ec2Subnets/{name}") + @ExpectedResponses({ 202, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("name") String name, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listBySubscriptionNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroupNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); + } + + /** + * List Ec2Subnet resources by subscription ID. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Ec2Subnet list operation along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync() { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), + res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List Ec2Subnet resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Ec2Subnet list operation along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), accept, + context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * List Ec2Subnet resources by subscription ID. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Ec2Subnet list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>(() -> listSinglePageAsync(), + nextLink -> listBySubscriptionNextSinglePageAsync(nextLink)); + } + + /** + * List Ec2Subnet resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Ec2Subnet list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(Context context) { + return new PagedFlux<>(() -> listSinglePageAsync(context), + nextLink -> listBySubscriptionNextSinglePageAsync(nextLink, context)); + } + + /** + * List Ec2Subnet resources by subscription ID. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Ec2Subnet list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + return new PagedIterable<>(listAsync()); + } + + /** + * List Ec2Subnet resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Ec2Subnet list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Context context) { + return new PagedIterable<>(listAsync(context)); + } + + /** + * List Ec2Subnet resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Ec2Subnet list operation along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), + res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List Ec2Subnet resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Ec2Subnet list operation along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * List Ec2Subnet resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Ec2Subnet list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName) { + return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); + } + + /** + * List Ec2Subnet resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Ec2Subnet list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName, Context context) { + return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName, context), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink, context)); + } + + /** + * List Ec2Subnet resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Ec2Subnet list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName)); + } + + /** + * List Ec2Subnet resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Ec2Subnet list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, context)); + } + + /** + * Get a Ec2Subnet. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2Subnet. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Ec2Subnet along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync(String resourceGroupName, String name) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.getByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get a Ec2Subnet. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2Subnet. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Ec2Subnet along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync(String resourceGroupName, String name, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.getByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, accept, context); + } + + /** + * Get a Ec2Subnet. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2Subnet. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Ec2Subnet on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getByResourceGroupAsync(String resourceGroupName, String name) { + return getByResourceGroupWithResponseAsync(resourceGroupName, name) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Get a Ec2Subnet. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2Subnet. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Ec2Subnet along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getByResourceGroupWithResponse(String resourceGroupName, String name, + Context context) { + return getByResourceGroupWithResponseAsync(resourceGroupName, name, context).block(); + } + + /** + * Get a Ec2Subnet. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2Subnet. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Ec2Subnet. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Ec2SubnetInner getByResourceGroup(String resourceGroupName, String name) { + return getByResourceGroupWithResponse(resourceGroupName, name, Context.NONE).getValue(); + } + + /** + * Create a Ec2Subnet. Please note that end user resource creation is currently restricted, but it will be enabled + * in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2Subnet. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrReplaceWithResponseAsync(String resourceGroupName, String name, + Ec2SubnetInner resource) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (resource == null) { + return Mono.error(new IllegalArgumentException("Parameter resource is required and cannot be null.")); + } else { + resource.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.createOrReplace(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, resource, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Create a Ec2Subnet. Please note that end user resource creation is currently restricted, but it will be enabled + * in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2Subnet. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrReplaceWithResponseAsync(String resourceGroupName, String name, + Ec2SubnetInner resource, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (resource == null) { + return Mono.error(new IllegalArgumentException("Parameter resource is required and cannot be null.")); + } else { + resource.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.createOrReplace(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, resource, accept, context); + } + + /** + * Create a Ec2Subnet. Please note that end user resource creation is currently restricted, but it will be enabled + * in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2Subnet. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Ec2SubnetInner> beginCreateOrReplaceAsync(String resourceGroupName, + String name, Ec2SubnetInner resource) { + Mono>> mono = createOrReplaceWithResponseAsync(resourceGroupName, name, resource); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + Ec2SubnetInner.class, Ec2SubnetInner.class, this.client.getContext()); + } + + /** + * Create a Ec2Subnet. Please note that end user resource creation is currently restricted, but it will be enabled + * in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2Subnet. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Ec2SubnetInner> beginCreateOrReplaceAsync(String resourceGroupName, + String name, Ec2SubnetInner resource, Context context) { + context = this.client.mergeContext(context); + Mono>> mono + = createOrReplaceWithResponseAsync(resourceGroupName, name, resource, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + Ec2SubnetInner.class, Ec2SubnetInner.class, context); + } + + /** + * Create a Ec2Subnet. Please note that end user resource creation is currently restricted, but it will be enabled + * in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2Subnet. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Ec2SubnetInner> beginCreateOrReplace(String resourceGroupName, + String name, Ec2SubnetInner resource) { + return this.beginCreateOrReplaceAsync(resourceGroupName, name, resource).getSyncPoller(); + } + + /** + * Create a Ec2Subnet. Please note that end user resource creation is currently restricted, but it will be enabled + * in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2Subnet. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Ec2SubnetInner> beginCreateOrReplace(String resourceGroupName, + String name, Ec2SubnetInner resource, Context context) { + return this.beginCreateOrReplaceAsync(resourceGroupName, name, resource, context).getSyncPoller(); + } + + /** + * Create a Ec2Subnet. Please note that end user resource creation is currently restricted, but it will be enabled + * in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2Subnet. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrReplaceAsync(String resourceGroupName, String name, Ec2SubnetInner resource) { + return beginCreateOrReplaceAsync(resourceGroupName, name, resource).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create a Ec2Subnet. Please note that end user resource creation is currently restricted, but it will be enabled + * in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2Subnet. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrReplaceAsync(String resourceGroupName, String name, Ec2SubnetInner resource, + Context context) { + return beginCreateOrReplaceAsync(resourceGroupName, name, resource, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create a Ec2Subnet. Please note that end user resource creation is currently restricted, but it will be enabled + * in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2Subnet. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Ec2SubnetInner createOrReplace(String resourceGroupName, String name, Ec2SubnetInner resource) { + return createOrReplaceAsync(resourceGroupName, name, resource).block(); + } + + /** + * Create a Ec2Subnet. Please note that end user resource creation is currently restricted, but it will be enabled + * in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2Subnet. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Ec2SubnetInner createOrReplace(String resourceGroupName, String name, Ec2SubnetInner resource, + Context context) { + return createOrReplaceAsync(resourceGroupName, name, resource, context).block(); + } + + /** + * Update a Ec2Subnet. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2Subnet. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync(String resourceGroupName, String name, + Ec2SubnetTagsUpdate properties) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (properties == null) { + return Mono.error(new IllegalArgumentException("Parameter properties is required and cannot be null.")); + } else { + properties.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.update(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, properties, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Update a Ec2Subnet. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2Subnet. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync(String resourceGroupName, String name, + Ec2SubnetTagsUpdate properties, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (properties == null) { + return Mono.error(new IllegalArgumentException("Parameter properties is required and cannot be null.")); + } else { + properties.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.update(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, name, properties, accept, context); + } + + /** + * Update a Ec2Subnet. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2Subnet. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Ec2SubnetInner> beginUpdateAsync(String resourceGroupName, + String name, Ec2SubnetTagsUpdate properties) { + Mono>> mono = updateWithResponseAsync(resourceGroupName, name, properties); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + Ec2SubnetInner.class, Ec2SubnetInner.class, this.client.getContext()); + } + + /** + * Update a Ec2Subnet. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2Subnet. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Ec2SubnetInner> beginUpdateAsync(String resourceGroupName, + String name, Ec2SubnetTagsUpdate properties, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = updateWithResponseAsync(resourceGroupName, name, properties, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + Ec2SubnetInner.class, Ec2SubnetInner.class, context); + } + + /** + * Update a Ec2Subnet. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2Subnet. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Ec2SubnetInner> beginUpdate(String resourceGroupName, String name, + Ec2SubnetTagsUpdate properties) { + return this.beginUpdateAsync(resourceGroupName, name, properties).getSyncPoller(); + } + + /** + * Update a Ec2Subnet. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2Subnet. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Ec2SubnetInner> beginUpdate(String resourceGroupName, String name, + Ec2SubnetTagsUpdate properties, Context context) { + return this.beginUpdateAsync(resourceGroupName, name, properties, context).getSyncPoller(); + } + + /** + * Update a Ec2Subnet. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2Subnet. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync(String resourceGroupName, String name, Ec2SubnetTagsUpdate properties) { + return beginUpdateAsync(resourceGroupName, name, properties).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Update a Ec2Subnet. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2Subnet. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync(String resourceGroupName, String name, Ec2SubnetTagsUpdate properties, + Context context) { + return beginUpdateAsync(resourceGroupName, name, properties, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Update a Ec2Subnet. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2Subnet. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Ec2SubnetInner update(String resourceGroupName, String name, Ec2SubnetTagsUpdate properties) { + return updateAsync(resourceGroupName, name, properties).block(); + } + + /** + * Update a Ec2Subnet. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2Subnet. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Ec2SubnetInner update(String resourceGroupName, String name, Ec2SubnetTagsUpdate properties, + Context context) { + return updateAsync(resourceGroupName, name, properties, context).block(); + } + + /** + * Delete a Ec2Subnet. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2Subnet. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync(String resourceGroupName, String name) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Delete a Ec2Subnet. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2Subnet. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync(String resourceGroupName, String name, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.delete(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, name, accept, context); + } + + /** + * Delete a Ec2Subnet. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2Subnet. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String name) { + Mono>> mono = deleteWithResponseAsync(resourceGroupName, name); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); + } + + /** + * Delete a Ec2Subnet. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2Subnet. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String name, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = deleteWithResponseAsync(resourceGroupName, name, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + context); + } + + /** + * Delete a Ec2Subnet. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2Subnet. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String name) { + return this.beginDeleteAsync(resourceGroupName, name).getSyncPoller(); + } + + /** + * Delete a Ec2Subnet. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2Subnet. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String name, Context context) { + return this.beginDeleteAsync(resourceGroupName, name, context).getSyncPoller(); + } + + /** + * Delete a Ec2Subnet. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2Subnet. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String name) { + return beginDeleteAsync(resourceGroupName, name).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete a Ec2Subnet. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2Subnet. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String name, Context context) { + return beginDeleteAsync(resourceGroupName, name, context).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete a Ec2Subnet. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2Subnet. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String name) { + deleteAsync(resourceGroupName, name).block(); + } + + /** + * Delete a Ec2Subnet. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2Subnet. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String name, Context context) { + deleteAsync(resourceGroupName, name, context).block(); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Ec2Subnet list operation along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listBySubscriptionNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), + res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Ec2Subnet list operation along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listBySubscriptionNextSinglePageAsync(String nextLink, + Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Ec2Subnet list operation along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), + res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Ec2Subnet list operation along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupNextSinglePageAsync(String nextLink, + Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/Ec2SubnetsImpl.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/Ec2SubnetsImpl.java new file mode 100644 index 000000000000..bac213a13310 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/Ec2SubnetsImpl.java @@ -0,0 +1,145 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.awsconnector.fluent.Ec2SubnetsClient; +import com.azure.resourcemanager.awsconnector.fluent.models.Ec2SubnetInner; +import com.azure.resourcemanager.awsconnector.models.Ec2Subnet; +import com.azure.resourcemanager.awsconnector.models.Ec2Subnets; + +public final class Ec2SubnetsImpl implements Ec2Subnets { + private static final ClientLogger LOGGER = new ClientLogger(Ec2SubnetsImpl.class); + + private final Ec2SubnetsClient innerClient; + + private final com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager; + + public Ec2SubnetsImpl(Ec2SubnetsClient innerClient, + com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return ResourceManagerUtils.mapPage(inner, inner1 -> new Ec2SubnetImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new Ec2SubnetImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName); + return ResourceManagerUtils.mapPage(inner, inner1 -> new Ec2SubnetImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new Ec2SubnetImpl(inner1, this.manager())); + } + + public Response getByResourceGroupWithResponse(String resourceGroupName, String name, Context context) { + Response inner + = this.serviceClient().getByResourceGroupWithResponse(resourceGroupName, name, context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new Ec2SubnetImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public Ec2Subnet getByResourceGroup(String resourceGroupName, String name) { + Ec2SubnetInner inner = this.serviceClient().getByResourceGroup(resourceGroupName, name); + if (inner != null) { + return new Ec2SubnetImpl(inner, this.manager()); + } else { + return null; + } + } + + public void deleteByResourceGroup(String resourceGroupName, String name) { + this.serviceClient().delete(resourceGroupName, name); + } + + public void delete(String resourceGroupName, String name, Context context) { + this.serviceClient().delete(resourceGroupName, name, context); + } + + public Ec2Subnet getById(String id) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String name = ResourceManagerUtils.getValueFromIdByName(id, "ec2Subnets"); + if (name == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'ec2Subnets'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, name, Context.NONE).getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String name = ResourceManagerUtils.getValueFromIdByName(id, "ec2Subnets"); + if (name == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'ec2Subnets'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, name, context); + } + + public void deleteById(String id) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String name = ResourceManagerUtils.getValueFromIdByName(id, "ec2Subnets"); + if (name == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'ec2Subnets'.", id))); + } + this.delete(resourceGroupName, name, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String name = ResourceManagerUtils.getValueFromIdByName(id, "ec2Subnets"); + if (name == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'ec2Subnets'.", id))); + } + this.delete(resourceGroupName, name, context); + } + + private Ec2SubnetsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.awsconnector.AwsconnectorManager manager() { + return this.serviceManager; + } + + public Ec2SubnetImpl define(String name) { + return new Ec2SubnetImpl(name, this.manager()); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/Ec2VolumeImpl.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/Ec2VolumeImpl.java new file mode 100644 index 000000000000..de663c3329d1 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/Ec2VolumeImpl.java @@ -0,0 +1,176 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.implementation; + +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.awsconnector.fluent.models.Ec2VolumeInner; +import com.azure.resourcemanager.awsconnector.models.Ec2Volume; +import com.azure.resourcemanager.awsconnector.models.Ec2VolumeProperties; +import com.azure.resourcemanager.awsconnector.models.Ec2VolumeTagsUpdate; +import java.util.Collections; +import java.util.Map; + +public final class Ec2VolumeImpl implements Ec2Volume, Ec2Volume.Definition, Ec2Volume.Update { + private Ec2VolumeInner innerObject; + + private final com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public String location() { + return this.innerModel().location(); + } + + public Map tags() { + Map inner = this.innerModel().tags(); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } + } + + public Ec2VolumeProperties properties() { + return this.innerModel().properties(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public String resourceGroupName() { + return resourceGroupName; + } + + public Ec2VolumeInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.awsconnector.AwsconnectorManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String name; + + private Ec2VolumeTagsUpdate updateProperties; + + public Ec2VolumeImpl withExistingResourceGroup(String resourceGroupName) { + this.resourceGroupName = resourceGroupName; + return this; + } + + public Ec2Volume create() { + this.innerObject = serviceManager.serviceClient() + .getEc2Volumes() + .createOrReplace(resourceGroupName, name, this.innerModel(), Context.NONE); + return this; + } + + public Ec2Volume create(Context context) { + this.innerObject = serviceManager.serviceClient() + .getEc2Volumes() + .createOrReplace(resourceGroupName, name, this.innerModel(), context); + return this; + } + + Ec2VolumeImpl(String name, com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager) { + this.innerObject = new Ec2VolumeInner(); + this.serviceManager = serviceManager; + this.name = name; + } + + public Ec2VolumeImpl update() { + this.updateProperties = new Ec2VolumeTagsUpdate(); + return this; + } + + public Ec2Volume apply() { + this.innerObject = serviceManager.serviceClient() + .getEc2Volumes() + .update(resourceGroupName, name, updateProperties, Context.NONE); + return this; + } + + public Ec2Volume apply(Context context) { + this.innerObject + = serviceManager.serviceClient().getEc2Volumes().update(resourceGroupName, name, updateProperties, context); + return this; + } + + Ec2VolumeImpl(Ec2VolumeInner innerObject, + com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.name = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "ec2Volumes"); + } + + public Ec2Volume refresh() { + this.innerObject = serviceManager.serviceClient() + .getEc2Volumes() + .getByResourceGroupWithResponse(resourceGroupName, name, Context.NONE) + .getValue(); + return this; + } + + public Ec2Volume refresh(Context context) { + this.innerObject = serviceManager.serviceClient() + .getEc2Volumes() + .getByResourceGroupWithResponse(resourceGroupName, name, context) + .getValue(); + return this; + } + + public Ec2VolumeImpl withRegion(Region location) { + this.innerModel().withLocation(location.toString()); + return this; + } + + public Ec2VolumeImpl withRegion(String location) { + this.innerModel().withLocation(location); + return this; + } + + public Ec2VolumeImpl withTags(Map tags) { + if (isInCreateMode()) { + this.innerModel().withTags(tags); + return this; + } else { + this.updateProperties.withTags(tags); + return this; + } + } + + public Ec2VolumeImpl withProperties(Ec2VolumeProperties properties) { + this.innerModel().withProperties(properties); + return this; + } + + private boolean isInCreateMode() { + return this.innerModel().id() == null; + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/Ec2VolumesClientImpl.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/Ec2VolumesClientImpl.java new file mode 100644 index 000000000000..8d98ca0ab901 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/Ec2VolumesClientImpl.java @@ -0,0 +1,1275 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.Patch; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.awsconnector.fluent.Ec2VolumesClient; +import com.azure.resourcemanager.awsconnector.fluent.models.Ec2VolumeInner; +import com.azure.resourcemanager.awsconnector.models.Ec2VolumeListResult; +import com.azure.resourcemanager.awsconnector.models.Ec2VolumeTagsUpdate; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in Ec2VolumesClient. + */ +public final class Ec2VolumesClientImpl implements Ec2VolumesClient { + /** + * The proxy service used to perform REST calls. + */ + private final Ec2VolumesService service; + + /** + * The service client containing this operation class. + */ + private final MicrosoftAwsConnectorImpl client; + + /** + * Initializes an instance of Ec2VolumesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + Ec2VolumesClientImpl(MicrosoftAwsConnectorImpl client) { + this.service + = RestProxy.create(Ec2VolumesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for MicrosoftAwsConnectorEc2Volumes to be used by the proxy service to + * perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "MicrosoftAwsConnecto") + public interface Ec2VolumesService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.AwsConnector/ec2Volumes") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/ec2Volumes") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroup(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/ec2Volumes/{name}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getByResourceGroup(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("name") String name, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/ec2Volumes/{name}") + @ExpectedResponses({ 200, 201 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrReplace(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("name") String name, + @BodyParam("application/json") Ec2VolumeInner resource, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/ec2Volumes/{name}") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> update(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("name") String name, + @BodyParam("application/json") Ec2VolumeTagsUpdate properties, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/ec2Volumes/{name}") + @ExpectedResponses({ 202, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("name") String name, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listBySubscriptionNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroupNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); + } + + /** + * List Ec2Volume resources by subscription ID. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Ec2Volume list operation along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync() { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), + res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List Ec2Volume resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Ec2Volume list operation along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), accept, + context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * List Ec2Volume resources by subscription ID. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Ec2Volume list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>(() -> listSinglePageAsync(), + nextLink -> listBySubscriptionNextSinglePageAsync(nextLink)); + } + + /** + * List Ec2Volume resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Ec2Volume list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(Context context) { + return new PagedFlux<>(() -> listSinglePageAsync(context), + nextLink -> listBySubscriptionNextSinglePageAsync(nextLink, context)); + } + + /** + * List Ec2Volume resources by subscription ID. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Ec2Volume list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + return new PagedIterable<>(listAsync()); + } + + /** + * List Ec2Volume resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Ec2Volume list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Context context) { + return new PagedIterable<>(listAsync(context)); + } + + /** + * List Ec2Volume resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Ec2Volume list operation along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), + res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List Ec2Volume resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Ec2Volume list operation along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * List Ec2Volume resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Ec2Volume list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName) { + return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); + } + + /** + * List Ec2Volume resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Ec2Volume list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName, Context context) { + return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName, context), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink, context)); + } + + /** + * List Ec2Volume resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Ec2Volume list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName)); + } + + /** + * List Ec2Volume resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Ec2Volume list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, context)); + } + + /** + * Get a Ec2Volume. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2Volume. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Ec2Volume along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync(String resourceGroupName, String name) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.getByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get a Ec2Volume. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2Volume. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Ec2Volume along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync(String resourceGroupName, String name, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.getByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, accept, context); + } + + /** + * Get a Ec2Volume. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2Volume. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Ec2Volume on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getByResourceGroupAsync(String resourceGroupName, String name) { + return getByResourceGroupWithResponseAsync(resourceGroupName, name) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Get a Ec2Volume. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2Volume. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Ec2Volume along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getByResourceGroupWithResponse(String resourceGroupName, String name, + Context context) { + return getByResourceGroupWithResponseAsync(resourceGroupName, name, context).block(); + } + + /** + * Get a Ec2Volume. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2Volume. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Ec2Volume. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Ec2VolumeInner getByResourceGroup(String resourceGroupName, String name) { + return getByResourceGroupWithResponse(resourceGroupName, name, Context.NONE).getValue(); + } + + /** + * Create a Ec2Volume. Please note that end user resource creation is currently restricted, but it will be enabled + * in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2Volume. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrReplaceWithResponseAsync(String resourceGroupName, String name, + Ec2VolumeInner resource) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (resource == null) { + return Mono.error(new IllegalArgumentException("Parameter resource is required and cannot be null.")); + } else { + resource.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.createOrReplace(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, resource, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Create a Ec2Volume. Please note that end user resource creation is currently restricted, but it will be enabled + * in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2Volume. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrReplaceWithResponseAsync(String resourceGroupName, String name, + Ec2VolumeInner resource, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (resource == null) { + return Mono.error(new IllegalArgumentException("Parameter resource is required and cannot be null.")); + } else { + resource.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.createOrReplace(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, resource, accept, context); + } + + /** + * Create a Ec2Volume. Please note that end user resource creation is currently restricted, but it will be enabled + * in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2Volume. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Ec2VolumeInner> beginCreateOrReplaceAsync(String resourceGroupName, + String name, Ec2VolumeInner resource) { + Mono>> mono = createOrReplaceWithResponseAsync(resourceGroupName, name, resource); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + Ec2VolumeInner.class, Ec2VolumeInner.class, this.client.getContext()); + } + + /** + * Create a Ec2Volume. Please note that end user resource creation is currently restricted, but it will be enabled + * in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2Volume. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Ec2VolumeInner> beginCreateOrReplaceAsync(String resourceGroupName, + String name, Ec2VolumeInner resource, Context context) { + context = this.client.mergeContext(context); + Mono>> mono + = createOrReplaceWithResponseAsync(resourceGroupName, name, resource, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + Ec2VolumeInner.class, Ec2VolumeInner.class, context); + } + + /** + * Create a Ec2Volume. Please note that end user resource creation is currently restricted, but it will be enabled + * in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2Volume. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Ec2VolumeInner> beginCreateOrReplace(String resourceGroupName, + String name, Ec2VolumeInner resource) { + return this.beginCreateOrReplaceAsync(resourceGroupName, name, resource).getSyncPoller(); + } + + /** + * Create a Ec2Volume. Please note that end user resource creation is currently restricted, but it will be enabled + * in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2Volume. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Ec2VolumeInner> beginCreateOrReplace(String resourceGroupName, + String name, Ec2VolumeInner resource, Context context) { + return this.beginCreateOrReplaceAsync(resourceGroupName, name, resource, context).getSyncPoller(); + } + + /** + * Create a Ec2Volume. Please note that end user resource creation is currently restricted, but it will be enabled + * in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2Volume. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrReplaceAsync(String resourceGroupName, String name, Ec2VolumeInner resource) { + return beginCreateOrReplaceAsync(resourceGroupName, name, resource).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create a Ec2Volume. Please note that end user resource creation is currently restricted, but it will be enabled + * in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2Volume. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrReplaceAsync(String resourceGroupName, String name, Ec2VolumeInner resource, + Context context) { + return beginCreateOrReplaceAsync(resourceGroupName, name, resource, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create a Ec2Volume. Please note that end user resource creation is currently restricted, but it will be enabled + * in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2Volume. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Ec2VolumeInner createOrReplace(String resourceGroupName, String name, Ec2VolumeInner resource) { + return createOrReplaceAsync(resourceGroupName, name, resource).block(); + } + + /** + * Create a Ec2Volume. Please note that end user resource creation is currently restricted, but it will be enabled + * in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2Volume. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Ec2VolumeInner createOrReplace(String resourceGroupName, String name, Ec2VolumeInner resource, + Context context) { + return createOrReplaceAsync(resourceGroupName, name, resource, context).block(); + } + + /** + * Update a Ec2Volume. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2Volume. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync(String resourceGroupName, String name, + Ec2VolumeTagsUpdate properties) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (properties == null) { + return Mono.error(new IllegalArgumentException("Parameter properties is required and cannot be null.")); + } else { + properties.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.update(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, properties, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Update a Ec2Volume. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2Volume. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync(String resourceGroupName, String name, + Ec2VolumeTagsUpdate properties, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (properties == null) { + return Mono.error(new IllegalArgumentException("Parameter properties is required and cannot be null.")); + } else { + properties.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.update(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, name, properties, accept, context); + } + + /** + * Update a Ec2Volume. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2Volume. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Ec2VolumeInner> beginUpdateAsync(String resourceGroupName, + String name, Ec2VolumeTagsUpdate properties) { + Mono>> mono = updateWithResponseAsync(resourceGroupName, name, properties); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + Ec2VolumeInner.class, Ec2VolumeInner.class, this.client.getContext()); + } + + /** + * Update a Ec2Volume. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2Volume. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Ec2VolumeInner> beginUpdateAsync(String resourceGroupName, + String name, Ec2VolumeTagsUpdate properties, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = updateWithResponseAsync(resourceGroupName, name, properties, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + Ec2VolumeInner.class, Ec2VolumeInner.class, context); + } + + /** + * Update a Ec2Volume. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2Volume. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Ec2VolumeInner> beginUpdate(String resourceGroupName, String name, + Ec2VolumeTagsUpdate properties) { + return this.beginUpdateAsync(resourceGroupName, name, properties).getSyncPoller(); + } + + /** + * Update a Ec2Volume. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2Volume. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Ec2VolumeInner> beginUpdate(String resourceGroupName, String name, + Ec2VolumeTagsUpdate properties, Context context) { + return this.beginUpdateAsync(resourceGroupName, name, properties, context).getSyncPoller(); + } + + /** + * Update a Ec2Volume. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2Volume. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync(String resourceGroupName, String name, Ec2VolumeTagsUpdate properties) { + return beginUpdateAsync(resourceGroupName, name, properties).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Update a Ec2Volume. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2Volume. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync(String resourceGroupName, String name, Ec2VolumeTagsUpdate properties, + Context context) { + return beginUpdateAsync(resourceGroupName, name, properties, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Update a Ec2Volume. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2Volume. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Ec2VolumeInner update(String resourceGroupName, String name, Ec2VolumeTagsUpdate properties) { + return updateAsync(resourceGroupName, name, properties).block(); + } + + /** + * Update a Ec2Volume. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2Volume. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Ec2VolumeInner update(String resourceGroupName, String name, Ec2VolumeTagsUpdate properties, + Context context) { + return updateAsync(resourceGroupName, name, properties, context).block(); + } + + /** + * Delete a Ec2Volume. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2Volume. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync(String resourceGroupName, String name) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Delete a Ec2Volume. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2Volume. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync(String resourceGroupName, String name, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.delete(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, name, accept, context); + } + + /** + * Delete a Ec2Volume. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2Volume. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String name) { + Mono>> mono = deleteWithResponseAsync(resourceGroupName, name); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); + } + + /** + * Delete a Ec2Volume. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2Volume. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String name, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = deleteWithResponseAsync(resourceGroupName, name, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + context); + } + + /** + * Delete a Ec2Volume. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2Volume. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String name) { + return this.beginDeleteAsync(resourceGroupName, name).getSyncPoller(); + } + + /** + * Delete a Ec2Volume. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2Volume. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String name, Context context) { + return this.beginDeleteAsync(resourceGroupName, name, context).getSyncPoller(); + } + + /** + * Delete a Ec2Volume. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2Volume. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String name) { + return beginDeleteAsync(resourceGroupName, name).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete a Ec2Volume. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2Volume. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String name, Context context) { + return beginDeleteAsync(resourceGroupName, name, context).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete a Ec2Volume. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2Volume. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String name) { + deleteAsync(resourceGroupName, name).block(); + } + + /** + * Delete a Ec2Volume. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2Volume. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String name, Context context) { + deleteAsync(resourceGroupName, name, context).block(); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Ec2Volume list operation along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listBySubscriptionNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), + res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Ec2Volume list operation along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listBySubscriptionNextSinglePageAsync(String nextLink, + Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Ec2Volume list operation along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), + res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Ec2Volume list operation along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupNextSinglePageAsync(String nextLink, + Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/Ec2VolumesImpl.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/Ec2VolumesImpl.java new file mode 100644 index 000000000000..92135beb9b5f --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/Ec2VolumesImpl.java @@ -0,0 +1,145 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.awsconnector.fluent.Ec2VolumesClient; +import com.azure.resourcemanager.awsconnector.fluent.models.Ec2VolumeInner; +import com.azure.resourcemanager.awsconnector.models.Ec2Volume; +import com.azure.resourcemanager.awsconnector.models.Ec2Volumes; + +public final class Ec2VolumesImpl implements Ec2Volumes { + private static final ClientLogger LOGGER = new ClientLogger(Ec2VolumesImpl.class); + + private final Ec2VolumesClient innerClient; + + private final com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager; + + public Ec2VolumesImpl(Ec2VolumesClient innerClient, + com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return ResourceManagerUtils.mapPage(inner, inner1 -> new Ec2VolumeImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new Ec2VolumeImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName); + return ResourceManagerUtils.mapPage(inner, inner1 -> new Ec2VolumeImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new Ec2VolumeImpl(inner1, this.manager())); + } + + public Response getByResourceGroupWithResponse(String resourceGroupName, String name, Context context) { + Response inner + = this.serviceClient().getByResourceGroupWithResponse(resourceGroupName, name, context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new Ec2VolumeImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public Ec2Volume getByResourceGroup(String resourceGroupName, String name) { + Ec2VolumeInner inner = this.serviceClient().getByResourceGroup(resourceGroupName, name); + if (inner != null) { + return new Ec2VolumeImpl(inner, this.manager()); + } else { + return null; + } + } + + public void deleteByResourceGroup(String resourceGroupName, String name) { + this.serviceClient().delete(resourceGroupName, name); + } + + public void delete(String resourceGroupName, String name, Context context) { + this.serviceClient().delete(resourceGroupName, name, context); + } + + public Ec2Volume getById(String id) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String name = ResourceManagerUtils.getValueFromIdByName(id, "ec2Volumes"); + if (name == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'ec2Volumes'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, name, Context.NONE).getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String name = ResourceManagerUtils.getValueFromIdByName(id, "ec2Volumes"); + if (name == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'ec2Volumes'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, name, context); + } + + public void deleteById(String id) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String name = ResourceManagerUtils.getValueFromIdByName(id, "ec2Volumes"); + if (name == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'ec2Volumes'.", id))); + } + this.delete(resourceGroupName, name, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String name = ResourceManagerUtils.getValueFromIdByName(id, "ec2Volumes"); + if (name == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'ec2Volumes'.", id))); + } + this.delete(resourceGroupName, name, context); + } + + private Ec2VolumesClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.awsconnector.AwsconnectorManager manager() { + return this.serviceManager; + } + + public Ec2VolumeImpl define(String name) { + return new Ec2VolumeImpl(name, this.manager()); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/Ec2VpcEndpointImpl.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/Ec2VpcEndpointImpl.java new file mode 100644 index 000000000000..45223c517e6a --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/Ec2VpcEndpointImpl.java @@ -0,0 +1,177 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.implementation; + +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.awsconnector.fluent.models.Ec2VpcEndpointInner; +import com.azure.resourcemanager.awsconnector.models.Ec2VpcEndpoint; +import com.azure.resourcemanager.awsconnector.models.Ec2VpcEndpointProperties; +import com.azure.resourcemanager.awsconnector.models.Ec2VpcEndpointTagsUpdate; +import java.util.Collections; +import java.util.Map; + +public final class Ec2VpcEndpointImpl implements Ec2VpcEndpoint, Ec2VpcEndpoint.Definition, Ec2VpcEndpoint.Update { + private Ec2VpcEndpointInner innerObject; + + private final com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public String location() { + return this.innerModel().location(); + } + + public Map tags() { + Map inner = this.innerModel().tags(); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } + } + + public Ec2VpcEndpointProperties properties() { + return this.innerModel().properties(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public String resourceGroupName() { + return resourceGroupName; + } + + public Ec2VpcEndpointInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.awsconnector.AwsconnectorManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String name; + + private Ec2VpcEndpointTagsUpdate updateProperties; + + public Ec2VpcEndpointImpl withExistingResourceGroup(String resourceGroupName) { + this.resourceGroupName = resourceGroupName; + return this; + } + + public Ec2VpcEndpoint create() { + this.innerObject = serviceManager.serviceClient() + .getEc2VpcEndpoints() + .createOrReplace(resourceGroupName, name, this.innerModel(), Context.NONE); + return this; + } + + public Ec2VpcEndpoint create(Context context) { + this.innerObject = serviceManager.serviceClient() + .getEc2VpcEndpoints() + .createOrReplace(resourceGroupName, name, this.innerModel(), context); + return this; + } + + Ec2VpcEndpointImpl(String name, com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager) { + this.innerObject = new Ec2VpcEndpointInner(); + this.serviceManager = serviceManager; + this.name = name; + } + + public Ec2VpcEndpointImpl update() { + this.updateProperties = new Ec2VpcEndpointTagsUpdate(); + return this; + } + + public Ec2VpcEndpoint apply() { + this.innerObject = serviceManager.serviceClient() + .getEc2VpcEndpoints() + .update(resourceGroupName, name, updateProperties, Context.NONE); + return this; + } + + public Ec2VpcEndpoint apply(Context context) { + this.innerObject = serviceManager.serviceClient() + .getEc2VpcEndpoints() + .update(resourceGroupName, name, updateProperties, context); + return this; + } + + Ec2VpcEndpointImpl(Ec2VpcEndpointInner innerObject, + com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.name = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "ec2VPCEndpoints"); + } + + public Ec2VpcEndpoint refresh() { + this.innerObject = serviceManager.serviceClient() + .getEc2VpcEndpoints() + .getByResourceGroupWithResponse(resourceGroupName, name, Context.NONE) + .getValue(); + return this; + } + + public Ec2VpcEndpoint refresh(Context context) { + this.innerObject = serviceManager.serviceClient() + .getEc2VpcEndpoints() + .getByResourceGroupWithResponse(resourceGroupName, name, context) + .getValue(); + return this; + } + + public Ec2VpcEndpointImpl withRegion(Region location) { + this.innerModel().withLocation(location.toString()); + return this; + } + + public Ec2VpcEndpointImpl withRegion(String location) { + this.innerModel().withLocation(location); + return this; + } + + public Ec2VpcEndpointImpl withTags(Map tags) { + if (isInCreateMode()) { + this.innerModel().withTags(tags); + return this; + } else { + this.updateProperties.withTags(tags); + return this; + } + } + + public Ec2VpcEndpointImpl withProperties(Ec2VpcEndpointProperties properties) { + this.innerModel().withProperties(properties); + return this; + } + + private boolean isInCreateMode() { + return this.innerModel().id() == null; + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/Ec2VpcEndpointsClientImpl.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/Ec2VpcEndpointsClientImpl.java new file mode 100644 index 000000000000..69f2115429d1 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/Ec2VpcEndpointsClientImpl.java @@ -0,0 +1,1278 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.Patch; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.awsconnector.fluent.Ec2VpcEndpointsClient; +import com.azure.resourcemanager.awsconnector.fluent.models.Ec2VpcEndpointInner; +import com.azure.resourcemanager.awsconnector.models.Ec2VpcEndpointListResult; +import com.azure.resourcemanager.awsconnector.models.Ec2VpcEndpointTagsUpdate; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in Ec2VpcEndpointsClient. + */ +public final class Ec2VpcEndpointsClientImpl implements Ec2VpcEndpointsClient { + /** + * The proxy service used to perform REST calls. + */ + private final Ec2VpcEndpointsService service; + + /** + * The service client containing this operation class. + */ + private final MicrosoftAwsConnectorImpl client; + + /** + * Initializes an instance of Ec2VpcEndpointsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + Ec2VpcEndpointsClientImpl(MicrosoftAwsConnectorImpl client) { + this.service + = RestProxy.create(Ec2VpcEndpointsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for MicrosoftAwsConnectorEc2VpcEndpoints to be used by the proxy service + * to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "MicrosoftAwsConnecto") + public interface Ec2VpcEndpointsService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.AwsConnector/ec2VPCEndpoints") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/ec2VPCEndpoints") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroup(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/ec2VPCEndpoints/{name}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getByResourceGroup(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("name") String name, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/ec2VPCEndpoints/{name}") + @ExpectedResponses({ 200, 201 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrReplace(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("name") String name, + @BodyParam("application/json") Ec2VpcEndpointInner resource, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/ec2VPCEndpoints/{name}") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> update(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("name") String name, + @BodyParam("application/json") Ec2VpcEndpointTagsUpdate properties, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/ec2VPCEndpoints/{name}") + @ExpectedResponses({ 202, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("name") String name, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listBySubscriptionNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroupNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); + } + + /** + * List Ec2VPCEndpoint resources by subscription ID. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Ec2VPCEndpoint list operation along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync() { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List Ec2VPCEndpoint resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Ec2VPCEndpoint list operation along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), accept, + context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * List Ec2VPCEndpoint resources by subscription ID. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Ec2VPCEndpoint list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>(() -> listSinglePageAsync(), + nextLink -> listBySubscriptionNextSinglePageAsync(nextLink)); + } + + /** + * List Ec2VPCEndpoint resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Ec2VPCEndpoint list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(Context context) { + return new PagedFlux<>(() -> listSinglePageAsync(context), + nextLink -> listBySubscriptionNextSinglePageAsync(nextLink, context)); + } + + /** + * List Ec2VPCEndpoint resources by subscription ID. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Ec2VPCEndpoint list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + return new PagedIterable<>(listAsync()); + } + + /** + * List Ec2VPCEndpoint resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Ec2VPCEndpoint list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Context context) { + return new PagedIterable<>(listAsync(context)); + } + + /** + * List Ec2VPCEndpoint resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Ec2VPCEndpoint list operation along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List Ec2VPCEndpoint resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Ec2VPCEndpoint list operation along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * List Ec2VPCEndpoint resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Ec2VPCEndpoint list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName) { + return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); + } + + /** + * List Ec2VPCEndpoint resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Ec2VPCEndpoint list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName, Context context) { + return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName, context), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink, context)); + } + + /** + * List Ec2VPCEndpoint resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Ec2VPCEndpoint list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName)); + } + + /** + * List Ec2VPCEndpoint resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Ec2VPCEndpoint list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, context)); + } + + /** + * Get a Ec2VPCEndpoint. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2VPCEndpoint. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Ec2VPCEndpoint along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync(String resourceGroupName, + String name) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.getByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get a Ec2VPCEndpoint. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2VPCEndpoint. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Ec2VPCEndpoint along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync(String resourceGroupName, + String name, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.getByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, accept, context); + } + + /** + * Get a Ec2VPCEndpoint. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2VPCEndpoint. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Ec2VPCEndpoint on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getByResourceGroupAsync(String resourceGroupName, String name) { + return getByResourceGroupWithResponseAsync(resourceGroupName, name) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Get a Ec2VPCEndpoint. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2VPCEndpoint. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Ec2VPCEndpoint along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getByResourceGroupWithResponse(String resourceGroupName, String name, + Context context) { + return getByResourceGroupWithResponseAsync(resourceGroupName, name, context).block(); + } + + /** + * Get a Ec2VPCEndpoint. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2VPCEndpoint. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Ec2VPCEndpoint. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Ec2VpcEndpointInner getByResourceGroup(String resourceGroupName, String name) { + return getByResourceGroupWithResponse(resourceGroupName, name, Context.NONE).getValue(); + } + + /** + * Create a Ec2VPCEndpoint. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2VPCEndpoint. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrReplaceWithResponseAsync(String resourceGroupName, String name, + Ec2VpcEndpointInner resource) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (resource == null) { + return Mono.error(new IllegalArgumentException("Parameter resource is required and cannot be null.")); + } else { + resource.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.createOrReplace(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, resource, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Create a Ec2VPCEndpoint. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2VPCEndpoint. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrReplaceWithResponseAsync(String resourceGroupName, String name, + Ec2VpcEndpointInner resource, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (resource == null) { + return Mono.error(new IllegalArgumentException("Parameter resource is required and cannot be null.")); + } else { + resource.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.createOrReplace(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, resource, accept, context); + } + + /** + * Create a Ec2VPCEndpoint. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2VPCEndpoint. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Ec2VpcEndpointInner> + beginCreateOrReplaceAsync(String resourceGroupName, String name, Ec2VpcEndpointInner resource) { + Mono>> mono = createOrReplaceWithResponseAsync(resourceGroupName, name, resource); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + Ec2VpcEndpointInner.class, Ec2VpcEndpointInner.class, this.client.getContext()); + } + + /** + * Create a Ec2VPCEndpoint. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2VPCEndpoint. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Ec2VpcEndpointInner> beginCreateOrReplaceAsync( + String resourceGroupName, String name, Ec2VpcEndpointInner resource, Context context) { + context = this.client.mergeContext(context); + Mono>> mono + = createOrReplaceWithResponseAsync(resourceGroupName, name, resource, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + Ec2VpcEndpointInner.class, Ec2VpcEndpointInner.class, context); + } + + /** + * Create a Ec2VPCEndpoint. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2VPCEndpoint. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Ec2VpcEndpointInner> + beginCreateOrReplace(String resourceGroupName, String name, Ec2VpcEndpointInner resource) { + return this.beginCreateOrReplaceAsync(resourceGroupName, name, resource).getSyncPoller(); + } + + /** + * Create a Ec2VPCEndpoint. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2VPCEndpoint. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Ec2VpcEndpointInner> + beginCreateOrReplace(String resourceGroupName, String name, Ec2VpcEndpointInner resource, Context context) { + return this.beginCreateOrReplaceAsync(resourceGroupName, name, resource, context).getSyncPoller(); + } + + /** + * Create a Ec2VPCEndpoint. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2VPCEndpoint. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrReplaceAsync(String resourceGroupName, String name, + Ec2VpcEndpointInner resource) { + return beginCreateOrReplaceAsync(resourceGroupName, name, resource).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create a Ec2VPCEndpoint. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2VPCEndpoint. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrReplaceAsync(String resourceGroupName, String name, + Ec2VpcEndpointInner resource, Context context) { + return beginCreateOrReplaceAsync(resourceGroupName, name, resource, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create a Ec2VPCEndpoint. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2VPCEndpoint. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Ec2VpcEndpointInner createOrReplace(String resourceGroupName, String name, Ec2VpcEndpointInner resource) { + return createOrReplaceAsync(resourceGroupName, name, resource).block(); + } + + /** + * Create a Ec2VPCEndpoint. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2VPCEndpoint. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Ec2VpcEndpointInner createOrReplace(String resourceGroupName, String name, Ec2VpcEndpointInner resource, + Context context) { + return createOrReplaceAsync(resourceGroupName, name, resource, context).block(); + } + + /** + * Update a Ec2VPCEndpoint. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2VPCEndpoint. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync(String resourceGroupName, String name, + Ec2VpcEndpointTagsUpdate properties) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (properties == null) { + return Mono.error(new IllegalArgumentException("Parameter properties is required and cannot be null.")); + } else { + properties.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.update(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, properties, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Update a Ec2VPCEndpoint. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2VPCEndpoint. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync(String resourceGroupName, String name, + Ec2VpcEndpointTagsUpdate properties, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (properties == null) { + return Mono.error(new IllegalArgumentException("Parameter properties is required and cannot be null.")); + } else { + properties.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.update(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, name, properties, accept, context); + } + + /** + * Update a Ec2VPCEndpoint. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2VPCEndpoint. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Ec2VpcEndpointInner> beginUpdateAsync(String resourceGroupName, + String name, Ec2VpcEndpointTagsUpdate properties) { + Mono>> mono = updateWithResponseAsync(resourceGroupName, name, properties); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + Ec2VpcEndpointInner.class, Ec2VpcEndpointInner.class, this.client.getContext()); + } + + /** + * Update a Ec2VPCEndpoint. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2VPCEndpoint. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Ec2VpcEndpointInner> beginUpdateAsync(String resourceGroupName, + String name, Ec2VpcEndpointTagsUpdate properties, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = updateWithResponseAsync(resourceGroupName, name, properties, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + Ec2VpcEndpointInner.class, Ec2VpcEndpointInner.class, context); + } + + /** + * Update a Ec2VPCEndpoint. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2VPCEndpoint. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Ec2VpcEndpointInner> beginUpdate(String resourceGroupName, + String name, Ec2VpcEndpointTagsUpdate properties) { + return this.beginUpdateAsync(resourceGroupName, name, properties).getSyncPoller(); + } + + /** + * Update a Ec2VPCEndpoint. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2VPCEndpoint. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Ec2VpcEndpointInner> beginUpdate(String resourceGroupName, + String name, Ec2VpcEndpointTagsUpdate properties, Context context) { + return this.beginUpdateAsync(resourceGroupName, name, properties, context).getSyncPoller(); + } + + /** + * Update a Ec2VPCEndpoint. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2VPCEndpoint. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync(String resourceGroupName, String name, + Ec2VpcEndpointTagsUpdate properties) { + return beginUpdateAsync(resourceGroupName, name, properties).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Update a Ec2VPCEndpoint. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2VPCEndpoint. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync(String resourceGroupName, String name, + Ec2VpcEndpointTagsUpdate properties, Context context) { + return beginUpdateAsync(resourceGroupName, name, properties, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Update a Ec2VPCEndpoint. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2VPCEndpoint. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Ec2VpcEndpointInner update(String resourceGroupName, String name, Ec2VpcEndpointTagsUpdate properties) { + return updateAsync(resourceGroupName, name, properties).block(); + } + + /** + * Update a Ec2VPCEndpoint. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2VPCEndpoint. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Ec2VpcEndpointInner update(String resourceGroupName, String name, Ec2VpcEndpointTagsUpdate properties, + Context context) { + return updateAsync(resourceGroupName, name, properties, context).block(); + } + + /** + * Delete a Ec2VPCEndpoint. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2VPCEndpoint. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync(String resourceGroupName, String name) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Delete a Ec2VPCEndpoint. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2VPCEndpoint. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync(String resourceGroupName, String name, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.delete(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, name, accept, context); + } + + /** + * Delete a Ec2VPCEndpoint. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2VPCEndpoint. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String name) { + Mono>> mono = deleteWithResponseAsync(resourceGroupName, name); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); + } + + /** + * Delete a Ec2VPCEndpoint. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2VPCEndpoint. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String name, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = deleteWithResponseAsync(resourceGroupName, name, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + context); + } + + /** + * Delete a Ec2VPCEndpoint. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2VPCEndpoint. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String name) { + return this.beginDeleteAsync(resourceGroupName, name).getSyncPoller(); + } + + /** + * Delete a Ec2VPCEndpoint. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2VPCEndpoint. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String name, Context context) { + return this.beginDeleteAsync(resourceGroupName, name, context).getSyncPoller(); + } + + /** + * Delete a Ec2VPCEndpoint. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2VPCEndpoint. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String name) { + return beginDeleteAsync(resourceGroupName, name).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete a Ec2VPCEndpoint. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2VPCEndpoint. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String name, Context context) { + return beginDeleteAsync(resourceGroupName, name, context).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete a Ec2VPCEndpoint. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2VPCEndpoint. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String name) { + deleteAsync(resourceGroupName, name).block(); + } + + /** + * Delete a Ec2VPCEndpoint. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2VPCEndpoint. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String name, Context context) { + deleteAsync(resourceGroupName, name, context).block(); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Ec2VPCEndpoint list operation along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listBySubscriptionNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Ec2VPCEndpoint list operation along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listBySubscriptionNextSinglePageAsync(String nextLink, + Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Ec2VPCEndpoint list operation along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Ec2VPCEndpoint list operation along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupNextSinglePageAsync(String nextLink, + Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/Ec2VpcEndpointsImpl.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/Ec2VpcEndpointsImpl.java new file mode 100644 index 000000000000..1888ccbd0f6c --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/Ec2VpcEndpointsImpl.java @@ -0,0 +1,146 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.awsconnector.fluent.Ec2VpcEndpointsClient; +import com.azure.resourcemanager.awsconnector.fluent.models.Ec2VpcEndpointInner; +import com.azure.resourcemanager.awsconnector.models.Ec2VpcEndpoint; +import com.azure.resourcemanager.awsconnector.models.Ec2VpcEndpoints; + +public final class Ec2VpcEndpointsImpl implements Ec2VpcEndpoints { + private static final ClientLogger LOGGER = new ClientLogger(Ec2VpcEndpointsImpl.class); + + private final Ec2VpcEndpointsClient innerClient; + + private final com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager; + + public Ec2VpcEndpointsImpl(Ec2VpcEndpointsClient innerClient, + com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return ResourceManagerUtils.mapPage(inner, inner1 -> new Ec2VpcEndpointImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new Ec2VpcEndpointImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName); + return ResourceManagerUtils.mapPage(inner, inner1 -> new Ec2VpcEndpointImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new Ec2VpcEndpointImpl(inner1, this.manager())); + } + + public Response getByResourceGroupWithResponse(String resourceGroupName, String name, + Context context) { + Response inner + = this.serviceClient().getByResourceGroupWithResponse(resourceGroupName, name, context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new Ec2VpcEndpointImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public Ec2VpcEndpoint getByResourceGroup(String resourceGroupName, String name) { + Ec2VpcEndpointInner inner = this.serviceClient().getByResourceGroup(resourceGroupName, name); + if (inner != null) { + return new Ec2VpcEndpointImpl(inner, this.manager()); + } else { + return null; + } + } + + public void deleteByResourceGroup(String resourceGroupName, String name) { + this.serviceClient().delete(resourceGroupName, name); + } + + public void delete(String resourceGroupName, String name, Context context) { + this.serviceClient().delete(resourceGroupName, name, context); + } + + public Ec2VpcEndpoint getById(String id) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String name = ResourceManagerUtils.getValueFromIdByName(id, "ec2VPCEndpoints"); + if (name == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'ec2VPCEndpoints'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, name, Context.NONE).getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String name = ResourceManagerUtils.getValueFromIdByName(id, "ec2VPCEndpoints"); + if (name == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'ec2VPCEndpoints'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, name, context); + } + + public void deleteById(String id) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String name = ResourceManagerUtils.getValueFromIdByName(id, "ec2VPCEndpoints"); + if (name == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'ec2VPCEndpoints'.", id))); + } + this.delete(resourceGroupName, name, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String name = ResourceManagerUtils.getValueFromIdByName(id, "ec2VPCEndpoints"); + if (name == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'ec2VPCEndpoints'.", id))); + } + this.delete(resourceGroupName, name, context); + } + + private Ec2VpcEndpointsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.awsconnector.AwsconnectorManager manager() { + return this.serviceManager; + } + + public Ec2VpcEndpointImpl define(String name) { + return new Ec2VpcEndpointImpl(name, this.manager()); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/Ec2VpcImpl.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/Ec2VpcImpl.java new file mode 100644 index 000000000000..36824488f0a6 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/Ec2VpcImpl.java @@ -0,0 +1,175 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.implementation; + +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.awsconnector.fluent.models.Ec2VpcInner; +import com.azure.resourcemanager.awsconnector.models.Ec2Vpc; +import com.azure.resourcemanager.awsconnector.models.Ec2VpcProperties; +import com.azure.resourcemanager.awsconnector.models.Ec2VpcTagsUpdate; +import java.util.Collections; +import java.util.Map; + +public final class Ec2VpcImpl implements Ec2Vpc, Ec2Vpc.Definition, Ec2Vpc.Update { + private Ec2VpcInner innerObject; + + private final com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public String location() { + return this.innerModel().location(); + } + + public Map tags() { + Map inner = this.innerModel().tags(); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } + } + + public Ec2VpcProperties properties() { + return this.innerModel().properties(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public String resourceGroupName() { + return resourceGroupName; + } + + public Ec2VpcInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.awsconnector.AwsconnectorManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String name; + + private Ec2VpcTagsUpdate updateProperties; + + public Ec2VpcImpl withExistingResourceGroup(String resourceGroupName) { + this.resourceGroupName = resourceGroupName; + return this; + } + + public Ec2Vpc create() { + this.innerObject = serviceManager.serviceClient() + .getEc2Vpcs() + .createOrReplace(resourceGroupName, name, this.innerModel(), Context.NONE); + return this; + } + + public Ec2Vpc create(Context context) { + this.innerObject = serviceManager.serviceClient() + .getEc2Vpcs() + .createOrReplace(resourceGroupName, name, this.innerModel(), context); + return this; + } + + Ec2VpcImpl(String name, com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager) { + this.innerObject = new Ec2VpcInner(); + this.serviceManager = serviceManager; + this.name = name; + } + + public Ec2VpcImpl update() { + this.updateProperties = new Ec2VpcTagsUpdate(); + return this; + } + + public Ec2Vpc apply() { + this.innerObject = serviceManager.serviceClient() + .getEc2Vpcs() + .update(resourceGroupName, name, updateProperties, Context.NONE); + return this; + } + + public Ec2Vpc apply(Context context) { + this.innerObject + = serviceManager.serviceClient().getEc2Vpcs().update(resourceGroupName, name, updateProperties, context); + return this; + } + + Ec2VpcImpl(Ec2VpcInner innerObject, com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.name = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "ec2Vpcs"); + } + + public Ec2Vpc refresh() { + this.innerObject = serviceManager.serviceClient() + .getEc2Vpcs() + .getByResourceGroupWithResponse(resourceGroupName, name, Context.NONE) + .getValue(); + return this; + } + + public Ec2Vpc refresh(Context context) { + this.innerObject = serviceManager.serviceClient() + .getEc2Vpcs() + .getByResourceGroupWithResponse(resourceGroupName, name, context) + .getValue(); + return this; + } + + public Ec2VpcImpl withRegion(Region location) { + this.innerModel().withLocation(location.toString()); + return this; + } + + public Ec2VpcImpl withRegion(String location) { + this.innerModel().withLocation(location); + return this; + } + + public Ec2VpcImpl withTags(Map tags) { + if (isInCreateMode()) { + this.innerModel().withTags(tags); + return this; + } else { + this.updateProperties.withTags(tags); + return this; + } + } + + public Ec2VpcImpl withProperties(Ec2VpcProperties properties) { + this.innerModel().withProperties(properties); + return this; + } + + private boolean isInCreateMode() { + return this.innerModel().id() == null; + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/Ec2VpcPeeringConnectionImpl.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/Ec2VpcPeeringConnectionImpl.java new file mode 100644 index 000000000000..c39071eefb2c --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/Ec2VpcPeeringConnectionImpl.java @@ -0,0 +1,179 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.implementation; + +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.awsconnector.fluent.models.Ec2VpcPeeringConnectionInner; +import com.azure.resourcemanager.awsconnector.models.Ec2VpcPeeringConnection; +import com.azure.resourcemanager.awsconnector.models.Ec2VpcPeeringConnectionProperties; +import com.azure.resourcemanager.awsconnector.models.Ec2VpcPeeringConnectionTagsUpdate; +import java.util.Collections; +import java.util.Map; + +public final class Ec2VpcPeeringConnectionImpl + implements Ec2VpcPeeringConnection, Ec2VpcPeeringConnection.Definition, Ec2VpcPeeringConnection.Update { + private Ec2VpcPeeringConnectionInner innerObject; + + private final com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public String location() { + return this.innerModel().location(); + } + + public Map tags() { + Map inner = this.innerModel().tags(); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } + } + + public Ec2VpcPeeringConnectionProperties properties() { + return this.innerModel().properties(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public String resourceGroupName() { + return resourceGroupName; + } + + public Ec2VpcPeeringConnectionInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.awsconnector.AwsconnectorManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String name; + + private Ec2VpcPeeringConnectionTagsUpdate updateProperties; + + public Ec2VpcPeeringConnectionImpl withExistingResourceGroup(String resourceGroupName) { + this.resourceGroupName = resourceGroupName; + return this; + } + + public Ec2VpcPeeringConnection create() { + this.innerObject = serviceManager.serviceClient() + .getEc2VpcPeeringConnections() + .createOrReplace(resourceGroupName, name, this.innerModel(), Context.NONE); + return this; + } + + public Ec2VpcPeeringConnection create(Context context) { + this.innerObject = serviceManager.serviceClient() + .getEc2VpcPeeringConnections() + .createOrReplace(resourceGroupName, name, this.innerModel(), context); + return this; + } + + Ec2VpcPeeringConnectionImpl(String name, + com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager) { + this.innerObject = new Ec2VpcPeeringConnectionInner(); + this.serviceManager = serviceManager; + this.name = name; + } + + public Ec2VpcPeeringConnectionImpl update() { + this.updateProperties = new Ec2VpcPeeringConnectionTagsUpdate(); + return this; + } + + public Ec2VpcPeeringConnection apply() { + this.innerObject = serviceManager.serviceClient() + .getEc2VpcPeeringConnections() + .update(resourceGroupName, name, updateProperties, Context.NONE); + return this; + } + + public Ec2VpcPeeringConnection apply(Context context) { + this.innerObject = serviceManager.serviceClient() + .getEc2VpcPeeringConnections() + .update(resourceGroupName, name, updateProperties, context); + return this; + } + + Ec2VpcPeeringConnectionImpl(Ec2VpcPeeringConnectionInner innerObject, + com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.name = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "ec2VPCPeeringConnections"); + } + + public Ec2VpcPeeringConnection refresh() { + this.innerObject = serviceManager.serviceClient() + .getEc2VpcPeeringConnections() + .getByResourceGroupWithResponse(resourceGroupName, name, Context.NONE) + .getValue(); + return this; + } + + public Ec2VpcPeeringConnection refresh(Context context) { + this.innerObject = serviceManager.serviceClient() + .getEc2VpcPeeringConnections() + .getByResourceGroupWithResponse(resourceGroupName, name, context) + .getValue(); + return this; + } + + public Ec2VpcPeeringConnectionImpl withRegion(Region location) { + this.innerModel().withLocation(location.toString()); + return this; + } + + public Ec2VpcPeeringConnectionImpl withRegion(String location) { + this.innerModel().withLocation(location); + return this; + } + + public Ec2VpcPeeringConnectionImpl withTags(Map tags) { + if (isInCreateMode()) { + this.innerModel().withTags(tags); + return this; + } else { + this.updateProperties.withTags(tags); + return this; + } + } + + public Ec2VpcPeeringConnectionImpl withProperties(Ec2VpcPeeringConnectionProperties properties) { + this.innerModel().withProperties(properties); + return this; + } + + private boolean isInCreateMode() { + return this.innerModel().id() == null; + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/Ec2VpcPeeringConnectionsClientImpl.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/Ec2VpcPeeringConnectionsClientImpl.java new file mode 100644 index 000000000000..eb798bf4504d --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/Ec2VpcPeeringConnectionsClientImpl.java @@ -0,0 +1,1291 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.Patch; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.awsconnector.fluent.Ec2VpcPeeringConnectionsClient; +import com.azure.resourcemanager.awsconnector.fluent.models.Ec2VpcPeeringConnectionInner; +import com.azure.resourcemanager.awsconnector.models.Ec2VpcPeeringConnectionListResult; +import com.azure.resourcemanager.awsconnector.models.Ec2VpcPeeringConnectionTagsUpdate; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in Ec2VpcPeeringConnectionsClient. + */ +public final class Ec2VpcPeeringConnectionsClientImpl implements Ec2VpcPeeringConnectionsClient { + /** + * The proxy service used to perform REST calls. + */ + private final Ec2VpcPeeringConnectionsService service; + + /** + * The service client containing this operation class. + */ + private final MicrosoftAwsConnectorImpl client; + + /** + * Initializes an instance of Ec2VpcPeeringConnectionsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + Ec2VpcPeeringConnectionsClientImpl(MicrosoftAwsConnectorImpl client) { + this.service = RestProxy.create(Ec2VpcPeeringConnectionsService.class, client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for MicrosoftAwsConnectorEc2VpcPeeringConnections to be used by the proxy + * service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "MicrosoftAwsConnecto") + public interface Ec2VpcPeeringConnectionsService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.AwsConnector/ec2VPCPeeringConnections") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/ec2VPCPeeringConnections") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroup(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/ec2VPCPeeringConnections/{name}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getByResourceGroup(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("name") String name, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/ec2VPCPeeringConnections/{name}") + @ExpectedResponses({ 200, 201 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrReplace(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("name") String name, + @BodyParam("application/json") Ec2VpcPeeringConnectionInner resource, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/ec2VPCPeeringConnections/{name}") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> update(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("name") String name, + @BodyParam("application/json") Ec2VpcPeeringConnectionTagsUpdate properties, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/ec2VPCPeeringConnections/{name}") + @ExpectedResponses({ 202, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("name") String name, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listBySubscriptionNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroupNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); + } + + /** + * List Ec2VPCPeeringConnection resources by subscription ID. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Ec2VPCPeeringConnection list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync() { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List Ec2VPCPeeringConnection resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Ec2VPCPeeringConnection list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), accept, + context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * List Ec2VPCPeeringConnection resources by subscription ID. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Ec2VPCPeeringConnection list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>(() -> listSinglePageAsync(), + nextLink -> listBySubscriptionNextSinglePageAsync(nextLink)); + } + + /** + * List Ec2VPCPeeringConnection resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Ec2VPCPeeringConnection list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(Context context) { + return new PagedFlux<>(() -> listSinglePageAsync(context), + nextLink -> listBySubscriptionNextSinglePageAsync(nextLink, context)); + } + + /** + * List Ec2VPCPeeringConnection resources by subscription ID. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Ec2VPCPeeringConnection list operation as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + return new PagedIterable<>(listAsync()); + } + + /** + * List Ec2VPCPeeringConnection resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Ec2VPCPeeringConnection list operation as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Context context) { + return new PagedIterable<>(listAsync(context)); + } + + /** + * List Ec2VPCPeeringConnection resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Ec2VPCPeeringConnection list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> + listByResourceGroupSinglePageAsync(String resourceGroupName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List Ec2VPCPeeringConnection resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Ec2VPCPeeringConnection list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> + listByResourceGroupSinglePageAsync(String resourceGroupName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * List Ec2VPCPeeringConnection resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Ec2VPCPeeringConnection list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName) { + return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); + } + + /** + * List Ec2VPCPeeringConnection resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Ec2VPCPeeringConnection list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName, + Context context) { + return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName, context), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink, context)); + } + + /** + * List Ec2VPCPeeringConnection resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Ec2VPCPeeringConnection list operation as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName)); + } + + /** + * List Ec2VPCPeeringConnection resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Ec2VPCPeeringConnection list operation as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, context)); + } + + /** + * Get a Ec2VPCPeeringConnection. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2VPCPeeringConnection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Ec2VPCPeeringConnection along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync(String resourceGroupName, + String name) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.getByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get a Ec2VPCPeeringConnection. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2VPCPeeringConnection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Ec2VPCPeeringConnection along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync(String resourceGroupName, + String name, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.getByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, accept, context); + } + + /** + * Get a Ec2VPCPeeringConnection. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2VPCPeeringConnection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Ec2VPCPeeringConnection on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getByResourceGroupAsync(String resourceGroupName, String name) { + return getByResourceGroupWithResponseAsync(resourceGroupName, name) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Get a Ec2VPCPeeringConnection. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2VPCPeeringConnection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Ec2VPCPeeringConnection along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getByResourceGroupWithResponse(String resourceGroupName, String name, + Context context) { + return getByResourceGroupWithResponseAsync(resourceGroupName, name, context).block(); + } + + /** + * Get a Ec2VPCPeeringConnection. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2VPCPeeringConnection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Ec2VPCPeeringConnection. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Ec2VpcPeeringConnectionInner getByResourceGroup(String resourceGroupName, String name) { + return getByResourceGroupWithResponse(resourceGroupName, name, Context.NONE).getValue(); + } + + /** + * Create a Ec2VPCPeeringConnection. Please note that end user resource creation is currently restricted, but it + * will be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2VPCPeeringConnection. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrReplaceWithResponseAsync(String resourceGroupName, String name, + Ec2VpcPeeringConnectionInner resource) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (resource == null) { + return Mono.error(new IllegalArgumentException("Parameter resource is required and cannot be null.")); + } else { + resource.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.createOrReplace(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, resource, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Create a Ec2VPCPeeringConnection. Please note that end user resource creation is currently restricted, but it + * will be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2VPCPeeringConnection. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrReplaceWithResponseAsync(String resourceGroupName, String name, + Ec2VpcPeeringConnectionInner resource, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (resource == null) { + return Mono.error(new IllegalArgumentException("Parameter resource is required and cannot be null.")); + } else { + resource.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.createOrReplace(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, resource, accept, context); + } + + /** + * Create a Ec2VPCPeeringConnection. Please note that end user resource creation is currently restricted, but it + * will be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2VPCPeeringConnection. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Ec2VpcPeeringConnectionInner> + beginCreateOrReplaceAsync(String resourceGroupName, String name, Ec2VpcPeeringConnectionInner resource) { + Mono>> mono = createOrReplaceWithResponseAsync(resourceGroupName, name, resource); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), Ec2VpcPeeringConnectionInner.class, Ec2VpcPeeringConnectionInner.class, + this.client.getContext()); + } + + /** + * Create a Ec2VPCPeeringConnection. Please note that end user resource creation is currently restricted, but it + * will be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2VPCPeeringConnection. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Ec2VpcPeeringConnectionInner> + beginCreateOrReplaceAsync(String resourceGroupName, String name, Ec2VpcPeeringConnectionInner resource, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono + = createOrReplaceWithResponseAsync(resourceGroupName, name, resource, context); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), Ec2VpcPeeringConnectionInner.class, Ec2VpcPeeringConnectionInner.class, + context); + } + + /** + * Create a Ec2VPCPeeringConnection. Please note that end user resource creation is currently restricted, but it + * will be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2VPCPeeringConnection. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Ec2VpcPeeringConnectionInner> + beginCreateOrReplace(String resourceGroupName, String name, Ec2VpcPeeringConnectionInner resource) { + return this.beginCreateOrReplaceAsync(resourceGroupName, name, resource).getSyncPoller(); + } + + /** + * Create a Ec2VPCPeeringConnection. Please note that end user resource creation is currently restricted, but it + * will be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2VPCPeeringConnection. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Ec2VpcPeeringConnectionInner> beginCreateOrReplace( + String resourceGroupName, String name, Ec2VpcPeeringConnectionInner resource, Context context) { + return this.beginCreateOrReplaceAsync(resourceGroupName, name, resource, context).getSyncPoller(); + } + + /** + * Create a Ec2VPCPeeringConnection. Please note that end user resource creation is currently restricted, but it + * will be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2VPCPeeringConnection. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrReplaceAsync(String resourceGroupName, String name, + Ec2VpcPeeringConnectionInner resource) { + return beginCreateOrReplaceAsync(resourceGroupName, name, resource).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create a Ec2VPCPeeringConnection. Please note that end user resource creation is currently restricted, but it + * will be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2VPCPeeringConnection. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrReplaceAsync(String resourceGroupName, String name, + Ec2VpcPeeringConnectionInner resource, Context context) { + return beginCreateOrReplaceAsync(resourceGroupName, name, resource, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create a Ec2VPCPeeringConnection. Please note that end user resource creation is currently restricted, but it + * will be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2VPCPeeringConnection. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Ec2VpcPeeringConnectionInner createOrReplace(String resourceGroupName, String name, + Ec2VpcPeeringConnectionInner resource) { + return createOrReplaceAsync(resourceGroupName, name, resource).block(); + } + + /** + * Create a Ec2VPCPeeringConnection. Please note that end user resource creation is currently restricted, but it + * will be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2VPCPeeringConnection. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Ec2VpcPeeringConnectionInner createOrReplace(String resourceGroupName, String name, + Ec2VpcPeeringConnectionInner resource, Context context) { + return createOrReplaceAsync(resourceGroupName, name, resource, context).block(); + } + + /** + * Update a Ec2VPCPeeringConnection. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2VPCPeeringConnection. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync(String resourceGroupName, String name, + Ec2VpcPeeringConnectionTagsUpdate properties) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (properties == null) { + return Mono.error(new IllegalArgumentException("Parameter properties is required and cannot be null.")); + } else { + properties.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.update(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, properties, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Update a Ec2VPCPeeringConnection. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2VPCPeeringConnection. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync(String resourceGroupName, String name, + Ec2VpcPeeringConnectionTagsUpdate properties, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (properties == null) { + return Mono.error(new IllegalArgumentException("Parameter properties is required and cannot be null.")); + } else { + properties.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.update(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, name, properties, accept, context); + } + + /** + * Update a Ec2VPCPeeringConnection. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2VPCPeeringConnection. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Ec2VpcPeeringConnectionInner> + beginUpdateAsync(String resourceGroupName, String name, Ec2VpcPeeringConnectionTagsUpdate properties) { + Mono>> mono = updateWithResponseAsync(resourceGroupName, name, properties); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), Ec2VpcPeeringConnectionInner.class, Ec2VpcPeeringConnectionInner.class, + this.client.getContext()); + } + + /** + * Update a Ec2VPCPeeringConnection. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2VPCPeeringConnection. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Ec2VpcPeeringConnectionInner> beginUpdateAsync( + String resourceGroupName, String name, Ec2VpcPeeringConnectionTagsUpdate properties, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = updateWithResponseAsync(resourceGroupName, name, properties, context); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), Ec2VpcPeeringConnectionInner.class, Ec2VpcPeeringConnectionInner.class, + context); + } + + /** + * Update a Ec2VPCPeeringConnection. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2VPCPeeringConnection. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Ec2VpcPeeringConnectionInner> + beginUpdate(String resourceGroupName, String name, Ec2VpcPeeringConnectionTagsUpdate properties) { + return this.beginUpdateAsync(resourceGroupName, name, properties).getSyncPoller(); + } + + /** + * Update a Ec2VPCPeeringConnection. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2VPCPeeringConnection. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Ec2VpcPeeringConnectionInner> beginUpdate( + String resourceGroupName, String name, Ec2VpcPeeringConnectionTagsUpdate properties, Context context) { + return this.beginUpdateAsync(resourceGroupName, name, properties, context).getSyncPoller(); + } + + /** + * Update a Ec2VPCPeeringConnection. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2VPCPeeringConnection. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync(String resourceGroupName, String name, + Ec2VpcPeeringConnectionTagsUpdate properties) { + return beginUpdateAsync(resourceGroupName, name, properties).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Update a Ec2VPCPeeringConnection. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2VPCPeeringConnection. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync(String resourceGroupName, String name, + Ec2VpcPeeringConnectionTagsUpdate properties, Context context) { + return beginUpdateAsync(resourceGroupName, name, properties, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Update a Ec2VPCPeeringConnection. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2VPCPeeringConnection. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Ec2VpcPeeringConnectionInner update(String resourceGroupName, String name, + Ec2VpcPeeringConnectionTagsUpdate properties) { + return updateAsync(resourceGroupName, name, properties).block(); + } + + /** + * Update a Ec2VPCPeeringConnection. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2VPCPeeringConnection. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Ec2VpcPeeringConnectionInner update(String resourceGroupName, String name, + Ec2VpcPeeringConnectionTagsUpdate properties, Context context) { + return updateAsync(resourceGroupName, name, properties, context).block(); + } + + /** + * Delete a Ec2VPCPeeringConnection. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2VPCPeeringConnection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync(String resourceGroupName, String name) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Delete a Ec2VPCPeeringConnection. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2VPCPeeringConnection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync(String resourceGroupName, String name, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.delete(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, name, accept, context); + } + + /** + * Delete a Ec2VPCPeeringConnection. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2VPCPeeringConnection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String name) { + Mono>> mono = deleteWithResponseAsync(resourceGroupName, name); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); + } + + /** + * Delete a Ec2VPCPeeringConnection. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2VPCPeeringConnection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String name, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = deleteWithResponseAsync(resourceGroupName, name, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + context); + } + + /** + * Delete a Ec2VPCPeeringConnection. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2VPCPeeringConnection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String name) { + return this.beginDeleteAsync(resourceGroupName, name).getSyncPoller(); + } + + /** + * Delete a Ec2VPCPeeringConnection. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2VPCPeeringConnection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String name, Context context) { + return this.beginDeleteAsync(resourceGroupName, name, context).getSyncPoller(); + } + + /** + * Delete a Ec2VPCPeeringConnection. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2VPCPeeringConnection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String name) { + return beginDeleteAsync(resourceGroupName, name).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete a Ec2VPCPeeringConnection. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2VPCPeeringConnection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String name, Context context) { + return beginDeleteAsync(resourceGroupName, name, context).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete a Ec2VPCPeeringConnection. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2VPCPeeringConnection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String name) { + deleteAsync(resourceGroupName, name).block(); + } + + /** + * Delete a Ec2VPCPeeringConnection. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2VPCPeeringConnection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String name, Context context) { + deleteAsync(resourceGroupName, name, context).block(); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Ec2VPCPeeringConnection list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listBySubscriptionNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Ec2VPCPeeringConnection list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listBySubscriptionNextSinglePageAsync(String nextLink, + Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Ec2VPCPeeringConnection list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Ec2VPCPeeringConnection list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupNextSinglePageAsync(String nextLink, + Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/Ec2VpcPeeringConnectionsImpl.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/Ec2VpcPeeringConnectionsImpl.java new file mode 100644 index 000000000000..e4c47da5a3d5 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/Ec2VpcPeeringConnectionsImpl.java @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.awsconnector.fluent.Ec2VpcPeeringConnectionsClient; +import com.azure.resourcemanager.awsconnector.fluent.models.Ec2VpcPeeringConnectionInner; +import com.azure.resourcemanager.awsconnector.models.Ec2VpcPeeringConnection; +import com.azure.resourcemanager.awsconnector.models.Ec2VpcPeeringConnections; + +public final class Ec2VpcPeeringConnectionsImpl implements Ec2VpcPeeringConnections { + private static final ClientLogger LOGGER = new ClientLogger(Ec2VpcPeeringConnectionsImpl.class); + + private final Ec2VpcPeeringConnectionsClient innerClient; + + private final com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager; + + public Ec2VpcPeeringConnectionsImpl(Ec2VpcPeeringConnectionsClient innerClient, + com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return ResourceManagerUtils.mapPage(inner, inner1 -> new Ec2VpcPeeringConnectionImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new Ec2VpcPeeringConnectionImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName); + return ResourceManagerUtils.mapPage(inner, inner1 -> new Ec2VpcPeeringConnectionImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + PagedIterable inner + = this.serviceClient().listByResourceGroup(resourceGroupName, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new Ec2VpcPeeringConnectionImpl(inner1, this.manager())); + } + + public Response getByResourceGroupWithResponse(String resourceGroupName, String name, + Context context) { + Response inner + = this.serviceClient().getByResourceGroupWithResponse(resourceGroupName, name, context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new Ec2VpcPeeringConnectionImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public Ec2VpcPeeringConnection getByResourceGroup(String resourceGroupName, String name) { + Ec2VpcPeeringConnectionInner inner = this.serviceClient().getByResourceGroup(resourceGroupName, name); + if (inner != null) { + return new Ec2VpcPeeringConnectionImpl(inner, this.manager()); + } else { + return null; + } + } + + public void deleteByResourceGroup(String resourceGroupName, String name) { + this.serviceClient().delete(resourceGroupName, name); + } + + public void delete(String resourceGroupName, String name, Context context) { + this.serviceClient().delete(resourceGroupName, name, context); + } + + public Ec2VpcPeeringConnection getById(String id) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String name = ResourceManagerUtils.getValueFromIdByName(id, "ec2VPCPeeringConnections"); + if (name == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException(String + .format("The resource ID '%s' is not valid. Missing path segment 'ec2VPCPeeringConnections'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, name, Context.NONE).getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String name = ResourceManagerUtils.getValueFromIdByName(id, "ec2VPCPeeringConnections"); + if (name == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException(String + .format("The resource ID '%s' is not valid. Missing path segment 'ec2VPCPeeringConnections'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, name, context); + } + + public void deleteById(String id) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String name = ResourceManagerUtils.getValueFromIdByName(id, "ec2VPCPeeringConnections"); + if (name == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException(String + .format("The resource ID '%s' is not valid. Missing path segment 'ec2VPCPeeringConnections'.", id))); + } + this.delete(resourceGroupName, name, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String name = ResourceManagerUtils.getValueFromIdByName(id, "ec2VPCPeeringConnections"); + if (name == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException(String + .format("The resource ID '%s' is not valid. Missing path segment 'ec2VPCPeeringConnections'.", id))); + } + this.delete(resourceGroupName, name, context); + } + + private Ec2VpcPeeringConnectionsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.awsconnector.AwsconnectorManager manager() { + return this.serviceManager; + } + + public Ec2VpcPeeringConnectionImpl define(String name) { + return new Ec2VpcPeeringConnectionImpl(name, this.manager()); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/Ec2VpcsClientImpl.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/Ec2VpcsClientImpl.java new file mode 100644 index 000000000000..e250a654af6f --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/Ec2VpcsClientImpl.java @@ -0,0 +1,1269 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.Patch; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.awsconnector.fluent.Ec2VpcsClient; +import com.azure.resourcemanager.awsconnector.fluent.models.Ec2VpcInner; +import com.azure.resourcemanager.awsconnector.models.Ec2VpcListResult; +import com.azure.resourcemanager.awsconnector.models.Ec2VpcTagsUpdate; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in Ec2VpcsClient. + */ +public final class Ec2VpcsClientImpl implements Ec2VpcsClient { + /** + * The proxy service used to perform REST calls. + */ + private final Ec2VpcsService service; + + /** + * The service client containing this operation class. + */ + private final MicrosoftAwsConnectorImpl client; + + /** + * Initializes an instance of Ec2VpcsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + Ec2VpcsClientImpl(MicrosoftAwsConnectorImpl client) { + this.service = RestProxy.create(Ec2VpcsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for MicrosoftAwsConnectorEc2Vpcs to be used by the proxy service to + * perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "MicrosoftAwsConnecto") + public interface Ec2VpcsService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.AwsConnector/ec2Vpcs") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/ec2Vpcs") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroup(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/ec2Vpcs/{name}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getByResourceGroup(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("name") String name, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/ec2Vpcs/{name}") + @ExpectedResponses({ 200, 201 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrReplace(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("name") String name, + @BodyParam("application/json") Ec2VpcInner resource, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/ec2Vpcs/{name}") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> update(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("name") String name, + @BodyParam("application/json") Ec2VpcTagsUpdate properties, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/ec2Vpcs/{name}") + @ExpectedResponses({ 202, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("name") String name, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listBySubscriptionNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroupNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); + } + + /** + * List Ec2Vpc resources by subscription ID. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Ec2Vpc list operation along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync() { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), + res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List Ec2Vpc resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Ec2Vpc list operation along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), accept, + context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * List Ec2Vpc resources by subscription ID. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Ec2Vpc list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>(() -> listSinglePageAsync(), + nextLink -> listBySubscriptionNextSinglePageAsync(nextLink)); + } + + /** + * List Ec2Vpc resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Ec2Vpc list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(Context context) { + return new PagedFlux<>(() -> listSinglePageAsync(context), + nextLink -> listBySubscriptionNextSinglePageAsync(nextLink, context)); + } + + /** + * List Ec2Vpc resources by subscription ID. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Ec2Vpc list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + return new PagedIterable<>(listAsync()); + } + + /** + * List Ec2Vpc resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Ec2Vpc list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Context context) { + return new PagedIterable<>(listAsync(context)); + } + + /** + * List Ec2Vpc resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Ec2Vpc list operation along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), + res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List Ec2Vpc resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Ec2Vpc list operation along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * List Ec2Vpc resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Ec2Vpc list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName) { + return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); + } + + /** + * List Ec2Vpc resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Ec2Vpc list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName, Context context) { + return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName, context), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink, context)); + } + + /** + * List Ec2Vpc resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Ec2Vpc list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName)); + } + + /** + * List Ec2Vpc resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Ec2Vpc list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, context)); + } + + /** + * Get a Ec2Vpc. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2Vpc. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Ec2Vpc along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync(String resourceGroupName, String name) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.getByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get a Ec2Vpc. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2Vpc. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Ec2Vpc along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync(String resourceGroupName, String name, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.getByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, accept, context); + } + + /** + * Get a Ec2Vpc. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2Vpc. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Ec2Vpc on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getByResourceGroupAsync(String resourceGroupName, String name) { + return getByResourceGroupWithResponseAsync(resourceGroupName, name) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Get a Ec2Vpc. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2Vpc. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Ec2Vpc along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getByResourceGroupWithResponse(String resourceGroupName, String name, + Context context) { + return getByResourceGroupWithResponseAsync(resourceGroupName, name, context).block(); + } + + /** + * Get a Ec2Vpc. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2Vpc. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Ec2Vpc. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Ec2VpcInner getByResourceGroup(String resourceGroupName, String name) { + return getByResourceGroupWithResponse(resourceGroupName, name, Context.NONE).getValue(); + } + + /** + * Create a Ec2Vpc. Please note that end user resource creation is currently restricted, but it will be enabled in + * the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2Vpc. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrReplaceWithResponseAsync(String resourceGroupName, String name, + Ec2VpcInner resource) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (resource == null) { + return Mono.error(new IllegalArgumentException("Parameter resource is required and cannot be null.")); + } else { + resource.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.createOrReplace(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, resource, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Create a Ec2Vpc. Please note that end user resource creation is currently restricted, but it will be enabled in + * the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2Vpc. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrReplaceWithResponseAsync(String resourceGroupName, String name, + Ec2VpcInner resource, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (resource == null) { + return Mono.error(new IllegalArgumentException("Parameter resource is required and cannot be null.")); + } else { + resource.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.createOrReplace(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, resource, accept, context); + } + + /** + * Create a Ec2Vpc. Please note that end user resource creation is currently restricted, but it will be enabled in + * the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2Vpc. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Ec2VpcInner> beginCreateOrReplaceAsync(String resourceGroupName, + String name, Ec2VpcInner resource) { + Mono>> mono = createOrReplaceWithResponseAsync(resourceGroupName, name, resource); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + Ec2VpcInner.class, Ec2VpcInner.class, this.client.getContext()); + } + + /** + * Create a Ec2Vpc. Please note that end user resource creation is currently restricted, but it will be enabled in + * the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2Vpc. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Ec2VpcInner> beginCreateOrReplaceAsync(String resourceGroupName, + String name, Ec2VpcInner resource, Context context) { + context = this.client.mergeContext(context); + Mono>> mono + = createOrReplaceWithResponseAsync(resourceGroupName, name, resource, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + Ec2VpcInner.class, Ec2VpcInner.class, context); + } + + /** + * Create a Ec2Vpc. Please note that end user resource creation is currently restricted, but it will be enabled in + * the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2Vpc. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Ec2VpcInner> beginCreateOrReplace(String resourceGroupName, String name, + Ec2VpcInner resource) { + return this.beginCreateOrReplaceAsync(resourceGroupName, name, resource).getSyncPoller(); + } + + /** + * Create a Ec2Vpc. Please note that end user resource creation is currently restricted, but it will be enabled in + * the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2Vpc. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Ec2VpcInner> beginCreateOrReplace(String resourceGroupName, String name, + Ec2VpcInner resource, Context context) { + return this.beginCreateOrReplaceAsync(resourceGroupName, name, resource, context).getSyncPoller(); + } + + /** + * Create a Ec2Vpc. Please note that end user resource creation is currently restricted, but it will be enabled in + * the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2Vpc. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrReplaceAsync(String resourceGroupName, String name, Ec2VpcInner resource) { + return beginCreateOrReplaceAsync(resourceGroupName, name, resource).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create a Ec2Vpc. Please note that end user resource creation is currently restricted, but it will be enabled in + * the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2Vpc. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrReplaceAsync(String resourceGroupName, String name, Ec2VpcInner resource, + Context context) { + return beginCreateOrReplaceAsync(resourceGroupName, name, resource, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create a Ec2Vpc. Please note that end user resource creation is currently restricted, but it will be enabled in + * the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2Vpc. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Ec2VpcInner createOrReplace(String resourceGroupName, String name, Ec2VpcInner resource) { + return createOrReplaceAsync(resourceGroupName, name, resource).block(); + } + + /** + * Create a Ec2Vpc. Please note that end user resource creation is currently restricted, but it will be enabled in + * the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2Vpc. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Ec2VpcInner createOrReplace(String resourceGroupName, String name, Ec2VpcInner resource, Context context) { + return createOrReplaceAsync(resourceGroupName, name, resource, context).block(); + } + + /** + * Update a Ec2Vpc. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2Vpc. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync(String resourceGroupName, String name, + Ec2VpcTagsUpdate properties) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (properties == null) { + return Mono.error(new IllegalArgumentException("Parameter properties is required and cannot be null.")); + } else { + properties.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.update(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, properties, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Update a Ec2Vpc. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2Vpc. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync(String resourceGroupName, String name, + Ec2VpcTagsUpdate properties, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (properties == null) { + return Mono.error(new IllegalArgumentException("Parameter properties is required and cannot be null.")); + } else { + properties.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.update(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, name, properties, accept, context); + } + + /** + * Update a Ec2Vpc. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2Vpc. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Ec2VpcInner> beginUpdateAsync(String resourceGroupName, String name, + Ec2VpcTagsUpdate properties) { + Mono>> mono = updateWithResponseAsync(resourceGroupName, name, properties); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + Ec2VpcInner.class, Ec2VpcInner.class, this.client.getContext()); + } + + /** + * Update a Ec2Vpc. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2Vpc. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Ec2VpcInner> beginUpdateAsync(String resourceGroupName, String name, + Ec2VpcTagsUpdate properties, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = updateWithResponseAsync(resourceGroupName, name, properties, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + Ec2VpcInner.class, Ec2VpcInner.class, context); + } + + /** + * Update a Ec2Vpc. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2Vpc. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Ec2VpcInner> beginUpdate(String resourceGroupName, String name, + Ec2VpcTagsUpdate properties) { + return this.beginUpdateAsync(resourceGroupName, name, properties).getSyncPoller(); + } + + /** + * Update a Ec2Vpc. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2Vpc. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Ec2VpcInner> beginUpdate(String resourceGroupName, String name, + Ec2VpcTagsUpdate properties, Context context) { + return this.beginUpdateAsync(resourceGroupName, name, properties, context).getSyncPoller(); + } + + /** + * Update a Ec2Vpc. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2Vpc. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync(String resourceGroupName, String name, Ec2VpcTagsUpdate properties) { + return beginUpdateAsync(resourceGroupName, name, properties).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Update a Ec2Vpc. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2Vpc. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync(String resourceGroupName, String name, Ec2VpcTagsUpdate properties, + Context context) { + return beginUpdateAsync(resourceGroupName, name, properties, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Update a Ec2Vpc. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2Vpc. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Ec2VpcInner update(String resourceGroupName, String name, Ec2VpcTagsUpdate properties) { + return updateAsync(resourceGroupName, name, properties).block(); + } + + /** + * Update a Ec2Vpc. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2Vpc. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Ec2VpcInner update(String resourceGroupName, String name, Ec2VpcTagsUpdate properties, Context context) { + return updateAsync(resourceGroupName, name, properties, context).block(); + } + + /** + * Delete a Ec2Vpc. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2Vpc. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync(String resourceGroupName, String name) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Delete a Ec2Vpc. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2Vpc. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync(String resourceGroupName, String name, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.delete(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, name, accept, context); + } + + /** + * Delete a Ec2Vpc. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2Vpc. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String name) { + Mono>> mono = deleteWithResponseAsync(resourceGroupName, name); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); + } + + /** + * Delete a Ec2Vpc. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2Vpc. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String name, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = deleteWithResponseAsync(resourceGroupName, name, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + context); + } + + /** + * Delete a Ec2Vpc. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2Vpc. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String name) { + return this.beginDeleteAsync(resourceGroupName, name).getSyncPoller(); + } + + /** + * Delete a Ec2Vpc. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2Vpc. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String name, Context context) { + return this.beginDeleteAsync(resourceGroupName, name, context).getSyncPoller(); + } + + /** + * Delete a Ec2Vpc. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2Vpc. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String name) { + return beginDeleteAsync(resourceGroupName, name).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete a Ec2Vpc. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2Vpc. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String name, Context context) { + return beginDeleteAsync(resourceGroupName, name, context).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete a Ec2Vpc. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2Vpc. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String name) { + deleteAsync(resourceGroupName, name).block(); + } + + /** + * Delete a Ec2Vpc. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2Vpc. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String name, Context context) { + deleteAsync(resourceGroupName, name, context).block(); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Ec2Vpc list operation along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listBySubscriptionNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), + res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Ec2Vpc list operation along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listBySubscriptionNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Ec2Vpc list operation along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), + res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Ec2Vpc list operation along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/Ec2VpcsImpl.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/Ec2VpcsImpl.java new file mode 100644 index 000000000000..70106549f16e --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/Ec2VpcsImpl.java @@ -0,0 +1,145 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.awsconnector.fluent.Ec2VpcsClient; +import com.azure.resourcemanager.awsconnector.fluent.models.Ec2VpcInner; +import com.azure.resourcemanager.awsconnector.models.Ec2Vpc; +import com.azure.resourcemanager.awsconnector.models.Ec2Vpcs; + +public final class Ec2VpcsImpl implements Ec2Vpcs { + private static final ClientLogger LOGGER = new ClientLogger(Ec2VpcsImpl.class); + + private final Ec2VpcsClient innerClient; + + private final com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager; + + public Ec2VpcsImpl(Ec2VpcsClient innerClient, + com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return ResourceManagerUtils.mapPage(inner, inner1 -> new Ec2VpcImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new Ec2VpcImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName); + return ResourceManagerUtils.mapPage(inner, inner1 -> new Ec2VpcImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new Ec2VpcImpl(inner1, this.manager())); + } + + public Response getByResourceGroupWithResponse(String resourceGroupName, String name, Context context) { + Response inner + = this.serviceClient().getByResourceGroupWithResponse(resourceGroupName, name, context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new Ec2VpcImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public Ec2Vpc getByResourceGroup(String resourceGroupName, String name) { + Ec2VpcInner inner = this.serviceClient().getByResourceGroup(resourceGroupName, name); + if (inner != null) { + return new Ec2VpcImpl(inner, this.manager()); + } else { + return null; + } + } + + public void deleteByResourceGroup(String resourceGroupName, String name) { + this.serviceClient().delete(resourceGroupName, name); + } + + public void delete(String resourceGroupName, String name, Context context) { + this.serviceClient().delete(resourceGroupName, name, context); + } + + public Ec2Vpc getById(String id) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String name = ResourceManagerUtils.getValueFromIdByName(id, "ec2Vpcs"); + if (name == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'ec2Vpcs'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, name, Context.NONE).getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String name = ResourceManagerUtils.getValueFromIdByName(id, "ec2Vpcs"); + if (name == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'ec2Vpcs'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, name, context); + } + + public void deleteById(String id) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String name = ResourceManagerUtils.getValueFromIdByName(id, "ec2Vpcs"); + if (name == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'ec2Vpcs'.", id))); + } + this.delete(resourceGroupName, name, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String name = ResourceManagerUtils.getValueFromIdByName(id, "ec2Vpcs"); + if (name == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'ec2Vpcs'.", id))); + } + this.delete(resourceGroupName, name, context); + } + + private Ec2VpcsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.awsconnector.AwsconnectorManager manager() { + return this.serviceManager; + } + + public Ec2VpcImpl define(String name) { + return new Ec2VpcImpl(name, this.manager()); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/EcrImageDetailImpl.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/EcrImageDetailImpl.java new file mode 100644 index 000000000000..abc8cc94bf63 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/EcrImageDetailImpl.java @@ -0,0 +1,177 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.implementation; + +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.awsconnector.fluent.models.EcrImageDetailInner; +import com.azure.resourcemanager.awsconnector.models.EcrImageDetail; +import com.azure.resourcemanager.awsconnector.models.EcrImageDetailProperties; +import com.azure.resourcemanager.awsconnector.models.EcrImageDetailTagsUpdate; +import java.util.Collections; +import java.util.Map; + +public final class EcrImageDetailImpl implements EcrImageDetail, EcrImageDetail.Definition, EcrImageDetail.Update { + private EcrImageDetailInner innerObject; + + private final com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public String location() { + return this.innerModel().location(); + } + + public Map tags() { + Map inner = this.innerModel().tags(); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } + } + + public EcrImageDetailProperties properties() { + return this.innerModel().properties(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public String resourceGroupName() { + return resourceGroupName; + } + + public EcrImageDetailInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.awsconnector.AwsconnectorManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String name; + + private EcrImageDetailTagsUpdate updateProperties; + + public EcrImageDetailImpl withExistingResourceGroup(String resourceGroupName) { + this.resourceGroupName = resourceGroupName; + return this; + } + + public EcrImageDetail create() { + this.innerObject = serviceManager.serviceClient() + .getEcrImageDetails() + .createOrReplace(resourceGroupName, name, this.innerModel(), Context.NONE); + return this; + } + + public EcrImageDetail create(Context context) { + this.innerObject = serviceManager.serviceClient() + .getEcrImageDetails() + .createOrReplace(resourceGroupName, name, this.innerModel(), context); + return this; + } + + EcrImageDetailImpl(String name, com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager) { + this.innerObject = new EcrImageDetailInner(); + this.serviceManager = serviceManager; + this.name = name; + } + + public EcrImageDetailImpl update() { + this.updateProperties = new EcrImageDetailTagsUpdate(); + return this; + } + + public EcrImageDetail apply() { + this.innerObject = serviceManager.serviceClient() + .getEcrImageDetails() + .update(resourceGroupName, name, updateProperties, Context.NONE); + return this; + } + + public EcrImageDetail apply(Context context) { + this.innerObject = serviceManager.serviceClient() + .getEcrImageDetails() + .update(resourceGroupName, name, updateProperties, context); + return this; + } + + EcrImageDetailImpl(EcrImageDetailInner innerObject, + com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.name = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "ecrImageDetails"); + } + + public EcrImageDetail refresh() { + this.innerObject = serviceManager.serviceClient() + .getEcrImageDetails() + .getByResourceGroupWithResponse(resourceGroupName, name, Context.NONE) + .getValue(); + return this; + } + + public EcrImageDetail refresh(Context context) { + this.innerObject = serviceManager.serviceClient() + .getEcrImageDetails() + .getByResourceGroupWithResponse(resourceGroupName, name, context) + .getValue(); + return this; + } + + public EcrImageDetailImpl withRegion(Region location) { + this.innerModel().withLocation(location.toString()); + return this; + } + + public EcrImageDetailImpl withRegion(String location) { + this.innerModel().withLocation(location); + return this; + } + + public EcrImageDetailImpl withTags(Map tags) { + if (isInCreateMode()) { + this.innerModel().withTags(tags); + return this; + } else { + this.updateProperties.withTags(tags); + return this; + } + } + + public EcrImageDetailImpl withProperties(EcrImageDetailProperties properties) { + this.innerModel().withProperties(properties); + return this; + } + + private boolean isInCreateMode() { + return this.innerModel().id() == null; + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/EcrImageDetailsClientImpl.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/EcrImageDetailsClientImpl.java new file mode 100644 index 000000000000..d58fb01ec582 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/EcrImageDetailsClientImpl.java @@ -0,0 +1,1278 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.Patch; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.awsconnector.fluent.EcrImageDetailsClient; +import com.azure.resourcemanager.awsconnector.fluent.models.EcrImageDetailInner; +import com.azure.resourcemanager.awsconnector.models.EcrImageDetailListResult; +import com.azure.resourcemanager.awsconnector.models.EcrImageDetailTagsUpdate; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in EcrImageDetailsClient. + */ +public final class EcrImageDetailsClientImpl implements EcrImageDetailsClient { + /** + * The proxy service used to perform REST calls. + */ + private final EcrImageDetailsService service; + + /** + * The service client containing this operation class. + */ + private final MicrosoftAwsConnectorImpl client; + + /** + * Initializes an instance of EcrImageDetailsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + EcrImageDetailsClientImpl(MicrosoftAwsConnectorImpl client) { + this.service + = RestProxy.create(EcrImageDetailsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for MicrosoftAwsConnectorEcrImageDetails to be used by the proxy service + * to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "MicrosoftAwsConnecto") + public interface EcrImageDetailsService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.AwsConnector/ecrImageDetails") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/ecrImageDetails") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroup(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/ecrImageDetails/{name}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getByResourceGroup(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("name") String name, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/ecrImageDetails/{name}") + @ExpectedResponses({ 200, 201 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrReplace(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("name") String name, + @BodyParam("application/json") EcrImageDetailInner resource, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/ecrImageDetails/{name}") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> update(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("name") String name, + @BodyParam("application/json") EcrImageDetailTagsUpdate properties, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/ecrImageDetails/{name}") + @ExpectedResponses({ 202, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("name") String name, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listBySubscriptionNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroupNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); + } + + /** + * List EcrImageDetail resources by subscription ID. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a EcrImageDetail list operation along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync() { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List EcrImageDetail resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a EcrImageDetail list operation along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), accept, + context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * List EcrImageDetail resources by subscription ID. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a EcrImageDetail list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>(() -> listSinglePageAsync(), + nextLink -> listBySubscriptionNextSinglePageAsync(nextLink)); + } + + /** + * List EcrImageDetail resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a EcrImageDetail list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(Context context) { + return new PagedFlux<>(() -> listSinglePageAsync(context), + nextLink -> listBySubscriptionNextSinglePageAsync(nextLink, context)); + } + + /** + * List EcrImageDetail resources by subscription ID. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a EcrImageDetail list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + return new PagedIterable<>(listAsync()); + } + + /** + * List EcrImageDetail resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a EcrImageDetail list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Context context) { + return new PagedIterable<>(listAsync(context)); + } + + /** + * List EcrImageDetail resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a EcrImageDetail list operation along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List EcrImageDetail resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a EcrImageDetail list operation along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * List EcrImageDetail resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a EcrImageDetail list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName) { + return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); + } + + /** + * List EcrImageDetail resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a EcrImageDetail list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName, Context context) { + return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName, context), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink, context)); + } + + /** + * List EcrImageDetail resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a EcrImageDetail list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName)); + } + + /** + * List EcrImageDetail resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a EcrImageDetail list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, context)); + } + + /** + * Get a EcrImageDetail. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of EcrImageDetail. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a EcrImageDetail along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync(String resourceGroupName, + String name) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.getByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get a EcrImageDetail. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of EcrImageDetail. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a EcrImageDetail along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync(String resourceGroupName, + String name, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.getByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, accept, context); + } + + /** + * Get a EcrImageDetail. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of EcrImageDetail. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a EcrImageDetail on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getByResourceGroupAsync(String resourceGroupName, String name) { + return getByResourceGroupWithResponseAsync(resourceGroupName, name) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Get a EcrImageDetail. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of EcrImageDetail. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a EcrImageDetail along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getByResourceGroupWithResponse(String resourceGroupName, String name, + Context context) { + return getByResourceGroupWithResponseAsync(resourceGroupName, name, context).block(); + } + + /** + * Get a EcrImageDetail. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of EcrImageDetail. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a EcrImageDetail. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public EcrImageDetailInner getByResourceGroup(String resourceGroupName, String name) { + return getByResourceGroupWithResponse(resourceGroupName, name, Context.NONE).getValue(); + } + + /** + * Create a EcrImageDetail. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of EcrImageDetail. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrReplaceWithResponseAsync(String resourceGroupName, String name, + EcrImageDetailInner resource) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (resource == null) { + return Mono.error(new IllegalArgumentException("Parameter resource is required and cannot be null.")); + } else { + resource.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.createOrReplace(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, resource, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Create a EcrImageDetail. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of EcrImageDetail. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrReplaceWithResponseAsync(String resourceGroupName, String name, + EcrImageDetailInner resource, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (resource == null) { + return Mono.error(new IllegalArgumentException("Parameter resource is required and cannot be null.")); + } else { + resource.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.createOrReplace(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, resource, accept, context); + } + + /** + * Create a EcrImageDetail. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of EcrImageDetail. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, EcrImageDetailInner> + beginCreateOrReplaceAsync(String resourceGroupName, String name, EcrImageDetailInner resource) { + Mono>> mono = createOrReplaceWithResponseAsync(resourceGroupName, name, resource); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + EcrImageDetailInner.class, EcrImageDetailInner.class, this.client.getContext()); + } + + /** + * Create a EcrImageDetail. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of EcrImageDetail. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, EcrImageDetailInner> beginCreateOrReplaceAsync( + String resourceGroupName, String name, EcrImageDetailInner resource, Context context) { + context = this.client.mergeContext(context); + Mono>> mono + = createOrReplaceWithResponseAsync(resourceGroupName, name, resource, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + EcrImageDetailInner.class, EcrImageDetailInner.class, context); + } + + /** + * Create a EcrImageDetail. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of EcrImageDetail. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, EcrImageDetailInner> + beginCreateOrReplace(String resourceGroupName, String name, EcrImageDetailInner resource) { + return this.beginCreateOrReplaceAsync(resourceGroupName, name, resource).getSyncPoller(); + } + + /** + * Create a EcrImageDetail. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of EcrImageDetail. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, EcrImageDetailInner> + beginCreateOrReplace(String resourceGroupName, String name, EcrImageDetailInner resource, Context context) { + return this.beginCreateOrReplaceAsync(resourceGroupName, name, resource, context).getSyncPoller(); + } + + /** + * Create a EcrImageDetail. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of EcrImageDetail. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrReplaceAsync(String resourceGroupName, String name, + EcrImageDetailInner resource) { + return beginCreateOrReplaceAsync(resourceGroupName, name, resource).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create a EcrImageDetail. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of EcrImageDetail. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrReplaceAsync(String resourceGroupName, String name, + EcrImageDetailInner resource, Context context) { + return beginCreateOrReplaceAsync(resourceGroupName, name, resource, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create a EcrImageDetail. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of EcrImageDetail. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public EcrImageDetailInner createOrReplace(String resourceGroupName, String name, EcrImageDetailInner resource) { + return createOrReplaceAsync(resourceGroupName, name, resource).block(); + } + + /** + * Create a EcrImageDetail. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of EcrImageDetail. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public EcrImageDetailInner createOrReplace(String resourceGroupName, String name, EcrImageDetailInner resource, + Context context) { + return createOrReplaceAsync(resourceGroupName, name, resource, context).block(); + } + + /** + * Update a EcrImageDetail. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of EcrImageDetail. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync(String resourceGroupName, String name, + EcrImageDetailTagsUpdate properties) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (properties == null) { + return Mono.error(new IllegalArgumentException("Parameter properties is required and cannot be null.")); + } else { + properties.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.update(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, properties, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Update a EcrImageDetail. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of EcrImageDetail. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync(String resourceGroupName, String name, + EcrImageDetailTagsUpdate properties, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (properties == null) { + return Mono.error(new IllegalArgumentException("Parameter properties is required and cannot be null.")); + } else { + properties.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.update(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, name, properties, accept, context); + } + + /** + * Update a EcrImageDetail. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of EcrImageDetail. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, EcrImageDetailInner> beginUpdateAsync(String resourceGroupName, + String name, EcrImageDetailTagsUpdate properties) { + Mono>> mono = updateWithResponseAsync(resourceGroupName, name, properties); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + EcrImageDetailInner.class, EcrImageDetailInner.class, this.client.getContext()); + } + + /** + * Update a EcrImageDetail. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of EcrImageDetail. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, EcrImageDetailInner> beginUpdateAsync(String resourceGroupName, + String name, EcrImageDetailTagsUpdate properties, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = updateWithResponseAsync(resourceGroupName, name, properties, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + EcrImageDetailInner.class, EcrImageDetailInner.class, context); + } + + /** + * Update a EcrImageDetail. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of EcrImageDetail. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, EcrImageDetailInner> beginUpdate(String resourceGroupName, + String name, EcrImageDetailTagsUpdate properties) { + return this.beginUpdateAsync(resourceGroupName, name, properties).getSyncPoller(); + } + + /** + * Update a EcrImageDetail. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of EcrImageDetail. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, EcrImageDetailInner> beginUpdate(String resourceGroupName, + String name, EcrImageDetailTagsUpdate properties, Context context) { + return this.beginUpdateAsync(resourceGroupName, name, properties, context).getSyncPoller(); + } + + /** + * Update a EcrImageDetail. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of EcrImageDetail. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync(String resourceGroupName, String name, + EcrImageDetailTagsUpdate properties) { + return beginUpdateAsync(resourceGroupName, name, properties).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Update a EcrImageDetail. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of EcrImageDetail. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync(String resourceGroupName, String name, + EcrImageDetailTagsUpdate properties, Context context) { + return beginUpdateAsync(resourceGroupName, name, properties, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Update a EcrImageDetail. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of EcrImageDetail. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public EcrImageDetailInner update(String resourceGroupName, String name, EcrImageDetailTagsUpdate properties) { + return updateAsync(resourceGroupName, name, properties).block(); + } + + /** + * Update a EcrImageDetail. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of EcrImageDetail. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public EcrImageDetailInner update(String resourceGroupName, String name, EcrImageDetailTagsUpdate properties, + Context context) { + return updateAsync(resourceGroupName, name, properties, context).block(); + } + + /** + * Delete a EcrImageDetail. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of EcrImageDetail. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync(String resourceGroupName, String name) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Delete a EcrImageDetail. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of EcrImageDetail. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync(String resourceGroupName, String name, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.delete(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, name, accept, context); + } + + /** + * Delete a EcrImageDetail. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of EcrImageDetail. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String name) { + Mono>> mono = deleteWithResponseAsync(resourceGroupName, name); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); + } + + /** + * Delete a EcrImageDetail. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of EcrImageDetail. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String name, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = deleteWithResponseAsync(resourceGroupName, name, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + context); + } + + /** + * Delete a EcrImageDetail. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of EcrImageDetail. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String name) { + return this.beginDeleteAsync(resourceGroupName, name).getSyncPoller(); + } + + /** + * Delete a EcrImageDetail. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of EcrImageDetail. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String name, Context context) { + return this.beginDeleteAsync(resourceGroupName, name, context).getSyncPoller(); + } + + /** + * Delete a EcrImageDetail. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of EcrImageDetail. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String name) { + return beginDeleteAsync(resourceGroupName, name).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete a EcrImageDetail. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of EcrImageDetail. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String name, Context context) { + return beginDeleteAsync(resourceGroupName, name, context).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete a EcrImageDetail. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of EcrImageDetail. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String name) { + deleteAsync(resourceGroupName, name).block(); + } + + /** + * Delete a EcrImageDetail. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of EcrImageDetail. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String name, Context context) { + deleteAsync(resourceGroupName, name, context).block(); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a EcrImageDetail list operation along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listBySubscriptionNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a EcrImageDetail list operation along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listBySubscriptionNextSinglePageAsync(String nextLink, + Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a EcrImageDetail list operation along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a EcrImageDetail list operation along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupNextSinglePageAsync(String nextLink, + Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/EcrImageDetailsImpl.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/EcrImageDetailsImpl.java new file mode 100644 index 000000000000..20952c93a2e4 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/EcrImageDetailsImpl.java @@ -0,0 +1,146 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.awsconnector.fluent.EcrImageDetailsClient; +import com.azure.resourcemanager.awsconnector.fluent.models.EcrImageDetailInner; +import com.azure.resourcemanager.awsconnector.models.EcrImageDetail; +import com.azure.resourcemanager.awsconnector.models.EcrImageDetails; + +public final class EcrImageDetailsImpl implements EcrImageDetails { + private static final ClientLogger LOGGER = new ClientLogger(EcrImageDetailsImpl.class); + + private final EcrImageDetailsClient innerClient; + + private final com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager; + + public EcrImageDetailsImpl(EcrImageDetailsClient innerClient, + com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return ResourceManagerUtils.mapPage(inner, inner1 -> new EcrImageDetailImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new EcrImageDetailImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName); + return ResourceManagerUtils.mapPage(inner, inner1 -> new EcrImageDetailImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new EcrImageDetailImpl(inner1, this.manager())); + } + + public Response getByResourceGroupWithResponse(String resourceGroupName, String name, + Context context) { + Response inner + = this.serviceClient().getByResourceGroupWithResponse(resourceGroupName, name, context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new EcrImageDetailImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public EcrImageDetail getByResourceGroup(String resourceGroupName, String name) { + EcrImageDetailInner inner = this.serviceClient().getByResourceGroup(resourceGroupName, name); + if (inner != null) { + return new EcrImageDetailImpl(inner, this.manager()); + } else { + return null; + } + } + + public void deleteByResourceGroup(String resourceGroupName, String name) { + this.serviceClient().delete(resourceGroupName, name); + } + + public void delete(String resourceGroupName, String name, Context context) { + this.serviceClient().delete(resourceGroupName, name, context); + } + + public EcrImageDetail getById(String id) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String name = ResourceManagerUtils.getValueFromIdByName(id, "ecrImageDetails"); + if (name == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'ecrImageDetails'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, name, Context.NONE).getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String name = ResourceManagerUtils.getValueFromIdByName(id, "ecrImageDetails"); + if (name == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'ecrImageDetails'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, name, context); + } + + public void deleteById(String id) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String name = ResourceManagerUtils.getValueFromIdByName(id, "ecrImageDetails"); + if (name == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'ecrImageDetails'.", id))); + } + this.delete(resourceGroupName, name, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String name = ResourceManagerUtils.getValueFromIdByName(id, "ecrImageDetails"); + if (name == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'ecrImageDetails'.", id))); + } + this.delete(resourceGroupName, name, context); + } + + private EcrImageDetailsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.awsconnector.AwsconnectorManager manager() { + return this.serviceManager; + } + + public EcrImageDetailImpl define(String name) { + return new EcrImageDetailImpl(name, this.manager()); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/EcrRepositoriesClientImpl.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/EcrRepositoriesClientImpl.java new file mode 100644 index 000000000000..032b71f2158f --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/EcrRepositoriesClientImpl.java @@ -0,0 +1,1278 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.Patch; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.awsconnector.fluent.EcrRepositoriesClient; +import com.azure.resourcemanager.awsconnector.fluent.models.EcrRepositoryInner; +import com.azure.resourcemanager.awsconnector.models.EcrRepositoryListResult; +import com.azure.resourcemanager.awsconnector.models.EcrRepositoryTagsUpdate; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in EcrRepositoriesClient. + */ +public final class EcrRepositoriesClientImpl implements EcrRepositoriesClient { + /** + * The proxy service used to perform REST calls. + */ + private final EcrRepositoriesService service; + + /** + * The service client containing this operation class. + */ + private final MicrosoftAwsConnectorImpl client; + + /** + * Initializes an instance of EcrRepositoriesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + EcrRepositoriesClientImpl(MicrosoftAwsConnectorImpl client) { + this.service + = RestProxy.create(EcrRepositoriesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for MicrosoftAwsConnectorEcrRepositories to be used by the proxy service + * to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "MicrosoftAwsConnecto") + public interface EcrRepositoriesService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.AwsConnector/ecrRepositories") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/ecrRepositories") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroup(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/ecrRepositories/{name}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getByResourceGroup(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("name") String name, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/ecrRepositories/{name}") + @ExpectedResponses({ 200, 201 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrReplace(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("name") String name, + @BodyParam("application/json") EcrRepositoryInner resource, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/ecrRepositories/{name}") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> update(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("name") String name, + @BodyParam("application/json") EcrRepositoryTagsUpdate properties, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/ecrRepositories/{name}") + @ExpectedResponses({ 202, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("name") String name, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listBySubscriptionNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroupNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); + } + + /** + * List EcrRepository resources by subscription ID. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a EcrRepository list operation along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync() { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List EcrRepository resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a EcrRepository list operation along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), accept, + context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * List EcrRepository resources by subscription ID. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a EcrRepository list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>(() -> listSinglePageAsync(), + nextLink -> listBySubscriptionNextSinglePageAsync(nextLink)); + } + + /** + * List EcrRepository resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a EcrRepository list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(Context context) { + return new PagedFlux<>(() -> listSinglePageAsync(context), + nextLink -> listBySubscriptionNextSinglePageAsync(nextLink, context)); + } + + /** + * List EcrRepository resources by subscription ID. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a EcrRepository list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + return new PagedIterable<>(listAsync()); + } + + /** + * List EcrRepository resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a EcrRepository list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Context context) { + return new PagedIterable<>(listAsync(context)); + } + + /** + * List EcrRepository resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a EcrRepository list operation along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List EcrRepository resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a EcrRepository list operation along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * List EcrRepository resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a EcrRepository list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName) { + return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); + } + + /** + * List EcrRepository resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a EcrRepository list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName, Context context) { + return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName, context), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink, context)); + } + + /** + * List EcrRepository resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a EcrRepository list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName)); + } + + /** + * List EcrRepository resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a EcrRepository list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, context)); + } + + /** + * Get a EcrRepository. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of EcrRepository. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a EcrRepository along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync(String resourceGroupName, + String name) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.getByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get a EcrRepository. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of EcrRepository. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a EcrRepository along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync(String resourceGroupName, + String name, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.getByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, accept, context); + } + + /** + * Get a EcrRepository. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of EcrRepository. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a EcrRepository on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getByResourceGroupAsync(String resourceGroupName, String name) { + return getByResourceGroupWithResponseAsync(resourceGroupName, name) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Get a EcrRepository. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of EcrRepository. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a EcrRepository along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getByResourceGroupWithResponse(String resourceGroupName, String name, + Context context) { + return getByResourceGroupWithResponseAsync(resourceGroupName, name, context).block(); + } + + /** + * Get a EcrRepository. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of EcrRepository. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a EcrRepository. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public EcrRepositoryInner getByResourceGroup(String resourceGroupName, String name) { + return getByResourceGroupWithResponse(resourceGroupName, name, Context.NONE).getValue(); + } + + /** + * Create a EcrRepository. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of EcrRepository. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrReplaceWithResponseAsync(String resourceGroupName, String name, + EcrRepositoryInner resource) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (resource == null) { + return Mono.error(new IllegalArgumentException("Parameter resource is required and cannot be null.")); + } else { + resource.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.createOrReplace(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, resource, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Create a EcrRepository. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of EcrRepository. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrReplaceWithResponseAsync(String resourceGroupName, String name, + EcrRepositoryInner resource, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (resource == null) { + return Mono.error(new IllegalArgumentException("Parameter resource is required and cannot be null.")); + } else { + resource.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.createOrReplace(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, resource, accept, context); + } + + /** + * Create a EcrRepository. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of EcrRepository. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, EcrRepositoryInner> + beginCreateOrReplaceAsync(String resourceGroupName, String name, EcrRepositoryInner resource) { + Mono>> mono = createOrReplaceWithResponseAsync(resourceGroupName, name, resource); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + EcrRepositoryInner.class, EcrRepositoryInner.class, this.client.getContext()); + } + + /** + * Create a EcrRepository. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of EcrRepository. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, EcrRepositoryInner> + beginCreateOrReplaceAsync(String resourceGroupName, String name, EcrRepositoryInner resource, Context context) { + context = this.client.mergeContext(context); + Mono>> mono + = createOrReplaceWithResponseAsync(resourceGroupName, name, resource, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + EcrRepositoryInner.class, EcrRepositoryInner.class, context); + } + + /** + * Create a EcrRepository. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of EcrRepository. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, EcrRepositoryInner> beginCreateOrReplace(String resourceGroupName, + String name, EcrRepositoryInner resource) { + return this.beginCreateOrReplaceAsync(resourceGroupName, name, resource).getSyncPoller(); + } + + /** + * Create a EcrRepository. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of EcrRepository. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, EcrRepositoryInner> beginCreateOrReplace(String resourceGroupName, + String name, EcrRepositoryInner resource, Context context) { + return this.beginCreateOrReplaceAsync(resourceGroupName, name, resource, context).getSyncPoller(); + } + + /** + * Create a EcrRepository. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of EcrRepository. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrReplaceAsync(String resourceGroupName, String name, + EcrRepositoryInner resource) { + return beginCreateOrReplaceAsync(resourceGroupName, name, resource).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create a EcrRepository. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of EcrRepository. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrReplaceAsync(String resourceGroupName, String name, + EcrRepositoryInner resource, Context context) { + return beginCreateOrReplaceAsync(resourceGroupName, name, resource, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create a EcrRepository. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of EcrRepository. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public EcrRepositoryInner createOrReplace(String resourceGroupName, String name, EcrRepositoryInner resource) { + return createOrReplaceAsync(resourceGroupName, name, resource).block(); + } + + /** + * Create a EcrRepository. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of EcrRepository. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public EcrRepositoryInner createOrReplace(String resourceGroupName, String name, EcrRepositoryInner resource, + Context context) { + return createOrReplaceAsync(resourceGroupName, name, resource, context).block(); + } + + /** + * Update a EcrRepository. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of EcrRepository. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync(String resourceGroupName, String name, + EcrRepositoryTagsUpdate properties) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (properties == null) { + return Mono.error(new IllegalArgumentException("Parameter properties is required and cannot be null.")); + } else { + properties.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.update(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, properties, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Update a EcrRepository. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of EcrRepository. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync(String resourceGroupName, String name, + EcrRepositoryTagsUpdate properties, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (properties == null) { + return Mono.error(new IllegalArgumentException("Parameter properties is required and cannot be null.")); + } else { + properties.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.update(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, name, properties, accept, context); + } + + /** + * Update a EcrRepository. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of EcrRepository. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, EcrRepositoryInner> beginUpdateAsync(String resourceGroupName, + String name, EcrRepositoryTagsUpdate properties) { + Mono>> mono = updateWithResponseAsync(resourceGroupName, name, properties); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + EcrRepositoryInner.class, EcrRepositoryInner.class, this.client.getContext()); + } + + /** + * Update a EcrRepository. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of EcrRepository. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, EcrRepositoryInner> beginUpdateAsync(String resourceGroupName, + String name, EcrRepositoryTagsUpdate properties, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = updateWithResponseAsync(resourceGroupName, name, properties, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + EcrRepositoryInner.class, EcrRepositoryInner.class, context); + } + + /** + * Update a EcrRepository. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of EcrRepository. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, EcrRepositoryInner> beginUpdate(String resourceGroupName, + String name, EcrRepositoryTagsUpdate properties) { + return this.beginUpdateAsync(resourceGroupName, name, properties).getSyncPoller(); + } + + /** + * Update a EcrRepository. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of EcrRepository. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, EcrRepositoryInner> beginUpdate(String resourceGroupName, + String name, EcrRepositoryTagsUpdate properties, Context context) { + return this.beginUpdateAsync(resourceGroupName, name, properties, context).getSyncPoller(); + } + + /** + * Update a EcrRepository. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of EcrRepository. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync(String resourceGroupName, String name, + EcrRepositoryTagsUpdate properties) { + return beginUpdateAsync(resourceGroupName, name, properties).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Update a EcrRepository. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of EcrRepository. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync(String resourceGroupName, String name, + EcrRepositoryTagsUpdate properties, Context context) { + return beginUpdateAsync(resourceGroupName, name, properties, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Update a EcrRepository. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of EcrRepository. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public EcrRepositoryInner update(String resourceGroupName, String name, EcrRepositoryTagsUpdate properties) { + return updateAsync(resourceGroupName, name, properties).block(); + } + + /** + * Update a EcrRepository. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of EcrRepository. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public EcrRepositoryInner update(String resourceGroupName, String name, EcrRepositoryTagsUpdate properties, + Context context) { + return updateAsync(resourceGroupName, name, properties, context).block(); + } + + /** + * Delete a EcrRepository. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of EcrRepository. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync(String resourceGroupName, String name) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Delete a EcrRepository. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of EcrRepository. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync(String resourceGroupName, String name, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.delete(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, name, accept, context); + } + + /** + * Delete a EcrRepository. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of EcrRepository. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String name) { + Mono>> mono = deleteWithResponseAsync(resourceGroupName, name); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); + } + + /** + * Delete a EcrRepository. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of EcrRepository. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String name, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = deleteWithResponseAsync(resourceGroupName, name, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + context); + } + + /** + * Delete a EcrRepository. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of EcrRepository. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String name) { + return this.beginDeleteAsync(resourceGroupName, name).getSyncPoller(); + } + + /** + * Delete a EcrRepository. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of EcrRepository. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String name, Context context) { + return this.beginDeleteAsync(resourceGroupName, name, context).getSyncPoller(); + } + + /** + * Delete a EcrRepository. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of EcrRepository. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String name) { + return beginDeleteAsync(resourceGroupName, name).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete a EcrRepository. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of EcrRepository. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String name, Context context) { + return beginDeleteAsync(resourceGroupName, name, context).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete a EcrRepository. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of EcrRepository. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String name) { + deleteAsync(resourceGroupName, name).block(); + } + + /** + * Delete a EcrRepository. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of EcrRepository. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String name, Context context) { + deleteAsync(resourceGroupName, name, context).block(); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a EcrRepository list operation along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listBySubscriptionNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a EcrRepository list operation along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listBySubscriptionNextSinglePageAsync(String nextLink, + Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a EcrRepository list operation along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a EcrRepository list operation along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupNextSinglePageAsync(String nextLink, + Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/EcrRepositoriesImpl.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/EcrRepositoriesImpl.java new file mode 100644 index 000000000000..61b0fff569ea --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/EcrRepositoriesImpl.java @@ -0,0 +1,146 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.awsconnector.fluent.EcrRepositoriesClient; +import com.azure.resourcemanager.awsconnector.fluent.models.EcrRepositoryInner; +import com.azure.resourcemanager.awsconnector.models.EcrRepositories; +import com.azure.resourcemanager.awsconnector.models.EcrRepository; + +public final class EcrRepositoriesImpl implements EcrRepositories { + private static final ClientLogger LOGGER = new ClientLogger(EcrRepositoriesImpl.class); + + private final EcrRepositoriesClient innerClient; + + private final com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager; + + public EcrRepositoriesImpl(EcrRepositoriesClient innerClient, + com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return ResourceManagerUtils.mapPage(inner, inner1 -> new EcrRepositoryImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new EcrRepositoryImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName); + return ResourceManagerUtils.mapPage(inner, inner1 -> new EcrRepositoryImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new EcrRepositoryImpl(inner1, this.manager())); + } + + public Response getByResourceGroupWithResponse(String resourceGroupName, String name, + Context context) { + Response inner + = this.serviceClient().getByResourceGroupWithResponse(resourceGroupName, name, context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new EcrRepositoryImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public EcrRepository getByResourceGroup(String resourceGroupName, String name) { + EcrRepositoryInner inner = this.serviceClient().getByResourceGroup(resourceGroupName, name); + if (inner != null) { + return new EcrRepositoryImpl(inner, this.manager()); + } else { + return null; + } + } + + public void deleteByResourceGroup(String resourceGroupName, String name) { + this.serviceClient().delete(resourceGroupName, name); + } + + public void delete(String resourceGroupName, String name, Context context) { + this.serviceClient().delete(resourceGroupName, name, context); + } + + public EcrRepository getById(String id) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String name = ResourceManagerUtils.getValueFromIdByName(id, "ecrRepositories"); + if (name == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'ecrRepositories'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, name, Context.NONE).getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String name = ResourceManagerUtils.getValueFromIdByName(id, "ecrRepositories"); + if (name == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'ecrRepositories'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, name, context); + } + + public void deleteById(String id) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String name = ResourceManagerUtils.getValueFromIdByName(id, "ecrRepositories"); + if (name == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'ecrRepositories'.", id))); + } + this.delete(resourceGroupName, name, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String name = ResourceManagerUtils.getValueFromIdByName(id, "ecrRepositories"); + if (name == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'ecrRepositories'.", id))); + } + this.delete(resourceGroupName, name, context); + } + + private EcrRepositoriesClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.awsconnector.AwsconnectorManager manager() { + return this.serviceManager; + } + + public EcrRepositoryImpl define(String name) { + return new EcrRepositoryImpl(name, this.manager()); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/EcrRepositoryImpl.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/EcrRepositoryImpl.java new file mode 100644 index 000000000000..915dedc7f8b4 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/EcrRepositoryImpl.java @@ -0,0 +1,177 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.implementation; + +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.awsconnector.fluent.models.EcrRepositoryInner; +import com.azure.resourcemanager.awsconnector.models.EcrRepository; +import com.azure.resourcemanager.awsconnector.models.EcrRepositoryProperties; +import com.azure.resourcemanager.awsconnector.models.EcrRepositoryTagsUpdate; +import java.util.Collections; +import java.util.Map; + +public final class EcrRepositoryImpl implements EcrRepository, EcrRepository.Definition, EcrRepository.Update { + private EcrRepositoryInner innerObject; + + private final com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public String location() { + return this.innerModel().location(); + } + + public Map tags() { + Map inner = this.innerModel().tags(); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } + } + + public EcrRepositoryProperties properties() { + return this.innerModel().properties(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public String resourceGroupName() { + return resourceGroupName; + } + + public EcrRepositoryInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.awsconnector.AwsconnectorManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String name; + + private EcrRepositoryTagsUpdate updateProperties; + + public EcrRepositoryImpl withExistingResourceGroup(String resourceGroupName) { + this.resourceGroupName = resourceGroupName; + return this; + } + + public EcrRepository create() { + this.innerObject = serviceManager.serviceClient() + .getEcrRepositories() + .createOrReplace(resourceGroupName, name, this.innerModel(), Context.NONE); + return this; + } + + public EcrRepository create(Context context) { + this.innerObject = serviceManager.serviceClient() + .getEcrRepositories() + .createOrReplace(resourceGroupName, name, this.innerModel(), context); + return this; + } + + EcrRepositoryImpl(String name, com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager) { + this.innerObject = new EcrRepositoryInner(); + this.serviceManager = serviceManager; + this.name = name; + } + + public EcrRepositoryImpl update() { + this.updateProperties = new EcrRepositoryTagsUpdate(); + return this; + } + + public EcrRepository apply() { + this.innerObject = serviceManager.serviceClient() + .getEcrRepositories() + .update(resourceGroupName, name, updateProperties, Context.NONE); + return this; + } + + public EcrRepository apply(Context context) { + this.innerObject = serviceManager.serviceClient() + .getEcrRepositories() + .update(resourceGroupName, name, updateProperties, context); + return this; + } + + EcrRepositoryImpl(EcrRepositoryInner innerObject, + com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.name = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "ecrRepositories"); + } + + public EcrRepository refresh() { + this.innerObject = serviceManager.serviceClient() + .getEcrRepositories() + .getByResourceGroupWithResponse(resourceGroupName, name, Context.NONE) + .getValue(); + return this; + } + + public EcrRepository refresh(Context context) { + this.innerObject = serviceManager.serviceClient() + .getEcrRepositories() + .getByResourceGroupWithResponse(resourceGroupName, name, context) + .getValue(); + return this; + } + + public EcrRepositoryImpl withRegion(Region location) { + this.innerModel().withLocation(location.toString()); + return this; + } + + public EcrRepositoryImpl withRegion(String location) { + this.innerModel().withLocation(location); + return this; + } + + public EcrRepositoryImpl withTags(Map tags) { + if (isInCreateMode()) { + this.innerModel().withTags(tags); + return this; + } else { + this.updateProperties.withTags(tags); + return this; + } + } + + public EcrRepositoryImpl withProperties(EcrRepositoryProperties properties) { + this.innerModel().withProperties(properties); + return this; + } + + private boolean isInCreateMode() { + return this.innerModel().id() == null; + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/EcsClusterImpl.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/EcsClusterImpl.java new file mode 100644 index 000000000000..e932d5d14b3d --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/EcsClusterImpl.java @@ -0,0 +1,177 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.implementation; + +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.awsconnector.fluent.models.EcsClusterInner; +import com.azure.resourcemanager.awsconnector.models.EcsCluster; +import com.azure.resourcemanager.awsconnector.models.EcsClusterProperties; +import com.azure.resourcemanager.awsconnector.models.EcsClusterTagsUpdate; +import java.util.Collections; +import java.util.Map; + +public final class EcsClusterImpl implements EcsCluster, EcsCluster.Definition, EcsCluster.Update { + private EcsClusterInner innerObject; + + private final com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public String location() { + return this.innerModel().location(); + } + + public Map tags() { + Map inner = this.innerModel().tags(); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } + } + + public EcsClusterProperties properties() { + return this.innerModel().properties(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public String resourceGroupName() { + return resourceGroupName; + } + + public EcsClusterInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.awsconnector.AwsconnectorManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String name; + + private EcsClusterTagsUpdate updateProperties; + + public EcsClusterImpl withExistingResourceGroup(String resourceGroupName) { + this.resourceGroupName = resourceGroupName; + return this; + } + + public EcsCluster create() { + this.innerObject = serviceManager.serviceClient() + .getEcsClusters() + .createOrReplace(resourceGroupName, name, this.innerModel(), Context.NONE); + return this; + } + + public EcsCluster create(Context context) { + this.innerObject = serviceManager.serviceClient() + .getEcsClusters() + .createOrReplace(resourceGroupName, name, this.innerModel(), context); + return this; + } + + EcsClusterImpl(String name, com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager) { + this.innerObject = new EcsClusterInner(); + this.serviceManager = serviceManager; + this.name = name; + } + + public EcsClusterImpl update() { + this.updateProperties = new EcsClusterTagsUpdate(); + return this; + } + + public EcsCluster apply() { + this.innerObject = serviceManager.serviceClient() + .getEcsClusters() + .update(resourceGroupName, name, updateProperties, Context.NONE); + return this; + } + + public EcsCluster apply(Context context) { + this.innerObject = serviceManager.serviceClient() + .getEcsClusters() + .update(resourceGroupName, name, updateProperties, context); + return this; + } + + EcsClusterImpl(EcsClusterInner innerObject, + com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.name = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "ecsClusters"); + } + + public EcsCluster refresh() { + this.innerObject = serviceManager.serviceClient() + .getEcsClusters() + .getByResourceGroupWithResponse(resourceGroupName, name, Context.NONE) + .getValue(); + return this; + } + + public EcsCluster refresh(Context context) { + this.innerObject = serviceManager.serviceClient() + .getEcsClusters() + .getByResourceGroupWithResponse(resourceGroupName, name, context) + .getValue(); + return this; + } + + public EcsClusterImpl withRegion(Region location) { + this.innerModel().withLocation(location.toString()); + return this; + } + + public EcsClusterImpl withRegion(String location) { + this.innerModel().withLocation(location); + return this; + } + + public EcsClusterImpl withTags(Map tags) { + if (isInCreateMode()) { + this.innerModel().withTags(tags); + return this; + } else { + this.updateProperties.withTags(tags); + return this; + } + } + + public EcsClusterImpl withProperties(EcsClusterProperties properties) { + this.innerModel().withProperties(properties); + return this; + } + + private boolean isInCreateMode() { + return this.innerModel().id() == null; + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/EcsClustersClientImpl.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/EcsClustersClientImpl.java new file mode 100644 index 000000000000..c74933f3c059 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/EcsClustersClientImpl.java @@ -0,0 +1,1276 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.Patch; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.awsconnector.fluent.EcsClustersClient; +import com.azure.resourcemanager.awsconnector.fluent.models.EcsClusterInner; +import com.azure.resourcemanager.awsconnector.models.EcsClusterListResult; +import com.azure.resourcemanager.awsconnector.models.EcsClusterTagsUpdate; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in EcsClustersClient. + */ +public final class EcsClustersClientImpl implements EcsClustersClient { + /** + * The proxy service used to perform REST calls. + */ + private final EcsClustersService service; + + /** + * The service client containing this operation class. + */ + private final MicrosoftAwsConnectorImpl client; + + /** + * Initializes an instance of EcsClustersClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + EcsClustersClientImpl(MicrosoftAwsConnectorImpl client) { + this.service + = RestProxy.create(EcsClustersService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for MicrosoftAwsConnectorEcsClusters to be used by the proxy service to + * perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "MicrosoftAwsConnecto") + public interface EcsClustersService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.AwsConnector/ecsClusters") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/ecsClusters") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroup(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/ecsClusters/{name}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getByResourceGroup(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("name") String name, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/ecsClusters/{name}") + @ExpectedResponses({ 200, 201 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrReplace(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("name") String name, + @BodyParam("application/json") EcsClusterInner resource, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/ecsClusters/{name}") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> update(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("name") String name, + @BodyParam("application/json") EcsClusterTagsUpdate properties, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/ecsClusters/{name}") + @ExpectedResponses({ 202, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("name") String name, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listBySubscriptionNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroupNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); + } + + /** + * List EcsCluster resources by subscription ID. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a EcsCluster list operation along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync() { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), + res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List EcsCluster resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a EcsCluster list operation along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), accept, + context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * List EcsCluster resources by subscription ID. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a EcsCluster list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>(() -> listSinglePageAsync(), + nextLink -> listBySubscriptionNextSinglePageAsync(nextLink)); + } + + /** + * List EcsCluster resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a EcsCluster list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(Context context) { + return new PagedFlux<>(() -> listSinglePageAsync(context), + nextLink -> listBySubscriptionNextSinglePageAsync(nextLink, context)); + } + + /** + * List EcsCluster resources by subscription ID. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a EcsCluster list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + return new PagedIterable<>(listAsync()); + } + + /** + * List EcsCluster resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a EcsCluster list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Context context) { + return new PagedIterable<>(listAsync(context)); + } + + /** + * List EcsCluster resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a EcsCluster list operation along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), + res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List EcsCluster resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a EcsCluster list operation along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * List EcsCluster resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a EcsCluster list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName) { + return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); + } + + /** + * List EcsCluster resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a EcsCluster list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName, Context context) { + return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName, context), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink, context)); + } + + /** + * List EcsCluster resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a EcsCluster list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName)); + } + + /** + * List EcsCluster resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a EcsCluster list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, context)); + } + + /** + * Get a EcsCluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of EcsCluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a EcsCluster along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync(String resourceGroupName, String name) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.getByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get a EcsCluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of EcsCluster. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a EcsCluster along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync(String resourceGroupName, String name, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.getByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, accept, context); + } + + /** + * Get a EcsCluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of EcsCluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a EcsCluster on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getByResourceGroupAsync(String resourceGroupName, String name) { + return getByResourceGroupWithResponseAsync(resourceGroupName, name) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Get a EcsCluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of EcsCluster. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a EcsCluster along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getByResourceGroupWithResponse(String resourceGroupName, String name, + Context context) { + return getByResourceGroupWithResponseAsync(resourceGroupName, name, context).block(); + } + + /** + * Get a EcsCluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of EcsCluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a EcsCluster. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public EcsClusterInner getByResourceGroup(String resourceGroupName, String name) { + return getByResourceGroupWithResponse(resourceGroupName, name, Context.NONE).getValue(); + } + + /** + * Create a EcsCluster. Please note that end user resource creation is currently restricted, but it will be enabled + * in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of EcsCluster. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrReplaceWithResponseAsync(String resourceGroupName, String name, + EcsClusterInner resource) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (resource == null) { + return Mono.error(new IllegalArgumentException("Parameter resource is required and cannot be null.")); + } else { + resource.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.createOrReplace(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, resource, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Create a EcsCluster. Please note that end user resource creation is currently restricted, but it will be enabled + * in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of EcsCluster. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrReplaceWithResponseAsync(String resourceGroupName, String name, + EcsClusterInner resource, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (resource == null) { + return Mono.error(new IllegalArgumentException("Parameter resource is required and cannot be null.")); + } else { + resource.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.createOrReplace(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, resource, accept, context); + } + + /** + * Create a EcsCluster. Please note that end user resource creation is currently restricted, but it will be enabled + * in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of EcsCluster. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, EcsClusterInner> beginCreateOrReplaceAsync(String resourceGroupName, + String name, EcsClusterInner resource) { + Mono>> mono = createOrReplaceWithResponseAsync(resourceGroupName, name, resource); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + EcsClusterInner.class, EcsClusterInner.class, this.client.getContext()); + } + + /** + * Create a EcsCluster. Please note that end user resource creation is currently restricted, but it will be enabled + * in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of EcsCluster. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, EcsClusterInner> beginCreateOrReplaceAsync(String resourceGroupName, + String name, EcsClusterInner resource, Context context) { + context = this.client.mergeContext(context); + Mono>> mono + = createOrReplaceWithResponseAsync(resourceGroupName, name, resource, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + EcsClusterInner.class, EcsClusterInner.class, context); + } + + /** + * Create a EcsCluster. Please note that end user resource creation is currently restricted, but it will be enabled + * in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of EcsCluster. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, EcsClusterInner> beginCreateOrReplace(String resourceGroupName, + String name, EcsClusterInner resource) { + return this.beginCreateOrReplaceAsync(resourceGroupName, name, resource).getSyncPoller(); + } + + /** + * Create a EcsCluster. Please note that end user resource creation is currently restricted, but it will be enabled + * in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of EcsCluster. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, EcsClusterInner> beginCreateOrReplace(String resourceGroupName, + String name, EcsClusterInner resource, Context context) { + return this.beginCreateOrReplaceAsync(resourceGroupName, name, resource, context).getSyncPoller(); + } + + /** + * Create a EcsCluster. Please note that end user resource creation is currently restricted, but it will be enabled + * in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of EcsCluster. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrReplaceAsync(String resourceGroupName, String name, + EcsClusterInner resource) { + return beginCreateOrReplaceAsync(resourceGroupName, name, resource).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create a EcsCluster. Please note that end user resource creation is currently restricted, but it will be enabled + * in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of EcsCluster. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrReplaceAsync(String resourceGroupName, String name, EcsClusterInner resource, + Context context) { + return beginCreateOrReplaceAsync(resourceGroupName, name, resource, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create a EcsCluster. Please note that end user resource creation is currently restricted, but it will be enabled + * in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of EcsCluster. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public EcsClusterInner createOrReplace(String resourceGroupName, String name, EcsClusterInner resource) { + return createOrReplaceAsync(resourceGroupName, name, resource).block(); + } + + /** + * Create a EcsCluster. Please note that end user resource creation is currently restricted, but it will be enabled + * in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of EcsCluster. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public EcsClusterInner createOrReplace(String resourceGroupName, String name, EcsClusterInner resource, + Context context) { + return createOrReplaceAsync(resourceGroupName, name, resource, context).block(); + } + + /** + * Update a EcsCluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of EcsCluster. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync(String resourceGroupName, String name, + EcsClusterTagsUpdate properties) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (properties == null) { + return Mono.error(new IllegalArgumentException("Parameter properties is required and cannot be null.")); + } else { + properties.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.update(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, properties, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Update a EcsCluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of EcsCluster. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync(String resourceGroupName, String name, + EcsClusterTagsUpdate properties, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (properties == null) { + return Mono.error(new IllegalArgumentException("Parameter properties is required and cannot be null.")); + } else { + properties.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.update(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, name, properties, accept, context); + } + + /** + * Update a EcsCluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of EcsCluster. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, EcsClusterInner> beginUpdateAsync(String resourceGroupName, + String name, EcsClusterTagsUpdate properties) { + Mono>> mono = updateWithResponseAsync(resourceGroupName, name, properties); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + EcsClusterInner.class, EcsClusterInner.class, this.client.getContext()); + } + + /** + * Update a EcsCluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of EcsCluster. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, EcsClusterInner> beginUpdateAsync(String resourceGroupName, + String name, EcsClusterTagsUpdate properties, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = updateWithResponseAsync(resourceGroupName, name, properties, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + EcsClusterInner.class, EcsClusterInner.class, context); + } + + /** + * Update a EcsCluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of EcsCluster. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, EcsClusterInner> beginUpdate(String resourceGroupName, String name, + EcsClusterTagsUpdate properties) { + return this.beginUpdateAsync(resourceGroupName, name, properties).getSyncPoller(); + } + + /** + * Update a EcsCluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of EcsCluster. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, EcsClusterInner> beginUpdate(String resourceGroupName, String name, + EcsClusterTagsUpdate properties, Context context) { + return this.beginUpdateAsync(resourceGroupName, name, properties, context).getSyncPoller(); + } + + /** + * Update a EcsCluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of EcsCluster. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync(String resourceGroupName, String name, EcsClusterTagsUpdate properties) { + return beginUpdateAsync(resourceGroupName, name, properties).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Update a EcsCluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of EcsCluster. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync(String resourceGroupName, String name, EcsClusterTagsUpdate properties, + Context context) { + return beginUpdateAsync(resourceGroupName, name, properties, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Update a EcsCluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of EcsCluster. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public EcsClusterInner update(String resourceGroupName, String name, EcsClusterTagsUpdate properties) { + return updateAsync(resourceGroupName, name, properties).block(); + } + + /** + * Update a EcsCluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of EcsCluster. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public EcsClusterInner update(String resourceGroupName, String name, EcsClusterTagsUpdate properties, + Context context) { + return updateAsync(resourceGroupName, name, properties, context).block(); + } + + /** + * Delete a EcsCluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of EcsCluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync(String resourceGroupName, String name) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Delete a EcsCluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of EcsCluster. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync(String resourceGroupName, String name, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.delete(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, name, accept, context); + } + + /** + * Delete a EcsCluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of EcsCluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String name) { + Mono>> mono = deleteWithResponseAsync(resourceGroupName, name); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); + } + + /** + * Delete a EcsCluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of EcsCluster. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String name, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = deleteWithResponseAsync(resourceGroupName, name, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + context); + } + + /** + * Delete a EcsCluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of EcsCluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String name) { + return this.beginDeleteAsync(resourceGroupName, name).getSyncPoller(); + } + + /** + * Delete a EcsCluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of EcsCluster. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String name, Context context) { + return this.beginDeleteAsync(resourceGroupName, name, context).getSyncPoller(); + } + + /** + * Delete a EcsCluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of EcsCluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String name) { + return beginDeleteAsync(resourceGroupName, name).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete a EcsCluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of EcsCluster. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String name, Context context) { + return beginDeleteAsync(resourceGroupName, name, context).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete a EcsCluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of EcsCluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String name) { + deleteAsync(resourceGroupName, name).block(); + } + + /** + * Delete a EcsCluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of EcsCluster. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String name, Context context) { + deleteAsync(resourceGroupName, name, context).block(); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a EcsCluster list operation along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listBySubscriptionNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), + res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a EcsCluster list operation along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listBySubscriptionNextSinglePageAsync(String nextLink, + Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a EcsCluster list operation along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), + res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a EcsCluster list operation along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupNextSinglePageAsync(String nextLink, + Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/EcsClustersImpl.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/EcsClustersImpl.java new file mode 100644 index 000000000000..65136af9030f --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/EcsClustersImpl.java @@ -0,0 +1,145 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.awsconnector.fluent.EcsClustersClient; +import com.azure.resourcemanager.awsconnector.fluent.models.EcsClusterInner; +import com.azure.resourcemanager.awsconnector.models.EcsCluster; +import com.azure.resourcemanager.awsconnector.models.EcsClusters; + +public final class EcsClustersImpl implements EcsClusters { + private static final ClientLogger LOGGER = new ClientLogger(EcsClustersImpl.class); + + private final EcsClustersClient innerClient; + + private final com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager; + + public EcsClustersImpl(EcsClustersClient innerClient, + com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return ResourceManagerUtils.mapPage(inner, inner1 -> new EcsClusterImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new EcsClusterImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName); + return ResourceManagerUtils.mapPage(inner, inner1 -> new EcsClusterImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new EcsClusterImpl(inner1, this.manager())); + } + + public Response getByResourceGroupWithResponse(String resourceGroupName, String name, Context context) { + Response inner + = this.serviceClient().getByResourceGroupWithResponse(resourceGroupName, name, context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new EcsClusterImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public EcsCluster getByResourceGroup(String resourceGroupName, String name) { + EcsClusterInner inner = this.serviceClient().getByResourceGroup(resourceGroupName, name); + if (inner != null) { + return new EcsClusterImpl(inner, this.manager()); + } else { + return null; + } + } + + public void deleteByResourceGroup(String resourceGroupName, String name) { + this.serviceClient().delete(resourceGroupName, name); + } + + public void delete(String resourceGroupName, String name, Context context) { + this.serviceClient().delete(resourceGroupName, name, context); + } + + public EcsCluster getById(String id) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String name = ResourceManagerUtils.getValueFromIdByName(id, "ecsClusters"); + if (name == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'ecsClusters'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, name, Context.NONE).getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String name = ResourceManagerUtils.getValueFromIdByName(id, "ecsClusters"); + if (name == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'ecsClusters'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, name, context); + } + + public void deleteById(String id) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String name = ResourceManagerUtils.getValueFromIdByName(id, "ecsClusters"); + if (name == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'ecsClusters'.", id))); + } + this.delete(resourceGroupName, name, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String name = ResourceManagerUtils.getValueFromIdByName(id, "ecsClusters"); + if (name == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'ecsClusters'.", id))); + } + this.delete(resourceGroupName, name, context); + } + + private EcsClustersClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.awsconnector.AwsconnectorManager manager() { + return this.serviceManager; + } + + public EcsClusterImpl define(String name) { + return new EcsClusterImpl(name, this.manager()); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/EcsServiceImpl.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/EcsServiceImpl.java new file mode 100644 index 000000000000..e974dd312cee --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/EcsServiceImpl.java @@ -0,0 +1,177 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.implementation; + +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.awsconnector.fluent.models.EcsServiceInner; +import com.azure.resourcemanager.awsconnector.models.EcsService; +import com.azure.resourcemanager.awsconnector.models.EcsServiceProperties; +import com.azure.resourcemanager.awsconnector.models.EcsServiceTagsUpdate; +import java.util.Collections; +import java.util.Map; + +public final class EcsServiceImpl implements EcsService, EcsService.Definition, EcsService.Update { + private EcsServiceInner innerObject; + + private final com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public String location() { + return this.innerModel().location(); + } + + public Map tags() { + Map inner = this.innerModel().tags(); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } + } + + public EcsServiceProperties properties() { + return this.innerModel().properties(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public String resourceGroupName() { + return resourceGroupName; + } + + public EcsServiceInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.awsconnector.AwsconnectorManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String name; + + private EcsServiceTagsUpdate updateProperties; + + public EcsServiceImpl withExistingResourceGroup(String resourceGroupName) { + this.resourceGroupName = resourceGroupName; + return this; + } + + public EcsService create() { + this.innerObject = serviceManager.serviceClient() + .getEcsServices() + .createOrReplace(resourceGroupName, name, this.innerModel(), Context.NONE); + return this; + } + + public EcsService create(Context context) { + this.innerObject = serviceManager.serviceClient() + .getEcsServices() + .createOrReplace(resourceGroupName, name, this.innerModel(), context); + return this; + } + + EcsServiceImpl(String name, com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager) { + this.innerObject = new EcsServiceInner(); + this.serviceManager = serviceManager; + this.name = name; + } + + public EcsServiceImpl update() { + this.updateProperties = new EcsServiceTagsUpdate(); + return this; + } + + public EcsService apply() { + this.innerObject = serviceManager.serviceClient() + .getEcsServices() + .update(resourceGroupName, name, updateProperties, Context.NONE); + return this; + } + + public EcsService apply(Context context) { + this.innerObject = serviceManager.serviceClient() + .getEcsServices() + .update(resourceGroupName, name, updateProperties, context); + return this; + } + + EcsServiceImpl(EcsServiceInner innerObject, + com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.name = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "ecsServices"); + } + + public EcsService refresh() { + this.innerObject = serviceManager.serviceClient() + .getEcsServices() + .getByResourceGroupWithResponse(resourceGroupName, name, Context.NONE) + .getValue(); + return this; + } + + public EcsService refresh(Context context) { + this.innerObject = serviceManager.serviceClient() + .getEcsServices() + .getByResourceGroupWithResponse(resourceGroupName, name, context) + .getValue(); + return this; + } + + public EcsServiceImpl withRegion(Region location) { + this.innerModel().withLocation(location.toString()); + return this; + } + + public EcsServiceImpl withRegion(String location) { + this.innerModel().withLocation(location); + return this; + } + + public EcsServiceImpl withTags(Map tags) { + if (isInCreateMode()) { + this.innerModel().withTags(tags); + return this; + } else { + this.updateProperties.withTags(tags); + return this; + } + } + + public EcsServiceImpl withProperties(EcsServiceProperties properties) { + this.innerModel().withProperties(properties); + return this; + } + + private boolean isInCreateMode() { + return this.innerModel().id() == null; + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/EcsServicesClientImpl.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/EcsServicesClientImpl.java new file mode 100644 index 000000000000..ff2a3855259d --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/EcsServicesClientImpl.java @@ -0,0 +1,1276 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.Patch; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.awsconnector.fluent.EcsServicesClient; +import com.azure.resourcemanager.awsconnector.fluent.models.EcsServiceInner; +import com.azure.resourcemanager.awsconnector.models.EcsServiceListResult; +import com.azure.resourcemanager.awsconnector.models.EcsServiceTagsUpdate; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in EcsServicesClient. + */ +public final class EcsServicesClientImpl implements EcsServicesClient { + /** + * The proxy service used to perform REST calls. + */ + private final EcsServicesService service; + + /** + * The service client containing this operation class. + */ + private final MicrosoftAwsConnectorImpl client; + + /** + * Initializes an instance of EcsServicesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + EcsServicesClientImpl(MicrosoftAwsConnectorImpl client) { + this.service + = RestProxy.create(EcsServicesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for MicrosoftAwsConnectorEcsServices to be used by the proxy service to + * perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "MicrosoftAwsConnecto") + public interface EcsServicesService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.AwsConnector/ecsServices") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/ecsServices") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroup(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/ecsServices/{name}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getByResourceGroup(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("name") String name, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/ecsServices/{name}") + @ExpectedResponses({ 200, 201 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrReplace(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("name") String name, + @BodyParam("application/json") EcsServiceInner resource, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/ecsServices/{name}") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> update(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("name") String name, + @BodyParam("application/json") EcsServiceTagsUpdate properties, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/ecsServices/{name}") + @ExpectedResponses({ 202, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("name") String name, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listBySubscriptionNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroupNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); + } + + /** + * List EcsService resources by subscription ID. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a EcsService list operation along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync() { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), + res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List EcsService resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a EcsService list operation along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), accept, + context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * List EcsService resources by subscription ID. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a EcsService list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>(() -> listSinglePageAsync(), + nextLink -> listBySubscriptionNextSinglePageAsync(nextLink)); + } + + /** + * List EcsService resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a EcsService list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(Context context) { + return new PagedFlux<>(() -> listSinglePageAsync(context), + nextLink -> listBySubscriptionNextSinglePageAsync(nextLink, context)); + } + + /** + * List EcsService resources by subscription ID. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a EcsService list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + return new PagedIterable<>(listAsync()); + } + + /** + * List EcsService resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a EcsService list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Context context) { + return new PagedIterable<>(listAsync(context)); + } + + /** + * List EcsService resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a EcsService list operation along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), + res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List EcsService resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a EcsService list operation along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * List EcsService resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a EcsService list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName) { + return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); + } + + /** + * List EcsService resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a EcsService list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName, Context context) { + return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName, context), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink, context)); + } + + /** + * List EcsService resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a EcsService list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName)); + } + + /** + * List EcsService resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a EcsService list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, context)); + } + + /** + * Get a EcsService. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of EcsService. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a EcsService along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync(String resourceGroupName, String name) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.getByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get a EcsService. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of EcsService. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a EcsService along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync(String resourceGroupName, String name, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.getByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, accept, context); + } + + /** + * Get a EcsService. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of EcsService. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a EcsService on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getByResourceGroupAsync(String resourceGroupName, String name) { + return getByResourceGroupWithResponseAsync(resourceGroupName, name) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Get a EcsService. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of EcsService. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a EcsService along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getByResourceGroupWithResponse(String resourceGroupName, String name, + Context context) { + return getByResourceGroupWithResponseAsync(resourceGroupName, name, context).block(); + } + + /** + * Get a EcsService. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of EcsService. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a EcsService. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public EcsServiceInner getByResourceGroup(String resourceGroupName, String name) { + return getByResourceGroupWithResponse(resourceGroupName, name, Context.NONE).getValue(); + } + + /** + * Create a EcsService. Please note that end user resource creation is currently restricted, but it will be enabled + * in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of EcsService. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrReplaceWithResponseAsync(String resourceGroupName, String name, + EcsServiceInner resource) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (resource == null) { + return Mono.error(new IllegalArgumentException("Parameter resource is required and cannot be null.")); + } else { + resource.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.createOrReplace(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, resource, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Create a EcsService. Please note that end user resource creation is currently restricted, but it will be enabled + * in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of EcsService. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrReplaceWithResponseAsync(String resourceGroupName, String name, + EcsServiceInner resource, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (resource == null) { + return Mono.error(new IllegalArgumentException("Parameter resource is required and cannot be null.")); + } else { + resource.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.createOrReplace(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, resource, accept, context); + } + + /** + * Create a EcsService. Please note that end user resource creation is currently restricted, but it will be enabled + * in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of EcsService. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, EcsServiceInner> beginCreateOrReplaceAsync(String resourceGroupName, + String name, EcsServiceInner resource) { + Mono>> mono = createOrReplaceWithResponseAsync(resourceGroupName, name, resource); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + EcsServiceInner.class, EcsServiceInner.class, this.client.getContext()); + } + + /** + * Create a EcsService. Please note that end user resource creation is currently restricted, but it will be enabled + * in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of EcsService. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, EcsServiceInner> beginCreateOrReplaceAsync(String resourceGroupName, + String name, EcsServiceInner resource, Context context) { + context = this.client.mergeContext(context); + Mono>> mono + = createOrReplaceWithResponseAsync(resourceGroupName, name, resource, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + EcsServiceInner.class, EcsServiceInner.class, context); + } + + /** + * Create a EcsService. Please note that end user resource creation is currently restricted, but it will be enabled + * in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of EcsService. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, EcsServiceInner> beginCreateOrReplace(String resourceGroupName, + String name, EcsServiceInner resource) { + return this.beginCreateOrReplaceAsync(resourceGroupName, name, resource).getSyncPoller(); + } + + /** + * Create a EcsService. Please note that end user resource creation is currently restricted, but it will be enabled + * in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of EcsService. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, EcsServiceInner> beginCreateOrReplace(String resourceGroupName, + String name, EcsServiceInner resource, Context context) { + return this.beginCreateOrReplaceAsync(resourceGroupName, name, resource, context).getSyncPoller(); + } + + /** + * Create a EcsService. Please note that end user resource creation is currently restricted, but it will be enabled + * in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of EcsService. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrReplaceAsync(String resourceGroupName, String name, + EcsServiceInner resource) { + return beginCreateOrReplaceAsync(resourceGroupName, name, resource).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create a EcsService. Please note that end user resource creation is currently restricted, but it will be enabled + * in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of EcsService. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrReplaceAsync(String resourceGroupName, String name, EcsServiceInner resource, + Context context) { + return beginCreateOrReplaceAsync(resourceGroupName, name, resource, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create a EcsService. Please note that end user resource creation is currently restricted, but it will be enabled + * in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of EcsService. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public EcsServiceInner createOrReplace(String resourceGroupName, String name, EcsServiceInner resource) { + return createOrReplaceAsync(resourceGroupName, name, resource).block(); + } + + /** + * Create a EcsService. Please note that end user resource creation is currently restricted, but it will be enabled + * in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of EcsService. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public EcsServiceInner createOrReplace(String resourceGroupName, String name, EcsServiceInner resource, + Context context) { + return createOrReplaceAsync(resourceGroupName, name, resource, context).block(); + } + + /** + * Update a EcsService. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of EcsService. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync(String resourceGroupName, String name, + EcsServiceTagsUpdate properties) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (properties == null) { + return Mono.error(new IllegalArgumentException("Parameter properties is required and cannot be null.")); + } else { + properties.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.update(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, properties, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Update a EcsService. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of EcsService. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync(String resourceGroupName, String name, + EcsServiceTagsUpdate properties, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (properties == null) { + return Mono.error(new IllegalArgumentException("Parameter properties is required and cannot be null.")); + } else { + properties.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.update(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, name, properties, accept, context); + } + + /** + * Update a EcsService. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of EcsService. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, EcsServiceInner> beginUpdateAsync(String resourceGroupName, + String name, EcsServiceTagsUpdate properties) { + Mono>> mono = updateWithResponseAsync(resourceGroupName, name, properties); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + EcsServiceInner.class, EcsServiceInner.class, this.client.getContext()); + } + + /** + * Update a EcsService. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of EcsService. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, EcsServiceInner> beginUpdateAsync(String resourceGroupName, + String name, EcsServiceTagsUpdate properties, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = updateWithResponseAsync(resourceGroupName, name, properties, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + EcsServiceInner.class, EcsServiceInner.class, context); + } + + /** + * Update a EcsService. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of EcsService. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, EcsServiceInner> beginUpdate(String resourceGroupName, String name, + EcsServiceTagsUpdate properties) { + return this.beginUpdateAsync(resourceGroupName, name, properties).getSyncPoller(); + } + + /** + * Update a EcsService. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of EcsService. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, EcsServiceInner> beginUpdate(String resourceGroupName, String name, + EcsServiceTagsUpdate properties, Context context) { + return this.beginUpdateAsync(resourceGroupName, name, properties, context).getSyncPoller(); + } + + /** + * Update a EcsService. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of EcsService. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync(String resourceGroupName, String name, EcsServiceTagsUpdate properties) { + return beginUpdateAsync(resourceGroupName, name, properties).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Update a EcsService. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of EcsService. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync(String resourceGroupName, String name, EcsServiceTagsUpdate properties, + Context context) { + return beginUpdateAsync(resourceGroupName, name, properties, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Update a EcsService. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of EcsService. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public EcsServiceInner update(String resourceGroupName, String name, EcsServiceTagsUpdate properties) { + return updateAsync(resourceGroupName, name, properties).block(); + } + + /** + * Update a EcsService. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of EcsService. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public EcsServiceInner update(String resourceGroupName, String name, EcsServiceTagsUpdate properties, + Context context) { + return updateAsync(resourceGroupName, name, properties, context).block(); + } + + /** + * Delete a EcsService. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of EcsService. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync(String resourceGroupName, String name) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Delete a EcsService. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of EcsService. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync(String resourceGroupName, String name, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.delete(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, name, accept, context); + } + + /** + * Delete a EcsService. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of EcsService. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String name) { + Mono>> mono = deleteWithResponseAsync(resourceGroupName, name); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); + } + + /** + * Delete a EcsService. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of EcsService. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String name, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = deleteWithResponseAsync(resourceGroupName, name, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + context); + } + + /** + * Delete a EcsService. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of EcsService. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String name) { + return this.beginDeleteAsync(resourceGroupName, name).getSyncPoller(); + } + + /** + * Delete a EcsService. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of EcsService. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String name, Context context) { + return this.beginDeleteAsync(resourceGroupName, name, context).getSyncPoller(); + } + + /** + * Delete a EcsService. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of EcsService. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String name) { + return beginDeleteAsync(resourceGroupName, name).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete a EcsService. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of EcsService. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String name, Context context) { + return beginDeleteAsync(resourceGroupName, name, context).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete a EcsService. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of EcsService. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String name) { + deleteAsync(resourceGroupName, name).block(); + } + + /** + * Delete a EcsService. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of EcsService. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String name, Context context) { + deleteAsync(resourceGroupName, name, context).block(); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a EcsService list operation along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listBySubscriptionNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), + res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a EcsService list operation along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listBySubscriptionNextSinglePageAsync(String nextLink, + Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a EcsService list operation along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), + res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a EcsService list operation along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupNextSinglePageAsync(String nextLink, + Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/EcsServicesImpl.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/EcsServicesImpl.java new file mode 100644 index 000000000000..09fbc8ea2f71 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/EcsServicesImpl.java @@ -0,0 +1,145 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.awsconnector.fluent.EcsServicesClient; +import com.azure.resourcemanager.awsconnector.fluent.models.EcsServiceInner; +import com.azure.resourcemanager.awsconnector.models.EcsService; +import com.azure.resourcemanager.awsconnector.models.EcsServices; + +public final class EcsServicesImpl implements EcsServices { + private static final ClientLogger LOGGER = new ClientLogger(EcsServicesImpl.class); + + private final EcsServicesClient innerClient; + + private final com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager; + + public EcsServicesImpl(EcsServicesClient innerClient, + com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return ResourceManagerUtils.mapPage(inner, inner1 -> new EcsServiceImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new EcsServiceImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName); + return ResourceManagerUtils.mapPage(inner, inner1 -> new EcsServiceImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new EcsServiceImpl(inner1, this.manager())); + } + + public Response getByResourceGroupWithResponse(String resourceGroupName, String name, Context context) { + Response inner + = this.serviceClient().getByResourceGroupWithResponse(resourceGroupName, name, context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new EcsServiceImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public EcsService getByResourceGroup(String resourceGroupName, String name) { + EcsServiceInner inner = this.serviceClient().getByResourceGroup(resourceGroupName, name); + if (inner != null) { + return new EcsServiceImpl(inner, this.manager()); + } else { + return null; + } + } + + public void deleteByResourceGroup(String resourceGroupName, String name) { + this.serviceClient().delete(resourceGroupName, name); + } + + public void delete(String resourceGroupName, String name, Context context) { + this.serviceClient().delete(resourceGroupName, name, context); + } + + public EcsService getById(String id) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String name = ResourceManagerUtils.getValueFromIdByName(id, "ecsServices"); + if (name == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'ecsServices'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, name, Context.NONE).getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String name = ResourceManagerUtils.getValueFromIdByName(id, "ecsServices"); + if (name == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'ecsServices'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, name, context); + } + + public void deleteById(String id) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String name = ResourceManagerUtils.getValueFromIdByName(id, "ecsServices"); + if (name == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'ecsServices'.", id))); + } + this.delete(resourceGroupName, name, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String name = ResourceManagerUtils.getValueFromIdByName(id, "ecsServices"); + if (name == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'ecsServices'.", id))); + } + this.delete(resourceGroupName, name, context); + } + + private EcsServicesClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.awsconnector.AwsconnectorManager manager() { + return this.serviceManager; + } + + public EcsServiceImpl define(String name) { + return new EcsServiceImpl(name, this.manager()); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/EcsTaskDefinitionImpl.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/EcsTaskDefinitionImpl.java new file mode 100644 index 000000000000..f271986ea638 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/EcsTaskDefinitionImpl.java @@ -0,0 +1,178 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.implementation; + +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.awsconnector.fluent.models.EcsTaskDefinitionInner; +import com.azure.resourcemanager.awsconnector.models.EcsTaskDefinition; +import com.azure.resourcemanager.awsconnector.models.EcsTaskDefinitionProperties; +import com.azure.resourcemanager.awsconnector.models.EcsTaskDefinitionTagsUpdate; +import java.util.Collections; +import java.util.Map; + +public final class EcsTaskDefinitionImpl + implements EcsTaskDefinition, EcsTaskDefinition.Definition, EcsTaskDefinition.Update { + private EcsTaskDefinitionInner innerObject; + + private final com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public String location() { + return this.innerModel().location(); + } + + public Map tags() { + Map inner = this.innerModel().tags(); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } + } + + public EcsTaskDefinitionProperties properties() { + return this.innerModel().properties(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public String resourceGroupName() { + return resourceGroupName; + } + + public EcsTaskDefinitionInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.awsconnector.AwsconnectorManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String name; + + private EcsTaskDefinitionTagsUpdate updateProperties; + + public EcsTaskDefinitionImpl withExistingResourceGroup(String resourceGroupName) { + this.resourceGroupName = resourceGroupName; + return this; + } + + public EcsTaskDefinition create() { + this.innerObject = serviceManager.serviceClient() + .getEcsTaskDefinitions() + .createOrReplace(resourceGroupName, name, this.innerModel(), Context.NONE); + return this; + } + + public EcsTaskDefinition create(Context context) { + this.innerObject = serviceManager.serviceClient() + .getEcsTaskDefinitions() + .createOrReplace(resourceGroupName, name, this.innerModel(), context); + return this; + } + + EcsTaskDefinitionImpl(String name, com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager) { + this.innerObject = new EcsTaskDefinitionInner(); + this.serviceManager = serviceManager; + this.name = name; + } + + public EcsTaskDefinitionImpl update() { + this.updateProperties = new EcsTaskDefinitionTagsUpdate(); + return this; + } + + public EcsTaskDefinition apply() { + this.innerObject = serviceManager.serviceClient() + .getEcsTaskDefinitions() + .update(resourceGroupName, name, updateProperties, Context.NONE); + return this; + } + + public EcsTaskDefinition apply(Context context) { + this.innerObject = serviceManager.serviceClient() + .getEcsTaskDefinitions() + .update(resourceGroupName, name, updateProperties, context); + return this; + } + + EcsTaskDefinitionImpl(EcsTaskDefinitionInner innerObject, + com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.name = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "ecsTaskDefinitions"); + } + + public EcsTaskDefinition refresh() { + this.innerObject = serviceManager.serviceClient() + .getEcsTaskDefinitions() + .getByResourceGroupWithResponse(resourceGroupName, name, Context.NONE) + .getValue(); + return this; + } + + public EcsTaskDefinition refresh(Context context) { + this.innerObject = serviceManager.serviceClient() + .getEcsTaskDefinitions() + .getByResourceGroupWithResponse(resourceGroupName, name, context) + .getValue(); + return this; + } + + public EcsTaskDefinitionImpl withRegion(Region location) { + this.innerModel().withLocation(location.toString()); + return this; + } + + public EcsTaskDefinitionImpl withRegion(String location) { + this.innerModel().withLocation(location); + return this; + } + + public EcsTaskDefinitionImpl withTags(Map tags) { + if (isInCreateMode()) { + this.innerModel().withTags(tags); + return this; + } else { + this.updateProperties.withTags(tags); + return this; + } + } + + public EcsTaskDefinitionImpl withProperties(EcsTaskDefinitionProperties properties) { + this.innerModel().withProperties(properties); + return this; + } + + private boolean isInCreateMode() { + return this.innerModel().id() == null; + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/EcsTaskDefinitionsClientImpl.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/EcsTaskDefinitionsClientImpl.java new file mode 100644 index 000000000000..ade141c0a291 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/EcsTaskDefinitionsClientImpl.java @@ -0,0 +1,1282 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.Patch; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.awsconnector.fluent.EcsTaskDefinitionsClient; +import com.azure.resourcemanager.awsconnector.fluent.models.EcsTaskDefinitionInner; +import com.azure.resourcemanager.awsconnector.models.EcsTaskDefinitionListResult; +import com.azure.resourcemanager.awsconnector.models.EcsTaskDefinitionTagsUpdate; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in EcsTaskDefinitionsClient. + */ +public final class EcsTaskDefinitionsClientImpl implements EcsTaskDefinitionsClient { + /** + * The proxy service used to perform REST calls. + */ + private final EcsTaskDefinitionsService service; + + /** + * The service client containing this operation class. + */ + private final MicrosoftAwsConnectorImpl client; + + /** + * Initializes an instance of EcsTaskDefinitionsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + EcsTaskDefinitionsClientImpl(MicrosoftAwsConnectorImpl client) { + this.service = RestProxy.create(EcsTaskDefinitionsService.class, client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for MicrosoftAwsConnectorEcsTaskDefinitions to be used by the proxy + * service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "MicrosoftAwsConnecto") + public interface EcsTaskDefinitionsService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.AwsConnector/ecsTaskDefinitions") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/ecsTaskDefinitions") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroup(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/ecsTaskDefinitions/{name}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getByResourceGroup(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("name") String name, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/ecsTaskDefinitions/{name}") + @ExpectedResponses({ 200, 201 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrReplace(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("name") String name, + @BodyParam("application/json") EcsTaskDefinitionInner resource, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/ecsTaskDefinitions/{name}") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> update(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("name") String name, + @BodyParam("application/json") EcsTaskDefinitionTagsUpdate properties, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/ecsTaskDefinitions/{name}") + @ExpectedResponses({ 202, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("name") String name, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listBySubscriptionNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroupNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); + } + + /** + * List EcsTaskDefinition resources by subscription ID. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a EcsTaskDefinition list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync() { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List EcsTaskDefinition resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a EcsTaskDefinition list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), accept, + context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * List EcsTaskDefinition resources by subscription ID. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a EcsTaskDefinition list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>(() -> listSinglePageAsync(), + nextLink -> listBySubscriptionNextSinglePageAsync(nextLink)); + } + + /** + * List EcsTaskDefinition resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a EcsTaskDefinition list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(Context context) { + return new PagedFlux<>(() -> listSinglePageAsync(context), + nextLink -> listBySubscriptionNextSinglePageAsync(nextLink, context)); + } + + /** + * List EcsTaskDefinition resources by subscription ID. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a EcsTaskDefinition list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + return new PagedIterable<>(listAsync()); + } + + /** + * List EcsTaskDefinition resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a EcsTaskDefinition list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Context context) { + return new PagedIterable<>(listAsync(context)); + } + + /** + * List EcsTaskDefinition resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a EcsTaskDefinition list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List EcsTaskDefinition resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a EcsTaskDefinition list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * List EcsTaskDefinition resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a EcsTaskDefinition list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName) { + return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); + } + + /** + * List EcsTaskDefinition resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a EcsTaskDefinition list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName, Context context) { + return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName, context), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink, context)); + } + + /** + * List EcsTaskDefinition resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a EcsTaskDefinition list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName)); + } + + /** + * List EcsTaskDefinition resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a EcsTaskDefinition list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, context)); + } + + /** + * Get a EcsTaskDefinition. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of EcsTaskDefinition. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a EcsTaskDefinition along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync(String resourceGroupName, + String name) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.getByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get a EcsTaskDefinition. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of EcsTaskDefinition. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a EcsTaskDefinition along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync(String resourceGroupName, + String name, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.getByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, accept, context); + } + + /** + * Get a EcsTaskDefinition. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of EcsTaskDefinition. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a EcsTaskDefinition on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getByResourceGroupAsync(String resourceGroupName, String name) { + return getByResourceGroupWithResponseAsync(resourceGroupName, name) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Get a EcsTaskDefinition. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of EcsTaskDefinition. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a EcsTaskDefinition along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getByResourceGroupWithResponse(String resourceGroupName, String name, + Context context) { + return getByResourceGroupWithResponseAsync(resourceGroupName, name, context).block(); + } + + /** + * Get a EcsTaskDefinition. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of EcsTaskDefinition. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a EcsTaskDefinition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public EcsTaskDefinitionInner getByResourceGroup(String resourceGroupName, String name) { + return getByResourceGroupWithResponse(resourceGroupName, name, Context.NONE).getValue(); + } + + /** + * Create a EcsTaskDefinition. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of EcsTaskDefinition. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrReplaceWithResponseAsync(String resourceGroupName, String name, + EcsTaskDefinitionInner resource) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (resource == null) { + return Mono.error(new IllegalArgumentException("Parameter resource is required and cannot be null.")); + } else { + resource.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.createOrReplace(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, resource, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Create a EcsTaskDefinition. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of EcsTaskDefinition. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrReplaceWithResponseAsync(String resourceGroupName, String name, + EcsTaskDefinitionInner resource, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (resource == null) { + return Mono.error(new IllegalArgumentException("Parameter resource is required and cannot be null.")); + } else { + resource.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.createOrReplace(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, resource, accept, context); + } + + /** + * Create a EcsTaskDefinition. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of EcsTaskDefinition. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, EcsTaskDefinitionInner> + beginCreateOrReplaceAsync(String resourceGroupName, String name, EcsTaskDefinitionInner resource) { + Mono>> mono = createOrReplaceWithResponseAsync(resourceGroupName, name, resource); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), EcsTaskDefinitionInner.class, EcsTaskDefinitionInner.class, + this.client.getContext()); + } + + /** + * Create a EcsTaskDefinition. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of EcsTaskDefinition. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, EcsTaskDefinitionInner> beginCreateOrReplaceAsync( + String resourceGroupName, String name, EcsTaskDefinitionInner resource, Context context) { + context = this.client.mergeContext(context); + Mono>> mono + = createOrReplaceWithResponseAsync(resourceGroupName, name, resource, context); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), EcsTaskDefinitionInner.class, EcsTaskDefinitionInner.class, context); + } + + /** + * Create a EcsTaskDefinition. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of EcsTaskDefinition. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, EcsTaskDefinitionInner> + beginCreateOrReplace(String resourceGroupName, String name, EcsTaskDefinitionInner resource) { + return this.beginCreateOrReplaceAsync(resourceGroupName, name, resource).getSyncPoller(); + } + + /** + * Create a EcsTaskDefinition. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of EcsTaskDefinition. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, EcsTaskDefinitionInner> + beginCreateOrReplace(String resourceGroupName, String name, EcsTaskDefinitionInner resource, Context context) { + return this.beginCreateOrReplaceAsync(resourceGroupName, name, resource, context).getSyncPoller(); + } + + /** + * Create a EcsTaskDefinition. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of EcsTaskDefinition. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrReplaceAsync(String resourceGroupName, String name, + EcsTaskDefinitionInner resource) { + return beginCreateOrReplaceAsync(resourceGroupName, name, resource).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create a EcsTaskDefinition. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of EcsTaskDefinition. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrReplaceAsync(String resourceGroupName, String name, + EcsTaskDefinitionInner resource, Context context) { + return beginCreateOrReplaceAsync(resourceGroupName, name, resource, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create a EcsTaskDefinition. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of EcsTaskDefinition. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public EcsTaskDefinitionInner createOrReplace(String resourceGroupName, String name, + EcsTaskDefinitionInner resource) { + return createOrReplaceAsync(resourceGroupName, name, resource).block(); + } + + /** + * Create a EcsTaskDefinition. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of EcsTaskDefinition. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public EcsTaskDefinitionInner createOrReplace(String resourceGroupName, String name, + EcsTaskDefinitionInner resource, Context context) { + return createOrReplaceAsync(resourceGroupName, name, resource, context).block(); + } + + /** + * Update a EcsTaskDefinition. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of EcsTaskDefinition. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync(String resourceGroupName, String name, + EcsTaskDefinitionTagsUpdate properties) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (properties == null) { + return Mono.error(new IllegalArgumentException("Parameter properties is required and cannot be null.")); + } else { + properties.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.update(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, properties, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Update a EcsTaskDefinition. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of EcsTaskDefinition. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync(String resourceGroupName, String name, + EcsTaskDefinitionTagsUpdate properties, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (properties == null) { + return Mono.error(new IllegalArgumentException("Parameter properties is required and cannot be null.")); + } else { + properties.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.update(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, name, properties, accept, context); + } + + /** + * Update a EcsTaskDefinition. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of EcsTaskDefinition. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, EcsTaskDefinitionInner> + beginUpdateAsync(String resourceGroupName, String name, EcsTaskDefinitionTagsUpdate properties) { + Mono>> mono = updateWithResponseAsync(resourceGroupName, name, properties); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), EcsTaskDefinitionInner.class, EcsTaskDefinitionInner.class, + this.client.getContext()); + } + + /** + * Update a EcsTaskDefinition. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of EcsTaskDefinition. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, EcsTaskDefinitionInner> beginUpdateAsync( + String resourceGroupName, String name, EcsTaskDefinitionTagsUpdate properties, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = updateWithResponseAsync(resourceGroupName, name, properties, context); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), EcsTaskDefinitionInner.class, EcsTaskDefinitionInner.class, context); + } + + /** + * Update a EcsTaskDefinition. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of EcsTaskDefinition. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, EcsTaskDefinitionInner> beginUpdate(String resourceGroupName, + String name, EcsTaskDefinitionTagsUpdate properties) { + return this.beginUpdateAsync(resourceGroupName, name, properties).getSyncPoller(); + } + + /** + * Update a EcsTaskDefinition. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of EcsTaskDefinition. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, EcsTaskDefinitionInner> beginUpdate(String resourceGroupName, + String name, EcsTaskDefinitionTagsUpdate properties, Context context) { + return this.beginUpdateAsync(resourceGroupName, name, properties, context).getSyncPoller(); + } + + /** + * Update a EcsTaskDefinition. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of EcsTaskDefinition. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync(String resourceGroupName, String name, + EcsTaskDefinitionTagsUpdate properties) { + return beginUpdateAsync(resourceGroupName, name, properties).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Update a EcsTaskDefinition. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of EcsTaskDefinition. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync(String resourceGroupName, String name, + EcsTaskDefinitionTagsUpdate properties, Context context) { + return beginUpdateAsync(resourceGroupName, name, properties, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Update a EcsTaskDefinition. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of EcsTaskDefinition. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public EcsTaskDefinitionInner update(String resourceGroupName, String name, + EcsTaskDefinitionTagsUpdate properties) { + return updateAsync(resourceGroupName, name, properties).block(); + } + + /** + * Update a EcsTaskDefinition. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of EcsTaskDefinition. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public EcsTaskDefinitionInner update(String resourceGroupName, String name, EcsTaskDefinitionTagsUpdate properties, + Context context) { + return updateAsync(resourceGroupName, name, properties, context).block(); + } + + /** + * Delete a EcsTaskDefinition. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of EcsTaskDefinition. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync(String resourceGroupName, String name) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Delete a EcsTaskDefinition. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of EcsTaskDefinition. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync(String resourceGroupName, String name, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.delete(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, name, accept, context); + } + + /** + * Delete a EcsTaskDefinition. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of EcsTaskDefinition. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String name) { + Mono>> mono = deleteWithResponseAsync(resourceGroupName, name); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); + } + + /** + * Delete a EcsTaskDefinition. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of EcsTaskDefinition. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String name, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = deleteWithResponseAsync(resourceGroupName, name, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + context); + } + + /** + * Delete a EcsTaskDefinition. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of EcsTaskDefinition. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String name) { + return this.beginDeleteAsync(resourceGroupName, name).getSyncPoller(); + } + + /** + * Delete a EcsTaskDefinition. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of EcsTaskDefinition. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String name, Context context) { + return this.beginDeleteAsync(resourceGroupName, name, context).getSyncPoller(); + } + + /** + * Delete a EcsTaskDefinition. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of EcsTaskDefinition. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String name) { + return beginDeleteAsync(resourceGroupName, name).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete a EcsTaskDefinition. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of EcsTaskDefinition. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String name, Context context) { + return beginDeleteAsync(resourceGroupName, name, context).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete a EcsTaskDefinition. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of EcsTaskDefinition. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String name) { + deleteAsync(resourceGroupName, name).block(); + } + + /** + * Delete a EcsTaskDefinition. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of EcsTaskDefinition. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String name, Context context) { + deleteAsync(resourceGroupName, name, context).block(); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a EcsTaskDefinition list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listBySubscriptionNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a EcsTaskDefinition list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listBySubscriptionNextSinglePageAsync(String nextLink, + Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a EcsTaskDefinition list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a EcsTaskDefinition list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupNextSinglePageAsync(String nextLink, + Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/EcsTaskDefinitionsImpl.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/EcsTaskDefinitionsImpl.java new file mode 100644 index 000000000000..ee6b8cc270f3 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/EcsTaskDefinitionsImpl.java @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.awsconnector.fluent.EcsTaskDefinitionsClient; +import com.azure.resourcemanager.awsconnector.fluent.models.EcsTaskDefinitionInner; +import com.azure.resourcemanager.awsconnector.models.EcsTaskDefinition; +import com.azure.resourcemanager.awsconnector.models.EcsTaskDefinitions; + +public final class EcsTaskDefinitionsImpl implements EcsTaskDefinitions { + private static final ClientLogger LOGGER = new ClientLogger(EcsTaskDefinitionsImpl.class); + + private final EcsTaskDefinitionsClient innerClient; + + private final com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager; + + public EcsTaskDefinitionsImpl(EcsTaskDefinitionsClient innerClient, + com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return ResourceManagerUtils.mapPage(inner, inner1 -> new EcsTaskDefinitionImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new EcsTaskDefinitionImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName); + return ResourceManagerUtils.mapPage(inner, inner1 -> new EcsTaskDefinitionImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + PagedIterable inner + = this.serviceClient().listByResourceGroup(resourceGroupName, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new EcsTaskDefinitionImpl(inner1, this.manager())); + } + + public Response getByResourceGroupWithResponse(String resourceGroupName, String name, + Context context) { + Response inner + = this.serviceClient().getByResourceGroupWithResponse(resourceGroupName, name, context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new EcsTaskDefinitionImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public EcsTaskDefinition getByResourceGroup(String resourceGroupName, String name) { + EcsTaskDefinitionInner inner = this.serviceClient().getByResourceGroup(resourceGroupName, name); + if (inner != null) { + return new EcsTaskDefinitionImpl(inner, this.manager()); + } else { + return null; + } + } + + public void deleteByResourceGroup(String resourceGroupName, String name) { + this.serviceClient().delete(resourceGroupName, name); + } + + public void delete(String resourceGroupName, String name, Context context) { + this.serviceClient().delete(resourceGroupName, name, context); + } + + public EcsTaskDefinition getById(String id) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String name = ResourceManagerUtils.getValueFromIdByName(id, "ecsTaskDefinitions"); + if (name == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'ecsTaskDefinitions'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, name, Context.NONE).getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String name = ResourceManagerUtils.getValueFromIdByName(id, "ecsTaskDefinitions"); + if (name == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'ecsTaskDefinitions'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, name, context); + } + + public void deleteById(String id) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String name = ResourceManagerUtils.getValueFromIdByName(id, "ecsTaskDefinitions"); + if (name == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'ecsTaskDefinitions'.", id))); + } + this.delete(resourceGroupName, name, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String name = ResourceManagerUtils.getValueFromIdByName(id, "ecsTaskDefinitions"); + if (name == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'ecsTaskDefinitions'.", id))); + } + this.delete(resourceGroupName, name, context); + } + + private EcsTaskDefinitionsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.awsconnector.AwsconnectorManager manager() { + return this.serviceManager; + } + + public EcsTaskDefinitionImpl define(String name) { + return new EcsTaskDefinitionImpl(name, this.manager()); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/EfsFileSystemImpl.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/EfsFileSystemImpl.java new file mode 100644 index 000000000000..863faa1ccfe4 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/EfsFileSystemImpl.java @@ -0,0 +1,177 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.implementation; + +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.awsconnector.fluent.models.EfsFileSystemInner; +import com.azure.resourcemanager.awsconnector.models.EfsFileSystem; +import com.azure.resourcemanager.awsconnector.models.EfsFileSystemProperties; +import com.azure.resourcemanager.awsconnector.models.EfsFileSystemTagsUpdate; +import java.util.Collections; +import java.util.Map; + +public final class EfsFileSystemImpl implements EfsFileSystem, EfsFileSystem.Definition, EfsFileSystem.Update { + private EfsFileSystemInner innerObject; + + private final com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public String location() { + return this.innerModel().location(); + } + + public Map tags() { + Map inner = this.innerModel().tags(); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } + } + + public EfsFileSystemProperties properties() { + return this.innerModel().properties(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public String resourceGroupName() { + return resourceGroupName; + } + + public EfsFileSystemInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.awsconnector.AwsconnectorManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String name; + + private EfsFileSystemTagsUpdate updateProperties; + + public EfsFileSystemImpl withExistingResourceGroup(String resourceGroupName) { + this.resourceGroupName = resourceGroupName; + return this; + } + + public EfsFileSystem create() { + this.innerObject = serviceManager.serviceClient() + .getEfsFileSystems() + .createOrReplace(resourceGroupName, name, this.innerModel(), Context.NONE); + return this; + } + + public EfsFileSystem create(Context context) { + this.innerObject = serviceManager.serviceClient() + .getEfsFileSystems() + .createOrReplace(resourceGroupName, name, this.innerModel(), context); + return this; + } + + EfsFileSystemImpl(String name, com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager) { + this.innerObject = new EfsFileSystemInner(); + this.serviceManager = serviceManager; + this.name = name; + } + + public EfsFileSystemImpl update() { + this.updateProperties = new EfsFileSystemTagsUpdate(); + return this; + } + + public EfsFileSystem apply() { + this.innerObject = serviceManager.serviceClient() + .getEfsFileSystems() + .update(resourceGroupName, name, updateProperties, Context.NONE); + return this; + } + + public EfsFileSystem apply(Context context) { + this.innerObject = serviceManager.serviceClient() + .getEfsFileSystems() + .update(resourceGroupName, name, updateProperties, context); + return this; + } + + EfsFileSystemImpl(EfsFileSystemInner innerObject, + com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.name = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "efsFileSystems"); + } + + public EfsFileSystem refresh() { + this.innerObject = serviceManager.serviceClient() + .getEfsFileSystems() + .getByResourceGroupWithResponse(resourceGroupName, name, Context.NONE) + .getValue(); + return this; + } + + public EfsFileSystem refresh(Context context) { + this.innerObject = serviceManager.serviceClient() + .getEfsFileSystems() + .getByResourceGroupWithResponse(resourceGroupName, name, context) + .getValue(); + return this; + } + + public EfsFileSystemImpl withRegion(Region location) { + this.innerModel().withLocation(location.toString()); + return this; + } + + public EfsFileSystemImpl withRegion(String location) { + this.innerModel().withLocation(location); + return this; + } + + public EfsFileSystemImpl withTags(Map tags) { + if (isInCreateMode()) { + this.innerModel().withTags(tags); + return this; + } else { + this.updateProperties.withTags(tags); + return this; + } + } + + public EfsFileSystemImpl withProperties(EfsFileSystemProperties properties) { + this.innerModel().withProperties(properties); + return this; + } + + private boolean isInCreateMode() { + return this.innerModel().id() == null; + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/EfsFileSystemsClientImpl.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/EfsFileSystemsClientImpl.java new file mode 100644 index 000000000000..b4b93a6653e0 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/EfsFileSystemsClientImpl.java @@ -0,0 +1,1278 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.Patch; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.awsconnector.fluent.EfsFileSystemsClient; +import com.azure.resourcemanager.awsconnector.fluent.models.EfsFileSystemInner; +import com.azure.resourcemanager.awsconnector.models.EfsFileSystemListResult; +import com.azure.resourcemanager.awsconnector.models.EfsFileSystemTagsUpdate; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in EfsFileSystemsClient. + */ +public final class EfsFileSystemsClientImpl implements EfsFileSystemsClient { + /** + * The proxy service used to perform REST calls. + */ + private final EfsFileSystemsService service; + + /** + * The service client containing this operation class. + */ + private final MicrosoftAwsConnectorImpl client; + + /** + * Initializes an instance of EfsFileSystemsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + EfsFileSystemsClientImpl(MicrosoftAwsConnectorImpl client) { + this.service + = RestProxy.create(EfsFileSystemsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for MicrosoftAwsConnectorEfsFileSystems to be used by the proxy service + * to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "MicrosoftAwsConnecto") + public interface EfsFileSystemsService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.AwsConnector/efsFileSystems") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/efsFileSystems") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroup(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/efsFileSystems/{name}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getByResourceGroup(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("name") String name, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/efsFileSystems/{name}") + @ExpectedResponses({ 200, 201 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrReplace(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("name") String name, + @BodyParam("application/json") EfsFileSystemInner resource, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/efsFileSystems/{name}") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> update(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("name") String name, + @BodyParam("application/json") EfsFileSystemTagsUpdate properties, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/efsFileSystems/{name}") + @ExpectedResponses({ 202, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("name") String name, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listBySubscriptionNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroupNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); + } + + /** + * List EfsFileSystem resources by subscription ID. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a EfsFileSystem list operation along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync() { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List EfsFileSystem resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a EfsFileSystem list operation along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), accept, + context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * List EfsFileSystem resources by subscription ID. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a EfsFileSystem list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>(() -> listSinglePageAsync(), + nextLink -> listBySubscriptionNextSinglePageAsync(nextLink)); + } + + /** + * List EfsFileSystem resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a EfsFileSystem list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(Context context) { + return new PagedFlux<>(() -> listSinglePageAsync(context), + nextLink -> listBySubscriptionNextSinglePageAsync(nextLink, context)); + } + + /** + * List EfsFileSystem resources by subscription ID. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a EfsFileSystem list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + return new PagedIterable<>(listAsync()); + } + + /** + * List EfsFileSystem resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a EfsFileSystem list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Context context) { + return new PagedIterable<>(listAsync(context)); + } + + /** + * List EfsFileSystem resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a EfsFileSystem list operation along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List EfsFileSystem resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a EfsFileSystem list operation along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * List EfsFileSystem resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a EfsFileSystem list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName) { + return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); + } + + /** + * List EfsFileSystem resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a EfsFileSystem list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName, Context context) { + return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName, context), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink, context)); + } + + /** + * List EfsFileSystem resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a EfsFileSystem list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName)); + } + + /** + * List EfsFileSystem resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a EfsFileSystem list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, context)); + } + + /** + * Get a EfsFileSystem. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of EfsFileSystem. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a EfsFileSystem along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync(String resourceGroupName, + String name) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.getByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get a EfsFileSystem. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of EfsFileSystem. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a EfsFileSystem along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync(String resourceGroupName, + String name, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.getByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, accept, context); + } + + /** + * Get a EfsFileSystem. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of EfsFileSystem. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a EfsFileSystem on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getByResourceGroupAsync(String resourceGroupName, String name) { + return getByResourceGroupWithResponseAsync(resourceGroupName, name) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Get a EfsFileSystem. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of EfsFileSystem. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a EfsFileSystem along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getByResourceGroupWithResponse(String resourceGroupName, String name, + Context context) { + return getByResourceGroupWithResponseAsync(resourceGroupName, name, context).block(); + } + + /** + * Get a EfsFileSystem. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of EfsFileSystem. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a EfsFileSystem. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public EfsFileSystemInner getByResourceGroup(String resourceGroupName, String name) { + return getByResourceGroupWithResponse(resourceGroupName, name, Context.NONE).getValue(); + } + + /** + * Create a EfsFileSystem. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of EfsFileSystem. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrReplaceWithResponseAsync(String resourceGroupName, String name, + EfsFileSystemInner resource) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (resource == null) { + return Mono.error(new IllegalArgumentException("Parameter resource is required and cannot be null.")); + } else { + resource.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.createOrReplace(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, resource, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Create a EfsFileSystem. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of EfsFileSystem. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrReplaceWithResponseAsync(String resourceGroupName, String name, + EfsFileSystemInner resource, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (resource == null) { + return Mono.error(new IllegalArgumentException("Parameter resource is required and cannot be null.")); + } else { + resource.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.createOrReplace(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, resource, accept, context); + } + + /** + * Create a EfsFileSystem. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of EfsFileSystem. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, EfsFileSystemInner> + beginCreateOrReplaceAsync(String resourceGroupName, String name, EfsFileSystemInner resource) { + Mono>> mono = createOrReplaceWithResponseAsync(resourceGroupName, name, resource); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + EfsFileSystemInner.class, EfsFileSystemInner.class, this.client.getContext()); + } + + /** + * Create a EfsFileSystem. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of EfsFileSystem. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, EfsFileSystemInner> + beginCreateOrReplaceAsync(String resourceGroupName, String name, EfsFileSystemInner resource, Context context) { + context = this.client.mergeContext(context); + Mono>> mono + = createOrReplaceWithResponseAsync(resourceGroupName, name, resource, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + EfsFileSystemInner.class, EfsFileSystemInner.class, context); + } + + /** + * Create a EfsFileSystem. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of EfsFileSystem. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, EfsFileSystemInner> beginCreateOrReplace(String resourceGroupName, + String name, EfsFileSystemInner resource) { + return this.beginCreateOrReplaceAsync(resourceGroupName, name, resource).getSyncPoller(); + } + + /** + * Create a EfsFileSystem. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of EfsFileSystem. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, EfsFileSystemInner> beginCreateOrReplace(String resourceGroupName, + String name, EfsFileSystemInner resource, Context context) { + return this.beginCreateOrReplaceAsync(resourceGroupName, name, resource, context).getSyncPoller(); + } + + /** + * Create a EfsFileSystem. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of EfsFileSystem. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrReplaceAsync(String resourceGroupName, String name, + EfsFileSystemInner resource) { + return beginCreateOrReplaceAsync(resourceGroupName, name, resource).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create a EfsFileSystem. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of EfsFileSystem. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrReplaceAsync(String resourceGroupName, String name, + EfsFileSystemInner resource, Context context) { + return beginCreateOrReplaceAsync(resourceGroupName, name, resource, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create a EfsFileSystem. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of EfsFileSystem. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public EfsFileSystemInner createOrReplace(String resourceGroupName, String name, EfsFileSystemInner resource) { + return createOrReplaceAsync(resourceGroupName, name, resource).block(); + } + + /** + * Create a EfsFileSystem. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of EfsFileSystem. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public EfsFileSystemInner createOrReplace(String resourceGroupName, String name, EfsFileSystemInner resource, + Context context) { + return createOrReplaceAsync(resourceGroupName, name, resource, context).block(); + } + + /** + * Update a EfsFileSystem. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of EfsFileSystem. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync(String resourceGroupName, String name, + EfsFileSystemTagsUpdate properties) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (properties == null) { + return Mono.error(new IllegalArgumentException("Parameter properties is required and cannot be null.")); + } else { + properties.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.update(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, properties, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Update a EfsFileSystem. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of EfsFileSystem. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync(String resourceGroupName, String name, + EfsFileSystemTagsUpdate properties, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (properties == null) { + return Mono.error(new IllegalArgumentException("Parameter properties is required and cannot be null.")); + } else { + properties.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.update(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, name, properties, accept, context); + } + + /** + * Update a EfsFileSystem. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of EfsFileSystem. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, EfsFileSystemInner> beginUpdateAsync(String resourceGroupName, + String name, EfsFileSystemTagsUpdate properties) { + Mono>> mono = updateWithResponseAsync(resourceGroupName, name, properties); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + EfsFileSystemInner.class, EfsFileSystemInner.class, this.client.getContext()); + } + + /** + * Update a EfsFileSystem. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of EfsFileSystem. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, EfsFileSystemInner> beginUpdateAsync(String resourceGroupName, + String name, EfsFileSystemTagsUpdate properties, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = updateWithResponseAsync(resourceGroupName, name, properties, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + EfsFileSystemInner.class, EfsFileSystemInner.class, context); + } + + /** + * Update a EfsFileSystem. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of EfsFileSystem. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, EfsFileSystemInner> beginUpdate(String resourceGroupName, + String name, EfsFileSystemTagsUpdate properties) { + return this.beginUpdateAsync(resourceGroupName, name, properties).getSyncPoller(); + } + + /** + * Update a EfsFileSystem. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of EfsFileSystem. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, EfsFileSystemInner> beginUpdate(String resourceGroupName, + String name, EfsFileSystemTagsUpdate properties, Context context) { + return this.beginUpdateAsync(resourceGroupName, name, properties, context).getSyncPoller(); + } + + /** + * Update a EfsFileSystem. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of EfsFileSystem. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync(String resourceGroupName, String name, + EfsFileSystemTagsUpdate properties) { + return beginUpdateAsync(resourceGroupName, name, properties).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Update a EfsFileSystem. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of EfsFileSystem. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync(String resourceGroupName, String name, + EfsFileSystemTagsUpdate properties, Context context) { + return beginUpdateAsync(resourceGroupName, name, properties, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Update a EfsFileSystem. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of EfsFileSystem. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public EfsFileSystemInner update(String resourceGroupName, String name, EfsFileSystemTagsUpdate properties) { + return updateAsync(resourceGroupName, name, properties).block(); + } + + /** + * Update a EfsFileSystem. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of EfsFileSystem. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public EfsFileSystemInner update(String resourceGroupName, String name, EfsFileSystemTagsUpdate properties, + Context context) { + return updateAsync(resourceGroupName, name, properties, context).block(); + } + + /** + * Delete a EfsFileSystem. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of EfsFileSystem. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync(String resourceGroupName, String name) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Delete a EfsFileSystem. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of EfsFileSystem. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync(String resourceGroupName, String name, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.delete(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, name, accept, context); + } + + /** + * Delete a EfsFileSystem. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of EfsFileSystem. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String name) { + Mono>> mono = deleteWithResponseAsync(resourceGroupName, name); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); + } + + /** + * Delete a EfsFileSystem. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of EfsFileSystem. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String name, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = deleteWithResponseAsync(resourceGroupName, name, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + context); + } + + /** + * Delete a EfsFileSystem. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of EfsFileSystem. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String name) { + return this.beginDeleteAsync(resourceGroupName, name).getSyncPoller(); + } + + /** + * Delete a EfsFileSystem. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of EfsFileSystem. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String name, Context context) { + return this.beginDeleteAsync(resourceGroupName, name, context).getSyncPoller(); + } + + /** + * Delete a EfsFileSystem. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of EfsFileSystem. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String name) { + return beginDeleteAsync(resourceGroupName, name).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete a EfsFileSystem. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of EfsFileSystem. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String name, Context context) { + return beginDeleteAsync(resourceGroupName, name, context).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete a EfsFileSystem. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of EfsFileSystem. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String name) { + deleteAsync(resourceGroupName, name).block(); + } + + /** + * Delete a EfsFileSystem. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of EfsFileSystem. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String name, Context context) { + deleteAsync(resourceGroupName, name, context).block(); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a EfsFileSystem list operation along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listBySubscriptionNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a EfsFileSystem list operation along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listBySubscriptionNextSinglePageAsync(String nextLink, + Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a EfsFileSystem list operation along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a EfsFileSystem list operation along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupNextSinglePageAsync(String nextLink, + Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/EfsFileSystemsImpl.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/EfsFileSystemsImpl.java new file mode 100644 index 000000000000..75c7441a62c7 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/EfsFileSystemsImpl.java @@ -0,0 +1,146 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.awsconnector.fluent.EfsFileSystemsClient; +import com.azure.resourcemanager.awsconnector.fluent.models.EfsFileSystemInner; +import com.azure.resourcemanager.awsconnector.models.EfsFileSystem; +import com.azure.resourcemanager.awsconnector.models.EfsFileSystems; + +public final class EfsFileSystemsImpl implements EfsFileSystems { + private static final ClientLogger LOGGER = new ClientLogger(EfsFileSystemsImpl.class); + + private final EfsFileSystemsClient innerClient; + + private final com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager; + + public EfsFileSystemsImpl(EfsFileSystemsClient innerClient, + com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return ResourceManagerUtils.mapPage(inner, inner1 -> new EfsFileSystemImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new EfsFileSystemImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName); + return ResourceManagerUtils.mapPage(inner, inner1 -> new EfsFileSystemImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new EfsFileSystemImpl(inner1, this.manager())); + } + + public Response getByResourceGroupWithResponse(String resourceGroupName, String name, + Context context) { + Response inner + = this.serviceClient().getByResourceGroupWithResponse(resourceGroupName, name, context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new EfsFileSystemImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public EfsFileSystem getByResourceGroup(String resourceGroupName, String name) { + EfsFileSystemInner inner = this.serviceClient().getByResourceGroup(resourceGroupName, name); + if (inner != null) { + return new EfsFileSystemImpl(inner, this.manager()); + } else { + return null; + } + } + + public void deleteByResourceGroup(String resourceGroupName, String name) { + this.serviceClient().delete(resourceGroupName, name); + } + + public void delete(String resourceGroupName, String name, Context context) { + this.serviceClient().delete(resourceGroupName, name, context); + } + + public EfsFileSystem getById(String id) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String name = ResourceManagerUtils.getValueFromIdByName(id, "efsFileSystems"); + if (name == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'efsFileSystems'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, name, Context.NONE).getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String name = ResourceManagerUtils.getValueFromIdByName(id, "efsFileSystems"); + if (name == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'efsFileSystems'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, name, context); + } + + public void deleteById(String id) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String name = ResourceManagerUtils.getValueFromIdByName(id, "efsFileSystems"); + if (name == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'efsFileSystems'.", id))); + } + this.delete(resourceGroupName, name, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String name = ResourceManagerUtils.getValueFromIdByName(id, "efsFileSystems"); + if (name == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'efsFileSystems'.", id))); + } + this.delete(resourceGroupName, name, context); + } + + private EfsFileSystemsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.awsconnector.AwsconnectorManager manager() { + return this.serviceManager; + } + + public EfsFileSystemImpl define(String name) { + return new EfsFileSystemImpl(name, this.manager()); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/EfsMountTargetImpl.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/EfsMountTargetImpl.java new file mode 100644 index 000000000000..f28f5172e0ef --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/EfsMountTargetImpl.java @@ -0,0 +1,177 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.implementation; + +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.awsconnector.fluent.models.EfsMountTargetInner; +import com.azure.resourcemanager.awsconnector.models.EfsMountTarget; +import com.azure.resourcemanager.awsconnector.models.EfsMountTargetProperties; +import com.azure.resourcemanager.awsconnector.models.EfsMountTargetTagsUpdate; +import java.util.Collections; +import java.util.Map; + +public final class EfsMountTargetImpl implements EfsMountTarget, EfsMountTarget.Definition, EfsMountTarget.Update { + private EfsMountTargetInner innerObject; + + private final com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public String location() { + return this.innerModel().location(); + } + + public Map tags() { + Map inner = this.innerModel().tags(); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } + } + + public EfsMountTargetProperties properties() { + return this.innerModel().properties(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public String resourceGroupName() { + return resourceGroupName; + } + + public EfsMountTargetInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.awsconnector.AwsconnectorManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String name; + + private EfsMountTargetTagsUpdate updateProperties; + + public EfsMountTargetImpl withExistingResourceGroup(String resourceGroupName) { + this.resourceGroupName = resourceGroupName; + return this; + } + + public EfsMountTarget create() { + this.innerObject = serviceManager.serviceClient() + .getEfsMountTargets() + .createOrReplace(resourceGroupName, name, this.innerModel(), Context.NONE); + return this; + } + + public EfsMountTarget create(Context context) { + this.innerObject = serviceManager.serviceClient() + .getEfsMountTargets() + .createOrReplace(resourceGroupName, name, this.innerModel(), context); + return this; + } + + EfsMountTargetImpl(String name, com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager) { + this.innerObject = new EfsMountTargetInner(); + this.serviceManager = serviceManager; + this.name = name; + } + + public EfsMountTargetImpl update() { + this.updateProperties = new EfsMountTargetTagsUpdate(); + return this; + } + + public EfsMountTarget apply() { + this.innerObject = serviceManager.serviceClient() + .getEfsMountTargets() + .update(resourceGroupName, name, updateProperties, Context.NONE); + return this; + } + + public EfsMountTarget apply(Context context) { + this.innerObject = serviceManager.serviceClient() + .getEfsMountTargets() + .update(resourceGroupName, name, updateProperties, context); + return this; + } + + EfsMountTargetImpl(EfsMountTargetInner innerObject, + com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.name = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "efsMountTargets"); + } + + public EfsMountTarget refresh() { + this.innerObject = serviceManager.serviceClient() + .getEfsMountTargets() + .getByResourceGroupWithResponse(resourceGroupName, name, Context.NONE) + .getValue(); + return this; + } + + public EfsMountTarget refresh(Context context) { + this.innerObject = serviceManager.serviceClient() + .getEfsMountTargets() + .getByResourceGroupWithResponse(resourceGroupName, name, context) + .getValue(); + return this; + } + + public EfsMountTargetImpl withRegion(Region location) { + this.innerModel().withLocation(location.toString()); + return this; + } + + public EfsMountTargetImpl withRegion(String location) { + this.innerModel().withLocation(location); + return this; + } + + public EfsMountTargetImpl withTags(Map tags) { + if (isInCreateMode()) { + this.innerModel().withTags(tags); + return this; + } else { + this.updateProperties.withTags(tags); + return this; + } + } + + public EfsMountTargetImpl withProperties(EfsMountTargetProperties properties) { + this.innerModel().withProperties(properties); + return this; + } + + private boolean isInCreateMode() { + return this.innerModel().id() == null; + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/EfsMountTargetsClientImpl.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/EfsMountTargetsClientImpl.java new file mode 100644 index 000000000000..1591d2e9ab96 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/EfsMountTargetsClientImpl.java @@ -0,0 +1,1278 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.Patch; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.awsconnector.fluent.EfsMountTargetsClient; +import com.azure.resourcemanager.awsconnector.fluent.models.EfsMountTargetInner; +import com.azure.resourcemanager.awsconnector.models.EfsMountTargetListResult; +import com.azure.resourcemanager.awsconnector.models.EfsMountTargetTagsUpdate; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in EfsMountTargetsClient. + */ +public final class EfsMountTargetsClientImpl implements EfsMountTargetsClient { + /** + * The proxy service used to perform REST calls. + */ + private final EfsMountTargetsService service; + + /** + * The service client containing this operation class. + */ + private final MicrosoftAwsConnectorImpl client; + + /** + * Initializes an instance of EfsMountTargetsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + EfsMountTargetsClientImpl(MicrosoftAwsConnectorImpl client) { + this.service + = RestProxy.create(EfsMountTargetsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for MicrosoftAwsConnectorEfsMountTargets to be used by the proxy service + * to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "MicrosoftAwsConnecto") + public interface EfsMountTargetsService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.AwsConnector/efsMountTargets") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/efsMountTargets") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroup(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/efsMountTargets/{name}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getByResourceGroup(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("name") String name, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/efsMountTargets/{name}") + @ExpectedResponses({ 200, 201 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrReplace(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("name") String name, + @BodyParam("application/json") EfsMountTargetInner resource, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/efsMountTargets/{name}") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> update(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("name") String name, + @BodyParam("application/json") EfsMountTargetTagsUpdate properties, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/efsMountTargets/{name}") + @ExpectedResponses({ 202, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("name") String name, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listBySubscriptionNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroupNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); + } + + /** + * List EfsMountTarget resources by subscription ID. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a EfsMountTarget list operation along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync() { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List EfsMountTarget resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a EfsMountTarget list operation along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), accept, + context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * List EfsMountTarget resources by subscription ID. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a EfsMountTarget list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>(() -> listSinglePageAsync(), + nextLink -> listBySubscriptionNextSinglePageAsync(nextLink)); + } + + /** + * List EfsMountTarget resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a EfsMountTarget list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(Context context) { + return new PagedFlux<>(() -> listSinglePageAsync(context), + nextLink -> listBySubscriptionNextSinglePageAsync(nextLink, context)); + } + + /** + * List EfsMountTarget resources by subscription ID. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a EfsMountTarget list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + return new PagedIterable<>(listAsync()); + } + + /** + * List EfsMountTarget resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a EfsMountTarget list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Context context) { + return new PagedIterable<>(listAsync(context)); + } + + /** + * List EfsMountTarget resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a EfsMountTarget list operation along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List EfsMountTarget resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a EfsMountTarget list operation along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * List EfsMountTarget resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a EfsMountTarget list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName) { + return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); + } + + /** + * List EfsMountTarget resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a EfsMountTarget list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName, Context context) { + return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName, context), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink, context)); + } + + /** + * List EfsMountTarget resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a EfsMountTarget list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName)); + } + + /** + * List EfsMountTarget resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a EfsMountTarget list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, context)); + } + + /** + * Get a EfsMountTarget. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of EfsMountTarget. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a EfsMountTarget along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync(String resourceGroupName, + String name) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.getByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get a EfsMountTarget. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of EfsMountTarget. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a EfsMountTarget along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync(String resourceGroupName, + String name, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.getByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, accept, context); + } + + /** + * Get a EfsMountTarget. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of EfsMountTarget. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a EfsMountTarget on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getByResourceGroupAsync(String resourceGroupName, String name) { + return getByResourceGroupWithResponseAsync(resourceGroupName, name) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Get a EfsMountTarget. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of EfsMountTarget. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a EfsMountTarget along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getByResourceGroupWithResponse(String resourceGroupName, String name, + Context context) { + return getByResourceGroupWithResponseAsync(resourceGroupName, name, context).block(); + } + + /** + * Get a EfsMountTarget. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of EfsMountTarget. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a EfsMountTarget. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public EfsMountTargetInner getByResourceGroup(String resourceGroupName, String name) { + return getByResourceGroupWithResponse(resourceGroupName, name, Context.NONE).getValue(); + } + + /** + * Create a EfsMountTarget. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of EfsMountTarget. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrReplaceWithResponseAsync(String resourceGroupName, String name, + EfsMountTargetInner resource) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (resource == null) { + return Mono.error(new IllegalArgumentException("Parameter resource is required and cannot be null.")); + } else { + resource.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.createOrReplace(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, resource, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Create a EfsMountTarget. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of EfsMountTarget. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrReplaceWithResponseAsync(String resourceGroupName, String name, + EfsMountTargetInner resource, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (resource == null) { + return Mono.error(new IllegalArgumentException("Parameter resource is required and cannot be null.")); + } else { + resource.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.createOrReplace(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, resource, accept, context); + } + + /** + * Create a EfsMountTarget. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of EfsMountTarget. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, EfsMountTargetInner> + beginCreateOrReplaceAsync(String resourceGroupName, String name, EfsMountTargetInner resource) { + Mono>> mono = createOrReplaceWithResponseAsync(resourceGroupName, name, resource); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + EfsMountTargetInner.class, EfsMountTargetInner.class, this.client.getContext()); + } + + /** + * Create a EfsMountTarget. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of EfsMountTarget. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, EfsMountTargetInner> beginCreateOrReplaceAsync( + String resourceGroupName, String name, EfsMountTargetInner resource, Context context) { + context = this.client.mergeContext(context); + Mono>> mono + = createOrReplaceWithResponseAsync(resourceGroupName, name, resource, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + EfsMountTargetInner.class, EfsMountTargetInner.class, context); + } + + /** + * Create a EfsMountTarget. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of EfsMountTarget. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, EfsMountTargetInner> + beginCreateOrReplace(String resourceGroupName, String name, EfsMountTargetInner resource) { + return this.beginCreateOrReplaceAsync(resourceGroupName, name, resource).getSyncPoller(); + } + + /** + * Create a EfsMountTarget. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of EfsMountTarget. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, EfsMountTargetInner> + beginCreateOrReplace(String resourceGroupName, String name, EfsMountTargetInner resource, Context context) { + return this.beginCreateOrReplaceAsync(resourceGroupName, name, resource, context).getSyncPoller(); + } + + /** + * Create a EfsMountTarget. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of EfsMountTarget. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrReplaceAsync(String resourceGroupName, String name, + EfsMountTargetInner resource) { + return beginCreateOrReplaceAsync(resourceGroupName, name, resource).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create a EfsMountTarget. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of EfsMountTarget. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrReplaceAsync(String resourceGroupName, String name, + EfsMountTargetInner resource, Context context) { + return beginCreateOrReplaceAsync(resourceGroupName, name, resource, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create a EfsMountTarget. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of EfsMountTarget. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public EfsMountTargetInner createOrReplace(String resourceGroupName, String name, EfsMountTargetInner resource) { + return createOrReplaceAsync(resourceGroupName, name, resource).block(); + } + + /** + * Create a EfsMountTarget. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of EfsMountTarget. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public EfsMountTargetInner createOrReplace(String resourceGroupName, String name, EfsMountTargetInner resource, + Context context) { + return createOrReplaceAsync(resourceGroupName, name, resource, context).block(); + } + + /** + * Update a EfsMountTarget. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of EfsMountTarget. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync(String resourceGroupName, String name, + EfsMountTargetTagsUpdate properties) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (properties == null) { + return Mono.error(new IllegalArgumentException("Parameter properties is required and cannot be null.")); + } else { + properties.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.update(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, properties, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Update a EfsMountTarget. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of EfsMountTarget. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync(String resourceGroupName, String name, + EfsMountTargetTagsUpdate properties, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (properties == null) { + return Mono.error(new IllegalArgumentException("Parameter properties is required and cannot be null.")); + } else { + properties.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.update(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, name, properties, accept, context); + } + + /** + * Update a EfsMountTarget. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of EfsMountTarget. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, EfsMountTargetInner> beginUpdateAsync(String resourceGroupName, + String name, EfsMountTargetTagsUpdate properties) { + Mono>> mono = updateWithResponseAsync(resourceGroupName, name, properties); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + EfsMountTargetInner.class, EfsMountTargetInner.class, this.client.getContext()); + } + + /** + * Update a EfsMountTarget. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of EfsMountTarget. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, EfsMountTargetInner> beginUpdateAsync(String resourceGroupName, + String name, EfsMountTargetTagsUpdate properties, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = updateWithResponseAsync(resourceGroupName, name, properties, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + EfsMountTargetInner.class, EfsMountTargetInner.class, context); + } + + /** + * Update a EfsMountTarget. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of EfsMountTarget. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, EfsMountTargetInner> beginUpdate(String resourceGroupName, + String name, EfsMountTargetTagsUpdate properties) { + return this.beginUpdateAsync(resourceGroupName, name, properties).getSyncPoller(); + } + + /** + * Update a EfsMountTarget. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of EfsMountTarget. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, EfsMountTargetInner> beginUpdate(String resourceGroupName, + String name, EfsMountTargetTagsUpdate properties, Context context) { + return this.beginUpdateAsync(resourceGroupName, name, properties, context).getSyncPoller(); + } + + /** + * Update a EfsMountTarget. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of EfsMountTarget. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync(String resourceGroupName, String name, + EfsMountTargetTagsUpdate properties) { + return beginUpdateAsync(resourceGroupName, name, properties).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Update a EfsMountTarget. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of EfsMountTarget. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync(String resourceGroupName, String name, + EfsMountTargetTagsUpdate properties, Context context) { + return beginUpdateAsync(resourceGroupName, name, properties, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Update a EfsMountTarget. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of EfsMountTarget. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public EfsMountTargetInner update(String resourceGroupName, String name, EfsMountTargetTagsUpdate properties) { + return updateAsync(resourceGroupName, name, properties).block(); + } + + /** + * Update a EfsMountTarget. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of EfsMountTarget. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public EfsMountTargetInner update(String resourceGroupName, String name, EfsMountTargetTagsUpdate properties, + Context context) { + return updateAsync(resourceGroupName, name, properties, context).block(); + } + + /** + * Delete a EfsMountTarget. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of EfsMountTarget. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync(String resourceGroupName, String name) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Delete a EfsMountTarget. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of EfsMountTarget. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync(String resourceGroupName, String name, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.delete(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, name, accept, context); + } + + /** + * Delete a EfsMountTarget. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of EfsMountTarget. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String name) { + Mono>> mono = deleteWithResponseAsync(resourceGroupName, name); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); + } + + /** + * Delete a EfsMountTarget. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of EfsMountTarget. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String name, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = deleteWithResponseAsync(resourceGroupName, name, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + context); + } + + /** + * Delete a EfsMountTarget. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of EfsMountTarget. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String name) { + return this.beginDeleteAsync(resourceGroupName, name).getSyncPoller(); + } + + /** + * Delete a EfsMountTarget. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of EfsMountTarget. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String name, Context context) { + return this.beginDeleteAsync(resourceGroupName, name, context).getSyncPoller(); + } + + /** + * Delete a EfsMountTarget. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of EfsMountTarget. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String name) { + return beginDeleteAsync(resourceGroupName, name).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete a EfsMountTarget. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of EfsMountTarget. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String name, Context context) { + return beginDeleteAsync(resourceGroupName, name, context).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete a EfsMountTarget. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of EfsMountTarget. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String name) { + deleteAsync(resourceGroupName, name).block(); + } + + /** + * Delete a EfsMountTarget. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of EfsMountTarget. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String name, Context context) { + deleteAsync(resourceGroupName, name, context).block(); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a EfsMountTarget list operation along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listBySubscriptionNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a EfsMountTarget list operation along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listBySubscriptionNextSinglePageAsync(String nextLink, + Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a EfsMountTarget list operation along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a EfsMountTarget list operation along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupNextSinglePageAsync(String nextLink, + Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/EfsMountTargetsImpl.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/EfsMountTargetsImpl.java new file mode 100644 index 000000000000..433b65aa0cef --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/EfsMountTargetsImpl.java @@ -0,0 +1,146 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.awsconnector.fluent.EfsMountTargetsClient; +import com.azure.resourcemanager.awsconnector.fluent.models.EfsMountTargetInner; +import com.azure.resourcemanager.awsconnector.models.EfsMountTarget; +import com.azure.resourcemanager.awsconnector.models.EfsMountTargets; + +public final class EfsMountTargetsImpl implements EfsMountTargets { + private static final ClientLogger LOGGER = new ClientLogger(EfsMountTargetsImpl.class); + + private final EfsMountTargetsClient innerClient; + + private final com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager; + + public EfsMountTargetsImpl(EfsMountTargetsClient innerClient, + com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return ResourceManagerUtils.mapPage(inner, inner1 -> new EfsMountTargetImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new EfsMountTargetImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName); + return ResourceManagerUtils.mapPage(inner, inner1 -> new EfsMountTargetImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new EfsMountTargetImpl(inner1, this.manager())); + } + + public Response getByResourceGroupWithResponse(String resourceGroupName, String name, + Context context) { + Response inner + = this.serviceClient().getByResourceGroupWithResponse(resourceGroupName, name, context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new EfsMountTargetImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public EfsMountTarget getByResourceGroup(String resourceGroupName, String name) { + EfsMountTargetInner inner = this.serviceClient().getByResourceGroup(resourceGroupName, name); + if (inner != null) { + return new EfsMountTargetImpl(inner, this.manager()); + } else { + return null; + } + } + + public void deleteByResourceGroup(String resourceGroupName, String name) { + this.serviceClient().delete(resourceGroupName, name); + } + + public void delete(String resourceGroupName, String name, Context context) { + this.serviceClient().delete(resourceGroupName, name, context); + } + + public EfsMountTarget getById(String id) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String name = ResourceManagerUtils.getValueFromIdByName(id, "efsMountTargets"); + if (name == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'efsMountTargets'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, name, Context.NONE).getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String name = ResourceManagerUtils.getValueFromIdByName(id, "efsMountTargets"); + if (name == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'efsMountTargets'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, name, context); + } + + public void deleteById(String id) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String name = ResourceManagerUtils.getValueFromIdByName(id, "efsMountTargets"); + if (name == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'efsMountTargets'.", id))); + } + this.delete(resourceGroupName, name, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String name = ResourceManagerUtils.getValueFromIdByName(id, "efsMountTargets"); + if (name == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'efsMountTargets'.", id))); + } + this.delete(resourceGroupName, name, context); + } + + private EfsMountTargetsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.awsconnector.AwsconnectorManager manager() { + return this.serviceManager; + } + + public EfsMountTargetImpl define(String name) { + return new EfsMountTargetImpl(name, this.manager()); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/EksClusterImpl.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/EksClusterImpl.java new file mode 100644 index 000000000000..43aaa92dd646 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/EksClusterImpl.java @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.implementation; + +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.awsconnector.fluent.models.EksClusterInner; +import com.azure.resourcemanager.awsconnector.models.EksCluster; +import com.azure.resourcemanager.awsconnector.models.EksClusterProperties; + +public final class EksClusterImpl implements EksCluster { + private EksClusterInner innerObject; + + private final com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager; + + EksClusterImpl(EksClusterInner innerObject, + com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public EksClusterProperties properties() { + return this.innerModel().properties(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public EksClusterInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.awsconnector.AwsconnectorManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/EksClustersClientImpl.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/EksClustersClientImpl.java new file mode 100644 index 000000000000..2edb8d9caf1d --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/EksClustersClientImpl.java @@ -0,0 +1,752 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.awsconnector.fluent.EksClustersClient; +import com.azure.resourcemanager.awsconnector.fluent.models.EksClusterInner; +import com.azure.resourcemanager.awsconnector.models.EksClusterListResult; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in EksClustersClient. + */ +public final class EksClustersClientImpl implements EksClustersClient { + /** + * The proxy service used to perform REST calls. + */ + private final EksClustersService service; + + /** + * The service client containing this operation class. + */ + private final MicrosoftAwsConnectorImpl client; + + /** + * Initializes an instance of EksClustersClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + EksClustersClientImpl(MicrosoftAwsConnectorImpl client) { + this.service + = RestProxy.create(EksClustersService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for MicrosoftAwsConnectorEksClusters to be used by the proxy service to + * perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "MicrosoftAwsConnecto") + public interface EksClustersService { + @Headers({ "Content-Type: application/json" }) + @Get("/{resourceUri}/providers/Microsoft.AwsConnector/eksClusters") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam(value = "resourceUri", encoded = true) String resourceUri, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/{resourceUri}/providers/Microsoft.AwsConnector/eksClusters/default") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam(value = "resourceUri", encoded = true) String resourceUri, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Put("/{resourceUri}/providers/Microsoft.AwsConnector/eksClusters/default") + @ExpectedResponses({ 200, 201 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrReplace(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam(value = "resourceUri", encoded = true) String resourceUri, + @BodyParam("application/json") EksClusterInner resource, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Delete("/{resourceUri}/providers/Microsoft.AwsConnector/eksClusters/default") + @ExpectedResponses({ 202, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam(value = "resourceUri", encoded = true) String resourceUri, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext(@PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, @HeaderParam("Accept") String accept, Context context); + } + + /** + * List EksCluster resources by parent. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a EksCluster list operation along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(String resourceUri) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceUri == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceUri is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), resourceUri, + accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), + res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List EksCluster resources by parent. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a EksCluster list operation along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(String resourceUri, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceUri == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceUri is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.list(this.client.getEndpoint(), this.client.getApiVersion(), resourceUri, accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * List EksCluster resources by parent. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a EksCluster list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceUri) { + return new PagedFlux<>(() -> listSinglePageAsync(resourceUri), nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * List EksCluster resources by parent. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a EksCluster list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceUri, Context context) { + return new PagedFlux<>(() -> listSinglePageAsync(resourceUri, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * List EksCluster resources by parent. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a EksCluster list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceUri) { + return new PagedIterable<>(listAsync(resourceUri)); + } + + /** + * List EksCluster resources by parent. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a EksCluster list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceUri, Context context) { + return new PagedIterable<>(listAsync(resourceUri, context)); + } + + /** + * Get a EksCluster. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the 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 a EksCluster along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String resourceUri) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceUri == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceUri is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.get(this.client.getEndpoint(), this.client.getApiVersion(), resourceUri, + accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get a EksCluster. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a EksCluster along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String resourceUri, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceUri == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceUri is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.get(this.client.getEndpoint(), this.client.getApiVersion(), resourceUri, accept, context); + } + + /** + * Get a EksCluster. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the 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 a EksCluster on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String resourceUri) { + return getWithResponseAsync(resourceUri).flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Get a EksCluster. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a EksCluster along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(String resourceUri, Context context) { + return getWithResponseAsync(resourceUri, context).block(); + } + + /** + * Get a EksCluster. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the 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 a EksCluster. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public EksClusterInner get(String resourceUri) { + return getWithResponse(resourceUri, Context.NONE).getValue(); + } + + /** + * Create a EksCluster. Please note that end user resource creation is currently restricted, but it will be enabled + * in the future. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrReplaceWithResponseAsync(String resourceUri, + EksClusterInner resource) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceUri == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceUri is required and cannot be null.")); + } + if (resource == null) { + return Mono.error(new IllegalArgumentException("Parameter resource is required and cannot be null.")); + } else { + resource.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.createOrReplace(this.client.getEndpoint(), this.client.getApiVersion(), + resourceUri, resource, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Create a EksCluster. Please note that end user resource creation is currently restricted, but it will be enabled + * in the future. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrReplaceWithResponseAsync(String resourceUri, + EksClusterInner resource, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceUri == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceUri is required and cannot be null.")); + } + if (resource == null) { + return Mono.error(new IllegalArgumentException("Parameter resource is required and cannot be null.")); + } else { + resource.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.createOrReplace(this.client.getEndpoint(), this.client.getApiVersion(), resourceUri, resource, + accept, context); + } + + /** + * Create a EksCluster. Please note that end user resource creation is currently restricted, but it will be enabled + * in the future. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, EksClusterInner> beginCreateOrReplaceAsync(String resourceUri, + EksClusterInner resource) { + Mono>> mono = createOrReplaceWithResponseAsync(resourceUri, resource); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + EksClusterInner.class, EksClusterInner.class, this.client.getContext()); + } + + /** + * Create a EksCluster. Please note that end user resource creation is currently restricted, but it will be enabled + * in the future. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, EksClusterInner> beginCreateOrReplaceAsync(String resourceUri, + EksClusterInner resource, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = createOrReplaceWithResponseAsync(resourceUri, resource, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + EksClusterInner.class, EksClusterInner.class, context); + } + + /** + * Create a EksCluster. Please note that end user resource creation is currently restricted, but it will be enabled + * in the future. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, EksClusterInner> beginCreateOrReplace(String resourceUri, + EksClusterInner resource) { + return this.beginCreateOrReplaceAsync(resourceUri, resource).getSyncPoller(); + } + + /** + * Create a EksCluster. Please note that end user resource creation is currently restricted, but it will be enabled + * in the future. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, EksClusterInner> beginCreateOrReplace(String resourceUri, + EksClusterInner resource, Context context) { + return this.beginCreateOrReplaceAsync(resourceUri, resource, context).getSyncPoller(); + } + + /** + * Create a EksCluster. Please note that end user resource creation is currently restricted, but it will be enabled + * in the future. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrReplaceAsync(String resourceUri, EksClusterInner resource) { + return beginCreateOrReplaceAsync(resourceUri, resource).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create a EksCluster. Please note that end user resource creation is currently restricted, but it will be enabled + * in the future. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrReplaceAsync(String resourceUri, EksClusterInner resource, Context context) { + return beginCreateOrReplaceAsync(resourceUri, resource, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create a EksCluster. Please note that end user resource creation is currently restricted, but it will be enabled + * in the future. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public EksClusterInner createOrReplace(String resourceUri, EksClusterInner resource) { + return createOrReplaceAsync(resourceUri, resource).block(); + } + + /** + * Create a EksCluster. Please note that end user resource creation is currently restricted, but it will be enabled + * in the future. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public EksClusterInner createOrReplace(String resourceUri, EksClusterInner resource, Context context) { + return createOrReplaceAsync(resourceUri, resource, context).block(); + } + + /** + * Delete a EksCluster. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync(String resourceUri) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceUri == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceUri is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), resourceUri, + accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Delete a EksCluster. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync(String resourceUri, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceUri == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceUri is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.delete(this.client.getEndpoint(), this.client.getApiVersion(), resourceUri, accept, context); + } + + /** + * Delete a EksCluster. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync(String resourceUri) { + Mono>> mono = deleteWithResponseAsync(resourceUri); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); + } + + /** + * Delete a EksCluster. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync(String resourceUri, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = deleteWithResponseAsync(resourceUri, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + context); + } + + /** + * Delete a EksCluster. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceUri) { + return this.beginDeleteAsync(resourceUri).getSyncPoller(); + } + + /** + * Delete a EksCluster. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceUri, Context context) { + return this.beginDeleteAsync(resourceUri, context).getSyncPoller(); + } + + /** + * Delete a EksCluster. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the 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 A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceUri) { + return beginDeleteAsync(resourceUri).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete a EksCluster. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceUri, Context context) { + return beginDeleteAsync(resourceUri, context).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete a EksCluster. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceUri) { + deleteAsync(resourceUri).block(); + } + + /** + * Delete a EksCluster. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceUri, Context context) { + deleteAsync(resourceUri, context).block(); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a EksCluster list operation along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), + res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a EksCluster list operation along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/EksClustersImpl.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/EksClustersImpl.java new file mode 100644 index 000000000000..4816ea6a990f --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/EksClustersImpl.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.awsconnector.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.awsconnector.fluent.EksClustersClient; +import com.azure.resourcemanager.awsconnector.fluent.models.EksClusterInner; +import com.azure.resourcemanager.awsconnector.models.EksCluster; +import com.azure.resourcemanager.awsconnector.models.EksClusters; + +public final class EksClustersImpl implements EksClusters { + private static final ClientLogger LOGGER = new ClientLogger(EksClustersImpl.class); + + private final EksClustersClient innerClient; + + private final com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager; + + public EksClustersImpl(EksClustersClient innerClient, + com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list(String resourceUri) { + PagedIterable inner = this.serviceClient().list(resourceUri); + return ResourceManagerUtils.mapPage(inner, inner1 -> new EksClusterImpl(inner1, this.manager())); + } + + public PagedIterable list(String resourceUri, Context context) { + PagedIterable inner = this.serviceClient().list(resourceUri, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new EksClusterImpl(inner1, this.manager())); + } + + public Response getWithResponse(String resourceUri, Context context) { + Response inner = this.serviceClient().getWithResponse(resourceUri, context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new EksClusterImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public EksCluster get(String resourceUri) { + EksClusterInner inner = this.serviceClient().get(resourceUri); + if (inner != null) { + return new EksClusterImpl(inner, this.manager()); + } else { + return null; + } + } + + public EksCluster createOrReplace(String resourceUri, EksClusterInner resource) { + EksClusterInner inner = this.serviceClient().createOrReplace(resourceUri, resource); + if (inner != null) { + return new EksClusterImpl(inner, this.manager()); + } else { + return null; + } + } + + public EksCluster createOrReplace(String resourceUri, EksClusterInner resource, Context context) { + EksClusterInner inner = this.serviceClient().createOrReplace(resourceUri, resource, context); + if (inner != null) { + return new EksClusterImpl(inner, this.manager()); + } else { + return null; + } + } + + public void delete(String resourceUri) { + this.serviceClient().delete(resourceUri); + } + + public void delete(String resourceUri, Context context) { + this.serviceClient().delete(resourceUri, context); + } + + private EksClustersClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.awsconnector.AwsconnectorManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/EksNodegroupImpl.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/EksNodegroupImpl.java new file mode 100644 index 000000000000..9a4dd6eca5bd --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/EksNodegroupImpl.java @@ -0,0 +1,177 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.implementation; + +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.awsconnector.fluent.models.EksNodegroupInner; +import com.azure.resourcemanager.awsconnector.models.EksNodegroup; +import com.azure.resourcemanager.awsconnector.models.EksNodegroupProperties; +import com.azure.resourcemanager.awsconnector.models.EksNodegroupTagsUpdate; +import java.util.Collections; +import java.util.Map; + +public final class EksNodegroupImpl implements EksNodegroup, EksNodegroup.Definition, EksNodegroup.Update { + private EksNodegroupInner innerObject; + + private final com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public String location() { + return this.innerModel().location(); + } + + public Map tags() { + Map inner = this.innerModel().tags(); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } + } + + public EksNodegroupProperties properties() { + return this.innerModel().properties(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public String resourceGroupName() { + return resourceGroupName; + } + + public EksNodegroupInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.awsconnector.AwsconnectorManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String name; + + private EksNodegroupTagsUpdate updateProperties; + + public EksNodegroupImpl withExistingResourceGroup(String resourceGroupName) { + this.resourceGroupName = resourceGroupName; + return this; + } + + public EksNodegroup create() { + this.innerObject = serviceManager.serviceClient() + .getEksNodegroups() + .createOrReplace(resourceGroupName, name, this.innerModel(), Context.NONE); + return this; + } + + public EksNodegroup create(Context context) { + this.innerObject = serviceManager.serviceClient() + .getEksNodegroups() + .createOrReplace(resourceGroupName, name, this.innerModel(), context); + return this; + } + + EksNodegroupImpl(String name, com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager) { + this.innerObject = new EksNodegroupInner(); + this.serviceManager = serviceManager; + this.name = name; + } + + public EksNodegroupImpl update() { + this.updateProperties = new EksNodegroupTagsUpdate(); + return this; + } + + public EksNodegroup apply() { + this.innerObject = serviceManager.serviceClient() + .getEksNodegroups() + .update(resourceGroupName, name, updateProperties, Context.NONE); + return this; + } + + public EksNodegroup apply(Context context) { + this.innerObject = serviceManager.serviceClient() + .getEksNodegroups() + .update(resourceGroupName, name, updateProperties, context); + return this; + } + + EksNodegroupImpl(EksNodegroupInner innerObject, + com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.name = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "eksNodegroups"); + } + + public EksNodegroup refresh() { + this.innerObject = serviceManager.serviceClient() + .getEksNodegroups() + .getByResourceGroupWithResponse(resourceGroupName, name, Context.NONE) + .getValue(); + return this; + } + + public EksNodegroup refresh(Context context) { + this.innerObject = serviceManager.serviceClient() + .getEksNodegroups() + .getByResourceGroupWithResponse(resourceGroupName, name, context) + .getValue(); + return this; + } + + public EksNodegroupImpl withRegion(Region location) { + this.innerModel().withLocation(location.toString()); + return this; + } + + public EksNodegroupImpl withRegion(String location) { + this.innerModel().withLocation(location); + return this; + } + + public EksNodegroupImpl withTags(Map tags) { + if (isInCreateMode()) { + this.innerModel().withTags(tags); + return this; + } else { + this.updateProperties.withTags(tags); + return this; + } + } + + public EksNodegroupImpl withProperties(EksNodegroupProperties properties) { + this.innerModel().withProperties(properties); + return this; + } + + private boolean isInCreateMode() { + return this.innerModel().id() == null; + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/EksNodegroupsClientImpl.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/EksNodegroupsClientImpl.java new file mode 100644 index 000000000000..a8489ba0c7c0 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/EksNodegroupsClientImpl.java @@ -0,0 +1,1278 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.Patch; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.awsconnector.fluent.EksNodegroupsClient; +import com.azure.resourcemanager.awsconnector.fluent.models.EksNodegroupInner; +import com.azure.resourcemanager.awsconnector.models.EksNodegroupListResult; +import com.azure.resourcemanager.awsconnector.models.EksNodegroupTagsUpdate; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in EksNodegroupsClient. + */ +public final class EksNodegroupsClientImpl implements EksNodegroupsClient { + /** + * The proxy service used to perform REST calls. + */ + private final EksNodegroupsService service; + + /** + * The service client containing this operation class. + */ + private final MicrosoftAwsConnectorImpl client; + + /** + * Initializes an instance of EksNodegroupsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + EksNodegroupsClientImpl(MicrosoftAwsConnectorImpl client) { + this.service + = RestProxy.create(EksNodegroupsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for MicrosoftAwsConnectorEksNodegroups to be used by the proxy service to + * perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "MicrosoftAwsConnecto") + public interface EksNodegroupsService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.AwsConnector/eksNodegroups") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/eksNodegroups") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroup(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/eksNodegroups/{name}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getByResourceGroup(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("name") String name, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/eksNodegroups/{name}") + @ExpectedResponses({ 200, 201 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrReplace(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("name") String name, + @BodyParam("application/json") EksNodegroupInner resource, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/eksNodegroups/{name}") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> update(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("name") String name, + @BodyParam("application/json") EksNodegroupTagsUpdate properties, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/eksNodegroups/{name}") + @ExpectedResponses({ 202, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("name") String name, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listBySubscriptionNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroupNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); + } + + /** + * List EksNodegroup resources by subscription ID. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a EksNodegroup list operation along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync() { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), + res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List EksNodegroup resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a EksNodegroup list operation along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), accept, + context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * List EksNodegroup resources by subscription ID. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a EksNodegroup list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>(() -> listSinglePageAsync(), + nextLink -> listBySubscriptionNextSinglePageAsync(nextLink)); + } + + /** + * List EksNodegroup resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a EksNodegroup list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(Context context) { + return new PagedFlux<>(() -> listSinglePageAsync(context), + nextLink -> listBySubscriptionNextSinglePageAsync(nextLink, context)); + } + + /** + * List EksNodegroup resources by subscription ID. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a EksNodegroup list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + return new PagedIterable<>(listAsync()); + } + + /** + * List EksNodegroup resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a EksNodegroup list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Context context) { + return new PagedIterable<>(listAsync(context)); + } + + /** + * List EksNodegroup resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a EksNodegroup list operation along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), + res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List EksNodegroup resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a EksNodegroup list operation along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * List EksNodegroup resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a EksNodegroup list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName) { + return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); + } + + /** + * List EksNodegroup resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a EksNodegroup list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName, Context context) { + return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName, context), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink, context)); + } + + /** + * List EksNodegroup resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a EksNodegroup list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName)); + } + + /** + * List EksNodegroup resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a EksNodegroup list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, context)); + } + + /** + * Get a EksNodegroup. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of EksNodegroup. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a EksNodegroup along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync(String resourceGroupName, + String name) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.getByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get a EksNodegroup. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of EksNodegroup. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a EksNodegroup along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync(String resourceGroupName, String name, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.getByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, accept, context); + } + + /** + * Get a EksNodegroup. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of EksNodegroup. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a EksNodegroup on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getByResourceGroupAsync(String resourceGroupName, String name) { + return getByResourceGroupWithResponseAsync(resourceGroupName, name) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Get a EksNodegroup. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of EksNodegroup. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a EksNodegroup along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getByResourceGroupWithResponse(String resourceGroupName, String name, + Context context) { + return getByResourceGroupWithResponseAsync(resourceGroupName, name, context).block(); + } + + /** + * Get a EksNodegroup. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of EksNodegroup. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a EksNodegroup. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public EksNodegroupInner getByResourceGroup(String resourceGroupName, String name) { + return getByResourceGroupWithResponse(resourceGroupName, name, Context.NONE).getValue(); + } + + /** + * Create a EksNodegroup. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of EksNodegroup. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrReplaceWithResponseAsync(String resourceGroupName, String name, + EksNodegroupInner resource) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (resource == null) { + return Mono.error(new IllegalArgumentException("Parameter resource is required and cannot be null.")); + } else { + resource.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.createOrReplace(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, resource, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Create a EksNodegroup. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of EksNodegroup. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrReplaceWithResponseAsync(String resourceGroupName, String name, + EksNodegroupInner resource, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (resource == null) { + return Mono.error(new IllegalArgumentException("Parameter resource is required and cannot be null.")); + } else { + resource.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.createOrReplace(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, resource, accept, context); + } + + /** + * Create a EksNodegroup. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of EksNodegroup. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, EksNodegroupInner> + beginCreateOrReplaceAsync(String resourceGroupName, String name, EksNodegroupInner resource) { + Mono>> mono = createOrReplaceWithResponseAsync(resourceGroupName, name, resource); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + EksNodegroupInner.class, EksNodegroupInner.class, this.client.getContext()); + } + + /** + * Create a EksNodegroup. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of EksNodegroup. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, EksNodegroupInner> + beginCreateOrReplaceAsync(String resourceGroupName, String name, EksNodegroupInner resource, Context context) { + context = this.client.mergeContext(context); + Mono>> mono + = createOrReplaceWithResponseAsync(resourceGroupName, name, resource, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + EksNodegroupInner.class, EksNodegroupInner.class, context); + } + + /** + * Create a EksNodegroup. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of EksNodegroup. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, EksNodegroupInner> beginCreateOrReplace(String resourceGroupName, + String name, EksNodegroupInner resource) { + return this.beginCreateOrReplaceAsync(resourceGroupName, name, resource).getSyncPoller(); + } + + /** + * Create a EksNodegroup. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of EksNodegroup. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, EksNodegroupInner> beginCreateOrReplace(String resourceGroupName, + String name, EksNodegroupInner resource, Context context) { + return this.beginCreateOrReplaceAsync(resourceGroupName, name, resource, context).getSyncPoller(); + } + + /** + * Create a EksNodegroup. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of EksNodegroup. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrReplaceAsync(String resourceGroupName, String name, + EksNodegroupInner resource) { + return beginCreateOrReplaceAsync(resourceGroupName, name, resource).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create a EksNodegroup. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of EksNodegroup. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrReplaceAsync(String resourceGroupName, String name, + EksNodegroupInner resource, Context context) { + return beginCreateOrReplaceAsync(resourceGroupName, name, resource, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create a EksNodegroup. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of EksNodegroup. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public EksNodegroupInner createOrReplace(String resourceGroupName, String name, EksNodegroupInner resource) { + return createOrReplaceAsync(resourceGroupName, name, resource).block(); + } + + /** + * Create a EksNodegroup. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of EksNodegroup. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public EksNodegroupInner createOrReplace(String resourceGroupName, String name, EksNodegroupInner resource, + Context context) { + return createOrReplaceAsync(resourceGroupName, name, resource, context).block(); + } + + /** + * Update a EksNodegroup. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of EksNodegroup. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync(String resourceGroupName, String name, + EksNodegroupTagsUpdate properties) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (properties == null) { + return Mono.error(new IllegalArgumentException("Parameter properties is required and cannot be null.")); + } else { + properties.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.update(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, properties, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Update a EksNodegroup. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of EksNodegroup. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync(String resourceGroupName, String name, + EksNodegroupTagsUpdate properties, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (properties == null) { + return Mono.error(new IllegalArgumentException("Parameter properties is required and cannot be null.")); + } else { + properties.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.update(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, name, properties, accept, context); + } + + /** + * Update a EksNodegroup. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of EksNodegroup. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, EksNodegroupInner> beginUpdateAsync(String resourceGroupName, + String name, EksNodegroupTagsUpdate properties) { + Mono>> mono = updateWithResponseAsync(resourceGroupName, name, properties); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + EksNodegroupInner.class, EksNodegroupInner.class, this.client.getContext()); + } + + /** + * Update a EksNodegroup. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of EksNodegroup. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, EksNodegroupInner> beginUpdateAsync(String resourceGroupName, + String name, EksNodegroupTagsUpdate properties, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = updateWithResponseAsync(resourceGroupName, name, properties, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + EksNodegroupInner.class, EksNodegroupInner.class, context); + } + + /** + * Update a EksNodegroup. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of EksNodegroup. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, EksNodegroupInner> beginUpdate(String resourceGroupName, + String name, EksNodegroupTagsUpdate properties) { + return this.beginUpdateAsync(resourceGroupName, name, properties).getSyncPoller(); + } + + /** + * Update a EksNodegroup. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of EksNodegroup. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, EksNodegroupInner> beginUpdate(String resourceGroupName, + String name, EksNodegroupTagsUpdate properties, Context context) { + return this.beginUpdateAsync(resourceGroupName, name, properties, context).getSyncPoller(); + } + + /** + * Update a EksNodegroup. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of EksNodegroup. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync(String resourceGroupName, String name, + EksNodegroupTagsUpdate properties) { + return beginUpdateAsync(resourceGroupName, name, properties).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Update a EksNodegroup. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of EksNodegroup. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync(String resourceGroupName, String name, + EksNodegroupTagsUpdate properties, Context context) { + return beginUpdateAsync(resourceGroupName, name, properties, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Update a EksNodegroup. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of EksNodegroup. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public EksNodegroupInner update(String resourceGroupName, String name, EksNodegroupTagsUpdate properties) { + return updateAsync(resourceGroupName, name, properties).block(); + } + + /** + * Update a EksNodegroup. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of EksNodegroup. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public EksNodegroupInner update(String resourceGroupName, String name, EksNodegroupTagsUpdate properties, + Context context) { + return updateAsync(resourceGroupName, name, properties, context).block(); + } + + /** + * Delete a EksNodegroup. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of EksNodegroup. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync(String resourceGroupName, String name) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Delete a EksNodegroup. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of EksNodegroup. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync(String resourceGroupName, String name, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.delete(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, name, accept, context); + } + + /** + * Delete a EksNodegroup. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of EksNodegroup. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String name) { + Mono>> mono = deleteWithResponseAsync(resourceGroupName, name); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); + } + + /** + * Delete a EksNodegroup. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of EksNodegroup. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String name, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = deleteWithResponseAsync(resourceGroupName, name, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + context); + } + + /** + * Delete a EksNodegroup. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of EksNodegroup. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String name) { + return this.beginDeleteAsync(resourceGroupName, name).getSyncPoller(); + } + + /** + * Delete a EksNodegroup. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of EksNodegroup. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String name, Context context) { + return this.beginDeleteAsync(resourceGroupName, name, context).getSyncPoller(); + } + + /** + * Delete a EksNodegroup. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of EksNodegroup. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String name) { + return beginDeleteAsync(resourceGroupName, name).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete a EksNodegroup. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of EksNodegroup. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String name, Context context) { + return beginDeleteAsync(resourceGroupName, name, context).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete a EksNodegroup. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of EksNodegroup. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String name) { + deleteAsync(resourceGroupName, name).block(); + } + + /** + * Delete a EksNodegroup. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of EksNodegroup. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String name, Context context) { + deleteAsync(resourceGroupName, name, context).block(); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a EksNodegroup list operation along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listBySubscriptionNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), + res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a EksNodegroup list operation along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listBySubscriptionNextSinglePageAsync(String nextLink, + Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a EksNodegroup list operation along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), + res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a EksNodegroup list operation along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupNextSinglePageAsync(String nextLink, + Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/EksNodegroupsImpl.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/EksNodegroupsImpl.java new file mode 100644 index 000000000000..7ac23dea7d1f --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/EksNodegroupsImpl.java @@ -0,0 +1,146 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.awsconnector.fluent.EksNodegroupsClient; +import com.azure.resourcemanager.awsconnector.fluent.models.EksNodegroupInner; +import com.azure.resourcemanager.awsconnector.models.EksNodegroup; +import com.azure.resourcemanager.awsconnector.models.EksNodegroups; + +public final class EksNodegroupsImpl implements EksNodegroups { + private static final ClientLogger LOGGER = new ClientLogger(EksNodegroupsImpl.class); + + private final EksNodegroupsClient innerClient; + + private final com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager; + + public EksNodegroupsImpl(EksNodegroupsClient innerClient, + com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return ResourceManagerUtils.mapPage(inner, inner1 -> new EksNodegroupImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new EksNodegroupImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName); + return ResourceManagerUtils.mapPage(inner, inner1 -> new EksNodegroupImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new EksNodegroupImpl(inner1, this.manager())); + } + + public Response getByResourceGroupWithResponse(String resourceGroupName, String name, + Context context) { + Response inner + = this.serviceClient().getByResourceGroupWithResponse(resourceGroupName, name, context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new EksNodegroupImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public EksNodegroup getByResourceGroup(String resourceGroupName, String name) { + EksNodegroupInner inner = this.serviceClient().getByResourceGroup(resourceGroupName, name); + if (inner != null) { + return new EksNodegroupImpl(inner, this.manager()); + } else { + return null; + } + } + + public void deleteByResourceGroup(String resourceGroupName, String name) { + this.serviceClient().delete(resourceGroupName, name); + } + + public void delete(String resourceGroupName, String name, Context context) { + this.serviceClient().delete(resourceGroupName, name, context); + } + + public EksNodegroup getById(String id) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String name = ResourceManagerUtils.getValueFromIdByName(id, "eksNodegroups"); + if (name == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'eksNodegroups'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, name, Context.NONE).getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String name = ResourceManagerUtils.getValueFromIdByName(id, "eksNodegroups"); + if (name == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'eksNodegroups'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, name, context); + } + + public void deleteById(String id) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String name = ResourceManagerUtils.getValueFromIdByName(id, "eksNodegroups"); + if (name == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'eksNodegroups'.", id))); + } + this.delete(resourceGroupName, name, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String name = ResourceManagerUtils.getValueFromIdByName(id, "eksNodegroups"); + if (name == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'eksNodegroups'.", id))); + } + this.delete(resourceGroupName, name, context); + } + + private EksNodegroupsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.awsconnector.AwsconnectorManager manager() { + return this.serviceManager; + } + + public EksNodegroupImpl define(String name) { + return new EksNodegroupImpl(name, this.manager()); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/ElasticBeanstalkApplicationImpl.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/ElasticBeanstalkApplicationImpl.java new file mode 100644 index 000000000000..60cfed2ee6bd --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/ElasticBeanstalkApplicationImpl.java @@ -0,0 +1,179 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.implementation; + +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.awsconnector.fluent.models.ElasticBeanstalkApplicationInner; +import com.azure.resourcemanager.awsconnector.models.ElasticBeanstalkApplication; +import com.azure.resourcemanager.awsconnector.models.ElasticBeanstalkApplicationProperties; +import com.azure.resourcemanager.awsconnector.models.ElasticBeanstalkApplicationTagsUpdate; +import java.util.Collections; +import java.util.Map; + +public final class ElasticBeanstalkApplicationImpl + implements ElasticBeanstalkApplication, ElasticBeanstalkApplication.Definition, ElasticBeanstalkApplication.Update { + private ElasticBeanstalkApplicationInner innerObject; + + private final com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public String location() { + return this.innerModel().location(); + } + + public Map tags() { + Map inner = this.innerModel().tags(); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } + } + + public ElasticBeanstalkApplicationProperties properties() { + return this.innerModel().properties(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public String resourceGroupName() { + return resourceGroupName; + } + + public ElasticBeanstalkApplicationInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.awsconnector.AwsconnectorManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String name; + + private ElasticBeanstalkApplicationTagsUpdate updateProperties; + + public ElasticBeanstalkApplicationImpl withExistingResourceGroup(String resourceGroupName) { + this.resourceGroupName = resourceGroupName; + return this; + } + + public ElasticBeanstalkApplication create() { + this.innerObject = serviceManager.serviceClient() + .getElasticBeanstalkApplications() + .createOrReplace(resourceGroupName, name, this.innerModel(), Context.NONE); + return this; + } + + public ElasticBeanstalkApplication create(Context context) { + this.innerObject = serviceManager.serviceClient() + .getElasticBeanstalkApplications() + .createOrReplace(resourceGroupName, name, this.innerModel(), context); + return this; + } + + ElasticBeanstalkApplicationImpl(String name, + com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager) { + this.innerObject = new ElasticBeanstalkApplicationInner(); + this.serviceManager = serviceManager; + this.name = name; + } + + public ElasticBeanstalkApplicationImpl update() { + this.updateProperties = new ElasticBeanstalkApplicationTagsUpdate(); + return this; + } + + public ElasticBeanstalkApplication apply() { + this.innerObject = serviceManager.serviceClient() + .getElasticBeanstalkApplications() + .update(resourceGroupName, name, updateProperties, Context.NONE); + return this; + } + + public ElasticBeanstalkApplication apply(Context context) { + this.innerObject = serviceManager.serviceClient() + .getElasticBeanstalkApplications() + .update(resourceGroupName, name, updateProperties, context); + return this; + } + + ElasticBeanstalkApplicationImpl(ElasticBeanstalkApplicationInner innerObject, + com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.name = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "elasticBeanstalkApplications"); + } + + public ElasticBeanstalkApplication refresh() { + this.innerObject = serviceManager.serviceClient() + .getElasticBeanstalkApplications() + .getByResourceGroupWithResponse(resourceGroupName, name, Context.NONE) + .getValue(); + return this; + } + + public ElasticBeanstalkApplication refresh(Context context) { + this.innerObject = serviceManager.serviceClient() + .getElasticBeanstalkApplications() + .getByResourceGroupWithResponse(resourceGroupName, name, context) + .getValue(); + return this; + } + + public ElasticBeanstalkApplicationImpl withRegion(Region location) { + this.innerModel().withLocation(location.toString()); + return this; + } + + public ElasticBeanstalkApplicationImpl withRegion(String location) { + this.innerModel().withLocation(location); + return this; + } + + public ElasticBeanstalkApplicationImpl withTags(Map tags) { + if (isInCreateMode()) { + this.innerModel().withTags(tags); + return this; + } else { + this.updateProperties.withTags(tags); + return this; + } + } + + public ElasticBeanstalkApplicationImpl withProperties(ElasticBeanstalkApplicationProperties properties) { + this.innerModel().withProperties(properties); + return this; + } + + private boolean isInCreateMode() { + return this.innerModel().id() == null; + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/ElasticBeanstalkApplicationsClientImpl.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/ElasticBeanstalkApplicationsClientImpl.java new file mode 100644 index 000000000000..67aeb395fa24 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/ElasticBeanstalkApplicationsClientImpl.java @@ -0,0 +1,1299 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.Patch; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.awsconnector.fluent.ElasticBeanstalkApplicationsClient; +import com.azure.resourcemanager.awsconnector.fluent.models.ElasticBeanstalkApplicationInner; +import com.azure.resourcemanager.awsconnector.models.ElasticBeanstalkApplicationListResult; +import com.azure.resourcemanager.awsconnector.models.ElasticBeanstalkApplicationTagsUpdate; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in ElasticBeanstalkApplicationsClient. + */ +public final class ElasticBeanstalkApplicationsClientImpl implements ElasticBeanstalkApplicationsClient { + /** + * The proxy service used to perform REST calls. + */ + private final ElasticBeanstalkApplicationsService service; + + /** + * The service client containing this operation class. + */ + private final MicrosoftAwsConnectorImpl client; + + /** + * Initializes an instance of ElasticBeanstalkApplicationsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + ElasticBeanstalkApplicationsClientImpl(MicrosoftAwsConnectorImpl client) { + this.service = RestProxy.create(ElasticBeanstalkApplicationsService.class, client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for MicrosoftAwsConnectorElasticBeanstalkApplications to be used by the + * proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "MicrosoftAwsConnecto") + public interface ElasticBeanstalkApplicationsService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.AwsConnector/elasticBeanstalkApplications") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/elasticBeanstalkApplications") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroup(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/elasticBeanstalkApplications/{name}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getByResourceGroup(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("name") String name, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/elasticBeanstalkApplications/{name}") + @ExpectedResponses({ 200, 201 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrReplace(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("name") String name, + @BodyParam("application/json") ElasticBeanstalkApplicationInner resource, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/elasticBeanstalkApplications/{name}") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> update(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("name") String name, + @BodyParam("application/json") ElasticBeanstalkApplicationTagsUpdate properties, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/elasticBeanstalkApplications/{name}") + @ExpectedResponses({ 202, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("name") String name, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listBySubscriptionNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroupNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); + } + + /** + * List ElasticBeanstalkApplication resources by subscription ID. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a ElasticBeanstalkApplication list operation along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync() { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List ElasticBeanstalkApplication resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a ElasticBeanstalkApplication list operation along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), accept, + context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * List ElasticBeanstalkApplication resources by subscription ID. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a ElasticBeanstalkApplication list operation as paginated response with + * {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>(() -> listSinglePageAsync(), + nextLink -> listBySubscriptionNextSinglePageAsync(nextLink)); + } + + /** + * List ElasticBeanstalkApplication resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a ElasticBeanstalkApplication list operation as paginated response with + * {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(Context context) { + return new PagedFlux<>(() -> listSinglePageAsync(context), + nextLink -> listBySubscriptionNextSinglePageAsync(nextLink, context)); + } + + /** + * List ElasticBeanstalkApplication resources by subscription ID. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a ElasticBeanstalkApplication list operation as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + return new PagedIterable<>(listAsync()); + } + + /** + * List ElasticBeanstalkApplication resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a ElasticBeanstalkApplication list operation as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Context context) { + return new PagedIterable<>(listAsync(context)); + } + + /** + * List ElasticBeanstalkApplication resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a ElasticBeanstalkApplication list operation along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> + listByResourceGroupSinglePageAsync(String resourceGroupName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List ElasticBeanstalkApplication resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a ElasticBeanstalkApplication list operation along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> + listByResourceGroupSinglePageAsync(String resourceGroupName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * List ElasticBeanstalkApplication resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a ElasticBeanstalkApplication list operation as paginated response with + * {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName) { + return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); + } + + /** + * List ElasticBeanstalkApplication resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a ElasticBeanstalkApplication list operation as paginated response with + * {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName, + Context context) { + return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName, context), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink, context)); + } + + /** + * List ElasticBeanstalkApplication resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a ElasticBeanstalkApplication list operation as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName)); + } + + /** + * List ElasticBeanstalkApplication resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a ElasticBeanstalkApplication list operation as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName, + Context context) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, context)); + } + + /** + * Get a ElasticBeanstalkApplication. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ElasticBeanstalkApplication. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a ElasticBeanstalkApplication along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> + getByResourceGroupWithResponseAsync(String resourceGroupName, String name) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.getByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get a ElasticBeanstalkApplication. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ElasticBeanstalkApplication. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a ElasticBeanstalkApplication along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> + getByResourceGroupWithResponseAsync(String resourceGroupName, String name, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.getByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, accept, context); + } + + /** + * Get a ElasticBeanstalkApplication. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ElasticBeanstalkApplication. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a ElasticBeanstalkApplication on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getByResourceGroupAsync(String resourceGroupName, String name) { + return getByResourceGroupWithResponseAsync(resourceGroupName, name) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Get a ElasticBeanstalkApplication. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ElasticBeanstalkApplication. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a ElasticBeanstalkApplication along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getByResourceGroupWithResponse(String resourceGroupName, + String name, Context context) { + return getByResourceGroupWithResponseAsync(resourceGroupName, name, context).block(); + } + + /** + * Get a ElasticBeanstalkApplication. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ElasticBeanstalkApplication. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a ElasticBeanstalkApplication. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ElasticBeanstalkApplicationInner getByResourceGroup(String resourceGroupName, String name) { + return getByResourceGroupWithResponse(resourceGroupName, name, Context.NONE).getValue(); + } + + /** + * Create a ElasticBeanstalkApplication. Please note that end user resource creation is currently restricted, but it + * will be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ElasticBeanstalkApplication. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrReplaceWithResponseAsync(String resourceGroupName, String name, + ElasticBeanstalkApplicationInner resource) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (resource == null) { + return Mono.error(new IllegalArgumentException("Parameter resource is required and cannot be null.")); + } else { + resource.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.createOrReplace(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, resource, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Create a ElasticBeanstalkApplication. Please note that end user resource creation is currently restricted, but it + * will be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ElasticBeanstalkApplication. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrReplaceWithResponseAsync(String resourceGroupName, String name, + ElasticBeanstalkApplicationInner resource, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (resource == null) { + return Mono.error(new IllegalArgumentException("Parameter resource is required and cannot be null.")); + } else { + resource.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.createOrReplace(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, resource, accept, context); + } + + /** + * Create a ElasticBeanstalkApplication. Please note that end user resource creation is currently restricted, but it + * will be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ElasticBeanstalkApplication. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, ElasticBeanstalkApplicationInner> + beginCreateOrReplaceAsync(String resourceGroupName, String name, ElasticBeanstalkApplicationInner resource) { + Mono>> mono = createOrReplaceWithResponseAsync(resourceGroupName, name, resource); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), ElasticBeanstalkApplicationInner.class, + ElasticBeanstalkApplicationInner.class, this.client.getContext()); + } + + /** + * Create a ElasticBeanstalkApplication. Please note that end user resource creation is currently restricted, but it + * will be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ElasticBeanstalkApplication. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, ElasticBeanstalkApplicationInner> + beginCreateOrReplaceAsync(String resourceGroupName, String name, ElasticBeanstalkApplicationInner resource, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono + = createOrReplaceWithResponseAsync(resourceGroupName, name, resource, context); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), ElasticBeanstalkApplicationInner.class, + ElasticBeanstalkApplicationInner.class, context); + } + + /** + * Create a ElasticBeanstalkApplication. Please note that end user resource creation is currently restricted, but it + * will be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ElasticBeanstalkApplication. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ElasticBeanstalkApplicationInner> + beginCreateOrReplace(String resourceGroupName, String name, ElasticBeanstalkApplicationInner resource) { + return this.beginCreateOrReplaceAsync(resourceGroupName, name, resource).getSyncPoller(); + } + + /** + * Create a ElasticBeanstalkApplication. Please note that end user resource creation is currently restricted, but it + * will be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ElasticBeanstalkApplication. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ElasticBeanstalkApplicationInner> + beginCreateOrReplace(String resourceGroupName, String name, ElasticBeanstalkApplicationInner resource, + Context context) { + return this.beginCreateOrReplaceAsync(resourceGroupName, name, resource, context).getSyncPoller(); + } + + /** + * Create a ElasticBeanstalkApplication. Please note that end user resource creation is currently restricted, but it + * will be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ElasticBeanstalkApplication. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrReplaceAsync(String resourceGroupName, String name, + ElasticBeanstalkApplicationInner resource) { + return beginCreateOrReplaceAsync(resourceGroupName, name, resource).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create a ElasticBeanstalkApplication. Please note that end user resource creation is currently restricted, but it + * will be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ElasticBeanstalkApplication. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrReplaceAsync(String resourceGroupName, String name, + ElasticBeanstalkApplicationInner resource, Context context) { + return beginCreateOrReplaceAsync(resourceGroupName, name, resource, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create a ElasticBeanstalkApplication. Please note that end user resource creation is currently restricted, but it + * will be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ElasticBeanstalkApplication. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ElasticBeanstalkApplicationInner createOrReplace(String resourceGroupName, String name, + ElasticBeanstalkApplicationInner resource) { + return createOrReplaceAsync(resourceGroupName, name, resource).block(); + } + + /** + * Create a ElasticBeanstalkApplication. Please note that end user resource creation is currently restricted, but it + * will be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ElasticBeanstalkApplication. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ElasticBeanstalkApplicationInner createOrReplace(String resourceGroupName, String name, + ElasticBeanstalkApplicationInner resource, Context context) { + return createOrReplaceAsync(resourceGroupName, name, resource, context).block(); + } + + /** + * Update a ElasticBeanstalkApplication. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ElasticBeanstalkApplication. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync(String resourceGroupName, String name, + ElasticBeanstalkApplicationTagsUpdate properties) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (properties == null) { + return Mono.error(new IllegalArgumentException("Parameter properties is required and cannot be null.")); + } else { + properties.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.update(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, properties, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Update a ElasticBeanstalkApplication. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ElasticBeanstalkApplication. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync(String resourceGroupName, String name, + ElasticBeanstalkApplicationTagsUpdate properties, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (properties == null) { + return Mono.error(new IllegalArgumentException("Parameter properties is required and cannot be null.")); + } else { + properties.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.update(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, name, properties, accept, context); + } + + /** + * Update a ElasticBeanstalkApplication. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ElasticBeanstalkApplication. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, ElasticBeanstalkApplicationInner> + beginUpdateAsync(String resourceGroupName, String name, ElasticBeanstalkApplicationTagsUpdate properties) { + Mono>> mono = updateWithResponseAsync(resourceGroupName, name, properties); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), ElasticBeanstalkApplicationInner.class, + ElasticBeanstalkApplicationInner.class, this.client.getContext()); + } + + /** + * Update a ElasticBeanstalkApplication. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ElasticBeanstalkApplication. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, ElasticBeanstalkApplicationInner> beginUpdateAsync( + String resourceGroupName, String name, ElasticBeanstalkApplicationTagsUpdate properties, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = updateWithResponseAsync(resourceGroupName, name, properties, context); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), ElasticBeanstalkApplicationInner.class, + ElasticBeanstalkApplicationInner.class, context); + } + + /** + * Update a ElasticBeanstalkApplication. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ElasticBeanstalkApplication. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ElasticBeanstalkApplicationInner> + beginUpdate(String resourceGroupName, String name, ElasticBeanstalkApplicationTagsUpdate properties) { + return this.beginUpdateAsync(resourceGroupName, name, properties).getSyncPoller(); + } + + /** + * Update a ElasticBeanstalkApplication. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ElasticBeanstalkApplication. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ElasticBeanstalkApplicationInner> beginUpdate( + String resourceGroupName, String name, ElasticBeanstalkApplicationTagsUpdate properties, Context context) { + return this.beginUpdateAsync(resourceGroupName, name, properties, context).getSyncPoller(); + } + + /** + * Update a ElasticBeanstalkApplication. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ElasticBeanstalkApplication. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync(String resourceGroupName, String name, + ElasticBeanstalkApplicationTagsUpdate properties) { + return beginUpdateAsync(resourceGroupName, name, properties).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Update a ElasticBeanstalkApplication. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ElasticBeanstalkApplication. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync(String resourceGroupName, String name, + ElasticBeanstalkApplicationTagsUpdate properties, Context context) { + return beginUpdateAsync(resourceGroupName, name, properties, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Update a ElasticBeanstalkApplication. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ElasticBeanstalkApplication. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ElasticBeanstalkApplicationInner update(String resourceGroupName, String name, + ElasticBeanstalkApplicationTagsUpdate properties) { + return updateAsync(resourceGroupName, name, properties).block(); + } + + /** + * Update a ElasticBeanstalkApplication. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ElasticBeanstalkApplication. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ElasticBeanstalkApplicationInner update(String resourceGroupName, String name, + ElasticBeanstalkApplicationTagsUpdate properties, Context context) { + return updateAsync(resourceGroupName, name, properties, context).block(); + } + + /** + * Delete a ElasticBeanstalkApplication. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ElasticBeanstalkApplication. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync(String resourceGroupName, String name) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Delete a ElasticBeanstalkApplication. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ElasticBeanstalkApplication. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync(String resourceGroupName, String name, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.delete(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, name, accept, context); + } + + /** + * Delete a ElasticBeanstalkApplication. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ElasticBeanstalkApplication. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String name) { + Mono>> mono = deleteWithResponseAsync(resourceGroupName, name); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); + } + + /** + * Delete a ElasticBeanstalkApplication. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ElasticBeanstalkApplication. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String name, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = deleteWithResponseAsync(resourceGroupName, name, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + context); + } + + /** + * Delete a ElasticBeanstalkApplication. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ElasticBeanstalkApplication. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String name) { + return this.beginDeleteAsync(resourceGroupName, name).getSyncPoller(); + } + + /** + * Delete a ElasticBeanstalkApplication. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ElasticBeanstalkApplication. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String name, Context context) { + return this.beginDeleteAsync(resourceGroupName, name, context).getSyncPoller(); + } + + /** + * Delete a ElasticBeanstalkApplication. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ElasticBeanstalkApplication. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String name) { + return beginDeleteAsync(resourceGroupName, name).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete a ElasticBeanstalkApplication. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ElasticBeanstalkApplication. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String name, Context context) { + return beginDeleteAsync(resourceGroupName, name, context).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete a ElasticBeanstalkApplication. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ElasticBeanstalkApplication. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String name) { + deleteAsync(resourceGroupName, name).block(); + } + + /** + * Delete a ElasticBeanstalkApplication. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ElasticBeanstalkApplication. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String name, Context context) { + deleteAsync(resourceGroupName, name, context).block(); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a ElasticBeanstalkApplication list operation along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> + listBySubscriptionNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a ElasticBeanstalkApplication list operation along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listBySubscriptionNextSinglePageAsync(String nextLink, + Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a ElasticBeanstalkApplication list operation along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> + listByResourceGroupNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a ElasticBeanstalkApplication list operation along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> + listByResourceGroupNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/ElasticBeanstalkApplicationsImpl.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/ElasticBeanstalkApplicationsImpl.java new file mode 100644 index 000000000000..ff0b3bb9e510 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/ElasticBeanstalkApplicationsImpl.java @@ -0,0 +1,152 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.awsconnector.fluent.ElasticBeanstalkApplicationsClient; +import com.azure.resourcemanager.awsconnector.fluent.models.ElasticBeanstalkApplicationInner; +import com.azure.resourcemanager.awsconnector.models.ElasticBeanstalkApplication; +import com.azure.resourcemanager.awsconnector.models.ElasticBeanstalkApplications; + +public final class ElasticBeanstalkApplicationsImpl implements ElasticBeanstalkApplications { + private static final ClientLogger LOGGER = new ClientLogger(ElasticBeanstalkApplicationsImpl.class); + + private final ElasticBeanstalkApplicationsClient innerClient; + + private final com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager; + + public ElasticBeanstalkApplicationsImpl(ElasticBeanstalkApplicationsClient innerClient, + com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return ResourceManagerUtils.mapPage(inner, + inner1 -> new ElasticBeanstalkApplicationImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return ResourceManagerUtils.mapPage(inner, + inner1 -> new ElasticBeanstalkApplicationImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName) { + PagedIterable inner + = this.serviceClient().listByResourceGroup(resourceGroupName); + return ResourceManagerUtils.mapPage(inner, + inner1 -> new ElasticBeanstalkApplicationImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + PagedIterable inner + = this.serviceClient().listByResourceGroup(resourceGroupName, context); + return ResourceManagerUtils.mapPage(inner, + inner1 -> new ElasticBeanstalkApplicationImpl(inner1, this.manager())); + } + + public Response getByResourceGroupWithResponse(String resourceGroupName, String name, + Context context) { + Response inner + = this.serviceClient().getByResourceGroupWithResponse(resourceGroupName, name, context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new ElasticBeanstalkApplicationImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public ElasticBeanstalkApplication getByResourceGroup(String resourceGroupName, String name) { + ElasticBeanstalkApplicationInner inner = this.serviceClient().getByResourceGroup(resourceGroupName, name); + if (inner != null) { + return new ElasticBeanstalkApplicationImpl(inner, this.manager()); + } else { + return null; + } + } + + public void deleteByResourceGroup(String resourceGroupName, String name) { + this.serviceClient().delete(resourceGroupName, name); + } + + public void delete(String resourceGroupName, String name, Context context) { + this.serviceClient().delete(resourceGroupName, name, context); + } + + public ElasticBeanstalkApplication getById(String id) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String name = ResourceManagerUtils.getValueFromIdByName(id, "elasticBeanstalkApplications"); + if (name == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException(String.format( + "The resource ID '%s' is not valid. Missing path segment 'elasticBeanstalkApplications'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, name, Context.NONE).getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String name = ResourceManagerUtils.getValueFromIdByName(id, "elasticBeanstalkApplications"); + if (name == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException(String.format( + "The resource ID '%s' is not valid. Missing path segment 'elasticBeanstalkApplications'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, name, context); + } + + public void deleteById(String id) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String name = ResourceManagerUtils.getValueFromIdByName(id, "elasticBeanstalkApplications"); + if (name == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException(String.format( + "The resource ID '%s' is not valid. Missing path segment 'elasticBeanstalkApplications'.", id))); + } + this.delete(resourceGroupName, name, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String name = ResourceManagerUtils.getValueFromIdByName(id, "elasticBeanstalkApplications"); + if (name == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException(String.format( + "The resource ID '%s' is not valid. Missing path segment 'elasticBeanstalkApplications'.", id))); + } + this.delete(resourceGroupName, name, context); + } + + private ElasticBeanstalkApplicationsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.awsconnector.AwsconnectorManager manager() { + return this.serviceManager; + } + + public ElasticBeanstalkApplicationImpl define(String name) { + return new ElasticBeanstalkApplicationImpl(name, this.manager()); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/ElasticBeanstalkConfigurationTemplateImpl.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/ElasticBeanstalkConfigurationTemplateImpl.java new file mode 100644 index 000000000000..96be45bd4ff6 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/ElasticBeanstalkConfigurationTemplateImpl.java @@ -0,0 +1,181 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.implementation; + +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.awsconnector.fluent.models.ElasticBeanstalkConfigurationTemplateInner; +import com.azure.resourcemanager.awsconnector.models.ElasticBeanstalkConfigurationTemplate; +import com.azure.resourcemanager.awsconnector.models.ElasticBeanstalkConfigurationTemplateProperties; +import com.azure.resourcemanager.awsconnector.models.ElasticBeanstalkConfigurationTemplateTagsUpdate; +import java.util.Collections; +import java.util.Map; + +public final class ElasticBeanstalkConfigurationTemplateImpl implements ElasticBeanstalkConfigurationTemplate, + ElasticBeanstalkConfigurationTemplate.Definition, ElasticBeanstalkConfigurationTemplate.Update { + private ElasticBeanstalkConfigurationTemplateInner innerObject; + + private final com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public String location() { + return this.innerModel().location(); + } + + public Map tags() { + Map inner = this.innerModel().tags(); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } + } + + public ElasticBeanstalkConfigurationTemplateProperties properties() { + return this.innerModel().properties(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public String resourceGroupName() { + return resourceGroupName; + } + + public ElasticBeanstalkConfigurationTemplateInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.awsconnector.AwsconnectorManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String name; + + private ElasticBeanstalkConfigurationTemplateTagsUpdate updateProperties; + + public ElasticBeanstalkConfigurationTemplateImpl withExistingResourceGroup(String resourceGroupName) { + this.resourceGroupName = resourceGroupName; + return this; + } + + public ElasticBeanstalkConfigurationTemplate create() { + this.innerObject = serviceManager.serviceClient() + .getElasticBeanstalkConfigurationTemplates() + .createOrReplace(resourceGroupName, name, this.innerModel(), Context.NONE); + return this; + } + + public ElasticBeanstalkConfigurationTemplate create(Context context) { + this.innerObject = serviceManager.serviceClient() + .getElasticBeanstalkConfigurationTemplates() + .createOrReplace(resourceGroupName, name, this.innerModel(), context); + return this; + } + + ElasticBeanstalkConfigurationTemplateImpl(String name, + com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager) { + this.innerObject = new ElasticBeanstalkConfigurationTemplateInner(); + this.serviceManager = serviceManager; + this.name = name; + } + + public ElasticBeanstalkConfigurationTemplateImpl update() { + this.updateProperties = new ElasticBeanstalkConfigurationTemplateTagsUpdate(); + return this; + } + + public ElasticBeanstalkConfigurationTemplate apply() { + this.innerObject = serviceManager.serviceClient() + .getElasticBeanstalkConfigurationTemplates() + .update(resourceGroupName, name, updateProperties, Context.NONE); + return this; + } + + public ElasticBeanstalkConfigurationTemplate apply(Context context) { + this.innerObject = serviceManager.serviceClient() + .getElasticBeanstalkConfigurationTemplates() + .update(resourceGroupName, name, updateProperties, context); + return this; + } + + ElasticBeanstalkConfigurationTemplateImpl(ElasticBeanstalkConfigurationTemplateInner innerObject, + com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.name + = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "elasticBeanstalkConfigurationTemplates"); + } + + public ElasticBeanstalkConfigurationTemplate refresh() { + this.innerObject = serviceManager.serviceClient() + .getElasticBeanstalkConfigurationTemplates() + .getByResourceGroupWithResponse(resourceGroupName, name, Context.NONE) + .getValue(); + return this; + } + + public ElasticBeanstalkConfigurationTemplate refresh(Context context) { + this.innerObject = serviceManager.serviceClient() + .getElasticBeanstalkConfigurationTemplates() + .getByResourceGroupWithResponse(resourceGroupName, name, context) + .getValue(); + return this; + } + + public ElasticBeanstalkConfigurationTemplateImpl withRegion(Region location) { + this.innerModel().withLocation(location.toString()); + return this; + } + + public ElasticBeanstalkConfigurationTemplateImpl withRegion(String location) { + this.innerModel().withLocation(location); + return this; + } + + public ElasticBeanstalkConfigurationTemplateImpl withTags(Map tags) { + if (isInCreateMode()) { + this.innerModel().withTags(tags); + return this; + } else { + this.updateProperties.withTags(tags); + return this; + } + } + + public ElasticBeanstalkConfigurationTemplateImpl + withProperties(ElasticBeanstalkConfigurationTemplateProperties properties) { + this.innerModel().withProperties(properties); + return this; + } + + private boolean isInCreateMode() { + return this.innerModel().id() == null; + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/ElasticBeanstalkConfigurationTemplatesClientImpl.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/ElasticBeanstalkConfigurationTemplatesClientImpl.java new file mode 100644 index 000000000000..29c3c5e34209 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/ElasticBeanstalkConfigurationTemplatesClientImpl.java @@ -0,0 +1,1327 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.Patch; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.awsconnector.fluent.ElasticBeanstalkConfigurationTemplatesClient; +import com.azure.resourcemanager.awsconnector.fluent.models.ElasticBeanstalkConfigurationTemplateInner; +import com.azure.resourcemanager.awsconnector.models.ElasticBeanstalkConfigurationTemplateListResult; +import com.azure.resourcemanager.awsconnector.models.ElasticBeanstalkConfigurationTemplateTagsUpdate; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in + * ElasticBeanstalkConfigurationTemplatesClient. + */ +public final class ElasticBeanstalkConfigurationTemplatesClientImpl + implements ElasticBeanstalkConfigurationTemplatesClient { + /** + * The proxy service used to perform REST calls. + */ + private final ElasticBeanstalkConfigurationTemplatesService service; + + /** + * The service client containing this operation class. + */ + private final MicrosoftAwsConnectorImpl client; + + /** + * Initializes an instance of ElasticBeanstalkConfigurationTemplatesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + ElasticBeanstalkConfigurationTemplatesClientImpl(MicrosoftAwsConnectorImpl client) { + this.service = RestProxy.create(ElasticBeanstalkConfigurationTemplatesService.class, client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for MicrosoftAwsConnectorElasticBeanstalkConfigurationTemplates to be + * used by the proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "MicrosoftAwsConnecto") + public interface ElasticBeanstalkConfigurationTemplatesService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.AwsConnector/elasticBeanstalkConfigurationTemplates") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/elasticBeanstalkConfigurationTemplates") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroup( + @HostParam("$host") String endpoint, @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/elasticBeanstalkConfigurationTemplates/{name}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getByResourceGroup( + @HostParam("$host") String endpoint, @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("name") String name, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/elasticBeanstalkConfigurationTemplates/{name}") + @ExpectedResponses({ 200, 201 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrReplace(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("name") String name, + @BodyParam("application/json") ElasticBeanstalkConfigurationTemplateInner resource, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/elasticBeanstalkConfigurationTemplates/{name}") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> update(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("name") String name, + @BodyParam("application/json") ElasticBeanstalkConfigurationTemplateTagsUpdate properties, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/elasticBeanstalkConfigurationTemplates/{name}") + @ExpectedResponses({ 202, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("name") String name, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listBySubscriptionNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroupNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); + } + + /** + * List ElasticBeanstalkConfigurationTemplate resources by subscription ID. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a ElasticBeanstalkConfigurationTemplate list operation along with {@link PagedResponse} + * on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync() { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), accept, context)) + .>map( + res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List ElasticBeanstalkConfigurationTemplate resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a ElasticBeanstalkConfigurationTemplate list operation along with {@link PagedResponse} + * on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), accept, + context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * List ElasticBeanstalkConfigurationTemplate resources by subscription ID. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a ElasticBeanstalkConfigurationTemplate list operation as paginated response with + * {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>(() -> listSinglePageAsync(), + nextLink -> listBySubscriptionNextSinglePageAsync(nextLink)); + } + + /** + * List ElasticBeanstalkConfigurationTemplate resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a ElasticBeanstalkConfigurationTemplate list operation as paginated response with + * {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(Context context) { + return new PagedFlux<>(() -> listSinglePageAsync(context), + nextLink -> listBySubscriptionNextSinglePageAsync(nextLink, context)); + } + + /** + * List ElasticBeanstalkConfigurationTemplate resources by subscription ID. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a ElasticBeanstalkConfigurationTemplate list operation as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + return new PagedIterable<>(listAsync()); + } + + /** + * List ElasticBeanstalkConfigurationTemplate resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a ElasticBeanstalkConfigurationTemplate list operation as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Context context) { + return new PagedIterable<>(listAsync(context)); + } + + /** + * List ElasticBeanstalkConfigurationTemplate resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a ElasticBeanstalkConfigurationTemplate list operation along with {@link PagedResponse} + * on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> + listByResourceGroupSinglePageAsync(String resourceGroupName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accept, context)) + .>map( + res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List ElasticBeanstalkConfigurationTemplate resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a ElasticBeanstalkConfigurationTemplate list operation along with {@link PagedResponse} + * on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> + listByResourceGroupSinglePageAsync(String resourceGroupName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * List ElasticBeanstalkConfigurationTemplate resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a ElasticBeanstalkConfigurationTemplate list operation as paginated response with + * {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName) { + return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); + } + + /** + * List ElasticBeanstalkConfigurationTemplate resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a ElasticBeanstalkConfigurationTemplate list operation as paginated response with + * {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName, + Context context) { + return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName, context), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink, context)); + } + + /** + * List ElasticBeanstalkConfigurationTemplate resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a ElasticBeanstalkConfigurationTemplate list operation as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName)); + } + + /** + * List ElasticBeanstalkConfigurationTemplate resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a ElasticBeanstalkConfigurationTemplate list operation as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName, + Context context) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, context)); + } + + /** + * Get a ElasticBeanstalkConfigurationTemplate. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ElasticBeanstalkConfigurationTemplate. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a ElasticBeanstalkConfigurationTemplate along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> + getByResourceGroupWithResponseAsync(String resourceGroupName, String name) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.getByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get a ElasticBeanstalkConfigurationTemplate. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ElasticBeanstalkConfigurationTemplate. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a ElasticBeanstalkConfigurationTemplate along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> + getByResourceGroupWithResponseAsync(String resourceGroupName, String name, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.getByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, accept, context); + } + + /** + * Get a ElasticBeanstalkConfigurationTemplate. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ElasticBeanstalkConfigurationTemplate. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a ElasticBeanstalkConfigurationTemplate on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getByResourceGroupAsync(String resourceGroupName, + String name) { + return getByResourceGroupWithResponseAsync(resourceGroupName, name) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Get a ElasticBeanstalkConfigurationTemplate. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ElasticBeanstalkConfigurationTemplate. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a ElasticBeanstalkConfigurationTemplate along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getByResourceGroupWithResponse(String resourceGroupName, + String name, Context context) { + return getByResourceGroupWithResponseAsync(resourceGroupName, name, context).block(); + } + + /** + * Get a ElasticBeanstalkConfigurationTemplate. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ElasticBeanstalkConfigurationTemplate. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a ElasticBeanstalkConfigurationTemplate. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ElasticBeanstalkConfigurationTemplateInner getByResourceGroup(String resourceGroupName, String name) { + return getByResourceGroupWithResponse(resourceGroupName, name, Context.NONE).getValue(); + } + + /** + * Create a ElasticBeanstalkConfigurationTemplate. Please note that end user resource creation is currently + * restricted, but it will be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ElasticBeanstalkConfigurationTemplate. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrReplaceWithResponseAsync(String resourceGroupName, String name, + ElasticBeanstalkConfigurationTemplateInner resource) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (resource == null) { + return Mono.error(new IllegalArgumentException("Parameter resource is required and cannot be null.")); + } else { + resource.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.createOrReplace(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, resource, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Create a ElasticBeanstalkConfigurationTemplate. Please note that end user resource creation is currently + * restricted, but it will be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ElasticBeanstalkConfigurationTemplate. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrReplaceWithResponseAsync(String resourceGroupName, String name, + ElasticBeanstalkConfigurationTemplateInner resource, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (resource == null) { + return Mono.error(new IllegalArgumentException("Parameter resource is required and cannot be null.")); + } else { + resource.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.createOrReplace(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, resource, accept, context); + } + + /** + * Create a ElasticBeanstalkConfigurationTemplate. Please note that end user resource creation is currently + * restricted, but it will be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ElasticBeanstalkConfigurationTemplate. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private + PollerFlux, ElasticBeanstalkConfigurationTemplateInner> + beginCreateOrReplaceAsync(String resourceGroupName, String name, + ElasticBeanstalkConfigurationTemplateInner resource) { + Mono>> mono = createOrReplaceWithResponseAsync(resourceGroupName, name, resource); + return this.client + .getLroResult(mono, + this.client.getHttpPipeline(), ElasticBeanstalkConfigurationTemplateInner.class, + ElasticBeanstalkConfigurationTemplateInner.class, this.client.getContext()); + } + + /** + * Create a ElasticBeanstalkConfigurationTemplate. Please note that end user resource creation is currently + * restricted, but it will be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ElasticBeanstalkConfigurationTemplate. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private + PollerFlux, ElasticBeanstalkConfigurationTemplateInner> + beginCreateOrReplaceAsync(String resourceGroupName, String name, + ElasticBeanstalkConfigurationTemplateInner resource, Context context) { + context = this.client.mergeContext(context); + Mono>> mono + = createOrReplaceWithResponseAsync(resourceGroupName, name, resource, context); + return this.client + .getLroResult(mono, + this.client.getHttpPipeline(), ElasticBeanstalkConfigurationTemplateInner.class, + ElasticBeanstalkConfigurationTemplateInner.class, context); + } + + /** + * Create a ElasticBeanstalkConfigurationTemplate. Please note that end user resource creation is currently + * restricted, but it will be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ElasticBeanstalkConfigurationTemplate. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public + SyncPoller, ElasticBeanstalkConfigurationTemplateInner> + beginCreateOrReplace(String resourceGroupName, String name, + ElasticBeanstalkConfigurationTemplateInner resource) { + return this.beginCreateOrReplaceAsync(resourceGroupName, name, resource).getSyncPoller(); + } + + /** + * Create a ElasticBeanstalkConfigurationTemplate. Please note that end user resource creation is currently + * restricted, but it will be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ElasticBeanstalkConfigurationTemplate. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public + SyncPoller, ElasticBeanstalkConfigurationTemplateInner> + beginCreateOrReplace(String resourceGroupName, String name, ElasticBeanstalkConfigurationTemplateInner resource, + Context context) { + return this.beginCreateOrReplaceAsync(resourceGroupName, name, resource, context).getSyncPoller(); + } + + /** + * Create a ElasticBeanstalkConfigurationTemplate. Please note that end user resource creation is currently + * restricted, but it will be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ElasticBeanstalkConfigurationTemplate. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrReplaceAsync(String resourceGroupName, String name, + ElasticBeanstalkConfigurationTemplateInner resource) { + return beginCreateOrReplaceAsync(resourceGroupName, name, resource).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create a ElasticBeanstalkConfigurationTemplate. Please note that end user resource creation is currently + * restricted, but it will be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ElasticBeanstalkConfigurationTemplate. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrReplaceAsync(String resourceGroupName, String name, + ElasticBeanstalkConfigurationTemplateInner resource, Context context) { + return beginCreateOrReplaceAsync(resourceGroupName, name, resource, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create a ElasticBeanstalkConfigurationTemplate. Please note that end user resource creation is currently + * restricted, but it will be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ElasticBeanstalkConfigurationTemplate. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ElasticBeanstalkConfigurationTemplateInner createOrReplace(String resourceGroupName, String name, + ElasticBeanstalkConfigurationTemplateInner resource) { + return createOrReplaceAsync(resourceGroupName, name, resource).block(); + } + + /** + * Create a ElasticBeanstalkConfigurationTemplate. Please note that end user resource creation is currently + * restricted, but it will be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ElasticBeanstalkConfigurationTemplate. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ElasticBeanstalkConfigurationTemplateInner createOrReplace(String resourceGroupName, String name, + ElasticBeanstalkConfigurationTemplateInner resource, Context context) { + return createOrReplaceAsync(resourceGroupName, name, resource, context).block(); + } + + /** + * Update a ElasticBeanstalkConfigurationTemplate. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ElasticBeanstalkConfigurationTemplate. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync(String resourceGroupName, String name, + ElasticBeanstalkConfigurationTemplateTagsUpdate properties) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (properties == null) { + return Mono.error(new IllegalArgumentException("Parameter properties is required and cannot be null.")); + } else { + properties.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.update(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, properties, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Update a ElasticBeanstalkConfigurationTemplate. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ElasticBeanstalkConfigurationTemplate. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync(String resourceGroupName, String name, + ElasticBeanstalkConfigurationTemplateTagsUpdate properties, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (properties == null) { + return Mono.error(new IllegalArgumentException("Parameter properties is required and cannot be null.")); + } else { + properties.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.update(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, name, properties, accept, context); + } + + /** + * Update a ElasticBeanstalkConfigurationTemplate. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ElasticBeanstalkConfigurationTemplate. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private + PollerFlux, ElasticBeanstalkConfigurationTemplateInner> + beginUpdateAsync(String resourceGroupName, String name, + ElasticBeanstalkConfigurationTemplateTagsUpdate properties) { + Mono>> mono = updateWithResponseAsync(resourceGroupName, name, properties); + return this.client + .getLroResult(mono, + this.client.getHttpPipeline(), ElasticBeanstalkConfigurationTemplateInner.class, + ElasticBeanstalkConfigurationTemplateInner.class, this.client.getContext()); + } + + /** + * Update a ElasticBeanstalkConfigurationTemplate. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ElasticBeanstalkConfigurationTemplate. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private + PollerFlux, ElasticBeanstalkConfigurationTemplateInner> + beginUpdateAsync(String resourceGroupName, String name, + ElasticBeanstalkConfigurationTemplateTagsUpdate properties, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = updateWithResponseAsync(resourceGroupName, name, properties, context); + return this.client + .getLroResult(mono, + this.client.getHttpPipeline(), ElasticBeanstalkConfigurationTemplateInner.class, + ElasticBeanstalkConfigurationTemplateInner.class, context); + } + + /** + * Update a ElasticBeanstalkConfigurationTemplate. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ElasticBeanstalkConfigurationTemplate. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public + SyncPoller, ElasticBeanstalkConfigurationTemplateInner> + beginUpdate(String resourceGroupName, String name, ElasticBeanstalkConfigurationTemplateTagsUpdate properties) { + return this.beginUpdateAsync(resourceGroupName, name, properties).getSyncPoller(); + } + + /** + * Update a ElasticBeanstalkConfigurationTemplate. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ElasticBeanstalkConfigurationTemplate. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public + SyncPoller, ElasticBeanstalkConfigurationTemplateInner> + beginUpdate(String resourceGroupName, String name, ElasticBeanstalkConfigurationTemplateTagsUpdate properties, + Context context) { + return this.beginUpdateAsync(resourceGroupName, name, properties, context).getSyncPoller(); + } + + /** + * Update a ElasticBeanstalkConfigurationTemplate. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ElasticBeanstalkConfigurationTemplate. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync(String resourceGroupName, String name, + ElasticBeanstalkConfigurationTemplateTagsUpdate properties) { + return beginUpdateAsync(resourceGroupName, name, properties).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Update a ElasticBeanstalkConfigurationTemplate. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ElasticBeanstalkConfigurationTemplate. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync(String resourceGroupName, String name, + ElasticBeanstalkConfigurationTemplateTagsUpdate properties, Context context) { + return beginUpdateAsync(resourceGroupName, name, properties, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Update a ElasticBeanstalkConfigurationTemplate. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ElasticBeanstalkConfigurationTemplate. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ElasticBeanstalkConfigurationTemplateInner update(String resourceGroupName, String name, + ElasticBeanstalkConfigurationTemplateTagsUpdate properties) { + return updateAsync(resourceGroupName, name, properties).block(); + } + + /** + * Update a ElasticBeanstalkConfigurationTemplate. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ElasticBeanstalkConfigurationTemplate. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ElasticBeanstalkConfigurationTemplateInner update(String resourceGroupName, String name, + ElasticBeanstalkConfigurationTemplateTagsUpdate properties, Context context) { + return updateAsync(resourceGroupName, name, properties, context).block(); + } + + /** + * Delete a ElasticBeanstalkConfigurationTemplate. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ElasticBeanstalkConfigurationTemplate. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync(String resourceGroupName, String name) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Delete a ElasticBeanstalkConfigurationTemplate. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ElasticBeanstalkConfigurationTemplate. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync(String resourceGroupName, String name, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.delete(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, name, accept, context); + } + + /** + * Delete a ElasticBeanstalkConfigurationTemplate. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ElasticBeanstalkConfigurationTemplate. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String name) { + Mono>> mono = deleteWithResponseAsync(resourceGroupName, name); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); + } + + /** + * Delete a ElasticBeanstalkConfigurationTemplate. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ElasticBeanstalkConfigurationTemplate. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String name, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = deleteWithResponseAsync(resourceGroupName, name, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + context); + } + + /** + * Delete a ElasticBeanstalkConfigurationTemplate. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ElasticBeanstalkConfigurationTemplate. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String name) { + return this.beginDeleteAsync(resourceGroupName, name).getSyncPoller(); + } + + /** + * Delete a ElasticBeanstalkConfigurationTemplate. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ElasticBeanstalkConfigurationTemplate. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String name, Context context) { + return this.beginDeleteAsync(resourceGroupName, name, context).getSyncPoller(); + } + + /** + * Delete a ElasticBeanstalkConfigurationTemplate. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ElasticBeanstalkConfigurationTemplate. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String name) { + return beginDeleteAsync(resourceGroupName, name).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete a ElasticBeanstalkConfigurationTemplate. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ElasticBeanstalkConfigurationTemplate. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String name, Context context) { + return beginDeleteAsync(resourceGroupName, name, context).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete a ElasticBeanstalkConfigurationTemplate. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ElasticBeanstalkConfigurationTemplate. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String name) { + deleteAsync(resourceGroupName, name).block(); + } + + /** + * Delete a ElasticBeanstalkConfigurationTemplate. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ElasticBeanstalkConfigurationTemplate. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String name, Context context) { + deleteAsync(resourceGroupName, name, context).block(); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a ElasticBeanstalkConfigurationTemplate list operation along with {@link PagedResponse} + * on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> + listBySubscriptionNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a ElasticBeanstalkConfigurationTemplate list operation along with {@link PagedResponse} + * on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> + listBySubscriptionNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a ElasticBeanstalkConfigurationTemplate list operation along with {@link PagedResponse} + * on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> + listByResourceGroupNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a ElasticBeanstalkConfigurationTemplate list operation along with {@link PagedResponse} + * on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> + listByResourceGroupNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/ElasticBeanstalkConfigurationTemplatesImpl.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/ElasticBeanstalkConfigurationTemplatesImpl.java new file mode 100644 index 000000000000..21dab20b3ac3 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/ElasticBeanstalkConfigurationTemplatesImpl.java @@ -0,0 +1,158 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.awsconnector.fluent.ElasticBeanstalkConfigurationTemplatesClient; +import com.azure.resourcemanager.awsconnector.fluent.models.ElasticBeanstalkConfigurationTemplateInner; +import com.azure.resourcemanager.awsconnector.models.ElasticBeanstalkConfigurationTemplate; +import com.azure.resourcemanager.awsconnector.models.ElasticBeanstalkConfigurationTemplates; + +public final class ElasticBeanstalkConfigurationTemplatesImpl implements ElasticBeanstalkConfigurationTemplates { + private static final ClientLogger LOGGER = new ClientLogger(ElasticBeanstalkConfigurationTemplatesImpl.class); + + private final ElasticBeanstalkConfigurationTemplatesClient innerClient; + + private final com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager; + + public ElasticBeanstalkConfigurationTemplatesImpl(ElasticBeanstalkConfigurationTemplatesClient innerClient, + com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return ResourceManagerUtils.mapPage(inner, + inner1 -> new ElasticBeanstalkConfigurationTemplateImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return ResourceManagerUtils.mapPage(inner, + inner1 -> new ElasticBeanstalkConfigurationTemplateImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName) { + PagedIterable inner + = this.serviceClient().listByResourceGroup(resourceGroupName); + return ResourceManagerUtils.mapPage(inner, + inner1 -> new ElasticBeanstalkConfigurationTemplateImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName, + Context context) { + PagedIterable inner + = this.serviceClient().listByResourceGroup(resourceGroupName, context); + return ResourceManagerUtils.mapPage(inner, + inner1 -> new ElasticBeanstalkConfigurationTemplateImpl(inner1, this.manager())); + } + + public Response getByResourceGroupWithResponse(String resourceGroupName, + String name, Context context) { + Response inner + = this.serviceClient().getByResourceGroupWithResponse(resourceGroupName, name, context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new ElasticBeanstalkConfigurationTemplateImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public ElasticBeanstalkConfigurationTemplate getByResourceGroup(String resourceGroupName, String name) { + ElasticBeanstalkConfigurationTemplateInner inner + = this.serviceClient().getByResourceGroup(resourceGroupName, name); + if (inner != null) { + return new ElasticBeanstalkConfigurationTemplateImpl(inner, this.manager()); + } else { + return null; + } + } + + public void deleteByResourceGroup(String resourceGroupName, String name) { + this.serviceClient().delete(resourceGroupName, name); + } + + public void delete(String resourceGroupName, String name, Context context) { + this.serviceClient().delete(resourceGroupName, name, context); + } + + public ElasticBeanstalkConfigurationTemplate getById(String id) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String name = ResourceManagerUtils.getValueFromIdByName(id, "elasticBeanstalkConfigurationTemplates"); + if (name == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException(String.format( + "The resource ID '%s' is not valid. Missing path segment 'elasticBeanstalkConfigurationTemplates'.", + id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, name, Context.NONE).getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String name = ResourceManagerUtils.getValueFromIdByName(id, "elasticBeanstalkConfigurationTemplates"); + if (name == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException(String.format( + "The resource ID '%s' is not valid. Missing path segment 'elasticBeanstalkConfigurationTemplates'.", + id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, name, context); + } + + public void deleteById(String id) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String name = ResourceManagerUtils.getValueFromIdByName(id, "elasticBeanstalkConfigurationTemplates"); + if (name == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException(String.format( + "The resource ID '%s' is not valid. Missing path segment 'elasticBeanstalkConfigurationTemplates'.", + id))); + } + this.delete(resourceGroupName, name, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String name = ResourceManagerUtils.getValueFromIdByName(id, "elasticBeanstalkConfigurationTemplates"); + if (name == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException(String.format( + "The resource ID '%s' is not valid. Missing path segment 'elasticBeanstalkConfigurationTemplates'.", + id))); + } + this.delete(resourceGroupName, name, context); + } + + private ElasticBeanstalkConfigurationTemplatesClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.awsconnector.AwsconnectorManager manager() { + return this.serviceManager; + } + + public ElasticBeanstalkConfigurationTemplateImpl define(String name) { + return new ElasticBeanstalkConfigurationTemplateImpl(name, this.manager()); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/ElasticBeanstalkEnvironmentImpl.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/ElasticBeanstalkEnvironmentImpl.java new file mode 100644 index 000000000000..9cc07db0d097 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/ElasticBeanstalkEnvironmentImpl.java @@ -0,0 +1,179 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.implementation; + +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.awsconnector.fluent.models.ElasticBeanstalkEnvironmentInner; +import com.azure.resourcemanager.awsconnector.models.ElasticBeanstalkEnvironment; +import com.azure.resourcemanager.awsconnector.models.ElasticBeanstalkEnvironmentProperties; +import com.azure.resourcemanager.awsconnector.models.ElasticBeanstalkEnvironmentTagsUpdate; +import java.util.Collections; +import java.util.Map; + +public final class ElasticBeanstalkEnvironmentImpl + implements ElasticBeanstalkEnvironment, ElasticBeanstalkEnvironment.Definition, ElasticBeanstalkEnvironment.Update { + private ElasticBeanstalkEnvironmentInner innerObject; + + private final com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public String location() { + return this.innerModel().location(); + } + + public Map tags() { + Map inner = this.innerModel().tags(); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } + } + + public ElasticBeanstalkEnvironmentProperties properties() { + return this.innerModel().properties(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public String resourceGroupName() { + return resourceGroupName; + } + + public ElasticBeanstalkEnvironmentInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.awsconnector.AwsconnectorManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String name; + + private ElasticBeanstalkEnvironmentTagsUpdate updateProperties; + + public ElasticBeanstalkEnvironmentImpl withExistingResourceGroup(String resourceGroupName) { + this.resourceGroupName = resourceGroupName; + return this; + } + + public ElasticBeanstalkEnvironment create() { + this.innerObject = serviceManager.serviceClient() + .getElasticBeanstalkEnvironments() + .createOrReplace(resourceGroupName, name, this.innerModel(), Context.NONE); + return this; + } + + public ElasticBeanstalkEnvironment create(Context context) { + this.innerObject = serviceManager.serviceClient() + .getElasticBeanstalkEnvironments() + .createOrReplace(resourceGroupName, name, this.innerModel(), context); + return this; + } + + ElasticBeanstalkEnvironmentImpl(String name, + com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager) { + this.innerObject = new ElasticBeanstalkEnvironmentInner(); + this.serviceManager = serviceManager; + this.name = name; + } + + public ElasticBeanstalkEnvironmentImpl update() { + this.updateProperties = new ElasticBeanstalkEnvironmentTagsUpdate(); + return this; + } + + public ElasticBeanstalkEnvironment apply() { + this.innerObject = serviceManager.serviceClient() + .getElasticBeanstalkEnvironments() + .update(resourceGroupName, name, updateProperties, Context.NONE); + return this; + } + + public ElasticBeanstalkEnvironment apply(Context context) { + this.innerObject = serviceManager.serviceClient() + .getElasticBeanstalkEnvironments() + .update(resourceGroupName, name, updateProperties, context); + return this; + } + + ElasticBeanstalkEnvironmentImpl(ElasticBeanstalkEnvironmentInner innerObject, + com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.name = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "elasticBeanstalkEnvironments"); + } + + public ElasticBeanstalkEnvironment refresh() { + this.innerObject = serviceManager.serviceClient() + .getElasticBeanstalkEnvironments() + .getByResourceGroupWithResponse(resourceGroupName, name, Context.NONE) + .getValue(); + return this; + } + + public ElasticBeanstalkEnvironment refresh(Context context) { + this.innerObject = serviceManager.serviceClient() + .getElasticBeanstalkEnvironments() + .getByResourceGroupWithResponse(resourceGroupName, name, context) + .getValue(); + return this; + } + + public ElasticBeanstalkEnvironmentImpl withRegion(Region location) { + this.innerModel().withLocation(location.toString()); + return this; + } + + public ElasticBeanstalkEnvironmentImpl withRegion(String location) { + this.innerModel().withLocation(location); + return this; + } + + public ElasticBeanstalkEnvironmentImpl withTags(Map tags) { + if (isInCreateMode()) { + this.innerModel().withTags(tags); + return this; + } else { + this.updateProperties.withTags(tags); + return this; + } + } + + public ElasticBeanstalkEnvironmentImpl withProperties(ElasticBeanstalkEnvironmentProperties properties) { + this.innerModel().withProperties(properties); + return this; + } + + private boolean isInCreateMode() { + return this.innerModel().id() == null; + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/ElasticBeanstalkEnvironmentsClientImpl.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/ElasticBeanstalkEnvironmentsClientImpl.java new file mode 100644 index 000000000000..919c18e2a8c9 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/ElasticBeanstalkEnvironmentsClientImpl.java @@ -0,0 +1,1299 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.Patch; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.awsconnector.fluent.ElasticBeanstalkEnvironmentsClient; +import com.azure.resourcemanager.awsconnector.fluent.models.ElasticBeanstalkEnvironmentInner; +import com.azure.resourcemanager.awsconnector.models.ElasticBeanstalkEnvironmentListResult; +import com.azure.resourcemanager.awsconnector.models.ElasticBeanstalkEnvironmentTagsUpdate; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in ElasticBeanstalkEnvironmentsClient. + */ +public final class ElasticBeanstalkEnvironmentsClientImpl implements ElasticBeanstalkEnvironmentsClient { + /** + * The proxy service used to perform REST calls. + */ + private final ElasticBeanstalkEnvironmentsService service; + + /** + * The service client containing this operation class. + */ + private final MicrosoftAwsConnectorImpl client; + + /** + * Initializes an instance of ElasticBeanstalkEnvironmentsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + ElasticBeanstalkEnvironmentsClientImpl(MicrosoftAwsConnectorImpl client) { + this.service = RestProxy.create(ElasticBeanstalkEnvironmentsService.class, client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for MicrosoftAwsConnectorElasticBeanstalkEnvironments to be used by the + * proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "MicrosoftAwsConnecto") + public interface ElasticBeanstalkEnvironmentsService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.AwsConnector/elasticBeanstalkEnvironments") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/elasticBeanstalkEnvironments") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroup(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/elasticBeanstalkEnvironments/{name}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getByResourceGroup(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("name") String name, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/elasticBeanstalkEnvironments/{name}") + @ExpectedResponses({ 200, 201 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrReplace(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("name") String name, + @BodyParam("application/json") ElasticBeanstalkEnvironmentInner resource, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/elasticBeanstalkEnvironments/{name}") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> update(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("name") String name, + @BodyParam("application/json") ElasticBeanstalkEnvironmentTagsUpdate properties, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/elasticBeanstalkEnvironments/{name}") + @ExpectedResponses({ 202, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("name") String name, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listBySubscriptionNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroupNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); + } + + /** + * List ElasticBeanstalkEnvironment resources by subscription ID. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a ElasticBeanstalkEnvironment list operation along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync() { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List ElasticBeanstalkEnvironment resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a ElasticBeanstalkEnvironment list operation along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), accept, + context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * List ElasticBeanstalkEnvironment resources by subscription ID. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a ElasticBeanstalkEnvironment list operation as paginated response with + * {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>(() -> listSinglePageAsync(), + nextLink -> listBySubscriptionNextSinglePageAsync(nextLink)); + } + + /** + * List ElasticBeanstalkEnvironment resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a ElasticBeanstalkEnvironment list operation as paginated response with + * {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(Context context) { + return new PagedFlux<>(() -> listSinglePageAsync(context), + nextLink -> listBySubscriptionNextSinglePageAsync(nextLink, context)); + } + + /** + * List ElasticBeanstalkEnvironment resources by subscription ID. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a ElasticBeanstalkEnvironment list operation as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + return new PagedIterable<>(listAsync()); + } + + /** + * List ElasticBeanstalkEnvironment resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a ElasticBeanstalkEnvironment list operation as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Context context) { + return new PagedIterable<>(listAsync(context)); + } + + /** + * List ElasticBeanstalkEnvironment resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a ElasticBeanstalkEnvironment list operation along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> + listByResourceGroupSinglePageAsync(String resourceGroupName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List ElasticBeanstalkEnvironment resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a ElasticBeanstalkEnvironment list operation along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> + listByResourceGroupSinglePageAsync(String resourceGroupName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * List ElasticBeanstalkEnvironment resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a ElasticBeanstalkEnvironment list operation as paginated response with + * {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName) { + return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); + } + + /** + * List ElasticBeanstalkEnvironment resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a ElasticBeanstalkEnvironment list operation as paginated response with + * {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName, + Context context) { + return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName, context), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink, context)); + } + + /** + * List ElasticBeanstalkEnvironment resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a ElasticBeanstalkEnvironment list operation as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName)); + } + + /** + * List ElasticBeanstalkEnvironment resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a ElasticBeanstalkEnvironment list operation as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName, + Context context) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, context)); + } + + /** + * Get a ElasticBeanstalkEnvironment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ElasticBeanstalkEnvironment. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a ElasticBeanstalkEnvironment along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> + getByResourceGroupWithResponseAsync(String resourceGroupName, String name) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.getByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get a ElasticBeanstalkEnvironment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ElasticBeanstalkEnvironment. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a ElasticBeanstalkEnvironment along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> + getByResourceGroupWithResponseAsync(String resourceGroupName, String name, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.getByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, accept, context); + } + + /** + * Get a ElasticBeanstalkEnvironment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ElasticBeanstalkEnvironment. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a ElasticBeanstalkEnvironment on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getByResourceGroupAsync(String resourceGroupName, String name) { + return getByResourceGroupWithResponseAsync(resourceGroupName, name) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Get a ElasticBeanstalkEnvironment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ElasticBeanstalkEnvironment. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a ElasticBeanstalkEnvironment along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getByResourceGroupWithResponse(String resourceGroupName, + String name, Context context) { + return getByResourceGroupWithResponseAsync(resourceGroupName, name, context).block(); + } + + /** + * Get a ElasticBeanstalkEnvironment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ElasticBeanstalkEnvironment. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a ElasticBeanstalkEnvironment. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ElasticBeanstalkEnvironmentInner getByResourceGroup(String resourceGroupName, String name) { + return getByResourceGroupWithResponse(resourceGroupName, name, Context.NONE).getValue(); + } + + /** + * Create a ElasticBeanstalkEnvironment. Please note that end user resource creation is currently restricted, but it + * will be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ElasticBeanstalkEnvironment. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrReplaceWithResponseAsync(String resourceGroupName, String name, + ElasticBeanstalkEnvironmentInner resource) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (resource == null) { + return Mono.error(new IllegalArgumentException("Parameter resource is required and cannot be null.")); + } else { + resource.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.createOrReplace(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, resource, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Create a ElasticBeanstalkEnvironment. Please note that end user resource creation is currently restricted, but it + * will be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ElasticBeanstalkEnvironment. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrReplaceWithResponseAsync(String resourceGroupName, String name, + ElasticBeanstalkEnvironmentInner resource, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (resource == null) { + return Mono.error(new IllegalArgumentException("Parameter resource is required and cannot be null.")); + } else { + resource.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.createOrReplace(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, resource, accept, context); + } + + /** + * Create a ElasticBeanstalkEnvironment. Please note that end user resource creation is currently restricted, but it + * will be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ElasticBeanstalkEnvironment. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, ElasticBeanstalkEnvironmentInner> + beginCreateOrReplaceAsync(String resourceGroupName, String name, ElasticBeanstalkEnvironmentInner resource) { + Mono>> mono = createOrReplaceWithResponseAsync(resourceGroupName, name, resource); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), ElasticBeanstalkEnvironmentInner.class, + ElasticBeanstalkEnvironmentInner.class, this.client.getContext()); + } + + /** + * Create a ElasticBeanstalkEnvironment. Please note that end user resource creation is currently restricted, but it + * will be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ElasticBeanstalkEnvironment. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, ElasticBeanstalkEnvironmentInner> + beginCreateOrReplaceAsync(String resourceGroupName, String name, ElasticBeanstalkEnvironmentInner resource, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono + = createOrReplaceWithResponseAsync(resourceGroupName, name, resource, context); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), ElasticBeanstalkEnvironmentInner.class, + ElasticBeanstalkEnvironmentInner.class, context); + } + + /** + * Create a ElasticBeanstalkEnvironment. Please note that end user resource creation is currently restricted, but it + * will be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ElasticBeanstalkEnvironment. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ElasticBeanstalkEnvironmentInner> + beginCreateOrReplace(String resourceGroupName, String name, ElasticBeanstalkEnvironmentInner resource) { + return this.beginCreateOrReplaceAsync(resourceGroupName, name, resource).getSyncPoller(); + } + + /** + * Create a ElasticBeanstalkEnvironment. Please note that end user resource creation is currently restricted, but it + * will be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ElasticBeanstalkEnvironment. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ElasticBeanstalkEnvironmentInner> + beginCreateOrReplace(String resourceGroupName, String name, ElasticBeanstalkEnvironmentInner resource, + Context context) { + return this.beginCreateOrReplaceAsync(resourceGroupName, name, resource, context).getSyncPoller(); + } + + /** + * Create a ElasticBeanstalkEnvironment. Please note that end user resource creation is currently restricted, but it + * will be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ElasticBeanstalkEnvironment. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrReplaceAsync(String resourceGroupName, String name, + ElasticBeanstalkEnvironmentInner resource) { + return beginCreateOrReplaceAsync(resourceGroupName, name, resource).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create a ElasticBeanstalkEnvironment. Please note that end user resource creation is currently restricted, but it + * will be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ElasticBeanstalkEnvironment. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrReplaceAsync(String resourceGroupName, String name, + ElasticBeanstalkEnvironmentInner resource, Context context) { + return beginCreateOrReplaceAsync(resourceGroupName, name, resource, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create a ElasticBeanstalkEnvironment. Please note that end user resource creation is currently restricted, but it + * will be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ElasticBeanstalkEnvironment. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ElasticBeanstalkEnvironmentInner createOrReplace(String resourceGroupName, String name, + ElasticBeanstalkEnvironmentInner resource) { + return createOrReplaceAsync(resourceGroupName, name, resource).block(); + } + + /** + * Create a ElasticBeanstalkEnvironment. Please note that end user resource creation is currently restricted, but it + * will be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ElasticBeanstalkEnvironment. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ElasticBeanstalkEnvironmentInner createOrReplace(String resourceGroupName, String name, + ElasticBeanstalkEnvironmentInner resource, Context context) { + return createOrReplaceAsync(resourceGroupName, name, resource, context).block(); + } + + /** + * Update a ElasticBeanstalkEnvironment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ElasticBeanstalkEnvironment. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync(String resourceGroupName, String name, + ElasticBeanstalkEnvironmentTagsUpdate properties) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (properties == null) { + return Mono.error(new IllegalArgumentException("Parameter properties is required and cannot be null.")); + } else { + properties.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.update(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, properties, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Update a ElasticBeanstalkEnvironment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ElasticBeanstalkEnvironment. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync(String resourceGroupName, String name, + ElasticBeanstalkEnvironmentTagsUpdate properties, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (properties == null) { + return Mono.error(new IllegalArgumentException("Parameter properties is required and cannot be null.")); + } else { + properties.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.update(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, name, properties, accept, context); + } + + /** + * Update a ElasticBeanstalkEnvironment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ElasticBeanstalkEnvironment. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, ElasticBeanstalkEnvironmentInner> + beginUpdateAsync(String resourceGroupName, String name, ElasticBeanstalkEnvironmentTagsUpdate properties) { + Mono>> mono = updateWithResponseAsync(resourceGroupName, name, properties); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), ElasticBeanstalkEnvironmentInner.class, + ElasticBeanstalkEnvironmentInner.class, this.client.getContext()); + } + + /** + * Update a ElasticBeanstalkEnvironment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ElasticBeanstalkEnvironment. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, ElasticBeanstalkEnvironmentInner> beginUpdateAsync( + String resourceGroupName, String name, ElasticBeanstalkEnvironmentTagsUpdate properties, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = updateWithResponseAsync(resourceGroupName, name, properties, context); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), ElasticBeanstalkEnvironmentInner.class, + ElasticBeanstalkEnvironmentInner.class, context); + } + + /** + * Update a ElasticBeanstalkEnvironment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ElasticBeanstalkEnvironment. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ElasticBeanstalkEnvironmentInner> + beginUpdate(String resourceGroupName, String name, ElasticBeanstalkEnvironmentTagsUpdate properties) { + return this.beginUpdateAsync(resourceGroupName, name, properties).getSyncPoller(); + } + + /** + * Update a ElasticBeanstalkEnvironment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ElasticBeanstalkEnvironment. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ElasticBeanstalkEnvironmentInner> beginUpdate( + String resourceGroupName, String name, ElasticBeanstalkEnvironmentTagsUpdate properties, Context context) { + return this.beginUpdateAsync(resourceGroupName, name, properties, context).getSyncPoller(); + } + + /** + * Update a ElasticBeanstalkEnvironment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ElasticBeanstalkEnvironment. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync(String resourceGroupName, String name, + ElasticBeanstalkEnvironmentTagsUpdate properties) { + return beginUpdateAsync(resourceGroupName, name, properties).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Update a ElasticBeanstalkEnvironment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ElasticBeanstalkEnvironment. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync(String resourceGroupName, String name, + ElasticBeanstalkEnvironmentTagsUpdate properties, Context context) { + return beginUpdateAsync(resourceGroupName, name, properties, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Update a ElasticBeanstalkEnvironment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ElasticBeanstalkEnvironment. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ElasticBeanstalkEnvironmentInner update(String resourceGroupName, String name, + ElasticBeanstalkEnvironmentTagsUpdate properties) { + return updateAsync(resourceGroupName, name, properties).block(); + } + + /** + * Update a ElasticBeanstalkEnvironment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ElasticBeanstalkEnvironment. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ElasticBeanstalkEnvironmentInner update(String resourceGroupName, String name, + ElasticBeanstalkEnvironmentTagsUpdate properties, Context context) { + return updateAsync(resourceGroupName, name, properties, context).block(); + } + + /** + * Delete a ElasticBeanstalkEnvironment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ElasticBeanstalkEnvironment. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync(String resourceGroupName, String name) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Delete a ElasticBeanstalkEnvironment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ElasticBeanstalkEnvironment. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync(String resourceGroupName, String name, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.delete(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, name, accept, context); + } + + /** + * Delete a ElasticBeanstalkEnvironment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ElasticBeanstalkEnvironment. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String name) { + Mono>> mono = deleteWithResponseAsync(resourceGroupName, name); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); + } + + /** + * Delete a ElasticBeanstalkEnvironment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ElasticBeanstalkEnvironment. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String name, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = deleteWithResponseAsync(resourceGroupName, name, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + context); + } + + /** + * Delete a ElasticBeanstalkEnvironment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ElasticBeanstalkEnvironment. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String name) { + return this.beginDeleteAsync(resourceGroupName, name).getSyncPoller(); + } + + /** + * Delete a ElasticBeanstalkEnvironment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ElasticBeanstalkEnvironment. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String name, Context context) { + return this.beginDeleteAsync(resourceGroupName, name, context).getSyncPoller(); + } + + /** + * Delete a ElasticBeanstalkEnvironment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ElasticBeanstalkEnvironment. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String name) { + return beginDeleteAsync(resourceGroupName, name).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete a ElasticBeanstalkEnvironment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ElasticBeanstalkEnvironment. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String name, Context context) { + return beginDeleteAsync(resourceGroupName, name, context).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete a ElasticBeanstalkEnvironment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ElasticBeanstalkEnvironment. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String name) { + deleteAsync(resourceGroupName, name).block(); + } + + /** + * Delete a ElasticBeanstalkEnvironment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ElasticBeanstalkEnvironment. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String name, Context context) { + deleteAsync(resourceGroupName, name, context).block(); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a ElasticBeanstalkEnvironment list operation along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> + listBySubscriptionNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a ElasticBeanstalkEnvironment list operation along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listBySubscriptionNextSinglePageAsync(String nextLink, + Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a ElasticBeanstalkEnvironment list operation along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> + listByResourceGroupNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a ElasticBeanstalkEnvironment list operation along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> + listByResourceGroupNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/ElasticBeanstalkEnvironmentsImpl.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/ElasticBeanstalkEnvironmentsImpl.java new file mode 100644 index 000000000000..a3a38e6d6926 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/ElasticBeanstalkEnvironmentsImpl.java @@ -0,0 +1,152 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.awsconnector.fluent.ElasticBeanstalkEnvironmentsClient; +import com.azure.resourcemanager.awsconnector.fluent.models.ElasticBeanstalkEnvironmentInner; +import com.azure.resourcemanager.awsconnector.models.ElasticBeanstalkEnvironment; +import com.azure.resourcemanager.awsconnector.models.ElasticBeanstalkEnvironments; + +public final class ElasticBeanstalkEnvironmentsImpl implements ElasticBeanstalkEnvironments { + private static final ClientLogger LOGGER = new ClientLogger(ElasticBeanstalkEnvironmentsImpl.class); + + private final ElasticBeanstalkEnvironmentsClient innerClient; + + private final com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager; + + public ElasticBeanstalkEnvironmentsImpl(ElasticBeanstalkEnvironmentsClient innerClient, + com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return ResourceManagerUtils.mapPage(inner, + inner1 -> new ElasticBeanstalkEnvironmentImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return ResourceManagerUtils.mapPage(inner, + inner1 -> new ElasticBeanstalkEnvironmentImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName) { + PagedIterable inner + = this.serviceClient().listByResourceGroup(resourceGroupName); + return ResourceManagerUtils.mapPage(inner, + inner1 -> new ElasticBeanstalkEnvironmentImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + PagedIterable inner + = this.serviceClient().listByResourceGroup(resourceGroupName, context); + return ResourceManagerUtils.mapPage(inner, + inner1 -> new ElasticBeanstalkEnvironmentImpl(inner1, this.manager())); + } + + public Response getByResourceGroupWithResponse(String resourceGroupName, String name, + Context context) { + Response inner + = this.serviceClient().getByResourceGroupWithResponse(resourceGroupName, name, context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new ElasticBeanstalkEnvironmentImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public ElasticBeanstalkEnvironment getByResourceGroup(String resourceGroupName, String name) { + ElasticBeanstalkEnvironmentInner inner = this.serviceClient().getByResourceGroup(resourceGroupName, name); + if (inner != null) { + return new ElasticBeanstalkEnvironmentImpl(inner, this.manager()); + } else { + return null; + } + } + + public void deleteByResourceGroup(String resourceGroupName, String name) { + this.serviceClient().delete(resourceGroupName, name); + } + + public void delete(String resourceGroupName, String name, Context context) { + this.serviceClient().delete(resourceGroupName, name, context); + } + + public ElasticBeanstalkEnvironment getById(String id) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String name = ResourceManagerUtils.getValueFromIdByName(id, "elasticBeanstalkEnvironments"); + if (name == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException(String.format( + "The resource ID '%s' is not valid. Missing path segment 'elasticBeanstalkEnvironments'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, name, Context.NONE).getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String name = ResourceManagerUtils.getValueFromIdByName(id, "elasticBeanstalkEnvironments"); + if (name == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException(String.format( + "The resource ID '%s' is not valid. Missing path segment 'elasticBeanstalkEnvironments'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, name, context); + } + + public void deleteById(String id) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String name = ResourceManagerUtils.getValueFromIdByName(id, "elasticBeanstalkEnvironments"); + if (name == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException(String.format( + "The resource ID '%s' is not valid. Missing path segment 'elasticBeanstalkEnvironments'.", id))); + } + this.delete(resourceGroupName, name, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String name = ResourceManagerUtils.getValueFromIdByName(id, "elasticBeanstalkEnvironments"); + if (name == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException(String.format( + "The resource ID '%s' is not valid. Missing path segment 'elasticBeanstalkEnvironments'.", id))); + } + this.delete(resourceGroupName, name, context); + } + + private ElasticBeanstalkEnvironmentsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.awsconnector.AwsconnectorManager manager() { + return this.serviceManager; + } + + public ElasticBeanstalkEnvironmentImpl define(String name) { + return new ElasticBeanstalkEnvironmentImpl(name, this.manager()); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/ElasticLoadBalancingV2ListenerImpl.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/ElasticLoadBalancingV2ListenerImpl.java new file mode 100644 index 000000000000..9ba716b559c1 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/ElasticLoadBalancingV2ListenerImpl.java @@ -0,0 +1,179 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.implementation; + +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.awsconnector.fluent.models.ElasticLoadBalancingV2ListenerInner; +import com.azure.resourcemanager.awsconnector.models.ElasticLoadBalancingV2Listener; +import com.azure.resourcemanager.awsconnector.models.ElasticLoadBalancingV2ListenerProperties; +import com.azure.resourcemanager.awsconnector.models.ElasticLoadBalancingV2ListenerTagsUpdate; +import java.util.Collections; +import java.util.Map; + +public final class ElasticLoadBalancingV2ListenerImpl implements ElasticLoadBalancingV2Listener, + ElasticLoadBalancingV2Listener.Definition, ElasticLoadBalancingV2Listener.Update { + private ElasticLoadBalancingV2ListenerInner innerObject; + + private final com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public String location() { + return this.innerModel().location(); + } + + public Map tags() { + Map inner = this.innerModel().tags(); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } + } + + public ElasticLoadBalancingV2ListenerProperties properties() { + return this.innerModel().properties(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public String resourceGroupName() { + return resourceGroupName; + } + + public ElasticLoadBalancingV2ListenerInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.awsconnector.AwsconnectorManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String name; + + private ElasticLoadBalancingV2ListenerTagsUpdate updateProperties; + + public ElasticLoadBalancingV2ListenerImpl withExistingResourceGroup(String resourceGroupName) { + this.resourceGroupName = resourceGroupName; + return this; + } + + public ElasticLoadBalancingV2Listener create() { + this.innerObject = serviceManager.serviceClient() + .getElasticLoadBalancingV2Listeners() + .createOrReplace(resourceGroupName, name, this.innerModel(), Context.NONE); + return this; + } + + public ElasticLoadBalancingV2Listener create(Context context) { + this.innerObject = serviceManager.serviceClient() + .getElasticLoadBalancingV2Listeners() + .createOrReplace(resourceGroupName, name, this.innerModel(), context); + return this; + } + + ElasticLoadBalancingV2ListenerImpl(String name, + com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager) { + this.innerObject = new ElasticLoadBalancingV2ListenerInner(); + this.serviceManager = serviceManager; + this.name = name; + } + + public ElasticLoadBalancingV2ListenerImpl update() { + this.updateProperties = new ElasticLoadBalancingV2ListenerTagsUpdate(); + return this; + } + + public ElasticLoadBalancingV2Listener apply() { + this.innerObject = serviceManager.serviceClient() + .getElasticLoadBalancingV2Listeners() + .update(resourceGroupName, name, updateProperties, Context.NONE); + return this; + } + + public ElasticLoadBalancingV2Listener apply(Context context) { + this.innerObject = serviceManager.serviceClient() + .getElasticLoadBalancingV2Listeners() + .update(resourceGroupName, name, updateProperties, context); + return this; + } + + ElasticLoadBalancingV2ListenerImpl(ElasticLoadBalancingV2ListenerInner innerObject, + com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.name = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "elasticLoadBalancingV2Listeners"); + } + + public ElasticLoadBalancingV2Listener refresh() { + this.innerObject = serviceManager.serviceClient() + .getElasticLoadBalancingV2Listeners() + .getByResourceGroupWithResponse(resourceGroupName, name, Context.NONE) + .getValue(); + return this; + } + + public ElasticLoadBalancingV2Listener refresh(Context context) { + this.innerObject = serviceManager.serviceClient() + .getElasticLoadBalancingV2Listeners() + .getByResourceGroupWithResponse(resourceGroupName, name, context) + .getValue(); + return this; + } + + public ElasticLoadBalancingV2ListenerImpl withRegion(Region location) { + this.innerModel().withLocation(location.toString()); + return this; + } + + public ElasticLoadBalancingV2ListenerImpl withRegion(String location) { + this.innerModel().withLocation(location); + return this; + } + + public ElasticLoadBalancingV2ListenerImpl withTags(Map tags) { + if (isInCreateMode()) { + this.innerModel().withTags(tags); + return this; + } else { + this.updateProperties.withTags(tags); + return this; + } + } + + public ElasticLoadBalancingV2ListenerImpl withProperties(ElasticLoadBalancingV2ListenerProperties properties) { + this.innerModel().withProperties(properties); + return this; + } + + private boolean isInCreateMode() { + return this.innerModel().id() == null; + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/ElasticLoadBalancingV2ListenersClientImpl.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/ElasticLoadBalancingV2ListenersClientImpl.java new file mode 100644 index 000000000000..ec1621ac5534 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/ElasticLoadBalancingV2ListenersClientImpl.java @@ -0,0 +1,1301 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.Patch; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.awsconnector.fluent.ElasticLoadBalancingV2ListenersClient; +import com.azure.resourcemanager.awsconnector.fluent.models.ElasticLoadBalancingV2ListenerInner; +import com.azure.resourcemanager.awsconnector.models.ElasticLoadBalancingV2ListenerListResult; +import com.azure.resourcemanager.awsconnector.models.ElasticLoadBalancingV2ListenerTagsUpdate; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in ElasticLoadBalancingV2ListenersClient. + */ +public final class ElasticLoadBalancingV2ListenersClientImpl implements ElasticLoadBalancingV2ListenersClient { + /** + * The proxy service used to perform REST calls. + */ + private final ElasticLoadBalancingV2ListenersService service; + + /** + * The service client containing this operation class. + */ + private final MicrosoftAwsConnectorImpl client; + + /** + * Initializes an instance of ElasticLoadBalancingV2ListenersClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + ElasticLoadBalancingV2ListenersClientImpl(MicrosoftAwsConnectorImpl client) { + this.service = RestProxy.create(ElasticLoadBalancingV2ListenersService.class, client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for MicrosoftAwsConnectorElasticLoadBalancingV2Listeners to be used by + * the proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "MicrosoftAwsConnecto") + public interface ElasticLoadBalancingV2ListenersService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.AwsConnector/elasticLoadBalancingV2Listeners") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/elasticLoadBalancingV2Listeners") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroup( + @HostParam("$host") String endpoint, @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/elasticLoadBalancingV2Listeners/{name}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getByResourceGroup(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("name") String name, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/elasticLoadBalancingV2Listeners/{name}") + @ExpectedResponses({ 200, 201 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrReplace(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("name") String name, + @BodyParam("application/json") ElasticLoadBalancingV2ListenerInner resource, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/elasticLoadBalancingV2Listeners/{name}") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> update(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("name") String name, + @BodyParam("application/json") ElasticLoadBalancingV2ListenerTagsUpdate properties, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/elasticLoadBalancingV2Listeners/{name}") + @ExpectedResponses({ 202, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("name") String name, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listBySubscriptionNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroupNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); + } + + /** + * List ElasticLoadBalancingV2Listener resources by subscription ID. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a ElasticLoadBalancingV2Listener list operation along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync() { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List ElasticLoadBalancingV2Listener resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a ElasticLoadBalancingV2Listener list operation along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), accept, + context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * List ElasticLoadBalancingV2Listener resources by subscription ID. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a ElasticLoadBalancingV2Listener list operation as paginated response with + * {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>(() -> listSinglePageAsync(), + nextLink -> listBySubscriptionNextSinglePageAsync(nextLink)); + } + + /** + * List ElasticLoadBalancingV2Listener resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a ElasticLoadBalancingV2Listener list operation as paginated response with + * {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(Context context) { + return new PagedFlux<>(() -> listSinglePageAsync(context), + nextLink -> listBySubscriptionNextSinglePageAsync(nextLink, context)); + } + + /** + * List ElasticLoadBalancingV2Listener resources by subscription ID. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a ElasticLoadBalancingV2Listener list operation as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + return new PagedIterable<>(listAsync()); + } + + /** + * List ElasticLoadBalancingV2Listener resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a ElasticLoadBalancingV2Listener list operation as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Context context) { + return new PagedIterable<>(listAsync(context)); + } + + /** + * List ElasticLoadBalancingV2Listener resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a ElasticLoadBalancingV2Listener list operation along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> + listByResourceGroupSinglePageAsync(String resourceGroupName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List ElasticLoadBalancingV2Listener resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a ElasticLoadBalancingV2Listener list operation along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> + listByResourceGroupSinglePageAsync(String resourceGroupName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * List ElasticLoadBalancingV2Listener resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a ElasticLoadBalancingV2Listener list operation as paginated response with + * {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName) { + return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); + } + + /** + * List ElasticLoadBalancingV2Listener resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a ElasticLoadBalancingV2Listener list operation as paginated response with + * {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName, + Context context) { + return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName, context), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink, context)); + } + + /** + * List ElasticLoadBalancingV2Listener resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a ElasticLoadBalancingV2Listener list operation as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName)); + } + + /** + * List ElasticLoadBalancingV2Listener resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a ElasticLoadBalancingV2Listener list operation as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName, + Context context) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, context)); + } + + /** + * Get a ElasticLoadBalancingV2Listener. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ElasticLoadBalancingV2Listener. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a ElasticLoadBalancingV2Listener along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> + getByResourceGroupWithResponseAsync(String resourceGroupName, String name) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.getByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get a ElasticLoadBalancingV2Listener. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ElasticLoadBalancingV2Listener. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a ElasticLoadBalancingV2Listener along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> + getByResourceGroupWithResponseAsync(String resourceGroupName, String name, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.getByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, accept, context); + } + + /** + * Get a ElasticLoadBalancingV2Listener. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ElasticLoadBalancingV2Listener. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a ElasticLoadBalancingV2Listener on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getByResourceGroupAsync(String resourceGroupName, String name) { + return getByResourceGroupWithResponseAsync(resourceGroupName, name) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Get a ElasticLoadBalancingV2Listener. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ElasticLoadBalancingV2Listener. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a ElasticLoadBalancingV2Listener along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getByResourceGroupWithResponse(String resourceGroupName, + String name, Context context) { + return getByResourceGroupWithResponseAsync(resourceGroupName, name, context).block(); + } + + /** + * Get a ElasticLoadBalancingV2Listener. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ElasticLoadBalancingV2Listener. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a ElasticLoadBalancingV2Listener. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ElasticLoadBalancingV2ListenerInner getByResourceGroup(String resourceGroupName, String name) { + return getByResourceGroupWithResponse(resourceGroupName, name, Context.NONE).getValue(); + } + + /** + * Create a ElasticLoadBalancingV2Listener. Please note that end user resource creation is currently restricted, but + * it will be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ElasticLoadBalancingV2Listener. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrReplaceWithResponseAsync(String resourceGroupName, String name, + ElasticLoadBalancingV2ListenerInner resource) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (resource == null) { + return Mono.error(new IllegalArgumentException("Parameter resource is required and cannot be null.")); + } else { + resource.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.createOrReplace(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, resource, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Create a ElasticLoadBalancingV2Listener. Please note that end user resource creation is currently restricted, but + * it will be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ElasticLoadBalancingV2Listener. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrReplaceWithResponseAsync(String resourceGroupName, String name, + ElasticLoadBalancingV2ListenerInner resource, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (resource == null) { + return Mono.error(new IllegalArgumentException("Parameter resource is required and cannot be null.")); + } else { + resource.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.createOrReplace(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, resource, accept, context); + } + + /** + * Create a ElasticLoadBalancingV2Listener. Please note that end user resource creation is currently restricted, but + * it will be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ElasticLoadBalancingV2Listener. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, ElasticLoadBalancingV2ListenerInner> + beginCreateOrReplaceAsync(String resourceGroupName, String name, ElasticLoadBalancingV2ListenerInner resource) { + Mono>> mono = createOrReplaceWithResponseAsync(resourceGroupName, name, resource); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), ElasticLoadBalancingV2ListenerInner.class, + ElasticLoadBalancingV2ListenerInner.class, this.client.getContext()); + } + + /** + * Create a ElasticLoadBalancingV2Listener. Please note that end user resource creation is currently restricted, but + * it will be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ElasticLoadBalancingV2Listener. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, ElasticLoadBalancingV2ListenerInner> + beginCreateOrReplaceAsync(String resourceGroupName, String name, ElasticLoadBalancingV2ListenerInner resource, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono + = createOrReplaceWithResponseAsync(resourceGroupName, name, resource, context); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), ElasticLoadBalancingV2ListenerInner.class, + ElasticLoadBalancingV2ListenerInner.class, context); + } + + /** + * Create a ElasticLoadBalancingV2Listener. Please note that end user resource creation is currently restricted, but + * it will be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ElasticLoadBalancingV2Listener. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ElasticLoadBalancingV2ListenerInner> + beginCreateOrReplace(String resourceGroupName, String name, ElasticLoadBalancingV2ListenerInner resource) { + return this.beginCreateOrReplaceAsync(resourceGroupName, name, resource).getSyncPoller(); + } + + /** + * Create a ElasticLoadBalancingV2Listener. Please note that end user resource creation is currently restricted, but + * it will be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ElasticLoadBalancingV2Listener. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ElasticLoadBalancingV2ListenerInner> + beginCreateOrReplace(String resourceGroupName, String name, ElasticLoadBalancingV2ListenerInner resource, + Context context) { + return this.beginCreateOrReplaceAsync(resourceGroupName, name, resource, context).getSyncPoller(); + } + + /** + * Create a ElasticLoadBalancingV2Listener. Please note that end user resource creation is currently restricted, but + * it will be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ElasticLoadBalancingV2Listener. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrReplaceAsync(String resourceGroupName, String name, + ElasticLoadBalancingV2ListenerInner resource) { + return beginCreateOrReplaceAsync(resourceGroupName, name, resource).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create a ElasticLoadBalancingV2Listener. Please note that end user resource creation is currently restricted, but + * it will be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ElasticLoadBalancingV2Listener. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrReplaceAsync(String resourceGroupName, String name, + ElasticLoadBalancingV2ListenerInner resource, Context context) { + return beginCreateOrReplaceAsync(resourceGroupName, name, resource, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create a ElasticLoadBalancingV2Listener. Please note that end user resource creation is currently restricted, but + * it will be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ElasticLoadBalancingV2Listener. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ElasticLoadBalancingV2ListenerInner createOrReplace(String resourceGroupName, String name, + ElasticLoadBalancingV2ListenerInner resource) { + return createOrReplaceAsync(resourceGroupName, name, resource).block(); + } + + /** + * Create a ElasticLoadBalancingV2Listener. Please note that end user resource creation is currently restricted, but + * it will be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ElasticLoadBalancingV2Listener. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ElasticLoadBalancingV2ListenerInner createOrReplace(String resourceGroupName, String name, + ElasticLoadBalancingV2ListenerInner resource, Context context) { + return createOrReplaceAsync(resourceGroupName, name, resource, context).block(); + } + + /** + * Update a ElasticLoadBalancingV2Listener. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ElasticLoadBalancingV2Listener. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync(String resourceGroupName, String name, + ElasticLoadBalancingV2ListenerTagsUpdate properties) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (properties == null) { + return Mono.error(new IllegalArgumentException("Parameter properties is required and cannot be null.")); + } else { + properties.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.update(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, properties, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Update a ElasticLoadBalancingV2Listener. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ElasticLoadBalancingV2Listener. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync(String resourceGroupName, String name, + ElasticLoadBalancingV2ListenerTagsUpdate properties, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (properties == null) { + return Mono.error(new IllegalArgumentException("Parameter properties is required and cannot be null.")); + } else { + properties.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.update(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, name, properties, accept, context); + } + + /** + * Update a ElasticLoadBalancingV2Listener. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ElasticLoadBalancingV2Listener. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, ElasticLoadBalancingV2ListenerInner> + beginUpdateAsync(String resourceGroupName, String name, ElasticLoadBalancingV2ListenerTagsUpdate properties) { + Mono>> mono = updateWithResponseAsync(resourceGroupName, name, properties); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), ElasticLoadBalancingV2ListenerInner.class, + ElasticLoadBalancingV2ListenerInner.class, this.client.getContext()); + } + + /** + * Update a ElasticLoadBalancingV2Listener. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ElasticLoadBalancingV2Listener. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, ElasticLoadBalancingV2ListenerInner> + beginUpdateAsync(String resourceGroupName, String name, ElasticLoadBalancingV2ListenerTagsUpdate properties, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = updateWithResponseAsync(resourceGroupName, name, properties, context); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), ElasticLoadBalancingV2ListenerInner.class, + ElasticLoadBalancingV2ListenerInner.class, context); + } + + /** + * Update a ElasticLoadBalancingV2Listener. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ElasticLoadBalancingV2Listener. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ElasticLoadBalancingV2ListenerInner> + beginUpdate(String resourceGroupName, String name, ElasticLoadBalancingV2ListenerTagsUpdate properties) { + return this.beginUpdateAsync(resourceGroupName, name, properties).getSyncPoller(); + } + + /** + * Update a ElasticLoadBalancingV2Listener. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ElasticLoadBalancingV2Listener. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ElasticLoadBalancingV2ListenerInner> beginUpdate( + String resourceGroupName, String name, ElasticLoadBalancingV2ListenerTagsUpdate properties, Context context) { + return this.beginUpdateAsync(resourceGroupName, name, properties, context).getSyncPoller(); + } + + /** + * Update a ElasticLoadBalancingV2Listener. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ElasticLoadBalancingV2Listener. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync(String resourceGroupName, String name, + ElasticLoadBalancingV2ListenerTagsUpdate properties) { + return beginUpdateAsync(resourceGroupName, name, properties).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Update a ElasticLoadBalancingV2Listener. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ElasticLoadBalancingV2Listener. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync(String resourceGroupName, String name, + ElasticLoadBalancingV2ListenerTagsUpdate properties, Context context) { + return beginUpdateAsync(resourceGroupName, name, properties, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Update a ElasticLoadBalancingV2Listener. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ElasticLoadBalancingV2Listener. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ElasticLoadBalancingV2ListenerInner update(String resourceGroupName, String name, + ElasticLoadBalancingV2ListenerTagsUpdate properties) { + return updateAsync(resourceGroupName, name, properties).block(); + } + + /** + * Update a ElasticLoadBalancingV2Listener. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ElasticLoadBalancingV2Listener. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ElasticLoadBalancingV2ListenerInner update(String resourceGroupName, String name, + ElasticLoadBalancingV2ListenerTagsUpdate properties, Context context) { + return updateAsync(resourceGroupName, name, properties, context).block(); + } + + /** + * Delete a ElasticLoadBalancingV2Listener. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ElasticLoadBalancingV2Listener. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync(String resourceGroupName, String name) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Delete a ElasticLoadBalancingV2Listener. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ElasticLoadBalancingV2Listener. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync(String resourceGroupName, String name, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.delete(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, name, accept, context); + } + + /** + * Delete a ElasticLoadBalancingV2Listener. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ElasticLoadBalancingV2Listener. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String name) { + Mono>> mono = deleteWithResponseAsync(resourceGroupName, name); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); + } + + /** + * Delete a ElasticLoadBalancingV2Listener. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ElasticLoadBalancingV2Listener. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String name, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = deleteWithResponseAsync(resourceGroupName, name, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + context); + } + + /** + * Delete a ElasticLoadBalancingV2Listener. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ElasticLoadBalancingV2Listener. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String name) { + return this.beginDeleteAsync(resourceGroupName, name).getSyncPoller(); + } + + /** + * Delete a ElasticLoadBalancingV2Listener. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ElasticLoadBalancingV2Listener. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String name, Context context) { + return this.beginDeleteAsync(resourceGroupName, name, context).getSyncPoller(); + } + + /** + * Delete a ElasticLoadBalancingV2Listener. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ElasticLoadBalancingV2Listener. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String name) { + return beginDeleteAsync(resourceGroupName, name).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete a ElasticLoadBalancingV2Listener. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ElasticLoadBalancingV2Listener. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String name, Context context) { + return beginDeleteAsync(resourceGroupName, name, context).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete a ElasticLoadBalancingV2Listener. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ElasticLoadBalancingV2Listener. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String name) { + deleteAsync(resourceGroupName, name).block(); + } + + /** + * Delete a ElasticLoadBalancingV2Listener. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ElasticLoadBalancingV2Listener. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String name, Context context) { + deleteAsync(resourceGroupName, name, context).block(); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a ElasticLoadBalancingV2Listener list operation along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> + listBySubscriptionNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a ElasticLoadBalancingV2Listener list operation along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> + listBySubscriptionNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a ElasticLoadBalancingV2Listener list operation along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> + listByResourceGroupNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a ElasticLoadBalancingV2Listener list operation along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> + listByResourceGroupNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/ElasticLoadBalancingV2ListenersImpl.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/ElasticLoadBalancingV2ListenersImpl.java new file mode 100644 index 000000000000..6ca4c0a1e384 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/ElasticLoadBalancingV2ListenersImpl.java @@ -0,0 +1,153 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.awsconnector.fluent.ElasticLoadBalancingV2ListenersClient; +import com.azure.resourcemanager.awsconnector.fluent.models.ElasticLoadBalancingV2ListenerInner; +import com.azure.resourcemanager.awsconnector.models.ElasticLoadBalancingV2Listener; +import com.azure.resourcemanager.awsconnector.models.ElasticLoadBalancingV2Listeners; + +public final class ElasticLoadBalancingV2ListenersImpl implements ElasticLoadBalancingV2Listeners { + private static final ClientLogger LOGGER = new ClientLogger(ElasticLoadBalancingV2ListenersImpl.class); + + private final ElasticLoadBalancingV2ListenersClient innerClient; + + private final com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager; + + public ElasticLoadBalancingV2ListenersImpl(ElasticLoadBalancingV2ListenersClient innerClient, + com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return ResourceManagerUtils.mapPage(inner, + inner1 -> new ElasticLoadBalancingV2ListenerImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return ResourceManagerUtils.mapPage(inner, + inner1 -> new ElasticLoadBalancingV2ListenerImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName) { + PagedIterable inner + = this.serviceClient().listByResourceGroup(resourceGroupName); + return ResourceManagerUtils.mapPage(inner, + inner1 -> new ElasticLoadBalancingV2ListenerImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName, + Context context) { + PagedIterable inner + = this.serviceClient().listByResourceGroup(resourceGroupName, context); + return ResourceManagerUtils.mapPage(inner, + inner1 -> new ElasticLoadBalancingV2ListenerImpl(inner1, this.manager())); + } + + public Response getByResourceGroupWithResponse(String resourceGroupName, + String name, Context context) { + Response inner + = this.serviceClient().getByResourceGroupWithResponse(resourceGroupName, name, context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new ElasticLoadBalancingV2ListenerImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public ElasticLoadBalancingV2Listener getByResourceGroup(String resourceGroupName, String name) { + ElasticLoadBalancingV2ListenerInner inner = this.serviceClient().getByResourceGroup(resourceGroupName, name); + if (inner != null) { + return new ElasticLoadBalancingV2ListenerImpl(inner, this.manager()); + } else { + return null; + } + } + + public void deleteByResourceGroup(String resourceGroupName, String name) { + this.serviceClient().delete(resourceGroupName, name); + } + + public void delete(String resourceGroupName, String name, Context context) { + this.serviceClient().delete(resourceGroupName, name, context); + } + + public ElasticLoadBalancingV2Listener getById(String id) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String name = ResourceManagerUtils.getValueFromIdByName(id, "elasticLoadBalancingV2Listeners"); + if (name == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException(String.format( + "The resource ID '%s' is not valid. Missing path segment 'elasticLoadBalancingV2Listeners'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, name, Context.NONE).getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String name = ResourceManagerUtils.getValueFromIdByName(id, "elasticLoadBalancingV2Listeners"); + if (name == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException(String.format( + "The resource ID '%s' is not valid. Missing path segment 'elasticLoadBalancingV2Listeners'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, name, context); + } + + public void deleteById(String id) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String name = ResourceManagerUtils.getValueFromIdByName(id, "elasticLoadBalancingV2Listeners"); + if (name == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException(String.format( + "The resource ID '%s' is not valid. Missing path segment 'elasticLoadBalancingV2Listeners'.", id))); + } + this.delete(resourceGroupName, name, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String name = ResourceManagerUtils.getValueFromIdByName(id, "elasticLoadBalancingV2Listeners"); + if (name == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException(String.format( + "The resource ID '%s' is not valid. Missing path segment 'elasticLoadBalancingV2Listeners'.", id))); + } + this.delete(resourceGroupName, name, context); + } + + private ElasticLoadBalancingV2ListenersClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.awsconnector.AwsconnectorManager manager() { + return this.serviceManager; + } + + public ElasticLoadBalancingV2ListenerImpl define(String name) { + return new ElasticLoadBalancingV2ListenerImpl(name, this.manager()); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/ElasticLoadBalancingV2LoadBalancerImpl.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/ElasticLoadBalancingV2LoadBalancerImpl.java new file mode 100644 index 000000000000..066f37cb4b83 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/ElasticLoadBalancingV2LoadBalancerImpl.java @@ -0,0 +1,180 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.implementation; + +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.awsconnector.fluent.models.ElasticLoadBalancingV2LoadBalancerInner; +import com.azure.resourcemanager.awsconnector.models.ElasticLoadBalancingV2LoadBalancer; +import com.azure.resourcemanager.awsconnector.models.ElasticLoadBalancingV2LoadBalancerProperties; +import com.azure.resourcemanager.awsconnector.models.ElasticLoadBalancingV2LoadBalancerTagsUpdate; +import java.util.Collections; +import java.util.Map; + +public final class ElasticLoadBalancingV2LoadBalancerImpl implements ElasticLoadBalancingV2LoadBalancer, + ElasticLoadBalancingV2LoadBalancer.Definition, ElasticLoadBalancingV2LoadBalancer.Update { + private ElasticLoadBalancingV2LoadBalancerInner innerObject; + + private final com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public String location() { + return this.innerModel().location(); + } + + public Map tags() { + Map inner = this.innerModel().tags(); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } + } + + public ElasticLoadBalancingV2LoadBalancerProperties properties() { + return this.innerModel().properties(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public String resourceGroupName() { + return resourceGroupName; + } + + public ElasticLoadBalancingV2LoadBalancerInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.awsconnector.AwsconnectorManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String name; + + private ElasticLoadBalancingV2LoadBalancerTagsUpdate updateProperties; + + public ElasticLoadBalancingV2LoadBalancerImpl withExistingResourceGroup(String resourceGroupName) { + this.resourceGroupName = resourceGroupName; + return this; + } + + public ElasticLoadBalancingV2LoadBalancer create() { + this.innerObject = serviceManager.serviceClient() + .getElasticLoadBalancingV2LoadBalancers() + .createOrReplace(resourceGroupName, name, this.innerModel(), Context.NONE); + return this; + } + + public ElasticLoadBalancingV2LoadBalancer create(Context context) { + this.innerObject = serviceManager.serviceClient() + .getElasticLoadBalancingV2LoadBalancers() + .createOrReplace(resourceGroupName, name, this.innerModel(), context); + return this; + } + + ElasticLoadBalancingV2LoadBalancerImpl(String name, + com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager) { + this.innerObject = new ElasticLoadBalancingV2LoadBalancerInner(); + this.serviceManager = serviceManager; + this.name = name; + } + + public ElasticLoadBalancingV2LoadBalancerImpl update() { + this.updateProperties = new ElasticLoadBalancingV2LoadBalancerTagsUpdate(); + return this; + } + + public ElasticLoadBalancingV2LoadBalancer apply() { + this.innerObject = serviceManager.serviceClient() + .getElasticLoadBalancingV2LoadBalancers() + .update(resourceGroupName, name, updateProperties, Context.NONE); + return this; + } + + public ElasticLoadBalancingV2LoadBalancer apply(Context context) { + this.innerObject = serviceManager.serviceClient() + .getElasticLoadBalancingV2LoadBalancers() + .update(resourceGroupName, name, updateProperties, context); + return this; + } + + ElasticLoadBalancingV2LoadBalancerImpl(ElasticLoadBalancingV2LoadBalancerInner innerObject, + com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.name = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "elasticLoadBalancingV2LoadBalancers"); + } + + public ElasticLoadBalancingV2LoadBalancer refresh() { + this.innerObject = serviceManager.serviceClient() + .getElasticLoadBalancingV2LoadBalancers() + .getByResourceGroupWithResponse(resourceGroupName, name, Context.NONE) + .getValue(); + return this; + } + + public ElasticLoadBalancingV2LoadBalancer refresh(Context context) { + this.innerObject = serviceManager.serviceClient() + .getElasticLoadBalancingV2LoadBalancers() + .getByResourceGroupWithResponse(resourceGroupName, name, context) + .getValue(); + return this; + } + + public ElasticLoadBalancingV2LoadBalancerImpl withRegion(Region location) { + this.innerModel().withLocation(location.toString()); + return this; + } + + public ElasticLoadBalancingV2LoadBalancerImpl withRegion(String location) { + this.innerModel().withLocation(location); + return this; + } + + public ElasticLoadBalancingV2LoadBalancerImpl withTags(Map tags) { + if (isInCreateMode()) { + this.innerModel().withTags(tags); + return this; + } else { + this.updateProperties.withTags(tags); + return this; + } + } + + public ElasticLoadBalancingV2LoadBalancerImpl + withProperties(ElasticLoadBalancingV2LoadBalancerProperties properties) { + this.innerModel().withProperties(properties); + return this; + } + + private boolean isInCreateMode() { + return this.innerModel().id() == null; + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/ElasticLoadBalancingV2LoadBalancersClientImpl.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/ElasticLoadBalancingV2LoadBalancersClientImpl.java new file mode 100644 index 000000000000..9b7716b1ffb4 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/ElasticLoadBalancingV2LoadBalancersClientImpl.java @@ -0,0 +1,1315 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.Patch; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.awsconnector.fluent.ElasticLoadBalancingV2LoadBalancersClient; +import com.azure.resourcemanager.awsconnector.fluent.models.ElasticLoadBalancingV2LoadBalancerInner; +import com.azure.resourcemanager.awsconnector.models.ElasticLoadBalancingV2LoadBalancerListResult; +import com.azure.resourcemanager.awsconnector.models.ElasticLoadBalancingV2LoadBalancerTagsUpdate; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in ElasticLoadBalancingV2LoadBalancersClient. + */ +public final class ElasticLoadBalancingV2LoadBalancersClientImpl implements ElasticLoadBalancingV2LoadBalancersClient { + /** + * The proxy service used to perform REST calls. + */ + private final ElasticLoadBalancingV2LoadBalancersService service; + + /** + * The service client containing this operation class. + */ + private final MicrosoftAwsConnectorImpl client; + + /** + * Initializes an instance of ElasticLoadBalancingV2LoadBalancersClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + ElasticLoadBalancingV2LoadBalancersClientImpl(MicrosoftAwsConnectorImpl client) { + this.service = RestProxy.create(ElasticLoadBalancingV2LoadBalancersService.class, client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for MicrosoftAwsConnectorElasticLoadBalancingV2LoadBalancers to be used + * by the proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "MicrosoftAwsConnecto") + public interface ElasticLoadBalancingV2LoadBalancersService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.AwsConnector/elasticLoadBalancingV2LoadBalancers") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/elasticLoadBalancingV2LoadBalancers") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroup( + @HostParam("$host") String endpoint, @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/elasticLoadBalancingV2LoadBalancers/{name}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getByResourceGroup(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("name") String name, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/elasticLoadBalancingV2LoadBalancers/{name}") + @ExpectedResponses({ 200, 201 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrReplace(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("name") String name, + @BodyParam("application/json") ElasticLoadBalancingV2LoadBalancerInner resource, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/elasticLoadBalancingV2LoadBalancers/{name}") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> update(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("name") String name, + @BodyParam("application/json") ElasticLoadBalancingV2LoadBalancerTagsUpdate properties, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/elasticLoadBalancingV2LoadBalancers/{name}") + @ExpectedResponses({ 202, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("name") String name, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listBySubscriptionNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroupNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); + } + + /** + * List ElasticLoadBalancingV2LoadBalancer resources by subscription ID. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a ElasticLoadBalancingV2LoadBalancer list operation along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync() { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), accept, context)) + .>map( + res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List ElasticLoadBalancingV2LoadBalancer resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a ElasticLoadBalancingV2LoadBalancer list operation along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), accept, + context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * List ElasticLoadBalancingV2LoadBalancer resources by subscription ID. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a ElasticLoadBalancingV2LoadBalancer list operation as paginated response with + * {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>(() -> listSinglePageAsync(), + nextLink -> listBySubscriptionNextSinglePageAsync(nextLink)); + } + + /** + * List ElasticLoadBalancingV2LoadBalancer resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a ElasticLoadBalancingV2LoadBalancer list operation as paginated response with + * {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(Context context) { + return new PagedFlux<>(() -> listSinglePageAsync(context), + nextLink -> listBySubscriptionNextSinglePageAsync(nextLink, context)); + } + + /** + * List ElasticLoadBalancingV2LoadBalancer resources by subscription ID. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a ElasticLoadBalancingV2LoadBalancer list operation as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + return new PagedIterable<>(listAsync()); + } + + /** + * List ElasticLoadBalancingV2LoadBalancer resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a ElasticLoadBalancingV2LoadBalancer list operation as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Context context) { + return new PagedIterable<>(listAsync(context)); + } + + /** + * List ElasticLoadBalancingV2LoadBalancer resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a ElasticLoadBalancingV2LoadBalancer list operation along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> + listByResourceGroupSinglePageAsync(String resourceGroupName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accept, context)) + .>map( + res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List ElasticLoadBalancingV2LoadBalancer resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a ElasticLoadBalancingV2LoadBalancer list operation along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> + listByResourceGroupSinglePageAsync(String resourceGroupName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * List ElasticLoadBalancingV2LoadBalancer resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a ElasticLoadBalancingV2LoadBalancer list operation as paginated response with + * {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName) { + return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); + } + + /** + * List ElasticLoadBalancingV2LoadBalancer resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a ElasticLoadBalancingV2LoadBalancer list operation as paginated response with + * {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName, + Context context) { + return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName, context), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink, context)); + } + + /** + * List ElasticLoadBalancingV2LoadBalancer resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a ElasticLoadBalancingV2LoadBalancer list operation as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName)); + } + + /** + * List ElasticLoadBalancingV2LoadBalancer resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a ElasticLoadBalancingV2LoadBalancer list operation as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName, + Context context) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, context)); + } + + /** + * Get a ElasticLoadBalancingV2LoadBalancer. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ElasticLoadBalancingV2LoadBalancer. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a ElasticLoadBalancingV2LoadBalancer along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> + getByResourceGroupWithResponseAsync(String resourceGroupName, String name) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.getByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get a ElasticLoadBalancingV2LoadBalancer. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ElasticLoadBalancingV2LoadBalancer. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a ElasticLoadBalancingV2LoadBalancer along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> + getByResourceGroupWithResponseAsync(String resourceGroupName, String name, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.getByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, accept, context); + } + + /** + * Get a ElasticLoadBalancingV2LoadBalancer. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ElasticLoadBalancingV2LoadBalancer. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a ElasticLoadBalancingV2LoadBalancer on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getByResourceGroupAsync(String resourceGroupName, + String name) { + return getByResourceGroupWithResponseAsync(resourceGroupName, name) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Get a ElasticLoadBalancingV2LoadBalancer. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ElasticLoadBalancingV2LoadBalancer. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a ElasticLoadBalancingV2LoadBalancer along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getByResourceGroupWithResponse(String resourceGroupName, + String name, Context context) { + return getByResourceGroupWithResponseAsync(resourceGroupName, name, context).block(); + } + + /** + * Get a ElasticLoadBalancingV2LoadBalancer. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ElasticLoadBalancingV2LoadBalancer. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a ElasticLoadBalancingV2LoadBalancer. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ElasticLoadBalancingV2LoadBalancerInner getByResourceGroup(String resourceGroupName, String name) { + return getByResourceGroupWithResponse(resourceGroupName, name, Context.NONE).getValue(); + } + + /** + * Create a ElasticLoadBalancingV2LoadBalancer. Please note that end user resource creation is currently restricted, + * but it will be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ElasticLoadBalancingV2LoadBalancer. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrReplaceWithResponseAsync(String resourceGroupName, String name, + ElasticLoadBalancingV2LoadBalancerInner resource) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (resource == null) { + return Mono.error(new IllegalArgumentException("Parameter resource is required and cannot be null.")); + } else { + resource.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.createOrReplace(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, resource, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Create a ElasticLoadBalancingV2LoadBalancer. Please note that end user resource creation is currently restricted, + * but it will be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ElasticLoadBalancingV2LoadBalancer. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrReplaceWithResponseAsync(String resourceGroupName, String name, + ElasticLoadBalancingV2LoadBalancerInner resource, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (resource == null) { + return Mono.error(new IllegalArgumentException("Parameter resource is required and cannot be null.")); + } else { + resource.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.createOrReplace(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, resource, accept, context); + } + + /** + * Create a ElasticLoadBalancingV2LoadBalancer. Please note that end user resource creation is currently restricted, + * but it will be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ElasticLoadBalancingV2LoadBalancer. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, ElasticLoadBalancingV2LoadBalancerInner> + beginCreateOrReplaceAsync(String resourceGroupName, String name, + ElasticLoadBalancingV2LoadBalancerInner resource) { + Mono>> mono = createOrReplaceWithResponseAsync(resourceGroupName, name, resource); + return this.client + .getLroResult(mono, + this.client.getHttpPipeline(), ElasticLoadBalancingV2LoadBalancerInner.class, + ElasticLoadBalancingV2LoadBalancerInner.class, this.client.getContext()); + } + + /** + * Create a ElasticLoadBalancingV2LoadBalancer. Please note that end user resource creation is currently restricted, + * but it will be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ElasticLoadBalancingV2LoadBalancer. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, ElasticLoadBalancingV2LoadBalancerInner> + beginCreateOrReplaceAsync(String resourceGroupName, String name, + ElasticLoadBalancingV2LoadBalancerInner resource, Context context) { + context = this.client.mergeContext(context); + Mono>> mono + = createOrReplaceWithResponseAsync(resourceGroupName, name, resource, context); + return this.client + .getLroResult(mono, + this.client.getHttpPipeline(), ElasticLoadBalancingV2LoadBalancerInner.class, + ElasticLoadBalancingV2LoadBalancerInner.class, context); + } + + /** + * Create a ElasticLoadBalancingV2LoadBalancer. Please note that end user resource creation is currently restricted, + * but it will be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ElasticLoadBalancingV2LoadBalancer. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ElasticLoadBalancingV2LoadBalancerInner> + beginCreateOrReplace(String resourceGroupName, String name, ElasticLoadBalancingV2LoadBalancerInner resource) { + return this.beginCreateOrReplaceAsync(resourceGroupName, name, resource).getSyncPoller(); + } + + /** + * Create a ElasticLoadBalancingV2LoadBalancer. Please note that end user resource creation is currently restricted, + * but it will be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ElasticLoadBalancingV2LoadBalancer. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ElasticLoadBalancingV2LoadBalancerInner> + beginCreateOrReplace(String resourceGroupName, String name, ElasticLoadBalancingV2LoadBalancerInner resource, + Context context) { + return this.beginCreateOrReplaceAsync(resourceGroupName, name, resource, context).getSyncPoller(); + } + + /** + * Create a ElasticLoadBalancingV2LoadBalancer. Please note that end user resource creation is currently restricted, + * but it will be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ElasticLoadBalancingV2LoadBalancer. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrReplaceAsync(String resourceGroupName, String name, + ElasticLoadBalancingV2LoadBalancerInner resource) { + return beginCreateOrReplaceAsync(resourceGroupName, name, resource).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create a ElasticLoadBalancingV2LoadBalancer. Please note that end user resource creation is currently restricted, + * but it will be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ElasticLoadBalancingV2LoadBalancer. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrReplaceAsync(String resourceGroupName, String name, + ElasticLoadBalancingV2LoadBalancerInner resource, Context context) { + return beginCreateOrReplaceAsync(resourceGroupName, name, resource, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create a ElasticLoadBalancingV2LoadBalancer. Please note that end user resource creation is currently restricted, + * but it will be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ElasticLoadBalancingV2LoadBalancer. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ElasticLoadBalancingV2LoadBalancerInner createOrReplace(String resourceGroupName, String name, + ElasticLoadBalancingV2LoadBalancerInner resource) { + return createOrReplaceAsync(resourceGroupName, name, resource).block(); + } + + /** + * Create a ElasticLoadBalancingV2LoadBalancer. Please note that end user resource creation is currently restricted, + * but it will be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ElasticLoadBalancingV2LoadBalancer. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ElasticLoadBalancingV2LoadBalancerInner createOrReplace(String resourceGroupName, String name, + ElasticLoadBalancingV2LoadBalancerInner resource, Context context) { + return createOrReplaceAsync(resourceGroupName, name, resource, context).block(); + } + + /** + * Update a ElasticLoadBalancingV2LoadBalancer. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ElasticLoadBalancingV2LoadBalancer. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync(String resourceGroupName, String name, + ElasticLoadBalancingV2LoadBalancerTagsUpdate properties) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (properties == null) { + return Mono.error(new IllegalArgumentException("Parameter properties is required and cannot be null.")); + } else { + properties.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.update(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, properties, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Update a ElasticLoadBalancingV2LoadBalancer. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ElasticLoadBalancingV2LoadBalancer. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync(String resourceGroupName, String name, + ElasticLoadBalancingV2LoadBalancerTagsUpdate properties, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (properties == null) { + return Mono.error(new IllegalArgumentException("Parameter properties is required and cannot be null.")); + } else { + properties.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.update(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, name, properties, accept, context); + } + + /** + * Update a ElasticLoadBalancingV2LoadBalancer. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ElasticLoadBalancingV2LoadBalancer. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, ElasticLoadBalancingV2LoadBalancerInner> + beginUpdateAsync(String resourceGroupName, String name, + ElasticLoadBalancingV2LoadBalancerTagsUpdate properties) { + Mono>> mono = updateWithResponseAsync(resourceGroupName, name, properties); + return this.client + .getLroResult(mono, + this.client.getHttpPipeline(), ElasticLoadBalancingV2LoadBalancerInner.class, + ElasticLoadBalancingV2LoadBalancerInner.class, this.client.getContext()); + } + + /** + * Update a ElasticLoadBalancingV2LoadBalancer. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ElasticLoadBalancingV2LoadBalancer. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, ElasticLoadBalancingV2LoadBalancerInner> + beginUpdateAsync(String resourceGroupName, String name, ElasticLoadBalancingV2LoadBalancerTagsUpdate properties, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = updateWithResponseAsync(resourceGroupName, name, properties, context); + return this.client + .getLroResult(mono, + this.client.getHttpPipeline(), ElasticLoadBalancingV2LoadBalancerInner.class, + ElasticLoadBalancingV2LoadBalancerInner.class, context); + } + + /** + * Update a ElasticLoadBalancingV2LoadBalancer. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ElasticLoadBalancingV2LoadBalancer. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ElasticLoadBalancingV2LoadBalancerInner> + beginUpdate(String resourceGroupName, String name, ElasticLoadBalancingV2LoadBalancerTagsUpdate properties) { + return this.beginUpdateAsync(resourceGroupName, name, properties).getSyncPoller(); + } + + /** + * Update a ElasticLoadBalancingV2LoadBalancer. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ElasticLoadBalancingV2LoadBalancer. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ElasticLoadBalancingV2LoadBalancerInner> + beginUpdate(String resourceGroupName, String name, ElasticLoadBalancingV2LoadBalancerTagsUpdate properties, + Context context) { + return this.beginUpdateAsync(resourceGroupName, name, properties, context).getSyncPoller(); + } + + /** + * Update a ElasticLoadBalancingV2LoadBalancer. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ElasticLoadBalancingV2LoadBalancer. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync(String resourceGroupName, String name, + ElasticLoadBalancingV2LoadBalancerTagsUpdate properties) { + return beginUpdateAsync(resourceGroupName, name, properties).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Update a ElasticLoadBalancingV2LoadBalancer. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ElasticLoadBalancingV2LoadBalancer. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync(String resourceGroupName, String name, + ElasticLoadBalancingV2LoadBalancerTagsUpdate properties, Context context) { + return beginUpdateAsync(resourceGroupName, name, properties, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Update a ElasticLoadBalancingV2LoadBalancer. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ElasticLoadBalancingV2LoadBalancer. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ElasticLoadBalancingV2LoadBalancerInner update(String resourceGroupName, String name, + ElasticLoadBalancingV2LoadBalancerTagsUpdate properties) { + return updateAsync(resourceGroupName, name, properties).block(); + } + + /** + * Update a ElasticLoadBalancingV2LoadBalancer. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ElasticLoadBalancingV2LoadBalancer. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ElasticLoadBalancingV2LoadBalancerInner update(String resourceGroupName, String name, + ElasticLoadBalancingV2LoadBalancerTagsUpdate properties, Context context) { + return updateAsync(resourceGroupName, name, properties, context).block(); + } + + /** + * Delete a ElasticLoadBalancingV2LoadBalancer. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ElasticLoadBalancingV2LoadBalancer. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync(String resourceGroupName, String name) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Delete a ElasticLoadBalancingV2LoadBalancer. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ElasticLoadBalancingV2LoadBalancer. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync(String resourceGroupName, String name, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.delete(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, name, accept, context); + } + + /** + * Delete a ElasticLoadBalancingV2LoadBalancer. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ElasticLoadBalancingV2LoadBalancer. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String name) { + Mono>> mono = deleteWithResponseAsync(resourceGroupName, name); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); + } + + /** + * Delete a ElasticLoadBalancingV2LoadBalancer. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ElasticLoadBalancingV2LoadBalancer. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String name, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = deleteWithResponseAsync(resourceGroupName, name, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + context); + } + + /** + * Delete a ElasticLoadBalancingV2LoadBalancer. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ElasticLoadBalancingV2LoadBalancer. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String name) { + return this.beginDeleteAsync(resourceGroupName, name).getSyncPoller(); + } + + /** + * Delete a ElasticLoadBalancingV2LoadBalancer. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ElasticLoadBalancingV2LoadBalancer. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String name, Context context) { + return this.beginDeleteAsync(resourceGroupName, name, context).getSyncPoller(); + } + + /** + * Delete a ElasticLoadBalancingV2LoadBalancer. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ElasticLoadBalancingV2LoadBalancer. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String name) { + return beginDeleteAsync(resourceGroupName, name).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete a ElasticLoadBalancingV2LoadBalancer. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ElasticLoadBalancingV2LoadBalancer. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String name, Context context) { + return beginDeleteAsync(resourceGroupName, name, context).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete a ElasticLoadBalancingV2LoadBalancer. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ElasticLoadBalancingV2LoadBalancer. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String name) { + deleteAsync(resourceGroupName, name).block(); + } + + /** + * Delete a ElasticLoadBalancingV2LoadBalancer. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ElasticLoadBalancingV2LoadBalancer. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String name, Context context) { + deleteAsync(resourceGroupName, name, context).block(); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a ElasticLoadBalancingV2LoadBalancer list operation along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> + listBySubscriptionNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a ElasticLoadBalancingV2LoadBalancer list operation along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> + listBySubscriptionNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a ElasticLoadBalancingV2LoadBalancer list operation along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> + listByResourceGroupNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a ElasticLoadBalancingV2LoadBalancer list operation along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> + listByResourceGroupNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/ElasticLoadBalancingV2LoadBalancersImpl.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/ElasticLoadBalancingV2LoadBalancersImpl.java new file mode 100644 index 000000000000..4730eaa6375d --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/ElasticLoadBalancingV2LoadBalancersImpl.java @@ -0,0 +1,154 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.awsconnector.fluent.ElasticLoadBalancingV2LoadBalancersClient; +import com.azure.resourcemanager.awsconnector.fluent.models.ElasticLoadBalancingV2LoadBalancerInner; +import com.azure.resourcemanager.awsconnector.models.ElasticLoadBalancingV2LoadBalancer; +import com.azure.resourcemanager.awsconnector.models.ElasticLoadBalancingV2LoadBalancers; + +public final class ElasticLoadBalancingV2LoadBalancersImpl implements ElasticLoadBalancingV2LoadBalancers { + private static final ClientLogger LOGGER = new ClientLogger(ElasticLoadBalancingV2LoadBalancersImpl.class); + + private final ElasticLoadBalancingV2LoadBalancersClient innerClient; + + private final com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager; + + public ElasticLoadBalancingV2LoadBalancersImpl(ElasticLoadBalancingV2LoadBalancersClient innerClient, + com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return ResourceManagerUtils.mapPage(inner, + inner1 -> new ElasticLoadBalancingV2LoadBalancerImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return ResourceManagerUtils.mapPage(inner, + inner1 -> new ElasticLoadBalancingV2LoadBalancerImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName) { + PagedIterable inner + = this.serviceClient().listByResourceGroup(resourceGroupName); + return ResourceManagerUtils.mapPage(inner, + inner1 -> new ElasticLoadBalancingV2LoadBalancerImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName, + Context context) { + PagedIterable inner + = this.serviceClient().listByResourceGroup(resourceGroupName, context); + return ResourceManagerUtils.mapPage(inner, + inner1 -> new ElasticLoadBalancingV2LoadBalancerImpl(inner1, this.manager())); + } + + public Response getByResourceGroupWithResponse(String resourceGroupName, + String name, Context context) { + Response inner + = this.serviceClient().getByResourceGroupWithResponse(resourceGroupName, name, context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new ElasticLoadBalancingV2LoadBalancerImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public ElasticLoadBalancingV2LoadBalancer getByResourceGroup(String resourceGroupName, String name) { + ElasticLoadBalancingV2LoadBalancerInner inner + = this.serviceClient().getByResourceGroup(resourceGroupName, name); + if (inner != null) { + return new ElasticLoadBalancingV2LoadBalancerImpl(inner, this.manager()); + } else { + return null; + } + } + + public void deleteByResourceGroup(String resourceGroupName, String name) { + this.serviceClient().delete(resourceGroupName, name); + } + + public void delete(String resourceGroupName, String name, Context context) { + this.serviceClient().delete(resourceGroupName, name, context); + } + + public ElasticLoadBalancingV2LoadBalancer getById(String id) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String name = ResourceManagerUtils.getValueFromIdByName(id, "elasticLoadBalancingV2LoadBalancers"); + if (name == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException(String.format( + "The resource ID '%s' is not valid. Missing path segment 'elasticLoadBalancingV2LoadBalancers'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, name, Context.NONE).getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String name = ResourceManagerUtils.getValueFromIdByName(id, "elasticLoadBalancingV2LoadBalancers"); + if (name == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException(String.format( + "The resource ID '%s' is not valid. Missing path segment 'elasticLoadBalancingV2LoadBalancers'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, name, context); + } + + public void deleteById(String id) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String name = ResourceManagerUtils.getValueFromIdByName(id, "elasticLoadBalancingV2LoadBalancers"); + if (name == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException(String.format( + "The resource ID '%s' is not valid. Missing path segment 'elasticLoadBalancingV2LoadBalancers'.", id))); + } + this.delete(resourceGroupName, name, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String name = ResourceManagerUtils.getValueFromIdByName(id, "elasticLoadBalancingV2LoadBalancers"); + if (name == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException(String.format( + "The resource ID '%s' is not valid. Missing path segment 'elasticLoadBalancingV2LoadBalancers'.", id))); + } + this.delete(resourceGroupName, name, context); + } + + private ElasticLoadBalancingV2LoadBalancersClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.awsconnector.AwsconnectorManager manager() { + return this.serviceManager; + } + + public ElasticLoadBalancingV2LoadBalancerImpl define(String name) { + return new ElasticLoadBalancingV2LoadBalancerImpl(name, this.manager()); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/ElasticLoadBalancingV2TargetGroupImpl.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/ElasticLoadBalancingV2TargetGroupImpl.java new file mode 100644 index 000000000000..77253c1d20b4 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/ElasticLoadBalancingV2TargetGroupImpl.java @@ -0,0 +1,180 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.implementation; + +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.awsconnector.fluent.models.ElasticLoadBalancingV2TargetGroupInner; +import com.azure.resourcemanager.awsconnector.models.ElasticLoadBalancingV2TargetGroup; +import com.azure.resourcemanager.awsconnector.models.ElasticLoadBalancingV2TargetGroupProperties; +import com.azure.resourcemanager.awsconnector.models.ElasticLoadBalancingV2TargetGroupTagsUpdate; +import java.util.Collections; +import java.util.Map; + +public final class ElasticLoadBalancingV2TargetGroupImpl implements ElasticLoadBalancingV2TargetGroup, + ElasticLoadBalancingV2TargetGroup.Definition, ElasticLoadBalancingV2TargetGroup.Update { + private ElasticLoadBalancingV2TargetGroupInner innerObject; + + private final com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public String location() { + return this.innerModel().location(); + } + + public Map tags() { + Map inner = this.innerModel().tags(); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } + } + + public ElasticLoadBalancingV2TargetGroupProperties properties() { + return this.innerModel().properties(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public String resourceGroupName() { + return resourceGroupName; + } + + public ElasticLoadBalancingV2TargetGroupInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.awsconnector.AwsconnectorManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String name; + + private ElasticLoadBalancingV2TargetGroupTagsUpdate updateProperties; + + public ElasticLoadBalancingV2TargetGroupImpl withExistingResourceGroup(String resourceGroupName) { + this.resourceGroupName = resourceGroupName; + return this; + } + + public ElasticLoadBalancingV2TargetGroup create() { + this.innerObject = serviceManager.serviceClient() + .getElasticLoadBalancingV2TargetGroups() + .createOrReplace(resourceGroupName, name, this.innerModel(), Context.NONE); + return this; + } + + public ElasticLoadBalancingV2TargetGroup create(Context context) { + this.innerObject = serviceManager.serviceClient() + .getElasticLoadBalancingV2TargetGroups() + .createOrReplace(resourceGroupName, name, this.innerModel(), context); + return this; + } + + ElasticLoadBalancingV2TargetGroupImpl(String name, + com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager) { + this.innerObject = new ElasticLoadBalancingV2TargetGroupInner(); + this.serviceManager = serviceManager; + this.name = name; + } + + public ElasticLoadBalancingV2TargetGroupImpl update() { + this.updateProperties = new ElasticLoadBalancingV2TargetGroupTagsUpdate(); + return this; + } + + public ElasticLoadBalancingV2TargetGroup apply() { + this.innerObject = serviceManager.serviceClient() + .getElasticLoadBalancingV2TargetGroups() + .update(resourceGroupName, name, updateProperties, Context.NONE); + return this; + } + + public ElasticLoadBalancingV2TargetGroup apply(Context context) { + this.innerObject = serviceManager.serviceClient() + .getElasticLoadBalancingV2TargetGroups() + .update(resourceGroupName, name, updateProperties, context); + return this; + } + + ElasticLoadBalancingV2TargetGroupImpl(ElasticLoadBalancingV2TargetGroupInner innerObject, + com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.name = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "elasticLoadBalancingV2TargetGroups"); + } + + public ElasticLoadBalancingV2TargetGroup refresh() { + this.innerObject = serviceManager.serviceClient() + .getElasticLoadBalancingV2TargetGroups() + .getByResourceGroupWithResponse(resourceGroupName, name, Context.NONE) + .getValue(); + return this; + } + + public ElasticLoadBalancingV2TargetGroup refresh(Context context) { + this.innerObject = serviceManager.serviceClient() + .getElasticLoadBalancingV2TargetGroups() + .getByResourceGroupWithResponse(resourceGroupName, name, context) + .getValue(); + return this; + } + + public ElasticLoadBalancingV2TargetGroupImpl withRegion(Region location) { + this.innerModel().withLocation(location.toString()); + return this; + } + + public ElasticLoadBalancingV2TargetGroupImpl withRegion(String location) { + this.innerModel().withLocation(location); + return this; + } + + public ElasticLoadBalancingV2TargetGroupImpl withTags(Map tags) { + if (isInCreateMode()) { + this.innerModel().withTags(tags); + return this; + } else { + this.updateProperties.withTags(tags); + return this; + } + } + + public ElasticLoadBalancingV2TargetGroupImpl + withProperties(ElasticLoadBalancingV2TargetGroupProperties properties) { + this.innerModel().withProperties(properties); + return this; + } + + private boolean isInCreateMode() { + return this.innerModel().id() == null; + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/ElasticLoadBalancingV2TargetGroupsClientImpl.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/ElasticLoadBalancingV2TargetGroupsClientImpl.java new file mode 100644 index 000000000000..2fe4aaac56c9 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/ElasticLoadBalancingV2TargetGroupsClientImpl.java @@ -0,0 +1,1305 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.Patch; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.awsconnector.fluent.ElasticLoadBalancingV2TargetGroupsClient; +import com.azure.resourcemanager.awsconnector.fluent.models.ElasticLoadBalancingV2TargetGroupInner; +import com.azure.resourcemanager.awsconnector.models.ElasticLoadBalancingV2TargetGroupListResult; +import com.azure.resourcemanager.awsconnector.models.ElasticLoadBalancingV2TargetGroupTagsUpdate; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in ElasticLoadBalancingV2TargetGroupsClient. + */ +public final class ElasticLoadBalancingV2TargetGroupsClientImpl implements ElasticLoadBalancingV2TargetGroupsClient { + /** + * The proxy service used to perform REST calls. + */ + private final ElasticLoadBalancingV2TargetGroupsService service; + + /** + * The service client containing this operation class. + */ + private final MicrosoftAwsConnectorImpl client; + + /** + * Initializes an instance of ElasticLoadBalancingV2TargetGroupsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + ElasticLoadBalancingV2TargetGroupsClientImpl(MicrosoftAwsConnectorImpl client) { + this.service = RestProxy.create(ElasticLoadBalancingV2TargetGroupsService.class, client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for MicrosoftAwsConnectorElasticLoadBalancingV2TargetGroups to be used by + * the proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "MicrosoftAwsConnecto") + public interface ElasticLoadBalancingV2TargetGroupsService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.AwsConnector/elasticLoadBalancingV2TargetGroups") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/elasticLoadBalancingV2TargetGroups") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroup( + @HostParam("$host") String endpoint, @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/elasticLoadBalancingV2TargetGroups/{name}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getByResourceGroup(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("name") String name, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/elasticLoadBalancingV2TargetGroups/{name}") + @ExpectedResponses({ 200, 201 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrReplace(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("name") String name, + @BodyParam("application/json") ElasticLoadBalancingV2TargetGroupInner resource, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/elasticLoadBalancingV2TargetGroups/{name}") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> update(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("name") String name, + @BodyParam("application/json") ElasticLoadBalancingV2TargetGroupTagsUpdate properties, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/elasticLoadBalancingV2TargetGroups/{name}") + @ExpectedResponses({ 202, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("name") String name, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listBySubscriptionNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroupNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); + } + + /** + * List ElasticLoadBalancingV2TargetGroup resources by subscription ID. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a ElasticLoadBalancingV2TargetGroup list operation along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync() { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List ElasticLoadBalancingV2TargetGroup resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a ElasticLoadBalancingV2TargetGroup list operation along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), accept, + context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * List ElasticLoadBalancingV2TargetGroup resources by subscription ID. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a ElasticLoadBalancingV2TargetGroup list operation as paginated response with + * {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>(() -> listSinglePageAsync(), + nextLink -> listBySubscriptionNextSinglePageAsync(nextLink)); + } + + /** + * List ElasticLoadBalancingV2TargetGroup resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a ElasticLoadBalancingV2TargetGroup list operation as paginated response with + * {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(Context context) { + return new PagedFlux<>(() -> listSinglePageAsync(context), + nextLink -> listBySubscriptionNextSinglePageAsync(nextLink, context)); + } + + /** + * List ElasticLoadBalancingV2TargetGroup resources by subscription ID. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a ElasticLoadBalancingV2TargetGroup list operation as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + return new PagedIterable<>(listAsync()); + } + + /** + * List ElasticLoadBalancingV2TargetGroup resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a ElasticLoadBalancingV2TargetGroup list operation as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Context context) { + return new PagedIterable<>(listAsync(context)); + } + + /** + * List ElasticLoadBalancingV2TargetGroup resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a ElasticLoadBalancingV2TargetGroup list operation along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> + listByResourceGroupSinglePageAsync(String resourceGroupName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List ElasticLoadBalancingV2TargetGroup resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a ElasticLoadBalancingV2TargetGroup list operation along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> + listByResourceGroupSinglePageAsync(String resourceGroupName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * List ElasticLoadBalancingV2TargetGroup resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a ElasticLoadBalancingV2TargetGroup list operation as paginated response with + * {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName) { + return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); + } + + /** + * List ElasticLoadBalancingV2TargetGroup resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a ElasticLoadBalancingV2TargetGroup list operation as paginated response with + * {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName, + Context context) { + return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName, context), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink, context)); + } + + /** + * List ElasticLoadBalancingV2TargetGroup resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a ElasticLoadBalancingV2TargetGroup list operation as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName)); + } + + /** + * List ElasticLoadBalancingV2TargetGroup resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a ElasticLoadBalancingV2TargetGroup list operation as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName, + Context context) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, context)); + } + + /** + * Get a ElasticLoadBalancingV2TargetGroup. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ElasticLoadBalancingV2TargetGroup. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a ElasticLoadBalancingV2TargetGroup along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> + getByResourceGroupWithResponseAsync(String resourceGroupName, String name) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.getByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get a ElasticLoadBalancingV2TargetGroup. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ElasticLoadBalancingV2TargetGroup. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a ElasticLoadBalancingV2TargetGroup along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> + getByResourceGroupWithResponseAsync(String resourceGroupName, String name, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.getByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, accept, context); + } + + /** + * Get a ElasticLoadBalancingV2TargetGroup. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ElasticLoadBalancingV2TargetGroup. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a ElasticLoadBalancingV2TargetGroup on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getByResourceGroupAsync(String resourceGroupName, + String name) { + return getByResourceGroupWithResponseAsync(resourceGroupName, name) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Get a ElasticLoadBalancingV2TargetGroup. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ElasticLoadBalancingV2TargetGroup. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a ElasticLoadBalancingV2TargetGroup along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getByResourceGroupWithResponse(String resourceGroupName, + String name, Context context) { + return getByResourceGroupWithResponseAsync(resourceGroupName, name, context).block(); + } + + /** + * Get a ElasticLoadBalancingV2TargetGroup. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ElasticLoadBalancingV2TargetGroup. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a ElasticLoadBalancingV2TargetGroup. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ElasticLoadBalancingV2TargetGroupInner getByResourceGroup(String resourceGroupName, String name) { + return getByResourceGroupWithResponse(resourceGroupName, name, Context.NONE).getValue(); + } + + /** + * Create a ElasticLoadBalancingV2TargetGroup. Please note that end user resource creation is currently restricted, + * but it will be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ElasticLoadBalancingV2TargetGroup. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrReplaceWithResponseAsync(String resourceGroupName, String name, + ElasticLoadBalancingV2TargetGroupInner resource) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (resource == null) { + return Mono.error(new IllegalArgumentException("Parameter resource is required and cannot be null.")); + } else { + resource.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.createOrReplace(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, resource, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Create a ElasticLoadBalancingV2TargetGroup. Please note that end user resource creation is currently restricted, + * but it will be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ElasticLoadBalancingV2TargetGroup. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrReplaceWithResponseAsync(String resourceGroupName, String name, + ElasticLoadBalancingV2TargetGroupInner resource, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (resource == null) { + return Mono.error(new IllegalArgumentException("Parameter resource is required and cannot be null.")); + } else { + resource.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.createOrReplace(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, resource, accept, context); + } + + /** + * Create a ElasticLoadBalancingV2TargetGroup. Please note that end user resource creation is currently restricted, + * but it will be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ElasticLoadBalancingV2TargetGroup. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, ElasticLoadBalancingV2TargetGroupInner> + beginCreateOrReplaceAsync(String resourceGroupName, String name, + ElasticLoadBalancingV2TargetGroupInner resource) { + Mono>> mono = createOrReplaceWithResponseAsync(resourceGroupName, name, resource); + return this.client.getLroResult( + mono, this.client.getHttpPipeline(), ElasticLoadBalancingV2TargetGroupInner.class, + ElasticLoadBalancingV2TargetGroupInner.class, this.client.getContext()); + } + + /** + * Create a ElasticLoadBalancingV2TargetGroup. Please note that end user resource creation is currently restricted, + * but it will be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ElasticLoadBalancingV2TargetGroup. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, ElasticLoadBalancingV2TargetGroupInner> + beginCreateOrReplaceAsync(String resourceGroupName, String name, + ElasticLoadBalancingV2TargetGroupInner resource, Context context) { + context = this.client.mergeContext(context); + Mono>> mono + = createOrReplaceWithResponseAsync(resourceGroupName, name, resource, context); + return this.client.getLroResult( + mono, this.client.getHttpPipeline(), ElasticLoadBalancingV2TargetGroupInner.class, + ElasticLoadBalancingV2TargetGroupInner.class, context); + } + + /** + * Create a ElasticLoadBalancingV2TargetGroup. Please note that end user resource creation is currently restricted, + * but it will be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ElasticLoadBalancingV2TargetGroup. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ElasticLoadBalancingV2TargetGroupInner> + beginCreateOrReplace(String resourceGroupName, String name, ElasticLoadBalancingV2TargetGroupInner resource) { + return this.beginCreateOrReplaceAsync(resourceGroupName, name, resource).getSyncPoller(); + } + + /** + * Create a ElasticLoadBalancingV2TargetGroup. Please note that end user resource creation is currently restricted, + * but it will be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ElasticLoadBalancingV2TargetGroup. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ElasticLoadBalancingV2TargetGroupInner> + beginCreateOrReplace(String resourceGroupName, String name, ElasticLoadBalancingV2TargetGroupInner resource, + Context context) { + return this.beginCreateOrReplaceAsync(resourceGroupName, name, resource, context).getSyncPoller(); + } + + /** + * Create a ElasticLoadBalancingV2TargetGroup. Please note that end user resource creation is currently restricted, + * but it will be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ElasticLoadBalancingV2TargetGroup. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrReplaceAsync(String resourceGroupName, String name, + ElasticLoadBalancingV2TargetGroupInner resource) { + return beginCreateOrReplaceAsync(resourceGroupName, name, resource).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create a ElasticLoadBalancingV2TargetGroup. Please note that end user resource creation is currently restricted, + * but it will be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ElasticLoadBalancingV2TargetGroup. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrReplaceAsync(String resourceGroupName, String name, + ElasticLoadBalancingV2TargetGroupInner resource, Context context) { + return beginCreateOrReplaceAsync(resourceGroupName, name, resource, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create a ElasticLoadBalancingV2TargetGroup. Please note that end user resource creation is currently restricted, + * but it will be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ElasticLoadBalancingV2TargetGroup. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ElasticLoadBalancingV2TargetGroupInner createOrReplace(String resourceGroupName, String name, + ElasticLoadBalancingV2TargetGroupInner resource) { + return createOrReplaceAsync(resourceGroupName, name, resource).block(); + } + + /** + * Create a ElasticLoadBalancingV2TargetGroup. Please note that end user resource creation is currently restricted, + * but it will be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ElasticLoadBalancingV2TargetGroup. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ElasticLoadBalancingV2TargetGroupInner createOrReplace(String resourceGroupName, String name, + ElasticLoadBalancingV2TargetGroupInner resource, Context context) { + return createOrReplaceAsync(resourceGroupName, name, resource, context).block(); + } + + /** + * Update a ElasticLoadBalancingV2TargetGroup. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ElasticLoadBalancingV2TargetGroup. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync(String resourceGroupName, String name, + ElasticLoadBalancingV2TargetGroupTagsUpdate properties) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (properties == null) { + return Mono.error(new IllegalArgumentException("Parameter properties is required and cannot be null.")); + } else { + properties.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.update(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, properties, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Update a ElasticLoadBalancingV2TargetGroup. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ElasticLoadBalancingV2TargetGroup. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync(String resourceGroupName, String name, + ElasticLoadBalancingV2TargetGroupTagsUpdate properties, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (properties == null) { + return Mono.error(new IllegalArgumentException("Parameter properties is required and cannot be null.")); + } else { + properties.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.update(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, name, properties, accept, context); + } + + /** + * Update a ElasticLoadBalancingV2TargetGroup. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ElasticLoadBalancingV2TargetGroup. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, ElasticLoadBalancingV2TargetGroupInner> + beginUpdateAsync(String resourceGroupName, String name, + ElasticLoadBalancingV2TargetGroupTagsUpdate properties) { + Mono>> mono = updateWithResponseAsync(resourceGroupName, name, properties); + return this.client.getLroResult( + mono, this.client.getHttpPipeline(), ElasticLoadBalancingV2TargetGroupInner.class, + ElasticLoadBalancingV2TargetGroupInner.class, this.client.getContext()); + } + + /** + * Update a ElasticLoadBalancingV2TargetGroup. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ElasticLoadBalancingV2TargetGroup. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, ElasticLoadBalancingV2TargetGroupInner> + beginUpdateAsync(String resourceGroupName, String name, ElasticLoadBalancingV2TargetGroupTagsUpdate properties, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = updateWithResponseAsync(resourceGroupName, name, properties, context); + return this.client.getLroResult( + mono, this.client.getHttpPipeline(), ElasticLoadBalancingV2TargetGroupInner.class, + ElasticLoadBalancingV2TargetGroupInner.class, context); + } + + /** + * Update a ElasticLoadBalancingV2TargetGroup. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ElasticLoadBalancingV2TargetGroup. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ElasticLoadBalancingV2TargetGroupInner> + beginUpdate(String resourceGroupName, String name, ElasticLoadBalancingV2TargetGroupTagsUpdate properties) { + return this.beginUpdateAsync(resourceGroupName, name, properties).getSyncPoller(); + } + + /** + * Update a ElasticLoadBalancingV2TargetGroup. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ElasticLoadBalancingV2TargetGroup. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ElasticLoadBalancingV2TargetGroupInner> + beginUpdate(String resourceGroupName, String name, ElasticLoadBalancingV2TargetGroupTagsUpdate properties, + Context context) { + return this.beginUpdateAsync(resourceGroupName, name, properties, context).getSyncPoller(); + } + + /** + * Update a ElasticLoadBalancingV2TargetGroup. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ElasticLoadBalancingV2TargetGroup. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync(String resourceGroupName, String name, + ElasticLoadBalancingV2TargetGroupTagsUpdate properties) { + return beginUpdateAsync(resourceGroupName, name, properties).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Update a ElasticLoadBalancingV2TargetGroup. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ElasticLoadBalancingV2TargetGroup. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync(String resourceGroupName, String name, + ElasticLoadBalancingV2TargetGroupTagsUpdate properties, Context context) { + return beginUpdateAsync(resourceGroupName, name, properties, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Update a ElasticLoadBalancingV2TargetGroup. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ElasticLoadBalancingV2TargetGroup. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ElasticLoadBalancingV2TargetGroupInner update(String resourceGroupName, String name, + ElasticLoadBalancingV2TargetGroupTagsUpdate properties) { + return updateAsync(resourceGroupName, name, properties).block(); + } + + /** + * Update a ElasticLoadBalancingV2TargetGroup. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ElasticLoadBalancingV2TargetGroup. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ElasticLoadBalancingV2TargetGroupInner update(String resourceGroupName, String name, + ElasticLoadBalancingV2TargetGroupTagsUpdate properties, Context context) { + return updateAsync(resourceGroupName, name, properties, context).block(); + } + + /** + * Delete a ElasticLoadBalancingV2TargetGroup. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ElasticLoadBalancingV2TargetGroup. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync(String resourceGroupName, String name) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Delete a ElasticLoadBalancingV2TargetGroup. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ElasticLoadBalancingV2TargetGroup. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync(String resourceGroupName, String name, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.delete(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, name, accept, context); + } + + /** + * Delete a ElasticLoadBalancingV2TargetGroup. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ElasticLoadBalancingV2TargetGroup. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String name) { + Mono>> mono = deleteWithResponseAsync(resourceGroupName, name); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); + } + + /** + * Delete a ElasticLoadBalancingV2TargetGroup. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ElasticLoadBalancingV2TargetGroup. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String name, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = deleteWithResponseAsync(resourceGroupName, name, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + context); + } + + /** + * Delete a ElasticLoadBalancingV2TargetGroup. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ElasticLoadBalancingV2TargetGroup. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String name) { + return this.beginDeleteAsync(resourceGroupName, name).getSyncPoller(); + } + + /** + * Delete a ElasticLoadBalancingV2TargetGroup. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ElasticLoadBalancingV2TargetGroup. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String name, Context context) { + return this.beginDeleteAsync(resourceGroupName, name, context).getSyncPoller(); + } + + /** + * Delete a ElasticLoadBalancingV2TargetGroup. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ElasticLoadBalancingV2TargetGroup. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String name) { + return beginDeleteAsync(resourceGroupName, name).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete a ElasticLoadBalancingV2TargetGroup. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ElasticLoadBalancingV2TargetGroup. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String name, Context context) { + return beginDeleteAsync(resourceGroupName, name, context).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete a ElasticLoadBalancingV2TargetGroup. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ElasticLoadBalancingV2TargetGroup. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String name) { + deleteAsync(resourceGroupName, name).block(); + } + + /** + * Delete a ElasticLoadBalancingV2TargetGroup. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ElasticLoadBalancingV2TargetGroup. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String name, Context context) { + deleteAsync(resourceGroupName, name, context).block(); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a ElasticLoadBalancingV2TargetGroup list operation along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> + listBySubscriptionNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a ElasticLoadBalancingV2TargetGroup list operation along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> + listBySubscriptionNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a ElasticLoadBalancingV2TargetGroup list operation along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> + listByResourceGroupNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a ElasticLoadBalancingV2TargetGroup list operation along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> + listByResourceGroupNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/ElasticLoadBalancingV2TargetGroupsImpl.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/ElasticLoadBalancingV2TargetGroupsImpl.java new file mode 100644 index 000000000000..9155a25070a5 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/ElasticLoadBalancingV2TargetGroupsImpl.java @@ -0,0 +1,153 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.awsconnector.fluent.ElasticLoadBalancingV2TargetGroupsClient; +import com.azure.resourcemanager.awsconnector.fluent.models.ElasticLoadBalancingV2TargetGroupInner; +import com.azure.resourcemanager.awsconnector.models.ElasticLoadBalancingV2TargetGroup; +import com.azure.resourcemanager.awsconnector.models.ElasticLoadBalancingV2TargetGroups; + +public final class ElasticLoadBalancingV2TargetGroupsImpl implements ElasticLoadBalancingV2TargetGroups { + private static final ClientLogger LOGGER = new ClientLogger(ElasticLoadBalancingV2TargetGroupsImpl.class); + + private final ElasticLoadBalancingV2TargetGroupsClient innerClient; + + private final com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager; + + public ElasticLoadBalancingV2TargetGroupsImpl(ElasticLoadBalancingV2TargetGroupsClient innerClient, + com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return ResourceManagerUtils.mapPage(inner, + inner1 -> new ElasticLoadBalancingV2TargetGroupImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return ResourceManagerUtils.mapPage(inner, + inner1 -> new ElasticLoadBalancingV2TargetGroupImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName) { + PagedIterable inner + = this.serviceClient().listByResourceGroup(resourceGroupName); + return ResourceManagerUtils.mapPage(inner, + inner1 -> new ElasticLoadBalancingV2TargetGroupImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName, + Context context) { + PagedIterable inner + = this.serviceClient().listByResourceGroup(resourceGroupName, context); + return ResourceManagerUtils.mapPage(inner, + inner1 -> new ElasticLoadBalancingV2TargetGroupImpl(inner1, this.manager())); + } + + public Response getByResourceGroupWithResponse(String resourceGroupName, + String name, Context context) { + Response inner + = this.serviceClient().getByResourceGroupWithResponse(resourceGroupName, name, context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new ElasticLoadBalancingV2TargetGroupImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public ElasticLoadBalancingV2TargetGroup getByResourceGroup(String resourceGroupName, String name) { + ElasticLoadBalancingV2TargetGroupInner inner = this.serviceClient().getByResourceGroup(resourceGroupName, name); + if (inner != null) { + return new ElasticLoadBalancingV2TargetGroupImpl(inner, this.manager()); + } else { + return null; + } + } + + public void deleteByResourceGroup(String resourceGroupName, String name) { + this.serviceClient().delete(resourceGroupName, name); + } + + public void delete(String resourceGroupName, String name, Context context) { + this.serviceClient().delete(resourceGroupName, name, context); + } + + public ElasticLoadBalancingV2TargetGroup getById(String id) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String name = ResourceManagerUtils.getValueFromIdByName(id, "elasticLoadBalancingV2TargetGroups"); + if (name == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException(String.format( + "The resource ID '%s' is not valid. Missing path segment 'elasticLoadBalancingV2TargetGroups'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, name, Context.NONE).getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String name = ResourceManagerUtils.getValueFromIdByName(id, "elasticLoadBalancingV2TargetGroups"); + if (name == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException(String.format( + "The resource ID '%s' is not valid. Missing path segment 'elasticLoadBalancingV2TargetGroups'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, name, context); + } + + public void deleteById(String id) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String name = ResourceManagerUtils.getValueFromIdByName(id, "elasticLoadBalancingV2TargetGroups"); + if (name == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException(String.format( + "The resource ID '%s' is not valid. Missing path segment 'elasticLoadBalancingV2TargetGroups'.", id))); + } + this.delete(resourceGroupName, name, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String name = ResourceManagerUtils.getValueFromIdByName(id, "elasticLoadBalancingV2TargetGroups"); + if (name == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException(String.format( + "The resource ID '%s' is not valid. Missing path segment 'elasticLoadBalancingV2TargetGroups'.", id))); + } + this.delete(resourceGroupName, name, context); + } + + private ElasticLoadBalancingV2TargetGroupsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.awsconnector.AwsconnectorManager manager() { + return this.serviceManager; + } + + public ElasticLoadBalancingV2TargetGroupImpl define(String name) { + return new ElasticLoadBalancingV2TargetGroupImpl(name, this.manager()); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/ElasticLoadBalancingv2TargetHealthDescriptionImpl.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/ElasticLoadBalancingv2TargetHealthDescriptionImpl.java new file mode 100644 index 000000000000..8daf1c39ab1b --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/ElasticLoadBalancingv2TargetHealthDescriptionImpl.java @@ -0,0 +1,182 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.implementation; + +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.awsconnector.fluent.models.ElasticLoadBalancingv2TargetHealthDescriptionInner; +import com.azure.resourcemanager.awsconnector.models.ElasticLoadBalancingv2TargetHealthDescription; +import com.azure.resourcemanager.awsconnector.models.ElasticLoadBalancingv2TargetHealthDescriptionProperties; +import com.azure.resourcemanager.awsconnector.models.ElasticLoadBalancingv2TargetHealthDescriptionTagsUpdate; +import java.util.Collections; +import java.util.Map; + +public final class ElasticLoadBalancingv2TargetHealthDescriptionImpl + implements ElasticLoadBalancingv2TargetHealthDescription, ElasticLoadBalancingv2TargetHealthDescription.Definition, + ElasticLoadBalancingv2TargetHealthDescription.Update { + private ElasticLoadBalancingv2TargetHealthDescriptionInner innerObject; + + private final com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public String location() { + return this.innerModel().location(); + } + + public Map tags() { + Map inner = this.innerModel().tags(); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } + } + + public ElasticLoadBalancingv2TargetHealthDescriptionProperties properties() { + return this.innerModel().properties(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public String resourceGroupName() { + return resourceGroupName; + } + + public ElasticLoadBalancingv2TargetHealthDescriptionInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.awsconnector.AwsconnectorManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String name; + + private ElasticLoadBalancingv2TargetHealthDescriptionTagsUpdate updateProperties; + + public ElasticLoadBalancingv2TargetHealthDescriptionImpl withExistingResourceGroup(String resourceGroupName) { + this.resourceGroupName = resourceGroupName; + return this; + } + + public ElasticLoadBalancingv2TargetHealthDescription create() { + this.innerObject = serviceManager.serviceClient() + .getElasticLoadBalancingv2TargetHealthDescriptions() + .createOrReplace(resourceGroupName, name, this.innerModel(), Context.NONE); + return this; + } + + public ElasticLoadBalancingv2TargetHealthDescription create(Context context) { + this.innerObject = serviceManager.serviceClient() + .getElasticLoadBalancingv2TargetHealthDescriptions() + .createOrReplace(resourceGroupName, name, this.innerModel(), context); + return this; + } + + ElasticLoadBalancingv2TargetHealthDescriptionImpl(String name, + com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager) { + this.innerObject = new ElasticLoadBalancingv2TargetHealthDescriptionInner(); + this.serviceManager = serviceManager; + this.name = name; + } + + public ElasticLoadBalancingv2TargetHealthDescriptionImpl update() { + this.updateProperties = new ElasticLoadBalancingv2TargetHealthDescriptionTagsUpdate(); + return this; + } + + public ElasticLoadBalancingv2TargetHealthDescription apply() { + this.innerObject = serviceManager.serviceClient() + .getElasticLoadBalancingv2TargetHealthDescriptions() + .update(resourceGroupName, name, updateProperties, Context.NONE); + return this; + } + + public ElasticLoadBalancingv2TargetHealthDescription apply(Context context) { + this.innerObject = serviceManager.serviceClient() + .getElasticLoadBalancingv2TargetHealthDescriptions() + .update(resourceGroupName, name, updateProperties, context); + return this; + } + + ElasticLoadBalancingv2TargetHealthDescriptionImpl(ElasticLoadBalancingv2TargetHealthDescriptionInner innerObject, + com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.name = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), + "elasticLoadBalancingV2TargetHealthDescriptions"); + } + + public ElasticLoadBalancingv2TargetHealthDescription refresh() { + this.innerObject = serviceManager.serviceClient() + .getElasticLoadBalancingv2TargetHealthDescriptions() + .getByResourceGroupWithResponse(resourceGroupName, name, Context.NONE) + .getValue(); + return this; + } + + public ElasticLoadBalancingv2TargetHealthDescription refresh(Context context) { + this.innerObject = serviceManager.serviceClient() + .getElasticLoadBalancingv2TargetHealthDescriptions() + .getByResourceGroupWithResponse(resourceGroupName, name, context) + .getValue(); + return this; + } + + public ElasticLoadBalancingv2TargetHealthDescriptionImpl withRegion(Region location) { + this.innerModel().withLocation(location.toString()); + return this; + } + + public ElasticLoadBalancingv2TargetHealthDescriptionImpl withRegion(String location) { + this.innerModel().withLocation(location); + return this; + } + + public ElasticLoadBalancingv2TargetHealthDescriptionImpl withTags(Map tags) { + if (isInCreateMode()) { + this.innerModel().withTags(tags); + return this; + } else { + this.updateProperties.withTags(tags); + return this; + } + } + + public ElasticLoadBalancingv2TargetHealthDescriptionImpl + withProperties(ElasticLoadBalancingv2TargetHealthDescriptionProperties properties) { + this.innerModel().withProperties(properties); + return this; + } + + private boolean isInCreateMode() { + return this.innerModel().id() == null; + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/ElasticLoadBalancingv2TargetHealthDescriptionsClientImpl.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/ElasticLoadBalancingv2TargetHealthDescriptionsClientImpl.java new file mode 100644 index 000000000000..907b6f6e323f --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/ElasticLoadBalancingv2TargetHealthDescriptionsClientImpl.java @@ -0,0 +1,1332 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.Patch; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.awsconnector.fluent.ElasticLoadBalancingv2TargetHealthDescriptionsClient; +import com.azure.resourcemanager.awsconnector.fluent.models.ElasticLoadBalancingv2TargetHealthDescriptionInner; +import com.azure.resourcemanager.awsconnector.models.ElasticLoadBalancingv2TargetHealthDescriptionListResult; +import com.azure.resourcemanager.awsconnector.models.ElasticLoadBalancingv2TargetHealthDescriptionTagsUpdate; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in + * ElasticLoadBalancingv2TargetHealthDescriptionsClient. + */ +public final class ElasticLoadBalancingv2TargetHealthDescriptionsClientImpl + implements ElasticLoadBalancingv2TargetHealthDescriptionsClient { + /** + * The proxy service used to perform REST calls. + */ + private final ElasticLoadBalancingv2TargetHealthDescriptionsService service; + + /** + * The service client containing this operation class. + */ + private final MicrosoftAwsConnectorImpl client; + + /** + * Initializes an instance of ElasticLoadBalancingv2TargetHealthDescriptionsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + ElasticLoadBalancingv2TargetHealthDescriptionsClientImpl(MicrosoftAwsConnectorImpl client) { + this.service = RestProxy.create(ElasticLoadBalancingv2TargetHealthDescriptionsService.class, + client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for MicrosoftAwsConnectorElasticLoadBalancingv2TargetHealthDescriptions + * to be used by the proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "MicrosoftAwsConnecto") + public interface ElasticLoadBalancingv2TargetHealthDescriptionsService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.AwsConnector/elasticLoadBalancingV2TargetHealthDescriptions") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/elasticLoadBalancingV2TargetHealthDescriptions") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroup( + @HostParam("$host") String endpoint, @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/elasticLoadBalancingV2TargetHealthDescriptions/{name}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getByResourceGroup( + @HostParam("$host") String endpoint, @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("name") String name, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/elasticLoadBalancingV2TargetHealthDescriptions/{name}") + @ExpectedResponses({ 200, 201 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrReplace(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("name") String name, + @BodyParam("application/json") ElasticLoadBalancingv2TargetHealthDescriptionInner resource, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/elasticLoadBalancingV2TargetHealthDescriptions/{name}") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> update(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("name") String name, + @BodyParam("application/json") ElasticLoadBalancingv2TargetHealthDescriptionTagsUpdate properties, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/elasticLoadBalancingV2TargetHealthDescriptions/{name}") + @ExpectedResponses({ 202, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("name") String name, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listBySubscriptionNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroupNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); + } + + /** + * List ElasticLoadBalancingv2TargetHealthDescription resources by subscription ID. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a ElasticLoadBalancingv2TargetHealthDescription list operation along with + * {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync() { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), accept, context)) + .>map( + res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List ElasticLoadBalancingv2TargetHealthDescription resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a ElasticLoadBalancingv2TargetHealthDescription list operation along with + * {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> + listSinglePageAsync(Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), accept, + context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * List ElasticLoadBalancingv2TargetHealthDescription resources by subscription ID. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a ElasticLoadBalancingv2TargetHealthDescription list operation as paginated response with + * {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>(() -> listSinglePageAsync(), + nextLink -> listBySubscriptionNextSinglePageAsync(nextLink)); + } + + /** + * List ElasticLoadBalancingv2TargetHealthDescription resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a ElasticLoadBalancingv2TargetHealthDescription list operation as paginated response with + * {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(Context context) { + return new PagedFlux<>(() -> listSinglePageAsync(context), + nextLink -> listBySubscriptionNextSinglePageAsync(nextLink, context)); + } + + /** + * List ElasticLoadBalancingv2TargetHealthDescription resources by subscription ID. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a ElasticLoadBalancingv2TargetHealthDescription list operation as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + return new PagedIterable<>(listAsync()); + } + + /** + * List ElasticLoadBalancingv2TargetHealthDescription resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a ElasticLoadBalancingv2TargetHealthDescription list operation as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Context context) { + return new PagedIterable<>(listAsync(context)); + } + + /** + * List ElasticLoadBalancingv2TargetHealthDescription resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a ElasticLoadBalancingv2TargetHealthDescription list operation along with + * {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> + listByResourceGroupSinglePageAsync(String resourceGroupName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accept, context)) + .>map( + res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List ElasticLoadBalancingv2TargetHealthDescription resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a ElasticLoadBalancingv2TargetHealthDescription list operation along with + * {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> + listByResourceGroupSinglePageAsync(String resourceGroupName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * List ElasticLoadBalancingv2TargetHealthDescription resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a ElasticLoadBalancingv2TargetHealthDescription list operation as paginated response with + * {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux + listByResourceGroupAsync(String resourceGroupName) { + return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); + } + + /** + * List ElasticLoadBalancingv2TargetHealthDescription resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a ElasticLoadBalancingv2TargetHealthDescription list operation as paginated response with + * {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux + listByResourceGroupAsync(String resourceGroupName, Context context) { + return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName, context), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink, context)); + } + + /** + * List ElasticLoadBalancingv2TargetHealthDescription resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a ElasticLoadBalancingv2TargetHealthDescription list operation as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable + listByResourceGroup(String resourceGroupName) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName)); + } + + /** + * List ElasticLoadBalancingv2TargetHealthDescription resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a ElasticLoadBalancingv2TargetHealthDescription list operation as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable + listByResourceGroup(String resourceGroupName, Context context) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, context)); + } + + /** + * Get a ElasticLoadBalancingv2TargetHealthDescription. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ElasticLoadBalancingv2TargetHealthDescription. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a ElasticLoadBalancingv2TargetHealthDescription along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> + getByResourceGroupWithResponseAsync(String resourceGroupName, String name) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.getByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get a ElasticLoadBalancingv2TargetHealthDescription. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ElasticLoadBalancingv2TargetHealthDescription. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a ElasticLoadBalancingv2TargetHealthDescription along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> + getByResourceGroupWithResponseAsync(String resourceGroupName, String name, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.getByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, accept, context); + } + + /** + * Get a ElasticLoadBalancingv2TargetHealthDescription. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ElasticLoadBalancingv2TargetHealthDescription. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a ElasticLoadBalancingv2TargetHealthDescription on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getByResourceGroupAsync(String resourceGroupName, + String name) { + return getByResourceGroupWithResponseAsync(resourceGroupName, name) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Get a ElasticLoadBalancingv2TargetHealthDescription. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ElasticLoadBalancingv2TargetHealthDescription. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a ElasticLoadBalancingv2TargetHealthDescription along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response + getByResourceGroupWithResponse(String resourceGroupName, String name, Context context) { + return getByResourceGroupWithResponseAsync(resourceGroupName, name, context).block(); + } + + /** + * Get a ElasticLoadBalancingv2TargetHealthDescription. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ElasticLoadBalancingv2TargetHealthDescription. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a ElasticLoadBalancingv2TargetHealthDescription. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ElasticLoadBalancingv2TargetHealthDescriptionInner getByResourceGroup(String resourceGroupName, + String name) { + return getByResourceGroupWithResponse(resourceGroupName, name, Context.NONE).getValue(); + } + + /** + * Create a ElasticLoadBalancingv2TargetHealthDescription. Please note that end user resource creation is currently + * restricted, but it will be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ElasticLoadBalancingv2TargetHealthDescription. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrReplaceWithResponseAsync(String resourceGroupName, String name, + ElasticLoadBalancingv2TargetHealthDescriptionInner resource) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (resource == null) { + return Mono.error(new IllegalArgumentException("Parameter resource is required and cannot be null.")); + } else { + resource.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.createOrReplace(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, resource, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Create a ElasticLoadBalancingv2TargetHealthDescription. Please note that end user resource creation is currently + * restricted, but it will be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ElasticLoadBalancingv2TargetHealthDescription. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrReplaceWithResponseAsync(String resourceGroupName, String name, + ElasticLoadBalancingv2TargetHealthDescriptionInner resource, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (resource == null) { + return Mono.error(new IllegalArgumentException("Parameter resource is required and cannot be null.")); + } else { + resource.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.createOrReplace(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, resource, accept, context); + } + + /** + * Create a ElasticLoadBalancingv2TargetHealthDescription. Please note that end user resource creation is currently + * restricted, but it will be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ElasticLoadBalancingv2TargetHealthDescription. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private + PollerFlux, ElasticLoadBalancingv2TargetHealthDescriptionInner> + beginCreateOrReplaceAsync(String resourceGroupName, String name, + ElasticLoadBalancingv2TargetHealthDescriptionInner resource) { + Mono>> mono = createOrReplaceWithResponseAsync(resourceGroupName, name, resource); + return this.client + .getLroResult( + mono, this.client.getHttpPipeline(), ElasticLoadBalancingv2TargetHealthDescriptionInner.class, + ElasticLoadBalancingv2TargetHealthDescriptionInner.class, this.client.getContext()); + } + + /** + * Create a ElasticLoadBalancingv2TargetHealthDescription. Please note that end user resource creation is currently + * restricted, but it will be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ElasticLoadBalancingv2TargetHealthDescription. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private + PollerFlux, ElasticLoadBalancingv2TargetHealthDescriptionInner> + beginCreateOrReplaceAsync(String resourceGroupName, String name, + ElasticLoadBalancingv2TargetHealthDescriptionInner resource, Context context) { + context = this.client.mergeContext(context); + Mono>> mono + = createOrReplaceWithResponseAsync(resourceGroupName, name, resource, context); + return this.client + .getLroResult( + mono, this.client.getHttpPipeline(), ElasticLoadBalancingv2TargetHealthDescriptionInner.class, + ElasticLoadBalancingv2TargetHealthDescriptionInner.class, context); + } + + /** + * Create a ElasticLoadBalancingv2TargetHealthDescription. Please note that end user resource creation is currently + * restricted, but it will be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ElasticLoadBalancingv2TargetHealthDescription. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public + SyncPoller, ElasticLoadBalancingv2TargetHealthDescriptionInner> + beginCreateOrReplace(String resourceGroupName, String name, + ElasticLoadBalancingv2TargetHealthDescriptionInner resource) { + return this.beginCreateOrReplaceAsync(resourceGroupName, name, resource).getSyncPoller(); + } + + /** + * Create a ElasticLoadBalancingv2TargetHealthDescription. Please note that end user resource creation is currently + * restricted, but it will be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ElasticLoadBalancingv2TargetHealthDescription. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public + SyncPoller, ElasticLoadBalancingv2TargetHealthDescriptionInner> + beginCreateOrReplace(String resourceGroupName, String name, + ElasticLoadBalancingv2TargetHealthDescriptionInner resource, Context context) { + return this.beginCreateOrReplaceAsync(resourceGroupName, name, resource, context).getSyncPoller(); + } + + /** + * Create a ElasticLoadBalancingv2TargetHealthDescription. Please note that end user resource creation is currently + * restricted, but it will be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ElasticLoadBalancingv2TargetHealthDescription. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrReplaceAsync(String resourceGroupName, + String name, ElasticLoadBalancingv2TargetHealthDescriptionInner resource) { + return beginCreateOrReplaceAsync(resourceGroupName, name, resource).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create a ElasticLoadBalancingv2TargetHealthDescription. Please note that end user resource creation is currently + * restricted, but it will be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ElasticLoadBalancingv2TargetHealthDescription. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrReplaceAsync(String resourceGroupName, + String name, ElasticLoadBalancingv2TargetHealthDescriptionInner resource, Context context) { + return beginCreateOrReplaceAsync(resourceGroupName, name, resource, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create a ElasticLoadBalancingv2TargetHealthDescription. Please note that end user resource creation is currently + * restricted, but it will be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ElasticLoadBalancingv2TargetHealthDescription. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ElasticLoadBalancingv2TargetHealthDescriptionInner createOrReplace(String resourceGroupName, String name, + ElasticLoadBalancingv2TargetHealthDescriptionInner resource) { + return createOrReplaceAsync(resourceGroupName, name, resource).block(); + } + + /** + * Create a ElasticLoadBalancingv2TargetHealthDescription. Please note that end user resource creation is currently + * restricted, but it will be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ElasticLoadBalancingv2TargetHealthDescription. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ElasticLoadBalancingv2TargetHealthDescriptionInner createOrReplace(String resourceGroupName, String name, + ElasticLoadBalancingv2TargetHealthDescriptionInner resource, Context context) { + return createOrReplaceAsync(resourceGroupName, name, resource, context).block(); + } + + /** + * Update a ElasticLoadBalancingv2TargetHealthDescription. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ElasticLoadBalancingv2TargetHealthDescription. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync(String resourceGroupName, String name, + ElasticLoadBalancingv2TargetHealthDescriptionTagsUpdate properties) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (properties == null) { + return Mono.error(new IllegalArgumentException("Parameter properties is required and cannot be null.")); + } else { + properties.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.update(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, properties, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Update a ElasticLoadBalancingv2TargetHealthDescription. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ElasticLoadBalancingv2TargetHealthDescription. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync(String resourceGroupName, String name, + ElasticLoadBalancingv2TargetHealthDescriptionTagsUpdate properties, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (properties == null) { + return Mono.error(new IllegalArgumentException("Parameter properties is required and cannot be null.")); + } else { + properties.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.update(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, name, properties, accept, context); + } + + /** + * Update a ElasticLoadBalancingv2TargetHealthDescription. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ElasticLoadBalancingv2TargetHealthDescription. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private + PollerFlux, ElasticLoadBalancingv2TargetHealthDescriptionInner> + beginUpdateAsync(String resourceGroupName, String name, + ElasticLoadBalancingv2TargetHealthDescriptionTagsUpdate properties) { + Mono>> mono = updateWithResponseAsync(resourceGroupName, name, properties); + return this.client + .getLroResult( + mono, this.client.getHttpPipeline(), ElasticLoadBalancingv2TargetHealthDescriptionInner.class, + ElasticLoadBalancingv2TargetHealthDescriptionInner.class, this.client.getContext()); + } + + /** + * Update a ElasticLoadBalancingv2TargetHealthDescription. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ElasticLoadBalancingv2TargetHealthDescription. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private + PollerFlux, ElasticLoadBalancingv2TargetHealthDescriptionInner> + beginUpdateAsync(String resourceGroupName, String name, + ElasticLoadBalancingv2TargetHealthDescriptionTagsUpdate properties, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = updateWithResponseAsync(resourceGroupName, name, properties, context); + return this.client + .getLroResult( + mono, this.client.getHttpPipeline(), ElasticLoadBalancingv2TargetHealthDescriptionInner.class, + ElasticLoadBalancingv2TargetHealthDescriptionInner.class, context); + } + + /** + * Update a ElasticLoadBalancingv2TargetHealthDescription. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ElasticLoadBalancingv2TargetHealthDescription. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public + SyncPoller, ElasticLoadBalancingv2TargetHealthDescriptionInner> + beginUpdate(String resourceGroupName, String name, + ElasticLoadBalancingv2TargetHealthDescriptionTagsUpdate properties) { + return this.beginUpdateAsync(resourceGroupName, name, properties).getSyncPoller(); + } + + /** + * Update a ElasticLoadBalancingv2TargetHealthDescription. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ElasticLoadBalancingv2TargetHealthDescription. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public + SyncPoller, ElasticLoadBalancingv2TargetHealthDescriptionInner> + beginUpdate(String resourceGroupName, String name, + ElasticLoadBalancingv2TargetHealthDescriptionTagsUpdate properties, Context context) { + return this.beginUpdateAsync(resourceGroupName, name, properties, context).getSyncPoller(); + } + + /** + * Update a ElasticLoadBalancingv2TargetHealthDescription. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ElasticLoadBalancingv2TargetHealthDescription. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync(String resourceGroupName, String name, + ElasticLoadBalancingv2TargetHealthDescriptionTagsUpdate properties) { + return beginUpdateAsync(resourceGroupName, name, properties).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Update a ElasticLoadBalancingv2TargetHealthDescription. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ElasticLoadBalancingv2TargetHealthDescription. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync(String resourceGroupName, String name, + ElasticLoadBalancingv2TargetHealthDescriptionTagsUpdate properties, Context context) { + return beginUpdateAsync(resourceGroupName, name, properties, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Update a ElasticLoadBalancingv2TargetHealthDescription. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ElasticLoadBalancingv2TargetHealthDescription. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ElasticLoadBalancingv2TargetHealthDescriptionInner update(String resourceGroupName, String name, + ElasticLoadBalancingv2TargetHealthDescriptionTagsUpdate properties) { + return updateAsync(resourceGroupName, name, properties).block(); + } + + /** + * Update a ElasticLoadBalancingv2TargetHealthDescription. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ElasticLoadBalancingv2TargetHealthDescription. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ElasticLoadBalancingv2TargetHealthDescriptionInner update(String resourceGroupName, String name, + ElasticLoadBalancingv2TargetHealthDescriptionTagsUpdate properties, Context context) { + return updateAsync(resourceGroupName, name, properties, context).block(); + } + + /** + * Delete a ElasticLoadBalancingv2TargetHealthDescription. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ElasticLoadBalancingv2TargetHealthDescription. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync(String resourceGroupName, String name) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Delete a ElasticLoadBalancingv2TargetHealthDescription. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ElasticLoadBalancingv2TargetHealthDescription. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync(String resourceGroupName, String name, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.delete(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, name, accept, context); + } + + /** + * Delete a ElasticLoadBalancingv2TargetHealthDescription. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ElasticLoadBalancingv2TargetHealthDescription. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String name) { + Mono>> mono = deleteWithResponseAsync(resourceGroupName, name); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); + } + + /** + * Delete a ElasticLoadBalancingv2TargetHealthDescription. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ElasticLoadBalancingv2TargetHealthDescription. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String name, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = deleteWithResponseAsync(resourceGroupName, name, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + context); + } + + /** + * Delete a ElasticLoadBalancingv2TargetHealthDescription. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ElasticLoadBalancingv2TargetHealthDescription. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String name) { + return this.beginDeleteAsync(resourceGroupName, name).getSyncPoller(); + } + + /** + * Delete a ElasticLoadBalancingv2TargetHealthDescription. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ElasticLoadBalancingv2TargetHealthDescription. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String name, Context context) { + return this.beginDeleteAsync(resourceGroupName, name, context).getSyncPoller(); + } + + /** + * Delete a ElasticLoadBalancingv2TargetHealthDescription. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ElasticLoadBalancingv2TargetHealthDescription. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String name) { + return beginDeleteAsync(resourceGroupName, name).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete a ElasticLoadBalancingv2TargetHealthDescription. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ElasticLoadBalancingv2TargetHealthDescription. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String name, Context context) { + return beginDeleteAsync(resourceGroupName, name, context).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete a ElasticLoadBalancingv2TargetHealthDescription. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ElasticLoadBalancingv2TargetHealthDescription. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String name) { + deleteAsync(resourceGroupName, name).block(); + } + + /** + * Delete a ElasticLoadBalancingv2TargetHealthDescription. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ElasticLoadBalancingv2TargetHealthDescription. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String name, Context context) { + deleteAsync(resourceGroupName, name, context).block(); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a ElasticLoadBalancingv2TargetHealthDescription list operation along with + * {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> + listBySubscriptionNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a ElasticLoadBalancingv2TargetHealthDescription list operation along with + * {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> + listBySubscriptionNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a ElasticLoadBalancingv2TargetHealthDescription list operation along with + * {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> + listByResourceGroupNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a ElasticLoadBalancingv2TargetHealthDescription list operation along with + * {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> + listByResourceGroupNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/ElasticLoadBalancingv2TargetHealthDescriptionsImpl.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/ElasticLoadBalancingv2TargetHealthDescriptionsImpl.java new file mode 100644 index 000000000000..ed067f6a7a8f --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/ElasticLoadBalancingv2TargetHealthDescriptionsImpl.java @@ -0,0 +1,161 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.awsconnector.fluent.ElasticLoadBalancingv2TargetHealthDescriptionsClient; +import com.azure.resourcemanager.awsconnector.fluent.models.ElasticLoadBalancingv2TargetHealthDescriptionInner; +import com.azure.resourcemanager.awsconnector.models.ElasticLoadBalancingv2TargetHealthDescription; +import com.azure.resourcemanager.awsconnector.models.ElasticLoadBalancingv2TargetHealthDescriptions; + +public final class ElasticLoadBalancingv2TargetHealthDescriptionsImpl + implements ElasticLoadBalancingv2TargetHealthDescriptions { + private static final ClientLogger LOGGER + = new ClientLogger(ElasticLoadBalancingv2TargetHealthDescriptionsImpl.class); + + private final ElasticLoadBalancingv2TargetHealthDescriptionsClient innerClient; + + private final com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager; + + public ElasticLoadBalancingv2TargetHealthDescriptionsImpl( + ElasticLoadBalancingv2TargetHealthDescriptionsClient innerClient, + com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return ResourceManagerUtils.mapPage(inner, + inner1 -> new ElasticLoadBalancingv2TargetHealthDescriptionImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return ResourceManagerUtils.mapPage(inner, + inner1 -> new ElasticLoadBalancingv2TargetHealthDescriptionImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName) { + PagedIterable inner + = this.serviceClient().listByResourceGroup(resourceGroupName); + return ResourceManagerUtils.mapPage(inner, + inner1 -> new ElasticLoadBalancingv2TargetHealthDescriptionImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName, + Context context) { + PagedIterable inner + = this.serviceClient().listByResourceGroup(resourceGroupName, context); + return ResourceManagerUtils.mapPage(inner, + inner1 -> new ElasticLoadBalancingv2TargetHealthDescriptionImpl(inner1, this.manager())); + } + + public Response + getByResourceGroupWithResponse(String resourceGroupName, String name, Context context) { + Response inner + = this.serviceClient().getByResourceGroupWithResponse(resourceGroupName, name, context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new ElasticLoadBalancingv2TargetHealthDescriptionImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public ElasticLoadBalancingv2TargetHealthDescription getByResourceGroup(String resourceGroupName, String name) { + ElasticLoadBalancingv2TargetHealthDescriptionInner inner + = this.serviceClient().getByResourceGroup(resourceGroupName, name); + if (inner != null) { + return new ElasticLoadBalancingv2TargetHealthDescriptionImpl(inner, this.manager()); + } else { + return null; + } + } + + public void deleteByResourceGroup(String resourceGroupName, String name) { + this.serviceClient().delete(resourceGroupName, name); + } + + public void delete(String resourceGroupName, String name, Context context) { + this.serviceClient().delete(resourceGroupName, name, context); + } + + public ElasticLoadBalancingv2TargetHealthDescription getById(String id) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String name = ResourceManagerUtils.getValueFromIdByName(id, "elasticLoadBalancingV2TargetHealthDescriptions"); + if (name == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException(String.format( + "The resource ID '%s' is not valid. Missing path segment 'elasticLoadBalancingV2TargetHealthDescriptions'.", + id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, name, Context.NONE).getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String name = ResourceManagerUtils.getValueFromIdByName(id, "elasticLoadBalancingV2TargetHealthDescriptions"); + if (name == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException(String.format( + "The resource ID '%s' is not valid. Missing path segment 'elasticLoadBalancingV2TargetHealthDescriptions'.", + id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, name, context); + } + + public void deleteById(String id) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String name = ResourceManagerUtils.getValueFromIdByName(id, "elasticLoadBalancingV2TargetHealthDescriptions"); + if (name == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException(String.format( + "The resource ID '%s' is not valid. Missing path segment 'elasticLoadBalancingV2TargetHealthDescriptions'.", + id))); + } + this.delete(resourceGroupName, name, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String name = ResourceManagerUtils.getValueFromIdByName(id, "elasticLoadBalancingV2TargetHealthDescriptions"); + if (name == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException(String.format( + "The resource ID '%s' is not valid. Missing path segment 'elasticLoadBalancingV2TargetHealthDescriptions'.", + id))); + } + this.delete(resourceGroupName, name, context); + } + + private ElasticLoadBalancingv2TargetHealthDescriptionsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.awsconnector.AwsconnectorManager manager() { + return this.serviceManager; + } + + public ElasticLoadBalancingv2TargetHealthDescriptionImpl define(String name) { + return new ElasticLoadBalancingv2TargetHealthDescriptionImpl(name, this.manager()); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/EmrClusterImpl.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/EmrClusterImpl.java new file mode 100644 index 000000000000..e4688f602c00 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/EmrClusterImpl.java @@ -0,0 +1,177 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.implementation; + +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.awsconnector.fluent.models.EmrClusterInner; +import com.azure.resourcemanager.awsconnector.models.EmrCluster; +import com.azure.resourcemanager.awsconnector.models.EmrClusterProperties; +import com.azure.resourcemanager.awsconnector.models.EmrClusterTagsUpdate; +import java.util.Collections; +import java.util.Map; + +public final class EmrClusterImpl implements EmrCluster, EmrCluster.Definition, EmrCluster.Update { + private EmrClusterInner innerObject; + + private final com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public String location() { + return this.innerModel().location(); + } + + public Map tags() { + Map inner = this.innerModel().tags(); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } + } + + public EmrClusterProperties properties() { + return this.innerModel().properties(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public String resourceGroupName() { + return resourceGroupName; + } + + public EmrClusterInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.awsconnector.AwsconnectorManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String name; + + private EmrClusterTagsUpdate updateProperties; + + public EmrClusterImpl withExistingResourceGroup(String resourceGroupName) { + this.resourceGroupName = resourceGroupName; + return this; + } + + public EmrCluster create() { + this.innerObject = serviceManager.serviceClient() + .getEmrClusters() + .createOrReplace(resourceGroupName, name, this.innerModel(), Context.NONE); + return this; + } + + public EmrCluster create(Context context) { + this.innerObject = serviceManager.serviceClient() + .getEmrClusters() + .createOrReplace(resourceGroupName, name, this.innerModel(), context); + return this; + } + + EmrClusterImpl(String name, com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager) { + this.innerObject = new EmrClusterInner(); + this.serviceManager = serviceManager; + this.name = name; + } + + public EmrClusterImpl update() { + this.updateProperties = new EmrClusterTagsUpdate(); + return this; + } + + public EmrCluster apply() { + this.innerObject = serviceManager.serviceClient() + .getEmrClusters() + .update(resourceGroupName, name, updateProperties, Context.NONE); + return this; + } + + public EmrCluster apply(Context context) { + this.innerObject = serviceManager.serviceClient() + .getEmrClusters() + .update(resourceGroupName, name, updateProperties, context); + return this; + } + + EmrClusterImpl(EmrClusterInner innerObject, + com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.name = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "emrClusters"); + } + + public EmrCluster refresh() { + this.innerObject = serviceManager.serviceClient() + .getEmrClusters() + .getByResourceGroupWithResponse(resourceGroupName, name, Context.NONE) + .getValue(); + return this; + } + + public EmrCluster refresh(Context context) { + this.innerObject = serviceManager.serviceClient() + .getEmrClusters() + .getByResourceGroupWithResponse(resourceGroupName, name, context) + .getValue(); + return this; + } + + public EmrClusterImpl withRegion(Region location) { + this.innerModel().withLocation(location.toString()); + return this; + } + + public EmrClusterImpl withRegion(String location) { + this.innerModel().withLocation(location); + return this; + } + + public EmrClusterImpl withTags(Map tags) { + if (isInCreateMode()) { + this.innerModel().withTags(tags); + return this; + } else { + this.updateProperties.withTags(tags); + return this; + } + } + + public EmrClusterImpl withProperties(EmrClusterProperties properties) { + this.innerModel().withProperties(properties); + return this; + } + + private boolean isInCreateMode() { + return this.innerModel().id() == null; + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/EmrClusterSummariesClientImpl.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/EmrClusterSummariesClientImpl.java new file mode 100644 index 000000000000..a5cb824306d8 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/EmrClusterSummariesClientImpl.java @@ -0,0 +1,1282 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.Patch; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.awsconnector.fluent.EmrClusterSummariesClient; +import com.azure.resourcemanager.awsconnector.fluent.models.EmrClusterSummaryInner; +import com.azure.resourcemanager.awsconnector.models.EmrClusterSummaryListResult; +import com.azure.resourcemanager.awsconnector.models.EmrClusterSummaryTagsUpdate; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in EmrClusterSummariesClient. + */ +public final class EmrClusterSummariesClientImpl implements EmrClusterSummariesClient { + /** + * The proxy service used to perform REST calls. + */ + private final EmrClusterSummariesService service; + + /** + * The service client containing this operation class. + */ + private final MicrosoftAwsConnectorImpl client; + + /** + * Initializes an instance of EmrClusterSummariesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + EmrClusterSummariesClientImpl(MicrosoftAwsConnectorImpl client) { + this.service = RestProxy.create(EmrClusterSummariesService.class, client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for MicrosoftAwsConnectorEmrClusterSummaries to be used by the proxy + * service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "MicrosoftAwsConnecto") + public interface EmrClusterSummariesService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.AwsConnector/emrClusterSummaries") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/emrClusterSummaries") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroup(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/emrClusterSummaries/{name}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getByResourceGroup(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("name") String name, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/emrClusterSummaries/{name}") + @ExpectedResponses({ 200, 201 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrReplace(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("name") String name, + @BodyParam("application/json") EmrClusterSummaryInner resource, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/emrClusterSummaries/{name}") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> update(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("name") String name, + @BodyParam("application/json") EmrClusterSummaryTagsUpdate properties, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/emrClusterSummaries/{name}") + @ExpectedResponses({ 202, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("name") String name, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listBySubscriptionNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroupNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); + } + + /** + * List EmrClusterSummary resources by subscription ID. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a EmrClusterSummary list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync() { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List EmrClusterSummary resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a EmrClusterSummary list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), accept, + context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * List EmrClusterSummary resources by subscription ID. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a EmrClusterSummary list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>(() -> listSinglePageAsync(), + nextLink -> listBySubscriptionNextSinglePageAsync(nextLink)); + } + + /** + * List EmrClusterSummary resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a EmrClusterSummary list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(Context context) { + return new PagedFlux<>(() -> listSinglePageAsync(context), + nextLink -> listBySubscriptionNextSinglePageAsync(nextLink, context)); + } + + /** + * List EmrClusterSummary resources by subscription ID. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a EmrClusterSummary list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + return new PagedIterable<>(listAsync()); + } + + /** + * List EmrClusterSummary resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a EmrClusterSummary list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Context context) { + return new PagedIterable<>(listAsync(context)); + } + + /** + * List EmrClusterSummary resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a EmrClusterSummary list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List EmrClusterSummary resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a EmrClusterSummary list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * List EmrClusterSummary resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a EmrClusterSummary list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName) { + return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); + } + + /** + * List EmrClusterSummary resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a EmrClusterSummary list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName, Context context) { + return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName, context), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink, context)); + } + + /** + * List EmrClusterSummary resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a EmrClusterSummary list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName)); + } + + /** + * List EmrClusterSummary resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a EmrClusterSummary list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, context)); + } + + /** + * Get a EmrClusterSummary. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of EmrClusterSummary. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a EmrClusterSummary along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync(String resourceGroupName, + String name) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.getByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get a EmrClusterSummary. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of EmrClusterSummary. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a EmrClusterSummary along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync(String resourceGroupName, + String name, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.getByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, accept, context); + } + + /** + * Get a EmrClusterSummary. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of EmrClusterSummary. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a EmrClusterSummary on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getByResourceGroupAsync(String resourceGroupName, String name) { + return getByResourceGroupWithResponseAsync(resourceGroupName, name) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Get a EmrClusterSummary. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of EmrClusterSummary. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a EmrClusterSummary along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getByResourceGroupWithResponse(String resourceGroupName, String name, + Context context) { + return getByResourceGroupWithResponseAsync(resourceGroupName, name, context).block(); + } + + /** + * Get a EmrClusterSummary. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of EmrClusterSummary. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a EmrClusterSummary. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public EmrClusterSummaryInner getByResourceGroup(String resourceGroupName, String name) { + return getByResourceGroupWithResponse(resourceGroupName, name, Context.NONE).getValue(); + } + + /** + * Create a EmrClusterSummary. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of EmrClusterSummary. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrReplaceWithResponseAsync(String resourceGroupName, String name, + EmrClusterSummaryInner resource) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (resource == null) { + return Mono.error(new IllegalArgumentException("Parameter resource is required and cannot be null.")); + } else { + resource.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.createOrReplace(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, resource, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Create a EmrClusterSummary. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of EmrClusterSummary. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrReplaceWithResponseAsync(String resourceGroupName, String name, + EmrClusterSummaryInner resource, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (resource == null) { + return Mono.error(new IllegalArgumentException("Parameter resource is required and cannot be null.")); + } else { + resource.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.createOrReplace(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, resource, accept, context); + } + + /** + * Create a EmrClusterSummary. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of EmrClusterSummary. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, EmrClusterSummaryInner> + beginCreateOrReplaceAsync(String resourceGroupName, String name, EmrClusterSummaryInner resource) { + Mono>> mono = createOrReplaceWithResponseAsync(resourceGroupName, name, resource); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), EmrClusterSummaryInner.class, EmrClusterSummaryInner.class, + this.client.getContext()); + } + + /** + * Create a EmrClusterSummary. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of EmrClusterSummary. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, EmrClusterSummaryInner> beginCreateOrReplaceAsync( + String resourceGroupName, String name, EmrClusterSummaryInner resource, Context context) { + context = this.client.mergeContext(context); + Mono>> mono + = createOrReplaceWithResponseAsync(resourceGroupName, name, resource, context); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), EmrClusterSummaryInner.class, EmrClusterSummaryInner.class, context); + } + + /** + * Create a EmrClusterSummary. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of EmrClusterSummary. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, EmrClusterSummaryInner> + beginCreateOrReplace(String resourceGroupName, String name, EmrClusterSummaryInner resource) { + return this.beginCreateOrReplaceAsync(resourceGroupName, name, resource).getSyncPoller(); + } + + /** + * Create a EmrClusterSummary. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of EmrClusterSummary. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, EmrClusterSummaryInner> + beginCreateOrReplace(String resourceGroupName, String name, EmrClusterSummaryInner resource, Context context) { + return this.beginCreateOrReplaceAsync(resourceGroupName, name, resource, context).getSyncPoller(); + } + + /** + * Create a EmrClusterSummary. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of EmrClusterSummary. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrReplaceAsync(String resourceGroupName, String name, + EmrClusterSummaryInner resource) { + return beginCreateOrReplaceAsync(resourceGroupName, name, resource).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create a EmrClusterSummary. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of EmrClusterSummary. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrReplaceAsync(String resourceGroupName, String name, + EmrClusterSummaryInner resource, Context context) { + return beginCreateOrReplaceAsync(resourceGroupName, name, resource, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create a EmrClusterSummary. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of EmrClusterSummary. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public EmrClusterSummaryInner createOrReplace(String resourceGroupName, String name, + EmrClusterSummaryInner resource) { + return createOrReplaceAsync(resourceGroupName, name, resource).block(); + } + + /** + * Create a EmrClusterSummary. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of EmrClusterSummary. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public EmrClusterSummaryInner createOrReplace(String resourceGroupName, String name, + EmrClusterSummaryInner resource, Context context) { + return createOrReplaceAsync(resourceGroupName, name, resource, context).block(); + } + + /** + * Update a EmrClusterSummary. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of EmrClusterSummary. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync(String resourceGroupName, String name, + EmrClusterSummaryTagsUpdate properties) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (properties == null) { + return Mono.error(new IllegalArgumentException("Parameter properties is required and cannot be null.")); + } else { + properties.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.update(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, properties, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Update a EmrClusterSummary. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of EmrClusterSummary. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync(String resourceGroupName, String name, + EmrClusterSummaryTagsUpdate properties, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (properties == null) { + return Mono.error(new IllegalArgumentException("Parameter properties is required and cannot be null.")); + } else { + properties.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.update(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, name, properties, accept, context); + } + + /** + * Update a EmrClusterSummary. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of EmrClusterSummary. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, EmrClusterSummaryInner> + beginUpdateAsync(String resourceGroupName, String name, EmrClusterSummaryTagsUpdate properties) { + Mono>> mono = updateWithResponseAsync(resourceGroupName, name, properties); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), EmrClusterSummaryInner.class, EmrClusterSummaryInner.class, + this.client.getContext()); + } + + /** + * Update a EmrClusterSummary. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of EmrClusterSummary. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, EmrClusterSummaryInner> beginUpdateAsync( + String resourceGroupName, String name, EmrClusterSummaryTagsUpdate properties, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = updateWithResponseAsync(resourceGroupName, name, properties, context); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), EmrClusterSummaryInner.class, EmrClusterSummaryInner.class, context); + } + + /** + * Update a EmrClusterSummary. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of EmrClusterSummary. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, EmrClusterSummaryInner> beginUpdate(String resourceGroupName, + String name, EmrClusterSummaryTagsUpdate properties) { + return this.beginUpdateAsync(resourceGroupName, name, properties).getSyncPoller(); + } + + /** + * Update a EmrClusterSummary. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of EmrClusterSummary. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, EmrClusterSummaryInner> beginUpdate(String resourceGroupName, + String name, EmrClusterSummaryTagsUpdate properties, Context context) { + return this.beginUpdateAsync(resourceGroupName, name, properties, context).getSyncPoller(); + } + + /** + * Update a EmrClusterSummary. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of EmrClusterSummary. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync(String resourceGroupName, String name, + EmrClusterSummaryTagsUpdate properties) { + return beginUpdateAsync(resourceGroupName, name, properties).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Update a EmrClusterSummary. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of EmrClusterSummary. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync(String resourceGroupName, String name, + EmrClusterSummaryTagsUpdate properties, Context context) { + return beginUpdateAsync(resourceGroupName, name, properties, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Update a EmrClusterSummary. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of EmrClusterSummary. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public EmrClusterSummaryInner update(String resourceGroupName, String name, + EmrClusterSummaryTagsUpdate properties) { + return updateAsync(resourceGroupName, name, properties).block(); + } + + /** + * Update a EmrClusterSummary. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of EmrClusterSummary. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public EmrClusterSummaryInner update(String resourceGroupName, String name, EmrClusterSummaryTagsUpdate properties, + Context context) { + return updateAsync(resourceGroupName, name, properties, context).block(); + } + + /** + * Delete a EmrClusterSummary. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of EmrClusterSummary. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync(String resourceGroupName, String name) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Delete a EmrClusterSummary. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of EmrClusterSummary. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync(String resourceGroupName, String name, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.delete(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, name, accept, context); + } + + /** + * Delete a EmrClusterSummary. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of EmrClusterSummary. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String name) { + Mono>> mono = deleteWithResponseAsync(resourceGroupName, name); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); + } + + /** + * Delete a EmrClusterSummary. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of EmrClusterSummary. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String name, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = deleteWithResponseAsync(resourceGroupName, name, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + context); + } + + /** + * Delete a EmrClusterSummary. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of EmrClusterSummary. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String name) { + return this.beginDeleteAsync(resourceGroupName, name).getSyncPoller(); + } + + /** + * Delete a EmrClusterSummary. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of EmrClusterSummary. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String name, Context context) { + return this.beginDeleteAsync(resourceGroupName, name, context).getSyncPoller(); + } + + /** + * Delete a EmrClusterSummary. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of EmrClusterSummary. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String name) { + return beginDeleteAsync(resourceGroupName, name).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete a EmrClusterSummary. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of EmrClusterSummary. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String name, Context context) { + return beginDeleteAsync(resourceGroupName, name, context).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete a EmrClusterSummary. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of EmrClusterSummary. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String name) { + deleteAsync(resourceGroupName, name).block(); + } + + /** + * Delete a EmrClusterSummary. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of EmrClusterSummary. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String name, Context context) { + deleteAsync(resourceGroupName, name, context).block(); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a EmrClusterSummary list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listBySubscriptionNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a EmrClusterSummary list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listBySubscriptionNextSinglePageAsync(String nextLink, + Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a EmrClusterSummary list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a EmrClusterSummary list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupNextSinglePageAsync(String nextLink, + Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/EmrClusterSummariesImpl.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/EmrClusterSummariesImpl.java new file mode 100644 index 000000000000..ac1cfe98fec3 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/EmrClusterSummariesImpl.java @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.awsconnector.fluent.EmrClusterSummariesClient; +import com.azure.resourcemanager.awsconnector.fluent.models.EmrClusterSummaryInner; +import com.azure.resourcemanager.awsconnector.models.EmrClusterSummaries; +import com.azure.resourcemanager.awsconnector.models.EmrClusterSummary; + +public final class EmrClusterSummariesImpl implements EmrClusterSummaries { + private static final ClientLogger LOGGER = new ClientLogger(EmrClusterSummariesImpl.class); + + private final EmrClusterSummariesClient innerClient; + + private final com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager; + + public EmrClusterSummariesImpl(EmrClusterSummariesClient innerClient, + com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return ResourceManagerUtils.mapPage(inner, inner1 -> new EmrClusterSummaryImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new EmrClusterSummaryImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName); + return ResourceManagerUtils.mapPage(inner, inner1 -> new EmrClusterSummaryImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + PagedIterable inner + = this.serviceClient().listByResourceGroup(resourceGroupName, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new EmrClusterSummaryImpl(inner1, this.manager())); + } + + public Response getByResourceGroupWithResponse(String resourceGroupName, String name, + Context context) { + Response inner + = this.serviceClient().getByResourceGroupWithResponse(resourceGroupName, name, context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new EmrClusterSummaryImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public EmrClusterSummary getByResourceGroup(String resourceGroupName, String name) { + EmrClusterSummaryInner inner = this.serviceClient().getByResourceGroup(resourceGroupName, name); + if (inner != null) { + return new EmrClusterSummaryImpl(inner, this.manager()); + } else { + return null; + } + } + + public void deleteByResourceGroup(String resourceGroupName, String name) { + this.serviceClient().delete(resourceGroupName, name); + } + + public void delete(String resourceGroupName, String name, Context context) { + this.serviceClient().delete(resourceGroupName, name, context); + } + + public EmrClusterSummary getById(String id) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String name = ResourceManagerUtils.getValueFromIdByName(id, "emrClusterSummaries"); + if (name == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'emrClusterSummaries'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, name, Context.NONE).getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String name = ResourceManagerUtils.getValueFromIdByName(id, "emrClusterSummaries"); + if (name == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'emrClusterSummaries'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, name, context); + } + + public void deleteById(String id) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String name = ResourceManagerUtils.getValueFromIdByName(id, "emrClusterSummaries"); + if (name == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'emrClusterSummaries'.", id))); + } + this.delete(resourceGroupName, name, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String name = ResourceManagerUtils.getValueFromIdByName(id, "emrClusterSummaries"); + if (name == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'emrClusterSummaries'.", id))); + } + this.delete(resourceGroupName, name, context); + } + + private EmrClusterSummariesClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.awsconnector.AwsconnectorManager manager() { + return this.serviceManager; + } + + public EmrClusterSummaryImpl define(String name) { + return new EmrClusterSummaryImpl(name, this.manager()); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/EmrClusterSummaryImpl.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/EmrClusterSummaryImpl.java new file mode 100644 index 000000000000..4c2c489f0f3b --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/EmrClusterSummaryImpl.java @@ -0,0 +1,178 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.implementation; + +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.awsconnector.fluent.models.EmrClusterSummaryInner; +import com.azure.resourcemanager.awsconnector.models.EmrClusterSummary; +import com.azure.resourcemanager.awsconnector.models.EmrClusterSummaryProperties; +import com.azure.resourcemanager.awsconnector.models.EmrClusterSummaryTagsUpdate; +import java.util.Collections; +import java.util.Map; + +public final class EmrClusterSummaryImpl + implements EmrClusterSummary, EmrClusterSummary.Definition, EmrClusterSummary.Update { + private EmrClusterSummaryInner innerObject; + + private final com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public String location() { + return this.innerModel().location(); + } + + public Map tags() { + Map inner = this.innerModel().tags(); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } + } + + public EmrClusterSummaryProperties properties() { + return this.innerModel().properties(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public String resourceGroupName() { + return resourceGroupName; + } + + public EmrClusterSummaryInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.awsconnector.AwsconnectorManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String name; + + private EmrClusterSummaryTagsUpdate updateProperties; + + public EmrClusterSummaryImpl withExistingResourceGroup(String resourceGroupName) { + this.resourceGroupName = resourceGroupName; + return this; + } + + public EmrClusterSummary create() { + this.innerObject = serviceManager.serviceClient() + .getEmrClusterSummaries() + .createOrReplace(resourceGroupName, name, this.innerModel(), Context.NONE); + return this; + } + + public EmrClusterSummary create(Context context) { + this.innerObject = serviceManager.serviceClient() + .getEmrClusterSummaries() + .createOrReplace(resourceGroupName, name, this.innerModel(), context); + return this; + } + + EmrClusterSummaryImpl(String name, com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager) { + this.innerObject = new EmrClusterSummaryInner(); + this.serviceManager = serviceManager; + this.name = name; + } + + public EmrClusterSummaryImpl update() { + this.updateProperties = new EmrClusterSummaryTagsUpdate(); + return this; + } + + public EmrClusterSummary apply() { + this.innerObject = serviceManager.serviceClient() + .getEmrClusterSummaries() + .update(resourceGroupName, name, updateProperties, Context.NONE); + return this; + } + + public EmrClusterSummary apply(Context context) { + this.innerObject = serviceManager.serviceClient() + .getEmrClusterSummaries() + .update(resourceGroupName, name, updateProperties, context); + return this; + } + + EmrClusterSummaryImpl(EmrClusterSummaryInner innerObject, + com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.name = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "emrClusterSummaries"); + } + + public EmrClusterSummary refresh() { + this.innerObject = serviceManager.serviceClient() + .getEmrClusterSummaries() + .getByResourceGroupWithResponse(resourceGroupName, name, Context.NONE) + .getValue(); + return this; + } + + public EmrClusterSummary refresh(Context context) { + this.innerObject = serviceManager.serviceClient() + .getEmrClusterSummaries() + .getByResourceGroupWithResponse(resourceGroupName, name, context) + .getValue(); + return this; + } + + public EmrClusterSummaryImpl withRegion(Region location) { + this.innerModel().withLocation(location.toString()); + return this; + } + + public EmrClusterSummaryImpl withRegion(String location) { + this.innerModel().withLocation(location); + return this; + } + + public EmrClusterSummaryImpl withTags(Map tags) { + if (isInCreateMode()) { + this.innerModel().withTags(tags); + return this; + } else { + this.updateProperties.withTags(tags); + return this; + } + } + + public EmrClusterSummaryImpl withProperties(EmrClusterSummaryProperties properties) { + this.innerModel().withProperties(properties); + return this; + } + + private boolean isInCreateMode() { + return this.innerModel().id() == null; + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/EmrClustersClientImpl.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/EmrClustersClientImpl.java new file mode 100644 index 000000000000..5664ef0834e9 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/EmrClustersClientImpl.java @@ -0,0 +1,1276 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.Patch; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.awsconnector.fluent.EmrClustersClient; +import com.azure.resourcemanager.awsconnector.fluent.models.EmrClusterInner; +import com.azure.resourcemanager.awsconnector.models.EmrClusterListResult; +import com.azure.resourcemanager.awsconnector.models.EmrClusterTagsUpdate; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in EmrClustersClient. + */ +public final class EmrClustersClientImpl implements EmrClustersClient { + /** + * The proxy service used to perform REST calls. + */ + private final EmrClustersService service; + + /** + * The service client containing this operation class. + */ + private final MicrosoftAwsConnectorImpl client; + + /** + * Initializes an instance of EmrClustersClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + EmrClustersClientImpl(MicrosoftAwsConnectorImpl client) { + this.service + = RestProxy.create(EmrClustersService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for MicrosoftAwsConnectorEmrClusters to be used by the proxy service to + * perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "MicrosoftAwsConnecto") + public interface EmrClustersService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.AwsConnector/emrClusters") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/emrClusters") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroup(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/emrClusters/{name}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getByResourceGroup(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("name") String name, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/emrClusters/{name}") + @ExpectedResponses({ 200, 201 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrReplace(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("name") String name, + @BodyParam("application/json") EmrClusterInner resource, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/emrClusters/{name}") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> update(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("name") String name, + @BodyParam("application/json") EmrClusterTagsUpdate properties, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/emrClusters/{name}") + @ExpectedResponses({ 202, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("name") String name, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listBySubscriptionNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroupNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); + } + + /** + * List EmrCluster resources by subscription ID. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a EmrCluster list operation along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync() { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), + res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List EmrCluster resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a EmrCluster list operation along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), accept, + context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * List EmrCluster resources by subscription ID. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a EmrCluster list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>(() -> listSinglePageAsync(), + nextLink -> listBySubscriptionNextSinglePageAsync(nextLink)); + } + + /** + * List EmrCluster resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a EmrCluster list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(Context context) { + return new PagedFlux<>(() -> listSinglePageAsync(context), + nextLink -> listBySubscriptionNextSinglePageAsync(nextLink, context)); + } + + /** + * List EmrCluster resources by subscription ID. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a EmrCluster list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + return new PagedIterable<>(listAsync()); + } + + /** + * List EmrCluster resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a EmrCluster list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Context context) { + return new PagedIterable<>(listAsync(context)); + } + + /** + * List EmrCluster resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a EmrCluster list operation along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), + res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List EmrCluster resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a EmrCluster list operation along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * List EmrCluster resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a EmrCluster list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName) { + return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); + } + + /** + * List EmrCluster resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a EmrCluster list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName, Context context) { + return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName, context), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink, context)); + } + + /** + * List EmrCluster resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a EmrCluster list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName)); + } + + /** + * List EmrCluster resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a EmrCluster list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, context)); + } + + /** + * Get a EmrCluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of EmrCluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a EmrCluster along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync(String resourceGroupName, String name) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.getByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get a EmrCluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of EmrCluster. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a EmrCluster along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync(String resourceGroupName, String name, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.getByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, accept, context); + } + + /** + * Get a EmrCluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of EmrCluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a EmrCluster on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getByResourceGroupAsync(String resourceGroupName, String name) { + return getByResourceGroupWithResponseAsync(resourceGroupName, name) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Get a EmrCluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of EmrCluster. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a EmrCluster along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getByResourceGroupWithResponse(String resourceGroupName, String name, + Context context) { + return getByResourceGroupWithResponseAsync(resourceGroupName, name, context).block(); + } + + /** + * Get a EmrCluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of EmrCluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a EmrCluster. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public EmrClusterInner getByResourceGroup(String resourceGroupName, String name) { + return getByResourceGroupWithResponse(resourceGroupName, name, Context.NONE).getValue(); + } + + /** + * Create a EmrCluster. Please note that end user resource creation is currently restricted, but it will be enabled + * in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of EmrCluster. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrReplaceWithResponseAsync(String resourceGroupName, String name, + EmrClusterInner resource) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (resource == null) { + return Mono.error(new IllegalArgumentException("Parameter resource is required and cannot be null.")); + } else { + resource.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.createOrReplace(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, resource, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Create a EmrCluster. Please note that end user resource creation is currently restricted, but it will be enabled + * in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of EmrCluster. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrReplaceWithResponseAsync(String resourceGroupName, String name, + EmrClusterInner resource, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (resource == null) { + return Mono.error(new IllegalArgumentException("Parameter resource is required and cannot be null.")); + } else { + resource.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.createOrReplace(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, resource, accept, context); + } + + /** + * Create a EmrCluster. Please note that end user resource creation is currently restricted, but it will be enabled + * in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of EmrCluster. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, EmrClusterInner> beginCreateOrReplaceAsync(String resourceGroupName, + String name, EmrClusterInner resource) { + Mono>> mono = createOrReplaceWithResponseAsync(resourceGroupName, name, resource); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + EmrClusterInner.class, EmrClusterInner.class, this.client.getContext()); + } + + /** + * Create a EmrCluster. Please note that end user resource creation is currently restricted, but it will be enabled + * in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of EmrCluster. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, EmrClusterInner> beginCreateOrReplaceAsync(String resourceGroupName, + String name, EmrClusterInner resource, Context context) { + context = this.client.mergeContext(context); + Mono>> mono + = createOrReplaceWithResponseAsync(resourceGroupName, name, resource, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + EmrClusterInner.class, EmrClusterInner.class, context); + } + + /** + * Create a EmrCluster. Please note that end user resource creation is currently restricted, but it will be enabled + * in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of EmrCluster. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, EmrClusterInner> beginCreateOrReplace(String resourceGroupName, + String name, EmrClusterInner resource) { + return this.beginCreateOrReplaceAsync(resourceGroupName, name, resource).getSyncPoller(); + } + + /** + * Create a EmrCluster. Please note that end user resource creation is currently restricted, but it will be enabled + * in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of EmrCluster. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, EmrClusterInner> beginCreateOrReplace(String resourceGroupName, + String name, EmrClusterInner resource, Context context) { + return this.beginCreateOrReplaceAsync(resourceGroupName, name, resource, context).getSyncPoller(); + } + + /** + * Create a EmrCluster. Please note that end user resource creation is currently restricted, but it will be enabled + * in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of EmrCluster. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrReplaceAsync(String resourceGroupName, String name, + EmrClusterInner resource) { + return beginCreateOrReplaceAsync(resourceGroupName, name, resource).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create a EmrCluster. Please note that end user resource creation is currently restricted, but it will be enabled + * in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of EmrCluster. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrReplaceAsync(String resourceGroupName, String name, EmrClusterInner resource, + Context context) { + return beginCreateOrReplaceAsync(resourceGroupName, name, resource, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create a EmrCluster. Please note that end user resource creation is currently restricted, but it will be enabled + * in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of EmrCluster. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public EmrClusterInner createOrReplace(String resourceGroupName, String name, EmrClusterInner resource) { + return createOrReplaceAsync(resourceGroupName, name, resource).block(); + } + + /** + * Create a EmrCluster. Please note that end user resource creation is currently restricted, but it will be enabled + * in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of EmrCluster. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public EmrClusterInner createOrReplace(String resourceGroupName, String name, EmrClusterInner resource, + Context context) { + return createOrReplaceAsync(resourceGroupName, name, resource, context).block(); + } + + /** + * Update a EmrCluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of EmrCluster. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync(String resourceGroupName, String name, + EmrClusterTagsUpdate properties) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (properties == null) { + return Mono.error(new IllegalArgumentException("Parameter properties is required and cannot be null.")); + } else { + properties.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.update(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, properties, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Update a EmrCluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of EmrCluster. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync(String resourceGroupName, String name, + EmrClusterTagsUpdate properties, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (properties == null) { + return Mono.error(new IllegalArgumentException("Parameter properties is required and cannot be null.")); + } else { + properties.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.update(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, name, properties, accept, context); + } + + /** + * Update a EmrCluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of EmrCluster. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, EmrClusterInner> beginUpdateAsync(String resourceGroupName, + String name, EmrClusterTagsUpdate properties) { + Mono>> mono = updateWithResponseAsync(resourceGroupName, name, properties); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + EmrClusterInner.class, EmrClusterInner.class, this.client.getContext()); + } + + /** + * Update a EmrCluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of EmrCluster. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, EmrClusterInner> beginUpdateAsync(String resourceGroupName, + String name, EmrClusterTagsUpdate properties, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = updateWithResponseAsync(resourceGroupName, name, properties, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + EmrClusterInner.class, EmrClusterInner.class, context); + } + + /** + * Update a EmrCluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of EmrCluster. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, EmrClusterInner> beginUpdate(String resourceGroupName, String name, + EmrClusterTagsUpdate properties) { + return this.beginUpdateAsync(resourceGroupName, name, properties).getSyncPoller(); + } + + /** + * Update a EmrCluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of EmrCluster. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, EmrClusterInner> beginUpdate(String resourceGroupName, String name, + EmrClusterTagsUpdate properties, Context context) { + return this.beginUpdateAsync(resourceGroupName, name, properties, context).getSyncPoller(); + } + + /** + * Update a EmrCluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of EmrCluster. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync(String resourceGroupName, String name, EmrClusterTagsUpdate properties) { + return beginUpdateAsync(resourceGroupName, name, properties).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Update a EmrCluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of EmrCluster. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync(String resourceGroupName, String name, EmrClusterTagsUpdate properties, + Context context) { + return beginUpdateAsync(resourceGroupName, name, properties, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Update a EmrCluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of EmrCluster. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public EmrClusterInner update(String resourceGroupName, String name, EmrClusterTagsUpdate properties) { + return updateAsync(resourceGroupName, name, properties).block(); + } + + /** + * Update a EmrCluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of EmrCluster. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public EmrClusterInner update(String resourceGroupName, String name, EmrClusterTagsUpdate properties, + Context context) { + return updateAsync(resourceGroupName, name, properties, context).block(); + } + + /** + * Delete a EmrCluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of EmrCluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync(String resourceGroupName, String name) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Delete a EmrCluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of EmrCluster. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync(String resourceGroupName, String name, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.delete(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, name, accept, context); + } + + /** + * Delete a EmrCluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of EmrCluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String name) { + Mono>> mono = deleteWithResponseAsync(resourceGroupName, name); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); + } + + /** + * Delete a EmrCluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of EmrCluster. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String name, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = deleteWithResponseAsync(resourceGroupName, name, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + context); + } + + /** + * Delete a EmrCluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of EmrCluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String name) { + return this.beginDeleteAsync(resourceGroupName, name).getSyncPoller(); + } + + /** + * Delete a EmrCluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of EmrCluster. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String name, Context context) { + return this.beginDeleteAsync(resourceGroupName, name, context).getSyncPoller(); + } + + /** + * Delete a EmrCluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of EmrCluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String name) { + return beginDeleteAsync(resourceGroupName, name).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete a EmrCluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of EmrCluster. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String name, Context context) { + return beginDeleteAsync(resourceGroupName, name, context).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete a EmrCluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of EmrCluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String name) { + deleteAsync(resourceGroupName, name).block(); + } + + /** + * Delete a EmrCluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of EmrCluster. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String name, Context context) { + deleteAsync(resourceGroupName, name, context).block(); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a EmrCluster list operation along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listBySubscriptionNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), + res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a EmrCluster list operation along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listBySubscriptionNextSinglePageAsync(String nextLink, + Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a EmrCluster list operation along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), + res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a EmrCluster list operation along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupNextSinglePageAsync(String nextLink, + Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/EmrClustersImpl.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/EmrClustersImpl.java new file mode 100644 index 000000000000..e7f0ae021975 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/EmrClustersImpl.java @@ -0,0 +1,145 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.awsconnector.fluent.EmrClustersClient; +import com.azure.resourcemanager.awsconnector.fluent.models.EmrClusterInner; +import com.azure.resourcemanager.awsconnector.models.EmrCluster; +import com.azure.resourcemanager.awsconnector.models.EmrClusters; + +public final class EmrClustersImpl implements EmrClusters { + private static final ClientLogger LOGGER = new ClientLogger(EmrClustersImpl.class); + + private final EmrClustersClient innerClient; + + private final com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager; + + public EmrClustersImpl(EmrClustersClient innerClient, + com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return ResourceManagerUtils.mapPage(inner, inner1 -> new EmrClusterImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new EmrClusterImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName); + return ResourceManagerUtils.mapPage(inner, inner1 -> new EmrClusterImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new EmrClusterImpl(inner1, this.manager())); + } + + public Response getByResourceGroupWithResponse(String resourceGroupName, String name, Context context) { + Response inner + = this.serviceClient().getByResourceGroupWithResponse(resourceGroupName, name, context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new EmrClusterImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public EmrCluster getByResourceGroup(String resourceGroupName, String name) { + EmrClusterInner inner = this.serviceClient().getByResourceGroup(resourceGroupName, name); + if (inner != null) { + return new EmrClusterImpl(inner, this.manager()); + } else { + return null; + } + } + + public void deleteByResourceGroup(String resourceGroupName, String name) { + this.serviceClient().delete(resourceGroupName, name); + } + + public void delete(String resourceGroupName, String name, Context context) { + this.serviceClient().delete(resourceGroupName, name, context); + } + + public EmrCluster getById(String id) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String name = ResourceManagerUtils.getValueFromIdByName(id, "emrClusters"); + if (name == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'emrClusters'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, name, Context.NONE).getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String name = ResourceManagerUtils.getValueFromIdByName(id, "emrClusters"); + if (name == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'emrClusters'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, name, context); + } + + public void deleteById(String id) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String name = ResourceManagerUtils.getValueFromIdByName(id, "emrClusters"); + if (name == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'emrClusters'.", id))); + } + this.delete(resourceGroupName, name, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String name = ResourceManagerUtils.getValueFromIdByName(id, "emrClusters"); + if (name == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'emrClusters'.", id))); + } + this.delete(resourceGroupName, name, context); + } + + private EmrClustersClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.awsconnector.AwsconnectorManager manager() { + return this.serviceManager; + } + + public EmrClusterImpl define(String name) { + return new EmrClusterImpl(name, this.manager()); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/GuardDutyDetectorImpl.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/GuardDutyDetectorImpl.java new file mode 100644 index 000000000000..0588fc40c2cf --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/GuardDutyDetectorImpl.java @@ -0,0 +1,178 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.implementation; + +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.awsconnector.fluent.models.GuardDutyDetectorInner; +import com.azure.resourcemanager.awsconnector.models.GuardDutyDetector; +import com.azure.resourcemanager.awsconnector.models.GuardDutyDetectorProperties; +import com.azure.resourcemanager.awsconnector.models.GuardDutyDetectorTagsUpdate; +import java.util.Collections; +import java.util.Map; + +public final class GuardDutyDetectorImpl + implements GuardDutyDetector, GuardDutyDetector.Definition, GuardDutyDetector.Update { + private GuardDutyDetectorInner innerObject; + + private final com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public String location() { + return this.innerModel().location(); + } + + public Map tags() { + Map inner = this.innerModel().tags(); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } + } + + public GuardDutyDetectorProperties properties() { + return this.innerModel().properties(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public String resourceGroupName() { + return resourceGroupName; + } + + public GuardDutyDetectorInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.awsconnector.AwsconnectorManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String name; + + private GuardDutyDetectorTagsUpdate updateProperties; + + public GuardDutyDetectorImpl withExistingResourceGroup(String resourceGroupName) { + this.resourceGroupName = resourceGroupName; + return this; + } + + public GuardDutyDetector create() { + this.innerObject = serviceManager.serviceClient() + .getGuardDutyDetectors() + .createOrReplace(resourceGroupName, name, this.innerModel(), Context.NONE); + return this; + } + + public GuardDutyDetector create(Context context) { + this.innerObject = serviceManager.serviceClient() + .getGuardDutyDetectors() + .createOrReplace(resourceGroupName, name, this.innerModel(), context); + return this; + } + + GuardDutyDetectorImpl(String name, com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager) { + this.innerObject = new GuardDutyDetectorInner(); + this.serviceManager = serviceManager; + this.name = name; + } + + public GuardDutyDetectorImpl update() { + this.updateProperties = new GuardDutyDetectorTagsUpdate(); + return this; + } + + public GuardDutyDetector apply() { + this.innerObject = serviceManager.serviceClient() + .getGuardDutyDetectors() + .update(resourceGroupName, name, updateProperties, Context.NONE); + return this; + } + + public GuardDutyDetector apply(Context context) { + this.innerObject = serviceManager.serviceClient() + .getGuardDutyDetectors() + .update(resourceGroupName, name, updateProperties, context); + return this; + } + + GuardDutyDetectorImpl(GuardDutyDetectorInner innerObject, + com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.name = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "guardDutyDetectors"); + } + + public GuardDutyDetector refresh() { + this.innerObject = serviceManager.serviceClient() + .getGuardDutyDetectors() + .getByResourceGroupWithResponse(resourceGroupName, name, Context.NONE) + .getValue(); + return this; + } + + public GuardDutyDetector refresh(Context context) { + this.innerObject = serviceManager.serviceClient() + .getGuardDutyDetectors() + .getByResourceGroupWithResponse(resourceGroupName, name, context) + .getValue(); + return this; + } + + public GuardDutyDetectorImpl withRegion(Region location) { + this.innerModel().withLocation(location.toString()); + return this; + } + + public GuardDutyDetectorImpl withRegion(String location) { + this.innerModel().withLocation(location); + return this; + } + + public GuardDutyDetectorImpl withTags(Map tags) { + if (isInCreateMode()) { + this.innerModel().withTags(tags); + return this; + } else { + this.updateProperties.withTags(tags); + return this; + } + } + + public GuardDutyDetectorImpl withProperties(GuardDutyDetectorProperties properties) { + this.innerModel().withProperties(properties); + return this; + } + + private boolean isInCreateMode() { + return this.innerModel().id() == null; + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/GuardDutyDetectorsClientImpl.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/GuardDutyDetectorsClientImpl.java new file mode 100644 index 000000000000..d65215f1efe3 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/GuardDutyDetectorsClientImpl.java @@ -0,0 +1,1282 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.Patch; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.awsconnector.fluent.GuardDutyDetectorsClient; +import com.azure.resourcemanager.awsconnector.fluent.models.GuardDutyDetectorInner; +import com.azure.resourcemanager.awsconnector.models.GuardDutyDetectorListResult; +import com.azure.resourcemanager.awsconnector.models.GuardDutyDetectorTagsUpdate; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in GuardDutyDetectorsClient. + */ +public final class GuardDutyDetectorsClientImpl implements GuardDutyDetectorsClient { + /** + * The proxy service used to perform REST calls. + */ + private final GuardDutyDetectorsService service; + + /** + * The service client containing this operation class. + */ + private final MicrosoftAwsConnectorImpl client; + + /** + * Initializes an instance of GuardDutyDetectorsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + GuardDutyDetectorsClientImpl(MicrosoftAwsConnectorImpl client) { + this.service = RestProxy.create(GuardDutyDetectorsService.class, client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for MicrosoftAwsConnectorGuardDutyDetectors to be used by the proxy + * service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "MicrosoftAwsConnecto") + public interface GuardDutyDetectorsService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.AwsConnector/guardDutyDetectors") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/guardDutyDetectors") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroup(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/guardDutyDetectors/{name}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getByResourceGroup(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("name") String name, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/guardDutyDetectors/{name}") + @ExpectedResponses({ 200, 201 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrReplace(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("name") String name, + @BodyParam("application/json") GuardDutyDetectorInner resource, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/guardDutyDetectors/{name}") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> update(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("name") String name, + @BodyParam("application/json") GuardDutyDetectorTagsUpdate properties, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/guardDutyDetectors/{name}") + @ExpectedResponses({ 202, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("name") String name, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listBySubscriptionNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroupNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); + } + + /** + * List GuardDutyDetector resources by subscription ID. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a GuardDutyDetector list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync() { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List GuardDutyDetector resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a GuardDutyDetector list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), accept, + context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * List GuardDutyDetector resources by subscription ID. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a GuardDutyDetector list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>(() -> listSinglePageAsync(), + nextLink -> listBySubscriptionNextSinglePageAsync(nextLink)); + } + + /** + * List GuardDutyDetector resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a GuardDutyDetector list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(Context context) { + return new PagedFlux<>(() -> listSinglePageAsync(context), + nextLink -> listBySubscriptionNextSinglePageAsync(nextLink, context)); + } + + /** + * List GuardDutyDetector resources by subscription ID. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a GuardDutyDetector list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + return new PagedIterable<>(listAsync()); + } + + /** + * List GuardDutyDetector resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a GuardDutyDetector list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Context context) { + return new PagedIterable<>(listAsync(context)); + } + + /** + * List GuardDutyDetector resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a GuardDutyDetector list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List GuardDutyDetector resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a GuardDutyDetector list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * List GuardDutyDetector resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a GuardDutyDetector list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName) { + return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); + } + + /** + * List GuardDutyDetector resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a GuardDutyDetector list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName, Context context) { + return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName, context), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink, context)); + } + + /** + * List GuardDutyDetector resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a GuardDutyDetector list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName)); + } + + /** + * List GuardDutyDetector resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a GuardDutyDetector list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, context)); + } + + /** + * Get a GuardDutyDetector. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of GuardDutyDetector. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a GuardDutyDetector along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync(String resourceGroupName, + String name) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.getByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get a GuardDutyDetector. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of GuardDutyDetector. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a GuardDutyDetector along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync(String resourceGroupName, + String name, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.getByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, accept, context); + } + + /** + * Get a GuardDutyDetector. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of GuardDutyDetector. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a GuardDutyDetector on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getByResourceGroupAsync(String resourceGroupName, String name) { + return getByResourceGroupWithResponseAsync(resourceGroupName, name) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Get a GuardDutyDetector. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of GuardDutyDetector. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a GuardDutyDetector along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getByResourceGroupWithResponse(String resourceGroupName, String name, + Context context) { + return getByResourceGroupWithResponseAsync(resourceGroupName, name, context).block(); + } + + /** + * Get a GuardDutyDetector. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of GuardDutyDetector. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a GuardDutyDetector. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public GuardDutyDetectorInner getByResourceGroup(String resourceGroupName, String name) { + return getByResourceGroupWithResponse(resourceGroupName, name, Context.NONE).getValue(); + } + + /** + * Create a GuardDutyDetector. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of GuardDutyDetector. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrReplaceWithResponseAsync(String resourceGroupName, String name, + GuardDutyDetectorInner resource) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (resource == null) { + return Mono.error(new IllegalArgumentException("Parameter resource is required and cannot be null.")); + } else { + resource.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.createOrReplace(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, resource, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Create a GuardDutyDetector. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of GuardDutyDetector. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrReplaceWithResponseAsync(String resourceGroupName, String name, + GuardDutyDetectorInner resource, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (resource == null) { + return Mono.error(new IllegalArgumentException("Parameter resource is required and cannot be null.")); + } else { + resource.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.createOrReplace(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, resource, accept, context); + } + + /** + * Create a GuardDutyDetector. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of GuardDutyDetector. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, GuardDutyDetectorInner> + beginCreateOrReplaceAsync(String resourceGroupName, String name, GuardDutyDetectorInner resource) { + Mono>> mono = createOrReplaceWithResponseAsync(resourceGroupName, name, resource); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), GuardDutyDetectorInner.class, GuardDutyDetectorInner.class, + this.client.getContext()); + } + + /** + * Create a GuardDutyDetector. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of GuardDutyDetector. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, GuardDutyDetectorInner> beginCreateOrReplaceAsync( + String resourceGroupName, String name, GuardDutyDetectorInner resource, Context context) { + context = this.client.mergeContext(context); + Mono>> mono + = createOrReplaceWithResponseAsync(resourceGroupName, name, resource, context); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), GuardDutyDetectorInner.class, GuardDutyDetectorInner.class, context); + } + + /** + * Create a GuardDutyDetector. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of GuardDutyDetector. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, GuardDutyDetectorInner> + beginCreateOrReplace(String resourceGroupName, String name, GuardDutyDetectorInner resource) { + return this.beginCreateOrReplaceAsync(resourceGroupName, name, resource).getSyncPoller(); + } + + /** + * Create a GuardDutyDetector. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of GuardDutyDetector. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, GuardDutyDetectorInner> + beginCreateOrReplace(String resourceGroupName, String name, GuardDutyDetectorInner resource, Context context) { + return this.beginCreateOrReplaceAsync(resourceGroupName, name, resource, context).getSyncPoller(); + } + + /** + * Create a GuardDutyDetector. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of GuardDutyDetector. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrReplaceAsync(String resourceGroupName, String name, + GuardDutyDetectorInner resource) { + return beginCreateOrReplaceAsync(resourceGroupName, name, resource).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create a GuardDutyDetector. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of GuardDutyDetector. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrReplaceAsync(String resourceGroupName, String name, + GuardDutyDetectorInner resource, Context context) { + return beginCreateOrReplaceAsync(resourceGroupName, name, resource, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create a GuardDutyDetector. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of GuardDutyDetector. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public GuardDutyDetectorInner createOrReplace(String resourceGroupName, String name, + GuardDutyDetectorInner resource) { + return createOrReplaceAsync(resourceGroupName, name, resource).block(); + } + + /** + * Create a GuardDutyDetector. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of GuardDutyDetector. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public GuardDutyDetectorInner createOrReplace(String resourceGroupName, String name, + GuardDutyDetectorInner resource, Context context) { + return createOrReplaceAsync(resourceGroupName, name, resource, context).block(); + } + + /** + * Update a GuardDutyDetector. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of GuardDutyDetector. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync(String resourceGroupName, String name, + GuardDutyDetectorTagsUpdate properties) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (properties == null) { + return Mono.error(new IllegalArgumentException("Parameter properties is required and cannot be null.")); + } else { + properties.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.update(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, properties, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Update a GuardDutyDetector. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of GuardDutyDetector. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync(String resourceGroupName, String name, + GuardDutyDetectorTagsUpdate properties, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (properties == null) { + return Mono.error(new IllegalArgumentException("Parameter properties is required and cannot be null.")); + } else { + properties.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.update(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, name, properties, accept, context); + } + + /** + * Update a GuardDutyDetector. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of GuardDutyDetector. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, GuardDutyDetectorInner> + beginUpdateAsync(String resourceGroupName, String name, GuardDutyDetectorTagsUpdate properties) { + Mono>> mono = updateWithResponseAsync(resourceGroupName, name, properties); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), GuardDutyDetectorInner.class, GuardDutyDetectorInner.class, + this.client.getContext()); + } + + /** + * Update a GuardDutyDetector. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of GuardDutyDetector. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, GuardDutyDetectorInner> beginUpdateAsync( + String resourceGroupName, String name, GuardDutyDetectorTagsUpdate properties, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = updateWithResponseAsync(resourceGroupName, name, properties, context); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), GuardDutyDetectorInner.class, GuardDutyDetectorInner.class, context); + } + + /** + * Update a GuardDutyDetector. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of GuardDutyDetector. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, GuardDutyDetectorInner> beginUpdate(String resourceGroupName, + String name, GuardDutyDetectorTagsUpdate properties) { + return this.beginUpdateAsync(resourceGroupName, name, properties).getSyncPoller(); + } + + /** + * Update a GuardDutyDetector. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of GuardDutyDetector. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, GuardDutyDetectorInner> beginUpdate(String resourceGroupName, + String name, GuardDutyDetectorTagsUpdate properties, Context context) { + return this.beginUpdateAsync(resourceGroupName, name, properties, context).getSyncPoller(); + } + + /** + * Update a GuardDutyDetector. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of GuardDutyDetector. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync(String resourceGroupName, String name, + GuardDutyDetectorTagsUpdate properties) { + return beginUpdateAsync(resourceGroupName, name, properties).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Update a GuardDutyDetector. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of GuardDutyDetector. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync(String resourceGroupName, String name, + GuardDutyDetectorTagsUpdate properties, Context context) { + return beginUpdateAsync(resourceGroupName, name, properties, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Update a GuardDutyDetector. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of GuardDutyDetector. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public GuardDutyDetectorInner update(String resourceGroupName, String name, + GuardDutyDetectorTagsUpdate properties) { + return updateAsync(resourceGroupName, name, properties).block(); + } + + /** + * Update a GuardDutyDetector. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of GuardDutyDetector. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public GuardDutyDetectorInner update(String resourceGroupName, String name, GuardDutyDetectorTagsUpdate properties, + Context context) { + return updateAsync(resourceGroupName, name, properties, context).block(); + } + + /** + * Delete a GuardDutyDetector. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of GuardDutyDetector. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync(String resourceGroupName, String name) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Delete a GuardDutyDetector. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of GuardDutyDetector. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync(String resourceGroupName, String name, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.delete(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, name, accept, context); + } + + /** + * Delete a GuardDutyDetector. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of GuardDutyDetector. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String name) { + Mono>> mono = deleteWithResponseAsync(resourceGroupName, name); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); + } + + /** + * Delete a GuardDutyDetector. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of GuardDutyDetector. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String name, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = deleteWithResponseAsync(resourceGroupName, name, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + context); + } + + /** + * Delete a GuardDutyDetector. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of GuardDutyDetector. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String name) { + return this.beginDeleteAsync(resourceGroupName, name).getSyncPoller(); + } + + /** + * Delete a GuardDutyDetector. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of GuardDutyDetector. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String name, Context context) { + return this.beginDeleteAsync(resourceGroupName, name, context).getSyncPoller(); + } + + /** + * Delete a GuardDutyDetector. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of GuardDutyDetector. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String name) { + return beginDeleteAsync(resourceGroupName, name).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete a GuardDutyDetector. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of GuardDutyDetector. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String name, Context context) { + return beginDeleteAsync(resourceGroupName, name, context).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete a GuardDutyDetector. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of GuardDutyDetector. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String name) { + deleteAsync(resourceGroupName, name).block(); + } + + /** + * Delete a GuardDutyDetector. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of GuardDutyDetector. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String name, Context context) { + deleteAsync(resourceGroupName, name, context).block(); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a GuardDutyDetector list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listBySubscriptionNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a GuardDutyDetector list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listBySubscriptionNextSinglePageAsync(String nextLink, + Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a GuardDutyDetector list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a GuardDutyDetector list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupNextSinglePageAsync(String nextLink, + Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/GuardDutyDetectorsImpl.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/GuardDutyDetectorsImpl.java new file mode 100644 index 000000000000..ff8aeec77dd3 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/GuardDutyDetectorsImpl.java @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.awsconnector.fluent.GuardDutyDetectorsClient; +import com.azure.resourcemanager.awsconnector.fluent.models.GuardDutyDetectorInner; +import com.azure.resourcemanager.awsconnector.models.GuardDutyDetector; +import com.azure.resourcemanager.awsconnector.models.GuardDutyDetectors; + +public final class GuardDutyDetectorsImpl implements GuardDutyDetectors { + private static final ClientLogger LOGGER = new ClientLogger(GuardDutyDetectorsImpl.class); + + private final GuardDutyDetectorsClient innerClient; + + private final com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager; + + public GuardDutyDetectorsImpl(GuardDutyDetectorsClient innerClient, + com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return ResourceManagerUtils.mapPage(inner, inner1 -> new GuardDutyDetectorImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new GuardDutyDetectorImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName); + return ResourceManagerUtils.mapPage(inner, inner1 -> new GuardDutyDetectorImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + PagedIterable inner + = this.serviceClient().listByResourceGroup(resourceGroupName, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new GuardDutyDetectorImpl(inner1, this.manager())); + } + + public Response getByResourceGroupWithResponse(String resourceGroupName, String name, + Context context) { + Response inner + = this.serviceClient().getByResourceGroupWithResponse(resourceGroupName, name, context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new GuardDutyDetectorImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public GuardDutyDetector getByResourceGroup(String resourceGroupName, String name) { + GuardDutyDetectorInner inner = this.serviceClient().getByResourceGroup(resourceGroupName, name); + if (inner != null) { + return new GuardDutyDetectorImpl(inner, this.manager()); + } else { + return null; + } + } + + public void deleteByResourceGroup(String resourceGroupName, String name) { + this.serviceClient().delete(resourceGroupName, name); + } + + public void delete(String resourceGroupName, String name, Context context) { + this.serviceClient().delete(resourceGroupName, name, context); + } + + public GuardDutyDetector getById(String id) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String name = ResourceManagerUtils.getValueFromIdByName(id, "guardDutyDetectors"); + if (name == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'guardDutyDetectors'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, name, Context.NONE).getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String name = ResourceManagerUtils.getValueFromIdByName(id, "guardDutyDetectors"); + if (name == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'guardDutyDetectors'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, name, context); + } + + public void deleteById(String id) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String name = ResourceManagerUtils.getValueFromIdByName(id, "guardDutyDetectors"); + if (name == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'guardDutyDetectors'.", id))); + } + this.delete(resourceGroupName, name, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String name = ResourceManagerUtils.getValueFromIdByName(id, "guardDutyDetectors"); + if (name == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'guardDutyDetectors'.", id))); + } + this.delete(resourceGroupName, name, context); + } + + private GuardDutyDetectorsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.awsconnector.AwsconnectorManager manager() { + return this.serviceManager; + } + + public GuardDutyDetectorImpl define(String name) { + return new GuardDutyDetectorImpl(name, this.manager()); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/IamAccessKeyLastUsedImpl.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/IamAccessKeyLastUsedImpl.java new file mode 100644 index 000000000000..3db93f5d0c48 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/IamAccessKeyLastUsedImpl.java @@ -0,0 +1,178 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.implementation; + +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.awsconnector.fluent.models.IamAccessKeyLastUsedInner; +import com.azure.resourcemanager.awsconnector.models.IamAccessKeyLastUsed; +import com.azure.resourcemanager.awsconnector.models.IamAccessKeyLastUsedProperties; +import com.azure.resourcemanager.awsconnector.models.IamAccessKeyLastUsedTagsUpdate; +import java.util.Collections; +import java.util.Map; + +public final class IamAccessKeyLastUsedImpl + implements IamAccessKeyLastUsed, IamAccessKeyLastUsed.Definition, IamAccessKeyLastUsed.Update { + private IamAccessKeyLastUsedInner innerObject; + + private final com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public String location() { + return this.innerModel().location(); + } + + public Map tags() { + Map inner = this.innerModel().tags(); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } + } + + public IamAccessKeyLastUsedProperties properties() { + return this.innerModel().properties(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public String resourceGroupName() { + return resourceGroupName; + } + + public IamAccessKeyLastUsedInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.awsconnector.AwsconnectorManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String name; + + private IamAccessKeyLastUsedTagsUpdate updateProperties; + + public IamAccessKeyLastUsedImpl withExistingResourceGroup(String resourceGroupName) { + this.resourceGroupName = resourceGroupName; + return this; + } + + public IamAccessKeyLastUsed create() { + this.innerObject = serviceManager.serviceClient() + .getIamAccessKeyLastUseds() + .createOrReplace(resourceGroupName, name, this.innerModel(), Context.NONE); + return this; + } + + public IamAccessKeyLastUsed create(Context context) { + this.innerObject = serviceManager.serviceClient() + .getIamAccessKeyLastUseds() + .createOrReplace(resourceGroupName, name, this.innerModel(), context); + return this; + } + + IamAccessKeyLastUsedImpl(String name, com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager) { + this.innerObject = new IamAccessKeyLastUsedInner(); + this.serviceManager = serviceManager; + this.name = name; + } + + public IamAccessKeyLastUsedImpl update() { + this.updateProperties = new IamAccessKeyLastUsedTagsUpdate(); + return this; + } + + public IamAccessKeyLastUsed apply() { + this.innerObject = serviceManager.serviceClient() + .getIamAccessKeyLastUseds() + .update(resourceGroupName, name, updateProperties, Context.NONE); + return this; + } + + public IamAccessKeyLastUsed apply(Context context) { + this.innerObject = serviceManager.serviceClient() + .getIamAccessKeyLastUseds() + .update(resourceGroupName, name, updateProperties, context); + return this; + } + + IamAccessKeyLastUsedImpl(IamAccessKeyLastUsedInner innerObject, + com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.name = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "iamAccessKeyLastUseds"); + } + + public IamAccessKeyLastUsed refresh() { + this.innerObject = serviceManager.serviceClient() + .getIamAccessKeyLastUseds() + .getByResourceGroupWithResponse(resourceGroupName, name, Context.NONE) + .getValue(); + return this; + } + + public IamAccessKeyLastUsed refresh(Context context) { + this.innerObject = serviceManager.serviceClient() + .getIamAccessKeyLastUseds() + .getByResourceGroupWithResponse(resourceGroupName, name, context) + .getValue(); + return this; + } + + public IamAccessKeyLastUsedImpl withRegion(Region location) { + this.innerModel().withLocation(location.toString()); + return this; + } + + public IamAccessKeyLastUsedImpl withRegion(String location) { + this.innerModel().withLocation(location); + return this; + } + + public IamAccessKeyLastUsedImpl withTags(Map tags) { + if (isInCreateMode()) { + this.innerModel().withTags(tags); + return this; + } else { + this.updateProperties.withTags(tags); + return this; + } + } + + public IamAccessKeyLastUsedImpl withProperties(IamAccessKeyLastUsedProperties properties) { + this.innerModel().withProperties(properties); + return this; + } + + private boolean isInCreateMode() { + return this.innerModel().id() == null; + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/IamAccessKeyLastUsedsClientImpl.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/IamAccessKeyLastUsedsClientImpl.java new file mode 100644 index 000000000000..ce4420320e32 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/IamAccessKeyLastUsedsClientImpl.java @@ -0,0 +1,1283 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.Patch; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.awsconnector.fluent.IamAccessKeyLastUsedsClient; +import com.azure.resourcemanager.awsconnector.fluent.models.IamAccessKeyLastUsedInner; +import com.azure.resourcemanager.awsconnector.models.IamAccessKeyLastUsedListResult; +import com.azure.resourcemanager.awsconnector.models.IamAccessKeyLastUsedTagsUpdate; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in IamAccessKeyLastUsedsClient. + */ +public final class IamAccessKeyLastUsedsClientImpl implements IamAccessKeyLastUsedsClient { + /** + * The proxy service used to perform REST calls. + */ + private final IamAccessKeyLastUsedsService service; + + /** + * The service client containing this operation class. + */ + private final MicrosoftAwsConnectorImpl client; + + /** + * Initializes an instance of IamAccessKeyLastUsedsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + IamAccessKeyLastUsedsClientImpl(MicrosoftAwsConnectorImpl client) { + this.service = RestProxy.create(IamAccessKeyLastUsedsService.class, client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for MicrosoftAwsConnectorIamAccessKeyLastUseds to be used by the proxy + * service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "MicrosoftAwsConnecto") + public interface IamAccessKeyLastUsedsService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.AwsConnector/iamAccessKeyLastUseds") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/iamAccessKeyLastUseds") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroup(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/iamAccessKeyLastUseds/{name}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getByResourceGroup(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("name") String name, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/iamAccessKeyLastUseds/{name}") + @ExpectedResponses({ 200, 201 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrReplace(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("name") String name, + @BodyParam("application/json") IamAccessKeyLastUsedInner resource, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/iamAccessKeyLastUseds/{name}") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> update(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("name") String name, + @BodyParam("application/json") IamAccessKeyLastUsedTagsUpdate properties, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/iamAccessKeyLastUseds/{name}") + @ExpectedResponses({ 202, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("name") String name, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listBySubscriptionNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroupNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); + } + + /** + * List IamAccessKeyLastUsed resources by subscription ID. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a IamAccessKeyLastUsed list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync() { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List IamAccessKeyLastUsed resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a IamAccessKeyLastUsed list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), accept, + context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * List IamAccessKeyLastUsed resources by subscription ID. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a IamAccessKeyLastUsed list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>(() -> listSinglePageAsync(), + nextLink -> listBySubscriptionNextSinglePageAsync(nextLink)); + } + + /** + * List IamAccessKeyLastUsed resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a IamAccessKeyLastUsed list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(Context context) { + return new PagedFlux<>(() -> listSinglePageAsync(context), + nextLink -> listBySubscriptionNextSinglePageAsync(nextLink, context)); + } + + /** + * List IamAccessKeyLastUsed resources by subscription ID. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a IamAccessKeyLastUsed list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + return new PagedIterable<>(listAsync()); + } + + /** + * List IamAccessKeyLastUsed resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a IamAccessKeyLastUsed list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Context context) { + return new PagedIterable<>(listAsync(context)); + } + + /** + * List IamAccessKeyLastUsed resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a IamAccessKeyLastUsed list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> + listByResourceGroupSinglePageAsync(String resourceGroupName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List IamAccessKeyLastUsed resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a IamAccessKeyLastUsed list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * List IamAccessKeyLastUsed resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a IamAccessKeyLastUsed list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName) { + return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); + } + + /** + * List IamAccessKeyLastUsed resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a IamAccessKeyLastUsed list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName, Context context) { + return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName, context), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink, context)); + } + + /** + * List IamAccessKeyLastUsed resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a IamAccessKeyLastUsed list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName)); + } + + /** + * List IamAccessKeyLastUsed resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a IamAccessKeyLastUsed list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, context)); + } + + /** + * Get a IamAccessKeyLastUsed. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of IamAccessKeyLastUsed. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a IamAccessKeyLastUsed along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync(String resourceGroupName, + String name) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.getByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get a IamAccessKeyLastUsed. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of IamAccessKeyLastUsed. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a IamAccessKeyLastUsed along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync(String resourceGroupName, + String name, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.getByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, accept, context); + } + + /** + * Get a IamAccessKeyLastUsed. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of IamAccessKeyLastUsed. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a IamAccessKeyLastUsed on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getByResourceGroupAsync(String resourceGroupName, String name) { + return getByResourceGroupWithResponseAsync(resourceGroupName, name) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Get a IamAccessKeyLastUsed. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of IamAccessKeyLastUsed. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a IamAccessKeyLastUsed along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getByResourceGroupWithResponse(String resourceGroupName, String name, + Context context) { + return getByResourceGroupWithResponseAsync(resourceGroupName, name, context).block(); + } + + /** + * Get a IamAccessKeyLastUsed. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of IamAccessKeyLastUsed. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a IamAccessKeyLastUsed. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public IamAccessKeyLastUsedInner getByResourceGroup(String resourceGroupName, String name) { + return getByResourceGroupWithResponse(resourceGroupName, name, Context.NONE).getValue(); + } + + /** + * Create a IamAccessKeyLastUsed. Please note that end user resource creation is currently restricted, but it will + * be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of IamAccessKeyLastUsed. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrReplaceWithResponseAsync(String resourceGroupName, String name, + IamAccessKeyLastUsedInner resource) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (resource == null) { + return Mono.error(new IllegalArgumentException("Parameter resource is required and cannot be null.")); + } else { + resource.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.createOrReplace(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, resource, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Create a IamAccessKeyLastUsed. Please note that end user resource creation is currently restricted, but it will + * be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of IamAccessKeyLastUsed. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrReplaceWithResponseAsync(String resourceGroupName, String name, + IamAccessKeyLastUsedInner resource, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (resource == null) { + return Mono.error(new IllegalArgumentException("Parameter resource is required and cannot be null.")); + } else { + resource.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.createOrReplace(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, resource, accept, context); + } + + /** + * Create a IamAccessKeyLastUsed. Please note that end user resource creation is currently restricted, but it will + * be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of IamAccessKeyLastUsed. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, IamAccessKeyLastUsedInner> + beginCreateOrReplaceAsync(String resourceGroupName, String name, IamAccessKeyLastUsedInner resource) { + Mono>> mono = createOrReplaceWithResponseAsync(resourceGroupName, name, resource); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), IamAccessKeyLastUsedInner.class, IamAccessKeyLastUsedInner.class, + this.client.getContext()); + } + + /** + * Create a IamAccessKeyLastUsed. Please note that end user resource creation is currently restricted, but it will + * be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of IamAccessKeyLastUsed. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, IamAccessKeyLastUsedInner> beginCreateOrReplaceAsync( + String resourceGroupName, String name, IamAccessKeyLastUsedInner resource, Context context) { + context = this.client.mergeContext(context); + Mono>> mono + = createOrReplaceWithResponseAsync(resourceGroupName, name, resource, context); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), IamAccessKeyLastUsedInner.class, IamAccessKeyLastUsedInner.class, context); + } + + /** + * Create a IamAccessKeyLastUsed. Please note that end user resource creation is currently restricted, but it will + * be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of IamAccessKeyLastUsed. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, IamAccessKeyLastUsedInner> + beginCreateOrReplace(String resourceGroupName, String name, IamAccessKeyLastUsedInner resource) { + return this.beginCreateOrReplaceAsync(resourceGroupName, name, resource).getSyncPoller(); + } + + /** + * Create a IamAccessKeyLastUsed. Please note that end user resource creation is currently restricted, but it will + * be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of IamAccessKeyLastUsed. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, IamAccessKeyLastUsedInner> beginCreateOrReplace( + String resourceGroupName, String name, IamAccessKeyLastUsedInner resource, Context context) { + return this.beginCreateOrReplaceAsync(resourceGroupName, name, resource, context).getSyncPoller(); + } + + /** + * Create a IamAccessKeyLastUsed. Please note that end user resource creation is currently restricted, but it will + * be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of IamAccessKeyLastUsed. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrReplaceAsync(String resourceGroupName, String name, + IamAccessKeyLastUsedInner resource) { + return beginCreateOrReplaceAsync(resourceGroupName, name, resource).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create a IamAccessKeyLastUsed. Please note that end user resource creation is currently restricted, but it will + * be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of IamAccessKeyLastUsed. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrReplaceAsync(String resourceGroupName, String name, + IamAccessKeyLastUsedInner resource, Context context) { + return beginCreateOrReplaceAsync(resourceGroupName, name, resource, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create a IamAccessKeyLastUsed. Please note that end user resource creation is currently restricted, but it will + * be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of IamAccessKeyLastUsed. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public IamAccessKeyLastUsedInner createOrReplace(String resourceGroupName, String name, + IamAccessKeyLastUsedInner resource) { + return createOrReplaceAsync(resourceGroupName, name, resource).block(); + } + + /** + * Create a IamAccessKeyLastUsed. Please note that end user resource creation is currently restricted, but it will + * be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of IamAccessKeyLastUsed. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public IamAccessKeyLastUsedInner createOrReplace(String resourceGroupName, String name, + IamAccessKeyLastUsedInner resource, Context context) { + return createOrReplaceAsync(resourceGroupName, name, resource, context).block(); + } + + /** + * Update a IamAccessKeyLastUsed. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of IamAccessKeyLastUsed. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync(String resourceGroupName, String name, + IamAccessKeyLastUsedTagsUpdate properties) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (properties == null) { + return Mono.error(new IllegalArgumentException("Parameter properties is required and cannot be null.")); + } else { + properties.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.update(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, properties, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Update a IamAccessKeyLastUsed. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of IamAccessKeyLastUsed. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync(String resourceGroupName, String name, + IamAccessKeyLastUsedTagsUpdate properties, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (properties == null) { + return Mono.error(new IllegalArgumentException("Parameter properties is required and cannot be null.")); + } else { + properties.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.update(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, name, properties, accept, context); + } + + /** + * Update a IamAccessKeyLastUsed. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of IamAccessKeyLastUsed. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, IamAccessKeyLastUsedInner> + beginUpdateAsync(String resourceGroupName, String name, IamAccessKeyLastUsedTagsUpdate properties) { + Mono>> mono = updateWithResponseAsync(resourceGroupName, name, properties); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), IamAccessKeyLastUsedInner.class, IamAccessKeyLastUsedInner.class, + this.client.getContext()); + } + + /** + * Update a IamAccessKeyLastUsed. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of IamAccessKeyLastUsed. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, IamAccessKeyLastUsedInner> beginUpdateAsync( + String resourceGroupName, String name, IamAccessKeyLastUsedTagsUpdate properties, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = updateWithResponseAsync(resourceGroupName, name, properties, context); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), IamAccessKeyLastUsedInner.class, IamAccessKeyLastUsedInner.class, context); + } + + /** + * Update a IamAccessKeyLastUsed. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of IamAccessKeyLastUsed. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, IamAccessKeyLastUsedInner> + beginUpdate(String resourceGroupName, String name, IamAccessKeyLastUsedTagsUpdate properties) { + return this.beginUpdateAsync(resourceGroupName, name, properties).getSyncPoller(); + } + + /** + * Update a IamAccessKeyLastUsed. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of IamAccessKeyLastUsed. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, IamAccessKeyLastUsedInner> + beginUpdate(String resourceGroupName, String name, IamAccessKeyLastUsedTagsUpdate properties, Context context) { + return this.beginUpdateAsync(resourceGroupName, name, properties, context).getSyncPoller(); + } + + /** + * Update a IamAccessKeyLastUsed. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of IamAccessKeyLastUsed. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync(String resourceGroupName, String name, + IamAccessKeyLastUsedTagsUpdate properties) { + return beginUpdateAsync(resourceGroupName, name, properties).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Update a IamAccessKeyLastUsed. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of IamAccessKeyLastUsed. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync(String resourceGroupName, String name, + IamAccessKeyLastUsedTagsUpdate properties, Context context) { + return beginUpdateAsync(resourceGroupName, name, properties, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Update a IamAccessKeyLastUsed. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of IamAccessKeyLastUsed. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public IamAccessKeyLastUsedInner update(String resourceGroupName, String name, + IamAccessKeyLastUsedTagsUpdate properties) { + return updateAsync(resourceGroupName, name, properties).block(); + } + + /** + * Update a IamAccessKeyLastUsed. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of IamAccessKeyLastUsed. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public IamAccessKeyLastUsedInner update(String resourceGroupName, String name, + IamAccessKeyLastUsedTagsUpdate properties, Context context) { + return updateAsync(resourceGroupName, name, properties, context).block(); + } + + /** + * Delete a IamAccessKeyLastUsed. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of IamAccessKeyLastUsed. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync(String resourceGroupName, String name) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Delete a IamAccessKeyLastUsed. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of IamAccessKeyLastUsed. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync(String resourceGroupName, String name, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.delete(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, name, accept, context); + } + + /** + * Delete a IamAccessKeyLastUsed. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of IamAccessKeyLastUsed. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String name) { + Mono>> mono = deleteWithResponseAsync(resourceGroupName, name); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); + } + + /** + * Delete a IamAccessKeyLastUsed. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of IamAccessKeyLastUsed. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String name, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = deleteWithResponseAsync(resourceGroupName, name, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + context); + } + + /** + * Delete a IamAccessKeyLastUsed. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of IamAccessKeyLastUsed. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String name) { + return this.beginDeleteAsync(resourceGroupName, name).getSyncPoller(); + } + + /** + * Delete a IamAccessKeyLastUsed. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of IamAccessKeyLastUsed. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String name, Context context) { + return this.beginDeleteAsync(resourceGroupName, name, context).getSyncPoller(); + } + + /** + * Delete a IamAccessKeyLastUsed. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of IamAccessKeyLastUsed. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String name) { + return beginDeleteAsync(resourceGroupName, name).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete a IamAccessKeyLastUsed. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of IamAccessKeyLastUsed. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String name, Context context) { + return beginDeleteAsync(resourceGroupName, name, context).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete a IamAccessKeyLastUsed. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of IamAccessKeyLastUsed. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String name) { + deleteAsync(resourceGroupName, name).block(); + } + + /** + * Delete a IamAccessKeyLastUsed. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of IamAccessKeyLastUsed. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String name, Context context) { + deleteAsync(resourceGroupName, name, context).block(); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a IamAccessKeyLastUsed list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listBySubscriptionNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a IamAccessKeyLastUsed list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listBySubscriptionNextSinglePageAsync(String nextLink, + Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a IamAccessKeyLastUsed list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a IamAccessKeyLastUsed list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupNextSinglePageAsync(String nextLink, + Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/IamAccessKeyLastUsedsImpl.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/IamAccessKeyLastUsedsImpl.java new file mode 100644 index 000000000000..1ba49782b9e0 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/IamAccessKeyLastUsedsImpl.java @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.awsconnector.fluent.IamAccessKeyLastUsedsClient; +import com.azure.resourcemanager.awsconnector.fluent.models.IamAccessKeyLastUsedInner; +import com.azure.resourcemanager.awsconnector.models.IamAccessKeyLastUsed; +import com.azure.resourcemanager.awsconnector.models.IamAccessKeyLastUseds; + +public final class IamAccessKeyLastUsedsImpl implements IamAccessKeyLastUseds { + private static final ClientLogger LOGGER = new ClientLogger(IamAccessKeyLastUsedsImpl.class); + + private final IamAccessKeyLastUsedsClient innerClient; + + private final com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager; + + public IamAccessKeyLastUsedsImpl(IamAccessKeyLastUsedsClient innerClient, + com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return ResourceManagerUtils.mapPage(inner, inner1 -> new IamAccessKeyLastUsedImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new IamAccessKeyLastUsedImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName); + return ResourceManagerUtils.mapPage(inner, inner1 -> new IamAccessKeyLastUsedImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + PagedIterable inner + = this.serviceClient().listByResourceGroup(resourceGroupName, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new IamAccessKeyLastUsedImpl(inner1, this.manager())); + } + + public Response getByResourceGroupWithResponse(String resourceGroupName, String name, + Context context) { + Response inner + = this.serviceClient().getByResourceGroupWithResponse(resourceGroupName, name, context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new IamAccessKeyLastUsedImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public IamAccessKeyLastUsed getByResourceGroup(String resourceGroupName, String name) { + IamAccessKeyLastUsedInner inner = this.serviceClient().getByResourceGroup(resourceGroupName, name); + if (inner != null) { + return new IamAccessKeyLastUsedImpl(inner, this.manager()); + } else { + return null; + } + } + + public void deleteByResourceGroup(String resourceGroupName, String name) { + this.serviceClient().delete(resourceGroupName, name); + } + + public void delete(String resourceGroupName, String name, Context context) { + this.serviceClient().delete(resourceGroupName, name, context); + } + + public IamAccessKeyLastUsed getById(String id) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String name = ResourceManagerUtils.getValueFromIdByName(id, "iamAccessKeyLastUseds"); + if (name == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'iamAccessKeyLastUseds'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, name, Context.NONE).getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String name = ResourceManagerUtils.getValueFromIdByName(id, "iamAccessKeyLastUseds"); + if (name == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'iamAccessKeyLastUseds'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, name, context); + } + + public void deleteById(String id) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String name = ResourceManagerUtils.getValueFromIdByName(id, "iamAccessKeyLastUseds"); + if (name == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'iamAccessKeyLastUseds'.", id))); + } + this.delete(resourceGroupName, name, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String name = ResourceManagerUtils.getValueFromIdByName(id, "iamAccessKeyLastUseds"); + if (name == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'iamAccessKeyLastUseds'.", id))); + } + this.delete(resourceGroupName, name, context); + } + + private IamAccessKeyLastUsedsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.awsconnector.AwsconnectorManager manager() { + return this.serviceManager; + } + + public IamAccessKeyLastUsedImpl define(String name) { + return new IamAccessKeyLastUsedImpl(name, this.manager()); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/IamAccessKeyMetadataImpl.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/IamAccessKeyMetadataImpl.java new file mode 100644 index 000000000000..fe4db6816a9d --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/IamAccessKeyMetadataImpl.java @@ -0,0 +1,178 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.implementation; + +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.awsconnector.fluent.models.IamAccessKeyMetadataInner; +import com.azure.resourcemanager.awsconnector.models.IamAccessKeyMetadata; +import com.azure.resourcemanager.awsconnector.models.IamAccessKeyMetadataProperties; +import com.azure.resourcemanager.awsconnector.models.IamAccessKeyMetadataTagsUpdate; +import java.util.Collections; +import java.util.Map; + +public final class IamAccessKeyMetadataImpl + implements IamAccessKeyMetadata, IamAccessKeyMetadata.Definition, IamAccessKeyMetadata.Update { + private IamAccessKeyMetadataInner innerObject; + + private final com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public String location() { + return this.innerModel().location(); + } + + public Map tags() { + Map inner = this.innerModel().tags(); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } + } + + public IamAccessKeyMetadataProperties properties() { + return this.innerModel().properties(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public String resourceGroupName() { + return resourceGroupName; + } + + public IamAccessKeyMetadataInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.awsconnector.AwsconnectorManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String name; + + private IamAccessKeyMetadataTagsUpdate updateProperties; + + public IamAccessKeyMetadataImpl withExistingResourceGroup(String resourceGroupName) { + this.resourceGroupName = resourceGroupName; + return this; + } + + public IamAccessKeyMetadata create() { + this.innerObject = serviceManager.serviceClient() + .getIamAccessKeyMetadataInfoes() + .createOrReplace(resourceGroupName, name, this.innerModel(), Context.NONE); + return this; + } + + public IamAccessKeyMetadata create(Context context) { + this.innerObject = serviceManager.serviceClient() + .getIamAccessKeyMetadataInfoes() + .createOrReplace(resourceGroupName, name, this.innerModel(), context); + return this; + } + + IamAccessKeyMetadataImpl(String name, com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager) { + this.innerObject = new IamAccessKeyMetadataInner(); + this.serviceManager = serviceManager; + this.name = name; + } + + public IamAccessKeyMetadataImpl update() { + this.updateProperties = new IamAccessKeyMetadataTagsUpdate(); + return this; + } + + public IamAccessKeyMetadata apply() { + this.innerObject = serviceManager.serviceClient() + .getIamAccessKeyMetadataInfoes() + .update(resourceGroupName, name, updateProperties, Context.NONE); + return this; + } + + public IamAccessKeyMetadata apply(Context context) { + this.innerObject = serviceManager.serviceClient() + .getIamAccessKeyMetadataInfoes() + .update(resourceGroupName, name, updateProperties, context); + return this; + } + + IamAccessKeyMetadataImpl(IamAccessKeyMetadataInner innerObject, + com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.name = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "iamAccessKeyMetadata"); + } + + public IamAccessKeyMetadata refresh() { + this.innerObject = serviceManager.serviceClient() + .getIamAccessKeyMetadataInfoes() + .getByResourceGroupWithResponse(resourceGroupName, name, Context.NONE) + .getValue(); + return this; + } + + public IamAccessKeyMetadata refresh(Context context) { + this.innerObject = serviceManager.serviceClient() + .getIamAccessKeyMetadataInfoes() + .getByResourceGroupWithResponse(resourceGroupName, name, context) + .getValue(); + return this; + } + + public IamAccessKeyMetadataImpl withRegion(Region location) { + this.innerModel().withLocation(location.toString()); + return this; + } + + public IamAccessKeyMetadataImpl withRegion(String location) { + this.innerModel().withLocation(location); + return this; + } + + public IamAccessKeyMetadataImpl withTags(Map tags) { + if (isInCreateMode()) { + this.innerModel().withTags(tags); + return this; + } else { + this.updateProperties.withTags(tags); + return this; + } + } + + public IamAccessKeyMetadataImpl withProperties(IamAccessKeyMetadataProperties properties) { + this.innerModel().withProperties(properties); + return this; + } + + private boolean isInCreateMode() { + return this.innerModel().id() == null; + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/IamAccessKeyMetadataInfoesClientImpl.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/IamAccessKeyMetadataInfoesClientImpl.java new file mode 100644 index 000000000000..1e55458020f7 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/IamAccessKeyMetadataInfoesClientImpl.java @@ -0,0 +1,1283 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.Patch; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.awsconnector.fluent.IamAccessKeyMetadataInfoesClient; +import com.azure.resourcemanager.awsconnector.fluent.models.IamAccessKeyMetadataInner; +import com.azure.resourcemanager.awsconnector.models.IamAccessKeyMetadataListResult; +import com.azure.resourcemanager.awsconnector.models.IamAccessKeyMetadataTagsUpdate; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in IamAccessKeyMetadataInfoesClient. + */ +public final class IamAccessKeyMetadataInfoesClientImpl implements IamAccessKeyMetadataInfoesClient { + /** + * The proxy service used to perform REST calls. + */ + private final IamAccessKeyMetadataInfoesService service; + + /** + * The service client containing this operation class. + */ + private final MicrosoftAwsConnectorImpl client; + + /** + * Initializes an instance of IamAccessKeyMetadataInfoesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + IamAccessKeyMetadataInfoesClientImpl(MicrosoftAwsConnectorImpl client) { + this.service = RestProxy.create(IamAccessKeyMetadataInfoesService.class, client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for MicrosoftAwsConnectorIamAccessKeyMetadataInfoes to be used by the + * proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "MicrosoftAwsConnecto") + public interface IamAccessKeyMetadataInfoesService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.AwsConnector/iamAccessKeyMetadata") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/iamAccessKeyMetadata") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroup(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/iamAccessKeyMetadata/{name}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getByResourceGroup(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("name") String name, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/iamAccessKeyMetadata/{name}") + @ExpectedResponses({ 200, 201 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrReplace(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("name") String name, + @BodyParam("application/json") IamAccessKeyMetadataInner resource, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/iamAccessKeyMetadata/{name}") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> update(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("name") String name, + @BodyParam("application/json") IamAccessKeyMetadataTagsUpdate properties, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/iamAccessKeyMetadata/{name}") + @ExpectedResponses({ 202, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("name") String name, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listBySubscriptionNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroupNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); + } + + /** + * List IamAccessKeyMetadata resources by subscription ID. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a IamAccessKeyMetadata list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync() { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List IamAccessKeyMetadata resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a IamAccessKeyMetadata list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), accept, + context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * List IamAccessKeyMetadata resources by subscription ID. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a IamAccessKeyMetadata list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>(() -> listSinglePageAsync(), + nextLink -> listBySubscriptionNextSinglePageAsync(nextLink)); + } + + /** + * List IamAccessKeyMetadata resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a IamAccessKeyMetadata list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(Context context) { + return new PagedFlux<>(() -> listSinglePageAsync(context), + nextLink -> listBySubscriptionNextSinglePageAsync(nextLink, context)); + } + + /** + * List IamAccessKeyMetadata resources by subscription ID. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a IamAccessKeyMetadata list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + return new PagedIterable<>(listAsync()); + } + + /** + * List IamAccessKeyMetadata resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a IamAccessKeyMetadata list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Context context) { + return new PagedIterable<>(listAsync(context)); + } + + /** + * List IamAccessKeyMetadata resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a IamAccessKeyMetadata list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> + listByResourceGroupSinglePageAsync(String resourceGroupName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List IamAccessKeyMetadata resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a IamAccessKeyMetadata list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * List IamAccessKeyMetadata resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a IamAccessKeyMetadata list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName) { + return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); + } + + /** + * List IamAccessKeyMetadata resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a IamAccessKeyMetadata list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName, Context context) { + return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName, context), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink, context)); + } + + /** + * List IamAccessKeyMetadata resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a IamAccessKeyMetadata list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName)); + } + + /** + * List IamAccessKeyMetadata resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a IamAccessKeyMetadata list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, context)); + } + + /** + * Get a IamAccessKeyMetadata. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of IamAccessKeyMetadata. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a IamAccessKeyMetadata along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync(String resourceGroupName, + String name) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.getByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get a IamAccessKeyMetadata. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of IamAccessKeyMetadata. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a IamAccessKeyMetadata along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync(String resourceGroupName, + String name, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.getByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, accept, context); + } + + /** + * Get a IamAccessKeyMetadata. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of IamAccessKeyMetadata. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a IamAccessKeyMetadata on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getByResourceGroupAsync(String resourceGroupName, String name) { + return getByResourceGroupWithResponseAsync(resourceGroupName, name) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Get a IamAccessKeyMetadata. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of IamAccessKeyMetadata. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a IamAccessKeyMetadata along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getByResourceGroupWithResponse(String resourceGroupName, String name, + Context context) { + return getByResourceGroupWithResponseAsync(resourceGroupName, name, context).block(); + } + + /** + * Get a IamAccessKeyMetadata. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of IamAccessKeyMetadata. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a IamAccessKeyMetadata. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public IamAccessKeyMetadataInner getByResourceGroup(String resourceGroupName, String name) { + return getByResourceGroupWithResponse(resourceGroupName, name, Context.NONE).getValue(); + } + + /** + * Create a IamAccessKeyMetadata. Please note that end user resource creation is currently restricted, but it will + * be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of IamAccessKeyMetadata. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrReplaceWithResponseAsync(String resourceGroupName, String name, + IamAccessKeyMetadataInner resource) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (resource == null) { + return Mono.error(new IllegalArgumentException("Parameter resource is required and cannot be null.")); + } else { + resource.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.createOrReplace(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, resource, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Create a IamAccessKeyMetadata. Please note that end user resource creation is currently restricted, but it will + * be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of IamAccessKeyMetadata. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrReplaceWithResponseAsync(String resourceGroupName, String name, + IamAccessKeyMetadataInner resource, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (resource == null) { + return Mono.error(new IllegalArgumentException("Parameter resource is required and cannot be null.")); + } else { + resource.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.createOrReplace(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, resource, accept, context); + } + + /** + * Create a IamAccessKeyMetadata. Please note that end user resource creation is currently restricted, but it will + * be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of IamAccessKeyMetadata. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, IamAccessKeyMetadataInner> + beginCreateOrReplaceAsync(String resourceGroupName, String name, IamAccessKeyMetadataInner resource) { + Mono>> mono = createOrReplaceWithResponseAsync(resourceGroupName, name, resource); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), IamAccessKeyMetadataInner.class, IamAccessKeyMetadataInner.class, + this.client.getContext()); + } + + /** + * Create a IamAccessKeyMetadata. Please note that end user resource creation is currently restricted, but it will + * be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of IamAccessKeyMetadata. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, IamAccessKeyMetadataInner> beginCreateOrReplaceAsync( + String resourceGroupName, String name, IamAccessKeyMetadataInner resource, Context context) { + context = this.client.mergeContext(context); + Mono>> mono + = createOrReplaceWithResponseAsync(resourceGroupName, name, resource, context); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), IamAccessKeyMetadataInner.class, IamAccessKeyMetadataInner.class, context); + } + + /** + * Create a IamAccessKeyMetadata. Please note that end user resource creation is currently restricted, but it will + * be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of IamAccessKeyMetadata. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, IamAccessKeyMetadataInner> + beginCreateOrReplace(String resourceGroupName, String name, IamAccessKeyMetadataInner resource) { + return this.beginCreateOrReplaceAsync(resourceGroupName, name, resource).getSyncPoller(); + } + + /** + * Create a IamAccessKeyMetadata. Please note that end user resource creation is currently restricted, but it will + * be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of IamAccessKeyMetadata. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, IamAccessKeyMetadataInner> beginCreateOrReplace( + String resourceGroupName, String name, IamAccessKeyMetadataInner resource, Context context) { + return this.beginCreateOrReplaceAsync(resourceGroupName, name, resource, context).getSyncPoller(); + } + + /** + * Create a IamAccessKeyMetadata. Please note that end user resource creation is currently restricted, but it will + * be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of IamAccessKeyMetadata. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrReplaceAsync(String resourceGroupName, String name, + IamAccessKeyMetadataInner resource) { + return beginCreateOrReplaceAsync(resourceGroupName, name, resource).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create a IamAccessKeyMetadata. Please note that end user resource creation is currently restricted, but it will + * be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of IamAccessKeyMetadata. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrReplaceAsync(String resourceGroupName, String name, + IamAccessKeyMetadataInner resource, Context context) { + return beginCreateOrReplaceAsync(resourceGroupName, name, resource, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create a IamAccessKeyMetadata. Please note that end user resource creation is currently restricted, but it will + * be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of IamAccessKeyMetadata. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public IamAccessKeyMetadataInner createOrReplace(String resourceGroupName, String name, + IamAccessKeyMetadataInner resource) { + return createOrReplaceAsync(resourceGroupName, name, resource).block(); + } + + /** + * Create a IamAccessKeyMetadata. Please note that end user resource creation is currently restricted, but it will + * be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of IamAccessKeyMetadata. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public IamAccessKeyMetadataInner createOrReplace(String resourceGroupName, String name, + IamAccessKeyMetadataInner resource, Context context) { + return createOrReplaceAsync(resourceGroupName, name, resource, context).block(); + } + + /** + * Update a IamAccessKeyMetadata. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of IamAccessKeyMetadata. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync(String resourceGroupName, String name, + IamAccessKeyMetadataTagsUpdate properties) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (properties == null) { + return Mono.error(new IllegalArgumentException("Parameter properties is required and cannot be null.")); + } else { + properties.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.update(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, properties, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Update a IamAccessKeyMetadata. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of IamAccessKeyMetadata. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync(String resourceGroupName, String name, + IamAccessKeyMetadataTagsUpdate properties, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (properties == null) { + return Mono.error(new IllegalArgumentException("Parameter properties is required and cannot be null.")); + } else { + properties.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.update(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, name, properties, accept, context); + } + + /** + * Update a IamAccessKeyMetadata. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of IamAccessKeyMetadata. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, IamAccessKeyMetadataInner> + beginUpdateAsync(String resourceGroupName, String name, IamAccessKeyMetadataTagsUpdate properties) { + Mono>> mono = updateWithResponseAsync(resourceGroupName, name, properties); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), IamAccessKeyMetadataInner.class, IamAccessKeyMetadataInner.class, + this.client.getContext()); + } + + /** + * Update a IamAccessKeyMetadata. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of IamAccessKeyMetadata. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, IamAccessKeyMetadataInner> beginUpdateAsync( + String resourceGroupName, String name, IamAccessKeyMetadataTagsUpdate properties, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = updateWithResponseAsync(resourceGroupName, name, properties, context); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), IamAccessKeyMetadataInner.class, IamAccessKeyMetadataInner.class, context); + } + + /** + * Update a IamAccessKeyMetadata. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of IamAccessKeyMetadata. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, IamAccessKeyMetadataInner> + beginUpdate(String resourceGroupName, String name, IamAccessKeyMetadataTagsUpdate properties) { + return this.beginUpdateAsync(resourceGroupName, name, properties).getSyncPoller(); + } + + /** + * Update a IamAccessKeyMetadata. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of IamAccessKeyMetadata. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, IamAccessKeyMetadataInner> + beginUpdate(String resourceGroupName, String name, IamAccessKeyMetadataTagsUpdate properties, Context context) { + return this.beginUpdateAsync(resourceGroupName, name, properties, context).getSyncPoller(); + } + + /** + * Update a IamAccessKeyMetadata. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of IamAccessKeyMetadata. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync(String resourceGroupName, String name, + IamAccessKeyMetadataTagsUpdate properties) { + return beginUpdateAsync(resourceGroupName, name, properties).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Update a IamAccessKeyMetadata. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of IamAccessKeyMetadata. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync(String resourceGroupName, String name, + IamAccessKeyMetadataTagsUpdate properties, Context context) { + return beginUpdateAsync(resourceGroupName, name, properties, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Update a IamAccessKeyMetadata. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of IamAccessKeyMetadata. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public IamAccessKeyMetadataInner update(String resourceGroupName, String name, + IamAccessKeyMetadataTagsUpdate properties) { + return updateAsync(resourceGroupName, name, properties).block(); + } + + /** + * Update a IamAccessKeyMetadata. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of IamAccessKeyMetadata. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public IamAccessKeyMetadataInner update(String resourceGroupName, String name, + IamAccessKeyMetadataTagsUpdate properties, Context context) { + return updateAsync(resourceGroupName, name, properties, context).block(); + } + + /** + * Delete a IamAccessKeyMetadata. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of IamAccessKeyMetadata. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync(String resourceGroupName, String name) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Delete a IamAccessKeyMetadata. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of IamAccessKeyMetadata. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync(String resourceGroupName, String name, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.delete(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, name, accept, context); + } + + /** + * Delete a IamAccessKeyMetadata. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of IamAccessKeyMetadata. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String name) { + Mono>> mono = deleteWithResponseAsync(resourceGroupName, name); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); + } + + /** + * Delete a IamAccessKeyMetadata. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of IamAccessKeyMetadata. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String name, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = deleteWithResponseAsync(resourceGroupName, name, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + context); + } + + /** + * Delete a IamAccessKeyMetadata. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of IamAccessKeyMetadata. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String name) { + return this.beginDeleteAsync(resourceGroupName, name).getSyncPoller(); + } + + /** + * Delete a IamAccessKeyMetadata. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of IamAccessKeyMetadata. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String name, Context context) { + return this.beginDeleteAsync(resourceGroupName, name, context).getSyncPoller(); + } + + /** + * Delete a IamAccessKeyMetadata. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of IamAccessKeyMetadata. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String name) { + return beginDeleteAsync(resourceGroupName, name).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete a IamAccessKeyMetadata. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of IamAccessKeyMetadata. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String name, Context context) { + return beginDeleteAsync(resourceGroupName, name, context).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete a IamAccessKeyMetadata. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of IamAccessKeyMetadata. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String name) { + deleteAsync(resourceGroupName, name).block(); + } + + /** + * Delete a IamAccessKeyMetadata. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of IamAccessKeyMetadata. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String name, Context context) { + deleteAsync(resourceGroupName, name, context).block(); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a IamAccessKeyMetadata list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listBySubscriptionNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a IamAccessKeyMetadata list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listBySubscriptionNextSinglePageAsync(String nextLink, + Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a IamAccessKeyMetadata list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a IamAccessKeyMetadata list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupNextSinglePageAsync(String nextLink, + Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/IamAccessKeyMetadataInfoesImpl.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/IamAccessKeyMetadataInfoesImpl.java new file mode 100644 index 000000000000..9554d2f2a67e --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/IamAccessKeyMetadataInfoesImpl.java @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.awsconnector.fluent.IamAccessKeyMetadataInfoesClient; +import com.azure.resourcemanager.awsconnector.fluent.models.IamAccessKeyMetadataInner; +import com.azure.resourcemanager.awsconnector.models.IamAccessKeyMetadata; +import com.azure.resourcemanager.awsconnector.models.IamAccessKeyMetadataInfoes; + +public final class IamAccessKeyMetadataInfoesImpl implements IamAccessKeyMetadataInfoes { + private static final ClientLogger LOGGER = new ClientLogger(IamAccessKeyMetadataInfoesImpl.class); + + private final IamAccessKeyMetadataInfoesClient innerClient; + + private final com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager; + + public IamAccessKeyMetadataInfoesImpl(IamAccessKeyMetadataInfoesClient innerClient, + com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return ResourceManagerUtils.mapPage(inner, inner1 -> new IamAccessKeyMetadataImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new IamAccessKeyMetadataImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName); + return ResourceManagerUtils.mapPage(inner, inner1 -> new IamAccessKeyMetadataImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + PagedIterable inner + = this.serviceClient().listByResourceGroup(resourceGroupName, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new IamAccessKeyMetadataImpl(inner1, this.manager())); + } + + public Response getByResourceGroupWithResponse(String resourceGroupName, String name, + Context context) { + Response inner + = this.serviceClient().getByResourceGroupWithResponse(resourceGroupName, name, context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new IamAccessKeyMetadataImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public IamAccessKeyMetadata getByResourceGroup(String resourceGroupName, String name) { + IamAccessKeyMetadataInner inner = this.serviceClient().getByResourceGroup(resourceGroupName, name); + if (inner != null) { + return new IamAccessKeyMetadataImpl(inner, this.manager()); + } else { + return null; + } + } + + public void deleteByResourceGroup(String resourceGroupName, String name) { + this.serviceClient().delete(resourceGroupName, name); + } + + public void delete(String resourceGroupName, String name, Context context) { + this.serviceClient().delete(resourceGroupName, name, context); + } + + public IamAccessKeyMetadata getById(String id) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String name = ResourceManagerUtils.getValueFromIdByName(id, "iamAccessKeyMetadata"); + if (name == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'iamAccessKeyMetadata'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, name, Context.NONE).getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String name = ResourceManagerUtils.getValueFromIdByName(id, "iamAccessKeyMetadata"); + if (name == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'iamAccessKeyMetadata'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, name, context); + } + + public void deleteById(String id) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String name = ResourceManagerUtils.getValueFromIdByName(id, "iamAccessKeyMetadata"); + if (name == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'iamAccessKeyMetadata'.", id))); + } + this.delete(resourceGroupName, name, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String name = ResourceManagerUtils.getValueFromIdByName(id, "iamAccessKeyMetadata"); + if (name == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'iamAccessKeyMetadata'.", id))); + } + this.delete(resourceGroupName, name, context); + } + + private IamAccessKeyMetadataInfoesClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.awsconnector.AwsconnectorManager manager() { + return this.serviceManager; + } + + public IamAccessKeyMetadataImpl define(String name) { + return new IamAccessKeyMetadataImpl(name, this.manager()); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/IamGroupImpl.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/IamGroupImpl.java new file mode 100644 index 000000000000..be482e48f8b3 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/IamGroupImpl.java @@ -0,0 +1,175 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.implementation; + +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.awsconnector.fluent.models.IamGroupInner; +import com.azure.resourcemanager.awsconnector.models.IamGroup; +import com.azure.resourcemanager.awsconnector.models.IamGroupProperties; +import com.azure.resourcemanager.awsconnector.models.IamGroupTagsUpdate; +import java.util.Collections; +import java.util.Map; + +public final class IamGroupImpl implements IamGroup, IamGroup.Definition, IamGroup.Update { + private IamGroupInner innerObject; + + private final com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public String location() { + return this.innerModel().location(); + } + + public Map tags() { + Map inner = this.innerModel().tags(); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } + } + + public IamGroupProperties properties() { + return this.innerModel().properties(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public String resourceGroupName() { + return resourceGroupName; + } + + public IamGroupInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.awsconnector.AwsconnectorManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String name; + + private IamGroupTagsUpdate updateProperties; + + public IamGroupImpl withExistingResourceGroup(String resourceGroupName) { + this.resourceGroupName = resourceGroupName; + return this; + } + + public IamGroup create() { + this.innerObject = serviceManager.serviceClient() + .getIamGroups() + .createOrReplace(resourceGroupName, name, this.innerModel(), Context.NONE); + return this; + } + + public IamGroup create(Context context) { + this.innerObject = serviceManager.serviceClient() + .getIamGroups() + .createOrReplace(resourceGroupName, name, this.innerModel(), context); + return this; + } + + IamGroupImpl(String name, com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager) { + this.innerObject = new IamGroupInner(); + this.serviceManager = serviceManager; + this.name = name; + } + + public IamGroupImpl update() { + this.updateProperties = new IamGroupTagsUpdate(); + return this; + } + + public IamGroup apply() { + this.innerObject = serviceManager.serviceClient() + .getIamGroups() + .update(resourceGroupName, name, updateProperties, Context.NONE); + return this; + } + + public IamGroup apply(Context context) { + this.innerObject + = serviceManager.serviceClient().getIamGroups().update(resourceGroupName, name, updateProperties, context); + return this; + } + + IamGroupImpl(IamGroupInner innerObject, com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.name = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "iamGroups"); + } + + public IamGroup refresh() { + this.innerObject = serviceManager.serviceClient() + .getIamGroups() + .getByResourceGroupWithResponse(resourceGroupName, name, Context.NONE) + .getValue(); + return this; + } + + public IamGroup refresh(Context context) { + this.innerObject = serviceManager.serviceClient() + .getIamGroups() + .getByResourceGroupWithResponse(resourceGroupName, name, context) + .getValue(); + return this; + } + + public IamGroupImpl withRegion(Region location) { + this.innerModel().withLocation(location.toString()); + return this; + } + + public IamGroupImpl withRegion(String location) { + this.innerModel().withLocation(location); + return this; + } + + public IamGroupImpl withTags(Map tags) { + if (isInCreateMode()) { + this.innerModel().withTags(tags); + return this; + } else { + this.updateProperties.withTags(tags); + return this; + } + } + + public IamGroupImpl withProperties(IamGroupProperties properties) { + this.innerModel().withProperties(properties); + return this; + } + + private boolean isInCreateMode() { + return this.innerModel().id() == null; + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/IamGroupsClientImpl.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/IamGroupsClientImpl.java new file mode 100644 index 000000000000..d5a42ec3d597 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/IamGroupsClientImpl.java @@ -0,0 +1,1273 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.Patch; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.awsconnector.fluent.IamGroupsClient; +import com.azure.resourcemanager.awsconnector.fluent.models.IamGroupInner; +import com.azure.resourcemanager.awsconnector.models.IamGroupListResult; +import com.azure.resourcemanager.awsconnector.models.IamGroupTagsUpdate; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in IamGroupsClient. + */ +public final class IamGroupsClientImpl implements IamGroupsClient { + /** + * The proxy service used to perform REST calls. + */ + private final IamGroupsService service; + + /** + * The service client containing this operation class. + */ + private final MicrosoftAwsConnectorImpl client; + + /** + * Initializes an instance of IamGroupsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + IamGroupsClientImpl(MicrosoftAwsConnectorImpl client) { + this.service + = RestProxy.create(IamGroupsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for MicrosoftAwsConnectorIamGroups to be used by the proxy service to + * perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "MicrosoftAwsConnecto") + public interface IamGroupsService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.AwsConnector/iamGroups") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/iamGroups") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroup(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/iamGroups/{name}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getByResourceGroup(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("name") String name, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/iamGroups/{name}") + @ExpectedResponses({ 200, 201 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrReplace(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("name") String name, + @BodyParam("application/json") IamGroupInner resource, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/iamGroups/{name}") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> update(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("name") String name, + @BodyParam("application/json") IamGroupTagsUpdate properties, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/iamGroups/{name}") + @ExpectedResponses({ 202, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("name") String name, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listBySubscriptionNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroupNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); + } + + /** + * List IamGroup resources by subscription ID. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a IamGroup list operation along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync() { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), + res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List IamGroup resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a IamGroup list operation along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), accept, + context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * List IamGroup resources by subscription ID. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a IamGroup list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>(() -> listSinglePageAsync(), + nextLink -> listBySubscriptionNextSinglePageAsync(nextLink)); + } + + /** + * List IamGroup resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a IamGroup list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(Context context) { + return new PagedFlux<>(() -> listSinglePageAsync(context), + nextLink -> listBySubscriptionNextSinglePageAsync(nextLink, context)); + } + + /** + * List IamGroup resources by subscription ID. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a IamGroup list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + return new PagedIterable<>(listAsync()); + } + + /** + * List IamGroup resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a IamGroup list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Context context) { + return new PagedIterable<>(listAsync(context)); + } + + /** + * List IamGroup resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a IamGroup list operation along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), + res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List IamGroup resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a IamGroup list operation along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * List IamGroup resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a IamGroup list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName) { + return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); + } + + /** + * List IamGroup resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a IamGroup list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName, Context context) { + return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName, context), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink, context)); + } + + /** + * List IamGroup resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a IamGroup list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName)); + } + + /** + * List IamGroup resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a IamGroup list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, context)); + } + + /** + * Get a IamGroup. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of IamGroup. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a IamGroup along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync(String resourceGroupName, String name) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.getByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get a IamGroup. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of IamGroup. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a IamGroup along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync(String resourceGroupName, String name, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.getByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, accept, context); + } + + /** + * Get a IamGroup. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of IamGroup. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a IamGroup on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getByResourceGroupAsync(String resourceGroupName, String name) { + return getByResourceGroupWithResponseAsync(resourceGroupName, name) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Get a IamGroup. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of IamGroup. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a IamGroup along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getByResourceGroupWithResponse(String resourceGroupName, String name, + Context context) { + return getByResourceGroupWithResponseAsync(resourceGroupName, name, context).block(); + } + + /** + * Get a IamGroup. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of IamGroup. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a IamGroup. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public IamGroupInner getByResourceGroup(String resourceGroupName, String name) { + return getByResourceGroupWithResponse(resourceGroupName, name, Context.NONE).getValue(); + } + + /** + * Create a IamGroup. Please note that end user resource creation is currently restricted, but it will be enabled in + * the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of IamGroup. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrReplaceWithResponseAsync(String resourceGroupName, String name, + IamGroupInner resource) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (resource == null) { + return Mono.error(new IllegalArgumentException("Parameter resource is required and cannot be null.")); + } else { + resource.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.createOrReplace(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, resource, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Create a IamGroup. Please note that end user resource creation is currently restricted, but it will be enabled in + * the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of IamGroup. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrReplaceWithResponseAsync(String resourceGroupName, String name, + IamGroupInner resource, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (resource == null) { + return Mono.error(new IllegalArgumentException("Parameter resource is required and cannot be null.")); + } else { + resource.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.createOrReplace(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, resource, accept, context); + } + + /** + * Create a IamGroup. Please note that end user resource creation is currently restricted, but it will be enabled in + * the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of IamGroup. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, IamGroupInner> beginCreateOrReplaceAsync(String resourceGroupName, + String name, IamGroupInner resource) { + Mono>> mono = createOrReplaceWithResponseAsync(resourceGroupName, name, resource); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + IamGroupInner.class, IamGroupInner.class, this.client.getContext()); + } + + /** + * Create a IamGroup. Please note that end user resource creation is currently restricted, but it will be enabled in + * the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of IamGroup. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, IamGroupInner> beginCreateOrReplaceAsync(String resourceGroupName, + String name, IamGroupInner resource, Context context) { + context = this.client.mergeContext(context); + Mono>> mono + = createOrReplaceWithResponseAsync(resourceGroupName, name, resource, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + IamGroupInner.class, IamGroupInner.class, context); + } + + /** + * Create a IamGroup. Please note that end user resource creation is currently restricted, but it will be enabled in + * the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of IamGroup. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, IamGroupInner> beginCreateOrReplace(String resourceGroupName, + String name, IamGroupInner resource) { + return this.beginCreateOrReplaceAsync(resourceGroupName, name, resource).getSyncPoller(); + } + + /** + * Create a IamGroup. Please note that end user resource creation is currently restricted, but it will be enabled in + * the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of IamGroup. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, IamGroupInner> beginCreateOrReplace(String resourceGroupName, + String name, IamGroupInner resource, Context context) { + return this.beginCreateOrReplaceAsync(resourceGroupName, name, resource, context).getSyncPoller(); + } + + /** + * Create a IamGroup. Please note that end user resource creation is currently restricted, but it will be enabled in + * the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of IamGroup. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrReplaceAsync(String resourceGroupName, String name, IamGroupInner resource) { + return beginCreateOrReplaceAsync(resourceGroupName, name, resource).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create a IamGroup. Please note that end user resource creation is currently restricted, but it will be enabled in + * the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of IamGroup. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrReplaceAsync(String resourceGroupName, String name, IamGroupInner resource, + Context context) { + return beginCreateOrReplaceAsync(resourceGroupName, name, resource, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create a IamGroup. Please note that end user resource creation is currently restricted, but it will be enabled in + * the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of IamGroup. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public IamGroupInner createOrReplace(String resourceGroupName, String name, IamGroupInner resource) { + return createOrReplaceAsync(resourceGroupName, name, resource).block(); + } + + /** + * Create a IamGroup. Please note that end user resource creation is currently restricted, but it will be enabled in + * the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of IamGroup. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public IamGroupInner createOrReplace(String resourceGroupName, String name, IamGroupInner resource, + Context context) { + return createOrReplaceAsync(resourceGroupName, name, resource, context).block(); + } + + /** + * Update a IamGroup. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of IamGroup. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync(String resourceGroupName, String name, + IamGroupTagsUpdate properties) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (properties == null) { + return Mono.error(new IllegalArgumentException("Parameter properties is required and cannot be null.")); + } else { + properties.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.update(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, properties, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Update a IamGroup. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of IamGroup. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync(String resourceGroupName, String name, + IamGroupTagsUpdate properties, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (properties == null) { + return Mono.error(new IllegalArgumentException("Parameter properties is required and cannot be null.")); + } else { + properties.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.update(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, name, properties, accept, context); + } + + /** + * Update a IamGroup. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of IamGroup. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, IamGroupInner> beginUpdateAsync(String resourceGroupName, String name, + IamGroupTagsUpdate properties) { + Mono>> mono = updateWithResponseAsync(resourceGroupName, name, properties); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + IamGroupInner.class, IamGroupInner.class, this.client.getContext()); + } + + /** + * Update a IamGroup. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of IamGroup. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, IamGroupInner> beginUpdateAsync(String resourceGroupName, String name, + IamGroupTagsUpdate properties, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = updateWithResponseAsync(resourceGroupName, name, properties, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + IamGroupInner.class, IamGroupInner.class, context); + } + + /** + * Update a IamGroup. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of IamGroup. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, IamGroupInner> beginUpdate(String resourceGroupName, String name, + IamGroupTagsUpdate properties) { + return this.beginUpdateAsync(resourceGroupName, name, properties).getSyncPoller(); + } + + /** + * Update a IamGroup. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of IamGroup. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, IamGroupInner> beginUpdate(String resourceGroupName, String name, + IamGroupTagsUpdate properties, Context context) { + return this.beginUpdateAsync(resourceGroupName, name, properties, context).getSyncPoller(); + } + + /** + * Update a IamGroup. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of IamGroup. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync(String resourceGroupName, String name, IamGroupTagsUpdate properties) { + return beginUpdateAsync(resourceGroupName, name, properties).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Update a IamGroup. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of IamGroup. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync(String resourceGroupName, String name, IamGroupTagsUpdate properties, + Context context) { + return beginUpdateAsync(resourceGroupName, name, properties, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Update a IamGroup. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of IamGroup. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public IamGroupInner update(String resourceGroupName, String name, IamGroupTagsUpdate properties) { + return updateAsync(resourceGroupName, name, properties).block(); + } + + /** + * Update a IamGroup. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of IamGroup. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public IamGroupInner update(String resourceGroupName, String name, IamGroupTagsUpdate properties, Context context) { + return updateAsync(resourceGroupName, name, properties, context).block(); + } + + /** + * Delete a IamGroup. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of IamGroup. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync(String resourceGroupName, String name) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Delete a IamGroup. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of IamGroup. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync(String resourceGroupName, String name, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.delete(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, name, accept, context); + } + + /** + * Delete a IamGroup. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of IamGroup. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String name) { + Mono>> mono = deleteWithResponseAsync(resourceGroupName, name); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); + } + + /** + * Delete a IamGroup. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of IamGroup. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String name, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = deleteWithResponseAsync(resourceGroupName, name, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + context); + } + + /** + * Delete a IamGroup. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of IamGroup. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String name) { + return this.beginDeleteAsync(resourceGroupName, name).getSyncPoller(); + } + + /** + * Delete a IamGroup. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of IamGroup. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String name, Context context) { + return this.beginDeleteAsync(resourceGroupName, name, context).getSyncPoller(); + } + + /** + * Delete a IamGroup. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of IamGroup. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String name) { + return beginDeleteAsync(resourceGroupName, name).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete a IamGroup. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of IamGroup. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String name, Context context) { + return beginDeleteAsync(resourceGroupName, name, context).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete a IamGroup. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of IamGroup. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String name) { + deleteAsync(resourceGroupName, name).block(); + } + + /** + * Delete a IamGroup. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of IamGroup. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String name, Context context) { + deleteAsync(resourceGroupName, name, context).block(); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a IamGroup list operation along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listBySubscriptionNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), + res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a IamGroup list operation along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listBySubscriptionNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a IamGroup list operation along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), + res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a IamGroup list operation along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupNextSinglePageAsync(String nextLink, + Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/IamGroupsImpl.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/IamGroupsImpl.java new file mode 100644 index 000000000000..a954ba707beb --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/IamGroupsImpl.java @@ -0,0 +1,145 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.awsconnector.fluent.IamGroupsClient; +import com.azure.resourcemanager.awsconnector.fluent.models.IamGroupInner; +import com.azure.resourcemanager.awsconnector.models.IamGroup; +import com.azure.resourcemanager.awsconnector.models.IamGroups; + +public final class IamGroupsImpl implements IamGroups { + private static final ClientLogger LOGGER = new ClientLogger(IamGroupsImpl.class); + + private final IamGroupsClient innerClient; + + private final com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager; + + public IamGroupsImpl(IamGroupsClient innerClient, + com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return ResourceManagerUtils.mapPage(inner, inner1 -> new IamGroupImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new IamGroupImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName); + return ResourceManagerUtils.mapPage(inner, inner1 -> new IamGroupImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new IamGroupImpl(inner1, this.manager())); + } + + public Response getByResourceGroupWithResponse(String resourceGroupName, String name, Context context) { + Response inner + = this.serviceClient().getByResourceGroupWithResponse(resourceGroupName, name, context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new IamGroupImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public IamGroup getByResourceGroup(String resourceGroupName, String name) { + IamGroupInner inner = this.serviceClient().getByResourceGroup(resourceGroupName, name); + if (inner != null) { + return new IamGroupImpl(inner, this.manager()); + } else { + return null; + } + } + + public void deleteByResourceGroup(String resourceGroupName, String name) { + this.serviceClient().delete(resourceGroupName, name); + } + + public void delete(String resourceGroupName, String name, Context context) { + this.serviceClient().delete(resourceGroupName, name, context); + } + + public IamGroup getById(String id) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String name = ResourceManagerUtils.getValueFromIdByName(id, "iamGroups"); + if (name == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'iamGroups'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, name, Context.NONE).getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String name = ResourceManagerUtils.getValueFromIdByName(id, "iamGroups"); + if (name == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'iamGroups'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, name, context); + } + + public void deleteById(String id) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String name = ResourceManagerUtils.getValueFromIdByName(id, "iamGroups"); + if (name == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'iamGroups'.", id))); + } + this.delete(resourceGroupName, name, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String name = ResourceManagerUtils.getValueFromIdByName(id, "iamGroups"); + if (name == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'iamGroups'.", id))); + } + this.delete(resourceGroupName, name, context); + } + + private IamGroupsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.awsconnector.AwsconnectorManager manager() { + return this.serviceManager; + } + + public IamGroupImpl define(String name) { + return new IamGroupImpl(name, this.manager()); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/IamInstanceProfileAutoGeneratedImpl.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/IamInstanceProfileAutoGeneratedImpl.java new file mode 100644 index 000000000000..18fbf74c33c6 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/IamInstanceProfileAutoGeneratedImpl.java @@ -0,0 +1,179 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.implementation; + +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.awsconnector.fluent.models.IamInstanceProfileAutoGeneratedInner; +import com.azure.resourcemanager.awsconnector.models.IamInstanceProfileAutoGenerated; +import com.azure.resourcemanager.awsconnector.models.IamInstanceProfileProperties; +import com.azure.resourcemanager.awsconnector.models.IamInstanceProfileTagsUpdate; +import java.util.Collections; +import java.util.Map; + +public final class IamInstanceProfileAutoGeneratedImpl implements IamInstanceProfileAutoGenerated, + IamInstanceProfileAutoGenerated.Definition, IamInstanceProfileAutoGenerated.Update { + private IamInstanceProfileAutoGeneratedInner innerObject; + + private final com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public String location() { + return this.innerModel().location(); + } + + public Map tags() { + Map inner = this.innerModel().tags(); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } + } + + public IamInstanceProfileProperties properties() { + return this.innerModel().properties(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public String resourceGroupName() { + return resourceGroupName; + } + + public IamInstanceProfileAutoGeneratedInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.awsconnector.AwsconnectorManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String name; + + private IamInstanceProfileTagsUpdate updateProperties; + + public IamInstanceProfileAutoGeneratedImpl withExistingResourceGroup(String resourceGroupName) { + this.resourceGroupName = resourceGroupName; + return this; + } + + public IamInstanceProfileAutoGenerated create() { + this.innerObject = serviceManager.serviceClient() + .getIamInstanceProfiles() + .createOrUpdate(resourceGroupName, name, this.innerModel(), Context.NONE); + return this; + } + + public IamInstanceProfileAutoGenerated create(Context context) { + this.innerObject = serviceManager.serviceClient() + .getIamInstanceProfiles() + .createOrUpdate(resourceGroupName, name, this.innerModel(), context); + return this; + } + + IamInstanceProfileAutoGeneratedImpl(String name, + com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager) { + this.innerObject = new IamInstanceProfileAutoGeneratedInner(); + this.serviceManager = serviceManager; + this.name = name; + } + + public IamInstanceProfileAutoGeneratedImpl update() { + this.updateProperties = new IamInstanceProfileTagsUpdate(); + return this; + } + + public IamInstanceProfileAutoGenerated apply() { + this.innerObject = serviceManager.serviceClient() + .getIamInstanceProfiles() + .update(resourceGroupName, name, updateProperties, Context.NONE); + return this; + } + + public IamInstanceProfileAutoGenerated apply(Context context) { + this.innerObject = serviceManager.serviceClient() + .getIamInstanceProfiles() + .update(resourceGroupName, name, updateProperties, context); + return this; + } + + IamInstanceProfileAutoGeneratedImpl(IamInstanceProfileAutoGeneratedInner innerObject, + com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.name = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "iamInstanceProfiles"); + } + + public IamInstanceProfileAutoGenerated refresh() { + this.innerObject = serviceManager.serviceClient() + .getIamInstanceProfiles() + .getByResourceGroupWithResponse(resourceGroupName, name, Context.NONE) + .getValue(); + return this; + } + + public IamInstanceProfileAutoGenerated refresh(Context context) { + this.innerObject = serviceManager.serviceClient() + .getIamInstanceProfiles() + .getByResourceGroupWithResponse(resourceGroupName, name, context) + .getValue(); + return this; + } + + public IamInstanceProfileAutoGeneratedImpl withRegion(Region location) { + this.innerModel().withLocation(location.toString()); + return this; + } + + public IamInstanceProfileAutoGeneratedImpl withRegion(String location) { + this.innerModel().withLocation(location); + return this; + } + + public IamInstanceProfileAutoGeneratedImpl withTags(Map tags) { + if (isInCreateMode()) { + this.innerModel().withTags(tags); + return this; + } else { + this.updateProperties.withTags(tags); + return this; + } + } + + public IamInstanceProfileAutoGeneratedImpl withProperties(IamInstanceProfileProperties properties) { + this.innerModel().withProperties(properties); + return this; + } + + private boolean isInCreateMode() { + return this.innerModel().id() == null; + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/IamInstanceProfilesClientImpl.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/IamInstanceProfilesClientImpl.java new file mode 100644 index 000000000000..107ad56f3674 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/IamInstanceProfilesClientImpl.java @@ -0,0 +1,1292 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.Patch; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.awsconnector.fluent.IamInstanceProfilesClient; +import com.azure.resourcemanager.awsconnector.fluent.models.IamInstanceProfileAutoGeneratedInner; +import com.azure.resourcemanager.awsconnector.models.IamInstanceProfileListResult; +import com.azure.resourcemanager.awsconnector.models.IamInstanceProfileTagsUpdate; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in IamInstanceProfilesClient. + */ +public final class IamInstanceProfilesClientImpl implements IamInstanceProfilesClient { + /** + * The proxy service used to perform REST calls. + */ + private final IamInstanceProfilesService service; + + /** + * The service client containing this operation class. + */ + private final MicrosoftAwsConnectorImpl client; + + /** + * Initializes an instance of IamInstanceProfilesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + IamInstanceProfilesClientImpl(MicrosoftAwsConnectorImpl client) { + this.service = RestProxy.create(IamInstanceProfilesService.class, client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for MicrosoftAwsConnectorIamInstanceProfiles to be used by the proxy + * service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "MicrosoftAwsConnecto") + public interface IamInstanceProfilesService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.AwsConnector/iamInstanceProfiles") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/iamInstanceProfiles") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroup(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/iamInstanceProfiles/{name}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getByResourceGroup(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("name") String name, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/iamInstanceProfiles/{name}") + @ExpectedResponses({ 200, 201 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrUpdate(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("name") String name, + @BodyParam("application/json") IamInstanceProfileAutoGeneratedInner resource, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/iamInstanceProfiles/{name}") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> update(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("name") String name, + @BodyParam("application/json") IamInstanceProfileTagsUpdate properties, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/iamInstanceProfiles/{name}") + @ExpectedResponses({ 202, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("name") String name, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listBySubscriptionNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroupNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); + } + + /** + * List IamInstanceProfile resources by subscription ID. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a IamInstanceProfile list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync() { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List IamInstanceProfile resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a IamInstanceProfile list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), accept, + context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * List IamInstanceProfile resources by subscription ID. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a IamInstanceProfile list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>(() -> listSinglePageAsync(), + nextLink -> listBySubscriptionNextSinglePageAsync(nextLink)); + } + + /** + * List IamInstanceProfile resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a IamInstanceProfile list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(Context context) { + return new PagedFlux<>(() -> listSinglePageAsync(context), + nextLink -> listBySubscriptionNextSinglePageAsync(nextLink, context)); + } + + /** + * List IamInstanceProfile resources by subscription ID. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a IamInstanceProfile list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + return new PagedIterable<>(listAsync()); + } + + /** + * List IamInstanceProfile resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a IamInstanceProfile list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Context context) { + return new PagedIterable<>(listAsync(context)); + } + + /** + * List IamInstanceProfile resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a IamInstanceProfile list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> + listByResourceGroupSinglePageAsync(String resourceGroupName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List IamInstanceProfile resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a IamInstanceProfile list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> + listByResourceGroupSinglePageAsync(String resourceGroupName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * List IamInstanceProfile resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a IamInstanceProfile list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName) { + return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); + } + + /** + * List IamInstanceProfile resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a IamInstanceProfile list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName, + Context context) { + return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName, context), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink, context)); + } + + /** + * List IamInstanceProfile resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a IamInstanceProfile list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName)); + } + + /** + * List IamInstanceProfile resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a IamInstanceProfile list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName, + Context context) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, context)); + } + + /** + * Get a IamInstanceProfile. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of IamInstanceProfile. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a IamInstanceProfile along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> + getByResourceGroupWithResponseAsync(String resourceGroupName, String name) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.getByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get a IamInstanceProfile. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of IamInstanceProfile. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a IamInstanceProfile along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> + getByResourceGroupWithResponseAsync(String resourceGroupName, String name, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.getByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, accept, context); + } + + /** + * Get a IamInstanceProfile. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of IamInstanceProfile. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a IamInstanceProfile on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getByResourceGroupAsync(String resourceGroupName, String name) { + return getByResourceGroupWithResponseAsync(resourceGroupName, name) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Get a IamInstanceProfile. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of IamInstanceProfile. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a IamInstanceProfile along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getByResourceGroupWithResponse(String resourceGroupName, + String name, Context context) { + return getByResourceGroupWithResponseAsync(resourceGroupName, name, context).block(); + } + + /** + * Get a IamInstanceProfile. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of IamInstanceProfile. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a IamInstanceProfile. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public IamInstanceProfileAutoGeneratedInner getByResourceGroup(String resourceGroupName, String name) { + return getByResourceGroupWithResponse(resourceGroupName, name, Context.NONE).getValue(); + } + + /** + * Create a IamInstanceProfile. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of IamInstanceProfile. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync(String resourceGroupName, String name, + IamInstanceProfileAutoGeneratedInner resource) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (resource == null) { + return Mono.error(new IllegalArgumentException("Parameter resource is required and cannot be null.")); + } else { + resource.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, resource, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Create a IamInstanceProfile. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of IamInstanceProfile. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync(String resourceGroupName, String name, + IamInstanceProfileAutoGeneratedInner resource, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (resource == null) { + return Mono.error(new IllegalArgumentException("Parameter resource is required and cannot be null.")); + } else { + resource.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.createOrUpdate(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, resource, accept, context); + } + + /** + * Create a IamInstanceProfile. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of IamInstanceProfile. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, IamInstanceProfileAutoGeneratedInner> + beginCreateOrUpdateAsync(String resourceGroupName, String name, IamInstanceProfileAutoGeneratedInner resource) { + Mono>> mono = createOrUpdateWithResponseAsync(resourceGroupName, name, resource); + return this.client.getLroResult( + mono, this.client.getHttpPipeline(), IamInstanceProfileAutoGeneratedInner.class, + IamInstanceProfileAutoGeneratedInner.class, this.client.getContext()); + } + + /** + * Create a IamInstanceProfile. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of IamInstanceProfile. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, IamInstanceProfileAutoGeneratedInner> + beginCreateOrUpdateAsync(String resourceGroupName, String name, IamInstanceProfileAutoGeneratedInner resource, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono + = createOrUpdateWithResponseAsync(resourceGroupName, name, resource, context); + return this.client.getLroResult( + mono, this.client.getHttpPipeline(), IamInstanceProfileAutoGeneratedInner.class, + IamInstanceProfileAutoGeneratedInner.class, context); + } + + /** + * Create a IamInstanceProfile. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of IamInstanceProfile. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, IamInstanceProfileAutoGeneratedInner> + beginCreateOrUpdate(String resourceGroupName, String name, IamInstanceProfileAutoGeneratedInner resource) { + return this.beginCreateOrUpdateAsync(resourceGroupName, name, resource).getSyncPoller(); + } + + /** + * Create a IamInstanceProfile. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of IamInstanceProfile. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, IamInstanceProfileAutoGeneratedInner> + beginCreateOrUpdate(String resourceGroupName, String name, IamInstanceProfileAutoGeneratedInner resource, + Context context) { + return this.beginCreateOrUpdateAsync(resourceGroupName, name, resource, context).getSyncPoller(); + } + + /** + * Create a IamInstanceProfile. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of IamInstanceProfile. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync(String resourceGroupName, String name, + IamInstanceProfileAutoGeneratedInner resource) { + return beginCreateOrUpdateAsync(resourceGroupName, name, resource).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create a IamInstanceProfile. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of IamInstanceProfile. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync(String resourceGroupName, String name, + IamInstanceProfileAutoGeneratedInner resource, Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, name, resource, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create a IamInstanceProfile. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of IamInstanceProfile. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public IamInstanceProfileAutoGeneratedInner createOrUpdate(String resourceGroupName, String name, + IamInstanceProfileAutoGeneratedInner resource) { + return createOrUpdateAsync(resourceGroupName, name, resource).block(); + } + + /** + * Create a IamInstanceProfile. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of IamInstanceProfile. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public IamInstanceProfileAutoGeneratedInner createOrUpdate(String resourceGroupName, String name, + IamInstanceProfileAutoGeneratedInner resource, Context context) { + return createOrUpdateAsync(resourceGroupName, name, resource, context).block(); + } + + /** + * Update a IamInstanceProfile. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of IamInstanceProfile. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync(String resourceGroupName, String name, + IamInstanceProfileTagsUpdate properties) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (properties == null) { + return Mono.error(new IllegalArgumentException("Parameter properties is required and cannot be null.")); + } else { + properties.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.update(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, properties, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Update a IamInstanceProfile. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of IamInstanceProfile. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync(String resourceGroupName, String name, + IamInstanceProfileTagsUpdate properties, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (properties == null) { + return Mono.error(new IllegalArgumentException("Parameter properties is required and cannot be null.")); + } else { + properties.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.update(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, name, properties, accept, context); + } + + /** + * Update a IamInstanceProfile. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of IamInstanceProfile. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, IamInstanceProfileAutoGeneratedInner> + beginUpdateAsync(String resourceGroupName, String name, IamInstanceProfileTagsUpdate properties) { + Mono>> mono = updateWithResponseAsync(resourceGroupName, name, properties); + return this.client.getLroResult( + mono, this.client.getHttpPipeline(), IamInstanceProfileAutoGeneratedInner.class, + IamInstanceProfileAutoGeneratedInner.class, this.client.getContext()); + } + + /** + * Update a IamInstanceProfile. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of IamInstanceProfile. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, IamInstanceProfileAutoGeneratedInner> + beginUpdateAsync(String resourceGroupName, String name, IamInstanceProfileTagsUpdate properties, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = updateWithResponseAsync(resourceGroupName, name, properties, context); + return this.client.getLroResult( + mono, this.client.getHttpPipeline(), IamInstanceProfileAutoGeneratedInner.class, + IamInstanceProfileAutoGeneratedInner.class, context); + } + + /** + * Update a IamInstanceProfile. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of IamInstanceProfile. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, IamInstanceProfileAutoGeneratedInner> + beginUpdate(String resourceGroupName, String name, IamInstanceProfileTagsUpdate properties) { + return this.beginUpdateAsync(resourceGroupName, name, properties).getSyncPoller(); + } + + /** + * Update a IamInstanceProfile. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of IamInstanceProfile. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, IamInstanceProfileAutoGeneratedInner> + beginUpdate(String resourceGroupName, String name, IamInstanceProfileTagsUpdate properties, Context context) { + return this.beginUpdateAsync(resourceGroupName, name, properties, context).getSyncPoller(); + } + + /** + * Update a IamInstanceProfile. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of IamInstanceProfile. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync(String resourceGroupName, String name, + IamInstanceProfileTagsUpdate properties) { + return beginUpdateAsync(resourceGroupName, name, properties).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Update a IamInstanceProfile. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of IamInstanceProfile. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync(String resourceGroupName, String name, + IamInstanceProfileTagsUpdate properties, Context context) { + return beginUpdateAsync(resourceGroupName, name, properties, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Update a IamInstanceProfile. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of IamInstanceProfile. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public IamInstanceProfileAutoGeneratedInner update(String resourceGroupName, String name, + IamInstanceProfileTagsUpdate properties) { + return updateAsync(resourceGroupName, name, properties).block(); + } + + /** + * Update a IamInstanceProfile. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of IamInstanceProfile. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public IamInstanceProfileAutoGeneratedInner update(String resourceGroupName, String name, + IamInstanceProfileTagsUpdate properties, Context context) { + return updateAsync(resourceGroupName, name, properties, context).block(); + } + + /** + * Delete a IamInstanceProfile. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of IamInstanceProfile. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync(String resourceGroupName, String name) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Delete a IamInstanceProfile. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of IamInstanceProfile. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync(String resourceGroupName, String name, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.delete(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, name, accept, context); + } + + /** + * Delete a IamInstanceProfile. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of IamInstanceProfile. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String name) { + Mono>> mono = deleteWithResponseAsync(resourceGroupName, name); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); + } + + /** + * Delete a IamInstanceProfile. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of IamInstanceProfile. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String name, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = deleteWithResponseAsync(resourceGroupName, name, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + context); + } + + /** + * Delete a IamInstanceProfile. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of IamInstanceProfile. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String name) { + return this.beginDeleteAsync(resourceGroupName, name).getSyncPoller(); + } + + /** + * Delete a IamInstanceProfile. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of IamInstanceProfile. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String name, Context context) { + return this.beginDeleteAsync(resourceGroupName, name, context).getSyncPoller(); + } + + /** + * Delete a IamInstanceProfile. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of IamInstanceProfile. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String name) { + return beginDeleteAsync(resourceGroupName, name).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete a IamInstanceProfile. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of IamInstanceProfile. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String name, Context context) { + return beginDeleteAsync(resourceGroupName, name, context).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete a IamInstanceProfile. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of IamInstanceProfile. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String name) { + deleteAsync(resourceGroupName, name).block(); + } + + /** + * Delete a IamInstanceProfile. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of IamInstanceProfile. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String name, Context context) { + deleteAsync(resourceGroupName, name, context).block(); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a IamInstanceProfile list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> + listBySubscriptionNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a IamInstanceProfile list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> + listBySubscriptionNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a IamInstanceProfile list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> + listByResourceGroupNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a IamInstanceProfile list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> + listByResourceGroupNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/IamInstanceProfilesImpl.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/IamInstanceProfilesImpl.java new file mode 100644 index 000000000000..bb11b841d891 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/IamInstanceProfilesImpl.java @@ -0,0 +1,153 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.awsconnector.fluent.IamInstanceProfilesClient; +import com.azure.resourcemanager.awsconnector.fluent.models.IamInstanceProfileAutoGeneratedInner; +import com.azure.resourcemanager.awsconnector.models.IamInstanceProfileAutoGenerated; +import com.azure.resourcemanager.awsconnector.models.IamInstanceProfiles; + +public final class IamInstanceProfilesImpl implements IamInstanceProfiles { + private static final ClientLogger LOGGER = new ClientLogger(IamInstanceProfilesImpl.class); + + private final IamInstanceProfilesClient innerClient; + + private final com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager; + + public IamInstanceProfilesImpl(IamInstanceProfilesClient innerClient, + com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return ResourceManagerUtils.mapPage(inner, + inner1 -> new IamInstanceProfileAutoGeneratedImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return ResourceManagerUtils.mapPage(inner, + inner1 -> new IamInstanceProfileAutoGeneratedImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName) { + PagedIterable inner + = this.serviceClient().listByResourceGroup(resourceGroupName); + return ResourceManagerUtils.mapPage(inner, + inner1 -> new IamInstanceProfileAutoGeneratedImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName, + Context context) { + PagedIterable inner + = this.serviceClient().listByResourceGroup(resourceGroupName, context); + return ResourceManagerUtils.mapPage(inner, + inner1 -> new IamInstanceProfileAutoGeneratedImpl(inner1, this.manager())); + } + + public Response getByResourceGroupWithResponse(String resourceGroupName, + String name, Context context) { + Response inner + = this.serviceClient().getByResourceGroupWithResponse(resourceGroupName, name, context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new IamInstanceProfileAutoGeneratedImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public IamInstanceProfileAutoGenerated getByResourceGroup(String resourceGroupName, String name) { + IamInstanceProfileAutoGeneratedInner inner = this.serviceClient().getByResourceGroup(resourceGroupName, name); + if (inner != null) { + return new IamInstanceProfileAutoGeneratedImpl(inner, this.manager()); + } else { + return null; + } + } + + public void deleteByResourceGroup(String resourceGroupName, String name) { + this.serviceClient().delete(resourceGroupName, name); + } + + public void delete(String resourceGroupName, String name, Context context) { + this.serviceClient().delete(resourceGroupName, name, context); + } + + public IamInstanceProfileAutoGenerated getById(String id) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String name = ResourceManagerUtils.getValueFromIdByName(id, "iamInstanceProfiles"); + if (name == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'iamInstanceProfiles'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, name, Context.NONE).getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String name = ResourceManagerUtils.getValueFromIdByName(id, "iamInstanceProfiles"); + if (name == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'iamInstanceProfiles'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, name, context); + } + + public void deleteById(String id) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String name = ResourceManagerUtils.getValueFromIdByName(id, "iamInstanceProfiles"); + if (name == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'iamInstanceProfiles'.", id))); + } + this.delete(resourceGroupName, name, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String name = ResourceManagerUtils.getValueFromIdByName(id, "iamInstanceProfiles"); + if (name == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'iamInstanceProfiles'.", id))); + } + this.delete(resourceGroupName, name, context); + } + + private IamInstanceProfilesClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.awsconnector.AwsconnectorManager manager() { + return this.serviceManager; + } + + public IamInstanceProfileAutoGeneratedImpl define(String name) { + return new IamInstanceProfileAutoGeneratedImpl(name, this.manager()); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/IamMfaDeviceImpl.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/IamMfaDeviceImpl.java new file mode 100644 index 000000000000..635febc61787 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/IamMfaDeviceImpl.java @@ -0,0 +1,177 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.implementation; + +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.awsconnector.fluent.models.IamMfaDeviceInner; +import com.azure.resourcemanager.awsconnector.models.IamMfaDevice; +import com.azure.resourcemanager.awsconnector.models.IamMfaDeviceProperties; +import com.azure.resourcemanager.awsconnector.models.IamMfaDeviceTagsUpdate; +import java.util.Collections; +import java.util.Map; + +public final class IamMfaDeviceImpl implements IamMfaDevice, IamMfaDevice.Definition, IamMfaDevice.Update { + private IamMfaDeviceInner innerObject; + + private final com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public String location() { + return this.innerModel().location(); + } + + public Map tags() { + Map inner = this.innerModel().tags(); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } + } + + public IamMfaDeviceProperties properties() { + return this.innerModel().properties(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public String resourceGroupName() { + return resourceGroupName; + } + + public IamMfaDeviceInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.awsconnector.AwsconnectorManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String name; + + private IamMfaDeviceTagsUpdate updateProperties; + + public IamMfaDeviceImpl withExistingResourceGroup(String resourceGroupName) { + this.resourceGroupName = resourceGroupName; + return this; + } + + public IamMfaDevice create() { + this.innerObject = serviceManager.serviceClient() + .getIamMfaDevices() + .createOrReplace(resourceGroupName, name, this.innerModel(), Context.NONE); + return this; + } + + public IamMfaDevice create(Context context) { + this.innerObject = serviceManager.serviceClient() + .getIamMfaDevices() + .createOrReplace(resourceGroupName, name, this.innerModel(), context); + return this; + } + + IamMfaDeviceImpl(String name, com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager) { + this.innerObject = new IamMfaDeviceInner(); + this.serviceManager = serviceManager; + this.name = name; + } + + public IamMfaDeviceImpl update() { + this.updateProperties = new IamMfaDeviceTagsUpdate(); + return this; + } + + public IamMfaDevice apply() { + this.innerObject = serviceManager.serviceClient() + .getIamMfaDevices() + .update(resourceGroupName, name, updateProperties, Context.NONE); + return this; + } + + public IamMfaDevice apply(Context context) { + this.innerObject = serviceManager.serviceClient() + .getIamMfaDevices() + .update(resourceGroupName, name, updateProperties, context); + return this; + } + + IamMfaDeviceImpl(IamMfaDeviceInner innerObject, + com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.name = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "iamMFADevices"); + } + + public IamMfaDevice refresh() { + this.innerObject = serviceManager.serviceClient() + .getIamMfaDevices() + .getByResourceGroupWithResponse(resourceGroupName, name, Context.NONE) + .getValue(); + return this; + } + + public IamMfaDevice refresh(Context context) { + this.innerObject = serviceManager.serviceClient() + .getIamMfaDevices() + .getByResourceGroupWithResponse(resourceGroupName, name, context) + .getValue(); + return this; + } + + public IamMfaDeviceImpl withRegion(Region location) { + this.innerModel().withLocation(location.toString()); + return this; + } + + public IamMfaDeviceImpl withRegion(String location) { + this.innerModel().withLocation(location); + return this; + } + + public IamMfaDeviceImpl withTags(Map tags) { + if (isInCreateMode()) { + this.innerModel().withTags(tags); + return this; + } else { + this.updateProperties.withTags(tags); + return this; + } + } + + public IamMfaDeviceImpl withProperties(IamMfaDeviceProperties properties) { + this.innerModel().withProperties(properties); + return this; + } + + private boolean isInCreateMode() { + return this.innerModel().id() == null; + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/IamMfaDevicesClientImpl.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/IamMfaDevicesClientImpl.java new file mode 100644 index 000000000000..e67d4ad0225c --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/IamMfaDevicesClientImpl.java @@ -0,0 +1,1278 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.Patch; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.awsconnector.fluent.IamMfaDevicesClient; +import com.azure.resourcemanager.awsconnector.fluent.models.IamMfaDeviceInner; +import com.azure.resourcemanager.awsconnector.models.IamMfaDeviceListResult; +import com.azure.resourcemanager.awsconnector.models.IamMfaDeviceTagsUpdate; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in IamMfaDevicesClient. + */ +public final class IamMfaDevicesClientImpl implements IamMfaDevicesClient { + /** + * The proxy service used to perform REST calls. + */ + private final IamMfaDevicesService service; + + /** + * The service client containing this operation class. + */ + private final MicrosoftAwsConnectorImpl client; + + /** + * Initializes an instance of IamMfaDevicesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + IamMfaDevicesClientImpl(MicrosoftAwsConnectorImpl client) { + this.service + = RestProxy.create(IamMfaDevicesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for MicrosoftAwsConnectorIamMfaDevices to be used by the proxy service to + * perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "MicrosoftAwsConnecto") + public interface IamMfaDevicesService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.AwsConnector/iamMFADevices") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/iamMFADevices") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroup(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/iamMFADevices/{name}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getByResourceGroup(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("name") String name, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/iamMFADevices/{name}") + @ExpectedResponses({ 200, 201 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrReplace(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("name") String name, + @BodyParam("application/json") IamMfaDeviceInner resource, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/iamMFADevices/{name}") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> update(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("name") String name, + @BodyParam("application/json") IamMfaDeviceTagsUpdate properties, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/iamMFADevices/{name}") + @ExpectedResponses({ 202, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("name") String name, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listBySubscriptionNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroupNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); + } + + /** + * List IamMFADevice resources by subscription ID. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a IamMFADevice list operation along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync() { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), + res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List IamMFADevice resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a IamMFADevice list operation along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), accept, + context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * List IamMFADevice resources by subscription ID. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a IamMFADevice list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>(() -> listSinglePageAsync(), + nextLink -> listBySubscriptionNextSinglePageAsync(nextLink)); + } + + /** + * List IamMFADevice resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a IamMFADevice list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(Context context) { + return new PagedFlux<>(() -> listSinglePageAsync(context), + nextLink -> listBySubscriptionNextSinglePageAsync(nextLink, context)); + } + + /** + * List IamMFADevice resources by subscription ID. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a IamMFADevice list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + return new PagedIterable<>(listAsync()); + } + + /** + * List IamMFADevice resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a IamMFADevice list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Context context) { + return new PagedIterable<>(listAsync(context)); + } + + /** + * List IamMFADevice resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a IamMFADevice list operation along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), + res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List IamMFADevice resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a IamMFADevice list operation along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * List IamMFADevice resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a IamMFADevice list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName) { + return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); + } + + /** + * List IamMFADevice resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a IamMFADevice list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName, Context context) { + return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName, context), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink, context)); + } + + /** + * List IamMFADevice resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a IamMFADevice list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName)); + } + + /** + * List IamMFADevice resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a IamMFADevice list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, context)); + } + + /** + * Get a IamMFADevice. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of IamMFADevice. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a IamMFADevice along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync(String resourceGroupName, + String name) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.getByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get a IamMFADevice. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of IamMFADevice. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a IamMFADevice along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync(String resourceGroupName, String name, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.getByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, accept, context); + } + + /** + * Get a IamMFADevice. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of IamMFADevice. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a IamMFADevice on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getByResourceGroupAsync(String resourceGroupName, String name) { + return getByResourceGroupWithResponseAsync(resourceGroupName, name) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Get a IamMFADevice. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of IamMFADevice. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a IamMFADevice along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getByResourceGroupWithResponse(String resourceGroupName, String name, + Context context) { + return getByResourceGroupWithResponseAsync(resourceGroupName, name, context).block(); + } + + /** + * Get a IamMFADevice. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of IamMFADevice. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a IamMFADevice. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public IamMfaDeviceInner getByResourceGroup(String resourceGroupName, String name) { + return getByResourceGroupWithResponse(resourceGroupName, name, Context.NONE).getValue(); + } + + /** + * Create a IamMFADevice. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of IamMFADevice. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrReplaceWithResponseAsync(String resourceGroupName, String name, + IamMfaDeviceInner resource) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (resource == null) { + return Mono.error(new IllegalArgumentException("Parameter resource is required and cannot be null.")); + } else { + resource.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.createOrReplace(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, resource, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Create a IamMFADevice. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of IamMFADevice. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrReplaceWithResponseAsync(String resourceGroupName, String name, + IamMfaDeviceInner resource, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (resource == null) { + return Mono.error(new IllegalArgumentException("Parameter resource is required and cannot be null.")); + } else { + resource.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.createOrReplace(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, resource, accept, context); + } + + /** + * Create a IamMFADevice. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of IamMFADevice. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, IamMfaDeviceInner> + beginCreateOrReplaceAsync(String resourceGroupName, String name, IamMfaDeviceInner resource) { + Mono>> mono = createOrReplaceWithResponseAsync(resourceGroupName, name, resource); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + IamMfaDeviceInner.class, IamMfaDeviceInner.class, this.client.getContext()); + } + + /** + * Create a IamMFADevice. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of IamMFADevice. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, IamMfaDeviceInner> + beginCreateOrReplaceAsync(String resourceGroupName, String name, IamMfaDeviceInner resource, Context context) { + context = this.client.mergeContext(context); + Mono>> mono + = createOrReplaceWithResponseAsync(resourceGroupName, name, resource, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + IamMfaDeviceInner.class, IamMfaDeviceInner.class, context); + } + + /** + * Create a IamMFADevice. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of IamMFADevice. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, IamMfaDeviceInner> beginCreateOrReplace(String resourceGroupName, + String name, IamMfaDeviceInner resource) { + return this.beginCreateOrReplaceAsync(resourceGroupName, name, resource).getSyncPoller(); + } + + /** + * Create a IamMFADevice. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of IamMFADevice. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, IamMfaDeviceInner> beginCreateOrReplace(String resourceGroupName, + String name, IamMfaDeviceInner resource, Context context) { + return this.beginCreateOrReplaceAsync(resourceGroupName, name, resource, context).getSyncPoller(); + } + + /** + * Create a IamMFADevice. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of IamMFADevice. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrReplaceAsync(String resourceGroupName, String name, + IamMfaDeviceInner resource) { + return beginCreateOrReplaceAsync(resourceGroupName, name, resource).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create a IamMFADevice. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of IamMFADevice. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrReplaceAsync(String resourceGroupName, String name, + IamMfaDeviceInner resource, Context context) { + return beginCreateOrReplaceAsync(resourceGroupName, name, resource, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create a IamMFADevice. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of IamMFADevice. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public IamMfaDeviceInner createOrReplace(String resourceGroupName, String name, IamMfaDeviceInner resource) { + return createOrReplaceAsync(resourceGroupName, name, resource).block(); + } + + /** + * Create a IamMFADevice. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of IamMFADevice. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public IamMfaDeviceInner createOrReplace(String resourceGroupName, String name, IamMfaDeviceInner resource, + Context context) { + return createOrReplaceAsync(resourceGroupName, name, resource, context).block(); + } + + /** + * Update a IamMFADevice. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of IamMFADevice. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync(String resourceGroupName, String name, + IamMfaDeviceTagsUpdate properties) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (properties == null) { + return Mono.error(new IllegalArgumentException("Parameter properties is required and cannot be null.")); + } else { + properties.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.update(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, properties, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Update a IamMFADevice. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of IamMFADevice. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync(String resourceGroupName, String name, + IamMfaDeviceTagsUpdate properties, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (properties == null) { + return Mono.error(new IllegalArgumentException("Parameter properties is required and cannot be null.")); + } else { + properties.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.update(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, name, properties, accept, context); + } + + /** + * Update a IamMFADevice. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of IamMFADevice. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, IamMfaDeviceInner> beginUpdateAsync(String resourceGroupName, + String name, IamMfaDeviceTagsUpdate properties) { + Mono>> mono = updateWithResponseAsync(resourceGroupName, name, properties); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + IamMfaDeviceInner.class, IamMfaDeviceInner.class, this.client.getContext()); + } + + /** + * Update a IamMFADevice. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of IamMFADevice. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, IamMfaDeviceInner> beginUpdateAsync(String resourceGroupName, + String name, IamMfaDeviceTagsUpdate properties, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = updateWithResponseAsync(resourceGroupName, name, properties, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + IamMfaDeviceInner.class, IamMfaDeviceInner.class, context); + } + + /** + * Update a IamMFADevice. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of IamMFADevice. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, IamMfaDeviceInner> beginUpdate(String resourceGroupName, + String name, IamMfaDeviceTagsUpdate properties) { + return this.beginUpdateAsync(resourceGroupName, name, properties).getSyncPoller(); + } + + /** + * Update a IamMFADevice. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of IamMFADevice. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, IamMfaDeviceInner> beginUpdate(String resourceGroupName, + String name, IamMfaDeviceTagsUpdate properties, Context context) { + return this.beginUpdateAsync(resourceGroupName, name, properties, context).getSyncPoller(); + } + + /** + * Update a IamMFADevice. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of IamMFADevice. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync(String resourceGroupName, String name, + IamMfaDeviceTagsUpdate properties) { + return beginUpdateAsync(resourceGroupName, name, properties).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Update a IamMFADevice. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of IamMFADevice. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync(String resourceGroupName, String name, + IamMfaDeviceTagsUpdate properties, Context context) { + return beginUpdateAsync(resourceGroupName, name, properties, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Update a IamMFADevice. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of IamMFADevice. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public IamMfaDeviceInner update(String resourceGroupName, String name, IamMfaDeviceTagsUpdate properties) { + return updateAsync(resourceGroupName, name, properties).block(); + } + + /** + * Update a IamMFADevice. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of IamMFADevice. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public IamMfaDeviceInner update(String resourceGroupName, String name, IamMfaDeviceTagsUpdate properties, + Context context) { + return updateAsync(resourceGroupName, name, properties, context).block(); + } + + /** + * Delete a IamMFADevice. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of IamMFADevice. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync(String resourceGroupName, String name) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Delete a IamMFADevice. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of IamMFADevice. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync(String resourceGroupName, String name, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.delete(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, name, accept, context); + } + + /** + * Delete a IamMFADevice. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of IamMFADevice. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String name) { + Mono>> mono = deleteWithResponseAsync(resourceGroupName, name); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); + } + + /** + * Delete a IamMFADevice. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of IamMFADevice. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String name, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = deleteWithResponseAsync(resourceGroupName, name, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + context); + } + + /** + * Delete a IamMFADevice. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of IamMFADevice. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String name) { + return this.beginDeleteAsync(resourceGroupName, name).getSyncPoller(); + } + + /** + * Delete a IamMFADevice. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of IamMFADevice. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String name, Context context) { + return this.beginDeleteAsync(resourceGroupName, name, context).getSyncPoller(); + } + + /** + * Delete a IamMFADevice. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of IamMFADevice. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String name) { + return beginDeleteAsync(resourceGroupName, name).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete a IamMFADevice. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of IamMFADevice. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String name, Context context) { + return beginDeleteAsync(resourceGroupName, name, context).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete a IamMFADevice. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of IamMFADevice. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String name) { + deleteAsync(resourceGroupName, name).block(); + } + + /** + * Delete a IamMFADevice. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of IamMFADevice. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String name, Context context) { + deleteAsync(resourceGroupName, name, context).block(); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a IamMFADevice list operation along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listBySubscriptionNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), + res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a IamMFADevice list operation along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listBySubscriptionNextSinglePageAsync(String nextLink, + Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a IamMFADevice list operation along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), + res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a IamMFADevice list operation along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupNextSinglePageAsync(String nextLink, + Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/IamMfaDevicesImpl.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/IamMfaDevicesImpl.java new file mode 100644 index 000000000000..2b9946a3a9ba --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/IamMfaDevicesImpl.java @@ -0,0 +1,146 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.awsconnector.fluent.IamMfaDevicesClient; +import com.azure.resourcemanager.awsconnector.fluent.models.IamMfaDeviceInner; +import com.azure.resourcemanager.awsconnector.models.IamMfaDevice; +import com.azure.resourcemanager.awsconnector.models.IamMfaDevices; + +public final class IamMfaDevicesImpl implements IamMfaDevices { + private static final ClientLogger LOGGER = new ClientLogger(IamMfaDevicesImpl.class); + + private final IamMfaDevicesClient innerClient; + + private final com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager; + + public IamMfaDevicesImpl(IamMfaDevicesClient innerClient, + com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return ResourceManagerUtils.mapPage(inner, inner1 -> new IamMfaDeviceImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new IamMfaDeviceImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName); + return ResourceManagerUtils.mapPage(inner, inner1 -> new IamMfaDeviceImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new IamMfaDeviceImpl(inner1, this.manager())); + } + + public Response getByResourceGroupWithResponse(String resourceGroupName, String name, + Context context) { + Response inner + = this.serviceClient().getByResourceGroupWithResponse(resourceGroupName, name, context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new IamMfaDeviceImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public IamMfaDevice getByResourceGroup(String resourceGroupName, String name) { + IamMfaDeviceInner inner = this.serviceClient().getByResourceGroup(resourceGroupName, name); + if (inner != null) { + return new IamMfaDeviceImpl(inner, this.manager()); + } else { + return null; + } + } + + public void deleteByResourceGroup(String resourceGroupName, String name) { + this.serviceClient().delete(resourceGroupName, name); + } + + public void delete(String resourceGroupName, String name, Context context) { + this.serviceClient().delete(resourceGroupName, name, context); + } + + public IamMfaDevice getById(String id) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String name = ResourceManagerUtils.getValueFromIdByName(id, "iamMFADevices"); + if (name == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'iamMFADevices'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, name, Context.NONE).getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String name = ResourceManagerUtils.getValueFromIdByName(id, "iamMFADevices"); + if (name == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'iamMFADevices'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, name, context); + } + + public void deleteById(String id) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String name = ResourceManagerUtils.getValueFromIdByName(id, "iamMFADevices"); + if (name == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'iamMFADevices'.", id))); + } + this.delete(resourceGroupName, name, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String name = ResourceManagerUtils.getValueFromIdByName(id, "iamMFADevices"); + if (name == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'iamMFADevices'.", id))); + } + this.delete(resourceGroupName, name, context); + } + + private IamMfaDevicesClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.awsconnector.AwsconnectorManager manager() { + return this.serviceManager; + } + + public IamMfaDeviceImpl define(String name) { + return new IamMfaDeviceImpl(name, this.manager()); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/IamPasswordPoliciesClientImpl.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/IamPasswordPoliciesClientImpl.java new file mode 100644 index 000000000000..7e290d08e458 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/IamPasswordPoliciesClientImpl.java @@ -0,0 +1,1282 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.Patch; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.awsconnector.fluent.IamPasswordPoliciesClient; +import com.azure.resourcemanager.awsconnector.fluent.models.IamPasswordPolicyInner; +import com.azure.resourcemanager.awsconnector.models.IamPasswordPolicyListResult; +import com.azure.resourcemanager.awsconnector.models.IamPasswordPolicyTagsUpdate; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in IamPasswordPoliciesClient. + */ +public final class IamPasswordPoliciesClientImpl implements IamPasswordPoliciesClient { + /** + * The proxy service used to perform REST calls. + */ + private final IamPasswordPoliciesService service; + + /** + * The service client containing this operation class. + */ + private final MicrosoftAwsConnectorImpl client; + + /** + * Initializes an instance of IamPasswordPoliciesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + IamPasswordPoliciesClientImpl(MicrosoftAwsConnectorImpl client) { + this.service = RestProxy.create(IamPasswordPoliciesService.class, client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for MicrosoftAwsConnectorIamPasswordPolicies to be used by the proxy + * service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "MicrosoftAwsConnecto") + public interface IamPasswordPoliciesService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.AwsConnector/iamPasswordPolicies") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/iamPasswordPolicies") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroup(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/iamPasswordPolicies/{name}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getByResourceGroup(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("name") String name, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/iamPasswordPolicies/{name}") + @ExpectedResponses({ 200, 201 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrReplace(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("name") String name, + @BodyParam("application/json") IamPasswordPolicyInner resource, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/iamPasswordPolicies/{name}") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> update(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("name") String name, + @BodyParam("application/json") IamPasswordPolicyTagsUpdate properties, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/iamPasswordPolicies/{name}") + @ExpectedResponses({ 202, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("name") String name, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listBySubscriptionNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroupNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); + } + + /** + * List IamPasswordPolicy resources by subscription ID. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a IamPasswordPolicy list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync() { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List IamPasswordPolicy resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a IamPasswordPolicy list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), accept, + context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * List IamPasswordPolicy resources by subscription ID. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a IamPasswordPolicy list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>(() -> listSinglePageAsync(), + nextLink -> listBySubscriptionNextSinglePageAsync(nextLink)); + } + + /** + * List IamPasswordPolicy resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a IamPasswordPolicy list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(Context context) { + return new PagedFlux<>(() -> listSinglePageAsync(context), + nextLink -> listBySubscriptionNextSinglePageAsync(nextLink, context)); + } + + /** + * List IamPasswordPolicy resources by subscription ID. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a IamPasswordPolicy list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + return new PagedIterable<>(listAsync()); + } + + /** + * List IamPasswordPolicy resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a IamPasswordPolicy list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Context context) { + return new PagedIterable<>(listAsync(context)); + } + + /** + * List IamPasswordPolicy resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a IamPasswordPolicy list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List IamPasswordPolicy resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a IamPasswordPolicy list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * List IamPasswordPolicy resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a IamPasswordPolicy list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName) { + return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); + } + + /** + * List IamPasswordPolicy resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a IamPasswordPolicy list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName, Context context) { + return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName, context), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink, context)); + } + + /** + * List IamPasswordPolicy resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a IamPasswordPolicy list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName)); + } + + /** + * List IamPasswordPolicy resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a IamPasswordPolicy list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, context)); + } + + /** + * Get a IamPasswordPolicy. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of IamPasswordPolicy. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a IamPasswordPolicy along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync(String resourceGroupName, + String name) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.getByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get a IamPasswordPolicy. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of IamPasswordPolicy. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a IamPasswordPolicy along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync(String resourceGroupName, + String name, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.getByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, accept, context); + } + + /** + * Get a IamPasswordPolicy. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of IamPasswordPolicy. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a IamPasswordPolicy on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getByResourceGroupAsync(String resourceGroupName, String name) { + return getByResourceGroupWithResponseAsync(resourceGroupName, name) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Get a IamPasswordPolicy. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of IamPasswordPolicy. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a IamPasswordPolicy along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getByResourceGroupWithResponse(String resourceGroupName, String name, + Context context) { + return getByResourceGroupWithResponseAsync(resourceGroupName, name, context).block(); + } + + /** + * Get a IamPasswordPolicy. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of IamPasswordPolicy. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a IamPasswordPolicy. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public IamPasswordPolicyInner getByResourceGroup(String resourceGroupName, String name) { + return getByResourceGroupWithResponse(resourceGroupName, name, Context.NONE).getValue(); + } + + /** + * Create a IamPasswordPolicy. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of IamPasswordPolicy. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrReplaceWithResponseAsync(String resourceGroupName, String name, + IamPasswordPolicyInner resource) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (resource == null) { + return Mono.error(new IllegalArgumentException("Parameter resource is required and cannot be null.")); + } else { + resource.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.createOrReplace(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, resource, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Create a IamPasswordPolicy. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of IamPasswordPolicy. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrReplaceWithResponseAsync(String resourceGroupName, String name, + IamPasswordPolicyInner resource, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (resource == null) { + return Mono.error(new IllegalArgumentException("Parameter resource is required and cannot be null.")); + } else { + resource.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.createOrReplace(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, resource, accept, context); + } + + /** + * Create a IamPasswordPolicy. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of IamPasswordPolicy. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, IamPasswordPolicyInner> + beginCreateOrReplaceAsync(String resourceGroupName, String name, IamPasswordPolicyInner resource) { + Mono>> mono = createOrReplaceWithResponseAsync(resourceGroupName, name, resource); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), IamPasswordPolicyInner.class, IamPasswordPolicyInner.class, + this.client.getContext()); + } + + /** + * Create a IamPasswordPolicy. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of IamPasswordPolicy. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, IamPasswordPolicyInner> beginCreateOrReplaceAsync( + String resourceGroupName, String name, IamPasswordPolicyInner resource, Context context) { + context = this.client.mergeContext(context); + Mono>> mono + = createOrReplaceWithResponseAsync(resourceGroupName, name, resource, context); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), IamPasswordPolicyInner.class, IamPasswordPolicyInner.class, context); + } + + /** + * Create a IamPasswordPolicy. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of IamPasswordPolicy. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, IamPasswordPolicyInner> + beginCreateOrReplace(String resourceGroupName, String name, IamPasswordPolicyInner resource) { + return this.beginCreateOrReplaceAsync(resourceGroupName, name, resource).getSyncPoller(); + } + + /** + * Create a IamPasswordPolicy. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of IamPasswordPolicy. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, IamPasswordPolicyInner> + beginCreateOrReplace(String resourceGroupName, String name, IamPasswordPolicyInner resource, Context context) { + return this.beginCreateOrReplaceAsync(resourceGroupName, name, resource, context).getSyncPoller(); + } + + /** + * Create a IamPasswordPolicy. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of IamPasswordPolicy. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrReplaceAsync(String resourceGroupName, String name, + IamPasswordPolicyInner resource) { + return beginCreateOrReplaceAsync(resourceGroupName, name, resource).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create a IamPasswordPolicy. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of IamPasswordPolicy. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrReplaceAsync(String resourceGroupName, String name, + IamPasswordPolicyInner resource, Context context) { + return beginCreateOrReplaceAsync(resourceGroupName, name, resource, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create a IamPasswordPolicy. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of IamPasswordPolicy. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public IamPasswordPolicyInner createOrReplace(String resourceGroupName, String name, + IamPasswordPolicyInner resource) { + return createOrReplaceAsync(resourceGroupName, name, resource).block(); + } + + /** + * Create a IamPasswordPolicy. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of IamPasswordPolicy. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public IamPasswordPolicyInner createOrReplace(String resourceGroupName, String name, + IamPasswordPolicyInner resource, Context context) { + return createOrReplaceAsync(resourceGroupName, name, resource, context).block(); + } + + /** + * Update a IamPasswordPolicy. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of IamPasswordPolicy. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync(String resourceGroupName, String name, + IamPasswordPolicyTagsUpdate properties) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (properties == null) { + return Mono.error(new IllegalArgumentException("Parameter properties is required and cannot be null.")); + } else { + properties.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.update(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, properties, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Update a IamPasswordPolicy. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of IamPasswordPolicy. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync(String resourceGroupName, String name, + IamPasswordPolicyTagsUpdate properties, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (properties == null) { + return Mono.error(new IllegalArgumentException("Parameter properties is required and cannot be null.")); + } else { + properties.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.update(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, name, properties, accept, context); + } + + /** + * Update a IamPasswordPolicy. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of IamPasswordPolicy. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, IamPasswordPolicyInner> + beginUpdateAsync(String resourceGroupName, String name, IamPasswordPolicyTagsUpdate properties) { + Mono>> mono = updateWithResponseAsync(resourceGroupName, name, properties); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), IamPasswordPolicyInner.class, IamPasswordPolicyInner.class, + this.client.getContext()); + } + + /** + * Update a IamPasswordPolicy. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of IamPasswordPolicy. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, IamPasswordPolicyInner> beginUpdateAsync( + String resourceGroupName, String name, IamPasswordPolicyTagsUpdate properties, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = updateWithResponseAsync(resourceGroupName, name, properties, context); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), IamPasswordPolicyInner.class, IamPasswordPolicyInner.class, context); + } + + /** + * Update a IamPasswordPolicy. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of IamPasswordPolicy. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, IamPasswordPolicyInner> beginUpdate(String resourceGroupName, + String name, IamPasswordPolicyTagsUpdate properties) { + return this.beginUpdateAsync(resourceGroupName, name, properties).getSyncPoller(); + } + + /** + * Update a IamPasswordPolicy. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of IamPasswordPolicy. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, IamPasswordPolicyInner> beginUpdate(String resourceGroupName, + String name, IamPasswordPolicyTagsUpdate properties, Context context) { + return this.beginUpdateAsync(resourceGroupName, name, properties, context).getSyncPoller(); + } + + /** + * Update a IamPasswordPolicy. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of IamPasswordPolicy. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync(String resourceGroupName, String name, + IamPasswordPolicyTagsUpdate properties) { + return beginUpdateAsync(resourceGroupName, name, properties).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Update a IamPasswordPolicy. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of IamPasswordPolicy. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync(String resourceGroupName, String name, + IamPasswordPolicyTagsUpdate properties, Context context) { + return beginUpdateAsync(resourceGroupName, name, properties, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Update a IamPasswordPolicy. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of IamPasswordPolicy. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public IamPasswordPolicyInner update(String resourceGroupName, String name, + IamPasswordPolicyTagsUpdate properties) { + return updateAsync(resourceGroupName, name, properties).block(); + } + + /** + * Update a IamPasswordPolicy. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of IamPasswordPolicy. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public IamPasswordPolicyInner update(String resourceGroupName, String name, IamPasswordPolicyTagsUpdate properties, + Context context) { + return updateAsync(resourceGroupName, name, properties, context).block(); + } + + /** + * Delete a IamPasswordPolicy. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of IamPasswordPolicy. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync(String resourceGroupName, String name) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Delete a IamPasswordPolicy. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of IamPasswordPolicy. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync(String resourceGroupName, String name, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.delete(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, name, accept, context); + } + + /** + * Delete a IamPasswordPolicy. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of IamPasswordPolicy. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String name) { + Mono>> mono = deleteWithResponseAsync(resourceGroupName, name); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); + } + + /** + * Delete a IamPasswordPolicy. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of IamPasswordPolicy. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String name, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = deleteWithResponseAsync(resourceGroupName, name, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + context); + } + + /** + * Delete a IamPasswordPolicy. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of IamPasswordPolicy. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String name) { + return this.beginDeleteAsync(resourceGroupName, name).getSyncPoller(); + } + + /** + * Delete a IamPasswordPolicy. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of IamPasswordPolicy. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String name, Context context) { + return this.beginDeleteAsync(resourceGroupName, name, context).getSyncPoller(); + } + + /** + * Delete a IamPasswordPolicy. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of IamPasswordPolicy. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String name) { + return beginDeleteAsync(resourceGroupName, name).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete a IamPasswordPolicy. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of IamPasswordPolicy. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String name, Context context) { + return beginDeleteAsync(resourceGroupName, name, context).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete a IamPasswordPolicy. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of IamPasswordPolicy. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String name) { + deleteAsync(resourceGroupName, name).block(); + } + + /** + * Delete a IamPasswordPolicy. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of IamPasswordPolicy. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String name, Context context) { + deleteAsync(resourceGroupName, name, context).block(); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a IamPasswordPolicy list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listBySubscriptionNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a IamPasswordPolicy list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listBySubscriptionNextSinglePageAsync(String nextLink, + Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a IamPasswordPolicy list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a IamPasswordPolicy list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupNextSinglePageAsync(String nextLink, + Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/IamPasswordPoliciesImpl.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/IamPasswordPoliciesImpl.java new file mode 100644 index 000000000000..a690aa8167cd --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/IamPasswordPoliciesImpl.java @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.awsconnector.fluent.IamPasswordPoliciesClient; +import com.azure.resourcemanager.awsconnector.fluent.models.IamPasswordPolicyInner; +import com.azure.resourcemanager.awsconnector.models.IamPasswordPolicies; +import com.azure.resourcemanager.awsconnector.models.IamPasswordPolicy; + +public final class IamPasswordPoliciesImpl implements IamPasswordPolicies { + private static final ClientLogger LOGGER = new ClientLogger(IamPasswordPoliciesImpl.class); + + private final IamPasswordPoliciesClient innerClient; + + private final com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager; + + public IamPasswordPoliciesImpl(IamPasswordPoliciesClient innerClient, + com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return ResourceManagerUtils.mapPage(inner, inner1 -> new IamPasswordPolicyImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new IamPasswordPolicyImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName); + return ResourceManagerUtils.mapPage(inner, inner1 -> new IamPasswordPolicyImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + PagedIterable inner + = this.serviceClient().listByResourceGroup(resourceGroupName, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new IamPasswordPolicyImpl(inner1, this.manager())); + } + + public Response getByResourceGroupWithResponse(String resourceGroupName, String name, + Context context) { + Response inner + = this.serviceClient().getByResourceGroupWithResponse(resourceGroupName, name, context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new IamPasswordPolicyImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public IamPasswordPolicy getByResourceGroup(String resourceGroupName, String name) { + IamPasswordPolicyInner inner = this.serviceClient().getByResourceGroup(resourceGroupName, name); + if (inner != null) { + return new IamPasswordPolicyImpl(inner, this.manager()); + } else { + return null; + } + } + + public void deleteByResourceGroup(String resourceGroupName, String name) { + this.serviceClient().delete(resourceGroupName, name); + } + + public void delete(String resourceGroupName, String name, Context context) { + this.serviceClient().delete(resourceGroupName, name, context); + } + + public IamPasswordPolicy getById(String id) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String name = ResourceManagerUtils.getValueFromIdByName(id, "iamPasswordPolicies"); + if (name == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'iamPasswordPolicies'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, name, Context.NONE).getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String name = ResourceManagerUtils.getValueFromIdByName(id, "iamPasswordPolicies"); + if (name == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'iamPasswordPolicies'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, name, context); + } + + public void deleteById(String id) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String name = ResourceManagerUtils.getValueFromIdByName(id, "iamPasswordPolicies"); + if (name == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'iamPasswordPolicies'.", id))); + } + this.delete(resourceGroupName, name, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String name = ResourceManagerUtils.getValueFromIdByName(id, "iamPasswordPolicies"); + if (name == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'iamPasswordPolicies'.", id))); + } + this.delete(resourceGroupName, name, context); + } + + private IamPasswordPoliciesClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.awsconnector.AwsconnectorManager manager() { + return this.serviceManager; + } + + public IamPasswordPolicyImpl define(String name) { + return new IamPasswordPolicyImpl(name, this.manager()); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/IamPasswordPolicyImpl.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/IamPasswordPolicyImpl.java new file mode 100644 index 000000000000..6ba484431163 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/IamPasswordPolicyImpl.java @@ -0,0 +1,178 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.implementation; + +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.awsconnector.fluent.models.IamPasswordPolicyInner; +import com.azure.resourcemanager.awsconnector.models.IamPasswordPolicy; +import com.azure.resourcemanager.awsconnector.models.IamPasswordPolicyProperties; +import com.azure.resourcemanager.awsconnector.models.IamPasswordPolicyTagsUpdate; +import java.util.Collections; +import java.util.Map; + +public final class IamPasswordPolicyImpl + implements IamPasswordPolicy, IamPasswordPolicy.Definition, IamPasswordPolicy.Update { + private IamPasswordPolicyInner innerObject; + + private final com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public String location() { + return this.innerModel().location(); + } + + public Map tags() { + Map inner = this.innerModel().tags(); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } + } + + public IamPasswordPolicyProperties properties() { + return this.innerModel().properties(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public String resourceGroupName() { + return resourceGroupName; + } + + public IamPasswordPolicyInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.awsconnector.AwsconnectorManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String name; + + private IamPasswordPolicyTagsUpdate updateProperties; + + public IamPasswordPolicyImpl withExistingResourceGroup(String resourceGroupName) { + this.resourceGroupName = resourceGroupName; + return this; + } + + public IamPasswordPolicy create() { + this.innerObject = serviceManager.serviceClient() + .getIamPasswordPolicies() + .createOrReplace(resourceGroupName, name, this.innerModel(), Context.NONE); + return this; + } + + public IamPasswordPolicy create(Context context) { + this.innerObject = serviceManager.serviceClient() + .getIamPasswordPolicies() + .createOrReplace(resourceGroupName, name, this.innerModel(), context); + return this; + } + + IamPasswordPolicyImpl(String name, com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager) { + this.innerObject = new IamPasswordPolicyInner(); + this.serviceManager = serviceManager; + this.name = name; + } + + public IamPasswordPolicyImpl update() { + this.updateProperties = new IamPasswordPolicyTagsUpdate(); + return this; + } + + public IamPasswordPolicy apply() { + this.innerObject = serviceManager.serviceClient() + .getIamPasswordPolicies() + .update(resourceGroupName, name, updateProperties, Context.NONE); + return this; + } + + public IamPasswordPolicy apply(Context context) { + this.innerObject = serviceManager.serviceClient() + .getIamPasswordPolicies() + .update(resourceGroupName, name, updateProperties, context); + return this; + } + + IamPasswordPolicyImpl(IamPasswordPolicyInner innerObject, + com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.name = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "iamPasswordPolicies"); + } + + public IamPasswordPolicy refresh() { + this.innerObject = serviceManager.serviceClient() + .getIamPasswordPolicies() + .getByResourceGroupWithResponse(resourceGroupName, name, Context.NONE) + .getValue(); + return this; + } + + public IamPasswordPolicy refresh(Context context) { + this.innerObject = serviceManager.serviceClient() + .getIamPasswordPolicies() + .getByResourceGroupWithResponse(resourceGroupName, name, context) + .getValue(); + return this; + } + + public IamPasswordPolicyImpl withRegion(Region location) { + this.innerModel().withLocation(location.toString()); + return this; + } + + public IamPasswordPolicyImpl withRegion(String location) { + this.innerModel().withLocation(location); + return this; + } + + public IamPasswordPolicyImpl withTags(Map tags) { + if (isInCreateMode()) { + this.innerModel().withTags(tags); + return this; + } else { + this.updateProperties.withTags(tags); + return this; + } + } + + public IamPasswordPolicyImpl withProperties(IamPasswordPolicyProperties properties) { + this.innerModel().withProperties(properties); + return this; + } + + private boolean isInCreateMode() { + return this.innerModel().id() == null; + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/IamPolicyVersionImpl.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/IamPolicyVersionImpl.java new file mode 100644 index 000000000000..90c29793119e --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/IamPolicyVersionImpl.java @@ -0,0 +1,178 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.implementation; + +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.awsconnector.fluent.models.IamPolicyVersionInner; +import com.azure.resourcemanager.awsconnector.models.IamPolicyVersion; +import com.azure.resourcemanager.awsconnector.models.IamPolicyVersionProperties; +import com.azure.resourcemanager.awsconnector.models.IamPolicyVersionTagsUpdate; +import java.util.Collections; +import java.util.Map; + +public final class IamPolicyVersionImpl + implements IamPolicyVersion, IamPolicyVersion.Definition, IamPolicyVersion.Update { + private IamPolicyVersionInner innerObject; + + private final com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public String location() { + return this.innerModel().location(); + } + + public Map tags() { + Map inner = this.innerModel().tags(); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } + } + + public IamPolicyVersionProperties properties() { + return this.innerModel().properties(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public String resourceGroupName() { + return resourceGroupName; + } + + public IamPolicyVersionInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.awsconnector.AwsconnectorManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String name; + + private IamPolicyVersionTagsUpdate updateProperties; + + public IamPolicyVersionImpl withExistingResourceGroup(String resourceGroupName) { + this.resourceGroupName = resourceGroupName; + return this; + } + + public IamPolicyVersion create() { + this.innerObject = serviceManager.serviceClient() + .getIamPolicyVersions() + .createOrReplace(resourceGroupName, name, this.innerModel(), Context.NONE); + return this; + } + + public IamPolicyVersion create(Context context) { + this.innerObject = serviceManager.serviceClient() + .getIamPolicyVersions() + .createOrReplace(resourceGroupName, name, this.innerModel(), context); + return this; + } + + IamPolicyVersionImpl(String name, com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager) { + this.innerObject = new IamPolicyVersionInner(); + this.serviceManager = serviceManager; + this.name = name; + } + + public IamPolicyVersionImpl update() { + this.updateProperties = new IamPolicyVersionTagsUpdate(); + return this; + } + + public IamPolicyVersion apply() { + this.innerObject = serviceManager.serviceClient() + .getIamPolicyVersions() + .update(resourceGroupName, name, updateProperties, Context.NONE); + return this; + } + + public IamPolicyVersion apply(Context context) { + this.innerObject = serviceManager.serviceClient() + .getIamPolicyVersions() + .update(resourceGroupName, name, updateProperties, context); + return this; + } + + IamPolicyVersionImpl(IamPolicyVersionInner innerObject, + com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.name = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "iamPolicyVersions"); + } + + public IamPolicyVersion refresh() { + this.innerObject = serviceManager.serviceClient() + .getIamPolicyVersions() + .getByResourceGroupWithResponse(resourceGroupName, name, Context.NONE) + .getValue(); + return this; + } + + public IamPolicyVersion refresh(Context context) { + this.innerObject = serviceManager.serviceClient() + .getIamPolicyVersions() + .getByResourceGroupWithResponse(resourceGroupName, name, context) + .getValue(); + return this; + } + + public IamPolicyVersionImpl withRegion(Region location) { + this.innerModel().withLocation(location.toString()); + return this; + } + + public IamPolicyVersionImpl withRegion(String location) { + this.innerModel().withLocation(location); + return this; + } + + public IamPolicyVersionImpl withTags(Map tags) { + if (isInCreateMode()) { + this.innerModel().withTags(tags); + return this; + } else { + this.updateProperties.withTags(tags); + return this; + } + } + + public IamPolicyVersionImpl withProperties(IamPolicyVersionProperties properties) { + this.innerModel().withProperties(properties); + return this; + } + + private boolean isInCreateMode() { + return this.innerModel().id() == null; + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/IamPolicyVersionsClientImpl.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/IamPolicyVersionsClientImpl.java new file mode 100644 index 000000000000..31f716b06d09 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/IamPolicyVersionsClientImpl.java @@ -0,0 +1,1281 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.Patch; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.awsconnector.fluent.IamPolicyVersionsClient; +import com.azure.resourcemanager.awsconnector.fluent.models.IamPolicyVersionInner; +import com.azure.resourcemanager.awsconnector.models.IamPolicyVersionListResult; +import com.azure.resourcemanager.awsconnector.models.IamPolicyVersionTagsUpdate; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in IamPolicyVersionsClient. + */ +public final class IamPolicyVersionsClientImpl implements IamPolicyVersionsClient { + /** + * The proxy service used to perform REST calls. + */ + private final IamPolicyVersionsService service; + + /** + * The service client containing this operation class. + */ + private final MicrosoftAwsConnectorImpl client; + + /** + * Initializes an instance of IamPolicyVersionsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + IamPolicyVersionsClientImpl(MicrosoftAwsConnectorImpl client) { + this.service + = RestProxy.create(IamPolicyVersionsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for MicrosoftAwsConnectorIamPolicyVersions to be used by the proxy + * service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "MicrosoftAwsConnecto") + public interface IamPolicyVersionsService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.AwsConnector/iamPolicyVersions") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/iamPolicyVersions") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroup(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/iamPolicyVersions/{name}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getByResourceGroup(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("name") String name, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/iamPolicyVersions/{name}") + @ExpectedResponses({ 200, 201 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrReplace(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("name") String name, + @BodyParam("application/json") IamPolicyVersionInner resource, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/iamPolicyVersions/{name}") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> update(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("name") String name, + @BodyParam("application/json") IamPolicyVersionTagsUpdate properties, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/iamPolicyVersions/{name}") + @ExpectedResponses({ 202, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("name") String name, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listBySubscriptionNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroupNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); + } + + /** + * List IamPolicyVersion resources by subscription ID. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a IamPolicyVersion list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync() { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List IamPolicyVersion resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a IamPolicyVersion list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), accept, + context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * List IamPolicyVersion resources by subscription ID. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a IamPolicyVersion list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>(() -> listSinglePageAsync(), + nextLink -> listBySubscriptionNextSinglePageAsync(nextLink)); + } + + /** + * List IamPolicyVersion resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a IamPolicyVersion list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(Context context) { + return new PagedFlux<>(() -> listSinglePageAsync(context), + nextLink -> listBySubscriptionNextSinglePageAsync(nextLink, context)); + } + + /** + * List IamPolicyVersion resources by subscription ID. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a IamPolicyVersion list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + return new PagedIterable<>(listAsync()); + } + + /** + * List IamPolicyVersion resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a IamPolicyVersion list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Context context) { + return new PagedIterable<>(listAsync(context)); + } + + /** + * List IamPolicyVersion resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a IamPolicyVersion list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List IamPolicyVersion resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a IamPolicyVersion list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * List IamPolicyVersion resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a IamPolicyVersion list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName) { + return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); + } + + /** + * List IamPolicyVersion resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a IamPolicyVersion list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName, Context context) { + return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName, context), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink, context)); + } + + /** + * List IamPolicyVersion resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a IamPolicyVersion list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName)); + } + + /** + * List IamPolicyVersion resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a IamPolicyVersion list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, context)); + } + + /** + * Get a IamPolicyVersion. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of IamPolicyVersion. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a IamPolicyVersion along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync(String resourceGroupName, + String name) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.getByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get a IamPolicyVersion. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of IamPolicyVersion. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a IamPolicyVersion along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync(String resourceGroupName, + String name, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.getByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, accept, context); + } + + /** + * Get a IamPolicyVersion. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of IamPolicyVersion. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a IamPolicyVersion on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getByResourceGroupAsync(String resourceGroupName, String name) { + return getByResourceGroupWithResponseAsync(resourceGroupName, name) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Get a IamPolicyVersion. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of IamPolicyVersion. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a IamPolicyVersion along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getByResourceGroupWithResponse(String resourceGroupName, String name, + Context context) { + return getByResourceGroupWithResponseAsync(resourceGroupName, name, context).block(); + } + + /** + * Get a IamPolicyVersion. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of IamPolicyVersion. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a IamPolicyVersion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public IamPolicyVersionInner getByResourceGroup(String resourceGroupName, String name) { + return getByResourceGroupWithResponse(resourceGroupName, name, Context.NONE).getValue(); + } + + /** + * Create a IamPolicyVersion. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of IamPolicyVersion. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrReplaceWithResponseAsync(String resourceGroupName, String name, + IamPolicyVersionInner resource) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (resource == null) { + return Mono.error(new IllegalArgumentException("Parameter resource is required and cannot be null.")); + } else { + resource.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.createOrReplace(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, resource, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Create a IamPolicyVersion. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of IamPolicyVersion. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrReplaceWithResponseAsync(String resourceGroupName, String name, + IamPolicyVersionInner resource, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (resource == null) { + return Mono.error(new IllegalArgumentException("Parameter resource is required and cannot be null.")); + } else { + resource.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.createOrReplace(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, resource, accept, context); + } + + /** + * Create a IamPolicyVersion. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of IamPolicyVersion. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, IamPolicyVersionInner> + beginCreateOrReplaceAsync(String resourceGroupName, String name, IamPolicyVersionInner resource) { + Mono>> mono = createOrReplaceWithResponseAsync(resourceGroupName, name, resource); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), IamPolicyVersionInner.class, IamPolicyVersionInner.class, + this.client.getContext()); + } + + /** + * Create a IamPolicyVersion. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of IamPolicyVersion. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, IamPolicyVersionInner> beginCreateOrReplaceAsync( + String resourceGroupName, String name, IamPolicyVersionInner resource, Context context) { + context = this.client.mergeContext(context); + Mono>> mono + = createOrReplaceWithResponseAsync(resourceGroupName, name, resource, context); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), IamPolicyVersionInner.class, IamPolicyVersionInner.class, context); + } + + /** + * Create a IamPolicyVersion. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of IamPolicyVersion. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, IamPolicyVersionInner> + beginCreateOrReplace(String resourceGroupName, String name, IamPolicyVersionInner resource) { + return this.beginCreateOrReplaceAsync(resourceGroupName, name, resource).getSyncPoller(); + } + + /** + * Create a IamPolicyVersion. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of IamPolicyVersion. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, IamPolicyVersionInner> + beginCreateOrReplace(String resourceGroupName, String name, IamPolicyVersionInner resource, Context context) { + return this.beginCreateOrReplaceAsync(resourceGroupName, name, resource, context).getSyncPoller(); + } + + /** + * Create a IamPolicyVersion. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of IamPolicyVersion. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrReplaceAsync(String resourceGroupName, String name, + IamPolicyVersionInner resource) { + return beginCreateOrReplaceAsync(resourceGroupName, name, resource).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create a IamPolicyVersion. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of IamPolicyVersion. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrReplaceAsync(String resourceGroupName, String name, + IamPolicyVersionInner resource, Context context) { + return beginCreateOrReplaceAsync(resourceGroupName, name, resource, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create a IamPolicyVersion. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of IamPolicyVersion. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public IamPolicyVersionInner createOrReplace(String resourceGroupName, String name, + IamPolicyVersionInner resource) { + return createOrReplaceAsync(resourceGroupName, name, resource).block(); + } + + /** + * Create a IamPolicyVersion. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of IamPolicyVersion. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public IamPolicyVersionInner createOrReplace(String resourceGroupName, String name, IamPolicyVersionInner resource, + Context context) { + return createOrReplaceAsync(resourceGroupName, name, resource, context).block(); + } + + /** + * Update a IamPolicyVersion. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of IamPolicyVersion. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync(String resourceGroupName, String name, + IamPolicyVersionTagsUpdate properties) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (properties == null) { + return Mono.error(new IllegalArgumentException("Parameter properties is required and cannot be null.")); + } else { + properties.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.update(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, properties, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Update a IamPolicyVersion. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of IamPolicyVersion. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync(String resourceGroupName, String name, + IamPolicyVersionTagsUpdate properties, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (properties == null) { + return Mono.error(new IllegalArgumentException("Parameter properties is required and cannot be null.")); + } else { + properties.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.update(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, name, properties, accept, context); + } + + /** + * Update a IamPolicyVersion. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of IamPolicyVersion. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, IamPolicyVersionInner> + beginUpdateAsync(String resourceGroupName, String name, IamPolicyVersionTagsUpdate properties) { + Mono>> mono = updateWithResponseAsync(resourceGroupName, name, properties); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), IamPolicyVersionInner.class, IamPolicyVersionInner.class, + this.client.getContext()); + } + + /** + * Update a IamPolicyVersion. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of IamPolicyVersion. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, IamPolicyVersionInner> beginUpdateAsync( + String resourceGroupName, String name, IamPolicyVersionTagsUpdate properties, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = updateWithResponseAsync(resourceGroupName, name, properties, context); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), IamPolicyVersionInner.class, IamPolicyVersionInner.class, context); + } + + /** + * Update a IamPolicyVersion. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of IamPolicyVersion. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, IamPolicyVersionInner> beginUpdate(String resourceGroupName, + String name, IamPolicyVersionTagsUpdate properties) { + return this.beginUpdateAsync(resourceGroupName, name, properties).getSyncPoller(); + } + + /** + * Update a IamPolicyVersion. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of IamPolicyVersion. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, IamPolicyVersionInner> beginUpdate(String resourceGroupName, + String name, IamPolicyVersionTagsUpdate properties, Context context) { + return this.beginUpdateAsync(resourceGroupName, name, properties, context).getSyncPoller(); + } + + /** + * Update a IamPolicyVersion. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of IamPolicyVersion. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync(String resourceGroupName, String name, + IamPolicyVersionTagsUpdate properties) { + return beginUpdateAsync(resourceGroupName, name, properties).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Update a IamPolicyVersion. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of IamPolicyVersion. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync(String resourceGroupName, String name, + IamPolicyVersionTagsUpdate properties, Context context) { + return beginUpdateAsync(resourceGroupName, name, properties, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Update a IamPolicyVersion. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of IamPolicyVersion. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public IamPolicyVersionInner update(String resourceGroupName, String name, IamPolicyVersionTagsUpdate properties) { + return updateAsync(resourceGroupName, name, properties).block(); + } + + /** + * Update a IamPolicyVersion. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of IamPolicyVersion. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public IamPolicyVersionInner update(String resourceGroupName, String name, IamPolicyVersionTagsUpdate properties, + Context context) { + return updateAsync(resourceGroupName, name, properties, context).block(); + } + + /** + * Delete a IamPolicyVersion. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of IamPolicyVersion. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync(String resourceGroupName, String name) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Delete a IamPolicyVersion. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of IamPolicyVersion. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync(String resourceGroupName, String name, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.delete(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, name, accept, context); + } + + /** + * Delete a IamPolicyVersion. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of IamPolicyVersion. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String name) { + Mono>> mono = deleteWithResponseAsync(resourceGroupName, name); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); + } + + /** + * Delete a IamPolicyVersion. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of IamPolicyVersion. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String name, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = deleteWithResponseAsync(resourceGroupName, name, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + context); + } + + /** + * Delete a IamPolicyVersion. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of IamPolicyVersion. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String name) { + return this.beginDeleteAsync(resourceGroupName, name).getSyncPoller(); + } + + /** + * Delete a IamPolicyVersion. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of IamPolicyVersion. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String name, Context context) { + return this.beginDeleteAsync(resourceGroupName, name, context).getSyncPoller(); + } + + /** + * Delete a IamPolicyVersion. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of IamPolicyVersion. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String name) { + return beginDeleteAsync(resourceGroupName, name).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete a IamPolicyVersion. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of IamPolicyVersion. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String name, Context context) { + return beginDeleteAsync(resourceGroupName, name, context).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete a IamPolicyVersion. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of IamPolicyVersion. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String name) { + deleteAsync(resourceGroupName, name).block(); + } + + /** + * Delete a IamPolicyVersion. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of IamPolicyVersion. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String name, Context context) { + deleteAsync(resourceGroupName, name, context).block(); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a IamPolicyVersion list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listBySubscriptionNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a IamPolicyVersion list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listBySubscriptionNextSinglePageAsync(String nextLink, + Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a IamPolicyVersion list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a IamPolicyVersion list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupNextSinglePageAsync(String nextLink, + Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/IamPolicyVersionsImpl.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/IamPolicyVersionsImpl.java new file mode 100644 index 000000000000..cf031914cb1d --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/IamPolicyVersionsImpl.java @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.awsconnector.fluent.IamPolicyVersionsClient; +import com.azure.resourcemanager.awsconnector.fluent.models.IamPolicyVersionInner; +import com.azure.resourcemanager.awsconnector.models.IamPolicyVersion; +import com.azure.resourcemanager.awsconnector.models.IamPolicyVersions; + +public final class IamPolicyVersionsImpl implements IamPolicyVersions { + private static final ClientLogger LOGGER = new ClientLogger(IamPolicyVersionsImpl.class); + + private final IamPolicyVersionsClient innerClient; + + private final com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager; + + public IamPolicyVersionsImpl(IamPolicyVersionsClient innerClient, + com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return ResourceManagerUtils.mapPage(inner, inner1 -> new IamPolicyVersionImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new IamPolicyVersionImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName); + return ResourceManagerUtils.mapPage(inner, inner1 -> new IamPolicyVersionImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + PagedIterable inner + = this.serviceClient().listByResourceGroup(resourceGroupName, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new IamPolicyVersionImpl(inner1, this.manager())); + } + + public Response getByResourceGroupWithResponse(String resourceGroupName, String name, + Context context) { + Response inner + = this.serviceClient().getByResourceGroupWithResponse(resourceGroupName, name, context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new IamPolicyVersionImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public IamPolicyVersion getByResourceGroup(String resourceGroupName, String name) { + IamPolicyVersionInner inner = this.serviceClient().getByResourceGroup(resourceGroupName, name); + if (inner != null) { + return new IamPolicyVersionImpl(inner, this.manager()); + } else { + return null; + } + } + + public void deleteByResourceGroup(String resourceGroupName, String name) { + this.serviceClient().delete(resourceGroupName, name); + } + + public void delete(String resourceGroupName, String name, Context context) { + this.serviceClient().delete(resourceGroupName, name, context); + } + + public IamPolicyVersion getById(String id) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String name = ResourceManagerUtils.getValueFromIdByName(id, "iamPolicyVersions"); + if (name == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'iamPolicyVersions'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, name, Context.NONE).getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String name = ResourceManagerUtils.getValueFromIdByName(id, "iamPolicyVersions"); + if (name == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'iamPolicyVersions'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, name, context); + } + + public void deleteById(String id) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String name = ResourceManagerUtils.getValueFromIdByName(id, "iamPolicyVersions"); + if (name == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'iamPolicyVersions'.", id))); + } + this.delete(resourceGroupName, name, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String name = ResourceManagerUtils.getValueFromIdByName(id, "iamPolicyVersions"); + if (name == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'iamPolicyVersions'.", id))); + } + this.delete(resourceGroupName, name, context); + } + + private IamPolicyVersionsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.awsconnector.AwsconnectorManager manager() { + return this.serviceManager; + } + + public IamPolicyVersionImpl define(String name) { + return new IamPolicyVersionImpl(name, this.manager()); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/IamRoleImpl.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/IamRoleImpl.java new file mode 100644 index 000000000000..8e86b22a0d2a --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/IamRoleImpl.java @@ -0,0 +1,175 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.implementation; + +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.awsconnector.fluent.models.IamRoleInner; +import com.azure.resourcemanager.awsconnector.models.IamRole; +import com.azure.resourcemanager.awsconnector.models.IamRoleProperties; +import com.azure.resourcemanager.awsconnector.models.IamRoleTagsUpdate; +import java.util.Collections; +import java.util.Map; + +public final class IamRoleImpl implements IamRole, IamRole.Definition, IamRole.Update { + private IamRoleInner innerObject; + + private final com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public String location() { + return this.innerModel().location(); + } + + public Map tags() { + Map inner = this.innerModel().tags(); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } + } + + public IamRoleProperties properties() { + return this.innerModel().properties(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public String resourceGroupName() { + return resourceGroupName; + } + + public IamRoleInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.awsconnector.AwsconnectorManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String name; + + private IamRoleTagsUpdate updateProperties; + + public IamRoleImpl withExistingResourceGroup(String resourceGroupName) { + this.resourceGroupName = resourceGroupName; + return this; + } + + public IamRole create() { + this.innerObject = serviceManager.serviceClient() + .getIamRoles() + .createOrReplace(resourceGroupName, name, this.innerModel(), Context.NONE); + return this; + } + + public IamRole create(Context context) { + this.innerObject = serviceManager.serviceClient() + .getIamRoles() + .createOrReplace(resourceGroupName, name, this.innerModel(), context); + return this; + } + + IamRoleImpl(String name, com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager) { + this.innerObject = new IamRoleInner(); + this.serviceManager = serviceManager; + this.name = name; + } + + public IamRoleImpl update() { + this.updateProperties = new IamRoleTagsUpdate(); + return this; + } + + public IamRole apply() { + this.innerObject = serviceManager.serviceClient() + .getIamRoles() + .update(resourceGroupName, name, updateProperties, Context.NONE); + return this; + } + + public IamRole apply(Context context) { + this.innerObject + = serviceManager.serviceClient().getIamRoles().update(resourceGroupName, name, updateProperties, context); + return this; + } + + IamRoleImpl(IamRoleInner innerObject, com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.name = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "iamRoles"); + } + + public IamRole refresh() { + this.innerObject = serviceManager.serviceClient() + .getIamRoles() + .getByResourceGroupWithResponse(resourceGroupName, name, Context.NONE) + .getValue(); + return this; + } + + public IamRole refresh(Context context) { + this.innerObject = serviceManager.serviceClient() + .getIamRoles() + .getByResourceGroupWithResponse(resourceGroupName, name, context) + .getValue(); + return this; + } + + public IamRoleImpl withRegion(Region location) { + this.innerModel().withLocation(location.toString()); + return this; + } + + public IamRoleImpl withRegion(String location) { + this.innerModel().withLocation(location); + return this; + } + + public IamRoleImpl withTags(Map tags) { + if (isInCreateMode()) { + this.innerModel().withTags(tags); + return this; + } else { + this.updateProperties.withTags(tags); + return this; + } + } + + public IamRoleImpl withProperties(IamRoleProperties properties) { + this.innerModel().withProperties(properties); + return this; + } + + private boolean isInCreateMode() { + return this.innerModel().id() == null; + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/IamRolesClientImpl.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/IamRolesClientImpl.java new file mode 100644 index 000000000000..e64fa1c4a026 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/IamRolesClientImpl.java @@ -0,0 +1,1270 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.Patch; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.awsconnector.fluent.IamRolesClient; +import com.azure.resourcemanager.awsconnector.fluent.models.IamRoleInner; +import com.azure.resourcemanager.awsconnector.models.IamRoleListResult; +import com.azure.resourcemanager.awsconnector.models.IamRoleTagsUpdate; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in IamRolesClient. + */ +public final class IamRolesClientImpl implements IamRolesClient { + /** + * The proxy service used to perform REST calls. + */ + private final IamRolesService service; + + /** + * The service client containing this operation class. + */ + private final MicrosoftAwsConnectorImpl client; + + /** + * Initializes an instance of IamRolesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + IamRolesClientImpl(MicrosoftAwsConnectorImpl client) { + this.service = RestProxy.create(IamRolesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for MicrosoftAwsConnectorIamRoles to be used by the proxy service to + * perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "MicrosoftAwsConnecto") + public interface IamRolesService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.AwsConnector/iamRoles") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/iamRoles") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroup(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/iamRoles/{name}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getByResourceGroup(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("name") String name, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/iamRoles/{name}") + @ExpectedResponses({ 200, 201 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrReplace(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("name") String name, + @BodyParam("application/json") IamRoleInner resource, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/iamRoles/{name}") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> update(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("name") String name, + @BodyParam("application/json") IamRoleTagsUpdate properties, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/iamRoles/{name}") + @ExpectedResponses({ 202, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("name") String name, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listBySubscriptionNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroupNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); + } + + /** + * List IamRole resources by subscription ID. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a IamRole list operation along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync() { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), + res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List IamRole resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a IamRole list operation along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), accept, + context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * List IamRole resources by subscription ID. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a IamRole list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>(() -> listSinglePageAsync(), + nextLink -> listBySubscriptionNextSinglePageAsync(nextLink)); + } + + /** + * List IamRole resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a IamRole list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(Context context) { + return new PagedFlux<>(() -> listSinglePageAsync(context), + nextLink -> listBySubscriptionNextSinglePageAsync(nextLink, context)); + } + + /** + * List IamRole resources by subscription ID. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a IamRole list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + return new PagedIterable<>(listAsync()); + } + + /** + * List IamRole resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a IamRole list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Context context) { + return new PagedIterable<>(listAsync(context)); + } + + /** + * List IamRole resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a IamRole list operation along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), + res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List IamRole resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a IamRole list operation along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * List IamRole resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a IamRole list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName) { + return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); + } + + /** + * List IamRole resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a IamRole list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName, Context context) { + return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName, context), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink, context)); + } + + /** + * List IamRole resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a IamRole list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName)); + } + + /** + * List IamRole resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a IamRole list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, context)); + } + + /** + * Get a IamRole. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of IamRole. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a IamRole along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync(String resourceGroupName, String name) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.getByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get a IamRole. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of IamRole. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a IamRole along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync(String resourceGroupName, String name, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.getByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, accept, context); + } + + /** + * Get a IamRole. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of IamRole. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a IamRole on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getByResourceGroupAsync(String resourceGroupName, String name) { + return getByResourceGroupWithResponseAsync(resourceGroupName, name) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Get a IamRole. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of IamRole. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a IamRole along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getByResourceGroupWithResponse(String resourceGroupName, String name, + Context context) { + return getByResourceGroupWithResponseAsync(resourceGroupName, name, context).block(); + } + + /** + * Get a IamRole. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of IamRole. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a IamRole. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public IamRoleInner getByResourceGroup(String resourceGroupName, String name) { + return getByResourceGroupWithResponse(resourceGroupName, name, Context.NONE).getValue(); + } + + /** + * Create a IamRole. Please note that end user resource creation is currently restricted, but it will be enabled in + * the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of IamRole. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrReplaceWithResponseAsync(String resourceGroupName, String name, + IamRoleInner resource) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (resource == null) { + return Mono.error(new IllegalArgumentException("Parameter resource is required and cannot be null.")); + } else { + resource.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.createOrReplace(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, resource, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Create a IamRole. Please note that end user resource creation is currently restricted, but it will be enabled in + * the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of IamRole. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrReplaceWithResponseAsync(String resourceGroupName, String name, + IamRoleInner resource, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (resource == null) { + return Mono.error(new IllegalArgumentException("Parameter resource is required and cannot be null.")); + } else { + resource.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.createOrReplace(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, resource, accept, context); + } + + /** + * Create a IamRole. Please note that end user resource creation is currently restricted, but it will be enabled in + * the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of IamRole. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, IamRoleInner> beginCreateOrReplaceAsync(String resourceGroupName, + String name, IamRoleInner resource) { + Mono>> mono = createOrReplaceWithResponseAsync(resourceGroupName, name, resource); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + IamRoleInner.class, IamRoleInner.class, this.client.getContext()); + } + + /** + * Create a IamRole. Please note that end user resource creation is currently restricted, but it will be enabled in + * the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of IamRole. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, IamRoleInner> beginCreateOrReplaceAsync(String resourceGroupName, + String name, IamRoleInner resource, Context context) { + context = this.client.mergeContext(context); + Mono>> mono + = createOrReplaceWithResponseAsync(resourceGroupName, name, resource, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + IamRoleInner.class, IamRoleInner.class, context); + } + + /** + * Create a IamRole. Please note that end user resource creation is currently restricted, but it will be enabled in + * the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of IamRole. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, IamRoleInner> beginCreateOrReplace(String resourceGroupName, + String name, IamRoleInner resource) { + return this.beginCreateOrReplaceAsync(resourceGroupName, name, resource).getSyncPoller(); + } + + /** + * Create a IamRole. Please note that end user resource creation is currently restricted, but it will be enabled in + * the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of IamRole. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, IamRoleInner> beginCreateOrReplace(String resourceGroupName, + String name, IamRoleInner resource, Context context) { + return this.beginCreateOrReplaceAsync(resourceGroupName, name, resource, context).getSyncPoller(); + } + + /** + * Create a IamRole. Please note that end user resource creation is currently restricted, but it will be enabled in + * the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of IamRole. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrReplaceAsync(String resourceGroupName, String name, IamRoleInner resource) { + return beginCreateOrReplaceAsync(resourceGroupName, name, resource).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create a IamRole. Please note that end user resource creation is currently restricted, but it will be enabled in + * the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of IamRole. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrReplaceAsync(String resourceGroupName, String name, IamRoleInner resource, + Context context) { + return beginCreateOrReplaceAsync(resourceGroupName, name, resource, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create a IamRole. Please note that end user resource creation is currently restricted, but it will be enabled in + * the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of IamRole. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public IamRoleInner createOrReplace(String resourceGroupName, String name, IamRoleInner resource) { + return createOrReplaceAsync(resourceGroupName, name, resource).block(); + } + + /** + * Create a IamRole. Please note that end user resource creation is currently restricted, but it will be enabled in + * the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of IamRole. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public IamRoleInner createOrReplace(String resourceGroupName, String name, IamRoleInner resource, Context context) { + return createOrReplaceAsync(resourceGroupName, name, resource, context).block(); + } + + /** + * Update a IamRole. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of IamRole. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync(String resourceGroupName, String name, + IamRoleTagsUpdate properties) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (properties == null) { + return Mono.error(new IllegalArgumentException("Parameter properties is required and cannot be null.")); + } else { + properties.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.update(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, properties, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Update a IamRole. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of IamRole. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync(String resourceGroupName, String name, + IamRoleTagsUpdate properties, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (properties == null) { + return Mono.error(new IllegalArgumentException("Parameter properties is required and cannot be null.")); + } else { + properties.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.update(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, name, properties, accept, context); + } + + /** + * Update a IamRole. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of IamRole. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, IamRoleInner> beginUpdateAsync(String resourceGroupName, String name, + IamRoleTagsUpdate properties) { + Mono>> mono = updateWithResponseAsync(resourceGroupName, name, properties); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + IamRoleInner.class, IamRoleInner.class, this.client.getContext()); + } + + /** + * Update a IamRole. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of IamRole. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, IamRoleInner> beginUpdateAsync(String resourceGroupName, String name, + IamRoleTagsUpdate properties, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = updateWithResponseAsync(resourceGroupName, name, properties, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + IamRoleInner.class, IamRoleInner.class, context); + } + + /** + * Update a IamRole. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of IamRole. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, IamRoleInner> beginUpdate(String resourceGroupName, String name, + IamRoleTagsUpdate properties) { + return this.beginUpdateAsync(resourceGroupName, name, properties).getSyncPoller(); + } + + /** + * Update a IamRole. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of IamRole. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, IamRoleInner> beginUpdate(String resourceGroupName, String name, + IamRoleTagsUpdate properties, Context context) { + return this.beginUpdateAsync(resourceGroupName, name, properties, context).getSyncPoller(); + } + + /** + * Update a IamRole. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of IamRole. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync(String resourceGroupName, String name, IamRoleTagsUpdate properties) { + return beginUpdateAsync(resourceGroupName, name, properties).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Update a IamRole. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of IamRole. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync(String resourceGroupName, String name, IamRoleTagsUpdate properties, + Context context) { + return beginUpdateAsync(resourceGroupName, name, properties, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Update a IamRole. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of IamRole. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public IamRoleInner update(String resourceGroupName, String name, IamRoleTagsUpdate properties) { + return updateAsync(resourceGroupName, name, properties).block(); + } + + /** + * Update a IamRole. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of IamRole. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public IamRoleInner update(String resourceGroupName, String name, IamRoleTagsUpdate properties, Context context) { + return updateAsync(resourceGroupName, name, properties, context).block(); + } + + /** + * Delete a IamRole. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of IamRole. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync(String resourceGroupName, String name) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Delete a IamRole. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of IamRole. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync(String resourceGroupName, String name, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.delete(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, name, accept, context); + } + + /** + * Delete a IamRole. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of IamRole. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String name) { + Mono>> mono = deleteWithResponseAsync(resourceGroupName, name); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); + } + + /** + * Delete a IamRole. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of IamRole. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String name, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = deleteWithResponseAsync(resourceGroupName, name, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + context); + } + + /** + * Delete a IamRole. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of IamRole. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String name) { + return this.beginDeleteAsync(resourceGroupName, name).getSyncPoller(); + } + + /** + * Delete a IamRole. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of IamRole. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String name, Context context) { + return this.beginDeleteAsync(resourceGroupName, name, context).getSyncPoller(); + } + + /** + * Delete a IamRole. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of IamRole. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String name) { + return beginDeleteAsync(resourceGroupName, name).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete a IamRole. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of IamRole. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String name, Context context) { + return beginDeleteAsync(resourceGroupName, name, context).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete a IamRole. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of IamRole. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String name) { + deleteAsync(resourceGroupName, name).block(); + } + + /** + * Delete a IamRole. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of IamRole. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String name, Context context) { + deleteAsync(resourceGroupName, name, context).block(); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a IamRole list operation along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listBySubscriptionNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), + res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a IamRole list operation along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listBySubscriptionNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a IamRole list operation along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), + res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a IamRole list operation along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/IamRolesImpl.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/IamRolesImpl.java new file mode 100644 index 000000000000..f684df70778b --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/IamRolesImpl.java @@ -0,0 +1,145 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.awsconnector.fluent.IamRolesClient; +import com.azure.resourcemanager.awsconnector.fluent.models.IamRoleInner; +import com.azure.resourcemanager.awsconnector.models.IamRole; +import com.azure.resourcemanager.awsconnector.models.IamRoles; + +public final class IamRolesImpl implements IamRoles { + private static final ClientLogger LOGGER = new ClientLogger(IamRolesImpl.class); + + private final IamRolesClient innerClient; + + private final com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager; + + public IamRolesImpl(IamRolesClient innerClient, + com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return ResourceManagerUtils.mapPage(inner, inner1 -> new IamRoleImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new IamRoleImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName); + return ResourceManagerUtils.mapPage(inner, inner1 -> new IamRoleImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new IamRoleImpl(inner1, this.manager())); + } + + public Response getByResourceGroupWithResponse(String resourceGroupName, String name, Context context) { + Response inner + = this.serviceClient().getByResourceGroupWithResponse(resourceGroupName, name, context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new IamRoleImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public IamRole getByResourceGroup(String resourceGroupName, String name) { + IamRoleInner inner = this.serviceClient().getByResourceGroup(resourceGroupName, name); + if (inner != null) { + return new IamRoleImpl(inner, this.manager()); + } else { + return null; + } + } + + public void deleteByResourceGroup(String resourceGroupName, String name) { + this.serviceClient().delete(resourceGroupName, name); + } + + public void delete(String resourceGroupName, String name, Context context) { + this.serviceClient().delete(resourceGroupName, name, context); + } + + public IamRole getById(String id) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String name = ResourceManagerUtils.getValueFromIdByName(id, "iamRoles"); + if (name == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'iamRoles'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, name, Context.NONE).getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String name = ResourceManagerUtils.getValueFromIdByName(id, "iamRoles"); + if (name == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'iamRoles'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, name, context); + } + + public void deleteById(String id) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String name = ResourceManagerUtils.getValueFromIdByName(id, "iamRoles"); + if (name == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'iamRoles'.", id))); + } + this.delete(resourceGroupName, name, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String name = ResourceManagerUtils.getValueFromIdByName(id, "iamRoles"); + if (name == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'iamRoles'.", id))); + } + this.delete(resourceGroupName, name, context); + } + + private IamRolesClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.awsconnector.AwsconnectorManager manager() { + return this.serviceManager; + } + + public IamRoleImpl define(String name) { + return new IamRoleImpl(name, this.manager()); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/IamServerCertificateImpl.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/IamServerCertificateImpl.java new file mode 100644 index 000000000000..822f1fadd743 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/IamServerCertificateImpl.java @@ -0,0 +1,178 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.implementation; + +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.awsconnector.fluent.models.IamServerCertificateInner; +import com.azure.resourcemanager.awsconnector.models.IamServerCertificate; +import com.azure.resourcemanager.awsconnector.models.IamServerCertificateProperties; +import com.azure.resourcemanager.awsconnector.models.IamServerCertificateTagsUpdate; +import java.util.Collections; +import java.util.Map; + +public final class IamServerCertificateImpl + implements IamServerCertificate, IamServerCertificate.Definition, IamServerCertificate.Update { + private IamServerCertificateInner innerObject; + + private final com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public String location() { + return this.innerModel().location(); + } + + public Map tags() { + Map inner = this.innerModel().tags(); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } + } + + public IamServerCertificateProperties properties() { + return this.innerModel().properties(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public String resourceGroupName() { + return resourceGroupName; + } + + public IamServerCertificateInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.awsconnector.AwsconnectorManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String name; + + private IamServerCertificateTagsUpdate updateProperties; + + public IamServerCertificateImpl withExistingResourceGroup(String resourceGroupName) { + this.resourceGroupName = resourceGroupName; + return this; + } + + public IamServerCertificate create() { + this.innerObject = serviceManager.serviceClient() + .getIamServerCertificates() + .createOrReplace(resourceGroupName, name, this.innerModel(), Context.NONE); + return this; + } + + public IamServerCertificate create(Context context) { + this.innerObject = serviceManager.serviceClient() + .getIamServerCertificates() + .createOrReplace(resourceGroupName, name, this.innerModel(), context); + return this; + } + + IamServerCertificateImpl(String name, com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager) { + this.innerObject = new IamServerCertificateInner(); + this.serviceManager = serviceManager; + this.name = name; + } + + public IamServerCertificateImpl update() { + this.updateProperties = new IamServerCertificateTagsUpdate(); + return this; + } + + public IamServerCertificate apply() { + this.innerObject = serviceManager.serviceClient() + .getIamServerCertificates() + .update(resourceGroupName, name, updateProperties, Context.NONE); + return this; + } + + public IamServerCertificate apply(Context context) { + this.innerObject = serviceManager.serviceClient() + .getIamServerCertificates() + .update(resourceGroupName, name, updateProperties, context); + return this; + } + + IamServerCertificateImpl(IamServerCertificateInner innerObject, + com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.name = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "iamServerCertificates"); + } + + public IamServerCertificate refresh() { + this.innerObject = serviceManager.serviceClient() + .getIamServerCertificates() + .getByResourceGroupWithResponse(resourceGroupName, name, Context.NONE) + .getValue(); + return this; + } + + public IamServerCertificate refresh(Context context) { + this.innerObject = serviceManager.serviceClient() + .getIamServerCertificates() + .getByResourceGroupWithResponse(resourceGroupName, name, context) + .getValue(); + return this; + } + + public IamServerCertificateImpl withRegion(Region location) { + this.innerModel().withLocation(location.toString()); + return this; + } + + public IamServerCertificateImpl withRegion(String location) { + this.innerModel().withLocation(location); + return this; + } + + public IamServerCertificateImpl withTags(Map tags) { + if (isInCreateMode()) { + this.innerModel().withTags(tags); + return this; + } else { + this.updateProperties.withTags(tags); + return this; + } + } + + public IamServerCertificateImpl withProperties(IamServerCertificateProperties properties) { + this.innerModel().withProperties(properties); + return this; + } + + private boolean isInCreateMode() { + return this.innerModel().id() == null; + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/IamServerCertificatesClientImpl.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/IamServerCertificatesClientImpl.java new file mode 100644 index 000000000000..28fb0e93fa6f --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/IamServerCertificatesClientImpl.java @@ -0,0 +1,1283 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.Patch; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.awsconnector.fluent.IamServerCertificatesClient; +import com.azure.resourcemanager.awsconnector.fluent.models.IamServerCertificateInner; +import com.azure.resourcemanager.awsconnector.models.IamServerCertificateListResult; +import com.azure.resourcemanager.awsconnector.models.IamServerCertificateTagsUpdate; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in IamServerCertificatesClient. + */ +public final class IamServerCertificatesClientImpl implements IamServerCertificatesClient { + /** + * The proxy service used to perform REST calls. + */ + private final IamServerCertificatesService service; + + /** + * The service client containing this operation class. + */ + private final MicrosoftAwsConnectorImpl client; + + /** + * Initializes an instance of IamServerCertificatesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + IamServerCertificatesClientImpl(MicrosoftAwsConnectorImpl client) { + this.service = RestProxy.create(IamServerCertificatesService.class, client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for MicrosoftAwsConnectorIamServerCertificates to be used by the proxy + * service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "MicrosoftAwsConnecto") + public interface IamServerCertificatesService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.AwsConnector/iamServerCertificates") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/iamServerCertificates") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroup(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/iamServerCertificates/{name}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getByResourceGroup(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("name") String name, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/iamServerCertificates/{name}") + @ExpectedResponses({ 200, 201 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrReplace(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("name") String name, + @BodyParam("application/json") IamServerCertificateInner resource, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/iamServerCertificates/{name}") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> update(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("name") String name, + @BodyParam("application/json") IamServerCertificateTagsUpdate properties, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/iamServerCertificates/{name}") + @ExpectedResponses({ 202, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("name") String name, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listBySubscriptionNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroupNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); + } + + /** + * List IamServerCertificate resources by subscription ID. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a IamServerCertificate list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync() { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List IamServerCertificate resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a IamServerCertificate list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), accept, + context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * List IamServerCertificate resources by subscription ID. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a IamServerCertificate list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>(() -> listSinglePageAsync(), + nextLink -> listBySubscriptionNextSinglePageAsync(nextLink)); + } + + /** + * List IamServerCertificate resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a IamServerCertificate list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(Context context) { + return new PagedFlux<>(() -> listSinglePageAsync(context), + nextLink -> listBySubscriptionNextSinglePageAsync(nextLink, context)); + } + + /** + * List IamServerCertificate resources by subscription ID. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a IamServerCertificate list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + return new PagedIterable<>(listAsync()); + } + + /** + * List IamServerCertificate resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a IamServerCertificate list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Context context) { + return new PagedIterable<>(listAsync(context)); + } + + /** + * List IamServerCertificate resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a IamServerCertificate list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> + listByResourceGroupSinglePageAsync(String resourceGroupName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List IamServerCertificate resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a IamServerCertificate list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * List IamServerCertificate resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a IamServerCertificate list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName) { + return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); + } + + /** + * List IamServerCertificate resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a IamServerCertificate list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName, Context context) { + return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName, context), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink, context)); + } + + /** + * List IamServerCertificate resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a IamServerCertificate list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName)); + } + + /** + * List IamServerCertificate resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a IamServerCertificate list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, context)); + } + + /** + * Get a IamServerCertificate. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of IamServerCertificate. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a IamServerCertificate along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync(String resourceGroupName, + String name) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.getByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get a IamServerCertificate. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of IamServerCertificate. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a IamServerCertificate along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync(String resourceGroupName, + String name, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.getByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, accept, context); + } + + /** + * Get a IamServerCertificate. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of IamServerCertificate. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a IamServerCertificate on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getByResourceGroupAsync(String resourceGroupName, String name) { + return getByResourceGroupWithResponseAsync(resourceGroupName, name) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Get a IamServerCertificate. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of IamServerCertificate. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a IamServerCertificate along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getByResourceGroupWithResponse(String resourceGroupName, String name, + Context context) { + return getByResourceGroupWithResponseAsync(resourceGroupName, name, context).block(); + } + + /** + * Get a IamServerCertificate. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of IamServerCertificate. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a IamServerCertificate. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public IamServerCertificateInner getByResourceGroup(String resourceGroupName, String name) { + return getByResourceGroupWithResponse(resourceGroupName, name, Context.NONE).getValue(); + } + + /** + * Create a IamServerCertificate. Please note that end user resource creation is currently restricted, but it will + * be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of IamServerCertificate. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrReplaceWithResponseAsync(String resourceGroupName, String name, + IamServerCertificateInner resource) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (resource == null) { + return Mono.error(new IllegalArgumentException("Parameter resource is required and cannot be null.")); + } else { + resource.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.createOrReplace(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, resource, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Create a IamServerCertificate. Please note that end user resource creation is currently restricted, but it will + * be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of IamServerCertificate. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrReplaceWithResponseAsync(String resourceGroupName, String name, + IamServerCertificateInner resource, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (resource == null) { + return Mono.error(new IllegalArgumentException("Parameter resource is required and cannot be null.")); + } else { + resource.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.createOrReplace(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, resource, accept, context); + } + + /** + * Create a IamServerCertificate. Please note that end user resource creation is currently restricted, but it will + * be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of IamServerCertificate. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, IamServerCertificateInner> + beginCreateOrReplaceAsync(String resourceGroupName, String name, IamServerCertificateInner resource) { + Mono>> mono = createOrReplaceWithResponseAsync(resourceGroupName, name, resource); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), IamServerCertificateInner.class, IamServerCertificateInner.class, + this.client.getContext()); + } + + /** + * Create a IamServerCertificate. Please note that end user resource creation is currently restricted, but it will + * be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of IamServerCertificate. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, IamServerCertificateInner> beginCreateOrReplaceAsync( + String resourceGroupName, String name, IamServerCertificateInner resource, Context context) { + context = this.client.mergeContext(context); + Mono>> mono + = createOrReplaceWithResponseAsync(resourceGroupName, name, resource, context); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), IamServerCertificateInner.class, IamServerCertificateInner.class, context); + } + + /** + * Create a IamServerCertificate. Please note that end user resource creation is currently restricted, but it will + * be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of IamServerCertificate. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, IamServerCertificateInner> + beginCreateOrReplace(String resourceGroupName, String name, IamServerCertificateInner resource) { + return this.beginCreateOrReplaceAsync(resourceGroupName, name, resource).getSyncPoller(); + } + + /** + * Create a IamServerCertificate. Please note that end user resource creation is currently restricted, but it will + * be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of IamServerCertificate. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, IamServerCertificateInner> beginCreateOrReplace( + String resourceGroupName, String name, IamServerCertificateInner resource, Context context) { + return this.beginCreateOrReplaceAsync(resourceGroupName, name, resource, context).getSyncPoller(); + } + + /** + * Create a IamServerCertificate. Please note that end user resource creation is currently restricted, but it will + * be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of IamServerCertificate. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrReplaceAsync(String resourceGroupName, String name, + IamServerCertificateInner resource) { + return beginCreateOrReplaceAsync(resourceGroupName, name, resource).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create a IamServerCertificate. Please note that end user resource creation is currently restricted, but it will + * be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of IamServerCertificate. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrReplaceAsync(String resourceGroupName, String name, + IamServerCertificateInner resource, Context context) { + return beginCreateOrReplaceAsync(resourceGroupName, name, resource, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create a IamServerCertificate. Please note that end user resource creation is currently restricted, but it will + * be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of IamServerCertificate. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public IamServerCertificateInner createOrReplace(String resourceGroupName, String name, + IamServerCertificateInner resource) { + return createOrReplaceAsync(resourceGroupName, name, resource).block(); + } + + /** + * Create a IamServerCertificate. Please note that end user resource creation is currently restricted, but it will + * be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of IamServerCertificate. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public IamServerCertificateInner createOrReplace(String resourceGroupName, String name, + IamServerCertificateInner resource, Context context) { + return createOrReplaceAsync(resourceGroupName, name, resource, context).block(); + } + + /** + * Update a IamServerCertificate. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of IamServerCertificate. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync(String resourceGroupName, String name, + IamServerCertificateTagsUpdate properties) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (properties == null) { + return Mono.error(new IllegalArgumentException("Parameter properties is required and cannot be null.")); + } else { + properties.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.update(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, properties, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Update a IamServerCertificate. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of IamServerCertificate. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync(String resourceGroupName, String name, + IamServerCertificateTagsUpdate properties, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (properties == null) { + return Mono.error(new IllegalArgumentException("Parameter properties is required and cannot be null.")); + } else { + properties.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.update(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, name, properties, accept, context); + } + + /** + * Update a IamServerCertificate. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of IamServerCertificate. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, IamServerCertificateInner> + beginUpdateAsync(String resourceGroupName, String name, IamServerCertificateTagsUpdate properties) { + Mono>> mono = updateWithResponseAsync(resourceGroupName, name, properties); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), IamServerCertificateInner.class, IamServerCertificateInner.class, + this.client.getContext()); + } + + /** + * Update a IamServerCertificate. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of IamServerCertificate. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, IamServerCertificateInner> beginUpdateAsync( + String resourceGroupName, String name, IamServerCertificateTagsUpdate properties, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = updateWithResponseAsync(resourceGroupName, name, properties, context); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), IamServerCertificateInner.class, IamServerCertificateInner.class, context); + } + + /** + * Update a IamServerCertificate. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of IamServerCertificate. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, IamServerCertificateInner> + beginUpdate(String resourceGroupName, String name, IamServerCertificateTagsUpdate properties) { + return this.beginUpdateAsync(resourceGroupName, name, properties).getSyncPoller(); + } + + /** + * Update a IamServerCertificate. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of IamServerCertificate. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, IamServerCertificateInner> + beginUpdate(String resourceGroupName, String name, IamServerCertificateTagsUpdate properties, Context context) { + return this.beginUpdateAsync(resourceGroupName, name, properties, context).getSyncPoller(); + } + + /** + * Update a IamServerCertificate. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of IamServerCertificate. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync(String resourceGroupName, String name, + IamServerCertificateTagsUpdate properties) { + return beginUpdateAsync(resourceGroupName, name, properties).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Update a IamServerCertificate. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of IamServerCertificate. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync(String resourceGroupName, String name, + IamServerCertificateTagsUpdate properties, Context context) { + return beginUpdateAsync(resourceGroupName, name, properties, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Update a IamServerCertificate. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of IamServerCertificate. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public IamServerCertificateInner update(String resourceGroupName, String name, + IamServerCertificateTagsUpdate properties) { + return updateAsync(resourceGroupName, name, properties).block(); + } + + /** + * Update a IamServerCertificate. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of IamServerCertificate. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public IamServerCertificateInner update(String resourceGroupName, String name, + IamServerCertificateTagsUpdate properties, Context context) { + return updateAsync(resourceGroupName, name, properties, context).block(); + } + + /** + * Delete a IamServerCertificate. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of IamServerCertificate. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync(String resourceGroupName, String name) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Delete a IamServerCertificate. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of IamServerCertificate. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync(String resourceGroupName, String name, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.delete(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, name, accept, context); + } + + /** + * Delete a IamServerCertificate. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of IamServerCertificate. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String name) { + Mono>> mono = deleteWithResponseAsync(resourceGroupName, name); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); + } + + /** + * Delete a IamServerCertificate. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of IamServerCertificate. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String name, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = deleteWithResponseAsync(resourceGroupName, name, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + context); + } + + /** + * Delete a IamServerCertificate. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of IamServerCertificate. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String name) { + return this.beginDeleteAsync(resourceGroupName, name).getSyncPoller(); + } + + /** + * Delete a IamServerCertificate. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of IamServerCertificate. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String name, Context context) { + return this.beginDeleteAsync(resourceGroupName, name, context).getSyncPoller(); + } + + /** + * Delete a IamServerCertificate. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of IamServerCertificate. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String name) { + return beginDeleteAsync(resourceGroupName, name).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete a IamServerCertificate. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of IamServerCertificate. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String name, Context context) { + return beginDeleteAsync(resourceGroupName, name, context).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete a IamServerCertificate. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of IamServerCertificate. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String name) { + deleteAsync(resourceGroupName, name).block(); + } + + /** + * Delete a IamServerCertificate. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of IamServerCertificate. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String name, Context context) { + deleteAsync(resourceGroupName, name, context).block(); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a IamServerCertificate list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listBySubscriptionNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a IamServerCertificate list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listBySubscriptionNextSinglePageAsync(String nextLink, + Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a IamServerCertificate list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a IamServerCertificate list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupNextSinglePageAsync(String nextLink, + Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/IamServerCertificatesImpl.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/IamServerCertificatesImpl.java new file mode 100644 index 000000000000..c750f465263d --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/IamServerCertificatesImpl.java @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.awsconnector.fluent.IamServerCertificatesClient; +import com.azure.resourcemanager.awsconnector.fluent.models.IamServerCertificateInner; +import com.azure.resourcemanager.awsconnector.models.IamServerCertificate; +import com.azure.resourcemanager.awsconnector.models.IamServerCertificates; + +public final class IamServerCertificatesImpl implements IamServerCertificates { + private static final ClientLogger LOGGER = new ClientLogger(IamServerCertificatesImpl.class); + + private final IamServerCertificatesClient innerClient; + + private final com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager; + + public IamServerCertificatesImpl(IamServerCertificatesClient innerClient, + com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return ResourceManagerUtils.mapPage(inner, inner1 -> new IamServerCertificateImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new IamServerCertificateImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName); + return ResourceManagerUtils.mapPage(inner, inner1 -> new IamServerCertificateImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + PagedIterable inner + = this.serviceClient().listByResourceGroup(resourceGroupName, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new IamServerCertificateImpl(inner1, this.manager())); + } + + public Response getByResourceGroupWithResponse(String resourceGroupName, String name, + Context context) { + Response inner + = this.serviceClient().getByResourceGroupWithResponse(resourceGroupName, name, context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new IamServerCertificateImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public IamServerCertificate getByResourceGroup(String resourceGroupName, String name) { + IamServerCertificateInner inner = this.serviceClient().getByResourceGroup(resourceGroupName, name); + if (inner != null) { + return new IamServerCertificateImpl(inner, this.manager()); + } else { + return null; + } + } + + public void deleteByResourceGroup(String resourceGroupName, String name) { + this.serviceClient().delete(resourceGroupName, name); + } + + public void delete(String resourceGroupName, String name, Context context) { + this.serviceClient().delete(resourceGroupName, name, context); + } + + public IamServerCertificate getById(String id) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String name = ResourceManagerUtils.getValueFromIdByName(id, "iamServerCertificates"); + if (name == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'iamServerCertificates'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, name, Context.NONE).getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String name = ResourceManagerUtils.getValueFromIdByName(id, "iamServerCertificates"); + if (name == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'iamServerCertificates'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, name, context); + } + + public void deleteById(String id) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String name = ResourceManagerUtils.getValueFromIdByName(id, "iamServerCertificates"); + if (name == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'iamServerCertificates'.", id))); + } + this.delete(resourceGroupName, name, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String name = ResourceManagerUtils.getValueFromIdByName(id, "iamServerCertificates"); + if (name == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'iamServerCertificates'.", id))); + } + this.delete(resourceGroupName, name, context); + } + + private IamServerCertificatesClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.awsconnector.AwsconnectorManager manager() { + return this.serviceManager; + } + + public IamServerCertificateImpl define(String name) { + return new IamServerCertificateImpl(name, this.manager()); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/IamVirtualMfaDeviceImpl.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/IamVirtualMfaDeviceImpl.java new file mode 100644 index 000000000000..8ed6c7b263bd --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/IamVirtualMfaDeviceImpl.java @@ -0,0 +1,178 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.implementation; + +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.awsconnector.fluent.models.IamVirtualMfaDeviceInner; +import com.azure.resourcemanager.awsconnector.models.IamVirtualMfaDevice; +import com.azure.resourcemanager.awsconnector.models.IamVirtualMfaDeviceProperties; +import com.azure.resourcemanager.awsconnector.models.IamVirtualMfaDeviceTagsUpdate; +import java.util.Collections; +import java.util.Map; + +public final class IamVirtualMfaDeviceImpl + implements IamVirtualMfaDevice, IamVirtualMfaDevice.Definition, IamVirtualMfaDevice.Update { + private IamVirtualMfaDeviceInner innerObject; + + private final com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public String location() { + return this.innerModel().location(); + } + + public Map tags() { + Map inner = this.innerModel().tags(); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } + } + + public IamVirtualMfaDeviceProperties properties() { + return this.innerModel().properties(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public String resourceGroupName() { + return resourceGroupName; + } + + public IamVirtualMfaDeviceInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.awsconnector.AwsconnectorManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String name; + + private IamVirtualMfaDeviceTagsUpdate updateProperties; + + public IamVirtualMfaDeviceImpl withExistingResourceGroup(String resourceGroupName) { + this.resourceGroupName = resourceGroupName; + return this; + } + + public IamVirtualMfaDevice create() { + this.innerObject = serviceManager.serviceClient() + .getIamVirtualMfaDevices() + .createOrReplace(resourceGroupName, name, this.innerModel(), Context.NONE); + return this; + } + + public IamVirtualMfaDevice create(Context context) { + this.innerObject = serviceManager.serviceClient() + .getIamVirtualMfaDevices() + .createOrReplace(resourceGroupName, name, this.innerModel(), context); + return this; + } + + IamVirtualMfaDeviceImpl(String name, com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager) { + this.innerObject = new IamVirtualMfaDeviceInner(); + this.serviceManager = serviceManager; + this.name = name; + } + + public IamVirtualMfaDeviceImpl update() { + this.updateProperties = new IamVirtualMfaDeviceTagsUpdate(); + return this; + } + + public IamVirtualMfaDevice apply() { + this.innerObject = serviceManager.serviceClient() + .getIamVirtualMfaDevices() + .update(resourceGroupName, name, updateProperties, Context.NONE); + return this; + } + + public IamVirtualMfaDevice apply(Context context) { + this.innerObject = serviceManager.serviceClient() + .getIamVirtualMfaDevices() + .update(resourceGroupName, name, updateProperties, context); + return this; + } + + IamVirtualMfaDeviceImpl(IamVirtualMfaDeviceInner innerObject, + com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.name = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "iamVirtualMFADevices"); + } + + public IamVirtualMfaDevice refresh() { + this.innerObject = serviceManager.serviceClient() + .getIamVirtualMfaDevices() + .getByResourceGroupWithResponse(resourceGroupName, name, Context.NONE) + .getValue(); + return this; + } + + public IamVirtualMfaDevice refresh(Context context) { + this.innerObject = serviceManager.serviceClient() + .getIamVirtualMfaDevices() + .getByResourceGroupWithResponse(resourceGroupName, name, context) + .getValue(); + return this; + } + + public IamVirtualMfaDeviceImpl withRegion(Region location) { + this.innerModel().withLocation(location.toString()); + return this; + } + + public IamVirtualMfaDeviceImpl withRegion(String location) { + this.innerModel().withLocation(location); + return this; + } + + public IamVirtualMfaDeviceImpl withTags(Map tags) { + if (isInCreateMode()) { + this.innerModel().withTags(tags); + return this; + } else { + this.updateProperties.withTags(tags); + return this; + } + } + + public IamVirtualMfaDeviceImpl withProperties(IamVirtualMfaDeviceProperties properties) { + this.innerModel().withProperties(properties); + return this; + } + + private boolean isInCreateMode() { + return this.innerModel().id() == null; + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/IamVirtualMfaDevicesClientImpl.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/IamVirtualMfaDevicesClientImpl.java new file mode 100644 index 000000000000..22638022bfd7 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/IamVirtualMfaDevicesClientImpl.java @@ -0,0 +1,1282 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.Patch; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.awsconnector.fluent.IamVirtualMfaDevicesClient; +import com.azure.resourcemanager.awsconnector.fluent.models.IamVirtualMfaDeviceInner; +import com.azure.resourcemanager.awsconnector.models.IamVirtualMfaDeviceListResult; +import com.azure.resourcemanager.awsconnector.models.IamVirtualMfaDeviceTagsUpdate; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in IamVirtualMfaDevicesClient. + */ +public final class IamVirtualMfaDevicesClientImpl implements IamVirtualMfaDevicesClient { + /** + * The proxy service used to perform REST calls. + */ + private final IamVirtualMfaDevicesService service; + + /** + * The service client containing this operation class. + */ + private final MicrosoftAwsConnectorImpl client; + + /** + * Initializes an instance of IamVirtualMfaDevicesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + IamVirtualMfaDevicesClientImpl(MicrosoftAwsConnectorImpl client) { + this.service = RestProxy.create(IamVirtualMfaDevicesService.class, client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for MicrosoftAwsConnectorIamVirtualMfaDevices to be used by the proxy + * service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "MicrosoftAwsConnecto") + public interface IamVirtualMfaDevicesService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.AwsConnector/iamVirtualMFADevices") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/iamVirtualMFADevices") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroup(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/iamVirtualMFADevices/{name}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getByResourceGroup(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("name") String name, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/iamVirtualMFADevices/{name}") + @ExpectedResponses({ 200, 201 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrReplace(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("name") String name, + @BodyParam("application/json") IamVirtualMfaDeviceInner resource, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/iamVirtualMFADevices/{name}") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> update(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("name") String name, + @BodyParam("application/json") IamVirtualMfaDeviceTagsUpdate properties, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/iamVirtualMFADevices/{name}") + @ExpectedResponses({ 202, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("name") String name, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listBySubscriptionNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroupNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); + } + + /** + * List IamVirtualMFADevice resources by subscription ID. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a IamVirtualMFADevice list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync() { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List IamVirtualMFADevice resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a IamVirtualMFADevice list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), accept, + context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * List IamVirtualMFADevice resources by subscription ID. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a IamVirtualMFADevice list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>(() -> listSinglePageAsync(), + nextLink -> listBySubscriptionNextSinglePageAsync(nextLink)); + } + + /** + * List IamVirtualMFADevice resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a IamVirtualMFADevice list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(Context context) { + return new PagedFlux<>(() -> listSinglePageAsync(context), + nextLink -> listBySubscriptionNextSinglePageAsync(nextLink, context)); + } + + /** + * List IamVirtualMFADevice resources by subscription ID. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a IamVirtualMFADevice list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + return new PagedIterable<>(listAsync()); + } + + /** + * List IamVirtualMFADevice resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a IamVirtualMFADevice list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Context context) { + return new PagedIterable<>(listAsync(context)); + } + + /** + * List IamVirtualMFADevice resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a IamVirtualMFADevice list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List IamVirtualMFADevice resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a IamVirtualMFADevice list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * List IamVirtualMFADevice resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a IamVirtualMFADevice list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName) { + return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); + } + + /** + * List IamVirtualMFADevice resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a IamVirtualMFADevice list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName, Context context) { + return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName, context), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink, context)); + } + + /** + * List IamVirtualMFADevice resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a IamVirtualMFADevice list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName)); + } + + /** + * List IamVirtualMFADevice resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a IamVirtualMFADevice list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, context)); + } + + /** + * Get a IamVirtualMFADevice. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of IamVirtualMFADevice. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a IamVirtualMFADevice along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync(String resourceGroupName, + String name) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.getByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get a IamVirtualMFADevice. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of IamVirtualMFADevice. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a IamVirtualMFADevice along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync(String resourceGroupName, + String name, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.getByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, accept, context); + } + + /** + * Get a IamVirtualMFADevice. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of IamVirtualMFADevice. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a IamVirtualMFADevice on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getByResourceGroupAsync(String resourceGroupName, String name) { + return getByResourceGroupWithResponseAsync(resourceGroupName, name) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Get a IamVirtualMFADevice. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of IamVirtualMFADevice. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a IamVirtualMFADevice along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getByResourceGroupWithResponse(String resourceGroupName, String name, + Context context) { + return getByResourceGroupWithResponseAsync(resourceGroupName, name, context).block(); + } + + /** + * Get a IamVirtualMFADevice. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of IamVirtualMFADevice. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a IamVirtualMFADevice. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public IamVirtualMfaDeviceInner getByResourceGroup(String resourceGroupName, String name) { + return getByResourceGroupWithResponse(resourceGroupName, name, Context.NONE).getValue(); + } + + /** + * Create a IamVirtualMFADevice. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of IamVirtualMFADevice. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrReplaceWithResponseAsync(String resourceGroupName, String name, + IamVirtualMfaDeviceInner resource) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (resource == null) { + return Mono.error(new IllegalArgumentException("Parameter resource is required and cannot be null.")); + } else { + resource.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.createOrReplace(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, resource, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Create a IamVirtualMFADevice. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of IamVirtualMFADevice. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrReplaceWithResponseAsync(String resourceGroupName, String name, + IamVirtualMfaDeviceInner resource, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (resource == null) { + return Mono.error(new IllegalArgumentException("Parameter resource is required and cannot be null.")); + } else { + resource.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.createOrReplace(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, resource, accept, context); + } + + /** + * Create a IamVirtualMFADevice. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of IamVirtualMFADevice. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, IamVirtualMfaDeviceInner> + beginCreateOrReplaceAsync(String resourceGroupName, String name, IamVirtualMfaDeviceInner resource) { + Mono>> mono = createOrReplaceWithResponseAsync(resourceGroupName, name, resource); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), IamVirtualMfaDeviceInner.class, IamVirtualMfaDeviceInner.class, + this.client.getContext()); + } + + /** + * Create a IamVirtualMFADevice. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of IamVirtualMFADevice. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, IamVirtualMfaDeviceInner> beginCreateOrReplaceAsync( + String resourceGroupName, String name, IamVirtualMfaDeviceInner resource, Context context) { + context = this.client.mergeContext(context); + Mono>> mono + = createOrReplaceWithResponseAsync(resourceGroupName, name, resource, context); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), IamVirtualMfaDeviceInner.class, IamVirtualMfaDeviceInner.class, context); + } + + /** + * Create a IamVirtualMFADevice. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of IamVirtualMFADevice. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, IamVirtualMfaDeviceInner> + beginCreateOrReplace(String resourceGroupName, String name, IamVirtualMfaDeviceInner resource) { + return this.beginCreateOrReplaceAsync(resourceGroupName, name, resource).getSyncPoller(); + } + + /** + * Create a IamVirtualMFADevice. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of IamVirtualMFADevice. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, IamVirtualMfaDeviceInner> beginCreateOrReplace( + String resourceGroupName, String name, IamVirtualMfaDeviceInner resource, Context context) { + return this.beginCreateOrReplaceAsync(resourceGroupName, name, resource, context).getSyncPoller(); + } + + /** + * Create a IamVirtualMFADevice. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of IamVirtualMFADevice. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrReplaceAsync(String resourceGroupName, String name, + IamVirtualMfaDeviceInner resource) { + return beginCreateOrReplaceAsync(resourceGroupName, name, resource).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create a IamVirtualMFADevice. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of IamVirtualMFADevice. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrReplaceAsync(String resourceGroupName, String name, + IamVirtualMfaDeviceInner resource, Context context) { + return beginCreateOrReplaceAsync(resourceGroupName, name, resource, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create a IamVirtualMFADevice. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of IamVirtualMFADevice. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public IamVirtualMfaDeviceInner createOrReplace(String resourceGroupName, String name, + IamVirtualMfaDeviceInner resource) { + return createOrReplaceAsync(resourceGroupName, name, resource).block(); + } + + /** + * Create a IamVirtualMFADevice. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of IamVirtualMFADevice. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public IamVirtualMfaDeviceInner createOrReplace(String resourceGroupName, String name, + IamVirtualMfaDeviceInner resource, Context context) { + return createOrReplaceAsync(resourceGroupName, name, resource, context).block(); + } + + /** + * Update a IamVirtualMFADevice. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of IamVirtualMFADevice. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync(String resourceGroupName, String name, + IamVirtualMfaDeviceTagsUpdate properties) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (properties == null) { + return Mono.error(new IllegalArgumentException("Parameter properties is required and cannot be null.")); + } else { + properties.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.update(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, properties, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Update a IamVirtualMFADevice. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of IamVirtualMFADevice. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync(String resourceGroupName, String name, + IamVirtualMfaDeviceTagsUpdate properties, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (properties == null) { + return Mono.error(new IllegalArgumentException("Parameter properties is required and cannot be null.")); + } else { + properties.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.update(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, name, properties, accept, context); + } + + /** + * Update a IamVirtualMFADevice. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of IamVirtualMFADevice. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, IamVirtualMfaDeviceInner> + beginUpdateAsync(String resourceGroupName, String name, IamVirtualMfaDeviceTagsUpdate properties) { + Mono>> mono = updateWithResponseAsync(resourceGroupName, name, properties); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), IamVirtualMfaDeviceInner.class, IamVirtualMfaDeviceInner.class, + this.client.getContext()); + } + + /** + * Update a IamVirtualMFADevice. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of IamVirtualMFADevice. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, IamVirtualMfaDeviceInner> beginUpdateAsync( + String resourceGroupName, String name, IamVirtualMfaDeviceTagsUpdate properties, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = updateWithResponseAsync(resourceGroupName, name, properties, context); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), IamVirtualMfaDeviceInner.class, IamVirtualMfaDeviceInner.class, context); + } + + /** + * Update a IamVirtualMFADevice. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of IamVirtualMFADevice. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, IamVirtualMfaDeviceInner> + beginUpdate(String resourceGroupName, String name, IamVirtualMfaDeviceTagsUpdate properties) { + return this.beginUpdateAsync(resourceGroupName, name, properties).getSyncPoller(); + } + + /** + * Update a IamVirtualMFADevice. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of IamVirtualMFADevice. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, IamVirtualMfaDeviceInner> + beginUpdate(String resourceGroupName, String name, IamVirtualMfaDeviceTagsUpdate properties, Context context) { + return this.beginUpdateAsync(resourceGroupName, name, properties, context).getSyncPoller(); + } + + /** + * Update a IamVirtualMFADevice. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of IamVirtualMFADevice. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync(String resourceGroupName, String name, + IamVirtualMfaDeviceTagsUpdate properties) { + return beginUpdateAsync(resourceGroupName, name, properties).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Update a IamVirtualMFADevice. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of IamVirtualMFADevice. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync(String resourceGroupName, String name, + IamVirtualMfaDeviceTagsUpdate properties, Context context) { + return beginUpdateAsync(resourceGroupName, name, properties, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Update a IamVirtualMFADevice. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of IamVirtualMFADevice. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public IamVirtualMfaDeviceInner update(String resourceGroupName, String name, + IamVirtualMfaDeviceTagsUpdate properties) { + return updateAsync(resourceGroupName, name, properties).block(); + } + + /** + * Update a IamVirtualMFADevice. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of IamVirtualMFADevice. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public IamVirtualMfaDeviceInner update(String resourceGroupName, String name, + IamVirtualMfaDeviceTagsUpdate properties, Context context) { + return updateAsync(resourceGroupName, name, properties, context).block(); + } + + /** + * Delete a IamVirtualMFADevice. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of IamVirtualMFADevice. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync(String resourceGroupName, String name) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Delete a IamVirtualMFADevice. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of IamVirtualMFADevice. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync(String resourceGroupName, String name, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.delete(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, name, accept, context); + } + + /** + * Delete a IamVirtualMFADevice. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of IamVirtualMFADevice. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String name) { + Mono>> mono = deleteWithResponseAsync(resourceGroupName, name); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); + } + + /** + * Delete a IamVirtualMFADevice. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of IamVirtualMFADevice. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String name, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = deleteWithResponseAsync(resourceGroupName, name, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + context); + } + + /** + * Delete a IamVirtualMFADevice. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of IamVirtualMFADevice. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String name) { + return this.beginDeleteAsync(resourceGroupName, name).getSyncPoller(); + } + + /** + * Delete a IamVirtualMFADevice. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of IamVirtualMFADevice. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String name, Context context) { + return this.beginDeleteAsync(resourceGroupName, name, context).getSyncPoller(); + } + + /** + * Delete a IamVirtualMFADevice. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of IamVirtualMFADevice. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String name) { + return beginDeleteAsync(resourceGroupName, name).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete a IamVirtualMFADevice. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of IamVirtualMFADevice. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String name, Context context) { + return beginDeleteAsync(resourceGroupName, name, context).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete a IamVirtualMFADevice. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of IamVirtualMFADevice. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String name) { + deleteAsync(resourceGroupName, name).block(); + } + + /** + * Delete a IamVirtualMFADevice. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of IamVirtualMFADevice. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String name, Context context) { + deleteAsync(resourceGroupName, name, context).block(); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a IamVirtualMFADevice list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listBySubscriptionNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a IamVirtualMFADevice list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listBySubscriptionNextSinglePageAsync(String nextLink, + Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a IamVirtualMFADevice list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a IamVirtualMFADevice list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupNextSinglePageAsync(String nextLink, + Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/IamVirtualMfaDevicesImpl.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/IamVirtualMfaDevicesImpl.java new file mode 100644 index 000000000000..e36bb10c3564 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/IamVirtualMfaDevicesImpl.java @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.awsconnector.fluent.IamVirtualMfaDevicesClient; +import com.azure.resourcemanager.awsconnector.fluent.models.IamVirtualMfaDeviceInner; +import com.azure.resourcemanager.awsconnector.models.IamVirtualMfaDevice; +import com.azure.resourcemanager.awsconnector.models.IamVirtualMfaDevices; + +public final class IamVirtualMfaDevicesImpl implements IamVirtualMfaDevices { + private static final ClientLogger LOGGER = new ClientLogger(IamVirtualMfaDevicesImpl.class); + + private final IamVirtualMfaDevicesClient innerClient; + + private final com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager; + + public IamVirtualMfaDevicesImpl(IamVirtualMfaDevicesClient innerClient, + com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return ResourceManagerUtils.mapPage(inner, inner1 -> new IamVirtualMfaDeviceImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new IamVirtualMfaDeviceImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName); + return ResourceManagerUtils.mapPage(inner, inner1 -> new IamVirtualMfaDeviceImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + PagedIterable inner + = this.serviceClient().listByResourceGroup(resourceGroupName, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new IamVirtualMfaDeviceImpl(inner1, this.manager())); + } + + public Response getByResourceGroupWithResponse(String resourceGroupName, String name, + Context context) { + Response inner + = this.serviceClient().getByResourceGroupWithResponse(resourceGroupName, name, context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new IamVirtualMfaDeviceImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public IamVirtualMfaDevice getByResourceGroup(String resourceGroupName, String name) { + IamVirtualMfaDeviceInner inner = this.serviceClient().getByResourceGroup(resourceGroupName, name); + if (inner != null) { + return new IamVirtualMfaDeviceImpl(inner, this.manager()); + } else { + return null; + } + } + + public void deleteByResourceGroup(String resourceGroupName, String name) { + this.serviceClient().delete(resourceGroupName, name); + } + + public void delete(String resourceGroupName, String name, Context context) { + this.serviceClient().delete(resourceGroupName, name, context); + } + + public IamVirtualMfaDevice getById(String id) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String name = ResourceManagerUtils.getValueFromIdByName(id, "iamVirtualMFADevices"); + if (name == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'iamVirtualMFADevices'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, name, Context.NONE).getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String name = ResourceManagerUtils.getValueFromIdByName(id, "iamVirtualMFADevices"); + if (name == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'iamVirtualMFADevices'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, name, context); + } + + public void deleteById(String id) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String name = ResourceManagerUtils.getValueFromIdByName(id, "iamVirtualMFADevices"); + if (name == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'iamVirtualMFADevices'.", id))); + } + this.delete(resourceGroupName, name, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String name = ResourceManagerUtils.getValueFromIdByName(id, "iamVirtualMFADevices"); + if (name == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'iamVirtualMFADevices'.", id))); + } + this.delete(resourceGroupName, name, context); + } + + private IamVirtualMfaDevicesClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.awsconnector.AwsconnectorManager manager() { + return this.serviceManager; + } + + public IamVirtualMfaDeviceImpl define(String name) { + return new IamVirtualMfaDeviceImpl(name, this.manager()); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/KmsAliasImpl.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/KmsAliasImpl.java new file mode 100644 index 000000000000..8ee08204ab0b --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/KmsAliasImpl.java @@ -0,0 +1,175 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.implementation; + +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.awsconnector.fluent.models.KmsAliasInner; +import com.azure.resourcemanager.awsconnector.models.KmsAlias; +import com.azure.resourcemanager.awsconnector.models.KmsAliasProperties; +import com.azure.resourcemanager.awsconnector.models.KmsAliasTagsUpdate; +import java.util.Collections; +import java.util.Map; + +public final class KmsAliasImpl implements KmsAlias, KmsAlias.Definition, KmsAlias.Update { + private KmsAliasInner innerObject; + + private final com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public String location() { + return this.innerModel().location(); + } + + public Map tags() { + Map inner = this.innerModel().tags(); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } + } + + public KmsAliasProperties properties() { + return this.innerModel().properties(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public String resourceGroupName() { + return resourceGroupName; + } + + public KmsAliasInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.awsconnector.AwsconnectorManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String name; + + private KmsAliasTagsUpdate updateProperties; + + public KmsAliasImpl withExistingResourceGroup(String resourceGroupName) { + this.resourceGroupName = resourceGroupName; + return this; + } + + public KmsAlias create() { + this.innerObject = serviceManager.serviceClient() + .getKmsAliases() + .createOrReplace(resourceGroupName, name, this.innerModel(), Context.NONE); + return this; + } + + public KmsAlias create(Context context) { + this.innerObject = serviceManager.serviceClient() + .getKmsAliases() + .createOrReplace(resourceGroupName, name, this.innerModel(), context); + return this; + } + + KmsAliasImpl(String name, com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager) { + this.innerObject = new KmsAliasInner(); + this.serviceManager = serviceManager; + this.name = name; + } + + public KmsAliasImpl update() { + this.updateProperties = new KmsAliasTagsUpdate(); + return this; + } + + public KmsAlias apply() { + this.innerObject = serviceManager.serviceClient() + .getKmsAliases() + .update(resourceGroupName, name, updateProperties, Context.NONE); + return this; + } + + public KmsAlias apply(Context context) { + this.innerObject + = serviceManager.serviceClient().getKmsAliases().update(resourceGroupName, name, updateProperties, context); + return this; + } + + KmsAliasImpl(KmsAliasInner innerObject, com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.name = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "kmsAliases"); + } + + public KmsAlias refresh() { + this.innerObject = serviceManager.serviceClient() + .getKmsAliases() + .getByResourceGroupWithResponse(resourceGroupName, name, Context.NONE) + .getValue(); + return this; + } + + public KmsAlias refresh(Context context) { + this.innerObject = serviceManager.serviceClient() + .getKmsAliases() + .getByResourceGroupWithResponse(resourceGroupName, name, context) + .getValue(); + return this; + } + + public KmsAliasImpl withRegion(Region location) { + this.innerModel().withLocation(location.toString()); + return this; + } + + public KmsAliasImpl withRegion(String location) { + this.innerModel().withLocation(location); + return this; + } + + public KmsAliasImpl withTags(Map tags) { + if (isInCreateMode()) { + this.innerModel().withTags(tags); + return this; + } else { + this.updateProperties.withTags(tags); + return this; + } + } + + public KmsAliasImpl withProperties(KmsAliasProperties properties) { + this.innerModel().withProperties(properties); + return this; + } + + private boolean isInCreateMode() { + return this.innerModel().id() == null; + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/KmsAliasesClientImpl.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/KmsAliasesClientImpl.java new file mode 100644 index 000000000000..e15f1c66a9cf --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/KmsAliasesClientImpl.java @@ -0,0 +1,1273 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.Patch; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.awsconnector.fluent.KmsAliasesClient; +import com.azure.resourcemanager.awsconnector.fluent.models.KmsAliasInner; +import com.azure.resourcemanager.awsconnector.models.KmsAliasListResult; +import com.azure.resourcemanager.awsconnector.models.KmsAliasTagsUpdate; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in KmsAliasesClient. + */ +public final class KmsAliasesClientImpl implements KmsAliasesClient { + /** + * The proxy service used to perform REST calls. + */ + private final KmsAliasesService service; + + /** + * The service client containing this operation class. + */ + private final MicrosoftAwsConnectorImpl client; + + /** + * Initializes an instance of KmsAliasesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + KmsAliasesClientImpl(MicrosoftAwsConnectorImpl client) { + this.service + = RestProxy.create(KmsAliasesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for MicrosoftAwsConnectorKmsAliases to be used by the proxy service to + * perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "MicrosoftAwsConnecto") + public interface KmsAliasesService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.AwsConnector/kmsAliases") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/kmsAliases") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroup(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/kmsAliases/{name}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getByResourceGroup(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("name") String name, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/kmsAliases/{name}") + @ExpectedResponses({ 200, 201 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrReplace(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("name") String name, + @BodyParam("application/json") KmsAliasInner resource, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/kmsAliases/{name}") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> update(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("name") String name, + @BodyParam("application/json") KmsAliasTagsUpdate properties, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/kmsAliases/{name}") + @ExpectedResponses({ 202, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("name") String name, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listBySubscriptionNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroupNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); + } + + /** + * List KmsAlias resources by subscription ID. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a KmsAlias list operation along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync() { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), + res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List KmsAlias resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a KmsAlias list operation along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), accept, + context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * List KmsAlias resources by subscription ID. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a KmsAlias list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>(() -> listSinglePageAsync(), + nextLink -> listBySubscriptionNextSinglePageAsync(nextLink)); + } + + /** + * List KmsAlias resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a KmsAlias list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(Context context) { + return new PagedFlux<>(() -> listSinglePageAsync(context), + nextLink -> listBySubscriptionNextSinglePageAsync(nextLink, context)); + } + + /** + * List KmsAlias resources by subscription ID. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a KmsAlias list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + return new PagedIterable<>(listAsync()); + } + + /** + * List KmsAlias resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a KmsAlias list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Context context) { + return new PagedIterable<>(listAsync(context)); + } + + /** + * List KmsAlias resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a KmsAlias list operation along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), + res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List KmsAlias resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a KmsAlias list operation along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * List KmsAlias resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a KmsAlias list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName) { + return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); + } + + /** + * List KmsAlias resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a KmsAlias list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName, Context context) { + return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName, context), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink, context)); + } + + /** + * List KmsAlias resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a KmsAlias list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName)); + } + + /** + * List KmsAlias resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a KmsAlias list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, context)); + } + + /** + * Get a KmsAlias. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of KmsAlias. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a KmsAlias along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync(String resourceGroupName, String name) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.getByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get a KmsAlias. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of KmsAlias. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a KmsAlias along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync(String resourceGroupName, String name, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.getByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, accept, context); + } + + /** + * Get a KmsAlias. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of KmsAlias. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a KmsAlias on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getByResourceGroupAsync(String resourceGroupName, String name) { + return getByResourceGroupWithResponseAsync(resourceGroupName, name) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Get a KmsAlias. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of KmsAlias. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a KmsAlias along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getByResourceGroupWithResponse(String resourceGroupName, String name, + Context context) { + return getByResourceGroupWithResponseAsync(resourceGroupName, name, context).block(); + } + + /** + * Get a KmsAlias. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of KmsAlias. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a KmsAlias. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public KmsAliasInner getByResourceGroup(String resourceGroupName, String name) { + return getByResourceGroupWithResponse(resourceGroupName, name, Context.NONE).getValue(); + } + + /** + * Create a KmsAlias. Please note that end user resource creation is currently restricted, but it will be enabled in + * the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of KmsAlias. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrReplaceWithResponseAsync(String resourceGroupName, String name, + KmsAliasInner resource) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (resource == null) { + return Mono.error(new IllegalArgumentException("Parameter resource is required and cannot be null.")); + } else { + resource.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.createOrReplace(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, resource, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Create a KmsAlias. Please note that end user resource creation is currently restricted, but it will be enabled in + * the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of KmsAlias. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrReplaceWithResponseAsync(String resourceGroupName, String name, + KmsAliasInner resource, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (resource == null) { + return Mono.error(new IllegalArgumentException("Parameter resource is required and cannot be null.")); + } else { + resource.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.createOrReplace(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, resource, accept, context); + } + + /** + * Create a KmsAlias. Please note that end user resource creation is currently restricted, but it will be enabled in + * the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of KmsAlias. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, KmsAliasInner> beginCreateOrReplaceAsync(String resourceGroupName, + String name, KmsAliasInner resource) { + Mono>> mono = createOrReplaceWithResponseAsync(resourceGroupName, name, resource); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + KmsAliasInner.class, KmsAliasInner.class, this.client.getContext()); + } + + /** + * Create a KmsAlias. Please note that end user resource creation is currently restricted, but it will be enabled in + * the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of KmsAlias. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, KmsAliasInner> beginCreateOrReplaceAsync(String resourceGroupName, + String name, KmsAliasInner resource, Context context) { + context = this.client.mergeContext(context); + Mono>> mono + = createOrReplaceWithResponseAsync(resourceGroupName, name, resource, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + KmsAliasInner.class, KmsAliasInner.class, context); + } + + /** + * Create a KmsAlias. Please note that end user resource creation is currently restricted, but it will be enabled in + * the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of KmsAlias. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, KmsAliasInner> beginCreateOrReplace(String resourceGroupName, + String name, KmsAliasInner resource) { + return this.beginCreateOrReplaceAsync(resourceGroupName, name, resource).getSyncPoller(); + } + + /** + * Create a KmsAlias. Please note that end user resource creation is currently restricted, but it will be enabled in + * the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of KmsAlias. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, KmsAliasInner> beginCreateOrReplace(String resourceGroupName, + String name, KmsAliasInner resource, Context context) { + return this.beginCreateOrReplaceAsync(resourceGroupName, name, resource, context).getSyncPoller(); + } + + /** + * Create a KmsAlias. Please note that end user resource creation is currently restricted, but it will be enabled in + * the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of KmsAlias. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrReplaceAsync(String resourceGroupName, String name, KmsAliasInner resource) { + return beginCreateOrReplaceAsync(resourceGroupName, name, resource).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create a KmsAlias. Please note that end user resource creation is currently restricted, but it will be enabled in + * the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of KmsAlias. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrReplaceAsync(String resourceGroupName, String name, KmsAliasInner resource, + Context context) { + return beginCreateOrReplaceAsync(resourceGroupName, name, resource, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create a KmsAlias. Please note that end user resource creation is currently restricted, but it will be enabled in + * the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of KmsAlias. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public KmsAliasInner createOrReplace(String resourceGroupName, String name, KmsAliasInner resource) { + return createOrReplaceAsync(resourceGroupName, name, resource).block(); + } + + /** + * Create a KmsAlias. Please note that end user resource creation is currently restricted, but it will be enabled in + * the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of KmsAlias. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public KmsAliasInner createOrReplace(String resourceGroupName, String name, KmsAliasInner resource, + Context context) { + return createOrReplaceAsync(resourceGroupName, name, resource, context).block(); + } + + /** + * Update a KmsAlias. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of KmsAlias. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync(String resourceGroupName, String name, + KmsAliasTagsUpdate properties) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (properties == null) { + return Mono.error(new IllegalArgumentException("Parameter properties is required and cannot be null.")); + } else { + properties.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.update(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, properties, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Update a KmsAlias. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of KmsAlias. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync(String resourceGroupName, String name, + KmsAliasTagsUpdate properties, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (properties == null) { + return Mono.error(new IllegalArgumentException("Parameter properties is required and cannot be null.")); + } else { + properties.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.update(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, name, properties, accept, context); + } + + /** + * Update a KmsAlias. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of KmsAlias. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, KmsAliasInner> beginUpdateAsync(String resourceGroupName, String name, + KmsAliasTagsUpdate properties) { + Mono>> mono = updateWithResponseAsync(resourceGroupName, name, properties); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + KmsAliasInner.class, KmsAliasInner.class, this.client.getContext()); + } + + /** + * Update a KmsAlias. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of KmsAlias. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, KmsAliasInner> beginUpdateAsync(String resourceGroupName, String name, + KmsAliasTagsUpdate properties, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = updateWithResponseAsync(resourceGroupName, name, properties, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + KmsAliasInner.class, KmsAliasInner.class, context); + } + + /** + * Update a KmsAlias. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of KmsAlias. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, KmsAliasInner> beginUpdate(String resourceGroupName, String name, + KmsAliasTagsUpdate properties) { + return this.beginUpdateAsync(resourceGroupName, name, properties).getSyncPoller(); + } + + /** + * Update a KmsAlias. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of KmsAlias. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, KmsAliasInner> beginUpdate(String resourceGroupName, String name, + KmsAliasTagsUpdate properties, Context context) { + return this.beginUpdateAsync(resourceGroupName, name, properties, context).getSyncPoller(); + } + + /** + * Update a KmsAlias. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of KmsAlias. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync(String resourceGroupName, String name, KmsAliasTagsUpdate properties) { + return beginUpdateAsync(resourceGroupName, name, properties).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Update a KmsAlias. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of KmsAlias. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync(String resourceGroupName, String name, KmsAliasTagsUpdate properties, + Context context) { + return beginUpdateAsync(resourceGroupName, name, properties, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Update a KmsAlias. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of KmsAlias. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public KmsAliasInner update(String resourceGroupName, String name, KmsAliasTagsUpdate properties) { + return updateAsync(resourceGroupName, name, properties).block(); + } + + /** + * Update a KmsAlias. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of KmsAlias. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public KmsAliasInner update(String resourceGroupName, String name, KmsAliasTagsUpdate properties, Context context) { + return updateAsync(resourceGroupName, name, properties, context).block(); + } + + /** + * Delete a KmsAlias. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of KmsAlias. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync(String resourceGroupName, String name) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Delete a KmsAlias. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of KmsAlias. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync(String resourceGroupName, String name, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.delete(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, name, accept, context); + } + + /** + * Delete a KmsAlias. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of KmsAlias. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String name) { + Mono>> mono = deleteWithResponseAsync(resourceGroupName, name); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); + } + + /** + * Delete a KmsAlias. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of KmsAlias. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String name, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = deleteWithResponseAsync(resourceGroupName, name, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + context); + } + + /** + * Delete a KmsAlias. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of KmsAlias. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String name) { + return this.beginDeleteAsync(resourceGroupName, name).getSyncPoller(); + } + + /** + * Delete a KmsAlias. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of KmsAlias. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String name, Context context) { + return this.beginDeleteAsync(resourceGroupName, name, context).getSyncPoller(); + } + + /** + * Delete a KmsAlias. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of KmsAlias. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String name) { + return beginDeleteAsync(resourceGroupName, name).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete a KmsAlias. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of KmsAlias. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String name, Context context) { + return beginDeleteAsync(resourceGroupName, name, context).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete a KmsAlias. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of KmsAlias. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String name) { + deleteAsync(resourceGroupName, name).block(); + } + + /** + * Delete a KmsAlias. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of KmsAlias. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String name, Context context) { + deleteAsync(resourceGroupName, name, context).block(); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a KmsAlias list operation along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listBySubscriptionNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), + res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a KmsAlias list operation along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listBySubscriptionNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a KmsAlias list operation along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), + res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a KmsAlias list operation along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupNextSinglePageAsync(String nextLink, + Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/KmsAliasesImpl.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/KmsAliasesImpl.java new file mode 100644 index 000000000000..3a2e4bacb3cf --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/KmsAliasesImpl.java @@ -0,0 +1,145 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.awsconnector.fluent.KmsAliasesClient; +import com.azure.resourcemanager.awsconnector.fluent.models.KmsAliasInner; +import com.azure.resourcemanager.awsconnector.models.KmsAlias; +import com.azure.resourcemanager.awsconnector.models.KmsAliases; + +public final class KmsAliasesImpl implements KmsAliases { + private static final ClientLogger LOGGER = new ClientLogger(KmsAliasesImpl.class); + + private final KmsAliasesClient innerClient; + + private final com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager; + + public KmsAliasesImpl(KmsAliasesClient innerClient, + com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return ResourceManagerUtils.mapPage(inner, inner1 -> new KmsAliasImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new KmsAliasImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName); + return ResourceManagerUtils.mapPage(inner, inner1 -> new KmsAliasImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new KmsAliasImpl(inner1, this.manager())); + } + + public Response getByResourceGroupWithResponse(String resourceGroupName, String name, Context context) { + Response inner + = this.serviceClient().getByResourceGroupWithResponse(resourceGroupName, name, context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new KmsAliasImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public KmsAlias getByResourceGroup(String resourceGroupName, String name) { + KmsAliasInner inner = this.serviceClient().getByResourceGroup(resourceGroupName, name); + if (inner != null) { + return new KmsAliasImpl(inner, this.manager()); + } else { + return null; + } + } + + public void deleteByResourceGroup(String resourceGroupName, String name) { + this.serviceClient().delete(resourceGroupName, name); + } + + public void delete(String resourceGroupName, String name, Context context) { + this.serviceClient().delete(resourceGroupName, name, context); + } + + public KmsAlias getById(String id) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String name = ResourceManagerUtils.getValueFromIdByName(id, "kmsAliases"); + if (name == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'kmsAliases'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, name, Context.NONE).getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String name = ResourceManagerUtils.getValueFromIdByName(id, "kmsAliases"); + if (name == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'kmsAliases'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, name, context); + } + + public void deleteById(String id) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String name = ResourceManagerUtils.getValueFromIdByName(id, "kmsAliases"); + if (name == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'kmsAliases'.", id))); + } + this.delete(resourceGroupName, name, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String name = ResourceManagerUtils.getValueFromIdByName(id, "kmsAliases"); + if (name == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'kmsAliases'.", id))); + } + this.delete(resourceGroupName, name, context); + } + + private KmsAliasesClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.awsconnector.AwsconnectorManager manager() { + return this.serviceManager; + } + + public KmsAliasImpl define(String name) { + return new KmsAliasImpl(name, this.manager()); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/KmsKeyImpl.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/KmsKeyImpl.java new file mode 100644 index 000000000000..3bacb1fbf14c --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/KmsKeyImpl.java @@ -0,0 +1,175 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.implementation; + +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.awsconnector.fluent.models.KmsKeyInner; +import com.azure.resourcemanager.awsconnector.models.KmsKey; +import com.azure.resourcemanager.awsconnector.models.KmsKeyProperties; +import com.azure.resourcemanager.awsconnector.models.KmsKeyTagsUpdate; +import java.util.Collections; +import java.util.Map; + +public final class KmsKeyImpl implements KmsKey, KmsKey.Definition, KmsKey.Update { + private KmsKeyInner innerObject; + + private final com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public String location() { + return this.innerModel().location(); + } + + public Map tags() { + Map inner = this.innerModel().tags(); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } + } + + public KmsKeyProperties properties() { + return this.innerModel().properties(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public String resourceGroupName() { + return resourceGroupName; + } + + public KmsKeyInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.awsconnector.AwsconnectorManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String name; + + private KmsKeyTagsUpdate updateProperties; + + public KmsKeyImpl withExistingResourceGroup(String resourceGroupName) { + this.resourceGroupName = resourceGroupName; + return this; + } + + public KmsKey create() { + this.innerObject = serviceManager.serviceClient() + .getKmsKeys() + .createOrReplace(resourceGroupName, name, this.innerModel(), Context.NONE); + return this; + } + + public KmsKey create(Context context) { + this.innerObject = serviceManager.serviceClient() + .getKmsKeys() + .createOrReplace(resourceGroupName, name, this.innerModel(), context); + return this; + } + + KmsKeyImpl(String name, com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager) { + this.innerObject = new KmsKeyInner(); + this.serviceManager = serviceManager; + this.name = name; + } + + public KmsKeyImpl update() { + this.updateProperties = new KmsKeyTagsUpdate(); + return this; + } + + public KmsKey apply() { + this.innerObject = serviceManager.serviceClient() + .getKmsKeys() + .update(resourceGroupName, name, updateProperties, Context.NONE); + return this; + } + + public KmsKey apply(Context context) { + this.innerObject + = serviceManager.serviceClient().getKmsKeys().update(resourceGroupName, name, updateProperties, context); + return this; + } + + KmsKeyImpl(KmsKeyInner innerObject, com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.name = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "kmsKeys"); + } + + public KmsKey refresh() { + this.innerObject = serviceManager.serviceClient() + .getKmsKeys() + .getByResourceGroupWithResponse(resourceGroupName, name, Context.NONE) + .getValue(); + return this; + } + + public KmsKey refresh(Context context) { + this.innerObject = serviceManager.serviceClient() + .getKmsKeys() + .getByResourceGroupWithResponse(resourceGroupName, name, context) + .getValue(); + return this; + } + + public KmsKeyImpl withRegion(Region location) { + this.innerModel().withLocation(location.toString()); + return this; + } + + public KmsKeyImpl withRegion(String location) { + this.innerModel().withLocation(location); + return this; + } + + public KmsKeyImpl withTags(Map tags) { + if (isInCreateMode()) { + this.innerModel().withTags(tags); + return this; + } else { + this.updateProperties.withTags(tags); + return this; + } + } + + public KmsKeyImpl withProperties(KmsKeyProperties properties) { + this.innerModel().withProperties(properties); + return this; + } + + private boolean isInCreateMode() { + return this.innerModel().id() == null; + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/KmsKeysClientImpl.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/KmsKeysClientImpl.java new file mode 100644 index 000000000000..4f3017a67c7a --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/KmsKeysClientImpl.java @@ -0,0 +1,1269 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.Patch; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.awsconnector.fluent.KmsKeysClient; +import com.azure.resourcemanager.awsconnector.fluent.models.KmsKeyInner; +import com.azure.resourcemanager.awsconnector.models.KmsKeyListResult; +import com.azure.resourcemanager.awsconnector.models.KmsKeyTagsUpdate; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in KmsKeysClient. + */ +public final class KmsKeysClientImpl implements KmsKeysClient { + /** + * The proxy service used to perform REST calls. + */ + private final KmsKeysService service; + + /** + * The service client containing this operation class. + */ + private final MicrosoftAwsConnectorImpl client; + + /** + * Initializes an instance of KmsKeysClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + KmsKeysClientImpl(MicrosoftAwsConnectorImpl client) { + this.service = RestProxy.create(KmsKeysService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for MicrosoftAwsConnectorKmsKeys to be used by the proxy service to + * perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "MicrosoftAwsConnecto") + public interface KmsKeysService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.AwsConnector/kmsKeys") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/kmsKeys") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroup(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/kmsKeys/{name}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getByResourceGroup(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("name") String name, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/kmsKeys/{name}") + @ExpectedResponses({ 200, 201 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrReplace(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("name") String name, + @BodyParam("application/json") KmsKeyInner resource, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/kmsKeys/{name}") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> update(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("name") String name, + @BodyParam("application/json") KmsKeyTagsUpdate properties, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/kmsKeys/{name}") + @ExpectedResponses({ 202, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("name") String name, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listBySubscriptionNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroupNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); + } + + /** + * List KmsKey resources by subscription ID. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a KmsKey list operation along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync() { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), + res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List KmsKey resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a KmsKey list operation along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), accept, + context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * List KmsKey resources by subscription ID. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a KmsKey list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>(() -> listSinglePageAsync(), + nextLink -> listBySubscriptionNextSinglePageAsync(nextLink)); + } + + /** + * List KmsKey resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a KmsKey list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(Context context) { + return new PagedFlux<>(() -> listSinglePageAsync(context), + nextLink -> listBySubscriptionNextSinglePageAsync(nextLink, context)); + } + + /** + * List KmsKey resources by subscription ID. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a KmsKey list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + return new PagedIterable<>(listAsync()); + } + + /** + * List KmsKey resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a KmsKey list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Context context) { + return new PagedIterable<>(listAsync(context)); + } + + /** + * List KmsKey resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a KmsKey list operation along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), + res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List KmsKey resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a KmsKey list operation along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * List KmsKey resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a KmsKey list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName) { + return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); + } + + /** + * List KmsKey resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a KmsKey list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName, Context context) { + return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName, context), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink, context)); + } + + /** + * List KmsKey resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a KmsKey list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName)); + } + + /** + * List KmsKey resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a KmsKey list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, context)); + } + + /** + * Get a KmsKey. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of KmsKey. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a KmsKey along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync(String resourceGroupName, String name) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.getByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get a KmsKey. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of KmsKey. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a KmsKey along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync(String resourceGroupName, String name, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.getByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, accept, context); + } + + /** + * Get a KmsKey. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of KmsKey. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a KmsKey on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getByResourceGroupAsync(String resourceGroupName, String name) { + return getByResourceGroupWithResponseAsync(resourceGroupName, name) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Get a KmsKey. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of KmsKey. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a KmsKey along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getByResourceGroupWithResponse(String resourceGroupName, String name, + Context context) { + return getByResourceGroupWithResponseAsync(resourceGroupName, name, context).block(); + } + + /** + * Get a KmsKey. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of KmsKey. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a KmsKey. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public KmsKeyInner getByResourceGroup(String resourceGroupName, String name) { + return getByResourceGroupWithResponse(resourceGroupName, name, Context.NONE).getValue(); + } + + /** + * Create a KmsKey. Please note that end user resource creation is currently restricted, but it will be enabled in + * the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of KmsKey. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrReplaceWithResponseAsync(String resourceGroupName, String name, + KmsKeyInner resource) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (resource == null) { + return Mono.error(new IllegalArgumentException("Parameter resource is required and cannot be null.")); + } else { + resource.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.createOrReplace(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, resource, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Create a KmsKey. Please note that end user resource creation is currently restricted, but it will be enabled in + * the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of KmsKey. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrReplaceWithResponseAsync(String resourceGroupName, String name, + KmsKeyInner resource, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (resource == null) { + return Mono.error(new IllegalArgumentException("Parameter resource is required and cannot be null.")); + } else { + resource.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.createOrReplace(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, resource, accept, context); + } + + /** + * Create a KmsKey. Please note that end user resource creation is currently restricted, but it will be enabled in + * the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of KmsKey. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, KmsKeyInner> beginCreateOrReplaceAsync(String resourceGroupName, + String name, KmsKeyInner resource) { + Mono>> mono = createOrReplaceWithResponseAsync(resourceGroupName, name, resource); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + KmsKeyInner.class, KmsKeyInner.class, this.client.getContext()); + } + + /** + * Create a KmsKey. Please note that end user resource creation is currently restricted, but it will be enabled in + * the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of KmsKey. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, KmsKeyInner> beginCreateOrReplaceAsync(String resourceGroupName, + String name, KmsKeyInner resource, Context context) { + context = this.client.mergeContext(context); + Mono>> mono + = createOrReplaceWithResponseAsync(resourceGroupName, name, resource, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + KmsKeyInner.class, KmsKeyInner.class, context); + } + + /** + * Create a KmsKey. Please note that end user resource creation is currently restricted, but it will be enabled in + * the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of KmsKey. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, KmsKeyInner> beginCreateOrReplace(String resourceGroupName, String name, + KmsKeyInner resource) { + return this.beginCreateOrReplaceAsync(resourceGroupName, name, resource).getSyncPoller(); + } + + /** + * Create a KmsKey. Please note that end user resource creation is currently restricted, but it will be enabled in + * the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of KmsKey. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, KmsKeyInner> beginCreateOrReplace(String resourceGroupName, String name, + KmsKeyInner resource, Context context) { + return this.beginCreateOrReplaceAsync(resourceGroupName, name, resource, context).getSyncPoller(); + } + + /** + * Create a KmsKey. Please note that end user resource creation is currently restricted, but it will be enabled in + * the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of KmsKey. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrReplaceAsync(String resourceGroupName, String name, KmsKeyInner resource) { + return beginCreateOrReplaceAsync(resourceGroupName, name, resource).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create a KmsKey. Please note that end user resource creation is currently restricted, but it will be enabled in + * the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of KmsKey. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrReplaceAsync(String resourceGroupName, String name, KmsKeyInner resource, + Context context) { + return beginCreateOrReplaceAsync(resourceGroupName, name, resource, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create a KmsKey. Please note that end user resource creation is currently restricted, but it will be enabled in + * the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of KmsKey. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public KmsKeyInner createOrReplace(String resourceGroupName, String name, KmsKeyInner resource) { + return createOrReplaceAsync(resourceGroupName, name, resource).block(); + } + + /** + * Create a KmsKey. Please note that end user resource creation is currently restricted, but it will be enabled in + * the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of KmsKey. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public KmsKeyInner createOrReplace(String resourceGroupName, String name, KmsKeyInner resource, Context context) { + return createOrReplaceAsync(resourceGroupName, name, resource, context).block(); + } + + /** + * Update a KmsKey. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of KmsKey. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync(String resourceGroupName, String name, + KmsKeyTagsUpdate properties) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (properties == null) { + return Mono.error(new IllegalArgumentException("Parameter properties is required and cannot be null.")); + } else { + properties.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.update(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, properties, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Update a KmsKey. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of KmsKey. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync(String resourceGroupName, String name, + KmsKeyTagsUpdate properties, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (properties == null) { + return Mono.error(new IllegalArgumentException("Parameter properties is required and cannot be null.")); + } else { + properties.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.update(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, name, properties, accept, context); + } + + /** + * Update a KmsKey. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of KmsKey. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, KmsKeyInner> beginUpdateAsync(String resourceGroupName, String name, + KmsKeyTagsUpdate properties) { + Mono>> mono = updateWithResponseAsync(resourceGroupName, name, properties); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + KmsKeyInner.class, KmsKeyInner.class, this.client.getContext()); + } + + /** + * Update a KmsKey. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of KmsKey. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, KmsKeyInner> beginUpdateAsync(String resourceGroupName, String name, + KmsKeyTagsUpdate properties, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = updateWithResponseAsync(resourceGroupName, name, properties, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + KmsKeyInner.class, KmsKeyInner.class, context); + } + + /** + * Update a KmsKey. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of KmsKey. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, KmsKeyInner> beginUpdate(String resourceGroupName, String name, + KmsKeyTagsUpdate properties) { + return this.beginUpdateAsync(resourceGroupName, name, properties).getSyncPoller(); + } + + /** + * Update a KmsKey. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of KmsKey. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, KmsKeyInner> beginUpdate(String resourceGroupName, String name, + KmsKeyTagsUpdate properties, Context context) { + return this.beginUpdateAsync(resourceGroupName, name, properties, context).getSyncPoller(); + } + + /** + * Update a KmsKey. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of KmsKey. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync(String resourceGroupName, String name, KmsKeyTagsUpdate properties) { + return beginUpdateAsync(resourceGroupName, name, properties).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Update a KmsKey. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of KmsKey. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync(String resourceGroupName, String name, KmsKeyTagsUpdate properties, + Context context) { + return beginUpdateAsync(resourceGroupName, name, properties, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Update a KmsKey. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of KmsKey. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public KmsKeyInner update(String resourceGroupName, String name, KmsKeyTagsUpdate properties) { + return updateAsync(resourceGroupName, name, properties).block(); + } + + /** + * Update a KmsKey. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of KmsKey. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public KmsKeyInner update(String resourceGroupName, String name, KmsKeyTagsUpdate properties, Context context) { + return updateAsync(resourceGroupName, name, properties, context).block(); + } + + /** + * Delete a KmsKey. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of KmsKey. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync(String resourceGroupName, String name) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Delete a KmsKey. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of KmsKey. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync(String resourceGroupName, String name, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.delete(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, name, accept, context); + } + + /** + * Delete a KmsKey. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of KmsKey. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String name) { + Mono>> mono = deleteWithResponseAsync(resourceGroupName, name); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); + } + + /** + * Delete a KmsKey. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of KmsKey. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String name, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = deleteWithResponseAsync(resourceGroupName, name, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + context); + } + + /** + * Delete a KmsKey. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of KmsKey. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String name) { + return this.beginDeleteAsync(resourceGroupName, name).getSyncPoller(); + } + + /** + * Delete a KmsKey. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of KmsKey. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String name, Context context) { + return this.beginDeleteAsync(resourceGroupName, name, context).getSyncPoller(); + } + + /** + * Delete a KmsKey. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of KmsKey. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String name) { + return beginDeleteAsync(resourceGroupName, name).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete a KmsKey. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of KmsKey. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String name, Context context) { + return beginDeleteAsync(resourceGroupName, name, context).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete a KmsKey. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of KmsKey. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String name) { + deleteAsync(resourceGroupName, name).block(); + } + + /** + * Delete a KmsKey. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of KmsKey. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String name, Context context) { + deleteAsync(resourceGroupName, name, context).block(); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a KmsKey list operation along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listBySubscriptionNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), + res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a KmsKey list operation along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listBySubscriptionNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a KmsKey list operation along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), + res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a KmsKey list operation along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/KmsKeysImpl.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/KmsKeysImpl.java new file mode 100644 index 000000000000..d95c4f20d238 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/KmsKeysImpl.java @@ -0,0 +1,145 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.awsconnector.fluent.KmsKeysClient; +import com.azure.resourcemanager.awsconnector.fluent.models.KmsKeyInner; +import com.azure.resourcemanager.awsconnector.models.KmsKey; +import com.azure.resourcemanager.awsconnector.models.KmsKeys; + +public final class KmsKeysImpl implements KmsKeys { + private static final ClientLogger LOGGER = new ClientLogger(KmsKeysImpl.class); + + private final KmsKeysClient innerClient; + + private final com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager; + + public KmsKeysImpl(KmsKeysClient innerClient, + com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return ResourceManagerUtils.mapPage(inner, inner1 -> new KmsKeyImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new KmsKeyImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName); + return ResourceManagerUtils.mapPage(inner, inner1 -> new KmsKeyImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new KmsKeyImpl(inner1, this.manager())); + } + + public Response getByResourceGroupWithResponse(String resourceGroupName, String name, Context context) { + Response inner + = this.serviceClient().getByResourceGroupWithResponse(resourceGroupName, name, context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new KmsKeyImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public KmsKey getByResourceGroup(String resourceGroupName, String name) { + KmsKeyInner inner = this.serviceClient().getByResourceGroup(resourceGroupName, name); + if (inner != null) { + return new KmsKeyImpl(inner, this.manager()); + } else { + return null; + } + } + + public void deleteByResourceGroup(String resourceGroupName, String name) { + this.serviceClient().delete(resourceGroupName, name); + } + + public void delete(String resourceGroupName, String name, Context context) { + this.serviceClient().delete(resourceGroupName, name, context); + } + + public KmsKey getById(String id) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String name = ResourceManagerUtils.getValueFromIdByName(id, "kmsKeys"); + if (name == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'kmsKeys'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, name, Context.NONE).getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String name = ResourceManagerUtils.getValueFromIdByName(id, "kmsKeys"); + if (name == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'kmsKeys'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, name, context); + } + + public void deleteById(String id) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String name = ResourceManagerUtils.getValueFromIdByName(id, "kmsKeys"); + if (name == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'kmsKeys'.", id))); + } + this.delete(resourceGroupName, name, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String name = ResourceManagerUtils.getValueFromIdByName(id, "kmsKeys"); + if (name == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'kmsKeys'.", id))); + } + this.delete(resourceGroupName, name, context); + } + + private KmsKeysClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.awsconnector.AwsconnectorManager manager() { + return this.serviceManager; + } + + public KmsKeyImpl define(String name) { + return new KmsKeyImpl(name, this.manager()); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/LambdaFunctionCodeLocationImpl.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/LambdaFunctionCodeLocationImpl.java new file mode 100644 index 000000000000..a2a37ab57751 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/LambdaFunctionCodeLocationImpl.java @@ -0,0 +1,179 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.implementation; + +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.awsconnector.fluent.models.LambdaFunctionCodeLocationInner; +import com.azure.resourcemanager.awsconnector.models.LambdaFunctionCodeLocation; +import com.azure.resourcemanager.awsconnector.models.LambdaFunctionCodeLocationProperties; +import com.azure.resourcemanager.awsconnector.models.LambdaFunctionCodeLocationTagsUpdate; +import java.util.Collections; +import java.util.Map; + +public final class LambdaFunctionCodeLocationImpl + implements LambdaFunctionCodeLocation, LambdaFunctionCodeLocation.Definition, LambdaFunctionCodeLocation.Update { + private LambdaFunctionCodeLocationInner innerObject; + + private final com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public String location() { + return this.innerModel().location(); + } + + public Map tags() { + Map inner = this.innerModel().tags(); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } + } + + public LambdaFunctionCodeLocationProperties properties() { + return this.innerModel().properties(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public String resourceGroupName() { + return resourceGroupName; + } + + public LambdaFunctionCodeLocationInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.awsconnector.AwsconnectorManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String name; + + private LambdaFunctionCodeLocationTagsUpdate updateProperties; + + public LambdaFunctionCodeLocationImpl withExistingResourceGroup(String resourceGroupName) { + this.resourceGroupName = resourceGroupName; + return this; + } + + public LambdaFunctionCodeLocation create() { + this.innerObject = serviceManager.serviceClient() + .getLambdaFunctionCodeLocations() + .createOrReplace(resourceGroupName, name, this.innerModel(), Context.NONE); + return this; + } + + public LambdaFunctionCodeLocation create(Context context) { + this.innerObject = serviceManager.serviceClient() + .getLambdaFunctionCodeLocations() + .createOrReplace(resourceGroupName, name, this.innerModel(), context); + return this; + } + + LambdaFunctionCodeLocationImpl(String name, + com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager) { + this.innerObject = new LambdaFunctionCodeLocationInner(); + this.serviceManager = serviceManager; + this.name = name; + } + + public LambdaFunctionCodeLocationImpl update() { + this.updateProperties = new LambdaFunctionCodeLocationTagsUpdate(); + return this; + } + + public LambdaFunctionCodeLocation apply() { + this.innerObject = serviceManager.serviceClient() + .getLambdaFunctionCodeLocations() + .update(resourceGroupName, name, updateProperties, Context.NONE); + return this; + } + + public LambdaFunctionCodeLocation apply(Context context) { + this.innerObject = serviceManager.serviceClient() + .getLambdaFunctionCodeLocations() + .update(resourceGroupName, name, updateProperties, context); + return this; + } + + LambdaFunctionCodeLocationImpl(LambdaFunctionCodeLocationInner innerObject, + com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.name = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "lambdaFunctionCodeLocations"); + } + + public LambdaFunctionCodeLocation refresh() { + this.innerObject = serviceManager.serviceClient() + .getLambdaFunctionCodeLocations() + .getByResourceGroupWithResponse(resourceGroupName, name, Context.NONE) + .getValue(); + return this; + } + + public LambdaFunctionCodeLocation refresh(Context context) { + this.innerObject = serviceManager.serviceClient() + .getLambdaFunctionCodeLocations() + .getByResourceGroupWithResponse(resourceGroupName, name, context) + .getValue(); + return this; + } + + public LambdaFunctionCodeLocationImpl withRegion(Region location) { + this.innerModel().withLocation(location.toString()); + return this; + } + + public LambdaFunctionCodeLocationImpl withRegion(String location) { + this.innerModel().withLocation(location); + return this; + } + + public LambdaFunctionCodeLocationImpl withTags(Map tags) { + if (isInCreateMode()) { + this.innerModel().withTags(tags); + return this; + } else { + this.updateProperties.withTags(tags); + return this; + } + } + + public LambdaFunctionCodeLocationImpl withProperties(LambdaFunctionCodeLocationProperties properties) { + this.innerModel().withProperties(properties); + return this; + } + + private boolean isInCreateMode() { + return this.innerModel().id() == null; + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/LambdaFunctionCodeLocationsClientImpl.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/LambdaFunctionCodeLocationsClientImpl.java new file mode 100644 index 000000000000..b5509c5ece66 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/LambdaFunctionCodeLocationsClientImpl.java @@ -0,0 +1,1295 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.Patch; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.awsconnector.fluent.LambdaFunctionCodeLocationsClient; +import com.azure.resourcemanager.awsconnector.fluent.models.LambdaFunctionCodeLocationInner; +import com.azure.resourcemanager.awsconnector.models.LambdaFunctionCodeLocationListResult; +import com.azure.resourcemanager.awsconnector.models.LambdaFunctionCodeLocationTagsUpdate; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in LambdaFunctionCodeLocationsClient. + */ +public final class LambdaFunctionCodeLocationsClientImpl implements LambdaFunctionCodeLocationsClient { + /** + * The proxy service used to perform REST calls. + */ + private final LambdaFunctionCodeLocationsService service; + + /** + * The service client containing this operation class. + */ + private final MicrosoftAwsConnectorImpl client; + + /** + * Initializes an instance of LambdaFunctionCodeLocationsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + LambdaFunctionCodeLocationsClientImpl(MicrosoftAwsConnectorImpl client) { + this.service = RestProxy.create(LambdaFunctionCodeLocationsService.class, client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for MicrosoftAwsConnectorLambdaFunctionCodeLocations to be used by the + * proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "MicrosoftAwsConnecto") + public interface LambdaFunctionCodeLocationsService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.AwsConnector/lambdaFunctionCodeLocations") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/lambdaFunctionCodeLocations") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroup(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/lambdaFunctionCodeLocations/{name}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getByResourceGroup(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("name") String name, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/lambdaFunctionCodeLocations/{name}") + @ExpectedResponses({ 200, 201 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrReplace(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("name") String name, + @BodyParam("application/json") LambdaFunctionCodeLocationInner resource, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/lambdaFunctionCodeLocations/{name}") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> update(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("name") String name, + @BodyParam("application/json") LambdaFunctionCodeLocationTagsUpdate properties, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/lambdaFunctionCodeLocations/{name}") + @ExpectedResponses({ 202, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("name") String name, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listBySubscriptionNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroupNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); + } + + /** + * List LambdaFunctionCodeLocation resources by subscription ID. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a LambdaFunctionCodeLocation list operation along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync() { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List LambdaFunctionCodeLocation resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a LambdaFunctionCodeLocation list operation along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), accept, + context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * List LambdaFunctionCodeLocation resources by subscription ID. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a LambdaFunctionCodeLocation list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>(() -> listSinglePageAsync(), + nextLink -> listBySubscriptionNextSinglePageAsync(nextLink)); + } + + /** + * List LambdaFunctionCodeLocation resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a LambdaFunctionCodeLocation list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(Context context) { + return new PagedFlux<>(() -> listSinglePageAsync(context), + nextLink -> listBySubscriptionNextSinglePageAsync(nextLink, context)); + } + + /** + * List LambdaFunctionCodeLocation resources by subscription ID. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a LambdaFunctionCodeLocation list operation as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + return new PagedIterable<>(listAsync()); + } + + /** + * List LambdaFunctionCodeLocation resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a LambdaFunctionCodeLocation list operation as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Context context) { + return new PagedIterable<>(listAsync(context)); + } + + /** + * List LambdaFunctionCodeLocation resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a LambdaFunctionCodeLocation list operation along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> + listByResourceGroupSinglePageAsync(String resourceGroupName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List LambdaFunctionCodeLocation resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a LambdaFunctionCodeLocation list operation along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> + listByResourceGroupSinglePageAsync(String resourceGroupName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * List LambdaFunctionCodeLocation resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a LambdaFunctionCodeLocation list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName) { + return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); + } + + /** + * List LambdaFunctionCodeLocation resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a LambdaFunctionCodeLocation list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName, + Context context) { + return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName, context), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink, context)); + } + + /** + * List LambdaFunctionCodeLocation resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a LambdaFunctionCodeLocation list operation as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName)); + } + + /** + * List LambdaFunctionCodeLocation resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a LambdaFunctionCodeLocation list operation as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName, + Context context) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, context)); + } + + /** + * Get a LambdaFunctionCodeLocation. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of LambdaFunctionCodeLocation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a LambdaFunctionCodeLocation along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> + getByResourceGroupWithResponseAsync(String resourceGroupName, String name) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.getByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get a LambdaFunctionCodeLocation. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of LambdaFunctionCodeLocation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a LambdaFunctionCodeLocation along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> + getByResourceGroupWithResponseAsync(String resourceGroupName, String name, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.getByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, accept, context); + } + + /** + * Get a LambdaFunctionCodeLocation. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of LambdaFunctionCodeLocation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a LambdaFunctionCodeLocation on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getByResourceGroupAsync(String resourceGroupName, String name) { + return getByResourceGroupWithResponseAsync(resourceGroupName, name) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Get a LambdaFunctionCodeLocation. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of LambdaFunctionCodeLocation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a LambdaFunctionCodeLocation along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getByResourceGroupWithResponse(String resourceGroupName, + String name, Context context) { + return getByResourceGroupWithResponseAsync(resourceGroupName, name, context).block(); + } + + /** + * Get a LambdaFunctionCodeLocation. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of LambdaFunctionCodeLocation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a LambdaFunctionCodeLocation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public LambdaFunctionCodeLocationInner getByResourceGroup(String resourceGroupName, String name) { + return getByResourceGroupWithResponse(resourceGroupName, name, Context.NONE).getValue(); + } + + /** + * Create a LambdaFunctionCodeLocation. Please note that end user resource creation is currently restricted, but it + * will be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of LambdaFunctionCodeLocation. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrReplaceWithResponseAsync(String resourceGroupName, String name, + LambdaFunctionCodeLocationInner resource) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (resource == null) { + return Mono.error(new IllegalArgumentException("Parameter resource is required and cannot be null.")); + } else { + resource.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.createOrReplace(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, resource, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Create a LambdaFunctionCodeLocation. Please note that end user resource creation is currently restricted, but it + * will be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of LambdaFunctionCodeLocation. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrReplaceWithResponseAsync(String resourceGroupName, String name, + LambdaFunctionCodeLocationInner resource, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (resource == null) { + return Mono.error(new IllegalArgumentException("Parameter resource is required and cannot be null.")); + } else { + resource.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.createOrReplace(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, resource, accept, context); + } + + /** + * Create a LambdaFunctionCodeLocation. Please note that end user resource creation is currently restricted, but it + * will be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of LambdaFunctionCodeLocation. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, LambdaFunctionCodeLocationInner> + beginCreateOrReplaceAsync(String resourceGroupName, String name, LambdaFunctionCodeLocationInner resource) { + Mono>> mono = createOrReplaceWithResponseAsync(resourceGroupName, name, resource); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), LambdaFunctionCodeLocationInner.class, LambdaFunctionCodeLocationInner.class, + this.client.getContext()); + } + + /** + * Create a LambdaFunctionCodeLocation. Please note that end user resource creation is currently restricted, but it + * will be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of LambdaFunctionCodeLocation. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, LambdaFunctionCodeLocationInner> + beginCreateOrReplaceAsync(String resourceGroupName, String name, LambdaFunctionCodeLocationInner resource, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono + = createOrReplaceWithResponseAsync(resourceGroupName, name, resource, context); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), LambdaFunctionCodeLocationInner.class, LambdaFunctionCodeLocationInner.class, + context); + } + + /** + * Create a LambdaFunctionCodeLocation. Please note that end user resource creation is currently restricted, but it + * will be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of LambdaFunctionCodeLocation. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, LambdaFunctionCodeLocationInner> + beginCreateOrReplace(String resourceGroupName, String name, LambdaFunctionCodeLocationInner resource) { + return this.beginCreateOrReplaceAsync(resourceGroupName, name, resource).getSyncPoller(); + } + + /** + * Create a LambdaFunctionCodeLocation. Please note that end user resource creation is currently restricted, but it + * will be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of LambdaFunctionCodeLocation. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, LambdaFunctionCodeLocationInner> + beginCreateOrReplace(String resourceGroupName, String name, LambdaFunctionCodeLocationInner resource, + Context context) { + return this.beginCreateOrReplaceAsync(resourceGroupName, name, resource, context).getSyncPoller(); + } + + /** + * Create a LambdaFunctionCodeLocation. Please note that end user resource creation is currently restricted, but it + * will be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of LambdaFunctionCodeLocation. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrReplaceAsync(String resourceGroupName, String name, + LambdaFunctionCodeLocationInner resource) { + return beginCreateOrReplaceAsync(resourceGroupName, name, resource).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create a LambdaFunctionCodeLocation. Please note that end user resource creation is currently restricted, but it + * will be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of LambdaFunctionCodeLocation. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrReplaceAsync(String resourceGroupName, String name, + LambdaFunctionCodeLocationInner resource, Context context) { + return beginCreateOrReplaceAsync(resourceGroupName, name, resource, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create a LambdaFunctionCodeLocation. Please note that end user resource creation is currently restricted, but it + * will be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of LambdaFunctionCodeLocation. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public LambdaFunctionCodeLocationInner createOrReplace(String resourceGroupName, String name, + LambdaFunctionCodeLocationInner resource) { + return createOrReplaceAsync(resourceGroupName, name, resource).block(); + } + + /** + * Create a LambdaFunctionCodeLocation. Please note that end user resource creation is currently restricted, but it + * will be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of LambdaFunctionCodeLocation. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public LambdaFunctionCodeLocationInner createOrReplace(String resourceGroupName, String name, + LambdaFunctionCodeLocationInner resource, Context context) { + return createOrReplaceAsync(resourceGroupName, name, resource, context).block(); + } + + /** + * Update a LambdaFunctionCodeLocation. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of LambdaFunctionCodeLocation. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync(String resourceGroupName, String name, + LambdaFunctionCodeLocationTagsUpdate properties) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (properties == null) { + return Mono.error(new IllegalArgumentException("Parameter properties is required and cannot be null.")); + } else { + properties.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.update(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, properties, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Update a LambdaFunctionCodeLocation. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of LambdaFunctionCodeLocation. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync(String resourceGroupName, String name, + LambdaFunctionCodeLocationTagsUpdate properties, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (properties == null) { + return Mono.error(new IllegalArgumentException("Parameter properties is required and cannot be null.")); + } else { + properties.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.update(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, name, properties, accept, context); + } + + /** + * Update a LambdaFunctionCodeLocation. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of LambdaFunctionCodeLocation. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, LambdaFunctionCodeLocationInner> + beginUpdateAsync(String resourceGroupName, String name, LambdaFunctionCodeLocationTagsUpdate properties) { + Mono>> mono = updateWithResponseAsync(resourceGroupName, name, properties); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), LambdaFunctionCodeLocationInner.class, LambdaFunctionCodeLocationInner.class, + this.client.getContext()); + } + + /** + * Update a LambdaFunctionCodeLocation. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of LambdaFunctionCodeLocation. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, LambdaFunctionCodeLocationInner> beginUpdateAsync( + String resourceGroupName, String name, LambdaFunctionCodeLocationTagsUpdate properties, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = updateWithResponseAsync(resourceGroupName, name, properties, context); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), LambdaFunctionCodeLocationInner.class, LambdaFunctionCodeLocationInner.class, + context); + } + + /** + * Update a LambdaFunctionCodeLocation. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of LambdaFunctionCodeLocation. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, LambdaFunctionCodeLocationInner> + beginUpdate(String resourceGroupName, String name, LambdaFunctionCodeLocationTagsUpdate properties) { + return this.beginUpdateAsync(resourceGroupName, name, properties).getSyncPoller(); + } + + /** + * Update a LambdaFunctionCodeLocation. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of LambdaFunctionCodeLocation. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, LambdaFunctionCodeLocationInner> beginUpdate( + String resourceGroupName, String name, LambdaFunctionCodeLocationTagsUpdate properties, Context context) { + return this.beginUpdateAsync(resourceGroupName, name, properties, context).getSyncPoller(); + } + + /** + * Update a LambdaFunctionCodeLocation. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of LambdaFunctionCodeLocation. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync(String resourceGroupName, String name, + LambdaFunctionCodeLocationTagsUpdate properties) { + return beginUpdateAsync(resourceGroupName, name, properties).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Update a LambdaFunctionCodeLocation. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of LambdaFunctionCodeLocation. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync(String resourceGroupName, String name, + LambdaFunctionCodeLocationTagsUpdate properties, Context context) { + return beginUpdateAsync(resourceGroupName, name, properties, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Update a LambdaFunctionCodeLocation. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of LambdaFunctionCodeLocation. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public LambdaFunctionCodeLocationInner update(String resourceGroupName, String name, + LambdaFunctionCodeLocationTagsUpdate properties) { + return updateAsync(resourceGroupName, name, properties).block(); + } + + /** + * Update a LambdaFunctionCodeLocation. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of LambdaFunctionCodeLocation. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public LambdaFunctionCodeLocationInner update(String resourceGroupName, String name, + LambdaFunctionCodeLocationTagsUpdate properties, Context context) { + return updateAsync(resourceGroupName, name, properties, context).block(); + } + + /** + * Delete a LambdaFunctionCodeLocation. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of LambdaFunctionCodeLocation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync(String resourceGroupName, String name) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Delete a LambdaFunctionCodeLocation. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of LambdaFunctionCodeLocation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync(String resourceGroupName, String name, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.delete(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, name, accept, context); + } + + /** + * Delete a LambdaFunctionCodeLocation. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of LambdaFunctionCodeLocation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String name) { + Mono>> mono = deleteWithResponseAsync(resourceGroupName, name); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); + } + + /** + * Delete a LambdaFunctionCodeLocation. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of LambdaFunctionCodeLocation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String name, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = deleteWithResponseAsync(resourceGroupName, name, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + context); + } + + /** + * Delete a LambdaFunctionCodeLocation. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of LambdaFunctionCodeLocation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String name) { + return this.beginDeleteAsync(resourceGroupName, name).getSyncPoller(); + } + + /** + * Delete a LambdaFunctionCodeLocation. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of LambdaFunctionCodeLocation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String name, Context context) { + return this.beginDeleteAsync(resourceGroupName, name, context).getSyncPoller(); + } + + /** + * Delete a LambdaFunctionCodeLocation. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of LambdaFunctionCodeLocation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String name) { + return beginDeleteAsync(resourceGroupName, name).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete a LambdaFunctionCodeLocation. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of LambdaFunctionCodeLocation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String name, Context context) { + return beginDeleteAsync(resourceGroupName, name, context).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete a LambdaFunctionCodeLocation. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of LambdaFunctionCodeLocation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String name) { + deleteAsync(resourceGroupName, name).block(); + } + + /** + * Delete a LambdaFunctionCodeLocation. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of LambdaFunctionCodeLocation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String name, Context context) { + deleteAsync(resourceGroupName, name, context).block(); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a LambdaFunctionCodeLocation list operation along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> + listBySubscriptionNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a LambdaFunctionCodeLocation list operation along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listBySubscriptionNextSinglePageAsync(String nextLink, + Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a LambdaFunctionCodeLocation list operation along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> + listByResourceGroupNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a LambdaFunctionCodeLocation list operation along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupNextSinglePageAsync(String nextLink, + Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/LambdaFunctionCodeLocationsImpl.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/LambdaFunctionCodeLocationsImpl.java new file mode 100644 index 000000000000..1ebf9927d826 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/LambdaFunctionCodeLocationsImpl.java @@ -0,0 +1,152 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.awsconnector.fluent.LambdaFunctionCodeLocationsClient; +import com.azure.resourcemanager.awsconnector.fluent.models.LambdaFunctionCodeLocationInner; +import com.azure.resourcemanager.awsconnector.models.LambdaFunctionCodeLocation; +import com.azure.resourcemanager.awsconnector.models.LambdaFunctionCodeLocations; + +public final class LambdaFunctionCodeLocationsImpl implements LambdaFunctionCodeLocations { + private static final ClientLogger LOGGER = new ClientLogger(LambdaFunctionCodeLocationsImpl.class); + + private final LambdaFunctionCodeLocationsClient innerClient; + + private final com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager; + + public LambdaFunctionCodeLocationsImpl(LambdaFunctionCodeLocationsClient innerClient, + com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return ResourceManagerUtils.mapPage(inner, + inner1 -> new LambdaFunctionCodeLocationImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return ResourceManagerUtils.mapPage(inner, + inner1 -> new LambdaFunctionCodeLocationImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName) { + PagedIterable inner + = this.serviceClient().listByResourceGroup(resourceGroupName); + return ResourceManagerUtils.mapPage(inner, + inner1 -> new LambdaFunctionCodeLocationImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + PagedIterable inner + = this.serviceClient().listByResourceGroup(resourceGroupName, context); + return ResourceManagerUtils.mapPage(inner, + inner1 -> new LambdaFunctionCodeLocationImpl(inner1, this.manager())); + } + + public Response getByResourceGroupWithResponse(String resourceGroupName, String name, + Context context) { + Response inner + = this.serviceClient().getByResourceGroupWithResponse(resourceGroupName, name, context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new LambdaFunctionCodeLocationImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public LambdaFunctionCodeLocation getByResourceGroup(String resourceGroupName, String name) { + LambdaFunctionCodeLocationInner inner = this.serviceClient().getByResourceGroup(resourceGroupName, name); + if (inner != null) { + return new LambdaFunctionCodeLocationImpl(inner, this.manager()); + } else { + return null; + } + } + + public void deleteByResourceGroup(String resourceGroupName, String name) { + this.serviceClient().delete(resourceGroupName, name); + } + + public void delete(String resourceGroupName, String name, Context context) { + this.serviceClient().delete(resourceGroupName, name, context); + } + + public LambdaFunctionCodeLocation getById(String id) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String name = ResourceManagerUtils.getValueFromIdByName(id, "lambdaFunctionCodeLocations"); + if (name == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException(String + .format("The resource ID '%s' is not valid. Missing path segment 'lambdaFunctionCodeLocations'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, name, Context.NONE).getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String name = ResourceManagerUtils.getValueFromIdByName(id, "lambdaFunctionCodeLocations"); + if (name == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException(String + .format("The resource ID '%s' is not valid. Missing path segment 'lambdaFunctionCodeLocations'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, name, context); + } + + public void deleteById(String id) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String name = ResourceManagerUtils.getValueFromIdByName(id, "lambdaFunctionCodeLocations"); + if (name == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException(String + .format("The resource ID '%s' is not valid. Missing path segment 'lambdaFunctionCodeLocations'.", id))); + } + this.delete(resourceGroupName, name, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String name = ResourceManagerUtils.getValueFromIdByName(id, "lambdaFunctionCodeLocations"); + if (name == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException(String + .format("The resource ID '%s' is not valid. Missing path segment 'lambdaFunctionCodeLocations'.", id))); + } + this.delete(resourceGroupName, name, context); + } + + private LambdaFunctionCodeLocationsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.awsconnector.AwsconnectorManager manager() { + return this.serviceManager; + } + + public LambdaFunctionCodeLocationImpl define(String name) { + return new LambdaFunctionCodeLocationImpl(name, this.manager()); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/LambdaFunctionImpl.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/LambdaFunctionImpl.java new file mode 100644 index 000000000000..671fbe202955 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/LambdaFunctionImpl.java @@ -0,0 +1,177 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.implementation; + +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.awsconnector.fluent.models.LambdaFunctionInner; +import com.azure.resourcemanager.awsconnector.models.LambdaFunction; +import com.azure.resourcemanager.awsconnector.models.LambdaFunctionProperties; +import com.azure.resourcemanager.awsconnector.models.LambdaFunctionTagsUpdate; +import java.util.Collections; +import java.util.Map; + +public final class LambdaFunctionImpl implements LambdaFunction, LambdaFunction.Definition, LambdaFunction.Update { + private LambdaFunctionInner innerObject; + + private final com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public String location() { + return this.innerModel().location(); + } + + public Map tags() { + Map inner = this.innerModel().tags(); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } + } + + public LambdaFunctionProperties properties() { + return this.innerModel().properties(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public String resourceGroupName() { + return resourceGroupName; + } + + public LambdaFunctionInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.awsconnector.AwsconnectorManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String name; + + private LambdaFunctionTagsUpdate updateProperties; + + public LambdaFunctionImpl withExistingResourceGroup(String resourceGroupName) { + this.resourceGroupName = resourceGroupName; + return this; + } + + public LambdaFunction create() { + this.innerObject = serviceManager.serviceClient() + .getLambdaFunctions() + .createOrReplace(resourceGroupName, name, this.innerModel(), Context.NONE); + return this; + } + + public LambdaFunction create(Context context) { + this.innerObject = serviceManager.serviceClient() + .getLambdaFunctions() + .createOrReplace(resourceGroupName, name, this.innerModel(), context); + return this; + } + + LambdaFunctionImpl(String name, com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager) { + this.innerObject = new LambdaFunctionInner(); + this.serviceManager = serviceManager; + this.name = name; + } + + public LambdaFunctionImpl update() { + this.updateProperties = new LambdaFunctionTagsUpdate(); + return this; + } + + public LambdaFunction apply() { + this.innerObject = serviceManager.serviceClient() + .getLambdaFunctions() + .update(resourceGroupName, name, updateProperties, Context.NONE); + return this; + } + + public LambdaFunction apply(Context context) { + this.innerObject = serviceManager.serviceClient() + .getLambdaFunctions() + .update(resourceGroupName, name, updateProperties, context); + return this; + } + + LambdaFunctionImpl(LambdaFunctionInner innerObject, + com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.name = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "lambdaFunctions"); + } + + public LambdaFunction refresh() { + this.innerObject = serviceManager.serviceClient() + .getLambdaFunctions() + .getByResourceGroupWithResponse(resourceGroupName, name, Context.NONE) + .getValue(); + return this; + } + + public LambdaFunction refresh(Context context) { + this.innerObject = serviceManager.serviceClient() + .getLambdaFunctions() + .getByResourceGroupWithResponse(resourceGroupName, name, context) + .getValue(); + return this; + } + + public LambdaFunctionImpl withRegion(Region location) { + this.innerModel().withLocation(location.toString()); + return this; + } + + public LambdaFunctionImpl withRegion(String location) { + this.innerModel().withLocation(location); + return this; + } + + public LambdaFunctionImpl withTags(Map tags) { + if (isInCreateMode()) { + this.innerModel().withTags(tags); + return this; + } else { + this.updateProperties.withTags(tags); + return this; + } + } + + public LambdaFunctionImpl withProperties(LambdaFunctionProperties properties) { + this.innerModel().withProperties(properties); + return this; + } + + private boolean isInCreateMode() { + return this.innerModel().id() == null; + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/LambdaFunctionsClientImpl.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/LambdaFunctionsClientImpl.java new file mode 100644 index 000000000000..095a43a27e47 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/LambdaFunctionsClientImpl.java @@ -0,0 +1,1278 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.Patch; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.awsconnector.fluent.LambdaFunctionsClient; +import com.azure.resourcemanager.awsconnector.fluent.models.LambdaFunctionInner; +import com.azure.resourcemanager.awsconnector.models.LambdaFunctionListResult; +import com.azure.resourcemanager.awsconnector.models.LambdaFunctionTagsUpdate; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in LambdaFunctionsClient. + */ +public final class LambdaFunctionsClientImpl implements LambdaFunctionsClient { + /** + * The proxy service used to perform REST calls. + */ + private final LambdaFunctionsService service; + + /** + * The service client containing this operation class. + */ + private final MicrosoftAwsConnectorImpl client; + + /** + * Initializes an instance of LambdaFunctionsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + LambdaFunctionsClientImpl(MicrosoftAwsConnectorImpl client) { + this.service + = RestProxy.create(LambdaFunctionsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for MicrosoftAwsConnectorLambdaFunctions to be used by the proxy service + * to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "MicrosoftAwsConnecto") + public interface LambdaFunctionsService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.AwsConnector/lambdaFunctions") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/lambdaFunctions") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroup(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/lambdaFunctions/{name}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getByResourceGroup(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("name") String name, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/lambdaFunctions/{name}") + @ExpectedResponses({ 200, 201 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrReplace(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("name") String name, + @BodyParam("application/json") LambdaFunctionInner resource, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/lambdaFunctions/{name}") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> update(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("name") String name, + @BodyParam("application/json") LambdaFunctionTagsUpdate properties, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/lambdaFunctions/{name}") + @ExpectedResponses({ 202, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("name") String name, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listBySubscriptionNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroupNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); + } + + /** + * List LambdaFunction resources by subscription ID. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a LambdaFunction list operation along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync() { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List LambdaFunction resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a LambdaFunction list operation along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), accept, + context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * List LambdaFunction resources by subscription ID. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a LambdaFunction list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>(() -> listSinglePageAsync(), + nextLink -> listBySubscriptionNextSinglePageAsync(nextLink)); + } + + /** + * List LambdaFunction resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a LambdaFunction list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(Context context) { + return new PagedFlux<>(() -> listSinglePageAsync(context), + nextLink -> listBySubscriptionNextSinglePageAsync(nextLink, context)); + } + + /** + * List LambdaFunction resources by subscription ID. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a LambdaFunction list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + return new PagedIterable<>(listAsync()); + } + + /** + * List LambdaFunction resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a LambdaFunction list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Context context) { + return new PagedIterable<>(listAsync(context)); + } + + /** + * List LambdaFunction resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a LambdaFunction list operation along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List LambdaFunction resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a LambdaFunction list operation along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * List LambdaFunction resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a LambdaFunction list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName) { + return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); + } + + /** + * List LambdaFunction resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a LambdaFunction list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName, Context context) { + return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName, context), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink, context)); + } + + /** + * List LambdaFunction resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a LambdaFunction list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName)); + } + + /** + * List LambdaFunction resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a LambdaFunction list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, context)); + } + + /** + * Get a LambdaFunction. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of LambdaFunction. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a LambdaFunction along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync(String resourceGroupName, + String name) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.getByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get a LambdaFunction. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of LambdaFunction. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a LambdaFunction along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync(String resourceGroupName, + String name, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.getByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, accept, context); + } + + /** + * Get a LambdaFunction. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of LambdaFunction. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a LambdaFunction on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getByResourceGroupAsync(String resourceGroupName, String name) { + return getByResourceGroupWithResponseAsync(resourceGroupName, name) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Get a LambdaFunction. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of LambdaFunction. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a LambdaFunction along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getByResourceGroupWithResponse(String resourceGroupName, String name, + Context context) { + return getByResourceGroupWithResponseAsync(resourceGroupName, name, context).block(); + } + + /** + * Get a LambdaFunction. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of LambdaFunction. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a LambdaFunction. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public LambdaFunctionInner getByResourceGroup(String resourceGroupName, String name) { + return getByResourceGroupWithResponse(resourceGroupName, name, Context.NONE).getValue(); + } + + /** + * Create a LambdaFunction. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of LambdaFunction. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrReplaceWithResponseAsync(String resourceGroupName, String name, + LambdaFunctionInner resource) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (resource == null) { + return Mono.error(new IllegalArgumentException("Parameter resource is required and cannot be null.")); + } else { + resource.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.createOrReplace(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, resource, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Create a LambdaFunction. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of LambdaFunction. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrReplaceWithResponseAsync(String resourceGroupName, String name, + LambdaFunctionInner resource, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (resource == null) { + return Mono.error(new IllegalArgumentException("Parameter resource is required and cannot be null.")); + } else { + resource.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.createOrReplace(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, resource, accept, context); + } + + /** + * Create a LambdaFunction. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of LambdaFunction. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, LambdaFunctionInner> + beginCreateOrReplaceAsync(String resourceGroupName, String name, LambdaFunctionInner resource) { + Mono>> mono = createOrReplaceWithResponseAsync(resourceGroupName, name, resource); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + LambdaFunctionInner.class, LambdaFunctionInner.class, this.client.getContext()); + } + + /** + * Create a LambdaFunction. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of LambdaFunction. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, LambdaFunctionInner> beginCreateOrReplaceAsync( + String resourceGroupName, String name, LambdaFunctionInner resource, Context context) { + context = this.client.mergeContext(context); + Mono>> mono + = createOrReplaceWithResponseAsync(resourceGroupName, name, resource, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + LambdaFunctionInner.class, LambdaFunctionInner.class, context); + } + + /** + * Create a LambdaFunction. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of LambdaFunction. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, LambdaFunctionInner> + beginCreateOrReplace(String resourceGroupName, String name, LambdaFunctionInner resource) { + return this.beginCreateOrReplaceAsync(resourceGroupName, name, resource).getSyncPoller(); + } + + /** + * Create a LambdaFunction. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of LambdaFunction. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, LambdaFunctionInner> + beginCreateOrReplace(String resourceGroupName, String name, LambdaFunctionInner resource, Context context) { + return this.beginCreateOrReplaceAsync(resourceGroupName, name, resource, context).getSyncPoller(); + } + + /** + * Create a LambdaFunction. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of LambdaFunction. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrReplaceAsync(String resourceGroupName, String name, + LambdaFunctionInner resource) { + return beginCreateOrReplaceAsync(resourceGroupName, name, resource).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create a LambdaFunction. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of LambdaFunction. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrReplaceAsync(String resourceGroupName, String name, + LambdaFunctionInner resource, Context context) { + return beginCreateOrReplaceAsync(resourceGroupName, name, resource, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create a LambdaFunction. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of LambdaFunction. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public LambdaFunctionInner createOrReplace(String resourceGroupName, String name, LambdaFunctionInner resource) { + return createOrReplaceAsync(resourceGroupName, name, resource).block(); + } + + /** + * Create a LambdaFunction. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of LambdaFunction. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public LambdaFunctionInner createOrReplace(String resourceGroupName, String name, LambdaFunctionInner resource, + Context context) { + return createOrReplaceAsync(resourceGroupName, name, resource, context).block(); + } + + /** + * Update a LambdaFunction. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of LambdaFunction. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync(String resourceGroupName, String name, + LambdaFunctionTagsUpdate properties) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (properties == null) { + return Mono.error(new IllegalArgumentException("Parameter properties is required and cannot be null.")); + } else { + properties.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.update(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, properties, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Update a LambdaFunction. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of LambdaFunction. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync(String resourceGroupName, String name, + LambdaFunctionTagsUpdate properties, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (properties == null) { + return Mono.error(new IllegalArgumentException("Parameter properties is required and cannot be null.")); + } else { + properties.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.update(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, name, properties, accept, context); + } + + /** + * Update a LambdaFunction. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of LambdaFunction. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, LambdaFunctionInner> beginUpdateAsync(String resourceGroupName, + String name, LambdaFunctionTagsUpdate properties) { + Mono>> mono = updateWithResponseAsync(resourceGroupName, name, properties); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + LambdaFunctionInner.class, LambdaFunctionInner.class, this.client.getContext()); + } + + /** + * Update a LambdaFunction. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of LambdaFunction. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, LambdaFunctionInner> beginUpdateAsync(String resourceGroupName, + String name, LambdaFunctionTagsUpdate properties, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = updateWithResponseAsync(resourceGroupName, name, properties, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + LambdaFunctionInner.class, LambdaFunctionInner.class, context); + } + + /** + * Update a LambdaFunction. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of LambdaFunction. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, LambdaFunctionInner> beginUpdate(String resourceGroupName, + String name, LambdaFunctionTagsUpdate properties) { + return this.beginUpdateAsync(resourceGroupName, name, properties).getSyncPoller(); + } + + /** + * Update a LambdaFunction. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of LambdaFunction. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, LambdaFunctionInner> beginUpdate(String resourceGroupName, + String name, LambdaFunctionTagsUpdate properties, Context context) { + return this.beginUpdateAsync(resourceGroupName, name, properties, context).getSyncPoller(); + } + + /** + * Update a LambdaFunction. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of LambdaFunction. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync(String resourceGroupName, String name, + LambdaFunctionTagsUpdate properties) { + return beginUpdateAsync(resourceGroupName, name, properties).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Update a LambdaFunction. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of LambdaFunction. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync(String resourceGroupName, String name, + LambdaFunctionTagsUpdate properties, Context context) { + return beginUpdateAsync(resourceGroupName, name, properties, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Update a LambdaFunction. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of LambdaFunction. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public LambdaFunctionInner update(String resourceGroupName, String name, LambdaFunctionTagsUpdate properties) { + return updateAsync(resourceGroupName, name, properties).block(); + } + + /** + * Update a LambdaFunction. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of LambdaFunction. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public LambdaFunctionInner update(String resourceGroupName, String name, LambdaFunctionTagsUpdate properties, + Context context) { + return updateAsync(resourceGroupName, name, properties, context).block(); + } + + /** + * Delete a LambdaFunction. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of LambdaFunction. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync(String resourceGroupName, String name) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Delete a LambdaFunction. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of LambdaFunction. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync(String resourceGroupName, String name, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.delete(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, name, accept, context); + } + + /** + * Delete a LambdaFunction. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of LambdaFunction. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String name) { + Mono>> mono = deleteWithResponseAsync(resourceGroupName, name); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); + } + + /** + * Delete a LambdaFunction. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of LambdaFunction. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String name, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = deleteWithResponseAsync(resourceGroupName, name, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + context); + } + + /** + * Delete a LambdaFunction. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of LambdaFunction. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String name) { + return this.beginDeleteAsync(resourceGroupName, name).getSyncPoller(); + } + + /** + * Delete a LambdaFunction. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of LambdaFunction. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String name, Context context) { + return this.beginDeleteAsync(resourceGroupName, name, context).getSyncPoller(); + } + + /** + * Delete a LambdaFunction. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of LambdaFunction. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String name) { + return beginDeleteAsync(resourceGroupName, name).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete a LambdaFunction. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of LambdaFunction. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String name, Context context) { + return beginDeleteAsync(resourceGroupName, name, context).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete a LambdaFunction. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of LambdaFunction. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String name) { + deleteAsync(resourceGroupName, name).block(); + } + + /** + * Delete a LambdaFunction. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of LambdaFunction. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String name, Context context) { + deleteAsync(resourceGroupName, name, context).block(); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a LambdaFunction list operation along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listBySubscriptionNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a LambdaFunction list operation along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listBySubscriptionNextSinglePageAsync(String nextLink, + Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a LambdaFunction list operation along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a LambdaFunction list operation along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupNextSinglePageAsync(String nextLink, + Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/LambdaFunctionsImpl.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/LambdaFunctionsImpl.java new file mode 100644 index 000000000000..c25ce5a9389c --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/LambdaFunctionsImpl.java @@ -0,0 +1,146 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.awsconnector.fluent.LambdaFunctionsClient; +import com.azure.resourcemanager.awsconnector.fluent.models.LambdaFunctionInner; +import com.azure.resourcemanager.awsconnector.models.LambdaFunction; +import com.azure.resourcemanager.awsconnector.models.LambdaFunctions; + +public final class LambdaFunctionsImpl implements LambdaFunctions { + private static final ClientLogger LOGGER = new ClientLogger(LambdaFunctionsImpl.class); + + private final LambdaFunctionsClient innerClient; + + private final com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager; + + public LambdaFunctionsImpl(LambdaFunctionsClient innerClient, + com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return ResourceManagerUtils.mapPage(inner, inner1 -> new LambdaFunctionImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new LambdaFunctionImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName); + return ResourceManagerUtils.mapPage(inner, inner1 -> new LambdaFunctionImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new LambdaFunctionImpl(inner1, this.manager())); + } + + public Response getByResourceGroupWithResponse(String resourceGroupName, String name, + Context context) { + Response inner + = this.serviceClient().getByResourceGroupWithResponse(resourceGroupName, name, context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new LambdaFunctionImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public LambdaFunction getByResourceGroup(String resourceGroupName, String name) { + LambdaFunctionInner inner = this.serviceClient().getByResourceGroup(resourceGroupName, name); + if (inner != null) { + return new LambdaFunctionImpl(inner, this.manager()); + } else { + return null; + } + } + + public void deleteByResourceGroup(String resourceGroupName, String name) { + this.serviceClient().delete(resourceGroupName, name); + } + + public void delete(String resourceGroupName, String name, Context context) { + this.serviceClient().delete(resourceGroupName, name, context); + } + + public LambdaFunction getById(String id) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String name = ResourceManagerUtils.getValueFromIdByName(id, "lambdaFunctions"); + if (name == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'lambdaFunctions'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, name, Context.NONE).getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String name = ResourceManagerUtils.getValueFromIdByName(id, "lambdaFunctions"); + if (name == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'lambdaFunctions'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, name, context); + } + + public void deleteById(String id) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String name = ResourceManagerUtils.getValueFromIdByName(id, "lambdaFunctions"); + if (name == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'lambdaFunctions'.", id))); + } + this.delete(resourceGroupName, name, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String name = ResourceManagerUtils.getValueFromIdByName(id, "lambdaFunctions"); + if (name == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'lambdaFunctions'.", id))); + } + this.delete(resourceGroupName, name, context); + } + + private LambdaFunctionsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.awsconnector.AwsconnectorManager manager() { + return this.serviceManager; + } + + public LambdaFunctionImpl define(String name) { + return new LambdaFunctionImpl(name, this.manager()); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/LightsailBucketImpl.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/LightsailBucketImpl.java new file mode 100644 index 000000000000..c081941e4c31 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/LightsailBucketImpl.java @@ -0,0 +1,177 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.implementation; + +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.awsconnector.fluent.models.LightsailBucketInner; +import com.azure.resourcemanager.awsconnector.models.LightsailBucket; +import com.azure.resourcemanager.awsconnector.models.LightsailBucketProperties; +import com.azure.resourcemanager.awsconnector.models.LightsailBucketTagsUpdate; +import java.util.Collections; +import java.util.Map; + +public final class LightsailBucketImpl implements LightsailBucket, LightsailBucket.Definition, LightsailBucket.Update { + private LightsailBucketInner innerObject; + + private final com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public String location() { + return this.innerModel().location(); + } + + public Map tags() { + Map inner = this.innerModel().tags(); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } + } + + public LightsailBucketProperties properties() { + return this.innerModel().properties(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public String resourceGroupName() { + return resourceGroupName; + } + + public LightsailBucketInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.awsconnector.AwsconnectorManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String name; + + private LightsailBucketTagsUpdate updateProperties; + + public LightsailBucketImpl withExistingResourceGroup(String resourceGroupName) { + this.resourceGroupName = resourceGroupName; + return this; + } + + public LightsailBucket create() { + this.innerObject = serviceManager.serviceClient() + .getLightsailBuckets() + .createOrReplace(resourceGroupName, name, this.innerModel(), Context.NONE); + return this; + } + + public LightsailBucket create(Context context) { + this.innerObject = serviceManager.serviceClient() + .getLightsailBuckets() + .createOrReplace(resourceGroupName, name, this.innerModel(), context); + return this; + } + + LightsailBucketImpl(String name, com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager) { + this.innerObject = new LightsailBucketInner(); + this.serviceManager = serviceManager; + this.name = name; + } + + public LightsailBucketImpl update() { + this.updateProperties = new LightsailBucketTagsUpdate(); + return this; + } + + public LightsailBucket apply() { + this.innerObject = serviceManager.serviceClient() + .getLightsailBuckets() + .update(resourceGroupName, name, updateProperties, Context.NONE); + return this; + } + + public LightsailBucket apply(Context context) { + this.innerObject = serviceManager.serviceClient() + .getLightsailBuckets() + .update(resourceGroupName, name, updateProperties, context); + return this; + } + + LightsailBucketImpl(LightsailBucketInner innerObject, + com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.name = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "lightsailBuckets"); + } + + public LightsailBucket refresh() { + this.innerObject = serviceManager.serviceClient() + .getLightsailBuckets() + .getByResourceGroupWithResponse(resourceGroupName, name, Context.NONE) + .getValue(); + return this; + } + + public LightsailBucket refresh(Context context) { + this.innerObject = serviceManager.serviceClient() + .getLightsailBuckets() + .getByResourceGroupWithResponse(resourceGroupName, name, context) + .getValue(); + return this; + } + + public LightsailBucketImpl withRegion(Region location) { + this.innerModel().withLocation(location.toString()); + return this; + } + + public LightsailBucketImpl withRegion(String location) { + this.innerModel().withLocation(location); + return this; + } + + public LightsailBucketImpl withTags(Map tags) { + if (isInCreateMode()) { + this.innerModel().withTags(tags); + return this; + } else { + this.updateProperties.withTags(tags); + return this; + } + } + + public LightsailBucketImpl withProperties(LightsailBucketProperties properties) { + this.innerModel().withProperties(properties); + return this; + } + + private boolean isInCreateMode() { + return this.innerModel().id() == null; + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/LightsailBucketsClientImpl.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/LightsailBucketsClientImpl.java new file mode 100644 index 000000000000..8deed7b96a22 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/LightsailBucketsClientImpl.java @@ -0,0 +1,1278 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.Patch; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.awsconnector.fluent.LightsailBucketsClient; +import com.azure.resourcemanager.awsconnector.fluent.models.LightsailBucketInner; +import com.azure.resourcemanager.awsconnector.models.LightsailBucketListResult; +import com.azure.resourcemanager.awsconnector.models.LightsailBucketTagsUpdate; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in LightsailBucketsClient. + */ +public final class LightsailBucketsClientImpl implements LightsailBucketsClient { + /** + * The proxy service used to perform REST calls. + */ + private final LightsailBucketsService service; + + /** + * The service client containing this operation class. + */ + private final MicrosoftAwsConnectorImpl client; + + /** + * Initializes an instance of LightsailBucketsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + LightsailBucketsClientImpl(MicrosoftAwsConnectorImpl client) { + this.service + = RestProxy.create(LightsailBucketsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for MicrosoftAwsConnectorLightsailBuckets to be used by the proxy service + * to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "MicrosoftAwsConnecto") + public interface LightsailBucketsService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.AwsConnector/lightsailBuckets") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/lightsailBuckets") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroup(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/lightsailBuckets/{name}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getByResourceGroup(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("name") String name, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/lightsailBuckets/{name}") + @ExpectedResponses({ 200, 201 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrReplace(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("name") String name, + @BodyParam("application/json") LightsailBucketInner resource, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/lightsailBuckets/{name}") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> update(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("name") String name, + @BodyParam("application/json") LightsailBucketTagsUpdate properties, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/lightsailBuckets/{name}") + @ExpectedResponses({ 202, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("name") String name, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listBySubscriptionNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroupNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); + } + + /** + * List LightsailBucket resources by subscription ID. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a LightsailBucket list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync() { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List LightsailBucket resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a LightsailBucket list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), accept, + context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * List LightsailBucket resources by subscription ID. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a LightsailBucket list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>(() -> listSinglePageAsync(), + nextLink -> listBySubscriptionNextSinglePageAsync(nextLink)); + } + + /** + * List LightsailBucket resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a LightsailBucket list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(Context context) { + return new PagedFlux<>(() -> listSinglePageAsync(context), + nextLink -> listBySubscriptionNextSinglePageAsync(nextLink, context)); + } + + /** + * List LightsailBucket resources by subscription ID. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a LightsailBucket list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + return new PagedIterable<>(listAsync()); + } + + /** + * List LightsailBucket resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a LightsailBucket list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Context context) { + return new PagedIterable<>(listAsync(context)); + } + + /** + * List LightsailBucket resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a LightsailBucket list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List LightsailBucket resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a LightsailBucket list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * List LightsailBucket resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a LightsailBucket list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName) { + return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); + } + + /** + * List LightsailBucket resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a LightsailBucket list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName, Context context) { + return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName, context), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink, context)); + } + + /** + * List LightsailBucket resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a LightsailBucket list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName)); + } + + /** + * List LightsailBucket resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a LightsailBucket list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, context)); + } + + /** + * Get a LightsailBucket. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of LightsailBucket. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a LightsailBucket along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync(String resourceGroupName, + String name) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.getByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get a LightsailBucket. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of LightsailBucket. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a LightsailBucket along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync(String resourceGroupName, + String name, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.getByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, accept, context); + } + + /** + * Get a LightsailBucket. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of LightsailBucket. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a LightsailBucket on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getByResourceGroupAsync(String resourceGroupName, String name) { + return getByResourceGroupWithResponseAsync(resourceGroupName, name) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Get a LightsailBucket. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of LightsailBucket. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a LightsailBucket along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getByResourceGroupWithResponse(String resourceGroupName, String name, + Context context) { + return getByResourceGroupWithResponseAsync(resourceGroupName, name, context).block(); + } + + /** + * Get a LightsailBucket. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of LightsailBucket. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a LightsailBucket. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public LightsailBucketInner getByResourceGroup(String resourceGroupName, String name) { + return getByResourceGroupWithResponse(resourceGroupName, name, Context.NONE).getValue(); + } + + /** + * Create a LightsailBucket. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of LightsailBucket. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrReplaceWithResponseAsync(String resourceGroupName, String name, + LightsailBucketInner resource) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (resource == null) { + return Mono.error(new IllegalArgumentException("Parameter resource is required and cannot be null.")); + } else { + resource.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.createOrReplace(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, resource, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Create a LightsailBucket. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of LightsailBucket. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrReplaceWithResponseAsync(String resourceGroupName, String name, + LightsailBucketInner resource, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (resource == null) { + return Mono.error(new IllegalArgumentException("Parameter resource is required and cannot be null.")); + } else { + resource.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.createOrReplace(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, resource, accept, context); + } + + /** + * Create a LightsailBucket. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of LightsailBucket. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, LightsailBucketInner> + beginCreateOrReplaceAsync(String resourceGroupName, String name, LightsailBucketInner resource) { + Mono>> mono = createOrReplaceWithResponseAsync(resourceGroupName, name, resource); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + LightsailBucketInner.class, LightsailBucketInner.class, this.client.getContext()); + } + + /** + * Create a LightsailBucket. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of LightsailBucket. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, LightsailBucketInner> beginCreateOrReplaceAsync( + String resourceGroupName, String name, LightsailBucketInner resource, Context context) { + context = this.client.mergeContext(context); + Mono>> mono + = createOrReplaceWithResponseAsync(resourceGroupName, name, resource, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + LightsailBucketInner.class, LightsailBucketInner.class, context); + } + + /** + * Create a LightsailBucket. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of LightsailBucket. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, LightsailBucketInner> + beginCreateOrReplace(String resourceGroupName, String name, LightsailBucketInner resource) { + return this.beginCreateOrReplaceAsync(resourceGroupName, name, resource).getSyncPoller(); + } + + /** + * Create a LightsailBucket. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of LightsailBucket. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, LightsailBucketInner> + beginCreateOrReplace(String resourceGroupName, String name, LightsailBucketInner resource, Context context) { + return this.beginCreateOrReplaceAsync(resourceGroupName, name, resource, context).getSyncPoller(); + } + + /** + * Create a LightsailBucket. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of LightsailBucket. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrReplaceAsync(String resourceGroupName, String name, + LightsailBucketInner resource) { + return beginCreateOrReplaceAsync(resourceGroupName, name, resource).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create a LightsailBucket. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of LightsailBucket. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrReplaceAsync(String resourceGroupName, String name, + LightsailBucketInner resource, Context context) { + return beginCreateOrReplaceAsync(resourceGroupName, name, resource, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create a LightsailBucket. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of LightsailBucket. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public LightsailBucketInner createOrReplace(String resourceGroupName, String name, LightsailBucketInner resource) { + return createOrReplaceAsync(resourceGroupName, name, resource).block(); + } + + /** + * Create a LightsailBucket. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of LightsailBucket. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public LightsailBucketInner createOrReplace(String resourceGroupName, String name, LightsailBucketInner resource, + Context context) { + return createOrReplaceAsync(resourceGroupName, name, resource, context).block(); + } + + /** + * Update a LightsailBucket. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of LightsailBucket. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync(String resourceGroupName, String name, + LightsailBucketTagsUpdate properties) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (properties == null) { + return Mono.error(new IllegalArgumentException("Parameter properties is required and cannot be null.")); + } else { + properties.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.update(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, properties, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Update a LightsailBucket. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of LightsailBucket. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync(String resourceGroupName, String name, + LightsailBucketTagsUpdate properties, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (properties == null) { + return Mono.error(new IllegalArgumentException("Parameter properties is required and cannot be null.")); + } else { + properties.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.update(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, name, properties, accept, context); + } + + /** + * Update a LightsailBucket. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of LightsailBucket. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, LightsailBucketInner> + beginUpdateAsync(String resourceGroupName, String name, LightsailBucketTagsUpdate properties) { + Mono>> mono = updateWithResponseAsync(resourceGroupName, name, properties); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + LightsailBucketInner.class, LightsailBucketInner.class, this.client.getContext()); + } + + /** + * Update a LightsailBucket. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of LightsailBucket. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, LightsailBucketInner> + beginUpdateAsync(String resourceGroupName, String name, LightsailBucketTagsUpdate properties, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = updateWithResponseAsync(resourceGroupName, name, properties, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + LightsailBucketInner.class, LightsailBucketInner.class, context); + } + + /** + * Update a LightsailBucket. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of LightsailBucket. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, LightsailBucketInner> beginUpdate(String resourceGroupName, + String name, LightsailBucketTagsUpdate properties) { + return this.beginUpdateAsync(resourceGroupName, name, properties).getSyncPoller(); + } + + /** + * Update a LightsailBucket. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of LightsailBucket. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, LightsailBucketInner> beginUpdate(String resourceGroupName, + String name, LightsailBucketTagsUpdate properties, Context context) { + return this.beginUpdateAsync(resourceGroupName, name, properties, context).getSyncPoller(); + } + + /** + * Update a LightsailBucket. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of LightsailBucket. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync(String resourceGroupName, String name, + LightsailBucketTagsUpdate properties) { + return beginUpdateAsync(resourceGroupName, name, properties).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Update a LightsailBucket. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of LightsailBucket. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync(String resourceGroupName, String name, + LightsailBucketTagsUpdate properties, Context context) { + return beginUpdateAsync(resourceGroupName, name, properties, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Update a LightsailBucket. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of LightsailBucket. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public LightsailBucketInner update(String resourceGroupName, String name, LightsailBucketTagsUpdate properties) { + return updateAsync(resourceGroupName, name, properties).block(); + } + + /** + * Update a LightsailBucket. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of LightsailBucket. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public LightsailBucketInner update(String resourceGroupName, String name, LightsailBucketTagsUpdate properties, + Context context) { + return updateAsync(resourceGroupName, name, properties, context).block(); + } + + /** + * Delete a LightsailBucket. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of LightsailBucket. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync(String resourceGroupName, String name) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Delete a LightsailBucket. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of LightsailBucket. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync(String resourceGroupName, String name, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.delete(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, name, accept, context); + } + + /** + * Delete a LightsailBucket. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of LightsailBucket. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String name) { + Mono>> mono = deleteWithResponseAsync(resourceGroupName, name); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); + } + + /** + * Delete a LightsailBucket. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of LightsailBucket. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String name, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = deleteWithResponseAsync(resourceGroupName, name, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + context); + } + + /** + * Delete a LightsailBucket. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of LightsailBucket. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String name) { + return this.beginDeleteAsync(resourceGroupName, name).getSyncPoller(); + } + + /** + * Delete a LightsailBucket. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of LightsailBucket. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String name, Context context) { + return this.beginDeleteAsync(resourceGroupName, name, context).getSyncPoller(); + } + + /** + * Delete a LightsailBucket. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of LightsailBucket. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String name) { + return beginDeleteAsync(resourceGroupName, name).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete a LightsailBucket. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of LightsailBucket. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String name, Context context) { + return beginDeleteAsync(resourceGroupName, name, context).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete a LightsailBucket. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of LightsailBucket. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String name) { + deleteAsync(resourceGroupName, name).block(); + } + + /** + * Delete a LightsailBucket. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of LightsailBucket. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String name, Context context) { + deleteAsync(resourceGroupName, name, context).block(); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a LightsailBucket list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listBySubscriptionNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a LightsailBucket list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listBySubscriptionNextSinglePageAsync(String nextLink, + Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a LightsailBucket list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a LightsailBucket list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupNextSinglePageAsync(String nextLink, + Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/LightsailBucketsImpl.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/LightsailBucketsImpl.java new file mode 100644 index 000000000000..c6fa9ca81fdf --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/LightsailBucketsImpl.java @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.awsconnector.fluent.LightsailBucketsClient; +import com.azure.resourcemanager.awsconnector.fluent.models.LightsailBucketInner; +import com.azure.resourcemanager.awsconnector.models.LightsailBucket; +import com.azure.resourcemanager.awsconnector.models.LightsailBuckets; + +public final class LightsailBucketsImpl implements LightsailBuckets { + private static final ClientLogger LOGGER = new ClientLogger(LightsailBucketsImpl.class); + + private final LightsailBucketsClient innerClient; + + private final com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager; + + public LightsailBucketsImpl(LightsailBucketsClient innerClient, + com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return ResourceManagerUtils.mapPage(inner, inner1 -> new LightsailBucketImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new LightsailBucketImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName); + return ResourceManagerUtils.mapPage(inner, inner1 -> new LightsailBucketImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + PagedIterable inner + = this.serviceClient().listByResourceGroup(resourceGroupName, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new LightsailBucketImpl(inner1, this.manager())); + } + + public Response getByResourceGroupWithResponse(String resourceGroupName, String name, + Context context) { + Response inner + = this.serviceClient().getByResourceGroupWithResponse(resourceGroupName, name, context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new LightsailBucketImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public LightsailBucket getByResourceGroup(String resourceGroupName, String name) { + LightsailBucketInner inner = this.serviceClient().getByResourceGroup(resourceGroupName, name); + if (inner != null) { + return new LightsailBucketImpl(inner, this.manager()); + } else { + return null; + } + } + + public void deleteByResourceGroup(String resourceGroupName, String name) { + this.serviceClient().delete(resourceGroupName, name); + } + + public void delete(String resourceGroupName, String name, Context context) { + this.serviceClient().delete(resourceGroupName, name, context); + } + + public LightsailBucket getById(String id) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String name = ResourceManagerUtils.getValueFromIdByName(id, "lightsailBuckets"); + if (name == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'lightsailBuckets'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, name, Context.NONE).getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String name = ResourceManagerUtils.getValueFromIdByName(id, "lightsailBuckets"); + if (name == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'lightsailBuckets'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, name, context); + } + + public void deleteById(String id) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String name = ResourceManagerUtils.getValueFromIdByName(id, "lightsailBuckets"); + if (name == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'lightsailBuckets'.", id))); + } + this.delete(resourceGroupName, name, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String name = ResourceManagerUtils.getValueFromIdByName(id, "lightsailBuckets"); + if (name == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'lightsailBuckets'.", id))); + } + this.delete(resourceGroupName, name, context); + } + + private LightsailBucketsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.awsconnector.AwsconnectorManager manager() { + return this.serviceManager; + } + + public LightsailBucketImpl define(String name) { + return new LightsailBucketImpl(name, this.manager()); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/LightsailInstanceImpl.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/LightsailInstanceImpl.java new file mode 100644 index 000000000000..468e43acde7d --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/LightsailInstanceImpl.java @@ -0,0 +1,178 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.implementation; + +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.awsconnector.fluent.models.LightsailInstanceInner; +import com.azure.resourcemanager.awsconnector.models.LightsailInstance; +import com.azure.resourcemanager.awsconnector.models.LightsailInstanceProperties; +import com.azure.resourcemanager.awsconnector.models.LightsailInstanceTagsUpdate; +import java.util.Collections; +import java.util.Map; + +public final class LightsailInstanceImpl + implements LightsailInstance, LightsailInstance.Definition, LightsailInstance.Update { + private LightsailInstanceInner innerObject; + + private final com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public String location() { + return this.innerModel().location(); + } + + public Map tags() { + Map inner = this.innerModel().tags(); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } + } + + public LightsailInstanceProperties properties() { + return this.innerModel().properties(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public String resourceGroupName() { + return resourceGroupName; + } + + public LightsailInstanceInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.awsconnector.AwsconnectorManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String name; + + private LightsailInstanceTagsUpdate updateProperties; + + public LightsailInstanceImpl withExistingResourceGroup(String resourceGroupName) { + this.resourceGroupName = resourceGroupName; + return this; + } + + public LightsailInstance create() { + this.innerObject = serviceManager.serviceClient() + .getLightsailInstances() + .createOrReplace(resourceGroupName, name, this.innerModel(), Context.NONE); + return this; + } + + public LightsailInstance create(Context context) { + this.innerObject = serviceManager.serviceClient() + .getLightsailInstances() + .createOrReplace(resourceGroupName, name, this.innerModel(), context); + return this; + } + + LightsailInstanceImpl(String name, com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager) { + this.innerObject = new LightsailInstanceInner(); + this.serviceManager = serviceManager; + this.name = name; + } + + public LightsailInstanceImpl update() { + this.updateProperties = new LightsailInstanceTagsUpdate(); + return this; + } + + public LightsailInstance apply() { + this.innerObject = serviceManager.serviceClient() + .getLightsailInstances() + .update(resourceGroupName, name, updateProperties, Context.NONE); + return this; + } + + public LightsailInstance apply(Context context) { + this.innerObject = serviceManager.serviceClient() + .getLightsailInstances() + .update(resourceGroupName, name, updateProperties, context); + return this; + } + + LightsailInstanceImpl(LightsailInstanceInner innerObject, + com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.name = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "lightsailInstances"); + } + + public LightsailInstance refresh() { + this.innerObject = serviceManager.serviceClient() + .getLightsailInstances() + .getByResourceGroupWithResponse(resourceGroupName, name, Context.NONE) + .getValue(); + return this; + } + + public LightsailInstance refresh(Context context) { + this.innerObject = serviceManager.serviceClient() + .getLightsailInstances() + .getByResourceGroupWithResponse(resourceGroupName, name, context) + .getValue(); + return this; + } + + public LightsailInstanceImpl withRegion(Region location) { + this.innerModel().withLocation(location.toString()); + return this; + } + + public LightsailInstanceImpl withRegion(String location) { + this.innerModel().withLocation(location); + return this; + } + + public LightsailInstanceImpl withTags(Map tags) { + if (isInCreateMode()) { + this.innerModel().withTags(tags); + return this; + } else { + this.updateProperties.withTags(tags); + return this; + } + } + + public LightsailInstanceImpl withProperties(LightsailInstanceProperties properties) { + this.innerModel().withProperties(properties); + return this; + } + + private boolean isInCreateMode() { + return this.innerModel().id() == null; + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/LightsailInstancesClientImpl.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/LightsailInstancesClientImpl.java new file mode 100644 index 000000000000..9ad3847352d9 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/LightsailInstancesClientImpl.java @@ -0,0 +1,1282 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.Patch; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.awsconnector.fluent.LightsailInstancesClient; +import com.azure.resourcemanager.awsconnector.fluent.models.LightsailInstanceInner; +import com.azure.resourcemanager.awsconnector.models.LightsailInstanceListResult; +import com.azure.resourcemanager.awsconnector.models.LightsailInstanceTagsUpdate; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in LightsailInstancesClient. + */ +public final class LightsailInstancesClientImpl implements LightsailInstancesClient { + /** + * The proxy service used to perform REST calls. + */ + private final LightsailInstancesService service; + + /** + * The service client containing this operation class. + */ + private final MicrosoftAwsConnectorImpl client; + + /** + * Initializes an instance of LightsailInstancesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + LightsailInstancesClientImpl(MicrosoftAwsConnectorImpl client) { + this.service = RestProxy.create(LightsailInstancesService.class, client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for MicrosoftAwsConnectorLightsailInstances to be used by the proxy + * service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "MicrosoftAwsConnecto") + public interface LightsailInstancesService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.AwsConnector/lightsailInstances") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/lightsailInstances") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroup(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/lightsailInstances/{name}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getByResourceGroup(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("name") String name, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/lightsailInstances/{name}") + @ExpectedResponses({ 200, 201 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrReplace(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("name") String name, + @BodyParam("application/json") LightsailInstanceInner resource, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/lightsailInstances/{name}") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> update(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("name") String name, + @BodyParam("application/json") LightsailInstanceTagsUpdate properties, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/lightsailInstances/{name}") + @ExpectedResponses({ 202, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("name") String name, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listBySubscriptionNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroupNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); + } + + /** + * List LightsailInstance resources by subscription ID. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a LightsailInstance list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync() { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List LightsailInstance resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a LightsailInstance list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), accept, + context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * List LightsailInstance resources by subscription ID. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a LightsailInstance list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>(() -> listSinglePageAsync(), + nextLink -> listBySubscriptionNextSinglePageAsync(nextLink)); + } + + /** + * List LightsailInstance resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a LightsailInstance list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(Context context) { + return new PagedFlux<>(() -> listSinglePageAsync(context), + nextLink -> listBySubscriptionNextSinglePageAsync(nextLink, context)); + } + + /** + * List LightsailInstance resources by subscription ID. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a LightsailInstance list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + return new PagedIterable<>(listAsync()); + } + + /** + * List LightsailInstance resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a LightsailInstance list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Context context) { + return new PagedIterable<>(listAsync(context)); + } + + /** + * List LightsailInstance resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a LightsailInstance list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List LightsailInstance resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a LightsailInstance list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * List LightsailInstance resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a LightsailInstance list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName) { + return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); + } + + /** + * List LightsailInstance resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a LightsailInstance list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName, Context context) { + return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName, context), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink, context)); + } + + /** + * List LightsailInstance resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a LightsailInstance list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName)); + } + + /** + * List LightsailInstance resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a LightsailInstance list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, context)); + } + + /** + * Get a LightsailInstance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of LightsailInstance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a LightsailInstance along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync(String resourceGroupName, + String name) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.getByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get a LightsailInstance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of LightsailInstance. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a LightsailInstance along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync(String resourceGroupName, + String name, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.getByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, accept, context); + } + + /** + * Get a LightsailInstance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of LightsailInstance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a LightsailInstance on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getByResourceGroupAsync(String resourceGroupName, String name) { + return getByResourceGroupWithResponseAsync(resourceGroupName, name) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Get a LightsailInstance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of LightsailInstance. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a LightsailInstance along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getByResourceGroupWithResponse(String resourceGroupName, String name, + Context context) { + return getByResourceGroupWithResponseAsync(resourceGroupName, name, context).block(); + } + + /** + * Get a LightsailInstance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of LightsailInstance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a LightsailInstance. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public LightsailInstanceInner getByResourceGroup(String resourceGroupName, String name) { + return getByResourceGroupWithResponse(resourceGroupName, name, Context.NONE).getValue(); + } + + /** + * Create a LightsailInstance. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of LightsailInstance. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrReplaceWithResponseAsync(String resourceGroupName, String name, + LightsailInstanceInner resource) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (resource == null) { + return Mono.error(new IllegalArgumentException("Parameter resource is required and cannot be null.")); + } else { + resource.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.createOrReplace(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, resource, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Create a LightsailInstance. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of LightsailInstance. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrReplaceWithResponseAsync(String resourceGroupName, String name, + LightsailInstanceInner resource, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (resource == null) { + return Mono.error(new IllegalArgumentException("Parameter resource is required and cannot be null.")); + } else { + resource.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.createOrReplace(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, resource, accept, context); + } + + /** + * Create a LightsailInstance. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of LightsailInstance. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, LightsailInstanceInner> + beginCreateOrReplaceAsync(String resourceGroupName, String name, LightsailInstanceInner resource) { + Mono>> mono = createOrReplaceWithResponseAsync(resourceGroupName, name, resource); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), LightsailInstanceInner.class, LightsailInstanceInner.class, + this.client.getContext()); + } + + /** + * Create a LightsailInstance. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of LightsailInstance. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, LightsailInstanceInner> beginCreateOrReplaceAsync( + String resourceGroupName, String name, LightsailInstanceInner resource, Context context) { + context = this.client.mergeContext(context); + Mono>> mono + = createOrReplaceWithResponseAsync(resourceGroupName, name, resource, context); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), LightsailInstanceInner.class, LightsailInstanceInner.class, context); + } + + /** + * Create a LightsailInstance. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of LightsailInstance. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, LightsailInstanceInner> + beginCreateOrReplace(String resourceGroupName, String name, LightsailInstanceInner resource) { + return this.beginCreateOrReplaceAsync(resourceGroupName, name, resource).getSyncPoller(); + } + + /** + * Create a LightsailInstance. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of LightsailInstance. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, LightsailInstanceInner> + beginCreateOrReplace(String resourceGroupName, String name, LightsailInstanceInner resource, Context context) { + return this.beginCreateOrReplaceAsync(resourceGroupName, name, resource, context).getSyncPoller(); + } + + /** + * Create a LightsailInstance. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of LightsailInstance. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrReplaceAsync(String resourceGroupName, String name, + LightsailInstanceInner resource) { + return beginCreateOrReplaceAsync(resourceGroupName, name, resource).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create a LightsailInstance. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of LightsailInstance. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrReplaceAsync(String resourceGroupName, String name, + LightsailInstanceInner resource, Context context) { + return beginCreateOrReplaceAsync(resourceGroupName, name, resource, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create a LightsailInstance. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of LightsailInstance. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public LightsailInstanceInner createOrReplace(String resourceGroupName, String name, + LightsailInstanceInner resource) { + return createOrReplaceAsync(resourceGroupName, name, resource).block(); + } + + /** + * Create a LightsailInstance. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of LightsailInstance. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public LightsailInstanceInner createOrReplace(String resourceGroupName, String name, + LightsailInstanceInner resource, Context context) { + return createOrReplaceAsync(resourceGroupName, name, resource, context).block(); + } + + /** + * Update a LightsailInstance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of LightsailInstance. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync(String resourceGroupName, String name, + LightsailInstanceTagsUpdate properties) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (properties == null) { + return Mono.error(new IllegalArgumentException("Parameter properties is required and cannot be null.")); + } else { + properties.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.update(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, properties, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Update a LightsailInstance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of LightsailInstance. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync(String resourceGroupName, String name, + LightsailInstanceTagsUpdate properties, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (properties == null) { + return Mono.error(new IllegalArgumentException("Parameter properties is required and cannot be null.")); + } else { + properties.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.update(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, name, properties, accept, context); + } + + /** + * Update a LightsailInstance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of LightsailInstance. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, LightsailInstanceInner> + beginUpdateAsync(String resourceGroupName, String name, LightsailInstanceTagsUpdate properties) { + Mono>> mono = updateWithResponseAsync(resourceGroupName, name, properties); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), LightsailInstanceInner.class, LightsailInstanceInner.class, + this.client.getContext()); + } + + /** + * Update a LightsailInstance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of LightsailInstance. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, LightsailInstanceInner> beginUpdateAsync( + String resourceGroupName, String name, LightsailInstanceTagsUpdate properties, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = updateWithResponseAsync(resourceGroupName, name, properties, context); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), LightsailInstanceInner.class, LightsailInstanceInner.class, context); + } + + /** + * Update a LightsailInstance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of LightsailInstance. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, LightsailInstanceInner> beginUpdate(String resourceGroupName, + String name, LightsailInstanceTagsUpdate properties) { + return this.beginUpdateAsync(resourceGroupName, name, properties).getSyncPoller(); + } + + /** + * Update a LightsailInstance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of LightsailInstance. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, LightsailInstanceInner> beginUpdate(String resourceGroupName, + String name, LightsailInstanceTagsUpdate properties, Context context) { + return this.beginUpdateAsync(resourceGroupName, name, properties, context).getSyncPoller(); + } + + /** + * Update a LightsailInstance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of LightsailInstance. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync(String resourceGroupName, String name, + LightsailInstanceTagsUpdate properties) { + return beginUpdateAsync(resourceGroupName, name, properties).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Update a LightsailInstance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of LightsailInstance. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync(String resourceGroupName, String name, + LightsailInstanceTagsUpdate properties, Context context) { + return beginUpdateAsync(resourceGroupName, name, properties, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Update a LightsailInstance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of LightsailInstance. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public LightsailInstanceInner update(String resourceGroupName, String name, + LightsailInstanceTagsUpdate properties) { + return updateAsync(resourceGroupName, name, properties).block(); + } + + /** + * Update a LightsailInstance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of LightsailInstance. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public LightsailInstanceInner update(String resourceGroupName, String name, LightsailInstanceTagsUpdate properties, + Context context) { + return updateAsync(resourceGroupName, name, properties, context).block(); + } + + /** + * Delete a LightsailInstance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of LightsailInstance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync(String resourceGroupName, String name) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Delete a LightsailInstance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of LightsailInstance. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync(String resourceGroupName, String name, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.delete(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, name, accept, context); + } + + /** + * Delete a LightsailInstance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of LightsailInstance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String name) { + Mono>> mono = deleteWithResponseAsync(resourceGroupName, name); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); + } + + /** + * Delete a LightsailInstance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of LightsailInstance. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String name, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = deleteWithResponseAsync(resourceGroupName, name, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + context); + } + + /** + * Delete a LightsailInstance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of LightsailInstance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String name) { + return this.beginDeleteAsync(resourceGroupName, name).getSyncPoller(); + } + + /** + * Delete a LightsailInstance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of LightsailInstance. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String name, Context context) { + return this.beginDeleteAsync(resourceGroupName, name, context).getSyncPoller(); + } + + /** + * Delete a LightsailInstance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of LightsailInstance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String name) { + return beginDeleteAsync(resourceGroupName, name).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete a LightsailInstance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of LightsailInstance. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String name, Context context) { + return beginDeleteAsync(resourceGroupName, name, context).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete a LightsailInstance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of LightsailInstance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String name) { + deleteAsync(resourceGroupName, name).block(); + } + + /** + * Delete a LightsailInstance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of LightsailInstance. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String name, Context context) { + deleteAsync(resourceGroupName, name, context).block(); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a LightsailInstance list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listBySubscriptionNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a LightsailInstance list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listBySubscriptionNextSinglePageAsync(String nextLink, + Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a LightsailInstance list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a LightsailInstance list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupNextSinglePageAsync(String nextLink, + Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/LightsailInstancesImpl.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/LightsailInstancesImpl.java new file mode 100644 index 000000000000..98546373eae2 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/LightsailInstancesImpl.java @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.awsconnector.fluent.LightsailInstancesClient; +import com.azure.resourcemanager.awsconnector.fluent.models.LightsailInstanceInner; +import com.azure.resourcemanager.awsconnector.models.LightsailInstance; +import com.azure.resourcemanager.awsconnector.models.LightsailInstances; + +public final class LightsailInstancesImpl implements LightsailInstances { + private static final ClientLogger LOGGER = new ClientLogger(LightsailInstancesImpl.class); + + private final LightsailInstancesClient innerClient; + + private final com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager; + + public LightsailInstancesImpl(LightsailInstancesClient innerClient, + com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return ResourceManagerUtils.mapPage(inner, inner1 -> new LightsailInstanceImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new LightsailInstanceImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName); + return ResourceManagerUtils.mapPage(inner, inner1 -> new LightsailInstanceImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + PagedIterable inner + = this.serviceClient().listByResourceGroup(resourceGroupName, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new LightsailInstanceImpl(inner1, this.manager())); + } + + public Response getByResourceGroupWithResponse(String resourceGroupName, String name, + Context context) { + Response inner + = this.serviceClient().getByResourceGroupWithResponse(resourceGroupName, name, context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new LightsailInstanceImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public LightsailInstance getByResourceGroup(String resourceGroupName, String name) { + LightsailInstanceInner inner = this.serviceClient().getByResourceGroup(resourceGroupName, name); + if (inner != null) { + return new LightsailInstanceImpl(inner, this.manager()); + } else { + return null; + } + } + + public void deleteByResourceGroup(String resourceGroupName, String name) { + this.serviceClient().delete(resourceGroupName, name); + } + + public void delete(String resourceGroupName, String name, Context context) { + this.serviceClient().delete(resourceGroupName, name, context); + } + + public LightsailInstance getById(String id) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String name = ResourceManagerUtils.getValueFromIdByName(id, "lightsailInstances"); + if (name == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'lightsailInstances'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, name, Context.NONE).getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String name = ResourceManagerUtils.getValueFromIdByName(id, "lightsailInstances"); + if (name == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'lightsailInstances'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, name, context); + } + + public void deleteById(String id) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String name = ResourceManagerUtils.getValueFromIdByName(id, "lightsailInstances"); + if (name == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'lightsailInstances'.", id))); + } + this.delete(resourceGroupName, name, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String name = ResourceManagerUtils.getValueFromIdByName(id, "lightsailInstances"); + if (name == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'lightsailInstances'.", id))); + } + this.delete(resourceGroupName, name, context); + } + + private LightsailInstancesClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.awsconnector.AwsconnectorManager manager() { + return this.serviceManager; + } + + public LightsailInstanceImpl define(String name) { + return new LightsailInstanceImpl(name, this.manager()); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/LogsLogGroupImpl.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/LogsLogGroupImpl.java new file mode 100644 index 000000000000..8d0120194beb --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/LogsLogGroupImpl.java @@ -0,0 +1,177 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.implementation; + +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.awsconnector.fluent.models.LogsLogGroupInner; +import com.azure.resourcemanager.awsconnector.models.LogsLogGroup; +import com.azure.resourcemanager.awsconnector.models.LogsLogGroupProperties; +import com.azure.resourcemanager.awsconnector.models.LogsLogGroupTagsUpdate; +import java.util.Collections; +import java.util.Map; + +public final class LogsLogGroupImpl implements LogsLogGroup, LogsLogGroup.Definition, LogsLogGroup.Update { + private LogsLogGroupInner innerObject; + + private final com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public String location() { + return this.innerModel().location(); + } + + public Map tags() { + Map inner = this.innerModel().tags(); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } + } + + public LogsLogGroupProperties properties() { + return this.innerModel().properties(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public String resourceGroupName() { + return resourceGroupName; + } + + public LogsLogGroupInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.awsconnector.AwsconnectorManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String name; + + private LogsLogGroupTagsUpdate updateProperties; + + public LogsLogGroupImpl withExistingResourceGroup(String resourceGroupName) { + this.resourceGroupName = resourceGroupName; + return this; + } + + public LogsLogGroup create() { + this.innerObject = serviceManager.serviceClient() + .getLogsLogGroups() + .createOrReplace(resourceGroupName, name, this.innerModel(), Context.NONE); + return this; + } + + public LogsLogGroup create(Context context) { + this.innerObject = serviceManager.serviceClient() + .getLogsLogGroups() + .createOrReplace(resourceGroupName, name, this.innerModel(), context); + return this; + } + + LogsLogGroupImpl(String name, com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager) { + this.innerObject = new LogsLogGroupInner(); + this.serviceManager = serviceManager; + this.name = name; + } + + public LogsLogGroupImpl update() { + this.updateProperties = new LogsLogGroupTagsUpdate(); + return this; + } + + public LogsLogGroup apply() { + this.innerObject = serviceManager.serviceClient() + .getLogsLogGroups() + .update(resourceGroupName, name, updateProperties, Context.NONE); + return this; + } + + public LogsLogGroup apply(Context context) { + this.innerObject = serviceManager.serviceClient() + .getLogsLogGroups() + .update(resourceGroupName, name, updateProperties, context); + return this; + } + + LogsLogGroupImpl(LogsLogGroupInner innerObject, + com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.name = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "logsLogGroups"); + } + + public LogsLogGroup refresh() { + this.innerObject = serviceManager.serviceClient() + .getLogsLogGroups() + .getByResourceGroupWithResponse(resourceGroupName, name, Context.NONE) + .getValue(); + return this; + } + + public LogsLogGroup refresh(Context context) { + this.innerObject = serviceManager.serviceClient() + .getLogsLogGroups() + .getByResourceGroupWithResponse(resourceGroupName, name, context) + .getValue(); + return this; + } + + public LogsLogGroupImpl withRegion(Region location) { + this.innerModel().withLocation(location.toString()); + return this; + } + + public LogsLogGroupImpl withRegion(String location) { + this.innerModel().withLocation(location); + return this; + } + + public LogsLogGroupImpl withTags(Map tags) { + if (isInCreateMode()) { + this.innerModel().withTags(tags); + return this; + } else { + this.updateProperties.withTags(tags); + return this; + } + } + + public LogsLogGroupImpl withProperties(LogsLogGroupProperties properties) { + this.innerModel().withProperties(properties); + return this; + } + + private boolean isInCreateMode() { + return this.innerModel().id() == null; + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/LogsLogGroupsClientImpl.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/LogsLogGroupsClientImpl.java new file mode 100644 index 000000000000..a1dffbb11886 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/LogsLogGroupsClientImpl.java @@ -0,0 +1,1278 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.Patch; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.awsconnector.fluent.LogsLogGroupsClient; +import com.azure.resourcemanager.awsconnector.fluent.models.LogsLogGroupInner; +import com.azure.resourcemanager.awsconnector.models.LogsLogGroupListResult; +import com.azure.resourcemanager.awsconnector.models.LogsLogGroupTagsUpdate; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in LogsLogGroupsClient. + */ +public final class LogsLogGroupsClientImpl implements LogsLogGroupsClient { + /** + * The proxy service used to perform REST calls. + */ + private final LogsLogGroupsService service; + + /** + * The service client containing this operation class. + */ + private final MicrosoftAwsConnectorImpl client; + + /** + * Initializes an instance of LogsLogGroupsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + LogsLogGroupsClientImpl(MicrosoftAwsConnectorImpl client) { + this.service + = RestProxy.create(LogsLogGroupsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for MicrosoftAwsConnectorLogsLogGroups to be used by the proxy service to + * perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "MicrosoftAwsConnecto") + public interface LogsLogGroupsService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.AwsConnector/logsLogGroups") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/logsLogGroups") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroup(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/logsLogGroups/{name}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getByResourceGroup(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("name") String name, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/logsLogGroups/{name}") + @ExpectedResponses({ 200, 201 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrReplace(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("name") String name, + @BodyParam("application/json") LogsLogGroupInner resource, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/logsLogGroups/{name}") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> update(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("name") String name, + @BodyParam("application/json") LogsLogGroupTagsUpdate properties, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/logsLogGroups/{name}") + @ExpectedResponses({ 202, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("name") String name, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listBySubscriptionNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroupNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); + } + + /** + * List LogsLogGroup resources by subscription ID. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a LogsLogGroup list operation along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync() { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), + res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List LogsLogGroup resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a LogsLogGroup list operation along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), accept, + context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * List LogsLogGroup resources by subscription ID. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a LogsLogGroup list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>(() -> listSinglePageAsync(), + nextLink -> listBySubscriptionNextSinglePageAsync(nextLink)); + } + + /** + * List LogsLogGroup resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a LogsLogGroup list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(Context context) { + return new PagedFlux<>(() -> listSinglePageAsync(context), + nextLink -> listBySubscriptionNextSinglePageAsync(nextLink, context)); + } + + /** + * List LogsLogGroup resources by subscription ID. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a LogsLogGroup list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + return new PagedIterable<>(listAsync()); + } + + /** + * List LogsLogGroup resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a LogsLogGroup list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Context context) { + return new PagedIterable<>(listAsync(context)); + } + + /** + * List LogsLogGroup resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a LogsLogGroup list operation along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), + res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List LogsLogGroup resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a LogsLogGroup list operation along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * List LogsLogGroup resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a LogsLogGroup list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName) { + return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); + } + + /** + * List LogsLogGroup resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a LogsLogGroup list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName, Context context) { + return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName, context), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink, context)); + } + + /** + * List LogsLogGroup resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a LogsLogGroup list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName)); + } + + /** + * List LogsLogGroup resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a LogsLogGroup list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, context)); + } + + /** + * Get a LogsLogGroup. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of LogsLogGroup. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a LogsLogGroup along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync(String resourceGroupName, + String name) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.getByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get a LogsLogGroup. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of LogsLogGroup. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a LogsLogGroup along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync(String resourceGroupName, String name, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.getByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, accept, context); + } + + /** + * Get a LogsLogGroup. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of LogsLogGroup. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a LogsLogGroup on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getByResourceGroupAsync(String resourceGroupName, String name) { + return getByResourceGroupWithResponseAsync(resourceGroupName, name) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Get a LogsLogGroup. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of LogsLogGroup. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a LogsLogGroup along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getByResourceGroupWithResponse(String resourceGroupName, String name, + Context context) { + return getByResourceGroupWithResponseAsync(resourceGroupName, name, context).block(); + } + + /** + * Get a LogsLogGroup. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of LogsLogGroup. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a LogsLogGroup. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public LogsLogGroupInner getByResourceGroup(String resourceGroupName, String name) { + return getByResourceGroupWithResponse(resourceGroupName, name, Context.NONE).getValue(); + } + + /** + * Create a LogsLogGroup. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of LogsLogGroup. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrReplaceWithResponseAsync(String resourceGroupName, String name, + LogsLogGroupInner resource) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (resource == null) { + return Mono.error(new IllegalArgumentException("Parameter resource is required and cannot be null.")); + } else { + resource.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.createOrReplace(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, resource, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Create a LogsLogGroup. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of LogsLogGroup. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrReplaceWithResponseAsync(String resourceGroupName, String name, + LogsLogGroupInner resource, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (resource == null) { + return Mono.error(new IllegalArgumentException("Parameter resource is required and cannot be null.")); + } else { + resource.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.createOrReplace(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, resource, accept, context); + } + + /** + * Create a LogsLogGroup. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of LogsLogGroup. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, LogsLogGroupInner> + beginCreateOrReplaceAsync(String resourceGroupName, String name, LogsLogGroupInner resource) { + Mono>> mono = createOrReplaceWithResponseAsync(resourceGroupName, name, resource); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + LogsLogGroupInner.class, LogsLogGroupInner.class, this.client.getContext()); + } + + /** + * Create a LogsLogGroup. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of LogsLogGroup. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, LogsLogGroupInner> + beginCreateOrReplaceAsync(String resourceGroupName, String name, LogsLogGroupInner resource, Context context) { + context = this.client.mergeContext(context); + Mono>> mono + = createOrReplaceWithResponseAsync(resourceGroupName, name, resource, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + LogsLogGroupInner.class, LogsLogGroupInner.class, context); + } + + /** + * Create a LogsLogGroup. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of LogsLogGroup. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, LogsLogGroupInner> beginCreateOrReplace(String resourceGroupName, + String name, LogsLogGroupInner resource) { + return this.beginCreateOrReplaceAsync(resourceGroupName, name, resource).getSyncPoller(); + } + + /** + * Create a LogsLogGroup. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of LogsLogGroup. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, LogsLogGroupInner> beginCreateOrReplace(String resourceGroupName, + String name, LogsLogGroupInner resource, Context context) { + return this.beginCreateOrReplaceAsync(resourceGroupName, name, resource, context).getSyncPoller(); + } + + /** + * Create a LogsLogGroup. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of LogsLogGroup. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrReplaceAsync(String resourceGroupName, String name, + LogsLogGroupInner resource) { + return beginCreateOrReplaceAsync(resourceGroupName, name, resource).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create a LogsLogGroup. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of LogsLogGroup. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrReplaceAsync(String resourceGroupName, String name, + LogsLogGroupInner resource, Context context) { + return beginCreateOrReplaceAsync(resourceGroupName, name, resource, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create a LogsLogGroup. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of LogsLogGroup. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public LogsLogGroupInner createOrReplace(String resourceGroupName, String name, LogsLogGroupInner resource) { + return createOrReplaceAsync(resourceGroupName, name, resource).block(); + } + + /** + * Create a LogsLogGroup. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of LogsLogGroup. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public LogsLogGroupInner createOrReplace(String resourceGroupName, String name, LogsLogGroupInner resource, + Context context) { + return createOrReplaceAsync(resourceGroupName, name, resource, context).block(); + } + + /** + * Update a LogsLogGroup. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of LogsLogGroup. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync(String resourceGroupName, String name, + LogsLogGroupTagsUpdate properties) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (properties == null) { + return Mono.error(new IllegalArgumentException("Parameter properties is required and cannot be null.")); + } else { + properties.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.update(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, properties, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Update a LogsLogGroup. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of LogsLogGroup. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync(String resourceGroupName, String name, + LogsLogGroupTagsUpdate properties, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (properties == null) { + return Mono.error(new IllegalArgumentException("Parameter properties is required and cannot be null.")); + } else { + properties.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.update(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, name, properties, accept, context); + } + + /** + * Update a LogsLogGroup. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of LogsLogGroup. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, LogsLogGroupInner> beginUpdateAsync(String resourceGroupName, + String name, LogsLogGroupTagsUpdate properties) { + Mono>> mono = updateWithResponseAsync(resourceGroupName, name, properties); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + LogsLogGroupInner.class, LogsLogGroupInner.class, this.client.getContext()); + } + + /** + * Update a LogsLogGroup. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of LogsLogGroup. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, LogsLogGroupInner> beginUpdateAsync(String resourceGroupName, + String name, LogsLogGroupTagsUpdate properties, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = updateWithResponseAsync(resourceGroupName, name, properties, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + LogsLogGroupInner.class, LogsLogGroupInner.class, context); + } + + /** + * Update a LogsLogGroup. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of LogsLogGroup. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, LogsLogGroupInner> beginUpdate(String resourceGroupName, + String name, LogsLogGroupTagsUpdate properties) { + return this.beginUpdateAsync(resourceGroupName, name, properties).getSyncPoller(); + } + + /** + * Update a LogsLogGroup. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of LogsLogGroup. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, LogsLogGroupInner> beginUpdate(String resourceGroupName, + String name, LogsLogGroupTagsUpdate properties, Context context) { + return this.beginUpdateAsync(resourceGroupName, name, properties, context).getSyncPoller(); + } + + /** + * Update a LogsLogGroup. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of LogsLogGroup. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync(String resourceGroupName, String name, + LogsLogGroupTagsUpdate properties) { + return beginUpdateAsync(resourceGroupName, name, properties).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Update a LogsLogGroup. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of LogsLogGroup. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync(String resourceGroupName, String name, + LogsLogGroupTagsUpdate properties, Context context) { + return beginUpdateAsync(resourceGroupName, name, properties, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Update a LogsLogGroup. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of LogsLogGroup. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public LogsLogGroupInner update(String resourceGroupName, String name, LogsLogGroupTagsUpdate properties) { + return updateAsync(resourceGroupName, name, properties).block(); + } + + /** + * Update a LogsLogGroup. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of LogsLogGroup. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public LogsLogGroupInner update(String resourceGroupName, String name, LogsLogGroupTagsUpdate properties, + Context context) { + return updateAsync(resourceGroupName, name, properties, context).block(); + } + + /** + * Delete a LogsLogGroup. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of LogsLogGroup. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync(String resourceGroupName, String name) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Delete a LogsLogGroup. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of LogsLogGroup. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync(String resourceGroupName, String name, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.delete(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, name, accept, context); + } + + /** + * Delete a LogsLogGroup. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of LogsLogGroup. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String name) { + Mono>> mono = deleteWithResponseAsync(resourceGroupName, name); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); + } + + /** + * Delete a LogsLogGroup. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of LogsLogGroup. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String name, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = deleteWithResponseAsync(resourceGroupName, name, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + context); + } + + /** + * Delete a LogsLogGroup. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of LogsLogGroup. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String name) { + return this.beginDeleteAsync(resourceGroupName, name).getSyncPoller(); + } + + /** + * Delete a LogsLogGroup. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of LogsLogGroup. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String name, Context context) { + return this.beginDeleteAsync(resourceGroupName, name, context).getSyncPoller(); + } + + /** + * Delete a LogsLogGroup. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of LogsLogGroup. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String name) { + return beginDeleteAsync(resourceGroupName, name).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete a LogsLogGroup. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of LogsLogGroup. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String name, Context context) { + return beginDeleteAsync(resourceGroupName, name, context).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete a LogsLogGroup. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of LogsLogGroup. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String name) { + deleteAsync(resourceGroupName, name).block(); + } + + /** + * Delete a LogsLogGroup. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of LogsLogGroup. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String name, Context context) { + deleteAsync(resourceGroupName, name, context).block(); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a LogsLogGroup list operation along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listBySubscriptionNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), + res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a LogsLogGroup list operation along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listBySubscriptionNextSinglePageAsync(String nextLink, + Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a LogsLogGroup list operation along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), + res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a LogsLogGroup list operation along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupNextSinglePageAsync(String nextLink, + Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/LogsLogGroupsImpl.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/LogsLogGroupsImpl.java new file mode 100644 index 000000000000..a59e5a71aaaf --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/LogsLogGroupsImpl.java @@ -0,0 +1,146 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.awsconnector.fluent.LogsLogGroupsClient; +import com.azure.resourcemanager.awsconnector.fluent.models.LogsLogGroupInner; +import com.azure.resourcemanager.awsconnector.models.LogsLogGroup; +import com.azure.resourcemanager.awsconnector.models.LogsLogGroups; + +public final class LogsLogGroupsImpl implements LogsLogGroups { + private static final ClientLogger LOGGER = new ClientLogger(LogsLogGroupsImpl.class); + + private final LogsLogGroupsClient innerClient; + + private final com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager; + + public LogsLogGroupsImpl(LogsLogGroupsClient innerClient, + com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return ResourceManagerUtils.mapPage(inner, inner1 -> new LogsLogGroupImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new LogsLogGroupImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName); + return ResourceManagerUtils.mapPage(inner, inner1 -> new LogsLogGroupImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new LogsLogGroupImpl(inner1, this.manager())); + } + + public Response getByResourceGroupWithResponse(String resourceGroupName, String name, + Context context) { + Response inner + = this.serviceClient().getByResourceGroupWithResponse(resourceGroupName, name, context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new LogsLogGroupImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public LogsLogGroup getByResourceGroup(String resourceGroupName, String name) { + LogsLogGroupInner inner = this.serviceClient().getByResourceGroup(resourceGroupName, name); + if (inner != null) { + return new LogsLogGroupImpl(inner, this.manager()); + } else { + return null; + } + } + + public void deleteByResourceGroup(String resourceGroupName, String name) { + this.serviceClient().delete(resourceGroupName, name); + } + + public void delete(String resourceGroupName, String name, Context context) { + this.serviceClient().delete(resourceGroupName, name, context); + } + + public LogsLogGroup getById(String id) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String name = ResourceManagerUtils.getValueFromIdByName(id, "logsLogGroups"); + if (name == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'logsLogGroups'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, name, Context.NONE).getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String name = ResourceManagerUtils.getValueFromIdByName(id, "logsLogGroups"); + if (name == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'logsLogGroups'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, name, context); + } + + public void deleteById(String id) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String name = ResourceManagerUtils.getValueFromIdByName(id, "logsLogGroups"); + if (name == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'logsLogGroups'.", id))); + } + this.delete(resourceGroupName, name, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String name = ResourceManagerUtils.getValueFromIdByName(id, "logsLogGroups"); + if (name == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'logsLogGroups'.", id))); + } + this.delete(resourceGroupName, name, context); + } + + private LogsLogGroupsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.awsconnector.AwsconnectorManager manager() { + return this.serviceManager; + } + + public LogsLogGroupImpl define(String name) { + return new LogsLogGroupImpl(name, this.manager()); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/LogsLogStreamImpl.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/LogsLogStreamImpl.java new file mode 100644 index 000000000000..4eb59eb3713f --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/LogsLogStreamImpl.java @@ -0,0 +1,177 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.implementation; + +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.awsconnector.fluent.models.LogsLogStreamInner; +import com.azure.resourcemanager.awsconnector.models.LogsLogStream; +import com.azure.resourcemanager.awsconnector.models.LogsLogStreamProperties; +import com.azure.resourcemanager.awsconnector.models.LogsLogStreamTagsUpdate; +import java.util.Collections; +import java.util.Map; + +public final class LogsLogStreamImpl implements LogsLogStream, LogsLogStream.Definition, LogsLogStream.Update { + private LogsLogStreamInner innerObject; + + private final com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public String location() { + return this.innerModel().location(); + } + + public Map tags() { + Map inner = this.innerModel().tags(); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } + } + + public LogsLogStreamProperties properties() { + return this.innerModel().properties(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public String resourceGroupName() { + return resourceGroupName; + } + + public LogsLogStreamInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.awsconnector.AwsconnectorManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String name; + + private LogsLogStreamTagsUpdate updateProperties; + + public LogsLogStreamImpl withExistingResourceGroup(String resourceGroupName) { + this.resourceGroupName = resourceGroupName; + return this; + } + + public LogsLogStream create() { + this.innerObject = serviceManager.serviceClient() + .getLogsLogStreams() + .createOrReplace(resourceGroupName, name, this.innerModel(), Context.NONE); + return this; + } + + public LogsLogStream create(Context context) { + this.innerObject = serviceManager.serviceClient() + .getLogsLogStreams() + .createOrReplace(resourceGroupName, name, this.innerModel(), context); + return this; + } + + LogsLogStreamImpl(String name, com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager) { + this.innerObject = new LogsLogStreamInner(); + this.serviceManager = serviceManager; + this.name = name; + } + + public LogsLogStreamImpl update() { + this.updateProperties = new LogsLogStreamTagsUpdate(); + return this; + } + + public LogsLogStream apply() { + this.innerObject = serviceManager.serviceClient() + .getLogsLogStreams() + .update(resourceGroupName, name, updateProperties, Context.NONE); + return this; + } + + public LogsLogStream apply(Context context) { + this.innerObject = serviceManager.serviceClient() + .getLogsLogStreams() + .update(resourceGroupName, name, updateProperties, context); + return this; + } + + LogsLogStreamImpl(LogsLogStreamInner innerObject, + com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.name = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "logsLogStreams"); + } + + public LogsLogStream refresh() { + this.innerObject = serviceManager.serviceClient() + .getLogsLogStreams() + .getByResourceGroupWithResponse(resourceGroupName, name, Context.NONE) + .getValue(); + return this; + } + + public LogsLogStream refresh(Context context) { + this.innerObject = serviceManager.serviceClient() + .getLogsLogStreams() + .getByResourceGroupWithResponse(resourceGroupName, name, context) + .getValue(); + return this; + } + + public LogsLogStreamImpl withRegion(Region location) { + this.innerModel().withLocation(location.toString()); + return this; + } + + public LogsLogStreamImpl withRegion(String location) { + this.innerModel().withLocation(location); + return this; + } + + public LogsLogStreamImpl withTags(Map tags) { + if (isInCreateMode()) { + this.innerModel().withTags(tags); + return this; + } else { + this.updateProperties.withTags(tags); + return this; + } + } + + public LogsLogStreamImpl withProperties(LogsLogStreamProperties properties) { + this.innerModel().withProperties(properties); + return this; + } + + private boolean isInCreateMode() { + return this.innerModel().id() == null; + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/LogsLogStreamsClientImpl.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/LogsLogStreamsClientImpl.java new file mode 100644 index 000000000000..95917a24a9f8 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/LogsLogStreamsClientImpl.java @@ -0,0 +1,1278 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.Patch; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.awsconnector.fluent.LogsLogStreamsClient; +import com.azure.resourcemanager.awsconnector.fluent.models.LogsLogStreamInner; +import com.azure.resourcemanager.awsconnector.models.LogsLogStreamListResult; +import com.azure.resourcemanager.awsconnector.models.LogsLogStreamTagsUpdate; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in LogsLogStreamsClient. + */ +public final class LogsLogStreamsClientImpl implements LogsLogStreamsClient { + /** + * The proxy service used to perform REST calls. + */ + private final LogsLogStreamsService service; + + /** + * The service client containing this operation class. + */ + private final MicrosoftAwsConnectorImpl client; + + /** + * Initializes an instance of LogsLogStreamsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + LogsLogStreamsClientImpl(MicrosoftAwsConnectorImpl client) { + this.service + = RestProxy.create(LogsLogStreamsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for MicrosoftAwsConnectorLogsLogStreams to be used by the proxy service + * to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "MicrosoftAwsConnecto") + public interface LogsLogStreamsService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.AwsConnector/logsLogStreams") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/logsLogStreams") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroup(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/logsLogStreams/{name}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getByResourceGroup(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("name") String name, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/logsLogStreams/{name}") + @ExpectedResponses({ 200, 201 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrReplace(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("name") String name, + @BodyParam("application/json") LogsLogStreamInner resource, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/logsLogStreams/{name}") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> update(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("name") String name, + @BodyParam("application/json") LogsLogStreamTagsUpdate properties, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/logsLogStreams/{name}") + @ExpectedResponses({ 202, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("name") String name, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listBySubscriptionNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroupNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); + } + + /** + * List LogsLogStream resources by subscription ID. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a LogsLogStream list operation along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync() { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List LogsLogStream resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a LogsLogStream list operation along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), accept, + context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * List LogsLogStream resources by subscription ID. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a LogsLogStream list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>(() -> listSinglePageAsync(), + nextLink -> listBySubscriptionNextSinglePageAsync(nextLink)); + } + + /** + * List LogsLogStream resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a LogsLogStream list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(Context context) { + return new PagedFlux<>(() -> listSinglePageAsync(context), + nextLink -> listBySubscriptionNextSinglePageAsync(nextLink, context)); + } + + /** + * List LogsLogStream resources by subscription ID. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a LogsLogStream list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + return new PagedIterable<>(listAsync()); + } + + /** + * List LogsLogStream resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a LogsLogStream list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Context context) { + return new PagedIterable<>(listAsync(context)); + } + + /** + * List LogsLogStream resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a LogsLogStream list operation along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List LogsLogStream resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a LogsLogStream list operation along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * List LogsLogStream resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a LogsLogStream list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName) { + return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); + } + + /** + * List LogsLogStream resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a LogsLogStream list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName, Context context) { + return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName, context), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink, context)); + } + + /** + * List LogsLogStream resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a LogsLogStream list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName)); + } + + /** + * List LogsLogStream resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a LogsLogStream list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, context)); + } + + /** + * Get a LogsLogStream. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of LogsLogStream. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a LogsLogStream along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync(String resourceGroupName, + String name) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.getByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get a LogsLogStream. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of LogsLogStream. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a LogsLogStream along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync(String resourceGroupName, + String name, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.getByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, accept, context); + } + + /** + * Get a LogsLogStream. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of LogsLogStream. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a LogsLogStream on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getByResourceGroupAsync(String resourceGroupName, String name) { + return getByResourceGroupWithResponseAsync(resourceGroupName, name) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Get a LogsLogStream. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of LogsLogStream. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a LogsLogStream along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getByResourceGroupWithResponse(String resourceGroupName, String name, + Context context) { + return getByResourceGroupWithResponseAsync(resourceGroupName, name, context).block(); + } + + /** + * Get a LogsLogStream. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of LogsLogStream. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a LogsLogStream. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public LogsLogStreamInner getByResourceGroup(String resourceGroupName, String name) { + return getByResourceGroupWithResponse(resourceGroupName, name, Context.NONE).getValue(); + } + + /** + * Create a LogsLogStream. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of LogsLogStream. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrReplaceWithResponseAsync(String resourceGroupName, String name, + LogsLogStreamInner resource) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (resource == null) { + return Mono.error(new IllegalArgumentException("Parameter resource is required and cannot be null.")); + } else { + resource.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.createOrReplace(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, resource, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Create a LogsLogStream. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of LogsLogStream. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrReplaceWithResponseAsync(String resourceGroupName, String name, + LogsLogStreamInner resource, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (resource == null) { + return Mono.error(new IllegalArgumentException("Parameter resource is required and cannot be null.")); + } else { + resource.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.createOrReplace(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, resource, accept, context); + } + + /** + * Create a LogsLogStream. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of LogsLogStream. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, LogsLogStreamInner> + beginCreateOrReplaceAsync(String resourceGroupName, String name, LogsLogStreamInner resource) { + Mono>> mono = createOrReplaceWithResponseAsync(resourceGroupName, name, resource); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + LogsLogStreamInner.class, LogsLogStreamInner.class, this.client.getContext()); + } + + /** + * Create a LogsLogStream. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of LogsLogStream. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, LogsLogStreamInner> + beginCreateOrReplaceAsync(String resourceGroupName, String name, LogsLogStreamInner resource, Context context) { + context = this.client.mergeContext(context); + Mono>> mono + = createOrReplaceWithResponseAsync(resourceGroupName, name, resource, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + LogsLogStreamInner.class, LogsLogStreamInner.class, context); + } + + /** + * Create a LogsLogStream. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of LogsLogStream. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, LogsLogStreamInner> beginCreateOrReplace(String resourceGroupName, + String name, LogsLogStreamInner resource) { + return this.beginCreateOrReplaceAsync(resourceGroupName, name, resource).getSyncPoller(); + } + + /** + * Create a LogsLogStream. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of LogsLogStream. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, LogsLogStreamInner> beginCreateOrReplace(String resourceGroupName, + String name, LogsLogStreamInner resource, Context context) { + return this.beginCreateOrReplaceAsync(resourceGroupName, name, resource, context).getSyncPoller(); + } + + /** + * Create a LogsLogStream. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of LogsLogStream. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrReplaceAsync(String resourceGroupName, String name, + LogsLogStreamInner resource) { + return beginCreateOrReplaceAsync(resourceGroupName, name, resource).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create a LogsLogStream. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of LogsLogStream. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrReplaceAsync(String resourceGroupName, String name, + LogsLogStreamInner resource, Context context) { + return beginCreateOrReplaceAsync(resourceGroupName, name, resource, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create a LogsLogStream. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of LogsLogStream. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public LogsLogStreamInner createOrReplace(String resourceGroupName, String name, LogsLogStreamInner resource) { + return createOrReplaceAsync(resourceGroupName, name, resource).block(); + } + + /** + * Create a LogsLogStream. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of LogsLogStream. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public LogsLogStreamInner createOrReplace(String resourceGroupName, String name, LogsLogStreamInner resource, + Context context) { + return createOrReplaceAsync(resourceGroupName, name, resource, context).block(); + } + + /** + * Update a LogsLogStream. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of LogsLogStream. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync(String resourceGroupName, String name, + LogsLogStreamTagsUpdate properties) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (properties == null) { + return Mono.error(new IllegalArgumentException("Parameter properties is required and cannot be null.")); + } else { + properties.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.update(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, properties, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Update a LogsLogStream. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of LogsLogStream. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync(String resourceGroupName, String name, + LogsLogStreamTagsUpdate properties, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (properties == null) { + return Mono.error(new IllegalArgumentException("Parameter properties is required and cannot be null.")); + } else { + properties.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.update(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, name, properties, accept, context); + } + + /** + * Update a LogsLogStream. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of LogsLogStream. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, LogsLogStreamInner> beginUpdateAsync(String resourceGroupName, + String name, LogsLogStreamTagsUpdate properties) { + Mono>> mono = updateWithResponseAsync(resourceGroupName, name, properties); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + LogsLogStreamInner.class, LogsLogStreamInner.class, this.client.getContext()); + } + + /** + * Update a LogsLogStream. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of LogsLogStream. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, LogsLogStreamInner> beginUpdateAsync(String resourceGroupName, + String name, LogsLogStreamTagsUpdate properties, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = updateWithResponseAsync(resourceGroupName, name, properties, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + LogsLogStreamInner.class, LogsLogStreamInner.class, context); + } + + /** + * Update a LogsLogStream. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of LogsLogStream. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, LogsLogStreamInner> beginUpdate(String resourceGroupName, + String name, LogsLogStreamTagsUpdate properties) { + return this.beginUpdateAsync(resourceGroupName, name, properties).getSyncPoller(); + } + + /** + * Update a LogsLogStream. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of LogsLogStream. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, LogsLogStreamInner> beginUpdate(String resourceGroupName, + String name, LogsLogStreamTagsUpdate properties, Context context) { + return this.beginUpdateAsync(resourceGroupName, name, properties, context).getSyncPoller(); + } + + /** + * Update a LogsLogStream. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of LogsLogStream. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync(String resourceGroupName, String name, + LogsLogStreamTagsUpdate properties) { + return beginUpdateAsync(resourceGroupName, name, properties).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Update a LogsLogStream. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of LogsLogStream. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync(String resourceGroupName, String name, + LogsLogStreamTagsUpdate properties, Context context) { + return beginUpdateAsync(resourceGroupName, name, properties, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Update a LogsLogStream. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of LogsLogStream. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public LogsLogStreamInner update(String resourceGroupName, String name, LogsLogStreamTagsUpdate properties) { + return updateAsync(resourceGroupName, name, properties).block(); + } + + /** + * Update a LogsLogStream. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of LogsLogStream. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public LogsLogStreamInner update(String resourceGroupName, String name, LogsLogStreamTagsUpdate properties, + Context context) { + return updateAsync(resourceGroupName, name, properties, context).block(); + } + + /** + * Delete a LogsLogStream. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of LogsLogStream. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync(String resourceGroupName, String name) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Delete a LogsLogStream. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of LogsLogStream. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync(String resourceGroupName, String name, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.delete(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, name, accept, context); + } + + /** + * Delete a LogsLogStream. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of LogsLogStream. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String name) { + Mono>> mono = deleteWithResponseAsync(resourceGroupName, name); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); + } + + /** + * Delete a LogsLogStream. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of LogsLogStream. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String name, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = deleteWithResponseAsync(resourceGroupName, name, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + context); + } + + /** + * Delete a LogsLogStream. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of LogsLogStream. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String name) { + return this.beginDeleteAsync(resourceGroupName, name).getSyncPoller(); + } + + /** + * Delete a LogsLogStream. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of LogsLogStream. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String name, Context context) { + return this.beginDeleteAsync(resourceGroupName, name, context).getSyncPoller(); + } + + /** + * Delete a LogsLogStream. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of LogsLogStream. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String name) { + return beginDeleteAsync(resourceGroupName, name).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete a LogsLogStream. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of LogsLogStream. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String name, Context context) { + return beginDeleteAsync(resourceGroupName, name, context).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete a LogsLogStream. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of LogsLogStream. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String name) { + deleteAsync(resourceGroupName, name).block(); + } + + /** + * Delete a LogsLogStream. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of LogsLogStream. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String name, Context context) { + deleteAsync(resourceGroupName, name, context).block(); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a LogsLogStream list operation along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listBySubscriptionNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a LogsLogStream list operation along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listBySubscriptionNextSinglePageAsync(String nextLink, + Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a LogsLogStream list operation along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a LogsLogStream list operation along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupNextSinglePageAsync(String nextLink, + Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/LogsLogStreamsImpl.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/LogsLogStreamsImpl.java new file mode 100644 index 000000000000..b2a072ea66c0 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/LogsLogStreamsImpl.java @@ -0,0 +1,146 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.awsconnector.fluent.LogsLogStreamsClient; +import com.azure.resourcemanager.awsconnector.fluent.models.LogsLogStreamInner; +import com.azure.resourcemanager.awsconnector.models.LogsLogStream; +import com.azure.resourcemanager.awsconnector.models.LogsLogStreams; + +public final class LogsLogStreamsImpl implements LogsLogStreams { + private static final ClientLogger LOGGER = new ClientLogger(LogsLogStreamsImpl.class); + + private final LogsLogStreamsClient innerClient; + + private final com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager; + + public LogsLogStreamsImpl(LogsLogStreamsClient innerClient, + com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return ResourceManagerUtils.mapPage(inner, inner1 -> new LogsLogStreamImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new LogsLogStreamImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName); + return ResourceManagerUtils.mapPage(inner, inner1 -> new LogsLogStreamImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new LogsLogStreamImpl(inner1, this.manager())); + } + + public Response getByResourceGroupWithResponse(String resourceGroupName, String name, + Context context) { + Response inner + = this.serviceClient().getByResourceGroupWithResponse(resourceGroupName, name, context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new LogsLogStreamImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public LogsLogStream getByResourceGroup(String resourceGroupName, String name) { + LogsLogStreamInner inner = this.serviceClient().getByResourceGroup(resourceGroupName, name); + if (inner != null) { + return new LogsLogStreamImpl(inner, this.manager()); + } else { + return null; + } + } + + public void deleteByResourceGroup(String resourceGroupName, String name) { + this.serviceClient().delete(resourceGroupName, name); + } + + public void delete(String resourceGroupName, String name, Context context) { + this.serviceClient().delete(resourceGroupName, name, context); + } + + public LogsLogStream getById(String id) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String name = ResourceManagerUtils.getValueFromIdByName(id, "logsLogStreams"); + if (name == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'logsLogStreams'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, name, Context.NONE).getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String name = ResourceManagerUtils.getValueFromIdByName(id, "logsLogStreams"); + if (name == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'logsLogStreams'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, name, context); + } + + public void deleteById(String id) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String name = ResourceManagerUtils.getValueFromIdByName(id, "logsLogStreams"); + if (name == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'logsLogStreams'.", id))); + } + this.delete(resourceGroupName, name, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String name = ResourceManagerUtils.getValueFromIdByName(id, "logsLogStreams"); + if (name == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'logsLogStreams'.", id))); + } + this.delete(resourceGroupName, name, context); + } + + private LogsLogStreamsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.awsconnector.AwsconnectorManager manager() { + return this.serviceManager; + } + + public LogsLogStreamImpl define(String name) { + return new LogsLogStreamImpl(name, this.manager()); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/LogsMetricFilterImpl.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/LogsMetricFilterImpl.java new file mode 100644 index 000000000000..7015cb1ef379 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/LogsMetricFilterImpl.java @@ -0,0 +1,178 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.implementation; + +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.awsconnector.fluent.models.LogsMetricFilterInner; +import com.azure.resourcemanager.awsconnector.models.LogsMetricFilter; +import com.azure.resourcemanager.awsconnector.models.LogsMetricFilterProperties; +import com.azure.resourcemanager.awsconnector.models.LogsMetricFilterTagsUpdate; +import java.util.Collections; +import java.util.Map; + +public final class LogsMetricFilterImpl + implements LogsMetricFilter, LogsMetricFilter.Definition, LogsMetricFilter.Update { + private LogsMetricFilterInner innerObject; + + private final com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public String location() { + return this.innerModel().location(); + } + + public Map tags() { + Map inner = this.innerModel().tags(); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } + } + + public LogsMetricFilterProperties properties() { + return this.innerModel().properties(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public String resourceGroupName() { + return resourceGroupName; + } + + public LogsMetricFilterInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.awsconnector.AwsconnectorManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String name; + + private LogsMetricFilterTagsUpdate updateProperties; + + public LogsMetricFilterImpl withExistingResourceGroup(String resourceGroupName) { + this.resourceGroupName = resourceGroupName; + return this; + } + + public LogsMetricFilter create() { + this.innerObject = serviceManager.serviceClient() + .getLogsMetricFilters() + .createOrReplace(resourceGroupName, name, this.innerModel(), Context.NONE); + return this; + } + + public LogsMetricFilter create(Context context) { + this.innerObject = serviceManager.serviceClient() + .getLogsMetricFilters() + .createOrReplace(resourceGroupName, name, this.innerModel(), context); + return this; + } + + LogsMetricFilterImpl(String name, com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager) { + this.innerObject = new LogsMetricFilterInner(); + this.serviceManager = serviceManager; + this.name = name; + } + + public LogsMetricFilterImpl update() { + this.updateProperties = new LogsMetricFilterTagsUpdate(); + return this; + } + + public LogsMetricFilter apply() { + this.innerObject = serviceManager.serviceClient() + .getLogsMetricFilters() + .update(resourceGroupName, name, updateProperties, Context.NONE); + return this; + } + + public LogsMetricFilter apply(Context context) { + this.innerObject = serviceManager.serviceClient() + .getLogsMetricFilters() + .update(resourceGroupName, name, updateProperties, context); + return this; + } + + LogsMetricFilterImpl(LogsMetricFilterInner innerObject, + com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.name = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "logsMetricFilters"); + } + + public LogsMetricFilter refresh() { + this.innerObject = serviceManager.serviceClient() + .getLogsMetricFilters() + .getByResourceGroupWithResponse(resourceGroupName, name, Context.NONE) + .getValue(); + return this; + } + + public LogsMetricFilter refresh(Context context) { + this.innerObject = serviceManager.serviceClient() + .getLogsMetricFilters() + .getByResourceGroupWithResponse(resourceGroupName, name, context) + .getValue(); + return this; + } + + public LogsMetricFilterImpl withRegion(Region location) { + this.innerModel().withLocation(location.toString()); + return this; + } + + public LogsMetricFilterImpl withRegion(String location) { + this.innerModel().withLocation(location); + return this; + } + + public LogsMetricFilterImpl withTags(Map tags) { + if (isInCreateMode()) { + this.innerModel().withTags(tags); + return this; + } else { + this.updateProperties.withTags(tags); + return this; + } + } + + public LogsMetricFilterImpl withProperties(LogsMetricFilterProperties properties) { + this.innerModel().withProperties(properties); + return this; + } + + private boolean isInCreateMode() { + return this.innerModel().id() == null; + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/LogsMetricFiltersClientImpl.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/LogsMetricFiltersClientImpl.java new file mode 100644 index 000000000000..e77d54382a88 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/LogsMetricFiltersClientImpl.java @@ -0,0 +1,1281 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.Patch; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.awsconnector.fluent.LogsMetricFiltersClient; +import com.azure.resourcemanager.awsconnector.fluent.models.LogsMetricFilterInner; +import com.azure.resourcemanager.awsconnector.models.LogsMetricFilterListResult; +import com.azure.resourcemanager.awsconnector.models.LogsMetricFilterTagsUpdate; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in LogsMetricFiltersClient. + */ +public final class LogsMetricFiltersClientImpl implements LogsMetricFiltersClient { + /** + * The proxy service used to perform REST calls. + */ + private final LogsMetricFiltersService service; + + /** + * The service client containing this operation class. + */ + private final MicrosoftAwsConnectorImpl client; + + /** + * Initializes an instance of LogsMetricFiltersClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + LogsMetricFiltersClientImpl(MicrosoftAwsConnectorImpl client) { + this.service + = RestProxy.create(LogsMetricFiltersService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for MicrosoftAwsConnectorLogsMetricFilters to be used by the proxy + * service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "MicrosoftAwsConnecto") + public interface LogsMetricFiltersService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.AwsConnector/logsMetricFilters") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/logsMetricFilters") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroup(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/logsMetricFilters/{name}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getByResourceGroup(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("name") String name, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/logsMetricFilters/{name}") + @ExpectedResponses({ 200, 201 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrReplace(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("name") String name, + @BodyParam("application/json") LogsMetricFilterInner resource, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/logsMetricFilters/{name}") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> update(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("name") String name, + @BodyParam("application/json") LogsMetricFilterTagsUpdate properties, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/logsMetricFilters/{name}") + @ExpectedResponses({ 202, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("name") String name, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listBySubscriptionNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroupNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); + } + + /** + * List LogsMetricFilter resources by subscription ID. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a LogsMetricFilter list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync() { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List LogsMetricFilter resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a LogsMetricFilter list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), accept, + context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * List LogsMetricFilter resources by subscription ID. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a LogsMetricFilter list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>(() -> listSinglePageAsync(), + nextLink -> listBySubscriptionNextSinglePageAsync(nextLink)); + } + + /** + * List LogsMetricFilter resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a LogsMetricFilter list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(Context context) { + return new PagedFlux<>(() -> listSinglePageAsync(context), + nextLink -> listBySubscriptionNextSinglePageAsync(nextLink, context)); + } + + /** + * List LogsMetricFilter resources by subscription ID. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a LogsMetricFilter list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + return new PagedIterable<>(listAsync()); + } + + /** + * List LogsMetricFilter resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a LogsMetricFilter list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Context context) { + return new PagedIterable<>(listAsync(context)); + } + + /** + * List LogsMetricFilter resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a LogsMetricFilter list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List LogsMetricFilter resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a LogsMetricFilter list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * List LogsMetricFilter resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a LogsMetricFilter list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName) { + return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); + } + + /** + * List LogsMetricFilter resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a LogsMetricFilter list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName, Context context) { + return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName, context), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink, context)); + } + + /** + * List LogsMetricFilter resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a LogsMetricFilter list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName)); + } + + /** + * List LogsMetricFilter resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a LogsMetricFilter list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, context)); + } + + /** + * Get a LogsMetricFilter. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of LogsMetricFilter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a LogsMetricFilter along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync(String resourceGroupName, + String name) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.getByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get a LogsMetricFilter. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of LogsMetricFilter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a LogsMetricFilter along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync(String resourceGroupName, + String name, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.getByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, accept, context); + } + + /** + * Get a LogsMetricFilter. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of LogsMetricFilter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a LogsMetricFilter on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getByResourceGroupAsync(String resourceGroupName, String name) { + return getByResourceGroupWithResponseAsync(resourceGroupName, name) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Get a LogsMetricFilter. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of LogsMetricFilter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a LogsMetricFilter along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getByResourceGroupWithResponse(String resourceGroupName, String name, + Context context) { + return getByResourceGroupWithResponseAsync(resourceGroupName, name, context).block(); + } + + /** + * Get a LogsMetricFilter. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of LogsMetricFilter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a LogsMetricFilter. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public LogsMetricFilterInner getByResourceGroup(String resourceGroupName, String name) { + return getByResourceGroupWithResponse(resourceGroupName, name, Context.NONE).getValue(); + } + + /** + * Create a LogsMetricFilter. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of LogsMetricFilter. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrReplaceWithResponseAsync(String resourceGroupName, String name, + LogsMetricFilterInner resource) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (resource == null) { + return Mono.error(new IllegalArgumentException("Parameter resource is required and cannot be null.")); + } else { + resource.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.createOrReplace(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, resource, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Create a LogsMetricFilter. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of LogsMetricFilter. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrReplaceWithResponseAsync(String resourceGroupName, String name, + LogsMetricFilterInner resource, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (resource == null) { + return Mono.error(new IllegalArgumentException("Parameter resource is required and cannot be null.")); + } else { + resource.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.createOrReplace(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, resource, accept, context); + } + + /** + * Create a LogsMetricFilter. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of LogsMetricFilter. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, LogsMetricFilterInner> + beginCreateOrReplaceAsync(String resourceGroupName, String name, LogsMetricFilterInner resource) { + Mono>> mono = createOrReplaceWithResponseAsync(resourceGroupName, name, resource); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), LogsMetricFilterInner.class, LogsMetricFilterInner.class, + this.client.getContext()); + } + + /** + * Create a LogsMetricFilter. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of LogsMetricFilter. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, LogsMetricFilterInner> beginCreateOrReplaceAsync( + String resourceGroupName, String name, LogsMetricFilterInner resource, Context context) { + context = this.client.mergeContext(context); + Mono>> mono + = createOrReplaceWithResponseAsync(resourceGroupName, name, resource, context); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), LogsMetricFilterInner.class, LogsMetricFilterInner.class, context); + } + + /** + * Create a LogsMetricFilter. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of LogsMetricFilter. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, LogsMetricFilterInner> + beginCreateOrReplace(String resourceGroupName, String name, LogsMetricFilterInner resource) { + return this.beginCreateOrReplaceAsync(resourceGroupName, name, resource).getSyncPoller(); + } + + /** + * Create a LogsMetricFilter. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of LogsMetricFilter. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, LogsMetricFilterInner> + beginCreateOrReplace(String resourceGroupName, String name, LogsMetricFilterInner resource, Context context) { + return this.beginCreateOrReplaceAsync(resourceGroupName, name, resource, context).getSyncPoller(); + } + + /** + * Create a LogsMetricFilter. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of LogsMetricFilter. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrReplaceAsync(String resourceGroupName, String name, + LogsMetricFilterInner resource) { + return beginCreateOrReplaceAsync(resourceGroupName, name, resource).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create a LogsMetricFilter. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of LogsMetricFilter. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrReplaceAsync(String resourceGroupName, String name, + LogsMetricFilterInner resource, Context context) { + return beginCreateOrReplaceAsync(resourceGroupName, name, resource, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create a LogsMetricFilter. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of LogsMetricFilter. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public LogsMetricFilterInner createOrReplace(String resourceGroupName, String name, + LogsMetricFilterInner resource) { + return createOrReplaceAsync(resourceGroupName, name, resource).block(); + } + + /** + * Create a LogsMetricFilter. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of LogsMetricFilter. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public LogsMetricFilterInner createOrReplace(String resourceGroupName, String name, LogsMetricFilterInner resource, + Context context) { + return createOrReplaceAsync(resourceGroupName, name, resource, context).block(); + } + + /** + * Update a LogsMetricFilter. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of LogsMetricFilter. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync(String resourceGroupName, String name, + LogsMetricFilterTagsUpdate properties) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (properties == null) { + return Mono.error(new IllegalArgumentException("Parameter properties is required and cannot be null.")); + } else { + properties.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.update(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, properties, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Update a LogsMetricFilter. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of LogsMetricFilter. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync(String resourceGroupName, String name, + LogsMetricFilterTagsUpdate properties, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (properties == null) { + return Mono.error(new IllegalArgumentException("Parameter properties is required and cannot be null.")); + } else { + properties.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.update(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, name, properties, accept, context); + } + + /** + * Update a LogsMetricFilter. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of LogsMetricFilter. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, LogsMetricFilterInner> + beginUpdateAsync(String resourceGroupName, String name, LogsMetricFilterTagsUpdate properties) { + Mono>> mono = updateWithResponseAsync(resourceGroupName, name, properties); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), LogsMetricFilterInner.class, LogsMetricFilterInner.class, + this.client.getContext()); + } + + /** + * Update a LogsMetricFilter. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of LogsMetricFilter. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, LogsMetricFilterInner> beginUpdateAsync( + String resourceGroupName, String name, LogsMetricFilterTagsUpdate properties, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = updateWithResponseAsync(resourceGroupName, name, properties, context); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), LogsMetricFilterInner.class, LogsMetricFilterInner.class, context); + } + + /** + * Update a LogsMetricFilter. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of LogsMetricFilter. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, LogsMetricFilterInner> beginUpdate(String resourceGroupName, + String name, LogsMetricFilterTagsUpdate properties) { + return this.beginUpdateAsync(resourceGroupName, name, properties).getSyncPoller(); + } + + /** + * Update a LogsMetricFilter. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of LogsMetricFilter. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, LogsMetricFilterInner> beginUpdate(String resourceGroupName, + String name, LogsMetricFilterTagsUpdate properties, Context context) { + return this.beginUpdateAsync(resourceGroupName, name, properties, context).getSyncPoller(); + } + + /** + * Update a LogsMetricFilter. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of LogsMetricFilter. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync(String resourceGroupName, String name, + LogsMetricFilterTagsUpdate properties) { + return beginUpdateAsync(resourceGroupName, name, properties).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Update a LogsMetricFilter. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of LogsMetricFilter. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync(String resourceGroupName, String name, + LogsMetricFilterTagsUpdate properties, Context context) { + return beginUpdateAsync(resourceGroupName, name, properties, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Update a LogsMetricFilter. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of LogsMetricFilter. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public LogsMetricFilterInner update(String resourceGroupName, String name, LogsMetricFilterTagsUpdate properties) { + return updateAsync(resourceGroupName, name, properties).block(); + } + + /** + * Update a LogsMetricFilter. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of LogsMetricFilter. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public LogsMetricFilterInner update(String resourceGroupName, String name, LogsMetricFilterTagsUpdate properties, + Context context) { + return updateAsync(resourceGroupName, name, properties, context).block(); + } + + /** + * Delete a LogsMetricFilter. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of LogsMetricFilter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync(String resourceGroupName, String name) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Delete a LogsMetricFilter. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of LogsMetricFilter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync(String resourceGroupName, String name, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.delete(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, name, accept, context); + } + + /** + * Delete a LogsMetricFilter. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of LogsMetricFilter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String name) { + Mono>> mono = deleteWithResponseAsync(resourceGroupName, name); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); + } + + /** + * Delete a LogsMetricFilter. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of LogsMetricFilter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String name, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = deleteWithResponseAsync(resourceGroupName, name, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + context); + } + + /** + * Delete a LogsMetricFilter. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of LogsMetricFilter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String name) { + return this.beginDeleteAsync(resourceGroupName, name).getSyncPoller(); + } + + /** + * Delete a LogsMetricFilter. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of LogsMetricFilter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String name, Context context) { + return this.beginDeleteAsync(resourceGroupName, name, context).getSyncPoller(); + } + + /** + * Delete a LogsMetricFilter. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of LogsMetricFilter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String name) { + return beginDeleteAsync(resourceGroupName, name).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete a LogsMetricFilter. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of LogsMetricFilter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String name, Context context) { + return beginDeleteAsync(resourceGroupName, name, context).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete a LogsMetricFilter. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of LogsMetricFilter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String name) { + deleteAsync(resourceGroupName, name).block(); + } + + /** + * Delete a LogsMetricFilter. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of LogsMetricFilter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String name, Context context) { + deleteAsync(resourceGroupName, name, context).block(); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a LogsMetricFilter list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listBySubscriptionNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a LogsMetricFilter list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listBySubscriptionNextSinglePageAsync(String nextLink, + Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a LogsMetricFilter list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a LogsMetricFilter list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupNextSinglePageAsync(String nextLink, + Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/LogsMetricFiltersImpl.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/LogsMetricFiltersImpl.java new file mode 100644 index 000000000000..373fca9ba9db --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/LogsMetricFiltersImpl.java @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.awsconnector.fluent.LogsMetricFiltersClient; +import com.azure.resourcemanager.awsconnector.fluent.models.LogsMetricFilterInner; +import com.azure.resourcemanager.awsconnector.models.LogsMetricFilter; +import com.azure.resourcemanager.awsconnector.models.LogsMetricFilters; + +public final class LogsMetricFiltersImpl implements LogsMetricFilters { + private static final ClientLogger LOGGER = new ClientLogger(LogsMetricFiltersImpl.class); + + private final LogsMetricFiltersClient innerClient; + + private final com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager; + + public LogsMetricFiltersImpl(LogsMetricFiltersClient innerClient, + com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return ResourceManagerUtils.mapPage(inner, inner1 -> new LogsMetricFilterImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new LogsMetricFilterImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName); + return ResourceManagerUtils.mapPage(inner, inner1 -> new LogsMetricFilterImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + PagedIterable inner + = this.serviceClient().listByResourceGroup(resourceGroupName, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new LogsMetricFilterImpl(inner1, this.manager())); + } + + public Response getByResourceGroupWithResponse(String resourceGroupName, String name, + Context context) { + Response inner + = this.serviceClient().getByResourceGroupWithResponse(resourceGroupName, name, context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new LogsMetricFilterImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public LogsMetricFilter getByResourceGroup(String resourceGroupName, String name) { + LogsMetricFilterInner inner = this.serviceClient().getByResourceGroup(resourceGroupName, name); + if (inner != null) { + return new LogsMetricFilterImpl(inner, this.manager()); + } else { + return null; + } + } + + public void deleteByResourceGroup(String resourceGroupName, String name) { + this.serviceClient().delete(resourceGroupName, name); + } + + public void delete(String resourceGroupName, String name, Context context) { + this.serviceClient().delete(resourceGroupName, name, context); + } + + public LogsMetricFilter getById(String id) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String name = ResourceManagerUtils.getValueFromIdByName(id, "logsMetricFilters"); + if (name == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'logsMetricFilters'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, name, Context.NONE).getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String name = ResourceManagerUtils.getValueFromIdByName(id, "logsMetricFilters"); + if (name == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'logsMetricFilters'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, name, context); + } + + public void deleteById(String id) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String name = ResourceManagerUtils.getValueFromIdByName(id, "logsMetricFilters"); + if (name == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'logsMetricFilters'.", id))); + } + this.delete(resourceGroupName, name, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String name = ResourceManagerUtils.getValueFromIdByName(id, "logsMetricFilters"); + if (name == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'logsMetricFilters'.", id))); + } + this.delete(resourceGroupName, name, context); + } + + private LogsMetricFiltersClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.awsconnector.AwsconnectorManager manager() { + return this.serviceManager; + } + + public LogsMetricFilterImpl define(String name) { + return new LogsMetricFilterImpl(name, this.manager()); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/LogsSubscriptionFilterImpl.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/LogsSubscriptionFilterImpl.java new file mode 100644 index 000000000000..f169ac3e051b --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/LogsSubscriptionFilterImpl.java @@ -0,0 +1,178 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.implementation; + +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.awsconnector.fluent.models.LogsSubscriptionFilterInner; +import com.azure.resourcemanager.awsconnector.models.LogsSubscriptionFilter; +import com.azure.resourcemanager.awsconnector.models.LogsSubscriptionFilterProperties; +import com.azure.resourcemanager.awsconnector.models.LogsSubscriptionFilterTagsUpdate; +import java.util.Collections; +import java.util.Map; + +public final class LogsSubscriptionFilterImpl + implements LogsSubscriptionFilter, LogsSubscriptionFilter.Definition, LogsSubscriptionFilter.Update { + private LogsSubscriptionFilterInner innerObject; + + private final com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public String location() { + return this.innerModel().location(); + } + + public Map tags() { + Map inner = this.innerModel().tags(); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } + } + + public LogsSubscriptionFilterProperties properties() { + return this.innerModel().properties(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public String resourceGroupName() { + return resourceGroupName; + } + + public LogsSubscriptionFilterInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.awsconnector.AwsconnectorManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String name; + + private LogsSubscriptionFilterTagsUpdate updateProperties; + + public LogsSubscriptionFilterImpl withExistingResourceGroup(String resourceGroupName) { + this.resourceGroupName = resourceGroupName; + return this; + } + + public LogsSubscriptionFilter create() { + this.innerObject = serviceManager.serviceClient() + .getLogsSubscriptionFilters() + .createOrReplace(resourceGroupName, name, this.innerModel(), Context.NONE); + return this; + } + + public LogsSubscriptionFilter create(Context context) { + this.innerObject = serviceManager.serviceClient() + .getLogsSubscriptionFilters() + .createOrReplace(resourceGroupName, name, this.innerModel(), context); + return this; + } + + LogsSubscriptionFilterImpl(String name, com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager) { + this.innerObject = new LogsSubscriptionFilterInner(); + this.serviceManager = serviceManager; + this.name = name; + } + + public LogsSubscriptionFilterImpl update() { + this.updateProperties = new LogsSubscriptionFilterTagsUpdate(); + return this; + } + + public LogsSubscriptionFilter apply() { + this.innerObject = serviceManager.serviceClient() + .getLogsSubscriptionFilters() + .update(resourceGroupName, name, updateProperties, Context.NONE); + return this; + } + + public LogsSubscriptionFilter apply(Context context) { + this.innerObject = serviceManager.serviceClient() + .getLogsSubscriptionFilters() + .update(resourceGroupName, name, updateProperties, context); + return this; + } + + LogsSubscriptionFilterImpl(LogsSubscriptionFilterInner innerObject, + com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.name = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "logsSubscriptionFilters"); + } + + public LogsSubscriptionFilter refresh() { + this.innerObject = serviceManager.serviceClient() + .getLogsSubscriptionFilters() + .getByResourceGroupWithResponse(resourceGroupName, name, Context.NONE) + .getValue(); + return this; + } + + public LogsSubscriptionFilter refresh(Context context) { + this.innerObject = serviceManager.serviceClient() + .getLogsSubscriptionFilters() + .getByResourceGroupWithResponse(resourceGroupName, name, context) + .getValue(); + return this; + } + + public LogsSubscriptionFilterImpl withRegion(Region location) { + this.innerModel().withLocation(location.toString()); + return this; + } + + public LogsSubscriptionFilterImpl withRegion(String location) { + this.innerModel().withLocation(location); + return this; + } + + public LogsSubscriptionFilterImpl withTags(Map tags) { + if (isInCreateMode()) { + this.innerModel().withTags(tags); + return this; + } else { + this.updateProperties.withTags(tags); + return this; + } + } + + public LogsSubscriptionFilterImpl withProperties(LogsSubscriptionFilterProperties properties) { + this.innerModel().withProperties(properties); + return this; + } + + private boolean isInCreateMode() { + return this.innerModel().id() == null; + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/LogsSubscriptionFiltersClientImpl.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/LogsSubscriptionFiltersClientImpl.java new file mode 100644 index 000000000000..5c9ca75095ac --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/LogsSubscriptionFiltersClientImpl.java @@ -0,0 +1,1285 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.Patch; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.awsconnector.fluent.LogsSubscriptionFiltersClient; +import com.azure.resourcemanager.awsconnector.fluent.models.LogsSubscriptionFilterInner; +import com.azure.resourcemanager.awsconnector.models.LogsSubscriptionFilterListResult; +import com.azure.resourcemanager.awsconnector.models.LogsSubscriptionFilterTagsUpdate; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in LogsSubscriptionFiltersClient. + */ +public final class LogsSubscriptionFiltersClientImpl implements LogsSubscriptionFiltersClient { + /** + * The proxy service used to perform REST calls. + */ + private final LogsSubscriptionFiltersService service; + + /** + * The service client containing this operation class. + */ + private final MicrosoftAwsConnectorImpl client; + + /** + * Initializes an instance of LogsSubscriptionFiltersClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + LogsSubscriptionFiltersClientImpl(MicrosoftAwsConnectorImpl client) { + this.service = RestProxy.create(LogsSubscriptionFiltersService.class, client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for MicrosoftAwsConnectorLogsSubscriptionFilters to be used by the proxy + * service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "MicrosoftAwsConnecto") + public interface LogsSubscriptionFiltersService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.AwsConnector/logsSubscriptionFilters") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/logsSubscriptionFilters") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroup(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/logsSubscriptionFilters/{name}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getByResourceGroup(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("name") String name, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/logsSubscriptionFilters/{name}") + @ExpectedResponses({ 200, 201 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrReplace(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("name") String name, + @BodyParam("application/json") LogsSubscriptionFilterInner resource, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/logsSubscriptionFilters/{name}") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> update(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("name") String name, + @BodyParam("application/json") LogsSubscriptionFilterTagsUpdate properties, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/logsSubscriptionFilters/{name}") + @ExpectedResponses({ 202, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("name") String name, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listBySubscriptionNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroupNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); + } + + /** + * List LogsSubscriptionFilter resources by subscription ID. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a LogsSubscriptionFilter list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync() { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List LogsSubscriptionFilter resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a LogsSubscriptionFilter list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), accept, + context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * List LogsSubscriptionFilter resources by subscription ID. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a LogsSubscriptionFilter list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>(() -> listSinglePageAsync(), + nextLink -> listBySubscriptionNextSinglePageAsync(nextLink)); + } + + /** + * List LogsSubscriptionFilter resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a LogsSubscriptionFilter list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(Context context) { + return new PagedFlux<>(() -> listSinglePageAsync(context), + nextLink -> listBySubscriptionNextSinglePageAsync(nextLink, context)); + } + + /** + * List LogsSubscriptionFilter resources by subscription ID. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a LogsSubscriptionFilter list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + return new PagedIterable<>(listAsync()); + } + + /** + * List LogsSubscriptionFilter resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a LogsSubscriptionFilter list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Context context) { + return new PagedIterable<>(listAsync(context)); + } + + /** + * List LogsSubscriptionFilter resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a LogsSubscriptionFilter list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> + listByResourceGroupSinglePageAsync(String resourceGroupName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List LogsSubscriptionFilter resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a LogsSubscriptionFilter list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> + listByResourceGroupSinglePageAsync(String resourceGroupName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * List LogsSubscriptionFilter resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a LogsSubscriptionFilter list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName) { + return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); + } + + /** + * List LogsSubscriptionFilter resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a LogsSubscriptionFilter list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName, Context context) { + return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName, context), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink, context)); + } + + /** + * List LogsSubscriptionFilter resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a LogsSubscriptionFilter list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName)); + } + + /** + * List LogsSubscriptionFilter resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a LogsSubscriptionFilter list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, context)); + } + + /** + * Get a LogsSubscriptionFilter. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of LogsSubscriptionFilter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a LogsSubscriptionFilter along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync(String resourceGroupName, + String name) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.getByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get a LogsSubscriptionFilter. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of LogsSubscriptionFilter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a LogsSubscriptionFilter along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync(String resourceGroupName, + String name, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.getByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, accept, context); + } + + /** + * Get a LogsSubscriptionFilter. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of LogsSubscriptionFilter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a LogsSubscriptionFilter on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getByResourceGroupAsync(String resourceGroupName, String name) { + return getByResourceGroupWithResponseAsync(resourceGroupName, name) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Get a LogsSubscriptionFilter. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of LogsSubscriptionFilter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a LogsSubscriptionFilter along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getByResourceGroupWithResponse(String resourceGroupName, String name, + Context context) { + return getByResourceGroupWithResponseAsync(resourceGroupName, name, context).block(); + } + + /** + * Get a LogsSubscriptionFilter. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of LogsSubscriptionFilter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a LogsSubscriptionFilter. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public LogsSubscriptionFilterInner getByResourceGroup(String resourceGroupName, String name) { + return getByResourceGroupWithResponse(resourceGroupName, name, Context.NONE).getValue(); + } + + /** + * Create a LogsSubscriptionFilter. Please note that end user resource creation is currently restricted, but it will + * be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of LogsSubscriptionFilter. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrReplaceWithResponseAsync(String resourceGroupName, String name, + LogsSubscriptionFilterInner resource) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (resource == null) { + return Mono.error(new IllegalArgumentException("Parameter resource is required and cannot be null.")); + } else { + resource.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.createOrReplace(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, resource, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Create a LogsSubscriptionFilter. Please note that end user resource creation is currently restricted, but it will + * be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of LogsSubscriptionFilter. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrReplaceWithResponseAsync(String resourceGroupName, String name, + LogsSubscriptionFilterInner resource, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (resource == null) { + return Mono.error(new IllegalArgumentException("Parameter resource is required and cannot be null.")); + } else { + resource.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.createOrReplace(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, resource, accept, context); + } + + /** + * Create a LogsSubscriptionFilter. Please note that end user resource creation is currently restricted, but it will + * be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of LogsSubscriptionFilter. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, LogsSubscriptionFilterInner> + beginCreateOrReplaceAsync(String resourceGroupName, String name, LogsSubscriptionFilterInner resource) { + Mono>> mono = createOrReplaceWithResponseAsync(resourceGroupName, name, resource); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), LogsSubscriptionFilterInner.class, LogsSubscriptionFilterInner.class, + this.client.getContext()); + } + + /** + * Create a LogsSubscriptionFilter. Please note that end user resource creation is currently restricted, but it will + * be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of LogsSubscriptionFilter. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, LogsSubscriptionFilterInner> beginCreateOrReplaceAsync( + String resourceGroupName, String name, LogsSubscriptionFilterInner resource, Context context) { + context = this.client.mergeContext(context); + Mono>> mono + = createOrReplaceWithResponseAsync(resourceGroupName, name, resource, context); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), LogsSubscriptionFilterInner.class, LogsSubscriptionFilterInner.class, + context); + } + + /** + * Create a LogsSubscriptionFilter. Please note that end user resource creation is currently restricted, but it will + * be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of LogsSubscriptionFilter. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, LogsSubscriptionFilterInner> + beginCreateOrReplace(String resourceGroupName, String name, LogsSubscriptionFilterInner resource) { + return this.beginCreateOrReplaceAsync(resourceGroupName, name, resource).getSyncPoller(); + } + + /** + * Create a LogsSubscriptionFilter. Please note that end user resource creation is currently restricted, but it will + * be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of LogsSubscriptionFilter. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, LogsSubscriptionFilterInner> beginCreateOrReplace( + String resourceGroupName, String name, LogsSubscriptionFilterInner resource, Context context) { + return this.beginCreateOrReplaceAsync(resourceGroupName, name, resource, context).getSyncPoller(); + } + + /** + * Create a LogsSubscriptionFilter. Please note that end user resource creation is currently restricted, but it will + * be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of LogsSubscriptionFilter. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrReplaceAsync(String resourceGroupName, String name, + LogsSubscriptionFilterInner resource) { + return beginCreateOrReplaceAsync(resourceGroupName, name, resource).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create a LogsSubscriptionFilter. Please note that end user resource creation is currently restricted, but it will + * be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of LogsSubscriptionFilter. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrReplaceAsync(String resourceGroupName, String name, + LogsSubscriptionFilterInner resource, Context context) { + return beginCreateOrReplaceAsync(resourceGroupName, name, resource, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create a LogsSubscriptionFilter. Please note that end user resource creation is currently restricted, but it will + * be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of LogsSubscriptionFilter. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public LogsSubscriptionFilterInner createOrReplace(String resourceGroupName, String name, + LogsSubscriptionFilterInner resource) { + return createOrReplaceAsync(resourceGroupName, name, resource).block(); + } + + /** + * Create a LogsSubscriptionFilter. Please note that end user resource creation is currently restricted, but it will + * be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of LogsSubscriptionFilter. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public LogsSubscriptionFilterInner createOrReplace(String resourceGroupName, String name, + LogsSubscriptionFilterInner resource, Context context) { + return createOrReplaceAsync(resourceGroupName, name, resource, context).block(); + } + + /** + * Update a LogsSubscriptionFilter. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of LogsSubscriptionFilter. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync(String resourceGroupName, String name, + LogsSubscriptionFilterTagsUpdate properties) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (properties == null) { + return Mono.error(new IllegalArgumentException("Parameter properties is required and cannot be null.")); + } else { + properties.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.update(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, properties, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Update a LogsSubscriptionFilter. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of LogsSubscriptionFilter. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync(String resourceGroupName, String name, + LogsSubscriptionFilterTagsUpdate properties, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (properties == null) { + return Mono.error(new IllegalArgumentException("Parameter properties is required and cannot be null.")); + } else { + properties.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.update(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, name, properties, accept, context); + } + + /** + * Update a LogsSubscriptionFilter. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of LogsSubscriptionFilter. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, LogsSubscriptionFilterInner> + beginUpdateAsync(String resourceGroupName, String name, LogsSubscriptionFilterTagsUpdate properties) { + Mono>> mono = updateWithResponseAsync(resourceGroupName, name, properties); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), LogsSubscriptionFilterInner.class, LogsSubscriptionFilterInner.class, + this.client.getContext()); + } + + /** + * Update a LogsSubscriptionFilter. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of LogsSubscriptionFilter. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, LogsSubscriptionFilterInner> beginUpdateAsync( + String resourceGroupName, String name, LogsSubscriptionFilterTagsUpdate properties, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = updateWithResponseAsync(resourceGroupName, name, properties, context); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), LogsSubscriptionFilterInner.class, LogsSubscriptionFilterInner.class, + context); + } + + /** + * Update a LogsSubscriptionFilter. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of LogsSubscriptionFilter. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, LogsSubscriptionFilterInner> + beginUpdate(String resourceGroupName, String name, LogsSubscriptionFilterTagsUpdate properties) { + return this.beginUpdateAsync(resourceGroupName, name, properties).getSyncPoller(); + } + + /** + * Update a LogsSubscriptionFilter. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of LogsSubscriptionFilter. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, LogsSubscriptionFilterInner> beginUpdate( + String resourceGroupName, String name, LogsSubscriptionFilterTagsUpdate properties, Context context) { + return this.beginUpdateAsync(resourceGroupName, name, properties, context).getSyncPoller(); + } + + /** + * Update a LogsSubscriptionFilter. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of LogsSubscriptionFilter. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync(String resourceGroupName, String name, + LogsSubscriptionFilterTagsUpdate properties) { + return beginUpdateAsync(resourceGroupName, name, properties).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Update a LogsSubscriptionFilter. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of LogsSubscriptionFilter. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync(String resourceGroupName, String name, + LogsSubscriptionFilterTagsUpdate properties, Context context) { + return beginUpdateAsync(resourceGroupName, name, properties, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Update a LogsSubscriptionFilter. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of LogsSubscriptionFilter. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public LogsSubscriptionFilterInner update(String resourceGroupName, String name, + LogsSubscriptionFilterTagsUpdate properties) { + return updateAsync(resourceGroupName, name, properties).block(); + } + + /** + * Update a LogsSubscriptionFilter. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of LogsSubscriptionFilter. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public LogsSubscriptionFilterInner update(String resourceGroupName, String name, + LogsSubscriptionFilterTagsUpdate properties, Context context) { + return updateAsync(resourceGroupName, name, properties, context).block(); + } + + /** + * Delete a LogsSubscriptionFilter. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of LogsSubscriptionFilter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync(String resourceGroupName, String name) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Delete a LogsSubscriptionFilter. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of LogsSubscriptionFilter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync(String resourceGroupName, String name, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.delete(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, name, accept, context); + } + + /** + * Delete a LogsSubscriptionFilter. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of LogsSubscriptionFilter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String name) { + Mono>> mono = deleteWithResponseAsync(resourceGroupName, name); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); + } + + /** + * Delete a LogsSubscriptionFilter. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of LogsSubscriptionFilter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String name, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = deleteWithResponseAsync(resourceGroupName, name, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + context); + } + + /** + * Delete a LogsSubscriptionFilter. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of LogsSubscriptionFilter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String name) { + return this.beginDeleteAsync(resourceGroupName, name).getSyncPoller(); + } + + /** + * Delete a LogsSubscriptionFilter. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of LogsSubscriptionFilter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String name, Context context) { + return this.beginDeleteAsync(resourceGroupName, name, context).getSyncPoller(); + } + + /** + * Delete a LogsSubscriptionFilter. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of LogsSubscriptionFilter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String name) { + return beginDeleteAsync(resourceGroupName, name).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete a LogsSubscriptionFilter. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of LogsSubscriptionFilter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String name, Context context) { + return beginDeleteAsync(resourceGroupName, name, context).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete a LogsSubscriptionFilter. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of LogsSubscriptionFilter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String name) { + deleteAsync(resourceGroupName, name).block(); + } + + /** + * Delete a LogsSubscriptionFilter. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of LogsSubscriptionFilter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String name, Context context) { + deleteAsync(resourceGroupName, name, context).block(); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a LogsSubscriptionFilter list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listBySubscriptionNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a LogsSubscriptionFilter list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listBySubscriptionNextSinglePageAsync(String nextLink, + Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a LogsSubscriptionFilter list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a LogsSubscriptionFilter list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupNextSinglePageAsync(String nextLink, + Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/LogsSubscriptionFiltersImpl.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/LogsSubscriptionFiltersImpl.java new file mode 100644 index 000000000000..aa7fd573653e --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/LogsSubscriptionFiltersImpl.java @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.awsconnector.fluent.LogsSubscriptionFiltersClient; +import com.azure.resourcemanager.awsconnector.fluent.models.LogsSubscriptionFilterInner; +import com.azure.resourcemanager.awsconnector.models.LogsSubscriptionFilter; +import com.azure.resourcemanager.awsconnector.models.LogsSubscriptionFilters; + +public final class LogsSubscriptionFiltersImpl implements LogsSubscriptionFilters { + private static final ClientLogger LOGGER = new ClientLogger(LogsSubscriptionFiltersImpl.class); + + private final LogsSubscriptionFiltersClient innerClient; + + private final com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager; + + public LogsSubscriptionFiltersImpl(LogsSubscriptionFiltersClient innerClient, + com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return ResourceManagerUtils.mapPage(inner, inner1 -> new LogsSubscriptionFilterImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new LogsSubscriptionFilterImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName); + return ResourceManagerUtils.mapPage(inner, inner1 -> new LogsSubscriptionFilterImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + PagedIterable inner + = this.serviceClient().listByResourceGroup(resourceGroupName, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new LogsSubscriptionFilterImpl(inner1, this.manager())); + } + + public Response getByResourceGroupWithResponse(String resourceGroupName, String name, + Context context) { + Response inner + = this.serviceClient().getByResourceGroupWithResponse(resourceGroupName, name, context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new LogsSubscriptionFilterImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public LogsSubscriptionFilter getByResourceGroup(String resourceGroupName, String name) { + LogsSubscriptionFilterInner inner = this.serviceClient().getByResourceGroup(resourceGroupName, name); + if (inner != null) { + return new LogsSubscriptionFilterImpl(inner, this.manager()); + } else { + return null; + } + } + + public void deleteByResourceGroup(String resourceGroupName, String name) { + this.serviceClient().delete(resourceGroupName, name); + } + + public void delete(String resourceGroupName, String name, Context context) { + this.serviceClient().delete(resourceGroupName, name, context); + } + + public LogsSubscriptionFilter getById(String id) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String name = ResourceManagerUtils.getValueFromIdByName(id, "logsSubscriptionFilters"); + if (name == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException(String + .format("The resource ID '%s' is not valid. Missing path segment 'logsSubscriptionFilters'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, name, Context.NONE).getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String name = ResourceManagerUtils.getValueFromIdByName(id, "logsSubscriptionFilters"); + if (name == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException(String + .format("The resource ID '%s' is not valid. Missing path segment 'logsSubscriptionFilters'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, name, context); + } + + public void deleteById(String id) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String name = ResourceManagerUtils.getValueFromIdByName(id, "logsSubscriptionFilters"); + if (name == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException(String + .format("The resource ID '%s' is not valid. Missing path segment 'logsSubscriptionFilters'.", id))); + } + this.delete(resourceGroupName, name, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String name = ResourceManagerUtils.getValueFromIdByName(id, "logsSubscriptionFilters"); + if (name == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException(String + .format("The resource ID '%s' is not valid. Missing path segment 'logsSubscriptionFilters'.", id))); + } + this.delete(resourceGroupName, name, context); + } + + private LogsSubscriptionFiltersClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.awsconnector.AwsconnectorManager manager() { + return this.serviceManager; + } + + public LogsSubscriptionFilterImpl define(String name) { + return new LogsSubscriptionFilterImpl(name, this.manager()); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/Macie2JobSummariesClientImpl.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/Macie2JobSummariesClientImpl.java new file mode 100644 index 000000000000..bfe8fd0a57d0 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/Macie2JobSummariesClientImpl.java @@ -0,0 +1,1281 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.Patch; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.awsconnector.fluent.Macie2JobSummariesClient; +import com.azure.resourcemanager.awsconnector.fluent.models.Macie2JobSummaryInner; +import com.azure.resourcemanager.awsconnector.models.Macie2JobSummaryListResult; +import com.azure.resourcemanager.awsconnector.models.Macie2JobSummaryTagsUpdate; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in Macie2JobSummariesClient. + */ +public final class Macie2JobSummariesClientImpl implements Macie2JobSummariesClient { + /** + * The proxy service used to perform REST calls. + */ + private final Macie2JobSummariesService service; + + /** + * The service client containing this operation class. + */ + private final MicrosoftAwsConnectorImpl client; + + /** + * Initializes an instance of Macie2JobSummariesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + Macie2JobSummariesClientImpl(MicrosoftAwsConnectorImpl client) { + this.service = RestProxy.create(Macie2JobSummariesService.class, client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for MicrosoftAwsConnectorMacie2JobSummaries to be used by the proxy + * service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "MicrosoftAwsConnecto") + public interface Macie2JobSummariesService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.AwsConnector/macie2JobSummaries") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/macie2JobSummaries") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroup(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/macie2JobSummaries/{name}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getByResourceGroup(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("name") String name, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/macie2JobSummaries/{name}") + @ExpectedResponses({ 200, 201 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrReplace(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("name") String name, + @BodyParam("application/json") Macie2JobSummaryInner resource, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/macie2JobSummaries/{name}") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> update(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("name") String name, + @BodyParam("application/json") Macie2JobSummaryTagsUpdate properties, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/macie2JobSummaries/{name}") + @ExpectedResponses({ 202, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("name") String name, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listBySubscriptionNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroupNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); + } + + /** + * List Macie2JobSummary resources by subscription ID. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Macie2JobSummary list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync() { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List Macie2JobSummary resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Macie2JobSummary list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), accept, + context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * List Macie2JobSummary resources by subscription ID. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Macie2JobSummary list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>(() -> listSinglePageAsync(), + nextLink -> listBySubscriptionNextSinglePageAsync(nextLink)); + } + + /** + * List Macie2JobSummary resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Macie2JobSummary list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(Context context) { + return new PagedFlux<>(() -> listSinglePageAsync(context), + nextLink -> listBySubscriptionNextSinglePageAsync(nextLink, context)); + } + + /** + * List Macie2JobSummary resources by subscription ID. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Macie2JobSummary list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + return new PagedIterable<>(listAsync()); + } + + /** + * List Macie2JobSummary resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Macie2JobSummary list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Context context) { + return new PagedIterable<>(listAsync(context)); + } + + /** + * List Macie2JobSummary resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Macie2JobSummary list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List Macie2JobSummary resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Macie2JobSummary list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * List Macie2JobSummary resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Macie2JobSummary list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName) { + return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); + } + + /** + * List Macie2JobSummary resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Macie2JobSummary list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName, Context context) { + return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName, context), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink, context)); + } + + /** + * List Macie2JobSummary resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Macie2JobSummary list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName)); + } + + /** + * List Macie2JobSummary resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Macie2JobSummary list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, context)); + } + + /** + * Get a Macie2JobSummary. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Macie2JobSummary. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Macie2JobSummary along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync(String resourceGroupName, + String name) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.getByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get a Macie2JobSummary. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Macie2JobSummary. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Macie2JobSummary along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync(String resourceGroupName, + String name, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.getByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, accept, context); + } + + /** + * Get a Macie2JobSummary. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Macie2JobSummary. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Macie2JobSummary on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getByResourceGroupAsync(String resourceGroupName, String name) { + return getByResourceGroupWithResponseAsync(resourceGroupName, name) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Get a Macie2JobSummary. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Macie2JobSummary. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Macie2JobSummary along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getByResourceGroupWithResponse(String resourceGroupName, String name, + Context context) { + return getByResourceGroupWithResponseAsync(resourceGroupName, name, context).block(); + } + + /** + * Get a Macie2JobSummary. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Macie2JobSummary. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Macie2JobSummary. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Macie2JobSummaryInner getByResourceGroup(String resourceGroupName, String name) { + return getByResourceGroupWithResponse(resourceGroupName, name, Context.NONE).getValue(); + } + + /** + * Create a Macie2JobSummary. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Macie2JobSummary. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrReplaceWithResponseAsync(String resourceGroupName, String name, + Macie2JobSummaryInner resource) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (resource == null) { + return Mono.error(new IllegalArgumentException("Parameter resource is required and cannot be null.")); + } else { + resource.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.createOrReplace(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, resource, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Create a Macie2JobSummary. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Macie2JobSummary. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrReplaceWithResponseAsync(String resourceGroupName, String name, + Macie2JobSummaryInner resource, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (resource == null) { + return Mono.error(new IllegalArgumentException("Parameter resource is required and cannot be null.")); + } else { + resource.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.createOrReplace(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, resource, accept, context); + } + + /** + * Create a Macie2JobSummary. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Macie2JobSummary. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Macie2JobSummaryInner> + beginCreateOrReplaceAsync(String resourceGroupName, String name, Macie2JobSummaryInner resource) { + Mono>> mono = createOrReplaceWithResponseAsync(resourceGroupName, name, resource); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), Macie2JobSummaryInner.class, Macie2JobSummaryInner.class, + this.client.getContext()); + } + + /** + * Create a Macie2JobSummary. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Macie2JobSummary. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Macie2JobSummaryInner> beginCreateOrReplaceAsync( + String resourceGroupName, String name, Macie2JobSummaryInner resource, Context context) { + context = this.client.mergeContext(context); + Mono>> mono + = createOrReplaceWithResponseAsync(resourceGroupName, name, resource, context); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), Macie2JobSummaryInner.class, Macie2JobSummaryInner.class, context); + } + + /** + * Create a Macie2JobSummary. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Macie2JobSummary. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Macie2JobSummaryInner> + beginCreateOrReplace(String resourceGroupName, String name, Macie2JobSummaryInner resource) { + return this.beginCreateOrReplaceAsync(resourceGroupName, name, resource).getSyncPoller(); + } + + /** + * Create a Macie2JobSummary. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Macie2JobSummary. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Macie2JobSummaryInner> + beginCreateOrReplace(String resourceGroupName, String name, Macie2JobSummaryInner resource, Context context) { + return this.beginCreateOrReplaceAsync(resourceGroupName, name, resource, context).getSyncPoller(); + } + + /** + * Create a Macie2JobSummary. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Macie2JobSummary. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrReplaceAsync(String resourceGroupName, String name, + Macie2JobSummaryInner resource) { + return beginCreateOrReplaceAsync(resourceGroupName, name, resource).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create a Macie2JobSummary. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Macie2JobSummary. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrReplaceAsync(String resourceGroupName, String name, + Macie2JobSummaryInner resource, Context context) { + return beginCreateOrReplaceAsync(resourceGroupName, name, resource, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create a Macie2JobSummary. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Macie2JobSummary. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Macie2JobSummaryInner createOrReplace(String resourceGroupName, String name, + Macie2JobSummaryInner resource) { + return createOrReplaceAsync(resourceGroupName, name, resource).block(); + } + + /** + * Create a Macie2JobSummary. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Macie2JobSummary. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Macie2JobSummaryInner createOrReplace(String resourceGroupName, String name, Macie2JobSummaryInner resource, + Context context) { + return createOrReplaceAsync(resourceGroupName, name, resource, context).block(); + } + + /** + * Update a Macie2JobSummary. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Macie2JobSummary. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync(String resourceGroupName, String name, + Macie2JobSummaryTagsUpdate properties) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (properties == null) { + return Mono.error(new IllegalArgumentException("Parameter properties is required and cannot be null.")); + } else { + properties.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.update(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, properties, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Update a Macie2JobSummary. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Macie2JobSummary. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync(String resourceGroupName, String name, + Macie2JobSummaryTagsUpdate properties, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (properties == null) { + return Mono.error(new IllegalArgumentException("Parameter properties is required and cannot be null.")); + } else { + properties.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.update(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, name, properties, accept, context); + } + + /** + * Update a Macie2JobSummary. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Macie2JobSummary. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Macie2JobSummaryInner> + beginUpdateAsync(String resourceGroupName, String name, Macie2JobSummaryTagsUpdate properties) { + Mono>> mono = updateWithResponseAsync(resourceGroupName, name, properties); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), Macie2JobSummaryInner.class, Macie2JobSummaryInner.class, + this.client.getContext()); + } + + /** + * Update a Macie2JobSummary. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Macie2JobSummary. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Macie2JobSummaryInner> beginUpdateAsync( + String resourceGroupName, String name, Macie2JobSummaryTagsUpdate properties, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = updateWithResponseAsync(resourceGroupName, name, properties, context); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), Macie2JobSummaryInner.class, Macie2JobSummaryInner.class, context); + } + + /** + * Update a Macie2JobSummary. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Macie2JobSummary. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Macie2JobSummaryInner> beginUpdate(String resourceGroupName, + String name, Macie2JobSummaryTagsUpdate properties) { + return this.beginUpdateAsync(resourceGroupName, name, properties).getSyncPoller(); + } + + /** + * Update a Macie2JobSummary. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Macie2JobSummary. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Macie2JobSummaryInner> beginUpdate(String resourceGroupName, + String name, Macie2JobSummaryTagsUpdate properties, Context context) { + return this.beginUpdateAsync(resourceGroupName, name, properties, context).getSyncPoller(); + } + + /** + * Update a Macie2JobSummary. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Macie2JobSummary. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync(String resourceGroupName, String name, + Macie2JobSummaryTagsUpdate properties) { + return beginUpdateAsync(resourceGroupName, name, properties).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Update a Macie2JobSummary. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Macie2JobSummary. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync(String resourceGroupName, String name, + Macie2JobSummaryTagsUpdate properties, Context context) { + return beginUpdateAsync(resourceGroupName, name, properties, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Update a Macie2JobSummary. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Macie2JobSummary. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Macie2JobSummaryInner update(String resourceGroupName, String name, Macie2JobSummaryTagsUpdate properties) { + return updateAsync(resourceGroupName, name, properties).block(); + } + + /** + * Update a Macie2JobSummary. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Macie2JobSummary. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Macie2JobSummaryInner update(String resourceGroupName, String name, Macie2JobSummaryTagsUpdate properties, + Context context) { + return updateAsync(resourceGroupName, name, properties, context).block(); + } + + /** + * Delete a Macie2JobSummary. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Macie2JobSummary. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync(String resourceGroupName, String name) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Delete a Macie2JobSummary. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Macie2JobSummary. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync(String resourceGroupName, String name, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.delete(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, name, accept, context); + } + + /** + * Delete a Macie2JobSummary. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Macie2JobSummary. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String name) { + Mono>> mono = deleteWithResponseAsync(resourceGroupName, name); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); + } + + /** + * Delete a Macie2JobSummary. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Macie2JobSummary. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String name, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = deleteWithResponseAsync(resourceGroupName, name, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + context); + } + + /** + * Delete a Macie2JobSummary. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Macie2JobSummary. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String name) { + return this.beginDeleteAsync(resourceGroupName, name).getSyncPoller(); + } + + /** + * Delete a Macie2JobSummary. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Macie2JobSummary. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String name, Context context) { + return this.beginDeleteAsync(resourceGroupName, name, context).getSyncPoller(); + } + + /** + * Delete a Macie2JobSummary. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Macie2JobSummary. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String name) { + return beginDeleteAsync(resourceGroupName, name).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete a Macie2JobSummary. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Macie2JobSummary. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String name, Context context) { + return beginDeleteAsync(resourceGroupName, name, context).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete a Macie2JobSummary. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Macie2JobSummary. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String name) { + deleteAsync(resourceGroupName, name).block(); + } + + /** + * Delete a Macie2JobSummary. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Macie2JobSummary. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String name, Context context) { + deleteAsync(resourceGroupName, name, context).block(); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Macie2JobSummary list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listBySubscriptionNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Macie2JobSummary list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listBySubscriptionNextSinglePageAsync(String nextLink, + Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Macie2JobSummary list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Macie2JobSummary list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupNextSinglePageAsync(String nextLink, + Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/Macie2JobSummariesImpl.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/Macie2JobSummariesImpl.java new file mode 100644 index 000000000000..c3514700d369 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/Macie2JobSummariesImpl.java @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.awsconnector.fluent.Macie2JobSummariesClient; +import com.azure.resourcemanager.awsconnector.fluent.models.Macie2JobSummaryInner; +import com.azure.resourcemanager.awsconnector.models.Macie2JobSummaries; +import com.azure.resourcemanager.awsconnector.models.Macie2JobSummary; + +public final class Macie2JobSummariesImpl implements Macie2JobSummaries { + private static final ClientLogger LOGGER = new ClientLogger(Macie2JobSummariesImpl.class); + + private final Macie2JobSummariesClient innerClient; + + private final com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager; + + public Macie2JobSummariesImpl(Macie2JobSummariesClient innerClient, + com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return ResourceManagerUtils.mapPage(inner, inner1 -> new Macie2JobSummaryImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new Macie2JobSummaryImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName); + return ResourceManagerUtils.mapPage(inner, inner1 -> new Macie2JobSummaryImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + PagedIterable inner + = this.serviceClient().listByResourceGroup(resourceGroupName, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new Macie2JobSummaryImpl(inner1, this.manager())); + } + + public Response getByResourceGroupWithResponse(String resourceGroupName, String name, + Context context) { + Response inner + = this.serviceClient().getByResourceGroupWithResponse(resourceGroupName, name, context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new Macie2JobSummaryImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public Macie2JobSummary getByResourceGroup(String resourceGroupName, String name) { + Macie2JobSummaryInner inner = this.serviceClient().getByResourceGroup(resourceGroupName, name); + if (inner != null) { + return new Macie2JobSummaryImpl(inner, this.manager()); + } else { + return null; + } + } + + public void deleteByResourceGroup(String resourceGroupName, String name) { + this.serviceClient().delete(resourceGroupName, name); + } + + public void delete(String resourceGroupName, String name, Context context) { + this.serviceClient().delete(resourceGroupName, name, context); + } + + public Macie2JobSummary getById(String id) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String name = ResourceManagerUtils.getValueFromIdByName(id, "macie2JobSummaries"); + if (name == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'macie2JobSummaries'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, name, Context.NONE).getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String name = ResourceManagerUtils.getValueFromIdByName(id, "macie2JobSummaries"); + if (name == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'macie2JobSummaries'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, name, context); + } + + public void deleteById(String id) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String name = ResourceManagerUtils.getValueFromIdByName(id, "macie2JobSummaries"); + if (name == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'macie2JobSummaries'.", id))); + } + this.delete(resourceGroupName, name, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String name = ResourceManagerUtils.getValueFromIdByName(id, "macie2JobSummaries"); + if (name == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'macie2JobSummaries'.", id))); + } + this.delete(resourceGroupName, name, context); + } + + private Macie2JobSummariesClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.awsconnector.AwsconnectorManager manager() { + return this.serviceManager; + } + + public Macie2JobSummaryImpl define(String name) { + return new Macie2JobSummaryImpl(name, this.manager()); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/Macie2JobSummaryImpl.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/Macie2JobSummaryImpl.java new file mode 100644 index 000000000000..0740c69af5ab --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/Macie2JobSummaryImpl.java @@ -0,0 +1,178 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.implementation; + +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.awsconnector.fluent.models.Macie2JobSummaryInner; +import com.azure.resourcemanager.awsconnector.models.Macie2JobSummary; +import com.azure.resourcemanager.awsconnector.models.Macie2JobSummaryProperties; +import com.azure.resourcemanager.awsconnector.models.Macie2JobSummaryTagsUpdate; +import java.util.Collections; +import java.util.Map; + +public final class Macie2JobSummaryImpl + implements Macie2JobSummary, Macie2JobSummary.Definition, Macie2JobSummary.Update { + private Macie2JobSummaryInner innerObject; + + private final com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public String location() { + return this.innerModel().location(); + } + + public Map tags() { + Map inner = this.innerModel().tags(); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } + } + + public Macie2JobSummaryProperties properties() { + return this.innerModel().properties(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public String resourceGroupName() { + return resourceGroupName; + } + + public Macie2JobSummaryInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.awsconnector.AwsconnectorManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String name; + + private Macie2JobSummaryTagsUpdate updateProperties; + + public Macie2JobSummaryImpl withExistingResourceGroup(String resourceGroupName) { + this.resourceGroupName = resourceGroupName; + return this; + } + + public Macie2JobSummary create() { + this.innerObject = serviceManager.serviceClient() + .getMacie2JobSummaries() + .createOrReplace(resourceGroupName, name, this.innerModel(), Context.NONE); + return this; + } + + public Macie2JobSummary create(Context context) { + this.innerObject = serviceManager.serviceClient() + .getMacie2JobSummaries() + .createOrReplace(resourceGroupName, name, this.innerModel(), context); + return this; + } + + Macie2JobSummaryImpl(String name, com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager) { + this.innerObject = new Macie2JobSummaryInner(); + this.serviceManager = serviceManager; + this.name = name; + } + + public Macie2JobSummaryImpl update() { + this.updateProperties = new Macie2JobSummaryTagsUpdate(); + return this; + } + + public Macie2JobSummary apply() { + this.innerObject = serviceManager.serviceClient() + .getMacie2JobSummaries() + .update(resourceGroupName, name, updateProperties, Context.NONE); + return this; + } + + public Macie2JobSummary apply(Context context) { + this.innerObject = serviceManager.serviceClient() + .getMacie2JobSummaries() + .update(resourceGroupName, name, updateProperties, context); + return this; + } + + Macie2JobSummaryImpl(Macie2JobSummaryInner innerObject, + com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.name = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "macie2JobSummaries"); + } + + public Macie2JobSummary refresh() { + this.innerObject = serviceManager.serviceClient() + .getMacie2JobSummaries() + .getByResourceGroupWithResponse(resourceGroupName, name, Context.NONE) + .getValue(); + return this; + } + + public Macie2JobSummary refresh(Context context) { + this.innerObject = serviceManager.serviceClient() + .getMacie2JobSummaries() + .getByResourceGroupWithResponse(resourceGroupName, name, context) + .getValue(); + return this; + } + + public Macie2JobSummaryImpl withRegion(Region location) { + this.innerModel().withLocation(location.toString()); + return this; + } + + public Macie2JobSummaryImpl withRegion(String location) { + this.innerModel().withLocation(location); + return this; + } + + public Macie2JobSummaryImpl withTags(Map tags) { + if (isInCreateMode()) { + this.innerModel().withTags(tags); + return this; + } else { + this.updateProperties.withTags(tags); + return this; + } + } + + public Macie2JobSummaryImpl withProperties(Macie2JobSummaryProperties properties) { + this.innerModel().withProperties(properties); + return this; + } + + private boolean isInCreateMode() { + return this.innerModel().id() == null; + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/MacieAllowListImpl.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/MacieAllowListImpl.java new file mode 100644 index 000000000000..ef51f336126c --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/MacieAllowListImpl.java @@ -0,0 +1,177 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.implementation; + +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.awsconnector.fluent.models.MacieAllowListInner; +import com.azure.resourcemanager.awsconnector.models.MacieAllowList; +import com.azure.resourcemanager.awsconnector.models.MacieAllowListProperties; +import com.azure.resourcemanager.awsconnector.models.MacieAllowListTagsUpdate; +import java.util.Collections; +import java.util.Map; + +public final class MacieAllowListImpl implements MacieAllowList, MacieAllowList.Definition, MacieAllowList.Update { + private MacieAllowListInner innerObject; + + private final com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public String location() { + return this.innerModel().location(); + } + + public Map tags() { + Map inner = this.innerModel().tags(); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } + } + + public MacieAllowListProperties properties() { + return this.innerModel().properties(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public String resourceGroupName() { + return resourceGroupName; + } + + public MacieAllowListInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.awsconnector.AwsconnectorManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String name; + + private MacieAllowListTagsUpdate updateProperties; + + public MacieAllowListImpl withExistingResourceGroup(String resourceGroupName) { + this.resourceGroupName = resourceGroupName; + return this; + } + + public MacieAllowList create() { + this.innerObject = serviceManager.serviceClient() + .getMacieAllowLists() + .createOrReplace(resourceGroupName, name, this.innerModel(), Context.NONE); + return this; + } + + public MacieAllowList create(Context context) { + this.innerObject = serviceManager.serviceClient() + .getMacieAllowLists() + .createOrReplace(resourceGroupName, name, this.innerModel(), context); + return this; + } + + MacieAllowListImpl(String name, com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager) { + this.innerObject = new MacieAllowListInner(); + this.serviceManager = serviceManager; + this.name = name; + } + + public MacieAllowListImpl update() { + this.updateProperties = new MacieAllowListTagsUpdate(); + return this; + } + + public MacieAllowList apply() { + this.innerObject = serviceManager.serviceClient() + .getMacieAllowLists() + .update(resourceGroupName, name, updateProperties, Context.NONE); + return this; + } + + public MacieAllowList apply(Context context) { + this.innerObject = serviceManager.serviceClient() + .getMacieAllowLists() + .update(resourceGroupName, name, updateProperties, context); + return this; + } + + MacieAllowListImpl(MacieAllowListInner innerObject, + com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.name = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "macieAllowLists"); + } + + public MacieAllowList refresh() { + this.innerObject = serviceManager.serviceClient() + .getMacieAllowLists() + .getByResourceGroupWithResponse(resourceGroupName, name, Context.NONE) + .getValue(); + return this; + } + + public MacieAllowList refresh(Context context) { + this.innerObject = serviceManager.serviceClient() + .getMacieAllowLists() + .getByResourceGroupWithResponse(resourceGroupName, name, context) + .getValue(); + return this; + } + + public MacieAllowListImpl withRegion(Region location) { + this.innerModel().withLocation(location.toString()); + return this; + } + + public MacieAllowListImpl withRegion(String location) { + this.innerModel().withLocation(location); + return this; + } + + public MacieAllowListImpl withTags(Map tags) { + if (isInCreateMode()) { + this.innerModel().withTags(tags); + return this; + } else { + this.updateProperties.withTags(tags); + return this; + } + } + + public MacieAllowListImpl withProperties(MacieAllowListProperties properties) { + this.innerModel().withProperties(properties); + return this; + } + + private boolean isInCreateMode() { + return this.innerModel().id() == null; + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/MacieAllowListsClientImpl.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/MacieAllowListsClientImpl.java new file mode 100644 index 000000000000..356e7dc316df --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/MacieAllowListsClientImpl.java @@ -0,0 +1,1278 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.Patch; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.awsconnector.fluent.MacieAllowListsClient; +import com.azure.resourcemanager.awsconnector.fluent.models.MacieAllowListInner; +import com.azure.resourcemanager.awsconnector.models.MacieAllowListResult; +import com.azure.resourcemanager.awsconnector.models.MacieAllowListTagsUpdate; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in MacieAllowListsClient. + */ +public final class MacieAllowListsClientImpl implements MacieAllowListsClient { + /** + * The proxy service used to perform REST calls. + */ + private final MacieAllowListsService service; + + /** + * The service client containing this operation class. + */ + private final MicrosoftAwsConnectorImpl client; + + /** + * Initializes an instance of MacieAllowListsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + MacieAllowListsClientImpl(MicrosoftAwsConnectorImpl client) { + this.service + = RestProxy.create(MacieAllowListsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for MicrosoftAwsConnectorMacieAllowLists to be used by the proxy service + * to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "MicrosoftAwsConnecto") + public interface MacieAllowListsService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.AwsConnector/macieAllowLists") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/macieAllowLists") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroup(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/macieAllowLists/{name}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getByResourceGroup(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("name") String name, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/macieAllowLists/{name}") + @ExpectedResponses({ 200, 201 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrReplace(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("name") String name, + @BodyParam("application/json") MacieAllowListInner resource, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/macieAllowLists/{name}") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> update(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("name") String name, + @BodyParam("application/json") MacieAllowListTagsUpdate properties, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/macieAllowLists/{name}") + @ExpectedResponses({ 202, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("name") String name, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listBySubscriptionNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroupNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); + } + + /** + * List MacieAllowList resources by subscription ID. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a MacieAllowList list operation along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync() { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List MacieAllowList resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a MacieAllowList list operation along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), accept, + context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * List MacieAllowList resources by subscription ID. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a MacieAllowList list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>(() -> listSinglePageAsync(), + nextLink -> listBySubscriptionNextSinglePageAsync(nextLink)); + } + + /** + * List MacieAllowList resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a MacieAllowList list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(Context context) { + return new PagedFlux<>(() -> listSinglePageAsync(context), + nextLink -> listBySubscriptionNextSinglePageAsync(nextLink, context)); + } + + /** + * List MacieAllowList resources by subscription ID. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a MacieAllowList list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + return new PagedIterable<>(listAsync()); + } + + /** + * List MacieAllowList resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a MacieAllowList list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Context context) { + return new PagedIterable<>(listAsync(context)); + } + + /** + * List MacieAllowList resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a MacieAllowList list operation along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List MacieAllowList resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a MacieAllowList list operation along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * List MacieAllowList resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a MacieAllowList list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName) { + return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); + } + + /** + * List MacieAllowList resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a MacieAllowList list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName, Context context) { + return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName, context), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink, context)); + } + + /** + * List MacieAllowList resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a MacieAllowList list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName)); + } + + /** + * List MacieAllowList resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a MacieAllowList list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, context)); + } + + /** + * Get a MacieAllowList. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of MacieAllowList. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a MacieAllowList along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync(String resourceGroupName, + String name) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.getByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get a MacieAllowList. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of MacieAllowList. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a MacieAllowList along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync(String resourceGroupName, + String name, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.getByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, accept, context); + } + + /** + * Get a MacieAllowList. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of MacieAllowList. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a MacieAllowList on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getByResourceGroupAsync(String resourceGroupName, String name) { + return getByResourceGroupWithResponseAsync(resourceGroupName, name) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Get a MacieAllowList. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of MacieAllowList. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a MacieAllowList along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getByResourceGroupWithResponse(String resourceGroupName, String name, + Context context) { + return getByResourceGroupWithResponseAsync(resourceGroupName, name, context).block(); + } + + /** + * Get a MacieAllowList. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of MacieAllowList. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a MacieAllowList. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public MacieAllowListInner getByResourceGroup(String resourceGroupName, String name) { + return getByResourceGroupWithResponse(resourceGroupName, name, Context.NONE).getValue(); + } + + /** + * Create a MacieAllowList. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of MacieAllowList. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrReplaceWithResponseAsync(String resourceGroupName, String name, + MacieAllowListInner resource) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (resource == null) { + return Mono.error(new IllegalArgumentException("Parameter resource is required and cannot be null.")); + } else { + resource.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.createOrReplace(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, resource, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Create a MacieAllowList. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of MacieAllowList. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrReplaceWithResponseAsync(String resourceGroupName, String name, + MacieAllowListInner resource, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (resource == null) { + return Mono.error(new IllegalArgumentException("Parameter resource is required and cannot be null.")); + } else { + resource.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.createOrReplace(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, resource, accept, context); + } + + /** + * Create a MacieAllowList. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of MacieAllowList. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, MacieAllowListInner> + beginCreateOrReplaceAsync(String resourceGroupName, String name, MacieAllowListInner resource) { + Mono>> mono = createOrReplaceWithResponseAsync(resourceGroupName, name, resource); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + MacieAllowListInner.class, MacieAllowListInner.class, this.client.getContext()); + } + + /** + * Create a MacieAllowList. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of MacieAllowList. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, MacieAllowListInner> beginCreateOrReplaceAsync( + String resourceGroupName, String name, MacieAllowListInner resource, Context context) { + context = this.client.mergeContext(context); + Mono>> mono + = createOrReplaceWithResponseAsync(resourceGroupName, name, resource, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + MacieAllowListInner.class, MacieAllowListInner.class, context); + } + + /** + * Create a MacieAllowList. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of MacieAllowList. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, MacieAllowListInner> + beginCreateOrReplace(String resourceGroupName, String name, MacieAllowListInner resource) { + return this.beginCreateOrReplaceAsync(resourceGroupName, name, resource).getSyncPoller(); + } + + /** + * Create a MacieAllowList. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of MacieAllowList. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, MacieAllowListInner> + beginCreateOrReplace(String resourceGroupName, String name, MacieAllowListInner resource, Context context) { + return this.beginCreateOrReplaceAsync(resourceGroupName, name, resource, context).getSyncPoller(); + } + + /** + * Create a MacieAllowList. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of MacieAllowList. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrReplaceAsync(String resourceGroupName, String name, + MacieAllowListInner resource) { + return beginCreateOrReplaceAsync(resourceGroupName, name, resource).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create a MacieAllowList. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of MacieAllowList. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrReplaceAsync(String resourceGroupName, String name, + MacieAllowListInner resource, Context context) { + return beginCreateOrReplaceAsync(resourceGroupName, name, resource, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create a MacieAllowList. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of MacieAllowList. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public MacieAllowListInner createOrReplace(String resourceGroupName, String name, MacieAllowListInner resource) { + return createOrReplaceAsync(resourceGroupName, name, resource).block(); + } + + /** + * Create a MacieAllowList. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of MacieAllowList. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public MacieAllowListInner createOrReplace(String resourceGroupName, String name, MacieAllowListInner resource, + Context context) { + return createOrReplaceAsync(resourceGroupName, name, resource, context).block(); + } + + /** + * Update a MacieAllowList. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of MacieAllowList. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync(String resourceGroupName, String name, + MacieAllowListTagsUpdate properties) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (properties == null) { + return Mono.error(new IllegalArgumentException("Parameter properties is required and cannot be null.")); + } else { + properties.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.update(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, properties, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Update a MacieAllowList. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of MacieAllowList. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync(String resourceGroupName, String name, + MacieAllowListTagsUpdate properties, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (properties == null) { + return Mono.error(new IllegalArgumentException("Parameter properties is required and cannot be null.")); + } else { + properties.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.update(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, name, properties, accept, context); + } + + /** + * Update a MacieAllowList. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of MacieAllowList. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, MacieAllowListInner> beginUpdateAsync(String resourceGroupName, + String name, MacieAllowListTagsUpdate properties) { + Mono>> mono = updateWithResponseAsync(resourceGroupName, name, properties); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + MacieAllowListInner.class, MacieAllowListInner.class, this.client.getContext()); + } + + /** + * Update a MacieAllowList. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of MacieAllowList. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, MacieAllowListInner> beginUpdateAsync(String resourceGroupName, + String name, MacieAllowListTagsUpdate properties, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = updateWithResponseAsync(resourceGroupName, name, properties, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + MacieAllowListInner.class, MacieAllowListInner.class, context); + } + + /** + * Update a MacieAllowList. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of MacieAllowList. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, MacieAllowListInner> beginUpdate(String resourceGroupName, + String name, MacieAllowListTagsUpdate properties) { + return this.beginUpdateAsync(resourceGroupName, name, properties).getSyncPoller(); + } + + /** + * Update a MacieAllowList. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of MacieAllowList. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, MacieAllowListInner> beginUpdate(String resourceGroupName, + String name, MacieAllowListTagsUpdate properties, Context context) { + return this.beginUpdateAsync(resourceGroupName, name, properties, context).getSyncPoller(); + } + + /** + * Update a MacieAllowList. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of MacieAllowList. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync(String resourceGroupName, String name, + MacieAllowListTagsUpdate properties) { + return beginUpdateAsync(resourceGroupName, name, properties).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Update a MacieAllowList. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of MacieAllowList. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync(String resourceGroupName, String name, + MacieAllowListTagsUpdate properties, Context context) { + return beginUpdateAsync(resourceGroupName, name, properties, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Update a MacieAllowList. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of MacieAllowList. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public MacieAllowListInner update(String resourceGroupName, String name, MacieAllowListTagsUpdate properties) { + return updateAsync(resourceGroupName, name, properties).block(); + } + + /** + * Update a MacieAllowList. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of MacieAllowList. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public MacieAllowListInner update(String resourceGroupName, String name, MacieAllowListTagsUpdate properties, + Context context) { + return updateAsync(resourceGroupName, name, properties, context).block(); + } + + /** + * Delete a MacieAllowList. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of MacieAllowList. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync(String resourceGroupName, String name) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Delete a MacieAllowList. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of MacieAllowList. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync(String resourceGroupName, String name, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.delete(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, name, accept, context); + } + + /** + * Delete a MacieAllowList. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of MacieAllowList. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String name) { + Mono>> mono = deleteWithResponseAsync(resourceGroupName, name); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); + } + + /** + * Delete a MacieAllowList. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of MacieAllowList. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String name, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = deleteWithResponseAsync(resourceGroupName, name, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + context); + } + + /** + * Delete a MacieAllowList. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of MacieAllowList. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String name) { + return this.beginDeleteAsync(resourceGroupName, name).getSyncPoller(); + } + + /** + * Delete a MacieAllowList. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of MacieAllowList. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String name, Context context) { + return this.beginDeleteAsync(resourceGroupName, name, context).getSyncPoller(); + } + + /** + * Delete a MacieAllowList. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of MacieAllowList. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String name) { + return beginDeleteAsync(resourceGroupName, name).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete a MacieAllowList. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of MacieAllowList. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String name, Context context) { + return beginDeleteAsync(resourceGroupName, name, context).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete a MacieAllowList. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of MacieAllowList. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String name) { + deleteAsync(resourceGroupName, name).block(); + } + + /** + * Delete a MacieAllowList. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of MacieAllowList. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String name, Context context) { + deleteAsync(resourceGroupName, name, context).block(); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a MacieAllowList list operation along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listBySubscriptionNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a MacieAllowList list operation along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listBySubscriptionNextSinglePageAsync(String nextLink, + Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a MacieAllowList list operation along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a MacieAllowList list operation along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupNextSinglePageAsync(String nextLink, + Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/MacieAllowListsImpl.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/MacieAllowListsImpl.java new file mode 100644 index 000000000000..5fcd15555ab9 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/MacieAllowListsImpl.java @@ -0,0 +1,146 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.awsconnector.fluent.MacieAllowListsClient; +import com.azure.resourcemanager.awsconnector.fluent.models.MacieAllowListInner; +import com.azure.resourcemanager.awsconnector.models.MacieAllowList; +import com.azure.resourcemanager.awsconnector.models.MacieAllowLists; + +public final class MacieAllowListsImpl implements MacieAllowLists { + private static final ClientLogger LOGGER = new ClientLogger(MacieAllowListsImpl.class); + + private final MacieAllowListsClient innerClient; + + private final com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager; + + public MacieAllowListsImpl(MacieAllowListsClient innerClient, + com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return ResourceManagerUtils.mapPage(inner, inner1 -> new MacieAllowListImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new MacieAllowListImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName); + return ResourceManagerUtils.mapPage(inner, inner1 -> new MacieAllowListImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new MacieAllowListImpl(inner1, this.manager())); + } + + public Response getByResourceGroupWithResponse(String resourceGroupName, String name, + Context context) { + Response inner + = this.serviceClient().getByResourceGroupWithResponse(resourceGroupName, name, context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new MacieAllowListImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public MacieAllowList getByResourceGroup(String resourceGroupName, String name) { + MacieAllowListInner inner = this.serviceClient().getByResourceGroup(resourceGroupName, name); + if (inner != null) { + return new MacieAllowListImpl(inner, this.manager()); + } else { + return null; + } + } + + public void deleteByResourceGroup(String resourceGroupName, String name) { + this.serviceClient().delete(resourceGroupName, name); + } + + public void delete(String resourceGroupName, String name, Context context) { + this.serviceClient().delete(resourceGroupName, name, context); + } + + public MacieAllowList getById(String id) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String name = ResourceManagerUtils.getValueFromIdByName(id, "macieAllowLists"); + if (name == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'macieAllowLists'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, name, Context.NONE).getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String name = ResourceManagerUtils.getValueFromIdByName(id, "macieAllowLists"); + if (name == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'macieAllowLists'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, name, context); + } + + public void deleteById(String id) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String name = ResourceManagerUtils.getValueFromIdByName(id, "macieAllowLists"); + if (name == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'macieAllowLists'.", id))); + } + this.delete(resourceGroupName, name, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String name = ResourceManagerUtils.getValueFromIdByName(id, "macieAllowLists"); + if (name == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'macieAllowLists'.", id))); + } + this.delete(resourceGroupName, name, context); + } + + private MacieAllowListsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.awsconnector.AwsconnectorManager manager() { + return this.serviceManager; + } + + public MacieAllowListImpl define(String name) { + return new MacieAllowListImpl(name, this.manager()); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/MicrosoftAwsConnectorBuilder.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/MicrosoftAwsConnectorBuilder.java new file mode 100644 index 000000000000..6071471caf8c --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/MicrosoftAwsConnectorBuilder.java @@ -0,0 +1,138 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.implementation; + +import com.azure.core.annotation.ServiceClientBuilder; +import com.azure.core.http.HttpPipeline; +import com.azure.core.http.HttpPipelineBuilder; +import com.azure.core.http.policy.RetryPolicy; +import com.azure.core.http.policy.UserAgentPolicy; +import com.azure.core.management.AzureEnvironment; +import com.azure.core.management.serializer.SerializerFactory; +import com.azure.core.util.serializer.SerializerAdapter; +import java.time.Duration; + +/** + * A builder for creating a new instance of the MicrosoftAwsConnectorImpl type. + */ +@ServiceClientBuilder(serviceClients = { MicrosoftAwsConnectorImpl.class }) +public final class MicrosoftAwsConnectorBuilder { + /* + * The ID of the target subscription. The value must be an UUID. + */ + private String subscriptionId; + + /** + * Sets The ID of the target subscription. The value must be an UUID. + * + * @param subscriptionId the subscriptionId value. + * @return the MicrosoftAwsConnectorBuilder. + */ + public MicrosoftAwsConnectorBuilder subscriptionId(String subscriptionId) { + this.subscriptionId = subscriptionId; + return this; + } + + /* + * server parameter + */ + private String endpoint; + + /** + * Sets server parameter. + * + * @param endpoint the endpoint value. + * @return the MicrosoftAwsConnectorBuilder. + */ + public MicrosoftAwsConnectorBuilder endpoint(String endpoint) { + this.endpoint = endpoint; + return this; + } + + /* + * The environment to connect to + */ + private AzureEnvironment environment; + + /** + * Sets The environment to connect to. + * + * @param environment the environment value. + * @return the MicrosoftAwsConnectorBuilder. + */ + public MicrosoftAwsConnectorBuilder environment(AzureEnvironment environment) { + this.environment = environment; + return this; + } + + /* + * The HTTP pipeline to send requests through + */ + private HttpPipeline pipeline; + + /** + * Sets The HTTP pipeline to send requests through. + * + * @param pipeline the pipeline value. + * @return the MicrosoftAwsConnectorBuilder. + */ + public MicrosoftAwsConnectorBuilder pipeline(HttpPipeline pipeline) { + this.pipeline = pipeline; + return this; + } + + /* + * The default poll interval for long-running operation + */ + private Duration defaultPollInterval; + + /** + * Sets The default poll interval for long-running operation. + * + * @param defaultPollInterval the defaultPollInterval value. + * @return the MicrosoftAwsConnectorBuilder. + */ + public MicrosoftAwsConnectorBuilder defaultPollInterval(Duration defaultPollInterval) { + this.defaultPollInterval = defaultPollInterval; + return this; + } + + /* + * The serializer to serialize an object into a string + */ + private SerializerAdapter serializerAdapter; + + /** + * Sets The serializer to serialize an object into a string. + * + * @param serializerAdapter the serializerAdapter value. + * @return the MicrosoftAwsConnectorBuilder. + */ + public MicrosoftAwsConnectorBuilder serializerAdapter(SerializerAdapter serializerAdapter) { + this.serializerAdapter = serializerAdapter; + return this; + } + + /** + * Builds an instance of MicrosoftAwsConnectorImpl with the provided parameters. + * + * @return an instance of MicrosoftAwsConnectorImpl. + */ + public MicrosoftAwsConnectorImpl buildClient() { + String localEndpoint = (endpoint != null) ? endpoint : "https://management.azure.com"; + AzureEnvironment localEnvironment = (environment != null) ? environment : AzureEnvironment.AZURE; + HttpPipeline localPipeline = (pipeline != null) + ? pipeline + : new HttpPipelineBuilder().policies(new UserAgentPolicy(), new RetryPolicy()).build(); + Duration localDefaultPollInterval + = (defaultPollInterval != null) ? defaultPollInterval : Duration.ofSeconds(30); + SerializerAdapter localSerializerAdapter = (serializerAdapter != null) + ? serializerAdapter + : SerializerFactory.createDefaultManagementSerializerAdapter(); + MicrosoftAwsConnectorImpl client = new MicrosoftAwsConnectorImpl(localPipeline, localSerializerAdapter, + localDefaultPollInterval, localEnvironment, this.subscriptionId, localEndpoint); + return client; + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/MicrosoftAwsConnectorImpl.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/MicrosoftAwsConnectorImpl.java new file mode 100644 index 000000000000..500fcfb00c2e --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/MicrosoftAwsConnectorImpl.java @@ -0,0 +1,2084 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.implementation; + +import com.azure.core.annotation.ServiceClient; +import com.azure.core.http.HttpHeaderName; +import com.azure.core.http.HttpHeaders; +import com.azure.core.http.HttpPipeline; +import com.azure.core.http.HttpResponse; +import com.azure.core.http.rest.Response; +import com.azure.core.management.AzureEnvironment; +import com.azure.core.management.exception.ManagementError; +import com.azure.core.management.exception.ManagementException; +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; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.serializer.SerializerAdapter; +import com.azure.core.util.serializer.SerializerEncoding; +import com.azure.resourcemanager.awsconnector.fluent.AccessAnalyzerAnalyzersClient; +import com.azure.resourcemanager.awsconnector.fluent.AcmCertificateSummariesClient; +import com.azure.resourcemanager.awsconnector.fluent.ApiGatewayRestApisClient; +import com.azure.resourcemanager.awsconnector.fluent.ApiGatewayStagesClient; +import com.azure.resourcemanager.awsconnector.fluent.AppSyncGraphqlApisClient; +import com.azure.resourcemanager.awsconnector.fluent.AutoScalingAutoScalingGroupsClient; +import com.azure.resourcemanager.awsconnector.fluent.CloudFormationStackSetsClient; +import com.azure.resourcemanager.awsconnector.fluent.CloudFormationStacksClient; +import com.azure.resourcemanager.awsconnector.fluent.CloudFrontDistributionsClient; +import com.azure.resourcemanager.awsconnector.fluent.CloudTrailTrailsClient; +import com.azure.resourcemanager.awsconnector.fluent.CloudWatchAlarmsClient; +import com.azure.resourcemanager.awsconnector.fluent.CodeBuildProjectsClient; +import com.azure.resourcemanager.awsconnector.fluent.CodeBuildSourceCredentialsInfosClient; +import com.azure.resourcemanager.awsconnector.fluent.ConfigServiceConfigurationRecorderStatusesClient; +import com.azure.resourcemanager.awsconnector.fluent.ConfigServiceConfigurationRecordersClient; +import com.azure.resourcemanager.awsconnector.fluent.ConfigServiceDeliveryChannelsClient; +import com.azure.resourcemanager.awsconnector.fluent.DatabaseMigrationServiceReplicationInstancesClient; +import com.azure.resourcemanager.awsconnector.fluent.DaxClustersClient; +import com.azure.resourcemanager.awsconnector.fluent.DynamoDbContinuousBackupsDescriptionsClient; +import com.azure.resourcemanager.awsconnector.fluent.DynamoDbTablesClient; +import com.azure.resourcemanager.awsconnector.fluent.Ec2AccountAttributesClient; +import com.azure.resourcemanager.awsconnector.fluent.Ec2AddressesClient; +import com.azure.resourcemanager.awsconnector.fluent.Ec2FlowLogsClient; +import com.azure.resourcemanager.awsconnector.fluent.Ec2ImagesClient; +import com.azure.resourcemanager.awsconnector.fluent.Ec2InstanceStatusesClient; +import com.azure.resourcemanager.awsconnector.fluent.Ec2InstancesClient; +import com.azure.resourcemanager.awsconnector.fluent.Ec2IpamsClient; +import com.azure.resourcemanager.awsconnector.fluent.Ec2KeyPairsClient; +import com.azure.resourcemanager.awsconnector.fluent.Ec2NetworkAclsClient; +import com.azure.resourcemanager.awsconnector.fluent.Ec2NetworkInterfacesClient; +import com.azure.resourcemanager.awsconnector.fluent.Ec2RouteTablesClient; +import com.azure.resourcemanager.awsconnector.fluent.Ec2SecurityGroupsClient; +import com.azure.resourcemanager.awsconnector.fluent.Ec2SnapshotsClient; +import com.azure.resourcemanager.awsconnector.fluent.Ec2SubnetsClient; +import com.azure.resourcemanager.awsconnector.fluent.Ec2VolumesClient; +import com.azure.resourcemanager.awsconnector.fluent.Ec2VpcEndpointsClient; +import com.azure.resourcemanager.awsconnector.fluent.Ec2VpcPeeringConnectionsClient; +import com.azure.resourcemanager.awsconnector.fluent.Ec2VpcsClient; +import com.azure.resourcemanager.awsconnector.fluent.EcrImageDetailsClient; +import com.azure.resourcemanager.awsconnector.fluent.EcrRepositoriesClient; +import com.azure.resourcemanager.awsconnector.fluent.EcsClustersClient; +import com.azure.resourcemanager.awsconnector.fluent.EcsServicesClient; +import com.azure.resourcemanager.awsconnector.fluent.EcsTaskDefinitionsClient; +import com.azure.resourcemanager.awsconnector.fluent.EfsFileSystemsClient; +import com.azure.resourcemanager.awsconnector.fluent.EfsMountTargetsClient; +import com.azure.resourcemanager.awsconnector.fluent.EksClustersClient; +import com.azure.resourcemanager.awsconnector.fluent.EksNodegroupsClient; +import com.azure.resourcemanager.awsconnector.fluent.ElasticBeanstalkApplicationsClient; +import com.azure.resourcemanager.awsconnector.fluent.ElasticBeanstalkConfigurationTemplatesClient; +import com.azure.resourcemanager.awsconnector.fluent.ElasticBeanstalkEnvironmentsClient; +import com.azure.resourcemanager.awsconnector.fluent.ElasticLoadBalancingV2ListenersClient; +import com.azure.resourcemanager.awsconnector.fluent.ElasticLoadBalancingV2LoadBalancersClient; +import com.azure.resourcemanager.awsconnector.fluent.ElasticLoadBalancingV2TargetGroupsClient; +import com.azure.resourcemanager.awsconnector.fluent.ElasticLoadBalancingv2TargetHealthDescriptionsClient; +import com.azure.resourcemanager.awsconnector.fluent.EmrClusterSummariesClient; +import com.azure.resourcemanager.awsconnector.fluent.EmrClustersClient; +import com.azure.resourcemanager.awsconnector.fluent.GuardDutyDetectorsClient; +import com.azure.resourcemanager.awsconnector.fluent.IamAccessKeyLastUsedsClient; +import com.azure.resourcemanager.awsconnector.fluent.IamAccessKeyMetadataInfoesClient; +import com.azure.resourcemanager.awsconnector.fluent.IamGroupsClient; +import com.azure.resourcemanager.awsconnector.fluent.IamInstanceProfilesClient; +import com.azure.resourcemanager.awsconnector.fluent.IamMfaDevicesClient; +import com.azure.resourcemanager.awsconnector.fluent.IamPasswordPoliciesClient; +import com.azure.resourcemanager.awsconnector.fluent.IamPolicyVersionsClient; +import com.azure.resourcemanager.awsconnector.fluent.IamRolesClient; +import com.azure.resourcemanager.awsconnector.fluent.IamServerCertificatesClient; +import com.azure.resourcemanager.awsconnector.fluent.IamVirtualMfaDevicesClient; +import com.azure.resourcemanager.awsconnector.fluent.KmsAliasesClient; +import com.azure.resourcemanager.awsconnector.fluent.KmsKeysClient; +import com.azure.resourcemanager.awsconnector.fluent.LambdaFunctionCodeLocationsClient; +import com.azure.resourcemanager.awsconnector.fluent.LambdaFunctionsClient; +import com.azure.resourcemanager.awsconnector.fluent.LightsailBucketsClient; +import com.azure.resourcemanager.awsconnector.fluent.LightsailInstancesClient; +import com.azure.resourcemanager.awsconnector.fluent.LogsLogGroupsClient; +import com.azure.resourcemanager.awsconnector.fluent.LogsLogStreamsClient; +import com.azure.resourcemanager.awsconnector.fluent.LogsMetricFiltersClient; +import com.azure.resourcemanager.awsconnector.fluent.LogsSubscriptionFiltersClient; +import com.azure.resourcemanager.awsconnector.fluent.Macie2JobSummariesClient; +import com.azure.resourcemanager.awsconnector.fluent.MacieAllowListsClient; +import com.azure.resourcemanager.awsconnector.fluent.MicrosoftAwsConnector; +import com.azure.resourcemanager.awsconnector.fluent.NetworkFirewallFirewallPoliciesClient; +import com.azure.resourcemanager.awsconnector.fluent.NetworkFirewallFirewallsClient; +import com.azure.resourcemanager.awsconnector.fluent.NetworkFirewallRuleGroupsClient; +import com.azure.resourcemanager.awsconnector.fluent.OpenSearchDomainStatusesClient; +import com.azure.resourcemanager.awsconnector.fluent.OperationsClient; +import com.azure.resourcemanager.awsconnector.fluent.OrganizationsAccountsClient; +import com.azure.resourcemanager.awsconnector.fluent.OrganizationsOrganizationsClient; +import com.azure.resourcemanager.awsconnector.fluent.RdsDbClustersClient; +import com.azure.resourcemanager.awsconnector.fluent.RdsDbInstancesClient; +import com.azure.resourcemanager.awsconnector.fluent.RdsDbSnapshotAttributesResultsClient; +import com.azure.resourcemanager.awsconnector.fluent.RdsDbSnapshotsClient; +import com.azure.resourcemanager.awsconnector.fluent.RdsEventSubscriptionsClient; +import com.azure.resourcemanager.awsconnector.fluent.RdsExportTasksClient; +import com.azure.resourcemanager.awsconnector.fluent.RedshiftClusterParameterGroupsClient; +import com.azure.resourcemanager.awsconnector.fluent.RedshiftClustersClient; +import com.azure.resourcemanager.awsconnector.fluent.Route53DomainsDomainSummariesClient; +import com.azure.resourcemanager.awsconnector.fluent.Route53HostedZonesClient; +import com.azure.resourcemanager.awsconnector.fluent.Route53ResourceRecordSetsClient; +import com.azure.resourcemanager.awsconnector.fluent.S3AccessPointsClient; +import com.azure.resourcemanager.awsconnector.fluent.S3BucketPoliciesClient; +import com.azure.resourcemanager.awsconnector.fluent.S3BucketsClient; +import com.azure.resourcemanager.awsconnector.fluent.S3ControlMultiRegionAccessPointPolicyDocumentsClient; +import com.azure.resourcemanager.awsconnector.fluent.SageMakerAppsClient; +import com.azure.resourcemanager.awsconnector.fluent.SageMakerNotebookInstanceSummariesClient; +import com.azure.resourcemanager.awsconnector.fluent.SecretsManagerResourcePoliciesClient; +import com.azure.resourcemanager.awsconnector.fluent.SecretsManagerSecretsClient; +import com.azure.resourcemanager.awsconnector.fluent.SnsSubscriptionsClient; +import com.azure.resourcemanager.awsconnector.fluent.SnsTopicsClient; +import com.azure.resourcemanager.awsconnector.fluent.SqsQueuesClient; +import com.azure.resourcemanager.awsconnector.fluent.SsmInstanceInformationsClient; +import com.azure.resourcemanager.awsconnector.fluent.SsmParametersClient; +import com.azure.resourcemanager.awsconnector.fluent.SsmResourceComplianceSummaryItemsClient; +import com.azure.resourcemanager.awsconnector.fluent.WafWebAclSummariesClient; +import com.azure.resourcemanager.awsconnector.fluent.Wafv2LoggingConfigurationsClient; +import java.io.IOException; +import java.lang.reflect.Type; +import java.nio.ByteBuffer; +import java.nio.charset.Charset; +import java.nio.charset.StandardCharsets; +import java.time.Duration; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** + * Initializes a new instance of the MicrosoftAwsConnectorImpl type. + */ +@ServiceClient(builder = MicrosoftAwsConnectorBuilder.class) +public final class MicrosoftAwsConnectorImpl implements MicrosoftAwsConnector { + /** + * The ID of the target subscription. The value must be an UUID. + */ + private final String subscriptionId; + + /** + * Gets The ID of the target subscription. The value must be an UUID. + * + * @return the subscriptionId value. + */ + public String getSubscriptionId() { + return this.subscriptionId; + } + + /** + * server parameter. + */ + private final String endpoint; + + /** + * Gets server parameter. + * + * @return the endpoint value. + */ + public String getEndpoint() { + return this.endpoint; + } + + /** + * Api Version. + */ + private final String apiVersion; + + /** + * Gets Api Version. + * + * @return the apiVersion value. + */ + public String getApiVersion() { + return this.apiVersion; + } + + /** + * The HTTP pipeline to send requests through. + */ + private final HttpPipeline httpPipeline; + + /** + * Gets The HTTP pipeline to send requests through. + * + * @return the httpPipeline value. + */ + public HttpPipeline getHttpPipeline() { + return this.httpPipeline; + } + + /** + * The serializer to serialize an object into a string. + */ + private final SerializerAdapter serializerAdapter; + + /** + * Gets The serializer to serialize an object into a string. + * + * @return the serializerAdapter value. + */ + SerializerAdapter getSerializerAdapter() { + return this.serializerAdapter; + } + + /** + * The default poll interval for long-running operation. + */ + private final Duration defaultPollInterval; + + /** + * Gets The default poll interval for long-running operation. + * + * @return the defaultPollInterval value. + */ + public Duration getDefaultPollInterval() { + return this.defaultPollInterval; + } + + /** + * The AccessAnalyzerAnalyzersClient object to access its operations. + */ + private final AccessAnalyzerAnalyzersClient accessAnalyzerAnalyzers; + + /** + * Gets the AccessAnalyzerAnalyzersClient object to access its operations. + * + * @return the AccessAnalyzerAnalyzersClient object. + */ + public AccessAnalyzerAnalyzersClient getAccessAnalyzerAnalyzers() { + return this.accessAnalyzerAnalyzers; + } + + /** + * The AcmCertificateSummariesClient object to access its operations. + */ + private final AcmCertificateSummariesClient acmCertificateSummaries; + + /** + * Gets the AcmCertificateSummariesClient object to access its operations. + * + * @return the AcmCertificateSummariesClient object. + */ + public AcmCertificateSummariesClient getAcmCertificateSummaries() { + return this.acmCertificateSummaries; + } + + /** + * The ApiGatewayRestApisClient object to access its operations. + */ + private final ApiGatewayRestApisClient apiGatewayRestApis; + + /** + * Gets the ApiGatewayRestApisClient object to access its operations. + * + * @return the ApiGatewayRestApisClient object. + */ + public ApiGatewayRestApisClient getApiGatewayRestApis() { + return this.apiGatewayRestApis; + } + + /** + * The ApiGatewayStagesClient object to access its operations. + */ + private final ApiGatewayStagesClient apiGatewayStages; + + /** + * Gets the ApiGatewayStagesClient object to access its operations. + * + * @return the ApiGatewayStagesClient object. + */ + public ApiGatewayStagesClient getApiGatewayStages() { + return this.apiGatewayStages; + } + + /** + * The AppSyncGraphqlApisClient object to access its operations. + */ + private final AppSyncGraphqlApisClient appSyncGraphqlApis; + + /** + * Gets the AppSyncGraphqlApisClient object to access its operations. + * + * @return the AppSyncGraphqlApisClient object. + */ + public AppSyncGraphqlApisClient getAppSyncGraphqlApis() { + return this.appSyncGraphqlApis; + } + + /** + * The AutoScalingAutoScalingGroupsClient object to access its operations. + */ + private final AutoScalingAutoScalingGroupsClient autoScalingAutoScalingGroups; + + /** + * Gets the AutoScalingAutoScalingGroupsClient object to access its operations. + * + * @return the AutoScalingAutoScalingGroupsClient object. + */ + public AutoScalingAutoScalingGroupsClient getAutoScalingAutoScalingGroups() { + return this.autoScalingAutoScalingGroups; + } + + /** + * The CloudFormationStacksClient object to access its operations. + */ + private final CloudFormationStacksClient cloudFormationStacks; + + /** + * Gets the CloudFormationStacksClient object to access its operations. + * + * @return the CloudFormationStacksClient object. + */ + public CloudFormationStacksClient getCloudFormationStacks() { + return this.cloudFormationStacks; + } + + /** + * The CloudFormationStackSetsClient object to access its operations. + */ + private final CloudFormationStackSetsClient cloudFormationStackSets; + + /** + * Gets the CloudFormationStackSetsClient object to access its operations. + * + * @return the CloudFormationStackSetsClient object. + */ + public CloudFormationStackSetsClient getCloudFormationStackSets() { + return this.cloudFormationStackSets; + } + + /** + * The CloudFrontDistributionsClient object to access its operations. + */ + private final CloudFrontDistributionsClient cloudFrontDistributions; + + /** + * Gets the CloudFrontDistributionsClient object to access its operations. + * + * @return the CloudFrontDistributionsClient object. + */ + public CloudFrontDistributionsClient getCloudFrontDistributions() { + return this.cloudFrontDistributions; + } + + /** + * The CloudTrailTrailsClient object to access its operations. + */ + private final CloudTrailTrailsClient cloudTrailTrails; + + /** + * Gets the CloudTrailTrailsClient object to access its operations. + * + * @return the CloudTrailTrailsClient object. + */ + public CloudTrailTrailsClient getCloudTrailTrails() { + return this.cloudTrailTrails; + } + + /** + * The CloudWatchAlarmsClient object to access its operations. + */ + private final CloudWatchAlarmsClient cloudWatchAlarms; + + /** + * Gets the CloudWatchAlarmsClient object to access its operations. + * + * @return the CloudWatchAlarmsClient object. + */ + public CloudWatchAlarmsClient getCloudWatchAlarms() { + return this.cloudWatchAlarms; + } + + /** + * The CodeBuildProjectsClient object to access its operations. + */ + private final CodeBuildProjectsClient codeBuildProjects; + + /** + * Gets the CodeBuildProjectsClient object to access its operations. + * + * @return the CodeBuildProjectsClient object. + */ + public CodeBuildProjectsClient getCodeBuildProjects() { + return this.codeBuildProjects; + } + + /** + * The CodeBuildSourceCredentialsInfosClient object to access its operations. + */ + private final CodeBuildSourceCredentialsInfosClient codeBuildSourceCredentialsInfos; + + /** + * Gets the CodeBuildSourceCredentialsInfosClient object to access its operations. + * + * @return the CodeBuildSourceCredentialsInfosClient object. + */ + public CodeBuildSourceCredentialsInfosClient getCodeBuildSourceCredentialsInfos() { + return this.codeBuildSourceCredentialsInfos; + } + + /** + * The ConfigServiceConfigurationRecordersClient object to access its operations. + */ + private final ConfigServiceConfigurationRecordersClient configServiceConfigurationRecorders; + + /** + * Gets the ConfigServiceConfigurationRecordersClient object to access its operations. + * + * @return the ConfigServiceConfigurationRecordersClient object. + */ + public ConfigServiceConfigurationRecordersClient getConfigServiceConfigurationRecorders() { + return this.configServiceConfigurationRecorders; + } + + /** + * The ConfigServiceConfigurationRecorderStatusesClient object to access its operations. + */ + private final ConfigServiceConfigurationRecorderStatusesClient configServiceConfigurationRecorderStatuses; + + /** + * Gets the ConfigServiceConfigurationRecorderStatusesClient object to access its operations. + * + * @return the ConfigServiceConfigurationRecorderStatusesClient object. + */ + public ConfigServiceConfigurationRecorderStatusesClient getConfigServiceConfigurationRecorderStatuses() { + return this.configServiceConfigurationRecorderStatuses; + } + + /** + * The ConfigServiceDeliveryChannelsClient object to access its operations. + */ + private final ConfigServiceDeliveryChannelsClient configServiceDeliveryChannels; + + /** + * Gets the ConfigServiceDeliveryChannelsClient object to access its operations. + * + * @return the ConfigServiceDeliveryChannelsClient object. + */ + public ConfigServiceDeliveryChannelsClient getConfigServiceDeliveryChannels() { + return this.configServiceDeliveryChannels; + } + + /** + * The DatabaseMigrationServiceReplicationInstancesClient object to access its operations. + */ + private final DatabaseMigrationServiceReplicationInstancesClient databaseMigrationServiceReplicationInstances; + + /** + * Gets the DatabaseMigrationServiceReplicationInstancesClient object to access its operations. + * + * @return the DatabaseMigrationServiceReplicationInstancesClient object. + */ + public DatabaseMigrationServiceReplicationInstancesClient getDatabaseMigrationServiceReplicationInstances() { + return this.databaseMigrationServiceReplicationInstances; + } + + /** + * The DaxClustersClient object to access its operations. + */ + private final DaxClustersClient daxClusters; + + /** + * Gets the DaxClustersClient object to access its operations. + * + * @return the DaxClustersClient object. + */ + public DaxClustersClient getDaxClusters() { + return this.daxClusters; + } + + /** + * The DynamoDbContinuousBackupsDescriptionsClient object to access its operations. + */ + private final DynamoDbContinuousBackupsDescriptionsClient dynamoDbContinuousBackupsDescriptions; + + /** + * Gets the DynamoDbContinuousBackupsDescriptionsClient object to access its operations. + * + * @return the DynamoDbContinuousBackupsDescriptionsClient object. + */ + public DynamoDbContinuousBackupsDescriptionsClient getDynamoDbContinuousBackupsDescriptions() { + return this.dynamoDbContinuousBackupsDescriptions; + } + + /** + * The DynamoDbTablesClient object to access its operations. + */ + private final DynamoDbTablesClient dynamoDbTables; + + /** + * Gets the DynamoDbTablesClient object to access its operations. + * + * @return the DynamoDbTablesClient object. + */ + public DynamoDbTablesClient getDynamoDbTables() { + return this.dynamoDbTables; + } + + /** + * The Ec2AccountAttributesClient object to access its operations. + */ + private final Ec2AccountAttributesClient ec2AccountAttributes; + + /** + * Gets the Ec2AccountAttributesClient object to access its operations. + * + * @return the Ec2AccountAttributesClient object. + */ + public Ec2AccountAttributesClient getEc2AccountAttributes() { + return this.ec2AccountAttributes; + } + + /** + * The Ec2AddressesClient object to access its operations. + */ + private final Ec2AddressesClient ec2Addresses; + + /** + * Gets the Ec2AddressesClient object to access its operations. + * + * @return the Ec2AddressesClient object. + */ + public Ec2AddressesClient getEc2Addresses() { + return this.ec2Addresses; + } + + /** + * The Ec2FlowLogsClient object to access its operations. + */ + private final Ec2FlowLogsClient ec2FlowLogs; + + /** + * Gets the Ec2FlowLogsClient object to access its operations. + * + * @return the Ec2FlowLogsClient object. + */ + public Ec2FlowLogsClient getEc2FlowLogs() { + return this.ec2FlowLogs; + } + + /** + * The Ec2ImagesClient object to access its operations. + */ + private final Ec2ImagesClient ec2Images; + + /** + * Gets the Ec2ImagesClient object to access its operations. + * + * @return the Ec2ImagesClient object. + */ + public Ec2ImagesClient getEc2Images() { + return this.ec2Images; + } + + /** + * The Ec2InstancesClient object to access its operations. + */ + private final Ec2InstancesClient ec2Instances; + + /** + * Gets the Ec2InstancesClient object to access its operations. + * + * @return the Ec2InstancesClient object. + */ + public Ec2InstancesClient getEc2Instances() { + return this.ec2Instances; + } + + /** + * The Ec2InstanceStatusesClient object to access its operations. + */ + private final Ec2InstanceStatusesClient ec2InstanceStatuses; + + /** + * Gets the Ec2InstanceStatusesClient object to access its operations. + * + * @return the Ec2InstanceStatusesClient object. + */ + public Ec2InstanceStatusesClient getEc2InstanceStatuses() { + return this.ec2InstanceStatuses; + } + + /** + * The Ec2IpamsClient object to access its operations. + */ + private final Ec2IpamsClient ec2Ipams; + + /** + * Gets the Ec2IpamsClient object to access its operations. + * + * @return the Ec2IpamsClient object. + */ + public Ec2IpamsClient getEc2Ipams() { + return this.ec2Ipams; + } + + /** + * The Ec2KeyPairsClient object to access its operations. + */ + private final Ec2KeyPairsClient ec2KeyPairs; + + /** + * Gets the Ec2KeyPairsClient object to access its operations. + * + * @return the Ec2KeyPairsClient object. + */ + public Ec2KeyPairsClient getEc2KeyPairs() { + return this.ec2KeyPairs; + } + + /** + * The Ec2NetworkAclsClient object to access its operations. + */ + private final Ec2NetworkAclsClient ec2NetworkAcls; + + /** + * Gets the Ec2NetworkAclsClient object to access its operations. + * + * @return the Ec2NetworkAclsClient object. + */ + public Ec2NetworkAclsClient getEc2NetworkAcls() { + return this.ec2NetworkAcls; + } + + /** + * The Ec2NetworkInterfacesClient object to access its operations. + */ + private final Ec2NetworkInterfacesClient ec2NetworkInterfaces; + + /** + * Gets the Ec2NetworkInterfacesClient object to access its operations. + * + * @return the Ec2NetworkInterfacesClient object. + */ + public Ec2NetworkInterfacesClient getEc2NetworkInterfaces() { + return this.ec2NetworkInterfaces; + } + + /** + * The Ec2RouteTablesClient object to access its operations. + */ + private final Ec2RouteTablesClient ec2RouteTables; + + /** + * Gets the Ec2RouteTablesClient object to access its operations. + * + * @return the Ec2RouteTablesClient object. + */ + public Ec2RouteTablesClient getEc2RouteTables() { + return this.ec2RouteTables; + } + + /** + * The Ec2SecurityGroupsClient object to access its operations. + */ + private final Ec2SecurityGroupsClient ec2SecurityGroups; + + /** + * Gets the Ec2SecurityGroupsClient object to access its operations. + * + * @return the Ec2SecurityGroupsClient object. + */ + public Ec2SecurityGroupsClient getEc2SecurityGroups() { + return this.ec2SecurityGroups; + } + + /** + * The Ec2SnapshotsClient object to access its operations. + */ + private final Ec2SnapshotsClient ec2Snapshots; + + /** + * Gets the Ec2SnapshotsClient object to access its operations. + * + * @return the Ec2SnapshotsClient object. + */ + public Ec2SnapshotsClient getEc2Snapshots() { + return this.ec2Snapshots; + } + + /** + * The Ec2SubnetsClient object to access its operations. + */ + private final Ec2SubnetsClient ec2Subnets; + + /** + * Gets the Ec2SubnetsClient object to access its operations. + * + * @return the Ec2SubnetsClient object. + */ + public Ec2SubnetsClient getEc2Subnets() { + return this.ec2Subnets; + } + + /** + * The Ec2VolumesClient object to access its operations. + */ + private final Ec2VolumesClient ec2Volumes; + + /** + * Gets the Ec2VolumesClient object to access its operations. + * + * @return the Ec2VolumesClient object. + */ + public Ec2VolumesClient getEc2Volumes() { + return this.ec2Volumes; + } + + /** + * The Ec2VpcsClient object to access its operations. + */ + private final Ec2VpcsClient ec2Vpcs; + + /** + * Gets the Ec2VpcsClient object to access its operations. + * + * @return the Ec2VpcsClient object. + */ + public Ec2VpcsClient getEc2Vpcs() { + return this.ec2Vpcs; + } + + /** + * The Ec2VpcEndpointsClient object to access its operations. + */ + private final Ec2VpcEndpointsClient ec2VpcEndpoints; + + /** + * Gets the Ec2VpcEndpointsClient object to access its operations. + * + * @return the Ec2VpcEndpointsClient object. + */ + public Ec2VpcEndpointsClient getEc2VpcEndpoints() { + return this.ec2VpcEndpoints; + } + + /** + * The Ec2VpcPeeringConnectionsClient object to access its operations. + */ + private final Ec2VpcPeeringConnectionsClient ec2VpcPeeringConnections; + + /** + * Gets the Ec2VpcPeeringConnectionsClient object to access its operations. + * + * @return the Ec2VpcPeeringConnectionsClient object. + */ + public Ec2VpcPeeringConnectionsClient getEc2VpcPeeringConnections() { + return this.ec2VpcPeeringConnections; + } + + /** + * The EcrImageDetailsClient object to access its operations. + */ + private final EcrImageDetailsClient ecrImageDetails; + + /** + * Gets the EcrImageDetailsClient object to access its operations. + * + * @return the EcrImageDetailsClient object. + */ + public EcrImageDetailsClient getEcrImageDetails() { + return this.ecrImageDetails; + } + + /** + * The EcrRepositoriesClient object to access its operations. + */ + private final EcrRepositoriesClient ecrRepositories; + + /** + * Gets the EcrRepositoriesClient object to access its operations. + * + * @return the EcrRepositoriesClient object. + */ + public EcrRepositoriesClient getEcrRepositories() { + return this.ecrRepositories; + } + + /** + * The EcsClustersClient object to access its operations. + */ + private final EcsClustersClient ecsClusters; + + /** + * Gets the EcsClustersClient object to access its operations. + * + * @return the EcsClustersClient object. + */ + public EcsClustersClient getEcsClusters() { + return this.ecsClusters; + } + + /** + * The EcsServicesClient object to access its operations. + */ + private final EcsServicesClient ecsServices; + + /** + * Gets the EcsServicesClient object to access its operations. + * + * @return the EcsServicesClient object. + */ + public EcsServicesClient getEcsServices() { + return this.ecsServices; + } + + /** + * The EcsTaskDefinitionsClient object to access its operations. + */ + private final EcsTaskDefinitionsClient ecsTaskDefinitions; + + /** + * Gets the EcsTaskDefinitionsClient object to access its operations. + * + * @return the EcsTaskDefinitionsClient object. + */ + public EcsTaskDefinitionsClient getEcsTaskDefinitions() { + return this.ecsTaskDefinitions; + } + + /** + * The EfsFileSystemsClient object to access its operations. + */ + private final EfsFileSystemsClient efsFileSystems; + + /** + * Gets the EfsFileSystemsClient object to access its operations. + * + * @return the EfsFileSystemsClient object. + */ + public EfsFileSystemsClient getEfsFileSystems() { + return this.efsFileSystems; + } + + /** + * The EfsMountTargetsClient object to access its operations. + */ + private final EfsMountTargetsClient efsMountTargets; + + /** + * Gets the EfsMountTargetsClient object to access its operations. + * + * @return the EfsMountTargetsClient object. + */ + public EfsMountTargetsClient getEfsMountTargets() { + return this.efsMountTargets; + } + + /** + * The EksClustersClient object to access its operations. + */ + private final EksClustersClient eksClusters; + + /** + * Gets the EksClustersClient object to access its operations. + * + * @return the EksClustersClient object. + */ + public EksClustersClient getEksClusters() { + return this.eksClusters; + } + + /** + * The EksNodegroupsClient object to access its operations. + */ + private final EksNodegroupsClient eksNodegroups; + + /** + * Gets the EksNodegroupsClient object to access its operations. + * + * @return the EksNodegroupsClient object. + */ + public EksNodegroupsClient getEksNodegroups() { + return this.eksNodegroups; + } + + /** + * The ElasticBeanstalkApplicationsClient object to access its operations. + */ + private final ElasticBeanstalkApplicationsClient elasticBeanstalkApplications; + + /** + * Gets the ElasticBeanstalkApplicationsClient object to access its operations. + * + * @return the ElasticBeanstalkApplicationsClient object. + */ + public ElasticBeanstalkApplicationsClient getElasticBeanstalkApplications() { + return this.elasticBeanstalkApplications; + } + + /** + * The ElasticBeanstalkConfigurationTemplatesClient object to access its operations. + */ + private final ElasticBeanstalkConfigurationTemplatesClient elasticBeanstalkConfigurationTemplates; + + /** + * Gets the ElasticBeanstalkConfigurationTemplatesClient object to access its operations. + * + * @return the ElasticBeanstalkConfigurationTemplatesClient object. + */ + public ElasticBeanstalkConfigurationTemplatesClient getElasticBeanstalkConfigurationTemplates() { + return this.elasticBeanstalkConfigurationTemplates; + } + + /** + * The ElasticBeanstalkEnvironmentsClient object to access its operations. + */ + private final ElasticBeanstalkEnvironmentsClient elasticBeanstalkEnvironments; + + /** + * Gets the ElasticBeanstalkEnvironmentsClient object to access its operations. + * + * @return the ElasticBeanstalkEnvironmentsClient object. + */ + public ElasticBeanstalkEnvironmentsClient getElasticBeanstalkEnvironments() { + return this.elasticBeanstalkEnvironments; + } + + /** + * The ElasticLoadBalancingV2ListenersClient object to access its operations. + */ + private final ElasticLoadBalancingV2ListenersClient elasticLoadBalancingV2Listeners; + + /** + * Gets the ElasticLoadBalancingV2ListenersClient object to access its operations. + * + * @return the ElasticLoadBalancingV2ListenersClient object. + */ + public ElasticLoadBalancingV2ListenersClient getElasticLoadBalancingV2Listeners() { + return this.elasticLoadBalancingV2Listeners; + } + + /** + * The ElasticLoadBalancingV2LoadBalancersClient object to access its operations. + */ + private final ElasticLoadBalancingV2LoadBalancersClient elasticLoadBalancingV2LoadBalancers; + + /** + * Gets the ElasticLoadBalancingV2LoadBalancersClient object to access its operations. + * + * @return the ElasticLoadBalancingV2LoadBalancersClient object. + */ + public ElasticLoadBalancingV2LoadBalancersClient getElasticLoadBalancingV2LoadBalancers() { + return this.elasticLoadBalancingV2LoadBalancers; + } + + /** + * The ElasticLoadBalancingV2TargetGroupsClient object to access its operations. + */ + private final ElasticLoadBalancingV2TargetGroupsClient elasticLoadBalancingV2TargetGroups; + + /** + * Gets the ElasticLoadBalancingV2TargetGroupsClient object to access its operations. + * + * @return the ElasticLoadBalancingV2TargetGroupsClient object. + */ + public ElasticLoadBalancingV2TargetGroupsClient getElasticLoadBalancingV2TargetGroups() { + return this.elasticLoadBalancingV2TargetGroups; + } + + /** + * The ElasticLoadBalancingv2TargetHealthDescriptionsClient object to access its operations. + */ + private final ElasticLoadBalancingv2TargetHealthDescriptionsClient elasticLoadBalancingv2TargetHealthDescriptions; + + /** + * Gets the ElasticLoadBalancingv2TargetHealthDescriptionsClient object to access its operations. + * + * @return the ElasticLoadBalancingv2TargetHealthDescriptionsClient object. + */ + public ElasticLoadBalancingv2TargetHealthDescriptionsClient getElasticLoadBalancingv2TargetHealthDescriptions() { + return this.elasticLoadBalancingv2TargetHealthDescriptions; + } + + /** + * The EmrClustersClient object to access its operations. + */ + private final EmrClustersClient emrClusters; + + /** + * Gets the EmrClustersClient object to access its operations. + * + * @return the EmrClustersClient object. + */ + public EmrClustersClient getEmrClusters() { + return this.emrClusters; + } + + /** + * The EmrClusterSummariesClient object to access its operations. + */ + private final EmrClusterSummariesClient emrClusterSummaries; + + /** + * Gets the EmrClusterSummariesClient object to access its operations. + * + * @return the EmrClusterSummariesClient object. + */ + public EmrClusterSummariesClient getEmrClusterSummaries() { + return this.emrClusterSummaries; + } + + /** + * The GuardDutyDetectorsClient object to access its operations. + */ + private final GuardDutyDetectorsClient guardDutyDetectors; + + /** + * Gets the GuardDutyDetectorsClient object to access its operations. + * + * @return the GuardDutyDetectorsClient object. + */ + public GuardDutyDetectorsClient getGuardDutyDetectors() { + return this.guardDutyDetectors; + } + + /** + * The IamAccessKeyLastUsedsClient object to access its operations. + */ + private final IamAccessKeyLastUsedsClient iamAccessKeyLastUseds; + + /** + * Gets the IamAccessKeyLastUsedsClient object to access its operations. + * + * @return the IamAccessKeyLastUsedsClient object. + */ + public IamAccessKeyLastUsedsClient getIamAccessKeyLastUseds() { + return this.iamAccessKeyLastUseds; + } + + /** + * The IamAccessKeyMetadataInfoesClient object to access its operations. + */ + private final IamAccessKeyMetadataInfoesClient iamAccessKeyMetadataInfoes; + + /** + * Gets the IamAccessKeyMetadataInfoesClient object to access its operations. + * + * @return the IamAccessKeyMetadataInfoesClient object. + */ + public IamAccessKeyMetadataInfoesClient getIamAccessKeyMetadataInfoes() { + return this.iamAccessKeyMetadataInfoes; + } + + /** + * The IamGroupsClient object to access its operations. + */ + private final IamGroupsClient iamGroups; + + /** + * Gets the IamGroupsClient object to access its operations. + * + * @return the IamGroupsClient object. + */ + public IamGroupsClient getIamGroups() { + return this.iamGroups; + } + + /** + * The IamInstanceProfilesClient object to access its operations. + */ + private final IamInstanceProfilesClient iamInstanceProfiles; + + /** + * Gets the IamInstanceProfilesClient object to access its operations. + * + * @return the IamInstanceProfilesClient object. + */ + public IamInstanceProfilesClient getIamInstanceProfiles() { + return this.iamInstanceProfiles; + } + + /** + * The IamMfaDevicesClient object to access its operations. + */ + private final IamMfaDevicesClient iamMfaDevices; + + /** + * Gets the IamMfaDevicesClient object to access its operations. + * + * @return the IamMfaDevicesClient object. + */ + public IamMfaDevicesClient getIamMfaDevices() { + return this.iamMfaDevices; + } + + /** + * The IamPasswordPoliciesClient object to access its operations. + */ + private final IamPasswordPoliciesClient iamPasswordPolicies; + + /** + * Gets the IamPasswordPoliciesClient object to access its operations. + * + * @return the IamPasswordPoliciesClient object. + */ + public IamPasswordPoliciesClient getIamPasswordPolicies() { + return this.iamPasswordPolicies; + } + + /** + * The IamPolicyVersionsClient object to access its operations. + */ + private final IamPolicyVersionsClient iamPolicyVersions; + + /** + * Gets the IamPolicyVersionsClient object to access its operations. + * + * @return the IamPolicyVersionsClient object. + */ + public IamPolicyVersionsClient getIamPolicyVersions() { + return this.iamPolicyVersions; + } + + /** + * The IamRolesClient object to access its operations. + */ + private final IamRolesClient iamRoles; + + /** + * Gets the IamRolesClient object to access its operations. + * + * @return the IamRolesClient object. + */ + public IamRolesClient getIamRoles() { + return this.iamRoles; + } + + /** + * The IamServerCertificatesClient object to access its operations. + */ + private final IamServerCertificatesClient iamServerCertificates; + + /** + * Gets the IamServerCertificatesClient object to access its operations. + * + * @return the IamServerCertificatesClient object. + */ + public IamServerCertificatesClient getIamServerCertificates() { + return this.iamServerCertificates; + } + + /** + * The IamVirtualMfaDevicesClient object to access its operations. + */ + private final IamVirtualMfaDevicesClient iamVirtualMfaDevices; + + /** + * Gets the IamVirtualMfaDevicesClient object to access its operations. + * + * @return the IamVirtualMfaDevicesClient object. + */ + public IamVirtualMfaDevicesClient getIamVirtualMfaDevices() { + return this.iamVirtualMfaDevices; + } + + /** + * The KmsAliasesClient object to access its operations. + */ + private final KmsAliasesClient kmsAliases; + + /** + * Gets the KmsAliasesClient object to access its operations. + * + * @return the KmsAliasesClient object. + */ + public KmsAliasesClient getKmsAliases() { + return this.kmsAliases; + } + + /** + * The KmsKeysClient object to access its operations. + */ + private final KmsKeysClient kmsKeys; + + /** + * Gets the KmsKeysClient object to access its operations. + * + * @return the KmsKeysClient object. + */ + public KmsKeysClient getKmsKeys() { + return this.kmsKeys; + } + + /** + * The LambdaFunctionsClient object to access its operations. + */ + private final LambdaFunctionsClient lambdaFunctions; + + /** + * Gets the LambdaFunctionsClient object to access its operations. + * + * @return the LambdaFunctionsClient object. + */ + public LambdaFunctionsClient getLambdaFunctions() { + return this.lambdaFunctions; + } + + /** + * The LambdaFunctionCodeLocationsClient object to access its operations. + */ + private final LambdaFunctionCodeLocationsClient lambdaFunctionCodeLocations; + + /** + * Gets the LambdaFunctionCodeLocationsClient object to access its operations. + * + * @return the LambdaFunctionCodeLocationsClient object. + */ + public LambdaFunctionCodeLocationsClient getLambdaFunctionCodeLocations() { + return this.lambdaFunctionCodeLocations; + } + + /** + * The LightsailBucketsClient object to access its operations. + */ + private final LightsailBucketsClient lightsailBuckets; + + /** + * Gets the LightsailBucketsClient object to access its operations. + * + * @return the LightsailBucketsClient object. + */ + public LightsailBucketsClient getLightsailBuckets() { + return this.lightsailBuckets; + } + + /** + * The LightsailInstancesClient object to access its operations. + */ + private final LightsailInstancesClient lightsailInstances; + + /** + * Gets the LightsailInstancesClient object to access its operations. + * + * @return the LightsailInstancesClient object. + */ + public LightsailInstancesClient getLightsailInstances() { + return this.lightsailInstances; + } + + /** + * The LogsLogGroupsClient object to access its operations. + */ + private final LogsLogGroupsClient logsLogGroups; + + /** + * Gets the LogsLogGroupsClient object to access its operations. + * + * @return the LogsLogGroupsClient object. + */ + public LogsLogGroupsClient getLogsLogGroups() { + return this.logsLogGroups; + } + + /** + * The LogsLogStreamsClient object to access its operations. + */ + private final LogsLogStreamsClient logsLogStreams; + + /** + * Gets the LogsLogStreamsClient object to access its operations. + * + * @return the LogsLogStreamsClient object. + */ + public LogsLogStreamsClient getLogsLogStreams() { + return this.logsLogStreams; + } + + /** + * The LogsMetricFiltersClient object to access its operations. + */ + private final LogsMetricFiltersClient logsMetricFilters; + + /** + * Gets the LogsMetricFiltersClient object to access its operations. + * + * @return the LogsMetricFiltersClient object. + */ + public LogsMetricFiltersClient getLogsMetricFilters() { + return this.logsMetricFilters; + } + + /** + * The LogsSubscriptionFiltersClient object to access its operations. + */ + private final LogsSubscriptionFiltersClient logsSubscriptionFilters; + + /** + * Gets the LogsSubscriptionFiltersClient object to access its operations. + * + * @return the LogsSubscriptionFiltersClient object. + */ + public LogsSubscriptionFiltersClient getLogsSubscriptionFilters() { + return this.logsSubscriptionFilters; + } + + /** + * The Macie2JobSummariesClient object to access its operations. + */ + private final Macie2JobSummariesClient macie2JobSummaries; + + /** + * Gets the Macie2JobSummariesClient object to access its operations. + * + * @return the Macie2JobSummariesClient object. + */ + public Macie2JobSummariesClient getMacie2JobSummaries() { + return this.macie2JobSummaries; + } + + /** + * The MacieAllowListsClient object to access its operations. + */ + private final MacieAllowListsClient macieAllowLists; + + /** + * Gets the MacieAllowListsClient object to access its operations. + * + * @return the MacieAllowListsClient object. + */ + public MacieAllowListsClient getMacieAllowLists() { + return this.macieAllowLists; + } + + /** + * The NetworkFirewallFirewallsClient object to access its operations. + */ + private final NetworkFirewallFirewallsClient networkFirewallFirewalls; + + /** + * Gets the NetworkFirewallFirewallsClient object to access its operations. + * + * @return the NetworkFirewallFirewallsClient object. + */ + public NetworkFirewallFirewallsClient getNetworkFirewallFirewalls() { + return this.networkFirewallFirewalls; + } + + /** + * The NetworkFirewallFirewallPoliciesClient object to access its operations. + */ + private final NetworkFirewallFirewallPoliciesClient networkFirewallFirewallPolicies; + + /** + * Gets the NetworkFirewallFirewallPoliciesClient object to access its operations. + * + * @return the NetworkFirewallFirewallPoliciesClient object. + */ + public NetworkFirewallFirewallPoliciesClient getNetworkFirewallFirewallPolicies() { + return this.networkFirewallFirewallPolicies; + } + + /** + * The NetworkFirewallRuleGroupsClient object to access its operations. + */ + private final NetworkFirewallRuleGroupsClient networkFirewallRuleGroups; + + /** + * Gets the NetworkFirewallRuleGroupsClient object to access its operations. + * + * @return the NetworkFirewallRuleGroupsClient object. + */ + public NetworkFirewallRuleGroupsClient getNetworkFirewallRuleGroups() { + return this.networkFirewallRuleGroups; + } + + /** + * The OpenSearchDomainStatusesClient object to access its operations. + */ + private final OpenSearchDomainStatusesClient openSearchDomainStatuses; + + /** + * Gets the OpenSearchDomainStatusesClient object to access its operations. + * + * @return the OpenSearchDomainStatusesClient object. + */ + public OpenSearchDomainStatusesClient getOpenSearchDomainStatuses() { + return this.openSearchDomainStatuses; + } + + /** + * The OperationsClient object to access its operations. + */ + private final OperationsClient operations; + + /** + * Gets the OperationsClient object to access its operations. + * + * @return the OperationsClient object. + */ + public OperationsClient getOperations() { + return this.operations; + } + + /** + * The OrganizationsAccountsClient object to access its operations. + */ + private final OrganizationsAccountsClient organizationsAccounts; + + /** + * Gets the OrganizationsAccountsClient object to access its operations. + * + * @return the OrganizationsAccountsClient object. + */ + public OrganizationsAccountsClient getOrganizationsAccounts() { + return this.organizationsAccounts; + } + + /** + * The OrganizationsOrganizationsClient object to access its operations. + */ + private final OrganizationsOrganizationsClient organizationsOrganizations; + + /** + * Gets the OrganizationsOrganizationsClient object to access its operations. + * + * @return the OrganizationsOrganizationsClient object. + */ + public OrganizationsOrganizationsClient getOrganizationsOrganizations() { + return this.organizationsOrganizations; + } + + /** + * The RdsDbClustersClient object to access its operations. + */ + private final RdsDbClustersClient rdsDbClusters; + + /** + * Gets the RdsDbClustersClient object to access its operations. + * + * @return the RdsDbClustersClient object. + */ + public RdsDbClustersClient getRdsDbClusters() { + return this.rdsDbClusters; + } + + /** + * The RdsDbInstancesClient object to access its operations. + */ + private final RdsDbInstancesClient rdsDbInstances; + + /** + * Gets the RdsDbInstancesClient object to access its operations. + * + * @return the RdsDbInstancesClient object. + */ + public RdsDbInstancesClient getRdsDbInstances() { + return this.rdsDbInstances; + } + + /** + * The RdsDbSnapshotsClient object to access its operations. + */ + private final RdsDbSnapshotsClient rdsDbSnapshots; + + /** + * Gets the RdsDbSnapshotsClient object to access its operations. + * + * @return the RdsDbSnapshotsClient object. + */ + public RdsDbSnapshotsClient getRdsDbSnapshots() { + return this.rdsDbSnapshots; + } + + /** + * The RdsDbSnapshotAttributesResultsClient object to access its operations. + */ + private final RdsDbSnapshotAttributesResultsClient rdsDbSnapshotAttributesResults; + + /** + * Gets the RdsDbSnapshotAttributesResultsClient object to access its operations. + * + * @return the RdsDbSnapshotAttributesResultsClient object. + */ + public RdsDbSnapshotAttributesResultsClient getRdsDbSnapshotAttributesResults() { + return this.rdsDbSnapshotAttributesResults; + } + + /** + * The RdsEventSubscriptionsClient object to access its operations. + */ + private final RdsEventSubscriptionsClient rdsEventSubscriptions; + + /** + * Gets the RdsEventSubscriptionsClient object to access its operations. + * + * @return the RdsEventSubscriptionsClient object. + */ + public RdsEventSubscriptionsClient getRdsEventSubscriptions() { + return this.rdsEventSubscriptions; + } + + /** + * The RdsExportTasksClient object to access its operations. + */ + private final RdsExportTasksClient rdsExportTasks; + + /** + * Gets the RdsExportTasksClient object to access its operations. + * + * @return the RdsExportTasksClient object. + */ + public RdsExportTasksClient getRdsExportTasks() { + return this.rdsExportTasks; + } + + /** + * The RedshiftClustersClient object to access its operations. + */ + private final RedshiftClustersClient redshiftClusters; + + /** + * Gets the RedshiftClustersClient object to access its operations. + * + * @return the RedshiftClustersClient object. + */ + public RedshiftClustersClient getRedshiftClusters() { + return this.redshiftClusters; + } + + /** + * The RedshiftClusterParameterGroupsClient object to access its operations. + */ + private final RedshiftClusterParameterGroupsClient redshiftClusterParameterGroups; + + /** + * Gets the RedshiftClusterParameterGroupsClient object to access its operations. + * + * @return the RedshiftClusterParameterGroupsClient object. + */ + public RedshiftClusterParameterGroupsClient getRedshiftClusterParameterGroups() { + return this.redshiftClusterParameterGroups; + } + + /** + * The Route53DomainsDomainSummariesClient object to access its operations. + */ + private final Route53DomainsDomainSummariesClient route53DomainsDomainSummaries; + + /** + * Gets the Route53DomainsDomainSummariesClient object to access its operations. + * + * @return the Route53DomainsDomainSummariesClient object. + */ + public Route53DomainsDomainSummariesClient getRoute53DomainsDomainSummaries() { + return this.route53DomainsDomainSummaries; + } + + /** + * The Route53HostedZonesClient object to access its operations. + */ + private final Route53HostedZonesClient route53HostedZones; + + /** + * Gets the Route53HostedZonesClient object to access its operations. + * + * @return the Route53HostedZonesClient object. + */ + public Route53HostedZonesClient getRoute53HostedZones() { + return this.route53HostedZones; + } + + /** + * The Route53ResourceRecordSetsClient object to access its operations. + */ + private final Route53ResourceRecordSetsClient route53ResourceRecordSets; + + /** + * Gets the Route53ResourceRecordSetsClient object to access its operations. + * + * @return the Route53ResourceRecordSetsClient object. + */ + public Route53ResourceRecordSetsClient getRoute53ResourceRecordSets() { + return this.route53ResourceRecordSets; + } + + /** + * The S3AccessPointsClient object to access its operations. + */ + private final S3AccessPointsClient s3AccessPoints; + + /** + * Gets the S3AccessPointsClient object to access its operations. + * + * @return the S3AccessPointsClient object. + */ + public S3AccessPointsClient getS3AccessPoints() { + return this.s3AccessPoints; + } + + /** + * The S3BucketsClient object to access its operations. + */ + private final S3BucketsClient s3Buckets; + + /** + * Gets the S3BucketsClient object to access its operations. + * + * @return the S3BucketsClient object. + */ + public S3BucketsClient getS3Buckets() { + return this.s3Buckets; + } + + /** + * The S3BucketPoliciesClient object to access its operations. + */ + private final S3BucketPoliciesClient s3BucketPolicies; + + /** + * Gets the S3BucketPoliciesClient object to access its operations. + * + * @return the S3BucketPoliciesClient object. + */ + public S3BucketPoliciesClient getS3BucketPolicies() { + return this.s3BucketPolicies; + } + + /** + * The S3ControlMultiRegionAccessPointPolicyDocumentsClient object to access its operations. + */ + private final S3ControlMultiRegionAccessPointPolicyDocumentsClient s3ControlMultiRegionAccessPointPolicyDocuments; + + /** + * Gets the S3ControlMultiRegionAccessPointPolicyDocumentsClient object to access its operations. + * + * @return the S3ControlMultiRegionAccessPointPolicyDocumentsClient object. + */ + public S3ControlMultiRegionAccessPointPolicyDocumentsClient getS3ControlMultiRegionAccessPointPolicyDocuments() { + return this.s3ControlMultiRegionAccessPointPolicyDocuments; + } + + /** + * The SageMakerAppsClient object to access its operations. + */ + private final SageMakerAppsClient sageMakerApps; + + /** + * Gets the SageMakerAppsClient object to access its operations. + * + * @return the SageMakerAppsClient object. + */ + public SageMakerAppsClient getSageMakerApps() { + return this.sageMakerApps; + } + + /** + * The SageMakerNotebookInstanceSummariesClient object to access its operations. + */ + private final SageMakerNotebookInstanceSummariesClient sageMakerNotebookInstanceSummaries; + + /** + * Gets the SageMakerNotebookInstanceSummariesClient object to access its operations. + * + * @return the SageMakerNotebookInstanceSummariesClient object. + */ + public SageMakerNotebookInstanceSummariesClient getSageMakerNotebookInstanceSummaries() { + return this.sageMakerNotebookInstanceSummaries; + } + + /** + * The SecretsManagerResourcePoliciesClient object to access its operations. + */ + private final SecretsManagerResourcePoliciesClient secretsManagerResourcePolicies; + + /** + * Gets the SecretsManagerResourcePoliciesClient object to access its operations. + * + * @return the SecretsManagerResourcePoliciesClient object. + */ + public SecretsManagerResourcePoliciesClient getSecretsManagerResourcePolicies() { + return this.secretsManagerResourcePolicies; + } + + /** + * The SecretsManagerSecretsClient object to access its operations. + */ + private final SecretsManagerSecretsClient secretsManagerSecrets; + + /** + * Gets the SecretsManagerSecretsClient object to access its operations. + * + * @return the SecretsManagerSecretsClient object. + */ + public SecretsManagerSecretsClient getSecretsManagerSecrets() { + return this.secretsManagerSecrets; + } + + /** + * The SnsSubscriptionsClient object to access its operations. + */ + private final SnsSubscriptionsClient snsSubscriptions; + + /** + * Gets the SnsSubscriptionsClient object to access its operations. + * + * @return the SnsSubscriptionsClient object. + */ + public SnsSubscriptionsClient getSnsSubscriptions() { + return this.snsSubscriptions; + } + + /** + * The SnsTopicsClient object to access its operations. + */ + private final SnsTopicsClient snsTopics; + + /** + * Gets the SnsTopicsClient object to access its operations. + * + * @return the SnsTopicsClient object. + */ + public SnsTopicsClient getSnsTopics() { + return this.snsTopics; + } + + /** + * The SqsQueuesClient object to access its operations. + */ + private final SqsQueuesClient sqsQueues; + + /** + * Gets the SqsQueuesClient object to access its operations. + * + * @return the SqsQueuesClient object. + */ + public SqsQueuesClient getSqsQueues() { + return this.sqsQueues; + } + + /** + * The SsmInstanceInformationsClient object to access its operations. + */ + private final SsmInstanceInformationsClient ssmInstanceInformations; + + /** + * Gets the SsmInstanceInformationsClient object to access its operations. + * + * @return the SsmInstanceInformationsClient object. + */ + public SsmInstanceInformationsClient getSsmInstanceInformations() { + return this.ssmInstanceInformations; + } + + /** + * The SsmParametersClient object to access its operations. + */ + private final SsmParametersClient ssmParameters; + + /** + * Gets the SsmParametersClient object to access its operations. + * + * @return the SsmParametersClient object. + */ + public SsmParametersClient getSsmParameters() { + return this.ssmParameters; + } + + /** + * The SsmResourceComplianceSummaryItemsClient object to access its operations. + */ + private final SsmResourceComplianceSummaryItemsClient ssmResourceComplianceSummaryItems; + + /** + * Gets the SsmResourceComplianceSummaryItemsClient object to access its operations. + * + * @return the SsmResourceComplianceSummaryItemsClient object. + */ + public SsmResourceComplianceSummaryItemsClient getSsmResourceComplianceSummaryItems() { + return this.ssmResourceComplianceSummaryItems; + } + + /** + * The Wafv2LoggingConfigurationsClient object to access its operations. + */ + private final Wafv2LoggingConfigurationsClient wafv2LoggingConfigurations; + + /** + * Gets the Wafv2LoggingConfigurationsClient object to access its operations. + * + * @return the Wafv2LoggingConfigurationsClient object. + */ + public Wafv2LoggingConfigurationsClient getWafv2LoggingConfigurations() { + return this.wafv2LoggingConfigurations; + } + + /** + * The WafWebAclSummariesClient object to access its operations. + */ + private final WafWebAclSummariesClient wafWebAclSummaries; + + /** + * Gets the WafWebAclSummariesClient object to access its operations. + * + * @return the WafWebAclSummariesClient object. + */ + public WafWebAclSummariesClient getWafWebAclSummaries() { + return this.wafWebAclSummaries; + } + + /** + * Initializes an instance of MicrosoftAwsConnector client. + * + * @param httpPipeline The HTTP pipeline to send requests through. + * @param serializerAdapter The serializer to serialize an object into a string. + * @param defaultPollInterval The default poll interval for long-running operation. + * @param environment The Azure environment. + * @param subscriptionId The ID of the target subscription. The value must be an UUID. + * @param endpoint server parameter. + */ + MicrosoftAwsConnectorImpl(HttpPipeline httpPipeline, SerializerAdapter serializerAdapter, + Duration defaultPollInterval, AzureEnvironment environment, String subscriptionId, String endpoint) { + this.httpPipeline = httpPipeline; + this.serializerAdapter = serializerAdapter; + this.defaultPollInterval = defaultPollInterval; + this.subscriptionId = subscriptionId; + this.endpoint = endpoint; + this.apiVersion = "2024-12-01"; + this.accessAnalyzerAnalyzers = new AccessAnalyzerAnalyzersClientImpl(this); + this.acmCertificateSummaries = new AcmCertificateSummariesClientImpl(this); + this.apiGatewayRestApis = new ApiGatewayRestApisClientImpl(this); + this.apiGatewayStages = new ApiGatewayStagesClientImpl(this); + this.appSyncGraphqlApis = new AppSyncGraphqlApisClientImpl(this); + this.autoScalingAutoScalingGroups = new AutoScalingAutoScalingGroupsClientImpl(this); + this.cloudFormationStacks = new CloudFormationStacksClientImpl(this); + this.cloudFormationStackSets = new CloudFormationStackSetsClientImpl(this); + this.cloudFrontDistributions = new CloudFrontDistributionsClientImpl(this); + this.cloudTrailTrails = new CloudTrailTrailsClientImpl(this); + this.cloudWatchAlarms = new CloudWatchAlarmsClientImpl(this); + this.codeBuildProjects = new CodeBuildProjectsClientImpl(this); + this.codeBuildSourceCredentialsInfos = new CodeBuildSourceCredentialsInfosClientImpl(this); + this.configServiceConfigurationRecorders = new ConfigServiceConfigurationRecordersClientImpl(this); + this.configServiceConfigurationRecorderStatuses + = new ConfigServiceConfigurationRecorderStatusesClientImpl(this); + this.configServiceDeliveryChannels = new ConfigServiceDeliveryChannelsClientImpl(this); + this.databaseMigrationServiceReplicationInstances + = new DatabaseMigrationServiceReplicationInstancesClientImpl(this); + this.daxClusters = new DaxClustersClientImpl(this); + this.dynamoDbContinuousBackupsDescriptions = new DynamoDbContinuousBackupsDescriptionsClientImpl(this); + this.dynamoDbTables = new DynamoDbTablesClientImpl(this); + this.ec2AccountAttributes = new Ec2AccountAttributesClientImpl(this); + this.ec2Addresses = new Ec2AddressesClientImpl(this); + this.ec2FlowLogs = new Ec2FlowLogsClientImpl(this); + this.ec2Images = new Ec2ImagesClientImpl(this); + this.ec2Instances = new Ec2InstancesClientImpl(this); + this.ec2InstanceStatuses = new Ec2InstanceStatusesClientImpl(this); + this.ec2Ipams = new Ec2IpamsClientImpl(this); + this.ec2KeyPairs = new Ec2KeyPairsClientImpl(this); + this.ec2NetworkAcls = new Ec2NetworkAclsClientImpl(this); + this.ec2NetworkInterfaces = new Ec2NetworkInterfacesClientImpl(this); + this.ec2RouteTables = new Ec2RouteTablesClientImpl(this); + this.ec2SecurityGroups = new Ec2SecurityGroupsClientImpl(this); + this.ec2Snapshots = new Ec2SnapshotsClientImpl(this); + this.ec2Subnets = new Ec2SubnetsClientImpl(this); + this.ec2Volumes = new Ec2VolumesClientImpl(this); + this.ec2Vpcs = new Ec2VpcsClientImpl(this); + this.ec2VpcEndpoints = new Ec2VpcEndpointsClientImpl(this); + this.ec2VpcPeeringConnections = new Ec2VpcPeeringConnectionsClientImpl(this); + this.ecrImageDetails = new EcrImageDetailsClientImpl(this); + this.ecrRepositories = new EcrRepositoriesClientImpl(this); + this.ecsClusters = new EcsClustersClientImpl(this); + this.ecsServices = new EcsServicesClientImpl(this); + this.ecsTaskDefinitions = new EcsTaskDefinitionsClientImpl(this); + this.efsFileSystems = new EfsFileSystemsClientImpl(this); + this.efsMountTargets = new EfsMountTargetsClientImpl(this); + this.eksClusters = new EksClustersClientImpl(this); + this.eksNodegroups = new EksNodegroupsClientImpl(this); + this.elasticBeanstalkApplications = new ElasticBeanstalkApplicationsClientImpl(this); + this.elasticBeanstalkConfigurationTemplates = new ElasticBeanstalkConfigurationTemplatesClientImpl(this); + this.elasticBeanstalkEnvironments = new ElasticBeanstalkEnvironmentsClientImpl(this); + this.elasticLoadBalancingV2Listeners = new ElasticLoadBalancingV2ListenersClientImpl(this); + this.elasticLoadBalancingV2LoadBalancers = new ElasticLoadBalancingV2LoadBalancersClientImpl(this); + this.elasticLoadBalancingV2TargetGroups = new ElasticLoadBalancingV2TargetGroupsClientImpl(this); + this.elasticLoadBalancingv2TargetHealthDescriptions + = new ElasticLoadBalancingv2TargetHealthDescriptionsClientImpl(this); + this.emrClusters = new EmrClustersClientImpl(this); + this.emrClusterSummaries = new EmrClusterSummariesClientImpl(this); + this.guardDutyDetectors = new GuardDutyDetectorsClientImpl(this); + this.iamAccessKeyLastUseds = new IamAccessKeyLastUsedsClientImpl(this); + this.iamAccessKeyMetadataInfoes = new IamAccessKeyMetadataInfoesClientImpl(this); + this.iamGroups = new IamGroupsClientImpl(this); + this.iamInstanceProfiles = new IamInstanceProfilesClientImpl(this); + this.iamMfaDevices = new IamMfaDevicesClientImpl(this); + this.iamPasswordPolicies = new IamPasswordPoliciesClientImpl(this); + this.iamPolicyVersions = new IamPolicyVersionsClientImpl(this); + this.iamRoles = new IamRolesClientImpl(this); + this.iamServerCertificates = new IamServerCertificatesClientImpl(this); + this.iamVirtualMfaDevices = new IamVirtualMfaDevicesClientImpl(this); + this.kmsAliases = new KmsAliasesClientImpl(this); + this.kmsKeys = new KmsKeysClientImpl(this); + this.lambdaFunctions = new LambdaFunctionsClientImpl(this); + this.lambdaFunctionCodeLocations = new LambdaFunctionCodeLocationsClientImpl(this); + this.lightsailBuckets = new LightsailBucketsClientImpl(this); + this.lightsailInstances = new LightsailInstancesClientImpl(this); + this.logsLogGroups = new LogsLogGroupsClientImpl(this); + this.logsLogStreams = new LogsLogStreamsClientImpl(this); + this.logsMetricFilters = new LogsMetricFiltersClientImpl(this); + this.logsSubscriptionFilters = new LogsSubscriptionFiltersClientImpl(this); + this.macie2JobSummaries = new Macie2JobSummariesClientImpl(this); + this.macieAllowLists = new MacieAllowListsClientImpl(this); + this.networkFirewallFirewalls = new NetworkFirewallFirewallsClientImpl(this); + this.networkFirewallFirewallPolicies = new NetworkFirewallFirewallPoliciesClientImpl(this); + this.networkFirewallRuleGroups = new NetworkFirewallRuleGroupsClientImpl(this); + this.openSearchDomainStatuses = new OpenSearchDomainStatusesClientImpl(this); + this.operations = new OperationsClientImpl(this); + this.organizationsAccounts = new OrganizationsAccountsClientImpl(this); + this.organizationsOrganizations = new OrganizationsOrganizationsClientImpl(this); + this.rdsDbClusters = new RdsDbClustersClientImpl(this); + this.rdsDbInstances = new RdsDbInstancesClientImpl(this); + this.rdsDbSnapshots = new RdsDbSnapshotsClientImpl(this); + this.rdsDbSnapshotAttributesResults = new RdsDbSnapshotAttributesResultsClientImpl(this); + this.rdsEventSubscriptions = new RdsEventSubscriptionsClientImpl(this); + this.rdsExportTasks = new RdsExportTasksClientImpl(this); + this.redshiftClusters = new RedshiftClustersClientImpl(this); + this.redshiftClusterParameterGroups = new RedshiftClusterParameterGroupsClientImpl(this); + this.route53DomainsDomainSummaries = new Route53DomainsDomainSummariesClientImpl(this); + this.route53HostedZones = new Route53HostedZonesClientImpl(this); + this.route53ResourceRecordSets = new Route53ResourceRecordSetsClientImpl(this); + this.s3AccessPoints = new S3AccessPointsClientImpl(this); + this.s3Buckets = new S3BucketsClientImpl(this); + this.s3BucketPolicies = new S3BucketPoliciesClientImpl(this); + this.s3ControlMultiRegionAccessPointPolicyDocuments + = new S3ControlMultiRegionAccessPointPolicyDocumentsClientImpl(this); + this.sageMakerApps = new SageMakerAppsClientImpl(this); + this.sageMakerNotebookInstanceSummaries = new SageMakerNotebookInstanceSummariesClientImpl(this); + this.secretsManagerResourcePolicies = new SecretsManagerResourcePoliciesClientImpl(this); + this.secretsManagerSecrets = new SecretsManagerSecretsClientImpl(this); + this.snsSubscriptions = new SnsSubscriptionsClientImpl(this); + this.snsTopics = new SnsTopicsClientImpl(this); + this.sqsQueues = new SqsQueuesClientImpl(this); + this.ssmInstanceInformations = new SsmInstanceInformationsClientImpl(this); + this.ssmParameters = new SsmParametersClientImpl(this); + this.ssmResourceComplianceSummaryItems = new SsmResourceComplianceSummaryItemsClientImpl(this); + this.wafv2LoggingConfigurations = new Wafv2LoggingConfigurationsClientImpl(this); + this.wafWebAclSummaries = new WafWebAclSummariesClientImpl(this); + } + + /** + * Gets default client context. + * + * @return the default client context. + */ + public Context getContext() { + return Context.NONE; + } + + /** + * Merges default client context with provided context. + * + * @param context the context to be merged with default client context. + * @return the merged context. + */ + public Context mergeContext(Context context) { + return CoreUtils.mergeContexts(this.getContext(), context); + } + + /** + * Gets long running operation result. + * + * @param activationResponse the response of activation operation. + * @param httpPipeline the http pipeline. + * @param pollResultType type of poll result. + * @param finalResultType type of final result. + * @param context the context shared by all requests. + * @param type of poll result. + * @param type of final result. + * @return poller flux for poll result and final result. + */ + public PollerFlux, U> getLroResult(Mono>> activationResponse, + HttpPipeline httpPipeline, Type pollResultType, Type finalResultType, Context context) { + return PollerFactory.create(serializerAdapter, httpPipeline, pollResultType, finalResultType, + defaultPollInterval, activationResponse, context); + } + + /** + * Gets the final result, or an error, based on last async poll response. + * + * @param response the last async poll response. + * @param type of poll result. + * @param type of final result. + * @return the final result, or an error. + */ + public Mono getLroFinalResultOrError(AsyncPollResponse, U> response) { + if (response.getStatus() != LongRunningOperationStatus.SUCCESSFULLY_COMPLETED) { + String errorMessage; + ManagementError managementError = null; + HttpResponse errorResponse = null; + PollResult.Error lroError = response.getValue().getError(); + if (lroError != null) { + errorResponse = new HttpResponseImpl(lroError.getResponseStatusCode(), lroError.getResponseHeaders(), + lroError.getResponseBody()); + + errorMessage = response.getValue().getError().getMessage(); + String errorBody = response.getValue().getError().getResponseBody(); + if (errorBody != null) { + // try to deserialize error body to ManagementError + try { + managementError = this.getSerializerAdapter() + .deserialize(errorBody, ManagementError.class, SerializerEncoding.JSON); + if (managementError.getCode() == null || managementError.getMessage() == null) { + managementError = null; + } + } catch (IOException | RuntimeException ioe) { + LOGGER.logThrowableAsWarning(ioe); + } + } + } else { + // fallback to default error message + errorMessage = "Long running operation failed."; + } + if (managementError == null) { + // fallback to default ManagementError + managementError = new ManagementError(response.getStatus().toString(), errorMessage); + } + return Mono.error(new ManagementException(errorMessage, errorResponse, managementError)); + } else { + return response.getFinalResult(); + } + } + + private static final class HttpResponseImpl extends HttpResponse { + private final int statusCode; + + private final byte[] responseBody; + + private final HttpHeaders httpHeaders; + + HttpResponseImpl(int statusCode, HttpHeaders httpHeaders, String responseBody) { + super(null); + this.statusCode = statusCode; + this.httpHeaders = httpHeaders; + this.responseBody = responseBody == null ? null : responseBody.getBytes(StandardCharsets.UTF_8); + } + + public int getStatusCode() { + return statusCode; + } + + public String getHeaderValue(String s) { + return httpHeaders.getValue(HttpHeaderName.fromString(s)); + } + + public HttpHeaders getHeaders() { + return httpHeaders; + } + + public Flux getBody() { + return Flux.just(ByteBuffer.wrap(responseBody)); + } + + public Mono getBodyAsByteArray() { + return Mono.just(responseBody); + } + + public Mono getBodyAsString() { + return Mono.just(new String(responseBody, StandardCharsets.UTF_8)); + } + + public Mono getBodyAsString(Charset charset) { + return Mono.just(new String(responseBody, charset)); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(MicrosoftAwsConnectorImpl.class); +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/NetworkFirewallFirewallPoliciesClientImpl.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/NetworkFirewallFirewallPoliciesClientImpl.java new file mode 100644 index 000000000000..a1f72256d3c7 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/NetworkFirewallFirewallPoliciesClientImpl.java @@ -0,0 +1,1291 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.Patch; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.awsconnector.fluent.NetworkFirewallFirewallPoliciesClient; +import com.azure.resourcemanager.awsconnector.fluent.models.NetworkFirewallPolicyInner; +import com.azure.resourcemanager.awsconnector.models.NetworkFirewallPolicyListResult; +import com.azure.resourcemanager.awsconnector.models.NetworkFirewallPolicyTagsUpdate; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in NetworkFirewallFirewallPoliciesClient. + */ +public final class NetworkFirewallFirewallPoliciesClientImpl implements NetworkFirewallFirewallPoliciesClient { + /** + * The proxy service used to perform REST calls. + */ + private final NetworkFirewallFirewallPoliciesService service; + + /** + * The service client containing this operation class. + */ + private final MicrosoftAwsConnectorImpl client; + + /** + * Initializes an instance of NetworkFirewallFirewallPoliciesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + NetworkFirewallFirewallPoliciesClientImpl(MicrosoftAwsConnectorImpl client) { + this.service = RestProxy.create(NetworkFirewallFirewallPoliciesService.class, client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for MicrosoftAwsConnectorNetworkFirewallFirewallPolicies to be used by + * the proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "MicrosoftAwsConnecto") + public interface NetworkFirewallFirewallPoliciesService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.AwsConnector/networkFirewallFirewallPolicies") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/networkFirewallFirewallPolicies") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroup(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/networkFirewallFirewallPolicies/{name}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getByResourceGroup(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("name") String name, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/networkFirewallFirewallPolicies/{name}") + @ExpectedResponses({ 200, 201 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrReplace(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("name") String name, + @BodyParam("application/json") NetworkFirewallPolicyInner resource, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/networkFirewallFirewallPolicies/{name}") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> update(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("name") String name, + @BodyParam("application/json") NetworkFirewallPolicyTagsUpdate properties, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/networkFirewallFirewallPolicies/{name}") + @ExpectedResponses({ 202, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("name") String name, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listBySubscriptionNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroupNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); + } + + /** + * List NetworkFirewallFirewallPolicy resources by subscription ID. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a NetworkFirewallFirewallPolicy list operation along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync() { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List NetworkFirewallFirewallPolicy resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a NetworkFirewallFirewallPolicy list operation along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), accept, + context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * List NetworkFirewallFirewallPolicy resources by subscription ID. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a NetworkFirewallFirewallPolicy list operation as paginated response with + * {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>(() -> listSinglePageAsync(), + nextLink -> listBySubscriptionNextSinglePageAsync(nextLink)); + } + + /** + * List NetworkFirewallFirewallPolicy resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a NetworkFirewallFirewallPolicy list operation as paginated response with + * {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(Context context) { + return new PagedFlux<>(() -> listSinglePageAsync(context), + nextLink -> listBySubscriptionNextSinglePageAsync(nextLink, context)); + } + + /** + * List NetworkFirewallFirewallPolicy resources by subscription ID. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a NetworkFirewallFirewallPolicy list operation as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + return new PagedIterable<>(listAsync()); + } + + /** + * List NetworkFirewallFirewallPolicy resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a NetworkFirewallFirewallPolicy list operation as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Context context) { + return new PagedIterable<>(listAsync(context)); + } + + /** + * List NetworkFirewallFirewallPolicy resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a NetworkFirewallFirewallPolicy list operation along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> + listByResourceGroupSinglePageAsync(String resourceGroupName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List NetworkFirewallFirewallPolicy resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a NetworkFirewallFirewallPolicy list operation along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * List NetworkFirewallFirewallPolicy resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a NetworkFirewallFirewallPolicy list operation as paginated response with + * {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName) { + return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); + } + + /** + * List NetworkFirewallFirewallPolicy resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a NetworkFirewallFirewallPolicy list operation as paginated response with + * {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName, Context context) { + return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName, context), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink, context)); + } + + /** + * List NetworkFirewallFirewallPolicy resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a NetworkFirewallFirewallPolicy list operation as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName)); + } + + /** + * List NetworkFirewallFirewallPolicy resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a NetworkFirewallFirewallPolicy list operation as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, context)); + } + + /** + * Get a NetworkFirewallFirewallPolicy. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of NetworkFirewallFirewallPolicy. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a NetworkFirewallFirewallPolicy along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync(String resourceGroupName, + String name) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.getByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get a NetworkFirewallFirewallPolicy. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of NetworkFirewallFirewallPolicy. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a NetworkFirewallFirewallPolicy along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync(String resourceGroupName, + String name, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.getByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, accept, context); + } + + /** + * Get a NetworkFirewallFirewallPolicy. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of NetworkFirewallFirewallPolicy. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a NetworkFirewallFirewallPolicy on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getByResourceGroupAsync(String resourceGroupName, String name) { + return getByResourceGroupWithResponseAsync(resourceGroupName, name) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Get a NetworkFirewallFirewallPolicy. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of NetworkFirewallFirewallPolicy. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a NetworkFirewallFirewallPolicy along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getByResourceGroupWithResponse(String resourceGroupName, String name, + Context context) { + return getByResourceGroupWithResponseAsync(resourceGroupName, name, context).block(); + } + + /** + * Get a NetworkFirewallFirewallPolicy. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of NetworkFirewallFirewallPolicy. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a NetworkFirewallFirewallPolicy. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public NetworkFirewallPolicyInner getByResourceGroup(String resourceGroupName, String name) { + return getByResourceGroupWithResponse(resourceGroupName, name, Context.NONE).getValue(); + } + + /** + * Create a NetworkFirewallFirewallPolicy. Please note that end user resource creation is currently restricted, but + * it will be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of NetworkFirewallFirewallPolicy. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrReplaceWithResponseAsync(String resourceGroupName, String name, + NetworkFirewallPolicyInner resource) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (resource == null) { + return Mono.error(new IllegalArgumentException("Parameter resource is required and cannot be null.")); + } else { + resource.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.createOrReplace(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, resource, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Create a NetworkFirewallFirewallPolicy. Please note that end user resource creation is currently restricted, but + * it will be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of NetworkFirewallFirewallPolicy. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrReplaceWithResponseAsync(String resourceGroupName, String name, + NetworkFirewallPolicyInner resource, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (resource == null) { + return Mono.error(new IllegalArgumentException("Parameter resource is required and cannot be null.")); + } else { + resource.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.createOrReplace(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, resource, accept, context); + } + + /** + * Create a NetworkFirewallFirewallPolicy. Please note that end user resource creation is currently restricted, but + * it will be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of NetworkFirewallFirewallPolicy. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, NetworkFirewallPolicyInner> + beginCreateOrReplaceAsync(String resourceGroupName, String name, NetworkFirewallPolicyInner resource) { + Mono>> mono = createOrReplaceWithResponseAsync(resourceGroupName, name, resource); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), NetworkFirewallPolicyInner.class, NetworkFirewallPolicyInner.class, + this.client.getContext()); + } + + /** + * Create a NetworkFirewallFirewallPolicy. Please note that end user resource creation is currently restricted, but + * it will be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of NetworkFirewallFirewallPolicy. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, NetworkFirewallPolicyInner> beginCreateOrReplaceAsync( + String resourceGroupName, String name, NetworkFirewallPolicyInner resource, Context context) { + context = this.client.mergeContext(context); + Mono>> mono + = createOrReplaceWithResponseAsync(resourceGroupName, name, resource, context); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), NetworkFirewallPolicyInner.class, NetworkFirewallPolicyInner.class, context); + } + + /** + * Create a NetworkFirewallFirewallPolicy. Please note that end user resource creation is currently restricted, but + * it will be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of NetworkFirewallFirewallPolicy. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, NetworkFirewallPolicyInner> + beginCreateOrReplace(String resourceGroupName, String name, NetworkFirewallPolicyInner resource) { + return this.beginCreateOrReplaceAsync(resourceGroupName, name, resource).getSyncPoller(); + } + + /** + * Create a NetworkFirewallFirewallPolicy. Please note that end user resource creation is currently restricted, but + * it will be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of NetworkFirewallFirewallPolicy. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, NetworkFirewallPolicyInner> beginCreateOrReplace( + String resourceGroupName, String name, NetworkFirewallPolicyInner resource, Context context) { + return this.beginCreateOrReplaceAsync(resourceGroupName, name, resource, context).getSyncPoller(); + } + + /** + * Create a NetworkFirewallFirewallPolicy. Please note that end user resource creation is currently restricted, but + * it will be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of NetworkFirewallFirewallPolicy. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrReplaceAsync(String resourceGroupName, String name, + NetworkFirewallPolicyInner resource) { + return beginCreateOrReplaceAsync(resourceGroupName, name, resource).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create a NetworkFirewallFirewallPolicy. Please note that end user resource creation is currently restricted, but + * it will be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of NetworkFirewallFirewallPolicy. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrReplaceAsync(String resourceGroupName, String name, + NetworkFirewallPolicyInner resource, Context context) { + return beginCreateOrReplaceAsync(resourceGroupName, name, resource, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create a NetworkFirewallFirewallPolicy. Please note that end user resource creation is currently restricted, but + * it will be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of NetworkFirewallFirewallPolicy. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public NetworkFirewallPolicyInner createOrReplace(String resourceGroupName, String name, + NetworkFirewallPolicyInner resource) { + return createOrReplaceAsync(resourceGroupName, name, resource).block(); + } + + /** + * Create a NetworkFirewallFirewallPolicy. Please note that end user resource creation is currently restricted, but + * it will be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of NetworkFirewallFirewallPolicy. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public NetworkFirewallPolicyInner createOrReplace(String resourceGroupName, String name, + NetworkFirewallPolicyInner resource, Context context) { + return createOrReplaceAsync(resourceGroupName, name, resource, context).block(); + } + + /** + * Update a NetworkFirewallFirewallPolicy. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of NetworkFirewallFirewallPolicy. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync(String resourceGroupName, String name, + NetworkFirewallPolicyTagsUpdate properties) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (properties == null) { + return Mono.error(new IllegalArgumentException("Parameter properties is required and cannot be null.")); + } else { + properties.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.update(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, properties, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Update a NetworkFirewallFirewallPolicy. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of NetworkFirewallFirewallPolicy. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync(String resourceGroupName, String name, + NetworkFirewallPolicyTagsUpdate properties, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (properties == null) { + return Mono.error(new IllegalArgumentException("Parameter properties is required and cannot be null.")); + } else { + properties.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.update(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, name, properties, accept, context); + } + + /** + * Update a NetworkFirewallFirewallPolicy. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of NetworkFirewallFirewallPolicy. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, NetworkFirewallPolicyInner> + beginUpdateAsync(String resourceGroupName, String name, NetworkFirewallPolicyTagsUpdate properties) { + Mono>> mono = updateWithResponseAsync(resourceGroupName, name, properties); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), NetworkFirewallPolicyInner.class, NetworkFirewallPolicyInner.class, + this.client.getContext()); + } + + /** + * Update a NetworkFirewallFirewallPolicy. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of NetworkFirewallFirewallPolicy. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, NetworkFirewallPolicyInner> beginUpdateAsync( + String resourceGroupName, String name, NetworkFirewallPolicyTagsUpdate properties, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = updateWithResponseAsync(resourceGroupName, name, properties, context); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), NetworkFirewallPolicyInner.class, NetworkFirewallPolicyInner.class, context); + } + + /** + * Update a NetworkFirewallFirewallPolicy. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of NetworkFirewallFirewallPolicy. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, NetworkFirewallPolicyInner> + beginUpdate(String resourceGroupName, String name, NetworkFirewallPolicyTagsUpdate properties) { + return this.beginUpdateAsync(resourceGroupName, name, properties).getSyncPoller(); + } + + /** + * Update a NetworkFirewallFirewallPolicy. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of NetworkFirewallFirewallPolicy. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, NetworkFirewallPolicyInner> beginUpdate( + String resourceGroupName, String name, NetworkFirewallPolicyTagsUpdate properties, Context context) { + return this.beginUpdateAsync(resourceGroupName, name, properties, context).getSyncPoller(); + } + + /** + * Update a NetworkFirewallFirewallPolicy. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of NetworkFirewallFirewallPolicy. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync(String resourceGroupName, String name, + NetworkFirewallPolicyTagsUpdate properties) { + return beginUpdateAsync(resourceGroupName, name, properties).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Update a NetworkFirewallFirewallPolicy. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of NetworkFirewallFirewallPolicy. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync(String resourceGroupName, String name, + NetworkFirewallPolicyTagsUpdate properties, Context context) { + return beginUpdateAsync(resourceGroupName, name, properties, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Update a NetworkFirewallFirewallPolicy. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of NetworkFirewallFirewallPolicy. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public NetworkFirewallPolicyInner update(String resourceGroupName, String name, + NetworkFirewallPolicyTagsUpdate properties) { + return updateAsync(resourceGroupName, name, properties).block(); + } + + /** + * Update a NetworkFirewallFirewallPolicy. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of NetworkFirewallFirewallPolicy. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public NetworkFirewallPolicyInner update(String resourceGroupName, String name, + NetworkFirewallPolicyTagsUpdate properties, Context context) { + return updateAsync(resourceGroupName, name, properties, context).block(); + } + + /** + * Delete a NetworkFirewallFirewallPolicy. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of NetworkFirewallFirewallPolicy. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync(String resourceGroupName, String name) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Delete a NetworkFirewallFirewallPolicy. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of NetworkFirewallFirewallPolicy. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync(String resourceGroupName, String name, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.delete(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, name, accept, context); + } + + /** + * Delete a NetworkFirewallFirewallPolicy. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of NetworkFirewallFirewallPolicy. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String name) { + Mono>> mono = deleteWithResponseAsync(resourceGroupName, name); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); + } + + /** + * Delete a NetworkFirewallFirewallPolicy. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of NetworkFirewallFirewallPolicy. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String name, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = deleteWithResponseAsync(resourceGroupName, name, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + context); + } + + /** + * Delete a NetworkFirewallFirewallPolicy. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of NetworkFirewallFirewallPolicy. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String name) { + return this.beginDeleteAsync(resourceGroupName, name).getSyncPoller(); + } + + /** + * Delete a NetworkFirewallFirewallPolicy. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of NetworkFirewallFirewallPolicy. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String name, Context context) { + return this.beginDeleteAsync(resourceGroupName, name, context).getSyncPoller(); + } + + /** + * Delete a NetworkFirewallFirewallPolicy. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of NetworkFirewallFirewallPolicy. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String name) { + return beginDeleteAsync(resourceGroupName, name).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete a NetworkFirewallFirewallPolicy. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of NetworkFirewallFirewallPolicy. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String name, Context context) { + return beginDeleteAsync(resourceGroupName, name, context).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete a NetworkFirewallFirewallPolicy. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of NetworkFirewallFirewallPolicy. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String name) { + deleteAsync(resourceGroupName, name).block(); + } + + /** + * Delete a NetworkFirewallFirewallPolicy. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of NetworkFirewallFirewallPolicy. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String name, Context context) { + deleteAsync(resourceGroupName, name, context).block(); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a NetworkFirewallFirewallPolicy list operation along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listBySubscriptionNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a NetworkFirewallFirewallPolicy list operation along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listBySubscriptionNextSinglePageAsync(String nextLink, + Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a NetworkFirewallFirewallPolicy list operation along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a NetworkFirewallFirewallPolicy list operation along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupNextSinglePageAsync(String nextLink, + Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/NetworkFirewallFirewallPoliciesImpl.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/NetworkFirewallFirewallPoliciesImpl.java new file mode 100644 index 000000000000..088e1acfd95a --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/NetworkFirewallFirewallPoliciesImpl.java @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.awsconnector.fluent.NetworkFirewallFirewallPoliciesClient; +import com.azure.resourcemanager.awsconnector.fluent.models.NetworkFirewallPolicyInner; +import com.azure.resourcemanager.awsconnector.models.NetworkFirewallFirewallPolicies; +import com.azure.resourcemanager.awsconnector.models.NetworkFirewallPolicy; + +public final class NetworkFirewallFirewallPoliciesImpl implements NetworkFirewallFirewallPolicies { + private static final ClientLogger LOGGER = new ClientLogger(NetworkFirewallFirewallPoliciesImpl.class); + + private final NetworkFirewallFirewallPoliciesClient innerClient; + + private final com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager; + + public NetworkFirewallFirewallPoliciesImpl(NetworkFirewallFirewallPoliciesClient innerClient, + com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return ResourceManagerUtils.mapPage(inner, inner1 -> new NetworkFirewallPolicyImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new NetworkFirewallPolicyImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName); + return ResourceManagerUtils.mapPage(inner, inner1 -> new NetworkFirewallPolicyImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + PagedIterable inner + = this.serviceClient().listByResourceGroup(resourceGroupName, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new NetworkFirewallPolicyImpl(inner1, this.manager())); + } + + public Response getByResourceGroupWithResponse(String resourceGroupName, String name, + Context context) { + Response inner + = this.serviceClient().getByResourceGroupWithResponse(resourceGroupName, name, context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new NetworkFirewallPolicyImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public NetworkFirewallPolicy getByResourceGroup(String resourceGroupName, String name) { + NetworkFirewallPolicyInner inner = this.serviceClient().getByResourceGroup(resourceGroupName, name); + if (inner != null) { + return new NetworkFirewallPolicyImpl(inner, this.manager()); + } else { + return null; + } + } + + public void deleteByResourceGroup(String resourceGroupName, String name) { + this.serviceClient().delete(resourceGroupName, name); + } + + public void delete(String resourceGroupName, String name, Context context) { + this.serviceClient().delete(resourceGroupName, name, context); + } + + public NetworkFirewallPolicy getById(String id) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String name = ResourceManagerUtils.getValueFromIdByName(id, "networkFirewallFirewallPolicies"); + if (name == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException(String.format( + "The resource ID '%s' is not valid. Missing path segment 'networkFirewallFirewallPolicies'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, name, Context.NONE).getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String name = ResourceManagerUtils.getValueFromIdByName(id, "networkFirewallFirewallPolicies"); + if (name == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException(String.format( + "The resource ID '%s' is not valid. Missing path segment 'networkFirewallFirewallPolicies'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, name, context); + } + + public void deleteById(String id) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String name = ResourceManagerUtils.getValueFromIdByName(id, "networkFirewallFirewallPolicies"); + if (name == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException(String.format( + "The resource ID '%s' is not valid. Missing path segment 'networkFirewallFirewallPolicies'.", id))); + } + this.delete(resourceGroupName, name, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String name = ResourceManagerUtils.getValueFromIdByName(id, "networkFirewallFirewallPolicies"); + if (name == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException(String.format( + "The resource ID '%s' is not valid. Missing path segment 'networkFirewallFirewallPolicies'.", id))); + } + this.delete(resourceGroupName, name, context); + } + + private NetworkFirewallFirewallPoliciesClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.awsconnector.AwsconnectorManager manager() { + return this.serviceManager; + } + + public NetworkFirewallPolicyImpl define(String name) { + return new NetworkFirewallPolicyImpl(name, this.manager()); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/NetworkFirewallFirewallsClientImpl.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/NetworkFirewallFirewallsClientImpl.java new file mode 100644 index 000000000000..61b0a0aa5d94 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/NetworkFirewallFirewallsClientImpl.java @@ -0,0 +1,1282 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.Patch; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.awsconnector.fluent.NetworkFirewallFirewallsClient; +import com.azure.resourcemanager.awsconnector.fluent.models.NetworkFirewallInner; +import com.azure.resourcemanager.awsconnector.models.NetworkFirewallListResult; +import com.azure.resourcemanager.awsconnector.models.NetworkFirewallTagsUpdate; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in NetworkFirewallFirewallsClient. + */ +public final class NetworkFirewallFirewallsClientImpl implements NetworkFirewallFirewallsClient { + /** + * The proxy service used to perform REST calls. + */ + private final NetworkFirewallFirewallsService service; + + /** + * The service client containing this operation class. + */ + private final MicrosoftAwsConnectorImpl client; + + /** + * Initializes an instance of NetworkFirewallFirewallsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + NetworkFirewallFirewallsClientImpl(MicrosoftAwsConnectorImpl client) { + this.service = RestProxy.create(NetworkFirewallFirewallsService.class, client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for MicrosoftAwsConnectorNetworkFirewallFirewalls to be used by the proxy + * service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "MicrosoftAwsConnecto") + public interface NetworkFirewallFirewallsService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.AwsConnector/networkFirewallFirewalls") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/networkFirewallFirewalls") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroup(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/networkFirewallFirewalls/{name}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getByResourceGroup(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("name") String name, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/networkFirewallFirewalls/{name}") + @ExpectedResponses({ 200, 201 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrReplace(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("name") String name, + @BodyParam("application/json") NetworkFirewallInner resource, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/networkFirewallFirewalls/{name}") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> update(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("name") String name, + @BodyParam("application/json") NetworkFirewallTagsUpdate properties, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/networkFirewallFirewalls/{name}") + @ExpectedResponses({ 202, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("name") String name, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listBySubscriptionNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroupNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); + } + + /** + * List NetworkFirewallFirewall resources by subscription ID. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a NetworkFirewallFirewall list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync() { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List NetworkFirewallFirewall resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a NetworkFirewallFirewall list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), accept, + context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * List NetworkFirewallFirewall resources by subscription ID. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a NetworkFirewallFirewall list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>(() -> listSinglePageAsync(), + nextLink -> listBySubscriptionNextSinglePageAsync(nextLink)); + } + + /** + * List NetworkFirewallFirewall resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a NetworkFirewallFirewall list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(Context context) { + return new PagedFlux<>(() -> listSinglePageAsync(context), + nextLink -> listBySubscriptionNextSinglePageAsync(nextLink, context)); + } + + /** + * List NetworkFirewallFirewall resources by subscription ID. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a NetworkFirewallFirewall list operation as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + return new PagedIterable<>(listAsync()); + } + + /** + * List NetworkFirewallFirewall resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a NetworkFirewallFirewall list operation as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Context context) { + return new PagedIterable<>(listAsync(context)); + } + + /** + * List NetworkFirewallFirewall resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a NetworkFirewallFirewall list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List NetworkFirewallFirewall resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a NetworkFirewallFirewall list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * List NetworkFirewallFirewall resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a NetworkFirewallFirewall list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName) { + return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); + } + + /** + * List NetworkFirewallFirewall resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a NetworkFirewallFirewall list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName, Context context) { + return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName, context), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink, context)); + } + + /** + * List NetworkFirewallFirewall resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a NetworkFirewallFirewall list operation as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName)); + } + + /** + * List NetworkFirewallFirewall resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a NetworkFirewallFirewall list operation as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, context)); + } + + /** + * Get a NetworkFirewallFirewall. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of NetworkFirewallFirewall. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a NetworkFirewallFirewall along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync(String resourceGroupName, + String name) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.getByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get a NetworkFirewallFirewall. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of NetworkFirewallFirewall. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a NetworkFirewallFirewall along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync(String resourceGroupName, + String name, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.getByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, accept, context); + } + + /** + * Get a NetworkFirewallFirewall. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of NetworkFirewallFirewall. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a NetworkFirewallFirewall on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getByResourceGroupAsync(String resourceGroupName, String name) { + return getByResourceGroupWithResponseAsync(resourceGroupName, name) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Get a NetworkFirewallFirewall. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of NetworkFirewallFirewall. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a NetworkFirewallFirewall along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getByResourceGroupWithResponse(String resourceGroupName, String name, + Context context) { + return getByResourceGroupWithResponseAsync(resourceGroupName, name, context).block(); + } + + /** + * Get a NetworkFirewallFirewall. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of NetworkFirewallFirewall. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a NetworkFirewallFirewall. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public NetworkFirewallInner getByResourceGroup(String resourceGroupName, String name) { + return getByResourceGroupWithResponse(resourceGroupName, name, Context.NONE).getValue(); + } + + /** + * Create a NetworkFirewallFirewall. Please note that end user resource creation is currently restricted, but it + * will be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of NetworkFirewallFirewall. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrReplaceWithResponseAsync(String resourceGroupName, String name, + NetworkFirewallInner resource) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (resource == null) { + return Mono.error(new IllegalArgumentException("Parameter resource is required and cannot be null.")); + } else { + resource.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.createOrReplace(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, resource, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Create a NetworkFirewallFirewall. Please note that end user resource creation is currently restricted, but it + * will be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of NetworkFirewallFirewall. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrReplaceWithResponseAsync(String resourceGroupName, String name, + NetworkFirewallInner resource, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (resource == null) { + return Mono.error(new IllegalArgumentException("Parameter resource is required and cannot be null.")); + } else { + resource.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.createOrReplace(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, resource, accept, context); + } + + /** + * Create a NetworkFirewallFirewall. Please note that end user resource creation is currently restricted, but it + * will be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of NetworkFirewallFirewall. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, NetworkFirewallInner> + beginCreateOrReplaceAsync(String resourceGroupName, String name, NetworkFirewallInner resource) { + Mono>> mono = createOrReplaceWithResponseAsync(resourceGroupName, name, resource); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + NetworkFirewallInner.class, NetworkFirewallInner.class, this.client.getContext()); + } + + /** + * Create a NetworkFirewallFirewall. Please note that end user resource creation is currently restricted, but it + * will be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of NetworkFirewallFirewall. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, NetworkFirewallInner> beginCreateOrReplaceAsync( + String resourceGroupName, String name, NetworkFirewallInner resource, Context context) { + context = this.client.mergeContext(context); + Mono>> mono + = createOrReplaceWithResponseAsync(resourceGroupName, name, resource, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + NetworkFirewallInner.class, NetworkFirewallInner.class, context); + } + + /** + * Create a NetworkFirewallFirewall. Please note that end user resource creation is currently restricted, but it + * will be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of NetworkFirewallFirewall. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, NetworkFirewallInner> + beginCreateOrReplace(String resourceGroupName, String name, NetworkFirewallInner resource) { + return this.beginCreateOrReplaceAsync(resourceGroupName, name, resource).getSyncPoller(); + } + + /** + * Create a NetworkFirewallFirewall. Please note that end user resource creation is currently restricted, but it + * will be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of NetworkFirewallFirewall. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, NetworkFirewallInner> + beginCreateOrReplace(String resourceGroupName, String name, NetworkFirewallInner resource, Context context) { + return this.beginCreateOrReplaceAsync(resourceGroupName, name, resource, context).getSyncPoller(); + } + + /** + * Create a NetworkFirewallFirewall. Please note that end user resource creation is currently restricted, but it + * will be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of NetworkFirewallFirewall. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrReplaceAsync(String resourceGroupName, String name, + NetworkFirewallInner resource) { + return beginCreateOrReplaceAsync(resourceGroupName, name, resource).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create a NetworkFirewallFirewall. Please note that end user resource creation is currently restricted, but it + * will be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of NetworkFirewallFirewall. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrReplaceAsync(String resourceGroupName, String name, + NetworkFirewallInner resource, Context context) { + return beginCreateOrReplaceAsync(resourceGroupName, name, resource, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create a NetworkFirewallFirewall. Please note that end user resource creation is currently restricted, but it + * will be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of NetworkFirewallFirewall. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public NetworkFirewallInner createOrReplace(String resourceGroupName, String name, NetworkFirewallInner resource) { + return createOrReplaceAsync(resourceGroupName, name, resource).block(); + } + + /** + * Create a NetworkFirewallFirewall. Please note that end user resource creation is currently restricted, but it + * will be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of NetworkFirewallFirewall. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public NetworkFirewallInner createOrReplace(String resourceGroupName, String name, NetworkFirewallInner resource, + Context context) { + return createOrReplaceAsync(resourceGroupName, name, resource, context).block(); + } + + /** + * Update a NetworkFirewallFirewall. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of NetworkFirewallFirewall. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync(String resourceGroupName, String name, + NetworkFirewallTagsUpdate properties) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (properties == null) { + return Mono.error(new IllegalArgumentException("Parameter properties is required and cannot be null.")); + } else { + properties.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.update(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, properties, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Update a NetworkFirewallFirewall. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of NetworkFirewallFirewall. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync(String resourceGroupName, String name, + NetworkFirewallTagsUpdate properties, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (properties == null) { + return Mono.error(new IllegalArgumentException("Parameter properties is required and cannot be null.")); + } else { + properties.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.update(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, name, properties, accept, context); + } + + /** + * Update a NetworkFirewallFirewall. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of NetworkFirewallFirewall. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, NetworkFirewallInner> + beginUpdateAsync(String resourceGroupName, String name, NetworkFirewallTagsUpdate properties) { + Mono>> mono = updateWithResponseAsync(resourceGroupName, name, properties); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + NetworkFirewallInner.class, NetworkFirewallInner.class, this.client.getContext()); + } + + /** + * Update a NetworkFirewallFirewall. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of NetworkFirewallFirewall. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, NetworkFirewallInner> + beginUpdateAsync(String resourceGroupName, String name, NetworkFirewallTagsUpdate properties, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = updateWithResponseAsync(resourceGroupName, name, properties, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + NetworkFirewallInner.class, NetworkFirewallInner.class, context); + } + + /** + * Update a NetworkFirewallFirewall. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of NetworkFirewallFirewall. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, NetworkFirewallInner> beginUpdate(String resourceGroupName, + String name, NetworkFirewallTagsUpdate properties) { + return this.beginUpdateAsync(resourceGroupName, name, properties).getSyncPoller(); + } + + /** + * Update a NetworkFirewallFirewall. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of NetworkFirewallFirewall. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, NetworkFirewallInner> beginUpdate(String resourceGroupName, + String name, NetworkFirewallTagsUpdate properties, Context context) { + return this.beginUpdateAsync(resourceGroupName, name, properties, context).getSyncPoller(); + } + + /** + * Update a NetworkFirewallFirewall. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of NetworkFirewallFirewall. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync(String resourceGroupName, String name, + NetworkFirewallTagsUpdate properties) { + return beginUpdateAsync(resourceGroupName, name, properties).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Update a NetworkFirewallFirewall. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of NetworkFirewallFirewall. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync(String resourceGroupName, String name, + NetworkFirewallTagsUpdate properties, Context context) { + return beginUpdateAsync(resourceGroupName, name, properties, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Update a NetworkFirewallFirewall. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of NetworkFirewallFirewall. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public NetworkFirewallInner update(String resourceGroupName, String name, NetworkFirewallTagsUpdate properties) { + return updateAsync(resourceGroupName, name, properties).block(); + } + + /** + * Update a NetworkFirewallFirewall. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of NetworkFirewallFirewall. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public NetworkFirewallInner update(String resourceGroupName, String name, NetworkFirewallTagsUpdate properties, + Context context) { + return updateAsync(resourceGroupName, name, properties, context).block(); + } + + /** + * Delete a NetworkFirewallFirewall. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of NetworkFirewallFirewall. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync(String resourceGroupName, String name) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Delete a NetworkFirewallFirewall. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of NetworkFirewallFirewall. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync(String resourceGroupName, String name, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.delete(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, name, accept, context); + } + + /** + * Delete a NetworkFirewallFirewall. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of NetworkFirewallFirewall. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String name) { + Mono>> mono = deleteWithResponseAsync(resourceGroupName, name); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); + } + + /** + * Delete a NetworkFirewallFirewall. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of NetworkFirewallFirewall. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String name, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = deleteWithResponseAsync(resourceGroupName, name, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + context); + } + + /** + * Delete a NetworkFirewallFirewall. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of NetworkFirewallFirewall. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String name) { + return this.beginDeleteAsync(resourceGroupName, name).getSyncPoller(); + } + + /** + * Delete a NetworkFirewallFirewall. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of NetworkFirewallFirewall. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String name, Context context) { + return this.beginDeleteAsync(resourceGroupName, name, context).getSyncPoller(); + } + + /** + * Delete a NetworkFirewallFirewall. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of NetworkFirewallFirewall. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String name) { + return beginDeleteAsync(resourceGroupName, name).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete a NetworkFirewallFirewall. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of NetworkFirewallFirewall. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String name, Context context) { + return beginDeleteAsync(resourceGroupName, name, context).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete a NetworkFirewallFirewall. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of NetworkFirewallFirewall. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String name) { + deleteAsync(resourceGroupName, name).block(); + } + + /** + * Delete a NetworkFirewallFirewall. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of NetworkFirewallFirewall. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String name, Context context) { + deleteAsync(resourceGroupName, name, context).block(); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a NetworkFirewallFirewall list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listBySubscriptionNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a NetworkFirewallFirewall list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listBySubscriptionNextSinglePageAsync(String nextLink, + Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a NetworkFirewallFirewall list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a NetworkFirewallFirewall list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupNextSinglePageAsync(String nextLink, + Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/NetworkFirewallFirewallsImpl.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/NetworkFirewallFirewallsImpl.java new file mode 100644 index 000000000000..133f821db585 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/NetworkFirewallFirewallsImpl.java @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.awsconnector.fluent.NetworkFirewallFirewallsClient; +import com.azure.resourcemanager.awsconnector.fluent.models.NetworkFirewallInner; +import com.azure.resourcemanager.awsconnector.models.NetworkFirewall; +import com.azure.resourcemanager.awsconnector.models.NetworkFirewallFirewalls; + +public final class NetworkFirewallFirewallsImpl implements NetworkFirewallFirewalls { + private static final ClientLogger LOGGER = new ClientLogger(NetworkFirewallFirewallsImpl.class); + + private final NetworkFirewallFirewallsClient innerClient; + + private final com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager; + + public NetworkFirewallFirewallsImpl(NetworkFirewallFirewallsClient innerClient, + com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return ResourceManagerUtils.mapPage(inner, inner1 -> new NetworkFirewallImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new NetworkFirewallImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName); + return ResourceManagerUtils.mapPage(inner, inner1 -> new NetworkFirewallImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + PagedIterable inner + = this.serviceClient().listByResourceGroup(resourceGroupName, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new NetworkFirewallImpl(inner1, this.manager())); + } + + public Response getByResourceGroupWithResponse(String resourceGroupName, String name, + Context context) { + Response inner + = this.serviceClient().getByResourceGroupWithResponse(resourceGroupName, name, context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new NetworkFirewallImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public NetworkFirewall getByResourceGroup(String resourceGroupName, String name) { + NetworkFirewallInner inner = this.serviceClient().getByResourceGroup(resourceGroupName, name); + if (inner != null) { + return new NetworkFirewallImpl(inner, this.manager()); + } else { + return null; + } + } + + public void deleteByResourceGroup(String resourceGroupName, String name) { + this.serviceClient().delete(resourceGroupName, name); + } + + public void delete(String resourceGroupName, String name, Context context) { + this.serviceClient().delete(resourceGroupName, name, context); + } + + public NetworkFirewall getById(String id) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String name = ResourceManagerUtils.getValueFromIdByName(id, "networkFirewallFirewalls"); + if (name == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException(String + .format("The resource ID '%s' is not valid. Missing path segment 'networkFirewallFirewalls'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, name, Context.NONE).getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String name = ResourceManagerUtils.getValueFromIdByName(id, "networkFirewallFirewalls"); + if (name == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException(String + .format("The resource ID '%s' is not valid. Missing path segment 'networkFirewallFirewalls'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, name, context); + } + + public void deleteById(String id) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String name = ResourceManagerUtils.getValueFromIdByName(id, "networkFirewallFirewalls"); + if (name == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException(String + .format("The resource ID '%s' is not valid. Missing path segment 'networkFirewallFirewalls'.", id))); + } + this.delete(resourceGroupName, name, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String name = ResourceManagerUtils.getValueFromIdByName(id, "networkFirewallFirewalls"); + if (name == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException(String + .format("The resource ID '%s' is not valid. Missing path segment 'networkFirewallFirewalls'.", id))); + } + this.delete(resourceGroupName, name, context); + } + + private NetworkFirewallFirewallsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.awsconnector.AwsconnectorManager manager() { + return this.serviceManager; + } + + public NetworkFirewallImpl define(String name) { + return new NetworkFirewallImpl(name, this.manager()); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/NetworkFirewallImpl.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/NetworkFirewallImpl.java new file mode 100644 index 000000000000..0a3857d7f49b --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/NetworkFirewallImpl.java @@ -0,0 +1,177 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.implementation; + +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.awsconnector.fluent.models.NetworkFirewallInner; +import com.azure.resourcemanager.awsconnector.models.NetworkFirewall; +import com.azure.resourcemanager.awsconnector.models.NetworkFirewallProperties; +import com.azure.resourcemanager.awsconnector.models.NetworkFirewallTagsUpdate; +import java.util.Collections; +import java.util.Map; + +public final class NetworkFirewallImpl implements NetworkFirewall, NetworkFirewall.Definition, NetworkFirewall.Update { + private NetworkFirewallInner innerObject; + + private final com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public String location() { + return this.innerModel().location(); + } + + public Map tags() { + Map inner = this.innerModel().tags(); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } + } + + public NetworkFirewallProperties properties() { + return this.innerModel().properties(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public String resourceGroupName() { + return resourceGroupName; + } + + public NetworkFirewallInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.awsconnector.AwsconnectorManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String name; + + private NetworkFirewallTagsUpdate updateProperties; + + public NetworkFirewallImpl withExistingResourceGroup(String resourceGroupName) { + this.resourceGroupName = resourceGroupName; + return this; + } + + public NetworkFirewall create() { + this.innerObject = serviceManager.serviceClient() + .getNetworkFirewallFirewalls() + .createOrReplace(resourceGroupName, name, this.innerModel(), Context.NONE); + return this; + } + + public NetworkFirewall create(Context context) { + this.innerObject = serviceManager.serviceClient() + .getNetworkFirewallFirewalls() + .createOrReplace(resourceGroupName, name, this.innerModel(), context); + return this; + } + + NetworkFirewallImpl(String name, com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager) { + this.innerObject = new NetworkFirewallInner(); + this.serviceManager = serviceManager; + this.name = name; + } + + public NetworkFirewallImpl update() { + this.updateProperties = new NetworkFirewallTagsUpdate(); + return this; + } + + public NetworkFirewall apply() { + this.innerObject = serviceManager.serviceClient() + .getNetworkFirewallFirewalls() + .update(resourceGroupName, name, updateProperties, Context.NONE); + return this; + } + + public NetworkFirewall apply(Context context) { + this.innerObject = serviceManager.serviceClient() + .getNetworkFirewallFirewalls() + .update(resourceGroupName, name, updateProperties, context); + return this; + } + + NetworkFirewallImpl(NetworkFirewallInner innerObject, + com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.name = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "networkFirewallFirewalls"); + } + + public NetworkFirewall refresh() { + this.innerObject = serviceManager.serviceClient() + .getNetworkFirewallFirewalls() + .getByResourceGroupWithResponse(resourceGroupName, name, Context.NONE) + .getValue(); + return this; + } + + public NetworkFirewall refresh(Context context) { + this.innerObject = serviceManager.serviceClient() + .getNetworkFirewallFirewalls() + .getByResourceGroupWithResponse(resourceGroupName, name, context) + .getValue(); + return this; + } + + public NetworkFirewallImpl withRegion(Region location) { + this.innerModel().withLocation(location.toString()); + return this; + } + + public NetworkFirewallImpl withRegion(String location) { + this.innerModel().withLocation(location); + return this; + } + + public NetworkFirewallImpl withTags(Map tags) { + if (isInCreateMode()) { + this.innerModel().withTags(tags); + return this; + } else { + this.updateProperties.withTags(tags); + return this; + } + } + + public NetworkFirewallImpl withProperties(NetworkFirewallProperties properties) { + this.innerModel().withProperties(properties); + return this; + } + + private boolean isInCreateMode() { + return this.innerModel().id() == null; + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/NetworkFirewallPolicyImpl.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/NetworkFirewallPolicyImpl.java new file mode 100644 index 000000000000..46677de33703 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/NetworkFirewallPolicyImpl.java @@ -0,0 +1,178 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.implementation; + +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.awsconnector.fluent.models.NetworkFirewallPolicyInner; +import com.azure.resourcemanager.awsconnector.models.NetworkFirewallPolicy; +import com.azure.resourcemanager.awsconnector.models.NetworkFirewallPolicyProperties; +import com.azure.resourcemanager.awsconnector.models.NetworkFirewallPolicyTagsUpdate; +import java.util.Collections; +import java.util.Map; + +public final class NetworkFirewallPolicyImpl + implements NetworkFirewallPolicy, NetworkFirewallPolicy.Definition, NetworkFirewallPolicy.Update { + private NetworkFirewallPolicyInner innerObject; + + private final com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public String location() { + return this.innerModel().location(); + } + + public Map tags() { + Map inner = this.innerModel().tags(); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } + } + + public NetworkFirewallPolicyProperties properties() { + return this.innerModel().properties(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public String resourceGroupName() { + return resourceGroupName; + } + + public NetworkFirewallPolicyInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.awsconnector.AwsconnectorManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String name; + + private NetworkFirewallPolicyTagsUpdate updateProperties; + + public NetworkFirewallPolicyImpl withExistingResourceGroup(String resourceGroupName) { + this.resourceGroupName = resourceGroupName; + return this; + } + + public NetworkFirewallPolicy create() { + this.innerObject = serviceManager.serviceClient() + .getNetworkFirewallFirewallPolicies() + .createOrReplace(resourceGroupName, name, this.innerModel(), Context.NONE); + return this; + } + + public NetworkFirewallPolicy create(Context context) { + this.innerObject = serviceManager.serviceClient() + .getNetworkFirewallFirewallPolicies() + .createOrReplace(resourceGroupName, name, this.innerModel(), context); + return this; + } + + NetworkFirewallPolicyImpl(String name, com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager) { + this.innerObject = new NetworkFirewallPolicyInner(); + this.serviceManager = serviceManager; + this.name = name; + } + + public NetworkFirewallPolicyImpl update() { + this.updateProperties = new NetworkFirewallPolicyTagsUpdate(); + return this; + } + + public NetworkFirewallPolicy apply() { + this.innerObject = serviceManager.serviceClient() + .getNetworkFirewallFirewallPolicies() + .update(resourceGroupName, name, updateProperties, Context.NONE); + return this; + } + + public NetworkFirewallPolicy apply(Context context) { + this.innerObject = serviceManager.serviceClient() + .getNetworkFirewallFirewallPolicies() + .update(resourceGroupName, name, updateProperties, context); + return this; + } + + NetworkFirewallPolicyImpl(NetworkFirewallPolicyInner innerObject, + com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.name = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "networkFirewallFirewallPolicies"); + } + + public NetworkFirewallPolicy refresh() { + this.innerObject = serviceManager.serviceClient() + .getNetworkFirewallFirewallPolicies() + .getByResourceGroupWithResponse(resourceGroupName, name, Context.NONE) + .getValue(); + return this; + } + + public NetworkFirewallPolicy refresh(Context context) { + this.innerObject = serviceManager.serviceClient() + .getNetworkFirewallFirewallPolicies() + .getByResourceGroupWithResponse(resourceGroupName, name, context) + .getValue(); + return this; + } + + public NetworkFirewallPolicyImpl withRegion(Region location) { + this.innerModel().withLocation(location.toString()); + return this; + } + + public NetworkFirewallPolicyImpl withRegion(String location) { + this.innerModel().withLocation(location); + return this; + } + + public NetworkFirewallPolicyImpl withTags(Map tags) { + if (isInCreateMode()) { + this.innerModel().withTags(tags); + return this; + } else { + this.updateProperties.withTags(tags); + return this; + } + } + + public NetworkFirewallPolicyImpl withProperties(NetworkFirewallPolicyProperties properties) { + this.innerModel().withProperties(properties); + return this; + } + + private boolean isInCreateMode() { + return this.innerModel().id() == null; + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/NetworkFirewallRuleGroupImpl.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/NetworkFirewallRuleGroupImpl.java new file mode 100644 index 000000000000..52091a4da270 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/NetworkFirewallRuleGroupImpl.java @@ -0,0 +1,179 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.implementation; + +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.awsconnector.fluent.models.NetworkFirewallRuleGroupInner; +import com.azure.resourcemanager.awsconnector.models.NetworkFirewallRuleGroup; +import com.azure.resourcemanager.awsconnector.models.NetworkFirewallRuleGroupProperties; +import com.azure.resourcemanager.awsconnector.models.NetworkFirewallRuleGroupTagsUpdate; +import java.util.Collections; +import java.util.Map; + +public final class NetworkFirewallRuleGroupImpl + implements NetworkFirewallRuleGroup, NetworkFirewallRuleGroup.Definition, NetworkFirewallRuleGroup.Update { + private NetworkFirewallRuleGroupInner innerObject; + + private final com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public String location() { + return this.innerModel().location(); + } + + public Map tags() { + Map inner = this.innerModel().tags(); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } + } + + public NetworkFirewallRuleGroupProperties properties() { + return this.innerModel().properties(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public String resourceGroupName() { + return resourceGroupName; + } + + public NetworkFirewallRuleGroupInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.awsconnector.AwsconnectorManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String name; + + private NetworkFirewallRuleGroupTagsUpdate updateProperties; + + public NetworkFirewallRuleGroupImpl withExistingResourceGroup(String resourceGroupName) { + this.resourceGroupName = resourceGroupName; + return this; + } + + public NetworkFirewallRuleGroup create() { + this.innerObject = serviceManager.serviceClient() + .getNetworkFirewallRuleGroups() + .createOrReplace(resourceGroupName, name, this.innerModel(), Context.NONE); + return this; + } + + public NetworkFirewallRuleGroup create(Context context) { + this.innerObject = serviceManager.serviceClient() + .getNetworkFirewallRuleGroups() + .createOrReplace(resourceGroupName, name, this.innerModel(), context); + return this; + } + + NetworkFirewallRuleGroupImpl(String name, + com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager) { + this.innerObject = new NetworkFirewallRuleGroupInner(); + this.serviceManager = serviceManager; + this.name = name; + } + + public NetworkFirewallRuleGroupImpl update() { + this.updateProperties = new NetworkFirewallRuleGroupTagsUpdate(); + return this; + } + + public NetworkFirewallRuleGroup apply() { + this.innerObject = serviceManager.serviceClient() + .getNetworkFirewallRuleGroups() + .update(resourceGroupName, name, updateProperties, Context.NONE); + return this; + } + + public NetworkFirewallRuleGroup apply(Context context) { + this.innerObject = serviceManager.serviceClient() + .getNetworkFirewallRuleGroups() + .update(resourceGroupName, name, updateProperties, context); + return this; + } + + NetworkFirewallRuleGroupImpl(NetworkFirewallRuleGroupInner innerObject, + com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.name = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "networkFirewallRuleGroups"); + } + + public NetworkFirewallRuleGroup refresh() { + this.innerObject = serviceManager.serviceClient() + .getNetworkFirewallRuleGroups() + .getByResourceGroupWithResponse(resourceGroupName, name, Context.NONE) + .getValue(); + return this; + } + + public NetworkFirewallRuleGroup refresh(Context context) { + this.innerObject = serviceManager.serviceClient() + .getNetworkFirewallRuleGroups() + .getByResourceGroupWithResponse(resourceGroupName, name, context) + .getValue(); + return this; + } + + public NetworkFirewallRuleGroupImpl withRegion(Region location) { + this.innerModel().withLocation(location.toString()); + return this; + } + + public NetworkFirewallRuleGroupImpl withRegion(String location) { + this.innerModel().withLocation(location); + return this; + } + + public NetworkFirewallRuleGroupImpl withTags(Map tags) { + if (isInCreateMode()) { + this.innerModel().withTags(tags); + return this; + } else { + this.updateProperties.withTags(tags); + return this; + } + } + + public NetworkFirewallRuleGroupImpl withProperties(NetworkFirewallRuleGroupProperties properties) { + this.innerModel().withProperties(properties); + return this; + } + + private boolean isInCreateMode() { + return this.innerModel().id() == null; + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/NetworkFirewallRuleGroupsClientImpl.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/NetworkFirewallRuleGroupsClientImpl.java new file mode 100644 index 000000000000..1adcb43ec2ae --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/NetworkFirewallRuleGroupsClientImpl.java @@ -0,0 +1,1291 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.Patch; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.awsconnector.fluent.NetworkFirewallRuleGroupsClient; +import com.azure.resourcemanager.awsconnector.fluent.models.NetworkFirewallRuleGroupInner; +import com.azure.resourcemanager.awsconnector.models.NetworkFirewallRuleGroupListResult; +import com.azure.resourcemanager.awsconnector.models.NetworkFirewallRuleGroupTagsUpdate; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in NetworkFirewallRuleGroupsClient. + */ +public final class NetworkFirewallRuleGroupsClientImpl implements NetworkFirewallRuleGroupsClient { + /** + * The proxy service used to perform REST calls. + */ + private final NetworkFirewallRuleGroupsService service; + + /** + * The service client containing this operation class. + */ + private final MicrosoftAwsConnectorImpl client; + + /** + * Initializes an instance of NetworkFirewallRuleGroupsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + NetworkFirewallRuleGroupsClientImpl(MicrosoftAwsConnectorImpl client) { + this.service = RestProxy.create(NetworkFirewallRuleGroupsService.class, client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for MicrosoftAwsConnectorNetworkFirewallRuleGroups to be used by the + * proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "MicrosoftAwsConnecto") + public interface NetworkFirewallRuleGroupsService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.AwsConnector/networkFirewallRuleGroups") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/networkFirewallRuleGroups") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroup(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/networkFirewallRuleGroups/{name}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getByResourceGroup(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("name") String name, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/networkFirewallRuleGroups/{name}") + @ExpectedResponses({ 200, 201 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrReplace(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("name") String name, + @BodyParam("application/json") NetworkFirewallRuleGroupInner resource, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/networkFirewallRuleGroups/{name}") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> update(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("name") String name, + @BodyParam("application/json") NetworkFirewallRuleGroupTagsUpdate properties, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/networkFirewallRuleGroups/{name}") + @ExpectedResponses({ 202, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("name") String name, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listBySubscriptionNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroupNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); + } + + /** + * List NetworkFirewallRuleGroup resources by subscription ID. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a NetworkFirewallRuleGroup list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync() { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List NetworkFirewallRuleGroup resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a NetworkFirewallRuleGroup list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), accept, + context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * List NetworkFirewallRuleGroup resources by subscription ID. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a NetworkFirewallRuleGroup list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>(() -> listSinglePageAsync(), + nextLink -> listBySubscriptionNextSinglePageAsync(nextLink)); + } + + /** + * List NetworkFirewallRuleGroup resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a NetworkFirewallRuleGroup list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(Context context) { + return new PagedFlux<>(() -> listSinglePageAsync(context), + nextLink -> listBySubscriptionNextSinglePageAsync(nextLink, context)); + } + + /** + * List NetworkFirewallRuleGroup resources by subscription ID. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a NetworkFirewallRuleGroup list operation as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + return new PagedIterable<>(listAsync()); + } + + /** + * List NetworkFirewallRuleGroup resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a NetworkFirewallRuleGroup list operation as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Context context) { + return new PagedIterable<>(listAsync(context)); + } + + /** + * List NetworkFirewallRuleGroup resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a NetworkFirewallRuleGroup list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> + listByResourceGroupSinglePageAsync(String resourceGroupName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List NetworkFirewallRuleGroup resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a NetworkFirewallRuleGroup list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> + listByResourceGroupSinglePageAsync(String resourceGroupName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * List NetworkFirewallRuleGroup resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a NetworkFirewallRuleGroup list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName) { + return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); + } + + /** + * List NetworkFirewallRuleGroup resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a NetworkFirewallRuleGroup list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName, + Context context) { + return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName, context), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink, context)); + } + + /** + * List NetworkFirewallRuleGroup resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a NetworkFirewallRuleGroup list operation as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName)); + } + + /** + * List NetworkFirewallRuleGroup resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a NetworkFirewallRuleGroup list operation as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, context)); + } + + /** + * Get a NetworkFirewallRuleGroup. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of NetworkFirewallRuleGroup. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a NetworkFirewallRuleGroup along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync(String resourceGroupName, + String name) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.getByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get a NetworkFirewallRuleGroup. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of NetworkFirewallRuleGroup. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a NetworkFirewallRuleGroup along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync(String resourceGroupName, + String name, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.getByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, accept, context); + } + + /** + * Get a NetworkFirewallRuleGroup. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of NetworkFirewallRuleGroup. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a NetworkFirewallRuleGroup on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getByResourceGroupAsync(String resourceGroupName, String name) { + return getByResourceGroupWithResponseAsync(resourceGroupName, name) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Get a NetworkFirewallRuleGroup. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of NetworkFirewallRuleGroup. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a NetworkFirewallRuleGroup along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getByResourceGroupWithResponse(String resourceGroupName, String name, + Context context) { + return getByResourceGroupWithResponseAsync(resourceGroupName, name, context).block(); + } + + /** + * Get a NetworkFirewallRuleGroup. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of NetworkFirewallRuleGroup. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a NetworkFirewallRuleGroup. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public NetworkFirewallRuleGroupInner getByResourceGroup(String resourceGroupName, String name) { + return getByResourceGroupWithResponse(resourceGroupName, name, Context.NONE).getValue(); + } + + /** + * Create a NetworkFirewallRuleGroup. Please note that end user resource creation is currently restricted, but it + * will be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of NetworkFirewallRuleGroup. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrReplaceWithResponseAsync(String resourceGroupName, String name, + NetworkFirewallRuleGroupInner resource) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (resource == null) { + return Mono.error(new IllegalArgumentException("Parameter resource is required and cannot be null.")); + } else { + resource.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.createOrReplace(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, resource, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Create a NetworkFirewallRuleGroup. Please note that end user resource creation is currently restricted, but it + * will be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of NetworkFirewallRuleGroup. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrReplaceWithResponseAsync(String resourceGroupName, String name, + NetworkFirewallRuleGroupInner resource, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (resource == null) { + return Mono.error(new IllegalArgumentException("Parameter resource is required and cannot be null.")); + } else { + resource.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.createOrReplace(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, resource, accept, context); + } + + /** + * Create a NetworkFirewallRuleGroup. Please note that end user resource creation is currently restricted, but it + * will be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of NetworkFirewallRuleGroup. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, NetworkFirewallRuleGroupInner> + beginCreateOrReplaceAsync(String resourceGroupName, String name, NetworkFirewallRuleGroupInner resource) { + Mono>> mono = createOrReplaceWithResponseAsync(resourceGroupName, name, resource); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), NetworkFirewallRuleGroupInner.class, NetworkFirewallRuleGroupInner.class, + this.client.getContext()); + } + + /** + * Create a NetworkFirewallRuleGroup. Please note that end user resource creation is currently restricted, but it + * will be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of NetworkFirewallRuleGroup. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, NetworkFirewallRuleGroupInner> + beginCreateOrReplaceAsync(String resourceGroupName, String name, NetworkFirewallRuleGroupInner resource, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono + = createOrReplaceWithResponseAsync(resourceGroupName, name, resource, context); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), NetworkFirewallRuleGroupInner.class, NetworkFirewallRuleGroupInner.class, + context); + } + + /** + * Create a NetworkFirewallRuleGroup. Please note that end user resource creation is currently restricted, but it + * will be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of NetworkFirewallRuleGroup. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, NetworkFirewallRuleGroupInner> + beginCreateOrReplace(String resourceGroupName, String name, NetworkFirewallRuleGroupInner resource) { + return this.beginCreateOrReplaceAsync(resourceGroupName, name, resource).getSyncPoller(); + } + + /** + * Create a NetworkFirewallRuleGroup. Please note that end user resource creation is currently restricted, but it + * will be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of NetworkFirewallRuleGroup. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, NetworkFirewallRuleGroupInner> beginCreateOrReplace( + String resourceGroupName, String name, NetworkFirewallRuleGroupInner resource, Context context) { + return this.beginCreateOrReplaceAsync(resourceGroupName, name, resource, context).getSyncPoller(); + } + + /** + * Create a NetworkFirewallRuleGroup. Please note that end user resource creation is currently restricted, but it + * will be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of NetworkFirewallRuleGroup. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrReplaceAsync(String resourceGroupName, String name, + NetworkFirewallRuleGroupInner resource) { + return beginCreateOrReplaceAsync(resourceGroupName, name, resource).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create a NetworkFirewallRuleGroup. Please note that end user resource creation is currently restricted, but it + * will be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of NetworkFirewallRuleGroup. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrReplaceAsync(String resourceGroupName, String name, + NetworkFirewallRuleGroupInner resource, Context context) { + return beginCreateOrReplaceAsync(resourceGroupName, name, resource, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create a NetworkFirewallRuleGroup. Please note that end user resource creation is currently restricted, but it + * will be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of NetworkFirewallRuleGroup. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public NetworkFirewallRuleGroupInner createOrReplace(String resourceGroupName, String name, + NetworkFirewallRuleGroupInner resource) { + return createOrReplaceAsync(resourceGroupName, name, resource).block(); + } + + /** + * Create a NetworkFirewallRuleGroup. Please note that end user resource creation is currently restricted, but it + * will be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of NetworkFirewallRuleGroup. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public NetworkFirewallRuleGroupInner createOrReplace(String resourceGroupName, String name, + NetworkFirewallRuleGroupInner resource, Context context) { + return createOrReplaceAsync(resourceGroupName, name, resource, context).block(); + } + + /** + * Update a NetworkFirewallRuleGroup. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of NetworkFirewallRuleGroup. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync(String resourceGroupName, String name, + NetworkFirewallRuleGroupTagsUpdate properties) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (properties == null) { + return Mono.error(new IllegalArgumentException("Parameter properties is required and cannot be null.")); + } else { + properties.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.update(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, properties, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Update a NetworkFirewallRuleGroup. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of NetworkFirewallRuleGroup. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync(String resourceGroupName, String name, + NetworkFirewallRuleGroupTagsUpdate properties, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (properties == null) { + return Mono.error(new IllegalArgumentException("Parameter properties is required and cannot be null.")); + } else { + properties.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.update(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, name, properties, accept, context); + } + + /** + * Update a NetworkFirewallRuleGroup. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of NetworkFirewallRuleGroup. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, NetworkFirewallRuleGroupInner> + beginUpdateAsync(String resourceGroupName, String name, NetworkFirewallRuleGroupTagsUpdate properties) { + Mono>> mono = updateWithResponseAsync(resourceGroupName, name, properties); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), NetworkFirewallRuleGroupInner.class, NetworkFirewallRuleGroupInner.class, + this.client.getContext()); + } + + /** + * Update a NetworkFirewallRuleGroup. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of NetworkFirewallRuleGroup. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, NetworkFirewallRuleGroupInner> beginUpdateAsync( + String resourceGroupName, String name, NetworkFirewallRuleGroupTagsUpdate properties, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = updateWithResponseAsync(resourceGroupName, name, properties, context); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), NetworkFirewallRuleGroupInner.class, NetworkFirewallRuleGroupInner.class, + context); + } + + /** + * Update a NetworkFirewallRuleGroup. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of NetworkFirewallRuleGroup. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, NetworkFirewallRuleGroupInner> + beginUpdate(String resourceGroupName, String name, NetworkFirewallRuleGroupTagsUpdate properties) { + return this.beginUpdateAsync(resourceGroupName, name, properties).getSyncPoller(); + } + + /** + * Update a NetworkFirewallRuleGroup. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of NetworkFirewallRuleGroup. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, NetworkFirewallRuleGroupInner> beginUpdate( + String resourceGroupName, String name, NetworkFirewallRuleGroupTagsUpdate properties, Context context) { + return this.beginUpdateAsync(resourceGroupName, name, properties, context).getSyncPoller(); + } + + /** + * Update a NetworkFirewallRuleGroup. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of NetworkFirewallRuleGroup. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync(String resourceGroupName, String name, + NetworkFirewallRuleGroupTagsUpdate properties) { + return beginUpdateAsync(resourceGroupName, name, properties).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Update a NetworkFirewallRuleGroup. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of NetworkFirewallRuleGroup. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync(String resourceGroupName, String name, + NetworkFirewallRuleGroupTagsUpdate properties, Context context) { + return beginUpdateAsync(resourceGroupName, name, properties, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Update a NetworkFirewallRuleGroup. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of NetworkFirewallRuleGroup. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public NetworkFirewallRuleGroupInner update(String resourceGroupName, String name, + NetworkFirewallRuleGroupTagsUpdate properties) { + return updateAsync(resourceGroupName, name, properties).block(); + } + + /** + * Update a NetworkFirewallRuleGroup. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of NetworkFirewallRuleGroup. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public NetworkFirewallRuleGroupInner update(String resourceGroupName, String name, + NetworkFirewallRuleGroupTagsUpdate properties, Context context) { + return updateAsync(resourceGroupName, name, properties, context).block(); + } + + /** + * Delete a NetworkFirewallRuleGroup. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of NetworkFirewallRuleGroup. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync(String resourceGroupName, String name) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Delete a NetworkFirewallRuleGroup. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of NetworkFirewallRuleGroup. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync(String resourceGroupName, String name, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.delete(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, name, accept, context); + } + + /** + * Delete a NetworkFirewallRuleGroup. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of NetworkFirewallRuleGroup. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String name) { + Mono>> mono = deleteWithResponseAsync(resourceGroupName, name); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); + } + + /** + * Delete a NetworkFirewallRuleGroup. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of NetworkFirewallRuleGroup. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String name, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = deleteWithResponseAsync(resourceGroupName, name, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + context); + } + + /** + * Delete a NetworkFirewallRuleGroup. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of NetworkFirewallRuleGroup. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String name) { + return this.beginDeleteAsync(resourceGroupName, name).getSyncPoller(); + } + + /** + * Delete a NetworkFirewallRuleGroup. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of NetworkFirewallRuleGroup. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String name, Context context) { + return this.beginDeleteAsync(resourceGroupName, name, context).getSyncPoller(); + } + + /** + * Delete a NetworkFirewallRuleGroup. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of NetworkFirewallRuleGroup. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String name) { + return beginDeleteAsync(resourceGroupName, name).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete a NetworkFirewallRuleGroup. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of NetworkFirewallRuleGroup. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String name, Context context) { + return beginDeleteAsync(resourceGroupName, name, context).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete a NetworkFirewallRuleGroup. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of NetworkFirewallRuleGroup. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String name) { + deleteAsync(resourceGroupName, name).block(); + } + + /** + * Delete a NetworkFirewallRuleGroup. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of NetworkFirewallRuleGroup. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String name, Context context) { + deleteAsync(resourceGroupName, name, context).block(); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a NetworkFirewallRuleGroup list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listBySubscriptionNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a NetworkFirewallRuleGroup list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listBySubscriptionNextSinglePageAsync(String nextLink, + Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a NetworkFirewallRuleGroup list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a NetworkFirewallRuleGroup list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupNextSinglePageAsync(String nextLink, + Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/NetworkFirewallRuleGroupsImpl.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/NetworkFirewallRuleGroupsImpl.java new file mode 100644 index 000000000000..324acd0bd3d2 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/NetworkFirewallRuleGroupsImpl.java @@ -0,0 +1,148 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.awsconnector.fluent.NetworkFirewallRuleGroupsClient; +import com.azure.resourcemanager.awsconnector.fluent.models.NetworkFirewallRuleGroupInner; +import com.azure.resourcemanager.awsconnector.models.NetworkFirewallRuleGroup; +import com.azure.resourcemanager.awsconnector.models.NetworkFirewallRuleGroups; + +public final class NetworkFirewallRuleGroupsImpl implements NetworkFirewallRuleGroups { + private static final ClientLogger LOGGER = new ClientLogger(NetworkFirewallRuleGroupsImpl.class); + + private final NetworkFirewallRuleGroupsClient innerClient; + + private final com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager; + + public NetworkFirewallRuleGroupsImpl(NetworkFirewallRuleGroupsClient innerClient, + com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return ResourceManagerUtils.mapPage(inner, inner1 -> new NetworkFirewallRuleGroupImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new NetworkFirewallRuleGroupImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName) { + PagedIterable inner + = this.serviceClient().listByResourceGroup(resourceGroupName); + return ResourceManagerUtils.mapPage(inner, inner1 -> new NetworkFirewallRuleGroupImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + PagedIterable inner + = this.serviceClient().listByResourceGroup(resourceGroupName, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new NetworkFirewallRuleGroupImpl(inner1, this.manager())); + } + + public Response getByResourceGroupWithResponse(String resourceGroupName, String name, + Context context) { + Response inner + = this.serviceClient().getByResourceGroupWithResponse(resourceGroupName, name, context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new NetworkFirewallRuleGroupImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public NetworkFirewallRuleGroup getByResourceGroup(String resourceGroupName, String name) { + NetworkFirewallRuleGroupInner inner = this.serviceClient().getByResourceGroup(resourceGroupName, name); + if (inner != null) { + return new NetworkFirewallRuleGroupImpl(inner, this.manager()); + } else { + return null; + } + } + + public void deleteByResourceGroup(String resourceGroupName, String name) { + this.serviceClient().delete(resourceGroupName, name); + } + + public void delete(String resourceGroupName, String name, Context context) { + this.serviceClient().delete(resourceGroupName, name, context); + } + + public NetworkFirewallRuleGroup getById(String id) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String name = ResourceManagerUtils.getValueFromIdByName(id, "networkFirewallRuleGroups"); + if (name == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException(String + .format("The resource ID '%s' is not valid. Missing path segment 'networkFirewallRuleGroups'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, name, Context.NONE).getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String name = ResourceManagerUtils.getValueFromIdByName(id, "networkFirewallRuleGroups"); + if (name == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException(String + .format("The resource ID '%s' is not valid. Missing path segment 'networkFirewallRuleGroups'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, name, context); + } + + public void deleteById(String id) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String name = ResourceManagerUtils.getValueFromIdByName(id, "networkFirewallRuleGroups"); + if (name == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException(String + .format("The resource ID '%s' is not valid. Missing path segment 'networkFirewallRuleGroups'.", id))); + } + this.delete(resourceGroupName, name, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String name = ResourceManagerUtils.getValueFromIdByName(id, "networkFirewallRuleGroups"); + if (name == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException(String + .format("The resource ID '%s' is not valid. Missing path segment 'networkFirewallRuleGroups'.", id))); + } + this.delete(resourceGroupName, name, context); + } + + private NetworkFirewallRuleGroupsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.awsconnector.AwsconnectorManager manager() { + return this.serviceManager; + } + + public NetworkFirewallRuleGroupImpl define(String name) { + return new NetworkFirewallRuleGroupImpl(name, this.manager()); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/OpenSearchDomainStatusImpl.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/OpenSearchDomainStatusImpl.java new file mode 100644 index 000000000000..67aa5c2d3828 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/OpenSearchDomainStatusImpl.java @@ -0,0 +1,178 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.implementation; + +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.awsconnector.fluent.models.OpenSearchDomainStatusInner; +import com.azure.resourcemanager.awsconnector.models.OpenSearchDomainStatus; +import com.azure.resourcemanager.awsconnector.models.OpenSearchDomainStatusProperties; +import com.azure.resourcemanager.awsconnector.models.OpenSearchDomainStatusTagsUpdate; +import java.util.Collections; +import java.util.Map; + +public final class OpenSearchDomainStatusImpl + implements OpenSearchDomainStatus, OpenSearchDomainStatus.Definition, OpenSearchDomainStatus.Update { + private OpenSearchDomainStatusInner innerObject; + + private final com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public String location() { + return this.innerModel().location(); + } + + public Map tags() { + Map inner = this.innerModel().tags(); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } + } + + public OpenSearchDomainStatusProperties properties() { + return this.innerModel().properties(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public String resourceGroupName() { + return resourceGroupName; + } + + public OpenSearchDomainStatusInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.awsconnector.AwsconnectorManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String name; + + private OpenSearchDomainStatusTagsUpdate updateProperties; + + public OpenSearchDomainStatusImpl withExistingResourceGroup(String resourceGroupName) { + this.resourceGroupName = resourceGroupName; + return this; + } + + public OpenSearchDomainStatus create() { + this.innerObject = serviceManager.serviceClient() + .getOpenSearchDomainStatuses() + .createOrReplace(resourceGroupName, name, this.innerModel(), Context.NONE); + return this; + } + + public OpenSearchDomainStatus create(Context context) { + this.innerObject = serviceManager.serviceClient() + .getOpenSearchDomainStatuses() + .createOrReplace(resourceGroupName, name, this.innerModel(), context); + return this; + } + + OpenSearchDomainStatusImpl(String name, com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager) { + this.innerObject = new OpenSearchDomainStatusInner(); + this.serviceManager = serviceManager; + this.name = name; + } + + public OpenSearchDomainStatusImpl update() { + this.updateProperties = new OpenSearchDomainStatusTagsUpdate(); + return this; + } + + public OpenSearchDomainStatus apply() { + this.innerObject = serviceManager.serviceClient() + .getOpenSearchDomainStatuses() + .update(resourceGroupName, name, updateProperties, Context.NONE); + return this; + } + + public OpenSearchDomainStatus apply(Context context) { + this.innerObject = serviceManager.serviceClient() + .getOpenSearchDomainStatuses() + .update(resourceGroupName, name, updateProperties, context); + return this; + } + + OpenSearchDomainStatusImpl(OpenSearchDomainStatusInner innerObject, + com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.name = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "openSearchDomainStatuses"); + } + + public OpenSearchDomainStatus refresh() { + this.innerObject = serviceManager.serviceClient() + .getOpenSearchDomainStatuses() + .getByResourceGroupWithResponse(resourceGroupName, name, Context.NONE) + .getValue(); + return this; + } + + public OpenSearchDomainStatus refresh(Context context) { + this.innerObject = serviceManager.serviceClient() + .getOpenSearchDomainStatuses() + .getByResourceGroupWithResponse(resourceGroupName, name, context) + .getValue(); + return this; + } + + public OpenSearchDomainStatusImpl withRegion(Region location) { + this.innerModel().withLocation(location.toString()); + return this; + } + + public OpenSearchDomainStatusImpl withRegion(String location) { + this.innerModel().withLocation(location); + return this; + } + + public OpenSearchDomainStatusImpl withTags(Map tags) { + if (isInCreateMode()) { + this.innerModel().withTags(tags); + return this; + } else { + this.updateProperties.withTags(tags); + return this; + } + } + + public OpenSearchDomainStatusImpl withProperties(OpenSearchDomainStatusProperties properties) { + this.innerModel().withProperties(properties); + return this; + } + + private boolean isInCreateMode() { + return this.innerModel().id() == null; + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/OpenSearchDomainStatusesClientImpl.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/OpenSearchDomainStatusesClientImpl.java new file mode 100644 index 000000000000..b5fa968a0910 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/OpenSearchDomainStatusesClientImpl.java @@ -0,0 +1,1285 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.Patch; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.awsconnector.fluent.OpenSearchDomainStatusesClient; +import com.azure.resourcemanager.awsconnector.fluent.models.OpenSearchDomainStatusInner; +import com.azure.resourcemanager.awsconnector.models.OpenSearchDomainStatusListResult; +import com.azure.resourcemanager.awsconnector.models.OpenSearchDomainStatusTagsUpdate; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in OpenSearchDomainStatusesClient. + */ +public final class OpenSearchDomainStatusesClientImpl implements OpenSearchDomainStatusesClient { + /** + * The proxy service used to perform REST calls. + */ + private final OpenSearchDomainStatusesService service; + + /** + * The service client containing this operation class. + */ + private final MicrosoftAwsConnectorImpl client; + + /** + * Initializes an instance of OpenSearchDomainStatusesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + OpenSearchDomainStatusesClientImpl(MicrosoftAwsConnectorImpl client) { + this.service = RestProxy.create(OpenSearchDomainStatusesService.class, client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for MicrosoftAwsConnectorOpenSearchDomainStatuses to be used by the proxy + * service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "MicrosoftAwsConnecto") + public interface OpenSearchDomainStatusesService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.AwsConnector/openSearchDomainStatuses") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/openSearchDomainStatuses") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroup(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/openSearchDomainStatuses/{name}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getByResourceGroup(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("name") String name, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/openSearchDomainStatuses/{name}") + @ExpectedResponses({ 200, 201 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrReplace(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("name") String name, + @BodyParam("application/json") OpenSearchDomainStatusInner resource, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/openSearchDomainStatuses/{name}") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> update(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("name") String name, + @BodyParam("application/json") OpenSearchDomainStatusTagsUpdate properties, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/openSearchDomainStatuses/{name}") + @ExpectedResponses({ 202, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("name") String name, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listBySubscriptionNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroupNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); + } + + /** + * List OpenSearchDomainStatus resources by subscription ID. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a OpenSearchDomainStatus list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync() { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List OpenSearchDomainStatus resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a OpenSearchDomainStatus list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), accept, + context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * List OpenSearchDomainStatus resources by subscription ID. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a OpenSearchDomainStatus list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>(() -> listSinglePageAsync(), + nextLink -> listBySubscriptionNextSinglePageAsync(nextLink)); + } + + /** + * List OpenSearchDomainStatus resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a OpenSearchDomainStatus list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(Context context) { + return new PagedFlux<>(() -> listSinglePageAsync(context), + nextLink -> listBySubscriptionNextSinglePageAsync(nextLink, context)); + } + + /** + * List OpenSearchDomainStatus resources by subscription ID. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a OpenSearchDomainStatus list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + return new PagedIterable<>(listAsync()); + } + + /** + * List OpenSearchDomainStatus resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a OpenSearchDomainStatus list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Context context) { + return new PagedIterable<>(listAsync(context)); + } + + /** + * List OpenSearchDomainStatus resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a OpenSearchDomainStatus list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> + listByResourceGroupSinglePageAsync(String resourceGroupName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List OpenSearchDomainStatus resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a OpenSearchDomainStatus list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> + listByResourceGroupSinglePageAsync(String resourceGroupName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * List OpenSearchDomainStatus resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a OpenSearchDomainStatus list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName) { + return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); + } + + /** + * List OpenSearchDomainStatus resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a OpenSearchDomainStatus list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName, Context context) { + return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName, context), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink, context)); + } + + /** + * List OpenSearchDomainStatus resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a OpenSearchDomainStatus list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName)); + } + + /** + * List OpenSearchDomainStatus resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a OpenSearchDomainStatus list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, context)); + } + + /** + * Get a OpenSearchDomainStatus. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of OpenSearchDomainStatus. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a OpenSearchDomainStatus along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync(String resourceGroupName, + String name) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.getByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get a OpenSearchDomainStatus. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of OpenSearchDomainStatus. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a OpenSearchDomainStatus along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync(String resourceGroupName, + String name, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.getByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, accept, context); + } + + /** + * Get a OpenSearchDomainStatus. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of OpenSearchDomainStatus. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a OpenSearchDomainStatus on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getByResourceGroupAsync(String resourceGroupName, String name) { + return getByResourceGroupWithResponseAsync(resourceGroupName, name) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Get a OpenSearchDomainStatus. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of OpenSearchDomainStatus. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a OpenSearchDomainStatus along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getByResourceGroupWithResponse(String resourceGroupName, String name, + Context context) { + return getByResourceGroupWithResponseAsync(resourceGroupName, name, context).block(); + } + + /** + * Get a OpenSearchDomainStatus. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of OpenSearchDomainStatus. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a OpenSearchDomainStatus. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public OpenSearchDomainStatusInner getByResourceGroup(String resourceGroupName, String name) { + return getByResourceGroupWithResponse(resourceGroupName, name, Context.NONE).getValue(); + } + + /** + * Create a OpenSearchDomainStatus. Please note that end user resource creation is currently restricted, but it will + * be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of OpenSearchDomainStatus. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrReplaceWithResponseAsync(String resourceGroupName, String name, + OpenSearchDomainStatusInner resource) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (resource == null) { + return Mono.error(new IllegalArgumentException("Parameter resource is required and cannot be null.")); + } else { + resource.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.createOrReplace(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, resource, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Create a OpenSearchDomainStatus. Please note that end user resource creation is currently restricted, but it will + * be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of OpenSearchDomainStatus. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrReplaceWithResponseAsync(String resourceGroupName, String name, + OpenSearchDomainStatusInner resource, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (resource == null) { + return Mono.error(new IllegalArgumentException("Parameter resource is required and cannot be null.")); + } else { + resource.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.createOrReplace(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, resource, accept, context); + } + + /** + * Create a OpenSearchDomainStatus. Please note that end user resource creation is currently restricted, but it will + * be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of OpenSearchDomainStatus. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, OpenSearchDomainStatusInner> + beginCreateOrReplaceAsync(String resourceGroupName, String name, OpenSearchDomainStatusInner resource) { + Mono>> mono = createOrReplaceWithResponseAsync(resourceGroupName, name, resource); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), OpenSearchDomainStatusInner.class, OpenSearchDomainStatusInner.class, + this.client.getContext()); + } + + /** + * Create a OpenSearchDomainStatus. Please note that end user resource creation is currently restricted, but it will + * be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of OpenSearchDomainStatus. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, OpenSearchDomainStatusInner> beginCreateOrReplaceAsync( + String resourceGroupName, String name, OpenSearchDomainStatusInner resource, Context context) { + context = this.client.mergeContext(context); + Mono>> mono + = createOrReplaceWithResponseAsync(resourceGroupName, name, resource, context); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), OpenSearchDomainStatusInner.class, OpenSearchDomainStatusInner.class, + context); + } + + /** + * Create a OpenSearchDomainStatus. Please note that end user resource creation is currently restricted, but it will + * be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of OpenSearchDomainStatus. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, OpenSearchDomainStatusInner> + beginCreateOrReplace(String resourceGroupName, String name, OpenSearchDomainStatusInner resource) { + return this.beginCreateOrReplaceAsync(resourceGroupName, name, resource).getSyncPoller(); + } + + /** + * Create a OpenSearchDomainStatus. Please note that end user resource creation is currently restricted, but it will + * be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of OpenSearchDomainStatus. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, OpenSearchDomainStatusInner> beginCreateOrReplace( + String resourceGroupName, String name, OpenSearchDomainStatusInner resource, Context context) { + return this.beginCreateOrReplaceAsync(resourceGroupName, name, resource, context).getSyncPoller(); + } + + /** + * Create a OpenSearchDomainStatus. Please note that end user resource creation is currently restricted, but it will + * be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of OpenSearchDomainStatus. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrReplaceAsync(String resourceGroupName, String name, + OpenSearchDomainStatusInner resource) { + return beginCreateOrReplaceAsync(resourceGroupName, name, resource).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create a OpenSearchDomainStatus. Please note that end user resource creation is currently restricted, but it will + * be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of OpenSearchDomainStatus. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrReplaceAsync(String resourceGroupName, String name, + OpenSearchDomainStatusInner resource, Context context) { + return beginCreateOrReplaceAsync(resourceGroupName, name, resource, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create a OpenSearchDomainStatus. Please note that end user resource creation is currently restricted, but it will + * be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of OpenSearchDomainStatus. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public OpenSearchDomainStatusInner createOrReplace(String resourceGroupName, String name, + OpenSearchDomainStatusInner resource) { + return createOrReplaceAsync(resourceGroupName, name, resource).block(); + } + + /** + * Create a OpenSearchDomainStatus. Please note that end user resource creation is currently restricted, but it will + * be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of OpenSearchDomainStatus. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public OpenSearchDomainStatusInner createOrReplace(String resourceGroupName, String name, + OpenSearchDomainStatusInner resource, Context context) { + return createOrReplaceAsync(resourceGroupName, name, resource, context).block(); + } + + /** + * Update a OpenSearchDomainStatus. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of OpenSearchDomainStatus. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync(String resourceGroupName, String name, + OpenSearchDomainStatusTagsUpdate properties) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (properties == null) { + return Mono.error(new IllegalArgumentException("Parameter properties is required and cannot be null.")); + } else { + properties.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.update(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, properties, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Update a OpenSearchDomainStatus. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of OpenSearchDomainStatus. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync(String resourceGroupName, String name, + OpenSearchDomainStatusTagsUpdate properties, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (properties == null) { + return Mono.error(new IllegalArgumentException("Parameter properties is required and cannot be null.")); + } else { + properties.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.update(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, name, properties, accept, context); + } + + /** + * Update a OpenSearchDomainStatus. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of OpenSearchDomainStatus. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, OpenSearchDomainStatusInner> + beginUpdateAsync(String resourceGroupName, String name, OpenSearchDomainStatusTagsUpdate properties) { + Mono>> mono = updateWithResponseAsync(resourceGroupName, name, properties); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), OpenSearchDomainStatusInner.class, OpenSearchDomainStatusInner.class, + this.client.getContext()); + } + + /** + * Update a OpenSearchDomainStatus. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of OpenSearchDomainStatus. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, OpenSearchDomainStatusInner> beginUpdateAsync( + String resourceGroupName, String name, OpenSearchDomainStatusTagsUpdate properties, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = updateWithResponseAsync(resourceGroupName, name, properties, context); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), OpenSearchDomainStatusInner.class, OpenSearchDomainStatusInner.class, + context); + } + + /** + * Update a OpenSearchDomainStatus. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of OpenSearchDomainStatus. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, OpenSearchDomainStatusInner> + beginUpdate(String resourceGroupName, String name, OpenSearchDomainStatusTagsUpdate properties) { + return this.beginUpdateAsync(resourceGroupName, name, properties).getSyncPoller(); + } + + /** + * Update a OpenSearchDomainStatus. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of OpenSearchDomainStatus. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, OpenSearchDomainStatusInner> beginUpdate( + String resourceGroupName, String name, OpenSearchDomainStatusTagsUpdate properties, Context context) { + return this.beginUpdateAsync(resourceGroupName, name, properties, context).getSyncPoller(); + } + + /** + * Update a OpenSearchDomainStatus. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of OpenSearchDomainStatus. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync(String resourceGroupName, String name, + OpenSearchDomainStatusTagsUpdate properties) { + return beginUpdateAsync(resourceGroupName, name, properties).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Update a OpenSearchDomainStatus. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of OpenSearchDomainStatus. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync(String resourceGroupName, String name, + OpenSearchDomainStatusTagsUpdate properties, Context context) { + return beginUpdateAsync(resourceGroupName, name, properties, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Update a OpenSearchDomainStatus. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of OpenSearchDomainStatus. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public OpenSearchDomainStatusInner update(String resourceGroupName, String name, + OpenSearchDomainStatusTagsUpdate properties) { + return updateAsync(resourceGroupName, name, properties).block(); + } + + /** + * Update a OpenSearchDomainStatus. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of OpenSearchDomainStatus. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public OpenSearchDomainStatusInner update(String resourceGroupName, String name, + OpenSearchDomainStatusTagsUpdate properties, Context context) { + return updateAsync(resourceGroupName, name, properties, context).block(); + } + + /** + * Delete a OpenSearchDomainStatus. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of OpenSearchDomainStatus. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync(String resourceGroupName, String name) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Delete a OpenSearchDomainStatus. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of OpenSearchDomainStatus. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync(String resourceGroupName, String name, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.delete(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, name, accept, context); + } + + /** + * Delete a OpenSearchDomainStatus. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of OpenSearchDomainStatus. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String name) { + Mono>> mono = deleteWithResponseAsync(resourceGroupName, name); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); + } + + /** + * Delete a OpenSearchDomainStatus. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of OpenSearchDomainStatus. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String name, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = deleteWithResponseAsync(resourceGroupName, name, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + context); + } + + /** + * Delete a OpenSearchDomainStatus. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of OpenSearchDomainStatus. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String name) { + return this.beginDeleteAsync(resourceGroupName, name).getSyncPoller(); + } + + /** + * Delete a OpenSearchDomainStatus. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of OpenSearchDomainStatus. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String name, Context context) { + return this.beginDeleteAsync(resourceGroupName, name, context).getSyncPoller(); + } + + /** + * Delete a OpenSearchDomainStatus. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of OpenSearchDomainStatus. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String name) { + return beginDeleteAsync(resourceGroupName, name).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete a OpenSearchDomainStatus. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of OpenSearchDomainStatus. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String name, Context context) { + return beginDeleteAsync(resourceGroupName, name, context).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete a OpenSearchDomainStatus. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of OpenSearchDomainStatus. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String name) { + deleteAsync(resourceGroupName, name).block(); + } + + /** + * Delete a OpenSearchDomainStatus. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of OpenSearchDomainStatus. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String name, Context context) { + deleteAsync(resourceGroupName, name, context).block(); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a OpenSearchDomainStatus list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listBySubscriptionNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a OpenSearchDomainStatus list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listBySubscriptionNextSinglePageAsync(String nextLink, + Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a OpenSearchDomainStatus list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a OpenSearchDomainStatus list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupNextSinglePageAsync(String nextLink, + Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/OpenSearchDomainStatusesImpl.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/OpenSearchDomainStatusesImpl.java new file mode 100644 index 000000000000..ab9ae0cecfde --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/OpenSearchDomainStatusesImpl.java @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.awsconnector.fluent.OpenSearchDomainStatusesClient; +import com.azure.resourcemanager.awsconnector.fluent.models.OpenSearchDomainStatusInner; +import com.azure.resourcemanager.awsconnector.models.OpenSearchDomainStatus; +import com.azure.resourcemanager.awsconnector.models.OpenSearchDomainStatuses; + +public final class OpenSearchDomainStatusesImpl implements OpenSearchDomainStatuses { + private static final ClientLogger LOGGER = new ClientLogger(OpenSearchDomainStatusesImpl.class); + + private final OpenSearchDomainStatusesClient innerClient; + + private final com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager; + + public OpenSearchDomainStatusesImpl(OpenSearchDomainStatusesClient innerClient, + com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return ResourceManagerUtils.mapPage(inner, inner1 -> new OpenSearchDomainStatusImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new OpenSearchDomainStatusImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName); + return ResourceManagerUtils.mapPage(inner, inner1 -> new OpenSearchDomainStatusImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + PagedIterable inner + = this.serviceClient().listByResourceGroup(resourceGroupName, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new OpenSearchDomainStatusImpl(inner1, this.manager())); + } + + public Response getByResourceGroupWithResponse(String resourceGroupName, String name, + Context context) { + Response inner + = this.serviceClient().getByResourceGroupWithResponse(resourceGroupName, name, context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new OpenSearchDomainStatusImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public OpenSearchDomainStatus getByResourceGroup(String resourceGroupName, String name) { + OpenSearchDomainStatusInner inner = this.serviceClient().getByResourceGroup(resourceGroupName, name); + if (inner != null) { + return new OpenSearchDomainStatusImpl(inner, this.manager()); + } else { + return null; + } + } + + public void deleteByResourceGroup(String resourceGroupName, String name) { + this.serviceClient().delete(resourceGroupName, name); + } + + public void delete(String resourceGroupName, String name, Context context) { + this.serviceClient().delete(resourceGroupName, name, context); + } + + public OpenSearchDomainStatus getById(String id) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String name = ResourceManagerUtils.getValueFromIdByName(id, "openSearchDomainStatuses"); + if (name == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException(String + .format("The resource ID '%s' is not valid. Missing path segment 'openSearchDomainStatuses'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, name, Context.NONE).getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String name = ResourceManagerUtils.getValueFromIdByName(id, "openSearchDomainStatuses"); + if (name == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException(String + .format("The resource ID '%s' is not valid. Missing path segment 'openSearchDomainStatuses'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, name, context); + } + + public void deleteById(String id) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String name = ResourceManagerUtils.getValueFromIdByName(id, "openSearchDomainStatuses"); + if (name == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException(String + .format("The resource ID '%s' is not valid. Missing path segment 'openSearchDomainStatuses'.", id))); + } + this.delete(resourceGroupName, name, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String name = ResourceManagerUtils.getValueFromIdByName(id, "openSearchDomainStatuses"); + if (name == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException(String + .format("The resource ID '%s' is not valid. Missing path segment 'openSearchDomainStatuses'.", id))); + } + this.delete(resourceGroupName, name, context); + } + + private OpenSearchDomainStatusesClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.awsconnector.AwsconnectorManager manager() { + return this.serviceManager; + } + + public OpenSearchDomainStatusImpl define(String name) { + return new OpenSearchDomainStatusImpl(name, this.manager()); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/OperationImpl.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/OperationImpl.java new file mode 100644 index 000000000000..fe56a39da309 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/OperationImpl.java @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.implementation; + +import com.azure.resourcemanager.awsconnector.fluent.models.OperationInner; +import com.azure.resourcemanager.awsconnector.models.ActionType; +import com.azure.resourcemanager.awsconnector.models.Operation; +import com.azure.resourcemanager.awsconnector.models.OperationDisplay; +import com.azure.resourcemanager.awsconnector.models.Origin; + +public final class OperationImpl implements Operation { + private OperationInner innerObject; + + private final com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager; + + OperationImpl(OperationInner innerObject, + com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String name() { + return this.innerModel().name(); + } + + public Boolean isDataAction() { + return this.innerModel().isDataAction(); + } + + public OperationDisplay display() { + return this.innerModel().display(); + } + + public Origin origin() { + return this.innerModel().origin(); + } + + public ActionType actionType() { + return this.innerModel().actionType(); + } + + public OperationInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.awsconnector.AwsconnectorManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/OperationStatusResultImpl.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/OperationStatusResultImpl.java new file mode 100644 index 000000000000..72ba922a0254 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/OperationStatusResultImpl.java @@ -0,0 +1,76 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.implementation; + +import com.azure.core.management.exception.ManagementError; +import com.azure.resourcemanager.awsconnector.fluent.models.OperationStatusResultInner; +import com.azure.resourcemanager.awsconnector.models.OperationStatusResult; +import java.time.OffsetDateTime; +import java.util.Collections; +import java.util.List; +import java.util.stream.Collectors; + +public final class OperationStatusResultImpl implements OperationStatusResult { + private OperationStatusResultInner innerObject; + + private final com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager; + + OperationStatusResultImpl(OperationStatusResultInner innerObject, + com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String id() { + return this.innerModel().id(); + } + + public String resourceId() { + return this.innerModel().resourceId(); + } + + public String name() { + return this.innerModel().name(); + } + + public String status() { + return this.innerModel().status(); + } + + public Float percentComplete() { + return this.innerModel().percentComplete(); + } + + public OffsetDateTime startTime() { + return this.innerModel().startTime(); + } + + public OffsetDateTime endTime() { + return this.innerModel().endTime(); + } + + public List operations() { + List inner = this.innerModel().operations(); + if (inner != null) { + return Collections.unmodifiableList(inner.stream() + .map(inner1 -> new OperationStatusResultImpl(inner1, this.manager())) + .collect(Collectors.toList())); + } else { + return Collections.emptyList(); + } + } + + public ManagementError error() { + return this.innerModel().error(); + } + + public OperationStatusResultInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.awsconnector.AwsconnectorManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/OperationsClientImpl.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/OperationsClientImpl.java new file mode 100644 index 000000000000..db89cc3e7e6d --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/OperationsClientImpl.java @@ -0,0 +1,235 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.implementation; + +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.resourcemanager.awsconnector.fluent.OperationsClient; +import com.azure.resourcemanager.awsconnector.fluent.models.OperationInner; +import com.azure.resourcemanager.awsconnector.models.OperationListResult; +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 { + /** + * The proxy service used to perform REST calls. + */ + private final OperationsService service; + + /** + * The service client containing this operation class. + */ + private final MicrosoftAwsConnectorImpl client; + + /** + * Initializes an instance of OperationsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + OperationsClientImpl(MicrosoftAwsConnectorImpl client) { + this.service + = RestProxy.create(OperationsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for MicrosoftAwsConnectorOperations to be used by the proxy service to + * perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "MicrosoftAwsConnecto") + public interface OperationsService { + @Headers({ "Content-Type: application/json" }) + @Get("/providers/Microsoft.AwsConnector/operations") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext(@PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, @HeaderParam("Accept") String accept, Context context); + } + + /** + * List the operations for the provider. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of REST API operations supported by an Azure Resource Provider along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync() { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), + res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List the operations for the provider. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of REST API operations supported by an Azure Resource Provider along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.list(this.client.getEndpoint(), this.client.getApiVersion(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * List the operations for the provider. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of REST API operations supported by an Azure Resource Provider as paginated response with + * {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>(() -> listSinglePageAsync(), nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * List the operations for the provider. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of REST API operations supported by an Azure Resource Provider as paginated response with + * {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(Context context) { + return new PagedFlux<>(() -> listSinglePageAsync(context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * List the operations for the provider. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of REST API operations supported by an Azure Resource Provider as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + return new PagedIterable<>(listAsync()); + } + + /** + * List the operations for the provider. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of REST API operations supported by an Azure Resource Provider as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Context context) { + return new PagedIterable<>(listAsync(context)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of REST API operations supported by an Azure Resource Provider along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), + res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of REST API operations supported by an Azure Resource Provider along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/OperationsImpl.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/OperationsImpl.java new file mode 100644 index 000000000000..757d4bd4649b --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/OperationsImpl.java @@ -0,0 +1,45 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.awsconnector.fluent.OperationsClient; +import com.azure.resourcemanager.awsconnector.fluent.models.OperationInner; +import com.azure.resourcemanager.awsconnector.models.Operation; +import com.azure.resourcemanager.awsconnector.models.Operations; + +public final class OperationsImpl implements Operations { + private static final ClientLogger LOGGER = new ClientLogger(OperationsImpl.class); + + private final OperationsClient innerClient; + + private final com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager; + + public OperationsImpl(OperationsClient innerClient, + com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return ResourceManagerUtils.mapPage(inner, inner1 -> new OperationImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new OperationImpl(inner1, this.manager())); + } + + private OperationsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.awsconnector.AwsconnectorManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/OrganizationsAccountImpl.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/OrganizationsAccountImpl.java new file mode 100644 index 000000000000..d5236f269064 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/OrganizationsAccountImpl.java @@ -0,0 +1,178 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.implementation; + +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.awsconnector.fluent.models.OrganizationsAccountInner; +import com.azure.resourcemanager.awsconnector.models.OrganizationsAccount; +import com.azure.resourcemanager.awsconnector.models.OrganizationsAccountProperties; +import com.azure.resourcemanager.awsconnector.models.OrganizationsAccountTagsUpdate; +import java.util.Collections; +import java.util.Map; + +public final class OrganizationsAccountImpl + implements OrganizationsAccount, OrganizationsAccount.Definition, OrganizationsAccount.Update { + private OrganizationsAccountInner innerObject; + + private final com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public String location() { + return this.innerModel().location(); + } + + public Map tags() { + Map inner = this.innerModel().tags(); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } + } + + public OrganizationsAccountProperties properties() { + return this.innerModel().properties(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public String resourceGroupName() { + return resourceGroupName; + } + + public OrganizationsAccountInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.awsconnector.AwsconnectorManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String name; + + private OrganizationsAccountTagsUpdate updateProperties; + + public OrganizationsAccountImpl withExistingResourceGroup(String resourceGroupName) { + this.resourceGroupName = resourceGroupName; + return this; + } + + public OrganizationsAccount create() { + this.innerObject = serviceManager.serviceClient() + .getOrganizationsAccounts() + .createOrReplace(resourceGroupName, name, this.innerModel(), Context.NONE); + return this; + } + + public OrganizationsAccount create(Context context) { + this.innerObject = serviceManager.serviceClient() + .getOrganizationsAccounts() + .createOrReplace(resourceGroupName, name, this.innerModel(), context); + return this; + } + + OrganizationsAccountImpl(String name, com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager) { + this.innerObject = new OrganizationsAccountInner(); + this.serviceManager = serviceManager; + this.name = name; + } + + public OrganizationsAccountImpl update() { + this.updateProperties = new OrganizationsAccountTagsUpdate(); + return this; + } + + public OrganizationsAccount apply() { + this.innerObject = serviceManager.serviceClient() + .getOrganizationsAccounts() + .update(resourceGroupName, name, updateProperties, Context.NONE); + return this; + } + + public OrganizationsAccount apply(Context context) { + this.innerObject = serviceManager.serviceClient() + .getOrganizationsAccounts() + .update(resourceGroupName, name, updateProperties, context); + return this; + } + + OrganizationsAccountImpl(OrganizationsAccountInner innerObject, + com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.name = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "organizationsAccounts"); + } + + public OrganizationsAccount refresh() { + this.innerObject = serviceManager.serviceClient() + .getOrganizationsAccounts() + .getByResourceGroupWithResponse(resourceGroupName, name, Context.NONE) + .getValue(); + return this; + } + + public OrganizationsAccount refresh(Context context) { + this.innerObject = serviceManager.serviceClient() + .getOrganizationsAccounts() + .getByResourceGroupWithResponse(resourceGroupName, name, context) + .getValue(); + return this; + } + + public OrganizationsAccountImpl withRegion(Region location) { + this.innerModel().withLocation(location.toString()); + return this; + } + + public OrganizationsAccountImpl withRegion(String location) { + this.innerModel().withLocation(location); + return this; + } + + public OrganizationsAccountImpl withTags(Map tags) { + if (isInCreateMode()) { + this.innerModel().withTags(tags); + return this; + } else { + this.updateProperties.withTags(tags); + return this; + } + } + + public OrganizationsAccountImpl withProperties(OrganizationsAccountProperties properties) { + this.innerModel().withProperties(properties); + return this; + } + + private boolean isInCreateMode() { + return this.innerModel().id() == null; + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/OrganizationsAccountsClientImpl.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/OrganizationsAccountsClientImpl.java new file mode 100644 index 000000000000..b83bd32a5cb9 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/OrganizationsAccountsClientImpl.java @@ -0,0 +1,1283 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.Patch; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.awsconnector.fluent.OrganizationsAccountsClient; +import com.azure.resourcemanager.awsconnector.fluent.models.OrganizationsAccountInner; +import com.azure.resourcemanager.awsconnector.models.OrganizationsAccountListResult; +import com.azure.resourcemanager.awsconnector.models.OrganizationsAccountTagsUpdate; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in OrganizationsAccountsClient. + */ +public final class OrganizationsAccountsClientImpl implements OrganizationsAccountsClient { + /** + * The proxy service used to perform REST calls. + */ + private final OrganizationsAccountsService service; + + /** + * The service client containing this operation class. + */ + private final MicrosoftAwsConnectorImpl client; + + /** + * Initializes an instance of OrganizationsAccountsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + OrganizationsAccountsClientImpl(MicrosoftAwsConnectorImpl client) { + this.service = RestProxy.create(OrganizationsAccountsService.class, client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for MicrosoftAwsConnectorOrganizationsAccounts to be used by the proxy + * service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "MicrosoftAwsConnecto") + public interface OrganizationsAccountsService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.AwsConnector/organizationsAccounts") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/organizationsAccounts") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroup(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/organizationsAccounts/{name}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getByResourceGroup(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("name") String name, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/organizationsAccounts/{name}") + @ExpectedResponses({ 200, 201 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrReplace(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("name") String name, + @BodyParam("application/json") OrganizationsAccountInner resource, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/organizationsAccounts/{name}") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> update(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("name") String name, + @BodyParam("application/json") OrganizationsAccountTagsUpdate properties, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/organizationsAccounts/{name}") + @ExpectedResponses({ 202, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("name") String name, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listBySubscriptionNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroupNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); + } + + /** + * List OrganizationsAccount resources by subscription ID. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a OrganizationsAccount list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync() { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List OrganizationsAccount resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a OrganizationsAccount list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), accept, + context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * List OrganizationsAccount resources by subscription ID. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a OrganizationsAccount list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>(() -> listSinglePageAsync(), + nextLink -> listBySubscriptionNextSinglePageAsync(nextLink)); + } + + /** + * List OrganizationsAccount resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a OrganizationsAccount list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(Context context) { + return new PagedFlux<>(() -> listSinglePageAsync(context), + nextLink -> listBySubscriptionNextSinglePageAsync(nextLink, context)); + } + + /** + * List OrganizationsAccount resources by subscription ID. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a OrganizationsAccount list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + return new PagedIterable<>(listAsync()); + } + + /** + * List OrganizationsAccount resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a OrganizationsAccount list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Context context) { + return new PagedIterable<>(listAsync(context)); + } + + /** + * List OrganizationsAccount resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a OrganizationsAccount list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> + listByResourceGroupSinglePageAsync(String resourceGroupName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List OrganizationsAccount resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a OrganizationsAccount list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * List OrganizationsAccount resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a OrganizationsAccount list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName) { + return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); + } + + /** + * List OrganizationsAccount resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a OrganizationsAccount list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName, Context context) { + return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName, context), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink, context)); + } + + /** + * List OrganizationsAccount resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a OrganizationsAccount list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName)); + } + + /** + * List OrganizationsAccount resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a OrganizationsAccount list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, context)); + } + + /** + * Get a OrganizationsAccount. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of OrganizationsAccount. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a OrganizationsAccount along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync(String resourceGroupName, + String name) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.getByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get a OrganizationsAccount. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of OrganizationsAccount. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a OrganizationsAccount along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync(String resourceGroupName, + String name, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.getByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, accept, context); + } + + /** + * Get a OrganizationsAccount. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of OrganizationsAccount. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a OrganizationsAccount on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getByResourceGroupAsync(String resourceGroupName, String name) { + return getByResourceGroupWithResponseAsync(resourceGroupName, name) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Get a OrganizationsAccount. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of OrganizationsAccount. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a OrganizationsAccount along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getByResourceGroupWithResponse(String resourceGroupName, String name, + Context context) { + return getByResourceGroupWithResponseAsync(resourceGroupName, name, context).block(); + } + + /** + * Get a OrganizationsAccount. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of OrganizationsAccount. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a OrganizationsAccount. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public OrganizationsAccountInner getByResourceGroup(String resourceGroupName, String name) { + return getByResourceGroupWithResponse(resourceGroupName, name, Context.NONE).getValue(); + } + + /** + * Create a OrganizationsAccount. Please note that end user resource creation is currently restricted, but it will + * be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of OrganizationsAccount. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrReplaceWithResponseAsync(String resourceGroupName, String name, + OrganizationsAccountInner resource) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (resource == null) { + return Mono.error(new IllegalArgumentException("Parameter resource is required and cannot be null.")); + } else { + resource.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.createOrReplace(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, resource, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Create a OrganizationsAccount. Please note that end user resource creation is currently restricted, but it will + * be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of OrganizationsAccount. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrReplaceWithResponseAsync(String resourceGroupName, String name, + OrganizationsAccountInner resource, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (resource == null) { + return Mono.error(new IllegalArgumentException("Parameter resource is required and cannot be null.")); + } else { + resource.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.createOrReplace(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, resource, accept, context); + } + + /** + * Create a OrganizationsAccount. Please note that end user resource creation is currently restricted, but it will + * be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of OrganizationsAccount. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, OrganizationsAccountInner> + beginCreateOrReplaceAsync(String resourceGroupName, String name, OrganizationsAccountInner resource) { + Mono>> mono = createOrReplaceWithResponseAsync(resourceGroupName, name, resource); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), OrganizationsAccountInner.class, OrganizationsAccountInner.class, + this.client.getContext()); + } + + /** + * Create a OrganizationsAccount. Please note that end user resource creation is currently restricted, but it will + * be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of OrganizationsAccount. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, OrganizationsAccountInner> beginCreateOrReplaceAsync( + String resourceGroupName, String name, OrganizationsAccountInner resource, Context context) { + context = this.client.mergeContext(context); + Mono>> mono + = createOrReplaceWithResponseAsync(resourceGroupName, name, resource, context); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), OrganizationsAccountInner.class, OrganizationsAccountInner.class, context); + } + + /** + * Create a OrganizationsAccount. Please note that end user resource creation is currently restricted, but it will + * be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of OrganizationsAccount. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, OrganizationsAccountInner> + beginCreateOrReplace(String resourceGroupName, String name, OrganizationsAccountInner resource) { + return this.beginCreateOrReplaceAsync(resourceGroupName, name, resource).getSyncPoller(); + } + + /** + * Create a OrganizationsAccount. Please note that end user resource creation is currently restricted, but it will + * be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of OrganizationsAccount. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, OrganizationsAccountInner> beginCreateOrReplace( + String resourceGroupName, String name, OrganizationsAccountInner resource, Context context) { + return this.beginCreateOrReplaceAsync(resourceGroupName, name, resource, context).getSyncPoller(); + } + + /** + * Create a OrganizationsAccount. Please note that end user resource creation is currently restricted, but it will + * be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of OrganizationsAccount. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrReplaceAsync(String resourceGroupName, String name, + OrganizationsAccountInner resource) { + return beginCreateOrReplaceAsync(resourceGroupName, name, resource).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create a OrganizationsAccount. Please note that end user resource creation is currently restricted, but it will + * be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of OrganizationsAccount. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrReplaceAsync(String resourceGroupName, String name, + OrganizationsAccountInner resource, Context context) { + return beginCreateOrReplaceAsync(resourceGroupName, name, resource, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create a OrganizationsAccount. Please note that end user resource creation is currently restricted, but it will + * be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of OrganizationsAccount. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public OrganizationsAccountInner createOrReplace(String resourceGroupName, String name, + OrganizationsAccountInner resource) { + return createOrReplaceAsync(resourceGroupName, name, resource).block(); + } + + /** + * Create a OrganizationsAccount. Please note that end user resource creation is currently restricted, but it will + * be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of OrganizationsAccount. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public OrganizationsAccountInner createOrReplace(String resourceGroupName, String name, + OrganizationsAccountInner resource, Context context) { + return createOrReplaceAsync(resourceGroupName, name, resource, context).block(); + } + + /** + * Update a OrganizationsAccount. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of OrganizationsAccount. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync(String resourceGroupName, String name, + OrganizationsAccountTagsUpdate properties) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (properties == null) { + return Mono.error(new IllegalArgumentException("Parameter properties is required and cannot be null.")); + } else { + properties.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.update(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, properties, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Update a OrganizationsAccount. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of OrganizationsAccount. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync(String resourceGroupName, String name, + OrganizationsAccountTagsUpdate properties, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (properties == null) { + return Mono.error(new IllegalArgumentException("Parameter properties is required and cannot be null.")); + } else { + properties.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.update(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, name, properties, accept, context); + } + + /** + * Update a OrganizationsAccount. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of OrganizationsAccount. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, OrganizationsAccountInner> + beginUpdateAsync(String resourceGroupName, String name, OrganizationsAccountTagsUpdate properties) { + Mono>> mono = updateWithResponseAsync(resourceGroupName, name, properties); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), OrganizationsAccountInner.class, OrganizationsAccountInner.class, + this.client.getContext()); + } + + /** + * Update a OrganizationsAccount. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of OrganizationsAccount. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, OrganizationsAccountInner> beginUpdateAsync( + String resourceGroupName, String name, OrganizationsAccountTagsUpdate properties, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = updateWithResponseAsync(resourceGroupName, name, properties, context); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), OrganizationsAccountInner.class, OrganizationsAccountInner.class, context); + } + + /** + * Update a OrganizationsAccount. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of OrganizationsAccount. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, OrganizationsAccountInner> + beginUpdate(String resourceGroupName, String name, OrganizationsAccountTagsUpdate properties) { + return this.beginUpdateAsync(resourceGroupName, name, properties).getSyncPoller(); + } + + /** + * Update a OrganizationsAccount. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of OrganizationsAccount. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, OrganizationsAccountInner> + beginUpdate(String resourceGroupName, String name, OrganizationsAccountTagsUpdate properties, Context context) { + return this.beginUpdateAsync(resourceGroupName, name, properties, context).getSyncPoller(); + } + + /** + * Update a OrganizationsAccount. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of OrganizationsAccount. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync(String resourceGroupName, String name, + OrganizationsAccountTagsUpdate properties) { + return beginUpdateAsync(resourceGroupName, name, properties).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Update a OrganizationsAccount. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of OrganizationsAccount. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync(String resourceGroupName, String name, + OrganizationsAccountTagsUpdate properties, Context context) { + return beginUpdateAsync(resourceGroupName, name, properties, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Update a OrganizationsAccount. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of OrganizationsAccount. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public OrganizationsAccountInner update(String resourceGroupName, String name, + OrganizationsAccountTagsUpdate properties) { + return updateAsync(resourceGroupName, name, properties).block(); + } + + /** + * Update a OrganizationsAccount. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of OrganizationsAccount. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public OrganizationsAccountInner update(String resourceGroupName, String name, + OrganizationsAccountTagsUpdate properties, Context context) { + return updateAsync(resourceGroupName, name, properties, context).block(); + } + + /** + * Delete a OrganizationsAccount. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of OrganizationsAccount. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync(String resourceGroupName, String name) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Delete a OrganizationsAccount. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of OrganizationsAccount. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync(String resourceGroupName, String name, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.delete(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, name, accept, context); + } + + /** + * Delete a OrganizationsAccount. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of OrganizationsAccount. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String name) { + Mono>> mono = deleteWithResponseAsync(resourceGroupName, name); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); + } + + /** + * Delete a OrganizationsAccount. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of OrganizationsAccount. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String name, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = deleteWithResponseAsync(resourceGroupName, name, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + context); + } + + /** + * Delete a OrganizationsAccount. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of OrganizationsAccount. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String name) { + return this.beginDeleteAsync(resourceGroupName, name).getSyncPoller(); + } + + /** + * Delete a OrganizationsAccount. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of OrganizationsAccount. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String name, Context context) { + return this.beginDeleteAsync(resourceGroupName, name, context).getSyncPoller(); + } + + /** + * Delete a OrganizationsAccount. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of OrganizationsAccount. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String name) { + return beginDeleteAsync(resourceGroupName, name).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete a OrganizationsAccount. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of OrganizationsAccount. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String name, Context context) { + return beginDeleteAsync(resourceGroupName, name, context).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete a OrganizationsAccount. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of OrganizationsAccount. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String name) { + deleteAsync(resourceGroupName, name).block(); + } + + /** + * Delete a OrganizationsAccount. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of OrganizationsAccount. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String name, Context context) { + deleteAsync(resourceGroupName, name, context).block(); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a OrganizationsAccount list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listBySubscriptionNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a OrganizationsAccount list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listBySubscriptionNextSinglePageAsync(String nextLink, + Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a OrganizationsAccount list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a OrganizationsAccount list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupNextSinglePageAsync(String nextLink, + Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/OrganizationsAccountsImpl.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/OrganizationsAccountsImpl.java new file mode 100644 index 000000000000..ea7ad790f28c --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/OrganizationsAccountsImpl.java @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.awsconnector.fluent.OrganizationsAccountsClient; +import com.azure.resourcemanager.awsconnector.fluent.models.OrganizationsAccountInner; +import com.azure.resourcemanager.awsconnector.models.OrganizationsAccount; +import com.azure.resourcemanager.awsconnector.models.OrganizationsAccounts; + +public final class OrganizationsAccountsImpl implements OrganizationsAccounts { + private static final ClientLogger LOGGER = new ClientLogger(OrganizationsAccountsImpl.class); + + private final OrganizationsAccountsClient innerClient; + + private final com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager; + + public OrganizationsAccountsImpl(OrganizationsAccountsClient innerClient, + com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return ResourceManagerUtils.mapPage(inner, inner1 -> new OrganizationsAccountImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new OrganizationsAccountImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName); + return ResourceManagerUtils.mapPage(inner, inner1 -> new OrganizationsAccountImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + PagedIterable inner + = this.serviceClient().listByResourceGroup(resourceGroupName, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new OrganizationsAccountImpl(inner1, this.manager())); + } + + public Response getByResourceGroupWithResponse(String resourceGroupName, String name, + Context context) { + Response inner + = this.serviceClient().getByResourceGroupWithResponse(resourceGroupName, name, context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new OrganizationsAccountImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public OrganizationsAccount getByResourceGroup(String resourceGroupName, String name) { + OrganizationsAccountInner inner = this.serviceClient().getByResourceGroup(resourceGroupName, name); + if (inner != null) { + return new OrganizationsAccountImpl(inner, this.manager()); + } else { + return null; + } + } + + public void deleteByResourceGroup(String resourceGroupName, String name) { + this.serviceClient().delete(resourceGroupName, name); + } + + public void delete(String resourceGroupName, String name, Context context) { + this.serviceClient().delete(resourceGroupName, name, context); + } + + public OrganizationsAccount getById(String id) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String name = ResourceManagerUtils.getValueFromIdByName(id, "organizationsAccounts"); + if (name == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'organizationsAccounts'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, name, Context.NONE).getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String name = ResourceManagerUtils.getValueFromIdByName(id, "organizationsAccounts"); + if (name == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'organizationsAccounts'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, name, context); + } + + public void deleteById(String id) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String name = ResourceManagerUtils.getValueFromIdByName(id, "organizationsAccounts"); + if (name == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'organizationsAccounts'.", id))); + } + this.delete(resourceGroupName, name, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String name = ResourceManagerUtils.getValueFromIdByName(id, "organizationsAccounts"); + if (name == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'organizationsAccounts'.", id))); + } + this.delete(resourceGroupName, name, context); + } + + private OrganizationsAccountsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.awsconnector.AwsconnectorManager manager() { + return this.serviceManager; + } + + public OrganizationsAccountImpl define(String name) { + return new OrganizationsAccountImpl(name, this.manager()); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/OrganizationsOrganizationImpl.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/OrganizationsOrganizationImpl.java new file mode 100644 index 000000000000..f4612dc13cfc --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/OrganizationsOrganizationImpl.java @@ -0,0 +1,179 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.implementation; + +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.awsconnector.fluent.models.OrganizationsOrganizationInner; +import com.azure.resourcemanager.awsconnector.models.OrganizationsOrganization; +import com.azure.resourcemanager.awsconnector.models.OrganizationsOrganizationProperties; +import com.azure.resourcemanager.awsconnector.models.OrganizationsOrganizationTagsUpdate; +import java.util.Collections; +import java.util.Map; + +public final class OrganizationsOrganizationImpl + implements OrganizationsOrganization, OrganizationsOrganization.Definition, OrganizationsOrganization.Update { + private OrganizationsOrganizationInner innerObject; + + private final com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public String location() { + return this.innerModel().location(); + } + + public Map tags() { + Map inner = this.innerModel().tags(); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } + } + + public OrganizationsOrganizationProperties properties() { + return this.innerModel().properties(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public String resourceGroupName() { + return resourceGroupName; + } + + public OrganizationsOrganizationInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.awsconnector.AwsconnectorManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String name; + + private OrganizationsOrganizationTagsUpdate updateProperties; + + public OrganizationsOrganizationImpl withExistingResourceGroup(String resourceGroupName) { + this.resourceGroupName = resourceGroupName; + return this; + } + + public OrganizationsOrganization create() { + this.innerObject = serviceManager.serviceClient() + .getOrganizationsOrganizations() + .createOrReplace(resourceGroupName, name, this.innerModel(), Context.NONE); + return this; + } + + public OrganizationsOrganization create(Context context) { + this.innerObject = serviceManager.serviceClient() + .getOrganizationsOrganizations() + .createOrReplace(resourceGroupName, name, this.innerModel(), context); + return this; + } + + OrganizationsOrganizationImpl(String name, + com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager) { + this.innerObject = new OrganizationsOrganizationInner(); + this.serviceManager = serviceManager; + this.name = name; + } + + public OrganizationsOrganizationImpl update() { + this.updateProperties = new OrganizationsOrganizationTagsUpdate(); + return this; + } + + public OrganizationsOrganization apply() { + this.innerObject = serviceManager.serviceClient() + .getOrganizationsOrganizations() + .update(resourceGroupName, name, updateProperties, Context.NONE); + return this; + } + + public OrganizationsOrganization apply(Context context) { + this.innerObject = serviceManager.serviceClient() + .getOrganizationsOrganizations() + .update(resourceGroupName, name, updateProperties, context); + return this; + } + + OrganizationsOrganizationImpl(OrganizationsOrganizationInner innerObject, + com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.name = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "organizationsOrganizations"); + } + + public OrganizationsOrganization refresh() { + this.innerObject = serviceManager.serviceClient() + .getOrganizationsOrganizations() + .getByResourceGroupWithResponse(resourceGroupName, name, Context.NONE) + .getValue(); + return this; + } + + public OrganizationsOrganization refresh(Context context) { + this.innerObject = serviceManager.serviceClient() + .getOrganizationsOrganizations() + .getByResourceGroupWithResponse(resourceGroupName, name, context) + .getValue(); + return this; + } + + public OrganizationsOrganizationImpl withRegion(Region location) { + this.innerModel().withLocation(location.toString()); + return this; + } + + public OrganizationsOrganizationImpl withRegion(String location) { + this.innerModel().withLocation(location); + return this; + } + + public OrganizationsOrganizationImpl withTags(Map tags) { + if (isInCreateMode()) { + this.innerModel().withTags(tags); + return this; + } else { + this.updateProperties.withTags(tags); + return this; + } + } + + public OrganizationsOrganizationImpl withProperties(OrganizationsOrganizationProperties properties) { + this.innerModel().withProperties(properties); + return this; + } + + private boolean isInCreateMode() { + return this.innerModel().id() == null; + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/OrganizationsOrganizationsClientImpl.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/OrganizationsOrganizationsClientImpl.java new file mode 100644 index 000000000000..4d06183d0def --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/OrganizationsOrganizationsClientImpl.java @@ -0,0 +1,1293 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.Patch; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.awsconnector.fluent.OrganizationsOrganizationsClient; +import com.azure.resourcemanager.awsconnector.fluent.models.OrganizationsOrganizationInner; +import com.azure.resourcemanager.awsconnector.models.OrganizationsOrganizationListResult; +import com.azure.resourcemanager.awsconnector.models.OrganizationsOrganizationTagsUpdate; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in OrganizationsOrganizationsClient. + */ +public final class OrganizationsOrganizationsClientImpl implements OrganizationsOrganizationsClient { + /** + * The proxy service used to perform REST calls. + */ + private final OrganizationsOrganizationsService service; + + /** + * The service client containing this operation class. + */ + private final MicrosoftAwsConnectorImpl client; + + /** + * Initializes an instance of OrganizationsOrganizationsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + OrganizationsOrganizationsClientImpl(MicrosoftAwsConnectorImpl client) { + this.service = RestProxy.create(OrganizationsOrganizationsService.class, client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for MicrosoftAwsConnectorOrganizationsOrganizations to be used by the + * proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "MicrosoftAwsConnecto") + public interface OrganizationsOrganizationsService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.AwsConnector/organizationsOrganizations") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/organizationsOrganizations") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroup(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/organizationsOrganizations/{name}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getByResourceGroup(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("name") String name, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/organizationsOrganizations/{name}") + @ExpectedResponses({ 200, 201 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrReplace(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("name") String name, + @BodyParam("application/json") OrganizationsOrganizationInner resource, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/organizationsOrganizations/{name}") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> update(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("name") String name, + @BodyParam("application/json") OrganizationsOrganizationTagsUpdate properties, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/organizationsOrganizations/{name}") + @ExpectedResponses({ 202, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("name") String name, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listBySubscriptionNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroupNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); + } + + /** + * List OrganizationsOrganization resources by subscription ID. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a OrganizationsOrganization list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync() { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List OrganizationsOrganization resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a OrganizationsOrganization list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), accept, + context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * List OrganizationsOrganization resources by subscription ID. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a OrganizationsOrganization list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>(() -> listSinglePageAsync(), + nextLink -> listBySubscriptionNextSinglePageAsync(nextLink)); + } + + /** + * List OrganizationsOrganization resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a OrganizationsOrganization list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(Context context) { + return new PagedFlux<>(() -> listSinglePageAsync(context), + nextLink -> listBySubscriptionNextSinglePageAsync(nextLink, context)); + } + + /** + * List OrganizationsOrganization resources by subscription ID. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a OrganizationsOrganization list operation as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + return new PagedIterable<>(listAsync()); + } + + /** + * List OrganizationsOrganization resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a OrganizationsOrganization list operation as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Context context) { + return new PagedIterable<>(listAsync(context)); + } + + /** + * List OrganizationsOrganization resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a OrganizationsOrganization list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> + listByResourceGroupSinglePageAsync(String resourceGroupName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List OrganizationsOrganization resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a OrganizationsOrganization list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> + listByResourceGroupSinglePageAsync(String resourceGroupName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * List OrganizationsOrganization resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a OrganizationsOrganization list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName) { + return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); + } + + /** + * List OrganizationsOrganization resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a OrganizationsOrganization list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName, + Context context) { + return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName, context), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink, context)); + } + + /** + * List OrganizationsOrganization resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a OrganizationsOrganization list operation as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName)); + } + + /** + * List OrganizationsOrganization resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a OrganizationsOrganization list operation as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName, + Context context) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, context)); + } + + /** + * Get a OrganizationsOrganization. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of OrganizationsOrganization. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a OrganizationsOrganization along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync(String resourceGroupName, + String name) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.getByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get a OrganizationsOrganization. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of OrganizationsOrganization. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a OrganizationsOrganization along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync(String resourceGroupName, + String name, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.getByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, accept, context); + } + + /** + * Get a OrganizationsOrganization. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of OrganizationsOrganization. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a OrganizationsOrganization on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getByResourceGroupAsync(String resourceGroupName, String name) { + return getByResourceGroupWithResponseAsync(resourceGroupName, name) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Get a OrganizationsOrganization. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of OrganizationsOrganization. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a OrganizationsOrganization along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getByResourceGroupWithResponse(String resourceGroupName, + String name, Context context) { + return getByResourceGroupWithResponseAsync(resourceGroupName, name, context).block(); + } + + /** + * Get a OrganizationsOrganization. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of OrganizationsOrganization. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a OrganizationsOrganization. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public OrganizationsOrganizationInner getByResourceGroup(String resourceGroupName, String name) { + return getByResourceGroupWithResponse(resourceGroupName, name, Context.NONE).getValue(); + } + + /** + * Create a OrganizationsOrganization. Please note that end user resource creation is currently restricted, but it + * will be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of OrganizationsOrganization. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrReplaceWithResponseAsync(String resourceGroupName, String name, + OrganizationsOrganizationInner resource) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (resource == null) { + return Mono.error(new IllegalArgumentException("Parameter resource is required and cannot be null.")); + } else { + resource.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.createOrReplace(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, resource, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Create a OrganizationsOrganization. Please note that end user resource creation is currently restricted, but it + * will be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of OrganizationsOrganization. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrReplaceWithResponseAsync(String resourceGroupName, String name, + OrganizationsOrganizationInner resource, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (resource == null) { + return Mono.error(new IllegalArgumentException("Parameter resource is required and cannot be null.")); + } else { + resource.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.createOrReplace(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, resource, accept, context); + } + + /** + * Create a OrganizationsOrganization. Please note that end user resource creation is currently restricted, but it + * will be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of OrganizationsOrganization. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, OrganizationsOrganizationInner> + beginCreateOrReplaceAsync(String resourceGroupName, String name, OrganizationsOrganizationInner resource) { + Mono>> mono = createOrReplaceWithResponseAsync(resourceGroupName, name, resource); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), OrganizationsOrganizationInner.class, OrganizationsOrganizationInner.class, + this.client.getContext()); + } + + /** + * Create a OrganizationsOrganization. Please note that end user resource creation is currently restricted, but it + * will be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of OrganizationsOrganization. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, OrganizationsOrganizationInner> + beginCreateOrReplaceAsync(String resourceGroupName, String name, OrganizationsOrganizationInner resource, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono + = createOrReplaceWithResponseAsync(resourceGroupName, name, resource, context); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), OrganizationsOrganizationInner.class, OrganizationsOrganizationInner.class, + context); + } + + /** + * Create a OrganizationsOrganization. Please note that end user resource creation is currently restricted, but it + * will be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of OrganizationsOrganization. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, OrganizationsOrganizationInner> + beginCreateOrReplace(String resourceGroupName, String name, OrganizationsOrganizationInner resource) { + return this.beginCreateOrReplaceAsync(resourceGroupName, name, resource).getSyncPoller(); + } + + /** + * Create a OrganizationsOrganization. Please note that end user resource creation is currently restricted, but it + * will be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of OrganizationsOrganization. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, OrganizationsOrganizationInner> beginCreateOrReplace( + String resourceGroupName, String name, OrganizationsOrganizationInner resource, Context context) { + return this.beginCreateOrReplaceAsync(resourceGroupName, name, resource, context).getSyncPoller(); + } + + /** + * Create a OrganizationsOrganization. Please note that end user resource creation is currently restricted, but it + * will be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of OrganizationsOrganization. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrReplaceAsync(String resourceGroupName, String name, + OrganizationsOrganizationInner resource) { + return beginCreateOrReplaceAsync(resourceGroupName, name, resource).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create a OrganizationsOrganization. Please note that end user resource creation is currently restricted, but it + * will be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of OrganizationsOrganization. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrReplaceAsync(String resourceGroupName, String name, + OrganizationsOrganizationInner resource, Context context) { + return beginCreateOrReplaceAsync(resourceGroupName, name, resource, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create a OrganizationsOrganization. Please note that end user resource creation is currently restricted, but it + * will be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of OrganizationsOrganization. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public OrganizationsOrganizationInner createOrReplace(String resourceGroupName, String name, + OrganizationsOrganizationInner resource) { + return createOrReplaceAsync(resourceGroupName, name, resource).block(); + } + + /** + * Create a OrganizationsOrganization. Please note that end user resource creation is currently restricted, but it + * will be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of OrganizationsOrganization. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public OrganizationsOrganizationInner createOrReplace(String resourceGroupName, String name, + OrganizationsOrganizationInner resource, Context context) { + return createOrReplaceAsync(resourceGroupName, name, resource, context).block(); + } + + /** + * Update a OrganizationsOrganization. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of OrganizationsOrganization. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync(String resourceGroupName, String name, + OrganizationsOrganizationTagsUpdate properties) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (properties == null) { + return Mono.error(new IllegalArgumentException("Parameter properties is required and cannot be null.")); + } else { + properties.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.update(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, properties, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Update a OrganizationsOrganization. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of OrganizationsOrganization. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync(String resourceGroupName, String name, + OrganizationsOrganizationTagsUpdate properties, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (properties == null) { + return Mono.error(new IllegalArgumentException("Parameter properties is required and cannot be null.")); + } else { + properties.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.update(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, name, properties, accept, context); + } + + /** + * Update a OrganizationsOrganization. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of OrganizationsOrganization. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, OrganizationsOrganizationInner> + beginUpdateAsync(String resourceGroupName, String name, OrganizationsOrganizationTagsUpdate properties) { + Mono>> mono = updateWithResponseAsync(resourceGroupName, name, properties); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), OrganizationsOrganizationInner.class, OrganizationsOrganizationInner.class, + this.client.getContext()); + } + + /** + * Update a OrganizationsOrganization. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of OrganizationsOrganization. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, OrganizationsOrganizationInner> beginUpdateAsync( + String resourceGroupName, String name, OrganizationsOrganizationTagsUpdate properties, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = updateWithResponseAsync(resourceGroupName, name, properties, context); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), OrganizationsOrganizationInner.class, OrganizationsOrganizationInner.class, + context); + } + + /** + * Update a OrganizationsOrganization. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of OrganizationsOrganization. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, OrganizationsOrganizationInner> + beginUpdate(String resourceGroupName, String name, OrganizationsOrganizationTagsUpdate properties) { + return this.beginUpdateAsync(resourceGroupName, name, properties).getSyncPoller(); + } + + /** + * Update a OrganizationsOrganization. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of OrganizationsOrganization. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, OrganizationsOrganizationInner> beginUpdate( + String resourceGroupName, String name, OrganizationsOrganizationTagsUpdate properties, Context context) { + return this.beginUpdateAsync(resourceGroupName, name, properties, context).getSyncPoller(); + } + + /** + * Update a OrganizationsOrganization. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of OrganizationsOrganization. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync(String resourceGroupName, String name, + OrganizationsOrganizationTagsUpdate properties) { + return beginUpdateAsync(resourceGroupName, name, properties).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Update a OrganizationsOrganization. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of OrganizationsOrganization. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync(String resourceGroupName, String name, + OrganizationsOrganizationTagsUpdate properties, Context context) { + return beginUpdateAsync(resourceGroupName, name, properties, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Update a OrganizationsOrganization. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of OrganizationsOrganization. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public OrganizationsOrganizationInner update(String resourceGroupName, String name, + OrganizationsOrganizationTagsUpdate properties) { + return updateAsync(resourceGroupName, name, properties).block(); + } + + /** + * Update a OrganizationsOrganization. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of OrganizationsOrganization. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public OrganizationsOrganizationInner update(String resourceGroupName, String name, + OrganizationsOrganizationTagsUpdate properties, Context context) { + return updateAsync(resourceGroupName, name, properties, context).block(); + } + + /** + * Delete a OrganizationsOrganization. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of OrganizationsOrganization. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync(String resourceGroupName, String name) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Delete a OrganizationsOrganization. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of OrganizationsOrganization. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync(String resourceGroupName, String name, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.delete(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, name, accept, context); + } + + /** + * Delete a OrganizationsOrganization. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of OrganizationsOrganization. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String name) { + Mono>> mono = deleteWithResponseAsync(resourceGroupName, name); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); + } + + /** + * Delete a OrganizationsOrganization. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of OrganizationsOrganization. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String name, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = deleteWithResponseAsync(resourceGroupName, name, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + context); + } + + /** + * Delete a OrganizationsOrganization. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of OrganizationsOrganization. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String name) { + return this.beginDeleteAsync(resourceGroupName, name).getSyncPoller(); + } + + /** + * Delete a OrganizationsOrganization. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of OrganizationsOrganization. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String name, Context context) { + return this.beginDeleteAsync(resourceGroupName, name, context).getSyncPoller(); + } + + /** + * Delete a OrganizationsOrganization. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of OrganizationsOrganization. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String name) { + return beginDeleteAsync(resourceGroupName, name).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete a OrganizationsOrganization. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of OrganizationsOrganization. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String name, Context context) { + return beginDeleteAsync(resourceGroupName, name, context).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete a OrganizationsOrganization. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of OrganizationsOrganization. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String name) { + deleteAsync(resourceGroupName, name).block(); + } + + /** + * Delete a OrganizationsOrganization. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of OrganizationsOrganization. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String name, Context context) { + deleteAsync(resourceGroupName, name, context).block(); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a OrganizationsOrganization list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listBySubscriptionNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a OrganizationsOrganization list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listBySubscriptionNextSinglePageAsync(String nextLink, + Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a OrganizationsOrganization list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> + listByResourceGroupNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a OrganizationsOrganization list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupNextSinglePageAsync(String nextLink, + Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/OrganizationsOrganizationsImpl.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/OrganizationsOrganizationsImpl.java new file mode 100644 index 000000000000..e5e122efbafa --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/OrganizationsOrganizationsImpl.java @@ -0,0 +1,148 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.awsconnector.fluent.OrganizationsOrganizationsClient; +import com.azure.resourcemanager.awsconnector.fluent.models.OrganizationsOrganizationInner; +import com.azure.resourcemanager.awsconnector.models.OrganizationsOrganization; +import com.azure.resourcemanager.awsconnector.models.OrganizationsOrganizations; + +public final class OrganizationsOrganizationsImpl implements OrganizationsOrganizations { + private static final ClientLogger LOGGER = new ClientLogger(OrganizationsOrganizationsImpl.class); + + private final OrganizationsOrganizationsClient innerClient; + + private final com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager; + + public OrganizationsOrganizationsImpl(OrganizationsOrganizationsClient innerClient, + com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return ResourceManagerUtils.mapPage(inner, inner1 -> new OrganizationsOrganizationImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new OrganizationsOrganizationImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName) { + PagedIterable inner + = this.serviceClient().listByResourceGroup(resourceGroupName); + return ResourceManagerUtils.mapPage(inner, inner1 -> new OrganizationsOrganizationImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + PagedIterable inner + = this.serviceClient().listByResourceGroup(resourceGroupName, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new OrganizationsOrganizationImpl(inner1, this.manager())); + } + + public Response getByResourceGroupWithResponse(String resourceGroupName, String name, + Context context) { + Response inner + = this.serviceClient().getByResourceGroupWithResponse(resourceGroupName, name, context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new OrganizationsOrganizationImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public OrganizationsOrganization getByResourceGroup(String resourceGroupName, String name) { + OrganizationsOrganizationInner inner = this.serviceClient().getByResourceGroup(resourceGroupName, name); + if (inner != null) { + return new OrganizationsOrganizationImpl(inner, this.manager()); + } else { + return null; + } + } + + public void deleteByResourceGroup(String resourceGroupName, String name) { + this.serviceClient().delete(resourceGroupName, name); + } + + public void delete(String resourceGroupName, String name, Context context) { + this.serviceClient().delete(resourceGroupName, name, context); + } + + public OrganizationsOrganization getById(String id) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String name = ResourceManagerUtils.getValueFromIdByName(id, "organizationsOrganizations"); + if (name == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException(String + .format("The resource ID '%s' is not valid. Missing path segment 'organizationsOrganizations'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, name, Context.NONE).getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String name = ResourceManagerUtils.getValueFromIdByName(id, "organizationsOrganizations"); + if (name == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException(String + .format("The resource ID '%s' is not valid. Missing path segment 'organizationsOrganizations'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, name, context); + } + + public void deleteById(String id) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String name = ResourceManagerUtils.getValueFromIdByName(id, "organizationsOrganizations"); + if (name == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException(String + .format("The resource ID '%s' is not valid. Missing path segment 'organizationsOrganizations'.", id))); + } + this.delete(resourceGroupName, name, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String name = ResourceManagerUtils.getValueFromIdByName(id, "organizationsOrganizations"); + if (name == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException(String + .format("The resource ID '%s' is not valid. Missing path segment 'organizationsOrganizations'.", id))); + } + this.delete(resourceGroupName, name, context); + } + + private OrganizationsOrganizationsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.awsconnector.AwsconnectorManager manager() { + return this.serviceManager; + } + + public OrganizationsOrganizationImpl define(String name) { + return new OrganizationsOrganizationImpl(name, this.manager()); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/RdsDBClusterImpl.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/RdsDBClusterImpl.java new file mode 100644 index 000000000000..b7f39b7844d7 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/RdsDBClusterImpl.java @@ -0,0 +1,177 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.implementation; + +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.awsconnector.fluent.models.RdsDBClusterInner; +import com.azure.resourcemanager.awsconnector.models.RdsDBCluster; +import com.azure.resourcemanager.awsconnector.models.RdsDBClusterProperties; +import com.azure.resourcemanager.awsconnector.models.RdsDBClusterTagsUpdate; +import java.util.Collections; +import java.util.Map; + +public final class RdsDBClusterImpl implements RdsDBCluster, RdsDBCluster.Definition, RdsDBCluster.Update { + private RdsDBClusterInner innerObject; + + private final com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public String location() { + return this.innerModel().location(); + } + + public Map tags() { + Map inner = this.innerModel().tags(); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } + } + + public RdsDBClusterProperties properties() { + return this.innerModel().properties(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public String resourceGroupName() { + return resourceGroupName; + } + + public RdsDBClusterInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.awsconnector.AwsconnectorManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String name; + + private RdsDBClusterTagsUpdate updateProperties; + + public RdsDBClusterImpl withExistingResourceGroup(String resourceGroupName) { + this.resourceGroupName = resourceGroupName; + return this; + } + + public RdsDBCluster create() { + this.innerObject = serviceManager.serviceClient() + .getRdsDbClusters() + .createOrReplace(resourceGroupName, name, this.innerModel(), Context.NONE); + return this; + } + + public RdsDBCluster create(Context context) { + this.innerObject = serviceManager.serviceClient() + .getRdsDbClusters() + .createOrReplace(resourceGroupName, name, this.innerModel(), context); + return this; + } + + RdsDBClusterImpl(String name, com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager) { + this.innerObject = new RdsDBClusterInner(); + this.serviceManager = serviceManager; + this.name = name; + } + + public RdsDBClusterImpl update() { + this.updateProperties = new RdsDBClusterTagsUpdate(); + return this; + } + + public RdsDBCluster apply() { + this.innerObject = serviceManager.serviceClient() + .getRdsDbClusters() + .update(resourceGroupName, name, updateProperties, Context.NONE); + return this; + } + + public RdsDBCluster apply(Context context) { + this.innerObject = serviceManager.serviceClient() + .getRdsDbClusters() + .update(resourceGroupName, name, updateProperties, context); + return this; + } + + RdsDBClusterImpl(RdsDBClusterInner innerObject, + com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.name = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "rdsDBClusters"); + } + + public RdsDBCluster refresh() { + this.innerObject = serviceManager.serviceClient() + .getRdsDbClusters() + .getByResourceGroupWithResponse(resourceGroupName, name, Context.NONE) + .getValue(); + return this; + } + + public RdsDBCluster refresh(Context context) { + this.innerObject = serviceManager.serviceClient() + .getRdsDbClusters() + .getByResourceGroupWithResponse(resourceGroupName, name, context) + .getValue(); + return this; + } + + public RdsDBClusterImpl withRegion(Region location) { + this.innerModel().withLocation(location.toString()); + return this; + } + + public RdsDBClusterImpl withRegion(String location) { + this.innerModel().withLocation(location); + return this; + } + + public RdsDBClusterImpl withTags(Map tags) { + if (isInCreateMode()) { + this.innerModel().withTags(tags); + return this; + } else { + this.updateProperties.withTags(tags); + return this; + } + } + + public RdsDBClusterImpl withProperties(RdsDBClusterProperties properties) { + this.innerModel().withProperties(properties); + return this; + } + + private boolean isInCreateMode() { + return this.innerModel().id() == null; + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/RdsDBInstanceImpl.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/RdsDBInstanceImpl.java new file mode 100644 index 000000000000..966a4b193dc1 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/RdsDBInstanceImpl.java @@ -0,0 +1,177 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.implementation; + +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.awsconnector.fluent.models.RdsDBInstanceInner; +import com.azure.resourcemanager.awsconnector.models.RdsDBInstance; +import com.azure.resourcemanager.awsconnector.models.RdsDBInstanceProperties; +import com.azure.resourcemanager.awsconnector.models.RdsDBInstanceTagsUpdate; +import java.util.Collections; +import java.util.Map; + +public final class RdsDBInstanceImpl implements RdsDBInstance, RdsDBInstance.Definition, RdsDBInstance.Update { + private RdsDBInstanceInner innerObject; + + private final com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public String location() { + return this.innerModel().location(); + } + + public Map tags() { + Map inner = this.innerModel().tags(); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } + } + + public RdsDBInstanceProperties properties() { + return this.innerModel().properties(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public String resourceGroupName() { + return resourceGroupName; + } + + public RdsDBInstanceInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.awsconnector.AwsconnectorManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String name; + + private RdsDBInstanceTagsUpdate updateProperties; + + public RdsDBInstanceImpl withExistingResourceGroup(String resourceGroupName) { + this.resourceGroupName = resourceGroupName; + return this; + } + + public RdsDBInstance create() { + this.innerObject = serviceManager.serviceClient() + .getRdsDbInstances() + .createOrReplace(resourceGroupName, name, this.innerModel(), Context.NONE); + return this; + } + + public RdsDBInstance create(Context context) { + this.innerObject = serviceManager.serviceClient() + .getRdsDbInstances() + .createOrReplace(resourceGroupName, name, this.innerModel(), context); + return this; + } + + RdsDBInstanceImpl(String name, com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager) { + this.innerObject = new RdsDBInstanceInner(); + this.serviceManager = serviceManager; + this.name = name; + } + + public RdsDBInstanceImpl update() { + this.updateProperties = new RdsDBInstanceTagsUpdate(); + return this; + } + + public RdsDBInstance apply() { + this.innerObject = serviceManager.serviceClient() + .getRdsDbInstances() + .update(resourceGroupName, name, updateProperties, Context.NONE); + return this; + } + + public RdsDBInstance apply(Context context) { + this.innerObject = serviceManager.serviceClient() + .getRdsDbInstances() + .update(resourceGroupName, name, updateProperties, context); + return this; + } + + RdsDBInstanceImpl(RdsDBInstanceInner innerObject, + com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.name = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "rdsDBInstances"); + } + + public RdsDBInstance refresh() { + this.innerObject = serviceManager.serviceClient() + .getRdsDbInstances() + .getByResourceGroupWithResponse(resourceGroupName, name, Context.NONE) + .getValue(); + return this; + } + + public RdsDBInstance refresh(Context context) { + this.innerObject = serviceManager.serviceClient() + .getRdsDbInstances() + .getByResourceGroupWithResponse(resourceGroupName, name, context) + .getValue(); + return this; + } + + public RdsDBInstanceImpl withRegion(Region location) { + this.innerModel().withLocation(location.toString()); + return this; + } + + public RdsDBInstanceImpl withRegion(String location) { + this.innerModel().withLocation(location); + return this; + } + + public RdsDBInstanceImpl withTags(Map tags) { + if (isInCreateMode()) { + this.innerModel().withTags(tags); + return this; + } else { + this.updateProperties.withTags(tags); + return this; + } + } + + public RdsDBInstanceImpl withProperties(RdsDBInstanceProperties properties) { + this.innerModel().withProperties(properties); + return this; + } + + private boolean isInCreateMode() { + return this.innerModel().id() == null; + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/RdsDBSnapshotAttributesResultImpl.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/RdsDBSnapshotAttributesResultImpl.java new file mode 100644 index 000000000000..e0853d5e87cb --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/RdsDBSnapshotAttributesResultImpl.java @@ -0,0 +1,179 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.implementation; + +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.awsconnector.fluent.models.RdsDBSnapshotAttributesResultInner; +import com.azure.resourcemanager.awsconnector.models.RdsDBSnapshotAttributesResult; +import com.azure.resourcemanager.awsconnector.models.RdsDBSnapshotAttributesResultProperties; +import com.azure.resourcemanager.awsconnector.models.RdsDBSnapshotAttributesResultTagsUpdate; +import java.util.Collections; +import java.util.Map; + +public final class RdsDBSnapshotAttributesResultImpl implements RdsDBSnapshotAttributesResult, + RdsDBSnapshotAttributesResult.Definition, RdsDBSnapshotAttributesResult.Update { + private RdsDBSnapshotAttributesResultInner innerObject; + + private final com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public String location() { + return this.innerModel().location(); + } + + public Map tags() { + Map inner = this.innerModel().tags(); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } + } + + public RdsDBSnapshotAttributesResultProperties properties() { + return this.innerModel().properties(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public String resourceGroupName() { + return resourceGroupName; + } + + public RdsDBSnapshotAttributesResultInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.awsconnector.AwsconnectorManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String name; + + private RdsDBSnapshotAttributesResultTagsUpdate updateProperties; + + public RdsDBSnapshotAttributesResultImpl withExistingResourceGroup(String resourceGroupName) { + this.resourceGroupName = resourceGroupName; + return this; + } + + public RdsDBSnapshotAttributesResult create() { + this.innerObject = serviceManager.serviceClient() + .getRdsDbSnapshotAttributesResults() + .createOrReplace(resourceGroupName, name, this.innerModel(), Context.NONE); + return this; + } + + public RdsDBSnapshotAttributesResult create(Context context) { + this.innerObject = serviceManager.serviceClient() + .getRdsDbSnapshotAttributesResults() + .createOrReplace(resourceGroupName, name, this.innerModel(), context); + return this; + } + + RdsDBSnapshotAttributesResultImpl(String name, + com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager) { + this.innerObject = new RdsDBSnapshotAttributesResultInner(); + this.serviceManager = serviceManager; + this.name = name; + } + + public RdsDBSnapshotAttributesResultImpl update() { + this.updateProperties = new RdsDBSnapshotAttributesResultTagsUpdate(); + return this; + } + + public RdsDBSnapshotAttributesResult apply() { + this.innerObject = serviceManager.serviceClient() + .getRdsDbSnapshotAttributesResults() + .update(resourceGroupName, name, updateProperties, Context.NONE); + return this; + } + + public RdsDBSnapshotAttributesResult apply(Context context) { + this.innerObject = serviceManager.serviceClient() + .getRdsDbSnapshotAttributesResults() + .update(resourceGroupName, name, updateProperties, context); + return this; + } + + RdsDBSnapshotAttributesResultImpl(RdsDBSnapshotAttributesResultInner innerObject, + com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.name = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "rdsDBSnapshotAttributesResults"); + } + + public RdsDBSnapshotAttributesResult refresh() { + this.innerObject = serviceManager.serviceClient() + .getRdsDbSnapshotAttributesResults() + .getByResourceGroupWithResponse(resourceGroupName, name, Context.NONE) + .getValue(); + return this; + } + + public RdsDBSnapshotAttributesResult refresh(Context context) { + this.innerObject = serviceManager.serviceClient() + .getRdsDbSnapshotAttributesResults() + .getByResourceGroupWithResponse(resourceGroupName, name, context) + .getValue(); + return this; + } + + public RdsDBSnapshotAttributesResultImpl withRegion(Region location) { + this.innerModel().withLocation(location.toString()); + return this; + } + + public RdsDBSnapshotAttributesResultImpl withRegion(String location) { + this.innerModel().withLocation(location); + return this; + } + + public RdsDBSnapshotAttributesResultImpl withTags(Map tags) { + if (isInCreateMode()) { + this.innerModel().withTags(tags); + return this; + } else { + this.updateProperties.withTags(tags); + return this; + } + } + + public RdsDBSnapshotAttributesResultImpl withProperties(RdsDBSnapshotAttributesResultProperties properties) { + this.innerModel().withProperties(properties); + return this; + } + + private boolean isInCreateMode() { + return this.innerModel().id() == null; + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/RdsDBSnapshotImpl.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/RdsDBSnapshotImpl.java new file mode 100644 index 000000000000..6c01b7908486 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/RdsDBSnapshotImpl.java @@ -0,0 +1,177 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.implementation; + +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.awsconnector.fluent.models.RdsDBSnapshotInner; +import com.azure.resourcemanager.awsconnector.models.RdsDBSnapshot; +import com.azure.resourcemanager.awsconnector.models.RdsDBSnapshotProperties; +import com.azure.resourcemanager.awsconnector.models.RdsDBSnapshotTagsUpdate; +import java.util.Collections; +import java.util.Map; + +public final class RdsDBSnapshotImpl implements RdsDBSnapshot, RdsDBSnapshot.Definition, RdsDBSnapshot.Update { + private RdsDBSnapshotInner innerObject; + + private final com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public String location() { + return this.innerModel().location(); + } + + public Map tags() { + Map inner = this.innerModel().tags(); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } + } + + public RdsDBSnapshotProperties properties() { + return this.innerModel().properties(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public String resourceGroupName() { + return resourceGroupName; + } + + public RdsDBSnapshotInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.awsconnector.AwsconnectorManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String name; + + private RdsDBSnapshotTagsUpdate updateProperties; + + public RdsDBSnapshotImpl withExistingResourceGroup(String resourceGroupName) { + this.resourceGroupName = resourceGroupName; + return this; + } + + public RdsDBSnapshot create() { + this.innerObject = serviceManager.serviceClient() + .getRdsDbSnapshots() + .createOrReplace(resourceGroupName, name, this.innerModel(), Context.NONE); + return this; + } + + public RdsDBSnapshot create(Context context) { + this.innerObject = serviceManager.serviceClient() + .getRdsDbSnapshots() + .createOrReplace(resourceGroupName, name, this.innerModel(), context); + return this; + } + + RdsDBSnapshotImpl(String name, com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager) { + this.innerObject = new RdsDBSnapshotInner(); + this.serviceManager = serviceManager; + this.name = name; + } + + public RdsDBSnapshotImpl update() { + this.updateProperties = new RdsDBSnapshotTagsUpdate(); + return this; + } + + public RdsDBSnapshot apply() { + this.innerObject = serviceManager.serviceClient() + .getRdsDbSnapshots() + .update(resourceGroupName, name, updateProperties, Context.NONE); + return this; + } + + public RdsDBSnapshot apply(Context context) { + this.innerObject = serviceManager.serviceClient() + .getRdsDbSnapshots() + .update(resourceGroupName, name, updateProperties, context); + return this; + } + + RdsDBSnapshotImpl(RdsDBSnapshotInner innerObject, + com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.name = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "rdsDBSnapshots"); + } + + public RdsDBSnapshot refresh() { + this.innerObject = serviceManager.serviceClient() + .getRdsDbSnapshots() + .getByResourceGroupWithResponse(resourceGroupName, name, Context.NONE) + .getValue(); + return this; + } + + public RdsDBSnapshot refresh(Context context) { + this.innerObject = serviceManager.serviceClient() + .getRdsDbSnapshots() + .getByResourceGroupWithResponse(resourceGroupName, name, context) + .getValue(); + return this; + } + + public RdsDBSnapshotImpl withRegion(Region location) { + this.innerModel().withLocation(location.toString()); + return this; + } + + public RdsDBSnapshotImpl withRegion(String location) { + this.innerModel().withLocation(location); + return this; + } + + public RdsDBSnapshotImpl withTags(Map tags) { + if (isInCreateMode()) { + this.innerModel().withTags(tags); + return this; + } else { + this.updateProperties.withTags(tags); + return this; + } + } + + public RdsDBSnapshotImpl withProperties(RdsDBSnapshotProperties properties) { + this.innerModel().withProperties(properties); + return this; + } + + private boolean isInCreateMode() { + return this.innerModel().id() == null; + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/RdsDbClustersClientImpl.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/RdsDbClustersClientImpl.java new file mode 100644 index 000000000000..47c5ca228ee6 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/RdsDbClustersClientImpl.java @@ -0,0 +1,1278 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.Patch; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.awsconnector.fluent.RdsDbClustersClient; +import com.azure.resourcemanager.awsconnector.fluent.models.RdsDBClusterInner; +import com.azure.resourcemanager.awsconnector.models.RdsDBClusterListResult; +import com.azure.resourcemanager.awsconnector.models.RdsDBClusterTagsUpdate; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in RdsDbClustersClient. + */ +public final class RdsDbClustersClientImpl implements RdsDbClustersClient { + /** + * The proxy service used to perform REST calls. + */ + private final RdsDbClustersService service; + + /** + * The service client containing this operation class. + */ + private final MicrosoftAwsConnectorImpl client; + + /** + * Initializes an instance of RdsDbClustersClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + RdsDbClustersClientImpl(MicrosoftAwsConnectorImpl client) { + this.service + = RestProxy.create(RdsDbClustersService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for MicrosoftAwsConnectorRdsDbClusters to be used by the proxy service to + * perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "MicrosoftAwsConnecto") + public interface RdsDbClustersService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.AwsConnector/rdsDBClusters") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/rdsDBClusters") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroup(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/rdsDBClusters/{name}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getByResourceGroup(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("name") String name, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/rdsDBClusters/{name}") + @ExpectedResponses({ 200, 201 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrReplace(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("name") String name, + @BodyParam("application/json") RdsDBClusterInner resource, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/rdsDBClusters/{name}") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> update(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("name") String name, + @BodyParam("application/json") RdsDBClusterTagsUpdate properties, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/rdsDBClusters/{name}") + @ExpectedResponses({ 202, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("name") String name, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listBySubscriptionNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroupNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); + } + + /** + * List RdsDBCluster resources by subscription ID. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a RdsDBCluster list operation along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync() { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), + res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List RdsDBCluster resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a RdsDBCluster list operation along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), accept, + context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * List RdsDBCluster resources by subscription ID. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a RdsDBCluster list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>(() -> listSinglePageAsync(), + nextLink -> listBySubscriptionNextSinglePageAsync(nextLink)); + } + + /** + * List RdsDBCluster resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a RdsDBCluster list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(Context context) { + return new PagedFlux<>(() -> listSinglePageAsync(context), + nextLink -> listBySubscriptionNextSinglePageAsync(nextLink, context)); + } + + /** + * List RdsDBCluster resources by subscription ID. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a RdsDBCluster list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + return new PagedIterable<>(listAsync()); + } + + /** + * List RdsDBCluster resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a RdsDBCluster list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Context context) { + return new PagedIterable<>(listAsync(context)); + } + + /** + * List RdsDBCluster resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a RdsDBCluster list operation along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), + res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List RdsDBCluster resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a RdsDBCluster list operation along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * List RdsDBCluster resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a RdsDBCluster list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName) { + return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); + } + + /** + * List RdsDBCluster resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a RdsDBCluster list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName, Context context) { + return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName, context), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink, context)); + } + + /** + * List RdsDBCluster resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a RdsDBCluster list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName)); + } + + /** + * List RdsDBCluster resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a RdsDBCluster list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, context)); + } + + /** + * Get a RdsDBCluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of RdsDBCluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a RdsDBCluster along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync(String resourceGroupName, + String name) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.getByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get a RdsDBCluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of RdsDBCluster. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a RdsDBCluster along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync(String resourceGroupName, String name, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.getByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, accept, context); + } + + /** + * Get a RdsDBCluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of RdsDBCluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a RdsDBCluster on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getByResourceGroupAsync(String resourceGroupName, String name) { + return getByResourceGroupWithResponseAsync(resourceGroupName, name) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Get a RdsDBCluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of RdsDBCluster. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a RdsDBCluster along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getByResourceGroupWithResponse(String resourceGroupName, String name, + Context context) { + return getByResourceGroupWithResponseAsync(resourceGroupName, name, context).block(); + } + + /** + * Get a RdsDBCluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of RdsDBCluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a RdsDBCluster. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public RdsDBClusterInner getByResourceGroup(String resourceGroupName, String name) { + return getByResourceGroupWithResponse(resourceGroupName, name, Context.NONE).getValue(); + } + + /** + * Create a RdsDBCluster. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of RdsDBCluster. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrReplaceWithResponseAsync(String resourceGroupName, String name, + RdsDBClusterInner resource) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (resource == null) { + return Mono.error(new IllegalArgumentException("Parameter resource is required and cannot be null.")); + } else { + resource.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.createOrReplace(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, resource, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Create a RdsDBCluster. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of RdsDBCluster. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrReplaceWithResponseAsync(String resourceGroupName, String name, + RdsDBClusterInner resource, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (resource == null) { + return Mono.error(new IllegalArgumentException("Parameter resource is required and cannot be null.")); + } else { + resource.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.createOrReplace(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, resource, accept, context); + } + + /** + * Create a RdsDBCluster. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of RdsDBCluster. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, RdsDBClusterInner> + beginCreateOrReplaceAsync(String resourceGroupName, String name, RdsDBClusterInner resource) { + Mono>> mono = createOrReplaceWithResponseAsync(resourceGroupName, name, resource); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + RdsDBClusterInner.class, RdsDBClusterInner.class, this.client.getContext()); + } + + /** + * Create a RdsDBCluster. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of RdsDBCluster. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, RdsDBClusterInner> + beginCreateOrReplaceAsync(String resourceGroupName, String name, RdsDBClusterInner resource, Context context) { + context = this.client.mergeContext(context); + Mono>> mono + = createOrReplaceWithResponseAsync(resourceGroupName, name, resource, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + RdsDBClusterInner.class, RdsDBClusterInner.class, context); + } + + /** + * Create a RdsDBCluster. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of RdsDBCluster. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, RdsDBClusterInner> beginCreateOrReplace(String resourceGroupName, + String name, RdsDBClusterInner resource) { + return this.beginCreateOrReplaceAsync(resourceGroupName, name, resource).getSyncPoller(); + } + + /** + * Create a RdsDBCluster. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of RdsDBCluster. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, RdsDBClusterInner> beginCreateOrReplace(String resourceGroupName, + String name, RdsDBClusterInner resource, Context context) { + return this.beginCreateOrReplaceAsync(resourceGroupName, name, resource, context).getSyncPoller(); + } + + /** + * Create a RdsDBCluster. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of RdsDBCluster. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrReplaceAsync(String resourceGroupName, String name, + RdsDBClusterInner resource) { + return beginCreateOrReplaceAsync(resourceGroupName, name, resource).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create a RdsDBCluster. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of RdsDBCluster. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrReplaceAsync(String resourceGroupName, String name, + RdsDBClusterInner resource, Context context) { + return beginCreateOrReplaceAsync(resourceGroupName, name, resource, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create a RdsDBCluster. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of RdsDBCluster. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public RdsDBClusterInner createOrReplace(String resourceGroupName, String name, RdsDBClusterInner resource) { + return createOrReplaceAsync(resourceGroupName, name, resource).block(); + } + + /** + * Create a RdsDBCluster. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of RdsDBCluster. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public RdsDBClusterInner createOrReplace(String resourceGroupName, String name, RdsDBClusterInner resource, + Context context) { + return createOrReplaceAsync(resourceGroupName, name, resource, context).block(); + } + + /** + * Update a RdsDBCluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of RdsDBCluster. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync(String resourceGroupName, String name, + RdsDBClusterTagsUpdate properties) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (properties == null) { + return Mono.error(new IllegalArgumentException("Parameter properties is required and cannot be null.")); + } else { + properties.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.update(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, properties, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Update a RdsDBCluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of RdsDBCluster. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync(String resourceGroupName, String name, + RdsDBClusterTagsUpdate properties, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (properties == null) { + return Mono.error(new IllegalArgumentException("Parameter properties is required and cannot be null.")); + } else { + properties.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.update(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, name, properties, accept, context); + } + + /** + * Update a RdsDBCluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of RdsDBCluster. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, RdsDBClusterInner> beginUpdateAsync(String resourceGroupName, + String name, RdsDBClusterTagsUpdate properties) { + Mono>> mono = updateWithResponseAsync(resourceGroupName, name, properties); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + RdsDBClusterInner.class, RdsDBClusterInner.class, this.client.getContext()); + } + + /** + * Update a RdsDBCluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of RdsDBCluster. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, RdsDBClusterInner> beginUpdateAsync(String resourceGroupName, + String name, RdsDBClusterTagsUpdate properties, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = updateWithResponseAsync(resourceGroupName, name, properties, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + RdsDBClusterInner.class, RdsDBClusterInner.class, context); + } + + /** + * Update a RdsDBCluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of RdsDBCluster. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, RdsDBClusterInner> beginUpdate(String resourceGroupName, + String name, RdsDBClusterTagsUpdate properties) { + return this.beginUpdateAsync(resourceGroupName, name, properties).getSyncPoller(); + } + + /** + * Update a RdsDBCluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of RdsDBCluster. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, RdsDBClusterInner> beginUpdate(String resourceGroupName, + String name, RdsDBClusterTagsUpdate properties, Context context) { + return this.beginUpdateAsync(resourceGroupName, name, properties, context).getSyncPoller(); + } + + /** + * Update a RdsDBCluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of RdsDBCluster. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync(String resourceGroupName, String name, + RdsDBClusterTagsUpdate properties) { + return beginUpdateAsync(resourceGroupName, name, properties).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Update a RdsDBCluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of RdsDBCluster. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync(String resourceGroupName, String name, + RdsDBClusterTagsUpdate properties, Context context) { + return beginUpdateAsync(resourceGroupName, name, properties, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Update a RdsDBCluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of RdsDBCluster. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public RdsDBClusterInner update(String resourceGroupName, String name, RdsDBClusterTagsUpdate properties) { + return updateAsync(resourceGroupName, name, properties).block(); + } + + /** + * Update a RdsDBCluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of RdsDBCluster. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public RdsDBClusterInner update(String resourceGroupName, String name, RdsDBClusterTagsUpdate properties, + Context context) { + return updateAsync(resourceGroupName, name, properties, context).block(); + } + + /** + * Delete a RdsDBCluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of RdsDBCluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync(String resourceGroupName, String name) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Delete a RdsDBCluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of RdsDBCluster. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync(String resourceGroupName, String name, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.delete(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, name, accept, context); + } + + /** + * Delete a RdsDBCluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of RdsDBCluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String name) { + Mono>> mono = deleteWithResponseAsync(resourceGroupName, name); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); + } + + /** + * Delete a RdsDBCluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of RdsDBCluster. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String name, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = deleteWithResponseAsync(resourceGroupName, name, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + context); + } + + /** + * Delete a RdsDBCluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of RdsDBCluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String name) { + return this.beginDeleteAsync(resourceGroupName, name).getSyncPoller(); + } + + /** + * Delete a RdsDBCluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of RdsDBCluster. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String name, Context context) { + return this.beginDeleteAsync(resourceGroupName, name, context).getSyncPoller(); + } + + /** + * Delete a RdsDBCluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of RdsDBCluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String name) { + return beginDeleteAsync(resourceGroupName, name).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete a RdsDBCluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of RdsDBCluster. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String name, Context context) { + return beginDeleteAsync(resourceGroupName, name, context).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete a RdsDBCluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of RdsDBCluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String name) { + deleteAsync(resourceGroupName, name).block(); + } + + /** + * Delete a RdsDBCluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of RdsDBCluster. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String name, Context context) { + deleteAsync(resourceGroupName, name, context).block(); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a RdsDBCluster list operation along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listBySubscriptionNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), + res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a RdsDBCluster list operation along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listBySubscriptionNextSinglePageAsync(String nextLink, + Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a RdsDBCluster list operation along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), + res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a RdsDBCluster list operation along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupNextSinglePageAsync(String nextLink, + Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/RdsDbClustersImpl.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/RdsDbClustersImpl.java new file mode 100644 index 000000000000..7ed844323de4 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/RdsDbClustersImpl.java @@ -0,0 +1,146 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.awsconnector.fluent.RdsDbClustersClient; +import com.azure.resourcemanager.awsconnector.fluent.models.RdsDBClusterInner; +import com.azure.resourcemanager.awsconnector.models.RdsDBCluster; +import com.azure.resourcemanager.awsconnector.models.RdsDbClusters; + +public final class RdsDbClustersImpl implements RdsDbClusters { + private static final ClientLogger LOGGER = new ClientLogger(RdsDbClustersImpl.class); + + private final RdsDbClustersClient innerClient; + + private final com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager; + + public RdsDbClustersImpl(RdsDbClustersClient innerClient, + com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return ResourceManagerUtils.mapPage(inner, inner1 -> new RdsDBClusterImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new RdsDBClusterImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName); + return ResourceManagerUtils.mapPage(inner, inner1 -> new RdsDBClusterImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new RdsDBClusterImpl(inner1, this.manager())); + } + + public Response getByResourceGroupWithResponse(String resourceGroupName, String name, + Context context) { + Response inner + = this.serviceClient().getByResourceGroupWithResponse(resourceGroupName, name, context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new RdsDBClusterImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public RdsDBCluster getByResourceGroup(String resourceGroupName, String name) { + RdsDBClusterInner inner = this.serviceClient().getByResourceGroup(resourceGroupName, name); + if (inner != null) { + return new RdsDBClusterImpl(inner, this.manager()); + } else { + return null; + } + } + + public void deleteByResourceGroup(String resourceGroupName, String name) { + this.serviceClient().delete(resourceGroupName, name); + } + + public void delete(String resourceGroupName, String name, Context context) { + this.serviceClient().delete(resourceGroupName, name, context); + } + + public RdsDBCluster getById(String id) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String name = ResourceManagerUtils.getValueFromIdByName(id, "rdsDBClusters"); + if (name == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'rdsDBClusters'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, name, Context.NONE).getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String name = ResourceManagerUtils.getValueFromIdByName(id, "rdsDBClusters"); + if (name == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'rdsDBClusters'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, name, context); + } + + public void deleteById(String id) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String name = ResourceManagerUtils.getValueFromIdByName(id, "rdsDBClusters"); + if (name == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'rdsDBClusters'.", id))); + } + this.delete(resourceGroupName, name, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String name = ResourceManagerUtils.getValueFromIdByName(id, "rdsDBClusters"); + if (name == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'rdsDBClusters'.", id))); + } + this.delete(resourceGroupName, name, context); + } + + private RdsDbClustersClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.awsconnector.AwsconnectorManager manager() { + return this.serviceManager; + } + + public RdsDBClusterImpl define(String name) { + return new RdsDBClusterImpl(name, this.manager()); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/RdsDbInstancesClientImpl.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/RdsDbInstancesClientImpl.java new file mode 100644 index 000000000000..90e3ac33925d --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/RdsDbInstancesClientImpl.java @@ -0,0 +1,1278 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.Patch; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.awsconnector.fluent.RdsDbInstancesClient; +import com.azure.resourcemanager.awsconnector.fluent.models.RdsDBInstanceInner; +import com.azure.resourcemanager.awsconnector.models.RdsDBInstanceListResult; +import com.azure.resourcemanager.awsconnector.models.RdsDBInstanceTagsUpdate; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in RdsDbInstancesClient. + */ +public final class RdsDbInstancesClientImpl implements RdsDbInstancesClient { + /** + * The proxy service used to perform REST calls. + */ + private final RdsDbInstancesService service; + + /** + * The service client containing this operation class. + */ + private final MicrosoftAwsConnectorImpl client; + + /** + * Initializes an instance of RdsDbInstancesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + RdsDbInstancesClientImpl(MicrosoftAwsConnectorImpl client) { + this.service + = RestProxy.create(RdsDbInstancesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for MicrosoftAwsConnectorRdsDbInstances to be used by the proxy service + * to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "MicrosoftAwsConnecto") + public interface RdsDbInstancesService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.AwsConnector/rdsDBInstances") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/rdsDBInstances") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroup(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/rdsDBInstances/{name}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getByResourceGroup(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("name") String name, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/rdsDBInstances/{name}") + @ExpectedResponses({ 200, 201 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrReplace(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("name") String name, + @BodyParam("application/json") RdsDBInstanceInner resource, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/rdsDBInstances/{name}") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> update(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("name") String name, + @BodyParam("application/json") RdsDBInstanceTagsUpdate properties, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/rdsDBInstances/{name}") + @ExpectedResponses({ 202, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("name") String name, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listBySubscriptionNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroupNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); + } + + /** + * List RdsDBInstance resources by subscription ID. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a RdsDBInstance list operation along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync() { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List RdsDBInstance resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a RdsDBInstance list operation along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), accept, + context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * List RdsDBInstance resources by subscription ID. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a RdsDBInstance list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>(() -> listSinglePageAsync(), + nextLink -> listBySubscriptionNextSinglePageAsync(nextLink)); + } + + /** + * List RdsDBInstance resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a RdsDBInstance list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(Context context) { + return new PagedFlux<>(() -> listSinglePageAsync(context), + nextLink -> listBySubscriptionNextSinglePageAsync(nextLink, context)); + } + + /** + * List RdsDBInstance resources by subscription ID. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a RdsDBInstance list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + return new PagedIterable<>(listAsync()); + } + + /** + * List RdsDBInstance resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a RdsDBInstance list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Context context) { + return new PagedIterable<>(listAsync(context)); + } + + /** + * List RdsDBInstance resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a RdsDBInstance list operation along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List RdsDBInstance resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a RdsDBInstance list operation along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * List RdsDBInstance resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a RdsDBInstance list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName) { + return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); + } + + /** + * List RdsDBInstance resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a RdsDBInstance list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName, Context context) { + return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName, context), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink, context)); + } + + /** + * List RdsDBInstance resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a RdsDBInstance list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName)); + } + + /** + * List RdsDBInstance resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a RdsDBInstance list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, context)); + } + + /** + * Get a RdsDBInstance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of RdsDBInstance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a RdsDBInstance along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync(String resourceGroupName, + String name) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.getByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get a RdsDBInstance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of RdsDBInstance. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a RdsDBInstance along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync(String resourceGroupName, + String name, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.getByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, accept, context); + } + + /** + * Get a RdsDBInstance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of RdsDBInstance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a RdsDBInstance on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getByResourceGroupAsync(String resourceGroupName, String name) { + return getByResourceGroupWithResponseAsync(resourceGroupName, name) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Get a RdsDBInstance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of RdsDBInstance. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a RdsDBInstance along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getByResourceGroupWithResponse(String resourceGroupName, String name, + Context context) { + return getByResourceGroupWithResponseAsync(resourceGroupName, name, context).block(); + } + + /** + * Get a RdsDBInstance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of RdsDBInstance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a RdsDBInstance. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public RdsDBInstanceInner getByResourceGroup(String resourceGroupName, String name) { + return getByResourceGroupWithResponse(resourceGroupName, name, Context.NONE).getValue(); + } + + /** + * Create a RdsDBInstance. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of RdsDBInstance. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrReplaceWithResponseAsync(String resourceGroupName, String name, + RdsDBInstanceInner resource) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (resource == null) { + return Mono.error(new IllegalArgumentException("Parameter resource is required and cannot be null.")); + } else { + resource.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.createOrReplace(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, resource, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Create a RdsDBInstance. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of RdsDBInstance. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrReplaceWithResponseAsync(String resourceGroupName, String name, + RdsDBInstanceInner resource, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (resource == null) { + return Mono.error(new IllegalArgumentException("Parameter resource is required and cannot be null.")); + } else { + resource.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.createOrReplace(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, resource, accept, context); + } + + /** + * Create a RdsDBInstance. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of RdsDBInstance. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, RdsDBInstanceInner> + beginCreateOrReplaceAsync(String resourceGroupName, String name, RdsDBInstanceInner resource) { + Mono>> mono = createOrReplaceWithResponseAsync(resourceGroupName, name, resource); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + RdsDBInstanceInner.class, RdsDBInstanceInner.class, this.client.getContext()); + } + + /** + * Create a RdsDBInstance. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of RdsDBInstance. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, RdsDBInstanceInner> + beginCreateOrReplaceAsync(String resourceGroupName, String name, RdsDBInstanceInner resource, Context context) { + context = this.client.mergeContext(context); + Mono>> mono + = createOrReplaceWithResponseAsync(resourceGroupName, name, resource, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + RdsDBInstanceInner.class, RdsDBInstanceInner.class, context); + } + + /** + * Create a RdsDBInstance. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of RdsDBInstance. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, RdsDBInstanceInner> beginCreateOrReplace(String resourceGroupName, + String name, RdsDBInstanceInner resource) { + return this.beginCreateOrReplaceAsync(resourceGroupName, name, resource).getSyncPoller(); + } + + /** + * Create a RdsDBInstance. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of RdsDBInstance. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, RdsDBInstanceInner> beginCreateOrReplace(String resourceGroupName, + String name, RdsDBInstanceInner resource, Context context) { + return this.beginCreateOrReplaceAsync(resourceGroupName, name, resource, context).getSyncPoller(); + } + + /** + * Create a RdsDBInstance. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of RdsDBInstance. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrReplaceAsync(String resourceGroupName, String name, + RdsDBInstanceInner resource) { + return beginCreateOrReplaceAsync(resourceGroupName, name, resource).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create a RdsDBInstance. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of RdsDBInstance. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrReplaceAsync(String resourceGroupName, String name, + RdsDBInstanceInner resource, Context context) { + return beginCreateOrReplaceAsync(resourceGroupName, name, resource, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create a RdsDBInstance. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of RdsDBInstance. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public RdsDBInstanceInner createOrReplace(String resourceGroupName, String name, RdsDBInstanceInner resource) { + return createOrReplaceAsync(resourceGroupName, name, resource).block(); + } + + /** + * Create a RdsDBInstance. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of RdsDBInstance. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public RdsDBInstanceInner createOrReplace(String resourceGroupName, String name, RdsDBInstanceInner resource, + Context context) { + return createOrReplaceAsync(resourceGroupName, name, resource, context).block(); + } + + /** + * Update a RdsDBInstance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of RdsDBInstance. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync(String resourceGroupName, String name, + RdsDBInstanceTagsUpdate properties) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (properties == null) { + return Mono.error(new IllegalArgumentException("Parameter properties is required and cannot be null.")); + } else { + properties.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.update(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, properties, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Update a RdsDBInstance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of RdsDBInstance. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync(String resourceGroupName, String name, + RdsDBInstanceTagsUpdate properties, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (properties == null) { + return Mono.error(new IllegalArgumentException("Parameter properties is required and cannot be null.")); + } else { + properties.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.update(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, name, properties, accept, context); + } + + /** + * Update a RdsDBInstance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of RdsDBInstance. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, RdsDBInstanceInner> beginUpdateAsync(String resourceGroupName, + String name, RdsDBInstanceTagsUpdate properties) { + Mono>> mono = updateWithResponseAsync(resourceGroupName, name, properties); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + RdsDBInstanceInner.class, RdsDBInstanceInner.class, this.client.getContext()); + } + + /** + * Update a RdsDBInstance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of RdsDBInstance. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, RdsDBInstanceInner> beginUpdateAsync(String resourceGroupName, + String name, RdsDBInstanceTagsUpdate properties, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = updateWithResponseAsync(resourceGroupName, name, properties, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + RdsDBInstanceInner.class, RdsDBInstanceInner.class, context); + } + + /** + * Update a RdsDBInstance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of RdsDBInstance. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, RdsDBInstanceInner> beginUpdate(String resourceGroupName, + String name, RdsDBInstanceTagsUpdate properties) { + return this.beginUpdateAsync(resourceGroupName, name, properties).getSyncPoller(); + } + + /** + * Update a RdsDBInstance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of RdsDBInstance. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, RdsDBInstanceInner> beginUpdate(String resourceGroupName, + String name, RdsDBInstanceTagsUpdate properties, Context context) { + return this.beginUpdateAsync(resourceGroupName, name, properties, context).getSyncPoller(); + } + + /** + * Update a RdsDBInstance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of RdsDBInstance. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync(String resourceGroupName, String name, + RdsDBInstanceTagsUpdate properties) { + return beginUpdateAsync(resourceGroupName, name, properties).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Update a RdsDBInstance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of RdsDBInstance. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync(String resourceGroupName, String name, + RdsDBInstanceTagsUpdate properties, Context context) { + return beginUpdateAsync(resourceGroupName, name, properties, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Update a RdsDBInstance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of RdsDBInstance. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public RdsDBInstanceInner update(String resourceGroupName, String name, RdsDBInstanceTagsUpdate properties) { + return updateAsync(resourceGroupName, name, properties).block(); + } + + /** + * Update a RdsDBInstance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of RdsDBInstance. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public RdsDBInstanceInner update(String resourceGroupName, String name, RdsDBInstanceTagsUpdate properties, + Context context) { + return updateAsync(resourceGroupName, name, properties, context).block(); + } + + /** + * Delete a RdsDBInstance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of RdsDBInstance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync(String resourceGroupName, String name) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Delete a RdsDBInstance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of RdsDBInstance. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync(String resourceGroupName, String name, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.delete(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, name, accept, context); + } + + /** + * Delete a RdsDBInstance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of RdsDBInstance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String name) { + Mono>> mono = deleteWithResponseAsync(resourceGroupName, name); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); + } + + /** + * Delete a RdsDBInstance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of RdsDBInstance. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String name, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = deleteWithResponseAsync(resourceGroupName, name, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + context); + } + + /** + * Delete a RdsDBInstance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of RdsDBInstance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String name) { + return this.beginDeleteAsync(resourceGroupName, name).getSyncPoller(); + } + + /** + * Delete a RdsDBInstance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of RdsDBInstance. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String name, Context context) { + return this.beginDeleteAsync(resourceGroupName, name, context).getSyncPoller(); + } + + /** + * Delete a RdsDBInstance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of RdsDBInstance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String name) { + return beginDeleteAsync(resourceGroupName, name).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete a RdsDBInstance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of RdsDBInstance. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String name, Context context) { + return beginDeleteAsync(resourceGroupName, name, context).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete a RdsDBInstance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of RdsDBInstance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String name) { + deleteAsync(resourceGroupName, name).block(); + } + + /** + * Delete a RdsDBInstance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of RdsDBInstance. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String name, Context context) { + deleteAsync(resourceGroupName, name, context).block(); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a RdsDBInstance list operation along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listBySubscriptionNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a RdsDBInstance list operation along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listBySubscriptionNextSinglePageAsync(String nextLink, + Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a RdsDBInstance list operation along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a RdsDBInstance list operation along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupNextSinglePageAsync(String nextLink, + Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/RdsDbInstancesImpl.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/RdsDbInstancesImpl.java new file mode 100644 index 000000000000..98bfc6865546 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/RdsDbInstancesImpl.java @@ -0,0 +1,146 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.awsconnector.fluent.RdsDbInstancesClient; +import com.azure.resourcemanager.awsconnector.fluent.models.RdsDBInstanceInner; +import com.azure.resourcemanager.awsconnector.models.RdsDBInstance; +import com.azure.resourcemanager.awsconnector.models.RdsDbInstances; + +public final class RdsDbInstancesImpl implements RdsDbInstances { + private static final ClientLogger LOGGER = new ClientLogger(RdsDbInstancesImpl.class); + + private final RdsDbInstancesClient innerClient; + + private final com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager; + + public RdsDbInstancesImpl(RdsDbInstancesClient innerClient, + com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return ResourceManagerUtils.mapPage(inner, inner1 -> new RdsDBInstanceImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new RdsDBInstanceImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName); + return ResourceManagerUtils.mapPage(inner, inner1 -> new RdsDBInstanceImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new RdsDBInstanceImpl(inner1, this.manager())); + } + + public Response getByResourceGroupWithResponse(String resourceGroupName, String name, + Context context) { + Response inner + = this.serviceClient().getByResourceGroupWithResponse(resourceGroupName, name, context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new RdsDBInstanceImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public RdsDBInstance getByResourceGroup(String resourceGroupName, String name) { + RdsDBInstanceInner inner = this.serviceClient().getByResourceGroup(resourceGroupName, name); + if (inner != null) { + return new RdsDBInstanceImpl(inner, this.manager()); + } else { + return null; + } + } + + public void deleteByResourceGroup(String resourceGroupName, String name) { + this.serviceClient().delete(resourceGroupName, name); + } + + public void delete(String resourceGroupName, String name, Context context) { + this.serviceClient().delete(resourceGroupName, name, context); + } + + public RdsDBInstance getById(String id) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String name = ResourceManagerUtils.getValueFromIdByName(id, "rdsDBInstances"); + if (name == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'rdsDBInstances'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, name, Context.NONE).getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String name = ResourceManagerUtils.getValueFromIdByName(id, "rdsDBInstances"); + if (name == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'rdsDBInstances'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, name, context); + } + + public void deleteById(String id) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String name = ResourceManagerUtils.getValueFromIdByName(id, "rdsDBInstances"); + if (name == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'rdsDBInstances'.", id))); + } + this.delete(resourceGroupName, name, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String name = ResourceManagerUtils.getValueFromIdByName(id, "rdsDBInstances"); + if (name == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'rdsDBInstances'.", id))); + } + this.delete(resourceGroupName, name, context); + } + + private RdsDbInstancesClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.awsconnector.AwsconnectorManager manager() { + return this.serviceManager; + } + + public RdsDBInstanceImpl define(String name) { + return new RdsDBInstanceImpl(name, this.manager()); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/RdsDbSnapshotAttributesResultsClientImpl.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/RdsDbSnapshotAttributesResultsClientImpl.java new file mode 100644 index 000000000000..779c67d10b6a --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/RdsDbSnapshotAttributesResultsClientImpl.java @@ -0,0 +1,1300 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.Patch; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.awsconnector.fluent.RdsDbSnapshotAttributesResultsClient; +import com.azure.resourcemanager.awsconnector.fluent.models.RdsDBSnapshotAttributesResultInner; +import com.azure.resourcemanager.awsconnector.models.RdsDBSnapshotAttributesResultListResult; +import com.azure.resourcemanager.awsconnector.models.RdsDBSnapshotAttributesResultTagsUpdate; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in RdsDbSnapshotAttributesResultsClient. + */ +public final class RdsDbSnapshotAttributesResultsClientImpl implements RdsDbSnapshotAttributesResultsClient { + /** + * The proxy service used to perform REST calls. + */ + private final RdsDbSnapshotAttributesResultsService service; + + /** + * The service client containing this operation class. + */ + private final MicrosoftAwsConnectorImpl client; + + /** + * Initializes an instance of RdsDbSnapshotAttributesResultsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + RdsDbSnapshotAttributesResultsClientImpl(MicrosoftAwsConnectorImpl client) { + this.service = RestProxy.create(RdsDbSnapshotAttributesResultsService.class, client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for MicrosoftAwsConnectorRdsDbSnapshotAttributesResults to be used by the + * proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "MicrosoftAwsConnecto") + public interface RdsDbSnapshotAttributesResultsService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.AwsConnector/rdsDBSnapshotAttributesResults") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/rdsDBSnapshotAttributesResults") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroup(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/rdsDBSnapshotAttributesResults/{name}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getByResourceGroup(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("name") String name, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/rdsDBSnapshotAttributesResults/{name}") + @ExpectedResponses({ 200, 201 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrReplace(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("name") String name, + @BodyParam("application/json") RdsDBSnapshotAttributesResultInner resource, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/rdsDBSnapshotAttributesResults/{name}") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> update(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("name") String name, + @BodyParam("application/json") RdsDBSnapshotAttributesResultTagsUpdate properties, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/rdsDBSnapshotAttributesResults/{name}") + @ExpectedResponses({ 202, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("name") String name, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listBySubscriptionNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroupNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); + } + + /** + * List RdsDBSnapshotAttributesResult resources by subscription ID. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a RdsDBSnapshotAttributesResult list operation along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync() { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List RdsDBSnapshotAttributesResult resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a RdsDBSnapshotAttributesResult list operation along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), accept, + context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * List RdsDBSnapshotAttributesResult resources by subscription ID. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a RdsDBSnapshotAttributesResult list operation as paginated response with + * {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>(() -> listSinglePageAsync(), + nextLink -> listBySubscriptionNextSinglePageAsync(nextLink)); + } + + /** + * List RdsDBSnapshotAttributesResult resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a RdsDBSnapshotAttributesResult list operation as paginated response with + * {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(Context context) { + return new PagedFlux<>(() -> listSinglePageAsync(context), + nextLink -> listBySubscriptionNextSinglePageAsync(nextLink, context)); + } + + /** + * List RdsDBSnapshotAttributesResult resources by subscription ID. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a RdsDBSnapshotAttributesResult list operation as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + return new PagedIterable<>(listAsync()); + } + + /** + * List RdsDBSnapshotAttributesResult resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a RdsDBSnapshotAttributesResult list operation as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Context context) { + return new PagedIterable<>(listAsync(context)); + } + + /** + * List RdsDBSnapshotAttributesResult resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a RdsDBSnapshotAttributesResult list operation along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> + listByResourceGroupSinglePageAsync(String resourceGroupName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List RdsDBSnapshotAttributesResult resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a RdsDBSnapshotAttributesResult list operation along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> + listByResourceGroupSinglePageAsync(String resourceGroupName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * List RdsDBSnapshotAttributesResult resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a RdsDBSnapshotAttributesResult list operation as paginated response with + * {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName) { + return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); + } + + /** + * List RdsDBSnapshotAttributesResult resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a RdsDBSnapshotAttributesResult list operation as paginated response with + * {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName, + Context context) { + return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName, context), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink, context)); + } + + /** + * List RdsDBSnapshotAttributesResult resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a RdsDBSnapshotAttributesResult list operation as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName)); + } + + /** + * List RdsDBSnapshotAttributesResult resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a RdsDBSnapshotAttributesResult list operation as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName, + Context context) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, context)); + } + + /** + * Get a RdsDBSnapshotAttributesResult. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of RdsDBSnapshotAttributesResult. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a RdsDBSnapshotAttributesResult along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> + getByResourceGroupWithResponseAsync(String resourceGroupName, String name) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.getByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get a RdsDBSnapshotAttributesResult. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of RdsDBSnapshotAttributesResult. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a RdsDBSnapshotAttributesResult along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> + getByResourceGroupWithResponseAsync(String resourceGroupName, String name, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.getByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, accept, context); + } + + /** + * Get a RdsDBSnapshotAttributesResult. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of RdsDBSnapshotAttributesResult. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a RdsDBSnapshotAttributesResult on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getByResourceGroupAsync(String resourceGroupName, String name) { + return getByResourceGroupWithResponseAsync(resourceGroupName, name) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Get a RdsDBSnapshotAttributesResult. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of RdsDBSnapshotAttributesResult. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a RdsDBSnapshotAttributesResult along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getByResourceGroupWithResponse(String resourceGroupName, + String name, Context context) { + return getByResourceGroupWithResponseAsync(resourceGroupName, name, context).block(); + } + + /** + * Get a RdsDBSnapshotAttributesResult. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of RdsDBSnapshotAttributesResult. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a RdsDBSnapshotAttributesResult. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public RdsDBSnapshotAttributesResultInner getByResourceGroup(String resourceGroupName, String name) { + return getByResourceGroupWithResponse(resourceGroupName, name, Context.NONE).getValue(); + } + + /** + * Create a RdsDBSnapshotAttributesResult. Please note that end user resource creation is currently restricted, but + * it will be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of RdsDBSnapshotAttributesResult. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrReplaceWithResponseAsync(String resourceGroupName, String name, + RdsDBSnapshotAttributesResultInner resource) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (resource == null) { + return Mono.error(new IllegalArgumentException("Parameter resource is required and cannot be null.")); + } else { + resource.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.createOrReplace(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, resource, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Create a RdsDBSnapshotAttributesResult. Please note that end user resource creation is currently restricted, but + * it will be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of RdsDBSnapshotAttributesResult. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrReplaceWithResponseAsync(String resourceGroupName, String name, + RdsDBSnapshotAttributesResultInner resource, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (resource == null) { + return Mono.error(new IllegalArgumentException("Parameter resource is required and cannot be null.")); + } else { + resource.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.createOrReplace(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, resource, accept, context); + } + + /** + * Create a RdsDBSnapshotAttributesResult. Please note that end user resource creation is currently restricted, but + * it will be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of RdsDBSnapshotAttributesResult. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, RdsDBSnapshotAttributesResultInner> + beginCreateOrReplaceAsync(String resourceGroupName, String name, RdsDBSnapshotAttributesResultInner resource) { + Mono>> mono = createOrReplaceWithResponseAsync(resourceGroupName, name, resource); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), RdsDBSnapshotAttributesResultInner.class, + RdsDBSnapshotAttributesResultInner.class, this.client.getContext()); + } + + /** + * Create a RdsDBSnapshotAttributesResult. Please note that end user resource creation is currently restricted, but + * it will be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of RdsDBSnapshotAttributesResult. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, RdsDBSnapshotAttributesResultInner> + beginCreateOrReplaceAsync(String resourceGroupName, String name, RdsDBSnapshotAttributesResultInner resource, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono + = createOrReplaceWithResponseAsync(resourceGroupName, name, resource, context); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), RdsDBSnapshotAttributesResultInner.class, + RdsDBSnapshotAttributesResultInner.class, context); + } + + /** + * Create a RdsDBSnapshotAttributesResult. Please note that end user resource creation is currently restricted, but + * it will be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of RdsDBSnapshotAttributesResult. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, RdsDBSnapshotAttributesResultInner> + beginCreateOrReplace(String resourceGroupName, String name, RdsDBSnapshotAttributesResultInner resource) { + return this.beginCreateOrReplaceAsync(resourceGroupName, name, resource).getSyncPoller(); + } + + /** + * Create a RdsDBSnapshotAttributesResult. Please note that end user resource creation is currently restricted, but + * it will be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of RdsDBSnapshotAttributesResult. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, RdsDBSnapshotAttributesResultInner> + beginCreateOrReplace(String resourceGroupName, String name, RdsDBSnapshotAttributesResultInner resource, + Context context) { + return this.beginCreateOrReplaceAsync(resourceGroupName, name, resource, context).getSyncPoller(); + } + + /** + * Create a RdsDBSnapshotAttributesResult. Please note that end user resource creation is currently restricted, but + * it will be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of RdsDBSnapshotAttributesResult. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrReplaceAsync(String resourceGroupName, String name, + RdsDBSnapshotAttributesResultInner resource) { + return beginCreateOrReplaceAsync(resourceGroupName, name, resource).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create a RdsDBSnapshotAttributesResult. Please note that end user resource creation is currently restricted, but + * it will be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of RdsDBSnapshotAttributesResult. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrReplaceAsync(String resourceGroupName, String name, + RdsDBSnapshotAttributesResultInner resource, Context context) { + return beginCreateOrReplaceAsync(resourceGroupName, name, resource, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create a RdsDBSnapshotAttributesResult. Please note that end user resource creation is currently restricted, but + * it will be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of RdsDBSnapshotAttributesResult. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public RdsDBSnapshotAttributesResultInner createOrReplace(String resourceGroupName, String name, + RdsDBSnapshotAttributesResultInner resource) { + return createOrReplaceAsync(resourceGroupName, name, resource).block(); + } + + /** + * Create a RdsDBSnapshotAttributesResult. Please note that end user resource creation is currently restricted, but + * it will be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of RdsDBSnapshotAttributesResult. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public RdsDBSnapshotAttributesResultInner createOrReplace(String resourceGroupName, String name, + RdsDBSnapshotAttributesResultInner resource, Context context) { + return createOrReplaceAsync(resourceGroupName, name, resource, context).block(); + } + + /** + * Update a RdsDBSnapshotAttributesResult. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of RdsDBSnapshotAttributesResult. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync(String resourceGroupName, String name, + RdsDBSnapshotAttributesResultTagsUpdate properties) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (properties == null) { + return Mono.error(new IllegalArgumentException("Parameter properties is required and cannot be null.")); + } else { + properties.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.update(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, properties, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Update a RdsDBSnapshotAttributesResult. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of RdsDBSnapshotAttributesResult. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync(String resourceGroupName, String name, + RdsDBSnapshotAttributesResultTagsUpdate properties, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (properties == null) { + return Mono.error(new IllegalArgumentException("Parameter properties is required and cannot be null.")); + } else { + properties.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.update(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, name, properties, accept, context); + } + + /** + * Update a RdsDBSnapshotAttributesResult. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of RdsDBSnapshotAttributesResult. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, RdsDBSnapshotAttributesResultInner> + beginUpdateAsync(String resourceGroupName, String name, RdsDBSnapshotAttributesResultTagsUpdate properties) { + Mono>> mono = updateWithResponseAsync(resourceGroupName, name, properties); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), RdsDBSnapshotAttributesResultInner.class, + RdsDBSnapshotAttributesResultInner.class, this.client.getContext()); + } + + /** + * Update a RdsDBSnapshotAttributesResult. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of RdsDBSnapshotAttributesResult. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, RdsDBSnapshotAttributesResultInner> + beginUpdateAsync(String resourceGroupName, String name, RdsDBSnapshotAttributesResultTagsUpdate properties, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = updateWithResponseAsync(resourceGroupName, name, properties, context); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), RdsDBSnapshotAttributesResultInner.class, + RdsDBSnapshotAttributesResultInner.class, context); + } + + /** + * Update a RdsDBSnapshotAttributesResult. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of RdsDBSnapshotAttributesResult. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, RdsDBSnapshotAttributesResultInner> + beginUpdate(String resourceGroupName, String name, RdsDBSnapshotAttributesResultTagsUpdate properties) { + return this.beginUpdateAsync(resourceGroupName, name, properties).getSyncPoller(); + } + + /** + * Update a RdsDBSnapshotAttributesResult. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of RdsDBSnapshotAttributesResult. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, RdsDBSnapshotAttributesResultInner> beginUpdate( + String resourceGroupName, String name, RdsDBSnapshotAttributesResultTagsUpdate properties, Context context) { + return this.beginUpdateAsync(resourceGroupName, name, properties, context).getSyncPoller(); + } + + /** + * Update a RdsDBSnapshotAttributesResult. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of RdsDBSnapshotAttributesResult. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync(String resourceGroupName, String name, + RdsDBSnapshotAttributesResultTagsUpdate properties) { + return beginUpdateAsync(resourceGroupName, name, properties).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Update a RdsDBSnapshotAttributesResult. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of RdsDBSnapshotAttributesResult. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync(String resourceGroupName, String name, + RdsDBSnapshotAttributesResultTagsUpdate properties, Context context) { + return beginUpdateAsync(resourceGroupName, name, properties, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Update a RdsDBSnapshotAttributesResult. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of RdsDBSnapshotAttributesResult. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public RdsDBSnapshotAttributesResultInner update(String resourceGroupName, String name, + RdsDBSnapshotAttributesResultTagsUpdate properties) { + return updateAsync(resourceGroupName, name, properties).block(); + } + + /** + * Update a RdsDBSnapshotAttributesResult. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of RdsDBSnapshotAttributesResult. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public RdsDBSnapshotAttributesResultInner update(String resourceGroupName, String name, + RdsDBSnapshotAttributesResultTagsUpdate properties, Context context) { + return updateAsync(resourceGroupName, name, properties, context).block(); + } + + /** + * Delete a RdsDBSnapshotAttributesResult. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of RdsDBSnapshotAttributesResult. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync(String resourceGroupName, String name) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Delete a RdsDBSnapshotAttributesResult. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of RdsDBSnapshotAttributesResult. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync(String resourceGroupName, String name, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.delete(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, name, accept, context); + } + + /** + * Delete a RdsDBSnapshotAttributesResult. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of RdsDBSnapshotAttributesResult. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String name) { + Mono>> mono = deleteWithResponseAsync(resourceGroupName, name); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); + } + + /** + * Delete a RdsDBSnapshotAttributesResult. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of RdsDBSnapshotAttributesResult. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String name, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = deleteWithResponseAsync(resourceGroupName, name, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + context); + } + + /** + * Delete a RdsDBSnapshotAttributesResult. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of RdsDBSnapshotAttributesResult. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String name) { + return this.beginDeleteAsync(resourceGroupName, name).getSyncPoller(); + } + + /** + * Delete a RdsDBSnapshotAttributesResult. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of RdsDBSnapshotAttributesResult. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String name, Context context) { + return this.beginDeleteAsync(resourceGroupName, name, context).getSyncPoller(); + } + + /** + * Delete a RdsDBSnapshotAttributesResult. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of RdsDBSnapshotAttributesResult. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String name) { + return beginDeleteAsync(resourceGroupName, name).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete a RdsDBSnapshotAttributesResult. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of RdsDBSnapshotAttributesResult. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String name, Context context) { + return beginDeleteAsync(resourceGroupName, name, context).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete a RdsDBSnapshotAttributesResult. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of RdsDBSnapshotAttributesResult. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String name) { + deleteAsync(resourceGroupName, name).block(); + } + + /** + * Delete a RdsDBSnapshotAttributesResult. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of RdsDBSnapshotAttributesResult. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String name, Context context) { + deleteAsync(resourceGroupName, name, context).block(); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a RdsDBSnapshotAttributesResult list operation along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> + listBySubscriptionNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a RdsDBSnapshotAttributesResult list operation along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> + listBySubscriptionNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a RdsDBSnapshotAttributesResult list operation along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> + listByResourceGroupNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a RdsDBSnapshotAttributesResult list operation along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> + listByResourceGroupNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/RdsDbSnapshotAttributesResultsImpl.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/RdsDbSnapshotAttributesResultsImpl.java new file mode 100644 index 000000000000..cbd371611a7b --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/RdsDbSnapshotAttributesResultsImpl.java @@ -0,0 +1,152 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.awsconnector.fluent.RdsDbSnapshotAttributesResultsClient; +import com.azure.resourcemanager.awsconnector.fluent.models.RdsDBSnapshotAttributesResultInner; +import com.azure.resourcemanager.awsconnector.models.RdsDBSnapshotAttributesResult; +import com.azure.resourcemanager.awsconnector.models.RdsDbSnapshotAttributesResults; + +public final class RdsDbSnapshotAttributesResultsImpl implements RdsDbSnapshotAttributesResults { + private static final ClientLogger LOGGER = new ClientLogger(RdsDbSnapshotAttributesResultsImpl.class); + + private final RdsDbSnapshotAttributesResultsClient innerClient; + + private final com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager; + + public RdsDbSnapshotAttributesResultsImpl(RdsDbSnapshotAttributesResultsClient innerClient, + com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return ResourceManagerUtils.mapPage(inner, + inner1 -> new RdsDBSnapshotAttributesResultImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return ResourceManagerUtils.mapPage(inner, + inner1 -> new RdsDBSnapshotAttributesResultImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName) { + PagedIterable inner + = this.serviceClient().listByResourceGroup(resourceGroupName); + return ResourceManagerUtils.mapPage(inner, + inner1 -> new RdsDBSnapshotAttributesResultImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + PagedIterable inner + = this.serviceClient().listByResourceGroup(resourceGroupName, context); + return ResourceManagerUtils.mapPage(inner, + inner1 -> new RdsDBSnapshotAttributesResultImpl(inner1, this.manager())); + } + + public Response getByResourceGroupWithResponse(String resourceGroupName, String name, + Context context) { + Response inner + = this.serviceClient().getByResourceGroupWithResponse(resourceGroupName, name, context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new RdsDBSnapshotAttributesResultImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public RdsDBSnapshotAttributesResult getByResourceGroup(String resourceGroupName, String name) { + RdsDBSnapshotAttributesResultInner inner = this.serviceClient().getByResourceGroup(resourceGroupName, name); + if (inner != null) { + return new RdsDBSnapshotAttributesResultImpl(inner, this.manager()); + } else { + return null; + } + } + + public void deleteByResourceGroup(String resourceGroupName, String name) { + this.serviceClient().delete(resourceGroupName, name); + } + + public void delete(String resourceGroupName, String name, Context context) { + this.serviceClient().delete(resourceGroupName, name, context); + } + + public RdsDBSnapshotAttributesResult getById(String id) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String name = ResourceManagerUtils.getValueFromIdByName(id, "rdsDBSnapshotAttributesResults"); + if (name == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException(String.format( + "The resource ID '%s' is not valid. Missing path segment 'rdsDBSnapshotAttributesResults'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, name, Context.NONE).getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String name = ResourceManagerUtils.getValueFromIdByName(id, "rdsDBSnapshotAttributesResults"); + if (name == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException(String.format( + "The resource ID '%s' is not valid. Missing path segment 'rdsDBSnapshotAttributesResults'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, name, context); + } + + public void deleteById(String id) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String name = ResourceManagerUtils.getValueFromIdByName(id, "rdsDBSnapshotAttributesResults"); + if (name == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException(String.format( + "The resource ID '%s' is not valid. Missing path segment 'rdsDBSnapshotAttributesResults'.", id))); + } + this.delete(resourceGroupName, name, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String name = ResourceManagerUtils.getValueFromIdByName(id, "rdsDBSnapshotAttributesResults"); + if (name == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException(String.format( + "The resource ID '%s' is not valid. Missing path segment 'rdsDBSnapshotAttributesResults'.", id))); + } + this.delete(resourceGroupName, name, context); + } + + private RdsDbSnapshotAttributesResultsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.awsconnector.AwsconnectorManager manager() { + return this.serviceManager; + } + + public RdsDBSnapshotAttributesResultImpl define(String name) { + return new RdsDBSnapshotAttributesResultImpl(name, this.manager()); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/RdsDbSnapshotsClientImpl.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/RdsDbSnapshotsClientImpl.java new file mode 100644 index 000000000000..9dce42a57521 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/RdsDbSnapshotsClientImpl.java @@ -0,0 +1,1278 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.Patch; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.awsconnector.fluent.RdsDbSnapshotsClient; +import com.azure.resourcemanager.awsconnector.fluent.models.RdsDBSnapshotInner; +import com.azure.resourcemanager.awsconnector.models.RdsDBSnapshotListResult; +import com.azure.resourcemanager.awsconnector.models.RdsDBSnapshotTagsUpdate; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in RdsDbSnapshotsClient. + */ +public final class RdsDbSnapshotsClientImpl implements RdsDbSnapshotsClient { + /** + * The proxy service used to perform REST calls. + */ + private final RdsDbSnapshotsService service; + + /** + * The service client containing this operation class. + */ + private final MicrosoftAwsConnectorImpl client; + + /** + * Initializes an instance of RdsDbSnapshotsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + RdsDbSnapshotsClientImpl(MicrosoftAwsConnectorImpl client) { + this.service + = RestProxy.create(RdsDbSnapshotsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for MicrosoftAwsConnectorRdsDbSnapshots to be used by the proxy service + * to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "MicrosoftAwsConnecto") + public interface RdsDbSnapshotsService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.AwsConnector/rdsDBSnapshots") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/rdsDBSnapshots") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroup(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/rdsDBSnapshots/{name}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getByResourceGroup(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("name") String name, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/rdsDBSnapshots/{name}") + @ExpectedResponses({ 200, 201 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrReplace(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("name") String name, + @BodyParam("application/json") RdsDBSnapshotInner resource, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/rdsDBSnapshots/{name}") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> update(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("name") String name, + @BodyParam("application/json") RdsDBSnapshotTagsUpdate properties, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/rdsDBSnapshots/{name}") + @ExpectedResponses({ 202, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("name") String name, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listBySubscriptionNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroupNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); + } + + /** + * List RdsDBSnapshot resources by subscription ID. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a RdsDBSnapshot list operation along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync() { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List RdsDBSnapshot resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a RdsDBSnapshot list operation along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), accept, + context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * List RdsDBSnapshot resources by subscription ID. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a RdsDBSnapshot list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>(() -> listSinglePageAsync(), + nextLink -> listBySubscriptionNextSinglePageAsync(nextLink)); + } + + /** + * List RdsDBSnapshot resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a RdsDBSnapshot list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(Context context) { + return new PagedFlux<>(() -> listSinglePageAsync(context), + nextLink -> listBySubscriptionNextSinglePageAsync(nextLink, context)); + } + + /** + * List RdsDBSnapshot resources by subscription ID. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a RdsDBSnapshot list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + return new PagedIterable<>(listAsync()); + } + + /** + * List RdsDBSnapshot resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a RdsDBSnapshot list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Context context) { + return new PagedIterable<>(listAsync(context)); + } + + /** + * List RdsDBSnapshot resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a RdsDBSnapshot list operation along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List RdsDBSnapshot resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a RdsDBSnapshot list operation along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * List RdsDBSnapshot resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a RdsDBSnapshot list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName) { + return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); + } + + /** + * List RdsDBSnapshot resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a RdsDBSnapshot list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName, Context context) { + return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName, context), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink, context)); + } + + /** + * List RdsDBSnapshot resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a RdsDBSnapshot list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName)); + } + + /** + * List RdsDBSnapshot resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a RdsDBSnapshot list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, context)); + } + + /** + * Get a RdsDBSnapshot. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of RdsDBSnapshot. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a RdsDBSnapshot along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync(String resourceGroupName, + String name) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.getByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get a RdsDBSnapshot. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of RdsDBSnapshot. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a RdsDBSnapshot along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync(String resourceGroupName, + String name, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.getByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, accept, context); + } + + /** + * Get a RdsDBSnapshot. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of RdsDBSnapshot. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a RdsDBSnapshot on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getByResourceGroupAsync(String resourceGroupName, String name) { + return getByResourceGroupWithResponseAsync(resourceGroupName, name) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Get a RdsDBSnapshot. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of RdsDBSnapshot. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a RdsDBSnapshot along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getByResourceGroupWithResponse(String resourceGroupName, String name, + Context context) { + return getByResourceGroupWithResponseAsync(resourceGroupName, name, context).block(); + } + + /** + * Get a RdsDBSnapshot. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of RdsDBSnapshot. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a RdsDBSnapshot. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public RdsDBSnapshotInner getByResourceGroup(String resourceGroupName, String name) { + return getByResourceGroupWithResponse(resourceGroupName, name, Context.NONE).getValue(); + } + + /** + * Create a RdsDBSnapshot. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of RdsDBSnapshot. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrReplaceWithResponseAsync(String resourceGroupName, String name, + RdsDBSnapshotInner resource) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (resource == null) { + return Mono.error(new IllegalArgumentException("Parameter resource is required and cannot be null.")); + } else { + resource.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.createOrReplace(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, resource, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Create a RdsDBSnapshot. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of RdsDBSnapshot. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrReplaceWithResponseAsync(String resourceGroupName, String name, + RdsDBSnapshotInner resource, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (resource == null) { + return Mono.error(new IllegalArgumentException("Parameter resource is required and cannot be null.")); + } else { + resource.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.createOrReplace(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, resource, accept, context); + } + + /** + * Create a RdsDBSnapshot. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of RdsDBSnapshot. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, RdsDBSnapshotInner> + beginCreateOrReplaceAsync(String resourceGroupName, String name, RdsDBSnapshotInner resource) { + Mono>> mono = createOrReplaceWithResponseAsync(resourceGroupName, name, resource); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + RdsDBSnapshotInner.class, RdsDBSnapshotInner.class, this.client.getContext()); + } + + /** + * Create a RdsDBSnapshot. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of RdsDBSnapshot. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, RdsDBSnapshotInner> + beginCreateOrReplaceAsync(String resourceGroupName, String name, RdsDBSnapshotInner resource, Context context) { + context = this.client.mergeContext(context); + Mono>> mono + = createOrReplaceWithResponseAsync(resourceGroupName, name, resource, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + RdsDBSnapshotInner.class, RdsDBSnapshotInner.class, context); + } + + /** + * Create a RdsDBSnapshot. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of RdsDBSnapshot. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, RdsDBSnapshotInner> beginCreateOrReplace(String resourceGroupName, + String name, RdsDBSnapshotInner resource) { + return this.beginCreateOrReplaceAsync(resourceGroupName, name, resource).getSyncPoller(); + } + + /** + * Create a RdsDBSnapshot. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of RdsDBSnapshot. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, RdsDBSnapshotInner> beginCreateOrReplace(String resourceGroupName, + String name, RdsDBSnapshotInner resource, Context context) { + return this.beginCreateOrReplaceAsync(resourceGroupName, name, resource, context).getSyncPoller(); + } + + /** + * Create a RdsDBSnapshot. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of RdsDBSnapshot. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrReplaceAsync(String resourceGroupName, String name, + RdsDBSnapshotInner resource) { + return beginCreateOrReplaceAsync(resourceGroupName, name, resource).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create a RdsDBSnapshot. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of RdsDBSnapshot. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrReplaceAsync(String resourceGroupName, String name, + RdsDBSnapshotInner resource, Context context) { + return beginCreateOrReplaceAsync(resourceGroupName, name, resource, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create a RdsDBSnapshot. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of RdsDBSnapshot. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public RdsDBSnapshotInner createOrReplace(String resourceGroupName, String name, RdsDBSnapshotInner resource) { + return createOrReplaceAsync(resourceGroupName, name, resource).block(); + } + + /** + * Create a RdsDBSnapshot. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of RdsDBSnapshot. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public RdsDBSnapshotInner createOrReplace(String resourceGroupName, String name, RdsDBSnapshotInner resource, + Context context) { + return createOrReplaceAsync(resourceGroupName, name, resource, context).block(); + } + + /** + * Update a RdsDBSnapshot. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of RdsDBSnapshot. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync(String resourceGroupName, String name, + RdsDBSnapshotTagsUpdate properties) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (properties == null) { + return Mono.error(new IllegalArgumentException("Parameter properties is required and cannot be null.")); + } else { + properties.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.update(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, properties, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Update a RdsDBSnapshot. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of RdsDBSnapshot. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync(String resourceGroupName, String name, + RdsDBSnapshotTagsUpdate properties, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (properties == null) { + return Mono.error(new IllegalArgumentException("Parameter properties is required and cannot be null.")); + } else { + properties.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.update(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, name, properties, accept, context); + } + + /** + * Update a RdsDBSnapshot. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of RdsDBSnapshot. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, RdsDBSnapshotInner> beginUpdateAsync(String resourceGroupName, + String name, RdsDBSnapshotTagsUpdate properties) { + Mono>> mono = updateWithResponseAsync(resourceGroupName, name, properties); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + RdsDBSnapshotInner.class, RdsDBSnapshotInner.class, this.client.getContext()); + } + + /** + * Update a RdsDBSnapshot. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of RdsDBSnapshot. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, RdsDBSnapshotInner> beginUpdateAsync(String resourceGroupName, + String name, RdsDBSnapshotTagsUpdate properties, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = updateWithResponseAsync(resourceGroupName, name, properties, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + RdsDBSnapshotInner.class, RdsDBSnapshotInner.class, context); + } + + /** + * Update a RdsDBSnapshot. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of RdsDBSnapshot. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, RdsDBSnapshotInner> beginUpdate(String resourceGroupName, + String name, RdsDBSnapshotTagsUpdate properties) { + return this.beginUpdateAsync(resourceGroupName, name, properties).getSyncPoller(); + } + + /** + * Update a RdsDBSnapshot. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of RdsDBSnapshot. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, RdsDBSnapshotInner> beginUpdate(String resourceGroupName, + String name, RdsDBSnapshotTagsUpdate properties, Context context) { + return this.beginUpdateAsync(resourceGroupName, name, properties, context).getSyncPoller(); + } + + /** + * Update a RdsDBSnapshot. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of RdsDBSnapshot. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync(String resourceGroupName, String name, + RdsDBSnapshotTagsUpdate properties) { + return beginUpdateAsync(resourceGroupName, name, properties).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Update a RdsDBSnapshot. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of RdsDBSnapshot. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync(String resourceGroupName, String name, + RdsDBSnapshotTagsUpdate properties, Context context) { + return beginUpdateAsync(resourceGroupName, name, properties, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Update a RdsDBSnapshot. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of RdsDBSnapshot. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public RdsDBSnapshotInner update(String resourceGroupName, String name, RdsDBSnapshotTagsUpdate properties) { + return updateAsync(resourceGroupName, name, properties).block(); + } + + /** + * Update a RdsDBSnapshot. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of RdsDBSnapshot. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public RdsDBSnapshotInner update(String resourceGroupName, String name, RdsDBSnapshotTagsUpdate properties, + Context context) { + return updateAsync(resourceGroupName, name, properties, context).block(); + } + + /** + * Delete a RdsDBSnapshot. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of RdsDBSnapshot. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync(String resourceGroupName, String name) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Delete a RdsDBSnapshot. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of RdsDBSnapshot. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync(String resourceGroupName, String name, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.delete(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, name, accept, context); + } + + /** + * Delete a RdsDBSnapshot. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of RdsDBSnapshot. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String name) { + Mono>> mono = deleteWithResponseAsync(resourceGroupName, name); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); + } + + /** + * Delete a RdsDBSnapshot. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of RdsDBSnapshot. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String name, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = deleteWithResponseAsync(resourceGroupName, name, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + context); + } + + /** + * Delete a RdsDBSnapshot. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of RdsDBSnapshot. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String name) { + return this.beginDeleteAsync(resourceGroupName, name).getSyncPoller(); + } + + /** + * Delete a RdsDBSnapshot. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of RdsDBSnapshot. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String name, Context context) { + return this.beginDeleteAsync(resourceGroupName, name, context).getSyncPoller(); + } + + /** + * Delete a RdsDBSnapshot. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of RdsDBSnapshot. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String name) { + return beginDeleteAsync(resourceGroupName, name).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete a RdsDBSnapshot. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of RdsDBSnapshot. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String name, Context context) { + return beginDeleteAsync(resourceGroupName, name, context).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete a RdsDBSnapshot. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of RdsDBSnapshot. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String name) { + deleteAsync(resourceGroupName, name).block(); + } + + /** + * Delete a RdsDBSnapshot. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of RdsDBSnapshot. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String name, Context context) { + deleteAsync(resourceGroupName, name, context).block(); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a RdsDBSnapshot list operation along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listBySubscriptionNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a RdsDBSnapshot list operation along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listBySubscriptionNextSinglePageAsync(String nextLink, + Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a RdsDBSnapshot list operation along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a RdsDBSnapshot list operation along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupNextSinglePageAsync(String nextLink, + Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/RdsDbSnapshotsImpl.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/RdsDbSnapshotsImpl.java new file mode 100644 index 000000000000..eddd263a091a --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/RdsDbSnapshotsImpl.java @@ -0,0 +1,146 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.awsconnector.fluent.RdsDbSnapshotsClient; +import com.azure.resourcemanager.awsconnector.fluent.models.RdsDBSnapshotInner; +import com.azure.resourcemanager.awsconnector.models.RdsDBSnapshot; +import com.azure.resourcemanager.awsconnector.models.RdsDbSnapshots; + +public final class RdsDbSnapshotsImpl implements RdsDbSnapshots { + private static final ClientLogger LOGGER = new ClientLogger(RdsDbSnapshotsImpl.class); + + private final RdsDbSnapshotsClient innerClient; + + private final com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager; + + public RdsDbSnapshotsImpl(RdsDbSnapshotsClient innerClient, + com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return ResourceManagerUtils.mapPage(inner, inner1 -> new RdsDBSnapshotImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new RdsDBSnapshotImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName); + return ResourceManagerUtils.mapPage(inner, inner1 -> new RdsDBSnapshotImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new RdsDBSnapshotImpl(inner1, this.manager())); + } + + public Response getByResourceGroupWithResponse(String resourceGroupName, String name, + Context context) { + Response inner + = this.serviceClient().getByResourceGroupWithResponse(resourceGroupName, name, context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new RdsDBSnapshotImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public RdsDBSnapshot getByResourceGroup(String resourceGroupName, String name) { + RdsDBSnapshotInner inner = this.serviceClient().getByResourceGroup(resourceGroupName, name); + if (inner != null) { + return new RdsDBSnapshotImpl(inner, this.manager()); + } else { + return null; + } + } + + public void deleteByResourceGroup(String resourceGroupName, String name) { + this.serviceClient().delete(resourceGroupName, name); + } + + public void delete(String resourceGroupName, String name, Context context) { + this.serviceClient().delete(resourceGroupName, name, context); + } + + public RdsDBSnapshot getById(String id) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String name = ResourceManagerUtils.getValueFromIdByName(id, "rdsDBSnapshots"); + if (name == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'rdsDBSnapshots'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, name, Context.NONE).getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String name = ResourceManagerUtils.getValueFromIdByName(id, "rdsDBSnapshots"); + if (name == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'rdsDBSnapshots'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, name, context); + } + + public void deleteById(String id) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String name = ResourceManagerUtils.getValueFromIdByName(id, "rdsDBSnapshots"); + if (name == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'rdsDBSnapshots'.", id))); + } + this.delete(resourceGroupName, name, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String name = ResourceManagerUtils.getValueFromIdByName(id, "rdsDBSnapshots"); + if (name == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'rdsDBSnapshots'.", id))); + } + this.delete(resourceGroupName, name, context); + } + + private RdsDbSnapshotsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.awsconnector.AwsconnectorManager manager() { + return this.serviceManager; + } + + public RdsDBSnapshotImpl define(String name) { + return new RdsDBSnapshotImpl(name, this.manager()); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/RdsEventSubscriptionImpl.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/RdsEventSubscriptionImpl.java new file mode 100644 index 000000000000..7afcf32ec283 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/RdsEventSubscriptionImpl.java @@ -0,0 +1,178 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.implementation; + +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.awsconnector.fluent.models.RdsEventSubscriptionInner; +import com.azure.resourcemanager.awsconnector.models.RdsEventSubscription; +import com.azure.resourcemanager.awsconnector.models.RdsEventSubscriptionProperties; +import com.azure.resourcemanager.awsconnector.models.RdsEventSubscriptionTagsUpdate; +import java.util.Collections; +import java.util.Map; + +public final class RdsEventSubscriptionImpl + implements RdsEventSubscription, RdsEventSubscription.Definition, RdsEventSubscription.Update { + private RdsEventSubscriptionInner innerObject; + + private final com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public String location() { + return this.innerModel().location(); + } + + public Map tags() { + Map inner = this.innerModel().tags(); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } + } + + public RdsEventSubscriptionProperties properties() { + return this.innerModel().properties(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public String resourceGroupName() { + return resourceGroupName; + } + + public RdsEventSubscriptionInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.awsconnector.AwsconnectorManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String name; + + private RdsEventSubscriptionTagsUpdate updateProperties; + + public RdsEventSubscriptionImpl withExistingResourceGroup(String resourceGroupName) { + this.resourceGroupName = resourceGroupName; + return this; + } + + public RdsEventSubscription create() { + this.innerObject = serviceManager.serviceClient() + .getRdsEventSubscriptions() + .createOrReplace(resourceGroupName, name, this.innerModel(), Context.NONE); + return this; + } + + public RdsEventSubscription create(Context context) { + this.innerObject = serviceManager.serviceClient() + .getRdsEventSubscriptions() + .createOrReplace(resourceGroupName, name, this.innerModel(), context); + return this; + } + + RdsEventSubscriptionImpl(String name, com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager) { + this.innerObject = new RdsEventSubscriptionInner(); + this.serviceManager = serviceManager; + this.name = name; + } + + public RdsEventSubscriptionImpl update() { + this.updateProperties = new RdsEventSubscriptionTagsUpdate(); + return this; + } + + public RdsEventSubscription apply() { + this.innerObject = serviceManager.serviceClient() + .getRdsEventSubscriptions() + .update(resourceGroupName, name, updateProperties, Context.NONE); + return this; + } + + public RdsEventSubscription apply(Context context) { + this.innerObject = serviceManager.serviceClient() + .getRdsEventSubscriptions() + .update(resourceGroupName, name, updateProperties, context); + return this; + } + + RdsEventSubscriptionImpl(RdsEventSubscriptionInner innerObject, + com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.name = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "rdsEventSubscriptions"); + } + + public RdsEventSubscription refresh() { + this.innerObject = serviceManager.serviceClient() + .getRdsEventSubscriptions() + .getByResourceGroupWithResponse(resourceGroupName, name, Context.NONE) + .getValue(); + return this; + } + + public RdsEventSubscription refresh(Context context) { + this.innerObject = serviceManager.serviceClient() + .getRdsEventSubscriptions() + .getByResourceGroupWithResponse(resourceGroupName, name, context) + .getValue(); + return this; + } + + public RdsEventSubscriptionImpl withRegion(Region location) { + this.innerModel().withLocation(location.toString()); + return this; + } + + public RdsEventSubscriptionImpl withRegion(String location) { + this.innerModel().withLocation(location); + return this; + } + + public RdsEventSubscriptionImpl withTags(Map tags) { + if (isInCreateMode()) { + this.innerModel().withTags(tags); + return this; + } else { + this.updateProperties.withTags(tags); + return this; + } + } + + public RdsEventSubscriptionImpl withProperties(RdsEventSubscriptionProperties properties) { + this.innerModel().withProperties(properties); + return this; + } + + private boolean isInCreateMode() { + return this.innerModel().id() == null; + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/RdsEventSubscriptionsClientImpl.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/RdsEventSubscriptionsClientImpl.java new file mode 100644 index 000000000000..989cc1d171ef --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/RdsEventSubscriptionsClientImpl.java @@ -0,0 +1,1283 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.Patch; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.awsconnector.fluent.RdsEventSubscriptionsClient; +import com.azure.resourcemanager.awsconnector.fluent.models.RdsEventSubscriptionInner; +import com.azure.resourcemanager.awsconnector.models.RdsEventSubscriptionListResult; +import com.azure.resourcemanager.awsconnector.models.RdsEventSubscriptionTagsUpdate; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in RdsEventSubscriptionsClient. + */ +public final class RdsEventSubscriptionsClientImpl implements RdsEventSubscriptionsClient { + /** + * The proxy service used to perform REST calls. + */ + private final RdsEventSubscriptionsService service; + + /** + * The service client containing this operation class. + */ + private final MicrosoftAwsConnectorImpl client; + + /** + * Initializes an instance of RdsEventSubscriptionsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + RdsEventSubscriptionsClientImpl(MicrosoftAwsConnectorImpl client) { + this.service = RestProxy.create(RdsEventSubscriptionsService.class, client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for MicrosoftAwsConnectorRdsEventSubscriptions to be used by the proxy + * service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "MicrosoftAwsConnecto") + public interface RdsEventSubscriptionsService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.AwsConnector/rdsEventSubscriptions") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/rdsEventSubscriptions") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroup(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/rdsEventSubscriptions/{name}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getByResourceGroup(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("name") String name, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/rdsEventSubscriptions/{name}") + @ExpectedResponses({ 200, 201 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrReplace(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("name") String name, + @BodyParam("application/json") RdsEventSubscriptionInner resource, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/rdsEventSubscriptions/{name}") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> update(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("name") String name, + @BodyParam("application/json") RdsEventSubscriptionTagsUpdate properties, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/rdsEventSubscriptions/{name}") + @ExpectedResponses({ 202, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("name") String name, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listBySubscriptionNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroupNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); + } + + /** + * List RdsEventSubscription resources by subscription ID. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a RdsEventSubscription list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync() { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List RdsEventSubscription resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a RdsEventSubscription list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), accept, + context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * List RdsEventSubscription resources by subscription ID. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a RdsEventSubscription list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>(() -> listSinglePageAsync(), + nextLink -> listBySubscriptionNextSinglePageAsync(nextLink)); + } + + /** + * List RdsEventSubscription resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a RdsEventSubscription list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(Context context) { + return new PagedFlux<>(() -> listSinglePageAsync(context), + nextLink -> listBySubscriptionNextSinglePageAsync(nextLink, context)); + } + + /** + * List RdsEventSubscription resources by subscription ID. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a RdsEventSubscription list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + return new PagedIterable<>(listAsync()); + } + + /** + * List RdsEventSubscription resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a RdsEventSubscription list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Context context) { + return new PagedIterable<>(listAsync(context)); + } + + /** + * List RdsEventSubscription resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a RdsEventSubscription list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> + listByResourceGroupSinglePageAsync(String resourceGroupName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List RdsEventSubscription resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a RdsEventSubscription list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * List RdsEventSubscription resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a RdsEventSubscription list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName) { + return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); + } + + /** + * List RdsEventSubscription resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a RdsEventSubscription list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName, Context context) { + return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName, context), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink, context)); + } + + /** + * List RdsEventSubscription resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a RdsEventSubscription list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName)); + } + + /** + * List RdsEventSubscription resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a RdsEventSubscription list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, context)); + } + + /** + * Get a RdsEventSubscription. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of RdsEventSubscription. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a RdsEventSubscription along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync(String resourceGroupName, + String name) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.getByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get a RdsEventSubscription. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of RdsEventSubscription. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a RdsEventSubscription along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync(String resourceGroupName, + String name, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.getByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, accept, context); + } + + /** + * Get a RdsEventSubscription. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of RdsEventSubscription. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a RdsEventSubscription on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getByResourceGroupAsync(String resourceGroupName, String name) { + return getByResourceGroupWithResponseAsync(resourceGroupName, name) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Get a RdsEventSubscription. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of RdsEventSubscription. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a RdsEventSubscription along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getByResourceGroupWithResponse(String resourceGroupName, String name, + Context context) { + return getByResourceGroupWithResponseAsync(resourceGroupName, name, context).block(); + } + + /** + * Get a RdsEventSubscription. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of RdsEventSubscription. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a RdsEventSubscription. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public RdsEventSubscriptionInner getByResourceGroup(String resourceGroupName, String name) { + return getByResourceGroupWithResponse(resourceGroupName, name, Context.NONE).getValue(); + } + + /** + * Create a RdsEventSubscription. Please note that end user resource creation is currently restricted, but it will + * be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of RdsEventSubscription. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrReplaceWithResponseAsync(String resourceGroupName, String name, + RdsEventSubscriptionInner resource) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (resource == null) { + return Mono.error(new IllegalArgumentException("Parameter resource is required and cannot be null.")); + } else { + resource.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.createOrReplace(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, resource, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Create a RdsEventSubscription. Please note that end user resource creation is currently restricted, but it will + * be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of RdsEventSubscription. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrReplaceWithResponseAsync(String resourceGroupName, String name, + RdsEventSubscriptionInner resource, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (resource == null) { + return Mono.error(new IllegalArgumentException("Parameter resource is required and cannot be null.")); + } else { + resource.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.createOrReplace(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, resource, accept, context); + } + + /** + * Create a RdsEventSubscription. Please note that end user resource creation is currently restricted, but it will + * be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of RdsEventSubscription. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, RdsEventSubscriptionInner> + beginCreateOrReplaceAsync(String resourceGroupName, String name, RdsEventSubscriptionInner resource) { + Mono>> mono = createOrReplaceWithResponseAsync(resourceGroupName, name, resource); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), RdsEventSubscriptionInner.class, RdsEventSubscriptionInner.class, + this.client.getContext()); + } + + /** + * Create a RdsEventSubscription. Please note that end user resource creation is currently restricted, but it will + * be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of RdsEventSubscription. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, RdsEventSubscriptionInner> beginCreateOrReplaceAsync( + String resourceGroupName, String name, RdsEventSubscriptionInner resource, Context context) { + context = this.client.mergeContext(context); + Mono>> mono + = createOrReplaceWithResponseAsync(resourceGroupName, name, resource, context); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), RdsEventSubscriptionInner.class, RdsEventSubscriptionInner.class, context); + } + + /** + * Create a RdsEventSubscription. Please note that end user resource creation is currently restricted, but it will + * be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of RdsEventSubscription. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, RdsEventSubscriptionInner> + beginCreateOrReplace(String resourceGroupName, String name, RdsEventSubscriptionInner resource) { + return this.beginCreateOrReplaceAsync(resourceGroupName, name, resource).getSyncPoller(); + } + + /** + * Create a RdsEventSubscription. Please note that end user resource creation is currently restricted, but it will + * be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of RdsEventSubscription. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, RdsEventSubscriptionInner> beginCreateOrReplace( + String resourceGroupName, String name, RdsEventSubscriptionInner resource, Context context) { + return this.beginCreateOrReplaceAsync(resourceGroupName, name, resource, context).getSyncPoller(); + } + + /** + * Create a RdsEventSubscription. Please note that end user resource creation is currently restricted, but it will + * be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of RdsEventSubscription. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrReplaceAsync(String resourceGroupName, String name, + RdsEventSubscriptionInner resource) { + return beginCreateOrReplaceAsync(resourceGroupName, name, resource).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create a RdsEventSubscription. Please note that end user resource creation is currently restricted, but it will + * be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of RdsEventSubscription. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrReplaceAsync(String resourceGroupName, String name, + RdsEventSubscriptionInner resource, Context context) { + return beginCreateOrReplaceAsync(resourceGroupName, name, resource, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create a RdsEventSubscription. Please note that end user resource creation is currently restricted, but it will + * be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of RdsEventSubscription. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public RdsEventSubscriptionInner createOrReplace(String resourceGroupName, String name, + RdsEventSubscriptionInner resource) { + return createOrReplaceAsync(resourceGroupName, name, resource).block(); + } + + /** + * Create a RdsEventSubscription. Please note that end user resource creation is currently restricted, but it will + * be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of RdsEventSubscription. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public RdsEventSubscriptionInner createOrReplace(String resourceGroupName, String name, + RdsEventSubscriptionInner resource, Context context) { + return createOrReplaceAsync(resourceGroupName, name, resource, context).block(); + } + + /** + * Update a RdsEventSubscription. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of RdsEventSubscription. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync(String resourceGroupName, String name, + RdsEventSubscriptionTagsUpdate properties) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (properties == null) { + return Mono.error(new IllegalArgumentException("Parameter properties is required and cannot be null.")); + } else { + properties.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.update(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, properties, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Update a RdsEventSubscription. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of RdsEventSubscription. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync(String resourceGroupName, String name, + RdsEventSubscriptionTagsUpdate properties, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (properties == null) { + return Mono.error(new IllegalArgumentException("Parameter properties is required and cannot be null.")); + } else { + properties.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.update(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, name, properties, accept, context); + } + + /** + * Update a RdsEventSubscription. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of RdsEventSubscription. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, RdsEventSubscriptionInner> + beginUpdateAsync(String resourceGroupName, String name, RdsEventSubscriptionTagsUpdate properties) { + Mono>> mono = updateWithResponseAsync(resourceGroupName, name, properties); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), RdsEventSubscriptionInner.class, RdsEventSubscriptionInner.class, + this.client.getContext()); + } + + /** + * Update a RdsEventSubscription. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of RdsEventSubscription. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, RdsEventSubscriptionInner> beginUpdateAsync( + String resourceGroupName, String name, RdsEventSubscriptionTagsUpdate properties, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = updateWithResponseAsync(resourceGroupName, name, properties, context); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), RdsEventSubscriptionInner.class, RdsEventSubscriptionInner.class, context); + } + + /** + * Update a RdsEventSubscription. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of RdsEventSubscription. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, RdsEventSubscriptionInner> + beginUpdate(String resourceGroupName, String name, RdsEventSubscriptionTagsUpdate properties) { + return this.beginUpdateAsync(resourceGroupName, name, properties).getSyncPoller(); + } + + /** + * Update a RdsEventSubscription. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of RdsEventSubscription. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, RdsEventSubscriptionInner> + beginUpdate(String resourceGroupName, String name, RdsEventSubscriptionTagsUpdate properties, Context context) { + return this.beginUpdateAsync(resourceGroupName, name, properties, context).getSyncPoller(); + } + + /** + * Update a RdsEventSubscription. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of RdsEventSubscription. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync(String resourceGroupName, String name, + RdsEventSubscriptionTagsUpdate properties) { + return beginUpdateAsync(resourceGroupName, name, properties).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Update a RdsEventSubscription. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of RdsEventSubscription. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync(String resourceGroupName, String name, + RdsEventSubscriptionTagsUpdate properties, Context context) { + return beginUpdateAsync(resourceGroupName, name, properties, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Update a RdsEventSubscription. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of RdsEventSubscription. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public RdsEventSubscriptionInner update(String resourceGroupName, String name, + RdsEventSubscriptionTagsUpdate properties) { + return updateAsync(resourceGroupName, name, properties).block(); + } + + /** + * Update a RdsEventSubscription. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of RdsEventSubscription. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public RdsEventSubscriptionInner update(String resourceGroupName, String name, + RdsEventSubscriptionTagsUpdate properties, Context context) { + return updateAsync(resourceGroupName, name, properties, context).block(); + } + + /** + * Delete a RdsEventSubscription. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of RdsEventSubscription. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync(String resourceGroupName, String name) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Delete a RdsEventSubscription. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of RdsEventSubscription. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync(String resourceGroupName, String name, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.delete(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, name, accept, context); + } + + /** + * Delete a RdsEventSubscription. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of RdsEventSubscription. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String name) { + Mono>> mono = deleteWithResponseAsync(resourceGroupName, name); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); + } + + /** + * Delete a RdsEventSubscription. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of RdsEventSubscription. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String name, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = deleteWithResponseAsync(resourceGroupName, name, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + context); + } + + /** + * Delete a RdsEventSubscription. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of RdsEventSubscription. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String name) { + return this.beginDeleteAsync(resourceGroupName, name).getSyncPoller(); + } + + /** + * Delete a RdsEventSubscription. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of RdsEventSubscription. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String name, Context context) { + return this.beginDeleteAsync(resourceGroupName, name, context).getSyncPoller(); + } + + /** + * Delete a RdsEventSubscription. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of RdsEventSubscription. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String name) { + return beginDeleteAsync(resourceGroupName, name).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete a RdsEventSubscription. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of RdsEventSubscription. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String name, Context context) { + return beginDeleteAsync(resourceGroupName, name, context).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete a RdsEventSubscription. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of RdsEventSubscription. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String name) { + deleteAsync(resourceGroupName, name).block(); + } + + /** + * Delete a RdsEventSubscription. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of RdsEventSubscription. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String name, Context context) { + deleteAsync(resourceGroupName, name, context).block(); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a RdsEventSubscription list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listBySubscriptionNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a RdsEventSubscription list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listBySubscriptionNextSinglePageAsync(String nextLink, + Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a RdsEventSubscription list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a RdsEventSubscription list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupNextSinglePageAsync(String nextLink, + Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/RdsEventSubscriptionsImpl.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/RdsEventSubscriptionsImpl.java new file mode 100644 index 000000000000..07b3ac03263e --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/RdsEventSubscriptionsImpl.java @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.awsconnector.fluent.RdsEventSubscriptionsClient; +import com.azure.resourcemanager.awsconnector.fluent.models.RdsEventSubscriptionInner; +import com.azure.resourcemanager.awsconnector.models.RdsEventSubscription; +import com.azure.resourcemanager.awsconnector.models.RdsEventSubscriptions; + +public final class RdsEventSubscriptionsImpl implements RdsEventSubscriptions { + private static final ClientLogger LOGGER = new ClientLogger(RdsEventSubscriptionsImpl.class); + + private final RdsEventSubscriptionsClient innerClient; + + private final com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager; + + public RdsEventSubscriptionsImpl(RdsEventSubscriptionsClient innerClient, + com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return ResourceManagerUtils.mapPage(inner, inner1 -> new RdsEventSubscriptionImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new RdsEventSubscriptionImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName); + return ResourceManagerUtils.mapPage(inner, inner1 -> new RdsEventSubscriptionImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + PagedIterable inner + = this.serviceClient().listByResourceGroup(resourceGroupName, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new RdsEventSubscriptionImpl(inner1, this.manager())); + } + + public Response getByResourceGroupWithResponse(String resourceGroupName, String name, + Context context) { + Response inner + = this.serviceClient().getByResourceGroupWithResponse(resourceGroupName, name, context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new RdsEventSubscriptionImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public RdsEventSubscription getByResourceGroup(String resourceGroupName, String name) { + RdsEventSubscriptionInner inner = this.serviceClient().getByResourceGroup(resourceGroupName, name); + if (inner != null) { + return new RdsEventSubscriptionImpl(inner, this.manager()); + } else { + return null; + } + } + + public void deleteByResourceGroup(String resourceGroupName, String name) { + this.serviceClient().delete(resourceGroupName, name); + } + + public void delete(String resourceGroupName, String name, Context context) { + this.serviceClient().delete(resourceGroupName, name, context); + } + + public RdsEventSubscription getById(String id) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String name = ResourceManagerUtils.getValueFromIdByName(id, "rdsEventSubscriptions"); + if (name == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'rdsEventSubscriptions'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, name, Context.NONE).getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String name = ResourceManagerUtils.getValueFromIdByName(id, "rdsEventSubscriptions"); + if (name == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'rdsEventSubscriptions'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, name, context); + } + + public void deleteById(String id) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String name = ResourceManagerUtils.getValueFromIdByName(id, "rdsEventSubscriptions"); + if (name == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'rdsEventSubscriptions'.", id))); + } + this.delete(resourceGroupName, name, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String name = ResourceManagerUtils.getValueFromIdByName(id, "rdsEventSubscriptions"); + if (name == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'rdsEventSubscriptions'.", id))); + } + this.delete(resourceGroupName, name, context); + } + + private RdsEventSubscriptionsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.awsconnector.AwsconnectorManager manager() { + return this.serviceManager; + } + + public RdsEventSubscriptionImpl define(String name) { + return new RdsEventSubscriptionImpl(name, this.manager()); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/RdsExportTaskImpl.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/RdsExportTaskImpl.java new file mode 100644 index 000000000000..6af3491f5412 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/RdsExportTaskImpl.java @@ -0,0 +1,177 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.implementation; + +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.awsconnector.fluent.models.RdsExportTaskInner; +import com.azure.resourcemanager.awsconnector.models.RdsExportTask; +import com.azure.resourcemanager.awsconnector.models.RdsExportTaskProperties; +import com.azure.resourcemanager.awsconnector.models.RdsExportTaskTagsUpdate; +import java.util.Collections; +import java.util.Map; + +public final class RdsExportTaskImpl implements RdsExportTask, RdsExportTask.Definition, RdsExportTask.Update { + private RdsExportTaskInner innerObject; + + private final com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public String location() { + return this.innerModel().location(); + } + + public Map tags() { + Map inner = this.innerModel().tags(); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } + } + + public RdsExportTaskProperties properties() { + return this.innerModel().properties(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public String resourceGroupName() { + return resourceGroupName; + } + + public RdsExportTaskInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.awsconnector.AwsconnectorManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String name; + + private RdsExportTaskTagsUpdate updateProperties; + + public RdsExportTaskImpl withExistingResourceGroup(String resourceGroupName) { + this.resourceGroupName = resourceGroupName; + return this; + } + + public RdsExportTask create() { + this.innerObject = serviceManager.serviceClient() + .getRdsExportTasks() + .createOrReplace(resourceGroupName, name, this.innerModel(), Context.NONE); + return this; + } + + public RdsExportTask create(Context context) { + this.innerObject = serviceManager.serviceClient() + .getRdsExportTasks() + .createOrReplace(resourceGroupName, name, this.innerModel(), context); + return this; + } + + RdsExportTaskImpl(String name, com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager) { + this.innerObject = new RdsExportTaskInner(); + this.serviceManager = serviceManager; + this.name = name; + } + + public RdsExportTaskImpl update() { + this.updateProperties = new RdsExportTaskTagsUpdate(); + return this; + } + + public RdsExportTask apply() { + this.innerObject = serviceManager.serviceClient() + .getRdsExportTasks() + .update(resourceGroupName, name, updateProperties, Context.NONE); + return this; + } + + public RdsExportTask apply(Context context) { + this.innerObject = serviceManager.serviceClient() + .getRdsExportTasks() + .update(resourceGroupName, name, updateProperties, context); + return this; + } + + RdsExportTaskImpl(RdsExportTaskInner innerObject, + com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.name = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "rdsExportTasks"); + } + + public RdsExportTask refresh() { + this.innerObject = serviceManager.serviceClient() + .getRdsExportTasks() + .getByResourceGroupWithResponse(resourceGroupName, name, Context.NONE) + .getValue(); + return this; + } + + public RdsExportTask refresh(Context context) { + this.innerObject = serviceManager.serviceClient() + .getRdsExportTasks() + .getByResourceGroupWithResponse(resourceGroupName, name, context) + .getValue(); + return this; + } + + public RdsExportTaskImpl withRegion(Region location) { + this.innerModel().withLocation(location.toString()); + return this; + } + + public RdsExportTaskImpl withRegion(String location) { + this.innerModel().withLocation(location); + return this; + } + + public RdsExportTaskImpl withTags(Map tags) { + if (isInCreateMode()) { + this.innerModel().withTags(tags); + return this; + } else { + this.updateProperties.withTags(tags); + return this; + } + } + + public RdsExportTaskImpl withProperties(RdsExportTaskProperties properties) { + this.innerModel().withProperties(properties); + return this; + } + + private boolean isInCreateMode() { + return this.innerModel().id() == null; + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/RdsExportTasksClientImpl.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/RdsExportTasksClientImpl.java new file mode 100644 index 000000000000..95066b72b4bc --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/RdsExportTasksClientImpl.java @@ -0,0 +1,1278 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.Patch; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.awsconnector.fluent.RdsExportTasksClient; +import com.azure.resourcemanager.awsconnector.fluent.models.RdsExportTaskInner; +import com.azure.resourcemanager.awsconnector.models.RdsExportTaskListResult; +import com.azure.resourcemanager.awsconnector.models.RdsExportTaskTagsUpdate; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in RdsExportTasksClient. + */ +public final class RdsExportTasksClientImpl implements RdsExportTasksClient { + /** + * The proxy service used to perform REST calls. + */ + private final RdsExportTasksService service; + + /** + * The service client containing this operation class. + */ + private final MicrosoftAwsConnectorImpl client; + + /** + * Initializes an instance of RdsExportTasksClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + RdsExportTasksClientImpl(MicrosoftAwsConnectorImpl client) { + this.service + = RestProxy.create(RdsExportTasksService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for MicrosoftAwsConnectorRdsExportTasks to be used by the proxy service + * to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "MicrosoftAwsConnecto") + public interface RdsExportTasksService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.AwsConnector/rdsExportTasks") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/rdsExportTasks") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroup(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/rdsExportTasks/{name}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getByResourceGroup(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("name") String name, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/rdsExportTasks/{name}") + @ExpectedResponses({ 200, 201 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrReplace(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("name") String name, + @BodyParam("application/json") RdsExportTaskInner resource, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/rdsExportTasks/{name}") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> update(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("name") String name, + @BodyParam("application/json") RdsExportTaskTagsUpdate properties, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/rdsExportTasks/{name}") + @ExpectedResponses({ 202, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("name") String name, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listBySubscriptionNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroupNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); + } + + /** + * List RdsExportTask resources by subscription ID. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a RdsExportTask list operation along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync() { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List RdsExportTask resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a RdsExportTask list operation along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), accept, + context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * List RdsExportTask resources by subscription ID. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a RdsExportTask list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>(() -> listSinglePageAsync(), + nextLink -> listBySubscriptionNextSinglePageAsync(nextLink)); + } + + /** + * List RdsExportTask resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a RdsExportTask list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(Context context) { + return new PagedFlux<>(() -> listSinglePageAsync(context), + nextLink -> listBySubscriptionNextSinglePageAsync(nextLink, context)); + } + + /** + * List RdsExportTask resources by subscription ID. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a RdsExportTask list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + return new PagedIterable<>(listAsync()); + } + + /** + * List RdsExportTask resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a RdsExportTask list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Context context) { + return new PagedIterable<>(listAsync(context)); + } + + /** + * List RdsExportTask resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a RdsExportTask list operation along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List RdsExportTask resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a RdsExportTask list operation along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * List RdsExportTask resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a RdsExportTask list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName) { + return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); + } + + /** + * List RdsExportTask resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a RdsExportTask list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName, Context context) { + return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName, context), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink, context)); + } + + /** + * List RdsExportTask resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a RdsExportTask list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName)); + } + + /** + * List RdsExportTask resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a RdsExportTask list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, context)); + } + + /** + * Get a RdsExportTask. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of RdsExportTask. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a RdsExportTask along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync(String resourceGroupName, + String name) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.getByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get a RdsExportTask. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of RdsExportTask. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a RdsExportTask along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync(String resourceGroupName, + String name, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.getByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, accept, context); + } + + /** + * Get a RdsExportTask. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of RdsExportTask. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a RdsExportTask on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getByResourceGroupAsync(String resourceGroupName, String name) { + return getByResourceGroupWithResponseAsync(resourceGroupName, name) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Get a RdsExportTask. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of RdsExportTask. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a RdsExportTask along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getByResourceGroupWithResponse(String resourceGroupName, String name, + Context context) { + return getByResourceGroupWithResponseAsync(resourceGroupName, name, context).block(); + } + + /** + * Get a RdsExportTask. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of RdsExportTask. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a RdsExportTask. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public RdsExportTaskInner getByResourceGroup(String resourceGroupName, String name) { + return getByResourceGroupWithResponse(resourceGroupName, name, Context.NONE).getValue(); + } + + /** + * Create a RdsExportTask. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of RdsExportTask. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrReplaceWithResponseAsync(String resourceGroupName, String name, + RdsExportTaskInner resource) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (resource == null) { + return Mono.error(new IllegalArgumentException("Parameter resource is required and cannot be null.")); + } else { + resource.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.createOrReplace(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, resource, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Create a RdsExportTask. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of RdsExportTask. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrReplaceWithResponseAsync(String resourceGroupName, String name, + RdsExportTaskInner resource, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (resource == null) { + return Mono.error(new IllegalArgumentException("Parameter resource is required and cannot be null.")); + } else { + resource.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.createOrReplace(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, resource, accept, context); + } + + /** + * Create a RdsExportTask. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of RdsExportTask. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, RdsExportTaskInner> + beginCreateOrReplaceAsync(String resourceGroupName, String name, RdsExportTaskInner resource) { + Mono>> mono = createOrReplaceWithResponseAsync(resourceGroupName, name, resource); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + RdsExportTaskInner.class, RdsExportTaskInner.class, this.client.getContext()); + } + + /** + * Create a RdsExportTask. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of RdsExportTask. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, RdsExportTaskInner> + beginCreateOrReplaceAsync(String resourceGroupName, String name, RdsExportTaskInner resource, Context context) { + context = this.client.mergeContext(context); + Mono>> mono + = createOrReplaceWithResponseAsync(resourceGroupName, name, resource, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + RdsExportTaskInner.class, RdsExportTaskInner.class, context); + } + + /** + * Create a RdsExportTask. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of RdsExportTask. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, RdsExportTaskInner> beginCreateOrReplace(String resourceGroupName, + String name, RdsExportTaskInner resource) { + return this.beginCreateOrReplaceAsync(resourceGroupName, name, resource).getSyncPoller(); + } + + /** + * Create a RdsExportTask. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of RdsExportTask. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, RdsExportTaskInner> beginCreateOrReplace(String resourceGroupName, + String name, RdsExportTaskInner resource, Context context) { + return this.beginCreateOrReplaceAsync(resourceGroupName, name, resource, context).getSyncPoller(); + } + + /** + * Create a RdsExportTask. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of RdsExportTask. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrReplaceAsync(String resourceGroupName, String name, + RdsExportTaskInner resource) { + return beginCreateOrReplaceAsync(resourceGroupName, name, resource).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create a RdsExportTask. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of RdsExportTask. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrReplaceAsync(String resourceGroupName, String name, + RdsExportTaskInner resource, Context context) { + return beginCreateOrReplaceAsync(resourceGroupName, name, resource, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create a RdsExportTask. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of RdsExportTask. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public RdsExportTaskInner createOrReplace(String resourceGroupName, String name, RdsExportTaskInner resource) { + return createOrReplaceAsync(resourceGroupName, name, resource).block(); + } + + /** + * Create a RdsExportTask. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of RdsExportTask. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public RdsExportTaskInner createOrReplace(String resourceGroupName, String name, RdsExportTaskInner resource, + Context context) { + return createOrReplaceAsync(resourceGroupName, name, resource, context).block(); + } + + /** + * Update a RdsExportTask. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of RdsExportTask. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync(String resourceGroupName, String name, + RdsExportTaskTagsUpdate properties) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (properties == null) { + return Mono.error(new IllegalArgumentException("Parameter properties is required and cannot be null.")); + } else { + properties.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.update(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, properties, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Update a RdsExportTask. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of RdsExportTask. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync(String resourceGroupName, String name, + RdsExportTaskTagsUpdate properties, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (properties == null) { + return Mono.error(new IllegalArgumentException("Parameter properties is required and cannot be null.")); + } else { + properties.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.update(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, name, properties, accept, context); + } + + /** + * Update a RdsExportTask. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of RdsExportTask. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, RdsExportTaskInner> beginUpdateAsync(String resourceGroupName, + String name, RdsExportTaskTagsUpdate properties) { + Mono>> mono = updateWithResponseAsync(resourceGroupName, name, properties); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + RdsExportTaskInner.class, RdsExportTaskInner.class, this.client.getContext()); + } + + /** + * Update a RdsExportTask. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of RdsExportTask. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, RdsExportTaskInner> beginUpdateAsync(String resourceGroupName, + String name, RdsExportTaskTagsUpdate properties, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = updateWithResponseAsync(resourceGroupName, name, properties, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + RdsExportTaskInner.class, RdsExportTaskInner.class, context); + } + + /** + * Update a RdsExportTask. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of RdsExportTask. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, RdsExportTaskInner> beginUpdate(String resourceGroupName, + String name, RdsExportTaskTagsUpdate properties) { + return this.beginUpdateAsync(resourceGroupName, name, properties).getSyncPoller(); + } + + /** + * Update a RdsExportTask. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of RdsExportTask. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, RdsExportTaskInner> beginUpdate(String resourceGroupName, + String name, RdsExportTaskTagsUpdate properties, Context context) { + return this.beginUpdateAsync(resourceGroupName, name, properties, context).getSyncPoller(); + } + + /** + * Update a RdsExportTask. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of RdsExportTask. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync(String resourceGroupName, String name, + RdsExportTaskTagsUpdate properties) { + return beginUpdateAsync(resourceGroupName, name, properties).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Update a RdsExportTask. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of RdsExportTask. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync(String resourceGroupName, String name, + RdsExportTaskTagsUpdate properties, Context context) { + return beginUpdateAsync(resourceGroupName, name, properties, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Update a RdsExportTask. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of RdsExportTask. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public RdsExportTaskInner update(String resourceGroupName, String name, RdsExportTaskTagsUpdate properties) { + return updateAsync(resourceGroupName, name, properties).block(); + } + + /** + * Update a RdsExportTask. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of RdsExportTask. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public RdsExportTaskInner update(String resourceGroupName, String name, RdsExportTaskTagsUpdate properties, + Context context) { + return updateAsync(resourceGroupName, name, properties, context).block(); + } + + /** + * Delete a RdsExportTask. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of RdsExportTask. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync(String resourceGroupName, String name) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Delete a RdsExportTask. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of RdsExportTask. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync(String resourceGroupName, String name, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.delete(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, name, accept, context); + } + + /** + * Delete a RdsExportTask. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of RdsExportTask. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String name) { + Mono>> mono = deleteWithResponseAsync(resourceGroupName, name); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); + } + + /** + * Delete a RdsExportTask. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of RdsExportTask. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String name, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = deleteWithResponseAsync(resourceGroupName, name, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + context); + } + + /** + * Delete a RdsExportTask. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of RdsExportTask. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String name) { + return this.beginDeleteAsync(resourceGroupName, name).getSyncPoller(); + } + + /** + * Delete a RdsExportTask. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of RdsExportTask. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String name, Context context) { + return this.beginDeleteAsync(resourceGroupName, name, context).getSyncPoller(); + } + + /** + * Delete a RdsExportTask. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of RdsExportTask. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String name) { + return beginDeleteAsync(resourceGroupName, name).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete a RdsExportTask. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of RdsExportTask. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String name, Context context) { + return beginDeleteAsync(resourceGroupName, name, context).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete a RdsExportTask. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of RdsExportTask. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String name) { + deleteAsync(resourceGroupName, name).block(); + } + + /** + * Delete a RdsExportTask. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of RdsExportTask. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String name, Context context) { + deleteAsync(resourceGroupName, name, context).block(); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a RdsExportTask list operation along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listBySubscriptionNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a RdsExportTask list operation along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listBySubscriptionNextSinglePageAsync(String nextLink, + Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a RdsExportTask list operation along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a RdsExportTask list operation along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupNextSinglePageAsync(String nextLink, + Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/RdsExportTasksImpl.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/RdsExportTasksImpl.java new file mode 100644 index 000000000000..06b7acba2e5d --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/RdsExportTasksImpl.java @@ -0,0 +1,146 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.awsconnector.fluent.RdsExportTasksClient; +import com.azure.resourcemanager.awsconnector.fluent.models.RdsExportTaskInner; +import com.azure.resourcemanager.awsconnector.models.RdsExportTask; +import com.azure.resourcemanager.awsconnector.models.RdsExportTasks; + +public final class RdsExportTasksImpl implements RdsExportTasks { + private static final ClientLogger LOGGER = new ClientLogger(RdsExportTasksImpl.class); + + private final RdsExportTasksClient innerClient; + + private final com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager; + + public RdsExportTasksImpl(RdsExportTasksClient innerClient, + com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return ResourceManagerUtils.mapPage(inner, inner1 -> new RdsExportTaskImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new RdsExportTaskImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName); + return ResourceManagerUtils.mapPage(inner, inner1 -> new RdsExportTaskImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new RdsExportTaskImpl(inner1, this.manager())); + } + + public Response getByResourceGroupWithResponse(String resourceGroupName, String name, + Context context) { + Response inner + = this.serviceClient().getByResourceGroupWithResponse(resourceGroupName, name, context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new RdsExportTaskImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public RdsExportTask getByResourceGroup(String resourceGroupName, String name) { + RdsExportTaskInner inner = this.serviceClient().getByResourceGroup(resourceGroupName, name); + if (inner != null) { + return new RdsExportTaskImpl(inner, this.manager()); + } else { + return null; + } + } + + public void deleteByResourceGroup(String resourceGroupName, String name) { + this.serviceClient().delete(resourceGroupName, name); + } + + public void delete(String resourceGroupName, String name, Context context) { + this.serviceClient().delete(resourceGroupName, name, context); + } + + public RdsExportTask getById(String id) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String name = ResourceManagerUtils.getValueFromIdByName(id, "rdsExportTasks"); + if (name == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'rdsExportTasks'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, name, Context.NONE).getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String name = ResourceManagerUtils.getValueFromIdByName(id, "rdsExportTasks"); + if (name == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'rdsExportTasks'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, name, context); + } + + public void deleteById(String id) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String name = ResourceManagerUtils.getValueFromIdByName(id, "rdsExportTasks"); + if (name == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'rdsExportTasks'.", id))); + } + this.delete(resourceGroupName, name, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String name = ResourceManagerUtils.getValueFromIdByName(id, "rdsExportTasks"); + if (name == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'rdsExportTasks'.", id))); + } + this.delete(resourceGroupName, name, context); + } + + private RdsExportTasksClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.awsconnector.AwsconnectorManager manager() { + return this.serviceManager; + } + + public RdsExportTaskImpl define(String name) { + return new RdsExportTaskImpl(name, this.manager()); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/RedshiftClusterImpl.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/RedshiftClusterImpl.java new file mode 100644 index 000000000000..c1a984ce86ad --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/RedshiftClusterImpl.java @@ -0,0 +1,177 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.implementation; + +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.awsconnector.fluent.models.RedshiftClusterInner; +import com.azure.resourcemanager.awsconnector.models.RedshiftCluster; +import com.azure.resourcemanager.awsconnector.models.RedshiftClusterProperties; +import com.azure.resourcemanager.awsconnector.models.RedshiftClusterTagsUpdate; +import java.util.Collections; +import java.util.Map; + +public final class RedshiftClusterImpl implements RedshiftCluster, RedshiftCluster.Definition, RedshiftCluster.Update { + private RedshiftClusterInner innerObject; + + private final com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public String location() { + return this.innerModel().location(); + } + + public Map tags() { + Map inner = this.innerModel().tags(); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } + } + + public RedshiftClusterProperties properties() { + return this.innerModel().properties(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public String resourceGroupName() { + return resourceGroupName; + } + + public RedshiftClusterInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.awsconnector.AwsconnectorManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String name; + + private RedshiftClusterTagsUpdate updateProperties; + + public RedshiftClusterImpl withExistingResourceGroup(String resourceGroupName) { + this.resourceGroupName = resourceGroupName; + return this; + } + + public RedshiftCluster create() { + this.innerObject = serviceManager.serviceClient() + .getRedshiftClusters() + .createOrReplace(resourceGroupName, name, this.innerModel(), Context.NONE); + return this; + } + + public RedshiftCluster create(Context context) { + this.innerObject = serviceManager.serviceClient() + .getRedshiftClusters() + .createOrReplace(resourceGroupName, name, this.innerModel(), context); + return this; + } + + RedshiftClusterImpl(String name, com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager) { + this.innerObject = new RedshiftClusterInner(); + this.serviceManager = serviceManager; + this.name = name; + } + + public RedshiftClusterImpl update() { + this.updateProperties = new RedshiftClusterTagsUpdate(); + return this; + } + + public RedshiftCluster apply() { + this.innerObject = serviceManager.serviceClient() + .getRedshiftClusters() + .update(resourceGroupName, name, updateProperties, Context.NONE); + return this; + } + + public RedshiftCluster apply(Context context) { + this.innerObject = serviceManager.serviceClient() + .getRedshiftClusters() + .update(resourceGroupName, name, updateProperties, context); + return this; + } + + RedshiftClusterImpl(RedshiftClusterInner innerObject, + com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.name = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "redshiftClusters"); + } + + public RedshiftCluster refresh() { + this.innerObject = serviceManager.serviceClient() + .getRedshiftClusters() + .getByResourceGroupWithResponse(resourceGroupName, name, Context.NONE) + .getValue(); + return this; + } + + public RedshiftCluster refresh(Context context) { + this.innerObject = serviceManager.serviceClient() + .getRedshiftClusters() + .getByResourceGroupWithResponse(resourceGroupName, name, context) + .getValue(); + return this; + } + + public RedshiftClusterImpl withRegion(Region location) { + this.innerModel().withLocation(location.toString()); + return this; + } + + public RedshiftClusterImpl withRegion(String location) { + this.innerModel().withLocation(location); + return this; + } + + public RedshiftClusterImpl withTags(Map tags) { + if (isInCreateMode()) { + this.innerModel().withTags(tags); + return this; + } else { + this.updateProperties.withTags(tags); + return this; + } + } + + public RedshiftClusterImpl withProperties(RedshiftClusterProperties properties) { + this.innerModel().withProperties(properties); + return this; + } + + private boolean isInCreateMode() { + return this.innerModel().id() == null; + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/RedshiftClusterParameterGroupImpl.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/RedshiftClusterParameterGroupImpl.java new file mode 100644 index 000000000000..0ab59bfd190a --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/RedshiftClusterParameterGroupImpl.java @@ -0,0 +1,179 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.implementation; + +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.awsconnector.fluent.models.RedshiftClusterParameterGroupInner; +import com.azure.resourcemanager.awsconnector.models.RedshiftClusterParameterGroup; +import com.azure.resourcemanager.awsconnector.models.RedshiftClusterParameterGroupProperties; +import com.azure.resourcemanager.awsconnector.models.RedshiftClusterParameterGroupTagsUpdate; +import java.util.Collections; +import java.util.Map; + +public final class RedshiftClusterParameterGroupImpl implements RedshiftClusterParameterGroup, + RedshiftClusterParameterGroup.Definition, RedshiftClusterParameterGroup.Update { + private RedshiftClusterParameterGroupInner innerObject; + + private final com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public String location() { + return this.innerModel().location(); + } + + public Map tags() { + Map inner = this.innerModel().tags(); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } + } + + public RedshiftClusterParameterGroupProperties properties() { + return this.innerModel().properties(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public String resourceGroupName() { + return resourceGroupName; + } + + public RedshiftClusterParameterGroupInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.awsconnector.AwsconnectorManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String name; + + private RedshiftClusterParameterGroupTagsUpdate updateProperties; + + public RedshiftClusterParameterGroupImpl withExistingResourceGroup(String resourceGroupName) { + this.resourceGroupName = resourceGroupName; + return this; + } + + public RedshiftClusterParameterGroup create() { + this.innerObject = serviceManager.serviceClient() + .getRedshiftClusterParameterGroups() + .createOrReplace(resourceGroupName, name, this.innerModel(), Context.NONE); + return this; + } + + public RedshiftClusterParameterGroup create(Context context) { + this.innerObject = serviceManager.serviceClient() + .getRedshiftClusterParameterGroups() + .createOrReplace(resourceGroupName, name, this.innerModel(), context); + return this; + } + + RedshiftClusterParameterGroupImpl(String name, + com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager) { + this.innerObject = new RedshiftClusterParameterGroupInner(); + this.serviceManager = serviceManager; + this.name = name; + } + + public RedshiftClusterParameterGroupImpl update() { + this.updateProperties = new RedshiftClusterParameterGroupTagsUpdate(); + return this; + } + + public RedshiftClusterParameterGroup apply() { + this.innerObject = serviceManager.serviceClient() + .getRedshiftClusterParameterGroups() + .update(resourceGroupName, name, updateProperties, Context.NONE); + return this; + } + + public RedshiftClusterParameterGroup apply(Context context) { + this.innerObject = serviceManager.serviceClient() + .getRedshiftClusterParameterGroups() + .update(resourceGroupName, name, updateProperties, context); + return this; + } + + RedshiftClusterParameterGroupImpl(RedshiftClusterParameterGroupInner innerObject, + com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.name = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "redshiftClusterParameterGroups"); + } + + public RedshiftClusterParameterGroup refresh() { + this.innerObject = serviceManager.serviceClient() + .getRedshiftClusterParameterGroups() + .getByResourceGroupWithResponse(resourceGroupName, name, Context.NONE) + .getValue(); + return this; + } + + public RedshiftClusterParameterGroup refresh(Context context) { + this.innerObject = serviceManager.serviceClient() + .getRedshiftClusterParameterGroups() + .getByResourceGroupWithResponse(resourceGroupName, name, context) + .getValue(); + return this; + } + + public RedshiftClusterParameterGroupImpl withRegion(Region location) { + this.innerModel().withLocation(location.toString()); + return this; + } + + public RedshiftClusterParameterGroupImpl withRegion(String location) { + this.innerModel().withLocation(location); + return this; + } + + public RedshiftClusterParameterGroupImpl withTags(Map tags) { + if (isInCreateMode()) { + this.innerModel().withTags(tags); + return this; + } else { + this.updateProperties.withTags(tags); + return this; + } + } + + public RedshiftClusterParameterGroupImpl withProperties(RedshiftClusterParameterGroupProperties properties) { + this.innerModel().withProperties(properties); + return this; + } + + private boolean isInCreateMode() { + return this.innerModel().id() == null; + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/RedshiftClusterParameterGroupsClientImpl.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/RedshiftClusterParameterGroupsClientImpl.java new file mode 100644 index 000000000000..d7c6a12aaf6d --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/RedshiftClusterParameterGroupsClientImpl.java @@ -0,0 +1,1300 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.Patch; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.awsconnector.fluent.RedshiftClusterParameterGroupsClient; +import com.azure.resourcemanager.awsconnector.fluent.models.RedshiftClusterParameterGroupInner; +import com.azure.resourcemanager.awsconnector.models.RedshiftClusterParameterGroupListResult; +import com.azure.resourcemanager.awsconnector.models.RedshiftClusterParameterGroupTagsUpdate; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in RedshiftClusterParameterGroupsClient. + */ +public final class RedshiftClusterParameterGroupsClientImpl implements RedshiftClusterParameterGroupsClient { + /** + * The proxy service used to perform REST calls. + */ + private final RedshiftClusterParameterGroupsService service; + + /** + * The service client containing this operation class. + */ + private final MicrosoftAwsConnectorImpl client; + + /** + * Initializes an instance of RedshiftClusterParameterGroupsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + RedshiftClusterParameterGroupsClientImpl(MicrosoftAwsConnectorImpl client) { + this.service = RestProxy.create(RedshiftClusterParameterGroupsService.class, client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for MicrosoftAwsConnectorRedshiftClusterParameterGroups to be used by the + * proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "MicrosoftAwsConnecto") + public interface RedshiftClusterParameterGroupsService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.AwsConnector/redshiftClusterParameterGroups") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/redshiftClusterParameterGroups") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroup(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/redshiftClusterParameterGroups/{name}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getByResourceGroup(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("name") String name, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/redshiftClusterParameterGroups/{name}") + @ExpectedResponses({ 200, 201 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrReplace(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("name") String name, + @BodyParam("application/json") RedshiftClusterParameterGroupInner resource, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/redshiftClusterParameterGroups/{name}") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> update(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("name") String name, + @BodyParam("application/json") RedshiftClusterParameterGroupTagsUpdate properties, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/redshiftClusterParameterGroups/{name}") + @ExpectedResponses({ 202, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("name") String name, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listBySubscriptionNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroupNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); + } + + /** + * List RedshiftClusterParameterGroup resources by subscription ID. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a RedshiftClusterParameterGroup list operation along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync() { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List RedshiftClusterParameterGroup resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a RedshiftClusterParameterGroup list operation along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), accept, + context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * List RedshiftClusterParameterGroup resources by subscription ID. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a RedshiftClusterParameterGroup list operation as paginated response with + * {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>(() -> listSinglePageAsync(), + nextLink -> listBySubscriptionNextSinglePageAsync(nextLink)); + } + + /** + * List RedshiftClusterParameterGroup resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a RedshiftClusterParameterGroup list operation as paginated response with + * {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(Context context) { + return new PagedFlux<>(() -> listSinglePageAsync(context), + nextLink -> listBySubscriptionNextSinglePageAsync(nextLink, context)); + } + + /** + * List RedshiftClusterParameterGroup resources by subscription ID. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a RedshiftClusterParameterGroup list operation as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + return new PagedIterable<>(listAsync()); + } + + /** + * List RedshiftClusterParameterGroup resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a RedshiftClusterParameterGroup list operation as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Context context) { + return new PagedIterable<>(listAsync(context)); + } + + /** + * List RedshiftClusterParameterGroup resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a RedshiftClusterParameterGroup list operation along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> + listByResourceGroupSinglePageAsync(String resourceGroupName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List RedshiftClusterParameterGroup resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a RedshiftClusterParameterGroup list operation along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> + listByResourceGroupSinglePageAsync(String resourceGroupName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * List RedshiftClusterParameterGroup resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a RedshiftClusterParameterGroup list operation as paginated response with + * {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName) { + return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); + } + + /** + * List RedshiftClusterParameterGroup resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a RedshiftClusterParameterGroup list operation as paginated response with + * {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName, + Context context) { + return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName, context), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink, context)); + } + + /** + * List RedshiftClusterParameterGroup resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a RedshiftClusterParameterGroup list operation as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName)); + } + + /** + * List RedshiftClusterParameterGroup resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a RedshiftClusterParameterGroup list operation as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName, + Context context) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, context)); + } + + /** + * Get a RedshiftClusterParameterGroup. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of RedshiftClusterParameterGroup. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a RedshiftClusterParameterGroup along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> + getByResourceGroupWithResponseAsync(String resourceGroupName, String name) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.getByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get a RedshiftClusterParameterGroup. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of RedshiftClusterParameterGroup. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a RedshiftClusterParameterGroup along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> + getByResourceGroupWithResponseAsync(String resourceGroupName, String name, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.getByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, accept, context); + } + + /** + * Get a RedshiftClusterParameterGroup. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of RedshiftClusterParameterGroup. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a RedshiftClusterParameterGroup on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getByResourceGroupAsync(String resourceGroupName, String name) { + return getByResourceGroupWithResponseAsync(resourceGroupName, name) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Get a RedshiftClusterParameterGroup. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of RedshiftClusterParameterGroup. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a RedshiftClusterParameterGroup along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getByResourceGroupWithResponse(String resourceGroupName, + String name, Context context) { + return getByResourceGroupWithResponseAsync(resourceGroupName, name, context).block(); + } + + /** + * Get a RedshiftClusterParameterGroup. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of RedshiftClusterParameterGroup. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a RedshiftClusterParameterGroup. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public RedshiftClusterParameterGroupInner getByResourceGroup(String resourceGroupName, String name) { + return getByResourceGroupWithResponse(resourceGroupName, name, Context.NONE).getValue(); + } + + /** + * Create a RedshiftClusterParameterGroup. Please note that end user resource creation is currently restricted, but + * it will be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of RedshiftClusterParameterGroup. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrReplaceWithResponseAsync(String resourceGroupName, String name, + RedshiftClusterParameterGroupInner resource) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (resource == null) { + return Mono.error(new IllegalArgumentException("Parameter resource is required and cannot be null.")); + } else { + resource.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.createOrReplace(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, resource, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Create a RedshiftClusterParameterGroup. Please note that end user resource creation is currently restricted, but + * it will be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of RedshiftClusterParameterGroup. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrReplaceWithResponseAsync(String resourceGroupName, String name, + RedshiftClusterParameterGroupInner resource, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (resource == null) { + return Mono.error(new IllegalArgumentException("Parameter resource is required and cannot be null.")); + } else { + resource.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.createOrReplace(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, resource, accept, context); + } + + /** + * Create a RedshiftClusterParameterGroup. Please note that end user resource creation is currently restricted, but + * it will be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of RedshiftClusterParameterGroup. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, RedshiftClusterParameterGroupInner> + beginCreateOrReplaceAsync(String resourceGroupName, String name, RedshiftClusterParameterGroupInner resource) { + Mono>> mono = createOrReplaceWithResponseAsync(resourceGroupName, name, resource); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), RedshiftClusterParameterGroupInner.class, + RedshiftClusterParameterGroupInner.class, this.client.getContext()); + } + + /** + * Create a RedshiftClusterParameterGroup. Please note that end user resource creation is currently restricted, but + * it will be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of RedshiftClusterParameterGroup. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, RedshiftClusterParameterGroupInner> + beginCreateOrReplaceAsync(String resourceGroupName, String name, RedshiftClusterParameterGroupInner resource, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono + = createOrReplaceWithResponseAsync(resourceGroupName, name, resource, context); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), RedshiftClusterParameterGroupInner.class, + RedshiftClusterParameterGroupInner.class, context); + } + + /** + * Create a RedshiftClusterParameterGroup. Please note that end user resource creation is currently restricted, but + * it will be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of RedshiftClusterParameterGroup. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, RedshiftClusterParameterGroupInner> + beginCreateOrReplace(String resourceGroupName, String name, RedshiftClusterParameterGroupInner resource) { + return this.beginCreateOrReplaceAsync(resourceGroupName, name, resource).getSyncPoller(); + } + + /** + * Create a RedshiftClusterParameterGroup. Please note that end user resource creation is currently restricted, but + * it will be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of RedshiftClusterParameterGroup. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, RedshiftClusterParameterGroupInner> + beginCreateOrReplace(String resourceGroupName, String name, RedshiftClusterParameterGroupInner resource, + Context context) { + return this.beginCreateOrReplaceAsync(resourceGroupName, name, resource, context).getSyncPoller(); + } + + /** + * Create a RedshiftClusterParameterGroup. Please note that end user resource creation is currently restricted, but + * it will be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of RedshiftClusterParameterGroup. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrReplaceAsync(String resourceGroupName, String name, + RedshiftClusterParameterGroupInner resource) { + return beginCreateOrReplaceAsync(resourceGroupName, name, resource).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create a RedshiftClusterParameterGroup. Please note that end user resource creation is currently restricted, but + * it will be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of RedshiftClusterParameterGroup. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrReplaceAsync(String resourceGroupName, String name, + RedshiftClusterParameterGroupInner resource, Context context) { + return beginCreateOrReplaceAsync(resourceGroupName, name, resource, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create a RedshiftClusterParameterGroup. Please note that end user resource creation is currently restricted, but + * it will be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of RedshiftClusterParameterGroup. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public RedshiftClusterParameterGroupInner createOrReplace(String resourceGroupName, String name, + RedshiftClusterParameterGroupInner resource) { + return createOrReplaceAsync(resourceGroupName, name, resource).block(); + } + + /** + * Create a RedshiftClusterParameterGroup. Please note that end user resource creation is currently restricted, but + * it will be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of RedshiftClusterParameterGroup. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public RedshiftClusterParameterGroupInner createOrReplace(String resourceGroupName, String name, + RedshiftClusterParameterGroupInner resource, Context context) { + return createOrReplaceAsync(resourceGroupName, name, resource, context).block(); + } + + /** + * Update a RedshiftClusterParameterGroup. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of RedshiftClusterParameterGroup. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync(String resourceGroupName, String name, + RedshiftClusterParameterGroupTagsUpdate properties) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (properties == null) { + return Mono.error(new IllegalArgumentException("Parameter properties is required and cannot be null.")); + } else { + properties.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.update(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, properties, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Update a RedshiftClusterParameterGroup. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of RedshiftClusterParameterGroup. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync(String resourceGroupName, String name, + RedshiftClusterParameterGroupTagsUpdate properties, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (properties == null) { + return Mono.error(new IllegalArgumentException("Parameter properties is required and cannot be null.")); + } else { + properties.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.update(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, name, properties, accept, context); + } + + /** + * Update a RedshiftClusterParameterGroup. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of RedshiftClusterParameterGroup. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, RedshiftClusterParameterGroupInner> + beginUpdateAsync(String resourceGroupName, String name, RedshiftClusterParameterGroupTagsUpdate properties) { + Mono>> mono = updateWithResponseAsync(resourceGroupName, name, properties); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), RedshiftClusterParameterGroupInner.class, + RedshiftClusterParameterGroupInner.class, this.client.getContext()); + } + + /** + * Update a RedshiftClusterParameterGroup. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of RedshiftClusterParameterGroup. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, RedshiftClusterParameterGroupInner> + beginUpdateAsync(String resourceGroupName, String name, RedshiftClusterParameterGroupTagsUpdate properties, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = updateWithResponseAsync(resourceGroupName, name, properties, context); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), RedshiftClusterParameterGroupInner.class, + RedshiftClusterParameterGroupInner.class, context); + } + + /** + * Update a RedshiftClusterParameterGroup. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of RedshiftClusterParameterGroup. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, RedshiftClusterParameterGroupInner> + beginUpdate(String resourceGroupName, String name, RedshiftClusterParameterGroupTagsUpdate properties) { + return this.beginUpdateAsync(resourceGroupName, name, properties).getSyncPoller(); + } + + /** + * Update a RedshiftClusterParameterGroup. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of RedshiftClusterParameterGroup. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, RedshiftClusterParameterGroupInner> beginUpdate( + String resourceGroupName, String name, RedshiftClusterParameterGroupTagsUpdate properties, Context context) { + return this.beginUpdateAsync(resourceGroupName, name, properties, context).getSyncPoller(); + } + + /** + * Update a RedshiftClusterParameterGroup. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of RedshiftClusterParameterGroup. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync(String resourceGroupName, String name, + RedshiftClusterParameterGroupTagsUpdate properties) { + return beginUpdateAsync(resourceGroupName, name, properties).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Update a RedshiftClusterParameterGroup. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of RedshiftClusterParameterGroup. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync(String resourceGroupName, String name, + RedshiftClusterParameterGroupTagsUpdate properties, Context context) { + return beginUpdateAsync(resourceGroupName, name, properties, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Update a RedshiftClusterParameterGroup. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of RedshiftClusterParameterGroup. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public RedshiftClusterParameterGroupInner update(String resourceGroupName, String name, + RedshiftClusterParameterGroupTagsUpdate properties) { + return updateAsync(resourceGroupName, name, properties).block(); + } + + /** + * Update a RedshiftClusterParameterGroup. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of RedshiftClusterParameterGroup. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public RedshiftClusterParameterGroupInner update(String resourceGroupName, String name, + RedshiftClusterParameterGroupTagsUpdate properties, Context context) { + return updateAsync(resourceGroupName, name, properties, context).block(); + } + + /** + * Delete a RedshiftClusterParameterGroup. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of RedshiftClusterParameterGroup. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync(String resourceGroupName, String name) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Delete a RedshiftClusterParameterGroup. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of RedshiftClusterParameterGroup. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync(String resourceGroupName, String name, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.delete(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, name, accept, context); + } + + /** + * Delete a RedshiftClusterParameterGroup. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of RedshiftClusterParameterGroup. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String name) { + Mono>> mono = deleteWithResponseAsync(resourceGroupName, name); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); + } + + /** + * Delete a RedshiftClusterParameterGroup. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of RedshiftClusterParameterGroup. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String name, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = deleteWithResponseAsync(resourceGroupName, name, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + context); + } + + /** + * Delete a RedshiftClusterParameterGroup. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of RedshiftClusterParameterGroup. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String name) { + return this.beginDeleteAsync(resourceGroupName, name).getSyncPoller(); + } + + /** + * Delete a RedshiftClusterParameterGroup. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of RedshiftClusterParameterGroup. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String name, Context context) { + return this.beginDeleteAsync(resourceGroupName, name, context).getSyncPoller(); + } + + /** + * Delete a RedshiftClusterParameterGroup. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of RedshiftClusterParameterGroup. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String name) { + return beginDeleteAsync(resourceGroupName, name).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete a RedshiftClusterParameterGroup. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of RedshiftClusterParameterGroup. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String name, Context context) { + return beginDeleteAsync(resourceGroupName, name, context).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete a RedshiftClusterParameterGroup. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of RedshiftClusterParameterGroup. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String name) { + deleteAsync(resourceGroupName, name).block(); + } + + /** + * Delete a RedshiftClusterParameterGroup. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of RedshiftClusterParameterGroup. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String name, Context context) { + deleteAsync(resourceGroupName, name, context).block(); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a RedshiftClusterParameterGroup list operation along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> + listBySubscriptionNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a RedshiftClusterParameterGroup list operation along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> + listBySubscriptionNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a RedshiftClusterParameterGroup list operation along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> + listByResourceGroupNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a RedshiftClusterParameterGroup list operation along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> + listByResourceGroupNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/RedshiftClusterParameterGroupsImpl.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/RedshiftClusterParameterGroupsImpl.java new file mode 100644 index 000000000000..2aa106dd1580 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/RedshiftClusterParameterGroupsImpl.java @@ -0,0 +1,152 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.awsconnector.fluent.RedshiftClusterParameterGroupsClient; +import com.azure.resourcemanager.awsconnector.fluent.models.RedshiftClusterParameterGroupInner; +import com.azure.resourcemanager.awsconnector.models.RedshiftClusterParameterGroup; +import com.azure.resourcemanager.awsconnector.models.RedshiftClusterParameterGroups; + +public final class RedshiftClusterParameterGroupsImpl implements RedshiftClusterParameterGroups { + private static final ClientLogger LOGGER = new ClientLogger(RedshiftClusterParameterGroupsImpl.class); + + private final RedshiftClusterParameterGroupsClient innerClient; + + private final com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager; + + public RedshiftClusterParameterGroupsImpl(RedshiftClusterParameterGroupsClient innerClient, + com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return ResourceManagerUtils.mapPage(inner, + inner1 -> new RedshiftClusterParameterGroupImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return ResourceManagerUtils.mapPage(inner, + inner1 -> new RedshiftClusterParameterGroupImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName) { + PagedIterable inner + = this.serviceClient().listByResourceGroup(resourceGroupName); + return ResourceManagerUtils.mapPage(inner, + inner1 -> new RedshiftClusterParameterGroupImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + PagedIterable inner + = this.serviceClient().listByResourceGroup(resourceGroupName, context); + return ResourceManagerUtils.mapPage(inner, + inner1 -> new RedshiftClusterParameterGroupImpl(inner1, this.manager())); + } + + public Response getByResourceGroupWithResponse(String resourceGroupName, String name, + Context context) { + Response inner + = this.serviceClient().getByResourceGroupWithResponse(resourceGroupName, name, context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new RedshiftClusterParameterGroupImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public RedshiftClusterParameterGroup getByResourceGroup(String resourceGroupName, String name) { + RedshiftClusterParameterGroupInner inner = this.serviceClient().getByResourceGroup(resourceGroupName, name); + if (inner != null) { + return new RedshiftClusterParameterGroupImpl(inner, this.manager()); + } else { + return null; + } + } + + public void deleteByResourceGroup(String resourceGroupName, String name) { + this.serviceClient().delete(resourceGroupName, name); + } + + public void delete(String resourceGroupName, String name, Context context) { + this.serviceClient().delete(resourceGroupName, name, context); + } + + public RedshiftClusterParameterGroup getById(String id) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String name = ResourceManagerUtils.getValueFromIdByName(id, "redshiftClusterParameterGroups"); + if (name == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException(String.format( + "The resource ID '%s' is not valid. Missing path segment 'redshiftClusterParameterGroups'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, name, Context.NONE).getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String name = ResourceManagerUtils.getValueFromIdByName(id, "redshiftClusterParameterGroups"); + if (name == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException(String.format( + "The resource ID '%s' is not valid. Missing path segment 'redshiftClusterParameterGroups'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, name, context); + } + + public void deleteById(String id) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String name = ResourceManagerUtils.getValueFromIdByName(id, "redshiftClusterParameterGroups"); + if (name == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException(String.format( + "The resource ID '%s' is not valid. Missing path segment 'redshiftClusterParameterGroups'.", id))); + } + this.delete(resourceGroupName, name, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String name = ResourceManagerUtils.getValueFromIdByName(id, "redshiftClusterParameterGroups"); + if (name == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException(String.format( + "The resource ID '%s' is not valid. Missing path segment 'redshiftClusterParameterGroups'.", id))); + } + this.delete(resourceGroupName, name, context); + } + + private RedshiftClusterParameterGroupsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.awsconnector.AwsconnectorManager manager() { + return this.serviceManager; + } + + public RedshiftClusterParameterGroupImpl define(String name) { + return new RedshiftClusterParameterGroupImpl(name, this.manager()); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/RedshiftClustersClientImpl.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/RedshiftClustersClientImpl.java new file mode 100644 index 000000000000..a791c87e4c50 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/RedshiftClustersClientImpl.java @@ -0,0 +1,1278 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.Patch; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.awsconnector.fluent.RedshiftClustersClient; +import com.azure.resourcemanager.awsconnector.fluent.models.RedshiftClusterInner; +import com.azure.resourcemanager.awsconnector.models.RedshiftClusterListResult; +import com.azure.resourcemanager.awsconnector.models.RedshiftClusterTagsUpdate; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in RedshiftClustersClient. + */ +public final class RedshiftClustersClientImpl implements RedshiftClustersClient { + /** + * The proxy service used to perform REST calls. + */ + private final RedshiftClustersService service; + + /** + * The service client containing this operation class. + */ + private final MicrosoftAwsConnectorImpl client; + + /** + * Initializes an instance of RedshiftClustersClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + RedshiftClustersClientImpl(MicrosoftAwsConnectorImpl client) { + this.service + = RestProxy.create(RedshiftClustersService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for MicrosoftAwsConnectorRedshiftClusters to be used by the proxy service + * to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "MicrosoftAwsConnecto") + public interface RedshiftClustersService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.AwsConnector/redshiftClusters") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/redshiftClusters") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroup(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/redshiftClusters/{name}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getByResourceGroup(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("name") String name, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/redshiftClusters/{name}") + @ExpectedResponses({ 200, 201 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrReplace(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("name") String name, + @BodyParam("application/json") RedshiftClusterInner resource, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/redshiftClusters/{name}") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> update(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("name") String name, + @BodyParam("application/json") RedshiftClusterTagsUpdate properties, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/redshiftClusters/{name}") + @ExpectedResponses({ 202, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("name") String name, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listBySubscriptionNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroupNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); + } + + /** + * List RedshiftCluster resources by subscription ID. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a RedshiftCluster list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync() { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List RedshiftCluster resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a RedshiftCluster list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), accept, + context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * List RedshiftCluster resources by subscription ID. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a RedshiftCluster list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>(() -> listSinglePageAsync(), + nextLink -> listBySubscriptionNextSinglePageAsync(nextLink)); + } + + /** + * List RedshiftCluster resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a RedshiftCluster list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(Context context) { + return new PagedFlux<>(() -> listSinglePageAsync(context), + nextLink -> listBySubscriptionNextSinglePageAsync(nextLink, context)); + } + + /** + * List RedshiftCluster resources by subscription ID. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a RedshiftCluster list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + return new PagedIterable<>(listAsync()); + } + + /** + * List RedshiftCluster resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a RedshiftCluster list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Context context) { + return new PagedIterable<>(listAsync(context)); + } + + /** + * List RedshiftCluster resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a RedshiftCluster list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List RedshiftCluster resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a RedshiftCluster list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * List RedshiftCluster resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a RedshiftCluster list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName) { + return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); + } + + /** + * List RedshiftCluster resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a RedshiftCluster list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName, Context context) { + return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName, context), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink, context)); + } + + /** + * List RedshiftCluster resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a RedshiftCluster list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName)); + } + + /** + * List RedshiftCluster resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a RedshiftCluster list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, context)); + } + + /** + * Get a RedshiftCluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of RedshiftCluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a RedshiftCluster along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync(String resourceGroupName, + String name) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.getByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get a RedshiftCluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of RedshiftCluster. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a RedshiftCluster along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync(String resourceGroupName, + String name, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.getByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, accept, context); + } + + /** + * Get a RedshiftCluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of RedshiftCluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a RedshiftCluster on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getByResourceGroupAsync(String resourceGroupName, String name) { + return getByResourceGroupWithResponseAsync(resourceGroupName, name) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Get a RedshiftCluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of RedshiftCluster. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a RedshiftCluster along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getByResourceGroupWithResponse(String resourceGroupName, String name, + Context context) { + return getByResourceGroupWithResponseAsync(resourceGroupName, name, context).block(); + } + + /** + * Get a RedshiftCluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of RedshiftCluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a RedshiftCluster. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public RedshiftClusterInner getByResourceGroup(String resourceGroupName, String name) { + return getByResourceGroupWithResponse(resourceGroupName, name, Context.NONE).getValue(); + } + + /** + * Create a RedshiftCluster. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of RedshiftCluster. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrReplaceWithResponseAsync(String resourceGroupName, String name, + RedshiftClusterInner resource) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (resource == null) { + return Mono.error(new IllegalArgumentException("Parameter resource is required and cannot be null.")); + } else { + resource.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.createOrReplace(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, resource, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Create a RedshiftCluster. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of RedshiftCluster. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrReplaceWithResponseAsync(String resourceGroupName, String name, + RedshiftClusterInner resource, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (resource == null) { + return Mono.error(new IllegalArgumentException("Parameter resource is required and cannot be null.")); + } else { + resource.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.createOrReplace(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, resource, accept, context); + } + + /** + * Create a RedshiftCluster. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of RedshiftCluster. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, RedshiftClusterInner> + beginCreateOrReplaceAsync(String resourceGroupName, String name, RedshiftClusterInner resource) { + Mono>> mono = createOrReplaceWithResponseAsync(resourceGroupName, name, resource); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + RedshiftClusterInner.class, RedshiftClusterInner.class, this.client.getContext()); + } + + /** + * Create a RedshiftCluster. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of RedshiftCluster. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, RedshiftClusterInner> beginCreateOrReplaceAsync( + String resourceGroupName, String name, RedshiftClusterInner resource, Context context) { + context = this.client.mergeContext(context); + Mono>> mono + = createOrReplaceWithResponseAsync(resourceGroupName, name, resource, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + RedshiftClusterInner.class, RedshiftClusterInner.class, context); + } + + /** + * Create a RedshiftCluster. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of RedshiftCluster. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, RedshiftClusterInner> + beginCreateOrReplace(String resourceGroupName, String name, RedshiftClusterInner resource) { + return this.beginCreateOrReplaceAsync(resourceGroupName, name, resource).getSyncPoller(); + } + + /** + * Create a RedshiftCluster. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of RedshiftCluster. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, RedshiftClusterInner> + beginCreateOrReplace(String resourceGroupName, String name, RedshiftClusterInner resource, Context context) { + return this.beginCreateOrReplaceAsync(resourceGroupName, name, resource, context).getSyncPoller(); + } + + /** + * Create a RedshiftCluster. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of RedshiftCluster. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrReplaceAsync(String resourceGroupName, String name, + RedshiftClusterInner resource) { + return beginCreateOrReplaceAsync(resourceGroupName, name, resource).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create a RedshiftCluster. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of RedshiftCluster. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrReplaceAsync(String resourceGroupName, String name, + RedshiftClusterInner resource, Context context) { + return beginCreateOrReplaceAsync(resourceGroupName, name, resource, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create a RedshiftCluster. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of RedshiftCluster. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public RedshiftClusterInner createOrReplace(String resourceGroupName, String name, RedshiftClusterInner resource) { + return createOrReplaceAsync(resourceGroupName, name, resource).block(); + } + + /** + * Create a RedshiftCluster. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of RedshiftCluster. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public RedshiftClusterInner createOrReplace(String resourceGroupName, String name, RedshiftClusterInner resource, + Context context) { + return createOrReplaceAsync(resourceGroupName, name, resource, context).block(); + } + + /** + * Update a RedshiftCluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of RedshiftCluster. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync(String resourceGroupName, String name, + RedshiftClusterTagsUpdate properties) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (properties == null) { + return Mono.error(new IllegalArgumentException("Parameter properties is required and cannot be null.")); + } else { + properties.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.update(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, properties, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Update a RedshiftCluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of RedshiftCluster. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync(String resourceGroupName, String name, + RedshiftClusterTagsUpdate properties, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (properties == null) { + return Mono.error(new IllegalArgumentException("Parameter properties is required and cannot be null.")); + } else { + properties.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.update(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, name, properties, accept, context); + } + + /** + * Update a RedshiftCluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of RedshiftCluster. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, RedshiftClusterInner> + beginUpdateAsync(String resourceGroupName, String name, RedshiftClusterTagsUpdate properties) { + Mono>> mono = updateWithResponseAsync(resourceGroupName, name, properties); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + RedshiftClusterInner.class, RedshiftClusterInner.class, this.client.getContext()); + } + + /** + * Update a RedshiftCluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of RedshiftCluster. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, RedshiftClusterInner> + beginUpdateAsync(String resourceGroupName, String name, RedshiftClusterTagsUpdate properties, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = updateWithResponseAsync(resourceGroupName, name, properties, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + RedshiftClusterInner.class, RedshiftClusterInner.class, context); + } + + /** + * Update a RedshiftCluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of RedshiftCluster. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, RedshiftClusterInner> beginUpdate(String resourceGroupName, + String name, RedshiftClusterTagsUpdate properties) { + return this.beginUpdateAsync(resourceGroupName, name, properties).getSyncPoller(); + } + + /** + * Update a RedshiftCluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of RedshiftCluster. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, RedshiftClusterInner> beginUpdate(String resourceGroupName, + String name, RedshiftClusterTagsUpdate properties, Context context) { + return this.beginUpdateAsync(resourceGroupName, name, properties, context).getSyncPoller(); + } + + /** + * Update a RedshiftCluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of RedshiftCluster. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync(String resourceGroupName, String name, + RedshiftClusterTagsUpdate properties) { + return beginUpdateAsync(resourceGroupName, name, properties).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Update a RedshiftCluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of RedshiftCluster. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync(String resourceGroupName, String name, + RedshiftClusterTagsUpdate properties, Context context) { + return beginUpdateAsync(resourceGroupName, name, properties, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Update a RedshiftCluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of RedshiftCluster. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public RedshiftClusterInner update(String resourceGroupName, String name, RedshiftClusterTagsUpdate properties) { + return updateAsync(resourceGroupName, name, properties).block(); + } + + /** + * Update a RedshiftCluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of RedshiftCluster. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public RedshiftClusterInner update(String resourceGroupName, String name, RedshiftClusterTagsUpdate properties, + Context context) { + return updateAsync(resourceGroupName, name, properties, context).block(); + } + + /** + * Delete a RedshiftCluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of RedshiftCluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync(String resourceGroupName, String name) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Delete a RedshiftCluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of RedshiftCluster. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync(String resourceGroupName, String name, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.delete(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, name, accept, context); + } + + /** + * Delete a RedshiftCluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of RedshiftCluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String name) { + Mono>> mono = deleteWithResponseAsync(resourceGroupName, name); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); + } + + /** + * Delete a RedshiftCluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of RedshiftCluster. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String name, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = deleteWithResponseAsync(resourceGroupName, name, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + context); + } + + /** + * Delete a RedshiftCluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of RedshiftCluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String name) { + return this.beginDeleteAsync(resourceGroupName, name).getSyncPoller(); + } + + /** + * Delete a RedshiftCluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of RedshiftCluster. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String name, Context context) { + return this.beginDeleteAsync(resourceGroupName, name, context).getSyncPoller(); + } + + /** + * Delete a RedshiftCluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of RedshiftCluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String name) { + return beginDeleteAsync(resourceGroupName, name).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete a RedshiftCluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of RedshiftCluster. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String name, Context context) { + return beginDeleteAsync(resourceGroupName, name, context).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete a RedshiftCluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of RedshiftCluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String name) { + deleteAsync(resourceGroupName, name).block(); + } + + /** + * Delete a RedshiftCluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of RedshiftCluster. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String name, Context context) { + deleteAsync(resourceGroupName, name, context).block(); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a RedshiftCluster list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listBySubscriptionNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a RedshiftCluster list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listBySubscriptionNextSinglePageAsync(String nextLink, + Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a RedshiftCluster list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a RedshiftCluster list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupNextSinglePageAsync(String nextLink, + Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/RedshiftClustersImpl.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/RedshiftClustersImpl.java new file mode 100644 index 000000000000..d4a661efb619 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/RedshiftClustersImpl.java @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.awsconnector.fluent.RedshiftClustersClient; +import com.azure.resourcemanager.awsconnector.fluent.models.RedshiftClusterInner; +import com.azure.resourcemanager.awsconnector.models.RedshiftCluster; +import com.azure.resourcemanager.awsconnector.models.RedshiftClusters; + +public final class RedshiftClustersImpl implements RedshiftClusters { + private static final ClientLogger LOGGER = new ClientLogger(RedshiftClustersImpl.class); + + private final RedshiftClustersClient innerClient; + + private final com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager; + + public RedshiftClustersImpl(RedshiftClustersClient innerClient, + com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return ResourceManagerUtils.mapPage(inner, inner1 -> new RedshiftClusterImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new RedshiftClusterImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName); + return ResourceManagerUtils.mapPage(inner, inner1 -> new RedshiftClusterImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + PagedIterable inner + = this.serviceClient().listByResourceGroup(resourceGroupName, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new RedshiftClusterImpl(inner1, this.manager())); + } + + public Response getByResourceGroupWithResponse(String resourceGroupName, String name, + Context context) { + Response inner + = this.serviceClient().getByResourceGroupWithResponse(resourceGroupName, name, context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new RedshiftClusterImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public RedshiftCluster getByResourceGroup(String resourceGroupName, String name) { + RedshiftClusterInner inner = this.serviceClient().getByResourceGroup(resourceGroupName, name); + if (inner != null) { + return new RedshiftClusterImpl(inner, this.manager()); + } else { + return null; + } + } + + public void deleteByResourceGroup(String resourceGroupName, String name) { + this.serviceClient().delete(resourceGroupName, name); + } + + public void delete(String resourceGroupName, String name, Context context) { + this.serviceClient().delete(resourceGroupName, name, context); + } + + public RedshiftCluster getById(String id) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String name = ResourceManagerUtils.getValueFromIdByName(id, "redshiftClusters"); + if (name == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'redshiftClusters'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, name, Context.NONE).getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String name = ResourceManagerUtils.getValueFromIdByName(id, "redshiftClusters"); + if (name == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'redshiftClusters'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, name, context); + } + + public void deleteById(String id) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String name = ResourceManagerUtils.getValueFromIdByName(id, "redshiftClusters"); + if (name == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'redshiftClusters'.", id))); + } + this.delete(resourceGroupName, name, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String name = ResourceManagerUtils.getValueFromIdByName(id, "redshiftClusters"); + if (name == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'redshiftClusters'.", id))); + } + this.delete(resourceGroupName, name, context); + } + + private RedshiftClustersClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.awsconnector.AwsconnectorManager manager() { + return this.serviceManager; + } + + public RedshiftClusterImpl define(String name) { + return new RedshiftClusterImpl(name, this.manager()); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/ResourceManagerUtils.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/ResourceManagerUtils.java new file mode 100644 index 000000000000..7a24671c0c94 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/ResourceManagerUtils.java @@ -0,0 +1,195 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.implementation; + +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.util.CoreUtils; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collections; +import java.util.Iterator; +import java.util.List; +import java.util.function.Function; +import java.util.stream.Collectors; +import java.util.stream.Stream; +import reactor.core.publisher.Flux; + +final class ResourceManagerUtils { + private ResourceManagerUtils() { + } + + static String getValueFromIdByName(String id, String name) { + if (id == null) { + return null; + } + Iterator itr = Arrays.stream(id.split("/")).iterator(); + while (itr.hasNext()) { + String part = itr.next(); + if (part != null && !part.trim().isEmpty()) { + if (part.equalsIgnoreCase(name)) { + if (itr.hasNext()) { + return itr.next(); + } else { + return null; + } + } + } + } + return null; + } + + static String getValueFromIdByParameterName(String id, String pathTemplate, String parameterName) { + if (id == null || pathTemplate == null) { + return null; + } + String parameterNameParentheses = "{" + parameterName + "}"; + List idSegmentsReverted = Arrays.asList(id.split("/")); + List pathSegments = Arrays.asList(pathTemplate.split("/")); + Collections.reverse(idSegmentsReverted); + Iterator idItrReverted = idSegmentsReverted.iterator(); + int pathIndex = pathSegments.size(); + while (idItrReverted.hasNext() && pathIndex > 0) { + String idSegment = idItrReverted.next(); + String pathSegment = pathSegments.get(--pathIndex); + if (!CoreUtils.isNullOrEmpty(idSegment) && !CoreUtils.isNullOrEmpty(pathSegment)) { + if (pathSegment.equalsIgnoreCase(parameterNameParentheses)) { + if (pathIndex == 0 || (pathIndex == 1 && pathSegments.get(0).isEmpty())) { + List segments = new ArrayList<>(); + segments.add(idSegment); + idItrReverted.forEachRemaining(segments::add); + Collections.reverse(segments); + if (!segments.isEmpty() && segments.get(0).isEmpty()) { + segments.remove(0); + } + return String.join("/", segments); + } else { + return idSegment; + } + } + } + } + return null; + } + + static PagedIterable mapPage(PagedIterable pageIterable, Function mapper) { + return new PagedIterableImpl<>(pageIterable, mapper); + } + + private static final class PagedIterableImpl extends PagedIterable { + + private final PagedIterable pagedIterable; + private final Function mapper; + private final Function, PagedResponse> pageMapper; + + private PagedIterableImpl(PagedIterable pagedIterable, Function mapper) { + super(PagedFlux.create(() -> (continuationToken, pageSize) -> Flux + .fromStream(pagedIterable.streamByPage().map(getPageMapper(mapper))))); + this.pagedIterable = pagedIterable; + this.mapper = mapper; + this.pageMapper = getPageMapper(mapper); + } + + private static Function, PagedResponse> getPageMapper(Function mapper) { + return page -> new PagedResponseBase(page.getRequest(), page.getStatusCode(), page.getHeaders(), + page.getElements().stream().map(mapper).collect(Collectors.toList()), page.getContinuationToken(), + null); + } + + @Override + public Stream stream() { + return pagedIterable.stream().map(mapper); + } + + @Override + public Stream> streamByPage() { + return pagedIterable.streamByPage().map(pageMapper); + } + + @Override + public Stream> streamByPage(String continuationToken) { + return pagedIterable.streamByPage(continuationToken).map(pageMapper); + } + + @Override + public Stream> streamByPage(int preferredPageSize) { + return pagedIterable.streamByPage(preferredPageSize).map(pageMapper); + } + + @Override + public Stream> streamByPage(String continuationToken, int preferredPageSize) { + return pagedIterable.streamByPage(continuationToken, preferredPageSize).map(pageMapper); + } + + @Override + public Iterator iterator() { + return new IteratorImpl<>(pagedIterable.iterator(), mapper); + } + + @Override + public Iterable> iterableByPage() { + return new IterableImpl<>(pagedIterable.iterableByPage(), pageMapper); + } + + @Override + public Iterable> iterableByPage(String continuationToken) { + return new IterableImpl<>(pagedIterable.iterableByPage(continuationToken), pageMapper); + } + + @Override + public Iterable> iterableByPage(int preferredPageSize) { + return new IterableImpl<>(pagedIterable.iterableByPage(preferredPageSize), pageMapper); + } + + @Override + public Iterable> iterableByPage(String continuationToken, int preferredPageSize) { + return new IterableImpl<>(pagedIterable.iterableByPage(continuationToken, preferredPageSize), pageMapper); + } + } + + private static final class IteratorImpl implements Iterator { + + private final Iterator iterator; + private final Function mapper; + + private IteratorImpl(Iterator iterator, Function mapper) { + this.iterator = iterator; + this.mapper = mapper; + } + + @Override + public boolean hasNext() { + return iterator.hasNext(); + } + + @Override + public S next() { + return mapper.apply(iterator.next()); + } + + @Override + public void remove() { + iterator.remove(); + } + } + + private static final class IterableImpl implements Iterable { + + private final Iterable iterable; + private final Function mapper; + + private IterableImpl(Iterable iterable, Function mapper) { + this.iterable = iterable; + this.mapper = mapper; + } + + @Override + public Iterator iterator() { + return new IteratorImpl<>(iterable.iterator(), mapper); + } + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/Route53DomainsDomainSummariesClientImpl.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/Route53DomainsDomainSummariesClientImpl.java new file mode 100644 index 000000000000..3ad75518d857 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/Route53DomainsDomainSummariesClientImpl.java @@ -0,0 +1,1299 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.Patch; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.awsconnector.fluent.Route53DomainsDomainSummariesClient; +import com.azure.resourcemanager.awsconnector.fluent.models.Route53DomainsDomainSummaryInner; +import com.azure.resourcemanager.awsconnector.models.Route53DomainsDomainSummaryListResult; +import com.azure.resourcemanager.awsconnector.models.Route53DomainsDomainSummaryTagsUpdate; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in Route53DomainsDomainSummariesClient. + */ +public final class Route53DomainsDomainSummariesClientImpl implements Route53DomainsDomainSummariesClient { + /** + * The proxy service used to perform REST calls. + */ + private final Route53DomainsDomainSummariesService service; + + /** + * The service client containing this operation class. + */ + private final MicrosoftAwsConnectorImpl client; + + /** + * Initializes an instance of Route53DomainsDomainSummariesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + Route53DomainsDomainSummariesClientImpl(MicrosoftAwsConnectorImpl client) { + this.service = RestProxy.create(Route53DomainsDomainSummariesService.class, client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for MicrosoftAwsConnectorRoute53DomainsDomainSummaries to be used by the + * proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "MicrosoftAwsConnecto") + public interface Route53DomainsDomainSummariesService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.AwsConnector/route53DomainsDomainSummaries") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/route53DomainsDomainSummaries") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroup(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/route53DomainsDomainSummaries/{name}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getByResourceGroup(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("name") String name, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/route53DomainsDomainSummaries/{name}") + @ExpectedResponses({ 200, 201 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrReplace(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("name") String name, + @BodyParam("application/json") Route53DomainsDomainSummaryInner resource, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/route53DomainsDomainSummaries/{name}") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> update(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("name") String name, + @BodyParam("application/json") Route53DomainsDomainSummaryTagsUpdate properties, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/route53DomainsDomainSummaries/{name}") + @ExpectedResponses({ 202, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("name") String name, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listBySubscriptionNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroupNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); + } + + /** + * List Route53DomainsDomainSummary resources by subscription ID. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Route53DomainsDomainSummary list operation along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync() { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List Route53DomainsDomainSummary resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Route53DomainsDomainSummary list operation along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), accept, + context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * List Route53DomainsDomainSummary resources by subscription ID. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Route53DomainsDomainSummary list operation as paginated response with + * {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>(() -> listSinglePageAsync(), + nextLink -> listBySubscriptionNextSinglePageAsync(nextLink)); + } + + /** + * List Route53DomainsDomainSummary resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Route53DomainsDomainSummary list operation as paginated response with + * {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(Context context) { + return new PagedFlux<>(() -> listSinglePageAsync(context), + nextLink -> listBySubscriptionNextSinglePageAsync(nextLink, context)); + } + + /** + * List Route53DomainsDomainSummary resources by subscription ID. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Route53DomainsDomainSummary list operation as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + return new PagedIterable<>(listAsync()); + } + + /** + * List Route53DomainsDomainSummary resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Route53DomainsDomainSummary list operation as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Context context) { + return new PagedIterable<>(listAsync(context)); + } + + /** + * List Route53DomainsDomainSummary resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Route53DomainsDomainSummary list operation along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> + listByResourceGroupSinglePageAsync(String resourceGroupName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List Route53DomainsDomainSummary resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Route53DomainsDomainSummary list operation along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> + listByResourceGroupSinglePageAsync(String resourceGroupName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * List Route53DomainsDomainSummary resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Route53DomainsDomainSummary list operation as paginated response with + * {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName) { + return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); + } + + /** + * List Route53DomainsDomainSummary resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Route53DomainsDomainSummary list operation as paginated response with + * {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName, + Context context) { + return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName, context), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink, context)); + } + + /** + * List Route53DomainsDomainSummary resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Route53DomainsDomainSummary list operation as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName)); + } + + /** + * List Route53DomainsDomainSummary resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Route53DomainsDomainSummary list operation as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName, + Context context) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, context)); + } + + /** + * Get a Route53DomainsDomainSummary. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Route53DomainsDomainSummary. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Route53DomainsDomainSummary along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> + getByResourceGroupWithResponseAsync(String resourceGroupName, String name) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.getByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get a Route53DomainsDomainSummary. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Route53DomainsDomainSummary. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Route53DomainsDomainSummary along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> + getByResourceGroupWithResponseAsync(String resourceGroupName, String name, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.getByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, accept, context); + } + + /** + * Get a Route53DomainsDomainSummary. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Route53DomainsDomainSummary. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Route53DomainsDomainSummary on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getByResourceGroupAsync(String resourceGroupName, String name) { + return getByResourceGroupWithResponseAsync(resourceGroupName, name) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Get a Route53DomainsDomainSummary. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Route53DomainsDomainSummary. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Route53DomainsDomainSummary along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getByResourceGroupWithResponse(String resourceGroupName, + String name, Context context) { + return getByResourceGroupWithResponseAsync(resourceGroupName, name, context).block(); + } + + /** + * Get a Route53DomainsDomainSummary. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Route53DomainsDomainSummary. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Route53DomainsDomainSummary. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Route53DomainsDomainSummaryInner getByResourceGroup(String resourceGroupName, String name) { + return getByResourceGroupWithResponse(resourceGroupName, name, Context.NONE).getValue(); + } + + /** + * Create a Route53DomainsDomainSummary. Please note that end user resource creation is currently restricted, but it + * will be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Route53DomainsDomainSummary. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrReplaceWithResponseAsync(String resourceGroupName, String name, + Route53DomainsDomainSummaryInner resource) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (resource == null) { + return Mono.error(new IllegalArgumentException("Parameter resource is required and cannot be null.")); + } else { + resource.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.createOrReplace(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, resource, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Create a Route53DomainsDomainSummary. Please note that end user resource creation is currently restricted, but it + * will be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Route53DomainsDomainSummary. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrReplaceWithResponseAsync(String resourceGroupName, String name, + Route53DomainsDomainSummaryInner resource, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (resource == null) { + return Mono.error(new IllegalArgumentException("Parameter resource is required and cannot be null.")); + } else { + resource.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.createOrReplace(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, resource, accept, context); + } + + /** + * Create a Route53DomainsDomainSummary. Please note that end user resource creation is currently restricted, but it + * will be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Route53DomainsDomainSummary. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Route53DomainsDomainSummaryInner> + beginCreateOrReplaceAsync(String resourceGroupName, String name, Route53DomainsDomainSummaryInner resource) { + Mono>> mono = createOrReplaceWithResponseAsync(resourceGroupName, name, resource); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), Route53DomainsDomainSummaryInner.class, + Route53DomainsDomainSummaryInner.class, this.client.getContext()); + } + + /** + * Create a Route53DomainsDomainSummary. Please note that end user resource creation is currently restricted, but it + * will be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Route53DomainsDomainSummary. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Route53DomainsDomainSummaryInner> + beginCreateOrReplaceAsync(String resourceGroupName, String name, Route53DomainsDomainSummaryInner resource, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono + = createOrReplaceWithResponseAsync(resourceGroupName, name, resource, context); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), Route53DomainsDomainSummaryInner.class, + Route53DomainsDomainSummaryInner.class, context); + } + + /** + * Create a Route53DomainsDomainSummary. Please note that end user resource creation is currently restricted, but it + * will be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Route53DomainsDomainSummary. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Route53DomainsDomainSummaryInner> + beginCreateOrReplace(String resourceGroupName, String name, Route53DomainsDomainSummaryInner resource) { + return this.beginCreateOrReplaceAsync(resourceGroupName, name, resource).getSyncPoller(); + } + + /** + * Create a Route53DomainsDomainSummary. Please note that end user resource creation is currently restricted, but it + * will be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Route53DomainsDomainSummary. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Route53DomainsDomainSummaryInner> + beginCreateOrReplace(String resourceGroupName, String name, Route53DomainsDomainSummaryInner resource, + Context context) { + return this.beginCreateOrReplaceAsync(resourceGroupName, name, resource, context).getSyncPoller(); + } + + /** + * Create a Route53DomainsDomainSummary. Please note that end user resource creation is currently restricted, but it + * will be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Route53DomainsDomainSummary. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrReplaceAsync(String resourceGroupName, String name, + Route53DomainsDomainSummaryInner resource) { + return beginCreateOrReplaceAsync(resourceGroupName, name, resource).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create a Route53DomainsDomainSummary. Please note that end user resource creation is currently restricted, but it + * will be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Route53DomainsDomainSummary. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrReplaceAsync(String resourceGroupName, String name, + Route53DomainsDomainSummaryInner resource, Context context) { + return beginCreateOrReplaceAsync(resourceGroupName, name, resource, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create a Route53DomainsDomainSummary. Please note that end user resource creation is currently restricted, but it + * will be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Route53DomainsDomainSummary. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Route53DomainsDomainSummaryInner createOrReplace(String resourceGroupName, String name, + Route53DomainsDomainSummaryInner resource) { + return createOrReplaceAsync(resourceGroupName, name, resource).block(); + } + + /** + * Create a Route53DomainsDomainSummary. Please note that end user resource creation is currently restricted, but it + * will be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Route53DomainsDomainSummary. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Route53DomainsDomainSummaryInner createOrReplace(String resourceGroupName, String name, + Route53DomainsDomainSummaryInner resource, Context context) { + return createOrReplaceAsync(resourceGroupName, name, resource, context).block(); + } + + /** + * Update a Route53DomainsDomainSummary. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Route53DomainsDomainSummary. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync(String resourceGroupName, String name, + Route53DomainsDomainSummaryTagsUpdate properties) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (properties == null) { + return Mono.error(new IllegalArgumentException("Parameter properties is required and cannot be null.")); + } else { + properties.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.update(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, properties, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Update a Route53DomainsDomainSummary. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Route53DomainsDomainSummary. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync(String resourceGroupName, String name, + Route53DomainsDomainSummaryTagsUpdate properties, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (properties == null) { + return Mono.error(new IllegalArgumentException("Parameter properties is required and cannot be null.")); + } else { + properties.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.update(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, name, properties, accept, context); + } + + /** + * Update a Route53DomainsDomainSummary. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Route53DomainsDomainSummary. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Route53DomainsDomainSummaryInner> + beginUpdateAsync(String resourceGroupName, String name, Route53DomainsDomainSummaryTagsUpdate properties) { + Mono>> mono = updateWithResponseAsync(resourceGroupName, name, properties); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), Route53DomainsDomainSummaryInner.class, + Route53DomainsDomainSummaryInner.class, this.client.getContext()); + } + + /** + * Update a Route53DomainsDomainSummary. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Route53DomainsDomainSummary. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Route53DomainsDomainSummaryInner> beginUpdateAsync( + String resourceGroupName, String name, Route53DomainsDomainSummaryTagsUpdate properties, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = updateWithResponseAsync(resourceGroupName, name, properties, context); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), Route53DomainsDomainSummaryInner.class, + Route53DomainsDomainSummaryInner.class, context); + } + + /** + * Update a Route53DomainsDomainSummary. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Route53DomainsDomainSummary. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Route53DomainsDomainSummaryInner> + beginUpdate(String resourceGroupName, String name, Route53DomainsDomainSummaryTagsUpdate properties) { + return this.beginUpdateAsync(resourceGroupName, name, properties).getSyncPoller(); + } + + /** + * Update a Route53DomainsDomainSummary. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Route53DomainsDomainSummary. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Route53DomainsDomainSummaryInner> beginUpdate( + String resourceGroupName, String name, Route53DomainsDomainSummaryTagsUpdate properties, Context context) { + return this.beginUpdateAsync(resourceGroupName, name, properties, context).getSyncPoller(); + } + + /** + * Update a Route53DomainsDomainSummary. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Route53DomainsDomainSummary. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync(String resourceGroupName, String name, + Route53DomainsDomainSummaryTagsUpdate properties) { + return beginUpdateAsync(resourceGroupName, name, properties).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Update a Route53DomainsDomainSummary. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Route53DomainsDomainSummary. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync(String resourceGroupName, String name, + Route53DomainsDomainSummaryTagsUpdate properties, Context context) { + return beginUpdateAsync(resourceGroupName, name, properties, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Update a Route53DomainsDomainSummary. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Route53DomainsDomainSummary. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Route53DomainsDomainSummaryInner update(String resourceGroupName, String name, + Route53DomainsDomainSummaryTagsUpdate properties) { + return updateAsync(resourceGroupName, name, properties).block(); + } + + /** + * Update a Route53DomainsDomainSummary. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Route53DomainsDomainSummary. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Route53DomainsDomainSummaryInner update(String resourceGroupName, String name, + Route53DomainsDomainSummaryTagsUpdate properties, Context context) { + return updateAsync(resourceGroupName, name, properties, context).block(); + } + + /** + * Delete a Route53DomainsDomainSummary. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Route53DomainsDomainSummary. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync(String resourceGroupName, String name) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Delete a Route53DomainsDomainSummary. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Route53DomainsDomainSummary. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync(String resourceGroupName, String name, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.delete(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, name, accept, context); + } + + /** + * Delete a Route53DomainsDomainSummary. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Route53DomainsDomainSummary. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String name) { + Mono>> mono = deleteWithResponseAsync(resourceGroupName, name); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); + } + + /** + * Delete a Route53DomainsDomainSummary. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Route53DomainsDomainSummary. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String name, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = deleteWithResponseAsync(resourceGroupName, name, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + context); + } + + /** + * Delete a Route53DomainsDomainSummary. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Route53DomainsDomainSummary. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String name) { + return this.beginDeleteAsync(resourceGroupName, name).getSyncPoller(); + } + + /** + * Delete a Route53DomainsDomainSummary. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Route53DomainsDomainSummary. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String name, Context context) { + return this.beginDeleteAsync(resourceGroupName, name, context).getSyncPoller(); + } + + /** + * Delete a Route53DomainsDomainSummary. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Route53DomainsDomainSummary. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String name) { + return beginDeleteAsync(resourceGroupName, name).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete a Route53DomainsDomainSummary. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Route53DomainsDomainSummary. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String name, Context context) { + return beginDeleteAsync(resourceGroupName, name, context).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete a Route53DomainsDomainSummary. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Route53DomainsDomainSummary. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String name) { + deleteAsync(resourceGroupName, name).block(); + } + + /** + * Delete a Route53DomainsDomainSummary. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Route53DomainsDomainSummary. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String name, Context context) { + deleteAsync(resourceGroupName, name, context).block(); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Route53DomainsDomainSummary list operation along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> + listBySubscriptionNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Route53DomainsDomainSummary list operation along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listBySubscriptionNextSinglePageAsync(String nextLink, + Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Route53DomainsDomainSummary list operation along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> + listByResourceGroupNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Route53DomainsDomainSummary list operation along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> + listByResourceGroupNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/Route53DomainsDomainSummariesImpl.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/Route53DomainsDomainSummariesImpl.java new file mode 100644 index 000000000000..98b12d52c7c6 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/Route53DomainsDomainSummariesImpl.java @@ -0,0 +1,152 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.awsconnector.fluent.Route53DomainsDomainSummariesClient; +import com.azure.resourcemanager.awsconnector.fluent.models.Route53DomainsDomainSummaryInner; +import com.azure.resourcemanager.awsconnector.models.Route53DomainsDomainSummaries; +import com.azure.resourcemanager.awsconnector.models.Route53DomainsDomainSummary; + +public final class Route53DomainsDomainSummariesImpl implements Route53DomainsDomainSummaries { + private static final ClientLogger LOGGER = new ClientLogger(Route53DomainsDomainSummariesImpl.class); + + private final Route53DomainsDomainSummariesClient innerClient; + + private final com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager; + + public Route53DomainsDomainSummariesImpl(Route53DomainsDomainSummariesClient innerClient, + com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return ResourceManagerUtils.mapPage(inner, + inner1 -> new Route53DomainsDomainSummaryImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return ResourceManagerUtils.mapPage(inner, + inner1 -> new Route53DomainsDomainSummaryImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName) { + PagedIterable inner + = this.serviceClient().listByResourceGroup(resourceGroupName); + return ResourceManagerUtils.mapPage(inner, + inner1 -> new Route53DomainsDomainSummaryImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + PagedIterable inner + = this.serviceClient().listByResourceGroup(resourceGroupName, context); + return ResourceManagerUtils.mapPage(inner, + inner1 -> new Route53DomainsDomainSummaryImpl(inner1, this.manager())); + } + + public Response getByResourceGroupWithResponse(String resourceGroupName, String name, + Context context) { + Response inner + = this.serviceClient().getByResourceGroupWithResponse(resourceGroupName, name, context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new Route53DomainsDomainSummaryImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public Route53DomainsDomainSummary getByResourceGroup(String resourceGroupName, String name) { + Route53DomainsDomainSummaryInner inner = this.serviceClient().getByResourceGroup(resourceGroupName, name); + if (inner != null) { + return new Route53DomainsDomainSummaryImpl(inner, this.manager()); + } else { + return null; + } + } + + public void deleteByResourceGroup(String resourceGroupName, String name) { + this.serviceClient().delete(resourceGroupName, name); + } + + public void delete(String resourceGroupName, String name, Context context) { + this.serviceClient().delete(resourceGroupName, name, context); + } + + public Route53DomainsDomainSummary getById(String id) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String name = ResourceManagerUtils.getValueFromIdByName(id, "route53DomainsDomainSummaries"); + if (name == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException(String.format( + "The resource ID '%s' is not valid. Missing path segment 'route53DomainsDomainSummaries'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, name, Context.NONE).getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String name = ResourceManagerUtils.getValueFromIdByName(id, "route53DomainsDomainSummaries"); + if (name == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException(String.format( + "The resource ID '%s' is not valid. Missing path segment 'route53DomainsDomainSummaries'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, name, context); + } + + public void deleteById(String id) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String name = ResourceManagerUtils.getValueFromIdByName(id, "route53DomainsDomainSummaries"); + if (name == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException(String.format( + "The resource ID '%s' is not valid. Missing path segment 'route53DomainsDomainSummaries'.", id))); + } + this.delete(resourceGroupName, name, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String name = ResourceManagerUtils.getValueFromIdByName(id, "route53DomainsDomainSummaries"); + if (name == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException(String.format( + "The resource ID '%s' is not valid. Missing path segment 'route53DomainsDomainSummaries'.", id))); + } + this.delete(resourceGroupName, name, context); + } + + private Route53DomainsDomainSummariesClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.awsconnector.AwsconnectorManager manager() { + return this.serviceManager; + } + + public Route53DomainsDomainSummaryImpl define(String name) { + return new Route53DomainsDomainSummaryImpl(name, this.manager()); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/Route53DomainsDomainSummaryImpl.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/Route53DomainsDomainSummaryImpl.java new file mode 100644 index 000000000000..313697d727cf --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/Route53DomainsDomainSummaryImpl.java @@ -0,0 +1,179 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.implementation; + +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.awsconnector.fluent.models.Route53DomainsDomainSummaryInner; +import com.azure.resourcemanager.awsconnector.models.Route53DomainsDomainSummary; +import com.azure.resourcemanager.awsconnector.models.Route53DomainsDomainSummaryProperties; +import com.azure.resourcemanager.awsconnector.models.Route53DomainsDomainSummaryTagsUpdate; +import java.util.Collections; +import java.util.Map; + +public final class Route53DomainsDomainSummaryImpl + implements Route53DomainsDomainSummary, Route53DomainsDomainSummary.Definition, Route53DomainsDomainSummary.Update { + private Route53DomainsDomainSummaryInner innerObject; + + private final com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public String location() { + return this.innerModel().location(); + } + + public Map tags() { + Map inner = this.innerModel().tags(); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } + } + + public Route53DomainsDomainSummaryProperties properties() { + return this.innerModel().properties(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public String resourceGroupName() { + return resourceGroupName; + } + + public Route53DomainsDomainSummaryInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.awsconnector.AwsconnectorManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String name; + + private Route53DomainsDomainSummaryTagsUpdate updateProperties; + + public Route53DomainsDomainSummaryImpl withExistingResourceGroup(String resourceGroupName) { + this.resourceGroupName = resourceGroupName; + return this; + } + + public Route53DomainsDomainSummary create() { + this.innerObject = serviceManager.serviceClient() + .getRoute53DomainsDomainSummaries() + .createOrReplace(resourceGroupName, name, this.innerModel(), Context.NONE); + return this; + } + + public Route53DomainsDomainSummary create(Context context) { + this.innerObject = serviceManager.serviceClient() + .getRoute53DomainsDomainSummaries() + .createOrReplace(resourceGroupName, name, this.innerModel(), context); + return this; + } + + Route53DomainsDomainSummaryImpl(String name, + com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager) { + this.innerObject = new Route53DomainsDomainSummaryInner(); + this.serviceManager = serviceManager; + this.name = name; + } + + public Route53DomainsDomainSummaryImpl update() { + this.updateProperties = new Route53DomainsDomainSummaryTagsUpdate(); + return this; + } + + public Route53DomainsDomainSummary apply() { + this.innerObject = serviceManager.serviceClient() + .getRoute53DomainsDomainSummaries() + .update(resourceGroupName, name, updateProperties, Context.NONE); + return this; + } + + public Route53DomainsDomainSummary apply(Context context) { + this.innerObject = serviceManager.serviceClient() + .getRoute53DomainsDomainSummaries() + .update(resourceGroupName, name, updateProperties, context); + return this; + } + + Route53DomainsDomainSummaryImpl(Route53DomainsDomainSummaryInner innerObject, + com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.name = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "route53DomainsDomainSummaries"); + } + + public Route53DomainsDomainSummary refresh() { + this.innerObject = serviceManager.serviceClient() + .getRoute53DomainsDomainSummaries() + .getByResourceGroupWithResponse(resourceGroupName, name, Context.NONE) + .getValue(); + return this; + } + + public Route53DomainsDomainSummary refresh(Context context) { + this.innerObject = serviceManager.serviceClient() + .getRoute53DomainsDomainSummaries() + .getByResourceGroupWithResponse(resourceGroupName, name, context) + .getValue(); + return this; + } + + public Route53DomainsDomainSummaryImpl withRegion(Region location) { + this.innerModel().withLocation(location.toString()); + return this; + } + + public Route53DomainsDomainSummaryImpl withRegion(String location) { + this.innerModel().withLocation(location); + return this; + } + + public Route53DomainsDomainSummaryImpl withTags(Map tags) { + if (isInCreateMode()) { + this.innerModel().withTags(tags); + return this; + } else { + this.updateProperties.withTags(tags); + return this; + } + } + + public Route53DomainsDomainSummaryImpl withProperties(Route53DomainsDomainSummaryProperties properties) { + this.innerModel().withProperties(properties); + return this; + } + + private boolean isInCreateMode() { + return this.innerModel().id() == null; + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/Route53HostedZoneImpl.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/Route53HostedZoneImpl.java new file mode 100644 index 000000000000..d00ccfaf04d6 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/Route53HostedZoneImpl.java @@ -0,0 +1,178 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.implementation; + +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.awsconnector.fluent.models.Route53HostedZoneInner; +import com.azure.resourcemanager.awsconnector.models.Route53HostedZone; +import com.azure.resourcemanager.awsconnector.models.Route53HostedZoneProperties; +import com.azure.resourcemanager.awsconnector.models.Route53HostedZoneTagsUpdate; +import java.util.Collections; +import java.util.Map; + +public final class Route53HostedZoneImpl + implements Route53HostedZone, Route53HostedZone.Definition, Route53HostedZone.Update { + private Route53HostedZoneInner innerObject; + + private final com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public String location() { + return this.innerModel().location(); + } + + public Map tags() { + Map inner = this.innerModel().tags(); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } + } + + public Route53HostedZoneProperties properties() { + return this.innerModel().properties(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public String resourceGroupName() { + return resourceGroupName; + } + + public Route53HostedZoneInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.awsconnector.AwsconnectorManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String name; + + private Route53HostedZoneTagsUpdate updateProperties; + + public Route53HostedZoneImpl withExistingResourceGroup(String resourceGroupName) { + this.resourceGroupName = resourceGroupName; + return this; + } + + public Route53HostedZone create() { + this.innerObject = serviceManager.serviceClient() + .getRoute53HostedZones() + .createOrReplace(resourceGroupName, name, this.innerModel(), Context.NONE); + return this; + } + + public Route53HostedZone create(Context context) { + this.innerObject = serviceManager.serviceClient() + .getRoute53HostedZones() + .createOrReplace(resourceGroupName, name, this.innerModel(), context); + return this; + } + + Route53HostedZoneImpl(String name, com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager) { + this.innerObject = new Route53HostedZoneInner(); + this.serviceManager = serviceManager; + this.name = name; + } + + public Route53HostedZoneImpl update() { + this.updateProperties = new Route53HostedZoneTagsUpdate(); + return this; + } + + public Route53HostedZone apply() { + this.innerObject = serviceManager.serviceClient() + .getRoute53HostedZones() + .update(resourceGroupName, name, updateProperties, Context.NONE); + return this; + } + + public Route53HostedZone apply(Context context) { + this.innerObject = serviceManager.serviceClient() + .getRoute53HostedZones() + .update(resourceGroupName, name, updateProperties, context); + return this; + } + + Route53HostedZoneImpl(Route53HostedZoneInner innerObject, + com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.name = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "route53HostedZones"); + } + + public Route53HostedZone refresh() { + this.innerObject = serviceManager.serviceClient() + .getRoute53HostedZones() + .getByResourceGroupWithResponse(resourceGroupName, name, Context.NONE) + .getValue(); + return this; + } + + public Route53HostedZone refresh(Context context) { + this.innerObject = serviceManager.serviceClient() + .getRoute53HostedZones() + .getByResourceGroupWithResponse(resourceGroupName, name, context) + .getValue(); + return this; + } + + public Route53HostedZoneImpl withRegion(Region location) { + this.innerModel().withLocation(location.toString()); + return this; + } + + public Route53HostedZoneImpl withRegion(String location) { + this.innerModel().withLocation(location); + return this; + } + + public Route53HostedZoneImpl withTags(Map tags) { + if (isInCreateMode()) { + this.innerModel().withTags(tags); + return this; + } else { + this.updateProperties.withTags(tags); + return this; + } + } + + public Route53HostedZoneImpl withProperties(Route53HostedZoneProperties properties) { + this.innerModel().withProperties(properties); + return this; + } + + private boolean isInCreateMode() { + return this.innerModel().id() == null; + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/Route53HostedZonesClientImpl.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/Route53HostedZonesClientImpl.java new file mode 100644 index 000000000000..9201cff6a173 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/Route53HostedZonesClientImpl.java @@ -0,0 +1,1282 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.Patch; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.awsconnector.fluent.Route53HostedZonesClient; +import com.azure.resourcemanager.awsconnector.fluent.models.Route53HostedZoneInner; +import com.azure.resourcemanager.awsconnector.models.Route53HostedZoneListResult; +import com.azure.resourcemanager.awsconnector.models.Route53HostedZoneTagsUpdate; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in Route53HostedZonesClient. + */ +public final class Route53HostedZonesClientImpl implements Route53HostedZonesClient { + /** + * The proxy service used to perform REST calls. + */ + private final Route53HostedZonesService service; + + /** + * The service client containing this operation class. + */ + private final MicrosoftAwsConnectorImpl client; + + /** + * Initializes an instance of Route53HostedZonesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + Route53HostedZonesClientImpl(MicrosoftAwsConnectorImpl client) { + this.service = RestProxy.create(Route53HostedZonesService.class, client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for MicrosoftAwsConnectorRoute53HostedZones to be used by the proxy + * service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "MicrosoftAwsConnecto") + public interface Route53HostedZonesService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.AwsConnector/route53HostedZones") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/route53HostedZones") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroup(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/route53HostedZones/{name}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getByResourceGroup(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("name") String name, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/route53HostedZones/{name}") + @ExpectedResponses({ 200, 201 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrReplace(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("name") String name, + @BodyParam("application/json") Route53HostedZoneInner resource, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/route53HostedZones/{name}") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> update(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("name") String name, + @BodyParam("application/json") Route53HostedZoneTagsUpdate properties, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/route53HostedZones/{name}") + @ExpectedResponses({ 202, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("name") String name, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listBySubscriptionNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroupNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); + } + + /** + * List Route53HostedZone resources by subscription ID. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Route53HostedZone list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync() { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List Route53HostedZone resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Route53HostedZone list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), accept, + context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * List Route53HostedZone resources by subscription ID. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Route53HostedZone list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>(() -> listSinglePageAsync(), + nextLink -> listBySubscriptionNextSinglePageAsync(nextLink)); + } + + /** + * List Route53HostedZone resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Route53HostedZone list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(Context context) { + return new PagedFlux<>(() -> listSinglePageAsync(context), + nextLink -> listBySubscriptionNextSinglePageAsync(nextLink, context)); + } + + /** + * List Route53HostedZone resources by subscription ID. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Route53HostedZone list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + return new PagedIterable<>(listAsync()); + } + + /** + * List Route53HostedZone resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Route53HostedZone list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Context context) { + return new PagedIterable<>(listAsync(context)); + } + + /** + * List Route53HostedZone resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Route53HostedZone list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List Route53HostedZone resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Route53HostedZone list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * List Route53HostedZone resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Route53HostedZone list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName) { + return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); + } + + /** + * List Route53HostedZone resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Route53HostedZone list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName, Context context) { + return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName, context), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink, context)); + } + + /** + * List Route53HostedZone resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Route53HostedZone list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName)); + } + + /** + * List Route53HostedZone resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Route53HostedZone list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, context)); + } + + /** + * Get a Route53HostedZone. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Route53HostedZone. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Route53HostedZone along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync(String resourceGroupName, + String name) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.getByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get a Route53HostedZone. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Route53HostedZone. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Route53HostedZone along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync(String resourceGroupName, + String name, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.getByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, accept, context); + } + + /** + * Get a Route53HostedZone. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Route53HostedZone. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Route53HostedZone on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getByResourceGroupAsync(String resourceGroupName, String name) { + return getByResourceGroupWithResponseAsync(resourceGroupName, name) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Get a Route53HostedZone. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Route53HostedZone. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Route53HostedZone along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getByResourceGroupWithResponse(String resourceGroupName, String name, + Context context) { + return getByResourceGroupWithResponseAsync(resourceGroupName, name, context).block(); + } + + /** + * Get a Route53HostedZone. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Route53HostedZone. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Route53HostedZone. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Route53HostedZoneInner getByResourceGroup(String resourceGroupName, String name) { + return getByResourceGroupWithResponse(resourceGroupName, name, Context.NONE).getValue(); + } + + /** + * Create a Route53HostedZone. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Route53HostedZone. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrReplaceWithResponseAsync(String resourceGroupName, String name, + Route53HostedZoneInner resource) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (resource == null) { + return Mono.error(new IllegalArgumentException("Parameter resource is required and cannot be null.")); + } else { + resource.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.createOrReplace(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, resource, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Create a Route53HostedZone. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Route53HostedZone. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrReplaceWithResponseAsync(String resourceGroupName, String name, + Route53HostedZoneInner resource, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (resource == null) { + return Mono.error(new IllegalArgumentException("Parameter resource is required and cannot be null.")); + } else { + resource.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.createOrReplace(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, resource, accept, context); + } + + /** + * Create a Route53HostedZone. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Route53HostedZone. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Route53HostedZoneInner> + beginCreateOrReplaceAsync(String resourceGroupName, String name, Route53HostedZoneInner resource) { + Mono>> mono = createOrReplaceWithResponseAsync(resourceGroupName, name, resource); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), Route53HostedZoneInner.class, Route53HostedZoneInner.class, + this.client.getContext()); + } + + /** + * Create a Route53HostedZone. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Route53HostedZone. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Route53HostedZoneInner> beginCreateOrReplaceAsync( + String resourceGroupName, String name, Route53HostedZoneInner resource, Context context) { + context = this.client.mergeContext(context); + Mono>> mono + = createOrReplaceWithResponseAsync(resourceGroupName, name, resource, context); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), Route53HostedZoneInner.class, Route53HostedZoneInner.class, context); + } + + /** + * Create a Route53HostedZone. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Route53HostedZone. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Route53HostedZoneInner> + beginCreateOrReplace(String resourceGroupName, String name, Route53HostedZoneInner resource) { + return this.beginCreateOrReplaceAsync(resourceGroupName, name, resource).getSyncPoller(); + } + + /** + * Create a Route53HostedZone. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Route53HostedZone. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Route53HostedZoneInner> + beginCreateOrReplace(String resourceGroupName, String name, Route53HostedZoneInner resource, Context context) { + return this.beginCreateOrReplaceAsync(resourceGroupName, name, resource, context).getSyncPoller(); + } + + /** + * Create a Route53HostedZone. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Route53HostedZone. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrReplaceAsync(String resourceGroupName, String name, + Route53HostedZoneInner resource) { + return beginCreateOrReplaceAsync(resourceGroupName, name, resource).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create a Route53HostedZone. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Route53HostedZone. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrReplaceAsync(String resourceGroupName, String name, + Route53HostedZoneInner resource, Context context) { + return beginCreateOrReplaceAsync(resourceGroupName, name, resource, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create a Route53HostedZone. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Route53HostedZone. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Route53HostedZoneInner createOrReplace(String resourceGroupName, String name, + Route53HostedZoneInner resource) { + return createOrReplaceAsync(resourceGroupName, name, resource).block(); + } + + /** + * Create a Route53HostedZone. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Route53HostedZone. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Route53HostedZoneInner createOrReplace(String resourceGroupName, String name, + Route53HostedZoneInner resource, Context context) { + return createOrReplaceAsync(resourceGroupName, name, resource, context).block(); + } + + /** + * Update a Route53HostedZone. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Route53HostedZone. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync(String resourceGroupName, String name, + Route53HostedZoneTagsUpdate properties) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (properties == null) { + return Mono.error(new IllegalArgumentException("Parameter properties is required and cannot be null.")); + } else { + properties.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.update(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, properties, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Update a Route53HostedZone. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Route53HostedZone. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync(String resourceGroupName, String name, + Route53HostedZoneTagsUpdate properties, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (properties == null) { + return Mono.error(new IllegalArgumentException("Parameter properties is required and cannot be null.")); + } else { + properties.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.update(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, name, properties, accept, context); + } + + /** + * Update a Route53HostedZone. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Route53HostedZone. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Route53HostedZoneInner> + beginUpdateAsync(String resourceGroupName, String name, Route53HostedZoneTagsUpdate properties) { + Mono>> mono = updateWithResponseAsync(resourceGroupName, name, properties); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), Route53HostedZoneInner.class, Route53HostedZoneInner.class, + this.client.getContext()); + } + + /** + * Update a Route53HostedZone. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Route53HostedZone. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Route53HostedZoneInner> beginUpdateAsync( + String resourceGroupName, String name, Route53HostedZoneTagsUpdate properties, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = updateWithResponseAsync(resourceGroupName, name, properties, context); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), Route53HostedZoneInner.class, Route53HostedZoneInner.class, context); + } + + /** + * Update a Route53HostedZone. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Route53HostedZone. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Route53HostedZoneInner> beginUpdate(String resourceGroupName, + String name, Route53HostedZoneTagsUpdate properties) { + return this.beginUpdateAsync(resourceGroupName, name, properties).getSyncPoller(); + } + + /** + * Update a Route53HostedZone. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Route53HostedZone. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Route53HostedZoneInner> beginUpdate(String resourceGroupName, + String name, Route53HostedZoneTagsUpdate properties, Context context) { + return this.beginUpdateAsync(resourceGroupName, name, properties, context).getSyncPoller(); + } + + /** + * Update a Route53HostedZone. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Route53HostedZone. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync(String resourceGroupName, String name, + Route53HostedZoneTagsUpdate properties) { + return beginUpdateAsync(resourceGroupName, name, properties).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Update a Route53HostedZone. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Route53HostedZone. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync(String resourceGroupName, String name, + Route53HostedZoneTagsUpdate properties, Context context) { + return beginUpdateAsync(resourceGroupName, name, properties, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Update a Route53HostedZone. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Route53HostedZone. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Route53HostedZoneInner update(String resourceGroupName, String name, + Route53HostedZoneTagsUpdate properties) { + return updateAsync(resourceGroupName, name, properties).block(); + } + + /** + * Update a Route53HostedZone. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Route53HostedZone. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Route53HostedZoneInner update(String resourceGroupName, String name, Route53HostedZoneTagsUpdate properties, + Context context) { + return updateAsync(resourceGroupName, name, properties, context).block(); + } + + /** + * Delete a Route53HostedZone. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Route53HostedZone. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync(String resourceGroupName, String name) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Delete a Route53HostedZone. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Route53HostedZone. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync(String resourceGroupName, String name, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.delete(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, name, accept, context); + } + + /** + * Delete a Route53HostedZone. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Route53HostedZone. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String name) { + Mono>> mono = deleteWithResponseAsync(resourceGroupName, name); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); + } + + /** + * Delete a Route53HostedZone. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Route53HostedZone. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String name, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = deleteWithResponseAsync(resourceGroupName, name, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + context); + } + + /** + * Delete a Route53HostedZone. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Route53HostedZone. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String name) { + return this.beginDeleteAsync(resourceGroupName, name).getSyncPoller(); + } + + /** + * Delete a Route53HostedZone. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Route53HostedZone. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String name, Context context) { + return this.beginDeleteAsync(resourceGroupName, name, context).getSyncPoller(); + } + + /** + * Delete a Route53HostedZone. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Route53HostedZone. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String name) { + return beginDeleteAsync(resourceGroupName, name).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete a Route53HostedZone. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Route53HostedZone. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String name, Context context) { + return beginDeleteAsync(resourceGroupName, name, context).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete a Route53HostedZone. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Route53HostedZone. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String name) { + deleteAsync(resourceGroupName, name).block(); + } + + /** + * Delete a Route53HostedZone. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Route53HostedZone. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String name, Context context) { + deleteAsync(resourceGroupName, name, context).block(); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Route53HostedZone list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listBySubscriptionNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Route53HostedZone list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listBySubscriptionNextSinglePageAsync(String nextLink, + Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Route53HostedZone list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Route53HostedZone list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupNextSinglePageAsync(String nextLink, + Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/Route53HostedZonesImpl.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/Route53HostedZonesImpl.java new file mode 100644 index 000000000000..6c08b67d95f3 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/Route53HostedZonesImpl.java @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.awsconnector.fluent.Route53HostedZonesClient; +import com.azure.resourcemanager.awsconnector.fluent.models.Route53HostedZoneInner; +import com.azure.resourcemanager.awsconnector.models.Route53HostedZone; +import com.azure.resourcemanager.awsconnector.models.Route53HostedZones; + +public final class Route53HostedZonesImpl implements Route53HostedZones { + private static final ClientLogger LOGGER = new ClientLogger(Route53HostedZonesImpl.class); + + private final Route53HostedZonesClient innerClient; + + private final com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager; + + public Route53HostedZonesImpl(Route53HostedZonesClient innerClient, + com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return ResourceManagerUtils.mapPage(inner, inner1 -> new Route53HostedZoneImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new Route53HostedZoneImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName); + return ResourceManagerUtils.mapPage(inner, inner1 -> new Route53HostedZoneImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + PagedIterable inner + = this.serviceClient().listByResourceGroup(resourceGroupName, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new Route53HostedZoneImpl(inner1, this.manager())); + } + + public Response getByResourceGroupWithResponse(String resourceGroupName, String name, + Context context) { + Response inner + = this.serviceClient().getByResourceGroupWithResponse(resourceGroupName, name, context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new Route53HostedZoneImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public Route53HostedZone getByResourceGroup(String resourceGroupName, String name) { + Route53HostedZoneInner inner = this.serviceClient().getByResourceGroup(resourceGroupName, name); + if (inner != null) { + return new Route53HostedZoneImpl(inner, this.manager()); + } else { + return null; + } + } + + public void deleteByResourceGroup(String resourceGroupName, String name) { + this.serviceClient().delete(resourceGroupName, name); + } + + public void delete(String resourceGroupName, String name, Context context) { + this.serviceClient().delete(resourceGroupName, name, context); + } + + public Route53HostedZone getById(String id) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String name = ResourceManagerUtils.getValueFromIdByName(id, "route53HostedZones"); + if (name == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'route53HostedZones'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, name, Context.NONE).getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String name = ResourceManagerUtils.getValueFromIdByName(id, "route53HostedZones"); + if (name == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'route53HostedZones'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, name, context); + } + + public void deleteById(String id) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String name = ResourceManagerUtils.getValueFromIdByName(id, "route53HostedZones"); + if (name == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'route53HostedZones'.", id))); + } + this.delete(resourceGroupName, name, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String name = ResourceManagerUtils.getValueFromIdByName(id, "route53HostedZones"); + if (name == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'route53HostedZones'.", id))); + } + this.delete(resourceGroupName, name, context); + } + + private Route53HostedZonesClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.awsconnector.AwsconnectorManager manager() { + return this.serviceManager; + } + + public Route53HostedZoneImpl define(String name) { + return new Route53HostedZoneImpl(name, this.manager()); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/Route53ResourceRecordSetImpl.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/Route53ResourceRecordSetImpl.java new file mode 100644 index 000000000000..ac558155d684 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/Route53ResourceRecordSetImpl.java @@ -0,0 +1,179 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.implementation; + +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.awsconnector.fluent.models.Route53ResourceRecordSetInner; +import com.azure.resourcemanager.awsconnector.models.Route53ResourceRecordSet; +import com.azure.resourcemanager.awsconnector.models.Route53ResourceRecordSetProperties; +import com.azure.resourcemanager.awsconnector.models.Route53ResourceRecordSetTagsUpdate; +import java.util.Collections; +import java.util.Map; + +public final class Route53ResourceRecordSetImpl + implements Route53ResourceRecordSet, Route53ResourceRecordSet.Definition, Route53ResourceRecordSet.Update { + private Route53ResourceRecordSetInner innerObject; + + private final com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public String location() { + return this.innerModel().location(); + } + + public Map tags() { + Map inner = this.innerModel().tags(); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } + } + + public Route53ResourceRecordSetProperties properties() { + return this.innerModel().properties(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public String resourceGroupName() { + return resourceGroupName; + } + + public Route53ResourceRecordSetInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.awsconnector.AwsconnectorManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String name; + + private Route53ResourceRecordSetTagsUpdate updateProperties; + + public Route53ResourceRecordSetImpl withExistingResourceGroup(String resourceGroupName) { + this.resourceGroupName = resourceGroupName; + return this; + } + + public Route53ResourceRecordSet create() { + this.innerObject = serviceManager.serviceClient() + .getRoute53ResourceRecordSets() + .createOrReplace(resourceGroupName, name, this.innerModel(), Context.NONE); + return this; + } + + public Route53ResourceRecordSet create(Context context) { + this.innerObject = serviceManager.serviceClient() + .getRoute53ResourceRecordSets() + .createOrReplace(resourceGroupName, name, this.innerModel(), context); + return this; + } + + Route53ResourceRecordSetImpl(String name, + com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager) { + this.innerObject = new Route53ResourceRecordSetInner(); + this.serviceManager = serviceManager; + this.name = name; + } + + public Route53ResourceRecordSetImpl update() { + this.updateProperties = new Route53ResourceRecordSetTagsUpdate(); + return this; + } + + public Route53ResourceRecordSet apply() { + this.innerObject = serviceManager.serviceClient() + .getRoute53ResourceRecordSets() + .update(resourceGroupName, name, updateProperties, Context.NONE); + return this; + } + + public Route53ResourceRecordSet apply(Context context) { + this.innerObject = serviceManager.serviceClient() + .getRoute53ResourceRecordSets() + .update(resourceGroupName, name, updateProperties, context); + return this; + } + + Route53ResourceRecordSetImpl(Route53ResourceRecordSetInner innerObject, + com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.name = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "route53ResourceRecordSets"); + } + + public Route53ResourceRecordSet refresh() { + this.innerObject = serviceManager.serviceClient() + .getRoute53ResourceRecordSets() + .getByResourceGroupWithResponse(resourceGroupName, name, Context.NONE) + .getValue(); + return this; + } + + public Route53ResourceRecordSet refresh(Context context) { + this.innerObject = serviceManager.serviceClient() + .getRoute53ResourceRecordSets() + .getByResourceGroupWithResponse(resourceGroupName, name, context) + .getValue(); + return this; + } + + public Route53ResourceRecordSetImpl withRegion(Region location) { + this.innerModel().withLocation(location.toString()); + return this; + } + + public Route53ResourceRecordSetImpl withRegion(String location) { + this.innerModel().withLocation(location); + return this; + } + + public Route53ResourceRecordSetImpl withTags(Map tags) { + if (isInCreateMode()) { + this.innerModel().withTags(tags); + return this; + } else { + this.updateProperties.withTags(tags); + return this; + } + } + + public Route53ResourceRecordSetImpl withProperties(Route53ResourceRecordSetProperties properties) { + this.innerModel().withProperties(properties); + return this; + } + + private boolean isInCreateMode() { + return this.innerModel().id() == null; + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/Route53ResourceRecordSetsClientImpl.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/Route53ResourceRecordSetsClientImpl.java new file mode 100644 index 000000000000..652b77b60268 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/Route53ResourceRecordSetsClientImpl.java @@ -0,0 +1,1291 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.Patch; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.awsconnector.fluent.Route53ResourceRecordSetsClient; +import com.azure.resourcemanager.awsconnector.fluent.models.Route53ResourceRecordSetInner; +import com.azure.resourcemanager.awsconnector.models.Route53ResourceRecordSetListResult; +import com.azure.resourcemanager.awsconnector.models.Route53ResourceRecordSetTagsUpdate; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in Route53ResourceRecordSetsClient. + */ +public final class Route53ResourceRecordSetsClientImpl implements Route53ResourceRecordSetsClient { + /** + * The proxy service used to perform REST calls. + */ + private final Route53ResourceRecordSetsService service; + + /** + * The service client containing this operation class. + */ + private final MicrosoftAwsConnectorImpl client; + + /** + * Initializes an instance of Route53ResourceRecordSetsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + Route53ResourceRecordSetsClientImpl(MicrosoftAwsConnectorImpl client) { + this.service = RestProxy.create(Route53ResourceRecordSetsService.class, client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for MicrosoftAwsConnectorRoute53ResourceRecordSets to be used by the + * proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "MicrosoftAwsConnecto") + public interface Route53ResourceRecordSetsService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.AwsConnector/route53ResourceRecordSets") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/route53ResourceRecordSets") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroup(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/route53ResourceRecordSets/{name}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getByResourceGroup(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("name") String name, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/route53ResourceRecordSets/{name}") + @ExpectedResponses({ 200, 201 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrReplace(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("name") String name, + @BodyParam("application/json") Route53ResourceRecordSetInner resource, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/route53ResourceRecordSets/{name}") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> update(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("name") String name, + @BodyParam("application/json") Route53ResourceRecordSetTagsUpdate properties, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/route53ResourceRecordSets/{name}") + @ExpectedResponses({ 202, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("name") String name, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listBySubscriptionNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroupNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); + } + + /** + * List Route53ResourceRecordSet resources by subscription ID. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Route53ResourceRecordSet list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync() { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List Route53ResourceRecordSet resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Route53ResourceRecordSet list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), accept, + context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * List Route53ResourceRecordSet resources by subscription ID. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Route53ResourceRecordSet list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>(() -> listSinglePageAsync(), + nextLink -> listBySubscriptionNextSinglePageAsync(nextLink)); + } + + /** + * List Route53ResourceRecordSet resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Route53ResourceRecordSet list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(Context context) { + return new PagedFlux<>(() -> listSinglePageAsync(context), + nextLink -> listBySubscriptionNextSinglePageAsync(nextLink, context)); + } + + /** + * List Route53ResourceRecordSet resources by subscription ID. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Route53ResourceRecordSet list operation as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + return new PagedIterable<>(listAsync()); + } + + /** + * List Route53ResourceRecordSet resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Route53ResourceRecordSet list operation as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Context context) { + return new PagedIterable<>(listAsync(context)); + } + + /** + * List Route53ResourceRecordSet resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Route53ResourceRecordSet list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> + listByResourceGroupSinglePageAsync(String resourceGroupName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List Route53ResourceRecordSet resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Route53ResourceRecordSet list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> + listByResourceGroupSinglePageAsync(String resourceGroupName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * List Route53ResourceRecordSet resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Route53ResourceRecordSet list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName) { + return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); + } + + /** + * List Route53ResourceRecordSet resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Route53ResourceRecordSet list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName, + Context context) { + return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName, context), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink, context)); + } + + /** + * List Route53ResourceRecordSet resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Route53ResourceRecordSet list operation as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName)); + } + + /** + * List Route53ResourceRecordSet resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Route53ResourceRecordSet list operation as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, context)); + } + + /** + * Get a Route53ResourceRecordSet. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Route53ResourceRecordSet. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Route53ResourceRecordSet along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync(String resourceGroupName, + String name) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.getByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get a Route53ResourceRecordSet. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Route53ResourceRecordSet. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Route53ResourceRecordSet along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync(String resourceGroupName, + String name, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.getByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, accept, context); + } + + /** + * Get a Route53ResourceRecordSet. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Route53ResourceRecordSet. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Route53ResourceRecordSet on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getByResourceGroupAsync(String resourceGroupName, String name) { + return getByResourceGroupWithResponseAsync(resourceGroupName, name) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Get a Route53ResourceRecordSet. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Route53ResourceRecordSet. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Route53ResourceRecordSet along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getByResourceGroupWithResponse(String resourceGroupName, String name, + Context context) { + return getByResourceGroupWithResponseAsync(resourceGroupName, name, context).block(); + } + + /** + * Get a Route53ResourceRecordSet. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Route53ResourceRecordSet. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Route53ResourceRecordSet. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Route53ResourceRecordSetInner getByResourceGroup(String resourceGroupName, String name) { + return getByResourceGroupWithResponse(resourceGroupName, name, Context.NONE).getValue(); + } + + /** + * Create a Route53ResourceRecordSet. Please note that end user resource creation is currently restricted, but it + * will be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Route53ResourceRecordSet. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrReplaceWithResponseAsync(String resourceGroupName, String name, + Route53ResourceRecordSetInner resource) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (resource == null) { + return Mono.error(new IllegalArgumentException("Parameter resource is required and cannot be null.")); + } else { + resource.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.createOrReplace(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, resource, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Create a Route53ResourceRecordSet. Please note that end user resource creation is currently restricted, but it + * will be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Route53ResourceRecordSet. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrReplaceWithResponseAsync(String resourceGroupName, String name, + Route53ResourceRecordSetInner resource, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (resource == null) { + return Mono.error(new IllegalArgumentException("Parameter resource is required and cannot be null.")); + } else { + resource.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.createOrReplace(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, resource, accept, context); + } + + /** + * Create a Route53ResourceRecordSet. Please note that end user resource creation is currently restricted, but it + * will be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Route53ResourceRecordSet. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Route53ResourceRecordSetInner> + beginCreateOrReplaceAsync(String resourceGroupName, String name, Route53ResourceRecordSetInner resource) { + Mono>> mono = createOrReplaceWithResponseAsync(resourceGroupName, name, resource); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), Route53ResourceRecordSetInner.class, Route53ResourceRecordSetInner.class, + this.client.getContext()); + } + + /** + * Create a Route53ResourceRecordSet. Please note that end user resource creation is currently restricted, but it + * will be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Route53ResourceRecordSet. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Route53ResourceRecordSetInner> + beginCreateOrReplaceAsync(String resourceGroupName, String name, Route53ResourceRecordSetInner resource, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono + = createOrReplaceWithResponseAsync(resourceGroupName, name, resource, context); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), Route53ResourceRecordSetInner.class, Route53ResourceRecordSetInner.class, + context); + } + + /** + * Create a Route53ResourceRecordSet. Please note that end user resource creation is currently restricted, but it + * will be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Route53ResourceRecordSet. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Route53ResourceRecordSetInner> + beginCreateOrReplace(String resourceGroupName, String name, Route53ResourceRecordSetInner resource) { + return this.beginCreateOrReplaceAsync(resourceGroupName, name, resource).getSyncPoller(); + } + + /** + * Create a Route53ResourceRecordSet. Please note that end user resource creation is currently restricted, but it + * will be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Route53ResourceRecordSet. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Route53ResourceRecordSetInner> beginCreateOrReplace( + String resourceGroupName, String name, Route53ResourceRecordSetInner resource, Context context) { + return this.beginCreateOrReplaceAsync(resourceGroupName, name, resource, context).getSyncPoller(); + } + + /** + * Create a Route53ResourceRecordSet. Please note that end user resource creation is currently restricted, but it + * will be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Route53ResourceRecordSet. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrReplaceAsync(String resourceGroupName, String name, + Route53ResourceRecordSetInner resource) { + return beginCreateOrReplaceAsync(resourceGroupName, name, resource).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create a Route53ResourceRecordSet. Please note that end user resource creation is currently restricted, but it + * will be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Route53ResourceRecordSet. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrReplaceAsync(String resourceGroupName, String name, + Route53ResourceRecordSetInner resource, Context context) { + return beginCreateOrReplaceAsync(resourceGroupName, name, resource, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create a Route53ResourceRecordSet. Please note that end user resource creation is currently restricted, but it + * will be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Route53ResourceRecordSet. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Route53ResourceRecordSetInner createOrReplace(String resourceGroupName, String name, + Route53ResourceRecordSetInner resource) { + return createOrReplaceAsync(resourceGroupName, name, resource).block(); + } + + /** + * Create a Route53ResourceRecordSet. Please note that end user resource creation is currently restricted, but it + * will be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Route53ResourceRecordSet. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Route53ResourceRecordSetInner createOrReplace(String resourceGroupName, String name, + Route53ResourceRecordSetInner resource, Context context) { + return createOrReplaceAsync(resourceGroupName, name, resource, context).block(); + } + + /** + * Update a Route53ResourceRecordSet. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Route53ResourceRecordSet. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync(String resourceGroupName, String name, + Route53ResourceRecordSetTagsUpdate properties) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (properties == null) { + return Mono.error(new IllegalArgumentException("Parameter properties is required and cannot be null.")); + } else { + properties.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.update(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, properties, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Update a Route53ResourceRecordSet. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Route53ResourceRecordSet. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync(String resourceGroupName, String name, + Route53ResourceRecordSetTagsUpdate properties, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (properties == null) { + return Mono.error(new IllegalArgumentException("Parameter properties is required and cannot be null.")); + } else { + properties.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.update(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, name, properties, accept, context); + } + + /** + * Update a Route53ResourceRecordSet. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Route53ResourceRecordSet. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Route53ResourceRecordSetInner> + beginUpdateAsync(String resourceGroupName, String name, Route53ResourceRecordSetTagsUpdate properties) { + Mono>> mono = updateWithResponseAsync(resourceGroupName, name, properties); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), Route53ResourceRecordSetInner.class, Route53ResourceRecordSetInner.class, + this.client.getContext()); + } + + /** + * Update a Route53ResourceRecordSet. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Route53ResourceRecordSet. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Route53ResourceRecordSetInner> beginUpdateAsync( + String resourceGroupName, String name, Route53ResourceRecordSetTagsUpdate properties, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = updateWithResponseAsync(resourceGroupName, name, properties, context); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), Route53ResourceRecordSetInner.class, Route53ResourceRecordSetInner.class, + context); + } + + /** + * Update a Route53ResourceRecordSet. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Route53ResourceRecordSet. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Route53ResourceRecordSetInner> + beginUpdate(String resourceGroupName, String name, Route53ResourceRecordSetTagsUpdate properties) { + return this.beginUpdateAsync(resourceGroupName, name, properties).getSyncPoller(); + } + + /** + * Update a Route53ResourceRecordSet. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Route53ResourceRecordSet. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Route53ResourceRecordSetInner> beginUpdate( + String resourceGroupName, String name, Route53ResourceRecordSetTagsUpdate properties, Context context) { + return this.beginUpdateAsync(resourceGroupName, name, properties, context).getSyncPoller(); + } + + /** + * Update a Route53ResourceRecordSet. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Route53ResourceRecordSet. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync(String resourceGroupName, String name, + Route53ResourceRecordSetTagsUpdate properties) { + return beginUpdateAsync(resourceGroupName, name, properties).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Update a Route53ResourceRecordSet. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Route53ResourceRecordSet. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync(String resourceGroupName, String name, + Route53ResourceRecordSetTagsUpdate properties, Context context) { + return beginUpdateAsync(resourceGroupName, name, properties, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Update a Route53ResourceRecordSet. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Route53ResourceRecordSet. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Route53ResourceRecordSetInner update(String resourceGroupName, String name, + Route53ResourceRecordSetTagsUpdate properties) { + return updateAsync(resourceGroupName, name, properties).block(); + } + + /** + * Update a Route53ResourceRecordSet. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Route53ResourceRecordSet. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Route53ResourceRecordSetInner update(String resourceGroupName, String name, + Route53ResourceRecordSetTagsUpdate properties, Context context) { + return updateAsync(resourceGroupName, name, properties, context).block(); + } + + /** + * Delete a Route53ResourceRecordSet. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Route53ResourceRecordSet. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync(String resourceGroupName, String name) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Delete a Route53ResourceRecordSet. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Route53ResourceRecordSet. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync(String resourceGroupName, String name, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.delete(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, name, accept, context); + } + + /** + * Delete a Route53ResourceRecordSet. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Route53ResourceRecordSet. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String name) { + Mono>> mono = deleteWithResponseAsync(resourceGroupName, name); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); + } + + /** + * Delete a Route53ResourceRecordSet. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Route53ResourceRecordSet. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String name, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = deleteWithResponseAsync(resourceGroupName, name, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + context); + } + + /** + * Delete a Route53ResourceRecordSet. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Route53ResourceRecordSet. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String name) { + return this.beginDeleteAsync(resourceGroupName, name).getSyncPoller(); + } + + /** + * Delete a Route53ResourceRecordSet. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Route53ResourceRecordSet. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String name, Context context) { + return this.beginDeleteAsync(resourceGroupName, name, context).getSyncPoller(); + } + + /** + * Delete a Route53ResourceRecordSet. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Route53ResourceRecordSet. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String name) { + return beginDeleteAsync(resourceGroupName, name).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete a Route53ResourceRecordSet. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Route53ResourceRecordSet. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String name, Context context) { + return beginDeleteAsync(resourceGroupName, name, context).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete a Route53ResourceRecordSet. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Route53ResourceRecordSet. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String name) { + deleteAsync(resourceGroupName, name).block(); + } + + /** + * Delete a Route53ResourceRecordSet. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Route53ResourceRecordSet. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String name, Context context) { + deleteAsync(resourceGroupName, name, context).block(); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Route53ResourceRecordSet list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listBySubscriptionNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Route53ResourceRecordSet list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listBySubscriptionNextSinglePageAsync(String nextLink, + Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Route53ResourceRecordSet list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Route53ResourceRecordSet list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupNextSinglePageAsync(String nextLink, + Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/Route53ResourceRecordSetsImpl.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/Route53ResourceRecordSetsImpl.java new file mode 100644 index 000000000000..03c1d6395236 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/Route53ResourceRecordSetsImpl.java @@ -0,0 +1,148 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.awsconnector.fluent.Route53ResourceRecordSetsClient; +import com.azure.resourcemanager.awsconnector.fluent.models.Route53ResourceRecordSetInner; +import com.azure.resourcemanager.awsconnector.models.Route53ResourceRecordSet; +import com.azure.resourcemanager.awsconnector.models.Route53ResourceRecordSets; + +public final class Route53ResourceRecordSetsImpl implements Route53ResourceRecordSets { + private static final ClientLogger LOGGER = new ClientLogger(Route53ResourceRecordSetsImpl.class); + + private final Route53ResourceRecordSetsClient innerClient; + + private final com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager; + + public Route53ResourceRecordSetsImpl(Route53ResourceRecordSetsClient innerClient, + com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return ResourceManagerUtils.mapPage(inner, inner1 -> new Route53ResourceRecordSetImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new Route53ResourceRecordSetImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName) { + PagedIterable inner + = this.serviceClient().listByResourceGroup(resourceGroupName); + return ResourceManagerUtils.mapPage(inner, inner1 -> new Route53ResourceRecordSetImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + PagedIterable inner + = this.serviceClient().listByResourceGroup(resourceGroupName, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new Route53ResourceRecordSetImpl(inner1, this.manager())); + } + + public Response getByResourceGroupWithResponse(String resourceGroupName, String name, + Context context) { + Response inner + = this.serviceClient().getByResourceGroupWithResponse(resourceGroupName, name, context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new Route53ResourceRecordSetImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public Route53ResourceRecordSet getByResourceGroup(String resourceGroupName, String name) { + Route53ResourceRecordSetInner inner = this.serviceClient().getByResourceGroup(resourceGroupName, name); + if (inner != null) { + return new Route53ResourceRecordSetImpl(inner, this.manager()); + } else { + return null; + } + } + + public void deleteByResourceGroup(String resourceGroupName, String name) { + this.serviceClient().delete(resourceGroupName, name); + } + + public void delete(String resourceGroupName, String name, Context context) { + this.serviceClient().delete(resourceGroupName, name, context); + } + + public Route53ResourceRecordSet getById(String id) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String name = ResourceManagerUtils.getValueFromIdByName(id, "route53ResourceRecordSets"); + if (name == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException(String + .format("The resource ID '%s' is not valid. Missing path segment 'route53ResourceRecordSets'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, name, Context.NONE).getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String name = ResourceManagerUtils.getValueFromIdByName(id, "route53ResourceRecordSets"); + if (name == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException(String + .format("The resource ID '%s' is not valid. Missing path segment 'route53ResourceRecordSets'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, name, context); + } + + public void deleteById(String id) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String name = ResourceManagerUtils.getValueFromIdByName(id, "route53ResourceRecordSets"); + if (name == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException(String + .format("The resource ID '%s' is not valid. Missing path segment 'route53ResourceRecordSets'.", id))); + } + this.delete(resourceGroupName, name, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String name = ResourceManagerUtils.getValueFromIdByName(id, "route53ResourceRecordSets"); + if (name == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException(String + .format("The resource ID '%s' is not valid. Missing path segment 'route53ResourceRecordSets'.", id))); + } + this.delete(resourceGroupName, name, context); + } + + private Route53ResourceRecordSetsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.awsconnector.AwsconnectorManager manager() { + return this.serviceManager; + } + + public Route53ResourceRecordSetImpl define(String name) { + return new Route53ResourceRecordSetImpl(name, this.manager()); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/S3AccessPointImpl.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/S3AccessPointImpl.java new file mode 100644 index 000000000000..3d1b211e8720 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/S3AccessPointImpl.java @@ -0,0 +1,177 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.implementation; + +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.awsconnector.fluent.models.S3AccessPointInner; +import com.azure.resourcemanager.awsconnector.models.S3AccessPoint; +import com.azure.resourcemanager.awsconnector.models.S3AccessPointProperties; +import com.azure.resourcemanager.awsconnector.models.S3AccessPointTagsUpdate; +import java.util.Collections; +import java.util.Map; + +public final class S3AccessPointImpl implements S3AccessPoint, S3AccessPoint.Definition, S3AccessPoint.Update { + private S3AccessPointInner innerObject; + + private final com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public String location() { + return this.innerModel().location(); + } + + public Map tags() { + Map inner = this.innerModel().tags(); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } + } + + public S3AccessPointProperties properties() { + return this.innerModel().properties(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public String resourceGroupName() { + return resourceGroupName; + } + + public S3AccessPointInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.awsconnector.AwsconnectorManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String name; + + private S3AccessPointTagsUpdate updateProperties; + + public S3AccessPointImpl withExistingResourceGroup(String resourceGroupName) { + this.resourceGroupName = resourceGroupName; + return this; + } + + public S3AccessPoint create() { + this.innerObject = serviceManager.serviceClient() + .getS3AccessPoints() + .createOrReplace(resourceGroupName, name, this.innerModel(), Context.NONE); + return this; + } + + public S3AccessPoint create(Context context) { + this.innerObject = serviceManager.serviceClient() + .getS3AccessPoints() + .createOrReplace(resourceGroupName, name, this.innerModel(), context); + return this; + } + + S3AccessPointImpl(String name, com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager) { + this.innerObject = new S3AccessPointInner(); + this.serviceManager = serviceManager; + this.name = name; + } + + public S3AccessPointImpl update() { + this.updateProperties = new S3AccessPointTagsUpdate(); + return this; + } + + public S3AccessPoint apply() { + this.innerObject = serviceManager.serviceClient() + .getS3AccessPoints() + .update(resourceGroupName, name, updateProperties, Context.NONE); + return this; + } + + public S3AccessPoint apply(Context context) { + this.innerObject = serviceManager.serviceClient() + .getS3AccessPoints() + .update(resourceGroupName, name, updateProperties, context); + return this; + } + + S3AccessPointImpl(S3AccessPointInner innerObject, + com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.name = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "s3AccessPoints"); + } + + public S3AccessPoint refresh() { + this.innerObject = serviceManager.serviceClient() + .getS3AccessPoints() + .getByResourceGroupWithResponse(resourceGroupName, name, Context.NONE) + .getValue(); + return this; + } + + public S3AccessPoint refresh(Context context) { + this.innerObject = serviceManager.serviceClient() + .getS3AccessPoints() + .getByResourceGroupWithResponse(resourceGroupName, name, context) + .getValue(); + return this; + } + + public S3AccessPointImpl withRegion(Region location) { + this.innerModel().withLocation(location.toString()); + return this; + } + + public S3AccessPointImpl withRegion(String location) { + this.innerModel().withLocation(location); + return this; + } + + public S3AccessPointImpl withTags(Map tags) { + if (isInCreateMode()) { + this.innerModel().withTags(tags); + return this; + } else { + this.updateProperties.withTags(tags); + return this; + } + } + + public S3AccessPointImpl withProperties(S3AccessPointProperties properties) { + this.innerModel().withProperties(properties); + return this; + } + + private boolean isInCreateMode() { + return this.innerModel().id() == null; + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/S3AccessPointsClientImpl.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/S3AccessPointsClientImpl.java new file mode 100644 index 000000000000..d98e506d0660 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/S3AccessPointsClientImpl.java @@ -0,0 +1,1278 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.Patch; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.awsconnector.fluent.S3AccessPointsClient; +import com.azure.resourcemanager.awsconnector.fluent.models.S3AccessPointInner; +import com.azure.resourcemanager.awsconnector.models.S3AccessPointListResult; +import com.azure.resourcemanager.awsconnector.models.S3AccessPointTagsUpdate; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in S3AccessPointsClient. + */ +public final class S3AccessPointsClientImpl implements S3AccessPointsClient { + /** + * The proxy service used to perform REST calls. + */ + private final S3AccessPointsService service; + + /** + * The service client containing this operation class. + */ + private final MicrosoftAwsConnectorImpl client; + + /** + * Initializes an instance of S3AccessPointsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + S3AccessPointsClientImpl(MicrosoftAwsConnectorImpl client) { + this.service + = RestProxy.create(S3AccessPointsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for MicrosoftAwsConnectorS3AccessPoints to be used by the proxy service + * to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "MicrosoftAwsConnecto") + public interface S3AccessPointsService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.AwsConnector/s3AccessPoints") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/s3AccessPoints") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroup(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/s3AccessPoints/{name}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getByResourceGroup(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("name") String name, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/s3AccessPoints/{name}") + @ExpectedResponses({ 200, 201 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrReplace(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("name") String name, + @BodyParam("application/json") S3AccessPointInner resource, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/s3AccessPoints/{name}") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> update(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("name") String name, + @BodyParam("application/json") S3AccessPointTagsUpdate properties, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/s3AccessPoints/{name}") + @ExpectedResponses({ 202, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("name") String name, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listBySubscriptionNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroupNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); + } + + /** + * List S3AccessPoint resources by subscription ID. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a S3AccessPoint list operation along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync() { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List S3AccessPoint resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a S3AccessPoint list operation along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), accept, + context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * List S3AccessPoint resources by subscription ID. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a S3AccessPoint list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>(() -> listSinglePageAsync(), + nextLink -> listBySubscriptionNextSinglePageAsync(nextLink)); + } + + /** + * List S3AccessPoint resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a S3AccessPoint list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(Context context) { + return new PagedFlux<>(() -> listSinglePageAsync(context), + nextLink -> listBySubscriptionNextSinglePageAsync(nextLink, context)); + } + + /** + * List S3AccessPoint resources by subscription ID. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a S3AccessPoint list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + return new PagedIterable<>(listAsync()); + } + + /** + * List S3AccessPoint resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a S3AccessPoint list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Context context) { + return new PagedIterable<>(listAsync(context)); + } + + /** + * List S3AccessPoint resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a S3AccessPoint list operation along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List S3AccessPoint resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a S3AccessPoint list operation along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * List S3AccessPoint resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a S3AccessPoint list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName) { + return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); + } + + /** + * List S3AccessPoint resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a S3AccessPoint list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName, Context context) { + return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName, context), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink, context)); + } + + /** + * List S3AccessPoint resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a S3AccessPoint list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName)); + } + + /** + * List S3AccessPoint resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a S3AccessPoint list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, context)); + } + + /** + * Get a S3AccessPoint. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of S3AccessPoint. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a S3AccessPoint along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync(String resourceGroupName, + String name) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.getByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get a S3AccessPoint. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of S3AccessPoint. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a S3AccessPoint along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync(String resourceGroupName, + String name, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.getByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, accept, context); + } + + /** + * Get a S3AccessPoint. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of S3AccessPoint. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a S3AccessPoint on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getByResourceGroupAsync(String resourceGroupName, String name) { + return getByResourceGroupWithResponseAsync(resourceGroupName, name) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Get a S3AccessPoint. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of S3AccessPoint. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a S3AccessPoint along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getByResourceGroupWithResponse(String resourceGroupName, String name, + Context context) { + return getByResourceGroupWithResponseAsync(resourceGroupName, name, context).block(); + } + + /** + * Get a S3AccessPoint. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of S3AccessPoint. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a S3AccessPoint. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public S3AccessPointInner getByResourceGroup(String resourceGroupName, String name) { + return getByResourceGroupWithResponse(resourceGroupName, name, Context.NONE).getValue(); + } + + /** + * Create a S3AccessPoint. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of S3AccessPoint. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrReplaceWithResponseAsync(String resourceGroupName, String name, + S3AccessPointInner resource) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (resource == null) { + return Mono.error(new IllegalArgumentException("Parameter resource is required and cannot be null.")); + } else { + resource.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.createOrReplace(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, resource, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Create a S3AccessPoint. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of S3AccessPoint. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrReplaceWithResponseAsync(String resourceGroupName, String name, + S3AccessPointInner resource, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (resource == null) { + return Mono.error(new IllegalArgumentException("Parameter resource is required and cannot be null.")); + } else { + resource.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.createOrReplace(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, resource, accept, context); + } + + /** + * Create a S3AccessPoint. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of S3AccessPoint. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, S3AccessPointInner> + beginCreateOrReplaceAsync(String resourceGroupName, String name, S3AccessPointInner resource) { + Mono>> mono = createOrReplaceWithResponseAsync(resourceGroupName, name, resource); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + S3AccessPointInner.class, S3AccessPointInner.class, this.client.getContext()); + } + + /** + * Create a S3AccessPoint. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of S3AccessPoint. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, S3AccessPointInner> + beginCreateOrReplaceAsync(String resourceGroupName, String name, S3AccessPointInner resource, Context context) { + context = this.client.mergeContext(context); + Mono>> mono + = createOrReplaceWithResponseAsync(resourceGroupName, name, resource, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + S3AccessPointInner.class, S3AccessPointInner.class, context); + } + + /** + * Create a S3AccessPoint. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of S3AccessPoint. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, S3AccessPointInner> beginCreateOrReplace(String resourceGroupName, + String name, S3AccessPointInner resource) { + return this.beginCreateOrReplaceAsync(resourceGroupName, name, resource).getSyncPoller(); + } + + /** + * Create a S3AccessPoint. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of S3AccessPoint. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, S3AccessPointInner> beginCreateOrReplace(String resourceGroupName, + String name, S3AccessPointInner resource, Context context) { + return this.beginCreateOrReplaceAsync(resourceGroupName, name, resource, context).getSyncPoller(); + } + + /** + * Create a S3AccessPoint. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of S3AccessPoint. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrReplaceAsync(String resourceGroupName, String name, + S3AccessPointInner resource) { + return beginCreateOrReplaceAsync(resourceGroupName, name, resource).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create a S3AccessPoint. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of S3AccessPoint. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrReplaceAsync(String resourceGroupName, String name, + S3AccessPointInner resource, Context context) { + return beginCreateOrReplaceAsync(resourceGroupName, name, resource, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create a S3AccessPoint. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of S3AccessPoint. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public S3AccessPointInner createOrReplace(String resourceGroupName, String name, S3AccessPointInner resource) { + return createOrReplaceAsync(resourceGroupName, name, resource).block(); + } + + /** + * Create a S3AccessPoint. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of S3AccessPoint. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public S3AccessPointInner createOrReplace(String resourceGroupName, String name, S3AccessPointInner resource, + Context context) { + return createOrReplaceAsync(resourceGroupName, name, resource, context).block(); + } + + /** + * Update a S3AccessPoint. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of S3AccessPoint. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync(String resourceGroupName, String name, + S3AccessPointTagsUpdate properties) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (properties == null) { + return Mono.error(new IllegalArgumentException("Parameter properties is required and cannot be null.")); + } else { + properties.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.update(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, properties, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Update a S3AccessPoint. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of S3AccessPoint. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync(String resourceGroupName, String name, + S3AccessPointTagsUpdate properties, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (properties == null) { + return Mono.error(new IllegalArgumentException("Parameter properties is required and cannot be null.")); + } else { + properties.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.update(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, name, properties, accept, context); + } + + /** + * Update a S3AccessPoint. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of S3AccessPoint. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, S3AccessPointInner> beginUpdateAsync(String resourceGroupName, + String name, S3AccessPointTagsUpdate properties) { + Mono>> mono = updateWithResponseAsync(resourceGroupName, name, properties); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + S3AccessPointInner.class, S3AccessPointInner.class, this.client.getContext()); + } + + /** + * Update a S3AccessPoint. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of S3AccessPoint. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, S3AccessPointInner> beginUpdateAsync(String resourceGroupName, + String name, S3AccessPointTagsUpdate properties, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = updateWithResponseAsync(resourceGroupName, name, properties, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + S3AccessPointInner.class, S3AccessPointInner.class, context); + } + + /** + * Update a S3AccessPoint. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of S3AccessPoint. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, S3AccessPointInner> beginUpdate(String resourceGroupName, + String name, S3AccessPointTagsUpdate properties) { + return this.beginUpdateAsync(resourceGroupName, name, properties).getSyncPoller(); + } + + /** + * Update a S3AccessPoint. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of S3AccessPoint. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, S3AccessPointInner> beginUpdate(String resourceGroupName, + String name, S3AccessPointTagsUpdate properties, Context context) { + return this.beginUpdateAsync(resourceGroupName, name, properties, context).getSyncPoller(); + } + + /** + * Update a S3AccessPoint. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of S3AccessPoint. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync(String resourceGroupName, String name, + S3AccessPointTagsUpdate properties) { + return beginUpdateAsync(resourceGroupName, name, properties).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Update a S3AccessPoint. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of S3AccessPoint. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync(String resourceGroupName, String name, + S3AccessPointTagsUpdate properties, Context context) { + return beginUpdateAsync(resourceGroupName, name, properties, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Update a S3AccessPoint. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of S3AccessPoint. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public S3AccessPointInner update(String resourceGroupName, String name, S3AccessPointTagsUpdate properties) { + return updateAsync(resourceGroupName, name, properties).block(); + } + + /** + * Update a S3AccessPoint. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of S3AccessPoint. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public S3AccessPointInner update(String resourceGroupName, String name, S3AccessPointTagsUpdate properties, + Context context) { + return updateAsync(resourceGroupName, name, properties, context).block(); + } + + /** + * Delete a S3AccessPoint. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of S3AccessPoint. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync(String resourceGroupName, String name) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Delete a S3AccessPoint. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of S3AccessPoint. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync(String resourceGroupName, String name, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.delete(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, name, accept, context); + } + + /** + * Delete a S3AccessPoint. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of S3AccessPoint. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String name) { + Mono>> mono = deleteWithResponseAsync(resourceGroupName, name); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); + } + + /** + * Delete a S3AccessPoint. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of S3AccessPoint. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String name, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = deleteWithResponseAsync(resourceGroupName, name, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + context); + } + + /** + * Delete a S3AccessPoint. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of S3AccessPoint. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String name) { + return this.beginDeleteAsync(resourceGroupName, name).getSyncPoller(); + } + + /** + * Delete a S3AccessPoint. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of S3AccessPoint. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String name, Context context) { + return this.beginDeleteAsync(resourceGroupName, name, context).getSyncPoller(); + } + + /** + * Delete a S3AccessPoint. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of S3AccessPoint. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String name) { + return beginDeleteAsync(resourceGroupName, name).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete a S3AccessPoint. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of S3AccessPoint. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String name, Context context) { + return beginDeleteAsync(resourceGroupName, name, context).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete a S3AccessPoint. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of S3AccessPoint. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String name) { + deleteAsync(resourceGroupName, name).block(); + } + + /** + * Delete a S3AccessPoint. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of S3AccessPoint. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String name, Context context) { + deleteAsync(resourceGroupName, name, context).block(); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a S3AccessPoint list operation along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listBySubscriptionNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a S3AccessPoint list operation along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listBySubscriptionNextSinglePageAsync(String nextLink, + Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a S3AccessPoint list operation along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a S3AccessPoint list operation along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupNextSinglePageAsync(String nextLink, + Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/S3AccessPointsImpl.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/S3AccessPointsImpl.java new file mode 100644 index 000000000000..57257d74bba9 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/S3AccessPointsImpl.java @@ -0,0 +1,146 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.awsconnector.fluent.S3AccessPointsClient; +import com.azure.resourcemanager.awsconnector.fluent.models.S3AccessPointInner; +import com.azure.resourcemanager.awsconnector.models.S3AccessPoint; +import com.azure.resourcemanager.awsconnector.models.S3AccessPoints; + +public final class S3AccessPointsImpl implements S3AccessPoints { + private static final ClientLogger LOGGER = new ClientLogger(S3AccessPointsImpl.class); + + private final S3AccessPointsClient innerClient; + + private final com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager; + + public S3AccessPointsImpl(S3AccessPointsClient innerClient, + com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return ResourceManagerUtils.mapPage(inner, inner1 -> new S3AccessPointImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new S3AccessPointImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName); + return ResourceManagerUtils.mapPage(inner, inner1 -> new S3AccessPointImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new S3AccessPointImpl(inner1, this.manager())); + } + + public Response getByResourceGroupWithResponse(String resourceGroupName, String name, + Context context) { + Response inner + = this.serviceClient().getByResourceGroupWithResponse(resourceGroupName, name, context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new S3AccessPointImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public S3AccessPoint getByResourceGroup(String resourceGroupName, String name) { + S3AccessPointInner inner = this.serviceClient().getByResourceGroup(resourceGroupName, name); + if (inner != null) { + return new S3AccessPointImpl(inner, this.manager()); + } else { + return null; + } + } + + public void deleteByResourceGroup(String resourceGroupName, String name) { + this.serviceClient().delete(resourceGroupName, name); + } + + public void delete(String resourceGroupName, String name, Context context) { + this.serviceClient().delete(resourceGroupName, name, context); + } + + public S3AccessPoint getById(String id) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String name = ResourceManagerUtils.getValueFromIdByName(id, "s3AccessPoints"); + if (name == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 's3AccessPoints'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, name, Context.NONE).getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String name = ResourceManagerUtils.getValueFromIdByName(id, "s3AccessPoints"); + if (name == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 's3AccessPoints'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, name, context); + } + + public void deleteById(String id) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String name = ResourceManagerUtils.getValueFromIdByName(id, "s3AccessPoints"); + if (name == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 's3AccessPoints'.", id))); + } + this.delete(resourceGroupName, name, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String name = ResourceManagerUtils.getValueFromIdByName(id, "s3AccessPoints"); + if (name == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 's3AccessPoints'.", id))); + } + this.delete(resourceGroupName, name, context); + } + + private S3AccessPointsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.awsconnector.AwsconnectorManager manager() { + return this.serviceManager; + } + + public S3AccessPointImpl define(String name) { + return new S3AccessPointImpl(name, this.manager()); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/S3BucketImpl.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/S3BucketImpl.java new file mode 100644 index 000000000000..4bb5946f0316 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/S3BucketImpl.java @@ -0,0 +1,175 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.implementation; + +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.awsconnector.fluent.models.S3BucketInner; +import com.azure.resourcemanager.awsconnector.models.S3Bucket; +import com.azure.resourcemanager.awsconnector.models.S3BucketProperties; +import com.azure.resourcemanager.awsconnector.models.S3BucketTagsUpdate; +import java.util.Collections; +import java.util.Map; + +public final class S3BucketImpl implements S3Bucket, S3Bucket.Definition, S3Bucket.Update { + private S3BucketInner innerObject; + + private final com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public String location() { + return this.innerModel().location(); + } + + public Map tags() { + Map inner = this.innerModel().tags(); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } + } + + public S3BucketProperties properties() { + return this.innerModel().properties(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public String resourceGroupName() { + return resourceGroupName; + } + + public S3BucketInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.awsconnector.AwsconnectorManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String name; + + private S3BucketTagsUpdate updateProperties; + + public S3BucketImpl withExistingResourceGroup(String resourceGroupName) { + this.resourceGroupName = resourceGroupName; + return this; + } + + public S3Bucket create() { + this.innerObject = serviceManager.serviceClient() + .getS3Buckets() + .createOrReplace(resourceGroupName, name, this.innerModel(), Context.NONE); + return this; + } + + public S3Bucket create(Context context) { + this.innerObject = serviceManager.serviceClient() + .getS3Buckets() + .createOrReplace(resourceGroupName, name, this.innerModel(), context); + return this; + } + + S3BucketImpl(String name, com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager) { + this.innerObject = new S3BucketInner(); + this.serviceManager = serviceManager; + this.name = name; + } + + public S3BucketImpl update() { + this.updateProperties = new S3BucketTagsUpdate(); + return this; + } + + public S3Bucket apply() { + this.innerObject = serviceManager.serviceClient() + .getS3Buckets() + .update(resourceGroupName, name, updateProperties, Context.NONE); + return this; + } + + public S3Bucket apply(Context context) { + this.innerObject + = serviceManager.serviceClient().getS3Buckets().update(resourceGroupName, name, updateProperties, context); + return this; + } + + S3BucketImpl(S3BucketInner innerObject, com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.name = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "s3Buckets"); + } + + public S3Bucket refresh() { + this.innerObject = serviceManager.serviceClient() + .getS3Buckets() + .getByResourceGroupWithResponse(resourceGroupName, name, Context.NONE) + .getValue(); + return this; + } + + public S3Bucket refresh(Context context) { + this.innerObject = serviceManager.serviceClient() + .getS3Buckets() + .getByResourceGroupWithResponse(resourceGroupName, name, context) + .getValue(); + return this; + } + + public S3BucketImpl withRegion(Region location) { + this.innerModel().withLocation(location.toString()); + return this; + } + + public S3BucketImpl withRegion(String location) { + this.innerModel().withLocation(location); + return this; + } + + public S3BucketImpl withTags(Map tags) { + if (isInCreateMode()) { + this.innerModel().withTags(tags); + return this; + } else { + this.updateProperties.withTags(tags); + return this; + } + } + + public S3BucketImpl withProperties(S3BucketProperties properties) { + this.innerModel().withProperties(properties); + return this; + } + + private boolean isInCreateMode() { + return this.innerModel().id() == null; + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/S3BucketPoliciesClientImpl.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/S3BucketPoliciesClientImpl.java new file mode 100644 index 000000000000..12b49459f018 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/S3BucketPoliciesClientImpl.java @@ -0,0 +1,1278 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.Patch; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.awsconnector.fluent.S3BucketPoliciesClient; +import com.azure.resourcemanager.awsconnector.fluent.models.S3BucketPolicyInner; +import com.azure.resourcemanager.awsconnector.models.S3BucketPolicyListResult; +import com.azure.resourcemanager.awsconnector.models.S3BucketPolicyTagsUpdate; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in S3BucketPoliciesClient. + */ +public final class S3BucketPoliciesClientImpl implements S3BucketPoliciesClient { + /** + * The proxy service used to perform REST calls. + */ + private final S3BucketPoliciesService service; + + /** + * The service client containing this operation class. + */ + private final MicrosoftAwsConnectorImpl client; + + /** + * Initializes an instance of S3BucketPoliciesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + S3BucketPoliciesClientImpl(MicrosoftAwsConnectorImpl client) { + this.service + = RestProxy.create(S3BucketPoliciesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for MicrosoftAwsConnectorS3BucketPolicies to be used by the proxy service + * to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "MicrosoftAwsConnecto") + public interface S3BucketPoliciesService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.AwsConnector/s3BucketPolicies") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/s3BucketPolicies") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroup(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/s3BucketPolicies/{name}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getByResourceGroup(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("name") String name, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/s3BucketPolicies/{name}") + @ExpectedResponses({ 200, 201 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrReplace(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("name") String name, + @BodyParam("application/json") S3BucketPolicyInner resource, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/s3BucketPolicies/{name}") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> update(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("name") String name, + @BodyParam("application/json") S3BucketPolicyTagsUpdate properties, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/s3BucketPolicies/{name}") + @ExpectedResponses({ 202, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("name") String name, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listBySubscriptionNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroupNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); + } + + /** + * List S3BucketPolicy resources by subscription ID. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a S3BucketPolicy list operation along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync() { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List S3BucketPolicy resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a S3BucketPolicy list operation along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), accept, + context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * List S3BucketPolicy resources by subscription ID. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a S3BucketPolicy list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>(() -> listSinglePageAsync(), + nextLink -> listBySubscriptionNextSinglePageAsync(nextLink)); + } + + /** + * List S3BucketPolicy resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a S3BucketPolicy list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(Context context) { + return new PagedFlux<>(() -> listSinglePageAsync(context), + nextLink -> listBySubscriptionNextSinglePageAsync(nextLink, context)); + } + + /** + * List S3BucketPolicy resources by subscription ID. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a S3BucketPolicy list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + return new PagedIterable<>(listAsync()); + } + + /** + * List S3BucketPolicy resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a S3BucketPolicy list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Context context) { + return new PagedIterable<>(listAsync(context)); + } + + /** + * List S3BucketPolicy resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a S3BucketPolicy list operation along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List S3BucketPolicy resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a S3BucketPolicy list operation along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * List S3BucketPolicy resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a S3BucketPolicy list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName) { + return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); + } + + /** + * List S3BucketPolicy resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a S3BucketPolicy list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName, Context context) { + return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName, context), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink, context)); + } + + /** + * List S3BucketPolicy resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a S3BucketPolicy list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName)); + } + + /** + * List S3BucketPolicy resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a S3BucketPolicy list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, context)); + } + + /** + * Get a S3BucketPolicy. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of S3BucketPolicy. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a S3BucketPolicy along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync(String resourceGroupName, + String name) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.getByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get a S3BucketPolicy. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of S3BucketPolicy. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a S3BucketPolicy along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync(String resourceGroupName, + String name, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.getByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, accept, context); + } + + /** + * Get a S3BucketPolicy. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of S3BucketPolicy. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a S3BucketPolicy on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getByResourceGroupAsync(String resourceGroupName, String name) { + return getByResourceGroupWithResponseAsync(resourceGroupName, name) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Get a S3BucketPolicy. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of S3BucketPolicy. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a S3BucketPolicy along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getByResourceGroupWithResponse(String resourceGroupName, String name, + Context context) { + return getByResourceGroupWithResponseAsync(resourceGroupName, name, context).block(); + } + + /** + * Get a S3BucketPolicy. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of S3BucketPolicy. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a S3BucketPolicy. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public S3BucketPolicyInner getByResourceGroup(String resourceGroupName, String name) { + return getByResourceGroupWithResponse(resourceGroupName, name, Context.NONE).getValue(); + } + + /** + * Create a S3BucketPolicy. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of S3BucketPolicy. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrReplaceWithResponseAsync(String resourceGroupName, String name, + S3BucketPolicyInner resource) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (resource == null) { + return Mono.error(new IllegalArgumentException("Parameter resource is required and cannot be null.")); + } else { + resource.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.createOrReplace(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, resource, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Create a S3BucketPolicy. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of S3BucketPolicy. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrReplaceWithResponseAsync(String resourceGroupName, String name, + S3BucketPolicyInner resource, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (resource == null) { + return Mono.error(new IllegalArgumentException("Parameter resource is required and cannot be null.")); + } else { + resource.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.createOrReplace(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, resource, accept, context); + } + + /** + * Create a S3BucketPolicy. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of S3BucketPolicy. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, S3BucketPolicyInner> + beginCreateOrReplaceAsync(String resourceGroupName, String name, S3BucketPolicyInner resource) { + Mono>> mono = createOrReplaceWithResponseAsync(resourceGroupName, name, resource); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + S3BucketPolicyInner.class, S3BucketPolicyInner.class, this.client.getContext()); + } + + /** + * Create a S3BucketPolicy. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of S3BucketPolicy. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, S3BucketPolicyInner> beginCreateOrReplaceAsync( + String resourceGroupName, String name, S3BucketPolicyInner resource, Context context) { + context = this.client.mergeContext(context); + Mono>> mono + = createOrReplaceWithResponseAsync(resourceGroupName, name, resource, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + S3BucketPolicyInner.class, S3BucketPolicyInner.class, context); + } + + /** + * Create a S3BucketPolicy. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of S3BucketPolicy. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, S3BucketPolicyInner> + beginCreateOrReplace(String resourceGroupName, String name, S3BucketPolicyInner resource) { + return this.beginCreateOrReplaceAsync(resourceGroupName, name, resource).getSyncPoller(); + } + + /** + * Create a S3BucketPolicy. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of S3BucketPolicy. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, S3BucketPolicyInner> + beginCreateOrReplace(String resourceGroupName, String name, S3BucketPolicyInner resource, Context context) { + return this.beginCreateOrReplaceAsync(resourceGroupName, name, resource, context).getSyncPoller(); + } + + /** + * Create a S3BucketPolicy. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of S3BucketPolicy. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrReplaceAsync(String resourceGroupName, String name, + S3BucketPolicyInner resource) { + return beginCreateOrReplaceAsync(resourceGroupName, name, resource).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create a S3BucketPolicy. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of S3BucketPolicy. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrReplaceAsync(String resourceGroupName, String name, + S3BucketPolicyInner resource, Context context) { + return beginCreateOrReplaceAsync(resourceGroupName, name, resource, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create a S3BucketPolicy. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of S3BucketPolicy. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public S3BucketPolicyInner createOrReplace(String resourceGroupName, String name, S3BucketPolicyInner resource) { + return createOrReplaceAsync(resourceGroupName, name, resource).block(); + } + + /** + * Create a S3BucketPolicy. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of S3BucketPolicy. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public S3BucketPolicyInner createOrReplace(String resourceGroupName, String name, S3BucketPolicyInner resource, + Context context) { + return createOrReplaceAsync(resourceGroupName, name, resource, context).block(); + } + + /** + * Update a S3BucketPolicy. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of S3BucketPolicy. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync(String resourceGroupName, String name, + S3BucketPolicyTagsUpdate properties) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (properties == null) { + return Mono.error(new IllegalArgumentException("Parameter properties is required and cannot be null.")); + } else { + properties.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.update(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, properties, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Update a S3BucketPolicy. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of S3BucketPolicy. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync(String resourceGroupName, String name, + S3BucketPolicyTagsUpdate properties, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (properties == null) { + return Mono.error(new IllegalArgumentException("Parameter properties is required and cannot be null.")); + } else { + properties.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.update(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, name, properties, accept, context); + } + + /** + * Update a S3BucketPolicy. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of S3BucketPolicy. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, S3BucketPolicyInner> beginUpdateAsync(String resourceGroupName, + String name, S3BucketPolicyTagsUpdate properties) { + Mono>> mono = updateWithResponseAsync(resourceGroupName, name, properties); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + S3BucketPolicyInner.class, S3BucketPolicyInner.class, this.client.getContext()); + } + + /** + * Update a S3BucketPolicy. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of S3BucketPolicy. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, S3BucketPolicyInner> beginUpdateAsync(String resourceGroupName, + String name, S3BucketPolicyTagsUpdate properties, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = updateWithResponseAsync(resourceGroupName, name, properties, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + S3BucketPolicyInner.class, S3BucketPolicyInner.class, context); + } + + /** + * Update a S3BucketPolicy. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of S3BucketPolicy. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, S3BucketPolicyInner> beginUpdate(String resourceGroupName, + String name, S3BucketPolicyTagsUpdate properties) { + return this.beginUpdateAsync(resourceGroupName, name, properties).getSyncPoller(); + } + + /** + * Update a S3BucketPolicy. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of S3BucketPolicy. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, S3BucketPolicyInner> beginUpdate(String resourceGroupName, + String name, S3BucketPolicyTagsUpdate properties, Context context) { + return this.beginUpdateAsync(resourceGroupName, name, properties, context).getSyncPoller(); + } + + /** + * Update a S3BucketPolicy. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of S3BucketPolicy. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync(String resourceGroupName, String name, + S3BucketPolicyTagsUpdate properties) { + return beginUpdateAsync(resourceGroupName, name, properties).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Update a S3BucketPolicy. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of S3BucketPolicy. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync(String resourceGroupName, String name, + S3BucketPolicyTagsUpdate properties, Context context) { + return beginUpdateAsync(resourceGroupName, name, properties, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Update a S3BucketPolicy. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of S3BucketPolicy. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public S3BucketPolicyInner update(String resourceGroupName, String name, S3BucketPolicyTagsUpdate properties) { + return updateAsync(resourceGroupName, name, properties).block(); + } + + /** + * Update a S3BucketPolicy. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of S3BucketPolicy. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public S3BucketPolicyInner update(String resourceGroupName, String name, S3BucketPolicyTagsUpdate properties, + Context context) { + return updateAsync(resourceGroupName, name, properties, context).block(); + } + + /** + * Delete a S3BucketPolicy. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of S3BucketPolicy. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync(String resourceGroupName, String name) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Delete a S3BucketPolicy. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of S3BucketPolicy. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync(String resourceGroupName, String name, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.delete(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, name, accept, context); + } + + /** + * Delete a S3BucketPolicy. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of S3BucketPolicy. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String name) { + Mono>> mono = deleteWithResponseAsync(resourceGroupName, name); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); + } + + /** + * Delete a S3BucketPolicy. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of S3BucketPolicy. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String name, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = deleteWithResponseAsync(resourceGroupName, name, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + context); + } + + /** + * Delete a S3BucketPolicy. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of S3BucketPolicy. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String name) { + return this.beginDeleteAsync(resourceGroupName, name).getSyncPoller(); + } + + /** + * Delete a S3BucketPolicy. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of S3BucketPolicy. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String name, Context context) { + return this.beginDeleteAsync(resourceGroupName, name, context).getSyncPoller(); + } + + /** + * Delete a S3BucketPolicy. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of S3BucketPolicy. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String name) { + return beginDeleteAsync(resourceGroupName, name).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete a S3BucketPolicy. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of S3BucketPolicy. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String name, Context context) { + return beginDeleteAsync(resourceGroupName, name, context).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete a S3BucketPolicy. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of S3BucketPolicy. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String name) { + deleteAsync(resourceGroupName, name).block(); + } + + /** + * Delete a S3BucketPolicy. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of S3BucketPolicy. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String name, Context context) { + deleteAsync(resourceGroupName, name, context).block(); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a S3BucketPolicy list operation along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listBySubscriptionNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a S3BucketPolicy list operation along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listBySubscriptionNextSinglePageAsync(String nextLink, + Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a S3BucketPolicy list operation along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a S3BucketPolicy list operation along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupNextSinglePageAsync(String nextLink, + Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/S3BucketPoliciesImpl.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/S3BucketPoliciesImpl.java new file mode 100644 index 000000000000..c718eaa5e041 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/S3BucketPoliciesImpl.java @@ -0,0 +1,146 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.awsconnector.fluent.S3BucketPoliciesClient; +import com.azure.resourcemanager.awsconnector.fluent.models.S3BucketPolicyInner; +import com.azure.resourcemanager.awsconnector.models.S3BucketPolicies; +import com.azure.resourcemanager.awsconnector.models.S3BucketPolicy; + +public final class S3BucketPoliciesImpl implements S3BucketPolicies { + private static final ClientLogger LOGGER = new ClientLogger(S3BucketPoliciesImpl.class); + + private final S3BucketPoliciesClient innerClient; + + private final com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager; + + public S3BucketPoliciesImpl(S3BucketPoliciesClient innerClient, + com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return ResourceManagerUtils.mapPage(inner, inner1 -> new S3BucketPolicyImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new S3BucketPolicyImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName); + return ResourceManagerUtils.mapPage(inner, inner1 -> new S3BucketPolicyImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new S3BucketPolicyImpl(inner1, this.manager())); + } + + public Response getByResourceGroupWithResponse(String resourceGroupName, String name, + Context context) { + Response inner + = this.serviceClient().getByResourceGroupWithResponse(resourceGroupName, name, context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new S3BucketPolicyImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public S3BucketPolicy getByResourceGroup(String resourceGroupName, String name) { + S3BucketPolicyInner inner = this.serviceClient().getByResourceGroup(resourceGroupName, name); + if (inner != null) { + return new S3BucketPolicyImpl(inner, this.manager()); + } else { + return null; + } + } + + public void deleteByResourceGroup(String resourceGroupName, String name) { + this.serviceClient().delete(resourceGroupName, name); + } + + public void delete(String resourceGroupName, String name, Context context) { + this.serviceClient().delete(resourceGroupName, name, context); + } + + public S3BucketPolicy getById(String id) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String name = ResourceManagerUtils.getValueFromIdByName(id, "s3BucketPolicies"); + if (name == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 's3BucketPolicies'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, name, Context.NONE).getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String name = ResourceManagerUtils.getValueFromIdByName(id, "s3BucketPolicies"); + if (name == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 's3BucketPolicies'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, name, context); + } + + public void deleteById(String id) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String name = ResourceManagerUtils.getValueFromIdByName(id, "s3BucketPolicies"); + if (name == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 's3BucketPolicies'.", id))); + } + this.delete(resourceGroupName, name, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String name = ResourceManagerUtils.getValueFromIdByName(id, "s3BucketPolicies"); + if (name == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 's3BucketPolicies'.", id))); + } + this.delete(resourceGroupName, name, context); + } + + private S3BucketPoliciesClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.awsconnector.AwsconnectorManager manager() { + return this.serviceManager; + } + + public S3BucketPolicyImpl define(String name) { + return new S3BucketPolicyImpl(name, this.manager()); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/S3BucketPolicyImpl.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/S3BucketPolicyImpl.java new file mode 100644 index 000000000000..8fc667139b6d --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/S3BucketPolicyImpl.java @@ -0,0 +1,177 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.implementation; + +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.awsconnector.fluent.models.S3BucketPolicyInner; +import com.azure.resourcemanager.awsconnector.models.S3BucketPolicy; +import com.azure.resourcemanager.awsconnector.models.S3BucketPolicyProperties; +import com.azure.resourcemanager.awsconnector.models.S3BucketPolicyTagsUpdate; +import java.util.Collections; +import java.util.Map; + +public final class S3BucketPolicyImpl implements S3BucketPolicy, S3BucketPolicy.Definition, S3BucketPolicy.Update { + private S3BucketPolicyInner innerObject; + + private final com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public String location() { + return this.innerModel().location(); + } + + public Map tags() { + Map inner = this.innerModel().tags(); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } + } + + public S3BucketPolicyProperties properties() { + return this.innerModel().properties(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public String resourceGroupName() { + return resourceGroupName; + } + + public S3BucketPolicyInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.awsconnector.AwsconnectorManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String name; + + private S3BucketPolicyTagsUpdate updateProperties; + + public S3BucketPolicyImpl withExistingResourceGroup(String resourceGroupName) { + this.resourceGroupName = resourceGroupName; + return this; + } + + public S3BucketPolicy create() { + this.innerObject = serviceManager.serviceClient() + .getS3BucketPolicies() + .createOrReplace(resourceGroupName, name, this.innerModel(), Context.NONE); + return this; + } + + public S3BucketPolicy create(Context context) { + this.innerObject = serviceManager.serviceClient() + .getS3BucketPolicies() + .createOrReplace(resourceGroupName, name, this.innerModel(), context); + return this; + } + + S3BucketPolicyImpl(String name, com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager) { + this.innerObject = new S3BucketPolicyInner(); + this.serviceManager = serviceManager; + this.name = name; + } + + public S3BucketPolicyImpl update() { + this.updateProperties = new S3BucketPolicyTagsUpdate(); + return this; + } + + public S3BucketPolicy apply() { + this.innerObject = serviceManager.serviceClient() + .getS3BucketPolicies() + .update(resourceGroupName, name, updateProperties, Context.NONE); + return this; + } + + public S3BucketPolicy apply(Context context) { + this.innerObject = serviceManager.serviceClient() + .getS3BucketPolicies() + .update(resourceGroupName, name, updateProperties, context); + return this; + } + + S3BucketPolicyImpl(S3BucketPolicyInner innerObject, + com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.name = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "s3BucketPolicies"); + } + + public S3BucketPolicy refresh() { + this.innerObject = serviceManager.serviceClient() + .getS3BucketPolicies() + .getByResourceGroupWithResponse(resourceGroupName, name, Context.NONE) + .getValue(); + return this; + } + + public S3BucketPolicy refresh(Context context) { + this.innerObject = serviceManager.serviceClient() + .getS3BucketPolicies() + .getByResourceGroupWithResponse(resourceGroupName, name, context) + .getValue(); + return this; + } + + public S3BucketPolicyImpl withRegion(Region location) { + this.innerModel().withLocation(location.toString()); + return this; + } + + public S3BucketPolicyImpl withRegion(String location) { + this.innerModel().withLocation(location); + return this; + } + + public S3BucketPolicyImpl withTags(Map tags) { + if (isInCreateMode()) { + this.innerModel().withTags(tags); + return this; + } else { + this.updateProperties.withTags(tags); + return this; + } + } + + public S3BucketPolicyImpl withProperties(S3BucketPolicyProperties properties) { + this.innerModel().withProperties(properties); + return this; + } + + private boolean isInCreateMode() { + return this.innerModel().id() == null; + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/S3BucketsClientImpl.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/S3BucketsClientImpl.java new file mode 100644 index 000000000000..3b438bd937c1 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/S3BucketsClientImpl.java @@ -0,0 +1,1273 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.Patch; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.awsconnector.fluent.S3BucketsClient; +import com.azure.resourcemanager.awsconnector.fluent.models.S3BucketInner; +import com.azure.resourcemanager.awsconnector.models.S3BucketListResult; +import com.azure.resourcemanager.awsconnector.models.S3BucketTagsUpdate; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in S3BucketsClient. + */ +public final class S3BucketsClientImpl implements S3BucketsClient { + /** + * The proxy service used to perform REST calls. + */ + private final S3BucketsService service; + + /** + * The service client containing this operation class. + */ + private final MicrosoftAwsConnectorImpl client; + + /** + * Initializes an instance of S3BucketsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + S3BucketsClientImpl(MicrosoftAwsConnectorImpl client) { + this.service + = RestProxy.create(S3BucketsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for MicrosoftAwsConnectorS3Buckets to be used by the proxy service to + * perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "MicrosoftAwsConnecto") + public interface S3BucketsService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.AwsConnector/s3Buckets") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/s3Buckets") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroup(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/s3Buckets/{name}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getByResourceGroup(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("name") String name, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/s3Buckets/{name}") + @ExpectedResponses({ 200, 201 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrReplace(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("name") String name, + @BodyParam("application/json") S3BucketInner resource, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/s3Buckets/{name}") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> update(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("name") String name, + @BodyParam("application/json") S3BucketTagsUpdate properties, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/s3Buckets/{name}") + @ExpectedResponses({ 202, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("name") String name, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listBySubscriptionNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroupNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); + } + + /** + * List S3Bucket resources by subscription ID. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a S3Bucket list operation along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync() { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), + res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List S3Bucket resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a S3Bucket list operation along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), accept, + context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * List S3Bucket resources by subscription ID. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a S3Bucket list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>(() -> listSinglePageAsync(), + nextLink -> listBySubscriptionNextSinglePageAsync(nextLink)); + } + + /** + * List S3Bucket resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a S3Bucket list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(Context context) { + return new PagedFlux<>(() -> listSinglePageAsync(context), + nextLink -> listBySubscriptionNextSinglePageAsync(nextLink, context)); + } + + /** + * List S3Bucket resources by subscription ID. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a S3Bucket list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + return new PagedIterable<>(listAsync()); + } + + /** + * List S3Bucket resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a S3Bucket list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Context context) { + return new PagedIterable<>(listAsync(context)); + } + + /** + * List S3Bucket resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a S3Bucket list operation along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), + res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List S3Bucket resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a S3Bucket list operation along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * List S3Bucket resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a S3Bucket list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName) { + return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); + } + + /** + * List S3Bucket resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a S3Bucket list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName, Context context) { + return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName, context), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink, context)); + } + + /** + * List S3Bucket resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a S3Bucket list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName)); + } + + /** + * List S3Bucket resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a S3Bucket list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, context)); + } + + /** + * Get a S3Bucket. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of S3Bucket. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a S3Bucket along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync(String resourceGroupName, String name) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.getByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get a S3Bucket. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of S3Bucket. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a S3Bucket along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync(String resourceGroupName, String name, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.getByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, accept, context); + } + + /** + * Get a S3Bucket. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of S3Bucket. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a S3Bucket on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getByResourceGroupAsync(String resourceGroupName, String name) { + return getByResourceGroupWithResponseAsync(resourceGroupName, name) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Get a S3Bucket. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of S3Bucket. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a S3Bucket along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getByResourceGroupWithResponse(String resourceGroupName, String name, + Context context) { + return getByResourceGroupWithResponseAsync(resourceGroupName, name, context).block(); + } + + /** + * Get a S3Bucket. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of S3Bucket. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a S3Bucket. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public S3BucketInner getByResourceGroup(String resourceGroupName, String name) { + return getByResourceGroupWithResponse(resourceGroupName, name, Context.NONE).getValue(); + } + + /** + * Create a S3Bucket. Please note that end user resource creation is currently restricted, but it will be enabled in + * the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of S3Bucket. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrReplaceWithResponseAsync(String resourceGroupName, String name, + S3BucketInner resource) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (resource == null) { + return Mono.error(new IllegalArgumentException("Parameter resource is required and cannot be null.")); + } else { + resource.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.createOrReplace(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, resource, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Create a S3Bucket. Please note that end user resource creation is currently restricted, but it will be enabled in + * the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of S3Bucket. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrReplaceWithResponseAsync(String resourceGroupName, String name, + S3BucketInner resource, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (resource == null) { + return Mono.error(new IllegalArgumentException("Parameter resource is required and cannot be null.")); + } else { + resource.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.createOrReplace(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, resource, accept, context); + } + + /** + * Create a S3Bucket. Please note that end user resource creation is currently restricted, but it will be enabled in + * the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of S3Bucket. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, S3BucketInner> beginCreateOrReplaceAsync(String resourceGroupName, + String name, S3BucketInner resource) { + Mono>> mono = createOrReplaceWithResponseAsync(resourceGroupName, name, resource); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + S3BucketInner.class, S3BucketInner.class, this.client.getContext()); + } + + /** + * Create a S3Bucket. Please note that end user resource creation is currently restricted, but it will be enabled in + * the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of S3Bucket. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, S3BucketInner> beginCreateOrReplaceAsync(String resourceGroupName, + String name, S3BucketInner resource, Context context) { + context = this.client.mergeContext(context); + Mono>> mono + = createOrReplaceWithResponseAsync(resourceGroupName, name, resource, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + S3BucketInner.class, S3BucketInner.class, context); + } + + /** + * Create a S3Bucket. Please note that end user resource creation is currently restricted, but it will be enabled in + * the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of S3Bucket. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, S3BucketInner> beginCreateOrReplace(String resourceGroupName, + String name, S3BucketInner resource) { + return this.beginCreateOrReplaceAsync(resourceGroupName, name, resource).getSyncPoller(); + } + + /** + * Create a S3Bucket. Please note that end user resource creation is currently restricted, but it will be enabled in + * the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of S3Bucket. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, S3BucketInner> beginCreateOrReplace(String resourceGroupName, + String name, S3BucketInner resource, Context context) { + return this.beginCreateOrReplaceAsync(resourceGroupName, name, resource, context).getSyncPoller(); + } + + /** + * Create a S3Bucket. Please note that end user resource creation is currently restricted, but it will be enabled in + * the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of S3Bucket. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrReplaceAsync(String resourceGroupName, String name, S3BucketInner resource) { + return beginCreateOrReplaceAsync(resourceGroupName, name, resource).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create a S3Bucket. Please note that end user resource creation is currently restricted, but it will be enabled in + * the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of S3Bucket. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrReplaceAsync(String resourceGroupName, String name, S3BucketInner resource, + Context context) { + return beginCreateOrReplaceAsync(resourceGroupName, name, resource, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create a S3Bucket. Please note that end user resource creation is currently restricted, but it will be enabled in + * the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of S3Bucket. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public S3BucketInner createOrReplace(String resourceGroupName, String name, S3BucketInner resource) { + return createOrReplaceAsync(resourceGroupName, name, resource).block(); + } + + /** + * Create a S3Bucket. Please note that end user resource creation is currently restricted, but it will be enabled in + * the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of S3Bucket. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public S3BucketInner createOrReplace(String resourceGroupName, String name, S3BucketInner resource, + Context context) { + return createOrReplaceAsync(resourceGroupName, name, resource, context).block(); + } + + /** + * Update a S3Bucket. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of S3Bucket. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync(String resourceGroupName, String name, + S3BucketTagsUpdate properties) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (properties == null) { + return Mono.error(new IllegalArgumentException("Parameter properties is required and cannot be null.")); + } else { + properties.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.update(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, properties, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Update a S3Bucket. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of S3Bucket. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync(String resourceGroupName, String name, + S3BucketTagsUpdate properties, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (properties == null) { + return Mono.error(new IllegalArgumentException("Parameter properties is required and cannot be null.")); + } else { + properties.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.update(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, name, properties, accept, context); + } + + /** + * Update a S3Bucket. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of S3Bucket. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, S3BucketInner> beginUpdateAsync(String resourceGroupName, String name, + S3BucketTagsUpdate properties) { + Mono>> mono = updateWithResponseAsync(resourceGroupName, name, properties); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + S3BucketInner.class, S3BucketInner.class, this.client.getContext()); + } + + /** + * Update a S3Bucket. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of S3Bucket. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, S3BucketInner> beginUpdateAsync(String resourceGroupName, String name, + S3BucketTagsUpdate properties, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = updateWithResponseAsync(resourceGroupName, name, properties, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + S3BucketInner.class, S3BucketInner.class, context); + } + + /** + * Update a S3Bucket. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of S3Bucket. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, S3BucketInner> beginUpdate(String resourceGroupName, String name, + S3BucketTagsUpdate properties) { + return this.beginUpdateAsync(resourceGroupName, name, properties).getSyncPoller(); + } + + /** + * Update a S3Bucket. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of S3Bucket. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, S3BucketInner> beginUpdate(String resourceGroupName, String name, + S3BucketTagsUpdate properties, Context context) { + return this.beginUpdateAsync(resourceGroupName, name, properties, context).getSyncPoller(); + } + + /** + * Update a S3Bucket. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of S3Bucket. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync(String resourceGroupName, String name, S3BucketTagsUpdate properties) { + return beginUpdateAsync(resourceGroupName, name, properties).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Update a S3Bucket. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of S3Bucket. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync(String resourceGroupName, String name, S3BucketTagsUpdate properties, + Context context) { + return beginUpdateAsync(resourceGroupName, name, properties, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Update a S3Bucket. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of S3Bucket. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public S3BucketInner update(String resourceGroupName, String name, S3BucketTagsUpdate properties) { + return updateAsync(resourceGroupName, name, properties).block(); + } + + /** + * Update a S3Bucket. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of S3Bucket. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public S3BucketInner update(String resourceGroupName, String name, S3BucketTagsUpdate properties, Context context) { + return updateAsync(resourceGroupName, name, properties, context).block(); + } + + /** + * Delete a S3Bucket. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of S3Bucket. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync(String resourceGroupName, String name) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Delete a S3Bucket. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of S3Bucket. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync(String resourceGroupName, String name, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.delete(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, name, accept, context); + } + + /** + * Delete a S3Bucket. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of S3Bucket. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String name) { + Mono>> mono = deleteWithResponseAsync(resourceGroupName, name); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); + } + + /** + * Delete a S3Bucket. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of S3Bucket. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String name, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = deleteWithResponseAsync(resourceGroupName, name, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + context); + } + + /** + * Delete a S3Bucket. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of S3Bucket. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String name) { + return this.beginDeleteAsync(resourceGroupName, name).getSyncPoller(); + } + + /** + * Delete a S3Bucket. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of S3Bucket. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String name, Context context) { + return this.beginDeleteAsync(resourceGroupName, name, context).getSyncPoller(); + } + + /** + * Delete a S3Bucket. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of S3Bucket. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String name) { + return beginDeleteAsync(resourceGroupName, name).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete a S3Bucket. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of S3Bucket. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String name, Context context) { + return beginDeleteAsync(resourceGroupName, name, context).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete a S3Bucket. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of S3Bucket. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String name) { + deleteAsync(resourceGroupName, name).block(); + } + + /** + * Delete a S3Bucket. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of S3Bucket. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String name, Context context) { + deleteAsync(resourceGroupName, name, context).block(); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a S3Bucket list operation along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listBySubscriptionNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), + res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a S3Bucket list operation along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listBySubscriptionNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a S3Bucket list operation along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), + res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a S3Bucket list operation along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupNextSinglePageAsync(String nextLink, + Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/S3BucketsImpl.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/S3BucketsImpl.java new file mode 100644 index 000000000000..a19c4fa50f23 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/S3BucketsImpl.java @@ -0,0 +1,145 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.awsconnector.fluent.S3BucketsClient; +import com.azure.resourcemanager.awsconnector.fluent.models.S3BucketInner; +import com.azure.resourcemanager.awsconnector.models.S3Bucket; +import com.azure.resourcemanager.awsconnector.models.S3Buckets; + +public final class S3BucketsImpl implements S3Buckets { + private static final ClientLogger LOGGER = new ClientLogger(S3BucketsImpl.class); + + private final S3BucketsClient innerClient; + + private final com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager; + + public S3BucketsImpl(S3BucketsClient innerClient, + com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return ResourceManagerUtils.mapPage(inner, inner1 -> new S3BucketImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new S3BucketImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName); + return ResourceManagerUtils.mapPage(inner, inner1 -> new S3BucketImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new S3BucketImpl(inner1, this.manager())); + } + + public Response getByResourceGroupWithResponse(String resourceGroupName, String name, Context context) { + Response inner + = this.serviceClient().getByResourceGroupWithResponse(resourceGroupName, name, context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new S3BucketImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public S3Bucket getByResourceGroup(String resourceGroupName, String name) { + S3BucketInner inner = this.serviceClient().getByResourceGroup(resourceGroupName, name); + if (inner != null) { + return new S3BucketImpl(inner, this.manager()); + } else { + return null; + } + } + + public void deleteByResourceGroup(String resourceGroupName, String name) { + this.serviceClient().delete(resourceGroupName, name); + } + + public void delete(String resourceGroupName, String name, Context context) { + this.serviceClient().delete(resourceGroupName, name, context); + } + + public S3Bucket getById(String id) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String name = ResourceManagerUtils.getValueFromIdByName(id, "s3Buckets"); + if (name == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 's3Buckets'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, name, Context.NONE).getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String name = ResourceManagerUtils.getValueFromIdByName(id, "s3Buckets"); + if (name == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 's3Buckets'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, name, context); + } + + public void deleteById(String id) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String name = ResourceManagerUtils.getValueFromIdByName(id, "s3Buckets"); + if (name == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 's3Buckets'.", id))); + } + this.delete(resourceGroupName, name, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String name = ResourceManagerUtils.getValueFromIdByName(id, "s3Buckets"); + if (name == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 's3Buckets'.", id))); + } + this.delete(resourceGroupName, name, context); + } + + private S3BucketsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.awsconnector.AwsconnectorManager manager() { + return this.serviceManager; + } + + public S3BucketImpl define(String name) { + return new S3BucketImpl(name, this.manager()); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/S3ControlMultiRegionAccessPointPolicyDocumentImpl.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/S3ControlMultiRegionAccessPointPolicyDocumentImpl.java new file mode 100644 index 000000000000..d63261ba061f --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/S3ControlMultiRegionAccessPointPolicyDocumentImpl.java @@ -0,0 +1,182 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.implementation; + +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.awsconnector.fluent.models.S3ControlMultiRegionAccessPointPolicyDocumentInner; +import com.azure.resourcemanager.awsconnector.models.S3ControlMultiRegionAccessPointPolicyDocument; +import com.azure.resourcemanager.awsconnector.models.S3ControlMultiRegionAccessPointPolicyDocumentProperties; +import com.azure.resourcemanager.awsconnector.models.S3ControlMultiRegionAccessPointPolicyDocumentTagsUpdate; +import java.util.Collections; +import java.util.Map; + +public final class S3ControlMultiRegionAccessPointPolicyDocumentImpl + implements S3ControlMultiRegionAccessPointPolicyDocument, S3ControlMultiRegionAccessPointPolicyDocument.Definition, + S3ControlMultiRegionAccessPointPolicyDocument.Update { + private S3ControlMultiRegionAccessPointPolicyDocumentInner innerObject; + + private final com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public String location() { + return this.innerModel().location(); + } + + public Map tags() { + Map inner = this.innerModel().tags(); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } + } + + public S3ControlMultiRegionAccessPointPolicyDocumentProperties properties() { + return this.innerModel().properties(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public String resourceGroupName() { + return resourceGroupName; + } + + public S3ControlMultiRegionAccessPointPolicyDocumentInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.awsconnector.AwsconnectorManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String name; + + private S3ControlMultiRegionAccessPointPolicyDocumentTagsUpdate updateProperties; + + public S3ControlMultiRegionAccessPointPolicyDocumentImpl withExistingResourceGroup(String resourceGroupName) { + this.resourceGroupName = resourceGroupName; + return this; + } + + public S3ControlMultiRegionAccessPointPolicyDocument create() { + this.innerObject = serviceManager.serviceClient() + .getS3ControlMultiRegionAccessPointPolicyDocuments() + .createOrReplace(resourceGroupName, name, this.innerModel(), Context.NONE); + return this; + } + + public S3ControlMultiRegionAccessPointPolicyDocument create(Context context) { + this.innerObject = serviceManager.serviceClient() + .getS3ControlMultiRegionAccessPointPolicyDocuments() + .createOrReplace(resourceGroupName, name, this.innerModel(), context); + return this; + } + + S3ControlMultiRegionAccessPointPolicyDocumentImpl(String name, + com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager) { + this.innerObject = new S3ControlMultiRegionAccessPointPolicyDocumentInner(); + this.serviceManager = serviceManager; + this.name = name; + } + + public S3ControlMultiRegionAccessPointPolicyDocumentImpl update() { + this.updateProperties = new S3ControlMultiRegionAccessPointPolicyDocumentTagsUpdate(); + return this; + } + + public S3ControlMultiRegionAccessPointPolicyDocument apply() { + this.innerObject = serviceManager.serviceClient() + .getS3ControlMultiRegionAccessPointPolicyDocuments() + .update(resourceGroupName, name, updateProperties, Context.NONE); + return this; + } + + public S3ControlMultiRegionAccessPointPolicyDocument apply(Context context) { + this.innerObject = serviceManager.serviceClient() + .getS3ControlMultiRegionAccessPointPolicyDocuments() + .update(resourceGroupName, name, updateProperties, context); + return this; + } + + S3ControlMultiRegionAccessPointPolicyDocumentImpl(S3ControlMultiRegionAccessPointPolicyDocumentInner innerObject, + com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.name = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), + "s3ControlMultiRegionAccessPointPolicyDocuments"); + } + + public S3ControlMultiRegionAccessPointPolicyDocument refresh() { + this.innerObject = serviceManager.serviceClient() + .getS3ControlMultiRegionAccessPointPolicyDocuments() + .getByResourceGroupWithResponse(resourceGroupName, name, Context.NONE) + .getValue(); + return this; + } + + public S3ControlMultiRegionAccessPointPolicyDocument refresh(Context context) { + this.innerObject = serviceManager.serviceClient() + .getS3ControlMultiRegionAccessPointPolicyDocuments() + .getByResourceGroupWithResponse(resourceGroupName, name, context) + .getValue(); + return this; + } + + public S3ControlMultiRegionAccessPointPolicyDocumentImpl withRegion(Region location) { + this.innerModel().withLocation(location.toString()); + return this; + } + + public S3ControlMultiRegionAccessPointPolicyDocumentImpl withRegion(String location) { + this.innerModel().withLocation(location); + return this; + } + + public S3ControlMultiRegionAccessPointPolicyDocumentImpl withTags(Map tags) { + if (isInCreateMode()) { + this.innerModel().withTags(tags); + return this; + } else { + this.updateProperties.withTags(tags); + return this; + } + } + + public S3ControlMultiRegionAccessPointPolicyDocumentImpl + withProperties(S3ControlMultiRegionAccessPointPolicyDocumentProperties properties) { + this.innerModel().withProperties(properties); + return this; + } + + private boolean isInCreateMode() { + return this.innerModel().id() == null; + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/S3ControlMultiRegionAccessPointPolicyDocumentsClientImpl.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/S3ControlMultiRegionAccessPointPolicyDocumentsClientImpl.java new file mode 100644 index 000000000000..4ef016eb9bb2 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/S3ControlMultiRegionAccessPointPolicyDocumentsClientImpl.java @@ -0,0 +1,1332 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.Patch; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.awsconnector.fluent.S3ControlMultiRegionAccessPointPolicyDocumentsClient; +import com.azure.resourcemanager.awsconnector.fluent.models.S3ControlMultiRegionAccessPointPolicyDocumentInner; +import com.azure.resourcemanager.awsconnector.models.S3ControlMultiRegionAccessPointPolicyDocumentListResult; +import com.azure.resourcemanager.awsconnector.models.S3ControlMultiRegionAccessPointPolicyDocumentTagsUpdate; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in + * S3ControlMultiRegionAccessPointPolicyDocumentsClient. + */ +public final class S3ControlMultiRegionAccessPointPolicyDocumentsClientImpl + implements S3ControlMultiRegionAccessPointPolicyDocumentsClient { + /** + * The proxy service used to perform REST calls. + */ + private final S3ControlMultiRegionAccessPointPolicyDocumentsService service; + + /** + * The service client containing this operation class. + */ + private final MicrosoftAwsConnectorImpl client; + + /** + * Initializes an instance of S3ControlMultiRegionAccessPointPolicyDocumentsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + S3ControlMultiRegionAccessPointPolicyDocumentsClientImpl(MicrosoftAwsConnectorImpl client) { + this.service = RestProxy.create(S3ControlMultiRegionAccessPointPolicyDocumentsService.class, + client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for MicrosoftAwsConnectorS3ControlMultiRegionAccessPointPolicyDocuments + * to be used by the proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "MicrosoftAwsConnecto") + public interface S3ControlMultiRegionAccessPointPolicyDocumentsService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.AwsConnector/s3ControlMultiRegionAccessPointPolicyDocuments") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/s3ControlMultiRegionAccessPointPolicyDocuments") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroup( + @HostParam("$host") String endpoint, @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/s3ControlMultiRegionAccessPointPolicyDocuments/{name}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getByResourceGroup( + @HostParam("$host") String endpoint, @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("name") String name, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/s3ControlMultiRegionAccessPointPolicyDocuments/{name}") + @ExpectedResponses({ 200, 201 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrReplace(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("name") String name, + @BodyParam("application/json") S3ControlMultiRegionAccessPointPolicyDocumentInner resource, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/s3ControlMultiRegionAccessPointPolicyDocuments/{name}") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> update(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("name") String name, + @BodyParam("application/json") S3ControlMultiRegionAccessPointPolicyDocumentTagsUpdate properties, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/s3ControlMultiRegionAccessPointPolicyDocuments/{name}") + @ExpectedResponses({ 202, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("name") String name, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listBySubscriptionNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroupNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); + } + + /** + * List S3ControlMultiRegionAccessPointPolicyDocument resources by subscription ID. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a S3ControlMultiRegionAccessPointPolicyDocument list operation along with + * {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync() { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), accept, context)) + .>map( + res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List S3ControlMultiRegionAccessPointPolicyDocument resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a S3ControlMultiRegionAccessPointPolicyDocument list operation along with + * {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> + listSinglePageAsync(Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), accept, + context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * List S3ControlMultiRegionAccessPointPolicyDocument resources by subscription ID. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a S3ControlMultiRegionAccessPointPolicyDocument list operation as paginated response with + * {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>(() -> listSinglePageAsync(), + nextLink -> listBySubscriptionNextSinglePageAsync(nextLink)); + } + + /** + * List S3ControlMultiRegionAccessPointPolicyDocument resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a S3ControlMultiRegionAccessPointPolicyDocument list operation as paginated response with + * {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(Context context) { + return new PagedFlux<>(() -> listSinglePageAsync(context), + nextLink -> listBySubscriptionNextSinglePageAsync(nextLink, context)); + } + + /** + * List S3ControlMultiRegionAccessPointPolicyDocument resources by subscription ID. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a S3ControlMultiRegionAccessPointPolicyDocument list operation as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + return new PagedIterable<>(listAsync()); + } + + /** + * List S3ControlMultiRegionAccessPointPolicyDocument resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a S3ControlMultiRegionAccessPointPolicyDocument list operation as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Context context) { + return new PagedIterable<>(listAsync(context)); + } + + /** + * List S3ControlMultiRegionAccessPointPolicyDocument resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a S3ControlMultiRegionAccessPointPolicyDocument list operation along with + * {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> + listByResourceGroupSinglePageAsync(String resourceGroupName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accept, context)) + .>map( + res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List S3ControlMultiRegionAccessPointPolicyDocument resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a S3ControlMultiRegionAccessPointPolicyDocument list operation along with + * {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> + listByResourceGroupSinglePageAsync(String resourceGroupName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * List S3ControlMultiRegionAccessPointPolicyDocument resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a S3ControlMultiRegionAccessPointPolicyDocument list operation as paginated response with + * {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux + listByResourceGroupAsync(String resourceGroupName) { + return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); + } + + /** + * List S3ControlMultiRegionAccessPointPolicyDocument resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a S3ControlMultiRegionAccessPointPolicyDocument list operation as paginated response with + * {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux + listByResourceGroupAsync(String resourceGroupName, Context context) { + return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName, context), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink, context)); + } + + /** + * List S3ControlMultiRegionAccessPointPolicyDocument resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a S3ControlMultiRegionAccessPointPolicyDocument list operation as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable + listByResourceGroup(String resourceGroupName) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName)); + } + + /** + * List S3ControlMultiRegionAccessPointPolicyDocument resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a S3ControlMultiRegionAccessPointPolicyDocument list operation as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable + listByResourceGroup(String resourceGroupName, Context context) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, context)); + } + + /** + * Get a S3ControlMultiRegionAccessPointPolicyDocument. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of S3ControlMultiRegionAccessPointPolicyDocument. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a S3ControlMultiRegionAccessPointPolicyDocument along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> + getByResourceGroupWithResponseAsync(String resourceGroupName, String name) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.getByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get a S3ControlMultiRegionAccessPointPolicyDocument. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of S3ControlMultiRegionAccessPointPolicyDocument. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a S3ControlMultiRegionAccessPointPolicyDocument along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> + getByResourceGroupWithResponseAsync(String resourceGroupName, String name, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.getByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, accept, context); + } + + /** + * Get a S3ControlMultiRegionAccessPointPolicyDocument. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of S3ControlMultiRegionAccessPointPolicyDocument. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a S3ControlMultiRegionAccessPointPolicyDocument on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getByResourceGroupAsync(String resourceGroupName, + String name) { + return getByResourceGroupWithResponseAsync(resourceGroupName, name) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Get a S3ControlMultiRegionAccessPointPolicyDocument. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of S3ControlMultiRegionAccessPointPolicyDocument. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a S3ControlMultiRegionAccessPointPolicyDocument along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response + getByResourceGroupWithResponse(String resourceGroupName, String name, Context context) { + return getByResourceGroupWithResponseAsync(resourceGroupName, name, context).block(); + } + + /** + * Get a S3ControlMultiRegionAccessPointPolicyDocument. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of S3ControlMultiRegionAccessPointPolicyDocument. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a S3ControlMultiRegionAccessPointPolicyDocument. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public S3ControlMultiRegionAccessPointPolicyDocumentInner getByResourceGroup(String resourceGroupName, + String name) { + return getByResourceGroupWithResponse(resourceGroupName, name, Context.NONE).getValue(); + } + + /** + * Create a S3ControlMultiRegionAccessPointPolicyDocument. Please note that end user resource creation is currently + * restricted, but it will be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of S3ControlMultiRegionAccessPointPolicyDocument. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrReplaceWithResponseAsync(String resourceGroupName, String name, + S3ControlMultiRegionAccessPointPolicyDocumentInner resource) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (resource == null) { + return Mono.error(new IllegalArgumentException("Parameter resource is required and cannot be null.")); + } else { + resource.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.createOrReplace(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, resource, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Create a S3ControlMultiRegionAccessPointPolicyDocument. Please note that end user resource creation is currently + * restricted, but it will be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of S3ControlMultiRegionAccessPointPolicyDocument. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrReplaceWithResponseAsync(String resourceGroupName, String name, + S3ControlMultiRegionAccessPointPolicyDocumentInner resource, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (resource == null) { + return Mono.error(new IllegalArgumentException("Parameter resource is required and cannot be null.")); + } else { + resource.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.createOrReplace(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, resource, accept, context); + } + + /** + * Create a S3ControlMultiRegionAccessPointPolicyDocument. Please note that end user resource creation is currently + * restricted, but it will be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of S3ControlMultiRegionAccessPointPolicyDocument. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private + PollerFlux, S3ControlMultiRegionAccessPointPolicyDocumentInner> + beginCreateOrReplaceAsync(String resourceGroupName, String name, + S3ControlMultiRegionAccessPointPolicyDocumentInner resource) { + Mono>> mono = createOrReplaceWithResponseAsync(resourceGroupName, name, resource); + return this.client + .getLroResult( + mono, this.client.getHttpPipeline(), S3ControlMultiRegionAccessPointPolicyDocumentInner.class, + S3ControlMultiRegionAccessPointPolicyDocumentInner.class, this.client.getContext()); + } + + /** + * Create a S3ControlMultiRegionAccessPointPolicyDocument. Please note that end user resource creation is currently + * restricted, but it will be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of S3ControlMultiRegionAccessPointPolicyDocument. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private + PollerFlux, S3ControlMultiRegionAccessPointPolicyDocumentInner> + beginCreateOrReplaceAsync(String resourceGroupName, String name, + S3ControlMultiRegionAccessPointPolicyDocumentInner resource, Context context) { + context = this.client.mergeContext(context); + Mono>> mono + = createOrReplaceWithResponseAsync(resourceGroupName, name, resource, context); + return this.client + .getLroResult( + mono, this.client.getHttpPipeline(), S3ControlMultiRegionAccessPointPolicyDocumentInner.class, + S3ControlMultiRegionAccessPointPolicyDocumentInner.class, context); + } + + /** + * Create a S3ControlMultiRegionAccessPointPolicyDocument. Please note that end user resource creation is currently + * restricted, but it will be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of S3ControlMultiRegionAccessPointPolicyDocument. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public + SyncPoller, S3ControlMultiRegionAccessPointPolicyDocumentInner> + beginCreateOrReplace(String resourceGroupName, String name, + S3ControlMultiRegionAccessPointPolicyDocumentInner resource) { + return this.beginCreateOrReplaceAsync(resourceGroupName, name, resource).getSyncPoller(); + } + + /** + * Create a S3ControlMultiRegionAccessPointPolicyDocument. Please note that end user resource creation is currently + * restricted, but it will be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of S3ControlMultiRegionAccessPointPolicyDocument. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public + SyncPoller, S3ControlMultiRegionAccessPointPolicyDocumentInner> + beginCreateOrReplace(String resourceGroupName, String name, + S3ControlMultiRegionAccessPointPolicyDocumentInner resource, Context context) { + return this.beginCreateOrReplaceAsync(resourceGroupName, name, resource, context).getSyncPoller(); + } + + /** + * Create a S3ControlMultiRegionAccessPointPolicyDocument. Please note that end user resource creation is currently + * restricted, but it will be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of S3ControlMultiRegionAccessPointPolicyDocument. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrReplaceAsync(String resourceGroupName, + String name, S3ControlMultiRegionAccessPointPolicyDocumentInner resource) { + return beginCreateOrReplaceAsync(resourceGroupName, name, resource).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create a S3ControlMultiRegionAccessPointPolicyDocument. Please note that end user resource creation is currently + * restricted, but it will be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of S3ControlMultiRegionAccessPointPolicyDocument. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrReplaceAsync(String resourceGroupName, + String name, S3ControlMultiRegionAccessPointPolicyDocumentInner resource, Context context) { + return beginCreateOrReplaceAsync(resourceGroupName, name, resource, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create a S3ControlMultiRegionAccessPointPolicyDocument. Please note that end user resource creation is currently + * restricted, but it will be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of S3ControlMultiRegionAccessPointPolicyDocument. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public S3ControlMultiRegionAccessPointPolicyDocumentInner createOrReplace(String resourceGroupName, String name, + S3ControlMultiRegionAccessPointPolicyDocumentInner resource) { + return createOrReplaceAsync(resourceGroupName, name, resource).block(); + } + + /** + * Create a S3ControlMultiRegionAccessPointPolicyDocument. Please note that end user resource creation is currently + * restricted, but it will be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of S3ControlMultiRegionAccessPointPolicyDocument. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public S3ControlMultiRegionAccessPointPolicyDocumentInner createOrReplace(String resourceGroupName, String name, + S3ControlMultiRegionAccessPointPolicyDocumentInner resource, Context context) { + return createOrReplaceAsync(resourceGroupName, name, resource, context).block(); + } + + /** + * Update a S3ControlMultiRegionAccessPointPolicyDocument. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of S3ControlMultiRegionAccessPointPolicyDocument. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync(String resourceGroupName, String name, + S3ControlMultiRegionAccessPointPolicyDocumentTagsUpdate properties) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (properties == null) { + return Mono.error(new IllegalArgumentException("Parameter properties is required and cannot be null.")); + } else { + properties.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.update(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, properties, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Update a S3ControlMultiRegionAccessPointPolicyDocument. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of S3ControlMultiRegionAccessPointPolicyDocument. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync(String resourceGroupName, String name, + S3ControlMultiRegionAccessPointPolicyDocumentTagsUpdate properties, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (properties == null) { + return Mono.error(new IllegalArgumentException("Parameter properties is required and cannot be null.")); + } else { + properties.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.update(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, name, properties, accept, context); + } + + /** + * Update a S3ControlMultiRegionAccessPointPolicyDocument. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of S3ControlMultiRegionAccessPointPolicyDocument. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private + PollerFlux, S3ControlMultiRegionAccessPointPolicyDocumentInner> + beginUpdateAsync(String resourceGroupName, String name, + S3ControlMultiRegionAccessPointPolicyDocumentTagsUpdate properties) { + Mono>> mono = updateWithResponseAsync(resourceGroupName, name, properties); + return this.client + .getLroResult( + mono, this.client.getHttpPipeline(), S3ControlMultiRegionAccessPointPolicyDocumentInner.class, + S3ControlMultiRegionAccessPointPolicyDocumentInner.class, this.client.getContext()); + } + + /** + * Update a S3ControlMultiRegionAccessPointPolicyDocument. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of S3ControlMultiRegionAccessPointPolicyDocument. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private + PollerFlux, S3ControlMultiRegionAccessPointPolicyDocumentInner> + beginUpdateAsync(String resourceGroupName, String name, + S3ControlMultiRegionAccessPointPolicyDocumentTagsUpdate properties, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = updateWithResponseAsync(resourceGroupName, name, properties, context); + return this.client + .getLroResult( + mono, this.client.getHttpPipeline(), S3ControlMultiRegionAccessPointPolicyDocumentInner.class, + S3ControlMultiRegionAccessPointPolicyDocumentInner.class, context); + } + + /** + * Update a S3ControlMultiRegionAccessPointPolicyDocument. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of S3ControlMultiRegionAccessPointPolicyDocument. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public + SyncPoller, S3ControlMultiRegionAccessPointPolicyDocumentInner> + beginUpdate(String resourceGroupName, String name, + S3ControlMultiRegionAccessPointPolicyDocumentTagsUpdate properties) { + return this.beginUpdateAsync(resourceGroupName, name, properties).getSyncPoller(); + } + + /** + * Update a S3ControlMultiRegionAccessPointPolicyDocument. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of S3ControlMultiRegionAccessPointPolicyDocument. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public + SyncPoller, S3ControlMultiRegionAccessPointPolicyDocumentInner> + beginUpdate(String resourceGroupName, String name, + S3ControlMultiRegionAccessPointPolicyDocumentTagsUpdate properties, Context context) { + return this.beginUpdateAsync(resourceGroupName, name, properties, context).getSyncPoller(); + } + + /** + * Update a S3ControlMultiRegionAccessPointPolicyDocument. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of S3ControlMultiRegionAccessPointPolicyDocument. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync(String resourceGroupName, String name, + S3ControlMultiRegionAccessPointPolicyDocumentTagsUpdate properties) { + return beginUpdateAsync(resourceGroupName, name, properties).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Update a S3ControlMultiRegionAccessPointPolicyDocument. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of S3ControlMultiRegionAccessPointPolicyDocument. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync(String resourceGroupName, String name, + S3ControlMultiRegionAccessPointPolicyDocumentTagsUpdate properties, Context context) { + return beginUpdateAsync(resourceGroupName, name, properties, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Update a S3ControlMultiRegionAccessPointPolicyDocument. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of S3ControlMultiRegionAccessPointPolicyDocument. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public S3ControlMultiRegionAccessPointPolicyDocumentInner update(String resourceGroupName, String name, + S3ControlMultiRegionAccessPointPolicyDocumentTagsUpdate properties) { + return updateAsync(resourceGroupName, name, properties).block(); + } + + /** + * Update a S3ControlMultiRegionAccessPointPolicyDocument. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of S3ControlMultiRegionAccessPointPolicyDocument. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public S3ControlMultiRegionAccessPointPolicyDocumentInner update(String resourceGroupName, String name, + S3ControlMultiRegionAccessPointPolicyDocumentTagsUpdate properties, Context context) { + return updateAsync(resourceGroupName, name, properties, context).block(); + } + + /** + * Delete a S3ControlMultiRegionAccessPointPolicyDocument. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of S3ControlMultiRegionAccessPointPolicyDocument. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync(String resourceGroupName, String name) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Delete a S3ControlMultiRegionAccessPointPolicyDocument. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of S3ControlMultiRegionAccessPointPolicyDocument. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync(String resourceGroupName, String name, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.delete(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, name, accept, context); + } + + /** + * Delete a S3ControlMultiRegionAccessPointPolicyDocument. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of S3ControlMultiRegionAccessPointPolicyDocument. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String name) { + Mono>> mono = deleteWithResponseAsync(resourceGroupName, name); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); + } + + /** + * Delete a S3ControlMultiRegionAccessPointPolicyDocument. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of S3ControlMultiRegionAccessPointPolicyDocument. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String name, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = deleteWithResponseAsync(resourceGroupName, name, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + context); + } + + /** + * Delete a S3ControlMultiRegionAccessPointPolicyDocument. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of S3ControlMultiRegionAccessPointPolicyDocument. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String name) { + return this.beginDeleteAsync(resourceGroupName, name).getSyncPoller(); + } + + /** + * Delete a S3ControlMultiRegionAccessPointPolicyDocument. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of S3ControlMultiRegionAccessPointPolicyDocument. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String name, Context context) { + return this.beginDeleteAsync(resourceGroupName, name, context).getSyncPoller(); + } + + /** + * Delete a S3ControlMultiRegionAccessPointPolicyDocument. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of S3ControlMultiRegionAccessPointPolicyDocument. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String name) { + return beginDeleteAsync(resourceGroupName, name).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete a S3ControlMultiRegionAccessPointPolicyDocument. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of S3ControlMultiRegionAccessPointPolicyDocument. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String name, Context context) { + return beginDeleteAsync(resourceGroupName, name, context).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete a S3ControlMultiRegionAccessPointPolicyDocument. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of S3ControlMultiRegionAccessPointPolicyDocument. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String name) { + deleteAsync(resourceGroupName, name).block(); + } + + /** + * Delete a S3ControlMultiRegionAccessPointPolicyDocument. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of S3ControlMultiRegionAccessPointPolicyDocument. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String name, Context context) { + deleteAsync(resourceGroupName, name, context).block(); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a S3ControlMultiRegionAccessPointPolicyDocument list operation along with + * {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> + listBySubscriptionNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a S3ControlMultiRegionAccessPointPolicyDocument list operation along with + * {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> + listBySubscriptionNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a S3ControlMultiRegionAccessPointPolicyDocument list operation along with + * {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> + listByResourceGroupNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a S3ControlMultiRegionAccessPointPolicyDocument list operation along with + * {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> + listByResourceGroupNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/S3ControlMultiRegionAccessPointPolicyDocumentsImpl.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/S3ControlMultiRegionAccessPointPolicyDocumentsImpl.java new file mode 100644 index 000000000000..e3db0a0a8916 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/S3ControlMultiRegionAccessPointPolicyDocumentsImpl.java @@ -0,0 +1,161 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.awsconnector.fluent.S3ControlMultiRegionAccessPointPolicyDocumentsClient; +import com.azure.resourcemanager.awsconnector.fluent.models.S3ControlMultiRegionAccessPointPolicyDocumentInner; +import com.azure.resourcemanager.awsconnector.models.S3ControlMultiRegionAccessPointPolicyDocument; +import com.azure.resourcemanager.awsconnector.models.S3ControlMultiRegionAccessPointPolicyDocuments; + +public final class S3ControlMultiRegionAccessPointPolicyDocumentsImpl + implements S3ControlMultiRegionAccessPointPolicyDocuments { + private static final ClientLogger LOGGER + = new ClientLogger(S3ControlMultiRegionAccessPointPolicyDocumentsImpl.class); + + private final S3ControlMultiRegionAccessPointPolicyDocumentsClient innerClient; + + private final com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager; + + public S3ControlMultiRegionAccessPointPolicyDocumentsImpl( + S3ControlMultiRegionAccessPointPolicyDocumentsClient innerClient, + com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return ResourceManagerUtils.mapPage(inner, + inner1 -> new S3ControlMultiRegionAccessPointPolicyDocumentImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return ResourceManagerUtils.mapPage(inner, + inner1 -> new S3ControlMultiRegionAccessPointPolicyDocumentImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName) { + PagedIterable inner + = this.serviceClient().listByResourceGroup(resourceGroupName); + return ResourceManagerUtils.mapPage(inner, + inner1 -> new S3ControlMultiRegionAccessPointPolicyDocumentImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName, + Context context) { + PagedIterable inner + = this.serviceClient().listByResourceGroup(resourceGroupName, context); + return ResourceManagerUtils.mapPage(inner, + inner1 -> new S3ControlMultiRegionAccessPointPolicyDocumentImpl(inner1, this.manager())); + } + + public Response + getByResourceGroupWithResponse(String resourceGroupName, String name, Context context) { + Response inner + = this.serviceClient().getByResourceGroupWithResponse(resourceGroupName, name, context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new S3ControlMultiRegionAccessPointPolicyDocumentImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public S3ControlMultiRegionAccessPointPolicyDocument getByResourceGroup(String resourceGroupName, String name) { + S3ControlMultiRegionAccessPointPolicyDocumentInner inner + = this.serviceClient().getByResourceGroup(resourceGroupName, name); + if (inner != null) { + return new S3ControlMultiRegionAccessPointPolicyDocumentImpl(inner, this.manager()); + } else { + return null; + } + } + + public void deleteByResourceGroup(String resourceGroupName, String name) { + this.serviceClient().delete(resourceGroupName, name); + } + + public void delete(String resourceGroupName, String name, Context context) { + this.serviceClient().delete(resourceGroupName, name, context); + } + + public S3ControlMultiRegionAccessPointPolicyDocument getById(String id) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String name = ResourceManagerUtils.getValueFromIdByName(id, "s3ControlMultiRegionAccessPointPolicyDocuments"); + if (name == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException(String.format( + "The resource ID '%s' is not valid. Missing path segment 's3ControlMultiRegionAccessPointPolicyDocuments'.", + id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, name, Context.NONE).getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String name = ResourceManagerUtils.getValueFromIdByName(id, "s3ControlMultiRegionAccessPointPolicyDocuments"); + if (name == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException(String.format( + "The resource ID '%s' is not valid. Missing path segment 's3ControlMultiRegionAccessPointPolicyDocuments'.", + id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, name, context); + } + + public void deleteById(String id) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String name = ResourceManagerUtils.getValueFromIdByName(id, "s3ControlMultiRegionAccessPointPolicyDocuments"); + if (name == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException(String.format( + "The resource ID '%s' is not valid. Missing path segment 's3ControlMultiRegionAccessPointPolicyDocuments'.", + id))); + } + this.delete(resourceGroupName, name, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String name = ResourceManagerUtils.getValueFromIdByName(id, "s3ControlMultiRegionAccessPointPolicyDocuments"); + if (name == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException(String.format( + "The resource ID '%s' is not valid. Missing path segment 's3ControlMultiRegionAccessPointPolicyDocuments'.", + id))); + } + this.delete(resourceGroupName, name, context); + } + + private S3ControlMultiRegionAccessPointPolicyDocumentsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.awsconnector.AwsconnectorManager manager() { + return this.serviceManager; + } + + public S3ControlMultiRegionAccessPointPolicyDocumentImpl define(String name) { + return new S3ControlMultiRegionAccessPointPolicyDocumentImpl(name, this.manager()); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/SageMakerAppImpl.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/SageMakerAppImpl.java new file mode 100644 index 000000000000..4be052c42a23 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/SageMakerAppImpl.java @@ -0,0 +1,177 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.implementation; + +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.awsconnector.fluent.models.SageMakerAppInner; +import com.azure.resourcemanager.awsconnector.models.SageMakerApp; +import com.azure.resourcemanager.awsconnector.models.SageMakerAppProperties; +import com.azure.resourcemanager.awsconnector.models.SageMakerAppTagsUpdate; +import java.util.Collections; +import java.util.Map; + +public final class SageMakerAppImpl implements SageMakerApp, SageMakerApp.Definition, SageMakerApp.Update { + private SageMakerAppInner innerObject; + + private final com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public String location() { + return this.innerModel().location(); + } + + public Map tags() { + Map inner = this.innerModel().tags(); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } + } + + public SageMakerAppProperties properties() { + return this.innerModel().properties(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public String resourceGroupName() { + return resourceGroupName; + } + + public SageMakerAppInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.awsconnector.AwsconnectorManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String name; + + private SageMakerAppTagsUpdate updateProperties; + + public SageMakerAppImpl withExistingResourceGroup(String resourceGroupName) { + this.resourceGroupName = resourceGroupName; + return this; + } + + public SageMakerApp create() { + this.innerObject = serviceManager.serviceClient() + .getSageMakerApps() + .createOrReplace(resourceGroupName, name, this.innerModel(), Context.NONE); + return this; + } + + public SageMakerApp create(Context context) { + this.innerObject = serviceManager.serviceClient() + .getSageMakerApps() + .createOrReplace(resourceGroupName, name, this.innerModel(), context); + return this; + } + + SageMakerAppImpl(String name, com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager) { + this.innerObject = new SageMakerAppInner(); + this.serviceManager = serviceManager; + this.name = name; + } + + public SageMakerAppImpl update() { + this.updateProperties = new SageMakerAppTagsUpdate(); + return this; + } + + public SageMakerApp apply() { + this.innerObject = serviceManager.serviceClient() + .getSageMakerApps() + .update(resourceGroupName, name, updateProperties, Context.NONE); + return this; + } + + public SageMakerApp apply(Context context) { + this.innerObject = serviceManager.serviceClient() + .getSageMakerApps() + .update(resourceGroupName, name, updateProperties, context); + return this; + } + + SageMakerAppImpl(SageMakerAppInner innerObject, + com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.name = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "sageMakerApps"); + } + + public SageMakerApp refresh() { + this.innerObject = serviceManager.serviceClient() + .getSageMakerApps() + .getByResourceGroupWithResponse(resourceGroupName, name, Context.NONE) + .getValue(); + return this; + } + + public SageMakerApp refresh(Context context) { + this.innerObject = serviceManager.serviceClient() + .getSageMakerApps() + .getByResourceGroupWithResponse(resourceGroupName, name, context) + .getValue(); + return this; + } + + public SageMakerAppImpl withRegion(Region location) { + this.innerModel().withLocation(location.toString()); + return this; + } + + public SageMakerAppImpl withRegion(String location) { + this.innerModel().withLocation(location); + return this; + } + + public SageMakerAppImpl withTags(Map tags) { + if (isInCreateMode()) { + this.innerModel().withTags(tags); + return this; + } else { + this.updateProperties.withTags(tags); + return this; + } + } + + public SageMakerAppImpl withProperties(SageMakerAppProperties properties) { + this.innerModel().withProperties(properties); + return this; + } + + private boolean isInCreateMode() { + return this.innerModel().id() == null; + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/SageMakerAppsClientImpl.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/SageMakerAppsClientImpl.java new file mode 100644 index 000000000000..80f919bd21bb --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/SageMakerAppsClientImpl.java @@ -0,0 +1,1278 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.Patch; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.awsconnector.fluent.SageMakerAppsClient; +import com.azure.resourcemanager.awsconnector.fluent.models.SageMakerAppInner; +import com.azure.resourcemanager.awsconnector.models.SageMakerAppListResult; +import com.azure.resourcemanager.awsconnector.models.SageMakerAppTagsUpdate; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in SageMakerAppsClient. + */ +public final class SageMakerAppsClientImpl implements SageMakerAppsClient { + /** + * The proxy service used to perform REST calls. + */ + private final SageMakerAppsService service; + + /** + * The service client containing this operation class. + */ + private final MicrosoftAwsConnectorImpl client; + + /** + * Initializes an instance of SageMakerAppsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + SageMakerAppsClientImpl(MicrosoftAwsConnectorImpl client) { + this.service + = RestProxy.create(SageMakerAppsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for MicrosoftAwsConnectorSageMakerApps to be used by the proxy service to + * perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "MicrosoftAwsConnecto") + public interface SageMakerAppsService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.AwsConnector/sageMakerApps") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/sageMakerApps") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroup(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/sageMakerApps/{name}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getByResourceGroup(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("name") String name, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/sageMakerApps/{name}") + @ExpectedResponses({ 200, 201 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrReplace(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("name") String name, + @BodyParam("application/json") SageMakerAppInner resource, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/sageMakerApps/{name}") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> update(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("name") String name, + @BodyParam("application/json") SageMakerAppTagsUpdate properties, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/sageMakerApps/{name}") + @ExpectedResponses({ 202, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("name") String name, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listBySubscriptionNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroupNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); + } + + /** + * List SageMakerApp resources by subscription ID. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a SageMakerApp list operation along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync() { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), + res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List SageMakerApp resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a SageMakerApp list operation along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), accept, + context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * List SageMakerApp resources by subscription ID. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a SageMakerApp list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>(() -> listSinglePageAsync(), + nextLink -> listBySubscriptionNextSinglePageAsync(nextLink)); + } + + /** + * List SageMakerApp resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a SageMakerApp list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(Context context) { + return new PagedFlux<>(() -> listSinglePageAsync(context), + nextLink -> listBySubscriptionNextSinglePageAsync(nextLink, context)); + } + + /** + * List SageMakerApp resources by subscription ID. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a SageMakerApp list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + return new PagedIterable<>(listAsync()); + } + + /** + * List SageMakerApp resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a SageMakerApp list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Context context) { + return new PagedIterable<>(listAsync(context)); + } + + /** + * List SageMakerApp resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a SageMakerApp list operation along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), + res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List SageMakerApp resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a SageMakerApp list operation along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * List SageMakerApp resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a SageMakerApp list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName) { + return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); + } + + /** + * List SageMakerApp resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a SageMakerApp list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName, Context context) { + return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName, context), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink, context)); + } + + /** + * List SageMakerApp resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a SageMakerApp list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName)); + } + + /** + * List SageMakerApp resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a SageMakerApp list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, context)); + } + + /** + * Get a SageMakerApp. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of SageMakerApp. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a SageMakerApp along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync(String resourceGroupName, + String name) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.getByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get a SageMakerApp. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of SageMakerApp. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a SageMakerApp along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync(String resourceGroupName, String name, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.getByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, accept, context); + } + + /** + * Get a SageMakerApp. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of SageMakerApp. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a SageMakerApp on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getByResourceGroupAsync(String resourceGroupName, String name) { + return getByResourceGroupWithResponseAsync(resourceGroupName, name) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Get a SageMakerApp. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of SageMakerApp. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a SageMakerApp along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getByResourceGroupWithResponse(String resourceGroupName, String name, + Context context) { + return getByResourceGroupWithResponseAsync(resourceGroupName, name, context).block(); + } + + /** + * Get a SageMakerApp. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of SageMakerApp. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a SageMakerApp. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SageMakerAppInner getByResourceGroup(String resourceGroupName, String name) { + return getByResourceGroupWithResponse(resourceGroupName, name, Context.NONE).getValue(); + } + + /** + * Create a SageMakerApp. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of SageMakerApp. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrReplaceWithResponseAsync(String resourceGroupName, String name, + SageMakerAppInner resource) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (resource == null) { + return Mono.error(new IllegalArgumentException("Parameter resource is required and cannot be null.")); + } else { + resource.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.createOrReplace(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, resource, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Create a SageMakerApp. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of SageMakerApp. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrReplaceWithResponseAsync(String resourceGroupName, String name, + SageMakerAppInner resource, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (resource == null) { + return Mono.error(new IllegalArgumentException("Parameter resource is required and cannot be null.")); + } else { + resource.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.createOrReplace(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, resource, accept, context); + } + + /** + * Create a SageMakerApp. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of SageMakerApp. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, SageMakerAppInner> + beginCreateOrReplaceAsync(String resourceGroupName, String name, SageMakerAppInner resource) { + Mono>> mono = createOrReplaceWithResponseAsync(resourceGroupName, name, resource); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + SageMakerAppInner.class, SageMakerAppInner.class, this.client.getContext()); + } + + /** + * Create a SageMakerApp. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of SageMakerApp. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, SageMakerAppInner> + beginCreateOrReplaceAsync(String resourceGroupName, String name, SageMakerAppInner resource, Context context) { + context = this.client.mergeContext(context); + Mono>> mono + = createOrReplaceWithResponseAsync(resourceGroupName, name, resource, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + SageMakerAppInner.class, SageMakerAppInner.class, context); + } + + /** + * Create a SageMakerApp. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of SageMakerApp. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, SageMakerAppInner> beginCreateOrReplace(String resourceGroupName, + String name, SageMakerAppInner resource) { + return this.beginCreateOrReplaceAsync(resourceGroupName, name, resource).getSyncPoller(); + } + + /** + * Create a SageMakerApp. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of SageMakerApp. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, SageMakerAppInner> beginCreateOrReplace(String resourceGroupName, + String name, SageMakerAppInner resource, Context context) { + return this.beginCreateOrReplaceAsync(resourceGroupName, name, resource, context).getSyncPoller(); + } + + /** + * Create a SageMakerApp. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of SageMakerApp. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrReplaceAsync(String resourceGroupName, String name, + SageMakerAppInner resource) { + return beginCreateOrReplaceAsync(resourceGroupName, name, resource).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create a SageMakerApp. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of SageMakerApp. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrReplaceAsync(String resourceGroupName, String name, + SageMakerAppInner resource, Context context) { + return beginCreateOrReplaceAsync(resourceGroupName, name, resource, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create a SageMakerApp. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of SageMakerApp. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SageMakerAppInner createOrReplace(String resourceGroupName, String name, SageMakerAppInner resource) { + return createOrReplaceAsync(resourceGroupName, name, resource).block(); + } + + /** + * Create a SageMakerApp. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of SageMakerApp. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SageMakerAppInner createOrReplace(String resourceGroupName, String name, SageMakerAppInner resource, + Context context) { + return createOrReplaceAsync(resourceGroupName, name, resource, context).block(); + } + + /** + * Update a SageMakerApp. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of SageMakerApp. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync(String resourceGroupName, String name, + SageMakerAppTagsUpdate properties) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (properties == null) { + return Mono.error(new IllegalArgumentException("Parameter properties is required and cannot be null.")); + } else { + properties.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.update(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, properties, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Update a SageMakerApp. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of SageMakerApp. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync(String resourceGroupName, String name, + SageMakerAppTagsUpdate properties, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (properties == null) { + return Mono.error(new IllegalArgumentException("Parameter properties is required and cannot be null.")); + } else { + properties.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.update(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, name, properties, accept, context); + } + + /** + * Update a SageMakerApp. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of SageMakerApp. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, SageMakerAppInner> beginUpdateAsync(String resourceGroupName, + String name, SageMakerAppTagsUpdate properties) { + Mono>> mono = updateWithResponseAsync(resourceGroupName, name, properties); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + SageMakerAppInner.class, SageMakerAppInner.class, this.client.getContext()); + } + + /** + * Update a SageMakerApp. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of SageMakerApp. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, SageMakerAppInner> beginUpdateAsync(String resourceGroupName, + String name, SageMakerAppTagsUpdate properties, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = updateWithResponseAsync(resourceGroupName, name, properties, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + SageMakerAppInner.class, SageMakerAppInner.class, context); + } + + /** + * Update a SageMakerApp. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of SageMakerApp. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, SageMakerAppInner> beginUpdate(String resourceGroupName, + String name, SageMakerAppTagsUpdate properties) { + return this.beginUpdateAsync(resourceGroupName, name, properties).getSyncPoller(); + } + + /** + * Update a SageMakerApp. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of SageMakerApp. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, SageMakerAppInner> beginUpdate(String resourceGroupName, + String name, SageMakerAppTagsUpdate properties, Context context) { + return this.beginUpdateAsync(resourceGroupName, name, properties, context).getSyncPoller(); + } + + /** + * Update a SageMakerApp. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of SageMakerApp. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync(String resourceGroupName, String name, + SageMakerAppTagsUpdate properties) { + return beginUpdateAsync(resourceGroupName, name, properties).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Update a SageMakerApp. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of SageMakerApp. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync(String resourceGroupName, String name, + SageMakerAppTagsUpdate properties, Context context) { + return beginUpdateAsync(resourceGroupName, name, properties, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Update a SageMakerApp. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of SageMakerApp. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SageMakerAppInner update(String resourceGroupName, String name, SageMakerAppTagsUpdate properties) { + return updateAsync(resourceGroupName, name, properties).block(); + } + + /** + * Update a SageMakerApp. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of SageMakerApp. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SageMakerAppInner update(String resourceGroupName, String name, SageMakerAppTagsUpdate properties, + Context context) { + return updateAsync(resourceGroupName, name, properties, context).block(); + } + + /** + * Delete a SageMakerApp. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of SageMakerApp. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync(String resourceGroupName, String name) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Delete a SageMakerApp. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of SageMakerApp. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync(String resourceGroupName, String name, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.delete(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, name, accept, context); + } + + /** + * Delete a SageMakerApp. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of SageMakerApp. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String name) { + Mono>> mono = deleteWithResponseAsync(resourceGroupName, name); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); + } + + /** + * Delete a SageMakerApp. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of SageMakerApp. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String name, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = deleteWithResponseAsync(resourceGroupName, name, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + context); + } + + /** + * Delete a SageMakerApp. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of SageMakerApp. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String name) { + return this.beginDeleteAsync(resourceGroupName, name).getSyncPoller(); + } + + /** + * Delete a SageMakerApp. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of SageMakerApp. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String name, Context context) { + return this.beginDeleteAsync(resourceGroupName, name, context).getSyncPoller(); + } + + /** + * Delete a SageMakerApp. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of SageMakerApp. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String name) { + return beginDeleteAsync(resourceGroupName, name).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete a SageMakerApp. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of SageMakerApp. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String name, Context context) { + return beginDeleteAsync(resourceGroupName, name, context).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete a SageMakerApp. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of SageMakerApp. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String name) { + deleteAsync(resourceGroupName, name).block(); + } + + /** + * Delete a SageMakerApp. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of SageMakerApp. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String name, Context context) { + deleteAsync(resourceGroupName, name, context).block(); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a SageMakerApp list operation along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listBySubscriptionNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), + res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a SageMakerApp list operation along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listBySubscriptionNextSinglePageAsync(String nextLink, + Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a SageMakerApp list operation along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), + res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a SageMakerApp list operation along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupNextSinglePageAsync(String nextLink, + Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/SageMakerAppsImpl.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/SageMakerAppsImpl.java new file mode 100644 index 000000000000..bbc736020690 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/SageMakerAppsImpl.java @@ -0,0 +1,146 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.awsconnector.fluent.SageMakerAppsClient; +import com.azure.resourcemanager.awsconnector.fluent.models.SageMakerAppInner; +import com.azure.resourcemanager.awsconnector.models.SageMakerApp; +import com.azure.resourcemanager.awsconnector.models.SageMakerApps; + +public final class SageMakerAppsImpl implements SageMakerApps { + private static final ClientLogger LOGGER = new ClientLogger(SageMakerAppsImpl.class); + + private final SageMakerAppsClient innerClient; + + private final com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager; + + public SageMakerAppsImpl(SageMakerAppsClient innerClient, + com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return ResourceManagerUtils.mapPage(inner, inner1 -> new SageMakerAppImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new SageMakerAppImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName); + return ResourceManagerUtils.mapPage(inner, inner1 -> new SageMakerAppImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new SageMakerAppImpl(inner1, this.manager())); + } + + public Response getByResourceGroupWithResponse(String resourceGroupName, String name, + Context context) { + Response inner + = this.serviceClient().getByResourceGroupWithResponse(resourceGroupName, name, context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new SageMakerAppImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public SageMakerApp getByResourceGroup(String resourceGroupName, String name) { + SageMakerAppInner inner = this.serviceClient().getByResourceGroup(resourceGroupName, name); + if (inner != null) { + return new SageMakerAppImpl(inner, this.manager()); + } else { + return null; + } + } + + public void deleteByResourceGroup(String resourceGroupName, String name) { + this.serviceClient().delete(resourceGroupName, name); + } + + public void delete(String resourceGroupName, String name, Context context) { + this.serviceClient().delete(resourceGroupName, name, context); + } + + public SageMakerApp getById(String id) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String name = ResourceManagerUtils.getValueFromIdByName(id, "sageMakerApps"); + if (name == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'sageMakerApps'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, name, Context.NONE).getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String name = ResourceManagerUtils.getValueFromIdByName(id, "sageMakerApps"); + if (name == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'sageMakerApps'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, name, context); + } + + public void deleteById(String id) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String name = ResourceManagerUtils.getValueFromIdByName(id, "sageMakerApps"); + if (name == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'sageMakerApps'.", id))); + } + this.delete(resourceGroupName, name, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String name = ResourceManagerUtils.getValueFromIdByName(id, "sageMakerApps"); + if (name == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'sageMakerApps'.", id))); + } + this.delete(resourceGroupName, name, context); + } + + private SageMakerAppsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.awsconnector.AwsconnectorManager manager() { + return this.serviceManager; + } + + public SageMakerAppImpl define(String name) { + return new SageMakerAppImpl(name, this.manager()); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/SageMakerNotebookInstanceSummariesClientImpl.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/SageMakerNotebookInstanceSummariesClientImpl.java new file mode 100644 index 000000000000..b74d2f1aa14d --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/SageMakerNotebookInstanceSummariesClientImpl.java @@ -0,0 +1,1303 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.Patch; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.awsconnector.fluent.SageMakerNotebookInstanceSummariesClient; +import com.azure.resourcemanager.awsconnector.fluent.models.SageMakerNotebookInstanceSummaryInner; +import com.azure.resourcemanager.awsconnector.models.SageMakerNotebookInstanceSummaryListResult; +import com.azure.resourcemanager.awsconnector.models.SageMakerNotebookInstanceSummaryTagsUpdate; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in SageMakerNotebookInstanceSummariesClient. + */ +public final class SageMakerNotebookInstanceSummariesClientImpl implements SageMakerNotebookInstanceSummariesClient { + /** + * The proxy service used to perform REST calls. + */ + private final SageMakerNotebookInstanceSummariesService service; + + /** + * The service client containing this operation class. + */ + private final MicrosoftAwsConnectorImpl client; + + /** + * Initializes an instance of SageMakerNotebookInstanceSummariesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + SageMakerNotebookInstanceSummariesClientImpl(MicrosoftAwsConnectorImpl client) { + this.service = RestProxy.create(SageMakerNotebookInstanceSummariesService.class, client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for MicrosoftAwsConnectorSageMakerNotebookInstanceSummaries to be used by + * the proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "MicrosoftAwsConnecto") + public interface SageMakerNotebookInstanceSummariesService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.AwsConnector/sageMakerNotebookInstanceSummaries") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/sageMakerNotebookInstanceSummaries") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroup( + @HostParam("$host") String endpoint, @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/sageMakerNotebookInstanceSummaries/{name}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getByResourceGroup(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("name") String name, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/sageMakerNotebookInstanceSummaries/{name}") + @ExpectedResponses({ 200, 201 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrReplace(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("name") String name, + @BodyParam("application/json") SageMakerNotebookInstanceSummaryInner resource, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/sageMakerNotebookInstanceSummaries/{name}") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> update(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("name") String name, + @BodyParam("application/json") SageMakerNotebookInstanceSummaryTagsUpdate properties, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/sageMakerNotebookInstanceSummaries/{name}") + @ExpectedResponses({ 202, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("name") String name, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listBySubscriptionNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroupNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); + } + + /** + * List SageMakerNotebookInstanceSummary resources by subscription ID. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a SageMakerNotebookInstanceSummary list operation along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync() { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List SageMakerNotebookInstanceSummary resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a SageMakerNotebookInstanceSummary list operation along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), accept, + context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * List SageMakerNotebookInstanceSummary resources by subscription ID. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a SageMakerNotebookInstanceSummary list operation as paginated response with + * {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>(() -> listSinglePageAsync(), + nextLink -> listBySubscriptionNextSinglePageAsync(nextLink)); + } + + /** + * List SageMakerNotebookInstanceSummary resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a SageMakerNotebookInstanceSummary list operation as paginated response with + * {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(Context context) { + return new PagedFlux<>(() -> listSinglePageAsync(context), + nextLink -> listBySubscriptionNextSinglePageAsync(nextLink, context)); + } + + /** + * List SageMakerNotebookInstanceSummary resources by subscription ID. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a SageMakerNotebookInstanceSummary list operation as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + return new PagedIterable<>(listAsync()); + } + + /** + * List SageMakerNotebookInstanceSummary resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a SageMakerNotebookInstanceSummary list operation as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Context context) { + return new PagedIterable<>(listAsync(context)); + } + + /** + * List SageMakerNotebookInstanceSummary resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a SageMakerNotebookInstanceSummary list operation along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> + listByResourceGroupSinglePageAsync(String resourceGroupName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List SageMakerNotebookInstanceSummary resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a SageMakerNotebookInstanceSummary list operation along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> + listByResourceGroupSinglePageAsync(String resourceGroupName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * List SageMakerNotebookInstanceSummary resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a SageMakerNotebookInstanceSummary list operation as paginated response with + * {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName) { + return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); + } + + /** + * List SageMakerNotebookInstanceSummary resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a SageMakerNotebookInstanceSummary list operation as paginated response with + * {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName, + Context context) { + return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName, context), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink, context)); + } + + /** + * List SageMakerNotebookInstanceSummary resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a SageMakerNotebookInstanceSummary list operation as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName)); + } + + /** + * List SageMakerNotebookInstanceSummary resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a SageMakerNotebookInstanceSummary list operation as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName, + Context context) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, context)); + } + + /** + * Get a SageMakerNotebookInstanceSummary. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of SageMakerNotebookInstanceSummary. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a SageMakerNotebookInstanceSummary along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> + getByResourceGroupWithResponseAsync(String resourceGroupName, String name) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.getByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get a SageMakerNotebookInstanceSummary. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of SageMakerNotebookInstanceSummary. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a SageMakerNotebookInstanceSummary along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> + getByResourceGroupWithResponseAsync(String resourceGroupName, String name, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.getByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, accept, context); + } + + /** + * Get a SageMakerNotebookInstanceSummary. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of SageMakerNotebookInstanceSummary. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a SageMakerNotebookInstanceSummary on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getByResourceGroupAsync(String resourceGroupName, String name) { + return getByResourceGroupWithResponseAsync(resourceGroupName, name) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Get a SageMakerNotebookInstanceSummary. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of SageMakerNotebookInstanceSummary. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a SageMakerNotebookInstanceSummary along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getByResourceGroupWithResponse(String resourceGroupName, + String name, Context context) { + return getByResourceGroupWithResponseAsync(resourceGroupName, name, context).block(); + } + + /** + * Get a SageMakerNotebookInstanceSummary. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of SageMakerNotebookInstanceSummary. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a SageMakerNotebookInstanceSummary. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SageMakerNotebookInstanceSummaryInner getByResourceGroup(String resourceGroupName, String name) { + return getByResourceGroupWithResponse(resourceGroupName, name, Context.NONE).getValue(); + } + + /** + * Create a SageMakerNotebookInstanceSummary. Please note that end user resource creation is currently restricted, + * but it will be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of SageMakerNotebookInstanceSummary. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrReplaceWithResponseAsync(String resourceGroupName, String name, + SageMakerNotebookInstanceSummaryInner resource) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (resource == null) { + return Mono.error(new IllegalArgumentException("Parameter resource is required and cannot be null.")); + } else { + resource.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.createOrReplace(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, resource, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Create a SageMakerNotebookInstanceSummary. Please note that end user resource creation is currently restricted, + * but it will be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of SageMakerNotebookInstanceSummary. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrReplaceWithResponseAsync(String resourceGroupName, String name, + SageMakerNotebookInstanceSummaryInner resource, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (resource == null) { + return Mono.error(new IllegalArgumentException("Parameter resource is required and cannot be null.")); + } else { + resource.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.createOrReplace(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, resource, accept, context); + } + + /** + * Create a SageMakerNotebookInstanceSummary. Please note that end user resource creation is currently restricted, + * but it will be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of SageMakerNotebookInstanceSummary. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, SageMakerNotebookInstanceSummaryInner> + beginCreateOrReplaceAsync(String resourceGroupName, String name, + SageMakerNotebookInstanceSummaryInner resource) { + Mono>> mono = createOrReplaceWithResponseAsync(resourceGroupName, name, resource); + return this.client.getLroResult( + mono, this.client.getHttpPipeline(), SageMakerNotebookInstanceSummaryInner.class, + SageMakerNotebookInstanceSummaryInner.class, this.client.getContext()); + } + + /** + * Create a SageMakerNotebookInstanceSummary. Please note that end user resource creation is currently restricted, + * but it will be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of SageMakerNotebookInstanceSummary. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, SageMakerNotebookInstanceSummaryInner> + beginCreateOrReplaceAsync(String resourceGroupName, String name, SageMakerNotebookInstanceSummaryInner resource, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono + = createOrReplaceWithResponseAsync(resourceGroupName, name, resource, context); + return this.client.getLroResult( + mono, this.client.getHttpPipeline(), SageMakerNotebookInstanceSummaryInner.class, + SageMakerNotebookInstanceSummaryInner.class, context); + } + + /** + * Create a SageMakerNotebookInstanceSummary. Please note that end user resource creation is currently restricted, + * but it will be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of SageMakerNotebookInstanceSummary. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, SageMakerNotebookInstanceSummaryInner> + beginCreateOrReplace(String resourceGroupName, String name, SageMakerNotebookInstanceSummaryInner resource) { + return this.beginCreateOrReplaceAsync(resourceGroupName, name, resource).getSyncPoller(); + } + + /** + * Create a SageMakerNotebookInstanceSummary. Please note that end user resource creation is currently restricted, + * but it will be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of SageMakerNotebookInstanceSummary. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, SageMakerNotebookInstanceSummaryInner> + beginCreateOrReplace(String resourceGroupName, String name, SageMakerNotebookInstanceSummaryInner resource, + Context context) { + return this.beginCreateOrReplaceAsync(resourceGroupName, name, resource, context).getSyncPoller(); + } + + /** + * Create a SageMakerNotebookInstanceSummary. Please note that end user resource creation is currently restricted, + * but it will be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of SageMakerNotebookInstanceSummary. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrReplaceAsync(String resourceGroupName, String name, + SageMakerNotebookInstanceSummaryInner resource) { + return beginCreateOrReplaceAsync(resourceGroupName, name, resource).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create a SageMakerNotebookInstanceSummary. Please note that end user resource creation is currently restricted, + * but it will be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of SageMakerNotebookInstanceSummary. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrReplaceAsync(String resourceGroupName, String name, + SageMakerNotebookInstanceSummaryInner resource, Context context) { + return beginCreateOrReplaceAsync(resourceGroupName, name, resource, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create a SageMakerNotebookInstanceSummary. Please note that end user resource creation is currently restricted, + * but it will be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of SageMakerNotebookInstanceSummary. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SageMakerNotebookInstanceSummaryInner createOrReplace(String resourceGroupName, String name, + SageMakerNotebookInstanceSummaryInner resource) { + return createOrReplaceAsync(resourceGroupName, name, resource).block(); + } + + /** + * Create a SageMakerNotebookInstanceSummary. Please note that end user resource creation is currently restricted, + * but it will be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of SageMakerNotebookInstanceSummary. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SageMakerNotebookInstanceSummaryInner createOrReplace(String resourceGroupName, String name, + SageMakerNotebookInstanceSummaryInner resource, Context context) { + return createOrReplaceAsync(resourceGroupName, name, resource, context).block(); + } + + /** + * Update a SageMakerNotebookInstanceSummary. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of SageMakerNotebookInstanceSummary. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync(String resourceGroupName, String name, + SageMakerNotebookInstanceSummaryTagsUpdate properties) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (properties == null) { + return Mono.error(new IllegalArgumentException("Parameter properties is required and cannot be null.")); + } else { + properties.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.update(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, properties, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Update a SageMakerNotebookInstanceSummary. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of SageMakerNotebookInstanceSummary. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync(String resourceGroupName, String name, + SageMakerNotebookInstanceSummaryTagsUpdate properties, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (properties == null) { + return Mono.error(new IllegalArgumentException("Parameter properties is required and cannot be null.")); + } else { + properties.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.update(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, name, properties, accept, context); + } + + /** + * Update a SageMakerNotebookInstanceSummary. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of SageMakerNotebookInstanceSummary. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, SageMakerNotebookInstanceSummaryInner> + beginUpdateAsync(String resourceGroupName, String name, SageMakerNotebookInstanceSummaryTagsUpdate properties) { + Mono>> mono = updateWithResponseAsync(resourceGroupName, name, properties); + return this.client.getLroResult( + mono, this.client.getHttpPipeline(), SageMakerNotebookInstanceSummaryInner.class, + SageMakerNotebookInstanceSummaryInner.class, this.client.getContext()); + } + + /** + * Update a SageMakerNotebookInstanceSummary. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of SageMakerNotebookInstanceSummary. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, SageMakerNotebookInstanceSummaryInner> + beginUpdateAsync(String resourceGroupName, String name, SageMakerNotebookInstanceSummaryTagsUpdate properties, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = updateWithResponseAsync(resourceGroupName, name, properties, context); + return this.client.getLroResult( + mono, this.client.getHttpPipeline(), SageMakerNotebookInstanceSummaryInner.class, + SageMakerNotebookInstanceSummaryInner.class, context); + } + + /** + * Update a SageMakerNotebookInstanceSummary. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of SageMakerNotebookInstanceSummary. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, SageMakerNotebookInstanceSummaryInner> + beginUpdate(String resourceGroupName, String name, SageMakerNotebookInstanceSummaryTagsUpdate properties) { + return this.beginUpdateAsync(resourceGroupName, name, properties).getSyncPoller(); + } + + /** + * Update a SageMakerNotebookInstanceSummary. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of SageMakerNotebookInstanceSummary. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, SageMakerNotebookInstanceSummaryInner> + beginUpdate(String resourceGroupName, String name, SageMakerNotebookInstanceSummaryTagsUpdate properties, + Context context) { + return this.beginUpdateAsync(resourceGroupName, name, properties, context).getSyncPoller(); + } + + /** + * Update a SageMakerNotebookInstanceSummary. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of SageMakerNotebookInstanceSummary. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync(String resourceGroupName, String name, + SageMakerNotebookInstanceSummaryTagsUpdate properties) { + return beginUpdateAsync(resourceGroupName, name, properties).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Update a SageMakerNotebookInstanceSummary. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of SageMakerNotebookInstanceSummary. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync(String resourceGroupName, String name, + SageMakerNotebookInstanceSummaryTagsUpdate properties, Context context) { + return beginUpdateAsync(resourceGroupName, name, properties, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Update a SageMakerNotebookInstanceSummary. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of SageMakerNotebookInstanceSummary. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SageMakerNotebookInstanceSummaryInner update(String resourceGroupName, String name, + SageMakerNotebookInstanceSummaryTagsUpdate properties) { + return updateAsync(resourceGroupName, name, properties).block(); + } + + /** + * Update a SageMakerNotebookInstanceSummary. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of SageMakerNotebookInstanceSummary. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SageMakerNotebookInstanceSummaryInner update(String resourceGroupName, String name, + SageMakerNotebookInstanceSummaryTagsUpdate properties, Context context) { + return updateAsync(resourceGroupName, name, properties, context).block(); + } + + /** + * Delete a SageMakerNotebookInstanceSummary. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of SageMakerNotebookInstanceSummary. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync(String resourceGroupName, String name) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Delete a SageMakerNotebookInstanceSummary. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of SageMakerNotebookInstanceSummary. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync(String resourceGroupName, String name, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.delete(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, name, accept, context); + } + + /** + * Delete a SageMakerNotebookInstanceSummary. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of SageMakerNotebookInstanceSummary. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String name) { + Mono>> mono = deleteWithResponseAsync(resourceGroupName, name); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); + } + + /** + * Delete a SageMakerNotebookInstanceSummary. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of SageMakerNotebookInstanceSummary. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String name, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = deleteWithResponseAsync(resourceGroupName, name, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + context); + } + + /** + * Delete a SageMakerNotebookInstanceSummary. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of SageMakerNotebookInstanceSummary. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String name) { + return this.beginDeleteAsync(resourceGroupName, name).getSyncPoller(); + } + + /** + * Delete a SageMakerNotebookInstanceSummary. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of SageMakerNotebookInstanceSummary. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String name, Context context) { + return this.beginDeleteAsync(resourceGroupName, name, context).getSyncPoller(); + } + + /** + * Delete a SageMakerNotebookInstanceSummary. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of SageMakerNotebookInstanceSummary. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String name) { + return beginDeleteAsync(resourceGroupName, name).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete a SageMakerNotebookInstanceSummary. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of SageMakerNotebookInstanceSummary. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String name, Context context) { + return beginDeleteAsync(resourceGroupName, name, context).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete a SageMakerNotebookInstanceSummary. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of SageMakerNotebookInstanceSummary. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String name) { + deleteAsync(resourceGroupName, name).block(); + } + + /** + * Delete a SageMakerNotebookInstanceSummary. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of SageMakerNotebookInstanceSummary. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String name, Context context) { + deleteAsync(resourceGroupName, name, context).block(); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a SageMakerNotebookInstanceSummary list operation along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> + listBySubscriptionNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a SageMakerNotebookInstanceSummary list operation along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> + listBySubscriptionNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a SageMakerNotebookInstanceSummary list operation along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> + listByResourceGroupNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a SageMakerNotebookInstanceSummary list operation along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> + listByResourceGroupNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/SageMakerNotebookInstanceSummariesImpl.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/SageMakerNotebookInstanceSummariesImpl.java new file mode 100644 index 000000000000..a45202e8511b --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/SageMakerNotebookInstanceSummariesImpl.java @@ -0,0 +1,153 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.awsconnector.fluent.SageMakerNotebookInstanceSummariesClient; +import com.azure.resourcemanager.awsconnector.fluent.models.SageMakerNotebookInstanceSummaryInner; +import com.azure.resourcemanager.awsconnector.models.SageMakerNotebookInstanceSummaries; +import com.azure.resourcemanager.awsconnector.models.SageMakerNotebookInstanceSummary; + +public final class SageMakerNotebookInstanceSummariesImpl implements SageMakerNotebookInstanceSummaries { + private static final ClientLogger LOGGER = new ClientLogger(SageMakerNotebookInstanceSummariesImpl.class); + + private final SageMakerNotebookInstanceSummariesClient innerClient; + + private final com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager; + + public SageMakerNotebookInstanceSummariesImpl(SageMakerNotebookInstanceSummariesClient innerClient, + com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return ResourceManagerUtils.mapPage(inner, + inner1 -> new SageMakerNotebookInstanceSummaryImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return ResourceManagerUtils.mapPage(inner, + inner1 -> new SageMakerNotebookInstanceSummaryImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName) { + PagedIterable inner + = this.serviceClient().listByResourceGroup(resourceGroupName); + return ResourceManagerUtils.mapPage(inner, + inner1 -> new SageMakerNotebookInstanceSummaryImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName, + Context context) { + PagedIterable inner + = this.serviceClient().listByResourceGroup(resourceGroupName, context); + return ResourceManagerUtils.mapPage(inner, + inner1 -> new SageMakerNotebookInstanceSummaryImpl(inner1, this.manager())); + } + + public Response getByResourceGroupWithResponse(String resourceGroupName, + String name, Context context) { + Response inner + = this.serviceClient().getByResourceGroupWithResponse(resourceGroupName, name, context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new SageMakerNotebookInstanceSummaryImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public SageMakerNotebookInstanceSummary getByResourceGroup(String resourceGroupName, String name) { + SageMakerNotebookInstanceSummaryInner inner = this.serviceClient().getByResourceGroup(resourceGroupName, name); + if (inner != null) { + return new SageMakerNotebookInstanceSummaryImpl(inner, this.manager()); + } else { + return null; + } + } + + public void deleteByResourceGroup(String resourceGroupName, String name) { + this.serviceClient().delete(resourceGroupName, name); + } + + public void delete(String resourceGroupName, String name, Context context) { + this.serviceClient().delete(resourceGroupName, name, context); + } + + public SageMakerNotebookInstanceSummary getById(String id) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String name = ResourceManagerUtils.getValueFromIdByName(id, "sageMakerNotebookInstanceSummaries"); + if (name == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException(String.format( + "The resource ID '%s' is not valid. Missing path segment 'sageMakerNotebookInstanceSummaries'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, name, Context.NONE).getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String name = ResourceManagerUtils.getValueFromIdByName(id, "sageMakerNotebookInstanceSummaries"); + if (name == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException(String.format( + "The resource ID '%s' is not valid. Missing path segment 'sageMakerNotebookInstanceSummaries'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, name, context); + } + + public void deleteById(String id) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String name = ResourceManagerUtils.getValueFromIdByName(id, "sageMakerNotebookInstanceSummaries"); + if (name == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException(String.format( + "The resource ID '%s' is not valid. Missing path segment 'sageMakerNotebookInstanceSummaries'.", id))); + } + this.delete(resourceGroupName, name, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String name = ResourceManagerUtils.getValueFromIdByName(id, "sageMakerNotebookInstanceSummaries"); + if (name == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException(String.format( + "The resource ID '%s' is not valid. Missing path segment 'sageMakerNotebookInstanceSummaries'.", id))); + } + this.delete(resourceGroupName, name, context); + } + + private SageMakerNotebookInstanceSummariesClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.awsconnector.AwsconnectorManager manager() { + return this.serviceManager; + } + + public SageMakerNotebookInstanceSummaryImpl define(String name) { + return new SageMakerNotebookInstanceSummaryImpl(name, this.manager()); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/SageMakerNotebookInstanceSummaryImpl.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/SageMakerNotebookInstanceSummaryImpl.java new file mode 100644 index 000000000000..59bb02c03170 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/SageMakerNotebookInstanceSummaryImpl.java @@ -0,0 +1,179 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.implementation; + +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.awsconnector.fluent.models.SageMakerNotebookInstanceSummaryInner; +import com.azure.resourcemanager.awsconnector.models.SageMakerNotebookInstanceSummary; +import com.azure.resourcemanager.awsconnector.models.SageMakerNotebookInstanceSummaryProperties; +import com.azure.resourcemanager.awsconnector.models.SageMakerNotebookInstanceSummaryTagsUpdate; +import java.util.Collections; +import java.util.Map; + +public final class SageMakerNotebookInstanceSummaryImpl implements SageMakerNotebookInstanceSummary, + SageMakerNotebookInstanceSummary.Definition, SageMakerNotebookInstanceSummary.Update { + private SageMakerNotebookInstanceSummaryInner innerObject; + + private final com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public String location() { + return this.innerModel().location(); + } + + public Map tags() { + Map inner = this.innerModel().tags(); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } + } + + public SageMakerNotebookInstanceSummaryProperties properties() { + return this.innerModel().properties(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public String resourceGroupName() { + return resourceGroupName; + } + + public SageMakerNotebookInstanceSummaryInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.awsconnector.AwsconnectorManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String name; + + private SageMakerNotebookInstanceSummaryTagsUpdate updateProperties; + + public SageMakerNotebookInstanceSummaryImpl withExistingResourceGroup(String resourceGroupName) { + this.resourceGroupName = resourceGroupName; + return this; + } + + public SageMakerNotebookInstanceSummary create() { + this.innerObject = serviceManager.serviceClient() + .getSageMakerNotebookInstanceSummaries() + .createOrReplace(resourceGroupName, name, this.innerModel(), Context.NONE); + return this; + } + + public SageMakerNotebookInstanceSummary create(Context context) { + this.innerObject = serviceManager.serviceClient() + .getSageMakerNotebookInstanceSummaries() + .createOrReplace(resourceGroupName, name, this.innerModel(), context); + return this; + } + + SageMakerNotebookInstanceSummaryImpl(String name, + com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager) { + this.innerObject = new SageMakerNotebookInstanceSummaryInner(); + this.serviceManager = serviceManager; + this.name = name; + } + + public SageMakerNotebookInstanceSummaryImpl update() { + this.updateProperties = new SageMakerNotebookInstanceSummaryTagsUpdate(); + return this; + } + + public SageMakerNotebookInstanceSummary apply() { + this.innerObject = serviceManager.serviceClient() + .getSageMakerNotebookInstanceSummaries() + .update(resourceGroupName, name, updateProperties, Context.NONE); + return this; + } + + public SageMakerNotebookInstanceSummary apply(Context context) { + this.innerObject = serviceManager.serviceClient() + .getSageMakerNotebookInstanceSummaries() + .update(resourceGroupName, name, updateProperties, context); + return this; + } + + SageMakerNotebookInstanceSummaryImpl(SageMakerNotebookInstanceSummaryInner innerObject, + com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.name = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "sageMakerNotebookInstanceSummaries"); + } + + public SageMakerNotebookInstanceSummary refresh() { + this.innerObject = serviceManager.serviceClient() + .getSageMakerNotebookInstanceSummaries() + .getByResourceGroupWithResponse(resourceGroupName, name, Context.NONE) + .getValue(); + return this; + } + + public SageMakerNotebookInstanceSummary refresh(Context context) { + this.innerObject = serviceManager.serviceClient() + .getSageMakerNotebookInstanceSummaries() + .getByResourceGroupWithResponse(resourceGroupName, name, context) + .getValue(); + return this; + } + + public SageMakerNotebookInstanceSummaryImpl withRegion(Region location) { + this.innerModel().withLocation(location.toString()); + return this; + } + + public SageMakerNotebookInstanceSummaryImpl withRegion(String location) { + this.innerModel().withLocation(location); + return this; + } + + public SageMakerNotebookInstanceSummaryImpl withTags(Map tags) { + if (isInCreateMode()) { + this.innerModel().withTags(tags); + return this; + } else { + this.updateProperties.withTags(tags); + return this; + } + } + + public SageMakerNotebookInstanceSummaryImpl withProperties(SageMakerNotebookInstanceSummaryProperties properties) { + this.innerModel().withProperties(properties); + return this; + } + + private boolean isInCreateMode() { + return this.innerModel().id() == null; + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/SecretsManagerResourcePoliciesClientImpl.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/SecretsManagerResourcePoliciesClientImpl.java new file mode 100644 index 000000000000..2f1bb72d0517 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/SecretsManagerResourcePoliciesClientImpl.java @@ -0,0 +1,1300 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.Patch; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.awsconnector.fluent.SecretsManagerResourcePoliciesClient; +import com.azure.resourcemanager.awsconnector.fluent.models.SecretsManagerResourcePolicyInner; +import com.azure.resourcemanager.awsconnector.models.SecretsManagerResourcePolicyListResult; +import com.azure.resourcemanager.awsconnector.models.SecretsManagerResourcePolicyTagsUpdate; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in SecretsManagerResourcePoliciesClient. + */ +public final class SecretsManagerResourcePoliciesClientImpl implements SecretsManagerResourcePoliciesClient { + /** + * The proxy service used to perform REST calls. + */ + private final SecretsManagerResourcePoliciesService service; + + /** + * The service client containing this operation class. + */ + private final MicrosoftAwsConnectorImpl client; + + /** + * Initializes an instance of SecretsManagerResourcePoliciesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + SecretsManagerResourcePoliciesClientImpl(MicrosoftAwsConnectorImpl client) { + this.service = RestProxy.create(SecretsManagerResourcePoliciesService.class, client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for MicrosoftAwsConnectorSecretsManagerResourcePolicies to be used by the + * proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "MicrosoftAwsConnecto") + public interface SecretsManagerResourcePoliciesService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.AwsConnector/secretsManagerResourcePolicies") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/secretsManagerResourcePolicies") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroup(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/secretsManagerResourcePolicies/{name}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getByResourceGroup(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("name") String name, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/secretsManagerResourcePolicies/{name}") + @ExpectedResponses({ 200, 201 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrReplace(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("name") String name, + @BodyParam("application/json") SecretsManagerResourcePolicyInner resource, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/secretsManagerResourcePolicies/{name}") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> update(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("name") String name, + @BodyParam("application/json") SecretsManagerResourcePolicyTagsUpdate properties, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/secretsManagerResourcePolicies/{name}") + @ExpectedResponses({ 202, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("name") String name, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listBySubscriptionNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroupNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); + } + + /** + * List SecretsManagerResourcePolicy resources by subscription ID. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a SecretsManagerResourcePolicy list operation along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync() { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List SecretsManagerResourcePolicy resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a SecretsManagerResourcePolicy list operation along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), accept, + context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * List SecretsManagerResourcePolicy resources by subscription ID. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a SecretsManagerResourcePolicy list operation as paginated response with + * {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>(() -> listSinglePageAsync(), + nextLink -> listBySubscriptionNextSinglePageAsync(nextLink)); + } + + /** + * List SecretsManagerResourcePolicy resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a SecretsManagerResourcePolicy list operation as paginated response with + * {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(Context context) { + return new PagedFlux<>(() -> listSinglePageAsync(context), + nextLink -> listBySubscriptionNextSinglePageAsync(nextLink, context)); + } + + /** + * List SecretsManagerResourcePolicy resources by subscription ID. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a SecretsManagerResourcePolicy list operation as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + return new PagedIterable<>(listAsync()); + } + + /** + * List SecretsManagerResourcePolicy resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a SecretsManagerResourcePolicy list operation as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Context context) { + return new PagedIterable<>(listAsync(context)); + } + + /** + * List SecretsManagerResourcePolicy resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a SecretsManagerResourcePolicy list operation along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> + listByResourceGroupSinglePageAsync(String resourceGroupName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List SecretsManagerResourcePolicy resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a SecretsManagerResourcePolicy list operation along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> + listByResourceGroupSinglePageAsync(String resourceGroupName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * List SecretsManagerResourcePolicy resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a SecretsManagerResourcePolicy list operation as paginated response with + * {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName) { + return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); + } + + /** + * List SecretsManagerResourcePolicy resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a SecretsManagerResourcePolicy list operation as paginated response with + * {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName, + Context context) { + return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName, context), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink, context)); + } + + /** + * List SecretsManagerResourcePolicy resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a SecretsManagerResourcePolicy list operation as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName)); + } + + /** + * List SecretsManagerResourcePolicy resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a SecretsManagerResourcePolicy list operation as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName, + Context context) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, context)); + } + + /** + * Get a SecretsManagerResourcePolicy. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of SecretsManagerResourcePolicy. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a SecretsManagerResourcePolicy along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> + getByResourceGroupWithResponseAsync(String resourceGroupName, String name) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.getByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get a SecretsManagerResourcePolicy. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of SecretsManagerResourcePolicy. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a SecretsManagerResourcePolicy along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> + getByResourceGroupWithResponseAsync(String resourceGroupName, String name, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.getByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, accept, context); + } + + /** + * Get a SecretsManagerResourcePolicy. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of SecretsManagerResourcePolicy. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a SecretsManagerResourcePolicy on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getByResourceGroupAsync(String resourceGroupName, String name) { + return getByResourceGroupWithResponseAsync(resourceGroupName, name) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Get a SecretsManagerResourcePolicy. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of SecretsManagerResourcePolicy. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a SecretsManagerResourcePolicy along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getByResourceGroupWithResponse(String resourceGroupName, + String name, Context context) { + return getByResourceGroupWithResponseAsync(resourceGroupName, name, context).block(); + } + + /** + * Get a SecretsManagerResourcePolicy. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of SecretsManagerResourcePolicy. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a SecretsManagerResourcePolicy. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SecretsManagerResourcePolicyInner getByResourceGroup(String resourceGroupName, String name) { + return getByResourceGroupWithResponse(resourceGroupName, name, Context.NONE).getValue(); + } + + /** + * Create a SecretsManagerResourcePolicy. Please note that end user resource creation is currently restricted, but + * it will be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of SecretsManagerResourcePolicy. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrReplaceWithResponseAsync(String resourceGroupName, String name, + SecretsManagerResourcePolicyInner resource) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (resource == null) { + return Mono.error(new IllegalArgumentException("Parameter resource is required and cannot be null.")); + } else { + resource.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.createOrReplace(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, resource, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Create a SecretsManagerResourcePolicy. Please note that end user resource creation is currently restricted, but + * it will be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of SecretsManagerResourcePolicy. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrReplaceWithResponseAsync(String resourceGroupName, String name, + SecretsManagerResourcePolicyInner resource, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (resource == null) { + return Mono.error(new IllegalArgumentException("Parameter resource is required and cannot be null.")); + } else { + resource.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.createOrReplace(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, resource, accept, context); + } + + /** + * Create a SecretsManagerResourcePolicy. Please note that end user resource creation is currently restricted, but + * it will be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of SecretsManagerResourcePolicy. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, SecretsManagerResourcePolicyInner> + beginCreateOrReplaceAsync(String resourceGroupName, String name, SecretsManagerResourcePolicyInner resource) { + Mono>> mono = createOrReplaceWithResponseAsync(resourceGroupName, name, resource); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), SecretsManagerResourcePolicyInner.class, + SecretsManagerResourcePolicyInner.class, this.client.getContext()); + } + + /** + * Create a SecretsManagerResourcePolicy. Please note that end user resource creation is currently restricted, but + * it will be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of SecretsManagerResourcePolicy. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, SecretsManagerResourcePolicyInner> + beginCreateOrReplaceAsync(String resourceGroupName, String name, SecretsManagerResourcePolicyInner resource, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono + = createOrReplaceWithResponseAsync(resourceGroupName, name, resource, context); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), SecretsManagerResourcePolicyInner.class, + SecretsManagerResourcePolicyInner.class, context); + } + + /** + * Create a SecretsManagerResourcePolicy. Please note that end user resource creation is currently restricted, but + * it will be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of SecretsManagerResourcePolicy. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, SecretsManagerResourcePolicyInner> + beginCreateOrReplace(String resourceGroupName, String name, SecretsManagerResourcePolicyInner resource) { + return this.beginCreateOrReplaceAsync(resourceGroupName, name, resource).getSyncPoller(); + } + + /** + * Create a SecretsManagerResourcePolicy. Please note that end user resource creation is currently restricted, but + * it will be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of SecretsManagerResourcePolicy. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, SecretsManagerResourcePolicyInner> + beginCreateOrReplace(String resourceGroupName, String name, SecretsManagerResourcePolicyInner resource, + Context context) { + return this.beginCreateOrReplaceAsync(resourceGroupName, name, resource, context).getSyncPoller(); + } + + /** + * Create a SecretsManagerResourcePolicy. Please note that end user resource creation is currently restricted, but + * it will be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of SecretsManagerResourcePolicy. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrReplaceAsync(String resourceGroupName, String name, + SecretsManagerResourcePolicyInner resource) { + return beginCreateOrReplaceAsync(resourceGroupName, name, resource).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create a SecretsManagerResourcePolicy. Please note that end user resource creation is currently restricted, but + * it will be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of SecretsManagerResourcePolicy. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrReplaceAsync(String resourceGroupName, String name, + SecretsManagerResourcePolicyInner resource, Context context) { + return beginCreateOrReplaceAsync(resourceGroupName, name, resource, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create a SecretsManagerResourcePolicy. Please note that end user resource creation is currently restricted, but + * it will be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of SecretsManagerResourcePolicy. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SecretsManagerResourcePolicyInner createOrReplace(String resourceGroupName, String name, + SecretsManagerResourcePolicyInner resource) { + return createOrReplaceAsync(resourceGroupName, name, resource).block(); + } + + /** + * Create a SecretsManagerResourcePolicy. Please note that end user resource creation is currently restricted, but + * it will be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of SecretsManagerResourcePolicy. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SecretsManagerResourcePolicyInner createOrReplace(String resourceGroupName, String name, + SecretsManagerResourcePolicyInner resource, Context context) { + return createOrReplaceAsync(resourceGroupName, name, resource, context).block(); + } + + /** + * Update a SecretsManagerResourcePolicy. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of SecretsManagerResourcePolicy. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync(String resourceGroupName, String name, + SecretsManagerResourcePolicyTagsUpdate properties) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (properties == null) { + return Mono.error(new IllegalArgumentException("Parameter properties is required and cannot be null.")); + } else { + properties.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.update(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, properties, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Update a SecretsManagerResourcePolicy. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of SecretsManagerResourcePolicy. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync(String resourceGroupName, String name, + SecretsManagerResourcePolicyTagsUpdate properties, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (properties == null) { + return Mono.error(new IllegalArgumentException("Parameter properties is required and cannot be null.")); + } else { + properties.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.update(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, name, properties, accept, context); + } + + /** + * Update a SecretsManagerResourcePolicy. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of SecretsManagerResourcePolicy. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, SecretsManagerResourcePolicyInner> + beginUpdateAsync(String resourceGroupName, String name, SecretsManagerResourcePolicyTagsUpdate properties) { + Mono>> mono = updateWithResponseAsync(resourceGroupName, name, properties); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), SecretsManagerResourcePolicyInner.class, + SecretsManagerResourcePolicyInner.class, this.client.getContext()); + } + + /** + * Update a SecretsManagerResourcePolicy. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of SecretsManagerResourcePolicy. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, SecretsManagerResourcePolicyInner> + beginUpdateAsync(String resourceGroupName, String name, SecretsManagerResourcePolicyTagsUpdate properties, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = updateWithResponseAsync(resourceGroupName, name, properties, context); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), SecretsManagerResourcePolicyInner.class, + SecretsManagerResourcePolicyInner.class, context); + } + + /** + * Update a SecretsManagerResourcePolicy. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of SecretsManagerResourcePolicy. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, SecretsManagerResourcePolicyInner> + beginUpdate(String resourceGroupName, String name, SecretsManagerResourcePolicyTagsUpdate properties) { + return this.beginUpdateAsync(resourceGroupName, name, properties).getSyncPoller(); + } + + /** + * Update a SecretsManagerResourcePolicy. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of SecretsManagerResourcePolicy. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, SecretsManagerResourcePolicyInner> beginUpdate( + String resourceGroupName, String name, SecretsManagerResourcePolicyTagsUpdate properties, Context context) { + return this.beginUpdateAsync(resourceGroupName, name, properties, context).getSyncPoller(); + } + + /** + * Update a SecretsManagerResourcePolicy. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of SecretsManagerResourcePolicy. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync(String resourceGroupName, String name, + SecretsManagerResourcePolicyTagsUpdate properties) { + return beginUpdateAsync(resourceGroupName, name, properties).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Update a SecretsManagerResourcePolicy. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of SecretsManagerResourcePolicy. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync(String resourceGroupName, String name, + SecretsManagerResourcePolicyTagsUpdate properties, Context context) { + return beginUpdateAsync(resourceGroupName, name, properties, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Update a SecretsManagerResourcePolicy. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of SecretsManagerResourcePolicy. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SecretsManagerResourcePolicyInner update(String resourceGroupName, String name, + SecretsManagerResourcePolicyTagsUpdate properties) { + return updateAsync(resourceGroupName, name, properties).block(); + } + + /** + * Update a SecretsManagerResourcePolicy. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of SecretsManagerResourcePolicy. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SecretsManagerResourcePolicyInner update(String resourceGroupName, String name, + SecretsManagerResourcePolicyTagsUpdate properties, Context context) { + return updateAsync(resourceGroupName, name, properties, context).block(); + } + + /** + * Delete a SecretsManagerResourcePolicy. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of SecretsManagerResourcePolicy. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync(String resourceGroupName, String name) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Delete a SecretsManagerResourcePolicy. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of SecretsManagerResourcePolicy. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync(String resourceGroupName, String name, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.delete(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, name, accept, context); + } + + /** + * Delete a SecretsManagerResourcePolicy. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of SecretsManagerResourcePolicy. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String name) { + Mono>> mono = deleteWithResponseAsync(resourceGroupName, name); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); + } + + /** + * Delete a SecretsManagerResourcePolicy. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of SecretsManagerResourcePolicy. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String name, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = deleteWithResponseAsync(resourceGroupName, name, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + context); + } + + /** + * Delete a SecretsManagerResourcePolicy. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of SecretsManagerResourcePolicy. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String name) { + return this.beginDeleteAsync(resourceGroupName, name).getSyncPoller(); + } + + /** + * Delete a SecretsManagerResourcePolicy. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of SecretsManagerResourcePolicy. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String name, Context context) { + return this.beginDeleteAsync(resourceGroupName, name, context).getSyncPoller(); + } + + /** + * Delete a SecretsManagerResourcePolicy. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of SecretsManagerResourcePolicy. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String name) { + return beginDeleteAsync(resourceGroupName, name).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete a SecretsManagerResourcePolicy. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of SecretsManagerResourcePolicy. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String name, Context context) { + return beginDeleteAsync(resourceGroupName, name, context).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete a SecretsManagerResourcePolicy. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of SecretsManagerResourcePolicy. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String name) { + deleteAsync(resourceGroupName, name).block(); + } + + /** + * Delete a SecretsManagerResourcePolicy. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of SecretsManagerResourcePolicy. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String name, Context context) { + deleteAsync(resourceGroupName, name, context).block(); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a SecretsManagerResourcePolicy list operation along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> + listBySubscriptionNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a SecretsManagerResourcePolicy list operation along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> + listBySubscriptionNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a SecretsManagerResourcePolicy list operation along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> + listByResourceGroupNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a SecretsManagerResourcePolicy list operation along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> + listByResourceGroupNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/SecretsManagerResourcePoliciesImpl.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/SecretsManagerResourcePoliciesImpl.java new file mode 100644 index 000000000000..ee054e0f5d0a --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/SecretsManagerResourcePoliciesImpl.java @@ -0,0 +1,152 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.awsconnector.fluent.SecretsManagerResourcePoliciesClient; +import com.azure.resourcemanager.awsconnector.fluent.models.SecretsManagerResourcePolicyInner; +import com.azure.resourcemanager.awsconnector.models.SecretsManagerResourcePolicies; +import com.azure.resourcemanager.awsconnector.models.SecretsManagerResourcePolicy; + +public final class SecretsManagerResourcePoliciesImpl implements SecretsManagerResourcePolicies { + private static final ClientLogger LOGGER = new ClientLogger(SecretsManagerResourcePoliciesImpl.class); + + private final SecretsManagerResourcePoliciesClient innerClient; + + private final com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager; + + public SecretsManagerResourcePoliciesImpl(SecretsManagerResourcePoliciesClient innerClient, + com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return ResourceManagerUtils.mapPage(inner, + inner1 -> new SecretsManagerResourcePolicyImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return ResourceManagerUtils.mapPage(inner, + inner1 -> new SecretsManagerResourcePolicyImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName) { + PagedIterable inner + = this.serviceClient().listByResourceGroup(resourceGroupName); + return ResourceManagerUtils.mapPage(inner, + inner1 -> new SecretsManagerResourcePolicyImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + PagedIterable inner + = this.serviceClient().listByResourceGroup(resourceGroupName, context); + return ResourceManagerUtils.mapPage(inner, + inner1 -> new SecretsManagerResourcePolicyImpl(inner1, this.manager())); + } + + public Response getByResourceGroupWithResponse(String resourceGroupName, String name, + Context context) { + Response inner + = this.serviceClient().getByResourceGroupWithResponse(resourceGroupName, name, context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new SecretsManagerResourcePolicyImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public SecretsManagerResourcePolicy getByResourceGroup(String resourceGroupName, String name) { + SecretsManagerResourcePolicyInner inner = this.serviceClient().getByResourceGroup(resourceGroupName, name); + if (inner != null) { + return new SecretsManagerResourcePolicyImpl(inner, this.manager()); + } else { + return null; + } + } + + public void deleteByResourceGroup(String resourceGroupName, String name) { + this.serviceClient().delete(resourceGroupName, name); + } + + public void delete(String resourceGroupName, String name, Context context) { + this.serviceClient().delete(resourceGroupName, name, context); + } + + public SecretsManagerResourcePolicy getById(String id) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String name = ResourceManagerUtils.getValueFromIdByName(id, "secretsManagerResourcePolicies"); + if (name == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException(String.format( + "The resource ID '%s' is not valid. Missing path segment 'secretsManagerResourcePolicies'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, name, Context.NONE).getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String name = ResourceManagerUtils.getValueFromIdByName(id, "secretsManagerResourcePolicies"); + if (name == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException(String.format( + "The resource ID '%s' is not valid. Missing path segment 'secretsManagerResourcePolicies'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, name, context); + } + + public void deleteById(String id) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String name = ResourceManagerUtils.getValueFromIdByName(id, "secretsManagerResourcePolicies"); + if (name == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException(String.format( + "The resource ID '%s' is not valid. Missing path segment 'secretsManagerResourcePolicies'.", id))); + } + this.delete(resourceGroupName, name, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String name = ResourceManagerUtils.getValueFromIdByName(id, "secretsManagerResourcePolicies"); + if (name == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException(String.format( + "The resource ID '%s' is not valid. Missing path segment 'secretsManagerResourcePolicies'.", id))); + } + this.delete(resourceGroupName, name, context); + } + + private SecretsManagerResourcePoliciesClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.awsconnector.AwsconnectorManager manager() { + return this.serviceManager; + } + + public SecretsManagerResourcePolicyImpl define(String name) { + return new SecretsManagerResourcePolicyImpl(name, this.manager()); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/SecretsManagerResourcePolicyImpl.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/SecretsManagerResourcePolicyImpl.java new file mode 100644 index 000000000000..29af2728acb2 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/SecretsManagerResourcePolicyImpl.java @@ -0,0 +1,179 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.implementation; + +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.awsconnector.fluent.models.SecretsManagerResourcePolicyInner; +import com.azure.resourcemanager.awsconnector.models.SecretsManagerResourcePolicy; +import com.azure.resourcemanager.awsconnector.models.SecretsManagerResourcePolicyProperties; +import com.azure.resourcemanager.awsconnector.models.SecretsManagerResourcePolicyTagsUpdate; +import java.util.Collections; +import java.util.Map; + +public final class SecretsManagerResourcePolicyImpl implements SecretsManagerResourcePolicy, + SecretsManagerResourcePolicy.Definition, SecretsManagerResourcePolicy.Update { + private SecretsManagerResourcePolicyInner innerObject; + + private final com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public String location() { + return this.innerModel().location(); + } + + public Map tags() { + Map inner = this.innerModel().tags(); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } + } + + public SecretsManagerResourcePolicyProperties properties() { + return this.innerModel().properties(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public String resourceGroupName() { + return resourceGroupName; + } + + public SecretsManagerResourcePolicyInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.awsconnector.AwsconnectorManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String name; + + private SecretsManagerResourcePolicyTagsUpdate updateProperties; + + public SecretsManagerResourcePolicyImpl withExistingResourceGroup(String resourceGroupName) { + this.resourceGroupName = resourceGroupName; + return this; + } + + public SecretsManagerResourcePolicy create() { + this.innerObject = serviceManager.serviceClient() + .getSecretsManagerResourcePolicies() + .createOrReplace(resourceGroupName, name, this.innerModel(), Context.NONE); + return this; + } + + public SecretsManagerResourcePolicy create(Context context) { + this.innerObject = serviceManager.serviceClient() + .getSecretsManagerResourcePolicies() + .createOrReplace(resourceGroupName, name, this.innerModel(), context); + return this; + } + + SecretsManagerResourcePolicyImpl(String name, + com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager) { + this.innerObject = new SecretsManagerResourcePolicyInner(); + this.serviceManager = serviceManager; + this.name = name; + } + + public SecretsManagerResourcePolicyImpl update() { + this.updateProperties = new SecretsManagerResourcePolicyTagsUpdate(); + return this; + } + + public SecretsManagerResourcePolicy apply() { + this.innerObject = serviceManager.serviceClient() + .getSecretsManagerResourcePolicies() + .update(resourceGroupName, name, updateProperties, Context.NONE); + return this; + } + + public SecretsManagerResourcePolicy apply(Context context) { + this.innerObject = serviceManager.serviceClient() + .getSecretsManagerResourcePolicies() + .update(resourceGroupName, name, updateProperties, context); + return this; + } + + SecretsManagerResourcePolicyImpl(SecretsManagerResourcePolicyInner innerObject, + com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.name = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "secretsManagerResourcePolicies"); + } + + public SecretsManagerResourcePolicy refresh() { + this.innerObject = serviceManager.serviceClient() + .getSecretsManagerResourcePolicies() + .getByResourceGroupWithResponse(resourceGroupName, name, Context.NONE) + .getValue(); + return this; + } + + public SecretsManagerResourcePolicy refresh(Context context) { + this.innerObject = serviceManager.serviceClient() + .getSecretsManagerResourcePolicies() + .getByResourceGroupWithResponse(resourceGroupName, name, context) + .getValue(); + return this; + } + + public SecretsManagerResourcePolicyImpl withRegion(Region location) { + this.innerModel().withLocation(location.toString()); + return this; + } + + public SecretsManagerResourcePolicyImpl withRegion(String location) { + this.innerModel().withLocation(location); + return this; + } + + public SecretsManagerResourcePolicyImpl withTags(Map tags) { + if (isInCreateMode()) { + this.innerModel().withTags(tags); + return this; + } else { + this.updateProperties.withTags(tags); + return this; + } + } + + public SecretsManagerResourcePolicyImpl withProperties(SecretsManagerResourcePolicyProperties properties) { + this.innerModel().withProperties(properties); + return this; + } + + private boolean isInCreateMode() { + return this.innerModel().id() == null; + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/SecretsManagerSecretImpl.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/SecretsManagerSecretImpl.java new file mode 100644 index 000000000000..0091775e0c0a --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/SecretsManagerSecretImpl.java @@ -0,0 +1,178 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.implementation; + +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.awsconnector.fluent.models.SecretsManagerSecretInner; +import com.azure.resourcemanager.awsconnector.models.SecretsManagerSecret; +import com.azure.resourcemanager.awsconnector.models.SecretsManagerSecretProperties; +import com.azure.resourcemanager.awsconnector.models.SecretsManagerSecretTagsUpdate; +import java.util.Collections; +import java.util.Map; + +public final class SecretsManagerSecretImpl + implements SecretsManagerSecret, SecretsManagerSecret.Definition, SecretsManagerSecret.Update { + private SecretsManagerSecretInner innerObject; + + private final com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public String location() { + return this.innerModel().location(); + } + + public Map tags() { + Map inner = this.innerModel().tags(); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } + } + + public SecretsManagerSecretProperties properties() { + return this.innerModel().properties(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public String resourceGroupName() { + return resourceGroupName; + } + + public SecretsManagerSecretInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.awsconnector.AwsconnectorManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String name; + + private SecretsManagerSecretTagsUpdate updateProperties; + + public SecretsManagerSecretImpl withExistingResourceGroup(String resourceGroupName) { + this.resourceGroupName = resourceGroupName; + return this; + } + + public SecretsManagerSecret create() { + this.innerObject = serviceManager.serviceClient() + .getSecretsManagerSecrets() + .createOrReplace(resourceGroupName, name, this.innerModel(), Context.NONE); + return this; + } + + public SecretsManagerSecret create(Context context) { + this.innerObject = serviceManager.serviceClient() + .getSecretsManagerSecrets() + .createOrReplace(resourceGroupName, name, this.innerModel(), context); + return this; + } + + SecretsManagerSecretImpl(String name, com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager) { + this.innerObject = new SecretsManagerSecretInner(); + this.serviceManager = serviceManager; + this.name = name; + } + + public SecretsManagerSecretImpl update() { + this.updateProperties = new SecretsManagerSecretTagsUpdate(); + return this; + } + + public SecretsManagerSecret apply() { + this.innerObject = serviceManager.serviceClient() + .getSecretsManagerSecrets() + .update(resourceGroupName, name, updateProperties, Context.NONE); + return this; + } + + public SecretsManagerSecret apply(Context context) { + this.innerObject = serviceManager.serviceClient() + .getSecretsManagerSecrets() + .update(resourceGroupName, name, updateProperties, context); + return this; + } + + SecretsManagerSecretImpl(SecretsManagerSecretInner innerObject, + com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.name = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "secretsManagerSecrets"); + } + + public SecretsManagerSecret refresh() { + this.innerObject = serviceManager.serviceClient() + .getSecretsManagerSecrets() + .getByResourceGroupWithResponse(resourceGroupName, name, Context.NONE) + .getValue(); + return this; + } + + public SecretsManagerSecret refresh(Context context) { + this.innerObject = serviceManager.serviceClient() + .getSecretsManagerSecrets() + .getByResourceGroupWithResponse(resourceGroupName, name, context) + .getValue(); + return this; + } + + public SecretsManagerSecretImpl withRegion(Region location) { + this.innerModel().withLocation(location.toString()); + return this; + } + + public SecretsManagerSecretImpl withRegion(String location) { + this.innerModel().withLocation(location); + return this; + } + + public SecretsManagerSecretImpl withTags(Map tags) { + if (isInCreateMode()) { + this.innerModel().withTags(tags); + return this; + } else { + this.updateProperties.withTags(tags); + return this; + } + } + + public SecretsManagerSecretImpl withProperties(SecretsManagerSecretProperties properties) { + this.innerModel().withProperties(properties); + return this; + } + + private boolean isInCreateMode() { + return this.innerModel().id() == null; + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/SecretsManagerSecretsClientImpl.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/SecretsManagerSecretsClientImpl.java new file mode 100644 index 000000000000..46a370aaf391 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/SecretsManagerSecretsClientImpl.java @@ -0,0 +1,1283 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.Patch; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.awsconnector.fluent.SecretsManagerSecretsClient; +import com.azure.resourcemanager.awsconnector.fluent.models.SecretsManagerSecretInner; +import com.azure.resourcemanager.awsconnector.models.SecretsManagerSecretListResult; +import com.azure.resourcemanager.awsconnector.models.SecretsManagerSecretTagsUpdate; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in SecretsManagerSecretsClient. + */ +public final class SecretsManagerSecretsClientImpl implements SecretsManagerSecretsClient { + /** + * The proxy service used to perform REST calls. + */ + private final SecretsManagerSecretsService service; + + /** + * The service client containing this operation class. + */ + private final MicrosoftAwsConnectorImpl client; + + /** + * Initializes an instance of SecretsManagerSecretsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + SecretsManagerSecretsClientImpl(MicrosoftAwsConnectorImpl client) { + this.service = RestProxy.create(SecretsManagerSecretsService.class, client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for MicrosoftAwsConnectorSecretsManagerSecrets to be used by the proxy + * service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "MicrosoftAwsConnecto") + public interface SecretsManagerSecretsService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.AwsConnector/secretsManagerSecrets") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/secretsManagerSecrets") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroup(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/secretsManagerSecrets/{name}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getByResourceGroup(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("name") String name, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/secretsManagerSecrets/{name}") + @ExpectedResponses({ 200, 201 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrReplace(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("name") String name, + @BodyParam("application/json") SecretsManagerSecretInner resource, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/secretsManagerSecrets/{name}") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> update(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("name") String name, + @BodyParam("application/json") SecretsManagerSecretTagsUpdate properties, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/secretsManagerSecrets/{name}") + @ExpectedResponses({ 202, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("name") String name, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listBySubscriptionNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroupNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); + } + + /** + * List SecretsManagerSecret resources by subscription ID. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a SecretsManagerSecret list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync() { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List SecretsManagerSecret resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a SecretsManagerSecret list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), accept, + context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * List SecretsManagerSecret resources by subscription ID. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a SecretsManagerSecret list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>(() -> listSinglePageAsync(), + nextLink -> listBySubscriptionNextSinglePageAsync(nextLink)); + } + + /** + * List SecretsManagerSecret resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a SecretsManagerSecret list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(Context context) { + return new PagedFlux<>(() -> listSinglePageAsync(context), + nextLink -> listBySubscriptionNextSinglePageAsync(nextLink, context)); + } + + /** + * List SecretsManagerSecret resources by subscription ID. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a SecretsManagerSecret list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + return new PagedIterable<>(listAsync()); + } + + /** + * List SecretsManagerSecret resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a SecretsManagerSecret list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Context context) { + return new PagedIterable<>(listAsync(context)); + } + + /** + * List SecretsManagerSecret resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a SecretsManagerSecret list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> + listByResourceGroupSinglePageAsync(String resourceGroupName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List SecretsManagerSecret resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a SecretsManagerSecret list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * List SecretsManagerSecret resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a SecretsManagerSecret list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName) { + return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); + } + + /** + * List SecretsManagerSecret resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a SecretsManagerSecret list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName, Context context) { + return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName, context), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink, context)); + } + + /** + * List SecretsManagerSecret resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a SecretsManagerSecret list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName)); + } + + /** + * List SecretsManagerSecret resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a SecretsManagerSecret list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, context)); + } + + /** + * Get a SecretsManagerSecret. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of SecretsManagerSecret. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a SecretsManagerSecret along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync(String resourceGroupName, + String name) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.getByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get a SecretsManagerSecret. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of SecretsManagerSecret. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a SecretsManagerSecret along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync(String resourceGroupName, + String name, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.getByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, accept, context); + } + + /** + * Get a SecretsManagerSecret. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of SecretsManagerSecret. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a SecretsManagerSecret on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getByResourceGroupAsync(String resourceGroupName, String name) { + return getByResourceGroupWithResponseAsync(resourceGroupName, name) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Get a SecretsManagerSecret. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of SecretsManagerSecret. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a SecretsManagerSecret along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getByResourceGroupWithResponse(String resourceGroupName, String name, + Context context) { + return getByResourceGroupWithResponseAsync(resourceGroupName, name, context).block(); + } + + /** + * Get a SecretsManagerSecret. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of SecretsManagerSecret. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a SecretsManagerSecret. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SecretsManagerSecretInner getByResourceGroup(String resourceGroupName, String name) { + return getByResourceGroupWithResponse(resourceGroupName, name, Context.NONE).getValue(); + } + + /** + * Create a SecretsManagerSecret. Please note that end user resource creation is currently restricted, but it will + * be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of SecretsManagerSecret. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrReplaceWithResponseAsync(String resourceGroupName, String name, + SecretsManagerSecretInner resource) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (resource == null) { + return Mono.error(new IllegalArgumentException("Parameter resource is required and cannot be null.")); + } else { + resource.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.createOrReplace(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, resource, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Create a SecretsManagerSecret. Please note that end user resource creation is currently restricted, but it will + * be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of SecretsManagerSecret. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrReplaceWithResponseAsync(String resourceGroupName, String name, + SecretsManagerSecretInner resource, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (resource == null) { + return Mono.error(new IllegalArgumentException("Parameter resource is required and cannot be null.")); + } else { + resource.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.createOrReplace(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, resource, accept, context); + } + + /** + * Create a SecretsManagerSecret. Please note that end user resource creation is currently restricted, but it will + * be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of SecretsManagerSecret. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, SecretsManagerSecretInner> + beginCreateOrReplaceAsync(String resourceGroupName, String name, SecretsManagerSecretInner resource) { + Mono>> mono = createOrReplaceWithResponseAsync(resourceGroupName, name, resource); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), SecretsManagerSecretInner.class, SecretsManagerSecretInner.class, + this.client.getContext()); + } + + /** + * Create a SecretsManagerSecret. Please note that end user resource creation is currently restricted, but it will + * be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of SecretsManagerSecret. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, SecretsManagerSecretInner> beginCreateOrReplaceAsync( + String resourceGroupName, String name, SecretsManagerSecretInner resource, Context context) { + context = this.client.mergeContext(context); + Mono>> mono + = createOrReplaceWithResponseAsync(resourceGroupName, name, resource, context); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), SecretsManagerSecretInner.class, SecretsManagerSecretInner.class, context); + } + + /** + * Create a SecretsManagerSecret. Please note that end user resource creation is currently restricted, but it will + * be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of SecretsManagerSecret. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, SecretsManagerSecretInner> + beginCreateOrReplace(String resourceGroupName, String name, SecretsManagerSecretInner resource) { + return this.beginCreateOrReplaceAsync(resourceGroupName, name, resource).getSyncPoller(); + } + + /** + * Create a SecretsManagerSecret. Please note that end user resource creation is currently restricted, but it will + * be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of SecretsManagerSecret. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, SecretsManagerSecretInner> beginCreateOrReplace( + String resourceGroupName, String name, SecretsManagerSecretInner resource, Context context) { + return this.beginCreateOrReplaceAsync(resourceGroupName, name, resource, context).getSyncPoller(); + } + + /** + * Create a SecretsManagerSecret. Please note that end user resource creation is currently restricted, but it will + * be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of SecretsManagerSecret. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrReplaceAsync(String resourceGroupName, String name, + SecretsManagerSecretInner resource) { + return beginCreateOrReplaceAsync(resourceGroupName, name, resource).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create a SecretsManagerSecret. Please note that end user resource creation is currently restricted, but it will + * be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of SecretsManagerSecret. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrReplaceAsync(String resourceGroupName, String name, + SecretsManagerSecretInner resource, Context context) { + return beginCreateOrReplaceAsync(resourceGroupName, name, resource, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create a SecretsManagerSecret. Please note that end user resource creation is currently restricted, but it will + * be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of SecretsManagerSecret. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SecretsManagerSecretInner createOrReplace(String resourceGroupName, String name, + SecretsManagerSecretInner resource) { + return createOrReplaceAsync(resourceGroupName, name, resource).block(); + } + + /** + * Create a SecretsManagerSecret. Please note that end user resource creation is currently restricted, but it will + * be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of SecretsManagerSecret. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SecretsManagerSecretInner createOrReplace(String resourceGroupName, String name, + SecretsManagerSecretInner resource, Context context) { + return createOrReplaceAsync(resourceGroupName, name, resource, context).block(); + } + + /** + * Update a SecretsManagerSecret. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of SecretsManagerSecret. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync(String resourceGroupName, String name, + SecretsManagerSecretTagsUpdate properties) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (properties == null) { + return Mono.error(new IllegalArgumentException("Parameter properties is required and cannot be null.")); + } else { + properties.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.update(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, properties, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Update a SecretsManagerSecret. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of SecretsManagerSecret. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync(String resourceGroupName, String name, + SecretsManagerSecretTagsUpdate properties, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (properties == null) { + return Mono.error(new IllegalArgumentException("Parameter properties is required and cannot be null.")); + } else { + properties.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.update(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, name, properties, accept, context); + } + + /** + * Update a SecretsManagerSecret. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of SecretsManagerSecret. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, SecretsManagerSecretInner> + beginUpdateAsync(String resourceGroupName, String name, SecretsManagerSecretTagsUpdate properties) { + Mono>> mono = updateWithResponseAsync(resourceGroupName, name, properties); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), SecretsManagerSecretInner.class, SecretsManagerSecretInner.class, + this.client.getContext()); + } + + /** + * Update a SecretsManagerSecret. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of SecretsManagerSecret. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, SecretsManagerSecretInner> beginUpdateAsync( + String resourceGroupName, String name, SecretsManagerSecretTagsUpdate properties, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = updateWithResponseAsync(resourceGroupName, name, properties, context); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), SecretsManagerSecretInner.class, SecretsManagerSecretInner.class, context); + } + + /** + * Update a SecretsManagerSecret. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of SecretsManagerSecret. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, SecretsManagerSecretInner> + beginUpdate(String resourceGroupName, String name, SecretsManagerSecretTagsUpdate properties) { + return this.beginUpdateAsync(resourceGroupName, name, properties).getSyncPoller(); + } + + /** + * Update a SecretsManagerSecret. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of SecretsManagerSecret. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, SecretsManagerSecretInner> + beginUpdate(String resourceGroupName, String name, SecretsManagerSecretTagsUpdate properties, Context context) { + return this.beginUpdateAsync(resourceGroupName, name, properties, context).getSyncPoller(); + } + + /** + * Update a SecretsManagerSecret. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of SecretsManagerSecret. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync(String resourceGroupName, String name, + SecretsManagerSecretTagsUpdate properties) { + return beginUpdateAsync(resourceGroupName, name, properties).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Update a SecretsManagerSecret. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of SecretsManagerSecret. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync(String resourceGroupName, String name, + SecretsManagerSecretTagsUpdate properties, Context context) { + return beginUpdateAsync(resourceGroupName, name, properties, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Update a SecretsManagerSecret. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of SecretsManagerSecret. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SecretsManagerSecretInner update(String resourceGroupName, String name, + SecretsManagerSecretTagsUpdate properties) { + return updateAsync(resourceGroupName, name, properties).block(); + } + + /** + * Update a SecretsManagerSecret. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of SecretsManagerSecret. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SecretsManagerSecretInner update(String resourceGroupName, String name, + SecretsManagerSecretTagsUpdate properties, Context context) { + return updateAsync(resourceGroupName, name, properties, context).block(); + } + + /** + * Delete a SecretsManagerSecret. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of SecretsManagerSecret. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync(String resourceGroupName, String name) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Delete a SecretsManagerSecret. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of SecretsManagerSecret. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync(String resourceGroupName, String name, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.delete(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, name, accept, context); + } + + /** + * Delete a SecretsManagerSecret. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of SecretsManagerSecret. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String name) { + Mono>> mono = deleteWithResponseAsync(resourceGroupName, name); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); + } + + /** + * Delete a SecretsManagerSecret. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of SecretsManagerSecret. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String name, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = deleteWithResponseAsync(resourceGroupName, name, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + context); + } + + /** + * Delete a SecretsManagerSecret. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of SecretsManagerSecret. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String name) { + return this.beginDeleteAsync(resourceGroupName, name).getSyncPoller(); + } + + /** + * Delete a SecretsManagerSecret. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of SecretsManagerSecret. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String name, Context context) { + return this.beginDeleteAsync(resourceGroupName, name, context).getSyncPoller(); + } + + /** + * Delete a SecretsManagerSecret. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of SecretsManagerSecret. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String name) { + return beginDeleteAsync(resourceGroupName, name).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete a SecretsManagerSecret. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of SecretsManagerSecret. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String name, Context context) { + return beginDeleteAsync(resourceGroupName, name, context).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete a SecretsManagerSecret. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of SecretsManagerSecret. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String name) { + deleteAsync(resourceGroupName, name).block(); + } + + /** + * Delete a SecretsManagerSecret. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of SecretsManagerSecret. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String name, Context context) { + deleteAsync(resourceGroupName, name, context).block(); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a SecretsManagerSecret list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listBySubscriptionNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a SecretsManagerSecret list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listBySubscriptionNextSinglePageAsync(String nextLink, + Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a SecretsManagerSecret list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a SecretsManagerSecret list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupNextSinglePageAsync(String nextLink, + Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/SecretsManagerSecretsImpl.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/SecretsManagerSecretsImpl.java new file mode 100644 index 000000000000..5f060f427d09 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/SecretsManagerSecretsImpl.java @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.awsconnector.fluent.SecretsManagerSecretsClient; +import com.azure.resourcemanager.awsconnector.fluent.models.SecretsManagerSecretInner; +import com.azure.resourcemanager.awsconnector.models.SecretsManagerSecret; +import com.azure.resourcemanager.awsconnector.models.SecretsManagerSecrets; + +public final class SecretsManagerSecretsImpl implements SecretsManagerSecrets { + private static final ClientLogger LOGGER = new ClientLogger(SecretsManagerSecretsImpl.class); + + private final SecretsManagerSecretsClient innerClient; + + private final com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager; + + public SecretsManagerSecretsImpl(SecretsManagerSecretsClient innerClient, + com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return ResourceManagerUtils.mapPage(inner, inner1 -> new SecretsManagerSecretImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new SecretsManagerSecretImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName); + return ResourceManagerUtils.mapPage(inner, inner1 -> new SecretsManagerSecretImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + PagedIterable inner + = this.serviceClient().listByResourceGroup(resourceGroupName, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new SecretsManagerSecretImpl(inner1, this.manager())); + } + + public Response getByResourceGroupWithResponse(String resourceGroupName, String name, + Context context) { + Response inner + = this.serviceClient().getByResourceGroupWithResponse(resourceGroupName, name, context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new SecretsManagerSecretImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public SecretsManagerSecret getByResourceGroup(String resourceGroupName, String name) { + SecretsManagerSecretInner inner = this.serviceClient().getByResourceGroup(resourceGroupName, name); + if (inner != null) { + return new SecretsManagerSecretImpl(inner, this.manager()); + } else { + return null; + } + } + + public void deleteByResourceGroup(String resourceGroupName, String name) { + this.serviceClient().delete(resourceGroupName, name); + } + + public void delete(String resourceGroupName, String name, Context context) { + this.serviceClient().delete(resourceGroupName, name, context); + } + + public SecretsManagerSecret getById(String id) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String name = ResourceManagerUtils.getValueFromIdByName(id, "secretsManagerSecrets"); + if (name == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'secretsManagerSecrets'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, name, Context.NONE).getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String name = ResourceManagerUtils.getValueFromIdByName(id, "secretsManagerSecrets"); + if (name == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'secretsManagerSecrets'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, name, context); + } + + public void deleteById(String id) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String name = ResourceManagerUtils.getValueFromIdByName(id, "secretsManagerSecrets"); + if (name == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'secretsManagerSecrets'.", id))); + } + this.delete(resourceGroupName, name, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String name = ResourceManagerUtils.getValueFromIdByName(id, "secretsManagerSecrets"); + if (name == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'secretsManagerSecrets'.", id))); + } + this.delete(resourceGroupName, name, context); + } + + private SecretsManagerSecretsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.awsconnector.AwsconnectorManager manager() { + return this.serviceManager; + } + + public SecretsManagerSecretImpl define(String name) { + return new SecretsManagerSecretImpl(name, this.manager()); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/SnsSubscriptionImpl.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/SnsSubscriptionImpl.java new file mode 100644 index 000000000000..733783bb35e0 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/SnsSubscriptionImpl.java @@ -0,0 +1,177 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.implementation; + +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.awsconnector.fluent.models.SnsSubscriptionInner; +import com.azure.resourcemanager.awsconnector.models.SnsSubscription; +import com.azure.resourcemanager.awsconnector.models.SnsSubscriptionProperties; +import com.azure.resourcemanager.awsconnector.models.SnsSubscriptionTagsUpdate; +import java.util.Collections; +import java.util.Map; + +public final class SnsSubscriptionImpl implements SnsSubscription, SnsSubscription.Definition, SnsSubscription.Update { + private SnsSubscriptionInner innerObject; + + private final com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public String location() { + return this.innerModel().location(); + } + + public Map tags() { + Map inner = this.innerModel().tags(); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } + } + + public SnsSubscriptionProperties properties() { + return this.innerModel().properties(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public String resourceGroupName() { + return resourceGroupName; + } + + public SnsSubscriptionInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.awsconnector.AwsconnectorManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String name; + + private SnsSubscriptionTagsUpdate updateProperties; + + public SnsSubscriptionImpl withExistingResourceGroup(String resourceGroupName) { + this.resourceGroupName = resourceGroupName; + return this; + } + + public SnsSubscription create() { + this.innerObject = serviceManager.serviceClient() + .getSnsSubscriptions() + .createOrReplace(resourceGroupName, name, this.innerModel(), Context.NONE); + return this; + } + + public SnsSubscription create(Context context) { + this.innerObject = serviceManager.serviceClient() + .getSnsSubscriptions() + .createOrReplace(resourceGroupName, name, this.innerModel(), context); + return this; + } + + SnsSubscriptionImpl(String name, com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager) { + this.innerObject = new SnsSubscriptionInner(); + this.serviceManager = serviceManager; + this.name = name; + } + + public SnsSubscriptionImpl update() { + this.updateProperties = new SnsSubscriptionTagsUpdate(); + return this; + } + + public SnsSubscription apply() { + this.innerObject = serviceManager.serviceClient() + .getSnsSubscriptions() + .update(resourceGroupName, name, updateProperties, Context.NONE); + return this; + } + + public SnsSubscription apply(Context context) { + this.innerObject = serviceManager.serviceClient() + .getSnsSubscriptions() + .update(resourceGroupName, name, updateProperties, context); + return this; + } + + SnsSubscriptionImpl(SnsSubscriptionInner innerObject, + com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.name = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "snsSubscriptions"); + } + + public SnsSubscription refresh() { + this.innerObject = serviceManager.serviceClient() + .getSnsSubscriptions() + .getByResourceGroupWithResponse(resourceGroupName, name, Context.NONE) + .getValue(); + return this; + } + + public SnsSubscription refresh(Context context) { + this.innerObject = serviceManager.serviceClient() + .getSnsSubscriptions() + .getByResourceGroupWithResponse(resourceGroupName, name, context) + .getValue(); + return this; + } + + public SnsSubscriptionImpl withRegion(Region location) { + this.innerModel().withLocation(location.toString()); + return this; + } + + public SnsSubscriptionImpl withRegion(String location) { + this.innerModel().withLocation(location); + return this; + } + + public SnsSubscriptionImpl withTags(Map tags) { + if (isInCreateMode()) { + this.innerModel().withTags(tags); + return this; + } else { + this.updateProperties.withTags(tags); + return this; + } + } + + public SnsSubscriptionImpl withProperties(SnsSubscriptionProperties properties) { + this.innerModel().withProperties(properties); + return this; + } + + private boolean isInCreateMode() { + return this.innerModel().id() == null; + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/SnsSubscriptionsClientImpl.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/SnsSubscriptionsClientImpl.java new file mode 100644 index 000000000000..5497c27f2ab2 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/SnsSubscriptionsClientImpl.java @@ -0,0 +1,1278 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.Patch; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.awsconnector.fluent.SnsSubscriptionsClient; +import com.azure.resourcemanager.awsconnector.fluent.models.SnsSubscriptionInner; +import com.azure.resourcemanager.awsconnector.models.SnsSubscriptionListResult; +import com.azure.resourcemanager.awsconnector.models.SnsSubscriptionTagsUpdate; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in SnsSubscriptionsClient. + */ +public final class SnsSubscriptionsClientImpl implements SnsSubscriptionsClient { + /** + * The proxy service used to perform REST calls. + */ + private final SnsSubscriptionsService service; + + /** + * The service client containing this operation class. + */ + private final MicrosoftAwsConnectorImpl client; + + /** + * Initializes an instance of SnsSubscriptionsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + SnsSubscriptionsClientImpl(MicrosoftAwsConnectorImpl client) { + this.service + = RestProxy.create(SnsSubscriptionsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for MicrosoftAwsConnectorSnsSubscriptions to be used by the proxy service + * to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "MicrosoftAwsConnecto") + public interface SnsSubscriptionsService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.AwsConnector/snsSubscriptions") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/snsSubscriptions") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroup(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/snsSubscriptions/{name}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getByResourceGroup(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("name") String name, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/snsSubscriptions/{name}") + @ExpectedResponses({ 200, 201 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrReplace(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("name") String name, + @BodyParam("application/json") SnsSubscriptionInner resource, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/snsSubscriptions/{name}") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> update(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("name") String name, + @BodyParam("application/json") SnsSubscriptionTagsUpdate properties, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/snsSubscriptions/{name}") + @ExpectedResponses({ 202, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("name") String name, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listBySubscriptionNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroupNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); + } + + /** + * List SnsSubscription resources by subscription ID. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a SnsSubscription list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync() { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List SnsSubscription resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a SnsSubscription list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), accept, + context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * List SnsSubscription resources by subscription ID. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a SnsSubscription list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>(() -> listSinglePageAsync(), + nextLink -> listBySubscriptionNextSinglePageAsync(nextLink)); + } + + /** + * List SnsSubscription resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a SnsSubscription list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(Context context) { + return new PagedFlux<>(() -> listSinglePageAsync(context), + nextLink -> listBySubscriptionNextSinglePageAsync(nextLink, context)); + } + + /** + * List SnsSubscription resources by subscription ID. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a SnsSubscription list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + return new PagedIterable<>(listAsync()); + } + + /** + * List SnsSubscription resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a SnsSubscription list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Context context) { + return new PagedIterable<>(listAsync(context)); + } + + /** + * List SnsSubscription resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a SnsSubscription list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List SnsSubscription resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a SnsSubscription list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * List SnsSubscription resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a SnsSubscription list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName) { + return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); + } + + /** + * List SnsSubscription resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a SnsSubscription list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName, Context context) { + return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName, context), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink, context)); + } + + /** + * List SnsSubscription resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a SnsSubscription list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName)); + } + + /** + * List SnsSubscription resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a SnsSubscription list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, context)); + } + + /** + * Get a SnsSubscription. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of SnsSubscription. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a SnsSubscription along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync(String resourceGroupName, + String name) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.getByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get a SnsSubscription. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of SnsSubscription. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a SnsSubscription along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync(String resourceGroupName, + String name, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.getByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, accept, context); + } + + /** + * Get a SnsSubscription. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of SnsSubscription. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a SnsSubscription on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getByResourceGroupAsync(String resourceGroupName, String name) { + return getByResourceGroupWithResponseAsync(resourceGroupName, name) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Get a SnsSubscription. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of SnsSubscription. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a SnsSubscription along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getByResourceGroupWithResponse(String resourceGroupName, String name, + Context context) { + return getByResourceGroupWithResponseAsync(resourceGroupName, name, context).block(); + } + + /** + * Get a SnsSubscription. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of SnsSubscription. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a SnsSubscription. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SnsSubscriptionInner getByResourceGroup(String resourceGroupName, String name) { + return getByResourceGroupWithResponse(resourceGroupName, name, Context.NONE).getValue(); + } + + /** + * Create a SnsSubscription. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of SnsSubscription. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrReplaceWithResponseAsync(String resourceGroupName, String name, + SnsSubscriptionInner resource) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (resource == null) { + return Mono.error(new IllegalArgumentException("Parameter resource is required and cannot be null.")); + } else { + resource.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.createOrReplace(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, resource, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Create a SnsSubscription. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of SnsSubscription. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrReplaceWithResponseAsync(String resourceGroupName, String name, + SnsSubscriptionInner resource, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (resource == null) { + return Mono.error(new IllegalArgumentException("Parameter resource is required and cannot be null.")); + } else { + resource.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.createOrReplace(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, resource, accept, context); + } + + /** + * Create a SnsSubscription. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of SnsSubscription. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, SnsSubscriptionInner> + beginCreateOrReplaceAsync(String resourceGroupName, String name, SnsSubscriptionInner resource) { + Mono>> mono = createOrReplaceWithResponseAsync(resourceGroupName, name, resource); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + SnsSubscriptionInner.class, SnsSubscriptionInner.class, this.client.getContext()); + } + + /** + * Create a SnsSubscription. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of SnsSubscription. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, SnsSubscriptionInner> beginCreateOrReplaceAsync( + String resourceGroupName, String name, SnsSubscriptionInner resource, Context context) { + context = this.client.mergeContext(context); + Mono>> mono + = createOrReplaceWithResponseAsync(resourceGroupName, name, resource, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + SnsSubscriptionInner.class, SnsSubscriptionInner.class, context); + } + + /** + * Create a SnsSubscription. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of SnsSubscription. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, SnsSubscriptionInner> + beginCreateOrReplace(String resourceGroupName, String name, SnsSubscriptionInner resource) { + return this.beginCreateOrReplaceAsync(resourceGroupName, name, resource).getSyncPoller(); + } + + /** + * Create a SnsSubscription. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of SnsSubscription. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, SnsSubscriptionInner> + beginCreateOrReplace(String resourceGroupName, String name, SnsSubscriptionInner resource, Context context) { + return this.beginCreateOrReplaceAsync(resourceGroupName, name, resource, context).getSyncPoller(); + } + + /** + * Create a SnsSubscription. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of SnsSubscription. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrReplaceAsync(String resourceGroupName, String name, + SnsSubscriptionInner resource) { + return beginCreateOrReplaceAsync(resourceGroupName, name, resource).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create a SnsSubscription. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of SnsSubscription. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrReplaceAsync(String resourceGroupName, String name, + SnsSubscriptionInner resource, Context context) { + return beginCreateOrReplaceAsync(resourceGroupName, name, resource, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create a SnsSubscription. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of SnsSubscription. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SnsSubscriptionInner createOrReplace(String resourceGroupName, String name, SnsSubscriptionInner resource) { + return createOrReplaceAsync(resourceGroupName, name, resource).block(); + } + + /** + * Create a SnsSubscription. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of SnsSubscription. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SnsSubscriptionInner createOrReplace(String resourceGroupName, String name, SnsSubscriptionInner resource, + Context context) { + return createOrReplaceAsync(resourceGroupName, name, resource, context).block(); + } + + /** + * Update a SnsSubscription. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of SnsSubscription. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync(String resourceGroupName, String name, + SnsSubscriptionTagsUpdate properties) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (properties == null) { + return Mono.error(new IllegalArgumentException("Parameter properties is required and cannot be null.")); + } else { + properties.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.update(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, properties, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Update a SnsSubscription. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of SnsSubscription. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync(String resourceGroupName, String name, + SnsSubscriptionTagsUpdate properties, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (properties == null) { + return Mono.error(new IllegalArgumentException("Parameter properties is required and cannot be null.")); + } else { + properties.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.update(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, name, properties, accept, context); + } + + /** + * Update a SnsSubscription. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of SnsSubscription. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, SnsSubscriptionInner> + beginUpdateAsync(String resourceGroupName, String name, SnsSubscriptionTagsUpdate properties) { + Mono>> mono = updateWithResponseAsync(resourceGroupName, name, properties); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + SnsSubscriptionInner.class, SnsSubscriptionInner.class, this.client.getContext()); + } + + /** + * Update a SnsSubscription. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of SnsSubscription. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, SnsSubscriptionInner> + beginUpdateAsync(String resourceGroupName, String name, SnsSubscriptionTagsUpdate properties, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = updateWithResponseAsync(resourceGroupName, name, properties, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + SnsSubscriptionInner.class, SnsSubscriptionInner.class, context); + } + + /** + * Update a SnsSubscription. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of SnsSubscription. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, SnsSubscriptionInner> beginUpdate(String resourceGroupName, + String name, SnsSubscriptionTagsUpdate properties) { + return this.beginUpdateAsync(resourceGroupName, name, properties).getSyncPoller(); + } + + /** + * Update a SnsSubscription. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of SnsSubscription. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, SnsSubscriptionInner> beginUpdate(String resourceGroupName, + String name, SnsSubscriptionTagsUpdate properties, Context context) { + return this.beginUpdateAsync(resourceGroupName, name, properties, context).getSyncPoller(); + } + + /** + * Update a SnsSubscription. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of SnsSubscription. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync(String resourceGroupName, String name, + SnsSubscriptionTagsUpdate properties) { + return beginUpdateAsync(resourceGroupName, name, properties).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Update a SnsSubscription. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of SnsSubscription. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync(String resourceGroupName, String name, + SnsSubscriptionTagsUpdate properties, Context context) { + return beginUpdateAsync(resourceGroupName, name, properties, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Update a SnsSubscription. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of SnsSubscription. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SnsSubscriptionInner update(String resourceGroupName, String name, SnsSubscriptionTagsUpdate properties) { + return updateAsync(resourceGroupName, name, properties).block(); + } + + /** + * Update a SnsSubscription. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of SnsSubscription. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SnsSubscriptionInner update(String resourceGroupName, String name, SnsSubscriptionTagsUpdate properties, + Context context) { + return updateAsync(resourceGroupName, name, properties, context).block(); + } + + /** + * Delete a SnsSubscription. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of SnsSubscription. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync(String resourceGroupName, String name) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Delete a SnsSubscription. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of SnsSubscription. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync(String resourceGroupName, String name, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.delete(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, name, accept, context); + } + + /** + * Delete a SnsSubscription. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of SnsSubscription. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String name) { + Mono>> mono = deleteWithResponseAsync(resourceGroupName, name); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); + } + + /** + * Delete a SnsSubscription. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of SnsSubscription. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String name, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = deleteWithResponseAsync(resourceGroupName, name, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + context); + } + + /** + * Delete a SnsSubscription. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of SnsSubscription. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String name) { + return this.beginDeleteAsync(resourceGroupName, name).getSyncPoller(); + } + + /** + * Delete a SnsSubscription. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of SnsSubscription. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String name, Context context) { + return this.beginDeleteAsync(resourceGroupName, name, context).getSyncPoller(); + } + + /** + * Delete a SnsSubscription. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of SnsSubscription. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String name) { + return beginDeleteAsync(resourceGroupName, name).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete a SnsSubscription. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of SnsSubscription. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String name, Context context) { + return beginDeleteAsync(resourceGroupName, name, context).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete a SnsSubscription. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of SnsSubscription. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String name) { + deleteAsync(resourceGroupName, name).block(); + } + + /** + * Delete a SnsSubscription. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of SnsSubscription. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String name, Context context) { + deleteAsync(resourceGroupName, name, context).block(); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a SnsSubscription list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listBySubscriptionNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a SnsSubscription list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listBySubscriptionNextSinglePageAsync(String nextLink, + Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a SnsSubscription list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a SnsSubscription list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupNextSinglePageAsync(String nextLink, + Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/SnsSubscriptionsImpl.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/SnsSubscriptionsImpl.java new file mode 100644 index 000000000000..2aaba89f18c1 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/SnsSubscriptionsImpl.java @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.awsconnector.fluent.SnsSubscriptionsClient; +import com.azure.resourcemanager.awsconnector.fluent.models.SnsSubscriptionInner; +import com.azure.resourcemanager.awsconnector.models.SnsSubscription; +import com.azure.resourcemanager.awsconnector.models.SnsSubscriptions; + +public final class SnsSubscriptionsImpl implements SnsSubscriptions { + private static final ClientLogger LOGGER = new ClientLogger(SnsSubscriptionsImpl.class); + + private final SnsSubscriptionsClient innerClient; + + private final com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager; + + public SnsSubscriptionsImpl(SnsSubscriptionsClient innerClient, + com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return ResourceManagerUtils.mapPage(inner, inner1 -> new SnsSubscriptionImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new SnsSubscriptionImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName); + return ResourceManagerUtils.mapPage(inner, inner1 -> new SnsSubscriptionImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + PagedIterable inner + = this.serviceClient().listByResourceGroup(resourceGroupName, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new SnsSubscriptionImpl(inner1, this.manager())); + } + + public Response getByResourceGroupWithResponse(String resourceGroupName, String name, + Context context) { + Response inner + = this.serviceClient().getByResourceGroupWithResponse(resourceGroupName, name, context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new SnsSubscriptionImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public SnsSubscription getByResourceGroup(String resourceGroupName, String name) { + SnsSubscriptionInner inner = this.serviceClient().getByResourceGroup(resourceGroupName, name); + if (inner != null) { + return new SnsSubscriptionImpl(inner, this.manager()); + } else { + return null; + } + } + + public void deleteByResourceGroup(String resourceGroupName, String name) { + this.serviceClient().delete(resourceGroupName, name); + } + + public void delete(String resourceGroupName, String name, Context context) { + this.serviceClient().delete(resourceGroupName, name, context); + } + + public SnsSubscription getById(String id) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String name = ResourceManagerUtils.getValueFromIdByName(id, "snsSubscriptions"); + if (name == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'snsSubscriptions'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, name, Context.NONE).getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String name = ResourceManagerUtils.getValueFromIdByName(id, "snsSubscriptions"); + if (name == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'snsSubscriptions'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, name, context); + } + + public void deleteById(String id) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String name = ResourceManagerUtils.getValueFromIdByName(id, "snsSubscriptions"); + if (name == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'snsSubscriptions'.", id))); + } + this.delete(resourceGroupName, name, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String name = ResourceManagerUtils.getValueFromIdByName(id, "snsSubscriptions"); + if (name == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'snsSubscriptions'.", id))); + } + this.delete(resourceGroupName, name, context); + } + + private SnsSubscriptionsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.awsconnector.AwsconnectorManager manager() { + return this.serviceManager; + } + + public SnsSubscriptionImpl define(String name) { + return new SnsSubscriptionImpl(name, this.manager()); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/SnsTopicImpl.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/SnsTopicImpl.java new file mode 100644 index 000000000000..537d81f4c8c5 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/SnsTopicImpl.java @@ -0,0 +1,175 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.implementation; + +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.awsconnector.fluent.models.SnsTopicInner; +import com.azure.resourcemanager.awsconnector.models.SnsTopic; +import com.azure.resourcemanager.awsconnector.models.SnsTopicProperties; +import com.azure.resourcemanager.awsconnector.models.SnsTopicTagsUpdate; +import java.util.Collections; +import java.util.Map; + +public final class SnsTopicImpl implements SnsTopic, SnsTopic.Definition, SnsTopic.Update { + private SnsTopicInner innerObject; + + private final com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public String location() { + return this.innerModel().location(); + } + + public Map tags() { + Map inner = this.innerModel().tags(); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } + } + + public SnsTopicProperties properties() { + return this.innerModel().properties(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public String resourceGroupName() { + return resourceGroupName; + } + + public SnsTopicInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.awsconnector.AwsconnectorManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String name; + + private SnsTopicTagsUpdate updateProperties; + + public SnsTopicImpl withExistingResourceGroup(String resourceGroupName) { + this.resourceGroupName = resourceGroupName; + return this; + } + + public SnsTopic create() { + this.innerObject = serviceManager.serviceClient() + .getSnsTopics() + .createOrReplace(resourceGroupName, name, this.innerModel(), Context.NONE); + return this; + } + + public SnsTopic create(Context context) { + this.innerObject = serviceManager.serviceClient() + .getSnsTopics() + .createOrReplace(resourceGroupName, name, this.innerModel(), context); + return this; + } + + SnsTopicImpl(String name, com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager) { + this.innerObject = new SnsTopicInner(); + this.serviceManager = serviceManager; + this.name = name; + } + + public SnsTopicImpl update() { + this.updateProperties = new SnsTopicTagsUpdate(); + return this; + } + + public SnsTopic apply() { + this.innerObject = serviceManager.serviceClient() + .getSnsTopics() + .update(resourceGroupName, name, updateProperties, Context.NONE); + return this; + } + + public SnsTopic apply(Context context) { + this.innerObject + = serviceManager.serviceClient().getSnsTopics().update(resourceGroupName, name, updateProperties, context); + return this; + } + + SnsTopicImpl(SnsTopicInner innerObject, com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.name = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "snsTopics"); + } + + public SnsTopic refresh() { + this.innerObject = serviceManager.serviceClient() + .getSnsTopics() + .getByResourceGroupWithResponse(resourceGroupName, name, Context.NONE) + .getValue(); + return this; + } + + public SnsTopic refresh(Context context) { + this.innerObject = serviceManager.serviceClient() + .getSnsTopics() + .getByResourceGroupWithResponse(resourceGroupName, name, context) + .getValue(); + return this; + } + + public SnsTopicImpl withRegion(Region location) { + this.innerModel().withLocation(location.toString()); + return this; + } + + public SnsTopicImpl withRegion(String location) { + this.innerModel().withLocation(location); + return this; + } + + public SnsTopicImpl withTags(Map tags) { + if (isInCreateMode()) { + this.innerModel().withTags(tags); + return this; + } else { + this.updateProperties.withTags(tags); + return this; + } + } + + public SnsTopicImpl withProperties(SnsTopicProperties properties) { + this.innerModel().withProperties(properties); + return this; + } + + private boolean isInCreateMode() { + return this.innerModel().id() == null; + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/SnsTopicsClientImpl.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/SnsTopicsClientImpl.java new file mode 100644 index 000000000000..1152bb400b02 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/SnsTopicsClientImpl.java @@ -0,0 +1,1273 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.Patch; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.awsconnector.fluent.SnsTopicsClient; +import com.azure.resourcemanager.awsconnector.fluent.models.SnsTopicInner; +import com.azure.resourcemanager.awsconnector.models.SnsTopicListResult; +import com.azure.resourcemanager.awsconnector.models.SnsTopicTagsUpdate; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in SnsTopicsClient. + */ +public final class SnsTopicsClientImpl implements SnsTopicsClient { + /** + * The proxy service used to perform REST calls. + */ + private final SnsTopicsService service; + + /** + * The service client containing this operation class. + */ + private final MicrosoftAwsConnectorImpl client; + + /** + * Initializes an instance of SnsTopicsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + SnsTopicsClientImpl(MicrosoftAwsConnectorImpl client) { + this.service + = RestProxy.create(SnsTopicsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for MicrosoftAwsConnectorSnsTopics to be used by the proxy service to + * perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "MicrosoftAwsConnecto") + public interface SnsTopicsService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.AwsConnector/snsTopics") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/snsTopics") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroup(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/snsTopics/{name}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getByResourceGroup(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("name") String name, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/snsTopics/{name}") + @ExpectedResponses({ 200, 201 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrReplace(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("name") String name, + @BodyParam("application/json") SnsTopicInner resource, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/snsTopics/{name}") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> update(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("name") String name, + @BodyParam("application/json") SnsTopicTagsUpdate properties, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/snsTopics/{name}") + @ExpectedResponses({ 202, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("name") String name, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listBySubscriptionNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroupNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); + } + + /** + * List SnsTopic resources by subscription ID. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a SnsTopic list operation along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync() { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), + res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List SnsTopic resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a SnsTopic list operation along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), accept, + context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * List SnsTopic resources by subscription ID. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a SnsTopic list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>(() -> listSinglePageAsync(), + nextLink -> listBySubscriptionNextSinglePageAsync(nextLink)); + } + + /** + * List SnsTopic resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a SnsTopic list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(Context context) { + return new PagedFlux<>(() -> listSinglePageAsync(context), + nextLink -> listBySubscriptionNextSinglePageAsync(nextLink, context)); + } + + /** + * List SnsTopic resources by subscription ID. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a SnsTopic list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + return new PagedIterable<>(listAsync()); + } + + /** + * List SnsTopic resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a SnsTopic list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Context context) { + return new PagedIterable<>(listAsync(context)); + } + + /** + * List SnsTopic resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a SnsTopic list operation along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), + res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List SnsTopic resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a SnsTopic list operation along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * List SnsTopic resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a SnsTopic list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName) { + return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); + } + + /** + * List SnsTopic resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a SnsTopic list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName, Context context) { + return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName, context), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink, context)); + } + + /** + * List SnsTopic resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a SnsTopic list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName)); + } + + /** + * List SnsTopic resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a SnsTopic list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, context)); + } + + /** + * Get a SnsTopic. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of SnsTopic. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a SnsTopic along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync(String resourceGroupName, String name) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.getByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get a SnsTopic. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of SnsTopic. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a SnsTopic along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync(String resourceGroupName, String name, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.getByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, accept, context); + } + + /** + * Get a SnsTopic. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of SnsTopic. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a SnsTopic on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getByResourceGroupAsync(String resourceGroupName, String name) { + return getByResourceGroupWithResponseAsync(resourceGroupName, name) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Get a SnsTopic. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of SnsTopic. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a SnsTopic along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getByResourceGroupWithResponse(String resourceGroupName, String name, + Context context) { + return getByResourceGroupWithResponseAsync(resourceGroupName, name, context).block(); + } + + /** + * Get a SnsTopic. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of SnsTopic. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a SnsTopic. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SnsTopicInner getByResourceGroup(String resourceGroupName, String name) { + return getByResourceGroupWithResponse(resourceGroupName, name, Context.NONE).getValue(); + } + + /** + * Create a SnsTopic. Please note that end user resource creation is currently restricted, but it will be enabled in + * the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of SnsTopic. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrReplaceWithResponseAsync(String resourceGroupName, String name, + SnsTopicInner resource) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (resource == null) { + return Mono.error(new IllegalArgumentException("Parameter resource is required and cannot be null.")); + } else { + resource.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.createOrReplace(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, resource, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Create a SnsTopic. Please note that end user resource creation is currently restricted, but it will be enabled in + * the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of SnsTopic. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrReplaceWithResponseAsync(String resourceGroupName, String name, + SnsTopicInner resource, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (resource == null) { + return Mono.error(new IllegalArgumentException("Parameter resource is required and cannot be null.")); + } else { + resource.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.createOrReplace(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, resource, accept, context); + } + + /** + * Create a SnsTopic. Please note that end user resource creation is currently restricted, but it will be enabled in + * the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of SnsTopic. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, SnsTopicInner> beginCreateOrReplaceAsync(String resourceGroupName, + String name, SnsTopicInner resource) { + Mono>> mono = createOrReplaceWithResponseAsync(resourceGroupName, name, resource); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + SnsTopicInner.class, SnsTopicInner.class, this.client.getContext()); + } + + /** + * Create a SnsTopic. Please note that end user resource creation is currently restricted, but it will be enabled in + * the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of SnsTopic. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, SnsTopicInner> beginCreateOrReplaceAsync(String resourceGroupName, + String name, SnsTopicInner resource, Context context) { + context = this.client.mergeContext(context); + Mono>> mono + = createOrReplaceWithResponseAsync(resourceGroupName, name, resource, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + SnsTopicInner.class, SnsTopicInner.class, context); + } + + /** + * Create a SnsTopic. Please note that end user resource creation is currently restricted, but it will be enabled in + * the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of SnsTopic. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, SnsTopicInner> beginCreateOrReplace(String resourceGroupName, + String name, SnsTopicInner resource) { + return this.beginCreateOrReplaceAsync(resourceGroupName, name, resource).getSyncPoller(); + } + + /** + * Create a SnsTopic. Please note that end user resource creation is currently restricted, but it will be enabled in + * the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of SnsTopic. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, SnsTopicInner> beginCreateOrReplace(String resourceGroupName, + String name, SnsTopicInner resource, Context context) { + return this.beginCreateOrReplaceAsync(resourceGroupName, name, resource, context).getSyncPoller(); + } + + /** + * Create a SnsTopic. Please note that end user resource creation is currently restricted, but it will be enabled in + * the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of SnsTopic. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrReplaceAsync(String resourceGroupName, String name, SnsTopicInner resource) { + return beginCreateOrReplaceAsync(resourceGroupName, name, resource).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create a SnsTopic. Please note that end user resource creation is currently restricted, but it will be enabled in + * the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of SnsTopic. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrReplaceAsync(String resourceGroupName, String name, SnsTopicInner resource, + Context context) { + return beginCreateOrReplaceAsync(resourceGroupName, name, resource, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create a SnsTopic. Please note that end user resource creation is currently restricted, but it will be enabled in + * the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of SnsTopic. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SnsTopicInner createOrReplace(String resourceGroupName, String name, SnsTopicInner resource) { + return createOrReplaceAsync(resourceGroupName, name, resource).block(); + } + + /** + * Create a SnsTopic. Please note that end user resource creation is currently restricted, but it will be enabled in + * the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of SnsTopic. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SnsTopicInner createOrReplace(String resourceGroupName, String name, SnsTopicInner resource, + Context context) { + return createOrReplaceAsync(resourceGroupName, name, resource, context).block(); + } + + /** + * Update a SnsTopic. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of SnsTopic. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync(String resourceGroupName, String name, + SnsTopicTagsUpdate properties) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (properties == null) { + return Mono.error(new IllegalArgumentException("Parameter properties is required and cannot be null.")); + } else { + properties.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.update(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, properties, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Update a SnsTopic. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of SnsTopic. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync(String resourceGroupName, String name, + SnsTopicTagsUpdate properties, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (properties == null) { + return Mono.error(new IllegalArgumentException("Parameter properties is required and cannot be null.")); + } else { + properties.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.update(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, name, properties, accept, context); + } + + /** + * Update a SnsTopic. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of SnsTopic. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, SnsTopicInner> beginUpdateAsync(String resourceGroupName, String name, + SnsTopicTagsUpdate properties) { + Mono>> mono = updateWithResponseAsync(resourceGroupName, name, properties); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + SnsTopicInner.class, SnsTopicInner.class, this.client.getContext()); + } + + /** + * Update a SnsTopic. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of SnsTopic. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, SnsTopicInner> beginUpdateAsync(String resourceGroupName, String name, + SnsTopicTagsUpdate properties, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = updateWithResponseAsync(resourceGroupName, name, properties, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + SnsTopicInner.class, SnsTopicInner.class, context); + } + + /** + * Update a SnsTopic. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of SnsTopic. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, SnsTopicInner> beginUpdate(String resourceGroupName, String name, + SnsTopicTagsUpdate properties) { + return this.beginUpdateAsync(resourceGroupName, name, properties).getSyncPoller(); + } + + /** + * Update a SnsTopic. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of SnsTopic. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, SnsTopicInner> beginUpdate(String resourceGroupName, String name, + SnsTopicTagsUpdate properties, Context context) { + return this.beginUpdateAsync(resourceGroupName, name, properties, context).getSyncPoller(); + } + + /** + * Update a SnsTopic. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of SnsTopic. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync(String resourceGroupName, String name, SnsTopicTagsUpdate properties) { + return beginUpdateAsync(resourceGroupName, name, properties).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Update a SnsTopic. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of SnsTopic. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync(String resourceGroupName, String name, SnsTopicTagsUpdate properties, + Context context) { + return beginUpdateAsync(resourceGroupName, name, properties, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Update a SnsTopic. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of SnsTopic. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SnsTopicInner update(String resourceGroupName, String name, SnsTopicTagsUpdate properties) { + return updateAsync(resourceGroupName, name, properties).block(); + } + + /** + * Update a SnsTopic. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of SnsTopic. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SnsTopicInner update(String resourceGroupName, String name, SnsTopicTagsUpdate properties, Context context) { + return updateAsync(resourceGroupName, name, properties, context).block(); + } + + /** + * Delete a SnsTopic. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of SnsTopic. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync(String resourceGroupName, String name) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Delete a SnsTopic. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of SnsTopic. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync(String resourceGroupName, String name, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.delete(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, name, accept, context); + } + + /** + * Delete a SnsTopic. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of SnsTopic. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String name) { + Mono>> mono = deleteWithResponseAsync(resourceGroupName, name); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); + } + + /** + * Delete a SnsTopic. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of SnsTopic. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String name, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = deleteWithResponseAsync(resourceGroupName, name, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + context); + } + + /** + * Delete a SnsTopic. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of SnsTopic. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String name) { + return this.beginDeleteAsync(resourceGroupName, name).getSyncPoller(); + } + + /** + * Delete a SnsTopic. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of SnsTopic. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String name, Context context) { + return this.beginDeleteAsync(resourceGroupName, name, context).getSyncPoller(); + } + + /** + * Delete a SnsTopic. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of SnsTopic. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String name) { + return beginDeleteAsync(resourceGroupName, name).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete a SnsTopic. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of SnsTopic. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String name, Context context) { + return beginDeleteAsync(resourceGroupName, name, context).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete a SnsTopic. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of SnsTopic. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String name) { + deleteAsync(resourceGroupName, name).block(); + } + + /** + * Delete a SnsTopic. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of SnsTopic. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String name, Context context) { + deleteAsync(resourceGroupName, name, context).block(); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a SnsTopic list operation along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listBySubscriptionNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), + res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a SnsTopic list operation along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listBySubscriptionNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a SnsTopic list operation along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), + res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a SnsTopic list operation along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupNextSinglePageAsync(String nextLink, + Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/SnsTopicsImpl.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/SnsTopicsImpl.java new file mode 100644 index 000000000000..f7fc4a39c19a --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/SnsTopicsImpl.java @@ -0,0 +1,145 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.awsconnector.fluent.SnsTopicsClient; +import com.azure.resourcemanager.awsconnector.fluent.models.SnsTopicInner; +import com.azure.resourcemanager.awsconnector.models.SnsTopic; +import com.azure.resourcemanager.awsconnector.models.SnsTopics; + +public final class SnsTopicsImpl implements SnsTopics { + private static final ClientLogger LOGGER = new ClientLogger(SnsTopicsImpl.class); + + private final SnsTopicsClient innerClient; + + private final com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager; + + public SnsTopicsImpl(SnsTopicsClient innerClient, + com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return ResourceManagerUtils.mapPage(inner, inner1 -> new SnsTopicImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new SnsTopicImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName); + return ResourceManagerUtils.mapPage(inner, inner1 -> new SnsTopicImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new SnsTopicImpl(inner1, this.manager())); + } + + public Response getByResourceGroupWithResponse(String resourceGroupName, String name, Context context) { + Response inner + = this.serviceClient().getByResourceGroupWithResponse(resourceGroupName, name, context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new SnsTopicImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public SnsTopic getByResourceGroup(String resourceGroupName, String name) { + SnsTopicInner inner = this.serviceClient().getByResourceGroup(resourceGroupName, name); + if (inner != null) { + return new SnsTopicImpl(inner, this.manager()); + } else { + return null; + } + } + + public void deleteByResourceGroup(String resourceGroupName, String name) { + this.serviceClient().delete(resourceGroupName, name); + } + + public void delete(String resourceGroupName, String name, Context context) { + this.serviceClient().delete(resourceGroupName, name, context); + } + + public SnsTopic getById(String id) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String name = ResourceManagerUtils.getValueFromIdByName(id, "snsTopics"); + if (name == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'snsTopics'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, name, Context.NONE).getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String name = ResourceManagerUtils.getValueFromIdByName(id, "snsTopics"); + if (name == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'snsTopics'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, name, context); + } + + public void deleteById(String id) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String name = ResourceManagerUtils.getValueFromIdByName(id, "snsTopics"); + if (name == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'snsTopics'.", id))); + } + this.delete(resourceGroupName, name, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String name = ResourceManagerUtils.getValueFromIdByName(id, "snsTopics"); + if (name == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'snsTopics'.", id))); + } + this.delete(resourceGroupName, name, context); + } + + private SnsTopicsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.awsconnector.AwsconnectorManager manager() { + return this.serviceManager; + } + + public SnsTopicImpl define(String name) { + return new SnsTopicImpl(name, this.manager()); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/SqsQueueImpl.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/SqsQueueImpl.java new file mode 100644 index 000000000000..a8f76ad051da --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/SqsQueueImpl.java @@ -0,0 +1,175 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.implementation; + +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.awsconnector.fluent.models.SqsQueueInner; +import com.azure.resourcemanager.awsconnector.models.SqsQueue; +import com.azure.resourcemanager.awsconnector.models.SqsQueueProperties; +import com.azure.resourcemanager.awsconnector.models.SqsQueueTagsUpdate; +import java.util.Collections; +import java.util.Map; + +public final class SqsQueueImpl implements SqsQueue, SqsQueue.Definition, SqsQueue.Update { + private SqsQueueInner innerObject; + + private final com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public String location() { + return this.innerModel().location(); + } + + public Map tags() { + Map inner = this.innerModel().tags(); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } + } + + public SqsQueueProperties properties() { + return this.innerModel().properties(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public String resourceGroupName() { + return resourceGroupName; + } + + public SqsQueueInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.awsconnector.AwsconnectorManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String name; + + private SqsQueueTagsUpdate updateProperties; + + public SqsQueueImpl withExistingResourceGroup(String resourceGroupName) { + this.resourceGroupName = resourceGroupName; + return this; + } + + public SqsQueue create() { + this.innerObject = serviceManager.serviceClient() + .getSqsQueues() + .createOrReplace(resourceGroupName, name, this.innerModel(), Context.NONE); + return this; + } + + public SqsQueue create(Context context) { + this.innerObject = serviceManager.serviceClient() + .getSqsQueues() + .createOrReplace(resourceGroupName, name, this.innerModel(), context); + return this; + } + + SqsQueueImpl(String name, com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager) { + this.innerObject = new SqsQueueInner(); + this.serviceManager = serviceManager; + this.name = name; + } + + public SqsQueueImpl update() { + this.updateProperties = new SqsQueueTagsUpdate(); + return this; + } + + public SqsQueue apply() { + this.innerObject = serviceManager.serviceClient() + .getSqsQueues() + .update(resourceGroupName, name, updateProperties, Context.NONE); + return this; + } + + public SqsQueue apply(Context context) { + this.innerObject + = serviceManager.serviceClient().getSqsQueues().update(resourceGroupName, name, updateProperties, context); + return this; + } + + SqsQueueImpl(SqsQueueInner innerObject, com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.name = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "sqsQueues"); + } + + public SqsQueue refresh() { + this.innerObject = serviceManager.serviceClient() + .getSqsQueues() + .getByResourceGroupWithResponse(resourceGroupName, name, Context.NONE) + .getValue(); + return this; + } + + public SqsQueue refresh(Context context) { + this.innerObject = serviceManager.serviceClient() + .getSqsQueues() + .getByResourceGroupWithResponse(resourceGroupName, name, context) + .getValue(); + return this; + } + + public SqsQueueImpl withRegion(Region location) { + this.innerModel().withLocation(location.toString()); + return this; + } + + public SqsQueueImpl withRegion(String location) { + this.innerModel().withLocation(location); + return this; + } + + public SqsQueueImpl withTags(Map tags) { + if (isInCreateMode()) { + this.innerModel().withTags(tags); + return this; + } else { + this.updateProperties.withTags(tags); + return this; + } + } + + public SqsQueueImpl withProperties(SqsQueueProperties properties) { + this.innerModel().withProperties(properties); + return this; + } + + private boolean isInCreateMode() { + return this.innerModel().id() == null; + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/SqsQueuesClientImpl.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/SqsQueuesClientImpl.java new file mode 100644 index 000000000000..e17483d7f6ed --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/SqsQueuesClientImpl.java @@ -0,0 +1,1273 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.Patch; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.awsconnector.fluent.SqsQueuesClient; +import com.azure.resourcemanager.awsconnector.fluent.models.SqsQueueInner; +import com.azure.resourcemanager.awsconnector.models.SqsQueueListResult; +import com.azure.resourcemanager.awsconnector.models.SqsQueueTagsUpdate; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in SqsQueuesClient. + */ +public final class SqsQueuesClientImpl implements SqsQueuesClient { + /** + * The proxy service used to perform REST calls. + */ + private final SqsQueuesService service; + + /** + * The service client containing this operation class. + */ + private final MicrosoftAwsConnectorImpl client; + + /** + * Initializes an instance of SqsQueuesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + SqsQueuesClientImpl(MicrosoftAwsConnectorImpl client) { + this.service + = RestProxy.create(SqsQueuesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for MicrosoftAwsConnectorSqsQueues to be used by the proxy service to + * perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "MicrosoftAwsConnecto") + public interface SqsQueuesService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.AwsConnector/sqsQueues") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/sqsQueues") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroup(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/sqsQueues/{name}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getByResourceGroup(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("name") String name, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/sqsQueues/{name}") + @ExpectedResponses({ 200, 201 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrReplace(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("name") String name, + @BodyParam("application/json") SqsQueueInner resource, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/sqsQueues/{name}") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> update(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("name") String name, + @BodyParam("application/json") SqsQueueTagsUpdate properties, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/sqsQueues/{name}") + @ExpectedResponses({ 202, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("name") String name, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listBySubscriptionNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroupNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); + } + + /** + * List SqsQueue resources by subscription ID. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a SqsQueue list operation along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync() { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), + res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List SqsQueue resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a SqsQueue list operation along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), accept, + context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * List SqsQueue resources by subscription ID. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a SqsQueue list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>(() -> listSinglePageAsync(), + nextLink -> listBySubscriptionNextSinglePageAsync(nextLink)); + } + + /** + * List SqsQueue resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a SqsQueue list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(Context context) { + return new PagedFlux<>(() -> listSinglePageAsync(context), + nextLink -> listBySubscriptionNextSinglePageAsync(nextLink, context)); + } + + /** + * List SqsQueue resources by subscription ID. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a SqsQueue list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + return new PagedIterable<>(listAsync()); + } + + /** + * List SqsQueue resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a SqsQueue list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Context context) { + return new PagedIterable<>(listAsync(context)); + } + + /** + * List SqsQueue resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a SqsQueue list operation along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), + res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List SqsQueue resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a SqsQueue list operation along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * List SqsQueue resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a SqsQueue list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName) { + return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); + } + + /** + * List SqsQueue resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a SqsQueue list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName, Context context) { + return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName, context), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink, context)); + } + + /** + * List SqsQueue resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a SqsQueue list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName)); + } + + /** + * List SqsQueue resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a SqsQueue list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, context)); + } + + /** + * Get a SqsQueue. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of SqsQueue. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a SqsQueue along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync(String resourceGroupName, String name) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.getByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get a SqsQueue. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of SqsQueue. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a SqsQueue along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync(String resourceGroupName, String name, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.getByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, accept, context); + } + + /** + * Get a SqsQueue. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of SqsQueue. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a SqsQueue on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getByResourceGroupAsync(String resourceGroupName, String name) { + return getByResourceGroupWithResponseAsync(resourceGroupName, name) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Get a SqsQueue. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of SqsQueue. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a SqsQueue along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getByResourceGroupWithResponse(String resourceGroupName, String name, + Context context) { + return getByResourceGroupWithResponseAsync(resourceGroupName, name, context).block(); + } + + /** + * Get a SqsQueue. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of SqsQueue. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a SqsQueue. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SqsQueueInner getByResourceGroup(String resourceGroupName, String name) { + return getByResourceGroupWithResponse(resourceGroupName, name, Context.NONE).getValue(); + } + + /** + * Create a SqsQueue. Please note that end user resource creation is currently restricted, but it will be enabled in + * the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of SqsQueue. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrReplaceWithResponseAsync(String resourceGroupName, String name, + SqsQueueInner resource) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (resource == null) { + return Mono.error(new IllegalArgumentException("Parameter resource is required and cannot be null.")); + } else { + resource.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.createOrReplace(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, resource, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Create a SqsQueue. Please note that end user resource creation is currently restricted, but it will be enabled in + * the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of SqsQueue. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrReplaceWithResponseAsync(String resourceGroupName, String name, + SqsQueueInner resource, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (resource == null) { + return Mono.error(new IllegalArgumentException("Parameter resource is required and cannot be null.")); + } else { + resource.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.createOrReplace(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, resource, accept, context); + } + + /** + * Create a SqsQueue. Please note that end user resource creation is currently restricted, but it will be enabled in + * the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of SqsQueue. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, SqsQueueInner> beginCreateOrReplaceAsync(String resourceGroupName, + String name, SqsQueueInner resource) { + Mono>> mono = createOrReplaceWithResponseAsync(resourceGroupName, name, resource); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + SqsQueueInner.class, SqsQueueInner.class, this.client.getContext()); + } + + /** + * Create a SqsQueue. Please note that end user resource creation is currently restricted, but it will be enabled in + * the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of SqsQueue. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, SqsQueueInner> beginCreateOrReplaceAsync(String resourceGroupName, + String name, SqsQueueInner resource, Context context) { + context = this.client.mergeContext(context); + Mono>> mono + = createOrReplaceWithResponseAsync(resourceGroupName, name, resource, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + SqsQueueInner.class, SqsQueueInner.class, context); + } + + /** + * Create a SqsQueue. Please note that end user resource creation is currently restricted, but it will be enabled in + * the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of SqsQueue. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, SqsQueueInner> beginCreateOrReplace(String resourceGroupName, + String name, SqsQueueInner resource) { + return this.beginCreateOrReplaceAsync(resourceGroupName, name, resource).getSyncPoller(); + } + + /** + * Create a SqsQueue. Please note that end user resource creation is currently restricted, but it will be enabled in + * the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of SqsQueue. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, SqsQueueInner> beginCreateOrReplace(String resourceGroupName, + String name, SqsQueueInner resource, Context context) { + return this.beginCreateOrReplaceAsync(resourceGroupName, name, resource, context).getSyncPoller(); + } + + /** + * Create a SqsQueue. Please note that end user resource creation is currently restricted, but it will be enabled in + * the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of SqsQueue. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrReplaceAsync(String resourceGroupName, String name, SqsQueueInner resource) { + return beginCreateOrReplaceAsync(resourceGroupName, name, resource).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create a SqsQueue. Please note that end user resource creation is currently restricted, but it will be enabled in + * the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of SqsQueue. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrReplaceAsync(String resourceGroupName, String name, SqsQueueInner resource, + Context context) { + return beginCreateOrReplaceAsync(resourceGroupName, name, resource, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create a SqsQueue. Please note that end user resource creation is currently restricted, but it will be enabled in + * the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of SqsQueue. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SqsQueueInner createOrReplace(String resourceGroupName, String name, SqsQueueInner resource) { + return createOrReplaceAsync(resourceGroupName, name, resource).block(); + } + + /** + * Create a SqsQueue. Please note that end user resource creation is currently restricted, but it will be enabled in + * the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of SqsQueue. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SqsQueueInner createOrReplace(String resourceGroupName, String name, SqsQueueInner resource, + Context context) { + return createOrReplaceAsync(resourceGroupName, name, resource, context).block(); + } + + /** + * Update a SqsQueue. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of SqsQueue. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync(String resourceGroupName, String name, + SqsQueueTagsUpdate properties) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (properties == null) { + return Mono.error(new IllegalArgumentException("Parameter properties is required and cannot be null.")); + } else { + properties.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.update(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, properties, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Update a SqsQueue. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of SqsQueue. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync(String resourceGroupName, String name, + SqsQueueTagsUpdate properties, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (properties == null) { + return Mono.error(new IllegalArgumentException("Parameter properties is required and cannot be null.")); + } else { + properties.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.update(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, name, properties, accept, context); + } + + /** + * Update a SqsQueue. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of SqsQueue. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, SqsQueueInner> beginUpdateAsync(String resourceGroupName, String name, + SqsQueueTagsUpdate properties) { + Mono>> mono = updateWithResponseAsync(resourceGroupName, name, properties); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + SqsQueueInner.class, SqsQueueInner.class, this.client.getContext()); + } + + /** + * Update a SqsQueue. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of SqsQueue. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, SqsQueueInner> beginUpdateAsync(String resourceGroupName, String name, + SqsQueueTagsUpdate properties, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = updateWithResponseAsync(resourceGroupName, name, properties, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + SqsQueueInner.class, SqsQueueInner.class, context); + } + + /** + * Update a SqsQueue. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of SqsQueue. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, SqsQueueInner> beginUpdate(String resourceGroupName, String name, + SqsQueueTagsUpdate properties) { + return this.beginUpdateAsync(resourceGroupName, name, properties).getSyncPoller(); + } + + /** + * Update a SqsQueue. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of SqsQueue. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, SqsQueueInner> beginUpdate(String resourceGroupName, String name, + SqsQueueTagsUpdate properties, Context context) { + return this.beginUpdateAsync(resourceGroupName, name, properties, context).getSyncPoller(); + } + + /** + * Update a SqsQueue. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of SqsQueue. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync(String resourceGroupName, String name, SqsQueueTagsUpdate properties) { + return beginUpdateAsync(resourceGroupName, name, properties).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Update a SqsQueue. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of SqsQueue. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync(String resourceGroupName, String name, SqsQueueTagsUpdate properties, + Context context) { + return beginUpdateAsync(resourceGroupName, name, properties, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Update a SqsQueue. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of SqsQueue. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SqsQueueInner update(String resourceGroupName, String name, SqsQueueTagsUpdate properties) { + return updateAsync(resourceGroupName, name, properties).block(); + } + + /** + * Update a SqsQueue. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of SqsQueue. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SqsQueueInner update(String resourceGroupName, String name, SqsQueueTagsUpdate properties, Context context) { + return updateAsync(resourceGroupName, name, properties, context).block(); + } + + /** + * Delete a SqsQueue. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of SqsQueue. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync(String resourceGroupName, String name) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Delete a SqsQueue. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of SqsQueue. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync(String resourceGroupName, String name, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.delete(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, name, accept, context); + } + + /** + * Delete a SqsQueue. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of SqsQueue. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String name) { + Mono>> mono = deleteWithResponseAsync(resourceGroupName, name); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); + } + + /** + * Delete a SqsQueue. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of SqsQueue. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String name, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = deleteWithResponseAsync(resourceGroupName, name, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + context); + } + + /** + * Delete a SqsQueue. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of SqsQueue. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String name) { + return this.beginDeleteAsync(resourceGroupName, name).getSyncPoller(); + } + + /** + * Delete a SqsQueue. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of SqsQueue. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String name, Context context) { + return this.beginDeleteAsync(resourceGroupName, name, context).getSyncPoller(); + } + + /** + * Delete a SqsQueue. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of SqsQueue. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String name) { + return beginDeleteAsync(resourceGroupName, name).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete a SqsQueue. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of SqsQueue. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String name, Context context) { + return beginDeleteAsync(resourceGroupName, name, context).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete a SqsQueue. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of SqsQueue. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String name) { + deleteAsync(resourceGroupName, name).block(); + } + + /** + * Delete a SqsQueue. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of SqsQueue. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String name, Context context) { + deleteAsync(resourceGroupName, name, context).block(); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a SqsQueue list operation along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listBySubscriptionNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), + res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a SqsQueue list operation along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listBySubscriptionNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a SqsQueue list operation along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), + res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a SqsQueue list operation along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupNextSinglePageAsync(String nextLink, + Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/SqsQueuesImpl.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/SqsQueuesImpl.java new file mode 100644 index 000000000000..d1f163d0461e --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/SqsQueuesImpl.java @@ -0,0 +1,145 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.awsconnector.fluent.SqsQueuesClient; +import com.azure.resourcemanager.awsconnector.fluent.models.SqsQueueInner; +import com.azure.resourcemanager.awsconnector.models.SqsQueue; +import com.azure.resourcemanager.awsconnector.models.SqsQueues; + +public final class SqsQueuesImpl implements SqsQueues { + private static final ClientLogger LOGGER = new ClientLogger(SqsQueuesImpl.class); + + private final SqsQueuesClient innerClient; + + private final com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager; + + public SqsQueuesImpl(SqsQueuesClient innerClient, + com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return ResourceManagerUtils.mapPage(inner, inner1 -> new SqsQueueImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new SqsQueueImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName); + return ResourceManagerUtils.mapPage(inner, inner1 -> new SqsQueueImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new SqsQueueImpl(inner1, this.manager())); + } + + public Response getByResourceGroupWithResponse(String resourceGroupName, String name, Context context) { + Response inner + = this.serviceClient().getByResourceGroupWithResponse(resourceGroupName, name, context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new SqsQueueImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public SqsQueue getByResourceGroup(String resourceGroupName, String name) { + SqsQueueInner inner = this.serviceClient().getByResourceGroup(resourceGroupName, name); + if (inner != null) { + return new SqsQueueImpl(inner, this.manager()); + } else { + return null; + } + } + + public void deleteByResourceGroup(String resourceGroupName, String name) { + this.serviceClient().delete(resourceGroupName, name); + } + + public void delete(String resourceGroupName, String name, Context context) { + this.serviceClient().delete(resourceGroupName, name, context); + } + + public SqsQueue getById(String id) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String name = ResourceManagerUtils.getValueFromIdByName(id, "sqsQueues"); + if (name == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'sqsQueues'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, name, Context.NONE).getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String name = ResourceManagerUtils.getValueFromIdByName(id, "sqsQueues"); + if (name == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'sqsQueues'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, name, context); + } + + public void deleteById(String id) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String name = ResourceManagerUtils.getValueFromIdByName(id, "sqsQueues"); + if (name == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'sqsQueues'.", id))); + } + this.delete(resourceGroupName, name, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String name = ResourceManagerUtils.getValueFromIdByName(id, "sqsQueues"); + if (name == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'sqsQueues'.", id))); + } + this.delete(resourceGroupName, name, context); + } + + private SqsQueuesClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.awsconnector.AwsconnectorManager manager() { + return this.serviceManager; + } + + public SqsQueueImpl define(String name) { + return new SqsQueueImpl(name, this.manager()); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/SsmInstanceInformationImpl.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/SsmInstanceInformationImpl.java new file mode 100644 index 000000000000..8204321fb8f3 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/SsmInstanceInformationImpl.java @@ -0,0 +1,178 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.implementation; + +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.awsconnector.fluent.models.SsmInstanceInformationInner; +import com.azure.resourcemanager.awsconnector.models.SsmInstanceInformation; +import com.azure.resourcemanager.awsconnector.models.SsmInstanceInformationProperties; +import com.azure.resourcemanager.awsconnector.models.SsmInstanceInformationTagsUpdate; +import java.util.Collections; +import java.util.Map; + +public final class SsmInstanceInformationImpl + implements SsmInstanceInformation, SsmInstanceInformation.Definition, SsmInstanceInformation.Update { + private SsmInstanceInformationInner innerObject; + + private final com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public String location() { + return this.innerModel().location(); + } + + public Map tags() { + Map inner = this.innerModel().tags(); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } + } + + public SsmInstanceInformationProperties properties() { + return this.innerModel().properties(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public String resourceGroupName() { + return resourceGroupName; + } + + public SsmInstanceInformationInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.awsconnector.AwsconnectorManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String name; + + private SsmInstanceInformationTagsUpdate updateProperties; + + public SsmInstanceInformationImpl withExistingResourceGroup(String resourceGroupName) { + this.resourceGroupName = resourceGroupName; + return this; + } + + public SsmInstanceInformation create() { + this.innerObject = serviceManager.serviceClient() + .getSsmInstanceInformations() + .createOrReplace(resourceGroupName, name, this.innerModel(), Context.NONE); + return this; + } + + public SsmInstanceInformation create(Context context) { + this.innerObject = serviceManager.serviceClient() + .getSsmInstanceInformations() + .createOrReplace(resourceGroupName, name, this.innerModel(), context); + return this; + } + + SsmInstanceInformationImpl(String name, com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager) { + this.innerObject = new SsmInstanceInformationInner(); + this.serviceManager = serviceManager; + this.name = name; + } + + public SsmInstanceInformationImpl update() { + this.updateProperties = new SsmInstanceInformationTagsUpdate(); + return this; + } + + public SsmInstanceInformation apply() { + this.innerObject = serviceManager.serviceClient() + .getSsmInstanceInformations() + .update(resourceGroupName, name, updateProperties, Context.NONE); + return this; + } + + public SsmInstanceInformation apply(Context context) { + this.innerObject = serviceManager.serviceClient() + .getSsmInstanceInformations() + .update(resourceGroupName, name, updateProperties, context); + return this; + } + + SsmInstanceInformationImpl(SsmInstanceInformationInner innerObject, + com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.name = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "ssmInstanceInformations"); + } + + public SsmInstanceInformation refresh() { + this.innerObject = serviceManager.serviceClient() + .getSsmInstanceInformations() + .getByResourceGroupWithResponse(resourceGroupName, name, Context.NONE) + .getValue(); + return this; + } + + public SsmInstanceInformation refresh(Context context) { + this.innerObject = serviceManager.serviceClient() + .getSsmInstanceInformations() + .getByResourceGroupWithResponse(resourceGroupName, name, context) + .getValue(); + return this; + } + + public SsmInstanceInformationImpl withRegion(Region location) { + this.innerModel().withLocation(location.toString()); + return this; + } + + public SsmInstanceInformationImpl withRegion(String location) { + this.innerModel().withLocation(location); + return this; + } + + public SsmInstanceInformationImpl withTags(Map tags) { + if (isInCreateMode()) { + this.innerModel().withTags(tags); + return this; + } else { + this.updateProperties.withTags(tags); + return this; + } + } + + public SsmInstanceInformationImpl withProperties(SsmInstanceInformationProperties properties) { + this.innerModel().withProperties(properties); + return this; + } + + private boolean isInCreateMode() { + return this.innerModel().id() == null; + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/SsmInstanceInformationsClientImpl.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/SsmInstanceInformationsClientImpl.java new file mode 100644 index 000000000000..ab47972c95b4 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/SsmInstanceInformationsClientImpl.java @@ -0,0 +1,1285 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.Patch; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.awsconnector.fluent.SsmInstanceInformationsClient; +import com.azure.resourcemanager.awsconnector.fluent.models.SsmInstanceInformationInner; +import com.azure.resourcemanager.awsconnector.models.SsmInstanceInformationListResult; +import com.azure.resourcemanager.awsconnector.models.SsmInstanceInformationTagsUpdate; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in SsmInstanceInformationsClient. + */ +public final class SsmInstanceInformationsClientImpl implements SsmInstanceInformationsClient { + /** + * The proxy service used to perform REST calls. + */ + private final SsmInstanceInformationsService service; + + /** + * The service client containing this operation class. + */ + private final MicrosoftAwsConnectorImpl client; + + /** + * Initializes an instance of SsmInstanceInformationsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + SsmInstanceInformationsClientImpl(MicrosoftAwsConnectorImpl client) { + this.service = RestProxy.create(SsmInstanceInformationsService.class, client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for MicrosoftAwsConnectorSsmInstanceInformations to be used by the proxy + * service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "MicrosoftAwsConnecto") + public interface SsmInstanceInformationsService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.AwsConnector/ssmInstanceInformations") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/ssmInstanceInformations") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroup(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/ssmInstanceInformations/{name}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getByResourceGroup(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("name") String name, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/ssmInstanceInformations/{name}") + @ExpectedResponses({ 200, 201 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrReplace(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("name") String name, + @BodyParam("application/json") SsmInstanceInformationInner resource, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/ssmInstanceInformations/{name}") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> update(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("name") String name, + @BodyParam("application/json") SsmInstanceInformationTagsUpdate properties, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/ssmInstanceInformations/{name}") + @ExpectedResponses({ 202, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("name") String name, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listBySubscriptionNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroupNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); + } + + /** + * List SsmInstanceInformation resources by subscription ID. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a SsmInstanceInformation list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync() { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List SsmInstanceInformation resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a SsmInstanceInformation list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), accept, + context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * List SsmInstanceInformation resources by subscription ID. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a SsmInstanceInformation list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>(() -> listSinglePageAsync(), + nextLink -> listBySubscriptionNextSinglePageAsync(nextLink)); + } + + /** + * List SsmInstanceInformation resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a SsmInstanceInformation list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(Context context) { + return new PagedFlux<>(() -> listSinglePageAsync(context), + nextLink -> listBySubscriptionNextSinglePageAsync(nextLink, context)); + } + + /** + * List SsmInstanceInformation resources by subscription ID. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a SsmInstanceInformation list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + return new PagedIterable<>(listAsync()); + } + + /** + * List SsmInstanceInformation resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a SsmInstanceInformation list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Context context) { + return new PagedIterable<>(listAsync(context)); + } + + /** + * List SsmInstanceInformation resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a SsmInstanceInformation list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> + listByResourceGroupSinglePageAsync(String resourceGroupName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List SsmInstanceInformation resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a SsmInstanceInformation list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> + listByResourceGroupSinglePageAsync(String resourceGroupName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * List SsmInstanceInformation resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a SsmInstanceInformation list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName) { + return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); + } + + /** + * List SsmInstanceInformation resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a SsmInstanceInformation list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName, Context context) { + return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName, context), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink, context)); + } + + /** + * List SsmInstanceInformation resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a SsmInstanceInformation list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName)); + } + + /** + * List SsmInstanceInformation resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a SsmInstanceInformation list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, context)); + } + + /** + * Get a SsmInstanceInformation. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of SsmInstanceInformation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a SsmInstanceInformation along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync(String resourceGroupName, + String name) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.getByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get a SsmInstanceInformation. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of SsmInstanceInformation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a SsmInstanceInformation along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync(String resourceGroupName, + String name, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.getByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, accept, context); + } + + /** + * Get a SsmInstanceInformation. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of SsmInstanceInformation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a SsmInstanceInformation on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getByResourceGroupAsync(String resourceGroupName, String name) { + return getByResourceGroupWithResponseAsync(resourceGroupName, name) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Get a SsmInstanceInformation. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of SsmInstanceInformation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a SsmInstanceInformation along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getByResourceGroupWithResponse(String resourceGroupName, String name, + Context context) { + return getByResourceGroupWithResponseAsync(resourceGroupName, name, context).block(); + } + + /** + * Get a SsmInstanceInformation. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of SsmInstanceInformation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a SsmInstanceInformation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SsmInstanceInformationInner getByResourceGroup(String resourceGroupName, String name) { + return getByResourceGroupWithResponse(resourceGroupName, name, Context.NONE).getValue(); + } + + /** + * Create a SsmInstanceInformation. Please note that end user resource creation is currently restricted, but it will + * be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of SsmInstanceInformation. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrReplaceWithResponseAsync(String resourceGroupName, String name, + SsmInstanceInformationInner resource) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (resource == null) { + return Mono.error(new IllegalArgumentException("Parameter resource is required and cannot be null.")); + } else { + resource.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.createOrReplace(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, resource, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Create a SsmInstanceInformation. Please note that end user resource creation is currently restricted, but it will + * be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of SsmInstanceInformation. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrReplaceWithResponseAsync(String resourceGroupName, String name, + SsmInstanceInformationInner resource, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (resource == null) { + return Mono.error(new IllegalArgumentException("Parameter resource is required and cannot be null.")); + } else { + resource.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.createOrReplace(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, resource, accept, context); + } + + /** + * Create a SsmInstanceInformation. Please note that end user resource creation is currently restricted, but it will + * be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of SsmInstanceInformation. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, SsmInstanceInformationInner> + beginCreateOrReplaceAsync(String resourceGroupName, String name, SsmInstanceInformationInner resource) { + Mono>> mono = createOrReplaceWithResponseAsync(resourceGroupName, name, resource); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), SsmInstanceInformationInner.class, SsmInstanceInformationInner.class, + this.client.getContext()); + } + + /** + * Create a SsmInstanceInformation. Please note that end user resource creation is currently restricted, but it will + * be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of SsmInstanceInformation. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, SsmInstanceInformationInner> beginCreateOrReplaceAsync( + String resourceGroupName, String name, SsmInstanceInformationInner resource, Context context) { + context = this.client.mergeContext(context); + Mono>> mono + = createOrReplaceWithResponseAsync(resourceGroupName, name, resource, context); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), SsmInstanceInformationInner.class, SsmInstanceInformationInner.class, + context); + } + + /** + * Create a SsmInstanceInformation. Please note that end user resource creation is currently restricted, but it will + * be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of SsmInstanceInformation. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, SsmInstanceInformationInner> + beginCreateOrReplace(String resourceGroupName, String name, SsmInstanceInformationInner resource) { + return this.beginCreateOrReplaceAsync(resourceGroupName, name, resource).getSyncPoller(); + } + + /** + * Create a SsmInstanceInformation. Please note that end user resource creation is currently restricted, but it will + * be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of SsmInstanceInformation. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, SsmInstanceInformationInner> beginCreateOrReplace( + String resourceGroupName, String name, SsmInstanceInformationInner resource, Context context) { + return this.beginCreateOrReplaceAsync(resourceGroupName, name, resource, context).getSyncPoller(); + } + + /** + * Create a SsmInstanceInformation. Please note that end user resource creation is currently restricted, but it will + * be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of SsmInstanceInformation. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrReplaceAsync(String resourceGroupName, String name, + SsmInstanceInformationInner resource) { + return beginCreateOrReplaceAsync(resourceGroupName, name, resource).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create a SsmInstanceInformation. Please note that end user resource creation is currently restricted, but it will + * be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of SsmInstanceInformation. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrReplaceAsync(String resourceGroupName, String name, + SsmInstanceInformationInner resource, Context context) { + return beginCreateOrReplaceAsync(resourceGroupName, name, resource, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create a SsmInstanceInformation. Please note that end user resource creation is currently restricted, but it will + * be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of SsmInstanceInformation. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SsmInstanceInformationInner createOrReplace(String resourceGroupName, String name, + SsmInstanceInformationInner resource) { + return createOrReplaceAsync(resourceGroupName, name, resource).block(); + } + + /** + * Create a SsmInstanceInformation. Please note that end user resource creation is currently restricted, but it will + * be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of SsmInstanceInformation. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SsmInstanceInformationInner createOrReplace(String resourceGroupName, String name, + SsmInstanceInformationInner resource, Context context) { + return createOrReplaceAsync(resourceGroupName, name, resource, context).block(); + } + + /** + * Update a SsmInstanceInformation. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of SsmInstanceInformation. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync(String resourceGroupName, String name, + SsmInstanceInformationTagsUpdate properties) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (properties == null) { + return Mono.error(new IllegalArgumentException("Parameter properties is required and cannot be null.")); + } else { + properties.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.update(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, properties, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Update a SsmInstanceInformation. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of SsmInstanceInformation. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync(String resourceGroupName, String name, + SsmInstanceInformationTagsUpdate properties, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (properties == null) { + return Mono.error(new IllegalArgumentException("Parameter properties is required and cannot be null.")); + } else { + properties.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.update(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, name, properties, accept, context); + } + + /** + * Update a SsmInstanceInformation. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of SsmInstanceInformation. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, SsmInstanceInformationInner> + beginUpdateAsync(String resourceGroupName, String name, SsmInstanceInformationTagsUpdate properties) { + Mono>> mono = updateWithResponseAsync(resourceGroupName, name, properties); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), SsmInstanceInformationInner.class, SsmInstanceInformationInner.class, + this.client.getContext()); + } + + /** + * Update a SsmInstanceInformation. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of SsmInstanceInformation. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, SsmInstanceInformationInner> beginUpdateAsync( + String resourceGroupName, String name, SsmInstanceInformationTagsUpdate properties, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = updateWithResponseAsync(resourceGroupName, name, properties, context); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), SsmInstanceInformationInner.class, SsmInstanceInformationInner.class, + context); + } + + /** + * Update a SsmInstanceInformation. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of SsmInstanceInformation. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, SsmInstanceInformationInner> + beginUpdate(String resourceGroupName, String name, SsmInstanceInformationTagsUpdate properties) { + return this.beginUpdateAsync(resourceGroupName, name, properties).getSyncPoller(); + } + + /** + * Update a SsmInstanceInformation. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of SsmInstanceInformation. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, SsmInstanceInformationInner> beginUpdate( + String resourceGroupName, String name, SsmInstanceInformationTagsUpdate properties, Context context) { + return this.beginUpdateAsync(resourceGroupName, name, properties, context).getSyncPoller(); + } + + /** + * Update a SsmInstanceInformation. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of SsmInstanceInformation. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync(String resourceGroupName, String name, + SsmInstanceInformationTagsUpdate properties) { + return beginUpdateAsync(resourceGroupName, name, properties).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Update a SsmInstanceInformation. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of SsmInstanceInformation. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync(String resourceGroupName, String name, + SsmInstanceInformationTagsUpdate properties, Context context) { + return beginUpdateAsync(resourceGroupName, name, properties, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Update a SsmInstanceInformation. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of SsmInstanceInformation. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SsmInstanceInformationInner update(String resourceGroupName, String name, + SsmInstanceInformationTagsUpdate properties) { + return updateAsync(resourceGroupName, name, properties).block(); + } + + /** + * Update a SsmInstanceInformation. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of SsmInstanceInformation. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SsmInstanceInformationInner update(String resourceGroupName, String name, + SsmInstanceInformationTagsUpdate properties, Context context) { + return updateAsync(resourceGroupName, name, properties, context).block(); + } + + /** + * Delete a SsmInstanceInformation. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of SsmInstanceInformation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync(String resourceGroupName, String name) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Delete a SsmInstanceInformation. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of SsmInstanceInformation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync(String resourceGroupName, String name, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.delete(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, name, accept, context); + } + + /** + * Delete a SsmInstanceInformation. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of SsmInstanceInformation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String name) { + Mono>> mono = deleteWithResponseAsync(resourceGroupName, name); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); + } + + /** + * Delete a SsmInstanceInformation. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of SsmInstanceInformation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String name, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = deleteWithResponseAsync(resourceGroupName, name, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + context); + } + + /** + * Delete a SsmInstanceInformation. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of SsmInstanceInformation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String name) { + return this.beginDeleteAsync(resourceGroupName, name).getSyncPoller(); + } + + /** + * Delete a SsmInstanceInformation. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of SsmInstanceInformation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String name, Context context) { + return this.beginDeleteAsync(resourceGroupName, name, context).getSyncPoller(); + } + + /** + * Delete a SsmInstanceInformation. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of SsmInstanceInformation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String name) { + return beginDeleteAsync(resourceGroupName, name).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete a SsmInstanceInformation. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of SsmInstanceInformation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String name, Context context) { + return beginDeleteAsync(resourceGroupName, name, context).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete a SsmInstanceInformation. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of SsmInstanceInformation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String name) { + deleteAsync(resourceGroupName, name).block(); + } + + /** + * Delete a SsmInstanceInformation. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of SsmInstanceInformation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String name, Context context) { + deleteAsync(resourceGroupName, name, context).block(); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a SsmInstanceInformation list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listBySubscriptionNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a SsmInstanceInformation list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listBySubscriptionNextSinglePageAsync(String nextLink, + Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a SsmInstanceInformation list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a SsmInstanceInformation list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupNextSinglePageAsync(String nextLink, + Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/SsmInstanceInformationsImpl.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/SsmInstanceInformationsImpl.java new file mode 100644 index 000000000000..34773b84796a --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/SsmInstanceInformationsImpl.java @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.awsconnector.fluent.SsmInstanceInformationsClient; +import com.azure.resourcemanager.awsconnector.fluent.models.SsmInstanceInformationInner; +import com.azure.resourcemanager.awsconnector.models.SsmInstanceInformation; +import com.azure.resourcemanager.awsconnector.models.SsmInstanceInformations; + +public final class SsmInstanceInformationsImpl implements SsmInstanceInformations { + private static final ClientLogger LOGGER = new ClientLogger(SsmInstanceInformationsImpl.class); + + private final SsmInstanceInformationsClient innerClient; + + private final com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager; + + public SsmInstanceInformationsImpl(SsmInstanceInformationsClient innerClient, + com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return ResourceManagerUtils.mapPage(inner, inner1 -> new SsmInstanceInformationImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new SsmInstanceInformationImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName); + return ResourceManagerUtils.mapPage(inner, inner1 -> new SsmInstanceInformationImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + PagedIterable inner + = this.serviceClient().listByResourceGroup(resourceGroupName, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new SsmInstanceInformationImpl(inner1, this.manager())); + } + + public Response getByResourceGroupWithResponse(String resourceGroupName, String name, + Context context) { + Response inner + = this.serviceClient().getByResourceGroupWithResponse(resourceGroupName, name, context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new SsmInstanceInformationImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public SsmInstanceInformation getByResourceGroup(String resourceGroupName, String name) { + SsmInstanceInformationInner inner = this.serviceClient().getByResourceGroup(resourceGroupName, name); + if (inner != null) { + return new SsmInstanceInformationImpl(inner, this.manager()); + } else { + return null; + } + } + + public void deleteByResourceGroup(String resourceGroupName, String name) { + this.serviceClient().delete(resourceGroupName, name); + } + + public void delete(String resourceGroupName, String name, Context context) { + this.serviceClient().delete(resourceGroupName, name, context); + } + + public SsmInstanceInformation getById(String id) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String name = ResourceManagerUtils.getValueFromIdByName(id, "ssmInstanceInformations"); + if (name == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException(String + .format("The resource ID '%s' is not valid. Missing path segment 'ssmInstanceInformations'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, name, Context.NONE).getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String name = ResourceManagerUtils.getValueFromIdByName(id, "ssmInstanceInformations"); + if (name == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException(String + .format("The resource ID '%s' is not valid. Missing path segment 'ssmInstanceInformations'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, name, context); + } + + public void deleteById(String id) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String name = ResourceManagerUtils.getValueFromIdByName(id, "ssmInstanceInformations"); + if (name == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException(String + .format("The resource ID '%s' is not valid. Missing path segment 'ssmInstanceInformations'.", id))); + } + this.delete(resourceGroupName, name, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String name = ResourceManagerUtils.getValueFromIdByName(id, "ssmInstanceInformations"); + if (name == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException(String + .format("The resource ID '%s' is not valid. Missing path segment 'ssmInstanceInformations'.", id))); + } + this.delete(resourceGroupName, name, context); + } + + private SsmInstanceInformationsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.awsconnector.AwsconnectorManager manager() { + return this.serviceManager; + } + + public SsmInstanceInformationImpl define(String name) { + return new SsmInstanceInformationImpl(name, this.manager()); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/SsmParameterImpl.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/SsmParameterImpl.java new file mode 100644 index 000000000000..d80ddf30141c --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/SsmParameterImpl.java @@ -0,0 +1,177 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.implementation; + +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.awsconnector.fluent.models.SsmParameterInner; +import com.azure.resourcemanager.awsconnector.models.SsmParameter; +import com.azure.resourcemanager.awsconnector.models.SsmParameterProperties; +import com.azure.resourcemanager.awsconnector.models.SsmParameterTagsUpdate; +import java.util.Collections; +import java.util.Map; + +public final class SsmParameterImpl implements SsmParameter, SsmParameter.Definition, SsmParameter.Update { + private SsmParameterInner innerObject; + + private final com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public String location() { + return this.innerModel().location(); + } + + public Map tags() { + Map inner = this.innerModel().tags(); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } + } + + public SsmParameterProperties properties() { + return this.innerModel().properties(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public String resourceGroupName() { + return resourceGroupName; + } + + public SsmParameterInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.awsconnector.AwsconnectorManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String name; + + private SsmParameterTagsUpdate updateProperties; + + public SsmParameterImpl withExistingResourceGroup(String resourceGroupName) { + this.resourceGroupName = resourceGroupName; + return this; + } + + public SsmParameter create() { + this.innerObject = serviceManager.serviceClient() + .getSsmParameters() + .createOrReplace(resourceGroupName, name, this.innerModel(), Context.NONE); + return this; + } + + public SsmParameter create(Context context) { + this.innerObject = serviceManager.serviceClient() + .getSsmParameters() + .createOrReplace(resourceGroupName, name, this.innerModel(), context); + return this; + } + + SsmParameterImpl(String name, com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager) { + this.innerObject = new SsmParameterInner(); + this.serviceManager = serviceManager; + this.name = name; + } + + public SsmParameterImpl update() { + this.updateProperties = new SsmParameterTagsUpdate(); + return this; + } + + public SsmParameter apply() { + this.innerObject = serviceManager.serviceClient() + .getSsmParameters() + .update(resourceGroupName, name, updateProperties, Context.NONE); + return this; + } + + public SsmParameter apply(Context context) { + this.innerObject = serviceManager.serviceClient() + .getSsmParameters() + .update(resourceGroupName, name, updateProperties, context); + return this; + } + + SsmParameterImpl(SsmParameterInner innerObject, + com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.name = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "ssmParameters"); + } + + public SsmParameter refresh() { + this.innerObject = serviceManager.serviceClient() + .getSsmParameters() + .getByResourceGroupWithResponse(resourceGroupName, name, Context.NONE) + .getValue(); + return this; + } + + public SsmParameter refresh(Context context) { + this.innerObject = serviceManager.serviceClient() + .getSsmParameters() + .getByResourceGroupWithResponse(resourceGroupName, name, context) + .getValue(); + return this; + } + + public SsmParameterImpl withRegion(Region location) { + this.innerModel().withLocation(location.toString()); + return this; + } + + public SsmParameterImpl withRegion(String location) { + this.innerModel().withLocation(location); + return this; + } + + public SsmParameterImpl withTags(Map tags) { + if (isInCreateMode()) { + this.innerModel().withTags(tags); + return this; + } else { + this.updateProperties.withTags(tags); + return this; + } + } + + public SsmParameterImpl withProperties(SsmParameterProperties properties) { + this.innerModel().withProperties(properties); + return this; + } + + private boolean isInCreateMode() { + return this.innerModel().id() == null; + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/SsmParametersClientImpl.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/SsmParametersClientImpl.java new file mode 100644 index 000000000000..ca5cf3a85d4e --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/SsmParametersClientImpl.java @@ -0,0 +1,1278 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.Patch; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.awsconnector.fluent.SsmParametersClient; +import com.azure.resourcemanager.awsconnector.fluent.models.SsmParameterInner; +import com.azure.resourcemanager.awsconnector.models.SsmParameterListResult; +import com.azure.resourcemanager.awsconnector.models.SsmParameterTagsUpdate; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in SsmParametersClient. + */ +public final class SsmParametersClientImpl implements SsmParametersClient { + /** + * The proxy service used to perform REST calls. + */ + private final SsmParametersService service; + + /** + * The service client containing this operation class. + */ + private final MicrosoftAwsConnectorImpl client; + + /** + * Initializes an instance of SsmParametersClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + SsmParametersClientImpl(MicrosoftAwsConnectorImpl client) { + this.service + = RestProxy.create(SsmParametersService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for MicrosoftAwsConnectorSsmParameters to be used by the proxy service to + * perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "MicrosoftAwsConnecto") + public interface SsmParametersService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.AwsConnector/ssmParameters") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/ssmParameters") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroup(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/ssmParameters/{name}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getByResourceGroup(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("name") String name, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/ssmParameters/{name}") + @ExpectedResponses({ 200, 201 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrReplace(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("name") String name, + @BodyParam("application/json") SsmParameterInner resource, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/ssmParameters/{name}") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> update(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("name") String name, + @BodyParam("application/json") SsmParameterTagsUpdate properties, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/ssmParameters/{name}") + @ExpectedResponses({ 202, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("name") String name, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listBySubscriptionNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroupNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); + } + + /** + * List SsmParameter resources by subscription ID. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a SsmParameter list operation along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync() { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), + res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List SsmParameter resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a SsmParameter list operation along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), accept, + context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * List SsmParameter resources by subscription ID. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a SsmParameter list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>(() -> listSinglePageAsync(), + nextLink -> listBySubscriptionNextSinglePageAsync(nextLink)); + } + + /** + * List SsmParameter resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a SsmParameter list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(Context context) { + return new PagedFlux<>(() -> listSinglePageAsync(context), + nextLink -> listBySubscriptionNextSinglePageAsync(nextLink, context)); + } + + /** + * List SsmParameter resources by subscription ID. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a SsmParameter list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + return new PagedIterable<>(listAsync()); + } + + /** + * List SsmParameter resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a SsmParameter list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Context context) { + return new PagedIterable<>(listAsync(context)); + } + + /** + * List SsmParameter resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a SsmParameter list operation along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), + res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List SsmParameter resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a SsmParameter list operation along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * List SsmParameter resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a SsmParameter list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName) { + return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); + } + + /** + * List SsmParameter resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a SsmParameter list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName, Context context) { + return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName, context), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink, context)); + } + + /** + * List SsmParameter resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a SsmParameter list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName)); + } + + /** + * List SsmParameter resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a SsmParameter list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, context)); + } + + /** + * Get a SsmParameter. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of SsmParameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a SsmParameter along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync(String resourceGroupName, + String name) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.getByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get a SsmParameter. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of SsmParameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a SsmParameter along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync(String resourceGroupName, String name, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.getByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, accept, context); + } + + /** + * Get a SsmParameter. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of SsmParameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a SsmParameter on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getByResourceGroupAsync(String resourceGroupName, String name) { + return getByResourceGroupWithResponseAsync(resourceGroupName, name) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Get a SsmParameter. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of SsmParameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a SsmParameter along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getByResourceGroupWithResponse(String resourceGroupName, String name, + Context context) { + return getByResourceGroupWithResponseAsync(resourceGroupName, name, context).block(); + } + + /** + * Get a SsmParameter. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of SsmParameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a SsmParameter. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SsmParameterInner getByResourceGroup(String resourceGroupName, String name) { + return getByResourceGroupWithResponse(resourceGroupName, name, Context.NONE).getValue(); + } + + /** + * Create a SsmParameter. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of SsmParameter. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrReplaceWithResponseAsync(String resourceGroupName, String name, + SsmParameterInner resource) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (resource == null) { + return Mono.error(new IllegalArgumentException("Parameter resource is required and cannot be null.")); + } else { + resource.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.createOrReplace(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, resource, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Create a SsmParameter. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of SsmParameter. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrReplaceWithResponseAsync(String resourceGroupName, String name, + SsmParameterInner resource, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (resource == null) { + return Mono.error(new IllegalArgumentException("Parameter resource is required and cannot be null.")); + } else { + resource.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.createOrReplace(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, resource, accept, context); + } + + /** + * Create a SsmParameter. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of SsmParameter. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, SsmParameterInner> + beginCreateOrReplaceAsync(String resourceGroupName, String name, SsmParameterInner resource) { + Mono>> mono = createOrReplaceWithResponseAsync(resourceGroupName, name, resource); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + SsmParameterInner.class, SsmParameterInner.class, this.client.getContext()); + } + + /** + * Create a SsmParameter. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of SsmParameter. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, SsmParameterInner> + beginCreateOrReplaceAsync(String resourceGroupName, String name, SsmParameterInner resource, Context context) { + context = this.client.mergeContext(context); + Mono>> mono + = createOrReplaceWithResponseAsync(resourceGroupName, name, resource, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + SsmParameterInner.class, SsmParameterInner.class, context); + } + + /** + * Create a SsmParameter. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of SsmParameter. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, SsmParameterInner> beginCreateOrReplace(String resourceGroupName, + String name, SsmParameterInner resource) { + return this.beginCreateOrReplaceAsync(resourceGroupName, name, resource).getSyncPoller(); + } + + /** + * Create a SsmParameter. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of SsmParameter. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, SsmParameterInner> beginCreateOrReplace(String resourceGroupName, + String name, SsmParameterInner resource, Context context) { + return this.beginCreateOrReplaceAsync(resourceGroupName, name, resource, context).getSyncPoller(); + } + + /** + * Create a SsmParameter. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of SsmParameter. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrReplaceAsync(String resourceGroupName, String name, + SsmParameterInner resource) { + return beginCreateOrReplaceAsync(resourceGroupName, name, resource).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create a SsmParameter. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of SsmParameter. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrReplaceAsync(String resourceGroupName, String name, + SsmParameterInner resource, Context context) { + return beginCreateOrReplaceAsync(resourceGroupName, name, resource, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create a SsmParameter. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of SsmParameter. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SsmParameterInner createOrReplace(String resourceGroupName, String name, SsmParameterInner resource) { + return createOrReplaceAsync(resourceGroupName, name, resource).block(); + } + + /** + * Create a SsmParameter. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of SsmParameter. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SsmParameterInner createOrReplace(String resourceGroupName, String name, SsmParameterInner resource, + Context context) { + return createOrReplaceAsync(resourceGroupName, name, resource, context).block(); + } + + /** + * Update a SsmParameter. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of SsmParameter. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync(String resourceGroupName, String name, + SsmParameterTagsUpdate properties) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (properties == null) { + return Mono.error(new IllegalArgumentException("Parameter properties is required and cannot be null.")); + } else { + properties.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.update(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, properties, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Update a SsmParameter. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of SsmParameter. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync(String resourceGroupName, String name, + SsmParameterTagsUpdate properties, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (properties == null) { + return Mono.error(new IllegalArgumentException("Parameter properties is required and cannot be null.")); + } else { + properties.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.update(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, name, properties, accept, context); + } + + /** + * Update a SsmParameter. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of SsmParameter. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, SsmParameterInner> beginUpdateAsync(String resourceGroupName, + String name, SsmParameterTagsUpdate properties) { + Mono>> mono = updateWithResponseAsync(resourceGroupName, name, properties); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + SsmParameterInner.class, SsmParameterInner.class, this.client.getContext()); + } + + /** + * Update a SsmParameter. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of SsmParameter. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, SsmParameterInner> beginUpdateAsync(String resourceGroupName, + String name, SsmParameterTagsUpdate properties, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = updateWithResponseAsync(resourceGroupName, name, properties, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + SsmParameterInner.class, SsmParameterInner.class, context); + } + + /** + * Update a SsmParameter. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of SsmParameter. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, SsmParameterInner> beginUpdate(String resourceGroupName, + String name, SsmParameterTagsUpdate properties) { + return this.beginUpdateAsync(resourceGroupName, name, properties).getSyncPoller(); + } + + /** + * Update a SsmParameter. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of SsmParameter. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, SsmParameterInner> beginUpdate(String resourceGroupName, + String name, SsmParameterTagsUpdate properties, Context context) { + return this.beginUpdateAsync(resourceGroupName, name, properties, context).getSyncPoller(); + } + + /** + * Update a SsmParameter. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of SsmParameter. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync(String resourceGroupName, String name, + SsmParameterTagsUpdate properties) { + return beginUpdateAsync(resourceGroupName, name, properties).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Update a SsmParameter. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of SsmParameter. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync(String resourceGroupName, String name, + SsmParameterTagsUpdate properties, Context context) { + return beginUpdateAsync(resourceGroupName, name, properties, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Update a SsmParameter. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of SsmParameter. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SsmParameterInner update(String resourceGroupName, String name, SsmParameterTagsUpdate properties) { + return updateAsync(resourceGroupName, name, properties).block(); + } + + /** + * Update a SsmParameter. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of SsmParameter. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SsmParameterInner update(String resourceGroupName, String name, SsmParameterTagsUpdate properties, + Context context) { + return updateAsync(resourceGroupName, name, properties, context).block(); + } + + /** + * Delete a SsmParameter. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of SsmParameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync(String resourceGroupName, String name) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Delete a SsmParameter. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of SsmParameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync(String resourceGroupName, String name, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.delete(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, name, accept, context); + } + + /** + * Delete a SsmParameter. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of SsmParameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String name) { + Mono>> mono = deleteWithResponseAsync(resourceGroupName, name); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); + } + + /** + * Delete a SsmParameter. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of SsmParameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String name, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = deleteWithResponseAsync(resourceGroupName, name, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + context); + } + + /** + * Delete a SsmParameter. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of SsmParameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String name) { + return this.beginDeleteAsync(resourceGroupName, name).getSyncPoller(); + } + + /** + * Delete a SsmParameter. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of SsmParameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String name, Context context) { + return this.beginDeleteAsync(resourceGroupName, name, context).getSyncPoller(); + } + + /** + * Delete a SsmParameter. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of SsmParameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String name) { + return beginDeleteAsync(resourceGroupName, name).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete a SsmParameter. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of SsmParameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String name, Context context) { + return beginDeleteAsync(resourceGroupName, name, context).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete a SsmParameter. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of SsmParameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String name) { + deleteAsync(resourceGroupName, name).block(); + } + + /** + * Delete a SsmParameter. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of SsmParameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String name, Context context) { + deleteAsync(resourceGroupName, name, context).block(); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a SsmParameter list operation along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listBySubscriptionNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), + res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a SsmParameter list operation along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listBySubscriptionNextSinglePageAsync(String nextLink, + Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a SsmParameter list operation along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), + res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a SsmParameter list operation along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupNextSinglePageAsync(String nextLink, + Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/SsmParametersImpl.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/SsmParametersImpl.java new file mode 100644 index 000000000000..67e350b16dce --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/SsmParametersImpl.java @@ -0,0 +1,146 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.awsconnector.fluent.SsmParametersClient; +import com.azure.resourcemanager.awsconnector.fluent.models.SsmParameterInner; +import com.azure.resourcemanager.awsconnector.models.SsmParameter; +import com.azure.resourcemanager.awsconnector.models.SsmParameters; + +public final class SsmParametersImpl implements SsmParameters { + private static final ClientLogger LOGGER = new ClientLogger(SsmParametersImpl.class); + + private final SsmParametersClient innerClient; + + private final com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager; + + public SsmParametersImpl(SsmParametersClient innerClient, + com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return ResourceManagerUtils.mapPage(inner, inner1 -> new SsmParameterImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new SsmParameterImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName); + return ResourceManagerUtils.mapPage(inner, inner1 -> new SsmParameterImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new SsmParameterImpl(inner1, this.manager())); + } + + public Response getByResourceGroupWithResponse(String resourceGroupName, String name, + Context context) { + Response inner + = this.serviceClient().getByResourceGroupWithResponse(resourceGroupName, name, context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new SsmParameterImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public SsmParameter getByResourceGroup(String resourceGroupName, String name) { + SsmParameterInner inner = this.serviceClient().getByResourceGroup(resourceGroupName, name); + if (inner != null) { + return new SsmParameterImpl(inner, this.manager()); + } else { + return null; + } + } + + public void deleteByResourceGroup(String resourceGroupName, String name) { + this.serviceClient().delete(resourceGroupName, name); + } + + public void delete(String resourceGroupName, String name, Context context) { + this.serviceClient().delete(resourceGroupName, name, context); + } + + public SsmParameter getById(String id) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String name = ResourceManagerUtils.getValueFromIdByName(id, "ssmParameters"); + if (name == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'ssmParameters'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, name, Context.NONE).getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String name = ResourceManagerUtils.getValueFromIdByName(id, "ssmParameters"); + if (name == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'ssmParameters'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, name, context); + } + + public void deleteById(String id) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String name = ResourceManagerUtils.getValueFromIdByName(id, "ssmParameters"); + if (name == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'ssmParameters'.", id))); + } + this.delete(resourceGroupName, name, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String name = ResourceManagerUtils.getValueFromIdByName(id, "ssmParameters"); + if (name == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'ssmParameters'.", id))); + } + this.delete(resourceGroupName, name, context); + } + + private SsmParametersClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.awsconnector.AwsconnectorManager manager() { + return this.serviceManager; + } + + public SsmParameterImpl define(String name) { + return new SsmParameterImpl(name, this.manager()); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/SsmResourceComplianceSummaryItemImpl.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/SsmResourceComplianceSummaryItemImpl.java new file mode 100644 index 000000000000..cd754a9f134d --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/SsmResourceComplianceSummaryItemImpl.java @@ -0,0 +1,179 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.implementation; + +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.awsconnector.fluent.models.SsmResourceComplianceSummaryItemInner; +import com.azure.resourcemanager.awsconnector.models.SsmResourceComplianceSummaryItem; +import com.azure.resourcemanager.awsconnector.models.SsmResourceComplianceSummaryItemProperties; +import com.azure.resourcemanager.awsconnector.models.SsmResourceComplianceSummaryItemTagsUpdate; +import java.util.Collections; +import java.util.Map; + +public final class SsmResourceComplianceSummaryItemImpl implements SsmResourceComplianceSummaryItem, + SsmResourceComplianceSummaryItem.Definition, SsmResourceComplianceSummaryItem.Update { + private SsmResourceComplianceSummaryItemInner innerObject; + + private final com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public String location() { + return this.innerModel().location(); + } + + public Map tags() { + Map inner = this.innerModel().tags(); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } + } + + public SsmResourceComplianceSummaryItemProperties properties() { + return this.innerModel().properties(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public String resourceGroupName() { + return resourceGroupName; + } + + public SsmResourceComplianceSummaryItemInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.awsconnector.AwsconnectorManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String name; + + private SsmResourceComplianceSummaryItemTagsUpdate updateProperties; + + public SsmResourceComplianceSummaryItemImpl withExistingResourceGroup(String resourceGroupName) { + this.resourceGroupName = resourceGroupName; + return this; + } + + public SsmResourceComplianceSummaryItem create() { + this.innerObject = serviceManager.serviceClient() + .getSsmResourceComplianceSummaryItems() + .createOrReplace(resourceGroupName, name, this.innerModel(), Context.NONE); + return this; + } + + public SsmResourceComplianceSummaryItem create(Context context) { + this.innerObject = serviceManager.serviceClient() + .getSsmResourceComplianceSummaryItems() + .createOrReplace(resourceGroupName, name, this.innerModel(), context); + return this; + } + + SsmResourceComplianceSummaryItemImpl(String name, + com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager) { + this.innerObject = new SsmResourceComplianceSummaryItemInner(); + this.serviceManager = serviceManager; + this.name = name; + } + + public SsmResourceComplianceSummaryItemImpl update() { + this.updateProperties = new SsmResourceComplianceSummaryItemTagsUpdate(); + return this; + } + + public SsmResourceComplianceSummaryItem apply() { + this.innerObject = serviceManager.serviceClient() + .getSsmResourceComplianceSummaryItems() + .update(resourceGroupName, name, updateProperties, Context.NONE); + return this; + } + + public SsmResourceComplianceSummaryItem apply(Context context) { + this.innerObject = serviceManager.serviceClient() + .getSsmResourceComplianceSummaryItems() + .update(resourceGroupName, name, updateProperties, context); + return this; + } + + SsmResourceComplianceSummaryItemImpl(SsmResourceComplianceSummaryItemInner innerObject, + com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.name = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "ssmResourceComplianceSummaryItems"); + } + + public SsmResourceComplianceSummaryItem refresh() { + this.innerObject = serviceManager.serviceClient() + .getSsmResourceComplianceSummaryItems() + .getByResourceGroupWithResponse(resourceGroupName, name, Context.NONE) + .getValue(); + return this; + } + + public SsmResourceComplianceSummaryItem refresh(Context context) { + this.innerObject = serviceManager.serviceClient() + .getSsmResourceComplianceSummaryItems() + .getByResourceGroupWithResponse(resourceGroupName, name, context) + .getValue(); + return this; + } + + public SsmResourceComplianceSummaryItemImpl withRegion(Region location) { + this.innerModel().withLocation(location.toString()); + return this; + } + + public SsmResourceComplianceSummaryItemImpl withRegion(String location) { + this.innerModel().withLocation(location); + return this; + } + + public SsmResourceComplianceSummaryItemImpl withTags(Map tags) { + if (isInCreateMode()) { + this.innerModel().withTags(tags); + return this; + } else { + this.updateProperties.withTags(tags); + return this; + } + } + + public SsmResourceComplianceSummaryItemImpl withProperties(SsmResourceComplianceSummaryItemProperties properties) { + this.innerModel().withProperties(properties); + return this; + } + + private boolean isInCreateMode() { + return this.innerModel().id() == null; + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/SsmResourceComplianceSummaryItemsClientImpl.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/SsmResourceComplianceSummaryItemsClientImpl.java new file mode 100644 index 000000000000..43d0fc21c1f4 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/SsmResourceComplianceSummaryItemsClientImpl.java @@ -0,0 +1,1303 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.Patch; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.awsconnector.fluent.SsmResourceComplianceSummaryItemsClient; +import com.azure.resourcemanager.awsconnector.fluent.models.SsmResourceComplianceSummaryItemInner; +import com.azure.resourcemanager.awsconnector.models.SsmResourceComplianceSummaryItemListResult; +import com.azure.resourcemanager.awsconnector.models.SsmResourceComplianceSummaryItemTagsUpdate; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in SsmResourceComplianceSummaryItemsClient. + */ +public final class SsmResourceComplianceSummaryItemsClientImpl implements SsmResourceComplianceSummaryItemsClient { + /** + * The proxy service used to perform REST calls. + */ + private final SsmResourceComplianceSummaryItemsService service; + + /** + * The service client containing this operation class. + */ + private final MicrosoftAwsConnectorImpl client; + + /** + * Initializes an instance of SsmResourceComplianceSummaryItemsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + SsmResourceComplianceSummaryItemsClientImpl(MicrosoftAwsConnectorImpl client) { + this.service = RestProxy.create(SsmResourceComplianceSummaryItemsService.class, client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for MicrosoftAwsConnectorSsmResourceComplianceSummaryItems to be used by + * the proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "MicrosoftAwsConnecto") + public interface SsmResourceComplianceSummaryItemsService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.AwsConnector/ssmResourceComplianceSummaryItems") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/ssmResourceComplianceSummaryItems") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroup( + @HostParam("$host") String endpoint, @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/ssmResourceComplianceSummaryItems/{name}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getByResourceGroup(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("name") String name, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/ssmResourceComplianceSummaryItems/{name}") + @ExpectedResponses({ 200, 201 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrReplace(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("name") String name, + @BodyParam("application/json") SsmResourceComplianceSummaryItemInner resource, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/ssmResourceComplianceSummaryItems/{name}") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> update(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("name") String name, + @BodyParam("application/json") SsmResourceComplianceSummaryItemTagsUpdate properties, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/ssmResourceComplianceSummaryItems/{name}") + @ExpectedResponses({ 202, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("name") String name, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listBySubscriptionNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroupNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); + } + + /** + * List SsmResourceComplianceSummaryItem resources by subscription ID. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a SsmResourceComplianceSummaryItem list operation along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync() { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List SsmResourceComplianceSummaryItem resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a SsmResourceComplianceSummaryItem list operation along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), accept, + context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * List SsmResourceComplianceSummaryItem resources by subscription ID. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a SsmResourceComplianceSummaryItem list operation as paginated response with + * {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>(() -> listSinglePageAsync(), + nextLink -> listBySubscriptionNextSinglePageAsync(nextLink)); + } + + /** + * List SsmResourceComplianceSummaryItem resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a SsmResourceComplianceSummaryItem list operation as paginated response with + * {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(Context context) { + return new PagedFlux<>(() -> listSinglePageAsync(context), + nextLink -> listBySubscriptionNextSinglePageAsync(nextLink, context)); + } + + /** + * List SsmResourceComplianceSummaryItem resources by subscription ID. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a SsmResourceComplianceSummaryItem list operation as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + return new PagedIterable<>(listAsync()); + } + + /** + * List SsmResourceComplianceSummaryItem resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a SsmResourceComplianceSummaryItem list operation as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Context context) { + return new PagedIterable<>(listAsync(context)); + } + + /** + * List SsmResourceComplianceSummaryItem resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a SsmResourceComplianceSummaryItem list operation along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> + listByResourceGroupSinglePageAsync(String resourceGroupName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List SsmResourceComplianceSummaryItem resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a SsmResourceComplianceSummaryItem list operation along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> + listByResourceGroupSinglePageAsync(String resourceGroupName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * List SsmResourceComplianceSummaryItem resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a SsmResourceComplianceSummaryItem list operation as paginated response with + * {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName) { + return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); + } + + /** + * List SsmResourceComplianceSummaryItem resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a SsmResourceComplianceSummaryItem list operation as paginated response with + * {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName, + Context context) { + return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName, context), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink, context)); + } + + /** + * List SsmResourceComplianceSummaryItem resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a SsmResourceComplianceSummaryItem list operation as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName)); + } + + /** + * List SsmResourceComplianceSummaryItem resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a SsmResourceComplianceSummaryItem list operation as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName, + Context context) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, context)); + } + + /** + * Get a SsmResourceComplianceSummaryItem. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of SsmResourceComplianceSummaryItem. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a SsmResourceComplianceSummaryItem along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> + getByResourceGroupWithResponseAsync(String resourceGroupName, String name) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.getByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get a SsmResourceComplianceSummaryItem. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of SsmResourceComplianceSummaryItem. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a SsmResourceComplianceSummaryItem along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> + getByResourceGroupWithResponseAsync(String resourceGroupName, String name, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.getByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, accept, context); + } + + /** + * Get a SsmResourceComplianceSummaryItem. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of SsmResourceComplianceSummaryItem. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a SsmResourceComplianceSummaryItem on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getByResourceGroupAsync(String resourceGroupName, String name) { + return getByResourceGroupWithResponseAsync(resourceGroupName, name) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Get a SsmResourceComplianceSummaryItem. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of SsmResourceComplianceSummaryItem. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a SsmResourceComplianceSummaryItem along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getByResourceGroupWithResponse(String resourceGroupName, + String name, Context context) { + return getByResourceGroupWithResponseAsync(resourceGroupName, name, context).block(); + } + + /** + * Get a SsmResourceComplianceSummaryItem. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of SsmResourceComplianceSummaryItem. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a SsmResourceComplianceSummaryItem. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SsmResourceComplianceSummaryItemInner getByResourceGroup(String resourceGroupName, String name) { + return getByResourceGroupWithResponse(resourceGroupName, name, Context.NONE).getValue(); + } + + /** + * Create a SsmResourceComplianceSummaryItem. Please note that end user resource creation is currently restricted, + * but it will be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of SsmResourceComplianceSummaryItem. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrReplaceWithResponseAsync(String resourceGroupName, String name, + SsmResourceComplianceSummaryItemInner resource) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (resource == null) { + return Mono.error(new IllegalArgumentException("Parameter resource is required and cannot be null.")); + } else { + resource.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.createOrReplace(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, resource, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Create a SsmResourceComplianceSummaryItem. Please note that end user resource creation is currently restricted, + * but it will be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of SsmResourceComplianceSummaryItem. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrReplaceWithResponseAsync(String resourceGroupName, String name, + SsmResourceComplianceSummaryItemInner resource, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (resource == null) { + return Mono.error(new IllegalArgumentException("Parameter resource is required and cannot be null.")); + } else { + resource.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.createOrReplace(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, resource, accept, context); + } + + /** + * Create a SsmResourceComplianceSummaryItem. Please note that end user resource creation is currently restricted, + * but it will be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of SsmResourceComplianceSummaryItem. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, SsmResourceComplianceSummaryItemInner> + beginCreateOrReplaceAsync(String resourceGroupName, String name, + SsmResourceComplianceSummaryItemInner resource) { + Mono>> mono = createOrReplaceWithResponseAsync(resourceGroupName, name, resource); + return this.client.getLroResult( + mono, this.client.getHttpPipeline(), SsmResourceComplianceSummaryItemInner.class, + SsmResourceComplianceSummaryItemInner.class, this.client.getContext()); + } + + /** + * Create a SsmResourceComplianceSummaryItem. Please note that end user resource creation is currently restricted, + * but it will be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of SsmResourceComplianceSummaryItem. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, SsmResourceComplianceSummaryItemInner> + beginCreateOrReplaceAsync(String resourceGroupName, String name, SsmResourceComplianceSummaryItemInner resource, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono + = createOrReplaceWithResponseAsync(resourceGroupName, name, resource, context); + return this.client.getLroResult( + mono, this.client.getHttpPipeline(), SsmResourceComplianceSummaryItemInner.class, + SsmResourceComplianceSummaryItemInner.class, context); + } + + /** + * Create a SsmResourceComplianceSummaryItem. Please note that end user resource creation is currently restricted, + * but it will be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of SsmResourceComplianceSummaryItem. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, SsmResourceComplianceSummaryItemInner> + beginCreateOrReplace(String resourceGroupName, String name, SsmResourceComplianceSummaryItemInner resource) { + return this.beginCreateOrReplaceAsync(resourceGroupName, name, resource).getSyncPoller(); + } + + /** + * Create a SsmResourceComplianceSummaryItem. Please note that end user resource creation is currently restricted, + * but it will be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of SsmResourceComplianceSummaryItem. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, SsmResourceComplianceSummaryItemInner> + beginCreateOrReplace(String resourceGroupName, String name, SsmResourceComplianceSummaryItemInner resource, + Context context) { + return this.beginCreateOrReplaceAsync(resourceGroupName, name, resource, context).getSyncPoller(); + } + + /** + * Create a SsmResourceComplianceSummaryItem. Please note that end user resource creation is currently restricted, + * but it will be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of SsmResourceComplianceSummaryItem. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrReplaceAsync(String resourceGroupName, String name, + SsmResourceComplianceSummaryItemInner resource) { + return beginCreateOrReplaceAsync(resourceGroupName, name, resource).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create a SsmResourceComplianceSummaryItem. Please note that end user resource creation is currently restricted, + * but it will be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of SsmResourceComplianceSummaryItem. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrReplaceAsync(String resourceGroupName, String name, + SsmResourceComplianceSummaryItemInner resource, Context context) { + return beginCreateOrReplaceAsync(resourceGroupName, name, resource, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create a SsmResourceComplianceSummaryItem. Please note that end user resource creation is currently restricted, + * but it will be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of SsmResourceComplianceSummaryItem. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SsmResourceComplianceSummaryItemInner createOrReplace(String resourceGroupName, String name, + SsmResourceComplianceSummaryItemInner resource) { + return createOrReplaceAsync(resourceGroupName, name, resource).block(); + } + + /** + * Create a SsmResourceComplianceSummaryItem. Please note that end user resource creation is currently restricted, + * but it will be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of SsmResourceComplianceSummaryItem. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SsmResourceComplianceSummaryItemInner createOrReplace(String resourceGroupName, String name, + SsmResourceComplianceSummaryItemInner resource, Context context) { + return createOrReplaceAsync(resourceGroupName, name, resource, context).block(); + } + + /** + * Update a SsmResourceComplianceSummaryItem. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of SsmResourceComplianceSummaryItem. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync(String resourceGroupName, String name, + SsmResourceComplianceSummaryItemTagsUpdate properties) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (properties == null) { + return Mono.error(new IllegalArgumentException("Parameter properties is required and cannot be null.")); + } else { + properties.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.update(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, properties, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Update a SsmResourceComplianceSummaryItem. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of SsmResourceComplianceSummaryItem. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync(String resourceGroupName, String name, + SsmResourceComplianceSummaryItemTagsUpdate properties, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (properties == null) { + return Mono.error(new IllegalArgumentException("Parameter properties is required and cannot be null.")); + } else { + properties.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.update(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, name, properties, accept, context); + } + + /** + * Update a SsmResourceComplianceSummaryItem. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of SsmResourceComplianceSummaryItem. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, SsmResourceComplianceSummaryItemInner> + beginUpdateAsync(String resourceGroupName, String name, SsmResourceComplianceSummaryItemTagsUpdate properties) { + Mono>> mono = updateWithResponseAsync(resourceGroupName, name, properties); + return this.client.getLroResult( + mono, this.client.getHttpPipeline(), SsmResourceComplianceSummaryItemInner.class, + SsmResourceComplianceSummaryItemInner.class, this.client.getContext()); + } + + /** + * Update a SsmResourceComplianceSummaryItem. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of SsmResourceComplianceSummaryItem. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, SsmResourceComplianceSummaryItemInner> + beginUpdateAsync(String resourceGroupName, String name, SsmResourceComplianceSummaryItemTagsUpdate properties, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = updateWithResponseAsync(resourceGroupName, name, properties, context); + return this.client.getLroResult( + mono, this.client.getHttpPipeline(), SsmResourceComplianceSummaryItemInner.class, + SsmResourceComplianceSummaryItemInner.class, context); + } + + /** + * Update a SsmResourceComplianceSummaryItem. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of SsmResourceComplianceSummaryItem. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, SsmResourceComplianceSummaryItemInner> + beginUpdate(String resourceGroupName, String name, SsmResourceComplianceSummaryItemTagsUpdate properties) { + return this.beginUpdateAsync(resourceGroupName, name, properties).getSyncPoller(); + } + + /** + * Update a SsmResourceComplianceSummaryItem. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of SsmResourceComplianceSummaryItem. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, SsmResourceComplianceSummaryItemInner> + beginUpdate(String resourceGroupName, String name, SsmResourceComplianceSummaryItemTagsUpdate properties, + Context context) { + return this.beginUpdateAsync(resourceGroupName, name, properties, context).getSyncPoller(); + } + + /** + * Update a SsmResourceComplianceSummaryItem. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of SsmResourceComplianceSummaryItem. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync(String resourceGroupName, String name, + SsmResourceComplianceSummaryItemTagsUpdate properties) { + return beginUpdateAsync(resourceGroupName, name, properties).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Update a SsmResourceComplianceSummaryItem. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of SsmResourceComplianceSummaryItem. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync(String resourceGroupName, String name, + SsmResourceComplianceSummaryItemTagsUpdate properties, Context context) { + return beginUpdateAsync(resourceGroupName, name, properties, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Update a SsmResourceComplianceSummaryItem. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of SsmResourceComplianceSummaryItem. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SsmResourceComplianceSummaryItemInner update(String resourceGroupName, String name, + SsmResourceComplianceSummaryItemTagsUpdate properties) { + return updateAsync(resourceGroupName, name, properties).block(); + } + + /** + * Update a SsmResourceComplianceSummaryItem. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of SsmResourceComplianceSummaryItem. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SsmResourceComplianceSummaryItemInner update(String resourceGroupName, String name, + SsmResourceComplianceSummaryItemTagsUpdate properties, Context context) { + return updateAsync(resourceGroupName, name, properties, context).block(); + } + + /** + * Delete a SsmResourceComplianceSummaryItem. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of SsmResourceComplianceSummaryItem. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync(String resourceGroupName, String name) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Delete a SsmResourceComplianceSummaryItem. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of SsmResourceComplianceSummaryItem. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync(String resourceGroupName, String name, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.delete(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, name, accept, context); + } + + /** + * Delete a SsmResourceComplianceSummaryItem. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of SsmResourceComplianceSummaryItem. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String name) { + Mono>> mono = deleteWithResponseAsync(resourceGroupName, name); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); + } + + /** + * Delete a SsmResourceComplianceSummaryItem. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of SsmResourceComplianceSummaryItem. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String name, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = deleteWithResponseAsync(resourceGroupName, name, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + context); + } + + /** + * Delete a SsmResourceComplianceSummaryItem. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of SsmResourceComplianceSummaryItem. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String name) { + return this.beginDeleteAsync(resourceGroupName, name).getSyncPoller(); + } + + /** + * Delete a SsmResourceComplianceSummaryItem. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of SsmResourceComplianceSummaryItem. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String name, Context context) { + return this.beginDeleteAsync(resourceGroupName, name, context).getSyncPoller(); + } + + /** + * Delete a SsmResourceComplianceSummaryItem. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of SsmResourceComplianceSummaryItem. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String name) { + return beginDeleteAsync(resourceGroupName, name).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete a SsmResourceComplianceSummaryItem. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of SsmResourceComplianceSummaryItem. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String name, Context context) { + return beginDeleteAsync(resourceGroupName, name, context).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete a SsmResourceComplianceSummaryItem. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of SsmResourceComplianceSummaryItem. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String name) { + deleteAsync(resourceGroupName, name).block(); + } + + /** + * Delete a SsmResourceComplianceSummaryItem. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of SsmResourceComplianceSummaryItem. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String name, Context context) { + deleteAsync(resourceGroupName, name, context).block(); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a SsmResourceComplianceSummaryItem list operation along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> + listBySubscriptionNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a SsmResourceComplianceSummaryItem list operation along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> + listBySubscriptionNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a SsmResourceComplianceSummaryItem list operation along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> + listByResourceGroupNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a SsmResourceComplianceSummaryItem list operation along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> + listByResourceGroupNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/SsmResourceComplianceSummaryItemsImpl.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/SsmResourceComplianceSummaryItemsImpl.java new file mode 100644 index 000000000000..a55e53745fcc --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/SsmResourceComplianceSummaryItemsImpl.java @@ -0,0 +1,153 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.awsconnector.fluent.SsmResourceComplianceSummaryItemsClient; +import com.azure.resourcemanager.awsconnector.fluent.models.SsmResourceComplianceSummaryItemInner; +import com.azure.resourcemanager.awsconnector.models.SsmResourceComplianceSummaryItem; +import com.azure.resourcemanager.awsconnector.models.SsmResourceComplianceSummaryItems; + +public final class SsmResourceComplianceSummaryItemsImpl implements SsmResourceComplianceSummaryItems { + private static final ClientLogger LOGGER = new ClientLogger(SsmResourceComplianceSummaryItemsImpl.class); + + private final SsmResourceComplianceSummaryItemsClient innerClient; + + private final com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager; + + public SsmResourceComplianceSummaryItemsImpl(SsmResourceComplianceSummaryItemsClient innerClient, + com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return ResourceManagerUtils.mapPage(inner, + inner1 -> new SsmResourceComplianceSummaryItemImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return ResourceManagerUtils.mapPage(inner, + inner1 -> new SsmResourceComplianceSummaryItemImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName) { + PagedIterable inner + = this.serviceClient().listByResourceGroup(resourceGroupName); + return ResourceManagerUtils.mapPage(inner, + inner1 -> new SsmResourceComplianceSummaryItemImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName, + Context context) { + PagedIterable inner + = this.serviceClient().listByResourceGroup(resourceGroupName, context); + return ResourceManagerUtils.mapPage(inner, + inner1 -> new SsmResourceComplianceSummaryItemImpl(inner1, this.manager())); + } + + public Response getByResourceGroupWithResponse(String resourceGroupName, + String name, Context context) { + Response inner + = this.serviceClient().getByResourceGroupWithResponse(resourceGroupName, name, context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new SsmResourceComplianceSummaryItemImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public SsmResourceComplianceSummaryItem getByResourceGroup(String resourceGroupName, String name) { + SsmResourceComplianceSummaryItemInner inner = this.serviceClient().getByResourceGroup(resourceGroupName, name); + if (inner != null) { + return new SsmResourceComplianceSummaryItemImpl(inner, this.manager()); + } else { + return null; + } + } + + public void deleteByResourceGroup(String resourceGroupName, String name) { + this.serviceClient().delete(resourceGroupName, name); + } + + public void delete(String resourceGroupName, String name, Context context) { + this.serviceClient().delete(resourceGroupName, name, context); + } + + public SsmResourceComplianceSummaryItem getById(String id) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String name = ResourceManagerUtils.getValueFromIdByName(id, "ssmResourceComplianceSummaryItems"); + if (name == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException(String.format( + "The resource ID '%s' is not valid. Missing path segment 'ssmResourceComplianceSummaryItems'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, name, Context.NONE).getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String name = ResourceManagerUtils.getValueFromIdByName(id, "ssmResourceComplianceSummaryItems"); + if (name == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException(String.format( + "The resource ID '%s' is not valid. Missing path segment 'ssmResourceComplianceSummaryItems'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, name, context); + } + + public void deleteById(String id) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String name = ResourceManagerUtils.getValueFromIdByName(id, "ssmResourceComplianceSummaryItems"); + if (name == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException(String.format( + "The resource ID '%s' is not valid. Missing path segment 'ssmResourceComplianceSummaryItems'.", id))); + } + this.delete(resourceGroupName, name, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String name = ResourceManagerUtils.getValueFromIdByName(id, "ssmResourceComplianceSummaryItems"); + if (name == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException(String.format( + "The resource ID '%s' is not valid. Missing path segment 'ssmResourceComplianceSummaryItems'.", id))); + } + this.delete(resourceGroupName, name, context); + } + + private SsmResourceComplianceSummaryItemsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.awsconnector.AwsconnectorManager manager() { + return this.serviceManager; + } + + public SsmResourceComplianceSummaryItemImpl define(String name) { + return new SsmResourceComplianceSummaryItemImpl(name, this.manager()); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/WafWebAclSummariesClientImpl.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/WafWebAclSummariesClientImpl.java new file mode 100644 index 000000000000..9228e08785a6 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/WafWebAclSummariesClientImpl.java @@ -0,0 +1,1281 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.Patch; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.awsconnector.fluent.WafWebAclSummariesClient; +import com.azure.resourcemanager.awsconnector.fluent.models.WafWebAclSummaryInner; +import com.azure.resourcemanager.awsconnector.models.WafWebAclSummaryListResult; +import com.azure.resourcemanager.awsconnector.models.WafWebAclSummaryTagsUpdate; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in WafWebAclSummariesClient. + */ +public final class WafWebAclSummariesClientImpl implements WafWebAclSummariesClient { + /** + * The proxy service used to perform REST calls. + */ + private final WafWebAclSummariesService service; + + /** + * The service client containing this operation class. + */ + private final MicrosoftAwsConnectorImpl client; + + /** + * Initializes an instance of WafWebAclSummariesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + WafWebAclSummariesClientImpl(MicrosoftAwsConnectorImpl client) { + this.service = RestProxy.create(WafWebAclSummariesService.class, client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for MicrosoftAwsConnectorWafWebAclSummaries to be used by the proxy + * service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "MicrosoftAwsConnecto") + public interface WafWebAclSummariesService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.AwsConnector/wafWebACLSummaries") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/wafWebACLSummaries") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroup(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/wafWebACLSummaries/{name}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getByResourceGroup(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("name") String name, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/wafWebACLSummaries/{name}") + @ExpectedResponses({ 200, 201 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrReplace(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("name") String name, + @BodyParam("application/json") WafWebAclSummaryInner resource, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/wafWebACLSummaries/{name}") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> update(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("name") String name, + @BodyParam("application/json") WafWebAclSummaryTagsUpdate properties, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/wafWebACLSummaries/{name}") + @ExpectedResponses({ 202, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("name") String name, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listBySubscriptionNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroupNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); + } + + /** + * List WafWebACLSummary resources by subscription ID. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a WafWebACLSummary list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync() { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List WafWebACLSummary resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a WafWebACLSummary list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), accept, + context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * List WafWebACLSummary resources by subscription ID. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a WafWebACLSummary list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>(() -> listSinglePageAsync(), + nextLink -> listBySubscriptionNextSinglePageAsync(nextLink)); + } + + /** + * List WafWebACLSummary resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a WafWebACLSummary list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(Context context) { + return new PagedFlux<>(() -> listSinglePageAsync(context), + nextLink -> listBySubscriptionNextSinglePageAsync(nextLink, context)); + } + + /** + * List WafWebACLSummary resources by subscription ID. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a WafWebACLSummary list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + return new PagedIterable<>(listAsync()); + } + + /** + * List WafWebACLSummary resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a WafWebACLSummary list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Context context) { + return new PagedIterable<>(listAsync(context)); + } + + /** + * List WafWebACLSummary resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a WafWebACLSummary list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List WafWebACLSummary resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a WafWebACLSummary list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * List WafWebACLSummary resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a WafWebACLSummary list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName) { + return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); + } + + /** + * List WafWebACLSummary resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a WafWebACLSummary list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName, Context context) { + return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName, context), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink, context)); + } + + /** + * List WafWebACLSummary resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a WafWebACLSummary list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName)); + } + + /** + * List WafWebACLSummary resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a WafWebACLSummary list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, context)); + } + + /** + * Get a WafWebACLSummary. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of WafWebACLSummary. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a WafWebACLSummary along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync(String resourceGroupName, + String name) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.getByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get a WafWebACLSummary. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of WafWebACLSummary. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a WafWebACLSummary along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync(String resourceGroupName, + String name, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.getByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, accept, context); + } + + /** + * Get a WafWebACLSummary. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of WafWebACLSummary. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a WafWebACLSummary on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getByResourceGroupAsync(String resourceGroupName, String name) { + return getByResourceGroupWithResponseAsync(resourceGroupName, name) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Get a WafWebACLSummary. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of WafWebACLSummary. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a WafWebACLSummary along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getByResourceGroupWithResponse(String resourceGroupName, String name, + Context context) { + return getByResourceGroupWithResponseAsync(resourceGroupName, name, context).block(); + } + + /** + * Get a WafWebACLSummary. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of WafWebACLSummary. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a WafWebACLSummary. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public WafWebAclSummaryInner getByResourceGroup(String resourceGroupName, String name) { + return getByResourceGroupWithResponse(resourceGroupName, name, Context.NONE).getValue(); + } + + /** + * Create a WafWebACLSummary. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of WafWebACLSummary. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrReplaceWithResponseAsync(String resourceGroupName, String name, + WafWebAclSummaryInner resource) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (resource == null) { + return Mono.error(new IllegalArgumentException("Parameter resource is required and cannot be null.")); + } else { + resource.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.createOrReplace(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, resource, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Create a WafWebACLSummary. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of WafWebACLSummary. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrReplaceWithResponseAsync(String resourceGroupName, String name, + WafWebAclSummaryInner resource, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (resource == null) { + return Mono.error(new IllegalArgumentException("Parameter resource is required and cannot be null.")); + } else { + resource.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.createOrReplace(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, resource, accept, context); + } + + /** + * Create a WafWebACLSummary. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of WafWebACLSummary. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, WafWebAclSummaryInner> + beginCreateOrReplaceAsync(String resourceGroupName, String name, WafWebAclSummaryInner resource) { + Mono>> mono = createOrReplaceWithResponseAsync(resourceGroupName, name, resource); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), WafWebAclSummaryInner.class, WafWebAclSummaryInner.class, + this.client.getContext()); + } + + /** + * Create a WafWebACLSummary. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of WafWebACLSummary. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, WafWebAclSummaryInner> beginCreateOrReplaceAsync( + String resourceGroupName, String name, WafWebAclSummaryInner resource, Context context) { + context = this.client.mergeContext(context); + Mono>> mono + = createOrReplaceWithResponseAsync(resourceGroupName, name, resource, context); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), WafWebAclSummaryInner.class, WafWebAclSummaryInner.class, context); + } + + /** + * Create a WafWebACLSummary. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of WafWebACLSummary. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, WafWebAclSummaryInner> + beginCreateOrReplace(String resourceGroupName, String name, WafWebAclSummaryInner resource) { + return this.beginCreateOrReplaceAsync(resourceGroupName, name, resource).getSyncPoller(); + } + + /** + * Create a WafWebACLSummary. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of WafWebACLSummary. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, WafWebAclSummaryInner> + beginCreateOrReplace(String resourceGroupName, String name, WafWebAclSummaryInner resource, Context context) { + return this.beginCreateOrReplaceAsync(resourceGroupName, name, resource, context).getSyncPoller(); + } + + /** + * Create a WafWebACLSummary. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of WafWebACLSummary. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrReplaceAsync(String resourceGroupName, String name, + WafWebAclSummaryInner resource) { + return beginCreateOrReplaceAsync(resourceGroupName, name, resource).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create a WafWebACLSummary. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of WafWebACLSummary. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrReplaceAsync(String resourceGroupName, String name, + WafWebAclSummaryInner resource, Context context) { + return beginCreateOrReplaceAsync(resourceGroupName, name, resource, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create a WafWebACLSummary. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of WafWebACLSummary. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public WafWebAclSummaryInner createOrReplace(String resourceGroupName, String name, + WafWebAclSummaryInner resource) { + return createOrReplaceAsync(resourceGroupName, name, resource).block(); + } + + /** + * Create a WafWebACLSummary. Please note that end user resource creation is currently restricted, but it will be + * enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of WafWebACLSummary. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public WafWebAclSummaryInner createOrReplace(String resourceGroupName, String name, WafWebAclSummaryInner resource, + Context context) { + return createOrReplaceAsync(resourceGroupName, name, resource, context).block(); + } + + /** + * Update a WafWebACLSummary. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of WafWebACLSummary. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync(String resourceGroupName, String name, + WafWebAclSummaryTagsUpdate properties) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (properties == null) { + return Mono.error(new IllegalArgumentException("Parameter properties is required and cannot be null.")); + } else { + properties.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.update(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, properties, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Update a WafWebACLSummary. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of WafWebACLSummary. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync(String resourceGroupName, String name, + WafWebAclSummaryTagsUpdate properties, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (properties == null) { + return Mono.error(new IllegalArgumentException("Parameter properties is required and cannot be null.")); + } else { + properties.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.update(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, name, properties, accept, context); + } + + /** + * Update a WafWebACLSummary. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of WafWebACLSummary. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, WafWebAclSummaryInner> + beginUpdateAsync(String resourceGroupName, String name, WafWebAclSummaryTagsUpdate properties) { + Mono>> mono = updateWithResponseAsync(resourceGroupName, name, properties); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), WafWebAclSummaryInner.class, WafWebAclSummaryInner.class, + this.client.getContext()); + } + + /** + * Update a WafWebACLSummary. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of WafWebACLSummary. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, WafWebAclSummaryInner> beginUpdateAsync( + String resourceGroupName, String name, WafWebAclSummaryTagsUpdate properties, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = updateWithResponseAsync(resourceGroupName, name, properties, context); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), WafWebAclSummaryInner.class, WafWebAclSummaryInner.class, context); + } + + /** + * Update a WafWebACLSummary. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of WafWebACLSummary. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, WafWebAclSummaryInner> beginUpdate(String resourceGroupName, + String name, WafWebAclSummaryTagsUpdate properties) { + return this.beginUpdateAsync(resourceGroupName, name, properties).getSyncPoller(); + } + + /** + * Update a WafWebACLSummary. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of WafWebACLSummary. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, WafWebAclSummaryInner> beginUpdate(String resourceGroupName, + String name, WafWebAclSummaryTagsUpdate properties, Context context) { + return this.beginUpdateAsync(resourceGroupName, name, properties, context).getSyncPoller(); + } + + /** + * Update a WafWebACLSummary. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of WafWebACLSummary. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync(String resourceGroupName, String name, + WafWebAclSummaryTagsUpdate properties) { + return beginUpdateAsync(resourceGroupName, name, properties).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Update a WafWebACLSummary. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of WafWebACLSummary. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync(String resourceGroupName, String name, + WafWebAclSummaryTagsUpdate properties, Context context) { + return beginUpdateAsync(resourceGroupName, name, properties, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Update a WafWebACLSummary. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of WafWebACLSummary. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public WafWebAclSummaryInner update(String resourceGroupName, String name, WafWebAclSummaryTagsUpdate properties) { + return updateAsync(resourceGroupName, name, properties).block(); + } + + /** + * Update a WafWebACLSummary. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of WafWebACLSummary. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public WafWebAclSummaryInner update(String resourceGroupName, String name, WafWebAclSummaryTagsUpdate properties, + Context context) { + return updateAsync(resourceGroupName, name, properties, context).block(); + } + + /** + * Delete a WafWebACLSummary. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of WafWebACLSummary. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync(String resourceGroupName, String name) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Delete a WafWebACLSummary. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of WafWebACLSummary. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync(String resourceGroupName, String name, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.delete(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, name, accept, context); + } + + /** + * Delete a WafWebACLSummary. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of WafWebACLSummary. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String name) { + Mono>> mono = deleteWithResponseAsync(resourceGroupName, name); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); + } + + /** + * Delete a WafWebACLSummary. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of WafWebACLSummary. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String name, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = deleteWithResponseAsync(resourceGroupName, name, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + context); + } + + /** + * Delete a WafWebACLSummary. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of WafWebACLSummary. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String name) { + return this.beginDeleteAsync(resourceGroupName, name).getSyncPoller(); + } + + /** + * Delete a WafWebACLSummary. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of WafWebACLSummary. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String name, Context context) { + return this.beginDeleteAsync(resourceGroupName, name, context).getSyncPoller(); + } + + /** + * Delete a WafWebACLSummary. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of WafWebACLSummary. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String name) { + return beginDeleteAsync(resourceGroupName, name).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete a WafWebACLSummary. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of WafWebACLSummary. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String name, Context context) { + return beginDeleteAsync(resourceGroupName, name, context).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete a WafWebACLSummary. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of WafWebACLSummary. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String name) { + deleteAsync(resourceGroupName, name).block(); + } + + /** + * Delete a WafWebACLSummary. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of WafWebACLSummary. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String name, Context context) { + deleteAsync(resourceGroupName, name, context).block(); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a WafWebACLSummary list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listBySubscriptionNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a WafWebACLSummary list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listBySubscriptionNextSinglePageAsync(String nextLink, + Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a WafWebACLSummary list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a WafWebACLSummary list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupNextSinglePageAsync(String nextLink, + Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/WafWebAclSummariesImpl.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/WafWebAclSummariesImpl.java new file mode 100644 index 000000000000..ae9847d55f79 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/WafWebAclSummariesImpl.java @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.awsconnector.fluent.WafWebAclSummariesClient; +import com.azure.resourcemanager.awsconnector.fluent.models.WafWebAclSummaryInner; +import com.azure.resourcemanager.awsconnector.models.WafWebAclSummaries; +import com.azure.resourcemanager.awsconnector.models.WafWebAclSummary; + +public final class WafWebAclSummariesImpl implements WafWebAclSummaries { + private static final ClientLogger LOGGER = new ClientLogger(WafWebAclSummariesImpl.class); + + private final WafWebAclSummariesClient innerClient; + + private final com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager; + + public WafWebAclSummariesImpl(WafWebAclSummariesClient innerClient, + com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return ResourceManagerUtils.mapPage(inner, inner1 -> new WafWebAclSummaryImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new WafWebAclSummaryImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName); + return ResourceManagerUtils.mapPage(inner, inner1 -> new WafWebAclSummaryImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + PagedIterable inner + = this.serviceClient().listByResourceGroup(resourceGroupName, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new WafWebAclSummaryImpl(inner1, this.manager())); + } + + public Response getByResourceGroupWithResponse(String resourceGroupName, String name, + Context context) { + Response inner + = this.serviceClient().getByResourceGroupWithResponse(resourceGroupName, name, context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new WafWebAclSummaryImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public WafWebAclSummary getByResourceGroup(String resourceGroupName, String name) { + WafWebAclSummaryInner inner = this.serviceClient().getByResourceGroup(resourceGroupName, name); + if (inner != null) { + return new WafWebAclSummaryImpl(inner, this.manager()); + } else { + return null; + } + } + + public void deleteByResourceGroup(String resourceGroupName, String name) { + this.serviceClient().delete(resourceGroupName, name); + } + + public void delete(String resourceGroupName, String name, Context context) { + this.serviceClient().delete(resourceGroupName, name, context); + } + + public WafWebAclSummary getById(String id) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String name = ResourceManagerUtils.getValueFromIdByName(id, "wafWebACLSummaries"); + if (name == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'wafWebACLSummaries'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, name, Context.NONE).getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String name = ResourceManagerUtils.getValueFromIdByName(id, "wafWebACLSummaries"); + if (name == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'wafWebACLSummaries'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, name, context); + } + + public void deleteById(String id) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String name = ResourceManagerUtils.getValueFromIdByName(id, "wafWebACLSummaries"); + if (name == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'wafWebACLSummaries'.", id))); + } + this.delete(resourceGroupName, name, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String name = ResourceManagerUtils.getValueFromIdByName(id, "wafWebACLSummaries"); + if (name == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'wafWebACLSummaries'.", id))); + } + this.delete(resourceGroupName, name, context); + } + + private WafWebAclSummariesClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.awsconnector.AwsconnectorManager manager() { + return this.serviceManager; + } + + public WafWebAclSummaryImpl define(String name) { + return new WafWebAclSummaryImpl(name, this.manager()); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/WafWebAclSummaryImpl.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/WafWebAclSummaryImpl.java new file mode 100644 index 000000000000..30fdbb3d813a --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/WafWebAclSummaryImpl.java @@ -0,0 +1,178 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.implementation; + +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.awsconnector.fluent.models.WafWebAclSummaryInner; +import com.azure.resourcemanager.awsconnector.models.WafWebAclSummary; +import com.azure.resourcemanager.awsconnector.models.WafWebAclSummaryProperties; +import com.azure.resourcemanager.awsconnector.models.WafWebAclSummaryTagsUpdate; +import java.util.Collections; +import java.util.Map; + +public final class WafWebAclSummaryImpl + implements WafWebAclSummary, WafWebAclSummary.Definition, WafWebAclSummary.Update { + private WafWebAclSummaryInner innerObject; + + private final com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public String location() { + return this.innerModel().location(); + } + + public Map tags() { + Map inner = this.innerModel().tags(); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } + } + + public WafWebAclSummaryProperties properties() { + return this.innerModel().properties(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public String resourceGroupName() { + return resourceGroupName; + } + + public WafWebAclSummaryInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.awsconnector.AwsconnectorManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String name; + + private WafWebAclSummaryTagsUpdate updateProperties; + + public WafWebAclSummaryImpl withExistingResourceGroup(String resourceGroupName) { + this.resourceGroupName = resourceGroupName; + return this; + } + + public WafWebAclSummary create() { + this.innerObject = serviceManager.serviceClient() + .getWafWebAclSummaries() + .createOrReplace(resourceGroupName, name, this.innerModel(), Context.NONE); + return this; + } + + public WafWebAclSummary create(Context context) { + this.innerObject = serviceManager.serviceClient() + .getWafWebAclSummaries() + .createOrReplace(resourceGroupName, name, this.innerModel(), context); + return this; + } + + WafWebAclSummaryImpl(String name, com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager) { + this.innerObject = new WafWebAclSummaryInner(); + this.serviceManager = serviceManager; + this.name = name; + } + + public WafWebAclSummaryImpl update() { + this.updateProperties = new WafWebAclSummaryTagsUpdate(); + return this; + } + + public WafWebAclSummary apply() { + this.innerObject = serviceManager.serviceClient() + .getWafWebAclSummaries() + .update(resourceGroupName, name, updateProperties, Context.NONE); + return this; + } + + public WafWebAclSummary apply(Context context) { + this.innerObject = serviceManager.serviceClient() + .getWafWebAclSummaries() + .update(resourceGroupName, name, updateProperties, context); + return this; + } + + WafWebAclSummaryImpl(WafWebAclSummaryInner innerObject, + com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.name = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "wafWebACLSummaries"); + } + + public WafWebAclSummary refresh() { + this.innerObject = serviceManager.serviceClient() + .getWafWebAclSummaries() + .getByResourceGroupWithResponse(resourceGroupName, name, Context.NONE) + .getValue(); + return this; + } + + public WafWebAclSummary refresh(Context context) { + this.innerObject = serviceManager.serviceClient() + .getWafWebAclSummaries() + .getByResourceGroupWithResponse(resourceGroupName, name, context) + .getValue(); + return this; + } + + public WafWebAclSummaryImpl withRegion(Region location) { + this.innerModel().withLocation(location.toString()); + return this; + } + + public WafWebAclSummaryImpl withRegion(String location) { + this.innerModel().withLocation(location); + return this; + } + + public WafWebAclSummaryImpl withTags(Map tags) { + if (isInCreateMode()) { + this.innerModel().withTags(tags); + return this; + } else { + this.updateProperties.withTags(tags); + return this; + } + } + + public WafWebAclSummaryImpl withProperties(WafWebAclSummaryProperties properties) { + this.innerModel().withProperties(properties); + return this; + } + + private boolean isInCreateMode() { + return this.innerModel().id() == null; + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/Wafv2LoggingConfigurationImpl.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/Wafv2LoggingConfigurationImpl.java new file mode 100644 index 000000000000..5f53bfaed4b4 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/Wafv2LoggingConfigurationImpl.java @@ -0,0 +1,179 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.implementation; + +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.awsconnector.fluent.models.Wafv2LoggingConfigurationInner; +import com.azure.resourcemanager.awsconnector.models.Wafv2LoggingConfiguration; +import com.azure.resourcemanager.awsconnector.models.Wafv2LoggingConfigurationProperties; +import com.azure.resourcemanager.awsconnector.models.Wafv2LoggingConfigurationTagsUpdate; +import java.util.Collections; +import java.util.Map; + +public final class Wafv2LoggingConfigurationImpl + implements Wafv2LoggingConfiguration, Wafv2LoggingConfiguration.Definition, Wafv2LoggingConfiguration.Update { + private Wafv2LoggingConfigurationInner innerObject; + + private final com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public String location() { + return this.innerModel().location(); + } + + public Map tags() { + Map inner = this.innerModel().tags(); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } + } + + public Wafv2LoggingConfigurationProperties properties() { + return this.innerModel().properties(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public String resourceGroupName() { + return resourceGroupName; + } + + public Wafv2LoggingConfigurationInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.awsconnector.AwsconnectorManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String name; + + private Wafv2LoggingConfigurationTagsUpdate updateProperties; + + public Wafv2LoggingConfigurationImpl withExistingResourceGroup(String resourceGroupName) { + this.resourceGroupName = resourceGroupName; + return this; + } + + public Wafv2LoggingConfiguration create() { + this.innerObject = serviceManager.serviceClient() + .getWafv2LoggingConfigurations() + .createOrReplace(resourceGroupName, name, this.innerModel(), Context.NONE); + return this; + } + + public Wafv2LoggingConfiguration create(Context context) { + this.innerObject = serviceManager.serviceClient() + .getWafv2LoggingConfigurations() + .createOrReplace(resourceGroupName, name, this.innerModel(), context); + return this; + } + + Wafv2LoggingConfigurationImpl(String name, + com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager) { + this.innerObject = new Wafv2LoggingConfigurationInner(); + this.serviceManager = serviceManager; + this.name = name; + } + + public Wafv2LoggingConfigurationImpl update() { + this.updateProperties = new Wafv2LoggingConfigurationTagsUpdate(); + return this; + } + + public Wafv2LoggingConfiguration apply() { + this.innerObject = serviceManager.serviceClient() + .getWafv2LoggingConfigurations() + .update(resourceGroupName, name, updateProperties, Context.NONE); + return this; + } + + public Wafv2LoggingConfiguration apply(Context context) { + this.innerObject = serviceManager.serviceClient() + .getWafv2LoggingConfigurations() + .update(resourceGroupName, name, updateProperties, context); + return this; + } + + Wafv2LoggingConfigurationImpl(Wafv2LoggingConfigurationInner innerObject, + com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.name = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "wafv2LoggingConfigurations"); + } + + public Wafv2LoggingConfiguration refresh() { + this.innerObject = serviceManager.serviceClient() + .getWafv2LoggingConfigurations() + .getByResourceGroupWithResponse(resourceGroupName, name, Context.NONE) + .getValue(); + return this; + } + + public Wafv2LoggingConfiguration refresh(Context context) { + this.innerObject = serviceManager.serviceClient() + .getWafv2LoggingConfigurations() + .getByResourceGroupWithResponse(resourceGroupName, name, context) + .getValue(); + return this; + } + + public Wafv2LoggingConfigurationImpl withRegion(Region location) { + this.innerModel().withLocation(location.toString()); + return this; + } + + public Wafv2LoggingConfigurationImpl withRegion(String location) { + this.innerModel().withLocation(location); + return this; + } + + public Wafv2LoggingConfigurationImpl withTags(Map tags) { + if (isInCreateMode()) { + this.innerModel().withTags(tags); + return this; + } else { + this.updateProperties.withTags(tags); + return this; + } + } + + public Wafv2LoggingConfigurationImpl withProperties(Wafv2LoggingConfigurationProperties properties) { + this.innerModel().withProperties(properties); + return this; + } + + private boolean isInCreateMode() { + return this.innerModel().id() == null; + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/Wafv2LoggingConfigurationsClientImpl.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/Wafv2LoggingConfigurationsClientImpl.java new file mode 100644 index 000000000000..82656cc19016 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/Wafv2LoggingConfigurationsClientImpl.java @@ -0,0 +1,1293 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.Patch; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.awsconnector.fluent.Wafv2LoggingConfigurationsClient; +import com.azure.resourcemanager.awsconnector.fluent.models.Wafv2LoggingConfigurationInner; +import com.azure.resourcemanager.awsconnector.models.Wafv2LoggingConfigurationListResult; +import com.azure.resourcemanager.awsconnector.models.Wafv2LoggingConfigurationTagsUpdate; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in Wafv2LoggingConfigurationsClient. + */ +public final class Wafv2LoggingConfigurationsClientImpl implements Wafv2LoggingConfigurationsClient { + /** + * The proxy service used to perform REST calls. + */ + private final Wafv2LoggingConfigurationsService service; + + /** + * The service client containing this operation class. + */ + private final MicrosoftAwsConnectorImpl client; + + /** + * Initializes an instance of Wafv2LoggingConfigurationsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + Wafv2LoggingConfigurationsClientImpl(MicrosoftAwsConnectorImpl client) { + this.service = RestProxy.create(Wafv2LoggingConfigurationsService.class, client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for MicrosoftAwsConnectorWafv2LoggingConfigurations to be used by the + * proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "MicrosoftAwsConnecto") + public interface Wafv2LoggingConfigurationsService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.AwsConnector/wafv2LoggingConfigurations") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/wafv2LoggingConfigurations") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroup(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/wafv2LoggingConfigurations/{name}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getByResourceGroup(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("name") String name, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/wafv2LoggingConfigurations/{name}") + @ExpectedResponses({ 200, 201 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrReplace(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("name") String name, + @BodyParam("application/json") Wafv2LoggingConfigurationInner resource, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/wafv2LoggingConfigurations/{name}") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> update(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("name") String name, + @BodyParam("application/json") Wafv2LoggingConfigurationTagsUpdate properties, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AwsConnector/wafv2LoggingConfigurations/{name}") + @ExpectedResponses({ 202, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("name") String name, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listBySubscriptionNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroupNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); + } + + /** + * List Wafv2LoggingConfiguration resources by subscription ID. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Wafv2LoggingConfiguration list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync() { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List Wafv2LoggingConfiguration resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Wafv2LoggingConfiguration list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), accept, + context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * List Wafv2LoggingConfiguration resources by subscription ID. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Wafv2LoggingConfiguration list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>(() -> listSinglePageAsync(), + nextLink -> listBySubscriptionNextSinglePageAsync(nextLink)); + } + + /** + * List Wafv2LoggingConfiguration resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Wafv2LoggingConfiguration list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(Context context) { + return new PagedFlux<>(() -> listSinglePageAsync(context), + nextLink -> listBySubscriptionNextSinglePageAsync(nextLink, context)); + } + + /** + * List Wafv2LoggingConfiguration resources by subscription ID. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Wafv2LoggingConfiguration list operation as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + return new PagedIterable<>(listAsync()); + } + + /** + * List Wafv2LoggingConfiguration resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Wafv2LoggingConfiguration list operation as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Context context) { + return new PagedIterable<>(listAsync(context)); + } + + /** + * List Wafv2LoggingConfiguration resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Wafv2LoggingConfiguration list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> + listByResourceGroupSinglePageAsync(String resourceGroupName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List Wafv2LoggingConfiguration resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Wafv2LoggingConfiguration list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> + listByResourceGroupSinglePageAsync(String resourceGroupName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * List Wafv2LoggingConfiguration resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Wafv2LoggingConfiguration list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName) { + return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); + } + + /** + * List Wafv2LoggingConfiguration resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Wafv2LoggingConfiguration list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName, + Context context) { + return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName, context), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink, context)); + } + + /** + * List Wafv2LoggingConfiguration resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Wafv2LoggingConfiguration list operation as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName)); + } + + /** + * List Wafv2LoggingConfiguration resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Wafv2LoggingConfiguration list operation as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName, + Context context) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, context)); + } + + /** + * Get a Wafv2LoggingConfiguration. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Wafv2LoggingConfiguration. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Wafv2LoggingConfiguration along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync(String resourceGroupName, + String name) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.getByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get a Wafv2LoggingConfiguration. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Wafv2LoggingConfiguration. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Wafv2LoggingConfiguration along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync(String resourceGroupName, + String name, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.getByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, accept, context); + } + + /** + * Get a Wafv2LoggingConfiguration. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Wafv2LoggingConfiguration. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Wafv2LoggingConfiguration on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getByResourceGroupAsync(String resourceGroupName, String name) { + return getByResourceGroupWithResponseAsync(resourceGroupName, name) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Get a Wafv2LoggingConfiguration. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Wafv2LoggingConfiguration. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Wafv2LoggingConfiguration along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getByResourceGroupWithResponse(String resourceGroupName, + String name, Context context) { + return getByResourceGroupWithResponseAsync(resourceGroupName, name, context).block(); + } + + /** + * Get a Wafv2LoggingConfiguration. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Wafv2LoggingConfiguration. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Wafv2LoggingConfiguration. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Wafv2LoggingConfigurationInner getByResourceGroup(String resourceGroupName, String name) { + return getByResourceGroupWithResponse(resourceGroupName, name, Context.NONE).getValue(); + } + + /** + * Create a Wafv2LoggingConfiguration. Please note that end user resource creation is currently restricted, but it + * will be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Wafv2LoggingConfiguration. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrReplaceWithResponseAsync(String resourceGroupName, String name, + Wafv2LoggingConfigurationInner resource) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (resource == null) { + return Mono.error(new IllegalArgumentException("Parameter resource is required and cannot be null.")); + } else { + resource.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.createOrReplace(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, resource, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Create a Wafv2LoggingConfiguration. Please note that end user resource creation is currently restricted, but it + * will be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Wafv2LoggingConfiguration. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrReplaceWithResponseAsync(String resourceGroupName, String name, + Wafv2LoggingConfigurationInner resource, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (resource == null) { + return Mono.error(new IllegalArgumentException("Parameter resource is required and cannot be null.")); + } else { + resource.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.createOrReplace(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, resource, accept, context); + } + + /** + * Create a Wafv2LoggingConfiguration. Please note that end user resource creation is currently restricted, but it + * will be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Wafv2LoggingConfiguration. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Wafv2LoggingConfigurationInner> + beginCreateOrReplaceAsync(String resourceGroupName, String name, Wafv2LoggingConfigurationInner resource) { + Mono>> mono = createOrReplaceWithResponseAsync(resourceGroupName, name, resource); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), Wafv2LoggingConfigurationInner.class, Wafv2LoggingConfigurationInner.class, + this.client.getContext()); + } + + /** + * Create a Wafv2LoggingConfiguration. Please note that end user resource creation is currently restricted, but it + * will be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Wafv2LoggingConfiguration. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Wafv2LoggingConfigurationInner> + beginCreateOrReplaceAsync(String resourceGroupName, String name, Wafv2LoggingConfigurationInner resource, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono + = createOrReplaceWithResponseAsync(resourceGroupName, name, resource, context); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), Wafv2LoggingConfigurationInner.class, Wafv2LoggingConfigurationInner.class, + context); + } + + /** + * Create a Wafv2LoggingConfiguration. Please note that end user resource creation is currently restricted, but it + * will be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Wafv2LoggingConfiguration. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Wafv2LoggingConfigurationInner> + beginCreateOrReplace(String resourceGroupName, String name, Wafv2LoggingConfigurationInner resource) { + return this.beginCreateOrReplaceAsync(resourceGroupName, name, resource).getSyncPoller(); + } + + /** + * Create a Wafv2LoggingConfiguration. Please note that end user resource creation is currently restricted, but it + * will be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Wafv2LoggingConfiguration. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Wafv2LoggingConfigurationInner> beginCreateOrReplace( + String resourceGroupName, String name, Wafv2LoggingConfigurationInner resource, Context context) { + return this.beginCreateOrReplaceAsync(resourceGroupName, name, resource, context).getSyncPoller(); + } + + /** + * Create a Wafv2LoggingConfiguration. Please note that end user resource creation is currently restricted, but it + * will be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Wafv2LoggingConfiguration. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrReplaceAsync(String resourceGroupName, String name, + Wafv2LoggingConfigurationInner resource) { + return beginCreateOrReplaceAsync(resourceGroupName, name, resource).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create a Wafv2LoggingConfiguration. Please note that end user resource creation is currently restricted, but it + * will be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Wafv2LoggingConfiguration. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrReplaceAsync(String resourceGroupName, String name, + Wafv2LoggingConfigurationInner resource, Context context) { + return beginCreateOrReplaceAsync(resourceGroupName, name, resource, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create a Wafv2LoggingConfiguration. Please note that end user resource creation is currently restricted, but it + * will be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Wafv2LoggingConfiguration. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Wafv2LoggingConfigurationInner createOrReplace(String resourceGroupName, String name, + Wafv2LoggingConfigurationInner resource) { + return createOrReplaceAsync(resourceGroupName, name, resource).block(); + } + + /** + * Create a Wafv2LoggingConfiguration. Please note that end user resource creation is currently restricted, but it + * will be enabled in the future. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Wafv2LoggingConfiguration. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Wafv2LoggingConfigurationInner createOrReplace(String resourceGroupName, String name, + Wafv2LoggingConfigurationInner resource, Context context) { + return createOrReplaceAsync(resourceGroupName, name, resource, context).block(); + } + + /** + * Update a Wafv2LoggingConfiguration. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Wafv2LoggingConfiguration. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync(String resourceGroupName, String name, + Wafv2LoggingConfigurationTagsUpdate properties) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (properties == null) { + return Mono.error(new IllegalArgumentException("Parameter properties is required and cannot be null.")); + } else { + properties.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.update(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, properties, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Update a Wafv2LoggingConfiguration. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Wafv2LoggingConfiguration. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync(String resourceGroupName, String name, + Wafv2LoggingConfigurationTagsUpdate properties, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (properties == null) { + return Mono.error(new IllegalArgumentException("Parameter properties is required and cannot be null.")); + } else { + properties.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.update(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, name, properties, accept, context); + } + + /** + * Update a Wafv2LoggingConfiguration. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Wafv2LoggingConfiguration. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Wafv2LoggingConfigurationInner> + beginUpdateAsync(String resourceGroupName, String name, Wafv2LoggingConfigurationTagsUpdate properties) { + Mono>> mono = updateWithResponseAsync(resourceGroupName, name, properties); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), Wafv2LoggingConfigurationInner.class, Wafv2LoggingConfigurationInner.class, + this.client.getContext()); + } + + /** + * Update a Wafv2LoggingConfiguration. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Wafv2LoggingConfiguration. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Wafv2LoggingConfigurationInner> beginUpdateAsync( + String resourceGroupName, String name, Wafv2LoggingConfigurationTagsUpdate properties, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = updateWithResponseAsync(resourceGroupName, name, properties, context); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), Wafv2LoggingConfigurationInner.class, Wafv2LoggingConfigurationInner.class, + context); + } + + /** + * Update a Wafv2LoggingConfiguration. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Wafv2LoggingConfiguration. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Wafv2LoggingConfigurationInner> + beginUpdate(String resourceGroupName, String name, Wafv2LoggingConfigurationTagsUpdate properties) { + return this.beginUpdateAsync(resourceGroupName, name, properties).getSyncPoller(); + } + + /** + * Update a Wafv2LoggingConfiguration. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Wafv2LoggingConfiguration. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Wafv2LoggingConfigurationInner> beginUpdate( + String resourceGroupName, String name, Wafv2LoggingConfigurationTagsUpdate properties, Context context) { + return this.beginUpdateAsync(resourceGroupName, name, properties, context).getSyncPoller(); + } + + /** + * Update a Wafv2LoggingConfiguration. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Wafv2LoggingConfiguration. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync(String resourceGroupName, String name, + Wafv2LoggingConfigurationTagsUpdate properties) { + return beginUpdateAsync(resourceGroupName, name, properties).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Update a Wafv2LoggingConfiguration. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Wafv2LoggingConfiguration. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync(String resourceGroupName, String name, + Wafv2LoggingConfigurationTagsUpdate properties, Context context) { + return beginUpdateAsync(resourceGroupName, name, properties, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Update a Wafv2LoggingConfiguration. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Wafv2LoggingConfiguration. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Wafv2LoggingConfigurationInner update(String resourceGroupName, String name, + Wafv2LoggingConfigurationTagsUpdate properties) { + return updateAsync(resourceGroupName, name, properties).block(); + } + + /** + * Update a Wafv2LoggingConfiguration. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Wafv2LoggingConfiguration. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Wafv2LoggingConfigurationInner update(String resourceGroupName, String name, + Wafv2LoggingConfigurationTagsUpdate properties, Context context) { + return updateAsync(resourceGroupName, name, properties, context).block(); + } + + /** + * Delete a Wafv2LoggingConfiguration. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Wafv2LoggingConfiguration. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync(String resourceGroupName, String name) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Delete a Wafv2LoggingConfiguration. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Wafv2LoggingConfiguration. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync(String resourceGroupName, String name, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.delete(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, name, accept, context); + } + + /** + * Delete a Wafv2LoggingConfiguration. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Wafv2LoggingConfiguration. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String name) { + Mono>> mono = deleteWithResponseAsync(resourceGroupName, name); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); + } + + /** + * Delete a Wafv2LoggingConfiguration. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Wafv2LoggingConfiguration. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String name, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = deleteWithResponseAsync(resourceGroupName, name, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + context); + } + + /** + * Delete a Wafv2LoggingConfiguration. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Wafv2LoggingConfiguration. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String name) { + return this.beginDeleteAsync(resourceGroupName, name).getSyncPoller(); + } + + /** + * Delete a Wafv2LoggingConfiguration. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Wafv2LoggingConfiguration. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String name, Context context) { + return this.beginDeleteAsync(resourceGroupName, name, context).getSyncPoller(); + } + + /** + * Delete a Wafv2LoggingConfiguration. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Wafv2LoggingConfiguration. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String name) { + return beginDeleteAsync(resourceGroupName, name).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete a Wafv2LoggingConfiguration. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Wafv2LoggingConfiguration. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String name, Context context) { + return beginDeleteAsync(resourceGroupName, name, context).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete a Wafv2LoggingConfiguration. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Wafv2LoggingConfiguration. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String name) { + deleteAsync(resourceGroupName, name).block(); + } + + /** + * Delete a Wafv2LoggingConfiguration. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Wafv2LoggingConfiguration. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String name, Context context) { + deleteAsync(resourceGroupName, name, context).block(); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Wafv2LoggingConfiguration list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listBySubscriptionNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Wafv2LoggingConfiguration list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listBySubscriptionNextSinglePageAsync(String nextLink, + Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Wafv2LoggingConfiguration list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> + listByResourceGroupNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Wafv2LoggingConfiguration list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupNextSinglePageAsync(String nextLink, + Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/Wafv2LoggingConfigurationsImpl.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/Wafv2LoggingConfigurationsImpl.java new file mode 100644 index 000000000000..5ee7c0885278 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/Wafv2LoggingConfigurationsImpl.java @@ -0,0 +1,148 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.awsconnector.fluent.Wafv2LoggingConfigurationsClient; +import com.azure.resourcemanager.awsconnector.fluent.models.Wafv2LoggingConfigurationInner; +import com.azure.resourcemanager.awsconnector.models.Wafv2LoggingConfiguration; +import com.azure.resourcemanager.awsconnector.models.Wafv2LoggingConfigurations; + +public final class Wafv2LoggingConfigurationsImpl implements Wafv2LoggingConfigurations { + private static final ClientLogger LOGGER = new ClientLogger(Wafv2LoggingConfigurationsImpl.class); + + private final Wafv2LoggingConfigurationsClient innerClient; + + private final com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager; + + public Wafv2LoggingConfigurationsImpl(Wafv2LoggingConfigurationsClient innerClient, + com.azure.resourcemanager.awsconnector.AwsconnectorManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return ResourceManagerUtils.mapPage(inner, inner1 -> new Wafv2LoggingConfigurationImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new Wafv2LoggingConfigurationImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName) { + PagedIterable inner + = this.serviceClient().listByResourceGroup(resourceGroupName); + return ResourceManagerUtils.mapPage(inner, inner1 -> new Wafv2LoggingConfigurationImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + PagedIterable inner + = this.serviceClient().listByResourceGroup(resourceGroupName, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new Wafv2LoggingConfigurationImpl(inner1, this.manager())); + } + + public Response getByResourceGroupWithResponse(String resourceGroupName, String name, + Context context) { + Response inner + = this.serviceClient().getByResourceGroupWithResponse(resourceGroupName, name, context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new Wafv2LoggingConfigurationImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public Wafv2LoggingConfiguration getByResourceGroup(String resourceGroupName, String name) { + Wafv2LoggingConfigurationInner inner = this.serviceClient().getByResourceGroup(resourceGroupName, name); + if (inner != null) { + return new Wafv2LoggingConfigurationImpl(inner, this.manager()); + } else { + return null; + } + } + + public void deleteByResourceGroup(String resourceGroupName, String name) { + this.serviceClient().delete(resourceGroupName, name); + } + + public void delete(String resourceGroupName, String name, Context context) { + this.serviceClient().delete(resourceGroupName, name, context); + } + + public Wafv2LoggingConfiguration getById(String id) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String name = ResourceManagerUtils.getValueFromIdByName(id, "wafv2LoggingConfigurations"); + if (name == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException(String + .format("The resource ID '%s' is not valid. Missing path segment 'wafv2LoggingConfigurations'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, name, Context.NONE).getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String name = ResourceManagerUtils.getValueFromIdByName(id, "wafv2LoggingConfigurations"); + if (name == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException(String + .format("The resource ID '%s' is not valid. Missing path segment 'wafv2LoggingConfigurations'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, name, context); + } + + public void deleteById(String id) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String name = ResourceManagerUtils.getValueFromIdByName(id, "wafv2LoggingConfigurations"); + if (name == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException(String + .format("The resource ID '%s' is not valid. Missing path segment 'wafv2LoggingConfigurations'.", id))); + } + this.delete(resourceGroupName, name, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String name = ResourceManagerUtils.getValueFromIdByName(id, "wafv2LoggingConfigurations"); + if (name == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException(String + .format("The resource ID '%s' is not valid. Missing path segment 'wafv2LoggingConfigurations'.", id))); + } + this.delete(resourceGroupName, name, context); + } + + private Wafv2LoggingConfigurationsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.awsconnector.AwsconnectorManager manager() { + return this.serviceManager; + } + + public Wafv2LoggingConfigurationImpl define(String name) { + return new Wafv2LoggingConfigurationImpl(name, this.manager()); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/package-info.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/package-info.java new file mode 100644 index 000000000000..77fad79506d2 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/implementation/package-info.java @@ -0,0 +1,9 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +/** + * Package containing the implementations for MicrosoftAwsConnector. + * Microsoft.AwsConnector Resource Provider management API. + */ +package com.azure.resourcemanager.awsconnector.implementation; diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/AbortIncompleteMultipartUpload.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/AbortIncompleteMultipartUpload.java new file mode 100644 index 000000000000..9f90841546d3 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/AbortIncompleteMultipartUpload.java @@ -0,0 +1,97 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of AbortIncompleteMultipartUpload. + */ +@Fluent +public final class AbortIncompleteMultipartUpload implements JsonSerializable { + /* + * Specifies the number of days after which Amazon S3 stops an incomplete multipart upload. + */ + private Integer daysAfterInitiation; + + /** + * Creates an instance of AbortIncompleteMultipartUpload class. + */ + public AbortIncompleteMultipartUpload() { + } + + /** + * Get the daysAfterInitiation property: Specifies the number of days after which Amazon S3 stops an incomplete + * multipart upload. + * + * @return the daysAfterInitiation value. + */ + public Integer daysAfterInitiation() { + return this.daysAfterInitiation; + } + + /** + * Set the daysAfterInitiation property: Specifies the number of days after which Amazon S3 stops an incomplete + * multipart upload. + * + * @param daysAfterInitiation the daysAfterInitiation value to set. + * @return the AbortIncompleteMultipartUpload object itself. + */ + public AbortIncompleteMultipartUpload withDaysAfterInitiation(Integer daysAfterInitiation) { + this.daysAfterInitiation = daysAfterInitiation; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeNumberField("daysAfterInitiation", this.daysAfterInitiation); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AbortIncompleteMultipartUpload from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AbortIncompleteMultipartUpload if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the AbortIncompleteMultipartUpload. + */ + public static AbortIncompleteMultipartUpload fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AbortIncompleteMultipartUpload deserializedAbortIncompleteMultipartUpload + = new AbortIncompleteMultipartUpload(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("daysAfterInitiation".equals(fieldName)) { + deserializedAbortIncompleteMultipartUpload.daysAfterInitiation + = reader.getNullable(JsonReader::getInt); + } else { + reader.skipChildren(); + } + } + + return deserializedAbortIncompleteMultipartUpload; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/AccelerateConfiguration.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/AccelerateConfiguration.java new file mode 100644 index 000000000000..6e8a3d469125 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/AccelerateConfiguration.java @@ -0,0 +1,96 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of AccelerateConfiguration. + */ +@Fluent +public final class AccelerateConfiguration implements JsonSerializable { + /* + * Specifies the transfer acceleration status of the bucket. + */ + private AccelerateConfigurationAccelerationStatus accelerationStatus; + + /** + * Creates an instance of AccelerateConfiguration class. + */ + public AccelerateConfiguration() { + } + + /** + * Get the accelerationStatus property: Specifies the transfer acceleration status of the bucket. + * + * @return the accelerationStatus value. + */ + public AccelerateConfigurationAccelerationStatus accelerationStatus() { + return this.accelerationStatus; + } + + /** + * Set the accelerationStatus property: Specifies the transfer acceleration status of the bucket. + * + * @param accelerationStatus the accelerationStatus value to set. + * @return the AccelerateConfiguration object itself. + */ + public AccelerateConfiguration + withAccelerationStatus(AccelerateConfigurationAccelerationStatus accelerationStatus) { + this.accelerationStatus = accelerationStatus; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("accelerationStatus", + this.accelerationStatus == null ? null : this.accelerationStatus.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AccelerateConfiguration from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AccelerateConfiguration if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the AccelerateConfiguration. + */ + public static AccelerateConfiguration fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AccelerateConfiguration deserializedAccelerateConfiguration = new AccelerateConfiguration(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("accelerationStatus".equals(fieldName)) { + deserializedAccelerateConfiguration.accelerationStatus + = AccelerateConfigurationAccelerationStatus.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedAccelerateConfiguration; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/AccelerateConfigurationAccelerationStatus.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/AccelerateConfigurationAccelerationStatus.java new file mode 100644 index 000000000000..4ad2c0cc1b22 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/AccelerateConfigurationAccelerationStatus.java @@ -0,0 +1,52 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * AccelerateConfigurationAccelerationStatus enum. + */ +public final class AccelerateConfigurationAccelerationStatus + extends ExpandableStringEnum { + /** + * Static value Enabled for AccelerateConfigurationAccelerationStatus. + */ + public static final AccelerateConfigurationAccelerationStatus ENABLED = fromString("Enabled"); + + /** + * Static value Suspended for AccelerateConfigurationAccelerationStatus. + */ + public static final AccelerateConfigurationAccelerationStatus SUSPENDED = fromString("Suspended"); + + /** + * Creates a new instance of AccelerateConfigurationAccelerationStatus value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public AccelerateConfigurationAccelerationStatus() { + } + + /** + * Creates or finds a AccelerateConfigurationAccelerationStatus from its string representation. + * + * @param name a name to look for. + * @return the corresponding AccelerateConfigurationAccelerationStatus. + */ + public static AccelerateConfigurationAccelerationStatus fromString(String name) { + return fromString(name, AccelerateConfigurationAccelerationStatus.class); + } + + /** + * Gets known AccelerateConfigurationAccelerationStatus values. + * + * @return known AccelerateConfigurationAccelerationStatus values. + */ + public static Collection values() { + return values(AccelerateConfigurationAccelerationStatus.class); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/AcceleratorCountRequest.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/AcceleratorCountRequest.java new file mode 100644 index 000000000000..f83093be737b --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/AcceleratorCountRequest.java @@ -0,0 +1,121 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of AcceleratorCountRequest. + */ +@Fluent +public final class AcceleratorCountRequest implements JsonSerializable { + /* + * The maximum value. + */ + private Integer max; + + /* + * The minimum value. + */ + private Integer min; + + /** + * Creates an instance of AcceleratorCountRequest class. + */ + public AcceleratorCountRequest() { + } + + /** + * Get the max property: The maximum value. + * + * @return the max value. + */ + public Integer max() { + return this.max; + } + + /** + * Set the max property: The maximum value. + * + * @param max the max value to set. + * @return the AcceleratorCountRequest object itself. + */ + public AcceleratorCountRequest withMax(Integer max) { + this.max = max; + return this; + } + + /** + * Get the min property: The minimum value. + * + * @return the min value. + */ + public Integer min() { + return this.min; + } + + /** + * Set the min property: The minimum value. + * + * @param min the min value to set. + * @return the AcceleratorCountRequest object itself. + */ + public AcceleratorCountRequest withMin(Integer min) { + this.min = min; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeNumberField("max", this.max); + jsonWriter.writeNumberField("min", this.min); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AcceleratorCountRequest from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AcceleratorCountRequest if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the AcceleratorCountRequest. + */ + public static AcceleratorCountRequest fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AcceleratorCountRequest deserializedAcceleratorCountRequest = new AcceleratorCountRequest(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("max".equals(fieldName)) { + deserializedAcceleratorCountRequest.max = reader.getNullable(JsonReader::getInt); + } else if ("min".equals(fieldName)) { + deserializedAcceleratorCountRequest.min = reader.getNullable(JsonReader::getInt); + } else { + reader.skipChildren(); + } + } + + return deserializedAcceleratorCountRequest; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/AcceleratorTotalMemoryMiBRequest.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/AcceleratorTotalMemoryMiBRequest.java new file mode 100644 index 000000000000..4decca53020c --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/AcceleratorTotalMemoryMiBRequest.java @@ -0,0 +1,122 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of AcceleratorTotalMemoryMiBRequest. + */ +@Fluent +public final class AcceleratorTotalMemoryMiBRequest implements JsonSerializable { + /* + * The memory maximum in MiB. + */ + private Integer max; + + /* + * The memory minimum in MiB. + */ + private Integer min; + + /** + * Creates an instance of AcceleratorTotalMemoryMiBRequest class. + */ + public AcceleratorTotalMemoryMiBRequest() { + } + + /** + * Get the max property: The memory maximum in MiB. + * + * @return the max value. + */ + public Integer max() { + return this.max; + } + + /** + * Set the max property: The memory maximum in MiB. + * + * @param max the max value to set. + * @return the AcceleratorTotalMemoryMiBRequest object itself. + */ + public AcceleratorTotalMemoryMiBRequest withMax(Integer max) { + this.max = max; + return this; + } + + /** + * Get the min property: The memory minimum in MiB. + * + * @return the min value. + */ + public Integer min() { + return this.min; + } + + /** + * Set the min property: The memory minimum in MiB. + * + * @param min the min value to set. + * @return the AcceleratorTotalMemoryMiBRequest object itself. + */ + public AcceleratorTotalMemoryMiBRequest withMin(Integer min) { + this.min = min; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeNumberField("max", this.max); + jsonWriter.writeNumberField("min", this.min); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AcceleratorTotalMemoryMiBRequest from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AcceleratorTotalMemoryMiBRequest if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the AcceleratorTotalMemoryMiBRequest. + */ + public static AcceleratorTotalMemoryMiBRequest fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AcceleratorTotalMemoryMiBRequest deserializedAcceleratorTotalMemoryMiBRequest + = new AcceleratorTotalMemoryMiBRequest(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("max".equals(fieldName)) { + deserializedAcceleratorTotalMemoryMiBRequest.max = reader.getNullable(JsonReader::getInt); + } else if ("min".equals(fieldName)) { + deserializedAcceleratorTotalMemoryMiBRequest.min = reader.getNullable(JsonReader::getInt); + } else { + reader.skipChildren(); + } + } + + return deserializedAcceleratorTotalMemoryMiBRequest; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/AccessAnalyzer.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/AccessAnalyzer.java new file mode 100644 index 000000000000..832fb4fd4089 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/AccessAnalyzer.java @@ -0,0 +1,252 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.awsconnector.fluent.models.AccessAnalyzerInner; +import java.util.Map; + +/** + * An immutable client-side representation of AccessAnalyzer. + */ +public interface AccessAnalyzer { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the location property: The geo-location where the resource lives. + * + * @return the location value. + */ + String location(); + + /** + * Gets the tags property: Resource tags. + * + * @return the tags value. + */ + Map tags(); + + /** + * Gets the properties property: The resource-specific properties for this resource. + * + * @return the properties value. + */ + AccessAnalyzerProperties properties(); + + /** + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the region of the resource. + * + * @return the region of the resource. + */ + Region region(); + + /** + * Gets the name of the resource region. + * + * @return the name of the resource region. + */ + String regionName(); + + /** + * Gets the name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + + /** + * Gets the inner com.azure.resourcemanager.awsconnector.fluent.models.AccessAnalyzerInner object. + * + * @return the inner object. + */ + AccessAnalyzerInner innerModel(); + + /** + * The entirety of the AccessAnalyzer definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithLocation, + DefinitionStages.WithResourceGroup, DefinitionStages.WithCreate { + } + + /** + * The AccessAnalyzer definition stages. + */ + interface DefinitionStages { + /** + * The first stage of the AccessAnalyzer definition. + */ + interface Blank extends WithLocation { + } + + /** + * The stage of the AccessAnalyzer definition allowing to specify location. + */ + interface WithLocation { + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithResourceGroup withRegion(Region location); + + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithResourceGroup withRegion(String location); + } + + /** + * The stage of the AccessAnalyzer definition allowing to specify parent resource. + */ + interface WithResourceGroup { + /** + * Specifies resourceGroupName. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @return the next definition stage. + */ + WithCreate withExistingResourceGroup(String resourceGroupName); + } + + /** + * The stage of the AccessAnalyzer 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.WithProperties { + /** + * Executes the create request. + * + * @return the created resource. + */ + AccessAnalyzer create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + AccessAnalyzer create(Context context); + } + + /** + * The stage of the AccessAnalyzer definition allowing to specify tags. + */ + interface WithTags { + /** + * Specifies the tags property: Resource tags.. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + WithCreate withTags(Map tags); + } + + /** + * The stage of the AccessAnalyzer definition allowing to specify properties. + */ + interface WithProperties { + /** + * Specifies the properties property: The resource-specific properties for this resource.. + * + * @param properties The resource-specific properties for this resource. + * @return the next definition stage. + */ + WithCreate withProperties(AccessAnalyzerProperties properties); + } + } + + /** + * Begins update for the AccessAnalyzer resource. + * + * @return the stage of resource update. + */ + AccessAnalyzer.Update update(); + + /** + * The template for AccessAnalyzer update. + */ + interface Update extends UpdateStages.WithTags { + /** + * Executes the update request. + * + * @return the updated resource. + */ + AccessAnalyzer apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + AccessAnalyzer apply(Context context); + } + + /** + * The AccessAnalyzer update stages. + */ + interface UpdateStages { + /** + * The stage of the AccessAnalyzer update allowing to specify tags. + */ + interface WithTags { + /** + * Specifies the tags property: Resource tags.. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + Update withTags(Map tags); + } + } + + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + AccessAnalyzer refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + AccessAnalyzer refresh(Context context); +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/AccessAnalyzerAnalyzers.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/AccessAnalyzerAnalyzers.java new file mode 100644 index 000000000000..a06a773a8b8d --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/AccessAnalyzerAnalyzers.java @@ -0,0 +1,157 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** + * Resource collection API of AccessAnalyzerAnalyzers. + */ +public interface AccessAnalyzerAnalyzers { + /** + * List AccessAnalyzerAnalyzer resources by subscription ID. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a AccessAnalyzerAnalyzer list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable list(); + + /** + * List AccessAnalyzerAnalyzer resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a AccessAnalyzerAnalyzer list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable list(Context context); + + /** + * List AccessAnalyzerAnalyzer resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a AccessAnalyzerAnalyzer list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * List AccessAnalyzerAnalyzer resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a AccessAnalyzerAnalyzer list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Get a AccessAnalyzerAnalyzer. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of AccessAnalyzerAnalyzer. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a AccessAnalyzerAnalyzer along with {@link Response}. + */ + Response getByResourceGroupWithResponse(String resourceGroupName, String name, Context context); + + /** + * Get a AccessAnalyzerAnalyzer. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of AccessAnalyzerAnalyzer. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a AccessAnalyzerAnalyzer. + */ + AccessAnalyzer getByResourceGroup(String resourceGroupName, String name); + + /** + * Delete a AccessAnalyzerAnalyzer. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of AccessAnalyzerAnalyzer. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByResourceGroup(String resourceGroupName, String name); + + /** + * Delete a AccessAnalyzerAnalyzer. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of AccessAnalyzerAnalyzer. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String name, Context context); + + /** + * Get a AccessAnalyzerAnalyzer. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a AccessAnalyzerAnalyzer along with {@link Response}. + */ + AccessAnalyzer getById(String id); + + /** + * Get a AccessAnalyzerAnalyzer. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a AccessAnalyzerAnalyzer along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Delete a AccessAnalyzerAnalyzer. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteById(String id); + + /** + * Delete a AccessAnalyzerAnalyzer. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new AccessAnalyzer resource. + * + * @param name resource name. + * @return the first stage of the new AccessAnalyzer definition. + */ + AccessAnalyzer.DefinitionStages.Blank define(String name); +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/AccessAnalyzerListResult.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/AccessAnalyzerListResult.java new file mode 100644 index 000000000000..cda06b0d9de6 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/AccessAnalyzerListResult.java @@ -0,0 +1,135 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.awsconnector.fluent.models.AccessAnalyzerInner; +import java.io.IOException; +import java.util.List; + +/** + * The response of a AccessAnalyzerAnalyzer list operation. + */ +@Fluent +public final class AccessAnalyzerListResult implements JsonSerializable { + /* + * The AccessAnalyzerAnalyzer items on this page + */ + private List value; + + /* + * The link to the next page of items + */ + private String nextLink; + + /** + * Creates an instance of AccessAnalyzerListResult class. + */ + public AccessAnalyzerListResult() { + } + + /** + * Get the value property: The AccessAnalyzerAnalyzer items on this page. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The AccessAnalyzerAnalyzer items on this page. + * + * @param value the value value to set. + * @return the AccessAnalyzerListResult object itself. + */ + public AccessAnalyzerListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The link to the next page of items. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: The link to the next page of items. + * + * @param nextLink the nextLink value to set. + * @return the AccessAnalyzerListResult object itself. + */ + public AccessAnalyzerListResult withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property value in model AccessAnalyzerListResult")); + } else { + value().forEach(e -> e.validate()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(AccessAnalyzerListResult.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("nextLink", this.nextLink); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AccessAnalyzerListResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AccessAnalyzerListResult if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the AccessAnalyzerListResult. + */ + public static AccessAnalyzerListResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AccessAnalyzerListResult deserializedAccessAnalyzerListResult = new AccessAnalyzerListResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> AccessAnalyzerInner.fromJson(reader1)); + deserializedAccessAnalyzerListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedAccessAnalyzerListResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedAccessAnalyzerListResult; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/AccessAnalyzerProperties.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/AccessAnalyzerProperties.java new file mode 100644 index 000000000000..706faa7bfd80 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/AccessAnalyzerProperties.java @@ -0,0 +1,311 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.Map; + +/** + * Definition of AccessAnalyzerAnalyzer. + */ +@Fluent +public final class AccessAnalyzerProperties implements JsonSerializable { + /* + * AWS Properties + */ + private AwsAccessAnalyzerProperties awsProperties; + + /* + * Public Cloud Connectors Resource ID + */ + private String publicCloudConnectorsResourceId; + + /* + * AWS Account ID + */ + private String awsAccountId; + + /* + * Amazon Resource Name (ARN) + */ + private String arn; + + /* + * Public Cloud Resource Name + */ + private String publicCloudResourceName; + + /* + * AWS Source Schema + */ + private String awsSourceSchema; + + /* + * AWS Region + */ + private String awsRegion; + + /* + * AWS Tags + */ + private Map awsTags; + + /* + * The status of the last operation. + */ + private ProvisioningState provisioningState; + + /** + * Creates an instance of AccessAnalyzerProperties class. + */ + public AccessAnalyzerProperties() { + } + + /** + * Get the awsProperties property: AWS Properties. + * + * @return the awsProperties value. + */ + public AwsAccessAnalyzerProperties awsProperties() { + return this.awsProperties; + } + + /** + * Set the awsProperties property: AWS Properties. + * + * @param awsProperties the awsProperties value to set. + * @return the AccessAnalyzerProperties object itself. + */ + public AccessAnalyzerProperties withAwsProperties(AwsAccessAnalyzerProperties awsProperties) { + this.awsProperties = awsProperties; + return this; + } + + /** + * Get the publicCloudConnectorsResourceId property: Public Cloud Connectors Resource ID. + * + * @return the publicCloudConnectorsResourceId value. + */ + public String publicCloudConnectorsResourceId() { + return this.publicCloudConnectorsResourceId; + } + + /** + * Set the publicCloudConnectorsResourceId property: Public Cloud Connectors Resource ID. + * + * @param publicCloudConnectorsResourceId the publicCloudConnectorsResourceId value to set. + * @return the AccessAnalyzerProperties object itself. + */ + public AccessAnalyzerProperties withPublicCloudConnectorsResourceId(String publicCloudConnectorsResourceId) { + this.publicCloudConnectorsResourceId = publicCloudConnectorsResourceId; + return this; + } + + /** + * Get the awsAccountId property: AWS Account ID. + * + * @return the awsAccountId value. + */ + public String awsAccountId() { + return this.awsAccountId; + } + + /** + * Set the awsAccountId property: AWS Account ID. + * + * @param awsAccountId the awsAccountId value to set. + * @return the AccessAnalyzerProperties object itself. + */ + public AccessAnalyzerProperties withAwsAccountId(String awsAccountId) { + this.awsAccountId = awsAccountId; + return this; + } + + /** + * Get the arn property: Amazon Resource Name (ARN). + * + * @return the arn value. + */ + public String arn() { + return this.arn; + } + + /** + * Set the arn property: Amazon Resource Name (ARN). + * + * @param arn the arn value to set. + * @return the AccessAnalyzerProperties object itself. + */ + public AccessAnalyzerProperties withArn(String arn) { + this.arn = arn; + return this; + } + + /** + * Get the publicCloudResourceName property: Public Cloud Resource Name. + * + * @return the publicCloudResourceName value. + */ + public String publicCloudResourceName() { + return this.publicCloudResourceName; + } + + /** + * Set the publicCloudResourceName property: Public Cloud Resource Name. + * + * @param publicCloudResourceName the publicCloudResourceName value to set. + * @return the AccessAnalyzerProperties object itself. + */ + public AccessAnalyzerProperties withPublicCloudResourceName(String publicCloudResourceName) { + this.publicCloudResourceName = publicCloudResourceName; + return this; + } + + /** + * Get the awsSourceSchema property: AWS Source Schema. + * + * @return the awsSourceSchema value. + */ + public String awsSourceSchema() { + return this.awsSourceSchema; + } + + /** + * Set the awsSourceSchema property: AWS Source Schema. + * + * @param awsSourceSchema the awsSourceSchema value to set. + * @return the AccessAnalyzerProperties object itself. + */ + public AccessAnalyzerProperties withAwsSourceSchema(String awsSourceSchema) { + this.awsSourceSchema = awsSourceSchema; + return this; + } + + /** + * Get the awsRegion property: AWS Region. + * + * @return the awsRegion value. + */ + public String awsRegion() { + return this.awsRegion; + } + + /** + * Set the awsRegion property: AWS Region. + * + * @param awsRegion the awsRegion value to set. + * @return the AccessAnalyzerProperties object itself. + */ + public AccessAnalyzerProperties withAwsRegion(String awsRegion) { + this.awsRegion = awsRegion; + return this; + } + + /** + * Get the awsTags property: AWS Tags. + * + * @return the awsTags value. + */ + public Map awsTags() { + return this.awsTags; + } + + /** + * Set the awsTags property: AWS Tags. + * + * @param awsTags the awsTags value to set. + * @return the AccessAnalyzerProperties object itself. + */ + public AccessAnalyzerProperties withAwsTags(Map awsTags) { + this.awsTags = awsTags; + return this; + } + + /** + * Get the provisioningState property: The status of the last operation. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (awsProperties() != null) { + awsProperties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("awsProperties", this.awsProperties); + jsonWriter.writeStringField("publicCloudConnectorsResourceId", this.publicCloudConnectorsResourceId); + jsonWriter.writeStringField("awsAccountId", this.awsAccountId); + jsonWriter.writeStringField("arn", this.arn); + jsonWriter.writeStringField("publicCloudResourceName", this.publicCloudResourceName); + jsonWriter.writeStringField("awsSourceSchema", this.awsSourceSchema); + jsonWriter.writeStringField("awsRegion", this.awsRegion); + jsonWriter.writeMapField("awsTags", this.awsTags, (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AccessAnalyzerProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AccessAnalyzerProperties if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IOException If an error occurs while reading the AccessAnalyzerProperties. + */ + public static AccessAnalyzerProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AccessAnalyzerProperties deserializedAccessAnalyzerProperties = new AccessAnalyzerProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("awsProperties".equals(fieldName)) { + deserializedAccessAnalyzerProperties.awsProperties = AwsAccessAnalyzerProperties.fromJson(reader); + } else if ("publicCloudConnectorsResourceId".equals(fieldName)) { + deserializedAccessAnalyzerProperties.publicCloudConnectorsResourceId = reader.getString(); + } else if ("awsAccountId".equals(fieldName)) { + deserializedAccessAnalyzerProperties.awsAccountId = reader.getString(); + } else if ("arn".equals(fieldName)) { + deserializedAccessAnalyzerProperties.arn = reader.getString(); + } else if ("publicCloudResourceName".equals(fieldName)) { + deserializedAccessAnalyzerProperties.publicCloudResourceName = reader.getString(); + } else if ("awsSourceSchema".equals(fieldName)) { + deserializedAccessAnalyzerProperties.awsSourceSchema = reader.getString(); + } else if ("awsRegion".equals(fieldName)) { + deserializedAccessAnalyzerProperties.awsRegion = reader.getString(); + } else if ("awsTags".equals(fieldName)) { + Map awsTags = reader.readMap(reader1 -> reader1.getString()); + deserializedAccessAnalyzerProperties.awsTags = awsTags; + } else if ("provisioningState".equals(fieldName)) { + deserializedAccessAnalyzerProperties.provisioningState + = ProvisioningState.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedAccessAnalyzerProperties; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/AccessAnalyzerTagsUpdate.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/AccessAnalyzerTagsUpdate.java new file mode 100644 index 000000000000..8dbe99df501f --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/AccessAnalyzerTagsUpdate.java @@ -0,0 +1,95 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.Map; + +/** + * The type used for updating tags in AccessAnalyzerAnalyzer resources. + */ +@Fluent +public final class AccessAnalyzerTagsUpdate implements JsonSerializable { + /* + * Resource tags. + */ + private Map tags; + + /** + * Creates an instance of AccessAnalyzerTagsUpdate class. + */ + public AccessAnalyzerTagsUpdate() { + } + + /** + * Get the tags property: Resource tags. + * + * @return the tags value. + */ + public Map tags() { + return this.tags; + } + + /** + * Set the tags property: Resource tags. + * + * @param tags the tags value to set. + * @return the AccessAnalyzerTagsUpdate object itself. + */ + public AccessAnalyzerTagsUpdate withTags(Map tags) { + this.tags = tags; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeMapField("tags", this.tags, (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AccessAnalyzerTagsUpdate from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AccessAnalyzerTagsUpdate if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IOException If an error occurs while reading the AccessAnalyzerTagsUpdate. + */ + public static AccessAnalyzerTagsUpdate fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AccessAnalyzerTagsUpdate deserializedAccessAnalyzerTagsUpdate = new AccessAnalyzerTagsUpdate(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedAccessAnalyzerTagsUpdate.tags = tags; + } else { + reader.skipChildren(); + } + } + + return deserializedAccessAnalyzerTagsUpdate; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/AccessConfigResponse.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/AccessConfigResponse.java new file mode 100644 index 000000000000..e57a19af2e35 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/AccessConfigResponse.java @@ -0,0 +1,130 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of AccessConfigResponse. + */ +@Fluent +public final class AccessConfigResponse implements JsonSerializable { + /* + *

The current authentication mode of the cluster.

+ */ + private AuthenticationModeEnumValue authenticationMode; + + /* + *

Specifies whether or not the cluster creator IAM principal was set as a cluster admin access entry during + * cluster creation time.

+ */ + private Boolean bootstrapClusterCreatorAdminPermissions; + + /** + * Creates an instance of AccessConfigResponse class. + */ + public AccessConfigResponse() { + } + + /** + * Get the authenticationMode property: <p>The current authentication mode of the cluster.</p>. + * + * @return the authenticationMode value. + */ + public AuthenticationModeEnumValue authenticationMode() { + return this.authenticationMode; + } + + /** + * Set the authenticationMode property: <p>The current authentication mode of the cluster.</p>. + * + * @param authenticationMode the authenticationMode value to set. + * @return the AccessConfigResponse object itself. + */ + public AccessConfigResponse withAuthenticationMode(AuthenticationModeEnumValue authenticationMode) { + this.authenticationMode = authenticationMode; + return this; + } + + /** + * Get the bootstrapClusterCreatorAdminPermissions property: <p>Specifies whether or not the cluster creator + * IAM principal was set as a cluster admin access entry during cluster creation time.</p>. + * + * @return the bootstrapClusterCreatorAdminPermissions value. + */ + public Boolean bootstrapClusterCreatorAdminPermissions() { + return this.bootstrapClusterCreatorAdminPermissions; + } + + /** + * Set the bootstrapClusterCreatorAdminPermissions property: <p>Specifies whether or not the cluster creator + * IAM principal was set as a cluster admin access entry during cluster creation time.</p>. + * + * @param bootstrapClusterCreatorAdminPermissions the bootstrapClusterCreatorAdminPermissions value to set. + * @return the AccessConfigResponse object itself. + */ + public AccessConfigResponse + withBootstrapClusterCreatorAdminPermissions(Boolean bootstrapClusterCreatorAdminPermissions) { + this.bootstrapClusterCreatorAdminPermissions = bootstrapClusterCreatorAdminPermissions; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (authenticationMode() != null) { + authenticationMode().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("authenticationMode", this.authenticationMode); + jsonWriter.writeBooleanField("bootstrapClusterCreatorAdminPermissions", + this.bootstrapClusterCreatorAdminPermissions); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AccessConfigResponse from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AccessConfigResponse if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the AccessConfigResponse. + */ + public static AccessConfigResponse fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AccessConfigResponse deserializedAccessConfigResponse = new AccessConfigResponse(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("authenticationMode".equals(fieldName)) { + deserializedAccessConfigResponse.authenticationMode = AuthenticationModeEnumValue.fromJson(reader); + } else if ("bootstrapClusterCreatorAdminPermissions".equals(fieldName)) { + deserializedAccessConfigResponse.bootstrapClusterCreatorAdminPermissions + = reader.getNullable(JsonReader::getBoolean); + } else { + reader.skipChildren(); + } + } + + return deserializedAccessConfigResponse; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/AccessControl.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/AccessControl.java new file mode 100644 index 000000000000..9ac597c7a275 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/AccessControl.java @@ -0,0 +1,81 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * AccessControl enum. + */ +public final class AccessControl extends ExpandableStringEnum { + /** + * Static value AuthenticatedRead for AccessControl. + */ + public static final AccessControl AUTHENTICATED_READ = fromString("AuthenticatedRead"); + + /** + * Static value AwsExecRead for AccessControl. + */ + public static final AccessControl AWS_EXEC_READ = fromString("AwsExecRead"); + + /** + * Static value BucketOwnerFullControl for AccessControl. + */ + public static final AccessControl BUCKET_OWNER_FULL_CONTROL = fromString("BucketOwnerFullControl"); + + /** + * Static value BucketOwnerRead for AccessControl. + */ + public static final AccessControl BUCKET_OWNER_READ = fromString("BucketOwnerRead"); + + /** + * Static value LogDeliveryWrite for AccessControl. + */ + public static final AccessControl LOG_DELIVERY_WRITE = fromString("LogDeliveryWrite"); + + /** + * Static value Private for AccessControl. + */ + public static final AccessControl PRIVATE = fromString("Private"); + + /** + * Static value PublicRead for AccessControl. + */ + public static final AccessControl PUBLIC_READ = fromString("PublicRead"); + + /** + * Static value PublicReadWrite for AccessControl. + */ + public static final AccessControl PUBLIC_READ_WRITE = fromString("PublicReadWrite"); + + /** + * Creates a new instance of AccessControl value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public AccessControl() { + } + + /** + * Creates or finds a AccessControl from its string representation. + * + * @param name a name to look for. + * @return the corresponding AccessControl. + */ + public static AccessControl fromString(String name) { + return fromString(name, AccessControl.class); + } + + /** + * Gets known AccessControl values. + * + * @return known AccessControl values. + */ + public static Collection values() { + return values(AccessControl.class); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/AccessControlTranslation.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/AccessControlTranslation.java new file mode 100644 index 000000000000..9831d453c3b6 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/AccessControlTranslation.java @@ -0,0 +1,99 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of AccessControlTranslation. + */ +@Fluent +public final class AccessControlTranslation implements JsonSerializable { + /* + * Specifies the replica ownership. For default and valid values, see [PUT bucket + * replication](https://docs.aws.amazon.com/AmazonS3/latest/API/RESTBucketPUTreplication.html) in the *Amazon S3 API + * Reference*. + */ + private String owner; + + /** + * Creates an instance of AccessControlTranslation class. + */ + public AccessControlTranslation() { + } + + /** + * Get the owner property: Specifies the replica ownership. For default and valid values, see [PUT bucket + * replication](https://docs.aws.amazon.com/AmazonS3/latest/API/RESTBucketPUTreplication.html) in the *Amazon S3 API + * Reference*. + * + * @return the owner value. + */ + public String owner() { + return this.owner; + } + + /** + * Set the owner property: Specifies the replica ownership. For default and valid values, see [PUT bucket + * replication](https://docs.aws.amazon.com/AmazonS3/latest/API/RESTBucketPUTreplication.html) in the *Amazon S3 API + * Reference*. + * + * @param owner the owner value to set. + * @return the AccessControlTranslation object itself. + */ + public AccessControlTranslation withOwner(String owner) { + this.owner = owner; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("owner", this.owner); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AccessControlTranslation from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AccessControlTranslation if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IOException If an error occurs while reading the AccessControlTranslation. + */ + public static AccessControlTranslation fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AccessControlTranslation deserializedAccessControlTranslation = new AccessControlTranslation(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("owner".equals(fieldName)) { + deserializedAccessControlTranslation.owner = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedAccessControlTranslation; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/AccessLogSetting.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/AccessLogSetting.java new file mode 100644 index 000000000000..d0682cf93434 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/AccessLogSetting.java @@ -0,0 +1,134 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of AccessLogSetting. + */ +@Fluent +public final class AccessLogSetting implements JsonSerializable { + /* + * The Amazon Resource Name (ARN) of the CloudWatch Logs log group or Kinesis Data Firehose delivery stream to + * receive access logs. If you specify a Kinesis Data Firehose delivery stream, the stream name must begin with + * ``amazon-apigateway-``. This parameter is required to enable access logging. + */ + private String destinationArn; + + /* + * A single line format of the access logs of data, as specified by selected [$context + * variables](https://docs.aws.amazon.com/apigateway/latest/developerguide/api-gateway-mapping-template-reference. + * html#context-variable-reference). The format must include at least ``$context.requestId``. This parameter is + * required to enable access logging. + */ + private String format; + + /** + * Creates an instance of AccessLogSetting class. + */ + public AccessLogSetting() { + } + + /** + * Get the destinationArn property: The Amazon Resource Name (ARN) of the CloudWatch Logs log group or Kinesis Data + * Firehose delivery stream to receive access logs. If you specify a Kinesis Data Firehose delivery stream, the + * stream name must begin with ``amazon-apigateway-``. This parameter is required to enable access logging. + * + * @return the destinationArn value. + */ + public String destinationArn() { + return this.destinationArn; + } + + /** + * Set the destinationArn property: The Amazon Resource Name (ARN) of the CloudWatch Logs log group or Kinesis Data + * Firehose delivery stream to receive access logs. If you specify a Kinesis Data Firehose delivery stream, the + * stream name must begin with ``amazon-apigateway-``. This parameter is required to enable access logging. + * + * @param destinationArn the destinationArn value to set. + * @return the AccessLogSetting object itself. + */ + public AccessLogSetting withDestinationArn(String destinationArn) { + this.destinationArn = destinationArn; + return this; + } + + /** + * Get the format property: A single line format of the access logs of data, as specified by selected [$context + * variables](https://docs.aws.amazon.com/apigateway/latest/developerguide/api-gateway-mapping-template-reference.html#context-variable-reference). + * The format must include at least ``$context.requestId``. This parameter is required to enable access logging. + * + * @return the format value. + */ + public String format() { + return this.format; + } + + /** + * Set the format property: A single line format of the access logs of data, as specified by selected [$context + * variables](https://docs.aws.amazon.com/apigateway/latest/developerguide/api-gateway-mapping-template-reference.html#context-variable-reference). + * The format must include at least ``$context.requestId``. This parameter is required to enable access logging. + * + * @param format the format value to set. + * @return the AccessLogSetting object itself. + */ + public AccessLogSetting withFormat(String format) { + this.format = format; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("destinationArn", this.destinationArn); + jsonWriter.writeStringField("format", this.format); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AccessLogSetting from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AccessLogSetting if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the AccessLogSetting. + */ + public static AccessLogSetting fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AccessLogSetting deserializedAccessLogSetting = new AccessLogSetting(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("destinationArn".equals(fieldName)) { + deserializedAccessLogSetting.destinationArn = reader.getString(); + } else if ("format".equals(fieldName)) { + deserializedAccessLogSetting.format = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedAccessLogSetting; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/AccessRules.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/AccessRules.java new file mode 100644 index 000000000000..ce1b4f96fd65 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/AccessRules.java @@ -0,0 +1,124 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of AccessRules. + */ +@Fluent +public final class AccessRules implements JsonSerializable { + /* + * A Boolean value that indicates whether the access control list (ACL) permissions that are applied to individual + * objects override the getObject option that is currently specified. + */ + private Boolean allowPublicOverrides; + + /* + * Specifies the anonymous access to all objects in a bucket. + */ + private String getObject; + + /** + * Creates an instance of AccessRules class. + */ + public AccessRules() { + } + + /** + * Get the allowPublicOverrides property: A Boolean value that indicates whether the access control list (ACL) + * permissions that are applied to individual objects override the getObject option that is currently specified. + * + * @return the allowPublicOverrides value. + */ + public Boolean allowPublicOverrides() { + return this.allowPublicOverrides; + } + + /** + * Set the allowPublicOverrides property: A Boolean value that indicates whether the access control list (ACL) + * permissions that are applied to individual objects override the getObject option that is currently specified. + * + * @param allowPublicOverrides the allowPublicOverrides value to set. + * @return the AccessRules object itself. + */ + public AccessRules withAllowPublicOverrides(Boolean allowPublicOverrides) { + this.allowPublicOverrides = allowPublicOverrides; + return this; + } + + /** + * Get the getObject property: Specifies the anonymous access to all objects in a bucket. + * + * @return the getObject value. + */ + public String getObject() { + return this.getObject; + } + + /** + * Set the getObject property: Specifies the anonymous access to all objects in a bucket. + * + * @param getObject the getObject value to set. + * @return the AccessRules object itself. + */ + public AccessRules withGetObject(String getObject) { + this.getObject = getObject; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeBooleanField("allowPublicOverrides", this.allowPublicOverrides); + jsonWriter.writeStringField("getObject", this.getObject); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AccessRules from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AccessRules if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the AccessRules. + */ + public static AccessRules fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AccessRules deserializedAccessRules = new AccessRules(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("allowPublicOverrides".equals(fieldName)) { + deserializedAccessRules.allowPublicOverrides = reader.getNullable(JsonReader::getBoolean); + } else if ("getObject".equals(fieldName)) { + deserializedAccessRules.getObject = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedAccessRules; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/AccountAttributeValue.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/AccountAttributeValue.java new file mode 100644 index 000000000000..febb27f37bdd --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/AccountAttributeValue.java @@ -0,0 +1,93 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of AccountAttributeValue. + */ +@Fluent +public final class AccountAttributeValue implements JsonSerializable { + /* + *

The value of the attribute.

+ */ + private String attributeValue; + + /** + * Creates an instance of AccountAttributeValue class. + */ + public AccountAttributeValue() { + } + + /** + * Get the attributeValue property: <p>The value of the attribute.</p>. + * + * @return the attributeValue value. + */ + public String attributeValue() { + return this.attributeValue; + } + + /** + * Set the attributeValue property: <p>The value of the attribute.</p>. + * + * @param attributeValue the attributeValue value to set. + * @return the AccountAttributeValue object itself. + */ + public AccountAttributeValue withAttributeValue(String attributeValue) { + this.attributeValue = attributeValue; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("attributeValue", this.attributeValue); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AccountAttributeValue from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AccountAttributeValue if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the AccountAttributeValue. + */ + public static AccountAttributeValue fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AccountAttributeValue deserializedAccountAttributeValue = new AccountAttributeValue(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("attributeValue".equals(fieldName)) { + deserializedAccountAttributeValue.attributeValue = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedAccountAttributeValue; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/AcmCertificateSummaries.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/AcmCertificateSummaries.java new file mode 100644 index 000000000000..69f1028db4a6 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/AcmCertificateSummaries.java @@ -0,0 +1,158 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** + * Resource collection API of AcmCertificateSummaries. + */ +public interface AcmCertificateSummaries { + /** + * List AcmCertificateSummary resources by subscription ID. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a AcmCertificateSummary list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable list(); + + /** + * List AcmCertificateSummary resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a AcmCertificateSummary list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable list(Context context); + + /** + * List AcmCertificateSummary resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a AcmCertificateSummary list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * List AcmCertificateSummary resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a AcmCertificateSummary list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Get a AcmCertificateSummary. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of AcmCertificateSummary. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a AcmCertificateSummary along with {@link Response}. + */ + Response getByResourceGroupWithResponse(String resourceGroupName, String name, + Context context); + + /** + * Get a AcmCertificateSummary. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of AcmCertificateSummary. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a AcmCertificateSummary. + */ + AcmCertificateSummary getByResourceGroup(String resourceGroupName, String name); + + /** + * Delete a AcmCertificateSummary. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of AcmCertificateSummary. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByResourceGroup(String resourceGroupName, String name); + + /** + * Delete a AcmCertificateSummary. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of AcmCertificateSummary. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String name, Context context); + + /** + * Get a AcmCertificateSummary. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a AcmCertificateSummary along with {@link Response}. + */ + AcmCertificateSummary getById(String id); + + /** + * Get a AcmCertificateSummary. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a AcmCertificateSummary along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Delete a AcmCertificateSummary. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteById(String id); + + /** + * Delete a AcmCertificateSummary. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new AcmCertificateSummary resource. + * + * @param name resource name. + * @return the first stage of the new AcmCertificateSummary definition. + */ + AcmCertificateSummary.DefinitionStages.Blank define(String name); +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/AcmCertificateSummary.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/AcmCertificateSummary.java new file mode 100644 index 000000000000..d0e44618d2fc --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/AcmCertificateSummary.java @@ -0,0 +1,252 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.awsconnector.fluent.models.AcmCertificateSummaryInner; +import java.util.Map; + +/** + * An immutable client-side representation of AcmCertificateSummary. + */ +public interface AcmCertificateSummary { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the location property: The geo-location where the resource lives. + * + * @return the location value. + */ + String location(); + + /** + * Gets the tags property: Resource tags. + * + * @return the tags value. + */ + Map tags(); + + /** + * Gets the properties property: The resource-specific properties for this resource. + * + * @return the properties value. + */ + AcmCertificateSummaryProperties properties(); + + /** + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the region of the resource. + * + * @return the region of the resource. + */ + Region region(); + + /** + * Gets the name of the resource region. + * + * @return the name of the resource region. + */ + String regionName(); + + /** + * Gets the name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + + /** + * Gets the inner com.azure.resourcemanager.awsconnector.fluent.models.AcmCertificateSummaryInner object. + * + * @return the inner object. + */ + AcmCertificateSummaryInner innerModel(); + + /** + * The entirety of the AcmCertificateSummary definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithLocation, + DefinitionStages.WithResourceGroup, DefinitionStages.WithCreate { + } + + /** + * The AcmCertificateSummary definition stages. + */ + interface DefinitionStages { + /** + * The first stage of the AcmCertificateSummary definition. + */ + interface Blank extends WithLocation { + } + + /** + * The stage of the AcmCertificateSummary definition allowing to specify location. + */ + interface WithLocation { + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithResourceGroup withRegion(Region location); + + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithResourceGroup withRegion(String location); + } + + /** + * The stage of the AcmCertificateSummary definition allowing to specify parent resource. + */ + interface WithResourceGroup { + /** + * Specifies resourceGroupName. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @return the next definition stage. + */ + WithCreate withExistingResourceGroup(String resourceGroupName); + } + + /** + * The stage of the AcmCertificateSummary 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.WithProperties { + /** + * Executes the create request. + * + * @return the created resource. + */ + AcmCertificateSummary create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + AcmCertificateSummary create(Context context); + } + + /** + * The stage of the AcmCertificateSummary definition allowing to specify tags. + */ + interface WithTags { + /** + * Specifies the tags property: Resource tags.. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + WithCreate withTags(Map tags); + } + + /** + * The stage of the AcmCertificateSummary definition allowing to specify properties. + */ + interface WithProperties { + /** + * Specifies the properties property: The resource-specific properties for this resource.. + * + * @param properties The resource-specific properties for this resource. + * @return the next definition stage. + */ + WithCreate withProperties(AcmCertificateSummaryProperties properties); + } + } + + /** + * Begins update for the AcmCertificateSummary resource. + * + * @return the stage of resource update. + */ + AcmCertificateSummary.Update update(); + + /** + * The template for AcmCertificateSummary update. + */ + interface Update extends UpdateStages.WithTags { + /** + * Executes the update request. + * + * @return the updated resource. + */ + AcmCertificateSummary apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + AcmCertificateSummary apply(Context context); + } + + /** + * The AcmCertificateSummary update stages. + */ + interface UpdateStages { + /** + * The stage of the AcmCertificateSummary update allowing to specify tags. + */ + interface WithTags { + /** + * Specifies the tags property: Resource tags.. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + Update withTags(Map tags); + } + } + + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + AcmCertificateSummary refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + AcmCertificateSummary refresh(Context context); +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/AcmCertificateSummaryListResult.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/AcmCertificateSummaryListResult.java new file mode 100644 index 000000000000..1811ada692a7 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/AcmCertificateSummaryListResult.java @@ -0,0 +1,137 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.awsconnector.fluent.models.AcmCertificateSummaryInner; +import java.io.IOException; +import java.util.List; + +/** + * The response of a AcmCertificateSummary list operation. + */ +@Fluent +public final class AcmCertificateSummaryListResult implements JsonSerializable { + /* + * The AcmCertificateSummary items on this page + */ + private List value; + + /* + * The link to the next page of items + */ + private String nextLink; + + /** + * Creates an instance of AcmCertificateSummaryListResult class. + */ + public AcmCertificateSummaryListResult() { + } + + /** + * Get the value property: The AcmCertificateSummary items on this page. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The AcmCertificateSummary items on this page. + * + * @param value the value value to set. + * @return the AcmCertificateSummaryListResult object itself. + */ + public AcmCertificateSummaryListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The link to the next page of items. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: The link to the next page of items. + * + * @param nextLink the nextLink value to set. + * @return the AcmCertificateSummaryListResult object itself. + */ + public AcmCertificateSummaryListResult withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property value in model AcmCertificateSummaryListResult")); + } else { + value().forEach(e -> e.validate()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(AcmCertificateSummaryListResult.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("nextLink", this.nextLink); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AcmCertificateSummaryListResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AcmCertificateSummaryListResult if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the AcmCertificateSummaryListResult. + */ + public static AcmCertificateSummaryListResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AcmCertificateSummaryListResult deserializedAcmCertificateSummaryListResult + = new AcmCertificateSummaryListResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> AcmCertificateSummaryInner.fromJson(reader1)); + deserializedAcmCertificateSummaryListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedAcmCertificateSummaryListResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedAcmCertificateSummaryListResult; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/AcmCertificateSummaryProperties.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/AcmCertificateSummaryProperties.java new file mode 100644 index 000000000000..938252b00d29 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/AcmCertificateSummaryProperties.java @@ -0,0 +1,313 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.Map; + +/** + * Definition of AcmCertificateSummary. + */ +@Fluent +public final class AcmCertificateSummaryProperties implements JsonSerializable { + /* + * AWS Properties + */ + private AwsAcmCertificateSummaryProperties awsProperties; + + /* + * Public Cloud Connectors Resource ID + */ + private String publicCloudConnectorsResourceId; + + /* + * AWS Account ID + */ + private String awsAccountId; + + /* + * Amazon Resource Name (ARN) + */ + private String arn; + + /* + * Public Cloud Resource Name + */ + private String publicCloudResourceName; + + /* + * AWS Source Schema + */ + private String awsSourceSchema; + + /* + * AWS Region + */ + private String awsRegion; + + /* + * AWS Tags + */ + private Map awsTags; + + /* + * The status of the last operation. + */ + private ProvisioningState provisioningState; + + /** + * Creates an instance of AcmCertificateSummaryProperties class. + */ + public AcmCertificateSummaryProperties() { + } + + /** + * Get the awsProperties property: AWS Properties. + * + * @return the awsProperties value. + */ + public AwsAcmCertificateSummaryProperties awsProperties() { + return this.awsProperties; + } + + /** + * Set the awsProperties property: AWS Properties. + * + * @param awsProperties the awsProperties value to set. + * @return the AcmCertificateSummaryProperties object itself. + */ + public AcmCertificateSummaryProperties withAwsProperties(AwsAcmCertificateSummaryProperties awsProperties) { + this.awsProperties = awsProperties; + return this; + } + + /** + * Get the publicCloudConnectorsResourceId property: Public Cloud Connectors Resource ID. + * + * @return the publicCloudConnectorsResourceId value. + */ + public String publicCloudConnectorsResourceId() { + return this.publicCloudConnectorsResourceId; + } + + /** + * Set the publicCloudConnectorsResourceId property: Public Cloud Connectors Resource ID. + * + * @param publicCloudConnectorsResourceId the publicCloudConnectorsResourceId value to set. + * @return the AcmCertificateSummaryProperties object itself. + */ + public AcmCertificateSummaryProperties withPublicCloudConnectorsResourceId(String publicCloudConnectorsResourceId) { + this.publicCloudConnectorsResourceId = publicCloudConnectorsResourceId; + return this; + } + + /** + * Get the awsAccountId property: AWS Account ID. + * + * @return the awsAccountId value. + */ + public String awsAccountId() { + return this.awsAccountId; + } + + /** + * Set the awsAccountId property: AWS Account ID. + * + * @param awsAccountId the awsAccountId value to set. + * @return the AcmCertificateSummaryProperties object itself. + */ + public AcmCertificateSummaryProperties withAwsAccountId(String awsAccountId) { + this.awsAccountId = awsAccountId; + return this; + } + + /** + * Get the arn property: Amazon Resource Name (ARN). + * + * @return the arn value. + */ + public String arn() { + return this.arn; + } + + /** + * Set the arn property: Amazon Resource Name (ARN). + * + * @param arn the arn value to set. + * @return the AcmCertificateSummaryProperties object itself. + */ + public AcmCertificateSummaryProperties withArn(String arn) { + this.arn = arn; + return this; + } + + /** + * Get the publicCloudResourceName property: Public Cloud Resource Name. + * + * @return the publicCloudResourceName value. + */ + public String publicCloudResourceName() { + return this.publicCloudResourceName; + } + + /** + * Set the publicCloudResourceName property: Public Cloud Resource Name. + * + * @param publicCloudResourceName the publicCloudResourceName value to set. + * @return the AcmCertificateSummaryProperties object itself. + */ + public AcmCertificateSummaryProperties withPublicCloudResourceName(String publicCloudResourceName) { + this.publicCloudResourceName = publicCloudResourceName; + return this; + } + + /** + * Get the awsSourceSchema property: AWS Source Schema. + * + * @return the awsSourceSchema value. + */ + public String awsSourceSchema() { + return this.awsSourceSchema; + } + + /** + * Set the awsSourceSchema property: AWS Source Schema. + * + * @param awsSourceSchema the awsSourceSchema value to set. + * @return the AcmCertificateSummaryProperties object itself. + */ + public AcmCertificateSummaryProperties withAwsSourceSchema(String awsSourceSchema) { + this.awsSourceSchema = awsSourceSchema; + return this; + } + + /** + * Get the awsRegion property: AWS Region. + * + * @return the awsRegion value. + */ + public String awsRegion() { + return this.awsRegion; + } + + /** + * Set the awsRegion property: AWS Region. + * + * @param awsRegion the awsRegion value to set. + * @return the AcmCertificateSummaryProperties object itself. + */ + public AcmCertificateSummaryProperties withAwsRegion(String awsRegion) { + this.awsRegion = awsRegion; + return this; + } + + /** + * Get the awsTags property: AWS Tags. + * + * @return the awsTags value. + */ + public Map awsTags() { + return this.awsTags; + } + + /** + * Set the awsTags property: AWS Tags. + * + * @param awsTags the awsTags value to set. + * @return the AcmCertificateSummaryProperties object itself. + */ + public AcmCertificateSummaryProperties withAwsTags(Map awsTags) { + this.awsTags = awsTags; + return this; + } + + /** + * Get the provisioningState property: The status of the last operation. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (awsProperties() != null) { + awsProperties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("awsProperties", this.awsProperties); + jsonWriter.writeStringField("publicCloudConnectorsResourceId", this.publicCloudConnectorsResourceId); + jsonWriter.writeStringField("awsAccountId", this.awsAccountId); + jsonWriter.writeStringField("arn", this.arn); + jsonWriter.writeStringField("publicCloudResourceName", this.publicCloudResourceName); + jsonWriter.writeStringField("awsSourceSchema", this.awsSourceSchema); + jsonWriter.writeStringField("awsRegion", this.awsRegion); + jsonWriter.writeMapField("awsTags", this.awsTags, (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AcmCertificateSummaryProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AcmCertificateSummaryProperties if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the AcmCertificateSummaryProperties. + */ + public static AcmCertificateSummaryProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AcmCertificateSummaryProperties deserializedAcmCertificateSummaryProperties + = new AcmCertificateSummaryProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("awsProperties".equals(fieldName)) { + deserializedAcmCertificateSummaryProperties.awsProperties + = AwsAcmCertificateSummaryProperties.fromJson(reader); + } else if ("publicCloudConnectorsResourceId".equals(fieldName)) { + deserializedAcmCertificateSummaryProperties.publicCloudConnectorsResourceId = reader.getString(); + } else if ("awsAccountId".equals(fieldName)) { + deserializedAcmCertificateSummaryProperties.awsAccountId = reader.getString(); + } else if ("arn".equals(fieldName)) { + deserializedAcmCertificateSummaryProperties.arn = reader.getString(); + } else if ("publicCloudResourceName".equals(fieldName)) { + deserializedAcmCertificateSummaryProperties.publicCloudResourceName = reader.getString(); + } else if ("awsSourceSchema".equals(fieldName)) { + deserializedAcmCertificateSummaryProperties.awsSourceSchema = reader.getString(); + } else if ("awsRegion".equals(fieldName)) { + deserializedAcmCertificateSummaryProperties.awsRegion = reader.getString(); + } else if ("awsTags".equals(fieldName)) { + Map awsTags = reader.readMap(reader1 -> reader1.getString()); + deserializedAcmCertificateSummaryProperties.awsTags = awsTags; + } else if ("provisioningState".equals(fieldName)) { + deserializedAcmCertificateSummaryProperties.provisioningState + = ProvisioningState.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedAcmCertificateSummaryProperties; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/AcmCertificateSummaryTagsUpdate.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/AcmCertificateSummaryTagsUpdate.java new file mode 100644 index 000000000000..ea6c88262d80 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/AcmCertificateSummaryTagsUpdate.java @@ -0,0 +1,96 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.Map; + +/** + * The type used for updating tags in AcmCertificateSummary resources. + */ +@Fluent +public final class AcmCertificateSummaryTagsUpdate implements JsonSerializable { + /* + * Resource tags. + */ + private Map tags; + + /** + * Creates an instance of AcmCertificateSummaryTagsUpdate class. + */ + public AcmCertificateSummaryTagsUpdate() { + } + + /** + * Get the tags property: Resource tags. + * + * @return the tags value. + */ + public Map tags() { + return this.tags; + } + + /** + * Set the tags property: Resource tags. + * + * @param tags the tags value to set. + * @return the AcmCertificateSummaryTagsUpdate object itself. + */ + public AcmCertificateSummaryTagsUpdate withTags(Map tags) { + this.tags = tags; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeMapField("tags", this.tags, (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AcmCertificateSummaryTagsUpdate from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AcmCertificateSummaryTagsUpdate if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the AcmCertificateSummaryTagsUpdate. + */ + public static AcmCertificateSummaryTagsUpdate fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AcmCertificateSummaryTagsUpdate deserializedAcmCertificateSummaryTagsUpdate + = new AcmCertificateSummaryTagsUpdate(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedAcmCertificateSummaryTagsUpdate.tags = tags; + } else { + reader.skipChildren(); + } + } + + return deserializedAcmCertificateSummaryTagsUpdate; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/Action.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/Action.java new file mode 100644 index 000000000000..864a9cab1d1d --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/Action.java @@ -0,0 +1,71 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Action enum. + */ +public final class Action extends ExpandableStringEnum { + /** + * Static value ALLOW for Action. + */ + public static final Action ALLOW = fromString("ALLOW"); + + /** + * Static value BLOCK for Action. + */ + public static final Action BLOCK = fromString("BLOCK"); + + /** + * Static value CAPTCHA for Action. + */ + public static final Action CAPTCHA = fromString("CAPTCHA"); + + /** + * Static value CHALLENGE for Action. + */ + public static final Action CHALLENGE = fromString("CHALLENGE"); + + /** + * Static value COUNT for Action. + */ + public static final Action COUNT = fromString("COUNT"); + + /** + * Static value EXCLUDED_AS_COUNT for Action. + */ + public static final Action EXCLUDED_AS_COUNT = fromString("EXCLUDED_AS_COUNT"); + + /** + * Creates a new instance of Action value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public Action() { + } + + /** + * Creates or finds a Action from its string representation. + * + * @param name a name to look for. + * @return the corresponding Action. + */ + public static Action fromString(String name) { + return fromString(name, Action.class); + } + + /** + * Gets known Action values. + * + * @return known Action values. + */ + public static Collection values() { + return values(Action.class); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ActionAutoGenerated.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ActionAutoGenerated.java new file mode 100644 index 000000000000..71758bfbe18b --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ActionAutoGenerated.java @@ -0,0 +1,369 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of Action. + */ +@Fluent +public final class ActionAutoGenerated implements JsonSerializable { + /* + * [HTTPS listeners] Information for using Amazon Cognito to authenticate users. Specify only when ``Type`` is + * ``authenticate-cognito``. Specifies information required when integrating with Amazon Cognito to authenticate + * users. + */ + private AuthenticateCognitoConfig authenticateCognitoConfig; + + /* + * [HTTPS listeners] Information about an identity provider that is compliant with OpenID Connect (OIDC). Specify + * only when ``Type`` is ``authenticate-oidc``. Specifies information required using an identity provide (IdP) that + * is compliant with OpenID Connect (OIDC) to authenticate users. + */ + private AuthenticateOidcConfig authenticateOidcConfig; + + /* + * [Application Load Balancer] Information for creating an action that returns a custom HTTP response. Specify only + * when ``Type`` is ``fixed-response``. Specifies information required when returning a custom HTTP response. + */ + private FixedResponseConfig fixedResponseConfig; + + /* + * Information for creating an action that distributes requests among one or more target groups. For Network Load + * Balancers, you can specify a single target group. Specify only when ``Type`` is ``forward``. If you specify both + * ``ForwardConfig`` and ``TargetGroupArn``, you can specify only one target group using ``ForwardConfig`` and it + * must be the same target group specified in ``TargetGroupArn``. Information for creating an action that + * distributes requests among one or more target groups. For Network Load Balancers, you can specify a single target + * group. Specify only when ``Type`` is ``forward``. If you specify both ``ForwardConfig`` and ``TargetGroupArn``, + * you can specify only one target group using ``ForwardConfig`` and it must be the same target group specified in + * ``TargetGroupArn``. + */ + private ForwardConfig forwardConfig; + + /* + * The order for the action. This value is required for rules with multiple actions. The action with the lowest + * value for order is performed first. + */ + private Integer order; + + /* + * [Application Load Balancer] Information for creating a redirect action. Specify only when ``Type`` is + * ``redirect``. Information about a redirect action. A URI consists of the following components: + * protocol://hostname:port/path?query. You must modify at least one of the following components to avoid a redirect + * loop: protocol, hostname, port, or path. Any components that you do not modify retain their original values. You + * can reuse URI components using the following reserved keywords: + #{protocol} + #{host} + #{port} + #{path} (the + * leading '/' is removed) + #{query} For example, you can change the path to '/new/#{path}', the hostname to + * 'example.#{host}', or the query to '#{query}&value=xyz'. + */ + private RedirectConfig redirectConfig; + + /* + * The Amazon Resource Name (ARN) of the target group. Specify only when ``Type`` is ``forward`` and you want to + * route to a single target group. To route to one or more target groups, use ``ForwardConfig`` instead. + */ + private String targetGroupArn; + + /* + * The type of action. + */ + private String type; + + /** + * Creates an instance of ActionAutoGenerated class. + */ + public ActionAutoGenerated() { + } + + /** + * Get the authenticateCognitoConfig property: [HTTPS listeners] Information for using Amazon Cognito to + * authenticate users. Specify only when ``Type`` is ``authenticate-cognito``. Specifies information required when + * integrating with Amazon Cognito to authenticate users. + * + * @return the authenticateCognitoConfig value. + */ + public AuthenticateCognitoConfig authenticateCognitoConfig() { + return this.authenticateCognitoConfig; + } + + /** + * Set the authenticateCognitoConfig property: [HTTPS listeners] Information for using Amazon Cognito to + * authenticate users. Specify only when ``Type`` is ``authenticate-cognito``. Specifies information required when + * integrating with Amazon Cognito to authenticate users. + * + * @param authenticateCognitoConfig the authenticateCognitoConfig value to set. + * @return the ActionAutoGenerated object itself. + */ + public ActionAutoGenerated withAuthenticateCognitoConfig(AuthenticateCognitoConfig authenticateCognitoConfig) { + this.authenticateCognitoConfig = authenticateCognitoConfig; + return this; + } + + /** + * Get the authenticateOidcConfig property: [HTTPS listeners] Information about an identity provider that is + * compliant with OpenID Connect (OIDC). Specify only when ``Type`` is ``authenticate-oidc``. Specifies information + * required using an identity provide (IdP) that is compliant with OpenID Connect (OIDC) to authenticate users. + * + * @return the authenticateOidcConfig value. + */ + public AuthenticateOidcConfig authenticateOidcConfig() { + return this.authenticateOidcConfig; + } + + /** + * Set the authenticateOidcConfig property: [HTTPS listeners] Information about an identity provider that is + * compliant with OpenID Connect (OIDC). Specify only when ``Type`` is ``authenticate-oidc``. Specifies information + * required using an identity provide (IdP) that is compliant with OpenID Connect (OIDC) to authenticate users. + * + * @param authenticateOidcConfig the authenticateOidcConfig value to set. + * @return the ActionAutoGenerated object itself. + */ + public ActionAutoGenerated withAuthenticateOidcConfig(AuthenticateOidcConfig authenticateOidcConfig) { + this.authenticateOidcConfig = authenticateOidcConfig; + return this; + } + + /** + * Get the fixedResponseConfig property: [Application Load Balancer] Information for creating an action that returns + * a custom HTTP response. Specify only when ``Type`` is ``fixed-response``. Specifies information required when + * returning a custom HTTP response. + * + * @return the fixedResponseConfig value. + */ + public FixedResponseConfig fixedResponseConfig() { + return this.fixedResponseConfig; + } + + /** + * Set the fixedResponseConfig property: [Application Load Balancer] Information for creating an action that returns + * a custom HTTP response. Specify only when ``Type`` is ``fixed-response``. Specifies information required when + * returning a custom HTTP response. + * + * @param fixedResponseConfig the fixedResponseConfig value to set. + * @return the ActionAutoGenerated object itself. + */ + public ActionAutoGenerated withFixedResponseConfig(FixedResponseConfig fixedResponseConfig) { + this.fixedResponseConfig = fixedResponseConfig; + return this; + } + + /** + * Get the forwardConfig property: Information for creating an action that distributes requests among one or more + * target groups. For Network Load Balancers, you can specify a single target group. Specify only when ``Type`` is + * ``forward``. If you specify both ``ForwardConfig`` and ``TargetGroupArn``, you can specify only one target group + * using ``ForwardConfig`` and it must be the same target group specified in ``TargetGroupArn``. Information for + * creating an action that distributes requests among one or more target groups. For Network Load Balancers, you can + * specify a single target group. Specify only when ``Type`` is ``forward``. If you specify both ``ForwardConfig`` + * and ``TargetGroupArn``, you can specify only one target group using ``ForwardConfig`` and it must be the same + * target group specified in ``TargetGroupArn``. + * + * @return the forwardConfig value. + */ + public ForwardConfig forwardConfig() { + return this.forwardConfig; + } + + /** + * Set the forwardConfig property: Information for creating an action that distributes requests among one or more + * target groups. For Network Load Balancers, you can specify a single target group. Specify only when ``Type`` is + * ``forward``. If you specify both ``ForwardConfig`` and ``TargetGroupArn``, you can specify only one target group + * using ``ForwardConfig`` and it must be the same target group specified in ``TargetGroupArn``. Information for + * creating an action that distributes requests among one or more target groups. For Network Load Balancers, you can + * specify a single target group. Specify only when ``Type`` is ``forward``. If you specify both ``ForwardConfig`` + * and ``TargetGroupArn``, you can specify only one target group using ``ForwardConfig`` and it must be the same + * target group specified in ``TargetGroupArn``. + * + * @param forwardConfig the forwardConfig value to set. + * @return the ActionAutoGenerated object itself. + */ + public ActionAutoGenerated withForwardConfig(ForwardConfig forwardConfig) { + this.forwardConfig = forwardConfig; + return this; + } + + /** + * Get the order property: The order for the action. This value is required for rules with multiple actions. The + * action with the lowest value for order is performed first. + * + * @return the order value. + */ + public Integer order() { + return this.order; + } + + /** + * Set the order property: The order for the action. This value is required for rules with multiple actions. The + * action with the lowest value for order is performed first. + * + * @param order the order value to set. + * @return the ActionAutoGenerated object itself. + */ + public ActionAutoGenerated withOrder(Integer order) { + this.order = order; + return this; + } + + /** + * Get the redirectConfig property: [Application Load Balancer] Information for creating a redirect action. Specify + * only when ``Type`` is ``redirect``. Information about a redirect action. A URI consists of the following + * components: protocol://hostname:port/path?query. You must modify at least one of the following components to + * avoid a redirect loop: protocol, hostname, port, or path. Any components that you do not modify retain their + * original values. You can reuse URI components using the following reserved keywords: + #{protocol} + #{host} + + * #{port} + #{path} (the leading '/' is removed) + #{query} For example, you can change the path to '/new/#{path}', + * the hostname to 'example.#{host}', or the query to '#{query}&value=xyz'. + * + * @return the redirectConfig value. + */ + public RedirectConfig redirectConfig() { + return this.redirectConfig; + } + + /** + * Set the redirectConfig property: [Application Load Balancer] Information for creating a redirect action. Specify + * only when ``Type`` is ``redirect``. Information about a redirect action. A URI consists of the following + * components: protocol://hostname:port/path?query. You must modify at least one of the following components to + * avoid a redirect loop: protocol, hostname, port, or path. Any components that you do not modify retain their + * original values. You can reuse URI components using the following reserved keywords: + #{protocol} + #{host} + + * #{port} + #{path} (the leading '/' is removed) + #{query} For example, you can change the path to '/new/#{path}', + * the hostname to 'example.#{host}', or the query to '#{query}&value=xyz'. + * + * @param redirectConfig the redirectConfig value to set. + * @return the ActionAutoGenerated object itself. + */ + public ActionAutoGenerated withRedirectConfig(RedirectConfig redirectConfig) { + this.redirectConfig = redirectConfig; + return this; + } + + /** + * Get the targetGroupArn property: The Amazon Resource Name (ARN) of the target group. Specify only when ``Type`` + * is ``forward`` and you want to route to a single target group. To route to one or more target groups, use + * ``ForwardConfig`` instead. + * + * @return the targetGroupArn value. + */ + public String targetGroupArn() { + return this.targetGroupArn; + } + + /** + * Set the targetGroupArn property: The Amazon Resource Name (ARN) of the target group. Specify only when ``Type`` + * is ``forward`` and you want to route to a single target group. To route to one or more target groups, use + * ``ForwardConfig`` instead. + * + * @param targetGroupArn the targetGroupArn value to set. + * @return the ActionAutoGenerated object itself. + */ + public ActionAutoGenerated withTargetGroupArn(String targetGroupArn) { + this.targetGroupArn = targetGroupArn; + return this; + } + + /** + * Get the type property: The type of action. + * + * @return the type value. + */ + public String type() { + return this.type; + } + + /** + * Set the type property: The type of action. + * + * @param type the type value to set. + * @return the ActionAutoGenerated object itself. + */ + public ActionAutoGenerated withType(String type) { + this.type = type; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (authenticateCognitoConfig() != null) { + authenticateCognitoConfig().validate(); + } + if (authenticateOidcConfig() != null) { + authenticateOidcConfig().validate(); + } + if (fixedResponseConfig() != null) { + fixedResponseConfig().validate(); + } + if (forwardConfig() != null) { + forwardConfig().validate(); + } + if (redirectConfig() != null) { + redirectConfig().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("authenticateCognitoConfig", this.authenticateCognitoConfig); + jsonWriter.writeJsonField("authenticateOidcConfig", this.authenticateOidcConfig); + jsonWriter.writeJsonField("fixedResponseConfig", this.fixedResponseConfig); + jsonWriter.writeJsonField("forwardConfig", this.forwardConfig); + jsonWriter.writeNumberField("order", this.order); + jsonWriter.writeJsonField("redirectConfig", this.redirectConfig); + jsonWriter.writeStringField("targetGroupArn", this.targetGroupArn); + jsonWriter.writeStringField("type", this.type); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ActionAutoGenerated from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ActionAutoGenerated if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the ActionAutoGenerated. + */ + public static ActionAutoGenerated fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ActionAutoGenerated deserializedActionAutoGenerated = new ActionAutoGenerated(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("authenticateCognitoConfig".equals(fieldName)) { + deserializedActionAutoGenerated.authenticateCognitoConfig + = AuthenticateCognitoConfig.fromJson(reader); + } else if ("authenticateOidcConfig".equals(fieldName)) { + deserializedActionAutoGenerated.authenticateOidcConfig = AuthenticateOidcConfig.fromJson(reader); + } else if ("fixedResponseConfig".equals(fieldName)) { + deserializedActionAutoGenerated.fixedResponseConfig = FixedResponseConfig.fromJson(reader); + } else if ("forwardConfig".equals(fieldName)) { + deserializedActionAutoGenerated.forwardConfig = ForwardConfig.fromJson(reader); + } else if ("order".equals(fieldName)) { + deserializedActionAutoGenerated.order = reader.getNullable(JsonReader::getInt); + } else if ("redirectConfig".equals(fieldName)) { + deserializedActionAutoGenerated.redirectConfig = RedirectConfig.fromJson(reader); + } else if ("targetGroupArn".equals(fieldName)) { + deserializedActionAutoGenerated.targetGroupArn = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedActionAutoGenerated.type = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedActionAutoGenerated; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ActionConditionModelProperties.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ActionConditionModelProperties.java new file mode 100644 index 000000000000..78797a462992 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ActionConditionModelProperties.java @@ -0,0 +1,97 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of ActionConditionModelProperties. + */ +@Fluent +public final class ActionConditionModelProperties implements JsonSerializable { + /* + * Logic to apply to the filtering conditions. You can specify that, in order to satisfy the filter, a log must + * match all conditions or must match at least one condition. + */ + private Action action; + + /** + * Creates an instance of ActionConditionModelProperties class. + */ + public ActionConditionModelProperties() { + } + + /** + * Get the action property: Logic to apply to the filtering conditions. You can specify that, in order to satisfy + * the filter, a log must match all conditions or must match at least one condition. + * + * @return the action value. + */ + public Action action() { + return this.action; + } + + /** + * Set the action property: Logic to apply to the filtering conditions. You can specify that, in order to satisfy + * the filter, a log must match all conditions or must match at least one condition. + * + * @param action the action value to set. + * @return the ActionConditionModelProperties object itself. + */ + public ActionConditionModelProperties withAction(Action action) { + this.action = action; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("action", this.action == null ? null : this.action.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ActionConditionModelProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ActionConditionModelProperties if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ActionConditionModelProperties. + */ + public static ActionConditionModelProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ActionConditionModelProperties deserializedActionConditionModelProperties + = new ActionConditionModelProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("action".equals(fieldName)) { + deserializedActionConditionModelProperties.action = Action.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedActionConditionModelProperties; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ActionDefinition.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ActionDefinition.java new file mode 100644 index 000000000000..fc8ebdd7d074 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ActionDefinition.java @@ -0,0 +1,96 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of ActionDefinition. + */ +@Fluent +public final class ActionDefinition implements JsonSerializable { + /* + * Property publishMetricAction + */ + private PublishMetricAction publishMetricAction; + + /** + * Creates an instance of ActionDefinition class. + */ + public ActionDefinition() { + } + + /** + * Get the publishMetricAction property: Property publishMetricAction. + * + * @return the publishMetricAction value. + */ + public PublishMetricAction publishMetricAction() { + return this.publishMetricAction; + } + + /** + * Set the publishMetricAction property: Property publishMetricAction. + * + * @param publishMetricAction the publishMetricAction value to set. + * @return the ActionDefinition object itself. + */ + public ActionDefinition withPublishMetricAction(PublishMetricAction publishMetricAction) { + this.publishMetricAction = publishMetricAction; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (publishMetricAction() != null) { + publishMetricAction().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("publishMetricAction", this.publishMetricAction); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ActionDefinition from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ActionDefinition if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the ActionDefinition. + */ + public static ActionDefinition fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ActionDefinition deserializedActionDefinition = new ActionDefinition(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("publishMetricAction".equals(fieldName)) { + deserializedActionDefinition.publishMetricAction = PublishMetricAction.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedActionDefinition; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ActionDefinitionAutoGenerated.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ActionDefinitionAutoGenerated.java new file mode 100644 index 000000000000..7171e17f21cf --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ActionDefinitionAutoGenerated.java @@ -0,0 +1,98 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of ActionDefinition. + */ +@Fluent +public final class ActionDefinitionAutoGenerated implements JsonSerializable { + /* + * Property publishMetricAction + */ + private PublishMetricActionAutoGenerated publishMetricAction; + + /** + * Creates an instance of ActionDefinitionAutoGenerated class. + */ + public ActionDefinitionAutoGenerated() { + } + + /** + * Get the publishMetricAction property: Property publishMetricAction. + * + * @return the publishMetricAction value. + */ + public PublishMetricActionAutoGenerated publishMetricAction() { + return this.publishMetricAction; + } + + /** + * Set the publishMetricAction property: Property publishMetricAction. + * + * @param publishMetricAction the publishMetricAction value to set. + * @return the ActionDefinitionAutoGenerated object itself. + */ + public ActionDefinitionAutoGenerated withPublishMetricAction(PublishMetricActionAutoGenerated publishMetricAction) { + this.publishMetricAction = publishMetricAction; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (publishMetricAction() != null) { + publishMetricAction().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("publishMetricAction", this.publishMetricAction); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ActionDefinitionAutoGenerated from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ActionDefinitionAutoGenerated if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ActionDefinitionAutoGenerated. + */ + public static ActionDefinitionAutoGenerated fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ActionDefinitionAutoGenerated deserializedActionDefinitionAutoGenerated + = new ActionDefinitionAutoGenerated(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("publishMetricAction".equals(fieldName)) { + deserializedActionDefinitionAutoGenerated.publishMetricAction + = PublishMetricActionAutoGenerated.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedActionDefinitionAutoGenerated; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ActionType.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ActionType.java new file mode 100644 index 000000000000..16c2296d30bb --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ActionType.java @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Enum. Indicates the action type. "Internal" refers to actions that are for internal only APIs. + */ +public final class ActionType extends ExpandableStringEnum { + /** + * Static value Internal for ActionType. + */ + public static final ActionType INTERNAL = fromString("Internal"); + + /** + * Creates a new instance of ActionType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ActionType() { + } + + /** + * Creates or finds a ActionType from its string representation. + * + * @param name a name to look for. + * @return the corresponding ActionType. + */ + public static ActionType fromString(String name) { + return fromString(name, ActionType.class); + } + + /** + * Gets known ActionType values. + * + * @return known ActionType values. + */ + public static Collection values() { + return values(ActionType.class); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ActiveModel.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ActiveModel.java new file mode 100644 index 000000000000..8aaf5d136647 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ActiveModel.java @@ -0,0 +1,96 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of Active. + */ +@Fluent +public final class ActiveModel implements JsonSerializable { + /* + * When true, StackSets performs non-conflicting operations concurrently and queues conflicting operations. After + * conflicting operations finish, StackSets starts queued operations in request order. + */ + private Boolean active; + + /** + * Creates an instance of ActiveModel class. + */ + public ActiveModel() { + } + + /** + * Get the active property: When true, StackSets performs non-conflicting operations concurrently and queues + * conflicting operations. After conflicting operations finish, StackSets starts queued operations in request order. + * + * @return the active value. + */ + public Boolean active() { + return this.active; + } + + /** + * Set the active property: When true, StackSets performs non-conflicting operations concurrently and queues + * conflicting operations. After conflicting operations finish, StackSets starts queued operations in request order. + * + * @param active the active value to set. + * @return the ActiveModel object itself. + */ + public ActiveModel withActive(Boolean active) { + this.active = active; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeBooleanField("active", this.active); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ActiveModel from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ActiveModel if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the ActiveModel. + */ + public static ActiveModel fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ActiveModel deserializedActiveModel = new ActiveModel(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("active".equals(fieldName)) { + deserializedActiveModel.active = reader.getNullable(JsonReader::getBoolean); + } else { + reader.skipChildren(); + } + } + + return deserializedActiveModel; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/AddOn.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/AddOn.java new file mode 100644 index 000000000000..211d6b55c0a1 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/AddOn.java @@ -0,0 +1,154 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of AddOn. + */ +@Fluent +public final class AddOn implements JsonSerializable { + /* + * The add-on type + */ + private String addOnType; + + /* + * An object that represents additional parameters when enabling or modifying the automatic snapshot add-on + */ + private AutoSnapshotAddOn autoSnapshotAddOnRequest; + + /* + * Status of the Addon + */ + private AddOnStatus status; + + /** + * Creates an instance of AddOn class. + */ + public AddOn() { + } + + /** + * Get the addOnType property: The add-on type. + * + * @return the addOnType value. + */ + public String addOnType() { + return this.addOnType; + } + + /** + * Set the addOnType property: The add-on type. + * + * @param addOnType the addOnType value to set. + * @return the AddOn object itself. + */ + public AddOn withAddOnType(String addOnType) { + this.addOnType = addOnType; + return this; + } + + /** + * Get the autoSnapshotAddOnRequest property: An object that represents additional parameters when enabling or + * modifying the automatic snapshot add-on. + * + * @return the autoSnapshotAddOnRequest value. + */ + public AutoSnapshotAddOn autoSnapshotAddOnRequest() { + return this.autoSnapshotAddOnRequest; + } + + /** + * Set the autoSnapshotAddOnRequest property: An object that represents additional parameters when enabling or + * modifying the automatic snapshot add-on. + * + * @param autoSnapshotAddOnRequest the autoSnapshotAddOnRequest value to set. + * @return the AddOn object itself. + */ + public AddOn withAutoSnapshotAddOnRequest(AutoSnapshotAddOn autoSnapshotAddOnRequest) { + this.autoSnapshotAddOnRequest = autoSnapshotAddOnRequest; + return this; + } + + /** + * Get the status property: Status of the Addon. + * + * @return the status value. + */ + public AddOnStatus status() { + return this.status; + } + + /** + * Set the status property: Status of the Addon. + * + * @param status the status value to set. + * @return the AddOn object itself. + */ + public AddOn withStatus(AddOnStatus status) { + this.status = status; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (autoSnapshotAddOnRequest() != null) { + autoSnapshotAddOnRequest().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("addOnType", this.addOnType); + jsonWriter.writeJsonField("autoSnapshotAddOnRequest", this.autoSnapshotAddOnRequest); + jsonWriter.writeStringField("status", this.status == null ? null : this.status.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AddOn from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AddOn if the JsonReader was pointing to an instance of it, or null if it was pointing to + * JSON null. + * @throws IOException If an error occurs while reading the AddOn. + */ + public static AddOn fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AddOn deserializedAddOn = new AddOn(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("addOnType".equals(fieldName)) { + deserializedAddOn.addOnType = reader.getString(); + } else if ("autoSnapshotAddOnRequest".equals(fieldName)) { + deserializedAddOn.autoSnapshotAddOnRequest = AutoSnapshotAddOn.fromJson(reader); + } else if ("status".equals(fieldName)) { + deserializedAddOn.status = AddOnStatus.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedAddOn; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/AddOnStatus.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/AddOnStatus.java new file mode 100644 index 000000000000..20a004744aa2 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/AddOnStatus.java @@ -0,0 +1,76 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * AddOnStatus enum. + */ +public final class AddOnStatus extends ExpandableStringEnum { + /** + * Static value Disabled for AddOnStatus. + */ + public static final AddOnStatus DISABLED = fromString("Disabled"); + + /** + * Static value Disabling for AddOnStatus. + */ + public static final AddOnStatus DISABLING = fromString("Disabling"); + + /** + * Static value Enabled for AddOnStatus. + */ + public static final AddOnStatus ENABLED = fromString("Enabled"); + + /** + * Static value Enabling for AddOnStatus. + */ + public static final AddOnStatus ENABLING = fromString("Enabling"); + + /** + * Static value Failed for AddOnStatus. + */ + public static final AddOnStatus FAILED = fromString("Failed"); + + /** + * Static value Terminated for AddOnStatus. + */ + public static final AddOnStatus TERMINATED = fromString("Terminated"); + + /** + * Static value Terminating for AddOnStatus. + */ + public static final AddOnStatus TERMINATING = fromString("Terminating"); + + /** + * Creates a new instance of AddOnStatus value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public AddOnStatus() { + } + + /** + * Creates or finds a AddOnStatus from its string representation. + * + * @param name a name to look for. + * @return the corresponding AddOnStatus. + */ + public static AddOnStatus fromString(String name) { + return fromString(name, AddOnStatus.class); + } + + /** + * Gets known AddOnStatus values. + * + * @return known AddOnStatus values. + */ + public static Collection values() { + return values(AddOnStatus.class); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/AdditionalAuthenticationProvider.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/AdditionalAuthenticationProvider.java new file mode 100644 index 000000000000..7771c7f19842 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/AdditionalAuthenticationProvider.java @@ -0,0 +1,197 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of AdditionalAuthenticationProvider. + */ +@Fluent +public final class AdditionalAuthenticationProvider implements JsonSerializable { + /* + *

The authentication type: API key, Identity and Access Management (IAM), OpenID Connect (OIDC), Amazon Cognito + * user pools, or Lambda.

+ */ + private AuthenticationTypeEnumValue authenticationType; + + /* + *

Configuration for Lambda function authorization.

+ */ + private LambdaAuthorizerConfig lambdaAuthorizerConfig; + + /* + *

The OIDC configuration.

+ */ + private OpenIdConnectConfig openIdConnectConfig; + + /* + *

The Amazon Cognito user pool configuration.

+ */ + private CognitoUserPoolConfig userPoolConfig; + + /** + * Creates an instance of AdditionalAuthenticationProvider class. + */ + public AdditionalAuthenticationProvider() { + } + + /** + * Get the authenticationType property: <p>The authentication type: API key, Identity and Access Management + * (IAM), OpenID Connect (OIDC), Amazon Cognito user pools, or Lambda.</p>. + * + * @return the authenticationType value. + */ + public AuthenticationTypeEnumValue authenticationType() { + return this.authenticationType; + } + + /** + * Set the authenticationType property: <p>The authentication type: API key, Identity and Access Management + * (IAM), OpenID Connect (OIDC), Amazon Cognito user pools, or Lambda.</p>. + * + * @param authenticationType the authenticationType value to set. + * @return the AdditionalAuthenticationProvider object itself. + */ + public AdditionalAuthenticationProvider withAuthenticationType(AuthenticationTypeEnumValue authenticationType) { + this.authenticationType = authenticationType; + return this; + } + + /** + * Get the lambdaAuthorizerConfig property: <p>Configuration for Lambda function authorization.</p>. + * + * @return the lambdaAuthorizerConfig value. + */ + public LambdaAuthorizerConfig lambdaAuthorizerConfig() { + return this.lambdaAuthorizerConfig; + } + + /** + * Set the lambdaAuthorizerConfig property: <p>Configuration for Lambda function authorization.</p>. + * + * @param lambdaAuthorizerConfig the lambdaAuthorizerConfig value to set. + * @return the AdditionalAuthenticationProvider object itself. + */ + public AdditionalAuthenticationProvider withLambdaAuthorizerConfig(LambdaAuthorizerConfig lambdaAuthorizerConfig) { + this.lambdaAuthorizerConfig = lambdaAuthorizerConfig; + return this; + } + + /** + * Get the openIdConnectConfig property: <p>The OIDC configuration.</p>. + * + * @return the openIdConnectConfig value. + */ + public OpenIdConnectConfig openIdConnectConfig() { + return this.openIdConnectConfig; + } + + /** + * Set the openIdConnectConfig property: <p>The OIDC configuration.</p>. + * + * @param openIdConnectConfig the openIdConnectConfig value to set. + * @return the AdditionalAuthenticationProvider object itself. + */ + public AdditionalAuthenticationProvider withOpenIdConnectConfig(OpenIdConnectConfig openIdConnectConfig) { + this.openIdConnectConfig = openIdConnectConfig; + return this; + } + + /** + * Get the userPoolConfig property: <p>The Amazon Cognito user pool configuration.</p>. + * + * @return the userPoolConfig value. + */ + public CognitoUserPoolConfig userPoolConfig() { + return this.userPoolConfig; + } + + /** + * Set the userPoolConfig property: <p>The Amazon Cognito user pool configuration.</p>. + * + * @param userPoolConfig the userPoolConfig value to set. + * @return the AdditionalAuthenticationProvider object itself. + */ + public AdditionalAuthenticationProvider withUserPoolConfig(CognitoUserPoolConfig userPoolConfig) { + this.userPoolConfig = userPoolConfig; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (authenticationType() != null) { + authenticationType().validate(); + } + if (lambdaAuthorizerConfig() != null) { + lambdaAuthorizerConfig().validate(); + } + if (openIdConnectConfig() != null) { + openIdConnectConfig().validate(); + } + if (userPoolConfig() != null) { + userPoolConfig().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("authenticationType", this.authenticationType); + jsonWriter.writeJsonField("lambdaAuthorizerConfig", this.lambdaAuthorizerConfig); + jsonWriter.writeJsonField("openIDConnectConfig", this.openIdConnectConfig); + jsonWriter.writeJsonField("userPoolConfig", this.userPoolConfig); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AdditionalAuthenticationProvider from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AdditionalAuthenticationProvider if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the AdditionalAuthenticationProvider. + */ + public static AdditionalAuthenticationProvider fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AdditionalAuthenticationProvider deserializedAdditionalAuthenticationProvider + = new AdditionalAuthenticationProvider(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("authenticationType".equals(fieldName)) { + deserializedAdditionalAuthenticationProvider.authenticationType + = AuthenticationTypeEnumValue.fromJson(reader); + } else if ("lambdaAuthorizerConfig".equals(fieldName)) { + deserializedAdditionalAuthenticationProvider.lambdaAuthorizerConfig + = LambdaAuthorizerConfig.fromJson(reader); + } else if ("openIDConnectConfig".equals(fieldName)) { + deserializedAdditionalAuthenticationProvider.openIdConnectConfig + = OpenIdConnectConfig.fromJson(reader); + } else if ("userPoolConfig".equals(fieldName)) { + deserializedAdditionalAuthenticationProvider.userPoolConfig + = CognitoUserPoolConfig.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedAdditionalAuthenticationProvider; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/Address.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/Address.java new file mode 100644 index 000000000000..5f8aa4706923 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/Address.java @@ -0,0 +1,93 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of Address. + */ +@Fluent +public final class Address implements JsonSerializable
{ + /* + * Property addressDefinition + */ + private String addressDefinition; + + /** + * Creates an instance of Address class. + */ + public Address() { + } + + /** + * Get the addressDefinition property: Property addressDefinition. + * + * @return the addressDefinition value. + */ + public String addressDefinition() { + return this.addressDefinition; + } + + /** + * Set the addressDefinition property: Property addressDefinition. + * + * @param addressDefinition the addressDefinition value to set. + * @return the Address object itself. + */ + public Address withAddressDefinition(String addressDefinition) { + this.addressDefinition = addressDefinition; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("addressDefinition", this.addressDefinition); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of Address from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of Address if the JsonReader was pointing to an instance of it, or null if it was pointing to + * JSON null. + * @throws IOException If an error occurs while reading the Address. + */ + public static Address fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + Address deserializedAddress = new Address(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("addressDefinition".equals(fieldName)) { + deserializedAddress.addressDefinition = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedAddress; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/AdvancedEventSelector.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/AdvancedEventSelector.java new file mode 100644 index 000000000000..a57546e4b764 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/AdvancedEventSelector.java @@ -0,0 +1,130 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Definition of AdvancedEventSelector. + */ +@Fluent +public final class AdvancedEventSelector implements JsonSerializable { + /* + * Contains all selector statements in an advanced event selector. + */ + private List fieldSelectors; + + /* + * An optional, descriptive name for an advanced event selector, such as 'Log data events for only two S3 buckets'. + */ + private String name; + + /** + * Creates an instance of AdvancedEventSelector class. + */ + public AdvancedEventSelector() { + } + + /** + * Get the fieldSelectors property: Contains all selector statements in an advanced event selector. + * + * @return the fieldSelectors value. + */ + public List fieldSelectors() { + return this.fieldSelectors; + } + + /** + * Set the fieldSelectors property: Contains all selector statements in an advanced event selector. + * + * @param fieldSelectors the fieldSelectors value to set. + * @return the AdvancedEventSelector object itself. + */ + public AdvancedEventSelector withFieldSelectors(List fieldSelectors) { + this.fieldSelectors = fieldSelectors; + return this; + } + + /** + * Get the name property: An optional, descriptive name for an advanced event selector, such as 'Log data events for + * only two S3 buckets'. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: An optional, descriptive name for an advanced event selector, such as 'Log data events for + * only two S3 buckets'. + * + * @param name the name value to set. + * @return the AdvancedEventSelector object itself. + */ + public AdvancedEventSelector withName(String name) { + this.name = name; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (fieldSelectors() != null) { + fieldSelectors().forEach(e -> e.validate()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("fieldSelectors", this.fieldSelectors, + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("name", this.name); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AdvancedEventSelector from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AdvancedEventSelector if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the AdvancedEventSelector. + */ + public static AdvancedEventSelector fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AdvancedEventSelector deserializedAdvancedEventSelector = new AdvancedEventSelector(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("fieldSelectors".equals(fieldName)) { + List fieldSelectors + = reader.readArray(reader1 -> AdvancedFieldSelector.fromJson(reader1)); + deserializedAdvancedEventSelector.fieldSelectors = fieldSelectors; + } else if ("name".equals(fieldName)) { + deserializedAdvancedEventSelector.name = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedAdvancedEventSelector; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/AdvancedFieldSelector.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/AdvancedFieldSelector.java new file mode 100644 index 000000000000..e383571cf91a --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/AdvancedFieldSelector.java @@ -0,0 +1,295 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Definition of AdvancedFieldSelector. + */ +@Fluent +public final class AdvancedFieldSelector implements JsonSerializable { + /* + * An operator that includes events that match the last few characters of the event record field specified as the + * value of Field. + */ + private List endsWith; + + /* + * An operator that includes events that match the exact value of the event record field specified as the value of + * Field. This is the only valid operator that you can use with the readOnly, eventCategory, and resources.type + * fields. + */ + private List equals; + + /* + * A field in an event record on which to filter events to be logged. Supported fields include readOnly, + * eventCategory, eventSource (for management events), eventName, resources.type, and resources.ARN. + */ + private String field; + + /* + * An operator that excludes events that match the last few characters of the event record field specified as the + * value of Field. + */ + private List notEndsWith; + + /* + * An operator that excludes events that match the exact value of the event record field specified as the value of + * Field. + */ + private List notEquals; + + /* + * An operator that excludes events that match the first few characters of the event record field specified as the + * value of Field. + */ + private List notStartsWith; + + /* + * An operator that includes events that match the first few characters of the event record field specified as the + * value of Field. + */ + private List startsWith; + + /** + * Creates an instance of AdvancedFieldSelector class. + */ + public AdvancedFieldSelector() { + } + + /** + * Get the endsWith property: An operator that includes events that match the last few characters of the event + * record field specified as the value of Field. + * + * @return the endsWith value. + */ + public List endsWith() { + return this.endsWith; + } + + /** + * Set the endsWith property: An operator that includes events that match the last few characters of the event + * record field specified as the value of Field. + * + * @param endsWith the endsWith value to set. + * @return the AdvancedFieldSelector object itself. + */ + public AdvancedFieldSelector withEndsWith(List endsWith) { + this.endsWith = endsWith; + return this; + } + + /** + * Get the equals property: An operator that includes events that match the exact value of the event record field + * specified as the value of Field. This is the only valid operator that you can use with the readOnly, + * eventCategory, and resources.type fields. + * + * @return the equals value. + */ + public List equals() { + return this.equals; + } + + /** + * Set the equals property: An operator that includes events that match the exact value of the event record field + * specified as the value of Field. This is the only valid operator that you can use with the readOnly, + * eventCategory, and resources.type fields. + * + * @param equals the equals value to set. + * @return the AdvancedFieldSelector object itself. + */ + public AdvancedFieldSelector withEquals(List equals) { + this.equals = equals; + return this; + } + + /** + * Get the field property: A field in an event record on which to filter events to be logged. Supported fields + * include readOnly, eventCategory, eventSource (for management events), eventName, resources.type, and + * resources.ARN. + * + * @return the field value. + */ + public String field() { + return this.field; + } + + /** + * Set the field property: A field in an event record on which to filter events to be logged. Supported fields + * include readOnly, eventCategory, eventSource (for management events), eventName, resources.type, and + * resources.ARN. + * + * @param field the field value to set. + * @return the AdvancedFieldSelector object itself. + */ + public AdvancedFieldSelector withField(String field) { + this.field = field; + return this; + } + + /** + * Get the notEndsWith property: An operator that excludes events that match the last few characters of the event + * record field specified as the value of Field. + * + * @return the notEndsWith value. + */ + public List notEndsWith() { + return this.notEndsWith; + } + + /** + * Set the notEndsWith property: An operator that excludes events that match the last few characters of the event + * record field specified as the value of Field. + * + * @param notEndsWith the notEndsWith value to set. + * @return the AdvancedFieldSelector object itself. + */ + public AdvancedFieldSelector withNotEndsWith(List notEndsWith) { + this.notEndsWith = notEndsWith; + return this; + } + + /** + * Get the notEquals property: An operator that excludes events that match the exact value of the event record field + * specified as the value of Field. + * + * @return the notEquals value. + */ + public List notEquals() { + return this.notEquals; + } + + /** + * Set the notEquals property: An operator that excludes events that match the exact value of the event record field + * specified as the value of Field. + * + * @param notEquals the notEquals value to set. + * @return the AdvancedFieldSelector object itself. + */ + public AdvancedFieldSelector withNotEquals(List notEquals) { + this.notEquals = notEquals; + return this; + } + + /** + * Get the notStartsWith property: An operator that excludes events that match the first few characters of the event + * record field specified as the value of Field. + * + * @return the notStartsWith value. + */ + public List notStartsWith() { + return this.notStartsWith; + } + + /** + * Set the notStartsWith property: An operator that excludes events that match the first few characters of the event + * record field specified as the value of Field. + * + * @param notStartsWith the notStartsWith value to set. + * @return the AdvancedFieldSelector object itself. + */ + public AdvancedFieldSelector withNotStartsWith(List notStartsWith) { + this.notStartsWith = notStartsWith; + return this; + } + + /** + * Get the startsWith property: An operator that includes events that match the first few characters of the event + * record field specified as the value of Field. + * + * @return the startsWith value. + */ + public List startsWith() { + return this.startsWith; + } + + /** + * Set the startsWith property: An operator that includes events that match the first few characters of the event + * record field specified as the value of Field. + * + * @param startsWith the startsWith value to set. + * @return the AdvancedFieldSelector object itself. + */ + public AdvancedFieldSelector withStartsWith(List startsWith) { + this.startsWith = startsWith; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("endsWith", this.endsWith, (writer, element) -> writer.writeString(element)); + jsonWriter.writeArrayField("equals", this.equals, (writer, element) -> writer.writeString(element)); + jsonWriter.writeStringField("field", this.field); + jsonWriter.writeArrayField("notEndsWith", this.notEndsWith, (writer, element) -> writer.writeString(element)); + jsonWriter.writeArrayField("notEquals", this.notEquals, (writer, element) -> writer.writeString(element)); + jsonWriter.writeArrayField("notStartsWith", this.notStartsWith, + (writer, element) -> writer.writeString(element)); + jsonWriter.writeArrayField("startsWith", this.startsWith, (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AdvancedFieldSelector from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AdvancedFieldSelector if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the AdvancedFieldSelector. + */ + public static AdvancedFieldSelector fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AdvancedFieldSelector deserializedAdvancedFieldSelector = new AdvancedFieldSelector(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("endsWith".equals(fieldName)) { + List endsWith = reader.readArray(reader1 -> reader1.getString()); + deserializedAdvancedFieldSelector.endsWith = endsWith; + } else if ("equals".equals(fieldName)) { + List equals = reader.readArray(reader1 -> reader1.getString()); + deserializedAdvancedFieldSelector.equals = equals; + } else if ("field".equals(fieldName)) { + deserializedAdvancedFieldSelector.field = reader.getString(); + } else if ("notEndsWith".equals(fieldName)) { + List notEndsWith = reader.readArray(reader1 -> reader1.getString()); + deserializedAdvancedFieldSelector.notEndsWith = notEndsWith; + } else if ("notEquals".equals(fieldName)) { + List notEquals = reader.readArray(reader1 -> reader1.getString()); + deserializedAdvancedFieldSelector.notEquals = notEquals; + } else if ("notStartsWith".equals(fieldName)) { + List notStartsWith = reader.readArray(reader1 -> reader1.getString()); + deserializedAdvancedFieldSelector.notStartsWith = notStartsWith; + } else if ("startsWith".equals(fieldName)) { + List startsWith = reader.readArray(reader1 -> reader1.getString()); + deserializedAdvancedFieldSelector.startsWith = startsWith; + } else { + reader.skipChildren(); + } + } + + return deserializedAdvancedFieldSelector; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/AdvancedSecurityOptions.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/AdvancedSecurityOptions.java new file mode 100644 index 000000000000..f6f5722d238a --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/AdvancedSecurityOptions.java @@ -0,0 +1,236 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.time.OffsetDateTime; +import java.time.format.DateTimeFormatter; + +/** + * Definition of AdvancedSecurityOptions. + */ +@Fluent +public final class AdvancedSecurityOptions implements JsonSerializable { + /* + *

Date and time when the migration period will be disabled. Only necessary when + * enabling fine-grained access control on an existing domain.

+ */ + private OffsetDateTime anonymousAuthDisableDate; + + /* + *

True if a 30-day migration period is enabled, during which administrators can create role mappings. Only + * necessary when + * enabling fine-grained access control on an existing domain.

+ */ + private Boolean anonymousAuthEnabled; + + /* + *

True if fine-grained access control is enabled.

+ */ + private Boolean enabled; + + /* + *

True if the internal user database is enabled.

+ */ + private Boolean internalUserDatabaseEnabled; + + /* + *

Container for information about the SAML configuration for OpenSearch Dashboards.

+ */ + private SamlOptionsOutput samlOptions; + + /** + * Creates an instance of AdvancedSecurityOptions class. + */ + public AdvancedSecurityOptions() { + } + + /** + * Get the anonymousAuthDisableDate property: <p>Date and time when the migration period will be disabled. + * Only necessary when <a + * href='https://docs.aws.amazon.com/opensearch-service/latest/developerguide/fgac.html#fgac-enabling-existing'>enabling + * fine-grained access control on an existing domain</a>.</p>. + * + * @return the anonymousAuthDisableDate value. + */ + public OffsetDateTime anonymousAuthDisableDate() { + return this.anonymousAuthDisableDate; + } + + /** + * Set the anonymousAuthDisableDate property: <p>Date and time when the migration period will be disabled. + * Only necessary when <a + * href='https://docs.aws.amazon.com/opensearch-service/latest/developerguide/fgac.html#fgac-enabling-existing'>enabling + * fine-grained access control on an existing domain</a>.</p>. + * + * @param anonymousAuthDisableDate the anonymousAuthDisableDate value to set. + * @return the AdvancedSecurityOptions object itself. + */ + public AdvancedSecurityOptions withAnonymousAuthDisableDate(OffsetDateTime anonymousAuthDisableDate) { + this.anonymousAuthDisableDate = anonymousAuthDisableDate; + return this; + } + + /** + * Get the anonymousAuthEnabled property: <p>True if a 30-day migration period is enabled, during which + * administrators can create role mappings. Only necessary when <a + * href='https://docs.aws.amazon.com/opensearch-service/latest/developerguide/fgac.html#fgac-enabling-existing'>enabling + * fine-grained access control on an existing domain</a>.</p>. + * + * @return the anonymousAuthEnabled value. + */ + public Boolean anonymousAuthEnabled() { + return this.anonymousAuthEnabled; + } + + /** + * Set the anonymousAuthEnabled property: <p>True if a 30-day migration period is enabled, during which + * administrators can create role mappings. Only necessary when <a + * href='https://docs.aws.amazon.com/opensearch-service/latest/developerguide/fgac.html#fgac-enabling-existing'>enabling + * fine-grained access control on an existing domain</a>.</p>. + * + * @param anonymousAuthEnabled the anonymousAuthEnabled value to set. + * @return the AdvancedSecurityOptions object itself. + */ + public AdvancedSecurityOptions withAnonymousAuthEnabled(Boolean anonymousAuthEnabled) { + this.anonymousAuthEnabled = anonymousAuthEnabled; + return this; + } + + /** + * Get the enabled property: <p>True if fine-grained access control is enabled.</p>. + * + * @return the enabled value. + */ + public Boolean enabled() { + return this.enabled; + } + + /** + * Set the enabled property: <p>True if fine-grained access control is enabled.</p>. + * + * @param enabled the enabled value to set. + * @return the AdvancedSecurityOptions object itself. + */ + public AdvancedSecurityOptions withEnabled(Boolean enabled) { + this.enabled = enabled; + return this; + } + + /** + * Get the internalUserDatabaseEnabled property: <p>True if the internal user database is enabled.</p>. + * + * @return the internalUserDatabaseEnabled value. + */ + public Boolean internalUserDatabaseEnabled() { + return this.internalUserDatabaseEnabled; + } + + /** + * Set the internalUserDatabaseEnabled property: <p>True if the internal user database is enabled.</p>. + * + * @param internalUserDatabaseEnabled the internalUserDatabaseEnabled value to set. + * @return the AdvancedSecurityOptions object itself. + */ + public AdvancedSecurityOptions withInternalUserDatabaseEnabled(Boolean internalUserDatabaseEnabled) { + this.internalUserDatabaseEnabled = internalUserDatabaseEnabled; + return this; + } + + /** + * Get the samlOptions property: <p>Container for information about the SAML configuration for OpenSearch + * Dashboards.</p>. + * + * @return the samlOptions value. + */ + public SamlOptionsOutput samlOptions() { + return this.samlOptions; + } + + /** + * Set the samlOptions property: <p>Container for information about the SAML configuration for OpenSearch + * Dashboards.</p>. + * + * @param samlOptions the samlOptions value to set. + * @return the AdvancedSecurityOptions object itself. + */ + public AdvancedSecurityOptions withSamlOptions(SamlOptionsOutput samlOptions) { + this.samlOptions = samlOptions; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (samlOptions() != null) { + samlOptions().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("anonymousAuthDisableDate", + this.anonymousAuthDisableDate == null + ? null + : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.anonymousAuthDisableDate)); + jsonWriter.writeBooleanField("anonymousAuthEnabled", this.anonymousAuthEnabled); + jsonWriter.writeBooleanField("enabled", this.enabled); + jsonWriter.writeBooleanField("internalUserDatabaseEnabled", this.internalUserDatabaseEnabled); + jsonWriter.writeJsonField("samlOptions", this.samlOptions); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AdvancedSecurityOptions from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AdvancedSecurityOptions if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the AdvancedSecurityOptions. + */ + public static AdvancedSecurityOptions fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AdvancedSecurityOptions deserializedAdvancedSecurityOptions = new AdvancedSecurityOptions(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("anonymousAuthDisableDate".equals(fieldName)) { + deserializedAdvancedSecurityOptions.anonymousAuthDisableDate = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("anonymousAuthEnabled".equals(fieldName)) { + deserializedAdvancedSecurityOptions.anonymousAuthEnabled + = reader.getNullable(JsonReader::getBoolean); + } else if ("enabled".equals(fieldName)) { + deserializedAdvancedSecurityOptions.enabled = reader.getNullable(JsonReader::getBoolean); + } else if ("internalUserDatabaseEnabled".equals(fieldName)) { + deserializedAdvancedSecurityOptions.internalUserDatabaseEnabled + = reader.getNullable(JsonReader::getBoolean); + } else if ("samlOptions".equals(fieldName)) { + deserializedAdvancedSecurityOptions.samlOptions = SamlOptionsOutput.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedAdvancedSecurityOptions; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/AliasTarget.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/AliasTarget.java new file mode 100644 index 000000000000..79c74255d7c9 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/AliasTarget.java @@ -0,0 +1,687 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of AliasTarget. + */ +@Fluent +public final class AliasTarget implements JsonSerializable { + /* + *

Alias resource record sets only: The value that you specify depends on where you want to route + * queries:

Amazon API Gateway custom regional APIs and edge-optimized APIs

Specify the + * applicable domain name for your API. You can get the applicable value using the CLI command get-domain-names:

  • For regional APIs, specify the value of regionalDomainName.

  • For + * edge-optimized APIs, specify the value of distributionDomainName. This is the name of the associated + * CloudFront distribution, such as da1b2c3d4e5.cloudfront.net.

The name of + * the record that you're creating must match a custom domain name for your API, such as + * api.example.com.

Amazon Virtual Private Cloud interface VPC endpoint
+ *

Enter the API endpoint for the interface endpoint, such as + * vpce-123456789abcdef01-example-us-east-1a.elasticloadbalancing.us-east-1.vpce.amazonaws.com. For + * edge-optimized APIs, this is the domain name for the corresponding CloudFront distribution. You can get the value + * of DnsName using the CLI command describe-vpc-endpoints.

CloudFront distribution

Specify the domain name that CloudFront assigned when you + * created your distribution.

Your CloudFront distribution must include an alternate domain name that matches + * the name of the resource record set. For example, if the name of the resource record set is + * acme.example.com, your CloudFront distribution must include acme.example.com as one of the + * alternate domain names. For more information, see Using Alternate Domain + * Names (CNAMEs) in the Amazon CloudFront Developer Guide.

You can't create a resource record set + * in a private hosted zone to route traffic to a CloudFront distribution.

For failover alias records, + * you can't specify a CloudFront distribution for both the primary and secondary records. A distribution must + * include an alternate domain name that matches the name of the record. However, the primary and secondary records + * have the same name, and you can't include the same alternate domain name in more than one distribution.

+ *
Elastic Beanstalk environment

If the domain name for your Elastic Beanstalk + * environment includes the region that you deployed the environment in, you can create an alias record that routes + * traffic to the environment. For example, the domain name + * my-environment.us-west-2.elasticbeanstalk.com is a regionalized domain name.

+ *

For environments that were created before early 2016, the domain name doesn't include the region. To route + * traffic to these environments, you must create a CNAME record instead of an alias record. Note that you can't + * create a CNAME record for the root domain name. For example, if your domain name is example.com, you can create a + * record that routes traffic for acme.example.com to your Elastic Beanstalk environment, but you can't create a + * record that routes traffic for example.com to your Elastic Beanstalk environment.

For Elastic + * Beanstalk environments that have regionalized subdomains, specify the CNAME attribute for the + * environment. You can use the following methods to get the value of the CNAME attribute:

  • + * Amazon Web Services Management Console: For information about how to get the value by using the console, + * see Using Custom Domains with + * Elastic Beanstalk in the Elastic Beanstalk Developer Guide.

  • Elastic Beanstalk + * API: Use the DescribeEnvironments action to get the value of the CNAME attribute. + * For more information, see DescribeEnvironments + * in the Elastic Beanstalk API Reference.

  • CLI: Use the + * describe-environments command to get the value of the CNAME attribute. For more + * information, see describe- + * environments in the CLI Command Reference.

ELB load balancer
+ *

Specify the DNS name that is associated with the load balancer. Get the DNS name by using the Amazon Web + * Services Management Console, the ELB API, or the CLI.

  • Amazon Web Services Management + * Console: Go to the EC2 page, choose Load Balancers in the navigation pane, choose the load balancer, + * choose the Description tab, and get the value of the DNS name field.

    If you're routing + * traffic to a Classic Load Balancer, get the value that begins with dualstack. If you're routing traffic to + * another type of load balancer, get the value that applies to the record type, A or AAAA.

  • + * Elastic Load Balancing API: Use DescribeLoadBalancers to get the value of + * DNSName. For more information, see the applicable guide:

  • CLI: Use describe-load-balancers to + * get the value of DNSName. For more information, see the applicable guide:

Global Accelerator accelerator

Specify the DNS name for + * your accelerator:

Amazon S3 bucket that is configured as a static website
+ *

Specify the domain name of the Amazon S3 website endpoint that you created the bucket in, for example, + * s3-website.us-east-2.amazonaws.com. For more information about valid values, see the table Amazon S3 Website + * Endpoints in the Amazon Web Services General Reference. For more information about using S3 buckets + * for websites, see Getting Started with Amazon + * Route 53 in the Amazon Route 53 Developer Guide.

Another Route 53 resource record + * set

Specify the value of the Name element for a resource record set in the current + * hosted zone.

If you're creating an alias record that has the same name as the hosted zone (known as + * the zone apex), you can't specify the domain name for a record for which the value of Type is + * CNAME. This is because the alias record must have the same type as the record that you're routing + * traffic to, and creating a CNAME record for the zone apex isn't supported even for an alias record.

+ *
+ */ + private String dnsName; + + /* + *

Applies only to alias, failover alias, geolocation alias, latency alias, and weighted alias resource + * record sets: When EvaluateTargetHealth is true, an alias resource record set + * inherits the health of the referenced Amazon Web Services resource, such as an ELB load balancer or another + * resource record set in the hosted zone.

Note the following:

CloudFront distributions
+ *

You can't set EvaluateTargetHealth to true when the alias target is a + * CloudFront distribution.

Elastic Beanstalk environments that have regionalized subdomains
+ *

If you specify an Elastic Beanstalk environment in DNSName and the environment contains an ELB + * load balancer, Elastic Load Balancing routes queries only to the healthy Amazon EC2 instances that are registered + * with the load balancer. (An environment automatically contains an ELB load balancer if it includes more than one + * Amazon EC2 instance.) If you set EvaluateTargetHealth to true and either no Amazon EC2 + * instances are healthy or the load balancer itself is unhealthy, Route 53 routes queries to other available + * resources that are healthy, if any.

If the environment contains a single Amazon EC2 instance, there are + * no special requirements.

ELB load balancers

Health checking behavior depends on the + * type of load balancer:

  • Classic Load Balancers: If you specify an ELB Classic Load + * Balancer in DNSName, Elastic Load Balancing routes queries only to the healthy Amazon EC2 instances + * that are registered with the load balancer. If you set EvaluateTargetHealth to true and + * either no EC2 instances are healthy or the load balancer itself is unhealthy, Route 53 routes queries to other + * resources.

  • Application and Network Load Balancers: If you specify an ELB Application or + * Network Load Balancer and you set EvaluateTargetHealth to true, Route 53 routes queries + * to the load balancer based on the health of the target groups that are associated with the load balancer:

    + *
    • For an Application or Network Load Balancer to be considered healthy, every target group that + * contains targets must contain at least one healthy target. If any target group contains only unhealthy targets, + * the load balancer is considered unhealthy, and Route 53 routes queries to other resources.

    • A + * target group that has no registered targets is considered unhealthy.

When + * you create a load balancer, you configure settings for Elastic Load Balancing health checks; they're not Route 53 + * health checks, but they perform a similar function. Do not create Route 53 health checks for the EC2 instances + * that you register with an ELB load balancer.

S3 buckets

There are no special + * requirements for setting EvaluateTargetHealth to true when the alias target is an S3 + * bucket.

Other records in the same hosted zone

If the Amazon Web Services resource that + * you specify in DNSName is a record or a group of records (for example, a group of weighted records) + * but is not another alias record, we recommend that you associate a health check with all of the records in the + * alias target. For more information, see What Happens When You Omit Health Checks? in the Amazon Route 53 Developer + * Guide.

For more information and examples, see Amazon Route 53 Health Checks + * and DNS Failover in the Amazon Route 53 Developer Guide.

+ */ + private Boolean evaluateTargetHealth; + + /* + *

Alias resource records sets only: The value used depends on where you want to route traffic:

+ *
Amazon API Gateway custom regional APIs and edge-optimized APIs

Specify the hosted zone ID for + * your API. You can get the applicable value using the CLI command get-domain-names:

  • For regional APIs, specify the value of regionalHostedZoneId.

  • For + * edge-optimized APIs, specify the value of distributionHostedZoneId.

Amazon + * Virtual Private Cloud interface VPC endpoint

Specify the hosted zone ID for your interface endpoint. + * You can get the value of HostedZoneId using the CLI command describe-vpc-endpoints.

CloudFront distribution

Specify Z2FDTNDATAQYW2.

Alias + * resource record sets for CloudFront can't be created in a private zone.

Elastic Beanstalk + * environment

Specify the hosted zone ID for the region that you created the environment in. The + * environment must have a regionalized subdomain. For a list of regions and the corresponding hosted zone IDs, see + * Elastic Beanstalk endpoints and + * quotas in the Amazon Web Services General Reference.

ELB load balancer
+ *

Specify the value of the hosted zone ID for the load balancer. Use the following methods to get the hosted + * zone ID:

Global + * Accelerator accelerator

Specify Z2BJ6XQ5FK7U4H.

An Amazon S3 bucket + * configured as a static website

Specify the hosted zone ID for the region that you created the bucket + * in. For more information about valid values, see the table Amazon S3 Website + * Endpoints in the Amazon Web Services General Reference.

Another Route 53 resource record + * set in your hosted zone

Specify the hosted zone ID of your hosted zone. (An alias resource record + * set can't reference a resource record set in a different hosted zone.)

+ */ + private String hostedZoneId; + + /** + * Creates an instance of AliasTarget class. + */ + public AliasTarget() { + } + + /** + * Get the dnsName property: <p> <i>Alias resource record sets only:</i> The value that you + * specify depends on where you want to route queries:</p> <dl> <dt>Amazon API Gateway custom + * regional APIs and edge-optimized APIs</dt> <dd> <p>Specify the applicable domain name for your + * API. You can get the applicable value using the CLI command <a + * href='https://docs.aws.amazon.com/cli/latest/reference/apigateway/get-domain-names.html'>get-domain-names</a>:</p> + * <ul> <li> <p>For regional APIs, specify the value of + * <code>regionalDomainName</code>.</p> </li> <li> <p>For edge-optimized APIs, + * specify the value of <code>distributionDomainName</code>. This is the name of the associated + * CloudFront distribution, such as <code>da1b2c3d4e5.cloudfront.net</code>.</p> </li> + * </ul> <note> <p>The name of the record that you're creating must match a custom domain name for + * your API, such as <code>api.example.com</code>.</p> </note> </dd> <dt>Amazon + * Virtual Private Cloud interface VPC endpoint</dt> <dd> <p>Enter the API endpoint for the + * interface endpoint, such as + * <code>vpce-123456789abcdef01-example-us-east-1a.elasticloadbalancing.us-east-1.vpce.amazonaws.com</code>. + * For edge-optimized APIs, this is the domain name for the corresponding CloudFront distribution. You can get the + * value of <code>DnsName</code> using the CLI command <a + * href='https://docs.aws.amazon.com/cli/latest/reference/ec2/describe-vpc-endpoints.html'>describe-vpc-endpoints</a>.</p> + * </dd> <dt>CloudFront distribution</dt> <dd> <p>Specify the domain name that + * CloudFront assigned when you created your distribution.</p> <p>Your CloudFront distribution must + * include an alternate domain name that matches the name of the resource record set. For example, if the name of + * the resource record set is <i>acme.example.com</i>, your CloudFront distribution must include + * <i>acme.example.com</i> as one of the alternate domain names. For more information, see <a + * href='https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/CNAMEs.html'>Using Alternate Domain + * Names (CNAMEs)</a> in the <i>Amazon CloudFront Developer Guide</i>.</p> <p>You + * can't create a resource record set in a private hosted zone to route traffic to a CloudFront + * distribution.</p> <note> <p>For failover alias records, you can't specify a CloudFront + * distribution for both the primary and secondary records. A distribution must include an alternate domain name + * that matches the name of the record. However, the primary and secondary records have the same name, and you can't + * include the same alternate domain name in more than one distribution. </p> </note> </dd> + * <dt>Elastic Beanstalk environment</dt> <dd> <p>If the domain name for your Elastic + * Beanstalk environment includes the region that you deployed the environment in, you can create an alias record + * that routes traffic to the environment. For example, the domain name + * <code>my-environment.<i>us-west-2</i>.elasticbeanstalk.com</code> is a regionalized + * domain name. </p> <important> <p>For environments that were created before early 2016, the + * domain name doesn't include the region. To route traffic to these environments, you must create a CNAME record + * instead of an alias record. Note that you can't create a CNAME record for the root domain name. For example, if + * your domain name is example.com, you can create a record that routes traffic for acme.example.com to your Elastic + * Beanstalk environment, but you can't create a record that routes traffic for example.com to your Elastic + * Beanstalk environment.</p> </important> <p>For Elastic Beanstalk environments that have + * regionalized subdomains, specify the <code>CNAME</code> attribute for the environment. You can use + * the following methods to get the value of the CNAME attribute:</p> <ul> <li> <p> + * <i>Amazon Web Services Management Console</i>: For information about how to get the value by using + * the console, see <a href='https://docs.aws.amazon.com/elasticbeanstalk/latest/dg/customdomains.html'>Using + * Custom Domains with Elastic Beanstalk</a> in the <i>Elastic Beanstalk Developer + * Guide</i>.</p> </li> <li> <p> <i>Elastic Beanstalk API</i>: Use the + * <code>DescribeEnvironments</code> action to get the value of the <code>CNAME</code> + * attribute. For more information, see <a + * href='https://docs.aws.amazon.com/elasticbeanstalk/latest/api/API_DescribeEnvironments.html'>DescribeEnvironments</a> + * in the <i>Elastic Beanstalk API Reference</i>.</p> </li> <li> <p> + * <i>CLI</i>: Use the <code>describe-environments</code> command to get the value of the + * <code>CNAME</code> attribute. For more information, see <a + * href='https://docs.aws.amazon.com/cli/latest/reference/elasticbeanstalk/describe-environments.html'>describe-environments</a> + * in the <i>CLI Command Reference</i>.</p> </li> </ul> </dd> <dt>ELB load + * balancer</dt> <dd> <p>Specify the DNS name that is associated with the load balancer. Get the + * DNS name by using the Amazon Web Services Management Console, the ELB API, or the CLI. </p> <ul> + * <li> <p> <b>Amazon Web Services Management Console</b>: Go to the EC2 page, choose + * <b>Load Balancers</b> in the navigation pane, choose the load balancer, choose the + * <b>Description</b> tab, and get the value of the <b>DNS name</b> field. </p> + * <p>If you're routing traffic to a Classic Load Balancer, get the value that begins with + * <b>dualstack</b>. If you're routing traffic to another type of load balancer, get the value that + * applies to the record type, A or AAAA.</p> </li> <li> <p> <b>Elastic Load Balancing + * API</b>: Use <code>DescribeLoadBalancers</code> to get the value of + * <code>DNSName</code>. For more information, see the applicable guide:</p> <ul> <li> + * <p>Classic Load Balancers: <a + * href='https://docs.aws.amazon.com/elasticloadbalancing/2012-06-01/APIReference/API_DescribeLoadBalancers.html'>DescribeLoadBalancers</a> + * </p> </li> <li> <p>Application and Network Load Balancers: <a + * href='https://docs.aws.amazon.com/elasticloadbalancing/latest/APIReference/API_DescribeLoadBalancers.html'>DescribeLoadBalancers</a> + * </p> </li> </ul> </li> <li> <p> <b>CLI</b>: Use + * <code>describe-load-balancers</code> to get the value of <code>DNSName</code>. For more + * information, see the applicable guide:</p> <ul> <li> <p>Classic Load Balancers: <a + * href='http://docs.aws.amazon.com/cli/latest/reference/elb/describe-load-balancers.html'>describe-load-balancers</a> + * </p> </li> <li> <p>Application and Network Load Balancers: <a + * href='http://docs.aws.amazon.com/cli/latest/reference/elbv2/describe-load-balancers.html'>describe-load-balancers</a> + * </p> </li> </ul> </li> </ul> </dd> <dt>Global Accelerator + * accelerator</dt> <dd> <p>Specify the DNS name for your accelerator:</p> <ul> + * <li> <p> <b>Global Accelerator API:</b> To get the DNS name, use <a + * href='https://docs.aws.amazon.com/global-accelerator/latest/api/API_DescribeAccelerator.html'>DescribeAccelerator</a>.</p> + * </li> <li> <p> <b>CLI:</b> To get the DNS name, use <a + * href='https://docs.aws.amazon.com/cli/latest/reference/globalaccelerator/describe-accelerator.html'>describe-accelerator</a>.</p> + * </li> </ul> </dd> <dt>Amazon S3 bucket that is configured as a static website</dt> + * <dd> <p>Specify the domain name of the Amazon S3 website endpoint that you created the bucket in, for + * example, <code>s3-website.us-east-2.amazonaws.com</code>. For more information about valid values, + * see the table <a + * href='https://docs.aws.amazon.com/general/latest/gr/s3.html#s3_website_region_endpoints'>Amazon S3 Website + * Endpoints</a> in the <i>Amazon Web Services General Reference</i>. For more information about + * using S3 buckets for websites, see <a + * href='https://docs.aws.amazon.com/Route53/latest/DeveloperGuide/getting-started.html'>Getting Started with + * Amazon Route 53</a> in the <i>Amazon Route 53 Developer Guide.</i> </p> </dd> + * <dt>Another Route 53 resource record set</dt> <dd> <p>Specify the value of the + * <code>Name</code> element for a resource record set in the current hosted zone.</p> + * <note> <p>If you're creating an alias record that has the same name as the hosted zone (known as the + * zone apex), you can't specify the domain name for a record for which the value of <code>Type</code> + * is <code>CNAME</code>. This is because the alias record must have the same type as the record that + * you're routing traffic to, and creating a CNAME record for the zone apex isn't supported even for an alias + * record.</p> </note> </dd> </dl>. + * + * @return the dnsName value. + */ + public String dnsName() { + return this.dnsName; + } + + /** + * Set the dnsName property: <p> <i>Alias resource record sets only:</i> The value that you + * specify depends on where you want to route queries:</p> <dl> <dt>Amazon API Gateway custom + * regional APIs and edge-optimized APIs</dt> <dd> <p>Specify the applicable domain name for your + * API. You can get the applicable value using the CLI command <a + * href='https://docs.aws.amazon.com/cli/latest/reference/apigateway/get-domain-names.html'>get-domain-names</a>:</p> + * <ul> <li> <p>For regional APIs, specify the value of + * <code>regionalDomainName</code>.</p> </li> <li> <p>For edge-optimized APIs, + * specify the value of <code>distributionDomainName</code>. This is the name of the associated + * CloudFront distribution, such as <code>da1b2c3d4e5.cloudfront.net</code>.</p> </li> + * </ul> <note> <p>The name of the record that you're creating must match a custom domain name for + * your API, such as <code>api.example.com</code>.</p> </note> </dd> <dt>Amazon + * Virtual Private Cloud interface VPC endpoint</dt> <dd> <p>Enter the API endpoint for the + * interface endpoint, such as + * <code>vpce-123456789abcdef01-example-us-east-1a.elasticloadbalancing.us-east-1.vpce.amazonaws.com</code>. + * For edge-optimized APIs, this is the domain name for the corresponding CloudFront distribution. You can get the + * value of <code>DnsName</code> using the CLI command <a + * href='https://docs.aws.amazon.com/cli/latest/reference/ec2/describe-vpc-endpoints.html'>describe-vpc-endpoints</a>.</p> + * </dd> <dt>CloudFront distribution</dt> <dd> <p>Specify the domain name that + * CloudFront assigned when you created your distribution.</p> <p>Your CloudFront distribution must + * include an alternate domain name that matches the name of the resource record set. For example, if the name of + * the resource record set is <i>acme.example.com</i>, your CloudFront distribution must include + * <i>acme.example.com</i> as one of the alternate domain names. For more information, see <a + * href='https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/CNAMEs.html'>Using Alternate Domain + * Names (CNAMEs)</a> in the <i>Amazon CloudFront Developer Guide</i>.</p> <p>You + * can't create a resource record set in a private hosted zone to route traffic to a CloudFront + * distribution.</p> <note> <p>For failover alias records, you can't specify a CloudFront + * distribution for both the primary and secondary records. A distribution must include an alternate domain name + * that matches the name of the record. However, the primary and secondary records have the same name, and you can't + * include the same alternate domain name in more than one distribution. </p> </note> </dd> + * <dt>Elastic Beanstalk environment</dt> <dd> <p>If the domain name for your Elastic + * Beanstalk environment includes the region that you deployed the environment in, you can create an alias record + * that routes traffic to the environment. For example, the domain name + * <code>my-environment.<i>us-west-2</i>.elasticbeanstalk.com</code> is a regionalized + * domain name. </p> <important> <p>For environments that were created before early 2016, the + * domain name doesn't include the region. To route traffic to these environments, you must create a CNAME record + * instead of an alias record. Note that you can't create a CNAME record for the root domain name. For example, if + * your domain name is example.com, you can create a record that routes traffic for acme.example.com to your Elastic + * Beanstalk environment, but you can't create a record that routes traffic for example.com to your Elastic + * Beanstalk environment.</p> </important> <p>For Elastic Beanstalk environments that have + * regionalized subdomains, specify the <code>CNAME</code> attribute for the environment. You can use + * the following methods to get the value of the CNAME attribute:</p> <ul> <li> <p> + * <i>Amazon Web Services Management Console</i>: For information about how to get the value by using + * the console, see <a href='https://docs.aws.amazon.com/elasticbeanstalk/latest/dg/customdomains.html'>Using + * Custom Domains with Elastic Beanstalk</a> in the <i>Elastic Beanstalk Developer + * Guide</i>.</p> </li> <li> <p> <i>Elastic Beanstalk API</i>: Use the + * <code>DescribeEnvironments</code> action to get the value of the <code>CNAME</code> + * attribute. For more information, see <a + * href='https://docs.aws.amazon.com/elasticbeanstalk/latest/api/API_DescribeEnvironments.html'>DescribeEnvironments</a> + * in the <i>Elastic Beanstalk API Reference</i>.</p> </li> <li> <p> + * <i>CLI</i>: Use the <code>describe-environments</code> command to get the value of the + * <code>CNAME</code> attribute. For more information, see <a + * href='https://docs.aws.amazon.com/cli/latest/reference/elasticbeanstalk/describe-environments.html'>describe-environments</a> + * in the <i>CLI Command Reference</i>.</p> </li> </ul> </dd> <dt>ELB load + * balancer</dt> <dd> <p>Specify the DNS name that is associated with the load balancer. Get the + * DNS name by using the Amazon Web Services Management Console, the ELB API, or the CLI. </p> <ul> + * <li> <p> <b>Amazon Web Services Management Console</b>: Go to the EC2 page, choose + * <b>Load Balancers</b> in the navigation pane, choose the load balancer, choose the + * <b>Description</b> tab, and get the value of the <b>DNS name</b> field. </p> + * <p>If you're routing traffic to a Classic Load Balancer, get the value that begins with + * <b>dualstack</b>. If you're routing traffic to another type of load balancer, get the value that + * applies to the record type, A or AAAA.</p> </li> <li> <p> <b>Elastic Load Balancing + * API</b>: Use <code>DescribeLoadBalancers</code> to get the value of + * <code>DNSName</code>. For more information, see the applicable guide:</p> <ul> <li> + * <p>Classic Load Balancers: <a + * href='https://docs.aws.amazon.com/elasticloadbalancing/2012-06-01/APIReference/API_DescribeLoadBalancers.html'>DescribeLoadBalancers</a> + * </p> </li> <li> <p>Application and Network Load Balancers: <a + * href='https://docs.aws.amazon.com/elasticloadbalancing/latest/APIReference/API_DescribeLoadBalancers.html'>DescribeLoadBalancers</a> + * </p> </li> </ul> </li> <li> <p> <b>CLI</b>: Use + * <code>describe-load-balancers</code> to get the value of <code>DNSName</code>. For more + * information, see the applicable guide:</p> <ul> <li> <p>Classic Load Balancers: <a + * href='http://docs.aws.amazon.com/cli/latest/reference/elb/describe-load-balancers.html'>describe-load-balancers</a> + * </p> </li> <li> <p>Application and Network Load Balancers: <a + * href='http://docs.aws.amazon.com/cli/latest/reference/elbv2/describe-load-balancers.html'>describe-load-balancers</a> + * </p> </li> </ul> </li> </ul> </dd> <dt>Global Accelerator + * accelerator</dt> <dd> <p>Specify the DNS name for your accelerator:</p> <ul> + * <li> <p> <b>Global Accelerator API:</b> To get the DNS name, use <a + * href='https://docs.aws.amazon.com/global-accelerator/latest/api/API_DescribeAccelerator.html'>DescribeAccelerator</a>.</p> + * </li> <li> <p> <b>CLI:</b> To get the DNS name, use <a + * href='https://docs.aws.amazon.com/cli/latest/reference/globalaccelerator/describe-accelerator.html'>describe-accelerator</a>.</p> + * </li> </ul> </dd> <dt>Amazon S3 bucket that is configured as a static website</dt> + * <dd> <p>Specify the domain name of the Amazon S3 website endpoint that you created the bucket in, for + * example, <code>s3-website.us-east-2.amazonaws.com</code>. For more information about valid values, + * see the table <a + * href='https://docs.aws.amazon.com/general/latest/gr/s3.html#s3_website_region_endpoints'>Amazon S3 Website + * Endpoints</a> in the <i>Amazon Web Services General Reference</i>. For more information about + * using S3 buckets for websites, see <a + * href='https://docs.aws.amazon.com/Route53/latest/DeveloperGuide/getting-started.html'>Getting Started with + * Amazon Route 53</a> in the <i>Amazon Route 53 Developer Guide.</i> </p> </dd> + * <dt>Another Route 53 resource record set</dt> <dd> <p>Specify the value of the + * <code>Name</code> element for a resource record set in the current hosted zone.</p> + * <note> <p>If you're creating an alias record that has the same name as the hosted zone (known as the + * zone apex), you can't specify the domain name for a record for which the value of <code>Type</code> + * is <code>CNAME</code>. This is because the alias record must have the same type as the record that + * you're routing traffic to, and creating a CNAME record for the zone apex isn't supported even for an alias + * record.</p> </note> </dd> </dl>. + * + * @param dnsName the dnsName value to set. + * @return the AliasTarget object itself. + */ + public AliasTarget withDnsName(String dnsName) { + this.dnsName = dnsName; + return this; + } + + /** + * Get the evaluateTargetHealth property: <p> <i>Applies only to alias, failover alias, geolocation + * alias, latency alias, and weighted alias resource record sets:</i> When + * <code>EvaluateTargetHealth</code> is <code>true</code>, an alias resource record set + * inherits the health of the referenced Amazon Web Services resource, such as an ELB load balancer or another + * resource record set in the hosted zone.</p> <p>Note the following:</p> <dl> + * <dt>CloudFront distributions</dt> <dd> <p>You can't set + * <code>EvaluateTargetHealth</code> to <code>true</code> when the alias target is a + * CloudFront distribution.</p> </dd> <dt>Elastic Beanstalk environments that have regionalized + * subdomains</dt> <dd> <p>If you specify an Elastic Beanstalk environment in + * <code>DNSName</code> and the environment contains an ELB load balancer, Elastic Load Balancing routes + * queries only to the healthy Amazon EC2 instances that are registered with the load balancer. (An environment + * automatically contains an ELB load balancer if it includes more than one Amazon EC2 instance.) If you set + * <code>EvaluateTargetHealth</code> to <code>true</code> and either no Amazon EC2 instances + * are healthy or the load balancer itself is unhealthy, Route 53 routes queries to other available resources that + * are healthy, if any. </p> <p>If the environment contains a single Amazon EC2 instance, there are no + * special requirements.</p> </dd> <dt>ELB load balancers</dt> <dd> <p>Health + * checking behavior depends on the type of load balancer:</p> <ul> <li> <p> + * <b>Classic Load Balancers</b>: If you specify an ELB Classic Load Balancer in + * <code>DNSName</code>, Elastic Load Balancing routes queries only to the healthy Amazon EC2 instances + * that are registered with the load balancer. If you set <code>EvaluateTargetHealth</code> to + * <code>true</code> and either no EC2 instances are healthy or the load balancer itself is unhealthy, + * Route 53 routes queries to other resources.</p> </li> <li> <p> <b>Application and + * Network Load Balancers</b>: If you specify an ELB Application or Network Load Balancer and you set + * <code>EvaluateTargetHealth</code> to <code>true</code>, Route 53 routes queries to the + * load balancer based on the health of the target groups that are associated with the load balancer:</p> + * <ul> <li> <p>For an Application or Network Load Balancer to be considered healthy, every target + * group that contains targets must contain at least one healthy target. If any target group contains only unhealthy + * targets, the load balancer is considered unhealthy, and Route 53 routes queries to other resources.</p> + * </li> <li> <p>A target group that has no registered targets is considered unhealthy.</p> + * </li> </ul> </li> </ul> <note> <p>When you create a load balancer, you + * configure settings for Elastic Load Balancing health checks; they're not Route 53 health checks, but they perform + * a similar function. Do not create Route 53 health checks for the EC2 instances that you register with an ELB load + * balancer. </p> </note> </dd> <dt>S3 buckets</dt> <dd> <p>There are no + * special requirements for setting <code>EvaluateTargetHealth</code> to <code>true</code> + * when the alias target is an S3 bucket.</p> </dd> <dt>Other records in the same hosted + * zone</dt> <dd> <p>If the Amazon Web Services resource that you specify in + * <code>DNSName</code> is a record or a group of records (for example, a group of weighted records) but + * is not another alias record, we recommend that you associate a health check with all of the records in the alias + * target. For more information, see <a + * href='https://docs.aws.amazon.com/Route53/latest/DeveloperGuide/dns-failover-complex-configs.html#dns-failover-complex-configs-hc-omitting'>What + * Happens When You Omit Health Checks?</a> in the <i>Amazon Route 53 Developer + * Guide</i>.</p> </dd> </dl> <p>For more information and examples, see <a + * href='https://docs.aws.amazon.com/Route53/latest/DeveloperGuide/dns-failover.html'>Amazon Route 53 Health + * Checks and DNS Failover</a> in the <i>Amazon Route 53 Developer Guide</i>.</p>. + * + * @return the evaluateTargetHealth value. + */ + public Boolean evaluateTargetHealth() { + return this.evaluateTargetHealth; + } + + /** + * Set the evaluateTargetHealth property: <p> <i>Applies only to alias, failover alias, geolocation + * alias, latency alias, and weighted alias resource record sets:</i> When + * <code>EvaluateTargetHealth</code> is <code>true</code>, an alias resource record set + * inherits the health of the referenced Amazon Web Services resource, such as an ELB load balancer or another + * resource record set in the hosted zone.</p> <p>Note the following:</p> <dl> + * <dt>CloudFront distributions</dt> <dd> <p>You can't set + * <code>EvaluateTargetHealth</code> to <code>true</code> when the alias target is a + * CloudFront distribution.</p> </dd> <dt>Elastic Beanstalk environments that have regionalized + * subdomains</dt> <dd> <p>If you specify an Elastic Beanstalk environment in + * <code>DNSName</code> and the environment contains an ELB load balancer, Elastic Load Balancing routes + * queries only to the healthy Amazon EC2 instances that are registered with the load balancer. (An environment + * automatically contains an ELB load balancer if it includes more than one Amazon EC2 instance.) If you set + * <code>EvaluateTargetHealth</code> to <code>true</code> and either no Amazon EC2 instances + * are healthy or the load balancer itself is unhealthy, Route 53 routes queries to other available resources that + * are healthy, if any. </p> <p>If the environment contains a single Amazon EC2 instance, there are no + * special requirements.</p> </dd> <dt>ELB load balancers</dt> <dd> <p>Health + * checking behavior depends on the type of load balancer:</p> <ul> <li> <p> + * <b>Classic Load Balancers</b>: If you specify an ELB Classic Load Balancer in + * <code>DNSName</code>, Elastic Load Balancing routes queries only to the healthy Amazon EC2 instances + * that are registered with the load balancer. If you set <code>EvaluateTargetHealth</code> to + * <code>true</code> and either no EC2 instances are healthy or the load balancer itself is unhealthy, + * Route 53 routes queries to other resources.</p> </li> <li> <p> <b>Application and + * Network Load Balancers</b>: If you specify an ELB Application or Network Load Balancer and you set + * <code>EvaluateTargetHealth</code> to <code>true</code>, Route 53 routes queries to the + * load balancer based on the health of the target groups that are associated with the load balancer:</p> + * <ul> <li> <p>For an Application or Network Load Balancer to be considered healthy, every target + * group that contains targets must contain at least one healthy target. If any target group contains only unhealthy + * targets, the load balancer is considered unhealthy, and Route 53 routes queries to other resources.</p> + * </li> <li> <p>A target group that has no registered targets is considered unhealthy.</p> + * </li> </ul> </li> </ul> <note> <p>When you create a load balancer, you + * configure settings for Elastic Load Balancing health checks; they're not Route 53 health checks, but they perform + * a similar function. Do not create Route 53 health checks for the EC2 instances that you register with an ELB load + * balancer. </p> </note> </dd> <dt>S3 buckets</dt> <dd> <p>There are no + * special requirements for setting <code>EvaluateTargetHealth</code> to <code>true</code> + * when the alias target is an S3 bucket.</p> </dd> <dt>Other records in the same hosted + * zone</dt> <dd> <p>If the Amazon Web Services resource that you specify in + * <code>DNSName</code> is a record or a group of records (for example, a group of weighted records) but + * is not another alias record, we recommend that you associate a health check with all of the records in the alias + * target. For more information, see <a + * href='https://docs.aws.amazon.com/Route53/latest/DeveloperGuide/dns-failover-complex-configs.html#dns-failover-complex-configs-hc-omitting'>What + * Happens When You Omit Health Checks?</a> in the <i>Amazon Route 53 Developer + * Guide</i>.</p> </dd> </dl> <p>For more information and examples, see <a + * href='https://docs.aws.amazon.com/Route53/latest/DeveloperGuide/dns-failover.html'>Amazon Route 53 Health + * Checks and DNS Failover</a> in the <i>Amazon Route 53 Developer Guide</i>.</p>. + * + * @param evaluateTargetHealth the evaluateTargetHealth value to set. + * @return the AliasTarget object itself. + */ + public AliasTarget withEvaluateTargetHealth(Boolean evaluateTargetHealth) { + this.evaluateTargetHealth = evaluateTargetHealth; + return this; + } + + /** + * Get the hostedZoneId property: <p> <i>Alias resource records sets only</i>: The value used + * depends on where you want to route traffic:</p> <dl> <dt>Amazon API Gateway custom regional + * APIs and edge-optimized APIs</dt> <dd> <p>Specify the hosted zone ID for your API. You can get + * the applicable value using the CLI command <a + * href='https://docs.aws.amazon.com/cli/latest/reference/apigateway/get-domain-names.html'>get-domain-names</a>:</p> + * <ul> <li> <p>For regional APIs, specify the value of + * <code>regionalHostedZoneId</code>.</p> </li> <li> <p>For edge-optimized APIs, + * specify the value of <code>distributionHostedZoneId</code>.</p> </li> </ul> + * </dd> <dt>Amazon Virtual Private Cloud interface VPC endpoint</dt> <dd> <p>Specify + * the hosted zone ID for your interface endpoint. You can get the value of <code>HostedZoneId</code> + * using the CLI command <a + * href='https://docs.aws.amazon.com/cli/latest/reference/ec2/describe-vpc-endpoints.html'>describe-vpc-endpoints</a>.</p> + * </dd> <dt>CloudFront distribution</dt> <dd> <p>Specify + * <code>Z2FDTNDATAQYW2</code>.</p> <note> <p>Alias resource record sets for + * CloudFront can't be created in a private zone.</p> </note> </dd> <dt>Elastic Beanstalk + * environment</dt> <dd> <p>Specify the hosted zone ID for the region that you created the + * environment in. The environment must have a regionalized subdomain. For a list of regions and the corresponding + * hosted zone IDs, see <a href='https://docs.aws.amazon.com/general/latest/gr/elasticbeanstalk.html'>Elastic + * Beanstalk endpoints and quotas</a> in the <i>Amazon Web Services General + * Reference</i>.</p> </dd> <dt>ELB load balancer</dt> <dd> <p>Specify the + * value of the hosted zone ID for the load balancer. Use the following methods to get the hosted zone ID:</p> + * <ul> <li> <p> <a href='https://docs.aws.amazon.com/general/latest/gr/elb.html'>Elastic + * Load Balancing endpoints and quotas</a> topic in the <i>Amazon Web Services General + * Reference</i>: Use the value that corresponds with the region that you created your load balancer in. Note + * that there are separate columns for Application and Classic Load Balancers and for Network Load + * Balancers.</p> </li> <li> <p> <b>Amazon Web Services Management Console</b>: + * Go to the Amazon EC2 page, choose <b>Load Balancers</b> in the navigation pane, select the load + * balancer, and get the value of the <b>Hosted zone</b> field on the <b>Description</b> + * tab.</p> </li> <li> <p> <b>Elastic Load Balancing API</b>: Use + * <code>DescribeLoadBalancers</code> to get the applicable value. For more information, see the + * applicable guide:</p> <ul> <li> <p>Classic Load Balancers: Use <a + * href='https://docs.aws.amazon.com/elasticloadbalancing/2012-06-01/APIReference/API_DescribeLoadBalancers.html'>DescribeLoadBalancers</a> + * to get the value of <code>CanonicalHostedZoneNameId</code>.</p> </li> <li> + * <p>Application and Network Load Balancers: Use <a + * href='https://docs.aws.amazon.com/elasticloadbalancing/latest/APIReference/API_DescribeLoadBalancers.html'>DescribeLoadBalancers</a> + * to get the value of <code>CanonicalHostedZoneId</code>.</p> </li> </ul> </li> + * <li> <p> <b>CLI</b>: Use <code>describe-load-balancers</code> to get the + * applicable value. For more information, see the applicable guide:</p> <ul> <li> + * <p>Classic Load Balancers: Use <a + * href='http://docs.aws.amazon.com/cli/latest/reference/elb/describe-load-balancers.html'>describe-load-balancers</a> + * to get the value of <code>CanonicalHostedZoneNameId</code>.</p> </li> <li> + * <p>Application and Network Load Balancers: Use <a + * href='http://docs.aws.amazon.com/cli/latest/reference/elbv2/describe-load-balancers.html'>describe-load-balancers</a> + * to get the value of <code>CanonicalHostedZoneId</code>.</p> </li> </ul> </li> + * </ul> </dd> <dt>Global Accelerator accelerator</dt> <dd> <p>Specify + * <code>Z2BJ6XQ5FK7U4H</code>.</p> </dd> <dt>An Amazon S3 bucket configured as a + * static website</dt> <dd> <p>Specify the hosted zone ID for the region that you created the + * bucket in. For more information about valid values, see the table <a + * href='https://docs.aws.amazon.com/general/latest/gr/s3.html#s3_website_region_endpoints'>Amazon S3 Website + * Endpoints</a> in the <i>Amazon Web Services General Reference</i>.</p> </dd> + * <dt>Another Route 53 resource record set in your hosted zone</dt> <dd> <p>Specify the + * hosted zone ID of your hosted zone. (An alias resource record set can't reference a resource record set in a + * different hosted zone.)</p> </dd> </dl>. + * + * @return the hostedZoneId value. + */ + public String hostedZoneId() { + return this.hostedZoneId; + } + + /** + * Set the hostedZoneId property: <p> <i>Alias resource records sets only</i>: The value used + * depends on where you want to route traffic:</p> <dl> <dt>Amazon API Gateway custom regional + * APIs and edge-optimized APIs</dt> <dd> <p>Specify the hosted zone ID for your API. You can get + * the applicable value using the CLI command <a + * href='https://docs.aws.amazon.com/cli/latest/reference/apigateway/get-domain-names.html'>get-domain-names</a>:</p> + * <ul> <li> <p>For regional APIs, specify the value of + * <code>regionalHostedZoneId</code>.</p> </li> <li> <p>For edge-optimized APIs, + * specify the value of <code>distributionHostedZoneId</code>.</p> </li> </ul> + * </dd> <dt>Amazon Virtual Private Cloud interface VPC endpoint</dt> <dd> <p>Specify + * the hosted zone ID for your interface endpoint. You can get the value of <code>HostedZoneId</code> + * using the CLI command <a + * href='https://docs.aws.amazon.com/cli/latest/reference/ec2/describe-vpc-endpoints.html'>describe-vpc-endpoints</a>.</p> + * </dd> <dt>CloudFront distribution</dt> <dd> <p>Specify + * <code>Z2FDTNDATAQYW2</code>.</p> <note> <p>Alias resource record sets for + * CloudFront can't be created in a private zone.</p> </note> </dd> <dt>Elastic Beanstalk + * environment</dt> <dd> <p>Specify the hosted zone ID for the region that you created the + * environment in. The environment must have a regionalized subdomain. For a list of regions and the corresponding + * hosted zone IDs, see <a href='https://docs.aws.amazon.com/general/latest/gr/elasticbeanstalk.html'>Elastic + * Beanstalk endpoints and quotas</a> in the <i>Amazon Web Services General + * Reference</i>.</p> </dd> <dt>ELB load balancer</dt> <dd> <p>Specify the + * value of the hosted zone ID for the load balancer. Use the following methods to get the hosted zone ID:</p> + * <ul> <li> <p> <a href='https://docs.aws.amazon.com/general/latest/gr/elb.html'>Elastic + * Load Balancing endpoints and quotas</a> topic in the <i>Amazon Web Services General + * Reference</i>: Use the value that corresponds with the region that you created your load balancer in. Note + * that there are separate columns for Application and Classic Load Balancers and for Network Load + * Balancers.</p> </li> <li> <p> <b>Amazon Web Services Management Console</b>: + * Go to the Amazon EC2 page, choose <b>Load Balancers</b> in the navigation pane, select the load + * balancer, and get the value of the <b>Hosted zone</b> field on the <b>Description</b> + * tab.</p> </li> <li> <p> <b>Elastic Load Balancing API</b>: Use + * <code>DescribeLoadBalancers</code> to get the applicable value. For more information, see the + * applicable guide:</p> <ul> <li> <p>Classic Load Balancers: Use <a + * href='https://docs.aws.amazon.com/elasticloadbalancing/2012-06-01/APIReference/API_DescribeLoadBalancers.html'>DescribeLoadBalancers</a> + * to get the value of <code>CanonicalHostedZoneNameId</code>.</p> </li> <li> + * <p>Application and Network Load Balancers: Use <a + * href='https://docs.aws.amazon.com/elasticloadbalancing/latest/APIReference/API_DescribeLoadBalancers.html'>DescribeLoadBalancers</a> + * to get the value of <code>CanonicalHostedZoneId</code>.</p> </li> </ul> </li> + * <li> <p> <b>CLI</b>: Use <code>describe-load-balancers</code> to get the + * applicable value. For more information, see the applicable guide:</p> <ul> <li> + * <p>Classic Load Balancers: Use <a + * href='http://docs.aws.amazon.com/cli/latest/reference/elb/describe-load-balancers.html'>describe-load-balancers</a> + * to get the value of <code>CanonicalHostedZoneNameId</code>.</p> </li> <li> + * <p>Application and Network Load Balancers: Use <a + * href='http://docs.aws.amazon.com/cli/latest/reference/elbv2/describe-load-balancers.html'>describe-load-balancers</a> + * to get the value of <code>CanonicalHostedZoneId</code>.</p> </li> </ul> </li> + * </ul> </dd> <dt>Global Accelerator accelerator</dt> <dd> <p>Specify + * <code>Z2BJ6XQ5FK7U4H</code>.</p> </dd> <dt>An Amazon S3 bucket configured as a + * static website</dt> <dd> <p>Specify the hosted zone ID for the region that you created the + * bucket in. For more information about valid values, see the table <a + * href='https://docs.aws.amazon.com/general/latest/gr/s3.html#s3_website_region_endpoints'>Amazon S3 Website + * Endpoints</a> in the <i>Amazon Web Services General Reference</i>.</p> </dd> + * <dt>Another Route 53 resource record set in your hosted zone</dt> <dd> <p>Specify the + * hosted zone ID of your hosted zone. (An alias resource record set can't reference a resource record set in a + * different hosted zone.)</p> </dd> </dl>. + * + * @param hostedZoneId the hostedZoneId value to set. + * @return the AliasTarget object itself. + */ + public AliasTarget withHostedZoneId(String hostedZoneId) { + this.hostedZoneId = hostedZoneId; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("dnsName", this.dnsName); + jsonWriter.writeBooleanField("evaluateTargetHealth", this.evaluateTargetHealth); + jsonWriter.writeStringField("hostedZoneId", this.hostedZoneId); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AliasTarget from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AliasTarget if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the AliasTarget. + */ + public static AliasTarget fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AliasTarget deserializedAliasTarget = new AliasTarget(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("dnsName".equals(fieldName)) { + deserializedAliasTarget.dnsName = reader.getString(); + } else if ("evaluateTargetHealth".equals(fieldName)) { + deserializedAliasTarget.evaluateTargetHealth = reader.getNullable(JsonReader::getBoolean); + } else if ("hostedZoneId".equals(fieldName)) { + deserializedAliasTarget.hostedZoneId = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedAliasTarget; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/AmdSevSnpSpecification.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/AmdSevSnpSpecification.java new file mode 100644 index 000000000000..f91513207066 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/AmdSevSnpSpecification.java @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * AmdSevSnpSpecification enum. + */ +public final class AmdSevSnpSpecification extends ExpandableStringEnum { + /** + * Static value disabled for AmdSevSnpSpecification. + */ + public static final AmdSevSnpSpecification DISABLED = fromString("disabled"); + + /** + * Static value enabled for AmdSevSnpSpecification. + */ + public static final AmdSevSnpSpecification ENABLED = fromString("enabled"); + + /** + * Creates a new instance of AmdSevSnpSpecification value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public AmdSevSnpSpecification() { + } + + /** + * Creates or finds a AmdSevSnpSpecification from its string representation. + * + * @param name a name to look for. + * @return the corresponding AmdSevSnpSpecification. + */ + public static AmdSevSnpSpecification fromString(String name) { + return fromString(name, AmdSevSnpSpecification.class); + } + + /** + * Gets known AmdSevSnpSpecification values. + * + * @return known AmdSevSnpSpecification values. + */ + public static Collection values() { + return values(AmdSevSnpSpecification.class); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/AmdSevSnpSpecificationEnumValue.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/AmdSevSnpSpecificationEnumValue.java new file mode 100644 index 000000000000..b6f3fd9fc283 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/AmdSevSnpSpecificationEnumValue.java @@ -0,0 +1,95 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of AmdSevSnpSpecificationEnumValue. + */ +@Fluent +public final class AmdSevSnpSpecificationEnumValue implements JsonSerializable { + /* + * Property value + */ + private AmdSevSnpSpecification value; + + /** + * Creates an instance of AmdSevSnpSpecificationEnumValue class. + */ + public AmdSevSnpSpecificationEnumValue() { + } + + /** + * Get the value property: Property value. + * + * @return the value value. + */ + public AmdSevSnpSpecification value() { + return this.value; + } + + /** + * Set the value property: Property value. + * + * @param value the value value to set. + * @return the AmdSevSnpSpecificationEnumValue object itself. + */ + public AmdSevSnpSpecificationEnumValue withValue(AmdSevSnpSpecification value) { + this.value = value; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("value", this.value == null ? null : this.value.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AmdSevSnpSpecificationEnumValue from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AmdSevSnpSpecificationEnumValue if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the AmdSevSnpSpecificationEnumValue. + */ + public static AmdSevSnpSpecificationEnumValue fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AmdSevSnpSpecificationEnumValue deserializedAmdSevSnpSpecificationEnumValue + = new AmdSevSnpSpecificationEnumValue(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + deserializedAmdSevSnpSpecificationEnumValue.value + = AmdSevSnpSpecification.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedAmdSevSnpSpecificationEnumValue; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/AnalyticsConfiguration.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/AnalyticsConfiguration.java new file mode 100644 index 000000000000..c964b898f4c2 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/AnalyticsConfiguration.java @@ -0,0 +1,198 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Definition of AnalyticsConfiguration. + */ +@Fluent +public final class AnalyticsConfiguration implements JsonSerializable { + /* + * The ID that identifies the analytics configuration. + */ + private String id; + + /* + * The prefix that an object must have to be included in the analytics results. + */ + private String prefix; + + /* + * Contains data related to access patterns to be collected and made available to analyze the tradeoffs between + * different storage classes. Specifies data related to access patterns to be collected and made available to + * analyze the tradeoffs between different storage classes for an Amazon S3 bucket. + */ + private StorageClassAnalysis storageClassAnalysis; + + /* + * The tags to use when evaluating an analytics filter. The analytics only includes objects that meet the filter's + * criteria. If no filter is specified, all of the contents of the bucket are included in the analysis. + */ + private List tagFilters; + + /** + * Creates an instance of AnalyticsConfiguration class. + */ + public AnalyticsConfiguration() { + } + + /** + * Get the id property: The ID that identifies the analytics configuration. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Set the id property: The ID that identifies the analytics configuration. + * + * @param id the id value to set. + * @return the AnalyticsConfiguration object itself. + */ + public AnalyticsConfiguration withId(String id) { + this.id = id; + return this; + } + + /** + * Get the prefix property: The prefix that an object must have to be included in the analytics results. + * + * @return the prefix value. + */ + public String prefix() { + return this.prefix; + } + + /** + * Set the prefix property: The prefix that an object must have to be included in the analytics results. + * + * @param prefix the prefix value to set. + * @return the AnalyticsConfiguration object itself. + */ + public AnalyticsConfiguration withPrefix(String prefix) { + this.prefix = prefix; + return this; + } + + /** + * Get the storageClassAnalysis property: Contains data related to access patterns to be collected and made + * available to analyze the tradeoffs between different storage classes. Specifies data related to access patterns + * to be collected and made available to analyze the tradeoffs between different storage classes for an Amazon S3 + * bucket. + * + * @return the storageClassAnalysis value. + */ + public StorageClassAnalysis storageClassAnalysis() { + return this.storageClassAnalysis; + } + + /** + * Set the storageClassAnalysis property: Contains data related to access patterns to be collected and made + * available to analyze the tradeoffs between different storage classes. Specifies data related to access patterns + * to be collected and made available to analyze the tradeoffs between different storage classes for an Amazon S3 + * bucket. + * + * @param storageClassAnalysis the storageClassAnalysis value to set. + * @return the AnalyticsConfiguration object itself. + */ + public AnalyticsConfiguration withStorageClassAnalysis(StorageClassAnalysis storageClassAnalysis) { + this.storageClassAnalysis = storageClassAnalysis; + return this; + } + + /** + * Get the tagFilters property: The tags to use when evaluating an analytics filter. The analytics only includes + * objects that meet the filter's criteria. If no filter is specified, all of the contents of the bucket are + * included in the analysis. + * + * @return the tagFilters value. + */ + public List tagFilters() { + return this.tagFilters; + } + + /** + * Set the tagFilters property: The tags to use when evaluating an analytics filter. The analytics only includes + * objects that meet the filter's criteria. If no filter is specified, all of the contents of the bucket are + * included in the analysis. + * + * @param tagFilters the tagFilters value to set. + * @return the AnalyticsConfiguration object itself. + */ + public AnalyticsConfiguration withTagFilters(List tagFilters) { + this.tagFilters = tagFilters; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (storageClassAnalysis() != null) { + storageClassAnalysis().validate(); + } + if (tagFilters() != null) { + tagFilters().forEach(e -> e.validate()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("id", this.id); + jsonWriter.writeStringField("prefix", this.prefix); + jsonWriter.writeJsonField("storageClassAnalysis", this.storageClassAnalysis); + jsonWriter.writeArrayField("tagFilters", this.tagFilters, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AnalyticsConfiguration from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AnalyticsConfiguration if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the AnalyticsConfiguration. + */ + public static AnalyticsConfiguration fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AnalyticsConfiguration deserializedAnalyticsConfiguration = new AnalyticsConfiguration(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedAnalyticsConfiguration.id = reader.getString(); + } else if ("prefix".equals(fieldName)) { + deserializedAnalyticsConfiguration.prefix = reader.getString(); + } else if ("storageClassAnalysis".equals(fieldName)) { + deserializedAnalyticsConfiguration.storageClassAnalysis = StorageClassAnalysis.fromJson(reader); + } else if ("tagFilters".equals(fieldName)) { + List tagFilters = reader.readArray(reader1 -> TagFilter.fromJson(reader1)); + deserializedAnalyticsConfiguration.tagFilters = tagFilters; + } else { + reader.skipChildren(); + } + } + + return deserializedAnalyticsConfiguration; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/AnomalyDetection.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/AnomalyDetection.java new file mode 100644 index 000000000000..860fdfe41670 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/AnomalyDetection.java @@ -0,0 +1,127 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of AnomalyDetection. + */ +@Fluent +public final class AnomalyDetection implements JsonSerializable { + /* + *

Indicates whether anomaly mitigation is in progress.

+ */ + private MitigationInEffectEnumValue mitigationInEffect; + + /* + *

The latest anomaly detection result.

+ */ + private AnomalyResultEnumValue result; + + /** + * Creates an instance of AnomalyDetection class. + */ + public AnomalyDetection() { + } + + /** + * Get the mitigationInEffect property: <p>Indicates whether anomaly mitigation is in progress.</p>. + * + * @return the mitigationInEffect value. + */ + public MitigationInEffectEnumValue mitigationInEffect() { + return this.mitigationInEffect; + } + + /** + * Set the mitigationInEffect property: <p>Indicates whether anomaly mitigation is in progress.</p>. + * + * @param mitigationInEffect the mitigationInEffect value to set. + * @return the AnomalyDetection object itself. + */ + public AnomalyDetection withMitigationInEffect(MitigationInEffectEnumValue mitigationInEffect) { + this.mitigationInEffect = mitigationInEffect; + return this; + } + + /** + * Get the result property: <p>The latest anomaly detection result.</p>. + * + * @return the result value. + */ + public AnomalyResultEnumValue result() { + return this.result; + } + + /** + * Set the result property: <p>The latest anomaly detection result.</p>. + * + * @param result the result value to set. + * @return the AnomalyDetection object itself. + */ + public AnomalyDetection withResult(AnomalyResultEnumValue result) { + this.result = result; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (mitigationInEffect() != null) { + mitigationInEffect().validate(); + } + if (result() != null) { + result().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("mitigationInEffect", this.mitigationInEffect); + jsonWriter.writeJsonField("result", this.result); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AnomalyDetection from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AnomalyDetection if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the AnomalyDetection. + */ + public static AnomalyDetection fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AnomalyDetection deserializedAnomalyDetection = new AnomalyDetection(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("mitigationInEffect".equals(fieldName)) { + deserializedAnomalyDetection.mitigationInEffect = MitigationInEffectEnumValue.fromJson(reader); + } else if ("result".equals(fieldName)) { + deserializedAnomalyDetection.result = AnomalyResultEnumValue.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedAnomalyDetection; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/AnomalyResultEnum.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/AnomalyResultEnum.java new file mode 100644 index 000000000000..2dd3e8477805 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/AnomalyResultEnum.java @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * AnomalyResultEnum enum. + */ +public final class AnomalyResultEnum extends ExpandableStringEnum { + /** + * Static value anomalous for AnomalyResultEnum. + */ + public static final AnomalyResultEnum ANOMALOUS = fromString("anomalous"); + + /** + * Static value normal for AnomalyResultEnum. + */ + public static final AnomalyResultEnum NORMAL = fromString("normal"); + + /** + * Creates a new instance of AnomalyResultEnum value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public AnomalyResultEnum() { + } + + /** + * Creates or finds a AnomalyResultEnum from its string representation. + * + * @param name a name to look for. + * @return the corresponding AnomalyResultEnum. + */ + public static AnomalyResultEnum fromString(String name) { + return fromString(name, AnomalyResultEnum.class); + } + + /** + * Gets known AnomalyResultEnum values. + * + * @return known AnomalyResultEnum values. + */ + public static Collection values() { + return values(AnomalyResultEnum.class); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/AnomalyResultEnumValue.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/AnomalyResultEnumValue.java new file mode 100644 index 000000000000..703740d4424b --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/AnomalyResultEnumValue.java @@ -0,0 +1,93 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of AnomalyResultEnumEnumValue. + */ +@Fluent +public final class AnomalyResultEnumValue implements JsonSerializable { + /* + * Property value + */ + private AnomalyResultEnum value; + + /** + * Creates an instance of AnomalyResultEnumValue class. + */ + public AnomalyResultEnumValue() { + } + + /** + * Get the value property: Property value. + * + * @return the value value. + */ + public AnomalyResultEnum value() { + return this.value; + } + + /** + * Set the value property: Property value. + * + * @param value the value value to set. + * @return the AnomalyResultEnumValue object itself. + */ + public AnomalyResultEnumValue withValue(AnomalyResultEnum value) { + this.value = value; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("value", this.value == null ? null : this.value.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AnomalyResultEnumValue from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AnomalyResultEnumValue if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the AnomalyResultEnumValue. + */ + public static AnomalyResultEnumValue fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AnomalyResultEnumValue deserializedAnomalyResultEnumValue = new AnomalyResultEnumValue(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + deserializedAnomalyResultEnumValue.value = AnomalyResultEnum.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedAnomalyResultEnumValue; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ApiGatewayRestApi.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ApiGatewayRestApi.java new file mode 100644 index 000000000000..fe2af2a619ab --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ApiGatewayRestApi.java @@ -0,0 +1,252 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.awsconnector.fluent.models.ApiGatewayRestApiInner; +import java.util.Map; + +/** + * An immutable client-side representation of ApiGatewayRestApi. + */ +public interface ApiGatewayRestApi { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the location property: The geo-location where the resource lives. + * + * @return the location value. + */ + String location(); + + /** + * Gets the tags property: Resource tags. + * + * @return the tags value. + */ + Map tags(); + + /** + * Gets the properties property: The resource-specific properties for this resource. + * + * @return the properties value. + */ + ApiGatewayRestApiProperties properties(); + + /** + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the region of the resource. + * + * @return the region of the resource. + */ + Region region(); + + /** + * Gets the name of the resource region. + * + * @return the name of the resource region. + */ + String regionName(); + + /** + * Gets the name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + + /** + * Gets the inner com.azure.resourcemanager.awsconnector.fluent.models.ApiGatewayRestApiInner object. + * + * @return the inner object. + */ + ApiGatewayRestApiInner innerModel(); + + /** + * The entirety of the ApiGatewayRestApi definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithLocation, + DefinitionStages.WithResourceGroup, DefinitionStages.WithCreate { + } + + /** + * The ApiGatewayRestApi definition stages. + */ + interface DefinitionStages { + /** + * The first stage of the ApiGatewayRestApi definition. + */ + interface Blank extends WithLocation { + } + + /** + * The stage of the ApiGatewayRestApi definition allowing to specify location. + */ + interface WithLocation { + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithResourceGroup withRegion(Region location); + + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithResourceGroup withRegion(String location); + } + + /** + * The stage of the ApiGatewayRestApi definition allowing to specify parent resource. + */ + interface WithResourceGroup { + /** + * Specifies resourceGroupName. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @return the next definition stage. + */ + WithCreate withExistingResourceGroup(String resourceGroupName); + } + + /** + * The stage of the ApiGatewayRestApi 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.WithProperties { + /** + * Executes the create request. + * + * @return the created resource. + */ + ApiGatewayRestApi create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + ApiGatewayRestApi create(Context context); + } + + /** + * The stage of the ApiGatewayRestApi definition allowing to specify tags. + */ + interface WithTags { + /** + * Specifies the tags property: Resource tags.. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + WithCreate withTags(Map tags); + } + + /** + * The stage of the ApiGatewayRestApi definition allowing to specify properties. + */ + interface WithProperties { + /** + * Specifies the properties property: The resource-specific properties for this resource.. + * + * @param properties The resource-specific properties for this resource. + * @return the next definition stage. + */ + WithCreate withProperties(ApiGatewayRestApiProperties properties); + } + } + + /** + * Begins update for the ApiGatewayRestApi resource. + * + * @return the stage of resource update. + */ + ApiGatewayRestApi.Update update(); + + /** + * The template for ApiGatewayRestApi update. + */ + interface Update extends UpdateStages.WithTags { + /** + * Executes the update request. + * + * @return the updated resource. + */ + ApiGatewayRestApi apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + ApiGatewayRestApi apply(Context context); + } + + /** + * The ApiGatewayRestApi update stages. + */ + interface UpdateStages { + /** + * The stage of the ApiGatewayRestApi update allowing to specify tags. + */ + interface WithTags { + /** + * Specifies the tags property: Resource tags.. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + Update withTags(Map tags); + } + } + + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + ApiGatewayRestApi refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + ApiGatewayRestApi refresh(Context context); +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ApiGatewayRestApiListResult.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ApiGatewayRestApiListResult.java new file mode 100644 index 000000000000..74df99d49f63 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ApiGatewayRestApiListResult.java @@ -0,0 +1,136 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.awsconnector.fluent.models.ApiGatewayRestApiInner; +import java.io.IOException; +import java.util.List; + +/** + * The response of a ApiGatewayRestApi list operation. + */ +@Fluent +public final class ApiGatewayRestApiListResult implements JsonSerializable { + /* + * The ApiGatewayRestApi items on this page + */ + private List value; + + /* + * The link to the next page of items + */ + private String nextLink; + + /** + * Creates an instance of ApiGatewayRestApiListResult class. + */ + public ApiGatewayRestApiListResult() { + } + + /** + * Get the value property: The ApiGatewayRestApi items on this page. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The ApiGatewayRestApi items on this page. + * + * @param value the value value to set. + * @return the ApiGatewayRestApiListResult object itself. + */ + public ApiGatewayRestApiListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The link to the next page of items. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: The link to the next page of items. + * + * @param nextLink the nextLink value to set. + * @return the ApiGatewayRestApiListResult object itself. + */ + public ApiGatewayRestApiListResult withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property value in model ApiGatewayRestApiListResult")); + } else { + value().forEach(e -> e.validate()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(ApiGatewayRestApiListResult.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("nextLink", this.nextLink); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ApiGatewayRestApiListResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ApiGatewayRestApiListResult if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the ApiGatewayRestApiListResult. + */ + public static ApiGatewayRestApiListResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ApiGatewayRestApiListResult deserializedApiGatewayRestApiListResult = new ApiGatewayRestApiListResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> ApiGatewayRestApiInner.fromJson(reader1)); + deserializedApiGatewayRestApiListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedApiGatewayRestApiListResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedApiGatewayRestApiListResult; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ApiGatewayRestApiProperties.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ApiGatewayRestApiProperties.java new file mode 100644 index 000000000000..a21baaeaab2d --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ApiGatewayRestApiProperties.java @@ -0,0 +1,312 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.Map; + +/** + * Definition of ApiGatewayRestApi. + */ +@Fluent +public final class ApiGatewayRestApiProperties implements JsonSerializable { + /* + * AWS Properties + */ + private AwsApiGatewayRestApiProperties awsProperties; + + /* + * Public Cloud Connectors Resource ID + */ + private String publicCloudConnectorsResourceId; + + /* + * AWS Account ID + */ + private String awsAccountId; + + /* + * Amazon Resource Name (ARN) + */ + private String arn; + + /* + * Public Cloud Resource Name + */ + private String publicCloudResourceName; + + /* + * AWS Source Schema + */ + private String awsSourceSchema; + + /* + * AWS Region + */ + private String awsRegion; + + /* + * AWS Tags + */ + private Map awsTags; + + /* + * The status of the last operation. + */ + private ProvisioningState provisioningState; + + /** + * Creates an instance of ApiGatewayRestApiProperties class. + */ + public ApiGatewayRestApiProperties() { + } + + /** + * Get the awsProperties property: AWS Properties. + * + * @return the awsProperties value. + */ + public AwsApiGatewayRestApiProperties awsProperties() { + return this.awsProperties; + } + + /** + * Set the awsProperties property: AWS Properties. + * + * @param awsProperties the awsProperties value to set. + * @return the ApiGatewayRestApiProperties object itself. + */ + public ApiGatewayRestApiProperties withAwsProperties(AwsApiGatewayRestApiProperties awsProperties) { + this.awsProperties = awsProperties; + return this; + } + + /** + * Get the publicCloudConnectorsResourceId property: Public Cloud Connectors Resource ID. + * + * @return the publicCloudConnectorsResourceId value. + */ + public String publicCloudConnectorsResourceId() { + return this.publicCloudConnectorsResourceId; + } + + /** + * Set the publicCloudConnectorsResourceId property: Public Cloud Connectors Resource ID. + * + * @param publicCloudConnectorsResourceId the publicCloudConnectorsResourceId value to set. + * @return the ApiGatewayRestApiProperties object itself. + */ + public ApiGatewayRestApiProperties withPublicCloudConnectorsResourceId(String publicCloudConnectorsResourceId) { + this.publicCloudConnectorsResourceId = publicCloudConnectorsResourceId; + return this; + } + + /** + * Get the awsAccountId property: AWS Account ID. + * + * @return the awsAccountId value. + */ + public String awsAccountId() { + return this.awsAccountId; + } + + /** + * Set the awsAccountId property: AWS Account ID. + * + * @param awsAccountId the awsAccountId value to set. + * @return the ApiGatewayRestApiProperties object itself. + */ + public ApiGatewayRestApiProperties withAwsAccountId(String awsAccountId) { + this.awsAccountId = awsAccountId; + return this; + } + + /** + * Get the arn property: Amazon Resource Name (ARN). + * + * @return the arn value. + */ + public String arn() { + return this.arn; + } + + /** + * Set the arn property: Amazon Resource Name (ARN). + * + * @param arn the arn value to set. + * @return the ApiGatewayRestApiProperties object itself. + */ + public ApiGatewayRestApiProperties withArn(String arn) { + this.arn = arn; + return this; + } + + /** + * Get the publicCloudResourceName property: Public Cloud Resource Name. + * + * @return the publicCloudResourceName value. + */ + public String publicCloudResourceName() { + return this.publicCloudResourceName; + } + + /** + * Set the publicCloudResourceName property: Public Cloud Resource Name. + * + * @param publicCloudResourceName the publicCloudResourceName value to set. + * @return the ApiGatewayRestApiProperties object itself. + */ + public ApiGatewayRestApiProperties withPublicCloudResourceName(String publicCloudResourceName) { + this.publicCloudResourceName = publicCloudResourceName; + return this; + } + + /** + * Get the awsSourceSchema property: AWS Source Schema. + * + * @return the awsSourceSchema value. + */ + public String awsSourceSchema() { + return this.awsSourceSchema; + } + + /** + * Set the awsSourceSchema property: AWS Source Schema. + * + * @param awsSourceSchema the awsSourceSchema value to set. + * @return the ApiGatewayRestApiProperties object itself. + */ + public ApiGatewayRestApiProperties withAwsSourceSchema(String awsSourceSchema) { + this.awsSourceSchema = awsSourceSchema; + return this; + } + + /** + * Get the awsRegion property: AWS Region. + * + * @return the awsRegion value. + */ + public String awsRegion() { + return this.awsRegion; + } + + /** + * Set the awsRegion property: AWS Region. + * + * @param awsRegion the awsRegion value to set. + * @return the ApiGatewayRestApiProperties object itself. + */ + public ApiGatewayRestApiProperties withAwsRegion(String awsRegion) { + this.awsRegion = awsRegion; + return this; + } + + /** + * Get the awsTags property: AWS Tags. + * + * @return the awsTags value. + */ + public Map awsTags() { + return this.awsTags; + } + + /** + * Set the awsTags property: AWS Tags. + * + * @param awsTags the awsTags value to set. + * @return the ApiGatewayRestApiProperties object itself. + */ + public ApiGatewayRestApiProperties withAwsTags(Map awsTags) { + this.awsTags = awsTags; + return this; + } + + /** + * Get the provisioningState property: The status of the last operation. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (awsProperties() != null) { + awsProperties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("awsProperties", this.awsProperties); + jsonWriter.writeStringField("publicCloudConnectorsResourceId", this.publicCloudConnectorsResourceId); + jsonWriter.writeStringField("awsAccountId", this.awsAccountId); + jsonWriter.writeStringField("arn", this.arn); + jsonWriter.writeStringField("publicCloudResourceName", this.publicCloudResourceName); + jsonWriter.writeStringField("awsSourceSchema", this.awsSourceSchema); + jsonWriter.writeStringField("awsRegion", this.awsRegion); + jsonWriter.writeMapField("awsTags", this.awsTags, (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ApiGatewayRestApiProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ApiGatewayRestApiProperties if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ApiGatewayRestApiProperties. + */ + public static ApiGatewayRestApiProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ApiGatewayRestApiProperties deserializedApiGatewayRestApiProperties = new ApiGatewayRestApiProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("awsProperties".equals(fieldName)) { + deserializedApiGatewayRestApiProperties.awsProperties + = AwsApiGatewayRestApiProperties.fromJson(reader); + } else if ("publicCloudConnectorsResourceId".equals(fieldName)) { + deserializedApiGatewayRestApiProperties.publicCloudConnectorsResourceId = reader.getString(); + } else if ("awsAccountId".equals(fieldName)) { + deserializedApiGatewayRestApiProperties.awsAccountId = reader.getString(); + } else if ("arn".equals(fieldName)) { + deserializedApiGatewayRestApiProperties.arn = reader.getString(); + } else if ("publicCloudResourceName".equals(fieldName)) { + deserializedApiGatewayRestApiProperties.publicCloudResourceName = reader.getString(); + } else if ("awsSourceSchema".equals(fieldName)) { + deserializedApiGatewayRestApiProperties.awsSourceSchema = reader.getString(); + } else if ("awsRegion".equals(fieldName)) { + deserializedApiGatewayRestApiProperties.awsRegion = reader.getString(); + } else if ("awsTags".equals(fieldName)) { + Map awsTags = reader.readMap(reader1 -> reader1.getString()); + deserializedApiGatewayRestApiProperties.awsTags = awsTags; + } else if ("provisioningState".equals(fieldName)) { + deserializedApiGatewayRestApiProperties.provisioningState + = ProvisioningState.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedApiGatewayRestApiProperties; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ApiGatewayRestApiTagsUpdate.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ApiGatewayRestApiTagsUpdate.java new file mode 100644 index 000000000000..346c4280f292 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ApiGatewayRestApiTagsUpdate.java @@ -0,0 +1,95 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.Map; + +/** + * The type used for updating tags in ApiGatewayRestApi resources. + */ +@Fluent +public final class ApiGatewayRestApiTagsUpdate implements JsonSerializable { + /* + * Resource tags. + */ + private Map tags; + + /** + * Creates an instance of ApiGatewayRestApiTagsUpdate class. + */ + public ApiGatewayRestApiTagsUpdate() { + } + + /** + * Get the tags property: Resource tags. + * + * @return the tags value. + */ + public Map tags() { + return this.tags; + } + + /** + * Set the tags property: Resource tags. + * + * @param tags the tags value to set. + * @return the ApiGatewayRestApiTagsUpdate object itself. + */ + public ApiGatewayRestApiTagsUpdate withTags(Map tags) { + this.tags = tags; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeMapField("tags", this.tags, (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ApiGatewayRestApiTagsUpdate from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ApiGatewayRestApiTagsUpdate if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ApiGatewayRestApiTagsUpdate. + */ + public static ApiGatewayRestApiTagsUpdate fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ApiGatewayRestApiTagsUpdate deserializedApiGatewayRestApiTagsUpdate = new ApiGatewayRestApiTagsUpdate(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedApiGatewayRestApiTagsUpdate.tags = tags; + } else { + reader.skipChildren(); + } + } + + return deserializedApiGatewayRestApiTagsUpdate; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ApiGatewayRestApis.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ApiGatewayRestApis.java new file mode 100644 index 000000000000..3d248b57a3ca --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ApiGatewayRestApis.java @@ -0,0 +1,157 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** + * Resource collection API of ApiGatewayRestApis. + */ +public interface ApiGatewayRestApis { + /** + * List ApiGatewayRestApi resources by subscription ID. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a ApiGatewayRestApi list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable list(); + + /** + * List ApiGatewayRestApi resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a ApiGatewayRestApi list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable list(Context context); + + /** + * List ApiGatewayRestApi resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a ApiGatewayRestApi list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * List ApiGatewayRestApi resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a ApiGatewayRestApi list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Get a ApiGatewayRestApi. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ApiGatewayRestApi. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a ApiGatewayRestApi along with {@link Response}. + */ + Response getByResourceGroupWithResponse(String resourceGroupName, String name, Context context); + + /** + * Get a ApiGatewayRestApi. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ApiGatewayRestApi. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a ApiGatewayRestApi. + */ + ApiGatewayRestApi getByResourceGroup(String resourceGroupName, String name); + + /** + * Delete a ApiGatewayRestApi. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ApiGatewayRestApi. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByResourceGroup(String resourceGroupName, String name); + + /** + * Delete a ApiGatewayRestApi. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ApiGatewayRestApi. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String name, Context context); + + /** + * Get a ApiGatewayRestApi. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a ApiGatewayRestApi along with {@link Response}. + */ + ApiGatewayRestApi getById(String id); + + /** + * Get a ApiGatewayRestApi. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a ApiGatewayRestApi along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Delete a ApiGatewayRestApi. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteById(String id); + + /** + * Delete a ApiGatewayRestApi. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new ApiGatewayRestApi resource. + * + * @param name resource name. + * @return the first stage of the new ApiGatewayRestApi definition. + */ + ApiGatewayRestApi.DefinitionStages.Blank define(String name); +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ApiGatewayStage.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ApiGatewayStage.java new file mode 100644 index 000000000000..3cfba49f8eae --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ApiGatewayStage.java @@ -0,0 +1,252 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.awsconnector.fluent.models.ApiGatewayStageInner; +import java.util.Map; + +/** + * An immutable client-side representation of ApiGatewayStage. + */ +public interface ApiGatewayStage { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the location property: The geo-location where the resource lives. + * + * @return the location value. + */ + String location(); + + /** + * Gets the tags property: Resource tags. + * + * @return the tags value. + */ + Map tags(); + + /** + * Gets the properties property: The resource-specific properties for this resource. + * + * @return the properties value. + */ + ApiGatewayStageProperties properties(); + + /** + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the region of the resource. + * + * @return the region of the resource. + */ + Region region(); + + /** + * Gets the name of the resource region. + * + * @return the name of the resource region. + */ + String regionName(); + + /** + * Gets the name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + + /** + * Gets the inner com.azure.resourcemanager.awsconnector.fluent.models.ApiGatewayStageInner object. + * + * @return the inner object. + */ + ApiGatewayStageInner innerModel(); + + /** + * The entirety of the ApiGatewayStage definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithLocation, + DefinitionStages.WithResourceGroup, DefinitionStages.WithCreate { + } + + /** + * The ApiGatewayStage definition stages. + */ + interface DefinitionStages { + /** + * The first stage of the ApiGatewayStage definition. + */ + interface Blank extends WithLocation { + } + + /** + * The stage of the ApiGatewayStage definition allowing to specify location. + */ + interface WithLocation { + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithResourceGroup withRegion(Region location); + + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithResourceGroup withRegion(String location); + } + + /** + * The stage of the ApiGatewayStage definition allowing to specify parent resource. + */ + interface WithResourceGroup { + /** + * Specifies resourceGroupName. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @return the next definition stage. + */ + WithCreate withExistingResourceGroup(String resourceGroupName); + } + + /** + * The stage of the ApiGatewayStage 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.WithProperties { + /** + * Executes the create request. + * + * @return the created resource. + */ + ApiGatewayStage create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + ApiGatewayStage create(Context context); + } + + /** + * The stage of the ApiGatewayStage definition allowing to specify tags. + */ + interface WithTags { + /** + * Specifies the tags property: Resource tags.. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + WithCreate withTags(Map tags); + } + + /** + * The stage of the ApiGatewayStage definition allowing to specify properties. + */ + interface WithProperties { + /** + * Specifies the properties property: The resource-specific properties for this resource.. + * + * @param properties The resource-specific properties for this resource. + * @return the next definition stage. + */ + WithCreate withProperties(ApiGatewayStageProperties properties); + } + } + + /** + * Begins update for the ApiGatewayStage resource. + * + * @return the stage of resource update. + */ + ApiGatewayStage.Update update(); + + /** + * The template for ApiGatewayStage update. + */ + interface Update extends UpdateStages.WithTags { + /** + * Executes the update request. + * + * @return the updated resource. + */ + ApiGatewayStage apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + ApiGatewayStage apply(Context context); + } + + /** + * The ApiGatewayStage update stages. + */ + interface UpdateStages { + /** + * The stage of the ApiGatewayStage update allowing to specify tags. + */ + interface WithTags { + /** + * Specifies the tags property: Resource tags.. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + Update withTags(Map tags); + } + } + + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + ApiGatewayStage refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + ApiGatewayStage refresh(Context context); +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ApiGatewayStageListResult.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ApiGatewayStageListResult.java new file mode 100644 index 000000000000..04c6e54d296a --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ApiGatewayStageListResult.java @@ -0,0 +1,136 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.awsconnector.fluent.models.ApiGatewayStageInner; +import java.io.IOException; +import java.util.List; + +/** + * The response of a ApiGatewayStage list operation. + */ +@Fluent +public final class ApiGatewayStageListResult implements JsonSerializable { + /* + * The ApiGatewayStage items on this page + */ + private List value; + + /* + * The link to the next page of items + */ + private String nextLink; + + /** + * Creates an instance of ApiGatewayStageListResult class. + */ + public ApiGatewayStageListResult() { + } + + /** + * Get the value property: The ApiGatewayStage items on this page. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The ApiGatewayStage items on this page. + * + * @param value the value value to set. + * @return the ApiGatewayStageListResult object itself. + */ + public ApiGatewayStageListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The link to the next page of items. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: The link to the next page of items. + * + * @param nextLink the nextLink value to set. + * @return the ApiGatewayStageListResult object itself. + */ + public ApiGatewayStageListResult withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() == null) { + throw LOGGER.atError() + .log( + new IllegalArgumentException("Missing required property value in model ApiGatewayStageListResult")); + } else { + value().forEach(e -> e.validate()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(ApiGatewayStageListResult.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("nextLink", this.nextLink); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ApiGatewayStageListResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ApiGatewayStageListResult if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the ApiGatewayStageListResult. + */ + public static ApiGatewayStageListResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ApiGatewayStageListResult deserializedApiGatewayStageListResult = new ApiGatewayStageListResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> ApiGatewayStageInner.fromJson(reader1)); + deserializedApiGatewayStageListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedApiGatewayStageListResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedApiGatewayStageListResult; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ApiGatewayStageProperties.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ApiGatewayStageProperties.java new file mode 100644 index 000000000000..19fce5b36c72 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ApiGatewayStageProperties.java @@ -0,0 +1,311 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.Map; + +/** + * Definition of ApiGatewayStage. + */ +@Fluent +public final class ApiGatewayStageProperties implements JsonSerializable { + /* + * AWS Properties + */ + private AwsApiGatewayStageProperties awsProperties; + + /* + * Public Cloud Connectors Resource ID + */ + private String publicCloudConnectorsResourceId; + + /* + * AWS Account ID + */ + private String awsAccountId; + + /* + * Amazon Resource Name (ARN) + */ + private String arn; + + /* + * Public Cloud Resource Name + */ + private String publicCloudResourceName; + + /* + * AWS Source Schema + */ + private String awsSourceSchema; + + /* + * AWS Region + */ + private String awsRegion; + + /* + * AWS Tags + */ + private Map awsTags; + + /* + * The status of the last operation. + */ + private ProvisioningState provisioningState; + + /** + * Creates an instance of ApiGatewayStageProperties class. + */ + public ApiGatewayStageProperties() { + } + + /** + * Get the awsProperties property: AWS Properties. + * + * @return the awsProperties value. + */ + public AwsApiGatewayStageProperties awsProperties() { + return this.awsProperties; + } + + /** + * Set the awsProperties property: AWS Properties. + * + * @param awsProperties the awsProperties value to set. + * @return the ApiGatewayStageProperties object itself. + */ + public ApiGatewayStageProperties withAwsProperties(AwsApiGatewayStageProperties awsProperties) { + this.awsProperties = awsProperties; + return this; + } + + /** + * Get the publicCloudConnectorsResourceId property: Public Cloud Connectors Resource ID. + * + * @return the publicCloudConnectorsResourceId value. + */ + public String publicCloudConnectorsResourceId() { + return this.publicCloudConnectorsResourceId; + } + + /** + * Set the publicCloudConnectorsResourceId property: Public Cloud Connectors Resource ID. + * + * @param publicCloudConnectorsResourceId the publicCloudConnectorsResourceId value to set. + * @return the ApiGatewayStageProperties object itself. + */ + public ApiGatewayStageProperties withPublicCloudConnectorsResourceId(String publicCloudConnectorsResourceId) { + this.publicCloudConnectorsResourceId = publicCloudConnectorsResourceId; + return this; + } + + /** + * Get the awsAccountId property: AWS Account ID. + * + * @return the awsAccountId value. + */ + public String awsAccountId() { + return this.awsAccountId; + } + + /** + * Set the awsAccountId property: AWS Account ID. + * + * @param awsAccountId the awsAccountId value to set. + * @return the ApiGatewayStageProperties object itself. + */ + public ApiGatewayStageProperties withAwsAccountId(String awsAccountId) { + this.awsAccountId = awsAccountId; + return this; + } + + /** + * Get the arn property: Amazon Resource Name (ARN). + * + * @return the arn value. + */ + public String arn() { + return this.arn; + } + + /** + * Set the arn property: Amazon Resource Name (ARN). + * + * @param arn the arn value to set. + * @return the ApiGatewayStageProperties object itself. + */ + public ApiGatewayStageProperties withArn(String arn) { + this.arn = arn; + return this; + } + + /** + * Get the publicCloudResourceName property: Public Cloud Resource Name. + * + * @return the publicCloudResourceName value. + */ + public String publicCloudResourceName() { + return this.publicCloudResourceName; + } + + /** + * Set the publicCloudResourceName property: Public Cloud Resource Name. + * + * @param publicCloudResourceName the publicCloudResourceName value to set. + * @return the ApiGatewayStageProperties object itself. + */ + public ApiGatewayStageProperties withPublicCloudResourceName(String publicCloudResourceName) { + this.publicCloudResourceName = publicCloudResourceName; + return this; + } + + /** + * Get the awsSourceSchema property: AWS Source Schema. + * + * @return the awsSourceSchema value. + */ + public String awsSourceSchema() { + return this.awsSourceSchema; + } + + /** + * Set the awsSourceSchema property: AWS Source Schema. + * + * @param awsSourceSchema the awsSourceSchema value to set. + * @return the ApiGatewayStageProperties object itself. + */ + public ApiGatewayStageProperties withAwsSourceSchema(String awsSourceSchema) { + this.awsSourceSchema = awsSourceSchema; + return this; + } + + /** + * Get the awsRegion property: AWS Region. + * + * @return the awsRegion value. + */ + public String awsRegion() { + return this.awsRegion; + } + + /** + * Set the awsRegion property: AWS Region. + * + * @param awsRegion the awsRegion value to set. + * @return the ApiGatewayStageProperties object itself. + */ + public ApiGatewayStageProperties withAwsRegion(String awsRegion) { + this.awsRegion = awsRegion; + return this; + } + + /** + * Get the awsTags property: AWS Tags. + * + * @return the awsTags value. + */ + public Map awsTags() { + return this.awsTags; + } + + /** + * Set the awsTags property: AWS Tags. + * + * @param awsTags the awsTags value to set. + * @return the ApiGatewayStageProperties object itself. + */ + public ApiGatewayStageProperties withAwsTags(Map awsTags) { + this.awsTags = awsTags; + return this; + } + + /** + * Get the provisioningState property: The status of the last operation. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (awsProperties() != null) { + awsProperties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("awsProperties", this.awsProperties); + jsonWriter.writeStringField("publicCloudConnectorsResourceId", this.publicCloudConnectorsResourceId); + jsonWriter.writeStringField("awsAccountId", this.awsAccountId); + jsonWriter.writeStringField("arn", this.arn); + jsonWriter.writeStringField("publicCloudResourceName", this.publicCloudResourceName); + jsonWriter.writeStringField("awsSourceSchema", this.awsSourceSchema); + jsonWriter.writeStringField("awsRegion", this.awsRegion); + jsonWriter.writeMapField("awsTags", this.awsTags, (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ApiGatewayStageProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ApiGatewayStageProperties if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ApiGatewayStageProperties. + */ + public static ApiGatewayStageProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ApiGatewayStageProperties deserializedApiGatewayStageProperties = new ApiGatewayStageProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("awsProperties".equals(fieldName)) { + deserializedApiGatewayStageProperties.awsProperties = AwsApiGatewayStageProperties.fromJson(reader); + } else if ("publicCloudConnectorsResourceId".equals(fieldName)) { + deserializedApiGatewayStageProperties.publicCloudConnectorsResourceId = reader.getString(); + } else if ("awsAccountId".equals(fieldName)) { + deserializedApiGatewayStageProperties.awsAccountId = reader.getString(); + } else if ("arn".equals(fieldName)) { + deserializedApiGatewayStageProperties.arn = reader.getString(); + } else if ("publicCloudResourceName".equals(fieldName)) { + deserializedApiGatewayStageProperties.publicCloudResourceName = reader.getString(); + } else if ("awsSourceSchema".equals(fieldName)) { + deserializedApiGatewayStageProperties.awsSourceSchema = reader.getString(); + } else if ("awsRegion".equals(fieldName)) { + deserializedApiGatewayStageProperties.awsRegion = reader.getString(); + } else if ("awsTags".equals(fieldName)) { + Map awsTags = reader.readMap(reader1 -> reader1.getString()); + deserializedApiGatewayStageProperties.awsTags = awsTags; + } else if ("provisioningState".equals(fieldName)) { + deserializedApiGatewayStageProperties.provisioningState + = ProvisioningState.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedApiGatewayStageProperties; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ApiGatewayStageTagsUpdate.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ApiGatewayStageTagsUpdate.java new file mode 100644 index 000000000000..c1d1f88f40cb --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ApiGatewayStageTagsUpdate.java @@ -0,0 +1,95 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.Map; + +/** + * The type used for updating tags in ApiGatewayStage resources. + */ +@Fluent +public final class ApiGatewayStageTagsUpdate implements JsonSerializable { + /* + * Resource tags. + */ + private Map tags; + + /** + * Creates an instance of ApiGatewayStageTagsUpdate class. + */ + public ApiGatewayStageTagsUpdate() { + } + + /** + * Get the tags property: Resource tags. + * + * @return the tags value. + */ + public Map tags() { + return this.tags; + } + + /** + * Set the tags property: Resource tags. + * + * @param tags the tags value to set. + * @return the ApiGatewayStageTagsUpdate object itself. + */ + public ApiGatewayStageTagsUpdate withTags(Map tags) { + this.tags = tags; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeMapField("tags", this.tags, (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ApiGatewayStageTagsUpdate from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ApiGatewayStageTagsUpdate if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ApiGatewayStageTagsUpdate. + */ + public static ApiGatewayStageTagsUpdate fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ApiGatewayStageTagsUpdate deserializedApiGatewayStageTagsUpdate = new ApiGatewayStageTagsUpdate(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedApiGatewayStageTagsUpdate.tags = tags; + } else { + reader.skipChildren(); + } + } + + return deserializedApiGatewayStageTagsUpdate; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ApiGatewayStages.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ApiGatewayStages.java new file mode 100644 index 000000000000..1b2254aa932e --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ApiGatewayStages.java @@ -0,0 +1,157 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** + * Resource collection API of ApiGatewayStages. + */ +public interface ApiGatewayStages { + /** + * List ApiGatewayStage resources by subscription ID. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a ApiGatewayStage list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable list(); + + /** + * List ApiGatewayStage resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a ApiGatewayStage list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable list(Context context); + + /** + * List ApiGatewayStage resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a ApiGatewayStage list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * List ApiGatewayStage resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a ApiGatewayStage list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Get a ApiGatewayStage. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ApiGatewayStage. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a ApiGatewayStage along with {@link Response}. + */ + Response getByResourceGroupWithResponse(String resourceGroupName, String name, Context context); + + /** + * Get a ApiGatewayStage. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ApiGatewayStage. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a ApiGatewayStage. + */ + ApiGatewayStage getByResourceGroup(String resourceGroupName, String name); + + /** + * Delete a ApiGatewayStage. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ApiGatewayStage. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByResourceGroup(String resourceGroupName, String name); + + /** + * Delete a ApiGatewayStage. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ApiGatewayStage. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String name, Context context); + + /** + * Get a ApiGatewayStage. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a ApiGatewayStage along with {@link Response}. + */ + ApiGatewayStage getById(String id); + + /** + * Get a ApiGatewayStage. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a ApiGatewayStage along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Delete a ApiGatewayStage. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteById(String id); + + /** + * Delete a ApiGatewayStage. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new ApiGatewayStage resource. + * + * @param name resource name. + * @return the first stage of the new ApiGatewayStage definition. + */ + ApiGatewayStage.DefinitionStages.Blank define(String name); +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/AppSyncGraphqlApi.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/AppSyncGraphqlApi.java new file mode 100644 index 000000000000..4bd85a551b6b --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/AppSyncGraphqlApi.java @@ -0,0 +1,252 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.awsconnector.fluent.models.AppSyncGraphqlApiInner; +import java.util.Map; + +/** + * An immutable client-side representation of AppSyncGraphqlApi. + */ +public interface AppSyncGraphqlApi { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the location property: The geo-location where the resource lives. + * + * @return the location value. + */ + String location(); + + /** + * Gets the tags property: Resource tags. + * + * @return the tags value. + */ + Map tags(); + + /** + * Gets the properties property: The resource-specific properties for this resource. + * + * @return the properties value. + */ + AppSyncGraphqlApiProperties properties(); + + /** + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the region of the resource. + * + * @return the region of the resource. + */ + Region region(); + + /** + * Gets the name of the resource region. + * + * @return the name of the resource region. + */ + String regionName(); + + /** + * Gets the name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + + /** + * Gets the inner com.azure.resourcemanager.awsconnector.fluent.models.AppSyncGraphqlApiInner object. + * + * @return the inner object. + */ + AppSyncGraphqlApiInner innerModel(); + + /** + * The entirety of the AppSyncGraphqlApi definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithLocation, + DefinitionStages.WithResourceGroup, DefinitionStages.WithCreate { + } + + /** + * The AppSyncGraphqlApi definition stages. + */ + interface DefinitionStages { + /** + * The first stage of the AppSyncGraphqlApi definition. + */ + interface Blank extends WithLocation { + } + + /** + * The stage of the AppSyncGraphqlApi definition allowing to specify location. + */ + interface WithLocation { + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithResourceGroup withRegion(Region location); + + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithResourceGroup withRegion(String location); + } + + /** + * The stage of the AppSyncGraphqlApi definition allowing to specify parent resource. + */ + interface WithResourceGroup { + /** + * Specifies resourceGroupName. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @return the next definition stage. + */ + WithCreate withExistingResourceGroup(String resourceGroupName); + } + + /** + * The stage of the AppSyncGraphqlApi 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.WithProperties { + /** + * Executes the create request. + * + * @return the created resource. + */ + AppSyncGraphqlApi create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + AppSyncGraphqlApi create(Context context); + } + + /** + * The stage of the AppSyncGraphqlApi definition allowing to specify tags. + */ + interface WithTags { + /** + * Specifies the tags property: Resource tags.. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + WithCreate withTags(Map tags); + } + + /** + * The stage of the AppSyncGraphqlApi definition allowing to specify properties. + */ + interface WithProperties { + /** + * Specifies the properties property: The resource-specific properties for this resource.. + * + * @param properties The resource-specific properties for this resource. + * @return the next definition stage. + */ + WithCreate withProperties(AppSyncGraphqlApiProperties properties); + } + } + + /** + * Begins update for the AppSyncGraphqlApi resource. + * + * @return the stage of resource update. + */ + AppSyncGraphqlApi.Update update(); + + /** + * The template for AppSyncGraphqlApi update. + */ + interface Update extends UpdateStages.WithTags { + /** + * Executes the update request. + * + * @return the updated resource. + */ + AppSyncGraphqlApi apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + AppSyncGraphqlApi apply(Context context); + } + + /** + * The AppSyncGraphqlApi update stages. + */ + interface UpdateStages { + /** + * The stage of the AppSyncGraphqlApi update allowing to specify tags. + */ + interface WithTags { + /** + * Specifies the tags property: Resource tags.. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + Update withTags(Map tags); + } + } + + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + AppSyncGraphqlApi refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + AppSyncGraphqlApi refresh(Context context); +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/AppSyncGraphqlApiListResult.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/AppSyncGraphqlApiListResult.java new file mode 100644 index 000000000000..3fe3687ee051 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/AppSyncGraphqlApiListResult.java @@ -0,0 +1,136 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.awsconnector.fluent.models.AppSyncGraphqlApiInner; +import java.io.IOException; +import java.util.List; + +/** + * The response of a AppSyncGraphqlApi list operation. + */ +@Fluent +public final class AppSyncGraphqlApiListResult implements JsonSerializable { + /* + * The AppSyncGraphqlApi items on this page + */ + private List value; + + /* + * The link to the next page of items + */ + private String nextLink; + + /** + * Creates an instance of AppSyncGraphqlApiListResult class. + */ + public AppSyncGraphqlApiListResult() { + } + + /** + * Get the value property: The AppSyncGraphqlApi items on this page. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The AppSyncGraphqlApi items on this page. + * + * @param value the value value to set. + * @return the AppSyncGraphqlApiListResult object itself. + */ + public AppSyncGraphqlApiListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The link to the next page of items. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: The link to the next page of items. + * + * @param nextLink the nextLink value to set. + * @return the AppSyncGraphqlApiListResult object itself. + */ + public AppSyncGraphqlApiListResult withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property value in model AppSyncGraphqlApiListResult")); + } else { + value().forEach(e -> e.validate()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(AppSyncGraphqlApiListResult.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("nextLink", this.nextLink); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AppSyncGraphqlApiListResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AppSyncGraphqlApiListResult if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the AppSyncGraphqlApiListResult. + */ + public static AppSyncGraphqlApiListResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AppSyncGraphqlApiListResult deserializedAppSyncGraphqlApiListResult = new AppSyncGraphqlApiListResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> AppSyncGraphqlApiInner.fromJson(reader1)); + deserializedAppSyncGraphqlApiListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedAppSyncGraphqlApiListResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedAppSyncGraphqlApiListResult; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/AppSyncGraphqlApiProperties.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/AppSyncGraphqlApiProperties.java new file mode 100644 index 000000000000..64d4321dcbd1 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/AppSyncGraphqlApiProperties.java @@ -0,0 +1,312 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.Map; + +/** + * Definition of AppSyncGraphqlApi. + */ +@Fluent +public final class AppSyncGraphqlApiProperties implements JsonSerializable { + /* + * AWS Properties + */ + private AwsAppSyncGraphqlApiProperties awsProperties; + + /* + * Public Cloud Connectors Resource ID + */ + private String publicCloudConnectorsResourceId; + + /* + * AWS Account ID + */ + private String awsAccountId; + + /* + * Amazon Resource Name (ARN) + */ + private String arn; + + /* + * Public Cloud Resource Name + */ + private String publicCloudResourceName; + + /* + * AWS Source Schema + */ + private String awsSourceSchema; + + /* + * AWS Region + */ + private String awsRegion; + + /* + * AWS Tags + */ + private Map awsTags; + + /* + * The status of the last operation. + */ + private ProvisioningState provisioningState; + + /** + * Creates an instance of AppSyncGraphqlApiProperties class. + */ + public AppSyncGraphqlApiProperties() { + } + + /** + * Get the awsProperties property: AWS Properties. + * + * @return the awsProperties value. + */ + public AwsAppSyncGraphqlApiProperties awsProperties() { + return this.awsProperties; + } + + /** + * Set the awsProperties property: AWS Properties. + * + * @param awsProperties the awsProperties value to set. + * @return the AppSyncGraphqlApiProperties object itself. + */ + public AppSyncGraphqlApiProperties withAwsProperties(AwsAppSyncGraphqlApiProperties awsProperties) { + this.awsProperties = awsProperties; + return this; + } + + /** + * Get the publicCloudConnectorsResourceId property: Public Cloud Connectors Resource ID. + * + * @return the publicCloudConnectorsResourceId value. + */ + public String publicCloudConnectorsResourceId() { + return this.publicCloudConnectorsResourceId; + } + + /** + * Set the publicCloudConnectorsResourceId property: Public Cloud Connectors Resource ID. + * + * @param publicCloudConnectorsResourceId the publicCloudConnectorsResourceId value to set. + * @return the AppSyncGraphqlApiProperties object itself. + */ + public AppSyncGraphqlApiProperties withPublicCloudConnectorsResourceId(String publicCloudConnectorsResourceId) { + this.publicCloudConnectorsResourceId = publicCloudConnectorsResourceId; + return this; + } + + /** + * Get the awsAccountId property: AWS Account ID. + * + * @return the awsAccountId value. + */ + public String awsAccountId() { + return this.awsAccountId; + } + + /** + * Set the awsAccountId property: AWS Account ID. + * + * @param awsAccountId the awsAccountId value to set. + * @return the AppSyncGraphqlApiProperties object itself. + */ + public AppSyncGraphqlApiProperties withAwsAccountId(String awsAccountId) { + this.awsAccountId = awsAccountId; + return this; + } + + /** + * Get the arn property: Amazon Resource Name (ARN). + * + * @return the arn value. + */ + public String arn() { + return this.arn; + } + + /** + * Set the arn property: Amazon Resource Name (ARN). + * + * @param arn the arn value to set. + * @return the AppSyncGraphqlApiProperties object itself. + */ + public AppSyncGraphqlApiProperties withArn(String arn) { + this.arn = arn; + return this; + } + + /** + * Get the publicCloudResourceName property: Public Cloud Resource Name. + * + * @return the publicCloudResourceName value. + */ + public String publicCloudResourceName() { + return this.publicCloudResourceName; + } + + /** + * Set the publicCloudResourceName property: Public Cloud Resource Name. + * + * @param publicCloudResourceName the publicCloudResourceName value to set. + * @return the AppSyncGraphqlApiProperties object itself. + */ + public AppSyncGraphqlApiProperties withPublicCloudResourceName(String publicCloudResourceName) { + this.publicCloudResourceName = publicCloudResourceName; + return this; + } + + /** + * Get the awsSourceSchema property: AWS Source Schema. + * + * @return the awsSourceSchema value. + */ + public String awsSourceSchema() { + return this.awsSourceSchema; + } + + /** + * Set the awsSourceSchema property: AWS Source Schema. + * + * @param awsSourceSchema the awsSourceSchema value to set. + * @return the AppSyncGraphqlApiProperties object itself. + */ + public AppSyncGraphqlApiProperties withAwsSourceSchema(String awsSourceSchema) { + this.awsSourceSchema = awsSourceSchema; + return this; + } + + /** + * Get the awsRegion property: AWS Region. + * + * @return the awsRegion value. + */ + public String awsRegion() { + return this.awsRegion; + } + + /** + * Set the awsRegion property: AWS Region. + * + * @param awsRegion the awsRegion value to set. + * @return the AppSyncGraphqlApiProperties object itself. + */ + public AppSyncGraphqlApiProperties withAwsRegion(String awsRegion) { + this.awsRegion = awsRegion; + return this; + } + + /** + * Get the awsTags property: AWS Tags. + * + * @return the awsTags value. + */ + public Map awsTags() { + return this.awsTags; + } + + /** + * Set the awsTags property: AWS Tags. + * + * @param awsTags the awsTags value to set. + * @return the AppSyncGraphqlApiProperties object itself. + */ + public AppSyncGraphqlApiProperties withAwsTags(Map awsTags) { + this.awsTags = awsTags; + return this; + } + + /** + * Get the provisioningState property: The status of the last operation. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (awsProperties() != null) { + awsProperties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("awsProperties", this.awsProperties); + jsonWriter.writeStringField("publicCloudConnectorsResourceId", this.publicCloudConnectorsResourceId); + jsonWriter.writeStringField("awsAccountId", this.awsAccountId); + jsonWriter.writeStringField("arn", this.arn); + jsonWriter.writeStringField("publicCloudResourceName", this.publicCloudResourceName); + jsonWriter.writeStringField("awsSourceSchema", this.awsSourceSchema); + jsonWriter.writeStringField("awsRegion", this.awsRegion); + jsonWriter.writeMapField("awsTags", this.awsTags, (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AppSyncGraphqlApiProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AppSyncGraphqlApiProperties if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the AppSyncGraphqlApiProperties. + */ + public static AppSyncGraphqlApiProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AppSyncGraphqlApiProperties deserializedAppSyncGraphqlApiProperties = new AppSyncGraphqlApiProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("awsProperties".equals(fieldName)) { + deserializedAppSyncGraphqlApiProperties.awsProperties + = AwsAppSyncGraphqlApiProperties.fromJson(reader); + } else if ("publicCloudConnectorsResourceId".equals(fieldName)) { + deserializedAppSyncGraphqlApiProperties.publicCloudConnectorsResourceId = reader.getString(); + } else if ("awsAccountId".equals(fieldName)) { + deserializedAppSyncGraphqlApiProperties.awsAccountId = reader.getString(); + } else if ("arn".equals(fieldName)) { + deserializedAppSyncGraphqlApiProperties.arn = reader.getString(); + } else if ("publicCloudResourceName".equals(fieldName)) { + deserializedAppSyncGraphqlApiProperties.publicCloudResourceName = reader.getString(); + } else if ("awsSourceSchema".equals(fieldName)) { + deserializedAppSyncGraphqlApiProperties.awsSourceSchema = reader.getString(); + } else if ("awsRegion".equals(fieldName)) { + deserializedAppSyncGraphqlApiProperties.awsRegion = reader.getString(); + } else if ("awsTags".equals(fieldName)) { + Map awsTags = reader.readMap(reader1 -> reader1.getString()); + deserializedAppSyncGraphqlApiProperties.awsTags = awsTags; + } else if ("provisioningState".equals(fieldName)) { + deserializedAppSyncGraphqlApiProperties.provisioningState + = ProvisioningState.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedAppSyncGraphqlApiProperties; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/AppSyncGraphqlApiTagsUpdate.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/AppSyncGraphqlApiTagsUpdate.java new file mode 100644 index 000000000000..fc2eb7244510 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/AppSyncGraphqlApiTagsUpdate.java @@ -0,0 +1,95 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.Map; + +/** + * The type used for updating tags in AppSyncGraphqlApi resources. + */ +@Fluent +public final class AppSyncGraphqlApiTagsUpdate implements JsonSerializable { + /* + * Resource tags. + */ + private Map tags; + + /** + * Creates an instance of AppSyncGraphqlApiTagsUpdate class. + */ + public AppSyncGraphqlApiTagsUpdate() { + } + + /** + * Get the tags property: Resource tags. + * + * @return the tags value. + */ + public Map tags() { + return this.tags; + } + + /** + * Set the tags property: Resource tags. + * + * @param tags the tags value to set. + * @return the AppSyncGraphqlApiTagsUpdate object itself. + */ + public AppSyncGraphqlApiTagsUpdate withTags(Map tags) { + this.tags = tags; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeMapField("tags", this.tags, (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AppSyncGraphqlApiTagsUpdate from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AppSyncGraphqlApiTagsUpdate if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the AppSyncGraphqlApiTagsUpdate. + */ + public static AppSyncGraphqlApiTagsUpdate fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AppSyncGraphqlApiTagsUpdate deserializedAppSyncGraphqlApiTagsUpdate = new AppSyncGraphqlApiTagsUpdate(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedAppSyncGraphqlApiTagsUpdate.tags = tags; + } else { + reader.skipChildren(); + } + } + + return deserializedAppSyncGraphqlApiTagsUpdate; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/AppSyncGraphqlApis.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/AppSyncGraphqlApis.java new file mode 100644 index 000000000000..5934fab5fe64 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/AppSyncGraphqlApis.java @@ -0,0 +1,157 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** + * Resource collection API of AppSyncGraphqlApis. + */ +public interface AppSyncGraphqlApis { + /** + * List AppSyncGraphqlApi resources by subscription ID. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a AppSyncGraphqlApi list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable list(); + + /** + * List AppSyncGraphqlApi resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a AppSyncGraphqlApi list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable list(Context context); + + /** + * List AppSyncGraphqlApi resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a AppSyncGraphqlApi list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * List AppSyncGraphqlApi resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a AppSyncGraphqlApi list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Get a AppSyncGraphqlApi. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of AppSyncGraphqlApi. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a AppSyncGraphqlApi along with {@link Response}. + */ + Response getByResourceGroupWithResponse(String resourceGroupName, String name, Context context); + + /** + * Get a AppSyncGraphqlApi. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of AppSyncGraphqlApi. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a AppSyncGraphqlApi. + */ + AppSyncGraphqlApi getByResourceGroup(String resourceGroupName, String name); + + /** + * Delete a AppSyncGraphqlApi. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of AppSyncGraphqlApi. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByResourceGroup(String resourceGroupName, String name); + + /** + * Delete a AppSyncGraphqlApi. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of AppSyncGraphqlApi. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String name, Context context); + + /** + * Get a AppSyncGraphqlApi. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a AppSyncGraphqlApi along with {@link Response}. + */ + AppSyncGraphqlApi getById(String id); + + /** + * Get a AppSyncGraphqlApi. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a AppSyncGraphqlApi along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Delete a AppSyncGraphqlApi. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteById(String id); + + /** + * Delete a AppSyncGraphqlApi. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new AppSyncGraphqlApi resource. + * + * @param name resource name. + * @return the first stage of the new AppSyncGraphqlApi definition. + */ + AppSyncGraphqlApi.DefinitionStages.Blank define(String name); +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/AppType.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/AppType.java new file mode 100644 index 000000000000..d60eb64b0e61 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/AppType.java @@ -0,0 +1,66 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * AppType enum. + */ +public final class AppType extends ExpandableStringEnum { + /** + * Static value Canvas for AppType. + */ + public static final AppType CANVAS = fromString("Canvas"); + + /** + * Static value JupyterServer for AppType. + */ + public static final AppType JUPYTER_SERVER = fromString("JupyterServer"); + + /** + * Static value KernelGateway for AppType. + */ + public static final AppType KERNEL_GATEWAY = fromString("KernelGateway"); + + /** + * Static value RSessionGateway for AppType. + */ + public static final AppType RSESSION_GATEWAY = fromString("RSessionGateway"); + + /** + * Static value RStudioServerPro for AppType. + */ + public static final AppType RSTUDIO_SERVER_PRO = fromString("RStudioServerPro"); + + /** + * Creates a new instance of AppType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public AppType() { + } + + /** + * Creates or finds a AppType from its string representation. + * + * @param name a name to look for. + * @return the corresponding AppType. + */ + public static AppType fromString(String name) { + return fromString(name, AppType.class); + } + + /** + * Gets known AppType values. + * + * @return known AppType values. + */ + public static Collection values() { + return values(AppType.class); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/Application.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/Application.java new file mode 100644 index 000000000000..818c39e4808a --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/Application.java @@ -0,0 +1,185 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; +import java.util.Map; + +/** + * Definition of Application. + */ +@Fluent +public final class Application implements JsonSerializable { + /* + *

This option is for advanced users only. This is meta information about third-party applications that + * third-party vendors use for testing purposes.

+ */ + private Map additionalInfo; + + /* + *

Arguments for Amazon EMR to pass to the application.

+ */ + private List args; + + /* + *

The name of the application.

+ */ + private String name; + + /* + *

The version of the application.

+ */ + private String version; + + /** + * Creates an instance of Application class. + */ + public Application() { + } + + /** + * Get the additionalInfo property: <p>This option is for advanced users only. This is meta information about + * third-party applications that third-party vendors use for testing purposes.</p>. + * + * @return the additionalInfo value. + */ + public Map additionalInfo() { + return this.additionalInfo; + } + + /** + * Set the additionalInfo property: <p>This option is for advanced users only. This is meta information about + * third-party applications that third-party vendors use for testing purposes.</p>. + * + * @param additionalInfo the additionalInfo value to set. + * @return the Application object itself. + */ + public Application withAdditionalInfo(Map additionalInfo) { + this.additionalInfo = additionalInfo; + return this; + } + + /** + * Get the args property: <p>Arguments for Amazon EMR to pass to the application.</p>. + * + * @return the args value. + */ + public List args() { + return this.args; + } + + /** + * Set the args property: <p>Arguments for Amazon EMR to pass to the application.</p>. + * + * @param args the args value to set. + * @return the Application object itself. + */ + public Application withArgs(List args) { + this.args = args; + return this; + } + + /** + * Get the name property: <p>The name of the application.</p>. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: <p>The name of the application.</p>. + * + * @param name the name value to set. + * @return the Application object itself. + */ + public Application withName(String name) { + this.name = name; + return this; + } + + /** + * Get the version property: <p>The version of the application.</p>. + * + * @return the version value. + */ + public String version() { + return this.version; + } + + /** + * Set the version property: <p>The version of the application.</p>. + * + * @param version the version value to set. + * @return the Application object itself. + */ + public Application withVersion(String version) { + this.version = version; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeMapField("additionalInfo", this.additionalInfo, + (writer, element) -> writer.writeString(element)); + jsonWriter.writeArrayField("args", this.args, (writer, element) -> writer.writeString(element)); + jsonWriter.writeStringField("name", this.name); + jsonWriter.writeStringField("version", this.version); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of Application from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of Application if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the Application. + */ + public static Application fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + Application deserializedApplication = new Application(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("additionalInfo".equals(fieldName)) { + Map additionalInfo = reader.readMap(reader1 -> reader1.getString()); + deserializedApplication.additionalInfo = additionalInfo; + } else if ("args".equals(fieldName)) { + List args = reader.readArray(reader1 -> reader1.getString()); + deserializedApplication.args = args; + } else if ("name".equals(fieldName)) { + deserializedApplication.name = reader.getString(); + } else if ("version".equals(fieldName)) { + deserializedApplication.version = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedApplication; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ApplicationResourceLifecycleConfig.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ApplicationResourceLifecycleConfig.java new file mode 100644 index 000000000000..0c96c3bc5652 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ApplicationResourceLifecycleConfig.java @@ -0,0 +1,138 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of ApplicationResourceLifecycleConfig. + */ +@Fluent +public final class ApplicationResourceLifecycleConfig implements JsonSerializable { + /* + * The ARN of an IAM service role that Elastic Beanstalk has permission to assume. The ServiceRole property is + * required the first time that you provide a ResourceLifecycleConfig for the application. After you provide it + * once, Elastic Beanstalk persists the Service Role with the application, and you don't need to specify it again. + * You can, however, specify it in subsequent updates to change the Service Role to another value. + */ + private String serviceRole; + + /* + * Defines lifecycle settings for application versions. + */ + private ApplicationVersionLifecycleConfig versionLifecycleConfig; + + /** + * Creates an instance of ApplicationResourceLifecycleConfig class. + */ + public ApplicationResourceLifecycleConfig() { + } + + /** + * Get the serviceRole property: The ARN of an IAM service role that Elastic Beanstalk has permission to assume. The + * ServiceRole property is required the first time that you provide a ResourceLifecycleConfig for the application. + * After you provide it once, Elastic Beanstalk persists the Service Role with the application, and you don't need + * to specify it again. You can, however, specify it in subsequent updates to change the Service Role to another + * value. + * + * @return the serviceRole value. + */ + public String serviceRole() { + return this.serviceRole; + } + + /** + * Set the serviceRole property: The ARN of an IAM service role that Elastic Beanstalk has permission to assume. The + * ServiceRole property is required the first time that you provide a ResourceLifecycleConfig for the application. + * After you provide it once, Elastic Beanstalk persists the Service Role with the application, and you don't need + * to specify it again. You can, however, specify it in subsequent updates to change the Service Role to another + * value. + * + * @param serviceRole the serviceRole value to set. + * @return the ApplicationResourceLifecycleConfig object itself. + */ + public ApplicationResourceLifecycleConfig withServiceRole(String serviceRole) { + this.serviceRole = serviceRole; + return this; + } + + /** + * Get the versionLifecycleConfig property: Defines lifecycle settings for application versions. + * + * @return the versionLifecycleConfig value. + */ + public ApplicationVersionLifecycleConfig versionLifecycleConfig() { + return this.versionLifecycleConfig; + } + + /** + * Set the versionLifecycleConfig property: Defines lifecycle settings for application versions. + * + * @param versionLifecycleConfig the versionLifecycleConfig value to set. + * @return the ApplicationResourceLifecycleConfig object itself. + */ + public ApplicationResourceLifecycleConfig + withVersionLifecycleConfig(ApplicationVersionLifecycleConfig versionLifecycleConfig) { + this.versionLifecycleConfig = versionLifecycleConfig; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (versionLifecycleConfig() != null) { + versionLifecycleConfig().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("serviceRole", this.serviceRole); + jsonWriter.writeJsonField("versionLifecycleConfig", this.versionLifecycleConfig); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ApplicationResourceLifecycleConfig from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ApplicationResourceLifecycleConfig if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ApplicationResourceLifecycleConfig. + */ + public static ApplicationResourceLifecycleConfig fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ApplicationResourceLifecycleConfig deserializedApplicationResourceLifecycleConfig + = new ApplicationResourceLifecycleConfig(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("serviceRole".equals(fieldName)) { + deserializedApplicationResourceLifecycleConfig.serviceRole = reader.getString(); + } else if ("versionLifecycleConfig".equals(fieldName)) { + deserializedApplicationResourceLifecycleConfig.versionLifecycleConfig + = ApplicationVersionLifecycleConfig.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedApplicationResourceLifecycleConfig; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ApplicationVersionLifecycleConfig.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ApplicationVersionLifecycleConfig.java new file mode 100644 index 000000000000..73517cf8e668 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ApplicationVersionLifecycleConfig.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.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of ApplicationVersionLifecycleConfig. + */ +@Fluent +public final class ApplicationVersionLifecycleConfig implements JsonSerializable { + /* + * Specify a max age rule to restrict the length of time that application versions are retained for an application. + */ + private MaxAgeRule maxAgeRule; + + /* + * Specify a max count rule to restrict the number of application versions that are retained for an application. + */ + private MaxCountRule maxCountRule; + + /** + * Creates an instance of ApplicationVersionLifecycleConfig class. + */ + public ApplicationVersionLifecycleConfig() { + } + + /** + * Get the maxAgeRule property: Specify a max age rule to restrict the length of time that application versions are + * retained for an application. + * + * @return the maxAgeRule value. + */ + public MaxAgeRule maxAgeRule() { + return this.maxAgeRule; + } + + /** + * Set the maxAgeRule property: Specify a max age rule to restrict the length of time that application versions are + * retained for an application. + * + * @param maxAgeRule the maxAgeRule value to set. + * @return the ApplicationVersionLifecycleConfig object itself. + */ + public ApplicationVersionLifecycleConfig withMaxAgeRule(MaxAgeRule maxAgeRule) { + this.maxAgeRule = maxAgeRule; + return this; + } + + /** + * Get the maxCountRule property: Specify a max count rule to restrict the number of application versions that are + * retained for an application. + * + * @return the maxCountRule value. + */ + public MaxCountRule maxCountRule() { + return this.maxCountRule; + } + + /** + * Set the maxCountRule property: Specify a max count rule to restrict the number of application versions that are + * retained for an application. + * + * @param maxCountRule the maxCountRule value to set. + * @return the ApplicationVersionLifecycleConfig object itself. + */ + public ApplicationVersionLifecycleConfig withMaxCountRule(MaxCountRule maxCountRule) { + this.maxCountRule = maxCountRule; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (maxAgeRule() != null) { + maxAgeRule().validate(); + } + if (maxCountRule() != null) { + maxCountRule().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("maxAgeRule", this.maxAgeRule); + jsonWriter.writeJsonField("maxCountRule", this.maxCountRule); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ApplicationVersionLifecycleConfig from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ApplicationVersionLifecycleConfig if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ApplicationVersionLifecycleConfig. + */ + public static ApplicationVersionLifecycleConfig fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ApplicationVersionLifecycleConfig deserializedApplicationVersionLifecycleConfig + = new ApplicationVersionLifecycleConfig(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("maxAgeRule".equals(fieldName)) { + deserializedApplicationVersionLifecycleConfig.maxAgeRule = MaxAgeRule.fromJson(reader); + } else if ("maxCountRule".equals(fieldName)) { + deserializedApplicationVersionLifecycleConfig.maxCountRule = MaxCountRule.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedApplicationVersionLifecycleConfig; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ArchitectureValues.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ArchitectureValues.java new file mode 100644 index 000000000000..1c32aa5da545 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ArchitectureValues.java @@ -0,0 +1,66 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * ArchitectureValues enum. + */ +public final class ArchitectureValues extends ExpandableStringEnum { + /** + * Static value arm64 for ArchitectureValues. + */ + public static final ArchitectureValues ARM64 = fromString("arm64"); + + /** + * Static value arm64_mac for ArchitectureValues. + */ + public static final ArchitectureValues ARM64_MAC = fromString("arm64_mac"); + + /** + * Static value i386 for ArchitectureValues. + */ + public static final ArchitectureValues I386 = fromString("i386"); + + /** + * Static value x86_64 for ArchitectureValues. + */ + public static final ArchitectureValues X86_64 = fromString("x86_64"); + + /** + * Static value x86_64_mac for ArchitectureValues. + */ + public static final ArchitectureValues X86_64_MAC = fromString("x86_64_mac"); + + /** + * Creates a new instance of ArchitectureValues value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ArchitectureValues() { + } + + /** + * Creates or finds a ArchitectureValues from its string representation. + * + * @param name a name to look for. + * @return the corresponding ArchitectureValues. + */ + public static ArchitectureValues fromString(String name) { + return fromString(name, ArchitectureValues.class); + } + + /** + * Gets known ArchitectureValues values. + * + * @return known ArchitectureValues values. + */ + public static Collection values() { + return values(ArchitectureValues.class); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ArchitectureValuesEnumValue.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ArchitectureValuesEnumValue.java new file mode 100644 index 000000000000..dbbc768612e5 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ArchitectureValuesEnumValue.java @@ -0,0 +1,93 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of ArchitectureValuesEnumValue. + */ +@Fluent +public final class ArchitectureValuesEnumValue implements JsonSerializable { + /* + * Property value + */ + private ArchitectureValues value; + + /** + * Creates an instance of ArchitectureValuesEnumValue class. + */ + public ArchitectureValuesEnumValue() { + } + + /** + * Get the value property: Property value. + * + * @return the value value. + */ + public ArchitectureValues value() { + return this.value; + } + + /** + * Set the value property: Property value. + * + * @param value the value value to set. + * @return the ArchitectureValuesEnumValue object itself. + */ + public ArchitectureValuesEnumValue withValue(ArchitectureValues value) { + this.value = value; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("value", this.value == null ? null : this.value.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ArchitectureValuesEnumValue from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ArchitectureValuesEnumValue if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ArchitectureValuesEnumValue. + */ + public static ArchitectureValuesEnumValue fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ArchitectureValuesEnumValue deserializedArchitectureValuesEnumValue = new ArchitectureValuesEnumValue(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + deserializedArchitectureValuesEnumValue.value = ArchitectureValues.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedArchitectureValuesEnumValue; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/Architectures.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/Architectures.java new file mode 100644 index 000000000000..fabff0b33e7e --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/Architectures.java @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Architectures enum. + */ +public final class Architectures extends ExpandableStringEnum { + /** + * Static value arm64 for Architectures. + */ + public static final Architectures ARM64 = fromString("arm64"); + + /** + * Static value x86_64 for Architectures. + */ + public static final Architectures X86_64 = fromString("x86_64"); + + /** + * Creates a new instance of Architectures value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public Architectures() { + } + + /** + * Creates or finds a Architectures from its string representation. + * + * @param name a name to look for. + * @return the corresponding Architectures. + */ + public static Architectures fromString(String name) { + return fromString(name, Architectures.class); + } + + /** + * Gets known Architectures values. + * + * @return known Architectures values. + */ + public static Collection values() { + return values(Architectures.class); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ArchiveRule.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ArchiveRule.java new file mode 100644 index 000000000000..7ad21fae85b5 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ArchiveRule.java @@ -0,0 +1,126 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Definition of ArchiveRule. + */ +@Fluent +public final class ArchiveRule implements JsonSerializable { + /* + * Property filter + */ + private List filter; + + /* + * The archive rule name + */ + private String ruleName; + + /** + * Creates an instance of ArchiveRule class. + */ + public ArchiveRule() { + } + + /** + * Get the filter property: Property filter. + * + * @return the filter value. + */ + public List filter() { + return this.filter; + } + + /** + * Set the filter property: Property filter. + * + * @param filter the filter value to set. + * @return the ArchiveRule object itself. + */ + public ArchiveRule withFilter(List filter) { + this.filter = filter; + return this; + } + + /** + * Get the ruleName property: The archive rule name. + * + * @return the ruleName value. + */ + public String ruleName() { + return this.ruleName; + } + + /** + * Set the ruleName property: The archive rule name. + * + * @param ruleName the ruleName value to set. + * @return the ArchiveRule object itself. + */ + public ArchiveRule withRuleName(String ruleName) { + this.ruleName = ruleName; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (filter() != null) { + filter().forEach(e -> e.validate()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("filter", this.filter, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("ruleName", this.ruleName); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ArchiveRule from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ArchiveRule if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the ArchiveRule. + */ + public static ArchiveRule fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ArchiveRule deserializedArchiveRule = new ArchiveRule(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("filter".equals(fieldName)) { + List filter = reader.readArray(reader1 -> Filter.fromJson(reader1)); + deserializedArchiveRule.filter = filter; + } else if ("ruleName".equals(fieldName)) { + deserializedArchiveRule.ruleName = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedArchiveRule; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ArtifactNamespace.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ArtifactNamespace.java new file mode 100644 index 000000000000..9e122801557b --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ArtifactNamespace.java @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * ArtifactNamespace enum. + */ +public final class ArtifactNamespace extends ExpandableStringEnum { + /** + * Static value BUILD_ID for ArtifactNamespace. + */ + public static final ArtifactNamespace BUILD_ID = fromString("BUILD_ID"); + + /** + * Static value NONE for ArtifactNamespace. + */ + public static final ArtifactNamespace NONE = fromString("NONE"); + + /** + * Creates a new instance of ArtifactNamespace value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ArtifactNamespace() { + } + + /** + * Creates or finds a ArtifactNamespace from its string representation. + * + * @param name a name to look for. + * @return the corresponding ArtifactNamespace. + */ + public static ArtifactNamespace fromString(String name) { + return fromString(name, ArtifactNamespace.class); + } + + /** + * Gets known ArtifactNamespace values. + * + * @return known ArtifactNamespace values. + */ + public static Collection values() { + return values(ArtifactNamespace.class); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ArtifactNamespaceEnumValue.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ArtifactNamespaceEnumValue.java new file mode 100644 index 000000000000..f591980b525d --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ArtifactNamespaceEnumValue.java @@ -0,0 +1,93 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of ArtifactNamespaceEnumValue. + */ +@Fluent +public final class ArtifactNamespaceEnumValue implements JsonSerializable { + /* + * Property value + */ + private ArtifactNamespace value; + + /** + * Creates an instance of ArtifactNamespaceEnumValue class. + */ + public ArtifactNamespaceEnumValue() { + } + + /** + * Get the value property: Property value. + * + * @return the value value. + */ + public ArtifactNamespace value() { + return this.value; + } + + /** + * Set the value property: Property value. + * + * @param value the value value to set. + * @return the ArtifactNamespaceEnumValue object itself. + */ + public ArtifactNamespaceEnumValue withValue(ArtifactNamespace value) { + this.value = value; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("value", this.value == null ? null : this.value.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ArtifactNamespaceEnumValue from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ArtifactNamespaceEnumValue if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ArtifactNamespaceEnumValue. + */ + public static ArtifactNamespaceEnumValue fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ArtifactNamespaceEnumValue deserializedArtifactNamespaceEnumValue = new ArtifactNamespaceEnumValue(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + deserializedArtifactNamespaceEnumValue.value = ArtifactNamespace.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedArtifactNamespaceEnumValue; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ArtifactPackaging.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ArtifactPackaging.java new file mode 100644 index 000000000000..d41a95dd7a2b --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ArtifactPackaging.java @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * ArtifactPackaging enum. + */ +public final class ArtifactPackaging extends ExpandableStringEnum { + /** + * Static value NONE for ArtifactPackaging. + */ + public static final ArtifactPackaging NONE = fromString("NONE"); + + /** + * Static value ZIP for ArtifactPackaging. + */ + public static final ArtifactPackaging ZIP = fromString("ZIP"); + + /** + * Creates a new instance of ArtifactPackaging value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ArtifactPackaging() { + } + + /** + * Creates or finds a ArtifactPackaging from its string representation. + * + * @param name a name to look for. + * @return the corresponding ArtifactPackaging. + */ + public static ArtifactPackaging fromString(String name) { + return fromString(name, ArtifactPackaging.class); + } + + /** + * Gets known ArtifactPackaging values. + * + * @return known ArtifactPackaging values. + */ + public static Collection values() { + return values(ArtifactPackaging.class); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ArtifactPackagingEnumValue.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ArtifactPackagingEnumValue.java new file mode 100644 index 000000000000..a09a729126a4 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ArtifactPackagingEnumValue.java @@ -0,0 +1,93 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of ArtifactPackagingEnumValue. + */ +@Fluent +public final class ArtifactPackagingEnumValue implements JsonSerializable { + /* + * Property value + */ + private ArtifactPackaging value; + + /** + * Creates an instance of ArtifactPackagingEnumValue class. + */ + public ArtifactPackagingEnumValue() { + } + + /** + * Get the value property: Property value. + * + * @return the value value. + */ + public ArtifactPackaging value() { + return this.value; + } + + /** + * Set the value property: Property value. + * + * @param value the value value to set. + * @return the ArtifactPackagingEnumValue object itself. + */ + public ArtifactPackagingEnumValue withValue(ArtifactPackaging value) { + this.value = value; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("value", this.value == null ? null : this.value.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ArtifactPackagingEnumValue from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ArtifactPackagingEnumValue if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ArtifactPackagingEnumValue. + */ + public static ArtifactPackagingEnumValue fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ArtifactPackagingEnumValue deserializedArtifactPackagingEnumValue = new ArtifactPackagingEnumValue(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + deserializedArtifactPackagingEnumValue.value = ArtifactPackaging.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedArtifactPackagingEnumValue; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ArtifactsType.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ArtifactsType.java new file mode 100644 index 000000000000..b21cf5a8e4c0 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ArtifactsType.java @@ -0,0 +1,56 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * ArtifactsType enum. + */ +public final class ArtifactsType extends ExpandableStringEnum { + /** + * Static value CODEPIPELINE for ArtifactsType. + */ + public static final ArtifactsType CODEPIPELINE = fromString("CODEPIPELINE"); + + /** + * Static value NO_ARTIFACTS for ArtifactsType. + */ + public static final ArtifactsType NO_ARTIFACTS = fromString("NO_ARTIFACTS"); + + /** + * Static value S3 for ArtifactsType. + */ + public static final ArtifactsType S3 = fromString("S3"); + + /** + * Creates a new instance of ArtifactsType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ArtifactsType() { + } + + /** + * Creates or finds a ArtifactsType from its string representation. + * + * @param name a name to look for. + * @return the corresponding ArtifactsType. + */ + public static ArtifactsType fromString(String name) { + return fromString(name, ArtifactsType.class); + } + + /** + * Gets known ArtifactsType values. + * + * @return known ArtifactsType values. + */ + public static Collection values() { + return values(ArtifactsType.class); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ArtifactsTypeEnumValue.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ArtifactsTypeEnumValue.java new file mode 100644 index 000000000000..95d5dcf771d8 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ArtifactsTypeEnumValue.java @@ -0,0 +1,93 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of ArtifactsTypeEnumValue. + */ +@Fluent +public final class ArtifactsTypeEnumValue implements JsonSerializable { + /* + * Property value + */ + private ArtifactsType value; + + /** + * Creates an instance of ArtifactsTypeEnumValue class. + */ + public ArtifactsTypeEnumValue() { + } + + /** + * Get the value property: Property value. + * + * @return the value value. + */ + public ArtifactsType value() { + return this.value; + } + + /** + * Set the value property: Property value. + * + * @param value the value value to set. + * @return the ArtifactsTypeEnumValue object itself. + */ + public ArtifactsTypeEnumValue withValue(ArtifactsType value) { + this.value = value; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("value", this.value == null ? null : this.value.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ArtifactsTypeEnumValue from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ArtifactsTypeEnumValue if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the ArtifactsTypeEnumValue. + */ + public static ArtifactsTypeEnumValue fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ArtifactsTypeEnumValue deserializedArtifactsTypeEnumValue = new ArtifactsTypeEnumValue(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + deserializedArtifactsTypeEnumValue.value = ArtifactsType.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedArtifactsTypeEnumValue; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/AttachmentStatus.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/AttachmentStatus.java new file mode 100644 index 000000000000..a2a7a71317f6 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/AttachmentStatus.java @@ -0,0 +1,61 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * AttachmentStatus enum. + */ +public final class AttachmentStatus extends ExpandableStringEnum { + /** + * Static value attached for AttachmentStatus. + */ + public static final AttachmentStatus ATTACHED = fromString("attached"); + + /** + * Static value attaching for AttachmentStatus. + */ + public static final AttachmentStatus ATTACHING = fromString("attaching"); + + /** + * Static value detached for AttachmentStatus. + */ + public static final AttachmentStatus DETACHED = fromString("detached"); + + /** + * Static value detaching for AttachmentStatus. + */ + public static final AttachmentStatus DETACHING = fromString("detaching"); + + /** + * Creates a new instance of AttachmentStatus value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public AttachmentStatus() { + } + + /** + * Creates or finds a AttachmentStatus from its string representation. + * + * @param name a name to look for. + * @return the corresponding AttachmentStatus. + */ + public static AttachmentStatus fromString(String name) { + return fromString(name, AttachmentStatus.class); + } + + /** + * Gets known AttachmentStatus values. + * + * @return known AttachmentStatus values. + */ + public static Collection values() { + return values(AttachmentStatus.class); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/AttachmentStatusEnumValue.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/AttachmentStatusEnumValue.java new file mode 100644 index 000000000000..0cb1f5c9594a --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/AttachmentStatusEnumValue.java @@ -0,0 +1,93 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of AttachmentStatusEnumValue. + */ +@Fluent +public final class AttachmentStatusEnumValue implements JsonSerializable { + /* + * Property value + */ + private AttachmentStatus value; + + /** + * Creates an instance of AttachmentStatusEnumValue class. + */ + public AttachmentStatusEnumValue() { + } + + /** + * Get the value property: Property value. + * + * @return the value value. + */ + public AttachmentStatus value() { + return this.value; + } + + /** + * Set the value property: Property value. + * + * @param value the value value to set. + * @return the AttachmentStatusEnumValue object itself. + */ + public AttachmentStatusEnumValue withValue(AttachmentStatus value) { + this.value = value; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("value", this.value == null ? null : this.value.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AttachmentStatusEnumValue from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AttachmentStatusEnumValue if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IOException If an error occurs while reading the AttachmentStatusEnumValue. + */ + public static AttachmentStatusEnumValue fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AttachmentStatusEnumValue deserializedAttachmentStatusEnumValue = new AttachmentStatusEnumValue(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + deserializedAttachmentStatusEnumValue.value = AttachmentStatus.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedAttachmentStatusEnumValue; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/AttributeDefinition.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/AttributeDefinition.java new file mode 100644 index 000000000000..847616801978 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/AttributeDefinition.java @@ -0,0 +1,124 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of AttributeDefinition. + */ +@Fluent +public final class AttributeDefinition implements JsonSerializable { + /* + * A name for the attribute. + */ + private String attributeName; + + /* + * The data type for the attribute, where: + ``S`` - the attribute is of type String + ``N`` - the attribute is of + * type Number + ``B`` - the attribute is of type Binary + */ + private String attributeType; + + /** + * Creates an instance of AttributeDefinition class. + */ + public AttributeDefinition() { + } + + /** + * Get the attributeName property: A name for the attribute. + * + * @return the attributeName value. + */ + public String attributeName() { + return this.attributeName; + } + + /** + * Set the attributeName property: A name for the attribute. + * + * @param attributeName the attributeName value to set. + * @return the AttributeDefinition object itself. + */ + public AttributeDefinition withAttributeName(String attributeName) { + this.attributeName = attributeName; + return this; + } + + /** + * Get the attributeType property: The data type for the attribute, where: + ``S`` - the attribute is of type String + * + ``N`` - the attribute is of type Number + ``B`` - the attribute is of type Binary. + * + * @return the attributeType value. + */ + public String attributeType() { + return this.attributeType; + } + + /** + * Set the attributeType property: The data type for the attribute, where: + ``S`` - the attribute is of type String + * + ``N`` - the attribute is of type Number + ``B`` - the attribute is of type Binary. + * + * @param attributeType the attributeType value to set. + * @return the AttributeDefinition object itself. + */ + public AttributeDefinition withAttributeType(String attributeType) { + this.attributeType = attributeType; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("attributeName", this.attributeName); + jsonWriter.writeStringField("attributeType", this.attributeType); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AttributeDefinition from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AttributeDefinition if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the AttributeDefinition. + */ + public static AttributeDefinition fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AttributeDefinition deserializedAttributeDefinition = new AttributeDefinition(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("attributeName".equals(fieldName)) { + deserializedAttributeDefinition.attributeName = reader.getString(); + } else if ("attributeType".equals(fieldName)) { + deserializedAttributeDefinition.attributeType = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedAttributeDefinition; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/AuthType.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/AuthType.java new file mode 100644 index 000000000000..a9a440bc4ee9 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/AuthType.java @@ -0,0 +1,61 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * AuthType enum. + */ +public final class AuthType extends ExpandableStringEnum { + /** + * Static value BASIC_AUTH for AuthType. + */ + public static final AuthType BASIC_AUTH = fromString("BASIC_AUTH"); + + /** + * Static value CODECONNECTIONS for AuthType. + */ + public static final AuthType CODECONNECTIONS = fromString("CODECONNECTIONS"); + + /** + * Static value OAUTH for AuthType. + */ + public static final AuthType OAUTH = fromString("OAUTH"); + + /** + * Static value PERSONAL_ACCESS_TOKEN for AuthType. + */ + public static final AuthType PERSONAL_ACCESS_TOKEN = fromString("PERSONAL_ACCESS_TOKEN"); + + /** + * Creates a new instance of AuthType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public AuthType() { + } + + /** + * Creates or finds a AuthType from its string representation. + * + * @param name a name to look for. + * @return the corresponding AuthType. + */ + public static AuthType fromString(String name) { + return fromString(name, AuthType.class); + } + + /** + * Gets known AuthType values. + * + * @return known AuthType values. + */ + public static Collection values() { + return values(AuthType.class); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/AuthTypeEnumValue.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/AuthTypeEnumValue.java new file mode 100644 index 000000000000..0bb0ddecdc09 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/AuthTypeEnumValue.java @@ -0,0 +1,93 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of AuthTypeEnumValue. + */ +@Fluent +public final class AuthTypeEnumValue implements JsonSerializable { + /* + * Property value + */ + private AuthType value; + + /** + * Creates an instance of AuthTypeEnumValue class. + */ + public AuthTypeEnumValue() { + } + + /** + * Get the value property: Property value. + * + * @return the value value. + */ + public AuthType value() { + return this.value; + } + + /** + * Set the value property: Property value. + * + * @param value the value value to set. + * @return the AuthTypeEnumValue object itself. + */ + public AuthTypeEnumValue withValue(AuthType value) { + this.value = value; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("value", this.value == null ? null : this.value.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AuthTypeEnumValue from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AuthTypeEnumValue if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the AuthTypeEnumValue. + */ + public static AuthTypeEnumValue fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AuthTypeEnumValue deserializedAuthTypeEnumValue = new AuthTypeEnumValue(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + deserializedAuthTypeEnumValue.value = AuthType.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedAuthTypeEnumValue; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/AuthenticateCognitoConfig.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/AuthenticateCognitoConfig.java new file mode 100644 index 000000000000..d3ff0a9f97d4 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/AuthenticateCognitoConfig.java @@ -0,0 +1,314 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.Map; + +/** + * Definition of AuthenticateCognitoConfig. + */ +@Fluent +public final class AuthenticateCognitoConfig implements JsonSerializable { + /* + * The query parameters (up to 10) to include in the redirect request to the authorization endpoint. + */ + private Map authenticationRequestExtraParams; + + /* + * The behavior if the user is not authenticated. The following are possible values: + deny```` - Return an HTTP 401 + * Unauthorized error. + allow```` - Allow the request to be forwarded to the target. + authenticate```` - Redirect + * the request to the IdP authorization endpoint. This is the default value. + */ + private String onUnauthenticatedRequest; + + /* + * The set of user claims to be requested from the IdP. The default is ``openid``. To verify which scope values your + * IdP supports and how to separate multiple values, see the documentation for your IdP. + */ + private String scope; + + /* + * The name of the cookie used to maintain session information. The default is AWSELBAuthSessionCookie. + */ + private String sessionCookieName; + + /* + * The maximum duration of the authentication session, in seconds. The default is 604800 seconds (7 days). + */ + private String sessionTimeout; + + /* + * The Amazon Resource Name (ARN) of the Amazon Cognito user pool. + */ + private String userPoolArn; + + /* + * The ID of the Amazon Cognito user pool client. + */ + private String userPoolClientId; + + /* + * The domain prefix or fully-qualified domain name of the Amazon Cognito user pool. + */ + private String userPoolDomain; + + /** + * Creates an instance of AuthenticateCognitoConfig class. + */ + public AuthenticateCognitoConfig() { + } + + /** + * Get the authenticationRequestExtraParams property: The query parameters (up to 10) to include in the redirect + * request to the authorization endpoint. + * + * @return the authenticationRequestExtraParams value. + */ + public Map authenticationRequestExtraParams() { + return this.authenticationRequestExtraParams; + } + + /** + * Set the authenticationRequestExtraParams property: The query parameters (up to 10) to include in the redirect + * request to the authorization endpoint. + * + * @param authenticationRequestExtraParams the authenticationRequestExtraParams value to set. + * @return the AuthenticateCognitoConfig object itself. + */ + public AuthenticateCognitoConfig + withAuthenticationRequestExtraParams(Map authenticationRequestExtraParams) { + this.authenticationRequestExtraParams = authenticationRequestExtraParams; + return this; + } + + /** + * Get the onUnauthenticatedRequest property: The behavior if the user is not authenticated. The following are + * possible values: + deny```` - Return an HTTP 401 Unauthorized error. + allow```` - Allow the request to be + * forwarded to the target. + authenticate```` - Redirect the request to the IdP authorization endpoint. This is the + * default value. + * + * @return the onUnauthenticatedRequest value. + */ + public String onUnauthenticatedRequest() { + return this.onUnauthenticatedRequest; + } + + /** + * Set the onUnauthenticatedRequest property: The behavior if the user is not authenticated. The following are + * possible values: + deny```` - Return an HTTP 401 Unauthorized error. + allow```` - Allow the request to be + * forwarded to the target. + authenticate```` - Redirect the request to the IdP authorization endpoint. This is the + * default value. + * + * @param onUnauthenticatedRequest the onUnauthenticatedRequest value to set. + * @return the AuthenticateCognitoConfig object itself. + */ + public AuthenticateCognitoConfig withOnUnauthenticatedRequest(String onUnauthenticatedRequest) { + this.onUnauthenticatedRequest = onUnauthenticatedRequest; + return this; + } + + /** + * Get the scope property: The set of user claims to be requested from the IdP. The default is ``openid``. To verify + * which scope values your IdP supports and how to separate multiple values, see the documentation for your IdP. + * + * @return the scope value. + */ + public String scope() { + return this.scope; + } + + /** + * Set the scope property: The set of user claims to be requested from the IdP. The default is ``openid``. To verify + * which scope values your IdP supports and how to separate multiple values, see the documentation for your IdP. + * + * @param scope the scope value to set. + * @return the AuthenticateCognitoConfig object itself. + */ + public AuthenticateCognitoConfig withScope(String scope) { + this.scope = scope; + return this; + } + + /** + * Get the sessionCookieName property: The name of the cookie used to maintain session information. The default is + * AWSELBAuthSessionCookie. + * + * @return the sessionCookieName value. + */ + public String sessionCookieName() { + return this.sessionCookieName; + } + + /** + * Set the sessionCookieName property: The name of the cookie used to maintain session information. The default is + * AWSELBAuthSessionCookie. + * + * @param sessionCookieName the sessionCookieName value to set. + * @return the AuthenticateCognitoConfig object itself. + */ + public AuthenticateCognitoConfig withSessionCookieName(String sessionCookieName) { + this.sessionCookieName = sessionCookieName; + return this; + } + + /** + * Get the sessionTimeout property: The maximum duration of the authentication session, in seconds. The default is + * 604800 seconds (7 days). + * + * @return the sessionTimeout value. + */ + public String sessionTimeout() { + return this.sessionTimeout; + } + + /** + * Set the sessionTimeout property: The maximum duration of the authentication session, in seconds. The default is + * 604800 seconds (7 days). + * + * @param sessionTimeout the sessionTimeout value to set. + * @return the AuthenticateCognitoConfig object itself. + */ + public AuthenticateCognitoConfig withSessionTimeout(String sessionTimeout) { + this.sessionTimeout = sessionTimeout; + return this; + } + + /** + * Get the userPoolArn property: The Amazon Resource Name (ARN) of the Amazon Cognito user pool. + * + * @return the userPoolArn value. + */ + public String userPoolArn() { + return this.userPoolArn; + } + + /** + * Set the userPoolArn property: The Amazon Resource Name (ARN) of the Amazon Cognito user pool. + * + * @param userPoolArn the userPoolArn value to set. + * @return the AuthenticateCognitoConfig object itself. + */ + public AuthenticateCognitoConfig withUserPoolArn(String userPoolArn) { + this.userPoolArn = userPoolArn; + return this; + } + + /** + * Get the userPoolClientId property: The ID of the Amazon Cognito user pool client. + * + * @return the userPoolClientId value. + */ + public String userPoolClientId() { + return this.userPoolClientId; + } + + /** + * Set the userPoolClientId property: The ID of the Amazon Cognito user pool client. + * + * @param userPoolClientId the userPoolClientId value to set. + * @return the AuthenticateCognitoConfig object itself. + */ + public AuthenticateCognitoConfig withUserPoolClientId(String userPoolClientId) { + this.userPoolClientId = userPoolClientId; + return this; + } + + /** + * Get the userPoolDomain property: The domain prefix or fully-qualified domain name of the Amazon Cognito user + * pool. + * + * @return the userPoolDomain value. + */ + public String userPoolDomain() { + return this.userPoolDomain; + } + + /** + * Set the userPoolDomain property: The domain prefix or fully-qualified domain name of the Amazon Cognito user + * pool. + * + * @param userPoolDomain the userPoolDomain value to set. + * @return the AuthenticateCognitoConfig object itself. + */ + public AuthenticateCognitoConfig withUserPoolDomain(String userPoolDomain) { + this.userPoolDomain = userPoolDomain; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeMapField("authenticationRequestExtraParams", this.authenticationRequestExtraParams, + (writer, element) -> writer.writeString(element)); + jsonWriter.writeStringField("onUnauthenticatedRequest", this.onUnauthenticatedRequest); + jsonWriter.writeStringField("scope", this.scope); + jsonWriter.writeStringField("sessionCookieName", this.sessionCookieName); + jsonWriter.writeStringField("sessionTimeout", this.sessionTimeout); + jsonWriter.writeStringField("userPoolArn", this.userPoolArn); + jsonWriter.writeStringField("userPoolClientId", this.userPoolClientId); + jsonWriter.writeStringField("userPoolDomain", this.userPoolDomain); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AuthenticateCognitoConfig from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AuthenticateCognitoConfig if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IOException If an error occurs while reading the AuthenticateCognitoConfig. + */ + public static AuthenticateCognitoConfig fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AuthenticateCognitoConfig deserializedAuthenticateCognitoConfig = new AuthenticateCognitoConfig(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("authenticationRequestExtraParams".equals(fieldName)) { + Map authenticationRequestExtraParams + = reader.readMap(reader1 -> reader1.getString()); + deserializedAuthenticateCognitoConfig.authenticationRequestExtraParams + = authenticationRequestExtraParams; + } else if ("onUnauthenticatedRequest".equals(fieldName)) { + deserializedAuthenticateCognitoConfig.onUnauthenticatedRequest = reader.getString(); + } else if ("scope".equals(fieldName)) { + deserializedAuthenticateCognitoConfig.scope = reader.getString(); + } else if ("sessionCookieName".equals(fieldName)) { + deserializedAuthenticateCognitoConfig.sessionCookieName = reader.getString(); + } else if ("sessionTimeout".equals(fieldName)) { + deserializedAuthenticateCognitoConfig.sessionTimeout = reader.getString(); + } else if ("userPoolArn".equals(fieldName)) { + deserializedAuthenticateCognitoConfig.userPoolArn = reader.getString(); + } else if ("userPoolClientId".equals(fieldName)) { + deserializedAuthenticateCognitoConfig.userPoolClientId = reader.getString(); + } else if ("userPoolDomain".equals(fieldName)) { + deserializedAuthenticateCognitoConfig.userPoolDomain = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedAuthenticateCognitoConfig; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/AuthenticateOidcConfig.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/AuthenticateOidcConfig.java new file mode 100644 index 000000000000..1e52718ed584 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/AuthenticateOidcConfig.java @@ -0,0 +1,442 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.Map; + +/** + * Definition of AuthenticateOidcConfig. + */ +@Fluent +public final class AuthenticateOidcConfig implements JsonSerializable { + /* + * The query parameters (up to 10) to include in the redirect request to the authorization endpoint. + */ + private Map authenticationRequestExtraParams; + + /* + * The authorization endpoint of the IdP. This must be a full URL, including the HTTPS protocol, the domain, and the + * path. + */ + private String authorizationEndpoint; + + /* + * The OAuth 2.0 client identifier. + */ + private String clientId; + + /* + * The OAuth 2.0 client secret. This parameter is required if you are creating a rule. If you are modifying a rule, + * you can omit this parameter if you set ``UseExistingClientSecret`` to true. + */ + private String clientSecret; + + /* + * The OIDC issuer identifier of the IdP. This must be a full URL, including the HTTPS protocol, the domain, and the + * path. + */ + private String issuer; + + /* + * The behavior if the user is not authenticated. The following are possible values: + deny```` - Return an HTTP 401 + * Unauthorized error. + allow```` - Allow the request to be forwarded to the target. + authenticate```` - Redirect + * the request to the IdP authorization endpoint. This is the default value. + */ + private String onUnauthenticatedRequest; + + /* + * The set of user claims to be requested from the IdP. The default is ``openid``. To verify which scope values your + * IdP supports and how to separate multiple values, see the documentation for your IdP. + */ + private String scope; + + /* + * The name of the cookie used to maintain session information. The default is AWSELBAuthSessionCookie. + */ + private String sessionCookieName; + + /* + * The maximum duration of the authentication session, in seconds. The default is 604800 seconds (7 days). + */ + private String sessionTimeout; + + /* + * The token endpoint of the IdP. This must be a full URL, including the HTTPS protocol, the domain, and the path. + */ + private String tokenEndpoint; + + /* + * Indicates whether to use the existing client secret when modifying a rule. If you are creating a rule, you can + * omit this parameter or set it to false. + */ + private Boolean useExistingClientSecret; + + /* + * The user info endpoint of the IdP. This must be a full URL, including the HTTPS protocol, the domain, and the + * path. + */ + private String userInfoEndpoint; + + /** + * Creates an instance of AuthenticateOidcConfig class. + */ + public AuthenticateOidcConfig() { + } + + /** + * Get the authenticationRequestExtraParams property: The query parameters (up to 10) to include in the redirect + * request to the authorization endpoint. + * + * @return the authenticationRequestExtraParams value. + */ + public Map authenticationRequestExtraParams() { + return this.authenticationRequestExtraParams; + } + + /** + * Set the authenticationRequestExtraParams property: The query parameters (up to 10) to include in the redirect + * request to the authorization endpoint. + * + * @param authenticationRequestExtraParams the authenticationRequestExtraParams value to set. + * @return the AuthenticateOidcConfig object itself. + */ + public AuthenticateOidcConfig + withAuthenticationRequestExtraParams(Map authenticationRequestExtraParams) { + this.authenticationRequestExtraParams = authenticationRequestExtraParams; + return this; + } + + /** + * Get the authorizationEndpoint property: The authorization endpoint of the IdP. This must be a full URL, including + * the HTTPS protocol, the domain, and the path. + * + * @return the authorizationEndpoint value. + */ + public String authorizationEndpoint() { + return this.authorizationEndpoint; + } + + /** + * Set the authorizationEndpoint property: The authorization endpoint of the IdP. This must be a full URL, including + * the HTTPS protocol, the domain, and the path. + * + * @param authorizationEndpoint the authorizationEndpoint value to set. + * @return the AuthenticateOidcConfig object itself. + */ + public AuthenticateOidcConfig withAuthorizationEndpoint(String authorizationEndpoint) { + this.authorizationEndpoint = authorizationEndpoint; + return this; + } + + /** + * Get the clientId property: The OAuth 2.0 client identifier. + * + * @return the clientId value. + */ + public String clientId() { + return this.clientId; + } + + /** + * Set the clientId property: The OAuth 2.0 client identifier. + * + * @param clientId the clientId value to set. + * @return the AuthenticateOidcConfig object itself. + */ + public AuthenticateOidcConfig withClientId(String clientId) { + this.clientId = clientId; + return this; + } + + /** + * Get the clientSecret property: The OAuth 2.0 client secret. This parameter is required if you are creating a + * rule. If you are modifying a rule, you can omit this parameter if you set ``UseExistingClientSecret`` to true. + * + * @return the clientSecret value. + */ + public String clientSecret() { + return this.clientSecret; + } + + /** + * Set the clientSecret property: The OAuth 2.0 client secret. This parameter is required if you are creating a + * rule. If you are modifying a rule, you can omit this parameter if you set ``UseExistingClientSecret`` to true. + * + * @param clientSecret the clientSecret value to set. + * @return the AuthenticateOidcConfig object itself. + */ + public AuthenticateOidcConfig withClientSecret(String clientSecret) { + this.clientSecret = clientSecret; + return this; + } + + /** + * Get the issuer property: The OIDC issuer identifier of the IdP. This must be a full URL, including the HTTPS + * protocol, the domain, and the path. + * + * @return the issuer value. + */ + public String issuer() { + return this.issuer; + } + + /** + * Set the issuer property: The OIDC issuer identifier of the IdP. This must be a full URL, including the HTTPS + * protocol, the domain, and the path. + * + * @param issuer the issuer value to set. + * @return the AuthenticateOidcConfig object itself. + */ + public AuthenticateOidcConfig withIssuer(String issuer) { + this.issuer = issuer; + return this; + } + + /** + * Get the onUnauthenticatedRequest property: The behavior if the user is not authenticated. The following are + * possible values: + deny```` - Return an HTTP 401 Unauthorized error. + allow```` - Allow the request to be + * forwarded to the target. + authenticate```` - Redirect the request to the IdP authorization endpoint. This is the + * default value. + * + * @return the onUnauthenticatedRequest value. + */ + public String onUnauthenticatedRequest() { + return this.onUnauthenticatedRequest; + } + + /** + * Set the onUnauthenticatedRequest property: The behavior if the user is not authenticated. The following are + * possible values: + deny```` - Return an HTTP 401 Unauthorized error. + allow```` - Allow the request to be + * forwarded to the target. + authenticate```` - Redirect the request to the IdP authorization endpoint. This is the + * default value. + * + * @param onUnauthenticatedRequest the onUnauthenticatedRequest value to set. + * @return the AuthenticateOidcConfig object itself. + */ + public AuthenticateOidcConfig withOnUnauthenticatedRequest(String onUnauthenticatedRequest) { + this.onUnauthenticatedRequest = onUnauthenticatedRequest; + return this; + } + + /** + * Get the scope property: The set of user claims to be requested from the IdP. The default is ``openid``. To verify + * which scope values your IdP supports and how to separate multiple values, see the documentation for your IdP. + * + * @return the scope value. + */ + public String scope() { + return this.scope; + } + + /** + * Set the scope property: The set of user claims to be requested from the IdP. The default is ``openid``. To verify + * which scope values your IdP supports and how to separate multiple values, see the documentation for your IdP. + * + * @param scope the scope value to set. + * @return the AuthenticateOidcConfig object itself. + */ + public AuthenticateOidcConfig withScope(String scope) { + this.scope = scope; + return this; + } + + /** + * Get the sessionCookieName property: The name of the cookie used to maintain session information. The default is + * AWSELBAuthSessionCookie. + * + * @return the sessionCookieName value. + */ + public String sessionCookieName() { + return this.sessionCookieName; + } + + /** + * Set the sessionCookieName property: The name of the cookie used to maintain session information. The default is + * AWSELBAuthSessionCookie. + * + * @param sessionCookieName the sessionCookieName value to set. + * @return the AuthenticateOidcConfig object itself. + */ + public AuthenticateOidcConfig withSessionCookieName(String sessionCookieName) { + this.sessionCookieName = sessionCookieName; + return this; + } + + /** + * Get the sessionTimeout property: The maximum duration of the authentication session, in seconds. The default is + * 604800 seconds (7 days). + * + * @return the sessionTimeout value. + */ + public String sessionTimeout() { + return this.sessionTimeout; + } + + /** + * Set the sessionTimeout property: The maximum duration of the authentication session, in seconds. The default is + * 604800 seconds (7 days). + * + * @param sessionTimeout the sessionTimeout value to set. + * @return the AuthenticateOidcConfig object itself. + */ + public AuthenticateOidcConfig withSessionTimeout(String sessionTimeout) { + this.sessionTimeout = sessionTimeout; + return this; + } + + /** + * Get the tokenEndpoint property: The token endpoint of the IdP. This must be a full URL, including the HTTPS + * protocol, the domain, and the path. + * + * @return the tokenEndpoint value. + */ + public String tokenEndpoint() { + return this.tokenEndpoint; + } + + /** + * Set the tokenEndpoint property: The token endpoint of the IdP. This must be a full URL, including the HTTPS + * protocol, the domain, and the path. + * + * @param tokenEndpoint the tokenEndpoint value to set. + * @return the AuthenticateOidcConfig object itself. + */ + public AuthenticateOidcConfig withTokenEndpoint(String tokenEndpoint) { + this.tokenEndpoint = tokenEndpoint; + return this; + } + + /** + * Get the useExistingClientSecret property: Indicates whether to use the existing client secret when modifying a + * rule. If you are creating a rule, you can omit this parameter or set it to false. + * + * @return the useExistingClientSecret value. + */ + public Boolean useExistingClientSecret() { + return this.useExistingClientSecret; + } + + /** + * Set the useExistingClientSecret property: Indicates whether to use the existing client secret when modifying a + * rule. If you are creating a rule, you can omit this parameter or set it to false. + * + * @param useExistingClientSecret the useExistingClientSecret value to set. + * @return the AuthenticateOidcConfig object itself. + */ + public AuthenticateOidcConfig withUseExistingClientSecret(Boolean useExistingClientSecret) { + this.useExistingClientSecret = useExistingClientSecret; + return this; + } + + /** + * Get the userInfoEndpoint property: The user info endpoint of the IdP. This must be a full URL, including the + * HTTPS protocol, the domain, and the path. + * + * @return the userInfoEndpoint value. + */ + public String userInfoEndpoint() { + return this.userInfoEndpoint; + } + + /** + * Set the userInfoEndpoint property: The user info endpoint of the IdP. This must be a full URL, including the + * HTTPS protocol, the domain, and the path. + * + * @param userInfoEndpoint the userInfoEndpoint value to set. + * @return the AuthenticateOidcConfig object itself. + */ + public AuthenticateOidcConfig withUserInfoEndpoint(String userInfoEndpoint) { + this.userInfoEndpoint = userInfoEndpoint; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeMapField("authenticationRequestExtraParams", this.authenticationRequestExtraParams, + (writer, element) -> writer.writeString(element)); + jsonWriter.writeStringField("authorizationEndpoint", this.authorizationEndpoint); + jsonWriter.writeStringField("clientId", this.clientId); + jsonWriter.writeStringField("clientSecret", this.clientSecret); + jsonWriter.writeStringField("issuer", this.issuer); + jsonWriter.writeStringField("onUnauthenticatedRequest", this.onUnauthenticatedRequest); + jsonWriter.writeStringField("scope", this.scope); + jsonWriter.writeStringField("sessionCookieName", this.sessionCookieName); + jsonWriter.writeStringField("sessionTimeout", this.sessionTimeout); + jsonWriter.writeStringField("tokenEndpoint", this.tokenEndpoint); + jsonWriter.writeBooleanField("useExistingClientSecret", this.useExistingClientSecret); + jsonWriter.writeStringField("userInfoEndpoint", this.userInfoEndpoint); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AuthenticateOidcConfig from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AuthenticateOidcConfig if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the AuthenticateOidcConfig. + */ + public static AuthenticateOidcConfig fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AuthenticateOidcConfig deserializedAuthenticateOidcConfig = new AuthenticateOidcConfig(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("authenticationRequestExtraParams".equals(fieldName)) { + Map authenticationRequestExtraParams + = reader.readMap(reader1 -> reader1.getString()); + deserializedAuthenticateOidcConfig.authenticationRequestExtraParams + = authenticationRequestExtraParams; + } else if ("authorizationEndpoint".equals(fieldName)) { + deserializedAuthenticateOidcConfig.authorizationEndpoint = reader.getString(); + } else if ("clientId".equals(fieldName)) { + deserializedAuthenticateOidcConfig.clientId = reader.getString(); + } else if ("clientSecret".equals(fieldName)) { + deserializedAuthenticateOidcConfig.clientSecret = reader.getString(); + } else if ("issuer".equals(fieldName)) { + deserializedAuthenticateOidcConfig.issuer = reader.getString(); + } else if ("onUnauthenticatedRequest".equals(fieldName)) { + deserializedAuthenticateOidcConfig.onUnauthenticatedRequest = reader.getString(); + } else if ("scope".equals(fieldName)) { + deserializedAuthenticateOidcConfig.scope = reader.getString(); + } else if ("sessionCookieName".equals(fieldName)) { + deserializedAuthenticateOidcConfig.sessionCookieName = reader.getString(); + } else if ("sessionTimeout".equals(fieldName)) { + deserializedAuthenticateOidcConfig.sessionTimeout = reader.getString(); + } else if ("tokenEndpoint".equals(fieldName)) { + deserializedAuthenticateOidcConfig.tokenEndpoint = reader.getString(); + } else if ("useExistingClientSecret".equals(fieldName)) { + deserializedAuthenticateOidcConfig.useExistingClientSecret + = reader.getNullable(JsonReader::getBoolean); + } else if ("userInfoEndpoint".equals(fieldName)) { + deserializedAuthenticateOidcConfig.userInfoEndpoint = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedAuthenticateOidcConfig; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/AuthenticationMode.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/AuthenticationMode.java new file mode 100644 index 000000000000..c152a4ab486d --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/AuthenticationMode.java @@ -0,0 +1,56 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * AuthenticationMode enum. + */ +public final class AuthenticationMode extends ExpandableStringEnum { + /** + * Static value API for AuthenticationMode. + */ + public static final AuthenticationMode API = fromString("API"); + + /** + * Static value API_AND_CONFIG_MAP for AuthenticationMode. + */ + public static final AuthenticationMode API_AND_CONFIG_MAP = fromString("API_AND_CONFIG_MAP"); + + /** + * Static value CONFIG_MAP for AuthenticationMode. + */ + public static final AuthenticationMode CONFIG_MAP = fromString("CONFIG_MAP"); + + /** + * Creates a new instance of AuthenticationMode value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public AuthenticationMode() { + } + + /** + * Creates or finds a AuthenticationMode from its string representation. + * + * @param name a name to look for. + * @return the corresponding AuthenticationMode. + */ + public static AuthenticationMode fromString(String name) { + return fromString(name, AuthenticationMode.class); + } + + /** + * Gets known AuthenticationMode values. + * + * @return known AuthenticationMode values. + */ + public static Collection values() { + return values(AuthenticationMode.class); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/AuthenticationModeEnumValue.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/AuthenticationModeEnumValue.java new file mode 100644 index 000000000000..ce2e790ac14e --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/AuthenticationModeEnumValue.java @@ -0,0 +1,93 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of AuthenticationModeEnumValue. + */ +@Fluent +public final class AuthenticationModeEnumValue implements JsonSerializable { + /* + * Property value + */ + private AuthenticationMode value; + + /** + * Creates an instance of AuthenticationModeEnumValue class. + */ + public AuthenticationModeEnumValue() { + } + + /** + * Get the value property: Property value. + * + * @return the value value. + */ + public AuthenticationMode value() { + return this.value; + } + + /** + * Set the value property: Property value. + * + * @param value the value value to set. + * @return the AuthenticationModeEnumValue object itself. + */ + public AuthenticationModeEnumValue withValue(AuthenticationMode value) { + this.value = value; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("value", this.value == null ? null : this.value.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AuthenticationModeEnumValue from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AuthenticationModeEnumValue if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the AuthenticationModeEnumValue. + */ + public static AuthenticationModeEnumValue fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AuthenticationModeEnumValue deserializedAuthenticationModeEnumValue = new AuthenticationModeEnumValue(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + deserializedAuthenticationModeEnumValue.value = AuthenticationMode.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedAuthenticationModeEnumValue; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/AuthenticationType.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/AuthenticationType.java new file mode 100644 index 000000000000..038b64742ebc --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/AuthenticationType.java @@ -0,0 +1,66 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * AuthenticationType enum. + */ +public final class AuthenticationType extends ExpandableStringEnum { + /** + * Static value AMAZON_COGNITO_USER_POOLS for AuthenticationType. + */ + public static final AuthenticationType AMAZON_COGNITO_USER_POOLS = fromString("AMAZON_COGNITO_USER_POOLS"); + + /** + * Static value API_KEY for AuthenticationType. + */ + public static final AuthenticationType API_KEY = fromString("API_KEY"); + + /** + * Static value AWS_IAM for AuthenticationType. + */ + public static final AuthenticationType AWS_IAM = fromString("AWS_IAM"); + + /** + * Static value AWS_LAMBDA for AuthenticationType. + */ + public static final AuthenticationType AWS_LAMBDA = fromString("AWS_LAMBDA"); + + /** + * Static value OPENID_CONNECT for AuthenticationType. + */ + public static final AuthenticationType OPENID_CONNECT = fromString("OPENID_CONNECT"); + + /** + * Creates a new instance of AuthenticationType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public AuthenticationType() { + } + + /** + * Creates or finds a AuthenticationType from its string representation. + * + * @param name a name to look for. + * @return the corresponding AuthenticationType. + */ + public static AuthenticationType fromString(String name) { + return fromString(name, AuthenticationType.class); + } + + /** + * Gets known AuthenticationType values. + * + * @return known AuthenticationType values. + */ + public static Collection values() { + return values(AuthenticationType.class); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/AuthenticationTypeEnumValue.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/AuthenticationTypeEnumValue.java new file mode 100644 index 000000000000..1dd72c885220 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/AuthenticationTypeEnumValue.java @@ -0,0 +1,93 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of AuthenticationTypeEnumValue. + */ +@Fluent +public final class AuthenticationTypeEnumValue implements JsonSerializable { + /* + * Property value + */ + private AuthenticationType value; + + /** + * Creates an instance of AuthenticationTypeEnumValue class. + */ + public AuthenticationTypeEnumValue() { + } + + /** + * Get the value property: Property value. + * + * @return the value value. + */ + public AuthenticationType value() { + return this.value; + } + + /** + * Set the value property: Property value. + * + * @param value the value value to set. + * @return the AuthenticationTypeEnumValue object itself. + */ + public AuthenticationTypeEnumValue withValue(AuthenticationType value) { + this.value = value; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("value", this.value == null ? null : this.value.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AuthenticationTypeEnumValue from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AuthenticationTypeEnumValue if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the AuthenticationTypeEnumValue. + */ + public static AuthenticationTypeEnumValue fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AuthenticationTypeEnumValue deserializedAuthenticationTypeEnumValue = new AuthenticationTypeEnumValue(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + deserializedAuthenticationTypeEnumValue.value = AuthenticationType.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedAuthenticationTypeEnumValue; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/AuthorizationConfig.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/AuthorizationConfig.java new file mode 100644 index 000000000000..eac82fbe7a04 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/AuthorizationConfig.java @@ -0,0 +1,151 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of AuthorizationConfig. + */ +@Fluent +public final class AuthorizationConfig implements JsonSerializable { + /* + * The Amazon EFS access point ID to use. If an access point is specified, the root directory value specified in the + * ``EFSVolumeConfiguration`` must either be omitted or set to ``/`` which will enforce the path set on the EFS + * access point. If an access point is used, transit encryption must be on in the ``EFSVolumeConfiguration``. For + * more information, see [Working with Amazon EFS access + * points](https://docs.aws.amazon.com/efs/latest/ug/efs-access-points.html) in the *Amazon Elastic File System User + * Guide*. + */ + private String accessPointId; + + /* + * Determines whether to use the Amazon ECS task role defined in a task definition when mounting the Amazon EFS file + * system. If it is turned on, transit encryption must be turned on in the ``EFSVolumeConfiguration``. If this + * parameter is omitted, the default value of ``DISABLED`` is used. For more information, see [Using Amazon EFS + * access + * points](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/efs-volumes.html#efs-volume-accesspoints) in + * the *Amazon Elastic Container Service Developer Guide*. + */ + private AuthorizationConfigIam iam; + + /** + * Creates an instance of AuthorizationConfig class. + */ + public AuthorizationConfig() { + } + + /** + * Get the accessPointId property: The Amazon EFS access point ID to use. If an access point is specified, the root + * directory value specified in the ``EFSVolumeConfiguration`` must either be omitted or set to ``/`` which will + * enforce the path set on the EFS access point. If an access point is used, transit encryption must be on in the + * ``EFSVolumeConfiguration``. For more information, see [Working with Amazon EFS access + * points](https://docs.aws.amazon.com/efs/latest/ug/efs-access-points.html) in the *Amazon Elastic File System User + * Guide*. + * + * @return the accessPointId value. + */ + public String accessPointId() { + return this.accessPointId; + } + + /** + * Set the accessPointId property: The Amazon EFS access point ID to use. If an access point is specified, the root + * directory value specified in the ``EFSVolumeConfiguration`` must either be omitted or set to ``/`` which will + * enforce the path set on the EFS access point. If an access point is used, transit encryption must be on in the + * ``EFSVolumeConfiguration``. For more information, see [Working with Amazon EFS access + * points](https://docs.aws.amazon.com/efs/latest/ug/efs-access-points.html) in the *Amazon Elastic File System User + * Guide*. + * + * @param accessPointId the accessPointId value to set. + * @return the AuthorizationConfig object itself. + */ + public AuthorizationConfig withAccessPointId(String accessPointId) { + this.accessPointId = accessPointId; + return this; + } + + /** + * Get the iam property: Determines whether to use the Amazon ECS task role defined in a task definition when + * mounting the Amazon EFS file system. If it is turned on, transit encryption must be turned on in the + * ``EFSVolumeConfiguration``. If this parameter is omitted, the default value of ``DISABLED`` is used. For more + * information, see [Using Amazon EFS access + * points](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/efs-volumes.html#efs-volume-accesspoints) in + * the *Amazon Elastic Container Service Developer Guide*. + * + * @return the iam value. + */ + public AuthorizationConfigIam iam() { + return this.iam; + } + + /** + * Set the iam property: Determines whether to use the Amazon ECS task role defined in a task definition when + * mounting the Amazon EFS file system. If it is turned on, transit encryption must be turned on in the + * ``EFSVolumeConfiguration``. If this parameter is omitted, the default value of ``DISABLED`` is used. For more + * information, see [Using Amazon EFS access + * points](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/efs-volumes.html#efs-volume-accesspoints) in + * the *Amazon Elastic Container Service Developer Guide*. + * + * @param iam the iam value to set. + * @return the AuthorizationConfig object itself. + */ + public AuthorizationConfig withIam(AuthorizationConfigIam iam) { + this.iam = iam; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("accessPointId", this.accessPointId); + jsonWriter.writeStringField("iam", this.iam == null ? null : this.iam.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AuthorizationConfig from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AuthorizationConfig if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the AuthorizationConfig. + */ + public static AuthorizationConfig fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AuthorizationConfig deserializedAuthorizationConfig = new AuthorizationConfig(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("accessPointId".equals(fieldName)) { + deserializedAuthorizationConfig.accessPointId = reader.getString(); + } else if ("iam".equals(fieldName)) { + deserializedAuthorizationConfig.iam = AuthorizationConfigIam.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedAuthorizationConfig; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/AuthorizationConfigIam.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/AuthorizationConfigIam.java new file mode 100644 index 000000000000..e65dc00c835c --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/AuthorizationConfigIam.java @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * AuthorizationConfigIAM enum. + */ +public final class AuthorizationConfigIam extends ExpandableStringEnum { + /** + * Static value DISABLED for AuthorizationConfigIam. + */ + public static final AuthorizationConfigIam DISABLED = fromString("DISABLED"); + + /** + * Static value ENABLED for AuthorizationConfigIam. + */ + public static final AuthorizationConfigIam ENABLED = fromString("ENABLED"); + + /** + * Creates a new instance of AuthorizationConfigIam value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public AuthorizationConfigIam() { + } + + /** + * Creates or finds a AuthorizationConfigIam from its string representation. + * + * @param name a name to look for. + * @return the corresponding AuthorizationConfigIam. + */ + public static AuthorizationConfigIam fromString(String name) { + return fromString(name, AuthorizationConfigIam.class); + } + + /** + * Gets known AuthorizationConfigIam values. + * + * @return known AuthorizationConfigIam values. + */ + public static Collection values() { + return values(AuthorizationConfigIam.class); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/AutoDeployment.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/AutoDeployment.java new file mode 100644 index 000000000000..c2e5605eb246 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/AutoDeployment.java @@ -0,0 +1,135 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of AutoDeployment. + */ +@Fluent +public final class AutoDeployment implements JsonSerializable { + /* + * If set to true, StackSets automatically deploys additional stack instances to AWS Organizations accounts that are + * added to a target organization or organizational unit (OU) in the specified Regions. If an account is removed + * from a target organization or OU, StackSets deletes stack instances from the account in the specified Regions. + */ + private Boolean enabled; + + /* + * If set to true, stack resources are retained when an account is removed from a target organization or OU. If set + * to false, stack resources are deleted. Specify only if Enabled is set to True. + */ + private Boolean retainStacksOnAccountRemoval; + + /** + * Creates an instance of AutoDeployment class. + */ + public AutoDeployment() { + } + + /** + * Get the enabled property: If set to true, StackSets automatically deploys additional stack instances to AWS + * Organizations accounts that are added to a target organization or organizational unit (OU) in the specified + * Regions. If an account is removed from a target organization or OU, StackSets deletes stack instances from the + * account in the specified Regions. + * + * @return the enabled value. + */ + public Boolean enabled() { + return this.enabled; + } + + /** + * Set the enabled property: If set to true, StackSets automatically deploys additional stack instances to AWS + * Organizations accounts that are added to a target organization or organizational unit (OU) in the specified + * Regions. If an account is removed from a target organization or OU, StackSets deletes stack instances from the + * account in the specified Regions. + * + * @param enabled the enabled value to set. + * @return the AutoDeployment object itself. + */ + public AutoDeployment withEnabled(Boolean enabled) { + this.enabled = enabled; + return this; + } + + /** + * Get the retainStacksOnAccountRemoval property: If set to true, stack resources are retained when an account is + * removed from a target organization or OU. If set to false, stack resources are deleted. Specify only if Enabled + * is set to True. + * + * @return the retainStacksOnAccountRemoval value. + */ + public Boolean retainStacksOnAccountRemoval() { + return this.retainStacksOnAccountRemoval; + } + + /** + * Set the retainStacksOnAccountRemoval property: If set to true, stack resources are retained when an account is + * removed from a target organization or OU. If set to false, stack resources are deleted. Specify only if Enabled + * is set to True. + * + * @param retainStacksOnAccountRemoval the retainStacksOnAccountRemoval value to set. + * @return the AutoDeployment object itself. + */ + public AutoDeployment withRetainStacksOnAccountRemoval(Boolean retainStacksOnAccountRemoval) { + this.retainStacksOnAccountRemoval = retainStacksOnAccountRemoval; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeBooleanField("enabled", this.enabled); + jsonWriter.writeBooleanField("retainStacksOnAccountRemoval", this.retainStacksOnAccountRemoval); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AutoDeployment from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AutoDeployment if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the AutoDeployment. + */ + public static AutoDeployment fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AutoDeployment deserializedAutoDeployment = new AutoDeployment(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("enabled".equals(fieldName)) { + deserializedAutoDeployment.enabled = reader.getNullable(JsonReader::getBoolean); + } else if ("retainStacksOnAccountRemoval".equals(fieldName)) { + deserializedAutoDeployment.retainStacksOnAccountRemoval + = reader.getNullable(JsonReader::getBoolean); + } else { + reader.skipChildren(); + } + } + + return deserializedAutoDeployment; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/AutoScalingAutoScalingGroups.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/AutoScalingAutoScalingGroups.java new file mode 100644 index 000000000000..7e02f8a53628 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/AutoScalingAutoScalingGroups.java @@ -0,0 +1,161 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** + * Resource collection API of AutoScalingAutoScalingGroups. + */ +public interface AutoScalingAutoScalingGroups { + /** + * List AutoScalingAutoScalingGroup resources by subscription ID. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a AutoScalingAutoScalingGroup list operation as paginated response with + * {@link PagedIterable}. + */ + PagedIterable list(); + + /** + * List AutoScalingAutoScalingGroup resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a AutoScalingAutoScalingGroup list operation as paginated response with + * {@link PagedIterable}. + */ + PagedIterable list(Context context); + + /** + * List AutoScalingAutoScalingGroup resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a AutoScalingAutoScalingGroup list operation as paginated response with + * {@link PagedIterable}. + */ + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * List AutoScalingAutoScalingGroup resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a AutoScalingAutoScalingGroup list operation as paginated response with + * {@link PagedIterable}. + */ + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Get a AutoScalingAutoScalingGroup. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of AutoScalingAutoScalingGroup. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a AutoScalingAutoScalingGroup along with {@link Response}. + */ + Response getByResourceGroupWithResponse(String resourceGroupName, String name, Context context); + + /** + * Get a AutoScalingAutoScalingGroup. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of AutoScalingAutoScalingGroup. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a AutoScalingAutoScalingGroup. + */ + AutoScalingGroup getByResourceGroup(String resourceGroupName, String name); + + /** + * Delete a AutoScalingAutoScalingGroup. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of AutoScalingAutoScalingGroup. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByResourceGroup(String resourceGroupName, String name); + + /** + * Delete a AutoScalingAutoScalingGroup. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of AutoScalingAutoScalingGroup. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String name, Context context); + + /** + * Get a AutoScalingAutoScalingGroup. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a AutoScalingAutoScalingGroup along with {@link Response}. + */ + AutoScalingGroup getById(String id); + + /** + * Get a AutoScalingAutoScalingGroup. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a AutoScalingAutoScalingGroup along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Delete a AutoScalingAutoScalingGroup. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteById(String id); + + /** + * Delete a AutoScalingAutoScalingGroup. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new AutoScalingGroup resource. + * + * @param name resource name. + * @return the first stage of the new AutoScalingGroup definition. + */ + AutoScalingGroup.DefinitionStages.Blank define(String name); +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/AutoScalingGroup.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/AutoScalingGroup.java new file mode 100644 index 000000000000..ada89d3f6201 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/AutoScalingGroup.java @@ -0,0 +1,252 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.awsconnector.fluent.models.AutoScalingGroupInner; +import java.util.Map; + +/** + * An immutable client-side representation of AutoScalingGroup. + */ +public interface AutoScalingGroup { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the location property: The geo-location where the resource lives. + * + * @return the location value. + */ + String location(); + + /** + * Gets the tags property: Resource tags. + * + * @return the tags value. + */ + Map tags(); + + /** + * Gets the properties property: The resource-specific properties for this resource. + * + * @return the properties value. + */ + AutoScalingGroupProperties properties(); + + /** + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the region of the resource. + * + * @return the region of the resource. + */ + Region region(); + + /** + * Gets the name of the resource region. + * + * @return the name of the resource region. + */ + String regionName(); + + /** + * Gets the name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + + /** + * Gets the inner com.azure.resourcemanager.awsconnector.fluent.models.AutoScalingGroupInner object. + * + * @return the inner object. + */ + AutoScalingGroupInner innerModel(); + + /** + * The entirety of the AutoScalingGroup definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithLocation, + DefinitionStages.WithResourceGroup, DefinitionStages.WithCreate { + } + + /** + * The AutoScalingGroup definition stages. + */ + interface DefinitionStages { + /** + * The first stage of the AutoScalingGroup definition. + */ + interface Blank extends WithLocation { + } + + /** + * The stage of the AutoScalingGroup definition allowing to specify location. + */ + interface WithLocation { + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithResourceGroup withRegion(Region location); + + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithResourceGroup withRegion(String location); + } + + /** + * The stage of the AutoScalingGroup definition allowing to specify parent resource. + */ + interface WithResourceGroup { + /** + * Specifies resourceGroupName. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @return the next definition stage. + */ + WithCreate withExistingResourceGroup(String resourceGroupName); + } + + /** + * The stage of the AutoScalingGroup 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.WithProperties { + /** + * Executes the create request. + * + * @return the created resource. + */ + AutoScalingGroup create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + AutoScalingGroup create(Context context); + } + + /** + * The stage of the AutoScalingGroup definition allowing to specify tags. + */ + interface WithTags { + /** + * Specifies the tags property: Resource tags.. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + WithCreate withTags(Map tags); + } + + /** + * The stage of the AutoScalingGroup definition allowing to specify properties. + */ + interface WithProperties { + /** + * Specifies the properties property: The resource-specific properties for this resource.. + * + * @param properties The resource-specific properties for this resource. + * @return the next definition stage. + */ + WithCreate withProperties(AutoScalingGroupProperties properties); + } + } + + /** + * Begins update for the AutoScalingGroup resource. + * + * @return the stage of resource update. + */ + AutoScalingGroup.Update update(); + + /** + * The template for AutoScalingGroup update. + */ + interface Update extends UpdateStages.WithTags { + /** + * Executes the update request. + * + * @return the updated resource. + */ + AutoScalingGroup apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + AutoScalingGroup apply(Context context); + } + + /** + * The AutoScalingGroup update stages. + */ + interface UpdateStages { + /** + * The stage of the AutoScalingGroup update allowing to specify tags. + */ + interface WithTags { + /** + * Specifies the tags property: Resource tags.. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + Update withTags(Map tags); + } + } + + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + AutoScalingGroup refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + AutoScalingGroup refresh(Context context); +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/AutoScalingGroupListResult.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/AutoScalingGroupListResult.java new file mode 100644 index 000000000000..97e8c5ffc997 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/AutoScalingGroupListResult.java @@ -0,0 +1,136 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.awsconnector.fluent.models.AutoScalingGroupInner; +import java.io.IOException; +import java.util.List; + +/** + * The response of a AutoScalingAutoScalingGroup list operation. + */ +@Fluent +public final class AutoScalingGroupListResult implements JsonSerializable { + /* + * The AutoScalingAutoScalingGroup items on this page + */ + private List value; + + /* + * The link to the next page of items + */ + private String nextLink; + + /** + * Creates an instance of AutoScalingGroupListResult class. + */ + public AutoScalingGroupListResult() { + } + + /** + * Get the value property: The AutoScalingAutoScalingGroup items on this page. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The AutoScalingAutoScalingGroup items on this page. + * + * @param value the value value to set. + * @return the AutoScalingGroupListResult object itself. + */ + public AutoScalingGroupListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The link to the next page of items. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: The link to the next page of items. + * + * @param nextLink the nextLink value to set. + * @return the AutoScalingGroupListResult object itself. + */ + public AutoScalingGroupListResult withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property value in model AutoScalingGroupListResult")); + } else { + value().forEach(e -> e.validate()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(AutoScalingGroupListResult.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("nextLink", this.nextLink); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AutoScalingGroupListResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AutoScalingGroupListResult if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the AutoScalingGroupListResult. + */ + public static AutoScalingGroupListResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AutoScalingGroupListResult deserializedAutoScalingGroupListResult = new AutoScalingGroupListResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> AutoScalingGroupInner.fromJson(reader1)); + deserializedAutoScalingGroupListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedAutoScalingGroupListResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedAutoScalingGroupListResult; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/AutoScalingGroupProperties.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/AutoScalingGroupProperties.java new file mode 100644 index 000000000000..bba1c5247c28 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/AutoScalingGroupProperties.java @@ -0,0 +1,312 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.Map; + +/** + * Definition of AutoScalingAutoScalingGroup. + */ +@Fluent +public final class AutoScalingGroupProperties implements JsonSerializable { + /* + * AWS Properties + */ + private AwsAutoScalingGroupProperties awsProperties; + + /* + * Public Cloud Connectors Resource ID + */ + private String publicCloudConnectorsResourceId; + + /* + * AWS Account ID + */ + private String awsAccountId; + + /* + * Amazon Resource Name (ARN) + */ + private String arn; + + /* + * Public Cloud Resource Name + */ + private String publicCloudResourceName; + + /* + * AWS Source Schema + */ + private String awsSourceSchema; + + /* + * AWS Region + */ + private String awsRegion; + + /* + * AWS Tags + */ + private Map awsTags; + + /* + * The status of the last operation. + */ + private ProvisioningState provisioningState; + + /** + * Creates an instance of AutoScalingGroupProperties class. + */ + public AutoScalingGroupProperties() { + } + + /** + * Get the awsProperties property: AWS Properties. + * + * @return the awsProperties value. + */ + public AwsAutoScalingGroupProperties awsProperties() { + return this.awsProperties; + } + + /** + * Set the awsProperties property: AWS Properties. + * + * @param awsProperties the awsProperties value to set. + * @return the AutoScalingGroupProperties object itself. + */ + public AutoScalingGroupProperties withAwsProperties(AwsAutoScalingGroupProperties awsProperties) { + this.awsProperties = awsProperties; + return this; + } + + /** + * Get the publicCloudConnectorsResourceId property: Public Cloud Connectors Resource ID. + * + * @return the publicCloudConnectorsResourceId value. + */ + public String publicCloudConnectorsResourceId() { + return this.publicCloudConnectorsResourceId; + } + + /** + * Set the publicCloudConnectorsResourceId property: Public Cloud Connectors Resource ID. + * + * @param publicCloudConnectorsResourceId the publicCloudConnectorsResourceId value to set. + * @return the AutoScalingGroupProperties object itself. + */ + public AutoScalingGroupProperties withPublicCloudConnectorsResourceId(String publicCloudConnectorsResourceId) { + this.publicCloudConnectorsResourceId = publicCloudConnectorsResourceId; + return this; + } + + /** + * Get the awsAccountId property: AWS Account ID. + * + * @return the awsAccountId value. + */ + public String awsAccountId() { + return this.awsAccountId; + } + + /** + * Set the awsAccountId property: AWS Account ID. + * + * @param awsAccountId the awsAccountId value to set. + * @return the AutoScalingGroupProperties object itself. + */ + public AutoScalingGroupProperties withAwsAccountId(String awsAccountId) { + this.awsAccountId = awsAccountId; + return this; + } + + /** + * Get the arn property: Amazon Resource Name (ARN). + * + * @return the arn value. + */ + public String arn() { + return this.arn; + } + + /** + * Set the arn property: Amazon Resource Name (ARN). + * + * @param arn the arn value to set. + * @return the AutoScalingGroupProperties object itself. + */ + public AutoScalingGroupProperties withArn(String arn) { + this.arn = arn; + return this; + } + + /** + * Get the publicCloudResourceName property: Public Cloud Resource Name. + * + * @return the publicCloudResourceName value. + */ + public String publicCloudResourceName() { + return this.publicCloudResourceName; + } + + /** + * Set the publicCloudResourceName property: Public Cloud Resource Name. + * + * @param publicCloudResourceName the publicCloudResourceName value to set. + * @return the AutoScalingGroupProperties object itself. + */ + public AutoScalingGroupProperties withPublicCloudResourceName(String publicCloudResourceName) { + this.publicCloudResourceName = publicCloudResourceName; + return this; + } + + /** + * Get the awsSourceSchema property: AWS Source Schema. + * + * @return the awsSourceSchema value. + */ + public String awsSourceSchema() { + return this.awsSourceSchema; + } + + /** + * Set the awsSourceSchema property: AWS Source Schema. + * + * @param awsSourceSchema the awsSourceSchema value to set. + * @return the AutoScalingGroupProperties object itself. + */ + public AutoScalingGroupProperties withAwsSourceSchema(String awsSourceSchema) { + this.awsSourceSchema = awsSourceSchema; + return this; + } + + /** + * Get the awsRegion property: AWS Region. + * + * @return the awsRegion value. + */ + public String awsRegion() { + return this.awsRegion; + } + + /** + * Set the awsRegion property: AWS Region. + * + * @param awsRegion the awsRegion value to set. + * @return the AutoScalingGroupProperties object itself. + */ + public AutoScalingGroupProperties withAwsRegion(String awsRegion) { + this.awsRegion = awsRegion; + return this; + } + + /** + * Get the awsTags property: AWS Tags. + * + * @return the awsTags value. + */ + public Map awsTags() { + return this.awsTags; + } + + /** + * Set the awsTags property: AWS Tags. + * + * @param awsTags the awsTags value to set. + * @return the AutoScalingGroupProperties object itself. + */ + public AutoScalingGroupProperties withAwsTags(Map awsTags) { + this.awsTags = awsTags; + return this; + } + + /** + * Get the provisioningState property: The status of the last operation. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (awsProperties() != null) { + awsProperties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("awsProperties", this.awsProperties); + jsonWriter.writeStringField("publicCloudConnectorsResourceId", this.publicCloudConnectorsResourceId); + jsonWriter.writeStringField("awsAccountId", this.awsAccountId); + jsonWriter.writeStringField("arn", this.arn); + jsonWriter.writeStringField("publicCloudResourceName", this.publicCloudResourceName); + jsonWriter.writeStringField("awsSourceSchema", this.awsSourceSchema); + jsonWriter.writeStringField("awsRegion", this.awsRegion); + jsonWriter.writeMapField("awsTags", this.awsTags, (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AutoScalingGroupProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AutoScalingGroupProperties if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IOException If an error occurs while reading the AutoScalingGroupProperties. + */ + public static AutoScalingGroupProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AutoScalingGroupProperties deserializedAutoScalingGroupProperties = new AutoScalingGroupProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("awsProperties".equals(fieldName)) { + deserializedAutoScalingGroupProperties.awsProperties + = AwsAutoScalingGroupProperties.fromJson(reader); + } else if ("publicCloudConnectorsResourceId".equals(fieldName)) { + deserializedAutoScalingGroupProperties.publicCloudConnectorsResourceId = reader.getString(); + } else if ("awsAccountId".equals(fieldName)) { + deserializedAutoScalingGroupProperties.awsAccountId = reader.getString(); + } else if ("arn".equals(fieldName)) { + deserializedAutoScalingGroupProperties.arn = reader.getString(); + } else if ("publicCloudResourceName".equals(fieldName)) { + deserializedAutoScalingGroupProperties.publicCloudResourceName = reader.getString(); + } else if ("awsSourceSchema".equals(fieldName)) { + deserializedAutoScalingGroupProperties.awsSourceSchema = reader.getString(); + } else if ("awsRegion".equals(fieldName)) { + deserializedAutoScalingGroupProperties.awsRegion = reader.getString(); + } else if ("awsTags".equals(fieldName)) { + Map awsTags = reader.readMap(reader1 -> reader1.getString()); + deserializedAutoScalingGroupProperties.awsTags = awsTags; + } else if ("provisioningState".equals(fieldName)) { + deserializedAutoScalingGroupProperties.provisioningState + = ProvisioningState.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedAutoScalingGroupProperties; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/AutoScalingGroupTagsUpdate.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/AutoScalingGroupTagsUpdate.java new file mode 100644 index 000000000000..2a0977216537 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/AutoScalingGroupTagsUpdate.java @@ -0,0 +1,95 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.Map; + +/** + * The type used for updating tags in AutoScalingAutoScalingGroup resources. + */ +@Fluent +public final class AutoScalingGroupTagsUpdate implements JsonSerializable { + /* + * Resource tags. + */ + private Map tags; + + /** + * Creates an instance of AutoScalingGroupTagsUpdate class. + */ + public AutoScalingGroupTagsUpdate() { + } + + /** + * Get the tags property: Resource tags. + * + * @return the tags value. + */ + public Map tags() { + return this.tags; + } + + /** + * Set the tags property: Resource tags. + * + * @param tags the tags value to set. + * @return the AutoScalingGroupTagsUpdate object itself. + */ + public AutoScalingGroupTagsUpdate withTags(Map tags) { + this.tags = tags; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeMapField("tags", this.tags, (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AutoScalingGroupTagsUpdate from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AutoScalingGroupTagsUpdate if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IOException If an error occurs while reading the AutoScalingGroupTagsUpdate. + */ + public static AutoScalingGroupTagsUpdate fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AutoScalingGroupTagsUpdate deserializedAutoScalingGroupTagsUpdate = new AutoScalingGroupTagsUpdate(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedAutoScalingGroupTagsUpdate.tags = tags; + } else { + reader.skipChildren(); + } + } + + return deserializedAutoScalingGroupTagsUpdate; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/AutoSnapshotAddOn.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/AutoSnapshotAddOn.java new file mode 100644 index 000000000000..f7bf0944f107 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/AutoSnapshotAddOn.java @@ -0,0 +1,93 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of AutoSnapshotAddOn. + */ +@Fluent +public final class AutoSnapshotAddOn implements JsonSerializable { + /* + * The daily time when an automatic snapshot will be created. + */ + private String snapshotTimeOfDay; + + /** + * Creates an instance of AutoSnapshotAddOn class. + */ + public AutoSnapshotAddOn() { + } + + /** + * Get the snapshotTimeOfDay property: The daily time when an automatic snapshot will be created. + * + * @return the snapshotTimeOfDay value. + */ + public String snapshotTimeOfDay() { + return this.snapshotTimeOfDay; + } + + /** + * Set the snapshotTimeOfDay property: The daily time when an automatic snapshot will be created. + * + * @param snapshotTimeOfDay the snapshotTimeOfDay value to set. + * @return the AutoSnapshotAddOn object itself. + */ + public AutoSnapshotAddOn withSnapshotTimeOfDay(String snapshotTimeOfDay) { + this.snapshotTimeOfDay = snapshotTimeOfDay; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("snapshotTimeOfDay", this.snapshotTimeOfDay); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AutoSnapshotAddOn from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AutoSnapshotAddOn if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the AutoSnapshotAddOn. + */ + public static AutoSnapshotAddOn fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AutoSnapshotAddOn deserializedAutoSnapshotAddOn = new AutoSnapshotAddOn(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("snapshotTimeOfDay".equals(fieldName)) { + deserializedAutoSnapshotAddOn.snapshotTimeOfDay = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedAutoSnapshotAddOn; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/AutoTuneOptionsOutput.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/AutoTuneOptionsOutput.java new file mode 100644 index 000000000000..a82b59d342c1 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/AutoTuneOptionsOutput.java @@ -0,0 +1,157 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of AutoTuneOptionsOutput. + */ +@Fluent +public final class AutoTuneOptionsOutput implements JsonSerializable { + /* + *

Any errors that occurred while enabling or disabling Auto-Tune.

+ */ + private String errorMessage; + + /* + *

The current state of Auto-Tune on the domain.

+ */ + private AutoTuneStateEnumValue state; + + /* + *

Whether the domain's off-peak window will be used to deploy Auto-Tune changes rather than a maintenance + * schedule.

+ */ + private Boolean useOffPeakWindow; + + /** + * Creates an instance of AutoTuneOptionsOutput class. + */ + public AutoTuneOptionsOutput() { + } + + /** + * Get the errorMessage property: <p>Any errors that occurred while enabling or disabling + * Auto-Tune.</p>. + * + * @return the errorMessage value. + */ + public String errorMessage() { + return this.errorMessage; + } + + /** + * Set the errorMessage property: <p>Any errors that occurred while enabling or disabling + * Auto-Tune.</p>. + * + * @param errorMessage the errorMessage value to set. + * @return the AutoTuneOptionsOutput object itself. + */ + public AutoTuneOptionsOutput withErrorMessage(String errorMessage) { + this.errorMessage = errorMessage; + return this; + } + + /** + * Get the state property: <p>The current state of Auto-Tune on the domain.</p>. + * + * @return the state value. + */ + public AutoTuneStateEnumValue state() { + return this.state; + } + + /** + * Set the state property: <p>The current state of Auto-Tune on the domain.</p>. + * + * @param state the state value to set. + * @return the AutoTuneOptionsOutput object itself. + */ + public AutoTuneOptionsOutput withState(AutoTuneStateEnumValue state) { + this.state = state; + return this; + } + + /** + * Get the useOffPeakWindow property: <p>Whether the domain's off-peak window will be used to deploy Auto-Tune + * changes rather than a maintenance schedule.</p>. + * + * @return the useOffPeakWindow value. + */ + public Boolean useOffPeakWindow() { + return this.useOffPeakWindow; + } + + /** + * Set the useOffPeakWindow property: <p>Whether the domain's off-peak window will be used to deploy Auto-Tune + * changes rather than a maintenance schedule.</p>. + * + * @param useOffPeakWindow the useOffPeakWindow value to set. + * @return the AutoTuneOptionsOutput object itself. + */ + public AutoTuneOptionsOutput withUseOffPeakWindow(Boolean useOffPeakWindow) { + this.useOffPeakWindow = useOffPeakWindow; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (state() != null) { + state().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("errorMessage", this.errorMessage); + jsonWriter.writeJsonField("state", this.state); + jsonWriter.writeBooleanField("useOffPeakWindow", this.useOffPeakWindow); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AutoTuneOptionsOutput from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AutoTuneOptionsOutput if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the AutoTuneOptionsOutput. + */ + public static AutoTuneOptionsOutput fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AutoTuneOptionsOutput deserializedAutoTuneOptionsOutput = new AutoTuneOptionsOutput(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("errorMessage".equals(fieldName)) { + deserializedAutoTuneOptionsOutput.errorMessage = reader.getString(); + } else if ("state".equals(fieldName)) { + deserializedAutoTuneOptionsOutput.state = AutoTuneStateEnumValue.fromJson(reader); + } else if ("useOffPeakWindow".equals(fieldName)) { + deserializedAutoTuneOptionsOutput.useOffPeakWindow = reader.getNullable(JsonReader::getBoolean); + } else { + reader.skipChildren(); + } + } + + return deserializedAutoTuneOptionsOutput; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/AutoTuneState.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/AutoTuneState.java new file mode 100644 index 000000000000..a538e28e6bdb --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/AutoTuneState.java @@ -0,0 +1,87 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * AutoTuneState enum. + */ +public final class AutoTuneState extends ExpandableStringEnum { + /** + * Static value DISABLED for AutoTuneState. + */ + public static final AutoTuneState DISABLED = fromString("DISABLED"); + + /** + * Static value DISABLED_AND_ROLLBACK_COMPLETE for AutoTuneState. + */ + public static final AutoTuneState DISABLED_AND_ROLLBACK_COMPLETE = fromString("DISABLED_AND_ROLLBACK_COMPLETE"); + + /** + * Static value DISABLED_AND_ROLLBACK_ERROR for AutoTuneState. + */ + public static final AutoTuneState DISABLED_AND_ROLLBACK_ERROR = fromString("DISABLED_AND_ROLLBACK_ERROR"); + + /** + * Static value DISABLED_AND_ROLLBACK_IN_PROGRESS for AutoTuneState. + */ + public static final AutoTuneState DISABLED_AND_ROLLBACK_IN_PROGRESS + = fromString("DISABLED_AND_ROLLBACK_IN_PROGRESS"); + + /** + * Static value DISABLED_AND_ROLLBACK_SCHEDULED for AutoTuneState. + */ + public static final AutoTuneState DISABLED_AND_ROLLBACK_SCHEDULED = fromString("DISABLED_AND_ROLLBACK_SCHEDULED"); + + /** + * Static value DISABLE_IN_PROGRESS for AutoTuneState. + */ + public static final AutoTuneState DISABLE_IN_PROGRESS = fromString("DISABLE_IN_PROGRESS"); + + /** + * Static value ENABLED for AutoTuneState. + */ + public static final AutoTuneState ENABLED = fromString("ENABLED"); + + /** + * Static value ENABLE_IN_PROGRESS for AutoTuneState. + */ + public static final AutoTuneState ENABLE_IN_PROGRESS = fromString("ENABLE_IN_PROGRESS"); + + /** + * Static value ERROR for AutoTuneState. + */ + public static final AutoTuneState ERROR = fromString("ERROR"); + + /** + * Creates a new instance of AutoTuneState value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public AutoTuneState() { + } + + /** + * Creates or finds a AutoTuneState from its string representation. + * + * @param name a name to look for. + * @return the corresponding AutoTuneState. + */ + public static AutoTuneState fromString(String name) { + return fromString(name, AutoTuneState.class); + } + + /** + * Gets known AutoTuneState values. + * + * @return known AutoTuneState values. + */ + public static Collection values() { + return values(AutoTuneState.class); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/AutoTuneStateEnumValue.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/AutoTuneStateEnumValue.java new file mode 100644 index 000000000000..9434bdf56129 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/AutoTuneStateEnumValue.java @@ -0,0 +1,93 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of AutoTuneStateEnumValue. + */ +@Fluent +public final class AutoTuneStateEnumValue implements JsonSerializable { + /* + * Property value + */ + private AutoTuneState value; + + /** + * Creates an instance of AutoTuneStateEnumValue class. + */ + public AutoTuneStateEnumValue() { + } + + /** + * Get the value property: Property value. + * + * @return the value value. + */ + public AutoTuneState value() { + return this.value; + } + + /** + * Set the value property: Property value. + * + * @param value the value value to set. + * @return the AutoTuneStateEnumValue object itself. + */ + public AutoTuneStateEnumValue withValue(AutoTuneState value) { + this.value = value; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("value", this.value == null ? null : this.value.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AutoTuneStateEnumValue from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AutoTuneStateEnumValue if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the AutoTuneStateEnumValue. + */ + public static AutoTuneStateEnumValue fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AutoTuneStateEnumValue deserializedAutoTuneStateEnumValue = new AutoTuneStateEnumValue(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + deserializedAutoTuneStateEnumValue.value = AutoTuneState.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedAutoTuneStateEnumValue; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/AvailabilityZone.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/AvailabilityZone.java new file mode 100644 index 000000000000..2c1be571120b --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/AvailabilityZone.java @@ -0,0 +1,93 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of AvailabilityZone. + */ +@Fluent +public final class AvailabilityZone implements JsonSerializable { + /* + *

The name of the Availability Zone.

+ */ + private String name; + + /** + * Creates an instance of AvailabilityZone class. + */ + public AvailabilityZone() { + } + + /** + * Get the name property: <p>The name of the Availability Zone.</p>. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: <p>The name of the Availability Zone.</p>. + * + * @param name the name value to set. + * @return the AvailabilityZone object itself. + */ + public AvailabilityZone withName(String name) { + this.name = name; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("name", this.name); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AvailabilityZone from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AvailabilityZone if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the AvailabilityZone. + */ + public static AvailabilityZone fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AvailabilityZone deserializedAvailabilityZone = new AvailabilityZone(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("name".equals(fieldName)) { + deserializedAvailabilityZone.name = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedAvailabilityZone; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/AwsAccessAnalyzerProperties.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/AwsAccessAnalyzerProperties.java new file mode 100644 index 000000000000..96e3a9c60edd --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/AwsAccessAnalyzerProperties.java @@ -0,0 +1,249 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Definition of awsAccessAnalyzerAnalyzer. + */ +@Fluent +public final class AwsAccessAnalyzerProperties implements JsonSerializable { + /* + * The configuration for the analyzer + */ + private UnusedAccessConfiguration analyzerConfiguration; + + /* + * Analyzer name + */ + private String analyzerName; + + /* + * Property archiveRules + */ + private List archiveRules; + + /* + * Amazon Resource Name (ARN) of the analyzer + */ + private String arn; + + /* + * An array of key-value pairs to apply to this resource. + */ + private List tags; + + /* + * The type of the analyzer, must be one of ACCOUNT, ORGANIZATION, ACCOUNT_UNUSED_ACCESS or + * ORGANIZATION_UNUSED_ACCESS + */ + private String type; + + /** + * Creates an instance of AwsAccessAnalyzerProperties class. + */ + public AwsAccessAnalyzerProperties() { + } + + /** + * Get the analyzerConfiguration property: The configuration for the analyzer. + * + * @return the analyzerConfiguration value. + */ + public UnusedAccessConfiguration analyzerConfiguration() { + return this.analyzerConfiguration; + } + + /** + * Set the analyzerConfiguration property: The configuration for the analyzer. + * + * @param analyzerConfiguration the analyzerConfiguration value to set. + * @return the AwsAccessAnalyzerProperties object itself. + */ + public AwsAccessAnalyzerProperties withAnalyzerConfiguration(UnusedAccessConfiguration analyzerConfiguration) { + this.analyzerConfiguration = analyzerConfiguration; + return this; + } + + /** + * Get the analyzerName property: Analyzer name. + * + * @return the analyzerName value. + */ + public String analyzerName() { + return this.analyzerName; + } + + /** + * Set the analyzerName property: Analyzer name. + * + * @param analyzerName the analyzerName value to set. + * @return the AwsAccessAnalyzerProperties object itself. + */ + public AwsAccessAnalyzerProperties withAnalyzerName(String analyzerName) { + this.analyzerName = analyzerName; + return this; + } + + /** + * Get the archiveRules property: Property archiveRules. + * + * @return the archiveRules value. + */ + public List archiveRules() { + return this.archiveRules; + } + + /** + * Set the archiveRules property: Property archiveRules. + * + * @param archiveRules the archiveRules value to set. + * @return the AwsAccessAnalyzerProperties object itself. + */ + public AwsAccessAnalyzerProperties withArchiveRules(List archiveRules) { + this.archiveRules = archiveRules; + return this; + } + + /** + * Get the arn property: Amazon Resource Name (ARN) of the analyzer. + * + * @return the arn value. + */ + public String arn() { + return this.arn; + } + + /** + * Set the arn property: Amazon Resource Name (ARN) of the analyzer. + * + * @param arn the arn value to set. + * @return the AwsAccessAnalyzerProperties object itself. + */ + public AwsAccessAnalyzerProperties withArn(String arn) { + this.arn = arn; + return this; + } + + /** + * Get the tags property: An array of key-value pairs to apply to this resource. + * + * @return the tags value. + */ + public List tags() { + return this.tags; + } + + /** + * Set the tags property: An array of key-value pairs to apply to this resource. + * + * @param tags the tags value to set. + * @return the AwsAccessAnalyzerProperties object itself. + */ + public AwsAccessAnalyzerProperties withTags(List tags) { + this.tags = tags; + return this; + } + + /** + * Get the type property: The type of the analyzer, must be one of ACCOUNT, ORGANIZATION, ACCOUNT_UNUSED_ACCESS or + * ORGANIZATION_UNUSED_ACCESS. + * + * @return the type value. + */ + public String type() { + return this.type; + } + + /** + * Set the type property: The type of the analyzer, must be one of ACCOUNT, ORGANIZATION, ACCOUNT_UNUSED_ACCESS or + * ORGANIZATION_UNUSED_ACCESS. + * + * @param type the type value to set. + * @return the AwsAccessAnalyzerProperties object itself. + */ + public AwsAccessAnalyzerProperties withType(String type) { + this.type = type; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (analyzerConfiguration() != null) { + analyzerConfiguration().validate(); + } + if (archiveRules() != null) { + archiveRules().forEach(e -> e.validate()); + } + if (tags() != null) { + tags().forEach(e -> e.validate()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("analyzerConfiguration", this.analyzerConfiguration); + jsonWriter.writeStringField("analyzerName", this.analyzerName); + jsonWriter.writeArrayField("archiveRules", this.archiveRules, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("arn", this.arn); + jsonWriter.writeArrayField("tags", this.tags, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("type", this.type); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AwsAccessAnalyzerProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AwsAccessAnalyzerProperties if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the AwsAccessAnalyzerProperties. + */ + public static AwsAccessAnalyzerProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AwsAccessAnalyzerProperties deserializedAwsAccessAnalyzerProperties = new AwsAccessAnalyzerProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("analyzerConfiguration".equals(fieldName)) { + deserializedAwsAccessAnalyzerProperties.analyzerConfiguration + = UnusedAccessConfiguration.fromJson(reader); + } else if ("analyzerName".equals(fieldName)) { + deserializedAwsAccessAnalyzerProperties.analyzerName = reader.getString(); + } else if ("archiveRules".equals(fieldName)) { + List archiveRules = reader.readArray(reader1 -> ArchiveRule.fromJson(reader1)); + deserializedAwsAccessAnalyzerProperties.archiveRules = archiveRules; + } else if ("arn".equals(fieldName)) { + deserializedAwsAccessAnalyzerProperties.arn = reader.getString(); + } else if ("tags".equals(fieldName)) { + List tags = reader.readArray(reader1 -> Tag.fromJson(reader1)); + deserializedAwsAccessAnalyzerProperties.tags = tags; + } else if ("type".equals(fieldName)) { + deserializedAwsAccessAnalyzerProperties.type = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedAwsAccessAnalyzerProperties; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/AwsAcmCertificateSummaryProperties.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/AwsAcmCertificateSummaryProperties.java new file mode 100644 index 000000000000..8ae6489eded0 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/AwsAcmCertificateSummaryProperties.java @@ -0,0 +1,745 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.time.OffsetDateTime; +import java.time.format.DateTimeFormatter; +import java.util.List; + +/** + * Definition of awsAcmCertificateSummary. + */ +@Fluent +public final class AwsAcmCertificateSummaryProperties implements JsonSerializable { + /* + *

Amazon Resource Name (ARN) of the certificate. This is of the form:

+ * arn:aws:acm:region:123456789012:certificate/12345678-1234-1234-1234-123456789012

For more + * information about ARNs, see Amazon Resource Names + * (ARNs).

+ */ + private String certificateArn; + + /* + *

The time at which the certificate was requested.

+ */ + private OffsetDateTime createdAt; + + /* + *

Fully qualified domain name (FQDN), such as www.example.com or example.com, for the certificate.

+ */ + private String domainName; + + /* + *

Indicates whether the certificate has been exported. This value exists only when the certificate type is + * PRIVATE.

+ */ + private Boolean exported; + + /* + *

Contains a list of Extended Key Usage X.509 v3 extension objects. Each object specifies a purpose for which + * the certificate public key can be used and consists of a name and an object identifier (OID).

+ */ + private List extendedKeyUsages; + + /* + *

When called by ListCertificates, + * indicates whether the full list of subject alternative names has been included in the response. If false, the + * response includes all of the subject alternative names included in the certificate. If true, the response only + * includes the first 100 subject alternative names included in the certificate. To display the full list of subject + * alternative names, use DescribeCertificate. + */ + private Boolean hasAdditionalSubjectAlternativeNames; + + /* + *

The date and time when the certificate was imported. This value exists only when the certificate type is + * IMPORTED.

+ */ + private OffsetDateTime importedAt; + + /* + *

Indicates whether the certificate is currently in use by any Amazon Web Services resources.

+ */ + private Boolean inUse; + + /* + *

The time at which the certificate was issued. This value exists only when the certificate type is + * AMAZON_ISSUED.

+ */ + private OffsetDateTime issuedAt; + + /* + *

The algorithm that was used to generate the public-private key pair.

+ */ + private KeyAlgorithmEnumValue keyAlgorithm; + + /* + *

A list of Key Usage X.509 v3 extension objects. Each object is a string value that identifies the purpose of + * the public key contained in the certificate. Possible extension values include DIGITAL_SIGNATURE, + * KEY_ENCHIPHERMENT, NON_REPUDIATION, and more.

+ */ + private List keyUsages; + + /* + *

The time after which the certificate is not valid.

+ */ + private OffsetDateTime notAfter; + + /* + *

The time before which the certificate is not valid.

+ */ + private OffsetDateTime notBefore; + + /* + *

Specifies whether the certificate is eligible for renewal. At this time, only exported private certificates + * can be renewed with the RenewCertificate command.

+ */ + private RenewalEligibilityEnumValue renewalEligibility; + + /* + *

The time at which the certificate was revoked. This value exists only when the certificate status is + * REVOKED.

+ */ + private OffsetDateTime revokedAt; + + /* + *

The status of the certificate.

A certificate enters status PENDING_VALIDATION upon being requested, + * unless it fails for any of the reasons given in the troubleshooting topic Certificate request + * fails. ACM makes repeated attempts to validate a certificate for 72 hours and then times out. If a + * certificate shows status FAILED or VALIDATION_TIMED_OUT, delete the request, correct the issue with DNS validation or Email validation, and try + * again. If validation succeeds, the certificate enters status ISSUED.

+ */ + private CertificateStatusEnumValue status; + + /* + *

One or more domain names (subject alternative names) included in the certificate. This list contains the + * domain names that are bound to the public key that is contained in the certificate. The subject alternative names + * include the canonical domain name (CN) of the certificate and additional domain names that can be used to connect + * to the website.

When called by ListCertificates, this + * parameter will only return the first 100 subject alternative names included in the certificate. To display the + * full list of subject alternative names, use DescribeCertificate. + */ + private List subjectAlternativeNameSummaries; + + /* + *

The source of the certificate. For certificates provided by ACM, this value is AMAZON_ISSUED. For + * certificates that you imported with ImportCertificate, this value is IMPORTED. ACM does not + * provide managed renewal for + * imported certificates. For more information about the differences between certificates that you import and those + * that ACM provides, see Importing Certificates in the + * Certificate Manager User Guide.

+ */ + private CertificateTypeEnumValue type; + + /** + * Creates an instance of AwsAcmCertificateSummaryProperties class. + */ + public AwsAcmCertificateSummaryProperties() { + } + + /** + * Get the certificateArn property: <p>Amazon Resource Name (ARN) of the certificate. This is of the + * form:</p> <p> + * <code>arn:aws:acm:region:123456789012:certificate/12345678-1234-1234-1234-123456789012</code> + * </p> <p>For more information about ARNs, see <a + * href='https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html'>Amazon Resource Names + * (ARNs)</a>.</p>. + * + * @return the certificateArn value. + */ + public String certificateArn() { + return this.certificateArn; + } + + /** + * Set the certificateArn property: <p>Amazon Resource Name (ARN) of the certificate. This is of the + * form:</p> <p> + * <code>arn:aws:acm:region:123456789012:certificate/12345678-1234-1234-1234-123456789012</code> + * </p> <p>For more information about ARNs, see <a + * href='https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html'>Amazon Resource Names + * (ARNs)</a>.</p>. + * + * @param certificateArn the certificateArn value to set. + * @return the AwsAcmCertificateSummaryProperties object itself. + */ + public AwsAcmCertificateSummaryProperties withCertificateArn(String certificateArn) { + this.certificateArn = certificateArn; + return this; + } + + /** + * Get the createdAt property: <p>The time at which the certificate was requested.</p>. + * + * @return the createdAt value. + */ + public OffsetDateTime createdAt() { + return this.createdAt; + } + + /** + * Set the createdAt property: <p>The time at which the certificate was requested.</p>. + * + * @param createdAt the createdAt value to set. + * @return the AwsAcmCertificateSummaryProperties object itself. + */ + public AwsAcmCertificateSummaryProperties withCreatedAt(OffsetDateTime createdAt) { + this.createdAt = createdAt; + return this; + } + + /** + * Get the domainName property: <p>Fully qualified domain name (FQDN), such as www.example.com or example.com, + * for the certificate.</p>. + * + * @return the domainName value. + */ + public String domainName() { + return this.domainName; + } + + /** + * Set the domainName property: <p>Fully qualified domain name (FQDN), such as www.example.com or example.com, + * for the certificate.</p>. + * + * @param domainName the domainName value to set. + * @return the AwsAcmCertificateSummaryProperties object itself. + */ + public AwsAcmCertificateSummaryProperties withDomainName(String domainName) { + this.domainName = domainName; + return this; + } + + /** + * Get the exported property: <p>Indicates whether the certificate has been exported. This value exists only + * when the certificate type is <code>PRIVATE</code>.</p>. + * + * @return the exported value. + */ + public Boolean exported() { + return this.exported; + } + + /** + * Set the exported property: <p>Indicates whether the certificate has been exported. This value exists only + * when the certificate type is <code>PRIVATE</code>.</p>. + * + * @param exported the exported value to set. + * @return the AwsAcmCertificateSummaryProperties object itself. + */ + public AwsAcmCertificateSummaryProperties withExported(Boolean exported) { + this.exported = exported; + return this; + } + + /** + * Get the extendedKeyUsages property: <p>Contains a list of Extended Key Usage X.509 v3 extension objects. + * Each object specifies a purpose for which the certificate public key can be used and consists of a name and an + * object identifier (OID). </p>. + * + * @return the extendedKeyUsages value. + */ + public List extendedKeyUsages() { + return this.extendedKeyUsages; + } + + /** + * Set the extendedKeyUsages property: <p>Contains a list of Extended Key Usage X.509 v3 extension objects. + * Each object specifies a purpose for which the certificate public key can be used and consists of a name and an + * object identifier (OID). </p>. + * + * @param extendedKeyUsages the extendedKeyUsages value to set. + * @return the AwsAcmCertificateSummaryProperties object itself. + */ + public AwsAcmCertificateSummaryProperties withExtendedKeyUsages(List extendedKeyUsages) { + this.extendedKeyUsages = extendedKeyUsages; + return this; + } + + /** + * Get the hasAdditionalSubjectAlternativeNames property: <p>When called by <a + * href='https://docs.aws.amazon.com/acm/latestAPIReference/API_ListCertificates.html'>ListCertificates</a>, + * indicates whether the full list of subject alternative names has been included in the response. If false, the + * response includes all of the subject alternative names included in the certificate. If true, the response only + * includes the first 100 subject alternative names included in the certificate. To display the full list of subject + * alternative names, use <a + * href='https://docs.aws.amazon.com/acm/latestAPIReference/API_DescribeCertificate.html'>DescribeCertificate</a>.</p>. + * + * @return the hasAdditionalSubjectAlternativeNames value. + */ + public Boolean hasAdditionalSubjectAlternativeNames() { + return this.hasAdditionalSubjectAlternativeNames; + } + + /** + * Set the hasAdditionalSubjectAlternativeNames property: <p>When called by <a + * href='https://docs.aws.amazon.com/acm/latestAPIReference/API_ListCertificates.html'>ListCertificates</a>, + * indicates whether the full list of subject alternative names has been included in the response. If false, the + * response includes all of the subject alternative names included in the certificate. If true, the response only + * includes the first 100 subject alternative names included in the certificate. To display the full list of subject + * alternative names, use <a + * href='https://docs.aws.amazon.com/acm/latestAPIReference/API_DescribeCertificate.html'>DescribeCertificate</a>.</p>. + * + * @param hasAdditionalSubjectAlternativeNames the hasAdditionalSubjectAlternativeNames value to set. + * @return the AwsAcmCertificateSummaryProperties object itself. + */ + public AwsAcmCertificateSummaryProperties + withHasAdditionalSubjectAlternativeNames(Boolean hasAdditionalSubjectAlternativeNames) { + this.hasAdditionalSubjectAlternativeNames = hasAdditionalSubjectAlternativeNames; + return this; + } + + /** + * Get the importedAt property: <p>The date and time when the certificate was imported. This value exists only + * when the certificate type is <code>IMPORTED</code>. </p>. + * + * @return the importedAt value. + */ + public OffsetDateTime importedAt() { + return this.importedAt; + } + + /** + * Set the importedAt property: <p>The date and time when the certificate was imported. This value exists only + * when the certificate type is <code>IMPORTED</code>. </p>. + * + * @param importedAt the importedAt value to set. + * @return the AwsAcmCertificateSummaryProperties object itself. + */ + public AwsAcmCertificateSummaryProperties withImportedAt(OffsetDateTime importedAt) { + this.importedAt = importedAt; + return this; + } + + /** + * Get the inUse property: <p>Indicates whether the certificate is currently in use by any Amazon Web Services + * resources.</p>. + * + * @return the inUse value. + */ + public Boolean inUse() { + return this.inUse; + } + + /** + * Set the inUse property: <p>Indicates whether the certificate is currently in use by any Amazon Web Services + * resources.</p>. + * + * @param inUse the inUse value to set. + * @return the AwsAcmCertificateSummaryProperties object itself. + */ + public AwsAcmCertificateSummaryProperties withInUse(Boolean inUse) { + this.inUse = inUse; + return this; + } + + /** + * Get the issuedAt property: <p>The time at which the certificate was issued. This value exists only when the + * certificate type is <code>AMAZON_ISSUED</code>. </p>. + * + * @return the issuedAt value. + */ + public OffsetDateTime issuedAt() { + return this.issuedAt; + } + + /** + * Set the issuedAt property: <p>The time at which the certificate was issued. This value exists only when the + * certificate type is <code>AMAZON_ISSUED</code>. </p>. + * + * @param issuedAt the issuedAt value to set. + * @return the AwsAcmCertificateSummaryProperties object itself. + */ + public AwsAcmCertificateSummaryProperties withIssuedAt(OffsetDateTime issuedAt) { + this.issuedAt = issuedAt; + return this; + } + + /** + * Get the keyAlgorithm property: <p>The algorithm that was used to generate the public-private key + * pair.</p>. + * + * @return the keyAlgorithm value. + */ + public KeyAlgorithmEnumValue keyAlgorithm() { + return this.keyAlgorithm; + } + + /** + * Set the keyAlgorithm property: <p>The algorithm that was used to generate the public-private key + * pair.</p>. + * + * @param keyAlgorithm the keyAlgorithm value to set. + * @return the AwsAcmCertificateSummaryProperties object itself. + */ + public AwsAcmCertificateSummaryProperties withKeyAlgorithm(KeyAlgorithmEnumValue keyAlgorithm) { + this.keyAlgorithm = keyAlgorithm; + return this; + } + + /** + * Get the keyUsages property: <p>A list of Key Usage X.509 v3 extension objects. Each object is a string + * value that identifies the purpose of the public key contained in the certificate. Possible extension values + * include DIGITAL_SIGNATURE, KEY_ENCHIPHERMENT, NON_REPUDIATION, and more.</p>. + * + * @return the keyUsages value. + */ + public List keyUsages() { + return this.keyUsages; + } + + /** + * Set the keyUsages property: <p>A list of Key Usage X.509 v3 extension objects. Each object is a string + * value that identifies the purpose of the public key contained in the certificate. Possible extension values + * include DIGITAL_SIGNATURE, KEY_ENCHIPHERMENT, NON_REPUDIATION, and more.</p>. + * + * @param keyUsages the keyUsages value to set. + * @return the AwsAcmCertificateSummaryProperties object itself. + */ + public AwsAcmCertificateSummaryProperties withKeyUsages(List keyUsages) { + this.keyUsages = keyUsages; + return this; + } + + /** + * Get the notAfter property: <p>The time after which the certificate is not valid.</p>. + * + * @return the notAfter value. + */ + public OffsetDateTime notAfter() { + return this.notAfter; + } + + /** + * Set the notAfter property: <p>The time after which the certificate is not valid.</p>. + * + * @param notAfter the notAfter value to set. + * @return the AwsAcmCertificateSummaryProperties object itself. + */ + public AwsAcmCertificateSummaryProperties withNotAfter(OffsetDateTime notAfter) { + this.notAfter = notAfter; + return this; + } + + /** + * Get the notBefore property: <p>The time before which the certificate is not valid.</p>. + * + * @return the notBefore value. + */ + public OffsetDateTime notBefore() { + return this.notBefore; + } + + /** + * Set the notBefore property: <p>The time before which the certificate is not valid.</p>. + * + * @param notBefore the notBefore value to set. + * @return the AwsAcmCertificateSummaryProperties object itself. + */ + public AwsAcmCertificateSummaryProperties withNotBefore(OffsetDateTime notBefore) { + this.notBefore = notBefore; + return this; + } + + /** + * Get the renewalEligibility property: <p>Specifies whether the certificate is eligible for renewal. At this + * time, only exported private certificates can be renewed with the <a>RenewCertificate</a> + * command.</p>. + * + * @return the renewalEligibility value. + */ + public RenewalEligibilityEnumValue renewalEligibility() { + return this.renewalEligibility; + } + + /** + * Set the renewalEligibility property: <p>Specifies whether the certificate is eligible for renewal. At this + * time, only exported private certificates can be renewed with the <a>RenewCertificate</a> + * command.</p>. + * + * @param renewalEligibility the renewalEligibility value to set. + * @return the AwsAcmCertificateSummaryProperties object itself. + */ + public AwsAcmCertificateSummaryProperties withRenewalEligibility(RenewalEligibilityEnumValue renewalEligibility) { + this.renewalEligibility = renewalEligibility; + return this; + } + + /** + * Get the revokedAt property: <p>The time at which the certificate was revoked. This value exists only when + * the certificate status is <code>REVOKED</code>. </p>. + * + * @return the revokedAt value. + */ + public OffsetDateTime revokedAt() { + return this.revokedAt; + } + + /** + * Set the revokedAt property: <p>The time at which the certificate was revoked. This value exists only when + * the certificate status is <code>REVOKED</code>. </p>. + * + * @param revokedAt the revokedAt value to set. + * @return the AwsAcmCertificateSummaryProperties object itself. + */ + public AwsAcmCertificateSummaryProperties withRevokedAt(OffsetDateTime revokedAt) { + this.revokedAt = revokedAt; + return this; + } + + /** + * Get the status property: <p>The status of the certificate.</p> <p>A certificate enters status + * PENDING_VALIDATION upon being requested, unless it fails for any of the reasons given in the troubleshooting + * topic <a href='https://docs.aws.amazon.com/acm/latest/userguide/troubleshooting-failed.html'>Certificate + * request fails</a>. ACM makes repeated attempts to validate a certificate for 72 hours and then times out. + * If a certificate shows status FAILED or VALIDATION_TIMED_OUT, delete the request, correct the issue with <a + * href='https://docs.aws.amazon.com/acm/latest/userguide/dns-validation.html'>DNS validation</a> or <a + * href='https://docs.aws.amazon.com/acm/latest/userguide/email-validation.html'>Email validation</a>, and + * try again. If validation succeeds, the certificate enters status ISSUED. </p>. + * + * @return the status value. + */ + public CertificateStatusEnumValue status() { + return this.status; + } + + /** + * Set the status property: <p>The status of the certificate.</p> <p>A certificate enters status + * PENDING_VALIDATION upon being requested, unless it fails for any of the reasons given in the troubleshooting + * topic <a href='https://docs.aws.amazon.com/acm/latest/userguide/troubleshooting-failed.html'>Certificate + * request fails</a>. ACM makes repeated attempts to validate a certificate for 72 hours and then times out. + * If a certificate shows status FAILED or VALIDATION_TIMED_OUT, delete the request, correct the issue with <a + * href='https://docs.aws.amazon.com/acm/latest/userguide/dns-validation.html'>DNS validation</a> or <a + * href='https://docs.aws.amazon.com/acm/latest/userguide/email-validation.html'>Email validation</a>, and + * try again. If validation succeeds, the certificate enters status ISSUED. </p>. + * + * @param status the status value to set. + * @return the AwsAcmCertificateSummaryProperties object itself. + */ + public AwsAcmCertificateSummaryProperties withStatus(CertificateStatusEnumValue status) { + this.status = status; + return this; + } + + /** + * Get the subjectAlternativeNameSummaries property: <p>One or more domain names (subject alternative names) + * included in the certificate. This list contains the domain names that are bound to the public key that is + * contained in the certificate. The subject alternative names include the canonical domain name (CN) of the + * certificate and additional domain names that can be used to connect to the website. </p> <p>When + * called by <a + * href='https://docs.aws.amazon.com/acm/latestAPIReference/API_ListCertificates.html'>ListCertificates</a>, + * this parameter will only return the first 100 subject alternative names included in the certificate. To display + * the full list of subject alternative names, use <a + * href='https://docs.aws.amazon.com/acm/latestAPIReference/API_DescribeCertificate.html'>DescribeCertificate</a>.</p>. + * + * @return the subjectAlternativeNameSummaries value. + */ + public List subjectAlternativeNameSummaries() { + return this.subjectAlternativeNameSummaries; + } + + /** + * Set the subjectAlternativeNameSummaries property: <p>One or more domain names (subject alternative names) + * included in the certificate. This list contains the domain names that are bound to the public key that is + * contained in the certificate. The subject alternative names include the canonical domain name (CN) of the + * certificate and additional domain names that can be used to connect to the website. </p> <p>When + * called by <a + * href='https://docs.aws.amazon.com/acm/latestAPIReference/API_ListCertificates.html'>ListCertificates</a>, + * this parameter will only return the first 100 subject alternative names included in the certificate. To display + * the full list of subject alternative names, use <a + * href='https://docs.aws.amazon.com/acm/latestAPIReference/API_DescribeCertificate.html'>DescribeCertificate</a>.</p>. + * + * @param subjectAlternativeNameSummaries the subjectAlternativeNameSummaries value to set. + * @return the AwsAcmCertificateSummaryProperties object itself. + */ + public AwsAcmCertificateSummaryProperties + withSubjectAlternativeNameSummaries(List subjectAlternativeNameSummaries) { + this.subjectAlternativeNameSummaries = subjectAlternativeNameSummaries; + return this; + } + + /** + * Get the type property: <p>The source of the certificate. For certificates provided by ACM, this value is + * <code>AMAZON_ISSUED</code>. For certificates that you imported with + * <a>ImportCertificate</a>, this value is <code>IMPORTED</code>. ACM does not provide <a + * href='https://docs.aws.amazon.com/acm/latest/userguide/acm-renewal.html'>managed renewal</a> for + * imported certificates. For more information about the differences between certificates that you import and those + * that ACM provides, see <a + * href='https://docs.aws.amazon.com/acm/latest/userguide/import-certificate.html'>Importing + * Certificates</a> in the <i>Certificate Manager User Guide</i>. </p>. + * + * @return the type value. + */ + public CertificateTypeEnumValue type() { + return this.type; + } + + /** + * Set the type property: <p>The source of the certificate. For certificates provided by ACM, this value is + * <code>AMAZON_ISSUED</code>. For certificates that you imported with + * <a>ImportCertificate</a>, this value is <code>IMPORTED</code>. ACM does not provide <a + * href='https://docs.aws.amazon.com/acm/latest/userguide/acm-renewal.html'>managed renewal</a> for + * imported certificates. For more information about the differences between certificates that you import and those + * that ACM provides, see <a + * href='https://docs.aws.amazon.com/acm/latest/userguide/import-certificate.html'>Importing + * Certificates</a> in the <i>Certificate Manager User Guide</i>. </p>. + * + * @param type the type value to set. + * @return the AwsAcmCertificateSummaryProperties object itself. + */ + public AwsAcmCertificateSummaryProperties withType(CertificateTypeEnumValue type) { + this.type = type; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (keyAlgorithm() != null) { + keyAlgorithm().validate(); + } + if (renewalEligibility() != null) { + renewalEligibility().validate(); + } + if (status() != null) { + status().validate(); + } + if (type() != null) { + type().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("certificateArn", this.certificateArn); + jsonWriter.writeStringField("createdAt", + this.createdAt == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.createdAt)); + jsonWriter.writeStringField("domainName", this.domainName); + jsonWriter.writeBooleanField("exported", this.exported); + jsonWriter.writeArrayField("extendedKeyUsages", this.extendedKeyUsages, + (writer, element) -> writer.writeString(element == null ? null : element.toString())); + jsonWriter.writeBooleanField("hasAdditionalSubjectAlternativeNames", this.hasAdditionalSubjectAlternativeNames); + jsonWriter.writeStringField("importedAt", + this.importedAt == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.importedAt)); + jsonWriter.writeBooleanField("inUse", this.inUse); + jsonWriter.writeStringField("issuedAt", + this.issuedAt == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.issuedAt)); + jsonWriter.writeJsonField("keyAlgorithm", this.keyAlgorithm); + jsonWriter.writeArrayField("keyUsages", this.keyUsages, + (writer, element) -> writer.writeString(element == null ? null : element.toString())); + jsonWriter.writeStringField("notAfter", + this.notAfter == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.notAfter)); + jsonWriter.writeStringField("notBefore", + this.notBefore == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.notBefore)); + jsonWriter.writeJsonField("renewalEligibility", this.renewalEligibility); + jsonWriter.writeStringField("revokedAt", + this.revokedAt == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.revokedAt)); + jsonWriter.writeJsonField("status", this.status); + jsonWriter.writeArrayField("subjectAlternativeNameSummaries", this.subjectAlternativeNameSummaries, + (writer, element) -> writer.writeString(element)); + jsonWriter.writeJsonField("type", this.type); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AwsAcmCertificateSummaryProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AwsAcmCertificateSummaryProperties if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the AwsAcmCertificateSummaryProperties. + */ + public static AwsAcmCertificateSummaryProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AwsAcmCertificateSummaryProperties deserializedAwsAcmCertificateSummaryProperties + = new AwsAcmCertificateSummaryProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("certificateArn".equals(fieldName)) { + deserializedAwsAcmCertificateSummaryProperties.certificateArn = reader.getString(); + } else if ("createdAt".equals(fieldName)) { + deserializedAwsAcmCertificateSummaryProperties.createdAt = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("domainName".equals(fieldName)) { + deserializedAwsAcmCertificateSummaryProperties.domainName = reader.getString(); + } else if ("exported".equals(fieldName)) { + deserializedAwsAcmCertificateSummaryProperties.exported + = reader.getNullable(JsonReader::getBoolean); + } else if ("extendedKeyUsages".equals(fieldName)) { + List extendedKeyUsages + = reader.readArray(reader1 -> ExtendedKeyUsageName.fromString(reader1.getString())); + deserializedAwsAcmCertificateSummaryProperties.extendedKeyUsages = extendedKeyUsages; + } else if ("hasAdditionalSubjectAlternativeNames".equals(fieldName)) { + deserializedAwsAcmCertificateSummaryProperties.hasAdditionalSubjectAlternativeNames + = reader.getNullable(JsonReader::getBoolean); + } else if ("importedAt".equals(fieldName)) { + deserializedAwsAcmCertificateSummaryProperties.importedAt = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("inUse".equals(fieldName)) { + deserializedAwsAcmCertificateSummaryProperties.inUse = reader.getNullable(JsonReader::getBoolean); + } else if ("issuedAt".equals(fieldName)) { + deserializedAwsAcmCertificateSummaryProperties.issuedAt = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("keyAlgorithm".equals(fieldName)) { + deserializedAwsAcmCertificateSummaryProperties.keyAlgorithm + = KeyAlgorithmEnumValue.fromJson(reader); + } else if ("keyUsages".equals(fieldName)) { + List keyUsages + = reader.readArray(reader1 -> KeyUsageName.fromString(reader1.getString())); + deserializedAwsAcmCertificateSummaryProperties.keyUsages = keyUsages; + } else if ("notAfter".equals(fieldName)) { + deserializedAwsAcmCertificateSummaryProperties.notAfter = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("notBefore".equals(fieldName)) { + deserializedAwsAcmCertificateSummaryProperties.notBefore = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("renewalEligibility".equals(fieldName)) { + deserializedAwsAcmCertificateSummaryProperties.renewalEligibility + = RenewalEligibilityEnumValue.fromJson(reader); + } else if ("revokedAt".equals(fieldName)) { + deserializedAwsAcmCertificateSummaryProperties.revokedAt = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("status".equals(fieldName)) { + deserializedAwsAcmCertificateSummaryProperties.status = CertificateStatusEnumValue.fromJson(reader); + } else if ("subjectAlternativeNameSummaries".equals(fieldName)) { + List subjectAlternativeNameSummaries = reader.readArray(reader1 -> reader1.getString()); + deserializedAwsAcmCertificateSummaryProperties.subjectAlternativeNameSummaries + = subjectAlternativeNameSummaries; + } else if ("type".equals(fieldName)) { + deserializedAwsAcmCertificateSummaryProperties.type = CertificateTypeEnumValue.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedAwsAcmCertificateSummaryProperties; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/AwsApiGatewayRestApiProperties.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/AwsApiGatewayRestApiProperties.java new file mode 100644 index 000000000000..af39561bcc62 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/AwsApiGatewayRestApiProperties.java @@ -0,0 +1,667 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; +import java.util.Map; + +/** + * Definition of awsApiGatewayRestApi. + */ +@Fluent +public final class AwsApiGatewayRestApiProperties implements JsonSerializable { + /* + * The source of the API key for metering requests according to a usage plan. Valid values are: ``HEADER`` to read + * the API key from the ``X-API-Key`` header of a request. ``AUTHORIZER`` to read the API key from the + * ``UsageIdentifierKey`` from a custom authorizer. + */ + private String apiKeySourceType; + + /* + * The list of binary media types supported by the RestApi. By default, the RestApi supports only UTF-8-encoded text + * payloads. + */ + private List binaryMediaTypes; + + /* + * An OpenAPI specification that defines a set of RESTful APIs in JSON format. For YAML templates, you can also + * provide the specification in YAML format. + */ + private Map body; + + /* + * The Amazon Simple Storage Service (Amazon S3) location that points to an OpenAPI file, which defines a set of + * RESTful APIs in JSON or YAML format. ``S3Location`` is a property of the + * [AWS::ApiGateway::RestApi](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-apigateway + * -restapi.html) resource that specifies the Amazon S3 location of a OpenAPI (formerly Swagger) file that defines a + * set of RESTful APIs in JSON or YAML. On January 1, 2016, the Swagger Specification was donated to the [OpenAPI + * initiative](https://docs.aws.amazon.com/https://www.openapis.org/), becoming the foundation of the OpenAPI + * Specification. + */ + private S3Location bodyS3Location; + + /* + * The ID of the RestApi that you want to clone from. + */ + private String cloneFrom; + + /* + * The description of the RestApi. + */ + private String description; + + /* + * Specifies whether clients can invoke your API by using the default ``execute-api`` endpoint. By default, clients + * can invoke your API with the default ``https://{api_id}.execute-api.{region}.amazonaws.com`` endpoint. To require + * that clients use a custom domain name to invoke your API, disable the default endpoint + */ + private Boolean disableExecuteApiEndpoint; + + /* + * A list of the endpoint types of the API. Use this property when creating an API. When importing an existing API, + * specify the endpoint configuration types using the ``Parameters`` property. The ``EndpointConfiguration`` + * property type specifies the endpoint types of a REST API. ``EndpointConfiguration`` is a property of the + * [AWS::ApiGateway::RestApi](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-apigateway + * -restapi.html) resource. + */ + private EndpointConfiguration endpointConfiguration; + + /* + * A query parameter to indicate whether to rollback the API update (``true``) or not (``false``) when a warning is + * encountered. The default value is ``false``. + */ + private Boolean failOnWarnings; + + /* + * A nullable integer that is used to enable compression (with non-negative between 0 and 10485760 (10M) bytes, + * inclusive) or disable compression (with a null value) on an API. When compression is enabled, compression or + * decompression is not applied on the payload if the payload size is smaller than this value. Setting it to zero + * allows compression for any payload size. + */ + private Integer minimumCompressionSize; + + /* + * This property applies only when you use OpenAPI to define your REST API. The ``Mode`` determines how API Gateway + * handles resource updates. Valid values are ``overwrite`` or ``merge``. For ``overwrite``, the new API definition + * replaces the existing one. The existing API identifier remains unchanged. For ``merge``, the new API definition + * is merged with the existing API. If you don't specify this property, a default value is chosen. For REST APIs + * created before March 29, 2021, the default is ``overwrite``. For REST APIs created after March 29, 2021, the new + * API definition takes precedence, but any container types such as endpoint configurations and binary media types + * are merged with the existing API. Use the default mode to define top-level ``RestApi`` properties in addition to + * using OpenAPI. Generally, it's preferred to use API Gateway's OpenAPI extensions to model these properties. + */ + private String mode; + + /* + * The name of the RestApi. A name is required if the REST API is not based on an OpenAPI specification. + */ + private String name; + + /* + * Custom header parameters as part of the request. For example, to exclude DocumentationParts from an imported API, + * set ``ignore=documentation`` as a ``parameters`` value, as in the AWS CLI command of ``aws apigateway + * import-rest-api --parameters ignore=documentation --body 'file:///path/to/imported-api-body.json'``. + */ + private Map parameters; + + /* + * A policy document that contains the permissions for the ``RestApi`` resource. To set the ARN for the policy, use + * the ``!Join`` intrinsic function with ``''`` as delimiter and values of ``'execute-api:/'`` and ``'*'``. + */ + private String policy; + + /* + * Property restApiId + */ + private String restApiId; + + /* + * Property rootResourceId + */ + private String rootResourceId; + + /* + * The key-value map of strings. The valid character set is [a-zA-Z+-=._:/]. The tag key can be up to 128 characters + * and must not start with ``aws:``. The tag value can be up to 256 characters. + */ + private List tags; + + /** + * Creates an instance of AwsApiGatewayRestApiProperties class. + */ + public AwsApiGatewayRestApiProperties() { + } + + /** + * Get the apiKeySourceType property: The source of the API key for metering requests according to a usage plan. + * Valid values are: ``HEADER`` to read the API key from the ``X-API-Key`` header of a request. ``AUTHORIZER`` to + * read the API key from the ``UsageIdentifierKey`` from a custom authorizer. + * + * @return the apiKeySourceType value. + */ + public String apiKeySourceType() { + return this.apiKeySourceType; + } + + /** + * Set the apiKeySourceType property: The source of the API key for metering requests according to a usage plan. + * Valid values are: ``HEADER`` to read the API key from the ``X-API-Key`` header of a request. ``AUTHORIZER`` to + * read the API key from the ``UsageIdentifierKey`` from a custom authorizer. + * + * @param apiKeySourceType the apiKeySourceType value to set. + * @return the AwsApiGatewayRestApiProperties object itself. + */ + public AwsApiGatewayRestApiProperties withApiKeySourceType(String apiKeySourceType) { + this.apiKeySourceType = apiKeySourceType; + return this; + } + + /** + * Get the binaryMediaTypes property: The list of binary media types supported by the RestApi. By default, the + * RestApi supports only UTF-8-encoded text payloads. + * + * @return the binaryMediaTypes value. + */ + public List binaryMediaTypes() { + return this.binaryMediaTypes; + } + + /** + * Set the binaryMediaTypes property: The list of binary media types supported by the RestApi. By default, the + * RestApi supports only UTF-8-encoded text payloads. + * + * @param binaryMediaTypes the binaryMediaTypes value to set. + * @return the AwsApiGatewayRestApiProperties object itself. + */ + public AwsApiGatewayRestApiProperties withBinaryMediaTypes(List binaryMediaTypes) { + this.binaryMediaTypes = binaryMediaTypes; + return this; + } + + /** + * Get the body property: An OpenAPI specification that defines a set of RESTful APIs in JSON format. For YAML + * templates, you can also provide the specification in YAML format. + * + * @return the body value. + */ + public Map body() { + return this.body; + } + + /** + * Set the body property: An OpenAPI specification that defines a set of RESTful APIs in JSON format. For YAML + * templates, you can also provide the specification in YAML format. + * + * @param body the body value to set. + * @return the AwsApiGatewayRestApiProperties object itself. + */ + public AwsApiGatewayRestApiProperties withBody(Map body) { + this.body = body; + return this; + } + + /** + * Get the bodyS3Location property: The Amazon Simple Storage Service (Amazon S3) location that points to an OpenAPI + * file, which defines a set of RESTful APIs in JSON or YAML format. ``S3Location`` is a property of the + * [AWS::ApiGateway::RestApi](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-apigateway-restapi.html) + * resource that specifies the Amazon S3 location of a OpenAPI (formerly Swagger) file that defines a set of RESTful + * APIs in JSON or YAML. On January 1, 2016, the Swagger Specification was donated to the [OpenAPI + * initiative](https://docs.aws.amazon.com/https://www.openapis.org/), becoming the foundation of the OpenAPI + * Specification. + * + * @return the bodyS3Location value. + */ + public S3Location bodyS3Location() { + return this.bodyS3Location; + } + + /** + * Set the bodyS3Location property: The Amazon Simple Storage Service (Amazon S3) location that points to an OpenAPI + * file, which defines a set of RESTful APIs in JSON or YAML format. ``S3Location`` is a property of the + * [AWS::ApiGateway::RestApi](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-apigateway-restapi.html) + * resource that specifies the Amazon S3 location of a OpenAPI (formerly Swagger) file that defines a set of RESTful + * APIs in JSON or YAML. On January 1, 2016, the Swagger Specification was donated to the [OpenAPI + * initiative](https://docs.aws.amazon.com/https://www.openapis.org/), becoming the foundation of the OpenAPI + * Specification. + * + * @param bodyS3Location the bodyS3Location value to set. + * @return the AwsApiGatewayRestApiProperties object itself. + */ + public AwsApiGatewayRestApiProperties withBodyS3Location(S3Location bodyS3Location) { + this.bodyS3Location = bodyS3Location; + return this; + } + + /** + * Get the cloneFrom property: The ID of the RestApi that you want to clone from. + * + * @return the cloneFrom value. + */ + public String cloneFrom() { + return this.cloneFrom; + } + + /** + * Set the cloneFrom property: The ID of the RestApi that you want to clone from. + * + * @param cloneFrom the cloneFrom value to set. + * @return the AwsApiGatewayRestApiProperties object itself. + */ + public AwsApiGatewayRestApiProperties withCloneFrom(String cloneFrom) { + this.cloneFrom = cloneFrom; + return this; + } + + /** + * Get the description property: The description of the RestApi. + * + * @return the description value. + */ + public String description() { + return this.description; + } + + /** + * Set the description property: The description of the RestApi. + * + * @param description the description value to set. + * @return the AwsApiGatewayRestApiProperties object itself. + */ + public AwsApiGatewayRestApiProperties withDescription(String description) { + this.description = description; + return this; + } + + /** + * Get the disableExecuteApiEndpoint property: Specifies whether clients can invoke your API by using the default + * ``execute-api`` endpoint. By default, clients can invoke your API with the default + * ``https://{api_id}.execute-api.{region}.amazonaws.com`` endpoint. To require that clients use a custom domain + * name to invoke your API, disable the default endpoint. + * + * @return the disableExecuteApiEndpoint value. + */ + public Boolean disableExecuteApiEndpoint() { + return this.disableExecuteApiEndpoint; + } + + /** + * Set the disableExecuteApiEndpoint property: Specifies whether clients can invoke your API by using the default + * ``execute-api`` endpoint. By default, clients can invoke your API with the default + * ``https://{api_id}.execute-api.{region}.amazonaws.com`` endpoint. To require that clients use a custom domain + * name to invoke your API, disable the default endpoint. + * + * @param disableExecuteApiEndpoint the disableExecuteApiEndpoint value to set. + * @return the AwsApiGatewayRestApiProperties object itself. + */ + public AwsApiGatewayRestApiProperties withDisableExecuteApiEndpoint(Boolean disableExecuteApiEndpoint) { + this.disableExecuteApiEndpoint = disableExecuteApiEndpoint; + return this; + } + + /** + * Get the endpointConfiguration property: A list of the endpoint types of the API. Use this property when creating + * an API. When importing an existing API, specify the endpoint configuration types using the ``Parameters`` + * property. The ``EndpointConfiguration`` property type specifies the endpoint types of a REST API. + * ``EndpointConfiguration`` is a property of the + * [AWS::ApiGateway::RestApi](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-apigateway-restapi.html) + * resource. + * + * @return the endpointConfiguration value. + */ + public EndpointConfiguration endpointConfiguration() { + return this.endpointConfiguration; + } + + /** + * Set the endpointConfiguration property: A list of the endpoint types of the API. Use this property when creating + * an API. When importing an existing API, specify the endpoint configuration types using the ``Parameters`` + * property. The ``EndpointConfiguration`` property type specifies the endpoint types of a REST API. + * ``EndpointConfiguration`` is a property of the + * [AWS::ApiGateway::RestApi](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-apigateway-restapi.html) + * resource. + * + * @param endpointConfiguration the endpointConfiguration value to set. + * @return the AwsApiGatewayRestApiProperties object itself. + */ + public AwsApiGatewayRestApiProperties withEndpointConfiguration(EndpointConfiguration endpointConfiguration) { + this.endpointConfiguration = endpointConfiguration; + return this; + } + + /** + * Get the failOnWarnings property: A query parameter to indicate whether to rollback the API update (``true``) or + * not (``false``) when a warning is encountered. The default value is ``false``. + * + * @return the failOnWarnings value. + */ + public Boolean failOnWarnings() { + return this.failOnWarnings; + } + + /** + * Set the failOnWarnings property: A query parameter to indicate whether to rollback the API update (``true``) or + * not (``false``) when a warning is encountered. The default value is ``false``. + * + * @param failOnWarnings the failOnWarnings value to set. + * @return the AwsApiGatewayRestApiProperties object itself. + */ + public AwsApiGatewayRestApiProperties withFailOnWarnings(Boolean failOnWarnings) { + this.failOnWarnings = failOnWarnings; + return this; + } + + /** + * Get the minimumCompressionSize property: A nullable integer that is used to enable compression (with non-negative + * between 0 and 10485760 (10M) bytes, inclusive) or disable compression (with a null value) on an API. When + * compression is enabled, compression or decompression is not applied on the payload if the payload size is smaller + * than this value. Setting it to zero allows compression for any payload size. + * + * @return the minimumCompressionSize value. + */ + public Integer minimumCompressionSize() { + return this.minimumCompressionSize; + } + + /** + * Set the minimumCompressionSize property: A nullable integer that is used to enable compression (with non-negative + * between 0 and 10485760 (10M) bytes, inclusive) or disable compression (with a null value) on an API. When + * compression is enabled, compression or decompression is not applied on the payload if the payload size is smaller + * than this value. Setting it to zero allows compression for any payload size. + * + * @param minimumCompressionSize the minimumCompressionSize value to set. + * @return the AwsApiGatewayRestApiProperties object itself. + */ + public AwsApiGatewayRestApiProperties withMinimumCompressionSize(Integer minimumCompressionSize) { + this.minimumCompressionSize = minimumCompressionSize; + return this; + } + + /** + * Get the mode property: This property applies only when you use OpenAPI to define your REST API. The ``Mode`` + * determines how API Gateway handles resource updates. Valid values are ``overwrite`` or ``merge``. For + * ``overwrite``, the new API definition replaces the existing one. The existing API identifier remains unchanged. + * For ``merge``, the new API definition is merged with the existing API. If you don't specify this property, a + * default value is chosen. For REST APIs created before March 29, 2021, the default is ``overwrite``. For REST APIs + * created after March 29, 2021, the new API definition takes precedence, but any container types such as endpoint + * configurations and binary media types are merged with the existing API. Use the default mode to define top-level + * ``RestApi`` properties in addition to using OpenAPI. Generally, it's preferred to use API Gateway's OpenAPI + * extensions to model these properties. + * + * @return the mode value. + */ + public String mode() { + return this.mode; + } + + /** + * Set the mode property: This property applies only when you use OpenAPI to define your REST API. The ``Mode`` + * determines how API Gateway handles resource updates. Valid values are ``overwrite`` or ``merge``. For + * ``overwrite``, the new API definition replaces the existing one. The existing API identifier remains unchanged. + * For ``merge``, the new API definition is merged with the existing API. If you don't specify this property, a + * default value is chosen. For REST APIs created before March 29, 2021, the default is ``overwrite``. For REST APIs + * created after March 29, 2021, the new API definition takes precedence, but any container types such as endpoint + * configurations and binary media types are merged with the existing API. Use the default mode to define top-level + * ``RestApi`` properties in addition to using OpenAPI. Generally, it's preferred to use API Gateway's OpenAPI + * extensions to model these properties. + * + * @param mode the mode value to set. + * @return the AwsApiGatewayRestApiProperties object itself. + */ + public AwsApiGatewayRestApiProperties withMode(String mode) { + this.mode = mode; + return this; + } + + /** + * Get the name property: The name of the RestApi. A name is required if the REST API is not based on an OpenAPI + * specification. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: The name of the RestApi. A name is required if the REST API is not based on an OpenAPI + * specification. + * + * @param name the name value to set. + * @return the AwsApiGatewayRestApiProperties object itself. + */ + public AwsApiGatewayRestApiProperties withName(String name) { + this.name = name; + return this; + } + + /** + * Get the parameters property: Custom header parameters as part of the request. For example, to exclude + * DocumentationParts from an imported API, set ``ignore=documentation`` as a ``parameters`` value, as in the AWS + * CLI command of ``aws apigateway import-rest-api --parameters ignore=documentation --body + * 'file:///path/to/imported-api-body.json'``. + * + * @return the parameters value. + */ + public Map parameters() { + return this.parameters; + } + + /** + * Set the parameters property: Custom header parameters as part of the request. For example, to exclude + * DocumentationParts from an imported API, set ``ignore=documentation`` as a ``parameters`` value, as in the AWS + * CLI command of ``aws apigateway import-rest-api --parameters ignore=documentation --body + * 'file:///path/to/imported-api-body.json'``. + * + * @param parameters the parameters value to set. + * @return the AwsApiGatewayRestApiProperties object itself. + */ + public AwsApiGatewayRestApiProperties withParameters(Map parameters) { + this.parameters = parameters; + return this; + } + + /** + * Get the policy property: A policy document that contains the permissions for the ``RestApi`` resource. To set the + * ARN for the policy, use the ``!Join`` intrinsic function with ``''`` as delimiter and values of + * ``'execute-api:/'`` and ``'*'``. + * + * @return the policy value. + */ + public String policy() { + return this.policy; + } + + /** + * Set the policy property: A policy document that contains the permissions for the ``RestApi`` resource. To set the + * ARN for the policy, use the ``!Join`` intrinsic function with ``''`` as delimiter and values of + * ``'execute-api:/'`` and ``'*'``. + * + * @param policy the policy value to set. + * @return the AwsApiGatewayRestApiProperties object itself. + */ + public AwsApiGatewayRestApiProperties withPolicy(String policy) { + this.policy = policy; + return this; + } + + /** + * Get the restApiId property: Property restApiId. + * + * @return the restApiId value. + */ + public String restApiId() { + return this.restApiId; + } + + /** + * Set the restApiId property: Property restApiId. + * + * @param restApiId the restApiId value to set. + * @return the AwsApiGatewayRestApiProperties object itself. + */ + public AwsApiGatewayRestApiProperties withRestApiId(String restApiId) { + this.restApiId = restApiId; + return this; + } + + /** + * Get the rootResourceId property: Property rootResourceId. + * + * @return the rootResourceId value. + */ + public String rootResourceId() { + return this.rootResourceId; + } + + /** + * Set the rootResourceId property: Property rootResourceId. + * + * @param rootResourceId the rootResourceId value to set. + * @return the AwsApiGatewayRestApiProperties object itself. + */ + public AwsApiGatewayRestApiProperties withRootResourceId(String rootResourceId) { + this.rootResourceId = rootResourceId; + return this; + } + + /** + * Get the tags property: The key-value map of strings. The valid character set is [a-zA-Z+-=._:/]. The tag key can + * be up to 128 characters and must not start with ``aws:``. The tag value can be up to 256 characters. + * + * @return the tags value. + */ + public List tags() { + return this.tags; + } + + /** + * Set the tags property: The key-value map of strings. The valid character set is [a-zA-Z+-=._:/]. The tag key can + * be up to 128 characters and must not start with ``aws:``. The tag value can be up to 256 characters. + * + * @param tags the tags value to set. + * @return the AwsApiGatewayRestApiProperties object itself. + */ + public AwsApiGatewayRestApiProperties withTags(List tags) { + this.tags = tags; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (bodyS3Location() != null) { + bodyS3Location().validate(); + } + if (endpointConfiguration() != null) { + endpointConfiguration().validate(); + } + if (tags() != null) { + tags().forEach(e -> e.validate()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("apiKeySourceType", this.apiKeySourceType); + jsonWriter.writeArrayField("binaryMediaTypes", this.binaryMediaTypes, + (writer, element) -> writer.writeString(element)); + jsonWriter.writeMapField("body", this.body, (writer, element) -> writer.writeUntyped(element)); + jsonWriter.writeJsonField("bodyS3Location", this.bodyS3Location); + jsonWriter.writeStringField("cloneFrom", this.cloneFrom); + jsonWriter.writeStringField("description", this.description); + jsonWriter.writeBooleanField("disableExecuteApiEndpoint", this.disableExecuteApiEndpoint); + jsonWriter.writeJsonField("endpointConfiguration", this.endpointConfiguration); + jsonWriter.writeBooleanField("failOnWarnings", this.failOnWarnings); + jsonWriter.writeNumberField("minimumCompressionSize", this.minimumCompressionSize); + jsonWriter.writeStringField("mode", this.mode); + jsonWriter.writeStringField("name", this.name); + jsonWriter.writeMapField("parameters", this.parameters, (writer, element) -> writer.writeString(element)); + jsonWriter.writeStringField("policy", this.policy); + jsonWriter.writeStringField("restApiId", this.restApiId); + jsonWriter.writeStringField("rootResourceId", this.rootResourceId); + jsonWriter.writeArrayField("tags", this.tags, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AwsApiGatewayRestApiProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AwsApiGatewayRestApiProperties if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the AwsApiGatewayRestApiProperties. + */ + public static AwsApiGatewayRestApiProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AwsApiGatewayRestApiProperties deserializedAwsApiGatewayRestApiProperties + = new AwsApiGatewayRestApiProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("apiKeySourceType".equals(fieldName)) { + deserializedAwsApiGatewayRestApiProperties.apiKeySourceType = reader.getString(); + } else if ("binaryMediaTypes".equals(fieldName)) { + List binaryMediaTypes = reader.readArray(reader1 -> reader1.getString()); + deserializedAwsApiGatewayRestApiProperties.binaryMediaTypes = binaryMediaTypes; + } else if ("body".equals(fieldName)) { + Map body = reader.readMap(reader1 -> reader1.readUntyped()); + deserializedAwsApiGatewayRestApiProperties.body = body; + } else if ("bodyS3Location".equals(fieldName)) { + deserializedAwsApiGatewayRestApiProperties.bodyS3Location = S3Location.fromJson(reader); + } else if ("cloneFrom".equals(fieldName)) { + deserializedAwsApiGatewayRestApiProperties.cloneFrom = reader.getString(); + } else if ("description".equals(fieldName)) { + deserializedAwsApiGatewayRestApiProperties.description = reader.getString(); + } else if ("disableExecuteApiEndpoint".equals(fieldName)) { + deserializedAwsApiGatewayRestApiProperties.disableExecuteApiEndpoint + = reader.getNullable(JsonReader::getBoolean); + } else if ("endpointConfiguration".equals(fieldName)) { + deserializedAwsApiGatewayRestApiProperties.endpointConfiguration + = EndpointConfiguration.fromJson(reader); + } else if ("failOnWarnings".equals(fieldName)) { + deserializedAwsApiGatewayRestApiProperties.failOnWarnings + = reader.getNullable(JsonReader::getBoolean); + } else if ("minimumCompressionSize".equals(fieldName)) { + deserializedAwsApiGatewayRestApiProperties.minimumCompressionSize + = reader.getNullable(JsonReader::getInt); + } else if ("mode".equals(fieldName)) { + deserializedAwsApiGatewayRestApiProperties.mode = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedAwsApiGatewayRestApiProperties.name = reader.getString(); + } else if ("parameters".equals(fieldName)) { + Map parameters = reader.readMap(reader1 -> reader1.getString()); + deserializedAwsApiGatewayRestApiProperties.parameters = parameters; + } else if ("policy".equals(fieldName)) { + deserializedAwsApiGatewayRestApiProperties.policy = reader.getString(); + } else if ("restApiId".equals(fieldName)) { + deserializedAwsApiGatewayRestApiProperties.restApiId = reader.getString(); + } else if ("rootResourceId".equals(fieldName)) { + deserializedAwsApiGatewayRestApiProperties.rootResourceId = reader.getString(); + } else if ("tags".equals(fieldName)) { + List tags = reader.readArray(reader1 -> TagAutoGenerated.fromJson(reader1)); + deserializedAwsApiGatewayRestApiProperties.tags = tags; + } else { + reader.skipChildren(); + } + } + + return deserializedAwsApiGatewayRestApiProperties; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/AwsApiGatewayStageProperties.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/AwsApiGatewayStageProperties.java new file mode 100644 index 000000000000..e8a5c948b36e --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/AwsApiGatewayStageProperties.java @@ -0,0 +1,513 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; +import java.util.Map; + +/** + * Definition of awsApiGatewayStage. + */ +@Fluent +public final class AwsApiGatewayStageProperties implements JsonSerializable { + /* + * Access log settings, including the access log format and access log destination ARN. The ``AccessLogSetting`` + * property type specifies settings for logging access in this stage. ``AccessLogSetting`` is a property of the + * [AWS::ApiGateway::Stage](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-apigateway- + * stage.html) resource. + */ + private AccessLogSetting accessLogSetting; + + /* + * Specifies whether a cache cluster is enabled for the stage. + */ + private Boolean cacheClusterEnabled; + + /* + * The stage's cache capacity in GB. For more information about choosing a cache size, see [Enabling API caching to + * enhance responsiveness](https://docs.aws.amazon.com/apigateway/latest/developerguide/api-gateway-caching.html). + */ + private String cacheClusterSize; + + /* + * Settings for the canary deployment in this stage. Configuration settings of a canary deployment. + */ + private CanarySetting canarySetting; + + /* + * The identifier of a client certificate for an API stage. + */ + private String clientCertificateId; + + /* + * The identifier of the Deployment that the stage points to. + */ + private String deploymentId; + + /* + * The stage's description. + */ + private String description; + + /* + * The version of the associated API documentation. + */ + private String documentationVersion; + + /* + * A map that defines the method settings for a Stage resource. Keys (designated as ``/{method_setting_key`` below) + * are method paths defined as ``{resource_path}/{http_method}`` for an individual method override, or + * ``/\*/\*`` for overriding all methods in the stage. + */ + private List methodSettings; + + /* + * The string identifier of the associated RestApi. + */ + private String restApiId; + + /* + * The name of the stage is the first path segment in the Uniform Resource Identifier (URI) of a call to API + * Gateway. Stage names can only contain alphanumeric characters, hyphens, and underscores. Maximum length is 128 + * characters. + */ + private String stageName; + + /* + * The collection of tags. Each tag element is associated with a given resource. + */ + private List tags; + + /* + * Specifies whether active tracing with X-ray is enabled for the Stage. + */ + private Boolean tracingEnabled; + + /* + * A map (string-to-string map) that defines the stage variables, where the variable name is the key and the + * variable value is the value. Variable names are limited to alphanumeric characters. Values must match the + * following regular expression: ``[A-Za-z0-9-._~:/?#&=,]+``. + */ + private Map variables; + + /** + * Creates an instance of AwsApiGatewayStageProperties class. + */ + public AwsApiGatewayStageProperties() { + } + + /** + * Get the accessLogSetting property: Access log settings, including the access log format and access log + * destination ARN. The ``AccessLogSetting`` property type specifies settings for logging access in this stage. + * ``AccessLogSetting`` is a property of the + * [AWS::ApiGateway::Stage](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-apigateway-stage.html) + * resource. + * + * @return the accessLogSetting value. + */ + public AccessLogSetting accessLogSetting() { + return this.accessLogSetting; + } + + /** + * Set the accessLogSetting property: Access log settings, including the access log format and access log + * destination ARN. The ``AccessLogSetting`` property type specifies settings for logging access in this stage. + * ``AccessLogSetting`` is a property of the + * [AWS::ApiGateway::Stage](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-apigateway-stage.html) + * resource. + * + * @param accessLogSetting the accessLogSetting value to set. + * @return the AwsApiGatewayStageProperties object itself. + */ + public AwsApiGatewayStageProperties withAccessLogSetting(AccessLogSetting accessLogSetting) { + this.accessLogSetting = accessLogSetting; + return this; + } + + /** + * Get the cacheClusterEnabled property: Specifies whether a cache cluster is enabled for the stage. + * + * @return the cacheClusterEnabled value. + */ + public Boolean cacheClusterEnabled() { + return this.cacheClusterEnabled; + } + + /** + * Set the cacheClusterEnabled property: Specifies whether a cache cluster is enabled for the stage. + * + * @param cacheClusterEnabled the cacheClusterEnabled value to set. + * @return the AwsApiGatewayStageProperties object itself. + */ + public AwsApiGatewayStageProperties withCacheClusterEnabled(Boolean cacheClusterEnabled) { + this.cacheClusterEnabled = cacheClusterEnabled; + return this; + } + + /** + * Get the cacheClusterSize property: The stage's cache capacity in GB. For more information about choosing a cache + * size, see [Enabling API caching to enhance + * responsiveness](https://docs.aws.amazon.com/apigateway/latest/developerguide/api-gateway-caching.html). + * + * @return the cacheClusterSize value. + */ + public String cacheClusterSize() { + return this.cacheClusterSize; + } + + /** + * Set the cacheClusterSize property: The stage's cache capacity in GB. For more information about choosing a cache + * size, see [Enabling API caching to enhance + * responsiveness](https://docs.aws.amazon.com/apigateway/latest/developerguide/api-gateway-caching.html). + * + * @param cacheClusterSize the cacheClusterSize value to set. + * @return the AwsApiGatewayStageProperties object itself. + */ + public AwsApiGatewayStageProperties withCacheClusterSize(String cacheClusterSize) { + this.cacheClusterSize = cacheClusterSize; + return this; + } + + /** + * Get the canarySetting property: Settings for the canary deployment in this stage. Configuration settings of a + * canary deployment. + * + * @return the canarySetting value. + */ + public CanarySetting canarySetting() { + return this.canarySetting; + } + + /** + * Set the canarySetting property: Settings for the canary deployment in this stage. Configuration settings of a + * canary deployment. + * + * @param canarySetting the canarySetting value to set. + * @return the AwsApiGatewayStageProperties object itself. + */ + public AwsApiGatewayStageProperties withCanarySetting(CanarySetting canarySetting) { + this.canarySetting = canarySetting; + return this; + } + + /** + * Get the clientCertificateId property: The identifier of a client certificate for an API stage. + * + * @return the clientCertificateId value. + */ + public String clientCertificateId() { + return this.clientCertificateId; + } + + /** + * Set the clientCertificateId property: The identifier of a client certificate for an API stage. + * + * @param clientCertificateId the clientCertificateId value to set. + * @return the AwsApiGatewayStageProperties object itself. + */ + public AwsApiGatewayStageProperties withClientCertificateId(String clientCertificateId) { + this.clientCertificateId = clientCertificateId; + return this; + } + + /** + * Get the deploymentId property: The identifier of the Deployment that the stage points to. + * + * @return the deploymentId value. + */ + public String deploymentId() { + return this.deploymentId; + } + + /** + * Set the deploymentId property: The identifier of the Deployment that the stage points to. + * + * @param deploymentId the deploymentId value to set. + * @return the AwsApiGatewayStageProperties object itself. + */ + public AwsApiGatewayStageProperties withDeploymentId(String deploymentId) { + this.deploymentId = deploymentId; + return this; + } + + /** + * Get the description property: The stage's description. + * + * @return the description value. + */ + public String description() { + return this.description; + } + + /** + * Set the description property: The stage's description. + * + * @param description the description value to set. + * @return the AwsApiGatewayStageProperties object itself. + */ + public AwsApiGatewayStageProperties withDescription(String description) { + this.description = description; + return this; + } + + /** + * Get the documentationVersion property: The version of the associated API documentation. + * + * @return the documentationVersion value. + */ + public String documentationVersion() { + return this.documentationVersion; + } + + /** + * Set the documentationVersion property: The version of the associated API documentation. + * + * @param documentationVersion the documentationVersion value to set. + * @return the AwsApiGatewayStageProperties object itself. + */ + public AwsApiGatewayStageProperties withDocumentationVersion(String documentationVersion) { + this.documentationVersion = documentationVersion; + return this; + } + + /** + * Get the methodSettings property: A map that defines the method settings for a Stage resource. Keys (designated as + * ``/{method_setting_key`` below) are method paths defined as ``{resource_path}/{http_method}`` for an individual + * method override, or ``/\*/\*`` for overriding all methods in the stage. + * + * @return the methodSettings value. + */ + public List methodSettings() { + return this.methodSettings; + } + + /** + * Set the methodSettings property: A map that defines the method settings for a Stage resource. Keys (designated as + * ``/{method_setting_key`` below) are method paths defined as ``{resource_path}/{http_method}`` for an individual + * method override, or ``/\*/\*`` for overriding all methods in the stage. + * + * @param methodSettings the methodSettings value to set. + * @return the AwsApiGatewayStageProperties object itself. + */ + public AwsApiGatewayStageProperties withMethodSettings(List methodSettings) { + this.methodSettings = methodSettings; + return this; + } + + /** + * Get the restApiId property: The string identifier of the associated RestApi. + * + * @return the restApiId value. + */ + public String restApiId() { + return this.restApiId; + } + + /** + * Set the restApiId property: The string identifier of the associated RestApi. + * + * @param restApiId the restApiId value to set. + * @return the AwsApiGatewayStageProperties object itself. + */ + public AwsApiGatewayStageProperties withRestApiId(String restApiId) { + this.restApiId = restApiId; + return this; + } + + /** + * Get the stageName property: The name of the stage is the first path segment in the Uniform Resource Identifier + * (URI) of a call to API Gateway. Stage names can only contain alphanumeric characters, hyphens, and underscores. + * Maximum length is 128 characters. + * + * @return the stageName value. + */ + public String stageName() { + return this.stageName; + } + + /** + * Set the stageName property: The name of the stage is the first path segment in the Uniform Resource Identifier + * (URI) of a call to API Gateway. Stage names can only contain alphanumeric characters, hyphens, and underscores. + * Maximum length is 128 characters. + * + * @param stageName the stageName value to set. + * @return the AwsApiGatewayStageProperties object itself. + */ + public AwsApiGatewayStageProperties withStageName(String stageName) { + this.stageName = stageName; + return this; + } + + /** + * Get the tags property: The collection of tags. Each tag element is associated with a given resource. + * + * @return the tags value. + */ + public List tags() { + return this.tags; + } + + /** + * Set the tags property: The collection of tags. Each tag element is associated with a given resource. + * + * @param tags the tags value to set. + * @return the AwsApiGatewayStageProperties object itself. + */ + public AwsApiGatewayStageProperties withTags(List tags) { + this.tags = tags; + return this; + } + + /** + * Get the tracingEnabled property: Specifies whether active tracing with X-ray is enabled for the Stage. + * + * @return the tracingEnabled value. + */ + public Boolean tracingEnabled() { + return this.tracingEnabled; + } + + /** + * Set the tracingEnabled property: Specifies whether active tracing with X-ray is enabled for the Stage. + * + * @param tracingEnabled the tracingEnabled value to set. + * @return the AwsApiGatewayStageProperties object itself. + */ + public AwsApiGatewayStageProperties withTracingEnabled(Boolean tracingEnabled) { + this.tracingEnabled = tracingEnabled; + return this; + } + + /** + * Get the variables property: A map (string-to-string map) that defines the stage variables, where the variable + * name is the key and the variable value is the value. Variable names are limited to alphanumeric characters. + * Values must match the following regular expression: ``[A-Za-z0-9-._~:/?#&=,]+``. + * + * @return the variables value. + */ + public Map variables() { + return this.variables; + } + + /** + * Set the variables property: A map (string-to-string map) that defines the stage variables, where the variable + * name is the key and the variable value is the value. Variable names are limited to alphanumeric characters. + * Values must match the following regular expression: ``[A-Za-z0-9-._~:/?#&=,]+``. + * + * @param variables the variables value to set. + * @return the AwsApiGatewayStageProperties object itself. + */ + public AwsApiGatewayStageProperties withVariables(Map variables) { + this.variables = variables; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (accessLogSetting() != null) { + accessLogSetting().validate(); + } + if (canarySetting() != null) { + canarySetting().validate(); + } + if (methodSettings() != null) { + methodSettings().forEach(e -> e.validate()); + } + if (tags() != null) { + tags().forEach(e -> e.validate()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("accessLogSetting", this.accessLogSetting); + jsonWriter.writeBooleanField("cacheClusterEnabled", this.cacheClusterEnabled); + jsonWriter.writeStringField("cacheClusterSize", this.cacheClusterSize); + jsonWriter.writeJsonField("canarySetting", this.canarySetting); + jsonWriter.writeStringField("clientCertificateId", this.clientCertificateId); + jsonWriter.writeStringField("deploymentId", this.deploymentId); + jsonWriter.writeStringField("description", this.description); + jsonWriter.writeStringField("documentationVersion", this.documentationVersion); + jsonWriter.writeArrayField("methodSettings", this.methodSettings, + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("restApiId", this.restApiId); + jsonWriter.writeStringField("stageName", this.stageName); + jsonWriter.writeArrayField("tags", this.tags, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeBooleanField("tracingEnabled", this.tracingEnabled); + jsonWriter.writeMapField("variables", this.variables, (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AwsApiGatewayStageProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AwsApiGatewayStageProperties if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the AwsApiGatewayStageProperties. + */ + public static AwsApiGatewayStageProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AwsApiGatewayStageProperties deserializedAwsApiGatewayStageProperties = new AwsApiGatewayStageProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("accessLogSetting".equals(fieldName)) { + deserializedAwsApiGatewayStageProperties.accessLogSetting = AccessLogSetting.fromJson(reader); + } else if ("cacheClusterEnabled".equals(fieldName)) { + deserializedAwsApiGatewayStageProperties.cacheClusterEnabled + = reader.getNullable(JsonReader::getBoolean); + } else if ("cacheClusterSize".equals(fieldName)) { + deserializedAwsApiGatewayStageProperties.cacheClusterSize = reader.getString(); + } else if ("canarySetting".equals(fieldName)) { + deserializedAwsApiGatewayStageProperties.canarySetting = CanarySetting.fromJson(reader); + } else if ("clientCertificateId".equals(fieldName)) { + deserializedAwsApiGatewayStageProperties.clientCertificateId = reader.getString(); + } else if ("deploymentId".equals(fieldName)) { + deserializedAwsApiGatewayStageProperties.deploymentId = reader.getString(); + } else if ("description".equals(fieldName)) { + deserializedAwsApiGatewayStageProperties.description = reader.getString(); + } else if ("documentationVersion".equals(fieldName)) { + deserializedAwsApiGatewayStageProperties.documentationVersion = reader.getString(); + } else if ("methodSettings".equals(fieldName)) { + List methodSettings = reader.readArray(reader1 -> MethodSetting.fromJson(reader1)); + deserializedAwsApiGatewayStageProperties.methodSettings = methodSettings; + } else if ("restApiId".equals(fieldName)) { + deserializedAwsApiGatewayStageProperties.restApiId = reader.getString(); + } else if ("stageName".equals(fieldName)) { + deserializedAwsApiGatewayStageProperties.stageName = reader.getString(); + } else if ("tags".equals(fieldName)) { + List tags = reader.readArray(reader1 -> TagAutoGenerated2.fromJson(reader1)); + deserializedAwsApiGatewayStageProperties.tags = tags; + } else if ("tracingEnabled".equals(fieldName)) { + deserializedAwsApiGatewayStageProperties.tracingEnabled + = reader.getNullable(JsonReader::getBoolean); + } else if ("variables".equals(fieldName)) { + Map variables = reader.readMap(reader1 -> reader1.getString()); + deserializedAwsApiGatewayStageProperties.variables = variables; + } else { + reader.skipChildren(); + } + } + + return deserializedAwsApiGatewayStageProperties; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/AwsAppSyncGraphqlApiProperties.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/AwsAppSyncGraphqlApiProperties.java new file mode 100644 index 000000000000..ef7c67ed7e31 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/AwsAppSyncGraphqlApiProperties.java @@ -0,0 +1,830 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; +import java.util.Map; + +/** + * Definition of awsAppSyncGraphqlApi. + */ +@Fluent +public final class AwsAppSyncGraphqlApiProperties implements JsonSerializable { + /* + *

A list of additional authentication providers for the GraphqlApi API.

+ */ + private List additionalAuthenticationProviders; + + /* + *

The API ID.

+ */ + private String apiId; + + /* + *

The value that indicates whether the GraphQL API is a standard API (GRAPHQL) or merged API + * (MERGED).

+ */ + private GraphQLApiTypeEnumValue apiType; + + /* + *

The Amazon Resource Name (ARN).

+ */ + private String arn; + + /* + *

The authentication type.

+ */ + private AuthenticationTypeEnumValue authenticationType; + + /* + *

The DNS records for the API.

+ */ + private Map dns; + + /* + *

The enhancedMetricsConfig object.

+ */ + private EnhancedMetricsConfig enhancedMetricsConfig; + + /* + *

Sets the value of the GraphQL API to enable (ENABLED) or disable (DISABLED) + * introspection. If no value is provided, the introspection configuration will be set to ENABLED by + * default. This field will produce an error if the operation attempts to use the introspection feature while this + * field is disabled.

For more information about introspection, see GraphQL introspection.

+ */ + private GraphQLApiIntrospectionConfigEnumValue introspectionConfig; + + /* + *

Configuration for Lambda function authorization.

+ */ + private LambdaAuthorizerConfig lambdaAuthorizerConfig; + + /* + *

The Amazon CloudWatch Logs configuration.

+ */ + private LogConfig logConfig; + + /* + *

The Identity and Access Management service role ARN for a merged API. The AppSync service assumes this role on + * behalf of the Merged API to validate access to source APIs at runtime and to prompt the AUTO_MERGE + * to update the merged API endpoint with the source API changes automatically.

+ */ + private String mergedApiExecutionRoleArn; + + /* + *

The API name.

+ */ + private String name; + + /* + *

The OpenID Connect configuration.

+ */ + private OpenIdConnectConfig openIdConnectConfig; + + /* + *

The account owner of the GraphQL API.

+ */ + private String owner; + + /* + *

The owner contact information for an API resource.

This field accepts any string input with a length of + * 0 - 256 characters.

+ */ + private String ownerContact; + + /* + *

The maximum depth a query can have in a single request. Depth refers to the amount of nested levels allowed in + * the body of query. The default value is 0 (or unspecified), which indicates there's no depth limit. + * If you set a limit, it can be between 1 and 75 nested levels. This field will produce a + * limit error if the operation falls out of bounds.

Note that fields can still be set to nullable or + * non-nullable. If a non-nullable field produces an error, the error will be thrown upwards to the first nullable + * field available.

+ */ + private Integer queryDepthLimit; + + /* + *

The maximum number of resolvers that can be invoked in a single request. The default value is 0 + * (or unspecified), which will set the limit to 10000. When specified, the limit value can be between + * 1 and 10000. This field will produce a limit error if the operation falls out of + * bounds.

+ */ + private Integer resolverCountLimit; + + /* + *

The tags.

+ */ + private Map tags; + + /* + *

The URIs.

+ */ + private Map uris; + + /* + *

The Amazon Cognito user pool configuration.

+ */ + private UserPoolConfig userPoolConfig; + + /* + *

Sets the value of the GraphQL API to public (GLOBAL) or private (PRIVATE). If no + * value is provided, the visibility will be set to GLOBAL by default. This value cannot be changed + * once the API has been created.

+ */ + private GraphQLApiVisibilityEnumValue visibility; + + /* + *

The ARN of the WAF access control list (ACL) associated with this GraphqlApi, if one exists.

+ */ + private String wafWebAclArn; + + /* + *

A flag indicating whether to use X-Ray tracing for this GraphqlApi.

+ */ + private Boolean xrayEnabled; + + /** + * Creates an instance of AwsAppSyncGraphqlApiProperties class. + */ + public AwsAppSyncGraphqlApiProperties() { + } + + /** + * Get the additionalAuthenticationProviders property: <p>A list of additional authentication providers for + * the <code>GraphqlApi</code> API.</p>. + * + * @return the additionalAuthenticationProviders value. + */ + public List additionalAuthenticationProviders() { + return this.additionalAuthenticationProviders; + } + + /** + * Set the additionalAuthenticationProviders property: <p>A list of additional authentication providers for + * the <code>GraphqlApi</code> API.</p>. + * + * @param additionalAuthenticationProviders the additionalAuthenticationProviders value to set. + * @return the AwsAppSyncGraphqlApiProperties object itself. + */ + public AwsAppSyncGraphqlApiProperties withAdditionalAuthenticationProviders( + List additionalAuthenticationProviders) { + this.additionalAuthenticationProviders = additionalAuthenticationProviders; + return this; + } + + /** + * Get the apiId property: <p>The API ID.</p>. + * + * @return the apiId value. + */ + public String apiId() { + return this.apiId; + } + + /** + * Set the apiId property: <p>The API ID.</p>. + * + * @param apiId the apiId value to set. + * @return the AwsAppSyncGraphqlApiProperties object itself. + */ + public AwsAppSyncGraphqlApiProperties withApiId(String apiId) { + this.apiId = apiId; + return this; + } + + /** + * Get the apiType property: <p>The value that indicates whether the GraphQL API is a standard API + * (<code>GRAPHQL</code>) or merged API (<code>MERGED</code>).</p>. + * + * @return the apiType value. + */ + public GraphQLApiTypeEnumValue apiType() { + return this.apiType; + } + + /** + * Set the apiType property: <p>The value that indicates whether the GraphQL API is a standard API + * (<code>GRAPHQL</code>) or merged API (<code>MERGED</code>).</p>. + * + * @param apiType the apiType value to set. + * @return the AwsAppSyncGraphqlApiProperties object itself. + */ + public AwsAppSyncGraphqlApiProperties withApiType(GraphQLApiTypeEnumValue apiType) { + this.apiType = apiType; + return this; + } + + /** + * Get the arn property: <p>The Amazon Resource Name (ARN).</p>. + * + * @return the arn value. + */ + public String arn() { + return this.arn; + } + + /** + * Set the arn property: <p>The Amazon Resource Name (ARN).</p>. + * + * @param arn the arn value to set. + * @return the AwsAppSyncGraphqlApiProperties object itself. + */ + public AwsAppSyncGraphqlApiProperties withArn(String arn) { + this.arn = arn; + return this; + } + + /** + * Get the authenticationType property: <p>The authentication type.</p>. + * + * @return the authenticationType value. + */ + public AuthenticationTypeEnumValue authenticationType() { + return this.authenticationType; + } + + /** + * Set the authenticationType property: <p>The authentication type.</p>. + * + * @param authenticationType the authenticationType value to set. + * @return the AwsAppSyncGraphqlApiProperties object itself. + */ + public AwsAppSyncGraphqlApiProperties withAuthenticationType(AuthenticationTypeEnumValue authenticationType) { + this.authenticationType = authenticationType; + return this; + } + + /** + * Get the dns property: <p>The DNS records for the API.</p>. + * + * @return the dns value. + */ + public Map dns() { + return this.dns; + } + + /** + * Set the dns property: <p>The DNS records for the API.</p>. + * + * @param dns the dns value to set. + * @return the AwsAppSyncGraphqlApiProperties object itself. + */ + public AwsAppSyncGraphqlApiProperties withDns(Map dns) { + this.dns = dns; + return this; + } + + /** + * Get the enhancedMetricsConfig property: <p>The <code>enhancedMetricsConfig</code> + * object.</p>. + * + * @return the enhancedMetricsConfig value. + */ + public EnhancedMetricsConfig enhancedMetricsConfig() { + return this.enhancedMetricsConfig; + } + + /** + * Set the enhancedMetricsConfig property: <p>The <code>enhancedMetricsConfig</code> + * object.</p>. + * + * @param enhancedMetricsConfig the enhancedMetricsConfig value to set. + * @return the AwsAppSyncGraphqlApiProperties object itself. + */ + public AwsAppSyncGraphqlApiProperties withEnhancedMetricsConfig(EnhancedMetricsConfig enhancedMetricsConfig) { + this.enhancedMetricsConfig = enhancedMetricsConfig; + return this; + } + + /** + * Get the introspectionConfig property: <p>Sets the value of the GraphQL API to enable + * (<code>ENABLED</code>) or disable (<code>DISABLED</code>) introspection. If no value is + * provided, the introspection configuration will be set to <code>ENABLED</code> by default. This field + * will produce an error if the operation attempts to use the introspection feature while this field is + * disabled.</p> <p>For more information about introspection, see <a + * href='https://graphql.org/learn/introspection/'>GraphQL introspection</a>.</p>. + * + * @return the introspectionConfig value. + */ + public GraphQLApiIntrospectionConfigEnumValue introspectionConfig() { + return this.introspectionConfig; + } + + /** + * Set the introspectionConfig property: <p>Sets the value of the GraphQL API to enable + * (<code>ENABLED</code>) or disable (<code>DISABLED</code>) introspection. If no value is + * provided, the introspection configuration will be set to <code>ENABLED</code> by default. This field + * will produce an error if the operation attempts to use the introspection feature while this field is + * disabled.</p> <p>For more information about introspection, see <a + * href='https://graphql.org/learn/introspection/'>GraphQL introspection</a>.</p>. + * + * @param introspectionConfig the introspectionConfig value to set. + * @return the AwsAppSyncGraphqlApiProperties object itself. + */ + public AwsAppSyncGraphqlApiProperties + withIntrospectionConfig(GraphQLApiIntrospectionConfigEnumValue introspectionConfig) { + this.introspectionConfig = introspectionConfig; + return this; + } + + /** + * Get the lambdaAuthorizerConfig property: <p>Configuration for Lambda function authorization.</p>. + * + * @return the lambdaAuthorizerConfig value. + */ + public LambdaAuthorizerConfig lambdaAuthorizerConfig() { + return this.lambdaAuthorizerConfig; + } + + /** + * Set the lambdaAuthorizerConfig property: <p>Configuration for Lambda function authorization.</p>. + * + * @param lambdaAuthorizerConfig the lambdaAuthorizerConfig value to set. + * @return the AwsAppSyncGraphqlApiProperties object itself. + */ + public AwsAppSyncGraphqlApiProperties withLambdaAuthorizerConfig(LambdaAuthorizerConfig lambdaAuthorizerConfig) { + this.lambdaAuthorizerConfig = lambdaAuthorizerConfig; + return this; + } + + /** + * Get the logConfig property: <p>The Amazon CloudWatch Logs configuration.</p>. + * + * @return the logConfig value. + */ + public LogConfig logConfig() { + return this.logConfig; + } + + /** + * Set the logConfig property: <p>The Amazon CloudWatch Logs configuration.</p>. + * + * @param logConfig the logConfig value to set. + * @return the AwsAppSyncGraphqlApiProperties object itself. + */ + public AwsAppSyncGraphqlApiProperties withLogConfig(LogConfig logConfig) { + this.logConfig = logConfig; + return this; + } + + /** + * Get the mergedApiExecutionRoleArn property: <p>The Identity and Access Management service role ARN for a + * merged API. The AppSync service assumes this role on behalf of the Merged API to validate access to source APIs + * at runtime and to prompt the <code>AUTO_MERGE</code> to update the merged API endpoint with the + * source API changes automatically.</p>. + * + * @return the mergedApiExecutionRoleArn value. + */ + public String mergedApiExecutionRoleArn() { + return this.mergedApiExecutionRoleArn; + } + + /** + * Set the mergedApiExecutionRoleArn property: <p>The Identity and Access Management service role ARN for a + * merged API. The AppSync service assumes this role on behalf of the Merged API to validate access to source APIs + * at runtime and to prompt the <code>AUTO_MERGE</code> to update the merged API endpoint with the + * source API changes automatically.</p>. + * + * @param mergedApiExecutionRoleArn the mergedApiExecutionRoleArn value to set. + * @return the AwsAppSyncGraphqlApiProperties object itself. + */ + public AwsAppSyncGraphqlApiProperties withMergedApiExecutionRoleArn(String mergedApiExecutionRoleArn) { + this.mergedApiExecutionRoleArn = mergedApiExecutionRoleArn; + return this; + } + + /** + * Get the name property: <p>The API name.</p>. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: <p>The API name.</p>. + * + * @param name the name value to set. + * @return the AwsAppSyncGraphqlApiProperties object itself. + */ + public AwsAppSyncGraphqlApiProperties withName(String name) { + this.name = name; + return this; + } + + /** + * Get the openIdConnectConfig property: <p>The OpenID Connect configuration.</p>. + * + * @return the openIdConnectConfig value. + */ + public OpenIdConnectConfig openIdConnectConfig() { + return this.openIdConnectConfig; + } + + /** + * Set the openIdConnectConfig property: <p>The OpenID Connect configuration.</p>. + * + * @param openIdConnectConfig the openIdConnectConfig value to set. + * @return the AwsAppSyncGraphqlApiProperties object itself. + */ + public AwsAppSyncGraphqlApiProperties withOpenIdConnectConfig(OpenIdConnectConfig openIdConnectConfig) { + this.openIdConnectConfig = openIdConnectConfig; + return this; + } + + /** + * Get the owner property: <p>The account owner of the GraphQL API.</p>. + * + * @return the owner value. + */ + public String owner() { + return this.owner; + } + + /** + * Set the owner property: <p>The account owner of the GraphQL API.</p>. + * + * @param owner the owner value to set. + * @return the AwsAppSyncGraphqlApiProperties object itself. + */ + public AwsAppSyncGraphqlApiProperties withOwner(String owner) { + this.owner = owner; + return this; + } + + /** + * Get the ownerContact property: <p>The owner contact information for an API resource.</p> + * <p>This field accepts any string input with a length of 0 - 256 characters.</p>. + * + * @return the ownerContact value. + */ + public String ownerContact() { + return this.ownerContact; + } + + /** + * Set the ownerContact property: <p>The owner contact information for an API resource.</p> + * <p>This field accepts any string input with a length of 0 - 256 characters.</p>. + * + * @param ownerContact the ownerContact value to set. + * @return the AwsAppSyncGraphqlApiProperties object itself. + */ + public AwsAppSyncGraphqlApiProperties withOwnerContact(String ownerContact) { + this.ownerContact = ownerContact; + return this; + } + + /** + * Get the queryDepthLimit property: <p>The maximum depth a query can have in a single request. Depth refers + * to the amount of nested levels allowed in the body of query. The default value is <code>0</code> (or + * unspecified), which indicates there's no depth limit. If you set a limit, it can be between + * <code>1</code> and <code>75</code> nested levels. This field will produce a limit error + * if the operation falls out of bounds.</p> <p>Note that fields can still be set to nullable or + * non-nullable. If a non-nullable field produces an error, the error will be thrown upwards to the first nullable + * field available.</p>. + * + * @return the queryDepthLimit value. + */ + public Integer queryDepthLimit() { + return this.queryDepthLimit; + } + + /** + * Set the queryDepthLimit property: <p>The maximum depth a query can have in a single request. Depth refers + * to the amount of nested levels allowed in the body of query. The default value is <code>0</code> (or + * unspecified), which indicates there's no depth limit. If you set a limit, it can be between + * <code>1</code> and <code>75</code> nested levels. This field will produce a limit error + * if the operation falls out of bounds.</p> <p>Note that fields can still be set to nullable or + * non-nullable. If a non-nullable field produces an error, the error will be thrown upwards to the first nullable + * field available.</p>. + * + * @param queryDepthLimit the queryDepthLimit value to set. + * @return the AwsAppSyncGraphqlApiProperties object itself. + */ + public AwsAppSyncGraphqlApiProperties withQueryDepthLimit(Integer queryDepthLimit) { + this.queryDepthLimit = queryDepthLimit; + return this; + } + + /** + * Get the resolverCountLimit property: <p>The maximum number of resolvers that can be invoked in a single + * request. The default value is <code>0</code> (or unspecified), which will set the limit to + * <code>10000</code>. When specified, the limit value can be between <code>1</code> and + * <code>10000</code>. This field will produce a limit error if the operation falls out of + * bounds.</p>. + * + * @return the resolverCountLimit value. + */ + public Integer resolverCountLimit() { + return this.resolverCountLimit; + } + + /** + * Set the resolverCountLimit property: <p>The maximum number of resolvers that can be invoked in a single + * request. The default value is <code>0</code> (or unspecified), which will set the limit to + * <code>10000</code>. When specified, the limit value can be between <code>1</code> and + * <code>10000</code>. This field will produce a limit error if the operation falls out of + * bounds.</p>. + * + * @param resolverCountLimit the resolverCountLimit value to set. + * @return the AwsAppSyncGraphqlApiProperties object itself. + */ + public AwsAppSyncGraphqlApiProperties withResolverCountLimit(Integer resolverCountLimit) { + this.resolverCountLimit = resolverCountLimit; + return this; + } + + /** + * Get the tags property: <p>The tags.</p>. + * + * @return the tags value. + */ + public Map tags() { + return this.tags; + } + + /** + * Set the tags property: <p>The tags.</p>. + * + * @param tags the tags value to set. + * @return the AwsAppSyncGraphqlApiProperties object itself. + */ + public AwsAppSyncGraphqlApiProperties withTags(Map tags) { + this.tags = tags; + return this; + } + + /** + * Get the uris property: <p>The URIs.</p>. + * + * @return the uris value. + */ + public Map uris() { + return this.uris; + } + + /** + * Set the uris property: <p>The URIs.</p>. + * + * @param uris the uris value to set. + * @return the AwsAppSyncGraphqlApiProperties object itself. + */ + public AwsAppSyncGraphqlApiProperties withUris(Map uris) { + this.uris = uris; + return this; + } + + /** + * Get the userPoolConfig property: <p>The Amazon Cognito user pool configuration.</p>. + * + * @return the userPoolConfig value. + */ + public UserPoolConfig userPoolConfig() { + return this.userPoolConfig; + } + + /** + * Set the userPoolConfig property: <p>The Amazon Cognito user pool configuration.</p>. + * + * @param userPoolConfig the userPoolConfig value to set. + * @return the AwsAppSyncGraphqlApiProperties object itself. + */ + public AwsAppSyncGraphqlApiProperties withUserPoolConfig(UserPoolConfig userPoolConfig) { + this.userPoolConfig = userPoolConfig; + return this; + } + + /** + * Get the visibility property: <p>Sets the value of the GraphQL API to public + * (<code>GLOBAL</code>) or private (<code>PRIVATE</code>). If no value is provided, the + * visibility will be set to <code>GLOBAL</code> by default. This value cannot be changed once the API + * has been created.</p>. + * + * @return the visibility value. + */ + public GraphQLApiVisibilityEnumValue visibility() { + return this.visibility; + } + + /** + * Set the visibility property: <p>Sets the value of the GraphQL API to public + * (<code>GLOBAL</code>) or private (<code>PRIVATE</code>). If no value is provided, the + * visibility will be set to <code>GLOBAL</code> by default. This value cannot be changed once the API + * has been created.</p>. + * + * @param visibility the visibility value to set. + * @return the AwsAppSyncGraphqlApiProperties object itself. + */ + public AwsAppSyncGraphqlApiProperties withVisibility(GraphQLApiVisibilityEnumValue visibility) { + this.visibility = visibility; + return this; + } + + /** + * Get the wafWebAclArn property: <p>The ARN of the WAF access control list (ACL) associated with this + * <code>GraphqlApi</code>, if one exists.</p>. + * + * @return the wafWebAclArn value. + */ + public String wafWebAclArn() { + return this.wafWebAclArn; + } + + /** + * Set the wafWebAclArn property: <p>The ARN of the WAF access control list (ACL) associated with this + * <code>GraphqlApi</code>, if one exists.</p>. + * + * @param wafWebAclArn the wafWebAclArn value to set. + * @return the AwsAppSyncGraphqlApiProperties object itself. + */ + public AwsAppSyncGraphqlApiProperties withWafWebAclArn(String wafWebAclArn) { + this.wafWebAclArn = wafWebAclArn; + return this; + } + + /** + * Get the xrayEnabled property: <p>A flag indicating whether to use X-Ray tracing for this + * <code>GraphqlApi</code>.</p>. + * + * @return the xrayEnabled value. + */ + public Boolean xrayEnabled() { + return this.xrayEnabled; + } + + /** + * Set the xrayEnabled property: <p>A flag indicating whether to use X-Ray tracing for this + * <code>GraphqlApi</code>.</p>. + * + * @param xrayEnabled the xrayEnabled value to set. + * @return the AwsAppSyncGraphqlApiProperties object itself. + */ + public AwsAppSyncGraphqlApiProperties withXrayEnabled(Boolean xrayEnabled) { + this.xrayEnabled = xrayEnabled; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (additionalAuthenticationProviders() != null) { + additionalAuthenticationProviders().forEach(e -> e.validate()); + } + if (apiType() != null) { + apiType().validate(); + } + if (authenticationType() != null) { + authenticationType().validate(); + } + if (enhancedMetricsConfig() != null) { + enhancedMetricsConfig().validate(); + } + if (introspectionConfig() != null) { + introspectionConfig().validate(); + } + if (lambdaAuthorizerConfig() != null) { + lambdaAuthorizerConfig().validate(); + } + if (logConfig() != null) { + logConfig().validate(); + } + if (openIdConnectConfig() != null) { + openIdConnectConfig().validate(); + } + if (userPoolConfig() != null) { + userPoolConfig().validate(); + } + if (visibility() != null) { + visibility().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("additionalAuthenticationProviders", this.additionalAuthenticationProviders, + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("apiId", this.apiId); + jsonWriter.writeJsonField("apiType", this.apiType); + jsonWriter.writeStringField("arn", this.arn); + jsonWriter.writeJsonField("authenticationType", this.authenticationType); + jsonWriter.writeMapField("dns", this.dns, (writer, element) -> writer.writeString(element)); + jsonWriter.writeJsonField("enhancedMetricsConfig", this.enhancedMetricsConfig); + jsonWriter.writeJsonField("introspectionConfig", this.introspectionConfig); + jsonWriter.writeJsonField("lambdaAuthorizerConfig", this.lambdaAuthorizerConfig); + jsonWriter.writeJsonField("logConfig", this.logConfig); + jsonWriter.writeStringField("mergedApiExecutionRoleArn", this.mergedApiExecutionRoleArn); + jsonWriter.writeStringField("name", this.name); + jsonWriter.writeJsonField("openIDConnectConfig", this.openIdConnectConfig); + jsonWriter.writeStringField("owner", this.owner); + jsonWriter.writeStringField("ownerContact", this.ownerContact); + jsonWriter.writeNumberField("queryDepthLimit", this.queryDepthLimit); + jsonWriter.writeNumberField("resolverCountLimit", this.resolverCountLimit); + jsonWriter.writeMapField("tags", this.tags, (writer, element) -> writer.writeString(element)); + jsonWriter.writeMapField("uris", this.uris, (writer, element) -> writer.writeString(element)); + jsonWriter.writeJsonField("userPoolConfig", this.userPoolConfig); + jsonWriter.writeJsonField("visibility", this.visibility); + jsonWriter.writeStringField("wafWebAclArn", this.wafWebAclArn); + jsonWriter.writeBooleanField("xrayEnabled", this.xrayEnabled); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AwsAppSyncGraphqlApiProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AwsAppSyncGraphqlApiProperties if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the AwsAppSyncGraphqlApiProperties. + */ + public static AwsAppSyncGraphqlApiProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AwsAppSyncGraphqlApiProperties deserializedAwsAppSyncGraphqlApiProperties + = new AwsAppSyncGraphqlApiProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("additionalAuthenticationProviders".equals(fieldName)) { + List additionalAuthenticationProviders + = reader.readArray(reader1 -> AdditionalAuthenticationProvider.fromJson(reader1)); + deserializedAwsAppSyncGraphqlApiProperties.additionalAuthenticationProviders + = additionalAuthenticationProviders; + } else if ("apiId".equals(fieldName)) { + deserializedAwsAppSyncGraphqlApiProperties.apiId = reader.getString(); + } else if ("apiType".equals(fieldName)) { + deserializedAwsAppSyncGraphqlApiProperties.apiType = GraphQLApiTypeEnumValue.fromJson(reader); + } else if ("arn".equals(fieldName)) { + deserializedAwsAppSyncGraphqlApiProperties.arn = reader.getString(); + } else if ("authenticationType".equals(fieldName)) { + deserializedAwsAppSyncGraphqlApiProperties.authenticationType + = AuthenticationTypeEnumValue.fromJson(reader); + } else if ("dns".equals(fieldName)) { + Map dns = reader.readMap(reader1 -> reader1.getString()); + deserializedAwsAppSyncGraphqlApiProperties.dns = dns; + } else if ("enhancedMetricsConfig".equals(fieldName)) { + deserializedAwsAppSyncGraphqlApiProperties.enhancedMetricsConfig + = EnhancedMetricsConfig.fromJson(reader); + } else if ("introspectionConfig".equals(fieldName)) { + deserializedAwsAppSyncGraphqlApiProperties.introspectionConfig + = GraphQLApiIntrospectionConfigEnumValue.fromJson(reader); + } else if ("lambdaAuthorizerConfig".equals(fieldName)) { + deserializedAwsAppSyncGraphqlApiProperties.lambdaAuthorizerConfig + = LambdaAuthorizerConfig.fromJson(reader); + } else if ("logConfig".equals(fieldName)) { + deserializedAwsAppSyncGraphqlApiProperties.logConfig = LogConfig.fromJson(reader); + } else if ("mergedApiExecutionRoleArn".equals(fieldName)) { + deserializedAwsAppSyncGraphqlApiProperties.mergedApiExecutionRoleArn = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedAwsAppSyncGraphqlApiProperties.name = reader.getString(); + } else if ("openIDConnectConfig".equals(fieldName)) { + deserializedAwsAppSyncGraphqlApiProperties.openIdConnectConfig + = OpenIdConnectConfig.fromJson(reader); + } else if ("owner".equals(fieldName)) { + deserializedAwsAppSyncGraphqlApiProperties.owner = reader.getString(); + } else if ("ownerContact".equals(fieldName)) { + deserializedAwsAppSyncGraphqlApiProperties.ownerContact = reader.getString(); + } else if ("queryDepthLimit".equals(fieldName)) { + deserializedAwsAppSyncGraphqlApiProperties.queryDepthLimit = reader.getNullable(JsonReader::getInt); + } else if ("resolverCountLimit".equals(fieldName)) { + deserializedAwsAppSyncGraphqlApiProperties.resolverCountLimit + = reader.getNullable(JsonReader::getInt); + } else if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedAwsAppSyncGraphqlApiProperties.tags = tags; + } else if ("uris".equals(fieldName)) { + Map uris = reader.readMap(reader1 -> reader1.getString()); + deserializedAwsAppSyncGraphqlApiProperties.uris = uris; + } else if ("userPoolConfig".equals(fieldName)) { + deserializedAwsAppSyncGraphqlApiProperties.userPoolConfig = UserPoolConfig.fromJson(reader); + } else if ("visibility".equals(fieldName)) { + deserializedAwsAppSyncGraphqlApiProperties.visibility + = GraphQLApiVisibilityEnumValue.fromJson(reader); + } else if ("wafWebAclArn".equals(fieldName)) { + deserializedAwsAppSyncGraphqlApiProperties.wafWebAclArn = reader.getString(); + } else if ("xrayEnabled".equals(fieldName)) { + deserializedAwsAppSyncGraphqlApiProperties.xrayEnabled = reader.getNullable(JsonReader::getBoolean); + } else { + reader.skipChildren(); + } + } + + return deserializedAwsAppSyncGraphqlApiProperties; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/AwsAutoScalingGroupProperties.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/AwsAutoScalingGroupProperties.java new file mode 100644 index 000000000000..9679c809fa45 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/AwsAutoScalingGroupProperties.java @@ -0,0 +1,1431 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Definition of awsAutoScalingAutoScalingGroup. + */ +@Fluent +public final class AwsAutoScalingGroupProperties implements JsonSerializable { + /* + * The name of the Auto Scaling group. This name must be unique per Region per account. The name can contain any + * ASCII character 33 to 126 including most punctuation characters, digits, and upper and lowercased letters. You + * cannot use a colon (:) in the name. + */ + private String autoScalingGroupName; + + /* + * A list of Availability Zones where instances in the Auto Scaling group can be created. Used for launching into + * the default VPC subnet in each Availability Zone when not using the ``VPCZoneIdentifier`` property, or for + * attaching a network interface when an existing network interface ID is specified in a launch template. + */ + private List availabilityZones; + + /* + * Indicates whether Capacity Rebalancing is enabled. Otherwise, Capacity Rebalancing is disabled. When you turn on + * Capacity Rebalancing, Amazon EC2 Auto Scaling attempts to launch a Spot Instance whenever Amazon EC2 notifies + * that a Spot Instance is at an elevated risk of interruption. After launching a new instance, it then terminates + * an old instance. For more information, see [Use Capacity Rebalancing to handle Amazon EC2 Spot + * Interruptions](https://docs.aws.amazon.com/autoscaling/ec2/userguide/ec2-auto-scaling-capacity-rebalancing.html) + * in the in the *Amazon EC2 Auto Scaling User Guide*. + */ + private Boolean capacityRebalance; + + /* + * Reserved. + */ + private String context; + + /* + * *Only needed if you use simple scaling policies.* The amount of time, in seconds, between one scaling activity + * ending and another one starting due to simple scaling policies. For more information, see [Scaling cooldowns for + * Amazon EC2 Auto Scaling](https://docs.aws.amazon.com/autoscaling/ec2/userguide/Cooldown.html) in the *Amazon EC2 + * Auto Scaling User Guide*. Default: ``300`` seconds + */ + private String cooldown; + + /* + * The amount of time, in seconds, until a new instance is considered to have finished initializing and resource + * consumption to become stable after it enters the ``InService`` state. During an instance refresh, Amazon EC2 Auto + * Scaling waits for the warm-up period after it replaces an instance before it moves on to replacing the next + * instance. Amazon EC2 Auto Scaling also waits for the warm-up period before aggregating the metrics for new + * instances with existing instances in the Amazon CloudWatch metrics that are used for scaling, resulting in more + * reliable usage data. For more information, see [Set the default instance warmup for an Auto Scaling + * group](https://docs.aws.amazon.com/autoscaling/ec2/userguide/ec2-auto-scaling-default-instance-warmup.html) in + * the *Amazon EC2 Auto Scaling User Guide*. To manage various warm-up settings at the group level, we recommend + * that you set the default instance warmup, *even if it is set to 0 seconds*. To remove a value that you previously + * set, include the property but specify ``-1`` for the value. However, we strongly recommend keeping the default + * instance warmup enabled by specifying a value of ``0`` or other nominal value. Default: None + */ + private Integer defaultInstanceWarmup; + + /* + * The desired capacity is the initial capacity of the Auto Scaling group at the time of its creation and the + * capacity it attempts to maintain. It can scale beyond this capacity if you configure automatic scaling. The + * number must be greater than or equal to the minimum size of the group and less than or equal to the maximum size + * of the group. If you do not specify a desired capacity when creating the stack, the default is the minimum size + * of the group. CloudFormation marks the Auto Scaling group as successful (by setting its status to + * CREATE_COMPLETE) when the desired capacity is reached. However, if a maximum Spot price is set in the launch + * template or launch configuration that you specified, then desired capacity is not used as a criteria for success. + * Whether your request is fulfilled depends on Spot Instance capacity and your maximum price. + */ + private String desiredCapacity; + + /* + * The unit of measurement for the value specified for desired capacity. Amazon EC2 Auto Scaling supports + * ``DesiredCapacityType`` for attribute-based instance type selection only. For more information, see [Creating an + * Auto Scaling group using attribute-based instance type + * selection](https://docs.aws.amazon.com/autoscaling/ec2/userguide/create-asg-instance-type-requirements.html) in + * the *Amazon EC2 Auto Scaling User Guide*. By default, Amazon EC2 Auto Scaling specifies ``units``, which + * translates into number of instances. Valid values: ``units`` | ``vcpu`` | ``memory-mib`` + */ + private String desiredCapacityType; + + /* + * The amount of time, in seconds, that Amazon EC2 Auto Scaling waits before checking the health status of an EC2 + * instance that has come into service and marking it unhealthy due to a failed health check. This is useful if your + * instances do not immediately pass their health checks after they enter the ``InService`` state. For more + * information, see [Set the health check grace period for an Auto Scaling + * group](https://docs.aws.amazon.com/autoscaling/ec2/userguide/health-check-grace-period.html) in the *Amazon EC2 + * Auto Scaling User Guide*. Default: ``0`` seconds + */ + private Integer healthCheckGracePeriod; + + /* + * A comma-separated value string of one or more health check types. The valid values are ``EC2``, ``ELB``, and + * ``VPC_LATTICE``. ``EC2`` is the default health check and cannot be disabled. For more information, see [Health + * checks for Auto Scaling instances](https://docs.aws.amazon.com/autoscaling/ec2/userguide/healthcheck.html) in the + * *Amazon EC2 Auto Scaling User Guide*. Only specify ``EC2`` if you must clear a value that was previously set. + */ + private String healthCheckType; + + /* + * The ID of the instance used to base the launch configuration on. For more information, see [Create an Auto + * Scaling group using an EC2 + * instance](https://docs.aws.amazon.com/autoscaling/ec2/userguide/create-asg-from-instance.html) in the *Amazon EC2 + * Auto Scaling User Guide*. If you specify ``LaunchTemplate``, ``MixedInstancesPolicy``, or + * ``LaunchConfigurationName``, don't specify ``InstanceId``. + */ + private String instanceId; + + /* + * An instance maintenance policy. For more information, see [Set instance maintenance + * policy](https://docs.aws.amazon.com/autoscaling/ec2/userguide/ec2-auto-scaling-instance-maintenance-policy.html) + * in the *Amazon EC2 Auto Scaling User Guide*. ``InstanceMaintenancePolicy`` is a property of the + * [AWS::AutoScaling::AutoScalingGroup](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource- + * autoscaling-autoscalinggroup.html) resource. For more information, see [Instance maintenance + * policies](https://docs.aws.amazon.com/autoscaling/ec2/userguide/ec2-auto-scaling-instance-maintenance-policy. + * html) in the *Amazon EC2 Auto Scaling User Guide*. + */ + private InstanceMaintenancePolicy instanceMaintenancePolicy; + + /* + * The name of the launch configuration to use to launch instances. Required only if you don't specify + * ``LaunchTemplate``, ``MixedInstancesPolicy``, or ``InstanceId``. + */ + private String launchConfigurationName; + + /* + * Information used to specify the launch template and version to use to launch instances. You can alternatively + * associate a launch template to the Auto Scaling group by specifying a ``MixedInstancesPolicy``. For more + * information about creating launch templates, see [Create a launch template for an Auto Scaling + * group](https://docs.aws.amazon.com/autoscaling/ec2/userguide/create-launch-template.html) in the *Amazon EC2 Auto + * Scaling User Guide*. If you omit this property, you must specify ``MixedInstancesPolicy``, + * ``LaunchConfigurationName``, or ``InstanceId``. Specifies a launch template to use when provisioning EC2 + * instances for an Auto Scaling group. You must specify the following: + The ID or the name of the launch template, + * but not both. + The version of the launch template. ``LaunchTemplateSpecification`` is property of the + * [AWS::AutoScaling::AutoScalingGroup](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource- + * autoscaling-autoscalinggroup.html) resource. It is also a property of the [AWS::AutoScaling::AutoScalingGroup + * LaunchTemplate](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-autoscaling- + * autoscalinggroup-launchtemplate.html) and [AWS::AutoScaling::AutoScalingGroup + * LaunchTemplateOverrides](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties- + * autoscaling-autoscalinggroup-launchtemplateoverrides.html) property types. For information about creating a + * launch template, see + * [AWS::EC2::LaunchTemplate](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ec2- + * launchtemplate.html) and [Create a launch template for an Auto Scaling + * group](https://docs.aws.amazon.com/autoscaling/ec2/userguide/create-launch-template.html) in the *Amazon EC2 Auto + * Scaling User Guide*. For examples of launch templates, see [Auto scaling template + * snippets](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/quickref-autoscaling.html) and the + * [Examples](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ec2-launchtemplate.html# + * aws-resource-ec2-launchtemplate--examples) section in the ``AWS::EC2::LaunchTemplate`` resource. + */ + private LaunchTemplateSpecification launchTemplate; + + /* + * One or more lifecycle hooks to add to the Auto Scaling group before instances are launched. + */ + private List lifecycleHookSpecificationList; + + /* + * A list of Classic Load Balancers associated with this Auto Scaling group. For Application Load Balancers, Network + * Load Balancers, and Gateway Load Balancers, specify the ``TargetGroupARNs`` property instead. + */ + private List loadBalancerNames; + + /* + * The maximum amount of time, in seconds, that an instance can be in service. The default is null. If specified, + * the value must be either 0 or a number equal to or greater than 86,400 seconds (1 day). For more information, see + * [Replacing Auto Scaling instances based on maximum instance + * lifetime](https://docs.aws.amazon.com/autoscaling/ec2/userguide/asg-max-instance-lifetime.html) in the *Amazon + * EC2 Auto Scaling User Guide*. + */ + private Integer maxInstanceLifetime; + + /* + * The maximum size of the group. With a mixed instances policy that uses instance weighting, Amazon EC2 Auto + * Scaling may need to go above ``MaxSize`` to meet your capacity requirements. In this event, Amazon EC2 Auto + * Scaling will never go above ``MaxSize`` by more than your largest instance weight (weights that define how many + * units each instance contributes to the desired capacity of the group). + */ + private String maxSize; + + /* + * Enables the monitoring of group metrics of an Auto Scaling group. By default, these metrics are disabled. + */ + private List metricsCollection; + + /* + * The minimum size of the group. + */ + private String minSize; + + /* + * An embedded object that specifies a mixed instances policy. The policy includes properties that not only define + * the distribution of On-Demand Instances and Spot Instances, the maximum price to pay for Spot Instances + * (optional), and how the Auto Scaling group allocates instance types to fulfill On-Demand and Spot capacities, but + * also the properties that specify the instance configuration information—the launch template and instance types. + * The policy can also include a weight for each instance type and different launch templates for individual + * instance types. For more information, see [Auto Scaling groups with multiple instance types and purchase + * options](https://docs.aws.amazon.com/autoscaling/ec2/userguide/ec2-auto-scaling-mixed-instances-groups.html) in + * the *Amazon EC2 Auto Scaling User Guide*. Use this structure to launch multiple instance types and On-Demand + * Instances and Spot Instances within a single Auto Scaling group. A mixed instances policy contains information + * that Amazon EC2 Auto Scaling can use to launch instances and help optimize your costs. For more information, see + * [Auto Scaling groups with multiple instance types and purchase + * options](https://docs.aws.amazon.com/autoscaling/ec2/userguide/ec2-auto-scaling-mixed-instances-groups.html) in + * the *Amazon EC2 Auto Scaling User Guide*. You can create a mixed instances policy for new and existing Auto + * Scaling groups. You must use a launch template to configure the policy. You cannot use a launch configuration. + * There are key differences between Spot Instances and On-Demand Instances: + The price for Spot Instances varies + * based on demand + Amazon EC2 can terminate an individual Spot Instance as the availability of, or price for, Spot + * Instances changes When a Spot Instance is terminated, Amazon EC2 Auto Scaling group attempts to launch a + * replacement instance to maintain the desired capacity for the group. ``MixedInstancesPolicy`` is a property of + * the + * [AWS::AutoScaling::AutoScalingGroup](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource- + * autoscaling-autoscalinggroup.html) resource. + */ + private MixedInstancesPolicy mixedInstancesPolicy; + + /* + * Indicates whether newly launched instances are protected from termination by Amazon EC2 Auto Scaling when scaling + * in. For more information about preventing instances from terminating on scale in, see [Using instance scale-in + * protection](https://docs.aws.amazon.com/autoscaling/ec2/userguide/ec2-auto-scaling-instance-protection.html) in + * the *Amazon EC2 Auto Scaling User Guide*. + */ + private Boolean newInstancesProtectedFromScaleIn; + + /* + * A structure that specifies an Amazon SNS notification configuration for the ``NotificationConfigurations`` + * property of the + * [AWS::AutoScaling::AutoScalingGroup](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource- + * autoscaling-autoscalinggroup.html) resource. For an example template snippet, see [Auto scaling template + * snippets](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/quickref-autoscaling.html). For more + * information, see [Get Amazon SNS notifications when your Auto Scaling group + * scales](https://docs.aws.amazon.com/autoscaling/ec2/userguide/ASGettingNotifications.html) in the *Amazon EC2 + * Auto Scaling User Guide*. + */ + private NotificationConfiguration notificationConfiguration; + + /* + * Configures an Auto Scaling group to send notifications when specified events take place. + */ + private List notificationConfigurations; + + /* + * The name of the placement group into which to launch your instances. For more information, see [Placement + * groups](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/placement-groups.html) in the *Amazon EC2 User Guide + * for Linux Instances*. A *cluster* placement group is a logical grouping of instances within a single Availability + * Zone. You cannot specify multiple Availability Zones and a cluster placement group. + */ + private String placementGroup; + + /* + * The Amazon Resource Name (ARN) of the service-linked role that the Auto Scaling group uses to call other AWS + * service on your behalf. By default, Amazon EC2 Auto Scaling uses a service-linked role named + * ``AWSServiceRoleForAutoScaling``, which it creates if it does not exist. For more information, see + * [Service-linked + * roles](https://docs.aws.amazon.com/autoscaling/ec2/userguide/autoscaling-service-linked-role.html) in the *Amazon + * EC2 Auto Scaling User Guide*. + */ + private String serviceLinkedRoleArn; + + /* + * One or more tags. You can tag your Auto Scaling group and propagate the tags to the Amazon EC2 instances it + * launches. Tags are not propagated to Amazon EBS volumes. To add tags to Amazon EBS volumes, specify the tags in a + * launch template but use caution. If the launch template specifies an instance tag with a key that is also + * specified for the Auto Scaling group, Amazon EC2 Auto Scaling overrides the value of that instance tag with the + * value specified by the Auto Scaling group. For more information, see [Tag Auto Scaling groups and + * instances](https://docs.aws.amazon.com/autoscaling/ec2/userguide/ec2-auto-scaling-tagging.html) in the *Amazon + * EC2 Auto Scaling User Guide*. + */ + private List tags; + + /* + * The Amazon Resource Names (ARN) of the Elastic Load Balancing target groups to associate with the Auto Scaling + * group. Instances are registered as targets with the target groups. The target groups receive incoming traffic and + * route requests to one or more registered targets. For more information, see [Use Elastic Load Balancing to + * distribute traffic across the instances in your Auto Scaling + * group](https://docs.aws.amazon.com/autoscaling/ec2/userguide/autoscaling-load-balancer.html) in the *Amazon EC2 + * Auto Scaling User Guide*. + */ + private List targetGroupARNs; + + /* + * A policy or a list of policies that are used to select the instance to terminate. These policies are executed in + * the order that you list them. For more information, see [Work with Amazon EC2 Auto Scaling termination + * policies](https://docs.aws.amazon.com/autoscaling/ec2/userguide/ec2-auto-scaling-termination-policies.html) in + * the *Amazon EC2 Auto Scaling User Guide*. Valid values: ``Default`` | ``AllocationStrategy`` | + * ``ClosestToNextInstanceHour`` | ``NewestInstance`` | ``OldestInstance`` | ``OldestLaunchConfiguration`` | + * ``OldestLaunchTemplate`` | ``arn:aws:lambda:region:account-id:function:my-function:my-alias`` + */ + private List terminationPolicies; + + /* + * A list of subnet IDs for a virtual private cloud (VPC) where instances in the Auto Scaling group can be created. + * If this resource specifies public subnets and is also in a VPC that is defined in the same stack template, you + * must use the [DependsOn + * attribute](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-dependson.html) to + * declare a dependency on the [VPC-gateway + * attachment](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ec2-vpc-gateway- + * attachment.html). When you update ``VPCZoneIdentifier``, this retains the same Auto Scaling group and replaces + * old instances with new ones, according to the specified subnets. You can optionally specify how CloudFormation + * handles these updates by using an [UpdatePolicy + * attribute](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-updatepolicy.html). + * Required to launch instances into a nondefault VPC. If you specify ``VPCZoneIdentifier`` with + * ``AvailabilityZones``, the subnets that you specify for this property must reside in those Availability Zones. + */ + private List vpcZoneIdentifier; + + /** + * Creates an instance of AwsAutoScalingGroupProperties class. + */ + public AwsAutoScalingGroupProperties() { + } + + /** + * Get the autoScalingGroupName property: The name of the Auto Scaling group. This name must be unique per Region + * per account. The name can contain any ASCII character 33 to 126 including most punctuation characters, digits, + * and upper and lowercased letters. You cannot use a colon (:) in the name. + * + * @return the autoScalingGroupName value. + */ + public String autoScalingGroupName() { + return this.autoScalingGroupName; + } + + /** + * Set the autoScalingGroupName property: The name of the Auto Scaling group. This name must be unique per Region + * per account. The name can contain any ASCII character 33 to 126 including most punctuation characters, digits, + * and upper and lowercased letters. You cannot use a colon (:) in the name. + * + * @param autoScalingGroupName the autoScalingGroupName value to set. + * @return the AwsAutoScalingGroupProperties object itself. + */ + public AwsAutoScalingGroupProperties withAutoScalingGroupName(String autoScalingGroupName) { + this.autoScalingGroupName = autoScalingGroupName; + return this; + } + + /** + * Get the availabilityZones property: A list of Availability Zones where instances in the Auto Scaling group can be + * created. Used for launching into the default VPC subnet in each Availability Zone when not using the + * ``VPCZoneIdentifier`` property, or for attaching a network interface when an existing network interface ID is + * specified in a launch template. + * + * @return the availabilityZones value. + */ + public List availabilityZones() { + return this.availabilityZones; + } + + /** + * Set the availabilityZones property: A list of Availability Zones where instances in the Auto Scaling group can be + * created. Used for launching into the default VPC subnet in each Availability Zone when not using the + * ``VPCZoneIdentifier`` property, or for attaching a network interface when an existing network interface ID is + * specified in a launch template. + * + * @param availabilityZones the availabilityZones value to set. + * @return the AwsAutoScalingGroupProperties object itself. + */ + public AwsAutoScalingGroupProperties withAvailabilityZones(List availabilityZones) { + this.availabilityZones = availabilityZones; + return this; + } + + /** + * Get the capacityRebalance property: Indicates whether Capacity Rebalancing is enabled. Otherwise, Capacity + * Rebalancing is disabled. When you turn on Capacity Rebalancing, Amazon EC2 Auto Scaling attempts to launch a Spot + * Instance whenever Amazon EC2 notifies that a Spot Instance is at an elevated risk of interruption. After + * launching a new instance, it then terminates an old instance. For more information, see [Use Capacity Rebalancing + * to handle Amazon EC2 Spot + * Interruptions](https://docs.aws.amazon.com/autoscaling/ec2/userguide/ec2-auto-scaling-capacity-rebalancing.html) + * in the in the *Amazon EC2 Auto Scaling User Guide*. + * + * @return the capacityRebalance value. + */ + public Boolean capacityRebalance() { + return this.capacityRebalance; + } + + /** + * Set the capacityRebalance property: Indicates whether Capacity Rebalancing is enabled. Otherwise, Capacity + * Rebalancing is disabled. When you turn on Capacity Rebalancing, Amazon EC2 Auto Scaling attempts to launch a Spot + * Instance whenever Amazon EC2 notifies that a Spot Instance is at an elevated risk of interruption. After + * launching a new instance, it then terminates an old instance. For more information, see [Use Capacity Rebalancing + * to handle Amazon EC2 Spot + * Interruptions](https://docs.aws.amazon.com/autoscaling/ec2/userguide/ec2-auto-scaling-capacity-rebalancing.html) + * in the in the *Amazon EC2 Auto Scaling User Guide*. + * + * @param capacityRebalance the capacityRebalance value to set. + * @return the AwsAutoScalingGroupProperties object itself. + */ + public AwsAutoScalingGroupProperties withCapacityRebalance(Boolean capacityRebalance) { + this.capacityRebalance = capacityRebalance; + return this; + } + + /** + * Get the context property: Reserved. + * + * @return the context value. + */ + public String context() { + return this.context; + } + + /** + * Set the context property: Reserved. + * + * @param context the context value to set. + * @return the AwsAutoScalingGroupProperties object itself. + */ + public AwsAutoScalingGroupProperties withContext(String context) { + this.context = context; + return this; + } + + /** + * Get the cooldown property: *Only needed if you use simple scaling policies.* The amount of time, in seconds, + * between one scaling activity ending and another one starting due to simple scaling policies. For more + * information, see [Scaling cooldowns for Amazon EC2 Auto + * Scaling](https://docs.aws.amazon.com/autoscaling/ec2/userguide/Cooldown.html) in the *Amazon EC2 Auto Scaling + * User Guide*. Default: ``300`` seconds. + * + * @return the cooldown value. + */ + public String cooldown() { + return this.cooldown; + } + + /** + * Set the cooldown property: *Only needed if you use simple scaling policies.* The amount of time, in seconds, + * between one scaling activity ending and another one starting due to simple scaling policies. For more + * information, see [Scaling cooldowns for Amazon EC2 Auto + * Scaling](https://docs.aws.amazon.com/autoscaling/ec2/userguide/Cooldown.html) in the *Amazon EC2 Auto Scaling + * User Guide*. Default: ``300`` seconds. + * + * @param cooldown the cooldown value to set. + * @return the AwsAutoScalingGroupProperties object itself. + */ + public AwsAutoScalingGroupProperties withCooldown(String cooldown) { + this.cooldown = cooldown; + return this; + } + + /** + * Get the defaultInstanceWarmup property: The amount of time, in seconds, until a new instance is considered to + * have finished initializing and resource consumption to become stable after it enters the ``InService`` state. + * During an instance refresh, Amazon EC2 Auto Scaling waits for the warm-up period after it replaces an instance + * before it moves on to replacing the next instance. Amazon EC2 Auto Scaling also waits for the warm-up period + * before aggregating the metrics for new instances with existing instances in the Amazon CloudWatch metrics that + * are used for scaling, resulting in more reliable usage data. For more information, see [Set the default instance + * warmup for an Auto Scaling + * group](https://docs.aws.amazon.com/autoscaling/ec2/userguide/ec2-auto-scaling-default-instance-warmup.html) in + * the *Amazon EC2 Auto Scaling User Guide*. To manage various warm-up settings at the group level, we recommend + * that you set the default instance warmup, *even if it is set to 0 seconds*. To remove a value that you previously + * set, include the property but specify ``-1`` for the value. However, we strongly recommend keeping the default + * instance warmup enabled by specifying a value of ``0`` or other nominal value. Default: None. + * + * @return the defaultInstanceWarmup value. + */ + public Integer defaultInstanceWarmup() { + return this.defaultInstanceWarmup; + } + + /** + * Set the defaultInstanceWarmup property: The amount of time, in seconds, until a new instance is considered to + * have finished initializing and resource consumption to become stable after it enters the ``InService`` state. + * During an instance refresh, Amazon EC2 Auto Scaling waits for the warm-up period after it replaces an instance + * before it moves on to replacing the next instance. Amazon EC2 Auto Scaling also waits for the warm-up period + * before aggregating the metrics for new instances with existing instances in the Amazon CloudWatch metrics that + * are used for scaling, resulting in more reliable usage data. For more information, see [Set the default instance + * warmup for an Auto Scaling + * group](https://docs.aws.amazon.com/autoscaling/ec2/userguide/ec2-auto-scaling-default-instance-warmup.html) in + * the *Amazon EC2 Auto Scaling User Guide*. To manage various warm-up settings at the group level, we recommend + * that you set the default instance warmup, *even if it is set to 0 seconds*. To remove a value that you previously + * set, include the property but specify ``-1`` for the value. However, we strongly recommend keeping the default + * instance warmup enabled by specifying a value of ``0`` or other nominal value. Default: None. + * + * @param defaultInstanceWarmup the defaultInstanceWarmup value to set. + * @return the AwsAutoScalingGroupProperties object itself. + */ + public AwsAutoScalingGroupProperties withDefaultInstanceWarmup(Integer defaultInstanceWarmup) { + this.defaultInstanceWarmup = defaultInstanceWarmup; + return this; + } + + /** + * Get the desiredCapacity property: The desired capacity is the initial capacity of the Auto Scaling group at the + * time of its creation and the capacity it attempts to maintain. It can scale beyond this capacity if you configure + * automatic scaling. The number must be greater than or equal to the minimum size of the group and less than or + * equal to the maximum size of the group. If you do not specify a desired capacity when creating the stack, the + * default is the minimum size of the group. CloudFormation marks the Auto Scaling group as successful (by setting + * its status to CREATE_COMPLETE) when the desired capacity is reached. However, if a maximum Spot price is set in + * the launch template or launch configuration that you specified, then desired capacity is not used as a criteria + * for success. Whether your request is fulfilled depends on Spot Instance capacity and your maximum price. + * + * @return the desiredCapacity value. + */ + public String desiredCapacity() { + return this.desiredCapacity; + } + + /** + * Set the desiredCapacity property: The desired capacity is the initial capacity of the Auto Scaling group at the + * time of its creation and the capacity it attempts to maintain. It can scale beyond this capacity if you configure + * automatic scaling. The number must be greater than or equal to the minimum size of the group and less than or + * equal to the maximum size of the group. If you do not specify a desired capacity when creating the stack, the + * default is the minimum size of the group. CloudFormation marks the Auto Scaling group as successful (by setting + * its status to CREATE_COMPLETE) when the desired capacity is reached. However, if a maximum Spot price is set in + * the launch template or launch configuration that you specified, then desired capacity is not used as a criteria + * for success. Whether your request is fulfilled depends on Spot Instance capacity and your maximum price. + * + * @param desiredCapacity the desiredCapacity value to set. + * @return the AwsAutoScalingGroupProperties object itself. + */ + public AwsAutoScalingGroupProperties withDesiredCapacity(String desiredCapacity) { + this.desiredCapacity = desiredCapacity; + return this; + } + + /** + * Get the desiredCapacityType property: The unit of measurement for the value specified for desired capacity. + * Amazon EC2 Auto Scaling supports ``DesiredCapacityType`` for attribute-based instance type selection only. For + * more information, see [Creating an Auto Scaling group using attribute-based instance type + * selection](https://docs.aws.amazon.com/autoscaling/ec2/userguide/create-asg-instance-type-requirements.html) in + * the *Amazon EC2 Auto Scaling User Guide*. By default, Amazon EC2 Auto Scaling specifies ``units``, which + * translates into number of instances. Valid values: ``units`` | ``vcpu`` | ``memory-mib``. + * + * @return the desiredCapacityType value. + */ + public String desiredCapacityType() { + return this.desiredCapacityType; + } + + /** + * Set the desiredCapacityType property: The unit of measurement for the value specified for desired capacity. + * Amazon EC2 Auto Scaling supports ``DesiredCapacityType`` for attribute-based instance type selection only. For + * more information, see [Creating an Auto Scaling group using attribute-based instance type + * selection](https://docs.aws.amazon.com/autoscaling/ec2/userguide/create-asg-instance-type-requirements.html) in + * the *Amazon EC2 Auto Scaling User Guide*. By default, Amazon EC2 Auto Scaling specifies ``units``, which + * translates into number of instances. Valid values: ``units`` | ``vcpu`` | ``memory-mib``. + * + * @param desiredCapacityType the desiredCapacityType value to set. + * @return the AwsAutoScalingGroupProperties object itself. + */ + public AwsAutoScalingGroupProperties withDesiredCapacityType(String desiredCapacityType) { + this.desiredCapacityType = desiredCapacityType; + return this; + } + + /** + * Get the healthCheckGracePeriod property: The amount of time, in seconds, that Amazon EC2 Auto Scaling waits + * before checking the health status of an EC2 instance that has come into service and marking it unhealthy due to a + * failed health check. This is useful if your instances do not immediately pass their health checks after they + * enter the ``InService`` state. For more information, see [Set the health check grace period for an Auto Scaling + * group](https://docs.aws.amazon.com/autoscaling/ec2/userguide/health-check-grace-period.html) in the *Amazon EC2 + * Auto Scaling User Guide*. Default: ``0`` seconds. + * + * @return the healthCheckGracePeriod value. + */ + public Integer healthCheckGracePeriod() { + return this.healthCheckGracePeriod; + } + + /** + * Set the healthCheckGracePeriod property: The amount of time, in seconds, that Amazon EC2 Auto Scaling waits + * before checking the health status of an EC2 instance that has come into service and marking it unhealthy due to a + * failed health check. This is useful if your instances do not immediately pass their health checks after they + * enter the ``InService`` state. For more information, see [Set the health check grace period for an Auto Scaling + * group](https://docs.aws.amazon.com/autoscaling/ec2/userguide/health-check-grace-period.html) in the *Amazon EC2 + * Auto Scaling User Guide*. Default: ``0`` seconds. + * + * @param healthCheckGracePeriod the healthCheckGracePeriod value to set. + * @return the AwsAutoScalingGroupProperties object itself. + */ + public AwsAutoScalingGroupProperties withHealthCheckGracePeriod(Integer healthCheckGracePeriod) { + this.healthCheckGracePeriod = healthCheckGracePeriod; + return this; + } + + /** + * Get the healthCheckType property: A comma-separated value string of one or more health check types. The valid + * values are ``EC2``, ``ELB``, and ``VPC_LATTICE``. ``EC2`` is the default health check and cannot be disabled. For + * more information, see [Health checks for Auto Scaling + * instances](https://docs.aws.amazon.com/autoscaling/ec2/userguide/healthcheck.html) in the *Amazon EC2 Auto + * Scaling User Guide*. Only specify ``EC2`` if you must clear a value that was previously set. + * + * @return the healthCheckType value. + */ + public String healthCheckType() { + return this.healthCheckType; + } + + /** + * Set the healthCheckType property: A comma-separated value string of one or more health check types. The valid + * values are ``EC2``, ``ELB``, and ``VPC_LATTICE``. ``EC2`` is the default health check and cannot be disabled. For + * more information, see [Health checks for Auto Scaling + * instances](https://docs.aws.amazon.com/autoscaling/ec2/userguide/healthcheck.html) in the *Amazon EC2 Auto + * Scaling User Guide*. Only specify ``EC2`` if you must clear a value that was previously set. + * + * @param healthCheckType the healthCheckType value to set. + * @return the AwsAutoScalingGroupProperties object itself. + */ + public AwsAutoScalingGroupProperties withHealthCheckType(String healthCheckType) { + this.healthCheckType = healthCheckType; + return this; + } + + /** + * Get the instanceId property: The ID of the instance used to base the launch configuration on. For more + * information, see [Create an Auto Scaling group using an EC2 + * instance](https://docs.aws.amazon.com/autoscaling/ec2/userguide/create-asg-from-instance.html) in the *Amazon EC2 + * Auto Scaling User Guide*. If you specify ``LaunchTemplate``, ``MixedInstancesPolicy``, or + * ``LaunchConfigurationName``, don't specify ``InstanceId``. + * + * @return the instanceId value. + */ + public String instanceId() { + return this.instanceId; + } + + /** + * Set the instanceId property: The ID of the instance used to base the launch configuration on. For more + * information, see [Create an Auto Scaling group using an EC2 + * instance](https://docs.aws.amazon.com/autoscaling/ec2/userguide/create-asg-from-instance.html) in the *Amazon EC2 + * Auto Scaling User Guide*. If you specify ``LaunchTemplate``, ``MixedInstancesPolicy``, or + * ``LaunchConfigurationName``, don't specify ``InstanceId``. + * + * @param instanceId the instanceId value to set. + * @return the AwsAutoScalingGroupProperties object itself. + */ + public AwsAutoScalingGroupProperties withInstanceId(String instanceId) { + this.instanceId = instanceId; + return this; + } + + /** + * Get the instanceMaintenancePolicy property: An instance maintenance policy. For more information, see [Set + * instance maintenance + * policy](https://docs.aws.amazon.com/autoscaling/ec2/userguide/ec2-auto-scaling-instance-maintenance-policy.html) + * in the *Amazon EC2 Auto Scaling User Guide*. ``InstanceMaintenancePolicy`` is a property of the + * [AWS::AutoScaling::AutoScalingGroup](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-autoscaling-autoscalinggroup.html) + * resource. For more information, see [Instance maintenance + * policies](https://docs.aws.amazon.com/autoscaling/ec2/userguide/ec2-auto-scaling-instance-maintenance-policy.html) + * in the *Amazon EC2 Auto Scaling User Guide*. + * + * @return the instanceMaintenancePolicy value. + */ + public InstanceMaintenancePolicy instanceMaintenancePolicy() { + return this.instanceMaintenancePolicy; + } + + /** + * Set the instanceMaintenancePolicy property: An instance maintenance policy. For more information, see [Set + * instance maintenance + * policy](https://docs.aws.amazon.com/autoscaling/ec2/userguide/ec2-auto-scaling-instance-maintenance-policy.html) + * in the *Amazon EC2 Auto Scaling User Guide*. ``InstanceMaintenancePolicy`` is a property of the + * [AWS::AutoScaling::AutoScalingGroup](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-autoscaling-autoscalinggroup.html) + * resource. For more information, see [Instance maintenance + * policies](https://docs.aws.amazon.com/autoscaling/ec2/userguide/ec2-auto-scaling-instance-maintenance-policy.html) + * in the *Amazon EC2 Auto Scaling User Guide*. + * + * @param instanceMaintenancePolicy the instanceMaintenancePolicy value to set. + * @return the AwsAutoScalingGroupProperties object itself. + */ + public AwsAutoScalingGroupProperties + withInstanceMaintenancePolicy(InstanceMaintenancePolicy instanceMaintenancePolicy) { + this.instanceMaintenancePolicy = instanceMaintenancePolicy; + return this; + } + + /** + * Get the launchConfigurationName property: The name of the launch configuration to use to launch instances. + * Required only if you don't specify ``LaunchTemplate``, ``MixedInstancesPolicy``, or ``InstanceId``. + * + * @return the launchConfigurationName value. + */ + public String launchConfigurationName() { + return this.launchConfigurationName; + } + + /** + * Set the launchConfigurationName property: The name of the launch configuration to use to launch instances. + * Required only if you don't specify ``LaunchTemplate``, ``MixedInstancesPolicy``, or ``InstanceId``. + * + * @param launchConfigurationName the launchConfigurationName value to set. + * @return the AwsAutoScalingGroupProperties object itself. + */ + public AwsAutoScalingGroupProperties withLaunchConfigurationName(String launchConfigurationName) { + this.launchConfigurationName = launchConfigurationName; + return this; + } + + /** + * Get the launchTemplate property: Information used to specify the launch template and version to use to launch + * instances. You can alternatively associate a launch template to the Auto Scaling group by specifying a + * ``MixedInstancesPolicy``. For more information about creating launch templates, see [Create a launch template for + * an Auto Scaling group](https://docs.aws.amazon.com/autoscaling/ec2/userguide/create-launch-template.html) in the + * *Amazon EC2 Auto Scaling User Guide*. If you omit this property, you must specify ``MixedInstancesPolicy``, + * ``LaunchConfigurationName``, or ``InstanceId``. Specifies a launch template to use when provisioning EC2 + * instances for an Auto Scaling group. You must specify the following: + The ID or the name of the launch template, + * but not both. + The version of the launch template. ``LaunchTemplateSpecification`` is property of the + * [AWS::AutoScaling::AutoScalingGroup](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-autoscaling-autoscalinggroup.html) + * resource. It is also a property of the [AWS::AutoScaling::AutoScalingGroup + * LaunchTemplate](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-autoscaling-autoscalinggroup-launchtemplate.html) + * and [AWS::AutoScaling::AutoScalingGroup + * LaunchTemplateOverrides](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-autoscaling-autoscalinggroup-launchtemplateoverrides.html) + * property types. For information about creating a launch template, see + * [AWS::EC2::LaunchTemplate](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ec2-launchtemplate.html) + * and [Create a launch template for an Auto Scaling + * group](https://docs.aws.amazon.com/autoscaling/ec2/userguide/create-launch-template.html) in the *Amazon EC2 Auto + * Scaling User Guide*. For examples of launch templates, see [Auto scaling template + * snippets](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/quickref-autoscaling.html) and the + * [Examples](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ec2-launchtemplate.html#aws-resource-ec2-launchtemplate--examples) + * section in the ``AWS::EC2::LaunchTemplate`` resource. + * + * @return the launchTemplate value. + */ + public LaunchTemplateSpecification launchTemplate() { + return this.launchTemplate; + } + + /** + * Set the launchTemplate property: Information used to specify the launch template and version to use to launch + * instances. You can alternatively associate a launch template to the Auto Scaling group by specifying a + * ``MixedInstancesPolicy``. For more information about creating launch templates, see [Create a launch template for + * an Auto Scaling group](https://docs.aws.amazon.com/autoscaling/ec2/userguide/create-launch-template.html) in the + * *Amazon EC2 Auto Scaling User Guide*. If you omit this property, you must specify ``MixedInstancesPolicy``, + * ``LaunchConfigurationName``, or ``InstanceId``. Specifies a launch template to use when provisioning EC2 + * instances for an Auto Scaling group. You must specify the following: + The ID or the name of the launch template, + * but not both. + The version of the launch template. ``LaunchTemplateSpecification`` is property of the + * [AWS::AutoScaling::AutoScalingGroup](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-autoscaling-autoscalinggroup.html) + * resource. It is also a property of the [AWS::AutoScaling::AutoScalingGroup + * LaunchTemplate](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-autoscaling-autoscalinggroup-launchtemplate.html) + * and [AWS::AutoScaling::AutoScalingGroup + * LaunchTemplateOverrides](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-autoscaling-autoscalinggroup-launchtemplateoverrides.html) + * property types. For information about creating a launch template, see + * [AWS::EC2::LaunchTemplate](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ec2-launchtemplate.html) + * and [Create a launch template for an Auto Scaling + * group](https://docs.aws.amazon.com/autoscaling/ec2/userguide/create-launch-template.html) in the *Amazon EC2 Auto + * Scaling User Guide*. For examples of launch templates, see [Auto scaling template + * snippets](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/quickref-autoscaling.html) and the + * [Examples](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ec2-launchtemplate.html#aws-resource-ec2-launchtemplate--examples) + * section in the ``AWS::EC2::LaunchTemplate`` resource. + * + * @param launchTemplate the launchTemplate value to set. + * @return the AwsAutoScalingGroupProperties object itself. + */ + public AwsAutoScalingGroupProperties withLaunchTemplate(LaunchTemplateSpecification launchTemplate) { + this.launchTemplate = launchTemplate; + return this; + } + + /** + * Get the lifecycleHookSpecificationList property: One or more lifecycle hooks to add to the Auto Scaling group + * before instances are launched. + * + * @return the lifecycleHookSpecificationList value. + */ + public List lifecycleHookSpecificationList() { + return this.lifecycleHookSpecificationList; + } + + /** + * Set the lifecycleHookSpecificationList property: One or more lifecycle hooks to add to the Auto Scaling group + * before instances are launched. + * + * @param lifecycleHookSpecificationList the lifecycleHookSpecificationList value to set. + * @return the AwsAutoScalingGroupProperties object itself. + */ + public AwsAutoScalingGroupProperties + withLifecycleHookSpecificationList(List lifecycleHookSpecificationList) { + this.lifecycleHookSpecificationList = lifecycleHookSpecificationList; + return this; + } + + /** + * Get the loadBalancerNames property: A list of Classic Load Balancers associated with this Auto Scaling group. For + * Application Load Balancers, Network Load Balancers, and Gateway Load Balancers, specify the ``TargetGroupARNs`` + * property instead. + * + * @return the loadBalancerNames value. + */ + public List loadBalancerNames() { + return this.loadBalancerNames; + } + + /** + * Set the loadBalancerNames property: A list of Classic Load Balancers associated with this Auto Scaling group. For + * Application Load Balancers, Network Load Balancers, and Gateway Load Balancers, specify the ``TargetGroupARNs`` + * property instead. + * + * @param loadBalancerNames the loadBalancerNames value to set. + * @return the AwsAutoScalingGroupProperties object itself. + */ + public AwsAutoScalingGroupProperties withLoadBalancerNames(List loadBalancerNames) { + this.loadBalancerNames = loadBalancerNames; + return this; + } + + /** + * Get the maxInstanceLifetime property: The maximum amount of time, in seconds, that an instance can be in service. + * The default is null. If specified, the value must be either 0 or a number equal to or greater than 86,400 seconds + * (1 day). For more information, see [Replacing Auto Scaling instances based on maximum instance + * lifetime](https://docs.aws.amazon.com/autoscaling/ec2/userguide/asg-max-instance-lifetime.html) in the *Amazon + * EC2 Auto Scaling User Guide*. + * + * @return the maxInstanceLifetime value. + */ + public Integer maxInstanceLifetime() { + return this.maxInstanceLifetime; + } + + /** + * Set the maxInstanceLifetime property: The maximum amount of time, in seconds, that an instance can be in service. + * The default is null. If specified, the value must be either 0 or a number equal to or greater than 86,400 seconds + * (1 day). For more information, see [Replacing Auto Scaling instances based on maximum instance + * lifetime](https://docs.aws.amazon.com/autoscaling/ec2/userguide/asg-max-instance-lifetime.html) in the *Amazon + * EC2 Auto Scaling User Guide*. + * + * @param maxInstanceLifetime the maxInstanceLifetime value to set. + * @return the AwsAutoScalingGroupProperties object itself. + */ + public AwsAutoScalingGroupProperties withMaxInstanceLifetime(Integer maxInstanceLifetime) { + this.maxInstanceLifetime = maxInstanceLifetime; + return this; + } + + /** + * Get the maxSize property: The maximum size of the group. With a mixed instances policy that uses instance + * weighting, Amazon EC2 Auto Scaling may need to go above ``MaxSize`` to meet your capacity requirements. In this + * event, Amazon EC2 Auto Scaling will never go above ``MaxSize`` by more than your largest instance weight (weights + * that define how many units each instance contributes to the desired capacity of the group). + * + * @return the maxSize value. + */ + public String maxSize() { + return this.maxSize; + } + + /** + * Set the maxSize property: The maximum size of the group. With a mixed instances policy that uses instance + * weighting, Amazon EC2 Auto Scaling may need to go above ``MaxSize`` to meet your capacity requirements. In this + * event, Amazon EC2 Auto Scaling will never go above ``MaxSize`` by more than your largest instance weight (weights + * that define how many units each instance contributes to the desired capacity of the group). + * + * @param maxSize the maxSize value to set. + * @return the AwsAutoScalingGroupProperties object itself. + */ + public AwsAutoScalingGroupProperties withMaxSize(String maxSize) { + this.maxSize = maxSize; + return this; + } + + /** + * Get the metricsCollection property: Enables the monitoring of group metrics of an Auto Scaling group. By default, + * these metrics are disabled. + * + * @return the metricsCollection value. + */ + public List metricsCollection() { + return this.metricsCollection; + } + + /** + * Set the metricsCollection property: Enables the monitoring of group metrics of an Auto Scaling group. By default, + * these metrics are disabled. + * + * @param metricsCollection the metricsCollection value to set. + * @return the AwsAutoScalingGroupProperties object itself. + */ + public AwsAutoScalingGroupProperties withMetricsCollection(List metricsCollection) { + this.metricsCollection = metricsCollection; + return this; + } + + /** + * Get the minSize property: The minimum size of the group. + * + * @return the minSize value. + */ + public String minSize() { + return this.minSize; + } + + /** + * Set the minSize property: The minimum size of the group. + * + * @param minSize the minSize value to set. + * @return the AwsAutoScalingGroupProperties object itself. + */ + public AwsAutoScalingGroupProperties withMinSize(String minSize) { + this.minSize = minSize; + return this; + } + + /** + * Get the mixedInstancesPolicy property: An embedded object that specifies a mixed instances policy. The policy + * includes properties that not only define the distribution of On-Demand Instances and Spot Instances, the maximum + * price to pay for Spot Instances (optional), and how the Auto Scaling group allocates instance types to fulfill + * On-Demand and Spot capacities, but also the properties that specify the instance configuration information—the + * launch template and instance types. The policy can also include a weight for each instance type and different + * launch templates for individual instance types. For more information, see [Auto Scaling groups with multiple + * instance types and purchase + * options](https://docs.aws.amazon.com/autoscaling/ec2/userguide/ec2-auto-scaling-mixed-instances-groups.html) in + * the *Amazon EC2 Auto Scaling User Guide*. Use this structure to launch multiple instance types and On-Demand + * Instances and Spot Instances within a single Auto Scaling group. A mixed instances policy contains information + * that Amazon EC2 Auto Scaling can use to launch instances and help optimize your costs. For more information, see + * [Auto Scaling groups with multiple instance types and purchase + * options](https://docs.aws.amazon.com/autoscaling/ec2/userguide/ec2-auto-scaling-mixed-instances-groups.html) in + * the *Amazon EC2 Auto Scaling User Guide*. You can create a mixed instances policy for new and existing Auto + * Scaling groups. You must use a launch template to configure the policy. You cannot use a launch configuration. + * There are key differences between Spot Instances and On-Demand Instances: + The price for Spot Instances varies + * based on demand + Amazon EC2 can terminate an individual Spot Instance as the availability of, or price for, Spot + * Instances changes When a Spot Instance is terminated, Amazon EC2 Auto Scaling group attempts to launch a + * replacement instance to maintain the desired capacity for the group. ``MixedInstancesPolicy`` is a property of + * the + * [AWS::AutoScaling::AutoScalingGroup](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-autoscaling-autoscalinggroup.html) + * resource. + * + * @return the mixedInstancesPolicy value. + */ + public MixedInstancesPolicy mixedInstancesPolicy() { + return this.mixedInstancesPolicy; + } + + /** + * Set the mixedInstancesPolicy property: An embedded object that specifies a mixed instances policy. The policy + * includes properties that not only define the distribution of On-Demand Instances and Spot Instances, the maximum + * price to pay for Spot Instances (optional), and how the Auto Scaling group allocates instance types to fulfill + * On-Demand and Spot capacities, but also the properties that specify the instance configuration information—the + * launch template and instance types. The policy can also include a weight for each instance type and different + * launch templates for individual instance types. For more information, see [Auto Scaling groups with multiple + * instance types and purchase + * options](https://docs.aws.amazon.com/autoscaling/ec2/userguide/ec2-auto-scaling-mixed-instances-groups.html) in + * the *Amazon EC2 Auto Scaling User Guide*. Use this structure to launch multiple instance types and On-Demand + * Instances and Spot Instances within a single Auto Scaling group. A mixed instances policy contains information + * that Amazon EC2 Auto Scaling can use to launch instances and help optimize your costs. For more information, see + * [Auto Scaling groups with multiple instance types and purchase + * options](https://docs.aws.amazon.com/autoscaling/ec2/userguide/ec2-auto-scaling-mixed-instances-groups.html) in + * the *Amazon EC2 Auto Scaling User Guide*. You can create a mixed instances policy for new and existing Auto + * Scaling groups. You must use a launch template to configure the policy. You cannot use a launch configuration. + * There are key differences between Spot Instances and On-Demand Instances: + The price for Spot Instances varies + * based on demand + Amazon EC2 can terminate an individual Spot Instance as the availability of, or price for, Spot + * Instances changes When a Spot Instance is terminated, Amazon EC2 Auto Scaling group attempts to launch a + * replacement instance to maintain the desired capacity for the group. ``MixedInstancesPolicy`` is a property of + * the + * [AWS::AutoScaling::AutoScalingGroup](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-autoscaling-autoscalinggroup.html) + * resource. + * + * @param mixedInstancesPolicy the mixedInstancesPolicy value to set. + * @return the AwsAutoScalingGroupProperties object itself. + */ + public AwsAutoScalingGroupProperties withMixedInstancesPolicy(MixedInstancesPolicy mixedInstancesPolicy) { + this.mixedInstancesPolicy = mixedInstancesPolicy; + return this; + } + + /** + * Get the newInstancesProtectedFromScaleIn property: Indicates whether newly launched instances are protected from + * termination by Amazon EC2 Auto Scaling when scaling in. For more information about preventing instances from + * terminating on scale in, see [Using instance scale-in + * protection](https://docs.aws.amazon.com/autoscaling/ec2/userguide/ec2-auto-scaling-instance-protection.html) in + * the *Amazon EC2 Auto Scaling User Guide*. + * + * @return the newInstancesProtectedFromScaleIn value. + */ + public Boolean newInstancesProtectedFromScaleIn() { + return this.newInstancesProtectedFromScaleIn; + } + + /** + * Set the newInstancesProtectedFromScaleIn property: Indicates whether newly launched instances are protected from + * termination by Amazon EC2 Auto Scaling when scaling in. For more information about preventing instances from + * terminating on scale in, see [Using instance scale-in + * protection](https://docs.aws.amazon.com/autoscaling/ec2/userguide/ec2-auto-scaling-instance-protection.html) in + * the *Amazon EC2 Auto Scaling User Guide*. + * + * @param newInstancesProtectedFromScaleIn the newInstancesProtectedFromScaleIn value to set. + * @return the AwsAutoScalingGroupProperties object itself. + */ + public AwsAutoScalingGroupProperties + withNewInstancesProtectedFromScaleIn(Boolean newInstancesProtectedFromScaleIn) { + this.newInstancesProtectedFromScaleIn = newInstancesProtectedFromScaleIn; + return this; + } + + /** + * Get the notificationConfiguration property: A structure that specifies an Amazon SNS notification configuration + * for the ``NotificationConfigurations`` property of the + * [AWS::AutoScaling::AutoScalingGroup](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-autoscaling-autoscalinggroup.html) + * resource. For an example template snippet, see [Auto scaling template + * snippets](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/quickref-autoscaling.html). For more + * information, see [Get Amazon SNS notifications when your Auto Scaling group + * scales](https://docs.aws.amazon.com/autoscaling/ec2/userguide/ASGettingNotifications.html) in the *Amazon EC2 + * Auto Scaling User Guide*. + * + * @return the notificationConfiguration value. + */ + public NotificationConfiguration notificationConfiguration() { + return this.notificationConfiguration; + } + + /** + * Set the notificationConfiguration property: A structure that specifies an Amazon SNS notification configuration + * for the ``NotificationConfigurations`` property of the + * [AWS::AutoScaling::AutoScalingGroup](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-autoscaling-autoscalinggroup.html) + * resource. For an example template snippet, see [Auto scaling template + * snippets](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/quickref-autoscaling.html). For more + * information, see [Get Amazon SNS notifications when your Auto Scaling group + * scales](https://docs.aws.amazon.com/autoscaling/ec2/userguide/ASGettingNotifications.html) in the *Amazon EC2 + * Auto Scaling User Guide*. + * + * @param notificationConfiguration the notificationConfiguration value to set. + * @return the AwsAutoScalingGroupProperties object itself. + */ + public AwsAutoScalingGroupProperties + withNotificationConfiguration(NotificationConfiguration notificationConfiguration) { + this.notificationConfiguration = notificationConfiguration; + return this; + } + + /** + * Get the notificationConfigurations property: Configures an Auto Scaling group to send notifications when + * specified events take place. + * + * @return the notificationConfigurations value. + */ + public List notificationConfigurations() { + return this.notificationConfigurations; + } + + /** + * Set the notificationConfigurations property: Configures an Auto Scaling group to send notifications when + * specified events take place. + * + * @param notificationConfigurations the notificationConfigurations value to set. + * @return the AwsAutoScalingGroupProperties object itself. + */ + public AwsAutoScalingGroupProperties + withNotificationConfigurations(List notificationConfigurations) { + this.notificationConfigurations = notificationConfigurations; + return this; + } + + /** + * Get the placementGroup property: The name of the placement group into which to launch your instances. For more + * information, see [Placement groups](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/placement-groups.html) in + * the *Amazon EC2 User Guide for Linux Instances*. A *cluster* placement group is a logical grouping of instances + * within a single Availability Zone. You cannot specify multiple Availability Zones and a cluster placement group. + * + * @return the placementGroup value. + */ + public String placementGroup() { + return this.placementGroup; + } + + /** + * Set the placementGroup property: The name of the placement group into which to launch your instances. For more + * information, see [Placement groups](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/placement-groups.html) in + * the *Amazon EC2 User Guide for Linux Instances*. A *cluster* placement group is a logical grouping of instances + * within a single Availability Zone. You cannot specify multiple Availability Zones and a cluster placement group. + * + * @param placementGroup the placementGroup value to set. + * @return the AwsAutoScalingGroupProperties object itself. + */ + public AwsAutoScalingGroupProperties withPlacementGroup(String placementGroup) { + this.placementGroup = placementGroup; + return this; + } + + /** + * Get the serviceLinkedRoleArn property: The Amazon Resource Name (ARN) of the service-linked role that the Auto + * Scaling group uses to call other AWS service on your behalf. By default, Amazon EC2 Auto Scaling uses a + * service-linked role named ``AWSServiceRoleForAutoScaling``, which it creates if it does not exist. For more + * information, see [Service-linked + * roles](https://docs.aws.amazon.com/autoscaling/ec2/userguide/autoscaling-service-linked-role.html) in the *Amazon + * EC2 Auto Scaling User Guide*. + * + * @return the serviceLinkedRoleArn value. + */ + public String serviceLinkedRoleArn() { + return this.serviceLinkedRoleArn; + } + + /** + * Set the serviceLinkedRoleArn property: The Amazon Resource Name (ARN) of the service-linked role that the Auto + * Scaling group uses to call other AWS service on your behalf. By default, Amazon EC2 Auto Scaling uses a + * service-linked role named ``AWSServiceRoleForAutoScaling``, which it creates if it does not exist. For more + * information, see [Service-linked + * roles](https://docs.aws.amazon.com/autoscaling/ec2/userguide/autoscaling-service-linked-role.html) in the *Amazon + * EC2 Auto Scaling User Guide*. + * + * @param serviceLinkedRoleArn the serviceLinkedRoleArn value to set. + * @return the AwsAutoScalingGroupProperties object itself. + */ + public AwsAutoScalingGroupProperties withServiceLinkedRoleArn(String serviceLinkedRoleArn) { + this.serviceLinkedRoleArn = serviceLinkedRoleArn; + return this; + } + + /** + * Get the tags property: One or more tags. You can tag your Auto Scaling group and propagate the tags to the Amazon + * EC2 instances it launches. Tags are not propagated to Amazon EBS volumes. To add tags to Amazon EBS volumes, + * specify the tags in a launch template but use caution. If the launch template specifies an instance tag with a + * key that is also specified for the Auto Scaling group, Amazon EC2 Auto Scaling overrides the value of that + * instance tag with the value specified by the Auto Scaling group. For more information, see [Tag Auto Scaling + * groups and instances](https://docs.aws.amazon.com/autoscaling/ec2/userguide/ec2-auto-scaling-tagging.html) in the + * *Amazon EC2 Auto Scaling User Guide*. + * + * @return the tags value. + */ + public List tags() { + return this.tags; + } + + /** + * Set the tags property: One or more tags. You can tag your Auto Scaling group and propagate the tags to the Amazon + * EC2 instances it launches. Tags are not propagated to Amazon EBS volumes. To add tags to Amazon EBS volumes, + * specify the tags in a launch template but use caution. If the launch template specifies an instance tag with a + * key that is also specified for the Auto Scaling group, Amazon EC2 Auto Scaling overrides the value of that + * instance tag with the value specified by the Auto Scaling group. For more information, see [Tag Auto Scaling + * groups and instances](https://docs.aws.amazon.com/autoscaling/ec2/userguide/ec2-auto-scaling-tagging.html) in the + * *Amazon EC2 Auto Scaling User Guide*. + * + * @param tags the tags value to set. + * @return the AwsAutoScalingGroupProperties object itself. + */ + public AwsAutoScalingGroupProperties withTags(List tags) { + this.tags = tags; + return this; + } + + /** + * Get the targetGroupARNs property: The Amazon Resource Names (ARN) of the Elastic Load Balancing target groups to + * associate with the Auto Scaling group. Instances are registered as targets with the target groups. The target + * groups receive incoming traffic and route requests to one or more registered targets. For more information, see + * [Use Elastic Load Balancing to distribute traffic across the instances in your Auto Scaling + * group](https://docs.aws.amazon.com/autoscaling/ec2/userguide/autoscaling-load-balancer.html) in the *Amazon EC2 + * Auto Scaling User Guide*. + * + * @return the targetGroupARNs value. + */ + public List targetGroupARNs() { + return this.targetGroupARNs; + } + + /** + * Set the targetGroupARNs property: The Amazon Resource Names (ARN) of the Elastic Load Balancing target groups to + * associate with the Auto Scaling group. Instances are registered as targets with the target groups. The target + * groups receive incoming traffic and route requests to one or more registered targets. For more information, see + * [Use Elastic Load Balancing to distribute traffic across the instances in your Auto Scaling + * group](https://docs.aws.amazon.com/autoscaling/ec2/userguide/autoscaling-load-balancer.html) in the *Amazon EC2 + * Auto Scaling User Guide*. + * + * @param targetGroupARNs the targetGroupARNs value to set. + * @return the AwsAutoScalingGroupProperties object itself. + */ + public AwsAutoScalingGroupProperties withTargetGroupARNs(List targetGroupARNs) { + this.targetGroupARNs = targetGroupARNs; + return this; + } + + /** + * Get the terminationPolicies property: A policy or a list of policies that are used to select the instance to + * terminate. These policies are executed in the order that you list them. For more information, see [Work with + * Amazon EC2 Auto Scaling termination + * policies](https://docs.aws.amazon.com/autoscaling/ec2/userguide/ec2-auto-scaling-termination-policies.html) in + * the *Amazon EC2 Auto Scaling User Guide*. Valid values: ``Default`` | ``AllocationStrategy`` | + * ``ClosestToNextInstanceHour`` | ``NewestInstance`` | ``OldestInstance`` | ``OldestLaunchConfiguration`` | + * ``OldestLaunchTemplate`` | ``arn:aws:lambda:region:account-id:function:my-function:my-alias``. + * + * @return the terminationPolicies value. + */ + public List terminationPolicies() { + return this.terminationPolicies; + } + + /** + * Set the terminationPolicies property: A policy or a list of policies that are used to select the instance to + * terminate. These policies are executed in the order that you list them. For more information, see [Work with + * Amazon EC2 Auto Scaling termination + * policies](https://docs.aws.amazon.com/autoscaling/ec2/userguide/ec2-auto-scaling-termination-policies.html) in + * the *Amazon EC2 Auto Scaling User Guide*. Valid values: ``Default`` | ``AllocationStrategy`` | + * ``ClosestToNextInstanceHour`` | ``NewestInstance`` | ``OldestInstance`` | ``OldestLaunchConfiguration`` | + * ``OldestLaunchTemplate`` | ``arn:aws:lambda:region:account-id:function:my-function:my-alias``. + * + * @param terminationPolicies the terminationPolicies value to set. + * @return the AwsAutoScalingGroupProperties object itself. + */ + public AwsAutoScalingGroupProperties withTerminationPolicies(List terminationPolicies) { + this.terminationPolicies = terminationPolicies; + return this; + } + + /** + * Get the vpcZoneIdentifier property: A list of subnet IDs for a virtual private cloud (VPC) where instances in the + * Auto Scaling group can be created. If this resource specifies public subnets and is also in a VPC that is defined + * in the same stack template, you must use the [DependsOn + * attribute](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-dependson.html) to + * declare a dependency on the [VPC-gateway + * attachment](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ec2-vpc-gateway-attachment.html). + * When you update ``VPCZoneIdentifier``, this retains the same Auto Scaling group and replaces old instances with + * new ones, according to the specified subnets. You can optionally specify how CloudFormation handles these updates + * by using an [UpdatePolicy + * attribute](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-updatepolicy.html). + * Required to launch instances into a nondefault VPC. If you specify ``VPCZoneIdentifier`` with + * ``AvailabilityZones``, the subnets that you specify for this property must reside in those Availability Zones. + * + * @return the vpcZoneIdentifier value. + */ + public List vpcZoneIdentifier() { + return this.vpcZoneIdentifier; + } + + /** + * Set the vpcZoneIdentifier property: A list of subnet IDs for a virtual private cloud (VPC) where instances in the + * Auto Scaling group can be created. If this resource specifies public subnets and is also in a VPC that is defined + * in the same stack template, you must use the [DependsOn + * attribute](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-dependson.html) to + * declare a dependency on the [VPC-gateway + * attachment](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ec2-vpc-gateway-attachment.html). + * When you update ``VPCZoneIdentifier``, this retains the same Auto Scaling group and replaces old instances with + * new ones, according to the specified subnets. You can optionally specify how CloudFormation handles these updates + * by using an [UpdatePolicy + * attribute](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-updatepolicy.html). + * Required to launch instances into a nondefault VPC. If you specify ``VPCZoneIdentifier`` with + * ``AvailabilityZones``, the subnets that you specify for this property must reside in those Availability Zones. + * + * @param vpcZoneIdentifier the vpcZoneIdentifier value to set. + * @return the AwsAutoScalingGroupProperties object itself. + */ + public AwsAutoScalingGroupProperties withVpcZoneIdentifier(List vpcZoneIdentifier) { + this.vpcZoneIdentifier = vpcZoneIdentifier; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (instanceMaintenancePolicy() != null) { + instanceMaintenancePolicy().validate(); + } + if (launchTemplate() != null) { + launchTemplate().validate(); + } + if (lifecycleHookSpecificationList() != null) { + lifecycleHookSpecificationList().forEach(e -> e.validate()); + } + if (metricsCollection() != null) { + metricsCollection().forEach(e -> e.validate()); + } + if (mixedInstancesPolicy() != null) { + mixedInstancesPolicy().validate(); + } + if (notificationConfiguration() != null) { + notificationConfiguration().validate(); + } + if (notificationConfigurations() != null) { + notificationConfigurations().forEach(e -> e.validate()); + } + if (tags() != null) { + tags().forEach(e -> e.validate()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("autoScalingGroupName", this.autoScalingGroupName); + jsonWriter.writeArrayField("availabilityZones", this.availabilityZones, + (writer, element) -> writer.writeString(element)); + jsonWriter.writeBooleanField("capacityRebalance", this.capacityRebalance); + jsonWriter.writeStringField("context", this.context); + jsonWriter.writeStringField("cooldown", this.cooldown); + jsonWriter.writeNumberField("defaultInstanceWarmup", this.defaultInstanceWarmup); + jsonWriter.writeStringField("desiredCapacity", this.desiredCapacity); + jsonWriter.writeStringField("desiredCapacityType", this.desiredCapacityType); + jsonWriter.writeNumberField("healthCheckGracePeriod", this.healthCheckGracePeriod); + jsonWriter.writeStringField("healthCheckType", this.healthCheckType); + jsonWriter.writeStringField("instanceId", this.instanceId); + jsonWriter.writeJsonField("instanceMaintenancePolicy", this.instanceMaintenancePolicy); + jsonWriter.writeStringField("launchConfigurationName", this.launchConfigurationName); + jsonWriter.writeJsonField("launchTemplate", this.launchTemplate); + jsonWriter.writeArrayField("lifecycleHookSpecificationList", this.lifecycleHookSpecificationList, + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("loadBalancerNames", this.loadBalancerNames, + (writer, element) -> writer.writeString(element)); + jsonWriter.writeNumberField("maxInstanceLifetime", this.maxInstanceLifetime); + jsonWriter.writeStringField("maxSize", this.maxSize); + jsonWriter.writeArrayField("metricsCollection", this.metricsCollection, + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("minSize", this.minSize); + jsonWriter.writeJsonField("mixedInstancesPolicy", this.mixedInstancesPolicy); + jsonWriter.writeBooleanField("newInstancesProtectedFromScaleIn", this.newInstancesProtectedFromScaleIn); + jsonWriter.writeJsonField("notificationConfiguration", this.notificationConfiguration); + jsonWriter.writeArrayField("notificationConfigurations", this.notificationConfigurations, + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("placementGroup", this.placementGroup); + jsonWriter.writeStringField("serviceLinkedRoleARN", this.serviceLinkedRoleArn); + jsonWriter.writeArrayField("tags", this.tags, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("targetGroupARNs", this.targetGroupARNs, + (writer, element) -> writer.writeString(element)); + jsonWriter.writeArrayField("terminationPolicies", this.terminationPolicies, + (writer, element) -> writer.writeString(element)); + jsonWriter.writeArrayField("vpcZoneIdentifier", this.vpcZoneIdentifier, + (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AwsAutoScalingGroupProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AwsAutoScalingGroupProperties if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the AwsAutoScalingGroupProperties. + */ + public static AwsAutoScalingGroupProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AwsAutoScalingGroupProperties deserializedAwsAutoScalingGroupProperties + = new AwsAutoScalingGroupProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("autoScalingGroupName".equals(fieldName)) { + deserializedAwsAutoScalingGroupProperties.autoScalingGroupName = reader.getString(); + } else if ("availabilityZones".equals(fieldName)) { + List availabilityZones = reader.readArray(reader1 -> reader1.getString()); + deserializedAwsAutoScalingGroupProperties.availabilityZones = availabilityZones; + } else if ("capacityRebalance".equals(fieldName)) { + deserializedAwsAutoScalingGroupProperties.capacityRebalance + = reader.getNullable(JsonReader::getBoolean); + } else if ("context".equals(fieldName)) { + deserializedAwsAutoScalingGroupProperties.context = reader.getString(); + } else if ("cooldown".equals(fieldName)) { + deserializedAwsAutoScalingGroupProperties.cooldown = reader.getString(); + } else if ("defaultInstanceWarmup".equals(fieldName)) { + deserializedAwsAutoScalingGroupProperties.defaultInstanceWarmup + = reader.getNullable(JsonReader::getInt); + } else if ("desiredCapacity".equals(fieldName)) { + deserializedAwsAutoScalingGroupProperties.desiredCapacity = reader.getString(); + } else if ("desiredCapacityType".equals(fieldName)) { + deserializedAwsAutoScalingGroupProperties.desiredCapacityType = reader.getString(); + } else if ("healthCheckGracePeriod".equals(fieldName)) { + deserializedAwsAutoScalingGroupProperties.healthCheckGracePeriod + = reader.getNullable(JsonReader::getInt); + } else if ("healthCheckType".equals(fieldName)) { + deserializedAwsAutoScalingGroupProperties.healthCheckType = reader.getString(); + } else if ("instanceId".equals(fieldName)) { + deserializedAwsAutoScalingGroupProperties.instanceId = reader.getString(); + } else if ("instanceMaintenancePolicy".equals(fieldName)) { + deserializedAwsAutoScalingGroupProperties.instanceMaintenancePolicy + = InstanceMaintenancePolicy.fromJson(reader); + } else if ("launchConfigurationName".equals(fieldName)) { + deserializedAwsAutoScalingGroupProperties.launchConfigurationName = reader.getString(); + } else if ("launchTemplate".equals(fieldName)) { + deserializedAwsAutoScalingGroupProperties.launchTemplate + = LaunchTemplateSpecification.fromJson(reader); + } else if ("lifecycleHookSpecificationList".equals(fieldName)) { + List lifecycleHookSpecificationList + = reader.readArray(reader1 -> LifecycleHookSpecification.fromJson(reader1)); + deserializedAwsAutoScalingGroupProperties.lifecycleHookSpecificationList + = lifecycleHookSpecificationList; + } else if ("loadBalancerNames".equals(fieldName)) { + List loadBalancerNames = reader.readArray(reader1 -> reader1.getString()); + deserializedAwsAutoScalingGroupProperties.loadBalancerNames = loadBalancerNames; + } else if ("maxInstanceLifetime".equals(fieldName)) { + deserializedAwsAutoScalingGroupProperties.maxInstanceLifetime + = reader.getNullable(JsonReader::getInt); + } else if ("maxSize".equals(fieldName)) { + deserializedAwsAutoScalingGroupProperties.maxSize = reader.getString(); + } else if ("metricsCollection".equals(fieldName)) { + List metricsCollection + = reader.readArray(reader1 -> MetricsCollection.fromJson(reader1)); + deserializedAwsAutoScalingGroupProperties.metricsCollection = metricsCollection; + } else if ("minSize".equals(fieldName)) { + deserializedAwsAutoScalingGroupProperties.minSize = reader.getString(); + } else if ("mixedInstancesPolicy".equals(fieldName)) { + deserializedAwsAutoScalingGroupProperties.mixedInstancesPolicy + = MixedInstancesPolicy.fromJson(reader); + } else if ("newInstancesProtectedFromScaleIn".equals(fieldName)) { + deserializedAwsAutoScalingGroupProperties.newInstancesProtectedFromScaleIn + = reader.getNullable(JsonReader::getBoolean); + } else if ("notificationConfiguration".equals(fieldName)) { + deserializedAwsAutoScalingGroupProperties.notificationConfiguration + = NotificationConfiguration.fromJson(reader); + } else if ("notificationConfigurations".equals(fieldName)) { + List notificationConfigurations + = reader.readArray(reader1 -> NotificationConfiguration.fromJson(reader1)); + deserializedAwsAutoScalingGroupProperties.notificationConfigurations = notificationConfigurations; + } else if ("placementGroup".equals(fieldName)) { + deserializedAwsAutoScalingGroupProperties.placementGroup = reader.getString(); + } else if ("serviceLinkedRoleARN".equals(fieldName)) { + deserializedAwsAutoScalingGroupProperties.serviceLinkedRoleArn = reader.getString(); + } else if ("tags".equals(fieldName)) { + List tags = reader.readArray(reader1 -> TagProperty.fromJson(reader1)); + deserializedAwsAutoScalingGroupProperties.tags = tags; + } else if ("targetGroupARNs".equals(fieldName)) { + List targetGroupARNs = reader.readArray(reader1 -> reader1.getString()); + deserializedAwsAutoScalingGroupProperties.targetGroupARNs = targetGroupARNs; + } else if ("terminationPolicies".equals(fieldName)) { + List terminationPolicies = reader.readArray(reader1 -> reader1.getString()); + deserializedAwsAutoScalingGroupProperties.terminationPolicies = terminationPolicies; + } else if ("vpcZoneIdentifier".equals(fieldName)) { + List vpcZoneIdentifier = reader.readArray(reader1 -> reader1.getString()); + deserializedAwsAutoScalingGroupProperties.vpcZoneIdentifier = vpcZoneIdentifier; + } else { + reader.skipChildren(); + } + } + + return deserializedAwsAutoScalingGroupProperties; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/AwsCloudFormationStackProperties.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/AwsCloudFormationStackProperties.java new file mode 100644 index 000000000000..8e20b8041a8c --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/AwsCloudFormationStackProperties.java @@ -0,0 +1,730 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; +import java.util.Map; + +/** + * Definition of awsCloudFormationStack. + */ +@Fluent +public final class AwsCloudFormationStackProperties implements JsonSerializable { + /* + * Property capabilities + */ + private List capabilities; + + /* + * Property changeSetId + */ + private String changeSetId; + + /* + * Property creationTime + */ + private String creationTime; + + /* + * Property description + */ + private String description; + + /* + * Property disableRollback + */ + private Boolean disableRollback; + + /* + * Property enableTerminationProtection + */ + private Boolean enableTerminationProtection; + + /* + * Property lastUpdateTime + */ + private String lastUpdateTime; + + /* + * Property notificationARNs + */ + private List notificationARNs; + + /* + * Property outputs + */ + private List outputs; + + /* + * Property parameters + */ + private Map parameters; + + /* + * Property parentId + */ + private String parentId; + + /* + * Property roleARN + */ + private String roleArn; + + /* + * Property rootId + */ + private String rootId; + + /* + * Property stackId + */ + private String stackId; + + /* + * Property stackName + */ + private String stackName; + + /* + * Property stackPolicyBody + */ + private Object stackPolicyBody; + + /* + * Property stackPolicyURL + */ + private String stackPolicyUrl; + + /* + * Property stackStatus + */ + private StackStatus stackStatus; + + /* + * Property stackStatusReason + */ + private String stackStatusReason; + + /* + * Property tags + */ + private List tags; + + /* + * Property templateBody + */ + private Object templateBody; + + /* + * Property templateURL + */ + private String templateUrl; + + /* + * Property timeoutInMinutes + */ + private Integer timeoutInMinutes; + + /** + * Creates an instance of AwsCloudFormationStackProperties class. + */ + public AwsCloudFormationStackProperties() { + } + + /** + * Get the capabilities property: Property capabilities. + * + * @return the capabilities value. + */ + public List capabilities() { + return this.capabilities; + } + + /** + * Set the capabilities property: Property capabilities. + * + * @param capabilities the capabilities value to set. + * @return the AwsCloudFormationStackProperties object itself. + */ + public AwsCloudFormationStackProperties withCapabilities(List capabilities) { + this.capabilities = capabilities; + return this; + } + + /** + * Get the changeSetId property: Property changeSetId. + * + * @return the changeSetId value. + */ + public String changeSetId() { + return this.changeSetId; + } + + /** + * Set the changeSetId property: Property changeSetId. + * + * @param changeSetId the changeSetId value to set. + * @return the AwsCloudFormationStackProperties object itself. + */ + public AwsCloudFormationStackProperties withChangeSetId(String changeSetId) { + this.changeSetId = changeSetId; + return this; + } + + /** + * Get the creationTime property: Property creationTime. + * + * @return the creationTime value. + */ + public String creationTime() { + return this.creationTime; + } + + /** + * Set the creationTime property: Property creationTime. + * + * @param creationTime the creationTime value to set. + * @return the AwsCloudFormationStackProperties object itself. + */ + public AwsCloudFormationStackProperties withCreationTime(String creationTime) { + this.creationTime = creationTime; + return this; + } + + /** + * Get the description property: Property description. + * + * @return the description value. + */ + public String description() { + return this.description; + } + + /** + * Set the description property: Property description. + * + * @param description the description value to set. + * @return the AwsCloudFormationStackProperties object itself. + */ + public AwsCloudFormationStackProperties withDescription(String description) { + this.description = description; + return this; + } + + /** + * Get the disableRollback property: Property disableRollback. + * + * @return the disableRollback value. + */ + public Boolean disableRollback() { + return this.disableRollback; + } + + /** + * Set the disableRollback property: Property disableRollback. + * + * @param disableRollback the disableRollback value to set. + * @return the AwsCloudFormationStackProperties object itself. + */ + public AwsCloudFormationStackProperties withDisableRollback(Boolean disableRollback) { + this.disableRollback = disableRollback; + return this; + } + + /** + * Get the enableTerminationProtection property: Property enableTerminationProtection. + * + * @return the enableTerminationProtection value. + */ + public Boolean enableTerminationProtection() { + return this.enableTerminationProtection; + } + + /** + * Set the enableTerminationProtection property: Property enableTerminationProtection. + * + * @param enableTerminationProtection the enableTerminationProtection value to set. + * @return the AwsCloudFormationStackProperties object itself. + */ + public AwsCloudFormationStackProperties withEnableTerminationProtection(Boolean enableTerminationProtection) { + this.enableTerminationProtection = enableTerminationProtection; + return this; + } + + /** + * Get the lastUpdateTime property: Property lastUpdateTime. + * + * @return the lastUpdateTime value. + */ + public String lastUpdateTime() { + return this.lastUpdateTime; + } + + /** + * Set the lastUpdateTime property: Property lastUpdateTime. + * + * @param lastUpdateTime the lastUpdateTime value to set. + * @return the AwsCloudFormationStackProperties object itself. + */ + public AwsCloudFormationStackProperties withLastUpdateTime(String lastUpdateTime) { + this.lastUpdateTime = lastUpdateTime; + return this; + } + + /** + * Get the notificationARNs property: Property notificationARNs. + * + * @return the notificationARNs value. + */ + public List notificationARNs() { + return this.notificationARNs; + } + + /** + * Set the notificationARNs property: Property notificationARNs. + * + * @param notificationARNs the notificationARNs value to set. + * @return the AwsCloudFormationStackProperties object itself. + */ + public AwsCloudFormationStackProperties withNotificationARNs(List notificationARNs) { + this.notificationARNs = notificationARNs; + return this; + } + + /** + * Get the outputs property: Property outputs. + * + * @return the outputs value. + */ + public List outputs() { + return this.outputs; + } + + /** + * Set the outputs property: Property outputs. + * + * @param outputs the outputs value to set. + * @return the AwsCloudFormationStackProperties object itself. + */ + public AwsCloudFormationStackProperties withOutputs(List outputs) { + this.outputs = outputs; + return this; + } + + /** + * Get the parameters property: Property parameters. + * + * @return the parameters value. + */ + public Map parameters() { + return this.parameters; + } + + /** + * Set the parameters property: Property parameters. + * + * @param parameters the parameters value to set. + * @return the AwsCloudFormationStackProperties object itself. + */ + public AwsCloudFormationStackProperties withParameters(Map parameters) { + this.parameters = parameters; + return this; + } + + /** + * Get the parentId property: Property parentId. + * + * @return the parentId value. + */ + public String parentId() { + return this.parentId; + } + + /** + * Set the parentId property: Property parentId. + * + * @param parentId the parentId value to set. + * @return the AwsCloudFormationStackProperties object itself. + */ + public AwsCloudFormationStackProperties withParentId(String parentId) { + this.parentId = parentId; + return this; + } + + /** + * Get the roleArn property: Property roleARN. + * + * @return the roleArn value. + */ + public String roleArn() { + return this.roleArn; + } + + /** + * Set the roleArn property: Property roleARN. + * + * @param roleArn the roleArn value to set. + * @return the AwsCloudFormationStackProperties object itself. + */ + public AwsCloudFormationStackProperties withRoleArn(String roleArn) { + this.roleArn = roleArn; + return this; + } + + /** + * Get the rootId property: Property rootId. + * + * @return the rootId value. + */ + public String rootId() { + return this.rootId; + } + + /** + * Set the rootId property: Property rootId. + * + * @param rootId the rootId value to set. + * @return the AwsCloudFormationStackProperties object itself. + */ + public AwsCloudFormationStackProperties withRootId(String rootId) { + this.rootId = rootId; + return this; + } + + /** + * Get the stackId property: Property stackId. + * + * @return the stackId value. + */ + public String stackId() { + return this.stackId; + } + + /** + * Set the stackId property: Property stackId. + * + * @param stackId the stackId value to set. + * @return the AwsCloudFormationStackProperties object itself. + */ + public AwsCloudFormationStackProperties withStackId(String stackId) { + this.stackId = stackId; + return this; + } + + /** + * Get the stackName property: Property stackName. + * + * @return the stackName value. + */ + public String stackName() { + return this.stackName; + } + + /** + * Set the stackName property: Property stackName. + * + * @param stackName the stackName value to set. + * @return the AwsCloudFormationStackProperties object itself. + */ + public AwsCloudFormationStackProperties withStackName(String stackName) { + this.stackName = stackName; + return this; + } + + /** + * Get the stackPolicyBody property: Property stackPolicyBody. + * + * @return the stackPolicyBody value. + */ + public Object stackPolicyBody() { + return this.stackPolicyBody; + } + + /** + * Set the stackPolicyBody property: Property stackPolicyBody. + * + * @param stackPolicyBody the stackPolicyBody value to set. + * @return the AwsCloudFormationStackProperties object itself. + */ + public AwsCloudFormationStackProperties withStackPolicyBody(Object stackPolicyBody) { + this.stackPolicyBody = stackPolicyBody; + return this; + } + + /** + * Get the stackPolicyUrl property: Property stackPolicyURL. + * + * @return the stackPolicyUrl value. + */ + public String stackPolicyUrl() { + return this.stackPolicyUrl; + } + + /** + * Set the stackPolicyUrl property: Property stackPolicyURL. + * + * @param stackPolicyUrl the stackPolicyUrl value to set. + * @return the AwsCloudFormationStackProperties object itself. + */ + public AwsCloudFormationStackProperties withStackPolicyUrl(String stackPolicyUrl) { + this.stackPolicyUrl = stackPolicyUrl; + return this; + } + + /** + * Get the stackStatus property: Property stackStatus. + * + * @return the stackStatus value. + */ + public StackStatus stackStatus() { + return this.stackStatus; + } + + /** + * Set the stackStatus property: Property stackStatus. + * + * @param stackStatus the stackStatus value to set. + * @return the AwsCloudFormationStackProperties object itself. + */ + public AwsCloudFormationStackProperties withStackStatus(StackStatus stackStatus) { + this.stackStatus = stackStatus; + return this; + } + + /** + * Get the stackStatusReason property: Property stackStatusReason. + * + * @return the stackStatusReason value. + */ + public String stackStatusReason() { + return this.stackStatusReason; + } + + /** + * Set the stackStatusReason property: Property stackStatusReason. + * + * @param stackStatusReason the stackStatusReason value to set. + * @return the AwsCloudFormationStackProperties object itself. + */ + public AwsCloudFormationStackProperties withStackStatusReason(String stackStatusReason) { + this.stackStatusReason = stackStatusReason; + return this; + } + + /** + * Get the tags property: Property tags. + * + * @return the tags value. + */ + public List tags() { + return this.tags; + } + + /** + * Set the tags property: Property tags. + * + * @param tags the tags value to set. + * @return the AwsCloudFormationStackProperties object itself. + */ + public AwsCloudFormationStackProperties withTags(List tags) { + this.tags = tags; + return this; + } + + /** + * Get the templateBody property: Property templateBody. + * + * @return the templateBody value. + */ + public Object templateBody() { + return this.templateBody; + } + + /** + * Set the templateBody property: Property templateBody. + * + * @param templateBody the templateBody value to set. + * @return the AwsCloudFormationStackProperties object itself. + */ + public AwsCloudFormationStackProperties withTemplateBody(Object templateBody) { + this.templateBody = templateBody; + return this; + } + + /** + * Get the templateUrl property: Property templateURL. + * + * @return the templateUrl value. + */ + public String templateUrl() { + return this.templateUrl; + } + + /** + * Set the templateUrl property: Property templateURL. + * + * @param templateUrl the templateUrl value to set. + * @return the AwsCloudFormationStackProperties object itself. + */ + public AwsCloudFormationStackProperties withTemplateUrl(String templateUrl) { + this.templateUrl = templateUrl; + return this; + } + + /** + * Get the timeoutInMinutes property: Property timeoutInMinutes. + * + * @return the timeoutInMinutes value. + */ + public Integer timeoutInMinutes() { + return this.timeoutInMinutes; + } + + /** + * Set the timeoutInMinutes property: Property timeoutInMinutes. + * + * @param timeoutInMinutes the timeoutInMinutes value to set. + * @return the AwsCloudFormationStackProperties object itself. + */ + public AwsCloudFormationStackProperties withTimeoutInMinutes(Integer timeoutInMinutes) { + this.timeoutInMinutes = timeoutInMinutes; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (outputs() != null) { + outputs().forEach(e -> e.validate()); + } + if (tags() != null) { + tags().forEach(e -> e.validate()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("capabilities", this.capabilities, + (writer, element) -> writer.writeString(element == null ? null : element.toString())); + jsonWriter.writeStringField("changeSetId", this.changeSetId); + jsonWriter.writeStringField("creationTime", this.creationTime); + jsonWriter.writeStringField("description", this.description); + jsonWriter.writeBooleanField("disableRollback", this.disableRollback); + jsonWriter.writeBooleanField("enableTerminationProtection", this.enableTerminationProtection); + jsonWriter.writeStringField("lastUpdateTime", this.lastUpdateTime); + jsonWriter.writeArrayField("notificationARNs", this.notificationARNs, + (writer, element) -> writer.writeString(element)); + jsonWriter.writeArrayField("outputs", this.outputs, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeMapField("parameters", this.parameters, (writer, element) -> writer.writeString(element)); + jsonWriter.writeStringField("parentId", this.parentId); + jsonWriter.writeStringField("roleARN", this.roleArn); + jsonWriter.writeStringField("rootId", this.rootId); + jsonWriter.writeStringField("stackId", this.stackId); + jsonWriter.writeStringField("stackName", this.stackName); + jsonWriter.writeUntypedField("stackPolicyBody", this.stackPolicyBody); + jsonWriter.writeStringField("stackPolicyURL", this.stackPolicyUrl); + jsonWriter.writeStringField("stackStatus", this.stackStatus == null ? null : this.stackStatus.toString()); + jsonWriter.writeStringField("stackStatusReason", this.stackStatusReason); + jsonWriter.writeArrayField("tags", this.tags, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeUntypedField("templateBody", this.templateBody); + jsonWriter.writeStringField("templateURL", this.templateUrl); + jsonWriter.writeNumberField("timeoutInMinutes", this.timeoutInMinutes); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AwsCloudFormationStackProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AwsCloudFormationStackProperties if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the AwsCloudFormationStackProperties. + */ + public static AwsCloudFormationStackProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AwsCloudFormationStackProperties deserializedAwsCloudFormationStackProperties + = new AwsCloudFormationStackProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("capabilities".equals(fieldName)) { + List capabilities + = reader.readArray(reader1 -> Capabilities.fromString(reader1.getString())); + deserializedAwsCloudFormationStackProperties.capabilities = capabilities; + } else if ("changeSetId".equals(fieldName)) { + deserializedAwsCloudFormationStackProperties.changeSetId = reader.getString(); + } else if ("creationTime".equals(fieldName)) { + deserializedAwsCloudFormationStackProperties.creationTime = reader.getString(); + } else if ("description".equals(fieldName)) { + deserializedAwsCloudFormationStackProperties.description = reader.getString(); + } else if ("disableRollback".equals(fieldName)) { + deserializedAwsCloudFormationStackProperties.disableRollback + = reader.getNullable(JsonReader::getBoolean); + } else if ("enableTerminationProtection".equals(fieldName)) { + deserializedAwsCloudFormationStackProperties.enableTerminationProtection + = reader.getNullable(JsonReader::getBoolean); + } else if ("lastUpdateTime".equals(fieldName)) { + deserializedAwsCloudFormationStackProperties.lastUpdateTime = reader.getString(); + } else if ("notificationARNs".equals(fieldName)) { + List notificationARNs = reader.readArray(reader1 -> reader1.getString()); + deserializedAwsCloudFormationStackProperties.notificationARNs = notificationARNs; + } else if ("outputs".equals(fieldName)) { + List outputs = reader.readArray(reader1 -> Output.fromJson(reader1)); + deserializedAwsCloudFormationStackProperties.outputs = outputs; + } else if ("parameters".equals(fieldName)) { + Map parameters = reader.readMap(reader1 -> reader1.getString()); + deserializedAwsCloudFormationStackProperties.parameters = parameters; + } else if ("parentId".equals(fieldName)) { + deserializedAwsCloudFormationStackProperties.parentId = reader.getString(); + } else if ("roleARN".equals(fieldName)) { + deserializedAwsCloudFormationStackProperties.roleArn = reader.getString(); + } else if ("rootId".equals(fieldName)) { + deserializedAwsCloudFormationStackProperties.rootId = reader.getString(); + } else if ("stackId".equals(fieldName)) { + deserializedAwsCloudFormationStackProperties.stackId = reader.getString(); + } else if ("stackName".equals(fieldName)) { + deserializedAwsCloudFormationStackProperties.stackName = reader.getString(); + } else if ("stackPolicyBody".equals(fieldName)) { + deserializedAwsCloudFormationStackProperties.stackPolicyBody = reader.readUntyped(); + } else if ("stackPolicyURL".equals(fieldName)) { + deserializedAwsCloudFormationStackProperties.stackPolicyUrl = reader.getString(); + } else if ("stackStatus".equals(fieldName)) { + deserializedAwsCloudFormationStackProperties.stackStatus + = StackStatus.fromString(reader.getString()); + } else if ("stackStatusReason".equals(fieldName)) { + deserializedAwsCloudFormationStackProperties.stackStatusReason = reader.getString(); + } else if ("tags".equals(fieldName)) { + List tags = reader.readArray(reader1 -> TagAutoGenerated3.fromJson(reader1)); + deserializedAwsCloudFormationStackProperties.tags = tags; + } else if ("templateBody".equals(fieldName)) { + deserializedAwsCloudFormationStackProperties.templateBody = reader.readUntyped(); + } else if ("templateURL".equals(fieldName)) { + deserializedAwsCloudFormationStackProperties.templateUrl = reader.getString(); + } else if ("timeoutInMinutes".equals(fieldName)) { + deserializedAwsCloudFormationStackProperties.timeoutInMinutes + = reader.getNullable(JsonReader::getInt); + } else { + reader.skipChildren(); + } + } + + return deserializedAwsCloudFormationStackProperties; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/AwsCloudFormationStackSetProperties.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/AwsCloudFormationStackSetProperties.java new file mode 100644 index 000000000000..df1d32e005b5 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/AwsCloudFormationStackSetProperties.java @@ -0,0 +1,597 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Definition of awsCloudFormationStackSet. + */ +@Fluent +public final class AwsCloudFormationStackSetProperties + implements JsonSerializable { + /* + * The Amazon Resource Number (ARN) of the IAM role to use to create this stack set. Specify an IAM role only if you + * are using customized administrator roles to control which users or groups can manage specific stack sets within + * the same administrator account. + */ + private String administrationRoleArn; + + /* + * Describes whether StackSets automatically deploys to AWS Organizations accounts that are added to the target + * organization or organizational unit (OU). Specify only if PermissionModel is SERVICE_MANAGED. + */ + private AutoDeployment autoDeployment; + + /* + * Specifies the AWS account that you are acting from. By default, SELF is specified. For self-managed permissions, + * specify SELF; for service-managed permissions, if you are signed in to the organization's management account, + * specify SELF. If you are signed in to a delegated administrator account, specify DELEGATED_ADMIN. + */ + private CallAs callAs; + + /* + * In some cases, you must explicitly acknowledge that your stack set template contains certain capabilities in + * order for AWS CloudFormation to create the stack set and related stack instances. + */ + private List capabilities; + + /* + * A description of the stack set. You can use the description to identify the stack set's purpose or other + * important information. + */ + private String description; + + /* + * The name of the IAM execution role to use to create the stack set. If you do not specify an execution role, AWS + * CloudFormation uses the AWSCloudFormationStackSetExecutionRole role for the stack set operation. + */ + private String executionRoleName; + + /* + * Describes whether StackSets performs non-conflicting operations concurrently and queues conflicting operations. + */ + private ActiveModel managedExecution; + + /* + * The user-specified preferences for how AWS CloudFormation performs a stack set operation. + */ + private OperationPreferences operationPreferences; + + /* + * The input parameters for the stack set template. + */ + private List parameters; + + /* + * Describes how the IAM roles required for stack set operations are created. By default, SELF-MANAGED is specified. + */ + private PermissionModel permissionModel; + + /* + * A group of stack instances with parameters in some specific accounts and regions. + */ + private List stackInstancesGroup; + + /* + * The ID of the stack set that you're creating. + */ + private String stackSetId; + + /* + * The name to associate with the stack set. The name must be unique in the Region where you create your stack set. + */ + private String stackSetName; + + /* + * The key-value pairs to associate with this stack set and the stacks created from it. AWS CloudFormation also + * propagates these tags to supported resources that are created in the stacks. A maximum number of 50 tags can be + * specified. + */ + private List tags; + + /* + * The structure that contains the template body, with a minimum length of 1 byte and a maximum length of 51,200 + * bytes. + */ + private String templateBody; + + /* + * Location of file containing the template body. The URL must point to a template (max size: 460,800 bytes) that is + * located in an Amazon S3 bucket. + */ + private String templateUrl; + + /** + * Creates an instance of AwsCloudFormationStackSetProperties class. + */ + public AwsCloudFormationStackSetProperties() { + } + + /** + * Get the administrationRoleArn property: The Amazon Resource Number (ARN) of the IAM role to use to create this + * stack set. Specify an IAM role only if you are using customized administrator roles to control which users or + * groups can manage specific stack sets within the same administrator account. + * + * @return the administrationRoleArn value. + */ + public String administrationRoleArn() { + return this.administrationRoleArn; + } + + /** + * Set the administrationRoleArn property: The Amazon Resource Number (ARN) of the IAM role to use to create this + * stack set. Specify an IAM role only if you are using customized administrator roles to control which users or + * groups can manage specific stack sets within the same administrator account. + * + * @param administrationRoleArn the administrationRoleArn value to set. + * @return the AwsCloudFormationStackSetProperties object itself. + */ + public AwsCloudFormationStackSetProperties withAdministrationRoleArn(String administrationRoleArn) { + this.administrationRoleArn = administrationRoleArn; + return this; + } + + /** + * Get the autoDeployment property: Describes whether StackSets automatically deploys to AWS Organizations accounts + * that are added to the target organization or organizational unit (OU). Specify only if PermissionModel is + * SERVICE_MANAGED. + * + * @return the autoDeployment value. + */ + public AutoDeployment autoDeployment() { + return this.autoDeployment; + } + + /** + * Set the autoDeployment property: Describes whether StackSets automatically deploys to AWS Organizations accounts + * that are added to the target organization or organizational unit (OU). Specify only if PermissionModel is + * SERVICE_MANAGED. + * + * @param autoDeployment the autoDeployment value to set. + * @return the AwsCloudFormationStackSetProperties object itself. + */ + public AwsCloudFormationStackSetProperties withAutoDeployment(AutoDeployment autoDeployment) { + this.autoDeployment = autoDeployment; + return this; + } + + /** + * Get the callAs property: Specifies the AWS account that you are acting from. By default, SELF is specified. For + * self-managed permissions, specify SELF; for service-managed permissions, if you are signed in to the + * organization's management account, specify SELF. If you are signed in to a delegated administrator account, + * specify DELEGATED_ADMIN. + * + * @return the callAs value. + */ + public CallAs callAs() { + return this.callAs; + } + + /** + * Set the callAs property: Specifies the AWS account that you are acting from. By default, SELF is specified. For + * self-managed permissions, specify SELF; for service-managed permissions, if you are signed in to the + * organization's management account, specify SELF. If you are signed in to a delegated administrator account, + * specify DELEGATED_ADMIN. + * + * @param callAs the callAs value to set. + * @return the AwsCloudFormationStackSetProperties object itself. + */ + public AwsCloudFormationStackSetProperties withCallAs(CallAs callAs) { + this.callAs = callAs; + return this; + } + + /** + * Get the capabilities property: In some cases, you must explicitly acknowledge that your stack set template + * contains certain capabilities in order for AWS CloudFormation to create the stack set and related stack + * instances. + * + * @return the capabilities value. + */ + public List capabilities() { + return this.capabilities; + } + + /** + * Set the capabilities property: In some cases, you must explicitly acknowledge that your stack set template + * contains certain capabilities in order for AWS CloudFormation to create the stack set and related stack + * instances. + * + * @param capabilities the capabilities value to set. + * @return the AwsCloudFormationStackSetProperties object itself. + */ + public AwsCloudFormationStackSetProperties withCapabilities(List capabilities) { + this.capabilities = capabilities; + return this; + } + + /** + * Get the description property: A description of the stack set. You can use the description to identify the stack + * set's purpose or other important information. + * + * @return the description value. + */ + public String description() { + return this.description; + } + + /** + * Set the description property: A description of the stack set. You can use the description to identify the stack + * set's purpose or other important information. + * + * @param description the description value to set. + * @return the AwsCloudFormationStackSetProperties object itself. + */ + public AwsCloudFormationStackSetProperties withDescription(String description) { + this.description = description; + return this; + } + + /** + * Get the executionRoleName property: The name of the IAM execution role to use to create the stack set. If you do + * not specify an execution role, AWS CloudFormation uses the AWSCloudFormationStackSetExecutionRole role for the + * stack set operation. + * + * @return the executionRoleName value. + */ + public String executionRoleName() { + return this.executionRoleName; + } + + /** + * Set the executionRoleName property: The name of the IAM execution role to use to create the stack set. If you do + * not specify an execution role, AWS CloudFormation uses the AWSCloudFormationStackSetExecutionRole role for the + * stack set operation. + * + * @param executionRoleName the executionRoleName value to set. + * @return the AwsCloudFormationStackSetProperties object itself. + */ + public AwsCloudFormationStackSetProperties withExecutionRoleName(String executionRoleName) { + this.executionRoleName = executionRoleName; + return this; + } + + /** + * Get the managedExecution property: Describes whether StackSets performs non-conflicting operations concurrently + * and queues conflicting operations. + * + * @return the managedExecution value. + */ + public ActiveModel managedExecution() { + return this.managedExecution; + } + + /** + * Set the managedExecution property: Describes whether StackSets performs non-conflicting operations concurrently + * and queues conflicting operations. + * + * @param managedExecution the managedExecution value to set. + * @return the AwsCloudFormationStackSetProperties object itself. + */ + public AwsCloudFormationStackSetProperties withManagedExecution(ActiveModel managedExecution) { + this.managedExecution = managedExecution; + return this; + } + + /** + * Get the operationPreferences property: The user-specified preferences for how AWS CloudFormation performs a stack + * set operation. + * + * @return the operationPreferences value. + */ + public OperationPreferences operationPreferences() { + return this.operationPreferences; + } + + /** + * Set the operationPreferences property: The user-specified preferences for how AWS CloudFormation performs a stack + * set operation. + * + * @param operationPreferences the operationPreferences value to set. + * @return the AwsCloudFormationStackSetProperties object itself. + */ + public AwsCloudFormationStackSetProperties withOperationPreferences(OperationPreferences operationPreferences) { + this.operationPreferences = operationPreferences; + return this; + } + + /** + * Get the parameters property: The input parameters for the stack set template. + * + * @return the parameters value. + */ + public List parameters() { + return this.parameters; + } + + /** + * Set the parameters property: The input parameters for the stack set template. + * + * @param parameters the parameters value to set. + * @return the AwsCloudFormationStackSetProperties object itself. + */ + public AwsCloudFormationStackSetProperties withParameters(List parameters) { + this.parameters = parameters; + return this; + } + + /** + * Get the permissionModel property: Describes how the IAM roles required for stack set operations are created. By + * default, SELF-MANAGED is specified. + * + * @return the permissionModel value. + */ + public PermissionModel permissionModel() { + return this.permissionModel; + } + + /** + * Set the permissionModel property: Describes how the IAM roles required for stack set operations are created. By + * default, SELF-MANAGED is specified. + * + * @param permissionModel the permissionModel value to set. + * @return the AwsCloudFormationStackSetProperties object itself. + */ + public AwsCloudFormationStackSetProperties withPermissionModel(PermissionModel permissionModel) { + this.permissionModel = permissionModel; + return this; + } + + /** + * Get the stackInstancesGroup property: A group of stack instances with parameters in some specific accounts and + * regions. + * + * @return the stackInstancesGroup value. + */ + public List stackInstancesGroup() { + return this.stackInstancesGroup; + } + + /** + * Set the stackInstancesGroup property: A group of stack instances with parameters in some specific accounts and + * regions. + * + * @param stackInstancesGroup the stackInstancesGroup value to set. + * @return the AwsCloudFormationStackSetProperties object itself. + */ + public AwsCloudFormationStackSetProperties withStackInstancesGroup(List stackInstancesGroup) { + this.stackInstancesGroup = stackInstancesGroup; + return this; + } + + /** + * Get the stackSetId property: The ID of the stack set that you're creating. + * + * @return the stackSetId value. + */ + public String stackSetId() { + return this.stackSetId; + } + + /** + * Set the stackSetId property: The ID of the stack set that you're creating. + * + * @param stackSetId the stackSetId value to set. + * @return the AwsCloudFormationStackSetProperties object itself. + */ + public AwsCloudFormationStackSetProperties withStackSetId(String stackSetId) { + this.stackSetId = stackSetId; + return this; + } + + /** + * Get the stackSetName property: The name to associate with the stack set. The name must be unique in the Region + * where you create your stack set. + * + * @return the stackSetName value. + */ + public String stackSetName() { + return this.stackSetName; + } + + /** + * Set the stackSetName property: The name to associate with the stack set. The name must be unique in the Region + * where you create your stack set. + * + * @param stackSetName the stackSetName value to set. + * @return the AwsCloudFormationStackSetProperties object itself. + */ + public AwsCloudFormationStackSetProperties withStackSetName(String stackSetName) { + this.stackSetName = stackSetName; + return this; + } + + /** + * Get the tags property: The key-value pairs to associate with this stack set and the stacks created from it. AWS + * CloudFormation also propagates these tags to supported resources that are created in the stacks. A maximum number + * of 50 tags can be specified. + * + * @return the tags value. + */ + public List tags() { + return this.tags; + } + + /** + * Set the tags property: The key-value pairs to associate with this stack set and the stacks created from it. AWS + * CloudFormation also propagates these tags to supported resources that are created in the stacks. A maximum number + * of 50 tags can be specified. + * + * @param tags the tags value to set. + * @return the AwsCloudFormationStackSetProperties object itself. + */ + public AwsCloudFormationStackSetProperties withTags(List tags) { + this.tags = tags; + return this; + } + + /** + * Get the templateBody property: The structure that contains the template body, with a minimum length of 1 byte and + * a maximum length of 51,200 bytes. + * + * @return the templateBody value. + */ + public String templateBody() { + return this.templateBody; + } + + /** + * Set the templateBody property: The structure that contains the template body, with a minimum length of 1 byte and + * a maximum length of 51,200 bytes. + * + * @param templateBody the templateBody value to set. + * @return the AwsCloudFormationStackSetProperties object itself. + */ + public AwsCloudFormationStackSetProperties withTemplateBody(String templateBody) { + this.templateBody = templateBody; + return this; + } + + /** + * Get the templateUrl property: Location of file containing the template body. The URL must point to a template + * (max size: 460,800 bytes) that is located in an Amazon S3 bucket. + * + * @return the templateUrl value. + */ + public String templateUrl() { + return this.templateUrl; + } + + /** + * Set the templateUrl property: Location of file containing the template body. The URL must point to a template + * (max size: 460,800 bytes) that is located in an Amazon S3 bucket. + * + * @param templateUrl the templateUrl value to set. + * @return the AwsCloudFormationStackSetProperties object itself. + */ + public AwsCloudFormationStackSetProperties withTemplateUrl(String templateUrl) { + this.templateUrl = templateUrl; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (autoDeployment() != null) { + autoDeployment().validate(); + } + if (managedExecution() != null) { + managedExecution().validate(); + } + if (operationPreferences() != null) { + operationPreferences().validate(); + } + if (parameters() != null) { + parameters().forEach(e -> e.validate()); + } + if (stackInstancesGroup() != null) { + stackInstancesGroup().forEach(e -> e.validate()); + } + if (tags() != null) { + tags().forEach(e -> e.validate()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("administrationRoleARN", this.administrationRoleArn); + jsonWriter.writeJsonField("autoDeployment", this.autoDeployment); + jsonWriter.writeStringField("callAs", this.callAs == null ? null : this.callAs.toString()); + jsonWriter.writeArrayField("capabilities", this.capabilities, (writer, element) -> writer.writeString(element)); + jsonWriter.writeStringField("description", this.description); + jsonWriter.writeStringField("executionRoleName", this.executionRoleName); + jsonWriter.writeJsonField("managedExecution", this.managedExecution); + jsonWriter.writeJsonField("operationPreferences", this.operationPreferences); + jsonWriter.writeArrayField("parameters", this.parameters, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("permissionModel", + this.permissionModel == null ? null : this.permissionModel.toString()); + jsonWriter.writeArrayField("stackInstancesGroup", this.stackInstancesGroup, + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("stackSetId", this.stackSetId); + jsonWriter.writeStringField("stackSetName", this.stackSetName); + jsonWriter.writeArrayField("tags", this.tags, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("templateBody", this.templateBody); + jsonWriter.writeStringField("templateURL", this.templateUrl); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AwsCloudFormationStackSetProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AwsCloudFormationStackSetProperties if the JsonReader was pointing to an instance of it, + * or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the AwsCloudFormationStackSetProperties. + */ + public static AwsCloudFormationStackSetProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AwsCloudFormationStackSetProperties deserializedAwsCloudFormationStackSetProperties + = new AwsCloudFormationStackSetProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("administrationRoleARN".equals(fieldName)) { + deserializedAwsCloudFormationStackSetProperties.administrationRoleArn = reader.getString(); + } else if ("autoDeployment".equals(fieldName)) { + deserializedAwsCloudFormationStackSetProperties.autoDeployment = AutoDeployment.fromJson(reader); + } else if ("callAs".equals(fieldName)) { + deserializedAwsCloudFormationStackSetProperties.callAs = CallAs.fromString(reader.getString()); + } else if ("capabilities".equals(fieldName)) { + List capabilities = reader.readArray(reader1 -> reader1.getString()); + deserializedAwsCloudFormationStackSetProperties.capabilities = capabilities; + } else if ("description".equals(fieldName)) { + deserializedAwsCloudFormationStackSetProperties.description = reader.getString(); + } else if ("executionRoleName".equals(fieldName)) { + deserializedAwsCloudFormationStackSetProperties.executionRoleName = reader.getString(); + } else if ("managedExecution".equals(fieldName)) { + deserializedAwsCloudFormationStackSetProperties.managedExecution = ActiveModel.fromJson(reader); + } else if ("operationPreferences".equals(fieldName)) { + deserializedAwsCloudFormationStackSetProperties.operationPreferences + = OperationPreferences.fromJson(reader); + } else if ("parameters".equals(fieldName)) { + List parameters = reader.readArray(reader1 -> Parameter.fromJson(reader1)); + deserializedAwsCloudFormationStackSetProperties.parameters = parameters; + } else if ("permissionModel".equals(fieldName)) { + deserializedAwsCloudFormationStackSetProperties.permissionModel + = PermissionModel.fromString(reader.getString()); + } else if ("stackInstancesGroup".equals(fieldName)) { + List stackInstancesGroup + = reader.readArray(reader1 -> StackInstances.fromJson(reader1)); + deserializedAwsCloudFormationStackSetProperties.stackInstancesGroup = stackInstancesGroup; + } else if ("stackSetId".equals(fieldName)) { + deserializedAwsCloudFormationStackSetProperties.stackSetId = reader.getString(); + } else if ("stackSetName".equals(fieldName)) { + deserializedAwsCloudFormationStackSetProperties.stackSetName = reader.getString(); + } else if ("tags".equals(fieldName)) { + List tags = reader.readArray(reader1 -> TagAutoGenerated4.fromJson(reader1)); + deserializedAwsCloudFormationStackSetProperties.tags = tags; + } else if ("templateBody".equals(fieldName)) { + deserializedAwsCloudFormationStackSetProperties.templateBody = reader.getString(); + } else if ("templateURL".equals(fieldName)) { + deserializedAwsCloudFormationStackSetProperties.templateUrl = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedAwsCloudFormationStackSetProperties; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/AwsCloudFrontDistributionProperties.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/AwsCloudFrontDistributionProperties.java new file mode 100644 index 000000000000..77ae300f84a0 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/AwsCloudFrontDistributionProperties.java @@ -0,0 +1,188 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Definition of awsCloudFrontDistribution. + */ +@Fluent +public final class AwsCloudFrontDistributionProperties + implements JsonSerializable { + /* + * The distribution's configuration. A distribution configuration. + */ + private DistributionConfig distributionConfig; + + /* + * Property domainName + */ + private String domainName; + + /* + * Property id + */ + private String id; + + /* + * A complex type that contains zero or more ``Tag`` elements. + */ + private List tags; + + /** + * Creates an instance of AwsCloudFrontDistributionProperties class. + */ + public AwsCloudFrontDistributionProperties() { + } + + /** + * Get the distributionConfig property: The distribution's configuration. A distribution configuration. + * + * @return the distributionConfig value. + */ + public DistributionConfig distributionConfig() { + return this.distributionConfig; + } + + /** + * Set the distributionConfig property: The distribution's configuration. A distribution configuration. + * + * @param distributionConfig the distributionConfig value to set. + * @return the AwsCloudFrontDistributionProperties object itself. + */ + public AwsCloudFrontDistributionProperties withDistributionConfig(DistributionConfig distributionConfig) { + this.distributionConfig = distributionConfig; + return this; + } + + /** + * Get the domainName property: Property domainName. + * + * @return the domainName value. + */ + public String domainName() { + return this.domainName; + } + + /** + * Set the domainName property: Property domainName. + * + * @param domainName the domainName value to set. + * @return the AwsCloudFrontDistributionProperties object itself. + */ + public AwsCloudFrontDistributionProperties withDomainName(String domainName) { + this.domainName = domainName; + return this; + } + + /** + * Get the id property: Property id. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Set the id property: Property id. + * + * @param id the id value to set. + * @return the AwsCloudFrontDistributionProperties object itself. + */ + public AwsCloudFrontDistributionProperties withId(String id) { + this.id = id; + return this; + } + + /** + * Get the tags property: A complex type that contains zero or more ``Tag`` elements. + * + * @return the tags value. + */ + public List tags() { + return this.tags; + } + + /** + * Set the tags property: A complex type that contains zero or more ``Tag`` elements. + * + * @param tags the tags value to set. + * @return the AwsCloudFrontDistributionProperties object itself. + */ + public AwsCloudFrontDistributionProperties withTags(List tags) { + this.tags = tags; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (distributionConfig() != null) { + distributionConfig().validate(); + } + if (tags() != null) { + tags().forEach(e -> e.validate()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("distributionConfig", this.distributionConfig); + jsonWriter.writeStringField("domainName", this.domainName); + jsonWriter.writeStringField("id", this.id); + jsonWriter.writeArrayField("tags", this.tags, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AwsCloudFrontDistributionProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AwsCloudFrontDistributionProperties if the JsonReader was pointing to an instance of it, + * or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the AwsCloudFrontDistributionProperties. + */ + public static AwsCloudFrontDistributionProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AwsCloudFrontDistributionProperties deserializedAwsCloudFrontDistributionProperties + = new AwsCloudFrontDistributionProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("distributionConfig".equals(fieldName)) { + deserializedAwsCloudFrontDistributionProperties.distributionConfig + = DistributionConfig.fromJson(reader); + } else if ("domainName".equals(fieldName)) { + deserializedAwsCloudFrontDistributionProperties.domainName = reader.getString(); + } else if ("id".equals(fieldName)) { + deserializedAwsCloudFrontDistributionProperties.id = reader.getString(); + } else if ("tags".equals(fieldName)) { + List tags = reader.readArray(reader1 -> TagAutoGenerated5.fromJson(reader1)); + deserializedAwsCloudFrontDistributionProperties.tags = tags; + } else { + reader.skipChildren(); + } + } + + return deserializedAwsCloudFrontDistributionProperties; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/AwsCloudTrailProperties.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/AwsCloudTrailProperties.java new file mode 100644 index 000000000000..84fc9955b719 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/AwsCloudTrailProperties.java @@ -0,0 +1,660 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Definition of awsCloudTrailTrail. + */ +@Fluent +public final class AwsCloudTrailProperties implements JsonSerializable { + /* + * The advanced event selectors that were used to select events for the data store. + */ + private List advancedEventSelectors; + + /* + * Property arn + */ + private String arn; + + /* + * Specifies a log group name using an Amazon Resource Name (ARN), a unique identifier that represents the log group + * to which CloudTrail logs will be delivered. Not required unless you specify CloudWatchLogsRoleArn. + */ + private String cloudWatchLogsLogGroupArn; + + /* + * Specifies the role for the CloudWatch Logs endpoint to assume to write to a user's log group. + */ + private String cloudWatchLogsRoleArn; + + /* + * Specifies whether log file validation is enabled. The default is false. + */ + private Boolean enableLogFileValidation; + + /* + * Use event selectors to further specify the management and data event settings for your trail. By default, trails + * created without specific event selectors will be configured to log all read and write management events, and no + * data events. When an event occurs in your account, CloudTrail evaluates the event selector for all trails. For + * each trail, if the event matches any event selector, the trail processes and logs the event. If the event doesn't + * match any event selector, the trail doesn't log the event. You can configure up to five event selectors for a + * trail. + */ + private List eventSelectors; + + /* + * Specifies whether the trail is publishing events from global services such as IAM to the log files. + */ + private Boolean includeGlobalServiceEvents; + + /* + * Lets you enable Insights event logging by specifying the Insights selectors that you want to enable on an + * existing trail. + */ + private List insightSelectors; + + /* + * Whether the CloudTrail is currently logging AWS API calls. + */ + private Boolean isLogging; + + /* + * Specifies whether the trail applies only to the current region or to all regions. The default is false. If the + * trail exists only in the current region and this value is set to true, shadow trails (replications of the trail) + * will be created in the other regions. If the trail exists in all regions and this value is set to false, the + * trail will remain in the region where it was created, and its shadow trails in other regions will be deleted. As + * a best practice, consider using trails that log events in all regions. + */ + private Boolean isMultiRegionTrail; + + /* + * Specifies whether the trail is created for all accounts in an organization in AWS Organizations, or only for the + * current AWS account. The default is false, and cannot be true unless the call is made on behalf of an AWS account + * that is the master account for an organization in AWS Organizations. + */ + private Boolean isOrganizationTrail; + + /* + * Specifies the KMS key ID to use to encrypt the logs delivered by CloudTrail. The value can be an alias name + * prefixed by 'alias/', a fully specified ARN to an alias, a fully specified ARN to a key, or a globally unique + * identifier. + */ + private String kmsKeyId; + + /* + * Specifies the name of the Amazon S3 bucket designated for publishing log files. See Amazon S3 Bucket Naming + * Requirements. + */ + private String s3BucketName; + + /* + * Specifies the Amazon S3 key prefix that comes after the name of the bucket you have designated for log file + * delivery. For more information, see Finding Your CloudTrail Log Files. The maximum length is 200 characters. + */ + private String s3KeyPrefix; + + /* + * Property snsTopicArn + */ + private String snsTopicArn; + + /* + * Specifies the name of the Amazon SNS topic defined for notification of log file delivery. The maximum length is + * 256 characters. + */ + private String snsTopicName; + + /* + * Property tags + */ + private List tags; + + /* + * Property trailName + */ + private String trailName; + + /** + * Creates an instance of AwsCloudTrailProperties class. + */ + public AwsCloudTrailProperties() { + } + + /** + * Get the advancedEventSelectors property: The advanced event selectors that were used to select events for the + * data store. + * + * @return the advancedEventSelectors value. + */ + public List advancedEventSelectors() { + return this.advancedEventSelectors; + } + + /** + * Set the advancedEventSelectors property: The advanced event selectors that were used to select events for the + * data store. + * + * @param advancedEventSelectors the advancedEventSelectors value to set. + * @return the AwsCloudTrailProperties object itself. + */ + public AwsCloudTrailProperties withAdvancedEventSelectors(List advancedEventSelectors) { + this.advancedEventSelectors = advancedEventSelectors; + return this; + } + + /** + * Get the arn property: Property arn. + * + * @return the arn value. + */ + public String arn() { + return this.arn; + } + + /** + * Set the arn property: Property arn. + * + * @param arn the arn value to set. + * @return the AwsCloudTrailProperties object itself. + */ + public AwsCloudTrailProperties withArn(String arn) { + this.arn = arn; + return this; + } + + /** + * Get the cloudWatchLogsLogGroupArn property: Specifies a log group name using an Amazon Resource Name (ARN), a + * unique identifier that represents the log group to which CloudTrail logs will be delivered. Not required unless + * you specify CloudWatchLogsRoleArn. + * + * @return the cloudWatchLogsLogGroupArn value. + */ + public String cloudWatchLogsLogGroupArn() { + return this.cloudWatchLogsLogGroupArn; + } + + /** + * Set the cloudWatchLogsLogGroupArn property: Specifies a log group name using an Amazon Resource Name (ARN), a + * unique identifier that represents the log group to which CloudTrail logs will be delivered. Not required unless + * you specify CloudWatchLogsRoleArn. + * + * @param cloudWatchLogsLogGroupArn the cloudWatchLogsLogGroupArn value to set. + * @return the AwsCloudTrailProperties object itself. + */ + public AwsCloudTrailProperties withCloudWatchLogsLogGroupArn(String cloudWatchLogsLogGroupArn) { + this.cloudWatchLogsLogGroupArn = cloudWatchLogsLogGroupArn; + return this; + } + + /** + * Get the cloudWatchLogsRoleArn property: Specifies the role for the CloudWatch Logs endpoint to assume to write to + * a user's log group. + * + * @return the cloudWatchLogsRoleArn value. + */ + public String cloudWatchLogsRoleArn() { + return this.cloudWatchLogsRoleArn; + } + + /** + * Set the cloudWatchLogsRoleArn property: Specifies the role for the CloudWatch Logs endpoint to assume to write to + * a user's log group. + * + * @param cloudWatchLogsRoleArn the cloudWatchLogsRoleArn value to set. + * @return the AwsCloudTrailProperties object itself. + */ + public AwsCloudTrailProperties withCloudWatchLogsRoleArn(String cloudWatchLogsRoleArn) { + this.cloudWatchLogsRoleArn = cloudWatchLogsRoleArn; + return this; + } + + /** + * Get the enableLogFileValidation property: Specifies whether log file validation is enabled. The default is false. + * + * @return the enableLogFileValidation value. + */ + public Boolean enableLogFileValidation() { + return this.enableLogFileValidation; + } + + /** + * Set the enableLogFileValidation property: Specifies whether log file validation is enabled. The default is false. + * + * @param enableLogFileValidation the enableLogFileValidation value to set. + * @return the AwsCloudTrailProperties object itself. + */ + public AwsCloudTrailProperties withEnableLogFileValidation(Boolean enableLogFileValidation) { + this.enableLogFileValidation = enableLogFileValidation; + return this; + } + + /** + * Get the eventSelectors property: Use event selectors to further specify the management and data event settings + * for your trail. By default, trails created without specific event selectors will be configured to log all read + * and write management events, and no data events. When an event occurs in your account, CloudTrail evaluates the + * event selector for all trails. For each trail, if the event matches any event selector, the trail processes and + * logs the event. If the event doesn't match any event selector, the trail doesn't log the event. You can configure + * up to five event selectors for a trail. + * + * @return the eventSelectors value. + */ + public List eventSelectors() { + return this.eventSelectors; + } + + /** + * Set the eventSelectors property: Use event selectors to further specify the management and data event settings + * for your trail. By default, trails created without specific event selectors will be configured to log all read + * and write management events, and no data events. When an event occurs in your account, CloudTrail evaluates the + * event selector for all trails. For each trail, if the event matches any event selector, the trail processes and + * logs the event. If the event doesn't match any event selector, the trail doesn't log the event. You can configure + * up to five event selectors for a trail. + * + * @param eventSelectors the eventSelectors value to set. + * @return the AwsCloudTrailProperties object itself. + */ + public AwsCloudTrailProperties withEventSelectors(List eventSelectors) { + this.eventSelectors = eventSelectors; + return this; + } + + /** + * Get the includeGlobalServiceEvents property: Specifies whether the trail is publishing events from global + * services such as IAM to the log files. + * + * @return the includeGlobalServiceEvents value. + */ + public Boolean includeGlobalServiceEvents() { + return this.includeGlobalServiceEvents; + } + + /** + * Set the includeGlobalServiceEvents property: Specifies whether the trail is publishing events from global + * services such as IAM to the log files. + * + * @param includeGlobalServiceEvents the includeGlobalServiceEvents value to set. + * @return the AwsCloudTrailProperties object itself. + */ + public AwsCloudTrailProperties withIncludeGlobalServiceEvents(Boolean includeGlobalServiceEvents) { + this.includeGlobalServiceEvents = includeGlobalServiceEvents; + return this; + } + + /** + * Get the insightSelectors property: Lets you enable Insights event logging by specifying the Insights selectors + * that you want to enable on an existing trail. + * + * @return the insightSelectors value. + */ + public List insightSelectors() { + return this.insightSelectors; + } + + /** + * Set the insightSelectors property: Lets you enable Insights event logging by specifying the Insights selectors + * that you want to enable on an existing trail. + * + * @param insightSelectors the insightSelectors value to set. + * @return the AwsCloudTrailProperties object itself. + */ + public AwsCloudTrailProperties withInsightSelectors(List insightSelectors) { + this.insightSelectors = insightSelectors; + return this; + } + + /** + * Get the isLogging property: Whether the CloudTrail is currently logging AWS API calls. + * + * @return the isLogging value. + */ + public Boolean isLogging() { + return this.isLogging; + } + + /** + * Set the isLogging property: Whether the CloudTrail is currently logging AWS API calls. + * + * @param isLogging the isLogging value to set. + * @return the AwsCloudTrailProperties object itself. + */ + public AwsCloudTrailProperties withIsLogging(Boolean isLogging) { + this.isLogging = isLogging; + return this; + } + + /** + * Get the isMultiRegionTrail property: Specifies whether the trail applies only to the current region or to all + * regions. The default is false. If the trail exists only in the current region and this value is set to true, + * shadow trails (replications of the trail) will be created in the other regions. If the trail exists in all + * regions and this value is set to false, the trail will remain in the region where it was created, and its shadow + * trails in other regions will be deleted. As a best practice, consider using trails that log events in all + * regions. + * + * @return the isMultiRegionTrail value. + */ + public Boolean isMultiRegionTrail() { + return this.isMultiRegionTrail; + } + + /** + * Set the isMultiRegionTrail property: Specifies whether the trail applies only to the current region or to all + * regions. The default is false. If the trail exists only in the current region and this value is set to true, + * shadow trails (replications of the trail) will be created in the other regions. If the trail exists in all + * regions and this value is set to false, the trail will remain in the region where it was created, and its shadow + * trails in other regions will be deleted. As a best practice, consider using trails that log events in all + * regions. + * + * @param isMultiRegionTrail the isMultiRegionTrail value to set. + * @return the AwsCloudTrailProperties object itself. + */ + public AwsCloudTrailProperties withIsMultiRegionTrail(Boolean isMultiRegionTrail) { + this.isMultiRegionTrail = isMultiRegionTrail; + return this; + } + + /** + * Get the isOrganizationTrail property: Specifies whether the trail is created for all accounts in an organization + * in AWS Organizations, or only for the current AWS account. The default is false, and cannot be true unless the + * call is made on behalf of an AWS account that is the master account for an organization in AWS Organizations. + * + * @return the isOrganizationTrail value. + */ + public Boolean isOrganizationTrail() { + return this.isOrganizationTrail; + } + + /** + * Set the isOrganizationTrail property: Specifies whether the trail is created for all accounts in an organization + * in AWS Organizations, or only for the current AWS account. The default is false, and cannot be true unless the + * call is made on behalf of an AWS account that is the master account for an organization in AWS Organizations. + * + * @param isOrganizationTrail the isOrganizationTrail value to set. + * @return the AwsCloudTrailProperties object itself. + */ + public AwsCloudTrailProperties withIsOrganizationTrail(Boolean isOrganizationTrail) { + this.isOrganizationTrail = isOrganizationTrail; + return this; + } + + /** + * Get the kmsKeyId property: Specifies the KMS key ID to use to encrypt the logs delivered by CloudTrail. The value + * can be an alias name prefixed by 'alias/', a fully specified ARN to an alias, a fully specified ARN to a key, or + * a globally unique identifier. + * + * @return the kmsKeyId value. + */ + public String kmsKeyId() { + return this.kmsKeyId; + } + + /** + * Set the kmsKeyId property: Specifies the KMS key ID to use to encrypt the logs delivered by CloudTrail. The value + * can be an alias name prefixed by 'alias/', a fully specified ARN to an alias, a fully specified ARN to a key, or + * a globally unique identifier. + * + * @param kmsKeyId the kmsKeyId value to set. + * @return the AwsCloudTrailProperties object itself. + */ + public AwsCloudTrailProperties withKmsKeyId(String kmsKeyId) { + this.kmsKeyId = kmsKeyId; + return this; + } + + /** + * Get the s3BucketName property: Specifies the name of the Amazon S3 bucket designated for publishing log files. + * See Amazon S3 Bucket Naming Requirements. + * + * @return the s3BucketName value. + */ + public String s3BucketName() { + return this.s3BucketName; + } + + /** + * Set the s3BucketName property: Specifies the name of the Amazon S3 bucket designated for publishing log files. + * See Amazon S3 Bucket Naming Requirements. + * + * @param s3BucketName the s3BucketName value to set. + * @return the AwsCloudTrailProperties object itself. + */ + public AwsCloudTrailProperties withS3BucketName(String s3BucketName) { + this.s3BucketName = s3BucketName; + return this; + } + + /** + * Get the s3KeyPrefix property: Specifies the Amazon S3 key prefix that comes after the name of the bucket you have + * designated for log file delivery. For more information, see Finding Your CloudTrail Log Files. The maximum length + * is 200 characters. + * + * @return the s3KeyPrefix value. + */ + public String s3KeyPrefix() { + return this.s3KeyPrefix; + } + + /** + * Set the s3KeyPrefix property: Specifies the Amazon S3 key prefix that comes after the name of the bucket you have + * designated for log file delivery. For more information, see Finding Your CloudTrail Log Files. The maximum length + * is 200 characters. + * + * @param s3KeyPrefix the s3KeyPrefix value to set. + * @return the AwsCloudTrailProperties object itself. + */ + public AwsCloudTrailProperties withS3KeyPrefix(String s3KeyPrefix) { + this.s3KeyPrefix = s3KeyPrefix; + return this; + } + + /** + * Get the snsTopicArn property: Property snsTopicArn. + * + * @return the snsTopicArn value. + */ + public String snsTopicArn() { + return this.snsTopicArn; + } + + /** + * Set the snsTopicArn property: Property snsTopicArn. + * + * @param snsTopicArn the snsTopicArn value to set. + * @return the AwsCloudTrailProperties object itself. + */ + public AwsCloudTrailProperties withSnsTopicArn(String snsTopicArn) { + this.snsTopicArn = snsTopicArn; + return this; + } + + /** + * Get the snsTopicName property: Specifies the name of the Amazon SNS topic defined for notification of log file + * delivery. The maximum length is 256 characters. + * + * @return the snsTopicName value. + */ + public String snsTopicName() { + return this.snsTopicName; + } + + /** + * Set the snsTopicName property: Specifies the name of the Amazon SNS topic defined for notification of log file + * delivery. The maximum length is 256 characters. + * + * @param snsTopicName the snsTopicName value to set. + * @return the AwsCloudTrailProperties object itself. + */ + public AwsCloudTrailProperties withSnsTopicName(String snsTopicName) { + this.snsTopicName = snsTopicName; + return this; + } + + /** + * Get the tags property: Property tags. + * + * @return the tags value. + */ + public List tags() { + return this.tags; + } + + /** + * Set the tags property: Property tags. + * + * @param tags the tags value to set. + * @return the AwsCloudTrailProperties object itself. + */ + public AwsCloudTrailProperties withTags(List tags) { + this.tags = tags; + return this; + } + + /** + * Get the trailName property: Property trailName. + * + * @return the trailName value. + */ + public String trailName() { + return this.trailName; + } + + /** + * Set the trailName property: Property trailName. + * + * @param trailName the trailName value to set. + * @return the AwsCloudTrailProperties object itself. + */ + public AwsCloudTrailProperties withTrailName(String trailName) { + this.trailName = trailName; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (advancedEventSelectors() != null) { + advancedEventSelectors().forEach(e -> e.validate()); + } + if (eventSelectors() != null) { + eventSelectors().forEach(e -> e.validate()); + } + if (insightSelectors() != null) { + insightSelectors().forEach(e -> e.validate()); + } + if (tags() != null) { + tags().forEach(e -> e.validate()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("advancedEventSelectors", this.advancedEventSelectors, + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("arn", this.arn); + jsonWriter.writeStringField("cloudWatchLogsLogGroupArn", this.cloudWatchLogsLogGroupArn); + jsonWriter.writeStringField("cloudWatchLogsRoleArn", this.cloudWatchLogsRoleArn); + jsonWriter.writeBooleanField("enableLogFileValidation", this.enableLogFileValidation); + jsonWriter.writeArrayField("eventSelectors", this.eventSelectors, + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeBooleanField("includeGlobalServiceEvents", this.includeGlobalServiceEvents); + jsonWriter.writeArrayField("insightSelectors", this.insightSelectors, + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeBooleanField("isLogging", this.isLogging); + jsonWriter.writeBooleanField("isMultiRegionTrail", this.isMultiRegionTrail); + jsonWriter.writeBooleanField("isOrganizationTrail", this.isOrganizationTrail); + jsonWriter.writeStringField("kmsKeyId", this.kmsKeyId); + jsonWriter.writeStringField("s3BucketName", this.s3BucketName); + jsonWriter.writeStringField("s3KeyPrefix", this.s3KeyPrefix); + jsonWriter.writeStringField("snsTopicArn", this.snsTopicArn); + jsonWriter.writeStringField("snsTopicName", this.snsTopicName); + jsonWriter.writeArrayField("tags", this.tags, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("trailName", this.trailName); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AwsCloudTrailProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AwsCloudTrailProperties if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the AwsCloudTrailProperties. + */ + public static AwsCloudTrailProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AwsCloudTrailProperties deserializedAwsCloudTrailProperties = new AwsCloudTrailProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("advancedEventSelectors".equals(fieldName)) { + List advancedEventSelectors + = reader.readArray(reader1 -> AdvancedEventSelector.fromJson(reader1)); + deserializedAwsCloudTrailProperties.advancedEventSelectors = advancedEventSelectors; + } else if ("arn".equals(fieldName)) { + deserializedAwsCloudTrailProperties.arn = reader.getString(); + } else if ("cloudWatchLogsLogGroupArn".equals(fieldName)) { + deserializedAwsCloudTrailProperties.cloudWatchLogsLogGroupArn = reader.getString(); + } else if ("cloudWatchLogsRoleArn".equals(fieldName)) { + deserializedAwsCloudTrailProperties.cloudWatchLogsRoleArn = reader.getString(); + } else if ("enableLogFileValidation".equals(fieldName)) { + deserializedAwsCloudTrailProperties.enableLogFileValidation + = reader.getNullable(JsonReader::getBoolean); + } else if ("eventSelectors".equals(fieldName)) { + List eventSelectors = reader.readArray(reader1 -> EventSelector.fromJson(reader1)); + deserializedAwsCloudTrailProperties.eventSelectors = eventSelectors; + } else if ("includeGlobalServiceEvents".equals(fieldName)) { + deserializedAwsCloudTrailProperties.includeGlobalServiceEvents + = reader.getNullable(JsonReader::getBoolean); + } else if ("insightSelectors".equals(fieldName)) { + List insightSelectors + = reader.readArray(reader1 -> InsightSelector.fromJson(reader1)); + deserializedAwsCloudTrailProperties.insightSelectors = insightSelectors; + } else if ("isLogging".equals(fieldName)) { + deserializedAwsCloudTrailProperties.isLogging = reader.getNullable(JsonReader::getBoolean); + } else if ("isMultiRegionTrail".equals(fieldName)) { + deserializedAwsCloudTrailProperties.isMultiRegionTrail = reader.getNullable(JsonReader::getBoolean); + } else if ("isOrganizationTrail".equals(fieldName)) { + deserializedAwsCloudTrailProperties.isOrganizationTrail + = reader.getNullable(JsonReader::getBoolean); + } else if ("kmsKeyId".equals(fieldName)) { + deserializedAwsCloudTrailProperties.kmsKeyId = reader.getString(); + } else if ("s3BucketName".equals(fieldName)) { + deserializedAwsCloudTrailProperties.s3BucketName = reader.getString(); + } else if ("s3KeyPrefix".equals(fieldName)) { + deserializedAwsCloudTrailProperties.s3KeyPrefix = reader.getString(); + } else if ("snsTopicArn".equals(fieldName)) { + deserializedAwsCloudTrailProperties.snsTopicArn = reader.getString(); + } else if ("snsTopicName".equals(fieldName)) { + deserializedAwsCloudTrailProperties.snsTopicName = reader.getString(); + } else if ("tags".equals(fieldName)) { + List tags = reader.readArray(reader1 -> Tag.fromJson(reader1)); + deserializedAwsCloudTrailProperties.tags = tags; + } else if ("trailName".equals(fieldName)) { + deserializedAwsCloudTrailProperties.trailName = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedAwsCloudTrailProperties; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/AwsCloudWatchAlarmProperties.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/AwsCloudWatchAlarmProperties.java new file mode 100644 index 000000000000..9b27f182185f --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/AwsCloudWatchAlarmProperties.java @@ -0,0 +1,874 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Definition of awsCloudWatchAlarm. + */ +@Fluent +public final class AwsCloudWatchAlarmProperties implements JsonSerializable { + /* + * Indicates whether actions should be executed during any changes to the alarm state. The default is TRUE. + */ + private Boolean actionsEnabled; + + /* + * The list of actions to execute when this alarm transitions into an ALARM state from any other state. Specify each + * action as an Amazon Resource Name (ARN). For more information about creating alarms and the actions that you can + * specify, see + * [PutMetricAlarm](https://docs.aws.amazon.com/AmazonCloudWatch/latest/APIReference/API_PutMetricAlarm.html) in the + * *API Reference*. + */ + private List alarmActions; + + /* + * The description of the alarm. + */ + private String alarmDescription; + + /* + * The name of the alarm. If you don't specify a name, CFN generates a unique physical ID and uses that ID for the + * alarm name. If you specify a name, you cannot perform updates that require replacement of this resource. You can + * perform updates that require no or some interruption. If you must replace the resource, specify a new name. + */ + private String alarmName; + + /* + * Property arn + */ + private String arn; + + /* + * The arithmetic operation to use when comparing the specified statistic and threshold. The specified statistic + * value is used as the first operand. + */ + private String comparisonOperator; + + /* + * The number of datapoints that must be breaching to trigger the alarm. This is used only if you are setting an 'M + * out of N' alarm. In that case, this value is the M, and the value that you set for ``EvaluationPeriods`` is the N + * value. For more information, see [Evaluating an + * Alarm](https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/AlarmThatSendsEmail.html#alarm-evaluation) + * in the *User Guide*. If you omit this parameter, CW uses the same value here that you set for + * ``EvaluationPeriods``, and the alarm goes to alarm state if that many consecutive periods are breaching. + */ + private Integer datapointsToAlarm; + + /* + * The dimensions for the metric associated with the alarm. For an alarm based on a math expression, you can't + * specify ``Dimensions``. Instead, you use ``Metrics``. + */ + private List dimensions; + + /* + * Used only for alarms based on percentiles. If ``ignore``, the alarm state does not change during periods with too + * few data points to be statistically significant. If ``evaluate`` or this parameter is not used, the alarm is + * always evaluated and possibly changes state no matter how many data points are available. + */ + private String evaluateLowSampleCountPercentile; + + /* + * The number of periods over which data is compared to the specified threshold. If you are setting an alarm that + * requires that a number of consecutive data points be breaching to trigger the alarm, this value specifies that + * number. If you are setting an 'M out of N' alarm, this value is the N, and ``DatapointsToAlarm`` is the M. For + * more information, see [Evaluating an + * Alarm](https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/AlarmThatSendsEmail.html#alarm-evaluation) + * in the *User Guide*. + */ + private Integer evaluationPeriods; + + /* + * The percentile statistic for the metric associated with the alarm. Specify a value between p0.0 and p100. For an + * alarm based on a metric, you must specify either ``Statistic`` or ``ExtendedStatistic`` but not both. For an + * alarm based on a math expression, you can't specify ``ExtendedStatistic``. Instead, you use ``Metrics``. + */ + private String extendedStatistic; + + /* + * The actions to execute when this alarm transitions to the ``INSUFFICIENT_DATA`` state from any other state. Each + * action is specified as an Amazon Resource Name (ARN). + */ + private List insufficientDataActions; + + /* + * The name of the metric associated with the alarm. This is required for an alarm based on a metric. For an alarm + * based on a math expression, you use ``Metrics`` instead and you can't specify ``MetricName``. + */ + private String metricName; + + /* + * An array that enables you to create an alarm based on the result of a metric math expression. Each item in the + * array either retrieves a metric or performs a math expression. If you specify the ``Metrics`` parameter, you + * cannot specify ``MetricName``, ``Dimensions``, ``Period``, ``Namespace``, ``Statistic``, ``ExtendedStatistic``, + * or ``Unit``. + */ + private List metrics; + + /* + * The namespace of the metric associated with the alarm. This is required for an alarm based on a metric. For an + * alarm based on a math expression, you can't specify ``Namespace`` and you use ``Metrics`` instead. For a list of + * namespaces for metrics from AWS services, see [Services That Publish + * Metrics.](https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/aws-services-cloudwatch-metrics.html) + */ + private String namespace; + + /* + * The actions to execute when this alarm transitions to the ``OK`` state from any other state. Each action is + * specified as an Amazon Resource Name (ARN). + */ + private List okActions; + + /* + * The period, in seconds, over which the statistic is applied. This is required for an alarm based on a metric. + * Valid values are 10, 30, 60, and any multiple of 60. For an alarm based on a math expression, you can't specify + * ``Period``, and instead you use the ``Metrics`` parameter. *Minimum:* 10 + */ + private Integer period; + + /* + * The statistic for the metric associated with the alarm, other than percentile. For percentile statistics, use + * ``ExtendedStatistic``. For an alarm based on a metric, you must specify either ``Statistic`` or + * ``ExtendedStatistic`` but not both. For an alarm based on a math expression, you can't specify ``Statistic``. + * Instead, you use ``Metrics``. + */ + private String statistic; + + /* + * Property tags + */ + private List tags; + + /* + * The value to compare with the specified statistic. + */ + private Float threshold; + + /* + * In an alarm based on an anomaly detection model, this is the ID of the ``ANOMALY_DETECTION_BAND`` function used + * as the threshold for the alarm. + */ + private String thresholdMetricId; + + /* + * Sets how this alarm is to handle missing data points. Valid values are ``breaching``, ``notBreaching``, + * ``ignore``, and ``missing``. For more information, see [Configuring How Alarms Treat Missing + * Data](https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/AlarmThatSendsEmail.html#alarms-and-missing- + * data) in the *Amazon User Guide*. If you omit this parameter, the default behavior of ``missing`` is used. + */ + private String treatMissingData; + + /* + * The unit of the metric associated with the alarm. Specify this only if you are creating an alarm based on a + * single metric. Do not specify this if you are specifying a ``Metrics`` array. You can specify the following + * values: Seconds, Microseconds, Milliseconds, Bytes, Kilobytes, Megabytes, Gigabytes, Terabytes, Bits, Kilobits, + * Megabits, Gigabits, Terabits, Percent, Count, Bytes/Second, Kilobytes/Second, Megabytes/Second, Gigabytes/Second, + * Terabytes/Second, Bits/Second, Kilobits/Second, Megabits/Second, Gigabits/Second, Terabits/Second, Count/Second, + * or None. + */ + private String unit; + + /** + * Creates an instance of AwsCloudWatchAlarmProperties class. + */ + public AwsCloudWatchAlarmProperties() { + } + + /** + * Get the actionsEnabled property: Indicates whether actions should be executed during any changes to the alarm + * state. The default is TRUE. + * + * @return the actionsEnabled value. + */ + public Boolean actionsEnabled() { + return this.actionsEnabled; + } + + /** + * Set the actionsEnabled property: Indicates whether actions should be executed during any changes to the alarm + * state. The default is TRUE. + * + * @param actionsEnabled the actionsEnabled value to set. + * @return the AwsCloudWatchAlarmProperties object itself. + */ + public AwsCloudWatchAlarmProperties withActionsEnabled(Boolean actionsEnabled) { + this.actionsEnabled = actionsEnabled; + return this; + } + + /** + * Get the alarmActions property: The list of actions to execute when this alarm transitions into an ALARM state + * from any other state. Specify each action as an Amazon Resource Name (ARN). For more information about creating + * alarms and the actions that you can specify, see + * [PutMetricAlarm](https://docs.aws.amazon.com/AmazonCloudWatch/latest/APIReference/API_PutMetricAlarm.html) in the + * *API Reference*. + * + * @return the alarmActions value. + */ + public List alarmActions() { + return this.alarmActions; + } + + /** + * Set the alarmActions property: The list of actions to execute when this alarm transitions into an ALARM state + * from any other state. Specify each action as an Amazon Resource Name (ARN). For more information about creating + * alarms and the actions that you can specify, see + * [PutMetricAlarm](https://docs.aws.amazon.com/AmazonCloudWatch/latest/APIReference/API_PutMetricAlarm.html) in the + * *API Reference*. + * + * @param alarmActions the alarmActions value to set. + * @return the AwsCloudWatchAlarmProperties object itself. + */ + public AwsCloudWatchAlarmProperties withAlarmActions(List alarmActions) { + this.alarmActions = alarmActions; + return this; + } + + /** + * Get the alarmDescription property: The description of the alarm. + * + * @return the alarmDescription value. + */ + public String alarmDescription() { + return this.alarmDescription; + } + + /** + * Set the alarmDescription property: The description of the alarm. + * + * @param alarmDescription the alarmDescription value to set. + * @return the AwsCloudWatchAlarmProperties object itself. + */ + public AwsCloudWatchAlarmProperties withAlarmDescription(String alarmDescription) { + this.alarmDescription = alarmDescription; + return this; + } + + /** + * Get the alarmName property: The name of the alarm. If you don't specify a name, CFN generates a unique physical + * ID and uses that ID for the alarm name. If you specify a name, you cannot perform updates that require + * replacement of this resource. You can perform updates that require no or some interruption. If you must replace + * the resource, specify a new name. + * + * @return the alarmName value. + */ + public String alarmName() { + return this.alarmName; + } + + /** + * Set the alarmName property: The name of the alarm. If you don't specify a name, CFN generates a unique physical + * ID and uses that ID for the alarm name. If you specify a name, you cannot perform updates that require + * replacement of this resource. You can perform updates that require no or some interruption. If you must replace + * the resource, specify a new name. + * + * @param alarmName the alarmName value to set. + * @return the AwsCloudWatchAlarmProperties object itself. + */ + public AwsCloudWatchAlarmProperties withAlarmName(String alarmName) { + this.alarmName = alarmName; + return this; + } + + /** + * Get the arn property: Property arn. + * + * @return the arn value. + */ + public String arn() { + return this.arn; + } + + /** + * Set the arn property: Property arn. + * + * @param arn the arn value to set. + * @return the AwsCloudWatchAlarmProperties object itself. + */ + public AwsCloudWatchAlarmProperties withArn(String arn) { + this.arn = arn; + return this; + } + + /** + * Get the comparisonOperator property: The arithmetic operation to use when comparing the specified statistic and + * threshold. The specified statistic value is used as the first operand. + * + * @return the comparisonOperator value. + */ + public String comparisonOperator() { + return this.comparisonOperator; + } + + /** + * Set the comparisonOperator property: The arithmetic operation to use when comparing the specified statistic and + * threshold. The specified statistic value is used as the first operand. + * + * @param comparisonOperator the comparisonOperator value to set. + * @return the AwsCloudWatchAlarmProperties object itself. + */ + public AwsCloudWatchAlarmProperties withComparisonOperator(String comparisonOperator) { + this.comparisonOperator = comparisonOperator; + return this; + } + + /** + * Get the datapointsToAlarm property: The number of datapoints that must be breaching to trigger the alarm. This is + * used only if you are setting an 'M out of N' alarm. In that case, this value is the M, and the value that you set + * for ``EvaluationPeriods`` is the N value. For more information, see [Evaluating an + * Alarm](https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/AlarmThatSendsEmail.html#alarm-evaluation) + * in the *User Guide*. If you omit this parameter, CW uses the same value here that you set for + * ``EvaluationPeriods``, and the alarm goes to alarm state if that many consecutive periods are breaching. + * + * @return the datapointsToAlarm value. + */ + public Integer datapointsToAlarm() { + return this.datapointsToAlarm; + } + + /** + * Set the datapointsToAlarm property: The number of datapoints that must be breaching to trigger the alarm. This is + * used only if you are setting an 'M out of N' alarm. In that case, this value is the M, and the value that you set + * for ``EvaluationPeriods`` is the N value. For more information, see [Evaluating an + * Alarm](https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/AlarmThatSendsEmail.html#alarm-evaluation) + * in the *User Guide*. If you omit this parameter, CW uses the same value here that you set for + * ``EvaluationPeriods``, and the alarm goes to alarm state if that many consecutive periods are breaching. + * + * @param datapointsToAlarm the datapointsToAlarm value to set. + * @return the AwsCloudWatchAlarmProperties object itself. + */ + public AwsCloudWatchAlarmProperties withDatapointsToAlarm(Integer datapointsToAlarm) { + this.datapointsToAlarm = datapointsToAlarm; + return this; + } + + /** + * Get the dimensions property: The dimensions for the metric associated with the alarm. For an alarm based on a + * math expression, you can't specify ``Dimensions``. Instead, you use ``Metrics``. + * + * @return the dimensions value. + */ + public List dimensions() { + return this.dimensions; + } + + /** + * Set the dimensions property: The dimensions for the metric associated with the alarm. For an alarm based on a + * math expression, you can't specify ``Dimensions``. Instead, you use ``Metrics``. + * + * @param dimensions the dimensions value to set. + * @return the AwsCloudWatchAlarmProperties object itself. + */ + public AwsCloudWatchAlarmProperties withDimensions(List dimensions) { + this.dimensions = dimensions; + return this; + } + + /** + * Get the evaluateLowSampleCountPercentile property: Used only for alarms based on percentiles. If ``ignore``, the + * alarm state does not change during periods with too few data points to be statistically significant. If + * ``evaluate`` or this parameter is not used, the alarm is always evaluated and possibly changes state no matter + * how many data points are available. + * + * @return the evaluateLowSampleCountPercentile value. + */ + public String evaluateLowSampleCountPercentile() { + return this.evaluateLowSampleCountPercentile; + } + + /** + * Set the evaluateLowSampleCountPercentile property: Used only for alarms based on percentiles. If ``ignore``, the + * alarm state does not change during periods with too few data points to be statistically significant. If + * ``evaluate`` or this parameter is not used, the alarm is always evaluated and possibly changes state no matter + * how many data points are available. + * + * @param evaluateLowSampleCountPercentile the evaluateLowSampleCountPercentile value to set. + * @return the AwsCloudWatchAlarmProperties object itself. + */ + public AwsCloudWatchAlarmProperties withEvaluateLowSampleCountPercentile(String evaluateLowSampleCountPercentile) { + this.evaluateLowSampleCountPercentile = evaluateLowSampleCountPercentile; + return this; + } + + /** + * Get the evaluationPeriods property: The number of periods over which data is compared to the specified threshold. + * If you are setting an alarm that requires that a number of consecutive data points be breaching to trigger the + * alarm, this value specifies that number. If you are setting an 'M out of N' alarm, this value is the N, and + * ``DatapointsToAlarm`` is the M. For more information, see [Evaluating an + * Alarm](https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/AlarmThatSendsEmail.html#alarm-evaluation) + * in the *User Guide*. + * + * @return the evaluationPeriods value. + */ + public Integer evaluationPeriods() { + return this.evaluationPeriods; + } + + /** + * Set the evaluationPeriods property: The number of periods over which data is compared to the specified threshold. + * If you are setting an alarm that requires that a number of consecutive data points be breaching to trigger the + * alarm, this value specifies that number. If you are setting an 'M out of N' alarm, this value is the N, and + * ``DatapointsToAlarm`` is the M. For more information, see [Evaluating an + * Alarm](https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/AlarmThatSendsEmail.html#alarm-evaluation) + * in the *User Guide*. + * + * @param evaluationPeriods the evaluationPeriods value to set. + * @return the AwsCloudWatchAlarmProperties object itself. + */ + public AwsCloudWatchAlarmProperties withEvaluationPeriods(Integer evaluationPeriods) { + this.evaluationPeriods = evaluationPeriods; + return this; + } + + /** + * Get the extendedStatistic property: The percentile statistic for the metric associated with the alarm. Specify a + * value between p0.0 and p100. For an alarm based on a metric, you must specify either ``Statistic`` or + * ``ExtendedStatistic`` but not both. For an alarm based on a math expression, you can't specify + * ``ExtendedStatistic``. Instead, you use ``Metrics``. + * + * @return the extendedStatistic value. + */ + public String extendedStatistic() { + return this.extendedStatistic; + } + + /** + * Set the extendedStatistic property: The percentile statistic for the metric associated with the alarm. Specify a + * value between p0.0 and p100. For an alarm based on a metric, you must specify either ``Statistic`` or + * ``ExtendedStatistic`` but not both. For an alarm based on a math expression, you can't specify + * ``ExtendedStatistic``. Instead, you use ``Metrics``. + * + * @param extendedStatistic the extendedStatistic value to set. + * @return the AwsCloudWatchAlarmProperties object itself. + */ + public AwsCloudWatchAlarmProperties withExtendedStatistic(String extendedStatistic) { + this.extendedStatistic = extendedStatistic; + return this; + } + + /** + * Get the insufficientDataActions property: The actions to execute when this alarm transitions to the + * ``INSUFFICIENT_DATA`` state from any other state. Each action is specified as an Amazon Resource Name (ARN). + * + * @return the insufficientDataActions value. + */ + public List insufficientDataActions() { + return this.insufficientDataActions; + } + + /** + * Set the insufficientDataActions property: The actions to execute when this alarm transitions to the + * ``INSUFFICIENT_DATA`` state from any other state. Each action is specified as an Amazon Resource Name (ARN). + * + * @param insufficientDataActions the insufficientDataActions value to set. + * @return the AwsCloudWatchAlarmProperties object itself. + */ + public AwsCloudWatchAlarmProperties withInsufficientDataActions(List insufficientDataActions) { + this.insufficientDataActions = insufficientDataActions; + return this; + } + + /** + * Get the metricName property: The name of the metric associated with the alarm. This is required for an alarm + * based on a metric. For an alarm based on a math expression, you use ``Metrics`` instead and you can't specify + * ``MetricName``. + * + * @return the metricName value. + */ + public String metricName() { + return this.metricName; + } + + /** + * Set the metricName property: The name of the metric associated with the alarm. This is required for an alarm + * based on a metric. For an alarm based on a math expression, you use ``Metrics`` instead and you can't specify + * ``MetricName``. + * + * @param metricName the metricName value to set. + * @return the AwsCloudWatchAlarmProperties object itself. + */ + public AwsCloudWatchAlarmProperties withMetricName(String metricName) { + this.metricName = metricName; + return this; + } + + /** + * Get the metrics property: An array that enables you to create an alarm based on the result of a metric math + * expression. Each item in the array either retrieves a metric or performs a math expression. If you specify the + * ``Metrics`` parameter, you cannot specify ``MetricName``, ``Dimensions``, ``Period``, ``Namespace``, + * ``Statistic``, ``ExtendedStatistic``, or ``Unit``. + * + * @return the metrics value. + */ + public List metrics() { + return this.metrics; + } + + /** + * Set the metrics property: An array that enables you to create an alarm based on the result of a metric math + * expression. Each item in the array either retrieves a metric or performs a math expression. If you specify the + * ``Metrics`` parameter, you cannot specify ``MetricName``, ``Dimensions``, ``Period``, ``Namespace``, + * ``Statistic``, ``ExtendedStatistic``, or ``Unit``. + * + * @param metrics the metrics value to set. + * @return the AwsCloudWatchAlarmProperties object itself. + */ + public AwsCloudWatchAlarmProperties withMetrics(List metrics) { + this.metrics = metrics; + return this; + } + + /** + * Get the namespace property: The namespace of the metric associated with the alarm. This is required for an alarm + * based on a metric. For an alarm based on a math expression, you can't specify ``Namespace`` and you use + * ``Metrics`` instead. For a list of namespaces for metrics from AWS services, see [Services That Publish + * Metrics.](https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/aws-services-cloudwatch-metrics.html). + * + * @return the namespace value. + */ + public String namespace() { + return this.namespace; + } + + /** + * Set the namespace property: The namespace of the metric associated with the alarm. This is required for an alarm + * based on a metric. For an alarm based on a math expression, you can't specify ``Namespace`` and you use + * ``Metrics`` instead. For a list of namespaces for metrics from AWS services, see [Services That Publish + * Metrics.](https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/aws-services-cloudwatch-metrics.html). + * + * @param namespace the namespace value to set. + * @return the AwsCloudWatchAlarmProperties object itself. + */ + public AwsCloudWatchAlarmProperties withNamespace(String namespace) { + this.namespace = namespace; + return this; + } + + /** + * Get the okActions property: The actions to execute when this alarm transitions to the ``OK`` state from any other + * state. Each action is specified as an Amazon Resource Name (ARN). + * + * @return the okActions value. + */ + public List okActions() { + return this.okActions; + } + + /** + * Set the okActions property: The actions to execute when this alarm transitions to the ``OK`` state from any other + * state. Each action is specified as an Amazon Resource Name (ARN). + * + * @param okActions the okActions value to set. + * @return the AwsCloudWatchAlarmProperties object itself. + */ + public AwsCloudWatchAlarmProperties withOkActions(List okActions) { + this.okActions = okActions; + return this; + } + + /** + * Get the period property: The period, in seconds, over which the statistic is applied. This is required for an + * alarm based on a metric. Valid values are 10, 30, 60, and any multiple of 60. For an alarm based on a math + * expression, you can't specify ``Period``, and instead you use the ``Metrics`` parameter. *Minimum:* 10. + * + * @return the period value. + */ + public Integer period() { + return this.period; + } + + /** + * Set the period property: The period, in seconds, over which the statistic is applied. This is required for an + * alarm based on a metric. Valid values are 10, 30, 60, and any multiple of 60. For an alarm based on a math + * expression, you can't specify ``Period``, and instead you use the ``Metrics`` parameter. *Minimum:* 10. + * + * @param period the period value to set. + * @return the AwsCloudWatchAlarmProperties object itself. + */ + public AwsCloudWatchAlarmProperties withPeriod(Integer period) { + this.period = period; + return this; + } + + /** + * Get the statistic property: The statistic for the metric associated with the alarm, other than percentile. For + * percentile statistics, use ``ExtendedStatistic``. For an alarm based on a metric, you must specify either + * ``Statistic`` or ``ExtendedStatistic`` but not both. For an alarm based on a math expression, you can't specify + * ``Statistic``. Instead, you use ``Metrics``. + * + * @return the statistic value. + */ + public String statistic() { + return this.statistic; + } + + /** + * Set the statistic property: The statistic for the metric associated with the alarm, other than percentile. For + * percentile statistics, use ``ExtendedStatistic``. For an alarm based on a metric, you must specify either + * ``Statistic`` or ``ExtendedStatistic`` but not both. For an alarm based on a math expression, you can't specify + * ``Statistic``. Instead, you use ``Metrics``. + * + * @param statistic the statistic value to set. + * @return the AwsCloudWatchAlarmProperties object itself. + */ + public AwsCloudWatchAlarmProperties withStatistic(String statistic) { + this.statistic = statistic; + return this; + } + + /** + * Get the tags property: Property tags. + * + * @return the tags value. + */ + public List tags() { + return this.tags; + } + + /** + * Set the tags property: Property tags. + * + * @param tags the tags value to set. + * @return the AwsCloudWatchAlarmProperties object itself. + */ + public AwsCloudWatchAlarmProperties withTags(List tags) { + this.tags = tags; + return this; + } + + /** + * Get the threshold property: The value to compare with the specified statistic. + * + * @return the threshold value. + */ + public Float threshold() { + return this.threshold; + } + + /** + * Set the threshold property: The value to compare with the specified statistic. + * + * @param threshold the threshold value to set. + * @return the AwsCloudWatchAlarmProperties object itself. + */ + public AwsCloudWatchAlarmProperties withThreshold(Float threshold) { + this.threshold = threshold; + return this; + } + + /** + * Get the thresholdMetricId property: In an alarm based on an anomaly detection model, this is the ID of the + * ``ANOMALY_DETECTION_BAND`` function used as the threshold for the alarm. + * + * @return the thresholdMetricId value. + */ + public String thresholdMetricId() { + return this.thresholdMetricId; + } + + /** + * Set the thresholdMetricId property: In an alarm based on an anomaly detection model, this is the ID of the + * ``ANOMALY_DETECTION_BAND`` function used as the threshold for the alarm. + * + * @param thresholdMetricId the thresholdMetricId value to set. + * @return the AwsCloudWatchAlarmProperties object itself. + */ + public AwsCloudWatchAlarmProperties withThresholdMetricId(String thresholdMetricId) { + this.thresholdMetricId = thresholdMetricId; + return this; + } + + /** + * Get the treatMissingData property: Sets how this alarm is to handle missing data points. Valid values are + * ``breaching``, ``notBreaching``, ``ignore``, and ``missing``. For more information, see [Configuring How Alarms + * Treat Missing + * Data](https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/AlarmThatSendsEmail.html#alarms-and-missing-data) + * in the *Amazon User Guide*. If you omit this parameter, the default behavior of ``missing`` is used. + * + * @return the treatMissingData value. + */ + public String treatMissingData() { + return this.treatMissingData; + } + + /** + * Set the treatMissingData property: Sets how this alarm is to handle missing data points. Valid values are + * ``breaching``, ``notBreaching``, ``ignore``, and ``missing``. For more information, see [Configuring How Alarms + * Treat Missing + * Data](https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/AlarmThatSendsEmail.html#alarms-and-missing-data) + * in the *Amazon User Guide*. If you omit this parameter, the default behavior of ``missing`` is used. + * + * @param treatMissingData the treatMissingData value to set. + * @return the AwsCloudWatchAlarmProperties object itself. + */ + public AwsCloudWatchAlarmProperties withTreatMissingData(String treatMissingData) { + this.treatMissingData = treatMissingData; + return this; + } + + /** + * Get the unit property: The unit of the metric associated with the alarm. Specify this only if you are creating an + * alarm based on a single metric. Do not specify this if you are specifying a ``Metrics`` array. You can specify + * the following values: Seconds, Microseconds, Milliseconds, Bytes, Kilobytes, Megabytes, Gigabytes, Terabytes, + * Bits, Kilobits, Megabits, Gigabits, Terabits, Percent, Count, Bytes/Second, Kilobytes/Second, Megabytes/Second, + * Gigabytes/Second, Terabytes/Second, Bits/Second, Kilobits/Second, Megabits/Second, Gigabits/Second, + * Terabits/Second, Count/Second, or None. + * + * @return the unit value. + */ + public String unit() { + return this.unit; + } + + /** + * Set the unit property: The unit of the metric associated with the alarm. Specify this only if you are creating an + * alarm based on a single metric. Do not specify this if you are specifying a ``Metrics`` array. You can specify + * the following values: Seconds, Microseconds, Milliseconds, Bytes, Kilobytes, Megabytes, Gigabytes, Terabytes, + * Bits, Kilobits, Megabits, Gigabits, Terabits, Percent, Count, Bytes/Second, Kilobytes/Second, Megabytes/Second, + * Gigabytes/Second, Terabytes/Second, Bits/Second, Kilobits/Second, Megabits/Second, Gigabits/Second, + * Terabits/Second, Count/Second, or None. + * + * @param unit the unit value to set. + * @return the AwsCloudWatchAlarmProperties object itself. + */ + public AwsCloudWatchAlarmProperties withUnit(String unit) { + this.unit = unit; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (dimensions() != null) { + dimensions().forEach(e -> e.validate()); + } + if (metrics() != null) { + metrics().forEach(e -> e.validate()); + } + if (tags() != null) { + tags().forEach(e -> e.validate()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeBooleanField("actionsEnabled", this.actionsEnabled); + jsonWriter.writeArrayField("alarmActions", this.alarmActions, (writer, element) -> writer.writeString(element)); + jsonWriter.writeStringField("alarmDescription", this.alarmDescription); + jsonWriter.writeStringField("alarmName", this.alarmName); + jsonWriter.writeStringField("arn", this.arn); + jsonWriter.writeStringField("comparisonOperator", this.comparisonOperator); + jsonWriter.writeNumberField("datapointsToAlarm", this.datapointsToAlarm); + jsonWriter.writeArrayField("dimensions", this.dimensions, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("evaluateLowSampleCountPercentile", this.evaluateLowSampleCountPercentile); + jsonWriter.writeNumberField("evaluationPeriods", this.evaluationPeriods); + jsonWriter.writeStringField("extendedStatistic", this.extendedStatistic); + jsonWriter.writeArrayField("insufficientDataActions", this.insufficientDataActions, + (writer, element) -> writer.writeString(element)); + jsonWriter.writeStringField("metricName", this.metricName); + jsonWriter.writeArrayField("metrics", this.metrics, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("namespace", this.namespace); + jsonWriter.writeArrayField("okActions", this.okActions, (writer, element) -> writer.writeString(element)); + jsonWriter.writeNumberField("period", this.period); + jsonWriter.writeStringField("statistic", this.statistic); + jsonWriter.writeArrayField("tags", this.tags, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeNumberField("threshold", this.threshold); + jsonWriter.writeStringField("thresholdMetricId", this.thresholdMetricId); + jsonWriter.writeStringField("treatMissingData", this.treatMissingData); + jsonWriter.writeStringField("unit", this.unit); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AwsCloudWatchAlarmProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AwsCloudWatchAlarmProperties if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the AwsCloudWatchAlarmProperties. + */ + public static AwsCloudWatchAlarmProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AwsCloudWatchAlarmProperties deserializedAwsCloudWatchAlarmProperties = new AwsCloudWatchAlarmProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("actionsEnabled".equals(fieldName)) { + deserializedAwsCloudWatchAlarmProperties.actionsEnabled + = reader.getNullable(JsonReader::getBoolean); + } else if ("alarmActions".equals(fieldName)) { + List alarmActions = reader.readArray(reader1 -> reader1.getString()); + deserializedAwsCloudWatchAlarmProperties.alarmActions = alarmActions; + } else if ("alarmDescription".equals(fieldName)) { + deserializedAwsCloudWatchAlarmProperties.alarmDescription = reader.getString(); + } else if ("alarmName".equals(fieldName)) { + deserializedAwsCloudWatchAlarmProperties.alarmName = reader.getString(); + } else if ("arn".equals(fieldName)) { + deserializedAwsCloudWatchAlarmProperties.arn = reader.getString(); + } else if ("comparisonOperator".equals(fieldName)) { + deserializedAwsCloudWatchAlarmProperties.comparisonOperator = reader.getString(); + } else if ("datapointsToAlarm".equals(fieldName)) { + deserializedAwsCloudWatchAlarmProperties.datapointsToAlarm = reader.getNullable(JsonReader::getInt); + } else if ("dimensions".equals(fieldName)) { + List dimensions = reader.readArray(reader1 -> Dimension.fromJson(reader1)); + deserializedAwsCloudWatchAlarmProperties.dimensions = dimensions; + } else if ("evaluateLowSampleCountPercentile".equals(fieldName)) { + deserializedAwsCloudWatchAlarmProperties.evaluateLowSampleCountPercentile = reader.getString(); + } else if ("evaluationPeriods".equals(fieldName)) { + deserializedAwsCloudWatchAlarmProperties.evaluationPeriods = reader.getNullable(JsonReader::getInt); + } else if ("extendedStatistic".equals(fieldName)) { + deserializedAwsCloudWatchAlarmProperties.extendedStatistic = reader.getString(); + } else if ("insufficientDataActions".equals(fieldName)) { + List insufficientDataActions = reader.readArray(reader1 -> reader1.getString()); + deserializedAwsCloudWatchAlarmProperties.insufficientDataActions = insufficientDataActions; + } else if ("metricName".equals(fieldName)) { + deserializedAwsCloudWatchAlarmProperties.metricName = reader.getString(); + } else if ("metrics".equals(fieldName)) { + List metrics = reader.readArray(reader1 -> MetricDataQuery.fromJson(reader1)); + deserializedAwsCloudWatchAlarmProperties.metrics = metrics; + } else if ("namespace".equals(fieldName)) { + deserializedAwsCloudWatchAlarmProperties.namespace = reader.getString(); + } else if ("okActions".equals(fieldName)) { + List okActions = reader.readArray(reader1 -> reader1.getString()); + deserializedAwsCloudWatchAlarmProperties.okActions = okActions; + } else if ("period".equals(fieldName)) { + deserializedAwsCloudWatchAlarmProperties.period = reader.getNullable(JsonReader::getInt); + } else if ("statistic".equals(fieldName)) { + deserializedAwsCloudWatchAlarmProperties.statistic = reader.getString(); + } else if ("tags".equals(fieldName)) { + List tags = reader.readArray(reader1 -> TagAutoGenerated6.fromJson(reader1)); + deserializedAwsCloudWatchAlarmProperties.tags = tags; + } else if ("threshold".equals(fieldName)) { + deserializedAwsCloudWatchAlarmProperties.threshold = reader.getNullable(JsonReader::getFloat); + } else if ("thresholdMetricId".equals(fieldName)) { + deserializedAwsCloudWatchAlarmProperties.thresholdMetricId = reader.getString(); + } else if ("treatMissingData".equals(fieldName)) { + deserializedAwsCloudWatchAlarmProperties.treatMissingData = reader.getString(); + } else if ("unit".equals(fieldName)) { + deserializedAwsCloudWatchAlarmProperties.unit = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedAwsCloudWatchAlarmProperties; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/AwsCodeBuildProjectProperties.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/AwsCodeBuildProjectProperties.java new file mode 100644 index 000000000000..4dd8d6413503 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/AwsCodeBuildProjectProperties.java @@ -0,0 +1,1034 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.time.OffsetDateTime; +import java.time.format.DateTimeFormatter; +import java.util.List; + +/** + * Definition of awsCodeBuildProject. + */ +@Fluent +public final class AwsCodeBuildProjectProperties implements JsonSerializable { + /* + *

The Amazon Resource Name (ARN) of the build project.

+ */ + private String arn; + + /* + *

Information about the build output artifacts for the build project.

+ */ + private ProjectArtifacts artifacts; + + /* + *

Information about the build badge for the build project.

+ */ + private ProjectBadge badge; + + /* + *

A ProjectBuildBatchConfig object that defines the batch build options for the project.

+ */ + private ProjectBuildBatchConfig buildBatchConfig; + + /* + *

Information about the cache for the build project.

+ */ + private ProjectCache cache; + + /* + *

The maximum number of concurrent builds that are allowed for this project.

New builds are only started + * if the current number of builds is less than or equal to this limit. If the current build count meets this limit, + * new builds are throttled and are not run.

+ */ + private Integer concurrentBuildLimit; + + /* + *

When the build project was created, expressed in Unix time format.

+ */ + private OffsetDateTime created; + + /* + *

A description that makes the build project easy to identify.

+ */ + private String description; + + /* + *

The Key Management Service customer master key (CMK) to be used for encrypting the build output artifacts.

+ *

You can use a cross-account KMS key to encrypt the build output artifacts if your service role has + * permission to that key.

You can specify either the Amazon Resource Name (ARN) of the CMK or, if + * available, the CMK's alias (using the format alias/<alias-name>). If you don't specify a + * value, CodeBuild uses the managed CMK for Amazon Simple Storage Service (Amazon S3).

+ */ + private String encryptionKey; + + /* + *

Information about the build environment for this build project.

+ */ + private ProjectEnvironment environment; + + /* + *

An array of ProjectFileSystemLocation objects for a CodeBuild build project. A + * ProjectFileSystemLocation object specifies the identifier, location, + * mountOptions, mountPoint, and type of a file system created using Amazon + * Elastic File System.

+ */ + private List fileSystemLocations; + + /* + *

When the build project's settings were last modified, expressed in Unix time format.

+ */ + private OffsetDateTime lastModified; + + /* + *

Information about logs for the build project. A project can create logs in CloudWatch Logs, an S3 bucket, or + * both.

+ */ + private LogsConfig logsConfig; + + /* + *

The name of the build project.

+ */ + private String name; + + /* + * Property projectVisibility + */ + private ProjectVisibilityTypeEnumValue projectVisibility; + + /* + *

Contains the project identifier used with the public build APIs.

+ */ + private String publicProjectAlias; + + /* + *

The number of minutes a build is allowed to be queued before it times out.

+ */ + private Integer queuedTimeoutInMinutes; + + /* + *

The ARN of the IAM role that enables CodeBuild to access the CloudWatch Logs and Amazon S3 artifacts for the + * project's builds.

+ */ + private String resourceAccessRole; + + /* + *

An array of ProjectArtifacts objects.

+ */ + private List secondaryArtifacts; + + /* + *

An array of ProjectSourceVersion objects. If secondarySourceVersions is specified at + * the build level, then they take over these secondarySourceVersions (at the project level).

+ */ + private List secondarySourceVersions; + + /* + *

An array of ProjectSource objects.

+ */ + private List secondarySources; + + /* + *

The ARN of the IAM role that enables CodeBuild to interact with dependent Amazon Web Services services on + * behalf of the Amazon Web Services account.

+ */ + private String serviceRole; + + /* + *

Information about the build input source code for this build project.

+ */ + private ProjectSource source; + + /* + *

A version of the build input to be built for this project. If not specified, the latest version is used. If + * specified, it must be one of:

  • For CodeCommit: the commit ID, branch, or Git tag to use.

    + *
  • For GitHub: the commit ID, pull request ID, branch name, or tag name that corresponds to the + * version of the source code you want to build. If a pull request ID is specified, it must use the format + * pr/pull-request-ID (for example pr/25). If a branch name is specified, the branch's + * HEAD commit ID is used. If not specified, the default branch's HEAD commit ID is used.

  • For + * Bitbucket: the commit ID, branch name, or tag name that corresponds to the version of the source code you want to + * build. If a branch name is specified, the branch's HEAD commit ID is used. If not specified, the default branch's + * HEAD commit ID is used.

  • For Amazon S3: the version ID of the object that represents the build + * input ZIP file to use.

If sourceVersion is specified at the build level, then + * that version takes precedence over this sourceVersion (at the project level).

For more + * information, see Source Version Sample + * with CodeBuild in the CodeBuild User Guide.

+ */ + private String sourceVersion; + + /* + *

A list of tag key and value pairs associated with this build project.

These tags are available for use + * by Amazon Web Services services that support CodeBuild build project tags.

+ */ + private List tags; + + /* + *

How long, in minutes, from 5 to 480 (8 hours), for CodeBuild to wait before timing out any related build that + * did not get marked as completed. The default is 60 minutes.

+ */ + private Integer timeoutInMinutes; + + /* + *

Information about the VPC configuration that CodeBuild accesses.

+ */ + private VpcConfig vpcConfig; + + /* + *

Information about a webhook that connects repository events to a build project in CodeBuild.

+ */ + private Webhook webhook; + + /** + * Creates an instance of AwsCodeBuildProjectProperties class. + */ + public AwsCodeBuildProjectProperties() { + } + + /** + * Get the arn property: <p>The Amazon Resource Name (ARN) of the build project.</p>. + * + * @return the arn value. + */ + public String arn() { + return this.arn; + } + + /** + * Set the arn property: <p>The Amazon Resource Name (ARN) of the build project.</p>. + * + * @param arn the arn value to set. + * @return the AwsCodeBuildProjectProperties object itself. + */ + public AwsCodeBuildProjectProperties withArn(String arn) { + this.arn = arn; + return this; + } + + /** + * Get the artifacts property: <p>Information about the build output artifacts for the build + * project.</p>. + * + * @return the artifacts value. + */ + public ProjectArtifacts artifacts() { + return this.artifacts; + } + + /** + * Set the artifacts property: <p>Information about the build output artifacts for the build + * project.</p>. + * + * @param artifacts the artifacts value to set. + * @return the AwsCodeBuildProjectProperties object itself. + */ + public AwsCodeBuildProjectProperties withArtifacts(ProjectArtifacts artifacts) { + this.artifacts = artifacts; + return this; + } + + /** + * Get the badge property: <p>Information about the build badge for the build project.</p>. + * + * @return the badge value. + */ + public ProjectBadge badge() { + return this.badge; + } + + /** + * Set the badge property: <p>Information about the build badge for the build project.</p>. + * + * @param badge the badge value to set. + * @return the AwsCodeBuildProjectProperties object itself. + */ + public AwsCodeBuildProjectProperties withBadge(ProjectBadge badge) { + this.badge = badge; + return this; + } + + /** + * Get the buildBatchConfig property: <p>A <a>ProjectBuildBatchConfig</a> object that defines the + * batch build options for the project.</p>. + * + * @return the buildBatchConfig value. + */ + public ProjectBuildBatchConfig buildBatchConfig() { + return this.buildBatchConfig; + } + + /** + * Set the buildBatchConfig property: <p>A <a>ProjectBuildBatchConfig</a> object that defines the + * batch build options for the project.</p>. + * + * @param buildBatchConfig the buildBatchConfig value to set. + * @return the AwsCodeBuildProjectProperties object itself. + */ + public AwsCodeBuildProjectProperties withBuildBatchConfig(ProjectBuildBatchConfig buildBatchConfig) { + this.buildBatchConfig = buildBatchConfig; + return this; + } + + /** + * Get the cache property: <p>Information about the cache for the build project.</p>. + * + * @return the cache value. + */ + public ProjectCache cache() { + return this.cache; + } + + /** + * Set the cache property: <p>Information about the cache for the build project.</p>. + * + * @param cache the cache value to set. + * @return the AwsCodeBuildProjectProperties object itself. + */ + public AwsCodeBuildProjectProperties withCache(ProjectCache cache) { + this.cache = cache; + return this; + } + + /** + * Get the concurrentBuildLimit property: <p>The maximum number of concurrent builds that are allowed for this + * project.</p> <p>New builds are only started if the current number of builds is less than or equal to + * this limit. If the current build count meets this limit, new builds are throttled and are not run.</p>. + * + * @return the concurrentBuildLimit value. + */ + public Integer concurrentBuildLimit() { + return this.concurrentBuildLimit; + } + + /** + * Set the concurrentBuildLimit property: <p>The maximum number of concurrent builds that are allowed for this + * project.</p> <p>New builds are only started if the current number of builds is less than or equal to + * this limit. If the current build count meets this limit, new builds are throttled and are not run.</p>. + * + * @param concurrentBuildLimit the concurrentBuildLimit value to set. + * @return the AwsCodeBuildProjectProperties object itself. + */ + public AwsCodeBuildProjectProperties withConcurrentBuildLimit(Integer concurrentBuildLimit) { + this.concurrentBuildLimit = concurrentBuildLimit; + return this; + } + + /** + * Get the created property: <p>When the build project was created, expressed in Unix time format.</p>. + * + * @return the created value. + */ + public OffsetDateTime created() { + return this.created; + } + + /** + * Set the created property: <p>When the build project was created, expressed in Unix time format.</p>. + * + * @param created the created value to set. + * @return the AwsCodeBuildProjectProperties object itself. + */ + public AwsCodeBuildProjectProperties withCreated(OffsetDateTime created) { + this.created = created; + return this; + } + + /** + * Get the description property: <p>A description that makes the build project easy to identify.</p>. + * + * @return the description value. + */ + public String description() { + return this.description; + } + + /** + * Set the description property: <p>A description that makes the build project easy to identify.</p>. + * + * @param description the description value to set. + * @return the AwsCodeBuildProjectProperties object itself. + */ + public AwsCodeBuildProjectProperties withDescription(String description) { + this.description = description; + return this; + } + + /** + * Get the encryptionKey property: <p>The Key Management Service customer master key (CMK) to be used for + * encrypting the build output artifacts.</p> <note> <p>You can use a cross-account KMS key to + * encrypt the build output artifacts if your service role has permission to that key. </p> </note> + * <p>You can specify either the Amazon Resource Name (ARN) of the CMK or, if available, the CMK's alias + * (using the format <code>alias/&lt;alias-name&gt;</code>). If you don't specify a value, + * CodeBuild uses the managed CMK for Amazon Simple Storage Service (Amazon S3). </p>. + * + * @return the encryptionKey value. + */ + public String encryptionKey() { + return this.encryptionKey; + } + + /** + * Set the encryptionKey property: <p>The Key Management Service customer master key (CMK) to be used for + * encrypting the build output artifacts.</p> <note> <p>You can use a cross-account KMS key to + * encrypt the build output artifacts if your service role has permission to that key. </p> </note> + * <p>You can specify either the Amazon Resource Name (ARN) of the CMK or, if available, the CMK's alias + * (using the format <code>alias/&lt;alias-name&gt;</code>). If you don't specify a value, + * CodeBuild uses the managed CMK for Amazon Simple Storage Service (Amazon S3). </p>. + * + * @param encryptionKey the encryptionKey value to set. + * @return the AwsCodeBuildProjectProperties object itself. + */ + public AwsCodeBuildProjectProperties withEncryptionKey(String encryptionKey) { + this.encryptionKey = encryptionKey; + return this; + } + + /** + * Get the environment property: <p>Information about the build environment for this build project.</p>. + * + * @return the environment value. + */ + public ProjectEnvironment environment() { + return this.environment; + } + + /** + * Set the environment property: <p>Information about the build environment for this build project.</p>. + * + * @param environment the environment value to set. + * @return the AwsCodeBuildProjectProperties object itself. + */ + public AwsCodeBuildProjectProperties withEnvironment(ProjectEnvironment environment) { + this.environment = environment; + return this; + } + + /** + * Get the fileSystemLocations property: <p> An array of <code>ProjectFileSystemLocation</code> + * objects for a CodeBuild build project. A <code>ProjectFileSystemLocation</code> object specifies the + * <code>identifier</code>, <code>location</code>, <code>mountOptions</code>, + * <code>mountPoint</code>, and <code>type</code> of a file system created using Amazon + * Elastic File System. </p>. + * + * @return the fileSystemLocations value. + */ + public List fileSystemLocations() { + return this.fileSystemLocations; + } + + /** + * Set the fileSystemLocations property: <p> An array of <code>ProjectFileSystemLocation</code> + * objects for a CodeBuild build project. A <code>ProjectFileSystemLocation</code> object specifies the + * <code>identifier</code>, <code>location</code>, <code>mountOptions</code>, + * <code>mountPoint</code>, and <code>type</code> of a file system created using Amazon + * Elastic File System. </p>. + * + * @param fileSystemLocations the fileSystemLocations value to set. + * @return the AwsCodeBuildProjectProperties object itself. + */ + public AwsCodeBuildProjectProperties withFileSystemLocations(List fileSystemLocations) { + this.fileSystemLocations = fileSystemLocations; + return this; + } + + /** + * Get the lastModified property: <p>When the build project's settings were last modified, expressed in Unix + * time format.</p>. + * + * @return the lastModified value. + */ + public OffsetDateTime lastModified() { + return this.lastModified; + } + + /** + * Set the lastModified property: <p>When the build project's settings were last modified, expressed in Unix + * time format.</p>. + * + * @param lastModified the lastModified value to set. + * @return the AwsCodeBuildProjectProperties object itself. + */ + public AwsCodeBuildProjectProperties withLastModified(OffsetDateTime lastModified) { + this.lastModified = lastModified; + return this; + } + + /** + * Get the logsConfig property: <p>Information about logs for the build project. A project can create logs in + * CloudWatch Logs, an S3 bucket, or both. </p>. + * + * @return the logsConfig value. + */ + public LogsConfig logsConfig() { + return this.logsConfig; + } + + /** + * Set the logsConfig property: <p>Information about logs for the build project. A project can create logs in + * CloudWatch Logs, an S3 bucket, or both. </p>. + * + * @param logsConfig the logsConfig value to set. + * @return the AwsCodeBuildProjectProperties object itself. + */ + public AwsCodeBuildProjectProperties withLogsConfig(LogsConfig logsConfig) { + this.logsConfig = logsConfig; + return this; + } + + /** + * Get the name property: <p>The name of the build project.</p>. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: <p>The name of the build project.</p>. + * + * @param name the name value to set. + * @return the AwsCodeBuildProjectProperties object itself. + */ + public AwsCodeBuildProjectProperties withName(String name) { + this.name = name; + return this; + } + + /** + * Get the projectVisibility property: Property projectVisibility. + * + * @return the projectVisibility value. + */ + public ProjectVisibilityTypeEnumValue projectVisibility() { + return this.projectVisibility; + } + + /** + * Set the projectVisibility property: Property projectVisibility. + * + * @param projectVisibility the projectVisibility value to set. + * @return the AwsCodeBuildProjectProperties object itself. + */ + public AwsCodeBuildProjectProperties withProjectVisibility(ProjectVisibilityTypeEnumValue projectVisibility) { + this.projectVisibility = projectVisibility; + return this; + } + + /** + * Get the publicProjectAlias property: <p>Contains the project identifier used with the public build APIs. + * </p>. + * + * @return the publicProjectAlias value. + */ + public String publicProjectAlias() { + return this.publicProjectAlias; + } + + /** + * Set the publicProjectAlias property: <p>Contains the project identifier used with the public build APIs. + * </p>. + * + * @param publicProjectAlias the publicProjectAlias value to set. + * @return the AwsCodeBuildProjectProperties object itself. + */ + public AwsCodeBuildProjectProperties withPublicProjectAlias(String publicProjectAlias) { + this.publicProjectAlias = publicProjectAlias; + return this; + } + + /** + * Get the queuedTimeoutInMinutes property: <p>The number of minutes a build is allowed to be queued before it + * times out. </p>. + * + * @return the queuedTimeoutInMinutes value. + */ + public Integer queuedTimeoutInMinutes() { + return this.queuedTimeoutInMinutes; + } + + /** + * Set the queuedTimeoutInMinutes property: <p>The number of minutes a build is allowed to be queued before it + * times out. </p>. + * + * @param queuedTimeoutInMinutes the queuedTimeoutInMinutes value to set. + * @return the AwsCodeBuildProjectProperties object itself. + */ + public AwsCodeBuildProjectProperties withQueuedTimeoutInMinutes(Integer queuedTimeoutInMinutes) { + this.queuedTimeoutInMinutes = queuedTimeoutInMinutes; + return this; + } + + /** + * Get the resourceAccessRole property: <p>The ARN of the IAM role that enables CodeBuild to access the + * CloudWatch Logs and Amazon S3 artifacts for the project's builds.</p>. + * + * @return the resourceAccessRole value. + */ + public String resourceAccessRole() { + return this.resourceAccessRole; + } + + /** + * Set the resourceAccessRole property: <p>The ARN of the IAM role that enables CodeBuild to access the + * CloudWatch Logs and Amazon S3 artifacts for the project's builds.</p>. + * + * @param resourceAccessRole the resourceAccessRole value to set. + * @return the AwsCodeBuildProjectProperties object itself. + */ + public AwsCodeBuildProjectProperties withResourceAccessRole(String resourceAccessRole) { + this.resourceAccessRole = resourceAccessRole; + return this; + } + + /** + * Get the secondaryArtifacts property: <p>An array of <code>ProjectArtifacts</code> objects. + * </p>. + * + * @return the secondaryArtifacts value. + */ + public List secondaryArtifacts() { + return this.secondaryArtifacts; + } + + /** + * Set the secondaryArtifacts property: <p>An array of <code>ProjectArtifacts</code> objects. + * </p>. + * + * @param secondaryArtifacts the secondaryArtifacts value to set. + * @return the AwsCodeBuildProjectProperties object itself. + */ + public AwsCodeBuildProjectProperties withSecondaryArtifacts(List secondaryArtifacts) { + this.secondaryArtifacts = secondaryArtifacts; + return this; + } + + /** + * Get the secondarySourceVersions property: <p>An array of <code>ProjectSourceVersion</code> + * objects. If <code>secondarySourceVersions</code> is specified at the build level, then they take over + * these <code>secondarySourceVersions</code> (at the project level). </p>. + * + * @return the secondarySourceVersions value. + */ + public List secondarySourceVersions() { + return this.secondarySourceVersions; + } + + /** + * Set the secondarySourceVersions property: <p>An array of <code>ProjectSourceVersion</code> + * objects. If <code>secondarySourceVersions</code> is specified at the build level, then they take over + * these <code>secondarySourceVersions</code> (at the project level). </p>. + * + * @param secondarySourceVersions the secondarySourceVersions value to set. + * @return the AwsCodeBuildProjectProperties object itself. + */ + public AwsCodeBuildProjectProperties + withSecondarySourceVersions(List secondarySourceVersions) { + this.secondarySourceVersions = secondarySourceVersions; + return this; + } + + /** + * Get the secondarySources property: <p>An array of <code>ProjectSource</code> objects. + * </p>. + * + * @return the secondarySources value. + */ + public List secondarySources() { + return this.secondarySources; + } + + /** + * Set the secondarySources property: <p>An array of <code>ProjectSource</code> objects. + * </p>. + * + * @param secondarySources the secondarySources value to set. + * @return the AwsCodeBuildProjectProperties object itself. + */ + public AwsCodeBuildProjectProperties withSecondarySources(List secondarySources) { + this.secondarySources = secondarySources; + return this; + } + + /** + * Get the serviceRole property: <p>The ARN of the IAM role that enables CodeBuild to interact with dependent + * Amazon Web Services services on behalf of the Amazon Web Services account.</p>. + * + * @return the serviceRole value. + */ + public String serviceRole() { + return this.serviceRole; + } + + /** + * Set the serviceRole property: <p>The ARN of the IAM role that enables CodeBuild to interact with dependent + * Amazon Web Services services on behalf of the Amazon Web Services account.</p>. + * + * @param serviceRole the serviceRole value to set. + * @return the AwsCodeBuildProjectProperties object itself. + */ + public AwsCodeBuildProjectProperties withServiceRole(String serviceRole) { + this.serviceRole = serviceRole; + return this; + } + + /** + * Get the source property: <p>Information about the build input source code for this build + * project.</p>. + * + * @return the source value. + */ + public ProjectSource source() { + return this.source; + } + + /** + * Set the source property: <p>Information about the build input source code for this build + * project.</p>. + * + * @param source the source value to set. + * @return the AwsCodeBuildProjectProperties object itself. + */ + public AwsCodeBuildProjectProperties withSource(ProjectSource source) { + this.source = source; + return this; + } + + /** + * Get the sourceVersion property: <p>A version of the build input to be built for this project. If not + * specified, the latest version is used. If specified, it must be one of:</p> <ul> <li> + * <p>For CodeCommit: the commit ID, branch, or Git tag to use.</p> </li> <li> <p>For + * GitHub: the commit ID, pull request ID, branch name, or tag name that corresponds to the version of the source + * code you want to build. If a pull request ID is specified, it must use the format + * <code>pr/pull-request-ID</code> (for example <code>pr/25</code>). If a branch name is + * specified, the branch's HEAD commit ID is used. If not specified, the default branch's HEAD commit ID is + * used.</p> </li> <li> <p>For Bitbucket: the commit ID, branch name, or tag name that + * corresponds to the version of the source code you want to build. If a branch name is specified, the branch's HEAD + * commit ID is used. If not specified, the default branch's HEAD commit ID is used.</p> </li> + * <li> <p>For Amazon S3: the version ID of the object that represents the build input ZIP file to + * use.</p> </li> </ul> <p>If <code>sourceVersion</code> is specified at the + * build level, then that version takes precedence over this <code>sourceVersion</code> (at the project + * level). </p> <p>For more information, see <a + * href='https://docs.aws.amazon.com/codebuild/latest/userguide/sample-source-version.html'>Source Version Sample + * with CodeBuild</a> in the <i>CodeBuild User Guide</i>. </p>. + * + * @return the sourceVersion value. + */ + public String sourceVersion() { + return this.sourceVersion; + } + + /** + * Set the sourceVersion property: <p>A version of the build input to be built for this project. If not + * specified, the latest version is used. If specified, it must be one of:</p> <ul> <li> + * <p>For CodeCommit: the commit ID, branch, or Git tag to use.</p> </li> <li> <p>For + * GitHub: the commit ID, pull request ID, branch name, or tag name that corresponds to the version of the source + * code you want to build. If a pull request ID is specified, it must use the format + * <code>pr/pull-request-ID</code> (for example <code>pr/25</code>). If a branch name is + * specified, the branch's HEAD commit ID is used. If not specified, the default branch's HEAD commit ID is + * used.</p> </li> <li> <p>For Bitbucket: the commit ID, branch name, or tag name that + * corresponds to the version of the source code you want to build. If a branch name is specified, the branch's HEAD + * commit ID is used. If not specified, the default branch's HEAD commit ID is used.</p> </li> + * <li> <p>For Amazon S3: the version ID of the object that represents the build input ZIP file to + * use.</p> </li> </ul> <p>If <code>sourceVersion</code> is specified at the + * build level, then that version takes precedence over this <code>sourceVersion</code> (at the project + * level). </p> <p>For more information, see <a + * href='https://docs.aws.amazon.com/codebuild/latest/userguide/sample-source-version.html'>Source Version Sample + * with CodeBuild</a> in the <i>CodeBuild User Guide</i>. </p>. + * + * @param sourceVersion the sourceVersion value to set. + * @return the AwsCodeBuildProjectProperties object itself. + */ + public AwsCodeBuildProjectProperties withSourceVersion(String sourceVersion) { + this.sourceVersion = sourceVersion; + return this; + } + + /** + * Get the tags property: <p>A list of tag key and value pairs associated with this build project.</p> + * <p>These tags are available for use by Amazon Web Services services that support CodeBuild build project + * tags.</p>. + * + * @return the tags value. + */ + public List tags() { + return this.tags; + } + + /** + * Set the tags property: <p>A list of tag key and value pairs associated with this build project.</p> + * <p>These tags are available for use by Amazon Web Services services that support CodeBuild build project + * tags.</p>. + * + * @param tags the tags value to set. + * @return the AwsCodeBuildProjectProperties object itself. + */ + public AwsCodeBuildProjectProperties withTags(List tags) { + this.tags = tags; + return this; + } + + /** + * Get the timeoutInMinutes property: <p>How long, in minutes, from 5 to 480 (8 hours), for CodeBuild to wait + * before timing out any related build that did not get marked as completed. The default is 60 minutes.</p>. + * + * @return the timeoutInMinutes value. + */ + public Integer timeoutInMinutes() { + return this.timeoutInMinutes; + } + + /** + * Set the timeoutInMinutes property: <p>How long, in minutes, from 5 to 480 (8 hours), for CodeBuild to wait + * before timing out any related build that did not get marked as completed. The default is 60 minutes.</p>. + * + * @param timeoutInMinutes the timeoutInMinutes value to set. + * @return the AwsCodeBuildProjectProperties object itself. + */ + public AwsCodeBuildProjectProperties withTimeoutInMinutes(Integer timeoutInMinutes) { + this.timeoutInMinutes = timeoutInMinutes; + return this; + } + + /** + * Get the vpcConfig property: <p>Information about the VPC configuration that CodeBuild accesses.</p>. + * + * @return the vpcConfig value. + */ + public VpcConfig vpcConfig() { + return this.vpcConfig; + } + + /** + * Set the vpcConfig property: <p>Information about the VPC configuration that CodeBuild accesses.</p>. + * + * @param vpcConfig the vpcConfig value to set. + * @return the AwsCodeBuildProjectProperties object itself. + */ + public AwsCodeBuildProjectProperties withVpcConfig(VpcConfig vpcConfig) { + this.vpcConfig = vpcConfig; + return this; + } + + /** + * Get the webhook property: <p>Information about a webhook that connects repository events to a build project + * in CodeBuild.</p>. + * + * @return the webhook value. + */ + public Webhook webhook() { + return this.webhook; + } + + /** + * Set the webhook property: <p>Information about a webhook that connects repository events to a build project + * in CodeBuild.</p>. + * + * @param webhook the webhook value to set. + * @return the AwsCodeBuildProjectProperties object itself. + */ + public AwsCodeBuildProjectProperties withWebhook(Webhook webhook) { + this.webhook = webhook; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (artifacts() != null) { + artifacts().validate(); + } + if (badge() != null) { + badge().validate(); + } + if (buildBatchConfig() != null) { + buildBatchConfig().validate(); + } + if (cache() != null) { + cache().validate(); + } + if (environment() != null) { + environment().validate(); + } + if (fileSystemLocations() != null) { + fileSystemLocations().forEach(e -> e.validate()); + } + if (logsConfig() != null) { + logsConfig().validate(); + } + if (projectVisibility() != null) { + projectVisibility().validate(); + } + if (secondaryArtifacts() != null) { + secondaryArtifacts().forEach(e -> e.validate()); + } + if (secondarySourceVersions() != null) { + secondarySourceVersions().forEach(e -> e.validate()); + } + if (secondarySources() != null) { + secondarySources().forEach(e -> e.validate()); + } + if (source() != null) { + source().validate(); + } + if (tags() != null) { + tags().forEach(e -> e.validate()); + } + if (vpcConfig() != null) { + vpcConfig().validate(); + } + if (webhook() != null) { + webhook().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("arn", this.arn); + jsonWriter.writeJsonField("artifacts", this.artifacts); + jsonWriter.writeJsonField("badge", this.badge); + jsonWriter.writeJsonField("buildBatchConfig", this.buildBatchConfig); + jsonWriter.writeJsonField("cache", this.cache); + jsonWriter.writeNumberField("concurrentBuildLimit", this.concurrentBuildLimit); + jsonWriter.writeStringField("created", + this.created == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.created)); + jsonWriter.writeStringField("description", this.description); + jsonWriter.writeStringField("encryptionKey", this.encryptionKey); + jsonWriter.writeJsonField("environment", this.environment); + jsonWriter.writeArrayField("fileSystemLocations", this.fileSystemLocations, + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("lastModified", + this.lastModified == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.lastModified)); + jsonWriter.writeJsonField("logsConfig", this.logsConfig); + jsonWriter.writeStringField("name", this.name); + jsonWriter.writeJsonField("projectVisibility", this.projectVisibility); + jsonWriter.writeStringField("publicProjectAlias", this.publicProjectAlias); + jsonWriter.writeNumberField("queuedTimeoutInMinutes", this.queuedTimeoutInMinutes); + jsonWriter.writeStringField("resourceAccessRole", this.resourceAccessRole); + jsonWriter.writeArrayField("secondaryArtifacts", this.secondaryArtifacts, + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("secondarySourceVersions", this.secondarySourceVersions, + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("secondarySources", this.secondarySources, + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("serviceRole", this.serviceRole); + jsonWriter.writeJsonField("source", this.source); + jsonWriter.writeStringField("sourceVersion", this.sourceVersion); + jsonWriter.writeArrayField("tags", this.tags, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeNumberField("timeoutInMinutes", this.timeoutInMinutes); + jsonWriter.writeJsonField("vpcConfig", this.vpcConfig); + jsonWriter.writeJsonField("webhook", this.webhook); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AwsCodeBuildProjectProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AwsCodeBuildProjectProperties if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the AwsCodeBuildProjectProperties. + */ + public static AwsCodeBuildProjectProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AwsCodeBuildProjectProperties deserializedAwsCodeBuildProjectProperties + = new AwsCodeBuildProjectProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("arn".equals(fieldName)) { + deserializedAwsCodeBuildProjectProperties.arn = reader.getString(); + } else if ("artifacts".equals(fieldName)) { + deserializedAwsCodeBuildProjectProperties.artifacts = ProjectArtifacts.fromJson(reader); + } else if ("badge".equals(fieldName)) { + deserializedAwsCodeBuildProjectProperties.badge = ProjectBadge.fromJson(reader); + } else if ("buildBatchConfig".equals(fieldName)) { + deserializedAwsCodeBuildProjectProperties.buildBatchConfig + = ProjectBuildBatchConfig.fromJson(reader); + } else if ("cache".equals(fieldName)) { + deserializedAwsCodeBuildProjectProperties.cache = ProjectCache.fromJson(reader); + } else if ("concurrentBuildLimit".equals(fieldName)) { + deserializedAwsCodeBuildProjectProperties.concurrentBuildLimit + = reader.getNullable(JsonReader::getInt); + } else if ("created".equals(fieldName)) { + deserializedAwsCodeBuildProjectProperties.created = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("description".equals(fieldName)) { + deserializedAwsCodeBuildProjectProperties.description = reader.getString(); + } else if ("encryptionKey".equals(fieldName)) { + deserializedAwsCodeBuildProjectProperties.encryptionKey = reader.getString(); + } else if ("environment".equals(fieldName)) { + deserializedAwsCodeBuildProjectProperties.environment = ProjectEnvironment.fromJson(reader); + } else if ("fileSystemLocations".equals(fieldName)) { + List fileSystemLocations + = reader.readArray(reader1 -> ProjectFileSystemLocation.fromJson(reader1)); + deserializedAwsCodeBuildProjectProperties.fileSystemLocations = fileSystemLocations; + } else if ("lastModified".equals(fieldName)) { + deserializedAwsCodeBuildProjectProperties.lastModified = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("logsConfig".equals(fieldName)) { + deserializedAwsCodeBuildProjectProperties.logsConfig = LogsConfig.fromJson(reader); + } else if ("name".equals(fieldName)) { + deserializedAwsCodeBuildProjectProperties.name = reader.getString(); + } else if ("projectVisibility".equals(fieldName)) { + deserializedAwsCodeBuildProjectProperties.projectVisibility + = ProjectVisibilityTypeEnumValue.fromJson(reader); + } else if ("publicProjectAlias".equals(fieldName)) { + deserializedAwsCodeBuildProjectProperties.publicProjectAlias = reader.getString(); + } else if ("queuedTimeoutInMinutes".equals(fieldName)) { + deserializedAwsCodeBuildProjectProperties.queuedTimeoutInMinutes + = reader.getNullable(JsonReader::getInt); + } else if ("resourceAccessRole".equals(fieldName)) { + deserializedAwsCodeBuildProjectProperties.resourceAccessRole = reader.getString(); + } else if ("secondaryArtifacts".equals(fieldName)) { + List secondaryArtifacts + = reader.readArray(reader1 -> ProjectArtifacts.fromJson(reader1)); + deserializedAwsCodeBuildProjectProperties.secondaryArtifacts = secondaryArtifacts; + } else if ("secondarySourceVersions".equals(fieldName)) { + List secondarySourceVersions + = reader.readArray(reader1 -> ProjectSourceVersion.fromJson(reader1)); + deserializedAwsCodeBuildProjectProperties.secondarySourceVersions = secondarySourceVersions; + } else if ("secondarySources".equals(fieldName)) { + List secondarySources = reader.readArray(reader1 -> ProjectSource.fromJson(reader1)); + deserializedAwsCodeBuildProjectProperties.secondarySources = secondarySources; + } else if ("serviceRole".equals(fieldName)) { + deserializedAwsCodeBuildProjectProperties.serviceRole = reader.getString(); + } else if ("source".equals(fieldName)) { + deserializedAwsCodeBuildProjectProperties.source = ProjectSource.fromJson(reader); + } else if ("sourceVersion".equals(fieldName)) { + deserializedAwsCodeBuildProjectProperties.sourceVersion = reader.getString(); + } else if ("tags".equals(fieldName)) { + List tags = reader.readArray(reader1 -> TagAutoGenerated7.fromJson(reader1)); + deserializedAwsCodeBuildProjectProperties.tags = tags; + } else if ("timeoutInMinutes".equals(fieldName)) { + deserializedAwsCodeBuildProjectProperties.timeoutInMinutes = reader.getNullable(JsonReader::getInt); + } else if ("vpcConfig".equals(fieldName)) { + deserializedAwsCodeBuildProjectProperties.vpcConfig = VpcConfig.fromJson(reader); + } else if ("webhook".equals(fieldName)) { + deserializedAwsCodeBuildProjectProperties.webhook = Webhook.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedAwsCodeBuildProjectProperties; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/AwsCodeBuildSourceCredentialsInfoProperties.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/AwsCodeBuildSourceCredentialsInfoProperties.java new file mode 100644 index 000000000000..0edaa66c3f06 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/AwsCodeBuildSourceCredentialsInfoProperties.java @@ -0,0 +1,196 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of awsCodeBuildSourceCredentialsInfo. + */ +@Fluent +public final class AwsCodeBuildSourceCredentialsInfoProperties + implements JsonSerializable { + /* + *

The Amazon Resource Name (ARN) of the token.

+ */ + private String arn; + + /* + *

The type of authentication used by the credentials. Valid options are OAUTH, BASIC_AUTH, + * PERSONAL_ACCESS_TOKEN, or CODECONNECTIONS.

+ */ + private AuthTypeEnumValue authType; + + /* + *

The connection ARN if your serverType type is GITLAB or GITLAB_SELF_MANAGED and your authType is + * CODECONNECTIONS.

+ */ + private String resource; + + /* + *

The type of source provider. The valid options are GITHUB, GITHUB_ENTERPRISE, GITLAB, GITLAB_SELF_MANAGED, or + * BITBUCKET.

+ */ + private ServerTypeEnumValue serverType; + + /** + * Creates an instance of AwsCodeBuildSourceCredentialsInfoProperties class. + */ + public AwsCodeBuildSourceCredentialsInfoProperties() { + } + + /** + * Get the arn property: <p> The Amazon Resource Name (ARN) of the token. </p>. + * + * @return the arn value. + */ + public String arn() { + return this.arn; + } + + /** + * Set the arn property: <p> The Amazon Resource Name (ARN) of the token. </p>. + * + * @param arn the arn value to set. + * @return the AwsCodeBuildSourceCredentialsInfoProperties object itself. + */ + public AwsCodeBuildSourceCredentialsInfoProperties withArn(String arn) { + this.arn = arn; + return this; + } + + /** + * Get the authType property: <p> The type of authentication used by the credentials. Valid options are OAUTH, + * BASIC_AUTH, PERSONAL_ACCESS_TOKEN, or CODECONNECTIONS. </p>. + * + * @return the authType value. + */ + public AuthTypeEnumValue authType() { + return this.authType; + } + + /** + * Set the authType property: <p> The type of authentication used by the credentials. Valid options are OAUTH, + * BASIC_AUTH, PERSONAL_ACCESS_TOKEN, or CODECONNECTIONS. </p>. + * + * @param authType the authType value to set. + * @return the AwsCodeBuildSourceCredentialsInfoProperties object itself. + */ + public AwsCodeBuildSourceCredentialsInfoProperties withAuthType(AuthTypeEnumValue authType) { + this.authType = authType; + return this; + } + + /** + * Get the resource property: <p>The connection ARN if your serverType type is GITLAB or GITLAB_SELF_MANAGED + * and your authType is CODECONNECTIONS.</p>. + * + * @return the resource value. + */ + public String resource() { + return this.resource; + } + + /** + * Set the resource property: <p>The connection ARN if your serverType type is GITLAB or GITLAB_SELF_MANAGED + * and your authType is CODECONNECTIONS.</p>. + * + * @param resource the resource value to set. + * @return the AwsCodeBuildSourceCredentialsInfoProperties object itself. + */ + public AwsCodeBuildSourceCredentialsInfoProperties withResource(String resource) { + this.resource = resource; + return this; + } + + /** + * Get the serverType property: <p> The type of source provider. The valid options are GITHUB, + * GITHUB_ENTERPRISE, GITLAB, GITLAB_SELF_MANAGED, or BITBUCKET. </p>. + * + * @return the serverType value. + */ + public ServerTypeEnumValue serverType() { + return this.serverType; + } + + /** + * Set the serverType property: <p> The type of source provider. The valid options are GITHUB, + * GITHUB_ENTERPRISE, GITLAB, GITLAB_SELF_MANAGED, or BITBUCKET. </p>. + * + * @param serverType the serverType value to set. + * @return the AwsCodeBuildSourceCredentialsInfoProperties object itself. + */ + public AwsCodeBuildSourceCredentialsInfoProperties withServerType(ServerTypeEnumValue serverType) { + this.serverType = serverType; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (authType() != null) { + authType().validate(); + } + if (serverType() != null) { + serverType().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("arn", this.arn); + jsonWriter.writeJsonField("authType", this.authType); + jsonWriter.writeStringField("resource", this.resource); + jsonWriter.writeJsonField("serverType", this.serverType); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AwsCodeBuildSourceCredentialsInfoProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AwsCodeBuildSourceCredentialsInfoProperties if the JsonReader was pointing to an instance + * of it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the AwsCodeBuildSourceCredentialsInfoProperties. + */ + public static AwsCodeBuildSourceCredentialsInfoProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AwsCodeBuildSourceCredentialsInfoProperties deserializedAwsCodeBuildSourceCredentialsInfoProperties + = new AwsCodeBuildSourceCredentialsInfoProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("arn".equals(fieldName)) { + deserializedAwsCodeBuildSourceCredentialsInfoProperties.arn = reader.getString(); + } else if ("authType".equals(fieldName)) { + deserializedAwsCodeBuildSourceCredentialsInfoProperties.authType + = AuthTypeEnumValue.fromJson(reader); + } else if ("resource".equals(fieldName)) { + deserializedAwsCodeBuildSourceCredentialsInfoProperties.resource = reader.getString(); + } else if ("serverType".equals(fieldName)) { + deserializedAwsCodeBuildSourceCredentialsInfoProperties.serverType + = ServerTypeEnumValue.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedAwsCodeBuildSourceCredentialsInfoProperties; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/AwsConfigServiceConfigurationRecorderProperties.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/AwsConfigServiceConfigurationRecorderProperties.java new file mode 100644 index 000000000000..660ad648ad36 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/AwsConfigServiceConfigurationRecorderProperties.java @@ -0,0 +1,285 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of awsConfigServiceConfigurationRecorder. + */ +@Fluent +public final class AwsConfigServiceConfigurationRecorderProperties + implements JsonSerializable { + /* + *

The name of the configuration recorder. Config automatically assigns the name of 'default' when creating the + * configuration recorder.

You cannot change the name of the configuration recorder after it has been + * created. To change the configuration recorder name, you must delete it and create a new configuration recorder + * with a new name.

+ */ + private String name; + + /* + *

Specifies which resource types Config records for configuration changes.

High Number of + * Config Evaluations

You may notice increased activity in your account during your initial month + * recording with Config when compared to subsequent months. During the initial bootstrapping process, Config runs + * evaluations on all the resources in your account that you have selected for Config to record.

If you are + * running ephemeral workloads, you may see increased activity from Config as it records configuration changes + * associated with creating and deleting these temporary resources. An ephemeral workload is a temporary use + * of computing resources that are loaded and run when needed. Examples include Amazon Elastic Compute Cloud (Amazon + * EC2) Spot Instances, Amazon EMR jobs, and Auto Scaling. If you want to avoid the increased activity from running + * ephemeral workloads, you can run these types of workloads in a separate account with Config turned off to avoid + * increased configuration recording and rule evaluations.

+ */ + private RecordingGroup recordingGroup; + + /* + *

Specifies the default recording frequency that Config uses to record configuration changes. Config supports + * Continuous recording and Daily recording.

  • Continuous recording allows you to + * record configuration changes continuously whenever a change occurs.

  • Daily recording allows you + * to receive a configuration item (CI) representing the most recent state of your resources over the last 24-hour + * period, only if it’s different from the previous CI recorded.

Firewall Manager depends + * on continuous recording to monitor your resources. If you are using Firewall Manager, it is recommended that you + * set the recording frequency to Continuous.

You can also override the recording frequency for + * specific resource types.

+ */ + private RecordingMode recordingMode; + + /* + *

Amazon Resource Name (ARN) of the IAM role assumed by Config and used by the configuration recorder.

+ *

While the API model does not require this field, the server will reject a request without a defined + * roleARN for the configuration recorder.

Pre-existing Config role

+ *

If you have used an Amazon Web Services service that uses Config, such as Security Hub or Control Tower, and + * an Config role has already been created, make sure that the IAM role that you use when setting up Config keeps + * the same minimum permissions as the already created Config role. You must do this so that the other Amazon Web + * Services service continues to run as expected.

For example, if Control Tower has an IAM role that allows + * Config to read Amazon Simple Storage Service (Amazon S3) objects, make sure that the same permissions are granted + * within the IAM role you use when setting up Config. Otherwise, it may interfere with how Control Tower operates. + * For more information about IAM roles for Config, see Identity and Access + * Management for Config in the Config Developer Guide.

+ */ + private String roleArn; + + /** + * Creates an instance of AwsConfigServiceConfigurationRecorderProperties class. + */ + public AwsConfigServiceConfigurationRecorderProperties() { + } + + /** + * Get the name property: <p>The name of the configuration recorder. Config automatically assigns the name of + * 'default' when creating the configuration recorder.</p> <note> <p>You cannot change the name of + * the configuration recorder after it has been created. To change the configuration recorder name, you must delete + * it and create a new configuration recorder with a new name. </p> </note>. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: <p>The name of the configuration recorder. Config automatically assigns the name of + * 'default' when creating the configuration recorder.</p> <note> <p>You cannot change the name of + * the configuration recorder after it has been created. To change the configuration recorder name, you must delete + * it and create a new configuration recorder with a new name. </p> </note>. + * + * @param name the name value to set. + * @return the AwsConfigServiceConfigurationRecorderProperties object itself. + */ + public AwsConfigServiceConfigurationRecorderProperties withName(String name) { + this.name = name; + return this; + } + + /** + * Get the recordingGroup property: <p>Specifies which resource types Config records for configuration + * changes.</p> <note> <p> <b> High Number of Config Evaluations</b> </p> + * <p>You may notice increased activity in your account during your initial month recording with Config when + * compared to subsequent months. During the initial bootstrapping process, Config runs evaluations on all the + * resources in your account that you have selected for Config to record.</p> <p>If you are running + * ephemeral workloads, you may see increased activity from Config as it records configuration changes associated + * with creating and deleting these temporary resources. An <i>ephemeral workload</i> is a temporary use + * of computing resources that are loaded and run when needed. Examples include Amazon Elastic Compute Cloud (Amazon + * EC2) Spot Instances, Amazon EMR jobs, and Auto Scaling. If you want to avoid the increased activity from running + * ephemeral workloads, you can run these types of workloads in a separate account with Config turned off to avoid + * increased configuration recording and rule evaluations.</p> </note>. + * + * @return the recordingGroup value. + */ + public RecordingGroup recordingGroup() { + return this.recordingGroup; + } + + /** + * Set the recordingGroup property: <p>Specifies which resource types Config records for configuration + * changes.</p> <note> <p> <b> High Number of Config Evaluations</b> </p> + * <p>You may notice increased activity in your account during your initial month recording with Config when + * compared to subsequent months. During the initial bootstrapping process, Config runs evaluations on all the + * resources in your account that you have selected for Config to record.</p> <p>If you are running + * ephemeral workloads, you may see increased activity from Config as it records configuration changes associated + * with creating and deleting these temporary resources. An <i>ephemeral workload</i> is a temporary use + * of computing resources that are loaded and run when needed. Examples include Amazon Elastic Compute Cloud (Amazon + * EC2) Spot Instances, Amazon EMR jobs, and Auto Scaling. If you want to avoid the increased activity from running + * ephemeral workloads, you can run these types of workloads in a separate account with Config turned off to avoid + * increased configuration recording and rule evaluations.</p> </note>. + * + * @param recordingGroup the recordingGroup value to set. + * @return the AwsConfigServiceConfigurationRecorderProperties object itself. + */ + public AwsConfigServiceConfigurationRecorderProperties withRecordingGroup(RecordingGroup recordingGroup) { + this.recordingGroup = recordingGroup; + return this; + } + + /** + * Get the recordingMode property: <p>Specifies the default recording frequency that Config uses to record + * configuration changes. Config supports <i>Continuous recording</i> and <i>Daily + * recording</i>.</p> <ul> <li> <p>Continuous recording allows you to record + * configuration changes continuously whenever a change occurs.</p> </li> <li> <p>Daily + * recording allows you to receive a configuration item (CI) representing the most recent state of your resources + * over the last 24-hour period, only if it’s different from the previous CI recorded. </p> </li> + * </ul> <note> <p>Firewall Manager depends on continuous recording to monitor your resources. If + * you are using Firewall Manager, it is recommended that you set the recording frequency to Continuous.</p> + * </note> <p>You can also override the recording frequency for specific resource types.</p>. + * + * @return the recordingMode value. + */ + public RecordingMode recordingMode() { + return this.recordingMode; + } + + /** + * Set the recordingMode property: <p>Specifies the default recording frequency that Config uses to record + * configuration changes. Config supports <i>Continuous recording</i> and <i>Daily + * recording</i>.</p> <ul> <li> <p>Continuous recording allows you to record + * configuration changes continuously whenever a change occurs.</p> </li> <li> <p>Daily + * recording allows you to receive a configuration item (CI) representing the most recent state of your resources + * over the last 24-hour period, only if it’s different from the previous CI recorded. </p> </li> + * </ul> <note> <p>Firewall Manager depends on continuous recording to monitor your resources. If + * you are using Firewall Manager, it is recommended that you set the recording frequency to Continuous.</p> + * </note> <p>You can also override the recording frequency for specific resource types.</p>. + * + * @param recordingMode the recordingMode value to set. + * @return the AwsConfigServiceConfigurationRecorderProperties object itself. + */ + public AwsConfigServiceConfigurationRecorderProperties withRecordingMode(RecordingMode recordingMode) { + this.recordingMode = recordingMode; + return this; + } + + /** + * Get the roleArn property: <p>Amazon Resource Name (ARN) of the IAM role assumed by Config and used by the + * configuration recorder.</p> <note> <p>While the API model does not require this field, the + * server will reject a request without a defined <code>roleARN</code> for the configuration + * recorder.</p> </note> <note> <p> <b>Pre-existing Config role</b> </p> + * <p>If you have used an Amazon Web Services service that uses Config, such as Security Hub or Control Tower, + * and an Config role has already been created, make sure that the IAM role that you use when setting up Config + * keeps the same minimum permissions as the already created Config role. You must do this so that the other Amazon + * Web Services service continues to run as expected. </p> <p>For example, if Control Tower has an IAM + * role that allows Config to read Amazon Simple Storage Service (Amazon S3) objects, make sure that the same + * permissions are granted within the IAM role you use when setting up Config. Otherwise, it may interfere with how + * Control Tower operates. For more information about IAM roles for Config, see <a + * href='https://docs.aws.amazon.com/config/latest/developerguide/security-iam.html'> <b>Identity and + * Access Management for Config</b> </a> in the <i>Config Developer Guide</i>. </p> + * </note>. + * + * @return the roleArn value. + */ + public String roleArn() { + return this.roleArn; + } + + /** + * Set the roleArn property: <p>Amazon Resource Name (ARN) of the IAM role assumed by Config and used by the + * configuration recorder.</p> <note> <p>While the API model does not require this field, the + * server will reject a request without a defined <code>roleARN</code> for the configuration + * recorder.</p> </note> <note> <p> <b>Pre-existing Config role</b> </p> + * <p>If you have used an Amazon Web Services service that uses Config, such as Security Hub or Control Tower, + * and an Config role has already been created, make sure that the IAM role that you use when setting up Config + * keeps the same minimum permissions as the already created Config role. You must do this so that the other Amazon + * Web Services service continues to run as expected. </p> <p>For example, if Control Tower has an IAM + * role that allows Config to read Amazon Simple Storage Service (Amazon S3) objects, make sure that the same + * permissions are granted within the IAM role you use when setting up Config. Otherwise, it may interfere with how + * Control Tower operates. For more information about IAM roles for Config, see <a + * href='https://docs.aws.amazon.com/config/latest/developerguide/security-iam.html'> <b>Identity and + * Access Management for Config</b> </a> in the <i>Config Developer Guide</i>. </p> + * </note>. + * + * @param roleArn the roleArn value to set. + * @return the AwsConfigServiceConfigurationRecorderProperties object itself. + */ + public AwsConfigServiceConfigurationRecorderProperties withRoleArn(String roleArn) { + this.roleArn = roleArn; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (recordingGroup() != null) { + recordingGroup().validate(); + } + if (recordingMode() != null) { + recordingMode().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("name", this.name); + jsonWriter.writeJsonField("recordingGroup", this.recordingGroup); + jsonWriter.writeJsonField("recordingMode", this.recordingMode); + jsonWriter.writeStringField("roleARN", this.roleArn); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AwsConfigServiceConfigurationRecorderProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AwsConfigServiceConfigurationRecorderProperties if the JsonReader was pointing to an + * instance of it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the AwsConfigServiceConfigurationRecorderProperties. + */ + public static AwsConfigServiceConfigurationRecorderProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AwsConfigServiceConfigurationRecorderProperties deserializedAwsConfigServiceConfigurationRecorderProperties + = new AwsConfigServiceConfigurationRecorderProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("name".equals(fieldName)) { + deserializedAwsConfigServiceConfigurationRecorderProperties.name = reader.getString(); + } else if ("recordingGroup".equals(fieldName)) { + deserializedAwsConfigServiceConfigurationRecorderProperties.recordingGroup + = RecordingGroup.fromJson(reader); + } else if ("recordingMode".equals(fieldName)) { + deserializedAwsConfigServiceConfigurationRecorderProperties.recordingMode + = RecordingMode.fromJson(reader); + } else if ("roleARN".equals(fieldName)) { + deserializedAwsConfigServiceConfigurationRecorderProperties.roleArn = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedAwsConfigServiceConfigurationRecorderProperties; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/AwsConfigServiceConfigurationRecorderStatusProperties.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/AwsConfigServiceConfigurationRecorderStatusProperties.java new file mode 100644 index 000000000000..0be030f69a53 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/AwsConfigServiceConfigurationRecorderStatusProperties.java @@ -0,0 +1,317 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.time.OffsetDateTime; +import java.time.format.DateTimeFormatter; + +/** + * Definition of awsConfigServiceConfigurationRecorderStatus. + */ +@Fluent +public final class AwsConfigServiceConfigurationRecorderStatusProperties + implements JsonSerializable { + /* + *

The latest error code from when the recorder last failed.

+ */ + private String lastErrorCode; + + /* + *

The latest error message from when the recorder last failed.

+ */ + private String lastErrorMessage; + + /* + *

The time the recorder was last started.

+ */ + private OffsetDateTime lastStartTime; + + /* + *

The status of the latest recording event processed by the recorder.

+ */ + private RecorderStatusEnumValue lastStatus; + + /* + *

The time of the latest change in status of an recording event processed by the recorder.

+ */ + private OffsetDateTime lastStatusChangeTime; + + /* + *

The time the recorder was last stopped.

+ */ + private OffsetDateTime lastStopTime; + + /* + *

The name of the configuration recorder.

+ */ + private String name; + + /* + *

Specifies whether or not the recorder is currently recording.

+ */ + private Boolean recording; + + /** + * Creates an instance of AwsConfigServiceConfigurationRecorderStatusProperties class. + */ + public AwsConfigServiceConfigurationRecorderStatusProperties() { + } + + /** + * Get the lastErrorCode property: <p>The latest error code from when the recorder last failed.</p>. + * + * @return the lastErrorCode value. + */ + public String lastErrorCode() { + return this.lastErrorCode; + } + + /** + * Set the lastErrorCode property: <p>The latest error code from when the recorder last failed.</p>. + * + * @param lastErrorCode the lastErrorCode value to set. + * @return the AwsConfigServiceConfigurationRecorderStatusProperties object itself. + */ + public AwsConfigServiceConfigurationRecorderStatusProperties withLastErrorCode(String lastErrorCode) { + this.lastErrorCode = lastErrorCode; + return this; + } + + /** + * Get the lastErrorMessage property: <p>The latest error message from when the recorder last + * failed.</p>. + * + * @return the lastErrorMessage value. + */ + public String lastErrorMessage() { + return this.lastErrorMessage; + } + + /** + * Set the lastErrorMessage property: <p>The latest error message from when the recorder last + * failed.</p>. + * + * @param lastErrorMessage the lastErrorMessage value to set. + * @return the AwsConfigServiceConfigurationRecorderStatusProperties object itself. + */ + public AwsConfigServiceConfigurationRecorderStatusProperties withLastErrorMessage(String lastErrorMessage) { + this.lastErrorMessage = lastErrorMessage; + return this; + } + + /** + * Get the lastStartTime property: <p>The time the recorder was last started.</p>. + * + * @return the lastStartTime value. + */ + public OffsetDateTime lastStartTime() { + return this.lastStartTime; + } + + /** + * Set the lastStartTime property: <p>The time the recorder was last started.</p>. + * + * @param lastStartTime the lastStartTime value to set. + * @return the AwsConfigServiceConfigurationRecorderStatusProperties object itself. + */ + public AwsConfigServiceConfigurationRecorderStatusProperties withLastStartTime(OffsetDateTime lastStartTime) { + this.lastStartTime = lastStartTime; + return this; + } + + /** + * Get the lastStatus property: <p>The status of the latest recording event processed by the + * recorder.</p>. + * + * @return the lastStatus value. + */ + public RecorderStatusEnumValue lastStatus() { + return this.lastStatus; + } + + /** + * Set the lastStatus property: <p>The status of the latest recording event processed by the + * recorder.</p>. + * + * @param lastStatus the lastStatus value to set. + * @return the AwsConfigServiceConfigurationRecorderStatusProperties object itself. + */ + public AwsConfigServiceConfigurationRecorderStatusProperties withLastStatus(RecorderStatusEnumValue lastStatus) { + this.lastStatus = lastStatus; + return this; + } + + /** + * Get the lastStatusChangeTime property: <p>The time of the latest change in status of an recording event + * processed by the recorder.</p>. + * + * @return the lastStatusChangeTime value. + */ + public OffsetDateTime lastStatusChangeTime() { + return this.lastStatusChangeTime; + } + + /** + * Set the lastStatusChangeTime property: <p>The time of the latest change in status of an recording event + * processed by the recorder.</p>. + * + * @param lastStatusChangeTime the lastStatusChangeTime value to set. + * @return the AwsConfigServiceConfigurationRecorderStatusProperties object itself. + */ + public AwsConfigServiceConfigurationRecorderStatusProperties + withLastStatusChangeTime(OffsetDateTime lastStatusChangeTime) { + this.lastStatusChangeTime = lastStatusChangeTime; + return this; + } + + /** + * Get the lastStopTime property: <p>The time the recorder was last stopped.</p>. + * + * @return the lastStopTime value. + */ + public OffsetDateTime lastStopTime() { + return this.lastStopTime; + } + + /** + * Set the lastStopTime property: <p>The time the recorder was last stopped.</p>. + * + * @param lastStopTime the lastStopTime value to set. + * @return the AwsConfigServiceConfigurationRecorderStatusProperties object itself. + */ + public AwsConfigServiceConfigurationRecorderStatusProperties withLastStopTime(OffsetDateTime lastStopTime) { + this.lastStopTime = lastStopTime; + return this; + } + + /** + * Get the name property: <p>The name of the configuration recorder.</p>. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: <p>The name of the configuration recorder.</p>. + * + * @param name the name value to set. + * @return the AwsConfigServiceConfigurationRecorderStatusProperties object itself. + */ + public AwsConfigServiceConfigurationRecorderStatusProperties withName(String name) { + this.name = name; + return this; + } + + /** + * Get the recording property: <p>Specifies whether or not the recorder is currently recording.</p>. + * + * @return the recording value. + */ + public Boolean recording() { + return this.recording; + } + + /** + * Set the recording property: <p>Specifies whether or not the recorder is currently recording.</p>. + * + * @param recording the recording value to set. + * @return the AwsConfigServiceConfigurationRecorderStatusProperties object itself. + */ + public AwsConfigServiceConfigurationRecorderStatusProperties withRecording(Boolean recording) { + this.recording = recording; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (lastStatus() != null) { + lastStatus().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("lastErrorCode", this.lastErrorCode); + jsonWriter.writeStringField("lastErrorMessage", this.lastErrorMessage); + jsonWriter.writeStringField("lastStartTime", + this.lastStartTime == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.lastStartTime)); + jsonWriter.writeJsonField("lastStatus", this.lastStatus); + jsonWriter.writeStringField("lastStatusChangeTime", + this.lastStatusChangeTime == null + ? null + : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.lastStatusChangeTime)); + jsonWriter.writeStringField("lastStopTime", + this.lastStopTime == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.lastStopTime)); + jsonWriter.writeStringField("name", this.name); + jsonWriter.writeBooleanField("recording", this.recording); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AwsConfigServiceConfigurationRecorderStatusProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AwsConfigServiceConfigurationRecorderStatusProperties if the JsonReader was pointing to an + * instance of it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the AwsConfigServiceConfigurationRecorderStatusProperties. + */ + public static AwsConfigServiceConfigurationRecorderStatusProperties fromJson(JsonReader jsonReader) + throws IOException { + return jsonReader.readObject(reader -> { + AwsConfigServiceConfigurationRecorderStatusProperties deserializedAwsConfigServiceConfigurationRecorderStatusProperties + = new AwsConfigServiceConfigurationRecorderStatusProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("lastErrorCode".equals(fieldName)) { + deserializedAwsConfigServiceConfigurationRecorderStatusProperties.lastErrorCode + = reader.getString(); + } else if ("lastErrorMessage".equals(fieldName)) { + deserializedAwsConfigServiceConfigurationRecorderStatusProperties.lastErrorMessage + = reader.getString(); + } else if ("lastStartTime".equals(fieldName)) { + deserializedAwsConfigServiceConfigurationRecorderStatusProperties.lastStartTime = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("lastStatus".equals(fieldName)) { + deserializedAwsConfigServiceConfigurationRecorderStatusProperties.lastStatus + = RecorderStatusEnumValue.fromJson(reader); + } else if ("lastStatusChangeTime".equals(fieldName)) { + deserializedAwsConfigServiceConfigurationRecorderStatusProperties.lastStatusChangeTime = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("lastStopTime".equals(fieldName)) { + deserializedAwsConfigServiceConfigurationRecorderStatusProperties.lastStopTime = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("name".equals(fieldName)) { + deserializedAwsConfigServiceConfigurationRecorderStatusProperties.name = reader.getString(); + } else if ("recording".equals(fieldName)) { + deserializedAwsConfigServiceConfigurationRecorderStatusProperties.recording + = reader.getNullable(JsonReader::getBoolean); + } else { + reader.skipChildren(); + } + } + + return deserializedAwsConfigServiceConfigurationRecorderStatusProperties; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/AwsConfigServiceDeliveryChannelProperties.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/AwsConfigServiceDeliveryChannelProperties.java new file mode 100644 index 000000000000..2ab3e28c1e01 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/AwsConfigServiceDeliveryChannelProperties.java @@ -0,0 +1,282 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of awsConfigServiceDeliveryChannel. + */ +@Fluent +public final class AwsConfigServiceDeliveryChannelProperties + implements JsonSerializable { + /* + *

The options for how often Config delivers configuration snapshots to the Amazon S3 bucket.

+ */ + private ConfigSnapshotDeliveryProperties configSnapshotDeliveryProperties; + + /* + *

The name of the delivery channel. By default, Config assigns the name 'default' when creating the delivery + * channel. To change the delivery channel name, you must use the DeleteDeliveryChannel action to delete your + * current delivery channel, and then you must use the PutDeliveryChannel command to create a delivery channel that + * has the desired name.

+ */ + private String name; + + /* + *

The name of the Amazon S3 bucket to which Config delivers configuration snapshots and configuration history + * files.

If you specify a bucket that belongs to another Amazon Web Services account, that bucket must have + * policies that grant access permissions to Config. For more information, see Permissions for the Amazon + * S3 Bucket in the Config Developer Guide.

+ */ + private String s3BucketName; + + /* + *

The prefix for the specified Amazon S3 bucket.

+ */ + private String s3KeyPrefix; + + /* + *

The Amazon Resource Name (ARN) of the Key Management Service (KMS ) KMS key (KMS key) used to encrypt objects + * delivered by Config. Must belong to the same Region as the destination S3 bucket.

+ */ + private String s3KmsKeyArn; + + /* + *

The Amazon Resource Name (ARN) of the Amazon SNS topic to which Config sends notifications about configuration + * changes.

If you choose a topic from another account, the topic must have policies that grant access + * permissions to Config. For more information, see Permissions for the Amazon + * SNS Topic in the Config Developer Guide.

+ */ + private String snsTopicArn; + + /** + * Creates an instance of AwsConfigServiceDeliveryChannelProperties class. + */ + public AwsConfigServiceDeliveryChannelProperties() { + } + + /** + * Get the configSnapshotDeliveryProperties property: <p>The options for how often Config delivers + * configuration snapshots to the Amazon S3 bucket.</p>. + * + * @return the configSnapshotDeliveryProperties value. + */ + public ConfigSnapshotDeliveryProperties configSnapshotDeliveryProperties() { + return this.configSnapshotDeliveryProperties; + } + + /** + * Set the configSnapshotDeliveryProperties property: <p>The options for how often Config delivers + * configuration snapshots to the Amazon S3 bucket.</p>. + * + * @param configSnapshotDeliveryProperties the configSnapshotDeliveryProperties value to set. + * @return the AwsConfigServiceDeliveryChannelProperties object itself. + */ + public AwsConfigServiceDeliveryChannelProperties + withConfigSnapshotDeliveryProperties(ConfigSnapshotDeliveryProperties configSnapshotDeliveryProperties) { + this.configSnapshotDeliveryProperties = configSnapshotDeliveryProperties; + return this; + } + + /** + * Get the name property: <p>The name of the delivery channel. By default, Config assigns the name 'default' + * when creating the delivery channel. To change the delivery channel name, you must use the DeleteDeliveryChannel + * action to delete your current delivery channel, and then you must use the PutDeliveryChannel command to create a + * delivery channel that has the desired name.</p>. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: <p>The name of the delivery channel. By default, Config assigns the name 'default' + * when creating the delivery channel. To change the delivery channel name, you must use the DeleteDeliveryChannel + * action to delete your current delivery channel, and then you must use the PutDeliveryChannel command to create a + * delivery channel that has the desired name.</p>. + * + * @param name the name value to set. + * @return the AwsConfigServiceDeliveryChannelProperties object itself. + */ + public AwsConfigServiceDeliveryChannelProperties withName(String name) { + this.name = name; + return this; + } + + /** + * Get the s3BucketName property: <p>The name of the Amazon S3 bucket to which Config delivers configuration + * snapshots and configuration history files.</p> <p>If you specify a bucket that belongs to another + * Amazon Web Services account, that bucket must have policies that grant access permissions to Config. For more + * information, see <a + * href='https://docs.aws.amazon.com/config/latest/developerguide/s3-bucket-policy.html'>Permissions for the + * Amazon S3 Bucket</a> in the <i>Config Developer Guide</i>.</p>. + * + * @return the s3BucketName value. + */ + public String s3BucketName() { + return this.s3BucketName; + } + + /** + * Set the s3BucketName property: <p>The name of the Amazon S3 bucket to which Config delivers configuration + * snapshots and configuration history files.</p> <p>If you specify a bucket that belongs to another + * Amazon Web Services account, that bucket must have policies that grant access permissions to Config. For more + * information, see <a + * href='https://docs.aws.amazon.com/config/latest/developerguide/s3-bucket-policy.html'>Permissions for the + * Amazon S3 Bucket</a> in the <i>Config Developer Guide</i>.</p>. + * + * @param s3BucketName the s3BucketName value to set. + * @return the AwsConfigServiceDeliveryChannelProperties object itself. + */ + public AwsConfigServiceDeliveryChannelProperties withS3BucketName(String s3BucketName) { + this.s3BucketName = s3BucketName; + return this; + } + + /** + * Get the s3KeyPrefix property: <p>The prefix for the specified Amazon S3 bucket.</p>. + * + * @return the s3KeyPrefix value. + */ + public String s3KeyPrefix() { + return this.s3KeyPrefix; + } + + /** + * Set the s3KeyPrefix property: <p>The prefix for the specified Amazon S3 bucket.</p>. + * + * @param s3KeyPrefix the s3KeyPrefix value to set. + * @return the AwsConfigServiceDeliveryChannelProperties object itself. + */ + public AwsConfigServiceDeliveryChannelProperties withS3KeyPrefix(String s3KeyPrefix) { + this.s3KeyPrefix = s3KeyPrefix; + return this; + } + + /** + * Get the s3KmsKeyArn property: <p>The Amazon Resource Name (ARN) of the Key Management Service (KMS ) KMS + * key (KMS key) used to encrypt objects delivered by Config. Must belong to the same Region as the destination S3 + * bucket.</p>. + * + * @return the s3KmsKeyArn value. + */ + public String s3KmsKeyArn() { + return this.s3KmsKeyArn; + } + + /** + * Set the s3KmsKeyArn property: <p>The Amazon Resource Name (ARN) of the Key Management Service (KMS ) KMS + * key (KMS key) used to encrypt objects delivered by Config. Must belong to the same Region as the destination S3 + * bucket.</p>. + * + * @param s3KmsKeyArn the s3KmsKeyArn value to set. + * @return the AwsConfigServiceDeliveryChannelProperties object itself. + */ + public AwsConfigServiceDeliveryChannelProperties withS3KmsKeyArn(String s3KmsKeyArn) { + this.s3KmsKeyArn = s3KmsKeyArn; + return this; + } + + /** + * Get the snsTopicArn property: <p>The Amazon Resource Name (ARN) of the Amazon SNS topic to which Config + * sends notifications about configuration changes.</p> <p>If you choose a topic from another account, + * the topic must have policies that grant access permissions to Config. For more information, see <a + * href='https://docs.aws.amazon.com/config/latest/developerguide/sns-topic-policy.html'>Permissions for the + * Amazon SNS Topic</a> in the <i>Config Developer Guide</i>.</p>. + * + * @return the snsTopicArn value. + */ + public String snsTopicArn() { + return this.snsTopicArn; + } + + /** + * Set the snsTopicArn property: <p>The Amazon Resource Name (ARN) of the Amazon SNS topic to which Config + * sends notifications about configuration changes.</p> <p>If you choose a topic from another account, + * the topic must have policies that grant access permissions to Config. For more information, see <a + * href='https://docs.aws.amazon.com/config/latest/developerguide/sns-topic-policy.html'>Permissions for the + * Amazon SNS Topic</a> in the <i>Config Developer Guide</i>.</p>. + * + * @param snsTopicArn the snsTopicArn value to set. + * @return the AwsConfigServiceDeliveryChannelProperties object itself. + */ + public AwsConfigServiceDeliveryChannelProperties withSnsTopicArn(String snsTopicArn) { + this.snsTopicArn = snsTopicArn; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (configSnapshotDeliveryProperties() != null) { + configSnapshotDeliveryProperties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("configSnapshotDeliveryProperties", this.configSnapshotDeliveryProperties); + jsonWriter.writeStringField("name", this.name); + jsonWriter.writeStringField("s3BucketName", this.s3BucketName); + jsonWriter.writeStringField("s3KeyPrefix", this.s3KeyPrefix); + jsonWriter.writeStringField("s3KmsKeyArn", this.s3KmsKeyArn); + jsonWriter.writeStringField("snsTopicARN", this.snsTopicArn); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AwsConfigServiceDeliveryChannelProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AwsConfigServiceDeliveryChannelProperties if the JsonReader was pointing to an instance of + * it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the AwsConfigServiceDeliveryChannelProperties. + */ + public static AwsConfigServiceDeliveryChannelProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AwsConfigServiceDeliveryChannelProperties deserializedAwsConfigServiceDeliveryChannelProperties + = new AwsConfigServiceDeliveryChannelProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("configSnapshotDeliveryProperties".equals(fieldName)) { + deserializedAwsConfigServiceDeliveryChannelProperties.configSnapshotDeliveryProperties + = ConfigSnapshotDeliveryProperties.fromJson(reader); + } else if ("name".equals(fieldName)) { + deserializedAwsConfigServiceDeliveryChannelProperties.name = reader.getString(); + } else if ("s3BucketName".equals(fieldName)) { + deserializedAwsConfigServiceDeliveryChannelProperties.s3BucketName = reader.getString(); + } else if ("s3KeyPrefix".equals(fieldName)) { + deserializedAwsConfigServiceDeliveryChannelProperties.s3KeyPrefix = reader.getString(); + } else if ("s3KmsKeyArn".equals(fieldName)) { + deserializedAwsConfigServiceDeliveryChannelProperties.s3KmsKeyArn = reader.getString(); + } else if ("snsTopicARN".equals(fieldName)) { + deserializedAwsConfigServiceDeliveryChannelProperties.snsTopicArn = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedAwsConfigServiceDeliveryChannelProperties; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/AwsDatabaseMigrationServiceReplicationInstanceProperties.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/AwsDatabaseMigrationServiceReplicationInstanceProperties.java new file mode 100644 index 000000000000..bf6eb5dc923c --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/AwsDatabaseMigrationServiceReplicationInstanceProperties.java @@ -0,0 +1,955 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.time.OffsetDateTime; +import java.time.format.DateTimeFormatter; +import java.util.List; + +/** + * Definition of awsDatabaseMigrationServiceReplicationInstance. + */ +@Fluent +public final class AwsDatabaseMigrationServiceReplicationInstanceProperties + implements JsonSerializable { + /* + *

The amount of storage (in gigabytes) that is allocated for the replication instance.

+ */ + private Integer allocatedStorage; + + /* + *

Boolean value indicating if minor version upgrades will be automatically applied to the instance.

+ */ + private Boolean autoMinorVersionUpgrade; + + /* + *

The Availability Zone for the instance.

+ */ + private String availabilityZone; + + /* + *

The DNS name servers supported for the replication instance to access your on-premise source or target + * database.

+ */ + private String dnsNameServers; + + /* + *

The engine version number of the replication instance.

If an engine version number is not specified + * when a replication instance is created, the default is the latest engine version available.

When modifying + * a major engine version of an instance, also set AllowMajorVersionUpgrade to true.

+ */ + private String engineVersion; + + /* + *

The expiration date of the free replication instance that is part of the Free DMS program.

+ */ + private OffsetDateTime freeUntil; + + /* + *

The time the replication instance was created.

+ */ + private OffsetDateTime instanceCreateTime; + + /* + *

An KMS key identifier that is used to encrypt the data on the replication instance.

If you don't + * specify a value for the KmsKeyId parameter, then DMS uses your default encryption key.

KMS + * creates the default encryption key for your Amazon Web Services account. Your Amazon Web Services account has a + * different default encryption key for each Amazon Web Services Region.

+ */ + private String kmsKeyId; + + /* + *

Specifies whether the replication instance is a Multi-AZ deployment. You can't set the + * AvailabilityZone parameter if the Multi-AZ parameter is set to true.

+ */ + private Boolean multiAZ; + + /* + *

The type of IP address protocol used by a replication instance, such as IPv4 only or Dual-stack that supports + * both IPv4 and IPv6 addressing. IPv6 only is not yet supported.

+ */ + private String networkType; + + /* + *

The pending modification values.

+ */ + private ReplicationPendingModifiedValues pendingModifiedValues; + + /* + *

The maintenance window times for the replication instance. Any pending upgrades to the replication instance + * are performed during this time.

+ */ + private String preferredMaintenanceWindow; + + /* + *

Specifies the accessibility options for the replication instance. A value of true represents an + * instance with a public IP address. A value of false represents an instance with a private IP + * address. The default value is true.

+ */ + private Boolean publiclyAccessible; + + /* + *

The Amazon Resource Name (ARN) of the replication instance.

+ */ + private String replicationInstanceArn; + + /* + *

The compute and memory capacity of the replication instance as defined for the specified replication instance + * class. It is a required parameter, although a default value is pre-selected in the DMS console.

For more + * information on the settings and capacities for the available replication instance classes, see Selecting the right DMS replication instance for your migration.

+ */ + private String replicationInstanceClass; + + /* + *

The replication instance identifier is a required parameter. This parameter is stored as a lowercase + * string.

Constraints:

  • Must contain 1-63 alphanumeric characters or hyphens.

  • + *

    First character must be a letter.

  • Cannot end with a hyphen or contain two consecutive + * hyphens.

Example: myrepinstance

+ */ + private String replicationInstanceIdentifier; + + /* + *

One or more IPv6 addresses for the replication instance.

+ */ + private List replicationInstanceIpv6Addresses; + + /* + *

The private IP address of the replication instance.

+ */ + private String replicationInstancePrivateIpAddress; + + /* + *

One or more private IP addresses for the replication instance.

+ */ + private List replicationInstancePrivateIpAddresses; + + /* + *

The public IP address of the replication instance.

+ */ + private String replicationInstancePublicIpAddress; + + /* + *

One or more public IP addresses for the replication instance.

+ */ + private List replicationInstancePublicIpAddresses; + + /* + *

The status of the replication instance. The possible return values include:

  • + * 'available'

  • 'creating'

  • 'deleted' + *

  • 'deleting'

  • 'failed'

  • + * 'modifying'

  • 'upgrading'

  • + * 'rebooting'

  • 'resetting-master-credentials'

  • + * 'storage-full'

  • 'incompatible-credentials'

  • + * 'incompatible-network'

  • 'maintenance'

+ */ + private String replicationInstanceStatus; + + /* + *

The subnet group for the replication instance.

+ */ + private ReplicationSubnetGroup replicationSubnetGroup; + + /* + *

The Availability Zone of the standby replication instance in a Multi-AZ deployment.

+ */ + private String secondaryAvailabilityZone; + + /* + *

The VPC security group for the instance.

+ */ + private List vpcSecurityGroups; + + /** + * Creates an instance of AwsDatabaseMigrationServiceReplicationInstanceProperties class. + */ + public AwsDatabaseMigrationServiceReplicationInstanceProperties() { + } + + /** + * Get the allocatedStorage property: <p>The amount of storage (in gigabytes) that is allocated for the + * replication instance.</p>. + * + * @return the allocatedStorage value. + */ + public Integer allocatedStorage() { + return this.allocatedStorage; + } + + /** + * Set the allocatedStorage property: <p>The amount of storage (in gigabytes) that is allocated for the + * replication instance.</p>. + * + * @param allocatedStorage the allocatedStorage value to set. + * @return the AwsDatabaseMigrationServiceReplicationInstanceProperties object itself. + */ + public AwsDatabaseMigrationServiceReplicationInstanceProperties withAllocatedStorage(Integer allocatedStorage) { + this.allocatedStorage = allocatedStorage; + return this; + } + + /** + * Get the autoMinorVersionUpgrade property: <p>Boolean value indicating if minor version upgrades will be + * automatically applied to the instance.</p>. + * + * @return the autoMinorVersionUpgrade value. + */ + public Boolean autoMinorVersionUpgrade() { + return this.autoMinorVersionUpgrade; + } + + /** + * Set the autoMinorVersionUpgrade property: <p>Boolean value indicating if minor version upgrades will be + * automatically applied to the instance.</p>. + * + * @param autoMinorVersionUpgrade the autoMinorVersionUpgrade value to set. + * @return the AwsDatabaseMigrationServiceReplicationInstanceProperties object itself. + */ + public AwsDatabaseMigrationServiceReplicationInstanceProperties + withAutoMinorVersionUpgrade(Boolean autoMinorVersionUpgrade) { + this.autoMinorVersionUpgrade = autoMinorVersionUpgrade; + return this; + } + + /** + * Get the availabilityZone property: <p>The Availability Zone for the instance.</p>. + * + * @return the availabilityZone value. + */ + public String availabilityZone() { + return this.availabilityZone; + } + + /** + * Set the availabilityZone property: <p>The Availability Zone for the instance.</p>. + * + * @param availabilityZone the availabilityZone value to set. + * @return the AwsDatabaseMigrationServiceReplicationInstanceProperties object itself. + */ + public AwsDatabaseMigrationServiceReplicationInstanceProperties withAvailabilityZone(String availabilityZone) { + this.availabilityZone = availabilityZone; + return this; + } + + /** + * Get the dnsNameServers property: <p>The DNS name servers supported for the replication instance to access + * your on-premise source or target database.</p>. + * + * @return the dnsNameServers value. + */ + public String dnsNameServers() { + return this.dnsNameServers; + } + + /** + * Set the dnsNameServers property: <p>The DNS name servers supported for the replication instance to access + * your on-premise source or target database.</p>. + * + * @param dnsNameServers the dnsNameServers value to set. + * @return the AwsDatabaseMigrationServiceReplicationInstanceProperties object itself. + */ + public AwsDatabaseMigrationServiceReplicationInstanceProperties withDnsNameServers(String dnsNameServers) { + this.dnsNameServers = dnsNameServers; + return this; + } + + /** + * Get the engineVersion property: <p>The engine version number of the replication instance.</p> + * <p>If an engine version number is not specified when a replication instance is created, the default is the + * latest engine version available.</p> <p>When modifying a major engine version of an instance, also + * set <code>AllowMajorVersionUpgrade</code> to <code>true</code>.</p>. + * + * @return the engineVersion value. + */ + public String engineVersion() { + return this.engineVersion; + } + + /** + * Set the engineVersion property: <p>The engine version number of the replication instance.</p> + * <p>If an engine version number is not specified when a replication instance is created, the default is the + * latest engine version available.</p> <p>When modifying a major engine version of an instance, also + * set <code>AllowMajorVersionUpgrade</code> to <code>true</code>.</p>. + * + * @param engineVersion the engineVersion value to set. + * @return the AwsDatabaseMigrationServiceReplicationInstanceProperties object itself. + */ + public AwsDatabaseMigrationServiceReplicationInstanceProperties withEngineVersion(String engineVersion) { + this.engineVersion = engineVersion; + return this; + } + + /** + * Get the freeUntil property: <p> The expiration date of the free replication instance that is part of the + * Free DMS program. </p>. + * + * @return the freeUntil value. + */ + public OffsetDateTime freeUntil() { + return this.freeUntil; + } + + /** + * Set the freeUntil property: <p> The expiration date of the free replication instance that is part of the + * Free DMS program. </p>. + * + * @param freeUntil the freeUntil value to set. + * @return the AwsDatabaseMigrationServiceReplicationInstanceProperties object itself. + */ + public AwsDatabaseMigrationServiceReplicationInstanceProperties withFreeUntil(OffsetDateTime freeUntil) { + this.freeUntil = freeUntil; + return this; + } + + /** + * Get the instanceCreateTime property: <p>The time the replication instance was created.</p>. + * + * @return the instanceCreateTime value. + */ + public OffsetDateTime instanceCreateTime() { + return this.instanceCreateTime; + } + + /** + * Set the instanceCreateTime property: <p>The time the replication instance was created.</p>. + * + * @param instanceCreateTime the instanceCreateTime value to set. + * @return the AwsDatabaseMigrationServiceReplicationInstanceProperties object itself. + */ + public AwsDatabaseMigrationServiceReplicationInstanceProperties + withInstanceCreateTime(OffsetDateTime instanceCreateTime) { + this.instanceCreateTime = instanceCreateTime; + return this; + } + + /** + * Get the kmsKeyId property: <p>An KMS key identifier that is used to encrypt the data on the replication + * instance.</p> <p>If you don't specify a value for the <code>KmsKeyId</code> parameter, + * then DMS uses your default encryption key.</p> <p>KMS creates the default encryption key for your + * Amazon Web Services account. Your Amazon Web Services account has a different default encryption key for each + * Amazon Web Services Region.</p>. + * + * @return the kmsKeyId value. + */ + public String kmsKeyId() { + return this.kmsKeyId; + } + + /** + * Set the kmsKeyId property: <p>An KMS key identifier that is used to encrypt the data on the replication + * instance.</p> <p>If you don't specify a value for the <code>KmsKeyId</code> parameter, + * then DMS uses your default encryption key.</p> <p>KMS creates the default encryption key for your + * Amazon Web Services account. Your Amazon Web Services account has a different default encryption key for each + * Amazon Web Services Region.</p>. + * + * @param kmsKeyId the kmsKeyId value to set. + * @return the AwsDatabaseMigrationServiceReplicationInstanceProperties object itself. + */ + public AwsDatabaseMigrationServiceReplicationInstanceProperties withKmsKeyId(String kmsKeyId) { + this.kmsKeyId = kmsKeyId; + return this; + } + + /** + * Get the multiAZ property: <p> Specifies whether the replication instance is a Multi-AZ deployment. You + * can't set the <code>AvailabilityZone</code> parameter if the Multi-AZ parameter is set to + * <code>true</code>. </p>. + * + * @return the multiAZ value. + */ + public Boolean multiAZ() { + return this.multiAZ; + } + + /** + * Set the multiAZ property: <p> Specifies whether the replication instance is a Multi-AZ deployment. You + * can't set the <code>AvailabilityZone</code> parameter if the Multi-AZ parameter is set to + * <code>true</code>. </p>. + * + * @param multiAZ the multiAZ value to set. + * @return the AwsDatabaseMigrationServiceReplicationInstanceProperties object itself. + */ + public AwsDatabaseMigrationServiceReplicationInstanceProperties withMultiAZ(Boolean multiAZ) { + this.multiAZ = multiAZ; + return this; + } + + /** + * Get the networkType property: <p>The type of IP address protocol used by a replication instance, such as + * IPv4 only or Dual-stack that supports both IPv4 and IPv6 addressing. IPv6 only is not yet supported.</p>. + * + * @return the networkType value. + */ + public String networkType() { + return this.networkType; + } + + /** + * Set the networkType property: <p>The type of IP address protocol used by a replication instance, such as + * IPv4 only or Dual-stack that supports both IPv4 and IPv6 addressing. IPv6 only is not yet supported.</p>. + * + * @param networkType the networkType value to set. + * @return the AwsDatabaseMigrationServiceReplicationInstanceProperties object itself. + */ + public AwsDatabaseMigrationServiceReplicationInstanceProperties withNetworkType(String networkType) { + this.networkType = networkType; + return this; + } + + /** + * Get the pendingModifiedValues property: <p>The pending modification values.</p>. + * + * @return the pendingModifiedValues value. + */ + public ReplicationPendingModifiedValues pendingModifiedValues() { + return this.pendingModifiedValues; + } + + /** + * Set the pendingModifiedValues property: <p>The pending modification values.</p>. + * + * @param pendingModifiedValues the pendingModifiedValues value to set. + * @return the AwsDatabaseMigrationServiceReplicationInstanceProperties object itself. + */ + public AwsDatabaseMigrationServiceReplicationInstanceProperties + withPendingModifiedValues(ReplicationPendingModifiedValues pendingModifiedValues) { + this.pendingModifiedValues = pendingModifiedValues; + return this; + } + + /** + * Get the preferredMaintenanceWindow property: <p>The maintenance window times for the replication instance. + * Any pending upgrades to the replication instance are performed during this time.</p>. + * + * @return the preferredMaintenanceWindow value. + */ + public String preferredMaintenanceWindow() { + return this.preferredMaintenanceWindow; + } + + /** + * Set the preferredMaintenanceWindow property: <p>The maintenance window times for the replication instance. + * Any pending upgrades to the replication instance are performed during this time.</p>. + * + * @param preferredMaintenanceWindow the preferredMaintenanceWindow value to set. + * @return the AwsDatabaseMigrationServiceReplicationInstanceProperties object itself. + */ + public AwsDatabaseMigrationServiceReplicationInstanceProperties + withPreferredMaintenanceWindow(String preferredMaintenanceWindow) { + this.preferredMaintenanceWindow = preferredMaintenanceWindow; + return this; + } + + /** + * Get the publiclyAccessible property: <p> Specifies the accessibility options for the replication instance. + * A value of <code>true</code> represents an instance with a public IP address. A value of + * <code>false</code> represents an instance with a private IP address. The default value is + * <code>true</code>. </p>. + * + * @return the publiclyAccessible value. + */ + public Boolean publiclyAccessible() { + return this.publiclyAccessible; + } + + /** + * Set the publiclyAccessible property: <p> Specifies the accessibility options for the replication instance. + * A value of <code>true</code> represents an instance with a public IP address. A value of + * <code>false</code> represents an instance with a private IP address. The default value is + * <code>true</code>. </p>. + * + * @param publiclyAccessible the publiclyAccessible value to set. + * @return the AwsDatabaseMigrationServiceReplicationInstanceProperties object itself. + */ + public AwsDatabaseMigrationServiceReplicationInstanceProperties withPubliclyAccessible(Boolean publiclyAccessible) { + this.publiclyAccessible = publiclyAccessible; + return this; + } + + /** + * Get the replicationInstanceArn property: <p>The Amazon Resource Name (ARN) of the replication + * instance.</p>. + * + * @return the replicationInstanceArn value. + */ + public String replicationInstanceArn() { + return this.replicationInstanceArn; + } + + /** + * Set the replicationInstanceArn property: <p>The Amazon Resource Name (ARN) of the replication + * instance.</p>. + * + * @param replicationInstanceArn the replicationInstanceArn value to set. + * @return the AwsDatabaseMigrationServiceReplicationInstanceProperties object itself. + */ + public AwsDatabaseMigrationServiceReplicationInstanceProperties + withReplicationInstanceArn(String replicationInstanceArn) { + this.replicationInstanceArn = replicationInstanceArn; + return this; + } + + /** + * Get the replicationInstanceClass property: <p>The compute and memory capacity of the replication instance + * as defined for the specified replication instance class. It is a required parameter, although a default value is + * pre-selected in the DMS console.</p> <p>For more information on the settings and capacities for the + * available replication instance classes, see <a + * href='https://docs.aws.amazon.com/dms/latest/userguide/CHAP_ReplicationInstance.html#CHAP_ReplicationInstance.InDepth'> + * Selecting the right DMS replication instance for your migration</a>. </p>. + * + * @return the replicationInstanceClass value. + */ + public String replicationInstanceClass() { + return this.replicationInstanceClass; + } + + /** + * Set the replicationInstanceClass property: <p>The compute and memory capacity of the replication instance + * as defined for the specified replication instance class. It is a required parameter, although a default value is + * pre-selected in the DMS console.</p> <p>For more information on the settings and capacities for the + * available replication instance classes, see <a + * href='https://docs.aws.amazon.com/dms/latest/userguide/CHAP_ReplicationInstance.html#CHAP_ReplicationInstance.InDepth'> + * Selecting the right DMS replication instance for your migration</a>. </p>. + * + * @param replicationInstanceClass the replicationInstanceClass value to set. + * @return the AwsDatabaseMigrationServiceReplicationInstanceProperties object itself. + */ + public AwsDatabaseMigrationServiceReplicationInstanceProperties + withReplicationInstanceClass(String replicationInstanceClass) { + this.replicationInstanceClass = replicationInstanceClass; + return this; + } + + /** + * Get the replicationInstanceIdentifier property: <p>The replication instance identifier is a required + * parameter. This parameter is stored as a lowercase string.</p> <p>Constraints:</p> <ul> + * <li> <p>Must contain 1-63 alphanumeric characters or hyphens.</p> </li> <li> + * <p>First character must be a letter.</p> </li> <li> <p>Cannot end with a hyphen or + * contain two consecutive hyphens.</p> </li> </ul> <p>Example: + * <code>myrepinstance</code> </p>. + * + * @return the replicationInstanceIdentifier value. + */ + public String replicationInstanceIdentifier() { + return this.replicationInstanceIdentifier; + } + + /** + * Set the replicationInstanceIdentifier property: <p>The replication instance identifier is a required + * parameter. This parameter is stored as a lowercase string.</p> <p>Constraints:</p> <ul> + * <li> <p>Must contain 1-63 alphanumeric characters or hyphens.</p> </li> <li> + * <p>First character must be a letter.</p> </li> <li> <p>Cannot end with a hyphen or + * contain two consecutive hyphens.</p> </li> </ul> <p>Example: + * <code>myrepinstance</code> </p>. + * + * @param replicationInstanceIdentifier the replicationInstanceIdentifier value to set. + * @return the AwsDatabaseMigrationServiceReplicationInstanceProperties object itself. + */ + public AwsDatabaseMigrationServiceReplicationInstanceProperties + withReplicationInstanceIdentifier(String replicationInstanceIdentifier) { + this.replicationInstanceIdentifier = replicationInstanceIdentifier; + return this; + } + + /** + * Get the replicationInstanceIpv6Addresses property: <p>One or more IPv6 addresses for the replication + * instance.</p>. + * + * @return the replicationInstanceIpv6Addresses value. + */ + public List replicationInstanceIpv6Addresses() { + return this.replicationInstanceIpv6Addresses; + } + + /** + * Set the replicationInstanceIpv6Addresses property: <p>One or more IPv6 addresses for the replication + * instance.</p>. + * + * @param replicationInstanceIpv6Addresses the replicationInstanceIpv6Addresses value to set. + * @return the AwsDatabaseMigrationServiceReplicationInstanceProperties object itself. + */ + public AwsDatabaseMigrationServiceReplicationInstanceProperties + withReplicationInstanceIpv6Addresses(List replicationInstanceIpv6Addresses) { + this.replicationInstanceIpv6Addresses = replicationInstanceIpv6Addresses; + return this; + } + + /** + * Get the replicationInstancePrivateIpAddress property: <p>The private IP address of the replication + * instance.</p>. + * + * @return the replicationInstancePrivateIpAddress value. + */ + public String replicationInstancePrivateIpAddress() { + return this.replicationInstancePrivateIpAddress; + } + + /** + * Set the replicationInstancePrivateIpAddress property: <p>The private IP address of the replication + * instance.</p>. + * + * @param replicationInstancePrivateIpAddress the replicationInstancePrivateIpAddress value to set. + * @return the AwsDatabaseMigrationServiceReplicationInstanceProperties object itself. + */ + public AwsDatabaseMigrationServiceReplicationInstanceProperties + withReplicationInstancePrivateIpAddress(String replicationInstancePrivateIpAddress) { + this.replicationInstancePrivateIpAddress = replicationInstancePrivateIpAddress; + return this; + } + + /** + * Get the replicationInstancePrivateIpAddresses property: <p>One or more private IP addresses for the + * replication instance.</p>. + * + * @return the replicationInstancePrivateIpAddresses value. + */ + public List replicationInstancePrivateIpAddresses() { + return this.replicationInstancePrivateIpAddresses; + } + + /** + * Set the replicationInstancePrivateIpAddresses property: <p>One or more private IP addresses for the + * replication instance.</p>. + * + * @param replicationInstancePrivateIpAddresses the replicationInstancePrivateIpAddresses value to set. + * @return the AwsDatabaseMigrationServiceReplicationInstanceProperties object itself. + */ + public AwsDatabaseMigrationServiceReplicationInstanceProperties + withReplicationInstancePrivateIpAddresses(List replicationInstancePrivateIpAddresses) { + this.replicationInstancePrivateIpAddresses = replicationInstancePrivateIpAddresses; + return this; + } + + /** + * Get the replicationInstancePublicIpAddress property: <p>The public IP address of the replication + * instance.</p>. + * + * @return the replicationInstancePublicIpAddress value. + */ + public String replicationInstancePublicIpAddress() { + return this.replicationInstancePublicIpAddress; + } + + /** + * Set the replicationInstancePublicIpAddress property: <p>The public IP address of the replication + * instance.</p>. + * + * @param replicationInstancePublicIpAddress the replicationInstancePublicIpAddress value to set. + * @return the AwsDatabaseMigrationServiceReplicationInstanceProperties object itself. + */ + public AwsDatabaseMigrationServiceReplicationInstanceProperties + withReplicationInstancePublicIpAddress(String replicationInstancePublicIpAddress) { + this.replicationInstancePublicIpAddress = replicationInstancePublicIpAddress; + return this; + } + + /** + * Get the replicationInstancePublicIpAddresses property: <p>One or more public IP addresses for the + * replication instance.</p>. + * + * @return the replicationInstancePublicIpAddresses value. + */ + public List replicationInstancePublicIpAddresses() { + return this.replicationInstancePublicIpAddresses; + } + + /** + * Set the replicationInstancePublicIpAddresses property: <p>One or more public IP addresses for the + * replication instance.</p>. + * + * @param replicationInstancePublicIpAddresses the replicationInstancePublicIpAddresses value to set. + * @return the AwsDatabaseMigrationServiceReplicationInstanceProperties object itself. + */ + public AwsDatabaseMigrationServiceReplicationInstanceProperties + withReplicationInstancePublicIpAddresses(List replicationInstancePublicIpAddresses) { + this.replicationInstancePublicIpAddresses = replicationInstancePublicIpAddresses; + return this; + } + + /** + * Get the replicationInstanceStatus property: <p>The status of the replication instance. The possible return + * values include:</p> <ul> <li> <p> <code>'available'</code> </p> + * </li> <li> <p> <code>'creating'</code> </p> </li> <li> <p> + * <code>'deleted'</code> </p> </li> <li> <p> + * <code>'deleting'</code> </p> </li> <li> <p> <code>'failed'</code> + * </p> </li> <li> <p> <code>'modifying'</code> </p> </li> + * <li> <p> <code>'upgrading'</code> </p> </li> <li> <p> + * <code>'rebooting'</code> </p> </li> <li> <p> + * <code>'resetting-master-credentials'</code> </p> </li> <li> <p> + * <code>'storage-full'</code> </p> </li> <li> <p> + * <code>'incompatible-credentials'</code> </p> </li> <li> <p> + * <code>'incompatible-network'</code> </p> </li> <li> <p> + * <code>'maintenance'</code> </p> </li> </ul>. + * + * @return the replicationInstanceStatus value. + */ + public String replicationInstanceStatus() { + return this.replicationInstanceStatus; + } + + /** + * Set the replicationInstanceStatus property: <p>The status of the replication instance. The possible return + * values include:</p> <ul> <li> <p> <code>'available'</code> </p> + * </li> <li> <p> <code>'creating'</code> </p> </li> <li> <p> + * <code>'deleted'</code> </p> </li> <li> <p> + * <code>'deleting'</code> </p> </li> <li> <p> <code>'failed'</code> + * </p> </li> <li> <p> <code>'modifying'</code> </p> </li> + * <li> <p> <code>'upgrading'</code> </p> </li> <li> <p> + * <code>'rebooting'</code> </p> </li> <li> <p> + * <code>'resetting-master-credentials'</code> </p> </li> <li> <p> + * <code>'storage-full'</code> </p> </li> <li> <p> + * <code>'incompatible-credentials'</code> </p> </li> <li> <p> + * <code>'incompatible-network'</code> </p> </li> <li> <p> + * <code>'maintenance'</code> </p> </li> </ul>. + * + * @param replicationInstanceStatus the replicationInstanceStatus value to set. + * @return the AwsDatabaseMigrationServiceReplicationInstanceProperties object itself. + */ + public AwsDatabaseMigrationServiceReplicationInstanceProperties + withReplicationInstanceStatus(String replicationInstanceStatus) { + this.replicationInstanceStatus = replicationInstanceStatus; + return this; + } + + /** + * Get the replicationSubnetGroup property: <p>The subnet group for the replication instance.</p>. + * + * @return the replicationSubnetGroup value. + */ + public ReplicationSubnetGroup replicationSubnetGroup() { + return this.replicationSubnetGroup; + } + + /** + * Set the replicationSubnetGroup property: <p>The subnet group for the replication instance.</p>. + * + * @param replicationSubnetGroup the replicationSubnetGroup value to set. + * @return the AwsDatabaseMigrationServiceReplicationInstanceProperties object itself. + */ + public AwsDatabaseMigrationServiceReplicationInstanceProperties + withReplicationSubnetGroup(ReplicationSubnetGroup replicationSubnetGroup) { + this.replicationSubnetGroup = replicationSubnetGroup; + return this; + } + + /** + * Get the secondaryAvailabilityZone property: <p>The Availability Zone of the standby replication instance in + * a Multi-AZ deployment.</p>. + * + * @return the secondaryAvailabilityZone value. + */ + public String secondaryAvailabilityZone() { + return this.secondaryAvailabilityZone; + } + + /** + * Set the secondaryAvailabilityZone property: <p>The Availability Zone of the standby replication instance in + * a Multi-AZ deployment.</p>. + * + * @param secondaryAvailabilityZone the secondaryAvailabilityZone value to set. + * @return the AwsDatabaseMigrationServiceReplicationInstanceProperties object itself. + */ + public AwsDatabaseMigrationServiceReplicationInstanceProperties + withSecondaryAvailabilityZone(String secondaryAvailabilityZone) { + this.secondaryAvailabilityZone = secondaryAvailabilityZone; + return this; + } + + /** + * Get the vpcSecurityGroups property: <p>The VPC security group for the instance.</p>. + * + * @return the vpcSecurityGroups value. + */ + public List vpcSecurityGroups() { + return this.vpcSecurityGroups; + } + + /** + * Set the vpcSecurityGroups property: <p>The VPC security group for the instance.</p>. + * + * @param vpcSecurityGroups the vpcSecurityGroups value to set. + * @return the AwsDatabaseMigrationServiceReplicationInstanceProperties object itself. + */ + public AwsDatabaseMigrationServiceReplicationInstanceProperties + withVpcSecurityGroups(List vpcSecurityGroups) { + this.vpcSecurityGroups = vpcSecurityGroups; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (pendingModifiedValues() != null) { + pendingModifiedValues().validate(); + } + if (replicationSubnetGroup() != null) { + replicationSubnetGroup().validate(); + } + if (vpcSecurityGroups() != null) { + vpcSecurityGroups().forEach(e -> e.validate()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeNumberField("allocatedStorage", this.allocatedStorage); + jsonWriter.writeBooleanField("autoMinorVersionUpgrade", this.autoMinorVersionUpgrade); + jsonWriter.writeStringField("availabilityZone", this.availabilityZone); + jsonWriter.writeStringField("dnsNameServers", this.dnsNameServers); + jsonWriter.writeStringField("engineVersion", this.engineVersion); + jsonWriter.writeStringField("freeUntil", + this.freeUntil == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.freeUntil)); + jsonWriter.writeStringField("instanceCreateTime", + this.instanceCreateTime == null + ? null + : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.instanceCreateTime)); + jsonWriter.writeStringField("kmsKeyId", this.kmsKeyId); + jsonWriter.writeBooleanField("multiAZ", this.multiAZ); + jsonWriter.writeStringField("networkType", this.networkType); + jsonWriter.writeJsonField("pendingModifiedValues", this.pendingModifiedValues); + jsonWriter.writeStringField("preferredMaintenanceWindow", this.preferredMaintenanceWindow); + jsonWriter.writeBooleanField("publiclyAccessible", this.publiclyAccessible); + jsonWriter.writeStringField("replicationInstanceArn", this.replicationInstanceArn); + jsonWriter.writeStringField("replicationInstanceClass", this.replicationInstanceClass); + jsonWriter.writeStringField("replicationInstanceIdentifier", this.replicationInstanceIdentifier); + jsonWriter.writeArrayField("replicationInstanceIpv6Addresses", this.replicationInstanceIpv6Addresses, + (writer, element) -> writer.writeString(element)); + jsonWriter.writeStringField("replicationInstancePrivateIpAddress", this.replicationInstancePrivateIpAddress); + jsonWriter.writeArrayField("replicationInstancePrivateIpAddresses", this.replicationInstancePrivateIpAddresses, + (writer, element) -> writer.writeString(element)); + jsonWriter.writeStringField("replicationInstancePublicIpAddress", this.replicationInstancePublicIpAddress); + jsonWriter.writeArrayField("replicationInstancePublicIpAddresses", this.replicationInstancePublicIpAddresses, + (writer, element) -> writer.writeString(element)); + jsonWriter.writeStringField("replicationInstanceStatus", this.replicationInstanceStatus); + jsonWriter.writeJsonField("replicationSubnetGroup", this.replicationSubnetGroup); + jsonWriter.writeStringField("secondaryAvailabilityZone", this.secondaryAvailabilityZone); + jsonWriter.writeArrayField("vpcSecurityGroups", this.vpcSecurityGroups, + (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AwsDatabaseMigrationServiceReplicationInstanceProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AwsDatabaseMigrationServiceReplicationInstanceProperties if the JsonReader was pointing to + * an instance of it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the + * AwsDatabaseMigrationServiceReplicationInstanceProperties. + */ + public static AwsDatabaseMigrationServiceReplicationInstanceProperties fromJson(JsonReader jsonReader) + throws IOException { + return jsonReader.readObject(reader -> { + AwsDatabaseMigrationServiceReplicationInstanceProperties deserializedAwsDatabaseMigrationServiceReplicationInstanceProperties + = new AwsDatabaseMigrationServiceReplicationInstanceProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("allocatedStorage".equals(fieldName)) { + deserializedAwsDatabaseMigrationServiceReplicationInstanceProperties.allocatedStorage + = reader.getNullable(JsonReader::getInt); + } else if ("autoMinorVersionUpgrade".equals(fieldName)) { + deserializedAwsDatabaseMigrationServiceReplicationInstanceProperties.autoMinorVersionUpgrade + = reader.getNullable(JsonReader::getBoolean); + } else if ("availabilityZone".equals(fieldName)) { + deserializedAwsDatabaseMigrationServiceReplicationInstanceProperties.availabilityZone + = reader.getString(); + } else if ("dnsNameServers".equals(fieldName)) { + deserializedAwsDatabaseMigrationServiceReplicationInstanceProperties.dnsNameServers + = reader.getString(); + } else if ("engineVersion".equals(fieldName)) { + deserializedAwsDatabaseMigrationServiceReplicationInstanceProperties.engineVersion + = reader.getString(); + } else if ("freeUntil".equals(fieldName)) { + deserializedAwsDatabaseMigrationServiceReplicationInstanceProperties.freeUntil = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("instanceCreateTime".equals(fieldName)) { + deserializedAwsDatabaseMigrationServiceReplicationInstanceProperties.instanceCreateTime = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("kmsKeyId".equals(fieldName)) { + deserializedAwsDatabaseMigrationServiceReplicationInstanceProperties.kmsKeyId = reader.getString(); + } else if ("multiAZ".equals(fieldName)) { + deserializedAwsDatabaseMigrationServiceReplicationInstanceProperties.multiAZ + = reader.getNullable(JsonReader::getBoolean); + } else if ("networkType".equals(fieldName)) { + deserializedAwsDatabaseMigrationServiceReplicationInstanceProperties.networkType + = reader.getString(); + } else if ("pendingModifiedValues".equals(fieldName)) { + deserializedAwsDatabaseMigrationServiceReplicationInstanceProperties.pendingModifiedValues + = ReplicationPendingModifiedValues.fromJson(reader); + } else if ("preferredMaintenanceWindow".equals(fieldName)) { + deserializedAwsDatabaseMigrationServiceReplicationInstanceProperties.preferredMaintenanceWindow + = reader.getString(); + } else if ("publiclyAccessible".equals(fieldName)) { + deserializedAwsDatabaseMigrationServiceReplicationInstanceProperties.publiclyAccessible + = reader.getNullable(JsonReader::getBoolean); + } else if ("replicationInstanceArn".equals(fieldName)) { + deserializedAwsDatabaseMigrationServiceReplicationInstanceProperties.replicationInstanceArn + = reader.getString(); + } else if ("replicationInstanceClass".equals(fieldName)) { + deserializedAwsDatabaseMigrationServiceReplicationInstanceProperties.replicationInstanceClass + = reader.getString(); + } else if ("replicationInstanceIdentifier".equals(fieldName)) { + deserializedAwsDatabaseMigrationServiceReplicationInstanceProperties.replicationInstanceIdentifier + = reader.getString(); + } else if ("replicationInstanceIpv6Addresses".equals(fieldName)) { + List replicationInstanceIpv6Addresses = reader.readArray(reader1 -> reader1.getString()); + deserializedAwsDatabaseMigrationServiceReplicationInstanceProperties.replicationInstanceIpv6Addresses + = replicationInstanceIpv6Addresses; + } else if ("replicationInstancePrivateIpAddress".equals(fieldName)) { + deserializedAwsDatabaseMigrationServiceReplicationInstanceProperties.replicationInstancePrivateIpAddress + = reader.getString(); + } else if ("replicationInstancePrivateIpAddresses".equals(fieldName)) { + List replicationInstancePrivateIpAddresses + = reader.readArray(reader1 -> reader1.getString()); + deserializedAwsDatabaseMigrationServiceReplicationInstanceProperties.replicationInstancePrivateIpAddresses + = replicationInstancePrivateIpAddresses; + } else if ("replicationInstancePublicIpAddress".equals(fieldName)) { + deserializedAwsDatabaseMigrationServiceReplicationInstanceProperties.replicationInstancePublicIpAddress + = reader.getString(); + } else if ("replicationInstancePublicIpAddresses".equals(fieldName)) { + List replicationInstancePublicIpAddresses + = reader.readArray(reader1 -> reader1.getString()); + deserializedAwsDatabaseMigrationServiceReplicationInstanceProperties.replicationInstancePublicIpAddresses + = replicationInstancePublicIpAddresses; + } else if ("replicationInstanceStatus".equals(fieldName)) { + deserializedAwsDatabaseMigrationServiceReplicationInstanceProperties.replicationInstanceStatus + = reader.getString(); + } else if ("replicationSubnetGroup".equals(fieldName)) { + deserializedAwsDatabaseMigrationServiceReplicationInstanceProperties.replicationSubnetGroup + = ReplicationSubnetGroup.fromJson(reader); + } else if ("secondaryAvailabilityZone".equals(fieldName)) { + deserializedAwsDatabaseMigrationServiceReplicationInstanceProperties.secondaryAvailabilityZone + = reader.getString(); + } else if ("vpcSecurityGroups".equals(fieldName)) { + List vpcSecurityGroups + = reader.readArray(reader1 -> VpcSecurityGroupMembership.fromJson(reader1)); + deserializedAwsDatabaseMigrationServiceReplicationInstanceProperties.vpcSecurityGroups + = vpcSecurityGroups; + } else { + reader.skipChildren(); + } + } + + return deserializedAwsDatabaseMigrationServiceReplicationInstanceProperties; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/AwsDaxClusterProperties.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/AwsDaxClusterProperties.java new file mode 100644 index 000000000000..b284838410c3 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/AwsDaxClusterProperties.java @@ -0,0 +1,637 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Definition of awsDaxCluster. + */ +@Fluent +public final class AwsDaxClusterProperties implements JsonSerializable { + /* + *

The number of nodes in the cluster that are active (i.e., capable of serving requests).

+ */ + private Integer activeNodes; + + /* + *

The Amazon Resource Name (ARN) that uniquely identifies the cluster.

+ */ + private String clusterArn; + + /* + *

The endpoint for this DAX cluster, consisting of a DNS name, a port number, and a URL. Applications should use + * the URL to configure the DAX client to find their cluster.

+ */ + private Endpoint clusterDiscoveryEndpoint; + + /* + *

The type of encryption supported by the cluster's endpoint. Values are:

  • NONE + * for no encryption

    TLS for Transport Layer Security

+ */ + private ClusterEndpointEncryptionTypeEnumValue clusterEndpointEncryptionType; + + /* + *

The name of the DAX cluster.

+ */ + private String clusterName; + + /* + *

The description of the cluster.

+ */ + private String description; + + /* + *

A valid Amazon Resource Name (ARN) that identifies an IAM role. At runtime, DAX will assume this role and use + * the role's permissions to access DynamoDB on your behalf.

+ */ + private String iamRoleArn; + + /* + *

A list of nodes to be removed from the cluster.

+ */ + private List nodeIdsToRemove; + + /* + *

The node type for the nodes in the cluster. (All nodes in a DAX cluster are of the same type.)

+ */ + private String nodeType; + + /* + *

A list of nodes that are currently in the cluster.

+ */ + private List nodes; + + /* + *

Describes a notification topic and its status. Notification topics are used for publishing DAX events to + * subscribers using Amazon Simple Notification Service (SNS).

+ */ + private NotificationConfigurationAutoGenerated notificationConfiguration; + + /* + *

The parameter group being used by nodes in the cluster.

+ */ + private ParameterGroupStatus parameterGroup; + + /* + *

A range of time when maintenance of DAX cluster software will be performed. For example: + * sun:01:00-sun:09:00. Cluster maintenance normally takes less than 30 minutes, and is performed + * automatically within the maintenance window.

+ */ + private String preferredMaintenanceWindow; + + /* + *

The description of the server-side encryption status on the specified DAX cluster.

+ */ + private SseDescription sseDescription; + + /* + *

A list of security groups, and the status of each, for the nodes in the cluster.

+ */ + private List securityGroups; + + /* + *

The current status of the cluster.

+ */ + private String status; + + /* + *

The subnet group where the DAX cluster is running.

+ */ + private String subnetGroup; + + /* + *

The total number of nodes in the cluster.

+ */ + private Integer totalNodes; + + /** + * Creates an instance of AwsDaxClusterProperties class. + */ + public AwsDaxClusterProperties() { + } + + /** + * Get the activeNodes property: <p>The number of nodes in the cluster that are active (i.e., capable of + * serving requests).</p>. + * + * @return the activeNodes value. + */ + public Integer activeNodes() { + return this.activeNodes; + } + + /** + * Set the activeNodes property: <p>The number of nodes in the cluster that are active (i.e., capable of + * serving requests).</p>. + * + * @param activeNodes the activeNodes value to set. + * @return the AwsDaxClusterProperties object itself. + */ + public AwsDaxClusterProperties withActiveNodes(Integer activeNodes) { + this.activeNodes = activeNodes; + return this; + } + + /** + * Get the clusterArn property: <p>The Amazon Resource Name (ARN) that uniquely identifies the cluster. + * </p>. + * + * @return the clusterArn value. + */ + public String clusterArn() { + return this.clusterArn; + } + + /** + * Set the clusterArn property: <p>The Amazon Resource Name (ARN) that uniquely identifies the cluster. + * </p>. + * + * @param clusterArn the clusterArn value to set. + * @return the AwsDaxClusterProperties object itself. + */ + public AwsDaxClusterProperties withClusterArn(String clusterArn) { + this.clusterArn = clusterArn; + return this; + } + + /** + * Get the clusterDiscoveryEndpoint property: <p>The endpoint for this DAX cluster, consisting of a DNS name, + * a port number, and a URL. Applications should use the URL to configure the DAX client to find their + * cluster.</p>. + * + * @return the clusterDiscoveryEndpoint value. + */ + public Endpoint clusterDiscoveryEndpoint() { + return this.clusterDiscoveryEndpoint; + } + + /** + * Set the clusterDiscoveryEndpoint property: <p>The endpoint for this DAX cluster, consisting of a DNS name, + * a port number, and a URL. Applications should use the URL to configure the DAX client to find their + * cluster.</p>. + * + * @param clusterDiscoveryEndpoint the clusterDiscoveryEndpoint value to set. + * @return the AwsDaxClusterProperties object itself. + */ + public AwsDaxClusterProperties withClusterDiscoveryEndpoint(Endpoint clusterDiscoveryEndpoint) { + this.clusterDiscoveryEndpoint = clusterDiscoveryEndpoint; + return this; + } + + /** + * Get the clusterEndpointEncryptionType property: <p>The type of encryption supported by the cluster's + * endpoint. Values are:</p> <ul> <li> <p> <code>NONE</code> for no + * encryption</p> <p> <code>TLS</code> for Transport Layer Security</p> </li> + * </ul>. + * + * @return the clusterEndpointEncryptionType value. + */ + public ClusterEndpointEncryptionTypeEnumValue clusterEndpointEncryptionType() { + return this.clusterEndpointEncryptionType; + } + + /** + * Set the clusterEndpointEncryptionType property: <p>The type of encryption supported by the cluster's + * endpoint. Values are:</p> <ul> <li> <p> <code>NONE</code> for no + * encryption</p> <p> <code>TLS</code> for Transport Layer Security</p> </li> + * </ul>. + * + * @param clusterEndpointEncryptionType the clusterEndpointEncryptionType value to set. + * @return the AwsDaxClusterProperties object itself. + */ + public AwsDaxClusterProperties + withClusterEndpointEncryptionType(ClusterEndpointEncryptionTypeEnumValue clusterEndpointEncryptionType) { + this.clusterEndpointEncryptionType = clusterEndpointEncryptionType; + return this; + } + + /** + * Get the clusterName property: <p>The name of the DAX cluster.</p>. + * + * @return the clusterName value. + */ + public String clusterName() { + return this.clusterName; + } + + /** + * Set the clusterName property: <p>The name of the DAX cluster.</p>. + * + * @param clusterName the clusterName value to set. + * @return the AwsDaxClusterProperties object itself. + */ + public AwsDaxClusterProperties withClusterName(String clusterName) { + this.clusterName = clusterName; + return this; + } + + /** + * Get the description property: <p>The description of the cluster.</p>. + * + * @return the description value. + */ + public String description() { + return this.description; + } + + /** + * Set the description property: <p>The description of the cluster.</p>. + * + * @param description the description value to set. + * @return the AwsDaxClusterProperties object itself. + */ + public AwsDaxClusterProperties withDescription(String description) { + this.description = description; + return this; + } + + /** + * Get the iamRoleArn property: <p>A valid Amazon Resource Name (ARN) that identifies an IAM role. At runtime, + * DAX will assume this role and use the role's permissions to access DynamoDB on your behalf.</p>. + * + * @return the iamRoleArn value. + */ + public String iamRoleArn() { + return this.iamRoleArn; + } + + /** + * Set the iamRoleArn property: <p>A valid Amazon Resource Name (ARN) that identifies an IAM role. At runtime, + * DAX will assume this role and use the role's permissions to access DynamoDB on your behalf.</p>. + * + * @param iamRoleArn the iamRoleArn value to set. + * @return the AwsDaxClusterProperties object itself. + */ + public AwsDaxClusterProperties withIamRoleArn(String iamRoleArn) { + this.iamRoleArn = iamRoleArn; + return this; + } + + /** + * Get the nodeIdsToRemove property: <p>A list of nodes to be removed from the cluster.</p>. + * + * @return the nodeIdsToRemove value. + */ + public List nodeIdsToRemove() { + return this.nodeIdsToRemove; + } + + /** + * Set the nodeIdsToRemove property: <p>A list of nodes to be removed from the cluster.</p>. + * + * @param nodeIdsToRemove the nodeIdsToRemove value to set. + * @return the AwsDaxClusterProperties object itself. + */ + public AwsDaxClusterProperties withNodeIdsToRemove(List nodeIdsToRemove) { + this.nodeIdsToRemove = nodeIdsToRemove; + return this; + } + + /** + * Get the nodeType property: <p>The node type for the nodes in the cluster. (All nodes in a DAX cluster are + * of the same type.)</p>. + * + * @return the nodeType value. + */ + public String nodeType() { + return this.nodeType; + } + + /** + * Set the nodeType property: <p>The node type for the nodes in the cluster. (All nodes in a DAX cluster are + * of the same type.)</p>. + * + * @param nodeType the nodeType value to set. + * @return the AwsDaxClusterProperties object itself. + */ + public AwsDaxClusterProperties withNodeType(String nodeType) { + this.nodeType = nodeType; + return this; + } + + /** + * Get the nodes property: <p>A list of nodes that are currently in the cluster.</p>. + * + * @return the nodes value. + */ + public List nodes() { + return this.nodes; + } + + /** + * Set the nodes property: <p>A list of nodes that are currently in the cluster.</p>. + * + * @param nodes the nodes value to set. + * @return the AwsDaxClusterProperties object itself. + */ + public AwsDaxClusterProperties withNodes(List nodes) { + this.nodes = nodes; + return this; + } + + /** + * Get the notificationConfiguration property: <p>Describes a notification topic and its status. Notification + * topics are used for publishing DAX events to subscribers using Amazon Simple Notification Service + * (SNS).</p>. + * + * @return the notificationConfiguration value. + */ + public NotificationConfigurationAutoGenerated notificationConfiguration() { + return this.notificationConfiguration; + } + + /** + * Set the notificationConfiguration property: <p>Describes a notification topic and its status. Notification + * topics are used for publishing DAX events to subscribers using Amazon Simple Notification Service + * (SNS).</p>. + * + * @param notificationConfiguration the notificationConfiguration value to set. + * @return the AwsDaxClusterProperties object itself. + */ + public AwsDaxClusterProperties + withNotificationConfiguration(NotificationConfigurationAutoGenerated notificationConfiguration) { + this.notificationConfiguration = notificationConfiguration; + return this; + } + + /** + * Get the parameterGroup property: <p>The parameter group being used by nodes in the cluster.</p>. + * + * @return the parameterGroup value. + */ + public ParameterGroupStatus parameterGroup() { + return this.parameterGroup; + } + + /** + * Set the parameterGroup property: <p>The parameter group being used by nodes in the cluster.</p>. + * + * @param parameterGroup the parameterGroup value to set. + * @return the AwsDaxClusterProperties object itself. + */ + public AwsDaxClusterProperties withParameterGroup(ParameterGroupStatus parameterGroup) { + this.parameterGroup = parameterGroup; + return this; + } + + /** + * Get the preferredMaintenanceWindow property: <p>A range of time when maintenance of DAX cluster software + * will be performed. For example: <code>sun:01:00-sun:09:00</code>. Cluster maintenance normally takes + * less than 30 minutes, and is performed automatically within the maintenance window.</p>. + * + * @return the preferredMaintenanceWindow value. + */ + public String preferredMaintenanceWindow() { + return this.preferredMaintenanceWindow; + } + + /** + * Set the preferredMaintenanceWindow property: <p>A range of time when maintenance of DAX cluster software + * will be performed. For example: <code>sun:01:00-sun:09:00</code>. Cluster maintenance normally takes + * less than 30 minutes, and is performed automatically within the maintenance window.</p>. + * + * @param preferredMaintenanceWindow the preferredMaintenanceWindow value to set. + * @return the AwsDaxClusterProperties object itself. + */ + public AwsDaxClusterProperties withPreferredMaintenanceWindow(String preferredMaintenanceWindow) { + this.preferredMaintenanceWindow = preferredMaintenanceWindow; + return this; + } + + /** + * Get the sseDescription property: <p>The description of the server-side encryption status on the specified + * DAX cluster.</p>. + * + * @return the sseDescription value. + */ + public SseDescription sseDescription() { + return this.sseDescription; + } + + /** + * Set the sseDescription property: <p>The description of the server-side encryption status on the specified + * DAX cluster.</p>. + * + * @param sseDescription the sseDescription value to set. + * @return the AwsDaxClusterProperties object itself. + */ + public AwsDaxClusterProperties withSseDescription(SseDescription sseDescription) { + this.sseDescription = sseDescription; + return this; + } + + /** + * Get the securityGroups property: <p>A list of security groups, and the status of each, for the nodes in the + * cluster.</p>. + * + * @return the securityGroups value. + */ + public List securityGroups() { + return this.securityGroups; + } + + /** + * Set the securityGroups property: <p>A list of security groups, and the status of each, for the nodes in the + * cluster.</p>. + * + * @param securityGroups the securityGroups value to set. + * @return the AwsDaxClusterProperties object itself. + */ + public AwsDaxClusterProperties withSecurityGroups(List securityGroups) { + this.securityGroups = securityGroups; + return this; + } + + /** + * Get the status property: <p>The current status of the cluster.</p>. + * + * @return the status value. + */ + public String status() { + return this.status; + } + + /** + * Set the status property: <p>The current status of the cluster.</p>. + * + * @param status the status value to set. + * @return the AwsDaxClusterProperties object itself. + */ + public AwsDaxClusterProperties withStatus(String status) { + this.status = status; + return this; + } + + /** + * Get the subnetGroup property: <p>The subnet group where the DAX cluster is running.</p>. + * + * @return the subnetGroup value. + */ + public String subnetGroup() { + return this.subnetGroup; + } + + /** + * Set the subnetGroup property: <p>The subnet group where the DAX cluster is running.</p>. + * + * @param subnetGroup the subnetGroup value to set. + * @return the AwsDaxClusterProperties object itself. + */ + public AwsDaxClusterProperties withSubnetGroup(String subnetGroup) { + this.subnetGroup = subnetGroup; + return this; + } + + /** + * Get the totalNodes property: <p>The total number of nodes in the cluster.</p>. + * + * @return the totalNodes value. + */ + public Integer totalNodes() { + return this.totalNodes; + } + + /** + * Set the totalNodes property: <p>The total number of nodes in the cluster.</p>. + * + * @param totalNodes the totalNodes value to set. + * @return the AwsDaxClusterProperties object itself. + */ + public AwsDaxClusterProperties withTotalNodes(Integer totalNodes) { + this.totalNodes = totalNodes; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (clusterDiscoveryEndpoint() != null) { + clusterDiscoveryEndpoint().validate(); + } + if (clusterEndpointEncryptionType() != null) { + clusterEndpointEncryptionType().validate(); + } + if (nodes() != null) { + nodes().forEach(e -> e.validate()); + } + if (notificationConfiguration() != null) { + notificationConfiguration().validate(); + } + if (parameterGroup() != null) { + parameterGroup().validate(); + } + if (sseDescription() != null) { + sseDescription().validate(); + } + if (securityGroups() != null) { + securityGroups().forEach(e -> e.validate()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeNumberField("activeNodes", this.activeNodes); + jsonWriter.writeStringField("clusterArn", this.clusterArn); + jsonWriter.writeJsonField("clusterDiscoveryEndpoint", this.clusterDiscoveryEndpoint); + jsonWriter.writeJsonField("clusterEndpointEncryptionType", this.clusterEndpointEncryptionType); + jsonWriter.writeStringField("clusterName", this.clusterName); + jsonWriter.writeStringField("description", this.description); + jsonWriter.writeStringField("iamRoleArn", this.iamRoleArn); + jsonWriter.writeArrayField("nodeIdsToRemove", this.nodeIdsToRemove, + (writer, element) -> writer.writeString(element)); + jsonWriter.writeStringField("nodeType", this.nodeType); + jsonWriter.writeArrayField("nodes", this.nodes, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeJsonField("notificationConfiguration", this.notificationConfiguration); + jsonWriter.writeJsonField("parameterGroup", this.parameterGroup); + jsonWriter.writeStringField("preferredMaintenanceWindow", this.preferredMaintenanceWindow); + jsonWriter.writeJsonField("sseDescription", this.sseDescription); + jsonWriter.writeArrayField("securityGroups", this.securityGroups, + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("status", this.status); + jsonWriter.writeStringField("subnetGroup", this.subnetGroup); + jsonWriter.writeNumberField("totalNodes", this.totalNodes); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AwsDaxClusterProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AwsDaxClusterProperties if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the AwsDaxClusterProperties. + */ + public static AwsDaxClusterProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AwsDaxClusterProperties deserializedAwsDaxClusterProperties = new AwsDaxClusterProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("activeNodes".equals(fieldName)) { + deserializedAwsDaxClusterProperties.activeNodes = reader.getNullable(JsonReader::getInt); + } else if ("clusterArn".equals(fieldName)) { + deserializedAwsDaxClusterProperties.clusterArn = reader.getString(); + } else if ("clusterDiscoveryEndpoint".equals(fieldName)) { + deserializedAwsDaxClusterProperties.clusterDiscoveryEndpoint = Endpoint.fromJson(reader); + } else if ("clusterEndpointEncryptionType".equals(fieldName)) { + deserializedAwsDaxClusterProperties.clusterEndpointEncryptionType + = ClusterEndpointEncryptionTypeEnumValue.fromJson(reader); + } else if ("clusterName".equals(fieldName)) { + deserializedAwsDaxClusterProperties.clusterName = reader.getString(); + } else if ("description".equals(fieldName)) { + deserializedAwsDaxClusterProperties.description = reader.getString(); + } else if ("iamRoleArn".equals(fieldName)) { + deserializedAwsDaxClusterProperties.iamRoleArn = reader.getString(); + } else if ("nodeIdsToRemove".equals(fieldName)) { + List nodeIdsToRemove = reader.readArray(reader1 -> reader1.getString()); + deserializedAwsDaxClusterProperties.nodeIdsToRemove = nodeIdsToRemove; + } else if ("nodeType".equals(fieldName)) { + deserializedAwsDaxClusterProperties.nodeType = reader.getString(); + } else if ("nodes".equals(fieldName)) { + List nodes = reader.readArray(reader1 -> Node.fromJson(reader1)); + deserializedAwsDaxClusterProperties.nodes = nodes; + } else if ("notificationConfiguration".equals(fieldName)) { + deserializedAwsDaxClusterProperties.notificationConfiguration + = NotificationConfigurationAutoGenerated.fromJson(reader); + } else if ("parameterGroup".equals(fieldName)) { + deserializedAwsDaxClusterProperties.parameterGroup = ParameterGroupStatus.fromJson(reader); + } else if ("preferredMaintenanceWindow".equals(fieldName)) { + deserializedAwsDaxClusterProperties.preferredMaintenanceWindow = reader.getString(); + } else if ("sseDescription".equals(fieldName)) { + deserializedAwsDaxClusterProperties.sseDescription = SseDescription.fromJson(reader); + } else if ("securityGroups".equals(fieldName)) { + List securityGroups + = reader.readArray(reader1 -> SecurityGroupMembership.fromJson(reader1)); + deserializedAwsDaxClusterProperties.securityGroups = securityGroups; + } else if ("status".equals(fieldName)) { + deserializedAwsDaxClusterProperties.status = reader.getString(); + } else if ("subnetGroup".equals(fieldName)) { + deserializedAwsDaxClusterProperties.subnetGroup = reader.getString(); + } else if ("totalNodes".equals(fieldName)) { + deserializedAwsDaxClusterProperties.totalNodes = reader.getNullable(JsonReader::getInt); + } else { + reader.skipChildren(); + } + } + + return deserializedAwsDaxClusterProperties; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/AwsDynamoDBContinuousBackupsDescriptionProperties.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/AwsDynamoDBContinuousBackupsDescriptionProperties.java new file mode 100644 index 000000000000..c9da4ae71984 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/AwsDynamoDBContinuousBackupsDescriptionProperties.java @@ -0,0 +1,137 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of awsDynamoDBContinuousBackupsDescription. + */ +@Fluent +public final class AwsDynamoDBContinuousBackupsDescriptionProperties + implements JsonSerializable { + /* + *

ContinuousBackupsStatus can be one of the following states: ENABLED, DISABLED

+ */ + private ContinuousBackupsStatusEnumValue continuousBackupsStatus; + + /* + *

The description of the point in time recovery settings applied to the table.

+ */ + private PointInTimeRecoveryDescription pointInTimeRecoveryDescription; + + /** + * Creates an instance of AwsDynamoDBContinuousBackupsDescriptionProperties class. + */ + public AwsDynamoDBContinuousBackupsDescriptionProperties() { + } + + /** + * Get the continuousBackupsStatus property: <p> <code>ContinuousBackupsStatus</code> can be one + * of the following states: ENABLED, DISABLED</p>. + * + * @return the continuousBackupsStatus value. + */ + public ContinuousBackupsStatusEnumValue continuousBackupsStatus() { + return this.continuousBackupsStatus; + } + + /** + * Set the continuousBackupsStatus property: <p> <code>ContinuousBackupsStatus</code> can be one + * of the following states: ENABLED, DISABLED</p>. + * + * @param continuousBackupsStatus the continuousBackupsStatus value to set. + * @return the AwsDynamoDBContinuousBackupsDescriptionProperties object itself. + */ + public AwsDynamoDBContinuousBackupsDescriptionProperties + withContinuousBackupsStatus(ContinuousBackupsStatusEnumValue continuousBackupsStatus) { + this.continuousBackupsStatus = continuousBackupsStatus; + return this; + } + + /** + * Get the pointInTimeRecoveryDescription property: <p>The description of the point in time recovery settings + * applied to the table.</p>. + * + * @return the pointInTimeRecoveryDescription value. + */ + public PointInTimeRecoveryDescription pointInTimeRecoveryDescription() { + return this.pointInTimeRecoveryDescription; + } + + /** + * Set the pointInTimeRecoveryDescription property: <p>The description of the point in time recovery settings + * applied to the table.</p>. + * + * @param pointInTimeRecoveryDescription the pointInTimeRecoveryDescription value to set. + * @return the AwsDynamoDBContinuousBackupsDescriptionProperties object itself. + */ + public AwsDynamoDBContinuousBackupsDescriptionProperties + withPointInTimeRecoveryDescription(PointInTimeRecoveryDescription pointInTimeRecoveryDescription) { + this.pointInTimeRecoveryDescription = pointInTimeRecoveryDescription; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (continuousBackupsStatus() != null) { + continuousBackupsStatus().validate(); + } + if (pointInTimeRecoveryDescription() != null) { + pointInTimeRecoveryDescription().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("continuousBackupsStatus", this.continuousBackupsStatus); + jsonWriter.writeJsonField("pointInTimeRecoveryDescription", this.pointInTimeRecoveryDescription); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AwsDynamoDBContinuousBackupsDescriptionProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AwsDynamoDBContinuousBackupsDescriptionProperties if the JsonReader was pointing to an + * instance of it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the AwsDynamoDBContinuousBackupsDescriptionProperties. + */ + public static AwsDynamoDBContinuousBackupsDescriptionProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AwsDynamoDBContinuousBackupsDescriptionProperties deserializedAwsDynamoDBContinuousBackupsDescriptionProperties + = new AwsDynamoDBContinuousBackupsDescriptionProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("continuousBackupsStatus".equals(fieldName)) { + deserializedAwsDynamoDBContinuousBackupsDescriptionProperties.continuousBackupsStatus + = ContinuousBackupsStatusEnumValue.fromJson(reader); + } else if ("pointInTimeRecoveryDescription".equals(fieldName)) { + deserializedAwsDynamoDBContinuousBackupsDescriptionProperties.pointInTimeRecoveryDescription + = PointInTimeRecoveryDescription.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedAwsDynamoDBContinuousBackupsDescriptionProperties; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/AwsDynamoDBTableProperties.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/AwsDynamoDBTableProperties.java new file mode 100644 index 000000000000..791ecb00d802 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/AwsDynamoDBTableProperties.java @@ -0,0 +1,947 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Definition of awsDynamoDBTable. + */ +@Fluent +public final class AwsDynamoDBTableProperties implements JsonSerializable { + /* + * Property arn + */ + private String arn; + + /* + * A list of attributes that describe the key schema for the table and indexes. This property is required to create + * a DDB table. Update requires: [Some + * interruptions](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update- + * behaviors.html#update-some-interrupt). Replacement if you edit an existing AttributeDefinition. + */ + private List attributeDefinitions; + + /* + * Specify how you are charged for read and write throughput and how you manage capacity. Valid values include: + + * ``PROVISIONED`` - We recommend using ``PROVISIONED`` for predictable workloads. ``PROVISIONED`` sets the billing + * mode to [Provisioned + * Mode](https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/HowItWorks.ReadWriteCapacityMode.html# + * HowItWorks.ProvisionedThroughput.Manual). + ``PAY_PER_REQUEST`` - We recommend using ``PAY_PER_REQUEST`` for + * unpredictable workloads. ``PAY_PER_REQUEST`` sets the billing mode to [On-Demand + * Mode](https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/HowItWorks.ReadWriteCapacityMode.html# + * HowItWorks.OnDemand). If not specified, the default is ``PROVISIONED``. + */ + private String billingMode; + + /* + * The settings used to enable or disable CloudWatch Contributor Insights for the specified table. The settings used + * to enable or disable CloudWatch Contributor Insights. + */ + private ContributorInsightsSpecification contributorInsightsSpecification; + + /* + * Determines if a table is protected from deletion. When enabled, the table cannot be deleted by any user or + * process. This setting is disabled by default. For more information, see [Using deletion + * protection](https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/WorkingWithTables.Basics.html# + * WorkingWithTables.Basics.DeletionProtection) in the *Developer Guide*. + */ + private Boolean deletionProtectionEnabled; + + /* + * Global secondary indexes to be created on the table. You can create up to 20 global secondary indexes. If you + * update a table to include a new global secondary index, CFNlong initiates the index creation and then proceeds + * with the stack update. CFNlong doesn't wait for the index to complete creation because the backfilling phase can + * take a long time, depending on the size of the table. You can't use the index or update the table until the + * index's status is ``ACTIVE``. You can track its status by using the DynamoDB + * [DescribeTable](https://docs.aws.amazon.com/cli/latest/reference/dynamodb/describe-table.html) command. If you + * add or delete an index during an update, we recommend that you don't update any other resources. If your stack + * fails to update and is rolled back while adding a new index, you must manually delete the index. Updates are not + * supported. The following are exceptions: + If you update either the contributor insights specification or the + * provisioned throughput values of global secondary indexes, you can update the table without interruption. + You + * can delete or add one global secondary index without interruption. If you do both in the same update (for + * example, by changing the index's logical ID), the update fails. + */ + private List globalSecondaryIndexes; + + /* + * Specifies the properties of data being imported from the S3 bucket source to the table. If you specify the + * ``ImportSourceSpecification`` property, and also specify either the ``StreamSpecification``, the ``TableClass`` + * property, or the ``DeletionProtectionEnabled`` property, the IAM entity creating/updating stack must have + * ``UpdateTable`` permission. Specifies the properties of data being imported from the S3 bucket source to the + * table. + */ + private ImportSourceSpecification importSourceSpecification; + + /* + * Specifies the attributes that make up the primary key for the table. The attributes in the ``KeySchema`` property + * must also be defined in the ``AttributeDefinitions`` property. + */ + private List keySchema; + + /* + * The Kinesis Data Streams configuration for the specified table. The Kinesis Data Streams configuration for the + * specified table. + */ + private KinesisStreamSpecification kinesisStreamSpecification; + + /* + * Local secondary indexes to be created on the table. You can create up to 5 local secondary indexes. Each index is + * scoped to a given hash key value. The size of each hash key can be up to 10 gigabytes. + */ + private List localSecondaryIndexes; + + /* + * The settings used to enable point in time recovery. The settings used to enable point in time recovery. + */ + private PointInTimeRecoverySpecification pointInTimeRecoverySpecification; + + /* + * Throughput for the specified table, which consists of values for ``ReadCapacityUnits`` and + * ``WriteCapacityUnits``. For more information about the contents of a provisioned throughput structure, see + * [Amazon DynamoDB Table + * ProvisionedThroughput](https://docs.aws.amazon.com/amazondynamodb/latest/APIReference/API_ProvisionedThroughput. + * html). If you set ``BillingMode`` as ``PROVISIONED``, you must specify this property. If you set ``BillingMode`` + * as ``PAY_PER_REQUEST``, you cannot specify this property. Throughput for the specified table, which consists of + * values for ``ReadCapacityUnits`` and ``WriteCapacityUnits``. For more information about the contents of a + * provisioned throughput structure, see [Table + * ProvisionedThroughput](https://docs.aws.amazon.com/amazondynamodb/latest/APIReference/API_ProvisionedThroughput. + * html). + */ + private ProvisionedThroughput provisionedThroughput; + + /* + * A resource-based policy document that contains permissions to add to the specified table. In a CFNshort template, + * you can provide the policy in JSON or YAML format because CFNshort converts YAML to JSON before submitting it to + * DDB. For more information about resource-based policies, see [Using resource-based policies + * for](https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/access-control-resource-based.html) and + * [Resource-based policy + * examples](https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/rbac-examples.html). When you attach a + * resource-based policy while creating a table, the policy creation is *strongly consistent*. For information about + * the considerations that you should keep in mind while attaching a resource-based policy, see [Resource-based + * policy + * considerations](https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/rbac-considerations.html). + * Creates or updates a resource-based policy document that contains the permissions for DDB resources, such as a + * table, its indexes, and stream. Resource-based policies let you define access permissions by specifying who has + * access to each resource, and the actions they are allowed to perform on each resource. In a CFNshort template, + * you can provide the policy in JSON or YAML format because CFNshort converts YAML to JSON before submitting it to + * DDB. For more information about resource-based policies, see [Using resource-based policies + * for](https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/access-control-resource-based.html) and + * [Resource-based policy + * examples](https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/rbac-examples.html). While defining + * resource-based policies in your CFNshort templates, the following considerations apply: + The maximum size + * supported for a resource-based policy document in JSON format is 20 KB. DDB counts whitespaces when calculating + * the size of a policy against this limit. + Resource-based policies don't support [drift + * detection](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-stack-drift.html#). If you + * update a policy outside of the CFNshort stack template, you'll need to update the CFNshort stack with the + * changes. + Resource-based policies don't support out-of-band changes. If you add, update, or delete a policy + * outside of the CFNshort template, the change won't be overwritten if there are no changes to the policy within + * the template. For example, say that your template contains a resource-based policy, which you later update + * outside of the template. If you don't make any changes to the policy in the template, the updated policy in DDB + * won’t be synced with the policy in the template. Conversely, say that your template doesn’t contain a + * resource-based policy, but you add a policy outside of the template. This policy won’t be removed from DDB as + * long as you don’t add it to the template. When you add a policy to the template and update the stack, the + * existing policy in DDB will be updated to match the one defined in the template. For a full list of all + * considerations, see [Resource-based policy + * considerations](https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/rbac-considerations.html). + */ + private ResourcePolicy resourcePolicy; + + /* + * Specifies the settings to enable server-side encryption. Represents the settings used to enable server-side + * encryption. + */ + private SseSpecification sseSpecification; + + /* + * Property streamArn + */ + private String streamArn; + + /* + * The settings for the DDB table stream, which capture changes to items stored in the table. Represents the + * DynamoDB Streams configuration for a table in DynamoDB. + */ + private StreamSpecification streamSpecification; + + /* + * The table class of the new table. Valid values are ``STANDARD`` and ``STANDARD_INFREQUENT_ACCESS``. + */ + private String tableClass; + + /* + * A name for the table. If you don't specify a name, CFNlong generates a unique physical ID and uses that ID for + * the table name. For more information, see [Name + * Type](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-name.html). If you specify a + * name, you cannot perform updates that require replacement of this resource. You can perform updates that require + * no or some interruption. If you must replace the resource, specify a new name. + */ + private String tableName; + + /* + * An array of key-value pairs to apply to this resource. For more information, see + * [Tag](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-resource-tags.html). + */ + private List tags; + + /* + * Specifies the Time to Live (TTL) settings for the table. For detailed information about the limits in DynamoDB, + * see [Limits in Amazon DynamoDB](https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Limits.html) in + * the Amazon DynamoDB Developer Guide. Represents the settings used to enable or disable Time to Live (TTL) for the + * specified table. + */ + private TimeToLiveSpecification timeToLiveSpecification; + + /** + * Creates an instance of AwsDynamoDBTableProperties class. + */ + public AwsDynamoDBTableProperties() { + } + + /** + * Get the arn property: Property arn. + * + * @return the arn value. + */ + public String arn() { + return this.arn; + } + + /** + * Set the arn property: Property arn. + * + * @param arn the arn value to set. + * @return the AwsDynamoDBTableProperties object itself. + */ + public AwsDynamoDBTableProperties withArn(String arn) { + this.arn = arn; + return this; + } + + /** + * Get the attributeDefinitions property: A list of attributes that describe the key schema for the table and + * indexes. This property is required to create a DDB table. Update requires: [Some + * interruptions](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-some-interrupt). + * Replacement if you edit an existing AttributeDefinition. + * + * @return the attributeDefinitions value. + */ + public List attributeDefinitions() { + return this.attributeDefinitions; + } + + /** + * Set the attributeDefinitions property: A list of attributes that describe the key schema for the table and + * indexes. This property is required to create a DDB table. Update requires: [Some + * interruptions](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-some-interrupt). + * Replacement if you edit an existing AttributeDefinition. + * + * @param attributeDefinitions the attributeDefinitions value to set. + * @return the AwsDynamoDBTableProperties object itself. + */ + public AwsDynamoDBTableProperties withAttributeDefinitions(List attributeDefinitions) { + this.attributeDefinitions = attributeDefinitions; + return this; + } + + /** + * Get the billingMode property: Specify how you are charged for read and write throughput and how you manage + * capacity. Valid values include: + ``PROVISIONED`` - We recommend using ``PROVISIONED`` for predictable workloads. + * ``PROVISIONED`` sets the billing mode to [Provisioned + * Mode](https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/HowItWorks.ReadWriteCapacityMode.html#HowItWorks.ProvisionedThroughput.Manual). + * + ``PAY_PER_REQUEST`` - We recommend using ``PAY_PER_REQUEST`` for unpredictable workloads. ``PAY_PER_REQUEST`` + * sets the billing mode to [On-Demand + * Mode](https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/HowItWorks.ReadWriteCapacityMode.html#HowItWorks.OnDemand). + * If not specified, the default is ``PROVISIONED``. + * + * @return the billingMode value. + */ + public String billingMode() { + return this.billingMode; + } + + /** + * Set the billingMode property: Specify how you are charged for read and write throughput and how you manage + * capacity. Valid values include: + ``PROVISIONED`` - We recommend using ``PROVISIONED`` for predictable workloads. + * ``PROVISIONED`` sets the billing mode to [Provisioned + * Mode](https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/HowItWorks.ReadWriteCapacityMode.html#HowItWorks.ProvisionedThroughput.Manual). + * + ``PAY_PER_REQUEST`` - We recommend using ``PAY_PER_REQUEST`` for unpredictable workloads. ``PAY_PER_REQUEST`` + * sets the billing mode to [On-Demand + * Mode](https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/HowItWorks.ReadWriteCapacityMode.html#HowItWorks.OnDemand). + * If not specified, the default is ``PROVISIONED``. + * + * @param billingMode the billingMode value to set. + * @return the AwsDynamoDBTableProperties object itself. + */ + public AwsDynamoDBTableProperties withBillingMode(String billingMode) { + this.billingMode = billingMode; + return this; + } + + /** + * Get the contributorInsightsSpecification property: The settings used to enable or disable CloudWatch Contributor + * Insights for the specified table. The settings used to enable or disable CloudWatch Contributor Insights. + * + * @return the contributorInsightsSpecification value. + */ + public ContributorInsightsSpecification contributorInsightsSpecification() { + return this.contributorInsightsSpecification; + } + + /** + * Set the contributorInsightsSpecification property: The settings used to enable or disable CloudWatch Contributor + * Insights for the specified table. The settings used to enable or disable CloudWatch Contributor Insights. + * + * @param contributorInsightsSpecification the contributorInsightsSpecification value to set. + * @return the AwsDynamoDBTableProperties object itself. + */ + public AwsDynamoDBTableProperties + withContributorInsightsSpecification(ContributorInsightsSpecification contributorInsightsSpecification) { + this.contributorInsightsSpecification = contributorInsightsSpecification; + return this; + } + + /** + * Get the deletionProtectionEnabled property: Determines if a table is protected from deletion. When enabled, the + * table cannot be deleted by any user or process. This setting is disabled by default. For more information, see + * [Using deletion + * protection](https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/WorkingWithTables.Basics.html#WorkingWithTables.Basics.DeletionProtection) + * in the *Developer Guide*. + * + * @return the deletionProtectionEnabled value. + */ + public Boolean deletionProtectionEnabled() { + return this.deletionProtectionEnabled; + } + + /** + * Set the deletionProtectionEnabled property: Determines if a table is protected from deletion. When enabled, the + * table cannot be deleted by any user or process. This setting is disabled by default. For more information, see + * [Using deletion + * protection](https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/WorkingWithTables.Basics.html#WorkingWithTables.Basics.DeletionProtection) + * in the *Developer Guide*. + * + * @param deletionProtectionEnabled the deletionProtectionEnabled value to set. + * @return the AwsDynamoDBTableProperties object itself. + */ + public AwsDynamoDBTableProperties withDeletionProtectionEnabled(Boolean deletionProtectionEnabled) { + this.deletionProtectionEnabled = deletionProtectionEnabled; + return this; + } + + /** + * Get the globalSecondaryIndexes property: Global secondary indexes to be created on the table. You can create up + * to 20 global secondary indexes. If you update a table to include a new global secondary index, CFNlong initiates + * the index creation and then proceeds with the stack update. CFNlong doesn't wait for the index to complete + * creation because the backfilling phase can take a long time, depending on the size of the table. You can't use + * the index or update the table until the index's status is ``ACTIVE``. You can track its status by using the + * DynamoDB [DescribeTable](https://docs.aws.amazon.com/cli/latest/reference/dynamodb/describe-table.html) command. + * If you add or delete an index during an update, we recommend that you don't update any other resources. If your + * stack fails to update and is rolled back while adding a new index, you must manually delete the index. Updates + * are not supported. The following are exceptions: + If you update either the contributor insights specification or + * the provisioned throughput values of global secondary indexes, you can update the table without interruption. + + * You can delete or add one global secondary index without interruption. If you do both in the same update (for + * example, by changing the index's logical ID), the update fails. + * + * @return the globalSecondaryIndexes value. + */ + public List globalSecondaryIndexes() { + return this.globalSecondaryIndexes; + } + + /** + * Set the globalSecondaryIndexes property: Global secondary indexes to be created on the table. You can create up + * to 20 global secondary indexes. If you update a table to include a new global secondary index, CFNlong initiates + * the index creation and then proceeds with the stack update. CFNlong doesn't wait for the index to complete + * creation because the backfilling phase can take a long time, depending on the size of the table. You can't use + * the index or update the table until the index's status is ``ACTIVE``. You can track its status by using the + * DynamoDB [DescribeTable](https://docs.aws.amazon.com/cli/latest/reference/dynamodb/describe-table.html) command. + * If you add or delete an index during an update, we recommend that you don't update any other resources. If your + * stack fails to update and is rolled back while adding a new index, you must manually delete the index. Updates + * are not supported. The following are exceptions: + If you update either the contributor insights specification or + * the provisioned throughput values of global secondary indexes, you can update the table without interruption. + + * You can delete or add one global secondary index without interruption. If you do both in the same update (for + * example, by changing the index's logical ID), the update fails. + * + * @param globalSecondaryIndexes the globalSecondaryIndexes value to set. + * @return the AwsDynamoDBTableProperties object itself. + */ + public AwsDynamoDBTableProperties withGlobalSecondaryIndexes(List globalSecondaryIndexes) { + this.globalSecondaryIndexes = globalSecondaryIndexes; + return this; + } + + /** + * Get the importSourceSpecification property: Specifies the properties of data being imported from the S3 bucket + * source to the table. If you specify the ``ImportSourceSpecification`` property, and also specify either the + * ``StreamSpecification``, the ``TableClass`` property, or the ``DeletionProtectionEnabled`` property, the IAM + * entity creating/updating stack must have ``UpdateTable`` permission. Specifies the properties of data being + * imported from the S3 bucket source to the table. + * + * @return the importSourceSpecification value. + */ + public ImportSourceSpecification importSourceSpecification() { + return this.importSourceSpecification; + } + + /** + * Set the importSourceSpecification property: Specifies the properties of data being imported from the S3 bucket + * source to the table. If you specify the ``ImportSourceSpecification`` property, and also specify either the + * ``StreamSpecification``, the ``TableClass`` property, or the ``DeletionProtectionEnabled`` property, the IAM + * entity creating/updating stack must have ``UpdateTable`` permission. Specifies the properties of data being + * imported from the S3 bucket source to the table. + * + * @param importSourceSpecification the importSourceSpecification value to set. + * @return the AwsDynamoDBTableProperties object itself. + */ + public AwsDynamoDBTableProperties + withImportSourceSpecification(ImportSourceSpecification importSourceSpecification) { + this.importSourceSpecification = importSourceSpecification; + return this; + } + + /** + * Get the keySchema property: Specifies the attributes that make up the primary key for the table. The attributes + * in the ``KeySchema`` property must also be defined in the ``AttributeDefinitions`` property. + * + * @return the keySchema value. + */ + public List keySchema() { + return this.keySchema; + } + + /** + * Set the keySchema property: Specifies the attributes that make up the primary key for the table. The attributes + * in the ``KeySchema`` property must also be defined in the ``AttributeDefinitions`` property. + * + * @param keySchema the keySchema value to set. + * @return the AwsDynamoDBTableProperties object itself. + */ + public AwsDynamoDBTableProperties withKeySchema(List keySchema) { + this.keySchema = keySchema; + return this; + } + + /** + * Get the kinesisStreamSpecification property: The Kinesis Data Streams configuration for the specified table. The + * Kinesis Data Streams configuration for the specified table. + * + * @return the kinesisStreamSpecification value. + */ + public KinesisStreamSpecification kinesisStreamSpecification() { + return this.kinesisStreamSpecification; + } + + /** + * Set the kinesisStreamSpecification property: The Kinesis Data Streams configuration for the specified table. The + * Kinesis Data Streams configuration for the specified table. + * + * @param kinesisStreamSpecification the kinesisStreamSpecification value to set. + * @return the AwsDynamoDBTableProperties object itself. + */ + public AwsDynamoDBTableProperties + withKinesisStreamSpecification(KinesisStreamSpecification kinesisStreamSpecification) { + this.kinesisStreamSpecification = kinesisStreamSpecification; + return this; + } + + /** + * Get the localSecondaryIndexes property: Local secondary indexes to be created on the table. You can create up to + * 5 local secondary indexes. Each index is scoped to a given hash key value. The size of each hash key can be up to + * 10 gigabytes. + * + * @return the localSecondaryIndexes value. + */ + public List localSecondaryIndexes() { + return this.localSecondaryIndexes; + } + + /** + * Set the localSecondaryIndexes property: Local secondary indexes to be created on the table. You can create up to + * 5 local secondary indexes. Each index is scoped to a given hash key value. The size of each hash key can be up to + * 10 gigabytes. + * + * @param localSecondaryIndexes the localSecondaryIndexes value to set. + * @return the AwsDynamoDBTableProperties object itself. + */ + public AwsDynamoDBTableProperties withLocalSecondaryIndexes(List localSecondaryIndexes) { + this.localSecondaryIndexes = localSecondaryIndexes; + return this; + } + + /** + * Get the pointInTimeRecoverySpecification property: The settings used to enable point in time recovery. The + * settings used to enable point in time recovery. + * + * @return the pointInTimeRecoverySpecification value. + */ + public PointInTimeRecoverySpecification pointInTimeRecoverySpecification() { + return this.pointInTimeRecoverySpecification; + } + + /** + * Set the pointInTimeRecoverySpecification property: The settings used to enable point in time recovery. The + * settings used to enable point in time recovery. + * + * @param pointInTimeRecoverySpecification the pointInTimeRecoverySpecification value to set. + * @return the AwsDynamoDBTableProperties object itself. + */ + public AwsDynamoDBTableProperties + withPointInTimeRecoverySpecification(PointInTimeRecoverySpecification pointInTimeRecoverySpecification) { + this.pointInTimeRecoverySpecification = pointInTimeRecoverySpecification; + return this; + } + + /** + * Get the provisionedThroughput property: Throughput for the specified table, which consists of values for + * ``ReadCapacityUnits`` and ``WriteCapacityUnits``. For more information about the contents of a provisioned + * throughput structure, see [Amazon DynamoDB Table + * ProvisionedThroughput](https://docs.aws.amazon.com/amazondynamodb/latest/APIReference/API_ProvisionedThroughput.html). + * If you set ``BillingMode`` as ``PROVISIONED``, you must specify this property. If you set ``BillingMode`` as + * ``PAY_PER_REQUEST``, you cannot specify this property. Throughput for the specified table, which consists of + * values for ``ReadCapacityUnits`` and ``WriteCapacityUnits``. For more information about the contents of a + * provisioned throughput structure, see [Table + * ProvisionedThroughput](https://docs.aws.amazon.com/amazondynamodb/latest/APIReference/API_ProvisionedThroughput.html). + * + * @return the provisionedThroughput value. + */ + public ProvisionedThroughput provisionedThroughput() { + return this.provisionedThroughput; + } + + /** + * Set the provisionedThroughput property: Throughput for the specified table, which consists of values for + * ``ReadCapacityUnits`` and ``WriteCapacityUnits``. For more information about the contents of a provisioned + * throughput structure, see [Amazon DynamoDB Table + * ProvisionedThroughput](https://docs.aws.amazon.com/amazondynamodb/latest/APIReference/API_ProvisionedThroughput.html). + * If you set ``BillingMode`` as ``PROVISIONED``, you must specify this property. If you set ``BillingMode`` as + * ``PAY_PER_REQUEST``, you cannot specify this property. Throughput for the specified table, which consists of + * values for ``ReadCapacityUnits`` and ``WriteCapacityUnits``. For more information about the contents of a + * provisioned throughput structure, see [Table + * ProvisionedThroughput](https://docs.aws.amazon.com/amazondynamodb/latest/APIReference/API_ProvisionedThroughput.html). + * + * @param provisionedThroughput the provisionedThroughput value to set. + * @return the AwsDynamoDBTableProperties object itself. + */ + public AwsDynamoDBTableProperties withProvisionedThroughput(ProvisionedThroughput provisionedThroughput) { + this.provisionedThroughput = provisionedThroughput; + return this; + } + + /** + * Get the resourcePolicy property: A resource-based policy document that contains permissions to add to the + * specified table. In a CFNshort template, you can provide the policy in JSON or YAML format because CFNshort + * converts YAML to JSON before submitting it to DDB. For more information about resource-based policies, see [Using + * resource-based policies + * for](https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/access-control-resource-based.html) and + * [Resource-based policy + * examples](https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/rbac-examples.html). When you attach a + * resource-based policy while creating a table, the policy creation is *strongly consistent*. For information about + * the considerations that you should keep in mind while attaching a resource-based policy, see [Resource-based + * policy + * considerations](https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/rbac-considerations.html). + * Creates or updates a resource-based policy document that contains the permissions for DDB resources, such as a + * table, its indexes, and stream. Resource-based policies let you define access permissions by specifying who has + * access to each resource, and the actions they are allowed to perform on each resource. In a CFNshort template, + * you can provide the policy in JSON or YAML format because CFNshort converts YAML to JSON before submitting it to + * DDB. For more information about resource-based policies, see [Using resource-based policies + * for](https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/access-control-resource-based.html) and + * [Resource-based policy + * examples](https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/rbac-examples.html). While defining + * resource-based policies in your CFNshort templates, the following considerations apply: + The maximum size + * supported for a resource-based policy document in JSON format is 20 KB. DDB counts whitespaces when calculating + * the size of a policy against this limit. + Resource-based policies don't support [drift + * detection](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-stack-drift.html#). If you + * update a policy outside of the CFNshort stack template, you'll need to update the CFNshort stack with the + * changes. + Resource-based policies don't support out-of-band changes. If you add, update, or delete a policy + * outside of the CFNshort template, the change won't be overwritten if there are no changes to the policy within + * the template. For example, say that your template contains a resource-based policy, which you later update + * outside of the template. If you don't make any changes to the policy in the template, the updated policy in DDB + * won’t be synced with the policy in the template. Conversely, say that your template doesn’t contain a + * resource-based policy, but you add a policy outside of the template. This policy won’t be removed from DDB as + * long as you don’t add it to the template. When you add a policy to the template and update the stack, the + * existing policy in DDB will be updated to match the one defined in the template. For a full list of all + * considerations, see [Resource-based policy + * considerations](https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/rbac-considerations.html). + * + * @return the resourcePolicy value. + */ + public ResourcePolicy resourcePolicy() { + return this.resourcePolicy; + } + + /** + * Set the resourcePolicy property: A resource-based policy document that contains permissions to add to the + * specified table. In a CFNshort template, you can provide the policy in JSON or YAML format because CFNshort + * converts YAML to JSON before submitting it to DDB. For more information about resource-based policies, see [Using + * resource-based policies + * for](https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/access-control-resource-based.html) and + * [Resource-based policy + * examples](https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/rbac-examples.html). When you attach a + * resource-based policy while creating a table, the policy creation is *strongly consistent*. For information about + * the considerations that you should keep in mind while attaching a resource-based policy, see [Resource-based + * policy + * considerations](https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/rbac-considerations.html). + * Creates or updates a resource-based policy document that contains the permissions for DDB resources, such as a + * table, its indexes, and stream. Resource-based policies let you define access permissions by specifying who has + * access to each resource, and the actions they are allowed to perform on each resource. In a CFNshort template, + * you can provide the policy in JSON or YAML format because CFNshort converts YAML to JSON before submitting it to + * DDB. For more information about resource-based policies, see [Using resource-based policies + * for](https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/access-control-resource-based.html) and + * [Resource-based policy + * examples](https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/rbac-examples.html). While defining + * resource-based policies in your CFNshort templates, the following considerations apply: + The maximum size + * supported for a resource-based policy document in JSON format is 20 KB. DDB counts whitespaces when calculating + * the size of a policy against this limit. + Resource-based policies don't support [drift + * detection](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-stack-drift.html#). If you + * update a policy outside of the CFNshort stack template, you'll need to update the CFNshort stack with the + * changes. + Resource-based policies don't support out-of-band changes. If you add, update, or delete a policy + * outside of the CFNshort template, the change won't be overwritten if there are no changes to the policy within + * the template. For example, say that your template contains a resource-based policy, which you later update + * outside of the template. If you don't make any changes to the policy in the template, the updated policy in DDB + * won’t be synced with the policy in the template. Conversely, say that your template doesn’t contain a + * resource-based policy, but you add a policy outside of the template. This policy won’t be removed from DDB as + * long as you don’t add it to the template. When you add a policy to the template and update the stack, the + * existing policy in DDB will be updated to match the one defined in the template. For a full list of all + * considerations, see [Resource-based policy + * considerations](https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/rbac-considerations.html). + * + * @param resourcePolicy the resourcePolicy value to set. + * @return the AwsDynamoDBTableProperties object itself. + */ + public AwsDynamoDBTableProperties withResourcePolicy(ResourcePolicy resourcePolicy) { + this.resourcePolicy = resourcePolicy; + return this; + } + + /** + * Get the sseSpecification property: Specifies the settings to enable server-side encryption. Represents the + * settings used to enable server-side encryption. + * + * @return the sseSpecification value. + */ + public SseSpecification sseSpecification() { + return this.sseSpecification; + } + + /** + * Set the sseSpecification property: Specifies the settings to enable server-side encryption. Represents the + * settings used to enable server-side encryption. + * + * @param sseSpecification the sseSpecification value to set. + * @return the AwsDynamoDBTableProperties object itself. + */ + public AwsDynamoDBTableProperties withSseSpecification(SseSpecification sseSpecification) { + this.sseSpecification = sseSpecification; + return this; + } + + /** + * Get the streamArn property: Property streamArn. + * + * @return the streamArn value. + */ + public String streamArn() { + return this.streamArn; + } + + /** + * Set the streamArn property: Property streamArn. + * + * @param streamArn the streamArn value to set. + * @return the AwsDynamoDBTableProperties object itself. + */ + public AwsDynamoDBTableProperties withStreamArn(String streamArn) { + this.streamArn = streamArn; + return this; + } + + /** + * Get the streamSpecification property: The settings for the DDB table stream, which capture changes to items + * stored in the table. Represents the DynamoDB Streams configuration for a table in DynamoDB. + * + * @return the streamSpecification value. + */ + public StreamSpecification streamSpecification() { + return this.streamSpecification; + } + + /** + * Set the streamSpecification property: The settings for the DDB table stream, which capture changes to items + * stored in the table. Represents the DynamoDB Streams configuration for a table in DynamoDB. + * + * @param streamSpecification the streamSpecification value to set. + * @return the AwsDynamoDBTableProperties object itself. + */ + public AwsDynamoDBTableProperties withStreamSpecification(StreamSpecification streamSpecification) { + this.streamSpecification = streamSpecification; + return this; + } + + /** + * Get the tableClass property: The table class of the new table. Valid values are ``STANDARD`` and + * ``STANDARD_INFREQUENT_ACCESS``. + * + * @return the tableClass value. + */ + public String tableClass() { + return this.tableClass; + } + + /** + * Set the tableClass property: The table class of the new table. Valid values are ``STANDARD`` and + * ``STANDARD_INFREQUENT_ACCESS``. + * + * @param tableClass the tableClass value to set. + * @return the AwsDynamoDBTableProperties object itself. + */ + public AwsDynamoDBTableProperties withTableClass(String tableClass) { + this.tableClass = tableClass; + return this; + } + + /** + * Get the tableName property: A name for the table. If you don't specify a name, CFNlong generates a unique + * physical ID and uses that ID for the table name. For more information, see [Name + * Type](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-name.html). If you specify a + * name, you cannot perform updates that require replacement of this resource. You can perform updates that require + * no or some interruption. If you must replace the resource, specify a new name. + * + * @return the tableName value. + */ + public String tableName() { + return this.tableName; + } + + /** + * Set the tableName property: A name for the table. If you don't specify a name, CFNlong generates a unique + * physical ID and uses that ID for the table name. For more information, see [Name + * Type](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-name.html). If you specify a + * name, you cannot perform updates that require replacement of this resource. You can perform updates that require + * no or some interruption. If you must replace the resource, specify a new name. + * + * @param tableName the tableName value to set. + * @return the AwsDynamoDBTableProperties object itself. + */ + public AwsDynamoDBTableProperties withTableName(String tableName) { + this.tableName = tableName; + return this; + } + + /** + * Get the tags property: An array of key-value pairs to apply to this resource. For more information, see + * [Tag](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-resource-tags.html). + * + * @return the tags value. + */ + public List tags() { + return this.tags; + } + + /** + * Set the tags property: An array of key-value pairs to apply to this resource. For more information, see + * [Tag](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-resource-tags.html). + * + * @param tags the tags value to set. + * @return the AwsDynamoDBTableProperties object itself. + */ + public AwsDynamoDBTableProperties withTags(List tags) { + this.tags = tags; + return this; + } + + /** + * Get the timeToLiveSpecification property: Specifies the Time to Live (TTL) settings for the table. For detailed + * information about the limits in DynamoDB, see [Limits in Amazon + * DynamoDB](https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Limits.html) in the Amazon DynamoDB + * Developer Guide. Represents the settings used to enable or disable Time to Live (TTL) for the specified table. + * + * @return the timeToLiveSpecification value. + */ + public TimeToLiveSpecification timeToLiveSpecification() { + return this.timeToLiveSpecification; + } + + /** + * Set the timeToLiveSpecification property: Specifies the Time to Live (TTL) settings for the table. For detailed + * information about the limits in DynamoDB, see [Limits in Amazon + * DynamoDB](https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Limits.html) in the Amazon DynamoDB + * Developer Guide. Represents the settings used to enable or disable Time to Live (TTL) for the specified table. + * + * @param timeToLiveSpecification the timeToLiveSpecification value to set. + * @return the AwsDynamoDBTableProperties object itself. + */ + public AwsDynamoDBTableProperties withTimeToLiveSpecification(TimeToLiveSpecification timeToLiveSpecification) { + this.timeToLiveSpecification = timeToLiveSpecification; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (attributeDefinitions() != null) { + attributeDefinitions().forEach(e -> e.validate()); + } + if (contributorInsightsSpecification() != null) { + contributorInsightsSpecification().validate(); + } + if (globalSecondaryIndexes() != null) { + globalSecondaryIndexes().forEach(e -> e.validate()); + } + if (importSourceSpecification() != null) { + importSourceSpecification().validate(); + } + if (keySchema() != null) { + keySchema().forEach(e -> e.validate()); + } + if (kinesisStreamSpecification() != null) { + kinesisStreamSpecification().validate(); + } + if (localSecondaryIndexes() != null) { + localSecondaryIndexes().forEach(e -> e.validate()); + } + if (pointInTimeRecoverySpecification() != null) { + pointInTimeRecoverySpecification().validate(); + } + if (provisionedThroughput() != null) { + provisionedThroughput().validate(); + } + if (resourcePolicy() != null) { + resourcePolicy().validate(); + } + if (sseSpecification() != null) { + sseSpecification().validate(); + } + if (streamSpecification() != null) { + streamSpecification().validate(); + } + if (tags() != null) { + tags().forEach(e -> e.validate()); + } + if (timeToLiveSpecification() != null) { + timeToLiveSpecification().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("arn", this.arn); + jsonWriter.writeArrayField("attributeDefinitions", this.attributeDefinitions, + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("billingMode", this.billingMode); + jsonWriter.writeJsonField("contributorInsightsSpecification", this.contributorInsightsSpecification); + jsonWriter.writeBooleanField("deletionProtectionEnabled", this.deletionProtectionEnabled); + jsonWriter.writeArrayField("globalSecondaryIndexes", this.globalSecondaryIndexes, + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeJsonField("importSourceSpecification", this.importSourceSpecification); + jsonWriter.writeArrayField("keySchema", this.keySchema, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeJsonField("kinesisStreamSpecification", this.kinesisStreamSpecification); + jsonWriter.writeArrayField("localSecondaryIndexes", this.localSecondaryIndexes, + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeJsonField("pointInTimeRecoverySpecification", this.pointInTimeRecoverySpecification); + jsonWriter.writeJsonField("provisionedThroughput", this.provisionedThroughput); + jsonWriter.writeJsonField("resourcePolicy", this.resourcePolicy); + jsonWriter.writeJsonField("sseSpecification", this.sseSpecification); + jsonWriter.writeStringField("streamArn", this.streamArn); + jsonWriter.writeJsonField("streamSpecification", this.streamSpecification); + jsonWriter.writeStringField("tableClass", this.tableClass); + jsonWriter.writeStringField("tableName", this.tableName); + jsonWriter.writeArrayField("tags", this.tags, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeJsonField("timeToLiveSpecification", this.timeToLiveSpecification); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AwsDynamoDBTableProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AwsDynamoDBTableProperties if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IOException If an error occurs while reading the AwsDynamoDBTableProperties. + */ + public static AwsDynamoDBTableProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AwsDynamoDBTableProperties deserializedAwsDynamoDBTableProperties = new AwsDynamoDBTableProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("arn".equals(fieldName)) { + deserializedAwsDynamoDBTableProperties.arn = reader.getString(); + } else if ("attributeDefinitions".equals(fieldName)) { + List attributeDefinitions + = reader.readArray(reader1 -> AttributeDefinition.fromJson(reader1)); + deserializedAwsDynamoDBTableProperties.attributeDefinitions = attributeDefinitions; + } else if ("billingMode".equals(fieldName)) { + deserializedAwsDynamoDBTableProperties.billingMode = reader.getString(); + } else if ("contributorInsightsSpecification".equals(fieldName)) { + deserializedAwsDynamoDBTableProperties.contributorInsightsSpecification + = ContributorInsightsSpecification.fromJson(reader); + } else if ("deletionProtectionEnabled".equals(fieldName)) { + deserializedAwsDynamoDBTableProperties.deletionProtectionEnabled + = reader.getNullable(JsonReader::getBoolean); + } else if ("globalSecondaryIndexes".equals(fieldName)) { + List globalSecondaryIndexes + = reader.readArray(reader1 -> GlobalSecondaryIndex.fromJson(reader1)); + deserializedAwsDynamoDBTableProperties.globalSecondaryIndexes = globalSecondaryIndexes; + } else if ("importSourceSpecification".equals(fieldName)) { + deserializedAwsDynamoDBTableProperties.importSourceSpecification + = ImportSourceSpecification.fromJson(reader); + } else if ("keySchema".equals(fieldName)) { + List keySchema = reader.readArray(reader1 -> KeySchema.fromJson(reader1)); + deserializedAwsDynamoDBTableProperties.keySchema = keySchema; + } else if ("kinesisStreamSpecification".equals(fieldName)) { + deserializedAwsDynamoDBTableProperties.kinesisStreamSpecification + = KinesisStreamSpecification.fromJson(reader); + } else if ("localSecondaryIndexes".equals(fieldName)) { + List localSecondaryIndexes + = reader.readArray(reader1 -> LocalSecondaryIndex.fromJson(reader1)); + deserializedAwsDynamoDBTableProperties.localSecondaryIndexes = localSecondaryIndexes; + } else if ("pointInTimeRecoverySpecification".equals(fieldName)) { + deserializedAwsDynamoDBTableProperties.pointInTimeRecoverySpecification + = PointInTimeRecoverySpecification.fromJson(reader); + } else if ("provisionedThroughput".equals(fieldName)) { + deserializedAwsDynamoDBTableProperties.provisionedThroughput + = ProvisionedThroughput.fromJson(reader); + } else if ("resourcePolicy".equals(fieldName)) { + deserializedAwsDynamoDBTableProperties.resourcePolicy = ResourcePolicy.fromJson(reader); + } else if ("sseSpecification".equals(fieldName)) { + deserializedAwsDynamoDBTableProperties.sseSpecification = SseSpecification.fromJson(reader); + } else if ("streamArn".equals(fieldName)) { + deserializedAwsDynamoDBTableProperties.streamArn = reader.getString(); + } else if ("streamSpecification".equals(fieldName)) { + deserializedAwsDynamoDBTableProperties.streamSpecification = StreamSpecification.fromJson(reader); + } else if ("tableClass".equals(fieldName)) { + deserializedAwsDynamoDBTableProperties.tableClass = reader.getString(); + } else if ("tableName".equals(fieldName)) { + deserializedAwsDynamoDBTableProperties.tableName = reader.getString(); + } else if ("tags".equals(fieldName)) { + List tags = reader.readArray(reader1 -> TagAutoGenerated8.fromJson(reader1)); + deserializedAwsDynamoDBTableProperties.tags = tags; + } else if ("timeToLiveSpecification".equals(fieldName)) { + deserializedAwsDynamoDBTableProperties.timeToLiveSpecification + = TimeToLiveSpecification.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedAwsDynamoDBTableProperties; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/AwsEc2AccountAttributeProperties.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/AwsEc2AccountAttributeProperties.java new file mode 100644 index 000000000000..1516ad11e21c --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/AwsEc2AccountAttributeProperties.java @@ -0,0 +1,129 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Definition of awsEc2AccountAttribute. + */ +@Fluent +public final class AwsEc2AccountAttributeProperties implements JsonSerializable { + /* + *

The name of the account attribute.

+ */ + private String attributeName; + + /* + *

The values for the account attribute.

+ */ + private List attributeValues; + + /** + * Creates an instance of AwsEc2AccountAttributeProperties class. + */ + public AwsEc2AccountAttributeProperties() { + } + + /** + * Get the attributeName property: <p>The name of the account attribute.</p>. + * + * @return the attributeName value. + */ + public String attributeName() { + return this.attributeName; + } + + /** + * Set the attributeName property: <p>The name of the account attribute.</p>. + * + * @param attributeName the attributeName value to set. + * @return the AwsEc2AccountAttributeProperties object itself. + */ + public AwsEc2AccountAttributeProperties withAttributeName(String attributeName) { + this.attributeName = attributeName; + return this; + } + + /** + * Get the attributeValues property: <p>The values for the account attribute.</p>. + * + * @return the attributeValues value. + */ + public List attributeValues() { + return this.attributeValues; + } + + /** + * Set the attributeValues property: <p>The values for the account attribute.</p>. + * + * @param attributeValues the attributeValues value to set. + * @return the AwsEc2AccountAttributeProperties object itself. + */ + public AwsEc2AccountAttributeProperties withAttributeValues(List attributeValues) { + this.attributeValues = attributeValues; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (attributeValues() != null) { + attributeValues().forEach(e -> e.validate()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("attributeName", this.attributeName); + jsonWriter.writeArrayField("attributeValues", this.attributeValues, + (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AwsEc2AccountAttributeProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AwsEc2AccountAttributeProperties if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the AwsEc2AccountAttributeProperties. + */ + public static AwsEc2AccountAttributeProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AwsEc2AccountAttributeProperties deserializedAwsEc2AccountAttributeProperties + = new AwsEc2AccountAttributeProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("attributeName".equals(fieldName)) { + deserializedAwsEc2AccountAttributeProperties.attributeName = reader.getString(); + } else if ("attributeValues".equals(fieldName)) { + List attributeValues + = reader.readArray(reader1 -> AccountAttributeValue.fromJson(reader1)); + deserializedAwsEc2AccountAttributeProperties.attributeValues = attributeValues; + } else { + reader.skipChildren(); + } + } + + return deserializedAwsEc2AccountAttributeProperties; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/AwsEc2AddressProperties.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/AwsEc2AddressProperties.java new file mode 100644 index 000000000000..1dfa02c10d49 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/AwsEc2AddressProperties.java @@ -0,0 +1,479 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Definition of awsEc2Address. + */ +@Fluent +public final class AwsEc2AddressProperties implements JsonSerializable { + /* + *

The ID representing the allocation of the address.

+ */ + private String allocationId; + + /* + *

The ID representing the association of the address with an instance.

+ */ + private String associationId; + + /* + *

The carrier IP address associated. This option is only available for network interfaces which reside in a + * subnet in a Wavelength Zone (for example an EC2 instance).

+ */ + private String carrierIp; + + /* + *

The customer-owned IP address.

+ */ + private String customerOwnedIp; + + /* + *

The ID of the customer-owned address pool.

+ */ + private String customerOwnedIpv4Pool; + + /* + *

The network (vpc).

+ */ + private DomainTypeEnumValue domain; + + /* + *

The ID of the instance that the address is associated with (if any).

+ */ + private String instanceId; + + /* + *

The name of the unique set of Availability Zones, Local Zones, or Wavelength Zones from which Amazon Web + * Services advertises IP addresses.

+ */ + private String networkBorderGroup; + + /* + *

The ID of the network interface.

+ */ + private String networkInterfaceId; + + /* + *

The ID of the Amazon Web Services account that owns the network interface.

+ */ + private String networkInterfaceOwnerId; + + /* + *

The private IP address associated with the Elastic IP address.

+ */ + private String privateIpAddress; + + /* + *

The Elastic IP address.

+ */ + private String publicIp; + + /* + *

The ID of an address pool.

+ */ + private String publicIpv4Pool; + + /* + *

Any tags assigned to the Elastic IP address.

+ */ + private List tags; + + /** + * Creates an instance of AwsEc2AddressProperties class. + */ + public AwsEc2AddressProperties() { + } + + /** + * Get the allocationId property: <p>The ID representing the allocation of the address.</p>. + * + * @return the allocationId value. + */ + public String allocationId() { + return this.allocationId; + } + + /** + * Set the allocationId property: <p>The ID representing the allocation of the address.</p>. + * + * @param allocationId the allocationId value to set. + * @return the AwsEc2AddressProperties object itself. + */ + public AwsEc2AddressProperties withAllocationId(String allocationId) { + this.allocationId = allocationId; + return this; + } + + /** + * Get the associationId property: <p>The ID representing the association of the address with an + * instance.</p>. + * + * @return the associationId value. + */ + public String associationId() { + return this.associationId; + } + + /** + * Set the associationId property: <p>The ID representing the association of the address with an + * instance.</p>. + * + * @param associationId the associationId value to set. + * @return the AwsEc2AddressProperties object itself. + */ + public AwsEc2AddressProperties withAssociationId(String associationId) { + this.associationId = associationId; + return this; + } + + /** + * Get the carrierIp property: <p>The carrier IP address associated. This option is only available for network + * interfaces which reside in a subnet in a Wavelength Zone (for example an EC2 instance). </p>. + * + * @return the carrierIp value. + */ + public String carrierIp() { + return this.carrierIp; + } + + /** + * Set the carrierIp property: <p>The carrier IP address associated. This option is only available for network + * interfaces which reside in a subnet in a Wavelength Zone (for example an EC2 instance). </p>. + * + * @param carrierIp the carrierIp value to set. + * @return the AwsEc2AddressProperties object itself. + */ + public AwsEc2AddressProperties withCarrierIp(String carrierIp) { + this.carrierIp = carrierIp; + return this; + } + + /** + * Get the customerOwnedIp property: <p>The customer-owned IP address.</p>. + * + * @return the customerOwnedIp value. + */ + public String customerOwnedIp() { + return this.customerOwnedIp; + } + + /** + * Set the customerOwnedIp property: <p>The customer-owned IP address.</p>. + * + * @param customerOwnedIp the customerOwnedIp value to set. + * @return the AwsEc2AddressProperties object itself. + */ + public AwsEc2AddressProperties withCustomerOwnedIp(String customerOwnedIp) { + this.customerOwnedIp = customerOwnedIp; + return this; + } + + /** + * Get the customerOwnedIpv4Pool property: <p>The ID of the customer-owned address pool.</p>. + * + * @return the customerOwnedIpv4Pool value. + */ + public String customerOwnedIpv4Pool() { + return this.customerOwnedIpv4Pool; + } + + /** + * Set the customerOwnedIpv4Pool property: <p>The ID of the customer-owned address pool.</p>. + * + * @param customerOwnedIpv4Pool the customerOwnedIpv4Pool value to set. + * @return the AwsEc2AddressProperties object itself. + */ + public AwsEc2AddressProperties withCustomerOwnedIpv4Pool(String customerOwnedIpv4Pool) { + this.customerOwnedIpv4Pool = customerOwnedIpv4Pool; + return this; + } + + /** + * Get the domain property: <p>The network (<code>vpc</code>).</p>. + * + * @return the domain value. + */ + public DomainTypeEnumValue domain() { + return this.domain; + } + + /** + * Set the domain property: <p>The network (<code>vpc</code>).</p>. + * + * @param domain the domain value to set. + * @return the AwsEc2AddressProperties object itself. + */ + public AwsEc2AddressProperties withDomain(DomainTypeEnumValue domain) { + this.domain = domain; + return this; + } + + /** + * Get the instanceId property: <p>The ID of the instance that the address is associated with (if + * any).</p>. + * + * @return the instanceId value. + */ + public String instanceId() { + return this.instanceId; + } + + /** + * Set the instanceId property: <p>The ID of the instance that the address is associated with (if + * any).</p>. + * + * @param instanceId the instanceId value to set. + * @return the AwsEc2AddressProperties object itself. + */ + public AwsEc2AddressProperties withInstanceId(String instanceId) { + this.instanceId = instanceId; + return this; + } + + /** + * Get the networkBorderGroup property: <p>The name of the unique set of Availability Zones, Local Zones, or + * Wavelength Zones from which Amazon Web Services advertises IP addresses.</p>. + * + * @return the networkBorderGroup value. + */ + public String networkBorderGroup() { + return this.networkBorderGroup; + } + + /** + * Set the networkBorderGroup property: <p>The name of the unique set of Availability Zones, Local Zones, or + * Wavelength Zones from which Amazon Web Services advertises IP addresses.</p>. + * + * @param networkBorderGroup the networkBorderGroup value to set. + * @return the AwsEc2AddressProperties object itself. + */ + public AwsEc2AddressProperties withNetworkBorderGroup(String networkBorderGroup) { + this.networkBorderGroup = networkBorderGroup; + return this; + } + + /** + * Get the networkInterfaceId property: <p>The ID of the network interface.</p>. + * + * @return the networkInterfaceId value. + */ + public String networkInterfaceId() { + return this.networkInterfaceId; + } + + /** + * Set the networkInterfaceId property: <p>The ID of the network interface.</p>. + * + * @param networkInterfaceId the networkInterfaceId value to set. + * @return the AwsEc2AddressProperties object itself. + */ + public AwsEc2AddressProperties withNetworkInterfaceId(String networkInterfaceId) { + this.networkInterfaceId = networkInterfaceId; + return this; + } + + /** + * Get the networkInterfaceOwnerId property: <p>The ID of the Amazon Web Services account that owns the + * network interface.</p>. + * + * @return the networkInterfaceOwnerId value. + */ + public String networkInterfaceOwnerId() { + return this.networkInterfaceOwnerId; + } + + /** + * Set the networkInterfaceOwnerId property: <p>The ID of the Amazon Web Services account that owns the + * network interface.</p>. + * + * @param networkInterfaceOwnerId the networkInterfaceOwnerId value to set. + * @return the AwsEc2AddressProperties object itself. + */ + public AwsEc2AddressProperties withNetworkInterfaceOwnerId(String networkInterfaceOwnerId) { + this.networkInterfaceOwnerId = networkInterfaceOwnerId; + return this; + } + + /** + * Get the privateIpAddress property: <p>The private IP address associated with the Elastic IP + * address.</p>. + * + * @return the privateIpAddress value. + */ + public String privateIpAddress() { + return this.privateIpAddress; + } + + /** + * Set the privateIpAddress property: <p>The private IP address associated with the Elastic IP + * address.</p>. + * + * @param privateIpAddress the privateIpAddress value to set. + * @return the AwsEc2AddressProperties object itself. + */ + public AwsEc2AddressProperties withPrivateIpAddress(String privateIpAddress) { + this.privateIpAddress = privateIpAddress; + return this; + } + + /** + * Get the publicIp property: <p>The Elastic IP address.</p>. + * + * @return the publicIp value. + */ + public String publicIp() { + return this.publicIp; + } + + /** + * Set the publicIp property: <p>The Elastic IP address.</p>. + * + * @param publicIp the publicIp value to set. + * @return the AwsEc2AddressProperties object itself. + */ + public AwsEc2AddressProperties withPublicIp(String publicIp) { + this.publicIp = publicIp; + return this; + } + + /** + * Get the publicIpv4Pool property: <p>The ID of an address pool.</p>. + * + * @return the publicIpv4Pool value. + */ + public String publicIpv4Pool() { + return this.publicIpv4Pool; + } + + /** + * Set the publicIpv4Pool property: <p>The ID of an address pool.</p>. + * + * @param publicIpv4Pool the publicIpv4Pool value to set. + * @return the AwsEc2AddressProperties object itself. + */ + public AwsEc2AddressProperties withPublicIpv4Pool(String publicIpv4Pool) { + this.publicIpv4Pool = publicIpv4Pool; + return this; + } + + /** + * Get the tags property: <p>Any tags assigned to the Elastic IP address.</p>. + * + * @return the tags value. + */ + public List tags() { + return this.tags; + } + + /** + * Set the tags property: <p>Any tags assigned to the Elastic IP address.</p>. + * + * @param tags the tags value to set. + * @return the AwsEc2AddressProperties object itself. + */ + public AwsEc2AddressProperties withTags(List tags) { + this.tags = tags; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (domain() != null) { + domain().validate(); + } + if (tags() != null) { + tags().forEach(e -> e.validate()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("allocationId", this.allocationId); + jsonWriter.writeStringField("associationId", this.associationId); + jsonWriter.writeStringField("carrierIp", this.carrierIp); + jsonWriter.writeStringField("customerOwnedIp", this.customerOwnedIp); + jsonWriter.writeStringField("customerOwnedIpv4Pool", this.customerOwnedIpv4Pool); + jsonWriter.writeJsonField("domain", this.domain); + jsonWriter.writeStringField("instanceId", this.instanceId); + jsonWriter.writeStringField("networkBorderGroup", this.networkBorderGroup); + jsonWriter.writeStringField("networkInterfaceId", this.networkInterfaceId); + jsonWriter.writeStringField("networkInterfaceOwnerId", this.networkInterfaceOwnerId); + jsonWriter.writeStringField("privateIpAddress", this.privateIpAddress); + jsonWriter.writeStringField("publicIp", this.publicIp); + jsonWriter.writeStringField("publicIpv4Pool", this.publicIpv4Pool); + jsonWriter.writeArrayField("tags", this.tags, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AwsEc2AddressProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AwsEc2AddressProperties if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the AwsEc2AddressProperties. + */ + public static AwsEc2AddressProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AwsEc2AddressProperties deserializedAwsEc2AddressProperties = new AwsEc2AddressProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("allocationId".equals(fieldName)) { + deserializedAwsEc2AddressProperties.allocationId = reader.getString(); + } else if ("associationId".equals(fieldName)) { + deserializedAwsEc2AddressProperties.associationId = reader.getString(); + } else if ("carrierIp".equals(fieldName)) { + deserializedAwsEc2AddressProperties.carrierIp = reader.getString(); + } else if ("customerOwnedIp".equals(fieldName)) { + deserializedAwsEc2AddressProperties.customerOwnedIp = reader.getString(); + } else if ("customerOwnedIpv4Pool".equals(fieldName)) { + deserializedAwsEc2AddressProperties.customerOwnedIpv4Pool = reader.getString(); + } else if ("domain".equals(fieldName)) { + deserializedAwsEc2AddressProperties.domain = DomainTypeEnumValue.fromJson(reader); + } else if ("instanceId".equals(fieldName)) { + deserializedAwsEc2AddressProperties.instanceId = reader.getString(); + } else if ("networkBorderGroup".equals(fieldName)) { + deserializedAwsEc2AddressProperties.networkBorderGroup = reader.getString(); + } else if ("networkInterfaceId".equals(fieldName)) { + deserializedAwsEc2AddressProperties.networkInterfaceId = reader.getString(); + } else if ("networkInterfaceOwnerId".equals(fieldName)) { + deserializedAwsEc2AddressProperties.networkInterfaceOwnerId = reader.getString(); + } else if ("privateIpAddress".equals(fieldName)) { + deserializedAwsEc2AddressProperties.privateIpAddress = reader.getString(); + } else if ("publicIp".equals(fieldName)) { + deserializedAwsEc2AddressProperties.publicIp = reader.getString(); + } else if ("publicIpv4Pool".equals(fieldName)) { + deserializedAwsEc2AddressProperties.publicIpv4Pool = reader.getString(); + } else if ("tags".equals(fieldName)) { + List tags = reader.readArray(reader1 -> TagAutoGenerated9.fromJson(reader1)); + deserializedAwsEc2AddressProperties.tags = tags; + } else { + reader.skipChildren(); + } + } + + return deserializedAwsEc2AddressProperties; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/AwsEc2FlowLogProperties.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/AwsEc2FlowLogProperties.java new file mode 100644 index 000000000000..2d0af05687df --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/AwsEc2FlowLogProperties.java @@ -0,0 +1,474 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Definition of awsEc2FlowLog. + */ +@Fluent +public final class AwsEc2FlowLogProperties implements JsonSerializable { + /* + * The ARN of the IAM role that allows Amazon EC2 to publish flow logs across accounts. + */ + private String deliverCrossAccountRole; + + /* + * The ARN for the IAM role that permits Amazon EC2 to publish flow logs to a CloudWatch Logs log group in your + * account. If you specify LogDestinationType as s3 or kinesis-data-firehose, do not specify + * DeliverLogsPermissionArn or LogGroupName. + */ + private String deliverLogsPermissionArn; + + /* + * Property destinationOptions + */ + private DestinationOptionsModelProperties destinationOptions; + + /* + * The Flow Log ID + */ + private String id; + + /* + * Specifies the destination to which the flow log data is to be published. Flow log data can be published to a + * CloudWatch Logs log group, an Amazon S3 bucket, or a Kinesis Firehose stream. The value specified for this + * parameter depends on the value specified for LogDestinationType. + */ + private String logDestination; + + /* + * Specifies the type of destination to which the flow log data is to be published. Flow log data can be published + * to CloudWatch Logs or Amazon S3. + */ + private LogDestinationType logDestinationType; + + /* + * The fields to include in the flow log record, in the order in which they should appear. + */ + private String logFormat; + + /* + * The name of a new or existing CloudWatch Logs log group where Amazon EC2 publishes your flow logs. If you specify + * LogDestinationType as s3 or kinesis-data-firehose, do not specify DeliverLogsPermissionArn or LogGroupName. + */ + private String logGroupName; + + /* + * The maximum interval of time during which a flow of packets is captured and aggregated into a flow log record. + * You can specify 60 seconds (1 minute) or 600 seconds (10 minutes). + */ + private Integer maxAggregationInterval; + + /* + * The ID of the subnet, network interface, or VPC for which you want to create a flow log. + */ + private String resourceId; + + /* + * The type of resource for which to create the flow log. For example, if you specified a VPC ID for the ResourceId + * property, specify VPC for this property. + */ + private ResourceType resourceType; + + /* + * The tags to apply to the flow logs. + */ + private List tags; + + /* + * The type of traffic to log. You can log traffic that the resource accepts or rejects, or all traffic. + */ + private TrafficType trafficType; + + /** + * Creates an instance of AwsEc2FlowLogProperties class. + */ + public AwsEc2FlowLogProperties() { + } + + /** + * Get the deliverCrossAccountRole property: The ARN of the IAM role that allows Amazon EC2 to publish flow logs + * across accounts. + * + * @return the deliverCrossAccountRole value. + */ + public String deliverCrossAccountRole() { + return this.deliverCrossAccountRole; + } + + /** + * Set the deliverCrossAccountRole property: The ARN of the IAM role that allows Amazon EC2 to publish flow logs + * across accounts. + * + * @param deliverCrossAccountRole the deliverCrossAccountRole value to set. + * @return the AwsEc2FlowLogProperties object itself. + */ + public AwsEc2FlowLogProperties withDeliverCrossAccountRole(String deliverCrossAccountRole) { + this.deliverCrossAccountRole = deliverCrossAccountRole; + return this; + } + + /** + * Get the deliverLogsPermissionArn property: The ARN for the IAM role that permits Amazon EC2 to publish flow logs + * to a CloudWatch Logs log group in your account. If you specify LogDestinationType as s3 or kinesis-data-firehose, + * do not specify DeliverLogsPermissionArn or LogGroupName. + * + * @return the deliverLogsPermissionArn value. + */ + public String deliverLogsPermissionArn() { + return this.deliverLogsPermissionArn; + } + + /** + * Set the deliverLogsPermissionArn property: The ARN for the IAM role that permits Amazon EC2 to publish flow logs + * to a CloudWatch Logs log group in your account. If you specify LogDestinationType as s3 or kinesis-data-firehose, + * do not specify DeliverLogsPermissionArn or LogGroupName. + * + * @param deliverLogsPermissionArn the deliverLogsPermissionArn value to set. + * @return the AwsEc2FlowLogProperties object itself. + */ + public AwsEc2FlowLogProperties withDeliverLogsPermissionArn(String deliverLogsPermissionArn) { + this.deliverLogsPermissionArn = deliverLogsPermissionArn; + return this; + } + + /** + * Get the destinationOptions property: Property destinationOptions. + * + * @return the destinationOptions value. + */ + public DestinationOptionsModelProperties destinationOptions() { + return this.destinationOptions; + } + + /** + * Set the destinationOptions property: Property destinationOptions. + * + * @param destinationOptions the destinationOptions value to set. + * @return the AwsEc2FlowLogProperties object itself. + */ + public AwsEc2FlowLogProperties withDestinationOptions(DestinationOptionsModelProperties destinationOptions) { + this.destinationOptions = destinationOptions; + return this; + } + + /** + * Get the id property: The Flow Log ID. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Set the id property: The Flow Log ID. + * + * @param id the id value to set. + * @return the AwsEc2FlowLogProperties object itself. + */ + public AwsEc2FlowLogProperties withId(String id) { + this.id = id; + return this; + } + + /** + * Get the logDestination property: Specifies the destination to which the flow log data is to be published. Flow + * log data can be published to a CloudWatch Logs log group, an Amazon S3 bucket, or a Kinesis Firehose stream. The + * value specified for this parameter depends on the value specified for LogDestinationType. + * + * @return the logDestination value. + */ + public String logDestination() { + return this.logDestination; + } + + /** + * Set the logDestination property: Specifies the destination to which the flow log data is to be published. Flow + * log data can be published to a CloudWatch Logs log group, an Amazon S3 bucket, or a Kinesis Firehose stream. The + * value specified for this parameter depends on the value specified for LogDestinationType. + * + * @param logDestination the logDestination value to set. + * @return the AwsEc2FlowLogProperties object itself. + */ + public AwsEc2FlowLogProperties withLogDestination(String logDestination) { + this.logDestination = logDestination; + return this; + } + + /** + * Get the logDestinationType property: Specifies the type of destination to which the flow log data is to be + * published. Flow log data can be published to CloudWatch Logs or Amazon S3. + * + * @return the logDestinationType value. + */ + public LogDestinationType logDestinationType() { + return this.logDestinationType; + } + + /** + * Set the logDestinationType property: Specifies the type of destination to which the flow log data is to be + * published. Flow log data can be published to CloudWatch Logs or Amazon S3. + * + * @param logDestinationType the logDestinationType value to set. + * @return the AwsEc2FlowLogProperties object itself. + */ + public AwsEc2FlowLogProperties withLogDestinationType(LogDestinationType logDestinationType) { + this.logDestinationType = logDestinationType; + return this; + } + + /** + * Get the logFormat property: The fields to include in the flow log record, in the order in which they should + * appear. + * + * @return the logFormat value. + */ + public String logFormat() { + return this.logFormat; + } + + /** + * Set the logFormat property: The fields to include in the flow log record, in the order in which they should + * appear. + * + * @param logFormat the logFormat value to set. + * @return the AwsEc2FlowLogProperties object itself. + */ + public AwsEc2FlowLogProperties withLogFormat(String logFormat) { + this.logFormat = logFormat; + return this; + } + + /** + * Get the logGroupName property: The name of a new or existing CloudWatch Logs log group where Amazon EC2 publishes + * your flow logs. If you specify LogDestinationType as s3 or kinesis-data-firehose, do not specify + * DeliverLogsPermissionArn or LogGroupName. + * + * @return the logGroupName value. + */ + public String logGroupName() { + return this.logGroupName; + } + + /** + * Set the logGroupName property: The name of a new or existing CloudWatch Logs log group where Amazon EC2 publishes + * your flow logs. If you specify LogDestinationType as s3 or kinesis-data-firehose, do not specify + * DeliverLogsPermissionArn or LogGroupName. + * + * @param logGroupName the logGroupName value to set. + * @return the AwsEc2FlowLogProperties object itself. + */ + public AwsEc2FlowLogProperties withLogGroupName(String logGroupName) { + this.logGroupName = logGroupName; + return this; + } + + /** + * Get the maxAggregationInterval property: The maximum interval of time during which a flow of packets is captured + * and aggregated into a flow log record. You can specify 60 seconds (1 minute) or 600 seconds (10 minutes). + * + * @return the maxAggregationInterval value. + */ + public Integer maxAggregationInterval() { + return this.maxAggregationInterval; + } + + /** + * Set the maxAggregationInterval property: The maximum interval of time during which a flow of packets is captured + * and aggregated into a flow log record. You can specify 60 seconds (1 minute) or 600 seconds (10 minutes). + * + * @param maxAggregationInterval the maxAggregationInterval value to set. + * @return the AwsEc2FlowLogProperties object itself. + */ + public AwsEc2FlowLogProperties withMaxAggregationInterval(Integer maxAggregationInterval) { + this.maxAggregationInterval = maxAggregationInterval; + return this; + } + + /** + * Get the resourceId property: The ID of the subnet, network interface, or VPC for which you want to create a flow + * log. + * + * @return the resourceId value. + */ + public String resourceId() { + return this.resourceId; + } + + /** + * Set the resourceId property: The ID of the subnet, network interface, or VPC for which you want to create a flow + * log. + * + * @param resourceId the resourceId value to set. + * @return the AwsEc2FlowLogProperties object itself. + */ + public AwsEc2FlowLogProperties withResourceId(String resourceId) { + this.resourceId = resourceId; + return this; + } + + /** + * Get the resourceType property: The type of resource for which to create the flow log. For example, if you + * specified a VPC ID for the ResourceId property, specify VPC for this property. + * + * @return the resourceType value. + */ + public ResourceType resourceType() { + return this.resourceType; + } + + /** + * Set the resourceType property: The type of resource for which to create the flow log. For example, if you + * specified a VPC ID for the ResourceId property, specify VPC for this property. + * + * @param resourceType the resourceType value to set. + * @return the AwsEc2FlowLogProperties object itself. + */ + public AwsEc2FlowLogProperties withResourceType(ResourceType resourceType) { + this.resourceType = resourceType; + return this; + } + + /** + * Get the tags property: The tags to apply to the flow logs. + * + * @return the tags value. + */ + public List tags() { + return this.tags; + } + + /** + * Set the tags property: The tags to apply to the flow logs. + * + * @param tags the tags value to set. + * @return the AwsEc2FlowLogProperties object itself. + */ + public AwsEc2FlowLogProperties withTags(List tags) { + this.tags = tags; + return this; + } + + /** + * Get the trafficType property: The type of traffic to log. You can log traffic that the resource accepts or + * rejects, or all traffic. + * + * @return the trafficType value. + */ + public TrafficType trafficType() { + return this.trafficType; + } + + /** + * Set the trafficType property: The type of traffic to log. You can log traffic that the resource accepts or + * rejects, or all traffic. + * + * @param trafficType the trafficType value to set. + * @return the AwsEc2FlowLogProperties object itself. + */ + public AwsEc2FlowLogProperties withTrafficType(TrafficType trafficType) { + this.trafficType = trafficType; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (destinationOptions() != null) { + destinationOptions().validate(); + } + if (tags() != null) { + tags().forEach(e -> e.validate()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("deliverCrossAccountRole", this.deliverCrossAccountRole); + jsonWriter.writeStringField("deliverLogsPermissionArn", this.deliverLogsPermissionArn); + jsonWriter.writeJsonField("destinationOptions", this.destinationOptions); + jsonWriter.writeStringField("id", this.id); + jsonWriter.writeStringField("logDestination", this.logDestination); + jsonWriter.writeStringField("logDestinationType", + this.logDestinationType == null ? null : this.logDestinationType.toString()); + jsonWriter.writeStringField("logFormat", this.logFormat); + jsonWriter.writeStringField("logGroupName", this.logGroupName); + jsonWriter.writeNumberField("maxAggregationInterval", this.maxAggregationInterval); + jsonWriter.writeStringField("resourceId", this.resourceId); + jsonWriter.writeStringField("resourceType", this.resourceType == null ? null : this.resourceType.toString()); + jsonWriter.writeArrayField("tags", this.tags, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("trafficType", this.trafficType == null ? null : this.trafficType.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AwsEc2FlowLogProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AwsEc2FlowLogProperties if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the AwsEc2FlowLogProperties. + */ + public static AwsEc2FlowLogProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AwsEc2FlowLogProperties deserializedAwsEc2FlowLogProperties = new AwsEc2FlowLogProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("deliverCrossAccountRole".equals(fieldName)) { + deserializedAwsEc2FlowLogProperties.deliverCrossAccountRole = reader.getString(); + } else if ("deliverLogsPermissionArn".equals(fieldName)) { + deserializedAwsEc2FlowLogProperties.deliverLogsPermissionArn = reader.getString(); + } else if ("destinationOptions".equals(fieldName)) { + deserializedAwsEc2FlowLogProperties.destinationOptions + = DestinationOptionsModelProperties.fromJson(reader); + } else if ("id".equals(fieldName)) { + deserializedAwsEc2FlowLogProperties.id = reader.getString(); + } else if ("logDestination".equals(fieldName)) { + deserializedAwsEc2FlowLogProperties.logDestination = reader.getString(); + } else if ("logDestinationType".equals(fieldName)) { + deserializedAwsEc2FlowLogProperties.logDestinationType + = LogDestinationType.fromString(reader.getString()); + } else if ("logFormat".equals(fieldName)) { + deserializedAwsEc2FlowLogProperties.logFormat = reader.getString(); + } else if ("logGroupName".equals(fieldName)) { + deserializedAwsEc2FlowLogProperties.logGroupName = reader.getString(); + } else if ("maxAggregationInterval".equals(fieldName)) { + deserializedAwsEc2FlowLogProperties.maxAggregationInterval = reader.getNullable(JsonReader::getInt); + } else if ("resourceId".equals(fieldName)) { + deserializedAwsEc2FlowLogProperties.resourceId = reader.getString(); + } else if ("resourceType".equals(fieldName)) { + deserializedAwsEc2FlowLogProperties.resourceType = ResourceType.fromString(reader.getString()); + } else if ("tags".equals(fieldName)) { + List tags = reader.readArray(reader1 -> TagAutoGenerated10.fromJson(reader1)); + deserializedAwsEc2FlowLogProperties.tags = tags; + } else if ("trafficType".equals(fieldName)) { + deserializedAwsEc2FlowLogProperties.trafficType = TrafficType.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedAwsEc2FlowLogProperties; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/AwsEc2ImageProperties.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/AwsEc2ImageProperties.java new file mode 100644 index 000000000000..dc2fc2a5352b --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/AwsEc2ImageProperties.java @@ -0,0 +1,1163 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Definition of awsEc2Image. + */ +@Fluent +public final class AwsEc2ImageProperties implements JsonSerializable { + /* + *

The architecture of the image.

+ */ + private ArchitectureValuesEnumValue architecture; + + /* + *

Any block device mapping entries.

+ */ + private List blockDeviceMappings; + + /* + *

The boot mode of the image. For more information, see Boot modes in the Amazon EC2 User + * Guide.

+ */ + private BootModeValuesEnumValue bootMode; + + /* + *

The date and time the image was created.

+ */ + private String creationDate; + + /* + *

The date and time to deprecate the AMI, in UTC, in the following format: + * YYYY-MM-DDTHH:MM:SSZ. If you specified a value for seconds, Amazon EC2 + * rounds the seconds to the nearest minute.

+ */ + private String deprecationTime; + + /* + *

Indicates whether deregistration protection is enabled for the AMI.

+ */ + private String deregistrationProtection; + + /* + *

The description of the AMI that was provided during image creation.

+ */ + private String description; + + /* + *

Specifies whether enhanced networking with ENA is enabled.

+ */ + private Boolean enaSupport; + + /* + *

The hypervisor type of the image. Only xen is supported. ovm is not supported.

+ */ + private HypervisorTypeEnumValue hypervisor; + + /* + *

The ID of the AMI.

+ */ + private String imageId; + + /* + *

The location of the AMI.

+ */ + private String imageLocation; + + /* + *

The owner alias (amazon | aws-marketplace).

+ */ + private String imageOwnerAlias; + + /* + *

The type of image.

+ */ + private ImageTypeValuesEnumValue imageType; + + /* + *

If v2.0, it indicates that IMDSv2 is specified in the AMI. Instances launched from this AMI will + * have HttpTokens automatically set to required so that, by default, the instance + * requires that IMDSv2 is used when requesting instance metadata. In addition, HttpPutResponseHopLimit + * is set to 2. For more information, see Configure the AMI in the Amazon EC2 User Guide.

+ */ + private ImdsSupportValuesEnumValue imdsSupport; + + /* + *

The kernel associated with the image, if any. Only applicable for machine images.

+ */ + private String kernelId; + + /* + *

The date and time, in ISO 8601 date-time format, when the AMI was + * last used to launch an EC2 instance. When the AMI is used to launch an instance, there is a 24-hour delay before + * that usage is reported.

lastLaunchedTime data is available starting April 2017.

+ *
+ */ + private String lastLaunchedTime; + + /* + *

The name of the AMI that was provided during image creation.

+ */ + private String name; + + /* + *

The ID of the Amazon Web Services account that owns the image.

+ */ + private String ownerId; + + /* + *

This value is set to windows for Windows AMIs; otherwise, it is blank.

+ */ + private PlatformValuesEnumValue platform; + + /* + *

The platform details associated with the billing code of the AMI. For more information, see Understand AMI billing + * information in the Amazon EC2 User Guide.

+ */ + private String platformDetails; + + /* + *

Any product codes associated with the AMI.

+ */ + private List productCodes; + + /* + *

Indicates whether the image has public launch permissions. The value is true if this image has + * public launch permissions or false if it has only implicit and explicit launch permissions.

+ */ + private Boolean publicProperty; + + /* + *

The RAM disk associated with the image, if any. Only applicable for machine images.

+ */ + private String ramdiskId; + + /* + *

The device name of the root device volume (for example, /dev/sda1).

+ */ + private String rootDeviceName; + + /* + *

The type of root device used by the AMI. The AMI can use an Amazon EBS volume or an instance store volume.

+ */ + private DeviceTypeEnumValue rootDeviceType; + + /* + *

The ID of the instance that the AMI was created from if the AMI was created using CreateImage. This field + * only appears if the AMI was created using CreateImage.

+ */ + private String sourceInstanceId; + + /* + *

Specifies whether enhanced networking with the Intel 82599 Virtual Function interface is enabled.

+ */ + private String sriovNetSupport; + + /* + *

The current state of the AMI. If the state is available, the image is successfully registered and + * can be used to launch an instance.

+ */ + private ImageStateEnumValue state; + + /* + *

The reason for the state change.

+ */ + private StateReason stateReason; + + /* + *

Any tags assigned to the image.

+ */ + private List tags; + + /* + *

If the image is configured for NitroTPM support, the value is v2.0. For more information, see NitroTPM in the Amazon EC2 User + * Guide.

+ */ + private TpmSupportValuesEnumValue tpmSupport; + + /* + *

The operation of the Amazon EC2 instance and the billing code that is associated with the AMI. + * usageOperation corresponds to the + * lineitem/Operation column on your Amazon Web Services Cost and Usage Report and in the Amazon Web Services Price + * List API. You can view these fields on the Instances or AMIs pages in the Amazon EC2 console, + * or in the responses that are returned by the DescribeImages command + * in the Amazon EC2 API, or the describe-images command in + * the CLI.

+ */ + private String usageOperation; + + /* + *

The type of virtualization of the AMI.

+ */ + private VirtualizationTypeEnumValue virtualizationType; + + /** + * Creates an instance of AwsEc2ImageProperties class. + */ + public AwsEc2ImageProperties() { + } + + /** + * Get the architecture property: <p>The architecture of the image.</p>. + * + * @return the architecture value. + */ + public ArchitectureValuesEnumValue architecture() { + return this.architecture; + } + + /** + * Set the architecture property: <p>The architecture of the image.</p>. + * + * @param architecture the architecture value to set. + * @return the AwsEc2ImageProperties object itself. + */ + public AwsEc2ImageProperties withArchitecture(ArchitectureValuesEnumValue architecture) { + this.architecture = architecture; + return this; + } + + /** + * Get the blockDeviceMappings property: <p>Any block device mapping entries.</p>. + * + * @return the blockDeviceMappings value. + */ + public List blockDeviceMappings() { + return this.blockDeviceMappings; + } + + /** + * Set the blockDeviceMappings property: <p>Any block device mapping entries.</p>. + * + * @param blockDeviceMappings the blockDeviceMappings value to set. + * @return the AwsEc2ImageProperties object itself. + */ + public AwsEc2ImageProperties withBlockDeviceMappings(List blockDeviceMappings) { + this.blockDeviceMappings = blockDeviceMappings; + return this; + } + + /** + * Get the bootMode property: <p>The boot mode of the image. For more information, see <a + * href='https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ami-boot.html'>Boot modes</a> in the + * <i>Amazon EC2 User Guide</i>.</p>. + * + * @return the bootMode value. + */ + public BootModeValuesEnumValue bootMode() { + return this.bootMode; + } + + /** + * Set the bootMode property: <p>The boot mode of the image. For more information, see <a + * href='https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ami-boot.html'>Boot modes</a> in the + * <i>Amazon EC2 User Guide</i>.</p>. + * + * @param bootMode the bootMode value to set. + * @return the AwsEc2ImageProperties object itself. + */ + public AwsEc2ImageProperties withBootMode(BootModeValuesEnumValue bootMode) { + this.bootMode = bootMode; + return this; + } + + /** + * Get the creationDate property: <p>The date and time the image was created.</p>. + * + * @return the creationDate value. + */ + public String creationDate() { + return this.creationDate; + } + + /** + * Set the creationDate property: <p>The date and time the image was created.</p>. + * + * @param creationDate the creationDate value to set. + * @return the AwsEc2ImageProperties object itself. + */ + public AwsEc2ImageProperties withCreationDate(String creationDate) { + this.creationDate = creationDate; + return this; + } + + /** + * Get the deprecationTime property: <p>The date and time to deprecate the AMI, in UTC, in the following + * format: + * <i>YYYY</i>-<i>MM</i>-<i>DD</i>T<i>HH</i>:<i>MM</i>:<i>SS</i>Z. + * If you specified a value for seconds, Amazon EC2 rounds the seconds to the nearest minute.</p>. + * + * @return the deprecationTime value. + */ + public String deprecationTime() { + return this.deprecationTime; + } + + /** + * Set the deprecationTime property: <p>The date and time to deprecate the AMI, in UTC, in the following + * format: + * <i>YYYY</i>-<i>MM</i>-<i>DD</i>T<i>HH</i>:<i>MM</i>:<i>SS</i>Z. + * If you specified a value for seconds, Amazon EC2 rounds the seconds to the nearest minute.</p>. + * + * @param deprecationTime the deprecationTime value to set. + * @return the AwsEc2ImageProperties object itself. + */ + public AwsEc2ImageProperties withDeprecationTime(String deprecationTime) { + this.deprecationTime = deprecationTime; + return this; + } + + /** + * Get the deregistrationProtection property: <p>Indicates whether deregistration protection is enabled for + * the AMI.</p>. + * + * @return the deregistrationProtection value. + */ + public String deregistrationProtection() { + return this.deregistrationProtection; + } + + /** + * Set the deregistrationProtection property: <p>Indicates whether deregistration protection is enabled for + * the AMI.</p>. + * + * @param deregistrationProtection the deregistrationProtection value to set. + * @return the AwsEc2ImageProperties object itself. + */ + public AwsEc2ImageProperties withDeregistrationProtection(String deregistrationProtection) { + this.deregistrationProtection = deregistrationProtection; + return this; + } + + /** + * Get the description property: <p>The description of the AMI that was provided during image + * creation.</p>. + * + * @return the description value. + */ + public String description() { + return this.description; + } + + /** + * Set the description property: <p>The description of the AMI that was provided during image + * creation.</p>. + * + * @param description the description value to set. + * @return the AwsEc2ImageProperties object itself. + */ + public AwsEc2ImageProperties withDescription(String description) { + this.description = description; + return this; + } + + /** + * Get the enaSupport property: <p>Specifies whether enhanced networking with ENA is enabled.</p>. + * + * @return the enaSupport value. + */ + public Boolean enaSupport() { + return this.enaSupport; + } + + /** + * Set the enaSupport property: <p>Specifies whether enhanced networking with ENA is enabled.</p>. + * + * @param enaSupport the enaSupport value to set. + * @return the AwsEc2ImageProperties object itself. + */ + public AwsEc2ImageProperties withEnaSupport(Boolean enaSupport) { + this.enaSupport = enaSupport; + return this; + } + + /** + * Get the hypervisor property: <p>The hypervisor type of the image. Only <code>xen</code> is + * supported. <code>ovm</code> is not supported.</p>. + * + * @return the hypervisor value. + */ + public HypervisorTypeEnumValue hypervisor() { + return this.hypervisor; + } + + /** + * Set the hypervisor property: <p>The hypervisor type of the image. Only <code>xen</code> is + * supported. <code>ovm</code> is not supported.</p>. + * + * @param hypervisor the hypervisor value to set. + * @return the AwsEc2ImageProperties object itself. + */ + public AwsEc2ImageProperties withHypervisor(HypervisorTypeEnumValue hypervisor) { + this.hypervisor = hypervisor; + return this; + } + + /** + * Get the imageId property: <p>The ID of the AMI.</p>. + * + * @return the imageId value. + */ + public String imageId() { + return this.imageId; + } + + /** + * Set the imageId property: <p>The ID of the AMI.</p>. + * + * @param imageId the imageId value to set. + * @return the AwsEc2ImageProperties object itself. + */ + public AwsEc2ImageProperties withImageId(String imageId) { + this.imageId = imageId; + return this; + } + + /** + * Get the imageLocation property: <p>The location of the AMI.</p>. + * + * @return the imageLocation value. + */ + public String imageLocation() { + return this.imageLocation; + } + + /** + * Set the imageLocation property: <p>The location of the AMI.</p>. + * + * @param imageLocation the imageLocation value to set. + * @return the AwsEc2ImageProperties object itself. + */ + public AwsEc2ImageProperties withImageLocation(String imageLocation) { + this.imageLocation = imageLocation; + return this; + } + + /** + * Get the imageOwnerAlias property: <p>The owner alias (<code>amazon</code> | + * <code>aws-marketplace</code>).</p>. + * + * @return the imageOwnerAlias value. + */ + public String imageOwnerAlias() { + return this.imageOwnerAlias; + } + + /** + * Set the imageOwnerAlias property: <p>The owner alias (<code>amazon</code> | + * <code>aws-marketplace</code>).</p>. + * + * @param imageOwnerAlias the imageOwnerAlias value to set. + * @return the AwsEc2ImageProperties object itself. + */ + public AwsEc2ImageProperties withImageOwnerAlias(String imageOwnerAlias) { + this.imageOwnerAlias = imageOwnerAlias; + return this; + } + + /** + * Get the imageType property: <p>The type of image.</p>. + * + * @return the imageType value. + */ + public ImageTypeValuesEnumValue imageType() { + return this.imageType; + } + + /** + * Set the imageType property: <p>The type of image.</p>. + * + * @param imageType the imageType value to set. + * @return the AwsEc2ImageProperties object itself. + */ + public AwsEc2ImageProperties withImageType(ImageTypeValuesEnumValue imageType) { + this.imageType = imageType; + return this; + } + + /** + * Get the imdsSupport property: <p>If <code>v2.0</code>, it indicates that IMDSv2 is specified in + * the AMI. Instances launched from this AMI will have <code>HttpTokens</code> automatically set to + * <code>required</code> so that, by default, the instance requires that IMDSv2 is used when requesting + * instance metadata. In addition, <code>HttpPutResponseHopLimit</code> is set to + * <code>2</code>. For more information, see <a + * href='https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/configuring-IMDS-new-instances.html#configure-IMDS-new-instances-ami-configuration'>Configure + * the AMI</a> in the <i>Amazon EC2 User Guide</i>.</p>. + * + * @return the imdsSupport value. + */ + public ImdsSupportValuesEnumValue imdsSupport() { + return this.imdsSupport; + } + + /** + * Set the imdsSupport property: <p>If <code>v2.0</code>, it indicates that IMDSv2 is specified in + * the AMI. Instances launched from this AMI will have <code>HttpTokens</code> automatically set to + * <code>required</code> so that, by default, the instance requires that IMDSv2 is used when requesting + * instance metadata. In addition, <code>HttpPutResponseHopLimit</code> is set to + * <code>2</code>. For more information, see <a + * href='https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/configuring-IMDS-new-instances.html#configure-IMDS-new-instances-ami-configuration'>Configure + * the AMI</a> in the <i>Amazon EC2 User Guide</i>.</p>. + * + * @param imdsSupport the imdsSupport value to set. + * @return the AwsEc2ImageProperties object itself. + */ + public AwsEc2ImageProperties withImdsSupport(ImdsSupportValuesEnumValue imdsSupport) { + this.imdsSupport = imdsSupport; + return this; + } + + /** + * Get the kernelId property: <p>The kernel associated with the image, if any. Only applicable for machine + * images.</p>. + * + * @return the kernelId value. + */ + public String kernelId() { + return this.kernelId; + } + + /** + * Set the kernelId property: <p>The kernel associated with the image, if any. Only applicable for machine + * images.</p>. + * + * @param kernelId the kernelId value to set. + * @return the AwsEc2ImageProperties object itself. + */ + public AwsEc2ImageProperties withKernelId(String kernelId) { + this.kernelId = kernelId; + return this; + } + + /** + * Get the lastLaunchedTime property: <p>The date and time, in <a + * href='http://www.iso.org/iso/iso8601'>ISO 8601 date-time format</a>, when the AMI was last used to + * launch an EC2 instance. When the AMI is used to launch an instance, there is a 24-hour delay before that usage is + * reported.</p> <note> <p> <code>lastLaunchedTime</code> data is available starting + * April 2017.</p> </note>. + * + * @return the lastLaunchedTime value. + */ + public String lastLaunchedTime() { + return this.lastLaunchedTime; + } + + /** + * Set the lastLaunchedTime property: <p>The date and time, in <a + * href='http://www.iso.org/iso/iso8601'>ISO 8601 date-time format</a>, when the AMI was last used to + * launch an EC2 instance. When the AMI is used to launch an instance, there is a 24-hour delay before that usage is + * reported.</p> <note> <p> <code>lastLaunchedTime</code> data is available starting + * April 2017.</p> </note>. + * + * @param lastLaunchedTime the lastLaunchedTime value to set. + * @return the AwsEc2ImageProperties object itself. + */ + public AwsEc2ImageProperties withLastLaunchedTime(String lastLaunchedTime) { + this.lastLaunchedTime = lastLaunchedTime; + return this; + } + + /** + * Get the name property: <p>The name of the AMI that was provided during image creation.</p>. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: <p>The name of the AMI that was provided during image creation.</p>. + * + * @param name the name value to set. + * @return the AwsEc2ImageProperties object itself. + */ + public AwsEc2ImageProperties withName(String name) { + this.name = name; + return this; + } + + /** + * Get the ownerId property: <p>The ID of the Amazon Web Services account that owns the image.</p>. + * + * @return the ownerId value. + */ + public String ownerId() { + return this.ownerId; + } + + /** + * Set the ownerId property: <p>The ID of the Amazon Web Services account that owns the image.</p>. + * + * @param ownerId the ownerId value to set. + * @return the AwsEc2ImageProperties object itself. + */ + public AwsEc2ImageProperties withOwnerId(String ownerId) { + this.ownerId = ownerId; + return this; + } + + /** + * Get the platform property: <p>This value is set to <code>windows</code> for Windows AMIs; + * otherwise, it is blank.</p>. + * + * @return the platform value. + */ + public PlatformValuesEnumValue platform() { + return this.platform; + } + + /** + * Set the platform property: <p>This value is set to <code>windows</code> for Windows AMIs; + * otherwise, it is blank.</p>. + * + * @param platform the platform value to set. + * @return the AwsEc2ImageProperties object itself. + */ + public AwsEc2ImageProperties withPlatform(PlatformValuesEnumValue platform) { + this.platform = platform; + return this; + } + + /** + * Get the platformDetails property: <p>The platform details associated with the billing code of the AMI. For + * more information, see <a + * href='https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ami-billing-info.html'>Understand AMI billing + * information</a> in the <i>Amazon EC2 User Guide</i>.</p>. + * + * @return the platformDetails value. + */ + public String platformDetails() { + return this.platformDetails; + } + + /** + * Set the platformDetails property: <p>The platform details associated with the billing code of the AMI. For + * more information, see <a + * href='https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ami-billing-info.html'>Understand AMI billing + * information</a> in the <i>Amazon EC2 User Guide</i>.</p>. + * + * @param platformDetails the platformDetails value to set. + * @return the AwsEc2ImageProperties object itself. + */ + public AwsEc2ImageProperties withPlatformDetails(String platformDetails) { + this.platformDetails = platformDetails; + return this; + } + + /** + * Get the productCodes property: <p>Any product codes associated with the AMI.</p>. + * + * @return the productCodes value. + */ + public List productCodes() { + return this.productCodes; + } + + /** + * Set the productCodes property: <p>Any product codes associated with the AMI.</p>. + * + * @param productCodes the productCodes value to set. + * @return the AwsEc2ImageProperties object itself. + */ + public AwsEc2ImageProperties withProductCodes(List productCodes) { + this.productCodes = productCodes; + return this; + } + + /** + * Get the publicProperty property: <p>Indicates whether the image has public launch permissions. The value is + * <code>true</code> if this image has public launch permissions or <code>false</code> if it + * has only implicit and explicit launch permissions.</p>. + * + * @return the publicProperty value. + */ + public Boolean publicProperty() { + return this.publicProperty; + } + + /** + * Set the publicProperty property: <p>Indicates whether the image has public launch permissions. The value is + * <code>true</code> if this image has public launch permissions or <code>false</code> if it + * has only implicit and explicit launch permissions.</p>. + * + * @param publicProperty the publicProperty value to set. + * @return the AwsEc2ImageProperties object itself. + */ + public AwsEc2ImageProperties withPublicProperty(Boolean publicProperty) { + this.publicProperty = publicProperty; + return this; + } + + /** + * Get the ramdiskId property: <p>The RAM disk associated with the image, if any. Only applicable for machine + * images.</p>. + * + * @return the ramdiskId value. + */ + public String ramdiskId() { + return this.ramdiskId; + } + + /** + * Set the ramdiskId property: <p>The RAM disk associated with the image, if any. Only applicable for machine + * images.</p>. + * + * @param ramdiskId the ramdiskId value to set. + * @return the AwsEc2ImageProperties object itself. + */ + public AwsEc2ImageProperties withRamdiskId(String ramdiskId) { + this.ramdiskId = ramdiskId; + return this; + } + + /** + * Get the rootDeviceName property: <p>The device name of the root device volume (for example, + * <code>/dev/sda1</code>).</p>. + * + * @return the rootDeviceName value. + */ + public String rootDeviceName() { + return this.rootDeviceName; + } + + /** + * Set the rootDeviceName property: <p>The device name of the root device volume (for example, + * <code>/dev/sda1</code>).</p>. + * + * @param rootDeviceName the rootDeviceName value to set. + * @return the AwsEc2ImageProperties object itself. + */ + public AwsEc2ImageProperties withRootDeviceName(String rootDeviceName) { + this.rootDeviceName = rootDeviceName; + return this; + } + + /** + * Get the rootDeviceType property: <p>The type of root device used by the AMI. The AMI can use an Amazon EBS + * volume or an instance store volume.</p>. + * + * @return the rootDeviceType value. + */ + public DeviceTypeEnumValue rootDeviceType() { + return this.rootDeviceType; + } + + /** + * Set the rootDeviceType property: <p>The type of root device used by the AMI. The AMI can use an Amazon EBS + * volume or an instance store volume.</p>. + * + * @param rootDeviceType the rootDeviceType value to set. + * @return the AwsEc2ImageProperties object itself. + */ + public AwsEc2ImageProperties withRootDeviceType(DeviceTypeEnumValue rootDeviceType) { + this.rootDeviceType = rootDeviceType; + return this; + } + + /** + * Get the sourceInstanceId property: <p>The ID of the instance that the AMI was created from if the AMI was + * created using <a + * href='https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_CreateImage.html'>CreateImage</a>. This + * field only appears if the AMI was created using CreateImage.</p>. + * + * @return the sourceInstanceId value. + */ + public String sourceInstanceId() { + return this.sourceInstanceId; + } + + /** + * Set the sourceInstanceId property: <p>The ID of the instance that the AMI was created from if the AMI was + * created using <a + * href='https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_CreateImage.html'>CreateImage</a>. This + * field only appears if the AMI was created using CreateImage.</p>. + * + * @param sourceInstanceId the sourceInstanceId value to set. + * @return the AwsEc2ImageProperties object itself. + */ + public AwsEc2ImageProperties withSourceInstanceId(String sourceInstanceId) { + this.sourceInstanceId = sourceInstanceId; + return this; + } + + /** + * Get the sriovNetSupport property: <p>Specifies whether enhanced networking with the Intel 82599 Virtual + * Function interface is enabled.</p>. + * + * @return the sriovNetSupport value. + */ + public String sriovNetSupport() { + return this.sriovNetSupport; + } + + /** + * Set the sriovNetSupport property: <p>Specifies whether enhanced networking with the Intel 82599 Virtual + * Function interface is enabled.</p>. + * + * @param sriovNetSupport the sriovNetSupport value to set. + * @return the AwsEc2ImageProperties object itself. + */ + public AwsEc2ImageProperties withSriovNetSupport(String sriovNetSupport) { + this.sriovNetSupport = sriovNetSupport; + return this; + } + + /** + * Get the state property: <p>The current state of the AMI. If the state is + * <code>available</code>, the image is successfully registered and can be used to launch an + * instance.</p>. + * + * @return the state value. + */ + public ImageStateEnumValue state() { + return this.state; + } + + /** + * Set the state property: <p>The current state of the AMI. If the state is + * <code>available</code>, the image is successfully registered and can be used to launch an + * instance.</p>. + * + * @param state the state value to set. + * @return the AwsEc2ImageProperties object itself. + */ + public AwsEc2ImageProperties withState(ImageStateEnumValue state) { + this.state = state; + return this; + } + + /** + * Get the stateReason property: <p>The reason for the state change.</p>. + * + * @return the stateReason value. + */ + public StateReason stateReason() { + return this.stateReason; + } + + /** + * Set the stateReason property: <p>The reason for the state change.</p>. + * + * @param stateReason the stateReason value to set. + * @return the AwsEc2ImageProperties object itself. + */ + public AwsEc2ImageProperties withStateReason(StateReason stateReason) { + this.stateReason = stateReason; + return this; + } + + /** + * Get the tags property: <p>Any tags assigned to the image.</p>. + * + * @return the tags value. + */ + public List tags() { + return this.tags; + } + + /** + * Set the tags property: <p>Any tags assigned to the image.</p>. + * + * @param tags the tags value to set. + * @return the AwsEc2ImageProperties object itself. + */ + public AwsEc2ImageProperties withTags(List tags) { + this.tags = tags; + return this; + } + + /** + * Get the tpmSupport property: <p>If the image is configured for NitroTPM support, the value is + * <code>v2.0</code>. For more information, see <a + * href='https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/nitrotpm.html'>NitroTPM</a> in the + * <i>Amazon EC2 User Guide</i>.</p>. + * + * @return the tpmSupport value. + */ + public TpmSupportValuesEnumValue tpmSupport() { + return this.tpmSupport; + } + + /** + * Set the tpmSupport property: <p>If the image is configured for NitroTPM support, the value is + * <code>v2.0</code>. For more information, see <a + * href='https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/nitrotpm.html'>NitroTPM</a> in the + * <i>Amazon EC2 User Guide</i>.</p>. + * + * @param tpmSupport the tpmSupport value to set. + * @return the AwsEc2ImageProperties object itself. + */ + public AwsEc2ImageProperties withTpmSupport(TpmSupportValuesEnumValue tpmSupport) { + this.tpmSupport = tpmSupport; + return this; + } + + /** + * Get the usageOperation property: <p>The operation of the Amazon EC2 instance and the billing code that is + * associated with the AMI. <code>usageOperation</code> corresponds to the <a + * href='https://docs.aws.amazon.com/cur/latest/userguide/Lineitem-columns.html#Lineitem-details-O-Operation'>lineitem/Operation</a> + * column on your Amazon Web Services Cost and Usage Report and in the <a + * href='https://docs.aws.amazon.com/awsaccountbilling/latest/aboutv2/price-changes.html'>Amazon Web Services + * Price List API</a>. You can view these fields on the <b>Instances</b> or + * <b>AMIs</b> pages in the Amazon EC2 console, or in the responses that are returned by the <a + * href='https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_DescribeImages.html'>DescribeImages</a> + * command in the Amazon EC2 API, or the <a + * href='https://docs.aws.amazon.com/cli/latest/reference/ec2/describe-images.html'>describe-images</a> + * command in the CLI.</p>. + * + * @return the usageOperation value. + */ + public String usageOperation() { + return this.usageOperation; + } + + /** + * Set the usageOperation property: <p>The operation of the Amazon EC2 instance and the billing code that is + * associated with the AMI. <code>usageOperation</code> corresponds to the <a + * href='https://docs.aws.amazon.com/cur/latest/userguide/Lineitem-columns.html#Lineitem-details-O-Operation'>lineitem/Operation</a> + * column on your Amazon Web Services Cost and Usage Report and in the <a + * href='https://docs.aws.amazon.com/awsaccountbilling/latest/aboutv2/price-changes.html'>Amazon Web Services + * Price List API</a>. You can view these fields on the <b>Instances</b> or + * <b>AMIs</b> pages in the Amazon EC2 console, or in the responses that are returned by the <a + * href='https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_DescribeImages.html'>DescribeImages</a> + * command in the Amazon EC2 API, or the <a + * href='https://docs.aws.amazon.com/cli/latest/reference/ec2/describe-images.html'>describe-images</a> + * command in the CLI.</p>. + * + * @param usageOperation the usageOperation value to set. + * @return the AwsEc2ImageProperties object itself. + */ + public AwsEc2ImageProperties withUsageOperation(String usageOperation) { + this.usageOperation = usageOperation; + return this; + } + + /** + * Get the virtualizationType property: <p>The type of virtualization of the AMI.</p>. + * + * @return the virtualizationType value. + */ + public VirtualizationTypeEnumValue virtualizationType() { + return this.virtualizationType; + } + + /** + * Set the virtualizationType property: <p>The type of virtualization of the AMI.</p>. + * + * @param virtualizationType the virtualizationType value to set. + * @return the AwsEc2ImageProperties object itself. + */ + public AwsEc2ImageProperties withVirtualizationType(VirtualizationTypeEnumValue virtualizationType) { + this.virtualizationType = virtualizationType; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (architecture() != null) { + architecture().validate(); + } + if (blockDeviceMappings() != null) { + blockDeviceMappings().forEach(e -> e.validate()); + } + if (bootMode() != null) { + bootMode().validate(); + } + if (hypervisor() != null) { + hypervisor().validate(); + } + if (imageType() != null) { + imageType().validate(); + } + if (imdsSupport() != null) { + imdsSupport().validate(); + } + if (platform() != null) { + platform().validate(); + } + if (productCodes() != null) { + productCodes().forEach(e -> e.validate()); + } + if (rootDeviceType() != null) { + rootDeviceType().validate(); + } + if (state() != null) { + state().validate(); + } + if (stateReason() != null) { + stateReason().validate(); + } + if (tags() != null) { + tags().forEach(e -> e.validate()); + } + if (tpmSupport() != null) { + tpmSupport().validate(); + } + if (virtualizationType() != null) { + virtualizationType().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("architecture", this.architecture); + jsonWriter.writeArrayField("blockDeviceMappings", this.blockDeviceMappings, + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeJsonField("bootMode", this.bootMode); + jsonWriter.writeStringField("creationDate", this.creationDate); + jsonWriter.writeStringField("deprecationTime", this.deprecationTime); + jsonWriter.writeStringField("deregistrationProtection", this.deregistrationProtection); + jsonWriter.writeStringField("description", this.description); + jsonWriter.writeBooleanField("enaSupport", this.enaSupport); + jsonWriter.writeJsonField("hypervisor", this.hypervisor); + jsonWriter.writeStringField("imageId", this.imageId); + jsonWriter.writeStringField("imageLocation", this.imageLocation); + jsonWriter.writeStringField("imageOwnerAlias", this.imageOwnerAlias); + jsonWriter.writeJsonField("imageType", this.imageType); + jsonWriter.writeJsonField("imdsSupport", this.imdsSupport); + jsonWriter.writeStringField("kernelId", this.kernelId); + jsonWriter.writeStringField("lastLaunchedTime", this.lastLaunchedTime); + jsonWriter.writeStringField("name", this.name); + jsonWriter.writeStringField("ownerId", this.ownerId); + jsonWriter.writeJsonField("platform", this.platform); + jsonWriter.writeStringField("platformDetails", this.platformDetails); + jsonWriter.writeArrayField("productCodes", this.productCodes, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeBooleanField("public", this.publicProperty); + jsonWriter.writeStringField("ramdiskId", this.ramdiskId); + jsonWriter.writeStringField("rootDeviceName", this.rootDeviceName); + jsonWriter.writeJsonField("rootDeviceType", this.rootDeviceType); + jsonWriter.writeStringField("sourceInstanceId", this.sourceInstanceId); + jsonWriter.writeStringField("sriovNetSupport", this.sriovNetSupport); + jsonWriter.writeJsonField("state", this.state); + jsonWriter.writeJsonField("stateReason", this.stateReason); + jsonWriter.writeArrayField("tags", this.tags, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeJsonField("tpmSupport", this.tpmSupport); + jsonWriter.writeStringField("usageOperation", this.usageOperation); + jsonWriter.writeJsonField("virtualizationType", this.virtualizationType); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AwsEc2ImageProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AwsEc2ImageProperties if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the AwsEc2ImageProperties. + */ + public static AwsEc2ImageProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AwsEc2ImageProperties deserializedAwsEc2ImageProperties = new AwsEc2ImageProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("architecture".equals(fieldName)) { + deserializedAwsEc2ImageProperties.architecture = ArchitectureValuesEnumValue.fromJson(reader); + } else if ("blockDeviceMappings".equals(fieldName)) { + List blockDeviceMappings + = reader.readArray(reader1 -> BlockDeviceMapping.fromJson(reader1)); + deserializedAwsEc2ImageProperties.blockDeviceMappings = blockDeviceMappings; + } else if ("bootMode".equals(fieldName)) { + deserializedAwsEc2ImageProperties.bootMode = BootModeValuesEnumValue.fromJson(reader); + } else if ("creationDate".equals(fieldName)) { + deserializedAwsEc2ImageProperties.creationDate = reader.getString(); + } else if ("deprecationTime".equals(fieldName)) { + deserializedAwsEc2ImageProperties.deprecationTime = reader.getString(); + } else if ("deregistrationProtection".equals(fieldName)) { + deserializedAwsEc2ImageProperties.deregistrationProtection = reader.getString(); + } else if ("description".equals(fieldName)) { + deserializedAwsEc2ImageProperties.description = reader.getString(); + } else if ("enaSupport".equals(fieldName)) { + deserializedAwsEc2ImageProperties.enaSupport = reader.getNullable(JsonReader::getBoolean); + } else if ("hypervisor".equals(fieldName)) { + deserializedAwsEc2ImageProperties.hypervisor = HypervisorTypeEnumValue.fromJson(reader); + } else if ("imageId".equals(fieldName)) { + deserializedAwsEc2ImageProperties.imageId = reader.getString(); + } else if ("imageLocation".equals(fieldName)) { + deserializedAwsEc2ImageProperties.imageLocation = reader.getString(); + } else if ("imageOwnerAlias".equals(fieldName)) { + deserializedAwsEc2ImageProperties.imageOwnerAlias = reader.getString(); + } else if ("imageType".equals(fieldName)) { + deserializedAwsEc2ImageProperties.imageType = ImageTypeValuesEnumValue.fromJson(reader); + } else if ("imdsSupport".equals(fieldName)) { + deserializedAwsEc2ImageProperties.imdsSupport = ImdsSupportValuesEnumValue.fromJson(reader); + } else if ("kernelId".equals(fieldName)) { + deserializedAwsEc2ImageProperties.kernelId = reader.getString(); + } else if ("lastLaunchedTime".equals(fieldName)) { + deserializedAwsEc2ImageProperties.lastLaunchedTime = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedAwsEc2ImageProperties.name = reader.getString(); + } else if ("ownerId".equals(fieldName)) { + deserializedAwsEc2ImageProperties.ownerId = reader.getString(); + } else if ("platform".equals(fieldName)) { + deserializedAwsEc2ImageProperties.platform = PlatformValuesEnumValue.fromJson(reader); + } else if ("platformDetails".equals(fieldName)) { + deserializedAwsEc2ImageProperties.platformDetails = reader.getString(); + } else if ("productCodes".equals(fieldName)) { + List productCodes = reader.readArray(reader1 -> ProductCode.fromJson(reader1)); + deserializedAwsEc2ImageProperties.productCodes = productCodes; + } else if ("public".equals(fieldName)) { + deserializedAwsEc2ImageProperties.publicProperty = reader.getNullable(JsonReader::getBoolean); + } else if ("ramdiskId".equals(fieldName)) { + deserializedAwsEc2ImageProperties.ramdiskId = reader.getString(); + } else if ("rootDeviceName".equals(fieldName)) { + deserializedAwsEc2ImageProperties.rootDeviceName = reader.getString(); + } else if ("rootDeviceType".equals(fieldName)) { + deserializedAwsEc2ImageProperties.rootDeviceType = DeviceTypeEnumValue.fromJson(reader); + } else if ("sourceInstanceId".equals(fieldName)) { + deserializedAwsEc2ImageProperties.sourceInstanceId = reader.getString(); + } else if ("sriovNetSupport".equals(fieldName)) { + deserializedAwsEc2ImageProperties.sriovNetSupport = reader.getString(); + } else if ("state".equals(fieldName)) { + deserializedAwsEc2ImageProperties.state = ImageStateEnumValue.fromJson(reader); + } else if ("stateReason".equals(fieldName)) { + deserializedAwsEc2ImageProperties.stateReason = StateReason.fromJson(reader); + } else if ("tags".equals(fieldName)) { + List tags = reader.readArray(reader1 -> TagAutoGenerated11.fromJson(reader1)); + deserializedAwsEc2ImageProperties.tags = tags; + } else if ("tpmSupport".equals(fieldName)) { + deserializedAwsEc2ImageProperties.tpmSupport = TpmSupportValuesEnumValue.fromJson(reader); + } else if ("usageOperation".equals(fieldName)) { + deserializedAwsEc2ImageProperties.usageOperation = reader.getString(); + } else if ("virtualizationType".equals(fieldName)) { + deserializedAwsEc2ImageProperties.virtualizationType = VirtualizationTypeEnumValue.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedAwsEc2ImageProperties; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/AwsEc2InstanceProperties.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/AwsEc2InstanceProperties.java new file mode 100644 index 000000000000..6dd85c2743cd --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/AwsEc2InstanceProperties.java @@ -0,0 +1,1908 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.time.OffsetDateTime; +import java.time.format.DateTimeFormatter; +import java.util.List; + +/** + * Definition of awsEc2Instance. + */ +@Fluent +public final class AwsEc2InstanceProperties implements JsonSerializable { + /* + *

The AMI launch index, which can be used to find this instance in the launch group.

+ */ + private Integer amiLaunchIndex; + + /* + *

The architecture of the image.

+ */ + private ArchitectureValuesEnumValue architecture; + + /* + *

Any block device mapping entries for the instance.

+ */ + private List blockDeviceMappings; + + /* + *

The boot mode that was specified by the AMI. If the value is uefi-preferred, the AMI supports + * both UEFI and Legacy BIOS. The currentInstanceBootMode parameter is the boot mode that is used to + * boot the instance at launch or start.

The operating system contained in the AMI must be configured + * to support the specified boot mode.

For more information, see Boot modes in the Amazon EC2 User + * Guide.

+ */ + private BootModeValuesEnumValue bootMode; + + /* + *

The ID of the Capacity Reservation.

+ */ + private String capacityReservationId; + + /* + *

Information about the Capacity Reservation targeting option.

+ */ + private CapacityReservationSpecificationResponse capacityReservationSpecification; + + /* + *

The idempotency token you provided when you launched the instance, if applicable.

+ */ + private String clientToken; + + /* + *

The CPU options for the instance.

+ */ + private CpuOptions cpuOptions; + + /* + *

The boot mode that is used to boot the instance at launch or start. For more information, see Boot modes in the Amazon EC2 User + * Guide.

+ */ + private InstanceBootModeValuesEnumValue currentInstanceBootMode; + + /* + *

Indicates whether the instance is optimized for Amazon EBS I/O. This optimization provides dedicated + * throughput to Amazon EBS and an optimized configuration stack to provide optimal I/O performance. This + * optimization isn't available with all instance types. Additional usage charges apply when using an EBS Optimized + * instance.

+ */ + private Boolean ebsOptimized; + + /* + *

Deprecated.

Amazon Elastic Graphics reached end of life on January 8, 2024. For workloads that + * require graphics acceleration, we recommend that you use Amazon EC2 G4ad, G4dn, or G5 instances.

+ */ + private List elasticGpuAssociations; + + /* + *

The elastic inference accelerator associated with the instance.

+ */ + private List elasticInferenceAcceleratorAssociations; + + /* + *

Specifies whether enhanced networking with ENA is enabled.

+ */ + private Boolean enaSupport; + + /* + *

Indicates whether the instance is enabled for Amazon Web Services Nitro Enclaves.

+ */ + private EnclaveOptions enclaveOptions; + + /* + *

Indicates whether the instance is enabled for hibernation.

+ */ + private HibernationOptions hibernationOptions; + + /* + *

The hypervisor type of the instance. The value xen is used for both Xen and Nitro + * hypervisors.

+ */ + private HypervisorTypeEnumValue hypervisor; + + /* + *

The IAM instance profile associated with the instance, if applicable.

+ */ + private IamInstanceProfile iamInstanceProfile; + + /* + *

The ID of the AMI used to launch the instance.

+ */ + private String imageId; + + /* + *

The ID of the instance.

+ */ + private String instanceId; + + /* + *

Indicates whether this is a Spot Instance or a Scheduled Instance.

+ */ + private InstanceLifecycleTypeEnumValue instanceLifecycle; + + /* + *

The instance type.

+ */ + private InstanceTypeEnumValue instanceType; + + /* + *

The IPv6 address assigned to the instance.

+ */ + private String ipv6Address; + + /* + *

The kernel associated with this instance, if applicable.

+ */ + private String kernelId; + + /* + *

The name of the key pair, if this instance was launched with an associated key pair.

+ */ + private String keyName; + + /* + *

The time the instance was launched.

+ */ + private OffsetDateTime launchTime; + + /* + *

The license configurations for the instance.

+ */ + private List licenses; + + /* + *

Provides information on the recovery and maintenance options of your instance.

+ */ + private InstanceMaintenanceOptions maintenanceOptions; + + /* + *

The metadata options for the instance.

+ */ + private InstanceMetadataOptionsResponse metadataOptions; + + /* + *

The monitoring for the instance.

+ */ + private Monitoring monitoring; + + /* + *

The network interfaces for the instance.

+ */ + private List networkInterfaces; + + /* + *

The Amazon Resource Name (ARN) of the Outpost.

+ */ + private String outpostArn; + + /* + *

The location where the instance launched, if applicable.

+ */ + private Placement placement; + + /* + *

The platform. This value is windows for Windows instances; otherwise, it is empty.

+ */ + private PlatformValuesEnumValue platform; + + /* + *

The platform details value for the instance. For more information, see AMI billing information + * fields in the Amazon EC2 User Guide.

+ */ + private String platformDetails; + + /* + *

[IPv4 only] The private DNS hostname name assigned to the instance. This DNS hostname can only be used inside + * the Amazon EC2 network. This name is not available until the instance enters the running state.

+ *

The Amazon-provided DNS server resolves Amazon-provided private DNS hostnames if you've enabled DNS resolution + * and DNS hostnames in your VPC. If you are not using the Amazon-provided DNS server in your VPC, your custom + * domain name servers must resolve the hostname as appropriate.

+ */ + private String privateDnsName; + + /* + *

The options for the instance hostname.

+ */ + private PrivateDnsNameOptionsResponse privateDnsNameOptions; + + /* + *

The private IPv4 address assigned to the instance.

+ */ + private String privateIpAddress; + + /* + *

The product codes attached to this instance, if applicable.

+ */ + private List productCodes; + + /* + *

[IPv4 only] The public DNS name assigned to the instance. This name is not available until the instance enters + * the running state. This name is only available if you've enabled DNS hostnames for your VPC.

+ */ + private String publicDnsName; + + /* + *

The public IPv4 address, or the Carrier IP address assigned to the instance, if applicable.

A Carrier + * IP address only applies to an instance launched in a subnet associated with a Wavelength Zone.

+ */ + private String publicIpAddress; + + /* + *

The RAM disk associated with this instance, if applicable.

+ */ + private String ramdiskId; + + /* + *

The device name of the root device volume (for example, /dev/sda1).

+ */ + private String rootDeviceName; + + /* + *

The root device type used by the AMI. The AMI can use an EBS volume or an instance store volume.

+ */ + private DeviceTypeEnumValue rootDeviceType; + + /* + *

The security groups for the instance.

+ */ + private List securityGroups; + + /* + *

Indicates whether source/destination checking is enabled.

+ */ + private Boolean sourceDestCheck; + + /* + *

If the request is a Spot Instance request, the ID of the request.

+ */ + private String spotInstanceRequestId; + + /* + *

Specifies whether enhanced networking with the Intel 82599 Virtual Function interface is enabled.

+ */ + private String sriovNetSupport; + + /* + *

The current state of the instance.

+ */ + private InstanceState state; + + /* + *

The reason for the most recent state transition.

+ */ + private StateReason stateReason; + + /* + *

The reason for the most recent state transition. This might be an empty string.

+ */ + private String stateTransitionReason; + + /* + *

The ID of the subnet in which the instance is running.

+ */ + private String subnetId; + + /* + *

Any tags assigned to the instance.

+ */ + private List tags; + + /* + *

If the instance is configured for NitroTPM support, the value is v2.0. For more information, see + * NitroTPM in the Amazon EC2 + * User Guide.

+ */ + private String tpmSupport; + + /* + *

The usage operation value for the instance. For more information, see AMI billing information + * fields in the Amazon EC2 User Guide.

+ */ + private String usageOperation; + + /* + *

The time that the usage operation was last updated.

+ */ + private OffsetDateTime usageOperationUpdateTime; + + /* + *

The virtualization type of the instance.

+ */ + private VirtualizationTypeEnumValue virtualizationType; + + /* + *

The ID of the VPC in which the instance is running.

+ */ + private String vpcId; + + /** + * Creates an instance of AwsEc2InstanceProperties class. + */ + public AwsEc2InstanceProperties() { + } + + /** + * Get the amiLaunchIndex property: <p>The AMI launch index, which can be used to find this instance in the + * launch group.</p>. + * + * @return the amiLaunchIndex value. + */ + public Integer amiLaunchIndex() { + return this.amiLaunchIndex; + } + + /** + * Set the amiLaunchIndex property: <p>The AMI launch index, which can be used to find this instance in the + * launch group.</p>. + * + * @param amiLaunchIndex the amiLaunchIndex value to set. + * @return the AwsEc2InstanceProperties object itself. + */ + public AwsEc2InstanceProperties withAmiLaunchIndex(Integer amiLaunchIndex) { + this.amiLaunchIndex = amiLaunchIndex; + return this; + } + + /** + * Get the architecture property: <p>The architecture of the image.</p>. + * + * @return the architecture value. + */ + public ArchitectureValuesEnumValue architecture() { + return this.architecture; + } + + /** + * Set the architecture property: <p>The architecture of the image.</p>. + * + * @param architecture the architecture value to set. + * @return the AwsEc2InstanceProperties object itself. + */ + public AwsEc2InstanceProperties withArchitecture(ArchitectureValuesEnumValue architecture) { + this.architecture = architecture; + return this; + } + + /** + * Get the blockDeviceMappings property: <p>Any block device mapping entries for the instance.</p>. + * + * @return the blockDeviceMappings value. + */ + public List blockDeviceMappings() { + return this.blockDeviceMappings; + } + + /** + * Set the blockDeviceMappings property: <p>Any block device mapping entries for the instance.</p>. + * + * @param blockDeviceMappings the blockDeviceMappings value to set. + * @return the AwsEc2InstanceProperties object itself. + */ + public AwsEc2InstanceProperties withBlockDeviceMappings(List blockDeviceMappings) { + this.blockDeviceMappings = blockDeviceMappings; + return this; + } + + /** + * Get the bootMode property: <p>The boot mode that was specified by the AMI. If the value is + * <code>uefi-preferred</code>, the AMI supports both UEFI and Legacy BIOS. The + * <code>currentInstanceBootMode</code> parameter is the boot mode that is used to boot the instance at + * launch or start.</p> <note> <p>The operating system contained in the AMI must be configured to + * support the specified boot mode.</p> </note> <p>For more information, see <a + * href='https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ami-boot.html'>Boot modes</a> in the + * <i>Amazon EC2 User Guide</i>.</p>. + * + * @return the bootMode value. + */ + public BootModeValuesEnumValue bootMode() { + return this.bootMode; + } + + /** + * Set the bootMode property: <p>The boot mode that was specified by the AMI. If the value is + * <code>uefi-preferred</code>, the AMI supports both UEFI and Legacy BIOS. The + * <code>currentInstanceBootMode</code> parameter is the boot mode that is used to boot the instance at + * launch or start.</p> <note> <p>The operating system contained in the AMI must be configured to + * support the specified boot mode.</p> </note> <p>For more information, see <a + * href='https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ami-boot.html'>Boot modes</a> in the + * <i>Amazon EC2 User Guide</i>.</p>. + * + * @param bootMode the bootMode value to set. + * @return the AwsEc2InstanceProperties object itself. + */ + public AwsEc2InstanceProperties withBootMode(BootModeValuesEnumValue bootMode) { + this.bootMode = bootMode; + return this; + } + + /** + * Get the capacityReservationId property: <p>The ID of the Capacity Reservation.</p>. + * + * @return the capacityReservationId value. + */ + public String capacityReservationId() { + return this.capacityReservationId; + } + + /** + * Set the capacityReservationId property: <p>The ID of the Capacity Reservation.</p>. + * + * @param capacityReservationId the capacityReservationId value to set. + * @return the AwsEc2InstanceProperties object itself. + */ + public AwsEc2InstanceProperties withCapacityReservationId(String capacityReservationId) { + this.capacityReservationId = capacityReservationId; + return this; + } + + /** + * Get the capacityReservationSpecification property: <p>Information about the Capacity Reservation targeting + * option.</p>. + * + * @return the capacityReservationSpecification value. + */ + public CapacityReservationSpecificationResponse capacityReservationSpecification() { + return this.capacityReservationSpecification; + } + + /** + * Set the capacityReservationSpecification property: <p>Information about the Capacity Reservation targeting + * option.</p>. + * + * @param capacityReservationSpecification the capacityReservationSpecification value to set. + * @return the AwsEc2InstanceProperties object itself. + */ + public AwsEc2InstanceProperties withCapacityReservationSpecification( + CapacityReservationSpecificationResponse capacityReservationSpecification) { + this.capacityReservationSpecification = capacityReservationSpecification; + return this; + } + + /** + * Get the clientToken property: <p>The idempotency token you provided when you launched the instance, if + * applicable.</p>. + * + * @return the clientToken value. + */ + public String clientToken() { + return this.clientToken; + } + + /** + * Set the clientToken property: <p>The idempotency token you provided when you launched the instance, if + * applicable.</p>. + * + * @param clientToken the clientToken value to set. + * @return the AwsEc2InstanceProperties object itself. + */ + public AwsEc2InstanceProperties withClientToken(String clientToken) { + this.clientToken = clientToken; + return this; + } + + /** + * Get the cpuOptions property: <p>The CPU options for the instance.</p>. + * + * @return the cpuOptions value. + */ + public CpuOptions cpuOptions() { + return this.cpuOptions; + } + + /** + * Set the cpuOptions property: <p>The CPU options for the instance.</p>. + * + * @param cpuOptions the cpuOptions value to set. + * @return the AwsEc2InstanceProperties object itself. + */ + public AwsEc2InstanceProperties withCpuOptions(CpuOptions cpuOptions) { + this.cpuOptions = cpuOptions; + return this; + } + + /** + * Get the currentInstanceBootMode property: <p>The boot mode that is used to boot the instance at launch or + * start. For more information, see <a + * href='https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ami-boot.html'>Boot modes</a> in the + * <i>Amazon EC2 User Guide</i>.</p>. + * + * @return the currentInstanceBootMode value. + */ + public InstanceBootModeValuesEnumValue currentInstanceBootMode() { + return this.currentInstanceBootMode; + } + + /** + * Set the currentInstanceBootMode property: <p>The boot mode that is used to boot the instance at launch or + * start. For more information, see <a + * href='https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ami-boot.html'>Boot modes</a> in the + * <i>Amazon EC2 User Guide</i>.</p>. + * + * @param currentInstanceBootMode the currentInstanceBootMode value to set. + * @return the AwsEc2InstanceProperties object itself. + */ + public AwsEc2InstanceProperties + withCurrentInstanceBootMode(InstanceBootModeValuesEnumValue currentInstanceBootMode) { + this.currentInstanceBootMode = currentInstanceBootMode; + return this; + } + + /** + * Get the ebsOptimized property: <p>Indicates whether the instance is optimized for Amazon EBS I/O. This + * optimization provides dedicated throughput to Amazon EBS and an optimized configuration stack to provide optimal + * I/O performance. This optimization isn't available with all instance types. Additional usage charges apply when + * using an EBS Optimized instance.</p>. + * + * @return the ebsOptimized value. + */ + public Boolean ebsOptimized() { + return this.ebsOptimized; + } + + /** + * Set the ebsOptimized property: <p>Indicates whether the instance is optimized for Amazon EBS I/O. This + * optimization provides dedicated throughput to Amazon EBS and an optimized configuration stack to provide optimal + * I/O performance. This optimization isn't available with all instance types. Additional usage charges apply when + * using an EBS Optimized instance.</p>. + * + * @param ebsOptimized the ebsOptimized value to set. + * @return the AwsEc2InstanceProperties object itself. + */ + public AwsEc2InstanceProperties withEbsOptimized(Boolean ebsOptimized) { + this.ebsOptimized = ebsOptimized; + return this; + } + + /** + * Get the elasticGpuAssociations property: <p>Deprecated.</p> <note> <p>Amazon Elastic + * Graphics reached end of life on January 8, 2024. For workloads that require graphics acceleration, we recommend + * that you use Amazon EC2 G4ad, G4dn, or G5 instances.</p> </note>. + * + * @return the elasticGpuAssociations value. + */ + public List elasticGpuAssociations() { + return this.elasticGpuAssociations; + } + + /** + * Set the elasticGpuAssociations property: <p>Deprecated.</p> <note> <p>Amazon Elastic + * Graphics reached end of life on January 8, 2024. For workloads that require graphics acceleration, we recommend + * that you use Amazon EC2 G4ad, G4dn, or G5 instances.</p> </note>. + * + * @param elasticGpuAssociations the elasticGpuAssociations value to set. + * @return the AwsEc2InstanceProperties object itself. + */ + public AwsEc2InstanceProperties withElasticGpuAssociations(List elasticGpuAssociations) { + this.elasticGpuAssociations = elasticGpuAssociations; + return this; + } + + /** + * Get the elasticInferenceAcceleratorAssociations property: <p>The elastic inference accelerator associated + * with the instance.</p>. + * + * @return the elasticInferenceAcceleratorAssociations value. + */ + public List elasticInferenceAcceleratorAssociations() { + return this.elasticInferenceAcceleratorAssociations; + } + + /** + * Set the elasticInferenceAcceleratorAssociations property: <p>The elastic inference accelerator associated + * with the instance.</p>. + * + * @param elasticInferenceAcceleratorAssociations the elasticInferenceAcceleratorAssociations value to set. + * @return the AwsEc2InstanceProperties object itself. + */ + public AwsEc2InstanceProperties withElasticInferenceAcceleratorAssociations( + List elasticInferenceAcceleratorAssociations) { + this.elasticInferenceAcceleratorAssociations = elasticInferenceAcceleratorAssociations; + return this; + } + + /** + * Get the enaSupport property: <p>Specifies whether enhanced networking with ENA is enabled.</p>. + * + * @return the enaSupport value. + */ + public Boolean enaSupport() { + return this.enaSupport; + } + + /** + * Set the enaSupport property: <p>Specifies whether enhanced networking with ENA is enabled.</p>. + * + * @param enaSupport the enaSupport value to set. + * @return the AwsEc2InstanceProperties object itself. + */ + public AwsEc2InstanceProperties withEnaSupport(Boolean enaSupport) { + this.enaSupport = enaSupport; + return this; + } + + /** + * Get the enclaveOptions property: <p>Indicates whether the instance is enabled for Amazon Web Services Nitro + * Enclaves.</p>. + * + * @return the enclaveOptions value. + */ + public EnclaveOptions enclaveOptions() { + return this.enclaveOptions; + } + + /** + * Set the enclaveOptions property: <p>Indicates whether the instance is enabled for Amazon Web Services Nitro + * Enclaves.</p>. + * + * @param enclaveOptions the enclaveOptions value to set. + * @return the AwsEc2InstanceProperties object itself. + */ + public AwsEc2InstanceProperties withEnclaveOptions(EnclaveOptions enclaveOptions) { + this.enclaveOptions = enclaveOptions; + return this; + } + + /** + * Get the hibernationOptions property: <p>Indicates whether the instance is enabled for + * hibernation.</p>. + * + * @return the hibernationOptions value. + */ + public HibernationOptions hibernationOptions() { + return this.hibernationOptions; + } + + /** + * Set the hibernationOptions property: <p>Indicates whether the instance is enabled for + * hibernation.</p>. + * + * @param hibernationOptions the hibernationOptions value to set. + * @return the AwsEc2InstanceProperties object itself. + */ + public AwsEc2InstanceProperties withHibernationOptions(HibernationOptions hibernationOptions) { + this.hibernationOptions = hibernationOptions; + return this; + } + + /** + * Get the hypervisor property: <p>The hypervisor type of the instance. The value <code>xen</code> + * is used for both Xen and Nitro hypervisors.</p>. + * + * @return the hypervisor value. + */ + public HypervisorTypeEnumValue hypervisor() { + return this.hypervisor; + } + + /** + * Set the hypervisor property: <p>The hypervisor type of the instance. The value <code>xen</code> + * is used for both Xen and Nitro hypervisors.</p>. + * + * @param hypervisor the hypervisor value to set. + * @return the AwsEc2InstanceProperties object itself. + */ + public AwsEc2InstanceProperties withHypervisor(HypervisorTypeEnumValue hypervisor) { + this.hypervisor = hypervisor; + return this; + } + + /** + * Get the iamInstanceProfile property: <p>The IAM instance profile associated with the instance, if + * applicable.</p>. + * + * @return the iamInstanceProfile value. + */ + public IamInstanceProfile iamInstanceProfile() { + return this.iamInstanceProfile; + } + + /** + * Set the iamInstanceProfile property: <p>The IAM instance profile associated with the instance, if + * applicable.</p>. + * + * @param iamInstanceProfile the iamInstanceProfile value to set. + * @return the AwsEc2InstanceProperties object itself. + */ + public AwsEc2InstanceProperties withIamInstanceProfile(IamInstanceProfile iamInstanceProfile) { + this.iamInstanceProfile = iamInstanceProfile; + return this; + } + + /** + * Get the imageId property: <p>The ID of the AMI used to launch the instance.</p>. + * + * @return the imageId value. + */ + public String imageId() { + return this.imageId; + } + + /** + * Set the imageId property: <p>The ID of the AMI used to launch the instance.</p>. + * + * @param imageId the imageId value to set. + * @return the AwsEc2InstanceProperties object itself. + */ + public AwsEc2InstanceProperties withImageId(String imageId) { + this.imageId = imageId; + return this; + } + + /** + * Get the instanceId property: <p>The ID of the instance.</p>. + * + * @return the instanceId value. + */ + public String instanceId() { + return this.instanceId; + } + + /** + * Set the instanceId property: <p>The ID of the instance.</p>. + * + * @param instanceId the instanceId value to set. + * @return the AwsEc2InstanceProperties object itself. + */ + public AwsEc2InstanceProperties withInstanceId(String instanceId) { + this.instanceId = instanceId; + return this; + } + + /** + * Get the instanceLifecycle property: <p>Indicates whether this is a Spot Instance or a Scheduled + * Instance.</p>. + * + * @return the instanceLifecycle value. + */ + public InstanceLifecycleTypeEnumValue instanceLifecycle() { + return this.instanceLifecycle; + } + + /** + * Set the instanceLifecycle property: <p>Indicates whether this is a Spot Instance or a Scheduled + * Instance.</p>. + * + * @param instanceLifecycle the instanceLifecycle value to set. + * @return the AwsEc2InstanceProperties object itself. + */ + public AwsEc2InstanceProperties withInstanceLifecycle(InstanceLifecycleTypeEnumValue instanceLifecycle) { + this.instanceLifecycle = instanceLifecycle; + return this; + } + + /** + * Get the instanceType property: <p>The instance type.</p>. + * + * @return the instanceType value. + */ + public InstanceTypeEnumValue instanceType() { + return this.instanceType; + } + + /** + * Set the instanceType property: <p>The instance type.</p>. + * + * @param instanceType the instanceType value to set. + * @return the AwsEc2InstanceProperties object itself. + */ + public AwsEc2InstanceProperties withInstanceType(InstanceTypeEnumValue instanceType) { + this.instanceType = instanceType; + return this; + } + + /** + * Get the ipv6Address property: <p>The IPv6 address assigned to the instance.</p>. + * + * @return the ipv6Address value. + */ + public String ipv6Address() { + return this.ipv6Address; + } + + /** + * Set the ipv6Address property: <p>The IPv6 address assigned to the instance.</p>. + * + * @param ipv6Address the ipv6Address value to set. + * @return the AwsEc2InstanceProperties object itself. + */ + public AwsEc2InstanceProperties withIpv6Address(String ipv6Address) { + this.ipv6Address = ipv6Address; + return this; + } + + /** + * Get the kernelId property: <p>The kernel associated with this instance, if applicable.</p>. + * + * @return the kernelId value. + */ + public String kernelId() { + return this.kernelId; + } + + /** + * Set the kernelId property: <p>The kernel associated with this instance, if applicable.</p>. + * + * @param kernelId the kernelId value to set. + * @return the AwsEc2InstanceProperties object itself. + */ + public AwsEc2InstanceProperties withKernelId(String kernelId) { + this.kernelId = kernelId; + return this; + } + + /** + * Get the keyName property: <p>The name of the key pair, if this instance was launched with an associated key + * pair.</p>. + * + * @return the keyName value. + */ + public String keyName() { + return this.keyName; + } + + /** + * Set the keyName property: <p>The name of the key pair, if this instance was launched with an associated key + * pair.</p>. + * + * @param keyName the keyName value to set. + * @return the AwsEc2InstanceProperties object itself. + */ + public AwsEc2InstanceProperties withKeyName(String keyName) { + this.keyName = keyName; + return this; + } + + /** + * Get the launchTime property: <p>The time the instance was launched.</p>. + * + * @return the launchTime value. + */ + public OffsetDateTime launchTime() { + return this.launchTime; + } + + /** + * Set the launchTime property: <p>The time the instance was launched.</p>. + * + * @param launchTime the launchTime value to set. + * @return the AwsEc2InstanceProperties object itself. + */ + public AwsEc2InstanceProperties withLaunchTime(OffsetDateTime launchTime) { + this.launchTime = launchTime; + return this; + } + + /** + * Get the licenses property: <p>The license configurations for the instance.</p>. + * + * @return the licenses value. + */ + public List licenses() { + return this.licenses; + } + + /** + * Set the licenses property: <p>The license configurations for the instance.</p>. + * + * @param licenses the licenses value to set. + * @return the AwsEc2InstanceProperties object itself. + */ + public AwsEc2InstanceProperties withLicenses(List licenses) { + this.licenses = licenses; + return this; + } + + /** + * Get the maintenanceOptions property: <p>Provides information on the recovery and maintenance options of + * your instance.</p>. + * + * @return the maintenanceOptions value. + */ + public InstanceMaintenanceOptions maintenanceOptions() { + return this.maintenanceOptions; + } + + /** + * Set the maintenanceOptions property: <p>Provides information on the recovery and maintenance options of + * your instance.</p>. + * + * @param maintenanceOptions the maintenanceOptions value to set. + * @return the AwsEc2InstanceProperties object itself. + */ + public AwsEc2InstanceProperties withMaintenanceOptions(InstanceMaintenanceOptions maintenanceOptions) { + this.maintenanceOptions = maintenanceOptions; + return this; + } + + /** + * Get the metadataOptions property: <p>The metadata options for the instance.</p>. + * + * @return the metadataOptions value. + */ + public InstanceMetadataOptionsResponse metadataOptions() { + return this.metadataOptions; + } + + /** + * Set the metadataOptions property: <p>The metadata options for the instance.</p>. + * + * @param metadataOptions the metadataOptions value to set. + * @return the AwsEc2InstanceProperties object itself. + */ + public AwsEc2InstanceProperties withMetadataOptions(InstanceMetadataOptionsResponse metadataOptions) { + this.metadataOptions = metadataOptions; + return this; + } + + /** + * Get the monitoring property: <p>The monitoring for the instance.</p>. + * + * @return the monitoring value. + */ + public Monitoring monitoring() { + return this.monitoring; + } + + /** + * Set the monitoring property: <p>The monitoring for the instance.</p>. + * + * @param monitoring the monitoring value to set. + * @return the AwsEc2InstanceProperties object itself. + */ + public AwsEc2InstanceProperties withMonitoring(Monitoring monitoring) { + this.monitoring = monitoring; + return this; + } + + /** + * Get the networkInterfaces property: <p>The network interfaces for the instance.</p>. + * + * @return the networkInterfaces value. + */ + public List networkInterfaces() { + return this.networkInterfaces; + } + + /** + * Set the networkInterfaces property: <p>The network interfaces for the instance.</p>. + * + * @param networkInterfaces the networkInterfaces value to set. + * @return the AwsEc2InstanceProperties object itself. + */ + public AwsEc2InstanceProperties withNetworkInterfaces(List networkInterfaces) { + this.networkInterfaces = networkInterfaces; + return this; + } + + /** + * Get the outpostArn property: <p>The Amazon Resource Name (ARN) of the Outpost.</p>. + * + * @return the outpostArn value. + */ + public String outpostArn() { + return this.outpostArn; + } + + /** + * Set the outpostArn property: <p>The Amazon Resource Name (ARN) of the Outpost.</p>. + * + * @param outpostArn the outpostArn value to set. + * @return the AwsEc2InstanceProperties object itself. + */ + public AwsEc2InstanceProperties withOutpostArn(String outpostArn) { + this.outpostArn = outpostArn; + return this; + } + + /** + * Get the placement property: <p>The location where the instance launched, if applicable.</p>. + * + * @return the placement value. + */ + public Placement placement() { + return this.placement; + } + + /** + * Set the placement property: <p>The location where the instance launched, if applicable.</p>. + * + * @param placement the placement value to set. + * @return the AwsEc2InstanceProperties object itself. + */ + public AwsEc2InstanceProperties withPlacement(Placement placement) { + this.placement = placement; + return this; + } + + /** + * Get the platform property: <p>The platform. This value is <code>windows</code> for Windows + * instances; otherwise, it is empty.</p>. + * + * @return the platform value. + */ + public PlatformValuesEnumValue platform() { + return this.platform; + } + + /** + * Set the platform property: <p>The platform. This value is <code>windows</code> for Windows + * instances; otherwise, it is empty.</p>. + * + * @param platform the platform value to set. + * @return the AwsEc2InstanceProperties object itself. + */ + public AwsEc2InstanceProperties withPlatform(PlatformValuesEnumValue platform) { + this.platform = platform; + return this; + } + + /** + * Get the platformDetails property: <p>The platform details value for the instance. For more information, see + * <a href='https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/billing-info-fields.html'>AMI billing + * information fields</a> in the <i>Amazon EC2 User Guide</i>.</p>. + * + * @return the platformDetails value. + */ + public String platformDetails() { + return this.platformDetails; + } + + /** + * Set the platformDetails property: <p>The platform details value for the instance. For more information, see + * <a href='https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/billing-info-fields.html'>AMI billing + * information fields</a> in the <i>Amazon EC2 User Guide</i>.</p>. + * + * @param platformDetails the platformDetails value to set. + * @return the AwsEc2InstanceProperties object itself. + */ + public AwsEc2InstanceProperties withPlatformDetails(String platformDetails) { + this.platformDetails = platformDetails; + return this; + } + + /** + * Get the privateDnsName property: <p>[IPv4 only] The private DNS hostname name assigned to the instance. + * This DNS hostname can only be used inside the Amazon EC2 network. This name is not available until the instance + * enters the <code>running</code> state. </p> <p>The Amazon-provided DNS server resolves + * Amazon-provided private DNS hostnames if you've enabled DNS resolution and DNS hostnames in your VPC. If you are + * not using the Amazon-provided DNS server in your VPC, your custom domain name servers must resolve the hostname + * as appropriate.</p>. + * + * @return the privateDnsName value. + */ + public String privateDnsName() { + return this.privateDnsName; + } + + /** + * Set the privateDnsName property: <p>[IPv4 only] The private DNS hostname name assigned to the instance. + * This DNS hostname can only be used inside the Amazon EC2 network. This name is not available until the instance + * enters the <code>running</code> state. </p> <p>The Amazon-provided DNS server resolves + * Amazon-provided private DNS hostnames if you've enabled DNS resolution and DNS hostnames in your VPC. If you are + * not using the Amazon-provided DNS server in your VPC, your custom domain name servers must resolve the hostname + * as appropriate.</p>. + * + * @param privateDnsName the privateDnsName value to set. + * @return the AwsEc2InstanceProperties object itself. + */ + public AwsEc2InstanceProperties withPrivateDnsName(String privateDnsName) { + this.privateDnsName = privateDnsName; + return this; + } + + /** + * Get the privateDnsNameOptions property: <p>The options for the instance hostname.</p>. + * + * @return the privateDnsNameOptions value. + */ + public PrivateDnsNameOptionsResponse privateDnsNameOptions() { + return this.privateDnsNameOptions; + } + + /** + * Set the privateDnsNameOptions property: <p>The options for the instance hostname.</p>. + * + * @param privateDnsNameOptions the privateDnsNameOptions value to set. + * @return the AwsEc2InstanceProperties object itself. + */ + public AwsEc2InstanceProperties withPrivateDnsNameOptions(PrivateDnsNameOptionsResponse privateDnsNameOptions) { + this.privateDnsNameOptions = privateDnsNameOptions; + return this; + } + + /** + * Get the privateIpAddress property: <p>The private IPv4 address assigned to the instance.</p>. + * + * @return the privateIpAddress value. + */ + public String privateIpAddress() { + return this.privateIpAddress; + } + + /** + * Set the privateIpAddress property: <p>The private IPv4 address assigned to the instance.</p>. + * + * @param privateIpAddress the privateIpAddress value to set. + * @return the AwsEc2InstanceProperties object itself. + */ + public AwsEc2InstanceProperties withPrivateIpAddress(String privateIpAddress) { + this.privateIpAddress = privateIpAddress; + return this; + } + + /** + * Get the productCodes property: <p>The product codes attached to this instance, if applicable.</p>. + * + * @return the productCodes value. + */ + public List productCodes() { + return this.productCodes; + } + + /** + * Set the productCodes property: <p>The product codes attached to this instance, if applicable.</p>. + * + * @param productCodes the productCodes value to set. + * @return the AwsEc2InstanceProperties object itself. + */ + public AwsEc2InstanceProperties withProductCodes(List productCodes) { + this.productCodes = productCodes; + return this; + } + + /** + * Get the publicDnsName property: <p>[IPv4 only] The public DNS name assigned to the instance. This name is + * not available until the instance enters the <code>running</code> state. This name is only available + * if you've enabled DNS hostnames for your VPC.</p>. + * + * @return the publicDnsName value. + */ + public String publicDnsName() { + return this.publicDnsName; + } + + /** + * Set the publicDnsName property: <p>[IPv4 only] The public DNS name assigned to the instance. This name is + * not available until the instance enters the <code>running</code> state. This name is only available + * if you've enabled DNS hostnames for your VPC.</p>. + * + * @param publicDnsName the publicDnsName value to set. + * @return the AwsEc2InstanceProperties object itself. + */ + public AwsEc2InstanceProperties withPublicDnsName(String publicDnsName) { + this.publicDnsName = publicDnsName; + return this; + } + + /** + * Get the publicIpAddress property: <p>The public IPv4 address, or the Carrier IP address assigned to the + * instance, if applicable.</p> <p>A Carrier IP address only applies to an instance launched in a subnet + * associated with a Wavelength Zone.</p>. + * + * @return the publicIpAddress value. + */ + public String publicIpAddress() { + return this.publicIpAddress; + } + + /** + * Set the publicIpAddress property: <p>The public IPv4 address, or the Carrier IP address assigned to the + * instance, if applicable.</p> <p>A Carrier IP address only applies to an instance launched in a subnet + * associated with a Wavelength Zone.</p>. + * + * @param publicIpAddress the publicIpAddress value to set. + * @return the AwsEc2InstanceProperties object itself. + */ + public AwsEc2InstanceProperties withPublicIpAddress(String publicIpAddress) { + this.publicIpAddress = publicIpAddress; + return this; + } + + /** + * Get the ramdiskId property: <p>The RAM disk associated with this instance, if applicable.</p>. + * + * @return the ramdiskId value. + */ + public String ramdiskId() { + return this.ramdiskId; + } + + /** + * Set the ramdiskId property: <p>The RAM disk associated with this instance, if applicable.</p>. + * + * @param ramdiskId the ramdiskId value to set. + * @return the AwsEc2InstanceProperties object itself. + */ + public AwsEc2InstanceProperties withRamdiskId(String ramdiskId) { + this.ramdiskId = ramdiskId; + return this; + } + + /** + * Get the rootDeviceName property: <p>The device name of the root device volume (for example, + * <code>/dev/sda1</code>).</p>. + * + * @return the rootDeviceName value. + */ + public String rootDeviceName() { + return this.rootDeviceName; + } + + /** + * Set the rootDeviceName property: <p>The device name of the root device volume (for example, + * <code>/dev/sda1</code>).</p>. + * + * @param rootDeviceName the rootDeviceName value to set. + * @return the AwsEc2InstanceProperties object itself. + */ + public AwsEc2InstanceProperties withRootDeviceName(String rootDeviceName) { + this.rootDeviceName = rootDeviceName; + return this; + } + + /** + * Get the rootDeviceType property: <p>The root device type used by the AMI. The AMI can use an EBS volume or + * an instance store volume.</p>. + * + * @return the rootDeviceType value. + */ + public DeviceTypeEnumValue rootDeviceType() { + return this.rootDeviceType; + } + + /** + * Set the rootDeviceType property: <p>The root device type used by the AMI. The AMI can use an EBS volume or + * an instance store volume.</p>. + * + * @param rootDeviceType the rootDeviceType value to set. + * @return the AwsEc2InstanceProperties object itself. + */ + public AwsEc2InstanceProperties withRootDeviceType(DeviceTypeEnumValue rootDeviceType) { + this.rootDeviceType = rootDeviceType; + return this; + } + + /** + * Get the securityGroups property: <p>The security groups for the instance.</p>. + * + * @return the securityGroups value. + */ + public List securityGroups() { + return this.securityGroups; + } + + /** + * Set the securityGroups property: <p>The security groups for the instance.</p>. + * + * @param securityGroups the securityGroups value to set. + * @return the AwsEc2InstanceProperties object itself. + */ + public AwsEc2InstanceProperties withSecurityGroups(List securityGroups) { + this.securityGroups = securityGroups; + return this; + } + + /** + * Get the sourceDestCheck property: <p>Indicates whether source/destination checking is enabled.</p>. + * + * @return the sourceDestCheck value. + */ + public Boolean sourceDestCheck() { + return this.sourceDestCheck; + } + + /** + * Set the sourceDestCheck property: <p>Indicates whether source/destination checking is enabled.</p>. + * + * @param sourceDestCheck the sourceDestCheck value to set. + * @return the AwsEc2InstanceProperties object itself. + */ + public AwsEc2InstanceProperties withSourceDestCheck(Boolean sourceDestCheck) { + this.sourceDestCheck = sourceDestCheck; + return this; + } + + /** + * Get the spotInstanceRequestId property: <p>If the request is a Spot Instance request, the ID of the + * request.</p>. + * + * @return the spotInstanceRequestId value. + */ + public String spotInstanceRequestId() { + return this.spotInstanceRequestId; + } + + /** + * Set the spotInstanceRequestId property: <p>If the request is a Spot Instance request, the ID of the + * request.</p>. + * + * @param spotInstanceRequestId the spotInstanceRequestId value to set. + * @return the AwsEc2InstanceProperties object itself. + */ + public AwsEc2InstanceProperties withSpotInstanceRequestId(String spotInstanceRequestId) { + this.spotInstanceRequestId = spotInstanceRequestId; + return this; + } + + /** + * Get the sriovNetSupport property: <p>Specifies whether enhanced networking with the Intel 82599 Virtual + * Function interface is enabled.</p>. + * + * @return the sriovNetSupport value. + */ + public String sriovNetSupport() { + return this.sriovNetSupport; + } + + /** + * Set the sriovNetSupport property: <p>Specifies whether enhanced networking with the Intel 82599 Virtual + * Function interface is enabled.</p>. + * + * @param sriovNetSupport the sriovNetSupport value to set. + * @return the AwsEc2InstanceProperties object itself. + */ + public AwsEc2InstanceProperties withSriovNetSupport(String sriovNetSupport) { + this.sriovNetSupport = sriovNetSupport; + return this; + } + + /** + * Get the state property: <p>The current state of the instance.</p>. + * + * @return the state value. + */ + public InstanceState state() { + return this.state; + } + + /** + * Set the state property: <p>The current state of the instance.</p>. + * + * @param state the state value to set. + * @return the AwsEc2InstanceProperties object itself. + */ + public AwsEc2InstanceProperties withState(InstanceState state) { + this.state = state; + return this; + } + + /** + * Get the stateReason property: <p>The reason for the most recent state transition.</p>. + * + * @return the stateReason value. + */ + public StateReason stateReason() { + return this.stateReason; + } + + /** + * Set the stateReason property: <p>The reason for the most recent state transition.</p>. + * + * @param stateReason the stateReason value to set. + * @return the AwsEc2InstanceProperties object itself. + */ + public AwsEc2InstanceProperties withStateReason(StateReason stateReason) { + this.stateReason = stateReason; + return this; + } + + /** + * Get the stateTransitionReason property: <p>The reason for the most recent state transition. This might be + * an empty string.</p>. + * + * @return the stateTransitionReason value. + */ + public String stateTransitionReason() { + return this.stateTransitionReason; + } + + /** + * Set the stateTransitionReason property: <p>The reason for the most recent state transition. This might be + * an empty string.</p>. + * + * @param stateTransitionReason the stateTransitionReason value to set. + * @return the AwsEc2InstanceProperties object itself. + */ + public AwsEc2InstanceProperties withStateTransitionReason(String stateTransitionReason) { + this.stateTransitionReason = stateTransitionReason; + return this; + } + + /** + * Get the subnetId property: <p>The ID of the subnet in which the instance is running.</p>. + * + * @return the subnetId value. + */ + public String subnetId() { + return this.subnetId; + } + + /** + * Set the subnetId property: <p>The ID of the subnet in which the instance is running.</p>. + * + * @param subnetId the subnetId value to set. + * @return the AwsEc2InstanceProperties object itself. + */ + public AwsEc2InstanceProperties withSubnetId(String subnetId) { + this.subnetId = subnetId; + return this; + } + + /** + * Get the tags property: <p>Any tags assigned to the instance.</p>. + * + * @return the tags value. + */ + public List tags() { + return this.tags; + } + + /** + * Set the tags property: <p>Any tags assigned to the instance.</p>. + * + * @param tags the tags value to set. + * @return the AwsEc2InstanceProperties object itself. + */ + public AwsEc2InstanceProperties withTags(List tags) { + this.tags = tags; + return this; + } + + /** + * Get the tpmSupport property: <p>If the instance is configured for NitroTPM support, the value is + * <code>v2.0</code>. For more information, see <a + * href='https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/nitrotpm.html'>NitroTPM</a> in the + * <i>Amazon EC2 User Guide</i>.</p>. + * + * @return the tpmSupport value. + */ + public String tpmSupport() { + return this.tpmSupport; + } + + /** + * Set the tpmSupport property: <p>If the instance is configured for NitroTPM support, the value is + * <code>v2.0</code>. For more information, see <a + * href='https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/nitrotpm.html'>NitroTPM</a> in the + * <i>Amazon EC2 User Guide</i>.</p>. + * + * @param tpmSupport the tpmSupport value to set. + * @return the AwsEc2InstanceProperties object itself. + */ + public AwsEc2InstanceProperties withTpmSupport(String tpmSupport) { + this.tpmSupport = tpmSupport; + return this; + } + + /** + * Get the usageOperation property: <p>The usage operation value for the instance. For more information, see + * <a href='https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/billing-info-fields.html'>AMI billing + * information fields</a> in the <i>Amazon EC2 User Guide</i>.</p>. + * + * @return the usageOperation value. + */ + public String usageOperation() { + return this.usageOperation; + } + + /** + * Set the usageOperation property: <p>The usage operation value for the instance. For more information, see + * <a href='https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/billing-info-fields.html'>AMI billing + * information fields</a> in the <i>Amazon EC2 User Guide</i>.</p>. + * + * @param usageOperation the usageOperation value to set. + * @return the AwsEc2InstanceProperties object itself. + */ + public AwsEc2InstanceProperties withUsageOperation(String usageOperation) { + this.usageOperation = usageOperation; + return this; + } + + /** + * Get the usageOperationUpdateTime property: <p>The time that the usage operation was last + * updated.</p>. + * + * @return the usageOperationUpdateTime value. + */ + public OffsetDateTime usageOperationUpdateTime() { + return this.usageOperationUpdateTime; + } + + /** + * Set the usageOperationUpdateTime property: <p>The time that the usage operation was last + * updated.</p>. + * + * @param usageOperationUpdateTime the usageOperationUpdateTime value to set. + * @return the AwsEc2InstanceProperties object itself. + */ + public AwsEc2InstanceProperties withUsageOperationUpdateTime(OffsetDateTime usageOperationUpdateTime) { + this.usageOperationUpdateTime = usageOperationUpdateTime; + return this; + } + + /** + * Get the virtualizationType property: <p>The virtualization type of the instance.</p>. + * + * @return the virtualizationType value. + */ + public VirtualizationTypeEnumValue virtualizationType() { + return this.virtualizationType; + } + + /** + * Set the virtualizationType property: <p>The virtualization type of the instance.</p>. + * + * @param virtualizationType the virtualizationType value to set. + * @return the AwsEc2InstanceProperties object itself. + */ + public AwsEc2InstanceProperties withVirtualizationType(VirtualizationTypeEnumValue virtualizationType) { + this.virtualizationType = virtualizationType; + return this; + } + + /** + * Get the vpcId property: <p>The ID of the VPC in which the instance is running.</p>. + * + * @return the vpcId value. + */ + public String vpcId() { + return this.vpcId; + } + + /** + * Set the vpcId property: <p>The ID of the VPC in which the instance is running.</p>. + * + * @param vpcId the vpcId value to set. + * @return the AwsEc2InstanceProperties object itself. + */ + public AwsEc2InstanceProperties withVpcId(String vpcId) { + this.vpcId = vpcId; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (architecture() != null) { + architecture().validate(); + } + if (blockDeviceMappings() != null) { + blockDeviceMappings().forEach(e -> e.validate()); + } + if (bootMode() != null) { + bootMode().validate(); + } + if (capacityReservationSpecification() != null) { + capacityReservationSpecification().validate(); + } + if (cpuOptions() != null) { + cpuOptions().validate(); + } + if (currentInstanceBootMode() != null) { + currentInstanceBootMode().validate(); + } + if (elasticGpuAssociations() != null) { + elasticGpuAssociations().forEach(e -> e.validate()); + } + if (elasticInferenceAcceleratorAssociations() != null) { + elasticInferenceAcceleratorAssociations().forEach(e -> e.validate()); + } + if (enclaveOptions() != null) { + enclaveOptions().validate(); + } + if (hibernationOptions() != null) { + hibernationOptions().validate(); + } + if (hypervisor() != null) { + hypervisor().validate(); + } + if (iamInstanceProfile() != null) { + iamInstanceProfile().validate(); + } + if (instanceLifecycle() != null) { + instanceLifecycle().validate(); + } + if (instanceType() != null) { + instanceType().validate(); + } + if (licenses() != null) { + licenses().forEach(e -> e.validate()); + } + if (maintenanceOptions() != null) { + maintenanceOptions().validate(); + } + if (metadataOptions() != null) { + metadataOptions().validate(); + } + if (monitoring() != null) { + monitoring().validate(); + } + if (networkInterfaces() != null) { + networkInterfaces().forEach(e -> e.validate()); + } + if (placement() != null) { + placement().validate(); + } + if (platform() != null) { + platform().validate(); + } + if (privateDnsNameOptions() != null) { + privateDnsNameOptions().validate(); + } + if (productCodes() != null) { + productCodes().forEach(e -> e.validate()); + } + if (rootDeviceType() != null) { + rootDeviceType().validate(); + } + if (securityGroups() != null) { + securityGroups().forEach(e -> e.validate()); + } + if (state() != null) { + state().validate(); + } + if (stateReason() != null) { + stateReason().validate(); + } + if (tags() != null) { + tags().forEach(e -> e.validate()); + } + if (virtualizationType() != null) { + virtualizationType().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeNumberField("amiLaunchIndex", this.amiLaunchIndex); + jsonWriter.writeJsonField("architecture", this.architecture); + jsonWriter.writeArrayField("blockDeviceMappings", this.blockDeviceMappings, + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeJsonField("bootMode", this.bootMode); + jsonWriter.writeStringField("capacityReservationId", this.capacityReservationId); + jsonWriter.writeJsonField("capacityReservationSpecification", this.capacityReservationSpecification); + jsonWriter.writeStringField("clientToken", this.clientToken); + jsonWriter.writeJsonField("cpuOptions", this.cpuOptions); + jsonWriter.writeJsonField("currentInstanceBootMode", this.currentInstanceBootMode); + jsonWriter.writeBooleanField("ebsOptimized", this.ebsOptimized); + jsonWriter.writeArrayField("elasticGpuAssociations", this.elasticGpuAssociations, + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("elasticInferenceAcceleratorAssociations", + this.elasticInferenceAcceleratorAssociations, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeBooleanField("enaSupport", this.enaSupport); + jsonWriter.writeJsonField("enclaveOptions", this.enclaveOptions); + jsonWriter.writeJsonField("hibernationOptions", this.hibernationOptions); + jsonWriter.writeJsonField("hypervisor", this.hypervisor); + jsonWriter.writeJsonField("iamInstanceProfile", this.iamInstanceProfile); + jsonWriter.writeStringField("imageId", this.imageId); + jsonWriter.writeStringField("instanceId", this.instanceId); + jsonWriter.writeJsonField("instanceLifecycle", this.instanceLifecycle); + jsonWriter.writeJsonField("instanceType", this.instanceType); + jsonWriter.writeStringField("ipv6Address", this.ipv6Address); + jsonWriter.writeStringField("kernelId", this.kernelId); + jsonWriter.writeStringField("keyName", this.keyName); + jsonWriter.writeStringField("launchTime", + this.launchTime == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.launchTime)); + jsonWriter.writeArrayField("licenses", this.licenses, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeJsonField("maintenanceOptions", this.maintenanceOptions); + jsonWriter.writeJsonField("metadataOptions", this.metadataOptions); + jsonWriter.writeJsonField("monitoring", this.monitoring); + jsonWriter.writeArrayField("networkInterfaces", this.networkInterfaces, + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("outpostArn", this.outpostArn); + jsonWriter.writeJsonField("placement", this.placement); + jsonWriter.writeJsonField("platform", this.platform); + jsonWriter.writeStringField("platformDetails", this.platformDetails); + jsonWriter.writeStringField("privateDnsName", this.privateDnsName); + jsonWriter.writeJsonField("privateDnsNameOptions", this.privateDnsNameOptions); + jsonWriter.writeStringField("privateIpAddress", this.privateIpAddress); + jsonWriter.writeArrayField("productCodes", this.productCodes, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("publicDnsName", this.publicDnsName); + jsonWriter.writeStringField("publicIpAddress", this.publicIpAddress); + jsonWriter.writeStringField("ramdiskId", this.ramdiskId); + jsonWriter.writeStringField("rootDeviceName", this.rootDeviceName); + jsonWriter.writeJsonField("rootDeviceType", this.rootDeviceType); + jsonWriter.writeArrayField("securityGroups", this.securityGroups, + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeBooleanField("sourceDestCheck", this.sourceDestCheck); + jsonWriter.writeStringField("spotInstanceRequestId", this.spotInstanceRequestId); + jsonWriter.writeStringField("sriovNetSupport", this.sriovNetSupport); + jsonWriter.writeJsonField("state", this.state); + jsonWriter.writeJsonField("stateReason", this.stateReason); + jsonWriter.writeStringField("stateTransitionReason", this.stateTransitionReason); + jsonWriter.writeStringField("subnetId", this.subnetId); + jsonWriter.writeArrayField("tags", this.tags, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("tpmSupport", this.tpmSupport); + jsonWriter.writeStringField("usageOperation", this.usageOperation); + jsonWriter.writeStringField("usageOperationUpdateTime", + this.usageOperationUpdateTime == null + ? null + : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.usageOperationUpdateTime)); + jsonWriter.writeJsonField("virtualizationType", this.virtualizationType); + jsonWriter.writeStringField("vpcId", this.vpcId); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AwsEc2InstanceProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AwsEc2InstanceProperties if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IOException If an error occurs while reading the AwsEc2InstanceProperties. + */ + public static AwsEc2InstanceProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AwsEc2InstanceProperties deserializedAwsEc2InstanceProperties = new AwsEc2InstanceProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("amiLaunchIndex".equals(fieldName)) { + deserializedAwsEc2InstanceProperties.amiLaunchIndex = reader.getNullable(JsonReader::getInt); + } else if ("architecture".equals(fieldName)) { + deserializedAwsEc2InstanceProperties.architecture = ArchitectureValuesEnumValue.fromJson(reader); + } else if ("blockDeviceMappings".equals(fieldName)) { + List blockDeviceMappings + = reader.readArray(reader1 -> InstanceBlockDeviceMapping.fromJson(reader1)); + deserializedAwsEc2InstanceProperties.blockDeviceMappings = blockDeviceMappings; + } else if ("bootMode".equals(fieldName)) { + deserializedAwsEc2InstanceProperties.bootMode = BootModeValuesEnumValue.fromJson(reader); + } else if ("capacityReservationId".equals(fieldName)) { + deserializedAwsEc2InstanceProperties.capacityReservationId = reader.getString(); + } else if ("capacityReservationSpecification".equals(fieldName)) { + deserializedAwsEc2InstanceProperties.capacityReservationSpecification + = CapacityReservationSpecificationResponse.fromJson(reader); + } else if ("clientToken".equals(fieldName)) { + deserializedAwsEc2InstanceProperties.clientToken = reader.getString(); + } else if ("cpuOptions".equals(fieldName)) { + deserializedAwsEc2InstanceProperties.cpuOptions = CpuOptions.fromJson(reader); + } else if ("currentInstanceBootMode".equals(fieldName)) { + deserializedAwsEc2InstanceProperties.currentInstanceBootMode + = InstanceBootModeValuesEnumValue.fromJson(reader); + } else if ("ebsOptimized".equals(fieldName)) { + deserializedAwsEc2InstanceProperties.ebsOptimized = reader.getNullable(JsonReader::getBoolean); + } else if ("elasticGpuAssociations".equals(fieldName)) { + List elasticGpuAssociations + = reader.readArray(reader1 -> ElasticGpuAssociation.fromJson(reader1)); + deserializedAwsEc2InstanceProperties.elasticGpuAssociations = elasticGpuAssociations; + } else if ("elasticInferenceAcceleratorAssociations".equals(fieldName)) { + List elasticInferenceAcceleratorAssociations + = reader.readArray(reader1 -> ElasticInferenceAcceleratorAssociation.fromJson(reader1)); + deserializedAwsEc2InstanceProperties.elasticInferenceAcceleratorAssociations + = elasticInferenceAcceleratorAssociations; + } else if ("enaSupport".equals(fieldName)) { + deserializedAwsEc2InstanceProperties.enaSupport = reader.getNullable(JsonReader::getBoolean); + } else if ("enclaveOptions".equals(fieldName)) { + deserializedAwsEc2InstanceProperties.enclaveOptions = EnclaveOptions.fromJson(reader); + } else if ("hibernationOptions".equals(fieldName)) { + deserializedAwsEc2InstanceProperties.hibernationOptions = HibernationOptions.fromJson(reader); + } else if ("hypervisor".equals(fieldName)) { + deserializedAwsEc2InstanceProperties.hypervisor = HypervisorTypeEnumValue.fromJson(reader); + } else if ("iamInstanceProfile".equals(fieldName)) { + deserializedAwsEc2InstanceProperties.iamInstanceProfile = IamInstanceProfile.fromJson(reader); + } else if ("imageId".equals(fieldName)) { + deserializedAwsEc2InstanceProperties.imageId = reader.getString(); + } else if ("instanceId".equals(fieldName)) { + deserializedAwsEc2InstanceProperties.instanceId = reader.getString(); + } else if ("instanceLifecycle".equals(fieldName)) { + deserializedAwsEc2InstanceProperties.instanceLifecycle + = InstanceLifecycleTypeEnumValue.fromJson(reader); + } else if ("instanceType".equals(fieldName)) { + deserializedAwsEc2InstanceProperties.instanceType = InstanceTypeEnumValue.fromJson(reader); + } else if ("ipv6Address".equals(fieldName)) { + deserializedAwsEc2InstanceProperties.ipv6Address = reader.getString(); + } else if ("kernelId".equals(fieldName)) { + deserializedAwsEc2InstanceProperties.kernelId = reader.getString(); + } else if ("keyName".equals(fieldName)) { + deserializedAwsEc2InstanceProperties.keyName = reader.getString(); + } else if ("launchTime".equals(fieldName)) { + deserializedAwsEc2InstanceProperties.launchTime = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("licenses".equals(fieldName)) { + List licenses + = reader.readArray(reader1 -> LicenseConfiguration.fromJson(reader1)); + deserializedAwsEc2InstanceProperties.licenses = licenses; + } else if ("maintenanceOptions".equals(fieldName)) { + deserializedAwsEc2InstanceProperties.maintenanceOptions + = InstanceMaintenanceOptions.fromJson(reader); + } else if ("metadataOptions".equals(fieldName)) { + deserializedAwsEc2InstanceProperties.metadataOptions + = InstanceMetadataOptionsResponse.fromJson(reader); + } else if ("monitoring".equals(fieldName)) { + deserializedAwsEc2InstanceProperties.monitoring = Monitoring.fromJson(reader); + } else if ("networkInterfaces".equals(fieldName)) { + List networkInterfaces + = reader.readArray(reader1 -> InstanceNetworkInterface.fromJson(reader1)); + deserializedAwsEc2InstanceProperties.networkInterfaces = networkInterfaces; + } else if ("outpostArn".equals(fieldName)) { + deserializedAwsEc2InstanceProperties.outpostArn = reader.getString(); + } else if ("placement".equals(fieldName)) { + deserializedAwsEc2InstanceProperties.placement = Placement.fromJson(reader); + } else if ("platform".equals(fieldName)) { + deserializedAwsEc2InstanceProperties.platform = PlatformValuesEnumValue.fromJson(reader); + } else if ("platformDetails".equals(fieldName)) { + deserializedAwsEc2InstanceProperties.platformDetails = reader.getString(); + } else if ("privateDnsName".equals(fieldName)) { + deserializedAwsEc2InstanceProperties.privateDnsName = reader.getString(); + } else if ("privateDnsNameOptions".equals(fieldName)) { + deserializedAwsEc2InstanceProperties.privateDnsNameOptions + = PrivateDnsNameOptionsResponse.fromJson(reader); + } else if ("privateIpAddress".equals(fieldName)) { + deserializedAwsEc2InstanceProperties.privateIpAddress = reader.getString(); + } else if ("productCodes".equals(fieldName)) { + List productCodes = reader.readArray(reader1 -> ProductCode.fromJson(reader1)); + deserializedAwsEc2InstanceProperties.productCodes = productCodes; + } else if ("publicDnsName".equals(fieldName)) { + deserializedAwsEc2InstanceProperties.publicDnsName = reader.getString(); + } else if ("publicIpAddress".equals(fieldName)) { + deserializedAwsEc2InstanceProperties.publicIpAddress = reader.getString(); + } else if ("ramdiskId".equals(fieldName)) { + deserializedAwsEc2InstanceProperties.ramdiskId = reader.getString(); + } else if ("rootDeviceName".equals(fieldName)) { + deserializedAwsEc2InstanceProperties.rootDeviceName = reader.getString(); + } else if ("rootDeviceType".equals(fieldName)) { + deserializedAwsEc2InstanceProperties.rootDeviceType = DeviceTypeEnumValue.fromJson(reader); + } else if ("securityGroups".equals(fieldName)) { + List securityGroups + = reader.readArray(reader1 -> GroupIdentifier.fromJson(reader1)); + deserializedAwsEc2InstanceProperties.securityGroups = securityGroups; + } else if ("sourceDestCheck".equals(fieldName)) { + deserializedAwsEc2InstanceProperties.sourceDestCheck = reader.getNullable(JsonReader::getBoolean); + } else if ("spotInstanceRequestId".equals(fieldName)) { + deserializedAwsEc2InstanceProperties.spotInstanceRequestId = reader.getString(); + } else if ("sriovNetSupport".equals(fieldName)) { + deserializedAwsEc2InstanceProperties.sriovNetSupport = reader.getString(); + } else if ("state".equals(fieldName)) { + deserializedAwsEc2InstanceProperties.state = InstanceState.fromJson(reader); + } else if ("stateReason".equals(fieldName)) { + deserializedAwsEc2InstanceProperties.stateReason = StateReason.fromJson(reader); + } else if ("stateTransitionReason".equals(fieldName)) { + deserializedAwsEc2InstanceProperties.stateTransitionReason = reader.getString(); + } else if ("subnetId".equals(fieldName)) { + deserializedAwsEc2InstanceProperties.subnetId = reader.getString(); + } else if ("tags".equals(fieldName)) { + List tags = reader.readArray(reader1 -> TagAutoGenerated12.fromJson(reader1)); + deserializedAwsEc2InstanceProperties.tags = tags; + } else if ("tpmSupport".equals(fieldName)) { + deserializedAwsEc2InstanceProperties.tpmSupport = reader.getString(); + } else if ("usageOperation".equals(fieldName)) { + deserializedAwsEc2InstanceProperties.usageOperation = reader.getString(); + } else if ("usageOperationUpdateTime".equals(fieldName)) { + deserializedAwsEc2InstanceProperties.usageOperationUpdateTime = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("virtualizationType".equals(fieldName)) { + deserializedAwsEc2InstanceProperties.virtualizationType + = VirtualizationTypeEnumValue.fromJson(reader); + } else if ("vpcId".equals(fieldName)) { + deserializedAwsEc2InstanceProperties.vpcId = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedAwsEc2InstanceProperties; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/AwsEc2InstanceStatusProperties.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/AwsEc2InstanceStatusProperties.java new file mode 100644 index 000000000000..12d149153308 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/AwsEc2InstanceStatusProperties.java @@ -0,0 +1,288 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Definition of awsEc2InstanceStatus. + */ +@Fluent +public final class AwsEc2InstanceStatusProperties implements JsonSerializable { + /* + *

The Availability Zone of the instance.

+ */ + private String availabilityZone; + + /* + *

Any scheduled events associated with the instance.

+ */ + private List events; + + /* + *

The ID of the instance.

+ */ + private String instanceId; + + /* + *

The intended state of the instance. DescribeInstanceStatus requires that an instance be in the + * running state.

+ */ + private InstanceState instanceState; + + /* + *

Reports impaired functionality that stems from issues internal to the instance, such as impaired + * reachability.

+ */ + private InstanceStatusSummary instanceStatus; + + /* + *

The Amazon Resource Name (ARN) of the Outpost.

+ */ + private String outpostArn; + + /* + *

Reports impaired functionality that stems from issues related to the systems that support an instance, such as + * hardware failures and network connectivity problems.

+ */ + private InstanceStatusSummary systemStatus; + + /** + * Creates an instance of AwsEc2InstanceStatusProperties class. + */ + public AwsEc2InstanceStatusProperties() { + } + + /** + * Get the availabilityZone property: <p>The Availability Zone of the instance.</p>. + * + * @return the availabilityZone value. + */ + public String availabilityZone() { + return this.availabilityZone; + } + + /** + * Set the availabilityZone property: <p>The Availability Zone of the instance.</p>. + * + * @param availabilityZone the availabilityZone value to set. + * @return the AwsEc2InstanceStatusProperties object itself. + */ + public AwsEc2InstanceStatusProperties withAvailabilityZone(String availabilityZone) { + this.availabilityZone = availabilityZone; + return this; + } + + /** + * Get the events property: <p>Any scheduled events associated with the instance.</p>. + * + * @return the events value. + */ + public List events() { + return this.events; + } + + /** + * Set the events property: <p>Any scheduled events associated with the instance.</p>. + * + * @param events the events value to set. + * @return the AwsEc2InstanceStatusProperties object itself. + */ + public AwsEc2InstanceStatusProperties withEvents(List events) { + this.events = events; + return this; + } + + /** + * Get the instanceId property: <p>The ID of the instance.</p>. + * + * @return the instanceId value. + */ + public String instanceId() { + return this.instanceId; + } + + /** + * Set the instanceId property: <p>The ID of the instance.</p>. + * + * @param instanceId the instanceId value to set. + * @return the AwsEc2InstanceStatusProperties object itself. + */ + public AwsEc2InstanceStatusProperties withInstanceId(String instanceId) { + this.instanceId = instanceId; + return this; + } + + /** + * Get the instanceState property: <p>The intended state of the instance. + * <a>DescribeInstanceStatus</a> requires that an instance be in the <code>running</code> + * state.</p>. + * + * @return the instanceState value. + */ + public InstanceState instanceState() { + return this.instanceState; + } + + /** + * Set the instanceState property: <p>The intended state of the instance. + * <a>DescribeInstanceStatus</a> requires that an instance be in the <code>running</code> + * state.</p>. + * + * @param instanceState the instanceState value to set. + * @return the AwsEc2InstanceStatusProperties object itself. + */ + public AwsEc2InstanceStatusProperties withInstanceState(InstanceState instanceState) { + this.instanceState = instanceState; + return this; + } + + /** + * Get the instanceStatus property: <p>Reports impaired functionality that stems from issues internal to the + * instance, such as impaired reachability.</p>. + * + * @return the instanceStatus value. + */ + public InstanceStatusSummary instanceStatus() { + return this.instanceStatus; + } + + /** + * Set the instanceStatus property: <p>Reports impaired functionality that stems from issues internal to the + * instance, such as impaired reachability.</p>. + * + * @param instanceStatus the instanceStatus value to set. + * @return the AwsEc2InstanceStatusProperties object itself. + */ + public AwsEc2InstanceStatusProperties withInstanceStatus(InstanceStatusSummary instanceStatus) { + this.instanceStatus = instanceStatus; + return this; + } + + /** + * Get the outpostArn property: <p>The Amazon Resource Name (ARN) of the Outpost.</p>. + * + * @return the outpostArn value. + */ + public String outpostArn() { + return this.outpostArn; + } + + /** + * Set the outpostArn property: <p>The Amazon Resource Name (ARN) of the Outpost.</p>. + * + * @param outpostArn the outpostArn value to set. + * @return the AwsEc2InstanceStatusProperties object itself. + */ + public AwsEc2InstanceStatusProperties withOutpostArn(String outpostArn) { + this.outpostArn = outpostArn; + return this; + } + + /** + * Get the systemStatus property: <p>Reports impaired functionality that stems from issues related to the + * systems that support an instance, such as hardware failures and network connectivity problems.</p>. + * + * @return the systemStatus value. + */ + public InstanceStatusSummary systemStatus() { + return this.systemStatus; + } + + /** + * Set the systemStatus property: <p>Reports impaired functionality that stems from issues related to the + * systems that support an instance, such as hardware failures and network connectivity problems.</p>. + * + * @param systemStatus the systemStatus value to set. + * @return the AwsEc2InstanceStatusProperties object itself. + */ + public AwsEc2InstanceStatusProperties withSystemStatus(InstanceStatusSummary systemStatus) { + this.systemStatus = systemStatus; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (events() != null) { + events().forEach(e -> e.validate()); + } + if (instanceState() != null) { + instanceState().validate(); + } + if (instanceStatus() != null) { + instanceStatus().validate(); + } + if (systemStatus() != null) { + systemStatus().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("availabilityZone", this.availabilityZone); + jsonWriter.writeArrayField("events", this.events, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("instanceId", this.instanceId); + jsonWriter.writeJsonField("instanceState", this.instanceState); + jsonWriter.writeJsonField("instanceStatus", this.instanceStatus); + jsonWriter.writeStringField("outpostArn", this.outpostArn); + jsonWriter.writeJsonField("systemStatus", this.systemStatus); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AwsEc2InstanceStatusProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AwsEc2InstanceStatusProperties if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the AwsEc2InstanceStatusProperties. + */ + public static AwsEc2InstanceStatusProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AwsEc2InstanceStatusProperties deserializedAwsEc2InstanceStatusProperties + = new AwsEc2InstanceStatusProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("availabilityZone".equals(fieldName)) { + deserializedAwsEc2InstanceStatusProperties.availabilityZone = reader.getString(); + } else if ("events".equals(fieldName)) { + List events + = reader.readArray(reader1 -> InstanceStatusEvent.fromJson(reader1)); + deserializedAwsEc2InstanceStatusProperties.events = events; + } else if ("instanceId".equals(fieldName)) { + deserializedAwsEc2InstanceStatusProperties.instanceId = reader.getString(); + } else if ("instanceState".equals(fieldName)) { + deserializedAwsEc2InstanceStatusProperties.instanceState = InstanceState.fromJson(reader); + } else if ("instanceStatus".equals(fieldName)) { + deserializedAwsEc2InstanceStatusProperties.instanceStatus = InstanceStatusSummary.fromJson(reader); + } else if ("outpostArn".equals(fieldName)) { + deserializedAwsEc2InstanceStatusProperties.outpostArn = reader.getString(); + } else if ("systemStatus".equals(fieldName)) { + deserializedAwsEc2InstanceStatusProperties.systemStatus = InstanceStatusSummary.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedAwsEc2InstanceStatusProperties; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/AwsEc2IpamProperties.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/AwsEc2IpamProperties.java new file mode 100644 index 000000000000..30a9fb4cb454 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/AwsEc2IpamProperties.java @@ -0,0 +1,572 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Definition of awsEc2Ipam. + */ +@Fluent +public final class AwsEc2IpamProperties implements JsonSerializable { + /* + *

The IPAM's default resource discovery association ID.

+ */ + private String defaultResourceDiscoveryAssociationId; + + /* + *

The IPAM's default resource discovery ID.

+ */ + private String defaultResourceDiscoveryId; + + /* + *

The description for the IPAM.

+ */ + private String description; + + /* + *

The Amazon Resource Name (ARN) of the IPAM.

+ */ + private String ipamArn; + + /* + *

The ID of the IPAM.

+ */ + private String ipamId; + + /* + *

The Amazon Web Services Region of the IPAM.

+ */ + private String ipamRegion; + + /* + *

The operating Regions for an IPAM. Operating Regions are Amazon Web Services Regions where the IPAM is allowed + * to manage IP address CIDRs. IPAM only discovers and monitors resources in the Amazon Web Services Regions you + * select as operating Regions.

For more information about operating Regions, see Create an IPAM in the Amazon VPC IPAM + * User Guide.

+ */ + private List operatingRegions; + + /* + *

The Amazon Web Services account ID of the owner of the IPAM.

+ */ + private String ownerId; + + /* + *

The ID of the IPAM's default private scope.

+ */ + private String privateDefaultScopeId; + + /* + *

The ID of the IPAM's default public scope.

+ */ + private String publicDefaultScopeId; + + /* + *

The IPAM's resource discovery association count.

+ */ + private Integer resourceDiscoveryAssociationCount; + + /* + *

The number of scopes in the IPAM. The scope quota is 5. For more information on quotas, see Quotas in IPAM in the Amazon VPC IPAM + * User Guide.

+ */ + private Integer scopeCount; + + /* + *

The state of the IPAM.

+ */ + private IpamStateEnumValue state; + + /* + *

The state message.

+ */ + private String stateMessage; + + /* + *

The key/value combination of a tag assigned to the resource. Use the tag key in the filter name and the tag + * value as the filter value. For example, to find all resources that have a tag with the key Owner and + * the value TeamA, specify tag:Owner for the filter name and TeamA for the + * filter value.

+ */ + private List tags; + + /* + *

IPAM is offered in a Free Tier and an Advanced Tier. For more information about the features available in each + * tier and the costs associated with the tiers, see Amazon VPC pricing + * > IPAM tab.

+ */ + private IpamTierEnumValue tier; + + /** + * Creates an instance of AwsEc2IpamProperties class. + */ + public AwsEc2IpamProperties() { + } + + /** + * Get the defaultResourceDiscoveryAssociationId property: <p>The IPAM's default resource discovery + * association ID.</p>. + * + * @return the defaultResourceDiscoveryAssociationId value. + */ + public String defaultResourceDiscoveryAssociationId() { + return this.defaultResourceDiscoveryAssociationId; + } + + /** + * Set the defaultResourceDiscoveryAssociationId property: <p>The IPAM's default resource discovery + * association ID.</p>. + * + * @param defaultResourceDiscoveryAssociationId the defaultResourceDiscoveryAssociationId value to set. + * @return the AwsEc2IpamProperties object itself. + */ + public AwsEc2IpamProperties + withDefaultResourceDiscoveryAssociationId(String defaultResourceDiscoveryAssociationId) { + this.defaultResourceDiscoveryAssociationId = defaultResourceDiscoveryAssociationId; + return this; + } + + /** + * Get the defaultResourceDiscoveryId property: <p>The IPAM's default resource discovery ID.</p>. + * + * @return the defaultResourceDiscoveryId value. + */ + public String defaultResourceDiscoveryId() { + return this.defaultResourceDiscoveryId; + } + + /** + * Set the defaultResourceDiscoveryId property: <p>The IPAM's default resource discovery ID.</p>. + * + * @param defaultResourceDiscoveryId the defaultResourceDiscoveryId value to set. + * @return the AwsEc2IpamProperties object itself. + */ + public AwsEc2IpamProperties withDefaultResourceDiscoveryId(String defaultResourceDiscoveryId) { + this.defaultResourceDiscoveryId = defaultResourceDiscoveryId; + return this; + } + + /** + * Get the description property: <p>The description for the IPAM.</p>. + * + * @return the description value. + */ + public String description() { + return this.description; + } + + /** + * Set the description property: <p>The description for the IPAM.</p>. + * + * @param description the description value to set. + * @return the AwsEc2IpamProperties object itself. + */ + public AwsEc2IpamProperties withDescription(String description) { + this.description = description; + return this; + } + + /** + * Get the ipamArn property: <p>The Amazon Resource Name (ARN) of the IPAM.</p>. + * + * @return the ipamArn value. + */ + public String ipamArn() { + return this.ipamArn; + } + + /** + * Set the ipamArn property: <p>The Amazon Resource Name (ARN) of the IPAM.</p>. + * + * @param ipamArn the ipamArn value to set. + * @return the AwsEc2IpamProperties object itself. + */ + public AwsEc2IpamProperties withIpamArn(String ipamArn) { + this.ipamArn = ipamArn; + return this; + } + + /** + * Get the ipamId property: <p>The ID of the IPAM.</p>. + * + * @return the ipamId value. + */ + public String ipamId() { + return this.ipamId; + } + + /** + * Set the ipamId property: <p>The ID of the IPAM.</p>. + * + * @param ipamId the ipamId value to set. + * @return the AwsEc2IpamProperties object itself. + */ + public AwsEc2IpamProperties withIpamId(String ipamId) { + this.ipamId = ipamId; + return this; + } + + /** + * Get the ipamRegion property: <p>The Amazon Web Services Region of the IPAM.</p>. + * + * @return the ipamRegion value. + */ + public String ipamRegion() { + return this.ipamRegion; + } + + /** + * Set the ipamRegion property: <p>The Amazon Web Services Region of the IPAM.</p>. + * + * @param ipamRegion the ipamRegion value to set. + * @return the AwsEc2IpamProperties object itself. + */ + public AwsEc2IpamProperties withIpamRegion(String ipamRegion) { + this.ipamRegion = ipamRegion; + return this; + } + + /** + * Get the operatingRegions property: <p>The operating Regions for an IPAM. Operating Regions are Amazon Web + * Services Regions where the IPAM is allowed to manage IP address CIDRs. IPAM only discovers and monitors resources + * in the Amazon Web Services Regions you select as operating Regions.</p> <p>For more information about + * operating Regions, see <a href='https://docs.aws.amazon.com/vpc/latest/ipam/create-ipam.html'>Create an + * IPAM</a> in the <i>Amazon VPC IPAM User Guide</i>.</p>. + * + * @return the operatingRegions value. + */ + public List operatingRegions() { + return this.operatingRegions; + } + + /** + * Set the operatingRegions property: <p>The operating Regions for an IPAM. Operating Regions are Amazon Web + * Services Regions where the IPAM is allowed to manage IP address CIDRs. IPAM only discovers and monitors resources + * in the Amazon Web Services Regions you select as operating Regions.</p> <p>For more information about + * operating Regions, see <a href='https://docs.aws.amazon.com/vpc/latest/ipam/create-ipam.html'>Create an + * IPAM</a> in the <i>Amazon VPC IPAM User Guide</i>.</p>. + * + * @param operatingRegions the operatingRegions value to set. + * @return the AwsEc2IpamProperties object itself. + */ + public AwsEc2IpamProperties withOperatingRegions(List operatingRegions) { + this.operatingRegions = operatingRegions; + return this; + } + + /** + * Get the ownerId property: <p>The Amazon Web Services account ID of the owner of the IPAM.</p>. + * + * @return the ownerId value. + */ + public String ownerId() { + return this.ownerId; + } + + /** + * Set the ownerId property: <p>The Amazon Web Services account ID of the owner of the IPAM.</p>. + * + * @param ownerId the ownerId value to set. + * @return the AwsEc2IpamProperties object itself. + */ + public AwsEc2IpamProperties withOwnerId(String ownerId) { + this.ownerId = ownerId; + return this; + } + + /** + * Get the privateDefaultScopeId property: <p>The ID of the IPAM's default private scope.</p>. + * + * @return the privateDefaultScopeId value. + */ + public String privateDefaultScopeId() { + return this.privateDefaultScopeId; + } + + /** + * Set the privateDefaultScopeId property: <p>The ID of the IPAM's default private scope.</p>. + * + * @param privateDefaultScopeId the privateDefaultScopeId value to set. + * @return the AwsEc2IpamProperties object itself. + */ + public AwsEc2IpamProperties withPrivateDefaultScopeId(String privateDefaultScopeId) { + this.privateDefaultScopeId = privateDefaultScopeId; + return this; + } + + /** + * Get the publicDefaultScopeId property: <p>The ID of the IPAM's default public scope.</p>. + * + * @return the publicDefaultScopeId value. + */ + public String publicDefaultScopeId() { + return this.publicDefaultScopeId; + } + + /** + * Set the publicDefaultScopeId property: <p>The ID of the IPAM's default public scope.</p>. + * + * @param publicDefaultScopeId the publicDefaultScopeId value to set. + * @return the AwsEc2IpamProperties object itself. + */ + public AwsEc2IpamProperties withPublicDefaultScopeId(String publicDefaultScopeId) { + this.publicDefaultScopeId = publicDefaultScopeId; + return this; + } + + /** + * Get the resourceDiscoveryAssociationCount property: <p>The IPAM's resource discovery association + * count.</p>. + * + * @return the resourceDiscoveryAssociationCount value. + */ + public Integer resourceDiscoveryAssociationCount() { + return this.resourceDiscoveryAssociationCount; + } + + /** + * Set the resourceDiscoveryAssociationCount property: <p>The IPAM's resource discovery association + * count.</p>. + * + * @param resourceDiscoveryAssociationCount the resourceDiscoveryAssociationCount value to set. + * @return the AwsEc2IpamProperties object itself. + */ + public AwsEc2IpamProperties withResourceDiscoveryAssociationCount(Integer resourceDiscoveryAssociationCount) { + this.resourceDiscoveryAssociationCount = resourceDiscoveryAssociationCount; + return this; + } + + /** + * Get the scopeCount property: <p>The number of scopes in the IPAM. The scope quota is 5. For more + * information on quotas, see <a href='https://docs.aws.amazon.com/vpc/latest/ipam/quotas-ipam.html'>Quotas in + * IPAM</a> in the <i>Amazon VPC IPAM User Guide</i>. </p>. + * + * @return the scopeCount value. + */ + public Integer scopeCount() { + return this.scopeCount; + } + + /** + * Set the scopeCount property: <p>The number of scopes in the IPAM. The scope quota is 5. For more + * information on quotas, see <a href='https://docs.aws.amazon.com/vpc/latest/ipam/quotas-ipam.html'>Quotas in + * IPAM</a> in the <i>Amazon VPC IPAM User Guide</i>. </p>. + * + * @param scopeCount the scopeCount value to set. + * @return the AwsEc2IpamProperties object itself. + */ + public AwsEc2IpamProperties withScopeCount(Integer scopeCount) { + this.scopeCount = scopeCount; + return this; + } + + /** + * Get the state property: <p>The state of the IPAM.</p>. + * + * @return the state value. + */ + public IpamStateEnumValue state() { + return this.state; + } + + /** + * Set the state property: <p>The state of the IPAM.</p>. + * + * @param state the state value to set. + * @return the AwsEc2IpamProperties object itself. + */ + public AwsEc2IpamProperties withState(IpamStateEnumValue state) { + this.state = state; + return this; + } + + /** + * Get the stateMessage property: <p>The state message.</p>. + * + * @return the stateMessage value. + */ + public String stateMessage() { + return this.stateMessage; + } + + /** + * Set the stateMessage property: <p>The state message.</p>. + * + * @param stateMessage the stateMessage value to set. + * @return the AwsEc2IpamProperties object itself. + */ + public AwsEc2IpamProperties withStateMessage(String stateMessage) { + this.stateMessage = stateMessage; + return this; + } + + /** + * Get the tags property: <p>The key/value combination of a tag assigned to the resource. Use the tag key in + * the filter name and the tag value as the filter value. For example, to find all resources that have a tag with + * the key <code>Owner</code> and the value <code>TeamA</code>, specify + * <code>tag:Owner</code> for the filter name and <code>TeamA</code> for the filter + * value.</p>. + * + * @return the tags value. + */ + public List tags() { + return this.tags; + } + + /** + * Set the tags property: <p>The key/value combination of a tag assigned to the resource. Use the tag key in + * the filter name and the tag value as the filter value. For example, to find all resources that have a tag with + * the key <code>Owner</code> and the value <code>TeamA</code>, specify + * <code>tag:Owner</code> for the filter name and <code>TeamA</code> for the filter + * value.</p>. + * + * @param tags the tags value to set. + * @return the AwsEc2IpamProperties object itself. + */ + public AwsEc2IpamProperties withTags(List tags) { + this.tags = tags; + return this; + } + + /** + * Get the tier property: <p>IPAM is offered in a Free Tier and an Advanced Tier. For more information about + * the features available in each tier and the costs associated with the tiers, see <a + * href='http://aws.amazon.com/vpc/pricing/'>Amazon VPC pricing &gt; IPAM tab</a>.</p>. + * + * @return the tier value. + */ + public IpamTierEnumValue tier() { + return this.tier; + } + + /** + * Set the tier property: <p>IPAM is offered in a Free Tier and an Advanced Tier. For more information about + * the features available in each tier and the costs associated with the tiers, see <a + * href='http://aws.amazon.com/vpc/pricing/'>Amazon VPC pricing &gt; IPAM tab</a>.</p>. + * + * @param tier the tier value to set. + * @return the AwsEc2IpamProperties object itself. + */ + public AwsEc2IpamProperties withTier(IpamTierEnumValue tier) { + this.tier = tier; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (operatingRegions() != null) { + operatingRegions().forEach(e -> e.validate()); + } + if (state() != null) { + state().validate(); + } + if (tags() != null) { + tags().forEach(e -> e.validate()); + } + if (tier() != null) { + tier().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("defaultResourceDiscoveryAssociationId", + this.defaultResourceDiscoveryAssociationId); + jsonWriter.writeStringField("defaultResourceDiscoveryId", this.defaultResourceDiscoveryId); + jsonWriter.writeStringField("description", this.description); + jsonWriter.writeStringField("ipamArn", this.ipamArn); + jsonWriter.writeStringField("ipamId", this.ipamId); + jsonWriter.writeStringField("ipamRegion", this.ipamRegion); + jsonWriter.writeArrayField("operatingRegions", this.operatingRegions, + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("ownerId", this.ownerId); + jsonWriter.writeStringField("privateDefaultScopeId", this.privateDefaultScopeId); + jsonWriter.writeStringField("publicDefaultScopeId", this.publicDefaultScopeId); + jsonWriter.writeNumberField("resourceDiscoveryAssociationCount", this.resourceDiscoveryAssociationCount); + jsonWriter.writeNumberField("scopeCount", this.scopeCount); + jsonWriter.writeJsonField("state", this.state); + jsonWriter.writeStringField("stateMessage", this.stateMessage); + jsonWriter.writeArrayField("tags", this.tags, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeJsonField("tier", this.tier); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AwsEc2IpamProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AwsEc2IpamProperties if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the AwsEc2IpamProperties. + */ + public static AwsEc2IpamProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AwsEc2IpamProperties deserializedAwsEc2IpamProperties = new AwsEc2IpamProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("defaultResourceDiscoveryAssociationId".equals(fieldName)) { + deserializedAwsEc2IpamProperties.defaultResourceDiscoveryAssociationId = reader.getString(); + } else if ("defaultResourceDiscoveryId".equals(fieldName)) { + deserializedAwsEc2IpamProperties.defaultResourceDiscoveryId = reader.getString(); + } else if ("description".equals(fieldName)) { + deserializedAwsEc2IpamProperties.description = reader.getString(); + } else if ("ipamArn".equals(fieldName)) { + deserializedAwsEc2IpamProperties.ipamArn = reader.getString(); + } else if ("ipamId".equals(fieldName)) { + deserializedAwsEc2IpamProperties.ipamId = reader.getString(); + } else if ("ipamRegion".equals(fieldName)) { + deserializedAwsEc2IpamProperties.ipamRegion = reader.getString(); + } else if ("operatingRegions".equals(fieldName)) { + List operatingRegions + = reader.readArray(reader1 -> IpamOperatingRegion.fromJson(reader1)); + deserializedAwsEc2IpamProperties.operatingRegions = operatingRegions; + } else if ("ownerId".equals(fieldName)) { + deserializedAwsEc2IpamProperties.ownerId = reader.getString(); + } else if ("privateDefaultScopeId".equals(fieldName)) { + deserializedAwsEc2IpamProperties.privateDefaultScopeId = reader.getString(); + } else if ("publicDefaultScopeId".equals(fieldName)) { + deserializedAwsEc2IpamProperties.publicDefaultScopeId = reader.getString(); + } else if ("resourceDiscoveryAssociationCount".equals(fieldName)) { + deserializedAwsEc2IpamProperties.resourceDiscoveryAssociationCount + = reader.getNullable(JsonReader::getInt); + } else if ("scopeCount".equals(fieldName)) { + deserializedAwsEc2IpamProperties.scopeCount = reader.getNullable(JsonReader::getInt); + } else if ("state".equals(fieldName)) { + deserializedAwsEc2IpamProperties.state = IpamStateEnumValue.fromJson(reader); + } else if ("stateMessage".equals(fieldName)) { + deserializedAwsEc2IpamProperties.stateMessage = reader.getString(); + } else if ("tags".equals(fieldName)) { + List tags = reader.readArray(reader1 -> TagAutoGenerated13.fromJson(reader1)); + deserializedAwsEc2IpamProperties.tags = tags; + } else if ("tier".equals(fieldName)) { + deserializedAwsEc2IpamProperties.tier = IpamTierEnumValue.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedAwsEc2IpamProperties; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/AwsEc2KeyPairProperties.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/AwsEc2KeyPairProperties.java new file mode 100644 index 000000000000..cb3ae070767e --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/AwsEc2KeyPairProperties.java @@ -0,0 +1,275 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Definition of awsEc2KeyPair. + */ +@Fluent +public final class AwsEc2KeyPairProperties implements JsonSerializable { + /* + * Property keyFingerprint + */ + private String keyFingerprint; + + /* + * The format of the key pair. Default: ``pem`` + */ + private KeyFormat keyFormat; + + /* + * A unique name for the key pair. Constraints: Up to 255 ASCII characters + */ + private String keyName; + + /* + * Property keyPairId + */ + private String keyPairId; + + /* + * The type of key pair. Note that ED25519 keys are not supported for Windows instances. If the + * ``PublicKeyMaterial`` property is specified, the ``KeyType`` property is ignored, and the key type is inferred + * from the ``PublicKeyMaterial`` value. Default: ``rsa`` + */ + private KeyType keyType; + + /* + * The public key material. The ``PublicKeyMaterial`` property is used to import a key pair. If this property is not + * specified, then a new key pair will be created. + */ + private String publicKeyMaterial; + + /* + * The tags to apply to the key pair. + */ + private List tags; + + /** + * Creates an instance of AwsEc2KeyPairProperties class. + */ + public AwsEc2KeyPairProperties() { + } + + /** + * Get the keyFingerprint property: Property keyFingerprint. + * + * @return the keyFingerprint value. + */ + public String keyFingerprint() { + return this.keyFingerprint; + } + + /** + * Set the keyFingerprint property: Property keyFingerprint. + * + * @param keyFingerprint the keyFingerprint value to set. + * @return the AwsEc2KeyPairProperties object itself. + */ + public AwsEc2KeyPairProperties withKeyFingerprint(String keyFingerprint) { + this.keyFingerprint = keyFingerprint; + return this; + } + + /** + * Get the keyFormat property: The format of the key pair. Default: ``pem``. + * + * @return the keyFormat value. + */ + public KeyFormat keyFormat() { + return this.keyFormat; + } + + /** + * Set the keyFormat property: The format of the key pair. Default: ``pem``. + * + * @param keyFormat the keyFormat value to set. + * @return the AwsEc2KeyPairProperties object itself. + */ + public AwsEc2KeyPairProperties withKeyFormat(KeyFormat keyFormat) { + this.keyFormat = keyFormat; + return this; + } + + /** + * Get the keyName property: A unique name for the key pair. Constraints: Up to 255 ASCII characters. + * + * @return the keyName value. + */ + public String keyName() { + return this.keyName; + } + + /** + * Set the keyName property: A unique name for the key pair. Constraints: Up to 255 ASCII characters. + * + * @param keyName the keyName value to set. + * @return the AwsEc2KeyPairProperties object itself. + */ + public AwsEc2KeyPairProperties withKeyName(String keyName) { + this.keyName = keyName; + return this; + } + + /** + * Get the keyPairId property: Property keyPairId. + * + * @return the keyPairId value. + */ + public String keyPairId() { + return this.keyPairId; + } + + /** + * Set the keyPairId property: Property keyPairId. + * + * @param keyPairId the keyPairId value to set. + * @return the AwsEc2KeyPairProperties object itself. + */ + public AwsEc2KeyPairProperties withKeyPairId(String keyPairId) { + this.keyPairId = keyPairId; + return this; + } + + /** + * Get the keyType property: The type of key pair. Note that ED25519 keys are not supported for Windows instances. + * If the ``PublicKeyMaterial`` property is specified, the ``KeyType`` property is ignored, and the key type is + * inferred from the ``PublicKeyMaterial`` value. Default: ``rsa``. + * + * @return the keyType value. + */ + public KeyType keyType() { + return this.keyType; + } + + /** + * Set the keyType property: The type of key pair. Note that ED25519 keys are not supported for Windows instances. + * If the ``PublicKeyMaterial`` property is specified, the ``KeyType`` property is ignored, and the key type is + * inferred from the ``PublicKeyMaterial`` value. Default: ``rsa``. + * + * @param keyType the keyType value to set. + * @return the AwsEc2KeyPairProperties object itself. + */ + public AwsEc2KeyPairProperties withKeyType(KeyType keyType) { + this.keyType = keyType; + return this; + } + + /** + * Get the publicKeyMaterial property: The public key material. The ``PublicKeyMaterial`` property is used to import + * a key pair. If this property is not specified, then a new key pair will be created. + * + * @return the publicKeyMaterial value. + */ + public String publicKeyMaterial() { + return this.publicKeyMaterial; + } + + /** + * Set the publicKeyMaterial property: The public key material. The ``PublicKeyMaterial`` property is used to import + * a key pair. If this property is not specified, then a new key pair will be created. + * + * @param publicKeyMaterial the publicKeyMaterial value to set. + * @return the AwsEc2KeyPairProperties object itself. + */ + public AwsEc2KeyPairProperties withPublicKeyMaterial(String publicKeyMaterial) { + this.publicKeyMaterial = publicKeyMaterial; + return this; + } + + /** + * Get the tags property: The tags to apply to the key pair. + * + * @return the tags value. + */ + public List tags() { + return this.tags; + } + + /** + * Set the tags property: The tags to apply to the key pair. + * + * @param tags the tags value to set. + * @return the AwsEc2KeyPairProperties object itself. + */ + public AwsEc2KeyPairProperties withTags(List tags) { + this.tags = tags; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (tags() != null) { + tags().forEach(e -> e.validate()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("keyFingerprint", this.keyFingerprint); + jsonWriter.writeStringField("keyFormat", this.keyFormat == null ? null : this.keyFormat.toString()); + jsonWriter.writeStringField("keyName", this.keyName); + jsonWriter.writeStringField("keyPairId", this.keyPairId); + jsonWriter.writeStringField("keyType", this.keyType == null ? null : this.keyType.toString()); + jsonWriter.writeStringField("publicKeyMaterial", this.publicKeyMaterial); + jsonWriter.writeArrayField("tags", this.tags, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AwsEc2KeyPairProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AwsEc2KeyPairProperties if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the AwsEc2KeyPairProperties. + */ + public static AwsEc2KeyPairProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AwsEc2KeyPairProperties deserializedAwsEc2KeyPairProperties = new AwsEc2KeyPairProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("keyFingerprint".equals(fieldName)) { + deserializedAwsEc2KeyPairProperties.keyFingerprint = reader.getString(); + } else if ("keyFormat".equals(fieldName)) { + deserializedAwsEc2KeyPairProperties.keyFormat = KeyFormat.fromString(reader.getString()); + } else if ("keyName".equals(fieldName)) { + deserializedAwsEc2KeyPairProperties.keyName = reader.getString(); + } else if ("keyPairId".equals(fieldName)) { + deserializedAwsEc2KeyPairProperties.keyPairId = reader.getString(); + } else if ("keyType".equals(fieldName)) { + deserializedAwsEc2KeyPairProperties.keyType = KeyType.fromString(reader.getString()); + } else if ("publicKeyMaterial".equals(fieldName)) { + deserializedAwsEc2KeyPairProperties.publicKeyMaterial = reader.getString(); + } else if ("tags".equals(fieldName)) { + List tags = reader.readArray(reader1 -> TagAutoGenerated14.fromJson(reader1)); + deserializedAwsEc2KeyPairProperties.tags = tags; + } else { + reader.skipChildren(); + } + } + + return deserializedAwsEc2KeyPairProperties; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/AwsEc2NetworkAclProperties.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/AwsEc2NetworkAclProperties.java new file mode 100644 index 000000000000..4f0ce63859c6 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/AwsEc2NetworkAclProperties.java @@ -0,0 +1,154 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Definition of awsEc2NetworkAcl. + */ +@Fluent +public final class AwsEc2NetworkAclProperties implements JsonSerializable { + /* + * Property id + */ + private String id; + + /* + * The tags for the network ACL. + */ + private List tags; + + /* + * The ID of the VPC for the network ACL. + */ + private String vpcId; + + /** + * Creates an instance of AwsEc2NetworkAclProperties class. + */ + public AwsEc2NetworkAclProperties() { + } + + /** + * Get the id property: Property id. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Set the id property: Property id. + * + * @param id the id value to set. + * @return the AwsEc2NetworkAclProperties object itself. + */ + public AwsEc2NetworkAclProperties withId(String id) { + this.id = id; + return this; + } + + /** + * Get the tags property: The tags for the network ACL. + * + * @return the tags value. + */ + public List tags() { + return this.tags; + } + + /** + * Set the tags property: The tags for the network ACL. + * + * @param tags the tags value to set. + * @return the AwsEc2NetworkAclProperties object itself. + */ + public AwsEc2NetworkAclProperties withTags(List tags) { + this.tags = tags; + return this; + } + + /** + * Get the vpcId property: The ID of the VPC for the network ACL. + * + * @return the vpcId value. + */ + public String vpcId() { + return this.vpcId; + } + + /** + * Set the vpcId property: The ID of the VPC for the network ACL. + * + * @param vpcId the vpcId value to set. + * @return the AwsEc2NetworkAclProperties object itself. + */ + public AwsEc2NetworkAclProperties withVpcId(String vpcId) { + this.vpcId = vpcId; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (tags() != null) { + tags().forEach(e -> e.validate()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("id", this.id); + jsonWriter.writeArrayField("tags", this.tags, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("vpcId", this.vpcId); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AwsEc2NetworkAclProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AwsEc2NetworkAclProperties if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IOException If an error occurs while reading the AwsEc2NetworkAclProperties. + */ + public static AwsEc2NetworkAclProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AwsEc2NetworkAclProperties deserializedAwsEc2NetworkAclProperties = new AwsEc2NetworkAclProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedAwsEc2NetworkAclProperties.id = reader.getString(); + } else if ("tags".equals(fieldName)) { + List tags = reader.readArray(reader1 -> TagAutoGenerated15.fromJson(reader1)); + deserializedAwsEc2NetworkAclProperties.tags = tags; + } else if ("vpcId".equals(fieldName)) { + deserializedAwsEc2NetworkAclProperties.vpcId = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedAwsEc2NetworkAclProperties; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/AwsEc2NetworkInterfaceProperties.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/AwsEc2NetworkInterfaceProperties.java new file mode 100644 index 000000000000..af6ea71b80a6 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/AwsEc2NetworkInterfaceProperties.java @@ -0,0 +1,818 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Definition of awsEc2NetworkInterface. + */ +@Fluent +public final class AwsEc2NetworkInterfaceProperties implements JsonSerializable { + /* + * Property connectionTrackingSpecification + */ + private ConnectionTrackingSpecification connectionTrackingSpecification; + + /* + * A description for the network interface. + */ + private String description; + + /* + * If you have instances or ENIs that rely on the IPv6 address not changing, to avoid disrupting traffic to + * instances or ENIs, you can enable a primary IPv6 address. Enable this option to automatically assign an IPv6 + * associated with the ENI attached to your instance to be the primary IPv6 address. When you enable an IPv6 address + * to be a primary IPv6, you cannot disable it. Traffic will be routed to the primary IPv6 address until the + * instance is terminated or the ENI is detached. If you have multiple IPv6 addresses associated with an ENI and you + * enable a primary IPv6 address, the first IPv6 address associated with the ENI becomes the primary IPv6 address. + */ + private Boolean enablePrimaryIpv6; + + /* + * A list of security group IDs associated with this network interface. + */ + private List groupSet; + + /* + * Network interface id. + */ + private String id; + + /* + * Indicates the type of network interface. + */ + private String interfaceType; + + /* + * The number of IPv4 prefixes to assign to a network interface. When you specify a number of IPv4 prefixes, Amazon + * EC2 selects these prefixes from your existing subnet CIDR reservations, if available, or from free spaces in the + * subnet. By default, these will be /28 prefixes. You can't specify a count of IPv4 prefixes if you've specified + * one of the following: specific IPv4 prefixes, specific private IPv4 addresses, or a count of private IPv4 + * addresses. + */ + private Integer ipv4PrefixCount; + + /* + * Assigns a list of IPv4 prefixes to the network interface. If you want EC2 to automatically assign IPv4 prefixes, + * use the Ipv4PrefixCount property and do not specify this property. Presently, only /28 prefixes are supported. + * You can't specify IPv4 prefixes if you've specified one of the following: a count of IPv4 prefixes, specific + * private IPv4 addresses, or a count of private IPv4 addresses. + */ + private List ipv4Prefixes; + + /* + * The number of IPv6 addresses to assign to a network interface. Amazon EC2 automatically selects the IPv6 + * addresses from the subnet range. To specify specific IPv6 addresses, use the Ipv6Addresses property and don't + * specify this property. + */ + private Integer ipv6AddressCount; + + /* + * One or more specific IPv6 addresses from the IPv6 CIDR block range of your subnet to associate with the network + * interface. If you're specifying a number of IPv6 addresses, use the Ipv6AddressCount property and don't specify + * this property. + */ + private List ipv6Addresses; + + /* + * The number of IPv6 prefixes to assign to a network interface. When you specify a number of IPv6 prefixes, Amazon + * EC2 selects these prefixes from your existing subnet CIDR reservations, if available, or from free spaces in the + * subnet. By default, these will be /80 prefixes. You can't specify a count of IPv6 prefixes if you've specified + * one of the following: specific IPv6 prefixes, specific IPv6 addresses, or a count of IPv6 addresses. + */ + private Integer ipv6PrefixCount; + + /* + * Assigns a list of IPv6 prefixes to the network interface. If you want EC2 to automatically assign IPv6 prefixes, + * use the Ipv6PrefixCount property and do not specify this property. Presently, only /80 prefixes are supported. + * You can't specify IPv6 prefixes if you've specified one of the following: a count of IPv6 prefixes, specific IPv6 + * addresses, or a count of IPv6 addresses. + */ + private List ipv6Prefixes; + + /* + * The primary IPv6 address + */ + private String primaryIpv6Address; + + /* + * Returns the primary private IP address of the network interface. + */ + private String primaryPrivateIpAddress; + + /* + * Assigns a single private IP address to the network interface, which is used as the primary private IP address. If + * you want to specify multiple private IP address, use the PrivateIpAddresses property. + */ + private String privateIpAddress; + + /* + * Assigns a list of private IP addresses to the network interface. You can specify a primary private IP address by + * setting the value of the Primary property to true in the PrivateIpAddressSpecification property. If you want EC2 + * to automatically assign private IP addresses, use the SecondaryPrivateIpAddressCount property and do not specify + * this property. + */ + private List privateIpAddresses; + + /* + * The number of secondary private IPv4 addresses to assign to a network interface. When you specify a number of + * secondary IPv4 addresses, Amazon EC2 selects these IP addresses within the subnet's IPv4 CIDR range. You can't + * specify this option and specify more than one private IP address using privateIpAddresses + */ + private Integer secondaryPrivateIpAddressCount; + + /* + * Returns the secondary private IP addresses of the network interface. + */ + private List secondaryPrivateIpAddresses; + + /* + * Indicates whether traffic to or from the instance is validated. + */ + private Boolean sourceDestCheck; + + /* + * The ID of the subnet to associate with the network interface. + */ + private String subnetId; + + /* + * An arbitrary set of tags (key-value pairs) for this network interface. + */ + private List tags; + + /* + * The ID of the VPC + */ + private String vpcId; + + /** + * Creates an instance of AwsEc2NetworkInterfaceProperties class. + */ + public AwsEc2NetworkInterfaceProperties() { + } + + /** + * Get the connectionTrackingSpecification property: Property connectionTrackingSpecification. + * + * @return the connectionTrackingSpecification value. + */ + public ConnectionTrackingSpecification connectionTrackingSpecification() { + return this.connectionTrackingSpecification; + } + + /** + * Set the connectionTrackingSpecification property: Property connectionTrackingSpecification. + * + * @param connectionTrackingSpecification the connectionTrackingSpecification value to set. + * @return the AwsEc2NetworkInterfaceProperties object itself. + */ + public AwsEc2NetworkInterfaceProperties + withConnectionTrackingSpecification(ConnectionTrackingSpecification connectionTrackingSpecification) { + this.connectionTrackingSpecification = connectionTrackingSpecification; + return this; + } + + /** + * Get the description property: A description for the network interface. + * + * @return the description value. + */ + public String description() { + return this.description; + } + + /** + * Set the description property: A description for the network interface. + * + * @param description the description value to set. + * @return the AwsEc2NetworkInterfaceProperties object itself. + */ + public AwsEc2NetworkInterfaceProperties withDescription(String description) { + this.description = description; + return this; + } + + /** + * Get the enablePrimaryIpv6 property: If you have instances or ENIs that rely on the IPv6 address not changing, to + * avoid disrupting traffic to instances or ENIs, you can enable a primary IPv6 address. Enable this option to + * automatically assign an IPv6 associated with the ENI attached to your instance to be the primary IPv6 address. + * When you enable an IPv6 address to be a primary IPv6, you cannot disable it. Traffic will be routed to the + * primary IPv6 address until the instance is terminated or the ENI is detached. If you have multiple IPv6 addresses + * associated with an ENI and you enable a primary IPv6 address, the first IPv6 address associated with the ENI + * becomes the primary IPv6 address. + * + * @return the enablePrimaryIpv6 value. + */ + public Boolean enablePrimaryIpv6() { + return this.enablePrimaryIpv6; + } + + /** + * Set the enablePrimaryIpv6 property: If you have instances or ENIs that rely on the IPv6 address not changing, to + * avoid disrupting traffic to instances or ENIs, you can enable a primary IPv6 address. Enable this option to + * automatically assign an IPv6 associated with the ENI attached to your instance to be the primary IPv6 address. + * When you enable an IPv6 address to be a primary IPv6, you cannot disable it. Traffic will be routed to the + * primary IPv6 address until the instance is terminated or the ENI is detached. If you have multiple IPv6 addresses + * associated with an ENI and you enable a primary IPv6 address, the first IPv6 address associated with the ENI + * becomes the primary IPv6 address. + * + * @param enablePrimaryIpv6 the enablePrimaryIpv6 value to set. + * @return the AwsEc2NetworkInterfaceProperties object itself. + */ + public AwsEc2NetworkInterfaceProperties withEnablePrimaryIpv6(Boolean enablePrimaryIpv6) { + this.enablePrimaryIpv6 = enablePrimaryIpv6; + return this; + } + + /** + * Get the groupSet property: A list of security group IDs associated with this network interface. + * + * @return the groupSet value. + */ + public List groupSet() { + return this.groupSet; + } + + /** + * Set the groupSet property: A list of security group IDs associated with this network interface. + * + * @param groupSet the groupSet value to set. + * @return the AwsEc2NetworkInterfaceProperties object itself. + */ + public AwsEc2NetworkInterfaceProperties withGroupSet(List groupSet) { + this.groupSet = groupSet; + return this; + } + + /** + * Get the id property: Network interface id. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Set the id property: Network interface id. + * + * @param id the id value to set. + * @return the AwsEc2NetworkInterfaceProperties object itself. + */ + public AwsEc2NetworkInterfaceProperties withId(String id) { + this.id = id; + return this; + } + + /** + * Get the interfaceType property: Indicates the type of network interface. + * + * @return the interfaceType value. + */ + public String interfaceType() { + return this.interfaceType; + } + + /** + * Set the interfaceType property: Indicates the type of network interface. + * + * @param interfaceType the interfaceType value to set. + * @return the AwsEc2NetworkInterfaceProperties object itself. + */ + public AwsEc2NetworkInterfaceProperties withInterfaceType(String interfaceType) { + this.interfaceType = interfaceType; + return this; + } + + /** + * Get the ipv4PrefixCount property: The number of IPv4 prefixes to assign to a network interface. When you specify + * a number of IPv4 prefixes, Amazon EC2 selects these prefixes from your existing subnet CIDR reservations, if + * available, or from free spaces in the subnet. By default, these will be /28 prefixes. You can't specify a count + * of IPv4 prefixes if you've specified one of the following: specific IPv4 prefixes, specific private IPv4 + * addresses, or a count of private IPv4 addresses. + * + * @return the ipv4PrefixCount value. + */ + public Integer ipv4PrefixCount() { + return this.ipv4PrefixCount; + } + + /** + * Set the ipv4PrefixCount property: The number of IPv4 prefixes to assign to a network interface. When you specify + * a number of IPv4 prefixes, Amazon EC2 selects these prefixes from your existing subnet CIDR reservations, if + * available, or from free spaces in the subnet. By default, these will be /28 prefixes. You can't specify a count + * of IPv4 prefixes if you've specified one of the following: specific IPv4 prefixes, specific private IPv4 + * addresses, or a count of private IPv4 addresses. + * + * @param ipv4PrefixCount the ipv4PrefixCount value to set. + * @return the AwsEc2NetworkInterfaceProperties object itself. + */ + public AwsEc2NetworkInterfaceProperties withIpv4PrefixCount(Integer ipv4PrefixCount) { + this.ipv4PrefixCount = ipv4PrefixCount; + return this; + } + + /** + * Get the ipv4Prefixes property: Assigns a list of IPv4 prefixes to the network interface. If you want EC2 to + * automatically assign IPv4 prefixes, use the Ipv4PrefixCount property and do not specify this property. Presently, + * only /28 prefixes are supported. You can't specify IPv4 prefixes if you've specified one of the following: a + * count of IPv4 prefixes, specific private IPv4 addresses, or a count of private IPv4 addresses. + * + * @return the ipv4Prefixes value. + */ + public List ipv4Prefixes() { + return this.ipv4Prefixes; + } + + /** + * Set the ipv4Prefixes property: Assigns a list of IPv4 prefixes to the network interface. If you want EC2 to + * automatically assign IPv4 prefixes, use the Ipv4PrefixCount property and do not specify this property. Presently, + * only /28 prefixes are supported. You can't specify IPv4 prefixes if you've specified one of the following: a + * count of IPv4 prefixes, specific private IPv4 addresses, or a count of private IPv4 addresses. + * + * @param ipv4Prefixes the ipv4Prefixes value to set. + * @return the AwsEc2NetworkInterfaceProperties object itself. + */ + public AwsEc2NetworkInterfaceProperties withIpv4Prefixes(List ipv4Prefixes) { + this.ipv4Prefixes = ipv4Prefixes; + return this; + } + + /** + * Get the ipv6AddressCount property: The number of IPv6 addresses to assign to a network interface. Amazon EC2 + * automatically selects the IPv6 addresses from the subnet range. To specify specific IPv6 addresses, use the + * Ipv6Addresses property and don't specify this property. + * + * @return the ipv6AddressCount value. + */ + public Integer ipv6AddressCount() { + return this.ipv6AddressCount; + } + + /** + * Set the ipv6AddressCount property: The number of IPv6 addresses to assign to a network interface. Amazon EC2 + * automatically selects the IPv6 addresses from the subnet range. To specify specific IPv6 addresses, use the + * Ipv6Addresses property and don't specify this property. + * + * @param ipv6AddressCount the ipv6AddressCount value to set. + * @return the AwsEc2NetworkInterfaceProperties object itself. + */ + public AwsEc2NetworkInterfaceProperties withIpv6AddressCount(Integer ipv6AddressCount) { + this.ipv6AddressCount = ipv6AddressCount; + return this; + } + + /** + * Get the ipv6Addresses property: One or more specific IPv6 addresses from the IPv6 CIDR block range of your subnet + * to associate with the network interface. If you're specifying a number of IPv6 addresses, use the + * Ipv6AddressCount property and don't specify this property. + * + * @return the ipv6Addresses value. + */ + public List ipv6Addresses() { + return this.ipv6Addresses; + } + + /** + * Set the ipv6Addresses property: One or more specific IPv6 addresses from the IPv6 CIDR block range of your subnet + * to associate with the network interface. If you're specifying a number of IPv6 addresses, use the + * Ipv6AddressCount property and don't specify this property. + * + * @param ipv6Addresses the ipv6Addresses value to set. + * @return the AwsEc2NetworkInterfaceProperties object itself. + */ + public AwsEc2NetworkInterfaceProperties withIpv6Addresses(List ipv6Addresses) { + this.ipv6Addresses = ipv6Addresses; + return this; + } + + /** + * Get the ipv6PrefixCount property: The number of IPv6 prefixes to assign to a network interface. When you specify + * a number of IPv6 prefixes, Amazon EC2 selects these prefixes from your existing subnet CIDR reservations, if + * available, or from free spaces in the subnet. By default, these will be /80 prefixes. You can't specify a count + * of IPv6 prefixes if you've specified one of the following: specific IPv6 prefixes, specific IPv6 addresses, or a + * count of IPv6 addresses. + * + * @return the ipv6PrefixCount value. + */ + public Integer ipv6PrefixCount() { + return this.ipv6PrefixCount; + } + + /** + * Set the ipv6PrefixCount property: The number of IPv6 prefixes to assign to a network interface. When you specify + * a number of IPv6 prefixes, Amazon EC2 selects these prefixes from your existing subnet CIDR reservations, if + * available, or from free spaces in the subnet. By default, these will be /80 prefixes. You can't specify a count + * of IPv6 prefixes if you've specified one of the following: specific IPv6 prefixes, specific IPv6 addresses, or a + * count of IPv6 addresses. + * + * @param ipv6PrefixCount the ipv6PrefixCount value to set. + * @return the AwsEc2NetworkInterfaceProperties object itself. + */ + public AwsEc2NetworkInterfaceProperties withIpv6PrefixCount(Integer ipv6PrefixCount) { + this.ipv6PrefixCount = ipv6PrefixCount; + return this; + } + + /** + * Get the ipv6Prefixes property: Assigns a list of IPv6 prefixes to the network interface. If you want EC2 to + * automatically assign IPv6 prefixes, use the Ipv6PrefixCount property and do not specify this property. Presently, + * only /80 prefixes are supported. You can't specify IPv6 prefixes if you've specified one of the following: a + * count of IPv6 prefixes, specific IPv6 addresses, or a count of IPv6 addresses. + * + * @return the ipv6Prefixes value. + */ + public List ipv6Prefixes() { + return this.ipv6Prefixes; + } + + /** + * Set the ipv6Prefixes property: Assigns a list of IPv6 prefixes to the network interface. If you want EC2 to + * automatically assign IPv6 prefixes, use the Ipv6PrefixCount property and do not specify this property. Presently, + * only /80 prefixes are supported. You can't specify IPv6 prefixes if you've specified one of the following: a + * count of IPv6 prefixes, specific IPv6 addresses, or a count of IPv6 addresses. + * + * @param ipv6Prefixes the ipv6Prefixes value to set. + * @return the AwsEc2NetworkInterfaceProperties object itself. + */ + public AwsEc2NetworkInterfaceProperties withIpv6Prefixes(List ipv6Prefixes) { + this.ipv6Prefixes = ipv6Prefixes; + return this; + } + + /** + * Get the primaryIpv6Address property: The primary IPv6 address. + * + * @return the primaryIpv6Address value. + */ + public String primaryIpv6Address() { + return this.primaryIpv6Address; + } + + /** + * Set the primaryIpv6Address property: The primary IPv6 address. + * + * @param primaryIpv6Address the primaryIpv6Address value to set. + * @return the AwsEc2NetworkInterfaceProperties object itself. + */ + public AwsEc2NetworkInterfaceProperties withPrimaryIpv6Address(String primaryIpv6Address) { + this.primaryIpv6Address = primaryIpv6Address; + return this; + } + + /** + * Get the primaryPrivateIpAddress property: Returns the primary private IP address of the network interface. + * + * @return the primaryPrivateIpAddress value. + */ + public String primaryPrivateIpAddress() { + return this.primaryPrivateIpAddress; + } + + /** + * Set the primaryPrivateIpAddress property: Returns the primary private IP address of the network interface. + * + * @param primaryPrivateIpAddress the primaryPrivateIpAddress value to set. + * @return the AwsEc2NetworkInterfaceProperties object itself. + */ + public AwsEc2NetworkInterfaceProperties withPrimaryPrivateIpAddress(String primaryPrivateIpAddress) { + this.primaryPrivateIpAddress = primaryPrivateIpAddress; + return this; + } + + /** + * Get the privateIpAddress property: Assigns a single private IP address to the network interface, which is used as + * the primary private IP address. If you want to specify multiple private IP address, use the PrivateIpAddresses + * property. + * + * @return the privateIpAddress value. + */ + public String privateIpAddress() { + return this.privateIpAddress; + } + + /** + * Set the privateIpAddress property: Assigns a single private IP address to the network interface, which is used as + * the primary private IP address. If you want to specify multiple private IP address, use the PrivateIpAddresses + * property. + * + * @param privateIpAddress the privateIpAddress value to set. + * @return the AwsEc2NetworkInterfaceProperties object itself. + */ + public AwsEc2NetworkInterfaceProperties withPrivateIpAddress(String privateIpAddress) { + this.privateIpAddress = privateIpAddress; + return this; + } + + /** + * Get the privateIpAddresses property: Assigns a list of private IP addresses to the network interface. You can + * specify a primary private IP address by setting the value of the Primary property to true in the + * PrivateIpAddressSpecification property. If you want EC2 to automatically assign private IP addresses, use the + * SecondaryPrivateIpAddressCount property and do not specify this property. + * + * @return the privateIpAddresses value. + */ + public List privateIpAddresses() { + return this.privateIpAddresses; + } + + /** + * Set the privateIpAddresses property: Assigns a list of private IP addresses to the network interface. You can + * specify a primary private IP address by setting the value of the Primary property to true in the + * PrivateIpAddressSpecification property. If you want EC2 to automatically assign private IP addresses, use the + * SecondaryPrivateIpAddressCount property and do not specify this property. + * + * @param privateIpAddresses the privateIpAddresses value to set. + * @return the AwsEc2NetworkInterfaceProperties object itself. + */ + public AwsEc2NetworkInterfaceProperties + withPrivateIpAddresses(List privateIpAddresses) { + this.privateIpAddresses = privateIpAddresses; + return this; + } + + /** + * Get the secondaryPrivateIpAddressCount property: The number of secondary private IPv4 addresses to assign to a + * network interface. When you specify a number of secondary IPv4 addresses, Amazon EC2 selects these IP addresses + * within the subnet's IPv4 CIDR range. You can't specify this option and specify more than one private IP address + * using privateIpAddresses. + * + * @return the secondaryPrivateIpAddressCount value. + */ + public Integer secondaryPrivateIpAddressCount() { + return this.secondaryPrivateIpAddressCount; + } + + /** + * Set the secondaryPrivateIpAddressCount property: The number of secondary private IPv4 addresses to assign to a + * network interface. When you specify a number of secondary IPv4 addresses, Amazon EC2 selects these IP addresses + * within the subnet's IPv4 CIDR range. You can't specify this option and specify more than one private IP address + * using privateIpAddresses. + * + * @param secondaryPrivateIpAddressCount the secondaryPrivateIpAddressCount value to set. + * @return the AwsEc2NetworkInterfaceProperties object itself. + */ + public AwsEc2NetworkInterfaceProperties withSecondaryPrivateIpAddressCount(Integer secondaryPrivateIpAddressCount) { + this.secondaryPrivateIpAddressCount = secondaryPrivateIpAddressCount; + return this; + } + + /** + * Get the secondaryPrivateIpAddresses property: Returns the secondary private IP addresses of the network + * interface. + * + * @return the secondaryPrivateIpAddresses value. + */ + public List secondaryPrivateIpAddresses() { + return this.secondaryPrivateIpAddresses; + } + + /** + * Set the secondaryPrivateIpAddresses property: Returns the secondary private IP addresses of the network + * interface. + * + * @param secondaryPrivateIpAddresses the secondaryPrivateIpAddresses value to set. + * @return the AwsEc2NetworkInterfaceProperties object itself. + */ + public AwsEc2NetworkInterfaceProperties withSecondaryPrivateIpAddresses(List secondaryPrivateIpAddresses) { + this.secondaryPrivateIpAddresses = secondaryPrivateIpAddresses; + return this; + } + + /** + * Get the sourceDestCheck property: Indicates whether traffic to or from the instance is validated. + * + * @return the sourceDestCheck value. + */ + public Boolean sourceDestCheck() { + return this.sourceDestCheck; + } + + /** + * Set the sourceDestCheck property: Indicates whether traffic to or from the instance is validated. + * + * @param sourceDestCheck the sourceDestCheck value to set. + * @return the AwsEc2NetworkInterfaceProperties object itself. + */ + public AwsEc2NetworkInterfaceProperties withSourceDestCheck(Boolean sourceDestCheck) { + this.sourceDestCheck = sourceDestCheck; + return this; + } + + /** + * Get the subnetId property: The ID of the subnet to associate with the network interface. + * + * @return the subnetId value. + */ + public String subnetId() { + return this.subnetId; + } + + /** + * Set the subnetId property: The ID of the subnet to associate with the network interface. + * + * @param subnetId the subnetId value to set. + * @return the AwsEc2NetworkInterfaceProperties object itself. + */ + public AwsEc2NetworkInterfaceProperties withSubnetId(String subnetId) { + this.subnetId = subnetId; + return this; + } + + /** + * Get the tags property: An arbitrary set of tags (key-value pairs) for this network interface. + * + * @return the tags value. + */ + public List tags() { + return this.tags; + } + + /** + * Set the tags property: An arbitrary set of tags (key-value pairs) for this network interface. + * + * @param tags the tags value to set. + * @return the AwsEc2NetworkInterfaceProperties object itself. + */ + public AwsEc2NetworkInterfaceProperties withTags(List tags) { + this.tags = tags; + return this; + } + + /** + * Get the vpcId property: The ID of the VPC. + * + * @return the vpcId value. + */ + public String vpcId() { + return this.vpcId; + } + + /** + * Set the vpcId property: The ID of the VPC. + * + * @param vpcId the vpcId value to set. + * @return the AwsEc2NetworkInterfaceProperties object itself. + */ + public AwsEc2NetworkInterfaceProperties withVpcId(String vpcId) { + this.vpcId = vpcId; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (connectionTrackingSpecification() != null) { + connectionTrackingSpecification().validate(); + } + if (ipv4Prefixes() != null) { + ipv4Prefixes().forEach(e -> e.validate()); + } + if (ipv6Addresses() != null) { + ipv6Addresses().forEach(e -> e.validate()); + } + if (ipv6Prefixes() != null) { + ipv6Prefixes().forEach(e -> e.validate()); + } + if (privateIpAddresses() != null) { + privateIpAddresses().forEach(e -> e.validate()); + } + if (tags() != null) { + tags().forEach(e -> e.validate()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("connectionTrackingSpecification", this.connectionTrackingSpecification); + jsonWriter.writeStringField("description", this.description); + jsonWriter.writeBooleanField("enablePrimaryIpv6", this.enablePrimaryIpv6); + jsonWriter.writeArrayField("groupSet", this.groupSet, (writer, element) -> writer.writeString(element)); + jsonWriter.writeStringField("id", this.id); + jsonWriter.writeStringField("interfaceType", this.interfaceType); + jsonWriter.writeNumberField("ipv4PrefixCount", this.ipv4PrefixCount); + jsonWriter.writeArrayField("ipv4Prefixes", this.ipv4Prefixes, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeNumberField("ipv6AddressCount", this.ipv6AddressCount); + jsonWriter.writeArrayField("ipv6Addresses", this.ipv6Addresses, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeNumberField("ipv6PrefixCount", this.ipv6PrefixCount); + jsonWriter.writeArrayField("ipv6Prefixes", this.ipv6Prefixes, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("primaryIpv6Address", this.primaryIpv6Address); + jsonWriter.writeStringField("primaryPrivateIpAddress", this.primaryPrivateIpAddress); + jsonWriter.writeStringField("privateIpAddress", this.privateIpAddress); + jsonWriter.writeArrayField("privateIpAddresses", this.privateIpAddresses, + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeNumberField("secondaryPrivateIpAddressCount", this.secondaryPrivateIpAddressCount); + jsonWriter.writeArrayField("secondaryPrivateIpAddresses", this.secondaryPrivateIpAddresses, + (writer, element) -> writer.writeString(element)); + jsonWriter.writeBooleanField("sourceDestCheck", this.sourceDestCheck); + jsonWriter.writeStringField("subnetId", this.subnetId); + jsonWriter.writeArrayField("tags", this.tags, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("vpcId", this.vpcId); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AwsEc2NetworkInterfaceProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AwsEc2NetworkInterfaceProperties if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the AwsEc2NetworkInterfaceProperties. + */ + public static AwsEc2NetworkInterfaceProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AwsEc2NetworkInterfaceProperties deserializedAwsEc2NetworkInterfaceProperties + = new AwsEc2NetworkInterfaceProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("connectionTrackingSpecification".equals(fieldName)) { + deserializedAwsEc2NetworkInterfaceProperties.connectionTrackingSpecification + = ConnectionTrackingSpecification.fromJson(reader); + } else if ("description".equals(fieldName)) { + deserializedAwsEc2NetworkInterfaceProperties.description = reader.getString(); + } else if ("enablePrimaryIpv6".equals(fieldName)) { + deserializedAwsEc2NetworkInterfaceProperties.enablePrimaryIpv6 + = reader.getNullable(JsonReader::getBoolean); + } else if ("groupSet".equals(fieldName)) { + List groupSet = reader.readArray(reader1 -> reader1.getString()); + deserializedAwsEc2NetworkInterfaceProperties.groupSet = groupSet; + } else if ("id".equals(fieldName)) { + deserializedAwsEc2NetworkInterfaceProperties.id = reader.getString(); + } else if ("interfaceType".equals(fieldName)) { + deserializedAwsEc2NetworkInterfaceProperties.interfaceType = reader.getString(); + } else if ("ipv4PrefixCount".equals(fieldName)) { + deserializedAwsEc2NetworkInterfaceProperties.ipv4PrefixCount + = reader.getNullable(JsonReader::getInt); + } else if ("ipv4Prefixes".equals(fieldName)) { + List ipv4Prefixes + = reader.readArray(reader1 -> Ipv4PrefixSpecification.fromJson(reader1)); + deserializedAwsEc2NetworkInterfaceProperties.ipv4Prefixes = ipv4Prefixes; + } else if ("ipv6AddressCount".equals(fieldName)) { + deserializedAwsEc2NetworkInterfaceProperties.ipv6AddressCount + = reader.getNullable(JsonReader::getInt); + } else if ("ipv6Addresses".equals(fieldName)) { + List ipv6Addresses + = reader.readArray(reader1 -> InstanceIpv6AddressAutoGenerated.fromJson(reader1)); + deserializedAwsEc2NetworkInterfaceProperties.ipv6Addresses = ipv6Addresses; + } else if ("ipv6PrefixCount".equals(fieldName)) { + deserializedAwsEc2NetworkInterfaceProperties.ipv6PrefixCount + = reader.getNullable(JsonReader::getInt); + } else if ("ipv6Prefixes".equals(fieldName)) { + List ipv6Prefixes + = reader.readArray(reader1 -> Ipv6PrefixSpecification.fromJson(reader1)); + deserializedAwsEc2NetworkInterfaceProperties.ipv6Prefixes = ipv6Prefixes; + } else if ("primaryIpv6Address".equals(fieldName)) { + deserializedAwsEc2NetworkInterfaceProperties.primaryIpv6Address = reader.getString(); + } else if ("primaryPrivateIpAddress".equals(fieldName)) { + deserializedAwsEc2NetworkInterfaceProperties.primaryPrivateIpAddress = reader.getString(); + } else if ("privateIpAddress".equals(fieldName)) { + deserializedAwsEc2NetworkInterfaceProperties.privateIpAddress = reader.getString(); + } else if ("privateIpAddresses".equals(fieldName)) { + List privateIpAddresses + = reader.readArray(reader1 -> PrivateIpAddressSpecification.fromJson(reader1)); + deserializedAwsEc2NetworkInterfaceProperties.privateIpAddresses = privateIpAddresses; + } else if ("secondaryPrivateIpAddressCount".equals(fieldName)) { + deserializedAwsEc2NetworkInterfaceProperties.secondaryPrivateIpAddressCount + = reader.getNullable(JsonReader::getInt); + } else if ("secondaryPrivateIpAddresses".equals(fieldName)) { + List secondaryPrivateIpAddresses = reader.readArray(reader1 -> reader1.getString()); + deserializedAwsEc2NetworkInterfaceProperties.secondaryPrivateIpAddresses + = secondaryPrivateIpAddresses; + } else if ("sourceDestCheck".equals(fieldName)) { + deserializedAwsEc2NetworkInterfaceProperties.sourceDestCheck + = reader.getNullable(JsonReader::getBoolean); + } else if ("subnetId".equals(fieldName)) { + deserializedAwsEc2NetworkInterfaceProperties.subnetId = reader.getString(); + } else if ("tags".equals(fieldName)) { + List tags = reader.readArray(reader1 -> TagAutoGenerated16.fromJson(reader1)); + deserializedAwsEc2NetworkInterfaceProperties.tags = tags; + } else if ("vpcId".equals(fieldName)) { + deserializedAwsEc2NetworkInterfaceProperties.vpcId = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedAwsEc2NetworkInterfaceProperties; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/AwsEc2RouteTableProperties.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/AwsEc2RouteTableProperties.java new file mode 100644 index 000000000000..a74f646e51d9 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/AwsEc2RouteTableProperties.java @@ -0,0 +1,154 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Definition of awsEc2RouteTable. + */ +@Fluent +public final class AwsEc2RouteTableProperties implements JsonSerializable { + /* + * Property routeTableId + */ + private String routeTableId; + + /* + * Any tags assigned to the route table. + */ + private List tags; + + /* + * The ID of the VPC. + */ + private String vpcId; + + /** + * Creates an instance of AwsEc2RouteTableProperties class. + */ + public AwsEc2RouteTableProperties() { + } + + /** + * Get the routeTableId property: Property routeTableId. + * + * @return the routeTableId value. + */ + public String routeTableId() { + return this.routeTableId; + } + + /** + * Set the routeTableId property: Property routeTableId. + * + * @param routeTableId the routeTableId value to set. + * @return the AwsEc2RouteTableProperties object itself. + */ + public AwsEc2RouteTableProperties withRouteTableId(String routeTableId) { + this.routeTableId = routeTableId; + return this; + } + + /** + * Get the tags property: Any tags assigned to the route table. + * + * @return the tags value. + */ + public List tags() { + return this.tags; + } + + /** + * Set the tags property: Any tags assigned to the route table. + * + * @param tags the tags value to set. + * @return the AwsEc2RouteTableProperties object itself. + */ + public AwsEc2RouteTableProperties withTags(List tags) { + this.tags = tags; + return this; + } + + /** + * Get the vpcId property: The ID of the VPC. + * + * @return the vpcId value. + */ + public String vpcId() { + return this.vpcId; + } + + /** + * Set the vpcId property: The ID of the VPC. + * + * @param vpcId the vpcId value to set. + * @return the AwsEc2RouteTableProperties object itself. + */ + public AwsEc2RouteTableProperties withVpcId(String vpcId) { + this.vpcId = vpcId; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (tags() != null) { + tags().forEach(e -> e.validate()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("routeTableId", this.routeTableId); + jsonWriter.writeArrayField("tags", this.tags, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("vpcId", this.vpcId); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AwsEc2RouteTableProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AwsEc2RouteTableProperties if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IOException If an error occurs while reading the AwsEc2RouteTableProperties. + */ + public static AwsEc2RouteTableProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AwsEc2RouteTableProperties deserializedAwsEc2RouteTableProperties = new AwsEc2RouteTableProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("routeTableId".equals(fieldName)) { + deserializedAwsEc2RouteTableProperties.routeTableId = reader.getString(); + } else if ("tags".equals(fieldName)) { + List tags = reader.readArray(reader1 -> TagAutoGenerated17.fromJson(reader1)); + deserializedAwsEc2RouteTableProperties.tags = tags; + } else if ("vpcId".equals(fieldName)) { + deserializedAwsEc2RouteTableProperties.vpcId = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedAwsEc2RouteTableProperties; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/AwsEc2SecurityGroupProperties.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/AwsEc2SecurityGroupProperties.java new file mode 100644 index 000000000000..c16c44b77205 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/AwsEc2SecurityGroupProperties.java @@ -0,0 +1,307 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Definition of awsEc2SecurityGroup. + */ +@Fluent +public final class AwsEc2SecurityGroupProperties implements JsonSerializable { + /* + *

A description of the security group.

+ */ + private String description; + + /* + *

The ID of the security group.

+ */ + private String groupId; + + /* + *

The name of the security group.

+ */ + private String groupName; + + /* + *

The inbound rules associated with the security group.

+ */ + private List ipPermissions; + + /* + *

The outbound rules associated with the security group.

+ */ + private List ipPermissionsEgress; + + /* + *

The Amazon Web Services account ID of the owner of the security group.

+ */ + private String ownerId; + + /* + *

Any tags assigned to the security group.

+ */ + private List tags; + + /* + *

The ID of the VPC for the security group.

+ */ + private String vpcId; + + /** + * Creates an instance of AwsEc2SecurityGroupProperties class. + */ + public AwsEc2SecurityGroupProperties() { + } + + /** + * Get the description property: <p>A description of the security group.</p>. + * + * @return the description value. + */ + public String description() { + return this.description; + } + + /** + * Set the description property: <p>A description of the security group.</p>. + * + * @param description the description value to set. + * @return the AwsEc2SecurityGroupProperties object itself. + */ + public AwsEc2SecurityGroupProperties withDescription(String description) { + this.description = description; + return this; + } + + /** + * Get the groupId property: <p>The ID of the security group.</p>. + * + * @return the groupId value. + */ + public String groupId() { + return this.groupId; + } + + /** + * Set the groupId property: <p>The ID of the security group.</p>. + * + * @param groupId the groupId value to set. + * @return the AwsEc2SecurityGroupProperties object itself. + */ + public AwsEc2SecurityGroupProperties withGroupId(String groupId) { + this.groupId = groupId; + return this; + } + + /** + * Get the groupName property: <p>The name of the security group.</p>. + * + * @return the groupName value. + */ + public String groupName() { + return this.groupName; + } + + /** + * Set the groupName property: <p>The name of the security group.</p>. + * + * @param groupName the groupName value to set. + * @return the AwsEc2SecurityGroupProperties object itself. + */ + public AwsEc2SecurityGroupProperties withGroupName(String groupName) { + this.groupName = groupName; + return this; + } + + /** + * Get the ipPermissions property: <p>The inbound rules associated with the security group.</p>. + * + * @return the ipPermissions value. + */ + public List ipPermissions() { + return this.ipPermissions; + } + + /** + * Set the ipPermissions property: <p>The inbound rules associated with the security group.</p>. + * + * @param ipPermissions the ipPermissions value to set. + * @return the AwsEc2SecurityGroupProperties object itself. + */ + public AwsEc2SecurityGroupProperties withIpPermissions(List ipPermissions) { + this.ipPermissions = ipPermissions; + return this; + } + + /** + * Get the ipPermissionsEgress property: <p>The outbound rules associated with the security group.</p>. + * + * @return the ipPermissionsEgress value. + */ + public List ipPermissionsEgress() { + return this.ipPermissionsEgress; + } + + /** + * Set the ipPermissionsEgress property: <p>The outbound rules associated with the security group.</p>. + * + * @param ipPermissionsEgress the ipPermissionsEgress value to set. + * @return the AwsEc2SecurityGroupProperties object itself. + */ + public AwsEc2SecurityGroupProperties withIpPermissionsEgress(List ipPermissionsEgress) { + this.ipPermissionsEgress = ipPermissionsEgress; + return this; + } + + /** + * Get the ownerId property: <p>The Amazon Web Services account ID of the owner of the security + * group.</p>. + * + * @return the ownerId value. + */ + public String ownerId() { + return this.ownerId; + } + + /** + * Set the ownerId property: <p>The Amazon Web Services account ID of the owner of the security + * group.</p>. + * + * @param ownerId the ownerId value to set. + * @return the AwsEc2SecurityGroupProperties object itself. + */ + public AwsEc2SecurityGroupProperties withOwnerId(String ownerId) { + this.ownerId = ownerId; + return this; + } + + /** + * Get the tags property: <p>Any tags assigned to the security group.</p>. + * + * @return the tags value. + */ + public List tags() { + return this.tags; + } + + /** + * Set the tags property: <p>Any tags assigned to the security group.</p>. + * + * @param tags the tags value to set. + * @return the AwsEc2SecurityGroupProperties object itself. + */ + public AwsEc2SecurityGroupProperties withTags(List tags) { + this.tags = tags; + return this; + } + + /** + * Get the vpcId property: <p>The ID of the VPC for the security group.</p>. + * + * @return the vpcId value. + */ + public String vpcId() { + return this.vpcId; + } + + /** + * Set the vpcId property: <p>The ID of the VPC for the security group.</p>. + * + * @param vpcId the vpcId value to set. + * @return the AwsEc2SecurityGroupProperties object itself. + */ + public AwsEc2SecurityGroupProperties withVpcId(String vpcId) { + this.vpcId = vpcId; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (ipPermissions() != null) { + ipPermissions().forEach(e -> e.validate()); + } + if (ipPermissionsEgress() != null) { + ipPermissionsEgress().forEach(e -> e.validate()); + } + if (tags() != null) { + tags().forEach(e -> e.validate()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("description", this.description); + jsonWriter.writeStringField("groupId", this.groupId); + jsonWriter.writeStringField("groupName", this.groupName); + jsonWriter.writeArrayField("ipPermissions", this.ipPermissions, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("ipPermissionsEgress", this.ipPermissionsEgress, + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("ownerId", this.ownerId); + jsonWriter.writeArrayField("tags", this.tags, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("vpcId", this.vpcId); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AwsEc2SecurityGroupProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AwsEc2SecurityGroupProperties if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the AwsEc2SecurityGroupProperties. + */ + public static AwsEc2SecurityGroupProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AwsEc2SecurityGroupProperties deserializedAwsEc2SecurityGroupProperties + = new AwsEc2SecurityGroupProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("description".equals(fieldName)) { + deserializedAwsEc2SecurityGroupProperties.description = reader.getString(); + } else if ("groupId".equals(fieldName)) { + deserializedAwsEc2SecurityGroupProperties.groupId = reader.getString(); + } else if ("groupName".equals(fieldName)) { + deserializedAwsEc2SecurityGroupProperties.groupName = reader.getString(); + } else if ("ipPermissions".equals(fieldName)) { + List ipPermissions = reader.readArray(reader1 -> IpPermission.fromJson(reader1)); + deserializedAwsEc2SecurityGroupProperties.ipPermissions = ipPermissions; + } else if ("ipPermissionsEgress".equals(fieldName)) { + List ipPermissionsEgress + = reader.readArray(reader1 -> IpPermission.fromJson(reader1)); + deserializedAwsEc2SecurityGroupProperties.ipPermissionsEgress = ipPermissionsEgress; + } else if ("ownerId".equals(fieldName)) { + deserializedAwsEc2SecurityGroupProperties.ownerId = reader.getString(); + } else if ("tags".equals(fieldName)) { + List tags = reader.readArray(reader1 -> TagAutoGenerated18.fromJson(reader1)); + deserializedAwsEc2SecurityGroupProperties.tags = tags; + } else if ("vpcId".equals(fieldName)) { + deserializedAwsEc2SecurityGroupProperties.vpcId = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedAwsEc2SecurityGroupProperties; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/AwsEc2SnapshotProperties.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/AwsEc2SnapshotProperties.java new file mode 100644 index 000000000000..5e43981a700c --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/AwsEc2SnapshotProperties.java @@ -0,0 +1,646 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.time.OffsetDateTime; +import java.time.format.DateTimeFormatter; +import java.util.List; + +/** + * Definition of awsEc2Snapshot. + */ +@Fluent +public final class AwsEc2SnapshotProperties implements JsonSerializable { + /* + *

The data encryption key identifier for the snapshot. This value is a unique identifier that corresponds to the + * data encryption key that was used to encrypt the original volume or snapshot copy. Because data encryption keys + * are inherited by volumes created from snapshots, and vice versa, if snapshots share the same data encryption key + * identifier, then they belong to the same volume/snapshot lineage. This parameter is only returned by + * DescribeSnapshots.

+ */ + private String dataEncryptionKeyId; + + /* + *

The description for the snapshot.

+ */ + private String description; + + /* + *

Indicates whether the snapshot is encrypted.

+ */ + private Boolean encrypted; + + /* + *

The Amazon Resource Name (ARN) of the Key Management Service (KMS) KMS key that was used to protect the volume + * encryption key for the parent volume.

+ */ + private String kmsKeyId; + + /* + *

The ARN of the Outpost on which the snapshot is stored. For more information, see Amazon EBS local snapshots on + * Outposts in the Amazon EBS User Guide.

+ */ + private String outpostArn; + + /* + *

The Amazon Web Services owner alias, from an Amazon-maintained list (amazon). This is not the + * user-configured Amazon Web Services account alias set using the IAM console.

+ */ + private String ownerAlias; + + /* + *

The ID of the Amazon Web Services account that owns the EBS snapshot.

+ */ + private String ownerId; + + /* + *

The progress of the snapshot, as a percentage.

+ */ + private String progress; + + /* + *

Only for archived snapshots that are temporarily restored. Indicates the date and time when a temporarily + * restored snapshot will be automatically re-archived.

+ */ + private OffsetDateTime restoreExpiryTime; + + /* + *

The ID of the snapshot. Each snapshot receives a unique identifier when it is created.

+ */ + private String snapshotId; + + /* + *

Reserved for future use.

+ */ + private SseTypeEnumValue sseType; + + /* + *

The time stamp when the snapshot was initiated.

+ */ + private OffsetDateTime startTime; + + /* + *

The snapshot state.

+ */ + private SnapshotStateEnumValue state; + + /* + *

Encrypted Amazon EBS snapshots are copied asynchronously. If a snapshot copy operation fails (for example, if + * the proper Key Management Service (KMS) permissions are not obtained) this field displays error state details to + * help you diagnose why the error occurred. This parameter is only returned by DescribeSnapshots.

+ */ + private String stateMessage; + + /* + *

The storage tier in which the snapshot is stored. standard indicates that the snapshot is stored + * in the standard snapshot storage tier and that it is ready for use. archive indicates that the + * snapshot is currently archived and that it must be restored before it can be used.

+ */ + private StorageTierEnumValue storageTier; + + /* + *

Any tags assigned to the snapshot.

+ */ + private List tags; + + /* + *

The ID of the volume that was used to create the snapshot. Snapshots created by the CopySnapshot action + * have an arbitrary volume ID that should not be used for any purpose.

+ */ + private String volumeId; + + /* + *

The size of the volume, in GiB.

+ */ + private Integer volumeSize; + + /** + * Creates an instance of AwsEc2SnapshotProperties class. + */ + public AwsEc2SnapshotProperties() { + } + + /** + * Get the dataEncryptionKeyId property: <p>The data encryption key identifier for the snapshot. This value is + * a unique identifier that corresponds to the data encryption key that was used to encrypt the original volume or + * snapshot copy. Because data encryption keys are inherited by volumes created from snapshots, and vice versa, if + * snapshots share the same data encryption key identifier, then they belong to the same volume/snapshot lineage. + * This parameter is only returned by <a>DescribeSnapshots</a>.</p>. + * + * @return the dataEncryptionKeyId value. + */ + public String dataEncryptionKeyId() { + return this.dataEncryptionKeyId; + } + + /** + * Set the dataEncryptionKeyId property: <p>The data encryption key identifier for the snapshot. This value is + * a unique identifier that corresponds to the data encryption key that was used to encrypt the original volume or + * snapshot copy. Because data encryption keys are inherited by volumes created from snapshots, and vice versa, if + * snapshots share the same data encryption key identifier, then they belong to the same volume/snapshot lineage. + * This parameter is only returned by <a>DescribeSnapshots</a>.</p>. + * + * @param dataEncryptionKeyId the dataEncryptionKeyId value to set. + * @return the AwsEc2SnapshotProperties object itself. + */ + public AwsEc2SnapshotProperties withDataEncryptionKeyId(String dataEncryptionKeyId) { + this.dataEncryptionKeyId = dataEncryptionKeyId; + return this; + } + + /** + * Get the description property: <p>The description for the snapshot.</p>. + * + * @return the description value. + */ + public String description() { + return this.description; + } + + /** + * Set the description property: <p>The description for the snapshot.</p>. + * + * @param description the description value to set. + * @return the AwsEc2SnapshotProperties object itself. + */ + public AwsEc2SnapshotProperties withDescription(String description) { + this.description = description; + return this; + } + + /** + * Get the encrypted property: <p>Indicates whether the snapshot is encrypted.</p>. + * + * @return the encrypted value. + */ + public Boolean encrypted() { + return this.encrypted; + } + + /** + * Set the encrypted property: <p>Indicates whether the snapshot is encrypted.</p>. + * + * @param encrypted the encrypted value to set. + * @return the AwsEc2SnapshotProperties object itself. + */ + public AwsEc2SnapshotProperties withEncrypted(Boolean encrypted) { + this.encrypted = encrypted; + return this; + } + + /** + * Get the kmsKeyId property: <p>The Amazon Resource Name (ARN) of the Key Management Service (KMS) KMS key + * that was used to protect the volume encryption key for the parent volume.</p>. + * + * @return the kmsKeyId value. + */ + public String kmsKeyId() { + return this.kmsKeyId; + } + + /** + * Set the kmsKeyId property: <p>The Amazon Resource Name (ARN) of the Key Management Service (KMS) KMS key + * that was used to protect the volume encryption key for the parent volume.</p>. + * + * @param kmsKeyId the kmsKeyId value to set. + * @return the AwsEc2SnapshotProperties object itself. + */ + public AwsEc2SnapshotProperties withKmsKeyId(String kmsKeyId) { + this.kmsKeyId = kmsKeyId; + return this; + } + + /** + * Get the outpostArn property: <p>The ARN of the Outpost on which the snapshot is stored. For more + * information, see <a href='https://docs.aws.amazon.com/ebs/latest/userguide/snapshots-outposts.html'>Amazon + * EBS local snapshots on Outposts</a> in the <i>Amazon EBS User Guide</i>.</p>. + * + * @return the outpostArn value. + */ + public String outpostArn() { + return this.outpostArn; + } + + /** + * Set the outpostArn property: <p>The ARN of the Outpost on which the snapshot is stored. For more + * information, see <a href='https://docs.aws.amazon.com/ebs/latest/userguide/snapshots-outposts.html'>Amazon + * EBS local snapshots on Outposts</a> in the <i>Amazon EBS User Guide</i>.</p>. + * + * @param outpostArn the outpostArn value to set. + * @return the AwsEc2SnapshotProperties object itself. + */ + public AwsEc2SnapshotProperties withOutpostArn(String outpostArn) { + this.outpostArn = outpostArn; + return this; + } + + /** + * Get the ownerAlias property: <p>The Amazon Web Services owner alias, from an Amazon-maintained list + * (<code>amazon</code>). This is not the user-configured Amazon Web Services account alias set using + * the IAM console.</p>. + * + * @return the ownerAlias value. + */ + public String ownerAlias() { + return this.ownerAlias; + } + + /** + * Set the ownerAlias property: <p>The Amazon Web Services owner alias, from an Amazon-maintained list + * (<code>amazon</code>). This is not the user-configured Amazon Web Services account alias set using + * the IAM console.</p>. + * + * @param ownerAlias the ownerAlias value to set. + * @return the AwsEc2SnapshotProperties object itself. + */ + public AwsEc2SnapshotProperties withOwnerAlias(String ownerAlias) { + this.ownerAlias = ownerAlias; + return this; + } + + /** + * Get the ownerId property: <p>The ID of the Amazon Web Services account that owns the EBS + * snapshot.</p>. + * + * @return the ownerId value. + */ + public String ownerId() { + return this.ownerId; + } + + /** + * Set the ownerId property: <p>The ID of the Amazon Web Services account that owns the EBS + * snapshot.</p>. + * + * @param ownerId the ownerId value to set. + * @return the AwsEc2SnapshotProperties object itself. + */ + public AwsEc2SnapshotProperties withOwnerId(String ownerId) { + this.ownerId = ownerId; + return this; + } + + /** + * Get the progress property: <p>The progress of the snapshot, as a percentage.</p>. + * + * @return the progress value. + */ + public String progress() { + return this.progress; + } + + /** + * Set the progress property: <p>The progress of the snapshot, as a percentage.</p>. + * + * @param progress the progress value to set. + * @return the AwsEc2SnapshotProperties object itself. + */ + public AwsEc2SnapshotProperties withProgress(String progress) { + this.progress = progress; + return this; + } + + /** + * Get the restoreExpiryTime property: <p>Only for archived snapshots that are temporarily restored. Indicates + * the date and time when a temporarily restored snapshot will be automatically re-archived.</p>. + * + * @return the restoreExpiryTime value. + */ + public OffsetDateTime restoreExpiryTime() { + return this.restoreExpiryTime; + } + + /** + * Set the restoreExpiryTime property: <p>Only for archived snapshots that are temporarily restored. Indicates + * the date and time when a temporarily restored snapshot will be automatically re-archived.</p>. + * + * @param restoreExpiryTime the restoreExpiryTime value to set. + * @return the AwsEc2SnapshotProperties object itself. + */ + public AwsEc2SnapshotProperties withRestoreExpiryTime(OffsetDateTime restoreExpiryTime) { + this.restoreExpiryTime = restoreExpiryTime; + return this; + } + + /** + * Get the snapshotId property: <p>The ID of the snapshot. Each snapshot receives a unique identifier when it + * is created.</p>. + * + * @return the snapshotId value. + */ + public String snapshotId() { + return this.snapshotId; + } + + /** + * Set the snapshotId property: <p>The ID of the snapshot. Each snapshot receives a unique identifier when it + * is created.</p>. + * + * @param snapshotId the snapshotId value to set. + * @return the AwsEc2SnapshotProperties object itself. + */ + public AwsEc2SnapshotProperties withSnapshotId(String snapshotId) { + this.snapshotId = snapshotId; + return this; + } + + /** + * Get the sseType property: <p>Reserved for future use.</p>. + * + * @return the sseType value. + */ + public SseTypeEnumValue sseType() { + return this.sseType; + } + + /** + * Set the sseType property: <p>Reserved for future use.</p>. + * + * @param sseType the sseType value to set. + * @return the AwsEc2SnapshotProperties object itself. + */ + public AwsEc2SnapshotProperties withSseType(SseTypeEnumValue sseType) { + this.sseType = sseType; + return this; + } + + /** + * Get the startTime property: <p>The time stamp when the snapshot was initiated.</p>. + * + * @return the startTime value. + */ + public OffsetDateTime startTime() { + return this.startTime; + } + + /** + * Set the startTime property: <p>The time stamp when the snapshot was initiated.</p>. + * + * @param startTime the startTime value to set. + * @return the AwsEc2SnapshotProperties object itself. + */ + public AwsEc2SnapshotProperties withStartTime(OffsetDateTime startTime) { + this.startTime = startTime; + return this; + } + + /** + * Get the state property: <p>The snapshot state.</p>. + * + * @return the state value. + */ + public SnapshotStateEnumValue state() { + return this.state; + } + + /** + * Set the state property: <p>The snapshot state.</p>. + * + * @param state the state value to set. + * @return the AwsEc2SnapshotProperties object itself. + */ + public AwsEc2SnapshotProperties withState(SnapshotStateEnumValue state) { + this.state = state; + return this; + } + + /** + * Get the stateMessage property: <p>Encrypted Amazon EBS snapshots are copied asynchronously. If a snapshot + * copy operation fails (for example, if the proper Key Management Service (KMS) permissions are not obtained) this + * field displays error state details to help you diagnose why the error occurred. This parameter is only returned + * by <a>DescribeSnapshots</a>.</p>. + * + * @return the stateMessage value. + */ + public String stateMessage() { + return this.stateMessage; + } + + /** + * Set the stateMessage property: <p>Encrypted Amazon EBS snapshots are copied asynchronously. If a snapshot + * copy operation fails (for example, if the proper Key Management Service (KMS) permissions are not obtained) this + * field displays error state details to help you diagnose why the error occurred. This parameter is only returned + * by <a>DescribeSnapshots</a>.</p>. + * + * @param stateMessage the stateMessage value to set. + * @return the AwsEc2SnapshotProperties object itself. + */ + public AwsEc2SnapshotProperties withStateMessage(String stateMessage) { + this.stateMessage = stateMessage; + return this; + } + + /** + * Get the storageTier property: <p>The storage tier in which the snapshot is stored. + * <code>standard</code> indicates that the snapshot is stored in the standard snapshot storage tier and + * that it is ready for use. <code>archive</code> indicates that the snapshot is currently archived and + * that it must be restored before it can be used.</p>. + * + * @return the storageTier value. + */ + public StorageTierEnumValue storageTier() { + return this.storageTier; + } + + /** + * Set the storageTier property: <p>The storage tier in which the snapshot is stored. + * <code>standard</code> indicates that the snapshot is stored in the standard snapshot storage tier and + * that it is ready for use. <code>archive</code> indicates that the snapshot is currently archived and + * that it must be restored before it can be used.</p>. + * + * @param storageTier the storageTier value to set. + * @return the AwsEc2SnapshotProperties object itself. + */ + public AwsEc2SnapshotProperties withStorageTier(StorageTierEnumValue storageTier) { + this.storageTier = storageTier; + return this; + } + + /** + * Get the tags property: <p>Any tags assigned to the snapshot.</p>. + * + * @return the tags value. + */ + public List tags() { + return this.tags; + } + + /** + * Set the tags property: <p>Any tags assigned to the snapshot.</p>. + * + * @param tags the tags value to set. + * @return the AwsEc2SnapshotProperties object itself. + */ + public AwsEc2SnapshotProperties withTags(List tags) { + this.tags = tags; + return this; + } + + /** + * Get the volumeId property: <p>The ID of the volume that was used to create the snapshot. Snapshots created + * by the <a>CopySnapshot</a> action have an arbitrary volume ID that should not be used for any + * purpose.</p>. + * + * @return the volumeId value. + */ + public String volumeId() { + return this.volumeId; + } + + /** + * Set the volumeId property: <p>The ID of the volume that was used to create the snapshot. Snapshots created + * by the <a>CopySnapshot</a> action have an arbitrary volume ID that should not be used for any + * purpose.</p>. + * + * @param volumeId the volumeId value to set. + * @return the AwsEc2SnapshotProperties object itself. + */ + public AwsEc2SnapshotProperties withVolumeId(String volumeId) { + this.volumeId = volumeId; + return this; + } + + /** + * Get the volumeSize property: <p>The size of the volume, in GiB.</p>. + * + * @return the volumeSize value. + */ + public Integer volumeSize() { + return this.volumeSize; + } + + /** + * Set the volumeSize property: <p>The size of the volume, in GiB.</p>. + * + * @param volumeSize the volumeSize value to set. + * @return the AwsEc2SnapshotProperties object itself. + */ + public AwsEc2SnapshotProperties withVolumeSize(Integer volumeSize) { + this.volumeSize = volumeSize; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (sseType() != null) { + sseType().validate(); + } + if (state() != null) { + state().validate(); + } + if (storageTier() != null) { + storageTier().validate(); + } + if (tags() != null) { + tags().forEach(e -> e.validate()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("dataEncryptionKeyId", this.dataEncryptionKeyId); + jsonWriter.writeStringField("description", this.description); + jsonWriter.writeBooleanField("encrypted", this.encrypted); + jsonWriter.writeStringField("kmsKeyId", this.kmsKeyId); + jsonWriter.writeStringField("outpostArn", this.outpostArn); + jsonWriter.writeStringField("ownerAlias", this.ownerAlias); + jsonWriter.writeStringField("ownerId", this.ownerId); + jsonWriter.writeStringField("progress", this.progress); + jsonWriter.writeStringField("restoreExpiryTime", + this.restoreExpiryTime == null + ? null + : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.restoreExpiryTime)); + jsonWriter.writeStringField("snapshotId", this.snapshotId); + jsonWriter.writeJsonField("sseType", this.sseType); + jsonWriter.writeStringField("startTime", + this.startTime == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.startTime)); + jsonWriter.writeJsonField("state", this.state); + jsonWriter.writeStringField("stateMessage", this.stateMessage); + jsonWriter.writeJsonField("storageTier", this.storageTier); + jsonWriter.writeArrayField("tags", this.tags, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("volumeId", this.volumeId); + jsonWriter.writeNumberField("volumeSize", this.volumeSize); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AwsEc2SnapshotProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AwsEc2SnapshotProperties if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IOException If an error occurs while reading the AwsEc2SnapshotProperties. + */ + public static AwsEc2SnapshotProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AwsEc2SnapshotProperties deserializedAwsEc2SnapshotProperties = new AwsEc2SnapshotProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("dataEncryptionKeyId".equals(fieldName)) { + deserializedAwsEc2SnapshotProperties.dataEncryptionKeyId = reader.getString(); + } else if ("description".equals(fieldName)) { + deserializedAwsEc2SnapshotProperties.description = reader.getString(); + } else if ("encrypted".equals(fieldName)) { + deserializedAwsEc2SnapshotProperties.encrypted = reader.getNullable(JsonReader::getBoolean); + } else if ("kmsKeyId".equals(fieldName)) { + deserializedAwsEc2SnapshotProperties.kmsKeyId = reader.getString(); + } else if ("outpostArn".equals(fieldName)) { + deserializedAwsEc2SnapshotProperties.outpostArn = reader.getString(); + } else if ("ownerAlias".equals(fieldName)) { + deserializedAwsEc2SnapshotProperties.ownerAlias = reader.getString(); + } else if ("ownerId".equals(fieldName)) { + deserializedAwsEc2SnapshotProperties.ownerId = reader.getString(); + } else if ("progress".equals(fieldName)) { + deserializedAwsEc2SnapshotProperties.progress = reader.getString(); + } else if ("restoreExpiryTime".equals(fieldName)) { + deserializedAwsEc2SnapshotProperties.restoreExpiryTime = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("snapshotId".equals(fieldName)) { + deserializedAwsEc2SnapshotProperties.snapshotId = reader.getString(); + } else if ("sseType".equals(fieldName)) { + deserializedAwsEc2SnapshotProperties.sseType = SseTypeEnumValue.fromJson(reader); + } else if ("startTime".equals(fieldName)) { + deserializedAwsEc2SnapshotProperties.startTime = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("state".equals(fieldName)) { + deserializedAwsEc2SnapshotProperties.state = SnapshotStateEnumValue.fromJson(reader); + } else if ("stateMessage".equals(fieldName)) { + deserializedAwsEc2SnapshotProperties.stateMessage = reader.getString(); + } else if ("storageTier".equals(fieldName)) { + deserializedAwsEc2SnapshotProperties.storageTier = StorageTierEnumValue.fromJson(reader); + } else if ("tags".equals(fieldName)) { + List tags = reader.readArray(reader1 -> TagAutoGenerated19.fromJson(reader1)); + deserializedAwsEc2SnapshotProperties.tags = tags; + } else if ("volumeId".equals(fieldName)) { + deserializedAwsEc2SnapshotProperties.volumeId = reader.getString(); + } else if ("volumeSize".equals(fieldName)) { + deserializedAwsEc2SnapshotProperties.volumeSize = reader.getNullable(JsonReader::getInt); + } else { + reader.skipChildren(); + } + } + + return deserializedAwsEc2SnapshotProperties; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/AwsEc2SubnetProperties.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/AwsEc2SubnetProperties.java new file mode 100644 index 000000000000..4facafac642c --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/AwsEc2SubnetProperties.java @@ -0,0 +1,691 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Definition of awsEc2Subnet. + */ +@Fluent +public final class AwsEc2SubnetProperties implements JsonSerializable { + /* + * Indicates whether a network interface created in this subnet receives an IPv6 address. The default value is + * ``false``. If you specify ``AssignIpv6AddressOnCreation``, you must also specify an IPv6 CIDR block. + */ + private Boolean assignIpv6AddressOnCreation; + + /* + * The Availability Zone of the subnet. If you update this property, you must also update the ``CidrBlock`` + * property. + */ + private String availabilityZone; + + /* + * The AZ ID of the subnet. + */ + private String availabilityZoneId; + + /* + * The IPv4 CIDR block assigned to the subnet. If you update this property, we create a new subnet, and then delete + * the existing one. + */ + private String cidrBlock; + + /* + * Indicates whether DNS queries made to the Amazon-provided DNS Resolver in this subnet should return synthetic + * IPv6 addresses for IPv4-only destinations. For more information, see [DNS64 and + * NAT64](https://docs.aws.amazon.com/vpc/latest/userguide/vpc-nat-gateway.html#nat-gateway-nat64-dns64) in the + * *User Guide*. + */ + private Boolean enableDns64; + + /* + * Indicates the device position for local network interfaces in this subnet. For example, ``1`` indicates local + * network interfaces in this subnet are the secondary network interface (eth1). + */ + private Integer enableLniAtDeviceIndex; + + /* + * An IPv4 IPAM pool ID for the subnet. + */ + private String ipv4IpamPoolId; + + /* + * An IPv4 netmask length for the subnet. + */ + private Integer ipv4NetmaskLength; + + /* + * The IPv6 CIDR block. If you specify ``AssignIpv6AddressOnCreation``, you must also specify an IPv6 CIDR block. + */ + private String ipv6CidrBlock; + + /* + * The IPv6 network ranges for the subnet, in CIDR notation. + */ + private List ipv6CidrBlocks; + + /* + * An IPv6 IPAM pool ID for the subnet. + */ + private String ipv6IpamPoolId; + + /* + * Indicates whether this is an IPv6 only subnet. For more information, see [Subnet + * basics](https://docs.aws.amazon.com/vpc/latest/userguide/VPC_Subnets.html#subnet-basics) in the *User Guide*. + */ + private Boolean ipv6Native; + + /* + * An IPv6 netmask length for the subnet. + */ + private Integer ipv6NetmaskLength; + + /* + * Indicates whether instances launched in this subnet receive a public IPv4 address. The default value is + * ``false``. AWS charges for all public IPv4 addresses, including public IPv4 addresses associated with running + * instances and Elastic IP addresses. For more information, see the *Public IPv4 Address* tab on the [VPC pricing + * page](https://docs.aws.amazon.com/vpc/pricing/). + */ + private Boolean mapPublicIpOnLaunch; + + /* + * Property networkAclAssociationId + */ + private String networkAclAssociationId; + + /* + * The Amazon Resource Name (ARN) of the Outpost. + */ + private String outpostArn; + + /* + * The hostname type for EC2 instances launched into this subnet and how DNS A and AAAA record queries to the + * instances should be handled. For more information, see [Amazon EC2 instance hostname + * types](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-instance-naming.html) in the *User Guide*. + * Available options: + EnableResourceNameDnsAAAARecord (true | false) + EnableResourceNameDnsARecord (true | false) + * + HostnameType (ip-name | resource-name) + */ + private PrivateDnsNameOptionsOnLaunchModelProperties privateDnsNameOptionsOnLaunch; + + /* + * Property subnetId + */ + private String subnetId; + + /* + * Any tags assigned to the subnet. + */ + private List tags; + + /* + * The ID of the VPC the subnet is in. If you update this property, you must also update the ``CidrBlock`` property. + */ + private String vpcId; + + /** + * Creates an instance of AwsEc2SubnetProperties class. + */ + public AwsEc2SubnetProperties() { + } + + /** + * Get the assignIpv6AddressOnCreation property: Indicates whether a network interface created in this subnet + * receives an IPv6 address. The default value is ``false``. If you specify ``AssignIpv6AddressOnCreation``, you + * must also specify an IPv6 CIDR block. + * + * @return the assignIpv6AddressOnCreation value. + */ + public Boolean assignIpv6AddressOnCreation() { + return this.assignIpv6AddressOnCreation; + } + + /** + * Set the assignIpv6AddressOnCreation property: Indicates whether a network interface created in this subnet + * receives an IPv6 address. The default value is ``false``. If you specify ``AssignIpv6AddressOnCreation``, you + * must also specify an IPv6 CIDR block. + * + * @param assignIpv6AddressOnCreation the assignIpv6AddressOnCreation value to set. + * @return the AwsEc2SubnetProperties object itself. + */ + public AwsEc2SubnetProperties withAssignIpv6AddressOnCreation(Boolean assignIpv6AddressOnCreation) { + this.assignIpv6AddressOnCreation = assignIpv6AddressOnCreation; + return this; + } + + /** + * Get the availabilityZone property: The Availability Zone of the subnet. If you update this property, you must + * also update the ``CidrBlock`` property. + * + * @return the availabilityZone value. + */ + public String availabilityZone() { + return this.availabilityZone; + } + + /** + * Set the availabilityZone property: The Availability Zone of the subnet. If you update this property, you must + * also update the ``CidrBlock`` property. + * + * @param availabilityZone the availabilityZone value to set. + * @return the AwsEc2SubnetProperties object itself. + */ + public AwsEc2SubnetProperties withAvailabilityZone(String availabilityZone) { + this.availabilityZone = availabilityZone; + return this; + } + + /** + * Get the availabilityZoneId property: The AZ ID of the subnet. + * + * @return the availabilityZoneId value. + */ + public String availabilityZoneId() { + return this.availabilityZoneId; + } + + /** + * Set the availabilityZoneId property: The AZ ID of the subnet. + * + * @param availabilityZoneId the availabilityZoneId value to set. + * @return the AwsEc2SubnetProperties object itself. + */ + public AwsEc2SubnetProperties withAvailabilityZoneId(String availabilityZoneId) { + this.availabilityZoneId = availabilityZoneId; + return this; + } + + /** + * Get the cidrBlock property: The IPv4 CIDR block assigned to the subnet. If you update this property, we create a + * new subnet, and then delete the existing one. + * + * @return the cidrBlock value. + */ + public String cidrBlock() { + return this.cidrBlock; + } + + /** + * Set the cidrBlock property: The IPv4 CIDR block assigned to the subnet. If you update this property, we create a + * new subnet, and then delete the existing one. + * + * @param cidrBlock the cidrBlock value to set. + * @return the AwsEc2SubnetProperties object itself. + */ + public AwsEc2SubnetProperties withCidrBlock(String cidrBlock) { + this.cidrBlock = cidrBlock; + return this; + } + + /** + * Get the enableDns64 property: Indicates whether DNS queries made to the Amazon-provided DNS Resolver in this + * subnet should return synthetic IPv6 addresses for IPv4-only destinations. For more information, see [DNS64 and + * NAT64](https://docs.aws.amazon.com/vpc/latest/userguide/vpc-nat-gateway.html#nat-gateway-nat64-dns64) in the + * *User Guide*. + * + * @return the enableDns64 value. + */ + public Boolean enableDns64() { + return this.enableDns64; + } + + /** + * Set the enableDns64 property: Indicates whether DNS queries made to the Amazon-provided DNS Resolver in this + * subnet should return synthetic IPv6 addresses for IPv4-only destinations. For more information, see [DNS64 and + * NAT64](https://docs.aws.amazon.com/vpc/latest/userguide/vpc-nat-gateway.html#nat-gateway-nat64-dns64) in the + * *User Guide*. + * + * @param enableDns64 the enableDns64 value to set. + * @return the AwsEc2SubnetProperties object itself. + */ + public AwsEc2SubnetProperties withEnableDns64(Boolean enableDns64) { + this.enableDns64 = enableDns64; + return this; + } + + /** + * Get the enableLniAtDeviceIndex property: Indicates the device position for local network interfaces in this + * subnet. For example, ``1`` indicates local network interfaces in this subnet are the secondary network interface + * (eth1). + * + * @return the enableLniAtDeviceIndex value. + */ + public Integer enableLniAtDeviceIndex() { + return this.enableLniAtDeviceIndex; + } + + /** + * Set the enableLniAtDeviceIndex property: Indicates the device position for local network interfaces in this + * subnet. For example, ``1`` indicates local network interfaces in this subnet are the secondary network interface + * (eth1). + * + * @param enableLniAtDeviceIndex the enableLniAtDeviceIndex value to set. + * @return the AwsEc2SubnetProperties object itself. + */ + public AwsEc2SubnetProperties withEnableLniAtDeviceIndex(Integer enableLniAtDeviceIndex) { + this.enableLniAtDeviceIndex = enableLniAtDeviceIndex; + return this; + } + + /** + * Get the ipv4IpamPoolId property: An IPv4 IPAM pool ID for the subnet. + * + * @return the ipv4IpamPoolId value. + */ + public String ipv4IpamPoolId() { + return this.ipv4IpamPoolId; + } + + /** + * Set the ipv4IpamPoolId property: An IPv4 IPAM pool ID for the subnet. + * + * @param ipv4IpamPoolId the ipv4IpamPoolId value to set. + * @return the AwsEc2SubnetProperties object itself. + */ + public AwsEc2SubnetProperties withIpv4IpamPoolId(String ipv4IpamPoolId) { + this.ipv4IpamPoolId = ipv4IpamPoolId; + return this; + } + + /** + * Get the ipv4NetmaskLength property: An IPv4 netmask length for the subnet. + * + * @return the ipv4NetmaskLength value. + */ + public Integer ipv4NetmaskLength() { + return this.ipv4NetmaskLength; + } + + /** + * Set the ipv4NetmaskLength property: An IPv4 netmask length for the subnet. + * + * @param ipv4NetmaskLength the ipv4NetmaskLength value to set. + * @return the AwsEc2SubnetProperties object itself. + */ + public AwsEc2SubnetProperties withIpv4NetmaskLength(Integer ipv4NetmaskLength) { + this.ipv4NetmaskLength = ipv4NetmaskLength; + return this; + } + + /** + * Get the ipv6CidrBlock property: The IPv6 CIDR block. If you specify ``AssignIpv6AddressOnCreation``, you must + * also specify an IPv6 CIDR block. + * + * @return the ipv6CidrBlock value. + */ + public String ipv6CidrBlock() { + return this.ipv6CidrBlock; + } + + /** + * Set the ipv6CidrBlock property: The IPv6 CIDR block. If you specify ``AssignIpv6AddressOnCreation``, you must + * also specify an IPv6 CIDR block. + * + * @param ipv6CidrBlock the ipv6CidrBlock value to set. + * @return the AwsEc2SubnetProperties object itself. + */ + public AwsEc2SubnetProperties withIpv6CidrBlock(String ipv6CidrBlock) { + this.ipv6CidrBlock = ipv6CidrBlock; + return this; + } + + /** + * Get the ipv6CidrBlocks property: The IPv6 network ranges for the subnet, in CIDR notation. + * + * @return the ipv6CidrBlocks value. + */ + public List ipv6CidrBlocks() { + return this.ipv6CidrBlocks; + } + + /** + * Set the ipv6CidrBlocks property: The IPv6 network ranges for the subnet, in CIDR notation. + * + * @param ipv6CidrBlocks the ipv6CidrBlocks value to set. + * @return the AwsEc2SubnetProperties object itself. + */ + public AwsEc2SubnetProperties withIpv6CidrBlocks(List ipv6CidrBlocks) { + this.ipv6CidrBlocks = ipv6CidrBlocks; + return this; + } + + /** + * Get the ipv6IpamPoolId property: An IPv6 IPAM pool ID for the subnet. + * + * @return the ipv6IpamPoolId value. + */ + public String ipv6IpamPoolId() { + return this.ipv6IpamPoolId; + } + + /** + * Set the ipv6IpamPoolId property: An IPv6 IPAM pool ID for the subnet. + * + * @param ipv6IpamPoolId the ipv6IpamPoolId value to set. + * @return the AwsEc2SubnetProperties object itself. + */ + public AwsEc2SubnetProperties withIpv6IpamPoolId(String ipv6IpamPoolId) { + this.ipv6IpamPoolId = ipv6IpamPoolId; + return this; + } + + /** + * Get the ipv6Native property: Indicates whether this is an IPv6 only subnet. For more information, see [Subnet + * basics](https://docs.aws.amazon.com/vpc/latest/userguide/VPC_Subnets.html#subnet-basics) in the *User Guide*. + * + * @return the ipv6Native value. + */ + public Boolean ipv6Native() { + return this.ipv6Native; + } + + /** + * Set the ipv6Native property: Indicates whether this is an IPv6 only subnet. For more information, see [Subnet + * basics](https://docs.aws.amazon.com/vpc/latest/userguide/VPC_Subnets.html#subnet-basics) in the *User Guide*. + * + * @param ipv6Native the ipv6Native value to set. + * @return the AwsEc2SubnetProperties object itself. + */ + public AwsEc2SubnetProperties withIpv6Native(Boolean ipv6Native) { + this.ipv6Native = ipv6Native; + return this; + } + + /** + * Get the ipv6NetmaskLength property: An IPv6 netmask length for the subnet. + * + * @return the ipv6NetmaskLength value. + */ + public Integer ipv6NetmaskLength() { + return this.ipv6NetmaskLength; + } + + /** + * Set the ipv6NetmaskLength property: An IPv6 netmask length for the subnet. + * + * @param ipv6NetmaskLength the ipv6NetmaskLength value to set. + * @return the AwsEc2SubnetProperties object itself. + */ + public AwsEc2SubnetProperties withIpv6NetmaskLength(Integer ipv6NetmaskLength) { + this.ipv6NetmaskLength = ipv6NetmaskLength; + return this; + } + + /** + * Get the mapPublicIpOnLaunch property: Indicates whether instances launched in this subnet receive a public IPv4 + * address. The default value is ``false``. AWS charges for all public IPv4 addresses, including public IPv4 + * addresses associated with running instances and Elastic IP addresses. For more information, see the *Public IPv4 + * Address* tab on the [VPC pricing page](https://docs.aws.amazon.com/vpc/pricing/). + * + * @return the mapPublicIpOnLaunch value. + */ + public Boolean mapPublicIpOnLaunch() { + return this.mapPublicIpOnLaunch; + } + + /** + * Set the mapPublicIpOnLaunch property: Indicates whether instances launched in this subnet receive a public IPv4 + * address. The default value is ``false``. AWS charges for all public IPv4 addresses, including public IPv4 + * addresses associated with running instances and Elastic IP addresses. For more information, see the *Public IPv4 + * Address* tab on the [VPC pricing page](https://docs.aws.amazon.com/vpc/pricing/). + * + * @param mapPublicIpOnLaunch the mapPublicIpOnLaunch value to set. + * @return the AwsEc2SubnetProperties object itself. + */ + public AwsEc2SubnetProperties withMapPublicIpOnLaunch(Boolean mapPublicIpOnLaunch) { + this.mapPublicIpOnLaunch = mapPublicIpOnLaunch; + return this; + } + + /** + * Get the networkAclAssociationId property: Property networkAclAssociationId. + * + * @return the networkAclAssociationId value. + */ + public String networkAclAssociationId() { + return this.networkAclAssociationId; + } + + /** + * Set the networkAclAssociationId property: Property networkAclAssociationId. + * + * @param networkAclAssociationId the networkAclAssociationId value to set. + * @return the AwsEc2SubnetProperties object itself. + */ + public AwsEc2SubnetProperties withNetworkAclAssociationId(String networkAclAssociationId) { + this.networkAclAssociationId = networkAclAssociationId; + return this; + } + + /** + * Get the outpostArn property: The Amazon Resource Name (ARN) of the Outpost. + * + * @return the outpostArn value. + */ + public String outpostArn() { + return this.outpostArn; + } + + /** + * Set the outpostArn property: The Amazon Resource Name (ARN) of the Outpost. + * + * @param outpostArn the outpostArn value to set. + * @return the AwsEc2SubnetProperties object itself. + */ + public AwsEc2SubnetProperties withOutpostArn(String outpostArn) { + this.outpostArn = outpostArn; + return this; + } + + /** + * Get the privateDnsNameOptionsOnLaunch property: The hostname type for EC2 instances launched into this subnet and + * how DNS A and AAAA record queries to the instances should be handled. For more information, see [Amazon EC2 + * instance hostname types](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-instance-naming.html) in the + * *User Guide*. Available options: + EnableResourceNameDnsAAAARecord (true | false) + EnableResourceNameDnsARecord + * (true | false) + HostnameType (ip-name | resource-name). + * + * @return the privateDnsNameOptionsOnLaunch value. + */ + public PrivateDnsNameOptionsOnLaunchModelProperties privateDnsNameOptionsOnLaunch() { + return this.privateDnsNameOptionsOnLaunch; + } + + /** + * Set the privateDnsNameOptionsOnLaunch property: The hostname type for EC2 instances launched into this subnet and + * how DNS A and AAAA record queries to the instances should be handled. For more information, see [Amazon EC2 + * instance hostname types](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-instance-naming.html) in the + * *User Guide*. Available options: + EnableResourceNameDnsAAAARecord (true | false) + EnableResourceNameDnsARecord + * (true | false) + HostnameType (ip-name | resource-name). + * + * @param privateDnsNameOptionsOnLaunch the privateDnsNameOptionsOnLaunch value to set. + * @return the AwsEc2SubnetProperties object itself. + */ + public AwsEc2SubnetProperties + withPrivateDnsNameOptionsOnLaunch(PrivateDnsNameOptionsOnLaunchModelProperties privateDnsNameOptionsOnLaunch) { + this.privateDnsNameOptionsOnLaunch = privateDnsNameOptionsOnLaunch; + return this; + } + + /** + * Get the subnetId property: Property subnetId. + * + * @return the subnetId value. + */ + public String subnetId() { + return this.subnetId; + } + + /** + * Set the subnetId property: Property subnetId. + * + * @param subnetId the subnetId value to set. + * @return the AwsEc2SubnetProperties object itself. + */ + public AwsEc2SubnetProperties withSubnetId(String subnetId) { + this.subnetId = subnetId; + return this; + } + + /** + * Get the tags property: Any tags assigned to the subnet. + * + * @return the tags value. + */ + public List tags() { + return this.tags; + } + + /** + * Set the tags property: Any tags assigned to the subnet. + * + * @param tags the tags value to set. + * @return the AwsEc2SubnetProperties object itself. + */ + public AwsEc2SubnetProperties withTags(List tags) { + this.tags = tags; + return this; + } + + /** + * Get the vpcId property: The ID of the VPC the subnet is in. If you update this property, you must also update the + * ``CidrBlock`` property. + * + * @return the vpcId value. + */ + public String vpcId() { + return this.vpcId; + } + + /** + * Set the vpcId property: The ID of the VPC the subnet is in. If you update this property, you must also update the + * ``CidrBlock`` property. + * + * @param vpcId the vpcId value to set. + * @return the AwsEc2SubnetProperties object itself. + */ + public AwsEc2SubnetProperties withVpcId(String vpcId) { + this.vpcId = vpcId; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (privateDnsNameOptionsOnLaunch() != null) { + privateDnsNameOptionsOnLaunch().validate(); + } + if (tags() != null) { + tags().forEach(e -> e.validate()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeBooleanField("assignIpv6AddressOnCreation", this.assignIpv6AddressOnCreation); + jsonWriter.writeStringField("availabilityZone", this.availabilityZone); + jsonWriter.writeStringField("availabilityZoneId", this.availabilityZoneId); + jsonWriter.writeStringField("cidrBlock", this.cidrBlock); + jsonWriter.writeBooleanField("enableDns64", this.enableDns64); + jsonWriter.writeNumberField("enableLniAtDeviceIndex", this.enableLniAtDeviceIndex); + jsonWriter.writeStringField("ipv4IpamPoolId", this.ipv4IpamPoolId); + jsonWriter.writeNumberField("ipv4NetmaskLength", this.ipv4NetmaskLength); + jsonWriter.writeStringField("ipv6CidrBlock", this.ipv6CidrBlock); + jsonWriter.writeArrayField("ipv6CidrBlocks", this.ipv6CidrBlocks, + (writer, element) -> writer.writeString(element)); + jsonWriter.writeStringField("ipv6IpamPoolId", this.ipv6IpamPoolId); + jsonWriter.writeBooleanField("ipv6Native", this.ipv6Native); + jsonWriter.writeNumberField("ipv6NetmaskLength", this.ipv6NetmaskLength); + jsonWriter.writeBooleanField("mapPublicIpOnLaunch", this.mapPublicIpOnLaunch); + jsonWriter.writeStringField("networkAclAssociationId", this.networkAclAssociationId); + jsonWriter.writeStringField("outpostArn", this.outpostArn); + jsonWriter.writeJsonField("privateDnsNameOptionsOnLaunch", this.privateDnsNameOptionsOnLaunch); + jsonWriter.writeStringField("subnetId", this.subnetId); + jsonWriter.writeArrayField("tags", this.tags, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("vpcId", this.vpcId); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AwsEc2SubnetProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AwsEc2SubnetProperties if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the AwsEc2SubnetProperties. + */ + public static AwsEc2SubnetProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AwsEc2SubnetProperties deserializedAwsEc2SubnetProperties = new AwsEc2SubnetProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("assignIpv6AddressOnCreation".equals(fieldName)) { + deserializedAwsEc2SubnetProperties.assignIpv6AddressOnCreation + = reader.getNullable(JsonReader::getBoolean); + } else if ("availabilityZone".equals(fieldName)) { + deserializedAwsEc2SubnetProperties.availabilityZone = reader.getString(); + } else if ("availabilityZoneId".equals(fieldName)) { + deserializedAwsEc2SubnetProperties.availabilityZoneId = reader.getString(); + } else if ("cidrBlock".equals(fieldName)) { + deserializedAwsEc2SubnetProperties.cidrBlock = reader.getString(); + } else if ("enableDns64".equals(fieldName)) { + deserializedAwsEc2SubnetProperties.enableDns64 = reader.getNullable(JsonReader::getBoolean); + } else if ("enableLniAtDeviceIndex".equals(fieldName)) { + deserializedAwsEc2SubnetProperties.enableLniAtDeviceIndex = reader.getNullable(JsonReader::getInt); + } else if ("ipv4IpamPoolId".equals(fieldName)) { + deserializedAwsEc2SubnetProperties.ipv4IpamPoolId = reader.getString(); + } else if ("ipv4NetmaskLength".equals(fieldName)) { + deserializedAwsEc2SubnetProperties.ipv4NetmaskLength = reader.getNullable(JsonReader::getInt); + } else if ("ipv6CidrBlock".equals(fieldName)) { + deserializedAwsEc2SubnetProperties.ipv6CidrBlock = reader.getString(); + } else if ("ipv6CidrBlocks".equals(fieldName)) { + List ipv6CidrBlocks = reader.readArray(reader1 -> reader1.getString()); + deserializedAwsEc2SubnetProperties.ipv6CidrBlocks = ipv6CidrBlocks; + } else if ("ipv6IpamPoolId".equals(fieldName)) { + deserializedAwsEc2SubnetProperties.ipv6IpamPoolId = reader.getString(); + } else if ("ipv6Native".equals(fieldName)) { + deserializedAwsEc2SubnetProperties.ipv6Native = reader.getNullable(JsonReader::getBoolean); + } else if ("ipv6NetmaskLength".equals(fieldName)) { + deserializedAwsEc2SubnetProperties.ipv6NetmaskLength = reader.getNullable(JsonReader::getInt); + } else if ("mapPublicIpOnLaunch".equals(fieldName)) { + deserializedAwsEc2SubnetProperties.mapPublicIpOnLaunch = reader.getNullable(JsonReader::getBoolean); + } else if ("networkAclAssociationId".equals(fieldName)) { + deserializedAwsEc2SubnetProperties.networkAclAssociationId = reader.getString(); + } else if ("outpostArn".equals(fieldName)) { + deserializedAwsEc2SubnetProperties.outpostArn = reader.getString(); + } else if ("privateDnsNameOptionsOnLaunch".equals(fieldName)) { + deserializedAwsEc2SubnetProperties.privateDnsNameOptionsOnLaunch + = PrivateDnsNameOptionsOnLaunchModelProperties.fromJson(reader); + } else if ("subnetId".equals(fieldName)) { + deserializedAwsEc2SubnetProperties.subnetId = reader.getString(); + } else if ("tags".equals(fieldName)) { + List tags = reader.readArray(reader1 -> TagAutoGenerated20.fromJson(reader1)); + deserializedAwsEc2SubnetProperties.tags = tags; + } else if ("vpcId".equals(fieldName)) { + deserializedAwsEc2SubnetProperties.vpcId = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedAwsEc2SubnetProperties; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/AwsEc2VolumeProperties.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/AwsEc2VolumeProperties.java new file mode 100644 index 000000000000..c403848dfb34 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/AwsEc2VolumeProperties.java @@ -0,0 +1,553 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Definition of awsEc2Volume. + */ +@Fluent +public final class AwsEc2VolumeProperties implements JsonSerializable { + /* + * Indicates whether the volume is auto-enabled for I/O operations. By default, Amazon EBS disables I/O to the + * volume from attached EC2 instances when it determines that a volume's data is potentially inconsistent. If the + * consistency of the volume is not a concern, and you prefer that the volume be made available immediately if it's + * impaired, you can configure the volume to automatically enable I/O. + */ + private Boolean autoEnableIO; + + /* + * The ID of the Availability Zone in which to create the volume. For example, ``us-east-1a``. + */ + private String availabilityZone; + + /* + * Indicates whether the volume should be encrypted. The effect of setting the encryption state to ``true`` depends + * on the volume origin (new or from a snapshot), starting encryption state, ownership, and whether encryption by + * default is enabled. For more information, see [Encryption by + * default](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/EBSEncryption.html#encryption-by-default) in the + * *Amazon Elastic Compute Cloud User Guide*. Encrypted Amazon EBS volumes must be attached to instances that + * support Amazon EBS encryption. For more information, see [Supported instance + * types](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/EBSEncryption.html#EBSEncryption_supported_instances). + */ + private Boolean encrypted; + + /* + * The number of I/O operations per second (IOPS). For ``gp3``, ``io1``, and ``io2`` volumes, this represents the + * number of IOPS that are provisioned for the volume. For ``gp2`` volumes, this represents the baseline performance + * of the volume and the rate at which the volume accumulates I/O credits for bursting. The following are the + * supported values for each volume type: + ``gp3``: 3,000 - 16,000 IOPS + ``io1``: 100 - 64,000 IOPS + ``io2``: 100 + * - 256,000 IOPS For ``io2`` volumes, you can achieve up to 256,000 IOPS on [instances built on the Nitro + * System](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/instance-types.html#ec2-nitro-instances). On other + * instances, you can achieve performance up to 32,000 IOPS. This parameter is required for ``io1`` and ``io2`` + * volumes. The default for ``gp3`` volumes is 3,000 IOPS. This parameter is not supported for ``gp2``, ``st1``, + * ``sc1``, or ``standard`` volumes. + */ + private Integer iops; + + /* + * The identifier of the kms-key-long to use for Amazon EBS encryption. If ``KmsKeyId`` is specified, the encrypted + * state must be ``true``. If you omit this property and your account is enabled for encryption by default, or + * *Encrypted* is set to ``true``, then the volume is encrypted using the default key specified for your account. If + * your account does not have a default key, then the volume is encrypted using the aws-managed-key. Alternatively, + * if you want to specify a different key, you can specify one of the following: + Key ID. For example, + * 1234abcd-12ab-34cd-56ef-1234567890ab. + Key alias. Specify the alias for the key, prefixed with ``alias/``. For + * example, for a key with the alias ``my_cmk``, use ``alias/my_cmk``. Or to specify the aws-managed-key, use + * ``alias/aws/ebs``. + Key ARN. For example, + * arn:aws:kms:us-east-1:012345678910:key/1234abcd-12ab-34cd-56ef-1234567890ab. + Alias ARN. For example, + * arn:aws:kms:us-east-1:012345678910:alias/ExampleAlias. + */ + private String kmsKeyId; + + /* + * Indicates whether Amazon EBS Multi-Attach is enabled. CFNlong does not currently support updating a single-attach + * volume to be multi-attach enabled, updating a multi-attach enabled volume to be single-attach, or updating the + * size or number of I/O operations per second (IOPS) of a multi-attach enabled volume. + */ + private Boolean multiAttachEnabled; + + /* + * The Amazon Resource Name (ARN) of the Outpost. + */ + private String outpostArn; + + /* + * The size of the volume, in GiBs. You must specify either a snapshot ID or a volume size. If you specify a + * snapshot, the default is the snapshot size. You can specify a volume size that is equal to or larger than the + * snapshot size. The following are the supported volumes sizes for each volume type: + ``gp2`` and ``gp3``: 1 - + * 16,384 GiB + ``io1``: 4 - 16,384 GiB + ``io2``: 4 - 65,536 GiB + ``st1`` and ``sc1``: 125 - 16,384 GiB + + * ``standard``: 1 - 1024 GiB + */ + private Integer size; + + /* + * The snapshot from which to create the volume. You must specify either a snapshot ID or a volume size. + */ + private String snapshotId; + + /* + * The tags to apply to the volume during creation. + */ + private List tags; + + /* + * The throughput to provision for a volume, with a maximum of 1,000 MiB/s. This parameter is valid only for ``gp3`` + * volumes. The default value is 125. Valid Range: Minimum value of 125. Maximum value of 1000. + */ + private Integer throughput; + + /* + * Property volumeId + */ + private String volumeId; + + /* + * The volume type. This parameter can be one of the following values: + General Purpose SSD: ``gp2`` | ``gp3`` + + * Provisioned IOPS SSD: ``io1`` | ``io2`` + Throughput Optimized HDD: ``st1`` + Cold HDD: ``sc1`` + Magnetic: + * ``standard`` For more information, see [Amazon EBS volume + * types](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/EBSVolumeTypes.html) in the *Amazon Elastic Compute + * Cloud User Guide*. Default: ``gp2`` + */ + private String volumeType; + + /** + * Creates an instance of AwsEc2VolumeProperties class. + */ + public AwsEc2VolumeProperties() { + } + + /** + * Get the autoEnableIO property: Indicates whether the volume is auto-enabled for I/O operations. By default, + * Amazon EBS disables I/O to the volume from attached EC2 instances when it determines that a volume's data is + * potentially inconsistent. If the consistency of the volume is not a concern, and you prefer that the volume be + * made available immediately if it's impaired, you can configure the volume to automatically enable I/O. + * + * @return the autoEnableIO value. + */ + public Boolean autoEnableIO() { + return this.autoEnableIO; + } + + /** + * Set the autoEnableIO property: Indicates whether the volume is auto-enabled for I/O operations. By default, + * Amazon EBS disables I/O to the volume from attached EC2 instances when it determines that a volume's data is + * potentially inconsistent. If the consistency of the volume is not a concern, and you prefer that the volume be + * made available immediately if it's impaired, you can configure the volume to automatically enable I/O. + * + * @param autoEnableIO the autoEnableIO value to set. + * @return the AwsEc2VolumeProperties object itself. + */ + public AwsEc2VolumeProperties withAutoEnableIO(Boolean autoEnableIO) { + this.autoEnableIO = autoEnableIO; + return this; + } + + /** + * Get the availabilityZone property: The ID of the Availability Zone in which to create the volume. For example, + * ``us-east-1a``. + * + * @return the availabilityZone value. + */ + public String availabilityZone() { + return this.availabilityZone; + } + + /** + * Set the availabilityZone property: The ID of the Availability Zone in which to create the volume. For example, + * ``us-east-1a``. + * + * @param availabilityZone the availabilityZone value to set. + * @return the AwsEc2VolumeProperties object itself. + */ + public AwsEc2VolumeProperties withAvailabilityZone(String availabilityZone) { + this.availabilityZone = availabilityZone; + return this; + } + + /** + * Get the encrypted property: Indicates whether the volume should be encrypted. The effect of setting the + * encryption state to ``true`` depends on the volume origin (new or from a snapshot), starting encryption state, + * ownership, and whether encryption by default is enabled. For more information, see [Encryption by + * default](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/EBSEncryption.html#encryption-by-default) in the + * *Amazon Elastic Compute Cloud User Guide*. Encrypted Amazon EBS volumes must be attached to instances that + * support Amazon EBS encryption. For more information, see [Supported instance + * types](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/EBSEncryption.html#EBSEncryption_supported_instances). + * + * @return the encrypted value. + */ + public Boolean encrypted() { + return this.encrypted; + } + + /** + * Set the encrypted property: Indicates whether the volume should be encrypted. The effect of setting the + * encryption state to ``true`` depends on the volume origin (new or from a snapshot), starting encryption state, + * ownership, and whether encryption by default is enabled. For more information, see [Encryption by + * default](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/EBSEncryption.html#encryption-by-default) in the + * *Amazon Elastic Compute Cloud User Guide*. Encrypted Amazon EBS volumes must be attached to instances that + * support Amazon EBS encryption. For more information, see [Supported instance + * types](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/EBSEncryption.html#EBSEncryption_supported_instances). + * + * @param encrypted the encrypted value to set. + * @return the AwsEc2VolumeProperties object itself. + */ + public AwsEc2VolumeProperties withEncrypted(Boolean encrypted) { + this.encrypted = encrypted; + return this; + } + + /** + * Get the iops property: The number of I/O operations per second (IOPS). For ``gp3``, ``io1``, and ``io2`` volumes, + * this represents the number of IOPS that are provisioned for the volume. For ``gp2`` volumes, this represents the + * baseline performance of the volume and the rate at which the volume accumulates I/O credits for bursting. The + * following are the supported values for each volume type: + ``gp3``: 3,000 - 16,000 IOPS + ``io1``: 100 - 64,000 + * IOPS + ``io2``: 100 - 256,000 IOPS For ``io2`` volumes, you can achieve up to 256,000 IOPS on [instances built on + * the Nitro System](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/instance-types.html#ec2-nitro-instances). + * On other instances, you can achieve performance up to 32,000 IOPS. This parameter is required for ``io1`` and + * ``io2`` volumes. The default for ``gp3`` volumes is 3,000 IOPS. This parameter is not supported for ``gp2``, + * ``st1``, ``sc1``, or ``standard`` volumes. + * + * @return the iops value. + */ + public Integer iops() { + return this.iops; + } + + /** + * Set the iops property: The number of I/O operations per second (IOPS). For ``gp3``, ``io1``, and ``io2`` volumes, + * this represents the number of IOPS that are provisioned for the volume. For ``gp2`` volumes, this represents the + * baseline performance of the volume and the rate at which the volume accumulates I/O credits for bursting. The + * following are the supported values for each volume type: + ``gp3``: 3,000 - 16,000 IOPS + ``io1``: 100 - 64,000 + * IOPS + ``io2``: 100 - 256,000 IOPS For ``io2`` volumes, you can achieve up to 256,000 IOPS on [instances built on + * the Nitro System](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/instance-types.html#ec2-nitro-instances). + * On other instances, you can achieve performance up to 32,000 IOPS. This parameter is required for ``io1`` and + * ``io2`` volumes. The default for ``gp3`` volumes is 3,000 IOPS. This parameter is not supported for ``gp2``, + * ``st1``, ``sc1``, or ``standard`` volumes. + * + * @param iops the iops value to set. + * @return the AwsEc2VolumeProperties object itself. + */ + public AwsEc2VolumeProperties withIops(Integer iops) { + this.iops = iops; + return this; + } + + /** + * Get the kmsKeyId property: The identifier of the kms-key-long to use for Amazon EBS encryption. If ``KmsKeyId`` + * is specified, the encrypted state must be ``true``. If you omit this property and your account is enabled for + * encryption by default, or *Encrypted* is set to ``true``, then the volume is encrypted using the default key + * specified for your account. If your account does not have a default key, then the volume is encrypted using the + * aws-managed-key. Alternatively, if you want to specify a different key, you can specify one of the following: + + * Key ID. For example, 1234abcd-12ab-34cd-56ef-1234567890ab. + Key alias. Specify the alias for the key, prefixed + * with ``alias/``. For example, for a key with the alias ``my_cmk``, use ``alias/my_cmk``. Or to specify the + * aws-managed-key, use ``alias/aws/ebs``. + Key ARN. For example, + * arn:aws:kms:us-east-1:012345678910:key/1234abcd-12ab-34cd-56ef-1234567890ab. + Alias ARN. For example, + * arn:aws:kms:us-east-1:012345678910:alias/ExampleAlias. + * + * @return the kmsKeyId value. + */ + public String kmsKeyId() { + return this.kmsKeyId; + } + + /** + * Set the kmsKeyId property: The identifier of the kms-key-long to use for Amazon EBS encryption. If ``KmsKeyId`` + * is specified, the encrypted state must be ``true``. If you omit this property and your account is enabled for + * encryption by default, or *Encrypted* is set to ``true``, then the volume is encrypted using the default key + * specified for your account. If your account does not have a default key, then the volume is encrypted using the + * aws-managed-key. Alternatively, if you want to specify a different key, you can specify one of the following: + + * Key ID. For example, 1234abcd-12ab-34cd-56ef-1234567890ab. + Key alias. Specify the alias for the key, prefixed + * with ``alias/``. For example, for a key with the alias ``my_cmk``, use ``alias/my_cmk``. Or to specify the + * aws-managed-key, use ``alias/aws/ebs``. + Key ARN. For example, + * arn:aws:kms:us-east-1:012345678910:key/1234abcd-12ab-34cd-56ef-1234567890ab. + Alias ARN. For example, + * arn:aws:kms:us-east-1:012345678910:alias/ExampleAlias. + * + * @param kmsKeyId the kmsKeyId value to set. + * @return the AwsEc2VolumeProperties object itself. + */ + public AwsEc2VolumeProperties withKmsKeyId(String kmsKeyId) { + this.kmsKeyId = kmsKeyId; + return this; + } + + /** + * Get the multiAttachEnabled property: Indicates whether Amazon EBS Multi-Attach is enabled. CFNlong does not + * currently support updating a single-attach volume to be multi-attach enabled, updating a multi-attach enabled + * volume to be single-attach, or updating the size or number of I/O operations per second (IOPS) of a multi-attach + * enabled volume. + * + * @return the multiAttachEnabled value. + */ + public Boolean multiAttachEnabled() { + return this.multiAttachEnabled; + } + + /** + * Set the multiAttachEnabled property: Indicates whether Amazon EBS Multi-Attach is enabled. CFNlong does not + * currently support updating a single-attach volume to be multi-attach enabled, updating a multi-attach enabled + * volume to be single-attach, or updating the size or number of I/O operations per second (IOPS) of a multi-attach + * enabled volume. + * + * @param multiAttachEnabled the multiAttachEnabled value to set. + * @return the AwsEc2VolumeProperties object itself. + */ + public AwsEc2VolumeProperties withMultiAttachEnabled(Boolean multiAttachEnabled) { + this.multiAttachEnabled = multiAttachEnabled; + return this; + } + + /** + * Get the outpostArn property: The Amazon Resource Name (ARN) of the Outpost. + * + * @return the outpostArn value. + */ + public String outpostArn() { + return this.outpostArn; + } + + /** + * Set the outpostArn property: The Amazon Resource Name (ARN) of the Outpost. + * + * @param outpostArn the outpostArn value to set. + * @return the AwsEc2VolumeProperties object itself. + */ + public AwsEc2VolumeProperties withOutpostArn(String outpostArn) { + this.outpostArn = outpostArn; + return this; + } + + /** + * Get the size property: The size of the volume, in GiBs. You must specify either a snapshot ID or a volume size. + * If you specify a snapshot, the default is the snapshot size. You can specify a volume size that is equal to or + * larger than the snapshot size. The following are the supported volumes sizes for each volume type: + ``gp2`` and + * ``gp3``: 1 - 16,384 GiB + ``io1``: 4 - 16,384 GiB + ``io2``: 4 - 65,536 GiB + ``st1`` and ``sc1``: 125 - 16,384 + * GiB + ``standard``: 1 - 1024 GiB. + * + * @return the size value. + */ + public Integer size() { + return this.size; + } + + /** + * Set the size property: The size of the volume, in GiBs. You must specify either a snapshot ID or a volume size. + * If you specify a snapshot, the default is the snapshot size. You can specify a volume size that is equal to or + * larger than the snapshot size. The following are the supported volumes sizes for each volume type: + ``gp2`` and + * ``gp3``: 1 - 16,384 GiB + ``io1``: 4 - 16,384 GiB + ``io2``: 4 - 65,536 GiB + ``st1`` and ``sc1``: 125 - 16,384 + * GiB + ``standard``: 1 - 1024 GiB. + * + * @param size the size value to set. + * @return the AwsEc2VolumeProperties object itself. + */ + public AwsEc2VolumeProperties withSize(Integer size) { + this.size = size; + return this; + } + + /** + * Get the snapshotId property: The snapshot from which to create the volume. You must specify either a snapshot ID + * or a volume size. + * + * @return the snapshotId value. + */ + public String snapshotId() { + return this.snapshotId; + } + + /** + * Set the snapshotId property: The snapshot from which to create the volume. You must specify either a snapshot ID + * or a volume size. + * + * @param snapshotId the snapshotId value to set. + * @return the AwsEc2VolumeProperties object itself. + */ + public AwsEc2VolumeProperties withSnapshotId(String snapshotId) { + this.snapshotId = snapshotId; + return this; + } + + /** + * Get the tags property: The tags to apply to the volume during creation. + * + * @return the tags value. + */ + public List tags() { + return this.tags; + } + + /** + * Set the tags property: The tags to apply to the volume during creation. + * + * @param tags the tags value to set. + * @return the AwsEc2VolumeProperties object itself. + */ + public AwsEc2VolumeProperties withTags(List tags) { + this.tags = tags; + return this; + } + + /** + * Get the throughput property: The throughput to provision for a volume, with a maximum of 1,000 MiB/s. This + * parameter is valid only for ``gp3`` volumes. The default value is 125. Valid Range: Minimum value of 125. Maximum + * value of 1000. + * + * @return the throughput value. + */ + public Integer throughput() { + return this.throughput; + } + + /** + * Set the throughput property: The throughput to provision for a volume, with a maximum of 1,000 MiB/s. This + * parameter is valid only for ``gp3`` volumes. The default value is 125. Valid Range: Minimum value of 125. Maximum + * value of 1000. + * + * @param throughput the throughput value to set. + * @return the AwsEc2VolumeProperties object itself. + */ + public AwsEc2VolumeProperties withThroughput(Integer throughput) { + this.throughput = throughput; + return this; + } + + /** + * Get the volumeId property: Property volumeId. + * + * @return the volumeId value. + */ + public String volumeId() { + return this.volumeId; + } + + /** + * Set the volumeId property: Property volumeId. + * + * @param volumeId the volumeId value to set. + * @return the AwsEc2VolumeProperties object itself. + */ + public AwsEc2VolumeProperties withVolumeId(String volumeId) { + this.volumeId = volumeId; + return this; + } + + /** + * Get the volumeType property: The volume type. This parameter can be one of the following values: + General + * Purpose SSD: ``gp2`` | ``gp3`` + Provisioned IOPS SSD: ``io1`` | ``io2`` + Throughput Optimized HDD: ``st1`` + + * Cold HDD: ``sc1`` + Magnetic: ``standard`` For more information, see [Amazon EBS volume + * types](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/EBSVolumeTypes.html) in the *Amazon Elastic Compute + * Cloud User Guide*. Default: ``gp2``. + * + * @return the volumeType value. + */ + public String volumeType() { + return this.volumeType; + } + + /** + * Set the volumeType property: The volume type. This parameter can be one of the following values: + General + * Purpose SSD: ``gp2`` | ``gp3`` + Provisioned IOPS SSD: ``io1`` | ``io2`` + Throughput Optimized HDD: ``st1`` + + * Cold HDD: ``sc1`` + Magnetic: ``standard`` For more information, see [Amazon EBS volume + * types](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/EBSVolumeTypes.html) in the *Amazon Elastic Compute + * Cloud User Guide*. Default: ``gp2``. + * + * @param volumeType the volumeType value to set. + * @return the AwsEc2VolumeProperties object itself. + */ + public AwsEc2VolumeProperties withVolumeType(String volumeType) { + this.volumeType = volumeType; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (tags() != null) { + tags().forEach(e -> e.validate()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeBooleanField("autoEnableIO", this.autoEnableIO); + jsonWriter.writeStringField("availabilityZone", this.availabilityZone); + jsonWriter.writeBooleanField("encrypted", this.encrypted); + jsonWriter.writeNumberField("iops", this.iops); + jsonWriter.writeStringField("kmsKeyId", this.kmsKeyId); + jsonWriter.writeBooleanField("multiAttachEnabled", this.multiAttachEnabled); + jsonWriter.writeStringField("outpostArn", this.outpostArn); + jsonWriter.writeNumberField("size", this.size); + jsonWriter.writeStringField("snapshotId", this.snapshotId); + jsonWriter.writeArrayField("tags", this.tags, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeNumberField("throughput", this.throughput); + jsonWriter.writeStringField("volumeId", this.volumeId); + jsonWriter.writeStringField("volumeType", this.volumeType); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AwsEc2VolumeProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AwsEc2VolumeProperties if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the AwsEc2VolumeProperties. + */ + public static AwsEc2VolumeProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AwsEc2VolumeProperties deserializedAwsEc2VolumeProperties = new AwsEc2VolumeProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("autoEnableIO".equals(fieldName)) { + deserializedAwsEc2VolumeProperties.autoEnableIO = reader.getNullable(JsonReader::getBoolean); + } else if ("availabilityZone".equals(fieldName)) { + deserializedAwsEc2VolumeProperties.availabilityZone = reader.getString(); + } else if ("encrypted".equals(fieldName)) { + deserializedAwsEc2VolumeProperties.encrypted = reader.getNullable(JsonReader::getBoolean); + } else if ("iops".equals(fieldName)) { + deserializedAwsEc2VolumeProperties.iops = reader.getNullable(JsonReader::getInt); + } else if ("kmsKeyId".equals(fieldName)) { + deserializedAwsEc2VolumeProperties.kmsKeyId = reader.getString(); + } else if ("multiAttachEnabled".equals(fieldName)) { + deserializedAwsEc2VolumeProperties.multiAttachEnabled = reader.getNullable(JsonReader::getBoolean); + } else if ("outpostArn".equals(fieldName)) { + deserializedAwsEc2VolumeProperties.outpostArn = reader.getString(); + } else if ("size".equals(fieldName)) { + deserializedAwsEc2VolumeProperties.size = reader.getNullable(JsonReader::getInt); + } else if ("snapshotId".equals(fieldName)) { + deserializedAwsEc2VolumeProperties.snapshotId = reader.getString(); + } else if ("tags".equals(fieldName)) { + List tags = reader.readArray(reader1 -> TagAutoGenerated21.fromJson(reader1)); + deserializedAwsEc2VolumeProperties.tags = tags; + } else if ("throughput".equals(fieldName)) { + deserializedAwsEc2VolumeProperties.throughput = reader.getNullable(JsonReader::getInt); + } else if ("volumeId".equals(fieldName)) { + deserializedAwsEc2VolumeProperties.volumeId = reader.getString(); + } else if ("volumeType".equals(fieldName)) { + deserializedAwsEc2VolumeProperties.volumeType = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedAwsEc2VolumeProperties; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/AwsEc2VpcEndpointProperties.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/AwsEc2VpcEndpointProperties.java new file mode 100644 index 000000000000..27df97d0fb08 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/AwsEc2VpcEndpointProperties.java @@ -0,0 +1,455 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; +import java.util.Map; + +/** + * Definition of awsEc2VPCEndpoint. + */ +@Fluent +public final class AwsEc2VpcEndpointProperties implements JsonSerializable { + /* + * Property creationTimestamp + */ + private String creationTimestamp; + + /* + * Property dnsEntries + */ + private List dnsEntries; + + /* + * Property id + */ + private String id; + + /* + * Property networkInterfaceIds + */ + private List networkInterfaceIds; + + /* + * An endpoint policy, which controls access to the service from the VPC. The default endpoint policy allows full + * access to the service. Endpoint policies are supported only for gateway and interface endpoints. For + * CloudFormation templates in YAML, you can provide the policy in JSON or YAML format. CFNlong converts YAML + * policies to JSON format before calling the API to create or modify the VPC endpoint. + */ + private Map policyDocument; + + /* + * Indicate whether to associate a private hosted zone with the specified VPC. The private hosted zone contains a + * record set for the default public DNS name for the service for the Region (for example, + * ``kinesis.us-east-1.amazonaws.com``), which resolves to the private IP addresses of the endpoint network + * interfaces in the VPC. This enables you to make requests to the default public DNS name for the service instead + * of the public DNS names that are automatically generated by the VPC endpoint service. To use a private hosted + * zone, you must set the following VPC attributes to ``true``: ``enableDnsHostnames`` and ``enableDnsSupport``. + * This property is supported only for interface endpoints. Default: ``false`` + */ + private Boolean privateDnsEnabled; + + /* + * The IDs of the route tables. Routing is supported only for gateway endpoints. + */ + private List routeTableIds; + + /* + * The IDs of the security groups to associate with the endpoint network interfaces. If this parameter is not + * specified, we use the default security group for the VPC. Security groups are supported only for interface + * endpoints. + */ + private List securityGroupIds; + + /* + * The name of the endpoint service. + */ + private String serviceName; + + /* + * The IDs of the subnets in which to create endpoint network interfaces. You must specify this property for an + * interface endpoint or a Gateway Load Balancer endpoint. You can't specify this property for a gateway endpoint. + * For a Gateway Load Balancer endpoint, you can specify only one subnet. + */ + private List subnetIds; + + /* + * The type of endpoint. Default: Gateway + */ + private VpcEndpointType vpcEndpointType; + + /* + * The ID of the VPC. + */ + private String vpcId; + + /** + * Creates an instance of AwsEc2VpcEndpointProperties class. + */ + public AwsEc2VpcEndpointProperties() { + } + + /** + * Get the creationTimestamp property: Property creationTimestamp. + * + * @return the creationTimestamp value. + */ + public String creationTimestamp() { + return this.creationTimestamp; + } + + /** + * Set the creationTimestamp property: Property creationTimestamp. + * + * @param creationTimestamp the creationTimestamp value to set. + * @return the AwsEc2VpcEndpointProperties object itself. + */ + public AwsEc2VpcEndpointProperties withCreationTimestamp(String creationTimestamp) { + this.creationTimestamp = creationTimestamp; + return this; + } + + /** + * Get the dnsEntries property: Property dnsEntries. + * + * @return the dnsEntries value. + */ + public List dnsEntries() { + return this.dnsEntries; + } + + /** + * Set the dnsEntries property: Property dnsEntries. + * + * @param dnsEntries the dnsEntries value to set. + * @return the AwsEc2VpcEndpointProperties object itself. + */ + public AwsEc2VpcEndpointProperties withDnsEntries(List dnsEntries) { + this.dnsEntries = dnsEntries; + return this; + } + + /** + * Get the id property: Property id. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Set the id property: Property id. + * + * @param id the id value to set. + * @return the AwsEc2VpcEndpointProperties object itself. + */ + public AwsEc2VpcEndpointProperties withId(String id) { + this.id = id; + return this; + } + + /** + * Get the networkInterfaceIds property: Property networkInterfaceIds. + * + * @return the networkInterfaceIds value. + */ + public List networkInterfaceIds() { + return this.networkInterfaceIds; + } + + /** + * Set the networkInterfaceIds property: Property networkInterfaceIds. + * + * @param networkInterfaceIds the networkInterfaceIds value to set. + * @return the AwsEc2VpcEndpointProperties object itself. + */ + public AwsEc2VpcEndpointProperties withNetworkInterfaceIds(List networkInterfaceIds) { + this.networkInterfaceIds = networkInterfaceIds; + return this; + } + + /** + * Get the policyDocument property: An endpoint policy, which controls access to the service from the VPC. The + * default endpoint policy allows full access to the service. Endpoint policies are supported only for gateway and + * interface endpoints. For CloudFormation templates in YAML, you can provide the policy in JSON or YAML format. + * CFNlong converts YAML policies to JSON format before calling the API to create or modify the VPC endpoint. + * + * @return the policyDocument value. + */ + public Map policyDocument() { + return this.policyDocument; + } + + /** + * Set the policyDocument property: An endpoint policy, which controls access to the service from the VPC. The + * default endpoint policy allows full access to the service. Endpoint policies are supported only for gateway and + * interface endpoints. For CloudFormation templates in YAML, you can provide the policy in JSON or YAML format. + * CFNlong converts YAML policies to JSON format before calling the API to create or modify the VPC endpoint. + * + * @param policyDocument the policyDocument value to set. + * @return the AwsEc2VpcEndpointProperties object itself. + */ + public AwsEc2VpcEndpointProperties withPolicyDocument(Map policyDocument) { + this.policyDocument = policyDocument; + return this; + } + + /** + * Get the privateDnsEnabled property: Indicate whether to associate a private hosted zone with the specified VPC. + * The private hosted zone contains a record set for the default public DNS name for the service for the Region (for + * example, ``kinesis.us-east-1.amazonaws.com``), which resolves to the private IP addresses of the endpoint network + * interfaces in the VPC. This enables you to make requests to the default public DNS name for the service instead + * of the public DNS names that are automatically generated by the VPC endpoint service. To use a private hosted + * zone, you must set the following VPC attributes to ``true``: ``enableDnsHostnames`` and ``enableDnsSupport``. + * This property is supported only for interface endpoints. Default: ``false``. + * + * @return the privateDnsEnabled value. + */ + public Boolean privateDnsEnabled() { + return this.privateDnsEnabled; + } + + /** + * Set the privateDnsEnabled property: Indicate whether to associate a private hosted zone with the specified VPC. + * The private hosted zone contains a record set for the default public DNS name for the service for the Region (for + * example, ``kinesis.us-east-1.amazonaws.com``), which resolves to the private IP addresses of the endpoint network + * interfaces in the VPC. This enables you to make requests to the default public DNS name for the service instead + * of the public DNS names that are automatically generated by the VPC endpoint service. To use a private hosted + * zone, you must set the following VPC attributes to ``true``: ``enableDnsHostnames`` and ``enableDnsSupport``. + * This property is supported only for interface endpoints. Default: ``false``. + * + * @param privateDnsEnabled the privateDnsEnabled value to set. + * @return the AwsEc2VpcEndpointProperties object itself. + */ + public AwsEc2VpcEndpointProperties withPrivateDnsEnabled(Boolean privateDnsEnabled) { + this.privateDnsEnabled = privateDnsEnabled; + return this; + } + + /** + * Get the routeTableIds property: The IDs of the route tables. Routing is supported only for gateway endpoints. + * + * @return the routeTableIds value. + */ + public List routeTableIds() { + return this.routeTableIds; + } + + /** + * Set the routeTableIds property: The IDs of the route tables. Routing is supported only for gateway endpoints. + * + * @param routeTableIds the routeTableIds value to set. + * @return the AwsEc2VpcEndpointProperties object itself. + */ + public AwsEc2VpcEndpointProperties withRouteTableIds(List routeTableIds) { + this.routeTableIds = routeTableIds; + return this; + } + + /** + * Get the securityGroupIds property: The IDs of the security groups to associate with the endpoint network + * interfaces. If this parameter is not specified, we use the default security group for the VPC. Security groups + * are supported only for interface endpoints. + * + * @return the securityGroupIds value. + */ + public List securityGroupIds() { + return this.securityGroupIds; + } + + /** + * Set the securityGroupIds property: The IDs of the security groups to associate with the endpoint network + * interfaces. If this parameter is not specified, we use the default security group for the VPC. Security groups + * are supported only for interface endpoints. + * + * @param securityGroupIds the securityGroupIds value to set. + * @return the AwsEc2VpcEndpointProperties object itself. + */ + public AwsEc2VpcEndpointProperties withSecurityGroupIds(List securityGroupIds) { + this.securityGroupIds = securityGroupIds; + return this; + } + + /** + * Get the serviceName property: The name of the endpoint service. + * + * @return the serviceName value. + */ + public String serviceName() { + return this.serviceName; + } + + /** + * Set the serviceName property: The name of the endpoint service. + * + * @param serviceName the serviceName value to set. + * @return the AwsEc2VpcEndpointProperties object itself. + */ + public AwsEc2VpcEndpointProperties withServiceName(String serviceName) { + this.serviceName = serviceName; + return this; + } + + /** + * Get the subnetIds property: The IDs of the subnets in which to create endpoint network interfaces. You must + * specify this property for an interface endpoint or a Gateway Load Balancer endpoint. You can't specify this + * property for a gateway endpoint. For a Gateway Load Balancer endpoint, you can specify only one subnet. + * + * @return the subnetIds value. + */ + public List subnetIds() { + return this.subnetIds; + } + + /** + * Set the subnetIds property: The IDs of the subnets in which to create endpoint network interfaces. You must + * specify this property for an interface endpoint or a Gateway Load Balancer endpoint. You can't specify this + * property for a gateway endpoint. For a Gateway Load Balancer endpoint, you can specify only one subnet. + * + * @param subnetIds the subnetIds value to set. + * @return the AwsEc2VpcEndpointProperties object itself. + */ + public AwsEc2VpcEndpointProperties withSubnetIds(List subnetIds) { + this.subnetIds = subnetIds; + return this; + } + + /** + * Get the vpcEndpointType property: The type of endpoint. Default: Gateway. + * + * @return the vpcEndpointType value. + */ + public VpcEndpointType vpcEndpointType() { + return this.vpcEndpointType; + } + + /** + * Set the vpcEndpointType property: The type of endpoint. Default: Gateway. + * + * @param vpcEndpointType the vpcEndpointType value to set. + * @return the AwsEc2VpcEndpointProperties object itself. + */ + public AwsEc2VpcEndpointProperties withVpcEndpointType(VpcEndpointType vpcEndpointType) { + this.vpcEndpointType = vpcEndpointType; + return this; + } + + /** + * Get the vpcId property: The ID of the VPC. + * + * @return the vpcId value. + */ + public String vpcId() { + return this.vpcId; + } + + /** + * Set the vpcId property: The ID of the VPC. + * + * @param vpcId the vpcId value to set. + * @return the AwsEc2VpcEndpointProperties object itself. + */ + public AwsEc2VpcEndpointProperties withVpcId(String vpcId) { + this.vpcId = vpcId; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("creationTimestamp", this.creationTimestamp); + jsonWriter.writeArrayField("dnsEntries", this.dnsEntries, (writer, element) -> writer.writeString(element)); + jsonWriter.writeStringField("id", this.id); + jsonWriter.writeArrayField("networkInterfaceIds", this.networkInterfaceIds, + (writer, element) -> writer.writeString(element)); + jsonWriter.writeMapField("policyDocument", this.policyDocument, + (writer, element) -> writer.writeUntyped(element)); + jsonWriter.writeBooleanField("privateDnsEnabled", this.privateDnsEnabled); + jsonWriter.writeArrayField("routeTableIds", this.routeTableIds, + (writer, element) -> writer.writeString(element)); + jsonWriter.writeArrayField("securityGroupIds", this.securityGroupIds, + (writer, element) -> writer.writeString(element)); + jsonWriter.writeStringField("serviceName", this.serviceName); + jsonWriter.writeArrayField("subnetIds", this.subnetIds, (writer, element) -> writer.writeString(element)); + jsonWriter.writeStringField("vpcEndpointType", + this.vpcEndpointType == null ? null : this.vpcEndpointType.toString()); + jsonWriter.writeStringField("vpcId", this.vpcId); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AwsEc2VpcEndpointProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AwsEc2VpcEndpointProperties if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the AwsEc2VpcEndpointProperties. + */ + public static AwsEc2VpcEndpointProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AwsEc2VpcEndpointProperties deserializedAwsEc2VpcEndpointProperties = new AwsEc2VpcEndpointProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("creationTimestamp".equals(fieldName)) { + deserializedAwsEc2VpcEndpointProperties.creationTimestamp = reader.getString(); + } else if ("dnsEntries".equals(fieldName)) { + List dnsEntries = reader.readArray(reader1 -> reader1.getString()); + deserializedAwsEc2VpcEndpointProperties.dnsEntries = dnsEntries; + } else if ("id".equals(fieldName)) { + deserializedAwsEc2VpcEndpointProperties.id = reader.getString(); + } else if ("networkInterfaceIds".equals(fieldName)) { + List networkInterfaceIds = reader.readArray(reader1 -> reader1.getString()); + deserializedAwsEc2VpcEndpointProperties.networkInterfaceIds = networkInterfaceIds; + } else if ("policyDocument".equals(fieldName)) { + Map policyDocument = reader.readMap(reader1 -> reader1.readUntyped()); + deserializedAwsEc2VpcEndpointProperties.policyDocument = policyDocument; + } else if ("privateDnsEnabled".equals(fieldName)) { + deserializedAwsEc2VpcEndpointProperties.privateDnsEnabled + = reader.getNullable(JsonReader::getBoolean); + } else if ("routeTableIds".equals(fieldName)) { + List routeTableIds = reader.readArray(reader1 -> reader1.getString()); + deserializedAwsEc2VpcEndpointProperties.routeTableIds = routeTableIds; + } else if ("securityGroupIds".equals(fieldName)) { + List securityGroupIds = reader.readArray(reader1 -> reader1.getString()); + deserializedAwsEc2VpcEndpointProperties.securityGroupIds = securityGroupIds; + } else if ("serviceName".equals(fieldName)) { + deserializedAwsEc2VpcEndpointProperties.serviceName = reader.getString(); + } else if ("subnetIds".equals(fieldName)) { + List subnetIds = reader.readArray(reader1 -> reader1.getString()); + deserializedAwsEc2VpcEndpointProperties.subnetIds = subnetIds; + } else if ("vpcEndpointType".equals(fieldName)) { + deserializedAwsEc2VpcEndpointProperties.vpcEndpointType + = VpcEndpointType.fromString(reader.getString()); + } else if ("vpcId".equals(fieldName)) { + deserializedAwsEc2VpcEndpointProperties.vpcId = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedAwsEc2VpcEndpointProperties; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/AwsEc2VpcPeeringConnectionProperties.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/AwsEc2VpcPeeringConnectionProperties.java new file mode 100644 index 000000000000..ef0e58c73380 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/AwsEc2VpcPeeringConnectionProperties.java @@ -0,0 +1,276 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Definition of awsEc2VPCPeeringConnection. + */ +@Fluent +public final class AwsEc2VpcPeeringConnectionProperties + implements JsonSerializable { + /* + * Property id + */ + private String id; + + /* + * The AWS account ID of the owner of the accepter VPC. + */ + private String peerOwnerId; + + /* + * The Region code for the accepter VPC, if the accepter VPC is located in a Region other than the Region in which + * you make the request. + */ + private String peerRegion; + + /* + * The Amazon Resource Name (ARN) of the VPC peer role for the peering connection in another AWS account. + */ + private String peerRoleArn; + + /* + * The ID of the VPC with which you are creating the VPC peering connection. You must specify this parameter in the + * request. + */ + private String peerVpcId; + + /* + * Property tags + */ + private List tags; + + /* + * The ID of the VPC. + */ + private String vpcId; + + /** + * Creates an instance of AwsEc2VpcPeeringConnectionProperties class. + */ + public AwsEc2VpcPeeringConnectionProperties() { + } + + /** + * Get the id property: Property id. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Set the id property: Property id. + * + * @param id the id value to set. + * @return the AwsEc2VpcPeeringConnectionProperties object itself. + */ + public AwsEc2VpcPeeringConnectionProperties withId(String id) { + this.id = id; + return this; + } + + /** + * Get the peerOwnerId property: The AWS account ID of the owner of the accepter VPC. + * + * @return the peerOwnerId value. + */ + public String peerOwnerId() { + return this.peerOwnerId; + } + + /** + * Set the peerOwnerId property: The AWS account ID of the owner of the accepter VPC. + * + * @param peerOwnerId the peerOwnerId value to set. + * @return the AwsEc2VpcPeeringConnectionProperties object itself. + */ + public AwsEc2VpcPeeringConnectionProperties withPeerOwnerId(String peerOwnerId) { + this.peerOwnerId = peerOwnerId; + return this; + } + + /** + * Get the peerRegion property: The Region code for the accepter VPC, if the accepter VPC is located in a Region + * other than the Region in which you make the request. + * + * @return the peerRegion value. + */ + public String peerRegion() { + return this.peerRegion; + } + + /** + * Set the peerRegion property: The Region code for the accepter VPC, if the accepter VPC is located in a Region + * other than the Region in which you make the request. + * + * @param peerRegion the peerRegion value to set. + * @return the AwsEc2VpcPeeringConnectionProperties object itself. + */ + public AwsEc2VpcPeeringConnectionProperties withPeerRegion(String peerRegion) { + this.peerRegion = peerRegion; + return this; + } + + /** + * Get the peerRoleArn property: The Amazon Resource Name (ARN) of the VPC peer role for the peering connection in + * another AWS account. + * + * @return the peerRoleArn value. + */ + public String peerRoleArn() { + return this.peerRoleArn; + } + + /** + * Set the peerRoleArn property: The Amazon Resource Name (ARN) of the VPC peer role for the peering connection in + * another AWS account. + * + * @param peerRoleArn the peerRoleArn value to set. + * @return the AwsEc2VpcPeeringConnectionProperties object itself. + */ + public AwsEc2VpcPeeringConnectionProperties withPeerRoleArn(String peerRoleArn) { + this.peerRoleArn = peerRoleArn; + return this; + } + + /** + * Get the peerVpcId property: The ID of the VPC with which you are creating the VPC peering connection. You must + * specify this parameter in the request. + * + * @return the peerVpcId value. + */ + public String peerVpcId() { + return this.peerVpcId; + } + + /** + * Set the peerVpcId property: The ID of the VPC with which you are creating the VPC peering connection. You must + * specify this parameter in the request. + * + * @param peerVpcId the peerVpcId value to set. + * @return the AwsEc2VpcPeeringConnectionProperties object itself. + */ + public AwsEc2VpcPeeringConnectionProperties withPeerVpcId(String peerVpcId) { + this.peerVpcId = peerVpcId; + return this; + } + + /** + * Get the tags property: Property tags. + * + * @return the tags value. + */ + public List tags() { + return this.tags; + } + + /** + * Set the tags property: Property tags. + * + * @param tags the tags value to set. + * @return the AwsEc2VpcPeeringConnectionProperties object itself. + */ + public AwsEc2VpcPeeringConnectionProperties withTags(List tags) { + this.tags = tags; + return this; + } + + /** + * Get the vpcId property: The ID of the VPC. + * + * @return the vpcId value. + */ + public String vpcId() { + return this.vpcId; + } + + /** + * Set the vpcId property: The ID of the VPC. + * + * @param vpcId the vpcId value to set. + * @return the AwsEc2VpcPeeringConnectionProperties object itself. + */ + public AwsEc2VpcPeeringConnectionProperties withVpcId(String vpcId) { + this.vpcId = vpcId; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (tags() != null) { + tags().forEach(e -> e.validate()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("id", this.id); + jsonWriter.writeStringField("peerOwnerId", this.peerOwnerId); + jsonWriter.writeStringField("peerRegion", this.peerRegion); + jsonWriter.writeStringField("peerRoleArn", this.peerRoleArn); + jsonWriter.writeStringField("peerVpcId", this.peerVpcId); + jsonWriter.writeArrayField("tags", this.tags, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("vpcId", this.vpcId); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AwsEc2VpcPeeringConnectionProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AwsEc2VpcPeeringConnectionProperties if the JsonReader was pointing to an instance of it, + * or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the AwsEc2VpcPeeringConnectionProperties. + */ + public static AwsEc2VpcPeeringConnectionProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AwsEc2VpcPeeringConnectionProperties deserializedAwsEc2VpcPeeringConnectionProperties + = new AwsEc2VpcPeeringConnectionProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedAwsEc2VpcPeeringConnectionProperties.id = reader.getString(); + } else if ("peerOwnerId".equals(fieldName)) { + deserializedAwsEc2VpcPeeringConnectionProperties.peerOwnerId = reader.getString(); + } else if ("peerRegion".equals(fieldName)) { + deserializedAwsEc2VpcPeeringConnectionProperties.peerRegion = reader.getString(); + } else if ("peerRoleArn".equals(fieldName)) { + deserializedAwsEc2VpcPeeringConnectionProperties.peerRoleArn = reader.getString(); + } else if ("peerVpcId".equals(fieldName)) { + deserializedAwsEc2VpcPeeringConnectionProperties.peerVpcId = reader.getString(); + } else if ("tags".equals(fieldName)) { + List tags = reader.readArray(reader1 -> TagAutoGenerated23.fromJson(reader1)); + deserializedAwsEc2VpcPeeringConnectionProperties.tags = tags; + } else if ("vpcId".equals(fieldName)) { + deserializedAwsEc2VpcPeeringConnectionProperties.vpcId = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedAwsEc2VpcPeeringConnectionProperties; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/AwsEc2VpcProperties.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/AwsEc2VpcProperties.java new file mode 100644 index 000000000000..4f9ee9873e8e --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/AwsEc2VpcProperties.java @@ -0,0 +1,469 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Definition of awsEc2Vpc. + */ +@Fluent +public final class AwsEc2VpcProperties implements JsonSerializable { + /* + * The IPv4 network range for the VPC, in CIDR notation. For example, ``10.0.0.0/16``. We modify the specified CIDR + * block to its canonical form; for example, if you specify ``100.68.0.18/18``, we modify it to ``100.68.0.0/18``. + * You must specify either``CidrBlock`` or ``Ipv4IpamPoolId``. + */ + private String cidrBlock; + + /* + * Property cidrBlockAssociations + */ + private List cidrBlockAssociations; + + /* + * Property defaultNetworkAcl + */ + private String defaultNetworkAcl; + + /* + * Property defaultSecurityGroup + */ + private String defaultSecurityGroup; + + /* + * Indicates whether the instances launched in the VPC get DNS hostnames. If enabled, instances in the VPC get DNS + * hostnames; otherwise, they do not. Disabled by default for nondefault VPCs. For more information, see [DNS + * attributes in your VPC](https://docs.aws.amazon.com/vpc/latest/userguide/vpc-dns.html#vpc-dns-support). You can + * only enable DNS hostnames if you've enabled DNS support. + */ + private Boolean enableDnsHostnames; + + /* + * Indicates whether the DNS resolution is supported for the VPC. If enabled, queries to the Amazon provided DNS + * server at the 169.254.169.253 IP address, or the reserved IP address at the base of the VPC network range 'plus + * two' succeed. If disabled, the Amazon provided DNS service in the VPC that resolves public DNS hostnames to IP + * addresses is not enabled. Enabled by default. For more information, see [DNS attributes in your + * VPC](https://docs.aws.amazon.com/vpc/latest/userguide/vpc-dns.html#vpc-dns-support). + */ + private Boolean enableDnsSupport; + + /* + * The allowed tenancy of instances launched into the VPC. + ``default``: An instance launched into the VPC runs on + * shared hardware by default, unless you explicitly specify a different tenancy during instance launch. + + * ``dedicated``: An instance launched into the VPC runs on dedicated hardware by default, unless you explicitly + * specify a tenancy of ``host`` during instance launch. You cannot specify a tenancy of ``default`` during instance + * launch. Updating ``InstanceTenancy`` requires no replacement only if you are updating its value from + * ``dedicated`` to ``default``. Updating ``InstanceTenancy`` from ``default`` to ``dedicated`` requires + * replacement. + */ + private String instanceTenancy; + + /* + * The ID of an IPv4 IPAM pool you want to use for allocating this VPC's CIDR. For more information, see [What is + * IPAM?](https://docs.aws.amazon.com//vpc/latest/ipam/what-is-it-ipam.html) in the *Amazon VPC IPAM User Guide*. + * You must specify either``CidrBlock`` or ``Ipv4IpamPoolId``. + */ + private String ipv4IpamPoolId; + + /* + * The netmask length of the IPv4 CIDR you want to allocate to this VPC from an Amazon VPC IP Address Manager (IPAM) + * pool. For more information about IPAM, see [What is + * IPAM?](https://docs.aws.amazon.com//vpc/latest/ipam/what-is-it-ipam.html) in the *Amazon VPC IPAM User Guide*. + */ + private Integer ipv4NetmaskLength; + + /* + * Property ipv6CidrBlocks + */ + private List ipv6CidrBlocks; + + /* + * The tags for the VPC. + */ + private List tags; + + /* + * Property vpcId + */ + private String vpcId; + + /** + * Creates an instance of AwsEc2VpcProperties class. + */ + public AwsEc2VpcProperties() { + } + + /** + * Get the cidrBlock property: The IPv4 network range for the VPC, in CIDR notation. For example, ``10.0.0.0/16``. + * We modify the specified CIDR block to its canonical form; for example, if you specify ``100.68.0.18/18``, we + * modify it to ``100.68.0.0/18``. You must specify either``CidrBlock`` or ``Ipv4IpamPoolId``. + * + * @return the cidrBlock value. + */ + public String cidrBlock() { + return this.cidrBlock; + } + + /** + * Set the cidrBlock property: The IPv4 network range for the VPC, in CIDR notation. For example, ``10.0.0.0/16``. + * We modify the specified CIDR block to its canonical form; for example, if you specify ``100.68.0.18/18``, we + * modify it to ``100.68.0.0/18``. You must specify either``CidrBlock`` or ``Ipv4IpamPoolId``. + * + * @param cidrBlock the cidrBlock value to set. + * @return the AwsEc2VpcProperties object itself. + */ + public AwsEc2VpcProperties withCidrBlock(String cidrBlock) { + this.cidrBlock = cidrBlock; + return this; + } + + /** + * Get the cidrBlockAssociations property: Property cidrBlockAssociations. + * + * @return the cidrBlockAssociations value. + */ + public List cidrBlockAssociations() { + return this.cidrBlockAssociations; + } + + /** + * Set the cidrBlockAssociations property: Property cidrBlockAssociations. + * + * @param cidrBlockAssociations the cidrBlockAssociations value to set. + * @return the AwsEc2VpcProperties object itself. + */ + public AwsEc2VpcProperties withCidrBlockAssociations(List cidrBlockAssociations) { + this.cidrBlockAssociations = cidrBlockAssociations; + return this; + } + + /** + * Get the defaultNetworkAcl property: Property defaultNetworkAcl. + * + * @return the defaultNetworkAcl value. + */ + public String defaultNetworkAcl() { + return this.defaultNetworkAcl; + } + + /** + * Set the defaultNetworkAcl property: Property defaultNetworkAcl. + * + * @param defaultNetworkAcl the defaultNetworkAcl value to set. + * @return the AwsEc2VpcProperties object itself. + */ + public AwsEc2VpcProperties withDefaultNetworkAcl(String defaultNetworkAcl) { + this.defaultNetworkAcl = defaultNetworkAcl; + return this; + } + + /** + * Get the defaultSecurityGroup property: Property defaultSecurityGroup. + * + * @return the defaultSecurityGroup value. + */ + public String defaultSecurityGroup() { + return this.defaultSecurityGroup; + } + + /** + * Set the defaultSecurityGroup property: Property defaultSecurityGroup. + * + * @param defaultSecurityGroup the defaultSecurityGroup value to set. + * @return the AwsEc2VpcProperties object itself. + */ + public AwsEc2VpcProperties withDefaultSecurityGroup(String defaultSecurityGroup) { + this.defaultSecurityGroup = defaultSecurityGroup; + return this; + } + + /** + * Get the enableDnsHostnames property: Indicates whether the instances launched in the VPC get DNS hostnames. If + * enabled, instances in the VPC get DNS hostnames; otherwise, they do not. Disabled by default for nondefault VPCs. + * For more information, see [DNS attributes in your + * VPC](https://docs.aws.amazon.com/vpc/latest/userguide/vpc-dns.html#vpc-dns-support). You can only enable DNS + * hostnames if you've enabled DNS support. + * + * @return the enableDnsHostnames value. + */ + public Boolean enableDnsHostnames() { + return this.enableDnsHostnames; + } + + /** + * Set the enableDnsHostnames property: Indicates whether the instances launched in the VPC get DNS hostnames. If + * enabled, instances in the VPC get DNS hostnames; otherwise, they do not. Disabled by default for nondefault VPCs. + * For more information, see [DNS attributes in your + * VPC](https://docs.aws.amazon.com/vpc/latest/userguide/vpc-dns.html#vpc-dns-support). You can only enable DNS + * hostnames if you've enabled DNS support. + * + * @param enableDnsHostnames the enableDnsHostnames value to set. + * @return the AwsEc2VpcProperties object itself. + */ + public AwsEc2VpcProperties withEnableDnsHostnames(Boolean enableDnsHostnames) { + this.enableDnsHostnames = enableDnsHostnames; + return this; + } + + /** + * Get the enableDnsSupport property: Indicates whether the DNS resolution is supported for the VPC. If enabled, + * queries to the Amazon provided DNS server at the 169.254.169.253 IP address, or the reserved IP address at the + * base of the VPC network range 'plus two' succeed. If disabled, the Amazon provided DNS service in the VPC that + * resolves public DNS hostnames to IP addresses is not enabled. Enabled by default. For more information, see [DNS + * attributes in your VPC](https://docs.aws.amazon.com/vpc/latest/userguide/vpc-dns.html#vpc-dns-support). + * + * @return the enableDnsSupport value. + */ + public Boolean enableDnsSupport() { + return this.enableDnsSupport; + } + + /** + * Set the enableDnsSupport property: Indicates whether the DNS resolution is supported for the VPC. If enabled, + * queries to the Amazon provided DNS server at the 169.254.169.253 IP address, or the reserved IP address at the + * base of the VPC network range 'plus two' succeed. If disabled, the Amazon provided DNS service in the VPC that + * resolves public DNS hostnames to IP addresses is not enabled. Enabled by default. For more information, see [DNS + * attributes in your VPC](https://docs.aws.amazon.com/vpc/latest/userguide/vpc-dns.html#vpc-dns-support). + * + * @param enableDnsSupport the enableDnsSupport value to set. + * @return the AwsEc2VpcProperties object itself. + */ + public AwsEc2VpcProperties withEnableDnsSupport(Boolean enableDnsSupport) { + this.enableDnsSupport = enableDnsSupport; + return this; + } + + /** + * Get the instanceTenancy property: The allowed tenancy of instances launched into the VPC. + ``default``: An + * instance launched into the VPC runs on shared hardware by default, unless you explicitly specify a different + * tenancy during instance launch. + ``dedicated``: An instance launched into the VPC runs on dedicated hardware by + * default, unless you explicitly specify a tenancy of ``host`` during instance launch. You cannot specify a tenancy + * of ``default`` during instance launch. Updating ``InstanceTenancy`` requires no replacement only if you are + * updating its value from ``dedicated`` to ``default``. Updating ``InstanceTenancy`` from ``default`` to + * ``dedicated`` requires replacement. + * + * @return the instanceTenancy value. + */ + public String instanceTenancy() { + return this.instanceTenancy; + } + + /** + * Set the instanceTenancy property: The allowed tenancy of instances launched into the VPC. + ``default``: An + * instance launched into the VPC runs on shared hardware by default, unless you explicitly specify a different + * tenancy during instance launch. + ``dedicated``: An instance launched into the VPC runs on dedicated hardware by + * default, unless you explicitly specify a tenancy of ``host`` during instance launch. You cannot specify a tenancy + * of ``default`` during instance launch. Updating ``InstanceTenancy`` requires no replacement only if you are + * updating its value from ``dedicated`` to ``default``. Updating ``InstanceTenancy`` from ``default`` to + * ``dedicated`` requires replacement. + * + * @param instanceTenancy the instanceTenancy value to set. + * @return the AwsEc2VpcProperties object itself. + */ + public AwsEc2VpcProperties withInstanceTenancy(String instanceTenancy) { + this.instanceTenancy = instanceTenancy; + return this; + } + + /** + * Get the ipv4IpamPoolId property: The ID of an IPv4 IPAM pool you want to use for allocating this VPC's CIDR. For + * more information, see [What is IPAM?](https://docs.aws.amazon.com//vpc/latest/ipam/what-is-it-ipam.html) in the + * *Amazon VPC IPAM User Guide*. You must specify either``CidrBlock`` or ``Ipv4IpamPoolId``. + * + * @return the ipv4IpamPoolId value. + */ + public String ipv4IpamPoolId() { + return this.ipv4IpamPoolId; + } + + /** + * Set the ipv4IpamPoolId property: The ID of an IPv4 IPAM pool you want to use for allocating this VPC's CIDR. For + * more information, see [What is IPAM?](https://docs.aws.amazon.com//vpc/latest/ipam/what-is-it-ipam.html) in the + * *Amazon VPC IPAM User Guide*. You must specify either``CidrBlock`` or ``Ipv4IpamPoolId``. + * + * @param ipv4IpamPoolId the ipv4IpamPoolId value to set. + * @return the AwsEc2VpcProperties object itself. + */ + public AwsEc2VpcProperties withIpv4IpamPoolId(String ipv4IpamPoolId) { + this.ipv4IpamPoolId = ipv4IpamPoolId; + return this; + } + + /** + * Get the ipv4NetmaskLength property: The netmask length of the IPv4 CIDR you want to allocate to this VPC from an + * Amazon VPC IP Address Manager (IPAM) pool. For more information about IPAM, see [What is + * IPAM?](https://docs.aws.amazon.com//vpc/latest/ipam/what-is-it-ipam.html) in the *Amazon VPC IPAM User Guide*. + * + * @return the ipv4NetmaskLength value. + */ + public Integer ipv4NetmaskLength() { + return this.ipv4NetmaskLength; + } + + /** + * Set the ipv4NetmaskLength property: The netmask length of the IPv4 CIDR you want to allocate to this VPC from an + * Amazon VPC IP Address Manager (IPAM) pool. For more information about IPAM, see [What is + * IPAM?](https://docs.aws.amazon.com//vpc/latest/ipam/what-is-it-ipam.html) in the *Amazon VPC IPAM User Guide*. + * + * @param ipv4NetmaskLength the ipv4NetmaskLength value to set. + * @return the AwsEc2VpcProperties object itself. + */ + public AwsEc2VpcProperties withIpv4NetmaskLength(Integer ipv4NetmaskLength) { + this.ipv4NetmaskLength = ipv4NetmaskLength; + return this; + } + + /** + * Get the ipv6CidrBlocks property: Property ipv6CidrBlocks. + * + * @return the ipv6CidrBlocks value. + */ + public List ipv6CidrBlocks() { + return this.ipv6CidrBlocks; + } + + /** + * Set the ipv6CidrBlocks property: Property ipv6CidrBlocks. + * + * @param ipv6CidrBlocks the ipv6CidrBlocks value to set. + * @return the AwsEc2VpcProperties object itself. + */ + public AwsEc2VpcProperties withIpv6CidrBlocks(List ipv6CidrBlocks) { + this.ipv6CidrBlocks = ipv6CidrBlocks; + return this; + } + + /** + * Get the tags property: The tags for the VPC. + * + * @return the tags value. + */ + public List tags() { + return this.tags; + } + + /** + * Set the tags property: The tags for the VPC. + * + * @param tags the tags value to set. + * @return the AwsEc2VpcProperties object itself. + */ + public AwsEc2VpcProperties withTags(List tags) { + this.tags = tags; + return this; + } + + /** + * Get the vpcId property: Property vpcId. + * + * @return the vpcId value. + */ + public String vpcId() { + return this.vpcId; + } + + /** + * Set the vpcId property: Property vpcId. + * + * @param vpcId the vpcId value to set. + * @return the AwsEc2VpcProperties object itself. + */ + public AwsEc2VpcProperties withVpcId(String vpcId) { + this.vpcId = vpcId; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (tags() != null) { + tags().forEach(e -> e.validate()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("cidrBlock", this.cidrBlock); + jsonWriter.writeArrayField("cidrBlockAssociations", this.cidrBlockAssociations, + (writer, element) -> writer.writeString(element)); + jsonWriter.writeStringField("defaultNetworkAcl", this.defaultNetworkAcl); + jsonWriter.writeStringField("defaultSecurityGroup", this.defaultSecurityGroup); + jsonWriter.writeBooleanField("enableDnsHostnames", this.enableDnsHostnames); + jsonWriter.writeBooleanField("enableDnsSupport", this.enableDnsSupport); + jsonWriter.writeStringField("instanceTenancy", this.instanceTenancy); + jsonWriter.writeStringField("ipv4IpamPoolId", this.ipv4IpamPoolId); + jsonWriter.writeNumberField("ipv4NetmaskLength", this.ipv4NetmaskLength); + jsonWriter.writeArrayField("ipv6CidrBlocks", this.ipv6CidrBlocks, + (writer, element) -> writer.writeString(element)); + jsonWriter.writeArrayField("tags", this.tags, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("vpcId", this.vpcId); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AwsEc2VpcProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AwsEc2VpcProperties if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the AwsEc2VpcProperties. + */ + public static AwsEc2VpcProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AwsEc2VpcProperties deserializedAwsEc2VpcProperties = new AwsEc2VpcProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("cidrBlock".equals(fieldName)) { + deserializedAwsEc2VpcProperties.cidrBlock = reader.getString(); + } else if ("cidrBlockAssociations".equals(fieldName)) { + List cidrBlockAssociations = reader.readArray(reader1 -> reader1.getString()); + deserializedAwsEc2VpcProperties.cidrBlockAssociations = cidrBlockAssociations; + } else if ("defaultNetworkAcl".equals(fieldName)) { + deserializedAwsEc2VpcProperties.defaultNetworkAcl = reader.getString(); + } else if ("defaultSecurityGroup".equals(fieldName)) { + deserializedAwsEc2VpcProperties.defaultSecurityGroup = reader.getString(); + } else if ("enableDnsHostnames".equals(fieldName)) { + deserializedAwsEc2VpcProperties.enableDnsHostnames = reader.getNullable(JsonReader::getBoolean); + } else if ("enableDnsSupport".equals(fieldName)) { + deserializedAwsEc2VpcProperties.enableDnsSupport = reader.getNullable(JsonReader::getBoolean); + } else if ("instanceTenancy".equals(fieldName)) { + deserializedAwsEc2VpcProperties.instanceTenancy = reader.getString(); + } else if ("ipv4IpamPoolId".equals(fieldName)) { + deserializedAwsEc2VpcProperties.ipv4IpamPoolId = reader.getString(); + } else if ("ipv4NetmaskLength".equals(fieldName)) { + deserializedAwsEc2VpcProperties.ipv4NetmaskLength = reader.getNullable(JsonReader::getInt); + } else if ("ipv6CidrBlocks".equals(fieldName)) { + List ipv6CidrBlocks = reader.readArray(reader1 -> reader1.getString()); + deserializedAwsEc2VpcProperties.ipv6CidrBlocks = ipv6CidrBlocks; + } else if ("tags".equals(fieldName)) { + List tags = reader.readArray(reader1 -> TagAutoGenerated22.fromJson(reader1)); + deserializedAwsEc2VpcProperties.tags = tags; + } else if ("vpcId".equals(fieldName)) { + deserializedAwsEc2VpcProperties.vpcId = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedAwsEc2VpcProperties; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/AwsEcrImageDetailProperties.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/AwsEcrImageDetailProperties.java new file mode 100644 index 000000000000..8a0386209142 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/AwsEcrImageDetailProperties.java @@ -0,0 +1,429 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.time.OffsetDateTime; +import java.time.format.DateTimeFormatter; +import java.util.List; + +/** + * Definition of awsEcrImageDetail. + */ +@Fluent +public final class AwsEcrImageDetailProperties implements JsonSerializable { + /* + *

The artifact media type of the image.

+ */ + private String artifactMediaType; + + /* + *

The sha256 digest of the image manifest.

+ */ + private String imageDigest; + + /* + *

The media type of the image manifest.

+ */ + private String imageManifestMediaType; + + /* + *

The date and time, expressed in standard JavaScript date format, at which the current image was pushed to the + * repository.

+ */ + private OffsetDateTime imagePushedAt; + + /* + *

A summary of the last completed image scan.

+ */ + private ImageScanFindingsSummary imageScanFindingsSummary; + + /* + *

The current state of the scan.

+ */ + private ImageScanStatus imageScanStatus; + + /* + *

The size, in bytes, of the image in the repository.

If the image is a manifest list, this will be the + * max size of all manifests in the list.

Beginning with Docker version 1.9, the Docker client + * compresses image layers before pushing them to a V2 Docker registry. The output of the docker images + * command shows the uncompressed image size, so it may return a larger image size than the image sizes returned by + * DescribeImages.

+ */ + private Long imageSizeInBytes; + + /* + *

The list of tags associated with this image.

+ */ + private List imageTags; + + /* + *

The date and time, expressed in standard JavaScript date format, when Amazon ECR recorded the last image + * pull.

Amazon ECR refreshes the last image pull timestamp at least once every 24 hours. For example, + * if you pull an image once a day then the lastRecordedPullTime timestamp will indicate the exact time + * that the image was last pulled. However, if you pull an image once an hour, because Amazon ECR refreshes the + * lastRecordedPullTime timestamp at least once every 24 hours, the result may not be the exact time + * that the image was last pulled.

+ */ + private OffsetDateTime lastRecordedPullTime; + + /* + *

The Amazon Web Services account ID associated with the registry to which this image belongs.

+ */ + private String registryId; + + /* + *

The name of the repository to which this image belongs.

+ */ + private String repositoryName; + + /** + * Creates an instance of AwsEcrImageDetailProperties class. + */ + public AwsEcrImageDetailProperties() { + } + + /** + * Get the artifactMediaType property: <p>The artifact media type of the image.</p>. + * + * @return the artifactMediaType value. + */ + public String artifactMediaType() { + return this.artifactMediaType; + } + + /** + * Set the artifactMediaType property: <p>The artifact media type of the image.</p>. + * + * @param artifactMediaType the artifactMediaType value to set. + * @return the AwsEcrImageDetailProperties object itself. + */ + public AwsEcrImageDetailProperties withArtifactMediaType(String artifactMediaType) { + this.artifactMediaType = artifactMediaType; + return this; + } + + /** + * Get the imageDigest property: <p>The <code>sha256</code> digest of the image + * manifest.</p>. + * + * @return the imageDigest value. + */ + public String imageDigest() { + return this.imageDigest; + } + + /** + * Set the imageDigest property: <p>The <code>sha256</code> digest of the image + * manifest.</p>. + * + * @param imageDigest the imageDigest value to set. + * @return the AwsEcrImageDetailProperties object itself. + */ + public AwsEcrImageDetailProperties withImageDigest(String imageDigest) { + this.imageDigest = imageDigest; + return this; + } + + /** + * Get the imageManifestMediaType property: <p>The media type of the image manifest.</p>. + * + * @return the imageManifestMediaType value. + */ + public String imageManifestMediaType() { + return this.imageManifestMediaType; + } + + /** + * Set the imageManifestMediaType property: <p>The media type of the image manifest.</p>. + * + * @param imageManifestMediaType the imageManifestMediaType value to set. + * @return the AwsEcrImageDetailProperties object itself. + */ + public AwsEcrImageDetailProperties withImageManifestMediaType(String imageManifestMediaType) { + this.imageManifestMediaType = imageManifestMediaType; + return this; + } + + /** + * Get the imagePushedAt property: <p>The date and time, expressed in standard JavaScript date format, at + * which the current image was pushed to the repository. </p>. + * + * @return the imagePushedAt value. + */ + public OffsetDateTime imagePushedAt() { + return this.imagePushedAt; + } + + /** + * Set the imagePushedAt property: <p>The date and time, expressed in standard JavaScript date format, at + * which the current image was pushed to the repository. </p>. + * + * @param imagePushedAt the imagePushedAt value to set. + * @return the AwsEcrImageDetailProperties object itself. + */ + public AwsEcrImageDetailProperties withImagePushedAt(OffsetDateTime imagePushedAt) { + this.imagePushedAt = imagePushedAt; + return this; + } + + /** + * Get the imageScanFindingsSummary property: <p>A summary of the last completed image scan.</p>. + * + * @return the imageScanFindingsSummary value. + */ + public ImageScanFindingsSummary imageScanFindingsSummary() { + return this.imageScanFindingsSummary; + } + + /** + * Set the imageScanFindingsSummary property: <p>A summary of the last completed image scan.</p>. + * + * @param imageScanFindingsSummary the imageScanFindingsSummary value to set. + * @return the AwsEcrImageDetailProperties object itself. + */ + public AwsEcrImageDetailProperties withImageScanFindingsSummary(ImageScanFindingsSummary imageScanFindingsSummary) { + this.imageScanFindingsSummary = imageScanFindingsSummary; + return this; + } + + /** + * Get the imageScanStatus property: <p>The current state of the scan.</p>. + * + * @return the imageScanStatus value. + */ + public ImageScanStatus imageScanStatus() { + return this.imageScanStatus; + } + + /** + * Set the imageScanStatus property: <p>The current state of the scan.</p>. + * + * @param imageScanStatus the imageScanStatus value to set. + * @return the AwsEcrImageDetailProperties object itself. + */ + public AwsEcrImageDetailProperties withImageScanStatus(ImageScanStatus imageScanStatus) { + this.imageScanStatus = imageScanStatus; + return this; + } + + /** + * Get the imageSizeInBytes property: <p>The size, in bytes, of the image in the repository.</p> + * <p>If the image is a manifest list, this will be the max size of all manifests in the list.</p> + * <note> <p>Beginning with Docker version 1.9, the Docker client compresses image layers before pushing + * them to a V2 Docker registry. The output of the <code>docker images</code> command shows the + * uncompressed image size, so it may return a larger image size than the image sizes returned by + * <a>DescribeImages</a>.</p> </note>. + * + * @return the imageSizeInBytes value. + */ + public Long imageSizeInBytes() { + return this.imageSizeInBytes; + } + + /** + * Set the imageSizeInBytes property: <p>The size, in bytes, of the image in the repository.</p> + * <p>If the image is a manifest list, this will be the max size of all manifests in the list.</p> + * <note> <p>Beginning with Docker version 1.9, the Docker client compresses image layers before pushing + * them to a V2 Docker registry. The output of the <code>docker images</code> command shows the + * uncompressed image size, so it may return a larger image size than the image sizes returned by + * <a>DescribeImages</a>.</p> </note>. + * + * @param imageSizeInBytes the imageSizeInBytes value to set. + * @return the AwsEcrImageDetailProperties object itself. + */ + public AwsEcrImageDetailProperties withImageSizeInBytes(Long imageSizeInBytes) { + this.imageSizeInBytes = imageSizeInBytes; + return this; + } + + /** + * Get the imageTags property: <p>The list of tags associated with this image.</p>. + * + * @return the imageTags value. + */ + public List imageTags() { + return this.imageTags; + } + + /** + * Set the imageTags property: <p>The list of tags associated with this image.</p>. + * + * @param imageTags the imageTags value to set. + * @return the AwsEcrImageDetailProperties object itself. + */ + public AwsEcrImageDetailProperties withImageTags(List imageTags) { + this.imageTags = imageTags; + return this; + } + + /** + * Get the lastRecordedPullTime property: <p>The date and time, expressed in standard JavaScript date format, + * when Amazon ECR recorded the last image pull.</p> <note> <p>Amazon ECR refreshes the last image + * pull timestamp at least once every 24 hours. For example, if you pull an image once a day then the + * <code>lastRecordedPullTime</code> timestamp will indicate the exact time that the image was last + * pulled. However, if you pull an image once an hour, because Amazon ECR refreshes the + * <code>lastRecordedPullTime</code> timestamp at least once every 24 hours, the result may not be the + * exact time that the image was last pulled.</p> </note>. + * + * @return the lastRecordedPullTime value. + */ + public OffsetDateTime lastRecordedPullTime() { + return this.lastRecordedPullTime; + } + + /** + * Set the lastRecordedPullTime property: <p>The date and time, expressed in standard JavaScript date format, + * when Amazon ECR recorded the last image pull.</p> <note> <p>Amazon ECR refreshes the last image + * pull timestamp at least once every 24 hours. For example, if you pull an image once a day then the + * <code>lastRecordedPullTime</code> timestamp will indicate the exact time that the image was last + * pulled. However, if you pull an image once an hour, because Amazon ECR refreshes the + * <code>lastRecordedPullTime</code> timestamp at least once every 24 hours, the result may not be the + * exact time that the image was last pulled.</p> </note>. + * + * @param lastRecordedPullTime the lastRecordedPullTime value to set. + * @return the AwsEcrImageDetailProperties object itself. + */ + public AwsEcrImageDetailProperties withLastRecordedPullTime(OffsetDateTime lastRecordedPullTime) { + this.lastRecordedPullTime = lastRecordedPullTime; + return this; + } + + /** + * Get the registryId property: <p>The Amazon Web Services account ID associated with the registry to which + * this image belongs.</p>. + * + * @return the registryId value. + */ + public String registryId() { + return this.registryId; + } + + /** + * Set the registryId property: <p>The Amazon Web Services account ID associated with the registry to which + * this image belongs.</p>. + * + * @param registryId the registryId value to set. + * @return the AwsEcrImageDetailProperties object itself. + */ + public AwsEcrImageDetailProperties withRegistryId(String registryId) { + this.registryId = registryId; + return this; + } + + /** + * Get the repositoryName property: <p>The name of the repository to which this image belongs.</p>. + * + * @return the repositoryName value. + */ + public String repositoryName() { + return this.repositoryName; + } + + /** + * Set the repositoryName property: <p>The name of the repository to which this image belongs.</p>. + * + * @param repositoryName the repositoryName value to set. + * @return the AwsEcrImageDetailProperties object itself. + */ + public AwsEcrImageDetailProperties withRepositoryName(String repositoryName) { + this.repositoryName = repositoryName; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (imageScanFindingsSummary() != null) { + imageScanFindingsSummary().validate(); + } + if (imageScanStatus() != null) { + imageScanStatus().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("artifactMediaType", this.artifactMediaType); + jsonWriter.writeStringField("imageDigest", this.imageDigest); + jsonWriter.writeStringField("imageManifestMediaType", this.imageManifestMediaType); + jsonWriter.writeStringField("imagePushedAt", + this.imagePushedAt == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.imagePushedAt)); + jsonWriter.writeJsonField("imageScanFindingsSummary", this.imageScanFindingsSummary); + jsonWriter.writeJsonField("imageScanStatus", this.imageScanStatus); + jsonWriter.writeNumberField("imageSizeInBytes", this.imageSizeInBytes); + jsonWriter.writeArrayField("imageTags", this.imageTags, (writer, element) -> writer.writeString(element)); + jsonWriter.writeStringField("lastRecordedPullTime", + this.lastRecordedPullTime == null + ? null + : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.lastRecordedPullTime)); + jsonWriter.writeStringField("registryId", this.registryId); + jsonWriter.writeStringField("repositoryName", this.repositoryName); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AwsEcrImageDetailProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AwsEcrImageDetailProperties if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the AwsEcrImageDetailProperties. + */ + public static AwsEcrImageDetailProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AwsEcrImageDetailProperties deserializedAwsEcrImageDetailProperties = new AwsEcrImageDetailProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("artifactMediaType".equals(fieldName)) { + deserializedAwsEcrImageDetailProperties.artifactMediaType = reader.getString(); + } else if ("imageDigest".equals(fieldName)) { + deserializedAwsEcrImageDetailProperties.imageDigest = reader.getString(); + } else if ("imageManifestMediaType".equals(fieldName)) { + deserializedAwsEcrImageDetailProperties.imageManifestMediaType = reader.getString(); + } else if ("imagePushedAt".equals(fieldName)) { + deserializedAwsEcrImageDetailProperties.imagePushedAt = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("imageScanFindingsSummary".equals(fieldName)) { + deserializedAwsEcrImageDetailProperties.imageScanFindingsSummary + = ImageScanFindingsSummary.fromJson(reader); + } else if ("imageScanStatus".equals(fieldName)) { + deserializedAwsEcrImageDetailProperties.imageScanStatus = ImageScanStatus.fromJson(reader); + } else if ("imageSizeInBytes".equals(fieldName)) { + deserializedAwsEcrImageDetailProperties.imageSizeInBytes = reader.getNullable(JsonReader::getLong); + } else if ("imageTags".equals(fieldName)) { + List imageTags = reader.readArray(reader1 -> reader1.getString()); + deserializedAwsEcrImageDetailProperties.imageTags = imageTags; + } else if ("lastRecordedPullTime".equals(fieldName)) { + deserializedAwsEcrImageDetailProperties.lastRecordedPullTime = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("registryId".equals(fieldName)) { + deserializedAwsEcrImageDetailProperties.registryId = reader.getString(); + } else if ("repositoryName".equals(fieldName)) { + deserializedAwsEcrImageDetailProperties.repositoryName = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedAwsEcrImageDetailProperties; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/AwsEcrRepositoryProperties.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/AwsEcrRepositoryProperties.java new file mode 100644 index 000000000000..9925f19c92ac --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/AwsEcrRepositoryProperties.java @@ -0,0 +1,455 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; +import java.util.Map; + +/** + * Definition of awsEcrRepository. + */ +@Fluent +public final class AwsEcrRepositoryProperties implements JsonSerializable { + /* + * Property arn + */ + private String arn; + + /* + * If true, deleting the repository force deletes the contents of the repository. If false, the repository must be + * empty before attempting to delete it. If true, deleting the repository force deletes the contents of the + * repository. Without a force delete, you can only delete empty repositories. + */ + private Boolean emptyOnDelete; + + /* + * The encryption configuration for the repository. This determines how the contents of your repository are + * encrypted at rest. The encryption configuration for the repository. This determines how the contents of your + * repository are encrypted at rest. By default, when no encryption configuration is set or the ``AES256`` + * encryption type is used, Amazon ECR uses server-side encryption with Amazon S3-managed encryption keys which + * encrypts your data at rest using an AES-256 encryption algorithm. This does not require any action on your part. + * For more control over the encryption of the contents of your repository, you can use server-side encryption with + * KMSlong key stored in KMSlong (KMS) to encrypt your images. For more information, see [Amazon ECR encryption at + * rest](https://docs.aws.amazon.com/AmazonECR/latest/userguide/encryption-at-rest.html) in the *Amazon Elastic + * Container Registry User Guide*. + */ + private EncryptionConfiguration encryptionConfiguration; + + /* + * The image scanning configuration for the repository. This determines whether images are scanned for known + * vulnerabilities after being pushed to the repository. The image scanning configuration for a repository. + */ + private ImageScanningConfiguration imageScanningConfiguration; + + /* + * The tag mutability setting for the repository. If this parameter is omitted, the default setting of ``MUTABLE`` + * will be used which will allow image tags to be overwritten. If ``IMMUTABLE`` is specified, all image tags within + * the repository will be immutable which will prevent them from being overwritten. + */ + private ImageTagMutability imageTagMutability; + + /* + * Creates or updates a lifecycle policy. For information about lifecycle policy syntax, see [Lifecycle policy + * template](https://docs.aws.amazon.com/AmazonECR/latest/userguide/LifecyclePolicies.html). The ``LifecyclePolicy`` + * property type specifies a lifecycle policy. For information about lifecycle policy syntax, see [Lifecycle policy + * template](https://docs.aws.amazon.com/AmazonECR/latest/userguide/LifecyclePolicies.html) in the *Amazon ECR User + * Guide*. + */ + private LifecyclePolicy lifecyclePolicy; + + /* + * The name to use for the repository. The repository name may be specified on its own (such as ``nginx-web-app``) + * or it can be prepended with a namespace to group the repository into a category (such as + * ``project-a/nginx-web-app``). If you don't specify a name, CFNlong generates a unique physical ID and uses that + * ID for the repository name. For more information, see [Name + * type](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-name.html). The repository + * name must start with a letter and can only contain lowercase letters, numbers, hyphens, underscores, and forward + * slashes. If you specify a name, you cannot perform updates that require replacement of this resource. You can + * perform updates that require no or some interruption. If you must replace the resource, specify a new name. + */ + private String repositoryName; + + /* + * The JSON repository policy text to apply to the repository. For more information, see [Amazon ECR repository + * policies](https://docs.aws.amazon.com/AmazonECR/latest/userguide/repository-policy-examples.html) in the *Amazon + * Elastic Container Registry User Guide*. + */ + private Map repositoryPolicyText; + + /* + * Property repositoryUri + */ + private String repositoryUri; + + /* + * An array of key-value pairs to apply to this resource. + */ + private List tags; + + /** + * Creates an instance of AwsEcrRepositoryProperties class. + */ + public AwsEcrRepositoryProperties() { + } + + /** + * Get the arn property: Property arn. + * + * @return the arn value. + */ + public String arn() { + return this.arn; + } + + /** + * Set the arn property: Property arn. + * + * @param arn the arn value to set. + * @return the AwsEcrRepositoryProperties object itself. + */ + public AwsEcrRepositoryProperties withArn(String arn) { + this.arn = arn; + return this; + } + + /** + * Get the emptyOnDelete property: If true, deleting the repository force deletes the contents of the repository. If + * false, the repository must be empty before attempting to delete it. If true, deleting the repository force + * deletes the contents of the repository. Without a force delete, you can only delete empty repositories. + * + * @return the emptyOnDelete value. + */ + public Boolean emptyOnDelete() { + return this.emptyOnDelete; + } + + /** + * Set the emptyOnDelete property: If true, deleting the repository force deletes the contents of the repository. If + * false, the repository must be empty before attempting to delete it. If true, deleting the repository force + * deletes the contents of the repository. Without a force delete, you can only delete empty repositories. + * + * @param emptyOnDelete the emptyOnDelete value to set. + * @return the AwsEcrRepositoryProperties object itself. + */ + public AwsEcrRepositoryProperties withEmptyOnDelete(Boolean emptyOnDelete) { + this.emptyOnDelete = emptyOnDelete; + return this; + } + + /** + * Get the encryptionConfiguration property: The encryption configuration for the repository. This determines how + * the contents of your repository are encrypted at rest. The encryption configuration for the repository. This + * determines how the contents of your repository are encrypted at rest. By default, when no encryption + * configuration is set or the ``AES256`` encryption type is used, Amazon ECR uses server-side encryption with + * Amazon S3-managed encryption keys which encrypts your data at rest using an AES-256 encryption algorithm. This + * does not require any action on your part. For more control over the encryption of the contents of your + * repository, you can use server-side encryption with KMSlong key stored in KMSlong (KMS) to encrypt your images. + * For more information, see [Amazon ECR encryption at + * rest](https://docs.aws.amazon.com/AmazonECR/latest/userguide/encryption-at-rest.html) in the *Amazon Elastic + * Container Registry User Guide*. + * + * @return the encryptionConfiguration value. + */ + public EncryptionConfiguration encryptionConfiguration() { + return this.encryptionConfiguration; + } + + /** + * Set the encryptionConfiguration property: The encryption configuration for the repository. This determines how + * the contents of your repository are encrypted at rest. The encryption configuration for the repository. This + * determines how the contents of your repository are encrypted at rest. By default, when no encryption + * configuration is set or the ``AES256`` encryption type is used, Amazon ECR uses server-side encryption with + * Amazon S3-managed encryption keys which encrypts your data at rest using an AES-256 encryption algorithm. This + * does not require any action on your part. For more control over the encryption of the contents of your + * repository, you can use server-side encryption with KMSlong key stored in KMSlong (KMS) to encrypt your images. + * For more information, see [Amazon ECR encryption at + * rest](https://docs.aws.amazon.com/AmazonECR/latest/userguide/encryption-at-rest.html) in the *Amazon Elastic + * Container Registry User Guide*. + * + * @param encryptionConfiguration the encryptionConfiguration value to set. + * @return the AwsEcrRepositoryProperties object itself. + */ + public AwsEcrRepositoryProperties withEncryptionConfiguration(EncryptionConfiguration encryptionConfiguration) { + this.encryptionConfiguration = encryptionConfiguration; + return this; + } + + /** + * Get the imageScanningConfiguration property: The image scanning configuration for the repository. This determines + * whether images are scanned for known vulnerabilities after being pushed to the repository. The image scanning + * configuration for a repository. + * + * @return the imageScanningConfiguration value. + */ + public ImageScanningConfiguration imageScanningConfiguration() { + return this.imageScanningConfiguration; + } + + /** + * Set the imageScanningConfiguration property: The image scanning configuration for the repository. This determines + * whether images are scanned for known vulnerabilities after being pushed to the repository. The image scanning + * configuration for a repository. + * + * @param imageScanningConfiguration the imageScanningConfiguration value to set. + * @return the AwsEcrRepositoryProperties object itself. + */ + public AwsEcrRepositoryProperties + withImageScanningConfiguration(ImageScanningConfiguration imageScanningConfiguration) { + this.imageScanningConfiguration = imageScanningConfiguration; + return this; + } + + /** + * Get the imageTagMutability property: The tag mutability setting for the repository. If this parameter is omitted, + * the default setting of ``MUTABLE`` will be used which will allow image tags to be overwritten. If ``IMMUTABLE`` + * is specified, all image tags within the repository will be immutable which will prevent them from being + * overwritten. + * + * @return the imageTagMutability value. + */ + public ImageTagMutability imageTagMutability() { + return this.imageTagMutability; + } + + /** + * Set the imageTagMutability property: The tag mutability setting for the repository. If this parameter is omitted, + * the default setting of ``MUTABLE`` will be used which will allow image tags to be overwritten. If ``IMMUTABLE`` + * is specified, all image tags within the repository will be immutable which will prevent them from being + * overwritten. + * + * @param imageTagMutability the imageTagMutability value to set. + * @return the AwsEcrRepositoryProperties object itself. + */ + public AwsEcrRepositoryProperties withImageTagMutability(ImageTagMutability imageTagMutability) { + this.imageTagMutability = imageTagMutability; + return this; + } + + /** + * Get the lifecyclePolicy property: Creates or updates a lifecycle policy. For information about lifecycle policy + * syntax, see [Lifecycle policy + * template](https://docs.aws.amazon.com/AmazonECR/latest/userguide/LifecyclePolicies.html). The ``LifecyclePolicy`` + * property type specifies a lifecycle policy. For information about lifecycle policy syntax, see [Lifecycle policy + * template](https://docs.aws.amazon.com/AmazonECR/latest/userguide/LifecyclePolicies.html) in the *Amazon ECR User + * Guide*. + * + * @return the lifecyclePolicy value. + */ + public LifecyclePolicy lifecyclePolicy() { + return this.lifecyclePolicy; + } + + /** + * Set the lifecyclePolicy property: Creates or updates a lifecycle policy. For information about lifecycle policy + * syntax, see [Lifecycle policy + * template](https://docs.aws.amazon.com/AmazonECR/latest/userguide/LifecyclePolicies.html). The ``LifecyclePolicy`` + * property type specifies a lifecycle policy. For information about lifecycle policy syntax, see [Lifecycle policy + * template](https://docs.aws.amazon.com/AmazonECR/latest/userguide/LifecyclePolicies.html) in the *Amazon ECR User + * Guide*. + * + * @param lifecyclePolicy the lifecyclePolicy value to set. + * @return the AwsEcrRepositoryProperties object itself. + */ + public AwsEcrRepositoryProperties withLifecyclePolicy(LifecyclePolicy lifecyclePolicy) { + this.lifecyclePolicy = lifecyclePolicy; + return this; + } + + /** + * Get the repositoryName property: The name to use for the repository. The repository name may be specified on its + * own (such as ``nginx-web-app``) or it can be prepended with a namespace to group the repository into a category + * (such as ``project-a/nginx-web-app``). If you don't specify a name, CFNlong generates a unique physical ID and + * uses that ID for the repository name. For more information, see [Name + * type](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-name.html). The repository + * name must start with a letter and can only contain lowercase letters, numbers, hyphens, underscores, and forward + * slashes. If you specify a name, you cannot perform updates that require replacement of this resource. You can + * perform updates that require no or some interruption. If you must replace the resource, specify a new name. + * + * @return the repositoryName value. + */ + public String repositoryName() { + return this.repositoryName; + } + + /** + * Set the repositoryName property: The name to use for the repository. The repository name may be specified on its + * own (such as ``nginx-web-app``) or it can be prepended with a namespace to group the repository into a category + * (such as ``project-a/nginx-web-app``). If you don't specify a name, CFNlong generates a unique physical ID and + * uses that ID for the repository name. For more information, see [Name + * type](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-name.html). The repository + * name must start with a letter and can only contain lowercase letters, numbers, hyphens, underscores, and forward + * slashes. If you specify a name, you cannot perform updates that require replacement of this resource. You can + * perform updates that require no or some interruption. If you must replace the resource, specify a new name. + * + * @param repositoryName the repositoryName value to set. + * @return the AwsEcrRepositoryProperties object itself. + */ + public AwsEcrRepositoryProperties withRepositoryName(String repositoryName) { + this.repositoryName = repositoryName; + return this; + } + + /** + * Get the repositoryPolicyText property: The JSON repository policy text to apply to the repository. For more + * information, see [Amazon ECR repository + * policies](https://docs.aws.amazon.com/AmazonECR/latest/userguide/repository-policy-examples.html) in the *Amazon + * Elastic Container Registry User Guide*. + * + * @return the repositoryPolicyText value. + */ + public Map repositoryPolicyText() { + return this.repositoryPolicyText; + } + + /** + * Set the repositoryPolicyText property: The JSON repository policy text to apply to the repository. For more + * information, see [Amazon ECR repository + * policies](https://docs.aws.amazon.com/AmazonECR/latest/userguide/repository-policy-examples.html) in the *Amazon + * Elastic Container Registry User Guide*. + * + * @param repositoryPolicyText the repositoryPolicyText value to set. + * @return the AwsEcrRepositoryProperties object itself. + */ + public AwsEcrRepositoryProperties withRepositoryPolicyText(Map repositoryPolicyText) { + this.repositoryPolicyText = repositoryPolicyText; + return this; + } + + /** + * Get the repositoryUri property: Property repositoryUri. + * + * @return the repositoryUri value. + */ + public String repositoryUri() { + return this.repositoryUri; + } + + /** + * Set the repositoryUri property: Property repositoryUri. + * + * @param repositoryUri the repositoryUri value to set. + * @return the AwsEcrRepositoryProperties object itself. + */ + public AwsEcrRepositoryProperties withRepositoryUri(String repositoryUri) { + this.repositoryUri = repositoryUri; + return this; + } + + /** + * Get the tags property: An array of key-value pairs to apply to this resource. + * + * @return the tags value. + */ + public List tags() { + return this.tags; + } + + /** + * Set the tags property: An array of key-value pairs to apply to this resource. + * + * @param tags the tags value to set. + * @return the AwsEcrRepositoryProperties object itself. + */ + public AwsEcrRepositoryProperties withTags(List tags) { + this.tags = tags; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (encryptionConfiguration() != null) { + encryptionConfiguration().validate(); + } + if (imageScanningConfiguration() != null) { + imageScanningConfiguration().validate(); + } + if (lifecyclePolicy() != null) { + lifecyclePolicy().validate(); + } + if (tags() != null) { + tags().forEach(e -> e.validate()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("arn", this.arn); + jsonWriter.writeBooleanField("emptyOnDelete", this.emptyOnDelete); + jsonWriter.writeJsonField("encryptionConfiguration", this.encryptionConfiguration); + jsonWriter.writeJsonField("imageScanningConfiguration", this.imageScanningConfiguration); + jsonWriter.writeStringField("imageTagMutability", + this.imageTagMutability == null ? null : this.imageTagMutability.toString()); + jsonWriter.writeJsonField("lifecyclePolicy", this.lifecyclePolicy); + jsonWriter.writeStringField("repositoryName", this.repositoryName); + jsonWriter.writeMapField("repositoryPolicyText", this.repositoryPolicyText, + (writer, element) -> writer.writeUntyped(element)); + jsonWriter.writeStringField("repositoryUri", this.repositoryUri); + jsonWriter.writeArrayField("tags", this.tags, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AwsEcrRepositoryProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AwsEcrRepositoryProperties if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IOException If an error occurs while reading the AwsEcrRepositoryProperties. + */ + public static AwsEcrRepositoryProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AwsEcrRepositoryProperties deserializedAwsEcrRepositoryProperties = new AwsEcrRepositoryProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("arn".equals(fieldName)) { + deserializedAwsEcrRepositoryProperties.arn = reader.getString(); + } else if ("emptyOnDelete".equals(fieldName)) { + deserializedAwsEcrRepositoryProperties.emptyOnDelete = reader.getNullable(JsonReader::getBoolean); + } else if ("encryptionConfiguration".equals(fieldName)) { + deserializedAwsEcrRepositoryProperties.encryptionConfiguration + = EncryptionConfiguration.fromJson(reader); + } else if ("imageScanningConfiguration".equals(fieldName)) { + deserializedAwsEcrRepositoryProperties.imageScanningConfiguration + = ImageScanningConfiguration.fromJson(reader); + } else if ("imageTagMutability".equals(fieldName)) { + deserializedAwsEcrRepositoryProperties.imageTagMutability + = ImageTagMutability.fromString(reader.getString()); + } else if ("lifecyclePolicy".equals(fieldName)) { + deserializedAwsEcrRepositoryProperties.lifecyclePolicy = LifecyclePolicy.fromJson(reader); + } else if ("repositoryName".equals(fieldName)) { + deserializedAwsEcrRepositoryProperties.repositoryName = reader.getString(); + } else if ("repositoryPolicyText".equals(fieldName)) { + Map repositoryPolicyText = reader.readMap(reader1 -> reader1.readUntyped()); + deserializedAwsEcrRepositoryProperties.repositoryPolicyText = repositoryPolicyText; + } else if ("repositoryUri".equals(fieldName)) { + deserializedAwsEcrRepositoryProperties.repositoryUri = reader.getString(); + } else if ("tags".equals(fieldName)) { + List tags = reader.readArray(reader1 -> TagAutoGenerated24.fromJson(reader1)); + deserializedAwsEcrRepositoryProperties.tags = tags; + } else { + reader.skipChildren(); + } + } + + return deserializedAwsEcrRepositoryProperties; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/AwsEcsClusterProperties.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/AwsEcsClusterProperties.java new file mode 100644 index 000000000000..7a064e261116 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/AwsEcsClusterProperties.java @@ -0,0 +1,453 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Definition of awsEcsCluster. + */ +@Fluent +public final class AwsEcsClusterProperties implements JsonSerializable { + /* + * Property arn + */ + private String arn; + + /* + * The short name of one or more capacity providers to associate with the cluster. A capacity provider must be + * associated with a cluster before it can be included as part of the default capacity provider strategy of the + * cluster or used in a capacity provider strategy when calling the + * [CreateService](https://docs.aws.amazon.com/AmazonECS/latest/APIReference/API_CreateService.html) or + * [RunTask](https://docs.aws.amazon.com/AmazonECS/latest/APIReference/API_RunTask.html) actions. If specifying a + * capacity provider that uses an Auto Scaling group, the capacity provider must be created but not associated with + * another cluster. New Auto Scaling group capacity providers can be created with the + * [CreateCapacityProvider](https://docs.aws.amazon.com/AmazonECS/latest/APIReference/API_CreateCapacityProvider. + * html) API operation. To use a FARGATElong capacity provider, specify either the ``FARGATE`` or ``FARGATE_SPOT`` + * capacity providers. The FARGATElong capacity providers are available to all accounts and only need to be + * associated with a cluster to be used. The + * [PutCapacityProvider](https://docs.aws.amazon.com/AmazonECS/latest/APIReference/API_PutCapacityProvider.html) API + * operation is used to update the list of available capacity providers for a cluster after the cluster is created. + */ + private List capacityProviders; + + /* + * A user-generated string that you use to identify your cluster. If you don't specify a name, CFNlong generates a + * unique physical ID for the name. + */ + private String clusterName; + + /* + * The settings to use when creating a cluster. This parameter is used to turn on CloudWatch Container Insights for + * a cluster. + */ + private List clusterSettings; + + /* + * The execute command configuration for the cluster. The execute command configuration for the cluster. + */ + private ClusterConfiguration configuration; + + /* + * The default capacity provider strategy for the cluster. When services or tasks are run in the cluster with no + * launch type or capacity provider strategy specified, the default capacity provider strategy is used. + */ + private List defaultCapacityProviderStrategy; + + /* + * Use this parameter to set a default Service Connect namespace. After you set a default Service Connect namespace, + * any new services with Service Connect turned on that are created in the cluster are added as client services in + * the namespace. This setting only applies to new services that set the ``enabled`` parameter to ``true`` in the + * ``ServiceConnectConfiguration``. You can set the namespace of each service individually in the + * ``ServiceConnectConfiguration`` to override this default parameter. Tasks that run in a namespace can use short + * names to connect to services in the namespace. Tasks can connect to services across all of the clusters in the + * namespace. Tasks connect through a managed proxy container that collects logs and metrics for increased + * visibility. Only the tasks that Amazon ECS services create are supported with Service Connect. For more + * information, see [Service + * Connect](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/service-connect.html) in the *Amazon Elastic + * Container Service Developer Guide*. Use this parameter to set a default Service Connect namespace. After you set + * a default Service Connect namespace, any new services with Service Connect turned on that are created in the + * cluster are added as client services in the namespace. This setting only applies to new services that set the + * ``enabled`` parameter to ``true`` in the ``ServiceConnectConfiguration``. You can set the namespace of each + * service individually in the ``ServiceConnectConfiguration`` to override this default parameter. Tasks that run in + * a namespace can use short names to connect to services in the namespace. Tasks can connect to services across all + * of the clusters in the namespace. Tasks connect through a managed proxy container that collects logs and metrics + * for increased visibility. Only the tasks that Amazon ECS services create are supported with Service Connect. For + * more information, see [Service + * Connect](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/service-connect.html) in the *Amazon Elastic + * Container Service Developer Guide*. + */ + private ServiceConnectDefaults serviceConnectDefaults; + + /* + * The metadata that you apply to the cluster to help you categorize and organize them. Each tag consists of a key + * and an optional value. You define both. The following basic restrictions apply to tags: + Maximum number of tags + * per resource - 50 + For each resource, each tag key must be unique, and each tag key can have only one value. + + * Maximum key length - 128 Unicode characters in UTF-8 + Maximum value length - 256 Unicode characters in UTF-8 + + * If your tagging schema is used across multiple services and resources, remember that other services may have + * restrictions on allowed characters. Generally allowed characters are: letters, numbers, and spaces representable + * in UTF-8, and the following characters: + - = . _ : / @. + Tag keys and values are case-sensitive. + Do not use + * ``aws:``, ``AWS:``, or any upper or lowercase combination of such as a prefix for either keys or values as it is + * reserved for AWS use. You cannot edit or delete tag keys or values with this prefix. Tags with this prefix do not + * count against your tags per resource limit. + */ + private List tags; + + /** + * Creates an instance of AwsEcsClusterProperties class. + */ + public AwsEcsClusterProperties() { + } + + /** + * Get the arn property: Property arn. + * + * @return the arn value. + */ + public String arn() { + return this.arn; + } + + /** + * Set the arn property: Property arn. + * + * @param arn the arn value to set. + * @return the AwsEcsClusterProperties object itself. + */ + public AwsEcsClusterProperties withArn(String arn) { + this.arn = arn; + return this; + } + + /** + * Get the capacityProviders property: The short name of one or more capacity providers to associate with the + * cluster. A capacity provider must be associated with a cluster before it can be included as part of the default + * capacity provider strategy of the cluster or used in a capacity provider strategy when calling the + * [CreateService](https://docs.aws.amazon.com/AmazonECS/latest/APIReference/API_CreateService.html) or + * [RunTask](https://docs.aws.amazon.com/AmazonECS/latest/APIReference/API_RunTask.html) actions. If specifying a + * capacity provider that uses an Auto Scaling group, the capacity provider must be created but not associated with + * another cluster. New Auto Scaling group capacity providers can be created with the + * [CreateCapacityProvider](https://docs.aws.amazon.com/AmazonECS/latest/APIReference/API_CreateCapacityProvider.html) + * API operation. To use a FARGATElong capacity provider, specify either the ``FARGATE`` or ``FARGATE_SPOT`` + * capacity providers. The FARGATElong capacity providers are available to all accounts and only need to be + * associated with a cluster to be used. The + * [PutCapacityProvider](https://docs.aws.amazon.com/AmazonECS/latest/APIReference/API_PutCapacityProvider.html) API + * operation is used to update the list of available capacity providers for a cluster after the cluster is created. + * + * @return the capacityProviders value. + */ + public List capacityProviders() { + return this.capacityProviders; + } + + /** + * Set the capacityProviders property: The short name of one or more capacity providers to associate with the + * cluster. A capacity provider must be associated with a cluster before it can be included as part of the default + * capacity provider strategy of the cluster or used in a capacity provider strategy when calling the + * [CreateService](https://docs.aws.amazon.com/AmazonECS/latest/APIReference/API_CreateService.html) or + * [RunTask](https://docs.aws.amazon.com/AmazonECS/latest/APIReference/API_RunTask.html) actions. If specifying a + * capacity provider that uses an Auto Scaling group, the capacity provider must be created but not associated with + * another cluster. New Auto Scaling group capacity providers can be created with the + * [CreateCapacityProvider](https://docs.aws.amazon.com/AmazonECS/latest/APIReference/API_CreateCapacityProvider.html) + * API operation. To use a FARGATElong capacity provider, specify either the ``FARGATE`` or ``FARGATE_SPOT`` + * capacity providers. The FARGATElong capacity providers are available to all accounts and only need to be + * associated with a cluster to be used. The + * [PutCapacityProvider](https://docs.aws.amazon.com/AmazonECS/latest/APIReference/API_PutCapacityProvider.html) API + * operation is used to update the list of available capacity providers for a cluster after the cluster is created. + * + * @param capacityProviders the capacityProviders value to set. + * @return the AwsEcsClusterProperties object itself. + */ + public AwsEcsClusterProperties withCapacityProviders(List capacityProviders) { + this.capacityProviders = capacityProviders; + return this; + } + + /** + * Get the clusterName property: A user-generated string that you use to identify your cluster. If you don't specify + * a name, CFNlong generates a unique physical ID for the name. + * + * @return the clusterName value. + */ + public String clusterName() { + return this.clusterName; + } + + /** + * Set the clusterName property: A user-generated string that you use to identify your cluster. If you don't specify + * a name, CFNlong generates a unique physical ID for the name. + * + * @param clusterName the clusterName value to set. + * @return the AwsEcsClusterProperties object itself. + */ + public AwsEcsClusterProperties withClusterName(String clusterName) { + this.clusterName = clusterName; + return this; + } + + /** + * Get the clusterSettings property: The settings to use when creating a cluster. This parameter is used to turn on + * CloudWatch Container Insights for a cluster. + * + * @return the clusterSettings value. + */ + public List clusterSettings() { + return this.clusterSettings; + } + + /** + * Set the clusterSettings property: The settings to use when creating a cluster. This parameter is used to turn on + * CloudWatch Container Insights for a cluster. + * + * @param clusterSettings the clusterSettings value to set. + * @return the AwsEcsClusterProperties object itself. + */ + public AwsEcsClusterProperties withClusterSettings(List clusterSettings) { + this.clusterSettings = clusterSettings; + return this; + } + + /** + * Get the configuration property: The execute command configuration for the cluster. The execute command + * configuration for the cluster. + * + * @return the configuration value. + */ + public ClusterConfiguration configuration() { + return this.configuration; + } + + /** + * Set the configuration property: The execute command configuration for the cluster. The execute command + * configuration for the cluster. + * + * @param configuration the configuration value to set. + * @return the AwsEcsClusterProperties object itself. + */ + public AwsEcsClusterProperties withConfiguration(ClusterConfiguration configuration) { + this.configuration = configuration; + return this; + } + + /** + * Get the defaultCapacityProviderStrategy property: The default capacity provider strategy for the cluster. When + * services or tasks are run in the cluster with no launch type or capacity provider strategy specified, the default + * capacity provider strategy is used. + * + * @return the defaultCapacityProviderStrategy value. + */ + public List defaultCapacityProviderStrategy() { + return this.defaultCapacityProviderStrategy; + } + + /** + * Set the defaultCapacityProviderStrategy property: The default capacity provider strategy for the cluster. When + * services or tasks are run in the cluster with no launch type or capacity provider strategy specified, the default + * capacity provider strategy is used. + * + * @param defaultCapacityProviderStrategy the defaultCapacityProviderStrategy value to set. + * @return the AwsEcsClusterProperties object itself. + */ + public AwsEcsClusterProperties + withDefaultCapacityProviderStrategy(List defaultCapacityProviderStrategy) { + this.defaultCapacityProviderStrategy = defaultCapacityProviderStrategy; + return this; + } + + /** + * Get the serviceConnectDefaults property: Use this parameter to set a default Service Connect namespace. After you + * set a default Service Connect namespace, any new services with Service Connect turned on that are created in the + * cluster are added as client services in the namespace. This setting only applies to new services that set the + * ``enabled`` parameter to ``true`` in the ``ServiceConnectConfiguration``. You can set the namespace of each + * service individually in the ``ServiceConnectConfiguration`` to override this default parameter. Tasks that run in + * a namespace can use short names to connect to services in the namespace. Tasks can connect to services across all + * of the clusters in the namespace. Tasks connect through a managed proxy container that collects logs and metrics + * for increased visibility. Only the tasks that Amazon ECS services create are supported with Service Connect. For + * more information, see [Service + * Connect](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/service-connect.html) in the *Amazon Elastic + * Container Service Developer Guide*. Use this parameter to set a default Service Connect namespace. After you set + * a default Service Connect namespace, any new services with Service Connect turned on that are created in the + * cluster are added as client services in the namespace. This setting only applies to new services that set the + * ``enabled`` parameter to ``true`` in the ``ServiceConnectConfiguration``. You can set the namespace of each + * service individually in the ``ServiceConnectConfiguration`` to override this default parameter. Tasks that run in + * a namespace can use short names to connect to services in the namespace. Tasks can connect to services across all + * of the clusters in the namespace. Tasks connect through a managed proxy container that collects logs and metrics + * for increased visibility. Only the tasks that Amazon ECS services create are supported with Service Connect. For + * more information, see [Service + * Connect](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/service-connect.html) in the *Amazon Elastic + * Container Service Developer Guide*. + * + * @return the serviceConnectDefaults value. + */ + public ServiceConnectDefaults serviceConnectDefaults() { + return this.serviceConnectDefaults; + } + + /** + * Set the serviceConnectDefaults property: Use this parameter to set a default Service Connect namespace. After you + * set a default Service Connect namespace, any new services with Service Connect turned on that are created in the + * cluster are added as client services in the namespace. This setting only applies to new services that set the + * ``enabled`` parameter to ``true`` in the ``ServiceConnectConfiguration``. You can set the namespace of each + * service individually in the ``ServiceConnectConfiguration`` to override this default parameter. Tasks that run in + * a namespace can use short names to connect to services in the namespace. Tasks can connect to services across all + * of the clusters in the namespace. Tasks connect through a managed proxy container that collects logs and metrics + * for increased visibility. Only the tasks that Amazon ECS services create are supported with Service Connect. For + * more information, see [Service + * Connect](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/service-connect.html) in the *Amazon Elastic + * Container Service Developer Guide*. Use this parameter to set a default Service Connect namespace. After you set + * a default Service Connect namespace, any new services with Service Connect turned on that are created in the + * cluster are added as client services in the namespace. This setting only applies to new services that set the + * ``enabled`` parameter to ``true`` in the ``ServiceConnectConfiguration``. You can set the namespace of each + * service individually in the ``ServiceConnectConfiguration`` to override this default parameter. Tasks that run in + * a namespace can use short names to connect to services in the namespace. Tasks can connect to services across all + * of the clusters in the namespace. Tasks connect through a managed proxy container that collects logs and metrics + * for increased visibility. Only the tasks that Amazon ECS services create are supported with Service Connect. For + * more information, see [Service + * Connect](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/service-connect.html) in the *Amazon Elastic + * Container Service Developer Guide*. + * + * @param serviceConnectDefaults the serviceConnectDefaults value to set. + * @return the AwsEcsClusterProperties object itself. + */ + public AwsEcsClusterProperties withServiceConnectDefaults(ServiceConnectDefaults serviceConnectDefaults) { + this.serviceConnectDefaults = serviceConnectDefaults; + return this; + } + + /** + * Get the tags property: The metadata that you apply to the cluster to help you categorize and organize them. Each + * tag consists of a key and an optional value. You define both. The following basic restrictions apply to tags: + + * Maximum number of tags per resource - 50 + For each resource, each tag key must be unique, and each tag key can + * have only one value. + Maximum key length - 128 Unicode characters in UTF-8 + Maximum value length - 256 Unicode + * characters in UTF-8 + If your tagging schema is used across multiple services and resources, remember that other + * services may have restrictions on allowed characters. Generally allowed characters are: letters, numbers, and + * spaces representable in UTF-8, and the following characters: + - = . _ : / @. + Tag keys and values are + * case-sensitive. + Do not use ``aws:``, ``AWS:``, or any upper or lowercase combination of such as a prefix for + * either keys or values as it is reserved for AWS use. You cannot edit or delete tag keys or values with this + * prefix. Tags with this prefix do not count against your tags per resource limit. + * + * @return the tags value. + */ + public List tags() { + return this.tags; + } + + /** + * Set the tags property: The metadata that you apply to the cluster to help you categorize and organize them. Each + * tag consists of a key and an optional value. You define both. The following basic restrictions apply to tags: + + * Maximum number of tags per resource - 50 + For each resource, each tag key must be unique, and each tag key can + * have only one value. + Maximum key length - 128 Unicode characters in UTF-8 + Maximum value length - 256 Unicode + * characters in UTF-8 + If your tagging schema is used across multiple services and resources, remember that other + * services may have restrictions on allowed characters. Generally allowed characters are: letters, numbers, and + * spaces representable in UTF-8, and the following characters: + - = . _ : / @. + Tag keys and values are + * case-sensitive. + Do not use ``aws:``, ``AWS:``, or any upper or lowercase combination of such as a prefix for + * either keys or values as it is reserved for AWS use. You cannot edit or delete tag keys or values with this + * prefix. Tags with this prefix do not count against your tags per resource limit. + * + * @param tags the tags value to set. + * @return the AwsEcsClusterProperties object itself. + */ + public AwsEcsClusterProperties withTags(List tags) { + this.tags = tags; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (clusterSettings() != null) { + clusterSettings().forEach(e -> e.validate()); + } + if (configuration() != null) { + configuration().validate(); + } + if (defaultCapacityProviderStrategy() != null) { + defaultCapacityProviderStrategy().forEach(e -> e.validate()); + } + if (serviceConnectDefaults() != null) { + serviceConnectDefaults().validate(); + } + if (tags() != null) { + tags().forEach(e -> e.validate()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("arn", this.arn); + jsonWriter.writeArrayField("capacityProviders", this.capacityProviders, + (writer, element) -> writer.writeString(element)); + jsonWriter.writeStringField("clusterName", this.clusterName); + jsonWriter.writeArrayField("clusterSettings", this.clusterSettings, + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeJsonField("configuration", this.configuration); + jsonWriter.writeArrayField("defaultCapacityProviderStrategy", this.defaultCapacityProviderStrategy, + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeJsonField("serviceConnectDefaults", this.serviceConnectDefaults); + jsonWriter.writeArrayField("tags", this.tags, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AwsEcsClusterProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AwsEcsClusterProperties if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the AwsEcsClusterProperties. + */ + public static AwsEcsClusterProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AwsEcsClusterProperties deserializedAwsEcsClusterProperties = new AwsEcsClusterProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("arn".equals(fieldName)) { + deserializedAwsEcsClusterProperties.arn = reader.getString(); + } else if ("capacityProviders".equals(fieldName)) { + List capacityProviders = reader.readArray(reader1 -> reader1.getString()); + deserializedAwsEcsClusterProperties.capacityProviders = capacityProviders; + } else if ("clusterName".equals(fieldName)) { + deserializedAwsEcsClusterProperties.clusterName = reader.getString(); + } else if ("clusterSettings".equals(fieldName)) { + List clusterSettings + = reader.readArray(reader1 -> ClusterSettings.fromJson(reader1)); + deserializedAwsEcsClusterProperties.clusterSettings = clusterSettings; + } else if ("configuration".equals(fieldName)) { + deserializedAwsEcsClusterProperties.configuration = ClusterConfiguration.fromJson(reader); + } else if ("defaultCapacityProviderStrategy".equals(fieldName)) { + List defaultCapacityProviderStrategy + = reader.readArray(reader1 -> CapacityProviderStrategyItem.fromJson(reader1)); + deserializedAwsEcsClusterProperties.defaultCapacityProviderStrategy + = defaultCapacityProviderStrategy; + } else if ("serviceConnectDefaults".equals(fieldName)) { + deserializedAwsEcsClusterProperties.serviceConnectDefaults + = ServiceConnectDefaults.fromJson(reader); + } else if ("tags".equals(fieldName)) { + List tags = reader.readArray(reader1 -> TagAutoGenerated25.fromJson(reader1)); + deserializedAwsEcsClusterProperties.tags = tags; + } else { + reader.skipChildren(); + } + } + + return deserializedAwsEcsClusterProperties; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/AwsEcsServiceProperties.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/AwsEcsServiceProperties.java new file mode 100644 index 000000000000..bf82ef26df54 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/AwsEcsServiceProperties.java @@ -0,0 +1,1159 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Definition of awsEcsService. + */ +@Fluent +public final class AwsEcsServiceProperties implements JsonSerializable { + /* + * The capacity provider strategy to use for the service. If a ``capacityProviderStrategy`` is specified, the + * ``launchType`` parameter must be omitted. If no ``capacityProviderStrategy`` or ``launchType`` is specified, the + * ``defaultCapacityProviderStrategy`` for the cluster is used. A capacity provider strategy may contain a maximum + * of 6 capacity providers. + */ + private List capacityProviderStrategy; + + /* + * The short name or full Amazon Resource Name (ARN) of the cluster that you run your service on. If you do not + * specify a cluster, the default cluster is assumed. + */ + private String cluster; + + /* + * Optional deployment parameters that control how many tasks run during the deployment and the ordering of stopping + * and starting tasks. The ``DeploymentConfiguration`` property specifies optional deployment parameters that + * control how many tasks run during the deployment and the ordering of stopping and starting tasks. + */ + private DeploymentConfiguration deploymentConfiguration; + + /* + * The deployment controller to use for the service. If no deployment controller is specified, the default value of + * ``ECS`` is used. The deployment controller to use for the service. For more information, see [Amazon ECS + * deployment types](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/deployment-types.html) in the + * *Amazon Elastic Container Service Developer Guide*. + */ + private DeploymentController deploymentController; + + /* + * The number of instantiations of the specified task definition to place and keep running in your service. For new + * services, if a desired count is not specified, a default value of ``1`` is used. When using the ``DAEMON`` + * scheduling strategy, the desired count is not required. For existing services, if a desired count is not + * specified, it is omitted from the operation. + */ + private Integer desiredCount; + + /* + * Specifies whether to turn on Amazon ECS managed tags for the tasks within the service. For more information, see + * [Tagging your Amazon ECS + * resources](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/ecs-using-tags.html) in the *Amazon + * Elastic Container Service Developer Guide*. When you use Amazon ECS managed tags, you need to set the + * ``propagateTags`` request parameter. + */ + private Boolean enableEcsManagedTags; + + /* + * Determines whether the execute command functionality is turned on for the service. If ``true``, the execute + * command functionality is turned on for all containers in tasks as part of the service. + */ + private Boolean enableExecuteCommand; + + /* + * The period of time, in seconds, that the Amazon ECS service scheduler ignores unhealthy Elastic Load Balancing + * target health checks after a task has first started. This is only used when your service is configured to use a + * load balancer. If your service has a load balancer defined and you don't specify a health check grace period + * value, the default value of ``0`` is used. If you do not use an Elastic Load Balancing, we recommend that you use + * the ``startPeriod`` in the task definition health check parameters. For more information, see [Health + * check](https://docs.aws.amazon.com/AmazonECS/latest/APIReference/API_HealthCheck.html). If your service's tasks + * take a while to start and respond to Elastic Load Balancing health checks, you can specify a health check grace + * period of up to 2,147,483,647 seconds (about 69 years). During that time, the Amazon ECS service scheduler + * ignores health check status. This grace period can prevent the service scheduler from marking tasks as unhealthy + * and stopping them before they have time to come up. + */ + private Integer healthCheckGracePeriodSeconds; + + /* + * The launch type on which to run your service. For more information, see [Amazon ECS Launch + * Types](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/launch_types.html) in the *Amazon Elastic + * Container Service Developer Guide*. + */ + private LaunchType launchType; + + /* + * A list of load balancer objects to associate with the service. If you specify the ``Role`` property, + * ``LoadBalancers`` must be specified as well. For information about the number of load balancers that you can + * specify per service, see [Service Load + * Balancing](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/service-load-balancing.html) in the + * *Amazon Elastic Container Service Developer Guide*. + */ + private List loadBalancers; + + /* + * Property name + */ + private String name; + + /* + * The network configuration for the service. This parameter is required for task definitions that use the + * ``awsvpc`` network mode to receive their own elastic network interface, and it is not supported for other network + * modes. For more information, see [Task + * Networking](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/task-networking.html) in the *Amazon + * Elastic Container Service Developer Guide*. The ``NetworkConfiguration`` property specifies an object + * representing the network configuration for a task or service. + */ + private NetworkConfiguration networkConfiguration; + + /* + * An array of placement constraint objects to use for tasks in your service. You can specify a maximum of 10 + * constraints for each task. This limit includes constraints in the task definition and those specified at runtime. + */ + private List placementConstraints; + + /* + * The placement strategy objects to use for tasks in your service. You can specify a maximum of 5 strategy rules + * for each service. + */ + private List placementStrategies; + + /* + * The platform version that your tasks in the service are running on. A platform version is specified only for + * tasks using the Fargate launch type. If one isn't specified, the ``LATEST`` platform version is used. For more + * information, see [platform + * versions](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/platform_versions.html) in the *Amazon + * Elastic Container Service Developer Guide*. + */ + private String platformVersion; + + /* + * Specifies whether to propagate the tags from the task definition to the task. If no value is specified, the tags + * aren't propagated. Tags can only be propagated to the task during task creation. To add tags to a task after task + * creation, use the [TagResource](https://docs.aws.amazon.com/AmazonECS/latest/APIReference/API_TagResource.html) + * API action. The default is ``NONE``. + */ + private PropagateTags propagateTags; + + /* + * The name or full Amazon Resource Name (ARN) of the IAM role that allows Amazon ECS to make calls to your load + * balancer on your behalf. This parameter is only permitted if you are using a load balancer with your service and + * your task definition doesn't use the ``awsvpc`` network mode. If you specify the ``role`` parameter, you must + * also specify a load balancer object with the ``loadBalancers`` parameter. If your account has already created the + * Amazon ECS service-linked role, that role is used for your service unless you specify a role here. The + * service-linked role is required if your task definition uses the ``awsvpc`` network mode or if the service is + * configured to use service discovery, an external deployment controller, multiple target groups, or Elastic + * Inference accelerators in which case you don't specify a role here. For more information, see [Using + * service-linked roles for Amazon + * ECS](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/using-service-linked-roles.html) in the *Amazon + * Elastic Container Service Developer Guide*. If your specified role has a path other than ``/``, then you must + * either specify the full role ARN (this is recommended) or prefix the role name with the path. For example, if a + * role with the name ``bar`` has a path of ``/foo/`` then you would specify ``/foo/bar`` as the role name. For more + * information, see [Friendly names and + * paths](https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_identifiers.html#identifiers-friendly-names) in + * the *IAM User Guide*. + */ + private String role; + + /* + * The scheduling strategy to use for the service. For more information, see + * [Services](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/ecs_services.html). There are two service + * scheduler strategies available: + ``REPLICA``-The replica scheduling strategy places and maintains the desired + * number of tasks across your cluster. By default, the service scheduler spreads tasks across Availability Zones. + * You can use task placement strategies and constraints to customize task placement decisions. This scheduler + * strategy is required if the service uses the ``CODE_DEPLOY`` or ``EXTERNAL`` deployment controller types. + + * ``DAEMON``-The daemon scheduling strategy deploys exactly one task on each active container instance that meets + * all of the task placement constraints that you specify in your cluster. The service scheduler also evaluates the + * task placement constraints for running tasks and will stop tasks that don't meet the placement constraints. When + * you're using this strategy, you don't need to specify a desired number of tasks, a task placement strategy, or + * use Service Auto Scaling policies. Tasks using the Fargate launch type or the ``CODE_DEPLOY`` or ``EXTERNAL`` + * deployment controller types don't support the ``DAEMON`` scheduling strategy. + */ + private SchedulingStrategy schedulingStrategy; + + /* + * Property serviceArn + */ + private String serviceArn; + + /* + * The configuration for this service to discover and connect to services, and be discovered by, and connected from, + * other services within a namespace. Tasks that run in a namespace can use short names to connect to services in + * the namespace. Tasks can connect to services across all of the clusters in the namespace. Tasks connect through a + * managed proxy container that collects logs and metrics for increased visibility. Only the tasks that Amazon ECS + * services create are supported with Service Connect. For more information, see [Service + * Connect](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/service-connect.html) in the *Amazon Elastic + * Container Service Developer Guide*. The Service Connect configuration of your Amazon ECS service. The + * configuration for this service to discover and connect to services, and be discovered by, and connected from, + * other services within a namespace. Tasks that run in a namespace can use short names to connect to services in + * the namespace. Tasks can connect to services across all of the clusters in the namespace. Tasks connect through a + * managed proxy container that collects logs and metrics for increased visibility. Only the tasks that Amazon ECS + * services create are supported with Service Connect. For more information, see [Service + * Connect](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/service-connect.html) in the *Amazon Elastic + * Container Service Developer Guide*. + */ + private ServiceConnectConfiguration serviceConnectConfiguration; + + /* + * The name of your service. Up to 255 letters (uppercase and lowercase), numbers, underscores, and hyphens are + * allowed. Service names must be unique within a cluster, but you can have similarly named services in multiple + * clusters within a Region or across multiple Regions. The stack update fails if you change any properties that + * require replacement and the ``ServiceName`` is configured. This is because AWS CloudFormation creates the + * replacement service first, but each ``ServiceName`` must be unique in the cluster. + */ + private String serviceName; + + /* + * The details of the service discovery registry to associate with this service. For more information, see [Service + * discovery](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/service-discovery.html). Each service may + * be associated with one service registry. Multiple service registries for each service isn't supported. + */ + private List serviceRegistries; + + /* + * The metadata that you apply to the service to help you categorize and organize them. Each tag consists of a key + * and an optional value, both of which you define. When a service is deleted, the tags are deleted as well. The + * following basic restrictions apply to tags: + Maximum number of tags per resource - 50 + For each resource, each + * tag key must be unique, and each tag key can have only one value. + Maximum key length - 128 Unicode characters + * in UTF-8 + Maximum value length - 256 Unicode characters in UTF-8 + If your tagging schema is used across + * multiple services and resources, remember that other services may have restrictions on allowed characters. + * Generally allowed characters are: letters, numbers, and spaces representable in UTF-8, and the following + * characters: + - = . _ : / @. + Tag keys and values are case-sensitive. + Do not use ``aws:``, ``AWS:``, or any + * upper or lowercase combination of such as a prefix for either keys or values as it is reserved for AWS use. You + * cannot edit or delete tag keys or values with this prefix. Tags with this prefix do not count against your tags + * per resource limit. + */ + private List tags; + + /* + * The ``family`` and ``revision`` (``family:revision``) or full ARN of the task definition to run in your service. + * If a ``revision`` isn't specified, the latest ``ACTIVE`` revision is used. A task definition must be specified if + * the service uses either the ``ECS`` or ``CODE_DEPLOY`` deployment controllers. For more information about + * deployment types, see [Amazon ECS deployment + * types](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/deployment-types.html). + */ + private String taskDefinition; + + /* + * The configuration for a volume specified in the task definition as a volume that is configured at launch time. + * Currently, the only supported volume type is an Amazon EBS volume. + */ + private List volumeConfigurations; + + /** + * Creates an instance of AwsEcsServiceProperties class. + */ + public AwsEcsServiceProperties() { + } + + /** + * Get the capacityProviderStrategy property: The capacity provider strategy to use for the service. If a + * ``capacityProviderStrategy`` is specified, the ``launchType`` parameter must be omitted. If no + * ``capacityProviderStrategy`` or ``launchType`` is specified, the ``defaultCapacityProviderStrategy`` for the + * cluster is used. A capacity provider strategy may contain a maximum of 6 capacity providers. + * + * @return the capacityProviderStrategy value. + */ + public List capacityProviderStrategy() { + return this.capacityProviderStrategy; + } + + /** + * Set the capacityProviderStrategy property: The capacity provider strategy to use for the service. If a + * ``capacityProviderStrategy`` is specified, the ``launchType`` parameter must be omitted. If no + * ``capacityProviderStrategy`` or ``launchType`` is specified, the ``defaultCapacityProviderStrategy`` for the + * cluster is used. A capacity provider strategy may contain a maximum of 6 capacity providers. + * + * @param capacityProviderStrategy the capacityProviderStrategy value to set. + * @return the AwsEcsServiceProperties object itself. + */ + public AwsEcsServiceProperties + withCapacityProviderStrategy(List capacityProviderStrategy) { + this.capacityProviderStrategy = capacityProviderStrategy; + return this; + } + + /** + * Get the cluster property: The short name or full Amazon Resource Name (ARN) of the cluster that you run your + * service on. If you do not specify a cluster, the default cluster is assumed. + * + * @return the cluster value. + */ + public String cluster() { + return this.cluster; + } + + /** + * Set the cluster property: The short name or full Amazon Resource Name (ARN) of the cluster that you run your + * service on. If you do not specify a cluster, the default cluster is assumed. + * + * @param cluster the cluster value to set. + * @return the AwsEcsServiceProperties object itself. + */ + public AwsEcsServiceProperties withCluster(String cluster) { + this.cluster = cluster; + return this; + } + + /** + * Get the deploymentConfiguration property: Optional deployment parameters that control how many tasks run during + * the deployment and the ordering of stopping and starting tasks. The ``DeploymentConfiguration`` property + * specifies optional deployment parameters that control how many tasks run during the deployment and the ordering + * of stopping and starting tasks. + * + * @return the deploymentConfiguration value. + */ + public DeploymentConfiguration deploymentConfiguration() { + return this.deploymentConfiguration; + } + + /** + * Set the deploymentConfiguration property: Optional deployment parameters that control how many tasks run during + * the deployment and the ordering of stopping and starting tasks. The ``DeploymentConfiguration`` property + * specifies optional deployment parameters that control how many tasks run during the deployment and the ordering + * of stopping and starting tasks. + * + * @param deploymentConfiguration the deploymentConfiguration value to set. + * @return the AwsEcsServiceProperties object itself. + */ + public AwsEcsServiceProperties withDeploymentConfiguration(DeploymentConfiguration deploymentConfiguration) { + this.deploymentConfiguration = deploymentConfiguration; + return this; + } + + /** + * Get the deploymentController property: The deployment controller to use for the service. If no deployment + * controller is specified, the default value of ``ECS`` is used. The deployment controller to use for the service. + * For more information, see [Amazon ECS deployment + * types](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/deployment-types.html) in the *Amazon Elastic + * Container Service Developer Guide*. + * + * @return the deploymentController value. + */ + public DeploymentController deploymentController() { + return this.deploymentController; + } + + /** + * Set the deploymentController property: The deployment controller to use for the service. If no deployment + * controller is specified, the default value of ``ECS`` is used. The deployment controller to use for the service. + * For more information, see [Amazon ECS deployment + * types](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/deployment-types.html) in the *Amazon Elastic + * Container Service Developer Guide*. + * + * @param deploymentController the deploymentController value to set. + * @return the AwsEcsServiceProperties object itself. + */ + public AwsEcsServiceProperties withDeploymentController(DeploymentController deploymentController) { + this.deploymentController = deploymentController; + return this; + } + + /** + * Get the desiredCount property: The number of instantiations of the specified task definition to place and keep + * running in your service. For new services, if a desired count is not specified, a default value of ``1`` is used. + * When using the ``DAEMON`` scheduling strategy, the desired count is not required. For existing services, if a + * desired count is not specified, it is omitted from the operation. + * + * @return the desiredCount value. + */ + public Integer desiredCount() { + return this.desiredCount; + } + + /** + * Set the desiredCount property: The number of instantiations of the specified task definition to place and keep + * running in your service. For new services, if a desired count is not specified, a default value of ``1`` is used. + * When using the ``DAEMON`` scheduling strategy, the desired count is not required. For existing services, if a + * desired count is not specified, it is omitted from the operation. + * + * @param desiredCount the desiredCount value to set. + * @return the AwsEcsServiceProperties object itself. + */ + public AwsEcsServiceProperties withDesiredCount(Integer desiredCount) { + this.desiredCount = desiredCount; + return this; + } + + /** + * Get the enableEcsManagedTags property: Specifies whether to turn on Amazon ECS managed tags for the tasks within + * the service. For more information, see [Tagging your Amazon ECS + * resources](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/ecs-using-tags.html) in the *Amazon + * Elastic Container Service Developer Guide*. When you use Amazon ECS managed tags, you need to set the + * ``propagateTags`` request parameter. + * + * @return the enableEcsManagedTags value. + */ + public Boolean enableEcsManagedTags() { + return this.enableEcsManagedTags; + } + + /** + * Set the enableEcsManagedTags property: Specifies whether to turn on Amazon ECS managed tags for the tasks within + * the service. For more information, see [Tagging your Amazon ECS + * resources](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/ecs-using-tags.html) in the *Amazon + * Elastic Container Service Developer Guide*. When you use Amazon ECS managed tags, you need to set the + * ``propagateTags`` request parameter. + * + * @param enableEcsManagedTags the enableEcsManagedTags value to set. + * @return the AwsEcsServiceProperties object itself. + */ + public AwsEcsServiceProperties withEnableEcsManagedTags(Boolean enableEcsManagedTags) { + this.enableEcsManagedTags = enableEcsManagedTags; + return this; + } + + /** + * Get the enableExecuteCommand property: Determines whether the execute command functionality is turned on for the + * service. If ``true``, the execute command functionality is turned on for all containers in tasks as part of the + * service. + * + * @return the enableExecuteCommand value. + */ + public Boolean enableExecuteCommand() { + return this.enableExecuteCommand; + } + + /** + * Set the enableExecuteCommand property: Determines whether the execute command functionality is turned on for the + * service. If ``true``, the execute command functionality is turned on for all containers in tasks as part of the + * service. + * + * @param enableExecuteCommand the enableExecuteCommand value to set. + * @return the AwsEcsServiceProperties object itself. + */ + public AwsEcsServiceProperties withEnableExecuteCommand(Boolean enableExecuteCommand) { + this.enableExecuteCommand = enableExecuteCommand; + return this; + } + + /** + * Get the healthCheckGracePeriodSeconds property: The period of time, in seconds, that the Amazon ECS service + * scheduler ignores unhealthy Elastic Load Balancing target health checks after a task has first started. This is + * only used when your service is configured to use a load balancer. If your service has a load balancer defined and + * you don't specify a health check grace period value, the default value of ``0`` is used. If you do not use an + * Elastic Load Balancing, we recommend that you use the ``startPeriod`` in the task definition health check + * parameters. For more information, see [Health + * check](https://docs.aws.amazon.com/AmazonECS/latest/APIReference/API_HealthCheck.html). If your service's tasks + * take a while to start and respond to Elastic Load Balancing health checks, you can specify a health check grace + * period of up to 2,147,483,647 seconds (about 69 years). During that time, the Amazon ECS service scheduler + * ignores health check status. This grace period can prevent the service scheduler from marking tasks as unhealthy + * and stopping them before they have time to come up. + * + * @return the healthCheckGracePeriodSeconds value. + */ + public Integer healthCheckGracePeriodSeconds() { + return this.healthCheckGracePeriodSeconds; + } + + /** + * Set the healthCheckGracePeriodSeconds property: The period of time, in seconds, that the Amazon ECS service + * scheduler ignores unhealthy Elastic Load Balancing target health checks after a task has first started. This is + * only used when your service is configured to use a load balancer. If your service has a load balancer defined and + * you don't specify a health check grace period value, the default value of ``0`` is used. If you do not use an + * Elastic Load Balancing, we recommend that you use the ``startPeriod`` in the task definition health check + * parameters. For more information, see [Health + * check](https://docs.aws.amazon.com/AmazonECS/latest/APIReference/API_HealthCheck.html). If your service's tasks + * take a while to start and respond to Elastic Load Balancing health checks, you can specify a health check grace + * period of up to 2,147,483,647 seconds (about 69 years). During that time, the Amazon ECS service scheduler + * ignores health check status. This grace period can prevent the service scheduler from marking tasks as unhealthy + * and stopping them before they have time to come up. + * + * @param healthCheckGracePeriodSeconds the healthCheckGracePeriodSeconds value to set. + * @return the AwsEcsServiceProperties object itself. + */ + public AwsEcsServiceProperties withHealthCheckGracePeriodSeconds(Integer healthCheckGracePeriodSeconds) { + this.healthCheckGracePeriodSeconds = healthCheckGracePeriodSeconds; + return this; + } + + /** + * Get the launchType property: The launch type on which to run your service. For more information, see [Amazon ECS + * Launch Types](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/launch_types.html) in the *Amazon + * Elastic Container Service Developer Guide*. + * + * @return the launchType value. + */ + public LaunchType launchType() { + return this.launchType; + } + + /** + * Set the launchType property: The launch type on which to run your service. For more information, see [Amazon ECS + * Launch Types](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/launch_types.html) in the *Amazon + * Elastic Container Service Developer Guide*. + * + * @param launchType the launchType value to set. + * @return the AwsEcsServiceProperties object itself. + */ + public AwsEcsServiceProperties withLaunchType(LaunchType launchType) { + this.launchType = launchType; + return this; + } + + /** + * Get the loadBalancers property: A list of load balancer objects to associate with the service. If you specify the + * ``Role`` property, ``LoadBalancers`` must be specified as well. For information about the number of load + * balancers that you can specify per service, see [Service Load + * Balancing](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/service-load-balancing.html) in the + * *Amazon Elastic Container Service Developer Guide*. + * + * @return the loadBalancers value. + */ + public List loadBalancers() { + return this.loadBalancers; + } + + /** + * Set the loadBalancers property: A list of load balancer objects to associate with the service. If you specify the + * ``Role`` property, ``LoadBalancers`` must be specified as well. For information about the number of load + * balancers that you can specify per service, see [Service Load + * Balancing](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/service-load-balancing.html) in the + * *Amazon Elastic Container Service Developer Guide*. + * + * @param loadBalancers the loadBalancers value to set. + * @return the AwsEcsServiceProperties object itself. + */ + public AwsEcsServiceProperties withLoadBalancers(List loadBalancers) { + this.loadBalancers = loadBalancers; + return this; + } + + /** + * Get the name property: Property name. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: Property name. + * + * @param name the name value to set. + * @return the AwsEcsServiceProperties object itself. + */ + public AwsEcsServiceProperties withName(String name) { + this.name = name; + return this; + } + + /** + * Get the networkConfiguration property: The network configuration for the service. This parameter is required for + * task definitions that use the ``awsvpc`` network mode to receive their own elastic network interface, and it is + * not supported for other network modes. For more information, see [Task + * Networking](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/task-networking.html) in the *Amazon + * Elastic Container Service Developer Guide*. The ``NetworkConfiguration`` property specifies an object + * representing the network configuration for a task or service. + * + * @return the networkConfiguration value. + */ + public NetworkConfiguration networkConfiguration() { + return this.networkConfiguration; + } + + /** + * Set the networkConfiguration property: The network configuration for the service. This parameter is required for + * task definitions that use the ``awsvpc`` network mode to receive their own elastic network interface, and it is + * not supported for other network modes. For more information, see [Task + * Networking](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/task-networking.html) in the *Amazon + * Elastic Container Service Developer Guide*. The ``NetworkConfiguration`` property specifies an object + * representing the network configuration for a task or service. + * + * @param networkConfiguration the networkConfiguration value to set. + * @return the AwsEcsServiceProperties object itself. + */ + public AwsEcsServiceProperties withNetworkConfiguration(NetworkConfiguration networkConfiguration) { + this.networkConfiguration = networkConfiguration; + return this; + } + + /** + * Get the placementConstraints property: An array of placement constraint objects to use for tasks in your service. + * You can specify a maximum of 10 constraints for each task. This limit includes constraints in the task definition + * and those specified at runtime. + * + * @return the placementConstraints value. + */ + public List placementConstraints() { + return this.placementConstraints; + } + + /** + * Set the placementConstraints property: An array of placement constraint objects to use for tasks in your service. + * You can specify a maximum of 10 constraints for each task. This limit includes constraints in the task definition + * and those specified at runtime. + * + * @param placementConstraints the placementConstraints value to set. + * @return the AwsEcsServiceProperties object itself. + */ + public AwsEcsServiceProperties withPlacementConstraints(List placementConstraints) { + this.placementConstraints = placementConstraints; + return this; + } + + /** + * Get the placementStrategies property: The placement strategy objects to use for tasks in your service. You can + * specify a maximum of 5 strategy rules for each service. + * + * @return the placementStrategies value. + */ + public List placementStrategies() { + return this.placementStrategies; + } + + /** + * Set the placementStrategies property: The placement strategy objects to use for tasks in your service. You can + * specify a maximum of 5 strategy rules for each service. + * + * @param placementStrategies the placementStrategies value to set. + * @return the AwsEcsServiceProperties object itself. + */ + public AwsEcsServiceProperties withPlacementStrategies(List placementStrategies) { + this.placementStrategies = placementStrategies; + return this; + } + + /** + * Get the platformVersion property: The platform version that your tasks in the service are running on. A platform + * version is specified only for tasks using the Fargate launch type. If one isn't specified, the ``LATEST`` + * platform version is used. For more information, see [platform + * versions](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/platform_versions.html) in the *Amazon + * Elastic Container Service Developer Guide*. + * + * @return the platformVersion value. + */ + public String platformVersion() { + return this.platformVersion; + } + + /** + * Set the platformVersion property: The platform version that your tasks in the service are running on. A platform + * version is specified only for tasks using the Fargate launch type. If one isn't specified, the ``LATEST`` + * platform version is used. For more information, see [platform + * versions](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/platform_versions.html) in the *Amazon + * Elastic Container Service Developer Guide*. + * + * @param platformVersion the platformVersion value to set. + * @return the AwsEcsServiceProperties object itself. + */ + public AwsEcsServiceProperties withPlatformVersion(String platformVersion) { + this.platformVersion = platformVersion; + return this; + } + + /** + * Get the propagateTags property: Specifies whether to propagate the tags from the task definition to the task. If + * no value is specified, the tags aren't propagated. Tags can only be propagated to the task during task creation. + * To add tags to a task after task creation, use the + * [TagResource](https://docs.aws.amazon.com/AmazonECS/latest/APIReference/API_TagResource.html) API action. The + * default is ``NONE``. + * + * @return the propagateTags value. + */ + public PropagateTags propagateTags() { + return this.propagateTags; + } + + /** + * Set the propagateTags property: Specifies whether to propagate the tags from the task definition to the task. If + * no value is specified, the tags aren't propagated. Tags can only be propagated to the task during task creation. + * To add tags to a task after task creation, use the + * [TagResource](https://docs.aws.amazon.com/AmazonECS/latest/APIReference/API_TagResource.html) API action. The + * default is ``NONE``. + * + * @param propagateTags the propagateTags value to set. + * @return the AwsEcsServiceProperties object itself. + */ + public AwsEcsServiceProperties withPropagateTags(PropagateTags propagateTags) { + this.propagateTags = propagateTags; + return this; + } + + /** + * Get the role property: The name or full Amazon Resource Name (ARN) of the IAM role that allows Amazon ECS to make + * calls to your load balancer on your behalf. This parameter is only permitted if you are using a load balancer + * with your service and your task definition doesn't use the ``awsvpc`` network mode. If you specify the ``role`` + * parameter, you must also specify a load balancer object with the ``loadBalancers`` parameter. If your account has + * already created the Amazon ECS service-linked role, that role is used for your service unless you specify a role + * here. The service-linked role is required if your task definition uses the ``awsvpc`` network mode or if the + * service is configured to use service discovery, an external deployment controller, multiple target groups, or + * Elastic Inference accelerators in which case you don't specify a role here. For more information, see [Using + * service-linked roles for Amazon + * ECS](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/using-service-linked-roles.html) in the *Amazon + * Elastic Container Service Developer Guide*. If your specified role has a path other than ``/``, then you must + * either specify the full role ARN (this is recommended) or prefix the role name with the path. For example, if a + * role with the name ``bar`` has a path of ``/foo/`` then you would specify ``/foo/bar`` as the role name. For more + * information, see [Friendly names and + * paths](https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_identifiers.html#identifiers-friendly-names) in + * the *IAM User Guide*. + * + * @return the role value. + */ + public String role() { + return this.role; + } + + /** + * Set the role property: The name or full Amazon Resource Name (ARN) of the IAM role that allows Amazon ECS to make + * calls to your load balancer on your behalf. This parameter is only permitted if you are using a load balancer + * with your service and your task definition doesn't use the ``awsvpc`` network mode. If you specify the ``role`` + * parameter, you must also specify a load balancer object with the ``loadBalancers`` parameter. If your account has + * already created the Amazon ECS service-linked role, that role is used for your service unless you specify a role + * here. The service-linked role is required if your task definition uses the ``awsvpc`` network mode or if the + * service is configured to use service discovery, an external deployment controller, multiple target groups, or + * Elastic Inference accelerators in which case you don't specify a role here. For more information, see [Using + * service-linked roles for Amazon + * ECS](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/using-service-linked-roles.html) in the *Amazon + * Elastic Container Service Developer Guide*. If your specified role has a path other than ``/``, then you must + * either specify the full role ARN (this is recommended) or prefix the role name with the path. For example, if a + * role with the name ``bar`` has a path of ``/foo/`` then you would specify ``/foo/bar`` as the role name. For more + * information, see [Friendly names and + * paths](https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_identifiers.html#identifiers-friendly-names) in + * the *IAM User Guide*. + * + * @param role the role value to set. + * @return the AwsEcsServiceProperties object itself. + */ + public AwsEcsServiceProperties withRole(String role) { + this.role = role; + return this; + } + + /** + * Get the schedulingStrategy property: The scheduling strategy to use for the service. For more information, see + * [Services](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/ecs_services.html). There are two service + * scheduler strategies available: + ``REPLICA``-The replica scheduling strategy places and maintains the desired + * number of tasks across your cluster. By default, the service scheduler spreads tasks across Availability Zones. + * You can use task placement strategies and constraints to customize task placement decisions. This scheduler + * strategy is required if the service uses the ``CODE_DEPLOY`` or ``EXTERNAL`` deployment controller types. + + * ``DAEMON``-The daemon scheduling strategy deploys exactly one task on each active container instance that meets + * all of the task placement constraints that you specify in your cluster. The service scheduler also evaluates the + * task placement constraints for running tasks and will stop tasks that don't meet the placement constraints. When + * you're using this strategy, you don't need to specify a desired number of tasks, a task placement strategy, or + * use Service Auto Scaling policies. Tasks using the Fargate launch type or the ``CODE_DEPLOY`` or ``EXTERNAL`` + * deployment controller types don't support the ``DAEMON`` scheduling strategy. + * + * @return the schedulingStrategy value. + */ + public SchedulingStrategy schedulingStrategy() { + return this.schedulingStrategy; + } + + /** + * Set the schedulingStrategy property: The scheduling strategy to use for the service. For more information, see + * [Services](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/ecs_services.html). There are two service + * scheduler strategies available: + ``REPLICA``-The replica scheduling strategy places and maintains the desired + * number of tasks across your cluster. By default, the service scheduler spreads tasks across Availability Zones. + * You can use task placement strategies and constraints to customize task placement decisions. This scheduler + * strategy is required if the service uses the ``CODE_DEPLOY`` or ``EXTERNAL`` deployment controller types. + + * ``DAEMON``-The daemon scheduling strategy deploys exactly one task on each active container instance that meets + * all of the task placement constraints that you specify in your cluster. The service scheduler also evaluates the + * task placement constraints for running tasks and will stop tasks that don't meet the placement constraints. When + * you're using this strategy, you don't need to specify a desired number of tasks, a task placement strategy, or + * use Service Auto Scaling policies. Tasks using the Fargate launch type or the ``CODE_DEPLOY`` or ``EXTERNAL`` + * deployment controller types don't support the ``DAEMON`` scheduling strategy. + * + * @param schedulingStrategy the schedulingStrategy value to set. + * @return the AwsEcsServiceProperties object itself. + */ + public AwsEcsServiceProperties withSchedulingStrategy(SchedulingStrategy schedulingStrategy) { + this.schedulingStrategy = schedulingStrategy; + return this; + } + + /** + * Get the serviceArn property: Property serviceArn. + * + * @return the serviceArn value. + */ + public String serviceArn() { + return this.serviceArn; + } + + /** + * Set the serviceArn property: Property serviceArn. + * + * @param serviceArn the serviceArn value to set. + * @return the AwsEcsServiceProperties object itself. + */ + public AwsEcsServiceProperties withServiceArn(String serviceArn) { + this.serviceArn = serviceArn; + return this; + } + + /** + * Get the serviceConnectConfiguration property: The configuration for this service to discover and connect to + * services, and be discovered by, and connected from, other services within a namespace. Tasks that run in a + * namespace can use short names to connect to services in the namespace. Tasks can connect to services across all + * of the clusters in the namespace. Tasks connect through a managed proxy container that collects logs and metrics + * for increased visibility. Only the tasks that Amazon ECS services create are supported with Service Connect. For + * more information, see [Service + * Connect](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/service-connect.html) in the *Amazon Elastic + * Container Service Developer Guide*. The Service Connect configuration of your Amazon ECS service. The + * configuration for this service to discover and connect to services, and be discovered by, and connected from, + * other services within a namespace. Tasks that run in a namespace can use short names to connect to services in + * the namespace. Tasks can connect to services across all of the clusters in the namespace. Tasks connect through a + * managed proxy container that collects logs and metrics for increased visibility. Only the tasks that Amazon ECS + * services create are supported with Service Connect. For more information, see [Service + * Connect](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/service-connect.html) in the *Amazon Elastic + * Container Service Developer Guide*. + * + * @return the serviceConnectConfiguration value. + */ + public ServiceConnectConfiguration serviceConnectConfiguration() { + return this.serviceConnectConfiguration; + } + + /** + * Set the serviceConnectConfiguration property: The configuration for this service to discover and connect to + * services, and be discovered by, and connected from, other services within a namespace. Tasks that run in a + * namespace can use short names to connect to services in the namespace. Tasks can connect to services across all + * of the clusters in the namespace. Tasks connect through a managed proxy container that collects logs and metrics + * for increased visibility. Only the tasks that Amazon ECS services create are supported with Service Connect. For + * more information, see [Service + * Connect](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/service-connect.html) in the *Amazon Elastic + * Container Service Developer Guide*. The Service Connect configuration of your Amazon ECS service. The + * configuration for this service to discover and connect to services, and be discovered by, and connected from, + * other services within a namespace. Tasks that run in a namespace can use short names to connect to services in + * the namespace. Tasks can connect to services across all of the clusters in the namespace. Tasks connect through a + * managed proxy container that collects logs and metrics for increased visibility. Only the tasks that Amazon ECS + * services create are supported with Service Connect. For more information, see [Service + * Connect](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/service-connect.html) in the *Amazon Elastic + * Container Service Developer Guide*. + * + * @param serviceConnectConfiguration the serviceConnectConfiguration value to set. + * @return the AwsEcsServiceProperties object itself. + */ + public AwsEcsServiceProperties + withServiceConnectConfiguration(ServiceConnectConfiguration serviceConnectConfiguration) { + this.serviceConnectConfiguration = serviceConnectConfiguration; + return this; + } + + /** + * Get the serviceName property: The name of your service. Up to 255 letters (uppercase and lowercase), numbers, + * underscores, and hyphens are allowed. Service names must be unique within a cluster, but you can have similarly + * named services in multiple clusters within a Region or across multiple Regions. The stack update fails if you + * change any properties that require replacement and the ``ServiceName`` is configured. This is because AWS + * CloudFormation creates the replacement service first, but each ``ServiceName`` must be unique in the cluster. + * + * @return the serviceName value. + */ + public String serviceName() { + return this.serviceName; + } + + /** + * Set the serviceName property: The name of your service. Up to 255 letters (uppercase and lowercase), numbers, + * underscores, and hyphens are allowed. Service names must be unique within a cluster, but you can have similarly + * named services in multiple clusters within a Region or across multiple Regions. The stack update fails if you + * change any properties that require replacement and the ``ServiceName`` is configured. This is because AWS + * CloudFormation creates the replacement service first, but each ``ServiceName`` must be unique in the cluster. + * + * @param serviceName the serviceName value to set. + * @return the AwsEcsServiceProperties object itself. + */ + public AwsEcsServiceProperties withServiceName(String serviceName) { + this.serviceName = serviceName; + return this; + } + + /** + * Get the serviceRegistries property: The details of the service discovery registry to associate with this service. + * For more information, see [Service + * discovery](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/service-discovery.html). Each service may + * be associated with one service registry. Multiple service registries for each service isn't supported. + * + * @return the serviceRegistries value. + */ + public List serviceRegistries() { + return this.serviceRegistries; + } + + /** + * Set the serviceRegistries property: The details of the service discovery registry to associate with this service. + * For more information, see [Service + * discovery](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/service-discovery.html). Each service may + * be associated with one service registry. Multiple service registries for each service isn't supported. + * + * @param serviceRegistries the serviceRegistries value to set. + * @return the AwsEcsServiceProperties object itself. + */ + public AwsEcsServiceProperties withServiceRegistries(List serviceRegistries) { + this.serviceRegistries = serviceRegistries; + return this; + } + + /** + * Get the tags property: The metadata that you apply to the service to help you categorize and organize them. Each + * tag consists of a key and an optional value, both of which you define. When a service is deleted, the tags are + * deleted as well. The following basic restrictions apply to tags: + Maximum number of tags per resource - 50 + For + * each resource, each tag key must be unique, and each tag key can have only one value. + Maximum key length - 128 + * Unicode characters in UTF-8 + Maximum value length - 256 Unicode characters in UTF-8 + If your tagging schema is + * used across multiple services and resources, remember that other services may have restrictions on allowed + * characters. Generally allowed characters are: letters, numbers, and spaces representable in UTF-8, and the + * following characters: + - = . _ : / @. + Tag keys and values are case-sensitive. + Do not use ``aws:``, + * ``AWS:``, or any upper or lowercase combination of such as a prefix for either keys or values as it is reserved + * for AWS use. You cannot edit or delete tag keys or values with this prefix. Tags with this prefix do not count + * against your tags per resource limit. + * + * @return the tags value. + */ + public List tags() { + return this.tags; + } + + /** + * Set the tags property: The metadata that you apply to the service to help you categorize and organize them. Each + * tag consists of a key and an optional value, both of which you define. When a service is deleted, the tags are + * deleted as well. The following basic restrictions apply to tags: + Maximum number of tags per resource - 50 + For + * each resource, each tag key must be unique, and each tag key can have only one value. + Maximum key length - 128 + * Unicode characters in UTF-8 + Maximum value length - 256 Unicode characters in UTF-8 + If your tagging schema is + * used across multiple services and resources, remember that other services may have restrictions on allowed + * characters. Generally allowed characters are: letters, numbers, and spaces representable in UTF-8, and the + * following characters: + - = . _ : / @. + Tag keys and values are case-sensitive. + Do not use ``aws:``, + * ``AWS:``, or any upper or lowercase combination of such as a prefix for either keys or values as it is reserved + * for AWS use. You cannot edit or delete tag keys or values with this prefix. Tags with this prefix do not count + * against your tags per resource limit. + * + * @param tags the tags value to set. + * @return the AwsEcsServiceProperties object itself. + */ + public AwsEcsServiceProperties withTags(List tags) { + this.tags = tags; + return this; + } + + /** + * Get the taskDefinition property: The ``family`` and ``revision`` (``family:revision``) or full ARN of the task + * definition to run in your service. If a ``revision`` isn't specified, the latest ``ACTIVE`` revision is used. A + * task definition must be specified if the service uses either the ``ECS`` or ``CODE_DEPLOY`` deployment + * controllers. For more information about deployment types, see [Amazon ECS deployment + * types](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/deployment-types.html). + * + * @return the taskDefinition value. + */ + public String taskDefinition() { + return this.taskDefinition; + } + + /** + * Set the taskDefinition property: The ``family`` and ``revision`` (``family:revision``) or full ARN of the task + * definition to run in your service. If a ``revision`` isn't specified, the latest ``ACTIVE`` revision is used. A + * task definition must be specified if the service uses either the ``ECS`` or ``CODE_DEPLOY`` deployment + * controllers. For more information about deployment types, see [Amazon ECS deployment + * types](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/deployment-types.html). + * + * @param taskDefinition the taskDefinition value to set. + * @return the AwsEcsServiceProperties object itself. + */ + public AwsEcsServiceProperties withTaskDefinition(String taskDefinition) { + this.taskDefinition = taskDefinition; + return this; + } + + /** + * Get the volumeConfigurations property: The configuration for a volume specified in the task definition as a + * volume that is configured at launch time. Currently, the only supported volume type is an Amazon EBS volume. + * + * @return the volumeConfigurations value. + */ + public List volumeConfigurations() { + return this.volumeConfigurations; + } + + /** + * Set the volumeConfigurations property: The configuration for a volume specified in the task definition as a + * volume that is configured at launch time. Currently, the only supported volume type is an Amazon EBS volume. + * + * @param volumeConfigurations the volumeConfigurations value to set. + * @return the AwsEcsServiceProperties object itself. + */ + public AwsEcsServiceProperties withVolumeConfigurations(List volumeConfigurations) { + this.volumeConfigurations = volumeConfigurations; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (capacityProviderStrategy() != null) { + capacityProviderStrategy().forEach(e -> e.validate()); + } + if (deploymentConfiguration() != null) { + deploymentConfiguration().validate(); + } + if (deploymentController() != null) { + deploymentController().validate(); + } + if (loadBalancers() != null) { + loadBalancers().forEach(e -> e.validate()); + } + if (networkConfiguration() != null) { + networkConfiguration().validate(); + } + if (placementConstraints() != null) { + placementConstraints().forEach(e -> e.validate()); + } + if (placementStrategies() != null) { + placementStrategies().forEach(e -> e.validate()); + } + if (serviceConnectConfiguration() != null) { + serviceConnectConfiguration().validate(); + } + if (serviceRegistries() != null) { + serviceRegistries().forEach(e -> e.validate()); + } + if (tags() != null) { + tags().forEach(e -> e.validate()); + } + if (volumeConfigurations() != null) { + volumeConfigurations().forEach(e -> e.validate()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("capacityProviderStrategy", this.capacityProviderStrategy, + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("cluster", this.cluster); + jsonWriter.writeJsonField("deploymentConfiguration", this.deploymentConfiguration); + jsonWriter.writeJsonField("deploymentController", this.deploymentController); + jsonWriter.writeNumberField("desiredCount", this.desiredCount); + jsonWriter.writeBooleanField("enableECSManagedTags", this.enableEcsManagedTags); + jsonWriter.writeBooleanField("enableExecuteCommand", this.enableExecuteCommand); + jsonWriter.writeNumberField("healthCheckGracePeriodSeconds", this.healthCheckGracePeriodSeconds); + jsonWriter.writeStringField("launchType", this.launchType == null ? null : this.launchType.toString()); + jsonWriter.writeArrayField("loadBalancers", this.loadBalancers, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("name", this.name); + jsonWriter.writeJsonField("networkConfiguration", this.networkConfiguration); + jsonWriter.writeArrayField("placementConstraints", this.placementConstraints, + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("placementStrategies", this.placementStrategies, + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("platformVersion", this.platformVersion); + jsonWriter.writeStringField("propagateTags", this.propagateTags == null ? null : this.propagateTags.toString()); + jsonWriter.writeStringField("role", this.role); + jsonWriter.writeStringField("schedulingStrategy", + this.schedulingStrategy == null ? null : this.schedulingStrategy.toString()); + jsonWriter.writeStringField("serviceArn", this.serviceArn); + jsonWriter.writeJsonField("serviceConnectConfiguration", this.serviceConnectConfiguration); + jsonWriter.writeStringField("serviceName", this.serviceName); + jsonWriter.writeArrayField("serviceRegistries", this.serviceRegistries, + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("tags", this.tags, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("taskDefinition", this.taskDefinition); + jsonWriter.writeArrayField("volumeConfigurations", this.volumeConfigurations, + (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AwsEcsServiceProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AwsEcsServiceProperties if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the AwsEcsServiceProperties. + */ + public static AwsEcsServiceProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AwsEcsServiceProperties deserializedAwsEcsServiceProperties = new AwsEcsServiceProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("capacityProviderStrategy".equals(fieldName)) { + List capacityProviderStrategy + = reader.readArray(reader1 -> CapacityProviderStrategyItem.fromJson(reader1)); + deserializedAwsEcsServiceProperties.capacityProviderStrategy = capacityProviderStrategy; + } else if ("cluster".equals(fieldName)) { + deserializedAwsEcsServiceProperties.cluster = reader.getString(); + } else if ("deploymentConfiguration".equals(fieldName)) { + deserializedAwsEcsServiceProperties.deploymentConfiguration + = DeploymentConfiguration.fromJson(reader); + } else if ("deploymentController".equals(fieldName)) { + deserializedAwsEcsServiceProperties.deploymentController = DeploymentController.fromJson(reader); + } else if ("desiredCount".equals(fieldName)) { + deserializedAwsEcsServiceProperties.desiredCount = reader.getNullable(JsonReader::getInt); + } else if ("enableECSManagedTags".equals(fieldName)) { + deserializedAwsEcsServiceProperties.enableEcsManagedTags + = reader.getNullable(JsonReader::getBoolean); + } else if ("enableExecuteCommand".equals(fieldName)) { + deserializedAwsEcsServiceProperties.enableExecuteCommand + = reader.getNullable(JsonReader::getBoolean); + } else if ("healthCheckGracePeriodSeconds".equals(fieldName)) { + deserializedAwsEcsServiceProperties.healthCheckGracePeriodSeconds + = reader.getNullable(JsonReader::getInt); + } else if ("launchType".equals(fieldName)) { + deserializedAwsEcsServiceProperties.launchType = LaunchType.fromString(reader.getString()); + } else if ("loadBalancers".equals(fieldName)) { + List loadBalancers = reader.readArray(reader1 -> LoadBalancer.fromJson(reader1)); + deserializedAwsEcsServiceProperties.loadBalancers = loadBalancers; + } else if ("name".equals(fieldName)) { + deserializedAwsEcsServiceProperties.name = reader.getString(); + } else if ("networkConfiguration".equals(fieldName)) { + deserializedAwsEcsServiceProperties.networkConfiguration = NetworkConfiguration.fromJson(reader); + } else if ("placementConstraints".equals(fieldName)) { + List placementConstraints + = reader.readArray(reader1 -> PlacementConstraint.fromJson(reader1)); + deserializedAwsEcsServiceProperties.placementConstraints = placementConstraints; + } else if ("placementStrategies".equals(fieldName)) { + List placementStrategies + = reader.readArray(reader1 -> PlacementStrategy.fromJson(reader1)); + deserializedAwsEcsServiceProperties.placementStrategies = placementStrategies; + } else if ("platformVersion".equals(fieldName)) { + deserializedAwsEcsServiceProperties.platformVersion = reader.getString(); + } else if ("propagateTags".equals(fieldName)) { + deserializedAwsEcsServiceProperties.propagateTags = PropagateTags.fromString(reader.getString()); + } else if ("role".equals(fieldName)) { + deserializedAwsEcsServiceProperties.role = reader.getString(); + } else if ("schedulingStrategy".equals(fieldName)) { + deserializedAwsEcsServiceProperties.schedulingStrategy + = SchedulingStrategy.fromString(reader.getString()); + } else if ("serviceArn".equals(fieldName)) { + deserializedAwsEcsServiceProperties.serviceArn = reader.getString(); + } else if ("serviceConnectConfiguration".equals(fieldName)) { + deserializedAwsEcsServiceProperties.serviceConnectConfiguration + = ServiceConnectConfiguration.fromJson(reader); + } else if ("serviceName".equals(fieldName)) { + deserializedAwsEcsServiceProperties.serviceName = reader.getString(); + } else if ("serviceRegistries".equals(fieldName)) { + List serviceRegistries + = reader.readArray(reader1 -> ServiceRegistry.fromJson(reader1)); + deserializedAwsEcsServiceProperties.serviceRegistries = serviceRegistries; + } else if ("tags".equals(fieldName)) { + List tags = reader.readArray(reader1 -> TagAutoGenerated26.fromJson(reader1)); + deserializedAwsEcsServiceProperties.tags = tags; + } else if ("taskDefinition".equals(fieldName)) { + deserializedAwsEcsServiceProperties.taskDefinition = reader.getString(); + } else if ("volumeConfigurations".equals(fieldName)) { + List volumeConfigurations + = reader.readArray(reader1 -> ServiceVolumeConfiguration.fromJson(reader1)); + deserializedAwsEcsServiceProperties.volumeConfigurations = volumeConfigurations; + } else { + reader.skipChildren(); + } + } + + return deserializedAwsEcsServiceProperties; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/AwsEcsTaskDefinitionProperties.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/AwsEcsTaskDefinitionProperties.java new file mode 100644 index 000000000000..3ddf7a464f69 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/AwsEcsTaskDefinitionProperties.java @@ -0,0 +1,1002 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Definition of awsEcsTaskDefinition. + */ +@Fluent +public final class AwsEcsTaskDefinitionProperties implements JsonSerializable { + /* + * A list of container definitions in JSON format that describe the different containers that make up your task. For + * more information about container definition parameters and defaults, see [Amazon ECS Task + * Definitions](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/task_defintions.html) in the *Amazon + * Elastic Container Service Developer Guide*. + */ + private List containerDefinitions; + + /* + * The number of ``cpu`` units used by the task. If you use the EC2 launch type, this field is optional. Any value + * can be used. If you use the Fargate launch type, this field is required. You must use one of the following + * values. The value that you choose determines your range of valid values for the ``memory`` parameter. The CPU + * units cannot be less than 1 vCPU when you use Windows containers on Fargate. + 256 (.25 vCPU) - Available + * ``memory`` values: 512 (0.5 GB), 1024 (1 GB), 2048 (2 GB) + 512 (.5 vCPU) - Available ``memory`` values: 1024 (1 + * GB), 2048 (2 GB), 3072 (3 GB), 4096 (4 GB) + 1024 (1 vCPU) - Available ``memory`` values: 2048 (2 GB), 3072 (3 + * GB), 4096 (4 GB), 5120 (5 GB), 6144 (6 GB), 7168 (7 GB), 8192 (8 GB) + 2048 (2 vCPU) - Available ``memory`` + * values: 4096 (4 GB) and 16384 (16 GB) in increments of 1024 (1 GB) + 4096 (4 vCPU) - Available ``memory`` values: + * 8192 (8 GB) and 30720 (30 GB) in increments of 1024 (1 GB) + 8192 (8 vCPU) - Available ``memory`` values: 16 GB + * and 60 GB in 4 GB increments This option requires Linux platform ``1.4.0`` or later. + 16384 (16vCPU) - Available + * ``memory`` values: 32GB and 120 GB in 8 GB increments This option requires Linux platform ``1.4.0`` or later. + */ + private String cpu; + + /* + * The ephemeral storage settings to use for tasks run with the task definition. The amount of ephemeral storage to + * allocate for the task. This parameter is used to expand the total amount of ephemeral storage available, beyond + * the default amount, for tasks hosted on FARGATElong. For more information, see [Using data volumes in + * tasks](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/using_data_volumes.html) in the *Amazon ECS + * Developer Guide;*. For tasks using the Fargate launch type, the task requires the following platforms: + Linux + * platform version ``1.4.0`` or later. + Windows platform version ``1.0.0`` or later. + */ + private EphemeralStorage ephemeralStorage; + + /* + * The Amazon Resource Name (ARN) of the task execution role that grants the Amazon ECS container agent permission + * to make AWS API calls on your behalf. The task execution IAM role is required depending on the requirements of + * your task. For more information, see [Amazon ECS task execution IAM + * role](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/task_execution_IAM_role.html) in the *Amazon + * Elastic Container Service Developer Guide*. + */ + private String executionRoleArn; + + /* + * The name of a family that this task definition is registered to. Up to 255 letters (uppercase and lowercase), + * numbers, hyphens, and underscores are allowed. A family groups multiple versions of a task definition. Amazon ECS + * gives the first task definition that you registered to a family a revision number of 1. Amazon ECS gives + * sequential revision numbers to each task definition that you add. To use revision numbers when you update a task + * definition, specify this property. If you don't specify a value, CFNlong generates a new task definition each + * time that you update it. + */ + private String family; + + /* + * The Elastic Inference accelerators to use for the containers in the task. + */ + private List inferenceAccelerators; + + /* + * The IPC resource namespace to use for the containers in the task. The valid values are ``host``, ``task``, or + * ``none``. If ``host`` is specified, then all containers within the tasks that specified the ``host`` IPC mode on + * the same container instance share the same IPC resources with the host Amazon EC2 instance. If ``task`` is + * specified, all containers within the specified task share the same IPC resources. If ``none`` is specified, then + * IPC resources within the containers of a task are private and not shared with other containers in a task or on + * the container instance. If no value is specified, then the IPC resource namespace sharing depends on the Docker + * daemon setting on the container instance. For more information, see [IPC + * settings](https://docs.aws.amazon.com/https://docs.docker.com/engine/reference/run/#ipc-settings---ipc) in the + * *Docker run reference*. If the ``host`` IPC mode is used, be aware that there is a heightened risk of undesired + * IPC namespace expose. For more information, see [Docker + * security](https://docs.aws.amazon.com/https://docs.docker.com/engine/security/security/). If you are setting + * namespaced kernel parameters using ``systemControls`` for the containers in the task, the following will apply to + * your IPC resource namespace. For more information, see [System + * Controls](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/task_definition_parameters.html) in the + * *Amazon Elastic Container Service Developer Guide*. + For tasks that use the ``host`` IPC mode, IPC namespace + * related ``systemControls`` are not supported. + For tasks that use the ``task`` IPC mode, IPC namespace related + * ``systemControls`` will apply to all containers within a task. This parameter is not supported for Windows + * containers or tasks run on FARGATElong. + */ + private String ipcMode; + + /* + * The amount (in MiB) of memory used by the task. If your tasks runs on Amazon EC2 instances, you must specify + * either a task-level memory value or a container-level memory value. This field is optional and any value can be + * used. If a task-level memory value is specified, the container-level memory value is optional. For more + * information regarding container-level memory and memory reservation, see + * [ContainerDefinition](https://docs.aws.amazon.com/AmazonECS/latest/APIReference/API_ContainerDefinition.html). If + * your tasks runs on FARGATElong, this field is required. You must use one of the following values. The value you + * choose determines your range of valid values for the ``cpu`` parameter. + 512 (0.5 GB), 1024 (1 GB), 2048 (2 GB) + * - Available ``cpu`` values: 256 (.25 vCPU) + 1024 (1 GB), 2048 (2 GB), 3072 (3 GB), 4096 (4 GB) - Available + * ``cpu`` values: 512 (.5 vCPU) + 2048 (2 GB), 3072 (3 GB), 4096 (4 GB), 5120 (5 GB), 6144 (6 GB), 7168 (7 GB), + * 8192 (8 GB) - Available ``cpu`` values: 1024 (1 vCPU) + Between 4096 (4 GB) and 16384 (16 GB) in increments of + * 1024 (1 GB) - Available ``cpu`` values: 2048 (2 vCPU) + Between 8192 (8 GB) and 30720 (30 GB) in increments of + * 1024 (1 GB) - Available ``cpu`` values: 4096 (4 vCPU) + Between 16 GB and 60 GB in 4 GB increments - Available + * ``cpu`` values: 8192 (8 vCPU) This option requires Linux platform ``1.4.0`` or later. + Between 32GB and 120 GB + * in 8 GB increments - Available ``cpu`` values: 16384 (16 vCPU) This option requires Linux platform ``1.4.0`` or + * later. + */ + private String memory; + + /* + * The Docker networking mode to use for the containers in the task. The valid values are ``none``, ``bridge``, + * ``awsvpc``, and ``host``. If no network mode is specified, the default is ``bridge``. For Amazon ECS tasks on + * Fargate, the ``awsvpc`` network mode is required. For Amazon ECS tasks on Amazon EC2 Linux instances, any network + * mode can be used. For Amazon ECS tasks on Amazon EC2 Windows instances, ```` or ``awsvpc`` can be used. + * If the network mode is set to ``none``, you cannot specify port mappings in your container definitions, and the + * tasks containers do not have external connectivity. The ``host`` and ``awsvpc`` network modes offer the highest + * networking performance for containers because they use the EC2 network stack instead of the virtualized network + * stack provided by the ``bridge`` mode. With the ``host`` and ``awsvpc`` network modes, exposed container ports + * are mapped directly to the corresponding host port (for the ``host`` network mode) or the attached elastic + * network interface port (for the ``awsvpc`` network mode), so you cannot take advantage of dynamic host port + * mappings. When using the ``host`` network mode, you should not run containers using the root user (UID 0). It is + * considered best practice to use a non-root user. If the network mode is ``awsvpc``, the task is allocated an + * elastic network interface, and you must specify a NetworkConfiguration value when you create a service or run a + * task with the task definition. For more information, see [Task + * Networking](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/task-networking.html) in the *Amazon + * Elastic Container Service Developer Guide*. If the network mode is ``host``, you cannot run multiple + * instantiations of the same task on a single container instance when port mappings are used. For more information, + * see [Network + * settings](https://docs.aws.amazon.com/https://docs.docker.com/engine/reference/run/#network-settings) in the + * *Docker run reference*. + */ + private String networkMode; + + /* + * The process namespace to use for the containers in the task. The valid values are ``host`` or ``task``. On + * Fargate for Linux containers, the only valid value is ``task``. For example, monitoring sidecars might need + * ``pidMode`` to access information about other containers running in the same task. If ``host`` is specified, all + * containers within the tasks that specified the ``host`` PID mode on the same container instance share the same + * process namespace with the host Amazon EC2 instance. If ``task`` is specified, all containers within the + * specified task share the same process namespace. If no value is specified, the default is a private namespace for + * each container. For more information, see [PID + * settings](https://docs.aws.amazon.com/https://docs.docker.com/engine/reference/run/#pid-settings---pid) in the + * *Docker run reference*. If the ``host`` PID mode is used, there's a heightened risk of undesired process + * namespace exposure. For more information, see [Docker + * security](https://docs.aws.amazon.com/https://docs.docker.com/engine/security/security/). This parameter is not + * supported for Windows containers. This parameter is only supported for tasks that are hosted on FARGATElong if + * the tasks are using platform version ``1.4.0`` or later (Linux). This isn't supported for Windows containers on + * Fargate. + */ + private String pidMode; + + /* + * An array of placement constraint objects to use for tasks. This parameter isn't supported for tasks run on + * FARGATElong. + */ + private List placementConstraints; + + /* + * The configuration details for the App Mesh proxy. Your Amazon ECS container instances require at least version + * 1.26.0 of the container agent and at least version 1.26.0-1 of the ``ecs-init`` package to use a proxy + * configuration. If your container instances are launched from the Amazon ECS optimized AMI version ``20190301`` or + * later, they contain the required versions of the container agent and ``ecs-init``. For more information, see + * [Amazon ECS-optimized Linux + * AMI](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/ecs-optimized_AMI.html) in the *Amazon Elastic + * Container Service Developer Guide*. The configuration details for the App Mesh proxy. For tasks that use the EC2 + * launch type, the container instances require at least version 1.26.0 of the container agent and at least version + * 1.26.0-1 of the ``ecs-init`` package to use a proxy configuration. If your container instances are launched from + * the Amazon ECS optimized AMI version ``20190301`` or later, then they contain the required versions of the + * container agent and ``ecs-init``. For more information, see [Amazon ECS-optimized Linux + * AMI](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/ecs-optimized_AMI.html) + */ + private ProxyConfiguration proxyConfiguration; + + /* + * The task launch types the task definition was validated against. The valid values are ``EC2``, ``FARGATE``, and + * ``EXTERNAL``. For more information, see [Amazon ECS launch + * types](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/launch_types.html) in the *Amazon Elastic + * Container Service Developer Guide*. + */ + private List requiresCompatibilities; + + /* + * The operating system that your tasks definitions run on. A platform family is specified only for tasks using the + * Fargate launch type. When you specify a task definition in a service, this value must match the + * ``runtimePlatform`` value of the service. Information about the platform for the Amazon ECS service or task. For + * more information about ``RuntimePlatform``, see + * [RuntimePlatform](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/task_definition_parameters.html# + * runtime-platform) in the *Amazon Elastic Container Service Developer Guide*. + */ + private RuntimePlatform runtimePlatform; + + /* + * The metadata that you apply to the task definition to help you categorize and organize them. Each tag consists of + * a key and an optional value. You define both of them. The following basic restrictions apply to tags: + Maximum + * number of tags per resource - 50 + For each resource, each tag key must be unique, and each tag key can have only + * one value. + Maximum key length - 128 Unicode characters in UTF-8 + Maximum value length - 256 Unicode characters + * in UTF-8 + If your tagging schema is used across multiple services and resources, remember that other services + * may have restrictions on allowed characters. Generally allowed characters are: letters, numbers, and spaces + * representable in UTF-8, and the following characters: + - = . _ : / @. + Tag keys and values are case-sensitive. + * + Do not use ``aws:``, ``AWS:``, or any upper or lowercase combination of such as a prefix for either keys or + * values as it is reserved for AWS use. You cannot edit or delete tag keys or values with this prefix. Tags with + * this prefix do not count against your tags per resource limit. + */ + private List tags; + + /* + * Property taskDefinitionArn + */ + private String taskDefinitionArn; + + /* + * The short name or full Amazon Resource Name (ARN) of the IAMlong role that grants containers in the task + * permission to call AWS APIs on your behalf. For more information, see [Amazon ECS Task + * Role](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/task-iam-roles.html) in the *Amazon Elastic + * Container Service Developer Guide*. IAM roles for tasks on Windows require that the ``-EnableTaskIAMRole`` option + * is set when you launch the Amazon ECS-optimized Windows AMI. Your containers must also run some configuration + * code to use the feature. For more information, see [Windows IAM roles for + * tasks](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/windows_task_IAM_roles.html) in the *Amazon + * Elastic Container Service Developer Guide*. + */ + private String taskRoleArn; + + /* + * The list of data volume definitions for the task. For more information, see [Using data volumes in + * tasks](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/using_data_volumes.html) in the *Amazon + * Elastic Container Service Developer Guide*. The ``host`` and ``sourcePath`` parameters aren't supported for tasks + * run on FARGATElong. + */ + private List volumes; + + /** + * Creates an instance of AwsEcsTaskDefinitionProperties class. + */ + public AwsEcsTaskDefinitionProperties() { + } + + /** + * Get the containerDefinitions property: A list of container definitions in JSON format that describe the different + * containers that make up your task. For more information about container definition parameters and defaults, see + * [Amazon ECS Task Definitions](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/task_defintions.html) + * in the *Amazon Elastic Container Service Developer Guide*. + * + * @return the containerDefinitions value. + */ + public List containerDefinitions() { + return this.containerDefinitions; + } + + /** + * Set the containerDefinitions property: A list of container definitions in JSON format that describe the different + * containers that make up your task. For more information about container definition parameters and defaults, see + * [Amazon ECS Task Definitions](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/task_defintions.html) + * in the *Amazon Elastic Container Service Developer Guide*. + * + * @param containerDefinitions the containerDefinitions value to set. + * @return the AwsEcsTaskDefinitionProperties object itself. + */ + public AwsEcsTaskDefinitionProperties withContainerDefinitions(List containerDefinitions) { + this.containerDefinitions = containerDefinitions; + return this; + } + + /** + * Get the cpu property: The number of ``cpu`` units used by the task. If you use the EC2 launch type, this field is + * optional. Any value can be used. If you use the Fargate launch type, this field is required. You must use one of + * the following values. The value that you choose determines your range of valid values for the ``memory`` + * parameter. The CPU units cannot be less than 1 vCPU when you use Windows containers on Fargate. + 256 (.25 vCPU) + * - Available ``memory`` values: 512 (0.5 GB), 1024 (1 GB), 2048 (2 GB) + 512 (.5 vCPU) - Available ``memory`` + * values: 1024 (1 GB), 2048 (2 GB), 3072 (3 GB), 4096 (4 GB) + 1024 (1 vCPU) - Available ``memory`` values: 2048 (2 + * GB), 3072 (3 GB), 4096 (4 GB), 5120 (5 GB), 6144 (6 GB), 7168 (7 GB), 8192 (8 GB) + 2048 (2 vCPU) - Available + * ``memory`` values: 4096 (4 GB) and 16384 (16 GB) in increments of 1024 (1 GB) + 4096 (4 vCPU) - Available + * ``memory`` values: 8192 (8 GB) and 30720 (30 GB) in increments of 1024 (1 GB) + 8192 (8 vCPU) - Available + * ``memory`` values: 16 GB and 60 GB in 4 GB increments This option requires Linux platform ``1.4.0`` or later. + + * 16384 (16vCPU) - Available ``memory`` values: 32GB and 120 GB in 8 GB increments This option requires Linux + * platform ``1.4.0`` or later. + * + * @return the cpu value. + */ + public String cpu() { + return this.cpu; + } + + /** + * Set the cpu property: The number of ``cpu`` units used by the task. If you use the EC2 launch type, this field is + * optional. Any value can be used. If you use the Fargate launch type, this field is required. You must use one of + * the following values. The value that you choose determines your range of valid values for the ``memory`` + * parameter. The CPU units cannot be less than 1 vCPU when you use Windows containers on Fargate. + 256 (.25 vCPU) + * - Available ``memory`` values: 512 (0.5 GB), 1024 (1 GB), 2048 (2 GB) + 512 (.5 vCPU) - Available ``memory`` + * values: 1024 (1 GB), 2048 (2 GB), 3072 (3 GB), 4096 (4 GB) + 1024 (1 vCPU) - Available ``memory`` values: 2048 (2 + * GB), 3072 (3 GB), 4096 (4 GB), 5120 (5 GB), 6144 (6 GB), 7168 (7 GB), 8192 (8 GB) + 2048 (2 vCPU) - Available + * ``memory`` values: 4096 (4 GB) and 16384 (16 GB) in increments of 1024 (1 GB) + 4096 (4 vCPU) - Available + * ``memory`` values: 8192 (8 GB) and 30720 (30 GB) in increments of 1024 (1 GB) + 8192 (8 vCPU) - Available + * ``memory`` values: 16 GB and 60 GB in 4 GB increments This option requires Linux platform ``1.4.0`` or later. + + * 16384 (16vCPU) - Available ``memory`` values: 32GB and 120 GB in 8 GB increments This option requires Linux + * platform ``1.4.0`` or later. + * + * @param cpu the cpu value to set. + * @return the AwsEcsTaskDefinitionProperties object itself. + */ + public AwsEcsTaskDefinitionProperties withCpu(String cpu) { + this.cpu = cpu; + return this; + } + + /** + * Get the ephemeralStorage property: The ephemeral storage settings to use for tasks run with the task definition. + * The amount of ephemeral storage to allocate for the task. This parameter is used to expand the total amount of + * ephemeral storage available, beyond the default amount, for tasks hosted on FARGATElong. For more information, + * see [Using data volumes in + * tasks](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/using_data_volumes.html) in the *Amazon ECS + * Developer Guide;*. For tasks using the Fargate launch type, the task requires the following platforms: + Linux + * platform version ``1.4.0`` or later. + Windows platform version ``1.0.0`` or later. + * + * @return the ephemeralStorage value. + */ + public EphemeralStorage ephemeralStorage() { + return this.ephemeralStorage; + } + + /** + * Set the ephemeralStorage property: The ephemeral storage settings to use for tasks run with the task definition. + * The amount of ephemeral storage to allocate for the task. This parameter is used to expand the total amount of + * ephemeral storage available, beyond the default amount, for tasks hosted on FARGATElong. For more information, + * see [Using data volumes in + * tasks](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/using_data_volumes.html) in the *Amazon ECS + * Developer Guide;*. For tasks using the Fargate launch type, the task requires the following platforms: + Linux + * platform version ``1.4.0`` or later. + Windows platform version ``1.0.0`` or later. + * + * @param ephemeralStorage the ephemeralStorage value to set. + * @return the AwsEcsTaskDefinitionProperties object itself. + */ + public AwsEcsTaskDefinitionProperties withEphemeralStorage(EphemeralStorage ephemeralStorage) { + this.ephemeralStorage = ephemeralStorage; + return this; + } + + /** + * Get the executionRoleArn property: The Amazon Resource Name (ARN) of the task execution role that grants the + * Amazon ECS container agent permission to make AWS API calls on your behalf. The task execution IAM role is + * required depending on the requirements of your task. For more information, see [Amazon ECS task execution IAM + * role](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/task_execution_IAM_role.html) in the *Amazon + * Elastic Container Service Developer Guide*. + * + * @return the executionRoleArn value. + */ + public String executionRoleArn() { + return this.executionRoleArn; + } + + /** + * Set the executionRoleArn property: The Amazon Resource Name (ARN) of the task execution role that grants the + * Amazon ECS container agent permission to make AWS API calls on your behalf. The task execution IAM role is + * required depending on the requirements of your task. For more information, see [Amazon ECS task execution IAM + * role](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/task_execution_IAM_role.html) in the *Amazon + * Elastic Container Service Developer Guide*. + * + * @param executionRoleArn the executionRoleArn value to set. + * @return the AwsEcsTaskDefinitionProperties object itself. + */ + public AwsEcsTaskDefinitionProperties withExecutionRoleArn(String executionRoleArn) { + this.executionRoleArn = executionRoleArn; + return this; + } + + /** + * Get the family property: The name of a family that this task definition is registered to. Up to 255 letters + * (uppercase and lowercase), numbers, hyphens, and underscores are allowed. A family groups multiple versions of a + * task definition. Amazon ECS gives the first task definition that you registered to a family a revision number of + * 1. Amazon ECS gives sequential revision numbers to each task definition that you add. To use revision numbers + * when you update a task definition, specify this property. If you don't specify a value, CFNlong generates a new + * task definition each time that you update it. + * + * @return the family value. + */ + public String family() { + return this.family; + } + + /** + * Set the family property: The name of a family that this task definition is registered to. Up to 255 letters + * (uppercase and lowercase), numbers, hyphens, and underscores are allowed. A family groups multiple versions of a + * task definition. Amazon ECS gives the first task definition that you registered to a family a revision number of + * 1. Amazon ECS gives sequential revision numbers to each task definition that you add. To use revision numbers + * when you update a task definition, specify this property. If you don't specify a value, CFNlong generates a new + * task definition each time that you update it. + * + * @param family the family value to set. + * @return the AwsEcsTaskDefinitionProperties object itself. + */ + public AwsEcsTaskDefinitionProperties withFamily(String family) { + this.family = family; + return this; + } + + /** + * Get the inferenceAccelerators property: The Elastic Inference accelerators to use for the containers in the task. + * + * @return the inferenceAccelerators value. + */ + public List inferenceAccelerators() { + return this.inferenceAccelerators; + } + + /** + * Set the inferenceAccelerators property: The Elastic Inference accelerators to use for the containers in the task. + * + * @param inferenceAccelerators the inferenceAccelerators value to set. + * @return the AwsEcsTaskDefinitionProperties object itself. + */ + public AwsEcsTaskDefinitionProperties withInferenceAccelerators(List inferenceAccelerators) { + this.inferenceAccelerators = inferenceAccelerators; + return this; + } + + /** + * Get the ipcMode property: The IPC resource namespace to use for the containers in the task. The valid values are + * ``host``, ``task``, or ``none``. If ``host`` is specified, then all containers within the tasks that specified + * the ``host`` IPC mode on the same container instance share the same IPC resources with the host Amazon EC2 + * instance. If ``task`` is specified, all containers within the specified task share the same IPC resources. If + * ``none`` is specified, then IPC resources within the containers of a task are private and not shared with other + * containers in a task or on the container instance. If no value is specified, then the IPC resource namespace + * sharing depends on the Docker daemon setting on the container instance. For more information, see [IPC + * settings](https://docs.aws.amazon.com/https://docs.docker.com/engine/reference/run/#ipc-settings---ipc) in the + * *Docker run reference*. If the ``host`` IPC mode is used, be aware that there is a heightened risk of undesired + * IPC namespace expose. For more information, see [Docker + * security](https://docs.aws.amazon.com/https://docs.docker.com/engine/security/security/). If you are setting + * namespaced kernel parameters using ``systemControls`` for the containers in the task, the following will apply to + * your IPC resource namespace. For more information, see [System + * Controls](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/task_definition_parameters.html) in the + * *Amazon Elastic Container Service Developer Guide*. + For tasks that use the ``host`` IPC mode, IPC namespace + * related ``systemControls`` are not supported. + For tasks that use the ``task`` IPC mode, IPC namespace related + * ``systemControls`` will apply to all containers within a task. This parameter is not supported for Windows + * containers or tasks run on FARGATElong. + * + * @return the ipcMode value. + */ + public String ipcMode() { + return this.ipcMode; + } + + /** + * Set the ipcMode property: The IPC resource namespace to use for the containers in the task. The valid values are + * ``host``, ``task``, or ``none``. If ``host`` is specified, then all containers within the tasks that specified + * the ``host`` IPC mode on the same container instance share the same IPC resources with the host Amazon EC2 + * instance. If ``task`` is specified, all containers within the specified task share the same IPC resources. If + * ``none`` is specified, then IPC resources within the containers of a task are private and not shared with other + * containers in a task or on the container instance. If no value is specified, then the IPC resource namespace + * sharing depends on the Docker daemon setting on the container instance. For more information, see [IPC + * settings](https://docs.aws.amazon.com/https://docs.docker.com/engine/reference/run/#ipc-settings---ipc) in the + * *Docker run reference*. If the ``host`` IPC mode is used, be aware that there is a heightened risk of undesired + * IPC namespace expose. For more information, see [Docker + * security](https://docs.aws.amazon.com/https://docs.docker.com/engine/security/security/). If you are setting + * namespaced kernel parameters using ``systemControls`` for the containers in the task, the following will apply to + * your IPC resource namespace. For more information, see [System + * Controls](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/task_definition_parameters.html) in the + * *Amazon Elastic Container Service Developer Guide*. + For tasks that use the ``host`` IPC mode, IPC namespace + * related ``systemControls`` are not supported. + For tasks that use the ``task`` IPC mode, IPC namespace related + * ``systemControls`` will apply to all containers within a task. This parameter is not supported for Windows + * containers or tasks run on FARGATElong. + * + * @param ipcMode the ipcMode value to set. + * @return the AwsEcsTaskDefinitionProperties object itself. + */ + public AwsEcsTaskDefinitionProperties withIpcMode(String ipcMode) { + this.ipcMode = ipcMode; + return this; + } + + /** + * Get the memory property: The amount (in MiB) of memory used by the task. If your tasks runs on Amazon EC2 + * instances, you must specify either a task-level memory value or a container-level memory value. This field is + * optional and any value can be used. If a task-level memory value is specified, the container-level memory value + * is optional. For more information regarding container-level memory and memory reservation, see + * [ContainerDefinition](https://docs.aws.amazon.com/AmazonECS/latest/APIReference/API_ContainerDefinition.html). If + * your tasks runs on FARGATElong, this field is required. You must use one of the following values. The value you + * choose determines your range of valid values for the ``cpu`` parameter. + 512 (0.5 GB), 1024 (1 GB), 2048 (2 GB) + * - Available ``cpu`` values: 256 (.25 vCPU) + 1024 (1 GB), 2048 (2 GB), 3072 (3 GB), 4096 (4 GB) - Available + * ``cpu`` values: 512 (.5 vCPU) + 2048 (2 GB), 3072 (3 GB), 4096 (4 GB), 5120 (5 GB), 6144 (6 GB), 7168 (7 GB), + * 8192 (8 GB) - Available ``cpu`` values: 1024 (1 vCPU) + Between 4096 (4 GB) and 16384 (16 GB) in increments of + * 1024 (1 GB) - Available ``cpu`` values: 2048 (2 vCPU) + Between 8192 (8 GB) and 30720 (30 GB) in increments of + * 1024 (1 GB) - Available ``cpu`` values: 4096 (4 vCPU) + Between 16 GB and 60 GB in 4 GB increments - Available + * ``cpu`` values: 8192 (8 vCPU) This option requires Linux platform ``1.4.0`` or later. + Between 32GB and 120 GB + * in 8 GB increments - Available ``cpu`` values: 16384 (16 vCPU) This option requires Linux platform ``1.4.0`` or + * later. + * + * @return the memory value. + */ + public String memory() { + return this.memory; + } + + /** + * Set the memory property: The amount (in MiB) of memory used by the task. If your tasks runs on Amazon EC2 + * instances, you must specify either a task-level memory value or a container-level memory value. This field is + * optional and any value can be used. If a task-level memory value is specified, the container-level memory value + * is optional. For more information regarding container-level memory and memory reservation, see + * [ContainerDefinition](https://docs.aws.amazon.com/AmazonECS/latest/APIReference/API_ContainerDefinition.html). If + * your tasks runs on FARGATElong, this field is required. You must use one of the following values. The value you + * choose determines your range of valid values for the ``cpu`` parameter. + 512 (0.5 GB), 1024 (1 GB), 2048 (2 GB) + * - Available ``cpu`` values: 256 (.25 vCPU) + 1024 (1 GB), 2048 (2 GB), 3072 (3 GB), 4096 (4 GB) - Available + * ``cpu`` values: 512 (.5 vCPU) + 2048 (2 GB), 3072 (3 GB), 4096 (4 GB), 5120 (5 GB), 6144 (6 GB), 7168 (7 GB), + * 8192 (8 GB) - Available ``cpu`` values: 1024 (1 vCPU) + Between 4096 (4 GB) and 16384 (16 GB) in increments of + * 1024 (1 GB) - Available ``cpu`` values: 2048 (2 vCPU) + Between 8192 (8 GB) and 30720 (30 GB) in increments of + * 1024 (1 GB) - Available ``cpu`` values: 4096 (4 vCPU) + Between 16 GB and 60 GB in 4 GB increments - Available + * ``cpu`` values: 8192 (8 vCPU) This option requires Linux platform ``1.4.0`` or later. + Between 32GB and 120 GB + * in 8 GB increments - Available ``cpu`` values: 16384 (16 vCPU) This option requires Linux platform ``1.4.0`` or + * later. + * + * @param memory the memory value to set. + * @return the AwsEcsTaskDefinitionProperties object itself. + */ + public AwsEcsTaskDefinitionProperties withMemory(String memory) { + this.memory = memory; + return this; + } + + /** + * Get the networkMode property: The Docker networking mode to use for the containers in the task. The valid values + * are ``none``, ``bridge``, ``awsvpc``, and ``host``. If no network mode is specified, the default is ``bridge``. + * For Amazon ECS tasks on Fargate, the ``awsvpc`` network mode is required. For Amazon ECS tasks on Amazon EC2 + * Linux instances, any network mode can be used. For Amazon ECS tasks on Amazon EC2 Windows instances, + * ``<default>`` or ``awsvpc`` can be used. If the network mode is set to ``none``, you cannot specify port + * mappings in your container definitions, and the tasks containers do not have external connectivity. The ``host`` + * and ``awsvpc`` network modes offer the highest networking performance for containers because they use the EC2 + * network stack instead of the virtualized network stack provided by the ``bridge`` mode. With the ``host`` and + * ``awsvpc`` network modes, exposed container ports are mapped directly to the corresponding host port (for the + * ``host`` network mode) or the attached elastic network interface port (for the ``awsvpc`` network mode), so you + * cannot take advantage of dynamic host port mappings. When using the ``host`` network mode, you should not run + * containers using the root user (UID 0). It is considered best practice to use a non-root user. If the network + * mode is ``awsvpc``, the task is allocated an elastic network interface, and you must specify a + * NetworkConfiguration value when you create a service or run a task with the task definition. For more + * information, see [Task + * Networking](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/task-networking.html) in the *Amazon + * Elastic Container Service Developer Guide*. If the network mode is ``host``, you cannot run multiple + * instantiations of the same task on a single container instance when port mappings are used. For more information, + * see [Network + * settings](https://docs.aws.amazon.com/https://docs.docker.com/engine/reference/run/#network-settings) in the + * *Docker run reference*. + * + * @return the networkMode value. + */ + public String networkMode() { + return this.networkMode; + } + + /** + * Set the networkMode property: The Docker networking mode to use for the containers in the task. The valid values + * are ``none``, ``bridge``, ``awsvpc``, and ``host``. If no network mode is specified, the default is ``bridge``. + * For Amazon ECS tasks on Fargate, the ``awsvpc`` network mode is required. For Amazon ECS tasks on Amazon EC2 + * Linux instances, any network mode can be used. For Amazon ECS tasks on Amazon EC2 Windows instances, + * ``<default>`` or ``awsvpc`` can be used. If the network mode is set to ``none``, you cannot specify port + * mappings in your container definitions, and the tasks containers do not have external connectivity. The ``host`` + * and ``awsvpc`` network modes offer the highest networking performance for containers because they use the EC2 + * network stack instead of the virtualized network stack provided by the ``bridge`` mode. With the ``host`` and + * ``awsvpc`` network modes, exposed container ports are mapped directly to the corresponding host port (for the + * ``host`` network mode) or the attached elastic network interface port (for the ``awsvpc`` network mode), so you + * cannot take advantage of dynamic host port mappings. When using the ``host`` network mode, you should not run + * containers using the root user (UID 0). It is considered best practice to use a non-root user. If the network + * mode is ``awsvpc``, the task is allocated an elastic network interface, and you must specify a + * NetworkConfiguration value when you create a service or run a task with the task definition. For more + * information, see [Task + * Networking](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/task-networking.html) in the *Amazon + * Elastic Container Service Developer Guide*. If the network mode is ``host``, you cannot run multiple + * instantiations of the same task on a single container instance when port mappings are used. For more information, + * see [Network + * settings](https://docs.aws.amazon.com/https://docs.docker.com/engine/reference/run/#network-settings) in the + * *Docker run reference*. + * + * @param networkMode the networkMode value to set. + * @return the AwsEcsTaskDefinitionProperties object itself. + */ + public AwsEcsTaskDefinitionProperties withNetworkMode(String networkMode) { + this.networkMode = networkMode; + return this; + } + + /** + * Get the pidMode property: The process namespace to use for the containers in the task. The valid values are + * ``host`` or ``task``. On Fargate for Linux containers, the only valid value is ``task``. For example, monitoring + * sidecars might need ``pidMode`` to access information about other containers running in the same task. If + * ``host`` is specified, all containers within the tasks that specified the ``host`` PID mode on the same container + * instance share the same process namespace with the host Amazon EC2 instance. If ``task`` is specified, all + * containers within the specified task share the same process namespace. If no value is specified, the default is a + * private namespace for each container. For more information, see [PID + * settings](https://docs.aws.amazon.com/https://docs.docker.com/engine/reference/run/#pid-settings---pid) in the + * *Docker run reference*. If the ``host`` PID mode is used, there's a heightened risk of undesired process + * namespace exposure. For more information, see [Docker + * security](https://docs.aws.amazon.com/https://docs.docker.com/engine/security/security/). This parameter is not + * supported for Windows containers. This parameter is only supported for tasks that are hosted on FARGATElong if + * the tasks are using platform version ``1.4.0`` or later (Linux). This isn't supported for Windows containers on + * Fargate. + * + * @return the pidMode value. + */ + public String pidMode() { + return this.pidMode; + } + + /** + * Set the pidMode property: The process namespace to use for the containers in the task. The valid values are + * ``host`` or ``task``. On Fargate for Linux containers, the only valid value is ``task``. For example, monitoring + * sidecars might need ``pidMode`` to access information about other containers running in the same task. If + * ``host`` is specified, all containers within the tasks that specified the ``host`` PID mode on the same container + * instance share the same process namespace with the host Amazon EC2 instance. If ``task`` is specified, all + * containers within the specified task share the same process namespace. If no value is specified, the default is a + * private namespace for each container. For more information, see [PID + * settings](https://docs.aws.amazon.com/https://docs.docker.com/engine/reference/run/#pid-settings---pid) in the + * *Docker run reference*. If the ``host`` PID mode is used, there's a heightened risk of undesired process + * namespace exposure. For more information, see [Docker + * security](https://docs.aws.amazon.com/https://docs.docker.com/engine/security/security/). This parameter is not + * supported for Windows containers. This parameter is only supported for tasks that are hosted on FARGATElong if + * the tasks are using platform version ``1.4.0`` or later (Linux). This isn't supported for Windows containers on + * Fargate. + * + * @param pidMode the pidMode value to set. + * @return the AwsEcsTaskDefinitionProperties object itself. + */ + public AwsEcsTaskDefinitionProperties withPidMode(String pidMode) { + this.pidMode = pidMode; + return this; + } + + /** + * Get the placementConstraints property: An array of placement constraint objects to use for tasks. This parameter + * isn't supported for tasks run on FARGATElong. + * + * @return the placementConstraints value. + */ + public List placementConstraints() { + return this.placementConstraints; + } + + /** + * Set the placementConstraints property: An array of placement constraint objects to use for tasks. This parameter + * isn't supported for tasks run on FARGATElong. + * + * @param placementConstraints the placementConstraints value to set. + * @return the AwsEcsTaskDefinitionProperties object itself. + */ + public AwsEcsTaskDefinitionProperties + withPlacementConstraints(List placementConstraints) { + this.placementConstraints = placementConstraints; + return this; + } + + /** + * Get the proxyConfiguration property: The configuration details for the App Mesh proxy. Your Amazon ECS container + * instances require at least version 1.26.0 of the container agent and at least version 1.26.0-1 of the + * ``ecs-init`` package to use a proxy configuration. If your container instances are launched from the Amazon ECS + * optimized AMI version ``20190301`` or later, they contain the required versions of the container agent and + * ``ecs-init``. For more information, see [Amazon ECS-optimized Linux + * AMI](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/ecs-optimized_AMI.html) in the *Amazon Elastic + * Container Service Developer Guide*. The configuration details for the App Mesh proxy. For tasks that use the EC2 + * launch type, the container instances require at least version 1.26.0 of the container agent and at least version + * 1.26.0-1 of the ``ecs-init`` package to use a proxy configuration. If your container instances are launched from + * the Amazon ECS optimized AMI version ``20190301`` or later, then they contain the required versions of the + * container agent and ``ecs-init``. For more information, see [Amazon ECS-optimized Linux + * AMI](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/ecs-optimized_AMI.html). + * + * @return the proxyConfiguration value. + */ + public ProxyConfiguration proxyConfiguration() { + return this.proxyConfiguration; + } + + /** + * Set the proxyConfiguration property: The configuration details for the App Mesh proxy. Your Amazon ECS container + * instances require at least version 1.26.0 of the container agent and at least version 1.26.0-1 of the + * ``ecs-init`` package to use a proxy configuration. If your container instances are launched from the Amazon ECS + * optimized AMI version ``20190301`` or later, they contain the required versions of the container agent and + * ``ecs-init``. For more information, see [Amazon ECS-optimized Linux + * AMI](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/ecs-optimized_AMI.html) in the *Amazon Elastic + * Container Service Developer Guide*. The configuration details for the App Mesh proxy. For tasks that use the EC2 + * launch type, the container instances require at least version 1.26.0 of the container agent and at least version + * 1.26.0-1 of the ``ecs-init`` package to use a proxy configuration. If your container instances are launched from + * the Amazon ECS optimized AMI version ``20190301`` or later, then they contain the required versions of the + * container agent and ``ecs-init``. For more information, see [Amazon ECS-optimized Linux + * AMI](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/ecs-optimized_AMI.html). + * + * @param proxyConfiguration the proxyConfiguration value to set. + * @return the AwsEcsTaskDefinitionProperties object itself. + */ + public AwsEcsTaskDefinitionProperties withProxyConfiguration(ProxyConfiguration proxyConfiguration) { + this.proxyConfiguration = proxyConfiguration; + return this; + } + + /** + * Get the requiresCompatibilities property: The task launch types the task definition was validated against. The + * valid values are ``EC2``, ``FARGATE``, and ``EXTERNAL``. For more information, see [Amazon ECS launch + * types](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/launch_types.html) in the *Amazon Elastic + * Container Service Developer Guide*. + * + * @return the requiresCompatibilities value. + */ + public List requiresCompatibilities() { + return this.requiresCompatibilities; + } + + /** + * Set the requiresCompatibilities property: The task launch types the task definition was validated against. The + * valid values are ``EC2``, ``FARGATE``, and ``EXTERNAL``. For more information, see [Amazon ECS launch + * types](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/launch_types.html) in the *Amazon Elastic + * Container Service Developer Guide*. + * + * @param requiresCompatibilities the requiresCompatibilities value to set. + * @return the AwsEcsTaskDefinitionProperties object itself. + */ + public AwsEcsTaskDefinitionProperties withRequiresCompatibilities(List requiresCompatibilities) { + this.requiresCompatibilities = requiresCompatibilities; + return this; + } + + /** + * Get the runtimePlatform property: The operating system that your tasks definitions run on. A platform family is + * specified only for tasks using the Fargate launch type. When you specify a task definition in a service, this + * value must match the ``runtimePlatform`` value of the service. Information about the platform for the Amazon ECS + * service or task. For more information about ``RuntimePlatform``, see + * [RuntimePlatform](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/task_definition_parameters.html#runtime-platform) + * in the *Amazon Elastic Container Service Developer Guide*. + * + * @return the runtimePlatform value. + */ + public RuntimePlatform runtimePlatform() { + return this.runtimePlatform; + } + + /** + * Set the runtimePlatform property: The operating system that your tasks definitions run on. A platform family is + * specified only for tasks using the Fargate launch type. When you specify a task definition in a service, this + * value must match the ``runtimePlatform`` value of the service. Information about the platform for the Amazon ECS + * service or task. For more information about ``RuntimePlatform``, see + * [RuntimePlatform](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/task_definition_parameters.html#runtime-platform) + * in the *Amazon Elastic Container Service Developer Guide*. + * + * @param runtimePlatform the runtimePlatform value to set. + * @return the AwsEcsTaskDefinitionProperties object itself. + */ + public AwsEcsTaskDefinitionProperties withRuntimePlatform(RuntimePlatform runtimePlatform) { + this.runtimePlatform = runtimePlatform; + return this; + } + + /** + * Get the tags property: The metadata that you apply to the task definition to help you categorize and organize + * them. Each tag consists of a key and an optional value. You define both of them. The following basic restrictions + * apply to tags: + Maximum number of tags per resource - 50 + For each resource, each tag key must be unique, and + * each tag key can have only one value. + Maximum key length - 128 Unicode characters in UTF-8 + Maximum value + * length - 256 Unicode characters in UTF-8 + If your tagging schema is used across multiple services and resources, + * remember that other services may have restrictions on allowed characters. Generally allowed characters are: + * letters, numbers, and spaces representable in UTF-8, and the following characters: + - = . _ : / @. + Tag + * keys and values are case-sensitive. + Do not use ``aws:``, ``AWS:``, or any upper or lowercase combination of + * such as a prefix for either keys or values as it is reserved for AWS use. You cannot edit or delete tag keys or + * values with this prefix. Tags with this prefix do not count against your tags per resource limit. + * + * @return the tags value. + */ + public List tags() { + return this.tags; + } + + /** + * Set the tags property: The metadata that you apply to the task definition to help you categorize and organize + * them. Each tag consists of a key and an optional value. You define both of them. The following basic restrictions + * apply to tags: + Maximum number of tags per resource - 50 + For each resource, each tag key must be unique, and + * each tag key can have only one value. + Maximum key length - 128 Unicode characters in UTF-8 + Maximum value + * length - 256 Unicode characters in UTF-8 + If your tagging schema is used across multiple services and resources, + * remember that other services may have restrictions on allowed characters. Generally allowed characters are: + * letters, numbers, and spaces representable in UTF-8, and the following characters: + - = . _ : / @. + Tag + * keys and values are case-sensitive. + Do not use ``aws:``, ``AWS:``, or any upper or lowercase combination of + * such as a prefix for either keys or values as it is reserved for AWS use. You cannot edit or delete tag keys or + * values with this prefix. Tags with this prefix do not count against your tags per resource limit. + * + * @param tags the tags value to set. + * @return the AwsEcsTaskDefinitionProperties object itself. + */ + public AwsEcsTaskDefinitionProperties withTags(List tags) { + this.tags = tags; + return this; + } + + /** + * Get the taskDefinitionArn property: Property taskDefinitionArn. + * + * @return the taskDefinitionArn value. + */ + public String taskDefinitionArn() { + return this.taskDefinitionArn; + } + + /** + * Set the taskDefinitionArn property: Property taskDefinitionArn. + * + * @param taskDefinitionArn the taskDefinitionArn value to set. + * @return the AwsEcsTaskDefinitionProperties object itself. + */ + public AwsEcsTaskDefinitionProperties withTaskDefinitionArn(String taskDefinitionArn) { + this.taskDefinitionArn = taskDefinitionArn; + return this; + } + + /** + * Get the taskRoleArn property: The short name or full Amazon Resource Name (ARN) of the IAMlong role that grants + * containers in the task permission to call AWS APIs on your behalf. For more information, see [Amazon ECS Task + * Role](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/task-iam-roles.html) in the *Amazon Elastic + * Container Service Developer Guide*. IAM roles for tasks on Windows require that the ``-EnableTaskIAMRole`` option + * is set when you launch the Amazon ECS-optimized Windows AMI. Your containers must also run some configuration + * code to use the feature. For more information, see [Windows IAM roles for + * tasks](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/windows_task_IAM_roles.html) in the *Amazon + * Elastic Container Service Developer Guide*. + * + * @return the taskRoleArn value. + */ + public String taskRoleArn() { + return this.taskRoleArn; + } + + /** + * Set the taskRoleArn property: The short name or full Amazon Resource Name (ARN) of the IAMlong role that grants + * containers in the task permission to call AWS APIs on your behalf. For more information, see [Amazon ECS Task + * Role](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/task-iam-roles.html) in the *Amazon Elastic + * Container Service Developer Guide*. IAM roles for tasks on Windows require that the ``-EnableTaskIAMRole`` option + * is set when you launch the Amazon ECS-optimized Windows AMI. Your containers must also run some configuration + * code to use the feature. For more information, see [Windows IAM roles for + * tasks](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/windows_task_IAM_roles.html) in the *Amazon + * Elastic Container Service Developer Guide*. + * + * @param taskRoleArn the taskRoleArn value to set. + * @return the AwsEcsTaskDefinitionProperties object itself. + */ + public AwsEcsTaskDefinitionProperties withTaskRoleArn(String taskRoleArn) { + this.taskRoleArn = taskRoleArn; + return this; + } + + /** + * Get the volumes property: The list of data volume definitions for the task. For more information, see [Using data + * volumes in tasks](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/using_data_volumes.html) in the + * *Amazon Elastic Container Service Developer Guide*. The ``host`` and ``sourcePath`` parameters aren't supported + * for tasks run on FARGATElong. + * + * @return the volumes value. + */ + public List volumes() { + return this.volumes; + } + + /** + * Set the volumes property: The list of data volume definitions for the task. For more information, see [Using data + * volumes in tasks](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/using_data_volumes.html) in the + * *Amazon Elastic Container Service Developer Guide*. The ``host`` and ``sourcePath`` parameters aren't supported + * for tasks run on FARGATElong. + * + * @param volumes the volumes value to set. + * @return the AwsEcsTaskDefinitionProperties object itself. + */ + public AwsEcsTaskDefinitionProperties withVolumes(List volumes) { + this.volumes = volumes; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (containerDefinitions() != null) { + containerDefinitions().forEach(e -> e.validate()); + } + if (ephemeralStorage() != null) { + ephemeralStorage().validate(); + } + if (inferenceAccelerators() != null) { + inferenceAccelerators().forEach(e -> e.validate()); + } + if (placementConstraints() != null) { + placementConstraints().forEach(e -> e.validate()); + } + if (proxyConfiguration() != null) { + proxyConfiguration().validate(); + } + if (runtimePlatform() != null) { + runtimePlatform().validate(); + } + if (tags() != null) { + tags().forEach(e -> e.validate()); + } + if (volumes() != null) { + volumes().forEach(e -> e.validate()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("containerDefinitions", this.containerDefinitions, + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("cpu", this.cpu); + jsonWriter.writeJsonField("ephemeralStorage", this.ephemeralStorage); + jsonWriter.writeStringField("executionRoleArn", this.executionRoleArn); + jsonWriter.writeStringField("family", this.family); + jsonWriter.writeArrayField("inferenceAccelerators", this.inferenceAccelerators, + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("ipcMode", this.ipcMode); + jsonWriter.writeStringField("memory", this.memory); + jsonWriter.writeStringField("networkMode", this.networkMode); + jsonWriter.writeStringField("pidMode", this.pidMode); + jsonWriter.writeArrayField("placementConstraints", this.placementConstraints, + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeJsonField("proxyConfiguration", this.proxyConfiguration); + jsonWriter.writeArrayField("requiresCompatibilities", this.requiresCompatibilities, + (writer, element) -> writer.writeString(element)); + jsonWriter.writeJsonField("runtimePlatform", this.runtimePlatform); + jsonWriter.writeArrayField("tags", this.tags, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("taskDefinitionArn", this.taskDefinitionArn); + jsonWriter.writeStringField("taskRoleArn", this.taskRoleArn); + jsonWriter.writeArrayField("volumes", this.volumes, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AwsEcsTaskDefinitionProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AwsEcsTaskDefinitionProperties if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the AwsEcsTaskDefinitionProperties. + */ + public static AwsEcsTaskDefinitionProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AwsEcsTaskDefinitionProperties deserializedAwsEcsTaskDefinitionProperties + = new AwsEcsTaskDefinitionProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("containerDefinitions".equals(fieldName)) { + List containerDefinitions + = reader.readArray(reader1 -> ContainerDefinition.fromJson(reader1)); + deserializedAwsEcsTaskDefinitionProperties.containerDefinitions = containerDefinitions; + } else if ("cpu".equals(fieldName)) { + deserializedAwsEcsTaskDefinitionProperties.cpu = reader.getString(); + } else if ("ephemeralStorage".equals(fieldName)) { + deserializedAwsEcsTaskDefinitionProperties.ephemeralStorage = EphemeralStorage.fromJson(reader); + } else if ("executionRoleArn".equals(fieldName)) { + deserializedAwsEcsTaskDefinitionProperties.executionRoleArn = reader.getString(); + } else if ("family".equals(fieldName)) { + deserializedAwsEcsTaskDefinitionProperties.family = reader.getString(); + } else if ("inferenceAccelerators".equals(fieldName)) { + List inferenceAccelerators + = reader.readArray(reader1 -> InferenceAccelerator.fromJson(reader1)); + deserializedAwsEcsTaskDefinitionProperties.inferenceAccelerators = inferenceAccelerators; + } else if ("ipcMode".equals(fieldName)) { + deserializedAwsEcsTaskDefinitionProperties.ipcMode = reader.getString(); + } else if ("memory".equals(fieldName)) { + deserializedAwsEcsTaskDefinitionProperties.memory = reader.getString(); + } else if ("networkMode".equals(fieldName)) { + deserializedAwsEcsTaskDefinitionProperties.networkMode = reader.getString(); + } else if ("pidMode".equals(fieldName)) { + deserializedAwsEcsTaskDefinitionProperties.pidMode = reader.getString(); + } else if ("placementConstraints".equals(fieldName)) { + List placementConstraints + = reader.readArray(reader1 -> TaskDefinitionPlacementConstraint.fromJson(reader1)); + deserializedAwsEcsTaskDefinitionProperties.placementConstraints = placementConstraints; + } else if ("proxyConfiguration".equals(fieldName)) { + deserializedAwsEcsTaskDefinitionProperties.proxyConfiguration = ProxyConfiguration.fromJson(reader); + } else if ("requiresCompatibilities".equals(fieldName)) { + List requiresCompatibilities = reader.readArray(reader1 -> reader1.getString()); + deserializedAwsEcsTaskDefinitionProperties.requiresCompatibilities = requiresCompatibilities; + } else if ("runtimePlatform".equals(fieldName)) { + deserializedAwsEcsTaskDefinitionProperties.runtimePlatform = RuntimePlatform.fromJson(reader); + } else if ("tags".equals(fieldName)) { + List tags = reader.readArray(reader1 -> TagAutoGenerated27.fromJson(reader1)); + deserializedAwsEcsTaskDefinitionProperties.tags = tags; + } else if ("taskDefinitionArn".equals(fieldName)) { + deserializedAwsEcsTaskDefinitionProperties.taskDefinitionArn = reader.getString(); + } else if ("taskRoleArn".equals(fieldName)) { + deserializedAwsEcsTaskDefinitionProperties.taskRoleArn = reader.getString(); + } else if ("volumes".equals(fieldName)) { + List volumes = reader.readArray(reader1 -> Volume.fromJson(reader1)); + deserializedAwsEcsTaskDefinitionProperties.volumes = volumes; + } else { + reader.skipChildren(); + } + } + + return deserializedAwsEcsTaskDefinitionProperties; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/AwsEfsFileSystemProperties.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/AwsEfsFileSystemProperties.java new file mode 100644 index 000000000000..d4362a4b1040 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/AwsEfsFileSystemProperties.java @@ -0,0 +1,658 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Definition of awsEfsFileSystem. + */ +@Fluent +public final class AwsEfsFileSystemProperties implements JsonSerializable { + /* + * Property arn + */ + private String arn; + + /* + * For One Zone file systems, specify the AWS Availability Zone in which to create the file system. Use the format + * ``us-east-1a`` to specify the Availability Zone. For more information about One Zone file systems, see [EFS file + * system types](https://docs.aws.amazon.com/efs/latest/ug/availability-durability.html#file-system-type) in the + * *Amazon EFS User Guide*. One Zone file systems are not available in all Availability Zones in AWS-Regions where + * Amazon EFS is available. + */ + private String availabilityZoneName; + + /* + * Use the ``BackupPolicy`` to turn automatic backups on or off for the file system. The backup policy turns + * automatic backups for the file system on or off. + */ + private BackupPolicy backupPolicy; + + /* + * (Optional) A boolean that specifies whether or not to bypass the ``FileSystemPolicy`` lockout safety check. The + * lockout safety check determines whether the policy in the request will lock out, or prevent, the IAM principal + * that is making the request from making future ``PutFileSystemPolicy`` requests on this file system. Set + * ``BypassPolicyLockoutSafetyCheck`` to ``True`` only when you intend to prevent the IAM principal that is making + * the request from making subsequent ``PutFileSystemPolicy`` requests on this file system. The default value is + * ``False``. + */ + private Boolean bypassPolicyLockoutSafetyCheck; + + /* + * A Boolean value that, if true, creates an encrypted file system. When creating an encrypted file system, you have + * the option of specifying a KmsKeyId for an existing kms-key-long. If you don't specify a kms-key, then the + * default kms-key for EFS, ``/aws/elasticfilesystem``, is used to protect the encrypted file system. + */ + private Boolean encrypted; + + /* + * Property fileSystemId + */ + private String fileSystemId; + + /* + * The ``FileSystemPolicy`` for the EFS file system. A file system policy is an IAM resource policy used to control + * NFS access to an EFS file system. For more information, see [Using to control NFS access to Amazon + * EFS](https://docs.aws.amazon.com/efs/latest/ug/iam-access-control-nfs-efs.html) in the *Amazon EFS User Guide*. + */ + private Object fileSystemPolicy; + + /* + * Describes the protection on the file system. Describes the protection on the file system. + */ + private FileSystemProtection fileSystemProtection; + + /* + * Use to create one or more tags associated with the file system. Each tag is a user-defined key-value pair. Name + * your file system on creation by including a ``'Key':'Name','Value':'{value}'`` key-value pair. Each key must be + * unique. For more information, see [Tagging + * resources](https://docs.aws.amazon.com/general/latest/gr/aws_tagging.html) in the *General Reference Guide*. + */ + private List fileSystemTags; + + /* + * The ID of the kms-key-long to be used to protect the encrypted file system. This parameter is only required if + * you want to use a nondefault kms-key. If this parameter is not specified, the default kms-key for EFS is used. + * This ID can be in one of the following formats: + Key ID - A unique identifier of the key, for example + * ``1234abcd-12ab-34cd-56ef-1234567890ab``. + ARN - An Amazon Resource Name (ARN) for the key, for example + * ``arn:aws:kms:us-west-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab``. + Key alias - A previously + * created display name for a key, for example ``alias/projectKey1``. + Key alias ARN - An ARN for a key alias, for + * example ``arn:aws:kms:us-west-2:444455556666:alias/projectKey1``. If ``KmsKeyId`` is specified, the ``Encrypted`` + * parameter must be set to true. + */ + private String kmsKeyId; + + /* + * An array of ``LifecyclePolicy`` objects that define the file system's ``LifecycleConfiguration`` object. A + * ``LifecycleConfiguration`` object informs Lifecycle management of the following: + When to move files in the file + * system from primary storage to IA storage. + When to move files in the file system from primary storage or IA + * storage to Archive storage. + When to move files that are in IA or Archive storage to primary storage. EFS + * requires that each ``LifecyclePolicy`` object have only a single transition. This means that in a request body, + * ``LifecyclePolicies`` needs to be structured as an array of ``LifecyclePolicy`` objects, one object for each + * transition, ``TransitionToIA``, ``TransitionToArchive`` ``TransitionToPrimaryStorageClass``. See the example + * requests in the following section for more information. + */ + private List lifecyclePolicies; + + /* + * The Performance mode of the file system. We recommend ``generalPurpose`` performance mode for all file systems. + * File systems using the ``maxIO`` performance mode can scale to higher levels of aggregate throughput and + * operations per second with a tradeoff of slightly higher latencies for most file operations. The performance mode + * can't be changed after the file system has been created. The ``maxIO`` mode is not supported on One Zone file + * systems. Due to the higher per-operation latencies with Max I/O, we recommend using General Purpose performance + * mode for all file systems. Default is ``generalPurpose``. + */ + private String performanceMode; + + /* + * The throughput, measured in mebibytes per second (MiBps), that you want to provision for a file system that + * you're creating. Required if ``ThroughputMode`` is set to ``provisioned``. Valid values are 1-3414 MiBps, with + * the upper limit depending on Region. To increase this limit, contact SUP. For more information, see [Amazon EFS + * quotas that you can increase](https://docs.aws.amazon.com/efs/latest/ug/limits.html#soft-limits) in the *Amazon + * EFS User Guide*. + */ + private Integer provisionedThroughputInMibps; + + /* + * Describes the replication configuration for a specific file system. Describes the replication configuration for a + * specific file system. + */ + private ReplicationConfiguration replicationConfiguration; + + /* + * Specifies the throughput mode for the file system. The mode can be ``bursting``, ``provisioned``, or ``elastic``. + * If you set ``ThroughputMode`` to ``provisioned``, you must also set a value for ``ProvisionedThroughputInMibps``. + * After you create the file system, you can decrease your file system's Provisioned throughput or change between + * the throughput modes, with certain time restrictions. For more information, see [Specifying throughput with + * provisioned mode](https://docs.aws.amazon.com/efs/latest/ug/performance.html#provisioned-throughput) in the + * *Amazon EFS User Guide*. Default is ``bursting``. + */ + private String throughputMode; + + /** + * Creates an instance of AwsEfsFileSystemProperties class. + */ + public AwsEfsFileSystemProperties() { + } + + /** + * Get the arn property: Property arn. + * + * @return the arn value. + */ + public String arn() { + return this.arn; + } + + /** + * Set the arn property: Property arn. + * + * @param arn the arn value to set. + * @return the AwsEfsFileSystemProperties object itself. + */ + public AwsEfsFileSystemProperties withArn(String arn) { + this.arn = arn; + return this; + } + + /** + * Get the availabilityZoneName property: For One Zone file systems, specify the AWS Availability Zone in which to + * create the file system. Use the format ``us-east-1a`` to specify the Availability Zone. For more information + * about One Zone file systems, see [EFS file system + * types](https://docs.aws.amazon.com/efs/latest/ug/availability-durability.html#file-system-type) in the *Amazon + * EFS User Guide*. One Zone file systems are not available in all Availability Zones in AWS-Regions where Amazon + * EFS is available. + * + * @return the availabilityZoneName value. + */ + public String availabilityZoneName() { + return this.availabilityZoneName; + } + + /** + * Set the availabilityZoneName property: For One Zone file systems, specify the AWS Availability Zone in which to + * create the file system. Use the format ``us-east-1a`` to specify the Availability Zone. For more information + * about One Zone file systems, see [EFS file system + * types](https://docs.aws.amazon.com/efs/latest/ug/availability-durability.html#file-system-type) in the *Amazon + * EFS User Guide*. One Zone file systems are not available in all Availability Zones in AWS-Regions where Amazon + * EFS is available. + * + * @param availabilityZoneName the availabilityZoneName value to set. + * @return the AwsEfsFileSystemProperties object itself. + */ + public AwsEfsFileSystemProperties withAvailabilityZoneName(String availabilityZoneName) { + this.availabilityZoneName = availabilityZoneName; + return this; + } + + /** + * Get the backupPolicy property: Use the ``BackupPolicy`` to turn automatic backups on or off for the file system. + * The backup policy turns automatic backups for the file system on or off. + * + * @return the backupPolicy value. + */ + public BackupPolicy backupPolicy() { + return this.backupPolicy; + } + + /** + * Set the backupPolicy property: Use the ``BackupPolicy`` to turn automatic backups on or off for the file system. + * The backup policy turns automatic backups for the file system on or off. + * + * @param backupPolicy the backupPolicy value to set. + * @return the AwsEfsFileSystemProperties object itself. + */ + public AwsEfsFileSystemProperties withBackupPolicy(BackupPolicy backupPolicy) { + this.backupPolicy = backupPolicy; + return this; + } + + /** + * Get the bypassPolicyLockoutSafetyCheck property: (Optional) A boolean that specifies whether or not to bypass the + * ``FileSystemPolicy`` lockout safety check. The lockout safety check determines whether the policy in the request + * will lock out, or prevent, the IAM principal that is making the request from making future + * ``PutFileSystemPolicy`` requests on this file system. Set ``BypassPolicyLockoutSafetyCheck`` to ``True`` only + * when you intend to prevent the IAM principal that is making the request from making subsequent + * ``PutFileSystemPolicy`` requests on this file system. The default value is ``False``. + * + * @return the bypassPolicyLockoutSafetyCheck value. + */ + public Boolean bypassPolicyLockoutSafetyCheck() { + return this.bypassPolicyLockoutSafetyCheck; + } + + /** + * Set the bypassPolicyLockoutSafetyCheck property: (Optional) A boolean that specifies whether or not to bypass the + * ``FileSystemPolicy`` lockout safety check. The lockout safety check determines whether the policy in the request + * will lock out, or prevent, the IAM principal that is making the request from making future + * ``PutFileSystemPolicy`` requests on this file system. Set ``BypassPolicyLockoutSafetyCheck`` to ``True`` only + * when you intend to prevent the IAM principal that is making the request from making subsequent + * ``PutFileSystemPolicy`` requests on this file system. The default value is ``False``. + * + * @param bypassPolicyLockoutSafetyCheck the bypassPolicyLockoutSafetyCheck value to set. + * @return the AwsEfsFileSystemProperties object itself. + */ + public AwsEfsFileSystemProperties withBypassPolicyLockoutSafetyCheck(Boolean bypassPolicyLockoutSafetyCheck) { + this.bypassPolicyLockoutSafetyCheck = bypassPolicyLockoutSafetyCheck; + return this; + } + + /** + * Get the encrypted property: A Boolean value that, if true, creates an encrypted file system. When creating an + * encrypted file system, you have the option of specifying a KmsKeyId for an existing kms-key-long. If you don't + * specify a kms-key, then the default kms-key for EFS, ``/aws/elasticfilesystem``, is used to protect the encrypted + * file system. + * + * @return the encrypted value. + */ + public Boolean encrypted() { + return this.encrypted; + } + + /** + * Set the encrypted property: A Boolean value that, if true, creates an encrypted file system. When creating an + * encrypted file system, you have the option of specifying a KmsKeyId for an existing kms-key-long. If you don't + * specify a kms-key, then the default kms-key for EFS, ``/aws/elasticfilesystem``, is used to protect the encrypted + * file system. + * + * @param encrypted the encrypted value to set. + * @return the AwsEfsFileSystemProperties object itself. + */ + public AwsEfsFileSystemProperties withEncrypted(Boolean encrypted) { + this.encrypted = encrypted; + return this; + } + + /** + * Get the fileSystemId property: Property fileSystemId. + * + * @return the fileSystemId value. + */ + public String fileSystemId() { + return this.fileSystemId; + } + + /** + * Set the fileSystemId property: Property fileSystemId. + * + * @param fileSystemId the fileSystemId value to set. + * @return the AwsEfsFileSystemProperties object itself. + */ + public AwsEfsFileSystemProperties withFileSystemId(String fileSystemId) { + this.fileSystemId = fileSystemId; + return this; + } + + /** + * Get the fileSystemPolicy property: The ``FileSystemPolicy`` for the EFS file system. A file system policy is an + * IAM resource policy used to control NFS access to an EFS file system. For more information, see [Using to control + * NFS access to Amazon EFS](https://docs.aws.amazon.com/efs/latest/ug/iam-access-control-nfs-efs.html) in the + * *Amazon EFS User Guide*. + * + * @return the fileSystemPolicy value. + */ + public Object fileSystemPolicy() { + return this.fileSystemPolicy; + } + + /** + * Set the fileSystemPolicy property: The ``FileSystemPolicy`` for the EFS file system. A file system policy is an + * IAM resource policy used to control NFS access to an EFS file system. For more information, see [Using to control + * NFS access to Amazon EFS](https://docs.aws.amazon.com/efs/latest/ug/iam-access-control-nfs-efs.html) in the + * *Amazon EFS User Guide*. + * + * @param fileSystemPolicy the fileSystemPolicy value to set. + * @return the AwsEfsFileSystemProperties object itself. + */ + public AwsEfsFileSystemProperties withFileSystemPolicy(Object fileSystemPolicy) { + this.fileSystemPolicy = fileSystemPolicy; + return this; + } + + /** + * Get the fileSystemProtection property: Describes the protection on the file system. Describes the protection on + * the file system. + * + * @return the fileSystemProtection value. + */ + public FileSystemProtection fileSystemProtection() { + return this.fileSystemProtection; + } + + /** + * Set the fileSystemProtection property: Describes the protection on the file system. Describes the protection on + * the file system. + * + * @param fileSystemProtection the fileSystemProtection value to set. + * @return the AwsEfsFileSystemProperties object itself. + */ + public AwsEfsFileSystemProperties withFileSystemProtection(FileSystemProtection fileSystemProtection) { + this.fileSystemProtection = fileSystemProtection; + return this; + } + + /** + * Get the fileSystemTags property: Use to create one or more tags associated with the file system. Each tag is a + * user-defined key-value pair. Name your file system on creation by including a ``'Key':'Name','Value':'{value}'`` + * key-value pair. Each key must be unique. For more information, see [Tagging + * resources](https://docs.aws.amazon.com/general/latest/gr/aws_tagging.html) in the *General Reference Guide*. + * + * @return the fileSystemTags value. + */ + public List fileSystemTags() { + return this.fileSystemTags; + } + + /** + * Set the fileSystemTags property: Use to create one or more tags associated with the file system. Each tag is a + * user-defined key-value pair. Name your file system on creation by including a ``'Key':'Name','Value':'{value}'`` + * key-value pair. Each key must be unique. For more information, see [Tagging + * resources](https://docs.aws.amazon.com/general/latest/gr/aws_tagging.html) in the *General Reference Guide*. + * + * @param fileSystemTags the fileSystemTags value to set. + * @return the AwsEfsFileSystemProperties object itself. + */ + public AwsEfsFileSystemProperties withFileSystemTags(List fileSystemTags) { + this.fileSystemTags = fileSystemTags; + return this; + } + + /** + * Get the kmsKeyId property: The ID of the kms-key-long to be used to protect the encrypted file system. This + * parameter is only required if you want to use a nondefault kms-key. If this parameter is not specified, the + * default kms-key for EFS is used. This ID can be in one of the following formats: + Key ID - A unique identifier + * of the key, for example ``1234abcd-12ab-34cd-56ef-1234567890ab``. + ARN - An Amazon Resource Name (ARN) for the + * key, for example ``arn:aws:kms:us-west-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab``. + Key alias - A + * previously created display name for a key, for example ``alias/projectKey1``. + Key alias ARN - An ARN for a key + * alias, for example ``arn:aws:kms:us-west-2:444455556666:alias/projectKey1``. If ``KmsKeyId`` is specified, the + * ``Encrypted`` parameter must be set to true. + * + * @return the kmsKeyId value. + */ + public String kmsKeyId() { + return this.kmsKeyId; + } + + /** + * Set the kmsKeyId property: The ID of the kms-key-long to be used to protect the encrypted file system. This + * parameter is only required if you want to use a nondefault kms-key. If this parameter is not specified, the + * default kms-key for EFS is used. This ID can be in one of the following formats: + Key ID - A unique identifier + * of the key, for example ``1234abcd-12ab-34cd-56ef-1234567890ab``. + ARN - An Amazon Resource Name (ARN) for the + * key, for example ``arn:aws:kms:us-west-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab``. + Key alias - A + * previously created display name for a key, for example ``alias/projectKey1``. + Key alias ARN - An ARN for a key + * alias, for example ``arn:aws:kms:us-west-2:444455556666:alias/projectKey1``. If ``KmsKeyId`` is specified, the + * ``Encrypted`` parameter must be set to true. + * + * @param kmsKeyId the kmsKeyId value to set. + * @return the AwsEfsFileSystemProperties object itself. + */ + public AwsEfsFileSystemProperties withKmsKeyId(String kmsKeyId) { + this.kmsKeyId = kmsKeyId; + return this; + } + + /** + * Get the lifecyclePolicies property: An array of ``LifecyclePolicy`` objects that define the file system's + * ``LifecycleConfiguration`` object. A ``LifecycleConfiguration`` object informs Lifecycle management of the + * following: + When to move files in the file system from primary storage to IA storage. + When to move files in + * the file system from primary storage or IA storage to Archive storage. + When to move files that are in IA or + * Archive storage to primary storage. EFS requires that each ``LifecyclePolicy`` object have only a single + * transition. This means that in a request body, ``LifecyclePolicies`` needs to be structured as an array of + * ``LifecyclePolicy`` objects, one object for each transition, ``TransitionToIA``, ``TransitionToArchive`` + * ``TransitionToPrimaryStorageClass``. See the example requests in the following section for more information. + * + * @return the lifecyclePolicies value. + */ + public List lifecyclePolicies() { + return this.lifecyclePolicies; + } + + /** + * Set the lifecyclePolicies property: An array of ``LifecyclePolicy`` objects that define the file system's + * ``LifecycleConfiguration`` object. A ``LifecycleConfiguration`` object informs Lifecycle management of the + * following: + When to move files in the file system from primary storage to IA storage. + When to move files in + * the file system from primary storage or IA storage to Archive storage. + When to move files that are in IA or + * Archive storage to primary storage. EFS requires that each ``LifecyclePolicy`` object have only a single + * transition. This means that in a request body, ``LifecyclePolicies`` needs to be structured as an array of + * ``LifecyclePolicy`` objects, one object for each transition, ``TransitionToIA``, ``TransitionToArchive`` + * ``TransitionToPrimaryStorageClass``. See the example requests in the following section for more information. + * + * @param lifecyclePolicies the lifecyclePolicies value to set. + * @return the AwsEfsFileSystemProperties object itself. + */ + public AwsEfsFileSystemProperties withLifecyclePolicies(List lifecyclePolicies) { + this.lifecyclePolicies = lifecyclePolicies; + return this; + } + + /** + * Get the performanceMode property: The Performance mode of the file system. We recommend ``generalPurpose`` + * performance mode for all file systems. File systems using the ``maxIO`` performance mode can scale to higher + * levels of aggregate throughput and operations per second with a tradeoff of slightly higher latencies for most + * file operations. The performance mode can't be changed after the file system has been created. The ``maxIO`` mode + * is not supported on One Zone file systems. Due to the higher per-operation latencies with Max I/O, we recommend + * using General Purpose performance mode for all file systems. Default is ``generalPurpose``. + * + * @return the performanceMode value. + */ + public String performanceMode() { + return this.performanceMode; + } + + /** + * Set the performanceMode property: The Performance mode of the file system. We recommend ``generalPurpose`` + * performance mode for all file systems. File systems using the ``maxIO`` performance mode can scale to higher + * levels of aggregate throughput and operations per second with a tradeoff of slightly higher latencies for most + * file operations. The performance mode can't be changed after the file system has been created. The ``maxIO`` mode + * is not supported on One Zone file systems. Due to the higher per-operation latencies with Max I/O, we recommend + * using General Purpose performance mode for all file systems. Default is ``generalPurpose``. + * + * @param performanceMode the performanceMode value to set. + * @return the AwsEfsFileSystemProperties object itself. + */ + public AwsEfsFileSystemProperties withPerformanceMode(String performanceMode) { + this.performanceMode = performanceMode; + return this; + } + + /** + * Get the provisionedThroughputInMibps property: The throughput, measured in mebibytes per second (MiBps), that you + * want to provision for a file system that you're creating. Required if ``ThroughputMode`` is set to + * ``provisioned``. Valid values are 1-3414 MiBps, with the upper limit depending on Region. To increase this limit, + * contact SUP. For more information, see [Amazon EFS quotas that you can + * increase](https://docs.aws.amazon.com/efs/latest/ug/limits.html#soft-limits) in the *Amazon EFS User Guide*. + * + * @return the provisionedThroughputInMibps value. + */ + public Integer provisionedThroughputInMibps() { + return this.provisionedThroughputInMibps; + } + + /** + * Set the provisionedThroughputInMibps property: The throughput, measured in mebibytes per second (MiBps), that you + * want to provision for a file system that you're creating. Required if ``ThroughputMode`` is set to + * ``provisioned``. Valid values are 1-3414 MiBps, with the upper limit depending on Region. To increase this limit, + * contact SUP. For more information, see [Amazon EFS quotas that you can + * increase](https://docs.aws.amazon.com/efs/latest/ug/limits.html#soft-limits) in the *Amazon EFS User Guide*. + * + * @param provisionedThroughputInMibps the provisionedThroughputInMibps value to set. + * @return the AwsEfsFileSystemProperties object itself. + */ + public AwsEfsFileSystemProperties withProvisionedThroughputInMibps(Integer provisionedThroughputInMibps) { + this.provisionedThroughputInMibps = provisionedThroughputInMibps; + return this; + } + + /** + * Get the replicationConfiguration property: Describes the replication configuration for a specific file system. + * Describes the replication configuration for a specific file system. + * + * @return the replicationConfiguration value. + */ + public ReplicationConfiguration replicationConfiguration() { + return this.replicationConfiguration; + } + + /** + * Set the replicationConfiguration property: Describes the replication configuration for a specific file system. + * Describes the replication configuration for a specific file system. + * + * @param replicationConfiguration the replicationConfiguration value to set. + * @return the AwsEfsFileSystemProperties object itself. + */ + public AwsEfsFileSystemProperties withReplicationConfiguration(ReplicationConfiguration replicationConfiguration) { + this.replicationConfiguration = replicationConfiguration; + return this; + } + + /** + * Get the throughputMode property: Specifies the throughput mode for the file system. The mode can be ``bursting``, + * ``provisioned``, or ``elastic``. If you set ``ThroughputMode`` to ``provisioned``, you must also set a value for + * ``ProvisionedThroughputInMibps``. After you create the file system, you can decrease your file system's + * Provisioned throughput or change between the throughput modes, with certain time restrictions. For more + * information, see [Specifying throughput with provisioned + * mode](https://docs.aws.amazon.com/efs/latest/ug/performance.html#provisioned-throughput) in the *Amazon EFS User + * Guide*. Default is ``bursting``. + * + * @return the throughputMode value. + */ + public String throughputMode() { + return this.throughputMode; + } + + /** + * Set the throughputMode property: Specifies the throughput mode for the file system. The mode can be ``bursting``, + * ``provisioned``, or ``elastic``. If you set ``ThroughputMode`` to ``provisioned``, you must also set a value for + * ``ProvisionedThroughputInMibps``. After you create the file system, you can decrease your file system's + * Provisioned throughput or change between the throughput modes, with certain time restrictions. For more + * information, see [Specifying throughput with provisioned + * mode](https://docs.aws.amazon.com/efs/latest/ug/performance.html#provisioned-throughput) in the *Amazon EFS User + * Guide*. Default is ``bursting``. + * + * @param throughputMode the throughputMode value to set. + * @return the AwsEfsFileSystemProperties object itself. + */ + public AwsEfsFileSystemProperties withThroughputMode(String throughputMode) { + this.throughputMode = throughputMode; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (backupPolicy() != null) { + backupPolicy().validate(); + } + if (fileSystemProtection() != null) { + fileSystemProtection().validate(); + } + if (fileSystemTags() != null) { + fileSystemTags().forEach(e -> e.validate()); + } + if (lifecyclePolicies() != null) { + lifecyclePolicies().forEach(e -> e.validate()); + } + if (replicationConfiguration() != null) { + replicationConfiguration().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("arn", this.arn); + jsonWriter.writeStringField("availabilityZoneName", this.availabilityZoneName); + jsonWriter.writeJsonField("backupPolicy", this.backupPolicy); + jsonWriter.writeBooleanField("bypassPolicyLockoutSafetyCheck", this.bypassPolicyLockoutSafetyCheck); + jsonWriter.writeBooleanField("encrypted", this.encrypted); + jsonWriter.writeStringField("fileSystemId", this.fileSystemId); + jsonWriter.writeUntypedField("fileSystemPolicy", this.fileSystemPolicy); + jsonWriter.writeJsonField("fileSystemProtection", this.fileSystemProtection); + jsonWriter.writeArrayField("fileSystemTags", this.fileSystemTags, + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("kmsKeyId", this.kmsKeyId); + jsonWriter.writeArrayField("lifecyclePolicies", this.lifecyclePolicies, + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("performanceMode", this.performanceMode); + jsonWriter.writeNumberField("provisionedThroughputInMibps", this.provisionedThroughputInMibps); + jsonWriter.writeJsonField("replicationConfiguration", this.replicationConfiguration); + jsonWriter.writeStringField("throughputMode", this.throughputMode); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AwsEfsFileSystemProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AwsEfsFileSystemProperties if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IOException If an error occurs while reading the AwsEfsFileSystemProperties. + */ + public static AwsEfsFileSystemProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AwsEfsFileSystemProperties deserializedAwsEfsFileSystemProperties = new AwsEfsFileSystemProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("arn".equals(fieldName)) { + deserializedAwsEfsFileSystemProperties.arn = reader.getString(); + } else if ("availabilityZoneName".equals(fieldName)) { + deserializedAwsEfsFileSystemProperties.availabilityZoneName = reader.getString(); + } else if ("backupPolicy".equals(fieldName)) { + deserializedAwsEfsFileSystemProperties.backupPolicy = BackupPolicy.fromJson(reader); + } else if ("bypassPolicyLockoutSafetyCheck".equals(fieldName)) { + deserializedAwsEfsFileSystemProperties.bypassPolicyLockoutSafetyCheck + = reader.getNullable(JsonReader::getBoolean); + } else if ("encrypted".equals(fieldName)) { + deserializedAwsEfsFileSystemProperties.encrypted = reader.getNullable(JsonReader::getBoolean); + } else if ("fileSystemId".equals(fieldName)) { + deserializedAwsEfsFileSystemProperties.fileSystemId = reader.getString(); + } else if ("fileSystemPolicy".equals(fieldName)) { + deserializedAwsEfsFileSystemProperties.fileSystemPolicy = reader.readUntyped(); + } else if ("fileSystemProtection".equals(fieldName)) { + deserializedAwsEfsFileSystemProperties.fileSystemProtection = FileSystemProtection.fromJson(reader); + } else if ("fileSystemTags".equals(fieldName)) { + List fileSystemTags + = reader.readArray(reader1 -> ElasticFileSystemTag.fromJson(reader1)); + deserializedAwsEfsFileSystemProperties.fileSystemTags = fileSystemTags; + } else if ("kmsKeyId".equals(fieldName)) { + deserializedAwsEfsFileSystemProperties.kmsKeyId = reader.getString(); + } else if ("lifecyclePolicies".equals(fieldName)) { + List lifecyclePolicies + = reader.readArray(reader1 -> LifecyclePolicyAutoGenerated.fromJson(reader1)); + deserializedAwsEfsFileSystemProperties.lifecyclePolicies = lifecyclePolicies; + } else if ("performanceMode".equals(fieldName)) { + deserializedAwsEfsFileSystemProperties.performanceMode = reader.getString(); + } else if ("provisionedThroughputInMibps".equals(fieldName)) { + deserializedAwsEfsFileSystemProperties.provisionedThroughputInMibps + = reader.getNullable(JsonReader::getInt); + } else if ("replicationConfiguration".equals(fieldName)) { + deserializedAwsEfsFileSystemProperties.replicationConfiguration + = ReplicationConfiguration.fromJson(reader); + } else if ("throughputMode".equals(fieldName)) { + deserializedAwsEfsFileSystemProperties.throughputMode = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedAwsEfsFileSystemProperties; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/AwsEfsMountTargetProperties.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/AwsEfsMountTargetProperties.java new file mode 100644 index 000000000000..b9e6eff7ee01 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/AwsEfsMountTargetProperties.java @@ -0,0 +1,214 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Definition of awsEfsMountTarget. + */ +@Fluent +public final class AwsEfsMountTargetProperties implements JsonSerializable { + /* + * The ID of the file system for which to create the mount target. + */ + private String fileSystemId; + + /* + * Property id + */ + private String id; + + /* + * Valid IPv4 address within the address range of the specified subnet. + */ + private String ipAddress; + + /* + * Up to five VPC security group IDs, of the form ``sg-xxxxxxxx``. These must be for the same VPC as subnet + * specified. + */ + private List securityGroups; + + /* + * The ID of the subnet to add the mount target in. For One Zone file systems, use the subnet that is associated + * with the file system's Availability Zone. + */ + private String subnetId; + + /** + * Creates an instance of AwsEfsMountTargetProperties class. + */ + public AwsEfsMountTargetProperties() { + } + + /** + * Get the fileSystemId property: The ID of the file system for which to create the mount target. + * + * @return the fileSystemId value. + */ + public String fileSystemId() { + return this.fileSystemId; + } + + /** + * Set the fileSystemId property: The ID of the file system for which to create the mount target. + * + * @param fileSystemId the fileSystemId value to set. + * @return the AwsEfsMountTargetProperties object itself. + */ + public AwsEfsMountTargetProperties withFileSystemId(String fileSystemId) { + this.fileSystemId = fileSystemId; + return this; + } + + /** + * Get the id property: Property id. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Set the id property: Property id. + * + * @param id the id value to set. + * @return the AwsEfsMountTargetProperties object itself. + */ + public AwsEfsMountTargetProperties withId(String id) { + this.id = id; + return this; + } + + /** + * Get the ipAddress property: Valid IPv4 address within the address range of the specified subnet. + * + * @return the ipAddress value. + */ + public String ipAddress() { + return this.ipAddress; + } + + /** + * Set the ipAddress property: Valid IPv4 address within the address range of the specified subnet. + * + * @param ipAddress the ipAddress value to set. + * @return the AwsEfsMountTargetProperties object itself. + */ + public AwsEfsMountTargetProperties withIpAddress(String ipAddress) { + this.ipAddress = ipAddress; + return this; + } + + /** + * Get the securityGroups property: Up to five VPC security group IDs, of the form ``sg-xxxxxxxx``. These must be + * for the same VPC as subnet specified. + * + * @return the securityGroups value. + */ + public List securityGroups() { + return this.securityGroups; + } + + /** + * Set the securityGroups property: Up to five VPC security group IDs, of the form ``sg-xxxxxxxx``. These must be + * for the same VPC as subnet specified. + * + * @param securityGroups the securityGroups value to set. + * @return the AwsEfsMountTargetProperties object itself. + */ + public AwsEfsMountTargetProperties withSecurityGroups(List securityGroups) { + this.securityGroups = securityGroups; + return this; + } + + /** + * Get the subnetId property: The ID of the subnet to add the mount target in. For One Zone file systems, use the + * subnet that is associated with the file system's Availability Zone. + * + * @return the subnetId value. + */ + public String subnetId() { + return this.subnetId; + } + + /** + * Set the subnetId property: The ID of the subnet to add the mount target in. For One Zone file systems, use the + * subnet that is associated with the file system's Availability Zone. + * + * @param subnetId the subnetId value to set. + * @return the AwsEfsMountTargetProperties object itself. + */ + public AwsEfsMountTargetProperties withSubnetId(String subnetId) { + this.subnetId = subnetId; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("fileSystemId", this.fileSystemId); + jsonWriter.writeStringField("id", this.id); + jsonWriter.writeStringField("ipAddress", this.ipAddress); + jsonWriter.writeArrayField("securityGroups", this.securityGroups, + (writer, element) -> writer.writeString(element)); + jsonWriter.writeStringField("subnetId", this.subnetId); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AwsEfsMountTargetProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AwsEfsMountTargetProperties if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the AwsEfsMountTargetProperties. + */ + public static AwsEfsMountTargetProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AwsEfsMountTargetProperties deserializedAwsEfsMountTargetProperties = new AwsEfsMountTargetProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("fileSystemId".equals(fieldName)) { + deserializedAwsEfsMountTargetProperties.fileSystemId = reader.getString(); + } else if ("id".equals(fieldName)) { + deserializedAwsEfsMountTargetProperties.id = reader.getString(); + } else if ("ipAddress".equals(fieldName)) { + deserializedAwsEfsMountTargetProperties.ipAddress = reader.getString(); + } else if ("securityGroups".equals(fieldName)) { + List securityGroups = reader.readArray(reader1 -> reader1.getString()); + deserializedAwsEfsMountTargetProperties.securityGroups = securityGroups; + } else if ("subnetId".equals(fieldName)) { + deserializedAwsEfsMountTargetProperties.subnetId = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedAwsEfsMountTargetProperties; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/AwsEksClusterProperties.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/AwsEksClusterProperties.java new file mode 100644 index 000000000000..2a41d66469fc --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/AwsEksClusterProperties.java @@ -0,0 +1,757 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.time.OffsetDateTime; +import java.time.format.DateTimeFormatter; +import java.util.List; +import java.util.Map; + +/** + * Definition of awsEksCluster. + */ +@Fluent +public final class AwsEksClusterProperties implements JsonSerializable { + /* + *

The access configuration for the cluster.

+ */ + private AccessConfigResponse accessConfig; + + /* + *

The Amazon Resource Name (ARN) of the cluster.

+ */ + private String arn; + + /* + *

The certificate-authority-data for your cluster.

+ */ + private Certificate certificateAuthority; + + /* + *

A unique, case-sensitive identifier that you provide to ensure the idempotency of the request.

+ */ + private String clientRequestToken; + + /* + *

The configuration used to connect to a cluster for registration.

+ */ + private ConnectorConfigResponse connectorConfig; + + /* + *

The Unix epoch timestamp at object creation.

+ */ + private OffsetDateTime createdAt; + + /* + *

The encryption configuration for the cluster.

+ */ + private List encryptionConfig; + + /* + *

The endpoint for your Kubernetes API server.

+ */ + private String endpoint; + + /* + *

An object representing the health of your local Amazon EKS cluster on an Amazon Web Services Outpost. This + * object isn't available for clusters on the Amazon Web Services cloud.

+ */ + private ClusterHealth health; + + /* + *

The ID of your local Amazon EKS cluster on an Amazon Web Services Outpost. This property isn't available for + * an Amazon EKS cluster on the Amazon Web Services cloud.

+ */ + private String id; + + /* + *

The identity provider information for the cluster.

+ */ + private Identity identity; + + /* + *

The Kubernetes network configuration for the cluster.

+ */ + private KubernetesNetworkConfigResponse kubernetesNetworkConfig; + + /* + *

The logging configuration for your cluster.

+ */ + private LoggingAutoGenerated logging; + + /* + *

The name of your cluster.

+ */ + private String name; + + /* + *

An object representing the configuration of your local Amazon EKS cluster on an Amazon Web Services Outpost. + * This object isn't available for clusters on the Amazon Web Services cloud.

+ */ + private OutpostConfigResponse outpostConfig; + + /* + *

The platform version of your Amazon EKS cluster. For more information about clusters deployed on the Amazon + * Web Services Cloud, see Platform versions in the + * Amazon EKS User Guide . For more information about local clusters deployed on an Outpost, see Amazon EKS local + * cluster platform versions in the Amazon EKS User Guide .

+ */ + private String platformVersion; + + /* + *

The VPC configuration used by the cluster control plane. Amazon EKS VPC resources have specific requirements + * to work properly with Kubernetes. For more information, see Cluster VPC considerations and Cluster security group + * considerations in the Amazon EKS User Guide.

+ */ + private VpcConfigResponse resourcesVpcConfig; + + /* + *

The Amazon Resource Name (ARN) of the IAM role that provides permissions for the Kubernetes control plane to + * make calls to Amazon Web Services API operations on your behalf.

+ */ + private String roleArn; + + /* + *

The current status of the cluster.

+ */ + private ClusterStatusEnumValue status; + + /* + *

Metadata that assists with categorization and organization. Each tag consists of a key and an optional value. + * You define both. Tags don't propagate to any other cluster or Amazon Web Services resources.

+ */ + private Map tags; + + /* + *

The Kubernetes server version for the cluster.

+ */ + private String version; + + /** + * Creates an instance of AwsEksClusterProperties class. + */ + public AwsEksClusterProperties() { + } + + /** + * Get the accessConfig property: <p>The access configuration for the cluster.</p>. + * + * @return the accessConfig value. + */ + public AccessConfigResponse accessConfig() { + return this.accessConfig; + } + + /** + * Set the accessConfig property: <p>The access configuration for the cluster.</p>. + * + * @param accessConfig the accessConfig value to set. + * @return the AwsEksClusterProperties object itself. + */ + public AwsEksClusterProperties withAccessConfig(AccessConfigResponse accessConfig) { + this.accessConfig = accessConfig; + return this; + } + + /** + * Get the arn property: <p>The Amazon Resource Name (ARN) of the cluster.</p>. + * + * @return the arn value. + */ + public String arn() { + return this.arn; + } + + /** + * Set the arn property: <p>The Amazon Resource Name (ARN) of the cluster.</p>. + * + * @param arn the arn value to set. + * @return the AwsEksClusterProperties object itself. + */ + public AwsEksClusterProperties withArn(String arn) { + this.arn = arn; + return this; + } + + /** + * Get the certificateAuthority property: <p>The <code>certificate-authority-data</code> for your + * cluster.</p>. + * + * @return the certificateAuthority value. + */ + public Certificate certificateAuthority() { + return this.certificateAuthority; + } + + /** + * Set the certificateAuthority property: <p>The <code>certificate-authority-data</code> for your + * cluster.</p>. + * + * @param certificateAuthority the certificateAuthority value to set. + * @return the AwsEksClusterProperties object itself. + */ + public AwsEksClusterProperties withCertificateAuthority(Certificate certificateAuthority) { + this.certificateAuthority = certificateAuthority; + return this; + } + + /** + * Get the clientRequestToken property: <p>A unique, case-sensitive identifier that you provide to ensure the + * idempotency of the request.</p>. + * + * @return the clientRequestToken value. + */ + public String clientRequestToken() { + return this.clientRequestToken; + } + + /** + * Set the clientRequestToken property: <p>A unique, case-sensitive identifier that you provide to ensure the + * idempotency of the request.</p>. + * + * @param clientRequestToken the clientRequestToken value to set. + * @return the AwsEksClusterProperties object itself. + */ + public AwsEksClusterProperties withClientRequestToken(String clientRequestToken) { + this.clientRequestToken = clientRequestToken; + return this; + } + + /** + * Get the connectorConfig property: <p>The configuration used to connect to a cluster for + * registration.</p>. + * + * @return the connectorConfig value. + */ + public ConnectorConfigResponse connectorConfig() { + return this.connectorConfig; + } + + /** + * Set the connectorConfig property: <p>The configuration used to connect to a cluster for + * registration.</p>. + * + * @param connectorConfig the connectorConfig value to set. + * @return the AwsEksClusterProperties object itself. + */ + public AwsEksClusterProperties withConnectorConfig(ConnectorConfigResponse connectorConfig) { + this.connectorConfig = connectorConfig; + return this; + } + + /** + * Get the createdAt property: <p>The Unix epoch timestamp at object creation.</p>. + * + * @return the createdAt value. + */ + public OffsetDateTime createdAt() { + return this.createdAt; + } + + /** + * Set the createdAt property: <p>The Unix epoch timestamp at object creation.</p>. + * + * @param createdAt the createdAt value to set. + * @return the AwsEksClusterProperties object itself. + */ + public AwsEksClusterProperties withCreatedAt(OffsetDateTime createdAt) { + this.createdAt = createdAt; + return this; + } + + /** + * Get the encryptionConfig property: <p>The encryption configuration for the cluster.</p>. + * + * @return the encryptionConfig value. + */ + public List encryptionConfig() { + return this.encryptionConfig; + } + + /** + * Set the encryptionConfig property: <p>The encryption configuration for the cluster.</p>. + * + * @param encryptionConfig the encryptionConfig value to set. + * @return the AwsEksClusterProperties object itself. + */ + public AwsEksClusterProperties withEncryptionConfig(List encryptionConfig) { + this.encryptionConfig = encryptionConfig; + return this; + } + + /** + * Get the endpoint property: <p>The endpoint for your Kubernetes API server.</p>. + * + * @return the endpoint value. + */ + public String endpoint() { + return this.endpoint; + } + + /** + * Set the endpoint property: <p>The endpoint for your Kubernetes API server.</p>. + * + * @param endpoint the endpoint value to set. + * @return the AwsEksClusterProperties object itself. + */ + public AwsEksClusterProperties withEndpoint(String endpoint) { + this.endpoint = endpoint; + return this; + } + + /** + * Get the health property: <p>An object representing the health of your local Amazon EKS cluster on an Amazon + * Web Services Outpost. This object isn't available for clusters on the Amazon Web Services cloud.</p>. + * + * @return the health value. + */ + public ClusterHealth health() { + return this.health; + } + + /** + * Set the health property: <p>An object representing the health of your local Amazon EKS cluster on an Amazon + * Web Services Outpost. This object isn't available for clusters on the Amazon Web Services cloud.</p>. + * + * @param health the health value to set. + * @return the AwsEksClusterProperties object itself. + */ + public AwsEksClusterProperties withHealth(ClusterHealth health) { + this.health = health; + return this; + } + + /** + * Get the id property: <p>The ID of your local Amazon EKS cluster on an Amazon Web Services Outpost. This + * property isn't available for an Amazon EKS cluster on the Amazon Web Services cloud.</p>. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Set the id property: <p>The ID of your local Amazon EKS cluster on an Amazon Web Services Outpost. This + * property isn't available for an Amazon EKS cluster on the Amazon Web Services cloud.</p>. + * + * @param id the id value to set. + * @return the AwsEksClusterProperties object itself. + */ + public AwsEksClusterProperties withId(String id) { + this.id = id; + return this; + } + + /** + * Get the identity property: <p>The identity provider information for the cluster.</p>. + * + * @return the identity value. + */ + public Identity identity() { + return this.identity; + } + + /** + * Set the identity property: <p>The identity provider information for the cluster.</p>. + * + * @param identity the identity value to set. + * @return the AwsEksClusterProperties object itself. + */ + public AwsEksClusterProperties withIdentity(Identity identity) { + this.identity = identity; + return this; + } + + /** + * Get the kubernetesNetworkConfig property: <p>The Kubernetes network configuration for the + * cluster.</p>. + * + * @return the kubernetesNetworkConfig value. + */ + public KubernetesNetworkConfigResponse kubernetesNetworkConfig() { + return this.kubernetesNetworkConfig; + } + + /** + * Set the kubernetesNetworkConfig property: <p>The Kubernetes network configuration for the + * cluster.</p>. + * + * @param kubernetesNetworkConfig the kubernetesNetworkConfig value to set. + * @return the AwsEksClusterProperties object itself. + */ + public AwsEksClusterProperties + withKubernetesNetworkConfig(KubernetesNetworkConfigResponse kubernetesNetworkConfig) { + this.kubernetesNetworkConfig = kubernetesNetworkConfig; + return this; + } + + /** + * Get the logging property: <p>The logging configuration for your cluster.</p>. + * + * @return the logging value. + */ + public LoggingAutoGenerated logging() { + return this.logging; + } + + /** + * Set the logging property: <p>The logging configuration for your cluster.</p>. + * + * @param logging the logging value to set. + * @return the AwsEksClusterProperties object itself. + */ + public AwsEksClusterProperties withLogging(LoggingAutoGenerated logging) { + this.logging = logging; + return this; + } + + /** + * Get the name property: <p>The name of your cluster.</p>. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: <p>The name of your cluster.</p>. + * + * @param name the name value to set. + * @return the AwsEksClusterProperties object itself. + */ + public AwsEksClusterProperties withName(String name) { + this.name = name; + return this; + } + + /** + * Get the outpostConfig property: <p>An object representing the configuration of your local Amazon EKS + * cluster on an Amazon Web Services Outpost. This object isn't available for clusters on the Amazon Web Services + * cloud.</p>. + * + * @return the outpostConfig value. + */ + public OutpostConfigResponse outpostConfig() { + return this.outpostConfig; + } + + /** + * Set the outpostConfig property: <p>An object representing the configuration of your local Amazon EKS + * cluster on an Amazon Web Services Outpost. This object isn't available for clusters on the Amazon Web Services + * cloud.</p>. + * + * @param outpostConfig the outpostConfig value to set. + * @return the AwsEksClusterProperties object itself. + */ + public AwsEksClusterProperties withOutpostConfig(OutpostConfigResponse outpostConfig) { + this.outpostConfig = outpostConfig; + return this; + } + + /** + * Get the platformVersion property: <p>The platform version of your Amazon EKS cluster. For more information + * about clusters deployed on the Amazon Web Services Cloud, see <a + * href='https://docs.aws.amazon.com/eks/latest/userguide/platform-versions.html'>Platform versions</a> in + * the <i> <i>Amazon EKS User Guide</i> </i>. For more information about local clusters + * deployed on an Outpost, see <a + * href='https://docs.aws.amazon.com/eks/latest/userguide/eks-outposts-platform-versions.html'>Amazon EKS local + * cluster platform versions</a> in the <i> <i>Amazon EKS User Guide</i> + * </i>.</p>. + * + * @return the platformVersion value. + */ + public String platformVersion() { + return this.platformVersion; + } + + /** + * Set the platformVersion property: <p>The platform version of your Amazon EKS cluster. For more information + * about clusters deployed on the Amazon Web Services Cloud, see <a + * href='https://docs.aws.amazon.com/eks/latest/userguide/platform-versions.html'>Platform versions</a> in + * the <i> <i>Amazon EKS User Guide</i> </i>. For more information about local clusters + * deployed on an Outpost, see <a + * href='https://docs.aws.amazon.com/eks/latest/userguide/eks-outposts-platform-versions.html'>Amazon EKS local + * cluster platform versions</a> in the <i> <i>Amazon EKS User Guide</i> + * </i>.</p>. + * + * @param platformVersion the platformVersion value to set. + * @return the AwsEksClusterProperties object itself. + */ + public AwsEksClusterProperties withPlatformVersion(String platformVersion) { + this.platformVersion = platformVersion; + return this; + } + + /** + * Get the resourcesVpcConfig property: <p>The VPC configuration used by the cluster control plane. Amazon EKS + * VPC resources have specific requirements to work properly with Kubernetes. For more information, see <a + * href='https://docs.aws.amazon.com/eks/latest/userguide/network_reqs.html'>Cluster VPC considerations</a> + * and <a href='https://docs.aws.amazon.com/eks/latest/userguide/sec-group-reqs.html'>Cluster security group + * considerations</a> in the <i>Amazon EKS User Guide</i>.</p>. + * + * @return the resourcesVpcConfig value. + */ + public VpcConfigResponse resourcesVpcConfig() { + return this.resourcesVpcConfig; + } + + /** + * Set the resourcesVpcConfig property: <p>The VPC configuration used by the cluster control plane. Amazon EKS + * VPC resources have specific requirements to work properly with Kubernetes. For more information, see <a + * href='https://docs.aws.amazon.com/eks/latest/userguide/network_reqs.html'>Cluster VPC considerations</a> + * and <a href='https://docs.aws.amazon.com/eks/latest/userguide/sec-group-reqs.html'>Cluster security group + * considerations</a> in the <i>Amazon EKS User Guide</i>.</p>. + * + * @param resourcesVpcConfig the resourcesVpcConfig value to set. + * @return the AwsEksClusterProperties object itself. + */ + public AwsEksClusterProperties withResourcesVpcConfig(VpcConfigResponse resourcesVpcConfig) { + this.resourcesVpcConfig = resourcesVpcConfig; + return this; + } + + /** + * Get the roleArn property: <p>The Amazon Resource Name (ARN) of the IAM role that provides permissions for + * the Kubernetes control plane to make calls to Amazon Web Services API operations on your behalf.</p>. + * + * @return the roleArn value. + */ + public String roleArn() { + return this.roleArn; + } + + /** + * Set the roleArn property: <p>The Amazon Resource Name (ARN) of the IAM role that provides permissions for + * the Kubernetes control plane to make calls to Amazon Web Services API operations on your behalf.</p>. + * + * @param roleArn the roleArn value to set. + * @return the AwsEksClusterProperties object itself. + */ + public AwsEksClusterProperties withRoleArn(String roleArn) { + this.roleArn = roleArn; + return this; + } + + /** + * Get the status property: <p>The current status of the cluster.</p>. + * + * @return the status value. + */ + public ClusterStatusEnumValue status() { + return this.status; + } + + /** + * Set the status property: <p>The current status of the cluster.</p>. + * + * @param status the status value to set. + * @return the AwsEksClusterProperties object itself. + */ + public AwsEksClusterProperties withStatus(ClusterStatusEnumValue status) { + this.status = status; + return this; + } + + /** + * Get the tags property: <p>Metadata that assists with categorization and organization. Each tag consists of + * a key and an optional value. You define both. Tags don't propagate to any other cluster or Amazon Web Services + * resources.</p>. + * + * @return the tags value. + */ + public Map tags() { + return this.tags; + } + + /** + * Set the tags property: <p>Metadata that assists with categorization and organization. Each tag consists of + * a key and an optional value. You define both. Tags don't propagate to any other cluster or Amazon Web Services + * resources.</p>. + * + * @param tags the tags value to set. + * @return the AwsEksClusterProperties object itself. + */ + public AwsEksClusterProperties withTags(Map tags) { + this.tags = tags; + return this; + } + + /** + * Get the version property: <p>The Kubernetes server version for the cluster.</p>. + * + * @return the version value. + */ + public String version() { + return this.version; + } + + /** + * Set the version property: <p>The Kubernetes server version for the cluster.</p>. + * + * @param version the version value to set. + * @return the AwsEksClusterProperties object itself. + */ + public AwsEksClusterProperties withVersion(String version) { + this.version = version; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (accessConfig() != null) { + accessConfig().validate(); + } + if (certificateAuthority() != null) { + certificateAuthority().validate(); + } + if (connectorConfig() != null) { + connectorConfig().validate(); + } + if (encryptionConfig() != null) { + encryptionConfig().forEach(e -> e.validate()); + } + if (health() != null) { + health().validate(); + } + if (identity() != null) { + identity().validate(); + } + if (kubernetesNetworkConfig() != null) { + kubernetesNetworkConfig().validate(); + } + if (logging() != null) { + logging().validate(); + } + if (outpostConfig() != null) { + outpostConfig().validate(); + } + if (resourcesVpcConfig() != null) { + resourcesVpcConfig().validate(); + } + if (status() != null) { + status().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("accessConfig", this.accessConfig); + jsonWriter.writeStringField("arn", this.arn); + jsonWriter.writeJsonField("certificateAuthority", this.certificateAuthority); + jsonWriter.writeStringField("clientRequestToken", this.clientRequestToken); + jsonWriter.writeJsonField("connectorConfig", this.connectorConfig); + jsonWriter.writeStringField("createdAt", + this.createdAt == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.createdAt)); + jsonWriter.writeArrayField("encryptionConfig", this.encryptionConfig, + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("endpoint", this.endpoint); + jsonWriter.writeJsonField("health", this.health); + jsonWriter.writeStringField("id", this.id); + jsonWriter.writeJsonField("identity", this.identity); + jsonWriter.writeJsonField("kubernetesNetworkConfig", this.kubernetesNetworkConfig); + jsonWriter.writeJsonField("logging", this.logging); + jsonWriter.writeStringField("name", this.name); + jsonWriter.writeJsonField("outpostConfig", this.outpostConfig); + jsonWriter.writeStringField("platformVersion", this.platformVersion); + jsonWriter.writeJsonField("resourcesVpcConfig", this.resourcesVpcConfig); + jsonWriter.writeStringField("roleArn", this.roleArn); + jsonWriter.writeJsonField("status", this.status); + jsonWriter.writeMapField("tags", this.tags, (writer, element) -> writer.writeString(element)); + jsonWriter.writeStringField("version", this.version); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AwsEksClusterProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AwsEksClusterProperties if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the AwsEksClusterProperties. + */ + public static AwsEksClusterProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AwsEksClusterProperties deserializedAwsEksClusterProperties = new AwsEksClusterProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("accessConfig".equals(fieldName)) { + deserializedAwsEksClusterProperties.accessConfig = AccessConfigResponse.fromJson(reader); + } else if ("arn".equals(fieldName)) { + deserializedAwsEksClusterProperties.arn = reader.getString(); + } else if ("certificateAuthority".equals(fieldName)) { + deserializedAwsEksClusterProperties.certificateAuthority = Certificate.fromJson(reader); + } else if ("clientRequestToken".equals(fieldName)) { + deserializedAwsEksClusterProperties.clientRequestToken = reader.getString(); + } else if ("connectorConfig".equals(fieldName)) { + deserializedAwsEksClusterProperties.connectorConfig = ConnectorConfigResponse.fromJson(reader); + } else if ("createdAt".equals(fieldName)) { + deserializedAwsEksClusterProperties.createdAt = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("encryptionConfig".equals(fieldName)) { + List encryptionConfig + = reader.readArray(reader1 -> EncryptionConfig.fromJson(reader1)); + deserializedAwsEksClusterProperties.encryptionConfig = encryptionConfig; + } else if ("endpoint".equals(fieldName)) { + deserializedAwsEksClusterProperties.endpoint = reader.getString(); + } else if ("health".equals(fieldName)) { + deserializedAwsEksClusterProperties.health = ClusterHealth.fromJson(reader); + } else if ("id".equals(fieldName)) { + deserializedAwsEksClusterProperties.id = reader.getString(); + } else if ("identity".equals(fieldName)) { + deserializedAwsEksClusterProperties.identity = Identity.fromJson(reader); + } else if ("kubernetesNetworkConfig".equals(fieldName)) { + deserializedAwsEksClusterProperties.kubernetesNetworkConfig + = KubernetesNetworkConfigResponse.fromJson(reader); + } else if ("logging".equals(fieldName)) { + deserializedAwsEksClusterProperties.logging = LoggingAutoGenerated.fromJson(reader); + } else if ("name".equals(fieldName)) { + deserializedAwsEksClusterProperties.name = reader.getString(); + } else if ("outpostConfig".equals(fieldName)) { + deserializedAwsEksClusterProperties.outpostConfig = OutpostConfigResponse.fromJson(reader); + } else if ("platformVersion".equals(fieldName)) { + deserializedAwsEksClusterProperties.platformVersion = reader.getString(); + } else if ("resourcesVpcConfig".equals(fieldName)) { + deserializedAwsEksClusterProperties.resourcesVpcConfig = VpcConfigResponse.fromJson(reader); + } else if ("roleArn".equals(fieldName)) { + deserializedAwsEksClusterProperties.roleArn = reader.getString(); + } else if ("status".equals(fieldName)) { + deserializedAwsEksClusterProperties.status = ClusterStatusEnumValue.fromJson(reader); + } else if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedAwsEksClusterProperties.tags = tags; + } else if ("version".equals(fieldName)) { + deserializedAwsEksClusterProperties.version = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedAwsEksClusterProperties; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/AwsEksNodegroupProperties.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/AwsEksNodegroupProperties.java new file mode 100644 index 000000000000..4b2f1d8a86e9 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/AwsEksNodegroupProperties.java @@ -0,0 +1,668 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; +import java.util.Map; + +/** + * Definition of awsEksNodegroup. + */ +@Fluent +public final class AwsEksNodegroupProperties implements JsonSerializable { + /* + * The AMI type for your node group. + */ + private String amiType; + + /* + * Property arn + */ + private String arn; + + /* + * The capacity type of your managed node group. + */ + private String capacityType; + + /* + * Name of the cluster to create the node group in. + */ + private String clusterName; + + /* + * The root device disk size (in GiB) for your node group instances. + */ + private Integer diskSize; + + /* + * Force the update if the existing node group's pods are unable to be drained due to a pod disruption budget issue. + */ + private Boolean forceUpdateEnabled; + + /* + * Property id + */ + private String id; + + /* + * Specify the instance types for a node group. + */ + private List instanceTypes; + + /* + * The Kubernetes labels to be applied to the nodes in the node group when they are created. + */ + private Map labels; + + /* + * An object representing a node group's launch template specification. An object representing a launch template + * specification for AWS EKS Nodegroup. + */ + private LaunchTemplateSpecificationAutoGenerated launchTemplate; + + /* + * The Amazon Resource Name (ARN) of the IAM role to associate with your node group. + */ + private String nodeRole; + + /* + * The unique name to give your node group. + */ + private String nodegroupName; + + /* + * The AMI version of the Amazon EKS-optimized AMI to use with your node group. + */ + private String releaseVersion; + + /* + * The remote access (SSH) configuration to use with your node group. An object representing a remote access + * configuration specification for AWS EKS Nodegroup. + */ + private RemoteAccess remoteAccess; + + /* + * The scaling configuration details for the Auto Scaling group that is created for your node group. An object + * representing a auto scaling group specification for AWS EKS Nodegroup. + */ + private ScalingConfig scalingConfig; + + /* + * The subnets to use for the Auto Scaling group that is created for your node group. + */ + private List subnets; + + /* + * The metadata, as key-value pairs, to apply to the node group to assist with categorization and organization. + * Follows same schema as Labels for consistency. + */ + private Map tags; + + /* + * The Kubernetes taints to be applied to the nodes in the node group when they are created. + */ + private List taints; + + /* + * The node group update configuration. The node group update configuration. + */ + private UpdateConfig updateConfig; + + /* + * The Kubernetes version to use for your managed nodes. + */ + private String version; + + /** + * Creates an instance of AwsEksNodegroupProperties class. + */ + public AwsEksNodegroupProperties() { + } + + /** + * Get the amiType property: The AMI type for your node group. + * + * @return the amiType value. + */ + public String amiType() { + return this.amiType; + } + + /** + * Set the amiType property: The AMI type for your node group. + * + * @param amiType the amiType value to set. + * @return the AwsEksNodegroupProperties object itself. + */ + public AwsEksNodegroupProperties withAmiType(String amiType) { + this.amiType = amiType; + return this; + } + + /** + * Get the arn property: Property arn. + * + * @return the arn value. + */ + public String arn() { + return this.arn; + } + + /** + * Set the arn property: Property arn. + * + * @param arn the arn value to set. + * @return the AwsEksNodegroupProperties object itself. + */ + public AwsEksNodegroupProperties withArn(String arn) { + this.arn = arn; + return this; + } + + /** + * Get the capacityType property: The capacity type of your managed node group. + * + * @return the capacityType value. + */ + public String capacityType() { + return this.capacityType; + } + + /** + * Set the capacityType property: The capacity type of your managed node group. + * + * @param capacityType the capacityType value to set. + * @return the AwsEksNodegroupProperties object itself. + */ + public AwsEksNodegroupProperties withCapacityType(String capacityType) { + this.capacityType = capacityType; + return this; + } + + /** + * Get the clusterName property: Name of the cluster to create the node group in. + * + * @return the clusterName value. + */ + public String clusterName() { + return this.clusterName; + } + + /** + * Set the clusterName property: Name of the cluster to create the node group in. + * + * @param clusterName the clusterName value to set. + * @return the AwsEksNodegroupProperties object itself. + */ + public AwsEksNodegroupProperties withClusterName(String clusterName) { + this.clusterName = clusterName; + return this; + } + + /** + * Get the diskSize property: The root device disk size (in GiB) for your node group instances. + * + * @return the diskSize value. + */ + public Integer diskSize() { + return this.diskSize; + } + + /** + * Set the diskSize property: The root device disk size (in GiB) for your node group instances. + * + * @param diskSize the diskSize value to set. + * @return the AwsEksNodegroupProperties object itself. + */ + public AwsEksNodegroupProperties withDiskSize(Integer diskSize) { + this.diskSize = diskSize; + return this; + } + + /** + * Get the forceUpdateEnabled property: Force the update if the existing node group's pods are unable to be drained + * due to a pod disruption budget issue. + * + * @return the forceUpdateEnabled value. + */ + public Boolean forceUpdateEnabled() { + return this.forceUpdateEnabled; + } + + /** + * Set the forceUpdateEnabled property: Force the update if the existing node group's pods are unable to be drained + * due to a pod disruption budget issue. + * + * @param forceUpdateEnabled the forceUpdateEnabled value to set. + * @return the AwsEksNodegroupProperties object itself. + */ + public AwsEksNodegroupProperties withForceUpdateEnabled(Boolean forceUpdateEnabled) { + this.forceUpdateEnabled = forceUpdateEnabled; + return this; + } + + /** + * Get the id property: Property id. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Set the id property: Property id. + * + * @param id the id value to set. + * @return the AwsEksNodegroupProperties object itself. + */ + public AwsEksNodegroupProperties withId(String id) { + this.id = id; + return this; + } + + /** + * Get the instanceTypes property: Specify the instance types for a node group. + * + * @return the instanceTypes value. + */ + public List instanceTypes() { + return this.instanceTypes; + } + + /** + * Set the instanceTypes property: Specify the instance types for a node group. + * + * @param instanceTypes the instanceTypes value to set. + * @return the AwsEksNodegroupProperties object itself. + */ + public AwsEksNodegroupProperties withInstanceTypes(List instanceTypes) { + this.instanceTypes = instanceTypes; + return this; + } + + /** + * Get the labels property: The Kubernetes labels to be applied to the nodes in the node group when they are + * created. + * + * @return the labels value. + */ + public Map labels() { + return this.labels; + } + + /** + * Set the labels property: The Kubernetes labels to be applied to the nodes in the node group when they are + * created. + * + * @param labels the labels value to set. + * @return the AwsEksNodegroupProperties object itself. + */ + public AwsEksNodegroupProperties withLabels(Map labels) { + this.labels = labels; + return this; + } + + /** + * Get the launchTemplate property: An object representing a node group's launch template specification. An object + * representing a launch template specification for AWS EKS Nodegroup. + * + * @return the launchTemplate value. + */ + public LaunchTemplateSpecificationAutoGenerated launchTemplate() { + return this.launchTemplate; + } + + /** + * Set the launchTemplate property: An object representing a node group's launch template specification. An object + * representing a launch template specification for AWS EKS Nodegroup. + * + * @param launchTemplate the launchTemplate value to set. + * @return the AwsEksNodegroupProperties object itself. + */ + public AwsEksNodegroupProperties withLaunchTemplate(LaunchTemplateSpecificationAutoGenerated launchTemplate) { + this.launchTemplate = launchTemplate; + return this; + } + + /** + * Get the nodeRole property: The Amazon Resource Name (ARN) of the IAM role to associate with your node group. + * + * @return the nodeRole value. + */ + public String nodeRole() { + return this.nodeRole; + } + + /** + * Set the nodeRole property: The Amazon Resource Name (ARN) of the IAM role to associate with your node group. + * + * @param nodeRole the nodeRole value to set. + * @return the AwsEksNodegroupProperties object itself. + */ + public AwsEksNodegroupProperties withNodeRole(String nodeRole) { + this.nodeRole = nodeRole; + return this; + } + + /** + * Get the nodegroupName property: The unique name to give your node group. + * + * @return the nodegroupName value. + */ + public String nodegroupName() { + return this.nodegroupName; + } + + /** + * Set the nodegroupName property: The unique name to give your node group. + * + * @param nodegroupName the nodegroupName value to set. + * @return the AwsEksNodegroupProperties object itself. + */ + public AwsEksNodegroupProperties withNodegroupName(String nodegroupName) { + this.nodegroupName = nodegroupName; + return this; + } + + /** + * Get the releaseVersion property: The AMI version of the Amazon EKS-optimized AMI to use with your node group. + * + * @return the releaseVersion value. + */ + public String releaseVersion() { + return this.releaseVersion; + } + + /** + * Set the releaseVersion property: The AMI version of the Amazon EKS-optimized AMI to use with your node group. + * + * @param releaseVersion the releaseVersion value to set. + * @return the AwsEksNodegroupProperties object itself. + */ + public AwsEksNodegroupProperties withReleaseVersion(String releaseVersion) { + this.releaseVersion = releaseVersion; + return this; + } + + /** + * Get the remoteAccess property: The remote access (SSH) configuration to use with your node group. An object + * representing a remote access configuration specification for AWS EKS Nodegroup. + * + * @return the remoteAccess value. + */ + public RemoteAccess remoteAccess() { + return this.remoteAccess; + } + + /** + * Set the remoteAccess property: The remote access (SSH) configuration to use with your node group. An object + * representing a remote access configuration specification for AWS EKS Nodegroup. + * + * @param remoteAccess the remoteAccess value to set. + * @return the AwsEksNodegroupProperties object itself. + */ + public AwsEksNodegroupProperties withRemoteAccess(RemoteAccess remoteAccess) { + this.remoteAccess = remoteAccess; + return this; + } + + /** + * Get the scalingConfig property: The scaling configuration details for the Auto Scaling group that is created for + * your node group. An object representing a auto scaling group specification for AWS EKS Nodegroup. + * + * @return the scalingConfig value. + */ + public ScalingConfig scalingConfig() { + return this.scalingConfig; + } + + /** + * Set the scalingConfig property: The scaling configuration details for the Auto Scaling group that is created for + * your node group. An object representing a auto scaling group specification for AWS EKS Nodegroup. + * + * @param scalingConfig the scalingConfig value to set. + * @return the AwsEksNodegroupProperties object itself. + */ + public AwsEksNodegroupProperties withScalingConfig(ScalingConfig scalingConfig) { + this.scalingConfig = scalingConfig; + return this; + } + + /** + * Get the subnets property: The subnets to use for the Auto Scaling group that is created for your node group. + * + * @return the subnets value. + */ + public List subnets() { + return this.subnets; + } + + /** + * Set the subnets property: The subnets to use for the Auto Scaling group that is created for your node group. + * + * @param subnets the subnets value to set. + * @return the AwsEksNodegroupProperties object itself. + */ + public AwsEksNodegroupProperties withSubnets(List subnets) { + this.subnets = subnets; + return this; + } + + /** + * Get the tags property: The metadata, as key-value pairs, to apply to the node group to assist with categorization + * and organization. Follows same schema as Labels for consistency. + * + * @return the tags value. + */ + public Map tags() { + return this.tags; + } + + /** + * Set the tags property: The metadata, as key-value pairs, to apply to the node group to assist with categorization + * and organization. Follows same schema as Labels for consistency. + * + * @param tags the tags value to set. + * @return the AwsEksNodegroupProperties object itself. + */ + public AwsEksNodegroupProperties withTags(Map tags) { + this.tags = tags; + return this; + } + + /** + * Get the taints property: The Kubernetes taints to be applied to the nodes in the node group when they are + * created. + * + * @return the taints value. + */ + public List taints() { + return this.taints; + } + + /** + * Set the taints property: The Kubernetes taints to be applied to the nodes in the node group when they are + * created. + * + * @param taints the taints value to set. + * @return the AwsEksNodegroupProperties object itself. + */ + public AwsEksNodegroupProperties withTaints(List taints) { + this.taints = taints; + return this; + } + + /** + * Get the updateConfig property: The node group update configuration. The node group update configuration. + * + * @return the updateConfig value. + */ + public UpdateConfig updateConfig() { + return this.updateConfig; + } + + /** + * Set the updateConfig property: The node group update configuration. The node group update configuration. + * + * @param updateConfig the updateConfig value to set. + * @return the AwsEksNodegroupProperties object itself. + */ + public AwsEksNodegroupProperties withUpdateConfig(UpdateConfig updateConfig) { + this.updateConfig = updateConfig; + return this; + } + + /** + * Get the version property: The Kubernetes version to use for your managed nodes. + * + * @return the version value. + */ + public String version() { + return this.version; + } + + /** + * Set the version property: The Kubernetes version to use for your managed nodes. + * + * @param version the version value to set. + * @return the AwsEksNodegroupProperties object itself. + */ + public AwsEksNodegroupProperties withVersion(String version) { + this.version = version; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (launchTemplate() != null) { + launchTemplate().validate(); + } + if (remoteAccess() != null) { + remoteAccess().validate(); + } + if (scalingConfig() != null) { + scalingConfig().validate(); + } + if (taints() != null) { + taints().forEach(e -> e.validate()); + } + if (updateConfig() != null) { + updateConfig().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("amiType", this.amiType); + jsonWriter.writeStringField("arn", this.arn); + jsonWriter.writeStringField("capacityType", this.capacityType); + jsonWriter.writeStringField("clusterName", this.clusterName); + jsonWriter.writeNumberField("diskSize", this.diskSize); + jsonWriter.writeBooleanField("forceUpdateEnabled", this.forceUpdateEnabled); + jsonWriter.writeStringField("id", this.id); + jsonWriter.writeArrayField("instanceTypes", this.instanceTypes, + (writer, element) -> writer.writeString(element)); + jsonWriter.writeMapField("labels", this.labels, (writer, element) -> writer.writeString(element)); + jsonWriter.writeJsonField("launchTemplate", this.launchTemplate); + jsonWriter.writeStringField("nodeRole", this.nodeRole); + jsonWriter.writeStringField("nodegroupName", this.nodegroupName); + jsonWriter.writeStringField("releaseVersion", this.releaseVersion); + jsonWriter.writeJsonField("remoteAccess", this.remoteAccess); + jsonWriter.writeJsonField("scalingConfig", this.scalingConfig); + jsonWriter.writeArrayField("subnets", this.subnets, (writer, element) -> writer.writeString(element)); + jsonWriter.writeMapField("tags", this.tags, (writer, element) -> writer.writeString(element)); + jsonWriter.writeArrayField("taints", this.taints, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeJsonField("updateConfig", this.updateConfig); + jsonWriter.writeStringField("version", this.version); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AwsEksNodegroupProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AwsEksNodegroupProperties if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IOException If an error occurs while reading the AwsEksNodegroupProperties. + */ + public static AwsEksNodegroupProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AwsEksNodegroupProperties deserializedAwsEksNodegroupProperties = new AwsEksNodegroupProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("amiType".equals(fieldName)) { + deserializedAwsEksNodegroupProperties.amiType = reader.getString(); + } else if ("arn".equals(fieldName)) { + deserializedAwsEksNodegroupProperties.arn = reader.getString(); + } else if ("capacityType".equals(fieldName)) { + deserializedAwsEksNodegroupProperties.capacityType = reader.getString(); + } else if ("clusterName".equals(fieldName)) { + deserializedAwsEksNodegroupProperties.clusterName = reader.getString(); + } else if ("diskSize".equals(fieldName)) { + deserializedAwsEksNodegroupProperties.diskSize = reader.getNullable(JsonReader::getInt); + } else if ("forceUpdateEnabled".equals(fieldName)) { + deserializedAwsEksNodegroupProperties.forceUpdateEnabled + = reader.getNullable(JsonReader::getBoolean); + } else if ("id".equals(fieldName)) { + deserializedAwsEksNodegroupProperties.id = reader.getString(); + } else if ("instanceTypes".equals(fieldName)) { + List instanceTypes = reader.readArray(reader1 -> reader1.getString()); + deserializedAwsEksNodegroupProperties.instanceTypes = instanceTypes; + } else if ("labels".equals(fieldName)) { + Map labels = reader.readMap(reader1 -> reader1.getString()); + deserializedAwsEksNodegroupProperties.labels = labels; + } else if ("launchTemplate".equals(fieldName)) { + deserializedAwsEksNodegroupProperties.launchTemplate + = LaunchTemplateSpecificationAutoGenerated.fromJson(reader); + } else if ("nodeRole".equals(fieldName)) { + deserializedAwsEksNodegroupProperties.nodeRole = reader.getString(); + } else if ("nodegroupName".equals(fieldName)) { + deserializedAwsEksNodegroupProperties.nodegroupName = reader.getString(); + } else if ("releaseVersion".equals(fieldName)) { + deserializedAwsEksNodegroupProperties.releaseVersion = reader.getString(); + } else if ("remoteAccess".equals(fieldName)) { + deserializedAwsEksNodegroupProperties.remoteAccess = RemoteAccess.fromJson(reader); + } else if ("scalingConfig".equals(fieldName)) { + deserializedAwsEksNodegroupProperties.scalingConfig = ScalingConfig.fromJson(reader); + } else if ("subnets".equals(fieldName)) { + List subnets = reader.readArray(reader1 -> reader1.getString()); + deserializedAwsEksNodegroupProperties.subnets = subnets; + } else if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedAwsEksNodegroupProperties.tags = tags; + } else if ("taints".equals(fieldName)) { + List taints = reader.readArray(reader1 -> Taint.fromJson(reader1)); + deserializedAwsEksNodegroupProperties.taints = taints; + } else if ("updateConfig".equals(fieldName)) { + deserializedAwsEksNodegroupProperties.updateConfig = UpdateConfig.fromJson(reader); + } else if ("version".equals(fieldName)) { + deserializedAwsEksNodegroupProperties.version = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedAwsEksNodegroupProperties; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/AwsElasticBeanstalkApplicationProperties.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/AwsElasticBeanstalkApplicationProperties.java new file mode 100644 index 000000000000..eda65846cef3 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/AwsElasticBeanstalkApplicationProperties.java @@ -0,0 +1,162 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of awsElasticBeanstalkApplication. + */ +@Fluent +public final class AwsElasticBeanstalkApplicationProperties + implements JsonSerializable { + /* + * A name for the Elastic Beanstalk application. If you don't specify a name, AWS CloudFormation generates a unique + * physical ID and uses that ID for the application name. + */ + private String applicationName; + + /* + * Your description of the application. + */ + private String description; + + /* + * Specifies an application resource lifecycle configuration to prevent your application from accumulating too many + * versions. + */ + private ApplicationResourceLifecycleConfig resourceLifecycleConfig; + + /** + * Creates an instance of AwsElasticBeanstalkApplicationProperties class. + */ + public AwsElasticBeanstalkApplicationProperties() { + } + + /** + * Get the applicationName property: A name for the Elastic Beanstalk application. If you don't specify a name, AWS + * CloudFormation generates a unique physical ID and uses that ID for the application name. + * + * @return the applicationName value. + */ + public String applicationName() { + return this.applicationName; + } + + /** + * Set the applicationName property: A name for the Elastic Beanstalk application. If you don't specify a name, AWS + * CloudFormation generates a unique physical ID and uses that ID for the application name. + * + * @param applicationName the applicationName value to set. + * @return the AwsElasticBeanstalkApplicationProperties object itself. + */ + public AwsElasticBeanstalkApplicationProperties withApplicationName(String applicationName) { + this.applicationName = applicationName; + return this; + } + + /** + * Get the description property: Your description of the application. + * + * @return the description value. + */ + public String description() { + return this.description; + } + + /** + * Set the description property: Your description of the application. + * + * @param description the description value to set. + * @return the AwsElasticBeanstalkApplicationProperties object itself. + */ + public AwsElasticBeanstalkApplicationProperties withDescription(String description) { + this.description = description; + return this; + } + + /** + * Get the resourceLifecycleConfig property: Specifies an application resource lifecycle configuration to prevent + * your application from accumulating too many versions. + * + * @return the resourceLifecycleConfig value. + */ + public ApplicationResourceLifecycleConfig resourceLifecycleConfig() { + return this.resourceLifecycleConfig; + } + + /** + * Set the resourceLifecycleConfig property: Specifies an application resource lifecycle configuration to prevent + * your application from accumulating too many versions. + * + * @param resourceLifecycleConfig the resourceLifecycleConfig value to set. + * @return the AwsElasticBeanstalkApplicationProperties object itself. + */ + public AwsElasticBeanstalkApplicationProperties + withResourceLifecycleConfig(ApplicationResourceLifecycleConfig resourceLifecycleConfig) { + this.resourceLifecycleConfig = resourceLifecycleConfig; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (resourceLifecycleConfig() != null) { + resourceLifecycleConfig().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("applicationName", this.applicationName); + jsonWriter.writeStringField("description", this.description); + jsonWriter.writeJsonField("resourceLifecycleConfig", this.resourceLifecycleConfig); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AwsElasticBeanstalkApplicationProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AwsElasticBeanstalkApplicationProperties if the JsonReader was pointing to an instance of + * it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the AwsElasticBeanstalkApplicationProperties. + */ + public static AwsElasticBeanstalkApplicationProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AwsElasticBeanstalkApplicationProperties deserializedAwsElasticBeanstalkApplicationProperties + = new AwsElasticBeanstalkApplicationProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("applicationName".equals(fieldName)) { + deserializedAwsElasticBeanstalkApplicationProperties.applicationName = reader.getString(); + } else if ("description".equals(fieldName)) { + deserializedAwsElasticBeanstalkApplicationProperties.description = reader.getString(); + } else if ("resourceLifecycleConfig".equals(fieldName)) { + deserializedAwsElasticBeanstalkApplicationProperties.resourceLifecycleConfig + = ApplicationResourceLifecycleConfig.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedAwsElasticBeanstalkApplicationProperties; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/AwsElasticBeanstalkConfigurationTemplateProperties.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/AwsElasticBeanstalkConfigurationTemplateProperties.java new file mode 100644 index 000000000000..b5b6c9ca2de0 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/AwsElasticBeanstalkConfigurationTemplateProperties.java @@ -0,0 +1,364 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Definition of awsElasticBeanstalkConfigurationTemplate. + */ +@Fluent +public final class AwsElasticBeanstalkConfigurationTemplateProperties + implements JsonSerializable { + /* + * The name of the Elastic Beanstalk application to associate with this configuration template. + */ + private String applicationName; + + /* + * An optional description for this configuration. + */ + private String description; + + /* + * The ID of an environment whose settings you want to use to create the configuration template. You must specify + * EnvironmentId if you don't specify PlatformArn, SolutionStackName, or SourceConfiguration. + */ + private String environmentId; + + /* + * Option values for the Elastic Beanstalk configuration, such as the instance type. If specified, these values + * override the values obtained from the solution stack or the source configuration template. For a complete list of + * Elastic Beanstalk configuration options, see [Option + * Values](https://docs.aws.amazon.com/elasticbeanstalk/latest/dg/command-options.html) in the AWS Elastic Beanstalk + * Developer Guide. + */ + private List optionSettings; + + /* + * The Amazon Resource Name (ARN) of the custom platform. For more information, see [Custom + * Platforms](https://docs.aws.amazon.com/elasticbeanstalk/latest/dg/custom-platforms.html) in the AWS Elastic + * Beanstalk Developer Guide. + */ + private String platformArn; + + /* + * The name of an Elastic Beanstalk solution stack (platform version) that this configuration uses. For example, + * 64bit Amazon Linux 2013.09 running Tomcat 7 Java 7. A solution stack specifies the operating system, runtime, and + * application server for a configuration template. It also determines the set of configuration options as well as + * the possible and default values. For more information, see [Supported + * Platforms](https://docs.aws.amazon.com/elasticbeanstalk/latest/dg/concepts.platforms.html) in the AWS Elastic + * Beanstalk Developer Guide. You must specify SolutionStackName if you don't specify PlatformArn, EnvironmentId, or + * SourceConfiguration. Use the ListAvailableSolutionStacks API to obtain a list of available solution stacks. + */ + private String solutionStackName; + + /* + * An Elastic Beanstalk configuration template to base this one on. If specified, Elastic Beanstalk uses the + * configuration values from the specified configuration template to create a new configuration.Values specified in + * OptionSettings override any values obtained from the SourceConfiguration.You must specify SourceConfiguration if + * you don't specify PlatformArn, EnvironmentId, or SolutionStackName.Constraint: If both solution stack name and + * source configuration are specified, the solution stack of the source configuration template must match the + * specified solution stack name. + */ + private SourceConfiguration sourceConfiguration; + + /* + * The name of the configuration template + */ + private String templateName; + + /** + * Creates an instance of AwsElasticBeanstalkConfigurationTemplateProperties class. + */ + public AwsElasticBeanstalkConfigurationTemplateProperties() { + } + + /** + * Get the applicationName property: The name of the Elastic Beanstalk application to associate with this + * configuration template. + * + * @return the applicationName value. + */ + public String applicationName() { + return this.applicationName; + } + + /** + * Set the applicationName property: The name of the Elastic Beanstalk application to associate with this + * configuration template. + * + * @param applicationName the applicationName value to set. + * @return the AwsElasticBeanstalkConfigurationTemplateProperties object itself. + */ + public AwsElasticBeanstalkConfigurationTemplateProperties withApplicationName(String applicationName) { + this.applicationName = applicationName; + return this; + } + + /** + * Get the description property: An optional description for this configuration. + * + * @return the description value. + */ + public String description() { + return this.description; + } + + /** + * Set the description property: An optional description for this configuration. + * + * @param description the description value to set. + * @return the AwsElasticBeanstalkConfigurationTemplateProperties object itself. + */ + public AwsElasticBeanstalkConfigurationTemplateProperties withDescription(String description) { + this.description = description; + return this; + } + + /** + * Get the environmentId property: The ID of an environment whose settings you want to use to create the + * configuration template. You must specify EnvironmentId if you don't specify PlatformArn, SolutionStackName, or + * SourceConfiguration. + * + * @return the environmentId value. + */ + public String environmentId() { + return this.environmentId; + } + + /** + * Set the environmentId property: The ID of an environment whose settings you want to use to create the + * configuration template. You must specify EnvironmentId if you don't specify PlatformArn, SolutionStackName, or + * SourceConfiguration. + * + * @param environmentId the environmentId value to set. + * @return the AwsElasticBeanstalkConfigurationTemplateProperties object itself. + */ + public AwsElasticBeanstalkConfigurationTemplateProperties withEnvironmentId(String environmentId) { + this.environmentId = environmentId; + return this; + } + + /** + * Get the optionSettings property: Option values for the Elastic Beanstalk configuration, such as the instance + * type. If specified, these values override the values obtained from the solution stack or the source configuration + * template. For a complete list of Elastic Beanstalk configuration options, see [Option + * Values](https://docs.aws.amazon.com/elasticbeanstalk/latest/dg/command-options.html) in the AWS Elastic Beanstalk + * Developer Guide. + * + * @return the optionSettings value. + */ + public List optionSettings() { + return this.optionSettings; + } + + /** + * Set the optionSettings property: Option values for the Elastic Beanstalk configuration, such as the instance + * type. If specified, these values override the values obtained from the solution stack or the source configuration + * template. For a complete list of Elastic Beanstalk configuration options, see [Option + * Values](https://docs.aws.amazon.com/elasticbeanstalk/latest/dg/command-options.html) in the AWS Elastic Beanstalk + * Developer Guide. + * + * @param optionSettings the optionSettings value to set. + * @return the AwsElasticBeanstalkConfigurationTemplateProperties object itself. + */ + public AwsElasticBeanstalkConfigurationTemplateProperties + withOptionSettings(List optionSettings) { + this.optionSettings = optionSettings; + return this; + } + + /** + * Get the platformArn property: The Amazon Resource Name (ARN) of the custom platform. For more information, see + * [Custom Platforms](https://docs.aws.amazon.com/elasticbeanstalk/latest/dg/custom-platforms.html) in the AWS + * Elastic Beanstalk Developer Guide. + * + * @return the platformArn value. + */ + public String platformArn() { + return this.platformArn; + } + + /** + * Set the platformArn property: The Amazon Resource Name (ARN) of the custom platform. For more information, see + * [Custom Platforms](https://docs.aws.amazon.com/elasticbeanstalk/latest/dg/custom-platforms.html) in the AWS + * Elastic Beanstalk Developer Guide. + * + * @param platformArn the platformArn value to set. + * @return the AwsElasticBeanstalkConfigurationTemplateProperties object itself. + */ + public AwsElasticBeanstalkConfigurationTemplateProperties withPlatformArn(String platformArn) { + this.platformArn = platformArn; + return this; + } + + /** + * Get the solutionStackName property: The name of an Elastic Beanstalk solution stack (platform version) that this + * configuration uses. For example, 64bit Amazon Linux 2013.09 running Tomcat 7 Java 7. A solution stack specifies + * the operating system, runtime, and application server for a configuration template. It also determines the set of + * configuration options as well as the possible and default values. For more information, see [Supported + * Platforms](https://docs.aws.amazon.com/elasticbeanstalk/latest/dg/concepts.platforms.html) in the AWS Elastic + * Beanstalk Developer Guide. You must specify SolutionStackName if you don't specify PlatformArn, EnvironmentId, or + * SourceConfiguration. Use the ListAvailableSolutionStacks API to obtain a list of available solution stacks. + * + * @return the solutionStackName value. + */ + public String solutionStackName() { + return this.solutionStackName; + } + + /** + * Set the solutionStackName property: The name of an Elastic Beanstalk solution stack (platform version) that this + * configuration uses. For example, 64bit Amazon Linux 2013.09 running Tomcat 7 Java 7. A solution stack specifies + * the operating system, runtime, and application server for a configuration template. It also determines the set of + * configuration options as well as the possible and default values. For more information, see [Supported + * Platforms](https://docs.aws.amazon.com/elasticbeanstalk/latest/dg/concepts.platforms.html) in the AWS Elastic + * Beanstalk Developer Guide. You must specify SolutionStackName if you don't specify PlatformArn, EnvironmentId, or + * SourceConfiguration. Use the ListAvailableSolutionStacks API to obtain a list of available solution stacks. + * + * @param solutionStackName the solutionStackName value to set. + * @return the AwsElasticBeanstalkConfigurationTemplateProperties object itself. + */ + public AwsElasticBeanstalkConfigurationTemplateProperties withSolutionStackName(String solutionStackName) { + this.solutionStackName = solutionStackName; + return this; + } + + /** + * Get the sourceConfiguration property: An Elastic Beanstalk configuration template to base this one on. If + * specified, Elastic Beanstalk uses the configuration values from the specified configuration template to create a + * new configuration.Values specified in OptionSettings override any values obtained from the + * SourceConfiguration.You must specify SourceConfiguration if you don't specify PlatformArn, EnvironmentId, or + * SolutionStackName.Constraint: If both solution stack name and source configuration are specified, the solution + * stack of the source configuration template must match the specified solution stack name. + * + * @return the sourceConfiguration value. + */ + public SourceConfiguration sourceConfiguration() { + return this.sourceConfiguration; + } + + /** + * Set the sourceConfiguration property: An Elastic Beanstalk configuration template to base this one on. If + * specified, Elastic Beanstalk uses the configuration values from the specified configuration template to create a + * new configuration.Values specified in OptionSettings override any values obtained from the + * SourceConfiguration.You must specify SourceConfiguration if you don't specify PlatformArn, EnvironmentId, or + * SolutionStackName.Constraint: If both solution stack name and source configuration are specified, the solution + * stack of the source configuration template must match the specified solution stack name. + * + * @param sourceConfiguration the sourceConfiguration value to set. + * @return the AwsElasticBeanstalkConfigurationTemplateProperties object itself. + */ + public AwsElasticBeanstalkConfigurationTemplateProperties + withSourceConfiguration(SourceConfiguration sourceConfiguration) { + this.sourceConfiguration = sourceConfiguration; + return this; + } + + /** + * Get the templateName property: The name of the configuration template. + * + * @return the templateName value. + */ + public String templateName() { + return this.templateName; + } + + /** + * Set the templateName property: The name of the configuration template. + * + * @param templateName the templateName value to set. + * @return the AwsElasticBeanstalkConfigurationTemplateProperties object itself. + */ + public AwsElasticBeanstalkConfigurationTemplateProperties withTemplateName(String templateName) { + this.templateName = templateName; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (optionSettings() != null) { + optionSettings().forEach(e -> e.validate()); + } + if (sourceConfiguration() != null) { + sourceConfiguration().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("applicationName", this.applicationName); + jsonWriter.writeStringField("description", this.description); + jsonWriter.writeStringField("environmentId", this.environmentId); + jsonWriter.writeArrayField("optionSettings", this.optionSettings, + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("platformArn", this.platformArn); + jsonWriter.writeStringField("solutionStackName", this.solutionStackName); + jsonWriter.writeJsonField("sourceConfiguration", this.sourceConfiguration); + jsonWriter.writeStringField("templateName", this.templateName); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AwsElasticBeanstalkConfigurationTemplateProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AwsElasticBeanstalkConfigurationTemplateProperties if the JsonReader was pointing to an + * instance of it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the AwsElasticBeanstalkConfigurationTemplateProperties. + */ + public static AwsElasticBeanstalkConfigurationTemplateProperties fromJson(JsonReader jsonReader) + throws IOException { + return jsonReader.readObject(reader -> { + AwsElasticBeanstalkConfigurationTemplateProperties deserializedAwsElasticBeanstalkConfigurationTemplateProperties + = new AwsElasticBeanstalkConfigurationTemplateProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("applicationName".equals(fieldName)) { + deserializedAwsElasticBeanstalkConfigurationTemplateProperties.applicationName = reader.getString(); + } else if ("description".equals(fieldName)) { + deserializedAwsElasticBeanstalkConfigurationTemplateProperties.description = reader.getString(); + } else if ("environmentId".equals(fieldName)) { + deserializedAwsElasticBeanstalkConfigurationTemplateProperties.environmentId = reader.getString(); + } else if ("optionSettings".equals(fieldName)) { + List optionSettings + = reader.readArray(reader1 -> ConfigurationOptionSetting.fromJson(reader1)); + deserializedAwsElasticBeanstalkConfigurationTemplateProperties.optionSettings = optionSettings; + } else if ("platformArn".equals(fieldName)) { + deserializedAwsElasticBeanstalkConfigurationTemplateProperties.platformArn = reader.getString(); + } else if ("solutionStackName".equals(fieldName)) { + deserializedAwsElasticBeanstalkConfigurationTemplateProperties.solutionStackName + = reader.getString(); + } else if ("sourceConfiguration".equals(fieldName)) { + deserializedAwsElasticBeanstalkConfigurationTemplateProperties.sourceConfiguration + = SourceConfiguration.fromJson(reader); + } else if ("templateName".equals(fieldName)) { + deserializedAwsElasticBeanstalkConfigurationTemplateProperties.templateName = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedAwsElasticBeanstalkConfigurationTemplateProperties; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/AwsElasticBeanstalkEnvironmentProperties.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/AwsElasticBeanstalkEnvironmentProperties.java new file mode 100644 index 000000000000..6ff45a8082bc --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/AwsElasticBeanstalkEnvironmentProperties.java @@ -0,0 +1,464 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Definition of awsElasticBeanstalkEnvironment. + */ +@Fluent +public final class AwsElasticBeanstalkEnvironmentProperties + implements JsonSerializable { + /* + * The name of the application that is associated with this environment. + */ + private String applicationName; + + /* + * If specified, the environment attempts to use this value as the prefix for the CNAME in your Elastic Beanstalk + * environment URL. If not specified, the CNAME is generated automatically by appending a random alphanumeric string + * to the environment name. + */ + private String cnamePrefix; + + /* + * Your description for this environment. + */ + private String description; + + /* + * Property endpointURL + */ + private String endpointUrl; + + /* + * A unique name for the environment. + */ + private String environmentName; + + /* + * The Amazon Resource Name (ARN) of an existing IAM role to be used as the environment's operations role. + */ + private String operationsRole; + + /* + * Key-value pairs defining configuration options for this environment, such as the instance type. + */ + private List optionSettings; + + /* + * The Amazon Resource Name (ARN) of the custom platform to use with the environment. + */ + private String platformArn; + + /* + * The name of an Elastic Beanstalk solution stack (platform version) to use with the environment. + */ + private String solutionStackName; + + /* + * Specifies the tags applied to resources in the environment. + */ + private List tags; + + /* + * The name of the Elastic Beanstalk configuration template to use with the environment. + */ + private String templateName; + + /* + * Specifies the tier to use in creating this environment. The environment tier that you choose determines whether + * Elastic Beanstalk provisions resources to support a web application that handles HTTP(S) requests or a web + * application that handles background-processing tasks. + */ + private TierAutoGenerated tier; + + /* + * The name of the application version to deploy. + */ + private String versionLabel; + + /** + * Creates an instance of AwsElasticBeanstalkEnvironmentProperties class. + */ + public AwsElasticBeanstalkEnvironmentProperties() { + } + + /** + * Get the applicationName property: The name of the application that is associated with this environment. + * + * @return the applicationName value. + */ + public String applicationName() { + return this.applicationName; + } + + /** + * Set the applicationName property: The name of the application that is associated with this environment. + * + * @param applicationName the applicationName value to set. + * @return the AwsElasticBeanstalkEnvironmentProperties object itself. + */ + public AwsElasticBeanstalkEnvironmentProperties withApplicationName(String applicationName) { + this.applicationName = applicationName; + return this; + } + + /** + * Get the cnamePrefix property: If specified, the environment attempts to use this value as the prefix for the + * CNAME in your Elastic Beanstalk environment URL. If not specified, the CNAME is generated automatically by + * appending a random alphanumeric string to the environment name. + * + * @return the cnamePrefix value. + */ + public String cnamePrefix() { + return this.cnamePrefix; + } + + /** + * Set the cnamePrefix property: If specified, the environment attempts to use this value as the prefix for the + * CNAME in your Elastic Beanstalk environment URL. If not specified, the CNAME is generated automatically by + * appending a random alphanumeric string to the environment name. + * + * @param cnamePrefix the cnamePrefix value to set. + * @return the AwsElasticBeanstalkEnvironmentProperties object itself. + */ + public AwsElasticBeanstalkEnvironmentProperties withCnamePrefix(String cnamePrefix) { + this.cnamePrefix = cnamePrefix; + return this; + } + + /** + * Get the description property: Your description for this environment. + * + * @return the description value. + */ + public String description() { + return this.description; + } + + /** + * Set the description property: Your description for this environment. + * + * @param description the description value to set. + * @return the AwsElasticBeanstalkEnvironmentProperties object itself. + */ + public AwsElasticBeanstalkEnvironmentProperties withDescription(String description) { + this.description = description; + return this; + } + + /** + * Get the endpointUrl property: Property endpointURL. + * + * @return the endpointUrl value. + */ + public String endpointUrl() { + return this.endpointUrl; + } + + /** + * Set the endpointUrl property: Property endpointURL. + * + * @param endpointUrl the endpointUrl value to set. + * @return the AwsElasticBeanstalkEnvironmentProperties object itself. + */ + public AwsElasticBeanstalkEnvironmentProperties withEndpointUrl(String endpointUrl) { + this.endpointUrl = endpointUrl; + return this; + } + + /** + * Get the environmentName property: A unique name for the environment. + * + * @return the environmentName value. + */ + public String environmentName() { + return this.environmentName; + } + + /** + * Set the environmentName property: A unique name for the environment. + * + * @param environmentName the environmentName value to set. + * @return the AwsElasticBeanstalkEnvironmentProperties object itself. + */ + public AwsElasticBeanstalkEnvironmentProperties withEnvironmentName(String environmentName) { + this.environmentName = environmentName; + return this; + } + + /** + * Get the operationsRole property: The Amazon Resource Name (ARN) of an existing IAM role to be used as the + * environment's operations role. + * + * @return the operationsRole value. + */ + public String operationsRole() { + return this.operationsRole; + } + + /** + * Set the operationsRole property: The Amazon Resource Name (ARN) of an existing IAM role to be used as the + * environment's operations role. + * + * @param operationsRole the operationsRole value to set. + * @return the AwsElasticBeanstalkEnvironmentProperties object itself. + */ + public AwsElasticBeanstalkEnvironmentProperties withOperationsRole(String operationsRole) { + this.operationsRole = operationsRole; + return this; + } + + /** + * Get the optionSettings property: Key-value pairs defining configuration options for this environment, such as the + * instance type. + * + * @return the optionSettings value. + */ + public List optionSettings() { + return this.optionSettings; + } + + /** + * Set the optionSettings property: Key-value pairs defining configuration options for this environment, such as the + * instance type. + * + * @param optionSettings the optionSettings value to set. + * @return the AwsElasticBeanstalkEnvironmentProperties object itself. + */ + public AwsElasticBeanstalkEnvironmentProperties withOptionSettings(List optionSettings) { + this.optionSettings = optionSettings; + return this; + } + + /** + * Get the platformArn property: The Amazon Resource Name (ARN) of the custom platform to use with the environment. + * + * @return the platformArn value. + */ + public String platformArn() { + return this.platformArn; + } + + /** + * Set the platformArn property: The Amazon Resource Name (ARN) of the custom platform to use with the environment. + * + * @param platformArn the platformArn value to set. + * @return the AwsElasticBeanstalkEnvironmentProperties object itself. + */ + public AwsElasticBeanstalkEnvironmentProperties withPlatformArn(String platformArn) { + this.platformArn = platformArn; + return this; + } + + /** + * Get the solutionStackName property: The name of an Elastic Beanstalk solution stack (platform version) to use + * with the environment. + * + * @return the solutionStackName value. + */ + public String solutionStackName() { + return this.solutionStackName; + } + + /** + * Set the solutionStackName property: The name of an Elastic Beanstalk solution stack (platform version) to use + * with the environment. + * + * @param solutionStackName the solutionStackName value to set. + * @return the AwsElasticBeanstalkEnvironmentProperties object itself. + */ + public AwsElasticBeanstalkEnvironmentProperties withSolutionStackName(String solutionStackName) { + this.solutionStackName = solutionStackName; + return this; + } + + /** + * Get the tags property: Specifies the tags applied to resources in the environment. + * + * @return the tags value. + */ + public List tags() { + return this.tags; + } + + /** + * Set the tags property: Specifies the tags applied to resources in the environment. + * + * @param tags the tags value to set. + * @return the AwsElasticBeanstalkEnvironmentProperties object itself. + */ + public AwsElasticBeanstalkEnvironmentProperties withTags(List tags) { + this.tags = tags; + return this; + } + + /** + * Get the templateName property: The name of the Elastic Beanstalk configuration template to use with the + * environment. + * + * @return the templateName value. + */ + public String templateName() { + return this.templateName; + } + + /** + * Set the templateName property: The name of the Elastic Beanstalk configuration template to use with the + * environment. + * + * @param templateName the templateName value to set. + * @return the AwsElasticBeanstalkEnvironmentProperties object itself. + */ + public AwsElasticBeanstalkEnvironmentProperties withTemplateName(String templateName) { + this.templateName = templateName; + return this; + } + + /** + * Get the tier property: Specifies the tier to use in creating this environment. The environment tier that you + * choose determines whether Elastic Beanstalk provisions resources to support a web application that handles + * HTTP(S) requests or a web application that handles background-processing tasks. + * + * @return the tier value. + */ + public TierAutoGenerated tier() { + return this.tier; + } + + /** + * Set the tier property: Specifies the tier to use in creating this environment. The environment tier that you + * choose determines whether Elastic Beanstalk provisions resources to support a web application that handles + * HTTP(S) requests or a web application that handles background-processing tasks. + * + * @param tier the tier value to set. + * @return the AwsElasticBeanstalkEnvironmentProperties object itself. + */ + public AwsElasticBeanstalkEnvironmentProperties withTier(TierAutoGenerated tier) { + this.tier = tier; + return this; + } + + /** + * Get the versionLabel property: The name of the application version to deploy. + * + * @return the versionLabel value. + */ + public String versionLabel() { + return this.versionLabel; + } + + /** + * Set the versionLabel property: The name of the application version to deploy. + * + * @param versionLabel the versionLabel value to set. + * @return the AwsElasticBeanstalkEnvironmentProperties object itself. + */ + public AwsElasticBeanstalkEnvironmentProperties withVersionLabel(String versionLabel) { + this.versionLabel = versionLabel; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (optionSettings() != null) { + optionSettings().forEach(e -> e.validate()); + } + if (tags() != null) { + tags().forEach(e -> e.validate()); + } + if (tier() != null) { + tier().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("applicationName", this.applicationName); + jsonWriter.writeStringField("cnamePrefix", this.cnamePrefix); + jsonWriter.writeStringField("description", this.description); + jsonWriter.writeStringField("endpointURL", this.endpointUrl); + jsonWriter.writeStringField("environmentName", this.environmentName); + jsonWriter.writeStringField("operationsRole", this.operationsRole); + jsonWriter.writeArrayField("optionSettings", this.optionSettings, + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("platformArn", this.platformArn); + jsonWriter.writeStringField("solutionStackName", this.solutionStackName); + jsonWriter.writeArrayField("tags", this.tags, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("templateName", this.templateName); + jsonWriter.writeJsonField("tier", this.tier); + jsonWriter.writeStringField("versionLabel", this.versionLabel); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AwsElasticBeanstalkEnvironmentProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AwsElasticBeanstalkEnvironmentProperties if the JsonReader was pointing to an instance of + * it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the AwsElasticBeanstalkEnvironmentProperties. + */ + public static AwsElasticBeanstalkEnvironmentProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AwsElasticBeanstalkEnvironmentProperties deserializedAwsElasticBeanstalkEnvironmentProperties + = new AwsElasticBeanstalkEnvironmentProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("applicationName".equals(fieldName)) { + deserializedAwsElasticBeanstalkEnvironmentProperties.applicationName = reader.getString(); + } else if ("cnamePrefix".equals(fieldName)) { + deserializedAwsElasticBeanstalkEnvironmentProperties.cnamePrefix = reader.getString(); + } else if ("description".equals(fieldName)) { + deserializedAwsElasticBeanstalkEnvironmentProperties.description = reader.getString(); + } else if ("endpointURL".equals(fieldName)) { + deserializedAwsElasticBeanstalkEnvironmentProperties.endpointUrl = reader.getString(); + } else if ("environmentName".equals(fieldName)) { + deserializedAwsElasticBeanstalkEnvironmentProperties.environmentName = reader.getString(); + } else if ("operationsRole".equals(fieldName)) { + deserializedAwsElasticBeanstalkEnvironmentProperties.operationsRole = reader.getString(); + } else if ("optionSettings".equals(fieldName)) { + List optionSettings = reader.readArray(reader1 -> OptionSetting.fromJson(reader1)); + deserializedAwsElasticBeanstalkEnvironmentProperties.optionSettings = optionSettings; + } else if ("platformArn".equals(fieldName)) { + deserializedAwsElasticBeanstalkEnvironmentProperties.platformArn = reader.getString(); + } else if ("solutionStackName".equals(fieldName)) { + deserializedAwsElasticBeanstalkEnvironmentProperties.solutionStackName = reader.getString(); + } else if ("tags".equals(fieldName)) { + List tags = reader.readArray(reader1 -> TagAutoGenerated28.fromJson(reader1)); + deserializedAwsElasticBeanstalkEnvironmentProperties.tags = tags; + } else if ("templateName".equals(fieldName)) { + deserializedAwsElasticBeanstalkEnvironmentProperties.templateName = reader.getString(); + } else if ("tier".equals(fieldName)) { + deserializedAwsElasticBeanstalkEnvironmentProperties.tier = TierAutoGenerated.fromJson(reader); + } else if ("versionLabel".equals(fieldName)) { + deserializedAwsElasticBeanstalkEnvironmentProperties.versionLabel = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedAwsElasticBeanstalkEnvironmentProperties; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/AwsElasticLoadBalancingV2ListenerProperties.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/AwsElasticLoadBalancingV2ListenerProperties.java new file mode 100644 index 000000000000..9ecbf63b6dbb --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/AwsElasticLoadBalancingV2ListenerProperties.java @@ -0,0 +1,384 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Definition of awsElasticLoadBalancingV2Listener. + */ +@Fluent +public final class AwsElasticLoadBalancingV2ListenerProperties + implements JsonSerializable { + /* + * [TLS listener] The name of the Application-Layer Protocol Negotiation (ALPN) policy. + */ + private List alpnPolicy; + + /* + * The default SSL server certificate for a secure listener. You must provide exactly one certificate if the + * listener protocol is HTTPS or TLS. To create a certificate list for a secure listener, use + * [AWS::ElasticLoadBalancingV2::ListenerCertificate](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide + * /aws-resource-elasticloadbalancingv2-listenercertificate.html). + */ + private List certificates; + + /* + * The actions for the default rule. You cannot define a condition for a default rule. To create additional rules + * for an Application Load Balancer, use + * [AWS::ElasticLoadBalancingV2::ListenerRule](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws- + * resource-elasticloadbalancingv2-listenerrule.html). + */ + private List defaultActions; + + /* + * Property listenerArn + */ + private String listenerArn; + + /* + * The Amazon Resource Name (ARN) of the load balancer. + */ + private String loadBalancerArn; + + /* + * The mutual authentication configuration information. Specifies the configuration information for mutual + * authentication. + */ + private MutualAuthentication mutualAuthentication; + + /* + * The port on which the load balancer is listening. You cannot specify a port for a Gateway Load Balancer. + */ + private Integer port; + + /* + * The protocol for connections from clients to the load balancer. For Application Load Balancers, the supported + * protocols are HTTP and HTTPS. For Network Load Balancers, the supported protocols are TCP, TLS, UDP, and TCP_UDP. + * You can’t specify the UDP or TCP_UDP protocol if dual-stack mode is enabled. You cannot specify a protocol for a + * Gateway Load Balancer. + */ + private String protocol; + + /* + * [HTTPS and TLS listeners] The security policy that defines which protocols and ciphers are supported. Updating + * the security policy can result in interruptions if the load balancer is handling a high volume of traffic. For + * more information, see [Security + * policies](https://docs.aws.amazon.com/elasticloadbalancing/latest/application/create-https-listener.html#describe + * -ssl-policies) in the *Application Load Balancers Guide* and [Security + * policies](https://docs.aws.amazon.com/elasticloadbalancing/latest/network/create-tls-listener.html#describe-ssl- + * policies) in the *Network Load Balancers Guide*. + */ + private String sslPolicy; + + /** + * Creates an instance of AwsElasticLoadBalancingV2ListenerProperties class. + */ + public AwsElasticLoadBalancingV2ListenerProperties() { + } + + /** + * Get the alpnPolicy property: [TLS listener] The name of the Application-Layer Protocol Negotiation (ALPN) policy. + * + * @return the alpnPolicy value. + */ + public List alpnPolicy() { + return this.alpnPolicy; + } + + /** + * Set the alpnPolicy property: [TLS listener] The name of the Application-Layer Protocol Negotiation (ALPN) policy. + * + * @param alpnPolicy the alpnPolicy value to set. + * @return the AwsElasticLoadBalancingV2ListenerProperties object itself. + */ + public AwsElasticLoadBalancingV2ListenerProperties withAlpnPolicy(List alpnPolicy) { + this.alpnPolicy = alpnPolicy; + return this; + } + + /** + * Get the certificates property: The default SSL server certificate for a secure listener. You must provide exactly + * one certificate if the listener protocol is HTTPS or TLS. To create a certificate list for a secure listener, use + * [AWS::ElasticLoadBalancingV2::ListenerCertificate](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-elasticloadbalancingv2-listenercertificate.html). + * + * @return the certificates value. + */ + public List certificates() { + return this.certificates; + } + + /** + * Set the certificates property: The default SSL server certificate for a secure listener. You must provide exactly + * one certificate if the listener protocol is HTTPS or TLS. To create a certificate list for a secure listener, use + * [AWS::ElasticLoadBalancingV2::ListenerCertificate](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-elasticloadbalancingv2-listenercertificate.html). + * + * @param certificates the certificates value to set. + * @return the AwsElasticLoadBalancingV2ListenerProperties object itself. + */ + public AwsElasticLoadBalancingV2ListenerProperties withCertificates(List certificates) { + this.certificates = certificates; + return this; + } + + /** + * Get the defaultActions property: The actions for the default rule. You cannot define a condition for a default + * rule. To create additional rules for an Application Load Balancer, use + * [AWS::ElasticLoadBalancingV2::ListenerRule](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-elasticloadbalancingv2-listenerrule.html). + * + * @return the defaultActions value. + */ + public List defaultActions() { + return this.defaultActions; + } + + /** + * Set the defaultActions property: The actions for the default rule. You cannot define a condition for a default + * rule. To create additional rules for an Application Load Balancer, use + * [AWS::ElasticLoadBalancingV2::ListenerRule](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-elasticloadbalancingv2-listenerrule.html). + * + * @param defaultActions the defaultActions value to set. + * @return the AwsElasticLoadBalancingV2ListenerProperties object itself. + */ + public AwsElasticLoadBalancingV2ListenerProperties withDefaultActions(List defaultActions) { + this.defaultActions = defaultActions; + return this; + } + + /** + * Get the listenerArn property: Property listenerArn. + * + * @return the listenerArn value. + */ + public String listenerArn() { + return this.listenerArn; + } + + /** + * Set the listenerArn property: Property listenerArn. + * + * @param listenerArn the listenerArn value to set. + * @return the AwsElasticLoadBalancingV2ListenerProperties object itself. + */ + public AwsElasticLoadBalancingV2ListenerProperties withListenerArn(String listenerArn) { + this.listenerArn = listenerArn; + return this; + } + + /** + * Get the loadBalancerArn property: The Amazon Resource Name (ARN) of the load balancer. + * + * @return the loadBalancerArn value. + */ + public String loadBalancerArn() { + return this.loadBalancerArn; + } + + /** + * Set the loadBalancerArn property: The Amazon Resource Name (ARN) of the load balancer. + * + * @param loadBalancerArn the loadBalancerArn value to set. + * @return the AwsElasticLoadBalancingV2ListenerProperties object itself. + */ + public AwsElasticLoadBalancingV2ListenerProperties withLoadBalancerArn(String loadBalancerArn) { + this.loadBalancerArn = loadBalancerArn; + return this; + } + + /** + * Get the mutualAuthentication property: The mutual authentication configuration information. Specifies the + * configuration information for mutual authentication. + * + * @return the mutualAuthentication value. + */ + public MutualAuthentication mutualAuthentication() { + return this.mutualAuthentication; + } + + /** + * Set the mutualAuthentication property: The mutual authentication configuration information. Specifies the + * configuration information for mutual authentication. + * + * @param mutualAuthentication the mutualAuthentication value to set. + * @return the AwsElasticLoadBalancingV2ListenerProperties object itself. + */ + public AwsElasticLoadBalancingV2ListenerProperties + withMutualAuthentication(MutualAuthentication mutualAuthentication) { + this.mutualAuthentication = mutualAuthentication; + return this; + } + + /** + * Get the port property: The port on which the load balancer is listening. You cannot specify a port for a Gateway + * Load Balancer. + * + * @return the port value. + */ + public Integer port() { + return this.port; + } + + /** + * Set the port property: The port on which the load balancer is listening. You cannot specify a port for a Gateway + * Load Balancer. + * + * @param port the port value to set. + * @return the AwsElasticLoadBalancingV2ListenerProperties object itself. + */ + public AwsElasticLoadBalancingV2ListenerProperties withPort(Integer port) { + this.port = port; + return this; + } + + /** + * Get the protocol property: The protocol for connections from clients to the load balancer. For Application Load + * Balancers, the supported protocols are HTTP and HTTPS. For Network Load Balancers, the supported protocols are + * TCP, TLS, UDP, and TCP_UDP. You can’t specify the UDP or TCP_UDP protocol if dual-stack mode is enabled. You + * cannot specify a protocol for a Gateway Load Balancer. + * + * @return the protocol value. + */ + public String protocol() { + return this.protocol; + } + + /** + * Set the protocol property: The protocol for connections from clients to the load balancer. For Application Load + * Balancers, the supported protocols are HTTP and HTTPS. For Network Load Balancers, the supported protocols are + * TCP, TLS, UDP, and TCP_UDP. You can’t specify the UDP or TCP_UDP protocol if dual-stack mode is enabled. You + * cannot specify a protocol for a Gateway Load Balancer. + * + * @param protocol the protocol value to set. + * @return the AwsElasticLoadBalancingV2ListenerProperties object itself. + */ + public AwsElasticLoadBalancingV2ListenerProperties withProtocol(String protocol) { + this.protocol = protocol; + return this; + } + + /** + * Get the sslPolicy property: [HTTPS and TLS listeners] The security policy that defines which protocols and + * ciphers are supported. Updating the security policy can result in interruptions if the load balancer is handling + * a high volume of traffic. For more information, see [Security + * policies](https://docs.aws.amazon.com/elasticloadbalancing/latest/application/create-https-listener.html#describe-ssl-policies) + * in the *Application Load Balancers Guide* and [Security + * policies](https://docs.aws.amazon.com/elasticloadbalancing/latest/network/create-tls-listener.html#describe-ssl-policies) + * in the *Network Load Balancers Guide*. + * + * @return the sslPolicy value. + */ + public String sslPolicy() { + return this.sslPolicy; + } + + /** + * Set the sslPolicy property: [HTTPS and TLS listeners] The security policy that defines which protocols and + * ciphers are supported. Updating the security policy can result in interruptions if the load balancer is handling + * a high volume of traffic. For more information, see [Security + * policies](https://docs.aws.amazon.com/elasticloadbalancing/latest/application/create-https-listener.html#describe-ssl-policies) + * in the *Application Load Balancers Guide* and [Security + * policies](https://docs.aws.amazon.com/elasticloadbalancing/latest/network/create-tls-listener.html#describe-ssl-policies) + * in the *Network Load Balancers Guide*. + * + * @param sslPolicy the sslPolicy value to set. + * @return the AwsElasticLoadBalancingV2ListenerProperties object itself. + */ + public AwsElasticLoadBalancingV2ListenerProperties withSslPolicy(String sslPolicy) { + this.sslPolicy = sslPolicy; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (certificates() != null) { + certificates().forEach(e -> e.validate()); + } + if (defaultActions() != null) { + defaultActions().forEach(e -> e.validate()); + } + if (mutualAuthentication() != null) { + mutualAuthentication().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("alpnPolicy", this.alpnPolicy, (writer, element) -> writer.writeString(element)); + jsonWriter.writeArrayField("certificates", this.certificates, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("defaultActions", this.defaultActions, + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("listenerArn", this.listenerArn); + jsonWriter.writeStringField("loadBalancerArn", this.loadBalancerArn); + jsonWriter.writeJsonField("mutualAuthentication", this.mutualAuthentication); + jsonWriter.writeNumberField("port", this.port); + jsonWriter.writeStringField("protocol", this.protocol); + jsonWriter.writeStringField("sslPolicy", this.sslPolicy); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AwsElasticLoadBalancingV2ListenerProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AwsElasticLoadBalancingV2ListenerProperties if the JsonReader was pointing to an instance + * of it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the AwsElasticLoadBalancingV2ListenerProperties. + */ + public static AwsElasticLoadBalancingV2ListenerProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AwsElasticLoadBalancingV2ListenerProperties deserializedAwsElasticLoadBalancingV2ListenerProperties + = new AwsElasticLoadBalancingV2ListenerProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("alpnPolicy".equals(fieldName)) { + List alpnPolicy = reader.readArray(reader1 -> reader1.getString()); + deserializedAwsElasticLoadBalancingV2ListenerProperties.alpnPolicy = alpnPolicy; + } else if ("certificates".equals(fieldName)) { + List certificates + = reader.readArray(reader1 -> CertificateAutoGenerated.fromJson(reader1)); + deserializedAwsElasticLoadBalancingV2ListenerProperties.certificates = certificates; + } else if ("defaultActions".equals(fieldName)) { + List defaultActions + = reader.readArray(reader1 -> ActionAutoGenerated.fromJson(reader1)); + deserializedAwsElasticLoadBalancingV2ListenerProperties.defaultActions = defaultActions; + } else if ("listenerArn".equals(fieldName)) { + deserializedAwsElasticLoadBalancingV2ListenerProperties.listenerArn = reader.getString(); + } else if ("loadBalancerArn".equals(fieldName)) { + deserializedAwsElasticLoadBalancingV2ListenerProperties.loadBalancerArn = reader.getString(); + } else if ("mutualAuthentication".equals(fieldName)) { + deserializedAwsElasticLoadBalancingV2ListenerProperties.mutualAuthentication + = MutualAuthentication.fromJson(reader); + } else if ("port".equals(fieldName)) { + deserializedAwsElasticLoadBalancingV2ListenerProperties.port + = reader.getNullable(JsonReader::getInt); + } else if ("protocol".equals(fieldName)) { + deserializedAwsElasticLoadBalancingV2ListenerProperties.protocol = reader.getString(); + } else if ("sslPolicy".equals(fieldName)) { + deserializedAwsElasticLoadBalancingV2ListenerProperties.sslPolicy = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedAwsElasticLoadBalancingV2ListenerProperties; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/AwsElasticLoadBalancingV2LoadBalancerProperties.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/AwsElasticLoadBalancingV2LoadBalancerProperties.java new file mode 100644 index 000000000000..17656ddda5f0 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/AwsElasticLoadBalancingV2LoadBalancerProperties.java @@ -0,0 +1,599 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Definition of awsElasticLoadBalancingV2LoadBalancer. + */ +@Fluent +public final class AwsElasticLoadBalancingV2LoadBalancerProperties + implements JsonSerializable { + /* + * Property canonicalHostedZoneID + */ + private String canonicalHostedZoneId; + + /* + * Property dnsName + */ + private String dnsName; + + /* + * Indicates whether to evaluate inbound security group rules for traffic sent to a Network Load Balancer through + * privatelink. + */ + private String enforceSecurityGroupInboundRulesOnPrivateLinkTraffic; + + /* + * The IP address type. The possible values are ``ipv4`` (for IPv4 addresses) and ``dualstack`` (for IPv4 and IPv6 + * addresses). You can’t specify ``dualstack`` for a load balancer with a UDP or TCP_UDP listener. + */ + private String ipAddressType; + + /* + * Property loadBalancerArn + */ + private String loadBalancerArn; + + /* + * The load balancer attributes. + */ + private List loadBalancerAttributes; + + /* + * Property loadBalancerFullName + */ + private String loadBalancerFullName; + + /* + * Property loadBalancerName + */ + private String loadBalancerName; + + /* + * The name of the load balancer. This name must be unique per region per account, can have a maximum of 32 + * characters, must contain only alphanumeric characters or hyphens, must not begin or end with a hyphen, and must + * not begin with 'internal-'. If you don't specify a name, AWS CloudFormation generates a unique physical ID for + * the load balancer. If you specify a name, you cannot perform updates that require replacement of this resource, + * but you can perform other updates. To replace the resource, specify a new name. + */ + private String name; + + /* + * The nodes of an Internet-facing load balancer have public IP addresses. The DNS name of an Internet-facing load + * balancer is publicly resolvable to the public IP addresses of the nodes. Therefore, Internet-facing load + * balancers can route requests from clients over the internet. The nodes of an internal load balancer have only + * private IP addresses. The DNS name of an internal load balancer is publicly resolvable to the private IP + * addresses of the nodes. Therefore, internal load balancers can route requests only from clients with access to + * the VPC for the load balancer. The default is an Internet-facing load balancer. You cannot specify a scheme for a + * Gateway Load Balancer. + */ + private String scheme; + + /* + * [Application Load Balancers and Network Load Balancers] The IDs of the security groups for the load balancer. + */ + private List securityGroups; + + /* + * The IDs of the subnets. You can specify only one subnet per Availability Zone. You must specify either subnets or + * subnet mappings, but not both. [Application Load Balancers] You must specify subnets from at least two + * Availability Zones. You cannot specify Elastic IP addresses for your subnets. [Application Load Balancers on + * Outposts] You must specify one Outpost subnet. [Application Load Balancers on Local Zones] You can specify + * subnets from one or more Local Zones. [Network Load Balancers] You can specify subnets from one or more + * Availability Zones. You can specify one Elastic IP address per subnet if you need static IP addresses for your + * internet-facing load balancer. For internal load balancers, you can specify one private IP address per subnet + * from the IPv4 range of the subnet. For internet-facing load balancer, you can specify one IPv6 address per + * subnet. [Gateway Load Balancers] You can specify subnets from one or more Availability Zones. You cannot specify + * Elastic IP addresses for your subnets. + */ + private List subnetMappings; + + /* + * The IDs of the subnets. You can specify only one subnet per Availability Zone. You must specify either subnets or + * subnet mappings, but not both. To specify an Elastic IP address, specify subnet mappings instead of subnets. + * [Application Load Balancers] You must specify subnets from at least two Availability Zones. [Application Load + * Balancers on Outposts] You must specify one Outpost subnet. [Application Load Balancers on Local Zones] You can + * specify subnets from one or more Local Zones. [Network Load Balancers] You can specify subnets from one or more + * Availability Zones. [Gateway Load Balancers] You can specify subnets from one or more Availability Zones. + */ + private List subnets; + + /* + * The tags to assign to the load balancer. + */ + private List tags; + + /* + * The type of load balancer. The default is ``application``. + */ + private String type; + + /** + * Creates an instance of AwsElasticLoadBalancingV2LoadBalancerProperties class. + */ + public AwsElasticLoadBalancingV2LoadBalancerProperties() { + } + + /** + * Get the canonicalHostedZoneId property: Property canonicalHostedZoneID. + * + * @return the canonicalHostedZoneId value. + */ + public String canonicalHostedZoneId() { + return this.canonicalHostedZoneId; + } + + /** + * Set the canonicalHostedZoneId property: Property canonicalHostedZoneID. + * + * @param canonicalHostedZoneId the canonicalHostedZoneId value to set. + * @return the AwsElasticLoadBalancingV2LoadBalancerProperties object itself. + */ + public AwsElasticLoadBalancingV2LoadBalancerProperties withCanonicalHostedZoneId(String canonicalHostedZoneId) { + this.canonicalHostedZoneId = canonicalHostedZoneId; + return this; + } + + /** + * Get the dnsName property: Property dnsName. + * + * @return the dnsName value. + */ + public String dnsName() { + return this.dnsName; + } + + /** + * Set the dnsName property: Property dnsName. + * + * @param dnsName the dnsName value to set. + * @return the AwsElasticLoadBalancingV2LoadBalancerProperties object itself. + */ + public AwsElasticLoadBalancingV2LoadBalancerProperties withDnsName(String dnsName) { + this.dnsName = dnsName; + return this; + } + + /** + * Get the enforceSecurityGroupInboundRulesOnPrivateLinkTraffic property: Indicates whether to evaluate inbound + * security group rules for traffic sent to a Network Load Balancer through privatelink. + * + * @return the enforceSecurityGroupInboundRulesOnPrivateLinkTraffic value. + */ + public String enforceSecurityGroupInboundRulesOnPrivateLinkTraffic() { + return this.enforceSecurityGroupInboundRulesOnPrivateLinkTraffic; + } + + /** + * Set the enforceSecurityGroupInboundRulesOnPrivateLinkTraffic property: Indicates whether to evaluate inbound + * security group rules for traffic sent to a Network Load Balancer through privatelink. + * + * @param enforceSecurityGroupInboundRulesOnPrivateLinkTraffic the + * enforceSecurityGroupInboundRulesOnPrivateLinkTraffic value to set. + * @return the AwsElasticLoadBalancingV2LoadBalancerProperties object itself. + */ + public AwsElasticLoadBalancingV2LoadBalancerProperties withEnforceSecurityGroupInboundRulesOnPrivateLinkTraffic( + String enforceSecurityGroupInboundRulesOnPrivateLinkTraffic) { + this.enforceSecurityGroupInboundRulesOnPrivateLinkTraffic + = enforceSecurityGroupInboundRulesOnPrivateLinkTraffic; + return this; + } + + /** + * Get the ipAddressType property: The IP address type. The possible values are ``ipv4`` (for IPv4 addresses) and + * ``dualstack`` (for IPv4 and IPv6 addresses). You can’t specify ``dualstack`` for a load balancer with a UDP or + * TCP_UDP listener. + * + * @return the ipAddressType value. + */ + public String ipAddressType() { + return this.ipAddressType; + } + + /** + * Set the ipAddressType property: The IP address type. The possible values are ``ipv4`` (for IPv4 addresses) and + * ``dualstack`` (for IPv4 and IPv6 addresses). You can’t specify ``dualstack`` for a load balancer with a UDP or + * TCP_UDP listener. + * + * @param ipAddressType the ipAddressType value to set. + * @return the AwsElasticLoadBalancingV2LoadBalancerProperties object itself. + */ + public AwsElasticLoadBalancingV2LoadBalancerProperties withIpAddressType(String ipAddressType) { + this.ipAddressType = ipAddressType; + return this; + } + + /** + * Get the loadBalancerArn property: Property loadBalancerArn. + * + * @return the loadBalancerArn value. + */ + public String loadBalancerArn() { + return this.loadBalancerArn; + } + + /** + * Set the loadBalancerArn property: Property loadBalancerArn. + * + * @param loadBalancerArn the loadBalancerArn value to set. + * @return the AwsElasticLoadBalancingV2LoadBalancerProperties object itself. + */ + public AwsElasticLoadBalancingV2LoadBalancerProperties withLoadBalancerArn(String loadBalancerArn) { + this.loadBalancerArn = loadBalancerArn; + return this; + } + + /** + * Get the loadBalancerAttributes property: The load balancer attributes. + * + * @return the loadBalancerAttributes value. + */ + public List loadBalancerAttributes() { + return this.loadBalancerAttributes; + } + + /** + * Set the loadBalancerAttributes property: The load balancer attributes. + * + * @param loadBalancerAttributes the loadBalancerAttributes value to set. + * @return the AwsElasticLoadBalancingV2LoadBalancerProperties object itself. + */ + public AwsElasticLoadBalancingV2LoadBalancerProperties + withLoadBalancerAttributes(List loadBalancerAttributes) { + this.loadBalancerAttributes = loadBalancerAttributes; + return this; + } + + /** + * Get the loadBalancerFullName property: Property loadBalancerFullName. + * + * @return the loadBalancerFullName value. + */ + public String loadBalancerFullName() { + return this.loadBalancerFullName; + } + + /** + * Set the loadBalancerFullName property: Property loadBalancerFullName. + * + * @param loadBalancerFullName the loadBalancerFullName value to set. + * @return the AwsElasticLoadBalancingV2LoadBalancerProperties object itself. + */ + public AwsElasticLoadBalancingV2LoadBalancerProperties withLoadBalancerFullName(String loadBalancerFullName) { + this.loadBalancerFullName = loadBalancerFullName; + return this; + } + + /** + * Get the loadBalancerName property: Property loadBalancerName. + * + * @return the loadBalancerName value. + */ + public String loadBalancerName() { + return this.loadBalancerName; + } + + /** + * Set the loadBalancerName property: Property loadBalancerName. + * + * @param loadBalancerName the loadBalancerName value to set. + * @return the AwsElasticLoadBalancingV2LoadBalancerProperties object itself. + */ + public AwsElasticLoadBalancingV2LoadBalancerProperties withLoadBalancerName(String loadBalancerName) { + this.loadBalancerName = loadBalancerName; + return this; + } + + /** + * Get the name property: The name of the load balancer. This name must be unique per region per account, can have a + * maximum of 32 characters, must contain only alphanumeric characters or hyphens, must not begin or end with a + * hyphen, and must not begin with 'internal-'. If you don't specify a name, AWS CloudFormation generates a unique + * physical ID for the load balancer. If you specify a name, you cannot perform updates that require replacement of + * this resource, but you can perform other updates. To replace the resource, specify a new name. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: The name of the load balancer. This name must be unique per region per account, can have a + * maximum of 32 characters, must contain only alphanumeric characters or hyphens, must not begin or end with a + * hyphen, and must not begin with 'internal-'. If you don't specify a name, AWS CloudFormation generates a unique + * physical ID for the load balancer. If you specify a name, you cannot perform updates that require replacement of + * this resource, but you can perform other updates. To replace the resource, specify a new name. + * + * @param name the name value to set. + * @return the AwsElasticLoadBalancingV2LoadBalancerProperties object itself. + */ + public AwsElasticLoadBalancingV2LoadBalancerProperties withName(String name) { + this.name = name; + return this; + } + + /** + * Get the scheme property: The nodes of an Internet-facing load balancer have public IP addresses. The DNS name of + * an Internet-facing load balancer is publicly resolvable to the public IP addresses of the nodes. Therefore, + * Internet-facing load balancers can route requests from clients over the internet. The nodes of an internal load + * balancer have only private IP addresses. The DNS name of an internal load balancer is publicly resolvable to the + * private IP addresses of the nodes. Therefore, internal load balancers can route requests only from clients with + * access to the VPC for the load balancer. The default is an Internet-facing load balancer. You cannot specify a + * scheme for a Gateway Load Balancer. + * + * @return the scheme value. + */ + public String scheme() { + return this.scheme; + } + + /** + * Set the scheme property: The nodes of an Internet-facing load balancer have public IP addresses. The DNS name of + * an Internet-facing load balancer is publicly resolvable to the public IP addresses of the nodes. Therefore, + * Internet-facing load balancers can route requests from clients over the internet. The nodes of an internal load + * balancer have only private IP addresses. The DNS name of an internal load balancer is publicly resolvable to the + * private IP addresses of the nodes. Therefore, internal load balancers can route requests only from clients with + * access to the VPC for the load balancer. The default is an Internet-facing load balancer. You cannot specify a + * scheme for a Gateway Load Balancer. + * + * @param scheme the scheme value to set. + * @return the AwsElasticLoadBalancingV2LoadBalancerProperties object itself. + */ + public AwsElasticLoadBalancingV2LoadBalancerProperties withScheme(String scheme) { + this.scheme = scheme; + return this; + } + + /** + * Get the securityGroups property: [Application Load Balancers and Network Load Balancers] The IDs of the security + * groups for the load balancer. + * + * @return the securityGroups value. + */ + public List securityGroups() { + return this.securityGroups; + } + + /** + * Set the securityGroups property: [Application Load Balancers and Network Load Balancers] The IDs of the security + * groups for the load balancer. + * + * @param securityGroups the securityGroups value to set. + * @return the AwsElasticLoadBalancingV2LoadBalancerProperties object itself. + */ + public AwsElasticLoadBalancingV2LoadBalancerProperties withSecurityGroups(List securityGroups) { + this.securityGroups = securityGroups; + return this; + } + + /** + * Get the subnetMappings property: The IDs of the subnets. You can specify only one subnet per Availability Zone. + * You must specify either subnets or subnet mappings, but not both. [Application Load Balancers] You must specify + * subnets from at least two Availability Zones. You cannot specify Elastic IP addresses for your subnets. + * [Application Load Balancers on Outposts] You must specify one Outpost subnet. [Application Load Balancers on + * Local Zones] You can specify subnets from one or more Local Zones. [Network Load Balancers] You can specify + * subnets from one or more Availability Zones. You can specify one Elastic IP address per subnet if you need static + * IP addresses for your internet-facing load balancer. For internal load balancers, you can specify one private IP + * address per subnet from the IPv4 range of the subnet. For internet-facing load balancer, you can specify one IPv6 + * address per subnet. [Gateway Load Balancers] You can specify subnets from one or more Availability Zones. You + * cannot specify Elastic IP addresses for your subnets. + * + * @return the subnetMappings value. + */ + public List subnetMappings() { + return this.subnetMappings; + } + + /** + * Set the subnetMappings property: The IDs of the subnets. You can specify only one subnet per Availability Zone. + * You must specify either subnets or subnet mappings, but not both. [Application Load Balancers] You must specify + * subnets from at least two Availability Zones. You cannot specify Elastic IP addresses for your subnets. + * [Application Load Balancers on Outposts] You must specify one Outpost subnet. [Application Load Balancers on + * Local Zones] You can specify subnets from one or more Local Zones. [Network Load Balancers] You can specify + * subnets from one or more Availability Zones. You can specify one Elastic IP address per subnet if you need static + * IP addresses for your internet-facing load balancer. For internal load balancers, you can specify one private IP + * address per subnet from the IPv4 range of the subnet. For internet-facing load balancer, you can specify one IPv6 + * address per subnet. [Gateway Load Balancers] You can specify subnets from one or more Availability Zones. You + * cannot specify Elastic IP addresses for your subnets. + * + * @param subnetMappings the subnetMappings value to set. + * @return the AwsElasticLoadBalancingV2LoadBalancerProperties object itself. + */ + public AwsElasticLoadBalancingV2LoadBalancerProperties withSubnetMappings(List subnetMappings) { + this.subnetMappings = subnetMappings; + return this; + } + + /** + * Get the subnets property: The IDs of the subnets. You can specify only one subnet per Availability Zone. You must + * specify either subnets or subnet mappings, but not both. To specify an Elastic IP address, specify subnet + * mappings instead of subnets. [Application Load Balancers] You must specify subnets from at least two Availability + * Zones. [Application Load Balancers on Outposts] You must specify one Outpost subnet. [Application Load Balancers + * on Local Zones] You can specify subnets from one or more Local Zones. [Network Load Balancers] You can specify + * subnets from one or more Availability Zones. [Gateway Load Balancers] You can specify subnets from one or more + * Availability Zones. + * + * @return the subnets value. + */ + public List subnets() { + return this.subnets; + } + + /** + * Set the subnets property: The IDs of the subnets. You can specify only one subnet per Availability Zone. You must + * specify either subnets or subnet mappings, but not both. To specify an Elastic IP address, specify subnet + * mappings instead of subnets. [Application Load Balancers] You must specify subnets from at least two Availability + * Zones. [Application Load Balancers on Outposts] You must specify one Outpost subnet. [Application Load Balancers + * on Local Zones] You can specify subnets from one or more Local Zones. [Network Load Balancers] You can specify + * subnets from one or more Availability Zones. [Gateway Load Balancers] You can specify subnets from one or more + * Availability Zones. + * + * @param subnets the subnets value to set. + * @return the AwsElasticLoadBalancingV2LoadBalancerProperties object itself. + */ + public AwsElasticLoadBalancingV2LoadBalancerProperties withSubnets(List subnets) { + this.subnets = subnets; + return this; + } + + /** + * Get the tags property: The tags to assign to the load balancer. + * + * @return the tags value. + */ + public List tags() { + return this.tags; + } + + /** + * Set the tags property: The tags to assign to the load balancer. + * + * @param tags the tags value to set. + * @return the AwsElasticLoadBalancingV2LoadBalancerProperties object itself. + */ + public AwsElasticLoadBalancingV2LoadBalancerProperties withTags(List tags) { + this.tags = tags; + return this; + } + + /** + * Get the type property: The type of load balancer. The default is ``application``. + * + * @return the type value. + */ + public String type() { + return this.type; + } + + /** + * Set the type property: The type of load balancer. The default is ``application``. + * + * @param type the type value to set. + * @return the AwsElasticLoadBalancingV2LoadBalancerProperties object itself. + */ + public AwsElasticLoadBalancingV2LoadBalancerProperties withType(String type) { + this.type = type; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (loadBalancerAttributes() != null) { + loadBalancerAttributes().forEach(e -> e.validate()); + } + if (subnetMappings() != null) { + subnetMappings().forEach(e -> e.validate()); + } + if (tags() != null) { + tags().forEach(e -> e.validate()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("canonicalHostedZoneID", this.canonicalHostedZoneId); + jsonWriter.writeStringField("dnsName", this.dnsName); + jsonWriter.writeStringField("enforceSecurityGroupInboundRulesOnPrivateLinkTraffic", + this.enforceSecurityGroupInboundRulesOnPrivateLinkTraffic); + jsonWriter.writeStringField("ipAddressType", this.ipAddressType); + jsonWriter.writeStringField("loadBalancerArn", this.loadBalancerArn); + jsonWriter.writeArrayField("loadBalancerAttributes", this.loadBalancerAttributes, + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("loadBalancerFullName", this.loadBalancerFullName); + jsonWriter.writeStringField("loadBalancerName", this.loadBalancerName); + jsonWriter.writeStringField("name", this.name); + jsonWriter.writeStringField("scheme", this.scheme); + jsonWriter.writeArrayField("securityGroups", this.securityGroups, + (writer, element) -> writer.writeString(element)); + jsonWriter.writeArrayField("subnetMappings", this.subnetMappings, + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("subnets", this.subnets, (writer, element) -> writer.writeString(element)); + jsonWriter.writeArrayField("tags", this.tags, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("type", this.type); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AwsElasticLoadBalancingV2LoadBalancerProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AwsElasticLoadBalancingV2LoadBalancerProperties if the JsonReader was pointing to an + * instance of it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the AwsElasticLoadBalancingV2LoadBalancerProperties. + */ + public static AwsElasticLoadBalancingV2LoadBalancerProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AwsElasticLoadBalancingV2LoadBalancerProperties deserializedAwsElasticLoadBalancingV2LoadBalancerProperties + = new AwsElasticLoadBalancingV2LoadBalancerProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("canonicalHostedZoneID".equals(fieldName)) { + deserializedAwsElasticLoadBalancingV2LoadBalancerProperties.canonicalHostedZoneId + = reader.getString(); + } else if ("dnsName".equals(fieldName)) { + deserializedAwsElasticLoadBalancingV2LoadBalancerProperties.dnsName = reader.getString(); + } else if ("enforceSecurityGroupInboundRulesOnPrivateLinkTraffic".equals(fieldName)) { + deserializedAwsElasticLoadBalancingV2LoadBalancerProperties.enforceSecurityGroupInboundRulesOnPrivateLinkTraffic + = reader.getString(); + } else if ("ipAddressType".equals(fieldName)) { + deserializedAwsElasticLoadBalancingV2LoadBalancerProperties.ipAddressType = reader.getString(); + } else if ("loadBalancerArn".equals(fieldName)) { + deserializedAwsElasticLoadBalancingV2LoadBalancerProperties.loadBalancerArn = reader.getString(); + } else if ("loadBalancerAttributes".equals(fieldName)) { + List loadBalancerAttributes + = reader.readArray(reader1 -> LoadBalancerAttribute.fromJson(reader1)); + deserializedAwsElasticLoadBalancingV2LoadBalancerProperties.loadBalancerAttributes + = loadBalancerAttributes; + } else if ("loadBalancerFullName".equals(fieldName)) { + deserializedAwsElasticLoadBalancingV2LoadBalancerProperties.loadBalancerFullName + = reader.getString(); + } else if ("loadBalancerName".equals(fieldName)) { + deserializedAwsElasticLoadBalancingV2LoadBalancerProperties.loadBalancerName = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedAwsElasticLoadBalancingV2LoadBalancerProperties.name = reader.getString(); + } else if ("scheme".equals(fieldName)) { + deserializedAwsElasticLoadBalancingV2LoadBalancerProperties.scheme = reader.getString(); + } else if ("securityGroups".equals(fieldName)) { + List securityGroups = reader.readArray(reader1 -> reader1.getString()); + deserializedAwsElasticLoadBalancingV2LoadBalancerProperties.securityGroups = securityGroups; + } else if ("subnetMappings".equals(fieldName)) { + List subnetMappings = reader.readArray(reader1 -> SubnetMapping.fromJson(reader1)); + deserializedAwsElasticLoadBalancingV2LoadBalancerProperties.subnetMappings = subnetMappings; + } else if ("subnets".equals(fieldName)) { + List subnets = reader.readArray(reader1 -> reader1.getString()); + deserializedAwsElasticLoadBalancingV2LoadBalancerProperties.subnets = subnets; + } else if ("tags".equals(fieldName)) { + List tags = reader.readArray(reader1 -> TagAutoGenerated29.fromJson(reader1)); + deserializedAwsElasticLoadBalancingV2LoadBalancerProperties.tags = tags; + } else if ("type".equals(fieldName)) { + deserializedAwsElasticLoadBalancingV2LoadBalancerProperties.type = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedAwsElasticLoadBalancingV2LoadBalancerProperties; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/AwsElasticLoadBalancingV2TargetGroupProperties.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/AwsElasticLoadBalancingV2TargetGroupProperties.java new file mode 100644 index 000000000000..aeaa9a28060d --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/AwsElasticLoadBalancingV2TargetGroupProperties.java @@ -0,0 +1,783 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Definition of awsElasticLoadBalancingV2TargetGroup. + */ +@Fluent +public final class AwsElasticLoadBalancingV2TargetGroupProperties + implements JsonSerializable { + /* + * Indicates whether health checks are enabled. If the target type is lambda, health checks are disabled by default + * but can be enabled. If the target type is instance, ip, or alb, health checks are always enabled and cannot be + * disabled. + */ + private Boolean healthCheckEnabled; + + /* + * The approximate amount of time, in seconds, between health checks of an individual target. + */ + private Integer healthCheckIntervalSeconds; + + /* + * [HTTP/HTTPS health checks] The destination for health checks on the targets. [HTTP1 or HTTP2 protocol version] + * The ping path. The default is /. [GRPC protocol version] The path of a custom health check method with the format + * /package.service/method. The default is /AWS.ALB/healthcheck. + */ + private String healthCheckPath; + + /* + * The port the load balancer uses when performing health checks on targets. + */ + private String healthCheckPort; + + /* + * The protocol the load balancer uses when performing health checks on targets. + */ + private String healthCheckProtocol; + + /* + * The amount of time, in seconds, during which no response from a target means a failed health check. + */ + private Integer healthCheckTimeoutSeconds; + + /* + * The number of consecutive health checks successes required before considering an unhealthy target healthy. + */ + private Integer healthyThresholdCount; + + /* + * The type of IP address used for this target group. The possible values are ipv4 and ipv6. + */ + private String ipAddressType; + + /* + * The Amazon Resource Names (ARNs) of the load balancers that route traffic to this target group. + */ + private List loadBalancerArns; + + /* + * [HTTP/HTTPS health checks] The HTTP or gRPC codes to use when checking for a successful response from a target. + */ + private Matcher matcher; + + /* + * The name of the target group. + */ + private String name; + + /* + * The port on which the targets receive traffic. This port is used unless you specify a port override when + * registering the target. If the target is a Lambda function, this parameter does not apply. If the protocol is + * GENEVE, the supported port is 6081. + */ + private Integer port; + + /* + * The protocol to use for routing traffic to the targets. + */ + private String protocol; + + /* + * [HTTP/HTTPS protocol] The protocol version. The possible values are GRPC, HTTP1, and HTTP2. + */ + private String protocolVersion; + + /* + * The tags. + */ + private List tags; + + /* + * The ARN of the Target Group + */ + private String targetGroupArn; + + /* + * The attributes. + */ + private List targetGroupAttributes; + + /* + * The full name of the target group. + */ + private String targetGroupFullName; + + /* + * The name of the target group. + */ + private String targetGroupName; + + /* + * The type of target that you must specify when registering targets with this target group. You can't specify + * targets for a target group using more than one target type. + */ + private String targetType; + + /* + * The targets. + */ + private List targets; + + /* + * The number of consecutive health check failures required before considering a target unhealthy. + */ + private Integer unhealthyThresholdCount; + + /* + * The identifier of the virtual private cloud (VPC). If the target is a Lambda function, this parameter does not + * apply. + */ + private String vpcId; + + /** + * Creates an instance of AwsElasticLoadBalancingV2TargetGroupProperties class. + */ + public AwsElasticLoadBalancingV2TargetGroupProperties() { + } + + /** + * Get the healthCheckEnabled property: Indicates whether health checks are enabled. If the target type is lambda, + * health checks are disabled by default but can be enabled. If the target type is instance, ip, or alb, health + * checks are always enabled and cannot be disabled. + * + * @return the healthCheckEnabled value. + */ + public Boolean healthCheckEnabled() { + return this.healthCheckEnabled; + } + + /** + * Set the healthCheckEnabled property: Indicates whether health checks are enabled. If the target type is lambda, + * health checks are disabled by default but can be enabled. If the target type is instance, ip, or alb, health + * checks are always enabled and cannot be disabled. + * + * @param healthCheckEnabled the healthCheckEnabled value to set. + * @return the AwsElasticLoadBalancingV2TargetGroupProperties object itself. + */ + public AwsElasticLoadBalancingV2TargetGroupProperties withHealthCheckEnabled(Boolean healthCheckEnabled) { + this.healthCheckEnabled = healthCheckEnabled; + return this; + } + + /** + * Get the healthCheckIntervalSeconds property: The approximate amount of time, in seconds, between health checks of + * an individual target. + * + * @return the healthCheckIntervalSeconds value. + */ + public Integer healthCheckIntervalSeconds() { + return this.healthCheckIntervalSeconds; + } + + /** + * Set the healthCheckIntervalSeconds property: The approximate amount of time, in seconds, between health checks of + * an individual target. + * + * @param healthCheckIntervalSeconds the healthCheckIntervalSeconds value to set. + * @return the AwsElasticLoadBalancingV2TargetGroupProperties object itself. + */ + public AwsElasticLoadBalancingV2TargetGroupProperties + withHealthCheckIntervalSeconds(Integer healthCheckIntervalSeconds) { + this.healthCheckIntervalSeconds = healthCheckIntervalSeconds; + return this; + } + + /** + * Get the healthCheckPath property: [HTTP/HTTPS health checks] The destination for health checks on the targets. + * [HTTP1 or HTTP2 protocol version] The ping path. The default is /. [GRPC protocol version] The path of a custom + * health check method with the format /package.service/method. The default is /AWS.ALB/healthcheck. + * + * @return the healthCheckPath value. + */ + public String healthCheckPath() { + return this.healthCheckPath; + } + + /** + * Set the healthCheckPath property: [HTTP/HTTPS health checks] The destination for health checks on the targets. + * [HTTP1 or HTTP2 protocol version] The ping path. The default is /. [GRPC protocol version] The path of a custom + * health check method with the format /package.service/method. The default is /AWS.ALB/healthcheck. + * + * @param healthCheckPath the healthCheckPath value to set. + * @return the AwsElasticLoadBalancingV2TargetGroupProperties object itself. + */ + public AwsElasticLoadBalancingV2TargetGroupProperties withHealthCheckPath(String healthCheckPath) { + this.healthCheckPath = healthCheckPath; + return this; + } + + /** + * Get the healthCheckPort property: The port the load balancer uses when performing health checks on targets. + * + * @return the healthCheckPort value. + */ + public String healthCheckPort() { + return this.healthCheckPort; + } + + /** + * Set the healthCheckPort property: The port the load balancer uses when performing health checks on targets. + * + * @param healthCheckPort the healthCheckPort value to set. + * @return the AwsElasticLoadBalancingV2TargetGroupProperties object itself. + */ + public AwsElasticLoadBalancingV2TargetGroupProperties withHealthCheckPort(String healthCheckPort) { + this.healthCheckPort = healthCheckPort; + return this; + } + + /** + * Get the healthCheckProtocol property: The protocol the load balancer uses when performing health checks on + * targets. + * + * @return the healthCheckProtocol value. + */ + public String healthCheckProtocol() { + return this.healthCheckProtocol; + } + + /** + * Set the healthCheckProtocol property: The protocol the load balancer uses when performing health checks on + * targets. + * + * @param healthCheckProtocol the healthCheckProtocol value to set. + * @return the AwsElasticLoadBalancingV2TargetGroupProperties object itself. + */ + public AwsElasticLoadBalancingV2TargetGroupProperties withHealthCheckProtocol(String healthCheckProtocol) { + this.healthCheckProtocol = healthCheckProtocol; + return this; + } + + /** + * Get the healthCheckTimeoutSeconds property: The amount of time, in seconds, during which no response from a + * target means a failed health check. + * + * @return the healthCheckTimeoutSeconds value. + */ + public Integer healthCheckTimeoutSeconds() { + return this.healthCheckTimeoutSeconds; + } + + /** + * Set the healthCheckTimeoutSeconds property: The amount of time, in seconds, during which no response from a + * target means a failed health check. + * + * @param healthCheckTimeoutSeconds the healthCheckTimeoutSeconds value to set. + * @return the AwsElasticLoadBalancingV2TargetGroupProperties object itself. + */ + public AwsElasticLoadBalancingV2TargetGroupProperties + withHealthCheckTimeoutSeconds(Integer healthCheckTimeoutSeconds) { + this.healthCheckTimeoutSeconds = healthCheckTimeoutSeconds; + return this; + } + + /** + * Get the healthyThresholdCount property: The number of consecutive health checks successes required before + * considering an unhealthy target healthy. + * + * @return the healthyThresholdCount value. + */ + public Integer healthyThresholdCount() { + return this.healthyThresholdCount; + } + + /** + * Set the healthyThresholdCount property: The number of consecutive health checks successes required before + * considering an unhealthy target healthy. + * + * @param healthyThresholdCount the healthyThresholdCount value to set. + * @return the AwsElasticLoadBalancingV2TargetGroupProperties object itself. + */ + public AwsElasticLoadBalancingV2TargetGroupProperties withHealthyThresholdCount(Integer healthyThresholdCount) { + this.healthyThresholdCount = healthyThresholdCount; + return this; + } + + /** + * Get the ipAddressType property: The type of IP address used for this target group. The possible values are ipv4 + * and ipv6. + * + * @return the ipAddressType value. + */ + public String ipAddressType() { + return this.ipAddressType; + } + + /** + * Set the ipAddressType property: The type of IP address used for this target group. The possible values are ipv4 + * and ipv6. + * + * @param ipAddressType the ipAddressType value to set. + * @return the AwsElasticLoadBalancingV2TargetGroupProperties object itself. + */ + public AwsElasticLoadBalancingV2TargetGroupProperties withIpAddressType(String ipAddressType) { + this.ipAddressType = ipAddressType; + return this; + } + + /** + * Get the loadBalancerArns property: The Amazon Resource Names (ARNs) of the load balancers that route traffic to + * this target group. + * + * @return the loadBalancerArns value. + */ + public List loadBalancerArns() { + return this.loadBalancerArns; + } + + /** + * Set the loadBalancerArns property: The Amazon Resource Names (ARNs) of the load balancers that route traffic to + * this target group. + * + * @param loadBalancerArns the loadBalancerArns value to set. + * @return the AwsElasticLoadBalancingV2TargetGroupProperties object itself. + */ + public AwsElasticLoadBalancingV2TargetGroupProperties withLoadBalancerArns(List loadBalancerArns) { + this.loadBalancerArns = loadBalancerArns; + return this; + } + + /** + * Get the matcher property: [HTTP/HTTPS health checks] The HTTP or gRPC codes to use when checking for a successful + * response from a target. + * + * @return the matcher value. + */ + public Matcher matcher() { + return this.matcher; + } + + /** + * Set the matcher property: [HTTP/HTTPS health checks] The HTTP or gRPC codes to use when checking for a successful + * response from a target. + * + * @param matcher the matcher value to set. + * @return the AwsElasticLoadBalancingV2TargetGroupProperties object itself. + */ + public AwsElasticLoadBalancingV2TargetGroupProperties withMatcher(Matcher matcher) { + this.matcher = matcher; + return this; + } + + /** + * Get the name property: The name of the target group. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: The name of the target group. + * + * @param name the name value to set. + * @return the AwsElasticLoadBalancingV2TargetGroupProperties object itself. + */ + public AwsElasticLoadBalancingV2TargetGroupProperties withName(String name) { + this.name = name; + return this; + } + + /** + * Get the port property: The port on which the targets receive traffic. This port is used unless you specify a port + * override when registering the target. If the target is a Lambda function, this parameter does not apply. If the + * protocol is GENEVE, the supported port is 6081. + * + * @return the port value. + */ + public Integer port() { + return this.port; + } + + /** + * Set the port property: The port on which the targets receive traffic. This port is used unless you specify a port + * override when registering the target. If the target is a Lambda function, this parameter does not apply. If the + * protocol is GENEVE, the supported port is 6081. + * + * @param port the port value to set. + * @return the AwsElasticLoadBalancingV2TargetGroupProperties object itself. + */ + public AwsElasticLoadBalancingV2TargetGroupProperties withPort(Integer port) { + this.port = port; + return this; + } + + /** + * Get the protocol property: The protocol to use for routing traffic to the targets. + * + * @return the protocol value. + */ + public String protocol() { + return this.protocol; + } + + /** + * Set the protocol property: The protocol to use for routing traffic to the targets. + * + * @param protocol the protocol value to set. + * @return the AwsElasticLoadBalancingV2TargetGroupProperties object itself. + */ + public AwsElasticLoadBalancingV2TargetGroupProperties withProtocol(String protocol) { + this.protocol = protocol; + return this; + } + + /** + * Get the protocolVersion property: [HTTP/HTTPS protocol] The protocol version. The possible values are GRPC, + * HTTP1, and HTTP2. + * + * @return the protocolVersion value. + */ + public String protocolVersion() { + return this.protocolVersion; + } + + /** + * Set the protocolVersion property: [HTTP/HTTPS protocol] The protocol version. The possible values are GRPC, + * HTTP1, and HTTP2. + * + * @param protocolVersion the protocolVersion value to set. + * @return the AwsElasticLoadBalancingV2TargetGroupProperties object itself. + */ + public AwsElasticLoadBalancingV2TargetGroupProperties withProtocolVersion(String protocolVersion) { + this.protocolVersion = protocolVersion; + return this; + } + + /** + * Get the tags property: The tags. + * + * @return the tags value. + */ + public List tags() { + return this.tags; + } + + /** + * Set the tags property: The tags. + * + * @param tags the tags value to set. + * @return the AwsElasticLoadBalancingV2TargetGroupProperties object itself. + */ + public AwsElasticLoadBalancingV2TargetGroupProperties withTags(List tags) { + this.tags = tags; + return this; + } + + /** + * Get the targetGroupArn property: The ARN of the Target Group. + * + * @return the targetGroupArn value. + */ + public String targetGroupArn() { + return this.targetGroupArn; + } + + /** + * Set the targetGroupArn property: The ARN of the Target Group. + * + * @param targetGroupArn the targetGroupArn value to set. + * @return the AwsElasticLoadBalancingV2TargetGroupProperties object itself. + */ + public AwsElasticLoadBalancingV2TargetGroupProperties withTargetGroupArn(String targetGroupArn) { + this.targetGroupArn = targetGroupArn; + return this; + } + + /** + * Get the targetGroupAttributes property: The attributes. + * + * @return the targetGroupAttributes value. + */ + public List targetGroupAttributes() { + return this.targetGroupAttributes; + } + + /** + * Set the targetGroupAttributes property: The attributes. + * + * @param targetGroupAttributes the targetGroupAttributes value to set. + * @return the AwsElasticLoadBalancingV2TargetGroupProperties object itself. + */ + public AwsElasticLoadBalancingV2TargetGroupProperties + withTargetGroupAttributes(List targetGroupAttributes) { + this.targetGroupAttributes = targetGroupAttributes; + return this; + } + + /** + * Get the targetGroupFullName property: The full name of the target group. + * + * @return the targetGroupFullName value. + */ + public String targetGroupFullName() { + return this.targetGroupFullName; + } + + /** + * Set the targetGroupFullName property: The full name of the target group. + * + * @param targetGroupFullName the targetGroupFullName value to set. + * @return the AwsElasticLoadBalancingV2TargetGroupProperties object itself. + */ + public AwsElasticLoadBalancingV2TargetGroupProperties withTargetGroupFullName(String targetGroupFullName) { + this.targetGroupFullName = targetGroupFullName; + return this; + } + + /** + * Get the targetGroupName property: The name of the target group. + * + * @return the targetGroupName value. + */ + public String targetGroupName() { + return this.targetGroupName; + } + + /** + * Set the targetGroupName property: The name of the target group. + * + * @param targetGroupName the targetGroupName value to set. + * @return the AwsElasticLoadBalancingV2TargetGroupProperties object itself. + */ + public AwsElasticLoadBalancingV2TargetGroupProperties withTargetGroupName(String targetGroupName) { + this.targetGroupName = targetGroupName; + return this; + } + + /** + * Get the targetType property: The type of target that you must specify when registering targets with this target + * group. You can't specify targets for a target group using more than one target type. + * + * @return the targetType value. + */ + public String targetType() { + return this.targetType; + } + + /** + * Set the targetType property: The type of target that you must specify when registering targets with this target + * group. You can't specify targets for a target group using more than one target type. + * + * @param targetType the targetType value to set. + * @return the AwsElasticLoadBalancingV2TargetGroupProperties object itself. + */ + public AwsElasticLoadBalancingV2TargetGroupProperties withTargetType(String targetType) { + this.targetType = targetType; + return this; + } + + /** + * Get the targets property: The targets. + * + * @return the targets value. + */ + public List targets() { + return this.targets; + } + + /** + * Set the targets property: The targets. + * + * @param targets the targets value to set. + * @return the AwsElasticLoadBalancingV2TargetGroupProperties object itself. + */ + public AwsElasticLoadBalancingV2TargetGroupProperties withTargets(List targets) { + this.targets = targets; + return this; + } + + /** + * Get the unhealthyThresholdCount property: The number of consecutive health check failures required before + * considering a target unhealthy. + * + * @return the unhealthyThresholdCount value. + */ + public Integer unhealthyThresholdCount() { + return this.unhealthyThresholdCount; + } + + /** + * Set the unhealthyThresholdCount property: The number of consecutive health check failures required before + * considering a target unhealthy. + * + * @param unhealthyThresholdCount the unhealthyThresholdCount value to set. + * @return the AwsElasticLoadBalancingV2TargetGroupProperties object itself. + */ + public AwsElasticLoadBalancingV2TargetGroupProperties withUnhealthyThresholdCount(Integer unhealthyThresholdCount) { + this.unhealthyThresholdCount = unhealthyThresholdCount; + return this; + } + + /** + * Get the vpcId property: The identifier of the virtual private cloud (VPC). If the target is a Lambda function, + * this parameter does not apply. + * + * @return the vpcId value. + */ + public String vpcId() { + return this.vpcId; + } + + /** + * Set the vpcId property: The identifier of the virtual private cloud (VPC). If the target is a Lambda function, + * this parameter does not apply. + * + * @param vpcId the vpcId value to set. + * @return the AwsElasticLoadBalancingV2TargetGroupProperties object itself. + */ + public AwsElasticLoadBalancingV2TargetGroupProperties withVpcId(String vpcId) { + this.vpcId = vpcId; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (matcher() != null) { + matcher().validate(); + } + if (tags() != null) { + tags().forEach(e -> e.validate()); + } + if (targetGroupAttributes() != null) { + targetGroupAttributes().forEach(e -> e.validate()); + } + if (targets() != null) { + targets().forEach(e -> e.validate()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeBooleanField("healthCheckEnabled", this.healthCheckEnabled); + jsonWriter.writeNumberField("healthCheckIntervalSeconds", this.healthCheckIntervalSeconds); + jsonWriter.writeStringField("healthCheckPath", this.healthCheckPath); + jsonWriter.writeStringField("healthCheckPort", this.healthCheckPort); + jsonWriter.writeStringField("healthCheckProtocol", this.healthCheckProtocol); + jsonWriter.writeNumberField("healthCheckTimeoutSeconds", this.healthCheckTimeoutSeconds); + jsonWriter.writeNumberField("healthyThresholdCount", this.healthyThresholdCount); + jsonWriter.writeStringField("ipAddressType", this.ipAddressType); + jsonWriter.writeArrayField("loadBalancerArns", this.loadBalancerArns, + (writer, element) -> writer.writeString(element)); + jsonWriter.writeJsonField("matcher", this.matcher); + jsonWriter.writeStringField("name", this.name); + jsonWriter.writeNumberField("port", this.port); + jsonWriter.writeStringField("protocol", this.protocol); + jsonWriter.writeStringField("protocolVersion", this.protocolVersion); + jsonWriter.writeArrayField("tags", this.tags, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("targetGroupArn", this.targetGroupArn); + jsonWriter.writeArrayField("targetGroupAttributes", this.targetGroupAttributes, + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("targetGroupFullName", this.targetGroupFullName); + jsonWriter.writeStringField("targetGroupName", this.targetGroupName); + jsonWriter.writeStringField("targetType", this.targetType); + jsonWriter.writeArrayField("targets", this.targets, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeNumberField("unhealthyThresholdCount", this.unhealthyThresholdCount); + jsonWriter.writeStringField("vpcId", this.vpcId); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AwsElasticLoadBalancingV2TargetGroupProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AwsElasticLoadBalancingV2TargetGroupProperties if the JsonReader was pointing to an + * instance of it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the AwsElasticLoadBalancingV2TargetGroupProperties. + */ + public static AwsElasticLoadBalancingV2TargetGroupProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AwsElasticLoadBalancingV2TargetGroupProperties deserializedAwsElasticLoadBalancingV2TargetGroupProperties + = new AwsElasticLoadBalancingV2TargetGroupProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("healthCheckEnabled".equals(fieldName)) { + deserializedAwsElasticLoadBalancingV2TargetGroupProperties.healthCheckEnabled + = reader.getNullable(JsonReader::getBoolean); + } else if ("healthCheckIntervalSeconds".equals(fieldName)) { + deserializedAwsElasticLoadBalancingV2TargetGroupProperties.healthCheckIntervalSeconds + = reader.getNullable(JsonReader::getInt); + } else if ("healthCheckPath".equals(fieldName)) { + deserializedAwsElasticLoadBalancingV2TargetGroupProperties.healthCheckPath = reader.getString(); + } else if ("healthCheckPort".equals(fieldName)) { + deserializedAwsElasticLoadBalancingV2TargetGroupProperties.healthCheckPort = reader.getString(); + } else if ("healthCheckProtocol".equals(fieldName)) { + deserializedAwsElasticLoadBalancingV2TargetGroupProperties.healthCheckProtocol = reader.getString(); + } else if ("healthCheckTimeoutSeconds".equals(fieldName)) { + deserializedAwsElasticLoadBalancingV2TargetGroupProperties.healthCheckTimeoutSeconds + = reader.getNullable(JsonReader::getInt); + } else if ("healthyThresholdCount".equals(fieldName)) { + deserializedAwsElasticLoadBalancingV2TargetGroupProperties.healthyThresholdCount + = reader.getNullable(JsonReader::getInt); + } else if ("ipAddressType".equals(fieldName)) { + deserializedAwsElasticLoadBalancingV2TargetGroupProperties.ipAddressType = reader.getString(); + } else if ("loadBalancerArns".equals(fieldName)) { + List loadBalancerArns = reader.readArray(reader1 -> reader1.getString()); + deserializedAwsElasticLoadBalancingV2TargetGroupProperties.loadBalancerArns = loadBalancerArns; + } else if ("matcher".equals(fieldName)) { + deserializedAwsElasticLoadBalancingV2TargetGroupProperties.matcher = Matcher.fromJson(reader); + } else if ("name".equals(fieldName)) { + deserializedAwsElasticLoadBalancingV2TargetGroupProperties.name = reader.getString(); + } else if ("port".equals(fieldName)) { + deserializedAwsElasticLoadBalancingV2TargetGroupProperties.port + = reader.getNullable(JsonReader::getInt); + } else if ("protocol".equals(fieldName)) { + deserializedAwsElasticLoadBalancingV2TargetGroupProperties.protocol = reader.getString(); + } else if ("protocolVersion".equals(fieldName)) { + deserializedAwsElasticLoadBalancingV2TargetGroupProperties.protocolVersion = reader.getString(); + } else if ("tags".equals(fieldName)) { + List tags = reader.readArray(reader1 -> TagAutoGenerated30.fromJson(reader1)); + deserializedAwsElasticLoadBalancingV2TargetGroupProperties.tags = tags; + } else if ("targetGroupArn".equals(fieldName)) { + deserializedAwsElasticLoadBalancingV2TargetGroupProperties.targetGroupArn = reader.getString(); + } else if ("targetGroupAttributes".equals(fieldName)) { + List targetGroupAttributes + = reader.readArray(reader1 -> TargetGroupAttribute.fromJson(reader1)); + deserializedAwsElasticLoadBalancingV2TargetGroupProperties.targetGroupAttributes + = targetGroupAttributes; + } else if ("targetGroupFullName".equals(fieldName)) { + deserializedAwsElasticLoadBalancingV2TargetGroupProperties.targetGroupFullName = reader.getString(); + } else if ("targetGroupName".equals(fieldName)) { + deserializedAwsElasticLoadBalancingV2TargetGroupProperties.targetGroupName = reader.getString(); + } else if ("targetType".equals(fieldName)) { + deserializedAwsElasticLoadBalancingV2TargetGroupProperties.targetType = reader.getString(); + } else if ("targets".equals(fieldName)) { + List targets = reader.readArray(reader1 -> TargetDescription.fromJson(reader1)); + deserializedAwsElasticLoadBalancingV2TargetGroupProperties.targets = targets; + } else if ("unhealthyThresholdCount".equals(fieldName)) { + deserializedAwsElasticLoadBalancingV2TargetGroupProperties.unhealthyThresholdCount + = reader.getNullable(JsonReader::getInt); + } else if ("vpcId".equals(fieldName)) { + deserializedAwsElasticLoadBalancingV2TargetGroupProperties.vpcId = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedAwsElasticLoadBalancingV2TargetGroupProperties; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/AwsElasticLoadBalancingv2TargetHealthDescriptionProperties.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/AwsElasticLoadBalancingv2TargetHealthDescriptionProperties.java new file mode 100644 index 000000000000..d457e94eebd0 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/AwsElasticLoadBalancingv2TargetHealthDescriptionProperties.java @@ -0,0 +1,201 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of awsElasticLoadBalancingv2TargetHealthDescription. + */ +@Fluent +public final class AwsElasticLoadBalancingv2TargetHealthDescriptionProperties + implements JsonSerializable { + /* + *

The anomaly detection result for the target.

If no anomalies were detected, the result is + * normal.

If anomalies were detected, the result is anomalous.

+ */ + private AnomalyDetection anomalyDetection; + + /* + *

The port to use to connect with the target.

+ */ + private String healthCheckPort; + + /* + *

The description of the target.

+ */ + private TargetDescriptionAutoGenerated target; + + /* + *

The health information for the target.

+ */ + private TargetHealth targetHealth; + + /** + * Creates an instance of AwsElasticLoadBalancingv2TargetHealthDescriptionProperties class. + */ + public AwsElasticLoadBalancingv2TargetHealthDescriptionProperties() { + } + + /** + * Get the anomalyDetection property: <p>The anomaly detection result for the target.</p> <p>If no + * anomalies were detected, the result is <code>normal</code>.</p> <p>If anomalies were + * detected, the result is <code>anomalous</code>.</p>. + * + * @return the anomalyDetection value. + */ + public AnomalyDetection anomalyDetection() { + return this.anomalyDetection; + } + + /** + * Set the anomalyDetection property: <p>The anomaly detection result for the target.</p> <p>If no + * anomalies were detected, the result is <code>normal</code>.</p> <p>If anomalies were + * detected, the result is <code>anomalous</code>.</p>. + * + * @param anomalyDetection the anomalyDetection value to set. + * @return the AwsElasticLoadBalancingv2TargetHealthDescriptionProperties object itself. + */ + public AwsElasticLoadBalancingv2TargetHealthDescriptionProperties + withAnomalyDetection(AnomalyDetection anomalyDetection) { + this.anomalyDetection = anomalyDetection; + return this; + } + + /** + * Get the healthCheckPort property: <p>The port to use to connect with the target.</p>. + * + * @return the healthCheckPort value. + */ + public String healthCheckPort() { + return this.healthCheckPort; + } + + /** + * Set the healthCheckPort property: <p>The port to use to connect with the target.</p>. + * + * @param healthCheckPort the healthCheckPort value to set. + * @return the AwsElasticLoadBalancingv2TargetHealthDescriptionProperties object itself. + */ + public AwsElasticLoadBalancingv2TargetHealthDescriptionProperties withHealthCheckPort(String healthCheckPort) { + this.healthCheckPort = healthCheckPort; + return this; + } + + /** + * Get the target property: <p>The description of the target.</p>. + * + * @return the target value. + */ + public TargetDescriptionAutoGenerated target() { + return this.target; + } + + /** + * Set the target property: <p>The description of the target.</p>. + * + * @param target the target value to set. + * @return the AwsElasticLoadBalancingv2TargetHealthDescriptionProperties object itself. + */ + public AwsElasticLoadBalancingv2TargetHealthDescriptionProperties + withTarget(TargetDescriptionAutoGenerated target) { + this.target = target; + return this; + } + + /** + * Get the targetHealth property: <p>The health information for the target.</p>. + * + * @return the targetHealth value. + */ + public TargetHealth targetHealth() { + return this.targetHealth; + } + + /** + * Set the targetHealth property: <p>The health information for the target.</p>. + * + * @param targetHealth the targetHealth value to set. + * @return the AwsElasticLoadBalancingv2TargetHealthDescriptionProperties object itself. + */ + public AwsElasticLoadBalancingv2TargetHealthDescriptionProperties withTargetHealth(TargetHealth targetHealth) { + this.targetHealth = targetHealth; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (anomalyDetection() != null) { + anomalyDetection().validate(); + } + if (target() != null) { + target().validate(); + } + if (targetHealth() != null) { + targetHealth().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("anomalyDetection", this.anomalyDetection); + jsonWriter.writeStringField("healthCheckPort", this.healthCheckPort); + jsonWriter.writeJsonField("target", this.target); + jsonWriter.writeJsonField("targetHealth", this.targetHealth); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AwsElasticLoadBalancingv2TargetHealthDescriptionProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AwsElasticLoadBalancingv2TargetHealthDescriptionProperties if the JsonReader was pointing + * to an instance of it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the + * AwsElasticLoadBalancingv2TargetHealthDescriptionProperties. + */ + public static AwsElasticLoadBalancingv2TargetHealthDescriptionProperties fromJson(JsonReader jsonReader) + throws IOException { + return jsonReader.readObject(reader -> { + AwsElasticLoadBalancingv2TargetHealthDescriptionProperties deserializedAwsElasticLoadBalancingv2TargetHealthDescriptionProperties + = new AwsElasticLoadBalancingv2TargetHealthDescriptionProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("anomalyDetection".equals(fieldName)) { + deserializedAwsElasticLoadBalancingv2TargetHealthDescriptionProperties.anomalyDetection + = AnomalyDetection.fromJson(reader); + } else if ("healthCheckPort".equals(fieldName)) { + deserializedAwsElasticLoadBalancingv2TargetHealthDescriptionProperties.healthCheckPort + = reader.getString(); + } else if ("target".equals(fieldName)) { + deserializedAwsElasticLoadBalancingv2TargetHealthDescriptionProperties.target + = TargetDescriptionAutoGenerated.fromJson(reader); + } else if ("targetHealth".equals(fieldName)) { + deserializedAwsElasticLoadBalancingv2TargetHealthDescriptionProperties.targetHealth + = TargetHealth.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedAwsElasticLoadBalancingv2TargetHealthDescriptionProperties; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/AwsEmrClusterProperties.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/AwsEmrClusterProperties.java new file mode 100644 index 000000000000..75f7cb7ff5ca --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/AwsEmrClusterProperties.java @@ -0,0 +1,1221 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Definition of awsEmrCluster. + */ +@Fluent +public final class AwsEmrClusterProperties implements JsonSerializable { + /* + *

The applications installed on this cluster.

+ */ + private List applications; + + /* + *

An IAM role for automatic scaling policies. The default role is EMR_AutoScaling_DefaultRole. The + * IAM role provides permissions that the automatic scaling feature requires to launch and terminate Amazon EC2 + * instances in an instance group.

+ */ + private String autoScalingRole; + + /* + *

Specifies whether the cluster should terminate after completing all steps.

+ */ + private Boolean autoTerminate; + + /* + *

The Amazon Resource Name of the cluster.

+ */ + private String clusterArn; + + /* + *

Applies only to Amazon EMR releases 4.x and later. The list of configurations that are supplied to the Amazon + * EMR cluster.

+ */ + private List configurations; + + /* + *

Available only in Amazon EMR releases 5.7.0 and later. The ID of a custom Amazon EBS-backed Linux AMI if the + * cluster uses a custom AMI.

+ */ + private String customAmiId; + + /* + *

The IOPS, of the Amazon EBS root device volume of the Linux AMI that is used for each Amazon EC2 instance. + * Available in Amazon EMR releases 6.15.0 and later.

+ */ + private Integer ebsRootVolumeIops; + + /* + *

The size, in GiB, of the Amazon EBS root device volume of the Linux AMI that is used for each Amazon EC2 + * instance. Available in Amazon EMR releases 4.x and later.

+ */ + private Integer ebsRootVolumeSize; + + /* + *

The throughput, in MiB/s, of the Amazon EBS root device volume of the Linux AMI that is used for each Amazon + * EC2 instance. Available in Amazon EMR releases 6.15.0 and later.

+ */ + private Integer ebsRootVolumeThroughput; + + /* + *

Provides information about the Amazon EC2 instances in a cluster grouped by category. For example, key name, + * subnet ID, IAM instance profile, and so on.

+ */ + private Ec2InstanceAttributes ec2InstanceAttributes; + + /* + *

The unique identifier for the cluster.

+ */ + private String id; + + /* + *

The instance fleet configuration is available only in Amazon EMR releases 4.8.0 and later, excluding + * 5.0.x versions.

The instance group configuration of the cluster. A value of + * INSTANCE_GROUP indicates a uniform instance group configuration. A value of + * INSTANCE_FLEET indicates an instance fleets configuration.

+ */ + private InstanceCollectionTypeEnumValue instanceCollectionType; + + /* + *

Attributes for Kerberos configuration when Kerberos authentication is enabled using a security configuration. + * For more information see Use + * Kerberos Authentication in the Amazon EMR Management Guide.

+ */ + private KerberosAttributes kerberosAttributes; + + /* + *

The KMS key used for encrypting log files. This attribute is only available with Amazon EMR 5.30.0 and later, + * excluding Amazon EMR 6.0.0.

+ */ + private String logEncryptionKmsKeyId; + + /* + *

The path to the Amazon S3 location where logs for this cluster are stored.

+ */ + private String logUri; + + /* + *

The DNS name of the master node. If the cluster is on a private subnet, this is the private DNS name. On a + * public subnet, this is the public DNS name.

+ */ + private String masterPublicDnsName; + + /* + *

The name of the cluster. This parameter can't contain the characters <, >, $, |, or ` (backtick).

+ */ + private String name; + + /* + *

An approximation of the cost of the cluster, represented in m1.small/hours. This value is incremented one time + * for every hour an m1.small instance runs. Larger instances are weighted more, so an Amazon EC2 instance that is + * roughly four times more expensive would result in the normalized instance hours being incremented by four. This + * result is only an approximation and does not reflect the actual billing rate.

+ */ + private Integer normalizedInstanceHours; + + /* + *

The Amazon Linux release specified in a cluster launch RunJobFlow request. If no Amazon Linux release was + * specified, the default Amazon Linux release is shown in the response.

+ */ + private String osReleaseLabel; + + /* + *

The Amazon Resource Name (ARN) of the Outpost where the cluster is launched.

+ */ + private String outpostArn; + + /* + *

Placement group configured for an Amazon EMR cluster.

+ */ + private List placementGroups; + + /* + *

The Amazon EMR release label, which determines the version of open-source application packages installed on + * the cluster. Release labels are in the form emr-x.x.x, where x.x.x is an Amazon EMR release version + * such as emr-5.14.0. For more information about Amazon EMR release versions and included application + * versions and features, see https://docs.aws.amazon.com/emr/latest/ReleaseGuide/< + * /a>. The release label applies only to Amazon EMR releases version 4.0 and later. Earlier versions use + * AmiVersion.

+ */ + private String releaseLabel; + + /* + *

Applies only when CustomAmiID is used. Specifies the type of updates that the Amazon Linux AMI + * package repositories apply when an instance boots using the AMI.

+ */ + private RepoUpgradeOnBootEnumValue repoUpgradeOnBoot; + + /* + *

The AMI version requested for this cluster.

+ */ + private String requestedAmiVersion; + + /* + *

The AMI version running on this cluster.

+ */ + private String runningAmiVersion; + + /* + *

The way that individual Amazon EC2 instances terminate when an automatic scale-in activity occurs or an + * instance group is resized. TERMINATE_AT_INSTANCE_HOUR indicates that Amazon EMR terminates nodes at + * the instance-hour boundary, regardless of when the request to terminate the instance was submitted. This option + * is only available with Amazon EMR 5.1.0 and later and is the default for clusters created using that version. + * TERMINATE_AT_TASK_COMPLETION indicates that Amazon EMR adds nodes to a deny list and drains tasks + * from nodes before terminating the Amazon EC2 instances, regardless of the instance-hour boundary. With either + * behavior, Amazon EMR removes the least active nodes first and blocks instance termination if it could lead to + * HDFS corruption. TERMINATE_AT_TASK_COMPLETION is available only in Amazon EMR releases 4.1.0 and + * later, and is the default for versions of Amazon EMR earlier than 5.1.0.

+ */ + private ScaleDownBehaviorEnumValue scaleDownBehavior; + + /* + *

The name of the security configuration applied to the cluster.

+ */ + private String securityConfiguration; + + /* + *

The IAM role that Amazon EMR assumes in order to access Amazon Web Services resources on your behalf.

+ */ + private String serviceRole; + + /* + *

The current status details about the cluster.

+ */ + private ClusterStatusAutoGenerated status; + + /* + *

Specifies the number of steps that can be executed concurrently.

+ */ + private Integer stepConcurrencyLevel; + + /* + *

A list of tags associated with a cluster.

+ */ + private List tags; + + /* + *

Indicates whether Amazon EMR will lock the cluster to prevent the Amazon EC2 instances from being terminated + * by an API call or user intervention, or in the event of a cluster error.

+ */ + private Boolean terminationProtected; + + /* + *

Indicates whether Amazon EMR should gracefully replace Amazon EC2 core instances that have degraded within the + * cluster.

+ */ + private Boolean unhealthyNodeReplacement; + + /* + *

Indicates whether the cluster is visible to IAM principals in the Amazon Web Services account associated with + * the cluster. When true, IAM principals in the Amazon Web Services account can perform Amazon EMR + * cluster actions on the cluster that their IAM policies allow. When false, only the IAM principal + * that created the cluster and the Amazon Web Services account root user can perform Amazon EMR actions, regardless + * of IAM permissions policies attached to other IAM principals.

The default value is true if a + * value is not provided when creating a cluster using the Amazon EMR API RunJobFlow command, the CLI create-cluster command, or + * the Amazon Web Services Management Console.

+ */ + private Boolean visibleToAllUsers; + + /** + * Creates an instance of AwsEmrClusterProperties class. + */ + public AwsEmrClusterProperties() { + } + + /** + * Get the applications property: <p>The applications installed on this cluster.</p>. + * + * @return the applications value. + */ + public List applications() { + return this.applications; + } + + /** + * Set the applications property: <p>The applications installed on this cluster.</p>. + * + * @param applications the applications value to set. + * @return the AwsEmrClusterProperties object itself. + */ + public AwsEmrClusterProperties withApplications(List applications) { + this.applications = applications; + return this; + } + + /** + * Get the autoScalingRole property: <p>An IAM role for automatic scaling policies. The default role is + * <code>EMR_AutoScaling_DefaultRole</code>. The IAM role provides permissions that the automatic + * scaling feature requires to launch and terminate Amazon EC2 instances in an instance group.</p>. + * + * @return the autoScalingRole value. + */ + public String autoScalingRole() { + return this.autoScalingRole; + } + + /** + * Set the autoScalingRole property: <p>An IAM role for automatic scaling policies. The default role is + * <code>EMR_AutoScaling_DefaultRole</code>. The IAM role provides permissions that the automatic + * scaling feature requires to launch and terminate Amazon EC2 instances in an instance group.</p>. + * + * @param autoScalingRole the autoScalingRole value to set. + * @return the AwsEmrClusterProperties object itself. + */ + public AwsEmrClusterProperties withAutoScalingRole(String autoScalingRole) { + this.autoScalingRole = autoScalingRole; + return this; + } + + /** + * Get the autoTerminate property: <p>Specifies whether the cluster should terminate after completing all + * steps.</p>. + * + * @return the autoTerminate value. + */ + public Boolean autoTerminate() { + return this.autoTerminate; + } + + /** + * Set the autoTerminate property: <p>Specifies whether the cluster should terminate after completing all + * steps.</p>. + * + * @param autoTerminate the autoTerminate value to set. + * @return the AwsEmrClusterProperties object itself. + */ + public AwsEmrClusterProperties withAutoTerminate(Boolean autoTerminate) { + this.autoTerminate = autoTerminate; + return this; + } + + /** + * Get the clusterArn property: <p>The Amazon Resource Name of the cluster.</p>. + * + * @return the clusterArn value. + */ + public String clusterArn() { + return this.clusterArn; + } + + /** + * Set the clusterArn property: <p>The Amazon Resource Name of the cluster.</p>. + * + * @param clusterArn the clusterArn value to set. + * @return the AwsEmrClusterProperties object itself. + */ + public AwsEmrClusterProperties withClusterArn(String clusterArn) { + this.clusterArn = clusterArn; + return this; + } + + /** + * Get the configurations property: <p>Applies only to Amazon EMR releases 4.x and later. The list of + * configurations that are supplied to the Amazon EMR cluster.</p>. + * + * @return the configurations value. + */ + public List configurations() { + return this.configurations; + } + + /** + * Set the configurations property: <p>Applies only to Amazon EMR releases 4.x and later. The list of + * configurations that are supplied to the Amazon EMR cluster.</p>. + * + * @param configurations the configurations value to set. + * @return the AwsEmrClusterProperties object itself. + */ + public AwsEmrClusterProperties withConfigurations(List configurations) { + this.configurations = configurations; + return this; + } + + /** + * Get the customAmiId property: <p>Available only in Amazon EMR releases 5.7.0 and later. The ID of a custom + * Amazon EBS-backed Linux AMI if the cluster uses a custom AMI.</p>. + * + * @return the customAmiId value. + */ + public String customAmiId() { + return this.customAmiId; + } + + /** + * Set the customAmiId property: <p>Available only in Amazon EMR releases 5.7.0 and later. The ID of a custom + * Amazon EBS-backed Linux AMI if the cluster uses a custom AMI.</p>. + * + * @param customAmiId the customAmiId value to set. + * @return the AwsEmrClusterProperties object itself. + */ + public AwsEmrClusterProperties withCustomAmiId(String customAmiId) { + this.customAmiId = customAmiId; + return this; + } + + /** + * Get the ebsRootVolumeIops property: <p>The IOPS, of the Amazon EBS root device volume of the Linux AMI that + * is used for each Amazon EC2 instance. Available in Amazon EMR releases 6.15.0 and later.</p>. + * + * @return the ebsRootVolumeIops value. + */ + public Integer ebsRootVolumeIops() { + return this.ebsRootVolumeIops; + } + + /** + * Set the ebsRootVolumeIops property: <p>The IOPS, of the Amazon EBS root device volume of the Linux AMI that + * is used for each Amazon EC2 instance. Available in Amazon EMR releases 6.15.0 and later.</p>. + * + * @param ebsRootVolumeIops the ebsRootVolumeIops value to set. + * @return the AwsEmrClusterProperties object itself. + */ + public AwsEmrClusterProperties withEbsRootVolumeIops(Integer ebsRootVolumeIops) { + this.ebsRootVolumeIops = ebsRootVolumeIops; + return this; + } + + /** + * Get the ebsRootVolumeSize property: <p>The size, in GiB, of the Amazon EBS root device volume of the Linux + * AMI that is used for each Amazon EC2 instance. Available in Amazon EMR releases 4.x and later.</p>. + * + * @return the ebsRootVolumeSize value. + */ + public Integer ebsRootVolumeSize() { + return this.ebsRootVolumeSize; + } + + /** + * Set the ebsRootVolumeSize property: <p>The size, in GiB, of the Amazon EBS root device volume of the Linux + * AMI that is used for each Amazon EC2 instance. Available in Amazon EMR releases 4.x and later.</p>. + * + * @param ebsRootVolumeSize the ebsRootVolumeSize value to set. + * @return the AwsEmrClusterProperties object itself. + */ + public AwsEmrClusterProperties withEbsRootVolumeSize(Integer ebsRootVolumeSize) { + this.ebsRootVolumeSize = ebsRootVolumeSize; + return this; + } + + /** + * Get the ebsRootVolumeThroughput property: <p>The throughput, in MiB/s, of the Amazon EBS root device volume + * of the Linux AMI that is used for each Amazon EC2 instance. Available in Amazon EMR releases 6.15.0 and + * later.</p>. + * + * @return the ebsRootVolumeThroughput value. + */ + public Integer ebsRootVolumeThroughput() { + return this.ebsRootVolumeThroughput; + } + + /** + * Set the ebsRootVolumeThroughput property: <p>The throughput, in MiB/s, of the Amazon EBS root device volume + * of the Linux AMI that is used for each Amazon EC2 instance. Available in Amazon EMR releases 6.15.0 and + * later.</p>. + * + * @param ebsRootVolumeThroughput the ebsRootVolumeThroughput value to set. + * @return the AwsEmrClusterProperties object itself. + */ + public AwsEmrClusterProperties withEbsRootVolumeThroughput(Integer ebsRootVolumeThroughput) { + this.ebsRootVolumeThroughput = ebsRootVolumeThroughput; + return this; + } + + /** + * Get the ec2InstanceAttributes property: <p>Provides information about the Amazon EC2 instances in a cluster + * grouped by category. For example, key name, subnet ID, IAM instance profile, and so on.</p>. + * + * @return the ec2InstanceAttributes value. + */ + public Ec2InstanceAttributes ec2InstanceAttributes() { + return this.ec2InstanceAttributes; + } + + /** + * Set the ec2InstanceAttributes property: <p>Provides information about the Amazon EC2 instances in a cluster + * grouped by category. For example, key name, subnet ID, IAM instance profile, and so on.</p>. + * + * @param ec2InstanceAttributes the ec2InstanceAttributes value to set. + * @return the AwsEmrClusterProperties object itself. + */ + public AwsEmrClusterProperties withEc2InstanceAttributes(Ec2InstanceAttributes ec2InstanceAttributes) { + this.ec2InstanceAttributes = ec2InstanceAttributes; + return this; + } + + /** + * Get the id property: <p>The unique identifier for the cluster.</p>. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Set the id property: <p>The unique identifier for the cluster.</p>. + * + * @param id the id value to set. + * @return the AwsEmrClusterProperties object itself. + */ + public AwsEmrClusterProperties withId(String id) { + this.id = id; + return this; + } + + /** + * Get the instanceCollectionType property: <note> <p>The instance fleet configuration is available only + * in Amazon EMR releases 4.8.0 and later, excluding 5.0.x versions.</p> </note> <p>The instance + * group configuration of the cluster. A value of <code>INSTANCE_GROUP</code> indicates a uniform + * instance group configuration. A value of <code>INSTANCE_FLEET</code> indicates an instance fleets + * configuration.</p>. + * + * @return the instanceCollectionType value. + */ + public InstanceCollectionTypeEnumValue instanceCollectionType() { + return this.instanceCollectionType; + } + + /** + * Set the instanceCollectionType property: <note> <p>The instance fleet configuration is available only + * in Amazon EMR releases 4.8.0 and later, excluding 5.0.x versions.</p> </note> <p>The instance + * group configuration of the cluster. A value of <code>INSTANCE_GROUP</code> indicates a uniform + * instance group configuration. A value of <code>INSTANCE_FLEET</code> indicates an instance fleets + * configuration.</p>. + * + * @param instanceCollectionType the instanceCollectionType value to set. + * @return the AwsEmrClusterProperties object itself. + */ + public AwsEmrClusterProperties withInstanceCollectionType(InstanceCollectionTypeEnumValue instanceCollectionType) { + this.instanceCollectionType = instanceCollectionType; + return this; + } + + /** + * Get the kerberosAttributes property: <p>Attributes for Kerberos configuration when Kerberos authentication + * is enabled using a security configuration. For more information see <a + * href='https://docs.aws.amazon.com/emr/latest/ManagementGuide/emr-kerberos.html'>Use Kerberos + * Authentication</a> in the <i>Amazon EMR Management Guide</i>.</p>. + * + * @return the kerberosAttributes value. + */ + public KerberosAttributes kerberosAttributes() { + return this.kerberosAttributes; + } + + /** + * Set the kerberosAttributes property: <p>Attributes for Kerberos configuration when Kerberos authentication + * is enabled using a security configuration. For more information see <a + * href='https://docs.aws.amazon.com/emr/latest/ManagementGuide/emr-kerberos.html'>Use Kerberos + * Authentication</a> in the <i>Amazon EMR Management Guide</i>.</p>. + * + * @param kerberosAttributes the kerberosAttributes value to set. + * @return the AwsEmrClusterProperties object itself. + */ + public AwsEmrClusterProperties withKerberosAttributes(KerberosAttributes kerberosAttributes) { + this.kerberosAttributes = kerberosAttributes; + return this; + } + + /** + * Get the logEncryptionKmsKeyId property: <p> The KMS key used for encrypting log files. This attribute is + * only available with Amazon EMR 5.30.0 and later, excluding Amazon EMR 6.0.0. </p>. + * + * @return the logEncryptionKmsKeyId value. + */ + public String logEncryptionKmsKeyId() { + return this.logEncryptionKmsKeyId; + } + + /** + * Set the logEncryptionKmsKeyId property: <p> The KMS key used for encrypting log files. This attribute is + * only available with Amazon EMR 5.30.0 and later, excluding Amazon EMR 6.0.0. </p>. + * + * @param logEncryptionKmsKeyId the logEncryptionKmsKeyId value to set. + * @return the AwsEmrClusterProperties object itself. + */ + public AwsEmrClusterProperties withLogEncryptionKmsKeyId(String logEncryptionKmsKeyId) { + this.logEncryptionKmsKeyId = logEncryptionKmsKeyId; + return this; + } + + /** + * Get the logUri property: <p>The path to the Amazon S3 location where logs for this cluster are + * stored.</p>. + * + * @return the logUri value. + */ + public String logUri() { + return this.logUri; + } + + /** + * Set the logUri property: <p>The path to the Amazon S3 location where logs for this cluster are + * stored.</p>. + * + * @param logUri the logUri value to set. + * @return the AwsEmrClusterProperties object itself. + */ + public AwsEmrClusterProperties withLogUri(String logUri) { + this.logUri = logUri; + return this; + } + + /** + * Get the masterPublicDnsName property: <p>The DNS name of the master node. If the cluster is on a private + * subnet, this is the private DNS name. On a public subnet, this is the public DNS name.</p>. + * + * @return the masterPublicDnsName value. + */ + public String masterPublicDnsName() { + return this.masterPublicDnsName; + } + + /** + * Set the masterPublicDnsName property: <p>The DNS name of the master node. If the cluster is on a private + * subnet, this is the private DNS name. On a public subnet, this is the public DNS name.</p>. + * + * @param masterPublicDnsName the masterPublicDnsName value to set. + * @return the AwsEmrClusterProperties object itself. + */ + public AwsEmrClusterProperties withMasterPublicDnsName(String masterPublicDnsName) { + this.masterPublicDnsName = masterPublicDnsName; + return this; + } + + /** + * Get the name property: <p>The name of the cluster. This parameter can't contain the characters &lt;, + * &gt;, $, |, or ` (backtick).</p>. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: <p>The name of the cluster. This parameter can't contain the characters &lt;, + * &gt;, $, |, or ` (backtick).</p>. + * + * @param name the name value to set. + * @return the AwsEmrClusterProperties object itself. + */ + public AwsEmrClusterProperties withName(String name) { + this.name = name; + return this; + } + + /** + * Get the normalizedInstanceHours property: <p>An approximation of the cost of the cluster, represented in + * m1.small/hours. This value is incremented one time for every hour an m1.small instance runs. Larger instances are + * weighted more, so an Amazon EC2 instance that is roughly four times more expensive would result in the normalized + * instance hours being incremented by four. This result is only an approximation and does not reflect the actual + * billing rate.</p>. + * + * @return the normalizedInstanceHours value. + */ + public Integer normalizedInstanceHours() { + return this.normalizedInstanceHours; + } + + /** + * Set the normalizedInstanceHours property: <p>An approximation of the cost of the cluster, represented in + * m1.small/hours. This value is incremented one time for every hour an m1.small instance runs. Larger instances are + * weighted more, so an Amazon EC2 instance that is roughly four times more expensive would result in the normalized + * instance hours being incremented by four. This result is only an approximation and does not reflect the actual + * billing rate.</p>. + * + * @param normalizedInstanceHours the normalizedInstanceHours value to set. + * @return the AwsEmrClusterProperties object itself. + */ + public AwsEmrClusterProperties withNormalizedInstanceHours(Integer normalizedInstanceHours) { + this.normalizedInstanceHours = normalizedInstanceHours; + return this; + } + + /** + * Get the osReleaseLabel property: <p>The Amazon Linux release specified in a cluster launch RunJobFlow + * request. If no Amazon Linux release was specified, the default Amazon Linux release is shown in the + * response.</p>. + * + * @return the osReleaseLabel value. + */ + public String osReleaseLabel() { + return this.osReleaseLabel; + } + + /** + * Set the osReleaseLabel property: <p>The Amazon Linux release specified in a cluster launch RunJobFlow + * request. If no Amazon Linux release was specified, the default Amazon Linux release is shown in the + * response.</p>. + * + * @param osReleaseLabel the osReleaseLabel value to set. + * @return the AwsEmrClusterProperties object itself. + */ + public AwsEmrClusterProperties withOsReleaseLabel(String osReleaseLabel) { + this.osReleaseLabel = osReleaseLabel; + return this; + } + + /** + * Get the outpostArn property: <p> The Amazon Resource Name (ARN) of the Outpost where the cluster is + * launched. </p>. + * + * @return the outpostArn value. + */ + public String outpostArn() { + return this.outpostArn; + } + + /** + * Set the outpostArn property: <p> The Amazon Resource Name (ARN) of the Outpost where the cluster is + * launched. </p>. + * + * @param outpostArn the outpostArn value to set. + * @return the AwsEmrClusterProperties object itself. + */ + public AwsEmrClusterProperties withOutpostArn(String outpostArn) { + this.outpostArn = outpostArn; + return this; + } + + /** + * Get the placementGroups property: <p>Placement group configured for an Amazon EMR cluster.</p>. + * + * @return the placementGroups value. + */ + public List placementGroups() { + return this.placementGroups; + } + + /** + * Set the placementGroups property: <p>Placement group configured for an Amazon EMR cluster.</p>. + * + * @param placementGroups the placementGroups value to set. + * @return the AwsEmrClusterProperties object itself. + */ + public AwsEmrClusterProperties withPlacementGroups(List placementGroups) { + this.placementGroups = placementGroups; + return this; + } + + /** + * Get the releaseLabel property: <p>The Amazon EMR release label, which determines the version of open-source + * application packages installed on the cluster. Release labels are in the form <code>emr-x.x.x</code>, + * where x.x.x is an Amazon EMR release version such as <code>emr-5.14.0</code>. For more information + * about Amazon EMR release versions and included application versions and features, see <a + * href='https://docs.aws.amazon.com/emr/latest/ReleaseGuide/'>https://docs.aws.amazon.com/emr/latest/ReleaseGuide/</a>. + * The release label applies only to Amazon EMR releases version 4.0 and later. Earlier versions use + * <code>AmiVersion</code>.</p>. + * + * @return the releaseLabel value. + */ + public String releaseLabel() { + return this.releaseLabel; + } + + /** + * Set the releaseLabel property: <p>The Amazon EMR release label, which determines the version of open-source + * application packages installed on the cluster. Release labels are in the form <code>emr-x.x.x</code>, + * where x.x.x is an Amazon EMR release version such as <code>emr-5.14.0</code>. For more information + * about Amazon EMR release versions and included application versions and features, see <a + * href='https://docs.aws.amazon.com/emr/latest/ReleaseGuide/'>https://docs.aws.amazon.com/emr/latest/ReleaseGuide/</a>. + * The release label applies only to Amazon EMR releases version 4.0 and later. Earlier versions use + * <code>AmiVersion</code>.</p>. + * + * @param releaseLabel the releaseLabel value to set. + * @return the AwsEmrClusterProperties object itself. + */ + public AwsEmrClusterProperties withReleaseLabel(String releaseLabel) { + this.releaseLabel = releaseLabel; + return this; + } + + /** + * Get the repoUpgradeOnBoot property: <p>Applies only when <code>CustomAmiID</code> is used. + * Specifies the type of updates that the Amazon Linux AMI package repositories apply when an instance boots using + * the AMI.</p>. + * + * @return the repoUpgradeOnBoot value. + */ + public RepoUpgradeOnBootEnumValue repoUpgradeOnBoot() { + return this.repoUpgradeOnBoot; + } + + /** + * Set the repoUpgradeOnBoot property: <p>Applies only when <code>CustomAmiID</code> is used. + * Specifies the type of updates that the Amazon Linux AMI package repositories apply when an instance boots using + * the AMI.</p>. + * + * @param repoUpgradeOnBoot the repoUpgradeOnBoot value to set. + * @return the AwsEmrClusterProperties object itself. + */ + public AwsEmrClusterProperties withRepoUpgradeOnBoot(RepoUpgradeOnBootEnumValue repoUpgradeOnBoot) { + this.repoUpgradeOnBoot = repoUpgradeOnBoot; + return this; + } + + /** + * Get the requestedAmiVersion property: <p>The AMI version requested for this cluster.</p>. + * + * @return the requestedAmiVersion value. + */ + public String requestedAmiVersion() { + return this.requestedAmiVersion; + } + + /** + * Set the requestedAmiVersion property: <p>The AMI version requested for this cluster.</p>. + * + * @param requestedAmiVersion the requestedAmiVersion value to set. + * @return the AwsEmrClusterProperties object itself. + */ + public AwsEmrClusterProperties withRequestedAmiVersion(String requestedAmiVersion) { + this.requestedAmiVersion = requestedAmiVersion; + return this; + } + + /** + * Get the runningAmiVersion property: <p>The AMI version running on this cluster.</p>. + * + * @return the runningAmiVersion value. + */ + public String runningAmiVersion() { + return this.runningAmiVersion; + } + + /** + * Set the runningAmiVersion property: <p>The AMI version running on this cluster.</p>. + * + * @param runningAmiVersion the runningAmiVersion value to set. + * @return the AwsEmrClusterProperties object itself. + */ + public AwsEmrClusterProperties withRunningAmiVersion(String runningAmiVersion) { + this.runningAmiVersion = runningAmiVersion; + return this; + } + + /** + * Get the scaleDownBehavior property: <p>The way that individual Amazon EC2 instances terminate when an + * automatic scale-in activity occurs or an instance group is resized. + * <code>TERMINATE_AT_INSTANCE_HOUR</code> indicates that Amazon EMR terminates nodes at the + * instance-hour boundary, regardless of when the request to terminate the instance was submitted. This option is + * only available with Amazon EMR 5.1.0 and later and is the default for clusters created using that version. + * <code>TERMINATE_AT_TASK_COMPLETION</code> indicates that Amazon EMR adds nodes to a deny list and + * drains tasks from nodes before terminating the Amazon EC2 instances, regardless of the instance-hour boundary. + * With either behavior, Amazon EMR removes the least active nodes first and blocks instance termination if it could + * lead to HDFS corruption. <code>TERMINATE_AT_TASK_COMPLETION</code> is available only in Amazon EMR + * releases 4.1.0 and later, and is the default for versions of Amazon EMR earlier than 5.1.0.</p>. + * + * @return the scaleDownBehavior value. + */ + public ScaleDownBehaviorEnumValue scaleDownBehavior() { + return this.scaleDownBehavior; + } + + /** + * Set the scaleDownBehavior property: <p>The way that individual Amazon EC2 instances terminate when an + * automatic scale-in activity occurs or an instance group is resized. + * <code>TERMINATE_AT_INSTANCE_HOUR</code> indicates that Amazon EMR terminates nodes at the + * instance-hour boundary, regardless of when the request to terminate the instance was submitted. This option is + * only available with Amazon EMR 5.1.0 and later and is the default for clusters created using that version. + * <code>TERMINATE_AT_TASK_COMPLETION</code> indicates that Amazon EMR adds nodes to a deny list and + * drains tasks from nodes before terminating the Amazon EC2 instances, regardless of the instance-hour boundary. + * With either behavior, Amazon EMR removes the least active nodes first and blocks instance termination if it could + * lead to HDFS corruption. <code>TERMINATE_AT_TASK_COMPLETION</code> is available only in Amazon EMR + * releases 4.1.0 and later, and is the default for versions of Amazon EMR earlier than 5.1.0.</p>. + * + * @param scaleDownBehavior the scaleDownBehavior value to set. + * @return the AwsEmrClusterProperties object itself. + */ + public AwsEmrClusterProperties withScaleDownBehavior(ScaleDownBehaviorEnumValue scaleDownBehavior) { + this.scaleDownBehavior = scaleDownBehavior; + return this; + } + + /** + * Get the securityConfiguration property: <p>The name of the security configuration applied to the + * cluster.</p>. + * + * @return the securityConfiguration value. + */ + public String securityConfiguration() { + return this.securityConfiguration; + } + + /** + * Set the securityConfiguration property: <p>The name of the security configuration applied to the + * cluster.</p>. + * + * @param securityConfiguration the securityConfiguration value to set. + * @return the AwsEmrClusterProperties object itself. + */ + public AwsEmrClusterProperties withSecurityConfiguration(String securityConfiguration) { + this.securityConfiguration = securityConfiguration; + return this; + } + + /** + * Get the serviceRole property: <p>The IAM role that Amazon EMR assumes in order to access Amazon Web + * Services resources on your behalf.</p>. + * + * @return the serviceRole value. + */ + public String serviceRole() { + return this.serviceRole; + } + + /** + * Set the serviceRole property: <p>The IAM role that Amazon EMR assumes in order to access Amazon Web + * Services resources on your behalf.</p>. + * + * @param serviceRole the serviceRole value to set. + * @return the AwsEmrClusterProperties object itself. + */ + public AwsEmrClusterProperties withServiceRole(String serviceRole) { + this.serviceRole = serviceRole; + return this; + } + + /** + * Get the status property: <p>The current status details about the cluster.</p>. + * + * @return the status value. + */ + public ClusterStatusAutoGenerated status() { + return this.status; + } + + /** + * Set the status property: <p>The current status details about the cluster.</p>. + * + * @param status the status value to set. + * @return the AwsEmrClusterProperties object itself. + */ + public AwsEmrClusterProperties withStatus(ClusterStatusAutoGenerated status) { + this.status = status; + return this; + } + + /** + * Get the stepConcurrencyLevel property: <p>Specifies the number of steps that can be executed + * concurrently.</p>. + * + * @return the stepConcurrencyLevel value. + */ + public Integer stepConcurrencyLevel() { + return this.stepConcurrencyLevel; + } + + /** + * Set the stepConcurrencyLevel property: <p>Specifies the number of steps that can be executed + * concurrently.</p>. + * + * @param stepConcurrencyLevel the stepConcurrencyLevel value to set. + * @return the AwsEmrClusterProperties object itself. + */ + public AwsEmrClusterProperties withStepConcurrencyLevel(Integer stepConcurrencyLevel) { + this.stepConcurrencyLevel = stepConcurrencyLevel; + return this; + } + + /** + * Get the tags property: <p>A list of tags associated with a cluster.</p>. + * + * @return the tags value. + */ + public List tags() { + return this.tags; + } + + /** + * Set the tags property: <p>A list of tags associated with a cluster.</p>. + * + * @param tags the tags value to set. + * @return the AwsEmrClusterProperties object itself. + */ + public AwsEmrClusterProperties withTags(List tags) { + this.tags = tags; + return this; + } + + /** + * Get the terminationProtected property: <p>Indicates whether Amazon EMR will lock the cluster to prevent the + * Amazon EC2 instances from being terminated by an API call or user intervention, or in the event of a cluster + * error.</p>. + * + * @return the terminationProtected value. + */ + public Boolean terminationProtected() { + return this.terminationProtected; + } + + /** + * Set the terminationProtected property: <p>Indicates whether Amazon EMR will lock the cluster to prevent the + * Amazon EC2 instances from being terminated by an API call or user intervention, or in the event of a cluster + * error.</p>. + * + * @param terminationProtected the terminationProtected value to set. + * @return the AwsEmrClusterProperties object itself. + */ + public AwsEmrClusterProperties withTerminationProtected(Boolean terminationProtected) { + this.terminationProtected = terminationProtected; + return this; + } + + /** + * Get the unhealthyNodeReplacement property: <p>Indicates whether Amazon EMR should gracefully replace Amazon + * EC2 core instances that have degraded within the cluster.</p>. + * + * @return the unhealthyNodeReplacement value. + */ + public Boolean unhealthyNodeReplacement() { + return this.unhealthyNodeReplacement; + } + + /** + * Set the unhealthyNodeReplacement property: <p>Indicates whether Amazon EMR should gracefully replace Amazon + * EC2 core instances that have degraded within the cluster.</p>. + * + * @param unhealthyNodeReplacement the unhealthyNodeReplacement value to set. + * @return the AwsEmrClusterProperties object itself. + */ + public AwsEmrClusterProperties withUnhealthyNodeReplacement(Boolean unhealthyNodeReplacement) { + this.unhealthyNodeReplacement = unhealthyNodeReplacement; + return this; + } + + /** + * Get the visibleToAllUsers property: <p>Indicates whether the cluster is visible to IAM principals in the + * Amazon Web Services account associated with the cluster. When <code>true</code>, IAM principals in + * the Amazon Web Services account can perform Amazon EMR cluster actions on the cluster that their IAM policies + * allow. When <code>false</code>, only the IAM principal that created the cluster and the Amazon Web + * Services account root user can perform Amazon EMR actions, regardless of IAM permissions policies attached to + * other IAM principals.</p> <p>The default value is <code>true</code> if a value is not + * provided when creating a cluster using the Amazon EMR API <a>RunJobFlow</a> command, the CLI <a + * href='https://docs.aws.amazon.com/cli/latest/reference/emr/create-cluster.html'>create-cluster</a> + * command, or the Amazon Web Services Management Console.</p>. + * + * @return the visibleToAllUsers value. + */ + public Boolean visibleToAllUsers() { + return this.visibleToAllUsers; + } + + /** + * Set the visibleToAllUsers property: <p>Indicates whether the cluster is visible to IAM principals in the + * Amazon Web Services account associated with the cluster. When <code>true</code>, IAM principals in + * the Amazon Web Services account can perform Amazon EMR cluster actions on the cluster that their IAM policies + * allow. When <code>false</code>, only the IAM principal that created the cluster and the Amazon Web + * Services account root user can perform Amazon EMR actions, regardless of IAM permissions policies attached to + * other IAM principals.</p> <p>The default value is <code>true</code> if a value is not + * provided when creating a cluster using the Amazon EMR API <a>RunJobFlow</a> command, the CLI <a + * href='https://docs.aws.amazon.com/cli/latest/reference/emr/create-cluster.html'>create-cluster</a> + * command, or the Amazon Web Services Management Console.</p>. + * + * @param visibleToAllUsers the visibleToAllUsers value to set. + * @return the AwsEmrClusterProperties object itself. + */ + public AwsEmrClusterProperties withVisibleToAllUsers(Boolean visibleToAllUsers) { + this.visibleToAllUsers = visibleToAllUsers; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (applications() != null) { + applications().forEach(e -> e.validate()); + } + if (configurations() != null) { + configurations().forEach(e -> e.validate()); + } + if (ec2InstanceAttributes() != null) { + ec2InstanceAttributes().validate(); + } + if (instanceCollectionType() != null) { + instanceCollectionType().validate(); + } + if (kerberosAttributes() != null) { + kerberosAttributes().validate(); + } + if (placementGroups() != null) { + placementGroups().forEach(e -> e.validate()); + } + if (repoUpgradeOnBoot() != null) { + repoUpgradeOnBoot().validate(); + } + if (scaleDownBehavior() != null) { + scaleDownBehavior().validate(); + } + if (status() != null) { + status().validate(); + } + if (tags() != null) { + tags().forEach(e -> e.validate()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("applications", this.applications, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("autoScalingRole", this.autoScalingRole); + jsonWriter.writeBooleanField("autoTerminate", this.autoTerminate); + jsonWriter.writeStringField("clusterArn", this.clusterArn); + jsonWriter.writeArrayField("configurations", this.configurations, + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("customAmiId", this.customAmiId); + jsonWriter.writeNumberField("ebsRootVolumeIops", this.ebsRootVolumeIops); + jsonWriter.writeNumberField("ebsRootVolumeSize", this.ebsRootVolumeSize); + jsonWriter.writeNumberField("ebsRootVolumeThroughput", this.ebsRootVolumeThroughput); + jsonWriter.writeJsonField("ec2InstanceAttributes", this.ec2InstanceAttributes); + jsonWriter.writeStringField("id", this.id); + jsonWriter.writeJsonField("instanceCollectionType", this.instanceCollectionType); + jsonWriter.writeJsonField("kerberosAttributes", this.kerberosAttributes); + jsonWriter.writeStringField("logEncryptionKmsKeyId", this.logEncryptionKmsKeyId); + jsonWriter.writeStringField("logUri", this.logUri); + jsonWriter.writeStringField("masterPublicDnsName", this.masterPublicDnsName); + jsonWriter.writeStringField("name", this.name); + jsonWriter.writeNumberField("normalizedInstanceHours", this.normalizedInstanceHours); + jsonWriter.writeStringField("osReleaseLabel", this.osReleaseLabel); + jsonWriter.writeStringField("outpostArn", this.outpostArn); + jsonWriter.writeArrayField("placementGroups", this.placementGroups, + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("releaseLabel", this.releaseLabel); + jsonWriter.writeJsonField("repoUpgradeOnBoot", this.repoUpgradeOnBoot); + jsonWriter.writeStringField("requestedAmiVersion", this.requestedAmiVersion); + jsonWriter.writeStringField("runningAmiVersion", this.runningAmiVersion); + jsonWriter.writeJsonField("scaleDownBehavior", this.scaleDownBehavior); + jsonWriter.writeStringField("securityConfiguration", this.securityConfiguration); + jsonWriter.writeStringField("serviceRole", this.serviceRole); + jsonWriter.writeJsonField("status", this.status); + jsonWriter.writeNumberField("stepConcurrencyLevel", this.stepConcurrencyLevel); + jsonWriter.writeArrayField("tags", this.tags, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeBooleanField("terminationProtected", this.terminationProtected); + jsonWriter.writeBooleanField("unhealthyNodeReplacement", this.unhealthyNodeReplacement); + jsonWriter.writeBooleanField("visibleToAllUsers", this.visibleToAllUsers); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AwsEmrClusterProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AwsEmrClusterProperties if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the AwsEmrClusterProperties. + */ + public static AwsEmrClusterProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AwsEmrClusterProperties deserializedAwsEmrClusterProperties = new AwsEmrClusterProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("applications".equals(fieldName)) { + List applications = reader.readArray(reader1 -> Application.fromJson(reader1)); + deserializedAwsEmrClusterProperties.applications = applications; + } else if ("autoScalingRole".equals(fieldName)) { + deserializedAwsEmrClusterProperties.autoScalingRole = reader.getString(); + } else if ("autoTerminate".equals(fieldName)) { + deserializedAwsEmrClusterProperties.autoTerminate = reader.getNullable(JsonReader::getBoolean); + } else if ("clusterArn".equals(fieldName)) { + deserializedAwsEmrClusterProperties.clusterArn = reader.getString(); + } else if ("configurations".equals(fieldName)) { + List configurations = reader.readArray(reader1 -> Configuration.fromJson(reader1)); + deserializedAwsEmrClusterProperties.configurations = configurations; + } else if ("customAmiId".equals(fieldName)) { + deserializedAwsEmrClusterProperties.customAmiId = reader.getString(); + } else if ("ebsRootVolumeIops".equals(fieldName)) { + deserializedAwsEmrClusterProperties.ebsRootVolumeIops = reader.getNullable(JsonReader::getInt); + } else if ("ebsRootVolumeSize".equals(fieldName)) { + deserializedAwsEmrClusterProperties.ebsRootVolumeSize = reader.getNullable(JsonReader::getInt); + } else if ("ebsRootVolumeThroughput".equals(fieldName)) { + deserializedAwsEmrClusterProperties.ebsRootVolumeThroughput + = reader.getNullable(JsonReader::getInt); + } else if ("ec2InstanceAttributes".equals(fieldName)) { + deserializedAwsEmrClusterProperties.ec2InstanceAttributes = Ec2InstanceAttributes.fromJson(reader); + } else if ("id".equals(fieldName)) { + deserializedAwsEmrClusterProperties.id = reader.getString(); + } else if ("instanceCollectionType".equals(fieldName)) { + deserializedAwsEmrClusterProperties.instanceCollectionType + = InstanceCollectionTypeEnumValue.fromJson(reader); + } else if ("kerberosAttributes".equals(fieldName)) { + deserializedAwsEmrClusterProperties.kerberosAttributes = KerberosAttributes.fromJson(reader); + } else if ("logEncryptionKmsKeyId".equals(fieldName)) { + deserializedAwsEmrClusterProperties.logEncryptionKmsKeyId = reader.getString(); + } else if ("logUri".equals(fieldName)) { + deserializedAwsEmrClusterProperties.logUri = reader.getString(); + } else if ("masterPublicDnsName".equals(fieldName)) { + deserializedAwsEmrClusterProperties.masterPublicDnsName = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedAwsEmrClusterProperties.name = reader.getString(); + } else if ("normalizedInstanceHours".equals(fieldName)) { + deserializedAwsEmrClusterProperties.normalizedInstanceHours + = reader.getNullable(JsonReader::getInt); + } else if ("osReleaseLabel".equals(fieldName)) { + deserializedAwsEmrClusterProperties.osReleaseLabel = reader.getString(); + } else if ("outpostArn".equals(fieldName)) { + deserializedAwsEmrClusterProperties.outpostArn = reader.getString(); + } else if ("placementGroups".equals(fieldName)) { + List placementGroups + = reader.readArray(reader1 -> PlacementGroupConfig.fromJson(reader1)); + deserializedAwsEmrClusterProperties.placementGroups = placementGroups; + } else if ("releaseLabel".equals(fieldName)) { + deserializedAwsEmrClusterProperties.releaseLabel = reader.getString(); + } else if ("repoUpgradeOnBoot".equals(fieldName)) { + deserializedAwsEmrClusterProperties.repoUpgradeOnBoot = RepoUpgradeOnBootEnumValue.fromJson(reader); + } else if ("requestedAmiVersion".equals(fieldName)) { + deserializedAwsEmrClusterProperties.requestedAmiVersion = reader.getString(); + } else if ("runningAmiVersion".equals(fieldName)) { + deserializedAwsEmrClusterProperties.runningAmiVersion = reader.getString(); + } else if ("scaleDownBehavior".equals(fieldName)) { + deserializedAwsEmrClusterProperties.scaleDownBehavior = ScaleDownBehaviorEnumValue.fromJson(reader); + } else if ("securityConfiguration".equals(fieldName)) { + deserializedAwsEmrClusterProperties.securityConfiguration = reader.getString(); + } else if ("serviceRole".equals(fieldName)) { + deserializedAwsEmrClusterProperties.serviceRole = reader.getString(); + } else if ("status".equals(fieldName)) { + deserializedAwsEmrClusterProperties.status = ClusterStatusAutoGenerated.fromJson(reader); + } else if ("stepConcurrencyLevel".equals(fieldName)) { + deserializedAwsEmrClusterProperties.stepConcurrencyLevel = reader.getNullable(JsonReader::getInt); + } else if ("tags".equals(fieldName)) { + List tags = reader.readArray(reader1 -> TagAutoGenerated31.fromJson(reader1)); + deserializedAwsEmrClusterProperties.tags = tags; + } else if ("terminationProtected".equals(fieldName)) { + deserializedAwsEmrClusterProperties.terminationProtected + = reader.getNullable(JsonReader::getBoolean); + } else if ("unhealthyNodeReplacement".equals(fieldName)) { + deserializedAwsEmrClusterProperties.unhealthyNodeReplacement + = reader.getNullable(JsonReader::getBoolean); + } else if ("visibleToAllUsers".equals(fieldName)) { + deserializedAwsEmrClusterProperties.visibleToAllUsers = reader.getNullable(JsonReader::getBoolean); + } else { + reader.skipChildren(); + } + } + + return deserializedAwsEmrClusterProperties; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/AwsEmrClusterSummaryProperties.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/AwsEmrClusterSummaryProperties.java new file mode 100644 index 000000000000..15b1a7676af6 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/AwsEmrClusterSummaryProperties.java @@ -0,0 +1,251 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of awsEmrClusterSummary. + */ +@Fluent +public final class AwsEmrClusterSummaryProperties implements JsonSerializable { + /* + *

The Amazon Resource Name of the cluster.

+ */ + private String clusterArn; + + /* + *

The unique identifier for the cluster.

+ */ + private String id; + + /* + *

The name of the cluster.

+ */ + private String name; + + /* + *

An approximation of the cost of the cluster, represented in m1.small/hours. This value is incremented one time + * for every hour an m1.small instance runs. Larger instances are weighted more, so an Amazon EC2 instance that is + * roughly four times more expensive would result in the normalized instance hours being incremented by four. This + * result is only an approximation and does not reflect the actual billing rate.

+ */ + private Integer normalizedInstanceHours; + + /* + *

The Amazon Resource Name (ARN) of the Outpost where the cluster is launched.

+ */ + private String outpostArn; + + /* + *

The details about the current status of the cluster.

+ */ + private ClusterStatusAutoGenerated status; + + /** + * Creates an instance of AwsEmrClusterSummaryProperties class. + */ + public AwsEmrClusterSummaryProperties() { + } + + /** + * Get the clusterArn property: <p>The Amazon Resource Name of the cluster.</p>. + * + * @return the clusterArn value. + */ + public String clusterArn() { + return this.clusterArn; + } + + /** + * Set the clusterArn property: <p>The Amazon Resource Name of the cluster.</p>. + * + * @param clusterArn the clusterArn value to set. + * @return the AwsEmrClusterSummaryProperties object itself. + */ + public AwsEmrClusterSummaryProperties withClusterArn(String clusterArn) { + this.clusterArn = clusterArn; + return this; + } + + /** + * Get the id property: <p>The unique identifier for the cluster.</p>. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Set the id property: <p>The unique identifier for the cluster.</p>. + * + * @param id the id value to set. + * @return the AwsEmrClusterSummaryProperties object itself. + */ + public AwsEmrClusterSummaryProperties withId(String id) { + this.id = id; + return this; + } + + /** + * Get the name property: <p>The name of the cluster.</p>. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: <p>The name of the cluster.</p>. + * + * @param name the name value to set. + * @return the AwsEmrClusterSummaryProperties object itself. + */ + public AwsEmrClusterSummaryProperties withName(String name) { + this.name = name; + return this; + } + + /** + * Get the normalizedInstanceHours property: <p>An approximation of the cost of the cluster, represented in + * m1.small/hours. This value is incremented one time for every hour an m1.small instance runs. Larger instances are + * weighted more, so an Amazon EC2 instance that is roughly four times more expensive would result in the normalized + * instance hours being incremented by four. This result is only an approximation and does not reflect the actual + * billing rate.</p>. + * + * @return the normalizedInstanceHours value. + */ + public Integer normalizedInstanceHours() { + return this.normalizedInstanceHours; + } + + /** + * Set the normalizedInstanceHours property: <p>An approximation of the cost of the cluster, represented in + * m1.small/hours. This value is incremented one time for every hour an m1.small instance runs. Larger instances are + * weighted more, so an Amazon EC2 instance that is roughly four times more expensive would result in the normalized + * instance hours being incremented by four. This result is only an approximation and does not reflect the actual + * billing rate.</p>. + * + * @param normalizedInstanceHours the normalizedInstanceHours value to set. + * @return the AwsEmrClusterSummaryProperties object itself. + */ + public AwsEmrClusterSummaryProperties withNormalizedInstanceHours(Integer normalizedInstanceHours) { + this.normalizedInstanceHours = normalizedInstanceHours; + return this; + } + + /** + * Get the outpostArn property: <p> The Amazon Resource Name (ARN) of the Outpost where the cluster is + * launched. </p>. + * + * @return the outpostArn value. + */ + public String outpostArn() { + return this.outpostArn; + } + + /** + * Set the outpostArn property: <p> The Amazon Resource Name (ARN) of the Outpost where the cluster is + * launched. </p>. + * + * @param outpostArn the outpostArn value to set. + * @return the AwsEmrClusterSummaryProperties object itself. + */ + public AwsEmrClusterSummaryProperties withOutpostArn(String outpostArn) { + this.outpostArn = outpostArn; + return this; + } + + /** + * Get the status property: <p>The details about the current status of the cluster.</p>. + * + * @return the status value. + */ + public ClusterStatusAutoGenerated status() { + return this.status; + } + + /** + * Set the status property: <p>The details about the current status of the cluster.</p>. + * + * @param status the status value to set. + * @return the AwsEmrClusterSummaryProperties object itself. + */ + public AwsEmrClusterSummaryProperties withStatus(ClusterStatusAutoGenerated status) { + this.status = status; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (status() != null) { + status().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("clusterArn", this.clusterArn); + jsonWriter.writeStringField("id", this.id); + jsonWriter.writeStringField("name", this.name); + jsonWriter.writeNumberField("normalizedInstanceHours", this.normalizedInstanceHours); + jsonWriter.writeStringField("outpostArn", this.outpostArn); + jsonWriter.writeJsonField("status", this.status); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AwsEmrClusterSummaryProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AwsEmrClusterSummaryProperties if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the AwsEmrClusterSummaryProperties. + */ + public static AwsEmrClusterSummaryProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AwsEmrClusterSummaryProperties deserializedAwsEmrClusterSummaryProperties + = new AwsEmrClusterSummaryProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("clusterArn".equals(fieldName)) { + deserializedAwsEmrClusterSummaryProperties.clusterArn = reader.getString(); + } else if ("id".equals(fieldName)) { + deserializedAwsEmrClusterSummaryProperties.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedAwsEmrClusterSummaryProperties.name = reader.getString(); + } else if ("normalizedInstanceHours".equals(fieldName)) { + deserializedAwsEmrClusterSummaryProperties.normalizedInstanceHours + = reader.getNullable(JsonReader::getInt); + } else if ("outpostArn".equals(fieldName)) { + deserializedAwsEmrClusterSummaryProperties.outpostArn = reader.getString(); + } else if ("status".equals(fieldName)) { + deserializedAwsEmrClusterSummaryProperties.status = ClusterStatusAutoGenerated.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedAwsEmrClusterSummaryProperties; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/AwsGuardDutyDetectorProperties.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/AwsGuardDutyDetectorProperties.java new file mode 100644 index 000000000000..20e2288be75b --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/AwsGuardDutyDetectorProperties.java @@ -0,0 +1,248 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Definition of awsGuardDutyDetector. + */ +@Fluent +public final class AwsGuardDutyDetectorProperties implements JsonSerializable { + /* + * Property dataSources + */ + private CfnDataSourceConfigurations dataSources; + + /* + * Property enable + */ + private Boolean enable; + + /* + * Property features + */ + private List features; + + /* + * Property findingPublishingFrequency + */ + private String findingPublishingFrequency; + + /* + * Property id + */ + private String id; + + /* + * Property tags + */ + private List tags; + + /** + * Creates an instance of AwsGuardDutyDetectorProperties class. + */ + public AwsGuardDutyDetectorProperties() { + } + + /** + * Get the dataSources property: Property dataSources. + * + * @return the dataSources value. + */ + public CfnDataSourceConfigurations dataSources() { + return this.dataSources; + } + + /** + * Set the dataSources property: Property dataSources. + * + * @param dataSources the dataSources value to set. + * @return the AwsGuardDutyDetectorProperties object itself. + */ + public AwsGuardDutyDetectorProperties withDataSources(CfnDataSourceConfigurations dataSources) { + this.dataSources = dataSources; + return this; + } + + /** + * Get the enable property: Property enable. + * + * @return the enable value. + */ + public Boolean enable() { + return this.enable; + } + + /** + * Set the enable property: Property enable. + * + * @param enable the enable value to set. + * @return the AwsGuardDutyDetectorProperties object itself. + */ + public AwsGuardDutyDetectorProperties withEnable(Boolean enable) { + this.enable = enable; + return this; + } + + /** + * Get the features property: Property features. + * + * @return the features value. + */ + public List features() { + return this.features; + } + + /** + * Set the features property: Property features. + * + * @param features the features value to set. + * @return the AwsGuardDutyDetectorProperties object itself. + */ + public AwsGuardDutyDetectorProperties withFeatures(List features) { + this.features = features; + return this; + } + + /** + * Get the findingPublishingFrequency property: Property findingPublishingFrequency. + * + * @return the findingPublishingFrequency value. + */ + public String findingPublishingFrequency() { + return this.findingPublishingFrequency; + } + + /** + * Set the findingPublishingFrequency property: Property findingPublishingFrequency. + * + * @param findingPublishingFrequency the findingPublishingFrequency value to set. + * @return the AwsGuardDutyDetectorProperties object itself. + */ + public AwsGuardDutyDetectorProperties withFindingPublishingFrequency(String findingPublishingFrequency) { + this.findingPublishingFrequency = findingPublishingFrequency; + return this; + } + + /** + * Get the id property: Property id. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Set the id property: Property id. + * + * @param id the id value to set. + * @return the AwsGuardDutyDetectorProperties object itself. + */ + public AwsGuardDutyDetectorProperties withId(String id) { + this.id = id; + return this; + } + + /** + * Get the tags property: Property tags. + * + * @return the tags value. + */ + public List tags() { + return this.tags; + } + + /** + * Set the tags property: Property tags. + * + * @param tags the tags value to set. + * @return the AwsGuardDutyDetectorProperties object itself. + */ + public AwsGuardDutyDetectorProperties withTags(List tags) { + this.tags = tags; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (dataSources() != null) { + dataSources().validate(); + } + if (features() != null) { + features().forEach(e -> e.validate()); + } + if (tags() != null) { + tags().forEach(e -> e.validate()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("dataSources", this.dataSources); + jsonWriter.writeBooleanField("enable", this.enable); + jsonWriter.writeArrayField("features", this.features, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("findingPublishingFrequency", this.findingPublishingFrequency); + jsonWriter.writeStringField("id", this.id); + jsonWriter.writeArrayField("tags", this.tags, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AwsGuardDutyDetectorProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AwsGuardDutyDetectorProperties if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the AwsGuardDutyDetectorProperties. + */ + public static AwsGuardDutyDetectorProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AwsGuardDutyDetectorProperties deserializedAwsGuardDutyDetectorProperties + = new AwsGuardDutyDetectorProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("dataSources".equals(fieldName)) { + deserializedAwsGuardDutyDetectorProperties.dataSources + = CfnDataSourceConfigurations.fromJson(reader); + } else if ("enable".equals(fieldName)) { + deserializedAwsGuardDutyDetectorProperties.enable = reader.getNullable(JsonReader::getBoolean); + } else if ("features".equals(fieldName)) { + List features + = reader.readArray(reader1 -> CfnFeatureConfiguration.fromJson(reader1)); + deserializedAwsGuardDutyDetectorProperties.features = features; + } else if ("findingPublishingFrequency".equals(fieldName)) { + deserializedAwsGuardDutyDetectorProperties.findingPublishingFrequency = reader.getString(); + } else if ("id".equals(fieldName)) { + deserializedAwsGuardDutyDetectorProperties.id = reader.getString(); + } else if ("tags".equals(fieldName)) { + List tags = reader.readArray(reader1 -> TagItem.fromJson(reader1)); + deserializedAwsGuardDutyDetectorProperties.tags = tags; + } else { + reader.skipChildren(); + } + } + + return deserializedAwsGuardDutyDetectorProperties; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/AwsIamAccessKeyLastUsedProperties.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/AwsIamAccessKeyLastUsedProperties.java new file mode 100644 index 000000000000..ae00a7ecc79c --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/AwsIamAccessKeyLastUsedProperties.java @@ -0,0 +1,196 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.time.OffsetDateTime; +import java.time.format.DateTimeFormatter; + +/** + * Definition of awsIamAccessKeyLastUsed. + */ +@Fluent +public final class AwsIamAccessKeyLastUsedProperties implements JsonSerializable { + /* + *

The date and time, in ISO 8601 date-time format, when the access + * key was most recently used. This field is null in the following situations:

  • The user does not + * have an access key.

  • An access key exists but has not been used since IAM began tracking this + * information.

  • There is no sign-in data associated with the user.

+ */ + private OffsetDateTime lastUsedDate; + + /* + *

The Amazon Web Services Region where this access key was most recently used. The value for this field is 'N/A' + * in the following situations:

  • The user does not have an access key.

  • An access + * key exists but has not been used since IAM began tracking this information.

  • There is no sign-in + * data associated with the user.

For more information about Amazon Web Services Regions, see Regions and endpoints in the Amazon Web + * Services General Reference.

+ */ + private String region; + + /* + *

The name of the Amazon Web Services service with which this access key was most recently used. The value of + * this field is 'N/A' in the following situations:

  • The user does not have an access key.

  • + *
  • An access key exists but has not been used since IAM started tracking this information.

  • + *

    There is no sign-in data associated with the user.

+ */ + private String serviceName; + + /** + * Creates an instance of AwsIamAccessKeyLastUsedProperties class. + */ + public AwsIamAccessKeyLastUsedProperties() { + } + + /** + * Get the lastUsedDate property: <p>The date and time, in <a href='http://www.iso.org/iso/iso8601'>ISO + * 8601 date-time format</a>, when the access key was most recently used. This field is null in the following + * situations:</p> <ul> <li> <p>The user does not have an access key.</p> </li> + * <li> <p>An access key exists but has not been used since IAM began tracking this + * information.</p> </li> <li> <p>There is no sign-in data associated with the + * user.</p> </li> </ul>. + * + * @return the lastUsedDate value. + */ + public OffsetDateTime lastUsedDate() { + return this.lastUsedDate; + } + + /** + * Set the lastUsedDate property: <p>The date and time, in <a href='http://www.iso.org/iso/iso8601'>ISO + * 8601 date-time format</a>, when the access key was most recently used. This field is null in the following + * situations:</p> <ul> <li> <p>The user does not have an access key.</p> </li> + * <li> <p>An access key exists but has not been used since IAM began tracking this + * information.</p> </li> <li> <p>There is no sign-in data associated with the + * user.</p> </li> </ul>. + * + * @param lastUsedDate the lastUsedDate value to set. + * @return the AwsIamAccessKeyLastUsedProperties object itself. + */ + public AwsIamAccessKeyLastUsedProperties withLastUsedDate(OffsetDateTime lastUsedDate) { + this.lastUsedDate = lastUsedDate; + return this; + } + + /** + * Get the region property: <p>The Amazon Web Services Region where this access key was most recently used. + * The value for this field is 'N/A' in the following situations:</p> <ul> <li> <p>The user + * does not have an access key.</p> </li> <li> <p>An access key exists but has not been used + * since IAM began tracking this information.</p> </li> <li> <p>There is no sign-in data + * associated with the user.</p> </li> </ul> <p>For more information about Amazon Web + * Services Regions, see <a href='https://docs.aws.amazon.com/general/latest/gr/rande.html'>Regions and + * endpoints</a> in the Amazon Web Services General Reference.</p>. + * + * @return the region value. + */ + public String region() { + return this.region; + } + + /** + * Set the region property: <p>The Amazon Web Services Region where this access key was most recently used. + * The value for this field is 'N/A' in the following situations:</p> <ul> <li> <p>The user + * does not have an access key.</p> </li> <li> <p>An access key exists but has not been used + * since IAM began tracking this information.</p> </li> <li> <p>There is no sign-in data + * associated with the user.</p> </li> </ul> <p>For more information about Amazon Web + * Services Regions, see <a href='https://docs.aws.amazon.com/general/latest/gr/rande.html'>Regions and + * endpoints</a> in the Amazon Web Services General Reference.</p>. + * + * @param region the region value to set. + * @return the AwsIamAccessKeyLastUsedProperties object itself. + */ + public AwsIamAccessKeyLastUsedProperties withRegion(String region) { + this.region = region; + return this; + } + + /** + * Get the serviceName property: <p>The name of the Amazon Web Services service with which this access key was + * most recently used. The value of this field is 'N/A' in the following situations:</p> <ul> <li> + * <p>The user does not have an access key.</p> </li> <li> <p>An access key exists but + * has not been used since IAM started tracking this information.</p> </li> <li> <p>There is + * no sign-in data associated with the user.</p> </li> </ul>. + * + * @return the serviceName value. + */ + public String serviceName() { + return this.serviceName; + } + + /** + * Set the serviceName property: <p>The name of the Amazon Web Services service with which this access key was + * most recently used. The value of this field is 'N/A' in the following situations:</p> <ul> <li> + * <p>The user does not have an access key.</p> </li> <li> <p>An access key exists but + * has not been used since IAM started tracking this information.</p> </li> <li> <p>There is + * no sign-in data associated with the user.</p> </li> </ul>. + * + * @param serviceName the serviceName value to set. + * @return the AwsIamAccessKeyLastUsedProperties object itself. + */ + public AwsIamAccessKeyLastUsedProperties withServiceName(String serviceName) { + this.serviceName = serviceName; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("lastUsedDate", + this.lastUsedDate == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.lastUsedDate)); + jsonWriter.writeStringField("region", this.region); + jsonWriter.writeStringField("serviceName", this.serviceName); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AwsIamAccessKeyLastUsedProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AwsIamAccessKeyLastUsedProperties if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the AwsIamAccessKeyLastUsedProperties. + */ + public static AwsIamAccessKeyLastUsedProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AwsIamAccessKeyLastUsedProperties deserializedAwsIamAccessKeyLastUsedProperties + = new AwsIamAccessKeyLastUsedProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("lastUsedDate".equals(fieldName)) { + deserializedAwsIamAccessKeyLastUsedProperties.lastUsedDate = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("region".equals(fieldName)) { + deserializedAwsIamAccessKeyLastUsedProperties.region = reader.getString(); + } else if ("serviceName".equals(fieldName)) { + deserializedAwsIamAccessKeyLastUsedProperties.serviceName = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedAwsIamAccessKeyLastUsedProperties; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/AwsIamAccessKeyMetadataProperties.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/AwsIamAccessKeyMetadataProperties.java new file mode 100644 index 000000000000..df29b6f03c57 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/AwsIamAccessKeyMetadataProperties.java @@ -0,0 +1,190 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.time.OffsetDateTime; +import java.time.format.DateTimeFormatter; + +/** + * Definition of awsIamAccessKeyMetadata. + */ +@Fluent +public final class AwsIamAccessKeyMetadataProperties implements JsonSerializable { + /* + *

The ID for this access key.

+ */ + private String accessKeyId; + + /* + *

The date when the access key was created.

+ */ + private OffsetDateTime createDate; + + /* + *

The status of the access key. Active means that the key is valid for API calls; + * Inactive means it is not.

+ */ + private StatusTypeEnumValueAutoGenerated status; + + /* + *

The name of the IAM user that the key is associated with.

+ */ + private String username; + + /** + * Creates an instance of AwsIamAccessKeyMetadataProperties class. + */ + public AwsIamAccessKeyMetadataProperties() { + } + + /** + * Get the accessKeyId property: <p>The ID for this access key.</p>. + * + * @return the accessKeyId value. + */ + public String accessKeyId() { + return this.accessKeyId; + } + + /** + * Set the accessKeyId property: <p>The ID for this access key.</p>. + * + * @param accessKeyId the accessKeyId value to set. + * @return the AwsIamAccessKeyMetadataProperties object itself. + */ + public AwsIamAccessKeyMetadataProperties withAccessKeyId(String accessKeyId) { + this.accessKeyId = accessKeyId; + return this; + } + + /** + * Get the createDate property: <p>The date when the access key was created.</p>. + * + * @return the createDate value. + */ + public OffsetDateTime createDate() { + return this.createDate; + } + + /** + * Set the createDate property: <p>The date when the access key was created.</p>. + * + * @param createDate the createDate value to set. + * @return the AwsIamAccessKeyMetadataProperties object itself. + */ + public AwsIamAccessKeyMetadataProperties withCreateDate(OffsetDateTime createDate) { + this.createDate = createDate; + return this; + } + + /** + * Get the status property: <p>The status of the access key. <code>Active</code> means that the + * key is valid for API calls; <code>Inactive</code> means it is not.</p>. + * + * @return the status value. + */ + public StatusTypeEnumValueAutoGenerated status() { + return this.status; + } + + /** + * Set the status property: <p>The status of the access key. <code>Active</code> means that the + * key is valid for API calls; <code>Inactive</code> means it is not.</p>. + * + * @param status the status value to set. + * @return the AwsIamAccessKeyMetadataProperties object itself. + */ + public AwsIamAccessKeyMetadataProperties withStatus(StatusTypeEnumValueAutoGenerated status) { + this.status = status; + return this; + } + + /** + * Get the username property: <p>The name of the IAM user that the key is associated with.</p>. + * + * @return the username value. + */ + public String username() { + return this.username; + } + + /** + * Set the username property: <p>The name of the IAM user that the key is associated with.</p>. + * + * @param username the username value to set. + * @return the AwsIamAccessKeyMetadataProperties object itself. + */ + public AwsIamAccessKeyMetadataProperties withUsername(String username) { + this.username = username; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (status() != null) { + status().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("accessKeyId", this.accessKeyId); + jsonWriter.writeStringField("createDate", + this.createDate == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.createDate)); + jsonWriter.writeJsonField("status", this.status); + jsonWriter.writeStringField("userName", this.username); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AwsIamAccessKeyMetadataProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AwsIamAccessKeyMetadataProperties if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the AwsIamAccessKeyMetadataProperties. + */ + public static AwsIamAccessKeyMetadataProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AwsIamAccessKeyMetadataProperties deserializedAwsIamAccessKeyMetadataProperties + = new AwsIamAccessKeyMetadataProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("accessKeyId".equals(fieldName)) { + deserializedAwsIamAccessKeyMetadataProperties.accessKeyId = reader.getString(); + } else if ("createDate".equals(fieldName)) { + deserializedAwsIamAccessKeyMetadataProperties.createDate = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("status".equals(fieldName)) { + deserializedAwsIamAccessKeyMetadataProperties.status + = StatusTypeEnumValueAutoGenerated.fromJson(reader); + } else if ("userName".equals(fieldName)) { + deserializedAwsIamAccessKeyMetadataProperties.username = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedAwsIamAccessKeyMetadataProperties; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/AwsIamGroupProperties.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/AwsIamGroupProperties.java new file mode 100644 index 000000000000..0c1a73a22ff0 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/AwsIamGroupProperties.java @@ -0,0 +1,284 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Definition of awsIamGroup. + */ +@Fluent +public final class AwsIamGroupProperties implements JsonSerializable { + /* + * Property arn + */ + private String arn; + + /* + * The name of the group to create. Do not include the path in this value. The group name must be unique within the + * account. Group names are not distinguished by case. For example, you cannot create groups named both 'ADMINS' and + * 'admins'. If you don't specify a name, CFN generates a unique physical ID and uses that ID for the group name. If + * you specify a name, you cannot perform updates that require replacement of this resource. You can perform updates + * that require no or some interruption. If you must replace the resource, specify a new name. If you specify a + * name, you must specify the ``CAPABILITY_NAMED_IAM`` value to acknowledge your template's capabilities. For more + * information, see [Acknowledging Resources in + * Templates](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-iam-template.html#using-iam- + * capabilities). Naming an IAM resource can cause an unrecoverable error if you reuse the same template in multiple + * Regions. To prevent this, we recommend using ``Fn::Join`` and ``AWS::Region`` to create a Region-specific name, + * as in the following example: ``{'Fn::Join': ['', [{'Ref': 'AWS::Region'}, {'Ref': 'MyResourceName'}]]}``. + */ + private String groupName; + + /* + * The Amazon Resource Name (ARN) of the IAM policy you want to attach. For more information about ARNs, see [Amazon + * Resource Names (ARNs)](https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html) in the + * *General Reference*. + */ + private List managedPolicyArns; + + /* + * The path to the group. For more information about paths, see [IAM + * identifiers](https://docs.aws.amazon.com/IAM/latest/UserGuide/Using_Identifiers.html) in the *IAM User Guide*. + * This parameter is optional. If it is not included, it defaults to a slash (/). This parameter allows (through its + * [regex pattern](https://docs.aws.amazon.com/http://wikipedia.org/wiki/regex)) a string of characters consisting + * of either a forward slash (/) by itself or a string that must begin and end with forward slashes. In addition, it + * can contain any ASCII character from the ! (``\u0021``) through the DEL character (``\u007F``), including most + * punctuation characters, digits, and upper and lowercased letters. + */ + private String path; + + /* + * Adds or updates an inline policy document that is embedded in the specified IAM group. To view AWS::IAM::Group + * snippets, see [Declaring an Group + * Resource](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/quickref-iam.html#scenario-iam-group). + * The name of each inline policy for a role, user, or group must be unique. If you don't choose unique names, + * updates to the IAM identity will fail. For information about limits on the number of inline policies that you can + * embed in a group, see [Limitations on + * Entities](https://docs.aws.amazon.com/IAM/latest/UserGuide/LimitationsOnEntities.html) in the *User Guide*. + */ + private List policies; + + /** + * Creates an instance of AwsIamGroupProperties class. + */ + public AwsIamGroupProperties() { + } + + /** + * Get the arn property: Property arn. + * + * @return the arn value. + */ + public String arn() { + return this.arn; + } + + /** + * Set the arn property: Property arn. + * + * @param arn the arn value to set. + * @return the AwsIamGroupProperties object itself. + */ + public AwsIamGroupProperties withArn(String arn) { + this.arn = arn; + return this; + } + + /** + * Get the groupName property: The name of the group to create. Do not include the path in this value. The group + * name must be unique within the account. Group names are not distinguished by case. For example, you cannot create + * groups named both 'ADMINS' and 'admins'. If you don't specify a name, CFN generates a unique physical ID and uses + * that ID for the group name. If you specify a name, you cannot perform updates that require replacement of this + * resource. You can perform updates that require no or some interruption. If you must replace the resource, specify + * a new name. If you specify a name, you must specify the ``CAPABILITY_NAMED_IAM`` value to acknowledge your + * template's capabilities. For more information, see [Acknowledging Resources in + * Templates](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-iam-template.html#using-iam-capabilities). + * Naming an IAM resource can cause an unrecoverable error if you reuse the same template in multiple Regions. To + * prevent this, we recommend using ``Fn::Join`` and ``AWS::Region`` to create a Region-specific name, as in the + * following example: ``{'Fn::Join': ['', [{'Ref': 'AWS::Region'}, {'Ref': 'MyResourceName'}]]}``. + * + * @return the groupName value. + */ + public String groupName() { + return this.groupName; + } + + /** + * Set the groupName property: The name of the group to create. Do not include the path in this value. The group + * name must be unique within the account. Group names are not distinguished by case. For example, you cannot create + * groups named both 'ADMINS' and 'admins'. If you don't specify a name, CFN generates a unique physical ID and uses + * that ID for the group name. If you specify a name, you cannot perform updates that require replacement of this + * resource. You can perform updates that require no or some interruption. If you must replace the resource, specify + * a new name. If you specify a name, you must specify the ``CAPABILITY_NAMED_IAM`` value to acknowledge your + * template's capabilities. For more information, see [Acknowledging Resources in + * Templates](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-iam-template.html#using-iam-capabilities). + * Naming an IAM resource can cause an unrecoverable error if you reuse the same template in multiple Regions. To + * prevent this, we recommend using ``Fn::Join`` and ``AWS::Region`` to create a Region-specific name, as in the + * following example: ``{'Fn::Join': ['', [{'Ref': 'AWS::Region'}, {'Ref': 'MyResourceName'}]]}``. + * + * @param groupName the groupName value to set. + * @return the AwsIamGroupProperties object itself. + */ + public AwsIamGroupProperties withGroupName(String groupName) { + this.groupName = groupName; + return this; + } + + /** + * Get the managedPolicyArns property: The Amazon Resource Name (ARN) of the IAM policy you want to attach. For more + * information about ARNs, see [Amazon Resource Names + * (ARNs)](https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html) in the *General Reference*. + * + * @return the managedPolicyArns value. + */ + public List managedPolicyArns() { + return this.managedPolicyArns; + } + + /** + * Set the managedPolicyArns property: The Amazon Resource Name (ARN) of the IAM policy you want to attach. For more + * information about ARNs, see [Amazon Resource Names + * (ARNs)](https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html) in the *General Reference*. + * + * @param managedPolicyArns the managedPolicyArns value to set. + * @return the AwsIamGroupProperties object itself. + */ + public AwsIamGroupProperties withManagedPolicyArns(List managedPolicyArns) { + this.managedPolicyArns = managedPolicyArns; + return this; + } + + /** + * Get the path property: The path to the group. For more information about paths, see [IAM + * identifiers](https://docs.aws.amazon.com/IAM/latest/UserGuide/Using_Identifiers.html) in the *IAM User Guide*. + * This parameter is optional. If it is not included, it defaults to a slash (/). This parameter allows (through its + * [regex pattern](https://docs.aws.amazon.com/http://wikipedia.org/wiki/regex)) a string of characters consisting + * of either a forward slash (/) by itself or a string that must begin and end with forward slashes. In addition, it + * can contain any ASCII character from the ! (``\u0021``) through the DEL character (``\u007F``), including most + * punctuation characters, digits, and upper and lowercased letters. + * + * @return the path value. + */ + public String path() { + return this.path; + } + + /** + * Set the path property: The path to the group. For more information about paths, see [IAM + * identifiers](https://docs.aws.amazon.com/IAM/latest/UserGuide/Using_Identifiers.html) in the *IAM User Guide*. + * This parameter is optional. If it is not included, it defaults to a slash (/). This parameter allows (through its + * [regex pattern](https://docs.aws.amazon.com/http://wikipedia.org/wiki/regex)) a string of characters consisting + * of either a forward slash (/) by itself or a string that must begin and end with forward slashes. In addition, it + * can contain any ASCII character from the ! (``\u0021``) through the DEL character (``\u007F``), including most + * punctuation characters, digits, and upper and lowercased letters. + * + * @param path the path value to set. + * @return the AwsIamGroupProperties object itself. + */ + public AwsIamGroupProperties withPath(String path) { + this.path = path; + return this; + } + + /** + * Get the policies property: Adds or updates an inline policy document that is embedded in the specified IAM group. + * To view AWS::IAM::Group snippets, see [Declaring an Group + * Resource](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/quickref-iam.html#scenario-iam-group). + * The name of each inline policy for a role, user, or group must be unique. If you don't choose unique names, + * updates to the IAM identity will fail. For information about limits on the number of inline policies that you can + * embed in a group, see [Limitations on + * Entities](https://docs.aws.amazon.com/IAM/latest/UserGuide/LimitationsOnEntities.html) in the *User Guide*. + * + * @return the policies value. + */ + public List policies() { + return this.policies; + } + + /** + * Set the policies property: Adds or updates an inline policy document that is embedded in the specified IAM group. + * To view AWS::IAM::Group snippets, see [Declaring an Group + * Resource](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/quickref-iam.html#scenario-iam-group). + * The name of each inline policy for a role, user, or group must be unique. If you don't choose unique names, + * updates to the IAM identity will fail. For information about limits on the number of inline policies that you can + * embed in a group, see [Limitations on + * Entities](https://docs.aws.amazon.com/IAM/latest/UserGuide/LimitationsOnEntities.html) in the *User Guide*. + * + * @param policies the policies value to set. + * @return the AwsIamGroupProperties object itself. + */ + public AwsIamGroupProperties withPolicies(List policies) { + this.policies = policies; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (policies() != null) { + policies().forEach(e -> e.validate()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("arn", this.arn); + jsonWriter.writeStringField("groupName", this.groupName); + jsonWriter.writeArrayField("managedPolicyArns", this.managedPolicyArns, + (writer, element) -> writer.writeString(element)); + jsonWriter.writeStringField("path", this.path); + jsonWriter.writeArrayField("policies", this.policies, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AwsIamGroupProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AwsIamGroupProperties if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the AwsIamGroupProperties. + */ + public static AwsIamGroupProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AwsIamGroupProperties deserializedAwsIamGroupProperties = new AwsIamGroupProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("arn".equals(fieldName)) { + deserializedAwsIamGroupProperties.arn = reader.getString(); + } else if ("groupName".equals(fieldName)) { + deserializedAwsIamGroupProperties.groupName = reader.getString(); + } else if ("managedPolicyArns".equals(fieldName)) { + List managedPolicyArns = reader.readArray(reader1 -> reader1.getString()); + deserializedAwsIamGroupProperties.managedPolicyArns = managedPolicyArns; + } else if ("path".equals(fieldName)) { + deserializedAwsIamGroupProperties.path = reader.getString(); + } else if ("policies".equals(fieldName)) { + List policies = reader.readArray(reader1 -> Policy.fromJson(reader1)); + deserializedAwsIamGroupProperties.policies = policies; + } else { + reader.skipChildren(); + } + } + + return deserializedAwsIamGroupProperties; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/AwsIamInstanceProfileProperties.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/AwsIamInstanceProfileProperties.java new file mode 100644 index 000000000000..80072a60486b --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/AwsIamInstanceProfileProperties.java @@ -0,0 +1,210 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Definition of awsIamInstanceProfile. + */ +@Fluent +public final class AwsIamInstanceProfileProperties implements JsonSerializable { + /* + * Property arn + */ + private String arn; + + /* + * The name of the instance profile to create. This parameter allows (through its [regex + * pattern](https://docs.aws.amazon.com/http://wikipedia.org/wiki/regex)) a string of characters consisting of upper + * and lowercase alphanumeric characters with no spaces. You can also include any of the following characters: + * _+=,.@- + */ + private String instanceProfileName; + + /* + * The path to the instance profile. For more information about paths, see [IAM + * Identifiers](https://docs.aws.amazon.com/IAM/latest/UserGuide/Using_Identifiers.html) in the *IAM User Guide*. + * This parameter is optional. If it is not included, it defaults to a slash (/). This parameter allows (through its + * [regex pattern](https://docs.aws.amazon.com/http://wikipedia.org/wiki/regex)) a string of characters consisting + * of either a forward slash (/) by itself or a string that must begin and end with forward slashes. In addition, it + * can contain any ASCII character from the ! (``\u0021``) through the DEL character (``\u007F``), including most + * punctuation characters, digits, and upper and lowercased letters. + */ + private String path; + + /* + * The name of the role to associate with the instance profile. Only one role can be assigned to an EC2 instance at + * a time, and all applications on the instance share the same role and permissions. + */ + private List roles; + + /** + * Creates an instance of AwsIamInstanceProfileProperties class. + */ + public AwsIamInstanceProfileProperties() { + } + + /** + * Get the arn property: Property arn. + * + * @return the arn value. + */ + public String arn() { + return this.arn; + } + + /** + * Set the arn property: Property arn. + * + * @param arn the arn value to set. + * @return the AwsIamInstanceProfileProperties object itself. + */ + public AwsIamInstanceProfileProperties withArn(String arn) { + this.arn = arn; + return this; + } + + /** + * Get the instanceProfileName property: The name of the instance profile to create. This parameter allows (through + * its [regex pattern](https://docs.aws.amazon.com/http://wikipedia.org/wiki/regex)) a string of characters + * consisting of upper and lowercase alphanumeric characters with no spaces. You can also include any of the + * following characters: _+=,.@-. + * + * @return the instanceProfileName value. + */ + public String instanceProfileName() { + return this.instanceProfileName; + } + + /** + * Set the instanceProfileName property: The name of the instance profile to create. This parameter allows (through + * its [regex pattern](https://docs.aws.amazon.com/http://wikipedia.org/wiki/regex)) a string of characters + * consisting of upper and lowercase alphanumeric characters with no spaces. You can also include any of the + * following characters: _+=,.@-. + * + * @param instanceProfileName the instanceProfileName value to set. + * @return the AwsIamInstanceProfileProperties object itself. + */ + public AwsIamInstanceProfileProperties withInstanceProfileName(String instanceProfileName) { + this.instanceProfileName = instanceProfileName; + return this; + } + + /** + * Get the path property: The path to the instance profile. For more information about paths, see [IAM + * Identifiers](https://docs.aws.amazon.com/IAM/latest/UserGuide/Using_Identifiers.html) in the *IAM User Guide*. + * This parameter is optional. If it is not included, it defaults to a slash (/). This parameter allows (through its + * [regex pattern](https://docs.aws.amazon.com/http://wikipedia.org/wiki/regex)) a string of characters consisting + * of either a forward slash (/) by itself or a string that must begin and end with forward slashes. In addition, it + * can contain any ASCII character from the ! (``\u0021``) through the DEL character (``\u007F``), including most + * punctuation characters, digits, and upper and lowercased letters. + * + * @return the path value. + */ + public String path() { + return this.path; + } + + /** + * Set the path property: The path to the instance profile. For more information about paths, see [IAM + * Identifiers](https://docs.aws.amazon.com/IAM/latest/UserGuide/Using_Identifiers.html) in the *IAM User Guide*. + * This parameter is optional. If it is not included, it defaults to a slash (/). This parameter allows (through its + * [regex pattern](https://docs.aws.amazon.com/http://wikipedia.org/wiki/regex)) a string of characters consisting + * of either a forward slash (/) by itself or a string that must begin and end with forward slashes. In addition, it + * can contain any ASCII character from the ! (``\u0021``) through the DEL character (``\u007F``), including most + * punctuation characters, digits, and upper and lowercased letters. + * + * @param path the path value to set. + * @return the AwsIamInstanceProfileProperties object itself. + */ + public AwsIamInstanceProfileProperties withPath(String path) { + this.path = path; + return this; + } + + /** + * Get the roles property: The name of the role to associate with the instance profile. Only one role can be + * assigned to an EC2 instance at a time, and all applications on the instance share the same role and permissions. + * + * @return the roles value. + */ + public List roles() { + return this.roles; + } + + /** + * Set the roles property: The name of the role to associate with the instance profile. Only one role can be + * assigned to an EC2 instance at a time, and all applications on the instance share the same role and permissions. + * + * @param roles the roles value to set. + * @return the AwsIamInstanceProfileProperties object itself. + */ + public AwsIamInstanceProfileProperties withRoles(List roles) { + this.roles = roles; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("arn", this.arn); + jsonWriter.writeStringField("instanceProfileName", this.instanceProfileName); + jsonWriter.writeStringField("path", this.path); + jsonWriter.writeArrayField("roles", this.roles, (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AwsIamInstanceProfileProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AwsIamInstanceProfileProperties if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the AwsIamInstanceProfileProperties. + */ + public static AwsIamInstanceProfileProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AwsIamInstanceProfileProperties deserializedAwsIamInstanceProfileProperties + = new AwsIamInstanceProfileProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("arn".equals(fieldName)) { + deserializedAwsIamInstanceProfileProperties.arn = reader.getString(); + } else if ("instanceProfileName".equals(fieldName)) { + deserializedAwsIamInstanceProfileProperties.instanceProfileName = reader.getString(); + } else if ("path".equals(fieldName)) { + deserializedAwsIamInstanceProfileProperties.path = reader.getString(); + } else if ("roles".equals(fieldName)) { + List roles = reader.readArray(reader1 -> reader1.getString()); + deserializedAwsIamInstanceProfileProperties.roles = roles; + } else { + reader.skipChildren(); + } + } + + return deserializedAwsIamInstanceProfileProperties; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/AwsIamMfaDeviceProperties.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/AwsIamMfaDeviceProperties.java new file mode 100644 index 000000000000..8e19ef7cdf92 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/AwsIamMfaDeviceProperties.java @@ -0,0 +1,157 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.time.OffsetDateTime; +import java.time.format.DateTimeFormatter; + +/** + * Definition of awsIamMFADevice. + */ +@Fluent +public final class AwsIamMfaDeviceProperties implements JsonSerializable { + /* + *

The date when the MFA device was enabled for the user.

+ */ + private OffsetDateTime enableDate; + + /* + *

The serial number that uniquely identifies the MFA device. For virtual MFA devices, the serial number is the + * device ARN.

+ */ + private String serialNumber; + + /* + *

The user with whom the MFA device is associated.

+ */ + private String username; + + /** + * Creates an instance of AwsIamMfaDeviceProperties class. + */ + public AwsIamMfaDeviceProperties() { + } + + /** + * Get the enableDate property: <p>The date when the MFA device was enabled for the user.</p>. + * + * @return the enableDate value. + */ + public OffsetDateTime enableDate() { + return this.enableDate; + } + + /** + * Set the enableDate property: <p>The date when the MFA device was enabled for the user.</p>. + * + * @param enableDate the enableDate value to set. + * @return the AwsIamMfaDeviceProperties object itself. + */ + public AwsIamMfaDeviceProperties withEnableDate(OffsetDateTime enableDate) { + this.enableDate = enableDate; + return this; + } + + /** + * Get the serialNumber property: <p>The serial number that uniquely identifies the MFA device. For virtual + * MFA devices, the serial number is the device ARN.</p>. + * + * @return the serialNumber value. + */ + public String serialNumber() { + return this.serialNumber; + } + + /** + * Set the serialNumber property: <p>The serial number that uniquely identifies the MFA device. For virtual + * MFA devices, the serial number is the device ARN.</p>. + * + * @param serialNumber the serialNumber value to set. + * @return the AwsIamMfaDeviceProperties object itself. + */ + public AwsIamMfaDeviceProperties withSerialNumber(String serialNumber) { + this.serialNumber = serialNumber; + return this; + } + + /** + * Get the username property: <p>The user with whom the MFA device is associated.</p>. + * + * @return the username value. + */ + public String username() { + return this.username; + } + + /** + * Set the username property: <p>The user with whom the MFA device is associated.</p>. + * + * @param username the username value to set. + * @return the AwsIamMfaDeviceProperties object itself. + */ + public AwsIamMfaDeviceProperties withUsername(String username) { + this.username = username; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("enableDate", + this.enableDate == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.enableDate)); + jsonWriter.writeStringField("serialNumber", this.serialNumber); + jsonWriter.writeStringField("userName", this.username); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AwsIamMfaDeviceProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AwsIamMfaDeviceProperties if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IOException If an error occurs while reading the AwsIamMfaDeviceProperties. + */ + public static AwsIamMfaDeviceProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AwsIamMfaDeviceProperties deserializedAwsIamMfaDeviceProperties = new AwsIamMfaDeviceProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("enableDate".equals(fieldName)) { + deserializedAwsIamMfaDeviceProperties.enableDate = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("serialNumber".equals(fieldName)) { + deserializedAwsIamMfaDeviceProperties.serialNumber = reader.getString(); + } else if ("userName".equals(fieldName)) { + deserializedAwsIamMfaDeviceProperties.username = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedAwsIamMfaDeviceProperties; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/AwsIamPasswordPolicyProperties.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/AwsIamPasswordPolicyProperties.java new file mode 100644 index 000000000000..328f8195e385 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/AwsIamPasswordPolicyProperties.java @@ -0,0 +1,388 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of awsIamPasswordPolicy. + */ +@Fluent +public final class AwsIamPasswordPolicyProperties implements JsonSerializable { + /* + *

Specifies whether IAM users are allowed to change their own password. Gives IAM users permissions to + * iam:ChangePassword for only their user and to the iam:GetAccountPasswordPolicy action. + * This option does not attach a permissions policy to each user, rather the permissions are applied at the + * account-level for all users by IAM.

+ */ + private Boolean allowUsersToChangePassword; + + /* + *

Indicates whether passwords in the account expire. Returns true if MaxPasswordAge contains a + * value greater than 0. Returns false if MaxPasswordAge is 0 or not present.

+ */ + private Boolean expirePasswords; + + /* + *

Specifies whether IAM users are prevented from setting a new password via the Amazon Web Services Management + * Console after their password has expired. The IAM user cannot access the console until an administrator resets + * the password. IAM users with iam:ChangePassword permission and active access keys can reset their + * own expired console password using the CLI or API.

+ */ + private Boolean hardExpiry; + + /* + *

The number of days that an IAM user password is valid.

+ */ + private Integer maxPasswordAge; + + /* + *

Minimum length to require for IAM user passwords.

+ */ + private Integer minimumPasswordLength; + + /* + *

Specifies the number of previous passwords that IAM users are prevented from reusing.

+ */ + private Integer passwordReusePrevention; + + /* + *

Specifies whether IAM user passwords must contain at least one lowercase character (a to z).

+ */ + private Boolean requireLowercaseCharacters; + + /* + *

Specifies whether IAM user passwords must contain at least one numeric character (0 to 9).

+ */ + private Boolean requireNumbers; + + /* + *

Specifies whether IAM user passwords must contain at least one of the following symbols:

! @ # $ % ^ + * & * ( ) _ + - = [ ] { } | '

+ */ + private Boolean requireSymbols; + + /* + *

Specifies whether IAM user passwords must contain at least one uppercase character (A to Z).

+ */ + private Boolean requireUppercaseCharacters; + + /** + * Creates an instance of AwsIamPasswordPolicyProperties class. + */ + public AwsIamPasswordPolicyProperties() { + } + + /** + * Get the allowUsersToChangePassword property: <p>Specifies whether IAM users are allowed to change their own + * password. Gives IAM users permissions to <code>iam:ChangePassword</code> for only their user and to + * the <code>iam:GetAccountPasswordPolicy</code> action. This option does not attach a permissions + * policy to each user, rather the permissions are applied at the account-level for all users by IAM.</p>. + * + * @return the allowUsersToChangePassword value. + */ + public Boolean allowUsersToChangePassword() { + return this.allowUsersToChangePassword; + } + + /** + * Set the allowUsersToChangePassword property: <p>Specifies whether IAM users are allowed to change their own + * password. Gives IAM users permissions to <code>iam:ChangePassword</code> for only their user and to + * the <code>iam:GetAccountPasswordPolicy</code> action. This option does not attach a permissions + * policy to each user, rather the permissions are applied at the account-level for all users by IAM.</p>. + * + * @param allowUsersToChangePassword the allowUsersToChangePassword value to set. + * @return the AwsIamPasswordPolicyProperties object itself. + */ + public AwsIamPasswordPolicyProperties withAllowUsersToChangePassword(Boolean allowUsersToChangePassword) { + this.allowUsersToChangePassword = allowUsersToChangePassword; + return this; + } + + /** + * Get the expirePasswords property: <p>Indicates whether passwords in the account expire. Returns true if + * <code>MaxPasswordAge</code> contains a value greater than 0. Returns false if MaxPasswordAge is 0 or + * not present.</p>. + * + * @return the expirePasswords value. + */ + public Boolean expirePasswords() { + return this.expirePasswords; + } + + /** + * Set the expirePasswords property: <p>Indicates whether passwords in the account expire. Returns true if + * <code>MaxPasswordAge</code> contains a value greater than 0. Returns false if MaxPasswordAge is 0 or + * not present.</p>. + * + * @param expirePasswords the expirePasswords value to set. + * @return the AwsIamPasswordPolicyProperties object itself. + */ + public AwsIamPasswordPolicyProperties withExpirePasswords(Boolean expirePasswords) { + this.expirePasswords = expirePasswords; + return this; + } + + /** + * Get the hardExpiry property: <p>Specifies whether IAM users are prevented from setting a new password via + * the Amazon Web Services Management Console after their password has expired. The IAM user cannot access the + * console until an administrator resets the password. IAM users with <code>iam:ChangePassword</code> + * permission and active access keys can reset their own expired console password using the CLI or API.</p>. + * + * @return the hardExpiry value. + */ + public Boolean hardExpiry() { + return this.hardExpiry; + } + + /** + * Set the hardExpiry property: <p>Specifies whether IAM users are prevented from setting a new password via + * the Amazon Web Services Management Console after their password has expired. The IAM user cannot access the + * console until an administrator resets the password. IAM users with <code>iam:ChangePassword</code> + * permission and active access keys can reset their own expired console password using the CLI or API.</p>. + * + * @param hardExpiry the hardExpiry value to set. + * @return the AwsIamPasswordPolicyProperties object itself. + */ + public AwsIamPasswordPolicyProperties withHardExpiry(Boolean hardExpiry) { + this.hardExpiry = hardExpiry; + return this; + } + + /** + * Get the maxPasswordAge property: <p>The number of days that an IAM user password is valid.</p>. + * + * @return the maxPasswordAge value. + */ + public Integer maxPasswordAge() { + return this.maxPasswordAge; + } + + /** + * Set the maxPasswordAge property: <p>The number of days that an IAM user password is valid.</p>. + * + * @param maxPasswordAge the maxPasswordAge value to set. + * @return the AwsIamPasswordPolicyProperties object itself. + */ + public AwsIamPasswordPolicyProperties withMaxPasswordAge(Integer maxPasswordAge) { + this.maxPasswordAge = maxPasswordAge; + return this; + } + + /** + * Get the minimumPasswordLength property: <p>Minimum length to require for IAM user passwords.</p>. + * + * @return the minimumPasswordLength value. + */ + public Integer minimumPasswordLength() { + return this.minimumPasswordLength; + } + + /** + * Set the minimumPasswordLength property: <p>Minimum length to require for IAM user passwords.</p>. + * + * @param minimumPasswordLength the minimumPasswordLength value to set. + * @return the AwsIamPasswordPolicyProperties object itself. + */ + public AwsIamPasswordPolicyProperties withMinimumPasswordLength(Integer minimumPasswordLength) { + this.minimumPasswordLength = minimumPasswordLength; + return this; + } + + /** + * Get the passwordReusePrevention property: <p>Specifies the number of previous passwords that IAM users are + * prevented from reusing.</p>. + * + * @return the passwordReusePrevention value. + */ + public Integer passwordReusePrevention() { + return this.passwordReusePrevention; + } + + /** + * Set the passwordReusePrevention property: <p>Specifies the number of previous passwords that IAM users are + * prevented from reusing.</p>. + * + * @param passwordReusePrevention the passwordReusePrevention value to set. + * @return the AwsIamPasswordPolicyProperties object itself. + */ + public AwsIamPasswordPolicyProperties withPasswordReusePrevention(Integer passwordReusePrevention) { + this.passwordReusePrevention = passwordReusePrevention; + return this; + } + + /** + * Get the requireLowercaseCharacters property: <p>Specifies whether IAM user passwords must contain at least + * one lowercase character (a to z).</p>. + * + * @return the requireLowercaseCharacters value. + */ + public Boolean requireLowercaseCharacters() { + return this.requireLowercaseCharacters; + } + + /** + * Set the requireLowercaseCharacters property: <p>Specifies whether IAM user passwords must contain at least + * one lowercase character (a to z).</p>. + * + * @param requireLowercaseCharacters the requireLowercaseCharacters value to set. + * @return the AwsIamPasswordPolicyProperties object itself. + */ + public AwsIamPasswordPolicyProperties withRequireLowercaseCharacters(Boolean requireLowercaseCharacters) { + this.requireLowercaseCharacters = requireLowercaseCharacters; + return this; + } + + /** + * Get the requireNumbers property: <p>Specifies whether IAM user passwords must contain at least one numeric + * character (0 to 9).</p>. + * + * @return the requireNumbers value. + */ + public Boolean requireNumbers() { + return this.requireNumbers; + } + + /** + * Set the requireNumbers property: <p>Specifies whether IAM user passwords must contain at least one numeric + * character (0 to 9).</p>. + * + * @param requireNumbers the requireNumbers value to set. + * @return the AwsIamPasswordPolicyProperties object itself. + */ + public AwsIamPasswordPolicyProperties withRequireNumbers(Boolean requireNumbers) { + this.requireNumbers = requireNumbers; + return this; + } + + /** + * Get the requireSymbols property: <p>Specifies whether IAM user passwords must contain at least one of the + * following symbols:</p> <p>! @ # $ % ^ &amp; * ( ) _ + - = [ ] { } | '</p>. + * + * @return the requireSymbols value. + */ + public Boolean requireSymbols() { + return this.requireSymbols; + } + + /** + * Set the requireSymbols property: <p>Specifies whether IAM user passwords must contain at least one of the + * following symbols:</p> <p>! @ # $ % ^ &amp; * ( ) _ + - = [ ] { } | '</p>. + * + * @param requireSymbols the requireSymbols value to set. + * @return the AwsIamPasswordPolicyProperties object itself. + */ + public AwsIamPasswordPolicyProperties withRequireSymbols(Boolean requireSymbols) { + this.requireSymbols = requireSymbols; + return this; + } + + /** + * Get the requireUppercaseCharacters property: <p>Specifies whether IAM user passwords must contain at least + * one uppercase character (A to Z).</p>. + * + * @return the requireUppercaseCharacters value. + */ + public Boolean requireUppercaseCharacters() { + return this.requireUppercaseCharacters; + } + + /** + * Set the requireUppercaseCharacters property: <p>Specifies whether IAM user passwords must contain at least + * one uppercase character (A to Z).</p>. + * + * @param requireUppercaseCharacters the requireUppercaseCharacters value to set. + * @return the AwsIamPasswordPolicyProperties object itself. + */ + public AwsIamPasswordPolicyProperties withRequireUppercaseCharacters(Boolean requireUppercaseCharacters) { + this.requireUppercaseCharacters = requireUppercaseCharacters; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeBooleanField("allowUsersToChangePassword", this.allowUsersToChangePassword); + jsonWriter.writeBooleanField("expirePasswords", this.expirePasswords); + jsonWriter.writeBooleanField("hardExpiry", this.hardExpiry); + jsonWriter.writeNumberField("maxPasswordAge", this.maxPasswordAge); + jsonWriter.writeNumberField("minimumPasswordLength", this.minimumPasswordLength); + jsonWriter.writeNumberField("passwordReusePrevention", this.passwordReusePrevention); + jsonWriter.writeBooleanField("requireLowercaseCharacters", this.requireLowercaseCharacters); + jsonWriter.writeBooleanField("requireNumbers", this.requireNumbers); + jsonWriter.writeBooleanField("requireSymbols", this.requireSymbols); + jsonWriter.writeBooleanField("requireUppercaseCharacters", this.requireUppercaseCharacters); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AwsIamPasswordPolicyProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AwsIamPasswordPolicyProperties if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the AwsIamPasswordPolicyProperties. + */ + public static AwsIamPasswordPolicyProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AwsIamPasswordPolicyProperties deserializedAwsIamPasswordPolicyProperties + = new AwsIamPasswordPolicyProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("allowUsersToChangePassword".equals(fieldName)) { + deserializedAwsIamPasswordPolicyProperties.allowUsersToChangePassword + = reader.getNullable(JsonReader::getBoolean); + } else if ("expirePasswords".equals(fieldName)) { + deserializedAwsIamPasswordPolicyProperties.expirePasswords + = reader.getNullable(JsonReader::getBoolean); + } else if ("hardExpiry".equals(fieldName)) { + deserializedAwsIamPasswordPolicyProperties.hardExpiry = reader.getNullable(JsonReader::getBoolean); + } else if ("maxPasswordAge".equals(fieldName)) { + deserializedAwsIamPasswordPolicyProperties.maxPasswordAge = reader.getNullable(JsonReader::getInt); + } else if ("minimumPasswordLength".equals(fieldName)) { + deserializedAwsIamPasswordPolicyProperties.minimumPasswordLength + = reader.getNullable(JsonReader::getInt); + } else if ("passwordReusePrevention".equals(fieldName)) { + deserializedAwsIamPasswordPolicyProperties.passwordReusePrevention + = reader.getNullable(JsonReader::getInt); + } else if ("requireLowercaseCharacters".equals(fieldName)) { + deserializedAwsIamPasswordPolicyProperties.requireLowercaseCharacters + = reader.getNullable(JsonReader::getBoolean); + } else if ("requireNumbers".equals(fieldName)) { + deserializedAwsIamPasswordPolicyProperties.requireNumbers + = reader.getNullable(JsonReader::getBoolean); + } else if ("requireSymbols".equals(fieldName)) { + deserializedAwsIamPasswordPolicyProperties.requireSymbols + = reader.getNullable(JsonReader::getBoolean); + } else if ("requireUppercaseCharacters".equals(fieldName)) { + deserializedAwsIamPasswordPolicyProperties.requireUppercaseCharacters + = reader.getNullable(JsonReader::getBoolean); + } else { + reader.skipChildren(); + } + } + + return deserializedAwsIamPasswordPolicyProperties; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/AwsIamPolicyVersionProperties.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/AwsIamPolicyVersionProperties.java new file mode 100644 index 000000000000..bf6defd421ae --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/AwsIamPolicyVersionProperties.java @@ -0,0 +1,214 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.time.OffsetDateTime; +import java.time.format.DateTimeFormatter; + +/** + * Definition of awsIamPolicyVersion. + */ +@Fluent +public final class AwsIamPolicyVersionProperties implements JsonSerializable { + /* + *

The date and time, in ISO 8601 date-time format, when the policy + * version was created.

+ */ + private OffsetDateTime createDate; + + /* + *

The policy document.

The policy document is returned in the response to the GetPolicyVersion and + * GetAccountAuthorizationDetails operations. It is not returned in the response to the + * CreatePolicyVersion or ListPolicyVersions operations.

The policy document returned in this + * structure is URL-encoded compliant with RFC 3986. You can use a + * URL decoding method to convert the policy back to plain JSON text. For example, if you use Java, you can use the + * decode method of the java.net.URLDecoder utility class in the Java SDK. Other languages + * and SDKs provide similar functionality.

+ */ + private String document; + + /* + *

Specifies whether the policy version is set as the policy's default version.

+ */ + private Boolean isDefaultVersion; + + /* + *

The identifier for the policy version.

Policy version identifiers always begin with v + * (always lowercase). When a policy is created, the first policy version is v1.

+ */ + private String versionId; + + /** + * Creates an instance of AwsIamPolicyVersionProperties class. + */ + public AwsIamPolicyVersionProperties() { + } + + /** + * Get the createDate property: <p>The date and time, in <a href='http://www.iso.org/iso/iso8601'>ISO + * 8601 date-time format</a>, when the policy version was created.</p>. + * + * @return the createDate value. + */ + public OffsetDateTime createDate() { + return this.createDate; + } + + /** + * Set the createDate property: <p>The date and time, in <a href='http://www.iso.org/iso/iso8601'>ISO + * 8601 date-time format</a>, when the policy version was created.</p>. + * + * @param createDate the createDate value to set. + * @return the AwsIamPolicyVersionProperties object itself. + */ + public AwsIamPolicyVersionProperties withCreateDate(OffsetDateTime createDate) { + this.createDate = createDate; + return this; + } + + /** + * Get the document property: <p>The policy document.</p> <p>The policy document is returned in + * the response to the <a>GetPolicyVersion</a> and <a>GetAccountAuthorizationDetails</a> + * operations. It is not returned in the response to the <a>CreatePolicyVersion</a> or + * <a>ListPolicyVersions</a> operations. </p> <p>The policy document returned in this + * structure is URL-encoded compliant with <a href='https://tools.ietf.org/html/rfc3986'>RFC 3986</a>. + * You can use a URL decoding method to convert the policy back to plain JSON text. For example, if you use Java, + * you can use the <code>decode</code> method of the <code>java.net.URLDecoder</code> + * utility class in the Java SDK. Other languages and SDKs provide similar functionality.</p>. + * + * @return the document value. + */ + public String document() { + return this.document; + } + + /** + * Set the document property: <p>The policy document.</p> <p>The policy document is returned in + * the response to the <a>GetPolicyVersion</a> and <a>GetAccountAuthorizationDetails</a> + * operations. It is not returned in the response to the <a>CreatePolicyVersion</a> or + * <a>ListPolicyVersions</a> operations. </p> <p>The policy document returned in this + * structure is URL-encoded compliant with <a href='https://tools.ietf.org/html/rfc3986'>RFC 3986</a>. + * You can use a URL decoding method to convert the policy back to plain JSON text. For example, if you use Java, + * you can use the <code>decode</code> method of the <code>java.net.URLDecoder</code> + * utility class in the Java SDK. Other languages and SDKs provide similar functionality.</p>. + * + * @param document the document value to set. + * @return the AwsIamPolicyVersionProperties object itself. + */ + public AwsIamPolicyVersionProperties withDocument(String document) { + this.document = document; + return this; + } + + /** + * Get the isDefaultVersion property: <p>Specifies whether the policy version is set as the policy's default + * version.</p>. + * + * @return the isDefaultVersion value. + */ + public Boolean isDefaultVersion() { + return this.isDefaultVersion; + } + + /** + * Set the isDefaultVersion property: <p>Specifies whether the policy version is set as the policy's default + * version.</p>. + * + * @param isDefaultVersion the isDefaultVersion value to set. + * @return the AwsIamPolicyVersionProperties object itself. + */ + public AwsIamPolicyVersionProperties withIsDefaultVersion(Boolean isDefaultVersion) { + this.isDefaultVersion = isDefaultVersion; + return this; + } + + /** + * Get the versionId property: <p>The identifier for the policy version.</p> <p>Policy version + * identifiers always begin with <code>v</code> (always lowercase). When a policy is created, the first + * policy version is <code>v1</code>. </p>. + * + * @return the versionId value. + */ + public String versionId() { + return this.versionId; + } + + /** + * Set the versionId property: <p>The identifier for the policy version.</p> <p>Policy version + * identifiers always begin with <code>v</code> (always lowercase). When a policy is created, the first + * policy version is <code>v1</code>. </p>. + * + * @param versionId the versionId value to set. + * @return the AwsIamPolicyVersionProperties object itself. + */ + public AwsIamPolicyVersionProperties withVersionId(String versionId) { + this.versionId = versionId; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("createDate", + this.createDate == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.createDate)); + jsonWriter.writeStringField("document", this.document); + jsonWriter.writeBooleanField("isDefaultVersion", this.isDefaultVersion); + jsonWriter.writeStringField("versionId", this.versionId); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AwsIamPolicyVersionProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AwsIamPolicyVersionProperties if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the AwsIamPolicyVersionProperties. + */ + public static AwsIamPolicyVersionProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AwsIamPolicyVersionProperties deserializedAwsIamPolicyVersionProperties + = new AwsIamPolicyVersionProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("createDate".equals(fieldName)) { + deserializedAwsIamPolicyVersionProperties.createDate = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("document".equals(fieldName)) { + deserializedAwsIamPolicyVersionProperties.document = reader.getString(); + } else if ("isDefaultVersion".equals(fieldName)) { + deserializedAwsIamPolicyVersionProperties.isDefaultVersion + = reader.getNullable(JsonReader::getBoolean); + } else if ("versionId".equals(fieldName)) { + deserializedAwsIamPolicyVersionProperties.versionId = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedAwsIamPolicyVersionProperties; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/AwsIamRoleProperties.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/AwsIamRoleProperties.java new file mode 100644 index 000000000000..c1e23a889f61 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/AwsIamRoleProperties.java @@ -0,0 +1,524 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; +import java.util.Map; + +/** + * Definition of awsIamRole. + */ +@Fluent +public final class AwsIamRoleProperties implements JsonSerializable { + /* + * Property arn + */ + private String arn; + + /* + * The trust policy that is associated with this role. Trust policies define which entities can assume the role. You + * can associate only one trust policy with a role. For an example of a policy that can be used to assume a role, + * see [Template + * Examples](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-iam-role.html#aws-resource- + * iam-role--examples). For more information about the elements that you can use in an IAM policy, see [Policy + * Elements Reference](https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_elements.html) in the + * *User Guide*. + */ + private Map assumeRolePolicyDocument; + + /* + * A description of the role that you provide. + */ + private String description; + + /* + * A list of Amazon Resource Names (ARNs) of the IAM managed policies that you want to attach to the role. For more + * information about ARNs, see [Amazon Resource Names (ARNs) and Service + * Namespaces](https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html) in the *General + * Reference*. + */ + private List managedPolicyArns; + + /* + * The maximum session duration (in seconds) that you want to set for the specified role. If you do not specify a + * value for this setting, the default value of one hour is applied. This setting can have a value from 1 hour to 12 + * hours. Anyone who assumes the role from the CLI or API can use the ``DurationSeconds`` API parameter or the + * ``duration-seconds`` CLI parameter to request a longer session. The ``MaxSessionDuration`` setting determines the + * maximum duration that can be requested using the ``DurationSeconds`` parameter. If users don't specify a value + * for the ``DurationSeconds`` parameter, their security credentials are valid for one hour by default. This applies + * when you use the ``AssumeRole*`` API operations or the ``assume-role*`` CLI operations but does not apply when + * you use those operations to create a console URL. For more information, see [Using IAM + * roles](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_use.html) in the *IAM User Guide*. + */ + private Integer maxSessionDuration; + + /* + * The path to the role. For more information about paths, see [IAM + * Identifiers](https://docs.aws.amazon.com/IAM/latest/UserGuide/Using_Identifiers.html) in the *IAM User Guide*. + * This parameter is optional. If it is not included, it defaults to a slash (/). This parameter allows (through its + * [regex pattern](https://docs.aws.amazon.com/http://wikipedia.org/wiki/regex)) a string of characters consisting + * of either a forward slash (/) by itself or a string that must begin and end with forward slashes. In addition, it + * can contain any ASCII character from the ! (``\u0021``) through the DEL character (``\u007F``), including most + * punctuation characters, digits, and upper and lowercased letters. + */ + private String path; + + /* + * The ARN of the policy used to set the permissions boundary for the role. For more information about permissions + * boundaries, see [Permissions boundaries for IAM + * identities](https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies_boundaries.html) in the *IAM User + * Guide*. + */ + private String permissionsBoundary; + + /* + * Adds or updates an inline policy document that is embedded in the specified IAM role. When you embed an inline + * policy in a role, the inline policy is used as part of the role's access (permissions) policy. The role's trust + * policy is created at the same time as the role. You can update a role's trust policy later. For more information + * about IAM roles, go to [Using Roles to Delegate Permissions and Federate + * Identities](https://docs.aws.amazon.com/IAM/latest/UserGuide/roles-toplevel.html). A role can also have an + * attached managed policy. For information about policies, see [Managed Policies and Inline + * Policies](https://docs.aws.amazon.com/IAM/latest/UserGuide/policies-managed-vs-inline.html) in the *User Guide*. + * For information about limits on the number of inline policies that you can embed with a role, see [Limitations on + * Entities](https://docs.aws.amazon.com/IAM/latest/UserGuide/LimitationsOnEntities.html) in the *User Guide*. If an + * external policy (such as ``AWS::IAM::Policy`` or + */ + private List policies; + + /* + * Property roleId + */ + private String roleId; + + /* + * A name for the IAM role, up to 64 characters in length. For valid values, see the ``RoleName`` parameter for the + * [CreateRole](https://docs.aws.amazon.com/IAM/latest/APIReference/API_CreateRole.html) action in the *User Guide*. + * This parameter allows (per its [regex pattern](https://docs.aws.amazon.com/http://wikipedia.org/wiki/regex)) a + * string of characters consisting of upper and lowercase alphanumeric characters with no spaces. You can also + * include any of the following characters: _+=,.@-. The role name must be unique within the account. Role names are + * not distinguished by case. For example, you cannot create roles named both 'Role1' and 'role1'. If you don't + * specify a name, CFN generates a unique physical ID and uses that ID for the role name. If you specify a name, you + * must specify the ``CAPABILITY_NAMED_IAM`` value to acknowledge your template's capabilities. For more + * information, see [Acknowledging Resources in Templates](https://docs.aws.amazon.com/AWSCloudFormation/latest/Use + */ + private String roleName; + + /* + * A list of tags that are attached to the role. For more information about tagging, see [Tagging IAM + * resources](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_tags.html) in the *IAM User Guide*. + */ + private List tags; + + /** + * Creates an instance of AwsIamRoleProperties class. + */ + public AwsIamRoleProperties() { + } + + /** + * Get the arn property: Property arn. + * + * @return the arn value. + */ + public String arn() { + return this.arn; + } + + /** + * Set the arn property: Property arn. + * + * @param arn the arn value to set. + * @return the AwsIamRoleProperties object itself. + */ + public AwsIamRoleProperties withArn(String arn) { + this.arn = arn; + return this; + } + + /** + * Get the assumeRolePolicyDocument property: The trust policy that is associated with this role. Trust policies + * define which entities can assume the role. You can associate only one trust policy with a role. For an example of + * a policy that can be used to assume a role, see [Template + * Examples](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-iam-role.html#aws-resource-iam-role--examples). + * For more information about the elements that you can use in an IAM policy, see [Policy Elements + * Reference](https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_elements.html) in the *User + * Guide*. + * + * @return the assumeRolePolicyDocument value. + */ + public Map assumeRolePolicyDocument() { + return this.assumeRolePolicyDocument; + } + + /** + * Set the assumeRolePolicyDocument property: The trust policy that is associated with this role. Trust policies + * define which entities can assume the role. You can associate only one trust policy with a role. For an example of + * a policy that can be used to assume a role, see [Template + * Examples](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-iam-role.html#aws-resource-iam-role--examples). + * For more information about the elements that you can use in an IAM policy, see [Policy Elements + * Reference](https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_elements.html) in the *User + * Guide*. + * + * @param assumeRolePolicyDocument the assumeRolePolicyDocument value to set. + * @return the AwsIamRoleProperties object itself. + */ + public AwsIamRoleProperties withAssumeRolePolicyDocument(Map assumeRolePolicyDocument) { + this.assumeRolePolicyDocument = assumeRolePolicyDocument; + return this; + } + + /** + * Get the description property: A description of the role that you provide. + * + * @return the description value. + */ + public String description() { + return this.description; + } + + /** + * Set the description property: A description of the role that you provide. + * + * @param description the description value to set. + * @return the AwsIamRoleProperties object itself. + */ + public AwsIamRoleProperties withDescription(String description) { + this.description = description; + return this; + } + + /** + * Get the managedPolicyArns property: A list of Amazon Resource Names (ARNs) of the IAM managed policies that you + * want to attach to the role. For more information about ARNs, see [Amazon Resource Names (ARNs) and Service + * Namespaces](https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html) in the *General + * Reference*. + * + * @return the managedPolicyArns value. + */ + public List managedPolicyArns() { + return this.managedPolicyArns; + } + + /** + * Set the managedPolicyArns property: A list of Amazon Resource Names (ARNs) of the IAM managed policies that you + * want to attach to the role. For more information about ARNs, see [Amazon Resource Names (ARNs) and Service + * Namespaces](https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html) in the *General + * Reference*. + * + * @param managedPolicyArns the managedPolicyArns value to set. + * @return the AwsIamRoleProperties object itself. + */ + public AwsIamRoleProperties withManagedPolicyArns(List managedPolicyArns) { + this.managedPolicyArns = managedPolicyArns; + return this; + } + + /** + * Get the maxSessionDuration property: The maximum session duration (in seconds) that you want to set for the + * specified role. If you do not specify a value for this setting, the default value of one hour is applied. This + * setting can have a value from 1 hour to 12 hours. Anyone who assumes the role from the CLI or API can use the + * ``DurationSeconds`` API parameter or the ``duration-seconds`` CLI parameter to request a longer session. The + * ``MaxSessionDuration`` setting determines the maximum duration that can be requested using the + * ``DurationSeconds`` parameter. If users don't specify a value for the ``DurationSeconds`` parameter, their + * security credentials are valid for one hour by default. This applies when you use the ``AssumeRole*`` API + * operations or the ``assume-role*`` CLI operations but does not apply when you use those operations to create a + * console URL. For more information, see [Using IAM + * roles](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_use.html) in the *IAM User Guide*. + * + * @return the maxSessionDuration value. + */ + public Integer maxSessionDuration() { + return this.maxSessionDuration; + } + + /** + * Set the maxSessionDuration property: The maximum session duration (in seconds) that you want to set for the + * specified role. If you do not specify a value for this setting, the default value of one hour is applied. This + * setting can have a value from 1 hour to 12 hours. Anyone who assumes the role from the CLI or API can use the + * ``DurationSeconds`` API parameter or the ``duration-seconds`` CLI parameter to request a longer session. The + * ``MaxSessionDuration`` setting determines the maximum duration that can be requested using the + * ``DurationSeconds`` parameter. If users don't specify a value for the ``DurationSeconds`` parameter, their + * security credentials are valid for one hour by default. This applies when you use the ``AssumeRole*`` API + * operations or the ``assume-role*`` CLI operations but does not apply when you use those operations to create a + * console URL. For more information, see [Using IAM + * roles](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_use.html) in the *IAM User Guide*. + * + * @param maxSessionDuration the maxSessionDuration value to set. + * @return the AwsIamRoleProperties object itself. + */ + public AwsIamRoleProperties withMaxSessionDuration(Integer maxSessionDuration) { + this.maxSessionDuration = maxSessionDuration; + return this; + } + + /** + * Get the path property: The path to the role. For more information about paths, see [IAM + * Identifiers](https://docs.aws.amazon.com/IAM/latest/UserGuide/Using_Identifiers.html) in the *IAM User Guide*. + * This parameter is optional. If it is not included, it defaults to a slash (/). This parameter allows (through its + * [regex pattern](https://docs.aws.amazon.com/http://wikipedia.org/wiki/regex)) a string of characters consisting + * of either a forward slash (/) by itself or a string that must begin and end with forward slashes. In addition, it + * can contain any ASCII character from the ! (``\u0021``) through the DEL character (``\u007F``), including most + * punctuation characters, digits, and upper and lowercased letters. + * + * @return the path value. + */ + public String path() { + return this.path; + } + + /** + * Set the path property: The path to the role. For more information about paths, see [IAM + * Identifiers](https://docs.aws.amazon.com/IAM/latest/UserGuide/Using_Identifiers.html) in the *IAM User Guide*. + * This parameter is optional. If it is not included, it defaults to a slash (/). This parameter allows (through its + * [regex pattern](https://docs.aws.amazon.com/http://wikipedia.org/wiki/regex)) a string of characters consisting + * of either a forward slash (/) by itself or a string that must begin and end with forward slashes. In addition, it + * can contain any ASCII character from the ! (``\u0021``) through the DEL character (``\u007F``), including most + * punctuation characters, digits, and upper and lowercased letters. + * + * @param path the path value to set. + * @return the AwsIamRoleProperties object itself. + */ + public AwsIamRoleProperties withPath(String path) { + this.path = path; + return this; + } + + /** + * Get the permissionsBoundary property: The ARN of the policy used to set the permissions boundary for the role. + * For more information about permissions boundaries, see [Permissions boundaries for IAM + * identities](https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies_boundaries.html) in the *IAM User + * Guide*. + * + * @return the permissionsBoundary value. + */ + public String permissionsBoundary() { + return this.permissionsBoundary; + } + + /** + * Set the permissionsBoundary property: The ARN of the policy used to set the permissions boundary for the role. + * For more information about permissions boundaries, see [Permissions boundaries for IAM + * identities](https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies_boundaries.html) in the *IAM User + * Guide*. + * + * @param permissionsBoundary the permissionsBoundary value to set. + * @return the AwsIamRoleProperties object itself. + */ + public AwsIamRoleProperties withPermissionsBoundary(String permissionsBoundary) { + this.permissionsBoundary = permissionsBoundary; + return this; + } + + /** + * Get the policies property: Adds or updates an inline policy document that is embedded in the specified IAM role. + * When you embed an inline policy in a role, the inline policy is used as part of the role's access (permissions) + * policy. The role's trust policy is created at the same time as the role. You can update a role's trust policy + * later. For more information about IAM roles, go to [Using Roles to Delegate Permissions and Federate + * Identities](https://docs.aws.amazon.com/IAM/latest/UserGuide/roles-toplevel.html). A role can also have an + * attached managed policy. For information about policies, see [Managed Policies and Inline + * Policies](https://docs.aws.amazon.com/IAM/latest/UserGuide/policies-managed-vs-inline.html) in the *User Guide*. + * For information about limits on the number of inline policies that you can embed with a role, see [Limitations on + * Entities](https://docs.aws.amazon.com/IAM/latest/UserGuide/LimitationsOnEntities.html) in the *User Guide*. If an + * external policy (such as ``AWS::IAM::Policy`` or. + * + * @return the policies value. + */ + public List policies() { + return this.policies; + } + + /** + * Set the policies property: Adds or updates an inline policy document that is embedded in the specified IAM role. + * When you embed an inline policy in a role, the inline policy is used as part of the role's access (permissions) + * policy. The role's trust policy is created at the same time as the role. You can update a role's trust policy + * later. For more information about IAM roles, go to [Using Roles to Delegate Permissions and Federate + * Identities](https://docs.aws.amazon.com/IAM/latest/UserGuide/roles-toplevel.html). A role can also have an + * attached managed policy. For information about policies, see [Managed Policies and Inline + * Policies](https://docs.aws.amazon.com/IAM/latest/UserGuide/policies-managed-vs-inline.html) in the *User Guide*. + * For information about limits on the number of inline policies that you can embed with a role, see [Limitations on + * Entities](https://docs.aws.amazon.com/IAM/latest/UserGuide/LimitationsOnEntities.html) in the *User Guide*. If an + * external policy (such as ``AWS::IAM::Policy`` or. + * + * @param policies the policies value to set. + * @return the AwsIamRoleProperties object itself. + */ + public AwsIamRoleProperties withPolicies(List policies) { + this.policies = policies; + return this; + } + + /** + * Get the roleId property: Property roleId. + * + * @return the roleId value. + */ + public String roleId() { + return this.roleId; + } + + /** + * Set the roleId property: Property roleId. + * + * @param roleId the roleId value to set. + * @return the AwsIamRoleProperties object itself. + */ + public AwsIamRoleProperties withRoleId(String roleId) { + this.roleId = roleId; + return this; + } + + /** + * Get the roleName property: A name for the IAM role, up to 64 characters in length. For valid values, see the + * ``RoleName`` parameter for the + * [CreateRole](https://docs.aws.amazon.com/IAM/latest/APIReference/API_CreateRole.html) action in the *User Guide*. + * This parameter allows (per its [regex pattern](https://docs.aws.amazon.com/http://wikipedia.org/wiki/regex)) a + * string of characters consisting of upper and lowercase alphanumeric characters with no spaces. You can also + * include any of the following characters: _+=,.@-. The role name must be unique within the account. Role + * names are not distinguished by case. For example, you cannot create roles named both 'Role1' and 'role1'. If you + * don't specify a name, CFN generates a unique physical ID and uses that ID for the role name. If you specify a + * name, you must specify the ``CAPABILITY_NAMED_IAM`` value to acknowledge your template's capabilities. For more + * information, see [Acknowledging Resources in Templates](https://docs.aws.amazon.com/AWSCloudFormation/latest/Use. + * + * @return the roleName value. + */ + public String roleName() { + return this.roleName; + } + + /** + * Set the roleName property: A name for the IAM role, up to 64 characters in length. For valid values, see the + * ``RoleName`` parameter for the + * [CreateRole](https://docs.aws.amazon.com/IAM/latest/APIReference/API_CreateRole.html) action in the *User Guide*. + * This parameter allows (per its [regex pattern](https://docs.aws.amazon.com/http://wikipedia.org/wiki/regex)) a + * string of characters consisting of upper and lowercase alphanumeric characters with no spaces. You can also + * include any of the following characters: _+=,.@-. The role name must be unique within the account. Role + * names are not distinguished by case. For example, you cannot create roles named both 'Role1' and 'role1'. If you + * don't specify a name, CFN generates a unique physical ID and uses that ID for the role name. If you specify a + * name, you must specify the ``CAPABILITY_NAMED_IAM`` value to acknowledge your template's capabilities. For more + * information, see [Acknowledging Resources in Templates](https://docs.aws.amazon.com/AWSCloudFormation/latest/Use. + * + * @param roleName the roleName value to set. + * @return the AwsIamRoleProperties object itself. + */ + public AwsIamRoleProperties withRoleName(String roleName) { + this.roleName = roleName; + return this; + } + + /** + * Get the tags property: A list of tags that are attached to the role. For more information about tagging, see + * [Tagging IAM resources](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_tags.html) in the *IAM User Guide*. + * + * @return the tags value. + */ + public List tags() { + return this.tags; + } + + /** + * Set the tags property: A list of tags that are attached to the role. For more information about tagging, see + * [Tagging IAM resources](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_tags.html) in the *IAM User Guide*. + * + * @param tags the tags value to set. + * @return the AwsIamRoleProperties object itself. + */ + public AwsIamRoleProperties withTags(List tags) { + this.tags = tags; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (policies() != null) { + policies().forEach(e -> e.validate()); + } + if (tags() != null) { + tags().forEach(e -> e.validate()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("arn", this.arn); + jsonWriter.writeMapField("assumeRolePolicyDocument", this.assumeRolePolicyDocument, + (writer, element) -> writer.writeUntyped(element)); + jsonWriter.writeStringField("description", this.description); + jsonWriter.writeArrayField("managedPolicyArns", this.managedPolicyArns, + (writer, element) -> writer.writeString(element)); + jsonWriter.writeNumberField("maxSessionDuration", this.maxSessionDuration); + jsonWriter.writeStringField("path", this.path); + jsonWriter.writeStringField("permissionsBoundary", this.permissionsBoundary); + jsonWriter.writeArrayField("policies", this.policies, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("roleId", this.roleId); + jsonWriter.writeStringField("roleName", this.roleName); + jsonWriter.writeArrayField("tags", this.tags, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AwsIamRoleProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AwsIamRoleProperties if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the AwsIamRoleProperties. + */ + public static AwsIamRoleProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AwsIamRoleProperties deserializedAwsIamRoleProperties = new AwsIamRoleProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("arn".equals(fieldName)) { + deserializedAwsIamRoleProperties.arn = reader.getString(); + } else if ("assumeRolePolicyDocument".equals(fieldName)) { + Map assumeRolePolicyDocument = reader.readMap(reader1 -> reader1.readUntyped()); + deserializedAwsIamRoleProperties.assumeRolePolicyDocument = assumeRolePolicyDocument; + } else if ("description".equals(fieldName)) { + deserializedAwsIamRoleProperties.description = reader.getString(); + } else if ("managedPolicyArns".equals(fieldName)) { + List managedPolicyArns = reader.readArray(reader1 -> reader1.getString()); + deserializedAwsIamRoleProperties.managedPolicyArns = managedPolicyArns; + } else if ("maxSessionDuration".equals(fieldName)) { + deserializedAwsIamRoleProperties.maxSessionDuration = reader.getNullable(JsonReader::getInt); + } else if ("path".equals(fieldName)) { + deserializedAwsIamRoleProperties.path = reader.getString(); + } else if ("permissionsBoundary".equals(fieldName)) { + deserializedAwsIamRoleProperties.permissionsBoundary = reader.getString(); + } else if ("policies".equals(fieldName)) { + List policies + = reader.readArray(reader1 -> PolicyAutoGenerated.fromJson(reader1)); + deserializedAwsIamRoleProperties.policies = policies; + } else if ("roleId".equals(fieldName)) { + deserializedAwsIamRoleProperties.roleId = reader.getString(); + } else if ("roleName".equals(fieldName)) { + deserializedAwsIamRoleProperties.roleName = reader.getString(); + } else if ("tags".equals(fieldName)) { + List tags = reader.readArray(reader1 -> TagAutoGenerated32.fromJson(reader1)); + deserializedAwsIamRoleProperties.tags = tags; + } else { + reader.skipChildren(); + } + } + + return deserializedAwsIamRoleProperties; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/AwsIamServerCertificateProperties.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/AwsIamServerCertificateProperties.java new file mode 100644 index 000000000000..e5044b7db270 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/AwsIamServerCertificateProperties.java @@ -0,0 +1,267 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Definition of awsIamServerCertificate. + */ +@Fluent +public final class AwsIamServerCertificateProperties implements JsonSerializable { + /* + * Amazon Resource Name (ARN) of the server certificate + */ + private String arn; + + /* + * Property certificateBody + */ + private String certificateBody; + + /* + * Property certificateChain + */ + private String certificateChain; + + /* + * Property path + */ + private String path; + + /* + * Property privateKey + */ + private String privateKey; + + /* + * Property serverCertificateName + */ + private String serverCertificateName; + + /* + * Property tags + */ + private List tags; + + /** + * Creates an instance of AwsIamServerCertificateProperties class. + */ + public AwsIamServerCertificateProperties() { + } + + /** + * Get the arn property: Amazon Resource Name (ARN) of the server certificate. + * + * @return the arn value. + */ + public String arn() { + return this.arn; + } + + /** + * Set the arn property: Amazon Resource Name (ARN) of the server certificate. + * + * @param arn the arn value to set. + * @return the AwsIamServerCertificateProperties object itself. + */ + public AwsIamServerCertificateProperties withArn(String arn) { + this.arn = arn; + return this; + } + + /** + * Get the certificateBody property: Property certificateBody. + * + * @return the certificateBody value. + */ + public String certificateBody() { + return this.certificateBody; + } + + /** + * Set the certificateBody property: Property certificateBody. + * + * @param certificateBody the certificateBody value to set. + * @return the AwsIamServerCertificateProperties object itself. + */ + public AwsIamServerCertificateProperties withCertificateBody(String certificateBody) { + this.certificateBody = certificateBody; + return this; + } + + /** + * Get the certificateChain property: Property certificateChain. + * + * @return the certificateChain value. + */ + public String certificateChain() { + return this.certificateChain; + } + + /** + * Set the certificateChain property: Property certificateChain. + * + * @param certificateChain the certificateChain value to set. + * @return the AwsIamServerCertificateProperties object itself. + */ + public AwsIamServerCertificateProperties withCertificateChain(String certificateChain) { + this.certificateChain = certificateChain; + return this; + } + + /** + * Get the path property: Property path. + * + * @return the path value. + */ + public String path() { + return this.path; + } + + /** + * Set the path property: Property path. + * + * @param path the path value to set. + * @return the AwsIamServerCertificateProperties object itself. + */ + public AwsIamServerCertificateProperties withPath(String path) { + this.path = path; + return this; + } + + /** + * Get the privateKey property: Property privateKey. + * + * @return the privateKey value. + */ + public String privateKey() { + return this.privateKey; + } + + /** + * Set the privateKey property: Property privateKey. + * + * @param privateKey the privateKey value to set. + * @return the AwsIamServerCertificateProperties object itself. + */ + public AwsIamServerCertificateProperties withPrivateKey(String privateKey) { + this.privateKey = privateKey; + return this; + } + + /** + * Get the serverCertificateName property: Property serverCertificateName. + * + * @return the serverCertificateName value. + */ + public String serverCertificateName() { + return this.serverCertificateName; + } + + /** + * Set the serverCertificateName property: Property serverCertificateName. + * + * @param serverCertificateName the serverCertificateName value to set. + * @return the AwsIamServerCertificateProperties object itself. + */ + public AwsIamServerCertificateProperties withServerCertificateName(String serverCertificateName) { + this.serverCertificateName = serverCertificateName; + return this; + } + + /** + * Get the tags property: Property tags. + * + * @return the tags value. + */ + public List tags() { + return this.tags; + } + + /** + * Set the tags property: Property tags. + * + * @param tags the tags value to set. + * @return the AwsIamServerCertificateProperties object itself. + */ + public AwsIamServerCertificateProperties withTags(List tags) { + this.tags = tags; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (tags() != null) { + tags().forEach(e -> e.validate()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("arn", this.arn); + jsonWriter.writeStringField("certificateBody", this.certificateBody); + jsonWriter.writeStringField("certificateChain", this.certificateChain); + jsonWriter.writeStringField("path", this.path); + jsonWriter.writeStringField("privateKey", this.privateKey); + jsonWriter.writeStringField("serverCertificateName", this.serverCertificateName); + jsonWriter.writeArrayField("tags", this.tags, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AwsIamServerCertificateProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AwsIamServerCertificateProperties if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the AwsIamServerCertificateProperties. + */ + public static AwsIamServerCertificateProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AwsIamServerCertificateProperties deserializedAwsIamServerCertificateProperties + = new AwsIamServerCertificateProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("arn".equals(fieldName)) { + deserializedAwsIamServerCertificateProperties.arn = reader.getString(); + } else if ("certificateBody".equals(fieldName)) { + deserializedAwsIamServerCertificateProperties.certificateBody = reader.getString(); + } else if ("certificateChain".equals(fieldName)) { + deserializedAwsIamServerCertificateProperties.certificateChain = reader.getString(); + } else if ("path".equals(fieldName)) { + deserializedAwsIamServerCertificateProperties.path = reader.getString(); + } else if ("privateKey".equals(fieldName)) { + deserializedAwsIamServerCertificateProperties.privateKey = reader.getString(); + } else if ("serverCertificateName".equals(fieldName)) { + deserializedAwsIamServerCertificateProperties.serverCertificateName = reader.getString(); + } else if ("tags".equals(fieldName)) { + List tags = reader.readArray(reader1 -> TagAutoGenerated33.fromJson(reader1)); + deserializedAwsIamServerCertificateProperties.tags = tags; + } else { + reader.skipChildren(); + } + } + + return deserializedAwsIamServerCertificateProperties; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/AwsIamVirtualMfaDeviceProperties.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/AwsIamVirtualMfaDeviceProperties.java new file mode 100644 index 000000000000..e655190974b6 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/AwsIamVirtualMfaDeviceProperties.java @@ -0,0 +1,212 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Definition of awsIamVirtualMFADevice. + */ +@Fluent +public final class AwsIamVirtualMfaDeviceProperties implements JsonSerializable { + /* + * Property path + */ + private String path; + + /* + * Property serialNumber + */ + private String serialNumber; + + /* + * Property tags + */ + private List tags; + + /* + * Property users + */ + private List users; + + /* + * Property virtualMfaDeviceName + */ + private String virtualMfaDeviceName; + + /** + * Creates an instance of AwsIamVirtualMfaDeviceProperties class. + */ + public AwsIamVirtualMfaDeviceProperties() { + } + + /** + * Get the path property: Property path. + * + * @return the path value. + */ + public String path() { + return this.path; + } + + /** + * Set the path property: Property path. + * + * @param path the path value to set. + * @return the AwsIamVirtualMfaDeviceProperties object itself. + */ + public AwsIamVirtualMfaDeviceProperties withPath(String path) { + this.path = path; + return this; + } + + /** + * Get the serialNumber property: Property serialNumber. + * + * @return the serialNumber value. + */ + public String serialNumber() { + return this.serialNumber; + } + + /** + * Set the serialNumber property: Property serialNumber. + * + * @param serialNumber the serialNumber value to set. + * @return the AwsIamVirtualMfaDeviceProperties object itself. + */ + public AwsIamVirtualMfaDeviceProperties withSerialNumber(String serialNumber) { + this.serialNumber = serialNumber; + return this; + } + + /** + * Get the tags property: Property tags. + * + * @return the tags value. + */ + public List tags() { + return this.tags; + } + + /** + * Set the tags property: Property tags. + * + * @param tags the tags value to set. + * @return the AwsIamVirtualMfaDeviceProperties object itself. + */ + public AwsIamVirtualMfaDeviceProperties withTags(List tags) { + this.tags = tags; + return this; + } + + /** + * Get the users property: Property users. + * + * @return the users value. + */ + public List users() { + return this.users; + } + + /** + * Set the users property: Property users. + * + * @param users the users value to set. + * @return the AwsIamVirtualMfaDeviceProperties object itself. + */ + public AwsIamVirtualMfaDeviceProperties withUsers(List users) { + this.users = users; + return this; + } + + /** + * Get the virtualMfaDeviceName property: Property virtualMfaDeviceName. + * + * @return the virtualMfaDeviceName value. + */ + public String virtualMfaDeviceName() { + return this.virtualMfaDeviceName; + } + + /** + * Set the virtualMfaDeviceName property: Property virtualMfaDeviceName. + * + * @param virtualMfaDeviceName the virtualMfaDeviceName value to set. + * @return the AwsIamVirtualMfaDeviceProperties object itself. + */ + public AwsIamVirtualMfaDeviceProperties withVirtualMfaDeviceName(String virtualMfaDeviceName) { + this.virtualMfaDeviceName = virtualMfaDeviceName; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (tags() != null) { + tags().forEach(e -> e.validate()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("path", this.path); + jsonWriter.writeStringField("serialNumber", this.serialNumber); + jsonWriter.writeArrayField("tags", this.tags, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("users", this.users, (writer, element) -> writer.writeString(element)); + jsonWriter.writeStringField("virtualMfaDeviceName", this.virtualMfaDeviceName); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AwsIamVirtualMfaDeviceProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AwsIamVirtualMfaDeviceProperties if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the AwsIamVirtualMfaDeviceProperties. + */ + public static AwsIamVirtualMfaDeviceProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AwsIamVirtualMfaDeviceProperties deserializedAwsIamVirtualMfaDeviceProperties + = new AwsIamVirtualMfaDeviceProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("path".equals(fieldName)) { + deserializedAwsIamVirtualMfaDeviceProperties.path = reader.getString(); + } else if ("serialNumber".equals(fieldName)) { + deserializedAwsIamVirtualMfaDeviceProperties.serialNumber = reader.getString(); + } else if ("tags".equals(fieldName)) { + List tags = reader.readArray(reader1 -> TagAutoGenerated34.fromJson(reader1)); + deserializedAwsIamVirtualMfaDeviceProperties.tags = tags; + } else if ("users".equals(fieldName)) { + List users = reader.readArray(reader1 -> reader1.getString()); + deserializedAwsIamVirtualMfaDeviceProperties.users = users; + } else if ("virtualMfaDeviceName".equals(fieldName)) { + deserializedAwsIamVirtualMfaDeviceProperties.virtualMfaDeviceName = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedAwsIamVirtualMfaDeviceProperties; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/AwsKmsAliasProperties.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/AwsKmsAliasProperties.java new file mode 100644 index 000000000000..2e884b15a622 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/AwsKmsAliasProperties.java @@ -0,0 +1,166 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of awsKmsAlias. + */ +@Fluent +public final class AwsKmsAliasProperties implements JsonSerializable { + /* + * Specifies the alias name. This value must begin with ``alias/`` followed by a name, such as + * ``alias/ExampleAlias``. If you change the value of the ``AliasName`` property, the existing alias is deleted and + * a new alias is created for the specified KMS key. This change can disrupt applications that use the alias. It can + * also allow or deny access to a KMS key affected by attribute-based access control (ABAC). The alias must be + * string of 1-256 characters. It can contain only alphanumeric characters, forward slashes (/), underscores (_), + * and dashes (-). The alias name cannot begin with ``alias/aws/``. The ``alias/aws/`` prefix is reserved for + * [](https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#aws-managed-cmk). + */ + private String aliasName; + + /* + * Associates the alias with the specified + * [](https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#customer-cmk). The KMS key must be in the + * same AWS-account and Region. A valid key ID is required. If you supply a null or empty string value, this + * operation returns an error. For help finding the key ID and ARN, see [Finding the key ID and + * ARN](https://docs.aws.amazon.com/kms/latest/developerguide/viewing-keys.html#find-cmk-id-arn) in the *Developer + * Guide*. Specify the key ID or the key ARN of the KMS key. For example: + Key ID: + * ``1234abcd-12ab-34cd-56ef-1234567890ab`` + Key ARN: + * ``arn:aws:kms:us-east-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab`` To get the key ID and key ARN for + * a KMS key, use [ListKeys](https://docs.aws.amazon.com/kms/latest/APIReference/API_ListKeys.html) or + * [DescribeKey](https://docs.aws.amazon.com/kms/latest/APIReference/API_DescribeKey.html). + */ + private String targetKeyId; + + /** + * Creates an instance of AwsKmsAliasProperties class. + */ + public AwsKmsAliasProperties() { + } + + /** + * Get the aliasName property: Specifies the alias name. This value must begin with ``alias/`` followed by a name, + * such as ``alias/ExampleAlias``. If you change the value of the ``AliasName`` property, the existing alias is + * deleted and a new alias is created for the specified KMS key. This change can disrupt applications that use the + * alias. It can also allow or deny access to a KMS key affected by attribute-based access control (ABAC). The alias + * must be string of 1-256 characters. It can contain only alphanumeric characters, forward slashes (/), underscores + * (_), and dashes (-). The alias name cannot begin with ``alias/aws/``. The ``alias/aws/`` prefix is reserved for + * [](https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#aws-managed-cmk). + * + * @return the aliasName value. + */ + public String aliasName() { + return this.aliasName; + } + + /** + * Set the aliasName property: Specifies the alias name. This value must begin with ``alias/`` followed by a name, + * such as ``alias/ExampleAlias``. If you change the value of the ``AliasName`` property, the existing alias is + * deleted and a new alias is created for the specified KMS key. This change can disrupt applications that use the + * alias. It can also allow or deny access to a KMS key affected by attribute-based access control (ABAC). The alias + * must be string of 1-256 characters. It can contain only alphanumeric characters, forward slashes (/), underscores + * (_), and dashes (-). The alias name cannot begin with ``alias/aws/``. The ``alias/aws/`` prefix is reserved for + * [](https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#aws-managed-cmk). + * + * @param aliasName the aliasName value to set. + * @return the AwsKmsAliasProperties object itself. + */ + public AwsKmsAliasProperties withAliasName(String aliasName) { + this.aliasName = aliasName; + return this; + } + + /** + * Get the targetKeyId property: Associates the alias with the specified + * [](https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#customer-cmk). The KMS key must be in the + * same AWS-account and Region. A valid key ID is required. If you supply a null or empty string value, this + * operation returns an error. For help finding the key ID and ARN, see [Finding the key ID and + * ARN](https://docs.aws.amazon.com/kms/latest/developerguide/viewing-keys.html#find-cmk-id-arn) in the *Developer + * Guide*. Specify the key ID or the key ARN of the KMS key. For example: + Key ID: + * ``1234abcd-12ab-34cd-56ef-1234567890ab`` + Key ARN: + * ``arn:aws:kms:us-east-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab`` To get the key ID and key ARN for + * a KMS key, use [ListKeys](https://docs.aws.amazon.com/kms/latest/APIReference/API_ListKeys.html) or + * [DescribeKey](https://docs.aws.amazon.com/kms/latest/APIReference/API_DescribeKey.html). + * + * @return the targetKeyId value. + */ + public String targetKeyId() { + return this.targetKeyId; + } + + /** + * Set the targetKeyId property: Associates the alias with the specified + * [](https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#customer-cmk). The KMS key must be in the + * same AWS-account and Region. A valid key ID is required. If you supply a null or empty string value, this + * operation returns an error. For help finding the key ID and ARN, see [Finding the key ID and + * ARN](https://docs.aws.amazon.com/kms/latest/developerguide/viewing-keys.html#find-cmk-id-arn) in the *Developer + * Guide*. Specify the key ID or the key ARN of the KMS key. For example: + Key ID: + * ``1234abcd-12ab-34cd-56ef-1234567890ab`` + Key ARN: + * ``arn:aws:kms:us-east-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab`` To get the key ID and key ARN for + * a KMS key, use [ListKeys](https://docs.aws.amazon.com/kms/latest/APIReference/API_ListKeys.html) or + * [DescribeKey](https://docs.aws.amazon.com/kms/latest/APIReference/API_DescribeKey.html). + * + * @param targetKeyId the targetKeyId value to set. + * @return the AwsKmsAliasProperties object itself. + */ + public AwsKmsAliasProperties withTargetKeyId(String targetKeyId) { + this.targetKeyId = targetKeyId; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("aliasName", this.aliasName); + jsonWriter.writeStringField("targetKeyId", this.targetKeyId); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AwsKmsAliasProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AwsKmsAliasProperties if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the AwsKmsAliasProperties. + */ + public static AwsKmsAliasProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AwsKmsAliasProperties deserializedAwsKmsAliasProperties = new AwsKmsAliasProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("aliasName".equals(fieldName)) { + deserializedAwsKmsAliasProperties.aliasName = reader.getString(); + } else if ("targetKeyId".equals(fieldName)) { + deserializedAwsKmsAliasProperties.targetKeyId = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedAwsKmsAliasProperties; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/AwsKmsKeyProperties.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/AwsKmsKeyProperties.java new file mode 100644 index 000000000000..564ff95fe26c --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/AwsKmsKeyProperties.java @@ -0,0 +1,851 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; +import java.util.Map; + +/** + * Definition of awsKmsKey. + */ +@Fluent +public final class AwsKmsKeyProperties implements JsonSerializable { + /* + * Property arn + */ + private String arn; + + /* + * Skips ('bypasses') the key policy lockout safety check. The default value is false. Setting this value to true + * increases the risk that the KMS key becomes unmanageable. Do not set this value to true indiscriminately. For + * more information, see [Default key + * policy](https://docs.aws.amazon.com/kms/latest/developerguide/key-policy-default.html#prevent-unmanageable-key) + * in the *Developer Guide*. Use this parameter only when you intend to prevent the principal that is making the + * request from making a subsequent + * [PutKeyPolicy](https://docs.aws.amazon.com/kms/latest/APIReference/API_PutKeyPolicy.html) request on the KMS key. + */ + private Boolean bypassPolicyLockoutSafetyCheck; + + /* + * A description of the KMS key. Use a description that helps you to distinguish this KMS key from others in the + * account, such as its intended use. + */ + private String description; + + /* + * Enables automatic rotation of the key material for the specified KMS key. By default, automatic key rotation is + * not enabled. KMS supports automatic rotation only for symmetric encryption KMS keys (``KeySpec`` = + * ``SYMMETRIC_DEFAULT``). For asymmetric KMS keys, HMAC KMS keys, and KMS keys with Origin ``EXTERNAL``, omit the + * ``EnableKeyRotation`` property or set it to ``false``. To enable automatic key rotation of the key material for a + * multi-Region KMS key, set ``EnableKeyRotation`` to ``true`` on the primary key (created by using + * ``AWS::KMS::Key``). KMS copies the rotation status to all replica keys. For details, see [Rotating multi-Region + * keys](https://docs.aws.amazon.com/kms/latest/developerguide/multi-region-keys-manage.html#multi-region-rotate) in + * the *Developer Guide*. When you enable automatic rotation, KMS automatically creates new key material for the KMS + * key one year after the enable date and every year thereafter. KMS retains all key material until you delete the + * KMS key. For detailed information about automatic key rotation, see [Rotating KMS + * keys](https://docs.aws.amazon.com/kms/latest/developerguide/rotate-keys.html) in the *Developer Guide*. + */ + private Boolean enableKeyRotation; + + /* + * Specifies whether the KMS key is enabled. Disabled KMS keys cannot be used in cryptographic operations. When + * ``Enabled`` is ``true``, the *key state* of the KMS key is ``Enabled``. When ``Enabled`` is ``false``, the key + * state of the KMS key is ``Disabled``. The default value is ``true``. The actual key state of the KMS key might be + * affected by actions taken outside of CloudFormation, such as running the + * [EnableKey](https://docs.aws.amazon.com/kms/latest/APIReference/API_EnableKey.html), + * [DisableKey](https://docs.aws.amazon.com/kms/latest/APIReference/API_DisableKey.html), or + * [ScheduleKeyDeletion](https://docs.aws.amazon.com/kms/latest/APIReference/API_ScheduleKeyDeletion.html) + * operations. For information about the key states of a KMS key, see [Key state: Effect on your KMS + * key](https://docs.aws.amazon.com/kms/latest/developerguide/key-state.html) in the *Developer Guide*. + */ + private Boolean enabled; + + /* + * Property keyId + */ + private String keyId; + + /* + * The key policy to attach to the KMS key. If you provide a key policy, it must meet the following criteria: + The + * key policy must allow the caller to make a subsequent + * [PutKeyPolicy](https://docs.aws.amazon.com/kms/latest/APIReference/API_PutKeyPolicy.html) request on the KMS key. + * This reduces the risk that the KMS key becomes unmanageable. For more information, see [Default key + * policy](https://docs.aws.amazon.com/kms/latest/developerguide/key-policies.html#key-policy-default-allow-root- + * enable-iam) in the *Developer Guide*. (To omit this condition, set ``BypassPolicyLockoutSafetyCheck`` to true.) + + * Each statement in the key policy must contain one or more principals. The principals in the key policy must exist + * and be visible to KMS. When you create a new AWS principal (for example, an IAM user or role), you might need to + * enforce a delay before including the new principal in a key policy because the new principal might not be + * immediately visible to KMS. For more information, see [Changes that I make are not always immediately + * visible](https://docs.aws.amazon.com/IAM/latest/UserGuide/troubleshoot_general.html#troubleshoot_general_eventual + * -consistency) in the *User Guide*. If you do not provide a key policy, KMS attaches a default key policy to the + * KMS key. For more information, see [Default key + * policy](https://docs.aws.amazon.com/kms/latest/developerguide/key-policies.html#key-policy-default) in the + * *Developer Guide*. A key policy document can include only the following characters: + Printable ASCII characters + * + Printable characters in the Basic Latin and Latin-1 Supplement character set + The tab (``\u0009``), line feed + * (``\u000A``), and carriage return (``\u000D``) special characters *Minimum*: ``1`` *Maximum*: ``32768`` + */ + private Map keyPolicy; + + /* + * Specifies the type of KMS key to create. The default value, ``SYMMETRIC_DEFAULT``, creates a KMS key with a + * 256-bit symmetric key for encryption and decryption. In China Regions, ``SYMMETRIC_DEFAULT`` creates a 128-bit + * symmetric key that uses SM4 encryption. You can't change the ``KeySpec`` value after the KMS key is created. For + * help choosing a key spec for your KMS key, see [Choosing a KMS key + * type](https://docs.aws.amazon.com/kms/latest/developerguide/symm-asymm-choose.html) in the *Developer Guide*. The + * ``KeySpec`` property determines the type of key material in the KMS key and the algorithms that the KMS key + * supports. To further restrict the algorithms that can be used with the KMS key, use a condition key in its key + * policy or IAM policy. For more information, see [condition + * keys](https://docs.aws.amazon.com/kms/latest/developerguide/policy-conditions.html#conditions-kms) in the + * *Developer Guide*. If you change the value of the ``KeySpec`` property on an existing KMS key, the update request + * fails, regardless of the value of the [UpdateReplacePolicy + * attribute](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-updatereplacepolicy.html) + * . This prevents you from accidentally deleting a KMS key by changing an immutable property value. [services that + * are integrated with](https://docs.aws.amazon.com/kms/features/#AWS_Service_Integration) use symmetric encryption + * KMS keys to protect your data. These services do not support encryption with asymmetric KMS keys. For help + * determining whether a KMS key is asymmetric, see [Identifying asymmetric KMS + * keys](https://docs.aws.amazon.com/kms/latest/developerguide/find-symm-asymm.html) in the *Developer Guide*. KMS + * supports the following key specs for KMS keys: + Symmetric encryption key (default) + ``SYMMETRIC_DEFAULT`` + * (AES-256-GCM) + HMAC keys (symmetric) + ``HMAC_224`` + ``HMAC_256`` + ``HMAC_384`` + ``HMAC_512`` + Asymmetric + * RSA key pairs + ``RSA_2048`` + ``RSA_3072`` + ``RSA_4096`` + Asymmetric NIST-recommended elliptic curve key pairs + * + ``ECC_NIST_P256`` (secp256r1) + ``ECC_NIST_P384`` (secp384r1) + ``ECC_NIST_P521`` (secp521r1) + Other + * asymmetric elliptic curve key pairs + ``ECC_SECG_P256K1`` (secp256k1), commonly used for cryptocurrencies. + SM2 + * key pairs (China Regions only) + ``SM2`` + */ + private KeySpec keySpec; + + /* + * Determines the [cryptographic + * operations](https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#cryptographic-operations) for + * which you can use the KMS key. The default value is ``ENCRYPT_DECRYPT``. This property is required for asymmetric + * KMS keys and HMAC KMS keys. You can't change the ``KeyUsage`` value after the KMS key is created. If you change + * the value of the ``KeyUsage`` property on an existing KMS key, the update request fails, regardless of the value + * of the [UpdateReplacePolicy + * attribute](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-updatereplacepolicy.html) + * . This prevents you from accidentally deleting a KMS key by changing an immutable property value. Select only one + * valid value. + For symmetric encryption KMS keys, omit the property or specify ``ENCRYPT_DECRYPT``. + For + * asymmetric KMS keys with RSA key material, specify ``ENCRYPT_DECRYPT`` or ``SIGN_VERIFY``. + For asymmetric KMS + * keys with ECC key material, specify ``SIGN_VERIFY``. + For asymmetric KMS keys with SM2 (China Regions only) key + * material, specify ``ENCRYPT_DECRYPT`` or ``SIGN_VERIFY``. + For HMAC KMS keys, specify ``GENERATE_VERIFY_MAC``. + */ + private KeyUsage keyUsage; + + /* + * Creates a multi-Region primary key that you can replicate in other AWS-Regions. You can't change the + * ``MultiRegion`` value after the KMS key is created. For a list of AWS-Regions in which multi-Region keys are + * supported, see [Multi-Region keys + * in](https://docs.aws.amazon.com/kms/latest/developerguide/multi-region-keys-overview.html) in the **. If you + * change the value of the ``MultiRegion`` property on an existing KMS key, the update request fails, regardless of + * the value of the [UpdateReplacePolicy + * attribute](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-updatereplacepolicy.html) + * . This prevents you from accidentally deleting a KMS key by changing an immutable property value. For a + * multi-Region key, set to this property to ``true``. For a single-Region key, omit this property or set it to + * ``false``. The default value is ``false``. *Multi-Region keys* are an KMS feature that lets you create multiple + * interoperable KMS keys in different AWS-Regions. Because these KMS keys have the same key ID, key material, and + * other metadata, you can use them to encrypt data in one AWS-Region and decrypt it in a different AWS-Region + * without making a cross-Region call or exposing the plaintext data. For more information, see [Multi-Region + * keys](https://docs.aws.amazon.com/kms/latest/developerguide/multi-region-keys-overview.html) in the *Developer + * Guide*. You can create a symmetric encryption, HMAC, or asymmetric multi-Region KMS key, and you can create a + * multi-Region key with imported key material. However, you cannot create a multi-Region key in a custom key store. + * To create a replica of this primary key in a different AWS-Region , create an + * [AWS::KMS::ReplicaKey](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-kms-replicakey + * .html) resource in a CloudFormation stack in the replica Region. Specify the key ARN of this primary key. + */ + private Boolean multiRegion; + + /* + * The source of the key material for the KMS key. You cannot change the origin after you create the KMS key. The + * default is ``AWS_KMS``, which means that KMS creates the key material. To [create a KMS key with no key + * material](https://docs.aws.amazon.com/kms/latest/developerguide/importing-keys-create-cmk.html) (for imported key + * material), set this value to ``EXTERNAL``. For more information about importing key material into KMS, see + * [Importing Key Material](https://docs.aws.amazon.com/kms/latest/developerguide/importing-keys.html) in the + * *Developer Guide*. You can ignore ``ENABLED`` when Origin is ``EXTERNAL``. When a KMS key with Origin + * ``EXTERNAL`` is created, the key state is ``PENDING_IMPORT`` and ``ENABLED`` is ``false``. After you import the + * key material, ``ENABLED`` updated to ``true``. The KMS key can then be used for Cryptographic Operations. CFN + * doesn't support creating an ``Origin`` parameter of the ``AWS_CLOUDHSM`` or ``EXTERNAL_KEY_STORE`` values. + */ + private Origin origin; + + /* + * Specifies the number of days in the waiting period before KMS deletes a KMS key that has been removed from a + * CloudFormation stack. Enter a value between 7 and 30 days. The default value is 30 days. When you remove a KMS + * key from a CloudFormation stack, KMS schedules the KMS key for deletion and starts the mandatory waiting period. + * The ``PendingWindowInDays`` property determines the length of waiting period. During the waiting period, the key + * state of KMS key is ``Pending Deletion`` or ``Pending Replica Deletion``, which prevents the KMS key from being + * used in cryptographic operations. When the waiting period expires, KMS permanently deletes the KMS key. KMS will + * not delete a [multi-Region primary + * key](https://docs.aws.amazon.com/kms/latest/developerguide/multi-region-keys-overview.html) that has replica + * keys. If you remove a multi-Region primary key from a CloudFormation stack, its key state changes to + * ``PendingReplicaDeletion`` so it cannot be replicated or used in cryptographic operations. This state can persist + * indefinitely. When the last of its replica keys is deleted, the key state of the primary key changes to + * ``PendingDeletion`` and the waiting period specified by ``PendingWindowInDays`` begins. When this waiting period + * expires, KMS deletes the primary key. For details, see [Deleting multi-Region + * keys](https://docs.aws.amazon.com/kms/latest/developerguide/multi-region-keys-delete.html) in the *Developer + * Guide*. You cannot use a CloudFormation template to cancel deletion of the KMS key after you remove it from the + * stack, regardless of the waiting period. If you specify a KMS key in your template, even one with the same name, + * CloudFormation creates a new KMS key. To cancel deletion of a KMS key, use the KMS console or the + * [CancelKeyDeletion](https://docs.aws.amazon.com/kms/latest/APIReference/API_CancelKeyDeletion.html) operation. + * For information about the ``Pending Deletion`` and ``Pending Replica Deletion`` key states, see [Key state: + * Effect on your KMS key](https://docs.aws.amazon.com/kms/latest/developerguide/key-state.html) in the *Developer + * Guide*. For more information about deleting KMS keys, see the + * [ScheduleKeyDeletion](https://docs.aws.amazon.com/kms/latest/APIReference/API_ScheduleKeyDeletion.html) operation + * in the *API Reference* and [Deleting KMS + * keys](https://docs.aws.amazon.com/kms/latest/developerguide/deleting-keys.html) in the *Developer Guide*. + */ + private Integer pendingWindowInDays; + + /* + * Property rotationPeriodInDays + */ + private Integer rotationPeriodInDays; + + /* + * Assigns one or more tags to the replica key. Tagging or untagging a KMS key can allow or deny permission to the + * KMS key. For details, see [ABAC for](https://docs.aws.amazon.com/kms/latest/developerguide/abac.html) in the + * *Developer Guide*. For information about tags in KMS, see [Tagging + * keys](https://docs.aws.amazon.com/kms/latest/developerguide/tagging-keys.html) in the *Developer Guide*. For + * information about tags in CloudFormation, see + * [Tag](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-resource-tags.html). + */ + private List tags; + + /** + * Creates an instance of AwsKmsKeyProperties class. + */ + public AwsKmsKeyProperties() { + } + + /** + * Get the arn property: Property arn. + * + * @return the arn value. + */ + public String arn() { + return this.arn; + } + + /** + * Set the arn property: Property arn. + * + * @param arn the arn value to set. + * @return the AwsKmsKeyProperties object itself. + */ + public AwsKmsKeyProperties withArn(String arn) { + this.arn = arn; + return this; + } + + /** + * Get the bypassPolicyLockoutSafetyCheck property: Skips ('bypasses') the key policy lockout safety check. The + * default value is false. Setting this value to true increases the risk that the KMS key becomes unmanageable. Do + * not set this value to true indiscriminately. For more information, see [Default key + * policy](https://docs.aws.amazon.com/kms/latest/developerguide/key-policy-default.html#prevent-unmanageable-key) + * in the *Developer Guide*. Use this parameter only when you intend to prevent the principal that is making the + * request from making a subsequent + * [PutKeyPolicy](https://docs.aws.amazon.com/kms/latest/APIReference/API_PutKeyPolicy.html) request on the KMS key. + * + * @return the bypassPolicyLockoutSafetyCheck value. + */ + public Boolean bypassPolicyLockoutSafetyCheck() { + return this.bypassPolicyLockoutSafetyCheck; + } + + /** + * Set the bypassPolicyLockoutSafetyCheck property: Skips ('bypasses') the key policy lockout safety check. The + * default value is false. Setting this value to true increases the risk that the KMS key becomes unmanageable. Do + * not set this value to true indiscriminately. For more information, see [Default key + * policy](https://docs.aws.amazon.com/kms/latest/developerguide/key-policy-default.html#prevent-unmanageable-key) + * in the *Developer Guide*. Use this parameter only when you intend to prevent the principal that is making the + * request from making a subsequent + * [PutKeyPolicy](https://docs.aws.amazon.com/kms/latest/APIReference/API_PutKeyPolicy.html) request on the KMS key. + * + * @param bypassPolicyLockoutSafetyCheck the bypassPolicyLockoutSafetyCheck value to set. + * @return the AwsKmsKeyProperties object itself. + */ + public AwsKmsKeyProperties withBypassPolicyLockoutSafetyCheck(Boolean bypassPolicyLockoutSafetyCheck) { + this.bypassPolicyLockoutSafetyCheck = bypassPolicyLockoutSafetyCheck; + return this; + } + + /** + * Get the description property: A description of the KMS key. Use a description that helps you to distinguish this + * KMS key from others in the account, such as its intended use. + * + * @return the description value. + */ + public String description() { + return this.description; + } + + /** + * Set the description property: A description of the KMS key. Use a description that helps you to distinguish this + * KMS key from others in the account, such as its intended use. + * + * @param description the description value to set. + * @return the AwsKmsKeyProperties object itself. + */ + public AwsKmsKeyProperties withDescription(String description) { + this.description = description; + return this; + } + + /** + * Get the enableKeyRotation property: Enables automatic rotation of the key material for the specified KMS key. By + * default, automatic key rotation is not enabled. KMS supports automatic rotation only for symmetric encryption KMS + * keys (``KeySpec`` = ``SYMMETRIC_DEFAULT``). For asymmetric KMS keys, HMAC KMS keys, and KMS keys with Origin + * ``EXTERNAL``, omit the ``EnableKeyRotation`` property or set it to ``false``. To enable automatic key rotation of + * the key material for a multi-Region KMS key, set ``EnableKeyRotation`` to ``true`` on the primary key (created by + * using ``AWS::KMS::Key``). KMS copies the rotation status to all replica keys. For details, see [Rotating + * multi-Region + * keys](https://docs.aws.amazon.com/kms/latest/developerguide/multi-region-keys-manage.html#multi-region-rotate) in + * the *Developer Guide*. When you enable automatic rotation, KMS automatically creates new key material for the KMS + * key one year after the enable date and every year thereafter. KMS retains all key material until you delete the + * KMS key. For detailed information about automatic key rotation, see [Rotating KMS + * keys](https://docs.aws.amazon.com/kms/latest/developerguide/rotate-keys.html) in the *Developer Guide*. + * + * @return the enableKeyRotation value. + */ + public Boolean enableKeyRotation() { + return this.enableKeyRotation; + } + + /** + * Set the enableKeyRotation property: Enables automatic rotation of the key material for the specified KMS key. By + * default, automatic key rotation is not enabled. KMS supports automatic rotation only for symmetric encryption KMS + * keys (``KeySpec`` = ``SYMMETRIC_DEFAULT``). For asymmetric KMS keys, HMAC KMS keys, and KMS keys with Origin + * ``EXTERNAL``, omit the ``EnableKeyRotation`` property or set it to ``false``. To enable automatic key rotation of + * the key material for a multi-Region KMS key, set ``EnableKeyRotation`` to ``true`` on the primary key (created by + * using ``AWS::KMS::Key``). KMS copies the rotation status to all replica keys. For details, see [Rotating + * multi-Region + * keys](https://docs.aws.amazon.com/kms/latest/developerguide/multi-region-keys-manage.html#multi-region-rotate) in + * the *Developer Guide*. When you enable automatic rotation, KMS automatically creates new key material for the KMS + * key one year after the enable date and every year thereafter. KMS retains all key material until you delete the + * KMS key. For detailed information about automatic key rotation, see [Rotating KMS + * keys](https://docs.aws.amazon.com/kms/latest/developerguide/rotate-keys.html) in the *Developer Guide*. + * + * @param enableKeyRotation the enableKeyRotation value to set. + * @return the AwsKmsKeyProperties object itself. + */ + public AwsKmsKeyProperties withEnableKeyRotation(Boolean enableKeyRotation) { + this.enableKeyRotation = enableKeyRotation; + return this; + } + + /** + * Get the enabled property: Specifies whether the KMS key is enabled. Disabled KMS keys cannot be used in + * cryptographic operations. When ``Enabled`` is ``true``, the *key state* of the KMS key is ``Enabled``. When + * ``Enabled`` is ``false``, the key state of the KMS key is ``Disabled``. The default value is ``true``. The actual + * key state of the KMS key might be affected by actions taken outside of CloudFormation, such as running the + * [EnableKey](https://docs.aws.amazon.com/kms/latest/APIReference/API_EnableKey.html), + * [DisableKey](https://docs.aws.amazon.com/kms/latest/APIReference/API_DisableKey.html), or + * [ScheduleKeyDeletion](https://docs.aws.amazon.com/kms/latest/APIReference/API_ScheduleKeyDeletion.html) + * operations. For information about the key states of a KMS key, see [Key state: Effect on your KMS + * key](https://docs.aws.amazon.com/kms/latest/developerguide/key-state.html) in the *Developer Guide*. + * + * @return the enabled value. + */ + public Boolean enabled() { + return this.enabled; + } + + /** + * Set the enabled property: Specifies whether the KMS key is enabled. Disabled KMS keys cannot be used in + * cryptographic operations. When ``Enabled`` is ``true``, the *key state* of the KMS key is ``Enabled``. When + * ``Enabled`` is ``false``, the key state of the KMS key is ``Disabled``. The default value is ``true``. The actual + * key state of the KMS key might be affected by actions taken outside of CloudFormation, such as running the + * [EnableKey](https://docs.aws.amazon.com/kms/latest/APIReference/API_EnableKey.html), + * [DisableKey](https://docs.aws.amazon.com/kms/latest/APIReference/API_DisableKey.html), or + * [ScheduleKeyDeletion](https://docs.aws.amazon.com/kms/latest/APIReference/API_ScheduleKeyDeletion.html) + * operations. For information about the key states of a KMS key, see [Key state: Effect on your KMS + * key](https://docs.aws.amazon.com/kms/latest/developerguide/key-state.html) in the *Developer Guide*. + * + * @param enabled the enabled value to set. + * @return the AwsKmsKeyProperties object itself. + */ + public AwsKmsKeyProperties withEnabled(Boolean enabled) { + this.enabled = enabled; + return this; + } + + /** + * Get the keyId property: Property keyId. + * + * @return the keyId value. + */ + public String keyId() { + return this.keyId; + } + + /** + * Set the keyId property: Property keyId. + * + * @param keyId the keyId value to set. + * @return the AwsKmsKeyProperties object itself. + */ + public AwsKmsKeyProperties withKeyId(String keyId) { + this.keyId = keyId; + return this; + } + + /** + * Get the keyPolicy property: The key policy to attach to the KMS key. If you provide a key policy, it must meet + * the following criteria: + The key policy must allow the caller to make a subsequent + * [PutKeyPolicy](https://docs.aws.amazon.com/kms/latest/APIReference/API_PutKeyPolicy.html) request on the KMS key. + * This reduces the risk that the KMS key becomes unmanageable. For more information, see [Default key + * policy](https://docs.aws.amazon.com/kms/latest/developerguide/key-policies.html#key-policy-default-allow-root-enable-iam) + * in the *Developer Guide*. (To omit this condition, set ``BypassPolicyLockoutSafetyCheck`` to true.) + Each + * statement in the key policy must contain one or more principals. The principals in the key policy must exist and + * be visible to KMS. When you create a new AWS principal (for example, an IAM user or role), you might need to + * enforce a delay before including the new principal in a key policy because the new principal might not be + * immediately visible to KMS. For more information, see [Changes that I make are not always immediately + * visible](https://docs.aws.amazon.com/IAM/latest/UserGuide/troubleshoot_general.html#troubleshoot_general_eventual-consistency) + * in the *User Guide*. If you do not provide a key policy, KMS attaches a default key policy to the KMS key. For + * more information, see [Default key + * policy](https://docs.aws.amazon.com/kms/latest/developerguide/key-policies.html#key-policy-default) in the + * *Developer Guide*. A key policy document can include only the following characters: + Printable ASCII characters + * + Printable characters in the Basic Latin and Latin-1 Supplement character set + The tab (``\u0009``), line feed + * (``\u000A``), and carriage return (``\u000D``) special characters *Minimum*: ``1`` *Maximum*: ``32768``. + * + * @return the keyPolicy value. + */ + public Map keyPolicy() { + return this.keyPolicy; + } + + /** + * Set the keyPolicy property: The key policy to attach to the KMS key. If you provide a key policy, it must meet + * the following criteria: + The key policy must allow the caller to make a subsequent + * [PutKeyPolicy](https://docs.aws.amazon.com/kms/latest/APIReference/API_PutKeyPolicy.html) request on the KMS key. + * This reduces the risk that the KMS key becomes unmanageable. For more information, see [Default key + * policy](https://docs.aws.amazon.com/kms/latest/developerguide/key-policies.html#key-policy-default-allow-root-enable-iam) + * in the *Developer Guide*. (To omit this condition, set ``BypassPolicyLockoutSafetyCheck`` to true.) + Each + * statement in the key policy must contain one or more principals. The principals in the key policy must exist and + * be visible to KMS. When you create a new AWS principal (for example, an IAM user or role), you might need to + * enforce a delay before including the new principal in a key policy because the new principal might not be + * immediately visible to KMS. For more information, see [Changes that I make are not always immediately + * visible](https://docs.aws.amazon.com/IAM/latest/UserGuide/troubleshoot_general.html#troubleshoot_general_eventual-consistency) + * in the *User Guide*. If you do not provide a key policy, KMS attaches a default key policy to the KMS key. For + * more information, see [Default key + * policy](https://docs.aws.amazon.com/kms/latest/developerguide/key-policies.html#key-policy-default) in the + * *Developer Guide*. A key policy document can include only the following characters: + Printable ASCII characters + * + Printable characters in the Basic Latin and Latin-1 Supplement character set + The tab (``\u0009``), line feed + * (``\u000A``), and carriage return (``\u000D``) special characters *Minimum*: ``1`` *Maximum*: ``32768``. + * + * @param keyPolicy the keyPolicy value to set. + * @return the AwsKmsKeyProperties object itself. + */ + public AwsKmsKeyProperties withKeyPolicy(Map keyPolicy) { + this.keyPolicy = keyPolicy; + return this; + } + + /** + * Get the keySpec property: Specifies the type of KMS key to create. The default value, ``SYMMETRIC_DEFAULT``, + * creates a KMS key with a 256-bit symmetric key for encryption and decryption. In China Regions, + * ``SYMMETRIC_DEFAULT`` creates a 128-bit symmetric key that uses SM4 encryption. You can't change the ``KeySpec`` + * value after the KMS key is created. For help choosing a key spec for your KMS key, see [Choosing a KMS key + * type](https://docs.aws.amazon.com/kms/latest/developerguide/symm-asymm-choose.html) in the *Developer Guide*. The + * ``KeySpec`` property determines the type of key material in the KMS key and the algorithms that the KMS key + * supports. To further restrict the algorithms that can be used with the KMS key, use a condition key in its key + * policy or IAM policy. For more information, see [condition + * keys](https://docs.aws.amazon.com/kms/latest/developerguide/policy-conditions.html#conditions-kms) in the + * *Developer Guide*. If you change the value of the ``KeySpec`` property on an existing KMS key, the update request + * fails, regardless of the value of the [UpdateReplacePolicy + * attribute](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-updatereplacepolicy.html). + * This prevents you from accidentally deleting a KMS key by changing an immutable property value. [services that + * are integrated with](https://docs.aws.amazon.com/kms/features/#AWS_Service_Integration) use symmetric encryption + * KMS keys to protect your data. These services do not support encryption with asymmetric KMS keys. For help + * determining whether a KMS key is asymmetric, see [Identifying asymmetric KMS + * keys](https://docs.aws.amazon.com/kms/latest/developerguide/find-symm-asymm.html) in the *Developer Guide*. KMS + * supports the following key specs for KMS keys: + Symmetric encryption key (default) + ``SYMMETRIC_DEFAULT`` + * (AES-256-GCM) + HMAC keys (symmetric) + ``HMAC_224`` + ``HMAC_256`` + ``HMAC_384`` + ``HMAC_512`` + Asymmetric + * RSA key pairs + ``RSA_2048`` + ``RSA_3072`` + ``RSA_4096`` + Asymmetric NIST-recommended elliptic curve key pairs + * + ``ECC_NIST_P256`` (secp256r1) + ``ECC_NIST_P384`` (secp384r1) + ``ECC_NIST_P521`` (secp521r1) + Other + * asymmetric elliptic curve key pairs + ``ECC_SECG_P256K1`` (secp256k1), commonly used for cryptocurrencies. + SM2 + * key pairs (China Regions only) + ``SM2``. + * + * @return the keySpec value. + */ + public KeySpec keySpec() { + return this.keySpec; + } + + /** + * Set the keySpec property: Specifies the type of KMS key to create. The default value, ``SYMMETRIC_DEFAULT``, + * creates a KMS key with a 256-bit symmetric key for encryption and decryption. In China Regions, + * ``SYMMETRIC_DEFAULT`` creates a 128-bit symmetric key that uses SM4 encryption. You can't change the ``KeySpec`` + * value after the KMS key is created. For help choosing a key spec for your KMS key, see [Choosing a KMS key + * type](https://docs.aws.amazon.com/kms/latest/developerguide/symm-asymm-choose.html) in the *Developer Guide*. The + * ``KeySpec`` property determines the type of key material in the KMS key and the algorithms that the KMS key + * supports. To further restrict the algorithms that can be used with the KMS key, use a condition key in its key + * policy or IAM policy. For more information, see [condition + * keys](https://docs.aws.amazon.com/kms/latest/developerguide/policy-conditions.html#conditions-kms) in the + * *Developer Guide*. If you change the value of the ``KeySpec`` property on an existing KMS key, the update request + * fails, regardless of the value of the [UpdateReplacePolicy + * attribute](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-updatereplacepolicy.html). + * This prevents you from accidentally deleting a KMS key by changing an immutable property value. [services that + * are integrated with](https://docs.aws.amazon.com/kms/features/#AWS_Service_Integration) use symmetric encryption + * KMS keys to protect your data. These services do not support encryption with asymmetric KMS keys. For help + * determining whether a KMS key is asymmetric, see [Identifying asymmetric KMS + * keys](https://docs.aws.amazon.com/kms/latest/developerguide/find-symm-asymm.html) in the *Developer Guide*. KMS + * supports the following key specs for KMS keys: + Symmetric encryption key (default) + ``SYMMETRIC_DEFAULT`` + * (AES-256-GCM) + HMAC keys (symmetric) + ``HMAC_224`` + ``HMAC_256`` + ``HMAC_384`` + ``HMAC_512`` + Asymmetric + * RSA key pairs + ``RSA_2048`` + ``RSA_3072`` + ``RSA_4096`` + Asymmetric NIST-recommended elliptic curve key pairs + * + ``ECC_NIST_P256`` (secp256r1) + ``ECC_NIST_P384`` (secp384r1) + ``ECC_NIST_P521`` (secp521r1) + Other + * asymmetric elliptic curve key pairs + ``ECC_SECG_P256K1`` (secp256k1), commonly used for cryptocurrencies. + SM2 + * key pairs (China Regions only) + ``SM2``. + * + * @param keySpec the keySpec value to set. + * @return the AwsKmsKeyProperties object itself. + */ + public AwsKmsKeyProperties withKeySpec(KeySpec keySpec) { + this.keySpec = keySpec; + return this; + } + + /** + * Get the keyUsage property: Determines the [cryptographic + * operations](https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#cryptographic-operations) for + * which you can use the KMS key. The default value is ``ENCRYPT_DECRYPT``. This property is required for asymmetric + * KMS keys and HMAC KMS keys. You can't change the ``KeyUsage`` value after the KMS key is created. If you change + * the value of the ``KeyUsage`` property on an existing KMS key, the update request fails, regardless of the value + * of the [UpdateReplacePolicy + * attribute](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-updatereplacepolicy.html). + * This prevents you from accidentally deleting a KMS key by changing an immutable property value. Select only one + * valid value. + For symmetric encryption KMS keys, omit the property or specify ``ENCRYPT_DECRYPT``. + For + * asymmetric KMS keys with RSA key material, specify ``ENCRYPT_DECRYPT`` or ``SIGN_VERIFY``. + For asymmetric KMS + * keys with ECC key material, specify ``SIGN_VERIFY``. + For asymmetric KMS keys with SM2 (China Regions only) key + * material, specify ``ENCRYPT_DECRYPT`` or ``SIGN_VERIFY``. + For HMAC KMS keys, specify ``GENERATE_VERIFY_MAC``. + * + * @return the keyUsage value. + */ + public KeyUsage keyUsage() { + return this.keyUsage; + } + + /** + * Set the keyUsage property: Determines the [cryptographic + * operations](https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#cryptographic-operations) for + * which you can use the KMS key. The default value is ``ENCRYPT_DECRYPT``. This property is required for asymmetric + * KMS keys and HMAC KMS keys. You can't change the ``KeyUsage`` value after the KMS key is created. If you change + * the value of the ``KeyUsage`` property on an existing KMS key, the update request fails, regardless of the value + * of the [UpdateReplacePolicy + * attribute](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-updatereplacepolicy.html). + * This prevents you from accidentally deleting a KMS key by changing an immutable property value. Select only one + * valid value. + For symmetric encryption KMS keys, omit the property or specify ``ENCRYPT_DECRYPT``. + For + * asymmetric KMS keys with RSA key material, specify ``ENCRYPT_DECRYPT`` or ``SIGN_VERIFY``. + For asymmetric KMS + * keys with ECC key material, specify ``SIGN_VERIFY``. + For asymmetric KMS keys with SM2 (China Regions only) key + * material, specify ``ENCRYPT_DECRYPT`` or ``SIGN_VERIFY``. + For HMAC KMS keys, specify ``GENERATE_VERIFY_MAC``. + * + * @param keyUsage the keyUsage value to set. + * @return the AwsKmsKeyProperties object itself. + */ + public AwsKmsKeyProperties withKeyUsage(KeyUsage keyUsage) { + this.keyUsage = keyUsage; + return this; + } + + /** + * Get the multiRegion property: Creates a multi-Region primary key that you can replicate in other AWS-Regions. You + * can't change the ``MultiRegion`` value after the KMS key is created. For a list of AWS-Regions in which + * multi-Region keys are supported, see [Multi-Region keys + * in](https://docs.aws.amazon.com/kms/latest/developerguide/multi-region-keys-overview.html) in the **. If you + * change the value of the ``MultiRegion`` property on an existing KMS key, the update request fails, regardless of + * the value of the [UpdateReplacePolicy + * attribute](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-updatereplacepolicy.html). + * This prevents you from accidentally deleting a KMS key by changing an immutable property value. For a + * multi-Region key, set to this property to ``true``. For a single-Region key, omit this property or set it to + * ``false``. The default value is ``false``. *Multi-Region keys* are an KMS feature that lets you create multiple + * interoperable KMS keys in different AWS-Regions. Because these KMS keys have the same key ID, key material, and + * other metadata, you can use them to encrypt data in one AWS-Region and decrypt it in a different AWS-Region + * without making a cross-Region call or exposing the plaintext data. For more information, see [Multi-Region + * keys](https://docs.aws.amazon.com/kms/latest/developerguide/multi-region-keys-overview.html) in the *Developer + * Guide*. You can create a symmetric encryption, HMAC, or asymmetric multi-Region KMS key, and you can create a + * multi-Region key with imported key material. However, you cannot create a multi-Region key in a custom key store. + * To create a replica of this primary key in a different AWS-Region , create an + * [AWS::KMS::ReplicaKey](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-kms-replicakey.html) + * resource in a CloudFormation stack in the replica Region. Specify the key ARN of this primary key. + * + * @return the multiRegion value. + */ + public Boolean multiRegion() { + return this.multiRegion; + } + + /** + * Set the multiRegion property: Creates a multi-Region primary key that you can replicate in other AWS-Regions. You + * can't change the ``MultiRegion`` value after the KMS key is created. For a list of AWS-Regions in which + * multi-Region keys are supported, see [Multi-Region keys + * in](https://docs.aws.amazon.com/kms/latest/developerguide/multi-region-keys-overview.html) in the **. If you + * change the value of the ``MultiRegion`` property on an existing KMS key, the update request fails, regardless of + * the value of the [UpdateReplacePolicy + * attribute](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-updatereplacepolicy.html). + * This prevents you from accidentally deleting a KMS key by changing an immutable property value. For a + * multi-Region key, set to this property to ``true``. For a single-Region key, omit this property or set it to + * ``false``. The default value is ``false``. *Multi-Region keys* are an KMS feature that lets you create multiple + * interoperable KMS keys in different AWS-Regions. Because these KMS keys have the same key ID, key material, and + * other metadata, you can use them to encrypt data in one AWS-Region and decrypt it in a different AWS-Region + * without making a cross-Region call or exposing the plaintext data. For more information, see [Multi-Region + * keys](https://docs.aws.amazon.com/kms/latest/developerguide/multi-region-keys-overview.html) in the *Developer + * Guide*. You can create a symmetric encryption, HMAC, or asymmetric multi-Region KMS key, and you can create a + * multi-Region key with imported key material. However, you cannot create a multi-Region key in a custom key store. + * To create a replica of this primary key in a different AWS-Region , create an + * [AWS::KMS::ReplicaKey](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-kms-replicakey.html) + * resource in a CloudFormation stack in the replica Region. Specify the key ARN of this primary key. + * + * @param multiRegion the multiRegion value to set. + * @return the AwsKmsKeyProperties object itself. + */ + public AwsKmsKeyProperties withMultiRegion(Boolean multiRegion) { + this.multiRegion = multiRegion; + return this; + } + + /** + * Get the origin property: The source of the key material for the KMS key. You cannot change the origin after you + * create the KMS key. The default is ``AWS_KMS``, which means that KMS creates the key material. To [create a KMS + * key with no key material](https://docs.aws.amazon.com/kms/latest/developerguide/importing-keys-create-cmk.html) + * (for imported key material), set this value to ``EXTERNAL``. For more information about importing key material + * into KMS, see [Importing Key Material](https://docs.aws.amazon.com/kms/latest/developerguide/importing-keys.html) + * in the *Developer Guide*. You can ignore ``ENABLED`` when Origin is ``EXTERNAL``. When a KMS key with Origin + * ``EXTERNAL`` is created, the key state is ``PENDING_IMPORT`` and ``ENABLED`` is ``false``. After you import the + * key material, ``ENABLED`` updated to ``true``. The KMS key can then be used for Cryptographic Operations. CFN + * doesn't support creating an ``Origin`` parameter of the ``AWS_CLOUDHSM`` or ``EXTERNAL_KEY_STORE`` values. + * + * @return the origin value. + */ + public Origin origin() { + return this.origin; + } + + /** + * Set the origin property: The source of the key material for the KMS key. You cannot change the origin after you + * create the KMS key. The default is ``AWS_KMS``, which means that KMS creates the key material. To [create a KMS + * key with no key material](https://docs.aws.amazon.com/kms/latest/developerguide/importing-keys-create-cmk.html) + * (for imported key material), set this value to ``EXTERNAL``. For more information about importing key material + * into KMS, see [Importing Key Material](https://docs.aws.amazon.com/kms/latest/developerguide/importing-keys.html) + * in the *Developer Guide*. You can ignore ``ENABLED`` when Origin is ``EXTERNAL``. When a KMS key with Origin + * ``EXTERNAL`` is created, the key state is ``PENDING_IMPORT`` and ``ENABLED`` is ``false``. After you import the + * key material, ``ENABLED`` updated to ``true``. The KMS key can then be used for Cryptographic Operations. CFN + * doesn't support creating an ``Origin`` parameter of the ``AWS_CLOUDHSM`` or ``EXTERNAL_KEY_STORE`` values. + * + * @param origin the origin value to set. + * @return the AwsKmsKeyProperties object itself. + */ + public AwsKmsKeyProperties withOrigin(Origin origin) { + this.origin = origin; + return this; + } + + /** + * Get the pendingWindowInDays property: Specifies the number of days in the waiting period before KMS deletes a KMS + * key that has been removed from a CloudFormation stack. Enter a value between 7 and 30 days. The default value is + * 30 days. When you remove a KMS key from a CloudFormation stack, KMS schedules the KMS key for deletion and starts + * the mandatory waiting period. The ``PendingWindowInDays`` property determines the length of waiting period. + * During the waiting period, the key state of KMS key is ``Pending Deletion`` or ``Pending Replica Deletion``, + * which prevents the KMS key from being used in cryptographic operations. When the waiting period expires, KMS + * permanently deletes the KMS key. KMS will not delete a [multi-Region primary + * key](https://docs.aws.amazon.com/kms/latest/developerguide/multi-region-keys-overview.html) that has replica + * keys. If you remove a multi-Region primary key from a CloudFormation stack, its key state changes to + * ``PendingReplicaDeletion`` so it cannot be replicated or used in cryptographic operations. This state can persist + * indefinitely. When the last of its replica keys is deleted, the key state of the primary key changes to + * ``PendingDeletion`` and the waiting period specified by ``PendingWindowInDays`` begins. When this waiting period + * expires, KMS deletes the primary key. For details, see [Deleting multi-Region + * keys](https://docs.aws.amazon.com/kms/latest/developerguide/multi-region-keys-delete.html) in the *Developer + * Guide*. You cannot use a CloudFormation template to cancel deletion of the KMS key after you remove it from the + * stack, regardless of the waiting period. If you specify a KMS key in your template, even one with the same name, + * CloudFormation creates a new KMS key. To cancel deletion of a KMS key, use the KMS console or the + * [CancelKeyDeletion](https://docs.aws.amazon.com/kms/latest/APIReference/API_CancelKeyDeletion.html) operation. + * For information about the ``Pending Deletion`` and ``Pending Replica Deletion`` key states, see [Key state: + * Effect on your KMS key](https://docs.aws.amazon.com/kms/latest/developerguide/key-state.html) in the *Developer + * Guide*. For more information about deleting KMS keys, see the + * [ScheduleKeyDeletion](https://docs.aws.amazon.com/kms/latest/APIReference/API_ScheduleKeyDeletion.html) operation + * in the *API Reference* and [Deleting KMS + * keys](https://docs.aws.amazon.com/kms/latest/developerguide/deleting-keys.html) in the *Developer Guide*. + * + * @return the pendingWindowInDays value. + */ + public Integer pendingWindowInDays() { + return this.pendingWindowInDays; + } + + /** + * Set the pendingWindowInDays property: Specifies the number of days in the waiting period before KMS deletes a KMS + * key that has been removed from a CloudFormation stack. Enter a value between 7 and 30 days. The default value is + * 30 days. When you remove a KMS key from a CloudFormation stack, KMS schedules the KMS key for deletion and starts + * the mandatory waiting period. The ``PendingWindowInDays`` property determines the length of waiting period. + * During the waiting period, the key state of KMS key is ``Pending Deletion`` or ``Pending Replica Deletion``, + * which prevents the KMS key from being used in cryptographic operations. When the waiting period expires, KMS + * permanently deletes the KMS key. KMS will not delete a [multi-Region primary + * key](https://docs.aws.amazon.com/kms/latest/developerguide/multi-region-keys-overview.html) that has replica + * keys. If you remove a multi-Region primary key from a CloudFormation stack, its key state changes to + * ``PendingReplicaDeletion`` so it cannot be replicated or used in cryptographic operations. This state can persist + * indefinitely. When the last of its replica keys is deleted, the key state of the primary key changes to + * ``PendingDeletion`` and the waiting period specified by ``PendingWindowInDays`` begins. When this waiting period + * expires, KMS deletes the primary key. For details, see [Deleting multi-Region + * keys](https://docs.aws.amazon.com/kms/latest/developerguide/multi-region-keys-delete.html) in the *Developer + * Guide*. You cannot use a CloudFormation template to cancel deletion of the KMS key after you remove it from the + * stack, regardless of the waiting period. If you specify a KMS key in your template, even one with the same name, + * CloudFormation creates a new KMS key. To cancel deletion of a KMS key, use the KMS console or the + * [CancelKeyDeletion](https://docs.aws.amazon.com/kms/latest/APIReference/API_CancelKeyDeletion.html) operation. + * For information about the ``Pending Deletion`` and ``Pending Replica Deletion`` key states, see [Key state: + * Effect on your KMS key](https://docs.aws.amazon.com/kms/latest/developerguide/key-state.html) in the *Developer + * Guide*. For more information about deleting KMS keys, see the + * [ScheduleKeyDeletion](https://docs.aws.amazon.com/kms/latest/APIReference/API_ScheduleKeyDeletion.html) operation + * in the *API Reference* and [Deleting KMS + * keys](https://docs.aws.amazon.com/kms/latest/developerguide/deleting-keys.html) in the *Developer Guide*. + * + * @param pendingWindowInDays the pendingWindowInDays value to set. + * @return the AwsKmsKeyProperties object itself. + */ + public AwsKmsKeyProperties withPendingWindowInDays(Integer pendingWindowInDays) { + this.pendingWindowInDays = pendingWindowInDays; + return this; + } + + /** + * Get the rotationPeriodInDays property: Property rotationPeriodInDays. + * + * @return the rotationPeriodInDays value. + */ + public Integer rotationPeriodInDays() { + return this.rotationPeriodInDays; + } + + /** + * Set the rotationPeriodInDays property: Property rotationPeriodInDays. + * + * @param rotationPeriodInDays the rotationPeriodInDays value to set. + * @return the AwsKmsKeyProperties object itself. + */ + public AwsKmsKeyProperties withRotationPeriodInDays(Integer rotationPeriodInDays) { + this.rotationPeriodInDays = rotationPeriodInDays; + return this; + } + + /** + * Get the tags property: Assigns one or more tags to the replica key. Tagging or untagging a KMS key can allow or + * deny permission to the KMS key. For details, see [ABAC + * for](https://docs.aws.amazon.com/kms/latest/developerguide/abac.html) in the *Developer Guide*. For information + * about tags in KMS, see [Tagging keys](https://docs.aws.amazon.com/kms/latest/developerguide/tagging-keys.html) in + * the *Developer Guide*. For information about tags in CloudFormation, see + * [Tag](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-resource-tags.html). + * + * @return the tags value. + */ + public List tags() { + return this.tags; + } + + /** + * Set the tags property: Assigns one or more tags to the replica key. Tagging or untagging a KMS key can allow or + * deny permission to the KMS key. For details, see [ABAC + * for](https://docs.aws.amazon.com/kms/latest/developerguide/abac.html) in the *Developer Guide*. For information + * about tags in KMS, see [Tagging keys](https://docs.aws.amazon.com/kms/latest/developerguide/tagging-keys.html) in + * the *Developer Guide*. For information about tags in CloudFormation, see + * [Tag](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-resource-tags.html). + * + * @param tags the tags value to set. + * @return the AwsKmsKeyProperties object itself. + */ + public AwsKmsKeyProperties withTags(List tags) { + this.tags = tags; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (tags() != null) { + tags().forEach(e -> e.validate()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("arn", this.arn); + jsonWriter.writeBooleanField("bypassPolicyLockoutSafetyCheck", this.bypassPolicyLockoutSafetyCheck); + jsonWriter.writeStringField("description", this.description); + jsonWriter.writeBooleanField("enableKeyRotation", this.enableKeyRotation); + jsonWriter.writeBooleanField("enabled", this.enabled); + jsonWriter.writeStringField("keyId", this.keyId); + jsonWriter.writeMapField("keyPolicy", this.keyPolicy, (writer, element) -> writer.writeUntyped(element)); + jsonWriter.writeStringField("keySpec", this.keySpec == null ? null : this.keySpec.toString()); + jsonWriter.writeStringField("keyUsage", this.keyUsage == null ? null : this.keyUsage.toString()); + jsonWriter.writeBooleanField("multiRegion", this.multiRegion); + jsonWriter.writeStringField("origin", this.origin == null ? null : this.origin.toString()); + jsonWriter.writeNumberField("pendingWindowInDays", this.pendingWindowInDays); + jsonWriter.writeNumberField("rotationPeriodInDays", this.rotationPeriodInDays); + jsonWriter.writeArrayField("tags", this.tags, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AwsKmsKeyProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AwsKmsKeyProperties if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the AwsKmsKeyProperties. + */ + public static AwsKmsKeyProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AwsKmsKeyProperties deserializedAwsKmsKeyProperties = new AwsKmsKeyProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("arn".equals(fieldName)) { + deserializedAwsKmsKeyProperties.arn = reader.getString(); + } else if ("bypassPolicyLockoutSafetyCheck".equals(fieldName)) { + deserializedAwsKmsKeyProperties.bypassPolicyLockoutSafetyCheck + = reader.getNullable(JsonReader::getBoolean); + } else if ("description".equals(fieldName)) { + deserializedAwsKmsKeyProperties.description = reader.getString(); + } else if ("enableKeyRotation".equals(fieldName)) { + deserializedAwsKmsKeyProperties.enableKeyRotation = reader.getNullable(JsonReader::getBoolean); + } else if ("enabled".equals(fieldName)) { + deserializedAwsKmsKeyProperties.enabled = reader.getNullable(JsonReader::getBoolean); + } else if ("keyId".equals(fieldName)) { + deserializedAwsKmsKeyProperties.keyId = reader.getString(); + } else if ("keyPolicy".equals(fieldName)) { + Map keyPolicy = reader.readMap(reader1 -> reader1.readUntyped()); + deserializedAwsKmsKeyProperties.keyPolicy = keyPolicy; + } else if ("keySpec".equals(fieldName)) { + deserializedAwsKmsKeyProperties.keySpec = KeySpec.fromString(reader.getString()); + } else if ("keyUsage".equals(fieldName)) { + deserializedAwsKmsKeyProperties.keyUsage = KeyUsage.fromString(reader.getString()); + } else if ("multiRegion".equals(fieldName)) { + deserializedAwsKmsKeyProperties.multiRegion = reader.getNullable(JsonReader::getBoolean); + } else if ("origin".equals(fieldName)) { + deserializedAwsKmsKeyProperties.origin = Origin.fromString(reader.getString()); + } else if ("pendingWindowInDays".equals(fieldName)) { + deserializedAwsKmsKeyProperties.pendingWindowInDays = reader.getNullable(JsonReader::getInt); + } else if ("rotationPeriodInDays".equals(fieldName)) { + deserializedAwsKmsKeyProperties.rotationPeriodInDays = reader.getNullable(JsonReader::getInt); + } else if ("tags".equals(fieldName)) { + List tags = reader.readArray(reader1 -> TagAutoGenerated35.fromJson(reader1)); + deserializedAwsKmsKeyProperties.tags = tags; + } else { + reader.skipChildren(); + } + } + + return deserializedAwsKmsKeyProperties; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/AwsLambdaFunctionCodeLocationProperties.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/AwsLambdaFunctionCodeLocationProperties.java new file mode 100644 index 000000000000..34618c1a26ff --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/AwsLambdaFunctionCodeLocationProperties.java @@ -0,0 +1,181 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of awsLambdaFunctionCodeLocation. + */ +@Fluent +public final class AwsLambdaFunctionCodeLocationProperties + implements JsonSerializable { + /* + *

URI of a container image in the Amazon ECR registry.

+ */ + private String imageUri; + + /* + *

A presigned URL that you can use to download the deployment package.

+ */ + private String location; + + /* + *

The service that's hosting the file.

+ */ + private String repositoryType; + + /* + *

The resolved URI for the image.

+ */ + private String resolvedImageUri; + + /** + * Creates an instance of AwsLambdaFunctionCodeLocationProperties class. + */ + public AwsLambdaFunctionCodeLocationProperties() { + } + + /** + * Get the imageUri property: <p>URI of a container image in the Amazon ECR registry.</p>. + * + * @return the imageUri value. + */ + public String imageUri() { + return this.imageUri; + } + + /** + * Set the imageUri property: <p>URI of a container image in the Amazon ECR registry.</p>. + * + * @param imageUri the imageUri value to set. + * @return the AwsLambdaFunctionCodeLocationProperties object itself. + */ + public AwsLambdaFunctionCodeLocationProperties withImageUri(String imageUri) { + this.imageUri = imageUri; + return this; + } + + /** + * Get the location property: <p>A presigned URL that you can use to download the deployment + * package.</p>. + * + * @return the location value. + */ + public String location() { + return this.location; + } + + /** + * Set the location property: <p>A presigned URL that you can use to download the deployment + * package.</p>. + * + * @param location the location value to set. + * @return the AwsLambdaFunctionCodeLocationProperties object itself. + */ + public AwsLambdaFunctionCodeLocationProperties withLocation(String location) { + this.location = location; + return this; + } + + /** + * Get the repositoryType property: <p>The service that's hosting the file.</p>. + * + * @return the repositoryType value. + */ + public String repositoryType() { + return this.repositoryType; + } + + /** + * Set the repositoryType property: <p>The service that's hosting the file.</p>. + * + * @param repositoryType the repositoryType value to set. + * @return the AwsLambdaFunctionCodeLocationProperties object itself. + */ + public AwsLambdaFunctionCodeLocationProperties withRepositoryType(String repositoryType) { + this.repositoryType = repositoryType; + return this; + } + + /** + * Get the resolvedImageUri property: <p>The resolved URI for the image.</p>. + * + * @return the resolvedImageUri value. + */ + public String resolvedImageUri() { + return this.resolvedImageUri; + } + + /** + * Set the resolvedImageUri property: <p>The resolved URI for the image.</p>. + * + * @param resolvedImageUri the resolvedImageUri value to set. + * @return the AwsLambdaFunctionCodeLocationProperties object itself. + */ + public AwsLambdaFunctionCodeLocationProperties withResolvedImageUri(String resolvedImageUri) { + this.resolvedImageUri = resolvedImageUri; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("imageUri", this.imageUri); + jsonWriter.writeStringField("location", this.location); + jsonWriter.writeStringField("repositoryType", this.repositoryType); + jsonWriter.writeStringField("resolvedImageUri", this.resolvedImageUri); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AwsLambdaFunctionCodeLocationProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AwsLambdaFunctionCodeLocationProperties if the JsonReader was pointing to an instance of + * it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the AwsLambdaFunctionCodeLocationProperties. + */ + public static AwsLambdaFunctionCodeLocationProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AwsLambdaFunctionCodeLocationProperties deserializedAwsLambdaFunctionCodeLocationProperties + = new AwsLambdaFunctionCodeLocationProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("imageUri".equals(fieldName)) { + deserializedAwsLambdaFunctionCodeLocationProperties.imageUri = reader.getString(); + } else if ("location".equals(fieldName)) { + deserializedAwsLambdaFunctionCodeLocationProperties.location = reader.getString(); + } else if ("repositoryType".equals(fieldName)) { + deserializedAwsLambdaFunctionCodeLocationProperties.repositoryType = reader.getString(); + } else if ("resolvedImageUri".equals(fieldName)) { + deserializedAwsLambdaFunctionCodeLocationProperties.resolvedImageUri = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedAwsLambdaFunctionCodeLocationProperties; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/AwsLambdaFunctionProperties.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/AwsLambdaFunctionProperties.java new file mode 100644 index 000000000000..c36abc9fd41a --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/AwsLambdaFunctionProperties.java @@ -0,0 +1,1092 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Definition of awsLambdaFunction. + */ +@Fluent +public final class AwsLambdaFunctionProperties implements JsonSerializable { + /* + * The instruction set architecture that the function supports. Enter a string array with one of the valid values + * (arm64 or x86_64). The default value is ``x86_64``. + */ + private List architectures; + + /* + * Property arn + */ + private String arn; + + /* + * The code for the function. The [deployment + * package](https://docs.aws.amazon.com/lambda/latest/dg/gettingstarted-package.html) for a Lambda function. To + * deploy a function defined as a container image, you specify the location of a container image in the Amazon ECR + * registry. For a .zip file deployment package, you can specify the location of an object in Amazon S3. For Node.js + * and Python functions, you can specify the function code inline in the template. Changes to a deployment package + * in Amazon S3 or a container image in ECR are not detected automatically during stack updates. To update the + * function code, change the object key or version in the template. + */ + private Code code; + + /* + * To enable code signing for this function, specify the ARN of a code-signing configuration. A code-signing + * configuration includes a set of signing profiles, which define the trusted publishers for this function. + */ + private String codeSigningConfigArn; + + /* + * A dead-letter queue configuration that specifies the queue or topic where Lambda sends asynchronous events when + * they fail processing. For more information, see [Dead-letter + * queues](https://docs.aws.amazon.com/lambda/latest/dg/invocation-async.html#invocation-dlq). The [dead-letter + * queue](https://docs.aws.amazon.com/lambda/latest/dg/invocation-async.html#dlq) for failed asynchronous + * invocations. + */ + private DeadLetterConfig deadLetterConfig; + + /* + * A description of the function. + */ + private String description; + + /* + * Environment variables that are accessible from function code during execution. A function's environment variable + * settings. You can use environment variables to adjust your function's behavior without updating code. An + * environment variable is a pair of strings that are stored in a function's version-specific configuration. + */ + private Environment environment; + + /* + * The size of the function's ``/tmp`` directory in MB. The default value is 512, but it can be any whole number + * between 512 and 10,240 MB. The size of the function's ``/tmp`` directory in MB. The default value is 512, but it + * can be any whole number between 512 and 10,240 MB. + */ + private EphemeralStorageAutoGenerated ephemeralStorage; + + /* + * Connection settings for an Amazon EFS file system. To connect a function to a file system, a mount target must be + * available in every Availability Zone that your function connects to. If your template contains an + * [AWS::EFS::MountTarget](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-efs- + * mounttarget.html) resource, you must also specify a ``DependsOn`` attribute to ensure that the mount target is + * created or updated before the function. For more information about using the ``DependsOn`` attribute, see + * [DependsOn + * Attribute](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-dependson.html). + */ + private List fileSystemConfigs; + + /* + * The name of the Lambda function, up to 64 characters in length. If you don't specify a name, CFN generates one. + * If you specify a name, you cannot perform updates that require replacement of this resource. You can perform + * updates that require no or some interruption. If you must replace the resource, specify a new name. + */ + private String functionName; + + /* + * The name of the method within your code that Lambda calls to run your function. Handler is required if the + * deployment package is a .zip file archive. The format includes the file name. It can also include namespaces and + * other qualifiers, depending on the runtime. For more information, see [Lambda programming + * model](https://docs.aws.amazon.com/lambda/latest/dg/foundation-progmodel.html). + */ + private String handler; + + /* + * Configuration values that override the container image Dockerfile settings. For more information, see [Container + * image settings](https://docs.aws.amazon.com/lambda/latest/dg/images-create.html#images-parms). Configuration + * values that override the container image Dockerfile settings. For more information, see [Container image + * settings](https://docs.aws.amazon.com/lambda/latest/dg/images-create.html#images-parms). + */ + private ImageConfig imageConfig; + + /* + * The ARN of the KMSlong (KMS) customer managed key that's used to encrypt your function's [environment + * variables](https://docs.aws.amazon.com/lambda/latest/dg/configuration-envvars.html#configuration-envvars- + * encryption). When [Lambda SnapStart](https://docs.aws.amazon.com/lambda/latest/dg/snapstart-security.html) is + * activated, Lambda also uses this key is to encrypt your function's snapshot. If you deploy your function using a + * container image, Lambda also uses this key to encrypt your function when it's deployed. Note that this is not the + * same key that's used to protect your container image in the Amazon Elastic Container Registry (Amazon ECR). If + * you don't provide a customer managed key, Lambda uses a default service key. + */ + private String kmsKeyArn; + + /* + * A list of [function layers](https://docs.aws.amazon.com/lambda/latest/dg/configuration-layers.html) to add to the + * function's execution environment. Specify each layer by its ARN, including the version. + */ + private List layers; + + /* + * The function's Amazon CloudWatch Logs configuration settings. The function's Amazon CloudWatch Logs configuration + * settings. + */ + private LoggingConfig loggingConfig; + + /* + * The amount of [memory available to the + * function](https://docs.aws.amazon.com/lambda/latest/dg/configuration-function-common.html#configuration-memory- + * console) at runtime. Increasing the function memory also increases its CPU allocation. The default value is 128 + * MB. The value can be any multiple of 1 MB. Note that new AWS accounts have reduced concurrency and memory quotas. + * AWS raises these quotas automatically based on your usage. You can also request a quota increase. + */ + private Integer memorySize; + + /* + * The type of deployment package. Set to ``Image`` for container image and set ``Zip`` for .zip file archive. + */ + private PackageType packageType; + + /* + * The number of simultaneous executions to reserve for the function. + */ + private Integer reservedConcurrentExecutions; + + /* + * The Amazon Resource Name (ARN) of the function's execution role. + */ + private String role; + + /* + * The identifier of the function's [runtime](https://docs.aws.amazon.com/lambda/latest/dg/lambda-runtimes.html). + * Runtime is required if the deployment package is a .zip file archive. The following list includes deprecated + * runtimes. For more information, see [Runtime deprecation + * policy](https://docs.aws.amazon.com/lambda/latest/dg/lambda-runtimes.html#runtime-support-policy). + */ + private String runtime; + + /* + * Sets the runtime management configuration for a function's version. For more information, see [Runtime + * updates](https://docs.aws.amazon.com/lambda/latest/dg/runtimes-update.html). Sets the runtime management + * configuration for a function's version. For more information, see [Runtime + * updates](https://docs.aws.amazon.com/lambda/latest/dg/runtimes-update.html). + */ + private RuntimeManagementConfig runtimeManagementConfig; + + /* + * The function's [SnapStart](https://docs.aws.amazon.com/lambda/latest/dg/snapstart.html) setting. The function's + * [SnapStart](https://docs.aws.amazon.com/lambda/latest/dg/snapstart.html) setting. + */ + private SnapStart snapStart; + + /* + * The function's [SnapStart](https://docs.aws.amazon.com/lambda/latest/dg/snapstart.html) setting. + */ + private SnapStartResponse snapStartResponse; + + /* + * A list of [tags](https://docs.aws.amazon.com/lambda/latest/dg/tagging.html) to apply to the function. + */ + private List tags; + + /* + * The amount of time (in seconds) that Lambda allows a function to run before stopping it. The default is 3 + * seconds. The maximum allowed value is 900 seconds. For more information, see [Lambda execution + * environment](https://docs.aws.amazon.com/lambda/latest/dg/runtimes-context.html). + */ + private Integer timeout; + + /* + * Set ``Mode`` to ``Active`` to sample and trace a subset of incoming requests with + * [X-Ray](https://docs.aws.amazon.com/lambda/latest/dg/services-xray.html). The function's + * [](https://docs.aws.amazon.com/lambda/latest/dg/services-xray.html) tracing configuration. To sample and record + * incoming requests, set ``Mode`` to ``Active``. + */ + private TracingConfig tracingConfig; + + /* + * For network connectivity to AWS resources in a VPC, specify a list of security groups and subnets in the VPC. + * When you connect a function to a VPC, it can access resources and the internet only through that VPC. For more + * information, see [Configuring a Lambda function to access resources in a + * VPC](https://docs.aws.amazon.com/lambda/latest/dg/configuration-vpc.html). The VPC security groups and subnets + * that are attached to a Lambda function. When you connect a function to a VPC, Lambda creates an elastic network + * interface for each combination of security group and subnet in the function's VPC configuration. The function can + * only access resources and the internet through that VPC. For more information, see [VPC + * Settings](https://docs.aws.amazon.com/lambda/latest/dg/configuration-vpc.html). When you delete a function, CFN + * monitors the state of its network interfaces and waits for Lambda to delete them before proceeding. If the VPC is + * defined in the same stack, the network interfaces need to be deleted by Lambda before CFN can delete the VPC's + * resources. To monitor network interfaces, CFN needs the ``ec2:DescribeNetworkInterfaces`` permission. It obtains + * this from the user or role that modifies the stack. If you don't provide this permission, CFN does not wait for + * network interfaces to be deleted. + */ + private VpcConfigAutoGenerated vpcConfig; + + /** + * Creates an instance of AwsLambdaFunctionProperties class. + */ + public AwsLambdaFunctionProperties() { + } + + /** + * Get the architectures property: The instruction set architecture that the function supports. Enter a string array + * with one of the valid values (arm64 or x86_64). The default value is ``x86_64``. + * + * @return the architectures value. + */ + public List architectures() { + return this.architectures; + } + + /** + * Set the architectures property: The instruction set architecture that the function supports. Enter a string array + * with one of the valid values (arm64 or x86_64). The default value is ``x86_64``. + * + * @param architectures the architectures value to set. + * @return the AwsLambdaFunctionProperties object itself. + */ + public AwsLambdaFunctionProperties withArchitectures(List architectures) { + this.architectures = architectures; + return this; + } + + /** + * Get the arn property: Property arn. + * + * @return the arn value. + */ + public String arn() { + return this.arn; + } + + /** + * Set the arn property: Property arn. + * + * @param arn the arn value to set. + * @return the AwsLambdaFunctionProperties object itself. + */ + public AwsLambdaFunctionProperties withArn(String arn) { + this.arn = arn; + return this; + } + + /** + * Get the code property: The code for the function. The [deployment + * package](https://docs.aws.amazon.com/lambda/latest/dg/gettingstarted-package.html) for a Lambda function. To + * deploy a function defined as a container image, you specify the location of a container image in the Amazon ECR + * registry. For a .zip file deployment package, you can specify the location of an object in Amazon S3. For Node.js + * and Python functions, you can specify the function code inline in the template. Changes to a deployment package + * in Amazon S3 or a container image in ECR are not detected automatically during stack updates. To update the + * function code, change the object key or version in the template. + * + * @return the code value. + */ + public Code code() { + return this.code; + } + + /** + * Set the code property: The code for the function. The [deployment + * package](https://docs.aws.amazon.com/lambda/latest/dg/gettingstarted-package.html) for a Lambda function. To + * deploy a function defined as a container image, you specify the location of a container image in the Amazon ECR + * registry. For a .zip file deployment package, you can specify the location of an object in Amazon S3. For Node.js + * and Python functions, you can specify the function code inline in the template. Changes to a deployment package + * in Amazon S3 or a container image in ECR are not detected automatically during stack updates. To update the + * function code, change the object key or version in the template. + * + * @param code the code value to set. + * @return the AwsLambdaFunctionProperties object itself. + */ + public AwsLambdaFunctionProperties withCode(Code code) { + this.code = code; + return this; + } + + /** + * Get the codeSigningConfigArn property: To enable code signing for this function, specify the ARN of a + * code-signing configuration. A code-signing configuration includes a set of signing profiles, which define the + * trusted publishers for this function. + * + * @return the codeSigningConfigArn value. + */ + public String codeSigningConfigArn() { + return this.codeSigningConfigArn; + } + + /** + * Set the codeSigningConfigArn property: To enable code signing for this function, specify the ARN of a + * code-signing configuration. A code-signing configuration includes a set of signing profiles, which define the + * trusted publishers for this function. + * + * @param codeSigningConfigArn the codeSigningConfigArn value to set. + * @return the AwsLambdaFunctionProperties object itself. + */ + public AwsLambdaFunctionProperties withCodeSigningConfigArn(String codeSigningConfigArn) { + this.codeSigningConfigArn = codeSigningConfigArn; + return this; + } + + /** + * Get the deadLetterConfig property: A dead-letter queue configuration that specifies the queue or topic where + * Lambda sends asynchronous events when they fail processing. For more information, see [Dead-letter + * queues](https://docs.aws.amazon.com/lambda/latest/dg/invocation-async.html#invocation-dlq). The [dead-letter + * queue](https://docs.aws.amazon.com/lambda/latest/dg/invocation-async.html#dlq) for failed asynchronous + * invocations. + * + * @return the deadLetterConfig value. + */ + public DeadLetterConfig deadLetterConfig() { + return this.deadLetterConfig; + } + + /** + * Set the deadLetterConfig property: A dead-letter queue configuration that specifies the queue or topic where + * Lambda sends asynchronous events when they fail processing. For more information, see [Dead-letter + * queues](https://docs.aws.amazon.com/lambda/latest/dg/invocation-async.html#invocation-dlq). The [dead-letter + * queue](https://docs.aws.amazon.com/lambda/latest/dg/invocation-async.html#dlq) for failed asynchronous + * invocations. + * + * @param deadLetterConfig the deadLetterConfig value to set. + * @return the AwsLambdaFunctionProperties object itself. + */ + public AwsLambdaFunctionProperties withDeadLetterConfig(DeadLetterConfig deadLetterConfig) { + this.deadLetterConfig = deadLetterConfig; + return this; + } + + /** + * Get the description property: A description of the function. + * + * @return the description value. + */ + public String description() { + return this.description; + } + + /** + * Set the description property: A description of the function. + * + * @param description the description value to set. + * @return the AwsLambdaFunctionProperties object itself. + */ + public AwsLambdaFunctionProperties withDescription(String description) { + this.description = description; + return this; + } + + /** + * Get the environment property: Environment variables that are accessible from function code during execution. A + * function's environment variable settings. You can use environment variables to adjust your function's behavior + * without updating code. An environment variable is a pair of strings that are stored in a function's + * version-specific configuration. + * + * @return the environment value. + */ + public Environment environment() { + return this.environment; + } + + /** + * Set the environment property: Environment variables that are accessible from function code during execution. A + * function's environment variable settings. You can use environment variables to adjust your function's behavior + * without updating code. An environment variable is a pair of strings that are stored in a function's + * version-specific configuration. + * + * @param environment the environment value to set. + * @return the AwsLambdaFunctionProperties object itself. + */ + public AwsLambdaFunctionProperties withEnvironment(Environment environment) { + this.environment = environment; + return this; + } + + /** + * Get the ephemeralStorage property: The size of the function's ``/tmp`` directory in MB. The default value is 512, + * but it can be any whole number between 512 and 10,240 MB. The size of the function's ``/tmp`` directory in MB. + * The default value is 512, but it can be any whole number between 512 and 10,240 MB. + * + * @return the ephemeralStorage value. + */ + public EphemeralStorageAutoGenerated ephemeralStorage() { + return this.ephemeralStorage; + } + + /** + * Set the ephemeralStorage property: The size of the function's ``/tmp`` directory in MB. The default value is 512, + * but it can be any whole number between 512 and 10,240 MB. The size of the function's ``/tmp`` directory in MB. + * The default value is 512, but it can be any whole number between 512 and 10,240 MB. + * + * @param ephemeralStorage the ephemeralStorage value to set. + * @return the AwsLambdaFunctionProperties object itself. + */ + public AwsLambdaFunctionProperties withEphemeralStorage(EphemeralStorageAutoGenerated ephemeralStorage) { + this.ephemeralStorage = ephemeralStorage; + return this; + } + + /** + * Get the fileSystemConfigs property: Connection settings for an Amazon EFS file system. To connect a function to a + * file system, a mount target must be available in every Availability Zone that your function connects to. If your + * template contains an + * [AWS::EFS::MountTarget](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-efs-mounttarget.html) + * resource, you must also specify a ``DependsOn`` attribute to ensure that the mount target is created or updated + * before the function. For more information about using the ``DependsOn`` attribute, see [DependsOn + * Attribute](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-dependson.html). + * + * @return the fileSystemConfigs value. + */ + public List fileSystemConfigs() { + return this.fileSystemConfigs; + } + + /** + * Set the fileSystemConfigs property: Connection settings for an Amazon EFS file system. To connect a function to a + * file system, a mount target must be available in every Availability Zone that your function connects to. If your + * template contains an + * [AWS::EFS::MountTarget](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-efs-mounttarget.html) + * resource, you must also specify a ``DependsOn`` attribute to ensure that the mount target is created or updated + * before the function. For more information about using the ``DependsOn`` attribute, see [DependsOn + * Attribute](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-dependson.html). + * + * @param fileSystemConfigs the fileSystemConfigs value to set. + * @return the AwsLambdaFunctionProperties object itself. + */ + public AwsLambdaFunctionProperties withFileSystemConfigs(List fileSystemConfigs) { + this.fileSystemConfigs = fileSystemConfigs; + return this; + } + + /** + * Get the functionName property: The name of the Lambda function, up to 64 characters in length. If you don't + * specify a name, CFN generates one. If you specify a name, you cannot perform updates that require replacement of + * this resource. You can perform updates that require no or some interruption. If you must replace the resource, + * specify a new name. + * + * @return the functionName value. + */ + public String functionName() { + return this.functionName; + } + + /** + * Set the functionName property: The name of the Lambda function, up to 64 characters in length. If you don't + * specify a name, CFN generates one. If you specify a name, you cannot perform updates that require replacement of + * this resource. You can perform updates that require no or some interruption. If you must replace the resource, + * specify a new name. + * + * @param functionName the functionName value to set. + * @return the AwsLambdaFunctionProperties object itself. + */ + public AwsLambdaFunctionProperties withFunctionName(String functionName) { + this.functionName = functionName; + return this; + } + + /** + * Get the handler property: The name of the method within your code that Lambda calls to run your function. Handler + * is required if the deployment package is a .zip file archive. The format includes the file name. It can also + * include namespaces and other qualifiers, depending on the runtime. For more information, see [Lambda programming + * model](https://docs.aws.amazon.com/lambda/latest/dg/foundation-progmodel.html). + * + * @return the handler value. + */ + public String handler() { + return this.handler; + } + + /** + * Set the handler property: The name of the method within your code that Lambda calls to run your function. Handler + * is required if the deployment package is a .zip file archive. The format includes the file name. It can also + * include namespaces and other qualifiers, depending on the runtime. For more information, see [Lambda programming + * model](https://docs.aws.amazon.com/lambda/latest/dg/foundation-progmodel.html). + * + * @param handler the handler value to set. + * @return the AwsLambdaFunctionProperties object itself. + */ + public AwsLambdaFunctionProperties withHandler(String handler) { + this.handler = handler; + return this; + } + + /** + * Get the imageConfig property: Configuration values that override the container image Dockerfile settings. For + * more information, see [Container image + * settings](https://docs.aws.amazon.com/lambda/latest/dg/images-create.html#images-parms). Configuration values + * that override the container image Dockerfile settings. For more information, see [Container image + * settings](https://docs.aws.amazon.com/lambda/latest/dg/images-create.html#images-parms). + * + * @return the imageConfig value. + */ + public ImageConfig imageConfig() { + return this.imageConfig; + } + + /** + * Set the imageConfig property: Configuration values that override the container image Dockerfile settings. For + * more information, see [Container image + * settings](https://docs.aws.amazon.com/lambda/latest/dg/images-create.html#images-parms). Configuration values + * that override the container image Dockerfile settings. For more information, see [Container image + * settings](https://docs.aws.amazon.com/lambda/latest/dg/images-create.html#images-parms). + * + * @param imageConfig the imageConfig value to set. + * @return the AwsLambdaFunctionProperties object itself. + */ + public AwsLambdaFunctionProperties withImageConfig(ImageConfig imageConfig) { + this.imageConfig = imageConfig; + return this; + } + + /** + * Get the kmsKeyArn property: The ARN of the KMSlong (KMS) customer managed key that's used to encrypt your + * function's [environment + * variables](https://docs.aws.amazon.com/lambda/latest/dg/configuration-envvars.html#configuration-envvars-encryption). + * When [Lambda SnapStart](https://docs.aws.amazon.com/lambda/latest/dg/snapstart-security.html) is activated, + * Lambda also uses this key is to encrypt your function's snapshot. If you deploy your function using a container + * image, Lambda also uses this key to encrypt your function when it's deployed. Note that this is not the same key + * that's used to protect your container image in the Amazon Elastic Container Registry (Amazon ECR). If you don't + * provide a customer managed key, Lambda uses a default service key. + * + * @return the kmsKeyArn value. + */ + public String kmsKeyArn() { + return this.kmsKeyArn; + } + + /** + * Set the kmsKeyArn property: The ARN of the KMSlong (KMS) customer managed key that's used to encrypt your + * function's [environment + * variables](https://docs.aws.amazon.com/lambda/latest/dg/configuration-envvars.html#configuration-envvars-encryption). + * When [Lambda SnapStart](https://docs.aws.amazon.com/lambda/latest/dg/snapstart-security.html) is activated, + * Lambda also uses this key is to encrypt your function's snapshot. If you deploy your function using a container + * image, Lambda also uses this key to encrypt your function when it's deployed. Note that this is not the same key + * that's used to protect your container image in the Amazon Elastic Container Registry (Amazon ECR). If you don't + * provide a customer managed key, Lambda uses a default service key. + * + * @param kmsKeyArn the kmsKeyArn value to set. + * @return the AwsLambdaFunctionProperties object itself. + */ + public AwsLambdaFunctionProperties withKmsKeyArn(String kmsKeyArn) { + this.kmsKeyArn = kmsKeyArn; + return this; + } + + /** + * Get the layers property: A list of [function + * layers](https://docs.aws.amazon.com/lambda/latest/dg/configuration-layers.html) to add to the function's + * execution environment. Specify each layer by its ARN, including the version. + * + * @return the layers value. + */ + public List layers() { + return this.layers; + } + + /** + * Set the layers property: A list of [function + * layers](https://docs.aws.amazon.com/lambda/latest/dg/configuration-layers.html) to add to the function's + * execution environment. Specify each layer by its ARN, including the version. + * + * @param layers the layers value to set. + * @return the AwsLambdaFunctionProperties object itself. + */ + public AwsLambdaFunctionProperties withLayers(List layers) { + this.layers = layers; + return this; + } + + /** + * Get the loggingConfig property: The function's Amazon CloudWatch Logs configuration settings. The function's + * Amazon CloudWatch Logs configuration settings. + * + * @return the loggingConfig value. + */ + public LoggingConfig loggingConfig() { + return this.loggingConfig; + } + + /** + * Set the loggingConfig property: The function's Amazon CloudWatch Logs configuration settings. The function's + * Amazon CloudWatch Logs configuration settings. + * + * @param loggingConfig the loggingConfig value to set. + * @return the AwsLambdaFunctionProperties object itself. + */ + public AwsLambdaFunctionProperties withLoggingConfig(LoggingConfig loggingConfig) { + this.loggingConfig = loggingConfig; + return this; + } + + /** + * Get the memorySize property: The amount of [memory available to the + * function](https://docs.aws.amazon.com/lambda/latest/dg/configuration-function-common.html#configuration-memory-console) + * at runtime. Increasing the function memory also increases its CPU allocation. The default value is 128 MB. The + * value can be any multiple of 1 MB. Note that new AWS accounts have reduced concurrency and memory quotas. AWS + * raises these quotas automatically based on your usage. You can also request a quota increase. + * + * @return the memorySize value. + */ + public Integer memorySize() { + return this.memorySize; + } + + /** + * Set the memorySize property: The amount of [memory available to the + * function](https://docs.aws.amazon.com/lambda/latest/dg/configuration-function-common.html#configuration-memory-console) + * at runtime. Increasing the function memory also increases its CPU allocation. The default value is 128 MB. The + * value can be any multiple of 1 MB. Note that new AWS accounts have reduced concurrency and memory quotas. AWS + * raises these quotas automatically based on your usage. You can also request a quota increase. + * + * @param memorySize the memorySize value to set. + * @return the AwsLambdaFunctionProperties object itself. + */ + public AwsLambdaFunctionProperties withMemorySize(Integer memorySize) { + this.memorySize = memorySize; + return this; + } + + /** + * Get the packageType property: The type of deployment package. Set to ``Image`` for container image and set + * ``Zip`` for .zip file archive. + * + * @return the packageType value. + */ + public PackageType packageType() { + return this.packageType; + } + + /** + * Set the packageType property: The type of deployment package. Set to ``Image`` for container image and set + * ``Zip`` for .zip file archive. + * + * @param packageType the packageType value to set. + * @return the AwsLambdaFunctionProperties object itself. + */ + public AwsLambdaFunctionProperties withPackageType(PackageType packageType) { + this.packageType = packageType; + return this; + } + + /** + * Get the reservedConcurrentExecutions property: The number of simultaneous executions to reserve for the function. + * + * @return the reservedConcurrentExecutions value. + */ + public Integer reservedConcurrentExecutions() { + return this.reservedConcurrentExecutions; + } + + /** + * Set the reservedConcurrentExecutions property: The number of simultaneous executions to reserve for the function. + * + * @param reservedConcurrentExecutions the reservedConcurrentExecutions value to set. + * @return the AwsLambdaFunctionProperties object itself. + */ + public AwsLambdaFunctionProperties withReservedConcurrentExecutions(Integer reservedConcurrentExecutions) { + this.reservedConcurrentExecutions = reservedConcurrentExecutions; + return this; + } + + /** + * Get the role property: The Amazon Resource Name (ARN) of the function's execution role. + * + * @return the role value. + */ + public String role() { + return this.role; + } + + /** + * Set the role property: The Amazon Resource Name (ARN) of the function's execution role. + * + * @param role the role value to set. + * @return the AwsLambdaFunctionProperties object itself. + */ + public AwsLambdaFunctionProperties withRole(String role) { + this.role = role; + return this; + } + + /** + * Get the runtime property: The identifier of the function's + * [runtime](https://docs.aws.amazon.com/lambda/latest/dg/lambda-runtimes.html). Runtime is required if the + * deployment package is a .zip file archive. The following list includes deprecated runtimes. For more information, + * see [Runtime deprecation + * policy](https://docs.aws.amazon.com/lambda/latest/dg/lambda-runtimes.html#runtime-support-policy). + * + * @return the runtime value. + */ + public String runtime() { + return this.runtime; + } + + /** + * Set the runtime property: The identifier of the function's + * [runtime](https://docs.aws.amazon.com/lambda/latest/dg/lambda-runtimes.html). Runtime is required if the + * deployment package is a .zip file archive. The following list includes deprecated runtimes. For more information, + * see [Runtime deprecation + * policy](https://docs.aws.amazon.com/lambda/latest/dg/lambda-runtimes.html#runtime-support-policy). + * + * @param runtime the runtime value to set. + * @return the AwsLambdaFunctionProperties object itself. + */ + public AwsLambdaFunctionProperties withRuntime(String runtime) { + this.runtime = runtime; + return this; + } + + /** + * Get the runtimeManagementConfig property: Sets the runtime management configuration for a function's version. For + * more information, see [Runtime updates](https://docs.aws.amazon.com/lambda/latest/dg/runtimes-update.html). Sets + * the runtime management configuration for a function's version. For more information, see [Runtime + * updates](https://docs.aws.amazon.com/lambda/latest/dg/runtimes-update.html). + * + * @return the runtimeManagementConfig value. + */ + public RuntimeManagementConfig runtimeManagementConfig() { + return this.runtimeManagementConfig; + } + + /** + * Set the runtimeManagementConfig property: Sets the runtime management configuration for a function's version. For + * more information, see [Runtime updates](https://docs.aws.amazon.com/lambda/latest/dg/runtimes-update.html). Sets + * the runtime management configuration for a function's version. For more information, see [Runtime + * updates](https://docs.aws.amazon.com/lambda/latest/dg/runtimes-update.html). + * + * @param runtimeManagementConfig the runtimeManagementConfig value to set. + * @return the AwsLambdaFunctionProperties object itself. + */ + public AwsLambdaFunctionProperties withRuntimeManagementConfig(RuntimeManagementConfig runtimeManagementConfig) { + this.runtimeManagementConfig = runtimeManagementConfig; + return this; + } + + /** + * Get the snapStart property: The function's + * [SnapStart](https://docs.aws.amazon.com/lambda/latest/dg/snapstart.html) setting. The function's + * [SnapStart](https://docs.aws.amazon.com/lambda/latest/dg/snapstart.html) setting. + * + * @return the snapStart value. + */ + public SnapStart snapStart() { + return this.snapStart; + } + + /** + * Set the snapStart property: The function's + * [SnapStart](https://docs.aws.amazon.com/lambda/latest/dg/snapstart.html) setting. The function's + * [SnapStart](https://docs.aws.amazon.com/lambda/latest/dg/snapstart.html) setting. + * + * @param snapStart the snapStart value to set. + * @return the AwsLambdaFunctionProperties object itself. + */ + public AwsLambdaFunctionProperties withSnapStart(SnapStart snapStart) { + this.snapStart = snapStart; + return this; + } + + /** + * Get the snapStartResponse property: The function's + * [SnapStart](https://docs.aws.amazon.com/lambda/latest/dg/snapstart.html) setting. + * + * @return the snapStartResponse value. + */ + public SnapStartResponse snapStartResponse() { + return this.snapStartResponse; + } + + /** + * Set the snapStartResponse property: The function's + * [SnapStart](https://docs.aws.amazon.com/lambda/latest/dg/snapstart.html) setting. + * + * @param snapStartResponse the snapStartResponse value to set. + * @return the AwsLambdaFunctionProperties object itself. + */ + public AwsLambdaFunctionProperties withSnapStartResponse(SnapStartResponse snapStartResponse) { + this.snapStartResponse = snapStartResponse; + return this; + } + + /** + * Get the tags property: A list of [tags](https://docs.aws.amazon.com/lambda/latest/dg/tagging.html) to apply to + * the function. + * + * @return the tags value. + */ + public List tags() { + return this.tags; + } + + /** + * Set the tags property: A list of [tags](https://docs.aws.amazon.com/lambda/latest/dg/tagging.html) to apply to + * the function. + * + * @param tags the tags value to set. + * @return the AwsLambdaFunctionProperties object itself. + */ + public AwsLambdaFunctionProperties withTags(List tags) { + this.tags = tags; + return this; + } + + /** + * Get the timeout property: The amount of time (in seconds) that Lambda allows a function to run before stopping + * it. The default is 3 seconds. The maximum allowed value is 900 seconds. For more information, see [Lambda + * execution environment](https://docs.aws.amazon.com/lambda/latest/dg/runtimes-context.html). + * + * @return the timeout value. + */ + public Integer timeout() { + return this.timeout; + } + + /** + * Set the timeout property: The amount of time (in seconds) that Lambda allows a function to run before stopping + * it. The default is 3 seconds. The maximum allowed value is 900 seconds. For more information, see [Lambda + * execution environment](https://docs.aws.amazon.com/lambda/latest/dg/runtimes-context.html). + * + * @param timeout the timeout value to set. + * @return the AwsLambdaFunctionProperties object itself. + */ + public AwsLambdaFunctionProperties withTimeout(Integer timeout) { + this.timeout = timeout; + return this; + } + + /** + * Get the tracingConfig property: Set ``Mode`` to ``Active`` to sample and trace a subset of incoming requests with + * [X-Ray](https://docs.aws.amazon.com/lambda/latest/dg/services-xray.html). The function's + * [](https://docs.aws.amazon.com/lambda/latest/dg/services-xray.html) tracing configuration. To sample and record + * incoming requests, set ``Mode`` to ``Active``. + * + * @return the tracingConfig value. + */ + public TracingConfig tracingConfig() { + return this.tracingConfig; + } + + /** + * Set the tracingConfig property: Set ``Mode`` to ``Active`` to sample and trace a subset of incoming requests with + * [X-Ray](https://docs.aws.amazon.com/lambda/latest/dg/services-xray.html). The function's + * [](https://docs.aws.amazon.com/lambda/latest/dg/services-xray.html) tracing configuration. To sample and record + * incoming requests, set ``Mode`` to ``Active``. + * + * @param tracingConfig the tracingConfig value to set. + * @return the AwsLambdaFunctionProperties object itself. + */ + public AwsLambdaFunctionProperties withTracingConfig(TracingConfig tracingConfig) { + this.tracingConfig = tracingConfig; + return this; + } + + /** + * Get the vpcConfig property: For network connectivity to AWS resources in a VPC, specify a list of security groups + * and subnets in the VPC. When you connect a function to a VPC, it can access resources and the internet only + * through that VPC. For more information, see [Configuring a Lambda function to access resources in a + * VPC](https://docs.aws.amazon.com/lambda/latest/dg/configuration-vpc.html). The VPC security groups and subnets + * that are attached to a Lambda function. When you connect a function to a VPC, Lambda creates an elastic network + * interface for each combination of security group and subnet in the function's VPC configuration. The function can + * only access resources and the internet through that VPC. For more information, see [VPC + * Settings](https://docs.aws.amazon.com/lambda/latest/dg/configuration-vpc.html). When you delete a function, CFN + * monitors the state of its network interfaces and waits for Lambda to delete them before proceeding. If the VPC is + * defined in the same stack, the network interfaces need to be deleted by Lambda before CFN can delete the VPC's + * resources. To monitor network interfaces, CFN needs the ``ec2:DescribeNetworkInterfaces`` permission. It obtains + * this from the user or role that modifies the stack. If you don't provide this permission, CFN does not wait for + * network interfaces to be deleted. + * + * @return the vpcConfig value. + */ + public VpcConfigAutoGenerated vpcConfig() { + return this.vpcConfig; + } + + /** + * Set the vpcConfig property: For network connectivity to AWS resources in a VPC, specify a list of security groups + * and subnets in the VPC. When you connect a function to a VPC, it can access resources and the internet only + * through that VPC. For more information, see [Configuring a Lambda function to access resources in a + * VPC](https://docs.aws.amazon.com/lambda/latest/dg/configuration-vpc.html). The VPC security groups and subnets + * that are attached to a Lambda function. When you connect a function to a VPC, Lambda creates an elastic network + * interface for each combination of security group and subnet in the function's VPC configuration. The function can + * only access resources and the internet through that VPC. For more information, see [VPC + * Settings](https://docs.aws.amazon.com/lambda/latest/dg/configuration-vpc.html). When you delete a function, CFN + * monitors the state of its network interfaces and waits for Lambda to delete them before proceeding. If the VPC is + * defined in the same stack, the network interfaces need to be deleted by Lambda before CFN can delete the VPC's + * resources. To monitor network interfaces, CFN needs the ``ec2:DescribeNetworkInterfaces`` permission. It obtains + * this from the user or role that modifies the stack. If you don't provide this permission, CFN does not wait for + * network interfaces to be deleted. + * + * @param vpcConfig the vpcConfig value to set. + * @return the AwsLambdaFunctionProperties object itself. + */ + public AwsLambdaFunctionProperties withVpcConfig(VpcConfigAutoGenerated vpcConfig) { + this.vpcConfig = vpcConfig; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (code() != null) { + code().validate(); + } + if (deadLetterConfig() != null) { + deadLetterConfig().validate(); + } + if (environment() != null) { + environment().validate(); + } + if (ephemeralStorage() != null) { + ephemeralStorage().validate(); + } + if (fileSystemConfigs() != null) { + fileSystemConfigs().forEach(e -> e.validate()); + } + if (imageConfig() != null) { + imageConfig().validate(); + } + if (loggingConfig() != null) { + loggingConfig().validate(); + } + if (runtimeManagementConfig() != null) { + runtimeManagementConfig().validate(); + } + if (snapStart() != null) { + snapStart().validate(); + } + if (snapStartResponse() != null) { + snapStartResponse().validate(); + } + if (tags() != null) { + tags().forEach(e -> e.validate()); + } + if (tracingConfig() != null) { + tracingConfig().validate(); + } + if (vpcConfig() != null) { + vpcConfig().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("architectures", this.architectures, + (writer, element) -> writer.writeString(element == null ? null : element.toString())); + jsonWriter.writeStringField("arn", this.arn); + jsonWriter.writeJsonField("code", this.code); + jsonWriter.writeStringField("codeSigningConfigArn", this.codeSigningConfigArn); + jsonWriter.writeJsonField("deadLetterConfig", this.deadLetterConfig); + jsonWriter.writeStringField("description", this.description); + jsonWriter.writeJsonField("environment", this.environment); + jsonWriter.writeJsonField("ephemeralStorage", this.ephemeralStorage); + jsonWriter.writeArrayField("fileSystemConfigs", this.fileSystemConfigs, + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("functionName", this.functionName); + jsonWriter.writeStringField("handler", this.handler); + jsonWriter.writeJsonField("imageConfig", this.imageConfig); + jsonWriter.writeStringField("kmsKeyArn", this.kmsKeyArn); + jsonWriter.writeArrayField("layers", this.layers, (writer, element) -> writer.writeString(element)); + jsonWriter.writeJsonField("loggingConfig", this.loggingConfig); + jsonWriter.writeNumberField("memorySize", this.memorySize); + jsonWriter.writeStringField("packageType", this.packageType == null ? null : this.packageType.toString()); + jsonWriter.writeNumberField("reservedConcurrentExecutions", this.reservedConcurrentExecutions); + jsonWriter.writeStringField("role", this.role); + jsonWriter.writeStringField("runtime", this.runtime); + jsonWriter.writeJsonField("runtimeManagementConfig", this.runtimeManagementConfig); + jsonWriter.writeJsonField("snapStart", this.snapStart); + jsonWriter.writeJsonField("snapStartResponse", this.snapStartResponse); + jsonWriter.writeArrayField("tags", this.tags, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeNumberField("timeout", this.timeout); + jsonWriter.writeJsonField("tracingConfig", this.tracingConfig); + jsonWriter.writeJsonField("vpcConfig", this.vpcConfig); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AwsLambdaFunctionProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AwsLambdaFunctionProperties if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the AwsLambdaFunctionProperties. + */ + public static AwsLambdaFunctionProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AwsLambdaFunctionProperties deserializedAwsLambdaFunctionProperties = new AwsLambdaFunctionProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("architectures".equals(fieldName)) { + List architectures + = reader.readArray(reader1 -> Architectures.fromString(reader1.getString())); + deserializedAwsLambdaFunctionProperties.architectures = architectures; + } else if ("arn".equals(fieldName)) { + deserializedAwsLambdaFunctionProperties.arn = reader.getString(); + } else if ("code".equals(fieldName)) { + deserializedAwsLambdaFunctionProperties.code = Code.fromJson(reader); + } else if ("codeSigningConfigArn".equals(fieldName)) { + deserializedAwsLambdaFunctionProperties.codeSigningConfigArn = reader.getString(); + } else if ("deadLetterConfig".equals(fieldName)) { + deserializedAwsLambdaFunctionProperties.deadLetterConfig = DeadLetterConfig.fromJson(reader); + } else if ("description".equals(fieldName)) { + deserializedAwsLambdaFunctionProperties.description = reader.getString(); + } else if ("environment".equals(fieldName)) { + deserializedAwsLambdaFunctionProperties.environment = Environment.fromJson(reader); + } else if ("ephemeralStorage".equals(fieldName)) { + deserializedAwsLambdaFunctionProperties.ephemeralStorage + = EphemeralStorageAutoGenerated.fromJson(reader); + } else if ("fileSystemConfigs".equals(fieldName)) { + List fileSystemConfigs + = reader.readArray(reader1 -> FileSystemConfig.fromJson(reader1)); + deserializedAwsLambdaFunctionProperties.fileSystemConfigs = fileSystemConfigs; + } else if ("functionName".equals(fieldName)) { + deserializedAwsLambdaFunctionProperties.functionName = reader.getString(); + } else if ("handler".equals(fieldName)) { + deserializedAwsLambdaFunctionProperties.handler = reader.getString(); + } else if ("imageConfig".equals(fieldName)) { + deserializedAwsLambdaFunctionProperties.imageConfig = ImageConfig.fromJson(reader); + } else if ("kmsKeyArn".equals(fieldName)) { + deserializedAwsLambdaFunctionProperties.kmsKeyArn = reader.getString(); + } else if ("layers".equals(fieldName)) { + List layers = reader.readArray(reader1 -> reader1.getString()); + deserializedAwsLambdaFunctionProperties.layers = layers; + } else if ("loggingConfig".equals(fieldName)) { + deserializedAwsLambdaFunctionProperties.loggingConfig = LoggingConfig.fromJson(reader); + } else if ("memorySize".equals(fieldName)) { + deserializedAwsLambdaFunctionProperties.memorySize = reader.getNullable(JsonReader::getInt); + } else if ("packageType".equals(fieldName)) { + deserializedAwsLambdaFunctionProperties.packageType = PackageType.fromString(reader.getString()); + } else if ("reservedConcurrentExecutions".equals(fieldName)) { + deserializedAwsLambdaFunctionProperties.reservedConcurrentExecutions + = reader.getNullable(JsonReader::getInt); + } else if ("role".equals(fieldName)) { + deserializedAwsLambdaFunctionProperties.role = reader.getString(); + } else if ("runtime".equals(fieldName)) { + deserializedAwsLambdaFunctionProperties.runtime = reader.getString(); + } else if ("runtimeManagementConfig".equals(fieldName)) { + deserializedAwsLambdaFunctionProperties.runtimeManagementConfig + = RuntimeManagementConfig.fromJson(reader); + } else if ("snapStart".equals(fieldName)) { + deserializedAwsLambdaFunctionProperties.snapStart = SnapStart.fromJson(reader); + } else if ("snapStartResponse".equals(fieldName)) { + deserializedAwsLambdaFunctionProperties.snapStartResponse = SnapStartResponse.fromJson(reader); + } else if ("tags".equals(fieldName)) { + List tags = reader.readArray(reader1 -> TagAutoGenerated36.fromJson(reader1)); + deserializedAwsLambdaFunctionProperties.tags = tags; + } else if ("timeout".equals(fieldName)) { + deserializedAwsLambdaFunctionProperties.timeout = reader.getNullable(JsonReader::getInt); + } else if ("tracingConfig".equals(fieldName)) { + deserializedAwsLambdaFunctionProperties.tracingConfig = TracingConfig.fromJson(reader); + } else if ("vpcConfig".equals(fieldName)) { + deserializedAwsLambdaFunctionProperties.vpcConfig = VpcConfigAutoGenerated.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedAwsLambdaFunctionProperties; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/AwsLightsailBucketProperties.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/AwsLightsailBucketProperties.java new file mode 100644 index 000000000000..d9ac714c22f0 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/AwsLightsailBucketProperties.java @@ -0,0 +1,364 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Definition of awsLightsailBucket. + */ +@Fluent +public final class AwsLightsailBucketProperties implements JsonSerializable { + /* + * Indicates whether the bundle that is currently applied to a bucket can be changed to another bundle. You can + * update a bucket's bundle only one time within a monthly AWS billing cycle. + */ + private Boolean ableToUpdateBundle; + + /* + * An object that sets the public accessibility of objects in the specified bucket. + */ + private AccessRules accessRules; + + /* + * Property bucketArn + */ + private String bucketArn; + + /* + * The name for the bucket. + */ + private String bucketName; + + /* + * The ID of the bundle to use for the bucket. + */ + private String bundleId; + + /* + * Specifies whether to enable or disable versioning of objects in the bucket. + */ + private Boolean objectVersioning; + + /* + * An array of strings to specify the AWS account IDs that can access the bucket. + */ + private List readOnlyAccessAccounts; + + /* + * The names of the Lightsail resources for which to set bucket access. + */ + private List resourcesReceivingAccess; + + /* + * An array of key-value pairs to apply to this resource. + */ + private List tags; + + /* + * The URL of the bucket. + */ + private String url; + + /** + * Creates an instance of AwsLightsailBucketProperties class. + */ + public AwsLightsailBucketProperties() { + } + + /** + * Get the ableToUpdateBundle property: Indicates whether the bundle that is currently applied to a bucket can be + * changed to another bundle. You can update a bucket's bundle only one time within a monthly AWS billing cycle. + * + * @return the ableToUpdateBundle value. + */ + public Boolean ableToUpdateBundle() { + return this.ableToUpdateBundle; + } + + /** + * Set the ableToUpdateBundle property: Indicates whether the bundle that is currently applied to a bucket can be + * changed to another bundle. You can update a bucket's bundle only one time within a monthly AWS billing cycle. + * + * @param ableToUpdateBundle the ableToUpdateBundle value to set. + * @return the AwsLightsailBucketProperties object itself. + */ + public AwsLightsailBucketProperties withAbleToUpdateBundle(Boolean ableToUpdateBundle) { + this.ableToUpdateBundle = ableToUpdateBundle; + return this; + } + + /** + * Get the accessRules property: An object that sets the public accessibility of objects in the specified bucket. + * + * @return the accessRules value. + */ + public AccessRules accessRules() { + return this.accessRules; + } + + /** + * Set the accessRules property: An object that sets the public accessibility of objects in the specified bucket. + * + * @param accessRules the accessRules value to set. + * @return the AwsLightsailBucketProperties object itself. + */ + public AwsLightsailBucketProperties withAccessRules(AccessRules accessRules) { + this.accessRules = accessRules; + return this; + } + + /** + * Get the bucketArn property: Property bucketArn. + * + * @return the bucketArn value. + */ + public String bucketArn() { + return this.bucketArn; + } + + /** + * Set the bucketArn property: Property bucketArn. + * + * @param bucketArn the bucketArn value to set. + * @return the AwsLightsailBucketProperties object itself. + */ + public AwsLightsailBucketProperties withBucketArn(String bucketArn) { + this.bucketArn = bucketArn; + return this; + } + + /** + * Get the bucketName property: The name for the bucket. + * + * @return the bucketName value. + */ + public String bucketName() { + return this.bucketName; + } + + /** + * Set the bucketName property: The name for the bucket. + * + * @param bucketName the bucketName value to set. + * @return the AwsLightsailBucketProperties object itself. + */ + public AwsLightsailBucketProperties withBucketName(String bucketName) { + this.bucketName = bucketName; + return this; + } + + /** + * Get the bundleId property: The ID of the bundle to use for the bucket. + * + * @return the bundleId value. + */ + public String bundleId() { + return this.bundleId; + } + + /** + * Set the bundleId property: The ID of the bundle to use for the bucket. + * + * @param bundleId the bundleId value to set. + * @return the AwsLightsailBucketProperties object itself. + */ + public AwsLightsailBucketProperties withBundleId(String bundleId) { + this.bundleId = bundleId; + return this; + } + + /** + * Get the objectVersioning property: Specifies whether to enable or disable versioning of objects in the bucket. + * + * @return the objectVersioning value. + */ + public Boolean objectVersioning() { + return this.objectVersioning; + } + + /** + * Set the objectVersioning property: Specifies whether to enable or disable versioning of objects in the bucket. + * + * @param objectVersioning the objectVersioning value to set. + * @return the AwsLightsailBucketProperties object itself. + */ + public AwsLightsailBucketProperties withObjectVersioning(Boolean objectVersioning) { + this.objectVersioning = objectVersioning; + return this; + } + + /** + * Get the readOnlyAccessAccounts property: An array of strings to specify the AWS account IDs that can access the + * bucket. + * + * @return the readOnlyAccessAccounts value. + */ + public List readOnlyAccessAccounts() { + return this.readOnlyAccessAccounts; + } + + /** + * Set the readOnlyAccessAccounts property: An array of strings to specify the AWS account IDs that can access the + * bucket. + * + * @param readOnlyAccessAccounts the readOnlyAccessAccounts value to set. + * @return the AwsLightsailBucketProperties object itself. + */ + public AwsLightsailBucketProperties withReadOnlyAccessAccounts(List readOnlyAccessAccounts) { + this.readOnlyAccessAccounts = readOnlyAccessAccounts; + return this; + } + + /** + * Get the resourcesReceivingAccess property: The names of the Lightsail resources for which to set bucket access. + * + * @return the resourcesReceivingAccess value. + */ + public List resourcesReceivingAccess() { + return this.resourcesReceivingAccess; + } + + /** + * Set the resourcesReceivingAccess property: The names of the Lightsail resources for which to set bucket access. + * + * @param resourcesReceivingAccess the resourcesReceivingAccess value to set. + * @return the AwsLightsailBucketProperties object itself. + */ + public AwsLightsailBucketProperties withResourcesReceivingAccess(List resourcesReceivingAccess) { + this.resourcesReceivingAccess = resourcesReceivingAccess; + return this; + } + + /** + * Get the tags property: An array of key-value pairs to apply to this resource. + * + * @return the tags value. + */ + public List tags() { + return this.tags; + } + + /** + * Set the tags property: An array of key-value pairs to apply to this resource. + * + * @param tags the tags value to set. + * @return the AwsLightsailBucketProperties object itself. + */ + public AwsLightsailBucketProperties withTags(List tags) { + this.tags = tags; + return this; + } + + /** + * Get the url property: The URL of the bucket. + * + * @return the url value. + */ + public String url() { + return this.url; + } + + /** + * Set the url property: The URL of the bucket. + * + * @param url the url value to set. + * @return the AwsLightsailBucketProperties object itself. + */ + public AwsLightsailBucketProperties withUrl(String url) { + this.url = url; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (accessRules() != null) { + accessRules().validate(); + } + if (tags() != null) { + tags().forEach(e -> e.validate()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeBooleanField("ableToUpdateBundle", this.ableToUpdateBundle); + jsonWriter.writeJsonField("accessRules", this.accessRules); + jsonWriter.writeStringField("bucketArn", this.bucketArn); + jsonWriter.writeStringField("bucketName", this.bucketName); + jsonWriter.writeStringField("bundleId", this.bundleId); + jsonWriter.writeBooleanField("objectVersioning", this.objectVersioning); + jsonWriter.writeArrayField("readOnlyAccessAccounts", this.readOnlyAccessAccounts, + (writer, element) -> writer.writeString(element)); + jsonWriter.writeArrayField("resourcesReceivingAccess", this.resourcesReceivingAccess, + (writer, element) -> writer.writeString(element)); + jsonWriter.writeArrayField("tags", this.tags, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("url", this.url); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AwsLightsailBucketProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AwsLightsailBucketProperties if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the AwsLightsailBucketProperties. + */ + public static AwsLightsailBucketProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AwsLightsailBucketProperties deserializedAwsLightsailBucketProperties = new AwsLightsailBucketProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("ableToUpdateBundle".equals(fieldName)) { + deserializedAwsLightsailBucketProperties.ableToUpdateBundle + = reader.getNullable(JsonReader::getBoolean); + } else if ("accessRules".equals(fieldName)) { + deserializedAwsLightsailBucketProperties.accessRules = AccessRules.fromJson(reader); + } else if ("bucketArn".equals(fieldName)) { + deserializedAwsLightsailBucketProperties.bucketArn = reader.getString(); + } else if ("bucketName".equals(fieldName)) { + deserializedAwsLightsailBucketProperties.bucketName = reader.getString(); + } else if ("bundleId".equals(fieldName)) { + deserializedAwsLightsailBucketProperties.bundleId = reader.getString(); + } else if ("objectVersioning".equals(fieldName)) { + deserializedAwsLightsailBucketProperties.objectVersioning + = reader.getNullable(JsonReader::getBoolean); + } else if ("readOnlyAccessAccounts".equals(fieldName)) { + List readOnlyAccessAccounts = reader.readArray(reader1 -> reader1.getString()); + deserializedAwsLightsailBucketProperties.readOnlyAccessAccounts = readOnlyAccessAccounts; + } else if ("resourcesReceivingAccess".equals(fieldName)) { + List resourcesReceivingAccess = reader.readArray(reader1 -> reader1.getString()); + deserializedAwsLightsailBucketProperties.resourcesReceivingAccess = resourcesReceivingAccess; + } else if ("tags".equals(fieldName)) { + List tags = reader.readArray(reader1 -> TagAutoGenerated37.fromJson(reader1)); + deserializedAwsLightsailBucketProperties.tags = tags; + } else if ("url".equals(fieldName)) { + deserializedAwsLightsailBucketProperties.url = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedAwsLightsailBucketProperties; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/AwsLightsailInstanceProperties.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/AwsLightsailInstanceProperties.java new file mode 100644 index 000000000000..7a5c9e2d3b93 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/AwsLightsailInstanceProperties.java @@ -0,0 +1,659 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Definition of awsLightsailInstance. + */ +@Fluent +public final class AwsLightsailInstanceProperties implements JsonSerializable { + /* + * An array of objects representing the add-ons to enable for the new instance. + */ + private List addOns; + + /* + * The Availability Zone in which to create your instance. Use the following format: us-east-2a (case sensitive). Be + * sure to add the include Availability Zones parameter to your request. + */ + private String availabilityZone; + + /* + * The ID for a virtual private server image (e.g., app_wordpress_4_4 or app_lamp_7_0 ). Use the get blueprints + * operation to return a list of available images (or blueprints ). + */ + private String blueprintId; + + /* + * The bundle of specification information for your virtual private server (or instance ), including the pricing + * plan (e.g., micro_1_0 ). + */ + private String bundleId; + + /* + * Hardware of the Instance. + */ + private Hardware hardware; + + /* + * Property instanceArn + */ + private String instanceArn; + + /* + * The names to use for your new Lightsail instance. + */ + private String instanceName; + + /* + * Is the IP Address of the Instance is the static IP + */ + private Boolean isStaticIp; + + /* + * The name of your key pair. + */ + private String keyPairName; + + /* + * Location of a resource. + */ + private Location location; + + /* + * Networking of the Instance. + */ + private Networking networking; + + /* + * Private IP Address of the Instance + */ + private String privateIpAddress; + + /* + * Public IP Address of the Instance + */ + private String publicIpAddress; + + /* + * Resource type of Lightsail instance. + */ + private String resourceType; + + /* + * SSH Key Name of the Lightsail instance. + */ + private String sshKeyName; + + /* + * Current State of the Instance. + */ + private State state; + + /* + * Support code to help identify any issues + */ + private String supportCode; + + /* + * An array of key-value pairs to apply to this resource. + */ + private List tags; + + /* + * A launch script you can create that configures a server with additional user data. For example, you might want to + * run apt-get -y update. + */ + private String userData; + + /* + * Username of the Lightsail instance. + */ + private String username; + + /** + * Creates an instance of AwsLightsailInstanceProperties class. + */ + public AwsLightsailInstanceProperties() { + } + + /** + * Get the addOns property: An array of objects representing the add-ons to enable for the new instance. + * + * @return the addOns value. + */ + public List addOns() { + return this.addOns; + } + + /** + * Set the addOns property: An array of objects representing the add-ons to enable for the new instance. + * + * @param addOns the addOns value to set. + * @return the AwsLightsailInstanceProperties object itself. + */ + public AwsLightsailInstanceProperties withAddOns(List addOns) { + this.addOns = addOns; + return this; + } + + /** + * Get the availabilityZone property: The Availability Zone in which to create your instance. Use the following + * format: us-east-2a (case sensitive). Be sure to add the include Availability Zones parameter to your request. + * + * @return the availabilityZone value. + */ + public String availabilityZone() { + return this.availabilityZone; + } + + /** + * Set the availabilityZone property: The Availability Zone in which to create your instance. Use the following + * format: us-east-2a (case sensitive). Be sure to add the include Availability Zones parameter to your request. + * + * @param availabilityZone the availabilityZone value to set. + * @return the AwsLightsailInstanceProperties object itself. + */ + public AwsLightsailInstanceProperties withAvailabilityZone(String availabilityZone) { + this.availabilityZone = availabilityZone; + return this; + } + + /** + * Get the blueprintId property: The ID for a virtual private server image (e.g., app_wordpress_4_4 or app_lamp_7_0 + * ). Use the get blueprints operation to return a list of available images (or blueprints ). + * + * @return the blueprintId value. + */ + public String blueprintId() { + return this.blueprintId; + } + + /** + * Set the blueprintId property: The ID for a virtual private server image (e.g., app_wordpress_4_4 or app_lamp_7_0 + * ). Use the get blueprints operation to return a list of available images (or blueprints ). + * + * @param blueprintId the blueprintId value to set. + * @return the AwsLightsailInstanceProperties object itself. + */ + public AwsLightsailInstanceProperties withBlueprintId(String blueprintId) { + this.blueprintId = blueprintId; + return this; + } + + /** + * Get the bundleId property: The bundle of specification information for your virtual private server (or instance + * ), including the pricing plan (e.g., micro_1_0 ). + * + * @return the bundleId value. + */ + public String bundleId() { + return this.bundleId; + } + + /** + * Set the bundleId property: The bundle of specification information for your virtual private server (or instance + * ), including the pricing plan (e.g., micro_1_0 ). + * + * @param bundleId the bundleId value to set. + * @return the AwsLightsailInstanceProperties object itself. + */ + public AwsLightsailInstanceProperties withBundleId(String bundleId) { + this.bundleId = bundleId; + return this; + } + + /** + * Get the hardware property: Hardware of the Instance. + * + * @return the hardware value. + */ + public Hardware hardware() { + return this.hardware; + } + + /** + * Set the hardware property: Hardware of the Instance. + * + * @param hardware the hardware value to set. + * @return the AwsLightsailInstanceProperties object itself. + */ + public AwsLightsailInstanceProperties withHardware(Hardware hardware) { + this.hardware = hardware; + return this; + } + + /** + * Get the instanceArn property: Property instanceArn. + * + * @return the instanceArn value. + */ + public String instanceArn() { + return this.instanceArn; + } + + /** + * Set the instanceArn property: Property instanceArn. + * + * @param instanceArn the instanceArn value to set. + * @return the AwsLightsailInstanceProperties object itself. + */ + public AwsLightsailInstanceProperties withInstanceArn(String instanceArn) { + this.instanceArn = instanceArn; + return this; + } + + /** + * Get the instanceName property: The names to use for your new Lightsail instance. + * + * @return the instanceName value. + */ + public String instanceName() { + return this.instanceName; + } + + /** + * Set the instanceName property: The names to use for your new Lightsail instance. + * + * @param instanceName the instanceName value to set. + * @return the AwsLightsailInstanceProperties object itself. + */ + public AwsLightsailInstanceProperties withInstanceName(String instanceName) { + this.instanceName = instanceName; + return this; + } + + /** + * Get the isStaticIp property: Is the IP Address of the Instance is the static IP. + * + * @return the isStaticIp value. + */ + public Boolean isStaticIp() { + return this.isStaticIp; + } + + /** + * Set the isStaticIp property: Is the IP Address of the Instance is the static IP. + * + * @param isStaticIp the isStaticIp value to set. + * @return the AwsLightsailInstanceProperties object itself. + */ + public AwsLightsailInstanceProperties withIsStaticIp(Boolean isStaticIp) { + this.isStaticIp = isStaticIp; + return this; + } + + /** + * Get the keyPairName property: The name of your key pair. + * + * @return the keyPairName value. + */ + public String keyPairName() { + return this.keyPairName; + } + + /** + * Set the keyPairName property: The name of your key pair. + * + * @param keyPairName the keyPairName value to set. + * @return the AwsLightsailInstanceProperties object itself. + */ + public AwsLightsailInstanceProperties withKeyPairName(String keyPairName) { + this.keyPairName = keyPairName; + return this; + } + + /** + * Get the location property: Location of a resource. + * + * @return the location value. + */ + public Location location() { + return this.location; + } + + /** + * Set the location property: Location of a resource. + * + * @param location the location value to set. + * @return the AwsLightsailInstanceProperties object itself. + */ + public AwsLightsailInstanceProperties withLocation(Location location) { + this.location = location; + return this; + } + + /** + * Get the networking property: Networking of the Instance. + * + * @return the networking value. + */ + public Networking networking() { + return this.networking; + } + + /** + * Set the networking property: Networking of the Instance. + * + * @param networking the networking value to set. + * @return the AwsLightsailInstanceProperties object itself. + */ + public AwsLightsailInstanceProperties withNetworking(Networking networking) { + this.networking = networking; + return this; + } + + /** + * Get the privateIpAddress property: Private IP Address of the Instance. + * + * @return the privateIpAddress value. + */ + public String privateIpAddress() { + return this.privateIpAddress; + } + + /** + * Set the privateIpAddress property: Private IP Address of the Instance. + * + * @param privateIpAddress the privateIpAddress value to set. + * @return the AwsLightsailInstanceProperties object itself. + */ + public AwsLightsailInstanceProperties withPrivateIpAddress(String privateIpAddress) { + this.privateIpAddress = privateIpAddress; + return this; + } + + /** + * Get the publicIpAddress property: Public IP Address of the Instance. + * + * @return the publicIpAddress value. + */ + public String publicIpAddress() { + return this.publicIpAddress; + } + + /** + * Set the publicIpAddress property: Public IP Address of the Instance. + * + * @param publicIpAddress the publicIpAddress value to set. + * @return the AwsLightsailInstanceProperties object itself. + */ + public AwsLightsailInstanceProperties withPublicIpAddress(String publicIpAddress) { + this.publicIpAddress = publicIpAddress; + return this; + } + + /** + * Get the resourceType property: Resource type of Lightsail instance. + * + * @return the resourceType value. + */ + public String resourceType() { + return this.resourceType; + } + + /** + * Set the resourceType property: Resource type of Lightsail instance. + * + * @param resourceType the resourceType value to set. + * @return the AwsLightsailInstanceProperties object itself. + */ + public AwsLightsailInstanceProperties withResourceType(String resourceType) { + this.resourceType = resourceType; + return this; + } + + /** + * Get the sshKeyName property: SSH Key Name of the Lightsail instance. + * + * @return the sshKeyName value. + */ + public String sshKeyName() { + return this.sshKeyName; + } + + /** + * Set the sshKeyName property: SSH Key Name of the Lightsail instance. + * + * @param sshKeyName the sshKeyName value to set. + * @return the AwsLightsailInstanceProperties object itself. + */ + public AwsLightsailInstanceProperties withSshKeyName(String sshKeyName) { + this.sshKeyName = sshKeyName; + return this; + } + + /** + * Get the state property: Current State of the Instance. + * + * @return the state value. + */ + public State state() { + return this.state; + } + + /** + * Set the state property: Current State of the Instance. + * + * @param state the state value to set. + * @return the AwsLightsailInstanceProperties object itself. + */ + public AwsLightsailInstanceProperties withState(State state) { + this.state = state; + return this; + } + + /** + * Get the supportCode property: Support code to help identify any issues. + * + * @return the supportCode value. + */ + public String supportCode() { + return this.supportCode; + } + + /** + * Set the supportCode property: Support code to help identify any issues. + * + * @param supportCode the supportCode value to set. + * @return the AwsLightsailInstanceProperties object itself. + */ + public AwsLightsailInstanceProperties withSupportCode(String supportCode) { + this.supportCode = supportCode; + return this; + } + + /** + * Get the tags property: An array of key-value pairs to apply to this resource. + * + * @return the tags value. + */ + public List tags() { + return this.tags; + } + + /** + * Set the tags property: An array of key-value pairs to apply to this resource. + * + * @param tags the tags value to set. + * @return the AwsLightsailInstanceProperties object itself. + */ + public AwsLightsailInstanceProperties withTags(List tags) { + this.tags = tags; + return this; + } + + /** + * Get the userData property: A launch script you can create that configures a server with additional user data. For + * example, you might want to run apt-get -y update. + * + * @return the userData value. + */ + public String userData() { + return this.userData; + } + + /** + * Set the userData property: A launch script you can create that configures a server with additional user data. For + * example, you might want to run apt-get -y update. + * + * @param userData the userData value to set. + * @return the AwsLightsailInstanceProperties object itself. + */ + public AwsLightsailInstanceProperties withUserData(String userData) { + this.userData = userData; + return this; + } + + /** + * Get the username property: Username of the Lightsail instance. + * + * @return the username value. + */ + public String username() { + return this.username; + } + + /** + * Set the username property: Username of the Lightsail instance. + * + * @param username the username value to set. + * @return the AwsLightsailInstanceProperties object itself. + */ + public AwsLightsailInstanceProperties withUsername(String username) { + this.username = username; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (addOns() != null) { + addOns().forEach(e -> e.validate()); + } + if (hardware() != null) { + hardware().validate(); + } + if (location() != null) { + location().validate(); + } + if (networking() != null) { + networking().validate(); + } + if (state() != null) { + state().validate(); + } + if (tags() != null) { + tags().forEach(e -> e.validate()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("addOns", this.addOns, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("availabilityZone", this.availabilityZone); + jsonWriter.writeStringField("blueprintId", this.blueprintId); + jsonWriter.writeStringField("bundleId", this.bundleId); + jsonWriter.writeJsonField("hardware", this.hardware); + jsonWriter.writeStringField("instanceArn", this.instanceArn); + jsonWriter.writeStringField("instanceName", this.instanceName); + jsonWriter.writeBooleanField("isStaticIp", this.isStaticIp); + jsonWriter.writeStringField("keyPairName", this.keyPairName); + jsonWriter.writeJsonField("location", this.location); + jsonWriter.writeJsonField("networking", this.networking); + jsonWriter.writeStringField("privateIpAddress", this.privateIpAddress); + jsonWriter.writeStringField("publicIpAddress", this.publicIpAddress); + jsonWriter.writeStringField("resourceType", this.resourceType); + jsonWriter.writeStringField("sshKeyName", this.sshKeyName); + jsonWriter.writeJsonField("state", this.state); + jsonWriter.writeStringField("supportCode", this.supportCode); + jsonWriter.writeArrayField("tags", this.tags, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("userData", this.userData); + jsonWriter.writeStringField("userName", this.username); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AwsLightsailInstanceProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AwsLightsailInstanceProperties if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the AwsLightsailInstanceProperties. + */ + public static AwsLightsailInstanceProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AwsLightsailInstanceProperties deserializedAwsLightsailInstanceProperties + = new AwsLightsailInstanceProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("addOns".equals(fieldName)) { + List addOns = reader.readArray(reader1 -> AddOn.fromJson(reader1)); + deserializedAwsLightsailInstanceProperties.addOns = addOns; + } else if ("availabilityZone".equals(fieldName)) { + deserializedAwsLightsailInstanceProperties.availabilityZone = reader.getString(); + } else if ("blueprintId".equals(fieldName)) { + deserializedAwsLightsailInstanceProperties.blueprintId = reader.getString(); + } else if ("bundleId".equals(fieldName)) { + deserializedAwsLightsailInstanceProperties.bundleId = reader.getString(); + } else if ("hardware".equals(fieldName)) { + deserializedAwsLightsailInstanceProperties.hardware = Hardware.fromJson(reader); + } else if ("instanceArn".equals(fieldName)) { + deserializedAwsLightsailInstanceProperties.instanceArn = reader.getString(); + } else if ("instanceName".equals(fieldName)) { + deserializedAwsLightsailInstanceProperties.instanceName = reader.getString(); + } else if ("isStaticIp".equals(fieldName)) { + deserializedAwsLightsailInstanceProperties.isStaticIp = reader.getNullable(JsonReader::getBoolean); + } else if ("keyPairName".equals(fieldName)) { + deserializedAwsLightsailInstanceProperties.keyPairName = reader.getString(); + } else if ("location".equals(fieldName)) { + deserializedAwsLightsailInstanceProperties.location = Location.fromJson(reader); + } else if ("networking".equals(fieldName)) { + deserializedAwsLightsailInstanceProperties.networking = Networking.fromJson(reader); + } else if ("privateIpAddress".equals(fieldName)) { + deserializedAwsLightsailInstanceProperties.privateIpAddress = reader.getString(); + } else if ("publicIpAddress".equals(fieldName)) { + deserializedAwsLightsailInstanceProperties.publicIpAddress = reader.getString(); + } else if ("resourceType".equals(fieldName)) { + deserializedAwsLightsailInstanceProperties.resourceType = reader.getString(); + } else if ("sshKeyName".equals(fieldName)) { + deserializedAwsLightsailInstanceProperties.sshKeyName = reader.getString(); + } else if ("state".equals(fieldName)) { + deserializedAwsLightsailInstanceProperties.state = State.fromJson(reader); + } else if ("supportCode".equals(fieldName)) { + deserializedAwsLightsailInstanceProperties.supportCode = reader.getString(); + } else if ("tags".equals(fieldName)) { + List tags = reader.readArray(reader1 -> TagAutoGenerated38.fromJson(reader1)); + deserializedAwsLightsailInstanceProperties.tags = tags; + } else if ("userData".equals(fieldName)) { + deserializedAwsLightsailInstanceProperties.userData = reader.getString(); + } else if ("userName".equals(fieldName)) { + deserializedAwsLightsailInstanceProperties.username = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedAwsLightsailInstanceProperties; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/AwsLogsLogGroupProperties.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/AwsLogsLogGroupProperties.java new file mode 100644 index 000000000000..d07503921cab --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/AwsLogsLogGroupProperties.java @@ -0,0 +1,325 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Definition of awsLogsLogGroup. + */ +@Fluent +public final class AwsLogsLogGroupProperties implements JsonSerializable { + /* + * Property arn + */ + private String arn; + + /* + * Creates a data protection policy and assigns it to the log group. A data protection policy can help safeguard + * sensitive data that's ingested by the log group by auditing and masking the sensitive log data. When a user who + * does not have permission to view masked data views a log event that includes masked data, the sensitive data is + * replaced by asterisks. For more information, including a list of types of data that can be audited and masked, + * see [Protect sensitive log data with + * masking](https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/mask-sensitive-log-data.html). + */ + private Object dataProtectionPolicy; + + /* + * The Amazon Resource Name (ARN) of the KMS key to use when encrypting log data. To associate an KMS key with the + * log group, specify the ARN of that KMS key here. If you do so, ingested data is encrypted using this key. This + * association is stored as long as the data encrypted with the KMS key is still within CWL. This enables CWL to + * decrypt this data whenever it is requested. If you attempt to associate a KMS key with the log group but the KMS + * key doesn't exist or is deactivated, you will receive an ``InvalidParameterException`` error. Log group data is + * always encrypted in CWL. If you omit this key, the encryption does not use KMS. For more information, see + * [Encrypt log data in using](https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/encrypt-log-data-kms.html) + */ + private String kmsKeyId; + + /* + * Specifies the log group class for this log group. There are two classes: + The ``Standard`` log class supports + * all CWL features. + The ``Infrequent Access`` log class supports a subset of CWL features and incurs lower costs. + * For details about the features supported by each class, see [Log + * classes](https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/CloudWatch_Logs_Log_Classes.html) + */ + private LogGroupClass logGroupClass; + + /* + * The name of the log group. If you don't specify a name, CFNlong generates a unique ID for the log group. + */ + private String logGroupName; + + /* + * The number of days to retain the log events in the specified log group. Possible values are: 1, 3, 5, 7, 14, 30, + * 60, 90, 120, 150, 180, 365, 400, 545, 731, 1096, 1827, 2192, 2557, 2922, 3288, and 3653. To set a log group so + * that its log events do not expire, use + * [DeleteRetentionPolicy](https://docs.aws.amazon.com/AmazonCloudWatchLogs/latest/APIReference/ + * API_DeleteRetentionPolicy.html). + */ + private Integer retentionInDays; + + /* + * An array of key-value pairs to apply to the log group. For more information, see + * [Tag](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-resource-tags.html). + */ + private List tags; + + /** + * Creates an instance of AwsLogsLogGroupProperties class. + */ + public AwsLogsLogGroupProperties() { + } + + /** + * Get the arn property: Property arn. + * + * @return the arn value. + */ + public String arn() { + return this.arn; + } + + /** + * Set the arn property: Property arn. + * + * @param arn the arn value to set. + * @return the AwsLogsLogGroupProperties object itself. + */ + public AwsLogsLogGroupProperties withArn(String arn) { + this.arn = arn; + return this; + } + + /** + * Get the dataProtectionPolicy property: Creates a data protection policy and assigns it to the log group. A data + * protection policy can help safeguard sensitive data that's ingested by the log group by auditing and masking the + * sensitive log data. When a user who does not have permission to view masked data views a log event that includes + * masked data, the sensitive data is replaced by asterisks. For more information, including a list of types of data + * that can be audited and masked, see [Protect sensitive log data with + * masking](https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/mask-sensitive-log-data.html). + * + * @return the dataProtectionPolicy value. + */ + public Object dataProtectionPolicy() { + return this.dataProtectionPolicy; + } + + /** + * Set the dataProtectionPolicy property: Creates a data protection policy and assigns it to the log group. A data + * protection policy can help safeguard sensitive data that's ingested by the log group by auditing and masking the + * sensitive log data. When a user who does not have permission to view masked data views a log event that includes + * masked data, the sensitive data is replaced by asterisks. For more information, including a list of types of data + * that can be audited and masked, see [Protect sensitive log data with + * masking](https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/mask-sensitive-log-data.html). + * + * @param dataProtectionPolicy the dataProtectionPolicy value to set. + * @return the AwsLogsLogGroupProperties object itself. + */ + public AwsLogsLogGroupProperties withDataProtectionPolicy(Object dataProtectionPolicy) { + this.dataProtectionPolicy = dataProtectionPolicy; + return this; + } + + /** + * Get the kmsKeyId property: The Amazon Resource Name (ARN) of the KMS key to use when encrypting log data. To + * associate an KMS key with the log group, specify the ARN of that KMS key here. If you do so, ingested data is + * encrypted using this key. This association is stored as long as the data encrypted with the KMS key is still + * within CWL. This enables CWL to decrypt this data whenever it is requested. If you attempt to associate a KMS key + * with the log group but the KMS key doesn't exist or is deactivated, you will receive an + * ``InvalidParameterException`` error. Log group data is always encrypted in CWL. If you omit this key, the + * encryption does not use KMS. For more information, see [Encrypt log data in + * using](https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/encrypt-log-data-kms.html). + * + * @return the kmsKeyId value. + */ + public String kmsKeyId() { + return this.kmsKeyId; + } + + /** + * Set the kmsKeyId property: The Amazon Resource Name (ARN) of the KMS key to use when encrypting log data. To + * associate an KMS key with the log group, specify the ARN of that KMS key here. If you do so, ingested data is + * encrypted using this key. This association is stored as long as the data encrypted with the KMS key is still + * within CWL. This enables CWL to decrypt this data whenever it is requested. If you attempt to associate a KMS key + * with the log group but the KMS key doesn't exist or is deactivated, you will receive an + * ``InvalidParameterException`` error. Log group data is always encrypted in CWL. If you omit this key, the + * encryption does not use KMS. For more information, see [Encrypt log data in + * using](https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/encrypt-log-data-kms.html). + * + * @param kmsKeyId the kmsKeyId value to set. + * @return the AwsLogsLogGroupProperties object itself. + */ + public AwsLogsLogGroupProperties withKmsKeyId(String kmsKeyId) { + this.kmsKeyId = kmsKeyId; + return this; + } + + /** + * Get the logGroupClass property: Specifies the log group class for this log group. There are two classes: + The + * ``Standard`` log class supports all CWL features. + The ``Infrequent Access`` log class supports a subset of CWL + * features and incurs lower costs. For details about the features supported by each class, see [Log + * classes](https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/CloudWatch_Logs_Log_Classes.html). + * + * @return the logGroupClass value. + */ + public LogGroupClass logGroupClass() { + return this.logGroupClass; + } + + /** + * Set the logGroupClass property: Specifies the log group class for this log group. There are two classes: + The + * ``Standard`` log class supports all CWL features. + The ``Infrequent Access`` log class supports a subset of CWL + * features and incurs lower costs. For details about the features supported by each class, see [Log + * classes](https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/CloudWatch_Logs_Log_Classes.html). + * + * @param logGroupClass the logGroupClass value to set. + * @return the AwsLogsLogGroupProperties object itself. + */ + public AwsLogsLogGroupProperties withLogGroupClass(LogGroupClass logGroupClass) { + this.logGroupClass = logGroupClass; + return this; + } + + /** + * Get the logGroupName property: The name of the log group. If you don't specify a name, CFNlong generates a unique + * ID for the log group. + * + * @return the logGroupName value. + */ + public String logGroupName() { + return this.logGroupName; + } + + /** + * Set the logGroupName property: The name of the log group. If you don't specify a name, CFNlong generates a unique + * ID for the log group. + * + * @param logGroupName the logGroupName value to set. + * @return the AwsLogsLogGroupProperties object itself. + */ + public AwsLogsLogGroupProperties withLogGroupName(String logGroupName) { + this.logGroupName = logGroupName; + return this; + } + + /** + * Get the retentionInDays property: The number of days to retain the log events in the specified log group. + * Possible values are: 1, 3, 5, 7, 14, 30, 60, 90, 120, 150, 180, 365, 400, 545, 731, 1096, 1827, 2192, 2557, 2922, + * 3288, and 3653. To set a log group so that its log events do not expire, use + * [DeleteRetentionPolicy](https://docs.aws.amazon.com/AmazonCloudWatchLogs/latest/APIReference/API_DeleteRetentionPolicy.html). + * + * @return the retentionInDays value. + */ + public Integer retentionInDays() { + return this.retentionInDays; + } + + /** + * Set the retentionInDays property: The number of days to retain the log events in the specified log group. + * Possible values are: 1, 3, 5, 7, 14, 30, 60, 90, 120, 150, 180, 365, 400, 545, 731, 1096, 1827, 2192, 2557, 2922, + * 3288, and 3653. To set a log group so that its log events do not expire, use + * [DeleteRetentionPolicy](https://docs.aws.amazon.com/AmazonCloudWatchLogs/latest/APIReference/API_DeleteRetentionPolicy.html). + * + * @param retentionInDays the retentionInDays value to set. + * @return the AwsLogsLogGroupProperties object itself. + */ + public AwsLogsLogGroupProperties withRetentionInDays(Integer retentionInDays) { + this.retentionInDays = retentionInDays; + return this; + } + + /** + * Get the tags property: An array of key-value pairs to apply to the log group. For more information, see + * [Tag](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-resource-tags.html). + * + * @return the tags value. + */ + public List tags() { + return this.tags; + } + + /** + * Set the tags property: An array of key-value pairs to apply to the log group. For more information, see + * [Tag](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-resource-tags.html). + * + * @param tags the tags value to set. + * @return the AwsLogsLogGroupProperties object itself. + */ + public AwsLogsLogGroupProperties withTags(List tags) { + this.tags = tags; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (tags() != null) { + tags().forEach(e -> e.validate()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("arn", this.arn); + jsonWriter.writeUntypedField("dataProtectionPolicy", this.dataProtectionPolicy); + jsonWriter.writeStringField("kmsKeyId", this.kmsKeyId); + jsonWriter.writeStringField("logGroupClass", this.logGroupClass == null ? null : this.logGroupClass.toString()); + jsonWriter.writeStringField("logGroupName", this.logGroupName); + jsonWriter.writeNumberField("retentionInDays", this.retentionInDays); + jsonWriter.writeArrayField("tags", this.tags, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AwsLogsLogGroupProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AwsLogsLogGroupProperties if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IOException If an error occurs while reading the AwsLogsLogGroupProperties. + */ + public static AwsLogsLogGroupProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AwsLogsLogGroupProperties deserializedAwsLogsLogGroupProperties = new AwsLogsLogGroupProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("arn".equals(fieldName)) { + deserializedAwsLogsLogGroupProperties.arn = reader.getString(); + } else if ("dataProtectionPolicy".equals(fieldName)) { + deserializedAwsLogsLogGroupProperties.dataProtectionPolicy = reader.readUntyped(); + } else if ("kmsKeyId".equals(fieldName)) { + deserializedAwsLogsLogGroupProperties.kmsKeyId = reader.getString(); + } else if ("logGroupClass".equals(fieldName)) { + deserializedAwsLogsLogGroupProperties.logGroupClass = LogGroupClass.fromString(reader.getString()); + } else if ("logGroupName".equals(fieldName)) { + deserializedAwsLogsLogGroupProperties.logGroupName = reader.getString(); + } else if ("retentionInDays".equals(fieldName)) { + deserializedAwsLogsLogGroupProperties.retentionInDays = reader.getNullable(JsonReader::getInt); + } else if ("tags".equals(fieldName)) { + List tags = reader.readArray(reader1 -> TagAutoGenerated39.fromJson(reader1)); + deserializedAwsLogsLogGroupProperties.tags = tags; + } else { + reader.skipChildren(); + } + } + + return deserializedAwsLogsLogGroupProperties; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/AwsLogsLogStreamProperties.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/AwsLogsLogStreamProperties.java new file mode 100644 index 000000000000..93a98dac1750 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/AwsLogsLogStreamProperties.java @@ -0,0 +1,121 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of awsLogsLogStream. + */ +@Fluent +public final class AwsLogsLogStreamProperties implements JsonSerializable { + /* + * The name of the log group where the log stream is created. + */ + private String logGroupName; + + /* + * The name of the log stream. The name must be unique wihtin the log group. + */ + private String logStreamName; + + /** + * Creates an instance of AwsLogsLogStreamProperties class. + */ + public AwsLogsLogStreamProperties() { + } + + /** + * Get the logGroupName property: The name of the log group where the log stream is created. + * + * @return the logGroupName value. + */ + public String logGroupName() { + return this.logGroupName; + } + + /** + * Set the logGroupName property: The name of the log group where the log stream is created. + * + * @param logGroupName the logGroupName value to set. + * @return the AwsLogsLogStreamProperties object itself. + */ + public AwsLogsLogStreamProperties withLogGroupName(String logGroupName) { + this.logGroupName = logGroupName; + return this; + } + + /** + * Get the logStreamName property: The name of the log stream. The name must be unique wihtin the log group. + * + * @return the logStreamName value. + */ + public String logStreamName() { + return this.logStreamName; + } + + /** + * Set the logStreamName property: The name of the log stream. The name must be unique wihtin the log group. + * + * @param logStreamName the logStreamName value to set. + * @return the AwsLogsLogStreamProperties object itself. + */ + public AwsLogsLogStreamProperties withLogStreamName(String logStreamName) { + this.logStreamName = logStreamName; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("logGroupName", this.logGroupName); + jsonWriter.writeStringField("logStreamName", this.logStreamName); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AwsLogsLogStreamProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AwsLogsLogStreamProperties if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IOException If an error occurs while reading the AwsLogsLogStreamProperties. + */ + public static AwsLogsLogStreamProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AwsLogsLogStreamProperties deserializedAwsLogsLogStreamProperties = new AwsLogsLogStreamProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("logGroupName".equals(fieldName)) { + deserializedAwsLogsLogStreamProperties.logGroupName = reader.getString(); + } else if ("logStreamName".equals(fieldName)) { + deserializedAwsLogsLogStreamProperties.logStreamName = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedAwsLogsLogStreamProperties; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/AwsLogsMetricFilterProperties.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/AwsLogsMetricFilterProperties.java new file mode 100644 index 000000000000..c88c197eb339 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/AwsLogsMetricFilterProperties.java @@ -0,0 +1,192 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Definition of awsLogsMetricFilter. + */ +@Fluent +public final class AwsLogsMetricFilterProperties implements JsonSerializable { + /* + * The name of the metric filter. + */ + private String filterName; + + /* + * A filter pattern for extracting metric data out of ingested log events. For more information, see [Filter and + * Pattern Syntax](https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/FilterAndPatternSyntax.html). + */ + private String filterPattern; + + /* + * The name of an existing log group that you want to associate with this metric filter. + */ + private String logGroupName; + + /* + * The metric transformations. + */ + private List metricTransformations; + + /** + * Creates an instance of AwsLogsMetricFilterProperties class. + */ + public AwsLogsMetricFilterProperties() { + } + + /** + * Get the filterName property: The name of the metric filter. + * + * @return the filterName value. + */ + public String filterName() { + return this.filterName; + } + + /** + * Set the filterName property: The name of the metric filter. + * + * @param filterName the filterName value to set. + * @return the AwsLogsMetricFilterProperties object itself. + */ + public AwsLogsMetricFilterProperties withFilterName(String filterName) { + this.filterName = filterName; + return this; + } + + /** + * Get the filterPattern property: A filter pattern for extracting metric data out of ingested log events. For more + * information, see [Filter and Pattern + * Syntax](https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/FilterAndPatternSyntax.html). + * + * @return the filterPattern value. + */ + public String filterPattern() { + return this.filterPattern; + } + + /** + * Set the filterPattern property: A filter pattern for extracting metric data out of ingested log events. For more + * information, see [Filter and Pattern + * Syntax](https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/FilterAndPatternSyntax.html). + * + * @param filterPattern the filterPattern value to set. + * @return the AwsLogsMetricFilterProperties object itself. + */ + public AwsLogsMetricFilterProperties withFilterPattern(String filterPattern) { + this.filterPattern = filterPattern; + return this; + } + + /** + * Get the logGroupName property: The name of an existing log group that you want to associate with this metric + * filter. + * + * @return the logGroupName value. + */ + public String logGroupName() { + return this.logGroupName; + } + + /** + * Set the logGroupName property: The name of an existing log group that you want to associate with this metric + * filter. + * + * @param logGroupName the logGroupName value to set. + * @return the AwsLogsMetricFilterProperties object itself. + */ + public AwsLogsMetricFilterProperties withLogGroupName(String logGroupName) { + this.logGroupName = logGroupName; + return this; + } + + /** + * Get the metricTransformations property: The metric transformations. + * + * @return the metricTransformations value. + */ + public List metricTransformations() { + return this.metricTransformations; + } + + /** + * Set the metricTransformations property: The metric transformations. + * + * @param metricTransformations the metricTransformations value to set. + * @return the AwsLogsMetricFilterProperties object itself. + */ + public AwsLogsMetricFilterProperties withMetricTransformations(List metricTransformations) { + this.metricTransformations = metricTransformations; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (metricTransformations() != null) { + metricTransformations().forEach(e -> e.validate()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("filterName", this.filterName); + jsonWriter.writeStringField("filterPattern", this.filterPattern); + jsonWriter.writeStringField("logGroupName", this.logGroupName); + jsonWriter.writeArrayField("metricTransformations", this.metricTransformations, + (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AwsLogsMetricFilterProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AwsLogsMetricFilterProperties if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the AwsLogsMetricFilterProperties. + */ + public static AwsLogsMetricFilterProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AwsLogsMetricFilterProperties deserializedAwsLogsMetricFilterProperties + = new AwsLogsMetricFilterProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("filterName".equals(fieldName)) { + deserializedAwsLogsMetricFilterProperties.filterName = reader.getString(); + } else if ("filterPattern".equals(fieldName)) { + deserializedAwsLogsMetricFilterProperties.filterPattern = reader.getString(); + } else if ("logGroupName".equals(fieldName)) { + deserializedAwsLogsMetricFilterProperties.logGroupName = reader.getString(); + } else if ("metricTransformations".equals(fieldName)) { + List metricTransformations + = reader.readArray(reader1 -> MetricTransformation.fromJson(reader1)); + deserializedAwsLogsMetricFilterProperties.metricTransformations = metricTransformations; + } else { + reader.skipChildren(); + } + } + + return deserializedAwsLogsMetricFilterProperties; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/AwsLogsSubscriptionFilterProperties.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/AwsLogsSubscriptionFilterProperties.java new file mode 100644 index 000000000000..9a67d074a754 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/AwsLogsSubscriptionFilterProperties.java @@ -0,0 +1,254 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of awsLogsSubscriptionFilter. + */ +@Fluent +public final class AwsLogsSubscriptionFilterProperties + implements JsonSerializable { + /* + * The Amazon Resource Name (ARN) of the destination. + */ + private String destinationArn; + + /* + * The method used to distribute log data to the destination, which can be either random or grouped by log stream. + */ + private Distribution distribution; + + /* + * The name of the subscription filter. + */ + private String filterName; + + /* + * The filtering expressions that restrict what gets delivered to the destination AWS resource. For more information + * about the filter pattern syntax, see [Filter and Pattern + * Syntax](https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/FilterAndPatternSyntax.html). + */ + private String filterPattern; + + /* + * The log group to associate with the subscription filter. All log events that are uploaded to this log group are + * filtered and delivered to the specified AWS resource if the filter pattern matches the log events. + */ + private String logGroupName; + + /* + * The ARN of an IAM role that grants CWL permissions to deliver ingested log events to the destination stream. You + * don't need to provide the ARN when you are working with a logical destination for cross-account delivery. + */ + private String roleArn; + + /** + * Creates an instance of AwsLogsSubscriptionFilterProperties class. + */ + public AwsLogsSubscriptionFilterProperties() { + } + + /** + * Get the destinationArn property: The Amazon Resource Name (ARN) of the destination. + * + * @return the destinationArn value. + */ + public String destinationArn() { + return this.destinationArn; + } + + /** + * Set the destinationArn property: The Amazon Resource Name (ARN) of the destination. + * + * @param destinationArn the destinationArn value to set. + * @return the AwsLogsSubscriptionFilterProperties object itself. + */ + public AwsLogsSubscriptionFilterProperties withDestinationArn(String destinationArn) { + this.destinationArn = destinationArn; + return this; + } + + /** + * Get the distribution property: The method used to distribute log data to the destination, which can be either + * random or grouped by log stream. + * + * @return the distribution value. + */ + public Distribution distribution() { + return this.distribution; + } + + /** + * Set the distribution property: The method used to distribute log data to the destination, which can be either + * random or grouped by log stream. + * + * @param distribution the distribution value to set. + * @return the AwsLogsSubscriptionFilterProperties object itself. + */ + public AwsLogsSubscriptionFilterProperties withDistribution(Distribution distribution) { + this.distribution = distribution; + return this; + } + + /** + * Get the filterName property: The name of the subscription filter. + * + * @return the filterName value. + */ + public String filterName() { + return this.filterName; + } + + /** + * Set the filterName property: The name of the subscription filter. + * + * @param filterName the filterName value to set. + * @return the AwsLogsSubscriptionFilterProperties object itself. + */ + public AwsLogsSubscriptionFilterProperties withFilterName(String filterName) { + this.filterName = filterName; + return this; + } + + /** + * Get the filterPattern property: The filtering expressions that restrict what gets delivered to the destination + * AWS resource. For more information about the filter pattern syntax, see [Filter and Pattern + * Syntax](https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/FilterAndPatternSyntax.html). + * + * @return the filterPattern value. + */ + public String filterPattern() { + return this.filterPattern; + } + + /** + * Set the filterPattern property: The filtering expressions that restrict what gets delivered to the destination + * AWS resource. For more information about the filter pattern syntax, see [Filter and Pattern + * Syntax](https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/FilterAndPatternSyntax.html). + * + * @param filterPattern the filterPattern value to set. + * @return the AwsLogsSubscriptionFilterProperties object itself. + */ + public AwsLogsSubscriptionFilterProperties withFilterPattern(String filterPattern) { + this.filterPattern = filterPattern; + return this; + } + + /** + * Get the logGroupName property: The log group to associate with the subscription filter. All log events that are + * uploaded to this log group are filtered and delivered to the specified AWS resource if the filter pattern matches + * the log events. + * + * @return the logGroupName value. + */ + public String logGroupName() { + return this.logGroupName; + } + + /** + * Set the logGroupName property: The log group to associate with the subscription filter. All log events that are + * uploaded to this log group are filtered and delivered to the specified AWS resource if the filter pattern matches + * the log events. + * + * @param logGroupName the logGroupName value to set. + * @return the AwsLogsSubscriptionFilterProperties object itself. + */ + public AwsLogsSubscriptionFilterProperties withLogGroupName(String logGroupName) { + this.logGroupName = logGroupName; + return this; + } + + /** + * Get the roleArn property: The ARN of an IAM role that grants CWL permissions to deliver ingested log events to + * the destination stream. You don't need to provide the ARN when you are working with a logical destination for + * cross-account delivery. + * + * @return the roleArn value. + */ + public String roleArn() { + return this.roleArn; + } + + /** + * Set the roleArn property: The ARN of an IAM role that grants CWL permissions to deliver ingested log events to + * the destination stream. You don't need to provide the ARN when you are working with a logical destination for + * cross-account delivery. + * + * @param roleArn the roleArn value to set. + * @return the AwsLogsSubscriptionFilterProperties object itself. + */ + public AwsLogsSubscriptionFilterProperties withRoleArn(String roleArn) { + this.roleArn = roleArn; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("destinationArn", this.destinationArn); + jsonWriter.writeStringField("distribution", this.distribution == null ? null : this.distribution.toString()); + jsonWriter.writeStringField("filterName", this.filterName); + jsonWriter.writeStringField("filterPattern", this.filterPattern); + jsonWriter.writeStringField("logGroupName", this.logGroupName); + jsonWriter.writeStringField("roleArn", this.roleArn); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AwsLogsSubscriptionFilterProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AwsLogsSubscriptionFilterProperties if the JsonReader was pointing to an instance of it, + * or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the AwsLogsSubscriptionFilterProperties. + */ + public static AwsLogsSubscriptionFilterProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AwsLogsSubscriptionFilterProperties deserializedAwsLogsSubscriptionFilterProperties + = new AwsLogsSubscriptionFilterProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("destinationArn".equals(fieldName)) { + deserializedAwsLogsSubscriptionFilterProperties.destinationArn = reader.getString(); + } else if ("distribution".equals(fieldName)) { + deserializedAwsLogsSubscriptionFilterProperties.distribution + = Distribution.fromString(reader.getString()); + } else if ("filterName".equals(fieldName)) { + deserializedAwsLogsSubscriptionFilterProperties.filterName = reader.getString(); + } else if ("filterPattern".equals(fieldName)) { + deserializedAwsLogsSubscriptionFilterProperties.filterPattern = reader.getString(); + } else if ("logGroupName".equals(fieldName)) { + deserializedAwsLogsSubscriptionFilterProperties.logGroupName = reader.getString(); + } else if ("roleArn".equals(fieldName)) { + deserializedAwsLogsSubscriptionFilterProperties.roleArn = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedAwsLogsSubscriptionFilterProperties; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/AwsMacie2JobSummaryProperties.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/AwsMacie2JobSummaryProperties.java new file mode 100644 index 000000000000..1622ece4e41c --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/AwsMacie2JobSummaryProperties.java @@ -0,0 +1,413 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.time.OffsetDateTime; +import java.time.format.DateTimeFormatter; +import java.util.List; + +/** + * Definition of awsMacie2JobSummary. + */ +@Fluent +public final class AwsMacie2JobSummaryProperties implements JsonSerializable { + /* + *

The property- and tag-based conditions that determine which S3 buckets are included or excluded from the job's + * analysis. Each time the job runs, the job uses these criteria to determine which buckets to analyze. A job's + * definition can contain a bucketCriteria object or a bucketDefinitions array, not both.

+ */ + private S3BucketCriteriaForJob bucketCriteria; + + /* + *

An array of objects, one for each Amazon Web Services account that owns specific S3 buckets for the job to + * analyze. Each object specifies the account ID for an account and one or more buckets to analyze for that account. + * A job's definition can contain a bucketDefinitions array or a bucketCriteria object, not both.

+ */ + private List bucketDefinitions; + + /* + *

The date and time, in UTC and extended ISO 8601 format, when the job was created.

+ */ + private OffsetDateTime createdAt; + + /* + *

The unique identifier for the job.

+ */ + private String jobId; + + /* + *

The current status of the job. Possible values are:

  • CANCELLED - You cancelled the job or, if + * it's a one-time job, you paused the job and didn't resume it within 30 days.

  • COMPLETE - For a + * one-time job, Amazon Macie finished processing the data specified for the job. This value doesn't apply to + * recurring jobs.

  • IDLE - For a recurring job, the previous scheduled run is complete and the next + * scheduled run is pending. This value doesn't apply to one-time jobs.

  • PAUSED - Macie started + * running the job but additional processing would exceed the monthly sensitive data discovery quota for your + * account or one or more member accounts that the job analyzes data for.

  • RUNNING - For a one-time + * job, the job is in progress. For a recurring job, a scheduled run is in progress.

  • USER_PAUSED - + * You paused the job. If you paused the job while it had a status of RUNNING and you don't resume it within 30 days + * of pausing it, the job or job run will expire and be cancelled, depending on the job's type. To check the + * expiration date, refer to the UserPausedDetails.jobExpiresAt property.

+ */ + private JobStatusEnumValue jobStatus; + + /* + *

The schedule for running the job. Possible values are:

  • ONE_TIME - The job runs only + * once.

  • SCHEDULED - The job runs on a daily, weekly, or monthly basis.

+ */ + private JobTypeEnumValue jobType; + + /* + *

Specifies whether any account- or bucket-level access errors occurred when the job ran. For a recurring job, + * this value indicates the error status of the job's most recent run.

+ */ + private LastRunErrorStatus lastRunErrorStatus; + + /* + *

The custom name of the job.

+ */ + private String name; + + /* + *

If the current status of the job is USER_PAUSED, specifies when the job was paused and when the job or job run + * will expire and be cancelled if it isn't resumed. This value is present only if the value for jobStatus is + * USER_PAUSED.

+ */ + private UserPausedDetails userPausedDetails; + + /** + * Creates an instance of AwsMacie2JobSummaryProperties class. + */ + public AwsMacie2JobSummaryProperties() { + } + + /** + * Get the bucketCriteria property: <p>The property- and tag-based conditions that determine which S3 buckets + * are included or excluded from the job's analysis. Each time the job runs, the job uses these criteria to + * determine which buckets to analyze. A job's definition can contain a bucketCriteria object or a bucketDefinitions + * array, not both.</p>. + * + * @return the bucketCriteria value. + */ + public S3BucketCriteriaForJob bucketCriteria() { + return this.bucketCriteria; + } + + /** + * Set the bucketCriteria property: <p>The property- and tag-based conditions that determine which S3 buckets + * are included or excluded from the job's analysis. Each time the job runs, the job uses these criteria to + * determine which buckets to analyze. A job's definition can contain a bucketCriteria object or a bucketDefinitions + * array, not both.</p>. + * + * @param bucketCriteria the bucketCriteria value to set. + * @return the AwsMacie2JobSummaryProperties object itself. + */ + public AwsMacie2JobSummaryProperties withBucketCriteria(S3BucketCriteriaForJob bucketCriteria) { + this.bucketCriteria = bucketCriteria; + return this; + } + + /** + * Get the bucketDefinitions property: <p>An array of objects, one for each Amazon Web Services account that + * owns specific S3 buckets for the job to analyze. Each object specifies the account ID for an account and one or + * more buckets to analyze for that account. A job's definition can contain a bucketDefinitions array or a + * bucketCriteria object, not both.</p>. + * + * @return the bucketDefinitions value. + */ + public List bucketDefinitions() { + return this.bucketDefinitions; + } + + /** + * Set the bucketDefinitions property: <p>An array of objects, one for each Amazon Web Services account that + * owns specific S3 buckets for the job to analyze. Each object specifies the account ID for an account and one or + * more buckets to analyze for that account. A job's definition can contain a bucketDefinitions array or a + * bucketCriteria object, not both.</p>. + * + * @param bucketDefinitions the bucketDefinitions value to set. + * @return the AwsMacie2JobSummaryProperties object itself. + */ + public AwsMacie2JobSummaryProperties withBucketDefinitions(List bucketDefinitions) { + this.bucketDefinitions = bucketDefinitions; + return this; + } + + /** + * Get the createdAt property: <p>The date and time, in UTC and extended ISO 8601 format, when the job was + * created.</p>. + * + * @return the createdAt value. + */ + public OffsetDateTime createdAt() { + return this.createdAt; + } + + /** + * Set the createdAt property: <p>The date and time, in UTC and extended ISO 8601 format, when the job was + * created.</p>. + * + * @param createdAt the createdAt value to set. + * @return the AwsMacie2JobSummaryProperties object itself. + */ + public AwsMacie2JobSummaryProperties withCreatedAt(OffsetDateTime createdAt) { + this.createdAt = createdAt; + return this; + } + + /** + * Get the jobId property: <p>The unique identifier for the job.</p>. + * + * @return the jobId value. + */ + public String jobId() { + return this.jobId; + } + + /** + * Set the jobId property: <p>The unique identifier for the job.</p>. + * + * @param jobId the jobId value to set. + * @return the AwsMacie2JobSummaryProperties object itself. + */ + public AwsMacie2JobSummaryProperties withJobId(String jobId) { + this.jobId = jobId; + return this; + } + + /** + * Get the jobStatus property: <p>The current status of the job. Possible values are:</p> + * <ul><li><p>CANCELLED - You cancelled the job or, if it's a one-time job, you paused the job and + * didn't resume it within 30 days.</p></li> <li><p>COMPLETE - For a one-time job, Amazon + * Macie finished processing the data specified for the job. This value doesn't apply to recurring + * jobs.</p></li> <li><p>IDLE - For a recurring job, the previous scheduled run is complete + * and the next scheduled run is pending. This value doesn't apply to one-time jobs.</p></li> + * <li><p>PAUSED - Macie started running the job but additional processing would exceed the monthly + * sensitive data discovery quota for your account or one or more member accounts that the job analyzes data + * for.</p></li> <li><p>RUNNING - For a one-time job, the job is in progress. For a + * recurring job, a scheduled run is in progress.</p></li> <li><p>USER_PAUSED - You paused + * the job. If you paused the job while it had a status of RUNNING and you don't resume it within 30 days of pausing + * it, the job or job run will expire and be cancelled, depending on the job's type. To check the expiration date, + * refer to the UserPausedDetails.jobExpiresAt property.</p></li></ul>. + * + * @return the jobStatus value. + */ + public JobStatusEnumValue jobStatus() { + return this.jobStatus; + } + + /** + * Set the jobStatus property: <p>The current status of the job. Possible values are:</p> + * <ul><li><p>CANCELLED - You cancelled the job or, if it's a one-time job, you paused the job and + * didn't resume it within 30 days.</p></li> <li><p>COMPLETE - For a one-time job, Amazon + * Macie finished processing the data specified for the job. This value doesn't apply to recurring + * jobs.</p></li> <li><p>IDLE - For a recurring job, the previous scheduled run is complete + * and the next scheduled run is pending. This value doesn't apply to one-time jobs.</p></li> + * <li><p>PAUSED - Macie started running the job but additional processing would exceed the monthly + * sensitive data discovery quota for your account or one or more member accounts that the job analyzes data + * for.</p></li> <li><p>RUNNING - For a one-time job, the job is in progress. For a + * recurring job, a scheduled run is in progress.</p></li> <li><p>USER_PAUSED - You paused + * the job. If you paused the job while it had a status of RUNNING and you don't resume it within 30 days of pausing + * it, the job or job run will expire and be cancelled, depending on the job's type. To check the expiration date, + * refer to the UserPausedDetails.jobExpiresAt property.</p></li></ul>. + * + * @param jobStatus the jobStatus value to set. + * @return the AwsMacie2JobSummaryProperties object itself. + */ + public AwsMacie2JobSummaryProperties withJobStatus(JobStatusEnumValue jobStatus) { + this.jobStatus = jobStatus; + return this; + } + + /** + * Get the jobType property: <p>The schedule for running the job. Possible values are:</p> + * <ul><li><p>ONE_TIME - The job runs only once.</p></li> <li><p>SCHEDULED + * - The job runs on a daily, weekly, or monthly basis.</p></li></ul>. + * + * @return the jobType value. + */ + public JobTypeEnumValue jobType() { + return this.jobType; + } + + /** + * Set the jobType property: <p>The schedule for running the job. Possible values are:</p> + * <ul><li><p>ONE_TIME - The job runs only once.</p></li> <li><p>SCHEDULED + * - The job runs on a daily, weekly, or monthly basis.</p></li></ul>. + * + * @param jobType the jobType value to set. + * @return the AwsMacie2JobSummaryProperties object itself. + */ + public AwsMacie2JobSummaryProperties withJobType(JobTypeEnumValue jobType) { + this.jobType = jobType; + return this; + } + + /** + * Get the lastRunErrorStatus property: <p>Specifies whether any account- or bucket-level access errors + * occurred when the job ran. For a recurring job, this value indicates the error status of the job's most recent + * run.</p>. + * + * @return the lastRunErrorStatus value. + */ + public LastRunErrorStatus lastRunErrorStatus() { + return this.lastRunErrorStatus; + } + + /** + * Set the lastRunErrorStatus property: <p>Specifies whether any account- or bucket-level access errors + * occurred when the job ran. For a recurring job, this value indicates the error status of the job's most recent + * run.</p>. + * + * @param lastRunErrorStatus the lastRunErrorStatus value to set. + * @return the AwsMacie2JobSummaryProperties object itself. + */ + public AwsMacie2JobSummaryProperties withLastRunErrorStatus(LastRunErrorStatus lastRunErrorStatus) { + this.lastRunErrorStatus = lastRunErrorStatus; + return this; + } + + /** + * Get the name property: <p>The custom name of the job.</p>. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: <p>The custom name of the job.</p>. + * + * @param name the name value to set. + * @return the AwsMacie2JobSummaryProperties object itself. + */ + public AwsMacie2JobSummaryProperties withName(String name) { + this.name = name; + return this; + } + + /** + * Get the userPausedDetails property: <p>If the current status of the job is USER_PAUSED, specifies when the + * job was paused and when the job or job run will expire and be cancelled if it isn't resumed. This value is + * present only if the value for jobStatus is USER_PAUSED.</p>. + * + * @return the userPausedDetails value. + */ + public UserPausedDetails userPausedDetails() { + return this.userPausedDetails; + } + + /** + * Set the userPausedDetails property: <p>If the current status of the job is USER_PAUSED, specifies when the + * job was paused and when the job or job run will expire and be cancelled if it isn't resumed. This value is + * present only if the value for jobStatus is USER_PAUSED.</p>. + * + * @param userPausedDetails the userPausedDetails value to set. + * @return the AwsMacie2JobSummaryProperties object itself. + */ + public AwsMacie2JobSummaryProperties withUserPausedDetails(UserPausedDetails userPausedDetails) { + this.userPausedDetails = userPausedDetails; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (bucketCriteria() != null) { + bucketCriteria().validate(); + } + if (bucketDefinitions() != null) { + bucketDefinitions().forEach(e -> e.validate()); + } + if (jobStatus() != null) { + jobStatus().validate(); + } + if (jobType() != null) { + jobType().validate(); + } + if (lastRunErrorStatus() != null) { + lastRunErrorStatus().validate(); + } + if (userPausedDetails() != null) { + userPausedDetails().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("bucketCriteria", this.bucketCriteria); + jsonWriter.writeArrayField("bucketDefinitions", this.bucketDefinitions, + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("createdAt", + this.createdAt == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.createdAt)); + jsonWriter.writeStringField("jobId", this.jobId); + jsonWriter.writeJsonField("jobStatus", this.jobStatus); + jsonWriter.writeJsonField("jobType", this.jobType); + jsonWriter.writeJsonField("lastRunErrorStatus", this.lastRunErrorStatus); + jsonWriter.writeStringField("name", this.name); + jsonWriter.writeJsonField("userPausedDetails", this.userPausedDetails); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AwsMacie2JobSummaryProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AwsMacie2JobSummaryProperties if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the AwsMacie2JobSummaryProperties. + */ + public static AwsMacie2JobSummaryProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AwsMacie2JobSummaryProperties deserializedAwsMacie2JobSummaryProperties + = new AwsMacie2JobSummaryProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("bucketCriteria".equals(fieldName)) { + deserializedAwsMacie2JobSummaryProperties.bucketCriteria = S3BucketCriteriaForJob.fromJson(reader); + } else if ("bucketDefinitions".equals(fieldName)) { + List bucketDefinitions + = reader.readArray(reader1 -> S3BucketDefinitionForJob.fromJson(reader1)); + deserializedAwsMacie2JobSummaryProperties.bucketDefinitions = bucketDefinitions; + } else if ("createdAt".equals(fieldName)) { + deserializedAwsMacie2JobSummaryProperties.createdAt = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("jobId".equals(fieldName)) { + deserializedAwsMacie2JobSummaryProperties.jobId = reader.getString(); + } else if ("jobStatus".equals(fieldName)) { + deserializedAwsMacie2JobSummaryProperties.jobStatus = JobStatusEnumValue.fromJson(reader); + } else if ("jobType".equals(fieldName)) { + deserializedAwsMacie2JobSummaryProperties.jobType = JobTypeEnumValue.fromJson(reader); + } else if ("lastRunErrorStatus".equals(fieldName)) { + deserializedAwsMacie2JobSummaryProperties.lastRunErrorStatus = LastRunErrorStatus.fromJson(reader); + } else if ("name".equals(fieldName)) { + deserializedAwsMacie2JobSummaryProperties.name = reader.getString(); + } else if ("userPausedDetails".equals(fieldName)) { + deserializedAwsMacie2JobSummaryProperties.userPausedDetails = UserPausedDetails.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedAwsMacie2JobSummaryProperties; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/AwsMacieAllowListProperties.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/AwsMacieAllowListProperties.java new file mode 100644 index 000000000000..649d7dea1932 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/AwsMacieAllowListProperties.java @@ -0,0 +1,269 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Definition of awsMacieAllowList. + */ +@Fluent +public final class AwsMacieAllowListProperties implements JsonSerializable { + /* + * AllowList ARN. + */ + private String arn; + + /* + * AllowList criteria. The regex or s3 object to use for the AllowList. + */ + private Criteria criteria; + + /* + * Description of AllowList. + */ + private String description; + + /* + * AllowList ID. + */ + private String id; + + /* + * Name of AllowList. + */ + private String name; + + /* + * AllowList status. The status for the AllowList + */ + private Status status; + + /* + * A collection of tags associated with a resource + */ + private List tags; + + /** + * Creates an instance of AwsMacieAllowListProperties class. + */ + public AwsMacieAllowListProperties() { + } + + /** + * Get the arn property: AllowList ARN. + * + * @return the arn value. + */ + public String arn() { + return this.arn; + } + + /** + * Set the arn property: AllowList ARN. + * + * @param arn the arn value to set. + * @return the AwsMacieAllowListProperties object itself. + */ + public AwsMacieAllowListProperties withArn(String arn) { + this.arn = arn; + return this; + } + + /** + * Get the criteria property: AllowList criteria. The regex or s3 object to use for the AllowList. + * + * @return the criteria value. + */ + public Criteria criteria() { + return this.criteria; + } + + /** + * Set the criteria property: AllowList criteria. The regex or s3 object to use for the AllowList. + * + * @param criteria the criteria value to set. + * @return the AwsMacieAllowListProperties object itself. + */ + public AwsMacieAllowListProperties withCriteria(Criteria criteria) { + this.criteria = criteria; + return this; + } + + /** + * Get the description property: Description of AllowList. + * + * @return the description value. + */ + public String description() { + return this.description; + } + + /** + * Set the description property: Description of AllowList. + * + * @param description the description value to set. + * @return the AwsMacieAllowListProperties object itself. + */ + public AwsMacieAllowListProperties withDescription(String description) { + this.description = description; + return this; + } + + /** + * Get the id property: AllowList ID. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Set the id property: AllowList ID. + * + * @param id the id value to set. + * @return the AwsMacieAllowListProperties object itself. + */ + public AwsMacieAllowListProperties withId(String id) { + this.id = id; + return this; + } + + /** + * Get the name property: Name of AllowList. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: Name of AllowList. + * + * @param name the name value to set. + * @return the AwsMacieAllowListProperties object itself. + */ + public AwsMacieAllowListProperties withName(String name) { + this.name = name; + return this; + } + + /** + * Get the status property: AllowList status. The status for the AllowList. + * + * @return the status value. + */ + public Status status() { + return this.status; + } + + /** + * Set the status property: AllowList status. The status for the AllowList. + * + * @param status the status value to set. + * @return the AwsMacieAllowListProperties object itself. + */ + public AwsMacieAllowListProperties withStatus(Status status) { + this.status = status; + return this; + } + + /** + * Get the tags property: A collection of tags associated with a resource. + * + * @return the tags value. + */ + public List tags() { + return this.tags; + } + + /** + * Set the tags property: A collection of tags associated with a resource. + * + * @param tags the tags value to set. + * @return the AwsMacieAllowListProperties object itself. + */ + public AwsMacieAllowListProperties withTags(List tags) { + this.tags = tags; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (criteria() != null) { + criteria().validate(); + } + if (tags() != null) { + tags().forEach(e -> e.validate()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("arn", this.arn); + jsonWriter.writeJsonField("criteria", this.criteria); + jsonWriter.writeStringField("description", this.description); + jsonWriter.writeStringField("id", this.id); + jsonWriter.writeStringField("name", this.name); + jsonWriter.writeStringField("status", this.status == null ? null : this.status.toString()); + jsonWriter.writeArrayField("tags", this.tags, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AwsMacieAllowListProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AwsMacieAllowListProperties if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the AwsMacieAllowListProperties. + */ + public static AwsMacieAllowListProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AwsMacieAllowListProperties deserializedAwsMacieAllowListProperties = new AwsMacieAllowListProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("arn".equals(fieldName)) { + deserializedAwsMacieAllowListProperties.arn = reader.getString(); + } else if ("criteria".equals(fieldName)) { + deserializedAwsMacieAllowListProperties.criteria = Criteria.fromJson(reader); + } else if ("description".equals(fieldName)) { + deserializedAwsMacieAllowListProperties.description = reader.getString(); + } else if ("id".equals(fieldName)) { + deserializedAwsMacieAllowListProperties.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedAwsMacieAllowListProperties.name = reader.getString(); + } else if ("status".equals(fieldName)) { + deserializedAwsMacieAllowListProperties.status = Status.fromString(reader.getString()); + } else if ("tags".equals(fieldName)) { + List tags = reader.readArray(reader1 -> TagAutoGenerated40.fromJson(reader1)); + deserializedAwsMacieAllowListProperties.tags = tags; + } else { + reader.skipChildren(); + } + } + + return deserializedAwsMacieAllowListProperties; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/AwsNetworkFirewallPolicyProperties.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/AwsNetworkFirewallPolicyProperties.java new file mode 100644 index 000000000000..6c8dc3eec121 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/AwsNetworkFirewallPolicyProperties.java @@ -0,0 +1,242 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Definition of awsNetworkFirewallFirewallPolicy. + */ +@Fluent +public final class AwsNetworkFirewallPolicyProperties implements JsonSerializable { + /* + * Property description + */ + private String description; + + /* + * Property firewallPolicy + */ + private FirewallPolicy firewallPolicy; + + /* + * A resource ARN. + */ + private String firewallPolicyArn; + + /* + * Property firewallPolicyId + */ + private String firewallPolicyId; + + /* + * Property firewallPolicyName + */ + private String firewallPolicyName; + + /* + * Property tags + */ + private List tags; + + /** + * Creates an instance of AwsNetworkFirewallPolicyProperties class. + */ + public AwsNetworkFirewallPolicyProperties() { + } + + /** + * Get the description property: Property description. + * + * @return the description value. + */ + public String description() { + return this.description; + } + + /** + * Set the description property: Property description. + * + * @param description the description value to set. + * @return the AwsNetworkFirewallPolicyProperties object itself. + */ + public AwsNetworkFirewallPolicyProperties withDescription(String description) { + this.description = description; + return this; + } + + /** + * Get the firewallPolicy property: Property firewallPolicy. + * + * @return the firewallPolicy value. + */ + public FirewallPolicy firewallPolicy() { + return this.firewallPolicy; + } + + /** + * Set the firewallPolicy property: Property firewallPolicy. + * + * @param firewallPolicy the firewallPolicy value to set. + * @return the AwsNetworkFirewallPolicyProperties object itself. + */ + public AwsNetworkFirewallPolicyProperties withFirewallPolicy(FirewallPolicy firewallPolicy) { + this.firewallPolicy = firewallPolicy; + return this; + } + + /** + * Get the firewallPolicyArn property: A resource ARN. + * + * @return the firewallPolicyArn value. + */ + public String firewallPolicyArn() { + return this.firewallPolicyArn; + } + + /** + * Set the firewallPolicyArn property: A resource ARN. + * + * @param firewallPolicyArn the firewallPolicyArn value to set. + * @return the AwsNetworkFirewallPolicyProperties object itself. + */ + public AwsNetworkFirewallPolicyProperties withFirewallPolicyArn(String firewallPolicyArn) { + this.firewallPolicyArn = firewallPolicyArn; + return this; + } + + /** + * Get the firewallPolicyId property: Property firewallPolicyId. + * + * @return the firewallPolicyId value. + */ + public String firewallPolicyId() { + return this.firewallPolicyId; + } + + /** + * Set the firewallPolicyId property: Property firewallPolicyId. + * + * @param firewallPolicyId the firewallPolicyId value to set. + * @return the AwsNetworkFirewallPolicyProperties object itself. + */ + public AwsNetworkFirewallPolicyProperties withFirewallPolicyId(String firewallPolicyId) { + this.firewallPolicyId = firewallPolicyId; + return this; + } + + /** + * Get the firewallPolicyName property: Property firewallPolicyName. + * + * @return the firewallPolicyName value. + */ + public String firewallPolicyName() { + return this.firewallPolicyName; + } + + /** + * Set the firewallPolicyName property: Property firewallPolicyName. + * + * @param firewallPolicyName the firewallPolicyName value to set. + * @return the AwsNetworkFirewallPolicyProperties object itself. + */ + public AwsNetworkFirewallPolicyProperties withFirewallPolicyName(String firewallPolicyName) { + this.firewallPolicyName = firewallPolicyName; + return this; + } + + /** + * Get the tags property: Property tags. + * + * @return the tags value. + */ + public List tags() { + return this.tags; + } + + /** + * Set the tags property: Property tags. + * + * @param tags the tags value to set. + * @return the AwsNetworkFirewallPolicyProperties object itself. + */ + public AwsNetworkFirewallPolicyProperties withTags(List tags) { + this.tags = tags; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (firewallPolicy() != null) { + firewallPolicy().validate(); + } + if (tags() != null) { + tags().forEach(e -> e.validate()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("description", this.description); + jsonWriter.writeJsonField("firewallPolicy", this.firewallPolicy); + jsonWriter.writeStringField("firewallPolicyArn", this.firewallPolicyArn); + jsonWriter.writeStringField("firewallPolicyId", this.firewallPolicyId); + jsonWriter.writeStringField("firewallPolicyName", this.firewallPolicyName); + jsonWriter.writeArrayField("tags", this.tags, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AwsNetworkFirewallPolicyProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AwsNetworkFirewallPolicyProperties if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the AwsNetworkFirewallPolicyProperties. + */ + public static AwsNetworkFirewallPolicyProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AwsNetworkFirewallPolicyProperties deserializedAwsNetworkFirewallPolicyProperties + = new AwsNetworkFirewallPolicyProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("description".equals(fieldName)) { + deserializedAwsNetworkFirewallPolicyProperties.description = reader.getString(); + } else if ("firewallPolicy".equals(fieldName)) { + deserializedAwsNetworkFirewallPolicyProperties.firewallPolicy = FirewallPolicy.fromJson(reader); + } else if ("firewallPolicyArn".equals(fieldName)) { + deserializedAwsNetworkFirewallPolicyProperties.firewallPolicyArn = reader.getString(); + } else if ("firewallPolicyId".equals(fieldName)) { + deserializedAwsNetworkFirewallPolicyProperties.firewallPolicyId = reader.getString(); + } else if ("firewallPolicyName".equals(fieldName)) { + deserializedAwsNetworkFirewallPolicyProperties.firewallPolicyName = reader.getString(); + } else if ("tags".equals(fieldName)) { + List tags = reader.readArray(reader1 -> TagAutoGenerated42.fromJson(reader1)); + deserializedAwsNetworkFirewallPolicyProperties.tags = tags; + } else { + reader.skipChildren(); + } + } + + return deserializedAwsNetworkFirewallPolicyProperties; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/AwsNetworkFirewallProperties.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/AwsNetworkFirewallProperties.java new file mode 100644 index 000000000000..f003fd5aff48 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/AwsNetworkFirewallProperties.java @@ -0,0 +1,416 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Definition of awsNetworkFirewallFirewall. + */ +@Fluent +public final class AwsNetworkFirewallProperties implements JsonSerializable { + /* + * Property deleteProtection + */ + private Boolean deleteProtection; + + /* + * Property description + */ + private String description; + + /* + * Property endpointIds + */ + private List endpointIds; + + /* + * A resource ARN. + */ + private String firewallArn; + + /* + * Property firewallId + */ + private String firewallId; + + /* + * Property firewallName + */ + private String firewallName; + + /* + * A resource ARN. + */ + private String firewallPolicyArn; + + /* + * Property firewallPolicyChangeProtection + */ + private Boolean firewallPolicyChangeProtection; + + /* + * Property subnetChangeProtection + */ + private Boolean subnetChangeProtection; + + /* + * Property subnetMappings + */ + private List subnetMappings; + + /* + * Property tags + */ + private List tags; + + /* + * Property vpcId + */ + private String vpcId; + + /** + * Creates an instance of AwsNetworkFirewallProperties class. + */ + public AwsNetworkFirewallProperties() { + } + + /** + * Get the deleteProtection property: Property deleteProtection. + * + * @return the deleteProtection value. + */ + public Boolean deleteProtection() { + return this.deleteProtection; + } + + /** + * Set the deleteProtection property: Property deleteProtection. + * + * @param deleteProtection the deleteProtection value to set. + * @return the AwsNetworkFirewallProperties object itself. + */ + public AwsNetworkFirewallProperties withDeleteProtection(Boolean deleteProtection) { + this.deleteProtection = deleteProtection; + return this; + } + + /** + * Get the description property: Property description. + * + * @return the description value. + */ + public String description() { + return this.description; + } + + /** + * Set the description property: Property description. + * + * @param description the description value to set. + * @return the AwsNetworkFirewallProperties object itself. + */ + public AwsNetworkFirewallProperties withDescription(String description) { + this.description = description; + return this; + } + + /** + * Get the endpointIds property: Property endpointIds. + * + * @return the endpointIds value. + */ + public List endpointIds() { + return this.endpointIds; + } + + /** + * Set the endpointIds property: Property endpointIds. + * + * @param endpointIds the endpointIds value to set. + * @return the AwsNetworkFirewallProperties object itself. + */ + public AwsNetworkFirewallProperties withEndpointIds(List endpointIds) { + this.endpointIds = endpointIds; + return this; + } + + /** + * Get the firewallArn property: A resource ARN. + * + * @return the firewallArn value. + */ + public String firewallArn() { + return this.firewallArn; + } + + /** + * Set the firewallArn property: A resource ARN. + * + * @param firewallArn the firewallArn value to set. + * @return the AwsNetworkFirewallProperties object itself. + */ + public AwsNetworkFirewallProperties withFirewallArn(String firewallArn) { + this.firewallArn = firewallArn; + return this; + } + + /** + * Get the firewallId property: Property firewallId. + * + * @return the firewallId value. + */ + public String firewallId() { + return this.firewallId; + } + + /** + * Set the firewallId property: Property firewallId. + * + * @param firewallId the firewallId value to set. + * @return the AwsNetworkFirewallProperties object itself. + */ + public AwsNetworkFirewallProperties withFirewallId(String firewallId) { + this.firewallId = firewallId; + return this; + } + + /** + * Get the firewallName property: Property firewallName. + * + * @return the firewallName value. + */ + public String firewallName() { + return this.firewallName; + } + + /** + * Set the firewallName property: Property firewallName. + * + * @param firewallName the firewallName value to set. + * @return the AwsNetworkFirewallProperties object itself. + */ + public AwsNetworkFirewallProperties withFirewallName(String firewallName) { + this.firewallName = firewallName; + return this; + } + + /** + * Get the firewallPolicyArn property: A resource ARN. + * + * @return the firewallPolicyArn value. + */ + public String firewallPolicyArn() { + return this.firewallPolicyArn; + } + + /** + * Set the firewallPolicyArn property: A resource ARN. + * + * @param firewallPolicyArn the firewallPolicyArn value to set. + * @return the AwsNetworkFirewallProperties object itself. + */ + public AwsNetworkFirewallProperties withFirewallPolicyArn(String firewallPolicyArn) { + this.firewallPolicyArn = firewallPolicyArn; + return this; + } + + /** + * Get the firewallPolicyChangeProtection property: Property firewallPolicyChangeProtection. + * + * @return the firewallPolicyChangeProtection value. + */ + public Boolean firewallPolicyChangeProtection() { + return this.firewallPolicyChangeProtection; + } + + /** + * Set the firewallPolicyChangeProtection property: Property firewallPolicyChangeProtection. + * + * @param firewallPolicyChangeProtection the firewallPolicyChangeProtection value to set. + * @return the AwsNetworkFirewallProperties object itself. + */ + public AwsNetworkFirewallProperties withFirewallPolicyChangeProtection(Boolean firewallPolicyChangeProtection) { + this.firewallPolicyChangeProtection = firewallPolicyChangeProtection; + return this; + } + + /** + * Get the subnetChangeProtection property: Property subnetChangeProtection. + * + * @return the subnetChangeProtection value. + */ + public Boolean subnetChangeProtection() { + return this.subnetChangeProtection; + } + + /** + * Set the subnetChangeProtection property: Property subnetChangeProtection. + * + * @param subnetChangeProtection the subnetChangeProtection value to set. + * @return the AwsNetworkFirewallProperties object itself. + */ + public AwsNetworkFirewallProperties withSubnetChangeProtection(Boolean subnetChangeProtection) { + this.subnetChangeProtection = subnetChangeProtection; + return this; + } + + /** + * Get the subnetMappings property: Property subnetMappings. + * + * @return the subnetMappings value. + */ + public List subnetMappings() { + return this.subnetMappings; + } + + /** + * Set the subnetMappings property: Property subnetMappings. + * + * @param subnetMappings the subnetMappings value to set. + * @return the AwsNetworkFirewallProperties object itself. + */ + public AwsNetworkFirewallProperties withSubnetMappings(List subnetMappings) { + this.subnetMappings = subnetMappings; + return this; + } + + /** + * Get the tags property: Property tags. + * + * @return the tags value. + */ + public List tags() { + return this.tags; + } + + /** + * Set the tags property: Property tags. + * + * @param tags the tags value to set. + * @return the AwsNetworkFirewallProperties object itself. + */ + public AwsNetworkFirewallProperties withTags(List tags) { + this.tags = tags; + return this; + } + + /** + * Get the vpcId property: Property vpcId. + * + * @return the vpcId value. + */ + public String vpcId() { + return this.vpcId; + } + + /** + * Set the vpcId property: Property vpcId. + * + * @param vpcId the vpcId value to set. + * @return the AwsNetworkFirewallProperties object itself. + */ + public AwsNetworkFirewallProperties withVpcId(String vpcId) { + this.vpcId = vpcId; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (subnetMappings() != null) { + subnetMappings().forEach(e -> e.validate()); + } + if (tags() != null) { + tags().forEach(e -> e.validate()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeBooleanField("deleteProtection", this.deleteProtection); + jsonWriter.writeStringField("description", this.description); + jsonWriter.writeArrayField("endpointIds", this.endpointIds, (writer, element) -> writer.writeString(element)); + jsonWriter.writeStringField("firewallArn", this.firewallArn); + jsonWriter.writeStringField("firewallId", this.firewallId); + jsonWriter.writeStringField("firewallName", this.firewallName); + jsonWriter.writeStringField("firewallPolicyArn", this.firewallPolicyArn); + jsonWriter.writeBooleanField("firewallPolicyChangeProtection", this.firewallPolicyChangeProtection); + jsonWriter.writeBooleanField("subnetChangeProtection", this.subnetChangeProtection); + jsonWriter.writeArrayField("subnetMappings", this.subnetMappings, + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("tags", this.tags, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("vpcId", this.vpcId); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AwsNetworkFirewallProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AwsNetworkFirewallProperties if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the AwsNetworkFirewallProperties. + */ + public static AwsNetworkFirewallProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AwsNetworkFirewallProperties deserializedAwsNetworkFirewallProperties = new AwsNetworkFirewallProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("deleteProtection".equals(fieldName)) { + deserializedAwsNetworkFirewallProperties.deleteProtection + = reader.getNullable(JsonReader::getBoolean); + } else if ("description".equals(fieldName)) { + deserializedAwsNetworkFirewallProperties.description = reader.getString(); + } else if ("endpointIds".equals(fieldName)) { + List endpointIds = reader.readArray(reader1 -> reader1.getString()); + deserializedAwsNetworkFirewallProperties.endpointIds = endpointIds; + } else if ("firewallArn".equals(fieldName)) { + deserializedAwsNetworkFirewallProperties.firewallArn = reader.getString(); + } else if ("firewallId".equals(fieldName)) { + deserializedAwsNetworkFirewallProperties.firewallId = reader.getString(); + } else if ("firewallName".equals(fieldName)) { + deserializedAwsNetworkFirewallProperties.firewallName = reader.getString(); + } else if ("firewallPolicyArn".equals(fieldName)) { + deserializedAwsNetworkFirewallProperties.firewallPolicyArn = reader.getString(); + } else if ("firewallPolicyChangeProtection".equals(fieldName)) { + deserializedAwsNetworkFirewallProperties.firewallPolicyChangeProtection + = reader.getNullable(JsonReader::getBoolean); + } else if ("subnetChangeProtection".equals(fieldName)) { + deserializedAwsNetworkFirewallProperties.subnetChangeProtection + = reader.getNullable(JsonReader::getBoolean); + } else if ("subnetMappings".equals(fieldName)) { + List subnetMappings + = reader.readArray(reader1 -> SubnetMappingAutoGenerated.fromJson(reader1)); + deserializedAwsNetworkFirewallProperties.subnetMappings = subnetMappings; + } else if ("tags".equals(fieldName)) { + List tags = reader.readArray(reader1 -> TagAutoGenerated41.fromJson(reader1)); + deserializedAwsNetworkFirewallProperties.tags = tags; + } else if ("vpcId".equals(fieldName)) { + deserializedAwsNetworkFirewallProperties.vpcId = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedAwsNetworkFirewallProperties; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/AwsNetworkFirewallRuleGroupProperties.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/AwsNetworkFirewallRuleGroupProperties.java new file mode 100644 index 000000000000..a9143e82b39d --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/AwsNetworkFirewallRuleGroupProperties.java @@ -0,0 +1,299 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Definition of awsNetworkFirewallRuleGroup. + */ +@Fluent +public final class AwsNetworkFirewallRuleGroupProperties + implements JsonSerializable { + /* + * Property capacity + */ + private Integer capacity; + + /* + * Property description + */ + private String description; + + /* + * Property ruleGroup + */ + private RuleGroup ruleGroup; + + /* + * A resource ARN. + */ + private String ruleGroupArn; + + /* + * Property ruleGroupId + */ + private String ruleGroupId; + + /* + * Property ruleGroupName + */ + private String ruleGroupName; + + /* + * Property tags + */ + private List tags; + + /* + * Property type + */ + private Type type; + + /** + * Creates an instance of AwsNetworkFirewallRuleGroupProperties class. + */ + public AwsNetworkFirewallRuleGroupProperties() { + } + + /** + * Get the capacity property: Property capacity. + * + * @return the capacity value. + */ + public Integer capacity() { + return this.capacity; + } + + /** + * Set the capacity property: Property capacity. + * + * @param capacity the capacity value to set. + * @return the AwsNetworkFirewallRuleGroupProperties object itself. + */ + public AwsNetworkFirewallRuleGroupProperties withCapacity(Integer capacity) { + this.capacity = capacity; + return this; + } + + /** + * Get the description property: Property description. + * + * @return the description value. + */ + public String description() { + return this.description; + } + + /** + * Set the description property: Property description. + * + * @param description the description value to set. + * @return the AwsNetworkFirewallRuleGroupProperties object itself. + */ + public AwsNetworkFirewallRuleGroupProperties withDescription(String description) { + this.description = description; + return this; + } + + /** + * Get the ruleGroup property: Property ruleGroup. + * + * @return the ruleGroup value. + */ + public RuleGroup ruleGroup() { + return this.ruleGroup; + } + + /** + * Set the ruleGroup property: Property ruleGroup. + * + * @param ruleGroup the ruleGroup value to set. + * @return the AwsNetworkFirewallRuleGroupProperties object itself. + */ + public AwsNetworkFirewallRuleGroupProperties withRuleGroup(RuleGroup ruleGroup) { + this.ruleGroup = ruleGroup; + return this; + } + + /** + * Get the ruleGroupArn property: A resource ARN. + * + * @return the ruleGroupArn value. + */ + public String ruleGroupArn() { + return this.ruleGroupArn; + } + + /** + * Set the ruleGroupArn property: A resource ARN. + * + * @param ruleGroupArn the ruleGroupArn value to set. + * @return the AwsNetworkFirewallRuleGroupProperties object itself. + */ + public AwsNetworkFirewallRuleGroupProperties withRuleGroupArn(String ruleGroupArn) { + this.ruleGroupArn = ruleGroupArn; + return this; + } + + /** + * Get the ruleGroupId property: Property ruleGroupId. + * + * @return the ruleGroupId value. + */ + public String ruleGroupId() { + return this.ruleGroupId; + } + + /** + * Set the ruleGroupId property: Property ruleGroupId. + * + * @param ruleGroupId the ruleGroupId value to set. + * @return the AwsNetworkFirewallRuleGroupProperties object itself. + */ + public AwsNetworkFirewallRuleGroupProperties withRuleGroupId(String ruleGroupId) { + this.ruleGroupId = ruleGroupId; + return this; + } + + /** + * Get the ruleGroupName property: Property ruleGroupName. + * + * @return the ruleGroupName value. + */ + public String ruleGroupName() { + return this.ruleGroupName; + } + + /** + * Set the ruleGroupName property: Property ruleGroupName. + * + * @param ruleGroupName the ruleGroupName value to set. + * @return the AwsNetworkFirewallRuleGroupProperties object itself. + */ + public AwsNetworkFirewallRuleGroupProperties withRuleGroupName(String ruleGroupName) { + this.ruleGroupName = ruleGroupName; + return this; + } + + /** + * Get the tags property: Property tags. + * + * @return the tags value. + */ + public List tags() { + return this.tags; + } + + /** + * Set the tags property: Property tags. + * + * @param tags the tags value to set. + * @return the AwsNetworkFirewallRuleGroupProperties object itself. + */ + public AwsNetworkFirewallRuleGroupProperties withTags(List tags) { + this.tags = tags; + return this; + } + + /** + * Get the type property: Property type. + * + * @return the type value. + */ + public Type type() { + return this.type; + } + + /** + * Set the type property: Property type. + * + * @param type the type value to set. + * @return the AwsNetworkFirewallRuleGroupProperties object itself. + */ + public AwsNetworkFirewallRuleGroupProperties withType(Type type) { + this.type = type; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (ruleGroup() != null) { + ruleGroup().validate(); + } + if (tags() != null) { + tags().forEach(e -> e.validate()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeNumberField("capacity", this.capacity); + jsonWriter.writeStringField("description", this.description); + jsonWriter.writeJsonField("ruleGroup", this.ruleGroup); + jsonWriter.writeStringField("ruleGroupArn", this.ruleGroupArn); + jsonWriter.writeStringField("ruleGroupId", this.ruleGroupId); + jsonWriter.writeStringField("ruleGroupName", this.ruleGroupName); + jsonWriter.writeArrayField("tags", this.tags, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("type", this.type == null ? null : this.type.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AwsNetworkFirewallRuleGroupProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AwsNetworkFirewallRuleGroupProperties if the JsonReader was pointing to an instance of it, + * or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the AwsNetworkFirewallRuleGroupProperties. + */ + public static AwsNetworkFirewallRuleGroupProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AwsNetworkFirewallRuleGroupProperties deserializedAwsNetworkFirewallRuleGroupProperties + = new AwsNetworkFirewallRuleGroupProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("capacity".equals(fieldName)) { + deserializedAwsNetworkFirewallRuleGroupProperties.capacity = reader.getNullable(JsonReader::getInt); + } else if ("description".equals(fieldName)) { + deserializedAwsNetworkFirewallRuleGroupProperties.description = reader.getString(); + } else if ("ruleGroup".equals(fieldName)) { + deserializedAwsNetworkFirewallRuleGroupProperties.ruleGroup = RuleGroup.fromJson(reader); + } else if ("ruleGroupArn".equals(fieldName)) { + deserializedAwsNetworkFirewallRuleGroupProperties.ruleGroupArn = reader.getString(); + } else if ("ruleGroupId".equals(fieldName)) { + deserializedAwsNetworkFirewallRuleGroupProperties.ruleGroupId = reader.getString(); + } else if ("ruleGroupName".equals(fieldName)) { + deserializedAwsNetworkFirewallRuleGroupProperties.ruleGroupName = reader.getString(); + } else if ("tags".equals(fieldName)) { + List tags = reader.readArray(reader1 -> TagAutoGenerated43.fromJson(reader1)); + deserializedAwsNetworkFirewallRuleGroupProperties.tags = tags; + } else if ("type".equals(fieldName)) { + deserializedAwsNetworkFirewallRuleGroupProperties.type = Type.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedAwsNetworkFirewallRuleGroupProperties; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/AwsOpenSearchDomainStatusProperties.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/AwsOpenSearchDomainStatusProperties.java new file mode 100644 index 000000000000..2b610673d3a2 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/AwsOpenSearchDomainStatusProperties.java @@ -0,0 +1,1091 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; +import java.util.Map; + +/** + * Definition of awsOpenSearchDomainStatus. + */ +@Fluent +public final class AwsOpenSearchDomainStatusProperties + implements JsonSerializable { + /* + *

The Amazon Resource Name (ARN) of the domain. For more information, see IAM identifiers in the + * AWS Identity and Access Management User Guide.

+ */ + private String arn; + + /* + *

Identity and Access Management (IAM) policy document specifying the access policies for the domain.

+ */ + private String accessPolicies; + + /* + *

Key-value pairs that specify advanced configuration options.

+ */ + private Map advancedOptions; + + /* + *

Settings for fine-grained access control.

+ */ + private AdvancedSecurityOptions advancedSecurityOptions; + + /* + *

Auto-Tune settings for the domain.

+ */ + private AutoTuneOptionsOutput autoTuneOptions; + + /* + *

Information about a configuration change happening on the domain.

+ */ + private ChangeProgressDetails changeProgressDetails; + + /* + *

Container for the cluster configuration of the domain.

+ */ + private ClusterConfig clusterConfig; + + /* + *

Key-value pairs to configure Amazon Cognito authentication for OpenSearch Dashboards.

+ */ + private CognitoOptions cognitoOptions; + + /* + *

Creation status of an OpenSearch Service domain. True if domain creation is complete. False if domain creation + * is still in progress.

+ */ + private Boolean created; + + /* + *

Deletion status of an OpenSearch Service domain. True if domain deletion is complete. False if domain deletion + * is still in progress. Once deletion is complete, the status of the domain is no longer returned.

+ */ + private Boolean deleted; + + /* + *

Additional options for the domain endpoint, such as whether to require HTTPS for all traffic.

+ */ + private DomainEndpointOptions domainEndpointOptions; + + /* + *

Unique identifier for the domain.

+ */ + private String domainId; + + /* + *

Name of the domain. Domain names are unique across all domains owned by the same account within an Amazon Web + * Services Region.

+ */ + private String domainName; + + /* + *

The status of any changes that are currently in progress for the domain.

+ */ + private DomainProcessingStatusTypeEnumValue domainProcessingStatus; + + /* + *

Container for EBS-based storage settings for the domain.

+ */ + private EbsOptions ebsOptions; + + /* + *

Encryption at rest settings for the domain.

+ */ + private EncryptionAtRestOptions encryptionAtRestOptions; + + /* + *

Domain-specific endpoint used to submit index, search, and data upload requests to the domain.

+ */ + private String endpoint; + + /* + *

If IPAddressType to set to dualstack, a version 2 domain endpoint is provisioned. + * This endpoint functions like a normal endpoint, except that it works with both IPv4 and IPv6 IP addresses. Normal + * endpoints work only with IPv4 IP addresses.

+ */ + private String endpointV2; + + /* + *

The key-value pair that exists if the OpenSearch Service domain uses VPC endpoints. Example key, + * value: 'vpc','vpc-endpoint-h2dsd34efgyghrtguk5gt6j2foh4.us-east-1.es.amazonaws.com'.

+ */ + private Map endpoints; + + /* + *

Version of OpenSearch or Elasticsearch that the domain is running, in the format + * Elasticsearch_X.Y or OpenSearch_X.Y.

+ */ + private String engineVersion; + + /* + *

The type of IP addresses supported by the endpoint for the domain.

+ */ + private IpAddressTypeEnumValue ipAddressType; + + /* + *

Log publishing options for the domain.

+ */ + private Map logPublishingOptions; + + /* + *

Information about the domain properties that are currently being modified.

+ */ + private List modifyingProperties; + + /* + *

Whether node-to-node encryption is enabled or disabled.

+ */ + private NodeToNodeEncryptionOptions nodeToNodeEncryptionOptions; + + /* + *

Options that specify a custom 10-hour window during which OpenSearch Service can perform configuration changes + * on the domain.

+ */ + private OffPeakWindowOptions offPeakWindowOptions; + + /* + *

The status of the domain configuration. True if OpenSearch Service is processing configuration changes. False + * if the configuration is active.

+ */ + private Boolean processing; + + /* + *

The current status of the domain's service software.

+ */ + private ServiceSoftwareOptions serviceSoftwareOptions; + + /* + *

DEPRECATED. Container for parameters required to configure automated snapshots of domain indexes.

+ */ + private SnapshotOptions snapshotOptions; + + /* + *

Service software update options for the domain.

+ */ + private SoftwareUpdateOptions softwareUpdateOptions; + + /* + *

The status of a domain version upgrade to a new version of OpenSearch or Elasticsearch. True if OpenSearch + * Service is in the process of a version upgrade. False if the configuration is active.

+ */ + private Boolean upgradeProcessing; + + /* + *

The VPC configuration for the domain.

+ */ + private VpcDerivedInfo vpcOptions; + + /** + * Creates an instance of AwsOpenSearchDomainStatusProperties class. + */ + public AwsOpenSearchDomainStatusProperties() { + } + + /** + * Get the arn property: <p>The Amazon Resource Name (ARN) of the domain. For more information, see <a + * href='https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_identifiers.html'>IAM identifiers </a> + * in the <i>AWS Identity and Access Management User Guide</i>.</p>. + * + * @return the arn value. + */ + public String arn() { + return this.arn; + } + + /** + * Set the arn property: <p>The Amazon Resource Name (ARN) of the domain. For more information, see <a + * href='https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_identifiers.html'>IAM identifiers </a> + * in the <i>AWS Identity and Access Management User Guide</i>.</p>. + * + * @param arn the arn value to set. + * @return the AwsOpenSearchDomainStatusProperties object itself. + */ + public AwsOpenSearchDomainStatusProperties withArn(String arn) { + this.arn = arn; + return this; + } + + /** + * Get the accessPolicies property: <p>Identity and Access Management (IAM) policy document specifying the + * access policies for the domain.</p>. + * + * @return the accessPolicies value. + */ + public String accessPolicies() { + return this.accessPolicies; + } + + /** + * Set the accessPolicies property: <p>Identity and Access Management (IAM) policy document specifying the + * access policies for the domain.</p>. + * + * @param accessPolicies the accessPolicies value to set. + * @return the AwsOpenSearchDomainStatusProperties object itself. + */ + public AwsOpenSearchDomainStatusProperties withAccessPolicies(String accessPolicies) { + this.accessPolicies = accessPolicies; + return this; + } + + /** + * Get the advancedOptions property: <p>Key-value pairs that specify advanced configuration + * options.</p>. + * + * @return the advancedOptions value. + */ + public Map advancedOptions() { + return this.advancedOptions; + } + + /** + * Set the advancedOptions property: <p>Key-value pairs that specify advanced configuration + * options.</p>. + * + * @param advancedOptions the advancedOptions value to set. + * @return the AwsOpenSearchDomainStatusProperties object itself. + */ + public AwsOpenSearchDomainStatusProperties withAdvancedOptions(Map advancedOptions) { + this.advancedOptions = advancedOptions; + return this; + } + + /** + * Get the advancedSecurityOptions property: <p>Settings for fine-grained access control.</p>. + * + * @return the advancedSecurityOptions value. + */ + public AdvancedSecurityOptions advancedSecurityOptions() { + return this.advancedSecurityOptions; + } + + /** + * Set the advancedSecurityOptions property: <p>Settings for fine-grained access control.</p>. + * + * @param advancedSecurityOptions the advancedSecurityOptions value to set. + * @return the AwsOpenSearchDomainStatusProperties object itself. + */ + public AwsOpenSearchDomainStatusProperties + withAdvancedSecurityOptions(AdvancedSecurityOptions advancedSecurityOptions) { + this.advancedSecurityOptions = advancedSecurityOptions; + return this; + } + + /** + * Get the autoTuneOptions property: <p>Auto-Tune settings for the domain.</p>. + * + * @return the autoTuneOptions value. + */ + public AutoTuneOptionsOutput autoTuneOptions() { + return this.autoTuneOptions; + } + + /** + * Set the autoTuneOptions property: <p>Auto-Tune settings for the domain.</p>. + * + * @param autoTuneOptions the autoTuneOptions value to set. + * @return the AwsOpenSearchDomainStatusProperties object itself. + */ + public AwsOpenSearchDomainStatusProperties withAutoTuneOptions(AutoTuneOptionsOutput autoTuneOptions) { + this.autoTuneOptions = autoTuneOptions; + return this; + } + + /** + * Get the changeProgressDetails property: <p>Information about a configuration change happening on the + * domain.</p>. + * + * @return the changeProgressDetails value. + */ + public ChangeProgressDetails changeProgressDetails() { + return this.changeProgressDetails; + } + + /** + * Set the changeProgressDetails property: <p>Information about a configuration change happening on the + * domain.</p>. + * + * @param changeProgressDetails the changeProgressDetails value to set. + * @return the AwsOpenSearchDomainStatusProperties object itself. + */ + public AwsOpenSearchDomainStatusProperties withChangeProgressDetails(ChangeProgressDetails changeProgressDetails) { + this.changeProgressDetails = changeProgressDetails; + return this; + } + + /** + * Get the clusterConfig property: <p>Container for the cluster configuration of the domain.</p>. + * + * @return the clusterConfig value. + */ + public ClusterConfig clusterConfig() { + return this.clusterConfig; + } + + /** + * Set the clusterConfig property: <p>Container for the cluster configuration of the domain.</p>. + * + * @param clusterConfig the clusterConfig value to set. + * @return the AwsOpenSearchDomainStatusProperties object itself. + */ + public AwsOpenSearchDomainStatusProperties withClusterConfig(ClusterConfig clusterConfig) { + this.clusterConfig = clusterConfig; + return this; + } + + /** + * Get the cognitoOptions property: <p>Key-value pairs to configure Amazon Cognito authentication for + * OpenSearch Dashboards.</p>. + * + * @return the cognitoOptions value. + */ + public CognitoOptions cognitoOptions() { + return this.cognitoOptions; + } + + /** + * Set the cognitoOptions property: <p>Key-value pairs to configure Amazon Cognito authentication for + * OpenSearch Dashboards.</p>. + * + * @param cognitoOptions the cognitoOptions value to set. + * @return the AwsOpenSearchDomainStatusProperties object itself. + */ + public AwsOpenSearchDomainStatusProperties withCognitoOptions(CognitoOptions cognitoOptions) { + this.cognitoOptions = cognitoOptions; + return this; + } + + /** + * Get the created property: <p>Creation status of an OpenSearch Service domain. True if domain creation is + * complete. False if domain creation is still in progress.</p>. + * + * @return the created value. + */ + public Boolean created() { + return this.created; + } + + /** + * Set the created property: <p>Creation status of an OpenSearch Service domain. True if domain creation is + * complete. False if domain creation is still in progress.</p>. + * + * @param created the created value to set. + * @return the AwsOpenSearchDomainStatusProperties object itself. + */ + public AwsOpenSearchDomainStatusProperties withCreated(Boolean created) { + this.created = created; + return this; + } + + /** + * Get the deleted property: <p>Deletion status of an OpenSearch Service domain. True if domain deletion is + * complete. False if domain deletion is still in progress. Once deletion is complete, the status of the domain is + * no longer returned.</p>. + * + * @return the deleted value. + */ + public Boolean deleted() { + return this.deleted; + } + + /** + * Set the deleted property: <p>Deletion status of an OpenSearch Service domain. True if domain deletion is + * complete. False if domain deletion is still in progress. Once deletion is complete, the status of the domain is + * no longer returned.</p>. + * + * @param deleted the deleted value to set. + * @return the AwsOpenSearchDomainStatusProperties object itself. + */ + public AwsOpenSearchDomainStatusProperties withDeleted(Boolean deleted) { + this.deleted = deleted; + return this; + } + + /** + * Get the domainEndpointOptions property: <p>Additional options for the domain endpoint, such as whether to + * require HTTPS for all traffic.</p>. + * + * @return the domainEndpointOptions value. + */ + public DomainEndpointOptions domainEndpointOptions() { + return this.domainEndpointOptions; + } + + /** + * Set the domainEndpointOptions property: <p>Additional options for the domain endpoint, such as whether to + * require HTTPS for all traffic.</p>. + * + * @param domainEndpointOptions the domainEndpointOptions value to set. + * @return the AwsOpenSearchDomainStatusProperties object itself. + */ + public AwsOpenSearchDomainStatusProperties withDomainEndpointOptions(DomainEndpointOptions domainEndpointOptions) { + this.domainEndpointOptions = domainEndpointOptions; + return this; + } + + /** + * Get the domainId property: <p>Unique identifier for the domain.</p>. + * + * @return the domainId value. + */ + public String domainId() { + return this.domainId; + } + + /** + * Set the domainId property: <p>Unique identifier for the domain.</p>. + * + * @param domainId the domainId value to set. + * @return the AwsOpenSearchDomainStatusProperties object itself. + */ + public AwsOpenSearchDomainStatusProperties withDomainId(String domainId) { + this.domainId = domainId; + return this; + } + + /** + * Get the domainName property: <p>Name of the domain. Domain names are unique across all domains owned by the + * same account within an Amazon Web Services Region.</p>. + * + * @return the domainName value. + */ + public String domainName() { + return this.domainName; + } + + /** + * Set the domainName property: <p>Name of the domain. Domain names are unique across all domains owned by the + * same account within an Amazon Web Services Region.</p>. + * + * @param domainName the domainName value to set. + * @return the AwsOpenSearchDomainStatusProperties object itself. + */ + public AwsOpenSearchDomainStatusProperties withDomainName(String domainName) { + this.domainName = domainName; + return this; + } + + /** + * Get the domainProcessingStatus property: <p>The status of any changes that are currently in progress for + * the domain.</p>. + * + * @return the domainProcessingStatus value. + */ + public DomainProcessingStatusTypeEnumValue domainProcessingStatus() { + return this.domainProcessingStatus; + } + + /** + * Set the domainProcessingStatus property: <p>The status of any changes that are currently in progress for + * the domain.</p>. + * + * @param domainProcessingStatus the domainProcessingStatus value to set. + * @return the AwsOpenSearchDomainStatusProperties object itself. + */ + public AwsOpenSearchDomainStatusProperties + withDomainProcessingStatus(DomainProcessingStatusTypeEnumValue domainProcessingStatus) { + this.domainProcessingStatus = domainProcessingStatus; + return this; + } + + /** + * Get the ebsOptions property: <p>Container for EBS-based storage settings for the domain.</p>. + * + * @return the ebsOptions value. + */ + public EbsOptions ebsOptions() { + return this.ebsOptions; + } + + /** + * Set the ebsOptions property: <p>Container for EBS-based storage settings for the domain.</p>. + * + * @param ebsOptions the ebsOptions value to set. + * @return the AwsOpenSearchDomainStatusProperties object itself. + */ + public AwsOpenSearchDomainStatusProperties withEbsOptions(EbsOptions ebsOptions) { + this.ebsOptions = ebsOptions; + return this; + } + + /** + * Get the encryptionAtRestOptions property: <p>Encryption at rest settings for the domain.</p>. + * + * @return the encryptionAtRestOptions value. + */ + public EncryptionAtRestOptions encryptionAtRestOptions() { + return this.encryptionAtRestOptions; + } + + /** + * Set the encryptionAtRestOptions property: <p>Encryption at rest settings for the domain.</p>. + * + * @param encryptionAtRestOptions the encryptionAtRestOptions value to set. + * @return the AwsOpenSearchDomainStatusProperties object itself. + */ + public AwsOpenSearchDomainStatusProperties + withEncryptionAtRestOptions(EncryptionAtRestOptions encryptionAtRestOptions) { + this.encryptionAtRestOptions = encryptionAtRestOptions; + return this; + } + + /** + * Get the endpoint property: <p>Domain-specific endpoint used to submit index, search, and data upload + * requests to the domain.</p>. + * + * @return the endpoint value. + */ + public String endpoint() { + return this.endpoint; + } + + /** + * Set the endpoint property: <p>Domain-specific endpoint used to submit index, search, and data upload + * requests to the domain.</p>. + * + * @param endpoint the endpoint value to set. + * @return the AwsOpenSearchDomainStatusProperties object itself. + */ + public AwsOpenSearchDomainStatusProperties withEndpoint(String endpoint) { + this.endpoint = endpoint; + return this; + } + + /** + * Get the endpointV2 property: <p>If <code>IPAddressType</code> to set to + * <code>dualstack</code>, a version 2 domain endpoint is provisioned. This endpoint functions like a + * normal endpoint, except that it works with both IPv4 and IPv6 IP addresses. Normal endpoints work only with IPv4 + * IP addresses. </p>. + * + * @return the endpointV2 value. + */ + public String endpointV2() { + return this.endpointV2; + } + + /** + * Set the endpointV2 property: <p>If <code>IPAddressType</code> to set to + * <code>dualstack</code>, a version 2 domain endpoint is provisioned. This endpoint functions like a + * normal endpoint, except that it works with both IPv4 and IPv6 IP addresses. Normal endpoints work only with IPv4 + * IP addresses. </p>. + * + * @param endpointV2 the endpointV2 value to set. + * @return the AwsOpenSearchDomainStatusProperties object itself. + */ + public AwsOpenSearchDomainStatusProperties withEndpointV2(String endpointV2) { + this.endpointV2 = endpointV2; + return this; + } + + /** + * Get the endpoints property: <p>The key-value pair that exists if the OpenSearch Service domain uses VPC + * endpoints. Example <code>key, value</code>: + * <code>'vpc','vpc-endpoint-h2dsd34efgyghrtguk5gt6j2foh4.us-east-1.es.amazonaws.com'</code>.</p>. + * + * @return the endpoints value. + */ + public Map endpoints() { + return this.endpoints; + } + + /** + * Set the endpoints property: <p>The key-value pair that exists if the OpenSearch Service domain uses VPC + * endpoints. Example <code>key, value</code>: + * <code>'vpc','vpc-endpoint-h2dsd34efgyghrtguk5gt6j2foh4.us-east-1.es.amazonaws.com'</code>.</p>. + * + * @param endpoints the endpoints value to set. + * @return the AwsOpenSearchDomainStatusProperties object itself. + */ + public AwsOpenSearchDomainStatusProperties withEndpoints(Map endpoints) { + this.endpoints = endpoints; + return this; + } + + /** + * Get the engineVersion property: <p>Version of OpenSearch or Elasticsearch that the domain is running, in + * the format <code>Elasticsearch_X.Y</code> or <code>OpenSearch_X.Y</code>.</p>. + * + * @return the engineVersion value. + */ + public String engineVersion() { + return this.engineVersion; + } + + /** + * Set the engineVersion property: <p>Version of OpenSearch or Elasticsearch that the domain is running, in + * the format <code>Elasticsearch_X.Y</code> or <code>OpenSearch_X.Y</code>.</p>. + * + * @param engineVersion the engineVersion value to set. + * @return the AwsOpenSearchDomainStatusProperties object itself. + */ + public AwsOpenSearchDomainStatusProperties withEngineVersion(String engineVersion) { + this.engineVersion = engineVersion; + return this; + } + + /** + * Get the ipAddressType property: <p>The type of IP addresses supported by the endpoint for the + * domain.</p>. + * + * @return the ipAddressType value. + */ + public IpAddressTypeEnumValue ipAddressType() { + return this.ipAddressType; + } + + /** + * Set the ipAddressType property: <p>The type of IP addresses supported by the endpoint for the + * domain.</p>. + * + * @param ipAddressType the ipAddressType value to set. + * @return the AwsOpenSearchDomainStatusProperties object itself. + */ + public AwsOpenSearchDomainStatusProperties withIpAddressType(IpAddressTypeEnumValue ipAddressType) { + this.ipAddressType = ipAddressType; + return this; + } + + /** + * Get the logPublishingOptions property: <p>Log publishing options for the domain.</p>. + * + * @return the logPublishingOptions value. + */ + public Map logPublishingOptions() { + return this.logPublishingOptions; + } + + /** + * Set the logPublishingOptions property: <p>Log publishing options for the domain.</p>. + * + * @param logPublishingOptions the logPublishingOptions value to set. + * @return the AwsOpenSearchDomainStatusProperties object itself. + */ + public AwsOpenSearchDomainStatusProperties + withLogPublishingOptions(Map logPublishingOptions) { + this.logPublishingOptions = logPublishingOptions; + return this; + } + + /** + * Get the modifyingProperties property: <p>Information about the domain properties that are currently being + * modified.</p>. + * + * @return the modifyingProperties value. + */ + public List modifyingProperties() { + return this.modifyingProperties; + } + + /** + * Set the modifyingProperties property: <p>Information about the domain properties that are currently being + * modified.</p>. + * + * @param modifyingProperties the modifyingProperties value to set. + * @return the AwsOpenSearchDomainStatusProperties object itself. + */ + public AwsOpenSearchDomainStatusProperties withModifyingProperties(List modifyingProperties) { + this.modifyingProperties = modifyingProperties; + return this; + } + + /** + * Get the nodeToNodeEncryptionOptions property: <p>Whether node-to-node encryption is enabled or + * disabled.</p>. + * + * @return the nodeToNodeEncryptionOptions value. + */ + public NodeToNodeEncryptionOptions nodeToNodeEncryptionOptions() { + return this.nodeToNodeEncryptionOptions; + } + + /** + * Set the nodeToNodeEncryptionOptions property: <p>Whether node-to-node encryption is enabled or + * disabled.</p>. + * + * @param nodeToNodeEncryptionOptions the nodeToNodeEncryptionOptions value to set. + * @return the AwsOpenSearchDomainStatusProperties object itself. + */ + public AwsOpenSearchDomainStatusProperties + withNodeToNodeEncryptionOptions(NodeToNodeEncryptionOptions nodeToNodeEncryptionOptions) { + this.nodeToNodeEncryptionOptions = nodeToNodeEncryptionOptions; + return this; + } + + /** + * Get the offPeakWindowOptions property: <p>Options that specify a custom 10-hour window during which + * OpenSearch Service can perform configuration changes on the domain.</p>. + * + * @return the offPeakWindowOptions value. + */ + public OffPeakWindowOptions offPeakWindowOptions() { + return this.offPeakWindowOptions; + } + + /** + * Set the offPeakWindowOptions property: <p>Options that specify a custom 10-hour window during which + * OpenSearch Service can perform configuration changes on the domain.</p>. + * + * @param offPeakWindowOptions the offPeakWindowOptions value to set. + * @return the AwsOpenSearchDomainStatusProperties object itself. + */ + public AwsOpenSearchDomainStatusProperties withOffPeakWindowOptions(OffPeakWindowOptions offPeakWindowOptions) { + this.offPeakWindowOptions = offPeakWindowOptions; + return this; + } + + /** + * Get the processing property: <p>The status of the domain configuration. True if OpenSearch Service is + * processing configuration changes. False if the configuration is active.</p>. + * + * @return the processing value. + */ + public Boolean processing() { + return this.processing; + } + + /** + * Set the processing property: <p>The status of the domain configuration. True if OpenSearch Service is + * processing configuration changes. False if the configuration is active.</p>. + * + * @param processing the processing value to set. + * @return the AwsOpenSearchDomainStatusProperties object itself. + */ + public AwsOpenSearchDomainStatusProperties withProcessing(Boolean processing) { + this.processing = processing; + return this; + } + + /** + * Get the serviceSoftwareOptions property: <p>The current status of the domain's service software.</p>. + * + * @return the serviceSoftwareOptions value. + */ + public ServiceSoftwareOptions serviceSoftwareOptions() { + return this.serviceSoftwareOptions; + } + + /** + * Set the serviceSoftwareOptions property: <p>The current status of the domain's service software.</p>. + * + * @param serviceSoftwareOptions the serviceSoftwareOptions value to set. + * @return the AwsOpenSearchDomainStatusProperties object itself. + */ + public AwsOpenSearchDomainStatusProperties + withServiceSoftwareOptions(ServiceSoftwareOptions serviceSoftwareOptions) { + this.serviceSoftwareOptions = serviceSoftwareOptions; + return this; + } + + /** + * Get the snapshotOptions property: <p>DEPRECATED. Container for parameters required to configure automated + * snapshots of domain indexes.</p>. + * + * @return the snapshotOptions value. + */ + public SnapshotOptions snapshotOptions() { + return this.snapshotOptions; + } + + /** + * Set the snapshotOptions property: <p>DEPRECATED. Container for parameters required to configure automated + * snapshots of domain indexes.</p>. + * + * @param snapshotOptions the snapshotOptions value to set. + * @return the AwsOpenSearchDomainStatusProperties object itself. + */ + public AwsOpenSearchDomainStatusProperties withSnapshotOptions(SnapshotOptions snapshotOptions) { + this.snapshotOptions = snapshotOptions; + return this; + } + + /** + * Get the softwareUpdateOptions property: <p>Service software update options for the domain.</p>. + * + * @return the softwareUpdateOptions value. + */ + public SoftwareUpdateOptions softwareUpdateOptions() { + return this.softwareUpdateOptions; + } + + /** + * Set the softwareUpdateOptions property: <p>Service software update options for the domain.</p>. + * + * @param softwareUpdateOptions the softwareUpdateOptions value to set. + * @return the AwsOpenSearchDomainStatusProperties object itself. + */ + public AwsOpenSearchDomainStatusProperties withSoftwareUpdateOptions(SoftwareUpdateOptions softwareUpdateOptions) { + this.softwareUpdateOptions = softwareUpdateOptions; + return this; + } + + /** + * Get the upgradeProcessing property: <p>The status of a domain version upgrade to a new version of + * OpenSearch or Elasticsearch. True if OpenSearch Service is in the process of a version upgrade. False if the + * configuration is active.</p>. + * + * @return the upgradeProcessing value. + */ + public Boolean upgradeProcessing() { + return this.upgradeProcessing; + } + + /** + * Set the upgradeProcessing property: <p>The status of a domain version upgrade to a new version of + * OpenSearch or Elasticsearch. True if OpenSearch Service is in the process of a version upgrade. False if the + * configuration is active.</p>. + * + * @param upgradeProcessing the upgradeProcessing value to set. + * @return the AwsOpenSearchDomainStatusProperties object itself. + */ + public AwsOpenSearchDomainStatusProperties withUpgradeProcessing(Boolean upgradeProcessing) { + this.upgradeProcessing = upgradeProcessing; + return this; + } + + /** + * Get the vpcOptions property: <p>The VPC configuration for the domain.</p>. + * + * @return the vpcOptions value. + */ + public VpcDerivedInfo vpcOptions() { + return this.vpcOptions; + } + + /** + * Set the vpcOptions property: <p>The VPC configuration for the domain.</p>. + * + * @param vpcOptions the vpcOptions value to set. + * @return the AwsOpenSearchDomainStatusProperties object itself. + */ + public AwsOpenSearchDomainStatusProperties withVpcOptions(VpcDerivedInfo vpcOptions) { + this.vpcOptions = vpcOptions; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (advancedSecurityOptions() != null) { + advancedSecurityOptions().validate(); + } + if (autoTuneOptions() != null) { + autoTuneOptions().validate(); + } + if (changeProgressDetails() != null) { + changeProgressDetails().validate(); + } + if (clusterConfig() != null) { + clusterConfig().validate(); + } + if (cognitoOptions() != null) { + cognitoOptions().validate(); + } + if (domainEndpointOptions() != null) { + domainEndpointOptions().validate(); + } + if (domainProcessingStatus() != null) { + domainProcessingStatus().validate(); + } + if (ebsOptions() != null) { + ebsOptions().validate(); + } + if (encryptionAtRestOptions() != null) { + encryptionAtRestOptions().validate(); + } + if (ipAddressType() != null) { + ipAddressType().validate(); + } + if (logPublishingOptions() != null) { + logPublishingOptions().values().forEach(e -> { + if (e != null) { + e.validate(); + } + }); + } + if (modifyingProperties() != null) { + modifyingProperties().forEach(e -> e.validate()); + } + if (nodeToNodeEncryptionOptions() != null) { + nodeToNodeEncryptionOptions().validate(); + } + if (offPeakWindowOptions() != null) { + offPeakWindowOptions().validate(); + } + if (serviceSoftwareOptions() != null) { + serviceSoftwareOptions().validate(); + } + if (snapshotOptions() != null) { + snapshotOptions().validate(); + } + if (softwareUpdateOptions() != null) { + softwareUpdateOptions().validate(); + } + if (vpcOptions() != null) { + vpcOptions().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("arn", this.arn); + jsonWriter.writeStringField("accessPolicies", this.accessPolicies); + jsonWriter.writeMapField("advancedOptions", this.advancedOptions, + (writer, element) -> writer.writeString(element)); + jsonWriter.writeJsonField("advancedSecurityOptions", this.advancedSecurityOptions); + jsonWriter.writeJsonField("autoTuneOptions", this.autoTuneOptions); + jsonWriter.writeJsonField("changeProgressDetails", this.changeProgressDetails); + jsonWriter.writeJsonField("clusterConfig", this.clusterConfig); + jsonWriter.writeJsonField("cognitoOptions", this.cognitoOptions); + jsonWriter.writeBooleanField("created", this.created); + jsonWriter.writeBooleanField("deleted", this.deleted); + jsonWriter.writeJsonField("domainEndpointOptions", this.domainEndpointOptions); + jsonWriter.writeStringField("domainId", this.domainId); + jsonWriter.writeStringField("domainName", this.domainName); + jsonWriter.writeJsonField("domainProcessingStatus", this.domainProcessingStatus); + jsonWriter.writeJsonField("ebsOptions", this.ebsOptions); + jsonWriter.writeJsonField("encryptionAtRestOptions", this.encryptionAtRestOptions); + jsonWriter.writeStringField("endpoint", this.endpoint); + jsonWriter.writeStringField("endpointV2", this.endpointV2); + jsonWriter.writeMapField("endpoints", this.endpoints, (writer, element) -> writer.writeString(element)); + jsonWriter.writeStringField("engineVersion", this.engineVersion); + jsonWriter.writeJsonField("ipAddressType", this.ipAddressType); + jsonWriter.writeMapField("logPublishingOptions", this.logPublishingOptions, + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("modifyingProperties", this.modifyingProperties, + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeJsonField("nodeToNodeEncryptionOptions", this.nodeToNodeEncryptionOptions); + jsonWriter.writeJsonField("offPeakWindowOptions", this.offPeakWindowOptions); + jsonWriter.writeBooleanField("processing", this.processing); + jsonWriter.writeJsonField("serviceSoftwareOptions", this.serviceSoftwareOptions); + jsonWriter.writeJsonField("snapshotOptions", this.snapshotOptions); + jsonWriter.writeJsonField("softwareUpdateOptions", this.softwareUpdateOptions); + jsonWriter.writeBooleanField("upgradeProcessing", this.upgradeProcessing); + jsonWriter.writeJsonField("vpcOptions", this.vpcOptions); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AwsOpenSearchDomainStatusProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AwsOpenSearchDomainStatusProperties if the JsonReader was pointing to an instance of it, + * or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the AwsOpenSearchDomainStatusProperties. + */ + public static AwsOpenSearchDomainStatusProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AwsOpenSearchDomainStatusProperties deserializedAwsOpenSearchDomainStatusProperties + = new AwsOpenSearchDomainStatusProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("arn".equals(fieldName)) { + deserializedAwsOpenSearchDomainStatusProperties.arn = reader.getString(); + } else if ("accessPolicies".equals(fieldName)) { + deserializedAwsOpenSearchDomainStatusProperties.accessPolicies = reader.getString(); + } else if ("advancedOptions".equals(fieldName)) { + Map advancedOptions = reader.readMap(reader1 -> reader1.getString()); + deserializedAwsOpenSearchDomainStatusProperties.advancedOptions = advancedOptions; + } else if ("advancedSecurityOptions".equals(fieldName)) { + deserializedAwsOpenSearchDomainStatusProperties.advancedSecurityOptions + = AdvancedSecurityOptions.fromJson(reader); + } else if ("autoTuneOptions".equals(fieldName)) { + deserializedAwsOpenSearchDomainStatusProperties.autoTuneOptions + = AutoTuneOptionsOutput.fromJson(reader); + } else if ("changeProgressDetails".equals(fieldName)) { + deserializedAwsOpenSearchDomainStatusProperties.changeProgressDetails + = ChangeProgressDetails.fromJson(reader); + } else if ("clusterConfig".equals(fieldName)) { + deserializedAwsOpenSearchDomainStatusProperties.clusterConfig = ClusterConfig.fromJson(reader); + } else if ("cognitoOptions".equals(fieldName)) { + deserializedAwsOpenSearchDomainStatusProperties.cognitoOptions = CognitoOptions.fromJson(reader); + } else if ("created".equals(fieldName)) { + deserializedAwsOpenSearchDomainStatusProperties.created + = reader.getNullable(JsonReader::getBoolean); + } else if ("deleted".equals(fieldName)) { + deserializedAwsOpenSearchDomainStatusProperties.deleted + = reader.getNullable(JsonReader::getBoolean); + } else if ("domainEndpointOptions".equals(fieldName)) { + deserializedAwsOpenSearchDomainStatusProperties.domainEndpointOptions + = DomainEndpointOptions.fromJson(reader); + } else if ("domainId".equals(fieldName)) { + deserializedAwsOpenSearchDomainStatusProperties.domainId = reader.getString(); + } else if ("domainName".equals(fieldName)) { + deserializedAwsOpenSearchDomainStatusProperties.domainName = reader.getString(); + } else if ("domainProcessingStatus".equals(fieldName)) { + deserializedAwsOpenSearchDomainStatusProperties.domainProcessingStatus + = DomainProcessingStatusTypeEnumValue.fromJson(reader); + } else if ("ebsOptions".equals(fieldName)) { + deserializedAwsOpenSearchDomainStatusProperties.ebsOptions = EbsOptions.fromJson(reader); + } else if ("encryptionAtRestOptions".equals(fieldName)) { + deserializedAwsOpenSearchDomainStatusProperties.encryptionAtRestOptions + = EncryptionAtRestOptions.fromJson(reader); + } else if ("endpoint".equals(fieldName)) { + deserializedAwsOpenSearchDomainStatusProperties.endpoint = reader.getString(); + } else if ("endpointV2".equals(fieldName)) { + deserializedAwsOpenSearchDomainStatusProperties.endpointV2 = reader.getString(); + } else if ("endpoints".equals(fieldName)) { + Map endpoints = reader.readMap(reader1 -> reader1.getString()); + deserializedAwsOpenSearchDomainStatusProperties.endpoints = endpoints; + } else if ("engineVersion".equals(fieldName)) { + deserializedAwsOpenSearchDomainStatusProperties.engineVersion = reader.getString(); + } else if ("ipAddressType".equals(fieldName)) { + deserializedAwsOpenSearchDomainStatusProperties.ipAddressType + = IpAddressTypeEnumValue.fromJson(reader); + } else if ("logPublishingOptions".equals(fieldName)) { + Map logPublishingOptions + = reader.readMap(reader1 -> LogPublishingOption.fromJson(reader1)); + deserializedAwsOpenSearchDomainStatusProperties.logPublishingOptions = logPublishingOptions; + } else if ("modifyingProperties".equals(fieldName)) { + List modifyingProperties + = reader.readArray(reader1 -> ModifyingProperties.fromJson(reader1)); + deserializedAwsOpenSearchDomainStatusProperties.modifyingProperties = modifyingProperties; + } else if ("nodeToNodeEncryptionOptions".equals(fieldName)) { + deserializedAwsOpenSearchDomainStatusProperties.nodeToNodeEncryptionOptions + = NodeToNodeEncryptionOptions.fromJson(reader); + } else if ("offPeakWindowOptions".equals(fieldName)) { + deserializedAwsOpenSearchDomainStatusProperties.offPeakWindowOptions + = OffPeakWindowOptions.fromJson(reader); + } else if ("processing".equals(fieldName)) { + deserializedAwsOpenSearchDomainStatusProperties.processing + = reader.getNullable(JsonReader::getBoolean); + } else if ("serviceSoftwareOptions".equals(fieldName)) { + deserializedAwsOpenSearchDomainStatusProperties.serviceSoftwareOptions + = ServiceSoftwareOptions.fromJson(reader); + } else if ("snapshotOptions".equals(fieldName)) { + deserializedAwsOpenSearchDomainStatusProperties.snapshotOptions = SnapshotOptions.fromJson(reader); + } else if ("softwareUpdateOptions".equals(fieldName)) { + deserializedAwsOpenSearchDomainStatusProperties.softwareUpdateOptions + = SoftwareUpdateOptions.fromJson(reader); + } else if ("upgradeProcessing".equals(fieldName)) { + deserializedAwsOpenSearchDomainStatusProperties.upgradeProcessing + = reader.getNullable(JsonReader::getBoolean); + } else if ("vpcOptions".equals(fieldName)) { + deserializedAwsOpenSearchDomainStatusProperties.vpcOptions = VpcDerivedInfo.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedAwsOpenSearchDomainStatusProperties; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/AwsOrganizationsAccountProperties.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/AwsOrganizationsAccountProperties.java new file mode 100644 index 000000000000..1e911a2b7d17 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/AwsOrganizationsAccountProperties.java @@ -0,0 +1,363 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Definition of awsOrganizationsAccount. + */ +@Fluent +public final class AwsOrganizationsAccountProperties implements JsonSerializable { + /* + * If the account was created successfully, the unique identifier (ID) of the new account. + */ + private String accountId; + + /* + * The friendly name of the member account. + */ + private String accountName; + + /* + * The Amazon Resource Name (ARN) of the account. + */ + private String arn; + + /* + * The email address of the owner to assign to the new member account. + */ + private String email; + + /* + * The method by which the account joined the organization. + */ + private JoinedMethod joinedMethod; + + /* + * The date the account became a part of the organization. + */ + private String joinedTimestamp; + + /* + * List of parent nodes for the member account. Currently only one parent at a time is supported. Default is root. + */ + private List parentIds; + + /* + * The name of an IAM role that AWS Organizations automatically preconfigures in the new member account. Default + * name is OrganizationAccountAccessRole if not specified. + */ + private String roleName; + + /* + * The status of the account in the organization. + */ + private Status status; + + /* + * A list of tags that you want to attach to the newly created account. For each tag in the list, you must specify + * both a tag key and a value. + */ + private List tags; + + /** + * Creates an instance of AwsOrganizationsAccountProperties class. + */ + public AwsOrganizationsAccountProperties() { + } + + /** + * Get the accountId property: If the account was created successfully, the unique identifier (ID) of the new + * account. + * + * @return the accountId value. + */ + public String accountId() { + return this.accountId; + } + + /** + * Set the accountId property: If the account was created successfully, the unique identifier (ID) of the new + * account. + * + * @param accountId the accountId value to set. + * @return the AwsOrganizationsAccountProperties object itself. + */ + public AwsOrganizationsAccountProperties withAccountId(String accountId) { + this.accountId = accountId; + return this; + } + + /** + * Get the accountName property: The friendly name of the member account. + * + * @return the accountName value. + */ + public String accountName() { + return this.accountName; + } + + /** + * Set the accountName property: The friendly name of the member account. + * + * @param accountName the accountName value to set. + * @return the AwsOrganizationsAccountProperties object itself. + */ + public AwsOrganizationsAccountProperties withAccountName(String accountName) { + this.accountName = accountName; + return this; + } + + /** + * Get the arn property: The Amazon Resource Name (ARN) of the account. + * + * @return the arn value. + */ + public String arn() { + return this.arn; + } + + /** + * Set the arn property: The Amazon Resource Name (ARN) of the account. + * + * @param arn the arn value to set. + * @return the AwsOrganizationsAccountProperties object itself. + */ + public AwsOrganizationsAccountProperties withArn(String arn) { + this.arn = arn; + return this; + } + + /** + * Get the email property: The email address of the owner to assign to the new member account. + * + * @return the email value. + */ + public String email() { + return this.email; + } + + /** + * Set the email property: The email address of the owner to assign to the new member account. + * + * @param email the email value to set. + * @return the AwsOrganizationsAccountProperties object itself. + */ + public AwsOrganizationsAccountProperties withEmail(String email) { + this.email = email; + return this; + } + + /** + * Get the joinedMethod property: The method by which the account joined the organization. + * + * @return the joinedMethod value. + */ + public JoinedMethod joinedMethod() { + return this.joinedMethod; + } + + /** + * Set the joinedMethod property: The method by which the account joined the organization. + * + * @param joinedMethod the joinedMethod value to set. + * @return the AwsOrganizationsAccountProperties object itself. + */ + public AwsOrganizationsAccountProperties withJoinedMethod(JoinedMethod joinedMethod) { + this.joinedMethod = joinedMethod; + return this; + } + + /** + * Get the joinedTimestamp property: The date the account became a part of the organization. + * + * @return the joinedTimestamp value. + */ + public String joinedTimestamp() { + return this.joinedTimestamp; + } + + /** + * Set the joinedTimestamp property: The date the account became a part of the organization. + * + * @param joinedTimestamp the joinedTimestamp value to set. + * @return the AwsOrganizationsAccountProperties object itself. + */ + public AwsOrganizationsAccountProperties withJoinedTimestamp(String joinedTimestamp) { + this.joinedTimestamp = joinedTimestamp; + return this; + } + + /** + * Get the parentIds property: List of parent nodes for the member account. Currently only one parent at a time is + * supported. Default is root. + * + * @return the parentIds value. + */ + public List parentIds() { + return this.parentIds; + } + + /** + * Set the parentIds property: List of parent nodes for the member account. Currently only one parent at a time is + * supported. Default is root. + * + * @param parentIds the parentIds value to set. + * @return the AwsOrganizationsAccountProperties object itself. + */ + public AwsOrganizationsAccountProperties withParentIds(List parentIds) { + this.parentIds = parentIds; + return this; + } + + /** + * Get the roleName property: The name of an IAM role that AWS Organizations automatically preconfigures in the new + * member account. Default name is OrganizationAccountAccessRole if not specified. + * + * @return the roleName value. + */ + public String roleName() { + return this.roleName; + } + + /** + * Set the roleName property: The name of an IAM role that AWS Organizations automatically preconfigures in the new + * member account. Default name is OrganizationAccountAccessRole if not specified. + * + * @param roleName the roleName value to set. + * @return the AwsOrganizationsAccountProperties object itself. + */ + public AwsOrganizationsAccountProperties withRoleName(String roleName) { + this.roleName = roleName; + return this; + } + + /** + * Get the status property: The status of the account in the organization. + * + * @return the status value. + */ + public Status status() { + return this.status; + } + + /** + * Set the status property: The status of the account in the organization. + * + * @param status the status value to set. + * @return the AwsOrganizationsAccountProperties object itself. + */ + public AwsOrganizationsAccountProperties withStatus(Status status) { + this.status = status; + return this; + } + + /** + * Get the tags property: A list of tags that you want to attach to the newly created account. For each tag in the + * list, you must specify both a tag key and a value. + * + * @return the tags value. + */ + public List tags() { + return this.tags; + } + + /** + * Set the tags property: A list of tags that you want to attach to the newly created account. For each tag in the + * list, you must specify both a tag key and a value. + * + * @param tags the tags value to set. + * @return the AwsOrganizationsAccountProperties object itself. + */ + public AwsOrganizationsAccountProperties withTags(List tags) { + this.tags = tags; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (tags() != null) { + tags().forEach(e -> e.validate()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("accountId", this.accountId); + jsonWriter.writeStringField("accountName", this.accountName); + jsonWriter.writeStringField("arn", this.arn); + jsonWriter.writeStringField("email", this.email); + jsonWriter.writeStringField("joinedMethod", this.joinedMethod == null ? null : this.joinedMethod.toString()); + jsonWriter.writeStringField("joinedTimestamp", this.joinedTimestamp); + jsonWriter.writeArrayField("parentIds", this.parentIds, (writer, element) -> writer.writeString(element)); + jsonWriter.writeStringField("roleName", this.roleName); + jsonWriter.writeStringField("status", this.status == null ? null : this.status.toString()); + jsonWriter.writeArrayField("tags", this.tags, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AwsOrganizationsAccountProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AwsOrganizationsAccountProperties if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the AwsOrganizationsAccountProperties. + */ + public static AwsOrganizationsAccountProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AwsOrganizationsAccountProperties deserializedAwsOrganizationsAccountProperties + = new AwsOrganizationsAccountProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("accountId".equals(fieldName)) { + deserializedAwsOrganizationsAccountProperties.accountId = reader.getString(); + } else if ("accountName".equals(fieldName)) { + deserializedAwsOrganizationsAccountProperties.accountName = reader.getString(); + } else if ("arn".equals(fieldName)) { + deserializedAwsOrganizationsAccountProperties.arn = reader.getString(); + } else if ("email".equals(fieldName)) { + deserializedAwsOrganizationsAccountProperties.email = reader.getString(); + } else if ("joinedMethod".equals(fieldName)) { + deserializedAwsOrganizationsAccountProperties.joinedMethod + = JoinedMethod.fromString(reader.getString()); + } else if ("joinedTimestamp".equals(fieldName)) { + deserializedAwsOrganizationsAccountProperties.joinedTimestamp = reader.getString(); + } else if ("parentIds".equals(fieldName)) { + List parentIds = reader.readArray(reader1 -> reader1.getString()); + deserializedAwsOrganizationsAccountProperties.parentIds = parentIds; + } else if ("roleName".equals(fieldName)) { + deserializedAwsOrganizationsAccountProperties.roleName = reader.getString(); + } else if ("status".equals(fieldName)) { + deserializedAwsOrganizationsAccountProperties.status = Status.fromString(reader.getString()); + } else if ("tags".equals(fieldName)) { + List tags = reader.readArray(reader1 -> TagAutoGenerated44.fromJson(reader1)); + deserializedAwsOrganizationsAccountProperties.tags = tags; + } else { + reader.skipChildren(); + } + } + + return deserializedAwsOrganizationsAccountProperties; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/AwsOrganizationsOrganizationProperties.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/AwsOrganizationsOrganizationProperties.java new file mode 100644 index 000000000000..25d55a90288a --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/AwsOrganizationsOrganizationProperties.java @@ -0,0 +1,272 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of awsOrganizationsOrganization. + */ +@Fluent +public final class AwsOrganizationsOrganizationProperties + implements JsonSerializable { + /* + * The Amazon Resource Name (ARN) of an organization. + */ + private String arn; + + /* + * Specifies the feature set supported by the new organization. Each feature set supports different levels of + * functionality. + */ + private FeatureSet featureSet; + + /* + * The unique identifier (ID) of an organization. + */ + private String id; + + /* + * The Amazon Resource Name (ARN) of the account that is designated as the management account for the organization. + */ + private String managementAccountArn; + + /* + * The email address that is associated with the AWS account that is designated as the management account for the + * organization. + */ + private String managementAccountEmail; + + /* + * The unique identifier (ID) of the management account of an organization. + */ + private String managementAccountId; + + /* + * The unique identifier (ID) for the root. + */ + private String rootId; + + /** + * Creates an instance of AwsOrganizationsOrganizationProperties class. + */ + public AwsOrganizationsOrganizationProperties() { + } + + /** + * Get the arn property: The Amazon Resource Name (ARN) of an organization. + * + * @return the arn value. + */ + public String arn() { + return this.arn; + } + + /** + * Set the arn property: The Amazon Resource Name (ARN) of an organization. + * + * @param arn the arn value to set. + * @return the AwsOrganizationsOrganizationProperties object itself. + */ + public AwsOrganizationsOrganizationProperties withArn(String arn) { + this.arn = arn; + return this; + } + + /** + * Get the featureSet property: Specifies the feature set supported by the new organization. Each feature set + * supports different levels of functionality. + * + * @return the featureSet value. + */ + public FeatureSet featureSet() { + return this.featureSet; + } + + /** + * Set the featureSet property: Specifies the feature set supported by the new organization. Each feature set + * supports different levels of functionality. + * + * @param featureSet the featureSet value to set. + * @return the AwsOrganizationsOrganizationProperties object itself. + */ + public AwsOrganizationsOrganizationProperties withFeatureSet(FeatureSet featureSet) { + this.featureSet = featureSet; + return this; + } + + /** + * Get the id property: The unique identifier (ID) of an organization. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Set the id property: The unique identifier (ID) of an organization. + * + * @param id the id value to set. + * @return the AwsOrganizationsOrganizationProperties object itself. + */ + public AwsOrganizationsOrganizationProperties withId(String id) { + this.id = id; + return this; + } + + /** + * Get the managementAccountArn property: The Amazon Resource Name (ARN) of the account that is designated as the + * management account for the organization. + * + * @return the managementAccountArn value. + */ + public String managementAccountArn() { + return this.managementAccountArn; + } + + /** + * Set the managementAccountArn property: The Amazon Resource Name (ARN) of the account that is designated as the + * management account for the organization. + * + * @param managementAccountArn the managementAccountArn value to set. + * @return the AwsOrganizationsOrganizationProperties object itself. + */ + public AwsOrganizationsOrganizationProperties withManagementAccountArn(String managementAccountArn) { + this.managementAccountArn = managementAccountArn; + return this; + } + + /** + * Get the managementAccountEmail property: The email address that is associated with the AWS account that is + * designated as the management account for the organization. + * + * @return the managementAccountEmail value. + */ + public String managementAccountEmail() { + return this.managementAccountEmail; + } + + /** + * Set the managementAccountEmail property: The email address that is associated with the AWS account that is + * designated as the management account for the organization. + * + * @param managementAccountEmail the managementAccountEmail value to set. + * @return the AwsOrganizationsOrganizationProperties object itself. + */ + public AwsOrganizationsOrganizationProperties withManagementAccountEmail(String managementAccountEmail) { + this.managementAccountEmail = managementAccountEmail; + return this; + } + + /** + * Get the managementAccountId property: The unique identifier (ID) of the management account of an organization. + * + * @return the managementAccountId value. + */ + public String managementAccountId() { + return this.managementAccountId; + } + + /** + * Set the managementAccountId property: The unique identifier (ID) of the management account of an organization. + * + * @param managementAccountId the managementAccountId value to set. + * @return the AwsOrganizationsOrganizationProperties object itself. + */ + public AwsOrganizationsOrganizationProperties withManagementAccountId(String managementAccountId) { + this.managementAccountId = managementAccountId; + return this; + } + + /** + * Get the rootId property: The unique identifier (ID) for the root. + * + * @return the rootId value. + */ + public String rootId() { + return this.rootId; + } + + /** + * Set the rootId property: The unique identifier (ID) for the root. + * + * @param rootId the rootId value to set. + * @return the AwsOrganizationsOrganizationProperties object itself. + */ + public AwsOrganizationsOrganizationProperties withRootId(String rootId) { + this.rootId = rootId; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("arn", this.arn); + jsonWriter.writeStringField("featureSet", this.featureSet == null ? null : this.featureSet.toString()); + jsonWriter.writeStringField("id", this.id); + jsonWriter.writeStringField("managementAccountArn", this.managementAccountArn); + jsonWriter.writeStringField("managementAccountEmail", this.managementAccountEmail); + jsonWriter.writeStringField("managementAccountId", this.managementAccountId); + jsonWriter.writeStringField("rootId", this.rootId); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AwsOrganizationsOrganizationProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AwsOrganizationsOrganizationProperties if the JsonReader was pointing to an instance of + * it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the AwsOrganizationsOrganizationProperties. + */ + public static AwsOrganizationsOrganizationProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AwsOrganizationsOrganizationProperties deserializedAwsOrganizationsOrganizationProperties + = new AwsOrganizationsOrganizationProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("arn".equals(fieldName)) { + deserializedAwsOrganizationsOrganizationProperties.arn = reader.getString(); + } else if ("featureSet".equals(fieldName)) { + deserializedAwsOrganizationsOrganizationProperties.featureSet + = FeatureSet.fromString(reader.getString()); + } else if ("id".equals(fieldName)) { + deserializedAwsOrganizationsOrganizationProperties.id = reader.getString(); + } else if ("managementAccountArn".equals(fieldName)) { + deserializedAwsOrganizationsOrganizationProperties.managementAccountArn = reader.getString(); + } else if ("managementAccountEmail".equals(fieldName)) { + deserializedAwsOrganizationsOrganizationProperties.managementAccountEmail = reader.getString(); + } else if ("managementAccountId".equals(fieldName)) { + deserializedAwsOrganizationsOrganizationProperties.managementAccountId = reader.getString(); + } else if ("rootId".equals(fieldName)) { + deserializedAwsOrganizationsOrganizationProperties.rootId = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedAwsOrganizationsOrganizationProperties; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/AwsRdsDBClusterProperties.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/AwsRdsDBClusterProperties.java new file mode 100644 index 000000000000..89d6a65698dc --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/AwsRdsDBClusterProperties.java @@ -0,0 +1,1951 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Definition of awsRdsDBCluster. + */ +@Fluent +public final class AwsRdsDBClusterProperties implements JsonSerializable { + /* + * The amount of storage in gibibytes (GiB) to allocate to each DB instance in the Multi-AZ DB cluster. + */ + private Integer allocatedStorage; + + /* + * Provides a list of the AWS Identity and Access Management (IAM) roles that are associated with the DB cluster. + * IAM roles that are associated with a DB cluster grant permission for the DB cluster to access other AWS services + * on your behalf. + */ + private List associatedRoles; + + /* + * A value that indicates whether minor engine upgrades are applied automatically to the DB cluster during the + * maintenance window. By default, minor engine upgrades are applied automatically. + */ + private Boolean autoMinorVersionUpgrade; + + /* + * A list of Availability Zones (AZs) where instances in the DB cluster can be created. For information on AWS + * Regions and Availability Zones, see Choosing the Regions and Availability Zones in the Amazon Aurora User Guide. + */ + private List availabilityZones; + + /* + * The target backtrack window, in seconds. To disable backtracking, set this value to 0. + */ + private Integer backtrackWindow; + + /* + * The number of days for which automated backups are retained. + */ + private Integer backupRetentionPeriod; + + /* + * A value that indicates whether to copy all tags from the DB cluster to snapshots of the DB cluster. The default + * is not to copy them. + */ + private Boolean copyTagsToSnapshot; + + /* + * The Amazon Resource Name (ARN) for the DB cluster. + */ + private String dbClusterArn; + + /* + * The DB cluster identifier. This parameter is stored as a lowercase string. + */ + private String dbClusterIdentifier; + + /* + * The compute and memory capacity of each DB instance in the Multi-AZ DB cluster, for example db.m6g.xlarge. + */ + private String dbClusterInstanceClass; + + /* + * The name of the DB cluster parameter group to associate with this DB cluster. + */ + private String dbClusterParameterGroupName; + + /* + * The AWS Region-unique, immutable identifier for the DB cluster. + */ + private String dbClusterResourceId; + + /* + * The name of the DB parameter group to apply to all instances of the DB cluster. + */ + private String dbInstanceParameterGroupName; + + /* + * A DB subnet group that you want to associate with this DB cluster. + */ + private String dbSubnetGroupName; + + /* + * Reserved for future use. + */ + private String dbSystemId; + + /* + * The name of your database. If you don't provide a name, then Amazon RDS won't create a database in this DB + * cluster. For naming constraints, see Naming Constraints in the Amazon RDS User Guide. + */ + private String databaseName; + + /* + * A value that indicates whether the DB cluster has deletion protection enabled. The database can't be deleted when + * deletion protection is enabled. By default, deletion protection is disabled. + */ + private Boolean deletionProtection; + + /* + * The Active Directory directory ID to create the DB cluster in. + */ + private String domain; + + /* + * Specify the name of the IAM role to be used when making API calls to the Directory Service. + */ + private String domainIamRoleName; + + /* + * The list of log types that need to be enabled for exporting to CloudWatch Logs. The values in the list depend on + * the DB engine being used. For more information, see Publishing Database Logs to Amazon CloudWatch Logs in the + * Amazon Aurora User Guide. + */ + private List enableCloudwatchLogsExports; + + /* + * Specifies whether to enable this DB cluster to forward write operations to the primary cluster of a global + * cluster (Aurora global database). By default, write operations are not allowed on Aurora DB clusters that are + * secondary clusters in an Aurora global database. + */ + private Boolean enableGlobalWriteForwarding; + + /* + * A value that indicates whether to enable the HTTP endpoint for DB cluster. By default, the HTTP endpoint is + * disabled. + */ + private Boolean enableHttpEndpoint; + + /* + * A value that indicates whether to enable mapping of AWS Identity and Access Management (IAM) accounts to database + * accounts. By default, mapping is disabled. + */ + private Boolean enableIamDatabaseAuthentication; + + /* + * Property endpoint + */ + private EndpointAutoGenerated endpoint; + + /* + * The name of the database engine to be used for this DB cluster. Valid Values: aurora (for MySQL 5.6-compatible + * Aurora), aurora-mysql (for MySQL 5.7-compatible Aurora), and aurora-postgresql + */ + private String engine; + + /* + * The DB engine mode of the DB cluster, either provisioned, serverless, parallelquery, global, or multimaster. + */ + private String engineMode; + + /* + * The version number of the database engine to use. + */ + private String engineVersion; + + /* + * If you are configuring an Aurora global database cluster and want your Aurora DB cluster to be a secondary member + * in the global database cluster, specify the global cluster ID of the global database cluster. To define the + * primary database cluster of the global cluster, use the AWS::RDS::GlobalCluster resource.If you aren't + * configuring a global database cluster, don't specify this property. + */ + private String globalClusterIdentifier; + + /* + * The amount of Provisioned IOPS (input/output operations per second) to be initially allocated for each DB + * instance in the Multi-AZ DB cluster. + */ + private Integer iops; + + /* + * The Amazon Resource Name (ARN) of the AWS Key Management Service master key that is used to encrypt the database + * instances in the DB cluster, such as arn:aws:kms:us-east-1:012345678910:key/abcd1234-a123-456a-a12b-a123b4cd56ef. + * If you enable the StorageEncrypted property but don't specify this property, the default master key is used. If + * you specify this property, you must set the StorageEncrypted property to true. + */ + private String kmsKeyId; + + /* + * A value that indicates whether to manage the master user password with AWS Secrets Manager. + */ + private Boolean manageMasterUserPassword; + + /* + * The master password for the DB instance. + */ + private String masterUserPassword; + + /* + * Contains the secret managed by RDS in AWS Secrets Manager for the master user password. + */ + private MasterUserSecret masterUserSecret; + + /* + * The name of the master user for the DB cluster. You must specify MasterUsername, unless you specify + * SnapshotIdentifier. In that case, don't specify MasterUsername. + */ + private String masterUsername; + + /* + * The interval, in seconds, between points when Enhanced Monitoring metrics are collected for the DB cluster. To + * turn off collecting Enhanced Monitoring metrics, specify 0. The default is 0. + */ + private Integer monitoringInterval; + + /* + * The Amazon Resource Name (ARN) for the IAM role that permits RDS to send Enhanced Monitoring metrics to Amazon + * CloudWatch Logs. + */ + private String monitoringRoleArn; + + /* + * The network type of the DB cluster. + */ + private String networkType; + + /* + * A value that indicates whether to turn on Performance Insights for the DB cluster. + */ + private Boolean performanceInsightsEnabled; + + /* + * The Amazon Web Services KMS key identifier for encryption of Performance Insights data. + */ + private String performanceInsightsKmsKeyId; + + /* + * The amount of time, in days, to retain Performance Insights data. + */ + private Integer performanceInsightsRetentionPeriod; + + /* + * The port number on which the instances in the DB cluster accept connections. Default: 3306 if engine is set as + * aurora or 5432 if set to aurora-postgresql. + */ + private Integer port; + + /* + * The daily time range during which automated backups are created if automated backups are enabled using the + * BackupRetentionPeriod parameter. The default is a 30-minute window selected at random from an 8-hour block of + * time for each AWS Region. To see the time blocks available, see Adjusting the Preferred DB Cluster Maintenance + * Window in the Amazon Aurora User Guide. + */ + private String preferredBackupWindow; + + /* + * The weekly time range during which system maintenance can occur, in Universal Coordinated Time (UTC). The default + * is a 30-minute window selected at random from an 8-hour block of time for each AWS Region, occurring on a random + * day of the week. To see the time blocks available, see Adjusting the Preferred DB Cluster Maintenance Window in + * the Amazon Aurora User Guide. + */ + private String preferredMaintenanceWindow; + + /* + * A value that indicates whether the DB cluster is publicly accessible. + */ + private Boolean publiclyAccessible; + + /* + * Property readEndpoint + */ + private ReadEndpoint readEndpoint; + + /* + * The Amazon Resource Name (ARN) of the source DB instance or DB cluster if this DB cluster is created as a Read + * Replica. + */ + private String replicationSourceIdentifier; + + /* + * The date and time to restore the DB cluster to. Value must be a time in Universal Coordinated Time (UTC) format. + * An example: 2015-03-07T23:45:00Z + */ + private String restoreToTime; + + /* + * The type of restore to be performed. You can specify one of the following values:full-copy - The new DB cluster + * is restored as a full copy of the source DB cluster.copy-on-write - The new DB cluster is restored as a clone of + * the source DB cluster. + */ + private String restoreType; + + /* + * The ScalingConfiguration property type specifies the scaling configuration of an Aurora Serverless DB cluster. + * The ScalingConfiguration property type specifies the scaling configuration of an Aurora Serverless DB cluster. + */ + private ScalingConfiguration scalingConfiguration; + + /* + * Contains the scaling configuration of an Aurora Serverless v2 DB cluster. Contains the scaling configuration of + * an Aurora Serverless v2 DB cluster. + */ + private ServerlessV2ScalingConfiguration serverlessV2ScalingConfiguration; + + /* + * The identifier for the DB snapshot or DB cluster snapshot to restore from.You can use either the name or the + * Amazon Resource Name (ARN) to specify a DB cluster snapshot. However, you can use only the ARN to specify a DB + * snapshot.After you restore a DB cluster with a SnapshotIdentifier property, you must specify the same + * SnapshotIdentifier property for any future updates to the DB cluster. When you specify this property for an + * update, the DB cluster is not restored from the snapshot again, and the data in the database is not changed. + * However, if you don't specify the SnapshotIdentifier property, an empty DB cluster is created, and the original + * DB cluster is deleted. If you specify a property that is different from the previous snapshot restore property, + * the DB cluster is restored from the specified SnapshotIdentifier property, and the original DB cluster is + * deleted. + */ + private String snapshotIdentifier; + + /* + * The identifier of the source DB cluster from which to restore. + */ + private String sourceDBClusterIdentifier; + + /* + * The AWS Region which contains the source DB cluster when replicating a DB cluster. For example, us-east-1. + */ + private String sourceRegion; + + /* + * Indicates whether the DB instance is encrypted.If you specify the DBClusterIdentifier, SnapshotIdentifier, or + * SourceDBInstanceIdentifier property, don't specify this property. The value is inherited from the cluster, + * snapshot, or source DB instance. + */ + private Boolean storageEncrypted; + + /* + * Specifies the storage throughput value for the DB cluster. This setting applies only to the gp3 storage type. + */ + private Integer storageThroughput; + + /* + * Specifies the storage type to be associated with the DB cluster. + */ + private String storageType; + + /* + * An array of key-value pairs to apply to this resource. + */ + private List tags; + + /* + * A value that indicates whether to restore the DB cluster to the latest restorable backup time. By default, the DB + * cluster is not restored to the latest restorable backup time. + */ + private Boolean useLatestRestorableTime; + + /* + * A list of EC2 VPC security groups to associate with this DB cluster. + */ + private List vpcSecurityGroupIds; + + /** + * Creates an instance of AwsRdsDBClusterProperties class. + */ + public AwsRdsDBClusterProperties() { + } + + /** + * Get the allocatedStorage property: The amount of storage in gibibytes (GiB) to allocate to each DB instance in + * the Multi-AZ DB cluster. + * + * @return the allocatedStorage value. + */ + public Integer allocatedStorage() { + return this.allocatedStorage; + } + + /** + * Set the allocatedStorage property: The amount of storage in gibibytes (GiB) to allocate to each DB instance in + * the Multi-AZ DB cluster. + * + * @param allocatedStorage the allocatedStorage value to set. + * @return the AwsRdsDBClusterProperties object itself. + */ + public AwsRdsDBClusterProperties withAllocatedStorage(Integer allocatedStorage) { + this.allocatedStorage = allocatedStorage; + return this; + } + + /** + * Get the associatedRoles property: Provides a list of the AWS Identity and Access Management (IAM) roles that are + * associated with the DB cluster. IAM roles that are associated with a DB cluster grant permission for the DB + * cluster to access other AWS services on your behalf. + * + * @return the associatedRoles value. + */ + public List associatedRoles() { + return this.associatedRoles; + } + + /** + * Set the associatedRoles property: Provides a list of the AWS Identity and Access Management (IAM) roles that are + * associated with the DB cluster. IAM roles that are associated with a DB cluster grant permission for the DB + * cluster to access other AWS services on your behalf. + * + * @param associatedRoles the associatedRoles value to set. + * @return the AwsRdsDBClusterProperties object itself. + */ + public AwsRdsDBClusterProperties withAssociatedRoles(List associatedRoles) { + this.associatedRoles = associatedRoles; + return this; + } + + /** + * Get the autoMinorVersionUpgrade property: A value that indicates whether minor engine upgrades are applied + * automatically to the DB cluster during the maintenance window. By default, minor engine upgrades are applied + * automatically. + * + * @return the autoMinorVersionUpgrade value. + */ + public Boolean autoMinorVersionUpgrade() { + return this.autoMinorVersionUpgrade; + } + + /** + * Set the autoMinorVersionUpgrade property: A value that indicates whether minor engine upgrades are applied + * automatically to the DB cluster during the maintenance window. By default, minor engine upgrades are applied + * automatically. + * + * @param autoMinorVersionUpgrade the autoMinorVersionUpgrade value to set. + * @return the AwsRdsDBClusterProperties object itself. + */ + public AwsRdsDBClusterProperties withAutoMinorVersionUpgrade(Boolean autoMinorVersionUpgrade) { + this.autoMinorVersionUpgrade = autoMinorVersionUpgrade; + return this; + } + + /** + * Get the availabilityZones property: A list of Availability Zones (AZs) where instances in the DB cluster can be + * created. For information on AWS Regions and Availability Zones, see Choosing the Regions and Availability Zones + * in the Amazon Aurora User Guide. + * + * @return the availabilityZones value. + */ + public List availabilityZones() { + return this.availabilityZones; + } + + /** + * Set the availabilityZones property: A list of Availability Zones (AZs) where instances in the DB cluster can be + * created. For information on AWS Regions and Availability Zones, see Choosing the Regions and Availability Zones + * in the Amazon Aurora User Guide. + * + * @param availabilityZones the availabilityZones value to set. + * @return the AwsRdsDBClusterProperties object itself. + */ + public AwsRdsDBClusterProperties withAvailabilityZones(List availabilityZones) { + this.availabilityZones = availabilityZones; + return this; + } + + /** + * Get the backtrackWindow property: The target backtrack window, in seconds. To disable backtracking, set this + * value to 0. + * + * @return the backtrackWindow value. + */ + public Integer backtrackWindow() { + return this.backtrackWindow; + } + + /** + * Set the backtrackWindow property: The target backtrack window, in seconds. To disable backtracking, set this + * value to 0. + * + * @param backtrackWindow the backtrackWindow value to set. + * @return the AwsRdsDBClusterProperties object itself. + */ + public AwsRdsDBClusterProperties withBacktrackWindow(Integer backtrackWindow) { + this.backtrackWindow = backtrackWindow; + return this; + } + + /** + * Get the backupRetentionPeriod property: The number of days for which automated backups are retained. + * + * @return the backupRetentionPeriod value. + */ + public Integer backupRetentionPeriod() { + return this.backupRetentionPeriod; + } + + /** + * Set the backupRetentionPeriod property: The number of days for which automated backups are retained. + * + * @param backupRetentionPeriod the backupRetentionPeriod value to set. + * @return the AwsRdsDBClusterProperties object itself. + */ + public AwsRdsDBClusterProperties withBackupRetentionPeriod(Integer backupRetentionPeriod) { + this.backupRetentionPeriod = backupRetentionPeriod; + return this; + } + + /** + * Get the copyTagsToSnapshot property: A value that indicates whether to copy all tags from the DB cluster to + * snapshots of the DB cluster. The default is not to copy them. + * + * @return the copyTagsToSnapshot value. + */ + public Boolean copyTagsToSnapshot() { + return this.copyTagsToSnapshot; + } + + /** + * Set the copyTagsToSnapshot property: A value that indicates whether to copy all tags from the DB cluster to + * snapshots of the DB cluster. The default is not to copy them. + * + * @param copyTagsToSnapshot the copyTagsToSnapshot value to set. + * @return the AwsRdsDBClusterProperties object itself. + */ + public AwsRdsDBClusterProperties withCopyTagsToSnapshot(Boolean copyTagsToSnapshot) { + this.copyTagsToSnapshot = copyTagsToSnapshot; + return this; + } + + /** + * Get the dbClusterArn property: The Amazon Resource Name (ARN) for the DB cluster. + * + * @return the dbClusterArn value. + */ + public String dbClusterArn() { + return this.dbClusterArn; + } + + /** + * Set the dbClusterArn property: The Amazon Resource Name (ARN) for the DB cluster. + * + * @param dbClusterArn the dbClusterArn value to set. + * @return the AwsRdsDBClusterProperties object itself. + */ + public AwsRdsDBClusterProperties withDbClusterArn(String dbClusterArn) { + this.dbClusterArn = dbClusterArn; + return this; + } + + /** + * Get the dbClusterIdentifier property: The DB cluster identifier. This parameter is stored as a lowercase string. + * + * @return the dbClusterIdentifier value. + */ + public String dbClusterIdentifier() { + return this.dbClusterIdentifier; + } + + /** + * Set the dbClusterIdentifier property: The DB cluster identifier. This parameter is stored as a lowercase string. + * + * @param dbClusterIdentifier the dbClusterIdentifier value to set. + * @return the AwsRdsDBClusterProperties object itself. + */ + public AwsRdsDBClusterProperties withDbClusterIdentifier(String dbClusterIdentifier) { + this.dbClusterIdentifier = dbClusterIdentifier; + return this; + } + + /** + * Get the dbClusterInstanceClass property: The compute and memory capacity of each DB instance in the Multi-AZ DB + * cluster, for example db.m6g.xlarge. + * + * @return the dbClusterInstanceClass value. + */ + public String dbClusterInstanceClass() { + return this.dbClusterInstanceClass; + } + + /** + * Set the dbClusterInstanceClass property: The compute and memory capacity of each DB instance in the Multi-AZ DB + * cluster, for example db.m6g.xlarge. + * + * @param dbClusterInstanceClass the dbClusterInstanceClass value to set. + * @return the AwsRdsDBClusterProperties object itself. + */ + public AwsRdsDBClusterProperties withDbClusterInstanceClass(String dbClusterInstanceClass) { + this.dbClusterInstanceClass = dbClusterInstanceClass; + return this; + } + + /** + * Get the dbClusterParameterGroupName property: The name of the DB cluster parameter group to associate with this + * DB cluster. + * + * @return the dbClusterParameterGroupName value. + */ + public String dbClusterParameterGroupName() { + return this.dbClusterParameterGroupName; + } + + /** + * Set the dbClusterParameterGroupName property: The name of the DB cluster parameter group to associate with this + * DB cluster. + * + * @param dbClusterParameterGroupName the dbClusterParameterGroupName value to set. + * @return the AwsRdsDBClusterProperties object itself. + */ + public AwsRdsDBClusterProperties withDbClusterParameterGroupName(String dbClusterParameterGroupName) { + this.dbClusterParameterGroupName = dbClusterParameterGroupName; + return this; + } + + /** + * Get the dbClusterResourceId property: The AWS Region-unique, immutable identifier for the DB cluster. + * + * @return the dbClusterResourceId value. + */ + public String dbClusterResourceId() { + return this.dbClusterResourceId; + } + + /** + * Set the dbClusterResourceId property: The AWS Region-unique, immutable identifier for the DB cluster. + * + * @param dbClusterResourceId the dbClusterResourceId value to set. + * @return the AwsRdsDBClusterProperties object itself. + */ + public AwsRdsDBClusterProperties withDbClusterResourceId(String dbClusterResourceId) { + this.dbClusterResourceId = dbClusterResourceId; + return this; + } + + /** + * Get the dbInstanceParameterGroupName property: The name of the DB parameter group to apply to all instances of + * the DB cluster. + * + * @return the dbInstanceParameterGroupName value. + */ + public String dbInstanceParameterGroupName() { + return this.dbInstanceParameterGroupName; + } + + /** + * Set the dbInstanceParameterGroupName property: The name of the DB parameter group to apply to all instances of + * the DB cluster. + * + * @param dbInstanceParameterGroupName the dbInstanceParameterGroupName value to set. + * @return the AwsRdsDBClusterProperties object itself. + */ + public AwsRdsDBClusterProperties withDbInstanceParameterGroupName(String dbInstanceParameterGroupName) { + this.dbInstanceParameterGroupName = dbInstanceParameterGroupName; + return this; + } + + /** + * Get the dbSubnetGroupName property: A DB subnet group that you want to associate with this DB cluster. + * + * @return the dbSubnetGroupName value. + */ + public String dbSubnetGroupName() { + return this.dbSubnetGroupName; + } + + /** + * Set the dbSubnetGroupName property: A DB subnet group that you want to associate with this DB cluster. + * + * @param dbSubnetGroupName the dbSubnetGroupName value to set. + * @return the AwsRdsDBClusterProperties object itself. + */ + public AwsRdsDBClusterProperties withDbSubnetGroupName(String dbSubnetGroupName) { + this.dbSubnetGroupName = dbSubnetGroupName; + return this; + } + + /** + * Get the dbSystemId property: Reserved for future use. + * + * @return the dbSystemId value. + */ + public String dbSystemId() { + return this.dbSystemId; + } + + /** + * Set the dbSystemId property: Reserved for future use. + * + * @param dbSystemId the dbSystemId value to set. + * @return the AwsRdsDBClusterProperties object itself. + */ + public AwsRdsDBClusterProperties withDbSystemId(String dbSystemId) { + this.dbSystemId = dbSystemId; + return this; + } + + /** + * Get the databaseName property: The name of your database. If you don't provide a name, then Amazon RDS won't + * create a database in this DB cluster. For naming constraints, see Naming Constraints in the Amazon RDS User + * Guide. + * + * @return the databaseName value. + */ + public String databaseName() { + return this.databaseName; + } + + /** + * Set the databaseName property: The name of your database. If you don't provide a name, then Amazon RDS won't + * create a database in this DB cluster. For naming constraints, see Naming Constraints in the Amazon RDS User + * Guide. + * + * @param databaseName the databaseName value to set. + * @return the AwsRdsDBClusterProperties object itself. + */ + public AwsRdsDBClusterProperties withDatabaseName(String databaseName) { + this.databaseName = databaseName; + return this; + } + + /** + * Get the deletionProtection property: A value that indicates whether the DB cluster has deletion protection + * enabled. The database can't be deleted when deletion protection is enabled. By default, deletion protection is + * disabled. + * + * @return the deletionProtection value. + */ + public Boolean deletionProtection() { + return this.deletionProtection; + } + + /** + * Set the deletionProtection property: A value that indicates whether the DB cluster has deletion protection + * enabled. The database can't be deleted when deletion protection is enabled. By default, deletion protection is + * disabled. + * + * @param deletionProtection the deletionProtection value to set. + * @return the AwsRdsDBClusterProperties object itself. + */ + public AwsRdsDBClusterProperties withDeletionProtection(Boolean deletionProtection) { + this.deletionProtection = deletionProtection; + return this; + } + + /** + * Get the domain property: The Active Directory directory ID to create the DB cluster in. + * + * @return the domain value. + */ + public String domain() { + return this.domain; + } + + /** + * Set the domain property: The Active Directory directory ID to create the DB cluster in. + * + * @param domain the domain value to set. + * @return the AwsRdsDBClusterProperties object itself. + */ + public AwsRdsDBClusterProperties withDomain(String domain) { + this.domain = domain; + return this; + } + + /** + * Get the domainIamRoleName property: Specify the name of the IAM role to be used when making API calls to the + * Directory Service. + * + * @return the domainIamRoleName value. + */ + public String domainIamRoleName() { + return this.domainIamRoleName; + } + + /** + * Set the domainIamRoleName property: Specify the name of the IAM role to be used when making API calls to the + * Directory Service. + * + * @param domainIamRoleName the domainIamRoleName value to set. + * @return the AwsRdsDBClusterProperties object itself. + */ + public AwsRdsDBClusterProperties withDomainIamRoleName(String domainIamRoleName) { + this.domainIamRoleName = domainIamRoleName; + return this; + } + + /** + * Get the enableCloudwatchLogsExports property: The list of log types that need to be enabled for exporting to + * CloudWatch Logs. The values in the list depend on the DB engine being used. For more information, see Publishing + * Database Logs to Amazon CloudWatch Logs in the Amazon Aurora User Guide. + * + * @return the enableCloudwatchLogsExports value. + */ + public List enableCloudwatchLogsExports() { + return this.enableCloudwatchLogsExports; + } + + /** + * Set the enableCloudwatchLogsExports property: The list of log types that need to be enabled for exporting to + * CloudWatch Logs. The values in the list depend on the DB engine being used. For more information, see Publishing + * Database Logs to Amazon CloudWatch Logs in the Amazon Aurora User Guide. + * + * @param enableCloudwatchLogsExports the enableCloudwatchLogsExports value to set. + * @return the AwsRdsDBClusterProperties object itself. + */ + public AwsRdsDBClusterProperties withEnableCloudwatchLogsExports(List enableCloudwatchLogsExports) { + this.enableCloudwatchLogsExports = enableCloudwatchLogsExports; + return this; + } + + /** + * Get the enableGlobalWriteForwarding property: Specifies whether to enable this DB cluster to forward write + * operations to the primary cluster of a global cluster (Aurora global database). By default, write operations are + * not allowed on Aurora DB clusters that are secondary clusters in an Aurora global database. + * + * @return the enableGlobalWriteForwarding value. + */ + public Boolean enableGlobalWriteForwarding() { + return this.enableGlobalWriteForwarding; + } + + /** + * Set the enableGlobalWriteForwarding property: Specifies whether to enable this DB cluster to forward write + * operations to the primary cluster of a global cluster (Aurora global database). By default, write operations are + * not allowed on Aurora DB clusters that are secondary clusters in an Aurora global database. + * + * @param enableGlobalWriteForwarding the enableGlobalWriteForwarding value to set. + * @return the AwsRdsDBClusterProperties object itself. + */ + public AwsRdsDBClusterProperties withEnableGlobalWriteForwarding(Boolean enableGlobalWriteForwarding) { + this.enableGlobalWriteForwarding = enableGlobalWriteForwarding; + return this; + } + + /** + * Get the enableHttpEndpoint property: A value that indicates whether to enable the HTTP endpoint for DB cluster. + * By default, the HTTP endpoint is disabled. + * + * @return the enableHttpEndpoint value. + */ + public Boolean enableHttpEndpoint() { + return this.enableHttpEndpoint; + } + + /** + * Set the enableHttpEndpoint property: A value that indicates whether to enable the HTTP endpoint for DB cluster. + * By default, the HTTP endpoint is disabled. + * + * @param enableHttpEndpoint the enableHttpEndpoint value to set. + * @return the AwsRdsDBClusterProperties object itself. + */ + public AwsRdsDBClusterProperties withEnableHttpEndpoint(Boolean enableHttpEndpoint) { + this.enableHttpEndpoint = enableHttpEndpoint; + return this; + } + + /** + * Get the enableIamDatabaseAuthentication property: A value that indicates whether to enable mapping of AWS + * Identity and Access Management (IAM) accounts to database accounts. By default, mapping is disabled. + * + * @return the enableIamDatabaseAuthentication value. + */ + public Boolean enableIamDatabaseAuthentication() { + return this.enableIamDatabaseAuthentication; + } + + /** + * Set the enableIamDatabaseAuthentication property: A value that indicates whether to enable mapping of AWS + * Identity and Access Management (IAM) accounts to database accounts. By default, mapping is disabled. + * + * @param enableIamDatabaseAuthentication the enableIamDatabaseAuthentication value to set. + * @return the AwsRdsDBClusterProperties object itself. + */ + public AwsRdsDBClusterProperties withEnableIamDatabaseAuthentication(Boolean enableIamDatabaseAuthentication) { + this.enableIamDatabaseAuthentication = enableIamDatabaseAuthentication; + return this; + } + + /** + * Get the endpoint property: Property endpoint. + * + * @return the endpoint value. + */ + public EndpointAutoGenerated endpoint() { + return this.endpoint; + } + + /** + * Set the endpoint property: Property endpoint. + * + * @param endpoint the endpoint value to set. + * @return the AwsRdsDBClusterProperties object itself. + */ + public AwsRdsDBClusterProperties withEndpoint(EndpointAutoGenerated endpoint) { + this.endpoint = endpoint; + return this; + } + + /** + * Get the engine property: The name of the database engine to be used for this DB cluster. Valid Values: aurora + * (for MySQL 5.6-compatible Aurora), aurora-mysql (for MySQL 5.7-compatible Aurora), and aurora-postgresql. + * + * @return the engine value. + */ + public String engine() { + return this.engine; + } + + /** + * Set the engine property: The name of the database engine to be used for this DB cluster. Valid Values: aurora + * (for MySQL 5.6-compatible Aurora), aurora-mysql (for MySQL 5.7-compatible Aurora), and aurora-postgresql. + * + * @param engine the engine value to set. + * @return the AwsRdsDBClusterProperties object itself. + */ + public AwsRdsDBClusterProperties withEngine(String engine) { + this.engine = engine; + return this; + } + + /** + * Get the engineMode property: The DB engine mode of the DB cluster, either provisioned, serverless, parallelquery, + * global, or multimaster. + * + * @return the engineMode value. + */ + public String engineMode() { + return this.engineMode; + } + + /** + * Set the engineMode property: The DB engine mode of the DB cluster, either provisioned, serverless, parallelquery, + * global, or multimaster. + * + * @param engineMode the engineMode value to set. + * @return the AwsRdsDBClusterProperties object itself. + */ + public AwsRdsDBClusterProperties withEngineMode(String engineMode) { + this.engineMode = engineMode; + return this; + } + + /** + * Get the engineVersion property: The version number of the database engine to use. + * + * @return the engineVersion value. + */ + public String engineVersion() { + return this.engineVersion; + } + + /** + * Set the engineVersion property: The version number of the database engine to use. + * + * @param engineVersion the engineVersion value to set. + * @return the AwsRdsDBClusterProperties object itself. + */ + public AwsRdsDBClusterProperties withEngineVersion(String engineVersion) { + this.engineVersion = engineVersion; + return this; + } + + /** + * Get the globalClusterIdentifier property: If you are configuring an Aurora global database cluster and want your + * Aurora DB cluster to be a secondary member in the global database cluster, specify the global cluster ID of the + * global database cluster. To define the primary database cluster of the global cluster, use the + * AWS::RDS::GlobalCluster resource.If you aren't configuring a global database cluster, don't specify this + * property. + * + * @return the globalClusterIdentifier value. + */ + public String globalClusterIdentifier() { + return this.globalClusterIdentifier; + } + + /** + * Set the globalClusterIdentifier property: If you are configuring an Aurora global database cluster and want your + * Aurora DB cluster to be a secondary member in the global database cluster, specify the global cluster ID of the + * global database cluster. To define the primary database cluster of the global cluster, use the + * AWS::RDS::GlobalCluster resource.If you aren't configuring a global database cluster, don't specify this + * property. + * + * @param globalClusterIdentifier the globalClusterIdentifier value to set. + * @return the AwsRdsDBClusterProperties object itself. + */ + public AwsRdsDBClusterProperties withGlobalClusterIdentifier(String globalClusterIdentifier) { + this.globalClusterIdentifier = globalClusterIdentifier; + return this; + } + + /** + * Get the iops property: The amount of Provisioned IOPS (input/output operations per second) to be initially + * allocated for each DB instance in the Multi-AZ DB cluster. + * + * @return the iops value. + */ + public Integer iops() { + return this.iops; + } + + /** + * Set the iops property: The amount of Provisioned IOPS (input/output operations per second) to be initially + * allocated for each DB instance in the Multi-AZ DB cluster. + * + * @param iops the iops value to set. + * @return the AwsRdsDBClusterProperties object itself. + */ + public AwsRdsDBClusterProperties withIops(Integer iops) { + this.iops = iops; + return this; + } + + /** + * Get the kmsKeyId property: The Amazon Resource Name (ARN) of the AWS Key Management Service master key that is + * used to encrypt the database instances in the DB cluster, such as + * arn:aws:kms:us-east-1:012345678910:key/abcd1234-a123-456a-a12b-a123b4cd56ef. If you enable the StorageEncrypted + * property but don't specify this property, the default master key is used. If you specify this property, you must + * set the StorageEncrypted property to true. + * + * @return the kmsKeyId value. + */ + public String kmsKeyId() { + return this.kmsKeyId; + } + + /** + * Set the kmsKeyId property: The Amazon Resource Name (ARN) of the AWS Key Management Service master key that is + * used to encrypt the database instances in the DB cluster, such as + * arn:aws:kms:us-east-1:012345678910:key/abcd1234-a123-456a-a12b-a123b4cd56ef. If you enable the StorageEncrypted + * property but don't specify this property, the default master key is used. If you specify this property, you must + * set the StorageEncrypted property to true. + * + * @param kmsKeyId the kmsKeyId value to set. + * @return the AwsRdsDBClusterProperties object itself. + */ + public AwsRdsDBClusterProperties withKmsKeyId(String kmsKeyId) { + this.kmsKeyId = kmsKeyId; + return this; + } + + /** + * Get the manageMasterUserPassword property: A value that indicates whether to manage the master user password with + * AWS Secrets Manager. + * + * @return the manageMasterUserPassword value. + */ + public Boolean manageMasterUserPassword() { + return this.manageMasterUserPassword; + } + + /** + * Set the manageMasterUserPassword property: A value that indicates whether to manage the master user password with + * AWS Secrets Manager. + * + * @param manageMasterUserPassword the manageMasterUserPassword value to set. + * @return the AwsRdsDBClusterProperties object itself. + */ + public AwsRdsDBClusterProperties withManageMasterUserPassword(Boolean manageMasterUserPassword) { + this.manageMasterUserPassword = manageMasterUserPassword; + return this; + } + + /** + * Get the masterUserPassword property: The master password for the DB instance. + * + * @return the masterUserPassword value. + */ + public String masterUserPassword() { + return this.masterUserPassword; + } + + /** + * Set the masterUserPassword property: The master password for the DB instance. + * + * @param masterUserPassword the masterUserPassword value to set. + * @return the AwsRdsDBClusterProperties object itself. + */ + public AwsRdsDBClusterProperties withMasterUserPassword(String masterUserPassword) { + this.masterUserPassword = masterUserPassword; + return this; + } + + /** + * Get the masterUserSecret property: Contains the secret managed by RDS in AWS Secrets Manager for the master user + * password. + * + * @return the masterUserSecret value. + */ + public MasterUserSecret masterUserSecret() { + return this.masterUserSecret; + } + + /** + * Set the masterUserSecret property: Contains the secret managed by RDS in AWS Secrets Manager for the master user + * password. + * + * @param masterUserSecret the masterUserSecret value to set. + * @return the AwsRdsDBClusterProperties object itself. + */ + public AwsRdsDBClusterProperties withMasterUserSecret(MasterUserSecret masterUserSecret) { + this.masterUserSecret = masterUserSecret; + return this; + } + + /** + * Get the masterUsername property: The name of the master user for the DB cluster. You must specify MasterUsername, + * unless you specify SnapshotIdentifier. In that case, don't specify MasterUsername. + * + * @return the masterUsername value. + */ + public String masterUsername() { + return this.masterUsername; + } + + /** + * Set the masterUsername property: The name of the master user for the DB cluster. You must specify MasterUsername, + * unless you specify SnapshotIdentifier. In that case, don't specify MasterUsername. + * + * @param masterUsername the masterUsername value to set. + * @return the AwsRdsDBClusterProperties object itself. + */ + public AwsRdsDBClusterProperties withMasterUsername(String masterUsername) { + this.masterUsername = masterUsername; + return this; + } + + /** + * Get the monitoringInterval property: The interval, in seconds, between points when Enhanced Monitoring metrics + * are collected for the DB cluster. To turn off collecting Enhanced Monitoring metrics, specify 0. The default is + * 0. + * + * @return the monitoringInterval value. + */ + public Integer monitoringInterval() { + return this.monitoringInterval; + } + + /** + * Set the monitoringInterval property: The interval, in seconds, between points when Enhanced Monitoring metrics + * are collected for the DB cluster. To turn off collecting Enhanced Monitoring metrics, specify 0. The default is + * 0. + * + * @param monitoringInterval the monitoringInterval value to set. + * @return the AwsRdsDBClusterProperties object itself. + */ + public AwsRdsDBClusterProperties withMonitoringInterval(Integer monitoringInterval) { + this.monitoringInterval = monitoringInterval; + return this; + } + + /** + * Get the monitoringRoleArn property: The Amazon Resource Name (ARN) for the IAM role that permits RDS to send + * Enhanced Monitoring metrics to Amazon CloudWatch Logs. + * + * @return the monitoringRoleArn value. + */ + public String monitoringRoleArn() { + return this.monitoringRoleArn; + } + + /** + * Set the monitoringRoleArn property: The Amazon Resource Name (ARN) for the IAM role that permits RDS to send + * Enhanced Monitoring metrics to Amazon CloudWatch Logs. + * + * @param monitoringRoleArn the monitoringRoleArn value to set. + * @return the AwsRdsDBClusterProperties object itself. + */ + public AwsRdsDBClusterProperties withMonitoringRoleArn(String monitoringRoleArn) { + this.monitoringRoleArn = monitoringRoleArn; + return this; + } + + /** + * Get the networkType property: The network type of the DB cluster. + * + * @return the networkType value. + */ + public String networkType() { + return this.networkType; + } + + /** + * Set the networkType property: The network type of the DB cluster. + * + * @param networkType the networkType value to set. + * @return the AwsRdsDBClusterProperties object itself. + */ + public AwsRdsDBClusterProperties withNetworkType(String networkType) { + this.networkType = networkType; + return this; + } + + /** + * Get the performanceInsightsEnabled property: A value that indicates whether to turn on Performance Insights for + * the DB cluster. + * + * @return the performanceInsightsEnabled value. + */ + public Boolean performanceInsightsEnabled() { + return this.performanceInsightsEnabled; + } + + /** + * Set the performanceInsightsEnabled property: A value that indicates whether to turn on Performance Insights for + * the DB cluster. + * + * @param performanceInsightsEnabled the performanceInsightsEnabled value to set. + * @return the AwsRdsDBClusterProperties object itself. + */ + public AwsRdsDBClusterProperties withPerformanceInsightsEnabled(Boolean performanceInsightsEnabled) { + this.performanceInsightsEnabled = performanceInsightsEnabled; + return this; + } + + /** + * Get the performanceInsightsKmsKeyId property: The Amazon Web Services KMS key identifier for encryption of + * Performance Insights data. + * + * @return the performanceInsightsKmsKeyId value. + */ + public String performanceInsightsKmsKeyId() { + return this.performanceInsightsKmsKeyId; + } + + /** + * Set the performanceInsightsKmsKeyId property: The Amazon Web Services KMS key identifier for encryption of + * Performance Insights data. + * + * @param performanceInsightsKmsKeyId the performanceInsightsKmsKeyId value to set. + * @return the AwsRdsDBClusterProperties object itself. + */ + public AwsRdsDBClusterProperties withPerformanceInsightsKmsKeyId(String performanceInsightsKmsKeyId) { + this.performanceInsightsKmsKeyId = performanceInsightsKmsKeyId; + return this; + } + + /** + * Get the performanceInsightsRetentionPeriod property: The amount of time, in days, to retain Performance Insights + * data. + * + * @return the performanceInsightsRetentionPeriod value. + */ + public Integer performanceInsightsRetentionPeriod() { + return this.performanceInsightsRetentionPeriod; + } + + /** + * Set the performanceInsightsRetentionPeriod property: The amount of time, in days, to retain Performance Insights + * data. + * + * @param performanceInsightsRetentionPeriod the performanceInsightsRetentionPeriod value to set. + * @return the AwsRdsDBClusterProperties object itself. + */ + public AwsRdsDBClusterProperties + withPerformanceInsightsRetentionPeriod(Integer performanceInsightsRetentionPeriod) { + this.performanceInsightsRetentionPeriod = performanceInsightsRetentionPeriod; + return this; + } + + /** + * Get the port property: The port number on which the instances in the DB cluster accept connections. Default: 3306 + * if engine is set as aurora or 5432 if set to aurora-postgresql. + * + * @return the port value. + */ + public Integer port() { + return this.port; + } + + /** + * Set the port property: The port number on which the instances in the DB cluster accept connections. Default: 3306 + * if engine is set as aurora or 5432 if set to aurora-postgresql. + * + * @param port the port value to set. + * @return the AwsRdsDBClusterProperties object itself. + */ + public AwsRdsDBClusterProperties withPort(Integer port) { + this.port = port; + return this; + } + + /** + * Get the preferredBackupWindow property: The daily time range during which automated backups are created if + * automated backups are enabled using the BackupRetentionPeriod parameter. The default is a 30-minute window + * selected at random from an 8-hour block of time for each AWS Region. To see the time blocks available, see + * Adjusting the Preferred DB Cluster Maintenance Window in the Amazon Aurora User Guide. + * + * @return the preferredBackupWindow value. + */ + public String preferredBackupWindow() { + return this.preferredBackupWindow; + } + + /** + * Set the preferredBackupWindow property: The daily time range during which automated backups are created if + * automated backups are enabled using the BackupRetentionPeriod parameter. The default is a 30-minute window + * selected at random from an 8-hour block of time for each AWS Region. To see the time blocks available, see + * Adjusting the Preferred DB Cluster Maintenance Window in the Amazon Aurora User Guide. + * + * @param preferredBackupWindow the preferredBackupWindow value to set. + * @return the AwsRdsDBClusterProperties object itself. + */ + public AwsRdsDBClusterProperties withPreferredBackupWindow(String preferredBackupWindow) { + this.preferredBackupWindow = preferredBackupWindow; + return this; + } + + /** + * Get the preferredMaintenanceWindow property: The weekly time range during which system maintenance can occur, in + * Universal Coordinated Time (UTC). The default is a 30-minute window selected at random from an 8-hour block of + * time for each AWS Region, occurring on a random day of the week. To see the time blocks available, see Adjusting + * the Preferred DB Cluster Maintenance Window in the Amazon Aurora User Guide. + * + * @return the preferredMaintenanceWindow value. + */ + public String preferredMaintenanceWindow() { + return this.preferredMaintenanceWindow; + } + + /** + * Set the preferredMaintenanceWindow property: The weekly time range during which system maintenance can occur, in + * Universal Coordinated Time (UTC). The default is a 30-minute window selected at random from an 8-hour block of + * time for each AWS Region, occurring on a random day of the week. To see the time blocks available, see Adjusting + * the Preferred DB Cluster Maintenance Window in the Amazon Aurora User Guide. + * + * @param preferredMaintenanceWindow the preferredMaintenanceWindow value to set. + * @return the AwsRdsDBClusterProperties object itself. + */ + public AwsRdsDBClusterProperties withPreferredMaintenanceWindow(String preferredMaintenanceWindow) { + this.preferredMaintenanceWindow = preferredMaintenanceWindow; + return this; + } + + /** + * Get the publiclyAccessible property: A value that indicates whether the DB cluster is publicly accessible. + * + * @return the publiclyAccessible value. + */ + public Boolean publiclyAccessible() { + return this.publiclyAccessible; + } + + /** + * Set the publiclyAccessible property: A value that indicates whether the DB cluster is publicly accessible. + * + * @param publiclyAccessible the publiclyAccessible value to set. + * @return the AwsRdsDBClusterProperties object itself. + */ + public AwsRdsDBClusterProperties withPubliclyAccessible(Boolean publiclyAccessible) { + this.publiclyAccessible = publiclyAccessible; + return this; + } + + /** + * Get the readEndpoint property: Property readEndpoint. + * + * @return the readEndpoint value. + */ + public ReadEndpoint readEndpoint() { + return this.readEndpoint; + } + + /** + * Set the readEndpoint property: Property readEndpoint. + * + * @param readEndpoint the readEndpoint value to set. + * @return the AwsRdsDBClusterProperties object itself. + */ + public AwsRdsDBClusterProperties withReadEndpoint(ReadEndpoint readEndpoint) { + this.readEndpoint = readEndpoint; + return this; + } + + /** + * Get the replicationSourceIdentifier property: The Amazon Resource Name (ARN) of the source DB instance or DB + * cluster if this DB cluster is created as a Read Replica. + * + * @return the replicationSourceIdentifier value. + */ + public String replicationSourceIdentifier() { + return this.replicationSourceIdentifier; + } + + /** + * Set the replicationSourceIdentifier property: The Amazon Resource Name (ARN) of the source DB instance or DB + * cluster if this DB cluster is created as a Read Replica. + * + * @param replicationSourceIdentifier the replicationSourceIdentifier value to set. + * @return the AwsRdsDBClusterProperties object itself. + */ + public AwsRdsDBClusterProperties withReplicationSourceIdentifier(String replicationSourceIdentifier) { + this.replicationSourceIdentifier = replicationSourceIdentifier; + return this; + } + + /** + * Get the restoreToTime property: The date and time to restore the DB cluster to. Value must be a time in Universal + * Coordinated Time (UTC) format. An example: 2015-03-07T23:45:00Z. + * + * @return the restoreToTime value. + */ + public String restoreToTime() { + return this.restoreToTime; + } + + /** + * Set the restoreToTime property: The date and time to restore the DB cluster to. Value must be a time in Universal + * Coordinated Time (UTC) format. An example: 2015-03-07T23:45:00Z. + * + * @param restoreToTime the restoreToTime value to set. + * @return the AwsRdsDBClusterProperties object itself. + */ + public AwsRdsDBClusterProperties withRestoreToTime(String restoreToTime) { + this.restoreToTime = restoreToTime; + return this; + } + + /** + * Get the restoreType property: The type of restore to be performed. You can specify one of the following + * values:full-copy - The new DB cluster is restored as a full copy of the source DB cluster.copy-on-write - The new + * DB cluster is restored as a clone of the source DB cluster. + * + * @return the restoreType value. + */ + public String restoreType() { + return this.restoreType; + } + + /** + * Set the restoreType property: The type of restore to be performed. You can specify one of the following + * values:full-copy - The new DB cluster is restored as a full copy of the source DB cluster.copy-on-write - The new + * DB cluster is restored as a clone of the source DB cluster. + * + * @param restoreType the restoreType value to set. + * @return the AwsRdsDBClusterProperties object itself. + */ + public AwsRdsDBClusterProperties withRestoreType(String restoreType) { + this.restoreType = restoreType; + return this; + } + + /** + * Get the scalingConfiguration property: The ScalingConfiguration property type specifies the scaling configuration + * of an Aurora Serverless DB cluster. The ScalingConfiguration property type specifies the scaling configuration of + * an Aurora Serverless DB cluster. + * + * @return the scalingConfiguration value. + */ + public ScalingConfiguration scalingConfiguration() { + return this.scalingConfiguration; + } + + /** + * Set the scalingConfiguration property: The ScalingConfiguration property type specifies the scaling configuration + * of an Aurora Serverless DB cluster. The ScalingConfiguration property type specifies the scaling configuration of + * an Aurora Serverless DB cluster. + * + * @param scalingConfiguration the scalingConfiguration value to set. + * @return the AwsRdsDBClusterProperties object itself. + */ + public AwsRdsDBClusterProperties withScalingConfiguration(ScalingConfiguration scalingConfiguration) { + this.scalingConfiguration = scalingConfiguration; + return this; + } + + /** + * Get the serverlessV2ScalingConfiguration property: Contains the scaling configuration of an Aurora Serverless v2 + * DB cluster. Contains the scaling configuration of an Aurora Serverless v2 DB cluster. + * + * @return the serverlessV2ScalingConfiguration value. + */ + public ServerlessV2ScalingConfiguration serverlessV2ScalingConfiguration() { + return this.serverlessV2ScalingConfiguration; + } + + /** + * Set the serverlessV2ScalingConfiguration property: Contains the scaling configuration of an Aurora Serverless v2 + * DB cluster. Contains the scaling configuration of an Aurora Serverless v2 DB cluster. + * + * @param serverlessV2ScalingConfiguration the serverlessV2ScalingConfiguration value to set. + * @return the AwsRdsDBClusterProperties object itself. + */ + public AwsRdsDBClusterProperties + withServerlessV2ScalingConfiguration(ServerlessV2ScalingConfiguration serverlessV2ScalingConfiguration) { + this.serverlessV2ScalingConfiguration = serverlessV2ScalingConfiguration; + return this; + } + + /** + * Get the snapshotIdentifier property: The identifier for the DB snapshot or DB cluster snapshot to restore + * from.You can use either the name or the Amazon Resource Name (ARN) to specify a DB cluster snapshot. However, you + * can use only the ARN to specify a DB snapshot.After you restore a DB cluster with a SnapshotIdentifier property, + * you must specify the same SnapshotIdentifier property for any future updates to the DB cluster. When you specify + * this property for an update, the DB cluster is not restored from the snapshot again, and the data in the database + * is not changed. However, if you don't specify the SnapshotIdentifier property, an empty DB cluster is created, + * and the original DB cluster is deleted. If you specify a property that is different from the previous snapshot + * restore property, the DB cluster is restored from the specified SnapshotIdentifier property, and the original DB + * cluster is deleted. + * + * @return the snapshotIdentifier value. + */ + public String snapshotIdentifier() { + return this.snapshotIdentifier; + } + + /** + * Set the snapshotIdentifier property: The identifier for the DB snapshot or DB cluster snapshot to restore + * from.You can use either the name or the Amazon Resource Name (ARN) to specify a DB cluster snapshot. However, you + * can use only the ARN to specify a DB snapshot.After you restore a DB cluster with a SnapshotIdentifier property, + * you must specify the same SnapshotIdentifier property for any future updates to the DB cluster. When you specify + * this property for an update, the DB cluster is not restored from the snapshot again, and the data in the database + * is not changed. However, if you don't specify the SnapshotIdentifier property, an empty DB cluster is created, + * and the original DB cluster is deleted. If you specify a property that is different from the previous snapshot + * restore property, the DB cluster is restored from the specified SnapshotIdentifier property, and the original DB + * cluster is deleted. + * + * @param snapshotIdentifier the snapshotIdentifier value to set. + * @return the AwsRdsDBClusterProperties object itself. + */ + public AwsRdsDBClusterProperties withSnapshotIdentifier(String snapshotIdentifier) { + this.snapshotIdentifier = snapshotIdentifier; + return this; + } + + /** + * Get the sourceDBClusterIdentifier property: The identifier of the source DB cluster from which to restore. + * + * @return the sourceDBClusterIdentifier value. + */ + public String sourceDBClusterIdentifier() { + return this.sourceDBClusterIdentifier; + } + + /** + * Set the sourceDBClusterIdentifier property: The identifier of the source DB cluster from which to restore. + * + * @param sourceDBClusterIdentifier the sourceDBClusterIdentifier value to set. + * @return the AwsRdsDBClusterProperties object itself. + */ + public AwsRdsDBClusterProperties withSourceDBClusterIdentifier(String sourceDBClusterIdentifier) { + this.sourceDBClusterIdentifier = sourceDBClusterIdentifier; + return this; + } + + /** + * Get the sourceRegion property: The AWS Region which contains the source DB cluster when replicating a DB cluster. + * For example, us-east-1. + * + * @return the sourceRegion value. + */ + public String sourceRegion() { + return this.sourceRegion; + } + + /** + * Set the sourceRegion property: The AWS Region which contains the source DB cluster when replicating a DB cluster. + * For example, us-east-1. + * + * @param sourceRegion the sourceRegion value to set. + * @return the AwsRdsDBClusterProperties object itself. + */ + public AwsRdsDBClusterProperties withSourceRegion(String sourceRegion) { + this.sourceRegion = sourceRegion; + return this; + } + + /** + * Get the storageEncrypted property: Indicates whether the DB instance is encrypted.If you specify the + * DBClusterIdentifier, SnapshotIdentifier, or SourceDBInstanceIdentifier property, don't specify this property. The + * value is inherited from the cluster, snapshot, or source DB instance. + * + * @return the storageEncrypted value. + */ + public Boolean storageEncrypted() { + return this.storageEncrypted; + } + + /** + * Set the storageEncrypted property: Indicates whether the DB instance is encrypted.If you specify the + * DBClusterIdentifier, SnapshotIdentifier, or SourceDBInstanceIdentifier property, don't specify this property. The + * value is inherited from the cluster, snapshot, or source DB instance. + * + * @param storageEncrypted the storageEncrypted value to set. + * @return the AwsRdsDBClusterProperties object itself. + */ + public AwsRdsDBClusterProperties withStorageEncrypted(Boolean storageEncrypted) { + this.storageEncrypted = storageEncrypted; + return this; + } + + /** + * Get the storageThroughput property: Specifies the storage throughput value for the DB cluster. This setting + * applies only to the gp3 storage type. + * + * @return the storageThroughput value. + */ + public Integer storageThroughput() { + return this.storageThroughput; + } + + /** + * Set the storageThroughput property: Specifies the storage throughput value for the DB cluster. This setting + * applies only to the gp3 storage type. + * + * @param storageThroughput the storageThroughput value to set. + * @return the AwsRdsDBClusterProperties object itself. + */ + public AwsRdsDBClusterProperties withStorageThroughput(Integer storageThroughput) { + this.storageThroughput = storageThroughput; + return this; + } + + /** + * Get the storageType property: Specifies the storage type to be associated with the DB cluster. + * + * @return the storageType value. + */ + public String storageType() { + return this.storageType; + } + + /** + * Set the storageType property: Specifies the storage type to be associated with the DB cluster. + * + * @param storageType the storageType value to set. + * @return the AwsRdsDBClusterProperties object itself. + */ + public AwsRdsDBClusterProperties withStorageType(String storageType) { + this.storageType = storageType; + return this; + } + + /** + * Get the tags property: An array of key-value pairs to apply to this resource. + * + * @return the tags value. + */ + public List tags() { + return this.tags; + } + + /** + * Set the tags property: An array of key-value pairs to apply to this resource. + * + * @param tags the tags value to set. + * @return the AwsRdsDBClusterProperties object itself. + */ + public AwsRdsDBClusterProperties withTags(List tags) { + this.tags = tags; + return this; + } + + /** + * Get the useLatestRestorableTime property: A value that indicates whether to restore the DB cluster to the latest + * restorable backup time. By default, the DB cluster is not restored to the latest restorable backup time. + * + * @return the useLatestRestorableTime value. + */ + public Boolean useLatestRestorableTime() { + return this.useLatestRestorableTime; + } + + /** + * Set the useLatestRestorableTime property: A value that indicates whether to restore the DB cluster to the latest + * restorable backup time. By default, the DB cluster is not restored to the latest restorable backup time. + * + * @param useLatestRestorableTime the useLatestRestorableTime value to set. + * @return the AwsRdsDBClusterProperties object itself. + */ + public AwsRdsDBClusterProperties withUseLatestRestorableTime(Boolean useLatestRestorableTime) { + this.useLatestRestorableTime = useLatestRestorableTime; + return this; + } + + /** + * Get the vpcSecurityGroupIds property: A list of EC2 VPC security groups to associate with this DB cluster. + * + * @return the vpcSecurityGroupIds value. + */ + public List vpcSecurityGroupIds() { + return this.vpcSecurityGroupIds; + } + + /** + * Set the vpcSecurityGroupIds property: A list of EC2 VPC security groups to associate with this DB cluster. + * + * @param vpcSecurityGroupIds the vpcSecurityGroupIds value to set. + * @return the AwsRdsDBClusterProperties object itself. + */ + public AwsRdsDBClusterProperties withVpcSecurityGroupIds(List vpcSecurityGroupIds) { + this.vpcSecurityGroupIds = vpcSecurityGroupIds; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (associatedRoles() != null) { + associatedRoles().forEach(e -> e.validate()); + } + if (endpoint() != null) { + endpoint().validate(); + } + if (masterUserSecret() != null) { + masterUserSecret().validate(); + } + if (readEndpoint() != null) { + readEndpoint().validate(); + } + if (scalingConfiguration() != null) { + scalingConfiguration().validate(); + } + if (serverlessV2ScalingConfiguration() != null) { + serverlessV2ScalingConfiguration().validate(); + } + if (tags() != null) { + tags().forEach(e -> e.validate()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeNumberField("allocatedStorage", this.allocatedStorage); + jsonWriter.writeArrayField("associatedRoles", this.associatedRoles, + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeBooleanField("autoMinorVersionUpgrade", this.autoMinorVersionUpgrade); + jsonWriter.writeArrayField("availabilityZones", this.availabilityZones, + (writer, element) -> writer.writeString(element)); + jsonWriter.writeNumberField("backtrackWindow", this.backtrackWindow); + jsonWriter.writeNumberField("backupRetentionPeriod", this.backupRetentionPeriod); + jsonWriter.writeBooleanField("copyTagsToSnapshot", this.copyTagsToSnapshot); + jsonWriter.writeStringField("dbClusterArn", this.dbClusterArn); + jsonWriter.writeStringField("dbClusterIdentifier", this.dbClusterIdentifier); + jsonWriter.writeStringField("dbClusterInstanceClass", this.dbClusterInstanceClass); + jsonWriter.writeStringField("dbClusterParameterGroupName", this.dbClusterParameterGroupName); + jsonWriter.writeStringField("dbClusterResourceId", this.dbClusterResourceId); + jsonWriter.writeStringField("dbInstanceParameterGroupName", this.dbInstanceParameterGroupName); + jsonWriter.writeStringField("dbSubnetGroupName", this.dbSubnetGroupName); + jsonWriter.writeStringField("dbSystemId", this.dbSystemId); + jsonWriter.writeStringField("databaseName", this.databaseName); + jsonWriter.writeBooleanField("deletionProtection", this.deletionProtection); + jsonWriter.writeStringField("domain", this.domain); + jsonWriter.writeStringField("domainIAMRoleName", this.domainIamRoleName); + jsonWriter.writeArrayField("enableCloudwatchLogsExports", this.enableCloudwatchLogsExports, + (writer, element) -> writer.writeString(element)); + jsonWriter.writeBooleanField("enableGlobalWriteForwarding", this.enableGlobalWriteForwarding); + jsonWriter.writeBooleanField("enableHttpEndpoint", this.enableHttpEndpoint); + jsonWriter.writeBooleanField("enableIAMDatabaseAuthentication", this.enableIamDatabaseAuthentication); + jsonWriter.writeJsonField("endpoint", this.endpoint); + jsonWriter.writeStringField("engine", this.engine); + jsonWriter.writeStringField("engineMode", this.engineMode); + jsonWriter.writeStringField("engineVersion", this.engineVersion); + jsonWriter.writeStringField("globalClusterIdentifier", this.globalClusterIdentifier); + jsonWriter.writeNumberField("iops", this.iops); + jsonWriter.writeStringField("kmsKeyId", this.kmsKeyId); + jsonWriter.writeBooleanField("manageMasterUserPassword", this.manageMasterUserPassword); + jsonWriter.writeStringField("masterUserPassword", this.masterUserPassword); + jsonWriter.writeJsonField("masterUserSecret", this.masterUserSecret); + jsonWriter.writeStringField("masterUsername", this.masterUsername); + jsonWriter.writeNumberField("monitoringInterval", this.monitoringInterval); + jsonWriter.writeStringField("monitoringRoleArn", this.monitoringRoleArn); + jsonWriter.writeStringField("networkType", this.networkType); + jsonWriter.writeBooleanField("performanceInsightsEnabled", this.performanceInsightsEnabled); + jsonWriter.writeStringField("performanceInsightsKmsKeyId", this.performanceInsightsKmsKeyId); + jsonWriter.writeNumberField("performanceInsightsRetentionPeriod", this.performanceInsightsRetentionPeriod); + jsonWriter.writeNumberField("port", this.port); + jsonWriter.writeStringField("preferredBackupWindow", this.preferredBackupWindow); + jsonWriter.writeStringField("preferredMaintenanceWindow", this.preferredMaintenanceWindow); + jsonWriter.writeBooleanField("publiclyAccessible", this.publiclyAccessible); + jsonWriter.writeJsonField("readEndpoint", this.readEndpoint); + jsonWriter.writeStringField("replicationSourceIdentifier", this.replicationSourceIdentifier); + jsonWriter.writeStringField("restoreToTime", this.restoreToTime); + jsonWriter.writeStringField("restoreType", this.restoreType); + jsonWriter.writeJsonField("scalingConfiguration", this.scalingConfiguration); + jsonWriter.writeJsonField("serverlessV2ScalingConfiguration", this.serverlessV2ScalingConfiguration); + jsonWriter.writeStringField("snapshotIdentifier", this.snapshotIdentifier); + jsonWriter.writeStringField("sourceDBClusterIdentifier", this.sourceDBClusterIdentifier); + jsonWriter.writeStringField("sourceRegion", this.sourceRegion); + jsonWriter.writeBooleanField("storageEncrypted", this.storageEncrypted); + jsonWriter.writeNumberField("storageThroughput", this.storageThroughput); + jsonWriter.writeStringField("storageType", this.storageType); + jsonWriter.writeArrayField("tags", this.tags, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeBooleanField("useLatestRestorableTime", this.useLatestRestorableTime); + jsonWriter.writeArrayField("vpcSecurityGroupIds", this.vpcSecurityGroupIds, + (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AwsRdsDBClusterProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AwsRdsDBClusterProperties if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IOException If an error occurs while reading the AwsRdsDBClusterProperties. + */ + public static AwsRdsDBClusterProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AwsRdsDBClusterProperties deserializedAwsRdsDBClusterProperties = new AwsRdsDBClusterProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("allocatedStorage".equals(fieldName)) { + deserializedAwsRdsDBClusterProperties.allocatedStorage = reader.getNullable(JsonReader::getInt); + } else if ("associatedRoles".equals(fieldName)) { + List associatedRoles = reader.readArray(reader1 -> DBClusterRole.fromJson(reader1)); + deserializedAwsRdsDBClusterProperties.associatedRoles = associatedRoles; + } else if ("autoMinorVersionUpgrade".equals(fieldName)) { + deserializedAwsRdsDBClusterProperties.autoMinorVersionUpgrade + = reader.getNullable(JsonReader::getBoolean); + } else if ("availabilityZones".equals(fieldName)) { + List availabilityZones = reader.readArray(reader1 -> reader1.getString()); + deserializedAwsRdsDBClusterProperties.availabilityZones = availabilityZones; + } else if ("backtrackWindow".equals(fieldName)) { + deserializedAwsRdsDBClusterProperties.backtrackWindow = reader.getNullable(JsonReader::getInt); + } else if ("backupRetentionPeriod".equals(fieldName)) { + deserializedAwsRdsDBClusterProperties.backupRetentionPeriod + = reader.getNullable(JsonReader::getInt); + } else if ("copyTagsToSnapshot".equals(fieldName)) { + deserializedAwsRdsDBClusterProperties.copyTagsToSnapshot + = reader.getNullable(JsonReader::getBoolean); + } else if ("dbClusterArn".equals(fieldName)) { + deserializedAwsRdsDBClusterProperties.dbClusterArn = reader.getString(); + } else if ("dbClusterIdentifier".equals(fieldName)) { + deserializedAwsRdsDBClusterProperties.dbClusterIdentifier = reader.getString(); + } else if ("dbClusterInstanceClass".equals(fieldName)) { + deserializedAwsRdsDBClusterProperties.dbClusterInstanceClass = reader.getString(); + } else if ("dbClusterParameterGroupName".equals(fieldName)) { + deserializedAwsRdsDBClusterProperties.dbClusterParameterGroupName = reader.getString(); + } else if ("dbClusterResourceId".equals(fieldName)) { + deserializedAwsRdsDBClusterProperties.dbClusterResourceId = reader.getString(); + } else if ("dbInstanceParameterGroupName".equals(fieldName)) { + deserializedAwsRdsDBClusterProperties.dbInstanceParameterGroupName = reader.getString(); + } else if ("dbSubnetGroupName".equals(fieldName)) { + deserializedAwsRdsDBClusterProperties.dbSubnetGroupName = reader.getString(); + } else if ("dbSystemId".equals(fieldName)) { + deserializedAwsRdsDBClusterProperties.dbSystemId = reader.getString(); + } else if ("databaseName".equals(fieldName)) { + deserializedAwsRdsDBClusterProperties.databaseName = reader.getString(); + } else if ("deletionProtection".equals(fieldName)) { + deserializedAwsRdsDBClusterProperties.deletionProtection + = reader.getNullable(JsonReader::getBoolean); + } else if ("domain".equals(fieldName)) { + deserializedAwsRdsDBClusterProperties.domain = reader.getString(); + } else if ("domainIAMRoleName".equals(fieldName)) { + deserializedAwsRdsDBClusterProperties.domainIamRoleName = reader.getString(); + } else if ("enableCloudwatchLogsExports".equals(fieldName)) { + List enableCloudwatchLogsExports = reader.readArray(reader1 -> reader1.getString()); + deserializedAwsRdsDBClusterProperties.enableCloudwatchLogsExports = enableCloudwatchLogsExports; + } else if ("enableGlobalWriteForwarding".equals(fieldName)) { + deserializedAwsRdsDBClusterProperties.enableGlobalWriteForwarding + = reader.getNullable(JsonReader::getBoolean); + } else if ("enableHttpEndpoint".equals(fieldName)) { + deserializedAwsRdsDBClusterProperties.enableHttpEndpoint + = reader.getNullable(JsonReader::getBoolean); + } else if ("enableIAMDatabaseAuthentication".equals(fieldName)) { + deserializedAwsRdsDBClusterProperties.enableIamDatabaseAuthentication + = reader.getNullable(JsonReader::getBoolean); + } else if ("endpoint".equals(fieldName)) { + deserializedAwsRdsDBClusterProperties.endpoint = EndpointAutoGenerated.fromJson(reader); + } else if ("engine".equals(fieldName)) { + deserializedAwsRdsDBClusterProperties.engine = reader.getString(); + } else if ("engineMode".equals(fieldName)) { + deserializedAwsRdsDBClusterProperties.engineMode = reader.getString(); + } else if ("engineVersion".equals(fieldName)) { + deserializedAwsRdsDBClusterProperties.engineVersion = reader.getString(); + } else if ("globalClusterIdentifier".equals(fieldName)) { + deserializedAwsRdsDBClusterProperties.globalClusterIdentifier = reader.getString(); + } else if ("iops".equals(fieldName)) { + deserializedAwsRdsDBClusterProperties.iops = reader.getNullable(JsonReader::getInt); + } else if ("kmsKeyId".equals(fieldName)) { + deserializedAwsRdsDBClusterProperties.kmsKeyId = reader.getString(); + } else if ("manageMasterUserPassword".equals(fieldName)) { + deserializedAwsRdsDBClusterProperties.manageMasterUserPassword + = reader.getNullable(JsonReader::getBoolean); + } else if ("masterUserPassword".equals(fieldName)) { + deserializedAwsRdsDBClusterProperties.masterUserPassword = reader.getString(); + } else if ("masterUserSecret".equals(fieldName)) { + deserializedAwsRdsDBClusterProperties.masterUserSecret = MasterUserSecret.fromJson(reader); + } else if ("masterUsername".equals(fieldName)) { + deserializedAwsRdsDBClusterProperties.masterUsername = reader.getString(); + } else if ("monitoringInterval".equals(fieldName)) { + deserializedAwsRdsDBClusterProperties.monitoringInterval = reader.getNullable(JsonReader::getInt); + } else if ("monitoringRoleArn".equals(fieldName)) { + deserializedAwsRdsDBClusterProperties.monitoringRoleArn = reader.getString(); + } else if ("networkType".equals(fieldName)) { + deserializedAwsRdsDBClusterProperties.networkType = reader.getString(); + } else if ("performanceInsightsEnabled".equals(fieldName)) { + deserializedAwsRdsDBClusterProperties.performanceInsightsEnabled + = reader.getNullable(JsonReader::getBoolean); + } else if ("performanceInsightsKmsKeyId".equals(fieldName)) { + deserializedAwsRdsDBClusterProperties.performanceInsightsKmsKeyId = reader.getString(); + } else if ("performanceInsightsRetentionPeriod".equals(fieldName)) { + deserializedAwsRdsDBClusterProperties.performanceInsightsRetentionPeriod + = reader.getNullable(JsonReader::getInt); + } else if ("port".equals(fieldName)) { + deserializedAwsRdsDBClusterProperties.port = reader.getNullable(JsonReader::getInt); + } else if ("preferredBackupWindow".equals(fieldName)) { + deserializedAwsRdsDBClusterProperties.preferredBackupWindow = reader.getString(); + } else if ("preferredMaintenanceWindow".equals(fieldName)) { + deserializedAwsRdsDBClusterProperties.preferredMaintenanceWindow = reader.getString(); + } else if ("publiclyAccessible".equals(fieldName)) { + deserializedAwsRdsDBClusterProperties.publiclyAccessible + = reader.getNullable(JsonReader::getBoolean); + } else if ("readEndpoint".equals(fieldName)) { + deserializedAwsRdsDBClusterProperties.readEndpoint = ReadEndpoint.fromJson(reader); + } else if ("replicationSourceIdentifier".equals(fieldName)) { + deserializedAwsRdsDBClusterProperties.replicationSourceIdentifier = reader.getString(); + } else if ("restoreToTime".equals(fieldName)) { + deserializedAwsRdsDBClusterProperties.restoreToTime = reader.getString(); + } else if ("restoreType".equals(fieldName)) { + deserializedAwsRdsDBClusterProperties.restoreType = reader.getString(); + } else if ("scalingConfiguration".equals(fieldName)) { + deserializedAwsRdsDBClusterProperties.scalingConfiguration = ScalingConfiguration.fromJson(reader); + } else if ("serverlessV2ScalingConfiguration".equals(fieldName)) { + deserializedAwsRdsDBClusterProperties.serverlessV2ScalingConfiguration + = ServerlessV2ScalingConfiguration.fromJson(reader); + } else if ("snapshotIdentifier".equals(fieldName)) { + deserializedAwsRdsDBClusterProperties.snapshotIdentifier = reader.getString(); + } else if ("sourceDBClusterIdentifier".equals(fieldName)) { + deserializedAwsRdsDBClusterProperties.sourceDBClusterIdentifier = reader.getString(); + } else if ("sourceRegion".equals(fieldName)) { + deserializedAwsRdsDBClusterProperties.sourceRegion = reader.getString(); + } else if ("storageEncrypted".equals(fieldName)) { + deserializedAwsRdsDBClusterProperties.storageEncrypted = reader.getNullable(JsonReader::getBoolean); + } else if ("storageThroughput".equals(fieldName)) { + deserializedAwsRdsDBClusterProperties.storageThroughput = reader.getNullable(JsonReader::getInt); + } else if ("storageType".equals(fieldName)) { + deserializedAwsRdsDBClusterProperties.storageType = reader.getString(); + } else if ("tags".equals(fieldName)) { + List tags = reader.readArray(reader1 -> TagAutoGenerated45.fromJson(reader1)); + deserializedAwsRdsDBClusterProperties.tags = tags; + } else if ("useLatestRestorableTime".equals(fieldName)) { + deserializedAwsRdsDBClusterProperties.useLatestRestorableTime + = reader.getNullable(JsonReader::getBoolean); + } else if ("vpcSecurityGroupIds".equals(fieldName)) { + List vpcSecurityGroupIds = reader.readArray(reader1 -> reader1.getString()); + deserializedAwsRdsDBClusterProperties.vpcSecurityGroupIds = vpcSecurityGroupIds; + } else { + reader.skipChildren(); + } + } + + return deserializedAwsRdsDBClusterProperties; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/AwsRdsDBInstanceProperties.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/AwsRdsDBInstanceProperties.java new file mode 100644 index 000000000000..52bacb3a9a6e --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/AwsRdsDBInstanceProperties.java @@ -0,0 +1,3616 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Definition of awsRdsDBInstance. + */ +@Fluent +public final class AwsRdsDBInstanceProperties implements JsonSerializable { + /* + * The amount of storage in gibibytes (GiB) to be initially allocated for the database instance. If any value is set + * in the ``Iops`` parameter, ``AllocatedStorage`` must be at least 100 GiB, which corresponds to the minimum Iops + * value of 1,000. If you increase the ``Iops`` value (in 1,000 IOPS increments), then you must also increase the + * ``AllocatedStorage`` value (in 100-GiB increments). *Amazon Aurora* Not applicable. Aurora cluster volumes + * automatically grow as the amount of data in your database increases, though you are only charged for the space + * that you use in an Aurora cluster volume. *Db2* Constraints to the amount of storage for each storage type are + * the following: + General Purpose (SSD) storage (gp3): Must be an integer from 20 to 64000. + Provisioned IOPS + * storage (io1): Must be an integer from 100 to 64000. *MySQL* Constraints to the amount of storage for each + * storage type are the following: + General Purpose (SSD) storage (gp2): Must be an integer from 20 to 65536. + + * Provisioned IOPS storage (io1): Must be an integer from 100 to 65536. + Magnetic storage (standard): Must be an + * integer from 5 to 3072. *MariaDB* Constraints to the amount of storage for each storage type are the following: + + * General Purpose (SSD) storage (gp2): Must be an integer from 20 to 65536. + Provisioned IOPS storage (io1): Must + * be an integer from 100 to 65536. + Magnetic storage (standard): Must be an integer from 5 to 3072. *PostgreSQL* + * Constraints to the amount of storage for each storage type are the following: + General Purpose (SSD) storage + * (gp2): Must be an integer from 20 to 65536. + Provisioned IOPS storage (io1): Must be an integer from 100 to + * 65536. + Magnetic storage (standard): Must be an integer from 5 to 3072. *Oracle* Constraints to the amount of + * storage for each storage type are the following: + General Purpose (SSD) storage (gp2): Must be an integer from + * 20 to 65536. + Provisioned IOPS storage (io1): Must be an integer from 100 to 65536. + Magnetic storage + * (standard): Must be an integer from 10 to 3072. *SQL Server* Constraints to the amount of storage for each + * storage type are the following: + General Purpose (SSD) storage (gp2): + Enterprise and Standard editions: Must + * be an integer from 20 to 16384. + Web and Express editions: Must be an integer from 20 to 16384. + Provisioned + * IOPS storage (io1): + Enterprise and Standard editions: Must be an integer from 20 to 16384. + Web and Express + * editions: Must be an integer from 20 to 16384. + Magnetic storage (standard): + Enterprise and Standard editions: + * Must be an integer from 20 to 1024. + Web and Express editions: Must be an integer from 20 to 1024. + */ + private String allocatedStorage; + + /* + * A value that indicates whether major version upgrades are allowed. Changing this parameter doesn't result in an + * outage and the change is asynchronously applied as soon as possible. Constraints: Major version upgrades must be + * allowed when specifying a value for the ``EngineVersion`` parameter that is a different major version than the DB + * instance's current version. + */ + private Boolean allowMajorVersionUpgrade; + + /* + * The IAMlong (IAM) roles associated with the DB instance. *Amazon Aurora* Not applicable. The associated roles are + * managed by the DB cluster. + */ + private List associatedRoles; + + /* + * A value that indicates whether minor engine upgrades are applied automatically to the DB instance during the + * maintenance window. By default, minor engine upgrades are applied automatically. + */ + private Boolean autoMinorVersionUpgrade; + + /* + * Property automaticBackupReplicationKmsKeyId + */ + private String automaticBackupReplicationKmsKeyId; + + /* + * The destination region for the backup replication of the DB instance. For more info, see [Replicating automated + * backups to another Region](https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_ReplicateBackups.html) in + * the *Amazon RDS User Guide*. + */ + private String automaticBackupReplicationRegion; + + /* + * The Availability Zone (AZ) where the database will be created. For information on AWS-Regions and Availability + * Zones, see [Regions and Availability + * Zones](https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/Concepts.RegionsAndAvailabilityZones.html). For + * Amazon Aurora, each Aurora DB cluster hosts copies of its storage in three separate Availability Zones. Specify + * one of these Availability Zones. Aurora automatically chooses an appropriate Availability Zone if you don't + * specify one. Default: A random, system-chosen Availability Zone in the endpoint's AWS-Region. Constraints: + The + * ``AvailabilityZone`` parameter can't be specified if the DB instance is a Multi-AZ deployment. + The specified + * Availability Zone must be in the same AWS-Region as the current endpoint. Example: ``us-east-1d`` + */ + private String availabilityZone; + + /* + * The number of days for which automated backups are retained. Setting this parameter to a positive number enables + * backups. Setting this parameter to 0 disables automated backups. *Amazon Aurora* Not applicable. The retention + * period for automated backups is managed by the DB cluster. Default: 1 Constraints: + Must be a value from 0 to 35 + * + Can't be set to 0 if the DB instance is a source to read replicas + */ + private Integer backupRetentionPeriod; + + /* + * The identifier of the CA certificate for this DB instance. For more information, see [Using SSL/TLS to encrypt a + * connection to a DB instance](https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/UsingWithRDS.SSL.html) in the + * *Amazon RDS User Guide* and [Using SSL/TLS to encrypt a connection to a DB + * cluster](https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/UsingWithRDS.SSL.html) in the *Amazon + * Aurora User Guide*. + */ + private String caCertificateIdentifier; + + /* + * The details of the DB instance's server certificate. Returns the details of the DB instance’s server certificate. + * For more information, see [Using SSL/TLS to encrypt a connection to a DB + * instance](https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/UsingWithRDS.SSL.html) in the *Amazon RDS User + * Guide* and [Using SSL/TLS to encrypt a connection to a DB + * cluster](https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/UsingWithRDS.SSL.html) in the *Amazon + * Aurora User Guide*. + */ + private CertificateDetails certificateDetails; + + /* + * Specifies whether the DB instance is restarted when you rotate your SSL/TLS certificate. By default, the DB + * instance is restarted when you rotate your SSL/TLS certificate. The certificate is not updated until the DB + * instance is restarted. Set this parameter only if you are *not* using SSL/TLS to connect to the DB instance. If + * you are using SSL/TLS to connect to the DB instance, follow the appropriate instructions for your DB engine to + * rotate your SSL/TLS certificate: + For more information about rotating your SSL/TLS certificate for RDS DB + * engines, see [Rotating Your SSL/TLS + * Certificate.](https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/UsingWithRDS.SSL-certificate-rotation.html) + * in the *Amazon RDS User Guide.* + For more information about rotating your SSL/TLS certificate for Aurora DB + * engines, see [Rotating Your SSL/TLS + * Certificate](https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/UsingWithRDS.SSL-certificate-rotation. + * html) in the *Amazon Aurora User Guide*. This setting doesn't apply to RDS Custom DB instances. + */ + private Boolean certificateRotationRestart; + + /* + * For supported engines, indicates that the DB instance should be associated with the specified character set. + * *Amazon Aurora* Not applicable. The character set is managed by the DB cluster. For more information, see + * [AWS::RDS::DBCluster](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-rds-dbcluster. + * html). + */ + private String characterSetName; + + /* + * Specifies whether to copy tags from the DB instance to snapshots of the DB instance. By default, tags are not + * copied. This setting doesn't apply to Amazon Aurora DB instances. Copying tags to snapshots is managed by the DB + * cluster. Setting this value for an Aurora DB instance has no effect on the DB cluster setting. + */ + private Boolean copyTagsToSnapshot; + + /* + * The instance profile associated with the underlying Amazon EC2 instance of an RDS Custom DB instance. This + * setting is required for RDS Custom. Constraints: + The profile must exist in your account. + The profile must + * have an IAM role that Amazon EC2 has permissions to assume. + The instance profile name and the associated IAM + * role name must start with the prefix ``AWSRDSCustom``. For the list of permissions required for the IAM role, see + * [Configure IAM and your + * VPC](https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/custom-setup-orcl.html#custom-setup-orcl.iam-vpc) in + * the *Amazon RDS User Guide*. + */ + private String customIamInstanceProfile; + + /* + * The identifier of the DB cluster that the instance will belong to. + */ + private String dbClusterIdentifier; + + /* + * The identifier for the Multi-AZ DB cluster snapshot to restore from. For more information on Multi-AZ DB + * clusters, see [Multi-AZ DB cluster + * deployments](https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/multi-az-db-clusters-concepts.html) in the + * *Amazon RDS User Guide*. Constraints: + Must match the identifier of an existing Multi-AZ DB cluster snapshot. + + * Can't be specified when ``DBSnapshotIdentifier`` is specified. + Must be specified when ``DBSnapshotIdentifier`` + * isn't specified. + If you are restoring from a shared manual Multi-AZ DB cluster snapshot, the + * ``DBClusterSnapshotIdentifier`` must be the ARN of the shared snapshot. + Can't be the identifier of an Aurora DB + * cluster snapshot. + */ + private String dbClusterSnapshotIdentifier; + + /* + * Property dbInstanceArn + */ + private String dbInstanceArn; + + /* + * The compute and memory capacity of the DB instance, for example ``db.m5.large``. Not all DB instance classes are + * available in all AWS-Regions, or for all database engines. For the full list of DB instance classes, and + * availability for your engine, see [DB instance + * classes](https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/Concepts.DBInstanceClass.html) in the *Amazon RDS + * User Guide* or [Aurora DB instance + * classes](https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/Concepts.DBInstanceClass.html) in the + * *Amazon Aurora User Guide*. + */ + private String dbInstanceClass; + + /* + * A name for the DB instance. If you specify a name, AWS CloudFormation converts it to lowercase. If you don't + * specify a name, AWS CloudFormation generates a unique physical ID and uses that ID for the DB instance. For more + * information, see [Name + * Type](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-name.html). For information + * about constraints that apply to DB instance identifiers, see [Naming constraints in Amazon + * RDS](https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/CHAP_Limits.html#RDS_Limits.Constraints) in the + * *Amazon RDS User Guide*. If you specify a name, you can't perform updates that require replacement of this + * resource. You can perform updates that require no or some interruption. If you must replace the resource, specify + * a new name. + */ + private String dbInstanceIdentifier; + + /* + * The meaning of this parameter differs according to the database engine you use. If you specify the + * ``DBSnapshotIdentifier`` property, this property only applies to RDS for Oracle. *Amazon Aurora* Not applicable. + * The database name is managed by the DB cluster. *Db2* The name of the database to create when the DB instance is + * created. If this parameter isn't specified, no database is created in the DB instance. Constraints: + Must + * contain 1 to 64 letters or numbers. + Must begin with a letter. Subsequent characters can be letters, + * underscores, or digits (0-9). + Can't be a word reserved by the specified database engine. *MySQL* The name of + * the database to create when the DB instance is created. If this parameter is not specified, no database is + * created in the DB instance. Constraints: + Must contain 1 to 64 letters or numbers. + Can't be a word reserved by + * the specified database engine *MariaDB* The name of the database to create when the DB instance is created. If + * this parameter is not specified, no database is created in the DB instance. Constraints: + Must contain 1 to 64 + * letters or numbers. + Can't be a word reserved by the specified database engine *PostgreSQL* The name of the + * database to create when the DB instance is created. If this parameter is not specified, the default ``postgres`` + * database is created in the DB instance. Constraints: + Must begin with a letter. Subsequent characters can be + * letters, underscores, or digits (0-9). + Must contain 1 to 63 characters. + Can't be a word reserved by the + * specified database engine *Oracle* The Oracle System ID (SID) of the created DB instance. If you specify + * ``null``, the default value ``ORCL`` is used. You can't specify the string NULL, or any other reserved word, for + * ``DBName``. Default: ``ORCL`` Constraints: + Can't be longer than 8 characters *SQL Server* Not applicable. Must + * be null. + */ + private String dbName; + + /* + * The name of an existing DB parameter group or a reference to an + * [AWS::RDS::DBParameterGroup](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-rds- + * dbparametergroup.html) resource created in the template. To list all of the available DB parameter group names, + * use the following command: ``aws rds describe-db-parameter-groups --query + * 'DBParameterGroups[].DBParameterGroupName' --output text`` If any of the data members of the referenced parameter + * group are changed during an update, the DB instance might need to be restarted, which causes some interruption. + * If the parameter group contains static parameters, whether they were changed or not, an update triggers a reboot. + * If you don't specify a value for ``DBParameterGroupName`` property, the default DB parameter group for the + * specified engine and engine version is used. + */ + private String dbParameterGroupName; + + /* + * A list of the DB security groups to assign to the DB instance. The list can include both the name of existing DB + * security groups or references to AWS::RDS::DBSecurityGroup resources created in the template. If you set + * DBSecurityGroups, you must not set VPCSecurityGroups, and vice versa. Also, note that the DBSecurityGroups + * property exists only for backwards compatibility with older regions and is no longer recommended for providing + * security information to an RDS DB instance. Instead, use VPCSecurityGroups. If you specify this property, AWS + * CloudFormation sends only the following properties (if specified) to Amazon RDS during create operations: + + * ``AllocatedStorage`` + ``AutoMinorVersionUpgrade`` + ``AvailabilityZone`` + ``BackupRetentionPeriod`` + + * ``CharacterSetName`` + ``DBInstanceClass`` + ``DBName`` + ``DBParameterGroupName`` + ``DBSecurityGroups`` + + * ``DBSubnetGroupName`` + ``Engine`` + ``EngineVersion`` + ``Iops`` + ``LicenseModel`` + ``MasterUsername`` + + * ``MasterUserPassword`` + ``MultiAZ`` + ``OptionGroupName`` + ``PreferredBackupWindow`` + + * ``PreferredMaintenanceWindow`` All other properties are ignored. Specify a virtual private cloud (VPC) security + * group if you want to submit other properties, such as ``StorageType``, ``StorageEncrypted``, or ``KmsKeyId``. If + * you're already using the ``DBSecurityGroups`` property, you can't use these other properties by updating your DB + * instance to use a VPC security group. You must recreate the DB instance. + */ + private List dbSecurityGroups; + + /* + * The name or Amazon Resource Name (ARN) of the DB snapshot that's used to restore the DB instance. If you're + * restoring from a shared manual DB snapshot, you must specify the ARN of the snapshot. By specifying this + * property, you can create a DB instance from the specified DB snapshot. If the ``DBSnapshotIdentifier`` property + * is an empty string or the ``AWS::RDS::DBInstance`` declaration has no ``DBSnapshotIdentifier`` property, AWS + * CloudFormation creates a new database. If the property contains a value (other than an empty string), AWS + * CloudFormation creates a database from the specified snapshot. If a snapshot with the specified name doesn't + * exist, AWS CloudFormation can't create the database and it rolls back the stack. Some DB instance properties + * aren't valid when you restore from a snapshot, such as the ``MasterUsername`` and ``MasterUserPassword`` + * properties. For information about the properties that you can specify, see the + * ``RestoreDBInstanceFromDBSnapshot`` action in the *Amazon RDS API Reference*. After you restore a DB instance + * with a ``DBSnapshotIdentifier`` property, you must specify the same ``DBSnapshotIdentifier`` property for any + * future updates to the DB instance. When you specify this property for an update, the DB instance is not restored + * from the DB snapshot again, and the data in the database is not changed. However, if you don't specify the + * ``DBSnapshotIdentifier`` property, an empty DB instance is created, and the original DB instance is deleted. If + * you specify a property that is different from the previous snapshot restore property, a new DB instance is + * restored from the specified ``DBSnapshotIdentifier`` property, and the original DB instance is deleted. If you + * specify the ``DBSnapshotIdentifier`` property to restore a DB instance (as opposed to specifying it for DB + * instance updates), then don't specify the following properties: + ``CharacterSetName`` + ``DBClusterIdentifier`` + * + ``DBName`` + ``DeleteAutomatedBackups`` + ``EnablePerformanceInsights`` + ``KmsKeyId`` + ``MasterUsername`` + + * ``MasterUserPassword`` + ``PerformanceInsightsKMSKeyId`` + ``PerformanceInsightsRetentionPeriod`` + + * ``PromotionTier`` + ``SourceDBInstanceIdentifier`` + ``SourceRegion`` + ``StorageEncrypted`` (for an encrypted + * snapshot) + ``Timezone`` *Amazon Aurora* Not applicable. Snapshot restore is managed by the DB cluster. + */ + private String dbSnapshotIdentifier; + + /* + * A DB subnet group to associate with the DB instance. If you update this value, the new subnet group must be a + * subnet group in a new VPC. If there's no DB subnet group, then the DB instance isn't a VPC DB instance. For more + * information about using Amazon RDS in a VPC, see [Using Amazon RDS with Amazon Virtual Private Cloud + * (VPC)](https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_VPC.html) in the *Amazon RDS User Guide*. + * *Amazon Aurora* Not applicable. The DB subnet group is managed by the DB cluster. If specified, the setting must + * match the DB cluster setting. + */ + private String dbSubnetGroupName; + + /* + * The Oracle system identifier (SID), which is the name of the Oracle database instance that manages your database + * files. In this context, the term 'Oracle database instance' refers exclusively to the system global area (SGA) + * and Oracle background processes. If you don't specify a SID, the value defaults to ``RDSCDB``. The Oracle SID is + * also the name of your CDB. + */ + private String dbSystemId; + + /* + * Property dbiResourceId + */ + private String dbiResourceId; + + /* + * Indicates whether the DB instance has a dedicated log volume (DLV) enabled. + */ + private Boolean dedicatedLogVolume; + + /* + * A value that indicates whether to remove automated backups immediately after the DB instance is deleted. This + * parameter isn't case-sensitive. The default is to remove automated backups immediately after the DB instance is + * deleted. *Amazon Aurora* Not applicable. When you delete a DB cluster, all automated backups for that DB cluster + * are deleted and can't be recovered. Manual DB cluster snapshots of the DB cluster are not deleted. + */ + private Boolean deleteAutomatedBackups; + + /* + * A value that indicates whether the DB instance has deletion protection enabled. The database can't be deleted + * when deletion protection is enabled. By default, deletion protection is disabled. For more information, see + * [Deleting a DB Instance](https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_DeleteInstance.html). + * *Amazon Aurora* Not applicable. You can enable or disable deletion protection for the DB cluster. For more + * information, see ``CreateDBCluster``. DB instances in a DB cluster can be deleted even when deletion protection + * is enabled for the DB cluster. + */ + private Boolean deletionProtection; + + /* + * The Active Directory directory ID to create the DB instance in. Currently, only Db2, MySQL, Microsoft SQL Server, + * Oracle, and PostgreSQL DB instances can be created in an Active Directory Domain. For more information, see + * [Kerberos Authentication](https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/kerberos-authentication.html) in + * the *Amazon RDS User Guide*. + */ + private String domain; + + /* + * The ARN for the Secrets Manager secret with the credentials for the user joining the domain. Example: + * ``arn:aws:secretsmanager:region:account-number:secret:myselfmanagedADtestsecret-123456`` + */ + private String domainAuthSecretArn; + + /* + * The IPv4 DNS IP addresses of your primary and secondary Active Directory domain controllers. Constraints: + Two + * IP addresses must be provided. If there isn't a secondary domain controller, use the IP address of the primary + * domain controller for both entries in the list. Example: ``123.124.125.126,234.235.236.237`` + */ + private List domainDnsIps; + + /* + * The fully qualified domain name (FQDN) of an Active Directory domain. Constraints: + Can't be longer than 64 + * characters. Example: ``mymanagedADtest.mymanagedAD.mydomain`` + */ + private String domainFqdn; + + /* + * The name of the IAM role to use when making API calls to the Directory Service. This setting doesn't apply to the + * following DB instances: + Amazon Aurora (The domain is managed by the DB cluster.) + RDS Custom + */ + private String domainIamRoleName; + + /* + * The Active Directory organizational unit for your DB instance to join. Constraints: + Must be in the + * distinguished name format. + Can't be longer than 64 characters. Example: + * ``OU=mymanagedADtestOU,DC=mymanagedADtest,DC=mymanagedAD,DC=mydomain`` + */ + private String domainOu; + + /* + * The list of log types that need to be enabled for exporting to CloudWatch Logs. The values in the list depend on + * the DB engine being used. For more information, see [Publishing Database Logs to Amazon CloudWatch + * Logs](https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_LogAccess.html#USER_LogAccess.Procedural. + * UploadtoCloudWatch) in the *Amazon Relational Database Service User Guide*. *Amazon Aurora* Not applicable. + * CloudWatch Logs exports are managed by the DB cluster. *Db2* Valid values: ``diag.log``, ``notify.log`` *MariaDB* + * Valid values: ``audit``, ``error``, ``general``, ``slowquery`` *Microsoft SQL Server* Valid values: ``agent``, + * ``error`` *MySQL* Valid values: ``audit``, ``error``, ``general``, ``slowquery`` *Oracle* Valid values: + * ``alert``, ``audit``, ``listener``, ``trace``, ``oemagent`` *PostgreSQL* Valid values: ``postgresql``, + * ``upgrade`` + */ + private List enableCloudwatchLogsExports; + + /* + * A value that indicates whether to enable mapping of AWS Identity and Access Management (IAM) accounts to database + * accounts. By default, mapping is disabled. This property is supported for RDS for MariaDB, RDS for MySQL, and RDS + * for PostgreSQL. For more information, see [IAM Database Authentication for MariaDB, MySQL, and + * PostgreSQL](https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/UsingWithRDS.IAMDBAuth.html) in the *Amazon + * RDS User Guide.* *Amazon Aurora* Not applicable. Mapping AWS IAM accounts to database accounts is managed by the + * DB cluster. + */ + private Boolean enableIamDatabaseAuthentication; + + /* + * Specifies whether to enable Performance Insights for the DB instance. For more information, see [Using Amazon + * Performance Insights](https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_PerfInsights.html) in the + * *Amazon RDS User Guide*. This setting doesn't apply to RDS Custom DB instances. + */ + private Boolean enablePerformanceInsights; + + /* + * The connection endpoint for the DB instance. The endpoint might not be shown for instances with the status of + * ``creating``. This data type represents the information you need to connect to an Amazon RDS DB instance. This + * data type is used as a response element in the following actions: + ``CreateDBInstance`` + + * ``DescribeDBInstances`` + ``DeleteDBInstance`` For the data structure that represents Amazon Aurora DB cluster + * endpoints, see ``DBClusterEndpoint``. + */ + private EndpointAutoGenerated2 endpoint; + + /* + * The name of the database engine to use for this DB instance. Not every database engine is available in every AWS + * Region. This property is required when creating a DB instance. You can change the architecture of an Oracle + * database from the non-container database (CDB) architecture to the CDB architecture by updating the ``Engine`` + * value in your templates from ``oracle-ee`` or ``oracle-ee-cdb`` to ``oracle-se2-cdb``. Converting to the CDB + * architecture requires an interruption. Valid Values: + ``aurora-mysql`` (for Aurora MySQL DB instances) + + * ``aurora-postgresql`` (for Aurora PostgreSQL DB instances) + ``custom-oracle-ee`` (for RDS Custom for Oracle DB + * instances) + ``custom-oracle-ee-cdb`` (for RDS Custom for Oracle DB instances) + ``custom-sqlserver-ee`` (for RDS + * Custom for SQL Server DB instances) + ``custom-sqlserver-se`` (for RDS Custom for SQL Server DB instances) + + * ``custom-sqlserver-web`` (for RDS Custom for SQL Server DB instances) + ``db2-ae`` + ``db2-se`` + ``mariadb`` + + * ``mysql`` + ``oracle-ee`` + ``oracle-ee-cdb`` + ``oracle-se2`` + ``oracle-se2-cdb`` + ``postgres`` + + * ``sqlserver-ee`` + ``sqlserver-se`` + ``sqlserver-ex`` + ``sqlserver-web`` + */ + private String engine; + + /* + * The version number of the database engine to use. For a list of valid engine versions, use the + * ``DescribeDBEngineVersions`` action. The following are the database engines and links to information about the + * major and minor versions that are available with Amazon RDS. Not every database engine is available for every AWS + * Region. *Amazon Aurora* Not applicable. The version number of the database engine to be used by the DB instance + * is managed by the DB cluster. *Db2* See [Amazon RDS for + * Db2](https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/CHAP_Db2.html#Db2.Concepts.VersionMgmt) in the + * *Amazon RDS User Guide.* *MariaDB* See [MariaDB on Amazon RDS + * Versions](https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/CHAP_MariaDB.html#MariaDB.Concepts.VersionMgmt) + * in the *Amazon RDS User Guide.* *Microsoft SQL Server* See [Microsoft SQL Server Versions on Amazon + * RDS](https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/CHAP_SQLServer.html#SQLServer.Concepts.General. + * VersionSupport) in the *Amazon RDS User Guide.* *MySQL* See [MySQL on Amazon RDS + * Versions](https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/CHAP_MySQL.html#MySQL.Concepts.VersionMgmt) in + * the *Amazon RDS User Guide.* *Oracle* See [Oracle Database Engine Release + * Notes](https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/Appendix.Oracle.PatchComposition.html) in the + * *Amazon RDS User Guide.* *PostgreSQL* See [Supported PostgreSQL Database + * Versions](https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/CHAP_PostgreSQL.html#PostgreSQL.Concepts.General + * .DBVersions) in the *Amazon RDS User Guide.* + */ + private String engineVersion; + + /* + * The number of I/O operations per second (IOPS) that the database provisions. The value must be equal to or + * greater than 1000. If you specify this property, you must follow the range of allowed ratios of your requested + * IOPS rate to the amount of storage that you allocate (IOPS to allocated storage). For example, you can provision + * an Oracle database instance with 1000 IOPS and 200 GiB of storage (a ratio of 5:1), or specify 2000 IOPS with 200 + * GiB of storage (a ratio of 10:1). For more information, see [Amazon RDS Provisioned IOPS Storage to Improve + * Performance](https://docs.aws.amazon.com/AmazonRDS/latest/DeveloperGuide/CHAP_Storage.html#USER_PIOPS) in the + * *Amazon RDS User Guide*. If you specify ``io1`` for the ``StorageType`` property, then you must also specify the + * ``Iops`` property. Constraints: + For RDS for Db2, MariaDB, MySQL, Oracle, and PostgreSQL - Must be a multiple + * between .5 and 50 of the storage amount for the DB instance. + For RDS for SQL Server - Must be a multiple + * between 1 and 50 of the storage amount for the DB instance. + */ + private Integer iops; + + /* + * The ARN of the AWS KMS key that's used to encrypt the DB instance, such as + * ``arn:aws:kms:us-east-1:012345678910:key/abcd1234-a123-456a-a12b-a123b4cd56ef``. If you enable the + * StorageEncrypted property but don't specify this property, AWS CloudFormation uses the default KMS key. If you + * specify this property, you must set the StorageEncrypted property to true. If you specify the + * ``SourceDBInstanceIdentifier`` property, the value is inherited from the source DB instance if the read replica + * is created in the same region. If you create an encrypted read replica in a different AWS Region, then you must + * specify a KMS key for the destination AWS Region. KMS encryption keys are specific to the region that they're + * created in, and you can't use encryption keys from one region in another region. If you specify the + * ``SnapshotIdentifier`` property, the ``StorageEncrypted`` property value is inherited from the snapshot, and if + * the DB instance is encrypted, the specified ``KmsKeyId`` property is used. If you specify ``DBSecurityGroups``, + * AWS CloudFormation ignores this property. To specify both a security group and this property, you must use a VPC + * security group. For more information about Amazon RDS and VPC, see [Using Amazon RDS with Amazon + * VPC](https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_VPC.html) in the *Amazon RDS User Guide*. + * *Amazon Aurora* Not applicable. The KMS key identifier is managed by the DB cluster. + */ + private String kmsKeyId; + + /* + * License model information for this DB instance. Valid Values: + Aurora MySQL - ``general-public-license`` + + * Aurora PostgreSQL - ``postgresql-license`` + RDS for Db2 - ``bring-your-own-license``. For more information about + * RDS for Db2 licensing, see [](https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/db2-licensing.html) in the + * *Amazon RDS User Guide.* + RDS for MariaDB - ``general-public-license`` + RDS for Microsoft SQL Server - + * ``license-included`` + RDS for MySQL - ``general-public-license`` + RDS for Oracle - ``bring-your-own-license`` + * or ``license-included`` + RDS for PostgreSQL - ``postgresql-license`` If you've specified ``DBSecurityGroups`` + * and then you update the license model, AWS CloudFormation replaces the underlying DB instance. This will incur + * some interruptions to database availability. + */ + private String licenseModel; + + /* + * Specifies whether to manage the master user password with AWS Secrets Manager. For more information, see + * [Password management with Secrets + * Manager](https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/rds-secrets-manager.html) in the *Amazon RDS User + * Guide.* Constraints: + Can't manage the master user password with AWS Secrets Manager if ``MasterUserPassword`` + * is specified. + */ + private Boolean manageMasterUserPassword; + + /* + * The password for the master user. The password can include any printable ASCII character except '/', ''', or '@'. + * *Amazon Aurora* Not applicable. The password for the master user is managed by the DB cluster. *RDS for Db2* Must + * contain from 8 to 255 characters. *RDS for MariaDB* Constraints: Must contain from 8 to 41 characters. *RDS for + * Microsoft SQL Server* Constraints: Must contain from 8 to 128 characters. *RDS for MySQL* Constraints: Must + * contain from 8 to 41 characters. *RDS for Oracle* Constraints: Must contain from 8 to 30 characters. *RDS for + * PostgreSQL* Constraints: Must contain from 8 to 128 characters. + */ + private String masterUserPassword; + + /* + * The secret managed by RDS in AWS Secrets Manager for the master user password. For more information, see + * [Password management with Secrets + * Manager](https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/rds-secrets-manager.html) in the *Amazon RDS User + * Guide.* The ``MasterUserSecret`` return value specifies the secret managed by RDS in AWS Secrets Manager for the + * master user password. For more information, see [Password management with Secrets + * Manager](https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/rds-secrets-manager.html) in the *Amazon RDS User + * Guide* and [Password management with Secrets + * Manager](https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/rds-secrets-manager.html) in the *Amazon + * Aurora User Guide.* + */ + private MasterUserSecret masterUserSecret; + + /* + * The master user name for the DB instance. If you specify the ``SourceDBInstanceIdentifier`` or + * ``DBSnapshotIdentifier`` property, don't specify this property. The value is inherited from the source DB + * instance or snapshot. When migrating a self-managed Db2 database, we recommend that you use the same master + * username as your self-managed Db2 instance name. *Amazon Aurora* Not applicable. The name for the master user is + * managed by the DB cluster. *RDS for Db2* Constraints: + Must be 1 to 16 letters or numbers. + First character + * must be a letter. + Can't be a reserved word for the chosen database engine. *RDS for MariaDB* Constraints: + + * Must be 1 to 16 letters or numbers. + Can't be a reserved word for the chosen database engine. *RDS for Microsoft + * SQL Server* Constraints: + Must be 1 to 128 letters or numbers. + First character must be a letter. + Can't be a + * reserved word for the chosen database engine. *RDS for MySQL* Constraints: + Must be 1 to 16 letters or numbers. + * + First character must be a letter. + Can't be a reserved word for the chosen database engine. *RDS for Oracle* + * Constraints: + Must be 1 to 30 letters or numbers. + First character must be a letter. + Can't be a reserved word + * for the chosen database engine. *RDS for PostgreSQL* Constraints: + Must be 1 to 63 letters or numbers. + First + * character must be a letter. + Can't be a reserved word for the chosen database engine. + */ + private String masterUsername; + + /* + * The upper limit in gibibytes (GiB) to which Amazon RDS can automatically scale the storage of the DB instance. + * For more information about this setting, including limitations that apply to it, see [Managing capacity + * automatically with Amazon RDS storage + * autoscaling](https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_PIOPS.StorageTypes.html#USER_PIOPS. + * Autoscaling) in the *Amazon RDS User Guide*. This setting doesn't apply to the following DB instances: + Amazon + * Aurora (Storage is managed by the DB cluster.) + RDS Custom + */ + private Integer maxAllocatedStorage; + + /* + * The interval, in seconds, between points when Enhanced Monitoring metrics are collected for the DB instance. To + * disable collection of Enhanced Monitoring metrics, specify 0. The default is 0. If ``MonitoringRoleArn`` is + * specified, then you must set ``MonitoringInterval`` to a value other than 0. This setting doesn't apply to RDS + * Custom. Valid Values: ``0, 1, 5, 10, 15, 30, 60`` + */ + private Integer monitoringInterval; + + /* + * The ARN for the IAM role that permits RDS to send enhanced monitoring metrics to Amazon CloudWatch Logs. For + * example, ``arn:aws:iam:123456789012:role/emaccess``. For information on creating a monitoring role, see [Setting + * Up and Enabling Enhanced + * Monitoring](https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_Monitoring.OS.html#USER_Monitoring.OS. + * Enabling) in the *Amazon RDS User Guide*. If ``MonitoringInterval`` is set to a value other than ``0``, then you + * must supply a ``MonitoringRoleArn`` value. This setting doesn't apply to RDS Custom DB instances. + */ + private String monitoringRoleArn; + + /* + * Specifies whether the database instance is a Multi-AZ DB instance deployment. You can't set the + * ``AvailabilityZone`` parameter if the ``MultiAZ`` parameter is set to true. For more information, see [Multi-AZ + * deployments for high availability](https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/Concepts.MultiAZ.html) + * in the *Amazon RDS User Guide*. *Amazon Aurora* Not applicable. Amazon Aurora storage is replicated across all of + * the Availability Zones and doesn't require the ``MultiAZ`` option to be set. + */ + private Boolean multiAZ; + + /* + * The name of the NCHAR character set for the Oracle DB instance. This setting doesn't apply to RDS Custom DB + * instances. + */ + private String ncharCharacterSetName; + + /* + * The network type of the DB instance. Valid values: + ``IPV4`` + ``DUAL`` The network type is determined by the + * ``DBSubnetGroup`` specified for the DB instance. A ``DBSubnetGroup`` can support only the IPv4 protocol or the + * IPv4 and IPv6 protocols (``DUAL``). For more information, see [Working with a DB instance in a + * VPC](https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_VPC.WorkingWithRDSInstanceinaVPC.html) in the + * *Amazon RDS User Guide.* + */ + private String networkType; + + /* + * Indicates that the DB instance should be associated with the specified option group. Permanent options, such as + * the TDE option for Oracle Advanced Security TDE, can't be removed from an option group. Also, that option group + * can't be removed from a DB instance once it is associated with a DB instance. + */ + private String optionGroupName; + + /* + * The AWS KMS key identifier for encryption of Performance Insights data. The KMS key identifier is the key ARN, + * key ID, alias ARN, or alias name for the KMS key. If you do not specify a value for + * ``PerformanceInsightsKMSKeyId``, then Amazon RDS uses your default KMS key. There is a default KMS key for your + * AWS account. Your AWS account has a different default KMS key for each AWS Region. For information about enabling + * Performance Insights, see + * [EnablePerformanceInsights](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-rds- + * database-instance.html#cfn-rds-dbinstance-enableperformanceinsights). + */ + private String performanceInsightsKmsKeyId; + + /* + * The number of days to retain Performance Insights data. This setting doesn't apply to RDS Custom DB instances. + * Valid Values: + ``7`` + *month* * 31, where *month* is a number of months from 1-23. Examples: ``93`` (3 months * + * 31), ``341`` (11 months * 31), ``589`` (19 months * 31) + ``731`` Default: ``7`` days If you specify a retention + * period that isn't valid, such as ``94``, Amazon RDS returns an error. + */ + private Integer performanceInsightsRetentionPeriod; + + /* + * The port number on which the database accepts connections. *Amazon Aurora* Not applicable. The port number is + * managed by the DB cluster. *Db2* Default value: ``50000`` + */ + private String port; + + /* + * The daily time range during which automated backups are created if automated backups are enabled, using the + * ``BackupRetentionPeriod`` parameter. For more information, see [Backup + * Window](https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_WorkingWithAutomatedBackups.html# + * USER_WorkingWithAutomatedBackups.BackupWindow) in the *Amazon RDS User Guide.* Constraints: + Must be in the + * format ``hh24:mi-hh24:mi``. + Must be in Universal Coordinated Time (UTC). + Must not conflict with the preferred + * maintenance window. + Must be at least 30 minutes. *Amazon Aurora* Not applicable. The daily time range for + * creating automated backups is managed by the DB cluster. + */ + private String preferredBackupWindow; + + /* + * The weekly time range during which system maintenance can occur, in Universal Coordinated Time (UTC). Format: + * ``ddd:hh24:mi-ddd:hh24:mi`` The default is a 30-minute window selected at random from an 8-hour block of time for + * each AWS Region, occurring on a random day of the week. To see the time blocks available, see [Adjusting the + * Preferred DB Instance Maintenance + * Window](https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_UpgradeDBInstance.Maintenance.html# + * AdjustingTheMaintenanceWindow) in the *Amazon RDS User Guide.* This property applies when AWS CloudFormation + * initially creates the DB instance. If you use AWS CloudFormation to update the DB instance, those updates are + * applied immediately. Constraints: Minimum 30-minute window. + */ + private String preferredMaintenanceWindow; + + /* + * The number of CPU cores and the number of threads per core for the DB instance class of the DB instance. This + * setting doesn't apply to Amazon Aurora or RDS Custom DB instances. + */ + private List processorFeatures; + + /* + * The order of priority in which an Aurora Replica is promoted to the primary instance after a failure of the + * existing primary instance. For more information, see [Fault Tolerance for an Aurora DB + * Cluster](https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/Concepts.AuroraHighAvailability.html#Aurora + * .Managing.FaultTolerance) in the *Amazon Aurora User Guide*. This setting doesn't apply to RDS Custom DB + * instances. Default: ``1`` Valid Values: ``0 - 15`` + */ + private Integer promotionTier; + + /* + * Indicates whether the DB instance is an internet-facing instance. If you specify true, AWS CloudFormation creates + * an instance with a publicly resolvable DNS name, which resolves to a public IP address. If you specify false, AWS + * CloudFormation creates an internal instance with a DNS name that resolves to a private IP address. The default + * behavior value depends on your VPC setup and the database subnet group. For more information, see the + * ``PubliclyAccessible`` parameter in the + * [CreateDBInstance](https://docs.aws.amazon.com/AmazonRDS/latest/APIReference/API_CreateDBInstance.html) in the + * *Amazon RDS API Reference*. + */ + private Boolean publiclyAccessible; + + /* + * The open mode of an Oracle read replica. For more information, see [Working with Oracle Read Replicas for Amazon + * RDS](https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/oracle-read-replicas.html) in the *Amazon RDS User + * Guide*. This setting is only supported in RDS for Oracle. Default: ``open-read-only`` Valid Values: + * ``open-read-only`` or ``mounted`` + */ + private String replicaMode; + + /* + * The date and time to restore from. Constraints: + Must be a time in Universal Coordinated Time (UTC) format. + + * Must be before the latest restorable time for the DB instance. + Can't be specified if the + * ``UseLatestRestorableTime`` parameter is enabled. Example: ``2009-09-07T23:45:00Z`` + */ + private String restoreTime; + + /* + * The identifier of the Multi-AZ DB cluster that will act as the source for the read replica. Each DB cluster can + * have up to 15 read replicas. Constraints: + Must be the identifier of an existing Multi-AZ DB cluster. + Can't be + * specified if the ``SourceDBInstanceIdentifier`` parameter is also specified. + The specified DB cluster must have + * automatic backups enabled, that is, its backup retention period must be greater than 0. + The source DB cluster + * must be in the same AWS-Region as the read replica. Cross-Region replication isn't supported. + */ + private String sourceDBClusterIdentifier; + + /* + * The Amazon Resource Name (ARN) of the replicated automated backups from which to restore, for example, + * ``arn:aws:rds:us-east-1:123456789012:auto-backup:ab-L2IJCEXJP7XQ7HOJ4SIEXAMPLE``. This setting doesn't apply to + * RDS Custom. + */ + private String sourceDBInstanceAutomatedBackupsArn; + + /* + * If you want to create a read replica DB instance, specify the ID of the source DB instance. Each DB instance can + * have a limited number of read replicas. For more information, see [Working with Read + * Replicas](https://docs.aws.amazon.com/AmazonRDS/latest/DeveloperGuide/USER_ReadRepl.html) in the *Amazon RDS User + * Guide*. For information about constraints that apply to DB instance identifiers, see [Naming constraints in + * Amazon RDS](https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/CHAP_Limits.html#RDS_Limits.Constraints) in + * the *Amazon RDS User Guide*. The ``SourceDBInstanceIdentifier`` property determines whether a DB instance is a + * read replica. If you remove the ``SourceDBInstanceIdentifier`` property from your template and then update your + * stack, AWS CloudFormation promotes the Read Replica to a standalone DB instance. + If you specify a source DB + * instance that uses VPC security groups, we recommend that you specify the ``VPCSecurityGroups`` property. If you + * don't specify the property, the read replica inherits the value of the ``VPCSecurityGroups`` property from the + * source DB when you create the replica. However, if you update the stack, AWS CloudFormation reverts the replica's + * ``VPCSecurityGroups`` property to the default value because it's not defined in the stack's template. This change + * might cause unexpected issues. + Read replicas don't support deletion policies. AWS CloudFormation ignores any + * deletion policy that's associated with a read replica. + If you specify ``SourceDBInstanceIdentifier``, don't + * specify the ``DBSnapshotIdentifier`` property. You can't create a read replica from a snapshot. + Don't set the + * ``BackupRetentionPeriod``, ``DBName``, ``MasterUsername``, ``MasterUserPassword``, and ``PreferredBackupWindow`` + * properties. The database attributes are inherited from the source DB instance, and backups are disabled for read + * replicas. + If the source DB instance is in a different region than the read replica, specify the source region + * in ``SourceRegion``, and specify an ARN for a valid DB instance in ``SourceDBInstanceIdentifier``. For more + * information, see [Constructing a Amazon RDS Amazon Resource Name + * (ARN)](https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_Tagging.html#USER_Tagging.ARN) in the *Amazon + * RDS User Guide*. + For DB instances in Amazon Aurora clusters, don't specify this property. Amazon RDS + * automatically assigns writer and reader DB instances. + */ + private String sourceDBInstanceIdentifier; + + /* + * The resource ID of the source DB instance from which to restore. + */ + private String sourceDbiResourceId; + + /* + * The ID of the region that contains the source DB instance for the read replica. + */ + private String sourceRegion; + + /* + * A value that indicates whether the DB instance is encrypted. By default, it isn't encrypted. If you specify the + * ``KmsKeyId`` property, then you must enable encryption. If you specify the ``SourceDBInstanceIdentifier`` + * property, don't specify this property. The value is inherited from the source DB instance, and if the DB instance + * is encrypted, the specified ``KmsKeyId`` property is used. If you specify the ``DBSnapshotIdentifier`` and the + * specified snapshot is encrypted, don't specify this property. The value is inherited from the snapshot, and the + * specified ``KmsKeyId`` property is used. If you specify the ``DBSnapshotIdentifier`` and the specified snapshot + * isn't encrypted, you can use this property to specify that the restored DB instance is encrypted. Specify the + * ``KmsKeyId`` property for the KMS key to use for encryption. If you don't want the restored DB instance to be + * encrypted, then don't set this property or set it to ``false``. *Amazon Aurora* Not applicable. The encryption + * for DB instances is managed by the DB cluster. + */ + private Boolean storageEncrypted; + + /* + * Specifies the storage throughput value for the DB instance. This setting applies only to the ``gp3`` storage + * type. This setting doesn't apply to RDS Custom or Amazon Aurora. + */ + private Integer storageThroughput; + + /* + * The storage type to associate with the DB instance. If you specify ``io1``, ``io2``, or ``gp3``, you must also + * include a value for the ``Iops`` parameter. This setting doesn't apply to Amazon Aurora DB instances. Storage is + * managed by the DB cluster. Valid Values: ``gp2 | gp3 | io1 | io2 | standard`` Default: ``io1``, if the ``Iops`` + * parameter is specified. Otherwise, ``gp2``. + */ + private String storageType; + + /* + * An optional array of key-value pairs to apply to this DB instance. + */ + private List tags; + + /* + * Property tdeCredentialArn + */ + private String tdeCredentialArn; + + /* + * Property tdeCredentialPassword + */ + private String tdeCredentialPassword; + + /* + * The time zone of the DB instance. The time zone parameter is currently supported only by [Microsoft SQL + * Server](https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/CHAP_SQLServer.html#SQLServer.Concepts.General. + * TimeZone). + */ + private String timezone; + + /* + * Specifies whether the DB instance class of the DB instance uses its default processor features. This setting + * doesn't apply to RDS Custom DB instances. + */ + private Boolean useDefaultProcessorFeatures; + + /* + * Specifies whether the DB instance is restored from the latest backup time. By default, the DB instance isn't + * restored from the latest backup time. Constraints: + Can't be specified if the ``RestoreTime`` parameter is + * provided. + */ + private Boolean useLatestRestorableTime; + + /* + * A list of the VPC security group IDs to assign to the DB instance. The list can include both the physical IDs of + * existing VPC security groups and references to + * [AWS::EC2::SecurityGroup](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ec2- + * security-group.html) resources created in the template. If you plan to update the resource, don't specify VPC + * security groups in a shared VPC. If you set ``VPCSecurityGroups``, you must not set + * [DBSecurityGroups](https://docs.aws.amazon.com//AWSCloudFormation/latest/UserGuide/aws-properties-rds-database- + * instance.html#cfn-rds-dbinstance-dbsecuritygroups), and vice versa. You can migrate a DB instance in your stack + * from an RDS DB security group to a VPC security group, but keep the following in mind: + You can't revert to + * using an RDS security group after you establish a VPC security group membership. + When you migrate your DB + * instance to VPC security groups, if your stack update rolls back because the DB instance update fails or because + * an update fails in another AWS CloudFormation resource, the rollback fails because it can't revert to an RDS + * security group. + To use the properties that are available when you use a VPC security group, you must recreate + * the DB instance. If you don't, AWS CloudFormation submits only the property values that are listed in the + * [DBSecurityGroups](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-rds-database- + * instance.html#cfn-rds-dbinstance-dbsecuritygroups) property. To avoid this situation, migrate your DB instance to + * using VPC security groups only when that is the only change in your stack template. *Amazon Aurora* Not + * applicable. The associated list of EC2 VPC security groups is managed by the DB cluster. If specified, the + * setting must match the DB cluster setting. + */ + private List vpcSecurityGroups; + + /** + * Creates an instance of AwsRdsDBInstanceProperties class. + */ + public AwsRdsDBInstanceProperties() { + } + + /** + * Get the allocatedStorage property: The amount of storage in gibibytes (GiB) to be initially allocated for the + * database instance. If any value is set in the ``Iops`` parameter, ``AllocatedStorage`` must be at least 100 GiB, + * which corresponds to the minimum Iops value of 1,000. If you increase the ``Iops`` value (in 1,000 IOPS + * increments), then you must also increase the ``AllocatedStorage`` value (in 100-GiB increments). *Amazon Aurora* + * Not applicable. Aurora cluster volumes automatically grow as the amount of data in your database increases, + * though you are only charged for the space that you use in an Aurora cluster volume. *Db2* Constraints to the + * amount of storage for each storage type are the following: + General Purpose (SSD) storage (gp3): Must be an + * integer from 20 to 64000. + Provisioned IOPS storage (io1): Must be an integer from 100 to 64000. *MySQL* + * Constraints to the amount of storage for each storage type are the following: + General Purpose (SSD) storage + * (gp2): Must be an integer from 20 to 65536. + Provisioned IOPS storage (io1): Must be an integer from 100 to + * 65536. + Magnetic storage (standard): Must be an integer from 5 to 3072. *MariaDB* Constraints to the amount of + * storage for each storage type are the following: + General Purpose (SSD) storage (gp2): Must be an integer from + * 20 to 65536. + Provisioned IOPS storage (io1): Must be an integer from 100 to 65536. + Magnetic storage + * (standard): Must be an integer from 5 to 3072. *PostgreSQL* Constraints to the amount of storage for each storage + * type are the following: + General Purpose (SSD) storage (gp2): Must be an integer from 20 to 65536. + Provisioned + * IOPS storage (io1): Must be an integer from 100 to 65536. + Magnetic storage (standard): Must be an integer from + * 5 to 3072. *Oracle* Constraints to the amount of storage for each storage type are the following: + General + * Purpose (SSD) storage (gp2): Must be an integer from 20 to 65536. + Provisioned IOPS storage (io1): Must be an + * integer from 100 to 65536. + Magnetic storage (standard): Must be an integer from 10 to 3072. *SQL Server* + * Constraints to the amount of storage for each storage type are the following: + General Purpose (SSD) storage + * (gp2): + Enterprise and Standard editions: Must be an integer from 20 to 16384. + Web and Express editions: Must + * be an integer from 20 to 16384. + Provisioned IOPS storage (io1): + Enterprise and Standard editions: Must be an + * integer from 20 to 16384. + Web and Express editions: Must be an integer from 20 to 16384. + Magnetic storage + * (standard): + Enterprise and Standard editions: Must be an integer from 20 to 1024. + Web and Express editions: + * Must be an integer from 20 to 1024. + * + * @return the allocatedStorage value. + */ + public String allocatedStorage() { + return this.allocatedStorage; + } + + /** + * Set the allocatedStorage property: The amount of storage in gibibytes (GiB) to be initially allocated for the + * database instance. If any value is set in the ``Iops`` parameter, ``AllocatedStorage`` must be at least 100 GiB, + * which corresponds to the minimum Iops value of 1,000. If you increase the ``Iops`` value (in 1,000 IOPS + * increments), then you must also increase the ``AllocatedStorage`` value (in 100-GiB increments). *Amazon Aurora* + * Not applicable. Aurora cluster volumes automatically grow as the amount of data in your database increases, + * though you are only charged for the space that you use in an Aurora cluster volume. *Db2* Constraints to the + * amount of storage for each storage type are the following: + General Purpose (SSD) storage (gp3): Must be an + * integer from 20 to 64000. + Provisioned IOPS storage (io1): Must be an integer from 100 to 64000. *MySQL* + * Constraints to the amount of storage for each storage type are the following: + General Purpose (SSD) storage + * (gp2): Must be an integer from 20 to 65536. + Provisioned IOPS storage (io1): Must be an integer from 100 to + * 65536. + Magnetic storage (standard): Must be an integer from 5 to 3072. *MariaDB* Constraints to the amount of + * storage for each storage type are the following: + General Purpose (SSD) storage (gp2): Must be an integer from + * 20 to 65536. + Provisioned IOPS storage (io1): Must be an integer from 100 to 65536. + Magnetic storage + * (standard): Must be an integer from 5 to 3072. *PostgreSQL* Constraints to the amount of storage for each storage + * type are the following: + General Purpose (SSD) storage (gp2): Must be an integer from 20 to 65536. + Provisioned + * IOPS storage (io1): Must be an integer from 100 to 65536. + Magnetic storage (standard): Must be an integer from + * 5 to 3072. *Oracle* Constraints to the amount of storage for each storage type are the following: + General + * Purpose (SSD) storage (gp2): Must be an integer from 20 to 65536. + Provisioned IOPS storage (io1): Must be an + * integer from 100 to 65536. + Magnetic storage (standard): Must be an integer from 10 to 3072. *SQL Server* + * Constraints to the amount of storage for each storage type are the following: + General Purpose (SSD) storage + * (gp2): + Enterprise and Standard editions: Must be an integer from 20 to 16384. + Web and Express editions: Must + * be an integer from 20 to 16384. + Provisioned IOPS storage (io1): + Enterprise and Standard editions: Must be an + * integer from 20 to 16384. + Web and Express editions: Must be an integer from 20 to 16384. + Magnetic storage + * (standard): + Enterprise and Standard editions: Must be an integer from 20 to 1024. + Web and Express editions: + * Must be an integer from 20 to 1024. + * + * @param allocatedStorage the allocatedStorage value to set. + * @return the AwsRdsDBInstanceProperties object itself. + */ + public AwsRdsDBInstanceProperties withAllocatedStorage(String allocatedStorage) { + this.allocatedStorage = allocatedStorage; + return this; + } + + /** + * Get the allowMajorVersionUpgrade property: A value that indicates whether major version upgrades are allowed. + * Changing this parameter doesn't result in an outage and the change is asynchronously applied as soon as possible. + * Constraints: Major version upgrades must be allowed when specifying a value for the ``EngineVersion`` parameter + * that is a different major version than the DB instance's current version. + * + * @return the allowMajorVersionUpgrade value. + */ + public Boolean allowMajorVersionUpgrade() { + return this.allowMajorVersionUpgrade; + } + + /** + * Set the allowMajorVersionUpgrade property: A value that indicates whether major version upgrades are allowed. + * Changing this parameter doesn't result in an outage and the change is asynchronously applied as soon as possible. + * Constraints: Major version upgrades must be allowed when specifying a value for the ``EngineVersion`` parameter + * that is a different major version than the DB instance's current version. + * + * @param allowMajorVersionUpgrade the allowMajorVersionUpgrade value to set. + * @return the AwsRdsDBInstanceProperties object itself. + */ + public AwsRdsDBInstanceProperties withAllowMajorVersionUpgrade(Boolean allowMajorVersionUpgrade) { + this.allowMajorVersionUpgrade = allowMajorVersionUpgrade; + return this; + } + + /** + * Get the associatedRoles property: The IAMlong (IAM) roles associated with the DB instance. *Amazon Aurora* Not + * applicable. The associated roles are managed by the DB cluster. + * + * @return the associatedRoles value. + */ + public List associatedRoles() { + return this.associatedRoles; + } + + /** + * Set the associatedRoles property: The IAMlong (IAM) roles associated with the DB instance. *Amazon Aurora* Not + * applicable. The associated roles are managed by the DB cluster. + * + * @param associatedRoles the associatedRoles value to set. + * @return the AwsRdsDBInstanceProperties object itself. + */ + public AwsRdsDBInstanceProperties withAssociatedRoles(List associatedRoles) { + this.associatedRoles = associatedRoles; + return this; + } + + /** + * Get the autoMinorVersionUpgrade property: A value that indicates whether minor engine upgrades are applied + * automatically to the DB instance during the maintenance window. By default, minor engine upgrades are applied + * automatically. + * + * @return the autoMinorVersionUpgrade value. + */ + public Boolean autoMinorVersionUpgrade() { + return this.autoMinorVersionUpgrade; + } + + /** + * Set the autoMinorVersionUpgrade property: A value that indicates whether minor engine upgrades are applied + * automatically to the DB instance during the maintenance window. By default, minor engine upgrades are applied + * automatically. + * + * @param autoMinorVersionUpgrade the autoMinorVersionUpgrade value to set. + * @return the AwsRdsDBInstanceProperties object itself. + */ + public AwsRdsDBInstanceProperties withAutoMinorVersionUpgrade(Boolean autoMinorVersionUpgrade) { + this.autoMinorVersionUpgrade = autoMinorVersionUpgrade; + return this; + } + + /** + * Get the automaticBackupReplicationKmsKeyId property: Property automaticBackupReplicationKmsKeyId. + * + * @return the automaticBackupReplicationKmsKeyId value. + */ + public String automaticBackupReplicationKmsKeyId() { + return this.automaticBackupReplicationKmsKeyId; + } + + /** + * Set the automaticBackupReplicationKmsKeyId property: Property automaticBackupReplicationKmsKeyId. + * + * @param automaticBackupReplicationKmsKeyId the automaticBackupReplicationKmsKeyId value to set. + * @return the AwsRdsDBInstanceProperties object itself. + */ + public AwsRdsDBInstanceProperties + withAutomaticBackupReplicationKmsKeyId(String automaticBackupReplicationKmsKeyId) { + this.automaticBackupReplicationKmsKeyId = automaticBackupReplicationKmsKeyId; + return this; + } + + /** + * Get the automaticBackupReplicationRegion property: The destination region for the backup replication of the DB + * instance. For more info, see [Replicating automated backups to another + * Region](https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_ReplicateBackups.html) in the *Amazon RDS + * User Guide*. + * + * @return the automaticBackupReplicationRegion value. + */ + public String automaticBackupReplicationRegion() { + return this.automaticBackupReplicationRegion; + } + + /** + * Set the automaticBackupReplicationRegion property: The destination region for the backup replication of the DB + * instance. For more info, see [Replicating automated backups to another + * Region](https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_ReplicateBackups.html) in the *Amazon RDS + * User Guide*. + * + * @param automaticBackupReplicationRegion the automaticBackupReplicationRegion value to set. + * @return the AwsRdsDBInstanceProperties object itself. + */ + public AwsRdsDBInstanceProperties withAutomaticBackupReplicationRegion(String automaticBackupReplicationRegion) { + this.automaticBackupReplicationRegion = automaticBackupReplicationRegion; + return this; + } + + /** + * Get the availabilityZone property: The Availability Zone (AZ) where the database will be created. For information + * on AWS-Regions and Availability Zones, see [Regions and Availability + * Zones](https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/Concepts.RegionsAndAvailabilityZones.html). For + * Amazon Aurora, each Aurora DB cluster hosts copies of its storage in three separate Availability Zones. Specify + * one of these Availability Zones. Aurora automatically chooses an appropriate Availability Zone if you don't + * specify one. Default: A random, system-chosen Availability Zone in the endpoint's AWS-Region. Constraints: + The + * ``AvailabilityZone`` parameter can't be specified if the DB instance is a Multi-AZ deployment. + The specified + * Availability Zone must be in the same AWS-Region as the current endpoint. Example: ``us-east-1d``. + * + * @return the availabilityZone value. + */ + public String availabilityZone() { + return this.availabilityZone; + } + + /** + * Set the availabilityZone property: The Availability Zone (AZ) where the database will be created. For information + * on AWS-Regions and Availability Zones, see [Regions and Availability + * Zones](https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/Concepts.RegionsAndAvailabilityZones.html). For + * Amazon Aurora, each Aurora DB cluster hosts copies of its storage in three separate Availability Zones. Specify + * one of these Availability Zones. Aurora automatically chooses an appropriate Availability Zone if you don't + * specify one. Default: A random, system-chosen Availability Zone in the endpoint's AWS-Region. Constraints: + The + * ``AvailabilityZone`` parameter can't be specified if the DB instance is a Multi-AZ deployment. + The specified + * Availability Zone must be in the same AWS-Region as the current endpoint. Example: ``us-east-1d``. + * + * @param availabilityZone the availabilityZone value to set. + * @return the AwsRdsDBInstanceProperties object itself. + */ + public AwsRdsDBInstanceProperties withAvailabilityZone(String availabilityZone) { + this.availabilityZone = availabilityZone; + return this; + } + + /** + * Get the backupRetentionPeriod property: The number of days for which automated backups are retained. Setting this + * parameter to a positive number enables backups. Setting this parameter to 0 disables automated backups. *Amazon + * Aurora* Not applicable. The retention period for automated backups is managed by the DB cluster. Default: 1 + * Constraints: + Must be a value from 0 to 35 + Can't be set to 0 if the DB instance is a source to read replicas. + * + * @return the backupRetentionPeriod value. + */ + public Integer backupRetentionPeriod() { + return this.backupRetentionPeriod; + } + + /** + * Set the backupRetentionPeriod property: The number of days for which automated backups are retained. Setting this + * parameter to a positive number enables backups. Setting this parameter to 0 disables automated backups. *Amazon + * Aurora* Not applicable. The retention period for automated backups is managed by the DB cluster. Default: 1 + * Constraints: + Must be a value from 0 to 35 + Can't be set to 0 if the DB instance is a source to read replicas. + * + * @param backupRetentionPeriod the backupRetentionPeriod value to set. + * @return the AwsRdsDBInstanceProperties object itself. + */ + public AwsRdsDBInstanceProperties withBackupRetentionPeriod(Integer backupRetentionPeriod) { + this.backupRetentionPeriod = backupRetentionPeriod; + return this; + } + + /** + * Get the caCertificateIdentifier property: The identifier of the CA certificate for this DB instance. For more + * information, see [Using SSL/TLS to encrypt a connection to a DB + * instance](https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/UsingWithRDS.SSL.html) in the *Amazon RDS User + * Guide* and [Using SSL/TLS to encrypt a connection to a DB + * cluster](https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/UsingWithRDS.SSL.html) in the *Amazon + * Aurora User Guide*. + * + * @return the caCertificateIdentifier value. + */ + public String caCertificateIdentifier() { + return this.caCertificateIdentifier; + } + + /** + * Set the caCertificateIdentifier property: The identifier of the CA certificate for this DB instance. For more + * information, see [Using SSL/TLS to encrypt a connection to a DB + * instance](https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/UsingWithRDS.SSL.html) in the *Amazon RDS User + * Guide* and [Using SSL/TLS to encrypt a connection to a DB + * cluster](https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/UsingWithRDS.SSL.html) in the *Amazon + * Aurora User Guide*. + * + * @param caCertificateIdentifier the caCertificateIdentifier value to set. + * @return the AwsRdsDBInstanceProperties object itself. + */ + public AwsRdsDBInstanceProperties withCaCertificateIdentifier(String caCertificateIdentifier) { + this.caCertificateIdentifier = caCertificateIdentifier; + return this; + } + + /** + * Get the certificateDetails property: The details of the DB instance's server certificate. Returns the details of + * the DB instance’s server certificate. For more information, see [Using SSL/TLS to encrypt a connection to a DB + * instance](https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/UsingWithRDS.SSL.html) in the *Amazon RDS User + * Guide* and [Using SSL/TLS to encrypt a connection to a DB + * cluster](https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/UsingWithRDS.SSL.html) in the *Amazon + * Aurora User Guide*. + * + * @return the certificateDetails value. + */ + public CertificateDetails certificateDetails() { + return this.certificateDetails; + } + + /** + * Set the certificateDetails property: The details of the DB instance's server certificate. Returns the details of + * the DB instance’s server certificate. For more information, see [Using SSL/TLS to encrypt a connection to a DB + * instance](https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/UsingWithRDS.SSL.html) in the *Amazon RDS User + * Guide* and [Using SSL/TLS to encrypt a connection to a DB + * cluster](https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/UsingWithRDS.SSL.html) in the *Amazon + * Aurora User Guide*. + * + * @param certificateDetails the certificateDetails value to set. + * @return the AwsRdsDBInstanceProperties object itself. + */ + public AwsRdsDBInstanceProperties withCertificateDetails(CertificateDetails certificateDetails) { + this.certificateDetails = certificateDetails; + return this; + } + + /** + * Get the certificateRotationRestart property: Specifies whether the DB instance is restarted when you rotate your + * SSL/TLS certificate. By default, the DB instance is restarted when you rotate your SSL/TLS certificate. The + * certificate is not updated until the DB instance is restarted. Set this parameter only if you are *not* using + * SSL/TLS to connect to the DB instance. If you are using SSL/TLS to connect to the DB instance, follow the + * appropriate instructions for your DB engine to rotate your SSL/TLS certificate: + For more information about + * rotating your SSL/TLS certificate for RDS DB engines, see [Rotating Your SSL/TLS + * Certificate.](https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/UsingWithRDS.SSL-certificate-rotation.html) + * in the *Amazon RDS User Guide.* + For more information about rotating your SSL/TLS certificate for Aurora DB + * engines, see [Rotating Your SSL/TLS + * Certificate](https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/UsingWithRDS.SSL-certificate-rotation.html) + * in the *Amazon Aurora User Guide*. This setting doesn't apply to RDS Custom DB instances. + * + * @return the certificateRotationRestart value. + */ + public Boolean certificateRotationRestart() { + return this.certificateRotationRestart; + } + + /** + * Set the certificateRotationRestart property: Specifies whether the DB instance is restarted when you rotate your + * SSL/TLS certificate. By default, the DB instance is restarted when you rotate your SSL/TLS certificate. The + * certificate is not updated until the DB instance is restarted. Set this parameter only if you are *not* using + * SSL/TLS to connect to the DB instance. If you are using SSL/TLS to connect to the DB instance, follow the + * appropriate instructions for your DB engine to rotate your SSL/TLS certificate: + For more information about + * rotating your SSL/TLS certificate for RDS DB engines, see [Rotating Your SSL/TLS + * Certificate.](https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/UsingWithRDS.SSL-certificate-rotation.html) + * in the *Amazon RDS User Guide.* + For more information about rotating your SSL/TLS certificate for Aurora DB + * engines, see [Rotating Your SSL/TLS + * Certificate](https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/UsingWithRDS.SSL-certificate-rotation.html) + * in the *Amazon Aurora User Guide*. This setting doesn't apply to RDS Custom DB instances. + * + * @param certificateRotationRestart the certificateRotationRestart value to set. + * @return the AwsRdsDBInstanceProperties object itself. + */ + public AwsRdsDBInstanceProperties withCertificateRotationRestart(Boolean certificateRotationRestart) { + this.certificateRotationRestart = certificateRotationRestart; + return this; + } + + /** + * Get the characterSetName property: For supported engines, indicates that the DB instance should be associated + * with the specified character set. *Amazon Aurora* Not applicable. The character set is managed by the DB cluster. + * For more information, see + * [AWS::RDS::DBCluster](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-rds-dbcluster.html). + * + * @return the characterSetName value. + */ + public String characterSetName() { + return this.characterSetName; + } + + /** + * Set the characterSetName property: For supported engines, indicates that the DB instance should be associated + * with the specified character set. *Amazon Aurora* Not applicable. The character set is managed by the DB cluster. + * For more information, see + * [AWS::RDS::DBCluster](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-rds-dbcluster.html). + * + * @param characterSetName the characterSetName value to set. + * @return the AwsRdsDBInstanceProperties object itself. + */ + public AwsRdsDBInstanceProperties withCharacterSetName(String characterSetName) { + this.characterSetName = characterSetName; + return this; + } + + /** + * Get the copyTagsToSnapshot property: Specifies whether to copy tags from the DB instance to snapshots of the DB + * instance. By default, tags are not copied. This setting doesn't apply to Amazon Aurora DB instances. Copying tags + * to snapshots is managed by the DB cluster. Setting this value for an Aurora DB instance has no effect on the DB + * cluster setting. + * + * @return the copyTagsToSnapshot value. + */ + public Boolean copyTagsToSnapshot() { + return this.copyTagsToSnapshot; + } + + /** + * Set the copyTagsToSnapshot property: Specifies whether to copy tags from the DB instance to snapshots of the DB + * instance. By default, tags are not copied. This setting doesn't apply to Amazon Aurora DB instances. Copying tags + * to snapshots is managed by the DB cluster. Setting this value for an Aurora DB instance has no effect on the DB + * cluster setting. + * + * @param copyTagsToSnapshot the copyTagsToSnapshot value to set. + * @return the AwsRdsDBInstanceProperties object itself. + */ + public AwsRdsDBInstanceProperties withCopyTagsToSnapshot(Boolean copyTagsToSnapshot) { + this.copyTagsToSnapshot = copyTagsToSnapshot; + return this; + } + + /** + * Get the customIamInstanceProfile property: The instance profile associated with the underlying Amazon EC2 + * instance of an RDS Custom DB instance. This setting is required for RDS Custom. Constraints: + The profile must + * exist in your account. + The profile must have an IAM role that Amazon EC2 has permissions to assume. + The + * instance profile name and the associated IAM role name must start with the prefix ``AWSRDSCustom``. For the list + * of permissions required for the IAM role, see [Configure IAM and your + * VPC](https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/custom-setup-orcl.html#custom-setup-orcl.iam-vpc) in + * the *Amazon RDS User Guide*. + * + * @return the customIamInstanceProfile value. + */ + public String customIamInstanceProfile() { + return this.customIamInstanceProfile; + } + + /** + * Set the customIamInstanceProfile property: The instance profile associated with the underlying Amazon EC2 + * instance of an RDS Custom DB instance. This setting is required for RDS Custom. Constraints: + The profile must + * exist in your account. + The profile must have an IAM role that Amazon EC2 has permissions to assume. + The + * instance profile name and the associated IAM role name must start with the prefix ``AWSRDSCustom``. For the list + * of permissions required for the IAM role, see [Configure IAM and your + * VPC](https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/custom-setup-orcl.html#custom-setup-orcl.iam-vpc) in + * the *Amazon RDS User Guide*. + * + * @param customIamInstanceProfile the customIamInstanceProfile value to set. + * @return the AwsRdsDBInstanceProperties object itself. + */ + public AwsRdsDBInstanceProperties withCustomIamInstanceProfile(String customIamInstanceProfile) { + this.customIamInstanceProfile = customIamInstanceProfile; + return this; + } + + /** + * Get the dbClusterIdentifier property: The identifier of the DB cluster that the instance will belong to. + * + * @return the dbClusterIdentifier value. + */ + public String dbClusterIdentifier() { + return this.dbClusterIdentifier; + } + + /** + * Set the dbClusterIdentifier property: The identifier of the DB cluster that the instance will belong to. + * + * @param dbClusterIdentifier the dbClusterIdentifier value to set. + * @return the AwsRdsDBInstanceProperties object itself. + */ + public AwsRdsDBInstanceProperties withDbClusterIdentifier(String dbClusterIdentifier) { + this.dbClusterIdentifier = dbClusterIdentifier; + return this; + } + + /** + * Get the dbClusterSnapshotIdentifier property: The identifier for the Multi-AZ DB cluster snapshot to restore + * from. For more information on Multi-AZ DB clusters, see [Multi-AZ DB cluster + * deployments](https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/multi-az-db-clusters-concepts.html) in the + * *Amazon RDS User Guide*. Constraints: + Must match the identifier of an existing Multi-AZ DB cluster snapshot. + + * Can't be specified when ``DBSnapshotIdentifier`` is specified. + Must be specified when ``DBSnapshotIdentifier`` + * isn't specified. + If you are restoring from a shared manual Multi-AZ DB cluster snapshot, the + * ``DBClusterSnapshotIdentifier`` must be the ARN of the shared snapshot. + Can't be the identifier of an Aurora DB + * cluster snapshot. + * + * @return the dbClusterSnapshotIdentifier value. + */ + public String dbClusterSnapshotIdentifier() { + return this.dbClusterSnapshotIdentifier; + } + + /** + * Set the dbClusterSnapshotIdentifier property: The identifier for the Multi-AZ DB cluster snapshot to restore + * from. For more information on Multi-AZ DB clusters, see [Multi-AZ DB cluster + * deployments](https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/multi-az-db-clusters-concepts.html) in the + * *Amazon RDS User Guide*. Constraints: + Must match the identifier of an existing Multi-AZ DB cluster snapshot. + + * Can't be specified when ``DBSnapshotIdentifier`` is specified. + Must be specified when ``DBSnapshotIdentifier`` + * isn't specified. + If you are restoring from a shared manual Multi-AZ DB cluster snapshot, the + * ``DBClusterSnapshotIdentifier`` must be the ARN of the shared snapshot. + Can't be the identifier of an Aurora DB + * cluster snapshot. + * + * @param dbClusterSnapshotIdentifier the dbClusterSnapshotIdentifier value to set. + * @return the AwsRdsDBInstanceProperties object itself. + */ + public AwsRdsDBInstanceProperties withDbClusterSnapshotIdentifier(String dbClusterSnapshotIdentifier) { + this.dbClusterSnapshotIdentifier = dbClusterSnapshotIdentifier; + return this; + } + + /** + * Get the dbInstanceArn property: Property dbInstanceArn. + * + * @return the dbInstanceArn value. + */ + public String dbInstanceArn() { + return this.dbInstanceArn; + } + + /** + * Set the dbInstanceArn property: Property dbInstanceArn. + * + * @param dbInstanceArn the dbInstanceArn value to set. + * @return the AwsRdsDBInstanceProperties object itself. + */ + public AwsRdsDBInstanceProperties withDbInstanceArn(String dbInstanceArn) { + this.dbInstanceArn = dbInstanceArn; + return this; + } + + /** + * Get the dbInstanceClass property: The compute and memory capacity of the DB instance, for example + * ``db.m5.large``. Not all DB instance classes are available in all AWS-Regions, or for all database engines. For + * the full list of DB instance classes, and availability for your engine, see [DB instance + * classes](https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/Concepts.DBInstanceClass.html) in the *Amazon RDS + * User Guide* or [Aurora DB instance + * classes](https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/Concepts.DBInstanceClass.html) in the + * *Amazon Aurora User Guide*. + * + * @return the dbInstanceClass value. + */ + public String dbInstanceClass() { + return this.dbInstanceClass; + } + + /** + * Set the dbInstanceClass property: The compute and memory capacity of the DB instance, for example + * ``db.m5.large``. Not all DB instance classes are available in all AWS-Regions, or for all database engines. For + * the full list of DB instance classes, and availability for your engine, see [DB instance + * classes](https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/Concepts.DBInstanceClass.html) in the *Amazon RDS + * User Guide* or [Aurora DB instance + * classes](https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/Concepts.DBInstanceClass.html) in the + * *Amazon Aurora User Guide*. + * + * @param dbInstanceClass the dbInstanceClass value to set. + * @return the AwsRdsDBInstanceProperties object itself. + */ + public AwsRdsDBInstanceProperties withDbInstanceClass(String dbInstanceClass) { + this.dbInstanceClass = dbInstanceClass; + return this; + } + + /** + * Get the dbInstanceIdentifier property: A name for the DB instance. If you specify a name, AWS CloudFormation + * converts it to lowercase. If you don't specify a name, AWS CloudFormation generates a unique physical ID and uses + * that ID for the DB instance. For more information, see [Name + * Type](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-name.html). For information + * about constraints that apply to DB instance identifiers, see [Naming constraints in Amazon + * RDS](https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/CHAP_Limits.html#RDS_Limits.Constraints) in the + * *Amazon RDS User Guide*. If you specify a name, you can't perform updates that require replacement of this + * resource. You can perform updates that require no or some interruption. If you must replace the resource, specify + * a new name. + * + * @return the dbInstanceIdentifier value. + */ + public String dbInstanceIdentifier() { + return this.dbInstanceIdentifier; + } + + /** + * Set the dbInstanceIdentifier property: A name for the DB instance. If you specify a name, AWS CloudFormation + * converts it to lowercase. If you don't specify a name, AWS CloudFormation generates a unique physical ID and uses + * that ID for the DB instance. For more information, see [Name + * Type](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-name.html). For information + * about constraints that apply to DB instance identifiers, see [Naming constraints in Amazon + * RDS](https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/CHAP_Limits.html#RDS_Limits.Constraints) in the + * *Amazon RDS User Guide*. If you specify a name, you can't perform updates that require replacement of this + * resource. You can perform updates that require no or some interruption. If you must replace the resource, specify + * a new name. + * + * @param dbInstanceIdentifier the dbInstanceIdentifier value to set. + * @return the AwsRdsDBInstanceProperties object itself. + */ + public AwsRdsDBInstanceProperties withDbInstanceIdentifier(String dbInstanceIdentifier) { + this.dbInstanceIdentifier = dbInstanceIdentifier; + return this; + } + + /** + * Get the dbName property: The meaning of this parameter differs according to the database engine you use. If you + * specify the ``DBSnapshotIdentifier`` property, this property only applies to RDS for Oracle. *Amazon Aurora* Not + * applicable. The database name is managed by the DB cluster. *Db2* The name of the database to create when the DB + * instance is created. If this parameter isn't specified, no database is created in the DB instance. Constraints: + + * Must contain 1 to 64 letters or numbers. + Must begin with a letter. Subsequent characters can be letters, + * underscores, or digits (0-9). + Can't be a word reserved by the specified database engine. *MySQL* The name of + * the database to create when the DB instance is created. If this parameter is not specified, no database is + * created in the DB instance. Constraints: + Must contain 1 to 64 letters or numbers. + Can't be a word reserved by + * the specified database engine *MariaDB* The name of the database to create when the DB instance is created. If + * this parameter is not specified, no database is created in the DB instance. Constraints: + Must contain 1 to 64 + * letters or numbers. + Can't be a word reserved by the specified database engine *PostgreSQL* The name of the + * database to create when the DB instance is created. If this parameter is not specified, the default ``postgres`` + * database is created in the DB instance. Constraints: + Must begin with a letter. Subsequent characters can be + * letters, underscores, or digits (0-9). + Must contain 1 to 63 characters. + Can't be a word reserved by the + * specified database engine *Oracle* The Oracle System ID (SID) of the created DB instance. If you specify + * ``null``, the default value ``ORCL`` is used. You can't specify the string NULL, or any other reserved word, for + * ``DBName``. Default: ``ORCL`` Constraints: + Can't be longer than 8 characters *SQL Server* Not applicable. Must + * be null. + * + * @return the dbName value. + */ + public String dbName() { + return this.dbName; + } + + /** + * Set the dbName property: The meaning of this parameter differs according to the database engine you use. If you + * specify the ``DBSnapshotIdentifier`` property, this property only applies to RDS for Oracle. *Amazon Aurora* Not + * applicable. The database name is managed by the DB cluster. *Db2* The name of the database to create when the DB + * instance is created. If this parameter isn't specified, no database is created in the DB instance. Constraints: + + * Must contain 1 to 64 letters or numbers. + Must begin with a letter. Subsequent characters can be letters, + * underscores, or digits (0-9). + Can't be a word reserved by the specified database engine. *MySQL* The name of + * the database to create when the DB instance is created. If this parameter is not specified, no database is + * created in the DB instance. Constraints: + Must contain 1 to 64 letters or numbers. + Can't be a word reserved by + * the specified database engine *MariaDB* The name of the database to create when the DB instance is created. If + * this parameter is not specified, no database is created in the DB instance. Constraints: + Must contain 1 to 64 + * letters or numbers. + Can't be a word reserved by the specified database engine *PostgreSQL* The name of the + * database to create when the DB instance is created. If this parameter is not specified, the default ``postgres`` + * database is created in the DB instance. Constraints: + Must begin with a letter. Subsequent characters can be + * letters, underscores, or digits (0-9). + Must contain 1 to 63 characters. + Can't be a word reserved by the + * specified database engine *Oracle* The Oracle System ID (SID) of the created DB instance. If you specify + * ``null``, the default value ``ORCL`` is used. You can't specify the string NULL, or any other reserved word, for + * ``DBName``. Default: ``ORCL`` Constraints: + Can't be longer than 8 characters *SQL Server* Not applicable. Must + * be null. + * + * @param dbName the dbName value to set. + * @return the AwsRdsDBInstanceProperties object itself. + */ + public AwsRdsDBInstanceProperties withDbName(String dbName) { + this.dbName = dbName; + return this; + } + + /** + * Get the dbParameterGroupName property: The name of an existing DB parameter group or a reference to an + * [AWS::RDS::DBParameterGroup](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-rds-dbparametergroup.html) + * resource created in the template. To list all of the available DB parameter group names, use the following + * command: ``aws rds describe-db-parameter-groups --query 'DBParameterGroups[].DBParameterGroupName' --output + * text`` If any of the data members of the referenced parameter group are changed during an update, the DB instance + * might need to be restarted, which causes some interruption. If the parameter group contains static parameters, + * whether they were changed or not, an update triggers a reboot. If you don't specify a value for + * ``DBParameterGroupName`` property, the default DB parameter group for the specified engine and engine version is + * used. + * + * @return the dbParameterGroupName value. + */ + public String dbParameterGroupName() { + return this.dbParameterGroupName; + } + + /** + * Set the dbParameterGroupName property: The name of an existing DB parameter group or a reference to an + * [AWS::RDS::DBParameterGroup](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-rds-dbparametergroup.html) + * resource created in the template. To list all of the available DB parameter group names, use the following + * command: ``aws rds describe-db-parameter-groups --query 'DBParameterGroups[].DBParameterGroupName' --output + * text`` If any of the data members of the referenced parameter group are changed during an update, the DB instance + * might need to be restarted, which causes some interruption. If the parameter group contains static parameters, + * whether they were changed or not, an update triggers a reboot. If you don't specify a value for + * ``DBParameterGroupName`` property, the default DB parameter group for the specified engine and engine version is + * used. + * + * @param dbParameterGroupName the dbParameterGroupName value to set. + * @return the AwsRdsDBInstanceProperties object itself. + */ + public AwsRdsDBInstanceProperties withDbParameterGroupName(String dbParameterGroupName) { + this.dbParameterGroupName = dbParameterGroupName; + return this; + } + + /** + * Get the dbSecurityGroups property: A list of the DB security groups to assign to the DB instance. The list can + * include both the name of existing DB security groups or references to AWS::RDS::DBSecurityGroup resources created + * in the template. If you set DBSecurityGroups, you must not set VPCSecurityGroups, and vice versa. Also, note that + * the DBSecurityGroups property exists only for backwards compatibility with older regions and is no longer + * recommended for providing security information to an RDS DB instance. Instead, use VPCSecurityGroups. If you + * specify this property, AWS CloudFormation sends only the following properties (if specified) to Amazon RDS during + * create operations: + ``AllocatedStorage`` + ``AutoMinorVersionUpgrade`` + ``AvailabilityZone`` + + * ``BackupRetentionPeriod`` + ``CharacterSetName`` + ``DBInstanceClass`` + ``DBName`` + ``DBParameterGroupName`` + + * ``DBSecurityGroups`` + ``DBSubnetGroupName`` + ``Engine`` + ``EngineVersion`` + ``Iops`` + ``LicenseModel`` + + * ``MasterUsername`` + ``MasterUserPassword`` + ``MultiAZ`` + ``OptionGroupName`` + ``PreferredBackupWindow`` + + * ``PreferredMaintenanceWindow`` All other properties are ignored. Specify a virtual private cloud (VPC) security + * group if you want to submit other properties, such as ``StorageType``, ``StorageEncrypted``, or ``KmsKeyId``. If + * you're already using the ``DBSecurityGroups`` property, you can't use these other properties by updating your DB + * instance to use a VPC security group. You must recreate the DB instance. + * + * @return the dbSecurityGroups value. + */ + public List dbSecurityGroups() { + return this.dbSecurityGroups; + } + + /** + * Set the dbSecurityGroups property: A list of the DB security groups to assign to the DB instance. The list can + * include both the name of existing DB security groups or references to AWS::RDS::DBSecurityGroup resources created + * in the template. If you set DBSecurityGroups, you must not set VPCSecurityGroups, and vice versa. Also, note that + * the DBSecurityGroups property exists only for backwards compatibility with older regions and is no longer + * recommended for providing security information to an RDS DB instance. Instead, use VPCSecurityGroups. If you + * specify this property, AWS CloudFormation sends only the following properties (if specified) to Amazon RDS during + * create operations: + ``AllocatedStorage`` + ``AutoMinorVersionUpgrade`` + ``AvailabilityZone`` + + * ``BackupRetentionPeriod`` + ``CharacterSetName`` + ``DBInstanceClass`` + ``DBName`` + ``DBParameterGroupName`` + + * ``DBSecurityGroups`` + ``DBSubnetGroupName`` + ``Engine`` + ``EngineVersion`` + ``Iops`` + ``LicenseModel`` + + * ``MasterUsername`` + ``MasterUserPassword`` + ``MultiAZ`` + ``OptionGroupName`` + ``PreferredBackupWindow`` + + * ``PreferredMaintenanceWindow`` All other properties are ignored. Specify a virtual private cloud (VPC) security + * group if you want to submit other properties, such as ``StorageType``, ``StorageEncrypted``, or ``KmsKeyId``. If + * you're already using the ``DBSecurityGroups`` property, you can't use these other properties by updating your DB + * instance to use a VPC security group. You must recreate the DB instance. + * + * @param dbSecurityGroups the dbSecurityGroups value to set. + * @return the AwsRdsDBInstanceProperties object itself. + */ + public AwsRdsDBInstanceProperties withDbSecurityGroups(List dbSecurityGroups) { + this.dbSecurityGroups = dbSecurityGroups; + return this; + } + + /** + * Get the dbSnapshotIdentifier property: The name or Amazon Resource Name (ARN) of the DB snapshot that's used to + * restore the DB instance. If you're restoring from a shared manual DB snapshot, you must specify the ARN of the + * snapshot. By specifying this property, you can create a DB instance from the specified DB snapshot. If the + * ``DBSnapshotIdentifier`` property is an empty string or the ``AWS::RDS::DBInstance`` declaration has no + * ``DBSnapshotIdentifier`` property, AWS CloudFormation creates a new database. If the property contains a value + * (other than an empty string), AWS CloudFormation creates a database from the specified snapshot. If a snapshot + * with the specified name doesn't exist, AWS CloudFormation can't create the database and it rolls back the stack. + * Some DB instance properties aren't valid when you restore from a snapshot, such as the ``MasterUsername`` and + * ``MasterUserPassword`` properties. For information about the properties that you can specify, see the + * ``RestoreDBInstanceFromDBSnapshot`` action in the *Amazon RDS API Reference*. After you restore a DB instance + * with a ``DBSnapshotIdentifier`` property, you must specify the same ``DBSnapshotIdentifier`` property for any + * future updates to the DB instance. When you specify this property for an update, the DB instance is not restored + * from the DB snapshot again, and the data in the database is not changed. However, if you don't specify the + * ``DBSnapshotIdentifier`` property, an empty DB instance is created, and the original DB instance is deleted. If + * you specify a property that is different from the previous snapshot restore property, a new DB instance is + * restored from the specified ``DBSnapshotIdentifier`` property, and the original DB instance is deleted. If you + * specify the ``DBSnapshotIdentifier`` property to restore a DB instance (as opposed to specifying it for DB + * instance updates), then don't specify the following properties: + ``CharacterSetName`` + ``DBClusterIdentifier`` + * + ``DBName`` + ``DeleteAutomatedBackups`` + ``EnablePerformanceInsights`` + ``KmsKeyId`` + ``MasterUsername`` + + * ``MasterUserPassword`` + ``PerformanceInsightsKMSKeyId`` + ``PerformanceInsightsRetentionPeriod`` + + * ``PromotionTier`` + ``SourceDBInstanceIdentifier`` + ``SourceRegion`` + ``StorageEncrypted`` (for an encrypted + * snapshot) + ``Timezone`` *Amazon Aurora* Not applicable. Snapshot restore is managed by the DB cluster. + * + * @return the dbSnapshotIdentifier value. + */ + public String dbSnapshotIdentifier() { + return this.dbSnapshotIdentifier; + } + + /** + * Set the dbSnapshotIdentifier property: The name or Amazon Resource Name (ARN) of the DB snapshot that's used to + * restore the DB instance. If you're restoring from a shared manual DB snapshot, you must specify the ARN of the + * snapshot. By specifying this property, you can create a DB instance from the specified DB snapshot. If the + * ``DBSnapshotIdentifier`` property is an empty string or the ``AWS::RDS::DBInstance`` declaration has no + * ``DBSnapshotIdentifier`` property, AWS CloudFormation creates a new database. If the property contains a value + * (other than an empty string), AWS CloudFormation creates a database from the specified snapshot. If a snapshot + * with the specified name doesn't exist, AWS CloudFormation can't create the database and it rolls back the stack. + * Some DB instance properties aren't valid when you restore from a snapshot, such as the ``MasterUsername`` and + * ``MasterUserPassword`` properties. For information about the properties that you can specify, see the + * ``RestoreDBInstanceFromDBSnapshot`` action in the *Amazon RDS API Reference*. After you restore a DB instance + * with a ``DBSnapshotIdentifier`` property, you must specify the same ``DBSnapshotIdentifier`` property for any + * future updates to the DB instance. When you specify this property for an update, the DB instance is not restored + * from the DB snapshot again, and the data in the database is not changed. However, if you don't specify the + * ``DBSnapshotIdentifier`` property, an empty DB instance is created, and the original DB instance is deleted. If + * you specify a property that is different from the previous snapshot restore property, a new DB instance is + * restored from the specified ``DBSnapshotIdentifier`` property, and the original DB instance is deleted. If you + * specify the ``DBSnapshotIdentifier`` property to restore a DB instance (as opposed to specifying it for DB + * instance updates), then don't specify the following properties: + ``CharacterSetName`` + ``DBClusterIdentifier`` + * + ``DBName`` + ``DeleteAutomatedBackups`` + ``EnablePerformanceInsights`` + ``KmsKeyId`` + ``MasterUsername`` + + * ``MasterUserPassword`` + ``PerformanceInsightsKMSKeyId`` + ``PerformanceInsightsRetentionPeriod`` + + * ``PromotionTier`` + ``SourceDBInstanceIdentifier`` + ``SourceRegion`` + ``StorageEncrypted`` (for an encrypted + * snapshot) + ``Timezone`` *Amazon Aurora* Not applicable. Snapshot restore is managed by the DB cluster. + * + * @param dbSnapshotIdentifier the dbSnapshotIdentifier value to set. + * @return the AwsRdsDBInstanceProperties object itself. + */ + public AwsRdsDBInstanceProperties withDbSnapshotIdentifier(String dbSnapshotIdentifier) { + this.dbSnapshotIdentifier = dbSnapshotIdentifier; + return this; + } + + /** + * Get the dbSubnetGroupName property: A DB subnet group to associate with the DB instance. If you update this + * value, the new subnet group must be a subnet group in a new VPC. If there's no DB subnet group, then the DB + * instance isn't a VPC DB instance. For more information about using Amazon RDS in a VPC, see [Using Amazon RDS + * with Amazon Virtual Private Cloud (VPC)](https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_VPC.html) in + * the *Amazon RDS User Guide*. *Amazon Aurora* Not applicable. The DB subnet group is managed by the DB cluster. If + * specified, the setting must match the DB cluster setting. + * + * @return the dbSubnetGroupName value. + */ + public String dbSubnetGroupName() { + return this.dbSubnetGroupName; + } + + /** + * Set the dbSubnetGroupName property: A DB subnet group to associate with the DB instance. If you update this + * value, the new subnet group must be a subnet group in a new VPC. If there's no DB subnet group, then the DB + * instance isn't a VPC DB instance. For more information about using Amazon RDS in a VPC, see [Using Amazon RDS + * with Amazon Virtual Private Cloud (VPC)](https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_VPC.html) in + * the *Amazon RDS User Guide*. *Amazon Aurora* Not applicable. The DB subnet group is managed by the DB cluster. If + * specified, the setting must match the DB cluster setting. + * + * @param dbSubnetGroupName the dbSubnetGroupName value to set. + * @return the AwsRdsDBInstanceProperties object itself. + */ + public AwsRdsDBInstanceProperties withDbSubnetGroupName(String dbSubnetGroupName) { + this.dbSubnetGroupName = dbSubnetGroupName; + return this; + } + + /** + * Get the dbSystemId property: The Oracle system identifier (SID), which is the name of the Oracle database + * instance that manages your database files. In this context, the term 'Oracle database instance' refers + * exclusively to the system global area (SGA) and Oracle background processes. If you don't specify a SID, the + * value defaults to ``RDSCDB``. The Oracle SID is also the name of your CDB. + * + * @return the dbSystemId value. + */ + public String dbSystemId() { + return this.dbSystemId; + } + + /** + * Set the dbSystemId property: The Oracle system identifier (SID), which is the name of the Oracle database + * instance that manages your database files. In this context, the term 'Oracle database instance' refers + * exclusively to the system global area (SGA) and Oracle background processes. If you don't specify a SID, the + * value defaults to ``RDSCDB``. The Oracle SID is also the name of your CDB. + * + * @param dbSystemId the dbSystemId value to set. + * @return the AwsRdsDBInstanceProperties object itself. + */ + public AwsRdsDBInstanceProperties withDbSystemId(String dbSystemId) { + this.dbSystemId = dbSystemId; + return this; + } + + /** + * Get the dbiResourceId property: Property dbiResourceId. + * + * @return the dbiResourceId value. + */ + public String dbiResourceId() { + return this.dbiResourceId; + } + + /** + * Set the dbiResourceId property: Property dbiResourceId. + * + * @param dbiResourceId the dbiResourceId value to set. + * @return the AwsRdsDBInstanceProperties object itself. + */ + public AwsRdsDBInstanceProperties withDbiResourceId(String dbiResourceId) { + this.dbiResourceId = dbiResourceId; + return this; + } + + /** + * Get the dedicatedLogVolume property: Indicates whether the DB instance has a dedicated log volume (DLV) enabled. + * + * @return the dedicatedLogVolume value. + */ + public Boolean dedicatedLogVolume() { + return this.dedicatedLogVolume; + } + + /** + * Set the dedicatedLogVolume property: Indicates whether the DB instance has a dedicated log volume (DLV) enabled. + * + * @param dedicatedLogVolume the dedicatedLogVolume value to set. + * @return the AwsRdsDBInstanceProperties object itself. + */ + public AwsRdsDBInstanceProperties withDedicatedLogVolume(Boolean dedicatedLogVolume) { + this.dedicatedLogVolume = dedicatedLogVolume; + return this; + } + + /** + * Get the deleteAutomatedBackups property: A value that indicates whether to remove automated backups immediately + * after the DB instance is deleted. This parameter isn't case-sensitive. The default is to remove automated backups + * immediately after the DB instance is deleted. *Amazon Aurora* Not applicable. When you delete a DB cluster, all + * automated backups for that DB cluster are deleted and can't be recovered. Manual DB cluster snapshots of the DB + * cluster are not deleted. + * + * @return the deleteAutomatedBackups value. + */ + public Boolean deleteAutomatedBackups() { + return this.deleteAutomatedBackups; + } + + /** + * Set the deleteAutomatedBackups property: A value that indicates whether to remove automated backups immediately + * after the DB instance is deleted. This parameter isn't case-sensitive. The default is to remove automated backups + * immediately after the DB instance is deleted. *Amazon Aurora* Not applicable. When you delete a DB cluster, all + * automated backups for that DB cluster are deleted and can't be recovered. Manual DB cluster snapshots of the DB + * cluster are not deleted. + * + * @param deleteAutomatedBackups the deleteAutomatedBackups value to set. + * @return the AwsRdsDBInstanceProperties object itself. + */ + public AwsRdsDBInstanceProperties withDeleteAutomatedBackups(Boolean deleteAutomatedBackups) { + this.deleteAutomatedBackups = deleteAutomatedBackups; + return this; + } + + /** + * Get the deletionProtection property: A value that indicates whether the DB instance has deletion protection + * enabled. The database can't be deleted when deletion protection is enabled. By default, deletion protection is + * disabled. For more information, see [Deleting a DB + * Instance](https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_DeleteInstance.html). *Amazon Aurora* Not + * applicable. You can enable or disable deletion protection for the DB cluster. For more information, see + * ``CreateDBCluster``. DB instances in a DB cluster can be deleted even when deletion protection is enabled for the + * DB cluster. + * + * @return the deletionProtection value. + */ + public Boolean deletionProtection() { + return this.deletionProtection; + } + + /** + * Set the deletionProtection property: A value that indicates whether the DB instance has deletion protection + * enabled. The database can't be deleted when deletion protection is enabled. By default, deletion protection is + * disabled. For more information, see [Deleting a DB + * Instance](https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_DeleteInstance.html). *Amazon Aurora* Not + * applicable. You can enable or disable deletion protection for the DB cluster. For more information, see + * ``CreateDBCluster``. DB instances in a DB cluster can be deleted even when deletion protection is enabled for the + * DB cluster. + * + * @param deletionProtection the deletionProtection value to set. + * @return the AwsRdsDBInstanceProperties object itself. + */ + public AwsRdsDBInstanceProperties withDeletionProtection(Boolean deletionProtection) { + this.deletionProtection = deletionProtection; + return this; + } + + /** + * Get the domain property: The Active Directory directory ID to create the DB instance in. Currently, only Db2, + * MySQL, Microsoft SQL Server, Oracle, and PostgreSQL DB instances can be created in an Active Directory Domain. + * For more information, see [Kerberos + * Authentication](https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/kerberos-authentication.html) in the + * *Amazon RDS User Guide*. + * + * @return the domain value. + */ + public String domain() { + return this.domain; + } + + /** + * Set the domain property: The Active Directory directory ID to create the DB instance in. Currently, only Db2, + * MySQL, Microsoft SQL Server, Oracle, and PostgreSQL DB instances can be created in an Active Directory Domain. + * For more information, see [Kerberos + * Authentication](https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/kerberos-authentication.html) in the + * *Amazon RDS User Guide*. + * + * @param domain the domain value to set. + * @return the AwsRdsDBInstanceProperties object itself. + */ + public AwsRdsDBInstanceProperties withDomain(String domain) { + this.domain = domain; + return this; + } + + /** + * Get the domainAuthSecretArn property: The ARN for the Secrets Manager secret with the credentials for the user + * joining the domain. Example: + * ``arn:aws:secretsmanager:region:account-number:secret:myselfmanagedADtestsecret-123456``. + * + * @return the domainAuthSecretArn value. + */ + public String domainAuthSecretArn() { + return this.domainAuthSecretArn; + } + + /** + * Set the domainAuthSecretArn property: The ARN for the Secrets Manager secret with the credentials for the user + * joining the domain. Example: + * ``arn:aws:secretsmanager:region:account-number:secret:myselfmanagedADtestsecret-123456``. + * + * @param domainAuthSecretArn the domainAuthSecretArn value to set. + * @return the AwsRdsDBInstanceProperties object itself. + */ + public AwsRdsDBInstanceProperties withDomainAuthSecretArn(String domainAuthSecretArn) { + this.domainAuthSecretArn = domainAuthSecretArn; + return this; + } + + /** + * Get the domainDnsIps property: The IPv4 DNS IP addresses of your primary and secondary Active Directory domain + * controllers. Constraints: + Two IP addresses must be provided. If there isn't a secondary domain controller, use + * the IP address of the primary domain controller for both entries in the list. Example: + * ``123.124.125.126,234.235.236.237``. + * + * @return the domainDnsIps value. + */ + public List domainDnsIps() { + return this.domainDnsIps; + } + + /** + * Set the domainDnsIps property: The IPv4 DNS IP addresses of your primary and secondary Active Directory domain + * controllers. Constraints: + Two IP addresses must be provided. If there isn't a secondary domain controller, use + * the IP address of the primary domain controller for both entries in the list. Example: + * ``123.124.125.126,234.235.236.237``. + * + * @param domainDnsIps the domainDnsIps value to set. + * @return the AwsRdsDBInstanceProperties object itself. + */ + public AwsRdsDBInstanceProperties withDomainDnsIps(List domainDnsIps) { + this.domainDnsIps = domainDnsIps; + return this; + } + + /** + * Get the domainFqdn property: The fully qualified domain name (FQDN) of an Active Directory domain. Constraints: + + * Can't be longer than 64 characters. Example: ``mymanagedADtest.mymanagedAD.mydomain``. + * + * @return the domainFqdn value. + */ + public String domainFqdn() { + return this.domainFqdn; + } + + /** + * Set the domainFqdn property: The fully qualified domain name (FQDN) of an Active Directory domain. Constraints: + + * Can't be longer than 64 characters. Example: ``mymanagedADtest.mymanagedAD.mydomain``. + * + * @param domainFqdn the domainFqdn value to set. + * @return the AwsRdsDBInstanceProperties object itself. + */ + public AwsRdsDBInstanceProperties withDomainFqdn(String domainFqdn) { + this.domainFqdn = domainFqdn; + return this; + } + + /** + * Get the domainIamRoleName property: The name of the IAM role to use when making API calls to the Directory + * Service. This setting doesn't apply to the following DB instances: + Amazon Aurora (The domain is managed by the + * DB cluster.) + RDS Custom. + * + * @return the domainIamRoleName value. + */ + public String domainIamRoleName() { + return this.domainIamRoleName; + } + + /** + * Set the domainIamRoleName property: The name of the IAM role to use when making API calls to the Directory + * Service. This setting doesn't apply to the following DB instances: + Amazon Aurora (The domain is managed by the + * DB cluster.) + RDS Custom. + * + * @param domainIamRoleName the domainIamRoleName value to set. + * @return the AwsRdsDBInstanceProperties object itself. + */ + public AwsRdsDBInstanceProperties withDomainIamRoleName(String domainIamRoleName) { + this.domainIamRoleName = domainIamRoleName; + return this; + } + + /** + * Get the domainOu property: The Active Directory organizational unit for your DB instance to join. Constraints: + + * Must be in the distinguished name format. + Can't be longer than 64 characters. Example: + * ``OU=mymanagedADtestOU,DC=mymanagedADtest,DC=mymanagedAD,DC=mydomain``. + * + * @return the domainOu value. + */ + public String domainOu() { + return this.domainOu; + } + + /** + * Set the domainOu property: The Active Directory organizational unit for your DB instance to join. Constraints: + + * Must be in the distinguished name format. + Can't be longer than 64 characters. Example: + * ``OU=mymanagedADtestOU,DC=mymanagedADtest,DC=mymanagedAD,DC=mydomain``. + * + * @param domainOu the domainOu value to set. + * @return the AwsRdsDBInstanceProperties object itself. + */ + public AwsRdsDBInstanceProperties withDomainOu(String domainOu) { + this.domainOu = domainOu; + return this; + } + + /** + * Get the enableCloudwatchLogsExports property: The list of log types that need to be enabled for exporting to + * CloudWatch Logs. The values in the list depend on the DB engine being used. For more information, see [Publishing + * Database Logs to Amazon CloudWatch + * Logs](https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_LogAccess.html#USER_LogAccess.Procedural.UploadtoCloudWatch) + * in the *Amazon Relational Database Service User Guide*. *Amazon Aurora* Not applicable. CloudWatch Logs exports + * are managed by the DB cluster. *Db2* Valid values: ``diag.log``, ``notify.log`` *MariaDB* Valid values: + * ``audit``, ``error``, ``general``, ``slowquery`` *Microsoft SQL Server* Valid values: ``agent``, ``error`` + * *MySQL* Valid values: ``audit``, ``error``, ``general``, ``slowquery`` *Oracle* Valid values: ``alert``, + * ``audit``, ``listener``, ``trace``, ``oemagent`` *PostgreSQL* Valid values: ``postgresql``, ``upgrade``. + * + * @return the enableCloudwatchLogsExports value. + */ + public List enableCloudwatchLogsExports() { + return this.enableCloudwatchLogsExports; + } + + /** + * Set the enableCloudwatchLogsExports property: The list of log types that need to be enabled for exporting to + * CloudWatch Logs. The values in the list depend on the DB engine being used. For more information, see [Publishing + * Database Logs to Amazon CloudWatch + * Logs](https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_LogAccess.html#USER_LogAccess.Procedural.UploadtoCloudWatch) + * in the *Amazon Relational Database Service User Guide*. *Amazon Aurora* Not applicable. CloudWatch Logs exports + * are managed by the DB cluster. *Db2* Valid values: ``diag.log``, ``notify.log`` *MariaDB* Valid values: + * ``audit``, ``error``, ``general``, ``slowquery`` *Microsoft SQL Server* Valid values: ``agent``, ``error`` + * *MySQL* Valid values: ``audit``, ``error``, ``general``, ``slowquery`` *Oracle* Valid values: ``alert``, + * ``audit``, ``listener``, ``trace``, ``oemagent`` *PostgreSQL* Valid values: ``postgresql``, ``upgrade``. + * + * @param enableCloudwatchLogsExports the enableCloudwatchLogsExports value to set. + * @return the AwsRdsDBInstanceProperties object itself. + */ + public AwsRdsDBInstanceProperties withEnableCloudwatchLogsExports(List enableCloudwatchLogsExports) { + this.enableCloudwatchLogsExports = enableCloudwatchLogsExports; + return this; + } + + /** + * Get the enableIamDatabaseAuthentication property: A value that indicates whether to enable mapping of AWS + * Identity and Access Management (IAM) accounts to database accounts. By default, mapping is disabled. This + * property is supported for RDS for MariaDB, RDS for MySQL, and RDS for PostgreSQL. For more information, see [IAM + * Database Authentication for MariaDB, MySQL, and + * PostgreSQL](https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/UsingWithRDS.IAMDBAuth.html) in the *Amazon + * RDS User Guide.* *Amazon Aurora* Not applicable. Mapping AWS IAM accounts to database accounts is managed by the + * DB cluster. + * + * @return the enableIamDatabaseAuthentication value. + */ + public Boolean enableIamDatabaseAuthentication() { + return this.enableIamDatabaseAuthentication; + } + + /** + * Set the enableIamDatabaseAuthentication property: A value that indicates whether to enable mapping of AWS + * Identity and Access Management (IAM) accounts to database accounts. By default, mapping is disabled. This + * property is supported for RDS for MariaDB, RDS for MySQL, and RDS for PostgreSQL. For more information, see [IAM + * Database Authentication for MariaDB, MySQL, and + * PostgreSQL](https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/UsingWithRDS.IAMDBAuth.html) in the *Amazon + * RDS User Guide.* *Amazon Aurora* Not applicable. Mapping AWS IAM accounts to database accounts is managed by the + * DB cluster. + * + * @param enableIamDatabaseAuthentication the enableIamDatabaseAuthentication value to set. + * @return the AwsRdsDBInstanceProperties object itself. + */ + public AwsRdsDBInstanceProperties withEnableIamDatabaseAuthentication(Boolean enableIamDatabaseAuthentication) { + this.enableIamDatabaseAuthentication = enableIamDatabaseAuthentication; + return this; + } + + /** + * Get the enablePerformanceInsights property: Specifies whether to enable Performance Insights for the DB instance. + * For more information, see [Using Amazon Performance + * Insights](https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_PerfInsights.html) in the *Amazon RDS User + * Guide*. This setting doesn't apply to RDS Custom DB instances. + * + * @return the enablePerformanceInsights value. + */ + public Boolean enablePerformanceInsights() { + return this.enablePerformanceInsights; + } + + /** + * Set the enablePerformanceInsights property: Specifies whether to enable Performance Insights for the DB instance. + * For more information, see [Using Amazon Performance + * Insights](https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_PerfInsights.html) in the *Amazon RDS User + * Guide*. This setting doesn't apply to RDS Custom DB instances. + * + * @param enablePerformanceInsights the enablePerformanceInsights value to set. + * @return the AwsRdsDBInstanceProperties object itself. + */ + public AwsRdsDBInstanceProperties withEnablePerformanceInsights(Boolean enablePerformanceInsights) { + this.enablePerformanceInsights = enablePerformanceInsights; + return this; + } + + /** + * Get the endpoint property: The connection endpoint for the DB instance. The endpoint might not be shown for + * instances with the status of ``creating``. This data type represents the information you need to connect to an + * Amazon RDS DB instance. This data type is used as a response element in the following actions: + + * ``CreateDBInstance`` + ``DescribeDBInstances`` + ``DeleteDBInstance`` For the data structure that represents + * Amazon Aurora DB cluster endpoints, see ``DBClusterEndpoint``. + * + * @return the endpoint value. + */ + public EndpointAutoGenerated2 endpoint() { + return this.endpoint; + } + + /** + * Set the endpoint property: The connection endpoint for the DB instance. The endpoint might not be shown for + * instances with the status of ``creating``. This data type represents the information you need to connect to an + * Amazon RDS DB instance. This data type is used as a response element in the following actions: + + * ``CreateDBInstance`` + ``DescribeDBInstances`` + ``DeleteDBInstance`` For the data structure that represents + * Amazon Aurora DB cluster endpoints, see ``DBClusterEndpoint``. + * + * @param endpoint the endpoint value to set. + * @return the AwsRdsDBInstanceProperties object itself. + */ + public AwsRdsDBInstanceProperties withEndpoint(EndpointAutoGenerated2 endpoint) { + this.endpoint = endpoint; + return this; + } + + /** + * Get the engine property: The name of the database engine to use for this DB instance. Not every database engine + * is available in every AWS Region. This property is required when creating a DB instance. You can change the + * architecture of an Oracle database from the non-container database (CDB) architecture to the CDB architecture by + * updating the ``Engine`` value in your templates from ``oracle-ee`` or ``oracle-ee-cdb`` to ``oracle-se2-cdb``. + * Converting to the CDB architecture requires an interruption. Valid Values: + ``aurora-mysql`` (for Aurora MySQL + * DB instances) + ``aurora-postgresql`` (for Aurora PostgreSQL DB instances) + ``custom-oracle-ee`` (for RDS Custom + * for Oracle DB instances) + ``custom-oracle-ee-cdb`` (for RDS Custom for Oracle DB instances) + + * ``custom-sqlserver-ee`` (for RDS Custom for SQL Server DB instances) + ``custom-sqlserver-se`` (for RDS Custom + * for SQL Server DB instances) + ``custom-sqlserver-web`` (for RDS Custom for SQL Server DB instances) + ``db2-ae`` + * + ``db2-se`` + ``mariadb`` + ``mysql`` + ``oracle-ee`` + ``oracle-ee-cdb`` + ``oracle-se2`` + ``oracle-se2-cdb`` + * + ``postgres`` + ``sqlserver-ee`` + ``sqlserver-se`` + ``sqlserver-ex`` + ``sqlserver-web``. + * + * @return the engine value. + */ + public String engine() { + return this.engine; + } + + /** + * Set the engine property: The name of the database engine to use for this DB instance. Not every database engine + * is available in every AWS Region. This property is required when creating a DB instance. You can change the + * architecture of an Oracle database from the non-container database (CDB) architecture to the CDB architecture by + * updating the ``Engine`` value in your templates from ``oracle-ee`` or ``oracle-ee-cdb`` to ``oracle-se2-cdb``. + * Converting to the CDB architecture requires an interruption. Valid Values: + ``aurora-mysql`` (for Aurora MySQL + * DB instances) + ``aurora-postgresql`` (for Aurora PostgreSQL DB instances) + ``custom-oracle-ee`` (for RDS Custom + * for Oracle DB instances) + ``custom-oracle-ee-cdb`` (for RDS Custom for Oracle DB instances) + + * ``custom-sqlserver-ee`` (for RDS Custom for SQL Server DB instances) + ``custom-sqlserver-se`` (for RDS Custom + * for SQL Server DB instances) + ``custom-sqlserver-web`` (for RDS Custom for SQL Server DB instances) + ``db2-ae`` + * + ``db2-se`` + ``mariadb`` + ``mysql`` + ``oracle-ee`` + ``oracle-ee-cdb`` + ``oracle-se2`` + ``oracle-se2-cdb`` + * + ``postgres`` + ``sqlserver-ee`` + ``sqlserver-se`` + ``sqlserver-ex`` + ``sqlserver-web``. + * + * @param engine the engine value to set. + * @return the AwsRdsDBInstanceProperties object itself. + */ + public AwsRdsDBInstanceProperties withEngine(String engine) { + this.engine = engine; + return this; + } + + /** + * Get the engineVersion property: The version number of the database engine to use. For a list of valid engine + * versions, use the ``DescribeDBEngineVersions`` action. The following are the database engines and links to + * information about the major and minor versions that are available with Amazon RDS. Not every database engine is + * available for every AWS Region. *Amazon Aurora* Not applicable. The version number of the database engine to be + * used by the DB instance is managed by the DB cluster. *Db2* See [Amazon RDS for + * Db2](https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/CHAP_Db2.html#Db2.Concepts.VersionMgmt) in the + * *Amazon RDS User Guide.* *MariaDB* See [MariaDB on Amazon RDS + * Versions](https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/CHAP_MariaDB.html#MariaDB.Concepts.VersionMgmt) + * in the *Amazon RDS User Guide.* *Microsoft SQL Server* See [Microsoft SQL Server Versions on Amazon + * RDS](https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/CHAP_SQLServer.html#SQLServer.Concepts.General.VersionSupport) + * in the *Amazon RDS User Guide.* *MySQL* See [MySQL on Amazon RDS + * Versions](https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/CHAP_MySQL.html#MySQL.Concepts.VersionMgmt) in + * the *Amazon RDS User Guide.* *Oracle* See [Oracle Database Engine Release + * Notes](https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/Appendix.Oracle.PatchComposition.html) in the + * *Amazon RDS User Guide.* *PostgreSQL* See [Supported PostgreSQL Database + * Versions](https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/CHAP_PostgreSQL.html#PostgreSQL.Concepts.General.DBVersions) + * in the *Amazon RDS User Guide.*. + * + * @return the engineVersion value. + */ + public String engineVersion() { + return this.engineVersion; + } + + /** + * Set the engineVersion property: The version number of the database engine to use. For a list of valid engine + * versions, use the ``DescribeDBEngineVersions`` action. The following are the database engines and links to + * information about the major and minor versions that are available with Amazon RDS. Not every database engine is + * available for every AWS Region. *Amazon Aurora* Not applicable. The version number of the database engine to be + * used by the DB instance is managed by the DB cluster. *Db2* See [Amazon RDS for + * Db2](https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/CHAP_Db2.html#Db2.Concepts.VersionMgmt) in the + * *Amazon RDS User Guide.* *MariaDB* See [MariaDB on Amazon RDS + * Versions](https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/CHAP_MariaDB.html#MariaDB.Concepts.VersionMgmt) + * in the *Amazon RDS User Guide.* *Microsoft SQL Server* See [Microsoft SQL Server Versions on Amazon + * RDS](https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/CHAP_SQLServer.html#SQLServer.Concepts.General.VersionSupport) + * in the *Amazon RDS User Guide.* *MySQL* See [MySQL on Amazon RDS + * Versions](https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/CHAP_MySQL.html#MySQL.Concepts.VersionMgmt) in + * the *Amazon RDS User Guide.* *Oracle* See [Oracle Database Engine Release + * Notes](https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/Appendix.Oracle.PatchComposition.html) in the + * *Amazon RDS User Guide.* *PostgreSQL* See [Supported PostgreSQL Database + * Versions](https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/CHAP_PostgreSQL.html#PostgreSQL.Concepts.General.DBVersions) + * in the *Amazon RDS User Guide.*. + * + * @param engineVersion the engineVersion value to set. + * @return the AwsRdsDBInstanceProperties object itself. + */ + public AwsRdsDBInstanceProperties withEngineVersion(String engineVersion) { + this.engineVersion = engineVersion; + return this; + } + + /** + * Get the iops property: The number of I/O operations per second (IOPS) that the database provisions. The value + * must be equal to or greater than 1000. If you specify this property, you must follow the range of allowed ratios + * of your requested IOPS rate to the amount of storage that you allocate (IOPS to allocated storage). For example, + * you can provision an Oracle database instance with 1000 IOPS and 200 GiB of storage (a ratio of 5:1), or specify + * 2000 IOPS with 200 GiB of storage (a ratio of 10:1). For more information, see [Amazon RDS Provisioned IOPS + * Storage to Improve + * Performance](https://docs.aws.amazon.com/AmazonRDS/latest/DeveloperGuide/CHAP_Storage.html#USER_PIOPS) in the + * *Amazon RDS User Guide*. If you specify ``io1`` for the ``StorageType`` property, then you must also specify the + * ``Iops`` property. Constraints: + For RDS for Db2, MariaDB, MySQL, Oracle, and PostgreSQL - Must be a multiple + * between .5 and 50 of the storage amount for the DB instance. + For RDS for SQL Server - Must be a multiple + * between 1 and 50 of the storage amount for the DB instance. + * + * @return the iops value. + */ + public Integer iops() { + return this.iops; + } + + /** + * Set the iops property: The number of I/O operations per second (IOPS) that the database provisions. The value + * must be equal to or greater than 1000. If you specify this property, you must follow the range of allowed ratios + * of your requested IOPS rate to the amount of storage that you allocate (IOPS to allocated storage). For example, + * you can provision an Oracle database instance with 1000 IOPS and 200 GiB of storage (a ratio of 5:1), or specify + * 2000 IOPS with 200 GiB of storage (a ratio of 10:1). For more information, see [Amazon RDS Provisioned IOPS + * Storage to Improve + * Performance](https://docs.aws.amazon.com/AmazonRDS/latest/DeveloperGuide/CHAP_Storage.html#USER_PIOPS) in the + * *Amazon RDS User Guide*. If you specify ``io1`` for the ``StorageType`` property, then you must also specify the + * ``Iops`` property. Constraints: + For RDS for Db2, MariaDB, MySQL, Oracle, and PostgreSQL - Must be a multiple + * between .5 and 50 of the storage amount for the DB instance. + For RDS for SQL Server - Must be a multiple + * between 1 and 50 of the storage amount for the DB instance. + * + * @param iops the iops value to set. + * @return the AwsRdsDBInstanceProperties object itself. + */ + public AwsRdsDBInstanceProperties withIops(Integer iops) { + this.iops = iops; + return this; + } + + /** + * Get the kmsKeyId property: The ARN of the AWS KMS key that's used to encrypt the DB instance, such as + * ``arn:aws:kms:us-east-1:012345678910:key/abcd1234-a123-456a-a12b-a123b4cd56ef``. If you enable the + * StorageEncrypted property but don't specify this property, AWS CloudFormation uses the default KMS key. If you + * specify this property, you must set the StorageEncrypted property to true. If you specify the + * ``SourceDBInstanceIdentifier`` property, the value is inherited from the source DB instance if the read replica + * is created in the same region. If you create an encrypted read replica in a different AWS Region, then you must + * specify a KMS key for the destination AWS Region. KMS encryption keys are specific to the region that they're + * created in, and you can't use encryption keys from one region in another region. If you specify the + * ``SnapshotIdentifier`` property, the ``StorageEncrypted`` property value is inherited from the snapshot, and if + * the DB instance is encrypted, the specified ``KmsKeyId`` property is used. If you specify ``DBSecurityGroups``, + * AWS CloudFormation ignores this property. To specify both a security group and this property, you must use a VPC + * security group. For more information about Amazon RDS and VPC, see [Using Amazon RDS with Amazon + * VPC](https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_VPC.html) in the *Amazon RDS User Guide*. + * *Amazon Aurora* Not applicable. The KMS key identifier is managed by the DB cluster. + * + * @return the kmsKeyId value. + */ + public String kmsKeyId() { + return this.kmsKeyId; + } + + /** + * Set the kmsKeyId property: The ARN of the AWS KMS key that's used to encrypt the DB instance, such as + * ``arn:aws:kms:us-east-1:012345678910:key/abcd1234-a123-456a-a12b-a123b4cd56ef``. If you enable the + * StorageEncrypted property but don't specify this property, AWS CloudFormation uses the default KMS key. If you + * specify this property, you must set the StorageEncrypted property to true. If you specify the + * ``SourceDBInstanceIdentifier`` property, the value is inherited from the source DB instance if the read replica + * is created in the same region. If you create an encrypted read replica in a different AWS Region, then you must + * specify a KMS key for the destination AWS Region. KMS encryption keys are specific to the region that they're + * created in, and you can't use encryption keys from one region in another region. If you specify the + * ``SnapshotIdentifier`` property, the ``StorageEncrypted`` property value is inherited from the snapshot, and if + * the DB instance is encrypted, the specified ``KmsKeyId`` property is used. If you specify ``DBSecurityGroups``, + * AWS CloudFormation ignores this property. To specify both a security group and this property, you must use a VPC + * security group. For more information about Amazon RDS and VPC, see [Using Amazon RDS with Amazon + * VPC](https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_VPC.html) in the *Amazon RDS User Guide*. + * *Amazon Aurora* Not applicable. The KMS key identifier is managed by the DB cluster. + * + * @param kmsKeyId the kmsKeyId value to set. + * @return the AwsRdsDBInstanceProperties object itself. + */ + public AwsRdsDBInstanceProperties withKmsKeyId(String kmsKeyId) { + this.kmsKeyId = kmsKeyId; + return this; + } + + /** + * Get the licenseModel property: License model information for this DB instance. Valid Values: + Aurora MySQL - + * ``general-public-license`` + Aurora PostgreSQL - ``postgresql-license`` + RDS for Db2 - + * ``bring-your-own-license``. For more information about RDS for Db2 licensing, see + * [](https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/db2-licensing.html) in the *Amazon RDS User Guide.* + + * RDS for MariaDB - ``general-public-license`` + RDS for Microsoft SQL Server - ``license-included`` + RDS for + * MySQL - ``general-public-license`` + RDS for Oracle - ``bring-your-own-license`` or ``license-included`` + RDS + * for PostgreSQL - ``postgresql-license`` If you've specified ``DBSecurityGroups`` and then you update the license + * model, AWS CloudFormation replaces the underlying DB instance. This will incur some interruptions to database + * availability. + * + * @return the licenseModel value. + */ + public String licenseModel() { + return this.licenseModel; + } + + /** + * Set the licenseModel property: License model information for this DB instance. Valid Values: + Aurora MySQL - + * ``general-public-license`` + Aurora PostgreSQL - ``postgresql-license`` + RDS for Db2 - + * ``bring-your-own-license``. For more information about RDS for Db2 licensing, see + * [](https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/db2-licensing.html) in the *Amazon RDS User Guide.* + + * RDS for MariaDB - ``general-public-license`` + RDS for Microsoft SQL Server - ``license-included`` + RDS for + * MySQL - ``general-public-license`` + RDS for Oracle - ``bring-your-own-license`` or ``license-included`` + RDS + * for PostgreSQL - ``postgresql-license`` If you've specified ``DBSecurityGroups`` and then you update the license + * model, AWS CloudFormation replaces the underlying DB instance. This will incur some interruptions to database + * availability. + * + * @param licenseModel the licenseModel value to set. + * @return the AwsRdsDBInstanceProperties object itself. + */ + public AwsRdsDBInstanceProperties withLicenseModel(String licenseModel) { + this.licenseModel = licenseModel; + return this; + } + + /** + * Get the manageMasterUserPassword property: Specifies whether to manage the master user password with AWS Secrets + * Manager. For more information, see [Password management with Secrets + * Manager](https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/rds-secrets-manager.html) in the *Amazon RDS User + * Guide.* Constraints: + Can't manage the master user password with AWS Secrets Manager if ``MasterUserPassword`` + * is specified. + * + * @return the manageMasterUserPassword value. + */ + public Boolean manageMasterUserPassword() { + return this.manageMasterUserPassword; + } + + /** + * Set the manageMasterUserPassword property: Specifies whether to manage the master user password with AWS Secrets + * Manager. For more information, see [Password management with Secrets + * Manager](https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/rds-secrets-manager.html) in the *Amazon RDS User + * Guide.* Constraints: + Can't manage the master user password with AWS Secrets Manager if ``MasterUserPassword`` + * is specified. + * + * @param manageMasterUserPassword the manageMasterUserPassword value to set. + * @return the AwsRdsDBInstanceProperties object itself. + */ + public AwsRdsDBInstanceProperties withManageMasterUserPassword(Boolean manageMasterUserPassword) { + this.manageMasterUserPassword = manageMasterUserPassword; + return this; + } + + /** + * Get the masterUserPassword property: The password for the master user. The password can include any printable + * ASCII character except '/', ''', or '@'. *Amazon Aurora* Not applicable. The password for the master user is + * managed by the DB cluster. *RDS for Db2* Must contain from 8 to 255 characters. *RDS for MariaDB* Constraints: + * Must contain from 8 to 41 characters. *RDS for Microsoft SQL Server* Constraints: Must contain from 8 to 128 + * characters. *RDS for MySQL* Constraints: Must contain from 8 to 41 characters. *RDS for Oracle* Constraints: Must + * contain from 8 to 30 characters. *RDS for PostgreSQL* Constraints: Must contain from 8 to 128 characters. + * + * @return the masterUserPassword value. + */ + public String masterUserPassword() { + return this.masterUserPassword; + } + + /** + * Set the masterUserPassword property: The password for the master user. The password can include any printable + * ASCII character except '/', ''', or '@'. *Amazon Aurora* Not applicable. The password for the master user is + * managed by the DB cluster. *RDS for Db2* Must contain from 8 to 255 characters. *RDS for MariaDB* Constraints: + * Must contain from 8 to 41 characters. *RDS for Microsoft SQL Server* Constraints: Must contain from 8 to 128 + * characters. *RDS for MySQL* Constraints: Must contain from 8 to 41 characters. *RDS for Oracle* Constraints: Must + * contain from 8 to 30 characters. *RDS for PostgreSQL* Constraints: Must contain from 8 to 128 characters. + * + * @param masterUserPassword the masterUserPassword value to set. + * @return the AwsRdsDBInstanceProperties object itself. + */ + public AwsRdsDBInstanceProperties withMasterUserPassword(String masterUserPassword) { + this.masterUserPassword = masterUserPassword; + return this; + } + + /** + * Get the masterUserSecret property: The secret managed by RDS in AWS Secrets Manager for the master user password. + * For more information, see [Password management with Secrets + * Manager](https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/rds-secrets-manager.html) in the *Amazon RDS User + * Guide.* The ``MasterUserSecret`` return value specifies the secret managed by RDS in AWS Secrets Manager for the + * master user password. For more information, see [Password management with Secrets + * Manager](https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/rds-secrets-manager.html) in the *Amazon RDS User + * Guide* and [Password management with Secrets + * Manager](https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/rds-secrets-manager.html) in the *Amazon + * Aurora User Guide.*. + * + * @return the masterUserSecret value. + */ + public MasterUserSecret masterUserSecret() { + return this.masterUserSecret; + } + + /** + * Set the masterUserSecret property: The secret managed by RDS in AWS Secrets Manager for the master user password. + * For more information, see [Password management with Secrets + * Manager](https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/rds-secrets-manager.html) in the *Amazon RDS User + * Guide.* The ``MasterUserSecret`` return value specifies the secret managed by RDS in AWS Secrets Manager for the + * master user password. For more information, see [Password management with Secrets + * Manager](https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/rds-secrets-manager.html) in the *Amazon RDS User + * Guide* and [Password management with Secrets + * Manager](https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/rds-secrets-manager.html) in the *Amazon + * Aurora User Guide.*. + * + * @param masterUserSecret the masterUserSecret value to set. + * @return the AwsRdsDBInstanceProperties object itself. + */ + public AwsRdsDBInstanceProperties withMasterUserSecret(MasterUserSecret masterUserSecret) { + this.masterUserSecret = masterUserSecret; + return this; + } + + /** + * Get the masterUsername property: The master user name for the DB instance. If you specify the + * ``SourceDBInstanceIdentifier`` or ``DBSnapshotIdentifier`` property, don't specify this property. The value is + * inherited from the source DB instance or snapshot. When migrating a self-managed Db2 database, we recommend that + * you use the same master username as your self-managed Db2 instance name. *Amazon Aurora* Not applicable. The name + * for the master user is managed by the DB cluster. *RDS for Db2* Constraints: + Must be 1 to 16 letters or + * numbers. + First character must be a letter. + Can't be a reserved word for the chosen database engine. *RDS for + * MariaDB* Constraints: + Must be 1 to 16 letters or numbers. + Can't be a reserved word for the chosen database + * engine. *RDS for Microsoft SQL Server* Constraints: + Must be 1 to 128 letters or numbers. + First character must + * be a letter. + Can't be a reserved word for the chosen database engine. *RDS for MySQL* Constraints: + Must be 1 + * to 16 letters or numbers. + First character must be a letter. + Can't be a reserved word for the chosen database + * engine. *RDS for Oracle* Constraints: + Must be 1 to 30 letters or numbers. + First character must be a letter. + + * Can't be a reserved word for the chosen database engine. *RDS for PostgreSQL* Constraints: + Must be 1 to 63 + * letters or numbers. + First character must be a letter. + Can't be a reserved word for the chosen database + * engine. + * + * @return the masterUsername value. + */ + public String masterUsername() { + return this.masterUsername; + } + + /** + * Set the masterUsername property: The master user name for the DB instance. If you specify the + * ``SourceDBInstanceIdentifier`` or ``DBSnapshotIdentifier`` property, don't specify this property. The value is + * inherited from the source DB instance or snapshot. When migrating a self-managed Db2 database, we recommend that + * you use the same master username as your self-managed Db2 instance name. *Amazon Aurora* Not applicable. The name + * for the master user is managed by the DB cluster. *RDS for Db2* Constraints: + Must be 1 to 16 letters or + * numbers. + First character must be a letter. + Can't be a reserved word for the chosen database engine. *RDS for + * MariaDB* Constraints: + Must be 1 to 16 letters or numbers. + Can't be a reserved word for the chosen database + * engine. *RDS for Microsoft SQL Server* Constraints: + Must be 1 to 128 letters or numbers. + First character must + * be a letter. + Can't be a reserved word for the chosen database engine. *RDS for MySQL* Constraints: + Must be 1 + * to 16 letters or numbers. + First character must be a letter. + Can't be a reserved word for the chosen database + * engine. *RDS for Oracle* Constraints: + Must be 1 to 30 letters or numbers. + First character must be a letter. + + * Can't be a reserved word for the chosen database engine. *RDS for PostgreSQL* Constraints: + Must be 1 to 63 + * letters or numbers. + First character must be a letter. + Can't be a reserved word for the chosen database + * engine. + * + * @param masterUsername the masterUsername value to set. + * @return the AwsRdsDBInstanceProperties object itself. + */ + public AwsRdsDBInstanceProperties withMasterUsername(String masterUsername) { + this.masterUsername = masterUsername; + return this; + } + + /** + * Get the maxAllocatedStorage property: The upper limit in gibibytes (GiB) to which Amazon RDS can automatically + * scale the storage of the DB instance. For more information about this setting, including limitations that apply + * to it, see [Managing capacity automatically with Amazon RDS storage + * autoscaling](https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_PIOPS.StorageTypes.html#USER_PIOPS.Autoscaling) + * in the *Amazon RDS User Guide*. This setting doesn't apply to the following DB instances: + Amazon Aurora + * (Storage is managed by the DB cluster.) + RDS Custom. + * + * @return the maxAllocatedStorage value. + */ + public Integer maxAllocatedStorage() { + return this.maxAllocatedStorage; + } + + /** + * Set the maxAllocatedStorage property: The upper limit in gibibytes (GiB) to which Amazon RDS can automatically + * scale the storage of the DB instance. For more information about this setting, including limitations that apply + * to it, see [Managing capacity automatically with Amazon RDS storage + * autoscaling](https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_PIOPS.StorageTypes.html#USER_PIOPS.Autoscaling) + * in the *Amazon RDS User Guide*. This setting doesn't apply to the following DB instances: + Amazon Aurora + * (Storage is managed by the DB cluster.) + RDS Custom. + * + * @param maxAllocatedStorage the maxAllocatedStorage value to set. + * @return the AwsRdsDBInstanceProperties object itself. + */ + public AwsRdsDBInstanceProperties withMaxAllocatedStorage(Integer maxAllocatedStorage) { + this.maxAllocatedStorage = maxAllocatedStorage; + return this; + } + + /** + * Get the monitoringInterval property: The interval, in seconds, between points when Enhanced Monitoring metrics + * are collected for the DB instance. To disable collection of Enhanced Monitoring metrics, specify 0. The default + * is 0. If ``MonitoringRoleArn`` is specified, then you must set ``MonitoringInterval`` to a value other than 0. + * This setting doesn't apply to RDS Custom. Valid Values: ``0, 1, 5, 10, 15, 30, 60``. + * + * @return the monitoringInterval value. + */ + public Integer monitoringInterval() { + return this.monitoringInterval; + } + + /** + * Set the monitoringInterval property: The interval, in seconds, between points when Enhanced Monitoring metrics + * are collected for the DB instance. To disable collection of Enhanced Monitoring metrics, specify 0. The default + * is 0. If ``MonitoringRoleArn`` is specified, then you must set ``MonitoringInterval`` to a value other than 0. + * This setting doesn't apply to RDS Custom. Valid Values: ``0, 1, 5, 10, 15, 30, 60``. + * + * @param monitoringInterval the monitoringInterval value to set. + * @return the AwsRdsDBInstanceProperties object itself. + */ + public AwsRdsDBInstanceProperties withMonitoringInterval(Integer monitoringInterval) { + this.monitoringInterval = monitoringInterval; + return this; + } + + /** + * Get the monitoringRoleArn property: The ARN for the IAM role that permits RDS to send enhanced monitoring metrics + * to Amazon CloudWatch Logs. For example, ``arn:aws:iam:123456789012:role/emaccess``. For information on creating a + * monitoring role, see [Setting Up and Enabling Enhanced + * Monitoring](https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_Monitoring.OS.html#USER_Monitoring.OS.Enabling) + * in the *Amazon RDS User Guide*. If ``MonitoringInterval`` is set to a value other than ``0``, then you must + * supply a ``MonitoringRoleArn`` value. This setting doesn't apply to RDS Custom DB instances. + * + * @return the monitoringRoleArn value. + */ + public String monitoringRoleArn() { + return this.monitoringRoleArn; + } + + /** + * Set the monitoringRoleArn property: The ARN for the IAM role that permits RDS to send enhanced monitoring metrics + * to Amazon CloudWatch Logs. For example, ``arn:aws:iam:123456789012:role/emaccess``. For information on creating a + * monitoring role, see [Setting Up and Enabling Enhanced + * Monitoring](https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_Monitoring.OS.html#USER_Monitoring.OS.Enabling) + * in the *Amazon RDS User Guide*. If ``MonitoringInterval`` is set to a value other than ``0``, then you must + * supply a ``MonitoringRoleArn`` value. This setting doesn't apply to RDS Custom DB instances. + * + * @param monitoringRoleArn the monitoringRoleArn value to set. + * @return the AwsRdsDBInstanceProperties object itself. + */ + public AwsRdsDBInstanceProperties withMonitoringRoleArn(String monitoringRoleArn) { + this.monitoringRoleArn = monitoringRoleArn; + return this; + } + + /** + * Get the multiAZ property: Specifies whether the database instance is a Multi-AZ DB instance deployment. You can't + * set the ``AvailabilityZone`` parameter if the ``MultiAZ`` parameter is set to true. For more information, see + * [Multi-AZ deployments for high + * availability](https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/Concepts.MultiAZ.html) in the *Amazon RDS + * User Guide*. *Amazon Aurora* Not applicable. Amazon Aurora storage is replicated across all of the Availability + * Zones and doesn't require the ``MultiAZ`` option to be set. + * + * @return the multiAZ value. + */ + public Boolean multiAZ() { + return this.multiAZ; + } + + /** + * Set the multiAZ property: Specifies whether the database instance is a Multi-AZ DB instance deployment. You can't + * set the ``AvailabilityZone`` parameter if the ``MultiAZ`` parameter is set to true. For more information, see + * [Multi-AZ deployments for high + * availability](https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/Concepts.MultiAZ.html) in the *Amazon RDS + * User Guide*. *Amazon Aurora* Not applicable. Amazon Aurora storage is replicated across all of the Availability + * Zones and doesn't require the ``MultiAZ`` option to be set. + * + * @param multiAZ the multiAZ value to set. + * @return the AwsRdsDBInstanceProperties object itself. + */ + public AwsRdsDBInstanceProperties withMultiAZ(Boolean multiAZ) { + this.multiAZ = multiAZ; + return this; + } + + /** + * Get the ncharCharacterSetName property: The name of the NCHAR character set for the Oracle DB instance. This + * setting doesn't apply to RDS Custom DB instances. + * + * @return the ncharCharacterSetName value. + */ + public String ncharCharacterSetName() { + return this.ncharCharacterSetName; + } + + /** + * Set the ncharCharacterSetName property: The name of the NCHAR character set for the Oracle DB instance. This + * setting doesn't apply to RDS Custom DB instances. + * + * @param ncharCharacterSetName the ncharCharacterSetName value to set. + * @return the AwsRdsDBInstanceProperties object itself. + */ + public AwsRdsDBInstanceProperties withNcharCharacterSetName(String ncharCharacterSetName) { + this.ncharCharacterSetName = ncharCharacterSetName; + return this; + } + + /** + * Get the networkType property: The network type of the DB instance. Valid values: + ``IPV4`` + ``DUAL`` The + * network type is determined by the ``DBSubnetGroup`` specified for the DB instance. A ``DBSubnetGroup`` can + * support only the IPv4 protocol or the IPv4 and IPv6 protocols (``DUAL``). For more information, see [Working with + * a DB instance in a + * VPC](https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_VPC.WorkingWithRDSInstanceinaVPC.html) in the + * *Amazon RDS User Guide.*. + * + * @return the networkType value. + */ + public String networkType() { + return this.networkType; + } + + /** + * Set the networkType property: The network type of the DB instance. Valid values: + ``IPV4`` + ``DUAL`` The + * network type is determined by the ``DBSubnetGroup`` specified for the DB instance. A ``DBSubnetGroup`` can + * support only the IPv4 protocol or the IPv4 and IPv6 protocols (``DUAL``). For more information, see [Working with + * a DB instance in a + * VPC](https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_VPC.WorkingWithRDSInstanceinaVPC.html) in the + * *Amazon RDS User Guide.*. + * + * @param networkType the networkType value to set. + * @return the AwsRdsDBInstanceProperties object itself. + */ + public AwsRdsDBInstanceProperties withNetworkType(String networkType) { + this.networkType = networkType; + return this; + } + + /** + * Get the optionGroupName property: Indicates that the DB instance should be associated with the specified option + * group. Permanent options, such as the TDE option for Oracle Advanced Security TDE, can't be removed from an + * option group. Also, that option group can't be removed from a DB instance once it is associated with a DB + * instance. + * + * @return the optionGroupName value. + */ + public String optionGroupName() { + return this.optionGroupName; + } + + /** + * Set the optionGroupName property: Indicates that the DB instance should be associated with the specified option + * group. Permanent options, such as the TDE option for Oracle Advanced Security TDE, can't be removed from an + * option group. Also, that option group can't be removed from a DB instance once it is associated with a DB + * instance. + * + * @param optionGroupName the optionGroupName value to set. + * @return the AwsRdsDBInstanceProperties object itself. + */ + public AwsRdsDBInstanceProperties withOptionGroupName(String optionGroupName) { + this.optionGroupName = optionGroupName; + return this; + } + + /** + * Get the performanceInsightsKmsKeyId property: The AWS KMS key identifier for encryption of Performance Insights + * data. The KMS key identifier is the key ARN, key ID, alias ARN, or alias name for the KMS key. If you do not + * specify a value for ``PerformanceInsightsKMSKeyId``, then Amazon RDS uses your default KMS key. There is a + * default KMS key for your AWS account. Your AWS account has a different default KMS key for each AWS Region. For + * information about enabling Performance Insights, see + * [EnablePerformanceInsights](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-rds-database-instance.html#cfn-rds-dbinstance-enableperformanceinsights). + * + * @return the performanceInsightsKmsKeyId value. + */ + public String performanceInsightsKmsKeyId() { + return this.performanceInsightsKmsKeyId; + } + + /** + * Set the performanceInsightsKmsKeyId property: The AWS KMS key identifier for encryption of Performance Insights + * data. The KMS key identifier is the key ARN, key ID, alias ARN, or alias name for the KMS key. If you do not + * specify a value for ``PerformanceInsightsKMSKeyId``, then Amazon RDS uses your default KMS key. There is a + * default KMS key for your AWS account. Your AWS account has a different default KMS key for each AWS Region. For + * information about enabling Performance Insights, see + * [EnablePerformanceInsights](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-rds-database-instance.html#cfn-rds-dbinstance-enableperformanceinsights). + * + * @param performanceInsightsKmsKeyId the performanceInsightsKmsKeyId value to set. + * @return the AwsRdsDBInstanceProperties object itself. + */ + public AwsRdsDBInstanceProperties withPerformanceInsightsKmsKeyId(String performanceInsightsKmsKeyId) { + this.performanceInsightsKmsKeyId = performanceInsightsKmsKeyId; + return this; + } + + /** + * Get the performanceInsightsRetentionPeriod property: The number of days to retain Performance Insights data. This + * setting doesn't apply to RDS Custom DB instances. Valid Values: + ``7`` + *month* * 31, where *month* is a number + * of months from 1-23. Examples: ``93`` (3 months * 31), ``341`` (11 months * 31), ``589`` (19 months * 31) + + * ``731`` Default: ``7`` days If you specify a retention period that isn't valid, such as ``94``, Amazon RDS + * returns an error. + * + * @return the performanceInsightsRetentionPeriod value. + */ + public Integer performanceInsightsRetentionPeriod() { + return this.performanceInsightsRetentionPeriod; + } + + /** + * Set the performanceInsightsRetentionPeriod property: The number of days to retain Performance Insights data. This + * setting doesn't apply to RDS Custom DB instances. Valid Values: + ``7`` + *month* * 31, where *month* is a number + * of months from 1-23. Examples: ``93`` (3 months * 31), ``341`` (11 months * 31), ``589`` (19 months * 31) + + * ``731`` Default: ``7`` days If you specify a retention period that isn't valid, such as ``94``, Amazon RDS + * returns an error. + * + * @param performanceInsightsRetentionPeriod the performanceInsightsRetentionPeriod value to set. + * @return the AwsRdsDBInstanceProperties object itself. + */ + public AwsRdsDBInstanceProperties + withPerformanceInsightsRetentionPeriod(Integer performanceInsightsRetentionPeriod) { + this.performanceInsightsRetentionPeriod = performanceInsightsRetentionPeriod; + return this; + } + + /** + * Get the port property: The port number on which the database accepts connections. *Amazon Aurora* Not applicable. + * The port number is managed by the DB cluster. *Db2* Default value: ``50000``. + * + * @return the port value. + */ + public String port() { + return this.port; + } + + /** + * Set the port property: The port number on which the database accepts connections. *Amazon Aurora* Not applicable. + * The port number is managed by the DB cluster. *Db2* Default value: ``50000``. + * + * @param port the port value to set. + * @return the AwsRdsDBInstanceProperties object itself. + */ + public AwsRdsDBInstanceProperties withPort(String port) { + this.port = port; + return this; + } + + /** + * Get the preferredBackupWindow property: The daily time range during which automated backups are created if + * automated backups are enabled, using the ``BackupRetentionPeriod`` parameter. For more information, see [Backup + * Window](https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_WorkingWithAutomatedBackups.html#USER_WorkingWithAutomatedBackups.BackupWindow) + * in the *Amazon RDS User Guide.* Constraints: + Must be in the format ``hh24:mi-hh24:mi``. + Must be in Universal + * Coordinated Time (UTC). + Must not conflict with the preferred maintenance window. + Must be at least 30 minutes. + * *Amazon Aurora* Not applicable. The daily time range for creating automated backups is managed by the DB cluster. + * + * @return the preferredBackupWindow value. + */ + public String preferredBackupWindow() { + return this.preferredBackupWindow; + } + + /** + * Set the preferredBackupWindow property: The daily time range during which automated backups are created if + * automated backups are enabled, using the ``BackupRetentionPeriod`` parameter. For more information, see [Backup + * Window](https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_WorkingWithAutomatedBackups.html#USER_WorkingWithAutomatedBackups.BackupWindow) + * in the *Amazon RDS User Guide.* Constraints: + Must be in the format ``hh24:mi-hh24:mi``. + Must be in Universal + * Coordinated Time (UTC). + Must not conflict with the preferred maintenance window. + Must be at least 30 minutes. + * *Amazon Aurora* Not applicable. The daily time range for creating automated backups is managed by the DB cluster. + * + * @param preferredBackupWindow the preferredBackupWindow value to set. + * @return the AwsRdsDBInstanceProperties object itself. + */ + public AwsRdsDBInstanceProperties withPreferredBackupWindow(String preferredBackupWindow) { + this.preferredBackupWindow = preferredBackupWindow; + return this; + } + + /** + * Get the preferredMaintenanceWindow property: The weekly time range during which system maintenance can occur, in + * Universal Coordinated Time (UTC). Format: ``ddd:hh24:mi-ddd:hh24:mi`` The default is a 30-minute window selected + * at random from an 8-hour block of time for each AWS Region, occurring on a random day of the week. To see the + * time blocks available, see [Adjusting the Preferred DB Instance Maintenance + * Window](https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_UpgradeDBInstance.Maintenance.html#AdjustingTheMaintenanceWindow) + * in the *Amazon RDS User Guide.* This property applies when AWS CloudFormation initially creates the DB instance. + * If you use AWS CloudFormation to update the DB instance, those updates are applied immediately. Constraints: + * Minimum 30-minute window. + * + * @return the preferredMaintenanceWindow value. + */ + public String preferredMaintenanceWindow() { + return this.preferredMaintenanceWindow; + } + + /** + * Set the preferredMaintenanceWindow property: The weekly time range during which system maintenance can occur, in + * Universal Coordinated Time (UTC). Format: ``ddd:hh24:mi-ddd:hh24:mi`` The default is a 30-minute window selected + * at random from an 8-hour block of time for each AWS Region, occurring on a random day of the week. To see the + * time blocks available, see [Adjusting the Preferred DB Instance Maintenance + * Window](https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_UpgradeDBInstance.Maintenance.html#AdjustingTheMaintenanceWindow) + * in the *Amazon RDS User Guide.* This property applies when AWS CloudFormation initially creates the DB instance. + * If you use AWS CloudFormation to update the DB instance, those updates are applied immediately. Constraints: + * Minimum 30-minute window. + * + * @param preferredMaintenanceWindow the preferredMaintenanceWindow value to set. + * @return the AwsRdsDBInstanceProperties object itself. + */ + public AwsRdsDBInstanceProperties withPreferredMaintenanceWindow(String preferredMaintenanceWindow) { + this.preferredMaintenanceWindow = preferredMaintenanceWindow; + return this; + } + + /** + * Get the processorFeatures property: The number of CPU cores and the number of threads per core for the DB + * instance class of the DB instance. This setting doesn't apply to Amazon Aurora or RDS Custom DB instances. + * + * @return the processorFeatures value. + */ + public List processorFeatures() { + return this.processorFeatures; + } + + /** + * Set the processorFeatures property: The number of CPU cores and the number of threads per core for the DB + * instance class of the DB instance. This setting doesn't apply to Amazon Aurora or RDS Custom DB instances. + * + * @param processorFeatures the processorFeatures value to set. + * @return the AwsRdsDBInstanceProperties object itself. + */ + public AwsRdsDBInstanceProperties withProcessorFeatures(List processorFeatures) { + this.processorFeatures = processorFeatures; + return this; + } + + /** + * Get the promotionTier property: The order of priority in which an Aurora Replica is promoted to the primary + * instance after a failure of the existing primary instance. For more information, see [Fault Tolerance for an + * Aurora DB + * Cluster](https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/Concepts.AuroraHighAvailability.html#Aurora.Managing.FaultTolerance) + * in the *Amazon Aurora User Guide*. This setting doesn't apply to RDS Custom DB instances. Default: ``1`` Valid + * Values: ``0 - 15``. + * + * @return the promotionTier value. + */ + public Integer promotionTier() { + return this.promotionTier; + } + + /** + * Set the promotionTier property: The order of priority in which an Aurora Replica is promoted to the primary + * instance after a failure of the existing primary instance. For more information, see [Fault Tolerance for an + * Aurora DB + * Cluster](https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/Concepts.AuroraHighAvailability.html#Aurora.Managing.FaultTolerance) + * in the *Amazon Aurora User Guide*. This setting doesn't apply to RDS Custom DB instances. Default: ``1`` Valid + * Values: ``0 - 15``. + * + * @param promotionTier the promotionTier value to set. + * @return the AwsRdsDBInstanceProperties object itself. + */ + public AwsRdsDBInstanceProperties withPromotionTier(Integer promotionTier) { + this.promotionTier = promotionTier; + return this; + } + + /** + * Get the publiclyAccessible property: Indicates whether the DB instance is an internet-facing instance. If you + * specify true, AWS CloudFormation creates an instance with a publicly resolvable DNS name, which resolves to a + * public IP address. If you specify false, AWS CloudFormation creates an internal instance with a DNS name that + * resolves to a private IP address. The default behavior value depends on your VPC setup and the database subnet + * group. For more information, see the ``PubliclyAccessible`` parameter in the + * [CreateDBInstance](https://docs.aws.amazon.com/AmazonRDS/latest/APIReference/API_CreateDBInstance.html) in the + * *Amazon RDS API Reference*. + * + * @return the publiclyAccessible value. + */ + public Boolean publiclyAccessible() { + return this.publiclyAccessible; + } + + /** + * Set the publiclyAccessible property: Indicates whether the DB instance is an internet-facing instance. If you + * specify true, AWS CloudFormation creates an instance with a publicly resolvable DNS name, which resolves to a + * public IP address. If you specify false, AWS CloudFormation creates an internal instance with a DNS name that + * resolves to a private IP address. The default behavior value depends on your VPC setup and the database subnet + * group. For more information, see the ``PubliclyAccessible`` parameter in the + * [CreateDBInstance](https://docs.aws.amazon.com/AmazonRDS/latest/APIReference/API_CreateDBInstance.html) in the + * *Amazon RDS API Reference*. + * + * @param publiclyAccessible the publiclyAccessible value to set. + * @return the AwsRdsDBInstanceProperties object itself. + */ + public AwsRdsDBInstanceProperties withPubliclyAccessible(Boolean publiclyAccessible) { + this.publiclyAccessible = publiclyAccessible; + return this; + } + + /** + * Get the replicaMode property: The open mode of an Oracle read replica. For more information, see [Working with + * Oracle Read Replicas for Amazon + * RDS](https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/oracle-read-replicas.html) in the *Amazon RDS User + * Guide*. This setting is only supported in RDS for Oracle. Default: ``open-read-only`` Valid Values: + * ``open-read-only`` or ``mounted``. + * + * @return the replicaMode value. + */ + public String replicaMode() { + return this.replicaMode; + } + + /** + * Set the replicaMode property: The open mode of an Oracle read replica. For more information, see [Working with + * Oracle Read Replicas for Amazon + * RDS](https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/oracle-read-replicas.html) in the *Amazon RDS User + * Guide*. This setting is only supported in RDS for Oracle. Default: ``open-read-only`` Valid Values: + * ``open-read-only`` or ``mounted``. + * + * @param replicaMode the replicaMode value to set. + * @return the AwsRdsDBInstanceProperties object itself. + */ + public AwsRdsDBInstanceProperties withReplicaMode(String replicaMode) { + this.replicaMode = replicaMode; + return this; + } + + /** + * Get the restoreTime property: The date and time to restore from. Constraints: + Must be a time in Universal + * Coordinated Time (UTC) format. + Must be before the latest restorable time for the DB instance. + Can't be + * specified if the ``UseLatestRestorableTime`` parameter is enabled. Example: ``2009-09-07T23:45:00Z``. + * + * @return the restoreTime value. + */ + public String restoreTime() { + return this.restoreTime; + } + + /** + * Set the restoreTime property: The date and time to restore from. Constraints: + Must be a time in Universal + * Coordinated Time (UTC) format. + Must be before the latest restorable time for the DB instance. + Can't be + * specified if the ``UseLatestRestorableTime`` parameter is enabled. Example: ``2009-09-07T23:45:00Z``. + * + * @param restoreTime the restoreTime value to set. + * @return the AwsRdsDBInstanceProperties object itself. + */ + public AwsRdsDBInstanceProperties withRestoreTime(String restoreTime) { + this.restoreTime = restoreTime; + return this; + } + + /** + * Get the sourceDBClusterIdentifier property: The identifier of the Multi-AZ DB cluster that will act as the source + * for the read replica. Each DB cluster can have up to 15 read replicas. Constraints: + Must be the identifier of + * an existing Multi-AZ DB cluster. + Can't be specified if the ``SourceDBInstanceIdentifier`` parameter is also + * specified. + The specified DB cluster must have automatic backups enabled, that is, its backup retention period + * must be greater than 0. + The source DB cluster must be in the same AWS-Region as the read replica. Cross-Region + * replication isn't supported. + * + * @return the sourceDBClusterIdentifier value. + */ + public String sourceDBClusterIdentifier() { + return this.sourceDBClusterIdentifier; + } + + /** + * Set the sourceDBClusterIdentifier property: The identifier of the Multi-AZ DB cluster that will act as the source + * for the read replica. Each DB cluster can have up to 15 read replicas. Constraints: + Must be the identifier of + * an existing Multi-AZ DB cluster. + Can't be specified if the ``SourceDBInstanceIdentifier`` parameter is also + * specified. + The specified DB cluster must have automatic backups enabled, that is, its backup retention period + * must be greater than 0. + The source DB cluster must be in the same AWS-Region as the read replica. Cross-Region + * replication isn't supported. + * + * @param sourceDBClusterIdentifier the sourceDBClusterIdentifier value to set. + * @return the AwsRdsDBInstanceProperties object itself. + */ + public AwsRdsDBInstanceProperties withSourceDBClusterIdentifier(String sourceDBClusterIdentifier) { + this.sourceDBClusterIdentifier = sourceDBClusterIdentifier; + return this; + } + + /** + * Get the sourceDBInstanceAutomatedBackupsArn property: The Amazon Resource Name (ARN) of the replicated automated + * backups from which to restore, for example, + * ``arn:aws:rds:us-east-1:123456789012:auto-backup:ab-L2IJCEXJP7XQ7HOJ4SIEXAMPLE``. This setting doesn't apply to + * RDS Custom. + * + * @return the sourceDBInstanceAutomatedBackupsArn value. + */ + public String sourceDBInstanceAutomatedBackupsArn() { + return this.sourceDBInstanceAutomatedBackupsArn; + } + + /** + * Set the sourceDBInstanceAutomatedBackupsArn property: The Amazon Resource Name (ARN) of the replicated automated + * backups from which to restore, for example, + * ``arn:aws:rds:us-east-1:123456789012:auto-backup:ab-L2IJCEXJP7XQ7HOJ4SIEXAMPLE``. This setting doesn't apply to + * RDS Custom. + * + * @param sourceDBInstanceAutomatedBackupsArn the sourceDBInstanceAutomatedBackupsArn value to set. + * @return the AwsRdsDBInstanceProperties object itself. + */ + public AwsRdsDBInstanceProperties + withSourceDBInstanceAutomatedBackupsArn(String sourceDBInstanceAutomatedBackupsArn) { + this.sourceDBInstanceAutomatedBackupsArn = sourceDBInstanceAutomatedBackupsArn; + return this; + } + + /** + * Get the sourceDBInstanceIdentifier property: If you want to create a read replica DB instance, specify the ID of + * the source DB instance. Each DB instance can have a limited number of read replicas. For more information, see + * [Working with Read Replicas](https://docs.aws.amazon.com/AmazonRDS/latest/DeveloperGuide/USER_ReadRepl.html) in + * the *Amazon RDS User Guide*. For information about constraints that apply to DB instance identifiers, see [Naming + * constraints in Amazon + * RDS](https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/CHAP_Limits.html#RDS_Limits.Constraints) in the + * *Amazon RDS User Guide*. The ``SourceDBInstanceIdentifier`` property determines whether a DB instance is a read + * replica. If you remove the ``SourceDBInstanceIdentifier`` property from your template and then update your stack, + * AWS CloudFormation promotes the Read Replica to a standalone DB instance. + If you specify a source DB instance + * that uses VPC security groups, we recommend that you specify the ``VPCSecurityGroups`` property. If you don't + * specify the property, the read replica inherits the value of the ``VPCSecurityGroups`` property from the source + * DB when you create the replica. However, if you update the stack, AWS CloudFormation reverts the replica's + * ``VPCSecurityGroups`` property to the default value because it's not defined in the stack's template. This change + * might cause unexpected issues. + Read replicas don't support deletion policies. AWS CloudFormation ignores any + * deletion policy that's associated with a read replica. + If you specify ``SourceDBInstanceIdentifier``, don't + * specify the ``DBSnapshotIdentifier`` property. You can't create a read replica from a snapshot. + Don't set the + * ``BackupRetentionPeriod``, ``DBName``, ``MasterUsername``, ``MasterUserPassword``, and ``PreferredBackupWindow`` + * properties. The database attributes are inherited from the source DB instance, and backups are disabled for read + * replicas. + If the source DB instance is in a different region than the read replica, specify the source region + * in ``SourceRegion``, and specify an ARN for a valid DB instance in ``SourceDBInstanceIdentifier``. For more + * information, see [Constructing a Amazon RDS Amazon Resource Name + * (ARN)](https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_Tagging.html#USER_Tagging.ARN) in the *Amazon + * RDS User Guide*. + For DB instances in Amazon Aurora clusters, don't specify this property. Amazon RDS + * automatically assigns writer and reader DB instances. + * + * @return the sourceDBInstanceIdentifier value. + */ + public String sourceDBInstanceIdentifier() { + return this.sourceDBInstanceIdentifier; + } + + /** + * Set the sourceDBInstanceIdentifier property: If you want to create a read replica DB instance, specify the ID of + * the source DB instance. Each DB instance can have a limited number of read replicas. For more information, see + * [Working with Read Replicas](https://docs.aws.amazon.com/AmazonRDS/latest/DeveloperGuide/USER_ReadRepl.html) in + * the *Amazon RDS User Guide*. For information about constraints that apply to DB instance identifiers, see [Naming + * constraints in Amazon + * RDS](https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/CHAP_Limits.html#RDS_Limits.Constraints) in the + * *Amazon RDS User Guide*. The ``SourceDBInstanceIdentifier`` property determines whether a DB instance is a read + * replica. If you remove the ``SourceDBInstanceIdentifier`` property from your template and then update your stack, + * AWS CloudFormation promotes the Read Replica to a standalone DB instance. + If you specify a source DB instance + * that uses VPC security groups, we recommend that you specify the ``VPCSecurityGroups`` property. If you don't + * specify the property, the read replica inherits the value of the ``VPCSecurityGroups`` property from the source + * DB when you create the replica. However, if you update the stack, AWS CloudFormation reverts the replica's + * ``VPCSecurityGroups`` property to the default value because it's not defined in the stack's template. This change + * might cause unexpected issues. + Read replicas don't support deletion policies. AWS CloudFormation ignores any + * deletion policy that's associated with a read replica. + If you specify ``SourceDBInstanceIdentifier``, don't + * specify the ``DBSnapshotIdentifier`` property. You can't create a read replica from a snapshot. + Don't set the + * ``BackupRetentionPeriod``, ``DBName``, ``MasterUsername``, ``MasterUserPassword``, and ``PreferredBackupWindow`` + * properties. The database attributes are inherited from the source DB instance, and backups are disabled for read + * replicas. + If the source DB instance is in a different region than the read replica, specify the source region + * in ``SourceRegion``, and specify an ARN for a valid DB instance in ``SourceDBInstanceIdentifier``. For more + * information, see [Constructing a Amazon RDS Amazon Resource Name + * (ARN)](https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_Tagging.html#USER_Tagging.ARN) in the *Amazon + * RDS User Guide*. + For DB instances in Amazon Aurora clusters, don't specify this property. Amazon RDS + * automatically assigns writer and reader DB instances. + * + * @param sourceDBInstanceIdentifier the sourceDBInstanceIdentifier value to set. + * @return the AwsRdsDBInstanceProperties object itself. + */ + public AwsRdsDBInstanceProperties withSourceDBInstanceIdentifier(String sourceDBInstanceIdentifier) { + this.sourceDBInstanceIdentifier = sourceDBInstanceIdentifier; + return this; + } + + /** + * Get the sourceDbiResourceId property: The resource ID of the source DB instance from which to restore. + * + * @return the sourceDbiResourceId value. + */ + public String sourceDbiResourceId() { + return this.sourceDbiResourceId; + } + + /** + * Set the sourceDbiResourceId property: The resource ID of the source DB instance from which to restore. + * + * @param sourceDbiResourceId the sourceDbiResourceId value to set. + * @return the AwsRdsDBInstanceProperties object itself. + */ + public AwsRdsDBInstanceProperties withSourceDbiResourceId(String sourceDbiResourceId) { + this.sourceDbiResourceId = sourceDbiResourceId; + return this; + } + + /** + * Get the sourceRegion property: The ID of the region that contains the source DB instance for the read replica. + * + * @return the sourceRegion value. + */ + public String sourceRegion() { + return this.sourceRegion; + } + + /** + * Set the sourceRegion property: The ID of the region that contains the source DB instance for the read replica. + * + * @param sourceRegion the sourceRegion value to set. + * @return the AwsRdsDBInstanceProperties object itself. + */ + public AwsRdsDBInstanceProperties withSourceRegion(String sourceRegion) { + this.sourceRegion = sourceRegion; + return this; + } + + /** + * Get the storageEncrypted property: A value that indicates whether the DB instance is encrypted. By default, it + * isn't encrypted. If you specify the ``KmsKeyId`` property, then you must enable encryption. If you specify the + * ``SourceDBInstanceIdentifier`` property, don't specify this property. The value is inherited from the source DB + * instance, and if the DB instance is encrypted, the specified ``KmsKeyId`` property is used. If you specify the + * ``DBSnapshotIdentifier`` and the specified snapshot is encrypted, don't specify this property. The value is + * inherited from the snapshot, and the specified ``KmsKeyId`` property is used. If you specify the + * ``DBSnapshotIdentifier`` and the specified snapshot isn't encrypted, you can use this property to specify that + * the restored DB instance is encrypted. Specify the ``KmsKeyId`` property for the KMS key to use for encryption. + * If you don't want the restored DB instance to be encrypted, then don't set this property or set it to ``false``. + * *Amazon Aurora* Not applicable. The encryption for DB instances is managed by the DB cluster. + * + * @return the storageEncrypted value. + */ + public Boolean storageEncrypted() { + return this.storageEncrypted; + } + + /** + * Set the storageEncrypted property: A value that indicates whether the DB instance is encrypted. By default, it + * isn't encrypted. If you specify the ``KmsKeyId`` property, then you must enable encryption. If you specify the + * ``SourceDBInstanceIdentifier`` property, don't specify this property. The value is inherited from the source DB + * instance, and if the DB instance is encrypted, the specified ``KmsKeyId`` property is used. If you specify the + * ``DBSnapshotIdentifier`` and the specified snapshot is encrypted, don't specify this property. The value is + * inherited from the snapshot, and the specified ``KmsKeyId`` property is used. If you specify the + * ``DBSnapshotIdentifier`` and the specified snapshot isn't encrypted, you can use this property to specify that + * the restored DB instance is encrypted. Specify the ``KmsKeyId`` property for the KMS key to use for encryption. + * If you don't want the restored DB instance to be encrypted, then don't set this property or set it to ``false``. + * *Amazon Aurora* Not applicable. The encryption for DB instances is managed by the DB cluster. + * + * @param storageEncrypted the storageEncrypted value to set. + * @return the AwsRdsDBInstanceProperties object itself. + */ + public AwsRdsDBInstanceProperties withStorageEncrypted(Boolean storageEncrypted) { + this.storageEncrypted = storageEncrypted; + return this; + } + + /** + * Get the storageThroughput property: Specifies the storage throughput value for the DB instance. This setting + * applies only to the ``gp3`` storage type. This setting doesn't apply to RDS Custom or Amazon Aurora. + * + * @return the storageThroughput value. + */ + public Integer storageThroughput() { + return this.storageThroughput; + } + + /** + * Set the storageThroughput property: Specifies the storage throughput value for the DB instance. This setting + * applies only to the ``gp3`` storage type. This setting doesn't apply to RDS Custom or Amazon Aurora. + * + * @param storageThroughput the storageThroughput value to set. + * @return the AwsRdsDBInstanceProperties object itself. + */ + public AwsRdsDBInstanceProperties withStorageThroughput(Integer storageThroughput) { + this.storageThroughput = storageThroughput; + return this; + } + + /** + * Get the storageType property: The storage type to associate with the DB instance. If you specify ``io1``, + * ``io2``, or ``gp3``, you must also include a value for the ``Iops`` parameter. This setting doesn't apply to + * Amazon Aurora DB instances. Storage is managed by the DB cluster. Valid Values: ``gp2 | gp3 | io1 | io2 | + * standard`` Default: ``io1``, if the ``Iops`` parameter is specified. Otherwise, ``gp2``. + * + * @return the storageType value. + */ + public String storageType() { + return this.storageType; + } + + /** + * Set the storageType property: The storage type to associate with the DB instance. If you specify ``io1``, + * ``io2``, or ``gp3``, you must also include a value for the ``Iops`` parameter. This setting doesn't apply to + * Amazon Aurora DB instances. Storage is managed by the DB cluster. Valid Values: ``gp2 | gp3 | io1 | io2 | + * standard`` Default: ``io1``, if the ``Iops`` parameter is specified. Otherwise, ``gp2``. + * + * @param storageType the storageType value to set. + * @return the AwsRdsDBInstanceProperties object itself. + */ + public AwsRdsDBInstanceProperties withStorageType(String storageType) { + this.storageType = storageType; + return this; + } + + /** + * Get the tags property: An optional array of key-value pairs to apply to this DB instance. + * + * @return the tags value. + */ + public List tags() { + return this.tags; + } + + /** + * Set the tags property: An optional array of key-value pairs to apply to this DB instance. + * + * @param tags the tags value to set. + * @return the AwsRdsDBInstanceProperties object itself. + */ + public AwsRdsDBInstanceProperties withTags(List tags) { + this.tags = tags; + return this; + } + + /** + * Get the tdeCredentialArn property: Property tdeCredentialArn. + * + * @return the tdeCredentialArn value. + */ + public String tdeCredentialArn() { + return this.tdeCredentialArn; + } + + /** + * Set the tdeCredentialArn property: Property tdeCredentialArn. + * + * @param tdeCredentialArn the tdeCredentialArn value to set. + * @return the AwsRdsDBInstanceProperties object itself. + */ + public AwsRdsDBInstanceProperties withTdeCredentialArn(String tdeCredentialArn) { + this.tdeCredentialArn = tdeCredentialArn; + return this; + } + + /** + * Get the tdeCredentialPassword property: Property tdeCredentialPassword. + * + * @return the tdeCredentialPassword value. + */ + public String tdeCredentialPassword() { + return this.tdeCredentialPassword; + } + + /** + * Set the tdeCredentialPassword property: Property tdeCredentialPassword. + * + * @param tdeCredentialPassword the tdeCredentialPassword value to set. + * @return the AwsRdsDBInstanceProperties object itself. + */ + public AwsRdsDBInstanceProperties withTdeCredentialPassword(String tdeCredentialPassword) { + this.tdeCredentialPassword = tdeCredentialPassword; + return this; + } + + /** + * Get the timezone property: The time zone of the DB instance. The time zone parameter is currently supported only + * by [Microsoft SQL + * Server](https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/CHAP_SQLServer.html#SQLServer.Concepts.General.TimeZone). + * + * @return the timezone value. + */ + public String timezone() { + return this.timezone; + } + + /** + * Set the timezone property: The time zone of the DB instance. The time zone parameter is currently supported only + * by [Microsoft SQL + * Server](https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/CHAP_SQLServer.html#SQLServer.Concepts.General.TimeZone). + * + * @param timezone the timezone value to set. + * @return the AwsRdsDBInstanceProperties object itself. + */ + public AwsRdsDBInstanceProperties withTimezone(String timezone) { + this.timezone = timezone; + return this; + } + + /** + * Get the useDefaultProcessorFeatures property: Specifies whether the DB instance class of the DB instance uses its + * default processor features. This setting doesn't apply to RDS Custom DB instances. + * + * @return the useDefaultProcessorFeatures value. + */ + public Boolean useDefaultProcessorFeatures() { + return this.useDefaultProcessorFeatures; + } + + /** + * Set the useDefaultProcessorFeatures property: Specifies whether the DB instance class of the DB instance uses its + * default processor features. This setting doesn't apply to RDS Custom DB instances. + * + * @param useDefaultProcessorFeatures the useDefaultProcessorFeatures value to set. + * @return the AwsRdsDBInstanceProperties object itself. + */ + public AwsRdsDBInstanceProperties withUseDefaultProcessorFeatures(Boolean useDefaultProcessorFeatures) { + this.useDefaultProcessorFeatures = useDefaultProcessorFeatures; + return this; + } + + /** + * Get the useLatestRestorableTime property: Specifies whether the DB instance is restored from the latest backup + * time. By default, the DB instance isn't restored from the latest backup time. Constraints: + Can't be specified + * if the ``RestoreTime`` parameter is provided. + * + * @return the useLatestRestorableTime value. + */ + public Boolean useLatestRestorableTime() { + return this.useLatestRestorableTime; + } + + /** + * Set the useLatestRestorableTime property: Specifies whether the DB instance is restored from the latest backup + * time. By default, the DB instance isn't restored from the latest backup time. Constraints: + Can't be specified + * if the ``RestoreTime`` parameter is provided. + * + * @param useLatestRestorableTime the useLatestRestorableTime value to set. + * @return the AwsRdsDBInstanceProperties object itself. + */ + public AwsRdsDBInstanceProperties withUseLatestRestorableTime(Boolean useLatestRestorableTime) { + this.useLatestRestorableTime = useLatestRestorableTime; + return this; + } + + /** + * Get the vpcSecurityGroups property: A list of the VPC security group IDs to assign to the DB instance. The list + * can include both the physical IDs of existing VPC security groups and references to + * [AWS::EC2::SecurityGroup](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ec2-security-group.html) + * resources created in the template. If you plan to update the resource, don't specify VPC security groups in a + * shared VPC. If you set ``VPCSecurityGroups``, you must not set + * [DBSecurityGroups](https://docs.aws.amazon.com//AWSCloudFormation/latest/UserGuide/aws-properties-rds-database-instance.html#cfn-rds-dbinstance-dbsecuritygroups), + * and vice versa. You can migrate a DB instance in your stack from an RDS DB security group to a VPC security + * group, but keep the following in mind: + You can't revert to using an RDS security group after you establish a + * VPC security group membership. + When you migrate your DB instance to VPC security groups, if your stack update + * rolls back because the DB instance update fails or because an update fails in another AWS CloudFormation + * resource, the rollback fails because it can't revert to an RDS security group. + To use the properties that are + * available when you use a VPC security group, you must recreate the DB instance. If you don't, AWS CloudFormation + * submits only the property values that are listed in the + * [DBSecurityGroups](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-rds-database-instance.html#cfn-rds-dbinstance-dbsecuritygroups) + * property. To avoid this situation, migrate your DB instance to using VPC security groups only when that is the + * only change in your stack template. *Amazon Aurora* Not applicable. The associated list of EC2 VPC security + * groups is managed by the DB cluster. If specified, the setting must match the DB cluster setting. + * + * @return the vpcSecurityGroups value. + */ + public List vpcSecurityGroups() { + return this.vpcSecurityGroups; + } + + /** + * Set the vpcSecurityGroups property: A list of the VPC security group IDs to assign to the DB instance. The list + * can include both the physical IDs of existing VPC security groups and references to + * [AWS::EC2::SecurityGroup](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ec2-security-group.html) + * resources created in the template. If you plan to update the resource, don't specify VPC security groups in a + * shared VPC. If you set ``VPCSecurityGroups``, you must not set + * [DBSecurityGroups](https://docs.aws.amazon.com//AWSCloudFormation/latest/UserGuide/aws-properties-rds-database-instance.html#cfn-rds-dbinstance-dbsecuritygroups), + * and vice versa. You can migrate a DB instance in your stack from an RDS DB security group to a VPC security + * group, but keep the following in mind: + You can't revert to using an RDS security group after you establish a + * VPC security group membership. + When you migrate your DB instance to VPC security groups, if your stack update + * rolls back because the DB instance update fails or because an update fails in another AWS CloudFormation + * resource, the rollback fails because it can't revert to an RDS security group. + To use the properties that are + * available when you use a VPC security group, you must recreate the DB instance. If you don't, AWS CloudFormation + * submits only the property values that are listed in the + * [DBSecurityGroups](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-rds-database-instance.html#cfn-rds-dbinstance-dbsecuritygroups) + * property. To avoid this situation, migrate your DB instance to using VPC security groups only when that is the + * only change in your stack template. *Amazon Aurora* Not applicable. The associated list of EC2 VPC security + * groups is managed by the DB cluster. If specified, the setting must match the DB cluster setting. + * + * @param vpcSecurityGroups the vpcSecurityGroups value to set. + * @return the AwsRdsDBInstanceProperties object itself. + */ + public AwsRdsDBInstanceProperties withVpcSecurityGroups(List vpcSecurityGroups) { + this.vpcSecurityGroups = vpcSecurityGroups; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (associatedRoles() != null) { + associatedRoles().forEach(e -> e.validate()); + } + if (certificateDetails() != null) { + certificateDetails().validate(); + } + if (endpoint() != null) { + endpoint().validate(); + } + if (masterUserSecret() != null) { + masterUserSecret().validate(); + } + if (processorFeatures() != null) { + processorFeatures().forEach(e -> e.validate()); + } + if (tags() != null) { + tags().forEach(e -> e.validate()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("allocatedStorage", this.allocatedStorage); + jsonWriter.writeBooleanField("allowMajorVersionUpgrade", this.allowMajorVersionUpgrade); + jsonWriter.writeArrayField("associatedRoles", this.associatedRoles, + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeBooleanField("autoMinorVersionUpgrade", this.autoMinorVersionUpgrade); + jsonWriter.writeStringField("automaticBackupReplicationKmsKeyId", this.automaticBackupReplicationKmsKeyId); + jsonWriter.writeStringField("automaticBackupReplicationRegion", this.automaticBackupReplicationRegion); + jsonWriter.writeStringField("availabilityZone", this.availabilityZone); + jsonWriter.writeNumberField("backupRetentionPeriod", this.backupRetentionPeriod); + jsonWriter.writeStringField("caCertificateIdentifier", this.caCertificateIdentifier); + jsonWriter.writeJsonField("certificateDetails", this.certificateDetails); + jsonWriter.writeBooleanField("certificateRotationRestart", this.certificateRotationRestart); + jsonWriter.writeStringField("characterSetName", this.characterSetName); + jsonWriter.writeBooleanField("copyTagsToSnapshot", this.copyTagsToSnapshot); + jsonWriter.writeStringField("customIAMInstanceProfile", this.customIamInstanceProfile); + jsonWriter.writeStringField("dbClusterIdentifier", this.dbClusterIdentifier); + jsonWriter.writeStringField("dbClusterSnapshotIdentifier", this.dbClusterSnapshotIdentifier); + jsonWriter.writeStringField("dbInstanceArn", this.dbInstanceArn); + jsonWriter.writeStringField("dbInstanceClass", this.dbInstanceClass); + jsonWriter.writeStringField("dbInstanceIdentifier", this.dbInstanceIdentifier); + jsonWriter.writeStringField("dbName", this.dbName); + jsonWriter.writeStringField("dbParameterGroupName", this.dbParameterGroupName); + jsonWriter.writeArrayField("dbSecurityGroups", this.dbSecurityGroups, + (writer, element) -> writer.writeString(element)); + jsonWriter.writeStringField("dbSnapshotIdentifier", this.dbSnapshotIdentifier); + jsonWriter.writeStringField("dbSubnetGroupName", this.dbSubnetGroupName); + jsonWriter.writeStringField("dbSystemId", this.dbSystemId); + jsonWriter.writeStringField("dbiResourceId", this.dbiResourceId); + jsonWriter.writeBooleanField("dedicatedLogVolume", this.dedicatedLogVolume); + jsonWriter.writeBooleanField("deleteAutomatedBackups", this.deleteAutomatedBackups); + jsonWriter.writeBooleanField("deletionProtection", this.deletionProtection); + jsonWriter.writeStringField("domain", this.domain); + jsonWriter.writeStringField("domainAuthSecretArn", this.domainAuthSecretArn); + jsonWriter.writeArrayField("domainDnsIps", this.domainDnsIps, (writer, element) -> writer.writeString(element)); + jsonWriter.writeStringField("domainFqdn", this.domainFqdn); + jsonWriter.writeStringField("domainIAMRoleName", this.domainIamRoleName); + jsonWriter.writeStringField("domainOu", this.domainOu); + jsonWriter.writeArrayField("enableCloudwatchLogsExports", this.enableCloudwatchLogsExports, + (writer, element) -> writer.writeString(element)); + jsonWriter.writeBooleanField("enableIAMDatabaseAuthentication", this.enableIamDatabaseAuthentication); + jsonWriter.writeBooleanField("enablePerformanceInsights", this.enablePerformanceInsights); + jsonWriter.writeJsonField("endpoint", this.endpoint); + jsonWriter.writeStringField("engine", this.engine); + jsonWriter.writeStringField("engineVersion", this.engineVersion); + jsonWriter.writeNumberField("iops", this.iops); + jsonWriter.writeStringField("kmsKeyId", this.kmsKeyId); + jsonWriter.writeStringField("licenseModel", this.licenseModel); + jsonWriter.writeBooleanField("manageMasterUserPassword", this.manageMasterUserPassword); + jsonWriter.writeStringField("masterUserPassword", this.masterUserPassword); + jsonWriter.writeJsonField("masterUserSecret", this.masterUserSecret); + jsonWriter.writeStringField("masterUsername", this.masterUsername); + jsonWriter.writeNumberField("maxAllocatedStorage", this.maxAllocatedStorage); + jsonWriter.writeNumberField("monitoringInterval", this.monitoringInterval); + jsonWriter.writeStringField("monitoringRoleArn", this.monitoringRoleArn); + jsonWriter.writeBooleanField("multiAZ", this.multiAZ); + jsonWriter.writeStringField("ncharCharacterSetName", this.ncharCharacterSetName); + jsonWriter.writeStringField("networkType", this.networkType); + jsonWriter.writeStringField("optionGroupName", this.optionGroupName); + jsonWriter.writeStringField("performanceInsightsKMSKeyId", this.performanceInsightsKmsKeyId); + jsonWriter.writeNumberField("performanceInsightsRetentionPeriod", this.performanceInsightsRetentionPeriod); + jsonWriter.writeStringField("port", this.port); + jsonWriter.writeStringField("preferredBackupWindow", this.preferredBackupWindow); + jsonWriter.writeStringField("preferredMaintenanceWindow", this.preferredMaintenanceWindow); + jsonWriter.writeArrayField("processorFeatures", this.processorFeatures, + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeNumberField("promotionTier", this.promotionTier); + jsonWriter.writeBooleanField("publiclyAccessible", this.publiclyAccessible); + jsonWriter.writeStringField("replicaMode", this.replicaMode); + jsonWriter.writeStringField("restoreTime", this.restoreTime); + jsonWriter.writeStringField("sourceDBClusterIdentifier", this.sourceDBClusterIdentifier); + jsonWriter.writeStringField("sourceDBInstanceAutomatedBackupsArn", this.sourceDBInstanceAutomatedBackupsArn); + jsonWriter.writeStringField("sourceDBInstanceIdentifier", this.sourceDBInstanceIdentifier); + jsonWriter.writeStringField("sourceDbiResourceId", this.sourceDbiResourceId); + jsonWriter.writeStringField("sourceRegion", this.sourceRegion); + jsonWriter.writeBooleanField("storageEncrypted", this.storageEncrypted); + jsonWriter.writeNumberField("storageThroughput", this.storageThroughput); + jsonWriter.writeStringField("storageType", this.storageType); + jsonWriter.writeArrayField("tags", this.tags, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("tdeCredentialArn", this.tdeCredentialArn); + jsonWriter.writeStringField("tdeCredentialPassword", this.tdeCredentialPassword); + jsonWriter.writeStringField("timezone", this.timezone); + jsonWriter.writeBooleanField("useDefaultProcessorFeatures", this.useDefaultProcessorFeatures); + jsonWriter.writeBooleanField("useLatestRestorableTime", this.useLatestRestorableTime); + jsonWriter.writeArrayField("vpcSecurityGroups", this.vpcSecurityGroups, + (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AwsRdsDBInstanceProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AwsRdsDBInstanceProperties if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IOException If an error occurs while reading the AwsRdsDBInstanceProperties. + */ + public static AwsRdsDBInstanceProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AwsRdsDBInstanceProperties deserializedAwsRdsDBInstanceProperties = new AwsRdsDBInstanceProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("allocatedStorage".equals(fieldName)) { + deserializedAwsRdsDBInstanceProperties.allocatedStorage = reader.getString(); + } else if ("allowMajorVersionUpgrade".equals(fieldName)) { + deserializedAwsRdsDBInstanceProperties.allowMajorVersionUpgrade + = reader.getNullable(JsonReader::getBoolean); + } else if ("associatedRoles".equals(fieldName)) { + List associatedRoles + = reader.readArray(reader1 -> DBInstanceRole.fromJson(reader1)); + deserializedAwsRdsDBInstanceProperties.associatedRoles = associatedRoles; + } else if ("autoMinorVersionUpgrade".equals(fieldName)) { + deserializedAwsRdsDBInstanceProperties.autoMinorVersionUpgrade + = reader.getNullable(JsonReader::getBoolean); + } else if ("automaticBackupReplicationKmsKeyId".equals(fieldName)) { + deserializedAwsRdsDBInstanceProperties.automaticBackupReplicationKmsKeyId = reader.getString(); + } else if ("automaticBackupReplicationRegion".equals(fieldName)) { + deserializedAwsRdsDBInstanceProperties.automaticBackupReplicationRegion = reader.getString(); + } else if ("availabilityZone".equals(fieldName)) { + deserializedAwsRdsDBInstanceProperties.availabilityZone = reader.getString(); + } else if ("backupRetentionPeriod".equals(fieldName)) { + deserializedAwsRdsDBInstanceProperties.backupRetentionPeriod + = reader.getNullable(JsonReader::getInt); + } else if ("caCertificateIdentifier".equals(fieldName)) { + deserializedAwsRdsDBInstanceProperties.caCertificateIdentifier = reader.getString(); + } else if ("certificateDetails".equals(fieldName)) { + deserializedAwsRdsDBInstanceProperties.certificateDetails = CertificateDetails.fromJson(reader); + } else if ("certificateRotationRestart".equals(fieldName)) { + deserializedAwsRdsDBInstanceProperties.certificateRotationRestart + = reader.getNullable(JsonReader::getBoolean); + } else if ("characterSetName".equals(fieldName)) { + deserializedAwsRdsDBInstanceProperties.characterSetName = reader.getString(); + } else if ("copyTagsToSnapshot".equals(fieldName)) { + deserializedAwsRdsDBInstanceProperties.copyTagsToSnapshot + = reader.getNullable(JsonReader::getBoolean); + } else if ("customIAMInstanceProfile".equals(fieldName)) { + deserializedAwsRdsDBInstanceProperties.customIamInstanceProfile = reader.getString(); + } else if ("dbClusterIdentifier".equals(fieldName)) { + deserializedAwsRdsDBInstanceProperties.dbClusterIdentifier = reader.getString(); + } else if ("dbClusterSnapshotIdentifier".equals(fieldName)) { + deserializedAwsRdsDBInstanceProperties.dbClusterSnapshotIdentifier = reader.getString(); + } else if ("dbInstanceArn".equals(fieldName)) { + deserializedAwsRdsDBInstanceProperties.dbInstanceArn = reader.getString(); + } else if ("dbInstanceClass".equals(fieldName)) { + deserializedAwsRdsDBInstanceProperties.dbInstanceClass = reader.getString(); + } else if ("dbInstanceIdentifier".equals(fieldName)) { + deserializedAwsRdsDBInstanceProperties.dbInstanceIdentifier = reader.getString(); + } else if ("dbName".equals(fieldName)) { + deserializedAwsRdsDBInstanceProperties.dbName = reader.getString(); + } else if ("dbParameterGroupName".equals(fieldName)) { + deserializedAwsRdsDBInstanceProperties.dbParameterGroupName = reader.getString(); + } else if ("dbSecurityGroups".equals(fieldName)) { + List dbSecurityGroups = reader.readArray(reader1 -> reader1.getString()); + deserializedAwsRdsDBInstanceProperties.dbSecurityGroups = dbSecurityGroups; + } else if ("dbSnapshotIdentifier".equals(fieldName)) { + deserializedAwsRdsDBInstanceProperties.dbSnapshotIdentifier = reader.getString(); + } else if ("dbSubnetGroupName".equals(fieldName)) { + deserializedAwsRdsDBInstanceProperties.dbSubnetGroupName = reader.getString(); + } else if ("dbSystemId".equals(fieldName)) { + deserializedAwsRdsDBInstanceProperties.dbSystemId = reader.getString(); + } else if ("dbiResourceId".equals(fieldName)) { + deserializedAwsRdsDBInstanceProperties.dbiResourceId = reader.getString(); + } else if ("dedicatedLogVolume".equals(fieldName)) { + deserializedAwsRdsDBInstanceProperties.dedicatedLogVolume + = reader.getNullable(JsonReader::getBoolean); + } else if ("deleteAutomatedBackups".equals(fieldName)) { + deserializedAwsRdsDBInstanceProperties.deleteAutomatedBackups + = reader.getNullable(JsonReader::getBoolean); + } else if ("deletionProtection".equals(fieldName)) { + deserializedAwsRdsDBInstanceProperties.deletionProtection + = reader.getNullable(JsonReader::getBoolean); + } else if ("domain".equals(fieldName)) { + deserializedAwsRdsDBInstanceProperties.domain = reader.getString(); + } else if ("domainAuthSecretArn".equals(fieldName)) { + deserializedAwsRdsDBInstanceProperties.domainAuthSecretArn = reader.getString(); + } else if ("domainDnsIps".equals(fieldName)) { + List domainDnsIps = reader.readArray(reader1 -> reader1.getString()); + deserializedAwsRdsDBInstanceProperties.domainDnsIps = domainDnsIps; + } else if ("domainFqdn".equals(fieldName)) { + deserializedAwsRdsDBInstanceProperties.domainFqdn = reader.getString(); + } else if ("domainIAMRoleName".equals(fieldName)) { + deserializedAwsRdsDBInstanceProperties.domainIamRoleName = reader.getString(); + } else if ("domainOu".equals(fieldName)) { + deserializedAwsRdsDBInstanceProperties.domainOu = reader.getString(); + } else if ("enableCloudwatchLogsExports".equals(fieldName)) { + List enableCloudwatchLogsExports = reader.readArray(reader1 -> reader1.getString()); + deserializedAwsRdsDBInstanceProperties.enableCloudwatchLogsExports = enableCloudwatchLogsExports; + } else if ("enableIAMDatabaseAuthentication".equals(fieldName)) { + deserializedAwsRdsDBInstanceProperties.enableIamDatabaseAuthentication + = reader.getNullable(JsonReader::getBoolean); + } else if ("enablePerformanceInsights".equals(fieldName)) { + deserializedAwsRdsDBInstanceProperties.enablePerformanceInsights + = reader.getNullable(JsonReader::getBoolean); + } else if ("endpoint".equals(fieldName)) { + deserializedAwsRdsDBInstanceProperties.endpoint = EndpointAutoGenerated2.fromJson(reader); + } else if ("engine".equals(fieldName)) { + deserializedAwsRdsDBInstanceProperties.engine = reader.getString(); + } else if ("engineVersion".equals(fieldName)) { + deserializedAwsRdsDBInstanceProperties.engineVersion = reader.getString(); + } else if ("iops".equals(fieldName)) { + deserializedAwsRdsDBInstanceProperties.iops = reader.getNullable(JsonReader::getInt); + } else if ("kmsKeyId".equals(fieldName)) { + deserializedAwsRdsDBInstanceProperties.kmsKeyId = reader.getString(); + } else if ("licenseModel".equals(fieldName)) { + deserializedAwsRdsDBInstanceProperties.licenseModel = reader.getString(); + } else if ("manageMasterUserPassword".equals(fieldName)) { + deserializedAwsRdsDBInstanceProperties.manageMasterUserPassword + = reader.getNullable(JsonReader::getBoolean); + } else if ("masterUserPassword".equals(fieldName)) { + deserializedAwsRdsDBInstanceProperties.masterUserPassword = reader.getString(); + } else if ("masterUserSecret".equals(fieldName)) { + deserializedAwsRdsDBInstanceProperties.masterUserSecret = MasterUserSecret.fromJson(reader); + } else if ("masterUsername".equals(fieldName)) { + deserializedAwsRdsDBInstanceProperties.masterUsername = reader.getString(); + } else if ("maxAllocatedStorage".equals(fieldName)) { + deserializedAwsRdsDBInstanceProperties.maxAllocatedStorage = reader.getNullable(JsonReader::getInt); + } else if ("monitoringInterval".equals(fieldName)) { + deserializedAwsRdsDBInstanceProperties.monitoringInterval = reader.getNullable(JsonReader::getInt); + } else if ("monitoringRoleArn".equals(fieldName)) { + deserializedAwsRdsDBInstanceProperties.monitoringRoleArn = reader.getString(); + } else if ("multiAZ".equals(fieldName)) { + deserializedAwsRdsDBInstanceProperties.multiAZ = reader.getNullable(JsonReader::getBoolean); + } else if ("ncharCharacterSetName".equals(fieldName)) { + deserializedAwsRdsDBInstanceProperties.ncharCharacterSetName = reader.getString(); + } else if ("networkType".equals(fieldName)) { + deserializedAwsRdsDBInstanceProperties.networkType = reader.getString(); + } else if ("optionGroupName".equals(fieldName)) { + deserializedAwsRdsDBInstanceProperties.optionGroupName = reader.getString(); + } else if ("performanceInsightsKMSKeyId".equals(fieldName)) { + deserializedAwsRdsDBInstanceProperties.performanceInsightsKmsKeyId = reader.getString(); + } else if ("performanceInsightsRetentionPeriod".equals(fieldName)) { + deserializedAwsRdsDBInstanceProperties.performanceInsightsRetentionPeriod + = reader.getNullable(JsonReader::getInt); + } else if ("port".equals(fieldName)) { + deserializedAwsRdsDBInstanceProperties.port = reader.getString(); + } else if ("preferredBackupWindow".equals(fieldName)) { + deserializedAwsRdsDBInstanceProperties.preferredBackupWindow = reader.getString(); + } else if ("preferredMaintenanceWindow".equals(fieldName)) { + deserializedAwsRdsDBInstanceProperties.preferredMaintenanceWindow = reader.getString(); + } else if ("processorFeatures".equals(fieldName)) { + List processorFeatures + = reader.readArray(reader1 -> ProcessorFeature.fromJson(reader1)); + deserializedAwsRdsDBInstanceProperties.processorFeatures = processorFeatures; + } else if ("promotionTier".equals(fieldName)) { + deserializedAwsRdsDBInstanceProperties.promotionTier = reader.getNullable(JsonReader::getInt); + } else if ("publiclyAccessible".equals(fieldName)) { + deserializedAwsRdsDBInstanceProperties.publiclyAccessible + = reader.getNullable(JsonReader::getBoolean); + } else if ("replicaMode".equals(fieldName)) { + deserializedAwsRdsDBInstanceProperties.replicaMode = reader.getString(); + } else if ("restoreTime".equals(fieldName)) { + deserializedAwsRdsDBInstanceProperties.restoreTime = reader.getString(); + } else if ("sourceDBClusterIdentifier".equals(fieldName)) { + deserializedAwsRdsDBInstanceProperties.sourceDBClusterIdentifier = reader.getString(); + } else if ("sourceDBInstanceAutomatedBackupsArn".equals(fieldName)) { + deserializedAwsRdsDBInstanceProperties.sourceDBInstanceAutomatedBackupsArn = reader.getString(); + } else if ("sourceDBInstanceIdentifier".equals(fieldName)) { + deserializedAwsRdsDBInstanceProperties.sourceDBInstanceIdentifier = reader.getString(); + } else if ("sourceDbiResourceId".equals(fieldName)) { + deserializedAwsRdsDBInstanceProperties.sourceDbiResourceId = reader.getString(); + } else if ("sourceRegion".equals(fieldName)) { + deserializedAwsRdsDBInstanceProperties.sourceRegion = reader.getString(); + } else if ("storageEncrypted".equals(fieldName)) { + deserializedAwsRdsDBInstanceProperties.storageEncrypted + = reader.getNullable(JsonReader::getBoolean); + } else if ("storageThroughput".equals(fieldName)) { + deserializedAwsRdsDBInstanceProperties.storageThroughput = reader.getNullable(JsonReader::getInt); + } else if ("storageType".equals(fieldName)) { + deserializedAwsRdsDBInstanceProperties.storageType = reader.getString(); + } else if ("tags".equals(fieldName)) { + List tags = reader.readArray(reader1 -> TagAutoGenerated46.fromJson(reader1)); + deserializedAwsRdsDBInstanceProperties.tags = tags; + } else if ("tdeCredentialArn".equals(fieldName)) { + deserializedAwsRdsDBInstanceProperties.tdeCredentialArn = reader.getString(); + } else if ("tdeCredentialPassword".equals(fieldName)) { + deserializedAwsRdsDBInstanceProperties.tdeCredentialPassword = reader.getString(); + } else if ("timezone".equals(fieldName)) { + deserializedAwsRdsDBInstanceProperties.timezone = reader.getString(); + } else if ("useDefaultProcessorFeatures".equals(fieldName)) { + deserializedAwsRdsDBInstanceProperties.useDefaultProcessorFeatures + = reader.getNullable(JsonReader::getBoolean); + } else if ("useLatestRestorableTime".equals(fieldName)) { + deserializedAwsRdsDBInstanceProperties.useLatestRestorableTime + = reader.getNullable(JsonReader::getBoolean); + } else if ("vpcSecurityGroups".equals(fieldName)) { + List vpcSecurityGroups = reader.readArray(reader1 -> reader1.getString()); + deserializedAwsRdsDBInstanceProperties.vpcSecurityGroups = vpcSecurityGroups; + } else { + reader.skipChildren(); + } + } + + return deserializedAwsRdsDBInstanceProperties; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/AwsRdsDBSnapshotAttributesResultProperties.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/AwsRdsDBSnapshotAttributesResultProperties.java new file mode 100644 index 000000000000..46bb8740854b --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/AwsRdsDBSnapshotAttributesResultProperties.java @@ -0,0 +1,135 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Definition of awsRdsDBSnapshotAttributesResult. + */ +@Fluent +public final class AwsRdsDBSnapshotAttributesResultProperties + implements JsonSerializable { + /* + *

The list of attributes and values for the manual DB snapshot.

+ */ + private List dbSnapshotAttributes; + + /* + *

The identifier of the manual DB snapshot that the attributes apply to.

+ */ + private String dbSnapshotIdentifier; + + /** + * Creates an instance of AwsRdsDBSnapshotAttributesResultProperties class. + */ + public AwsRdsDBSnapshotAttributesResultProperties() { + } + + /** + * Get the dbSnapshotAttributes property: <p>The list of attributes and values for the manual DB + * snapshot.</p>. + * + * @return the dbSnapshotAttributes value. + */ + public List dbSnapshotAttributes() { + return this.dbSnapshotAttributes; + } + + /** + * Set the dbSnapshotAttributes property: <p>The list of attributes and values for the manual DB + * snapshot.</p>. + * + * @param dbSnapshotAttributes the dbSnapshotAttributes value to set. + * @return the AwsRdsDBSnapshotAttributesResultProperties object itself. + */ + public AwsRdsDBSnapshotAttributesResultProperties + withDbSnapshotAttributes(List dbSnapshotAttributes) { + this.dbSnapshotAttributes = dbSnapshotAttributes; + return this; + } + + /** + * Get the dbSnapshotIdentifier property: <p>The identifier of the manual DB snapshot that the attributes + * apply to.</p>. + * + * @return the dbSnapshotIdentifier value. + */ + public String dbSnapshotIdentifier() { + return this.dbSnapshotIdentifier; + } + + /** + * Set the dbSnapshotIdentifier property: <p>The identifier of the manual DB snapshot that the attributes + * apply to.</p>. + * + * @param dbSnapshotIdentifier the dbSnapshotIdentifier value to set. + * @return the AwsRdsDBSnapshotAttributesResultProperties object itself. + */ + public AwsRdsDBSnapshotAttributesResultProperties withDbSnapshotIdentifier(String dbSnapshotIdentifier) { + this.dbSnapshotIdentifier = dbSnapshotIdentifier; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (dbSnapshotAttributes() != null) { + dbSnapshotAttributes().forEach(e -> e.validate()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("dbSnapshotAttributes", this.dbSnapshotAttributes, + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("dbSnapshotIdentifier", this.dbSnapshotIdentifier); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AwsRdsDBSnapshotAttributesResultProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AwsRdsDBSnapshotAttributesResultProperties if the JsonReader was pointing to an instance + * of it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the AwsRdsDBSnapshotAttributesResultProperties. + */ + public static AwsRdsDBSnapshotAttributesResultProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AwsRdsDBSnapshotAttributesResultProperties deserializedAwsRdsDBSnapshotAttributesResultProperties + = new AwsRdsDBSnapshotAttributesResultProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("dbSnapshotAttributes".equals(fieldName)) { + List dbSnapshotAttributes + = reader.readArray(reader1 -> DBSnapshotAttribute.fromJson(reader1)); + deserializedAwsRdsDBSnapshotAttributesResultProperties.dbSnapshotAttributes = dbSnapshotAttributes; + } else if ("dbSnapshotIdentifier".equals(fieldName)) { + deserializedAwsRdsDBSnapshotAttributesResultProperties.dbSnapshotIdentifier = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedAwsRdsDBSnapshotAttributesResultProperties; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/AwsRdsDBSnapshotProperties.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/AwsRdsDBSnapshotProperties.java new file mode 100644 index 000000000000..0186c042098e --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/AwsRdsDBSnapshotProperties.java @@ -0,0 +1,1180 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.time.OffsetDateTime; +import java.time.format.DateTimeFormatter; +import java.util.List; + +/** + * Definition of awsRdsDBSnapshot. + */ +@Fluent +public final class AwsRdsDBSnapshotProperties implements JsonSerializable { + /* + *

Specifies the allocated storage size in gibibytes (GiB).

+ */ + private Integer allocatedStorage; + + /* + *

Specifies the name of the Availability Zone the DB instance was located in at the time of the DB snapshot.

+ */ + private String availabilityZone; + + /* + *

Specifies the DB instance identifier of the DB instance this DB snapshot was created from.

+ */ + private String dbInstanceIdentifier; + + /* + *

The Amazon Resource Name (ARN) for the DB snapshot.

+ */ + private String dbSnapshotArn; + + /* + *

Specifies the identifier for the DB snapshot.

+ */ + private String dbSnapshotIdentifier; + + /* + *

The Oracle system identifier (SID), which is the name of the Oracle database instance that manages your + * database files. The Oracle SID is also the name of your CDB.

+ */ + private String dbSystemId; + + /* + *

The identifier for the source DB instance, which can't be changed and which is unique to an Amazon Web + * Services Region.

+ */ + private String dbiResourceId; + + /* + *

Indicates whether the DB instance has a dedicated log volume (DLV) enabled.

+ */ + private Boolean dedicatedLogVolume; + + /* + *

Indicates whether the DB snapshot is encrypted.

+ */ + private Boolean encrypted; + + /* + *

Specifies the name of the database engine.

+ */ + private String engine; + + /* + *

Specifies the version of the database engine.

+ */ + private String engineVersion; + + /* + *

Indicates whether mapping of Amazon Web Services Identity and Access Management (IAM) accounts to database + * accounts is enabled.

+ */ + private Boolean iamDatabaseAuthenticationEnabled; + + /* + *

Specifies the time in Coordinated Universal Time (UTC) when the DB instance, from which the snapshot was + * taken, was created.

+ */ + private OffsetDateTime instanceCreateTime; + + /* + *

Specifies the Provisioned IOPS (I/O operations per second) value of the DB instance at the time of the + * snapshot.

+ */ + private Integer iops; + + /* + *

If Encrypted is true, the Amazon Web Services KMS key identifier for the encrypted DB + * snapshot.

The Amazon Web Services KMS key identifier is the key ARN, key ID, alias ARN, or alias name for + * the KMS key.

+ */ + private String kmsKeyId; + + /* + *

License model information for the restored DB instance.

+ */ + private String licenseModel; + + /* + *

Provides the master username for the DB snapshot.

+ */ + private String masterUsername; + + /* + *

Indicates whether the snapshot is of a DB instance using the multi-tenant configuration (TRUE) or the + * single-tenant configuration (FALSE).

+ */ + private Boolean multiTenant; + + /* + *

Provides the option group name for the DB snapshot.

+ */ + private String optionGroupName; + + /* + *

Specifies the time of the CreateDBSnapshot operation in Coordinated Universal Time (UTC). Doesn't change when + * the snapshot is copied.

+ */ + private OffsetDateTime originalSnapshotCreateTime; + + /* + *

The percentage of the estimated data that has been transferred.

+ */ + private Integer percentProgress; + + /* + *

Specifies the port that the database engine was listening on at the time of the snapshot.

+ */ + private Integer port; + + /* + *

The number of CPU cores and the number of threads per core for the DB instance class of the DB instance when + * the DB snapshot was created.

+ */ + private List processorFeatures; + + /* + *

Specifies when the snapshot was taken in Coordinated Universal Time (UTC). Changes for the copy when the + * snapshot is copied.

+ */ + private OffsetDateTime snapshotCreateTime; + + /* + *

The timestamp of the most recent transaction applied to the database that you're backing up. Thus, if you + * restore a snapshot, SnapshotDatabaseTime is the most recent transaction in the restored DB instance. In contrast, + * originalSnapshotCreateTime specifies the system time that the snapshot completed.

If you back up a read + * replica, you can determine the replica lag by comparing SnapshotDatabaseTime with originalSnapshotCreateTime. For + * example, if originalSnapshotCreateTime is two hours later than SnapshotDatabaseTime, then the replica lag is two + * hours.

+ */ + private OffsetDateTime snapshotDatabaseTime; + + /* + *

Specifies where manual snapshots are stored: Amazon Web Services Outposts or the Amazon Web Services + * Region.

+ */ + private String snapshotTarget; + + /* + *

Provides the type of the DB snapshot.

+ */ + private String snapshotType; + + /* + *

The DB snapshot Amazon Resource Name (ARN) that the DB snapshot was copied from. It only has a value in the + * case of a cross-account or cross-Region copy.

+ */ + private String sourceDBSnapshotIdentifier; + + /* + *

The Amazon Web Services Region that the DB snapshot was created in or copied from.

+ */ + private String sourceRegion; + + /* + *

Specifies the status of this DB snapshot.

+ */ + private String status; + + /* + *

Specifies the storage throughput for the DB snapshot.

+ */ + private Integer storageThroughput; + + /* + *

Specifies the storage type associated with DB snapshot.

+ */ + private String storageType; + + /* + * Property tagList + */ + private List tagList; + + /* + *

The ARN from the key store with which to associate the instance for TDE encryption.

+ */ + private String tdeCredentialArn; + + /* + *

The time zone of the DB snapshot. In most cases, the Timezone element is empty. + * Timezone content appears only for snapshots taken from Microsoft SQL Server DB instances that were + * created with a time zone specified.

+ */ + private String timezone; + + /* + *

Provides the VPC ID associated with the DB snapshot.

+ */ + private String vpcId; + + /** + * Creates an instance of AwsRdsDBSnapshotProperties class. + */ + public AwsRdsDBSnapshotProperties() { + } + + /** + * Get the allocatedStorage property: <p>Specifies the allocated storage size in gibibytes (GiB).</p>. + * + * @return the allocatedStorage value. + */ + public Integer allocatedStorage() { + return this.allocatedStorage; + } + + /** + * Set the allocatedStorage property: <p>Specifies the allocated storage size in gibibytes (GiB).</p>. + * + * @param allocatedStorage the allocatedStorage value to set. + * @return the AwsRdsDBSnapshotProperties object itself. + */ + public AwsRdsDBSnapshotProperties withAllocatedStorage(Integer allocatedStorage) { + this.allocatedStorage = allocatedStorage; + return this; + } + + /** + * Get the availabilityZone property: <p>Specifies the name of the Availability Zone the DB instance was + * located in at the time of the DB snapshot.</p>. + * + * @return the availabilityZone value. + */ + public String availabilityZone() { + return this.availabilityZone; + } + + /** + * Set the availabilityZone property: <p>Specifies the name of the Availability Zone the DB instance was + * located in at the time of the DB snapshot.</p>. + * + * @param availabilityZone the availabilityZone value to set. + * @return the AwsRdsDBSnapshotProperties object itself. + */ + public AwsRdsDBSnapshotProperties withAvailabilityZone(String availabilityZone) { + this.availabilityZone = availabilityZone; + return this; + } + + /** + * Get the dbInstanceIdentifier property: <p>Specifies the DB instance identifier of the DB instance this DB + * snapshot was created from.</p>. + * + * @return the dbInstanceIdentifier value. + */ + public String dbInstanceIdentifier() { + return this.dbInstanceIdentifier; + } + + /** + * Set the dbInstanceIdentifier property: <p>Specifies the DB instance identifier of the DB instance this DB + * snapshot was created from.</p>. + * + * @param dbInstanceIdentifier the dbInstanceIdentifier value to set. + * @return the AwsRdsDBSnapshotProperties object itself. + */ + public AwsRdsDBSnapshotProperties withDbInstanceIdentifier(String dbInstanceIdentifier) { + this.dbInstanceIdentifier = dbInstanceIdentifier; + return this; + } + + /** + * Get the dbSnapshotArn property: <p>The Amazon Resource Name (ARN) for the DB snapshot.</p>. + * + * @return the dbSnapshotArn value. + */ + public String dbSnapshotArn() { + return this.dbSnapshotArn; + } + + /** + * Set the dbSnapshotArn property: <p>The Amazon Resource Name (ARN) for the DB snapshot.</p>. + * + * @param dbSnapshotArn the dbSnapshotArn value to set. + * @return the AwsRdsDBSnapshotProperties object itself. + */ + public AwsRdsDBSnapshotProperties withDbSnapshotArn(String dbSnapshotArn) { + this.dbSnapshotArn = dbSnapshotArn; + return this; + } + + /** + * Get the dbSnapshotIdentifier property: <p>Specifies the identifier for the DB snapshot.</p>. + * + * @return the dbSnapshotIdentifier value. + */ + public String dbSnapshotIdentifier() { + return this.dbSnapshotIdentifier; + } + + /** + * Set the dbSnapshotIdentifier property: <p>Specifies the identifier for the DB snapshot.</p>. + * + * @param dbSnapshotIdentifier the dbSnapshotIdentifier value to set. + * @return the AwsRdsDBSnapshotProperties object itself. + */ + public AwsRdsDBSnapshotProperties withDbSnapshotIdentifier(String dbSnapshotIdentifier) { + this.dbSnapshotIdentifier = dbSnapshotIdentifier; + return this; + } + + /** + * Get the dbSystemId property: <p>The Oracle system identifier (SID), which is the name of the Oracle + * database instance that manages your database files. The Oracle SID is also the name of your CDB.</p>. + * + * @return the dbSystemId value. + */ + public String dbSystemId() { + return this.dbSystemId; + } + + /** + * Set the dbSystemId property: <p>The Oracle system identifier (SID), which is the name of the Oracle + * database instance that manages your database files. The Oracle SID is also the name of your CDB.</p>. + * + * @param dbSystemId the dbSystemId value to set. + * @return the AwsRdsDBSnapshotProperties object itself. + */ + public AwsRdsDBSnapshotProperties withDbSystemId(String dbSystemId) { + this.dbSystemId = dbSystemId; + return this; + } + + /** + * Get the dbiResourceId property: <p>The identifier for the source DB instance, which can't be changed and + * which is unique to an Amazon Web Services Region.</p>. + * + * @return the dbiResourceId value. + */ + public String dbiResourceId() { + return this.dbiResourceId; + } + + /** + * Set the dbiResourceId property: <p>The identifier for the source DB instance, which can't be changed and + * which is unique to an Amazon Web Services Region.</p>. + * + * @param dbiResourceId the dbiResourceId value to set. + * @return the AwsRdsDBSnapshotProperties object itself. + */ + public AwsRdsDBSnapshotProperties withDbiResourceId(String dbiResourceId) { + this.dbiResourceId = dbiResourceId; + return this; + } + + /** + * Get the dedicatedLogVolume property: <p>Indicates whether the DB instance has a dedicated log volume (DLV) + * enabled.</p>. + * + * @return the dedicatedLogVolume value. + */ + public Boolean dedicatedLogVolume() { + return this.dedicatedLogVolume; + } + + /** + * Set the dedicatedLogVolume property: <p>Indicates whether the DB instance has a dedicated log volume (DLV) + * enabled.</p>. + * + * @param dedicatedLogVolume the dedicatedLogVolume value to set. + * @return the AwsRdsDBSnapshotProperties object itself. + */ + public AwsRdsDBSnapshotProperties withDedicatedLogVolume(Boolean dedicatedLogVolume) { + this.dedicatedLogVolume = dedicatedLogVolume; + return this; + } + + /** + * Get the encrypted property: <p>Indicates whether the DB snapshot is encrypted.</p>. + * + * @return the encrypted value. + */ + public Boolean encrypted() { + return this.encrypted; + } + + /** + * Set the encrypted property: <p>Indicates whether the DB snapshot is encrypted.</p>. + * + * @param encrypted the encrypted value to set. + * @return the AwsRdsDBSnapshotProperties object itself. + */ + public AwsRdsDBSnapshotProperties withEncrypted(Boolean encrypted) { + this.encrypted = encrypted; + return this; + } + + /** + * Get the engine property: <p>Specifies the name of the database engine.</p>. + * + * @return the engine value. + */ + public String engine() { + return this.engine; + } + + /** + * Set the engine property: <p>Specifies the name of the database engine.</p>. + * + * @param engine the engine value to set. + * @return the AwsRdsDBSnapshotProperties object itself. + */ + public AwsRdsDBSnapshotProperties withEngine(String engine) { + this.engine = engine; + return this; + } + + /** + * Get the engineVersion property: <p>Specifies the version of the database engine.</p>. + * + * @return the engineVersion value. + */ + public String engineVersion() { + return this.engineVersion; + } + + /** + * Set the engineVersion property: <p>Specifies the version of the database engine.</p>. + * + * @param engineVersion the engineVersion value to set. + * @return the AwsRdsDBSnapshotProperties object itself. + */ + public AwsRdsDBSnapshotProperties withEngineVersion(String engineVersion) { + this.engineVersion = engineVersion; + return this; + } + + /** + * Get the iamDatabaseAuthenticationEnabled property: <p>Indicates whether mapping of Amazon Web Services + * Identity and Access Management (IAM) accounts to database accounts is enabled.</p>. + * + * @return the iamDatabaseAuthenticationEnabled value. + */ + public Boolean iamDatabaseAuthenticationEnabled() { + return this.iamDatabaseAuthenticationEnabled; + } + + /** + * Set the iamDatabaseAuthenticationEnabled property: <p>Indicates whether mapping of Amazon Web Services + * Identity and Access Management (IAM) accounts to database accounts is enabled.</p>. + * + * @param iamDatabaseAuthenticationEnabled the iamDatabaseAuthenticationEnabled value to set. + * @return the AwsRdsDBSnapshotProperties object itself. + */ + public AwsRdsDBSnapshotProperties withIamDatabaseAuthenticationEnabled(Boolean iamDatabaseAuthenticationEnabled) { + this.iamDatabaseAuthenticationEnabled = iamDatabaseAuthenticationEnabled; + return this; + } + + /** + * Get the instanceCreateTime property: <p>Specifies the time in Coordinated Universal Time (UTC) when the DB + * instance, from which the snapshot was taken, was created.</p>. + * + * @return the instanceCreateTime value. + */ + public OffsetDateTime instanceCreateTime() { + return this.instanceCreateTime; + } + + /** + * Set the instanceCreateTime property: <p>Specifies the time in Coordinated Universal Time (UTC) when the DB + * instance, from which the snapshot was taken, was created.</p>. + * + * @param instanceCreateTime the instanceCreateTime value to set. + * @return the AwsRdsDBSnapshotProperties object itself. + */ + public AwsRdsDBSnapshotProperties withInstanceCreateTime(OffsetDateTime instanceCreateTime) { + this.instanceCreateTime = instanceCreateTime; + return this; + } + + /** + * Get the iops property: <p>Specifies the Provisioned IOPS (I/O operations per second) value of the DB + * instance at the time of the snapshot.</p>. + * + * @return the iops value. + */ + public Integer iops() { + return this.iops; + } + + /** + * Set the iops property: <p>Specifies the Provisioned IOPS (I/O operations per second) value of the DB + * instance at the time of the snapshot.</p>. + * + * @param iops the iops value to set. + * @return the AwsRdsDBSnapshotProperties object itself. + */ + public AwsRdsDBSnapshotProperties withIops(Integer iops) { + this.iops = iops; + return this; + } + + /** + * Get the kmsKeyId property: <p>If <code>Encrypted</code> is true, the Amazon Web Services KMS + * key identifier for the encrypted DB snapshot.</p> <p>The Amazon Web Services KMS key identifier is + * the key ARN, key ID, alias ARN, or alias name for the KMS key.</p>. + * + * @return the kmsKeyId value. + */ + public String kmsKeyId() { + return this.kmsKeyId; + } + + /** + * Set the kmsKeyId property: <p>If <code>Encrypted</code> is true, the Amazon Web Services KMS + * key identifier for the encrypted DB snapshot.</p> <p>The Amazon Web Services KMS key identifier is + * the key ARN, key ID, alias ARN, or alias name for the KMS key.</p>. + * + * @param kmsKeyId the kmsKeyId value to set. + * @return the AwsRdsDBSnapshotProperties object itself. + */ + public AwsRdsDBSnapshotProperties withKmsKeyId(String kmsKeyId) { + this.kmsKeyId = kmsKeyId; + return this; + } + + /** + * Get the licenseModel property: <p>License model information for the restored DB instance.</p>. + * + * @return the licenseModel value. + */ + public String licenseModel() { + return this.licenseModel; + } + + /** + * Set the licenseModel property: <p>License model information for the restored DB instance.</p>. + * + * @param licenseModel the licenseModel value to set. + * @return the AwsRdsDBSnapshotProperties object itself. + */ + public AwsRdsDBSnapshotProperties withLicenseModel(String licenseModel) { + this.licenseModel = licenseModel; + return this; + } + + /** + * Get the masterUsername property: <p>Provides the master username for the DB snapshot.</p>. + * + * @return the masterUsername value. + */ + public String masterUsername() { + return this.masterUsername; + } + + /** + * Set the masterUsername property: <p>Provides the master username for the DB snapshot.</p>. + * + * @param masterUsername the masterUsername value to set. + * @return the AwsRdsDBSnapshotProperties object itself. + */ + public AwsRdsDBSnapshotProperties withMasterUsername(String masterUsername) { + this.masterUsername = masterUsername; + return this; + } + + /** + * Get the multiTenant property: <p>Indicates whether the snapshot is of a DB instance using the multi-tenant + * configuration (TRUE) or the single-tenant configuration (FALSE).</p>. + * + * @return the multiTenant value. + */ + public Boolean multiTenant() { + return this.multiTenant; + } + + /** + * Set the multiTenant property: <p>Indicates whether the snapshot is of a DB instance using the multi-tenant + * configuration (TRUE) or the single-tenant configuration (FALSE).</p>. + * + * @param multiTenant the multiTenant value to set. + * @return the AwsRdsDBSnapshotProperties object itself. + */ + public AwsRdsDBSnapshotProperties withMultiTenant(Boolean multiTenant) { + this.multiTenant = multiTenant; + return this; + } + + /** + * Get the optionGroupName property: <p>Provides the option group name for the DB snapshot.</p>. + * + * @return the optionGroupName value. + */ + public String optionGroupName() { + return this.optionGroupName; + } + + /** + * Set the optionGroupName property: <p>Provides the option group name for the DB snapshot.</p>. + * + * @param optionGroupName the optionGroupName value to set. + * @return the AwsRdsDBSnapshotProperties object itself. + */ + public AwsRdsDBSnapshotProperties withOptionGroupName(String optionGroupName) { + this.optionGroupName = optionGroupName; + return this; + } + + /** + * Get the originalSnapshotCreateTime property: <p>Specifies the time of the CreateDBSnapshot operation in + * Coordinated Universal Time (UTC). Doesn't change when the snapshot is copied.</p>. + * + * @return the originalSnapshotCreateTime value. + */ + public OffsetDateTime originalSnapshotCreateTime() { + return this.originalSnapshotCreateTime; + } + + /** + * Set the originalSnapshotCreateTime property: <p>Specifies the time of the CreateDBSnapshot operation in + * Coordinated Universal Time (UTC). Doesn't change when the snapshot is copied.</p>. + * + * @param originalSnapshotCreateTime the originalSnapshotCreateTime value to set. + * @return the AwsRdsDBSnapshotProperties object itself. + */ + public AwsRdsDBSnapshotProperties withOriginalSnapshotCreateTime(OffsetDateTime originalSnapshotCreateTime) { + this.originalSnapshotCreateTime = originalSnapshotCreateTime; + return this; + } + + /** + * Get the percentProgress property: <p>The percentage of the estimated data that has been + * transferred.</p>. + * + * @return the percentProgress value. + */ + public Integer percentProgress() { + return this.percentProgress; + } + + /** + * Set the percentProgress property: <p>The percentage of the estimated data that has been + * transferred.</p>. + * + * @param percentProgress the percentProgress value to set. + * @return the AwsRdsDBSnapshotProperties object itself. + */ + public AwsRdsDBSnapshotProperties withPercentProgress(Integer percentProgress) { + this.percentProgress = percentProgress; + return this; + } + + /** + * Get the port property: <p>Specifies the port that the database engine was listening on at the time of the + * snapshot.</p>. + * + * @return the port value. + */ + public Integer port() { + return this.port; + } + + /** + * Set the port property: <p>Specifies the port that the database engine was listening on at the time of the + * snapshot.</p>. + * + * @param port the port value to set. + * @return the AwsRdsDBSnapshotProperties object itself. + */ + public AwsRdsDBSnapshotProperties withPort(Integer port) { + this.port = port; + return this; + } + + /** + * Get the processorFeatures property: <p>The number of CPU cores and the number of threads per core for the + * DB instance class of the DB instance when the DB snapshot was created.</p>. + * + * @return the processorFeatures value. + */ + public List processorFeatures() { + return this.processorFeatures; + } + + /** + * Set the processorFeatures property: <p>The number of CPU cores and the number of threads per core for the + * DB instance class of the DB instance when the DB snapshot was created.</p>. + * + * @param processorFeatures the processorFeatures value to set. + * @return the AwsRdsDBSnapshotProperties object itself. + */ + public AwsRdsDBSnapshotProperties withProcessorFeatures(List processorFeatures) { + this.processorFeatures = processorFeatures; + return this; + } + + /** + * Get the snapshotCreateTime property: <p>Specifies when the snapshot was taken in Coordinated Universal Time + * (UTC). Changes for the copy when the snapshot is copied.</p>. + * + * @return the snapshotCreateTime value. + */ + public OffsetDateTime snapshotCreateTime() { + return this.snapshotCreateTime; + } + + /** + * Set the snapshotCreateTime property: <p>Specifies when the snapshot was taken in Coordinated Universal Time + * (UTC). Changes for the copy when the snapshot is copied.</p>. + * + * @param snapshotCreateTime the snapshotCreateTime value to set. + * @return the AwsRdsDBSnapshotProperties object itself. + */ + public AwsRdsDBSnapshotProperties withSnapshotCreateTime(OffsetDateTime snapshotCreateTime) { + this.snapshotCreateTime = snapshotCreateTime; + return this; + } + + /** + * Get the snapshotDatabaseTime property: <p>The timestamp of the most recent transaction applied to the + * database that you're backing up. Thus, if you restore a snapshot, SnapshotDatabaseTime is the most recent + * transaction in the restored DB instance. In contrast, originalSnapshotCreateTime specifies the system time that + * the snapshot completed.</p> <p>If you back up a read replica, you can determine the replica lag by + * comparing SnapshotDatabaseTime with originalSnapshotCreateTime. For example, if originalSnapshotCreateTime is two + * hours later than SnapshotDatabaseTime, then the replica lag is two hours.</p>. + * + * @return the snapshotDatabaseTime value. + */ + public OffsetDateTime snapshotDatabaseTime() { + return this.snapshotDatabaseTime; + } + + /** + * Set the snapshotDatabaseTime property: <p>The timestamp of the most recent transaction applied to the + * database that you're backing up. Thus, if you restore a snapshot, SnapshotDatabaseTime is the most recent + * transaction in the restored DB instance. In contrast, originalSnapshotCreateTime specifies the system time that + * the snapshot completed.</p> <p>If you back up a read replica, you can determine the replica lag by + * comparing SnapshotDatabaseTime with originalSnapshotCreateTime. For example, if originalSnapshotCreateTime is two + * hours later than SnapshotDatabaseTime, then the replica lag is two hours.</p>. + * + * @param snapshotDatabaseTime the snapshotDatabaseTime value to set. + * @return the AwsRdsDBSnapshotProperties object itself. + */ + public AwsRdsDBSnapshotProperties withSnapshotDatabaseTime(OffsetDateTime snapshotDatabaseTime) { + this.snapshotDatabaseTime = snapshotDatabaseTime; + return this; + } + + /** + * Get the snapshotTarget property: <p>Specifies where manual snapshots are stored: Amazon Web Services + * Outposts or the Amazon Web Services Region.</p>. + * + * @return the snapshotTarget value. + */ + public String snapshotTarget() { + return this.snapshotTarget; + } + + /** + * Set the snapshotTarget property: <p>Specifies where manual snapshots are stored: Amazon Web Services + * Outposts or the Amazon Web Services Region.</p>. + * + * @param snapshotTarget the snapshotTarget value to set. + * @return the AwsRdsDBSnapshotProperties object itself. + */ + public AwsRdsDBSnapshotProperties withSnapshotTarget(String snapshotTarget) { + this.snapshotTarget = snapshotTarget; + return this; + } + + /** + * Get the snapshotType property: <p>Provides the type of the DB snapshot.</p>. + * + * @return the snapshotType value. + */ + public String snapshotType() { + return this.snapshotType; + } + + /** + * Set the snapshotType property: <p>Provides the type of the DB snapshot.</p>. + * + * @param snapshotType the snapshotType value to set. + * @return the AwsRdsDBSnapshotProperties object itself. + */ + public AwsRdsDBSnapshotProperties withSnapshotType(String snapshotType) { + this.snapshotType = snapshotType; + return this; + } + + /** + * Get the sourceDBSnapshotIdentifier property: <p>The DB snapshot Amazon Resource Name (ARN) that the DB + * snapshot was copied from. It only has a value in the case of a cross-account or cross-Region copy.</p>. + * + * @return the sourceDBSnapshotIdentifier value. + */ + public String sourceDBSnapshotIdentifier() { + return this.sourceDBSnapshotIdentifier; + } + + /** + * Set the sourceDBSnapshotIdentifier property: <p>The DB snapshot Amazon Resource Name (ARN) that the DB + * snapshot was copied from. It only has a value in the case of a cross-account or cross-Region copy.</p>. + * + * @param sourceDBSnapshotIdentifier the sourceDBSnapshotIdentifier value to set. + * @return the AwsRdsDBSnapshotProperties object itself. + */ + public AwsRdsDBSnapshotProperties withSourceDBSnapshotIdentifier(String sourceDBSnapshotIdentifier) { + this.sourceDBSnapshotIdentifier = sourceDBSnapshotIdentifier; + return this; + } + + /** + * Get the sourceRegion property: <p>The Amazon Web Services Region that the DB snapshot was created in or + * copied from.</p>. + * + * @return the sourceRegion value. + */ + public String sourceRegion() { + return this.sourceRegion; + } + + /** + * Set the sourceRegion property: <p>The Amazon Web Services Region that the DB snapshot was created in or + * copied from.</p>. + * + * @param sourceRegion the sourceRegion value to set. + * @return the AwsRdsDBSnapshotProperties object itself. + */ + public AwsRdsDBSnapshotProperties withSourceRegion(String sourceRegion) { + this.sourceRegion = sourceRegion; + return this; + } + + /** + * Get the status property: <p>Specifies the status of this DB snapshot.</p>. + * + * @return the status value. + */ + public String status() { + return this.status; + } + + /** + * Set the status property: <p>Specifies the status of this DB snapshot.</p>. + * + * @param status the status value to set. + * @return the AwsRdsDBSnapshotProperties object itself. + */ + public AwsRdsDBSnapshotProperties withStatus(String status) { + this.status = status; + return this; + } + + /** + * Get the storageThroughput property: <p>Specifies the storage throughput for the DB snapshot.</p>. + * + * @return the storageThroughput value. + */ + public Integer storageThroughput() { + return this.storageThroughput; + } + + /** + * Set the storageThroughput property: <p>Specifies the storage throughput for the DB snapshot.</p>. + * + * @param storageThroughput the storageThroughput value to set. + * @return the AwsRdsDBSnapshotProperties object itself. + */ + public AwsRdsDBSnapshotProperties withStorageThroughput(Integer storageThroughput) { + this.storageThroughput = storageThroughput; + return this; + } + + /** + * Get the storageType property: <p>Specifies the storage type associated with DB snapshot.</p>. + * + * @return the storageType value. + */ + public String storageType() { + return this.storageType; + } + + /** + * Set the storageType property: <p>Specifies the storage type associated with DB snapshot.</p>. + * + * @param storageType the storageType value to set. + * @return the AwsRdsDBSnapshotProperties object itself. + */ + public AwsRdsDBSnapshotProperties withStorageType(String storageType) { + this.storageType = storageType; + return this; + } + + /** + * Get the tagList property: Property tagList. + * + * @return the tagList value. + */ + public List tagList() { + return this.tagList; + } + + /** + * Set the tagList property: Property tagList. + * + * @param tagList the tagList value to set. + * @return the AwsRdsDBSnapshotProperties object itself. + */ + public AwsRdsDBSnapshotProperties withTagList(List tagList) { + this.tagList = tagList; + return this; + } + + /** + * Get the tdeCredentialArn property: <p>The ARN from the key store with which to associate the instance for + * TDE encryption.</p>. + * + * @return the tdeCredentialArn value. + */ + public String tdeCredentialArn() { + return this.tdeCredentialArn; + } + + /** + * Set the tdeCredentialArn property: <p>The ARN from the key store with which to associate the instance for + * TDE encryption.</p>. + * + * @param tdeCredentialArn the tdeCredentialArn value to set. + * @return the AwsRdsDBSnapshotProperties object itself. + */ + public AwsRdsDBSnapshotProperties withTdeCredentialArn(String tdeCredentialArn) { + this.tdeCredentialArn = tdeCredentialArn; + return this; + } + + /** + * Get the timezone property: <p>The time zone of the DB snapshot. In most cases, the + * <code>Timezone</code> element is empty. <code>Timezone</code> content appears only for + * snapshots taken from Microsoft SQL Server DB instances that were created with a time zone specified.</p>. + * + * @return the timezone value. + */ + public String timezone() { + return this.timezone; + } + + /** + * Set the timezone property: <p>The time zone of the DB snapshot. In most cases, the + * <code>Timezone</code> element is empty. <code>Timezone</code> content appears only for + * snapshots taken from Microsoft SQL Server DB instances that were created with a time zone specified.</p>. + * + * @param timezone the timezone value to set. + * @return the AwsRdsDBSnapshotProperties object itself. + */ + public AwsRdsDBSnapshotProperties withTimezone(String timezone) { + this.timezone = timezone; + return this; + } + + /** + * Get the vpcId property: <p>Provides the VPC ID associated with the DB snapshot.</p>. + * + * @return the vpcId value. + */ + public String vpcId() { + return this.vpcId; + } + + /** + * Set the vpcId property: <p>Provides the VPC ID associated with the DB snapshot.</p>. + * + * @param vpcId the vpcId value to set. + * @return the AwsRdsDBSnapshotProperties object itself. + */ + public AwsRdsDBSnapshotProperties withVpcId(String vpcId) { + this.vpcId = vpcId; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (processorFeatures() != null) { + processorFeatures().forEach(e -> e.validate()); + } + if (tagList() != null) { + tagList().forEach(e -> e.validate()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeNumberField("allocatedStorage", this.allocatedStorage); + jsonWriter.writeStringField("availabilityZone", this.availabilityZone); + jsonWriter.writeStringField("dbInstanceIdentifier", this.dbInstanceIdentifier); + jsonWriter.writeStringField("dbSnapshotArn", this.dbSnapshotArn); + jsonWriter.writeStringField("dbSnapshotIdentifier", this.dbSnapshotIdentifier); + jsonWriter.writeStringField("dbSystemId", this.dbSystemId); + jsonWriter.writeStringField("dbiResourceId", this.dbiResourceId); + jsonWriter.writeBooleanField("dedicatedLogVolume", this.dedicatedLogVolume); + jsonWriter.writeBooleanField("encrypted", this.encrypted); + jsonWriter.writeStringField("engine", this.engine); + jsonWriter.writeStringField("engineVersion", this.engineVersion); + jsonWriter.writeBooleanField("iamDatabaseAuthenticationEnabled", this.iamDatabaseAuthenticationEnabled); + jsonWriter.writeStringField("instanceCreateTime", + this.instanceCreateTime == null + ? null + : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.instanceCreateTime)); + jsonWriter.writeNumberField("iops", this.iops); + jsonWriter.writeStringField("kmsKeyId", this.kmsKeyId); + jsonWriter.writeStringField("licenseModel", this.licenseModel); + jsonWriter.writeStringField("masterUsername", this.masterUsername); + jsonWriter.writeBooleanField("multiTenant", this.multiTenant); + jsonWriter.writeStringField("optionGroupName", this.optionGroupName); + jsonWriter.writeStringField("originalSnapshotCreateTime", + this.originalSnapshotCreateTime == null + ? null + : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.originalSnapshotCreateTime)); + jsonWriter.writeNumberField("percentProgress", this.percentProgress); + jsonWriter.writeNumberField("port", this.port); + jsonWriter.writeArrayField("processorFeatures", this.processorFeatures, + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("snapshotCreateTime", + this.snapshotCreateTime == null + ? null + : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.snapshotCreateTime)); + jsonWriter.writeStringField("snapshotDatabaseTime", + this.snapshotDatabaseTime == null + ? null + : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.snapshotDatabaseTime)); + jsonWriter.writeStringField("snapshotTarget", this.snapshotTarget); + jsonWriter.writeStringField("snapshotType", this.snapshotType); + jsonWriter.writeStringField("sourceDBSnapshotIdentifier", this.sourceDBSnapshotIdentifier); + jsonWriter.writeStringField("sourceRegion", this.sourceRegion); + jsonWriter.writeStringField("status", this.status); + jsonWriter.writeNumberField("storageThroughput", this.storageThroughput); + jsonWriter.writeStringField("storageType", this.storageType); + jsonWriter.writeArrayField("tagList", this.tagList, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("tdeCredentialArn", this.tdeCredentialArn); + jsonWriter.writeStringField("timezone", this.timezone); + jsonWriter.writeStringField("vpcId", this.vpcId); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AwsRdsDBSnapshotProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AwsRdsDBSnapshotProperties if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IOException If an error occurs while reading the AwsRdsDBSnapshotProperties. + */ + public static AwsRdsDBSnapshotProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AwsRdsDBSnapshotProperties deserializedAwsRdsDBSnapshotProperties = new AwsRdsDBSnapshotProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("allocatedStorage".equals(fieldName)) { + deserializedAwsRdsDBSnapshotProperties.allocatedStorage = reader.getNullable(JsonReader::getInt); + } else if ("availabilityZone".equals(fieldName)) { + deserializedAwsRdsDBSnapshotProperties.availabilityZone = reader.getString(); + } else if ("dbInstanceIdentifier".equals(fieldName)) { + deserializedAwsRdsDBSnapshotProperties.dbInstanceIdentifier = reader.getString(); + } else if ("dbSnapshotArn".equals(fieldName)) { + deserializedAwsRdsDBSnapshotProperties.dbSnapshotArn = reader.getString(); + } else if ("dbSnapshotIdentifier".equals(fieldName)) { + deserializedAwsRdsDBSnapshotProperties.dbSnapshotIdentifier = reader.getString(); + } else if ("dbSystemId".equals(fieldName)) { + deserializedAwsRdsDBSnapshotProperties.dbSystemId = reader.getString(); + } else if ("dbiResourceId".equals(fieldName)) { + deserializedAwsRdsDBSnapshotProperties.dbiResourceId = reader.getString(); + } else if ("dedicatedLogVolume".equals(fieldName)) { + deserializedAwsRdsDBSnapshotProperties.dedicatedLogVolume + = reader.getNullable(JsonReader::getBoolean); + } else if ("encrypted".equals(fieldName)) { + deserializedAwsRdsDBSnapshotProperties.encrypted = reader.getNullable(JsonReader::getBoolean); + } else if ("engine".equals(fieldName)) { + deserializedAwsRdsDBSnapshotProperties.engine = reader.getString(); + } else if ("engineVersion".equals(fieldName)) { + deserializedAwsRdsDBSnapshotProperties.engineVersion = reader.getString(); + } else if ("iamDatabaseAuthenticationEnabled".equals(fieldName)) { + deserializedAwsRdsDBSnapshotProperties.iamDatabaseAuthenticationEnabled + = reader.getNullable(JsonReader::getBoolean); + } else if ("instanceCreateTime".equals(fieldName)) { + deserializedAwsRdsDBSnapshotProperties.instanceCreateTime = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("iops".equals(fieldName)) { + deserializedAwsRdsDBSnapshotProperties.iops = reader.getNullable(JsonReader::getInt); + } else if ("kmsKeyId".equals(fieldName)) { + deserializedAwsRdsDBSnapshotProperties.kmsKeyId = reader.getString(); + } else if ("licenseModel".equals(fieldName)) { + deserializedAwsRdsDBSnapshotProperties.licenseModel = reader.getString(); + } else if ("masterUsername".equals(fieldName)) { + deserializedAwsRdsDBSnapshotProperties.masterUsername = reader.getString(); + } else if ("multiTenant".equals(fieldName)) { + deserializedAwsRdsDBSnapshotProperties.multiTenant = reader.getNullable(JsonReader::getBoolean); + } else if ("optionGroupName".equals(fieldName)) { + deserializedAwsRdsDBSnapshotProperties.optionGroupName = reader.getString(); + } else if ("originalSnapshotCreateTime".equals(fieldName)) { + deserializedAwsRdsDBSnapshotProperties.originalSnapshotCreateTime = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("percentProgress".equals(fieldName)) { + deserializedAwsRdsDBSnapshotProperties.percentProgress = reader.getNullable(JsonReader::getInt); + } else if ("port".equals(fieldName)) { + deserializedAwsRdsDBSnapshotProperties.port = reader.getNullable(JsonReader::getInt); + } else if ("processorFeatures".equals(fieldName)) { + List processorFeatures + = reader.readArray(reader1 -> ProcessorFeatureAutoGenerated.fromJson(reader1)); + deserializedAwsRdsDBSnapshotProperties.processorFeatures = processorFeatures; + } else if ("snapshotCreateTime".equals(fieldName)) { + deserializedAwsRdsDBSnapshotProperties.snapshotCreateTime = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("snapshotDatabaseTime".equals(fieldName)) { + deserializedAwsRdsDBSnapshotProperties.snapshotDatabaseTime = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("snapshotTarget".equals(fieldName)) { + deserializedAwsRdsDBSnapshotProperties.snapshotTarget = reader.getString(); + } else if ("snapshotType".equals(fieldName)) { + deserializedAwsRdsDBSnapshotProperties.snapshotType = reader.getString(); + } else if ("sourceDBSnapshotIdentifier".equals(fieldName)) { + deserializedAwsRdsDBSnapshotProperties.sourceDBSnapshotIdentifier = reader.getString(); + } else if ("sourceRegion".equals(fieldName)) { + deserializedAwsRdsDBSnapshotProperties.sourceRegion = reader.getString(); + } else if ("status".equals(fieldName)) { + deserializedAwsRdsDBSnapshotProperties.status = reader.getString(); + } else if ("storageThroughput".equals(fieldName)) { + deserializedAwsRdsDBSnapshotProperties.storageThroughput = reader.getNullable(JsonReader::getInt); + } else if ("storageType".equals(fieldName)) { + deserializedAwsRdsDBSnapshotProperties.storageType = reader.getString(); + } else if ("tagList".equals(fieldName)) { + List tagList + = reader.readArray(reader1 -> TagAutoGenerated47.fromJson(reader1)); + deserializedAwsRdsDBSnapshotProperties.tagList = tagList; + } else if ("tdeCredentialArn".equals(fieldName)) { + deserializedAwsRdsDBSnapshotProperties.tdeCredentialArn = reader.getString(); + } else if ("timezone".equals(fieldName)) { + deserializedAwsRdsDBSnapshotProperties.timezone = reader.getString(); + } else if ("vpcId".equals(fieldName)) { + deserializedAwsRdsDBSnapshotProperties.vpcId = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedAwsRdsDBSnapshotProperties; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/AwsRdsEventSubscriptionProperties.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/AwsRdsEventSubscriptionProperties.java new file mode 100644 index 000000000000..dd69ba1a8dc8 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/AwsRdsEventSubscriptionProperties.java @@ -0,0 +1,294 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Definition of awsRdsEventSubscription. + */ +@Fluent +public final class AwsRdsEventSubscriptionProperties implements JsonSerializable { + /* + * A Boolean value; set to true to activate the subscription, set to false to create the subscription but not active + * it. + */ + private Boolean enabled; + + /* + * A list of event categories for a SourceType that you want to subscribe to. You can see a list of the categories + * for a given SourceType in the Events topic in the Amazon RDS User Guide or by using the DescribeEventCategories + * action. + */ + private List eventCategories; + + /* + * The Amazon Resource Name (ARN) of the SNS topic created for event notification. The ARN is created by Amazon SNS + * when you create a topic and subscribe to it. + */ + private String snsTopicArn; + + /* + * The list of identifiers of the event sources for which events will be returned. If not specified, then all + * sources are included in the response. An identifier must begin with a letter and must contain only ASCII letters, + * digits, and hyphens; it cannot end with a hyphen or contain two consecutive hyphens. + */ + private List sourceIds; + + /* + * The type of source that will be generating the events. For example, if you want to be notified of events + * generated by a DB instance, you would set this parameter to db-instance. if this value is not specified, all + * events are returned. + */ + private String sourceType; + + /* + * The name of the subscription. + */ + private String subscriptionName; + + /* + * An array of key-value pairs to apply to this resource. + */ + private List tags; + + /** + * Creates an instance of AwsRdsEventSubscriptionProperties class. + */ + public AwsRdsEventSubscriptionProperties() { + } + + /** + * Get the enabled property: A Boolean value; set to true to activate the subscription, set to false to create the + * subscription but not active it. + * + * @return the enabled value. + */ + public Boolean enabled() { + return this.enabled; + } + + /** + * Set the enabled property: A Boolean value; set to true to activate the subscription, set to false to create the + * subscription but not active it. + * + * @param enabled the enabled value to set. + * @return the AwsRdsEventSubscriptionProperties object itself. + */ + public AwsRdsEventSubscriptionProperties withEnabled(Boolean enabled) { + this.enabled = enabled; + return this; + } + + /** + * Get the eventCategories property: A list of event categories for a SourceType that you want to subscribe to. You + * can see a list of the categories for a given SourceType in the Events topic in the Amazon RDS User Guide or by + * using the DescribeEventCategories action. + * + * @return the eventCategories value. + */ + public List eventCategories() { + return this.eventCategories; + } + + /** + * Set the eventCategories property: A list of event categories for a SourceType that you want to subscribe to. You + * can see a list of the categories for a given SourceType in the Events topic in the Amazon RDS User Guide or by + * using the DescribeEventCategories action. + * + * @param eventCategories the eventCategories value to set. + * @return the AwsRdsEventSubscriptionProperties object itself. + */ + public AwsRdsEventSubscriptionProperties withEventCategories(List eventCategories) { + this.eventCategories = eventCategories; + return this; + } + + /** + * Get the snsTopicArn property: The Amazon Resource Name (ARN) of the SNS topic created for event notification. The + * ARN is created by Amazon SNS when you create a topic and subscribe to it. + * + * @return the snsTopicArn value. + */ + public String snsTopicArn() { + return this.snsTopicArn; + } + + /** + * Set the snsTopicArn property: The Amazon Resource Name (ARN) of the SNS topic created for event notification. The + * ARN is created by Amazon SNS when you create a topic and subscribe to it. + * + * @param snsTopicArn the snsTopicArn value to set. + * @return the AwsRdsEventSubscriptionProperties object itself. + */ + public AwsRdsEventSubscriptionProperties withSnsTopicArn(String snsTopicArn) { + this.snsTopicArn = snsTopicArn; + return this; + } + + /** + * Get the sourceIds property: The list of identifiers of the event sources for which events will be returned. If + * not specified, then all sources are included in the response. An identifier must begin with a letter and must + * contain only ASCII letters, digits, and hyphens; it cannot end with a hyphen or contain two consecutive hyphens. + * + * @return the sourceIds value. + */ + public List sourceIds() { + return this.sourceIds; + } + + /** + * Set the sourceIds property: The list of identifiers of the event sources for which events will be returned. If + * not specified, then all sources are included in the response. An identifier must begin with a letter and must + * contain only ASCII letters, digits, and hyphens; it cannot end with a hyphen or contain two consecutive hyphens. + * + * @param sourceIds the sourceIds value to set. + * @return the AwsRdsEventSubscriptionProperties object itself. + */ + public AwsRdsEventSubscriptionProperties withSourceIds(List sourceIds) { + this.sourceIds = sourceIds; + return this; + } + + /** + * Get the sourceType property: The type of source that will be generating the events. For example, if you want to + * be notified of events generated by a DB instance, you would set this parameter to db-instance. if this value is + * not specified, all events are returned. + * + * @return the sourceType value. + */ + public String sourceType() { + return this.sourceType; + } + + /** + * Set the sourceType property: The type of source that will be generating the events. For example, if you want to + * be notified of events generated by a DB instance, you would set this parameter to db-instance. if this value is + * not specified, all events are returned. + * + * @param sourceType the sourceType value to set. + * @return the AwsRdsEventSubscriptionProperties object itself. + */ + public AwsRdsEventSubscriptionProperties withSourceType(String sourceType) { + this.sourceType = sourceType; + return this; + } + + /** + * Get the subscriptionName property: The name of the subscription. + * + * @return the subscriptionName value. + */ + public String subscriptionName() { + return this.subscriptionName; + } + + /** + * Set the subscriptionName property: The name of the subscription. + * + * @param subscriptionName the subscriptionName value to set. + * @return the AwsRdsEventSubscriptionProperties object itself. + */ + public AwsRdsEventSubscriptionProperties withSubscriptionName(String subscriptionName) { + this.subscriptionName = subscriptionName; + return this; + } + + /** + * Get the tags property: An array of key-value pairs to apply to this resource. + * + * @return the tags value. + */ + public List tags() { + return this.tags; + } + + /** + * Set the tags property: An array of key-value pairs to apply to this resource. + * + * @param tags the tags value to set. + * @return the AwsRdsEventSubscriptionProperties object itself. + */ + public AwsRdsEventSubscriptionProperties withTags(List tags) { + this.tags = tags; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (tags() != null) { + tags().forEach(e -> e.validate()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeBooleanField("enabled", this.enabled); + jsonWriter.writeArrayField("eventCategories", this.eventCategories, + (writer, element) -> writer.writeString(element)); + jsonWriter.writeStringField("snsTopicArn", this.snsTopicArn); + jsonWriter.writeArrayField("sourceIds", this.sourceIds, (writer, element) -> writer.writeString(element)); + jsonWriter.writeStringField("sourceType", this.sourceType); + jsonWriter.writeStringField("subscriptionName", this.subscriptionName); + jsonWriter.writeArrayField("tags", this.tags, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AwsRdsEventSubscriptionProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AwsRdsEventSubscriptionProperties if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the AwsRdsEventSubscriptionProperties. + */ + public static AwsRdsEventSubscriptionProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AwsRdsEventSubscriptionProperties deserializedAwsRdsEventSubscriptionProperties + = new AwsRdsEventSubscriptionProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("enabled".equals(fieldName)) { + deserializedAwsRdsEventSubscriptionProperties.enabled = reader.getNullable(JsonReader::getBoolean); + } else if ("eventCategories".equals(fieldName)) { + List eventCategories = reader.readArray(reader1 -> reader1.getString()); + deserializedAwsRdsEventSubscriptionProperties.eventCategories = eventCategories; + } else if ("snsTopicArn".equals(fieldName)) { + deserializedAwsRdsEventSubscriptionProperties.snsTopicArn = reader.getString(); + } else if ("sourceIds".equals(fieldName)) { + List sourceIds = reader.readArray(reader1 -> reader1.getString()); + deserializedAwsRdsEventSubscriptionProperties.sourceIds = sourceIds; + } else if ("sourceType".equals(fieldName)) { + deserializedAwsRdsEventSubscriptionProperties.sourceType = reader.getString(); + } else if ("subscriptionName".equals(fieldName)) { + deserializedAwsRdsEventSubscriptionProperties.subscriptionName = reader.getString(); + } else if ("tags".equals(fieldName)) { + List tags = reader.readArray(reader1 -> TagAutoGenerated48.fromJson(reader1)); + deserializedAwsRdsEventSubscriptionProperties.tags = tags; + } else { + reader.skipChildren(); + } + } + + return deserializedAwsRdsEventSubscriptionProperties; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/AwsRdsExportTaskProperties.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/AwsRdsExportTaskProperties.java new file mode 100644 index 000000000000..e3dd0ea51536 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/AwsRdsExportTaskProperties.java @@ -0,0 +1,584 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.time.OffsetDateTime; +import java.time.format.DateTimeFormatter; +import java.util.List; + +/** + * Definition of awsRdsExportTask. + */ +@Fluent +public final class AwsRdsExportTaskProperties implements JsonSerializable { + /* + *

The data exported from the snapshot or cluster.

Valid Values:

  • database - + * Export all the data from a specified database.

  • database.table table-name - + * Export a table of the snapshot or cluster. This format is valid only for RDS for MySQL, RDS for MariaDB, and + * Aurora MySQL.

  • database.schema schema-name - Export a database schema of + * the snapshot or cluster. This format is valid only for RDS for PostgreSQL and Aurora PostgreSQL.

  • + *

    database.schema.table table-name - Export a table of the database schema. This format is + * valid only for RDS for PostgreSQL and Aurora PostgreSQL.

+ */ + private List exportOnly; + + /* + *

A unique identifier for the snapshot or cluster export task. This ID isn't an identifier for the Amazon S3 + * bucket where the data is exported.

+ */ + private String exportTaskIdentifier; + + /* + *

The reason the export failed, if it failed.

+ */ + private String failureCause; + + /* + *

The name of the IAM role that is used to write to Amazon S3 when exporting a snapshot or cluster.

+ */ + private String iamRoleArn; + + /* + *

The key identifier of the Amazon Web Services KMS key that is used to encrypt the data when it's exported to + * Amazon S3. The KMS key identifier is its key ARN, key ID, alias ARN, or alias name. The IAM role used for the + * export must have encryption and decryption permissions to use this KMS key.

+ */ + private String kmsKeyId; + + /* + *

The progress of the snapshot or cluster export task as a percentage.

+ */ + private Integer percentProgress; + + /* + *

The Amazon S3 bucket where the snapshot or cluster is exported to.

+ */ + private String s3Bucket; + + /* + *

The Amazon S3 bucket prefix that is the file name and path of the exported data.

+ */ + private String s3Prefix; + + /* + *

The time when the snapshot was created.

+ */ + private OffsetDateTime snapshotTime; + + /* + *

The Amazon Resource Name (ARN) of the snapshot or cluster exported to Amazon S3.

+ */ + private String sourceArn; + + /* + *

The type of source for the export.

+ */ + private ExportSourceTypeEnumValue sourceType; + + /* + *

The progress status of the export task. The status can be one of the following:

  • + * CANCELED

  • CANCELING

  • COMPLETE

    + *
  • FAILED

  • IN_PROGRESS

  • + * STARTING

+ */ + private String status; + + /* + *

The time when the snapshot or cluster export task ended.

+ */ + private OffsetDateTime taskEndTime; + + /* + *

The time when the snapshot or cluster export task started.

+ */ + private OffsetDateTime taskStartTime; + + /* + *

The total amount of data exported, in gigabytes.

+ */ + private Integer totalExtractedDataInGB; + + /* + *

A warning about the snapshot or cluster export task.

+ */ + private String warningMessage; + + /** + * Creates an instance of AwsRdsExportTaskProperties class. + */ + public AwsRdsExportTaskProperties() { + } + + /** + * Get the exportOnly property: <p>The data exported from the snapshot or cluster.</p> <p>Valid + * Values:</p> <ul> <li> <p> <code>database</code> - Export all the data from a + * specified database.</p> </li> <li> <p> <code>database.table</code> + * <i>table-name</i> - Export a table of the snapshot or cluster. This format is valid only for RDS for + * MySQL, RDS for MariaDB, and Aurora MySQL.</p> </li> <li> <p> + * <code>database.schema</code> <i>schema-name</i> - Export a database schema of the + * snapshot or cluster. This format is valid only for RDS for PostgreSQL and Aurora PostgreSQL.</p> + * </li> <li> <p> <code>database.schema.table</code> <i>table-name</i> - + * Export a table of the database schema. This format is valid only for RDS for PostgreSQL and Aurora + * PostgreSQL.</p> </li> </ul>. + * + * @return the exportOnly value. + */ + public List exportOnly() { + return this.exportOnly; + } + + /** + * Set the exportOnly property: <p>The data exported from the snapshot or cluster.</p> <p>Valid + * Values:</p> <ul> <li> <p> <code>database</code> - Export all the data from a + * specified database.</p> </li> <li> <p> <code>database.table</code> + * <i>table-name</i> - Export a table of the snapshot or cluster. This format is valid only for RDS for + * MySQL, RDS for MariaDB, and Aurora MySQL.</p> </li> <li> <p> + * <code>database.schema</code> <i>schema-name</i> - Export a database schema of the + * snapshot or cluster. This format is valid only for RDS for PostgreSQL and Aurora PostgreSQL.</p> + * </li> <li> <p> <code>database.schema.table</code> <i>table-name</i> - + * Export a table of the database schema. This format is valid only for RDS for PostgreSQL and Aurora + * PostgreSQL.</p> </li> </ul>. + * + * @param exportOnly the exportOnly value to set. + * @return the AwsRdsExportTaskProperties object itself. + */ + public AwsRdsExportTaskProperties withExportOnly(List exportOnly) { + this.exportOnly = exportOnly; + return this; + } + + /** + * Get the exportTaskIdentifier property: <p>A unique identifier for the snapshot or cluster export task. This + * ID isn't an identifier for the Amazon S3 bucket where the data is exported.</p>. + * + * @return the exportTaskIdentifier value. + */ + public String exportTaskIdentifier() { + return this.exportTaskIdentifier; + } + + /** + * Set the exportTaskIdentifier property: <p>A unique identifier for the snapshot or cluster export task. This + * ID isn't an identifier for the Amazon S3 bucket where the data is exported.</p>. + * + * @param exportTaskIdentifier the exportTaskIdentifier value to set. + * @return the AwsRdsExportTaskProperties object itself. + */ + public AwsRdsExportTaskProperties withExportTaskIdentifier(String exportTaskIdentifier) { + this.exportTaskIdentifier = exportTaskIdentifier; + return this; + } + + /** + * Get the failureCause property: <p>The reason the export failed, if it failed.</p>. + * + * @return the failureCause value. + */ + public String failureCause() { + return this.failureCause; + } + + /** + * Set the failureCause property: <p>The reason the export failed, if it failed.</p>. + * + * @param failureCause the failureCause value to set. + * @return the AwsRdsExportTaskProperties object itself. + */ + public AwsRdsExportTaskProperties withFailureCause(String failureCause) { + this.failureCause = failureCause; + return this; + } + + /** + * Get the iamRoleArn property: <p>The name of the IAM role that is used to write to Amazon S3 when exporting + * a snapshot or cluster.</p>. + * + * @return the iamRoleArn value. + */ + public String iamRoleArn() { + return this.iamRoleArn; + } + + /** + * Set the iamRoleArn property: <p>The name of the IAM role that is used to write to Amazon S3 when exporting + * a snapshot or cluster.</p>. + * + * @param iamRoleArn the iamRoleArn value to set. + * @return the AwsRdsExportTaskProperties object itself. + */ + public AwsRdsExportTaskProperties withIamRoleArn(String iamRoleArn) { + this.iamRoleArn = iamRoleArn; + return this; + } + + /** + * Get the kmsKeyId property: <p>The key identifier of the Amazon Web Services KMS key that is used to encrypt + * the data when it's exported to Amazon S3. The KMS key identifier is its key ARN, key ID, alias ARN, or alias + * name. The IAM role used for the export must have encryption and decryption permissions to use this KMS + * key.</p>. + * + * @return the kmsKeyId value. + */ + public String kmsKeyId() { + return this.kmsKeyId; + } + + /** + * Set the kmsKeyId property: <p>The key identifier of the Amazon Web Services KMS key that is used to encrypt + * the data when it's exported to Amazon S3. The KMS key identifier is its key ARN, key ID, alias ARN, or alias + * name. The IAM role used for the export must have encryption and decryption permissions to use this KMS + * key.</p>. + * + * @param kmsKeyId the kmsKeyId value to set. + * @return the AwsRdsExportTaskProperties object itself. + */ + public AwsRdsExportTaskProperties withKmsKeyId(String kmsKeyId) { + this.kmsKeyId = kmsKeyId; + return this; + } + + /** + * Get the percentProgress property: <p>The progress of the snapshot or cluster export task as a + * percentage.</p>. + * + * @return the percentProgress value. + */ + public Integer percentProgress() { + return this.percentProgress; + } + + /** + * Set the percentProgress property: <p>The progress of the snapshot or cluster export task as a + * percentage.</p>. + * + * @param percentProgress the percentProgress value to set. + * @return the AwsRdsExportTaskProperties object itself. + */ + public AwsRdsExportTaskProperties withPercentProgress(Integer percentProgress) { + this.percentProgress = percentProgress; + return this; + } + + /** + * Get the s3Bucket property: <p>The Amazon S3 bucket where the snapshot or cluster is exported to.</p>. + * + * @return the s3Bucket value. + */ + public String s3Bucket() { + return this.s3Bucket; + } + + /** + * Set the s3Bucket property: <p>The Amazon S3 bucket where the snapshot or cluster is exported to.</p>. + * + * @param s3Bucket the s3Bucket value to set. + * @return the AwsRdsExportTaskProperties object itself. + */ + public AwsRdsExportTaskProperties withS3Bucket(String s3Bucket) { + this.s3Bucket = s3Bucket; + return this; + } + + /** + * Get the s3Prefix property: <p>The Amazon S3 bucket prefix that is the file name and path of the exported + * data.</p>. + * + * @return the s3Prefix value. + */ + public String s3Prefix() { + return this.s3Prefix; + } + + /** + * Set the s3Prefix property: <p>The Amazon S3 bucket prefix that is the file name and path of the exported + * data.</p>. + * + * @param s3Prefix the s3Prefix value to set. + * @return the AwsRdsExportTaskProperties object itself. + */ + public AwsRdsExportTaskProperties withS3Prefix(String s3Prefix) { + this.s3Prefix = s3Prefix; + return this; + } + + /** + * Get the snapshotTime property: <p>The time when the snapshot was created.</p>. + * + * @return the snapshotTime value. + */ + public OffsetDateTime snapshotTime() { + return this.snapshotTime; + } + + /** + * Set the snapshotTime property: <p>The time when the snapshot was created.</p>. + * + * @param snapshotTime the snapshotTime value to set. + * @return the AwsRdsExportTaskProperties object itself. + */ + public AwsRdsExportTaskProperties withSnapshotTime(OffsetDateTime snapshotTime) { + this.snapshotTime = snapshotTime; + return this; + } + + /** + * Get the sourceArn property: <p>The Amazon Resource Name (ARN) of the snapshot or cluster exported to Amazon + * S3.</p>. + * + * @return the sourceArn value. + */ + public String sourceArn() { + return this.sourceArn; + } + + /** + * Set the sourceArn property: <p>The Amazon Resource Name (ARN) of the snapshot or cluster exported to Amazon + * S3.</p>. + * + * @param sourceArn the sourceArn value to set. + * @return the AwsRdsExportTaskProperties object itself. + */ + public AwsRdsExportTaskProperties withSourceArn(String sourceArn) { + this.sourceArn = sourceArn; + return this; + } + + /** + * Get the sourceType property: <p>The type of source for the export.</p>. + * + * @return the sourceType value. + */ + public ExportSourceTypeEnumValue sourceType() { + return this.sourceType; + } + + /** + * Set the sourceType property: <p>The type of source for the export.</p>. + * + * @param sourceType the sourceType value to set. + * @return the AwsRdsExportTaskProperties object itself. + */ + public AwsRdsExportTaskProperties withSourceType(ExportSourceTypeEnumValue sourceType) { + this.sourceType = sourceType; + return this; + } + + /** + * Get the status property: <p>The progress status of the export task. The status can be one of the + * following:</p> <ul> <li> <p> <code>CANCELED</code> </p> </li> + * <li> <p> <code>CANCELING</code> </p> </li> <li> <p> + * <code>COMPLETE</code> </p> </li> <li> <p> <code>FAILED</code> + * </p> </li> <li> <p> <code>IN_PROGRESS</code> </p> </li> + * <li> <p> <code>STARTING</code> </p> </li> </ul>. + * + * @return the status value. + */ + public String status() { + return this.status; + } + + /** + * Set the status property: <p>The progress status of the export task. The status can be one of the + * following:</p> <ul> <li> <p> <code>CANCELED</code> </p> </li> + * <li> <p> <code>CANCELING</code> </p> </li> <li> <p> + * <code>COMPLETE</code> </p> </li> <li> <p> <code>FAILED</code> + * </p> </li> <li> <p> <code>IN_PROGRESS</code> </p> </li> + * <li> <p> <code>STARTING</code> </p> </li> </ul>. + * + * @param status the status value to set. + * @return the AwsRdsExportTaskProperties object itself. + */ + public AwsRdsExportTaskProperties withStatus(String status) { + this.status = status; + return this; + } + + /** + * Get the taskEndTime property: <p>The time when the snapshot or cluster export task ended.</p>. + * + * @return the taskEndTime value. + */ + public OffsetDateTime taskEndTime() { + return this.taskEndTime; + } + + /** + * Set the taskEndTime property: <p>The time when the snapshot or cluster export task ended.</p>. + * + * @param taskEndTime the taskEndTime value to set. + * @return the AwsRdsExportTaskProperties object itself. + */ + public AwsRdsExportTaskProperties withTaskEndTime(OffsetDateTime taskEndTime) { + this.taskEndTime = taskEndTime; + return this; + } + + /** + * Get the taskStartTime property: <p>The time when the snapshot or cluster export task started.</p>. + * + * @return the taskStartTime value. + */ + public OffsetDateTime taskStartTime() { + return this.taskStartTime; + } + + /** + * Set the taskStartTime property: <p>The time when the snapshot or cluster export task started.</p>. + * + * @param taskStartTime the taskStartTime value to set. + * @return the AwsRdsExportTaskProperties object itself. + */ + public AwsRdsExportTaskProperties withTaskStartTime(OffsetDateTime taskStartTime) { + this.taskStartTime = taskStartTime; + return this; + } + + /** + * Get the totalExtractedDataInGB property: <p>The total amount of data exported, in gigabytes.</p>. + * + * @return the totalExtractedDataInGB value. + */ + public Integer totalExtractedDataInGB() { + return this.totalExtractedDataInGB; + } + + /** + * Set the totalExtractedDataInGB property: <p>The total amount of data exported, in gigabytes.</p>. + * + * @param totalExtractedDataInGB the totalExtractedDataInGB value to set. + * @return the AwsRdsExportTaskProperties object itself. + */ + public AwsRdsExportTaskProperties withTotalExtractedDataInGB(Integer totalExtractedDataInGB) { + this.totalExtractedDataInGB = totalExtractedDataInGB; + return this; + } + + /** + * Get the warningMessage property: <p>A warning about the snapshot or cluster export task.</p>. + * + * @return the warningMessage value. + */ + public String warningMessage() { + return this.warningMessage; + } + + /** + * Set the warningMessage property: <p>A warning about the snapshot or cluster export task.</p>. + * + * @param warningMessage the warningMessage value to set. + * @return the AwsRdsExportTaskProperties object itself. + */ + public AwsRdsExportTaskProperties withWarningMessage(String warningMessage) { + this.warningMessage = warningMessage; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (sourceType() != null) { + sourceType().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("exportOnly", this.exportOnly, (writer, element) -> writer.writeString(element)); + jsonWriter.writeStringField("exportTaskIdentifier", this.exportTaskIdentifier); + jsonWriter.writeStringField("failureCause", this.failureCause); + jsonWriter.writeStringField("iamRoleArn", this.iamRoleArn); + jsonWriter.writeStringField("kmsKeyId", this.kmsKeyId); + jsonWriter.writeNumberField("percentProgress", this.percentProgress); + jsonWriter.writeStringField("s3Bucket", this.s3Bucket); + jsonWriter.writeStringField("s3Prefix", this.s3Prefix); + jsonWriter.writeStringField("snapshotTime", + this.snapshotTime == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.snapshotTime)); + jsonWriter.writeStringField("sourceArn", this.sourceArn); + jsonWriter.writeJsonField("sourceType", this.sourceType); + jsonWriter.writeStringField("status", this.status); + jsonWriter.writeStringField("taskEndTime", + this.taskEndTime == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.taskEndTime)); + jsonWriter.writeStringField("taskStartTime", + this.taskStartTime == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.taskStartTime)); + jsonWriter.writeNumberField("totalExtractedDataInGB", this.totalExtractedDataInGB); + jsonWriter.writeStringField("warningMessage", this.warningMessage); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AwsRdsExportTaskProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AwsRdsExportTaskProperties if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IOException If an error occurs while reading the AwsRdsExportTaskProperties. + */ + public static AwsRdsExportTaskProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AwsRdsExportTaskProperties deserializedAwsRdsExportTaskProperties = new AwsRdsExportTaskProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("exportOnly".equals(fieldName)) { + List exportOnly = reader.readArray(reader1 -> reader1.getString()); + deserializedAwsRdsExportTaskProperties.exportOnly = exportOnly; + } else if ("exportTaskIdentifier".equals(fieldName)) { + deserializedAwsRdsExportTaskProperties.exportTaskIdentifier = reader.getString(); + } else if ("failureCause".equals(fieldName)) { + deserializedAwsRdsExportTaskProperties.failureCause = reader.getString(); + } else if ("iamRoleArn".equals(fieldName)) { + deserializedAwsRdsExportTaskProperties.iamRoleArn = reader.getString(); + } else if ("kmsKeyId".equals(fieldName)) { + deserializedAwsRdsExportTaskProperties.kmsKeyId = reader.getString(); + } else if ("percentProgress".equals(fieldName)) { + deserializedAwsRdsExportTaskProperties.percentProgress = reader.getNullable(JsonReader::getInt); + } else if ("s3Bucket".equals(fieldName)) { + deserializedAwsRdsExportTaskProperties.s3Bucket = reader.getString(); + } else if ("s3Prefix".equals(fieldName)) { + deserializedAwsRdsExportTaskProperties.s3Prefix = reader.getString(); + } else if ("snapshotTime".equals(fieldName)) { + deserializedAwsRdsExportTaskProperties.snapshotTime = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("sourceArn".equals(fieldName)) { + deserializedAwsRdsExportTaskProperties.sourceArn = reader.getString(); + } else if ("sourceType".equals(fieldName)) { + deserializedAwsRdsExportTaskProperties.sourceType = ExportSourceTypeEnumValue.fromJson(reader); + } else if ("status".equals(fieldName)) { + deserializedAwsRdsExportTaskProperties.status = reader.getString(); + } else if ("taskEndTime".equals(fieldName)) { + deserializedAwsRdsExportTaskProperties.taskEndTime = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("taskStartTime".equals(fieldName)) { + deserializedAwsRdsExportTaskProperties.taskStartTime = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("totalExtractedDataInGB".equals(fieldName)) { + deserializedAwsRdsExportTaskProperties.totalExtractedDataInGB + = reader.getNullable(JsonReader::getInt); + } else if ("warningMessage".equals(fieldName)) { + deserializedAwsRdsExportTaskProperties.warningMessage = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedAwsRdsExportTaskProperties; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/AwsRedshiftClusterParameterGroupProperties.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/AwsRedshiftClusterParameterGroupProperties.java new file mode 100644 index 000000000000..cb6967eeaf21 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/AwsRedshiftClusterParameterGroupProperties.java @@ -0,0 +1,222 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Definition of awsRedshiftClusterParameterGroup. + */ +@Fluent +public final class AwsRedshiftClusterParameterGroupProperties + implements JsonSerializable { + /* + * A description of the parameter group. + */ + private String description; + + /* + * The Amazon Redshift engine version to which the cluster parameter group applies. The cluster engine version + * determines the set of parameters. + */ + private String parameterGroupFamily; + + /* + * The name of the cluster parameter group. + */ + private String parameterGroupName; + + /* + * An array of parameters to be modified. A maximum of 20 parameters can be modified in a single request. + */ + private List parameters; + + /* + * An array of key-value pairs to apply to this resource. + */ + private List tags; + + /** + * Creates an instance of AwsRedshiftClusterParameterGroupProperties class. + */ + public AwsRedshiftClusterParameterGroupProperties() { + } + + /** + * Get the description property: A description of the parameter group. + * + * @return the description value. + */ + public String description() { + return this.description; + } + + /** + * Set the description property: A description of the parameter group. + * + * @param description the description value to set. + * @return the AwsRedshiftClusterParameterGroupProperties object itself. + */ + public AwsRedshiftClusterParameterGroupProperties withDescription(String description) { + this.description = description; + return this; + } + + /** + * Get the parameterGroupFamily property: The Amazon Redshift engine version to which the cluster parameter group + * applies. The cluster engine version determines the set of parameters. + * + * @return the parameterGroupFamily value. + */ + public String parameterGroupFamily() { + return this.parameterGroupFamily; + } + + /** + * Set the parameterGroupFamily property: The Amazon Redshift engine version to which the cluster parameter group + * applies. The cluster engine version determines the set of parameters. + * + * @param parameterGroupFamily the parameterGroupFamily value to set. + * @return the AwsRedshiftClusterParameterGroupProperties object itself. + */ + public AwsRedshiftClusterParameterGroupProperties withParameterGroupFamily(String parameterGroupFamily) { + this.parameterGroupFamily = parameterGroupFamily; + return this; + } + + /** + * Get the parameterGroupName property: The name of the cluster parameter group. + * + * @return the parameterGroupName value. + */ + public String parameterGroupName() { + return this.parameterGroupName; + } + + /** + * Set the parameterGroupName property: The name of the cluster parameter group. + * + * @param parameterGroupName the parameterGroupName value to set. + * @return the AwsRedshiftClusterParameterGroupProperties object itself. + */ + public AwsRedshiftClusterParameterGroupProperties withParameterGroupName(String parameterGroupName) { + this.parameterGroupName = parameterGroupName; + return this; + } + + /** + * Get the parameters property: An array of parameters to be modified. A maximum of 20 parameters can be modified in + * a single request. + * + * @return the parameters value. + */ + public List parameters() { + return this.parameters; + } + + /** + * Set the parameters property: An array of parameters to be modified. A maximum of 20 parameters can be modified in + * a single request. + * + * @param parameters the parameters value to set. + * @return the AwsRedshiftClusterParameterGroupProperties object itself. + */ + public AwsRedshiftClusterParameterGroupProperties withParameters(List parameters) { + this.parameters = parameters; + return this; + } + + /** + * Get the tags property: An array of key-value pairs to apply to this resource. + * + * @return the tags value. + */ + public List tags() { + return this.tags; + } + + /** + * Set the tags property: An array of key-value pairs to apply to this resource. + * + * @param tags the tags value to set. + * @return the AwsRedshiftClusterParameterGroupProperties object itself. + */ + public AwsRedshiftClusterParameterGroupProperties withTags(List tags) { + this.tags = tags; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (parameters() != null) { + parameters().forEach(e -> e.validate()); + } + if (tags() != null) { + tags().forEach(e -> e.validate()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("description", this.description); + jsonWriter.writeStringField("parameterGroupFamily", this.parameterGroupFamily); + jsonWriter.writeStringField("parameterGroupName", this.parameterGroupName); + jsonWriter.writeArrayField("parameters", this.parameters, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("tags", this.tags, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AwsRedshiftClusterParameterGroupProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AwsRedshiftClusterParameterGroupProperties if the JsonReader was pointing to an instance + * of it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the AwsRedshiftClusterParameterGroupProperties. + */ + public static AwsRedshiftClusterParameterGroupProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AwsRedshiftClusterParameterGroupProperties deserializedAwsRedshiftClusterParameterGroupProperties + = new AwsRedshiftClusterParameterGroupProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("description".equals(fieldName)) { + deserializedAwsRedshiftClusterParameterGroupProperties.description = reader.getString(); + } else if ("parameterGroupFamily".equals(fieldName)) { + deserializedAwsRedshiftClusterParameterGroupProperties.parameterGroupFamily = reader.getString(); + } else if ("parameterGroupName".equals(fieldName)) { + deserializedAwsRedshiftClusterParameterGroupProperties.parameterGroupName = reader.getString(); + } else if ("parameters".equals(fieldName)) { + List parameters + = reader.readArray(reader1 -> ParameterAutoGenerated.fromJson(reader1)); + deserializedAwsRedshiftClusterParameterGroupProperties.parameters = parameters; + } else if ("tags".equals(fieldName)) { + List tags = reader.readArray(reader1 -> TagAutoGenerated49.fromJson(reader1)); + deserializedAwsRedshiftClusterParameterGroupProperties.tags = tags; + } else { + reader.skipChildren(); + } + } + + return deserializedAwsRedshiftClusterParameterGroupProperties; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/AwsRedshiftClusterProperties.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/AwsRedshiftClusterProperties.java new file mode 100644 index 000000000000..03bd1dc87eb9 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/AwsRedshiftClusterProperties.java @@ -0,0 +1,1795 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Definition of awsRedshiftCluster. + */ +@Fluent +public final class AwsRedshiftClusterProperties implements JsonSerializable { + /* + * Major version upgrades can be applied during the maintenance window to the Amazon Redshift engine that is running + * on the cluster. Default value is True + */ + private Boolean allowVersionUpgrade; + + /* + * The value represents how the cluster is configured to use AQUA (Advanced Query Accelerator) after the cluster is + * restored. Possible values include the following.enabled - Use AQUA if it is available for the current Region and + * Amazon Redshift node type.disabled - Don't use AQUA.auto - Amazon Redshift determines whether to use AQUA. + */ + private String aquaConfigurationStatus; + + /* + * The number of days that automated snapshots are retained. If the value is 0, automated snapshots are disabled. + * Default value is 1 + */ + private Integer automatedSnapshotRetentionPeriod; + + /* + * The EC2 Availability Zone (AZ) in which you want Amazon Redshift to provision the cluster. Default: A random, + * system-chosen Availability Zone in the region that is specified by the endpoint + */ + private String availabilityZone; + + /* + * The option to enable relocation for an Amazon Redshift cluster between Availability Zones after the cluster + * modification is complete. + */ + private Boolean availabilityZoneRelocation; + + /* + * The availability zone relocation status of the cluster + */ + private String availabilityZoneRelocationStatus; + + /* + * A boolean value indicating whether the resize operation is using the classic resize process. If you don't provide + * this parameter or set the value to false , the resize type is elastic. + */ + private Boolean classic; + + /* + * A unique identifier for the cluster. You use this identifier to refer to the cluster for any subsequent cluster + * operations such as deleting or modifying. All alphabetical characters must be lower case, no hypens at the end, + * no two consecutive hyphens. Cluster name should be unique for all clusters within an AWS account + */ + private String clusterIdentifier; + + /* + * The Amazon Resource Name (ARN) of the cluster namespace. + */ + private String clusterNamespaceArn; + + /* + * The name of the parameter group to be associated with this cluster. + */ + private String clusterParameterGroupName; + + /* + * A list of security groups to be associated with this cluster. + */ + private List clusterSecurityGroups; + + /* + * The name of a cluster subnet group to be associated with this cluster. + */ + private String clusterSubnetGroupName; + + /* + * The type of the cluster. When cluster type is specified as single-node, the NumberOfNodes parameter is not + * required and if multi-node, the NumberOfNodes parameter is required + */ + private String clusterType; + + /* + * The version of the Amazon Redshift engine software that you want to deploy on the cluster.The version selected + * runs on all the nodes in the cluster. + */ + private String clusterVersion; + + /* + * The name of the first database to be created when the cluster is created. To create additional databases after + * the cluster is created, connect to the cluster with a SQL client and use SQL commands to create a database. + */ + private String dbName; + + /* + * A boolean indicating whether to enable the deferred maintenance window. + */ + private Boolean deferMaintenance; + + /* + * An integer indicating the duration of the maintenance window in days. If you specify a duration, you can't + * specify an end time. The duration must be 45 days or less. + */ + private Integer deferMaintenanceDuration; + + /* + * A timestamp indicating end time for the deferred maintenance window. If you specify an end time, you can't + * specify a duration. + */ + private String deferMaintenanceEndTime; + + /* + * A unique identifier for the deferred maintenance window. + */ + private String deferMaintenanceIdentifier; + + /* + * A timestamp indicating the start time for the deferred maintenance window. + */ + private String deferMaintenanceStartTime; + + /* + * The destination AWS Region that you want to copy snapshots to. Constraints: Must be the name of a valid AWS + * Region. For more information, see Regions and Endpoints in the Amazon Web Services + * [https://docs.aws.amazon.com/general/latest/gr/rande.html#redshift_region] General Reference + */ + private String destinationRegion; + + /* + * The Elastic IP (EIP) address for the cluster. + */ + private String elasticIp; + + /* + * If true, the data in the cluster is encrypted at rest. + */ + private Boolean encrypted; + + /* + * Property endpoint + */ + private EndpointAutoGenerated3 endpoint; + + /* + * An option that specifies whether to create the cluster with enhanced VPC routing enabled. To create a cluster + * that uses enhanced VPC routing, the cluster must be in a VPC. For more information, see Enhanced VPC Routing in + * the Amazon Redshift Cluster Management Guide.If this option is true , enhanced VPC routing is enabled.Default: + * false + */ + private Boolean enhancedVpcRouting; + + /* + * Specifies the name of the HSM client certificate the Amazon Redshift cluster uses to retrieve the data encryption + * keys stored in an HSM + */ + private String hsmClientCertificateIdentifier; + + /* + * Specifies the name of the HSM configuration that contains the information the Amazon Redshift cluster can use to + * retrieve and store keys in an HSM. + */ + private String hsmConfigurationIdentifier; + + /* + * A list of AWS Identity and Access Management (IAM) roles that can be used by the cluster to access other AWS + * services. You must supply the IAM roles in their Amazon Resource Name (ARN) format. You can supply up to 50 IAM + * roles in a single request + */ + private List iamRoles; + + /* + * The AWS Key Management Service (KMS) key ID of the encryption key that you want to use to encrypt data in the + * cluster. + */ + private String kmsKeyId; + + /* + * Property loggingProperties + */ + private LoggingProperties loggingProperties; + + /* + * The name for the maintenance track that you want to assign for the cluster. This name change is asynchronous. The + * new track name stays in the PendingModifiedValues for the cluster until the next maintenance window. When the + * maintenance track changes, the cluster is switched to the latest cluster release available for the maintenance + * track. At this point, the maintenance track name is applied. + */ + private String maintenanceTrackName; + + /* + * A boolean indicating if the redshift cluster's admin user credentials is managed by Redshift or not. You can't + * use MasterUserPassword if ManageMasterPassword is true. If ManageMasterPassword is false or not set, Amazon + * Redshift uses MasterUserPassword for the admin user account's password. + */ + private Boolean manageMasterPassword; + + /* + * The number of days to retain newly copied snapshots in the destination AWS Region after they are copied from the + * source AWS Region. If the value is -1, the manual snapshot is retained indefinitely.The value must be either -1 + * or an integer between 1 and 3,653. + */ + private Integer manualSnapshotRetentionPeriod; + + /* + * The Amazon Resource Name (ARN) for the cluster's admin user credentials secret. + */ + private String masterPasswordSecretArn; + + /* + * The ID of the Key Management Service (KMS) key used to encrypt and store the cluster's admin user credentials + * secret. + */ + private String masterPasswordSecretKmsKeyId; + + /* + * The password associated with the master user account for the cluster that is being created. You can't use + * MasterUserPassword if ManageMasterPassword is true. Password must be between 8 and 64 characters in length, + * should have at least one uppercase letter.Must contain at least one lowercase letter.Must contain one number.Can + * be any printable ASCII character. + */ + private String masterUserPassword; + + /* + * The user name associated with the master user account for the cluster that is being created. The user name can't + * be PUBLIC and first character must be a letter. + */ + private String masterUsername; + + /* + * A boolean indicating if the redshift cluster is multi-az or not. If you don't provide this parameter or set the + * value to false, the redshift cluster will be single-az. + */ + private Boolean multiAZ; + + /* + * The namespace resource policy document that will be attached to a Redshift cluster. + */ + private Object namespaceResourcePolicy; + + /* + * The node type to be provisioned for the cluster.Valid Values: ds2.xlarge | ds2.8xlarge | dc1.large | dc1.8xlarge + * | dc2.large | dc2.8xlarge | ra3.4xlarge | ra3.16xlarge + */ + private String nodeType; + + /* + * The number of compute nodes in the cluster. This parameter is required when the ClusterType parameter is + * specified as multi-node. + */ + private Integer numberOfNodes; + + /* + * Property ownerAccount + */ + private String ownerAccount; + + /* + * The port number on which the cluster accepts incoming connections. The cluster is accessible only via the JDBC + * and ODBC connection strings + */ + private Integer port; + + /* + * The weekly time range (in UTC) during which automated cluster maintenance can occur. + */ + private String preferredMaintenanceWindow; + + /* + * If true, the cluster can be accessed from a public network. + */ + private Boolean publiclyAccessible; + + /* + * The Redshift operation to be performed. Resource Action supports pause-cluster, resume-cluster, + * failover-primary-compute APIs + */ + private String resourceAction; + + /* + * The identifier of the database revision. You can retrieve this value from the response to the + * DescribeClusterDbRevisions request. + */ + private String revisionTarget; + + /* + * A boolean indicating if we want to rotate Encryption Keys. + */ + private Boolean rotateEncryptionKey; + + /* + * The name of the cluster the source snapshot was created from. This parameter is required if your IAM user has a + * policy containing a snapshot resource element that specifies anything other than * for the cluster name. + */ + private String snapshotClusterIdentifier; + + /* + * The name of the snapshot copy grant to use when snapshots of an AWS KMS-encrypted cluster are copied to the + * destination region. + */ + private String snapshotCopyGrantName; + + /* + * Indicates whether to apply the snapshot retention period to newly copied manual snapshots instead of automated + * snapshots. + */ + private Boolean snapshotCopyManual; + + /* + * The number of days to retain automated snapshots in the destination region after they are copied from the source + * region. Default is 7. Constraints: Must be at least 1 and no more than 35. + */ + private Integer snapshotCopyRetentionPeriod; + + /* + * The name of the snapshot from which to create the new cluster. This parameter isn't case sensitive. + */ + private String snapshotIdentifier; + + /* + * The list of tags for the cluster parameter group. + */ + private List tags; + + /* + * A list of Virtual Private Cloud (VPC) security groups to be associated with the cluster. + */ + private List vpcSecurityGroupIds; + + /** + * Creates an instance of AwsRedshiftClusterProperties class. + */ + public AwsRedshiftClusterProperties() { + } + + /** + * Get the allowVersionUpgrade property: Major version upgrades can be applied during the maintenance window to the + * Amazon Redshift engine that is running on the cluster. Default value is True. + * + * @return the allowVersionUpgrade value. + */ + public Boolean allowVersionUpgrade() { + return this.allowVersionUpgrade; + } + + /** + * Set the allowVersionUpgrade property: Major version upgrades can be applied during the maintenance window to the + * Amazon Redshift engine that is running on the cluster. Default value is True. + * + * @param allowVersionUpgrade the allowVersionUpgrade value to set. + * @return the AwsRedshiftClusterProperties object itself. + */ + public AwsRedshiftClusterProperties withAllowVersionUpgrade(Boolean allowVersionUpgrade) { + this.allowVersionUpgrade = allowVersionUpgrade; + return this; + } + + /** + * Get the aquaConfigurationStatus property: The value represents how the cluster is configured to use AQUA + * (Advanced Query Accelerator) after the cluster is restored. Possible values include the following.enabled - Use + * AQUA if it is available for the current Region and Amazon Redshift node type.disabled - Don't use AQUA.auto - + * Amazon Redshift determines whether to use AQUA. + * + * @return the aquaConfigurationStatus value. + */ + public String aquaConfigurationStatus() { + return this.aquaConfigurationStatus; + } + + /** + * Set the aquaConfigurationStatus property: The value represents how the cluster is configured to use AQUA + * (Advanced Query Accelerator) after the cluster is restored. Possible values include the following.enabled - Use + * AQUA if it is available for the current Region and Amazon Redshift node type.disabled - Don't use AQUA.auto - + * Amazon Redshift determines whether to use AQUA. + * + * @param aquaConfigurationStatus the aquaConfigurationStatus value to set. + * @return the AwsRedshiftClusterProperties object itself. + */ + public AwsRedshiftClusterProperties withAquaConfigurationStatus(String aquaConfigurationStatus) { + this.aquaConfigurationStatus = aquaConfigurationStatus; + return this; + } + + /** + * Get the automatedSnapshotRetentionPeriod property: The number of days that automated snapshots are retained. If + * the value is 0, automated snapshots are disabled. Default value is 1. + * + * @return the automatedSnapshotRetentionPeriod value. + */ + public Integer automatedSnapshotRetentionPeriod() { + return this.automatedSnapshotRetentionPeriod; + } + + /** + * Set the automatedSnapshotRetentionPeriod property: The number of days that automated snapshots are retained. If + * the value is 0, automated snapshots are disabled. Default value is 1. + * + * @param automatedSnapshotRetentionPeriod the automatedSnapshotRetentionPeriod value to set. + * @return the AwsRedshiftClusterProperties object itself. + */ + public AwsRedshiftClusterProperties withAutomatedSnapshotRetentionPeriod(Integer automatedSnapshotRetentionPeriod) { + this.automatedSnapshotRetentionPeriod = automatedSnapshotRetentionPeriod; + return this; + } + + /** + * Get the availabilityZone property: The EC2 Availability Zone (AZ) in which you want Amazon Redshift to provision + * the cluster. Default: A random, system-chosen Availability Zone in the region that is specified by the endpoint. + * + * @return the availabilityZone value. + */ + public String availabilityZone() { + return this.availabilityZone; + } + + /** + * Set the availabilityZone property: The EC2 Availability Zone (AZ) in which you want Amazon Redshift to provision + * the cluster. Default: A random, system-chosen Availability Zone in the region that is specified by the endpoint. + * + * @param availabilityZone the availabilityZone value to set. + * @return the AwsRedshiftClusterProperties object itself. + */ + public AwsRedshiftClusterProperties withAvailabilityZone(String availabilityZone) { + this.availabilityZone = availabilityZone; + return this; + } + + /** + * Get the availabilityZoneRelocation property: The option to enable relocation for an Amazon Redshift cluster + * between Availability Zones after the cluster modification is complete. + * + * @return the availabilityZoneRelocation value. + */ + public Boolean availabilityZoneRelocation() { + return this.availabilityZoneRelocation; + } + + /** + * Set the availabilityZoneRelocation property: The option to enable relocation for an Amazon Redshift cluster + * between Availability Zones after the cluster modification is complete. + * + * @param availabilityZoneRelocation the availabilityZoneRelocation value to set. + * @return the AwsRedshiftClusterProperties object itself. + */ + public AwsRedshiftClusterProperties withAvailabilityZoneRelocation(Boolean availabilityZoneRelocation) { + this.availabilityZoneRelocation = availabilityZoneRelocation; + return this; + } + + /** + * Get the availabilityZoneRelocationStatus property: The availability zone relocation status of the cluster. + * + * @return the availabilityZoneRelocationStatus value. + */ + public String availabilityZoneRelocationStatus() { + return this.availabilityZoneRelocationStatus; + } + + /** + * Set the availabilityZoneRelocationStatus property: The availability zone relocation status of the cluster. + * + * @param availabilityZoneRelocationStatus the availabilityZoneRelocationStatus value to set. + * @return the AwsRedshiftClusterProperties object itself. + */ + public AwsRedshiftClusterProperties withAvailabilityZoneRelocationStatus(String availabilityZoneRelocationStatus) { + this.availabilityZoneRelocationStatus = availabilityZoneRelocationStatus; + return this; + } + + /** + * Get the classic property: A boolean value indicating whether the resize operation is using the classic resize + * process. If you don't provide this parameter or set the value to false , the resize type is elastic. + * + * @return the classic value. + */ + public Boolean classic() { + return this.classic; + } + + /** + * Set the classic property: A boolean value indicating whether the resize operation is using the classic resize + * process. If you don't provide this parameter or set the value to false , the resize type is elastic. + * + * @param classic the classic value to set. + * @return the AwsRedshiftClusterProperties object itself. + */ + public AwsRedshiftClusterProperties withClassic(Boolean classic) { + this.classic = classic; + return this; + } + + /** + * Get the clusterIdentifier property: A unique identifier for the cluster. You use this identifier to refer to the + * cluster for any subsequent cluster operations such as deleting or modifying. All alphabetical characters must be + * lower case, no hypens at the end, no two consecutive hyphens. Cluster name should be unique for all clusters + * within an AWS account. + * + * @return the clusterIdentifier value. + */ + public String clusterIdentifier() { + return this.clusterIdentifier; + } + + /** + * Set the clusterIdentifier property: A unique identifier for the cluster. You use this identifier to refer to the + * cluster for any subsequent cluster operations such as deleting or modifying. All alphabetical characters must be + * lower case, no hypens at the end, no two consecutive hyphens. Cluster name should be unique for all clusters + * within an AWS account. + * + * @param clusterIdentifier the clusterIdentifier value to set. + * @return the AwsRedshiftClusterProperties object itself. + */ + public AwsRedshiftClusterProperties withClusterIdentifier(String clusterIdentifier) { + this.clusterIdentifier = clusterIdentifier; + return this; + } + + /** + * Get the clusterNamespaceArn property: The Amazon Resource Name (ARN) of the cluster namespace. + * + * @return the clusterNamespaceArn value. + */ + public String clusterNamespaceArn() { + return this.clusterNamespaceArn; + } + + /** + * Set the clusterNamespaceArn property: The Amazon Resource Name (ARN) of the cluster namespace. + * + * @param clusterNamespaceArn the clusterNamespaceArn value to set. + * @return the AwsRedshiftClusterProperties object itself. + */ + public AwsRedshiftClusterProperties withClusterNamespaceArn(String clusterNamespaceArn) { + this.clusterNamespaceArn = clusterNamespaceArn; + return this; + } + + /** + * Get the clusterParameterGroupName property: The name of the parameter group to be associated with this cluster. + * + * @return the clusterParameterGroupName value. + */ + public String clusterParameterGroupName() { + return this.clusterParameterGroupName; + } + + /** + * Set the clusterParameterGroupName property: The name of the parameter group to be associated with this cluster. + * + * @param clusterParameterGroupName the clusterParameterGroupName value to set. + * @return the AwsRedshiftClusterProperties object itself. + */ + public AwsRedshiftClusterProperties withClusterParameterGroupName(String clusterParameterGroupName) { + this.clusterParameterGroupName = clusterParameterGroupName; + return this; + } + + /** + * Get the clusterSecurityGroups property: A list of security groups to be associated with this cluster. + * + * @return the clusterSecurityGroups value. + */ + public List clusterSecurityGroups() { + return this.clusterSecurityGroups; + } + + /** + * Set the clusterSecurityGroups property: A list of security groups to be associated with this cluster. + * + * @param clusterSecurityGroups the clusterSecurityGroups value to set. + * @return the AwsRedshiftClusterProperties object itself. + */ + public AwsRedshiftClusterProperties withClusterSecurityGroups(List clusterSecurityGroups) { + this.clusterSecurityGroups = clusterSecurityGroups; + return this; + } + + /** + * Get the clusterSubnetGroupName property: The name of a cluster subnet group to be associated with this cluster. + * + * @return the clusterSubnetGroupName value. + */ + public String clusterSubnetGroupName() { + return this.clusterSubnetGroupName; + } + + /** + * Set the clusterSubnetGroupName property: The name of a cluster subnet group to be associated with this cluster. + * + * @param clusterSubnetGroupName the clusterSubnetGroupName value to set. + * @return the AwsRedshiftClusterProperties object itself. + */ + public AwsRedshiftClusterProperties withClusterSubnetGroupName(String clusterSubnetGroupName) { + this.clusterSubnetGroupName = clusterSubnetGroupName; + return this; + } + + /** + * Get the clusterType property: The type of the cluster. When cluster type is specified as single-node, the + * NumberOfNodes parameter is not required and if multi-node, the NumberOfNodes parameter is required. + * + * @return the clusterType value. + */ + public String clusterType() { + return this.clusterType; + } + + /** + * Set the clusterType property: The type of the cluster. When cluster type is specified as single-node, the + * NumberOfNodes parameter is not required and if multi-node, the NumberOfNodes parameter is required. + * + * @param clusterType the clusterType value to set. + * @return the AwsRedshiftClusterProperties object itself. + */ + public AwsRedshiftClusterProperties withClusterType(String clusterType) { + this.clusterType = clusterType; + return this; + } + + /** + * Get the clusterVersion property: The version of the Amazon Redshift engine software that you want to deploy on + * the cluster.The version selected runs on all the nodes in the cluster. + * + * @return the clusterVersion value. + */ + public String clusterVersion() { + return this.clusterVersion; + } + + /** + * Set the clusterVersion property: The version of the Amazon Redshift engine software that you want to deploy on + * the cluster.The version selected runs on all the nodes in the cluster. + * + * @param clusterVersion the clusterVersion value to set. + * @return the AwsRedshiftClusterProperties object itself. + */ + public AwsRedshiftClusterProperties withClusterVersion(String clusterVersion) { + this.clusterVersion = clusterVersion; + return this; + } + + /** + * Get the dbName property: The name of the first database to be created when the cluster is created. To create + * additional databases after the cluster is created, connect to the cluster with a SQL client and use SQL commands + * to create a database. + * + * @return the dbName value. + */ + public String dbName() { + return this.dbName; + } + + /** + * Set the dbName property: The name of the first database to be created when the cluster is created. To create + * additional databases after the cluster is created, connect to the cluster with a SQL client and use SQL commands + * to create a database. + * + * @param dbName the dbName value to set. + * @return the AwsRedshiftClusterProperties object itself. + */ + public AwsRedshiftClusterProperties withDbName(String dbName) { + this.dbName = dbName; + return this; + } + + /** + * Get the deferMaintenance property: A boolean indicating whether to enable the deferred maintenance window. + * + * @return the deferMaintenance value. + */ + public Boolean deferMaintenance() { + return this.deferMaintenance; + } + + /** + * Set the deferMaintenance property: A boolean indicating whether to enable the deferred maintenance window. + * + * @param deferMaintenance the deferMaintenance value to set. + * @return the AwsRedshiftClusterProperties object itself. + */ + public AwsRedshiftClusterProperties withDeferMaintenance(Boolean deferMaintenance) { + this.deferMaintenance = deferMaintenance; + return this; + } + + /** + * Get the deferMaintenanceDuration property: An integer indicating the duration of the maintenance window in days. + * If you specify a duration, you can't specify an end time. The duration must be 45 days or less. + * + * @return the deferMaintenanceDuration value. + */ + public Integer deferMaintenanceDuration() { + return this.deferMaintenanceDuration; + } + + /** + * Set the deferMaintenanceDuration property: An integer indicating the duration of the maintenance window in days. + * If you specify a duration, you can't specify an end time. The duration must be 45 days or less. + * + * @param deferMaintenanceDuration the deferMaintenanceDuration value to set. + * @return the AwsRedshiftClusterProperties object itself. + */ + public AwsRedshiftClusterProperties withDeferMaintenanceDuration(Integer deferMaintenanceDuration) { + this.deferMaintenanceDuration = deferMaintenanceDuration; + return this; + } + + /** + * Get the deferMaintenanceEndTime property: A timestamp indicating end time for the deferred maintenance window. If + * you specify an end time, you can't specify a duration. + * + * @return the deferMaintenanceEndTime value. + */ + public String deferMaintenanceEndTime() { + return this.deferMaintenanceEndTime; + } + + /** + * Set the deferMaintenanceEndTime property: A timestamp indicating end time for the deferred maintenance window. If + * you specify an end time, you can't specify a duration. + * + * @param deferMaintenanceEndTime the deferMaintenanceEndTime value to set. + * @return the AwsRedshiftClusterProperties object itself. + */ + public AwsRedshiftClusterProperties withDeferMaintenanceEndTime(String deferMaintenanceEndTime) { + this.deferMaintenanceEndTime = deferMaintenanceEndTime; + return this; + } + + /** + * Get the deferMaintenanceIdentifier property: A unique identifier for the deferred maintenance window. + * + * @return the deferMaintenanceIdentifier value. + */ + public String deferMaintenanceIdentifier() { + return this.deferMaintenanceIdentifier; + } + + /** + * Set the deferMaintenanceIdentifier property: A unique identifier for the deferred maintenance window. + * + * @param deferMaintenanceIdentifier the deferMaintenanceIdentifier value to set. + * @return the AwsRedshiftClusterProperties object itself. + */ + public AwsRedshiftClusterProperties withDeferMaintenanceIdentifier(String deferMaintenanceIdentifier) { + this.deferMaintenanceIdentifier = deferMaintenanceIdentifier; + return this; + } + + /** + * Get the deferMaintenanceStartTime property: A timestamp indicating the start time for the deferred maintenance + * window. + * + * @return the deferMaintenanceStartTime value. + */ + public String deferMaintenanceStartTime() { + return this.deferMaintenanceStartTime; + } + + /** + * Set the deferMaintenanceStartTime property: A timestamp indicating the start time for the deferred maintenance + * window. + * + * @param deferMaintenanceStartTime the deferMaintenanceStartTime value to set. + * @return the AwsRedshiftClusterProperties object itself. + */ + public AwsRedshiftClusterProperties withDeferMaintenanceStartTime(String deferMaintenanceStartTime) { + this.deferMaintenanceStartTime = deferMaintenanceStartTime; + return this; + } + + /** + * Get the destinationRegion property: The destination AWS Region that you want to copy snapshots to. Constraints: + * Must be the name of a valid AWS Region. For more information, see Regions and Endpoints in the Amazon Web + * Services [https://docs.aws.amazon.com/general/latest/gr/rande.html#redshift_region] General Reference. + * + * @return the destinationRegion value. + */ + public String destinationRegion() { + return this.destinationRegion; + } + + /** + * Set the destinationRegion property: The destination AWS Region that you want to copy snapshots to. Constraints: + * Must be the name of a valid AWS Region. For more information, see Regions and Endpoints in the Amazon Web + * Services [https://docs.aws.amazon.com/general/latest/gr/rande.html#redshift_region] General Reference. + * + * @param destinationRegion the destinationRegion value to set. + * @return the AwsRedshiftClusterProperties object itself. + */ + public AwsRedshiftClusterProperties withDestinationRegion(String destinationRegion) { + this.destinationRegion = destinationRegion; + return this; + } + + /** + * Get the elasticIp property: The Elastic IP (EIP) address for the cluster. + * + * @return the elasticIp value. + */ + public String elasticIp() { + return this.elasticIp; + } + + /** + * Set the elasticIp property: The Elastic IP (EIP) address for the cluster. + * + * @param elasticIp the elasticIp value to set. + * @return the AwsRedshiftClusterProperties object itself. + */ + public AwsRedshiftClusterProperties withElasticIp(String elasticIp) { + this.elasticIp = elasticIp; + return this; + } + + /** + * Get the encrypted property: If true, the data in the cluster is encrypted at rest. + * + * @return the encrypted value. + */ + public Boolean encrypted() { + return this.encrypted; + } + + /** + * Set the encrypted property: If true, the data in the cluster is encrypted at rest. + * + * @param encrypted the encrypted value to set. + * @return the AwsRedshiftClusterProperties object itself. + */ + public AwsRedshiftClusterProperties withEncrypted(Boolean encrypted) { + this.encrypted = encrypted; + return this; + } + + /** + * Get the endpoint property: Property endpoint. + * + * @return the endpoint value. + */ + public EndpointAutoGenerated3 endpoint() { + return this.endpoint; + } + + /** + * Set the endpoint property: Property endpoint. + * + * @param endpoint the endpoint value to set. + * @return the AwsRedshiftClusterProperties object itself. + */ + public AwsRedshiftClusterProperties withEndpoint(EndpointAutoGenerated3 endpoint) { + this.endpoint = endpoint; + return this; + } + + /** + * Get the enhancedVpcRouting property: An option that specifies whether to create the cluster with enhanced VPC + * routing enabled. To create a cluster that uses enhanced VPC routing, the cluster must be in a VPC. For more + * information, see Enhanced VPC Routing in the Amazon Redshift Cluster Management Guide.If this option is true , + * enhanced VPC routing is enabled.Default: false. + * + * @return the enhancedVpcRouting value. + */ + public Boolean enhancedVpcRouting() { + return this.enhancedVpcRouting; + } + + /** + * Set the enhancedVpcRouting property: An option that specifies whether to create the cluster with enhanced VPC + * routing enabled. To create a cluster that uses enhanced VPC routing, the cluster must be in a VPC. For more + * information, see Enhanced VPC Routing in the Amazon Redshift Cluster Management Guide.If this option is true , + * enhanced VPC routing is enabled.Default: false. + * + * @param enhancedVpcRouting the enhancedVpcRouting value to set. + * @return the AwsRedshiftClusterProperties object itself. + */ + public AwsRedshiftClusterProperties withEnhancedVpcRouting(Boolean enhancedVpcRouting) { + this.enhancedVpcRouting = enhancedVpcRouting; + return this; + } + + /** + * Get the hsmClientCertificateIdentifier property: Specifies the name of the HSM client certificate the Amazon + * Redshift cluster uses to retrieve the data encryption keys stored in an HSM. + * + * @return the hsmClientCertificateIdentifier value. + */ + public String hsmClientCertificateIdentifier() { + return this.hsmClientCertificateIdentifier; + } + + /** + * Set the hsmClientCertificateIdentifier property: Specifies the name of the HSM client certificate the Amazon + * Redshift cluster uses to retrieve the data encryption keys stored in an HSM. + * + * @param hsmClientCertificateIdentifier the hsmClientCertificateIdentifier value to set. + * @return the AwsRedshiftClusterProperties object itself. + */ + public AwsRedshiftClusterProperties withHsmClientCertificateIdentifier(String hsmClientCertificateIdentifier) { + this.hsmClientCertificateIdentifier = hsmClientCertificateIdentifier; + return this; + } + + /** + * Get the hsmConfigurationIdentifier property: Specifies the name of the HSM configuration that contains the + * information the Amazon Redshift cluster can use to retrieve and store keys in an HSM. + * + * @return the hsmConfigurationIdentifier value. + */ + public String hsmConfigurationIdentifier() { + return this.hsmConfigurationIdentifier; + } + + /** + * Set the hsmConfigurationIdentifier property: Specifies the name of the HSM configuration that contains the + * information the Amazon Redshift cluster can use to retrieve and store keys in an HSM. + * + * @param hsmConfigurationIdentifier the hsmConfigurationIdentifier value to set. + * @return the AwsRedshiftClusterProperties object itself. + */ + public AwsRedshiftClusterProperties withHsmConfigurationIdentifier(String hsmConfigurationIdentifier) { + this.hsmConfigurationIdentifier = hsmConfigurationIdentifier; + return this; + } + + /** + * Get the iamRoles property: A list of AWS Identity and Access Management (IAM) roles that can be used by the + * cluster to access other AWS services. You must supply the IAM roles in their Amazon Resource Name (ARN) format. + * You can supply up to 50 IAM roles in a single request. + * + * @return the iamRoles value. + */ + public List iamRoles() { + return this.iamRoles; + } + + /** + * Set the iamRoles property: A list of AWS Identity and Access Management (IAM) roles that can be used by the + * cluster to access other AWS services. You must supply the IAM roles in their Amazon Resource Name (ARN) format. + * You can supply up to 50 IAM roles in a single request. + * + * @param iamRoles the iamRoles value to set. + * @return the AwsRedshiftClusterProperties object itself. + */ + public AwsRedshiftClusterProperties withIamRoles(List iamRoles) { + this.iamRoles = iamRoles; + return this; + } + + /** + * Get the kmsKeyId property: The AWS Key Management Service (KMS) key ID of the encryption key that you want to use + * to encrypt data in the cluster. + * + * @return the kmsKeyId value. + */ + public String kmsKeyId() { + return this.kmsKeyId; + } + + /** + * Set the kmsKeyId property: The AWS Key Management Service (KMS) key ID of the encryption key that you want to use + * to encrypt data in the cluster. + * + * @param kmsKeyId the kmsKeyId value to set. + * @return the AwsRedshiftClusterProperties object itself. + */ + public AwsRedshiftClusterProperties withKmsKeyId(String kmsKeyId) { + this.kmsKeyId = kmsKeyId; + return this; + } + + /** + * Get the loggingProperties property: Property loggingProperties. + * + * @return the loggingProperties value. + */ + public LoggingProperties loggingProperties() { + return this.loggingProperties; + } + + /** + * Set the loggingProperties property: Property loggingProperties. + * + * @param loggingProperties the loggingProperties value to set. + * @return the AwsRedshiftClusterProperties object itself. + */ + public AwsRedshiftClusterProperties withLoggingProperties(LoggingProperties loggingProperties) { + this.loggingProperties = loggingProperties; + return this; + } + + /** + * Get the maintenanceTrackName property: The name for the maintenance track that you want to assign for the + * cluster. This name change is asynchronous. The new track name stays in the PendingModifiedValues for the cluster + * until the next maintenance window. When the maintenance track changes, the cluster is switched to the latest + * cluster release available for the maintenance track. At this point, the maintenance track name is applied. + * + * @return the maintenanceTrackName value. + */ + public String maintenanceTrackName() { + return this.maintenanceTrackName; + } + + /** + * Set the maintenanceTrackName property: The name for the maintenance track that you want to assign for the + * cluster. This name change is asynchronous. The new track name stays in the PendingModifiedValues for the cluster + * until the next maintenance window. When the maintenance track changes, the cluster is switched to the latest + * cluster release available for the maintenance track. At this point, the maintenance track name is applied. + * + * @param maintenanceTrackName the maintenanceTrackName value to set. + * @return the AwsRedshiftClusterProperties object itself. + */ + public AwsRedshiftClusterProperties withMaintenanceTrackName(String maintenanceTrackName) { + this.maintenanceTrackName = maintenanceTrackName; + return this; + } + + /** + * Get the manageMasterPassword property: A boolean indicating if the redshift cluster's admin user credentials is + * managed by Redshift or not. You can't use MasterUserPassword if ManageMasterPassword is true. If + * ManageMasterPassword is false or not set, Amazon Redshift uses MasterUserPassword for the admin user account's + * password. + * + * @return the manageMasterPassword value. + */ + public Boolean manageMasterPassword() { + return this.manageMasterPassword; + } + + /** + * Set the manageMasterPassword property: A boolean indicating if the redshift cluster's admin user credentials is + * managed by Redshift or not. You can't use MasterUserPassword if ManageMasterPassword is true. If + * ManageMasterPassword is false or not set, Amazon Redshift uses MasterUserPassword for the admin user account's + * password. + * + * @param manageMasterPassword the manageMasterPassword value to set. + * @return the AwsRedshiftClusterProperties object itself. + */ + public AwsRedshiftClusterProperties withManageMasterPassword(Boolean manageMasterPassword) { + this.manageMasterPassword = manageMasterPassword; + return this; + } + + /** + * Get the manualSnapshotRetentionPeriod property: The number of days to retain newly copied snapshots in the + * destination AWS Region after they are copied from the source AWS Region. If the value is -1, the manual snapshot + * is retained indefinitely.The value must be either -1 or an integer between 1 and 3,653. + * + * @return the manualSnapshotRetentionPeriod value. + */ + public Integer manualSnapshotRetentionPeriod() { + return this.manualSnapshotRetentionPeriod; + } + + /** + * Set the manualSnapshotRetentionPeriod property: The number of days to retain newly copied snapshots in the + * destination AWS Region after they are copied from the source AWS Region. If the value is -1, the manual snapshot + * is retained indefinitely.The value must be either -1 or an integer between 1 and 3,653. + * + * @param manualSnapshotRetentionPeriod the manualSnapshotRetentionPeriod value to set. + * @return the AwsRedshiftClusterProperties object itself. + */ + public AwsRedshiftClusterProperties withManualSnapshotRetentionPeriod(Integer manualSnapshotRetentionPeriod) { + this.manualSnapshotRetentionPeriod = manualSnapshotRetentionPeriod; + return this; + } + + /** + * Get the masterPasswordSecretArn property: The Amazon Resource Name (ARN) for the cluster's admin user credentials + * secret. + * + * @return the masterPasswordSecretArn value. + */ + public String masterPasswordSecretArn() { + return this.masterPasswordSecretArn; + } + + /** + * Set the masterPasswordSecretArn property: The Amazon Resource Name (ARN) for the cluster's admin user credentials + * secret. + * + * @param masterPasswordSecretArn the masterPasswordSecretArn value to set. + * @return the AwsRedshiftClusterProperties object itself. + */ + public AwsRedshiftClusterProperties withMasterPasswordSecretArn(String masterPasswordSecretArn) { + this.masterPasswordSecretArn = masterPasswordSecretArn; + return this; + } + + /** + * Get the masterPasswordSecretKmsKeyId property: The ID of the Key Management Service (KMS) key used to encrypt and + * store the cluster's admin user credentials secret. + * + * @return the masterPasswordSecretKmsKeyId value. + */ + public String masterPasswordSecretKmsKeyId() { + return this.masterPasswordSecretKmsKeyId; + } + + /** + * Set the masterPasswordSecretKmsKeyId property: The ID of the Key Management Service (KMS) key used to encrypt and + * store the cluster's admin user credentials secret. + * + * @param masterPasswordSecretKmsKeyId the masterPasswordSecretKmsKeyId value to set. + * @return the AwsRedshiftClusterProperties object itself. + */ + public AwsRedshiftClusterProperties withMasterPasswordSecretKmsKeyId(String masterPasswordSecretKmsKeyId) { + this.masterPasswordSecretKmsKeyId = masterPasswordSecretKmsKeyId; + return this; + } + + /** + * Get the masterUserPassword property: The password associated with the master user account for the cluster that is + * being created. You can't use MasterUserPassword if ManageMasterPassword is true. Password must be between 8 and + * 64 characters in length, should have at least one uppercase letter.Must contain at least one lowercase + * letter.Must contain one number.Can be any printable ASCII character. + * + * @return the masterUserPassword value. + */ + public String masterUserPassword() { + return this.masterUserPassword; + } + + /** + * Set the masterUserPassword property: The password associated with the master user account for the cluster that is + * being created. You can't use MasterUserPassword if ManageMasterPassword is true. Password must be between 8 and + * 64 characters in length, should have at least one uppercase letter.Must contain at least one lowercase + * letter.Must contain one number.Can be any printable ASCII character. + * + * @param masterUserPassword the masterUserPassword value to set. + * @return the AwsRedshiftClusterProperties object itself. + */ + public AwsRedshiftClusterProperties withMasterUserPassword(String masterUserPassword) { + this.masterUserPassword = masterUserPassword; + return this; + } + + /** + * Get the masterUsername property: The user name associated with the master user account for the cluster that is + * being created. The user name can't be PUBLIC and first character must be a letter. + * + * @return the masterUsername value. + */ + public String masterUsername() { + return this.masterUsername; + } + + /** + * Set the masterUsername property: The user name associated with the master user account for the cluster that is + * being created. The user name can't be PUBLIC and first character must be a letter. + * + * @param masterUsername the masterUsername value to set. + * @return the AwsRedshiftClusterProperties object itself. + */ + public AwsRedshiftClusterProperties withMasterUsername(String masterUsername) { + this.masterUsername = masterUsername; + return this; + } + + /** + * Get the multiAZ property: A boolean indicating if the redshift cluster is multi-az or not. If you don't provide + * this parameter or set the value to false, the redshift cluster will be single-az. + * + * @return the multiAZ value. + */ + public Boolean multiAZ() { + return this.multiAZ; + } + + /** + * Set the multiAZ property: A boolean indicating if the redshift cluster is multi-az or not. If you don't provide + * this parameter or set the value to false, the redshift cluster will be single-az. + * + * @param multiAZ the multiAZ value to set. + * @return the AwsRedshiftClusterProperties object itself. + */ + public AwsRedshiftClusterProperties withMultiAZ(Boolean multiAZ) { + this.multiAZ = multiAZ; + return this; + } + + /** + * Get the namespaceResourcePolicy property: The namespace resource policy document that will be attached to a + * Redshift cluster. + * + * @return the namespaceResourcePolicy value. + */ + public Object namespaceResourcePolicy() { + return this.namespaceResourcePolicy; + } + + /** + * Set the namespaceResourcePolicy property: The namespace resource policy document that will be attached to a + * Redshift cluster. + * + * @param namespaceResourcePolicy the namespaceResourcePolicy value to set. + * @return the AwsRedshiftClusterProperties object itself. + */ + public AwsRedshiftClusterProperties withNamespaceResourcePolicy(Object namespaceResourcePolicy) { + this.namespaceResourcePolicy = namespaceResourcePolicy; + return this; + } + + /** + * Get the nodeType property: The node type to be provisioned for the cluster.Valid Values: ds2.xlarge | ds2.8xlarge + * | dc1.large | dc1.8xlarge | dc2.large | dc2.8xlarge | ra3.4xlarge | ra3.16xlarge. + * + * @return the nodeType value. + */ + public String nodeType() { + return this.nodeType; + } + + /** + * Set the nodeType property: The node type to be provisioned for the cluster.Valid Values: ds2.xlarge | ds2.8xlarge + * | dc1.large | dc1.8xlarge | dc2.large | dc2.8xlarge | ra3.4xlarge | ra3.16xlarge. + * + * @param nodeType the nodeType value to set. + * @return the AwsRedshiftClusterProperties object itself. + */ + public AwsRedshiftClusterProperties withNodeType(String nodeType) { + this.nodeType = nodeType; + return this; + } + + /** + * Get the numberOfNodes property: The number of compute nodes in the cluster. This parameter is required when the + * ClusterType parameter is specified as multi-node. + * + * @return the numberOfNodes value. + */ + public Integer numberOfNodes() { + return this.numberOfNodes; + } + + /** + * Set the numberOfNodes property: The number of compute nodes in the cluster. This parameter is required when the + * ClusterType parameter is specified as multi-node. + * + * @param numberOfNodes the numberOfNodes value to set. + * @return the AwsRedshiftClusterProperties object itself. + */ + public AwsRedshiftClusterProperties withNumberOfNodes(Integer numberOfNodes) { + this.numberOfNodes = numberOfNodes; + return this; + } + + /** + * Get the ownerAccount property: Property ownerAccount. + * + * @return the ownerAccount value. + */ + public String ownerAccount() { + return this.ownerAccount; + } + + /** + * Set the ownerAccount property: Property ownerAccount. + * + * @param ownerAccount the ownerAccount value to set. + * @return the AwsRedshiftClusterProperties object itself. + */ + public AwsRedshiftClusterProperties withOwnerAccount(String ownerAccount) { + this.ownerAccount = ownerAccount; + return this; + } + + /** + * Get the port property: The port number on which the cluster accepts incoming connections. The cluster is + * accessible only via the JDBC and ODBC connection strings. + * + * @return the port value. + */ + public Integer port() { + return this.port; + } + + /** + * Set the port property: The port number on which the cluster accepts incoming connections. The cluster is + * accessible only via the JDBC and ODBC connection strings. + * + * @param port the port value to set. + * @return the AwsRedshiftClusterProperties object itself. + */ + public AwsRedshiftClusterProperties withPort(Integer port) { + this.port = port; + return this; + } + + /** + * Get the preferredMaintenanceWindow property: The weekly time range (in UTC) during which automated cluster + * maintenance can occur. + * + * @return the preferredMaintenanceWindow value. + */ + public String preferredMaintenanceWindow() { + return this.preferredMaintenanceWindow; + } + + /** + * Set the preferredMaintenanceWindow property: The weekly time range (in UTC) during which automated cluster + * maintenance can occur. + * + * @param preferredMaintenanceWindow the preferredMaintenanceWindow value to set. + * @return the AwsRedshiftClusterProperties object itself. + */ + public AwsRedshiftClusterProperties withPreferredMaintenanceWindow(String preferredMaintenanceWindow) { + this.preferredMaintenanceWindow = preferredMaintenanceWindow; + return this; + } + + /** + * Get the publiclyAccessible property: If true, the cluster can be accessed from a public network. + * + * @return the publiclyAccessible value. + */ + public Boolean publiclyAccessible() { + return this.publiclyAccessible; + } + + /** + * Set the publiclyAccessible property: If true, the cluster can be accessed from a public network. + * + * @param publiclyAccessible the publiclyAccessible value to set. + * @return the AwsRedshiftClusterProperties object itself. + */ + public AwsRedshiftClusterProperties withPubliclyAccessible(Boolean publiclyAccessible) { + this.publiclyAccessible = publiclyAccessible; + return this; + } + + /** + * Get the resourceAction property: The Redshift operation to be performed. Resource Action supports pause-cluster, + * resume-cluster, failover-primary-compute APIs. + * + * @return the resourceAction value. + */ + public String resourceAction() { + return this.resourceAction; + } + + /** + * Set the resourceAction property: The Redshift operation to be performed. Resource Action supports pause-cluster, + * resume-cluster, failover-primary-compute APIs. + * + * @param resourceAction the resourceAction value to set. + * @return the AwsRedshiftClusterProperties object itself. + */ + public AwsRedshiftClusterProperties withResourceAction(String resourceAction) { + this.resourceAction = resourceAction; + return this; + } + + /** + * Get the revisionTarget property: The identifier of the database revision. You can retrieve this value from the + * response to the DescribeClusterDbRevisions request. + * + * @return the revisionTarget value. + */ + public String revisionTarget() { + return this.revisionTarget; + } + + /** + * Set the revisionTarget property: The identifier of the database revision. You can retrieve this value from the + * response to the DescribeClusterDbRevisions request. + * + * @param revisionTarget the revisionTarget value to set. + * @return the AwsRedshiftClusterProperties object itself. + */ + public AwsRedshiftClusterProperties withRevisionTarget(String revisionTarget) { + this.revisionTarget = revisionTarget; + return this; + } + + /** + * Get the rotateEncryptionKey property: A boolean indicating if we want to rotate Encryption Keys. + * + * @return the rotateEncryptionKey value. + */ + public Boolean rotateEncryptionKey() { + return this.rotateEncryptionKey; + } + + /** + * Set the rotateEncryptionKey property: A boolean indicating if we want to rotate Encryption Keys. + * + * @param rotateEncryptionKey the rotateEncryptionKey value to set. + * @return the AwsRedshiftClusterProperties object itself. + */ + public AwsRedshiftClusterProperties withRotateEncryptionKey(Boolean rotateEncryptionKey) { + this.rotateEncryptionKey = rotateEncryptionKey; + return this; + } + + /** + * Get the snapshotClusterIdentifier property: The name of the cluster the source snapshot was created from. This + * parameter is required if your IAM user has a policy containing a snapshot resource element that specifies + * anything other than * for the cluster name. + * + * @return the snapshotClusterIdentifier value. + */ + public String snapshotClusterIdentifier() { + return this.snapshotClusterIdentifier; + } + + /** + * Set the snapshotClusterIdentifier property: The name of the cluster the source snapshot was created from. This + * parameter is required if your IAM user has a policy containing a snapshot resource element that specifies + * anything other than * for the cluster name. + * + * @param snapshotClusterIdentifier the snapshotClusterIdentifier value to set. + * @return the AwsRedshiftClusterProperties object itself. + */ + public AwsRedshiftClusterProperties withSnapshotClusterIdentifier(String snapshotClusterIdentifier) { + this.snapshotClusterIdentifier = snapshotClusterIdentifier; + return this; + } + + /** + * Get the snapshotCopyGrantName property: The name of the snapshot copy grant to use when snapshots of an AWS + * KMS-encrypted cluster are copied to the destination region. + * + * @return the snapshotCopyGrantName value. + */ + public String snapshotCopyGrantName() { + return this.snapshotCopyGrantName; + } + + /** + * Set the snapshotCopyGrantName property: The name of the snapshot copy grant to use when snapshots of an AWS + * KMS-encrypted cluster are copied to the destination region. + * + * @param snapshotCopyGrantName the snapshotCopyGrantName value to set. + * @return the AwsRedshiftClusterProperties object itself. + */ + public AwsRedshiftClusterProperties withSnapshotCopyGrantName(String snapshotCopyGrantName) { + this.snapshotCopyGrantName = snapshotCopyGrantName; + return this; + } + + /** + * Get the snapshotCopyManual property: Indicates whether to apply the snapshot retention period to newly copied + * manual snapshots instead of automated snapshots. + * + * @return the snapshotCopyManual value. + */ + public Boolean snapshotCopyManual() { + return this.snapshotCopyManual; + } + + /** + * Set the snapshotCopyManual property: Indicates whether to apply the snapshot retention period to newly copied + * manual snapshots instead of automated snapshots. + * + * @param snapshotCopyManual the snapshotCopyManual value to set. + * @return the AwsRedshiftClusterProperties object itself. + */ + public AwsRedshiftClusterProperties withSnapshotCopyManual(Boolean snapshotCopyManual) { + this.snapshotCopyManual = snapshotCopyManual; + return this; + } + + /** + * Get the snapshotCopyRetentionPeriod property: The number of days to retain automated snapshots in the destination + * region after they are copied from the source region. Default is 7. Constraints: Must be at least 1 and no more + * than 35. + * + * @return the snapshotCopyRetentionPeriod value. + */ + public Integer snapshotCopyRetentionPeriod() { + return this.snapshotCopyRetentionPeriod; + } + + /** + * Set the snapshotCopyRetentionPeriod property: The number of days to retain automated snapshots in the destination + * region after they are copied from the source region. Default is 7. Constraints: Must be at least 1 and no more + * than 35. + * + * @param snapshotCopyRetentionPeriod the snapshotCopyRetentionPeriod value to set. + * @return the AwsRedshiftClusterProperties object itself. + */ + public AwsRedshiftClusterProperties withSnapshotCopyRetentionPeriod(Integer snapshotCopyRetentionPeriod) { + this.snapshotCopyRetentionPeriod = snapshotCopyRetentionPeriod; + return this; + } + + /** + * Get the snapshotIdentifier property: The name of the snapshot from which to create the new cluster. This + * parameter isn't case sensitive. + * + * @return the snapshotIdentifier value. + */ + public String snapshotIdentifier() { + return this.snapshotIdentifier; + } + + /** + * Set the snapshotIdentifier property: The name of the snapshot from which to create the new cluster. This + * parameter isn't case sensitive. + * + * @param snapshotIdentifier the snapshotIdentifier value to set. + * @return the AwsRedshiftClusterProperties object itself. + */ + public AwsRedshiftClusterProperties withSnapshotIdentifier(String snapshotIdentifier) { + this.snapshotIdentifier = snapshotIdentifier; + return this; + } + + /** + * Get the tags property: The list of tags for the cluster parameter group. + * + * @return the tags value. + */ + public List tags() { + return this.tags; + } + + /** + * Set the tags property: The list of tags for the cluster parameter group. + * + * @param tags the tags value to set. + * @return the AwsRedshiftClusterProperties object itself. + */ + public AwsRedshiftClusterProperties withTags(List tags) { + this.tags = tags; + return this; + } + + /** + * Get the vpcSecurityGroupIds property: A list of Virtual Private Cloud (VPC) security groups to be associated with + * the cluster. + * + * @return the vpcSecurityGroupIds value. + */ + public List vpcSecurityGroupIds() { + return this.vpcSecurityGroupIds; + } + + /** + * Set the vpcSecurityGroupIds property: A list of Virtual Private Cloud (VPC) security groups to be associated with + * the cluster. + * + * @param vpcSecurityGroupIds the vpcSecurityGroupIds value to set. + * @return the AwsRedshiftClusterProperties object itself. + */ + public AwsRedshiftClusterProperties withVpcSecurityGroupIds(List vpcSecurityGroupIds) { + this.vpcSecurityGroupIds = vpcSecurityGroupIds; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (endpoint() != null) { + endpoint().validate(); + } + if (loggingProperties() != null) { + loggingProperties().validate(); + } + if (tags() != null) { + tags().forEach(e -> e.validate()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeBooleanField("allowVersionUpgrade", this.allowVersionUpgrade); + jsonWriter.writeStringField("aquaConfigurationStatus", this.aquaConfigurationStatus); + jsonWriter.writeNumberField("automatedSnapshotRetentionPeriod", this.automatedSnapshotRetentionPeriod); + jsonWriter.writeStringField("availabilityZone", this.availabilityZone); + jsonWriter.writeBooleanField("availabilityZoneRelocation", this.availabilityZoneRelocation); + jsonWriter.writeStringField("availabilityZoneRelocationStatus", this.availabilityZoneRelocationStatus); + jsonWriter.writeBooleanField("classic", this.classic); + jsonWriter.writeStringField("clusterIdentifier", this.clusterIdentifier); + jsonWriter.writeStringField("clusterNamespaceArn", this.clusterNamespaceArn); + jsonWriter.writeStringField("clusterParameterGroupName", this.clusterParameterGroupName); + jsonWriter.writeArrayField("clusterSecurityGroups", this.clusterSecurityGroups, + (writer, element) -> writer.writeString(element)); + jsonWriter.writeStringField("clusterSubnetGroupName", this.clusterSubnetGroupName); + jsonWriter.writeStringField("clusterType", this.clusterType); + jsonWriter.writeStringField("clusterVersion", this.clusterVersion); + jsonWriter.writeStringField("dbName", this.dbName); + jsonWriter.writeBooleanField("deferMaintenance", this.deferMaintenance); + jsonWriter.writeNumberField("deferMaintenanceDuration", this.deferMaintenanceDuration); + jsonWriter.writeStringField("deferMaintenanceEndTime", this.deferMaintenanceEndTime); + jsonWriter.writeStringField("deferMaintenanceIdentifier", this.deferMaintenanceIdentifier); + jsonWriter.writeStringField("deferMaintenanceStartTime", this.deferMaintenanceStartTime); + jsonWriter.writeStringField("destinationRegion", this.destinationRegion); + jsonWriter.writeStringField("elasticIp", this.elasticIp); + jsonWriter.writeBooleanField("encrypted", this.encrypted); + jsonWriter.writeJsonField("endpoint", this.endpoint); + jsonWriter.writeBooleanField("enhancedVpcRouting", this.enhancedVpcRouting); + jsonWriter.writeStringField("hsmClientCertificateIdentifier", this.hsmClientCertificateIdentifier); + jsonWriter.writeStringField("hsmConfigurationIdentifier", this.hsmConfigurationIdentifier); + jsonWriter.writeArrayField("iamRoles", this.iamRoles, (writer, element) -> writer.writeString(element)); + jsonWriter.writeStringField("kmsKeyId", this.kmsKeyId); + jsonWriter.writeJsonField("loggingProperties", this.loggingProperties); + jsonWriter.writeStringField("maintenanceTrackName", this.maintenanceTrackName); + jsonWriter.writeBooleanField("manageMasterPassword", this.manageMasterPassword); + jsonWriter.writeNumberField("manualSnapshotRetentionPeriod", this.manualSnapshotRetentionPeriod); + jsonWriter.writeStringField("masterPasswordSecretArn", this.masterPasswordSecretArn); + jsonWriter.writeStringField("masterPasswordSecretKmsKeyId", this.masterPasswordSecretKmsKeyId); + jsonWriter.writeStringField("masterUserPassword", this.masterUserPassword); + jsonWriter.writeStringField("masterUsername", this.masterUsername); + jsonWriter.writeBooleanField("multiAZ", this.multiAZ); + jsonWriter.writeUntypedField("namespaceResourcePolicy", this.namespaceResourcePolicy); + jsonWriter.writeStringField("nodeType", this.nodeType); + jsonWriter.writeNumberField("numberOfNodes", this.numberOfNodes); + jsonWriter.writeStringField("ownerAccount", this.ownerAccount); + jsonWriter.writeNumberField("port", this.port); + jsonWriter.writeStringField("preferredMaintenanceWindow", this.preferredMaintenanceWindow); + jsonWriter.writeBooleanField("publiclyAccessible", this.publiclyAccessible); + jsonWriter.writeStringField("resourceAction", this.resourceAction); + jsonWriter.writeStringField("revisionTarget", this.revisionTarget); + jsonWriter.writeBooleanField("rotateEncryptionKey", this.rotateEncryptionKey); + jsonWriter.writeStringField("snapshotClusterIdentifier", this.snapshotClusterIdentifier); + jsonWriter.writeStringField("snapshotCopyGrantName", this.snapshotCopyGrantName); + jsonWriter.writeBooleanField("snapshotCopyManual", this.snapshotCopyManual); + jsonWriter.writeNumberField("snapshotCopyRetentionPeriod", this.snapshotCopyRetentionPeriod); + jsonWriter.writeStringField("snapshotIdentifier", this.snapshotIdentifier); + jsonWriter.writeArrayField("tags", this.tags, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("vpcSecurityGroupIds", this.vpcSecurityGroupIds, + (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AwsRedshiftClusterProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AwsRedshiftClusterProperties if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the AwsRedshiftClusterProperties. + */ + public static AwsRedshiftClusterProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AwsRedshiftClusterProperties deserializedAwsRedshiftClusterProperties = new AwsRedshiftClusterProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("allowVersionUpgrade".equals(fieldName)) { + deserializedAwsRedshiftClusterProperties.allowVersionUpgrade + = reader.getNullable(JsonReader::getBoolean); + } else if ("aquaConfigurationStatus".equals(fieldName)) { + deserializedAwsRedshiftClusterProperties.aquaConfigurationStatus = reader.getString(); + } else if ("automatedSnapshotRetentionPeriod".equals(fieldName)) { + deserializedAwsRedshiftClusterProperties.automatedSnapshotRetentionPeriod + = reader.getNullable(JsonReader::getInt); + } else if ("availabilityZone".equals(fieldName)) { + deserializedAwsRedshiftClusterProperties.availabilityZone = reader.getString(); + } else if ("availabilityZoneRelocation".equals(fieldName)) { + deserializedAwsRedshiftClusterProperties.availabilityZoneRelocation + = reader.getNullable(JsonReader::getBoolean); + } else if ("availabilityZoneRelocationStatus".equals(fieldName)) { + deserializedAwsRedshiftClusterProperties.availabilityZoneRelocationStatus = reader.getString(); + } else if ("classic".equals(fieldName)) { + deserializedAwsRedshiftClusterProperties.classic = reader.getNullable(JsonReader::getBoolean); + } else if ("clusterIdentifier".equals(fieldName)) { + deserializedAwsRedshiftClusterProperties.clusterIdentifier = reader.getString(); + } else if ("clusterNamespaceArn".equals(fieldName)) { + deserializedAwsRedshiftClusterProperties.clusterNamespaceArn = reader.getString(); + } else if ("clusterParameterGroupName".equals(fieldName)) { + deserializedAwsRedshiftClusterProperties.clusterParameterGroupName = reader.getString(); + } else if ("clusterSecurityGroups".equals(fieldName)) { + List clusterSecurityGroups = reader.readArray(reader1 -> reader1.getString()); + deserializedAwsRedshiftClusterProperties.clusterSecurityGroups = clusterSecurityGroups; + } else if ("clusterSubnetGroupName".equals(fieldName)) { + deserializedAwsRedshiftClusterProperties.clusterSubnetGroupName = reader.getString(); + } else if ("clusterType".equals(fieldName)) { + deserializedAwsRedshiftClusterProperties.clusterType = reader.getString(); + } else if ("clusterVersion".equals(fieldName)) { + deserializedAwsRedshiftClusterProperties.clusterVersion = reader.getString(); + } else if ("dbName".equals(fieldName)) { + deserializedAwsRedshiftClusterProperties.dbName = reader.getString(); + } else if ("deferMaintenance".equals(fieldName)) { + deserializedAwsRedshiftClusterProperties.deferMaintenance + = reader.getNullable(JsonReader::getBoolean); + } else if ("deferMaintenanceDuration".equals(fieldName)) { + deserializedAwsRedshiftClusterProperties.deferMaintenanceDuration + = reader.getNullable(JsonReader::getInt); + } else if ("deferMaintenanceEndTime".equals(fieldName)) { + deserializedAwsRedshiftClusterProperties.deferMaintenanceEndTime = reader.getString(); + } else if ("deferMaintenanceIdentifier".equals(fieldName)) { + deserializedAwsRedshiftClusterProperties.deferMaintenanceIdentifier = reader.getString(); + } else if ("deferMaintenanceStartTime".equals(fieldName)) { + deserializedAwsRedshiftClusterProperties.deferMaintenanceStartTime = reader.getString(); + } else if ("destinationRegion".equals(fieldName)) { + deserializedAwsRedshiftClusterProperties.destinationRegion = reader.getString(); + } else if ("elasticIp".equals(fieldName)) { + deserializedAwsRedshiftClusterProperties.elasticIp = reader.getString(); + } else if ("encrypted".equals(fieldName)) { + deserializedAwsRedshiftClusterProperties.encrypted = reader.getNullable(JsonReader::getBoolean); + } else if ("endpoint".equals(fieldName)) { + deserializedAwsRedshiftClusterProperties.endpoint = EndpointAutoGenerated3.fromJson(reader); + } else if ("enhancedVpcRouting".equals(fieldName)) { + deserializedAwsRedshiftClusterProperties.enhancedVpcRouting + = reader.getNullable(JsonReader::getBoolean); + } else if ("hsmClientCertificateIdentifier".equals(fieldName)) { + deserializedAwsRedshiftClusterProperties.hsmClientCertificateIdentifier = reader.getString(); + } else if ("hsmConfigurationIdentifier".equals(fieldName)) { + deserializedAwsRedshiftClusterProperties.hsmConfigurationIdentifier = reader.getString(); + } else if ("iamRoles".equals(fieldName)) { + List iamRoles = reader.readArray(reader1 -> reader1.getString()); + deserializedAwsRedshiftClusterProperties.iamRoles = iamRoles; + } else if ("kmsKeyId".equals(fieldName)) { + deserializedAwsRedshiftClusterProperties.kmsKeyId = reader.getString(); + } else if ("loggingProperties".equals(fieldName)) { + deserializedAwsRedshiftClusterProperties.loggingProperties = LoggingProperties.fromJson(reader); + } else if ("maintenanceTrackName".equals(fieldName)) { + deserializedAwsRedshiftClusterProperties.maintenanceTrackName = reader.getString(); + } else if ("manageMasterPassword".equals(fieldName)) { + deserializedAwsRedshiftClusterProperties.manageMasterPassword + = reader.getNullable(JsonReader::getBoolean); + } else if ("manualSnapshotRetentionPeriod".equals(fieldName)) { + deserializedAwsRedshiftClusterProperties.manualSnapshotRetentionPeriod + = reader.getNullable(JsonReader::getInt); + } else if ("masterPasswordSecretArn".equals(fieldName)) { + deserializedAwsRedshiftClusterProperties.masterPasswordSecretArn = reader.getString(); + } else if ("masterPasswordSecretKmsKeyId".equals(fieldName)) { + deserializedAwsRedshiftClusterProperties.masterPasswordSecretKmsKeyId = reader.getString(); + } else if ("masterUserPassword".equals(fieldName)) { + deserializedAwsRedshiftClusterProperties.masterUserPassword = reader.getString(); + } else if ("masterUsername".equals(fieldName)) { + deserializedAwsRedshiftClusterProperties.masterUsername = reader.getString(); + } else if ("multiAZ".equals(fieldName)) { + deserializedAwsRedshiftClusterProperties.multiAZ = reader.getNullable(JsonReader::getBoolean); + } else if ("namespaceResourcePolicy".equals(fieldName)) { + deserializedAwsRedshiftClusterProperties.namespaceResourcePolicy = reader.readUntyped(); + } else if ("nodeType".equals(fieldName)) { + deserializedAwsRedshiftClusterProperties.nodeType = reader.getString(); + } else if ("numberOfNodes".equals(fieldName)) { + deserializedAwsRedshiftClusterProperties.numberOfNodes = reader.getNullable(JsonReader::getInt); + } else if ("ownerAccount".equals(fieldName)) { + deserializedAwsRedshiftClusterProperties.ownerAccount = reader.getString(); + } else if ("port".equals(fieldName)) { + deserializedAwsRedshiftClusterProperties.port = reader.getNullable(JsonReader::getInt); + } else if ("preferredMaintenanceWindow".equals(fieldName)) { + deserializedAwsRedshiftClusterProperties.preferredMaintenanceWindow = reader.getString(); + } else if ("publiclyAccessible".equals(fieldName)) { + deserializedAwsRedshiftClusterProperties.publiclyAccessible + = reader.getNullable(JsonReader::getBoolean); + } else if ("resourceAction".equals(fieldName)) { + deserializedAwsRedshiftClusterProperties.resourceAction = reader.getString(); + } else if ("revisionTarget".equals(fieldName)) { + deserializedAwsRedshiftClusterProperties.revisionTarget = reader.getString(); + } else if ("rotateEncryptionKey".equals(fieldName)) { + deserializedAwsRedshiftClusterProperties.rotateEncryptionKey + = reader.getNullable(JsonReader::getBoolean); + } else if ("snapshotClusterIdentifier".equals(fieldName)) { + deserializedAwsRedshiftClusterProperties.snapshotClusterIdentifier = reader.getString(); + } else if ("snapshotCopyGrantName".equals(fieldName)) { + deserializedAwsRedshiftClusterProperties.snapshotCopyGrantName = reader.getString(); + } else if ("snapshotCopyManual".equals(fieldName)) { + deserializedAwsRedshiftClusterProperties.snapshotCopyManual + = reader.getNullable(JsonReader::getBoolean); + } else if ("snapshotCopyRetentionPeriod".equals(fieldName)) { + deserializedAwsRedshiftClusterProperties.snapshotCopyRetentionPeriod + = reader.getNullable(JsonReader::getInt); + } else if ("snapshotIdentifier".equals(fieldName)) { + deserializedAwsRedshiftClusterProperties.snapshotIdentifier = reader.getString(); + } else if ("tags".equals(fieldName)) { + List tags = reader.readArray(reader1 -> Tag.fromJson(reader1)); + deserializedAwsRedshiftClusterProperties.tags = tags; + } else if ("vpcSecurityGroupIds".equals(fieldName)) { + List vpcSecurityGroupIds = reader.readArray(reader1 -> reader1.getString()); + deserializedAwsRedshiftClusterProperties.vpcSecurityGroupIds = vpcSecurityGroupIds; + } else { + reader.skipChildren(); + } + } + + return deserializedAwsRedshiftClusterProperties; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/AwsRoute53DomainsDomainSummaryProperties.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/AwsRoute53DomainsDomainSummaryProperties.java new file mode 100644 index 000000000000..37b4115814bf --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/AwsRoute53DomainsDomainSummaryProperties.java @@ -0,0 +1,192 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.time.OffsetDateTime; +import java.time.format.DateTimeFormatter; + +/** + * Definition of awsRoute53DomainsDomainSummary. + */ +@Fluent +public final class AwsRoute53DomainsDomainSummaryProperties + implements JsonSerializable { + /* + *

Indicates whether the domain is automatically renewed upon expiration.

+ */ + private Boolean autoRenew; + + /* + *

The name of the domain that the summary information applies to.

+ */ + private String domainName; + + /* + *

Expiration date of the domain in Unix time format and Coordinated Universal Time (UTC).

+ */ + private OffsetDateTime expiry; + + /* + *

Indicates whether a domain is locked from unauthorized transfer to another party.

+ */ + private Boolean transferLock; + + /** + * Creates an instance of AwsRoute53DomainsDomainSummaryProperties class. + */ + public AwsRoute53DomainsDomainSummaryProperties() { + } + + /** + * Get the autoRenew property: <p>Indicates whether the domain is automatically renewed upon + * expiration.</p>. + * + * @return the autoRenew value. + */ + public Boolean autoRenew() { + return this.autoRenew; + } + + /** + * Set the autoRenew property: <p>Indicates whether the domain is automatically renewed upon + * expiration.</p>. + * + * @param autoRenew the autoRenew value to set. + * @return the AwsRoute53DomainsDomainSummaryProperties object itself. + */ + public AwsRoute53DomainsDomainSummaryProperties withAutoRenew(Boolean autoRenew) { + this.autoRenew = autoRenew; + return this; + } + + /** + * Get the domainName property: <p>The name of the domain that the summary information applies to.</p>. + * + * @return the domainName value. + */ + public String domainName() { + return this.domainName; + } + + /** + * Set the domainName property: <p>The name of the domain that the summary information applies to.</p>. + * + * @param domainName the domainName value to set. + * @return the AwsRoute53DomainsDomainSummaryProperties object itself. + */ + public AwsRoute53DomainsDomainSummaryProperties withDomainName(String domainName) { + this.domainName = domainName; + return this; + } + + /** + * Get the expiry property: <p>Expiration date of the domain in Unix time format and Coordinated Universal + * Time (UTC).</p>. + * + * @return the expiry value. + */ + public OffsetDateTime expiry() { + return this.expiry; + } + + /** + * Set the expiry property: <p>Expiration date of the domain in Unix time format and Coordinated Universal + * Time (UTC).</p>. + * + * @param expiry the expiry value to set. + * @return the AwsRoute53DomainsDomainSummaryProperties object itself. + */ + public AwsRoute53DomainsDomainSummaryProperties withExpiry(OffsetDateTime expiry) { + this.expiry = expiry; + return this; + } + + /** + * Get the transferLock property: <p>Indicates whether a domain is locked from unauthorized transfer to + * another party.</p>. + * + * @return the transferLock value. + */ + public Boolean transferLock() { + return this.transferLock; + } + + /** + * Set the transferLock property: <p>Indicates whether a domain is locked from unauthorized transfer to + * another party.</p>. + * + * @param transferLock the transferLock value to set. + * @return the AwsRoute53DomainsDomainSummaryProperties object itself. + */ + public AwsRoute53DomainsDomainSummaryProperties withTransferLock(Boolean transferLock) { + this.transferLock = transferLock; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeBooleanField("autoRenew", this.autoRenew); + jsonWriter.writeStringField("domainName", this.domainName); + jsonWriter.writeStringField("expiry", + this.expiry == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.expiry)); + jsonWriter.writeBooleanField("transferLock", this.transferLock); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AwsRoute53DomainsDomainSummaryProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AwsRoute53DomainsDomainSummaryProperties if the JsonReader was pointing to an instance of + * it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the AwsRoute53DomainsDomainSummaryProperties. + */ + public static AwsRoute53DomainsDomainSummaryProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AwsRoute53DomainsDomainSummaryProperties deserializedAwsRoute53DomainsDomainSummaryProperties + = new AwsRoute53DomainsDomainSummaryProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("autoRenew".equals(fieldName)) { + deserializedAwsRoute53DomainsDomainSummaryProperties.autoRenew + = reader.getNullable(JsonReader::getBoolean); + } else if ("domainName".equals(fieldName)) { + deserializedAwsRoute53DomainsDomainSummaryProperties.domainName = reader.getString(); + } else if ("expiry".equals(fieldName)) { + deserializedAwsRoute53DomainsDomainSummaryProperties.expiry = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("transferLock".equals(fieldName)) { + deserializedAwsRoute53DomainsDomainSummaryProperties.transferLock + = reader.getNullable(JsonReader::getBoolean); + } else { + reader.skipChildren(); + } + } + + return deserializedAwsRoute53DomainsDomainSummaryProperties; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/AwsRoute53HostedZoneProperties.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/AwsRoute53HostedZoneProperties.java new file mode 100644 index 000000000000..e1fe7e7849d3 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/AwsRoute53HostedZoneProperties.java @@ -0,0 +1,448 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Definition of awsRoute53HostedZone. + */ +@Fluent +public final class AwsRoute53HostedZoneProperties implements JsonSerializable { + /* + * A complex type that contains an optional comment. If you don't want to specify a comment, omit the + * ``HostedZoneConfig`` and ``Comment`` elements. A complex type that contains an optional comment about your hosted + * zone. If you don't want to specify a comment, omit both the ``HostedZoneConfig`` and ``Comment`` elements. + */ + private HostedZoneConfig hostedZoneConfig; + + /* + * Adds, edits, or deletes tags for a health check or a hosted zone. For information about using tags for cost + * allocation, see [Using Cost Allocation + * Tags](https://docs.aws.amazon.com/awsaccountbilling/latest/aboutv2/cost-alloc-tags.html) in the *User Guide*. + */ + private List hostedZoneTags; + + /* + * Property id + */ + private String id; + + /* + * The name of the domain. Specify a fully qualified domain name, for example, *www.example.com*. The trailing dot + * is optional; Amazon Route 53 assumes that the domain name is fully qualified. This means that Route 53 treats + * *www.example.com* (without a trailing dot) and *www.example.com.* (with a trailing dot) as identical. If you're + * creating a public hosted zone, this is the name you have registered with your DNS registrar. If your domain name + * is registered with a registrar other than Route 53, change the name servers for your domain to the set of + * ``NameServers`` that are returned by the ``Fn::GetAtt`` intrinsic function. + */ + private String name; + + /* + * Property nameServers + */ + private List nameServers; + + /* + * Creates a configuration for DNS query logging. After you create a query logging configuration, Amazon Route 53 + * begins to publish log data to an Amazon CloudWatch Logs log group. DNS query logs contain information about the + * queries that Route 53 receives for a specified public hosted zone, such as the following: + Route 53 edge + * location that responded to the DNS query + Domain or subdomain that was requested + DNS record type, such as A or + * AAAA + DNS response code, such as ``NoError`` or ``ServFail`` + Log Group and Resource Policy Before you create a + * query logging configuration, perform the following operations. If you create a query logging configuration using + * the Route 53 console, Route 53 performs these operations automatically. Create a CloudWatch Logs log group, and + * make note of the ARN, which you specify when you create a query logging configuration. Note the following: You + * must create the log group in the us-east-1 region. You must use the same to create the log group and the hosted + * zone that you want to configure query logging for. When you create log groups for query logging, we recommend + * that you use a consistent prefix, for example: /aws/route53/hosted zone name In the next step, you'll create a + * resource policy, which controls access to one or more log groups and the associated resources, such as Route 53 + * hosted zones. There's a limit on the number of resource policies that you can create, so we recommend that you + * use a consistent prefix so you can use the same resource policy for all the log groups that you create for query + * logging. Create a CloudWatch Logs resource policy, and give it the permissions that Route 53 needs to create log + * streams and to send query logs to log streams. For the value of Resource, specify the ARN for the log group that + * you created in the previous step. To use the same resource policy for all the CloudWatch Logs log groups that you + * created for query logging configurations, replace the hosted zone name with *, for example: + * arn:aws:logs:us-east-1:123412341234:log-group:/aws/route53/* To avoid the confused deputy problem, a security + * issue where an entity without a permission for an action can coerce a more-privileged entity to perform it, you + * can optionally limit the permissions that a service has to a resource in a resource-based policy by supplying the + * following values: For aws:SourceArn, supply the hosted zone ARN used in creating the query logging configuration. + * For example, aws:SourceArn: arn:aws:route53:::hostedzone/hosted zone ID. For aws:SourceAccount, supply the + * account ID for the account that creates the query logging configuration. For example, + * aws:SourceAccount:111111111111. For more information, see The confused deputy problem in the IAM User Guide. You + * can't use the CloudWatch console to create or edit a resource policy. You must use the CloudWatch API, one of the + * SDKs, or the . + Log Streams and Edge Locations When Route 53 finishes creating the configuration for DNS query + * logging, it does the following: Creates a log stream for an edge location the first time that the edge location + * responds to DNS queries for the specified hosted zone. That log stream is used to log all queries that Route 53 + * responds to for that edge location. Begins to send query logs to the applicable log stream. The name of each log + * stream is in the following format: hosted zone ID/edge location code The edge location code is a three-letter + * code and an arbitrarily assigned number, for example, DFW3. The three-letter code typically corresponds with the + * International Air Transport Association airport code for an airport near the edge location. (These abbreviations + * might change in the future.) For a list of edge locations, see 'The Route 53 Global Network' on the Route 53 + * Product Details page. + Queries That Are Logged Query logs contain only the queries that DNS resolvers forward to + * Route 53. If a DNS resolver has already cached the response to a query (such as the IP address for a load + * balancer for example.com), the resolver will continue to return the cached response. It doesn't forward another + * query to Route 53 until the TTL for the corresponding resource record set expires. Depending on how many DNS + * queries are submitted for a resource record set, and depending on the TTL for that resource record set, query + * logs might contain information about only one query out of every several thousand queries that are submitted to + * DNS. For more information about how DNS works, see Routing Internet Traffic to Your Website or Web Application in + * the Amazon Route 53 Developer Guide. + Log File Format For a list of the values in each query log and the format + * of each value, see Logging DNS Queries in the Amazon Route 53 Developer Guide. + Pricing For information about + * charges for query logs, see Amazon CloudWatch Pricing. + How to Stop Logging If you want Route 53 to stop sending + * query logs to CloudWatch Logs, delete the query logging configuration. For more information, see + * DeleteQueryLoggingConfig. A complex type that contains information about a configuration for DNS query logging. + */ + private QueryLoggingConfig queryLoggingConfig; + + /* + * *Private hosted zones:* A complex type that contains information about the VPCs that are associated with the + * specified hosted zone. For public hosted zones, omit ``VPCs``, ``VPCId``, and ``VPCRegion``. + */ + private List vpCs; + + /** + * Creates an instance of AwsRoute53HostedZoneProperties class. + */ + public AwsRoute53HostedZoneProperties() { + } + + /** + * Get the hostedZoneConfig property: A complex type that contains an optional comment. If you don't want to specify + * a comment, omit the ``HostedZoneConfig`` and ``Comment`` elements. A complex type that contains an optional + * comment about your hosted zone. If you don't want to specify a comment, omit both the ``HostedZoneConfig`` and + * ``Comment`` elements. + * + * @return the hostedZoneConfig value. + */ + public HostedZoneConfig hostedZoneConfig() { + return this.hostedZoneConfig; + } + + /** + * Set the hostedZoneConfig property: A complex type that contains an optional comment. If you don't want to specify + * a comment, omit the ``HostedZoneConfig`` and ``Comment`` elements. A complex type that contains an optional + * comment about your hosted zone. If you don't want to specify a comment, omit both the ``HostedZoneConfig`` and + * ``Comment`` elements. + * + * @param hostedZoneConfig the hostedZoneConfig value to set. + * @return the AwsRoute53HostedZoneProperties object itself. + */ + public AwsRoute53HostedZoneProperties withHostedZoneConfig(HostedZoneConfig hostedZoneConfig) { + this.hostedZoneConfig = hostedZoneConfig; + return this; + } + + /** + * Get the hostedZoneTags property: Adds, edits, or deletes tags for a health check or a hosted zone. For + * information about using tags for cost allocation, see [Using Cost Allocation + * Tags](https://docs.aws.amazon.com/awsaccountbilling/latest/aboutv2/cost-alloc-tags.html) in the *User Guide*. + * + * @return the hostedZoneTags value. + */ + public List hostedZoneTags() { + return this.hostedZoneTags; + } + + /** + * Set the hostedZoneTags property: Adds, edits, or deletes tags for a health check or a hosted zone. For + * information about using tags for cost allocation, see [Using Cost Allocation + * Tags](https://docs.aws.amazon.com/awsaccountbilling/latest/aboutv2/cost-alloc-tags.html) in the *User Guide*. + * + * @param hostedZoneTags the hostedZoneTags value to set. + * @return the AwsRoute53HostedZoneProperties object itself. + */ + public AwsRoute53HostedZoneProperties withHostedZoneTags(List hostedZoneTags) { + this.hostedZoneTags = hostedZoneTags; + return this; + } + + /** + * Get the id property: Property id. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Set the id property: Property id. + * + * @param id the id value to set. + * @return the AwsRoute53HostedZoneProperties object itself. + */ + public AwsRoute53HostedZoneProperties withId(String id) { + this.id = id; + return this; + } + + /** + * Get the name property: The name of the domain. Specify a fully qualified domain name, for example, + * *www.example.com*. The trailing dot is optional; Amazon Route 53 assumes that the domain name is fully qualified. + * This means that Route 53 treats *www.example.com* (without a trailing dot) and *www.example.com.* (with a + * trailing dot) as identical. If you're creating a public hosted zone, this is the name you have registered with + * your DNS registrar. If your domain name is registered with a registrar other than Route 53, change the name + * servers for your domain to the set of ``NameServers`` that are returned by the ``Fn::GetAtt`` intrinsic function. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: The name of the domain. Specify a fully qualified domain name, for example, + * *www.example.com*. The trailing dot is optional; Amazon Route 53 assumes that the domain name is fully qualified. + * This means that Route 53 treats *www.example.com* (without a trailing dot) and *www.example.com.* (with a + * trailing dot) as identical. If you're creating a public hosted zone, this is the name you have registered with + * your DNS registrar. If your domain name is registered with a registrar other than Route 53, change the name + * servers for your domain to the set of ``NameServers`` that are returned by the ``Fn::GetAtt`` intrinsic function. + * + * @param name the name value to set. + * @return the AwsRoute53HostedZoneProperties object itself. + */ + public AwsRoute53HostedZoneProperties withName(String name) { + this.name = name; + return this; + } + + /** + * Get the nameServers property: Property nameServers. + * + * @return the nameServers value. + */ + public List nameServers() { + return this.nameServers; + } + + /** + * Set the nameServers property: Property nameServers. + * + * @param nameServers the nameServers value to set. + * @return the AwsRoute53HostedZoneProperties object itself. + */ + public AwsRoute53HostedZoneProperties withNameServers(List nameServers) { + this.nameServers = nameServers; + return this; + } + + /** + * Get the queryLoggingConfig property: Creates a configuration for DNS query logging. After you create a query + * logging configuration, Amazon Route 53 begins to publish log data to an Amazon CloudWatch Logs log group. DNS + * query logs contain information about the queries that Route 53 receives for a specified public hosted zone, such + * as the following: + Route 53 edge location that responded to the DNS query + Domain or subdomain that was + * requested + DNS record type, such as A or AAAA + DNS response code, such as ``NoError`` or ``ServFail`` + Log + * Group and Resource Policy Before you create a query logging configuration, perform the following operations. If + * you create a query logging configuration using the Route 53 console, Route 53 performs these operations + * automatically. Create a CloudWatch Logs log group, and make note of the ARN, which you specify when you create a + * query logging configuration. Note the following: You must create the log group in the us-east-1 region. You must + * use the same to create the log group and the hosted zone that you want to configure query logging for. When you + * create log groups for query logging, we recommend that you use a consistent prefix, for example: + * /aws/route53/hosted zone name In the next step, you'll create a resource policy, which controls access to one or + * more log groups and the associated resources, such as Route 53 hosted zones. There's a limit on the number of + * resource policies that you can create, so we recommend that you use a consistent prefix so you can use the same + * resource policy for all the log groups that you create for query logging. Create a CloudWatch Logs resource + * policy, and give it the permissions that Route 53 needs to create log streams and to send query logs to log + * streams. For the value of Resource, specify the ARN for the log group that you created in the previous step. To + * use the same resource policy for all the CloudWatch Logs log groups that you created for query logging + * configurations, replace the hosted zone name with *, for example: + * arn:aws:logs:us-east-1:123412341234:log-group:/aws/route53/* To avoid the confused deputy problem, a security + * issue where an entity without a permission for an action can coerce a more-privileged entity to perform it, you + * can optionally limit the permissions that a service has to a resource in a resource-based policy by supplying the + * following values: For aws:SourceArn, supply the hosted zone ARN used in creating the query logging configuration. + * For example, aws:SourceArn: arn:aws:route53:::hostedzone/hosted zone ID. For aws:SourceAccount, supply the + * account ID for the account that creates the query logging configuration. For example, + * aws:SourceAccount:111111111111. For more information, see The confused deputy problem in the IAM User Guide. You + * can't use the CloudWatch console to create or edit a resource policy. You must use the CloudWatch API, one of the + * SDKs, or the . + Log Streams and Edge Locations When Route 53 finishes creating the configuration for DNS query + * logging, it does the following: Creates a log stream for an edge location the first time that the edge location + * responds to DNS queries for the specified hosted zone. That log stream is used to log all queries that Route 53 + * responds to for that edge location. Begins to send query logs to the applicable log stream. The name of each log + * stream is in the following format: hosted zone ID/edge location code The edge location code is a three-letter + * code and an arbitrarily assigned number, for example, DFW3. The three-letter code typically corresponds with the + * International Air Transport Association airport code for an airport near the edge location. (These abbreviations + * might change in the future.) For a list of edge locations, see 'The Route 53 Global Network' on the Route 53 + * Product Details page. + Queries That Are Logged Query logs contain only the queries that DNS resolvers forward to + * Route 53. If a DNS resolver has already cached the response to a query (such as the IP address for a load + * balancer for example.com), the resolver will continue to return the cached response. It doesn't forward another + * query to Route 53 until the TTL for the corresponding resource record set expires. Depending on how many DNS + * queries are submitted for a resource record set, and depending on the TTL for that resource record set, query + * logs might contain information about only one query out of every several thousand queries that are submitted to + * DNS. For more information about how DNS works, see Routing Internet Traffic to Your Website or Web Application in + * the Amazon Route 53 Developer Guide. + Log File Format For a list of the values in each query log and the format + * of each value, see Logging DNS Queries in the Amazon Route 53 Developer Guide. + Pricing For information about + * charges for query logs, see Amazon CloudWatch Pricing. + How to Stop Logging If you want Route 53 to stop sending + * query logs to CloudWatch Logs, delete the query logging configuration. For more information, see + * DeleteQueryLoggingConfig. A complex type that contains information about a configuration for DNS query logging. + * + * @return the queryLoggingConfig value. + */ + public QueryLoggingConfig queryLoggingConfig() { + return this.queryLoggingConfig; + } + + /** + * Set the queryLoggingConfig property: Creates a configuration for DNS query logging. After you create a query + * logging configuration, Amazon Route 53 begins to publish log data to an Amazon CloudWatch Logs log group. DNS + * query logs contain information about the queries that Route 53 receives for a specified public hosted zone, such + * as the following: + Route 53 edge location that responded to the DNS query + Domain or subdomain that was + * requested + DNS record type, such as A or AAAA + DNS response code, such as ``NoError`` or ``ServFail`` + Log + * Group and Resource Policy Before you create a query logging configuration, perform the following operations. If + * you create a query logging configuration using the Route 53 console, Route 53 performs these operations + * automatically. Create a CloudWatch Logs log group, and make note of the ARN, which you specify when you create a + * query logging configuration. Note the following: You must create the log group in the us-east-1 region. You must + * use the same to create the log group and the hosted zone that you want to configure query logging for. When you + * create log groups for query logging, we recommend that you use a consistent prefix, for example: + * /aws/route53/hosted zone name In the next step, you'll create a resource policy, which controls access to one or + * more log groups and the associated resources, such as Route 53 hosted zones. There's a limit on the number of + * resource policies that you can create, so we recommend that you use a consistent prefix so you can use the same + * resource policy for all the log groups that you create for query logging. Create a CloudWatch Logs resource + * policy, and give it the permissions that Route 53 needs to create log streams and to send query logs to log + * streams. For the value of Resource, specify the ARN for the log group that you created in the previous step. To + * use the same resource policy for all the CloudWatch Logs log groups that you created for query logging + * configurations, replace the hosted zone name with *, for example: + * arn:aws:logs:us-east-1:123412341234:log-group:/aws/route53/* To avoid the confused deputy problem, a security + * issue where an entity without a permission for an action can coerce a more-privileged entity to perform it, you + * can optionally limit the permissions that a service has to a resource in a resource-based policy by supplying the + * following values: For aws:SourceArn, supply the hosted zone ARN used in creating the query logging configuration. + * For example, aws:SourceArn: arn:aws:route53:::hostedzone/hosted zone ID. For aws:SourceAccount, supply the + * account ID for the account that creates the query logging configuration. For example, + * aws:SourceAccount:111111111111. For more information, see The confused deputy problem in the IAM User Guide. You + * can't use the CloudWatch console to create or edit a resource policy. You must use the CloudWatch API, one of the + * SDKs, or the . + Log Streams and Edge Locations When Route 53 finishes creating the configuration for DNS query + * logging, it does the following: Creates a log stream for an edge location the first time that the edge location + * responds to DNS queries for the specified hosted zone. That log stream is used to log all queries that Route 53 + * responds to for that edge location. Begins to send query logs to the applicable log stream. The name of each log + * stream is in the following format: hosted zone ID/edge location code The edge location code is a three-letter + * code and an arbitrarily assigned number, for example, DFW3. The three-letter code typically corresponds with the + * International Air Transport Association airport code for an airport near the edge location. (These abbreviations + * might change in the future.) For a list of edge locations, see 'The Route 53 Global Network' on the Route 53 + * Product Details page. + Queries That Are Logged Query logs contain only the queries that DNS resolvers forward to + * Route 53. If a DNS resolver has already cached the response to a query (such as the IP address for a load + * balancer for example.com), the resolver will continue to return the cached response. It doesn't forward another + * query to Route 53 until the TTL for the corresponding resource record set expires. Depending on how many DNS + * queries are submitted for a resource record set, and depending on the TTL for that resource record set, query + * logs might contain information about only one query out of every several thousand queries that are submitted to + * DNS. For more information about how DNS works, see Routing Internet Traffic to Your Website or Web Application in + * the Amazon Route 53 Developer Guide. + Log File Format For a list of the values in each query log and the format + * of each value, see Logging DNS Queries in the Amazon Route 53 Developer Guide. + Pricing For information about + * charges for query logs, see Amazon CloudWatch Pricing. + How to Stop Logging If you want Route 53 to stop sending + * query logs to CloudWatch Logs, delete the query logging configuration. For more information, see + * DeleteQueryLoggingConfig. A complex type that contains information about a configuration for DNS query logging. + * + * @param queryLoggingConfig the queryLoggingConfig value to set. + * @return the AwsRoute53HostedZoneProperties object itself. + */ + public AwsRoute53HostedZoneProperties withQueryLoggingConfig(QueryLoggingConfig queryLoggingConfig) { + this.queryLoggingConfig = queryLoggingConfig; + return this; + } + + /** + * Get the vpCs property: *Private hosted zones:* A complex type that contains information about the VPCs that are + * associated with the specified hosted zone. For public hosted zones, omit ``VPCs``, ``VPCId``, and ``VPCRegion``. + * + * @return the vpCs value. + */ + public List vpCs() { + return this.vpCs; + } + + /** + * Set the vpCs property: *Private hosted zones:* A complex type that contains information about the VPCs that are + * associated with the specified hosted zone. For public hosted zones, omit ``VPCs``, ``VPCId``, and ``VPCRegion``. + * + * @param vpCs the vpCs value to set. + * @return the AwsRoute53HostedZoneProperties object itself. + */ + public AwsRoute53HostedZoneProperties withVpCs(List vpCs) { + this.vpCs = vpCs; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (hostedZoneConfig() != null) { + hostedZoneConfig().validate(); + } + if (hostedZoneTags() != null) { + hostedZoneTags().forEach(e -> e.validate()); + } + if (queryLoggingConfig() != null) { + queryLoggingConfig().validate(); + } + if (vpCs() != null) { + vpCs().forEach(e -> e.validate()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("hostedZoneConfig", this.hostedZoneConfig); + jsonWriter.writeArrayField("hostedZoneTags", this.hostedZoneTags, + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("id", this.id); + jsonWriter.writeStringField("name", this.name); + jsonWriter.writeArrayField("nameServers", this.nameServers, (writer, element) -> writer.writeString(element)); + jsonWriter.writeJsonField("queryLoggingConfig", this.queryLoggingConfig); + jsonWriter.writeArrayField("vpCs", this.vpCs, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AwsRoute53HostedZoneProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AwsRoute53HostedZoneProperties if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the AwsRoute53HostedZoneProperties. + */ + public static AwsRoute53HostedZoneProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AwsRoute53HostedZoneProperties deserializedAwsRoute53HostedZoneProperties + = new AwsRoute53HostedZoneProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("hostedZoneConfig".equals(fieldName)) { + deserializedAwsRoute53HostedZoneProperties.hostedZoneConfig = HostedZoneConfig.fromJson(reader); + } else if ("hostedZoneTags".equals(fieldName)) { + List hostedZoneTags = reader.readArray(reader1 -> HostedZoneTag.fromJson(reader1)); + deserializedAwsRoute53HostedZoneProperties.hostedZoneTags = hostedZoneTags; + } else if ("id".equals(fieldName)) { + deserializedAwsRoute53HostedZoneProperties.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedAwsRoute53HostedZoneProperties.name = reader.getString(); + } else if ("nameServers".equals(fieldName)) { + List nameServers = reader.readArray(reader1 -> reader1.getString()); + deserializedAwsRoute53HostedZoneProperties.nameServers = nameServers; + } else if ("queryLoggingConfig".equals(fieldName)) { + deserializedAwsRoute53HostedZoneProperties.queryLoggingConfig = QueryLoggingConfig.fromJson(reader); + } else if ("vpCs".equals(fieldName)) { + List vpCs = reader.readArray(reader1 -> Vpc.fromJson(reader1)); + deserializedAwsRoute53HostedZoneProperties.vpCs = vpCs; + } else { + reader.skipChildren(); + } + } + + return deserializedAwsRoute53HostedZoneProperties; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/AwsRoute53ResourceRecordSetProperties.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/AwsRoute53ResourceRecordSetProperties.java new file mode 100644 index 000000000000..c74b57a0a7cc --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/AwsRoute53ResourceRecordSetProperties.java @@ -0,0 +1,1249 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Definition of awsRoute53ResourceRecordSet. + */ +@Fluent +public final class AwsRoute53ResourceRecordSetProperties + implements JsonSerializable { + /* + *

Alias resource record sets only: Information about the Amazon Web Services resource, such as a + * CloudFront distribution or an Amazon S3 bucket, that you want to route traffic to.

If you're creating + * resource records sets for a private hosted zone, note the following:

  • You can't create an alias + * resource record set in a private hosted zone to route traffic to a CloudFront distribution.

  • For + * information about creating failover resource record sets in a private hosted zone, see + * Configuring Failover in a Private Hosted Zone in the Amazon Route 53 Developer Guide.

+ */ + private AliasTarget aliasTarget; + + /* + * Property cidrRoutingConfig + */ + private CidrRoutingConfig cidrRoutingConfig; + + /* + *

Failover resource record sets only: To configure failover, you add the Failover element + * to two resource record sets. For one resource record set, you specify PRIMARY as the value for + * Failover; for the other resource record set, you specify SECONDARY. In addition, you + * include the HealthCheckId element and specify the health check that you want Amazon Route 53 to + * perform for each resource record set.

Except where noted, the following failover behaviors assume that you + * have included the HealthCheckId element in both resource record sets:

  • When the + * primary resource record set is healthy, Route 53 responds to DNS queries with the applicable value from the + * primary resource record set regardless of the health of the secondary resource record set.

  • When + * the primary resource record set is unhealthy and the secondary resource record set is healthy, Route 53 responds + * to DNS queries with the applicable value from the secondary resource record set.

  • When the + * secondary resource record set is unhealthy, Route 53 responds to DNS queries with the applicable value from the + * primary resource record set regardless of the health of the primary resource record set.

  • If you + * omit the HealthCheckId element for the secondary resource record set, and if the primary resource + * record set is unhealthy, Route 53 always responds to DNS queries with the applicable value from the secondary + * resource record set. This is true regardless of the health of the associated endpoint.

You + * can't create non-failover resource record sets that have the same values for the Name and + * Type elements as failover resource record sets.

For failover alias resource record sets, you + * must also include the EvaluateTargetHealth element and set the value to true.

For more + * information about configuring failover for Route 53, see the following topics in the Amazon Route 53 Developer + * Guide:

+ */ + private ResourceRecordSetFailoverEnumValue failover; + + /* + *

Geolocation resource record sets only: A complex type that lets you control how Amazon Route 53 + * responds to DNS queries based on the geographic origin of the query. For example, if you want all queries from + * Africa to be routed to a web server with an IP address of 192.0.2.111, create a resource record set + * with a Type of A and a ContinentCode of AF.

If you + * create separate resource record sets for overlapping geographic regions (for example, one resource record set for + * a continent and one for a country on the same continent), priority goes to the smallest geographic region. This + * allows you to route most queries for a continent to one resource and to route queries for a country on that + * continent to a different resource.

You can't create two geolocation resource record sets that specify the + * same geographic location.

The value * in the CountryCode element matches all + * geographic locations that aren't specified in other geolocation resource record sets that have the same values + * for the Name and Type elements.

Geolocation works by mapping IP + * addresses to locations. However, some IP addresses aren't mapped to geographic locations, so even if you create + * geolocation resource record sets that cover all seven continents, Route 53 will receive some DNS queries from + * locations that it can't identify. We recommend that you create a resource record set for which the value of + * CountryCode is *. Two groups of queries are routed to the resource that you specify in + * this record: queries that come from locations for which you haven't created geolocation resource record sets and + * queries from IP addresses that aren't mapped to a location. If you don't create a * resource record + * set, Route 53 returns a 'no answer' response for queries from those locations.

You can't + * create non-geolocation resource record sets that have the same values for the Name and + * Type elements as geolocation resource record sets.

+ */ + private GeoLocation geoLocation; + + /* + *

GeoproximityLocation resource record sets only: A complex type that lets you control how Route 53 + * responds to DNS queries based on the geographic origin of the query and your resources.

+ */ + private GeoProximityLocation geoProximityLocation; + + /* + *

If you want Amazon Route 53 to return this resource record set in response to a DNS query only when the status + * of a health check is healthy, include the HealthCheckId element and specify the ID of the applicable + * health check.

Route 53 determines whether a resource record set is healthy based on one of the + * following:

  • By periodically sending a request to the endpoint that is specified in the health + * check

  • By aggregating the status of a specified group of health checks (calculated health + * checks)

  • By determining the current state of a CloudWatch alarm (CloudWatch metric health + * checks)

Route 53 doesn't check the health of the endpoint that is specified in the + * resource record set, for example, the endpoint specified by the IP address in the Value element. + * When you add a HealthCheckId element to a resource record set, Route 53 checks the health of the + * endpoint that you specified in the health check.

For more information, see the following + * topics in the Amazon Route 53 Developer Guide:

When to Specify HealthCheckId

+ *

Specifying a value for HealthCheckId is useful only when Route 53 is choosing between two or more + * resource record sets to respond to a DNS query, and you want Route 53 to base the choice in part on the status of + * a health check. Configuring health checks makes sense only in the following configurations:

  • + * Non-alias resource record sets: You're checking the health of a group of non-alias resource record sets + * that have the same routing policy, name, and type (such as multiple weighted records named www.example.com with a + * type of A) and you specify health check IDs for all the resource record sets.

    If the health check status + * for a resource record set is healthy, Route 53 includes the record among the records that it responds to DNS + * queries with.

    If the health check status for a resource record set is unhealthy, Route 53 stops responding + * to DNS queries using the value for that resource record set.

    If the health check status for all resource + * record sets in the group is unhealthy, Route 53 considers all resource record sets in the group healthy and + * responds to DNS queries accordingly.

  • Alias resource record sets: You specify the + * following settings:

    • You set EvaluateTargetHealth to true for an alias resource + * record set in a group of resource record sets that have the same routing policy, name, and type (such as multiple + * weighted records named www.example.com with a type of A).

    • You configure the alias resource + * record set to route traffic to a non-alias resource record set in the same hosted zone.

    • You + * specify a health check ID for the non-alias resource record set.

    If the health check status + * is healthy, Route 53 considers the alias resource record set to be healthy and includes the alias record among + * the records that it responds to DNS queries with.

    If the health check status is unhealthy, Route 53 stops + * responding to DNS queries using the alias resource record set.

    The alias resource record set can + * also route traffic to a group of non-alias resource record sets that have the same routing policy, name, + * and type. In that configuration, associate health checks with all of the resource record sets in the group of + * non-alias resource record sets.

Geolocation Routing

For geolocation + * resource record sets, if an endpoint is unhealthy, Route 53 looks for a resource record set for the larger, + * associated geographic region. For example, suppose you have resource record sets for a state in the United + * States, for the entire United States, for North America, and a resource record set that has * for + * CountryCode is *, which applies to all locations. If the endpoint for the state + * resource record set is unhealthy, Route 53 checks for healthy resource record sets in the following order until + * it finds a resource record set for which the endpoint is healthy:

  • The United States

  • + *
  • North America

  • The default resource record set

Specifying the + * Health Check Endpoint by Domain Name

If your health checks specify the endpoint only by domain name, + * we recommend that you create a separate health check for each endpoint. For example, create a health check for + * each HTTP server that is serving content for www.example.com. For the value of + * FullyQualifiedDomainName, specify the domain name of the server (such as + * us-east-2-www.example.com), not the name of the resource record sets + * (www.example.com).

Health check results will be unpredictable if you do the + * following:

  • Create a health check that has the same value for + * FullyQualifiedDomainName as the name of a resource record set.

  • Associate that + * health check with the resource record set.

+ */ + private String healthCheckId; + + /* + *

Multivalue answer resource record sets only: To route traffic approximately randomly to multiple + * resources, such as web servers, create one multivalue answer record for each resource and specify + * true for MultiValueAnswer. Note the following:

  • If you associate a + * health check with a multivalue answer resource record set, Amazon Route 53 responds to DNS queries with the + * corresponding IP address only when the health check is healthy.

  • If you don't associate a health + * check with a multivalue answer record, Route 53 always considers the record to be healthy.

  • + *

    Route 53 responds to DNS queries with up to eight healthy records; if you have eight or fewer healthy records, + * Route 53 responds to all DNS queries with all the healthy records.

  • If you have more than eight + * healthy records, Route 53 responds to different DNS resolvers with different combinations of healthy records.

    + *
  • When all records are unhealthy, Route 53 responds to DNS queries with up to eight unhealthy + * records.

  • If a resource becomes unavailable after a resolver caches a response, client software + * typically tries another of the IP addresses in the response.

You can't create multivalue + * answer alias records.

+ */ + private Boolean multiValueAnswer; + + /* + *

For ChangeResourceRecordSets requests, the name of the record that you want to create, update, or + * delete. For ListResourceRecordSets responses, the name of a record in the specified hosted zone.

+ *

ChangeResourceRecordSets Only

Enter a fully qualified domain name, for example, + * www.example.com. You can optionally include a trailing dot. If you omit the trailing dot, Amazon + * Route 53 assumes that the domain name that you specify is fully qualified. This means that Route 53 treats + * www.example.com (without a trailing dot) and www.example.com. (with a trailing dot) as + * identical.

For information about how to specify characters other than a-z, 0-9, + * and - (hyphen) and how to specify internationalized domain names, see DNS Domain Name Format + * in the Amazon Route 53 Developer Guide.

You can use the asterisk (*) wildcard to replace the + * leftmost label in a domain name, for example, *.example.com. Note the following:

  • + *

    The * must replace the entire label. For example, you can't specify *prod.example.com or + * prod*.example.com.

  • The * can't replace any of the middle labels, for example, + * marketing.*.example.com.

  • If you include * in any position other than the leftmost label in a + * domain name, DNS treats it as an * character (ASCII 42), not as a wildcard.

    You can't use the + * * wildcard for resource records sets that have a type of NS.

+ */ + private String name; + + /* + *

Latency-based resource record sets only: The Amazon EC2 Region where you created the resource that + * this resource record set refers to. The resource typically is an Amazon Web Services resource, such as an EC2 + * instance or an ELB load balancer, and is referred to by an IP address or a DNS domain name, depending on the + * record type.

When Amazon Route 53 receives a DNS query for a domain name and type for which you have + * created latency resource record sets, Route 53 selects the latency resource record set that has the lowest + * latency between the end user and the associated Amazon EC2 Region. Route 53 then returns the value that is + * associated with the selected resource record set.

Note the following:

  • You can only + * specify one ResourceRecord per latency resource record set.

  • You can only create + * one latency resource record set for each Amazon EC2 Region.

  • You aren't required to create + * latency resource record sets for all Amazon EC2 Regions. Route 53 will choose the region with the best latency + * from among the regions that you create latency resource record sets for.

  • You can't create + * non-latency resource record sets that have the same values for the Name and Type + * elements as latency resource record sets.

+ */ + private ResourceRecordSetRegionEnumValue region; + + /* + *

Information about the resource records to act upon.

If you're creating an alias resource record + * set, omit ResourceRecords.

+ */ + private List resourceRecords; + + /* + *

Resource record sets that have a routing policy other than simple: An identifier that differentiates + * among multiple resource record sets that have the same combination of name and type, such as multiple weighted + * resource record sets named acme.example.com that have a type of A. In a group of resource record sets that have + * the same name and type, the value of SetIdentifier must be unique for each resource record set.

+ *

For information about routing policies, see Choosing a Routing + * Policy in the Amazon Route 53 Developer Guide.

+ */ + private String setIdentifier; + + /* + *

The resource record cache time to live (TTL), in seconds. Note the following:

  • If you're + * creating or updating an alias resource record set, omit TTL. Amazon Route 53 uses the value of + * TTL for the alias target.

  • If you're associating this resource record set with a + * health check (if you're adding a HealthCheckId element), we recommend that you specify a + * TTL of 60 seconds or less so clients respond quickly to changes in health status.

  • + *

    All of the resource record sets in a group of weighted resource record sets must have the same value for + * TTL.

  • If a group of weighted resource record sets includes one or more weighted + * alias resource record sets for which the alias target is an ELB load balancer, we recommend that you specify a + * TTL of 60 seconds for all of the non-alias weighted resource record sets that have the same name and + * type. Values other than 60 seconds (the TTL for load balancers) will change the effect of the values that you + * specify for Weight.

+ */ + private Long ttl; + + /* + *

When you create a traffic policy instance, Amazon Route 53 automatically creates a resource record set. + * TrafficPolicyInstanceId is the ID of the traffic policy instance that Route 53 created this resource + * record set for.

To delete the resource record set that is associated with a traffic policy + * instance, use DeleteTrafficPolicyInstance. Route 53 will delete the resource record set + * automatically. If you delete the resource record set by using ChangeResourceRecordSets, Route 53 + * doesn't automatically delete the traffic policy instance, and you'll continue to be charged for it even though + * it's no longer in use.

+ */ + private String trafficPolicyInstanceId; + + /* + *

The DNS record type. For information about different record types and how data is encoded for them, see Supported DNS Resource + * Record Types in the Amazon Route 53 Developer Guide.

Valid values for basic resource record + * sets: A | AAAA | CAA | CNAME | DS + * |MX | NAPTR | NS | PTR | SOA | SPF + * | SRV | TXT

Values for weighted, latency, geolocation, and failover resource + * record sets: A | AAAA | CAA | CNAME | MX | + * NAPTR | PTR | SPF | SRV | TXT. When creating a + * group of weighted, latency, geolocation, or failover resource record sets, specify the same value for all of the + * resource record sets in the group.

Valid values for multivalue answer resource record sets: A + * | AAAA | MX | NAPTR | PTR | SPF | + * SRV | TXT

SPF records were formerly used to verify the identity of the + * sender of email messages. However, we no longer recommend that you create resource record sets for which the + * value of Type is SPF. RFC 7208, Sender Policy Framework (SPF) for Authorizing Use of + * Domains in Email, Version 1, has been updated to say, '...[I]ts existence and mechanism defined in [RFC4408] + * have led to some interoperability issues. Accordingly, its use is no longer appropriate for SPF version 1; + * implementations are not to use it.' In RFC 7208, see section 14.1, The SPF DNS Record Type.

Values for + * alias resource record sets:

  • Amazon API Gateway custom regional APIs and edge-optimized + * APIs: A

  • CloudFront distributions: A

    If IPv6 is + * enabled for the distribution, create two resource record sets to route traffic to your distribution, one with a + * value of A and one with a value of AAAA.

  • Amazon API Gateway + * environment that has a regionalized subdomain: A

  • ELB load balancers: + * A | AAAA

  • Amazon S3 buckets: A

  • + *

    Amazon Virtual Private Cloud interface VPC endpoints A

  • Another + * resource record set in this hosted zone: Specify the type of the resource record set that you're creating the + * alias for. All values are supported except NS and SOA.

    If you're creating + * an alias record that has the same name as the hosted zone (known as the zone apex), you can't route traffic to a + * record for which the value of Type is CNAME. This is because the alias record must have + * the same type as the record you're routing traffic to, and creating a CNAME record for the zone apex isn't + * supported even for an alias record.

+ */ + private RRTypeEnumValue type; + + /* + *

Weighted resource record sets only: Among resource record sets that have the same combination of DNS + * name and type, a value that determines the proportion of DNS queries that Amazon Route 53 responds to using the + * current resource record set. Route 53 calculates the sum of the weights for the resource record sets that have + * the same combination of DNS name and type. Route 53 then responds to queries based on the ratio of a resource's + * weight to the total. Note the following:

  • You must specify a value for the Weight + * element for every weighted resource record set.

  • You can only specify one + * ResourceRecord per weighted resource record set.

  • You can't create latency, + * failover, or geolocation resource record sets that have the same values for the Name and + * Type elements as weighted resource record sets.

  • You can create a maximum of 100 + * weighted resource record sets that have the same values for the Name and Type + * elements.

  • For weighted (but not weighted alias) resource record sets, if you set + * Weight to 0 for a resource record set, Route 53 never responds to queries with the + * applicable value for that resource record set. However, if you set Weight to 0 for all + * resource record sets that have the same combination of DNS name and type, traffic is routed to all resources with + * equal probability.

    The effect of setting Weight to 0 is different when you + * associate health checks with weighted resource record sets. For more information, see Options + * for Configuring Route 53 Active-Active and Active-Passive Failover in the Amazon Route 53 Developer + * Guide.

+ */ + private Long weight; + + /** + * Creates an instance of AwsRoute53ResourceRecordSetProperties class. + */ + public AwsRoute53ResourceRecordSetProperties() { + } + + /** + * Get the aliasTarget property: <p> <i>Alias resource record sets only:</i> Information about the + * Amazon Web Services resource, such as a CloudFront distribution or an Amazon S3 bucket, that you want to route + * traffic to. </p> <p>If you're creating resource records sets for a private hosted zone, note the + * following:</p> <ul> <li> <p>You can't create an alias resource record set in a private + * hosted zone to route traffic to a CloudFront distribution.</p> </li> <li> <p>For + * information about creating failover resource record sets in a private hosted zone, see <a + * href='https://docs.aws.amazon.com/Route53/latest/DeveloperGuide/dns-failover-private-hosted-zones.html'>Configuring + * Failover in a Private Hosted Zone</a> in the <i>Amazon Route 53 Developer Guide</i>.</p> + * </li> </ul>. + * + * @return the aliasTarget value. + */ + public AliasTarget aliasTarget() { + return this.aliasTarget; + } + + /** + * Set the aliasTarget property: <p> <i>Alias resource record sets only:</i> Information about the + * Amazon Web Services resource, such as a CloudFront distribution or an Amazon S3 bucket, that you want to route + * traffic to. </p> <p>If you're creating resource records sets for a private hosted zone, note the + * following:</p> <ul> <li> <p>You can't create an alias resource record set in a private + * hosted zone to route traffic to a CloudFront distribution.</p> </li> <li> <p>For + * information about creating failover resource record sets in a private hosted zone, see <a + * href='https://docs.aws.amazon.com/Route53/latest/DeveloperGuide/dns-failover-private-hosted-zones.html'>Configuring + * Failover in a Private Hosted Zone</a> in the <i>Amazon Route 53 Developer Guide</i>.</p> + * </li> </ul>. + * + * @param aliasTarget the aliasTarget value to set. + * @return the AwsRoute53ResourceRecordSetProperties object itself. + */ + public AwsRoute53ResourceRecordSetProperties withAliasTarget(AliasTarget aliasTarget) { + this.aliasTarget = aliasTarget; + return this; + } + + /** + * Get the cidrRoutingConfig property: Property cidrRoutingConfig. + * + * @return the cidrRoutingConfig value. + */ + public CidrRoutingConfig cidrRoutingConfig() { + return this.cidrRoutingConfig; + } + + /** + * Set the cidrRoutingConfig property: Property cidrRoutingConfig. + * + * @param cidrRoutingConfig the cidrRoutingConfig value to set. + * @return the AwsRoute53ResourceRecordSetProperties object itself. + */ + public AwsRoute53ResourceRecordSetProperties withCidrRoutingConfig(CidrRoutingConfig cidrRoutingConfig) { + this.cidrRoutingConfig = cidrRoutingConfig; + return this; + } + + /** + * Get the failover property: <p> <i>Failover resource record sets only:</i> To configure + * failover, you add the <code>Failover</code> element to two resource record sets. For one resource + * record set, you specify <code>PRIMARY</code> as the value for <code>Failover</code>; for + * the other resource record set, you specify <code>SECONDARY</code>. In addition, you include the + * <code>HealthCheckId</code> element and specify the health check that you want Amazon Route 53 to + * perform for each resource record set.</p> <p>Except where noted, the following failover behaviors + * assume that you have included the <code>HealthCheckId</code> element in both resource record + * sets:</p> <ul> <li> <p>When the primary resource record set is healthy, Route 53 responds + * to DNS queries with the applicable value from the primary resource record set regardless of the health of the + * secondary resource record set.</p> </li> <li> <p>When the primary resource record set is + * unhealthy and the secondary resource record set is healthy, Route 53 responds to DNS queries with the applicable + * value from the secondary resource record set.</p> </li> <li> <p>When the secondary + * resource record set is unhealthy, Route 53 responds to DNS queries with the applicable value from the primary + * resource record set regardless of the health of the primary resource record set.</p> </li> <li> + * <p>If you omit the <code>HealthCheckId</code> element for the secondary resource record set, + * and if the primary resource record set is unhealthy, Route 53 always responds to DNS queries with the applicable + * value from the secondary resource record set. This is true regardless of the health of the associated + * endpoint.</p> </li> </ul> <p>You can't create non-failover resource record sets that have + * the same values for the <code>Name</code> and <code>Type</code> elements as failover + * resource record sets.</p> <p>For failover alias resource record sets, you must also include the + * <code>EvaluateTargetHealth</code> element and set the value to true.</p> <p>For more + * information about configuring failover for Route 53, see the following topics in the <i>Amazon Route 53 + * Developer Guide</i>: </p> <ul> <li> <p> <a + * href='https://docs.aws.amazon.com/Route53/latest/DeveloperGuide/dns-failover.html'>Route 53 Health Checks and + * DNS Failover</a> </p> </li> <li> <p> <a + * href='https://docs.aws.amazon.com/Route53/latest/DeveloperGuide/dns-failover-private-hosted-zones.html'>Configuring + * Failover in a Private Hosted Zone</a> </p> </li> </ul>. + * + * @return the failover value. + */ + public ResourceRecordSetFailoverEnumValue failover() { + return this.failover; + } + + /** + * Set the failover property: <p> <i>Failover resource record sets only:</i> To configure + * failover, you add the <code>Failover</code> element to two resource record sets. For one resource + * record set, you specify <code>PRIMARY</code> as the value for <code>Failover</code>; for + * the other resource record set, you specify <code>SECONDARY</code>. In addition, you include the + * <code>HealthCheckId</code> element and specify the health check that you want Amazon Route 53 to + * perform for each resource record set.</p> <p>Except where noted, the following failover behaviors + * assume that you have included the <code>HealthCheckId</code> element in both resource record + * sets:</p> <ul> <li> <p>When the primary resource record set is healthy, Route 53 responds + * to DNS queries with the applicable value from the primary resource record set regardless of the health of the + * secondary resource record set.</p> </li> <li> <p>When the primary resource record set is + * unhealthy and the secondary resource record set is healthy, Route 53 responds to DNS queries with the applicable + * value from the secondary resource record set.</p> </li> <li> <p>When the secondary + * resource record set is unhealthy, Route 53 responds to DNS queries with the applicable value from the primary + * resource record set regardless of the health of the primary resource record set.</p> </li> <li> + * <p>If you omit the <code>HealthCheckId</code> element for the secondary resource record set, + * and if the primary resource record set is unhealthy, Route 53 always responds to DNS queries with the applicable + * value from the secondary resource record set. This is true regardless of the health of the associated + * endpoint.</p> </li> </ul> <p>You can't create non-failover resource record sets that have + * the same values for the <code>Name</code> and <code>Type</code> elements as failover + * resource record sets.</p> <p>For failover alias resource record sets, you must also include the + * <code>EvaluateTargetHealth</code> element and set the value to true.</p> <p>For more + * information about configuring failover for Route 53, see the following topics in the <i>Amazon Route 53 + * Developer Guide</i>: </p> <ul> <li> <p> <a + * href='https://docs.aws.amazon.com/Route53/latest/DeveloperGuide/dns-failover.html'>Route 53 Health Checks and + * DNS Failover</a> </p> </li> <li> <p> <a + * href='https://docs.aws.amazon.com/Route53/latest/DeveloperGuide/dns-failover-private-hosted-zones.html'>Configuring + * Failover in a Private Hosted Zone</a> </p> </li> </ul>. + * + * @param failover the failover value to set. + * @return the AwsRoute53ResourceRecordSetProperties object itself. + */ + public AwsRoute53ResourceRecordSetProperties withFailover(ResourceRecordSetFailoverEnumValue failover) { + this.failover = failover; + return this; + } + + /** + * Get the geoLocation property: <p> <i>Geolocation resource record sets only:</i> A complex type + * that lets you control how Amazon Route 53 responds to DNS queries based on the geographic origin of the query. + * For example, if you want all queries from Africa to be routed to a web server with an IP address of + * <code>192.0.2.111</code>, create a resource record set with a <code>Type</code> of + * <code>A</code> and a <code>ContinentCode</code> of <code>AF</code>.</p> + * <p>If you create separate resource record sets for overlapping geographic regions (for example, one + * resource record set for a continent and one for a country on the same continent), priority goes to the smallest + * geographic region. This allows you to route most queries for a continent to one resource and to route queries for + * a country on that continent to a different resource.</p> <p>You can't create two geolocation resource + * record sets that specify the same geographic location.</p> <p>The value <code>*</code> in + * the <code>CountryCode</code> element matches all geographic locations that aren't specified in other + * geolocation resource record sets that have the same values for the <code>Name</code> and + * <code>Type</code> elements.</p> <important> <p>Geolocation works by mapping IP + * addresses to locations. However, some IP addresses aren't mapped to geographic locations, so even if you create + * geolocation resource record sets that cover all seven continents, Route 53 will receive some DNS queries from + * locations that it can't identify. We recommend that you create a resource record set for which the value of + * <code>CountryCode</code> is <code>*</code>. Two groups of queries are routed to the + * resource that you specify in this record: queries that come from locations for which you haven't created + * geolocation resource record sets and queries from IP addresses that aren't mapped to a location. If you don't + * create a <code>*</code> resource record set, Route 53 returns a 'no answer' response for queries from + * those locations.</p> </important> <p>You can't create non-geolocation resource record sets that + * have the same values for the <code>Name</code> and <code>Type</code> elements as + * geolocation resource record sets.</p>. + * + * @return the geoLocation value. + */ + public GeoLocation geoLocation() { + return this.geoLocation; + } + + /** + * Set the geoLocation property: <p> <i>Geolocation resource record sets only:</i> A complex type + * that lets you control how Amazon Route 53 responds to DNS queries based on the geographic origin of the query. + * For example, if you want all queries from Africa to be routed to a web server with an IP address of + * <code>192.0.2.111</code>, create a resource record set with a <code>Type</code> of + * <code>A</code> and a <code>ContinentCode</code> of <code>AF</code>.</p> + * <p>If you create separate resource record sets for overlapping geographic regions (for example, one + * resource record set for a continent and one for a country on the same continent), priority goes to the smallest + * geographic region. This allows you to route most queries for a continent to one resource and to route queries for + * a country on that continent to a different resource.</p> <p>You can't create two geolocation resource + * record sets that specify the same geographic location.</p> <p>The value <code>*</code> in + * the <code>CountryCode</code> element matches all geographic locations that aren't specified in other + * geolocation resource record sets that have the same values for the <code>Name</code> and + * <code>Type</code> elements.</p> <important> <p>Geolocation works by mapping IP + * addresses to locations. However, some IP addresses aren't mapped to geographic locations, so even if you create + * geolocation resource record sets that cover all seven continents, Route 53 will receive some DNS queries from + * locations that it can't identify. We recommend that you create a resource record set for which the value of + * <code>CountryCode</code> is <code>*</code>. Two groups of queries are routed to the + * resource that you specify in this record: queries that come from locations for which you haven't created + * geolocation resource record sets and queries from IP addresses that aren't mapped to a location. If you don't + * create a <code>*</code> resource record set, Route 53 returns a 'no answer' response for queries from + * those locations.</p> </important> <p>You can't create non-geolocation resource record sets that + * have the same values for the <code>Name</code> and <code>Type</code> elements as + * geolocation resource record sets.</p>. + * + * @param geoLocation the geoLocation value to set. + * @return the AwsRoute53ResourceRecordSetProperties object itself. + */ + public AwsRoute53ResourceRecordSetProperties withGeoLocation(GeoLocation geoLocation) { + this.geoLocation = geoLocation; + return this; + } + + /** + * Get the geoProximityLocation property: <p> <i> GeoproximityLocation resource record sets + * only:</i> A complex type that lets you control how Route 53 responds to DNS queries based on the geographic + * origin of the query and your resources. </p>. + * + * @return the geoProximityLocation value. + */ + public GeoProximityLocation geoProximityLocation() { + return this.geoProximityLocation; + } + + /** + * Set the geoProximityLocation property: <p> <i> GeoproximityLocation resource record sets + * only:</i> A complex type that lets you control how Route 53 responds to DNS queries based on the geographic + * origin of the query and your resources. </p>. + * + * @param geoProximityLocation the geoProximityLocation value to set. + * @return the AwsRoute53ResourceRecordSetProperties object itself. + */ + public AwsRoute53ResourceRecordSetProperties withGeoProximityLocation(GeoProximityLocation geoProximityLocation) { + this.geoProximityLocation = geoProximityLocation; + return this; + } + + /** + * Get the healthCheckId property: <p>If you want Amazon Route 53 to return this resource record set in + * response to a DNS query only when the status of a health check is healthy, include the + * <code>HealthCheckId</code> element and specify the ID of the applicable health check.</p> + * <p>Route 53 determines whether a resource record set is healthy based on one of the following:</p> + * <ul> <li> <p>By periodically sending a request to the endpoint that is specified in the health + * check</p> </li> <li> <p>By aggregating the status of a specified group of health checks + * (calculated health checks)</p> </li> <li> <p>By determining the current state of a + * CloudWatch alarm (CloudWatch metric health checks)</p> </li> </ul> <important> + * <p>Route 53 doesn't check the health of the endpoint that is specified in the resource record set, for + * example, the endpoint specified by the IP address in the <code>Value</code> element. When you add a + * <code>HealthCheckId</code> element to a resource record set, Route 53 checks the health of the + * endpoint that you specified in the health check. </p> </important> <p>For more information, see + * the following topics in the <i>Amazon Route 53 Developer Guide</i>:</p> <ul> <li> + * <p> <a + * href='https://docs.aws.amazon.com/Route53/latest/DeveloperGuide/dns-failover-determining-health-of-endpoints.html'>How + * Amazon Route 53 Determines Whether an Endpoint Is Healthy</a> </p> </li> <li> <p> + * <a href='https://docs.aws.amazon.com/Route53/latest/DeveloperGuide/dns-failover.html'>Route 53 Health + * Checks and DNS Failover</a> </p> </li> <li> <p> <a + * href='https://docs.aws.amazon.com/Route53/latest/DeveloperGuide/dns-failover-private-hosted-zones.html'>Configuring + * Failover in a Private Hosted Zone</a> </p> </li> </ul> <p> <b>When to Specify + * HealthCheckId</b> </p> <p>Specifying a value for <code>HealthCheckId</code> is + * useful only when Route 53 is choosing between two or more resource record sets to respond to a DNS query, and you + * want Route 53 to base the choice in part on the status of a health check. Configuring health checks makes sense + * only in the following configurations:</p> <ul> <li> <p> <b>Non-alias resource + * record sets</b>: You're checking the health of a group of non-alias resource record sets that have the same + * routing policy, name, and type (such as multiple weighted records named www.example.com with a type of A) and you + * specify health check IDs for all the resource record sets. </p> <p>If the health check status for a + * resource record set is healthy, Route 53 includes the record among the records that it responds to DNS queries + * with.</p> <p>If the health check status for a resource record set is unhealthy, Route 53 stops + * responding to DNS queries using the value for that resource record set.</p> <p>If the health check + * status for all resource record sets in the group is unhealthy, Route 53 considers all resource record sets in the + * group healthy and responds to DNS queries accordingly. </p> </li> <li> <p> <b>Alias + * resource record sets</b>: You specify the following settings:</p> <ul> <li> <p>You + * set <code>EvaluateTargetHealth</code> to true for an alias resource record set in a group of resource + * record sets that have the same routing policy, name, and type (such as multiple weighted records named + * www.example.com with a type of A). </p> </li> <li> <p>You configure the alias resource + * record set to route traffic to a non-alias resource record set in the same hosted zone.</p> </li> + * <li> <p>You specify a health check ID for the non-alias resource record set. </p> </li> + * </ul> <p>If the health check status is healthy, Route 53 considers the alias resource record set to + * be healthy and includes the alias record among the records that it responds to DNS queries with.</p> + * <p>If the health check status is unhealthy, Route 53 stops responding to DNS queries using the alias + * resource record set.</p> <note> <p>The alias resource record set can also route traffic to a + * <i>group</i> of non-alias resource record sets that have the same routing policy, name, and type. In + * that configuration, associate health checks with all of the resource record sets in the group of non-alias + * resource record sets.</p> </note> </li> </ul> <p> <b>Geolocation + * Routing</b> </p> <p>For geolocation resource record sets, if an endpoint is unhealthy, Route 53 + * looks for a resource record set for the larger, associated geographic region. For example, suppose you have + * resource record sets for a state in the United States, for the entire United States, for North America, and a + * resource record set that has <code>*</code> for <code>CountryCode</code> is + * <code>*</code>, which applies to all locations. If the endpoint for the state resource record set is + * unhealthy, Route 53 checks for healthy resource record sets in the following order until it finds a resource + * record set for which the endpoint is healthy:</p> <ul> <li> <p>The United + * States</p> </li> <li> <p>North America</p> </li> <li> <p>The + * default resource record set</p> </li> </ul> <p> <b>Specifying the Health Check + * Endpoint by Domain Name</b> </p> <p>If your health checks specify the endpoint only by domain + * name, we recommend that you create a separate health check for each endpoint. For example, create a health check + * for each <code>HTTP</code> server that is serving content for + * <code>www.example.com</code>. For the value of <code>FullyQualifiedDomainName</code>, + * specify the domain name of the server (such as <code>us-east-2-www.example.com</code>), not the name + * of the resource record sets (<code>www.example.com</code>).</p> <important> + * <p>Health check results will be unpredictable if you do the following:</p> <ul> <li> + * <p>Create a health check that has the same value for <code>FullyQualifiedDomainName</code> as + * the name of a resource record set.</p> </li> <li> <p>Associate that health check with the + * resource record set.</p> </li> </ul> </important>. + * + * @return the healthCheckId value. + */ + public String healthCheckId() { + return this.healthCheckId; + } + + /** + * Set the healthCheckId property: <p>If you want Amazon Route 53 to return this resource record set in + * response to a DNS query only when the status of a health check is healthy, include the + * <code>HealthCheckId</code> element and specify the ID of the applicable health check.</p> + * <p>Route 53 determines whether a resource record set is healthy based on one of the following:</p> + * <ul> <li> <p>By periodically sending a request to the endpoint that is specified in the health + * check</p> </li> <li> <p>By aggregating the status of a specified group of health checks + * (calculated health checks)</p> </li> <li> <p>By determining the current state of a + * CloudWatch alarm (CloudWatch metric health checks)</p> </li> </ul> <important> + * <p>Route 53 doesn't check the health of the endpoint that is specified in the resource record set, for + * example, the endpoint specified by the IP address in the <code>Value</code> element. When you add a + * <code>HealthCheckId</code> element to a resource record set, Route 53 checks the health of the + * endpoint that you specified in the health check. </p> </important> <p>For more information, see + * the following topics in the <i>Amazon Route 53 Developer Guide</i>:</p> <ul> <li> + * <p> <a + * href='https://docs.aws.amazon.com/Route53/latest/DeveloperGuide/dns-failover-determining-health-of-endpoints.html'>How + * Amazon Route 53 Determines Whether an Endpoint Is Healthy</a> </p> </li> <li> <p> + * <a href='https://docs.aws.amazon.com/Route53/latest/DeveloperGuide/dns-failover.html'>Route 53 Health + * Checks and DNS Failover</a> </p> </li> <li> <p> <a + * href='https://docs.aws.amazon.com/Route53/latest/DeveloperGuide/dns-failover-private-hosted-zones.html'>Configuring + * Failover in a Private Hosted Zone</a> </p> </li> </ul> <p> <b>When to Specify + * HealthCheckId</b> </p> <p>Specifying a value for <code>HealthCheckId</code> is + * useful only when Route 53 is choosing between two or more resource record sets to respond to a DNS query, and you + * want Route 53 to base the choice in part on the status of a health check. Configuring health checks makes sense + * only in the following configurations:</p> <ul> <li> <p> <b>Non-alias resource + * record sets</b>: You're checking the health of a group of non-alias resource record sets that have the same + * routing policy, name, and type (such as multiple weighted records named www.example.com with a type of A) and you + * specify health check IDs for all the resource record sets. </p> <p>If the health check status for a + * resource record set is healthy, Route 53 includes the record among the records that it responds to DNS queries + * with.</p> <p>If the health check status for a resource record set is unhealthy, Route 53 stops + * responding to DNS queries using the value for that resource record set.</p> <p>If the health check + * status for all resource record sets in the group is unhealthy, Route 53 considers all resource record sets in the + * group healthy and responds to DNS queries accordingly. </p> </li> <li> <p> <b>Alias + * resource record sets</b>: You specify the following settings:</p> <ul> <li> <p>You + * set <code>EvaluateTargetHealth</code> to true for an alias resource record set in a group of resource + * record sets that have the same routing policy, name, and type (such as multiple weighted records named + * www.example.com with a type of A). </p> </li> <li> <p>You configure the alias resource + * record set to route traffic to a non-alias resource record set in the same hosted zone.</p> </li> + * <li> <p>You specify a health check ID for the non-alias resource record set. </p> </li> + * </ul> <p>If the health check status is healthy, Route 53 considers the alias resource record set to + * be healthy and includes the alias record among the records that it responds to DNS queries with.</p> + * <p>If the health check status is unhealthy, Route 53 stops responding to DNS queries using the alias + * resource record set.</p> <note> <p>The alias resource record set can also route traffic to a + * <i>group</i> of non-alias resource record sets that have the same routing policy, name, and type. In + * that configuration, associate health checks with all of the resource record sets in the group of non-alias + * resource record sets.</p> </note> </li> </ul> <p> <b>Geolocation + * Routing</b> </p> <p>For geolocation resource record sets, if an endpoint is unhealthy, Route 53 + * looks for a resource record set for the larger, associated geographic region. For example, suppose you have + * resource record sets for a state in the United States, for the entire United States, for North America, and a + * resource record set that has <code>*</code> for <code>CountryCode</code> is + * <code>*</code>, which applies to all locations. If the endpoint for the state resource record set is + * unhealthy, Route 53 checks for healthy resource record sets in the following order until it finds a resource + * record set for which the endpoint is healthy:</p> <ul> <li> <p>The United + * States</p> </li> <li> <p>North America</p> </li> <li> <p>The + * default resource record set</p> </li> </ul> <p> <b>Specifying the Health Check + * Endpoint by Domain Name</b> </p> <p>If your health checks specify the endpoint only by domain + * name, we recommend that you create a separate health check for each endpoint. For example, create a health check + * for each <code>HTTP</code> server that is serving content for + * <code>www.example.com</code>. For the value of <code>FullyQualifiedDomainName</code>, + * specify the domain name of the server (such as <code>us-east-2-www.example.com</code>), not the name + * of the resource record sets (<code>www.example.com</code>).</p> <important> + * <p>Health check results will be unpredictable if you do the following:</p> <ul> <li> + * <p>Create a health check that has the same value for <code>FullyQualifiedDomainName</code> as + * the name of a resource record set.</p> </li> <li> <p>Associate that health check with the + * resource record set.</p> </li> </ul> </important>. + * + * @param healthCheckId the healthCheckId value to set. + * @return the AwsRoute53ResourceRecordSetProperties object itself. + */ + public AwsRoute53ResourceRecordSetProperties withHealthCheckId(String healthCheckId) { + this.healthCheckId = healthCheckId; + return this; + } + + /** + * Get the multiValueAnswer property: <p> <i>Multivalue answer resource record sets only</i>: To + * route traffic approximately randomly to multiple resources, such as web servers, create one multivalue answer + * record for each resource and specify <code>true</code> for <code>MultiValueAnswer</code>. + * Note the following:</p> <ul> <li> <p>If you associate a health check with a multivalue + * answer resource record set, Amazon Route 53 responds to DNS queries with the corresponding IP address only when + * the health check is healthy.</p> </li> <li> <p>If you don't associate a health check with + * a multivalue answer record, Route 53 always considers the record to be healthy.</p> </li> <li> + * <p>Route 53 responds to DNS queries with up to eight healthy records; if you have eight or fewer healthy + * records, Route 53 responds to all DNS queries with all the healthy records.</p> </li> <li> + * <p>If you have more than eight healthy records, Route 53 responds to different DNS resolvers with different + * combinations of healthy records.</p> </li> <li> <p>When all records are unhealthy, Route + * 53 responds to DNS queries with up to eight unhealthy records.</p> </li> <li> <p>If a + * resource becomes unavailable after a resolver caches a response, client software typically tries another of the + * IP addresses in the response.</p> </li> </ul> <p>You can't create multivalue answer alias + * records.</p>. + * + * @return the multiValueAnswer value. + */ + public Boolean multiValueAnswer() { + return this.multiValueAnswer; + } + + /** + * Set the multiValueAnswer property: <p> <i>Multivalue answer resource record sets only</i>: To + * route traffic approximately randomly to multiple resources, such as web servers, create one multivalue answer + * record for each resource and specify <code>true</code> for <code>MultiValueAnswer</code>. + * Note the following:</p> <ul> <li> <p>If you associate a health check with a multivalue + * answer resource record set, Amazon Route 53 responds to DNS queries with the corresponding IP address only when + * the health check is healthy.</p> </li> <li> <p>If you don't associate a health check with + * a multivalue answer record, Route 53 always considers the record to be healthy.</p> </li> <li> + * <p>Route 53 responds to DNS queries with up to eight healthy records; if you have eight or fewer healthy + * records, Route 53 responds to all DNS queries with all the healthy records.</p> </li> <li> + * <p>If you have more than eight healthy records, Route 53 responds to different DNS resolvers with different + * combinations of healthy records.</p> </li> <li> <p>When all records are unhealthy, Route + * 53 responds to DNS queries with up to eight unhealthy records.</p> </li> <li> <p>If a + * resource becomes unavailable after a resolver caches a response, client software typically tries another of the + * IP addresses in the response.</p> </li> </ul> <p>You can't create multivalue answer alias + * records.</p>. + * + * @param multiValueAnswer the multiValueAnswer value to set. + * @return the AwsRoute53ResourceRecordSetProperties object itself. + */ + public AwsRoute53ResourceRecordSetProperties withMultiValueAnswer(Boolean multiValueAnswer) { + this.multiValueAnswer = multiValueAnswer; + return this; + } + + /** + * Get the name property: <p>For <code>ChangeResourceRecordSets</code> requests, the name of the + * record that you want to create, update, or delete. For <code>ListResourceRecordSets</code> responses, + * the name of a record in the specified hosted zone.</p> <p> <b>ChangeResourceRecordSets + * Only</b> </p> <p>Enter a fully qualified domain name, for example, + * <code>www.example.com</code>. You can optionally include a trailing dot. If you omit the trailing + * dot, Amazon Route 53 assumes that the domain name that you specify is fully qualified. This means that Route 53 + * treats <code>www.example.com</code> (without a trailing dot) and + * <code>www.example.com.</code> (with a trailing dot) as identical.</p> <p>For information + * about how to specify characters other than <code>a-z</code>, <code>0-9</code>, and + * <code>-</code> (hyphen) and how to specify internationalized domain names, see <a + * href='https://docs.aws.amazon.com/Route53/latest/DeveloperGuide/DomainNameFormat.html'>DNS Domain Name + * Format</a> in the <i>Amazon Route 53 Developer Guide</i>.</p> <p>You can use the + * asterisk (*) wildcard to replace the leftmost label in a domain name, for example, + * <code>*.example.com</code>. Note the following:</p> <ul> <li> <p>The * must + * replace the entire label. For example, you can't specify <code>*prod.example.com</code> or + * <code>prod*.example.com</code>.</p> </li> <li> <p>The * can't replace any of + * the middle labels, for example, marketing.*.example.com.</p> </li> <li> <p>If you include + * * in any position other than the leftmost label in a domain name, DNS treats it as an * character (ASCII 42), not + * as a wildcard.</p> <important> <p>You can't use the * wildcard for resource records sets that + * have a type of NS.</p> </important> </li> </ul>. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: <p>For <code>ChangeResourceRecordSets</code> requests, the name of the + * record that you want to create, update, or delete. For <code>ListResourceRecordSets</code> responses, + * the name of a record in the specified hosted zone.</p> <p> <b>ChangeResourceRecordSets + * Only</b> </p> <p>Enter a fully qualified domain name, for example, + * <code>www.example.com</code>. You can optionally include a trailing dot. If you omit the trailing + * dot, Amazon Route 53 assumes that the domain name that you specify is fully qualified. This means that Route 53 + * treats <code>www.example.com</code> (without a trailing dot) and + * <code>www.example.com.</code> (with a trailing dot) as identical.</p> <p>For information + * about how to specify characters other than <code>a-z</code>, <code>0-9</code>, and + * <code>-</code> (hyphen) and how to specify internationalized domain names, see <a + * href='https://docs.aws.amazon.com/Route53/latest/DeveloperGuide/DomainNameFormat.html'>DNS Domain Name + * Format</a> in the <i>Amazon Route 53 Developer Guide</i>.</p> <p>You can use the + * asterisk (*) wildcard to replace the leftmost label in a domain name, for example, + * <code>*.example.com</code>. Note the following:</p> <ul> <li> <p>The * must + * replace the entire label. For example, you can't specify <code>*prod.example.com</code> or + * <code>prod*.example.com</code>.</p> </li> <li> <p>The * can't replace any of + * the middle labels, for example, marketing.*.example.com.</p> </li> <li> <p>If you include + * * in any position other than the leftmost label in a domain name, DNS treats it as an * character (ASCII 42), not + * as a wildcard.</p> <important> <p>You can't use the * wildcard for resource records sets that + * have a type of NS.</p> </important> </li> </ul>. + * + * @param name the name value to set. + * @return the AwsRoute53ResourceRecordSetProperties object itself. + */ + public AwsRoute53ResourceRecordSetProperties withName(String name) { + this.name = name; + return this; + } + + /** + * Get the region property: <p> <i>Latency-based resource record sets only:</i> The Amazon EC2 + * Region where you created the resource that this resource record set refers to. The resource typically is an + * Amazon Web Services resource, such as an EC2 instance or an ELB load balancer, and is referred to by an IP + * address or a DNS domain name, depending on the record type.</p> <p>When Amazon Route 53 receives a + * DNS query for a domain name and type for which you have created latency resource record sets, Route 53 selects + * the latency resource record set that has the lowest latency between the end user and the associated Amazon EC2 + * Region. Route 53 then returns the value that is associated with the selected resource record set.</p> + * <p>Note the following:</p> <ul> <li> <p>You can only specify one + * <code>ResourceRecord</code> per latency resource record set.</p> </li> <li> + * <p>You can only create one latency resource record set for each Amazon EC2 Region.</p> </li> + * <li> <p>You aren't required to create latency resource record sets for all Amazon EC2 Regions. Route + * 53 will choose the region with the best latency from among the regions that you create latency resource record + * sets for.</p> </li> <li> <p>You can't create non-latency resource record sets that have + * the same values for the <code>Name</code> and <code>Type</code> elements as latency + * resource record sets.</p> </li> </ul>. + * + * @return the region value. + */ + public ResourceRecordSetRegionEnumValue region() { + return this.region; + } + + /** + * Set the region property: <p> <i>Latency-based resource record sets only:</i> The Amazon EC2 + * Region where you created the resource that this resource record set refers to. The resource typically is an + * Amazon Web Services resource, such as an EC2 instance or an ELB load balancer, and is referred to by an IP + * address or a DNS domain name, depending on the record type.</p> <p>When Amazon Route 53 receives a + * DNS query for a domain name and type for which you have created latency resource record sets, Route 53 selects + * the latency resource record set that has the lowest latency between the end user and the associated Amazon EC2 + * Region. Route 53 then returns the value that is associated with the selected resource record set.</p> + * <p>Note the following:</p> <ul> <li> <p>You can only specify one + * <code>ResourceRecord</code> per latency resource record set.</p> </li> <li> + * <p>You can only create one latency resource record set for each Amazon EC2 Region.</p> </li> + * <li> <p>You aren't required to create latency resource record sets for all Amazon EC2 Regions. Route + * 53 will choose the region with the best latency from among the regions that you create latency resource record + * sets for.</p> </li> <li> <p>You can't create non-latency resource record sets that have + * the same values for the <code>Name</code> and <code>Type</code> elements as latency + * resource record sets.</p> </li> </ul>. + * + * @param region the region value to set. + * @return the AwsRoute53ResourceRecordSetProperties object itself. + */ + public AwsRoute53ResourceRecordSetProperties withRegion(ResourceRecordSetRegionEnumValue region) { + this.region = region; + return this; + } + + /** + * Get the resourceRecords property: <p>Information about the resource records to act upon.</p> + * <note> <p>If you're creating an alias resource record set, omit + * <code>ResourceRecords</code>.</p> </note>. + * + * @return the resourceRecords value. + */ + public List resourceRecords() { + return this.resourceRecords; + } + + /** + * Set the resourceRecords property: <p>Information about the resource records to act upon.</p> + * <note> <p>If you're creating an alias resource record set, omit + * <code>ResourceRecords</code>.</p> </note>. + * + * @param resourceRecords the resourceRecords value to set. + * @return the AwsRoute53ResourceRecordSetProperties object itself. + */ + public AwsRoute53ResourceRecordSetProperties withResourceRecords(List resourceRecords) { + this.resourceRecords = resourceRecords; + return this; + } + + /** + * Get the setIdentifier property: <p> <i>Resource record sets that have a routing policy other than + * simple:</i> An identifier that differentiates among multiple resource record sets that have the same + * combination of name and type, such as multiple weighted resource record sets named acme.example.com that have a + * type of A. In a group of resource record sets that have the same name and type, the value of + * <code>SetIdentifier</code> must be unique for each resource record set. </p> <p>For + * information about routing policies, see <a + * href='https://docs.aws.amazon.com/Route53/latest/DeveloperGuide/routing-policy.html'>Choosing a Routing + * Policy</a> in the <i>Amazon Route 53 Developer Guide</i>.</p>. + * + * @return the setIdentifier value. + */ + public String setIdentifier() { + return this.setIdentifier; + } + + /** + * Set the setIdentifier property: <p> <i>Resource record sets that have a routing policy other than + * simple:</i> An identifier that differentiates among multiple resource record sets that have the same + * combination of name and type, such as multiple weighted resource record sets named acme.example.com that have a + * type of A. In a group of resource record sets that have the same name and type, the value of + * <code>SetIdentifier</code> must be unique for each resource record set. </p> <p>For + * information about routing policies, see <a + * href='https://docs.aws.amazon.com/Route53/latest/DeveloperGuide/routing-policy.html'>Choosing a Routing + * Policy</a> in the <i>Amazon Route 53 Developer Guide</i>.</p>. + * + * @param setIdentifier the setIdentifier value to set. + * @return the AwsRoute53ResourceRecordSetProperties object itself. + */ + public AwsRoute53ResourceRecordSetProperties withSetIdentifier(String setIdentifier) { + this.setIdentifier = setIdentifier; + return this; + } + + /** + * Get the ttl property: <p>The resource record cache time to live (TTL), in seconds. Note the + * following:</p> <ul> <li> <p>If you're creating or updating an alias resource record set, + * omit <code>TTL</code>. Amazon Route 53 uses the value of <code>TTL</code> for the alias + * target. </p> </li> <li> <p>If you're associating this resource record set with a health + * check (if you're adding a <code>HealthCheckId</code> element), we recommend that you specify a + * <code>TTL</code> of 60 seconds or less so clients respond quickly to changes in health + * status.</p> </li> <li> <p>All of the resource record sets in a group of weighted resource + * record sets must have the same value for <code>TTL</code>.</p> </li> <li> + * <p>If a group of weighted resource record sets includes one or more weighted alias resource record sets for + * which the alias target is an ELB load balancer, we recommend that you specify a <code>TTL</code> of + * 60 seconds for all of the non-alias weighted resource record sets that have the same name and type. Values other + * than 60 seconds (the TTL for load balancers) will change the effect of the values that you specify for + * <code>Weight</code>.</p> </li> </ul>. + * + * @return the ttl value. + */ + public Long ttl() { + return this.ttl; + } + + /** + * Set the ttl property: <p>The resource record cache time to live (TTL), in seconds. Note the + * following:</p> <ul> <li> <p>If you're creating or updating an alias resource record set, + * omit <code>TTL</code>. Amazon Route 53 uses the value of <code>TTL</code> for the alias + * target. </p> </li> <li> <p>If you're associating this resource record set with a health + * check (if you're adding a <code>HealthCheckId</code> element), we recommend that you specify a + * <code>TTL</code> of 60 seconds or less so clients respond quickly to changes in health + * status.</p> </li> <li> <p>All of the resource record sets in a group of weighted resource + * record sets must have the same value for <code>TTL</code>.</p> </li> <li> + * <p>If a group of weighted resource record sets includes one or more weighted alias resource record sets for + * which the alias target is an ELB load balancer, we recommend that you specify a <code>TTL</code> of + * 60 seconds for all of the non-alias weighted resource record sets that have the same name and type. Values other + * than 60 seconds (the TTL for load balancers) will change the effect of the values that you specify for + * <code>Weight</code>.</p> </li> </ul>. + * + * @param ttl the ttl value to set. + * @return the AwsRoute53ResourceRecordSetProperties object itself. + */ + public AwsRoute53ResourceRecordSetProperties withTtl(Long ttl) { + this.ttl = ttl; + return this; + } + + /** + * Get the trafficPolicyInstanceId property: <p>When you create a traffic policy instance, Amazon Route 53 + * automatically creates a resource record set. <code>TrafficPolicyInstanceId</code> is the ID of the + * traffic policy instance that Route 53 created this resource record set for.</p> <important> + * <p>To delete the resource record set that is associated with a traffic policy instance, use + * <code>DeleteTrafficPolicyInstance</code>. Route 53 will delete the resource record set automatically. + * If you delete the resource record set by using <code>ChangeResourceRecordSets</code>, Route 53 + * doesn't automatically delete the traffic policy instance, and you'll continue to be charged for it even though + * it's no longer in use. </p> </important>. + * + * @return the trafficPolicyInstanceId value. + */ + public String trafficPolicyInstanceId() { + return this.trafficPolicyInstanceId; + } + + /** + * Set the trafficPolicyInstanceId property: <p>When you create a traffic policy instance, Amazon Route 53 + * automatically creates a resource record set. <code>TrafficPolicyInstanceId</code> is the ID of the + * traffic policy instance that Route 53 created this resource record set for.</p> <important> + * <p>To delete the resource record set that is associated with a traffic policy instance, use + * <code>DeleteTrafficPolicyInstance</code>. Route 53 will delete the resource record set automatically. + * If you delete the resource record set by using <code>ChangeResourceRecordSets</code>, Route 53 + * doesn't automatically delete the traffic policy instance, and you'll continue to be charged for it even though + * it's no longer in use. </p> </important>. + * + * @param trafficPolicyInstanceId the trafficPolicyInstanceId value to set. + * @return the AwsRoute53ResourceRecordSetProperties object itself. + */ + public AwsRoute53ResourceRecordSetProperties withTrafficPolicyInstanceId(String trafficPolicyInstanceId) { + this.trafficPolicyInstanceId = trafficPolicyInstanceId; + return this; + } + + /** + * Get the type property: <p>The DNS record type. For information about different record types and how data is + * encoded for them, see <a + * href='https://docs.aws.amazon.com/Route53/latest/DeveloperGuide/ResourceRecordTypes.html'>Supported DNS + * Resource Record Types</a> in the <i>Amazon Route 53 Developer Guide</i>.</p> + * <p>Valid values for basic resource record sets: <code>A</code> | <code>AAAA</code> + * | <code>CAA</code> | <code>CNAME</code> | <code>DS</code> + * |<code>MX</code> | <code>NAPTR</code> | <code>NS</code> | + * <code>PTR</code> | <code>SOA</code> | <code>SPF</code> | + * <code>SRV</code> | <code>TXT</code> </p> <p>Values for weighted, latency, + * geolocation, and failover resource record sets: <code>A</code> | <code>AAAA</code> | + * <code>CAA</code> | <code>CNAME</code> | <code>MX</code> | + * <code>NAPTR</code> | <code>PTR</code> | <code>SPF</code> | + * <code>SRV</code> | <code>TXT</code>. When creating a group of weighted, latency, + * geolocation, or failover resource record sets, specify the same value for all of the resource record sets in the + * group.</p> <p>Valid values for multivalue answer resource record sets: <code>A</code> | + * <code>AAAA</code> | <code>MX</code> | <code>NAPTR</code> | + * <code>PTR</code> | <code>SPF</code> | <code>SRV</code> | + * <code>TXT</code> </p> <note> <p>SPF records were formerly used to verify the + * identity of the sender of email messages. However, we no longer recommend that you create resource record sets + * for which the value of <code>Type</code> is <code>SPF</code>. RFC 7208, <i>Sender + * Policy Framework (SPF) for Authorizing Use of Domains in Email, Version 1</i>, has been updated to say, + * '...[I]ts existence and mechanism defined in [RFC4408] have led to some interoperability issues. Accordingly, its + * use is no longer appropriate for SPF version 1; implementations are not to use it.' In RFC 7208, see section + * 14.1, <a href='http://tools.ietf.org/html/rfc7208#section-14.1'>The SPF DNS Record + * Type</a>.</p> </note> <p>Values for alias resource record sets:</p> <ul> + * <li> <p> <b>Amazon API Gateway custom regional APIs and edge-optimized APIs:</b> + * <code>A</code> </p> </li> <li> <p> <b>CloudFront + * distributions:</b> <code>A</code> </p> <p>If IPv6 is enabled for the distribution, + * create two resource record sets to route traffic to your distribution, one with a value of + * <code>A</code> and one with a value of <code>AAAA</code>. </p> </li> + * <li> <p> <b>Amazon API Gateway environment that has a regionalized subdomain</b>: + * <code>A</code> </p> </li> <li> <p> <b>ELB load balancers:</b> + * <code>A</code> | <code>AAAA</code> </p> </li> <li> <p> + * <b>Amazon S3 buckets:</b> <code>A</code> </p> </li> <li> <p> + * <b>Amazon Virtual Private Cloud interface VPC endpoints</b> <code>A</code> </p> + * </li> <li> <p> <b>Another resource record set in this hosted zone:</b> Specify the + * type of the resource record set that you're creating the alias for. All values are supported except + * <code>NS</code> and <code>SOA</code>.</p> <note> <p>If you're creating + * an alias record that has the same name as the hosted zone (known as the zone apex), you can't route traffic to a + * record for which the value of <code>Type</code> is <code>CNAME</code>. This is because + * the alias record must have the same type as the record you're routing traffic to, and creating a CNAME record for + * the zone apex isn't supported even for an alias record.</p> </note> </li> </ul>. + * + * @return the type value. + */ + public RRTypeEnumValue type() { + return this.type; + } + + /** + * Set the type property: <p>The DNS record type. For information about different record types and how data is + * encoded for them, see <a + * href='https://docs.aws.amazon.com/Route53/latest/DeveloperGuide/ResourceRecordTypes.html'>Supported DNS + * Resource Record Types</a> in the <i>Amazon Route 53 Developer Guide</i>.</p> + * <p>Valid values for basic resource record sets: <code>A</code> | <code>AAAA</code> + * | <code>CAA</code> | <code>CNAME</code> | <code>DS</code> + * |<code>MX</code> | <code>NAPTR</code> | <code>NS</code> | + * <code>PTR</code> | <code>SOA</code> | <code>SPF</code> | + * <code>SRV</code> | <code>TXT</code> </p> <p>Values for weighted, latency, + * geolocation, and failover resource record sets: <code>A</code> | <code>AAAA</code> | + * <code>CAA</code> | <code>CNAME</code> | <code>MX</code> | + * <code>NAPTR</code> | <code>PTR</code> | <code>SPF</code> | + * <code>SRV</code> | <code>TXT</code>. When creating a group of weighted, latency, + * geolocation, or failover resource record sets, specify the same value for all of the resource record sets in the + * group.</p> <p>Valid values for multivalue answer resource record sets: <code>A</code> | + * <code>AAAA</code> | <code>MX</code> | <code>NAPTR</code> | + * <code>PTR</code> | <code>SPF</code> | <code>SRV</code> | + * <code>TXT</code> </p> <note> <p>SPF records were formerly used to verify the + * identity of the sender of email messages. However, we no longer recommend that you create resource record sets + * for which the value of <code>Type</code> is <code>SPF</code>. RFC 7208, <i>Sender + * Policy Framework (SPF) for Authorizing Use of Domains in Email, Version 1</i>, has been updated to say, + * '...[I]ts existence and mechanism defined in [RFC4408] have led to some interoperability issues. Accordingly, its + * use is no longer appropriate for SPF version 1; implementations are not to use it.' In RFC 7208, see section + * 14.1, <a href='http://tools.ietf.org/html/rfc7208#section-14.1'>The SPF DNS Record + * Type</a>.</p> </note> <p>Values for alias resource record sets:</p> <ul> + * <li> <p> <b>Amazon API Gateway custom regional APIs and edge-optimized APIs:</b> + * <code>A</code> </p> </li> <li> <p> <b>CloudFront + * distributions:</b> <code>A</code> </p> <p>If IPv6 is enabled for the distribution, + * create two resource record sets to route traffic to your distribution, one with a value of + * <code>A</code> and one with a value of <code>AAAA</code>. </p> </li> + * <li> <p> <b>Amazon API Gateway environment that has a regionalized subdomain</b>: + * <code>A</code> </p> </li> <li> <p> <b>ELB load balancers:</b> + * <code>A</code> | <code>AAAA</code> </p> </li> <li> <p> + * <b>Amazon S3 buckets:</b> <code>A</code> </p> </li> <li> <p> + * <b>Amazon Virtual Private Cloud interface VPC endpoints</b> <code>A</code> </p> + * </li> <li> <p> <b>Another resource record set in this hosted zone:</b> Specify the + * type of the resource record set that you're creating the alias for. All values are supported except + * <code>NS</code> and <code>SOA</code>.</p> <note> <p>If you're creating + * an alias record that has the same name as the hosted zone (known as the zone apex), you can't route traffic to a + * record for which the value of <code>Type</code> is <code>CNAME</code>. This is because + * the alias record must have the same type as the record you're routing traffic to, and creating a CNAME record for + * the zone apex isn't supported even for an alias record.</p> </note> </li> </ul>. + * + * @param type the type value to set. + * @return the AwsRoute53ResourceRecordSetProperties object itself. + */ + public AwsRoute53ResourceRecordSetProperties withType(RRTypeEnumValue type) { + this.type = type; + return this; + } + + /** + * Get the weight property: <p> <i>Weighted resource record sets only:</i> Among resource record + * sets that have the same combination of DNS name and type, a value that determines the proportion of DNS queries + * that Amazon Route 53 responds to using the current resource record set. Route 53 calculates the sum of the + * weights for the resource record sets that have the same combination of DNS name and type. Route 53 then responds + * to queries based on the ratio of a resource's weight to the total. Note the following:</p> <ul> + * <li> <p>You must specify a value for the <code>Weight</code> element for every weighted + * resource record set.</p> </li> <li> <p>You can only specify one + * <code>ResourceRecord</code> per weighted resource record set.</p> </li> <li> + * <p>You can't create latency, failover, or geolocation resource record sets that have the same values for + * the <code>Name</code> and <code>Type</code> elements as weighted resource record + * sets.</p> </li> <li> <p>You can create a maximum of 100 weighted resource record sets + * that have the same values for the <code>Name</code> and <code>Type</code> + * elements.</p> </li> <li> <p>For weighted (but not weighted alias) resource record sets, + * if you set <code>Weight</code> to <code>0</code> for a resource record set, Route 53 + * never responds to queries with the applicable value for that resource record set. However, if you set + * <code>Weight</code> to <code>0</code> for all resource record sets that have the same + * combination of DNS name and type, traffic is routed to all resources with equal probability.</p> + * <p>The effect of setting <code>Weight</code> to <code>0</code> is different when + * you associate health checks with weighted resource record sets. For more information, see <a + * href='https://docs.aws.amazon.com/Route53/latest/DeveloperGuide/dns-failover-configuring-options.html'>Options + * for Configuring Route 53 Active-Active and Active-Passive Failover</a> in the <i>Amazon Route 53 + * Developer Guide</i>.</p> </li> </ul>. + * + * @return the weight value. + */ + public Long weight() { + return this.weight; + } + + /** + * Set the weight property: <p> <i>Weighted resource record sets only:</i> Among resource record + * sets that have the same combination of DNS name and type, a value that determines the proportion of DNS queries + * that Amazon Route 53 responds to using the current resource record set. Route 53 calculates the sum of the + * weights for the resource record sets that have the same combination of DNS name and type. Route 53 then responds + * to queries based on the ratio of a resource's weight to the total. Note the following:</p> <ul> + * <li> <p>You must specify a value for the <code>Weight</code> element for every weighted + * resource record set.</p> </li> <li> <p>You can only specify one + * <code>ResourceRecord</code> per weighted resource record set.</p> </li> <li> + * <p>You can't create latency, failover, or geolocation resource record sets that have the same values for + * the <code>Name</code> and <code>Type</code> elements as weighted resource record + * sets.</p> </li> <li> <p>You can create a maximum of 100 weighted resource record sets + * that have the same values for the <code>Name</code> and <code>Type</code> + * elements.</p> </li> <li> <p>For weighted (but not weighted alias) resource record sets, + * if you set <code>Weight</code> to <code>0</code> for a resource record set, Route 53 + * never responds to queries with the applicable value for that resource record set. However, if you set + * <code>Weight</code> to <code>0</code> for all resource record sets that have the same + * combination of DNS name and type, traffic is routed to all resources with equal probability.</p> + * <p>The effect of setting <code>Weight</code> to <code>0</code> is different when + * you associate health checks with weighted resource record sets. For more information, see <a + * href='https://docs.aws.amazon.com/Route53/latest/DeveloperGuide/dns-failover-configuring-options.html'>Options + * for Configuring Route 53 Active-Active and Active-Passive Failover</a> in the <i>Amazon Route 53 + * Developer Guide</i>.</p> </li> </ul>. + * + * @param weight the weight value to set. + * @return the AwsRoute53ResourceRecordSetProperties object itself. + */ + public AwsRoute53ResourceRecordSetProperties withWeight(Long weight) { + this.weight = weight; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (aliasTarget() != null) { + aliasTarget().validate(); + } + if (cidrRoutingConfig() != null) { + cidrRoutingConfig().validate(); + } + if (failover() != null) { + failover().validate(); + } + if (geoLocation() != null) { + geoLocation().validate(); + } + if (geoProximityLocation() != null) { + geoProximityLocation().validate(); + } + if (region() != null) { + region().validate(); + } + if (resourceRecords() != null) { + resourceRecords().forEach(e -> e.validate()); + } + if (type() != null) { + type().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("aliasTarget", this.aliasTarget); + jsonWriter.writeJsonField("cidrRoutingConfig", this.cidrRoutingConfig); + jsonWriter.writeJsonField("failover", this.failover); + jsonWriter.writeJsonField("geoLocation", this.geoLocation); + jsonWriter.writeJsonField("geoProximityLocation", this.geoProximityLocation); + jsonWriter.writeStringField("healthCheckId", this.healthCheckId); + jsonWriter.writeBooleanField("multiValueAnswer", this.multiValueAnswer); + jsonWriter.writeStringField("name", this.name); + jsonWriter.writeJsonField("region", this.region); + jsonWriter.writeArrayField("resourceRecords", this.resourceRecords, + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("setIdentifier", this.setIdentifier); + jsonWriter.writeNumberField("ttl", this.ttl); + jsonWriter.writeStringField("trafficPolicyInstanceId", this.trafficPolicyInstanceId); + jsonWriter.writeJsonField("type", this.type); + jsonWriter.writeNumberField("weight", this.weight); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AwsRoute53ResourceRecordSetProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AwsRoute53ResourceRecordSetProperties if the JsonReader was pointing to an instance of it, + * or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the AwsRoute53ResourceRecordSetProperties. + */ + public static AwsRoute53ResourceRecordSetProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AwsRoute53ResourceRecordSetProperties deserializedAwsRoute53ResourceRecordSetProperties + = new AwsRoute53ResourceRecordSetProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("aliasTarget".equals(fieldName)) { + deserializedAwsRoute53ResourceRecordSetProperties.aliasTarget = AliasTarget.fromJson(reader); + } else if ("cidrRoutingConfig".equals(fieldName)) { + deserializedAwsRoute53ResourceRecordSetProperties.cidrRoutingConfig + = CidrRoutingConfig.fromJson(reader); + } else if ("failover".equals(fieldName)) { + deserializedAwsRoute53ResourceRecordSetProperties.failover + = ResourceRecordSetFailoverEnumValue.fromJson(reader); + } else if ("geoLocation".equals(fieldName)) { + deserializedAwsRoute53ResourceRecordSetProperties.geoLocation = GeoLocation.fromJson(reader); + } else if ("geoProximityLocation".equals(fieldName)) { + deserializedAwsRoute53ResourceRecordSetProperties.geoProximityLocation + = GeoProximityLocation.fromJson(reader); + } else if ("healthCheckId".equals(fieldName)) { + deserializedAwsRoute53ResourceRecordSetProperties.healthCheckId = reader.getString(); + } else if ("multiValueAnswer".equals(fieldName)) { + deserializedAwsRoute53ResourceRecordSetProperties.multiValueAnswer + = reader.getNullable(JsonReader::getBoolean); + } else if ("name".equals(fieldName)) { + deserializedAwsRoute53ResourceRecordSetProperties.name = reader.getString(); + } else if ("region".equals(fieldName)) { + deserializedAwsRoute53ResourceRecordSetProperties.region + = ResourceRecordSetRegionEnumValue.fromJson(reader); + } else if ("resourceRecords".equals(fieldName)) { + List resourceRecords + = reader.readArray(reader1 -> ResourceRecord.fromJson(reader1)); + deserializedAwsRoute53ResourceRecordSetProperties.resourceRecords = resourceRecords; + } else if ("setIdentifier".equals(fieldName)) { + deserializedAwsRoute53ResourceRecordSetProperties.setIdentifier = reader.getString(); + } else if ("ttl".equals(fieldName)) { + deserializedAwsRoute53ResourceRecordSetProperties.ttl = reader.getNullable(JsonReader::getLong); + } else if ("trafficPolicyInstanceId".equals(fieldName)) { + deserializedAwsRoute53ResourceRecordSetProperties.trafficPolicyInstanceId = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedAwsRoute53ResourceRecordSetProperties.type = RRTypeEnumValue.fromJson(reader); + } else if ("weight".equals(fieldName)) { + deserializedAwsRoute53ResourceRecordSetProperties.weight = reader.getNullable(JsonReader::getLong); + } else { + reader.skipChildren(); + } + } + + return deserializedAwsRoute53ResourceRecordSetProperties; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/AwsS3AccessPointProperties.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/AwsS3AccessPointProperties.java new file mode 100644 index 000000000000..7b991e49381b --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/AwsS3AccessPointProperties.java @@ -0,0 +1,361 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of awsS3AccessPoint. + */ +@Fluent +public final class AwsS3AccessPointProperties implements JsonSerializable { + /* + * The alias of this Access Point. This alias can be used for compatibility purposes with other AWS services and + * third-party applications. + */ + private String alias; + + /* + * The Amazon Resource Name (ARN) of the specified accesspoint. the Amazon Resource Name (ARN) of the specified + * accesspoint. + */ + private String arn; + + /* + * The name of the bucket that you want to associate this Access Point with. + */ + private String bucket; + + /* + * The AWS account ID associated with the S3 bucket associated with this access point. + */ + private String bucketAccountId; + + /* + * The name you want to assign to this Access Point. If you don't specify a name, AWS CloudFormation generates a + * unique ID and uses that ID for the access point name. + */ + private String name; + + /* + * Indicates whether this Access Point allows access from the public Internet. If VpcConfiguration is specified for + * this Access Point, then NetworkOrigin is VPC, and the Access Point doesn't allow access from the public Internet. + * Otherwise, NetworkOrigin is Internet, and the Access Point allows access from the public Internet, subject to the + * Access Point and bucket access policies. + */ + private NetworkOrigin networkOrigin; + + /* + * The Access Point Policy you want to apply to this access point. + */ + private Object policy; + + /* + * The PublicAccessBlock configuration that you want to apply to this Access Point. You can enable the configuration + * options in any combination. For more information about when Amazon S3 considers a bucket or object public, see + * https://docs.aws.amazon.com/AmazonS3/latest/dev/access-control-block-public-access.html#access-control-block- + * public-access-policy-status 'The Meaning of Public' in the Amazon Simple Storage Service Developer Guide. + */ + private PublicAccessBlockConfiguration publicAccessBlockConfiguration; + + /* + * If you include this field, Amazon S3 restricts access to this Access Point to requests from the specified Virtual + * Private Cloud (VPC). The Virtual Private Cloud (VPC) configuration for a bucket access point. + */ + private VpcConfiguration vpcConfiguration; + + /** + * Creates an instance of AwsS3AccessPointProperties class. + */ + public AwsS3AccessPointProperties() { + } + + /** + * Get the alias property: The alias of this Access Point. This alias can be used for compatibility purposes with + * other AWS services and third-party applications. + * + * @return the alias value. + */ + public String alias() { + return this.alias; + } + + /** + * Set the alias property: The alias of this Access Point. This alias can be used for compatibility purposes with + * other AWS services and third-party applications. + * + * @param alias the alias value to set. + * @return the AwsS3AccessPointProperties object itself. + */ + public AwsS3AccessPointProperties withAlias(String alias) { + this.alias = alias; + return this; + } + + /** + * Get the arn property: The Amazon Resource Name (ARN) of the specified accesspoint. the Amazon Resource Name (ARN) + * of the specified accesspoint. + * + * @return the arn value. + */ + public String arn() { + return this.arn; + } + + /** + * Set the arn property: The Amazon Resource Name (ARN) of the specified accesspoint. the Amazon Resource Name (ARN) + * of the specified accesspoint. + * + * @param arn the arn value to set. + * @return the AwsS3AccessPointProperties object itself. + */ + public AwsS3AccessPointProperties withArn(String arn) { + this.arn = arn; + return this; + } + + /** + * Get the bucket property: The name of the bucket that you want to associate this Access Point with. + * + * @return the bucket value. + */ + public String bucket() { + return this.bucket; + } + + /** + * Set the bucket property: The name of the bucket that you want to associate this Access Point with. + * + * @param bucket the bucket value to set. + * @return the AwsS3AccessPointProperties object itself. + */ + public AwsS3AccessPointProperties withBucket(String bucket) { + this.bucket = bucket; + return this; + } + + /** + * Get the bucketAccountId property: The AWS account ID associated with the S3 bucket associated with this access + * point. + * + * @return the bucketAccountId value. + */ + public String bucketAccountId() { + return this.bucketAccountId; + } + + /** + * Set the bucketAccountId property: The AWS account ID associated with the S3 bucket associated with this access + * point. + * + * @param bucketAccountId the bucketAccountId value to set. + * @return the AwsS3AccessPointProperties object itself. + */ + public AwsS3AccessPointProperties withBucketAccountId(String bucketAccountId) { + this.bucketAccountId = bucketAccountId; + return this; + } + + /** + * Get the name property: The name you want to assign to this Access Point. If you don't specify a name, AWS + * CloudFormation generates a unique ID and uses that ID for the access point name. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: The name you want to assign to this Access Point. If you don't specify a name, AWS + * CloudFormation generates a unique ID and uses that ID for the access point name. + * + * @param name the name value to set. + * @return the AwsS3AccessPointProperties object itself. + */ + public AwsS3AccessPointProperties withName(String name) { + this.name = name; + return this; + } + + /** + * Get the networkOrigin property: Indicates whether this Access Point allows access from the public Internet. If + * VpcConfiguration is specified for this Access Point, then NetworkOrigin is VPC, and the Access Point doesn't + * allow access from the public Internet. Otherwise, NetworkOrigin is Internet, and the Access Point allows access + * from the public Internet, subject to the Access Point and bucket access policies. + * + * @return the networkOrigin value. + */ + public NetworkOrigin networkOrigin() { + return this.networkOrigin; + } + + /** + * Set the networkOrigin property: Indicates whether this Access Point allows access from the public Internet. If + * VpcConfiguration is specified for this Access Point, then NetworkOrigin is VPC, and the Access Point doesn't + * allow access from the public Internet. Otherwise, NetworkOrigin is Internet, and the Access Point allows access + * from the public Internet, subject to the Access Point and bucket access policies. + * + * @param networkOrigin the networkOrigin value to set. + * @return the AwsS3AccessPointProperties object itself. + */ + public AwsS3AccessPointProperties withNetworkOrigin(NetworkOrigin networkOrigin) { + this.networkOrigin = networkOrigin; + return this; + } + + /** + * Get the policy property: The Access Point Policy you want to apply to this access point. + * + * @return the policy value. + */ + public Object policy() { + return this.policy; + } + + /** + * Set the policy property: The Access Point Policy you want to apply to this access point. + * + * @param policy the policy value to set. + * @return the AwsS3AccessPointProperties object itself. + */ + public AwsS3AccessPointProperties withPolicy(Object policy) { + this.policy = policy; + return this; + } + + /** + * Get the publicAccessBlockConfiguration property: The PublicAccessBlock configuration that you want to apply to + * this Access Point. You can enable the configuration options in any combination. For more information about when + * Amazon S3 considers a bucket or object public, see + * https://docs.aws.amazon.com/AmazonS3/latest/dev/access-control-block-public-access.html#access-control-block-public-access-policy-status + * 'The Meaning of Public' in the Amazon Simple Storage Service Developer Guide. + * + * @return the publicAccessBlockConfiguration value. + */ + public PublicAccessBlockConfiguration publicAccessBlockConfiguration() { + return this.publicAccessBlockConfiguration; + } + + /** + * Set the publicAccessBlockConfiguration property: The PublicAccessBlock configuration that you want to apply to + * this Access Point. You can enable the configuration options in any combination. For more information about when + * Amazon S3 considers a bucket or object public, see + * https://docs.aws.amazon.com/AmazonS3/latest/dev/access-control-block-public-access.html#access-control-block-public-access-policy-status + * 'The Meaning of Public' in the Amazon Simple Storage Service Developer Guide. + * + * @param publicAccessBlockConfiguration the publicAccessBlockConfiguration value to set. + * @return the AwsS3AccessPointProperties object itself. + */ + public AwsS3AccessPointProperties + withPublicAccessBlockConfiguration(PublicAccessBlockConfiguration publicAccessBlockConfiguration) { + this.publicAccessBlockConfiguration = publicAccessBlockConfiguration; + return this; + } + + /** + * Get the vpcConfiguration property: If you include this field, Amazon S3 restricts access to this Access Point to + * requests from the specified Virtual Private Cloud (VPC). The Virtual Private Cloud (VPC) configuration for a + * bucket access point. + * + * @return the vpcConfiguration value. + */ + public VpcConfiguration vpcConfiguration() { + return this.vpcConfiguration; + } + + /** + * Set the vpcConfiguration property: If you include this field, Amazon S3 restricts access to this Access Point to + * requests from the specified Virtual Private Cloud (VPC). The Virtual Private Cloud (VPC) configuration for a + * bucket access point. + * + * @param vpcConfiguration the vpcConfiguration value to set. + * @return the AwsS3AccessPointProperties object itself. + */ + public AwsS3AccessPointProperties withVpcConfiguration(VpcConfiguration vpcConfiguration) { + this.vpcConfiguration = vpcConfiguration; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (publicAccessBlockConfiguration() != null) { + publicAccessBlockConfiguration().validate(); + } + if (vpcConfiguration() != null) { + vpcConfiguration().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("alias", this.alias); + jsonWriter.writeStringField("arn", this.arn); + jsonWriter.writeStringField("bucket", this.bucket); + jsonWriter.writeStringField("bucketAccountId", this.bucketAccountId); + jsonWriter.writeStringField("name", this.name); + jsonWriter.writeStringField("networkOrigin", this.networkOrigin == null ? null : this.networkOrigin.toString()); + jsonWriter.writeUntypedField("policy", this.policy); + jsonWriter.writeJsonField("publicAccessBlockConfiguration", this.publicAccessBlockConfiguration); + jsonWriter.writeJsonField("vpcConfiguration", this.vpcConfiguration); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AwsS3AccessPointProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AwsS3AccessPointProperties if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IOException If an error occurs while reading the AwsS3AccessPointProperties. + */ + public static AwsS3AccessPointProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AwsS3AccessPointProperties deserializedAwsS3AccessPointProperties = new AwsS3AccessPointProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("alias".equals(fieldName)) { + deserializedAwsS3AccessPointProperties.alias = reader.getString(); + } else if ("arn".equals(fieldName)) { + deserializedAwsS3AccessPointProperties.arn = reader.getString(); + } else if ("bucket".equals(fieldName)) { + deserializedAwsS3AccessPointProperties.bucket = reader.getString(); + } else if ("bucketAccountId".equals(fieldName)) { + deserializedAwsS3AccessPointProperties.bucketAccountId = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedAwsS3AccessPointProperties.name = reader.getString(); + } else if ("networkOrigin".equals(fieldName)) { + deserializedAwsS3AccessPointProperties.networkOrigin = NetworkOrigin.fromString(reader.getString()); + } else if ("policy".equals(fieldName)) { + deserializedAwsS3AccessPointProperties.policy = reader.readUntyped(); + } else if ("publicAccessBlockConfiguration".equals(fieldName)) { + deserializedAwsS3AccessPointProperties.publicAccessBlockConfiguration + = PublicAccessBlockConfiguration.fromJson(reader); + } else if ("vpcConfiguration".equals(fieldName)) { + deserializedAwsS3AccessPointProperties.vpcConfiguration = VpcConfiguration.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedAwsS3AccessPointProperties; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/AwsS3BucketPolicyProperties.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/AwsS3BucketPolicyProperties.java new file mode 100644 index 000000000000..ff4faf2fbc9d --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/AwsS3BucketPolicyProperties.java @@ -0,0 +1,93 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of awsS3BucketPolicy. + */ +@Fluent +public final class AwsS3BucketPolicyProperties implements JsonSerializable { + /* + *

The bucket policy as a JSON document.

+ */ + private String policy; + + /** + * Creates an instance of AwsS3BucketPolicyProperties class. + */ + public AwsS3BucketPolicyProperties() { + } + + /** + * Get the policy property: <p>The bucket policy as a JSON document.</p>. + * + * @return the policy value. + */ + public String policy() { + return this.policy; + } + + /** + * Set the policy property: <p>The bucket policy as a JSON document.</p>. + * + * @param policy the policy value to set. + * @return the AwsS3BucketPolicyProperties object itself. + */ + public AwsS3BucketPolicyProperties withPolicy(String policy) { + this.policy = policy; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("policy", this.policy); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AwsS3BucketPolicyProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AwsS3BucketPolicyProperties if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the AwsS3BucketPolicyProperties. + */ + public static AwsS3BucketPolicyProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AwsS3BucketPolicyProperties deserializedAwsS3BucketPolicyProperties = new AwsS3BucketPolicyProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("policy".equals(fieldName)) { + deserializedAwsS3BucketPolicyProperties.policy = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedAwsS3BucketPolicyProperties; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/AwsS3BucketProperties.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/AwsS3BucketProperties.java new file mode 100644 index 000000000000..7d7bf8d5d98b --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/AwsS3BucketProperties.java @@ -0,0 +1,1150 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Definition of awsS3Bucket. + */ +@Fluent +public final class AwsS3BucketProperties implements JsonSerializable { + /* + * Configures the transfer acceleration state for an Amazon S3 bucket. For more information, see [Amazon S3 Transfer + * Acceleration](https://docs.aws.amazon.com/AmazonS3/latest/dev/transfer-acceleration.html) in the *Amazon S3 User + * Guide*. Configures the transfer acceleration state for an Amazon S3 bucket. For more information, see [Amazon S3 + * Transfer Acceleration](https://docs.aws.amazon.com/AmazonS3/latest/dev/transfer-acceleration.html) in the *Amazon + * S3 User Guide*. + */ + private AccelerateConfiguration accelerateConfiguration; + + /* + * This is a legacy property, and it is not recommended for most use cases. A majority of modern use cases in Amazon + * S3 no longer require the use of ACLs, and we recommend that you keep ACLs disabled. For more information, see + * [Controlling object + * ownership](https://docs.aws.amazon.com//AmazonS3/latest/userguide/about-object-ownership.html) in the *Amazon S3 + * User Guide*. A canned access control list (ACL) that grants predefined permissions to the bucket. For more + * information about canned ACLs, see [Canned + * ACL](https://docs.aws.amazon.com/AmazonS3/latest/dev/acl-overview.html#canned-acl) in the *Amazon S3 User Guide*. + * S3 buckets are created with ACLs disabled by default. Therefore, unless you explicitly set the + * [AWS::S3::OwnershipControls](https://docs.aws.amazon.com//AWSCloudFormation/latest/UserGuide/aws-properties-s3- + * bucket-ownershipcontrols.html) property to enable ACLs, your resource will fail to deploy with any value other + * than Private. Use cases requiring ACLs are uncommon. The majority of access control configurations can be + * successfully and more easily achieved with bucket policies. For more information, see + * [AWS::S3::BucketPolicy](https://docs.aws.amazon.com//AWSCloudFormation/latest/UserGuide/aws-properties-s3-policy. + * html). For examples of common policy configurations, including S3 Server Access Logs buckets and more, see + * [Bucket policy examples](https://docs.aws.amazon.com/AmazonS3/latest/userguide/example-bucket-policies.html) in + * the *Amazon S3 User Guide*. + */ + private AccessControl accessControl; + + /* + * Specifies the configuration and any analyses for the analytics filter of an Amazon S3 bucket. + */ + private List analyticsConfigurations; + + /* + * the Amazon Resource Name (ARN) of the specified bucket. + */ + private String arn; + + /* + * Specifies default encryption for a bucket using server-side encryption with Amazon S3-managed keys (SSE-S3), AWS + * KMS-managed keys (SSE-KMS), or dual-layer server-side encryption with KMS-managed keys (DSSE-KMS). For + * information about the Amazon S3 default encryption feature, see [Amazon S3 Default Encryption for S3 + * Buckets](https://docs.aws.amazon.com/AmazonS3/latest/dev/bucket-encryption.html) in the *Amazon S3 User Guide*. + * Specifies default encryption for a bucket using server-side encryption with Amazon S3-managed keys (SSE-S3), AWS + * KMS-managed keys (SSE-KMS), or dual-layer server-side encryption with KMS-managed keys (DSSE-KMS). For + * information about the Amazon S3 default encryption feature, see [Amazon S3 Default Encryption for S3 + * Buckets](https://docs.aws.amazon.com/AmazonS3/latest/dev/bucket-encryption.html) in the *Amazon S3 User Guide*. + */ + private BucketEncryption bucketEncryption; + + /* + * A name for the bucket. If you don't specify a name, AWS CloudFormation generates a unique ID and uses that ID for + * the bucket name. The bucket name must contain only lowercase letters, numbers, periods (.), and dashes (-) and + * must follow [Amazon S3 bucket restrictions and + * limitations](https://docs.aws.amazon.com/AmazonS3/latest/dev/BucketRestrictions.html). For more information, see + * [Rules for naming Amazon S3 + * buckets](https://docs.aws.amazon.com/AmazonS3/latest/dev/BucketRestrictions.html#bucketnamingrules) in the + * *Amazon S3 User Guide*. If you specify a name, you can't perform updates that require replacement of this + * resource. You can perform updates that require no or some interruption. If you need to replace the resource, + * specify a new name. + */ + private String bucketName; + + /* + * Describes the cross-origin access configuration for objects in an Amazon S3 bucket. For more information, see + * [Enabling Cross-Origin Resource Sharing](https://docs.aws.amazon.com/AmazonS3/latest/dev/cors.html) in the + * *Amazon S3 User Guide*. Describes the cross-origin access configuration for objects in an Amazon S3 bucket. For + * more information, see [Enabling Cross-Origin Resource + * Sharing](https://docs.aws.amazon.com/AmazonS3/latest/dev/cors.html) in the *Amazon S3 User Guide*. + */ + private CorsConfiguration corsConfiguration; + + /* + * Property domainName + */ + private String domainName; + + /* + * Property dualStackDomainName + */ + private String dualStackDomainName; + + /* + * Defines how Amazon S3 handles Intelligent-Tiering storage. + */ + private List intelligentTieringConfigurations; + + /* + * Specifies the inventory configuration for an Amazon S3 bucket. For more information, see [GET Bucket + * inventory](https://docs.aws.amazon.com/AmazonS3/latest/API/RESTBucketGETInventoryConfig.html) in the *Amazon S3 + * API Reference*. + */ + private List inventoryConfigurations; + + /* + * Specifies the lifecycle configuration for objects in an Amazon S3 bucket. For more information, see [Object + * Lifecycle Management](https://docs.aws.amazon.com/AmazonS3/latest/dev/object-lifecycle-mgmt.html) in the *Amazon + * S3 User Guide*. Specifies the lifecycle configuration for objects in an Amazon S3 bucket. For more information, + * see [Object Lifecycle Management](https://docs.aws.amazon.com/AmazonS3/latest/dev/object-lifecycle-mgmt.html) in + * the *Amazon S3 User Guide*. + */ + private LifecycleConfiguration lifecycleConfiguration; + + /* + * Settings that define where logs are stored. Describes where logs are stored and the prefix that Amazon S3 assigns + * to all log object keys for a bucket. For examples and more information, see [PUT Bucket + * logging](https://docs.aws.amazon.com/AmazonS3/latest/API/RESTBucketPUTlogging.html) in the *Amazon S3 API + * Reference*. To successfully complete the ``AWS::S3::Bucket LoggingConfiguration`` request, you must have + * ``s3:PutObject`` and ``s3:PutObjectAcl`` in your IAM permissions. + */ + private LoggingConfiguration loggingConfiguration; + + /* + * Specifies a metrics configuration for the CloudWatch request metrics (specified by the metrics configuration ID) + * from an Amazon S3 bucket. If you're updating an existing metrics configuration, note that this is a full + * replacement of the existing metrics configuration. If you don't include the elements you want to keep, they are + * erased. For more information, see + * [PutBucketMetricsConfiguration](https://docs.aws.amazon.com/AmazonS3/latest/API/RESTBucketPUTMetricConfiguration. + * html). + */ + private List metricsConfigurations; + + /* + * Configuration that defines how Amazon S3 handles bucket notifications. Describes the notification configuration + * for an Amazon S3 bucket. If you create the target resource and related permissions in the same template, you + * might have a circular dependency. For example, you might use the ``AWS::Lambda::Permission`` resource to grant + * the bucket permission to invoke an AWS Lambda function. However, AWS CloudFormation can't create the bucket until + * the bucket has permission to invoke the function (AWS CloudFormation checks whether the bucket can invoke the + * function). If you're using Refs to pass the bucket name, this leads to a circular dependency. To avoid this + * dependency, you can create all resources without specifying the notification configuration. Then, update the + * stack with a notification configuration. For more information on permissions, see + * [AWS::Lambda::Permission](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda- + * permission.html) and [Granting Permissions to Publish Event Notification Messages to a + * Destination](https://docs.aws.amazon.com/AmazonS3/latest/dev/NotificationHowTo.html#grant-destinations- + * permissions-to-s3). + */ + private NotificationConfigurationAutoGenerated2 notificationConfiguration; + + /* + * This operation is not supported by directory buckets. Places an Object Lock configuration on the specified + * bucket. The rule specified in the Object Lock configuration will be applied by default to every new object placed + * in the specified bucket. For more information, see [Locking + * Objects](https://docs.aws.amazon.com/AmazonS3/latest/dev/object-lock.html). + The ``DefaultRetention`` settings + * require both a mode and a period. + The ``DefaultRetention`` period can be either ``Days`` or ``Years`` but you + * must select one. You cannot specify ``Days`` and ``Years`` at the same time. + You can enable Object Lock for new + * or existing buckets. For more information, see [Configuring Object + * Lock](https://docs.aws.amazon.com/AmazonS3/latest/userguide/object-lock-configure.html). Places an Object Lock + * configuration on the specified bucket. The rule specified in the Object Lock configuration will be applied by + * default to every new object placed in the specified bucket. For more information, see [Locking + * Objects](https://docs.aws.amazon.com/AmazonS3/latest/dev/object-lock.html). + */ + private ObjectLockConfiguration objectLockConfiguration; + + /* + * Indicates whether this bucket has an Object Lock configuration enabled. Enable ``ObjectLockEnabled`` when you + * apply ``ObjectLockConfiguration`` to a bucket. + */ + private Boolean objectLockEnabled; + + /* + * Configuration that defines how Amazon S3 handles Object Ownership rules. Specifies the container element for + * Object Ownership rules. S3 Object Ownership is an Amazon S3 bucket-level setting that you can use to disable + * access control lists (ACLs) and take ownership of every object in your bucket, simplifying access management for + * data stored in Amazon S3. For more information, see [Controlling ownership of objects and disabling + * ACLs](https://docs.aws.amazon.com/AmazonS3/latest/userguide/about-object-ownership.html) in the *Amazon S3 User + * Guide*. + */ + private OwnershipControls ownershipControls; + + /* + * Configuration that defines how Amazon S3 handles public access. The PublicAccessBlock configuration that you want + * to apply to this Amazon S3 bucket. You can enable the configuration options in any combination. For more + * information about when Amazon S3 considers a bucket or object public, see [The Meaning of + * 'Public'](https://docs.aws.amazon.com/AmazonS3/latest/dev/access-control-block-public-access.html#access-control- + * block-public-access-policy-status) in the *Amazon S3 User Guide*. + */ + private PublicAccessBlockConfigurationAutoGenerated publicAccessBlockConfiguration; + + /* + * Property regionalDomainName + */ + private String regionalDomainName; + + /* + * Configuration for replicating objects in an S3 bucket. To enable replication, you must also enable versioning by + * using the ``VersioningConfiguration`` property. Amazon S3 can store replicated objects in a single destination + * bucket or multiple destination buckets. The destination bucket or buckets must already exist. A container for + * replication rules. You can add up to 1,000 rules. The maximum size of a replication configuration is 2 MB. The + * latest version of the replication configuration XML is V2. For more information about XML V2 replication + * configurations, see [Replication + * configuration](https://docs.aws.amazon.com/AmazonS3/latest/userguide/replication-add-config.html) in the *Amazon + * S3 User Guide*. + */ + private ReplicationConfigurationAutoGenerated replicationConfiguration; + + /* + * An arbitrary set of tags (key-value pairs) for this S3 bucket. + */ + private List tags; + + /* + * Enables multiple versions of all objects in this bucket. You might enable versioning to prevent objects from + * being deleted or overwritten by mistake or to archive objects so that you can retrieve previous versions of them. + * Describes the versioning state of an Amazon S3 bucket. For more information, see [PUT Bucket + * versioning](https://docs.aws.amazon.com/AmazonS3/latest/API/RESTBucketPUTVersioningStatus.html) in the *Amazon S3 + * API Reference*. + */ + private VersioningConfiguration versioningConfiguration; + + /* + * Information used to configure the bucket as a static website. For more information, see [Hosting Websites on + * Amazon S3](https://docs.aws.amazon.com/AmazonS3/latest/dev/WebsiteHosting.html). Specifies website configuration + * parameters for an Amazon S3 bucket. + */ + private WebsiteConfiguration websiteConfiguration; + + /* + * Property websiteURL + */ + private String websiteUrl; + + /** + * Creates an instance of AwsS3BucketProperties class. + */ + public AwsS3BucketProperties() { + } + + /** + * Get the accelerateConfiguration property: Configures the transfer acceleration state for an Amazon S3 bucket. For + * more information, see [Amazon S3 Transfer + * Acceleration](https://docs.aws.amazon.com/AmazonS3/latest/dev/transfer-acceleration.html) in the *Amazon S3 User + * Guide*. Configures the transfer acceleration state for an Amazon S3 bucket. For more information, see [Amazon S3 + * Transfer Acceleration](https://docs.aws.amazon.com/AmazonS3/latest/dev/transfer-acceleration.html) in the *Amazon + * S3 User Guide*. + * + * @return the accelerateConfiguration value. + */ + public AccelerateConfiguration accelerateConfiguration() { + return this.accelerateConfiguration; + } + + /** + * Set the accelerateConfiguration property: Configures the transfer acceleration state for an Amazon S3 bucket. For + * more information, see [Amazon S3 Transfer + * Acceleration](https://docs.aws.amazon.com/AmazonS3/latest/dev/transfer-acceleration.html) in the *Amazon S3 User + * Guide*. Configures the transfer acceleration state for an Amazon S3 bucket. For more information, see [Amazon S3 + * Transfer Acceleration](https://docs.aws.amazon.com/AmazonS3/latest/dev/transfer-acceleration.html) in the *Amazon + * S3 User Guide*. + * + * @param accelerateConfiguration the accelerateConfiguration value to set. + * @return the AwsS3BucketProperties object itself. + */ + public AwsS3BucketProperties withAccelerateConfiguration(AccelerateConfiguration accelerateConfiguration) { + this.accelerateConfiguration = accelerateConfiguration; + return this; + } + + /** + * Get the accessControl property: This is a legacy property, and it is not recommended for most use cases. A + * majority of modern use cases in Amazon S3 no longer require the use of ACLs, and we recommend that you keep ACLs + * disabled. For more information, see [Controlling object + * ownership](https://docs.aws.amazon.com//AmazonS3/latest/userguide/about-object-ownership.html) in the *Amazon S3 + * User Guide*. A canned access control list (ACL) that grants predefined permissions to the bucket. For more + * information about canned ACLs, see [Canned + * ACL](https://docs.aws.amazon.com/AmazonS3/latest/dev/acl-overview.html#canned-acl) in the *Amazon S3 User Guide*. + * S3 buckets are created with ACLs disabled by default. Therefore, unless you explicitly set the + * [AWS::S3::OwnershipControls](https://docs.aws.amazon.com//AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-ownershipcontrols.html) + * property to enable ACLs, your resource will fail to deploy with any value other than Private. Use cases requiring + * ACLs are uncommon. The majority of access control configurations can be successfully and more easily achieved + * with bucket policies. For more information, see + * [AWS::S3::BucketPolicy](https://docs.aws.amazon.com//AWSCloudFormation/latest/UserGuide/aws-properties-s3-policy.html). + * For examples of common policy configurations, including S3 Server Access Logs buckets and more, see [Bucket + * policy examples](https://docs.aws.amazon.com/AmazonS3/latest/userguide/example-bucket-policies.html) in the + * *Amazon S3 User Guide*. + * + * @return the accessControl value. + */ + public AccessControl accessControl() { + return this.accessControl; + } + + /** + * Set the accessControl property: This is a legacy property, and it is not recommended for most use cases. A + * majority of modern use cases in Amazon S3 no longer require the use of ACLs, and we recommend that you keep ACLs + * disabled. For more information, see [Controlling object + * ownership](https://docs.aws.amazon.com//AmazonS3/latest/userguide/about-object-ownership.html) in the *Amazon S3 + * User Guide*. A canned access control list (ACL) that grants predefined permissions to the bucket. For more + * information about canned ACLs, see [Canned + * ACL](https://docs.aws.amazon.com/AmazonS3/latest/dev/acl-overview.html#canned-acl) in the *Amazon S3 User Guide*. + * S3 buckets are created with ACLs disabled by default. Therefore, unless you explicitly set the + * [AWS::S3::OwnershipControls](https://docs.aws.amazon.com//AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-ownershipcontrols.html) + * property to enable ACLs, your resource will fail to deploy with any value other than Private. Use cases requiring + * ACLs are uncommon. The majority of access control configurations can be successfully and more easily achieved + * with bucket policies. For more information, see + * [AWS::S3::BucketPolicy](https://docs.aws.amazon.com//AWSCloudFormation/latest/UserGuide/aws-properties-s3-policy.html). + * For examples of common policy configurations, including S3 Server Access Logs buckets and more, see [Bucket + * policy examples](https://docs.aws.amazon.com/AmazonS3/latest/userguide/example-bucket-policies.html) in the + * *Amazon S3 User Guide*. + * + * @param accessControl the accessControl value to set. + * @return the AwsS3BucketProperties object itself. + */ + public AwsS3BucketProperties withAccessControl(AccessControl accessControl) { + this.accessControl = accessControl; + return this; + } + + /** + * Get the analyticsConfigurations property: Specifies the configuration and any analyses for the analytics filter + * of an Amazon S3 bucket. + * + * @return the analyticsConfigurations value. + */ + public List analyticsConfigurations() { + return this.analyticsConfigurations; + } + + /** + * Set the analyticsConfigurations property: Specifies the configuration and any analyses for the analytics filter + * of an Amazon S3 bucket. + * + * @param analyticsConfigurations the analyticsConfigurations value to set. + * @return the AwsS3BucketProperties object itself. + */ + public AwsS3BucketProperties withAnalyticsConfigurations(List analyticsConfigurations) { + this.analyticsConfigurations = analyticsConfigurations; + return this; + } + + /** + * Get the arn property: the Amazon Resource Name (ARN) of the specified bucket. + * + * @return the arn value. + */ + public String arn() { + return this.arn; + } + + /** + * Set the arn property: the Amazon Resource Name (ARN) of the specified bucket. + * + * @param arn the arn value to set. + * @return the AwsS3BucketProperties object itself. + */ + public AwsS3BucketProperties withArn(String arn) { + this.arn = arn; + return this; + } + + /** + * Get the bucketEncryption property: Specifies default encryption for a bucket using server-side encryption with + * Amazon S3-managed keys (SSE-S3), AWS KMS-managed keys (SSE-KMS), or dual-layer server-side encryption with + * KMS-managed keys (DSSE-KMS). For information about the Amazon S3 default encryption feature, see [Amazon S3 + * Default Encryption for S3 Buckets](https://docs.aws.amazon.com/AmazonS3/latest/dev/bucket-encryption.html) in the + * *Amazon S3 User Guide*. Specifies default encryption for a bucket using server-side encryption with Amazon + * S3-managed keys (SSE-S3), AWS KMS-managed keys (SSE-KMS), or dual-layer server-side encryption with KMS-managed + * keys (DSSE-KMS). For information about the Amazon S3 default encryption feature, see [Amazon S3 Default + * Encryption for S3 Buckets](https://docs.aws.amazon.com/AmazonS3/latest/dev/bucket-encryption.html) in the *Amazon + * S3 User Guide*. + * + * @return the bucketEncryption value. + */ + public BucketEncryption bucketEncryption() { + return this.bucketEncryption; + } + + /** + * Set the bucketEncryption property: Specifies default encryption for a bucket using server-side encryption with + * Amazon S3-managed keys (SSE-S3), AWS KMS-managed keys (SSE-KMS), or dual-layer server-side encryption with + * KMS-managed keys (DSSE-KMS). For information about the Amazon S3 default encryption feature, see [Amazon S3 + * Default Encryption for S3 Buckets](https://docs.aws.amazon.com/AmazonS3/latest/dev/bucket-encryption.html) in the + * *Amazon S3 User Guide*. Specifies default encryption for a bucket using server-side encryption with Amazon + * S3-managed keys (SSE-S3), AWS KMS-managed keys (SSE-KMS), or dual-layer server-side encryption with KMS-managed + * keys (DSSE-KMS). For information about the Amazon S3 default encryption feature, see [Amazon S3 Default + * Encryption for S3 Buckets](https://docs.aws.amazon.com/AmazonS3/latest/dev/bucket-encryption.html) in the *Amazon + * S3 User Guide*. + * + * @param bucketEncryption the bucketEncryption value to set. + * @return the AwsS3BucketProperties object itself. + */ + public AwsS3BucketProperties withBucketEncryption(BucketEncryption bucketEncryption) { + this.bucketEncryption = bucketEncryption; + return this; + } + + /** + * Get the bucketName property: A name for the bucket. If you don't specify a name, AWS CloudFormation generates a + * unique ID and uses that ID for the bucket name. The bucket name must contain only lowercase letters, numbers, + * periods (.), and dashes (-) and must follow [Amazon S3 bucket restrictions and + * limitations](https://docs.aws.amazon.com/AmazonS3/latest/dev/BucketRestrictions.html). For more information, see + * [Rules for naming Amazon S3 + * buckets](https://docs.aws.amazon.com/AmazonS3/latest/dev/BucketRestrictions.html#bucketnamingrules) in the + * *Amazon S3 User Guide*. If you specify a name, you can't perform updates that require replacement of this + * resource. You can perform updates that require no or some interruption. If you need to replace the resource, + * specify a new name. + * + * @return the bucketName value. + */ + public String bucketName() { + return this.bucketName; + } + + /** + * Set the bucketName property: A name for the bucket. If you don't specify a name, AWS CloudFormation generates a + * unique ID and uses that ID for the bucket name. The bucket name must contain only lowercase letters, numbers, + * periods (.), and dashes (-) and must follow [Amazon S3 bucket restrictions and + * limitations](https://docs.aws.amazon.com/AmazonS3/latest/dev/BucketRestrictions.html). For more information, see + * [Rules for naming Amazon S3 + * buckets](https://docs.aws.amazon.com/AmazonS3/latest/dev/BucketRestrictions.html#bucketnamingrules) in the + * *Amazon S3 User Guide*. If you specify a name, you can't perform updates that require replacement of this + * resource. You can perform updates that require no or some interruption. If you need to replace the resource, + * specify a new name. + * + * @param bucketName the bucketName value to set. + * @return the AwsS3BucketProperties object itself. + */ + public AwsS3BucketProperties withBucketName(String bucketName) { + this.bucketName = bucketName; + return this; + } + + /** + * Get the corsConfiguration property: Describes the cross-origin access configuration for objects in an Amazon S3 + * bucket. For more information, see [Enabling Cross-Origin Resource + * Sharing](https://docs.aws.amazon.com/AmazonS3/latest/dev/cors.html) in the *Amazon S3 User Guide*. Describes the + * cross-origin access configuration for objects in an Amazon S3 bucket. For more information, see [Enabling + * Cross-Origin Resource Sharing](https://docs.aws.amazon.com/AmazonS3/latest/dev/cors.html) in the *Amazon S3 User + * Guide*. + * + * @return the corsConfiguration value. + */ + public CorsConfiguration corsConfiguration() { + return this.corsConfiguration; + } + + /** + * Set the corsConfiguration property: Describes the cross-origin access configuration for objects in an Amazon S3 + * bucket. For more information, see [Enabling Cross-Origin Resource + * Sharing](https://docs.aws.amazon.com/AmazonS3/latest/dev/cors.html) in the *Amazon S3 User Guide*. Describes the + * cross-origin access configuration for objects in an Amazon S3 bucket. For more information, see [Enabling + * Cross-Origin Resource Sharing](https://docs.aws.amazon.com/AmazonS3/latest/dev/cors.html) in the *Amazon S3 User + * Guide*. + * + * @param corsConfiguration the corsConfiguration value to set. + * @return the AwsS3BucketProperties object itself. + */ + public AwsS3BucketProperties withCorsConfiguration(CorsConfiguration corsConfiguration) { + this.corsConfiguration = corsConfiguration; + return this; + } + + /** + * Get the domainName property: Property domainName. + * + * @return the domainName value. + */ + public String domainName() { + return this.domainName; + } + + /** + * Set the domainName property: Property domainName. + * + * @param domainName the domainName value to set. + * @return the AwsS3BucketProperties object itself. + */ + public AwsS3BucketProperties withDomainName(String domainName) { + this.domainName = domainName; + return this; + } + + /** + * Get the dualStackDomainName property: Property dualStackDomainName. + * + * @return the dualStackDomainName value. + */ + public String dualStackDomainName() { + return this.dualStackDomainName; + } + + /** + * Set the dualStackDomainName property: Property dualStackDomainName. + * + * @param dualStackDomainName the dualStackDomainName value to set. + * @return the AwsS3BucketProperties object itself. + */ + public AwsS3BucketProperties withDualStackDomainName(String dualStackDomainName) { + this.dualStackDomainName = dualStackDomainName; + return this; + } + + /** + * Get the intelligentTieringConfigurations property: Defines how Amazon S3 handles Intelligent-Tiering storage. + * + * @return the intelligentTieringConfigurations value. + */ + public List intelligentTieringConfigurations() { + return this.intelligentTieringConfigurations; + } + + /** + * Set the intelligentTieringConfigurations property: Defines how Amazon S3 handles Intelligent-Tiering storage. + * + * @param intelligentTieringConfigurations the intelligentTieringConfigurations value to set. + * @return the AwsS3BucketProperties object itself. + */ + public AwsS3BucketProperties + withIntelligentTieringConfigurations(List intelligentTieringConfigurations) { + this.intelligentTieringConfigurations = intelligentTieringConfigurations; + return this; + } + + /** + * Get the inventoryConfigurations property: Specifies the inventory configuration for an Amazon S3 bucket. For more + * information, see [GET Bucket + * inventory](https://docs.aws.amazon.com/AmazonS3/latest/API/RESTBucketGETInventoryConfig.html) in the *Amazon S3 + * API Reference*. + * + * @return the inventoryConfigurations value. + */ + public List inventoryConfigurations() { + return this.inventoryConfigurations; + } + + /** + * Set the inventoryConfigurations property: Specifies the inventory configuration for an Amazon S3 bucket. For more + * information, see [GET Bucket + * inventory](https://docs.aws.amazon.com/AmazonS3/latest/API/RESTBucketGETInventoryConfig.html) in the *Amazon S3 + * API Reference*. + * + * @param inventoryConfigurations the inventoryConfigurations value to set. + * @return the AwsS3BucketProperties object itself. + */ + public AwsS3BucketProperties withInventoryConfigurations(List inventoryConfigurations) { + this.inventoryConfigurations = inventoryConfigurations; + return this; + } + + /** + * Get the lifecycleConfiguration property: Specifies the lifecycle configuration for objects in an Amazon S3 + * bucket. For more information, see [Object Lifecycle + * Management](https://docs.aws.amazon.com/AmazonS3/latest/dev/object-lifecycle-mgmt.html) in the *Amazon S3 User + * Guide*. Specifies the lifecycle configuration for objects in an Amazon S3 bucket. For more information, see + * [Object Lifecycle Management](https://docs.aws.amazon.com/AmazonS3/latest/dev/object-lifecycle-mgmt.html) in the + * *Amazon S3 User Guide*. + * + * @return the lifecycleConfiguration value. + */ + public LifecycleConfiguration lifecycleConfiguration() { + return this.lifecycleConfiguration; + } + + /** + * Set the lifecycleConfiguration property: Specifies the lifecycle configuration for objects in an Amazon S3 + * bucket. For more information, see [Object Lifecycle + * Management](https://docs.aws.amazon.com/AmazonS3/latest/dev/object-lifecycle-mgmt.html) in the *Amazon S3 User + * Guide*. Specifies the lifecycle configuration for objects in an Amazon S3 bucket. For more information, see + * [Object Lifecycle Management](https://docs.aws.amazon.com/AmazonS3/latest/dev/object-lifecycle-mgmt.html) in the + * *Amazon S3 User Guide*. + * + * @param lifecycleConfiguration the lifecycleConfiguration value to set. + * @return the AwsS3BucketProperties object itself. + */ + public AwsS3BucketProperties withLifecycleConfiguration(LifecycleConfiguration lifecycleConfiguration) { + this.lifecycleConfiguration = lifecycleConfiguration; + return this; + } + + /** + * Get the loggingConfiguration property: Settings that define where logs are stored. Describes where logs are + * stored and the prefix that Amazon S3 assigns to all log object keys for a bucket. For examples and more + * information, see [PUT Bucket logging](https://docs.aws.amazon.com/AmazonS3/latest/API/RESTBucketPUTlogging.html) + * in the *Amazon S3 API Reference*. To successfully complete the ``AWS::S3::Bucket LoggingConfiguration`` request, + * you must have ``s3:PutObject`` and ``s3:PutObjectAcl`` in your IAM permissions. + * + * @return the loggingConfiguration value. + */ + public LoggingConfiguration loggingConfiguration() { + return this.loggingConfiguration; + } + + /** + * Set the loggingConfiguration property: Settings that define where logs are stored. Describes where logs are + * stored and the prefix that Amazon S3 assigns to all log object keys for a bucket. For examples and more + * information, see [PUT Bucket logging](https://docs.aws.amazon.com/AmazonS3/latest/API/RESTBucketPUTlogging.html) + * in the *Amazon S3 API Reference*. To successfully complete the ``AWS::S3::Bucket LoggingConfiguration`` request, + * you must have ``s3:PutObject`` and ``s3:PutObjectAcl`` in your IAM permissions. + * + * @param loggingConfiguration the loggingConfiguration value to set. + * @return the AwsS3BucketProperties object itself. + */ + public AwsS3BucketProperties withLoggingConfiguration(LoggingConfiguration loggingConfiguration) { + this.loggingConfiguration = loggingConfiguration; + return this; + } + + /** + * Get the metricsConfigurations property: Specifies a metrics configuration for the CloudWatch request metrics + * (specified by the metrics configuration ID) from an Amazon S3 bucket. If you're updating an existing metrics + * configuration, note that this is a full replacement of the existing metrics configuration. If you don't include + * the elements you want to keep, they are erased. For more information, see + * [PutBucketMetricsConfiguration](https://docs.aws.amazon.com/AmazonS3/latest/API/RESTBucketPUTMetricConfiguration.html). + * + * @return the metricsConfigurations value. + */ + public List metricsConfigurations() { + return this.metricsConfigurations; + } + + /** + * Set the metricsConfigurations property: Specifies a metrics configuration for the CloudWatch request metrics + * (specified by the metrics configuration ID) from an Amazon S3 bucket. If you're updating an existing metrics + * configuration, note that this is a full replacement of the existing metrics configuration. If you don't include + * the elements you want to keep, they are erased. For more information, see + * [PutBucketMetricsConfiguration](https://docs.aws.amazon.com/AmazonS3/latest/API/RESTBucketPUTMetricConfiguration.html). + * + * @param metricsConfigurations the metricsConfigurations value to set. + * @return the AwsS3BucketProperties object itself. + */ + public AwsS3BucketProperties withMetricsConfigurations(List metricsConfigurations) { + this.metricsConfigurations = metricsConfigurations; + return this; + } + + /** + * Get the notificationConfiguration property: Configuration that defines how Amazon S3 handles bucket + * notifications. Describes the notification configuration for an Amazon S3 bucket. If you create the target + * resource and related permissions in the same template, you might have a circular dependency. For example, you + * might use the ``AWS::Lambda::Permission`` resource to grant the bucket permission to invoke an AWS Lambda + * function. However, AWS CloudFormation can't create the bucket until the bucket has permission to invoke the + * function (AWS CloudFormation checks whether the bucket can invoke the function). If you're using Refs to pass the + * bucket name, this leads to a circular dependency. To avoid this dependency, you can create all resources without + * specifying the notification configuration. Then, update the stack with a notification configuration. For more + * information on permissions, see + * [AWS::Lambda::Permission](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-permission.html) + * and [Granting Permissions to Publish Event Notification Messages to a + * Destination](https://docs.aws.amazon.com/AmazonS3/latest/dev/NotificationHowTo.html#grant-destinations-permissions-to-s3). + * + * @return the notificationConfiguration value. + */ + public NotificationConfigurationAutoGenerated2 notificationConfiguration() { + return this.notificationConfiguration; + } + + /** + * Set the notificationConfiguration property: Configuration that defines how Amazon S3 handles bucket + * notifications. Describes the notification configuration for an Amazon S3 bucket. If you create the target + * resource and related permissions in the same template, you might have a circular dependency. For example, you + * might use the ``AWS::Lambda::Permission`` resource to grant the bucket permission to invoke an AWS Lambda + * function. However, AWS CloudFormation can't create the bucket until the bucket has permission to invoke the + * function (AWS CloudFormation checks whether the bucket can invoke the function). If you're using Refs to pass the + * bucket name, this leads to a circular dependency. To avoid this dependency, you can create all resources without + * specifying the notification configuration. Then, update the stack with a notification configuration. For more + * information on permissions, see + * [AWS::Lambda::Permission](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-permission.html) + * and [Granting Permissions to Publish Event Notification Messages to a + * Destination](https://docs.aws.amazon.com/AmazonS3/latest/dev/NotificationHowTo.html#grant-destinations-permissions-to-s3). + * + * @param notificationConfiguration the notificationConfiguration value to set. + * @return the AwsS3BucketProperties object itself. + */ + public AwsS3BucketProperties + withNotificationConfiguration(NotificationConfigurationAutoGenerated2 notificationConfiguration) { + this.notificationConfiguration = notificationConfiguration; + return this; + } + + /** + * Get the objectLockConfiguration property: This operation is not supported by directory buckets. Places an Object + * Lock configuration on the specified bucket. The rule specified in the Object Lock configuration will be applied + * by default to every new object placed in the specified bucket. For more information, see [Locking + * Objects](https://docs.aws.amazon.com/AmazonS3/latest/dev/object-lock.html). + The ``DefaultRetention`` settings + * require both a mode and a period. + The ``DefaultRetention`` period can be either ``Days`` or ``Years`` but you + * must select one. You cannot specify ``Days`` and ``Years`` at the same time. + You can enable Object Lock for new + * or existing buckets. For more information, see [Configuring Object + * Lock](https://docs.aws.amazon.com/AmazonS3/latest/userguide/object-lock-configure.html). Places an Object Lock + * configuration on the specified bucket. The rule specified in the Object Lock configuration will be applied by + * default to every new object placed in the specified bucket. For more information, see [Locking + * Objects](https://docs.aws.amazon.com/AmazonS3/latest/dev/object-lock.html). + * + * @return the objectLockConfiguration value. + */ + public ObjectLockConfiguration objectLockConfiguration() { + return this.objectLockConfiguration; + } + + /** + * Set the objectLockConfiguration property: This operation is not supported by directory buckets. Places an Object + * Lock configuration on the specified bucket. The rule specified in the Object Lock configuration will be applied + * by default to every new object placed in the specified bucket. For more information, see [Locking + * Objects](https://docs.aws.amazon.com/AmazonS3/latest/dev/object-lock.html). + The ``DefaultRetention`` settings + * require both a mode and a period. + The ``DefaultRetention`` period can be either ``Days`` or ``Years`` but you + * must select one. You cannot specify ``Days`` and ``Years`` at the same time. + You can enable Object Lock for new + * or existing buckets. For more information, see [Configuring Object + * Lock](https://docs.aws.amazon.com/AmazonS3/latest/userguide/object-lock-configure.html). Places an Object Lock + * configuration on the specified bucket. The rule specified in the Object Lock configuration will be applied by + * default to every new object placed in the specified bucket. For more information, see [Locking + * Objects](https://docs.aws.amazon.com/AmazonS3/latest/dev/object-lock.html). + * + * @param objectLockConfiguration the objectLockConfiguration value to set. + * @return the AwsS3BucketProperties object itself. + */ + public AwsS3BucketProperties withObjectLockConfiguration(ObjectLockConfiguration objectLockConfiguration) { + this.objectLockConfiguration = objectLockConfiguration; + return this; + } + + /** + * Get the objectLockEnabled property: Indicates whether this bucket has an Object Lock configuration enabled. + * Enable ``ObjectLockEnabled`` when you apply ``ObjectLockConfiguration`` to a bucket. + * + * @return the objectLockEnabled value. + */ + public Boolean objectLockEnabled() { + return this.objectLockEnabled; + } + + /** + * Set the objectLockEnabled property: Indicates whether this bucket has an Object Lock configuration enabled. + * Enable ``ObjectLockEnabled`` when you apply ``ObjectLockConfiguration`` to a bucket. + * + * @param objectLockEnabled the objectLockEnabled value to set. + * @return the AwsS3BucketProperties object itself. + */ + public AwsS3BucketProperties withObjectLockEnabled(Boolean objectLockEnabled) { + this.objectLockEnabled = objectLockEnabled; + return this; + } + + /** + * Get the ownershipControls property: Configuration that defines how Amazon S3 handles Object Ownership rules. + * Specifies the container element for Object Ownership rules. S3 Object Ownership is an Amazon S3 bucket-level + * setting that you can use to disable access control lists (ACLs) and take ownership of every object in your + * bucket, simplifying access management for data stored in Amazon S3. For more information, see [Controlling + * ownership of objects and disabling + * ACLs](https://docs.aws.amazon.com/AmazonS3/latest/userguide/about-object-ownership.html) in the *Amazon S3 User + * Guide*. + * + * @return the ownershipControls value. + */ + public OwnershipControls ownershipControls() { + return this.ownershipControls; + } + + /** + * Set the ownershipControls property: Configuration that defines how Amazon S3 handles Object Ownership rules. + * Specifies the container element for Object Ownership rules. S3 Object Ownership is an Amazon S3 bucket-level + * setting that you can use to disable access control lists (ACLs) and take ownership of every object in your + * bucket, simplifying access management for data stored in Amazon S3. For more information, see [Controlling + * ownership of objects and disabling + * ACLs](https://docs.aws.amazon.com/AmazonS3/latest/userguide/about-object-ownership.html) in the *Amazon S3 User + * Guide*. + * + * @param ownershipControls the ownershipControls value to set. + * @return the AwsS3BucketProperties object itself. + */ + public AwsS3BucketProperties withOwnershipControls(OwnershipControls ownershipControls) { + this.ownershipControls = ownershipControls; + return this; + } + + /** + * Get the publicAccessBlockConfiguration property: Configuration that defines how Amazon S3 handles public access. + * The PublicAccessBlock configuration that you want to apply to this Amazon S3 bucket. You can enable the + * configuration options in any combination. For more information about when Amazon S3 considers a bucket or object + * public, see [The Meaning of + * 'Public'](https://docs.aws.amazon.com/AmazonS3/latest/dev/access-control-block-public-access.html#access-control-block-public-access-policy-status) + * in the *Amazon S3 User Guide*. + * + * @return the publicAccessBlockConfiguration value. + */ + public PublicAccessBlockConfigurationAutoGenerated publicAccessBlockConfiguration() { + return this.publicAccessBlockConfiguration; + } + + /** + * Set the publicAccessBlockConfiguration property: Configuration that defines how Amazon S3 handles public access. + * The PublicAccessBlock configuration that you want to apply to this Amazon S3 bucket. You can enable the + * configuration options in any combination. For more information about when Amazon S3 considers a bucket or object + * public, see [The Meaning of + * 'Public'](https://docs.aws.amazon.com/AmazonS3/latest/dev/access-control-block-public-access.html#access-control-block-public-access-policy-status) + * in the *Amazon S3 User Guide*. + * + * @param publicAccessBlockConfiguration the publicAccessBlockConfiguration value to set. + * @return the AwsS3BucketProperties object itself. + */ + public AwsS3BucketProperties + withPublicAccessBlockConfiguration(PublicAccessBlockConfigurationAutoGenerated publicAccessBlockConfiguration) { + this.publicAccessBlockConfiguration = publicAccessBlockConfiguration; + return this; + } + + /** + * Get the regionalDomainName property: Property regionalDomainName. + * + * @return the regionalDomainName value. + */ + public String regionalDomainName() { + return this.regionalDomainName; + } + + /** + * Set the regionalDomainName property: Property regionalDomainName. + * + * @param regionalDomainName the regionalDomainName value to set. + * @return the AwsS3BucketProperties object itself. + */ + public AwsS3BucketProperties withRegionalDomainName(String regionalDomainName) { + this.regionalDomainName = regionalDomainName; + return this; + } + + /** + * Get the replicationConfiguration property: Configuration for replicating objects in an S3 bucket. To enable + * replication, you must also enable versioning by using the ``VersioningConfiguration`` property. Amazon S3 can + * store replicated objects in a single destination bucket or multiple destination buckets. The destination bucket + * or buckets must already exist. A container for replication rules. You can add up to 1,000 rules. The maximum size + * of a replication configuration is 2 MB. The latest version of the replication configuration XML is V2. For more + * information about XML V2 replication configurations, see [Replication + * configuration](https://docs.aws.amazon.com/AmazonS3/latest/userguide/replication-add-config.html) in the *Amazon + * S3 User Guide*. + * + * @return the replicationConfiguration value. + */ + public ReplicationConfigurationAutoGenerated replicationConfiguration() { + return this.replicationConfiguration; + } + + /** + * Set the replicationConfiguration property: Configuration for replicating objects in an S3 bucket. To enable + * replication, you must also enable versioning by using the ``VersioningConfiguration`` property. Amazon S3 can + * store replicated objects in a single destination bucket or multiple destination buckets. The destination bucket + * or buckets must already exist. A container for replication rules. You can add up to 1,000 rules. The maximum size + * of a replication configuration is 2 MB. The latest version of the replication configuration XML is V2. For more + * information about XML V2 replication configurations, see [Replication + * configuration](https://docs.aws.amazon.com/AmazonS3/latest/userguide/replication-add-config.html) in the *Amazon + * S3 User Guide*. + * + * @param replicationConfiguration the replicationConfiguration value to set. + * @return the AwsS3BucketProperties object itself. + */ + public AwsS3BucketProperties + withReplicationConfiguration(ReplicationConfigurationAutoGenerated replicationConfiguration) { + this.replicationConfiguration = replicationConfiguration; + return this; + } + + /** + * Get the tags property: An arbitrary set of tags (key-value pairs) for this S3 bucket. + * + * @return the tags value. + */ + public List tags() { + return this.tags; + } + + /** + * Set the tags property: An arbitrary set of tags (key-value pairs) for this S3 bucket. + * + * @param tags the tags value to set. + * @return the AwsS3BucketProperties object itself. + */ + public AwsS3BucketProperties withTags(List tags) { + this.tags = tags; + return this; + } + + /** + * Get the versioningConfiguration property: Enables multiple versions of all objects in this bucket. You might + * enable versioning to prevent objects from being deleted or overwritten by mistake or to archive objects so that + * you can retrieve previous versions of them. Describes the versioning state of an Amazon S3 bucket. For more + * information, see [PUT Bucket + * versioning](https://docs.aws.amazon.com/AmazonS3/latest/API/RESTBucketPUTVersioningStatus.html) in the *Amazon S3 + * API Reference*. + * + * @return the versioningConfiguration value. + */ + public VersioningConfiguration versioningConfiguration() { + return this.versioningConfiguration; + } + + /** + * Set the versioningConfiguration property: Enables multiple versions of all objects in this bucket. You might + * enable versioning to prevent objects from being deleted or overwritten by mistake or to archive objects so that + * you can retrieve previous versions of them. Describes the versioning state of an Amazon S3 bucket. For more + * information, see [PUT Bucket + * versioning](https://docs.aws.amazon.com/AmazonS3/latest/API/RESTBucketPUTVersioningStatus.html) in the *Amazon S3 + * API Reference*. + * + * @param versioningConfiguration the versioningConfiguration value to set. + * @return the AwsS3BucketProperties object itself. + */ + public AwsS3BucketProperties withVersioningConfiguration(VersioningConfiguration versioningConfiguration) { + this.versioningConfiguration = versioningConfiguration; + return this; + } + + /** + * Get the websiteConfiguration property: Information used to configure the bucket as a static website. For more + * information, see [Hosting Websites on Amazon + * S3](https://docs.aws.amazon.com/AmazonS3/latest/dev/WebsiteHosting.html). Specifies website configuration + * parameters for an Amazon S3 bucket. + * + * @return the websiteConfiguration value. + */ + public WebsiteConfiguration websiteConfiguration() { + return this.websiteConfiguration; + } + + /** + * Set the websiteConfiguration property: Information used to configure the bucket as a static website. For more + * information, see [Hosting Websites on Amazon + * S3](https://docs.aws.amazon.com/AmazonS3/latest/dev/WebsiteHosting.html). Specifies website configuration + * parameters for an Amazon S3 bucket. + * + * @param websiteConfiguration the websiteConfiguration value to set. + * @return the AwsS3BucketProperties object itself. + */ + public AwsS3BucketProperties withWebsiteConfiguration(WebsiteConfiguration websiteConfiguration) { + this.websiteConfiguration = websiteConfiguration; + return this; + } + + /** + * Get the websiteUrl property: Property websiteURL. + * + * @return the websiteUrl value. + */ + public String websiteUrl() { + return this.websiteUrl; + } + + /** + * Set the websiteUrl property: Property websiteURL. + * + * @param websiteUrl the websiteUrl value to set. + * @return the AwsS3BucketProperties object itself. + */ + public AwsS3BucketProperties withWebsiteUrl(String websiteUrl) { + this.websiteUrl = websiteUrl; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (accelerateConfiguration() != null) { + accelerateConfiguration().validate(); + } + if (analyticsConfigurations() != null) { + analyticsConfigurations().forEach(e -> e.validate()); + } + if (bucketEncryption() != null) { + bucketEncryption().validate(); + } + if (corsConfiguration() != null) { + corsConfiguration().validate(); + } + if (intelligentTieringConfigurations() != null) { + intelligentTieringConfigurations().forEach(e -> e.validate()); + } + if (inventoryConfigurations() != null) { + inventoryConfigurations().forEach(e -> e.validate()); + } + if (lifecycleConfiguration() != null) { + lifecycleConfiguration().validate(); + } + if (loggingConfiguration() != null) { + loggingConfiguration().validate(); + } + if (metricsConfigurations() != null) { + metricsConfigurations().forEach(e -> e.validate()); + } + if (notificationConfiguration() != null) { + notificationConfiguration().validate(); + } + if (objectLockConfiguration() != null) { + objectLockConfiguration().validate(); + } + if (ownershipControls() != null) { + ownershipControls().validate(); + } + if (publicAccessBlockConfiguration() != null) { + publicAccessBlockConfiguration().validate(); + } + if (replicationConfiguration() != null) { + replicationConfiguration().validate(); + } + if (tags() != null) { + tags().forEach(e -> e.validate()); + } + if (versioningConfiguration() != null) { + versioningConfiguration().validate(); + } + if (websiteConfiguration() != null) { + websiteConfiguration().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("accelerateConfiguration", this.accelerateConfiguration); + jsonWriter.writeStringField("accessControl", this.accessControl == null ? null : this.accessControl.toString()); + jsonWriter.writeArrayField("analyticsConfigurations", this.analyticsConfigurations, + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("arn", this.arn); + jsonWriter.writeJsonField("bucketEncryption", this.bucketEncryption); + jsonWriter.writeStringField("bucketName", this.bucketName); + jsonWriter.writeJsonField("corsConfiguration", this.corsConfiguration); + jsonWriter.writeStringField("domainName", this.domainName); + jsonWriter.writeStringField("dualStackDomainName", this.dualStackDomainName); + jsonWriter.writeArrayField("intelligentTieringConfigurations", this.intelligentTieringConfigurations, + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("inventoryConfigurations", this.inventoryConfigurations, + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeJsonField("lifecycleConfiguration", this.lifecycleConfiguration); + jsonWriter.writeJsonField("loggingConfiguration", this.loggingConfiguration); + jsonWriter.writeArrayField("metricsConfigurations", this.metricsConfigurations, + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeJsonField("notificationConfiguration", this.notificationConfiguration); + jsonWriter.writeJsonField("objectLockConfiguration", this.objectLockConfiguration); + jsonWriter.writeBooleanField("objectLockEnabled", this.objectLockEnabled); + jsonWriter.writeJsonField("ownershipControls", this.ownershipControls); + jsonWriter.writeJsonField("publicAccessBlockConfiguration", this.publicAccessBlockConfiguration); + jsonWriter.writeStringField("regionalDomainName", this.regionalDomainName); + jsonWriter.writeJsonField("replicationConfiguration", this.replicationConfiguration); + jsonWriter.writeArrayField("tags", this.tags, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeJsonField("versioningConfiguration", this.versioningConfiguration); + jsonWriter.writeJsonField("websiteConfiguration", this.websiteConfiguration); + jsonWriter.writeStringField("websiteURL", this.websiteUrl); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AwsS3BucketProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AwsS3BucketProperties if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the AwsS3BucketProperties. + */ + public static AwsS3BucketProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AwsS3BucketProperties deserializedAwsS3BucketProperties = new AwsS3BucketProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("accelerateConfiguration".equals(fieldName)) { + deserializedAwsS3BucketProperties.accelerateConfiguration + = AccelerateConfiguration.fromJson(reader); + } else if ("accessControl".equals(fieldName)) { + deserializedAwsS3BucketProperties.accessControl = AccessControl.fromString(reader.getString()); + } else if ("analyticsConfigurations".equals(fieldName)) { + List analyticsConfigurations + = reader.readArray(reader1 -> AnalyticsConfiguration.fromJson(reader1)); + deserializedAwsS3BucketProperties.analyticsConfigurations = analyticsConfigurations; + } else if ("arn".equals(fieldName)) { + deserializedAwsS3BucketProperties.arn = reader.getString(); + } else if ("bucketEncryption".equals(fieldName)) { + deserializedAwsS3BucketProperties.bucketEncryption = BucketEncryption.fromJson(reader); + } else if ("bucketName".equals(fieldName)) { + deserializedAwsS3BucketProperties.bucketName = reader.getString(); + } else if ("corsConfiguration".equals(fieldName)) { + deserializedAwsS3BucketProperties.corsConfiguration = CorsConfiguration.fromJson(reader); + } else if ("domainName".equals(fieldName)) { + deserializedAwsS3BucketProperties.domainName = reader.getString(); + } else if ("dualStackDomainName".equals(fieldName)) { + deserializedAwsS3BucketProperties.dualStackDomainName = reader.getString(); + } else if ("intelligentTieringConfigurations".equals(fieldName)) { + List intelligentTieringConfigurations + = reader.readArray(reader1 -> IntelligentTieringConfiguration.fromJson(reader1)); + deserializedAwsS3BucketProperties.intelligentTieringConfigurations + = intelligentTieringConfigurations; + } else if ("inventoryConfigurations".equals(fieldName)) { + List inventoryConfigurations + = reader.readArray(reader1 -> InventoryConfiguration.fromJson(reader1)); + deserializedAwsS3BucketProperties.inventoryConfigurations = inventoryConfigurations; + } else if ("lifecycleConfiguration".equals(fieldName)) { + deserializedAwsS3BucketProperties.lifecycleConfiguration = LifecycleConfiguration.fromJson(reader); + } else if ("loggingConfiguration".equals(fieldName)) { + deserializedAwsS3BucketProperties.loggingConfiguration = LoggingConfiguration.fromJson(reader); + } else if ("metricsConfigurations".equals(fieldName)) { + List metricsConfigurations + = reader.readArray(reader1 -> MetricsConfiguration.fromJson(reader1)); + deserializedAwsS3BucketProperties.metricsConfigurations = metricsConfigurations; + } else if ("notificationConfiguration".equals(fieldName)) { + deserializedAwsS3BucketProperties.notificationConfiguration + = NotificationConfigurationAutoGenerated2.fromJson(reader); + } else if ("objectLockConfiguration".equals(fieldName)) { + deserializedAwsS3BucketProperties.objectLockConfiguration + = ObjectLockConfiguration.fromJson(reader); + } else if ("objectLockEnabled".equals(fieldName)) { + deserializedAwsS3BucketProperties.objectLockEnabled = reader.getNullable(JsonReader::getBoolean); + } else if ("ownershipControls".equals(fieldName)) { + deserializedAwsS3BucketProperties.ownershipControls = OwnershipControls.fromJson(reader); + } else if ("publicAccessBlockConfiguration".equals(fieldName)) { + deserializedAwsS3BucketProperties.publicAccessBlockConfiguration + = PublicAccessBlockConfigurationAutoGenerated.fromJson(reader); + } else if ("regionalDomainName".equals(fieldName)) { + deserializedAwsS3BucketProperties.regionalDomainName = reader.getString(); + } else if ("replicationConfiguration".equals(fieldName)) { + deserializedAwsS3BucketProperties.replicationConfiguration + = ReplicationConfigurationAutoGenerated.fromJson(reader); + } else if ("tags".equals(fieldName)) { + List tags = reader.readArray(reader1 -> TagAutoGenerated50.fromJson(reader1)); + deserializedAwsS3BucketProperties.tags = tags; + } else if ("versioningConfiguration".equals(fieldName)) { + deserializedAwsS3BucketProperties.versioningConfiguration + = VersioningConfiguration.fromJson(reader); + } else if ("websiteConfiguration".equals(fieldName)) { + deserializedAwsS3BucketProperties.websiteConfiguration = WebsiteConfiguration.fromJson(reader); + } else if ("websiteURL".equals(fieldName)) { + deserializedAwsS3BucketProperties.websiteUrl = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedAwsS3BucketProperties; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/AwsS3ControlMultiRegionAccessPointPolicyDocumentProperties.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/AwsS3ControlMultiRegionAccessPointPolicyDocumentProperties.java new file mode 100644 index 000000000000..6d3d104f6cd3 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/AwsS3ControlMultiRegionAccessPointPolicyDocumentProperties.java @@ -0,0 +1,135 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of awsS3ControlMultiRegionAccessPointPolicyDocument. + */ +@Fluent +public final class AwsS3ControlMultiRegionAccessPointPolicyDocumentProperties + implements JsonSerializable { + /* + *

The last established policy for the Multi-Region Access Point.

+ */ + private EstablishedMultiRegionAccessPointPolicy established; + + /* + *

The proposed policy for the Multi-Region Access Point.

+ */ + private ProposedMultiRegionAccessPointPolicy proposed; + + /** + * Creates an instance of AwsS3ControlMultiRegionAccessPointPolicyDocumentProperties class. + */ + public AwsS3ControlMultiRegionAccessPointPolicyDocumentProperties() { + } + + /** + * Get the established property: <p>The last established policy for the Multi-Region Access Point.</p>. + * + * @return the established value. + */ + public EstablishedMultiRegionAccessPointPolicy established() { + return this.established; + } + + /** + * Set the established property: <p>The last established policy for the Multi-Region Access Point.</p>. + * + * @param established the established value to set. + * @return the AwsS3ControlMultiRegionAccessPointPolicyDocumentProperties object itself. + */ + public AwsS3ControlMultiRegionAccessPointPolicyDocumentProperties + withEstablished(EstablishedMultiRegionAccessPointPolicy established) { + this.established = established; + return this; + } + + /** + * Get the proposed property: <p>The proposed policy for the Multi-Region Access Point.</p>. + * + * @return the proposed value. + */ + public ProposedMultiRegionAccessPointPolicy proposed() { + return this.proposed; + } + + /** + * Set the proposed property: <p>The proposed policy for the Multi-Region Access Point.</p>. + * + * @param proposed the proposed value to set. + * @return the AwsS3ControlMultiRegionAccessPointPolicyDocumentProperties object itself. + */ + public AwsS3ControlMultiRegionAccessPointPolicyDocumentProperties + withProposed(ProposedMultiRegionAccessPointPolicy proposed) { + this.proposed = proposed; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (established() != null) { + established().validate(); + } + if (proposed() != null) { + proposed().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("established", this.established); + jsonWriter.writeJsonField("proposed", this.proposed); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AwsS3ControlMultiRegionAccessPointPolicyDocumentProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AwsS3ControlMultiRegionAccessPointPolicyDocumentProperties if the JsonReader was pointing + * to an instance of it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the + * AwsS3ControlMultiRegionAccessPointPolicyDocumentProperties. + */ + public static AwsS3ControlMultiRegionAccessPointPolicyDocumentProperties fromJson(JsonReader jsonReader) + throws IOException { + return jsonReader.readObject(reader -> { + AwsS3ControlMultiRegionAccessPointPolicyDocumentProperties deserializedAwsS3ControlMultiRegionAccessPointPolicyDocumentProperties + = new AwsS3ControlMultiRegionAccessPointPolicyDocumentProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("established".equals(fieldName)) { + deserializedAwsS3ControlMultiRegionAccessPointPolicyDocumentProperties.established + = EstablishedMultiRegionAccessPointPolicy.fromJson(reader); + } else if ("proposed".equals(fieldName)) { + deserializedAwsS3ControlMultiRegionAccessPointPolicyDocumentProperties.proposed + = ProposedMultiRegionAccessPointPolicy.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedAwsS3ControlMultiRegionAccessPointPolicyDocumentProperties; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/AwsSageMakerAppProperties.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/AwsSageMakerAppProperties.java new file mode 100644 index 000000000000..5140f1a837db --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/AwsSageMakerAppProperties.java @@ -0,0 +1,271 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Definition of awsSageMakerApp. + */ +@Fluent +public final class AwsSageMakerAppProperties implements JsonSerializable { + /* + * The Amazon Resource Name (ARN) of the app. + */ + private String appArn; + + /* + * The name of the app. + */ + private String appName; + + /* + * The type of app. + */ + private AppType appType; + + /* + * The domain ID. + */ + private String domainId; + + /* + * The instance type and the Amazon Resource Name (ARN) of the SageMaker image created on the instance. + */ + private ResourceSpec resourceSpec; + + /* + * A list of tags to apply to the app. + */ + private List tags; + + /* + * The user profile name. + */ + private String userProfileName; + + /** + * Creates an instance of AwsSageMakerAppProperties class. + */ + public AwsSageMakerAppProperties() { + } + + /** + * Get the appArn property: The Amazon Resource Name (ARN) of the app. + * + * @return the appArn value. + */ + public String appArn() { + return this.appArn; + } + + /** + * Set the appArn property: The Amazon Resource Name (ARN) of the app. + * + * @param appArn the appArn value to set. + * @return the AwsSageMakerAppProperties object itself. + */ + public AwsSageMakerAppProperties withAppArn(String appArn) { + this.appArn = appArn; + return this; + } + + /** + * Get the appName property: The name of the app. + * + * @return the appName value. + */ + public String appName() { + return this.appName; + } + + /** + * Set the appName property: The name of the app. + * + * @param appName the appName value to set. + * @return the AwsSageMakerAppProperties object itself. + */ + public AwsSageMakerAppProperties withAppName(String appName) { + this.appName = appName; + return this; + } + + /** + * Get the appType property: The type of app. + * + * @return the appType value. + */ + public AppType appType() { + return this.appType; + } + + /** + * Set the appType property: The type of app. + * + * @param appType the appType value to set. + * @return the AwsSageMakerAppProperties object itself. + */ + public AwsSageMakerAppProperties withAppType(AppType appType) { + this.appType = appType; + return this; + } + + /** + * Get the domainId property: The domain ID. + * + * @return the domainId value. + */ + public String domainId() { + return this.domainId; + } + + /** + * Set the domainId property: The domain ID. + * + * @param domainId the domainId value to set. + * @return the AwsSageMakerAppProperties object itself. + */ + public AwsSageMakerAppProperties withDomainId(String domainId) { + this.domainId = domainId; + return this; + } + + /** + * Get the resourceSpec property: The instance type and the Amazon Resource Name (ARN) of the SageMaker image + * created on the instance. + * + * @return the resourceSpec value. + */ + public ResourceSpec resourceSpec() { + return this.resourceSpec; + } + + /** + * Set the resourceSpec property: The instance type and the Amazon Resource Name (ARN) of the SageMaker image + * created on the instance. + * + * @param resourceSpec the resourceSpec value to set. + * @return the AwsSageMakerAppProperties object itself. + */ + public AwsSageMakerAppProperties withResourceSpec(ResourceSpec resourceSpec) { + this.resourceSpec = resourceSpec; + return this; + } + + /** + * Get the tags property: A list of tags to apply to the app. + * + * @return the tags value. + */ + public List tags() { + return this.tags; + } + + /** + * Set the tags property: A list of tags to apply to the app. + * + * @param tags the tags value to set. + * @return the AwsSageMakerAppProperties object itself. + */ + public AwsSageMakerAppProperties withTags(List tags) { + this.tags = tags; + return this; + } + + /** + * Get the userProfileName property: The user profile name. + * + * @return the userProfileName value. + */ + public String userProfileName() { + return this.userProfileName; + } + + /** + * Set the userProfileName property: The user profile name. + * + * @param userProfileName the userProfileName value to set. + * @return the AwsSageMakerAppProperties object itself. + */ + public AwsSageMakerAppProperties withUserProfileName(String userProfileName) { + this.userProfileName = userProfileName; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (resourceSpec() != null) { + resourceSpec().validate(); + } + if (tags() != null) { + tags().forEach(e -> e.validate()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("appArn", this.appArn); + jsonWriter.writeStringField("appName", this.appName); + jsonWriter.writeStringField("appType", this.appType == null ? null : this.appType.toString()); + jsonWriter.writeStringField("domainId", this.domainId); + jsonWriter.writeJsonField("resourceSpec", this.resourceSpec); + jsonWriter.writeArrayField("tags", this.tags, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("userProfileName", this.userProfileName); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AwsSageMakerAppProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AwsSageMakerAppProperties if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IOException If an error occurs while reading the AwsSageMakerAppProperties. + */ + public static AwsSageMakerAppProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AwsSageMakerAppProperties deserializedAwsSageMakerAppProperties = new AwsSageMakerAppProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("appArn".equals(fieldName)) { + deserializedAwsSageMakerAppProperties.appArn = reader.getString(); + } else if ("appName".equals(fieldName)) { + deserializedAwsSageMakerAppProperties.appName = reader.getString(); + } else if ("appType".equals(fieldName)) { + deserializedAwsSageMakerAppProperties.appType = AppType.fromString(reader.getString()); + } else if ("domainId".equals(fieldName)) { + deserializedAwsSageMakerAppProperties.domainId = reader.getString(); + } else if ("resourceSpec".equals(fieldName)) { + deserializedAwsSageMakerAppProperties.resourceSpec = ResourceSpec.fromJson(reader); + } else if ("tags".equals(fieldName)) { + List tags = reader.readArray(reader1 -> TagAutoGenerated51.fromJson(reader1)); + deserializedAwsSageMakerAppProperties.tags = tags; + } else if ("userProfileName".equals(fieldName)) { + deserializedAwsSageMakerAppProperties.userProfileName = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedAwsSageMakerAppProperties; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/AwsSageMakerNotebookInstanceSummaryProperties.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/AwsSageMakerNotebookInstanceSummaryProperties.java new file mode 100644 index 000000000000..4198a593aaeb --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/AwsSageMakerNotebookInstanceSummaryProperties.java @@ -0,0 +1,434 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.time.OffsetDateTime; +import java.time.format.DateTimeFormatter; +import java.util.List; + +/** + * Definition of awsSageMakerNotebookInstanceSummary. + */ +@Fluent +public final class AwsSageMakerNotebookInstanceSummaryProperties + implements JsonSerializable { + /* + *

An array of up to three Git repositories associated with the notebook instance. These can be either the names + * of Git repositories stored as resources in your account, or the URL of Git repositories in Amazon Web Services CodeCommit or + * in any other Git repository. These repositories are cloned at the same level as the default repository of your + * notebook instance. For more information, see Associating Git Repositories with + * SageMaker Notebook Instances.

+ */ + private List additionalCodeRepositories; + + /* + *

A timestamp that shows when the notebook instance was created.

+ */ + private OffsetDateTime creationTime; + + /* + *

The Git repository associated with the notebook instance as its default code repository. This can be either + * the name of a Git repository stored as a resource in your account, or the URL of a Git repository in Amazon Web Services CodeCommit or + * in any other Git repository. When you open a notebook instance, it opens in the directory that contains this + * repository. For more information, see Associating Git Repositories with + * SageMaker Notebook Instances.

+ */ + private String defaultCodeRepository; + + /* + *

The type of ML compute instance that the notebook instance is running on.

+ */ + private InstanceTypeEnumValue instanceType; + + /* + *

A timestamp that shows when the notebook instance was last modified.

+ */ + private OffsetDateTime lastModifiedTime; + + /* + *

The Amazon Resource Name (ARN) of the notebook instance.

+ */ + private String notebookInstanceArn; + + /* + *

The name of a notebook instance lifecycle configuration associated with this notebook instance.

For + * information about notebook instance lifestyle configurations, see Step 2.1: (Optional) + * Customize a Notebook Instance.

+ */ + private String notebookInstanceLifecycleConfigName; + + /* + *

The name of the notebook instance that you want a summary for.

+ */ + private String notebookInstanceName; + + /* + *

The status of the notebook instance.

+ */ + private NotebookInstanceStatusEnumValue notebookInstanceStatus; + + /* + *

The URL that you use to connect to the Jupyter notebook running in your notebook instance.

+ */ + private String url; + + /** + * Creates an instance of AwsSageMakerNotebookInstanceSummaryProperties class. + */ + public AwsSageMakerNotebookInstanceSummaryProperties() { + } + + /** + * Get the additionalCodeRepositories property: <p>An array of up to three Git repositories associated with + * the notebook instance. These can be either the names of Git repositories stored as resources in your account, or + * the URL of Git repositories in <a + * href='https://docs.aws.amazon.com/codecommit/latest/userguide/welcome.html'>Amazon Web Services + * CodeCommit</a> or in any other Git repository. These repositories are cloned at the same level as the + * default repository of your notebook instance. For more information, see <a + * href='https://docs.aws.amazon.com/sagemaker/latest/dg/nbi-git-repo.html'>Associating Git Repositories with + * SageMaker Notebook Instances</a>.</p>. + * + * @return the additionalCodeRepositories value. + */ + public List additionalCodeRepositories() { + return this.additionalCodeRepositories; + } + + /** + * Set the additionalCodeRepositories property: <p>An array of up to three Git repositories associated with + * the notebook instance. These can be either the names of Git repositories stored as resources in your account, or + * the URL of Git repositories in <a + * href='https://docs.aws.amazon.com/codecommit/latest/userguide/welcome.html'>Amazon Web Services + * CodeCommit</a> or in any other Git repository. These repositories are cloned at the same level as the + * default repository of your notebook instance. For more information, see <a + * href='https://docs.aws.amazon.com/sagemaker/latest/dg/nbi-git-repo.html'>Associating Git Repositories with + * SageMaker Notebook Instances</a>.</p>. + * + * @param additionalCodeRepositories the additionalCodeRepositories value to set. + * @return the AwsSageMakerNotebookInstanceSummaryProperties object itself. + */ + public AwsSageMakerNotebookInstanceSummaryProperties + withAdditionalCodeRepositories(List additionalCodeRepositories) { + this.additionalCodeRepositories = additionalCodeRepositories; + return this; + } + + /** + * Get the creationTime property: <p>A timestamp that shows when the notebook instance was created.</p>. + * + * @return the creationTime value. + */ + public OffsetDateTime creationTime() { + return this.creationTime; + } + + /** + * Set the creationTime property: <p>A timestamp that shows when the notebook instance was created.</p>. + * + * @param creationTime the creationTime value to set. + * @return the AwsSageMakerNotebookInstanceSummaryProperties object itself. + */ + public AwsSageMakerNotebookInstanceSummaryProperties withCreationTime(OffsetDateTime creationTime) { + this.creationTime = creationTime; + return this; + } + + /** + * Get the defaultCodeRepository property: <p>The Git repository associated with the notebook instance as its + * default code repository. This can be either the name of a Git repository stored as a resource in your account, or + * the URL of a Git repository in <a + * href='https://docs.aws.amazon.com/codecommit/latest/userguide/welcome.html'>Amazon Web Services + * CodeCommit</a> or in any other Git repository. When you open a notebook instance, it opens in the directory + * that contains this repository. For more information, see <a + * href='https://docs.aws.amazon.com/sagemaker/latest/dg/nbi-git-repo.html'>Associating Git Repositories with + * SageMaker Notebook Instances</a>.</p>. + * + * @return the defaultCodeRepository value. + */ + public String defaultCodeRepository() { + return this.defaultCodeRepository; + } + + /** + * Set the defaultCodeRepository property: <p>The Git repository associated with the notebook instance as its + * default code repository. This can be either the name of a Git repository stored as a resource in your account, or + * the URL of a Git repository in <a + * href='https://docs.aws.amazon.com/codecommit/latest/userguide/welcome.html'>Amazon Web Services + * CodeCommit</a> or in any other Git repository. When you open a notebook instance, it opens in the directory + * that contains this repository. For more information, see <a + * href='https://docs.aws.amazon.com/sagemaker/latest/dg/nbi-git-repo.html'>Associating Git Repositories with + * SageMaker Notebook Instances</a>.</p>. + * + * @param defaultCodeRepository the defaultCodeRepository value to set. + * @return the AwsSageMakerNotebookInstanceSummaryProperties object itself. + */ + public AwsSageMakerNotebookInstanceSummaryProperties withDefaultCodeRepository(String defaultCodeRepository) { + this.defaultCodeRepository = defaultCodeRepository; + return this; + } + + /** + * Get the instanceType property: <p>The type of ML compute instance that the notebook instance is running + * on.</p>. + * + * @return the instanceType value. + */ + public InstanceTypeEnumValue instanceType() { + return this.instanceType; + } + + /** + * Set the instanceType property: <p>The type of ML compute instance that the notebook instance is running + * on.</p>. + * + * @param instanceType the instanceType value to set. + * @return the AwsSageMakerNotebookInstanceSummaryProperties object itself. + */ + public AwsSageMakerNotebookInstanceSummaryProperties withInstanceType(InstanceTypeEnumValue instanceType) { + this.instanceType = instanceType; + return this; + } + + /** + * Get the lastModifiedTime property: <p>A timestamp that shows when the notebook instance was last + * modified.</p>. + * + * @return the lastModifiedTime value. + */ + public OffsetDateTime lastModifiedTime() { + return this.lastModifiedTime; + } + + /** + * Set the lastModifiedTime property: <p>A timestamp that shows when the notebook instance was last + * modified.</p>. + * + * @param lastModifiedTime the lastModifiedTime value to set. + * @return the AwsSageMakerNotebookInstanceSummaryProperties object itself. + */ + public AwsSageMakerNotebookInstanceSummaryProperties withLastModifiedTime(OffsetDateTime lastModifiedTime) { + this.lastModifiedTime = lastModifiedTime; + return this; + } + + /** + * Get the notebookInstanceArn property: <p>The Amazon Resource Name (ARN) of the notebook + * instance.</p>. + * + * @return the notebookInstanceArn value. + */ + public String notebookInstanceArn() { + return this.notebookInstanceArn; + } + + /** + * Set the notebookInstanceArn property: <p>The Amazon Resource Name (ARN) of the notebook + * instance.</p>. + * + * @param notebookInstanceArn the notebookInstanceArn value to set. + * @return the AwsSageMakerNotebookInstanceSummaryProperties object itself. + */ + public AwsSageMakerNotebookInstanceSummaryProperties withNotebookInstanceArn(String notebookInstanceArn) { + this.notebookInstanceArn = notebookInstanceArn; + return this; + } + + /** + * Get the notebookInstanceLifecycleConfigName property: <p>The name of a notebook instance lifecycle + * configuration associated with this notebook instance.</p> <p>For information about notebook instance + * lifestyle configurations, see <a + * href='https://docs.aws.amazon.com/sagemaker/latest/dg/notebook-lifecycle-config.html'>Step 2.1: (Optional) + * Customize a Notebook Instance</a>.</p>. + * + * @return the notebookInstanceLifecycleConfigName value. + */ + public String notebookInstanceLifecycleConfigName() { + return this.notebookInstanceLifecycleConfigName; + } + + /** + * Set the notebookInstanceLifecycleConfigName property: <p>The name of a notebook instance lifecycle + * configuration associated with this notebook instance.</p> <p>For information about notebook instance + * lifestyle configurations, see <a + * href='https://docs.aws.amazon.com/sagemaker/latest/dg/notebook-lifecycle-config.html'>Step 2.1: (Optional) + * Customize a Notebook Instance</a>.</p>. + * + * @param notebookInstanceLifecycleConfigName the notebookInstanceLifecycleConfigName value to set. + * @return the AwsSageMakerNotebookInstanceSummaryProperties object itself. + */ + public AwsSageMakerNotebookInstanceSummaryProperties + withNotebookInstanceLifecycleConfigName(String notebookInstanceLifecycleConfigName) { + this.notebookInstanceLifecycleConfigName = notebookInstanceLifecycleConfigName; + return this; + } + + /** + * Get the notebookInstanceName property: <p>The name of the notebook instance that you want a summary + * for.</p>. + * + * @return the notebookInstanceName value. + */ + public String notebookInstanceName() { + return this.notebookInstanceName; + } + + /** + * Set the notebookInstanceName property: <p>The name of the notebook instance that you want a summary + * for.</p>. + * + * @param notebookInstanceName the notebookInstanceName value to set. + * @return the AwsSageMakerNotebookInstanceSummaryProperties object itself. + */ + public AwsSageMakerNotebookInstanceSummaryProperties withNotebookInstanceName(String notebookInstanceName) { + this.notebookInstanceName = notebookInstanceName; + return this; + } + + /** + * Get the notebookInstanceStatus property: <p>The status of the notebook instance.</p>. + * + * @return the notebookInstanceStatus value. + */ + public NotebookInstanceStatusEnumValue notebookInstanceStatus() { + return this.notebookInstanceStatus; + } + + /** + * Set the notebookInstanceStatus property: <p>The status of the notebook instance.</p>. + * + * @param notebookInstanceStatus the notebookInstanceStatus value to set. + * @return the AwsSageMakerNotebookInstanceSummaryProperties object itself. + */ + public AwsSageMakerNotebookInstanceSummaryProperties + withNotebookInstanceStatus(NotebookInstanceStatusEnumValue notebookInstanceStatus) { + this.notebookInstanceStatus = notebookInstanceStatus; + return this; + } + + /** + * Get the url property: <p>The URL that you use to connect to the Jupyter notebook running in your notebook + * instance. </p>. + * + * @return the url value. + */ + public String url() { + return this.url; + } + + /** + * Set the url property: <p>The URL that you use to connect to the Jupyter notebook running in your notebook + * instance. </p>. + * + * @param url the url value to set. + * @return the AwsSageMakerNotebookInstanceSummaryProperties object itself. + */ + public AwsSageMakerNotebookInstanceSummaryProperties withUrl(String url) { + this.url = url; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (instanceType() != null) { + instanceType().validate(); + } + if (notebookInstanceStatus() != null) { + notebookInstanceStatus().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("additionalCodeRepositories", this.additionalCodeRepositories, + (writer, element) -> writer.writeString(element)); + jsonWriter.writeStringField("creationTime", + this.creationTime == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.creationTime)); + jsonWriter.writeStringField("defaultCodeRepository", this.defaultCodeRepository); + jsonWriter.writeJsonField("instanceType", this.instanceType); + jsonWriter.writeStringField("lastModifiedTime", + this.lastModifiedTime == null + ? null + : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.lastModifiedTime)); + jsonWriter.writeStringField("notebookInstanceArn", this.notebookInstanceArn); + jsonWriter.writeStringField("notebookInstanceLifecycleConfigName", this.notebookInstanceLifecycleConfigName); + jsonWriter.writeStringField("notebookInstanceName", this.notebookInstanceName); + jsonWriter.writeJsonField("notebookInstanceStatus", this.notebookInstanceStatus); + jsonWriter.writeStringField("url", this.url); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AwsSageMakerNotebookInstanceSummaryProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AwsSageMakerNotebookInstanceSummaryProperties if the JsonReader was pointing to an + * instance of it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the AwsSageMakerNotebookInstanceSummaryProperties. + */ + public static AwsSageMakerNotebookInstanceSummaryProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AwsSageMakerNotebookInstanceSummaryProperties deserializedAwsSageMakerNotebookInstanceSummaryProperties + = new AwsSageMakerNotebookInstanceSummaryProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("additionalCodeRepositories".equals(fieldName)) { + List additionalCodeRepositories = reader.readArray(reader1 -> reader1.getString()); + deserializedAwsSageMakerNotebookInstanceSummaryProperties.additionalCodeRepositories + = additionalCodeRepositories; + } else if ("creationTime".equals(fieldName)) { + deserializedAwsSageMakerNotebookInstanceSummaryProperties.creationTime = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("defaultCodeRepository".equals(fieldName)) { + deserializedAwsSageMakerNotebookInstanceSummaryProperties.defaultCodeRepository + = reader.getString(); + } else if ("instanceType".equals(fieldName)) { + deserializedAwsSageMakerNotebookInstanceSummaryProperties.instanceType + = InstanceTypeEnumValue.fromJson(reader); + } else if ("lastModifiedTime".equals(fieldName)) { + deserializedAwsSageMakerNotebookInstanceSummaryProperties.lastModifiedTime = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("notebookInstanceArn".equals(fieldName)) { + deserializedAwsSageMakerNotebookInstanceSummaryProperties.notebookInstanceArn = reader.getString(); + } else if ("notebookInstanceLifecycleConfigName".equals(fieldName)) { + deserializedAwsSageMakerNotebookInstanceSummaryProperties.notebookInstanceLifecycleConfigName + = reader.getString(); + } else if ("notebookInstanceName".equals(fieldName)) { + deserializedAwsSageMakerNotebookInstanceSummaryProperties.notebookInstanceName = reader.getString(); + } else if ("notebookInstanceStatus".equals(fieldName)) { + deserializedAwsSageMakerNotebookInstanceSummaryProperties.notebookInstanceStatus + = NotebookInstanceStatusEnumValue.fromJson(reader); + } else if ("url".equals(fieldName)) { + deserializedAwsSageMakerNotebookInstanceSummaryProperties.url = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedAwsSageMakerNotebookInstanceSummaryProperties; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/AwsSecretsManagerResourcePolicyProperties.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/AwsSecretsManagerResourcePolicyProperties.java new file mode 100644 index 000000000000..7829eea901e7 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/AwsSecretsManagerResourcePolicyProperties.java @@ -0,0 +1,180 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of awsSecretsManagerResourcePolicy. + */ +@Fluent +public final class AwsSecretsManagerResourcePolicyProperties + implements JsonSerializable { + /* + * Property blockPublicPolicy + */ + private Boolean blockPublicPolicy; + + /* + * Property id + */ + private String id; + + /* + * Property resourcePolicy + */ + private Object resourcePolicy; + + /* + * Property secretId + */ + private String secretId; + + /** + * Creates an instance of AwsSecretsManagerResourcePolicyProperties class. + */ + public AwsSecretsManagerResourcePolicyProperties() { + } + + /** + * Get the blockPublicPolicy property: Property blockPublicPolicy. + * + * @return the blockPublicPolicy value. + */ + public Boolean blockPublicPolicy() { + return this.blockPublicPolicy; + } + + /** + * Set the blockPublicPolicy property: Property blockPublicPolicy. + * + * @param blockPublicPolicy the blockPublicPolicy value to set. + * @return the AwsSecretsManagerResourcePolicyProperties object itself. + */ + public AwsSecretsManagerResourcePolicyProperties withBlockPublicPolicy(Boolean blockPublicPolicy) { + this.blockPublicPolicy = blockPublicPolicy; + return this; + } + + /** + * Get the id property: Property id. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Set the id property: Property id. + * + * @param id the id value to set. + * @return the AwsSecretsManagerResourcePolicyProperties object itself. + */ + public AwsSecretsManagerResourcePolicyProperties withId(String id) { + this.id = id; + return this; + } + + /** + * Get the resourcePolicy property: Property resourcePolicy. + * + * @return the resourcePolicy value. + */ + public Object resourcePolicy() { + return this.resourcePolicy; + } + + /** + * Set the resourcePolicy property: Property resourcePolicy. + * + * @param resourcePolicy the resourcePolicy value to set. + * @return the AwsSecretsManagerResourcePolicyProperties object itself. + */ + public AwsSecretsManagerResourcePolicyProperties withResourcePolicy(Object resourcePolicy) { + this.resourcePolicy = resourcePolicy; + return this; + } + + /** + * Get the secretId property: Property secretId. + * + * @return the secretId value. + */ + public String secretId() { + return this.secretId; + } + + /** + * Set the secretId property: Property secretId. + * + * @param secretId the secretId value to set. + * @return the AwsSecretsManagerResourcePolicyProperties object itself. + */ + public AwsSecretsManagerResourcePolicyProperties withSecretId(String secretId) { + this.secretId = secretId; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeBooleanField("blockPublicPolicy", this.blockPublicPolicy); + jsonWriter.writeStringField("id", this.id); + jsonWriter.writeUntypedField("resourcePolicy", this.resourcePolicy); + jsonWriter.writeStringField("secretId", this.secretId); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AwsSecretsManagerResourcePolicyProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AwsSecretsManagerResourcePolicyProperties if the JsonReader was pointing to an instance of + * it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the AwsSecretsManagerResourcePolicyProperties. + */ + public static AwsSecretsManagerResourcePolicyProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AwsSecretsManagerResourcePolicyProperties deserializedAwsSecretsManagerResourcePolicyProperties + = new AwsSecretsManagerResourcePolicyProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("blockPublicPolicy".equals(fieldName)) { + deserializedAwsSecretsManagerResourcePolicyProperties.blockPublicPolicy + = reader.getNullable(JsonReader::getBoolean); + } else if ("id".equals(fieldName)) { + deserializedAwsSecretsManagerResourcePolicyProperties.id = reader.getString(); + } else if ("resourcePolicy".equals(fieldName)) { + deserializedAwsSecretsManagerResourcePolicyProperties.resourcePolicy = reader.readUntyped(); + } else if ("secretId".equals(fieldName)) { + deserializedAwsSecretsManagerResourcePolicyProperties.secretId = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedAwsSecretsManagerResourcePolicyProperties; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/AwsSecretsManagerSecretProperties.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/AwsSecretsManagerSecretProperties.java new file mode 100644 index 000000000000..a246748939fe --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/AwsSecretsManagerSecretProperties.java @@ -0,0 +1,442 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Definition of awsSecretsManagerSecret. + */ +@Fluent +public final class AwsSecretsManagerSecretProperties implements JsonSerializable { + /* + * The description of the secret. + */ + private String description; + + /* + * A structure that specifies how to generate a password to encrypt and store in the secret. To include a specific + * string in the secret, use ``SecretString`` instead. If you omit both ``GenerateSecretString`` and + * ``SecretString``, you create an empty secret. When you make a change to this property, a new secret version is + * created. We recommend that you specify the maximum length and include every character type that the system you + * are generating a password for can support. Generates a random password. We recommend that you specify the maximum + * length and include every character type that the system you are generating a password for can support. *Required + * permissions:* ``secretsmanager:GetRandomPassword``. For more information, see [IAM policy actions for Secrets + * Manager](https://docs.aws.amazon.com/service-authorization/latest/reference/list_awssecretsmanager.html# + * awssecretsmanager-actions-as-permissions) and [Authentication and access control in Secrets + * Manager](https://docs.aws.amazon.com/secretsmanager/latest/userguide/auth-and-access.html). + */ + private GenerateSecretString generateSecretString; + + /* + * Property id + */ + private String id; + + /* + * The ARN, key ID, or alias of the KMS key that Secrets Manager uses to encrypt the secret value in the secret. An + * alias is always prefixed by ``alias/``, for example ``alias/aws/secretsmanager``. For more information, see + * [About aliases](https://docs.aws.amazon.com/kms/latest/developerguide/alias-about.html). To use a KMS key in a + * different account, use the key ARN or the alias ARN. If you don't specify this value, then Secrets Manager uses + * the key ``aws/secretsmanager``. If that key doesn't yet exist, then Secrets Manager creates it for you + * automatically the first time it encrypts the secret value. If the secret is in a different AWS account from the + * credentials calling the API, then you can't use ``aws/secretsmanager`` to encrypt the secret, and you must create + * and use a customer managed KMS key. + */ + private String kmsKeyId; + + /* + * The name of the new secret. The secret name can contain ASCII letters, numbers, and the following characters: + * /_+=.@- Do not end your secret name with a hyphen followed by six characters. If you do so, you risk confusion + * and unexpected results when searching for a secret by partial ARN. Secrets Manager automatically adds a hyphen + * and six random characters after the secret name at the end of the ARN. + */ + private String name; + + /* + * A custom type that specifies a ``Region`` and the ``KmsKeyId`` for a replica secret. + */ + private List replicaRegions; + + /* + * The text to encrypt and store in the secret. We recommend you use a JSON structure of key/value pairs for your + * secret value. To generate a random password, use ``GenerateSecretString`` instead. If you omit both + * ``GenerateSecretString`` and ``SecretString``, you create an empty secret. When you make a change to this + * property, a new secret version is created. + */ + private String secretString; + + /* + * A list of tags to attach to the secret. Each tag is a key and value pair of strings in a JSON text string, for + * example: ``[{'Key':'CostCenter','Value':'12345'},{'Key':'environment','Value':'production'}]`` Secrets Manager + * tag key names are case sensitive. A tag with the key 'ABC' is a different tag from one with key 'abc'. + * Stack-level tags, tags you apply to the CloudFormation stack, are also attached to the secret. If you check tags + * in permissions policies as part of your security strategy, then adding or removing a tag can change permissions. + * If the completion of this operation would result in you losing your permissions for this secret, then Secrets + * Manager blocks the operation and returns an ``Access Denied`` error. For more information, see [Control access to + * secrets using + * tags](https://docs.aws.amazon.com/secretsmanager/latest/userguide/auth-and-access_examples.html#tag-secrets-abac) + * and [Limit access to identities with tags that match secrets' + * tags](https://docs.aws.amazon.com/secretsmanager/latest/userguide/auth-and-access_examples.html#auth-and- + * access_tags2). For information about how to format a JSON parameter for the various command line tool + * environments, see [Using JSON for + * Parameters](https://docs.aws.amazon.com/cli/latest/userguide/cli-using-param.html#cli-using-param-json). If your + * command-line tool or SDK requires quotation marks around the parameter, you should use single quotes to avoid + * confusion with the double quotes required in the JSON text. The following restrictions apply to tags: + Maximum + * number of tags per secret: 50 + Maximum key length: 127 Unicode characters in UTF-8 + Maximum value length: 255 + * Unicode characters in UTF-8 + Tag keys and values are case sensitive. + Do not use the ``aws:`` prefix in your + * tag names or values because AWS reserves it for AWS use. You can't edit or delete tag names or values with this + * prefix. Tags with this prefix do not count against your tags per secret limit. + If you use your tagging schema + * across multiple services and resources, other services might have restrictions on allowed characters. Generally + * allowed characters: letters, spaces, and numbers representable in UTF-8, plus the following special characters: + + * - = . _ : / @. + */ + private List tags; + + /** + * Creates an instance of AwsSecretsManagerSecretProperties class. + */ + public AwsSecretsManagerSecretProperties() { + } + + /** + * Get the description property: The description of the secret. + * + * @return the description value. + */ + public String description() { + return this.description; + } + + /** + * Set the description property: The description of the secret. + * + * @param description the description value to set. + * @return the AwsSecretsManagerSecretProperties object itself. + */ + public AwsSecretsManagerSecretProperties withDescription(String description) { + this.description = description; + return this; + } + + /** + * Get the generateSecretString property: A structure that specifies how to generate a password to encrypt and store + * in the secret. To include a specific string in the secret, use ``SecretString`` instead. If you omit both + * ``GenerateSecretString`` and ``SecretString``, you create an empty secret. When you make a change to this + * property, a new secret version is created. We recommend that you specify the maximum length and include every + * character type that the system you are generating a password for can support. Generates a random password. We + * recommend that you specify the maximum length and include every character type that the system you are generating + * a password for can support. *Required permissions:* ``secretsmanager:GetRandomPassword``. For more information, + * see [IAM policy actions for Secrets + * Manager](https://docs.aws.amazon.com/service-authorization/latest/reference/list_awssecretsmanager.html#awssecretsmanager-actions-as-permissions) + * and [Authentication and access control in Secrets + * Manager](https://docs.aws.amazon.com/secretsmanager/latest/userguide/auth-and-access.html). + * + * @return the generateSecretString value. + */ + public GenerateSecretString generateSecretString() { + return this.generateSecretString; + } + + /** + * Set the generateSecretString property: A structure that specifies how to generate a password to encrypt and store + * in the secret. To include a specific string in the secret, use ``SecretString`` instead. If you omit both + * ``GenerateSecretString`` and ``SecretString``, you create an empty secret. When you make a change to this + * property, a new secret version is created. We recommend that you specify the maximum length and include every + * character type that the system you are generating a password for can support. Generates a random password. We + * recommend that you specify the maximum length and include every character type that the system you are generating + * a password for can support. *Required permissions:* ``secretsmanager:GetRandomPassword``. For more information, + * see [IAM policy actions for Secrets + * Manager](https://docs.aws.amazon.com/service-authorization/latest/reference/list_awssecretsmanager.html#awssecretsmanager-actions-as-permissions) + * and [Authentication and access control in Secrets + * Manager](https://docs.aws.amazon.com/secretsmanager/latest/userguide/auth-and-access.html). + * + * @param generateSecretString the generateSecretString value to set. + * @return the AwsSecretsManagerSecretProperties object itself. + */ + public AwsSecretsManagerSecretProperties withGenerateSecretString(GenerateSecretString generateSecretString) { + this.generateSecretString = generateSecretString; + return this; + } + + /** + * Get the id property: Property id. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Set the id property: Property id. + * + * @param id the id value to set. + * @return the AwsSecretsManagerSecretProperties object itself. + */ + public AwsSecretsManagerSecretProperties withId(String id) { + this.id = id; + return this; + } + + /** + * Get the kmsKeyId property: The ARN, key ID, or alias of the KMS key that Secrets Manager uses to encrypt the + * secret value in the secret. An alias is always prefixed by ``alias/``, for example ``alias/aws/secretsmanager``. + * For more information, see [About + * aliases](https://docs.aws.amazon.com/kms/latest/developerguide/alias-about.html). To use a KMS key in a different + * account, use the key ARN or the alias ARN. If you don't specify this value, then Secrets Manager uses the key + * ``aws/secretsmanager``. If that key doesn't yet exist, then Secrets Manager creates it for you automatically the + * first time it encrypts the secret value. If the secret is in a different AWS account from the credentials calling + * the API, then you can't use ``aws/secretsmanager`` to encrypt the secret, and you must create and use a customer + * managed KMS key. + * + * @return the kmsKeyId value. + */ + public String kmsKeyId() { + return this.kmsKeyId; + } + + /** + * Set the kmsKeyId property: The ARN, key ID, or alias of the KMS key that Secrets Manager uses to encrypt the + * secret value in the secret. An alias is always prefixed by ``alias/``, for example ``alias/aws/secretsmanager``. + * For more information, see [About + * aliases](https://docs.aws.amazon.com/kms/latest/developerguide/alias-about.html). To use a KMS key in a different + * account, use the key ARN or the alias ARN. If you don't specify this value, then Secrets Manager uses the key + * ``aws/secretsmanager``. If that key doesn't yet exist, then Secrets Manager creates it for you automatically the + * first time it encrypts the secret value. If the secret is in a different AWS account from the credentials calling + * the API, then you can't use ``aws/secretsmanager`` to encrypt the secret, and you must create and use a customer + * managed KMS key. + * + * @param kmsKeyId the kmsKeyId value to set. + * @return the AwsSecretsManagerSecretProperties object itself. + */ + public AwsSecretsManagerSecretProperties withKmsKeyId(String kmsKeyId) { + this.kmsKeyId = kmsKeyId; + return this; + } + + /** + * Get the name property: The name of the new secret. The secret name can contain ASCII letters, numbers, and the + * following characters: /_+=.@- Do not end your secret name with a hyphen followed by six characters. If you + * do so, you risk confusion and unexpected results when searching for a secret by partial ARN. Secrets Manager + * automatically adds a hyphen and six random characters after the secret name at the end of the ARN. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: The name of the new secret. The secret name can contain ASCII letters, numbers, and the + * following characters: /_+=.@- Do not end your secret name with a hyphen followed by six characters. If you + * do so, you risk confusion and unexpected results when searching for a secret by partial ARN. Secrets Manager + * automatically adds a hyphen and six random characters after the secret name at the end of the ARN. + * + * @param name the name value to set. + * @return the AwsSecretsManagerSecretProperties object itself. + */ + public AwsSecretsManagerSecretProperties withName(String name) { + this.name = name; + return this; + } + + /** + * Get the replicaRegions property: A custom type that specifies a ``Region`` and the ``KmsKeyId`` for a replica + * secret. + * + * @return the replicaRegions value. + */ + public List replicaRegions() { + return this.replicaRegions; + } + + /** + * Set the replicaRegions property: A custom type that specifies a ``Region`` and the ``KmsKeyId`` for a replica + * secret. + * + * @param replicaRegions the replicaRegions value to set. + * @return the AwsSecretsManagerSecretProperties object itself. + */ + public AwsSecretsManagerSecretProperties withReplicaRegions(List replicaRegions) { + this.replicaRegions = replicaRegions; + return this; + } + + /** + * Get the secretString property: The text to encrypt and store in the secret. We recommend you use a JSON structure + * of key/value pairs for your secret value. To generate a random password, use ``GenerateSecretString`` instead. If + * you omit both ``GenerateSecretString`` and ``SecretString``, you create an empty secret. When you make a change + * to this property, a new secret version is created. + * + * @return the secretString value. + */ + public String secretString() { + return this.secretString; + } + + /** + * Set the secretString property: The text to encrypt and store in the secret. We recommend you use a JSON structure + * of key/value pairs for your secret value. To generate a random password, use ``GenerateSecretString`` instead. If + * you omit both ``GenerateSecretString`` and ``SecretString``, you create an empty secret. When you make a change + * to this property, a new secret version is created. + * + * @param secretString the secretString value to set. + * @return the AwsSecretsManagerSecretProperties object itself. + */ + public AwsSecretsManagerSecretProperties withSecretString(String secretString) { + this.secretString = secretString; + return this; + } + + /** + * Get the tags property: A list of tags to attach to the secret. Each tag is a key and value pair of strings in a + * JSON text string, for example: + * ``[{'Key':'CostCenter','Value':'12345'},{'Key':'environment','Value':'production'}]`` Secrets Manager tag key + * names are case sensitive. A tag with the key 'ABC' is a different tag from one with key 'abc'. Stack-level tags, + * tags you apply to the CloudFormation stack, are also attached to the secret. If you check tags in permissions + * policies as part of your security strategy, then adding or removing a tag can change permissions. If the + * completion of this operation would result in you losing your permissions for this secret, then Secrets Manager + * blocks the operation and returns an ``Access Denied`` error. For more information, see [Control access to secrets + * using + * tags](https://docs.aws.amazon.com/secretsmanager/latest/userguide/auth-and-access_examples.html#tag-secrets-abac) + * and [Limit access to identities with tags that match secrets' + * tags](https://docs.aws.amazon.com/secretsmanager/latest/userguide/auth-and-access_examples.html#auth-and-access_tags2). + * For information about how to format a JSON parameter for the various command line tool environments, see [Using + * JSON for Parameters](https://docs.aws.amazon.com/cli/latest/userguide/cli-using-param.html#cli-using-param-json). + * If your command-line tool or SDK requires quotation marks around the parameter, you should use single quotes to + * avoid confusion with the double quotes required in the JSON text. The following restrictions apply to tags: + + * Maximum number of tags per secret: 50 + Maximum key length: 127 Unicode characters in UTF-8 + Maximum value + * length: 255 Unicode characters in UTF-8 + Tag keys and values are case sensitive. + Do not use the ``aws:`` + * prefix in your tag names or values because AWS reserves it for AWS use. You can't edit or delete tag names or + * values with this prefix. Tags with this prefix do not count against your tags per secret limit. + If you use your + * tagging schema across multiple services and resources, other services might have restrictions on allowed + * characters. Generally allowed characters: letters, spaces, and numbers representable in UTF-8, plus the following + * special characters: + - = . _ : / @. + * + * @return the tags value. + */ + public List tags() { + return this.tags; + } + + /** + * Set the tags property: A list of tags to attach to the secret. Each tag is a key and value pair of strings in a + * JSON text string, for example: + * ``[{'Key':'CostCenter','Value':'12345'},{'Key':'environment','Value':'production'}]`` Secrets Manager tag key + * names are case sensitive. A tag with the key 'ABC' is a different tag from one with key 'abc'. Stack-level tags, + * tags you apply to the CloudFormation stack, are also attached to the secret. If you check tags in permissions + * policies as part of your security strategy, then adding or removing a tag can change permissions. If the + * completion of this operation would result in you losing your permissions for this secret, then Secrets Manager + * blocks the operation and returns an ``Access Denied`` error. For more information, see [Control access to secrets + * using + * tags](https://docs.aws.amazon.com/secretsmanager/latest/userguide/auth-and-access_examples.html#tag-secrets-abac) + * and [Limit access to identities with tags that match secrets' + * tags](https://docs.aws.amazon.com/secretsmanager/latest/userguide/auth-and-access_examples.html#auth-and-access_tags2). + * For information about how to format a JSON parameter for the various command line tool environments, see [Using + * JSON for Parameters](https://docs.aws.amazon.com/cli/latest/userguide/cli-using-param.html#cli-using-param-json). + * If your command-line tool or SDK requires quotation marks around the parameter, you should use single quotes to + * avoid confusion with the double quotes required in the JSON text. The following restrictions apply to tags: + + * Maximum number of tags per secret: 50 + Maximum key length: 127 Unicode characters in UTF-8 + Maximum value + * length: 255 Unicode characters in UTF-8 + Tag keys and values are case sensitive. + Do not use the ``aws:`` + * prefix in your tag names or values because AWS reserves it for AWS use. You can't edit or delete tag names or + * values with this prefix. Tags with this prefix do not count against your tags per secret limit. + If you use your + * tagging schema across multiple services and resources, other services might have restrictions on allowed + * characters. Generally allowed characters: letters, spaces, and numbers representable in UTF-8, plus the following + * special characters: + - = . _ : / @. + * + * @param tags the tags value to set. + * @return the AwsSecretsManagerSecretProperties object itself. + */ + public AwsSecretsManagerSecretProperties withTags(List tags) { + this.tags = tags; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (generateSecretString() != null) { + generateSecretString().validate(); + } + if (replicaRegions() != null) { + replicaRegions().forEach(e -> e.validate()); + } + if (tags() != null) { + tags().forEach(e -> e.validate()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("description", this.description); + jsonWriter.writeJsonField("generateSecretString", this.generateSecretString); + jsonWriter.writeStringField("id", this.id); + jsonWriter.writeStringField("kmsKeyId", this.kmsKeyId); + jsonWriter.writeStringField("name", this.name); + jsonWriter.writeArrayField("replicaRegions", this.replicaRegions, + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("secretString", this.secretString); + jsonWriter.writeArrayField("tags", this.tags, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AwsSecretsManagerSecretProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AwsSecretsManagerSecretProperties if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the AwsSecretsManagerSecretProperties. + */ + public static AwsSecretsManagerSecretProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AwsSecretsManagerSecretProperties deserializedAwsSecretsManagerSecretProperties + = new AwsSecretsManagerSecretProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("description".equals(fieldName)) { + deserializedAwsSecretsManagerSecretProperties.description = reader.getString(); + } else if ("generateSecretString".equals(fieldName)) { + deserializedAwsSecretsManagerSecretProperties.generateSecretString + = GenerateSecretString.fromJson(reader); + } else if ("id".equals(fieldName)) { + deserializedAwsSecretsManagerSecretProperties.id = reader.getString(); + } else if ("kmsKeyId".equals(fieldName)) { + deserializedAwsSecretsManagerSecretProperties.kmsKeyId = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedAwsSecretsManagerSecretProperties.name = reader.getString(); + } else if ("replicaRegions".equals(fieldName)) { + List replicaRegions = reader.readArray(reader1 -> ReplicaRegion.fromJson(reader1)); + deserializedAwsSecretsManagerSecretProperties.replicaRegions = replicaRegions; + } else if ("secretString".equals(fieldName)) { + deserializedAwsSecretsManagerSecretProperties.secretString = reader.getString(); + } else if ("tags".equals(fieldName)) { + List tags = reader.readArray(reader1 -> TagAutoGenerated52.fromJson(reader1)); + deserializedAwsSecretsManagerSecretProperties.tags = tags; + } else { + reader.skipChildren(); + } + } + + return deserializedAwsSecretsManagerSecretProperties; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/AwsSnsSubscriptionProperties.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/AwsSnsSubscriptionProperties.java new file mode 100644 index 000000000000..39fb5542ab42 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/AwsSnsSubscriptionProperties.java @@ -0,0 +1,205 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of awsSnsSubscription. + */ +@Fluent +public final class AwsSnsSubscriptionProperties implements JsonSerializable { + /* + *

The subscription's endpoint (format depends on the protocol).

+ */ + private String endpoint; + + /* + *

The subscription's owner.

+ */ + private String owner; + + /* + *

The subscription's protocol.

+ */ + private String protocol; + + /* + *

The subscription's ARN.

+ */ + private String subscriptionArn; + + /* + *

The ARN of the subscription's topic.

+ */ + private String topicArn; + + /** + * Creates an instance of AwsSnsSubscriptionProperties class. + */ + public AwsSnsSubscriptionProperties() { + } + + /** + * Get the endpoint property: <p>The subscription's endpoint (format depends on the protocol).</p>. + * + * @return the endpoint value. + */ + public String endpoint() { + return this.endpoint; + } + + /** + * Set the endpoint property: <p>The subscription's endpoint (format depends on the protocol).</p>. + * + * @param endpoint the endpoint value to set. + * @return the AwsSnsSubscriptionProperties object itself. + */ + public AwsSnsSubscriptionProperties withEndpoint(String endpoint) { + this.endpoint = endpoint; + return this; + } + + /** + * Get the owner property: <p>The subscription's owner.</p>. + * + * @return the owner value. + */ + public String owner() { + return this.owner; + } + + /** + * Set the owner property: <p>The subscription's owner.</p>. + * + * @param owner the owner value to set. + * @return the AwsSnsSubscriptionProperties object itself. + */ + public AwsSnsSubscriptionProperties withOwner(String owner) { + this.owner = owner; + return this; + } + + /** + * Get the protocol property: <p>The subscription's protocol.</p>. + * + * @return the protocol value. + */ + public String protocol() { + return this.protocol; + } + + /** + * Set the protocol property: <p>The subscription's protocol.</p>. + * + * @param protocol the protocol value to set. + * @return the AwsSnsSubscriptionProperties object itself. + */ + public AwsSnsSubscriptionProperties withProtocol(String protocol) { + this.protocol = protocol; + return this; + } + + /** + * Get the subscriptionArn property: <p>The subscription's ARN.</p>. + * + * @return the subscriptionArn value. + */ + public String subscriptionArn() { + return this.subscriptionArn; + } + + /** + * Set the subscriptionArn property: <p>The subscription's ARN.</p>. + * + * @param subscriptionArn the subscriptionArn value to set. + * @return the AwsSnsSubscriptionProperties object itself. + */ + public AwsSnsSubscriptionProperties withSubscriptionArn(String subscriptionArn) { + this.subscriptionArn = subscriptionArn; + return this; + } + + /** + * Get the topicArn property: <p>The ARN of the subscription's topic.</p>. + * + * @return the topicArn value. + */ + public String topicArn() { + return this.topicArn; + } + + /** + * Set the topicArn property: <p>The ARN of the subscription's topic.</p>. + * + * @param topicArn the topicArn value to set. + * @return the AwsSnsSubscriptionProperties object itself. + */ + public AwsSnsSubscriptionProperties withTopicArn(String topicArn) { + this.topicArn = topicArn; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("endpoint", this.endpoint); + jsonWriter.writeStringField("owner", this.owner); + jsonWriter.writeStringField("protocol", this.protocol); + jsonWriter.writeStringField("subscriptionArn", this.subscriptionArn); + jsonWriter.writeStringField("topicArn", this.topicArn); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AwsSnsSubscriptionProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AwsSnsSubscriptionProperties if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the AwsSnsSubscriptionProperties. + */ + public static AwsSnsSubscriptionProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AwsSnsSubscriptionProperties deserializedAwsSnsSubscriptionProperties = new AwsSnsSubscriptionProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("endpoint".equals(fieldName)) { + deserializedAwsSnsSubscriptionProperties.endpoint = reader.getString(); + } else if ("owner".equals(fieldName)) { + deserializedAwsSnsSubscriptionProperties.owner = reader.getString(); + } else if ("protocol".equals(fieldName)) { + deserializedAwsSnsSubscriptionProperties.protocol = reader.getString(); + } else if ("subscriptionArn".equals(fieldName)) { + deserializedAwsSnsSubscriptionProperties.subscriptionArn = reader.getString(); + } else if ("topicArn".equals(fieldName)) { + deserializedAwsSnsSubscriptionProperties.topicArn = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedAwsSnsSubscriptionProperties; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/AwsSnsTopicProperties.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/AwsSnsTopicProperties.java new file mode 100644 index 000000000000..4eb78190c417 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/AwsSnsTopicProperties.java @@ -0,0 +1,526 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Definition of awsSnsTopic. + */ +@Fluent +public final class AwsSnsTopicProperties implements JsonSerializable { + /* + * The archive policy determines the number of days SNS retains messages. You can set a retention period from 1 to + * 365 days. + */ + private Object archivePolicy; + + /* + * Enables content-based deduplication for FIFO topics. + By default, ``ContentBasedDeduplication`` is set to + * ``false``. If you create a FIFO topic and this attribute is ``false``, you must specify a value for the + * ``MessageDeduplicationId`` parameter for the + * [Publish](https://docs.aws.amazon.com/sns/latest/api/API_Publish.html) action. + When you set + * ``ContentBasedDeduplication`` to ``true``, SNS uses a SHA-256 hash to generate the ``MessageDeduplicationId`` + * using the body of the message (but not the attributes of the message). (Optional) To override the generated + * value, you can specify a value for the the ``MessageDeduplicationId`` parameter for the ``Publish`` action. + */ + private Boolean contentBasedDeduplication; + + /* + * The body of the policy document you want to use for this topic. You can only add one policy per topic. The policy + * must be in JSON string format. Length Constraints: Maximum length of 30,720. + */ + private Object dataProtectionPolicy; + + /* + * Property deliveryStatusLogging + */ + private List deliveryStatusLogging; + + /* + * The display name to use for an SNS topic with SMS subscriptions. The display name must be maximum 100 characters + * long, including hyphens (-), underscores (_), spaces, and tabs. + */ + private String displayName; + + /* + * Set to true to create a FIFO topic. + */ + private Boolean fifoTopic; + + /* + * The ID of an AWS managed customer master key (CMK) for SNS or a custom CMK. For more information, see [Key + * terms](https://docs.aws.amazon.com/sns/latest/dg/sns-server-side-encryption.html#sse-key-terms). For more + * examples, see ``KeyId`` in the *API Reference*. This property applies only to + * [server-side-encryption](https://docs.aws.amazon.com/sns/latest/dg/sns-server-side-encryption.html). + */ + private String kmsMasterKeyId; + + /* + * The signature version corresponds to the hashing algorithm used while creating the signature of the + * notifications, subscription confirmations, or unsubscribe confirmation messages sent by Amazon SNS. By default, + * ``SignatureVersion`` is set to ``1``. + */ + private String signatureVersion; + + /* + * The SNS subscriptions (endpoints) for this topic. If you specify the ``Subscription`` property in the + * ``AWS::SNS::Topic`` resource and it creates an associated subscription resource, the associated subscription is + * not deleted when the ``AWS::SNS::Topic`` resource is deleted. + */ + private List subscription; + + /* + * The list of tags to add to a new topic. To be able to tag a topic on creation, you must have the + * ``sns:CreateTopic`` and ``sns:TagResource`` permissions. + */ + private List tags; + + /* + * Property topicArn + */ + private String topicArn; + + /* + * The name of the topic you want to create. Topic names must include only uppercase and lowercase ASCII letters, + * numbers, underscores, and hyphens, and must be between 1 and 256 characters long. FIFO topic names must end with + * ``.fifo``. If you don't specify a name, CFN generates a unique physical ID and uses that ID for the topic name. + * For more information, see [Name + * type](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-name.html). If you specify a + * name, you can't perform updates that require replacement of this resource. You can perform updates that require + * no or some interruption. If you must replace the resource, specify a new name. + */ + private String topicName; + + /* + * Tracing mode of an SNS topic. By default ``TracingConfig`` is set to ``PassThrough``, and the topic passes + * through the tracing header it receives from an SNS publisher to its subscriptions. If set to ``Active``, SNS will + * vend X-Ray segment data to topic owner account if the sampled flag in the tracing header is true. + */ + private String tracingConfig; + + /** + * Creates an instance of AwsSnsTopicProperties class. + */ + public AwsSnsTopicProperties() { + } + + /** + * Get the archivePolicy property: The archive policy determines the number of days SNS retains messages. You can + * set a retention period from 1 to 365 days. + * + * @return the archivePolicy value. + */ + public Object archivePolicy() { + return this.archivePolicy; + } + + /** + * Set the archivePolicy property: The archive policy determines the number of days SNS retains messages. You can + * set a retention period from 1 to 365 days. + * + * @param archivePolicy the archivePolicy value to set. + * @return the AwsSnsTopicProperties object itself. + */ + public AwsSnsTopicProperties withArchivePolicy(Object archivePolicy) { + this.archivePolicy = archivePolicy; + return this; + } + + /** + * Get the contentBasedDeduplication property: Enables content-based deduplication for FIFO topics. + By default, + * ``ContentBasedDeduplication`` is set to ``false``. If you create a FIFO topic and this attribute is ``false``, + * you must specify a value for the ``MessageDeduplicationId`` parameter for the + * [Publish](https://docs.aws.amazon.com/sns/latest/api/API_Publish.html) action. + When you set + * ``ContentBasedDeduplication`` to ``true``, SNS uses a SHA-256 hash to generate the ``MessageDeduplicationId`` + * using the body of the message (but not the attributes of the message). (Optional) To override the generated + * value, you can specify a value for the the ``MessageDeduplicationId`` parameter for the ``Publish`` action. + * + * @return the contentBasedDeduplication value. + */ + public Boolean contentBasedDeduplication() { + return this.contentBasedDeduplication; + } + + /** + * Set the contentBasedDeduplication property: Enables content-based deduplication for FIFO topics. + By default, + * ``ContentBasedDeduplication`` is set to ``false``. If you create a FIFO topic and this attribute is ``false``, + * you must specify a value for the ``MessageDeduplicationId`` parameter for the + * [Publish](https://docs.aws.amazon.com/sns/latest/api/API_Publish.html) action. + When you set + * ``ContentBasedDeduplication`` to ``true``, SNS uses a SHA-256 hash to generate the ``MessageDeduplicationId`` + * using the body of the message (but not the attributes of the message). (Optional) To override the generated + * value, you can specify a value for the the ``MessageDeduplicationId`` parameter for the ``Publish`` action. + * + * @param contentBasedDeduplication the contentBasedDeduplication value to set. + * @return the AwsSnsTopicProperties object itself. + */ + public AwsSnsTopicProperties withContentBasedDeduplication(Boolean contentBasedDeduplication) { + this.contentBasedDeduplication = contentBasedDeduplication; + return this; + } + + /** + * Get the dataProtectionPolicy property: The body of the policy document you want to use for this topic. You can + * only add one policy per topic. The policy must be in JSON string format. Length Constraints: Maximum length of + * 30,720. + * + * @return the dataProtectionPolicy value. + */ + public Object dataProtectionPolicy() { + return this.dataProtectionPolicy; + } + + /** + * Set the dataProtectionPolicy property: The body of the policy document you want to use for this topic. You can + * only add one policy per topic. The policy must be in JSON string format. Length Constraints: Maximum length of + * 30,720. + * + * @param dataProtectionPolicy the dataProtectionPolicy value to set. + * @return the AwsSnsTopicProperties object itself. + */ + public AwsSnsTopicProperties withDataProtectionPolicy(Object dataProtectionPolicy) { + this.dataProtectionPolicy = dataProtectionPolicy; + return this; + } + + /** + * Get the deliveryStatusLogging property: Property deliveryStatusLogging. + * + * @return the deliveryStatusLogging value. + */ + public List deliveryStatusLogging() { + return this.deliveryStatusLogging; + } + + /** + * Set the deliveryStatusLogging property: Property deliveryStatusLogging. + * + * @param deliveryStatusLogging the deliveryStatusLogging value to set. + * @return the AwsSnsTopicProperties object itself. + */ + public AwsSnsTopicProperties withDeliveryStatusLogging(List deliveryStatusLogging) { + this.deliveryStatusLogging = deliveryStatusLogging; + return this; + } + + /** + * Get the displayName property: The display name to use for an SNS topic with SMS subscriptions. The display name + * must be maximum 100 characters long, including hyphens (-), underscores (_), spaces, and tabs. + * + * @return the displayName value. + */ + public String displayName() { + return this.displayName; + } + + /** + * Set the displayName property: The display name to use for an SNS topic with SMS subscriptions. The display name + * must be maximum 100 characters long, including hyphens (-), underscores (_), spaces, and tabs. + * + * @param displayName the displayName value to set. + * @return the AwsSnsTopicProperties object itself. + */ + public AwsSnsTopicProperties withDisplayName(String displayName) { + this.displayName = displayName; + return this; + } + + /** + * Get the fifoTopic property: Set to true to create a FIFO topic. + * + * @return the fifoTopic value. + */ + public Boolean fifoTopic() { + return this.fifoTopic; + } + + /** + * Set the fifoTopic property: Set to true to create a FIFO topic. + * + * @param fifoTopic the fifoTopic value to set. + * @return the AwsSnsTopicProperties object itself. + */ + public AwsSnsTopicProperties withFifoTopic(Boolean fifoTopic) { + this.fifoTopic = fifoTopic; + return this; + } + + /** + * Get the kmsMasterKeyId property: The ID of an AWS managed customer master key (CMK) for SNS or a custom CMK. For + * more information, see [Key + * terms](https://docs.aws.amazon.com/sns/latest/dg/sns-server-side-encryption.html#sse-key-terms). For more + * examples, see ``KeyId`` in the *API Reference*. This property applies only to + * [server-side-encryption](https://docs.aws.amazon.com/sns/latest/dg/sns-server-side-encryption.html). + * + * @return the kmsMasterKeyId value. + */ + public String kmsMasterKeyId() { + return this.kmsMasterKeyId; + } + + /** + * Set the kmsMasterKeyId property: The ID of an AWS managed customer master key (CMK) for SNS or a custom CMK. For + * more information, see [Key + * terms](https://docs.aws.amazon.com/sns/latest/dg/sns-server-side-encryption.html#sse-key-terms). For more + * examples, see ``KeyId`` in the *API Reference*. This property applies only to + * [server-side-encryption](https://docs.aws.amazon.com/sns/latest/dg/sns-server-side-encryption.html). + * + * @param kmsMasterKeyId the kmsMasterKeyId value to set. + * @return the AwsSnsTopicProperties object itself. + */ + public AwsSnsTopicProperties withKmsMasterKeyId(String kmsMasterKeyId) { + this.kmsMasterKeyId = kmsMasterKeyId; + return this; + } + + /** + * Get the signatureVersion property: The signature version corresponds to the hashing algorithm used while creating + * the signature of the notifications, subscription confirmations, or unsubscribe confirmation messages sent by + * Amazon SNS. By default, ``SignatureVersion`` is set to ``1``. + * + * @return the signatureVersion value. + */ + public String signatureVersion() { + return this.signatureVersion; + } + + /** + * Set the signatureVersion property: The signature version corresponds to the hashing algorithm used while creating + * the signature of the notifications, subscription confirmations, or unsubscribe confirmation messages sent by + * Amazon SNS. By default, ``SignatureVersion`` is set to ``1``. + * + * @param signatureVersion the signatureVersion value to set. + * @return the AwsSnsTopicProperties object itself. + */ + public AwsSnsTopicProperties withSignatureVersion(String signatureVersion) { + this.signatureVersion = signatureVersion; + return this; + } + + /** + * Get the subscription property: The SNS subscriptions (endpoints) for this topic. If you specify the + * ``Subscription`` property in the ``AWS::SNS::Topic`` resource and it creates an associated subscription resource, + * the associated subscription is not deleted when the ``AWS::SNS::Topic`` resource is deleted. + * + * @return the subscription value. + */ + public List subscription() { + return this.subscription; + } + + /** + * Set the subscription property: The SNS subscriptions (endpoints) for this topic. If you specify the + * ``Subscription`` property in the ``AWS::SNS::Topic`` resource and it creates an associated subscription resource, + * the associated subscription is not deleted when the ``AWS::SNS::Topic`` resource is deleted. + * + * @param subscription the subscription value to set. + * @return the AwsSnsTopicProperties object itself. + */ + public AwsSnsTopicProperties withSubscription(List subscription) { + this.subscription = subscription; + return this; + } + + /** + * Get the tags property: The list of tags to add to a new topic. To be able to tag a topic on creation, you must + * have the ``sns:CreateTopic`` and ``sns:TagResource`` permissions. + * + * @return the tags value. + */ + public List tags() { + return this.tags; + } + + /** + * Set the tags property: The list of tags to add to a new topic. To be able to tag a topic on creation, you must + * have the ``sns:CreateTopic`` and ``sns:TagResource`` permissions. + * + * @param tags the tags value to set. + * @return the AwsSnsTopicProperties object itself. + */ + public AwsSnsTopicProperties withTags(List tags) { + this.tags = tags; + return this; + } + + /** + * Get the topicArn property: Property topicArn. + * + * @return the topicArn value. + */ + public String topicArn() { + return this.topicArn; + } + + /** + * Set the topicArn property: Property topicArn. + * + * @param topicArn the topicArn value to set. + * @return the AwsSnsTopicProperties object itself. + */ + public AwsSnsTopicProperties withTopicArn(String topicArn) { + this.topicArn = topicArn; + return this; + } + + /** + * Get the topicName property: The name of the topic you want to create. Topic names must include only uppercase and + * lowercase ASCII letters, numbers, underscores, and hyphens, and must be between 1 and 256 characters long. FIFO + * topic names must end with ``.fifo``. If you don't specify a name, CFN generates a unique physical ID and uses + * that ID for the topic name. For more information, see [Name + * type](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-name.html). If you specify a + * name, you can't perform updates that require replacement of this resource. You can perform updates that require + * no or some interruption. If you must replace the resource, specify a new name. + * + * @return the topicName value. + */ + public String topicName() { + return this.topicName; + } + + /** + * Set the topicName property: The name of the topic you want to create. Topic names must include only uppercase and + * lowercase ASCII letters, numbers, underscores, and hyphens, and must be between 1 and 256 characters long. FIFO + * topic names must end with ``.fifo``. If you don't specify a name, CFN generates a unique physical ID and uses + * that ID for the topic name. For more information, see [Name + * type](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-name.html). If you specify a + * name, you can't perform updates that require replacement of this resource. You can perform updates that require + * no or some interruption. If you must replace the resource, specify a new name. + * + * @param topicName the topicName value to set. + * @return the AwsSnsTopicProperties object itself. + */ + public AwsSnsTopicProperties withTopicName(String topicName) { + this.topicName = topicName; + return this; + } + + /** + * Get the tracingConfig property: Tracing mode of an SNS topic. By default ``TracingConfig`` is set to + * ``PassThrough``, and the topic passes through the tracing header it receives from an SNS publisher to its + * subscriptions. If set to ``Active``, SNS will vend X-Ray segment data to topic owner account if the sampled flag + * in the tracing header is true. + * + * @return the tracingConfig value. + */ + public String tracingConfig() { + return this.tracingConfig; + } + + /** + * Set the tracingConfig property: Tracing mode of an SNS topic. By default ``TracingConfig`` is set to + * ``PassThrough``, and the topic passes through the tracing header it receives from an SNS publisher to its + * subscriptions. If set to ``Active``, SNS will vend X-Ray segment data to topic owner account if the sampled flag + * in the tracing header is true. + * + * @param tracingConfig the tracingConfig value to set. + * @return the AwsSnsTopicProperties object itself. + */ + public AwsSnsTopicProperties withTracingConfig(String tracingConfig) { + this.tracingConfig = tracingConfig; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (deliveryStatusLogging() != null) { + deliveryStatusLogging().forEach(e -> e.validate()); + } + if (subscription() != null) { + subscription().forEach(e -> e.validate()); + } + if (tags() != null) { + tags().forEach(e -> e.validate()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeUntypedField("archivePolicy", this.archivePolicy); + jsonWriter.writeBooleanField("contentBasedDeduplication", this.contentBasedDeduplication); + jsonWriter.writeUntypedField("dataProtectionPolicy", this.dataProtectionPolicy); + jsonWriter.writeArrayField("deliveryStatusLogging", this.deliveryStatusLogging, + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("displayName", this.displayName); + jsonWriter.writeBooleanField("fifoTopic", this.fifoTopic); + jsonWriter.writeStringField("kmsMasterKeyId", this.kmsMasterKeyId); + jsonWriter.writeStringField("signatureVersion", this.signatureVersion); + jsonWriter.writeArrayField("subscription", this.subscription, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("tags", this.tags, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("topicArn", this.topicArn); + jsonWriter.writeStringField("topicName", this.topicName); + jsonWriter.writeStringField("tracingConfig", this.tracingConfig); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AwsSnsTopicProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AwsSnsTopicProperties if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the AwsSnsTopicProperties. + */ + public static AwsSnsTopicProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AwsSnsTopicProperties deserializedAwsSnsTopicProperties = new AwsSnsTopicProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("archivePolicy".equals(fieldName)) { + deserializedAwsSnsTopicProperties.archivePolicy = reader.readUntyped(); + } else if ("contentBasedDeduplication".equals(fieldName)) { + deserializedAwsSnsTopicProperties.contentBasedDeduplication + = reader.getNullable(JsonReader::getBoolean); + } else if ("dataProtectionPolicy".equals(fieldName)) { + deserializedAwsSnsTopicProperties.dataProtectionPolicy = reader.readUntyped(); + } else if ("deliveryStatusLogging".equals(fieldName)) { + List deliveryStatusLogging + = reader.readArray(reader1 -> LoggingConfigAutoGenerated.fromJson(reader1)); + deserializedAwsSnsTopicProperties.deliveryStatusLogging = deliveryStatusLogging; + } else if ("displayName".equals(fieldName)) { + deserializedAwsSnsTopicProperties.displayName = reader.getString(); + } else if ("fifoTopic".equals(fieldName)) { + deserializedAwsSnsTopicProperties.fifoTopic = reader.getNullable(JsonReader::getBoolean); + } else if ("kmsMasterKeyId".equals(fieldName)) { + deserializedAwsSnsTopicProperties.kmsMasterKeyId = reader.getString(); + } else if ("signatureVersion".equals(fieldName)) { + deserializedAwsSnsTopicProperties.signatureVersion = reader.getString(); + } else if ("subscription".equals(fieldName)) { + List subscription = reader.readArray(reader1 -> Subscription.fromJson(reader1)); + deserializedAwsSnsTopicProperties.subscription = subscription; + } else if ("tags".equals(fieldName)) { + List tags = reader.readArray(reader1 -> TagAutoGenerated53.fromJson(reader1)); + deserializedAwsSnsTopicProperties.tags = tags; + } else if ("topicArn".equals(fieldName)) { + deserializedAwsSnsTopicProperties.topicArn = reader.getString(); + } else if ("topicName".equals(fieldName)) { + deserializedAwsSnsTopicProperties.topicName = reader.getString(); + } else if ("tracingConfig".equals(fieldName)) { + deserializedAwsSnsTopicProperties.tracingConfig = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedAwsSnsTopicProperties; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/AwsSqsQueueProperties.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/AwsSqsQueueProperties.java new file mode 100644 index 000000000000..48a47582731e --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/AwsSqsQueueProperties.java @@ -0,0 +1,840 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; +import java.util.Map; + +/** + * Definition of awsSqsQueue. + */ +@Fluent +public final class AwsSqsQueueProperties implements JsonSerializable { + /* + * Property arn + */ + private String arn; + + /* + * For first-in-first-out (FIFO) queues, specifies whether to enable content-based deduplication. During the + * deduplication interval, SQS treats messages that are sent with identical content as duplicates and delivers only + * one copy of the message. For more information, see the ``ContentBasedDeduplication`` attribute for the + * ``CreateQueue`` action in the *API Reference*. + */ + private Boolean contentBasedDeduplication; + + /* + * For high throughput for FIFO queues, specifies whether message deduplication occurs at the message group or queue + * level. Valid values are ``messageGroup`` and ``queue``. To enable high throughput for a FIFO queue, set this + * attribute to ``messageGroup`` *and* set the ``FifoThroughputLimit`` attribute to ``perMessageGroupId``. If you + * set these attributes to anything other than these values, normal throughput is in effect and deduplication occurs + * as specified. For more information, see [High throughput for FIFO + * queues](https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/high-throughput-fifo.html) and + * [Quotas related to + * messages](https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/quotas-messages.html) in the + * *Developer Guide*. + */ + private String deduplicationScope; + + /* + * The time in seconds for which the delivery of all messages in the queue is delayed. You can specify an integer + * value of ``0`` to ``900`` (15 minutes). The default value is ``0``. + */ + private Integer delaySeconds; + + /* + * If set to true, creates a FIFO queue. If you don't specify this property, SQS creates a standard queue. For more + * information, see [FIFO + * queues](https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/FIFO-queues.html) in the + * *Developer Guide*. + */ + private Boolean fifoQueue; + + /* + * For high throughput for FIFO queues, specifies whether the FIFO queue throughput quota applies to the entire + * queue or per message group. Valid values are ``perQueue`` and ``perMessageGroupId``. To enable high throughput + * for a FIFO queue, set this attribute to ``perMessageGroupId`` *and* set the ``DeduplicationScope`` attribute to + * ``messageGroup``. If you set these attributes to anything other than these values, normal throughput is in effect + * and deduplication occurs as specified. For more information, see [High throughput for FIFO + * queues](https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/high-throughput-fifo.html) and + * [Quotas related to + * messages](https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/quotas-messages.html) in the + * *Developer Guide*. + */ + private String fifoThroughputLimit; + + /* + * The length of time in seconds for which SQS can reuse a data key to encrypt or decrypt messages before calling + * KMS again. The value must be an integer between 60 (1 minute) and 86,400 (24 hours). The default is 300 (5 + * minutes). A shorter time period provides better security, but results in more calls to KMS, which might incur + * charges after Free Tier. For more information, see [Encryption at + * rest](https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-server-side-encryption.html# + * sqs-how-does-the-data-key-reuse-period-work) in the *Developer Guide*. + */ + private Integer kmsDataKeyReusePeriodSeconds; + + /* + * The ID of an AWS Key Management Service (KMS) for SQS, or a custom KMS. To use the AWS managed KMS for SQS, + * specify a (default) alias ARN, alias name (e.g. ``alias/aws/sqs``), key ARN, or key ID. For more information, see + * the following: + [Encryption at + * rest](https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-server-side-encryption.html) + * in the *Developer Guide* + + * [CreateQueue](https://docs.aws.amazon.com/AWSSimpleQueueService/latest/APIReference/API_CreateQueue.html) in the + * *API Reference* + [Request Parameters](https://docs.aws.amazon.com/kms/latest/APIReference/API_DescribeKey.html# + * API_DescribeKey_RequestParameters) in the *Key Management Service API Reference* + The Key Management Service + * (KMS) section of the [Best + * Practices](https://docs.aws.amazon.com/https://d0.awsstatic.com/whitepapers/aws-kms-best-practices.pdf) + * whitepaper + */ + private String kmsMasterKeyId; + + /* + * The limit of how many bytes that a message can contain before SQS rejects it. You can specify an integer value + * from ``1,024`` bytes (1 KiB) to ``262,144`` bytes (256 KiB). The default value is ``262,144`` (256 KiB). + */ + private Integer maximumMessageSize; + + /* + * The number of seconds that SQS retains a message. You can specify an integer value from ``60`` seconds (1 minute) + * to ``1,209,600`` seconds (14 days). The default value is ``345,600`` seconds (4 days). + */ + private Integer messageRetentionPeriod; + + /* + * A name for the queue. To create a FIFO queue, the name of your FIFO queue must end with the ``.fifo`` suffix. For + * more information, see [FIFO + * queues](https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/FIFO-queues.html) in the + * *Developer Guide*. If you don't specify a name, CFN generates a unique physical ID and uses that ID for the queue + * name. For more information, see [Name + * type](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-name.html) in the *User + * Guide*. If you specify a name, you can't perform updates that require replacement of this resource. You can + * perform updates that require no or some interruption. If you must replace the resource, specify a new name. + */ + private String queueName; + + /* + * Property queueUrl + */ + private String queueUrl; + + /* + * Specifies the duration, in seconds, that the ReceiveMessage action call waits until a message is in the queue in + * order to include it in the response, rather than returning an empty response if a message isn't yet available. + * You can specify an integer from 1 to 20. Short polling is used as the default or when you specify 0 for this + * property. For more information, see [Consuming messages using long + * polling](https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-short-and-long-polling. + * html#sqs-long-polling) in the *Developer Guide*. + */ + private Integer receiveMessageWaitTimeSeconds; + + /* + * The string that includes the parameters for the permissions for the dead-letter queue redrive permission and + * which source queues can specify dead-letter queues as a JSON object. The parameters are as follows: + + * ``redrivePermission``: The permission type that defines which source queues can specify the current queue as the + * dead-letter queue. Valid values are: + ``allowAll``: (Default) Any source queues in this AWS account in the same + * Region can specify this queue as the dead-letter queue. + ``denyAll``: No source queues can specify this queue as + * the dead-letter queue. + ``byQueue``: Only queues specified by the ``sourceQueueArns`` parameter can specify this + * queue as the dead-letter queue. + ``sourceQueueArns``: The Amazon Resource Names (ARN)s of the source queues that + * can specify this queue as the dead-letter queue and redrive messages. You can specify this parameter only when + * the ``redrivePermission`` parameter is set to ``byQueue``. You can specify up to 10 source queue ARNs. To allow + * more than 10 source queues to specify dead-letter queues, set the ``redrivePermission`` parameter to + * ``allowAll``. + */ + private Map redriveAllowPolicy; + + /* + * The string that includes the parameters for the dead-letter queue functionality of the source queue as a JSON + * object. The parameters are as follows: + ``deadLetterTargetArn``: The Amazon Resource Name (ARN) of the + * dead-letter queue to which SQS moves messages after the value of ``maxReceiveCount`` is exceeded. + + * ``maxReceiveCount``: The number of times a message is delivered to the source queue before being moved to the + * dead-letter queue. When the ``ReceiveCount`` for a message exceeds the ``maxReceiveCount`` for a queue, SQS moves + * the message to the dead-letter-queue. The dead-letter queue of a FIFO queue must also be a FIFO queue. Similarly, + * the dead-letter queue of a standard queue must also be a standard queue. *JSON* ``{ 'deadLetterTargetArn' : + * String, 'maxReceiveCount' : Integer }`` *YAML* ``deadLetterTargetArn : String`` ``maxReceiveCount : Integer`` + */ + private Map redrivePolicy; + + /* + * Enables server-side queue encryption using SQS owned encryption keys. Only one server-side encryption option is + * supported per queue (for example, + * [SSE-KMS](https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-configure-sse-existing- + * queue.html) or + * [SSE-SQS](https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-configure-sqs-sse-queue. + * html)). When ``SqsManagedSseEnabled`` is not defined, ``SSE-SQS`` encryption is enabled by default. + */ + private Boolean sqsManagedSseEnabled; + + /* + * The tags that you attach to this queue. For more information, see [Resource + * tag](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-resource-tags.html) in the + * *User Guide*. + */ + private List tags; + + /* + * The length of time during which a message will be unavailable after a message is delivered from the queue. This + * blocks other components from receiving the same message and gives the initial component time to process and + * delete the message from the queue. Values must be from 0 to 43,200 seconds (12 hours). If you don't specify a + * value, AWS CloudFormation uses the default value of 30 seconds. For more information about SQS queue visibility + * timeouts, see [Visibility + * timeout](https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-visibility-timeout.html) + * in the *Developer Guide*. + */ + private Integer visibilityTimeout; + + /** + * Creates an instance of AwsSqsQueueProperties class. + */ + public AwsSqsQueueProperties() { + } + + /** + * Get the arn property: Property arn. + * + * @return the arn value. + */ + public String arn() { + return this.arn; + } + + /** + * Set the arn property: Property arn. + * + * @param arn the arn value to set. + * @return the AwsSqsQueueProperties object itself. + */ + public AwsSqsQueueProperties withArn(String arn) { + this.arn = arn; + return this; + } + + /** + * Get the contentBasedDeduplication property: For first-in-first-out (FIFO) queues, specifies whether to enable + * content-based deduplication. During the deduplication interval, SQS treats messages that are sent with identical + * content as duplicates and delivers only one copy of the message. For more information, see the + * ``ContentBasedDeduplication`` attribute for the ``CreateQueue`` action in the *API Reference*. + * + * @return the contentBasedDeduplication value. + */ + public Boolean contentBasedDeduplication() { + return this.contentBasedDeduplication; + } + + /** + * Set the contentBasedDeduplication property: For first-in-first-out (FIFO) queues, specifies whether to enable + * content-based deduplication. During the deduplication interval, SQS treats messages that are sent with identical + * content as duplicates and delivers only one copy of the message. For more information, see the + * ``ContentBasedDeduplication`` attribute for the ``CreateQueue`` action in the *API Reference*. + * + * @param contentBasedDeduplication the contentBasedDeduplication value to set. + * @return the AwsSqsQueueProperties object itself. + */ + public AwsSqsQueueProperties withContentBasedDeduplication(Boolean contentBasedDeduplication) { + this.contentBasedDeduplication = contentBasedDeduplication; + return this; + } + + /** + * Get the deduplicationScope property: For high throughput for FIFO queues, specifies whether message deduplication + * occurs at the message group or queue level. Valid values are ``messageGroup`` and ``queue``. To enable high + * throughput for a FIFO queue, set this attribute to ``messageGroup`` *and* set the ``FifoThroughputLimit`` + * attribute to ``perMessageGroupId``. If you set these attributes to anything other than these values, normal + * throughput is in effect and deduplication occurs as specified. For more information, see [High throughput for + * FIFO + * queues](https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/high-throughput-fifo.html) and + * [Quotas related to + * messages](https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/quotas-messages.html) in the + * *Developer Guide*. + * + * @return the deduplicationScope value. + */ + public String deduplicationScope() { + return this.deduplicationScope; + } + + /** + * Set the deduplicationScope property: For high throughput for FIFO queues, specifies whether message deduplication + * occurs at the message group or queue level. Valid values are ``messageGroup`` and ``queue``. To enable high + * throughput for a FIFO queue, set this attribute to ``messageGroup`` *and* set the ``FifoThroughputLimit`` + * attribute to ``perMessageGroupId``. If you set these attributes to anything other than these values, normal + * throughput is in effect and deduplication occurs as specified. For more information, see [High throughput for + * FIFO + * queues](https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/high-throughput-fifo.html) and + * [Quotas related to + * messages](https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/quotas-messages.html) in the + * *Developer Guide*. + * + * @param deduplicationScope the deduplicationScope value to set. + * @return the AwsSqsQueueProperties object itself. + */ + public AwsSqsQueueProperties withDeduplicationScope(String deduplicationScope) { + this.deduplicationScope = deduplicationScope; + return this; + } + + /** + * Get the delaySeconds property: The time in seconds for which the delivery of all messages in the queue is + * delayed. You can specify an integer value of ``0`` to ``900`` (15 minutes). The default value is ``0``. + * + * @return the delaySeconds value. + */ + public Integer delaySeconds() { + return this.delaySeconds; + } + + /** + * Set the delaySeconds property: The time in seconds for which the delivery of all messages in the queue is + * delayed. You can specify an integer value of ``0`` to ``900`` (15 minutes). The default value is ``0``. + * + * @param delaySeconds the delaySeconds value to set. + * @return the AwsSqsQueueProperties object itself. + */ + public AwsSqsQueueProperties withDelaySeconds(Integer delaySeconds) { + this.delaySeconds = delaySeconds; + return this; + } + + /** + * Get the fifoQueue property: If set to true, creates a FIFO queue. If you don't specify this property, SQS creates + * a standard queue. For more information, see [FIFO + * queues](https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/FIFO-queues.html) in the + * *Developer Guide*. + * + * @return the fifoQueue value. + */ + public Boolean fifoQueue() { + return this.fifoQueue; + } + + /** + * Set the fifoQueue property: If set to true, creates a FIFO queue. If you don't specify this property, SQS creates + * a standard queue. For more information, see [FIFO + * queues](https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/FIFO-queues.html) in the + * *Developer Guide*. + * + * @param fifoQueue the fifoQueue value to set. + * @return the AwsSqsQueueProperties object itself. + */ + public AwsSqsQueueProperties withFifoQueue(Boolean fifoQueue) { + this.fifoQueue = fifoQueue; + return this; + } + + /** + * Get the fifoThroughputLimit property: For high throughput for FIFO queues, specifies whether the FIFO queue + * throughput quota applies to the entire queue or per message group. Valid values are ``perQueue`` and + * ``perMessageGroupId``. To enable high throughput for a FIFO queue, set this attribute to ``perMessageGroupId`` + * *and* set the ``DeduplicationScope`` attribute to ``messageGroup``. If you set these attributes to anything other + * than these values, normal throughput is in effect and deduplication occurs as specified. For more information, + * see [High throughput for FIFO + * queues](https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/high-throughput-fifo.html) and + * [Quotas related to + * messages](https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/quotas-messages.html) in the + * *Developer Guide*. + * + * @return the fifoThroughputLimit value. + */ + public String fifoThroughputLimit() { + return this.fifoThroughputLimit; + } + + /** + * Set the fifoThroughputLimit property: For high throughput for FIFO queues, specifies whether the FIFO queue + * throughput quota applies to the entire queue or per message group. Valid values are ``perQueue`` and + * ``perMessageGroupId``. To enable high throughput for a FIFO queue, set this attribute to ``perMessageGroupId`` + * *and* set the ``DeduplicationScope`` attribute to ``messageGroup``. If you set these attributes to anything other + * than these values, normal throughput is in effect and deduplication occurs as specified. For more information, + * see [High throughput for FIFO + * queues](https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/high-throughput-fifo.html) and + * [Quotas related to + * messages](https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/quotas-messages.html) in the + * *Developer Guide*. + * + * @param fifoThroughputLimit the fifoThroughputLimit value to set. + * @return the AwsSqsQueueProperties object itself. + */ + public AwsSqsQueueProperties withFifoThroughputLimit(String fifoThroughputLimit) { + this.fifoThroughputLimit = fifoThroughputLimit; + return this; + } + + /** + * Get the kmsDataKeyReusePeriodSeconds property: The length of time in seconds for which SQS can reuse a data key + * to encrypt or decrypt messages before calling KMS again. The value must be an integer between 60 (1 minute) and + * 86,400 (24 hours). The default is 300 (5 minutes). A shorter time period provides better security, but results in + * more calls to KMS, which might incur charges after Free Tier. For more information, see [Encryption at + * rest](https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-server-side-encryption.html#sqs-how-does-the-data-key-reuse-period-work) + * in the *Developer Guide*. + * + * @return the kmsDataKeyReusePeriodSeconds value. + */ + public Integer kmsDataKeyReusePeriodSeconds() { + return this.kmsDataKeyReusePeriodSeconds; + } + + /** + * Set the kmsDataKeyReusePeriodSeconds property: The length of time in seconds for which SQS can reuse a data key + * to encrypt or decrypt messages before calling KMS again. The value must be an integer between 60 (1 minute) and + * 86,400 (24 hours). The default is 300 (5 minutes). A shorter time period provides better security, but results in + * more calls to KMS, which might incur charges after Free Tier. For more information, see [Encryption at + * rest](https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-server-side-encryption.html#sqs-how-does-the-data-key-reuse-period-work) + * in the *Developer Guide*. + * + * @param kmsDataKeyReusePeriodSeconds the kmsDataKeyReusePeriodSeconds value to set. + * @return the AwsSqsQueueProperties object itself. + */ + public AwsSqsQueueProperties withKmsDataKeyReusePeriodSeconds(Integer kmsDataKeyReusePeriodSeconds) { + this.kmsDataKeyReusePeriodSeconds = kmsDataKeyReusePeriodSeconds; + return this; + } + + /** + * Get the kmsMasterKeyId property: The ID of an AWS Key Management Service (KMS) for SQS, or a custom KMS. To use + * the AWS managed KMS for SQS, specify a (default) alias ARN, alias name (e.g. ``alias/aws/sqs``), key ARN, or key + * ID. For more information, see the following: + [Encryption at + * rest](https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-server-side-encryption.html) + * in the *Developer Guide* + + * [CreateQueue](https://docs.aws.amazon.com/AWSSimpleQueueService/latest/APIReference/API_CreateQueue.html) in the + * *API Reference* + [Request + * Parameters](https://docs.aws.amazon.com/kms/latest/APIReference/API_DescribeKey.html#API_DescribeKey_RequestParameters) + * in the *Key Management Service API Reference* + The Key Management Service (KMS) section of the [Best + * Practices](https://docs.aws.amazon.com/https://d0.awsstatic.com/whitepapers/aws-kms-best-practices.pdf) + * whitepaper. + * + * @return the kmsMasterKeyId value. + */ + public String kmsMasterKeyId() { + return this.kmsMasterKeyId; + } + + /** + * Set the kmsMasterKeyId property: The ID of an AWS Key Management Service (KMS) for SQS, or a custom KMS. To use + * the AWS managed KMS for SQS, specify a (default) alias ARN, alias name (e.g. ``alias/aws/sqs``), key ARN, or key + * ID. For more information, see the following: + [Encryption at + * rest](https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-server-side-encryption.html) + * in the *Developer Guide* + + * [CreateQueue](https://docs.aws.amazon.com/AWSSimpleQueueService/latest/APIReference/API_CreateQueue.html) in the + * *API Reference* + [Request + * Parameters](https://docs.aws.amazon.com/kms/latest/APIReference/API_DescribeKey.html#API_DescribeKey_RequestParameters) + * in the *Key Management Service API Reference* + The Key Management Service (KMS) section of the [Best + * Practices](https://docs.aws.amazon.com/https://d0.awsstatic.com/whitepapers/aws-kms-best-practices.pdf) + * whitepaper. + * + * @param kmsMasterKeyId the kmsMasterKeyId value to set. + * @return the AwsSqsQueueProperties object itself. + */ + public AwsSqsQueueProperties withKmsMasterKeyId(String kmsMasterKeyId) { + this.kmsMasterKeyId = kmsMasterKeyId; + return this; + } + + /** + * Get the maximumMessageSize property: The limit of how many bytes that a message can contain before SQS rejects + * it. You can specify an integer value from ``1,024`` bytes (1 KiB) to ``262,144`` bytes (256 KiB). The default + * value is ``262,144`` (256 KiB). + * + * @return the maximumMessageSize value. + */ + public Integer maximumMessageSize() { + return this.maximumMessageSize; + } + + /** + * Set the maximumMessageSize property: The limit of how many bytes that a message can contain before SQS rejects + * it. You can specify an integer value from ``1,024`` bytes (1 KiB) to ``262,144`` bytes (256 KiB). The default + * value is ``262,144`` (256 KiB). + * + * @param maximumMessageSize the maximumMessageSize value to set. + * @return the AwsSqsQueueProperties object itself. + */ + public AwsSqsQueueProperties withMaximumMessageSize(Integer maximumMessageSize) { + this.maximumMessageSize = maximumMessageSize; + return this; + } + + /** + * Get the messageRetentionPeriod property: The number of seconds that SQS retains a message. You can specify an + * integer value from ``60`` seconds (1 minute) to ``1,209,600`` seconds (14 days). The default value is ``345,600`` + * seconds (4 days). + * + * @return the messageRetentionPeriod value. + */ + public Integer messageRetentionPeriod() { + return this.messageRetentionPeriod; + } + + /** + * Set the messageRetentionPeriod property: The number of seconds that SQS retains a message. You can specify an + * integer value from ``60`` seconds (1 minute) to ``1,209,600`` seconds (14 days). The default value is ``345,600`` + * seconds (4 days). + * + * @param messageRetentionPeriod the messageRetentionPeriod value to set. + * @return the AwsSqsQueueProperties object itself. + */ + public AwsSqsQueueProperties withMessageRetentionPeriod(Integer messageRetentionPeriod) { + this.messageRetentionPeriod = messageRetentionPeriod; + return this; + } + + /** + * Get the queueName property: A name for the queue. To create a FIFO queue, the name of your FIFO queue must end + * with the ``.fifo`` suffix. For more information, see [FIFO + * queues](https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/FIFO-queues.html) in the + * *Developer Guide*. If you don't specify a name, CFN generates a unique physical ID and uses that ID for the queue + * name. For more information, see [Name + * type](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-name.html) in the *User + * Guide*. If you specify a name, you can't perform updates that require replacement of this resource. You can + * perform updates that require no or some interruption. If you must replace the resource, specify a new name. + * + * @return the queueName value. + */ + public String queueName() { + return this.queueName; + } + + /** + * Set the queueName property: A name for the queue. To create a FIFO queue, the name of your FIFO queue must end + * with the ``.fifo`` suffix. For more information, see [FIFO + * queues](https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/FIFO-queues.html) in the + * *Developer Guide*. If you don't specify a name, CFN generates a unique physical ID and uses that ID for the queue + * name. For more information, see [Name + * type](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-name.html) in the *User + * Guide*. If you specify a name, you can't perform updates that require replacement of this resource. You can + * perform updates that require no or some interruption. If you must replace the resource, specify a new name. + * + * @param queueName the queueName value to set. + * @return the AwsSqsQueueProperties object itself. + */ + public AwsSqsQueueProperties withQueueName(String queueName) { + this.queueName = queueName; + return this; + } + + /** + * Get the queueUrl property: Property queueUrl. + * + * @return the queueUrl value. + */ + public String queueUrl() { + return this.queueUrl; + } + + /** + * Set the queueUrl property: Property queueUrl. + * + * @param queueUrl the queueUrl value to set. + * @return the AwsSqsQueueProperties object itself. + */ + public AwsSqsQueueProperties withQueueUrl(String queueUrl) { + this.queueUrl = queueUrl; + return this; + } + + /** + * Get the receiveMessageWaitTimeSeconds property: Specifies the duration, in seconds, that the ReceiveMessage + * action call waits until a message is in the queue in order to include it in the response, rather than returning + * an empty response if a message isn't yet available. You can specify an integer from 1 to 20. Short polling is + * used as the default or when you specify 0 for this property. For more information, see [Consuming messages using + * long + * polling](https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-short-and-long-polling.html#sqs-long-polling) + * in the *Developer Guide*. + * + * @return the receiveMessageWaitTimeSeconds value. + */ + public Integer receiveMessageWaitTimeSeconds() { + return this.receiveMessageWaitTimeSeconds; + } + + /** + * Set the receiveMessageWaitTimeSeconds property: Specifies the duration, in seconds, that the ReceiveMessage + * action call waits until a message is in the queue in order to include it in the response, rather than returning + * an empty response if a message isn't yet available. You can specify an integer from 1 to 20. Short polling is + * used as the default or when you specify 0 for this property. For more information, see [Consuming messages using + * long + * polling](https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-short-and-long-polling.html#sqs-long-polling) + * in the *Developer Guide*. + * + * @param receiveMessageWaitTimeSeconds the receiveMessageWaitTimeSeconds value to set. + * @return the AwsSqsQueueProperties object itself. + */ + public AwsSqsQueueProperties withReceiveMessageWaitTimeSeconds(Integer receiveMessageWaitTimeSeconds) { + this.receiveMessageWaitTimeSeconds = receiveMessageWaitTimeSeconds; + return this; + } + + /** + * Get the redriveAllowPolicy property: The string that includes the parameters for the permissions for the + * dead-letter queue redrive permission and which source queues can specify dead-letter queues as a JSON object. The + * parameters are as follows: + ``redrivePermission``: The permission type that defines which source queues can + * specify the current queue as the dead-letter queue. Valid values are: + ``allowAll``: (Default) Any source queues + * in this AWS account in the same Region can specify this queue as the dead-letter queue. + ``denyAll``: No source + * queues can specify this queue as the dead-letter queue. + ``byQueue``: Only queues specified by the + * ``sourceQueueArns`` parameter can specify this queue as the dead-letter queue. + ``sourceQueueArns``: The Amazon + * Resource Names (ARN)s of the source queues that can specify this queue as the dead-letter queue and redrive + * messages. You can specify this parameter only when the ``redrivePermission`` parameter is set to ``byQueue``. You + * can specify up to 10 source queue ARNs. To allow more than 10 source queues to specify dead-letter queues, set + * the ``redrivePermission`` parameter to ``allowAll``. + * + * @return the redriveAllowPolicy value. + */ + public Map redriveAllowPolicy() { + return this.redriveAllowPolicy; + } + + /** + * Set the redriveAllowPolicy property: The string that includes the parameters for the permissions for the + * dead-letter queue redrive permission and which source queues can specify dead-letter queues as a JSON object. The + * parameters are as follows: + ``redrivePermission``: The permission type that defines which source queues can + * specify the current queue as the dead-letter queue. Valid values are: + ``allowAll``: (Default) Any source queues + * in this AWS account in the same Region can specify this queue as the dead-letter queue. + ``denyAll``: No source + * queues can specify this queue as the dead-letter queue. + ``byQueue``: Only queues specified by the + * ``sourceQueueArns`` parameter can specify this queue as the dead-letter queue. + ``sourceQueueArns``: The Amazon + * Resource Names (ARN)s of the source queues that can specify this queue as the dead-letter queue and redrive + * messages. You can specify this parameter only when the ``redrivePermission`` parameter is set to ``byQueue``. You + * can specify up to 10 source queue ARNs. To allow more than 10 source queues to specify dead-letter queues, set + * the ``redrivePermission`` parameter to ``allowAll``. + * + * @param redriveAllowPolicy the redriveAllowPolicy value to set. + * @return the AwsSqsQueueProperties object itself. + */ + public AwsSqsQueueProperties withRedriveAllowPolicy(Map redriveAllowPolicy) { + this.redriveAllowPolicy = redriveAllowPolicy; + return this; + } + + /** + * Get the redrivePolicy property: The string that includes the parameters for the dead-letter queue functionality + * of the source queue as a JSON object. The parameters are as follows: + ``deadLetterTargetArn``: The Amazon + * Resource Name (ARN) of the dead-letter queue to which SQS moves messages after the value of ``maxReceiveCount`` + * is exceeded. + ``maxReceiveCount``: The number of times a message is delivered to the source queue before being + * moved to the dead-letter queue. When the ``ReceiveCount`` for a message exceeds the ``maxReceiveCount`` for a + * queue, SQS moves the message to the dead-letter-queue. The dead-letter queue of a FIFO queue must also be a FIFO + * queue. Similarly, the dead-letter queue of a standard queue must also be a standard queue. *JSON* ``{ + * 'deadLetterTargetArn' : String, 'maxReceiveCount' : Integer }`` *YAML* ``deadLetterTargetArn : String`` + * ``maxReceiveCount : Integer``. + * + * @return the redrivePolicy value. + */ + public Map redrivePolicy() { + return this.redrivePolicy; + } + + /** + * Set the redrivePolicy property: The string that includes the parameters for the dead-letter queue functionality + * of the source queue as a JSON object. The parameters are as follows: + ``deadLetterTargetArn``: The Amazon + * Resource Name (ARN) of the dead-letter queue to which SQS moves messages after the value of ``maxReceiveCount`` + * is exceeded. + ``maxReceiveCount``: The number of times a message is delivered to the source queue before being + * moved to the dead-letter queue. When the ``ReceiveCount`` for a message exceeds the ``maxReceiveCount`` for a + * queue, SQS moves the message to the dead-letter-queue. The dead-letter queue of a FIFO queue must also be a FIFO + * queue. Similarly, the dead-letter queue of a standard queue must also be a standard queue. *JSON* ``{ + * 'deadLetterTargetArn' : String, 'maxReceiveCount' : Integer }`` *YAML* ``deadLetterTargetArn : String`` + * ``maxReceiveCount : Integer``. + * + * @param redrivePolicy the redrivePolicy value to set. + * @return the AwsSqsQueueProperties object itself. + */ + public AwsSqsQueueProperties withRedrivePolicy(Map redrivePolicy) { + this.redrivePolicy = redrivePolicy; + return this; + } + + /** + * Get the sqsManagedSseEnabled property: Enables server-side queue encryption using SQS owned encryption keys. Only + * one server-side encryption option is supported per queue (for example, + * [SSE-KMS](https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-configure-sse-existing-queue.html) + * or + * [SSE-SQS](https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-configure-sqs-sse-queue.html)). + * When ``SqsManagedSseEnabled`` is not defined, ``SSE-SQS`` encryption is enabled by default. + * + * @return the sqsManagedSseEnabled value. + */ + public Boolean sqsManagedSseEnabled() { + return this.sqsManagedSseEnabled; + } + + /** + * Set the sqsManagedSseEnabled property: Enables server-side queue encryption using SQS owned encryption keys. Only + * one server-side encryption option is supported per queue (for example, + * [SSE-KMS](https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-configure-sse-existing-queue.html) + * or + * [SSE-SQS](https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-configure-sqs-sse-queue.html)). + * When ``SqsManagedSseEnabled`` is not defined, ``SSE-SQS`` encryption is enabled by default. + * + * @param sqsManagedSseEnabled the sqsManagedSseEnabled value to set. + * @return the AwsSqsQueueProperties object itself. + */ + public AwsSqsQueueProperties withSqsManagedSseEnabled(Boolean sqsManagedSseEnabled) { + this.sqsManagedSseEnabled = sqsManagedSseEnabled; + return this; + } + + /** + * Get the tags property: The tags that you attach to this queue. For more information, see [Resource + * tag](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-resource-tags.html) in the + * *User Guide*. + * + * @return the tags value. + */ + public List tags() { + return this.tags; + } + + /** + * Set the tags property: The tags that you attach to this queue. For more information, see [Resource + * tag](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-resource-tags.html) in the + * *User Guide*. + * + * @param tags the tags value to set. + * @return the AwsSqsQueueProperties object itself. + */ + public AwsSqsQueueProperties withTags(List tags) { + this.tags = tags; + return this; + } + + /** + * Get the visibilityTimeout property: The length of time during which a message will be unavailable after a message + * is delivered from the queue. This blocks other components from receiving the same message and gives the initial + * component time to process and delete the message from the queue. Values must be from 0 to 43,200 seconds (12 + * hours). If you don't specify a value, AWS CloudFormation uses the default value of 30 seconds. For more + * information about SQS queue visibility timeouts, see [Visibility + * timeout](https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-visibility-timeout.html) + * in the *Developer Guide*. + * + * @return the visibilityTimeout value. + */ + public Integer visibilityTimeout() { + return this.visibilityTimeout; + } + + /** + * Set the visibilityTimeout property: The length of time during which a message will be unavailable after a message + * is delivered from the queue. This blocks other components from receiving the same message and gives the initial + * component time to process and delete the message from the queue. Values must be from 0 to 43,200 seconds (12 + * hours). If you don't specify a value, AWS CloudFormation uses the default value of 30 seconds. For more + * information about SQS queue visibility timeouts, see [Visibility + * timeout](https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-visibility-timeout.html) + * in the *Developer Guide*. + * + * @param visibilityTimeout the visibilityTimeout value to set. + * @return the AwsSqsQueueProperties object itself. + */ + public AwsSqsQueueProperties withVisibilityTimeout(Integer visibilityTimeout) { + this.visibilityTimeout = visibilityTimeout; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (tags() != null) { + tags().forEach(e -> e.validate()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("arn", this.arn); + jsonWriter.writeBooleanField("contentBasedDeduplication", this.contentBasedDeduplication); + jsonWriter.writeStringField("deduplicationScope", this.deduplicationScope); + jsonWriter.writeNumberField("delaySeconds", this.delaySeconds); + jsonWriter.writeBooleanField("fifoQueue", this.fifoQueue); + jsonWriter.writeStringField("fifoThroughputLimit", this.fifoThroughputLimit); + jsonWriter.writeNumberField("kmsDataKeyReusePeriodSeconds", this.kmsDataKeyReusePeriodSeconds); + jsonWriter.writeStringField("kmsMasterKeyId", this.kmsMasterKeyId); + jsonWriter.writeNumberField("maximumMessageSize", this.maximumMessageSize); + jsonWriter.writeNumberField("messageRetentionPeriod", this.messageRetentionPeriod); + jsonWriter.writeStringField("queueName", this.queueName); + jsonWriter.writeStringField("queueUrl", this.queueUrl); + jsonWriter.writeNumberField("receiveMessageWaitTimeSeconds", this.receiveMessageWaitTimeSeconds); + jsonWriter.writeMapField("redriveAllowPolicy", this.redriveAllowPolicy, + (writer, element) -> writer.writeUntyped(element)); + jsonWriter.writeMapField("redrivePolicy", this.redrivePolicy, + (writer, element) -> writer.writeUntyped(element)); + jsonWriter.writeBooleanField("sqsManagedSseEnabled", this.sqsManagedSseEnabled); + jsonWriter.writeArrayField("tags", this.tags, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeNumberField("visibilityTimeout", this.visibilityTimeout); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AwsSqsQueueProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AwsSqsQueueProperties if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the AwsSqsQueueProperties. + */ + public static AwsSqsQueueProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AwsSqsQueueProperties deserializedAwsSqsQueueProperties = new AwsSqsQueueProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("arn".equals(fieldName)) { + deserializedAwsSqsQueueProperties.arn = reader.getString(); + } else if ("contentBasedDeduplication".equals(fieldName)) { + deserializedAwsSqsQueueProperties.contentBasedDeduplication + = reader.getNullable(JsonReader::getBoolean); + } else if ("deduplicationScope".equals(fieldName)) { + deserializedAwsSqsQueueProperties.deduplicationScope = reader.getString(); + } else if ("delaySeconds".equals(fieldName)) { + deserializedAwsSqsQueueProperties.delaySeconds = reader.getNullable(JsonReader::getInt); + } else if ("fifoQueue".equals(fieldName)) { + deserializedAwsSqsQueueProperties.fifoQueue = reader.getNullable(JsonReader::getBoolean); + } else if ("fifoThroughputLimit".equals(fieldName)) { + deserializedAwsSqsQueueProperties.fifoThroughputLimit = reader.getString(); + } else if ("kmsDataKeyReusePeriodSeconds".equals(fieldName)) { + deserializedAwsSqsQueueProperties.kmsDataKeyReusePeriodSeconds + = reader.getNullable(JsonReader::getInt); + } else if ("kmsMasterKeyId".equals(fieldName)) { + deserializedAwsSqsQueueProperties.kmsMasterKeyId = reader.getString(); + } else if ("maximumMessageSize".equals(fieldName)) { + deserializedAwsSqsQueueProperties.maximumMessageSize = reader.getNullable(JsonReader::getInt); + } else if ("messageRetentionPeriod".equals(fieldName)) { + deserializedAwsSqsQueueProperties.messageRetentionPeriod = reader.getNullable(JsonReader::getInt); + } else if ("queueName".equals(fieldName)) { + deserializedAwsSqsQueueProperties.queueName = reader.getString(); + } else if ("queueUrl".equals(fieldName)) { + deserializedAwsSqsQueueProperties.queueUrl = reader.getString(); + } else if ("receiveMessageWaitTimeSeconds".equals(fieldName)) { + deserializedAwsSqsQueueProperties.receiveMessageWaitTimeSeconds + = reader.getNullable(JsonReader::getInt); + } else if ("redriveAllowPolicy".equals(fieldName)) { + Map redriveAllowPolicy = reader.readMap(reader1 -> reader1.readUntyped()); + deserializedAwsSqsQueueProperties.redriveAllowPolicy = redriveAllowPolicy; + } else if ("redrivePolicy".equals(fieldName)) { + Map redrivePolicy = reader.readMap(reader1 -> reader1.readUntyped()); + deserializedAwsSqsQueueProperties.redrivePolicy = redrivePolicy; + } else if ("sqsManagedSseEnabled".equals(fieldName)) { + deserializedAwsSqsQueueProperties.sqsManagedSseEnabled = reader.getNullable(JsonReader::getBoolean); + } else if ("tags".equals(fieldName)) { + List tags = reader.readArray(reader1 -> TagAutoGenerated54.fromJson(reader1)); + deserializedAwsSqsQueueProperties.tags = tags; + } else if ("visibilityTimeout".equals(fieldName)) { + deserializedAwsSqsQueueProperties.visibilityTimeout = reader.getNullable(JsonReader::getInt); + } else { + reader.skipChildren(); + } + } + + return deserializedAwsSqsQueueProperties; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/AwsSsmInstanceInformationProperties.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/AwsSsmInstanceInformationProperties.java new file mode 100644 index 000000000000..98a0f9ec3cb8 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/AwsSsmInstanceInformationProperties.java @@ -0,0 +1,787 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.time.OffsetDateTime; +import java.time.format.DateTimeFormatter; + +/** + * Definition of awsSsmInstanceInformation. + */ +@Fluent +public final class AwsSsmInstanceInformationProperties + implements JsonSerializable { + /* + *

The activation ID created by Amazon Web Services Systems Manager when the server or virtual machine (VM) was + * registered.

+ */ + private String activationId; + + /* + *

The version of SSM Agent running on your Linux managed node.

+ */ + private String agentVersion; + + /* + *

Information about the association.

+ */ + private InstanceAggregatedAssociationOverview associationOverview; + + /* + *

The status of the association.

+ */ + private String associationStatus; + + /* + *

The fully qualified host name of the managed node.

+ */ + private String computerName; + + /* + *

The IP address of the managed node.

+ */ + private String ipAddress; + + /* + *

The Identity and Access Management (IAM) role assigned to the on-premises Systems Manager managed node. This + * call doesn't return the IAM role for Amazon Elastic Compute Cloud (Amazon EC2) instances. To retrieve the IAM + * role for an EC2 instance, use the Amazon EC2 DescribeInstances operation. For information, see DescribeInstances in + * the Amazon EC2 API Reference or describe-instances in the + * Amazon Web Services CLI Command Reference.

+ */ + private String iamRole; + + /* + *

The managed node ID.

+ */ + private String instanceId; + + /* + *

Indicates whether the latest version of SSM Agent is running on your Linux managed node. This field doesn't + * indicate whether or not the latest version is installed on Windows managed nodes, because some older versions of + * Windows Server use the EC2Config service to process Systems Manager requests.

+ */ + private Boolean isLatestVersion; + + /* + *

The date the association was last run.

+ */ + private OffsetDateTime lastAssociationExecutionDate; + + /* + *

The date and time when the agent last pinged the Systems Manager service.

+ */ + private OffsetDateTime lastPingDateTime; + + /* + *

The last date the association was successfully run.

+ */ + private OffsetDateTime lastSuccessfulAssociationExecutionDate; + + /* + *

The name assigned to an on-premises server, edge device, or virtual machine (VM) when it is activated as a + * Systems Manager managed node. The name is specified as the DefaultInstanceName property using the + * CreateActivation command. It is applied to the managed node by specifying the Activation Code and + * Activation ID when you install SSM Agent on the node, as explained in Install SSM + * Agent for a hybrid and multicloud environment (Linux) and Install SSM + * Agent for a hybrid and multicloud environment (Windows). To retrieve the Name tag of an EC2 + * instance, use the Amazon EC2 DescribeInstances operation. For information, see DescribeInstances in + * the Amazon EC2 API Reference or describe-instances in the + * Amazon Web Services CLI Command Reference.

+ */ + private String name; + + /* + *

Connection status of SSM Agent.

The status Inactive has been deprecated and is no + * longer in use.

+ */ + private PingStatusEnumValue pingStatus; + + /* + *

The name of the operating system platform running on your managed node.

+ */ + private String platformName; + + /* + *

The operating system platform type.

+ */ + private PlatformTypeEnumValue platformType; + + /* + *

The version of the OS platform running on your managed node.

+ */ + private String platformVersion; + + /* + *

The date the server or VM was registered with Amazon Web Services as a managed node.

+ */ + private OffsetDateTime registrationDate; + + /* + *

The type of instance. Instances are either EC2 instances or managed instances.

+ */ + private ResourceTypeEnumValue resourceType; + + /* + *

The ID of the source resource. For IoT Greengrass devices, SourceId is the Thing name.

+ */ + private String sourceId; + + /* + *

The type of the source resource. For IoT Greengrass devices, SourceType is + * AWS::IoT::Thing.

+ */ + private SourceTypeEnumValue sourceType; + + /** + * Creates an instance of AwsSsmInstanceInformationProperties class. + */ + public AwsSsmInstanceInformationProperties() { + } + + /** + * Get the activationId property: <p>The activation ID created by Amazon Web Services Systems Manager when the + * server or virtual machine (VM) was registered.</p>. + * + * @return the activationId value. + */ + public String activationId() { + return this.activationId; + } + + /** + * Set the activationId property: <p>The activation ID created by Amazon Web Services Systems Manager when the + * server or virtual machine (VM) was registered.</p>. + * + * @param activationId the activationId value to set. + * @return the AwsSsmInstanceInformationProperties object itself. + */ + public AwsSsmInstanceInformationProperties withActivationId(String activationId) { + this.activationId = activationId; + return this; + } + + /** + * Get the agentVersion property: <p>The version of SSM Agent running on your Linux managed node. </p>. + * + * @return the agentVersion value. + */ + public String agentVersion() { + return this.agentVersion; + } + + /** + * Set the agentVersion property: <p>The version of SSM Agent running on your Linux managed node. </p>. + * + * @param agentVersion the agentVersion value to set. + * @return the AwsSsmInstanceInformationProperties object itself. + */ + public AwsSsmInstanceInformationProperties withAgentVersion(String agentVersion) { + this.agentVersion = agentVersion; + return this; + } + + /** + * Get the associationOverview property: <p>Information about the association.</p>. + * + * @return the associationOverview value. + */ + public InstanceAggregatedAssociationOverview associationOverview() { + return this.associationOverview; + } + + /** + * Set the associationOverview property: <p>Information about the association.</p>. + * + * @param associationOverview the associationOverview value to set. + * @return the AwsSsmInstanceInformationProperties object itself. + */ + public AwsSsmInstanceInformationProperties + withAssociationOverview(InstanceAggregatedAssociationOverview associationOverview) { + this.associationOverview = associationOverview; + return this; + } + + /** + * Get the associationStatus property: <p>The status of the association.</p>. + * + * @return the associationStatus value. + */ + public String associationStatus() { + return this.associationStatus; + } + + /** + * Set the associationStatus property: <p>The status of the association.</p>. + * + * @param associationStatus the associationStatus value to set. + * @return the AwsSsmInstanceInformationProperties object itself. + */ + public AwsSsmInstanceInformationProperties withAssociationStatus(String associationStatus) { + this.associationStatus = associationStatus; + return this; + } + + /** + * Get the computerName property: <p>The fully qualified host name of the managed node.</p>. + * + * @return the computerName value. + */ + public String computerName() { + return this.computerName; + } + + /** + * Set the computerName property: <p>The fully qualified host name of the managed node.</p>. + * + * @param computerName the computerName value to set. + * @return the AwsSsmInstanceInformationProperties object itself. + */ + public AwsSsmInstanceInformationProperties withComputerName(String computerName) { + this.computerName = computerName; + return this; + } + + /** + * Get the ipAddress property: <p>The IP address of the managed node.</p>. + * + * @return the ipAddress value. + */ + public String ipAddress() { + return this.ipAddress; + } + + /** + * Set the ipAddress property: <p>The IP address of the managed node.</p>. + * + * @param ipAddress the ipAddress value to set. + * @return the AwsSsmInstanceInformationProperties object itself. + */ + public AwsSsmInstanceInformationProperties withIpAddress(String ipAddress) { + this.ipAddress = ipAddress; + return this; + } + + /** + * Get the iamRole property: <p>The Identity and Access Management (IAM) role assigned to the on-premises + * Systems Manager managed node. This call doesn't return the IAM role for Amazon Elastic Compute Cloud (Amazon EC2) + * instances. To retrieve the IAM role for an EC2 instance, use the Amazon EC2 + * <code>DescribeInstances</code> operation. For information, see <a + * href='https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_DescribeInstances.html'>DescribeInstances</a> + * in the <i>Amazon EC2 API Reference</i> or <a + * href='https://docs.aws.amazon.com/cli/latest/reference/ec2/describe-instances.html'>describe-instances</a> + * in the <i>Amazon Web Services CLI Command Reference</i>.</p>. + * + * @return the iamRole value. + */ + public String iamRole() { + return this.iamRole; + } + + /** + * Set the iamRole property: <p>The Identity and Access Management (IAM) role assigned to the on-premises + * Systems Manager managed node. This call doesn't return the IAM role for Amazon Elastic Compute Cloud (Amazon EC2) + * instances. To retrieve the IAM role for an EC2 instance, use the Amazon EC2 + * <code>DescribeInstances</code> operation. For information, see <a + * href='https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_DescribeInstances.html'>DescribeInstances</a> + * in the <i>Amazon EC2 API Reference</i> or <a + * href='https://docs.aws.amazon.com/cli/latest/reference/ec2/describe-instances.html'>describe-instances</a> + * in the <i>Amazon Web Services CLI Command Reference</i>.</p>. + * + * @param iamRole the iamRole value to set. + * @return the AwsSsmInstanceInformationProperties object itself. + */ + public AwsSsmInstanceInformationProperties withIamRole(String iamRole) { + this.iamRole = iamRole; + return this; + } + + /** + * Get the instanceId property: <p>The managed node ID. </p>. + * + * @return the instanceId value. + */ + public String instanceId() { + return this.instanceId; + } + + /** + * Set the instanceId property: <p>The managed node ID. </p>. + * + * @param instanceId the instanceId value to set. + * @return the AwsSsmInstanceInformationProperties object itself. + */ + public AwsSsmInstanceInformationProperties withInstanceId(String instanceId) { + this.instanceId = instanceId; + return this; + } + + /** + * Get the isLatestVersion property: <p>Indicates whether the latest version of SSM Agent is running on your + * Linux managed node. This field doesn't indicate whether or not the latest version is installed on Windows managed + * nodes, because some older versions of Windows Server use the EC2Config service to process Systems Manager + * requests.</p>. + * + * @return the isLatestVersion value. + */ + public Boolean isLatestVersion() { + return this.isLatestVersion; + } + + /** + * Set the isLatestVersion property: <p>Indicates whether the latest version of SSM Agent is running on your + * Linux managed node. This field doesn't indicate whether or not the latest version is installed on Windows managed + * nodes, because some older versions of Windows Server use the EC2Config service to process Systems Manager + * requests.</p>. + * + * @param isLatestVersion the isLatestVersion value to set. + * @return the AwsSsmInstanceInformationProperties object itself. + */ + public AwsSsmInstanceInformationProperties withIsLatestVersion(Boolean isLatestVersion) { + this.isLatestVersion = isLatestVersion; + return this; + } + + /** + * Get the lastAssociationExecutionDate property: <p>The date the association was last run.</p>. + * + * @return the lastAssociationExecutionDate value. + */ + public OffsetDateTime lastAssociationExecutionDate() { + return this.lastAssociationExecutionDate; + } + + /** + * Set the lastAssociationExecutionDate property: <p>The date the association was last run.</p>. + * + * @param lastAssociationExecutionDate the lastAssociationExecutionDate value to set. + * @return the AwsSsmInstanceInformationProperties object itself. + */ + public AwsSsmInstanceInformationProperties + withLastAssociationExecutionDate(OffsetDateTime lastAssociationExecutionDate) { + this.lastAssociationExecutionDate = lastAssociationExecutionDate; + return this; + } + + /** + * Get the lastPingDateTime property: <p>The date and time when the agent last pinged the Systems Manager + * service. </p>. + * + * @return the lastPingDateTime value. + */ + public OffsetDateTime lastPingDateTime() { + return this.lastPingDateTime; + } + + /** + * Set the lastPingDateTime property: <p>The date and time when the agent last pinged the Systems Manager + * service. </p>. + * + * @param lastPingDateTime the lastPingDateTime value to set. + * @return the AwsSsmInstanceInformationProperties object itself. + */ + public AwsSsmInstanceInformationProperties withLastPingDateTime(OffsetDateTime lastPingDateTime) { + this.lastPingDateTime = lastPingDateTime; + return this; + } + + /** + * Get the lastSuccessfulAssociationExecutionDate property: <p>The last date the association was successfully + * run.</p>. + * + * @return the lastSuccessfulAssociationExecutionDate value. + */ + public OffsetDateTime lastSuccessfulAssociationExecutionDate() { + return this.lastSuccessfulAssociationExecutionDate; + } + + /** + * Set the lastSuccessfulAssociationExecutionDate property: <p>The last date the association was successfully + * run.</p>. + * + * @param lastSuccessfulAssociationExecutionDate the lastSuccessfulAssociationExecutionDate value to set. + * @return the AwsSsmInstanceInformationProperties object itself. + */ + public AwsSsmInstanceInformationProperties + withLastSuccessfulAssociationExecutionDate(OffsetDateTime lastSuccessfulAssociationExecutionDate) { + this.lastSuccessfulAssociationExecutionDate = lastSuccessfulAssociationExecutionDate; + return this; + } + + /** + * Get the name property: <p>The name assigned to an on-premises server, edge device, or virtual machine (VM) + * when it is activated as a Systems Manager managed node. The name is specified as the + * <code>DefaultInstanceName</code> property using the <a>CreateActivation</a> command. It + * is applied to the managed node by specifying the Activation Code and Activation ID when you install SSM Agent on + * the node, as explained in <a + * href='https://docs.aws.amazon.com/systems-manager/latest/userguide/sysman-install-managed-linux.html'>Install + * SSM Agent for a hybrid and multicloud environment (Linux)</a> and <a + * href='https://docs.aws.amazon.com/systems-manager/latest/userguide/sysman-install-managed-win.html'>Install + * SSM Agent for a hybrid and multicloud environment (Windows)</a>. To retrieve the + * <code>Name</code> tag of an EC2 instance, use the Amazon EC2 + * <code>DescribeInstances</code> operation. For information, see <a + * href='https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_DescribeInstances.html'>DescribeInstances</a> + * in the <i>Amazon EC2 API Reference</i> or <a + * href='https://docs.aws.amazon.com/cli/latest/reference/ec2/describe-instances.html'>describe-instances</a> + * in the <i>Amazon Web Services CLI Command Reference</i>.</p>. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: <p>The name assigned to an on-premises server, edge device, or virtual machine (VM) + * when it is activated as a Systems Manager managed node. The name is specified as the + * <code>DefaultInstanceName</code> property using the <a>CreateActivation</a> command. It + * is applied to the managed node by specifying the Activation Code and Activation ID when you install SSM Agent on + * the node, as explained in <a + * href='https://docs.aws.amazon.com/systems-manager/latest/userguide/sysman-install-managed-linux.html'>Install + * SSM Agent for a hybrid and multicloud environment (Linux)</a> and <a + * href='https://docs.aws.amazon.com/systems-manager/latest/userguide/sysman-install-managed-win.html'>Install + * SSM Agent for a hybrid and multicloud environment (Windows)</a>. To retrieve the + * <code>Name</code> tag of an EC2 instance, use the Amazon EC2 + * <code>DescribeInstances</code> operation. For information, see <a + * href='https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_DescribeInstances.html'>DescribeInstances</a> + * in the <i>Amazon EC2 API Reference</i> or <a + * href='https://docs.aws.amazon.com/cli/latest/reference/ec2/describe-instances.html'>describe-instances</a> + * in the <i>Amazon Web Services CLI Command Reference</i>.</p>. + * + * @param name the name value to set. + * @return the AwsSsmInstanceInformationProperties object itself. + */ + public AwsSsmInstanceInformationProperties withName(String name) { + this.name = name; + return this; + } + + /** + * Get the pingStatus property: <p>Connection status of SSM Agent. </p> <note> <p>The status + * <code>Inactive</code> has been deprecated and is no longer in use.</p> </note>. + * + * @return the pingStatus value. + */ + public PingStatusEnumValue pingStatus() { + return this.pingStatus; + } + + /** + * Set the pingStatus property: <p>Connection status of SSM Agent. </p> <note> <p>The status + * <code>Inactive</code> has been deprecated and is no longer in use.</p> </note>. + * + * @param pingStatus the pingStatus value to set. + * @return the AwsSsmInstanceInformationProperties object itself. + */ + public AwsSsmInstanceInformationProperties withPingStatus(PingStatusEnumValue pingStatus) { + this.pingStatus = pingStatus; + return this; + } + + /** + * Get the platformName property: <p>The name of the operating system platform running on your managed node. + * </p>. + * + * @return the platformName value. + */ + public String platformName() { + return this.platformName; + } + + /** + * Set the platformName property: <p>The name of the operating system platform running on your managed node. + * </p>. + * + * @param platformName the platformName value to set. + * @return the AwsSsmInstanceInformationProperties object itself. + */ + public AwsSsmInstanceInformationProperties withPlatformName(String platformName) { + this.platformName = platformName; + return this; + } + + /** + * Get the platformType property: <p>The operating system platform type. </p>. + * + * @return the platformType value. + */ + public PlatformTypeEnumValue platformType() { + return this.platformType; + } + + /** + * Set the platformType property: <p>The operating system platform type. </p>. + * + * @param platformType the platformType value to set. + * @return the AwsSsmInstanceInformationProperties object itself. + */ + public AwsSsmInstanceInformationProperties withPlatformType(PlatformTypeEnumValue platformType) { + this.platformType = platformType; + return this; + } + + /** + * Get the platformVersion property: <p>The version of the OS platform running on your managed node. + * </p>. + * + * @return the platformVersion value. + */ + public String platformVersion() { + return this.platformVersion; + } + + /** + * Set the platformVersion property: <p>The version of the OS platform running on your managed node. + * </p>. + * + * @param platformVersion the platformVersion value to set. + * @return the AwsSsmInstanceInformationProperties object itself. + */ + public AwsSsmInstanceInformationProperties withPlatformVersion(String platformVersion) { + this.platformVersion = platformVersion; + return this; + } + + /** + * Get the registrationDate property: <p>The date the server or VM was registered with Amazon Web Services as + * a managed node.</p>. + * + * @return the registrationDate value. + */ + public OffsetDateTime registrationDate() { + return this.registrationDate; + } + + /** + * Set the registrationDate property: <p>The date the server or VM was registered with Amazon Web Services as + * a managed node.</p>. + * + * @param registrationDate the registrationDate value to set. + * @return the AwsSsmInstanceInformationProperties object itself. + */ + public AwsSsmInstanceInformationProperties withRegistrationDate(OffsetDateTime registrationDate) { + this.registrationDate = registrationDate; + return this; + } + + /** + * Get the resourceType property: <p>The type of instance. Instances are either EC2 instances or managed + * instances. </p>. + * + * @return the resourceType value. + */ + public ResourceTypeEnumValue resourceType() { + return this.resourceType; + } + + /** + * Set the resourceType property: <p>The type of instance. Instances are either EC2 instances or managed + * instances. </p>. + * + * @param resourceType the resourceType value to set. + * @return the AwsSsmInstanceInformationProperties object itself. + */ + public AwsSsmInstanceInformationProperties withResourceType(ResourceTypeEnumValue resourceType) { + this.resourceType = resourceType; + return this; + } + + /** + * Get the sourceId property: <p>The ID of the source resource. For IoT Greengrass devices, + * <code>SourceId</code> is the Thing name. </p>. + * + * @return the sourceId value. + */ + public String sourceId() { + return this.sourceId; + } + + /** + * Set the sourceId property: <p>The ID of the source resource. For IoT Greengrass devices, + * <code>SourceId</code> is the Thing name. </p>. + * + * @param sourceId the sourceId value to set. + * @return the AwsSsmInstanceInformationProperties object itself. + */ + public AwsSsmInstanceInformationProperties withSourceId(String sourceId) { + this.sourceId = sourceId; + return this; + } + + /** + * Get the sourceType property: <p>The type of the source resource. For IoT Greengrass devices, + * <code>SourceType</code> is <code>AWS::IoT::Thing</code>. </p>. + * + * @return the sourceType value. + */ + public SourceTypeEnumValue sourceType() { + return this.sourceType; + } + + /** + * Set the sourceType property: <p>The type of the source resource. For IoT Greengrass devices, + * <code>SourceType</code> is <code>AWS::IoT::Thing</code>. </p>. + * + * @param sourceType the sourceType value to set. + * @return the AwsSsmInstanceInformationProperties object itself. + */ + public AwsSsmInstanceInformationProperties withSourceType(SourceTypeEnumValue sourceType) { + this.sourceType = sourceType; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (associationOverview() != null) { + associationOverview().validate(); + } + if (pingStatus() != null) { + pingStatus().validate(); + } + if (platformType() != null) { + platformType().validate(); + } + if (resourceType() != null) { + resourceType().validate(); + } + if (sourceType() != null) { + sourceType().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("activationId", this.activationId); + jsonWriter.writeStringField("agentVersion", this.agentVersion); + jsonWriter.writeJsonField("associationOverview", this.associationOverview); + jsonWriter.writeStringField("associationStatus", this.associationStatus); + jsonWriter.writeStringField("computerName", this.computerName); + jsonWriter.writeStringField("ipAddress", this.ipAddress); + jsonWriter.writeStringField("iamRole", this.iamRole); + jsonWriter.writeStringField("instanceId", this.instanceId); + jsonWriter.writeBooleanField("isLatestVersion", this.isLatestVersion); + jsonWriter.writeStringField("lastAssociationExecutionDate", + this.lastAssociationExecutionDate == null + ? null + : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.lastAssociationExecutionDate)); + jsonWriter.writeStringField("lastPingDateTime", + this.lastPingDateTime == null + ? null + : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.lastPingDateTime)); + jsonWriter.writeStringField("lastSuccessfulAssociationExecutionDate", + this.lastSuccessfulAssociationExecutionDate == null + ? null + : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.lastSuccessfulAssociationExecutionDate)); + jsonWriter.writeStringField("name", this.name); + jsonWriter.writeJsonField("pingStatus", this.pingStatus); + jsonWriter.writeStringField("platformName", this.platformName); + jsonWriter.writeJsonField("platformType", this.platformType); + jsonWriter.writeStringField("platformVersion", this.platformVersion); + jsonWriter.writeStringField("registrationDate", + this.registrationDate == null + ? null + : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.registrationDate)); + jsonWriter.writeJsonField("resourceType", this.resourceType); + jsonWriter.writeStringField("sourceId", this.sourceId); + jsonWriter.writeJsonField("sourceType", this.sourceType); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AwsSsmInstanceInformationProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AwsSsmInstanceInformationProperties if the JsonReader was pointing to an instance of it, + * or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the AwsSsmInstanceInformationProperties. + */ + public static AwsSsmInstanceInformationProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AwsSsmInstanceInformationProperties deserializedAwsSsmInstanceInformationProperties + = new AwsSsmInstanceInformationProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("activationId".equals(fieldName)) { + deserializedAwsSsmInstanceInformationProperties.activationId = reader.getString(); + } else if ("agentVersion".equals(fieldName)) { + deserializedAwsSsmInstanceInformationProperties.agentVersion = reader.getString(); + } else if ("associationOverview".equals(fieldName)) { + deserializedAwsSsmInstanceInformationProperties.associationOverview + = InstanceAggregatedAssociationOverview.fromJson(reader); + } else if ("associationStatus".equals(fieldName)) { + deserializedAwsSsmInstanceInformationProperties.associationStatus = reader.getString(); + } else if ("computerName".equals(fieldName)) { + deserializedAwsSsmInstanceInformationProperties.computerName = reader.getString(); + } else if ("ipAddress".equals(fieldName)) { + deserializedAwsSsmInstanceInformationProperties.ipAddress = reader.getString(); + } else if ("iamRole".equals(fieldName)) { + deserializedAwsSsmInstanceInformationProperties.iamRole = reader.getString(); + } else if ("instanceId".equals(fieldName)) { + deserializedAwsSsmInstanceInformationProperties.instanceId = reader.getString(); + } else if ("isLatestVersion".equals(fieldName)) { + deserializedAwsSsmInstanceInformationProperties.isLatestVersion + = reader.getNullable(JsonReader::getBoolean); + } else if ("lastAssociationExecutionDate".equals(fieldName)) { + deserializedAwsSsmInstanceInformationProperties.lastAssociationExecutionDate = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("lastPingDateTime".equals(fieldName)) { + deserializedAwsSsmInstanceInformationProperties.lastPingDateTime = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("lastSuccessfulAssociationExecutionDate".equals(fieldName)) { + deserializedAwsSsmInstanceInformationProperties.lastSuccessfulAssociationExecutionDate = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("name".equals(fieldName)) { + deserializedAwsSsmInstanceInformationProperties.name = reader.getString(); + } else if ("pingStatus".equals(fieldName)) { + deserializedAwsSsmInstanceInformationProperties.pingStatus = PingStatusEnumValue.fromJson(reader); + } else if ("platformName".equals(fieldName)) { + deserializedAwsSsmInstanceInformationProperties.platformName = reader.getString(); + } else if ("platformType".equals(fieldName)) { + deserializedAwsSsmInstanceInformationProperties.platformType + = PlatformTypeEnumValue.fromJson(reader); + } else if ("platformVersion".equals(fieldName)) { + deserializedAwsSsmInstanceInformationProperties.platformVersion = reader.getString(); + } else if ("registrationDate".equals(fieldName)) { + deserializedAwsSsmInstanceInformationProperties.registrationDate = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("resourceType".equals(fieldName)) { + deserializedAwsSsmInstanceInformationProperties.resourceType + = ResourceTypeEnumValue.fromJson(reader); + } else if ("sourceId".equals(fieldName)) { + deserializedAwsSsmInstanceInformationProperties.sourceId = reader.getString(); + } else if ("sourceType".equals(fieldName)) { + deserializedAwsSsmInstanceInformationProperties.sourceType = SourceTypeEnumValue.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedAwsSsmInstanceInformationProperties; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/AwsSsmParameterProperties.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/AwsSsmParameterProperties.java new file mode 100644 index 000000000000..949d67496550 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/AwsSsmParameterProperties.java @@ -0,0 +1,351 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of awsSsmParameter. + */ +@Fluent +public final class AwsSsmParameterProperties implements JsonSerializable { + /* + * A regular expression used to validate the parameter value. For example, for ``String`` types with values + * restricted to numbers, you can specify the following: ``AllowedPattern=^\d+$`` + */ + private String allowedPattern; + + /* + * The data type of the parameter, such as ``text`` or ``aws:ec2:image``. The default is ``text``. + */ + private DataType dataType; + + /* + * Information about the parameter. + */ + private String description; + + /* + * The name of the parameter. The maximum length constraint listed below includes capacity for additional system + * attributes that aren't part of the name. The maximum length for a parameter name, including the full length of + * the parameter Amazon Resource Name (ARN), is 1011 characters. For example, the length of the following parameter + * name is 65 characters, not 20 characters: ``arn:aws:ssm:us-east-2:111222333444:parameter/ExampleParameterName`` + */ + private String name; + + /* + * Information about the policies assigned to a parameter. [Assigning parameter + * policies](https://docs.aws.amazon.com/systems-manager/latest/userguide/parameter-store-policies.html) in the + * *User Guide*. + */ + private String policies; + + /* + * Optional metadata that you assign to a resource in the form of an arbitrary set of tags (key-value pairs). Tags + * enable you to categorize a resource in different ways, such as by purpose, owner, or environment. For example, + * you might want to tag a SYS parameter to identify the type of resource to which it applies, the environment, or + * the type of configuration data referenced by the parameter. + */ + private Object tags; + + /* + * The parameter tier. + */ + private Tier tier; + + /* + * The type of parameter. + */ + private Type type; + + /* + * The parameter value. If type is ``StringList``, the system returns a comma-separated string with no spaces + * between commas in the ``Value`` field. + */ + private String value; + + /** + * Creates an instance of AwsSsmParameterProperties class. + */ + public AwsSsmParameterProperties() { + } + + /** + * Get the allowedPattern property: A regular expression used to validate the parameter value. For example, for + * ``String`` types with values restricted to numbers, you can specify the following: ``AllowedPattern=^\d+$``. + * + * @return the allowedPattern value. + */ + public String allowedPattern() { + return this.allowedPattern; + } + + /** + * Set the allowedPattern property: A regular expression used to validate the parameter value. For example, for + * ``String`` types with values restricted to numbers, you can specify the following: ``AllowedPattern=^\d+$``. + * + * @param allowedPattern the allowedPattern value to set. + * @return the AwsSsmParameterProperties object itself. + */ + public AwsSsmParameterProperties withAllowedPattern(String allowedPattern) { + this.allowedPattern = allowedPattern; + return this; + } + + /** + * Get the dataType property: The data type of the parameter, such as ``text`` or ``aws:ec2:image``. The default is + * ``text``. + * + * @return the dataType value. + */ + public DataType dataType() { + return this.dataType; + } + + /** + * Set the dataType property: The data type of the parameter, such as ``text`` or ``aws:ec2:image``. The default is + * ``text``. + * + * @param dataType the dataType value to set. + * @return the AwsSsmParameterProperties object itself. + */ + public AwsSsmParameterProperties withDataType(DataType dataType) { + this.dataType = dataType; + return this; + } + + /** + * Get the description property: Information about the parameter. + * + * @return the description value. + */ + public String description() { + return this.description; + } + + /** + * Set the description property: Information about the parameter. + * + * @param description the description value to set. + * @return the AwsSsmParameterProperties object itself. + */ + public AwsSsmParameterProperties withDescription(String description) { + this.description = description; + return this; + } + + /** + * Get the name property: The name of the parameter. The maximum length constraint listed below includes capacity + * for additional system attributes that aren't part of the name. The maximum length for a parameter name, including + * the full length of the parameter Amazon Resource Name (ARN), is 1011 characters. For example, the length of the + * following parameter name is 65 characters, not 20 characters: + * ``arn:aws:ssm:us-east-2:111222333444:parameter/ExampleParameterName``. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: The name of the parameter. The maximum length constraint listed below includes capacity + * for additional system attributes that aren't part of the name. The maximum length for a parameter name, including + * the full length of the parameter Amazon Resource Name (ARN), is 1011 characters. For example, the length of the + * following parameter name is 65 characters, not 20 characters: + * ``arn:aws:ssm:us-east-2:111222333444:parameter/ExampleParameterName``. + * + * @param name the name value to set. + * @return the AwsSsmParameterProperties object itself. + */ + public AwsSsmParameterProperties withName(String name) { + this.name = name; + return this; + } + + /** + * Get the policies property: Information about the policies assigned to a parameter. [Assigning parameter + * policies](https://docs.aws.amazon.com/systems-manager/latest/userguide/parameter-store-policies.html) in the + * *User Guide*. + * + * @return the policies value. + */ + public String policies() { + return this.policies; + } + + /** + * Set the policies property: Information about the policies assigned to a parameter. [Assigning parameter + * policies](https://docs.aws.amazon.com/systems-manager/latest/userguide/parameter-store-policies.html) in the + * *User Guide*. + * + * @param policies the policies value to set. + * @return the AwsSsmParameterProperties object itself. + */ + public AwsSsmParameterProperties withPolicies(String policies) { + this.policies = policies; + return this; + } + + /** + * Get the tags property: Optional metadata that you assign to a resource in the form of an arbitrary set of tags + * (key-value pairs). Tags enable you to categorize a resource in different ways, such as by purpose, owner, or + * environment. For example, you might want to tag a SYS parameter to identify the type of resource to which it + * applies, the environment, or the type of configuration data referenced by the parameter. + * + * @return the tags value. + */ + public Object tags() { + return this.tags; + } + + /** + * Set the tags property: Optional metadata that you assign to a resource in the form of an arbitrary set of tags + * (key-value pairs). Tags enable you to categorize a resource in different ways, such as by purpose, owner, or + * environment. For example, you might want to tag a SYS parameter to identify the type of resource to which it + * applies, the environment, or the type of configuration data referenced by the parameter. + * + * @param tags the tags value to set. + * @return the AwsSsmParameterProperties object itself. + */ + public AwsSsmParameterProperties withTags(Object tags) { + this.tags = tags; + return this; + } + + /** + * Get the tier property: The parameter tier. + * + * @return the tier value. + */ + public Tier tier() { + return this.tier; + } + + /** + * Set the tier property: The parameter tier. + * + * @param tier the tier value to set. + * @return the AwsSsmParameterProperties object itself. + */ + public AwsSsmParameterProperties withTier(Tier tier) { + this.tier = tier; + return this; + } + + /** + * Get the type property: The type of parameter. + * + * @return the type value. + */ + public Type type() { + return this.type; + } + + /** + * Set the type property: The type of parameter. + * + * @param type the type value to set. + * @return the AwsSsmParameterProperties object itself. + */ + public AwsSsmParameterProperties withType(Type type) { + this.type = type; + return this; + } + + /** + * Get the value property: The parameter value. If type is ``StringList``, the system returns a comma-separated + * string with no spaces between commas in the ``Value`` field. + * + * @return the value value. + */ + public String value() { + return this.value; + } + + /** + * Set the value property: The parameter value. If type is ``StringList``, the system returns a comma-separated + * string with no spaces between commas in the ``Value`` field. + * + * @param value the value value to set. + * @return the AwsSsmParameterProperties object itself. + */ + public AwsSsmParameterProperties withValue(String value) { + this.value = value; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("allowedPattern", this.allowedPattern); + jsonWriter.writeStringField("dataType", this.dataType == null ? null : this.dataType.toString()); + jsonWriter.writeStringField("description", this.description); + jsonWriter.writeStringField("name", this.name); + jsonWriter.writeStringField("policies", this.policies); + jsonWriter.writeUntypedField("tags", this.tags); + jsonWriter.writeStringField("tier", this.tier == null ? null : this.tier.toString()); + jsonWriter.writeStringField("type", this.type == null ? null : this.type.toString()); + jsonWriter.writeStringField("value", this.value); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AwsSsmParameterProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AwsSsmParameterProperties if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IOException If an error occurs while reading the AwsSsmParameterProperties. + */ + public static AwsSsmParameterProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AwsSsmParameterProperties deserializedAwsSsmParameterProperties = new AwsSsmParameterProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("allowedPattern".equals(fieldName)) { + deserializedAwsSsmParameterProperties.allowedPattern = reader.getString(); + } else if ("dataType".equals(fieldName)) { + deserializedAwsSsmParameterProperties.dataType = DataType.fromString(reader.getString()); + } else if ("description".equals(fieldName)) { + deserializedAwsSsmParameterProperties.description = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedAwsSsmParameterProperties.name = reader.getString(); + } else if ("policies".equals(fieldName)) { + deserializedAwsSsmParameterProperties.policies = reader.getString(); + } else if ("tags".equals(fieldName)) { + deserializedAwsSsmParameterProperties.tags = reader.readUntyped(); + } else if ("tier".equals(fieldName)) { + deserializedAwsSsmParameterProperties.tier = Tier.fromString(reader.getString()); + } else if ("type".equals(fieldName)) { + deserializedAwsSsmParameterProperties.type = Type.fromString(reader.getString()); + } else if ("value".equals(fieldName)) { + deserializedAwsSsmParameterProperties.value = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedAwsSsmParameterProperties; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/AwsSsmResourceComplianceSummaryItemProperties.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/AwsSsmResourceComplianceSummaryItemProperties.java new file mode 100644 index 000000000000..c0ac230e10cb --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/AwsSsmResourceComplianceSummaryItemProperties.java @@ -0,0 +1,316 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of awsSsmResourceComplianceSummaryItem. + */ +@Fluent +public final class AwsSsmResourceComplianceSummaryItemProperties + implements JsonSerializable { + /* + *

The compliance type.

+ */ + private String complianceType; + + /* + *

A list of items that are compliant for the resource.

+ */ + private CompliantSummary compliantSummary; + + /* + *

Information about the execution.

+ */ + private ComplianceExecutionSummary executionSummary; + + /* + *

A list of items that aren't compliant for the resource.

+ */ + private NonCompliantSummary nonCompliantSummary; + + /* + *

The highest severity item found for the resource. The resource is compliant for this item.

+ */ + private ComplianceSeverityEnumValue overallSeverity; + + /* + *

The resource ID.

+ */ + private String resourceId; + + /* + *

The resource type.

+ */ + private String resourceType; + + /* + *

The compliance status for the resource.

+ */ + private ComplianceStatusEnumValue status; + + /** + * Creates an instance of AwsSsmResourceComplianceSummaryItemProperties class. + */ + public AwsSsmResourceComplianceSummaryItemProperties() { + } + + /** + * Get the complianceType property: <p>The compliance type.</p>. + * + * @return the complianceType value. + */ + public String complianceType() { + return this.complianceType; + } + + /** + * Set the complianceType property: <p>The compliance type.</p>. + * + * @param complianceType the complianceType value to set. + * @return the AwsSsmResourceComplianceSummaryItemProperties object itself. + */ + public AwsSsmResourceComplianceSummaryItemProperties withComplianceType(String complianceType) { + this.complianceType = complianceType; + return this; + } + + /** + * Get the compliantSummary property: <p>A list of items that are compliant for the resource.</p>. + * + * @return the compliantSummary value. + */ + public CompliantSummary compliantSummary() { + return this.compliantSummary; + } + + /** + * Set the compliantSummary property: <p>A list of items that are compliant for the resource.</p>. + * + * @param compliantSummary the compliantSummary value to set. + * @return the AwsSsmResourceComplianceSummaryItemProperties object itself. + */ + public AwsSsmResourceComplianceSummaryItemProperties withCompliantSummary(CompliantSummary compliantSummary) { + this.compliantSummary = compliantSummary; + return this; + } + + /** + * Get the executionSummary property: <p>Information about the execution.</p>. + * + * @return the executionSummary value. + */ + public ComplianceExecutionSummary executionSummary() { + return this.executionSummary; + } + + /** + * Set the executionSummary property: <p>Information about the execution.</p>. + * + * @param executionSummary the executionSummary value to set. + * @return the AwsSsmResourceComplianceSummaryItemProperties object itself. + */ + public AwsSsmResourceComplianceSummaryItemProperties + withExecutionSummary(ComplianceExecutionSummary executionSummary) { + this.executionSummary = executionSummary; + return this; + } + + /** + * Get the nonCompliantSummary property: <p>A list of items that aren't compliant for the resource.</p>. + * + * @return the nonCompliantSummary value. + */ + public NonCompliantSummary nonCompliantSummary() { + return this.nonCompliantSummary; + } + + /** + * Set the nonCompliantSummary property: <p>A list of items that aren't compliant for the resource.</p>. + * + * @param nonCompliantSummary the nonCompliantSummary value to set. + * @return the AwsSsmResourceComplianceSummaryItemProperties object itself. + */ + public AwsSsmResourceComplianceSummaryItemProperties + withNonCompliantSummary(NonCompliantSummary nonCompliantSummary) { + this.nonCompliantSummary = nonCompliantSummary; + return this; + } + + /** + * Get the overallSeverity property: <p>The highest severity item found for the resource. The resource is + * compliant for this item.</p>. + * + * @return the overallSeverity value. + */ + public ComplianceSeverityEnumValue overallSeverity() { + return this.overallSeverity; + } + + /** + * Set the overallSeverity property: <p>The highest severity item found for the resource. The resource is + * compliant for this item.</p>. + * + * @param overallSeverity the overallSeverity value to set. + * @return the AwsSsmResourceComplianceSummaryItemProperties object itself. + */ + public AwsSsmResourceComplianceSummaryItemProperties + withOverallSeverity(ComplianceSeverityEnumValue overallSeverity) { + this.overallSeverity = overallSeverity; + return this; + } + + /** + * Get the resourceId property: <p>The resource ID.</p>. + * + * @return the resourceId value. + */ + public String resourceId() { + return this.resourceId; + } + + /** + * Set the resourceId property: <p>The resource ID.</p>. + * + * @param resourceId the resourceId value to set. + * @return the AwsSsmResourceComplianceSummaryItemProperties object itself. + */ + public AwsSsmResourceComplianceSummaryItemProperties withResourceId(String resourceId) { + this.resourceId = resourceId; + return this; + } + + /** + * Get the resourceType property: <p>The resource type.</p>. + * + * @return the resourceType value. + */ + public String resourceType() { + return this.resourceType; + } + + /** + * Set the resourceType property: <p>The resource type.</p>. + * + * @param resourceType the resourceType value to set. + * @return the AwsSsmResourceComplianceSummaryItemProperties object itself. + */ + public AwsSsmResourceComplianceSummaryItemProperties withResourceType(String resourceType) { + this.resourceType = resourceType; + return this; + } + + /** + * Get the status property: <p>The compliance status for the resource.</p>. + * + * @return the status value. + */ + public ComplianceStatusEnumValue status() { + return this.status; + } + + /** + * Set the status property: <p>The compliance status for the resource.</p>. + * + * @param status the status value to set. + * @return the AwsSsmResourceComplianceSummaryItemProperties object itself. + */ + public AwsSsmResourceComplianceSummaryItemProperties withStatus(ComplianceStatusEnumValue status) { + this.status = status; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (compliantSummary() != null) { + compliantSummary().validate(); + } + if (executionSummary() != null) { + executionSummary().validate(); + } + if (nonCompliantSummary() != null) { + nonCompliantSummary().validate(); + } + if (overallSeverity() != null) { + overallSeverity().validate(); + } + if (status() != null) { + status().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("complianceType", this.complianceType); + jsonWriter.writeJsonField("compliantSummary", this.compliantSummary); + jsonWriter.writeJsonField("executionSummary", this.executionSummary); + jsonWriter.writeJsonField("nonCompliantSummary", this.nonCompliantSummary); + jsonWriter.writeJsonField("overallSeverity", this.overallSeverity); + jsonWriter.writeStringField("resourceId", this.resourceId); + jsonWriter.writeStringField("resourceType", this.resourceType); + jsonWriter.writeJsonField("status", this.status); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AwsSsmResourceComplianceSummaryItemProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AwsSsmResourceComplianceSummaryItemProperties if the JsonReader was pointing to an + * instance of it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the AwsSsmResourceComplianceSummaryItemProperties. + */ + public static AwsSsmResourceComplianceSummaryItemProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AwsSsmResourceComplianceSummaryItemProperties deserializedAwsSsmResourceComplianceSummaryItemProperties + = new AwsSsmResourceComplianceSummaryItemProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("complianceType".equals(fieldName)) { + deserializedAwsSsmResourceComplianceSummaryItemProperties.complianceType = reader.getString(); + } else if ("compliantSummary".equals(fieldName)) { + deserializedAwsSsmResourceComplianceSummaryItemProperties.compliantSummary + = CompliantSummary.fromJson(reader); + } else if ("executionSummary".equals(fieldName)) { + deserializedAwsSsmResourceComplianceSummaryItemProperties.executionSummary + = ComplianceExecutionSummary.fromJson(reader); + } else if ("nonCompliantSummary".equals(fieldName)) { + deserializedAwsSsmResourceComplianceSummaryItemProperties.nonCompliantSummary + = NonCompliantSummary.fromJson(reader); + } else if ("overallSeverity".equals(fieldName)) { + deserializedAwsSsmResourceComplianceSummaryItemProperties.overallSeverity + = ComplianceSeverityEnumValue.fromJson(reader); + } else if ("resourceId".equals(fieldName)) { + deserializedAwsSsmResourceComplianceSummaryItemProperties.resourceId = reader.getString(); + } else if ("resourceType".equals(fieldName)) { + deserializedAwsSsmResourceComplianceSummaryItemProperties.resourceType = reader.getString(); + } else if ("status".equals(fieldName)) { + deserializedAwsSsmResourceComplianceSummaryItemProperties.status + = ComplianceStatusEnumValue.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedAwsSsmResourceComplianceSummaryItemProperties; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/AwsVpcConfiguration.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/AwsVpcConfiguration.java new file mode 100644 index 000000000000..ca2bbfd3a531 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/AwsVpcConfiguration.java @@ -0,0 +1,166 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Definition of AwsVpcConfiguration. + */ +@Fluent +public final class AwsVpcConfiguration implements JsonSerializable { + /* + * Whether the task's elastic network interface receives a public IP address. The default value is ``DISABLED``. + */ + private AwsVpcConfigurationAssignPublicIp assignPublicIp; + + /* + * The IDs of the security groups associated with the task or service. If you don't specify a security group, the + * default security group for the VPC is used. There's a limit of 5 security groups that can be specified per + * ``AwsVpcConfiguration``. All specified security groups must be from the same VPC. + */ + private List securityGroups; + + /* + * The IDs of the subnets associated with the task or service. There's a limit of 16 subnets that can be specified + * per ``AwsVpcConfiguration``. All specified subnets must be from the same VPC. + */ + private List subnets; + + /** + * Creates an instance of AwsVpcConfiguration class. + */ + public AwsVpcConfiguration() { + } + + /** + * Get the assignPublicIp property: Whether the task's elastic network interface receives a public IP address. The + * default value is ``DISABLED``. + * + * @return the assignPublicIp value. + */ + public AwsVpcConfigurationAssignPublicIp assignPublicIp() { + return this.assignPublicIp; + } + + /** + * Set the assignPublicIp property: Whether the task's elastic network interface receives a public IP address. The + * default value is ``DISABLED``. + * + * @param assignPublicIp the assignPublicIp value to set. + * @return the AwsVpcConfiguration object itself. + */ + public AwsVpcConfiguration withAssignPublicIp(AwsVpcConfigurationAssignPublicIp assignPublicIp) { + this.assignPublicIp = assignPublicIp; + return this; + } + + /** + * Get the securityGroups property: The IDs of the security groups associated with the task or service. If you don't + * specify a security group, the default security group for the VPC is used. There's a limit of 5 security groups + * that can be specified per ``AwsVpcConfiguration``. All specified security groups must be from the same VPC. + * + * @return the securityGroups value. + */ + public List securityGroups() { + return this.securityGroups; + } + + /** + * Set the securityGroups property: The IDs of the security groups associated with the task or service. If you don't + * specify a security group, the default security group for the VPC is used. There's a limit of 5 security groups + * that can be specified per ``AwsVpcConfiguration``. All specified security groups must be from the same VPC. + * + * @param securityGroups the securityGroups value to set. + * @return the AwsVpcConfiguration object itself. + */ + public AwsVpcConfiguration withSecurityGroups(List securityGroups) { + this.securityGroups = securityGroups; + return this; + } + + /** + * Get the subnets property: The IDs of the subnets associated with the task or service. There's a limit of 16 + * subnets that can be specified per ``AwsVpcConfiguration``. All specified subnets must be from the same VPC. + * + * @return the subnets value. + */ + public List subnets() { + return this.subnets; + } + + /** + * Set the subnets property: The IDs of the subnets associated with the task or service. There's a limit of 16 + * subnets that can be specified per ``AwsVpcConfiguration``. All specified subnets must be from the same VPC. + * + * @param subnets the subnets value to set. + * @return the AwsVpcConfiguration object itself. + */ + public AwsVpcConfiguration withSubnets(List subnets) { + this.subnets = subnets; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("assignPublicIp", + this.assignPublicIp == null ? null : this.assignPublicIp.toString()); + jsonWriter.writeArrayField("securityGroups", this.securityGroups, + (writer, element) -> writer.writeString(element)); + jsonWriter.writeArrayField("subnets", this.subnets, (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AwsVpcConfiguration from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AwsVpcConfiguration if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the AwsVpcConfiguration. + */ + public static AwsVpcConfiguration fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AwsVpcConfiguration deserializedAwsVpcConfiguration = new AwsVpcConfiguration(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("assignPublicIp".equals(fieldName)) { + deserializedAwsVpcConfiguration.assignPublicIp + = AwsVpcConfigurationAssignPublicIp.fromString(reader.getString()); + } else if ("securityGroups".equals(fieldName)) { + List securityGroups = reader.readArray(reader1 -> reader1.getString()); + deserializedAwsVpcConfiguration.securityGroups = securityGroups; + } else if ("subnets".equals(fieldName)) { + List subnets = reader.readArray(reader1 -> reader1.getString()); + deserializedAwsVpcConfiguration.subnets = subnets; + } else { + reader.skipChildren(); + } + } + + return deserializedAwsVpcConfiguration; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/AwsVpcConfigurationAssignPublicIp.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/AwsVpcConfigurationAssignPublicIp.java new file mode 100644 index 000000000000..cd2f878242c2 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/AwsVpcConfigurationAssignPublicIp.java @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * AwsVpcConfigurationAssignPublicIp enum. + */ +public final class AwsVpcConfigurationAssignPublicIp extends ExpandableStringEnum { + /** + * Static value DISABLED for AwsVpcConfigurationAssignPublicIp. + */ + public static final AwsVpcConfigurationAssignPublicIp DISABLED = fromString("DISABLED"); + + /** + * Static value ENABLED for AwsVpcConfigurationAssignPublicIp. + */ + public static final AwsVpcConfigurationAssignPublicIp ENABLED = fromString("ENABLED"); + + /** + * Creates a new instance of AwsVpcConfigurationAssignPublicIp value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public AwsVpcConfigurationAssignPublicIp() { + } + + /** + * Creates or finds a AwsVpcConfigurationAssignPublicIp from its string representation. + * + * @param name a name to look for. + * @return the corresponding AwsVpcConfigurationAssignPublicIp. + */ + public static AwsVpcConfigurationAssignPublicIp fromString(String name) { + return fromString(name, AwsVpcConfigurationAssignPublicIp.class); + } + + /** + * Gets known AwsVpcConfigurationAssignPublicIp values. + * + * @return known AwsVpcConfigurationAssignPublicIp values. + */ + public static Collection values() { + return values(AwsVpcConfigurationAssignPublicIp.class); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/AwsWafWebAclSummaryProperties.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/AwsWafWebAclSummaryProperties.java new file mode 100644 index 000000000000..160f56726e23 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/AwsWafWebAclSummaryProperties.java @@ -0,0 +1,138 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of awsWafWebACLSummary. + */ +@Fluent +public final class AwsWafWebAclSummaryProperties implements JsonSerializable { + /* + *

A friendly name or description of the WebACL. You can't change the name of a WebACL after + * you create it.

+ */ + private String name; + + /* + *

A unique identifier for a WebACL. You use WebACLId to get information about a + * WebACL (see GetWebACL), update a WebACL (see UpdateWebACL), and delete a + * WebACL from AWS WAF (see DeleteWebACL).

WebACLId is returned by + * CreateWebACL and by ListWebACLs.

+ */ + private String webAclId; + + /** + * Creates an instance of AwsWafWebAclSummaryProperties class. + */ + public AwsWafWebAclSummaryProperties() { + } + + /** + * Get the name property: <p>A friendly name or description of the <a>WebACL</a>. You can't change + * the name of a <code>WebACL</code> after you create it.</p>. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: <p>A friendly name or description of the <a>WebACL</a>. You can't change + * the name of a <code>WebACL</code> after you create it.</p>. + * + * @param name the name value to set. + * @return the AwsWafWebAclSummaryProperties object itself. + */ + public AwsWafWebAclSummaryProperties withName(String name) { + this.name = name; + return this; + } + + /** + * Get the webAclId property: <p>A unique identifier for a <code>WebACL</code>. You use + * <code>WebACLId</code> to get information about a <code>WebACL</code> (see + * <a>GetWebACL</a>), update a <code>WebACL</code> (see <a>UpdateWebACL</a>), + * and delete a <code>WebACL</code> from AWS WAF (see <a>DeleteWebACL</a>).</p> + * <p> <code>WebACLId</code> is returned by <a>CreateWebACL</a> and by + * <a>ListWebACLs</a>.</p>. + * + * @return the webAclId value. + */ + public String webAclId() { + return this.webAclId; + } + + /** + * Set the webAclId property: <p>A unique identifier for a <code>WebACL</code>. You use + * <code>WebACLId</code> to get information about a <code>WebACL</code> (see + * <a>GetWebACL</a>), update a <code>WebACL</code> (see <a>UpdateWebACL</a>), + * and delete a <code>WebACL</code> from AWS WAF (see <a>DeleteWebACL</a>).</p> + * <p> <code>WebACLId</code> is returned by <a>CreateWebACL</a> and by + * <a>ListWebACLs</a>.</p>. + * + * @param webAclId the webAclId value to set. + * @return the AwsWafWebAclSummaryProperties object itself. + */ + public AwsWafWebAclSummaryProperties withWebAclId(String webAclId) { + this.webAclId = webAclId; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("name", this.name); + jsonWriter.writeStringField("webACLId", this.webAclId); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AwsWafWebAclSummaryProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AwsWafWebAclSummaryProperties if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the AwsWafWebAclSummaryProperties. + */ + public static AwsWafWebAclSummaryProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AwsWafWebAclSummaryProperties deserializedAwsWafWebAclSummaryProperties + = new AwsWafWebAclSummaryProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("name".equals(fieldName)) { + deserializedAwsWafWebAclSummaryProperties.name = reader.getString(); + } else if ("webACLId".equals(fieldName)) { + deserializedAwsWafWebAclSummaryProperties.webAclId = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedAwsWafWebAclSummaryProperties; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/AwsWafv2LoggingConfigurationProperties.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/AwsWafv2LoggingConfigurationProperties.java new file mode 100644 index 000000000000..0d34e76d9818 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/AwsWafv2LoggingConfigurationProperties.java @@ -0,0 +1,237 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Definition of awsWafv2LoggingConfiguration. + */ +@Fluent +public final class AwsWafv2LoggingConfigurationProperties + implements JsonSerializable { + /* + * The Amazon Resource Names (ARNs) of the logging destinations that you want to associate with the web ACL. + */ + private List logDestinationConfigs; + + /* + * Filtering that specifies which web requests are kept in the logs and which are dropped. You can filter on the + * rule action and on the web request labels that were applied by matching rules during web ACL evaluation. + */ + private LoggingFilterModelProperties loggingFilter; + + /* + * Indicates whether the logging configuration was created by AWS Firewall Manager, as part of an AWS WAF policy + * configuration. If true, only Firewall Manager can modify or delete the configuration. + */ + private Boolean managedByFirewallManager; + + /* + * The parts of the request that you want to keep out of the logs. For example, if you redact the HEADER field, the + * HEADER field in the firehose will be xxx. + */ + private List redactedFields; + + /* + * The Amazon Resource Name (ARN) of the web ACL that you want to associate with LogDestinationConfigs. + */ + private String resourceArn; + + /** + * Creates an instance of AwsWafv2LoggingConfigurationProperties class. + */ + public AwsWafv2LoggingConfigurationProperties() { + } + + /** + * Get the logDestinationConfigs property: The Amazon Resource Names (ARNs) of the logging destinations that you + * want to associate with the web ACL. + * + * @return the logDestinationConfigs value. + */ + public List logDestinationConfigs() { + return this.logDestinationConfigs; + } + + /** + * Set the logDestinationConfigs property: The Amazon Resource Names (ARNs) of the logging destinations that you + * want to associate with the web ACL. + * + * @param logDestinationConfigs the logDestinationConfigs value to set. + * @return the AwsWafv2LoggingConfigurationProperties object itself. + */ + public AwsWafv2LoggingConfigurationProperties withLogDestinationConfigs(List logDestinationConfigs) { + this.logDestinationConfigs = logDestinationConfigs; + return this; + } + + /** + * Get the loggingFilter property: Filtering that specifies which web requests are kept in the logs and which are + * dropped. You can filter on the rule action and on the web request labels that were applied by matching rules + * during web ACL evaluation. + * + * @return the loggingFilter value. + */ + public LoggingFilterModelProperties loggingFilter() { + return this.loggingFilter; + } + + /** + * Set the loggingFilter property: Filtering that specifies which web requests are kept in the logs and which are + * dropped. You can filter on the rule action and on the web request labels that were applied by matching rules + * during web ACL evaluation. + * + * @param loggingFilter the loggingFilter value to set. + * @return the AwsWafv2LoggingConfigurationProperties object itself. + */ + public AwsWafv2LoggingConfigurationProperties withLoggingFilter(LoggingFilterModelProperties loggingFilter) { + this.loggingFilter = loggingFilter; + return this; + } + + /** + * Get the managedByFirewallManager property: Indicates whether the logging configuration was created by AWS + * Firewall Manager, as part of an AWS WAF policy configuration. If true, only Firewall Manager can modify or delete + * the configuration. + * + * @return the managedByFirewallManager value. + */ + public Boolean managedByFirewallManager() { + return this.managedByFirewallManager; + } + + /** + * Set the managedByFirewallManager property: Indicates whether the logging configuration was created by AWS + * Firewall Manager, as part of an AWS WAF policy configuration. If true, only Firewall Manager can modify or delete + * the configuration. + * + * @param managedByFirewallManager the managedByFirewallManager value to set. + * @return the AwsWafv2LoggingConfigurationProperties object itself. + */ + public AwsWafv2LoggingConfigurationProperties withManagedByFirewallManager(Boolean managedByFirewallManager) { + this.managedByFirewallManager = managedByFirewallManager; + return this; + } + + /** + * Get the redactedFields property: The parts of the request that you want to keep out of the logs. For example, if + * you redact the HEADER field, the HEADER field in the firehose will be xxx. + * + * @return the redactedFields value. + */ + public List redactedFields() { + return this.redactedFields; + } + + /** + * Set the redactedFields property: The parts of the request that you want to keep out of the logs. For example, if + * you redact the HEADER field, the HEADER field in the firehose will be xxx. + * + * @param redactedFields the redactedFields value to set. + * @return the AwsWafv2LoggingConfigurationProperties object itself. + */ + public AwsWafv2LoggingConfigurationProperties withRedactedFields(List redactedFields) { + this.redactedFields = redactedFields; + return this; + } + + /** + * Get the resourceArn property: The Amazon Resource Name (ARN) of the web ACL that you want to associate with + * LogDestinationConfigs. + * + * @return the resourceArn value. + */ + public String resourceArn() { + return this.resourceArn; + } + + /** + * Set the resourceArn property: The Amazon Resource Name (ARN) of the web ACL that you want to associate with + * LogDestinationConfigs. + * + * @param resourceArn the resourceArn value to set. + * @return the AwsWafv2LoggingConfigurationProperties object itself. + */ + public AwsWafv2LoggingConfigurationProperties withResourceArn(String resourceArn) { + this.resourceArn = resourceArn; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (loggingFilter() != null) { + loggingFilter().validate(); + } + if (redactedFields() != null) { + redactedFields().forEach(e -> e.validate()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("logDestinationConfigs", this.logDestinationConfigs, + (writer, element) -> writer.writeString(element)); + jsonWriter.writeJsonField("loggingFilter", this.loggingFilter); + jsonWriter.writeBooleanField("managedByFirewallManager", this.managedByFirewallManager); + jsonWriter.writeArrayField("redactedFields", this.redactedFields, + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("resourceArn", this.resourceArn); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AwsWafv2LoggingConfigurationProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AwsWafv2LoggingConfigurationProperties if the JsonReader was pointing to an instance of + * it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the AwsWafv2LoggingConfigurationProperties. + */ + public static AwsWafv2LoggingConfigurationProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AwsWafv2LoggingConfigurationProperties deserializedAwsWafv2LoggingConfigurationProperties + = new AwsWafv2LoggingConfigurationProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("logDestinationConfigs".equals(fieldName)) { + List logDestinationConfigs = reader.readArray(reader1 -> reader1.getString()); + deserializedAwsWafv2LoggingConfigurationProperties.logDestinationConfigs = logDestinationConfigs; + } else if ("loggingFilter".equals(fieldName)) { + deserializedAwsWafv2LoggingConfigurationProperties.loggingFilter + = LoggingFilterModelProperties.fromJson(reader); + } else if ("managedByFirewallManager".equals(fieldName)) { + deserializedAwsWafv2LoggingConfigurationProperties.managedByFirewallManager + = reader.getNullable(JsonReader::getBoolean); + } else if ("redactedFields".equals(fieldName)) { + List redactedFields = reader.readArray(reader1 -> FieldToMatch.fromJson(reader1)); + deserializedAwsWafv2LoggingConfigurationProperties.redactedFields = redactedFields; + } else if ("resourceArn".equals(fieldName)) { + deserializedAwsWafv2LoggingConfigurationProperties.resourceArn = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedAwsWafv2LoggingConfigurationProperties; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/BackupPolicy.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/BackupPolicy.java new file mode 100644 index 000000000000..ee5fb1974062 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/BackupPolicy.java @@ -0,0 +1,96 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of BackupPolicy. + */ +@Fluent +public final class BackupPolicy implements JsonSerializable { + /* + * Set the backup policy status for the file system. + *ENABLED* - Turns automatic backups on for the file system. + + * *DISABLED* - Turns automatic backups off for the file system. + */ + private BackupPolicyStatus status; + + /** + * Creates an instance of BackupPolicy class. + */ + public BackupPolicy() { + } + + /** + * Get the status property: Set the backup policy status for the file system. + *ENABLED* - Turns automatic backups + * on for the file system. + *DISABLED* - Turns automatic backups off for the file system. + * + * @return the status value. + */ + public BackupPolicyStatus status() { + return this.status; + } + + /** + * Set the status property: Set the backup policy status for the file system. + *ENABLED* - Turns automatic backups + * on for the file system. + *DISABLED* - Turns automatic backups off for the file system. + * + * @param status the status value to set. + * @return the BackupPolicy object itself. + */ + public BackupPolicy withStatus(BackupPolicyStatus status) { + this.status = status; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("status", this.status == null ? null : this.status.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of BackupPolicy from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of BackupPolicy if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the BackupPolicy. + */ + public static BackupPolicy fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + BackupPolicy deserializedBackupPolicy = new BackupPolicy(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("status".equals(fieldName)) { + deserializedBackupPolicy.status = BackupPolicyStatus.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedBackupPolicy; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/BackupPolicyStatus.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/BackupPolicyStatus.java new file mode 100644 index 000000000000..3bfafdcd6aa4 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/BackupPolicyStatus.java @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * BackupPolicyStatus enum. + */ +public final class BackupPolicyStatus extends ExpandableStringEnum { + /** + * Static value DISABLED for BackupPolicyStatus. + */ + public static final BackupPolicyStatus DISABLED = fromString("DISABLED"); + + /** + * Static value ENABLED for BackupPolicyStatus. + */ + public static final BackupPolicyStatus ENABLED = fromString("ENABLED"); + + /** + * Creates a new instance of BackupPolicyStatus value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public BackupPolicyStatus() { + } + + /** + * Creates or finds a BackupPolicyStatus from its string representation. + * + * @param name a name to look for. + * @return the corresponding BackupPolicyStatus. + */ + public static BackupPolicyStatus fromString(String name) { + return fromString(name, BackupPolicyStatus.class); + } + + /** + * Gets known BackupPolicyStatus values. + * + * @return known BackupPolicyStatus values. + */ + public static Collection values() { + return values(BackupPolicyStatus.class); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/BaselineEbsBandwidthMbpsRequest.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/BaselineEbsBandwidthMbpsRequest.java new file mode 100644 index 000000000000..fb79adc0de5b --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/BaselineEbsBandwidthMbpsRequest.java @@ -0,0 +1,122 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of BaselineEbsBandwidthMbpsRequest. + */ +@Fluent +public final class BaselineEbsBandwidthMbpsRequest implements JsonSerializable { + /* + * The maximum value in Mbps. + */ + private Integer max; + + /* + * The minimum value in Mbps. + */ + private Integer min; + + /** + * Creates an instance of BaselineEbsBandwidthMbpsRequest class. + */ + public BaselineEbsBandwidthMbpsRequest() { + } + + /** + * Get the max property: The maximum value in Mbps. + * + * @return the max value. + */ + public Integer max() { + return this.max; + } + + /** + * Set the max property: The maximum value in Mbps. + * + * @param max the max value to set. + * @return the BaselineEbsBandwidthMbpsRequest object itself. + */ + public BaselineEbsBandwidthMbpsRequest withMax(Integer max) { + this.max = max; + return this; + } + + /** + * Get the min property: The minimum value in Mbps. + * + * @return the min value. + */ + public Integer min() { + return this.min; + } + + /** + * Set the min property: The minimum value in Mbps. + * + * @param min the min value to set. + * @return the BaselineEbsBandwidthMbpsRequest object itself. + */ + public BaselineEbsBandwidthMbpsRequest withMin(Integer min) { + this.min = min; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeNumberField("max", this.max); + jsonWriter.writeNumberField("min", this.min); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of BaselineEbsBandwidthMbpsRequest from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of BaselineEbsBandwidthMbpsRequest if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the BaselineEbsBandwidthMbpsRequest. + */ + public static BaselineEbsBandwidthMbpsRequest fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + BaselineEbsBandwidthMbpsRequest deserializedBaselineEbsBandwidthMbpsRequest + = new BaselineEbsBandwidthMbpsRequest(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("max".equals(fieldName)) { + deserializedBaselineEbsBandwidthMbpsRequest.max = reader.getNullable(JsonReader::getInt); + } else if ("min".equals(fieldName)) { + deserializedBaselineEbsBandwidthMbpsRequest.min = reader.getNullable(JsonReader::getInt); + } else { + reader.skipChildren(); + } + } + + return deserializedBaselineEbsBandwidthMbpsRequest; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/BatchReportModeType.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/BatchReportModeType.java new file mode 100644 index 000000000000..ab0fa24a279b --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/BatchReportModeType.java @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * BatchReportModeType enum. + */ +public final class BatchReportModeType extends ExpandableStringEnum { + /** + * Static value REPORT_AGGREGATED_BATCH for BatchReportModeType. + */ + public static final BatchReportModeType REPORT_AGGREGATED_BATCH = fromString("REPORT_AGGREGATED_BATCH"); + + /** + * Static value REPORT_INDIVIDUAL_BUILDS for BatchReportModeType. + */ + public static final BatchReportModeType REPORT_INDIVIDUAL_BUILDS = fromString("REPORT_INDIVIDUAL_BUILDS"); + + /** + * Creates a new instance of BatchReportModeType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public BatchReportModeType() { + } + + /** + * Creates or finds a BatchReportModeType from its string representation. + * + * @param name a name to look for. + * @return the corresponding BatchReportModeType. + */ + public static BatchReportModeType fromString(String name) { + return fromString(name, BatchReportModeType.class); + } + + /** + * Gets known BatchReportModeType values. + * + * @return known BatchReportModeType values. + */ + public static Collection values() { + return values(BatchReportModeType.class); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/BatchReportModeTypeEnumValue.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/BatchReportModeTypeEnumValue.java new file mode 100644 index 000000000000..b523ae41da3c --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/BatchReportModeTypeEnumValue.java @@ -0,0 +1,93 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of BatchReportModeTypeEnumValue. + */ +@Fluent +public final class BatchReportModeTypeEnumValue implements JsonSerializable { + /* + * Property value + */ + private BatchReportModeType value; + + /** + * Creates an instance of BatchReportModeTypeEnumValue class. + */ + public BatchReportModeTypeEnumValue() { + } + + /** + * Get the value property: Property value. + * + * @return the value value. + */ + public BatchReportModeType value() { + return this.value; + } + + /** + * Set the value property: Property value. + * + * @param value the value value to set. + * @return the BatchReportModeTypeEnumValue object itself. + */ + public BatchReportModeTypeEnumValue withValue(BatchReportModeType value) { + this.value = value; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("value", this.value == null ? null : this.value.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of BatchReportModeTypeEnumValue from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of BatchReportModeTypeEnumValue if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the BatchReportModeTypeEnumValue. + */ + public static BatchReportModeTypeEnumValue fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + BatchReportModeTypeEnumValue deserializedBatchReportModeTypeEnumValue = new BatchReportModeTypeEnumValue(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + deserializedBatchReportModeTypeEnumValue.value = BatchReportModeType.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedBatchReportModeTypeEnumValue; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/BatchRestrictions.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/BatchRestrictions.java new file mode 100644 index 000000000000..fbea681cda73 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/BatchRestrictions.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.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Definition of BatchRestrictions. + */ +@Fluent +public final class BatchRestrictions implements JsonSerializable { + /* + *

An array of strings that specify the compute types that are allowed for the batch build. See Build environment + * compute types in the CodeBuild User Guide for these values.

+ */ + private List computeTypesAllowed; + + /* + *

Specifies the maximum number of builds allowed.

+ */ + private Integer maximumBuildsAllowed; + + /** + * Creates an instance of BatchRestrictions class. + */ + public BatchRestrictions() { + } + + /** + * Get the computeTypesAllowed property: <p>An array of strings that specify the compute types that are + * allowed for the batch build. See <a + * href='https://docs.aws.amazon.com/codebuild/latest/userguide/build-env-ref-compute-types.html'>Build + * environment compute types</a> in the <i>CodeBuild User Guide</i> for these values. </p>. + * + * @return the computeTypesAllowed value. + */ + public List computeTypesAllowed() { + return this.computeTypesAllowed; + } + + /** + * Set the computeTypesAllowed property: <p>An array of strings that specify the compute types that are + * allowed for the batch build. See <a + * href='https://docs.aws.amazon.com/codebuild/latest/userguide/build-env-ref-compute-types.html'>Build + * environment compute types</a> in the <i>CodeBuild User Guide</i> for these values. </p>. + * + * @param computeTypesAllowed the computeTypesAllowed value to set. + * @return the BatchRestrictions object itself. + */ + public BatchRestrictions withComputeTypesAllowed(List computeTypesAllowed) { + this.computeTypesAllowed = computeTypesAllowed; + return this; + } + + /** + * Get the maximumBuildsAllowed property: <p>Specifies the maximum number of builds allowed.</p>. + * + * @return the maximumBuildsAllowed value. + */ + public Integer maximumBuildsAllowed() { + return this.maximumBuildsAllowed; + } + + /** + * Set the maximumBuildsAllowed property: <p>Specifies the maximum number of builds allowed.</p>. + * + * @param maximumBuildsAllowed the maximumBuildsAllowed value to set. + * @return the BatchRestrictions object itself. + */ + public BatchRestrictions withMaximumBuildsAllowed(Integer maximumBuildsAllowed) { + this.maximumBuildsAllowed = maximumBuildsAllowed; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("computeTypesAllowed", this.computeTypesAllowed, + (writer, element) -> writer.writeString(element)); + jsonWriter.writeNumberField("maximumBuildsAllowed", this.maximumBuildsAllowed); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of BatchRestrictions from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of BatchRestrictions if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the BatchRestrictions. + */ + public static BatchRestrictions fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + BatchRestrictions deserializedBatchRestrictions = new BatchRestrictions(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("computeTypesAllowed".equals(fieldName)) { + List computeTypesAllowed = reader.readArray(reader1 -> reader1.getString()); + deserializedBatchRestrictions.computeTypesAllowed = computeTypesAllowed; + } else if ("maximumBuildsAllowed".equals(fieldName)) { + deserializedBatchRestrictions.maximumBuildsAllowed = reader.getNullable(JsonReader::getInt); + } else { + reader.skipChildren(); + } + } + + return deserializedBatchRestrictions; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/BlockDeviceMapping.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/BlockDeviceMapping.java new file mode 100644 index 000000000000..6af3382dd5e0 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/BlockDeviceMapping.java @@ -0,0 +1,210 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of BlockDeviceMapping. + */ +@Fluent +public final class BlockDeviceMapping implements JsonSerializable { + /* + *

The device name (for example, /dev/sdh or xvdh).

+ */ + private String deviceName; + + /* + *

Parameters used to automatically set up EBS volumes when the instance is launched.

+ */ + private EbsBlockDevice ebs; + + /* + *

To omit the device from the block device mapping, specify an empty string. When this property is specified, + * the device is removed from the block device mapping regardless of the assigned value.

+ */ + private String noDevice; + + /* + *

The virtual device name (ephemeralN). Instance store volumes are numbered starting from 0. An + * instance type with 2 available instance store volumes can specify mappings for ephemeral0 and + * ephemeral1. The number of available instance store volumes depends on the instance type. After you + * connect to the instance, you must mount the volume.

NVMe instance store volumes are automatically + * enumerated and assigned a device name. Including them in your block device mapping has no effect.

+ *

Constraints: For M3 instances, you must specify instance store volumes in the block device mapping for the + * instance. When you launch an M3 instance, we ignore any instance store volumes specified in the block device + * mapping for the AMI.

+ */ + private String virtualName; + + /** + * Creates an instance of BlockDeviceMapping class. + */ + public BlockDeviceMapping() { + } + + /** + * Get the deviceName property: <p>The device name (for example, <code>/dev/sdh</code> or + * <code>xvdh</code>).</p>. + * + * @return the deviceName value. + */ + public String deviceName() { + return this.deviceName; + } + + /** + * Set the deviceName property: <p>The device name (for example, <code>/dev/sdh</code> or + * <code>xvdh</code>).</p>. + * + * @param deviceName the deviceName value to set. + * @return the BlockDeviceMapping object itself. + */ + public BlockDeviceMapping withDeviceName(String deviceName) { + this.deviceName = deviceName; + return this; + } + + /** + * Get the ebs property: <p>Parameters used to automatically set up EBS volumes when the instance is + * launched.</p>. + * + * @return the ebs value. + */ + public EbsBlockDevice ebs() { + return this.ebs; + } + + /** + * Set the ebs property: <p>Parameters used to automatically set up EBS volumes when the instance is + * launched.</p>. + * + * @param ebs the ebs value to set. + * @return the BlockDeviceMapping object itself. + */ + public BlockDeviceMapping withEbs(EbsBlockDevice ebs) { + this.ebs = ebs; + return this; + } + + /** + * Get the noDevice property: <p>To omit the device from the block device mapping, specify an empty string. + * When this property is specified, the device is removed from the block device mapping regardless of the assigned + * value.</p>. + * + * @return the noDevice value. + */ + public String noDevice() { + return this.noDevice; + } + + /** + * Set the noDevice property: <p>To omit the device from the block device mapping, specify an empty string. + * When this property is specified, the device is removed from the block device mapping regardless of the assigned + * value.</p>. + * + * @param noDevice the noDevice value to set. + * @return the BlockDeviceMapping object itself. + */ + public BlockDeviceMapping withNoDevice(String noDevice) { + this.noDevice = noDevice; + return this; + } + + /** + * Get the virtualName property: <p>The virtual device name (<code>ephemeral</code>N). Instance + * store volumes are numbered starting from 0. An instance type with 2 available instance store volumes can specify + * mappings for <code>ephemeral0</code> and <code>ephemeral1</code>. The number of available + * instance store volumes depends on the instance type. After you connect to the instance, you must mount the + * volume.</p> <p>NVMe instance store volumes are automatically enumerated and assigned a device name. + * Including them in your block device mapping has no effect.</p> <p>Constraints: For M3 instances, you + * must specify instance store volumes in the block device mapping for the instance. When you launch an M3 instance, + * we ignore any instance store volumes specified in the block device mapping for the AMI.</p>. + * + * @return the virtualName value. + */ + public String virtualName() { + return this.virtualName; + } + + /** + * Set the virtualName property: <p>The virtual device name (<code>ephemeral</code>N). Instance + * store volumes are numbered starting from 0. An instance type with 2 available instance store volumes can specify + * mappings for <code>ephemeral0</code> and <code>ephemeral1</code>. The number of available + * instance store volumes depends on the instance type. After you connect to the instance, you must mount the + * volume.</p> <p>NVMe instance store volumes are automatically enumerated and assigned a device name. + * Including them in your block device mapping has no effect.</p> <p>Constraints: For M3 instances, you + * must specify instance store volumes in the block device mapping for the instance. When you launch an M3 instance, + * we ignore any instance store volumes specified in the block device mapping for the AMI.</p>. + * + * @param virtualName the virtualName value to set. + * @return the BlockDeviceMapping object itself. + */ + public BlockDeviceMapping withVirtualName(String virtualName) { + this.virtualName = virtualName; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (ebs() != null) { + ebs().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("deviceName", this.deviceName); + jsonWriter.writeJsonField("ebs", this.ebs); + jsonWriter.writeStringField("noDevice", this.noDevice); + jsonWriter.writeStringField("virtualName", this.virtualName); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of BlockDeviceMapping from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of BlockDeviceMapping if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the BlockDeviceMapping. + */ + public static BlockDeviceMapping fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + BlockDeviceMapping deserializedBlockDeviceMapping = new BlockDeviceMapping(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("deviceName".equals(fieldName)) { + deserializedBlockDeviceMapping.deviceName = reader.getString(); + } else if ("ebs".equals(fieldName)) { + deserializedBlockDeviceMapping.ebs = EbsBlockDevice.fromJson(reader); + } else if ("noDevice".equals(fieldName)) { + deserializedBlockDeviceMapping.noDevice = reader.getString(); + } else if ("virtualName".equals(fieldName)) { + deserializedBlockDeviceMapping.virtualName = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedBlockDeviceMapping; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/BootModeValues.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/BootModeValues.java new file mode 100644 index 000000000000..e34460b04f1d --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/BootModeValues.java @@ -0,0 +1,56 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * BootModeValues enum. + */ +public final class BootModeValues extends ExpandableStringEnum { + /** + * Static value legacy-bios for BootModeValues. + */ + public static final BootModeValues LEGACY_BIOS = fromString("legacy-bios"); + + /** + * Static value uefi for BootModeValues. + */ + public static final BootModeValues UEFI = fromString("uefi"); + + /** + * Static value uefi-preferred for BootModeValues. + */ + public static final BootModeValues UEFI_PREFERRED = fromString("uefi-preferred"); + + /** + * Creates a new instance of BootModeValues value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public BootModeValues() { + } + + /** + * Creates or finds a BootModeValues from its string representation. + * + * @param name a name to look for. + * @return the corresponding BootModeValues. + */ + public static BootModeValues fromString(String name) { + return fromString(name, BootModeValues.class); + } + + /** + * Gets known BootModeValues values. + * + * @return known BootModeValues values. + */ + public static Collection values() { + return values(BootModeValues.class); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/BootModeValuesEnumValue.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/BootModeValuesEnumValue.java new file mode 100644 index 000000000000..a9362fe3d171 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/BootModeValuesEnumValue.java @@ -0,0 +1,93 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of BootModeValuesEnumValue. + */ +@Fluent +public final class BootModeValuesEnumValue implements JsonSerializable { + /* + * Property value + */ + private BootModeValues value; + + /** + * Creates an instance of BootModeValuesEnumValue class. + */ + public BootModeValuesEnumValue() { + } + + /** + * Get the value property: Property value. + * + * @return the value value. + */ + public BootModeValues value() { + return this.value; + } + + /** + * Set the value property: Property value. + * + * @param value the value value to set. + * @return the BootModeValuesEnumValue object itself. + */ + public BootModeValuesEnumValue withValue(BootModeValues value) { + this.value = value; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("value", this.value == null ? null : this.value.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of BootModeValuesEnumValue from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of BootModeValuesEnumValue if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the BootModeValuesEnumValue. + */ + public static BootModeValuesEnumValue fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + BootModeValuesEnumValue deserializedBootModeValuesEnumValue = new BootModeValuesEnumValue(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + deserializedBootModeValuesEnumValue.value = BootModeValues.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedBootModeValuesEnumValue; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/BucketEncryption.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/BucketEncryption.java new file mode 100644 index 000000000000..325ce336bec2 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/BucketEncryption.java @@ -0,0 +1,101 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Definition of BucketEncryption. + */ +@Fluent +public final class BucketEncryption implements JsonSerializable { + /* + * Specifies the default server-side-encryption configuration. + */ + private List serverSideEncryptionConfiguration; + + /** + * Creates an instance of BucketEncryption class. + */ + public BucketEncryption() { + } + + /** + * Get the serverSideEncryptionConfiguration property: Specifies the default server-side-encryption configuration. + * + * @return the serverSideEncryptionConfiguration value. + */ + public List serverSideEncryptionConfiguration() { + return this.serverSideEncryptionConfiguration; + } + + /** + * Set the serverSideEncryptionConfiguration property: Specifies the default server-side-encryption configuration. + * + * @param serverSideEncryptionConfiguration the serverSideEncryptionConfiguration value to set. + * @return the BucketEncryption object itself. + */ + public BucketEncryption + withServerSideEncryptionConfiguration(List serverSideEncryptionConfiguration) { + this.serverSideEncryptionConfiguration = serverSideEncryptionConfiguration; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (serverSideEncryptionConfiguration() != null) { + serverSideEncryptionConfiguration().forEach(e -> e.validate()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("serverSideEncryptionConfiguration", this.serverSideEncryptionConfiguration, + (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of BucketEncryption from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of BucketEncryption if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the BucketEncryption. + */ + public static BucketEncryption fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + BucketEncryption deserializedBucketEncryption = new BucketEncryption(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("serverSideEncryptionConfiguration".equals(fieldName)) { + List serverSideEncryptionConfiguration + = reader.readArray(reader1 -> ServerSideEncryptionRule.fromJson(reader1)); + deserializedBucketEncryption.serverSideEncryptionConfiguration = serverSideEncryptionConfiguration; + } else { + reader.skipChildren(); + } + } + + return deserializedBucketEncryption; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/BucketOwnerAccess.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/BucketOwnerAccess.java new file mode 100644 index 000000000000..fa06da3c6b58 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/BucketOwnerAccess.java @@ -0,0 +1,56 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * BucketOwnerAccess enum. + */ +public final class BucketOwnerAccess extends ExpandableStringEnum { + /** + * Static value FULL for BucketOwnerAccess. + */ + public static final BucketOwnerAccess FULL = fromString("FULL"); + + /** + * Static value NONE for BucketOwnerAccess. + */ + public static final BucketOwnerAccess NONE = fromString("NONE"); + + /** + * Static value READ_ONLY for BucketOwnerAccess. + */ + public static final BucketOwnerAccess READ_ONLY = fromString("READ_ONLY"); + + /** + * Creates a new instance of BucketOwnerAccess value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public BucketOwnerAccess() { + } + + /** + * Creates or finds a BucketOwnerAccess from its string representation. + * + * @param name a name to look for. + * @return the corresponding BucketOwnerAccess. + */ + public static BucketOwnerAccess fromString(String name) { + return fromString(name, BucketOwnerAccess.class); + } + + /** + * Gets known BucketOwnerAccess values. + * + * @return known BucketOwnerAccess values. + */ + public static Collection values() { + return values(BucketOwnerAccess.class); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/BucketOwnerAccessEnumValue.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/BucketOwnerAccessEnumValue.java new file mode 100644 index 000000000000..963d0a4529b3 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/BucketOwnerAccessEnumValue.java @@ -0,0 +1,93 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of BucketOwnerAccessEnumValue. + */ +@Fluent +public final class BucketOwnerAccessEnumValue implements JsonSerializable { + /* + * Property value + */ + private BucketOwnerAccess value; + + /** + * Creates an instance of BucketOwnerAccessEnumValue class. + */ + public BucketOwnerAccessEnumValue() { + } + + /** + * Get the value property: Property value. + * + * @return the value value. + */ + public BucketOwnerAccess value() { + return this.value; + } + + /** + * Set the value property: Property value. + * + * @param value the value value to set. + * @return the BucketOwnerAccessEnumValue object itself. + */ + public BucketOwnerAccessEnumValue withValue(BucketOwnerAccess value) { + this.value = value; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("value", this.value == null ? null : this.value.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of BucketOwnerAccessEnumValue from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of BucketOwnerAccessEnumValue if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IOException If an error occurs while reading the BucketOwnerAccessEnumValue. + */ + public static BucketOwnerAccessEnumValue fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + BucketOwnerAccessEnumValue deserializedBucketOwnerAccessEnumValue = new BucketOwnerAccessEnumValue(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + deserializedBucketOwnerAccessEnumValue.value = BucketOwnerAccess.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedBucketOwnerAccessEnumValue; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/BuildStatusConfig.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/BuildStatusConfig.java new file mode 100644 index 000000000000..817a206bea41 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/BuildStatusConfig.java @@ -0,0 +1,173 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of BuildStatusConfig. + */ +@Fluent +public final class BuildStatusConfig implements JsonSerializable { + /* + *

Specifies the context of the build status CodeBuild sends to the source provider. The usage of this parameter + * depends on the source provider.

Bitbucket

This parameter is used for the + * name parameter in the Bitbucket commit status. For more information, see build in the Bitbucket API documentation.

+ *
GitHub/GitHub Enterprise Server

This parameter is used for the context parameter in + * the GitHub commit status. For more information, see Create a commit status in the + * GitHub developer guide.

+ */ + private String context; + + /* + *

Specifies the target url of the build status CodeBuild sends to the source provider. The usage of this + * parameter depends on the source provider.

Bitbucket

This parameter is used for the + * url parameter in the Bitbucket commit status. For more information, see build in the Bitbucket API documentation.

+ *
GitHub/GitHub Enterprise Server

This parameter is used for the target_url parameter + * in the GitHub commit status. For more information, see Create a commit status in the + * GitHub developer guide.

+ */ + private String targetUrl; + + /** + * Creates an instance of BuildStatusConfig class. + */ + public BuildStatusConfig() { + } + + /** + * Get the context property: <p>Specifies the context of the build status CodeBuild sends to the source + * provider. The usage of this parameter depends on the source provider.</p> <dl> + * <dt>Bitbucket</dt> <dd> <p>This parameter is used for the <code>name</code> + * parameter in the Bitbucket commit status. For more information, see <a + * href='https://developer.atlassian.com/bitbucket/api/2/reference/resource/repositories/%7Bworkspace%7D/%7Brepo_slug%7D/commit/%7Bnode%7D/statuses/build'>build</a> + * in the Bitbucket API documentation.</p> </dd> <dt>GitHub/GitHub Enterprise Server</dt> + * <dd> <p>This parameter is used for the <code>context</code> parameter in the GitHub + * commit status. For more information, see <a + * href='https://developer.github.com/v3/repos/statuses/#create-a-commit-status'>Create a commit status</a> + * in the GitHub developer guide.</p> </dd> </dl>. + * + * @return the context value. + */ + public String context() { + return this.context; + } + + /** + * Set the context property: <p>Specifies the context of the build status CodeBuild sends to the source + * provider. The usage of this parameter depends on the source provider.</p> <dl> + * <dt>Bitbucket</dt> <dd> <p>This parameter is used for the <code>name</code> + * parameter in the Bitbucket commit status. For more information, see <a + * href='https://developer.atlassian.com/bitbucket/api/2/reference/resource/repositories/%7Bworkspace%7D/%7Brepo_slug%7D/commit/%7Bnode%7D/statuses/build'>build</a> + * in the Bitbucket API documentation.</p> </dd> <dt>GitHub/GitHub Enterprise Server</dt> + * <dd> <p>This parameter is used for the <code>context</code> parameter in the GitHub + * commit status. For more information, see <a + * href='https://developer.github.com/v3/repos/statuses/#create-a-commit-status'>Create a commit status</a> + * in the GitHub developer guide.</p> </dd> </dl>. + * + * @param context the context value to set. + * @return the BuildStatusConfig object itself. + */ + public BuildStatusConfig withContext(String context) { + this.context = context; + return this; + } + + /** + * Get the targetUrl property: <p>Specifies the target url of the build status CodeBuild sends to the source + * provider. The usage of this parameter depends on the source provider.</p> <dl> + * <dt>Bitbucket</dt> <dd> <p>This parameter is used for the <code>url</code> + * parameter in the Bitbucket commit status. For more information, see <a + * href='https://developer.atlassian.com/bitbucket/api/2/reference/resource/repositories/%7Bworkspace%7D/%7Brepo_slug%7D/commit/%7Bnode%7D/statuses/build'>build</a> + * in the Bitbucket API documentation.</p> </dd> <dt>GitHub/GitHub Enterprise Server</dt> + * <dd> <p>This parameter is used for the <code>target_url</code> parameter in the GitHub + * commit status. For more information, see <a + * href='https://developer.github.com/v3/repos/statuses/#create-a-commit-status'>Create a commit status</a> + * in the GitHub developer guide.</p> </dd> </dl>. + * + * @return the targetUrl value. + */ + public String targetUrl() { + return this.targetUrl; + } + + /** + * Set the targetUrl property: <p>Specifies the target url of the build status CodeBuild sends to the source + * provider. The usage of this parameter depends on the source provider.</p> <dl> + * <dt>Bitbucket</dt> <dd> <p>This parameter is used for the <code>url</code> + * parameter in the Bitbucket commit status. For more information, see <a + * href='https://developer.atlassian.com/bitbucket/api/2/reference/resource/repositories/%7Bworkspace%7D/%7Brepo_slug%7D/commit/%7Bnode%7D/statuses/build'>build</a> + * in the Bitbucket API documentation.</p> </dd> <dt>GitHub/GitHub Enterprise Server</dt> + * <dd> <p>This parameter is used for the <code>target_url</code> parameter in the GitHub + * commit status. For more information, see <a + * href='https://developer.github.com/v3/repos/statuses/#create-a-commit-status'>Create a commit status</a> + * in the GitHub developer guide.</p> </dd> </dl>. + * + * @param targetUrl the targetUrl value to set. + * @return the BuildStatusConfig object itself. + */ + public BuildStatusConfig withTargetUrl(String targetUrl) { + this.targetUrl = targetUrl; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("context", this.context); + jsonWriter.writeStringField("targetUrl", this.targetUrl); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of BuildStatusConfig from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of BuildStatusConfig if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the BuildStatusConfig. + */ + public static BuildStatusConfig fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + BuildStatusConfig deserializedBuildStatusConfig = new BuildStatusConfig(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("context".equals(fieldName)) { + deserializedBuildStatusConfig.context = reader.getString(); + } else if ("targetUrl".equals(fieldName)) { + deserializedBuildStatusConfig.targetUrl = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedBuildStatusConfig; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/CacheBehavior.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/CacheBehavior.java new file mode 100644 index 000000000000..164e266c33a1 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/CacheBehavior.java @@ -0,0 +1,1020 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Definition of CacheBehavior. + */ +@Fluent +public final class CacheBehavior implements JsonSerializable { + /* + * A complex type that controls which HTTP methods CloudFront processes and forwards to your Amazon S3 bucket or + * your custom origin. There are three choices: + CloudFront forwards only ``GET`` and ``HEAD`` requests. + + * CloudFront forwards only ``GET``, ``HEAD``, and ``OPTIONS`` requests. + CloudFront forwards ``GET, HEAD, OPTIONS, + * PUT, PATCH, POST``, and ``DELETE`` requests. If you pick the third choice, you may need to restrict access to + * your Amazon S3 bucket or to your custom origin so users can't perform operations that you don't want them to. For + * example, you might not want users to have permissions to delete objects from your origin. + */ + private List allowedMethods; + + /* + * The unique identifier of the cache policy that is attached to this cache behavior. For more information, see + * [Creating cache + * policies](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/controlling-the-cache-key.html#cache + * -key-create-cache-policy) or [Using the managed cache + * policies](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/using-managed-cache-policies.html) + * in the *Amazon CloudFront Developer Guide*. A ``CacheBehavior`` must include either a ``CachePolicyId`` or + * ``ForwardedValues``. We recommend that you use a ``CachePolicyId``. + */ + private String cachePolicyId; + + /* + * A complex type that controls whether CloudFront caches the response to requests using the specified HTTP methods. + * There are two choices: + CloudFront caches responses to ``GET`` and ``HEAD`` requests. + CloudFront caches + * responses to ``GET``, ``HEAD``, and ``OPTIONS`` requests. If you pick the second choice for your Amazon S3 + * Origin, you may need to forward Access-Control-Request-Method, Access-Control-Request-Headers, and Origin headers + * for the responses to be cached correctly. + */ + private List cachedMethods; + + /* + * Whether you want CloudFront to automatically compress certain files for this cache behavior. If so, specify true; + * if not, specify false. For more information, see [Serving Compressed + * Files](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/ServingCompressedFiles.html) in the + * *Amazon CloudFront Developer Guide*. + */ + private Boolean compress; + + /* + * This field is deprecated. We recommend that you use the ``DefaultTTL`` field in a cache policy instead of this + * field. For more information, see [Creating cache + * policies](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/controlling-the-cache-key.html#cache + * -key-create-cache-policy) or [Using the managed cache + * policies](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/using-managed-cache-policies.html) + * in the *Amazon CloudFront Developer Guide*. The default amount of time that you want objects to stay in + * CloudFront caches before CloudFront forwards another request to your origin to determine whether the object has + * been updated. The value that you specify applies only when your origin does not add HTTP headers such as + * ``Cache-Control max-age``, ``Cache-Control s-maxage``, and ``Expires`` to objects. For more information, see + * [Managing How Long Content Stays in an Edge Cache + * (Expiration)](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/Expiration.html) in the *Amazon + * CloudFront Developer Guide*. + */ + private Integer defaultTtl; + + /* + * The value of ``ID`` for the field-level encryption configuration that you want CloudFront to use for encrypting + * specific fields of data for this cache behavior. + */ + private String fieldLevelEncryptionId; + + /* + * This field is deprecated. We recommend that you use a cache policy or an origin request policy instead of this + * field. For more information, see [Working with + * policies](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/working-with-policies.html) in the + * *Amazon CloudFront Developer Guide*. If you want to include values in the cache key, use a cache policy. For more + * information, see [Creating cache + * policies](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/controlling-the-cache-key.html#cache + * -key-create-cache-policy) or [Using the managed cache + * policies](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/using-managed-cache-policies.html) + * in the *Amazon CloudFront Developer Guide*. If you want to send values to the origin but not include them in the + * cache key, use an origin request policy. For more information, see [Creating origin request + * policies](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/controlling-origin-requests.html# + * origin-request-create-origin-request-policy) or [Using the managed origin request + * policies](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/using-managed-origin-request- + * policies.html) in the *Amazon CloudFront Developer Guide*. A ``CacheBehavior`` must include either a + * ``CachePolicyId`` or ``ForwardedValues``. We recommend that you use a ``CachePolicyId``. A complex type that + * specifies how CloudFront handles query strings, cookies, and HTTP headers. This field is deprecated. We recommend + * that you use a cache policy or an origin request policy instead of this field. If you want to include values in + * the cache key, use a cache policy. For more information, see [Creating cache + * policies](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/controlling-the-cache-key.html#cache + * -key-create-cache-policy) in the *Amazon CloudFront Developer Guide*. If you want to send values to the origin + * but not include them in the cache key, use an origin request policy. For more information, see [Creating origin + * request + * policies](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/controlling-origin-requests.html# + * origin-request-create-origin-request-policy) in the *Amazon CloudFront Developer Guide*. A complex type that + * specifies how CloudFront handles query strings, cookies, and HTTP headers. + */ + private ForwardedValues forwardedValues; + + /* + * A list of CloudFront functions that are associated with this cache behavior. CloudFront functions must be + * published to the ``LIVE`` stage to associate them with a cache behavior. + */ + private List functionAssociations; + + /* + * A complex type that contains zero or more Lambda@Edge function associations for a cache behavior. + */ + private List lambdaFunctionAssociations; + + /* + * This field is deprecated. We recommend that you use the ``MaxTTL`` field in a cache policy instead of this field. + * For more information, see [Creating cache + * policies](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/controlling-the-cache-key.html#cache + * -key-create-cache-policy) or [Using the managed cache + * policies](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/using-managed-cache-policies.html) + * in the *Amazon CloudFront Developer Guide*. The maximum amount of time that you want objects to stay in + * CloudFront caches before CloudFront forwards another request to your origin to determine whether the object has + * been updated. The value that you specify applies only when your origin adds HTTP headers such as ``Cache-Control + * max-age``, ``Cache-Control s-maxage``, and ``Expires`` to objects. For more information, see [Managing How Long + * Content Stays in an Edge Cache + * (Expiration)](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/Expiration.html) in the *Amazon + * CloudFront Developer Guide*. + */ + private Integer maxTtl; + + /* + * This field is deprecated. We recommend that you use the ``MinTTL`` field in a cache policy instead of this field. + * For more information, see [Creating cache + * policies](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/controlling-the-cache-key.html#cache + * -key-create-cache-policy) or [Using the managed cache + * policies](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/using-managed-cache-policies.html) + * in the *Amazon CloudFront Developer Guide*. The minimum amount of time that you want objects to stay in + * CloudFront caches before CloudFront forwards another request to your origin to determine whether the object has + * been updated. For more information, see [Managing How Long Content Stays in an Edge Cache + * (Expiration)](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/Expiration.html) in the *Amazon + * CloudFront Developer Guide*. You must specify ``0`` for ``MinTTL`` if you configure CloudFront to forward all + * headers to your origin (under ``Headers``, if you specify ``1`` for ``Quantity`` and ``*`` for ``Name``). + */ + private Integer minTtl; + + /* + * The unique identifier of the origin request policy that is attached to this cache behavior. For more information, + * see [Creating origin request + * policies](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/controlling-origin-requests.html# + * origin-request-create-origin-request-policy) or [Using the managed origin request + * policies](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/using-managed-origin-request- + * policies.html) in the *Amazon CloudFront Developer Guide*. + */ + private String originRequestPolicyId; + + /* + * The pattern (for example, ``images/*.jpg``) that specifies which requests to apply the behavior to. When + * CloudFront receives a viewer request, the requested path is compared with path patterns in the order in which + * cache behaviors are listed in the distribution. You can optionally include a slash (``/``) at the beginning of + * the path pattern. For example, ``/images/*.jpg``. CloudFront behavior is the same with or without the leading + * ``/``. The path pattern for the default cache behavior is ``*`` and cannot be changed. If the request for an + * object does not match the path pattern for any cache behaviors, CloudFront applies the behavior in the default + * cache behavior. For more information, see [Path + * Pattern](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/distribution-web-values-specify.html# + * DownloadDistValuesPathPattern) in the *Amazon CloudFront Developer Guide*. + */ + private String pathPattern; + + /* + * The Amazon Resource Name (ARN) of the real-time log configuration that is attached to this cache behavior. For + * more information, see [Real-time + * logs](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/real-time-logs.html) in the *Amazon + * CloudFront Developer Guide*. + */ + private String realtimeLogConfigArn; + + /* + * The identifier for a response headers policy. + */ + private String responseHeadersPolicyId; + + /* + * Indicates whether you want to distribute media files in the Microsoft Smooth Streaming format using the origin + * that is associated with this cache behavior. If so, specify ``true``; if not, specify ``false``. If you specify + * ``true`` for ``SmoothStreaming``, you can still distribute other content using this cache behavior if the content + * matches the value of ``PathPattern``. + */ + private Boolean smoothStreaming; + + /* + * The value of ``ID`` for the origin that you want CloudFront to route requests to when they match this cache + * behavior. + */ + private String targetOriginId; + + /* + * A list of key groups that CloudFront can use to validate signed URLs or signed cookies. When a cache behavior + * contains trusted key groups, CloudFront requires signed URLs or signed cookies for all requests that match the + * cache behavior. The URLs or cookies must be signed with a private key whose corresponding public key is in the + * key group. The signed URL or cookie contains information about which public key CloudFront should use to verify + * the signature. For more information, see [Serving private + * content](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/PrivateContent.html) in the *Amazon + * CloudFront Developer Guide*. + */ + private List trustedKeyGroups; + + /* + * We recommend using ``TrustedKeyGroups`` instead of ``TrustedSigners``. A list of AWS-account IDs whose public + * keys CloudFront can use to validate signed URLs or signed cookies. When a cache behavior contains trusted + * signers, CloudFront requires signed URLs or signed cookies for all requests that match the cache behavior. The + * URLs or cookies must be signed with the private key of a CloudFront key pair in the trusted signer's AWS-account. + * The signed URL or cookie contains information about which public key CloudFront should use to verify the + * signature. For more information, see [Serving private + * content](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/PrivateContent.html) in the *Amazon + * CloudFront Developer Guide*. + */ + private List trustedSigners; + + /* + * The protocol that viewers can use to access the files in the origin specified by ``TargetOriginId`` when a + * request matches the path pattern in ``PathPattern``. You can specify the following options: + ``allow-all``: + * Viewers can use HTTP or HTTPS. + ``redirect-to-https``: If a viewer submits an HTTP request, CloudFront returns + * an HTTP status code of 301 (Moved Permanently) to the viewer along with the HTTPS URL. The viewer then resubmits + * the request using the new URL. + ``https-only``: If a viewer sends an HTTP request, CloudFront returns an HTTP + * status code of 403 (Forbidden). For more information about requiring the HTTPS protocol, see [Requiring HTTPS + * Between Viewers and + * CloudFront](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/using-https-viewers-to-cloudfront. + * html) in the *Amazon CloudFront Developer Guide*. The only way to guarantee that viewers retrieve an object that + * was fetched from the origin using HTTPS is never to use any other protocol to fetch the object. If you have + * recently changed from HTTP to HTTPS, we recommend that you clear your objects' cache because cached objects are + * protocol agnostic. That means that an edge location will return an object from the cache regardless of whether + * the current request protocol matches the protocol used previously. For more information, see [Managing Cache + * Expiration](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/Expiration.html) in the *Amazon + * CloudFront Developer Guide*. + */ + private String viewerProtocolPolicy; + + /** + * Creates an instance of CacheBehavior class. + */ + public CacheBehavior() { + } + + /** + * Get the allowedMethods property: A complex type that controls which HTTP methods CloudFront processes and + * forwards to your Amazon S3 bucket or your custom origin. There are three choices: + CloudFront forwards only + * ``GET`` and ``HEAD`` requests. + CloudFront forwards only ``GET``, ``HEAD``, and ``OPTIONS`` requests. + + * CloudFront forwards ``GET, HEAD, OPTIONS, PUT, PATCH, POST``, and ``DELETE`` requests. If you pick the third + * choice, you may need to restrict access to your Amazon S3 bucket or to your custom origin so users can't perform + * operations that you don't want them to. For example, you might not want users to have permissions to delete + * objects from your origin. + * + * @return the allowedMethods value. + */ + public List allowedMethods() { + return this.allowedMethods; + } + + /** + * Set the allowedMethods property: A complex type that controls which HTTP methods CloudFront processes and + * forwards to your Amazon S3 bucket or your custom origin. There are three choices: + CloudFront forwards only + * ``GET`` and ``HEAD`` requests. + CloudFront forwards only ``GET``, ``HEAD``, and ``OPTIONS`` requests. + + * CloudFront forwards ``GET, HEAD, OPTIONS, PUT, PATCH, POST``, and ``DELETE`` requests. If you pick the third + * choice, you may need to restrict access to your Amazon S3 bucket or to your custom origin so users can't perform + * operations that you don't want them to. For example, you might not want users to have permissions to delete + * objects from your origin. + * + * @param allowedMethods the allowedMethods value to set. + * @return the CacheBehavior object itself. + */ + public CacheBehavior withAllowedMethods(List allowedMethods) { + this.allowedMethods = allowedMethods; + return this; + } + + /** + * Get the cachePolicyId property: The unique identifier of the cache policy that is attached to this cache + * behavior. For more information, see [Creating cache + * policies](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/controlling-the-cache-key.html#cache-key-create-cache-policy) + * or [Using the managed cache + * policies](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/using-managed-cache-policies.html) + * in the *Amazon CloudFront Developer Guide*. A ``CacheBehavior`` must include either a ``CachePolicyId`` or + * ``ForwardedValues``. We recommend that you use a ``CachePolicyId``. + * + * @return the cachePolicyId value. + */ + public String cachePolicyId() { + return this.cachePolicyId; + } + + /** + * Set the cachePolicyId property: The unique identifier of the cache policy that is attached to this cache + * behavior. For more information, see [Creating cache + * policies](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/controlling-the-cache-key.html#cache-key-create-cache-policy) + * or [Using the managed cache + * policies](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/using-managed-cache-policies.html) + * in the *Amazon CloudFront Developer Guide*. A ``CacheBehavior`` must include either a ``CachePolicyId`` or + * ``ForwardedValues``. We recommend that you use a ``CachePolicyId``. + * + * @param cachePolicyId the cachePolicyId value to set. + * @return the CacheBehavior object itself. + */ + public CacheBehavior withCachePolicyId(String cachePolicyId) { + this.cachePolicyId = cachePolicyId; + return this; + } + + /** + * Get the cachedMethods property: A complex type that controls whether CloudFront caches the response to requests + * using the specified HTTP methods. There are two choices: + CloudFront caches responses to ``GET`` and ``HEAD`` + * requests. + CloudFront caches responses to ``GET``, ``HEAD``, and ``OPTIONS`` requests. If you pick the second + * choice for your Amazon S3 Origin, you may need to forward Access-Control-Request-Method, + * Access-Control-Request-Headers, and Origin headers for the responses to be cached correctly. + * + * @return the cachedMethods value. + */ + public List cachedMethods() { + return this.cachedMethods; + } + + /** + * Set the cachedMethods property: A complex type that controls whether CloudFront caches the response to requests + * using the specified HTTP methods. There are two choices: + CloudFront caches responses to ``GET`` and ``HEAD`` + * requests. + CloudFront caches responses to ``GET``, ``HEAD``, and ``OPTIONS`` requests. If you pick the second + * choice for your Amazon S3 Origin, you may need to forward Access-Control-Request-Method, + * Access-Control-Request-Headers, and Origin headers for the responses to be cached correctly. + * + * @param cachedMethods the cachedMethods value to set. + * @return the CacheBehavior object itself. + */ + public CacheBehavior withCachedMethods(List cachedMethods) { + this.cachedMethods = cachedMethods; + return this; + } + + /** + * Get the compress property: Whether you want CloudFront to automatically compress certain files for this cache + * behavior. If so, specify true; if not, specify false. For more information, see [Serving Compressed + * Files](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/ServingCompressedFiles.html) in the + * *Amazon CloudFront Developer Guide*. + * + * @return the compress value. + */ + public Boolean compress() { + return this.compress; + } + + /** + * Set the compress property: Whether you want CloudFront to automatically compress certain files for this cache + * behavior. If so, specify true; if not, specify false. For more information, see [Serving Compressed + * Files](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/ServingCompressedFiles.html) in the + * *Amazon CloudFront Developer Guide*. + * + * @param compress the compress value to set. + * @return the CacheBehavior object itself. + */ + public CacheBehavior withCompress(Boolean compress) { + this.compress = compress; + return this; + } + + /** + * Get the defaultTtl property: This field is deprecated. We recommend that you use the ``DefaultTTL`` field in a + * cache policy instead of this field. For more information, see [Creating cache + * policies](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/controlling-the-cache-key.html#cache-key-create-cache-policy) + * or [Using the managed cache + * policies](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/using-managed-cache-policies.html) + * in the *Amazon CloudFront Developer Guide*. The default amount of time that you want objects to stay in + * CloudFront caches before CloudFront forwards another request to your origin to determine whether the object has + * been updated. The value that you specify applies only when your origin does not add HTTP headers such as + * ``Cache-Control max-age``, ``Cache-Control s-maxage``, and ``Expires`` to objects. For more information, see + * [Managing How Long Content Stays in an Edge Cache + * (Expiration)](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/Expiration.html) in the *Amazon + * CloudFront Developer Guide*. + * + * @return the defaultTtl value. + */ + public Integer defaultTtl() { + return this.defaultTtl; + } + + /** + * Set the defaultTtl property: This field is deprecated. We recommend that you use the ``DefaultTTL`` field in a + * cache policy instead of this field. For more information, see [Creating cache + * policies](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/controlling-the-cache-key.html#cache-key-create-cache-policy) + * or [Using the managed cache + * policies](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/using-managed-cache-policies.html) + * in the *Amazon CloudFront Developer Guide*. The default amount of time that you want objects to stay in + * CloudFront caches before CloudFront forwards another request to your origin to determine whether the object has + * been updated. The value that you specify applies only when your origin does not add HTTP headers such as + * ``Cache-Control max-age``, ``Cache-Control s-maxage``, and ``Expires`` to objects. For more information, see + * [Managing How Long Content Stays in an Edge Cache + * (Expiration)](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/Expiration.html) in the *Amazon + * CloudFront Developer Guide*. + * + * @param defaultTtl the defaultTtl value to set. + * @return the CacheBehavior object itself. + */ + public CacheBehavior withDefaultTtl(Integer defaultTtl) { + this.defaultTtl = defaultTtl; + return this; + } + + /** + * Get the fieldLevelEncryptionId property: The value of ``ID`` for the field-level encryption configuration that + * you want CloudFront to use for encrypting specific fields of data for this cache behavior. + * + * @return the fieldLevelEncryptionId value. + */ + public String fieldLevelEncryptionId() { + return this.fieldLevelEncryptionId; + } + + /** + * Set the fieldLevelEncryptionId property: The value of ``ID`` for the field-level encryption configuration that + * you want CloudFront to use for encrypting specific fields of data for this cache behavior. + * + * @param fieldLevelEncryptionId the fieldLevelEncryptionId value to set. + * @return the CacheBehavior object itself. + */ + public CacheBehavior withFieldLevelEncryptionId(String fieldLevelEncryptionId) { + this.fieldLevelEncryptionId = fieldLevelEncryptionId; + return this; + } + + /** + * Get the forwardedValues property: This field is deprecated. We recommend that you use a cache policy or an origin + * request policy instead of this field. For more information, see [Working with + * policies](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/working-with-policies.html) in the + * *Amazon CloudFront Developer Guide*. If you want to include values in the cache key, use a cache policy. For more + * information, see [Creating cache + * policies](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/controlling-the-cache-key.html#cache-key-create-cache-policy) + * or [Using the managed cache + * policies](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/using-managed-cache-policies.html) + * in the *Amazon CloudFront Developer Guide*. If you want to send values to the origin but not include them in the + * cache key, use an origin request policy. For more information, see [Creating origin request + * policies](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/controlling-origin-requests.html#origin-request-create-origin-request-policy) + * or [Using the managed origin request + * policies](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/using-managed-origin-request-policies.html) + * in the *Amazon CloudFront Developer Guide*. A ``CacheBehavior`` must include either a ``CachePolicyId`` or + * ``ForwardedValues``. We recommend that you use a ``CachePolicyId``. A complex type that specifies how CloudFront + * handles query strings, cookies, and HTTP headers. This field is deprecated. We recommend that you use a cache + * policy or an origin request policy instead of this field. If you want to include values in the cache key, use a + * cache policy. For more information, see [Creating cache + * policies](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/controlling-the-cache-key.html#cache-key-create-cache-policy) + * in the *Amazon CloudFront Developer Guide*. If you want to send values to the origin but not include them in the + * cache key, use an origin request policy. For more information, see [Creating origin request + * policies](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/controlling-origin-requests.html#origin-request-create-origin-request-policy) + * in the *Amazon CloudFront Developer Guide*. A complex type that specifies how CloudFront handles query strings, + * cookies, and HTTP headers. + * + * @return the forwardedValues value. + */ + public ForwardedValues forwardedValues() { + return this.forwardedValues; + } + + /** + * Set the forwardedValues property: This field is deprecated. We recommend that you use a cache policy or an origin + * request policy instead of this field. For more information, see [Working with + * policies](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/working-with-policies.html) in the + * *Amazon CloudFront Developer Guide*. If you want to include values in the cache key, use a cache policy. For more + * information, see [Creating cache + * policies](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/controlling-the-cache-key.html#cache-key-create-cache-policy) + * or [Using the managed cache + * policies](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/using-managed-cache-policies.html) + * in the *Amazon CloudFront Developer Guide*. If you want to send values to the origin but not include them in the + * cache key, use an origin request policy. For more information, see [Creating origin request + * policies](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/controlling-origin-requests.html#origin-request-create-origin-request-policy) + * or [Using the managed origin request + * policies](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/using-managed-origin-request-policies.html) + * in the *Amazon CloudFront Developer Guide*. A ``CacheBehavior`` must include either a ``CachePolicyId`` or + * ``ForwardedValues``. We recommend that you use a ``CachePolicyId``. A complex type that specifies how CloudFront + * handles query strings, cookies, and HTTP headers. This field is deprecated. We recommend that you use a cache + * policy or an origin request policy instead of this field. If you want to include values in the cache key, use a + * cache policy. For more information, see [Creating cache + * policies](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/controlling-the-cache-key.html#cache-key-create-cache-policy) + * in the *Amazon CloudFront Developer Guide*. If you want to send values to the origin but not include them in the + * cache key, use an origin request policy. For more information, see [Creating origin request + * policies](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/controlling-origin-requests.html#origin-request-create-origin-request-policy) + * in the *Amazon CloudFront Developer Guide*. A complex type that specifies how CloudFront handles query strings, + * cookies, and HTTP headers. + * + * @param forwardedValues the forwardedValues value to set. + * @return the CacheBehavior object itself. + */ + public CacheBehavior withForwardedValues(ForwardedValues forwardedValues) { + this.forwardedValues = forwardedValues; + return this; + } + + /** + * Get the functionAssociations property: A list of CloudFront functions that are associated with this cache + * behavior. CloudFront functions must be published to the ``LIVE`` stage to associate them with a cache behavior. + * + * @return the functionAssociations value. + */ + public List functionAssociations() { + return this.functionAssociations; + } + + /** + * Set the functionAssociations property: A list of CloudFront functions that are associated with this cache + * behavior. CloudFront functions must be published to the ``LIVE`` stage to associate them with a cache behavior. + * + * @param functionAssociations the functionAssociations value to set. + * @return the CacheBehavior object itself. + */ + public CacheBehavior withFunctionAssociations(List functionAssociations) { + this.functionAssociations = functionAssociations; + return this; + } + + /** + * Get the lambdaFunctionAssociations property: A complex type that contains zero or more Lambda@Edge function + * associations for a cache behavior. + * + * @return the lambdaFunctionAssociations value. + */ + public List lambdaFunctionAssociations() { + return this.lambdaFunctionAssociations; + } + + /** + * Set the lambdaFunctionAssociations property: A complex type that contains zero or more Lambda@Edge function + * associations for a cache behavior. + * + * @param lambdaFunctionAssociations the lambdaFunctionAssociations value to set. + * @return the CacheBehavior object itself. + */ + public CacheBehavior withLambdaFunctionAssociations(List lambdaFunctionAssociations) { + this.lambdaFunctionAssociations = lambdaFunctionAssociations; + return this; + } + + /** + * Get the maxTtl property: This field is deprecated. We recommend that you use the ``MaxTTL`` field in a cache + * policy instead of this field. For more information, see [Creating cache + * policies](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/controlling-the-cache-key.html#cache-key-create-cache-policy) + * or [Using the managed cache + * policies](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/using-managed-cache-policies.html) + * in the *Amazon CloudFront Developer Guide*. The maximum amount of time that you want objects to stay in + * CloudFront caches before CloudFront forwards another request to your origin to determine whether the object has + * been updated. The value that you specify applies only when your origin adds HTTP headers such as ``Cache-Control + * max-age``, ``Cache-Control s-maxage``, and ``Expires`` to objects. For more information, see [Managing How Long + * Content Stays in an Edge Cache + * (Expiration)](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/Expiration.html) in the *Amazon + * CloudFront Developer Guide*. + * + * @return the maxTtl value. + */ + public Integer maxTtl() { + return this.maxTtl; + } + + /** + * Set the maxTtl property: This field is deprecated. We recommend that you use the ``MaxTTL`` field in a cache + * policy instead of this field. For more information, see [Creating cache + * policies](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/controlling-the-cache-key.html#cache-key-create-cache-policy) + * or [Using the managed cache + * policies](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/using-managed-cache-policies.html) + * in the *Amazon CloudFront Developer Guide*. The maximum amount of time that you want objects to stay in + * CloudFront caches before CloudFront forwards another request to your origin to determine whether the object has + * been updated. The value that you specify applies only when your origin adds HTTP headers such as ``Cache-Control + * max-age``, ``Cache-Control s-maxage``, and ``Expires`` to objects. For more information, see [Managing How Long + * Content Stays in an Edge Cache + * (Expiration)](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/Expiration.html) in the *Amazon + * CloudFront Developer Guide*. + * + * @param maxTtl the maxTtl value to set. + * @return the CacheBehavior object itself. + */ + public CacheBehavior withMaxTtl(Integer maxTtl) { + this.maxTtl = maxTtl; + return this; + } + + /** + * Get the minTtl property: This field is deprecated. We recommend that you use the ``MinTTL`` field in a cache + * policy instead of this field. For more information, see [Creating cache + * policies](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/controlling-the-cache-key.html#cache-key-create-cache-policy) + * or [Using the managed cache + * policies](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/using-managed-cache-policies.html) + * in the *Amazon CloudFront Developer Guide*. The minimum amount of time that you want objects to stay in + * CloudFront caches before CloudFront forwards another request to your origin to determine whether the object has + * been updated. For more information, see [Managing How Long Content Stays in an Edge Cache + * (Expiration)](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/Expiration.html) in the *Amazon + * CloudFront Developer Guide*. You must specify ``0`` for ``MinTTL`` if you configure CloudFront to forward all + * headers to your origin (under ``Headers``, if you specify ``1`` for ``Quantity`` and ``*`` for ``Name``). + * + * @return the minTtl value. + */ + public Integer minTtl() { + return this.minTtl; + } + + /** + * Set the minTtl property: This field is deprecated. We recommend that you use the ``MinTTL`` field in a cache + * policy instead of this field. For more information, see [Creating cache + * policies](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/controlling-the-cache-key.html#cache-key-create-cache-policy) + * or [Using the managed cache + * policies](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/using-managed-cache-policies.html) + * in the *Amazon CloudFront Developer Guide*. The minimum amount of time that you want objects to stay in + * CloudFront caches before CloudFront forwards another request to your origin to determine whether the object has + * been updated. For more information, see [Managing How Long Content Stays in an Edge Cache + * (Expiration)](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/Expiration.html) in the *Amazon + * CloudFront Developer Guide*. You must specify ``0`` for ``MinTTL`` if you configure CloudFront to forward all + * headers to your origin (under ``Headers``, if you specify ``1`` for ``Quantity`` and ``*`` for ``Name``). + * + * @param minTtl the minTtl value to set. + * @return the CacheBehavior object itself. + */ + public CacheBehavior withMinTtl(Integer minTtl) { + this.minTtl = minTtl; + return this; + } + + /** + * Get the originRequestPolicyId property: The unique identifier of the origin request policy that is attached to + * this cache behavior. For more information, see [Creating origin request + * policies](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/controlling-origin-requests.html#origin-request-create-origin-request-policy) + * or [Using the managed origin request + * policies](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/using-managed-origin-request-policies.html) + * in the *Amazon CloudFront Developer Guide*. + * + * @return the originRequestPolicyId value. + */ + public String originRequestPolicyId() { + return this.originRequestPolicyId; + } + + /** + * Set the originRequestPolicyId property: The unique identifier of the origin request policy that is attached to + * this cache behavior. For more information, see [Creating origin request + * policies](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/controlling-origin-requests.html#origin-request-create-origin-request-policy) + * or [Using the managed origin request + * policies](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/using-managed-origin-request-policies.html) + * in the *Amazon CloudFront Developer Guide*. + * + * @param originRequestPolicyId the originRequestPolicyId value to set. + * @return the CacheBehavior object itself. + */ + public CacheBehavior withOriginRequestPolicyId(String originRequestPolicyId) { + this.originRequestPolicyId = originRequestPolicyId; + return this; + } + + /** + * Get the pathPattern property: The pattern (for example, ``images/*.jpg``) that specifies which requests to apply + * the behavior to. When CloudFront receives a viewer request, the requested path is compared with path patterns in + * the order in which cache behaviors are listed in the distribution. You can optionally include a slash (``/``) at + * the beginning of the path pattern. For example, ``/images/*.jpg``. CloudFront behavior is the same with or + * without the leading ``/``. The path pattern for the default cache behavior is ``*`` and cannot be changed. If the + * request for an object does not match the path pattern for any cache behaviors, CloudFront applies the behavior in + * the default cache behavior. For more information, see [Path + * Pattern](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/distribution-web-values-specify.html#DownloadDistValuesPathPattern) + * in the *Amazon CloudFront Developer Guide*. + * + * @return the pathPattern value. + */ + public String pathPattern() { + return this.pathPattern; + } + + /** + * Set the pathPattern property: The pattern (for example, ``images/*.jpg``) that specifies which requests to apply + * the behavior to. When CloudFront receives a viewer request, the requested path is compared with path patterns in + * the order in which cache behaviors are listed in the distribution. You can optionally include a slash (``/``) at + * the beginning of the path pattern. For example, ``/images/*.jpg``. CloudFront behavior is the same with or + * without the leading ``/``. The path pattern for the default cache behavior is ``*`` and cannot be changed. If the + * request for an object does not match the path pattern for any cache behaviors, CloudFront applies the behavior in + * the default cache behavior. For more information, see [Path + * Pattern](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/distribution-web-values-specify.html#DownloadDistValuesPathPattern) + * in the *Amazon CloudFront Developer Guide*. + * + * @param pathPattern the pathPattern value to set. + * @return the CacheBehavior object itself. + */ + public CacheBehavior withPathPattern(String pathPattern) { + this.pathPattern = pathPattern; + return this; + } + + /** + * Get the realtimeLogConfigArn property: The Amazon Resource Name (ARN) of the real-time log configuration that is + * attached to this cache behavior. For more information, see [Real-time + * logs](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/real-time-logs.html) in the *Amazon + * CloudFront Developer Guide*. + * + * @return the realtimeLogConfigArn value. + */ + public String realtimeLogConfigArn() { + return this.realtimeLogConfigArn; + } + + /** + * Set the realtimeLogConfigArn property: The Amazon Resource Name (ARN) of the real-time log configuration that is + * attached to this cache behavior. For more information, see [Real-time + * logs](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/real-time-logs.html) in the *Amazon + * CloudFront Developer Guide*. + * + * @param realtimeLogConfigArn the realtimeLogConfigArn value to set. + * @return the CacheBehavior object itself. + */ + public CacheBehavior withRealtimeLogConfigArn(String realtimeLogConfigArn) { + this.realtimeLogConfigArn = realtimeLogConfigArn; + return this; + } + + /** + * Get the responseHeadersPolicyId property: The identifier for a response headers policy. + * + * @return the responseHeadersPolicyId value. + */ + public String responseHeadersPolicyId() { + return this.responseHeadersPolicyId; + } + + /** + * Set the responseHeadersPolicyId property: The identifier for a response headers policy. + * + * @param responseHeadersPolicyId the responseHeadersPolicyId value to set. + * @return the CacheBehavior object itself. + */ + public CacheBehavior withResponseHeadersPolicyId(String responseHeadersPolicyId) { + this.responseHeadersPolicyId = responseHeadersPolicyId; + return this; + } + + /** + * Get the smoothStreaming property: Indicates whether you want to distribute media files in the Microsoft Smooth + * Streaming format using the origin that is associated with this cache behavior. If so, specify ``true``; if not, + * specify ``false``. If you specify ``true`` for ``SmoothStreaming``, you can still distribute other content using + * this cache behavior if the content matches the value of ``PathPattern``. + * + * @return the smoothStreaming value. + */ + public Boolean smoothStreaming() { + return this.smoothStreaming; + } + + /** + * Set the smoothStreaming property: Indicates whether you want to distribute media files in the Microsoft Smooth + * Streaming format using the origin that is associated with this cache behavior. If so, specify ``true``; if not, + * specify ``false``. If you specify ``true`` for ``SmoothStreaming``, you can still distribute other content using + * this cache behavior if the content matches the value of ``PathPattern``. + * + * @param smoothStreaming the smoothStreaming value to set. + * @return the CacheBehavior object itself. + */ + public CacheBehavior withSmoothStreaming(Boolean smoothStreaming) { + this.smoothStreaming = smoothStreaming; + return this; + } + + /** + * Get the targetOriginId property: The value of ``ID`` for the origin that you want CloudFront to route requests to + * when they match this cache behavior. + * + * @return the targetOriginId value. + */ + public String targetOriginId() { + return this.targetOriginId; + } + + /** + * Set the targetOriginId property: The value of ``ID`` for the origin that you want CloudFront to route requests to + * when they match this cache behavior. + * + * @param targetOriginId the targetOriginId value to set. + * @return the CacheBehavior object itself. + */ + public CacheBehavior withTargetOriginId(String targetOriginId) { + this.targetOriginId = targetOriginId; + return this; + } + + /** + * Get the trustedKeyGroups property: A list of key groups that CloudFront can use to validate signed URLs or signed + * cookies. When a cache behavior contains trusted key groups, CloudFront requires signed URLs or signed cookies for + * all requests that match the cache behavior. The URLs or cookies must be signed with a private key whose + * corresponding public key is in the key group. The signed URL or cookie contains information about which public + * key CloudFront should use to verify the signature. For more information, see [Serving private + * content](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/PrivateContent.html) in the *Amazon + * CloudFront Developer Guide*. + * + * @return the trustedKeyGroups value. + */ + public List trustedKeyGroups() { + return this.trustedKeyGroups; + } + + /** + * Set the trustedKeyGroups property: A list of key groups that CloudFront can use to validate signed URLs or signed + * cookies. When a cache behavior contains trusted key groups, CloudFront requires signed URLs or signed cookies for + * all requests that match the cache behavior. The URLs or cookies must be signed with a private key whose + * corresponding public key is in the key group. The signed URL or cookie contains information about which public + * key CloudFront should use to verify the signature. For more information, see [Serving private + * content](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/PrivateContent.html) in the *Amazon + * CloudFront Developer Guide*. + * + * @param trustedKeyGroups the trustedKeyGroups value to set. + * @return the CacheBehavior object itself. + */ + public CacheBehavior withTrustedKeyGroups(List trustedKeyGroups) { + this.trustedKeyGroups = trustedKeyGroups; + return this; + } + + /** + * Get the trustedSigners property: We recommend using ``TrustedKeyGroups`` instead of ``TrustedSigners``. A list of + * AWS-account IDs whose public keys CloudFront can use to validate signed URLs or signed cookies. When a cache + * behavior contains trusted signers, CloudFront requires signed URLs or signed cookies for all requests that match + * the cache behavior. The URLs or cookies must be signed with the private key of a CloudFront key pair in the + * trusted signer's AWS-account. The signed URL or cookie contains information about which public key CloudFront + * should use to verify the signature. For more information, see [Serving private + * content](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/PrivateContent.html) in the *Amazon + * CloudFront Developer Guide*. + * + * @return the trustedSigners value. + */ + public List trustedSigners() { + return this.trustedSigners; + } + + /** + * Set the trustedSigners property: We recommend using ``TrustedKeyGroups`` instead of ``TrustedSigners``. A list of + * AWS-account IDs whose public keys CloudFront can use to validate signed URLs or signed cookies. When a cache + * behavior contains trusted signers, CloudFront requires signed URLs or signed cookies for all requests that match + * the cache behavior. The URLs or cookies must be signed with the private key of a CloudFront key pair in the + * trusted signer's AWS-account. The signed URL or cookie contains information about which public key CloudFront + * should use to verify the signature. For more information, see [Serving private + * content](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/PrivateContent.html) in the *Amazon + * CloudFront Developer Guide*. + * + * @param trustedSigners the trustedSigners value to set. + * @return the CacheBehavior object itself. + */ + public CacheBehavior withTrustedSigners(List trustedSigners) { + this.trustedSigners = trustedSigners; + return this; + } + + /** + * Get the viewerProtocolPolicy property: The protocol that viewers can use to access the files in the origin + * specified by ``TargetOriginId`` when a request matches the path pattern in ``PathPattern``. You can specify the + * following options: + ``allow-all``: Viewers can use HTTP or HTTPS. + ``redirect-to-https``: If a viewer submits + * an HTTP request, CloudFront returns an HTTP status code of 301 (Moved Permanently) to the viewer along with the + * HTTPS URL. The viewer then resubmits the request using the new URL. + ``https-only``: If a viewer sends an HTTP + * request, CloudFront returns an HTTP status code of 403 (Forbidden). For more information about requiring the + * HTTPS protocol, see [Requiring HTTPS Between Viewers and + * CloudFront](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/using-https-viewers-to-cloudfront.html) + * in the *Amazon CloudFront Developer Guide*. The only way to guarantee that viewers retrieve an object that was + * fetched from the origin using HTTPS is never to use any other protocol to fetch the object. If you have recently + * changed from HTTP to HTTPS, we recommend that you clear your objects' cache because cached objects are protocol + * agnostic. That means that an edge location will return an object from the cache regardless of whether the current + * request protocol matches the protocol used previously. For more information, see [Managing Cache + * Expiration](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/Expiration.html) in the *Amazon + * CloudFront Developer Guide*. + * + * @return the viewerProtocolPolicy value. + */ + public String viewerProtocolPolicy() { + return this.viewerProtocolPolicy; + } + + /** + * Set the viewerProtocolPolicy property: The protocol that viewers can use to access the files in the origin + * specified by ``TargetOriginId`` when a request matches the path pattern in ``PathPattern``. You can specify the + * following options: + ``allow-all``: Viewers can use HTTP or HTTPS. + ``redirect-to-https``: If a viewer submits + * an HTTP request, CloudFront returns an HTTP status code of 301 (Moved Permanently) to the viewer along with the + * HTTPS URL. The viewer then resubmits the request using the new URL. + ``https-only``: If a viewer sends an HTTP + * request, CloudFront returns an HTTP status code of 403 (Forbidden). For more information about requiring the + * HTTPS protocol, see [Requiring HTTPS Between Viewers and + * CloudFront](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/using-https-viewers-to-cloudfront.html) + * in the *Amazon CloudFront Developer Guide*. The only way to guarantee that viewers retrieve an object that was + * fetched from the origin using HTTPS is never to use any other protocol to fetch the object. If you have recently + * changed from HTTP to HTTPS, we recommend that you clear your objects' cache because cached objects are protocol + * agnostic. That means that an edge location will return an object from the cache regardless of whether the current + * request protocol matches the protocol used previously. For more information, see [Managing Cache + * Expiration](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/Expiration.html) in the *Amazon + * CloudFront Developer Guide*. + * + * @param viewerProtocolPolicy the viewerProtocolPolicy value to set. + * @return the CacheBehavior object itself. + */ + public CacheBehavior withViewerProtocolPolicy(String viewerProtocolPolicy) { + this.viewerProtocolPolicy = viewerProtocolPolicy; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (forwardedValues() != null) { + forwardedValues().validate(); + } + if (functionAssociations() != null) { + functionAssociations().forEach(e -> e.validate()); + } + if (lambdaFunctionAssociations() != null) { + lambdaFunctionAssociations().forEach(e -> e.validate()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("allowedMethods", this.allowedMethods, + (writer, element) -> writer.writeString(element)); + jsonWriter.writeStringField("cachePolicyId", this.cachePolicyId); + jsonWriter.writeArrayField("cachedMethods", this.cachedMethods, + (writer, element) -> writer.writeString(element)); + jsonWriter.writeBooleanField("compress", this.compress); + jsonWriter.writeNumberField("defaultTTL", this.defaultTtl); + jsonWriter.writeStringField("fieldLevelEncryptionId", this.fieldLevelEncryptionId); + jsonWriter.writeJsonField("forwardedValues", this.forwardedValues); + jsonWriter.writeArrayField("functionAssociations", this.functionAssociations, + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("lambdaFunctionAssociations", this.lambdaFunctionAssociations, + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeNumberField("maxTTL", this.maxTtl); + jsonWriter.writeNumberField("minTTL", this.minTtl); + jsonWriter.writeStringField("originRequestPolicyId", this.originRequestPolicyId); + jsonWriter.writeStringField("pathPattern", this.pathPattern); + jsonWriter.writeStringField("realtimeLogConfigArn", this.realtimeLogConfigArn); + jsonWriter.writeStringField("responseHeadersPolicyId", this.responseHeadersPolicyId); + jsonWriter.writeBooleanField("smoothStreaming", this.smoothStreaming); + jsonWriter.writeStringField("targetOriginId", this.targetOriginId); + jsonWriter.writeArrayField("trustedKeyGroups", this.trustedKeyGroups, + (writer, element) -> writer.writeString(element)); + jsonWriter.writeArrayField("trustedSigners", this.trustedSigners, + (writer, element) -> writer.writeString(element)); + jsonWriter.writeStringField("viewerProtocolPolicy", this.viewerProtocolPolicy); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of CacheBehavior from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of CacheBehavior if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the CacheBehavior. + */ + public static CacheBehavior fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + CacheBehavior deserializedCacheBehavior = new CacheBehavior(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("allowedMethods".equals(fieldName)) { + List allowedMethods = reader.readArray(reader1 -> reader1.getString()); + deserializedCacheBehavior.allowedMethods = allowedMethods; + } else if ("cachePolicyId".equals(fieldName)) { + deserializedCacheBehavior.cachePolicyId = reader.getString(); + } else if ("cachedMethods".equals(fieldName)) { + List cachedMethods = reader.readArray(reader1 -> reader1.getString()); + deserializedCacheBehavior.cachedMethods = cachedMethods; + } else if ("compress".equals(fieldName)) { + deserializedCacheBehavior.compress = reader.getNullable(JsonReader::getBoolean); + } else if ("defaultTTL".equals(fieldName)) { + deserializedCacheBehavior.defaultTtl = reader.getNullable(JsonReader::getInt); + } else if ("fieldLevelEncryptionId".equals(fieldName)) { + deserializedCacheBehavior.fieldLevelEncryptionId = reader.getString(); + } else if ("forwardedValues".equals(fieldName)) { + deserializedCacheBehavior.forwardedValues = ForwardedValues.fromJson(reader); + } else if ("functionAssociations".equals(fieldName)) { + List functionAssociations + = reader.readArray(reader1 -> FunctionAssociation.fromJson(reader1)); + deserializedCacheBehavior.functionAssociations = functionAssociations; + } else if ("lambdaFunctionAssociations".equals(fieldName)) { + List lambdaFunctionAssociations + = reader.readArray(reader1 -> LambdaFunctionAssociation.fromJson(reader1)); + deserializedCacheBehavior.lambdaFunctionAssociations = lambdaFunctionAssociations; + } else if ("maxTTL".equals(fieldName)) { + deserializedCacheBehavior.maxTtl = reader.getNullable(JsonReader::getInt); + } else if ("minTTL".equals(fieldName)) { + deserializedCacheBehavior.minTtl = reader.getNullable(JsonReader::getInt); + } else if ("originRequestPolicyId".equals(fieldName)) { + deserializedCacheBehavior.originRequestPolicyId = reader.getString(); + } else if ("pathPattern".equals(fieldName)) { + deserializedCacheBehavior.pathPattern = reader.getString(); + } else if ("realtimeLogConfigArn".equals(fieldName)) { + deserializedCacheBehavior.realtimeLogConfigArn = reader.getString(); + } else if ("responseHeadersPolicyId".equals(fieldName)) { + deserializedCacheBehavior.responseHeadersPolicyId = reader.getString(); + } else if ("smoothStreaming".equals(fieldName)) { + deserializedCacheBehavior.smoothStreaming = reader.getNullable(JsonReader::getBoolean); + } else if ("targetOriginId".equals(fieldName)) { + deserializedCacheBehavior.targetOriginId = reader.getString(); + } else if ("trustedKeyGroups".equals(fieldName)) { + List trustedKeyGroups = reader.readArray(reader1 -> reader1.getString()); + deserializedCacheBehavior.trustedKeyGroups = trustedKeyGroups; + } else if ("trustedSigners".equals(fieldName)) { + List trustedSigners = reader.readArray(reader1 -> reader1.getString()); + deserializedCacheBehavior.trustedSigners = trustedSigners; + } else if ("viewerProtocolPolicy".equals(fieldName)) { + deserializedCacheBehavior.viewerProtocolPolicy = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedCacheBehavior; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/CacheMode.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/CacheMode.java new file mode 100644 index 000000000000..2e92aaca4ee4 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/CacheMode.java @@ -0,0 +1,56 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * CacheMode enum. + */ +public final class CacheMode extends ExpandableStringEnum { + /** + * Static value LOCAL_CUSTOM_CACHE for CacheMode. + */ + public static final CacheMode LOCAL_CUSTOM_CACHE = fromString("LOCAL_CUSTOM_CACHE"); + + /** + * Static value LOCAL_DOCKER_LAYER_CACHE for CacheMode. + */ + public static final CacheMode LOCAL_DOCKER_LAYER_CACHE = fromString("LOCAL_DOCKER_LAYER_CACHE"); + + /** + * Static value LOCAL_SOURCE_CACHE for CacheMode. + */ + public static final CacheMode LOCAL_SOURCE_CACHE = fromString("LOCAL_SOURCE_CACHE"); + + /** + * Creates a new instance of CacheMode value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public CacheMode() { + } + + /** + * Creates or finds a CacheMode from its string representation. + * + * @param name a name to look for. + * @return the corresponding CacheMode. + */ + public static CacheMode fromString(String name) { + return fromString(name, CacheMode.class); + } + + /** + * Gets known CacheMode values. + * + * @return known CacheMode values. + */ + public static Collection values() { + return values(CacheMode.class); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/CacheType.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/CacheType.java new file mode 100644 index 000000000000..e4f2f6dedc3d --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/CacheType.java @@ -0,0 +1,56 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * CacheType enum. + */ +public final class CacheType extends ExpandableStringEnum { + /** + * Static value LOCAL for CacheType. + */ + public static final CacheType LOCAL = fromString("LOCAL"); + + /** + * Static value NO_CACHE for CacheType. + */ + public static final CacheType NO_CACHE = fromString("NO_CACHE"); + + /** + * Static value S3 for CacheType. + */ + public static final CacheType S3 = fromString("S3"); + + /** + * Creates a new instance of CacheType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public CacheType() { + } + + /** + * Creates or finds a CacheType from its string representation. + * + * @param name a name to look for. + * @return the corresponding CacheType. + */ + public static CacheType fromString(String name) { + return fromString(name, CacheType.class); + } + + /** + * Gets known CacheType values. + * + * @return known CacheType values. + */ + public static Collection values() { + return values(CacheType.class); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/CacheTypeEnumValue.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/CacheTypeEnumValue.java new file mode 100644 index 000000000000..c11f4c570eb2 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/CacheTypeEnumValue.java @@ -0,0 +1,93 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of CacheTypeEnumValue. + */ +@Fluent +public final class CacheTypeEnumValue implements JsonSerializable { + /* + * Property value + */ + private CacheType value; + + /** + * Creates an instance of CacheTypeEnumValue class. + */ + public CacheTypeEnumValue() { + } + + /** + * Get the value property: Property value. + * + * @return the value value. + */ + public CacheType value() { + return this.value; + } + + /** + * Set the value property: Property value. + * + * @param value the value value to set. + * @return the CacheTypeEnumValue object itself. + */ + public CacheTypeEnumValue withValue(CacheType value) { + this.value = value; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("value", this.value == null ? null : this.value.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of CacheTypeEnumValue from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of CacheTypeEnumValue if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the CacheTypeEnumValue. + */ + public static CacheTypeEnumValue fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + CacheTypeEnumValue deserializedCacheTypeEnumValue = new CacheTypeEnumValue(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + deserializedCacheTypeEnumValue.value = CacheType.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedCacheTypeEnumValue; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/CallAs.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/CallAs.java new file mode 100644 index 000000000000..7308b6039b55 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/CallAs.java @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * CallAs enum. + */ +public final class CallAs extends ExpandableStringEnum { + /** + * Static value DELEGATED_ADMIN for CallAs. + */ + public static final CallAs DELEGATED_ADMIN = fromString("DELEGATED_ADMIN"); + + /** + * Static value SELF for CallAs. + */ + public static final CallAs SELF = fromString("SELF"); + + /** + * Creates a new instance of CallAs value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public CallAs() { + } + + /** + * Creates or finds a CallAs from its string representation. + * + * @param name a name to look for. + * @return the corresponding CallAs. + */ + public static CallAs fromString(String name) { + return fromString(name, CallAs.class); + } + + /** + * Gets known CallAs values. + * + * @return known CallAs values. + */ + public static Collection values() { + return values(CallAs.class); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/CanarySetting.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/CanarySetting.java new file mode 100644 index 000000000000..e8708dd16e11 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/CanarySetting.java @@ -0,0 +1,188 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.Map; + +/** + * Definition of CanarySetting. + */ +@Fluent +public final class CanarySetting implements JsonSerializable { + /* + * The ID of the canary deployment. + */ + private String deploymentId; + + /* + * The percent (0-100) of traffic diverted to a canary deployment. + */ + private Integer percentTraffic; + + /* + * Stage variables overridden for a canary release deployment, including new stage variables introduced in the + * canary. These stage variables are represented as a string-to-string map between stage variable names and their + * values. + */ + private Map stageVariableOverrides; + + /* + * A Boolean flag to indicate whether the canary deployment uses the stage cache or not. + */ + private Boolean useStageCache; + + /** + * Creates an instance of CanarySetting class. + */ + public CanarySetting() { + } + + /** + * Get the deploymentId property: The ID of the canary deployment. + * + * @return the deploymentId value. + */ + public String deploymentId() { + return this.deploymentId; + } + + /** + * Set the deploymentId property: The ID of the canary deployment. + * + * @param deploymentId the deploymentId value to set. + * @return the CanarySetting object itself. + */ + public CanarySetting withDeploymentId(String deploymentId) { + this.deploymentId = deploymentId; + return this; + } + + /** + * Get the percentTraffic property: The percent (0-100) of traffic diverted to a canary deployment. + * + * @return the percentTraffic value. + */ + public Integer percentTraffic() { + return this.percentTraffic; + } + + /** + * Set the percentTraffic property: The percent (0-100) of traffic diverted to a canary deployment. + * + * @param percentTraffic the percentTraffic value to set. + * @return the CanarySetting object itself. + */ + public CanarySetting withPercentTraffic(Integer percentTraffic) { + this.percentTraffic = percentTraffic; + return this; + } + + /** + * Get the stageVariableOverrides property: Stage variables overridden for a canary release deployment, including + * new stage variables introduced in the canary. These stage variables are represented as a string-to-string map + * between stage variable names and their values. + * + * @return the stageVariableOverrides value. + */ + public Map stageVariableOverrides() { + return this.stageVariableOverrides; + } + + /** + * Set the stageVariableOverrides property: Stage variables overridden for a canary release deployment, including + * new stage variables introduced in the canary. These stage variables are represented as a string-to-string map + * between stage variable names and their values. + * + * @param stageVariableOverrides the stageVariableOverrides value to set. + * @return the CanarySetting object itself. + */ + public CanarySetting withStageVariableOverrides(Map stageVariableOverrides) { + this.stageVariableOverrides = stageVariableOverrides; + return this; + } + + /** + * Get the useStageCache property: A Boolean flag to indicate whether the canary deployment uses the stage cache or + * not. + * + * @return the useStageCache value. + */ + public Boolean useStageCache() { + return this.useStageCache; + } + + /** + * Set the useStageCache property: A Boolean flag to indicate whether the canary deployment uses the stage cache or + * not. + * + * @param useStageCache the useStageCache value to set. + * @return the CanarySetting object itself. + */ + public CanarySetting withUseStageCache(Boolean useStageCache) { + this.useStageCache = useStageCache; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("deploymentId", this.deploymentId); + jsonWriter.writeNumberField("percentTraffic", this.percentTraffic); + jsonWriter.writeMapField("stageVariableOverrides", this.stageVariableOverrides, + (writer, element) -> writer.writeString(element)); + jsonWriter.writeBooleanField("useStageCache", this.useStageCache); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of CanarySetting from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of CanarySetting if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the CanarySetting. + */ + public static CanarySetting fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + CanarySetting deserializedCanarySetting = new CanarySetting(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("deploymentId".equals(fieldName)) { + deserializedCanarySetting.deploymentId = reader.getString(); + } else if ("percentTraffic".equals(fieldName)) { + deserializedCanarySetting.percentTraffic = reader.getNullable(JsonReader::getInt); + } else if ("stageVariableOverrides".equals(fieldName)) { + Map stageVariableOverrides = reader.readMap(reader1 -> reader1.getString()); + deserializedCanarySetting.stageVariableOverrides = stageVariableOverrides; + } else if ("useStageCache".equals(fieldName)) { + deserializedCanarySetting.useStageCache = reader.getNullable(JsonReader::getBoolean); + } else { + reader.skipChildren(); + } + } + + return deserializedCanarySetting; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/Capabilities.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/Capabilities.java new file mode 100644 index 000000000000..839e56095e9e --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/Capabilities.java @@ -0,0 +1,56 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Capabilities enum. + */ +public final class Capabilities extends ExpandableStringEnum { + /** + * Static value CAPABILITY_AUTO_EXPAND for Capabilities. + */ + public static final Capabilities CAPABILITY_AUTO_EXPAND = fromString("CAPABILITY_AUTO_EXPAND"); + + /** + * Static value CAPABILITY_IAM for Capabilities. + */ + public static final Capabilities CAPABILITY_IAM = fromString("CAPABILITY_IAM"); + + /** + * Static value CAPABILITY_NAMED_IAM for Capabilities. + */ + public static final Capabilities CAPABILITY_NAMED_IAM = fromString("CAPABILITY_NAMED_IAM"); + + /** + * Creates a new instance of Capabilities value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public Capabilities() { + } + + /** + * Creates or finds a Capabilities from its string representation. + * + * @param name a name to look for. + * @return the corresponding Capabilities. + */ + public static Capabilities fromString(String name) { + return fromString(name, Capabilities.class); + } + + /** + * Gets known Capabilities values. + * + * @return known Capabilities values. + */ + public static Collection values() { + return values(Capabilities.class); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/CapacityProviderStrategyItem.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/CapacityProviderStrategyItem.java new file mode 100644 index 000000000000..ffc5b8874027 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/CapacityProviderStrategyItem.java @@ -0,0 +1,187 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of CapacityProviderStrategyItem. + */ +@Fluent +public final class CapacityProviderStrategyItem implements JsonSerializable { + /* + * The *base* value designates how many tasks, at a minimum, to run on the specified capacity provider. Only one + * capacity provider in a capacity provider strategy can have a *base* defined. If no value is specified, the + * default value of ``0`` is used. + */ + private Integer base; + + /* + * The short name of the capacity provider. + */ + private String capacityProvider; + + /* + * The *weight* value designates the relative percentage of the total number of tasks launched that should use the + * specified capacity provider. The ``weight`` value is taken into consideration after the ``base`` value, if + * defined, is satisfied. If no ``weight`` value is specified, the default value of ``0`` is used. When multiple + * capacity providers are specified within a capacity provider strategy, at least one of the capacity providers must + * have a weight value greater than zero and any capacity providers with a weight of ``0`` can't be used to place + * tasks. If you specify multiple capacity providers in a strategy that all have a weight of ``0``, any ``RunTask`` + * or ``CreateService`` actions using the capacity provider strategy will fail. An example scenario for using + * weights is defining a strategy that contains two capacity providers and both have a weight of ``1``, then when + * the ``base`` is satisfied, the tasks will be split evenly across the two capacity providers. Using that same + * logic, if you specify a weight of ``1`` for *capacityProviderA* and a weight of ``4`` for *capacityProviderB*, + * then for every one task that's run using *capacityProviderA*, four tasks would use *capacityProviderB*. + */ + private Integer weight; + + /** + * Creates an instance of CapacityProviderStrategyItem class. + */ + public CapacityProviderStrategyItem() { + } + + /** + * Get the base property: The *base* value designates how many tasks, at a minimum, to run on the specified capacity + * provider. Only one capacity provider in a capacity provider strategy can have a *base* defined. If no value is + * specified, the default value of ``0`` is used. + * + * @return the base value. + */ + public Integer base() { + return this.base; + } + + /** + * Set the base property: The *base* value designates how many tasks, at a minimum, to run on the specified capacity + * provider. Only one capacity provider in a capacity provider strategy can have a *base* defined. If no value is + * specified, the default value of ``0`` is used. + * + * @param base the base value to set. + * @return the CapacityProviderStrategyItem object itself. + */ + public CapacityProviderStrategyItem withBase(Integer base) { + this.base = base; + return this; + } + + /** + * Get the capacityProvider property: The short name of the capacity provider. + * + * @return the capacityProvider value. + */ + public String capacityProvider() { + return this.capacityProvider; + } + + /** + * Set the capacityProvider property: The short name of the capacity provider. + * + * @param capacityProvider the capacityProvider value to set. + * @return the CapacityProviderStrategyItem object itself. + */ + public CapacityProviderStrategyItem withCapacityProvider(String capacityProvider) { + this.capacityProvider = capacityProvider; + return this; + } + + /** + * Get the weight property: The *weight* value designates the relative percentage of the total number of tasks + * launched that should use the specified capacity provider. The ``weight`` value is taken into consideration after + * the ``base`` value, if defined, is satisfied. If no ``weight`` value is specified, the default value of ``0`` is + * used. When multiple capacity providers are specified within a capacity provider strategy, at least one of the + * capacity providers must have a weight value greater than zero and any capacity providers with a weight of ``0`` + * can't be used to place tasks. If you specify multiple capacity providers in a strategy that all have a weight of + * ``0``, any ``RunTask`` or ``CreateService`` actions using the capacity provider strategy will fail. An example + * scenario for using weights is defining a strategy that contains two capacity providers and both have a weight of + * ``1``, then when the ``base`` is satisfied, the tasks will be split evenly across the two capacity providers. + * Using that same logic, if you specify a weight of ``1`` for *capacityProviderA* and a weight of ``4`` for + * *capacityProviderB*, then for every one task that's run using *capacityProviderA*, four tasks would use + * *capacityProviderB*. + * + * @return the weight value. + */ + public Integer weight() { + return this.weight; + } + + /** + * Set the weight property: The *weight* value designates the relative percentage of the total number of tasks + * launched that should use the specified capacity provider. The ``weight`` value is taken into consideration after + * the ``base`` value, if defined, is satisfied. If no ``weight`` value is specified, the default value of ``0`` is + * used. When multiple capacity providers are specified within a capacity provider strategy, at least one of the + * capacity providers must have a weight value greater than zero and any capacity providers with a weight of ``0`` + * can't be used to place tasks. If you specify multiple capacity providers in a strategy that all have a weight of + * ``0``, any ``RunTask`` or ``CreateService`` actions using the capacity provider strategy will fail. An example + * scenario for using weights is defining a strategy that contains two capacity providers and both have a weight of + * ``1``, then when the ``base`` is satisfied, the tasks will be split evenly across the two capacity providers. + * Using that same logic, if you specify a weight of ``1`` for *capacityProviderA* and a weight of ``4`` for + * *capacityProviderB*, then for every one task that's run using *capacityProviderA*, four tasks would use + * *capacityProviderB*. + * + * @param weight the weight value to set. + * @return the CapacityProviderStrategyItem object itself. + */ + public CapacityProviderStrategyItem withWeight(Integer weight) { + this.weight = weight; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeNumberField("base", this.base); + jsonWriter.writeStringField("capacityProvider", this.capacityProvider); + jsonWriter.writeNumberField("weight", this.weight); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of CapacityProviderStrategyItem from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of CapacityProviderStrategyItem if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the CapacityProviderStrategyItem. + */ + public static CapacityProviderStrategyItem fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + CapacityProviderStrategyItem deserializedCapacityProviderStrategyItem = new CapacityProviderStrategyItem(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("base".equals(fieldName)) { + deserializedCapacityProviderStrategyItem.base = reader.getNullable(JsonReader::getInt); + } else if ("capacityProvider".equals(fieldName)) { + deserializedCapacityProviderStrategyItem.capacityProvider = reader.getString(); + } else if ("weight".equals(fieldName)) { + deserializedCapacityProviderStrategyItem.weight = reader.getNullable(JsonReader::getInt); + } else { + reader.skipChildren(); + } + } + + return deserializedCapacityProviderStrategyItem; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/CapacityReservationPreference.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/CapacityReservationPreference.java new file mode 100644 index 000000000000..c0bd687409ed --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/CapacityReservationPreference.java @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * CapacityReservationPreference enum. + */ +public final class CapacityReservationPreference extends ExpandableStringEnum { + /** + * Static value none for CapacityReservationPreference. + */ + public static final CapacityReservationPreference NONE = fromString("none"); + + /** + * Static value open for CapacityReservationPreference. + */ + public static final CapacityReservationPreference OPEN = fromString("open"); + + /** + * Creates a new instance of CapacityReservationPreference value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public CapacityReservationPreference() { + } + + /** + * Creates or finds a CapacityReservationPreference from its string representation. + * + * @param name a name to look for. + * @return the corresponding CapacityReservationPreference. + */ + public static CapacityReservationPreference fromString(String name) { + return fromString(name, CapacityReservationPreference.class); + } + + /** + * Gets known CapacityReservationPreference values. + * + * @return known CapacityReservationPreference values. + */ + public static Collection values() { + return values(CapacityReservationPreference.class); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/CapacityReservationPreferenceEnumValue.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/CapacityReservationPreferenceEnumValue.java new file mode 100644 index 000000000000..e33c4c1ed1cb --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/CapacityReservationPreferenceEnumValue.java @@ -0,0 +1,96 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of CapacityReservationPreferenceEnumValue. + */ +@Fluent +public final class CapacityReservationPreferenceEnumValue + implements JsonSerializable { + /* + * Property value + */ + private CapacityReservationPreference value; + + /** + * Creates an instance of CapacityReservationPreferenceEnumValue class. + */ + public CapacityReservationPreferenceEnumValue() { + } + + /** + * Get the value property: Property value. + * + * @return the value value. + */ + public CapacityReservationPreference value() { + return this.value; + } + + /** + * Set the value property: Property value. + * + * @param value the value value to set. + * @return the CapacityReservationPreferenceEnumValue object itself. + */ + public CapacityReservationPreferenceEnumValue withValue(CapacityReservationPreference value) { + this.value = value; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("value", this.value == null ? null : this.value.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of CapacityReservationPreferenceEnumValue from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of CapacityReservationPreferenceEnumValue if the JsonReader was pointing to an instance of + * it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the CapacityReservationPreferenceEnumValue. + */ + public static CapacityReservationPreferenceEnumValue fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + CapacityReservationPreferenceEnumValue deserializedCapacityReservationPreferenceEnumValue + = new CapacityReservationPreferenceEnumValue(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + deserializedCapacityReservationPreferenceEnumValue.value + = CapacityReservationPreference.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedCapacityReservationPreferenceEnumValue; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/CapacityReservationSpecificationResponse.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/CapacityReservationSpecificationResponse.java new file mode 100644 index 000000000000..505e81674bf4 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/CapacityReservationSpecificationResponse.java @@ -0,0 +1,149 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of CapacityReservationSpecificationResponse. + */ +@Fluent +public final class CapacityReservationSpecificationResponse + implements JsonSerializable { + /* + *

Describes the instance's Capacity Reservation preferences. Possible preferences include:

  • + * open - The instance can run in any open Capacity Reservation that has matching + * attributes (instance type, platform, Availability Zone).

  • none - The instance + * avoids running in a Capacity Reservation even if one is available. The instance runs in On-Demand capacity.

    + *
+ */ + private CapacityReservationPreferenceEnumValue capacityReservationPreference; + + /* + *

Information about the targeted Capacity Reservation or Capacity Reservation group.

+ */ + private CapacityReservationTargetResponse capacityReservationTarget; + + /** + * Creates an instance of CapacityReservationSpecificationResponse class. + */ + public CapacityReservationSpecificationResponse() { + } + + /** + * Get the capacityReservationPreference property: <p>Describes the instance's Capacity Reservation + * preferences. Possible preferences include:</p> <ul> <li> <p> + * <code>open</code> - The instance can run in any <code>open</code> Capacity Reservation + * that has matching attributes (instance type, platform, Availability Zone).</p> </li> <li> + * <p> <code>none</code> - The instance avoids running in a Capacity Reservation even if one is + * available. The instance runs in On-Demand capacity.</p> </li> </ul>. + * + * @return the capacityReservationPreference value. + */ + public CapacityReservationPreferenceEnumValue capacityReservationPreference() { + return this.capacityReservationPreference; + } + + /** + * Set the capacityReservationPreference property: <p>Describes the instance's Capacity Reservation + * preferences. Possible preferences include:</p> <ul> <li> <p> + * <code>open</code> - The instance can run in any <code>open</code> Capacity Reservation + * that has matching attributes (instance type, platform, Availability Zone).</p> </li> <li> + * <p> <code>none</code> - The instance avoids running in a Capacity Reservation even if one is + * available. The instance runs in On-Demand capacity.</p> </li> </ul>. + * + * @param capacityReservationPreference the capacityReservationPreference value to set. + * @return the CapacityReservationSpecificationResponse object itself. + */ + public CapacityReservationSpecificationResponse + withCapacityReservationPreference(CapacityReservationPreferenceEnumValue capacityReservationPreference) { + this.capacityReservationPreference = capacityReservationPreference; + return this; + } + + /** + * Get the capacityReservationTarget property: <p>Information about the targeted Capacity Reservation or + * Capacity Reservation group.</p>. + * + * @return the capacityReservationTarget value. + */ + public CapacityReservationTargetResponse capacityReservationTarget() { + return this.capacityReservationTarget; + } + + /** + * Set the capacityReservationTarget property: <p>Information about the targeted Capacity Reservation or + * Capacity Reservation group.</p>. + * + * @param capacityReservationTarget the capacityReservationTarget value to set. + * @return the CapacityReservationSpecificationResponse object itself. + */ + public CapacityReservationSpecificationResponse + withCapacityReservationTarget(CapacityReservationTargetResponse capacityReservationTarget) { + this.capacityReservationTarget = capacityReservationTarget; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (capacityReservationPreference() != null) { + capacityReservationPreference().validate(); + } + if (capacityReservationTarget() != null) { + capacityReservationTarget().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("capacityReservationPreference", this.capacityReservationPreference); + jsonWriter.writeJsonField("capacityReservationTarget", this.capacityReservationTarget); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of CapacityReservationSpecificationResponse from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of CapacityReservationSpecificationResponse if the JsonReader was pointing to an instance of + * it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the CapacityReservationSpecificationResponse. + */ + public static CapacityReservationSpecificationResponse fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + CapacityReservationSpecificationResponse deserializedCapacityReservationSpecificationResponse + = new CapacityReservationSpecificationResponse(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("capacityReservationPreference".equals(fieldName)) { + deserializedCapacityReservationSpecificationResponse.capacityReservationPreference + = CapacityReservationPreferenceEnumValue.fromJson(reader); + } else if ("capacityReservationTarget".equals(fieldName)) { + deserializedCapacityReservationSpecificationResponse.capacityReservationTarget + = CapacityReservationTargetResponse.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedCapacityReservationSpecificationResponse; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/CapacityReservationTargetResponse.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/CapacityReservationTargetResponse.java new file mode 100644 index 000000000000..041040841d56 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/CapacityReservationTargetResponse.java @@ -0,0 +1,126 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of CapacityReservationTargetResponse. + */ +@Fluent +public final class CapacityReservationTargetResponse implements JsonSerializable { + /* + *

The ID of the targeted Capacity Reservation.

+ */ + private String capacityReservationId; + + /* + *

The ARN of the targeted Capacity Reservation group.

+ */ + private String capacityReservationResourceGroupArn; + + /** + * Creates an instance of CapacityReservationTargetResponse class. + */ + public CapacityReservationTargetResponse() { + } + + /** + * Get the capacityReservationId property: <p>The ID of the targeted Capacity Reservation.</p>. + * + * @return the capacityReservationId value. + */ + public String capacityReservationId() { + return this.capacityReservationId; + } + + /** + * Set the capacityReservationId property: <p>The ID of the targeted Capacity Reservation.</p>. + * + * @param capacityReservationId the capacityReservationId value to set. + * @return the CapacityReservationTargetResponse object itself. + */ + public CapacityReservationTargetResponse withCapacityReservationId(String capacityReservationId) { + this.capacityReservationId = capacityReservationId; + return this; + } + + /** + * Get the capacityReservationResourceGroupArn property: <p>The ARN of the targeted Capacity Reservation + * group.</p>. + * + * @return the capacityReservationResourceGroupArn value. + */ + public String capacityReservationResourceGroupArn() { + return this.capacityReservationResourceGroupArn; + } + + /** + * Set the capacityReservationResourceGroupArn property: <p>The ARN of the targeted Capacity Reservation + * group.</p>. + * + * @param capacityReservationResourceGroupArn the capacityReservationResourceGroupArn value to set. + * @return the CapacityReservationTargetResponse object itself. + */ + public CapacityReservationTargetResponse + withCapacityReservationResourceGroupArn(String capacityReservationResourceGroupArn) { + this.capacityReservationResourceGroupArn = capacityReservationResourceGroupArn; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("capacityReservationId", this.capacityReservationId); + jsonWriter.writeStringField("capacityReservationResourceGroupArn", this.capacityReservationResourceGroupArn); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of CapacityReservationTargetResponse from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of CapacityReservationTargetResponse if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the CapacityReservationTargetResponse. + */ + public static CapacityReservationTargetResponse fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + CapacityReservationTargetResponse deserializedCapacityReservationTargetResponse + = new CapacityReservationTargetResponse(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("capacityReservationId".equals(fieldName)) { + deserializedCapacityReservationTargetResponse.capacityReservationId = reader.getString(); + } else if ("capacityReservationResourceGroupArn".equals(fieldName)) { + deserializedCapacityReservationTargetResponse.capacityReservationResourceGroupArn + = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedCapacityReservationTargetResponse; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/Certificate.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/Certificate.java new file mode 100644 index 000000000000..5d7214d8b69e --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/Certificate.java @@ -0,0 +1,98 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of Certificate. + */ +@Fluent +public final class Certificate implements JsonSerializable { + /* + *

The Base64-encoded certificate data required to communicate with your cluster. Add this to the + * certificate-authority-data section of the kubeconfig file for your cluster.

+ */ + private String data; + + /** + * Creates an instance of Certificate class. + */ + public Certificate() { + } + + /** + * Get the data property: <p>The Base64-encoded certificate data required to communicate with your cluster. + * Add this to the <code>certificate-authority-data</code> section of the + * <code>kubeconfig</code> file for your cluster.</p>. + * + * @return the data value. + */ + public String data() { + return this.data; + } + + /** + * Set the data property: <p>The Base64-encoded certificate data required to communicate with your cluster. + * Add this to the <code>certificate-authority-data</code> section of the + * <code>kubeconfig</code> file for your cluster.</p>. + * + * @param data the data value to set. + * @return the Certificate object itself. + */ + public Certificate withData(String data) { + this.data = data; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("data", this.data); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of Certificate from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of Certificate if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the Certificate. + */ + public static Certificate fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + Certificate deserializedCertificate = new Certificate(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("data".equals(fieldName)) { + deserializedCertificate.data = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedCertificate; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/CertificateAutoGenerated.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/CertificateAutoGenerated.java new file mode 100644 index 000000000000..123667a0df62 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/CertificateAutoGenerated.java @@ -0,0 +1,93 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of Certificate. + */ +@Fluent +public final class CertificateAutoGenerated implements JsonSerializable { + /* + * The Amazon Resource Name (ARN) of the certificate. + */ + private String certificateArn; + + /** + * Creates an instance of CertificateAutoGenerated class. + */ + public CertificateAutoGenerated() { + } + + /** + * Get the certificateArn property: The Amazon Resource Name (ARN) of the certificate. + * + * @return the certificateArn value. + */ + public String certificateArn() { + return this.certificateArn; + } + + /** + * Set the certificateArn property: The Amazon Resource Name (ARN) of the certificate. + * + * @param certificateArn the certificateArn value to set. + * @return the CertificateAutoGenerated object itself. + */ + public CertificateAutoGenerated withCertificateArn(String certificateArn) { + this.certificateArn = certificateArn; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("certificateArn", this.certificateArn); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of CertificateAutoGenerated from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of CertificateAutoGenerated if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IOException If an error occurs while reading the CertificateAutoGenerated. + */ + public static CertificateAutoGenerated fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + CertificateAutoGenerated deserializedCertificateAutoGenerated = new CertificateAutoGenerated(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("certificateArn".equals(fieldName)) { + deserializedCertificateAutoGenerated.certificateArn = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedCertificateAutoGenerated; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/CertificateDetails.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/CertificateDetails.java new file mode 100644 index 000000000000..30867ed7c0f7 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/CertificateDetails.java @@ -0,0 +1,123 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of CertificateDetails. + */ +@Fluent +public final class CertificateDetails implements JsonSerializable { + /* + * The CA identifier of the CA certificate used for the DB instance's server certificate. + */ + private String caIdentifier; + + /* + * The expiration date of the DB instance’s server certificate. + */ + private String validTill; + + /** + * Creates an instance of CertificateDetails class. + */ + public CertificateDetails() { + } + + /** + * Get the caIdentifier property: The CA identifier of the CA certificate used for the DB instance's server + * certificate. + * + * @return the caIdentifier value. + */ + public String caIdentifier() { + return this.caIdentifier; + } + + /** + * Set the caIdentifier property: The CA identifier of the CA certificate used for the DB instance's server + * certificate. + * + * @param caIdentifier the caIdentifier value to set. + * @return the CertificateDetails object itself. + */ + public CertificateDetails withCaIdentifier(String caIdentifier) { + this.caIdentifier = caIdentifier; + return this; + } + + /** + * Get the validTill property: The expiration date of the DB instance’s server certificate. + * + * @return the validTill value. + */ + public String validTill() { + return this.validTill; + } + + /** + * Set the validTill property: The expiration date of the DB instance’s server certificate. + * + * @param validTill the validTill value to set. + * @return the CertificateDetails object itself. + */ + public CertificateDetails withValidTill(String validTill) { + this.validTill = validTill; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("caIdentifier", this.caIdentifier); + jsonWriter.writeStringField("validTill", this.validTill); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of CertificateDetails from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of CertificateDetails if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the CertificateDetails. + */ + public static CertificateDetails fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + CertificateDetails deserializedCertificateDetails = new CertificateDetails(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("caIdentifier".equals(fieldName)) { + deserializedCertificateDetails.caIdentifier = reader.getString(); + } else if ("validTill".equals(fieldName)) { + deserializedCertificateDetails.validTill = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedCertificateDetails; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/CertificateStatus.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/CertificateStatus.java new file mode 100644 index 000000000000..91ce6e05674b --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/CertificateStatus.java @@ -0,0 +1,76 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * CertificateStatus enum. + */ +public final class CertificateStatus extends ExpandableStringEnum { + /** + * Static value EXPIRED for CertificateStatus. + */ + public static final CertificateStatus EXPIRED = fromString("EXPIRED"); + + /** + * Static value FAILED for CertificateStatus. + */ + public static final CertificateStatus FAILED = fromString("FAILED"); + + /** + * Static value INACTIVE for CertificateStatus. + */ + public static final CertificateStatus INACTIVE = fromString("INACTIVE"); + + /** + * Static value ISSUED for CertificateStatus. + */ + public static final CertificateStatus ISSUED = fromString("ISSUED"); + + /** + * Static value PENDING_VALIDATION for CertificateStatus. + */ + public static final CertificateStatus PENDING_VALIDATION = fromString("PENDING_VALIDATION"); + + /** + * Static value REVOKED for CertificateStatus. + */ + public static final CertificateStatus REVOKED = fromString("REVOKED"); + + /** + * Static value VALIDATION_TIMED_OUT for CertificateStatus. + */ + public static final CertificateStatus VALIDATION_TIMED_OUT = fromString("VALIDATION_TIMED_OUT"); + + /** + * Creates a new instance of CertificateStatus value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public CertificateStatus() { + } + + /** + * Creates or finds a CertificateStatus from its string representation. + * + * @param name a name to look for. + * @return the corresponding CertificateStatus. + */ + public static CertificateStatus fromString(String name) { + return fromString(name, CertificateStatus.class); + } + + /** + * Gets known CertificateStatus values. + * + * @return known CertificateStatus values. + */ + public static Collection values() { + return values(CertificateStatus.class); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/CertificateStatusEnumValue.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/CertificateStatusEnumValue.java new file mode 100644 index 000000000000..3f00479bba61 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/CertificateStatusEnumValue.java @@ -0,0 +1,93 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of CertificateStatusEnumValue. + */ +@Fluent +public final class CertificateStatusEnumValue implements JsonSerializable { + /* + * Property value + */ + private CertificateStatus value; + + /** + * Creates an instance of CertificateStatusEnumValue class. + */ + public CertificateStatusEnumValue() { + } + + /** + * Get the value property: Property value. + * + * @return the value value. + */ + public CertificateStatus value() { + return this.value; + } + + /** + * Set the value property: Property value. + * + * @param value the value value to set. + * @return the CertificateStatusEnumValue object itself. + */ + public CertificateStatusEnumValue withValue(CertificateStatus value) { + this.value = value; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("value", this.value == null ? null : this.value.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of CertificateStatusEnumValue from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of CertificateStatusEnumValue if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IOException If an error occurs while reading the CertificateStatusEnumValue. + */ + public static CertificateStatusEnumValue fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + CertificateStatusEnumValue deserializedCertificateStatusEnumValue = new CertificateStatusEnumValue(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + deserializedCertificateStatusEnumValue.value = CertificateStatus.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedCertificateStatusEnumValue; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/CertificateType.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/CertificateType.java new file mode 100644 index 000000000000..2e59730fa1a4 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/CertificateType.java @@ -0,0 +1,56 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * CertificateType enum. + */ +public final class CertificateType extends ExpandableStringEnum { + /** + * Static value AMAZON_ISSUED for CertificateType. + */ + public static final CertificateType AMAZON_ISSUED = fromString("AMAZON_ISSUED"); + + /** + * Static value IMPORTED for CertificateType. + */ + public static final CertificateType IMPORTED = fromString("IMPORTED"); + + /** + * Static value PRIVATE for CertificateType. + */ + public static final CertificateType PRIVATE = fromString("PRIVATE"); + + /** + * Creates a new instance of CertificateType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public CertificateType() { + } + + /** + * Creates or finds a CertificateType from its string representation. + * + * @param name a name to look for. + * @return the corresponding CertificateType. + */ + public static CertificateType fromString(String name) { + return fromString(name, CertificateType.class); + } + + /** + * Gets known CertificateType values. + * + * @return known CertificateType values. + */ + public static Collection values() { + return values(CertificateType.class); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/CertificateTypeEnumValue.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/CertificateTypeEnumValue.java new file mode 100644 index 000000000000..1fdb5ecc7ddb --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/CertificateTypeEnumValue.java @@ -0,0 +1,93 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of CertificateTypeEnumValue. + */ +@Fluent +public final class CertificateTypeEnumValue implements JsonSerializable { + /* + * Property value + */ + private CertificateType value; + + /** + * Creates an instance of CertificateTypeEnumValue class. + */ + public CertificateTypeEnumValue() { + } + + /** + * Get the value property: Property value. + * + * @return the value value. + */ + public CertificateType value() { + return this.value; + } + + /** + * Set the value property: Property value. + * + * @param value the value value to set. + * @return the CertificateTypeEnumValue object itself. + */ + public CertificateTypeEnumValue withValue(CertificateType value) { + this.value = value; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("value", this.value == null ? null : this.value.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of CertificateTypeEnumValue from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of CertificateTypeEnumValue if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IOException If an error occurs while reading the CertificateTypeEnumValue. + */ + public static CertificateTypeEnumValue fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + CertificateTypeEnumValue deserializedCertificateTypeEnumValue = new CertificateTypeEnumValue(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + deserializedCertificateTypeEnumValue.value = CertificateType.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedCertificateTypeEnumValue; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/CfnDataSourceConfigurations.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/CfnDataSourceConfigurations.java new file mode 100644 index 000000000000..2d5916436618 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/CfnDataSourceConfigurations.java @@ -0,0 +1,159 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of CFNDataSourceConfigurations. + */ +@Fluent +public final class CfnDataSourceConfigurations implements JsonSerializable { + /* + * Property kubernetes + */ + private CfnKubernetesConfiguration kubernetes; + + /* + * Property malwareProtection + */ + private CfnMalwareProtectionConfiguration malwareProtection; + + /* + * Property s3Logs + */ + private Cfns3LogsConfiguration s3Logs; + + /** + * Creates an instance of CfnDataSourceConfigurations class. + */ + public CfnDataSourceConfigurations() { + } + + /** + * Get the kubernetes property: Property kubernetes. + * + * @return the kubernetes value. + */ + public CfnKubernetesConfiguration kubernetes() { + return this.kubernetes; + } + + /** + * Set the kubernetes property: Property kubernetes. + * + * @param kubernetes the kubernetes value to set. + * @return the CfnDataSourceConfigurations object itself. + */ + public CfnDataSourceConfigurations withKubernetes(CfnKubernetesConfiguration kubernetes) { + this.kubernetes = kubernetes; + return this; + } + + /** + * Get the malwareProtection property: Property malwareProtection. + * + * @return the malwareProtection value. + */ + public CfnMalwareProtectionConfiguration malwareProtection() { + return this.malwareProtection; + } + + /** + * Set the malwareProtection property: Property malwareProtection. + * + * @param malwareProtection the malwareProtection value to set. + * @return the CfnDataSourceConfigurations object itself. + */ + public CfnDataSourceConfigurations withMalwareProtection(CfnMalwareProtectionConfiguration malwareProtection) { + this.malwareProtection = malwareProtection; + return this; + } + + /** + * Get the s3Logs property: Property s3Logs. + * + * @return the s3Logs value. + */ + public Cfns3LogsConfiguration s3Logs() { + return this.s3Logs; + } + + /** + * Set the s3Logs property: Property s3Logs. + * + * @param s3Logs the s3Logs value to set. + * @return the CfnDataSourceConfigurations object itself. + */ + public CfnDataSourceConfigurations withS3Logs(Cfns3LogsConfiguration s3Logs) { + this.s3Logs = s3Logs; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (kubernetes() != null) { + kubernetes().validate(); + } + if (malwareProtection() != null) { + malwareProtection().validate(); + } + if (s3Logs() != null) { + s3Logs().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("kubernetes", this.kubernetes); + jsonWriter.writeJsonField("malwareProtection", this.malwareProtection); + jsonWriter.writeJsonField("s3Logs", this.s3Logs); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of CfnDataSourceConfigurations from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of CfnDataSourceConfigurations if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the CfnDataSourceConfigurations. + */ + public static CfnDataSourceConfigurations fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + CfnDataSourceConfigurations deserializedCfnDataSourceConfigurations = new CfnDataSourceConfigurations(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("kubernetes".equals(fieldName)) { + deserializedCfnDataSourceConfigurations.kubernetes = CfnKubernetesConfiguration.fromJson(reader); + } else if ("malwareProtection".equals(fieldName)) { + deserializedCfnDataSourceConfigurations.malwareProtection + = CfnMalwareProtectionConfiguration.fromJson(reader); + } else if ("s3Logs".equals(fieldName)) { + deserializedCfnDataSourceConfigurations.s3Logs = Cfns3LogsConfiguration.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedCfnDataSourceConfigurations; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/CfnFeatureAdditionalConfiguration.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/CfnFeatureAdditionalConfiguration.java new file mode 100644 index 000000000000..e4f436fe4a90 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/CfnFeatureAdditionalConfiguration.java @@ -0,0 +1,122 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of CFNFeatureAdditionalConfiguration. + */ +@Fluent +public final class CfnFeatureAdditionalConfiguration implements JsonSerializable { + /* + * Property name + */ + private String name; + + /* + * Property status + */ + private String status; + + /** + * Creates an instance of CfnFeatureAdditionalConfiguration class. + */ + public CfnFeatureAdditionalConfiguration() { + } + + /** + * Get the name property: Property name. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: Property name. + * + * @param name the name value to set. + * @return the CfnFeatureAdditionalConfiguration object itself. + */ + public CfnFeatureAdditionalConfiguration withName(String name) { + this.name = name; + return this; + } + + /** + * Get the status property: Property status. + * + * @return the status value. + */ + public String status() { + return this.status; + } + + /** + * Set the status property: Property status. + * + * @param status the status value to set. + * @return the CfnFeatureAdditionalConfiguration object itself. + */ + public CfnFeatureAdditionalConfiguration withStatus(String status) { + this.status = status; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("name", this.name); + jsonWriter.writeStringField("status", this.status); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of CfnFeatureAdditionalConfiguration from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of CfnFeatureAdditionalConfiguration if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the CfnFeatureAdditionalConfiguration. + */ + public static CfnFeatureAdditionalConfiguration fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + CfnFeatureAdditionalConfiguration deserializedCfnFeatureAdditionalConfiguration + = new CfnFeatureAdditionalConfiguration(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("name".equals(fieldName)) { + deserializedCfnFeatureAdditionalConfiguration.name = reader.getString(); + } else if ("status".equals(fieldName)) { + deserializedCfnFeatureAdditionalConfiguration.status = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedCfnFeatureAdditionalConfiguration; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/CfnFeatureConfiguration.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/CfnFeatureConfiguration.java new file mode 100644 index 000000000000..037a3eff7dad --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/CfnFeatureConfiguration.java @@ -0,0 +1,158 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Definition of CFNFeatureConfiguration. + */ +@Fluent +public final class CfnFeatureConfiguration implements JsonSerializable { + /* + * Property additionalConfiguration + */ + private List additionalConfiguration; + + /* + * Property name + */ + private String name; + + /* + * Property status + */ + private CfnFeatureConfigurationStatus status; + + /** + * Creates an instance of CfnFeatureConfiguration class. + */ + public CfnFeatureConfiguration() { + } + + /** + * Get the additionalConfiguration property: Property additionalConfiguration. + * + * @return the additionalConfiguration value. + */ + public List additionalConfiguration() { + return this.additionalConfiguration; + } + + /** + * Set the additionalConfiguration property: Property additionalConfiguration. + * + * @param additionalConfiguration the additionalConfiguration value to set. + * @return the CfnFeatureConfiguration object itself. + */ + public CfnFeatureConfiguration + withAdditionalConfiguration(List additionalConfiguration) { + this.additionalConfiguration = additionalConfiguration; + return this; + } + + /** + * Get the name property: Property name. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: Property name. + * + * @param name the name value to set. + * @return the CfnFeatureConfiguration object itself. + */ + public CfnFeatureConfiguration withName(String name) { + this.name = name; + return this; + } + + /** + * Get the status property: Property status. + * + * @return the status value. + */ + public CfnFeatureConfigurationStatus status() { + return this.status; + } + + /** + * Set the status property: Property status. + * + * @param status the status value to set. + * @return the CfnFeatureConfiguration object itself. + */ + public CfnFeatureConfiguration withStatus(CfnFeatureConfigurationStatus status) { + this.status = status; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (additionalConfiguration() != null) { + additionalConfiguration().forEach(e -> e.validate()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("additionalConfiguration", this.additionalConfiguration, + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("name", this.name); + jsonWriter.writeStringField("status", this.status == null ? null : this.status.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of CfnFeatureConfiguration from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of CfnFeatureConfiguration if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the CfnFeatureConfiguration. + */ + public static CfnFeatureConfiguration fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + CfnFeatureConfiguration deserializedCfnFeatureConfiguration = new CfnFeatureConfiguration(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("additionalConfiguration".equals(fieldName)) { + List additionalConfiguration + = reader.readArray(reader1 -> CfnFeatureAdditionalConfiguration.fromJson(reader1)); + deserializedCfnFeatureConfiguration.additionalConfiguration = additionalConfiguration; + } else if ("name".equals(fieldName)) { + deserializedCfnFeatureConfiguration.name = reader.getString(); + } else if ("status".equals(fieldName)) { + deserializedCfnFeatureConfiguration.status + = CfnFeatureConfigurationStatus.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedCfnFeatureConfiguration; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/CfnFeatureConfigurationStatus.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/CfnFeatureConfigurationStatus.java new file mode 100644 index 000000000000..ddb6eb20a23e --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/CfnFeatureConfigurationStatus.java @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * CFNFeatureConfigurationStatus enum. + */ +public final class CfnFeatureConfigurationStatus extends ExpandableStringEnum { + /** + * Static value DISABLED for CfnFeatureConfigurationStatus. + */ + public static final CfnFeatureConfigurationStatus DISABLED = fromString("DISABLED"); + + /** + * Static value ENABLED for CfnFeatureConfigurationStatus. + */ + public static final CfnFeatureConfigurationStatus ENABLED = fromString("ENABLED"); + + /** + * Creates a new instance of CfnFeatureConfigurationStatus value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public CfnFeatureConfigurationStatus() { + } + + /** + * Creates or finds a CfnFeatureConfigurationStatus from its string representation. + * + * @param name a name to look for. + * @return the corresponding CfnFeatureConfigurationStatus. + */ + public static CfnFeatureConfigurationStatus fromString(String name) { + return fromString(name, CfnFeatureConfigurationStatus.class); + } + + /** + * Gets known CfnFeatureConfigurationStatus values. + * + * @return known CfnFeatureConfigurationStatus values. + */ + public static Collection values() { + return values(CfnFeatureConfigurationStatus.class); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/CfnKubernetesAuditLogsConfiguration.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/CfnKubernetesAuditLogsConfiguration.java new file mode 100644 index 000000000000..55a87866d27c --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/CfnKubernetesAuditLogsConfiguration.java @@ -0,0 +1,95 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of CFNKubernetesAuditLogsConfiguration. + */ +@Fluent +public final class CfnKubernetesAuditLogsConfiguration + implements JsonSerializable { + /* + * Property enable + */ + private Boolean enable; + + /** + * Creates an instance of CfnKubernetesAuditLogsConfiguration class. + */ + public CfnKubernetesAuditLogsConfiguration() { + } + + /** + * Get the enable property: Property enable. + * + * @return the enable value. + */ + public Boolean enable() { + return this.enable; + } + + /** + * Set the enable property: Property enable. + * + * @param enable the enable value to set. + * @return the CfnKubernetesAuditLogsConfiguration object itself. + */ + public CfnKubernetesAuditLogsConfiguration withEnable(Boolean enable) { + this.enable = enable; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeBooleanField("enable", this.enable); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of CfnKubernetesAuditLogsConfiguration from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of CfnKubernetesAuditLogsConfiguration if the JsonReader was pointing to an instance of it, + * or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the CfnKubernetesAuditLogsConfiguration. + */ + public static CfnKubernetesAuditLogsConfiguration fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + CfnKubernetesAuditLogsConfiguration deserializedCfnKubernetesAuditLogsConfiguration + = new CfnKubernetesAuditLogsConfiguration(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("enable".equals(fieldName)) { + deserializedCfnKubernetesAuditLogsConfiguration.enable = reader.getNullable(JsonReader::getBoolean); + } else { + reader.skipChildren(); + } + } + + return deserializedCfnKubernetesAuditLogsConfiguration; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/CfnKubernetesConfiguration.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/CfnKubernetesConfiguration.java new file mode 100644 index 000000000000..6be7a86029d4 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/CfnKubernetesConfiguration.java @@ -0,0 +1,97 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of CFNKubernetesConfiguration. + */ +@Fluent +public final class CfnKubernetesConfiguration implements JsonSerializable { + /* + * Property auditLogs + */ + private CfnKubernetesAuditLogsConfiguration auditLogs; + + /** + * Creates an instance of CfnKubernetesConfiguration class. + */ + public CfnKubernetesConfiguration() { + } + + /** + * Get the auditLogs property: Property auditLogs. + * + * @return the auditLogs value. + */ + public CfnKubernetesAuditLogsConfiguration auditLogs() { + return this.auditLogs; + } + + /** + * Set the auditLogs property: Property auditLogs. + * + * @param auditLogs the auditLogs value to set. + * @return the CfnKubernetesConfiguration object itself. + */ + public CfnKubernetesConfiguration withAuditLogs(CfnKubernetesAuditLogsConfiguration auditLogs) { + this.auditLogs = auditLogs; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (auditLogs() != null) { + auditLogs().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("auditLogs", this.auditLogs); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of CfnKubernetesConfiguration from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of CfnKubernetesConfiguration if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IOException If an error occurs while reading the CfnKubernetesConfiguration. + */ + public static CfnKubernetesConfiguration fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + CfnKubernetesConfiguration deserializedCfnKubernetesConfiguration = new CfnKubernetesConfiguration(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("auditLogs".equals(fieldName)) { + deserializedCfnKubernetesConfiguration.auditLogs + = CfnKubernetesAuditLogsConfiguration.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedCfnKubernetesConfiguration; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/CfnMalwareProtectionConfiguration.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/CfnMalwareProtectionConfiguration.java new file mode 100644 index 000000000000..c7ba95f11c67 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/CfnMalwareProtectionConfiguration.java @@ -0,0 +1,99 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of CFNMalwareProtectionConfiguration. + */ +@Fluent +public final class CfnMalwareProtectionConfiguration implements JsonSerializable { + /* + * Property scanEc2InstanceWithFindings + */ + private CfnScanEc2InstanceWithFindingsConfiguration scanEc2InstanceWithFindings; + + /** + * Creates an instance of CfnMalwareProtectionConfiguration class. + */ + public CfnMalwareProtectionConfiguration() { + } + + /** + * Get the scanEc2InstanceWithFindings property: Property scanEc2InstanceWithFindings. + * + * @return the scanEc2InstanceWithFindings value. + */ + public CfnScanEc2InstanceWithFindingsConfiguration scanEc2InstanceWithFindings() { + return this.scanEc2InstanceWithFindings; + } + + /** + * Set the scanEc2InstanceWithFindings property: Property scanEc2InstanceWithFindings. + * + * @param scanEc2InstanceWithFindings the scanEc2InstanceWithFindings value to set. + * @return the CfnMalwareProtectionConfiguration object itself. + */ + public CfnMalwareProtectionConfiguration + withScanEc2InstanceWithFindings(CfnScanEc2InstanceWithFindingsConfiguration scanEc2InstanceWithFindings) { + this.scanEc2InstanceWithFindings = scanEc2InstanceWithFindings; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (scanEc2InstanceWithFindings() != null) { + scanEc2InstanceWithFindings().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("scanEc2InstanceWithFindings", this.scanEc2InstanceWithFindings); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of CfnMalwareProtectionConfiguration from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of CfnMalwareProtectionConfiguration if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the CfnMalwareProtectionConfiguration. + */ + public static CfnMalwareProtectionConfiguration fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + CfnMalwareProtectionConfiguration deserializedCfnMalwareProtectionConfiguration + = new CfnMalwareProtectionConfiguration(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("scanEc2InstanceWithFindings".equals(fieldName)) { + deserializedCfnMalwareProtectionConfiguration.scanEc2InstanceWithFindings + = CfnScanEc2InstanceWithFindingsConfiguration.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedCfnMalwareProtectionConfiguration; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/CfnScanEc2InstanceWithFindingsConfiguration.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/CfnScanEc2InstanceWithFindingsConfiguration.java new file mode 100644 index 000000000000..002886ce015e --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/CfnScanEc2InstanceWithFindingsConfiguration.java @@ -0,0 +1,96 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of CFNScanEc2InstanceWithFindingsConfiguration. + */ +@Fluent +public final class CfnScanEc2InstanceWithFindingsConfiguration + implements JsonSerializable { + /* + * Property ebsVolumes + */ + private Boolean ebsVolumes; + + /** + * Creates an instance of CfnScanEc2InstanceWithFindingsConfiguration class. + */ + public CfnScanEc2InstanceWithFindingsConfiguration() { + } + + /** + * Get the ebsVolumes property: Property ebsVolumes. + * + * @return the ebsVolumes value. + */ + public Boolean ebsVolumes() { + return this.ebsVolumes; + } + + /** + * Set the ebsVolumes property: Property ebsVolumes. + * + * @param ebsVolumes the ebsVolumes value to set. + * @return the CfnScanEc2InstanceWithFindingsConfiguration object itself. + */ + public CfnScanEc2InstanceWithFindingsConfiguration withEbsVolumes(Boolean ebsVolumes) { + this.ebsVolumes = ebsVolumes; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeBooleanField("ebsVolumes", this.ebsVolumes); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of CfnScanEc2InstanceWithFindingsConfiguration from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of CfnScanEc2InstanceWithFindingsConfiguration if the JsonReader was pointing to an instance + * of it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the CfnScanEc2InstanceWithFindingsConfiguration. + */ + public static CfnScanEc2InstanceWithFindingsConfiguration fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + CfnScanEc2InstanceWithFindingsConfiguration deserializedCfnScanEc2InstanceWithFindingsConfiguration + = new CfnScanEc2InstanceWithFindingsConfiguration(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("ebsVolumes".equals(fieldName)) { + deserializedCfnScanEc2InstanceWithFindingsConfiguration.ebsVolumes + = reader.getNullable(JsonReader::getBoolean); + } else { + reader.skipChildren(); + } + } + + return deserializedCfnScanEc2InstanceWithFindingsConfiguration; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/Cfns3LogsConfiguration.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/Cfns3LogsConfiguration.java new file mode 100644 index 000000000000..c1b44986749d --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/Cfns3LogsConfiguration.java @@ -0,0 +1,93 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of CFNS3LogsConfiguration. + */ +@Fluent +public final class Cfns3LogsConfiguration implements JsonSerializable { + /* + * Property enable + */ + private Boolean enable; + + /** + * Creates an instance of Cfns3LogsConfiguration class. + */ + public Cfns3LogsConfiguration() { + } + + /** + * Get the enable property: Property enable. + * + * @return the enable value. + */ + public Boolean enable() { + return this.enable; + } + + /** + * Set the enable property: Property enable. + * + * @param enable the enable value to set. + * @return the Cfns3LogsConfiguration object itself. + */ + public Cfns3LogsConfiguration withEnable(Boolean enable) { + this.enable = enable; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeBooleanField("enable", this.enable); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of Cfns3LogsConfiguration from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of Cfns3LogsConfiguration if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the Cfns3LogsConfiguration. + */ + public static Cfns3LogsConfiguration fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + Cfns3LogsConfiguration deserializedCfns3LogsConfiguration = new Cfns3LogsConfiguration(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("enable".equals(fieldName)) { + deserializedCfns3LogsConfiguration.enable = reader.getNullable(JsonReader::getBoolean); + } else { + reader.skipChildren(); + } + } + + return deserializedCfns3LogsConfiguration; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ChangeProgressDetails.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ChangeProgressDetails.java new file mode 100644 index 000000000000..9c94deb3f07a --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ChangeProgressDetails.java @@ -0,0 +1,248 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.time.OffsetDateTime; +import java.time.format.DateTimeFormatter; + +/** + * Definition of ChangeProgressDetails. + */ +@Fluent +public final class ChangeProgressDetails implements JsonSerializable { + /* + *

The ID of the configuration change.

+ */ + private String changeId; + + /* + *

The current status of the configuration change.

+ */ + private ConfigChangeStatusEnumValue configChangeStatus; + + /* + *

The IAM principal who initiated the configuration change.

+ */ + private InitiatedByEnumValue initiatedBy; + + /* + *

The last time that the configuration change was updated.

+ */ + private OffsetDateTime lastUpdatedTime; + + /* + *

A message corresponding to the status of the configuration change.

+ */ + private String message; + + /* + *

The time that the configuration change was initiated, in Universal Coordinated Time (UTC).

+ */ + private OffsetDateTime startTime; + + /** + * Creates an instance of ChangeProgressDetails class. + */ + public ChangeProgressDetails() { + } + + /** + * Get the changeId property: <p>The ID of the configuration change.</p>. + * + * @return the changeId value. + */ + public String changeId() { + return this.changeId; + } + + /** + * Set the changeId property: <p>The ID of the configuration change.</p>. + * + * @param changeId the changeId value to set. + * @return the ChangeProgressDetails object itself. + */ + public ChangeProgressDetails withChangeId(String changeId) { + this.changeId = changeId; + return this; + } + + /** + * Get the configChangeStatus property: <p>The current status of the configuration change.</p>. + * + * @return the configChangeStatus value. + */ + public ConfigChangeStatusEnumValue configChangeStatus() { + return this.configChangeStatus; + } + + /** + * Set the configChangeStatus property: <p>The current status of the configuration change.</p>. + * + * @param configChangeStatus the configChangeStatus value to set. + * @return the ChangeProgressDetails object itself. + */ + public ChangeProgressDetails withConfigChangeStatus(ConfigChangeStatusEnumValue configChangeStatus) { + this.configChangeStatus = configChangeStatus; + return this; + } + + /** + * Get the initiatedBy property: <p>The IAM principal who initiated the configuration change.</p>. + * + * @return the initiatedBy value. + */ + public InitiatedByEnumValue initiatedBy() { + return this.initiatedBy; + } + + /** + * Set the initiatedBy property: <p>The IAM principal who initiated the configuration change.</p>. + * + * @param initiatedBy the initiatedBy value to set. + * @return the ChangeProgressDetails object itself. + */ + public ChangeProgressDetails withInitiatedBy(InitiatedByEnumValue initiatedBy) { + this.initiatedBy = initiatedBy; + return this; + } + + /** + * Get the lastUpdatedTime property: <p>The last time that the configuration change was updated.</p>. + * + * @return the lastUpdatedTime value. + */ + public OffsetDateTime lastUpdatedTime() { + return this.lastUpdatedTime; + } + + /** + * Set the lastUpdatedTime property: <p>The last time that the configuration change was updated.</p>. + * + * @param lastUpdatedTime the lastUpdatedTime value to set. + * @return the ChangeProgressDetails object itself. + */ + public ChangeProgressDetails withLastUpdatedTime(OffsetDateTime lastUpdatedTime) { + this.lastUpdatedTime = lastUpdatedTime; + return this; + } + + /** + * Get the message property: <p>A message corresponding to the status of the configuration change.</p>. + * + * @return the message value. + */ + public String message() { + return this.message; + } + + /** + * Set the message property: <p>A message corresponding to the status of the configuration change.</p>. + * + * @param message the message value to set. + * @return the ChangeProgressDetails object itself. + */ + public ChangeProgressDetails withMessage(String message) { + this.message = message; + return this; + } + + /** + * Get the startTime property: <p>The time that the configuration change was initiated, in Universal + * Coordinated Time (UTC).</p>. + * + * @return the startTime value. + */ + public OffsetDateTime startTime() { + return this.startTime; + } + + /** + * Set the startTime property: <p>The time that the configuration change was initiated, in Universal + * Coordinated Time (UTC).</p>. + * + * @param startTime the startTime value to set. + * @return the ChangeProgressDetails object itself. + */ + public ChangeProgressDetails withStartTime(OffsetDateTime startTime) { + this.startTime = startTime; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (configChangeStatus() != null) { + configChangeStatus().validate(); + } + if (initiatedBy() != null) { + initiatedBy().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("changeId", this.changeId); + jsonWriter.writeJsonField("configChangeStatus", this.configChangeStatus); + jsonWriter.writeJsonField("initiatedBy", this.initiatedBy); + jsonWriter.writeStringField("lastUpdatedTime", + this.lastUpdatedTime == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.lastUpdatedTime)); + jsonWriter.writeStringField("message", this.message); + jsonWriter.writeStringField("startTime", + this.startTime == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.startTime)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ChangeProgressDetails from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ChangeProgressDetails if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the ChangeProgressDetails. + */ + public static ChangeProgressDetails fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ChangeProgressDetails deserializedChangeProgressDetails = new ChangeProgressDetails(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("changeId".equals(fieldName)) { + deserializedChangeProgressDetails.changeId = reader.getString(); + } else if ("configChangeStatus".equals(fieldName)) { + deserializedChangeProgressDetails.configChangeStatus = ConfigChangeStatusEnumValue.fromJson(reader); + } else if ("initiatedBy".equals(fieldName)) { + deserializedChangeProgressDetails.initiatedBy = InitiatedByEnumValue.fromJson(reader); + } else if ("lastUpdatedTime".equals(fieldName)) { + deserializedChangeProgressDetails.lastUpdatedTime = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("message".equals(fieldName)) { + deserializedChangeProgressDetails.message = reader.getString(); + } else if ("startTime".equals(fieldName)) { + deserializedChangeProgressDetails.startTime = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else { + reader.skipChildren(); + } + } + + return deserializedChangeProgressDetails; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/CidrRoutingConfig.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/CidrRoutingConfig.java new file mode 100644 index 000000000000..8839b8ff7201 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/CidrRoutingConfig.java @@ -0,0 +1,121 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of CidrRoutingConfig. + */ +@Fluent +public final class CidrRoutingConfig implements JsonSerializable { + /* + *

The CIDR collection ID.

+ */ + private String collectionId; + + /* + *

The CIDR collection location name.

+ */ + private String locationName; + + /** + * Creates an instance of CidrRoutingConfig class. + */ + public CidrRoutingConfig() { + } + + /** + * Get the collectionId property: <p>The CIDR collection ID.</p>. + * + * @return the collectionId value. + */ + public String collectionId() { + return this.collectionId; + } + + /** + * Set the collectionId property: <p>The CIDR collection ID.</p>. + * + * @param collectionId the collectionId value to set. + * @return the CidrRoutingConfig object itself. + */ + public CidrRoutingConfig withCollectionId(String collectionId) { + this.collectionId = collectionId; + return this; + } + + /** + * Get the locationName property: <p>The CIDR collection location name.</p>. + * + * @return the locationName value. + */ + public String locationName() { + return this.locationName; + } + + /** + * Set the locationName property: <p>The CIDR collection location name.</p>. + * + * @param locationName the locationName value to set. + * @return the CidrRoutingConfig object itself. + */ + public CidrRoutingConfig withLocationName(String locationName) { + this.locationName = locationName; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("collectionId", this.collectionId); + jsonWriter.writeStringField("locationName", this.locationName); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of CidrRoutingConfig from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of CidrRoutingConfig if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the CidrRoutingConfig. + */ + public static CidrRoutingConfig fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + CidrRoutingConfig deserializedCidrRoutingConfig = new CidrRoutingConfig(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("collectionId".equals(fieldName)) { + deserializedCidrRoutingConfig.collectionId = reader.getString(); + } else if ("locationName".equals(fieldName)) { + deserializedCidrRoutingConfig.locationName = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedCidrRoutingConfig; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/CloudFormationStack.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/CloudFormationStack.java new file mode 100644 index 000000000000..7d464e48eb99 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/CloudFormationStack.java @@ -0,0 +1,252 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.awsconnector.fluent.models.CloudFormationStackInner; +import java.util.Map; + +/** + * An immutable client-side representation of CloudFormationStack. + */ +public interface CloudFormationStack { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the location property: The geo-location where the resource lives. + * + * @return the location value. + */ + String location(); + + /** + * Gets the tags property: Resource tags. + * + * @return the tags value. + */ + Map tags(); + + /** + * Gets the properties property: The resource-specific properties for this resource. + * + * @return the properties value. + */ + CloudFormationStackProperties properties(); + + /** + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the region of the resource. + * + * @return the region of the resource. + */ + Region region(); + + /** + * Gets the name of the resource region. + * + * @return the name of the resource region. + */ + String regionName(); + + /** + * Gets the name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + + /** + * Gets the inner com.azure.resourcemanager.awsconnector.fluent.models.CloudFormationStackInner object. + * + * @return the inner object. + */ + CloudFormationStackInner innerModel(); + + /** + * The entirety of the CloudFormationStack definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithLocation, + DefinitionStages.WithResourceGroup, DefinitionStages.WithCreate { + } + + /** + * The CloudFormationStack definition stages. + */ + interface DefinitionStages { + /** + * The first stage of the CloudFormationStack definition. + */ + interface Blank extends WithLocation { + } + + /** + * The stage of the CloudFormationStack definition allowing to specify location. + */ + interface WithLocation { + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithResourceGroup withRegion(Region location); + + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithResourceGroup withRegion(String location); + } + + /** + * The stage of the CloudFormationStack definition allowing to specify parent resource. + */ + interface WithResourceGroup { + /** + * Specifies resourceGroupName. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @return the next definition stage. + */ + WithCreate withExistingResourceGroup(String resourceGroupName); + } + + /** + * The stage of the CloudFormationStack 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.WithProperties { + /** + * Executes the create request. + * + * @return the created resource. + */ + CloudFormationStack create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + CloudFormationStack create(Context context); + } + + /** + * The stage of the CloudFormationStack definition allowing to specify tags. + */ + interface WithTags { + /** + * Specifies the tags property: Resource tags.. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + WithCreate withTags(Map tags); + } + + /** + * The stage of the CloudFormationStack definition allowing to specify properties. + */ + interface WithProperties { + /** + * Specifies the properties property: The resource-specific properties for this resource.. + * + * @param properties The resource-specific properties for this resource. + * @return the next definition stage. + */ + WithCreate withProperties(CloudFormationStackProperties properties); + } + } + + /** + * Begins update for the CloudFormationStack resource. + * + * @return the stage of resource update. + */ + CloudFormationStack.Update update(); + + /** + * The template for CloudFormationStack update. + */ + interface Update extends UpdateStages.WithTags { + /** + * Executes the update request. + * + * @return the updated resource. + */ + CloudFormationStack apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + CloudFormationStack apply(Context context); + } + + /** + * The CloudFormationStack update stages. + */ + interface UpdateStages { + /** + * The stage of the CloudFormationStack update allowing to specify tags. + */ + interface WithTags { + /** + * Specifies the tags property: Resource tags.. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + Update withTags(Map tags); + } + } + + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + CloudFormationStack refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + CloudFormationStack refresh(Context context); +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/CloudFormationStackListResult.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/CloudFormationStackListResult.java new file mode 100644 index 000000000000..4bb2081234be --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/CloudFormationStackListResult.java @@ -0,0 +1,137 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.awsconnector.fluent.models.CloudFormationStackInner; +import java.io.IOException; +import java.util.List; + +/** + * The response of a CloudFormationStack list operation. + */ +@Fluent +public final class CloudFormationStackListResult implements JsonSerializable { + /* + * The CloudFormationStack items on this page + */ + private List value; + + /* + * The link to the next page of items + */ + private String nextLink; + + /** + * Creates an instance of CloudFormationStackListResult class. + */ + public CloudFormationStackListResult() { + } + + /** + * Get the value property: The CloudFormationStack items on this page. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The CloudFormationStack items on this page. + * + * @param value the value value to set. + * @return the CloudFormationStackListResult object itself. + */ + public CloudFormationStackListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The link to the next page of items. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: The link to the next page of items. + * + * @param nextLink the nextLink value to set. + * @return the CloudFormationStackListResult object itself. + */ + public CloudFormationStackListResult withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property value in model CloudFormationStackListResult")); + } else { + value().forEach(e -> e.validate()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(CloudFormationStackListResult.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("nextLink", this.nextLink); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of CloudFormationStackListResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of CloudFormationStackListResult if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the CloudFormationStackListResult. + */ + public static CloudFormationStackListResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + CloudFormationStackListResult deserializedCloudFormationStackListResult + = new CloudFormationStackListResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> CloudFormationStackInner.fromJson(reader1)); + deserializedCloudFormationStackListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedCloudFormationStackListResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedCloudFormationStackListResult; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/CloudFormationStackProperties.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/CloudFormationStackProperties.java new file mode 100644 index 000000000000..45b014814b46 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/CloudFormationStackProperties.java @@ -0,0 +1,313 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.Map; + +/** + * Definition of CloudFormationStack. + */ +@Fluent +public final class CloudFormationStackProperties implements JsonSerializable { + /* + * AWS Properties + */ + private AwsCloudFormationStackProperties awsProperties; + + /* + * Public Cloud Connectors Resource ID + */ + private String publicCloudConnectorsResourceId; + + /* + * AWS Account ID + */ + private String awsAccountId; + + /* + * Amazon Resource Name (ARN) + */ + private String arn; + + /* + * Public Cloud Resource Name + */ + private String publicCloudResourceName; + + /* + * AWS Source Schema + */ + private String awsSourceSchema; + + /* + * AWS Region + */ + private String awsRegion; + + /* + * AWS Tags + */ + private Map awsTags; + + /* + * The status of the last operation. + */ + private ProvisioningState provisioningState; + + /** + * Creates an instance of CloudFormationStackProperties class. + */ + public CloudFormationStackProperties() { + } + + /** + * Get the awsProperties property: AWS Properties. + * + * @return the awsProperties value. + */ + public AwsCloudFormationStackProperties awsProperties() { + return this.awsProperties; + } + + /** + * Set the awsProperties property: AWS Properties. + * + * @param awsProperties the awsProperties value to set. + * @return the CloudFormationStackProperties object itself. + */ + public CloudFormationStackProperties withAwsProperties(AwsCloudFormationStackProperties awsProperties) { + this.awsProperties = awsProperties; + return this; + } + + /** + * Get the publicCloudConnectorsResourceId property: Public Cloud Connectors Resource ID. + * + * @return the publicCloudConnectorsResourceId value. + */ + public String publicCloudConnectorsResourceId() { + return this.publicCloudConnectorsResourceId; + } + + /** + * Set the publicCloudConnectorsResourceId property: Public Cloud Connectors Resource ID. + * + * @param publicCloudConnectorsResourceId the publicCloudConnectorsResourceId value to set. + * @return the CloudFormationStackProperties object itself. + */ + public CloudFormationStackProperties withPublicCloudConnectorsResourceId(String publicCloudConnectorsResourceId) { + this.publicCloudConnectorsResourceId = publicCloudConnectorsResourceId; + return this; + } + + /** + * Get the awsAccountId property: AWS Account ID. + * + * @return the awsAccountId value. + */ + public String awsAccountId() { + return this.awsAccountId; + } + + /** + * Set the awsAccountId property: AWS Account ID. + * + * @param awsAccountId the awsAccountId value to set. + * @return the CloudFormationStackProperties object itself. + */ + public CloudFormationStackProperties withAwsAccountId(String awsAccountId) { + this.awsAccountId = awsAccountId; + return this; + } + + /** + * Get the arn property: Amazon Resource Name (ARN). + * + * @return the arn value. + */ + public String arn() { + return this.arn; + } + + /** + * Set the arn property: Amazon Resource Name (ARN). + * + * @param arn the arn value to set. + * @return the CloudFormationStackProperties object itself. + */ + public CloudFormationStackProperties withArn(String arn) { + this.arn = arn; + return this; + } + + /** + * Get the publicCloudResourceName property: Public Cloud Resource Name. + * + * @return the publicCloudResourceName value. + */ + public String publicCloudResourceName() { + return this.publicCloudResourceName; + } + + /** + * Set the publicCloudResourceName property: Public Cloud Resource Name. + * + * @param publicCloudResourceName the publicCloudResourceName value to set. + * @return the CloudFormationStackProperties object itself. + */ + public CloudFormationStackProperties withPublicCloudResourceName(String publicCloudResourceName) { + this.publicCloudResourceName = publicCloudResourceName; + return this; + } + + /** + * Get the awsSourceSchema property: AWS Source Schema. + * + * @return the awsSourceSchema value. + */ + public String awsSourceSchema() { + return this.awsSourceSchema; + } + + /** + * Set the awsSourceSchema property: AWS Source Schema. + * + * @param awsSourceSchema the awsSourceSchema value to set. + * @return the CloudFormationStackProperties object itself. + */ + public CloudFormationStackProperties withAwsSourceSchema(String awsSourceSchema) { + this.awsSourceSchema = awsSourceSchema; + return this; + } + + /** + * Get the awsRegion property: AWS Region. + * + * @return the awsRegion value. + */ + public String awsRegion() { + return this.awsRegion; + } + + /** + * Set the awsRegion property: AWS Region. + * + * @param awsRegion the awsRegion value to set. + * @return the CloudFormationStackProperties object itself. + */ + public CloudFormationStackProperties withAwsRegion(String awsRegion) { + this.awsRegion = awsRegion; + return this; + } + + /** + * Get the awsTags property: AWS Tags. + * + * @return the awsTags value. + */ + public Map awsTags() { + return this.awsTags; + } + + /** + * Set the awsTags property: AWS Tags. + * + * @param awsTags the awsTags value to set. + * @return the CloudFormationStackProperties object itself. + */ + public CloudFormationStackProperties withAwsTags(Map awsTags) { + this.awsTags = awsTags; + return this; + } + + /** + * Get the provisioningState property: The status of the last operation. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (awsProperties() != null) { + awsProperties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("awsProperties", this.awsProperties); + jsonWriter.writeStringField("publicCloudConnectorsResourceId", this.publicCloudConnectorsResourceId); + jsonWriter.writeStringField("awsAccountId", this.awsAccountId); + jsonWriter.writeStringField("arn", this.arn); + jsonWriter.writeStringField("publicCloudResourceName", this.publicCloudResourceName); + jsonWriter.writeStringField("awsSourceSchema", this.awsSourceSchema); + jsonWriter.writeStringField("awsRegion", this.awsRegion); + jsonWriter.writeMapField("awsTags", this.awsTags, (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of CloudFormationStackProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of CloudFormationStackProperties if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the CloudFormationStackProperties. + */ + public static CloudFormationStackProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + CloudFormationStackProperties deserializedCloudFormationStackProperties + = new CloudFormationStackProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("awsProperties".equals(fieldName)) { + deserializedCloudFormationStackProperties.awsProperties + = AwsCloudFormationStackProperties.fromJson(reader); + } else if ("publicCloudConnectorsResourceId".equals(fieldName)) { + deserializedCloudFormationStackProperties.publicCloudConnectorsResourceId = reader.getString(); + } else if ("awsAccountId".equals(fieldName)) { + deserializedCloudFormationStackProperties.awsAccountId = reader.getString(); + } else if ("arn".equals(fieldName)) { + deserializedCloudFormationStackProperties.arn = reader.getString(); + } else if ("publicCloudResourceName".equals(fieldName)) { + deserializedCloudFormationStackProperties.publicCloudResourceName = reader.getString(); + } else if ("awsSourceSchema".equals(fieldName)) { + deserializedCloudFormationStackProperties.awsSourceSchema = reader.getString(); + } else if ("awsRegion".equals(fieldName)) { + deserializedCloudFormationStackProperties.awsRegion = reader.getString(); + } else if ("awsTags".equals(fieldName)) { + Map awsTags = reader.readMap(reader1 -> reader1.getString()); + deserializedCloudFormationStackProperties.awsTags = awsTags; + } else if ("provisioningState".equals(fieldName)) { + deserializedCloudFormationStackProperties.provisioningState + = ProvisioningState.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedCloudFormationStackProperties; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/CloudFormationStackSet.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/CloudFormationStackSet.java new file mode 100644 index 000000000000..6e4f6dfda871 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/CloudFormationStackSet.java @@ -0,0 +1,252 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.awsconnector.fluent.models.CloudFormationStackSetInner; +import java.util.Map; + +/** + * An immutable client-side representation of CloudFormationStackSet. + */ +public interface CloudFormationStackSet { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the location property: The geo-location where the resource lives. + * + * @return the location value. + */ + String location(); + + /** + * Gets the tags property: Resource tags. + * + * @return the tags value. + */ + Map tags(); + + /** + * Gets the properties property: The resource-specific properties for this resource. + * + * @return the properties value. + */ + CloudFormationStackSetProperties properties(); + + /** + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the region of the resource. + * + * @return the region of the resource. + */ + Region region(); + + /** + * Gets the name of the resource region. + * + * @return the name of the resource region. + */ + String regionName(); + + /** + * Gets the name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + + /** + * Gets the inner com.azure.resourcemanager.awsconnector.fluent.models.CloudFormationStackSetInner object. + * + * @return the inner object. + */ + CloudFormationStackSetInner innerModel(); + + /** + * The entirety of the CloudFormationStackSet definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithLocation, + DefinitionStages.WithResourceGroup, DefinitionStages.WithCreate { + } + + /** + * The CloudFormationStackSet definition stages. + */ + interface DefinitionStages { + /** + * The first stage of the CloudFormationStackSet definition. + */ + interface Blank extends WithLocation { + } + + /** + * The stage of the CloudFormationStackSet definition allowing to specify location. + */ + interface WithLocation { + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithResourceGroup withRegion(Region location); + + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithResourceGroup withRegion(String location); + } + + /** + * The stage of the CloudFormationStackSet definition allowing to specify parent resource. + */ + interface WithResourceGroup { + /** + * Specifies resourceGroupName. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @return the next definition stage. + */ + WithCreate withExistingResourceGroup(String resourceGroupName); + } + + /** + * The stage of the CloudFormationStackSet 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.WithProperties { + /** + * Executes the create request. + * + * @return the created resource. + */ + CloudFormationStackSet create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + CloudFormationStackSet create(Context context); + } + + /** + * The stage of the CloudFormationStackSet definition allowing to specify tags. + */ + interface WithTags { + /** + * Specifies the tags property: Resource tags.. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + WithCreate withTags(Map tags); + } + + /** + * The stage of the CloudFormationStackSet definition allowing to specify properties. + */ + interface WithProperties { + /** + * Specifies the properties property: The resource-specific properties for this resource.. + * + * @param properties The resource-specific properties for this resource. + * @return the next definition stage. + */ + WithCreate withProperties(CloudFormationStackSetProperties properties); + } + } + + /** + * Begins update for the CloudFormationStackSet resource. + * + * @return the stage of resource update. + */ + CloudFormationStackSet.Update update(); + + /** + * The template for CloudFormationStackSet update. + */ + interface Update extends UpdateStages.WithTags { + /** + * Executes the update request. + * + * @return the updated resource. + */ + CloudFormationStackSet apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + CloudFormationStackSet apply(Context context); + } + + /** + * The CloudFormationStackSet update stages. + */ + interface UpdateStages { + /** + * The stage of the CloudFormationStackSet update allowing to specify tags. + */ + interface WithTags { + /** + * Specifies the tags property: Resource tags.. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + Update withTags(Map tags); + } + } + + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + CloudFormationStackSet refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + CloudFormationStackSet refresh(Context context); +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/CloudFormationStackSetListResult.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/CloudFormationStackSetListResult.java new file mode 100644 index 000000000000..5ec5a894b642 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/CloudFormationStackSetListResult.java @@ -0,0 +1,137 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.awsconnector.fluent.models.CloudFormationStackSetInner; +import java.io.IOException; +import java.util.List; + +/** + * The response of a CloudFormationStackSet list operation. + */ +@Fluent +public final class CloudFormationStackSetListResult implements JsonSerializable { + /* + * The CloudFormationStackSet items on this page + */ + private List value; + + /* + * The link to the next page of items + */ + private String nextLink; + + /** + * Creates an instance of CloudFormationStackSetListResult class. + */ + public CloudFormationStackSetListResult() { + } + + /** + * Get the value property: The CloudFormationStackSet items on this page. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The CloudFormationStackSet items on this page. + * + * @param value the value value to set. + * @return the CloudFormationStackSetListResult object itself. + */ + public CloudFormationStackSetListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The link to the next page of items. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: The link to the next page of items. + * + * @param nextLink the nextLink value to set. + * @return the CloudFormationStackSetListResult object itself. + */ + public CloudFormationStackSetListResult withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property value in model CloudFormationStackSetListResult")); + } else { + value().forEach(e -> e.validate()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(CloudFormationStackSetListResult.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("nextLink", this.nextLink); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of CloudFormationStackSetListResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of CloudFormationStackSetListResult if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the CloudFormationStackSetListResult. + */ + public static CloudFormationStackSetListResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + CloudFormationStackSetListResult deserializedCloudFormationStackSetListResult + = new CloudFormationStackSetListResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> CloudFormationStackSetInner.fromJson(reader1)); + deserializedCloudFormationStackSetListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedCloudFormationStackSetListResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedCloudFormationStackSetListResult; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/CloudFormationStackSetProperties.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/CloudFormationStackSetProperties.java new file mode 100644 index 000000000000..4904b66c5bc5 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/CloudFormationStackSetProperties.java @@ -0,0 +1,314 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.Map; + +/** + * Definition of CloudFormationStackSet. + */ +@Fluent +public final class CloudFormationStackSetProperties implements JsonSerializable { + /* + * AWS Properties + */ + private AwsCloudFormationStackSetProperties awsProperties; + + /* + * Public Cloud Connectors Resource ID + */ + private String publicCloudConnectorsResourceId; + + /* + * AWS Account ID + */ + private String awsAccountId; + + /* + * Amazon Resource Name (ARN) + */ + private String arn; + + /* + * Public Cloud Resource Name + */ + private String publicCloudResourceName; + + /* + * AWS Source Schema + */ + private String awsSourceSchema; + + /* + * AWS Region + */ + private String awsRegion; + + /* + * AWS Tags + */ + private Map awsTags; + + /* + * The status of the last operation. + */ + private ProvisioningState provisioningState; + + /** + * Creates an instance of CloudFormationStackSetProperties class. + */ + public CloudFormationStackSetProperties() { + } + + /** + * Get the awsProperties property: AWS Properties. + * + * @return the awsProperties value. + */ + public AwsCloudFormationStackSetProperties awsProperties() { + return this.awsProperties; + } + + /** + * Set the awsProperties property: AWS Properties. + * + * @param awsProperties the awsProperties value to set. + * @return the CloudFormationStackSetProperties object itself. + */ + public CloudFormationStackSetProperties withAwsProperties(AwsCloudFormationStackSetProperties awsProperties) { + this.awsProperties = awsProperties; + return this; + } + + /** + * Get the publicCloudConnectorsResourceId property: Public Cloud Connectors Resource ID. + * + * @return the publicCloudConnectorsResourceId value. + */ + public String publicCloudConnectorsResourceId() { + return this.publicCloudConnectorsResourceId; + } + + /** + * Set the publicCloudConnectorsResourceId property: Public Cloud Connectors Resource ID. + * + * @param publicCloudConnectorsResourceId the publicCloudConnectorsResourceId value to set. + * @return the CloudFormationStackSetProperties object itself. + */ + public CloudFormationStackSetProperties + withPublicCloudConnectorsResourceId(String publicCloudConnectorsResourceId) { + this.publicCloudConnectorsResourceId = publicCloudConnectorsResourceId; + return this; + } + + /** + * Get the awsAccountId property: AWS Account ID. + * + * @return the awsAccountId value. + */ + public String awsAccountId() { + return this.awsAccountId; + } + + /** + * Set the awsAccountId property: AWS Account ID. + * + * @param awsAccountId the awsAccountId value to set. + * @return the CloudFormationStackSetProperties object itself. + */ + public CloudFormationStackSetProperties withAwsAccountId(String awsAccountId) { + this.awsAccountId = awsAccountId; + return this; + } + + /** + * Get the arn property: Amazon Resource Name (ARN). + * + * @return the arn value. + */ + public String arn() { + return this.arn; + } + + /** + * Set the arn property: Amazon Resource Name (ARN). + * + * @param arn the arn value to set. + * @return the CloudFormationStackSetProperties object itself. + */ + public CloudFormationStackSetProperties withArn(String arn) { + this.arn = arn; + return this; + } + + /** + * Get the publicCloudResourceName property: Public Cloud Resource Name. + * + * @return the publicCloudResourceName value. + */ + public String publicCloudResourceName() { + return this.publicCloudResourceName; + } + + /** + * Set the publicCloudResourceName property: Public Cloud Resource Name. + * + * @param publicCloudResourceName the publicCloudResourceName value to set. + * @return the CloudFormationStackSetProperties object itself. + */ + public CloudFormationStackSetProperties withPublicCloudResourceName(String publicCloudResourceName) { + this.publicCloudResourceName = publicCloudResourceName; + return this; + } + + /** + * Get the awsSourceSchema property: AWS Source Schema. + * + * @return the awsSourceSchema value. + */ + public String awsSourceSchema() { + return this.awsSourceSchema; + } + + /** + * Set the awsSourceSchema property: AWS Source Schema. + * + * @param awsSourceSchema the awsSourceSchema value to set. + * @return the CloudFormationStackSetProperties object itself. + */ + public CloudFormationStackSetProperties withAwsSourceSchema(String awsSourceSchema) { + this.awsSourceSchema = awsSourceSchema; + return this; + } + + /** + * Get the awsRegion property: AWS Region. + * + * @return the awsRegion value. + */ + public String awsRegion() { + return this.awsRegion; + } + + /** + * Set the awsRegion property: AWS Region. + * + * @param awsRegion the awsRegion value to set. + * @return the CloudFormationStackSetProperties object itself. + */ + public CloudFormationStackSetProperties withAwsRegion(String awsRegion) { + this.awsRegion = awsRegion; + return this; + } + + /** + * Get the awsTags property: AWS Tags. + * + * @return the awsTags value. + */ + public Map awsTags() { + return this.awsTags; + } + + /** + * Set the awsTags property: AWS Tags. + * + * @param awsTags the awsTags value to set. + * @return the CloudFormationStackSetProperties object itself. + */ + public CloudFormationStackSetProperties withAwsTags(Map awsTags) { + this.awsTags = awsTags; + return this; + } + + /** + * Get the provisioningState property: The status of the last operation. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (awsProperties() != null) { + awsProperties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("awsProperties", this.awsProperties); + jsonWriter.writeStringField("publicCloudConnectorsResourceId", this.publicCloudConnectorsResourceId); + jsonWriter.writeStringField("awsAccountId", this.awsAccountId); + jsonWriter.writeStringField("arn", this.arn); + jsonWriter.writeStringField("publicCloudResourceName", this.publicCloudResourceName); + jsonWriter.writeStringField("awsSourceSchema", this.awsSourceSchema); + jsonWriter.writeStringField("awsRegion", this.awsRegion); + jsonWriter.writeMapField("awsTags", this.awsTags, (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of CloudFormationStackSetProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of CloudFormationStackSetProperties if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the CloudFormationStackSetProperties. + */ + public static CloudFormationStackSetProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + CloudFormationStackSetProperties deserializedCloudFormationStackSetProperties + = new CloudFormationStackSetProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("awsProperties".equals(fieldName)) { + deserializedCloudFormationStackSetProperties.awsProperties + = AwsCloudFormationStackSetProperties.fromJson(reader); + } else if ("publicCloudConnectorsResourceId".equals(fieldName)) { + deserializedCloudFormationStackSetProperties.publicCloudConnectorsResourceId = reader.getString(); + } else if ("awsAccountId".equals(fieldName)) { + deserializedCloudFormationStackSetProperties.awsAccountId = reader.getString(); + } else if ("arn".equals(fieldName)) { + deserializedCloudFormationStackSetProperties.arn = reader.getString(); + } else if ("publicCloudResourceName".equals(fieldName)) { + deserializedCloudFormationStackSetProperties.publicCloudResourceName = reader.getString(); + } else if ("awsSourceSchema".equals(fieldName)) { + deserializedCloudFormationStackSetProperties.awsSourceSchema = reader.getString(); + } else if ("awsRegion".equals(fieldName)) { + deserializedCloudFormationStackSetProperties.awsRegion = reader.getString(); + } else if ("awsTags".equals(fieldName)) { + Map awsTags = reader.readMap(reader1 -> reader1.getString()); + deserializedCloudFormationStackSetProperties.awsTags = awsTags; + } else if ("provisioningState".equals(fieldName)) { + deserializedCloudFormationStackSetProperties.provisioningState + = ProvisioningState.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedCloudFormationStackSetProperties; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/CloudFormationStackSetTagsUpdate.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/CloudFormationStackSetTagsUpdate.java new file mode 100644 index 000000000000..2238d9eee128 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/CloudFormationStackSetTagsUpdate.java @@ -0,0 +1,96 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.Map; + +/** + * The type used for updating tags in CloudFormationStackSet resources. + */ +@Fluent +public final class CloudFormationStackSetTagsUpdate implements JsonSerializable { + /* + * Resource tags. + */ + private Map tags; + + /** + * Creates an instance of CloudFormationStackSetTagsUpdate class. + */ + public CloudFormationStackSetTagsUpdate() { + } + + /** + * Get the tags property: Resource tags. + * + * @return the tags value. + */ + public Map tags() { + return this.tags; + } + + /** + * Set the tags property: Resource tags. + * + * @param tags the tags value to set. + * @return the CloudFormationStackSetTagsUpdate object itself. + */ + public CloudFormationStackSetTagsUpdate withTags(Map tags) { + this.tags = tags; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeMapField("tags", this.tags, (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of CloudFormationStackSetTagsUpdate from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of CloudFormationStackSetTagsUpdate if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the CloudFormationStackSetTagsUpdate. + */ + public static CloudFormationStackSetTagsUpdate fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + CloudFormationStackSetTagsUpdate deserializedCloudFormationStackSetTagsUpdate + = new CloudFormationStackSetTagsUpdate(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedCloudFormationStackSetTagsUpdate.tags = tags; + } else { + reader.skipChildren(); + } + } + + return deserializedCloudFormationStackSetTagsUpdate; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/CloudFormationStackSets.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/CloudFormationStackSets.java new file mode 100644 index 000000000000..1aee7ba2182a --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/CloudFormationStackSets.java @@ -0,0 +1,158 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** + * Resource collection API of CloudFormationStackSets. + */ +public interface CloudFormationStackSets { + /** + * List CloudFormationStackSet resources by subscription ID. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a CloudFormationStackSet list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable list(); + + /** + * List CloudFormationStackSet resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a CloudFormationStackSet list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable list(Context context); + + /** + * List CloudFormationStackSet resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a CloudFormationStackSet list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * List CloudFormationStackSet resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a CloudFormationStackSet list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Get a CloudFormationStackSet. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of CloudFormationStackSet. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a CloudFormationStackSet along with {@link Response}. + */ + Response getByResourceGroupWithResponse(String resourceGroupName, String name, + Context context); + + /** + * Get a CloudFormationStackSet. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of CloudFormationStackSet. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a CloudFormationStackSet. + */ + CloudFormationStackSet getByResourceGroup(String resourceGroupName, String name); + + /** + * Delete a CloudFormationStackSet. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of CloudFormationStackSet. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByResourceGroup(String resourceGroupName, String name); + + /** + * Delete a CloudFormationStackSet. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of CloudFormationStackSet. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String name, Context context); + + /** + * Get a CloudFormationStackSet. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a CloudFormationStackSet along with {@link Response}. + */ + CloudFormationStackSet getById(String id); + + /** + * Get a CloudFormationStackSet. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a CloudFormationStackSet along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Delete a CloudFormationStackSet. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteById(String id); + + /** + * Delete a CloudFormationStackSet. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new CloudFormationStackSet resource. + * + * @param name resource name. + * @return the first stage of the new CloudFormationStackSet definition. + */ + CloudFormationStackSet.DefinitionStages.Blank define(String name); +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/CloudFormationStackTagsUpdate.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/CloudFormationStackTagsUpdate.java new file mode 100644 index 000000000000..80a12e4b66c2 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/CloudFormationStackTagsUpdate.java @@ -0,0 +1,96 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.Map; + +/** + * The type used for updating tags in CloudFormationStack resources. + */ +@Fluent +public final class CloudFormationStackTagsUpdate implements JsonSerializable { + /* + * Resource tags. + */ + private Map tags; + + /** + * Creates an instance of CloudFormationStackTagsUpdate class. + */ + public CloudFormationStackTagsUpdate() { + } + + /** + * Get the tags property: Resource tags. + * + * @return the tags value. + */ + public Map tags() { + return this.tags; + } + + /** + * Set the tags property: Resource tags. + * + * @param tags the tags value to set. + * @return the CloudFormationStackTagsUpdate object itself. + */ + public CloudFormationStackTagsUpdate withTags(Map tags) { + this.tags = tags; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeMapField("tags", this.tags, (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of CloudFormationStackTagsUpdate from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of CloudFormationStackTagsUpdate if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the CloudFormationStackTagsUpdate. + */ + public static CloudFormationStackTagsUpdate fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + CloudFormationStackTagsUpdate deserializedCloudFormationStackTagsUpdate + = new CloudFormationStackTagsUpdate(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedCloudFormationStackTagsUpdate.tags = tags; + } else { + reader.skipChildren(); + } + } + + return deserializedCloudFormationStackTagsUpdate; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/CloudFormationStacks.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/CloudFormationStacks.java new file mode 100644 index 000000000000..c1028a1f96a2 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/CloudFormationStacks.java @@ -0,0 +1,158 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** + * Resource collection API of CloudFormationStacks. + */ +public interface CloudFormationStacks { + /** + * List CloudFormationStack resources by subscription ID. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a CloudFormationStack list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable list(); + + /** + * List CloudFormationStack resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a CloudFormationStack list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable list(Context context); + + /** + * List CloudFormationStack resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a CloudFormationStack list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * List CloudFormationStack resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a CloudFormationStack list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Get a CloudFormationStack. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of CloudFormationStack. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a CloudFormationStack along with {@link Response}. + */ + Response getByResourceGroupWithResponse(String resourceGroupName, String name, + Context context); + + /** + * Get a CloudFormationStack. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of CloudFormationStack. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a CloudFormationStack. + */ + CloudFormationStack getByResourceGroup(String resourceGroupName, String name); + + /** + * Delete a CloudFormationStack. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of CloudFormationStack. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByResourceGroup(String resourceGroupName, String name); + + /** + * Delete a CloudFormationStack. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of CloudFormationStack. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String name, Context context); + + /** + * Get a CloudFormationStack. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a CloudFormationStack along with {@link Response}. + */ + CloudFormationStack getById(String id); + + /** + * Get a CloudFormationStack. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a CloudFormationStack along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Delete a CloudFormationStack. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteById(String id); + + /** + * Delete a CloudFormationStack. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new CloudFormationStack resource. + * + * @param name resource name. + * @return the first stage of the new CloudFormationStack definition. + */ + CloudFormationStack.DefinitionStages.Blank define(String name); +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/CloudFrontDistribution.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/CloudFrontDistribution.java new file mode 100644 index 000000000000..745db9159130 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/CloudFrontDistribution.java @@ -0,0 +1,252 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.awsconnector.fluent.models.CloudFrontDistributionInner; +import java.util.Map; + +/** + * An immutable client-side representation of CloudFrontDistribution. + */ +public interface CloudFrontDistribution { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the location property: The geo-location where the resource lives. + * + * @return the location value. + */ + String location(); + + /** + * Gets the tags property: Resource tags. + * + * @return the tags value. + */ + Map tags(); + + /** + * Gets the properties property: The resource-specific properties for this resource. + * + * @return the properties value. + */ + CloudFrontDistributionProperties properties(); + + /** + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the region of the resource. + * + * @return the region of the resource. + */ + Region region(); + + /** + * Gets the name of the resource region. + * + * @return the name of the resource region. + */ + String regionName(); + + /** + * Gets the name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + + /** + * Gets the inner com.azure.resourcemanager.awsconnector.fluent.models.CloudFrontDistributionInner object. + * + * @return the inner object. + */ + CloudFrontDistributionInner innerModel(); + + /** + * The entirety of the CloudFrontDistribution definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithLocation, + DefinitionStages.WithResourceGroup, DefinitionStages.WithCreate { + } + + /** + * The CloudFrontDistribution definition stages. + */ + interface DefinitionStages { + /** + * The first stage of the CloudFrontDistribution definition. + */ + interface Blank extends WithLocation { + } + + /** + * The stage of the CloudFrontDistribution definition allowing to specify location. + */ + interface WithLocation { + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithResourceGroup withRegion(Region location); + + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithResourceGroup withRegion(String location); + } + + /** + * The stage of the CloudFrontDistribution definition allowing to specify parent resource. + */ + interface WithResourceGroup { + /** + * Specifies resourceGroupName. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @return the next definition stage. + */ + WithCreate withExistingResourceGroup(String resourceGroupName); + } + + /** + * The stage of the CloudFrontDistribution 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.WithProperties { + /** + * Executes the create request. + * + * @return the created resource. + */ + CloudFrontDistribution create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + CloudFrontDistribution create(Context context); + } + + /** + * The stage of the CloudFrontDistribution definition allowing to specify tags. + */ + interface WithTags { + /** + * Specifies the tags property: Resource tags.. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + WithCreate withTags(Map tags); + } + + /** + * The stage of the CloudFrontDistribution definition allowing to specify properties. + */ + interface WithProperties { + /** + * Specifies the properties property: The resource-specific properties for this resource.. + * + * @param properties The resource-specific properties for this resource. + * @return the next definition stage. + */ + WithCreate withProperties(CloudFrontDistributionProperties properties); + } + } + + /** + * Begins update for the CloudFrontDistribution resource. + * + * @return the stage of resource update. + */ + CloudFrontDistribution.Update update(); + + /** + * The template for CloudFrontDistribution update. + */ + interface Update extends UpdateStages.WithTags { + /** + * Executes the update request. + * + * @return the updated resource. + */ + CloudFrontDistribution apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + CloudFrontDistribution apply(Context context); + } + + /** + * The CloudFrontDistribution update stages. + */ + interface UpdateStages { + /** + * The stage of the CloudFrontDistribution update allowing to specify tags. + */ + interface WithTags { + /** + * Specifies the tags property: Resource tags.. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + Update withTags(Map tags); + } + } + + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + CloudFrontDistribution refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + CloudFrontDistribution refresh(Context context); +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/CloudFrontDistributionListResult.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/CloudFrontDistributionListResult.java new file mode 100644 index 000000000000..f0cca47378bf --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/CloudFrontDistributionListResult.java @@ -0,0 +1,137 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.awsconnector.fluent.models.CloudFrontDistributionInner; +import java.io.IOException; +import java.util.List; + +/** + * The response of a CloudFrontDistribution list operation. + */ +@Fluent +public final class CloudFrontDistributionListResult implements JsonSerializable { + /* + * The CloudFrontDistribution items on this page + */ + private List value; + + /* + * The link to the next page of items + */ + private String nextLink; + + /** + * Creates an instance of CloudFrontDistributionListResult class. + */ + public CloudFrontDistributionListResult() { + } + + /** + * Get the value property: The CloudFrontDistribution items on this page. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The CloudFrontDistribution items on this page. + * + * @param value the value value to set. + * @return the CloudFrontDistributionListResult object itself. + */ + public CloudFrontDistributionListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The link to the next page of items. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: The link to the next page of items. + * + * @param nextLink the nextLink value to set. + * @return the CloudFrontDistributionListResult object itself. + */ + public CloudFrontDistributionListResult withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property value in model CloudFrontDistributionListResult")); + } else { + value().forEach(e -> e.validate()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(CloudFrontDistributionListResult.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("nextLink", this.nextLink); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of CloudFrontDistributionListResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of CloudFrontDistributionListResult if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the CloudFrontDistributionListResult. + */ + public static CloudFrontDistributionListResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + CloudFrontDistributionListResult deserializedCloudFrontDistributionListResult + = new CloudFrontDistributionListResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> CloudFrontDistributionInner.fromJson(reader1)); + deserializedCloudFrontDistributionListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedCloudFrontDistributionListResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedCloudFrontDistributionListResult; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/CloudFrontDistributionProperties.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/CloudFrontDistributionProperties.java new file mode 100644 index 000000000000..e1101f425563 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/CloudFrontDistributionProperties.java @@ -0,0 +1,314 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.Map; + +/** + * Definition of CloudFrontDistribution. + */ +@Fluent +public final class CloudFrontDistributionProperties implements JsonSerializable { + /* + * AWS Properties + */ + private AwsCloudFrontDistributionProperties awsProperties; + + /* + * Public Cloud Connectors Resource ID + */ + private String publicCloudConnectorsResourceId; + + /* + * AWS Account ID + */ + private String awsAccountId; + + /* + * Amazon Resource Name (ARN) + */ + private String arn; + + /* + * Public Cloud Resource Name + */ + private String publicCloudResourceName; + + /* + * AWS Source Schema + */ + private String awsSourceSchema; + + /* + * AWS Region + */ + private String awsRegion; + + /* + * AWS Tags + */ + private Map awsTags; + + /* + * The status of the last operation. + */ + private ProvisioningState provisioningState; + + /** + * Creates an instance of CloudFrontDistributionProperties class. + */ + public CloudFrontDistributionProperties() { + } + + /** + * Get the awsProperties property: AWS Properties. + * + * @return the awsProperties value. + */ + public AwsCloudFrontDistributionProperties awsProperties() { + return this.awsProperties; + } + + /** + * Set the awsProperties property: AWS Properties. + * + * @param awsProperties the awsProperties value to set. + * @return the CloudFrontDistributionProperties object itself. + */ + public CloudFrontDistributionProperties withAwsProperties(AwsCloudFrontDistributionProperties awsProperties) { + this.awsProperties = awsProperties; + return this; + } + + /** + * Get the publicCloudConnectorsResourceId property: Public Cloud Connectors Resource ID. + * + * @return the publicCloudConnectorsResourceId value. + */ + public String publicCloudConnectorsResourceId() { + return this.publicCloudConnectorsResourceId; + } + + /** + * Set the publicCloudConnectorsResourceId property: Public Cloud Connectors Resource ID. + * + * @param publicCloudConnectorsResourceId the publicCloudConnectorsResourceId value to set. + * @return the CloudFrontDistributionProperties object itself. + */ + public CloudFrontDistributionProperties + withPublicCloudConnectorsResourceId(String publicCloudConnectorsResourceId) { + this.publicCloudConnectorsResourceId = publicCloudConnectorsResourceId; + return this; + } + + /** + * Get the awsAccountId property: AWS Account ID. + * + * @return the awsAccountId value. + */ + public String awsAccountId() { + return this.awsAccountId; + } + + /** + * Set the awsAccountId property: AWS Account ID. + * + * @param awsAccountId the awsAccountId value to set. + * @return the CloudFrontDistributionProperties object itself. + */ + public CloudFrontDistributionProperties withAwsAccountId(String awsAccountId) { + this.awsAccountId = awsAccountId; + return this; + } + + /** + * Get the arn property: Amazon Resource Name (ARN). + * + * @return the arn value. + */ + public String arn() { + return this.arn; + } + + /** + * Set the arn property: Amazon Resource Name (ARN). + * + * @param arn the arn value to set. + * @return the CloudFrontDistributionProperties object itself. + */ + public CloudFrontDistributionProperties withArn(String arn) { + this.arn = arn; + return this; + } + + /** + * Get the publicCloudResourceName property: Public Cloud Resource Name. + * + * @return the publicCloudResourceName value. + */ + public String publicCloudResourceName() { + return this.publicCloudResourceName; + } + + /** + * Set the publicCloudResourceName property: Public Cloud Resource Name. + * + * @param publicCloudResourceName the publicCloudResourceName value to set. + * @return the CloudFrontDistributionProperties object itself. + */ + public CloudFrontDistributionProperties withPublicCloudResourceName(String publicCloudResourceName) { + this.publicCloudResourceName = publicCloudResourceName; + return this; + } + + /** + * Get the awsSourceSchema property: AWS Source Schema. + * + * @return the awsSourceSchema value. + */ + public String awsSourceSchema() { + return this.awsSourceSchema; + } + + /** + * Set the awsSourceSchema property: AWS Source Schema. + * + * @param awsSourceSchema the awsSourceSchema value to set. + * @return the CloudFrontDistributionProperties object itself. + */ + public CloudFrontDistributionProperties withAwsSourceSchema(String awsSourceSchema) { + this.awsSourceSchema = awsSourceSchema; + return this; + } + + /** + * Get the awsRegion property: AWS Region. + * + * @return the awsRegion value. + */ + public String awsRegion() { + return this.awsRegion; + } + + /** + * Set the awsRegion property: AWS Region. + * + * @param awsRegion the awsRegion value to set. + * @return the CloudFrontDistributionProperties object itself. + */ + public CloudFrontDistributionProperties withAwsRegion(String awsRegion) { + this.awsRegion = awsRegion; + return this; + } + + /** + * Get the awsTags property: AWS Tags. + * + * @return the awsTags value. + */ + public Map awsTags() { + return this.awsTags; + } + + /** + * Set the awsTags property: AWS Tags. + * + * @param awsTags the awsTags value to set. + * @return the CloudFrontDistributionProperties object itself. + */ + public CloudFrontDistributionProperties withAwsTags(Map awsTags) { + this.awsTags = awsTags; + return this; + } + + /** + * Get the provisioningState property: The status of the last operation. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (awsProperties() != null) { + awsProperties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("awsProperties", this.awsProperties); + jsonWriter.writeStringField("publicCloudConnectorsResourceId", this.publicCloudConnectorsResourceId); + jsonWriter.writeStringField("awsAccountId", this.awsAccountId); + jsonWriter.writeStringField("arn", this.arn); + jsonWriter.writeStringField("publicCloudResourceName", this.publicCloudResourceName); + jsonWriter.writeStringField("awsSourceSchema", this.awsSourceSchema); + jsonWriter.writeStringField("awsRegion", this.awsRegion); + jsonWriter.writeMapField("awsTags", this.awsTags, (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of CloudFrontDistributionProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of CloudFrontDistributionProperties if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the CloudFrontDistributionProperties. + */ + public static CloudFrontDistributionProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + CloudFrontDistributionProperties deserializedCloudFrontDistributionProperties + = new CloudFrontDistributionProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("awsProperties".equals(fieldName)) { + deserializedCloudFrontDistributionProperties.awsProperties + = AwsCloudFrontDistributionProperties.fromJson(reader); + } else if ("publicCloudConnectorsResourceId".equals(fieldName)) { + deserializedCloudFrontDistributionProperties.publicCloudConnectorsResourceId = reader.getString(); + } else if ("awsAccountId".equals(fieldName)) { + deserializedCloudFrontDistributionProperties.awsAccountId = reader.getString(); + } else if ("arn".equals(fieldName)) { + deserializedCloudFrontDistributionProperties.arn = reader.getString(); + } else if ("publicCloudResourceName".equals(fieldName)) { + deserializedCloudFrontDistributionProperties.publicCloudResourceName = reader.getString(); + } else if ("awsSourceSchema".equals(fieldName)) { + deserializedCloudFrontDistributionProperties.awsSourceSchema = reader.getString(); + } else if ("awsRegion".equals(fieldName)) { + deserializedCloudFrontDistributionProperties.awsRegion = reader.getString(); + } else if ("awsTags".equals(fieldName)) { + Map awsTags = reader.readMap(reader1 -> reader1.getString()); + deserializedCloudFrontDistributionProperties.awsTags = awsTags; + } else if ("provisioningState".equals(fieldName)) { + deserializedCloudFrontDistributionProperties.provisioningState + = ProvisioningState.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedCloudFrontDistributionProperties; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/CloudFrontDistributionTagsUpdate.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/CloudFrontDistributionTagsUpdate.java new file mode 100644 index 000000000000..cd11e5f72e18 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/CloudFrontDistributionTagsUpdate.java @@ -0,0 +1,96 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.Map; + +/** + * The type used for updating tags in CloudFrontDistribution resources. + */ +@Fluent +public final class CloudFrontDistributionTagsUpdate implements JsonSerializable { + /* + * Resource tags. + */ + private Map tags; + + /** + * Creates an instance of CloudFrontDistributionTagsUpdate class. + */ + public CloudFrontDistributionTagsUpdate() { + } + + /** + * Get the tags property: Resource tags. + * + * @return the tags value. + */ + public Map tags() { + return this.tags; + } + + /** + * Set the tags property: Resource tags. + * + * @param tags the tags value to set. + * @return the CloudFrontDistributionTagsUpdate object itself. + */ + public CloudFrontDistributionTagsUpdate withTags(Map tags) { + this.tags = tags; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeMapField("tags", this.tags, (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of CloudFrontDistributionTagsUpdate from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of CloudFrontDistributionTagsUpdate if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the CloudFrontDistributionTagsUpdate. + */ + public static CloudFrontDistributionTagsUpdate fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + CloudFrontDistributionTagsUpdate deserializedCloudFrontDistributionTagsUpdate + = new CloudFrontDistributionTagsUpdate(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedCloudFrontDistributionTagsUpdate.tags = tags; + } else { + reader.skipChildren(); + } + } + + return deserializedCloudFrontDistributionTagsUpdate; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/CloudFrontDistributions.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/CloudFrontDistributions.java new file mode 100644 index 000000000000..8d0641652150 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/CloudFrontDistributions.java @@ -0,0 +1,158 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** + * Resource collection API of CloudFrontDistributions. + */ +public interface CloudFrontDistributions { + /** + * List CloudFrontDistribution resources by subscription ID. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a CloudFrontDistribution list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable list(); + + /** + * List CloudFrontDistribution resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a CloudFrontDistribution list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable list(Context context); + + /** + * List CloudFrontDistribution resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a CloudFrontDistribution list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * List CloudFrontDistribution resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a CloudFrontDistribution list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Get a CloudFrontDistribution. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of CloudFrontDistribution. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a CloudFrontDistribution along with {@link Response}. + */ + Response getByResourceGroupWithResponse(String resourceGroupName, String name, + Context context); + + /** + * Get a CloudFrontDistribution. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of CloudFrontDistribution. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a CloudFrontDistribution. + */ + CloudFrontDistribution getByResourceGroup(String resourceGroupName, String name); + + /** + * Delete a CloudFrontDistribution. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of CloudFrontDistribution. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByResourceGroup(String resourceGroupName, String name); + + /** + * Delete a CloudFrontDistribution. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of CloudFrontDistribution. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String name, Context context); + + /** + * Get a CloudFrontDistribution. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a CloudFrontDistribution along with {@link Response}. + */ + CloudFrontDistribution getById(String id); + + /** + * Get a CloudFrontDistribution. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a CloudFrontDistribution along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Delete a CloudFrontDistribution. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteById(String id); + + /** + * Delete a CloudFrontDistribution. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new CloudFrontDistribution resource. + * + * @param name resource name. + * @return the first stage of the new CloudFrontDistribution definition. + */ + CloudFrontDistribution.DefinitionStages.Blank define(String name); +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/CloudTrail.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/CloudTrail.java new file mode 100644 index 000000000000..8308bd9e1230 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/CloudTrail.java @@ -0,0 +1,252 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.awsconnector.fluent.models.CloudTrailInner; +import java.util.Map; + +/** + * An immutable client-side representation of CloudTrail. + */ +public interface CloudTrail { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the location property: The geo-location where the resource lives. + * + * @return the location value. + */ + String location(); + + /** + * Gets the tags property: Resource tags. + * + * @return the tags value. + */ + Map tags(); + + /** + * Gets the properties property: The resource-specific properties for this resource. + * + * @return the properties value. + */ + CloudTrailProperties properties(); + + /** + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the region of the resource. + * + * @return the region of the resource. + */ + Region region(); + + /** + * Gets the name of the resource region. + * + * @return the name of the resource region. + */ + String regionName(); + + /** + * Gets the name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + + /** + * Gets the inner com.azure.resourcemanager.awsconnector.fluent.models.CloudTrailInner object. + * + * @return the inner object. + */ + CloudTrailInner innerModel(); + + /** + * The entirety of the CloudTrail definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithLocation, + DefinitionStages.WithResourceGroup, DefinitionStages.WithCreate { + } + + /** + * The CloudTrail definition stages. + */ + interface DefinitionStages { + /** + * The first stage of the CloudTrail definition. + */ + interface Blank extends WithLocation { + } + + /** + * The stage of the CloudTrail definition allowing to specify location. + */ + interface WithLocation { + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithResourceGroup withRegion(Region location); + + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithResourceGroup withRegion(String location); + } + + /** + * The stage of the CloudTrail definition allowing to specify parent resource. + */ + interface WithResourceGroup { + /** + * Specifies resourceGroupName. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @return the next definition stage. + */ + WithCreate withExistingResourceGroup(String resourceGroupName); + } + + /** + * The stage of the CloudTrail 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.WithProperties { + /** + * Executes the create request. + * + * @return the created resource. + */ + CloudTrail create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + CloudTrail create(Context context); + } + + /** + * The stage of the CloudTrail definition allowing to specify tags. + */ + interface WithTags { + /** + * Specifies the tags property: Resource tags.. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + WithCreate withTags(Map tags); + } + + /** + * The stage of the CloudTrail definition allowing to specify properties. + */ + interface WithProperties { + /** + * Specifies the properties property: The resource-specific properties for this resource.. + * + * @param properties The resource-specific properties for this resource. + * @return the next definition stage. + */ + WithCreate withProperties(CloudTrailProperties properties); + } + } + + /** + * Begins update for the CloudTrail resource. + * + * @return the stage of resource update. + */ + CloudTrail.Update update(); + + /** + * The template for CloudTrail update. + */ + interface Update extends UpdateStages.WithTags { + /** + * Executes the update request. + * + * @return the updated resource. + */ + CloudTrail apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + CloudTrail apply(Context context); + } + + /** + * The CloudTrail update stages. + */ + interface UpdateStages { + /** + * The stage of the CloudTrail update allowing to specify tags. + */ + interface WithTags { + /** + * Specifies the tags property: Resource tags.. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + Update withTags(Map tags); + } + } + + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + CloudTrail refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + CloudTrail refresh(Context context); +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/CloudTrailListResult.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/CloudTrailListResult.java new file mode 100644 index 000000000000..bcbdfdf1cc93 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/CloudTrailListResult.java @@ -0,0 +1,134 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.awsconnector.fluent.models.CloudTrailInner; +import java.io.IOException; +import java.util.List; + +/** + * The response of a CloudTrailTrail list operation. + */ +@Fluent +public final class CloudTrailListResult implements JsonSerializable { + /* + * The CloudTrailTrail items on this page + */ + private List value; + + /* + * The link to the next page of items + */ + private String nextLink; + + /** + * Creates an instance of CloudTrailListResult class. + */ + public CloudTrailListResult() { + } + + /** + * Get the value property: The CloudTrailTrail items on this page. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The CloudTrailTrail items on this page. + * + * @param value the value value to set. + * @return the CloudTrailListResult object itself. + */ + public CloudTrailListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The link to the next page of items. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: The link to the next page of items. + * + * @param nextLink the nextLink value to set. + * @return the CloudTrailListResult object itself. + */ + public CloudTrailListResult withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property value in model CloudTrailListResult")); + } else { + value().forEach(e -> e.validate()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(CloudTrailListResult.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("nextLink", this.nextLink); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of CloudTrailListResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of CloudTrailListResult if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the CloudTrailListResult. + */ + public static CloudTrailListResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + CloudTrailListResult deserializedCloudTrailListResult = new CloudTrailListResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value = reader.readArray(reader1 -> CloudTrailInner.fromJson(reader1)); + deserializedCloudTrailListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedCloudTrailListResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedCloudTrailListResult; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/CloudTrailProperties.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/CloudTrailProperties.java new file mode 100644 index 000000000000..3df747b64ea9 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/CloudTrailProperties.java @@ -0,0 +1,311 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.Map; + +/** + * Definition of CloudTrailTrail. + */ +@Fluent +public final class CloudTrailProperties implements JsonSerializable { + /* + * AWS Properties + */ + private AwsCloudTrailProperties awsProperties; + + /* + * Public Cloud Connectors Resource ID + */ + private String publicCloudConnectorsResourceId; + + /* + * AWS Account ID + */ + private String awsAccountId; + + /* + * Amazon Resource Name (ARN) + */ + private String arn; + + /* + * Public Cloud Resource Name + */ + private String publicCloudResourceName; + + /* + * AWS Source Schema + */ + private String awsSourceSchema; + + /* + * AWS Region + */ + private String awsRegion; + + /* + * AWS Tags + */ + private Map awsTags; + + /* + * The status of the last operation. + */ + private ProvisioningState provisioningState; + + /** + * Creates an instance of CloudTrailProperties class. + */ + public CloudTrailProperties() { + } + + /** + * Get the awsProperties property: AWS Properties. + * + * @return the awsProperties value. + */ + public AwsCloudTrailProperties awsProperties() { + return this.awsProperties; + } + + /** + * Set the awsProperties property: AWS Properties. + * + * @param awsProperties the awsProperties value to set. + * @return the CloudTrailProperties object itself. + */ + public CloudTrailProperties withAwsProperties(AwsCloudTrailProperties awsProperties) { + this.awsProperties = awsProperties; + return this; + } + + /** + * Get the publicCloudConnectorsResourceId property: Public Cloud Connectors Resource ID. + * + * @return the publicCloudConnectorsResourceId value. + */ + public String publicCloudConnectorsResourceId() { + return this.publicCloudConnectorsResourceId; + } + + /** + * Set the publicCloudConnectorsResourceId property: Public Cloud Connectors Resource ID. + * + * @param publicCloudConnectorsResourceId the publicCloudConnectorsResourceId value to set. + * @return the CloudTrailProperties object itself. + */ + public CloudTrailProperties withPublicCloudConnectorsResourceId(String publicCloudConnectorsResourceId) { + this.publicCloudConnectorsResourceId = publicCloudConnectorsResourceId; + return this; + } + + /** + * Get the awsAccountId property: AWS Account ID. + * + * @return the awsAccountId value. + */ + public String awsAccountId() { + return this.awsAccountId; + } + + /** + * Set the awsAccountId property: AWS Account ID. + * + * @param awsAccountId the awsAccountId value to set. + * @return the CloudTrailProperties object itself. + */ + public CloudTrailProperties withAwsAccountId(String awsAccountId) { + this.awsAccountId = awsAccountId; + return this; + } + + /** + * Get the arn property: Amazon Resource Name (ARN). + * + * @return the arn value. + */ + public String arn() { + return this.arn; + } + + /** + * Set the arn property: Amazon Resource Name (ARN). + * + * @param arn the arn value to set. + * @return the CloudTrailProperties object itself. + */ + public CloudTrailProperties withArn(String arn) { + this.arn = arn; + return this; + } + + /** + * Get the publicCloudResourceName property: Public Cloud Resource Name. + * + * @return the publicCloudResourceName value. + */ + public String publicCloudResourceName() { + return this.publicCloudResourceName; + } + + /** + * Set the publicCloudResourceName property: Public Cloud Resource Name. + * + * @param publicCloudResourceName the publicCloudResourceName value to set. + * @return the CloudTrailProperties object itself. + */ + public CloudTrailProperties withPublicCloudResourceName(String publicCloudResourceName) { + this.publicCloudResourceName = publicCloudResourceName; + return this; + } + + /** + * Get the awsSourceSchema property: AWS Source Schema. + * + * @return the awsSourceSchema value. + */ + public String awsSourceSchema() { + return this.awsSourceSchema; + } + + /** + * Set the awsSourceSchema property: AWS Source Schema. + * + * @param awsSourceSchema the awsSourceSchema value to set. + * @return the CloudTrailProperties object itself. + */ + public CloudTrailProperties withAwsSourceSchema(String awsSourceSchema) { + this.awsSourceSchema = awsSourceSchema; + return this; + } + + /** + * Get the awsRegion property: AWS Region. + * + * @return the awsRegion value. + */ + public String awsRegion() { + return this.awsRegion; + } + + /** + * Set the awsRegion property: AWS Region. + * + * @param awsRegion the awsRegion value to set. + * @return the CloudTrailProperties object itself. + */ + public CloudTrailProperties withAwsRegion(String awsRegion) { + this.awsRegion = awsRegion; + return this; + } + + /** + * Get the awsTags property: AWS Tags. + * + * @return the awsTags value. + */ + public Map awsTags() { + return this.awsTags; + } + + /** + * Set the awsTags property: AWS Tags. + * + * @param awsTags the awsTags value to set. + * @return the CloudTrailProperties object itself. + */ + public CloudTrailProperties withAwsTags(Map awsTags) { + this.awsTags = awsTags; + return this; + } + + /** + * Get the provisioningState property: The status of the last operation. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (awsProperties() != null) { + awsProperties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("awsProperties", this.awsProperties); + jsonWriter.writeStringField("publicCloudConnectorsResourceId", this.publicCloudConnectorsResourceId); + jsonWriter.writeStringField("awsAccountId", this.awsAccountId); + jsonWriter.writeStringField("arn", this.arn); + jsonWriter.writeStringField("publicCloudResourceName", this.publicCloudResourceName); + jsonWriter.writeStringField("awsSourceSchema", this.awsSourceSchema); + jsonWriter.writeStringField("awsRegion", this.awsRegion); + jsonWriter.writeMapField("awsTags", this.awsTags, (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of CloudTrailProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of CloudTrailProperties if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the CloudTrailProperties. + */ + public static CloudTrailProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + CloudTrailProperties deserializedCloudTrailProperties = new CloudTrailProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("awsProperties".equals(fieldName)) { + deserializedCloudTrailProperties.awsProperties = AwsCloudTrailProperties.fromJson(reader); + } else if ("publicCloudConnectorsResourceId".equals(fieldName)) { + deserializedCloudTrailProperties.publicCloudConnectorsResourceId = reader.getString(); + } else if ("awsAccountId".equals(fieldName)) { + deserializedCloudTrailProperties.awsAccountId = reader.getString(); + } else if ("arn".equals(fieldName)) { + deserializedCloudTrailProperties.arn = reader.getString(); + } else if ("publicCloudResourceName".equals(fieldName)) { + deserializedCloudTrailProperties.publicCloudResourceName = reader.getString(); + } else if ("awsSourceSchema".equals(fieldName)) { + deserializedCloudTrailProperties.awsSourceSchema = reader.getString(); + } else if ("awsRegion".equals(fieldName)) { + deserializedCloudTrailProperties.awsRegion = reader.getString(); + } else if ("awsTags".equals(fieldName)) { + Map awsTags = reader.readMap(reader1 -> reader1.getString()); + deserializedCloudTrailProperties.awsTags = awsTags; + } else if ("provisioningState".equals(fieldName)) { + deserializedCloudTrailProperties.provisioningState + = ProvisioningState.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedCloudTrailProperties; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/CloudTrailTagsUpdate.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/CloudTrailTagsUpdate.java new file mode 100644 index 000000000000..306b5926a25e --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/CloudTrailTagsUpdate.java @@ -0,0 +1,95 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.Map; + +/** + * The type used for updating tags in CloudTrailTrail resources. + */ +@Fluent +public final class CloudTrailTagsUpdate implements JsonSerializable { + /* + * Resource tags. + */ + private Map tags; + + /** + * Creates an instance of CloudTrailTagsUpdate class. + */ + public CloudTrailTagsUpdate() { + } + + /** + * Get the tags property: Resource tags. + * + * @return the tags value. + */ + public Map tags() { + return this.tags; + } + + /** + * Set the tags property: Resource tags. + * + * @param tags the tags value to set. + * @return the CloudTrailTagsUpdate object itself. + */ + public CloudTrailTagsUpdate withTags(Map tags) { + this.tags = tags; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeMapField("tags", this.tags, (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of CloudTrailTagsUpdate from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of CloudTrailTagsUpdate if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the CloudTrailTagsUpdate. + */ + public static CloudTrailTagsUpdate fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + CloudTrailTagsUpdate deserializedCloudTrailTagsUpdate = new CloudTrailTagsUpdate(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedCloudTrailTagsUpdate.tags = tags; + } else { + reader.skipChildren(); + } + } + + return deserializedCloudTrailTagsUpdate; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/CloudTrailTrails.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/CloudTrailTrails.java new file mode 100644 index 000000000000..bbceab5ea26e --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/CloudTrailTrails.java @@ -0,0 +1,157 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** + * Resource collection API of CloudTrailTrails. + */ +public interface CloudTrailTrails { + /** + * List CloudTrailTrail resources by subscription ID. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a CloudTrailTrail list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable list(); + + /** + * List CloudTrailTrail resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a CloudTrailTrail list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable list(Context context); + + /** + * List CloudTrailTrail resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a CloudTrailTrail list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * List CloudTrailTrail resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a CloudTrailTrail list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Get a CloudTrailTrail. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of CloudTrailTrail. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a CloudTrailTrail along with {@link Response}. + */ + Response getByResourceGroupWithResponse(String resourceGroupName, String name, Context context); + + /** + * Get a CloudTrailTrail. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of CloudTrailTrail. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a CloudTrailTrail. + */ + CloudTrail getByResourceGroup(String resourceGroupName, String name); + + /** + * Delete a CloudTrailTrail. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of CloudTrailTrail. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByResourceGroup(String resourceGroupName, String name); + + /** + * Delete a CloudTrailTrail. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of CloudTrailTrail. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String name, Context context); + + /** + * Get a CloudTrailTrail. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a CloudTrailTrail along with {@link Response}. + */ + CloudTrail getById(String id); + + /** + * Get a CloudTrailTrail. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a CloudTrailTrail along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Delete a CloudTrailTrail. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteById(String id); + + /** + * Delete a CloudTrailTrail. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new CloudTrail resource. + * + * @param name resource name. + * @return the first stage of the new CloudTrail definition. + */ + CloudTrail.DefinitionStages.Blank define(String name); +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/CloudWatchAlarm.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/CloudWatchAlarm.java new file mode 100644 index 000000000000..1f4d068a2618 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/CloudWatchAlarm.java @@ -0,0 +1,252 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.awsconnector.fluent.models.CloudWatchAlarmInner; +import java.util.Map; + +/** + * An immutable client-side representation of CloudWatchAlarm. + */ +public interface CloudWatchAlarm { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the location property: The geo-location where the resource lives. + * + * @return the location value. + */ + String location(); + + /** + * Gets the tags property: Resource tags. + * + * @return the tags value. + */ + Map tags(); + + /** + * Gets the properties property: The resource-specific properties for this resource. + * + * @return the properties value. + */ + CloudWatchAlarmProperties properties(); + + /** + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the region of the resource. + * + * @return the region of the resource. + */ + Region region(); + + /** + * Gets the name of the resource region. + * + * @return the name of the resource region. + */ + String regionName(); + + /** + * Gets the name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + + /** + * Gets the inner com.azure.resourcemanager.awsconnector.fluent.models.CloudWatchAlarmInner object. + * + * @return the inner object. + */ + CloudWatchAlarmInner innerModel(); + + /** + * The entirety of the CloudWatchAlarm definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithLocation, + DefinitionStages.WithResourceGroup, DefinitionStages.WithCreate { + } + + /** + * The CloudWatchAlarm definition stages. + */ + interface DefinitionStages { + /** + * The first stage of the CloudWatchAlarm definition. + */ + interface Blank extends WithLocation { + } + + /** + * The stage of the CloudWatchAlarm definition allowing to specify location. + */ + interface WithLocation { + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithResourceGroup withRegion(Region location); + + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithResourceGroup withRegion(String location); + } + + /** + * The stage of the CloudWatchAlarm definition allowing to specify parent resource. + */ + interface WithResourceGroup { + /** + * Specifies resourceGroupName. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @return the next definition stage. + */ + WithCreate withExistingResourceGroup(String resourceGroupName); + } + + /** + * The stage of the CloudWatchAlarm 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.WithProperties { + /** + * Executes the create request. + * + * @return the created resource. + */ + CloudWatchAlarm create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + CloudWatchAlarm create(Context context); + } + + /** + * The stage of the CloudWatchAlarm definition allowing to specify tags. + */ + interface WithTags { + /** + * Specifies the tags property: Resource tags.. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + WithCreate withTags(Map tags); + } + + /** + * The stage of the CloudWatchAlarm definition allowing to specify properties. + */ + interface WithProperties { + /** + * Specifies the properties property: The resource-specific properties for this resource.. + * + * @param properties The resource-specific properties for this resource. + * @return the next definition stage. + */ + WithCreate withProperties(CloudWatchAlarmProperties properties); + } + } + + /** + * Begins update for the CloudWatchAlarm resource. + * + * @return the stage of resource update. + */ + CloudWatchAlarm.Update update(); + + /** + * The template for CloudWatchAlarm update. + */ + interface Update extends UpdateStages.WithTags { + /** + * Executes the update request. + * + * @return the updated resource. + */ + CloudWatchAlarm apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + CloudWatchAlarm apply(Context context); + } + + /** + * The CloudWatchAlarm update stages. + */ + interface UpdateStages { + /** + * The stage of the CloudWatchAlarm update allowing to specify tags. + */ + interface WithTags { + /** + * Specifies the tags property: Resource tags.. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + Update withTags(Map tags); + } + } + + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + CloudWatchAlarm refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + CloudWatchAlarm refresh(Context context); +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/CloudWatchAlarmListResult.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/CloudWatchAlarmListResult.java new file mode 100644 index 000000000000..47295255ccd0 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/CloudWatchAlarmListResult.java @@ -0,0 +1,136 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.awsconnector.fluent.models.CloudWatchAlarmInner; +import java.io.IOException; +import java.util.List; + +/** + * The response of a CloudWatchAlarm list operation. + */ +@Fluent +public final class CloudWatchAlarmListResult implements JsonSerializable { + /* + * The CloudWatchAlarm items on this page + */ + private List value; + + /* + * The link to the next page of items + */ + private String nextLink; + + /** + * Creates an instance of CloudWatchAlarmListResult class. + */ + public CloudWatchAlarmListResult() { + } + + /** + * Get the value property: The CloudWatchAlarm items on this page. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The CloudWatchAlarm items on this page. + * + * @param value the value value to set. + * @return the CloudWatchAlarmListResult object itself. + */ + public CloudWatchAlarmListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The link to the next page of items. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: The link to the next page of items. + * + * @param nextLink the nextLink value to set. + * @return the CloudWatchAlarmListResult object itself. + */ + public CloudWatchAlarmListResult withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() == null) { + throw LOGGER.atError() + .log( + new IllegalArgumentException("Missing required property value in model CloudWatchAlarmListResult")); + } else { + value().forEach(e -> e.validate()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(CloudWatchAlarmListResult.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("nextLink", this.nextLink); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of CloudWatchAlarmListResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of CloudWatchAlarmListResult if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the CloudWatchAlarmListResult. + */ + public static CloudWatchAlarmListResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + CloudWatchAlarmListResult deserializedCloudWatchAlarmListResult = new CloudWatchAlarmListResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> CloudWatchAlarmInner.fromJson(reader1)); + deserializedCloudWatchAlarmListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedCloudWatchAlarmListResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedCloudWatchAlarmListResult; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/CloudWatchAlarmProperties.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/CloudWatchAlarmProperties.java new file mode 100644 index 000000000000..beb0837d5127 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/CloudWatchAlarmProperties.java @@ -0,0 +1,311 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.Map; + +/** + * Definition of CloudWatchAlarm. + */ +@Fluent +public final class CloudWatchAlarmProperties implements JsonSerializable { + /* + * AWS Properties + */ + private AwsCloudWatchAlarmProperties awsProperties; + + /* + * Public Cloud Connectors Resource ID + */ + private String publicCloudConnectorsResourceId; + + /* + * AWS Account ID + */ + private String awsAccountId; + + /* + * Amazon Resource Name (ARN) + */ + private String arn; + + /* + * Public Cloud Resource Name + */ + private String publicCloudResourceName; + + /* + * AWS Source Schema + */ + private String awsSourceSchema; + + /* + * AWS Region + */ + private String awsRegion; + + /* + * AWS Tags + */ + private Map awsTags; + + /* + * The status of the last operation. + */ + private ProvisioningState provisioningState; + + /** + * Creates an instance of CloudWatchAlarmProperties class. + */ + public CloudWatchAlarmProperties() { + } + + /** + * Get the awsProperties property: AWS Properties. + * + * @return the awsProperties value. + */ + public AwsCloudWatchAlarmProperties awsProperties() { + return this.awsProperties; + } + + /** + * Set the awsProperties property: AWS Properties. + * + * @param awsProperties the awsProperties value to set. + * @return the CloudWatchAlarmProperties object itself. + */ + public CloudWatchAlarmProperties withAwsProperties(AwsCloudWatchAlarmProperties awsProperties) { + this.awsProperties = awsProperties; + return this; + } + + /** + * Get the publicCloudConnectorsResourceId property: Public Cloud Connectors Resource ID. + * + * @return the publicCloudConnectorsResourceId value. + */ + public String publicCloudConnectorsResourceId() { + return this.publicCloudConnectorsResourceId; + } + + /** + * Set the publicCloudConnectorsResourceId property: Public Cloud Connectors Resource ID. + * + * @param publicCloudConnectorsResourceId the publicCloudConnectorsResourceId value to set. + * @return the CloudWatchAlarmProperties object itself. + */ + public CloudWatchAlarmProperties withPublicCloudConnectorsResourceId(String publicCloudConnectorsResourceId) { + this.publicCloudConnectorsResourceId = publicCloudConnectorsResourceId; + return this; + } + + /** + * Get the awsAccountId property: AWS Account ID. + * + * @return the awsAccountId value. + */ + public String awsAccountId() { + return this.awsAccountId; + } + + /** + * Set the awsAccountId property: AWS Account ID. + * + * @param awsAccountId the awsAccountId value to set. + * @return the CloudWatchAlarmProperties object itself. + */ + public CloudWatchAlarmProperties withAwsAccountId(String awsAccountId) { + this.awsAccountId = awsAccountId; + return this; + } + + /** + * Get the arn property: Amazon Resource Name (ARN). + * + * @return the arn value. + */ + public String arn() { + return this.arn; + } + + /** + * Set the arn property: Amazon Resource Name (ARN). + * + * @param arn the arn value to set. + * @return the CloudWatchAlarmProperties object itself. + */ + public CloudWatchAlarmProperties withArn(String arn) { + this.arn = arn; + return this; + } + + /** + * Get the publicCloudResourceName property: Public Cloud Resource Name. + * + * @return the publicCloudResourceName value. + */ + public String publicCloudResourceName() { + return this.publicCloudResourceName; + } + + /** + * Set the publicCloudResourceName property: Public Cloud Resource Name. + * + * @param publicCloudResourceName the publicCloudResourceName value to set. + * @return the CloudWatchAlarmProperties object itself. + */ + public CloudWatchAlarmProperties withPublicCloudResourceName(String publicCloudResourceName) { + this.publicCloudResourceName = publicCloudResourceName; + return this; + } + + /** + * Get the awsSourceSchema property: AWS Source Schema. + * + * @return the awsSourceSchema value. + */ + public String awsSourceSchema() { + return this.awsSourceSchema; + } + + /** + * Set the awsSourceSchema property: AWS Source Schema. + * + * @param awsSourceSchema the awsSourceSchema value to set. + * @return the CloudWatchAlarmProperties object itself. + */ + public CloudWatchAlarmProperties withAwsSourceSchema(String awsSourceSchema) { + this.awsSourceSchema = awsSourceSchema; + return this; + } + + /** + * Get the awsRegion property: AWS Region. + * + * @return the awsRegion value. + */ + public String awsRegion() { + return this.awsRegion; + } + + /** + * Set the awsRegion property: AWS Region. + * + * @param awsRegion the awsRegion value to set. + * @return the CloudWatchAlarmProperties object itself. + */ + public CloudWatchAlarmProperties withAwsRegion(String awsRegion) { + this.awsRegion = awsRegion; + return this; + } + + /** + * Get the awsTags property: AWS Tags. + * + * @return the awsTags value. + */ + public Map awsTags() { + return this.awsTags; + } + + /** + * Set the awsTags property: AWS Tags. + * + * @param awsTags the awsTags value to set. + * @return the CloudWatchAlarmProperties object itself. + */ + public CloudWatchAlarmProperties withAwsTags(Map awsTags) { + this.awsTags = awsTags; + return this; + } + + /** + * Get the provisioningState property: The status of the last operation. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (awsProperties() != null) { + awsProperties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("awsProperties", this.awsProperties); + jsonWriter.writeStringField("publicCloudConnectorsResourceId", this.publicCloudConnectorsResourceId); + jsonWriter.writeStringField("awsAccountId", this.awsAccountId); + jsonWriter.writeStringField("arn", this.arn); + jsonWriter.writeStringField("publicCloudResourceName", this.publicCloudResourceName); + jsonWriter.writeStringField("awsSourceSchema", this.awsSourceSchema); + jsonWriter.writeStringField("awsRegion", this.awsRegion); + jsonWriter.writeMapField("awsTags", this.awsTags, (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of CloudWatchAlarmProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of CloudWatchAlarmProperties if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IOException If an error occurs while reading the CloudWatchAlarmProperties. + */ + public static CloudWatchAlarmProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + CloudWatchAlarmProperties deserializedCloudWatchAlarmProperties = new CloudWatchAlarmProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("awsProperties".equals(fieldName)) { + deserializedCloudWatchAlarmProperties.awsProperties = AwsCloudWatchAlarmProperties.fromJson(reader); + } else if ("publicCloudConnectorsResourceId".equals(fieldName)) { + deserializedCloudWatchAlarmProperties.publicCloudConnectorsResourceId = reader.getString(); + } else if ("awsAccountId".equals(fieldName)) { + deserializedCloudWatchAlarmProperties.awsAccountId = reader.getString(); + } else if ("arn".equals(fieldName)) { + deserializedCloudWatchAlarmProperties.arn = reader.getString(); + } else if ("publicCloudResourceName".equals(fieldName)) { + deserializedCloudWatchAlarmProperties.publicCloudResourceName = reader.getString(); + } else if ("awsSourceSchema".equals(fieldName)) { + deserializedCloudWatchAlarmProperties.awsSourceSchema = reader.getString(); + } else if ("awsRegion".equals(fieldName)) { + deserializedCloudWatchAlarmProperties.awsRegion = reader.getString(); + } else if ("awsTags".equals(fieldName)) { + Map awsTags = reader.readMap(reader1 -> reader1.getString()); + deserializedCloudWatchAlarmProperties.awsTags = awsTags; + } else if ("provisioningState".equals(fieldName)) { + deserializedCloudWatchAlarmProperties.provisioningState + = ProvisioningState.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedCloudWatchAlarmProperties; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/CloudWatchAlarmTagsUpdate.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/CloudWatchAlarmTagsUpdate.java new file mode 100644 index 000000000000..f7602bd02793 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/CloudWatchAlarmTagsUpdate.java @@ -0,0 +1,95 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.Map; + +/** + * The type used for updating tags in CloudWatchAlarm resources. + */ +@Fluent +public final class CloudWatchAlarmTagsUpdate implements JsonSerializable { + /* + * Resource tags. + */ + private Map tags; + + /** + * Creates an instance of CloudWatchAlarmTagsUpdate class. + */ + public CloudWatchAlarmTagsUpdate() { + } + + /** + * Get the tags property: Resource tags. + * + * @return the tags value. + */ + public Map tags() { + return this.tags; + } + + /** + * Set the tags property: Resource tags. + * + * @param tags the tags value to set. + * @return the CloudWatchAlarmTagsUpdate object itself. + */ + public CloudWatchAlarmTagsUpdate withTags(Map tags) { + this.tags = tags; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeMapField("tags", this.tags, (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of CloudWatchAlarmTagsUpdate from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of CloudWatchAlarmTagsUpdate if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IOException If an error occurs while reading the CloudWatchAlarmTagsUpdate. + */ + public static CloudWatchAlarmTagsUpdate fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + CloudWatchAlarmTagsUpdate deserializedCloudWatchAlarmTagsUpdate = new CloudWatchAlarmTagsUpdate(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedCloudWatchAlarmTagsUpdate.tags = tags; + } else { + reader.skipChildren(); + } + } + + return deserializedCloudWatchAlarmTagsUpdate; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/CloudWatchAlarms.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/CloudWatchAlarms.java new file mode 100644 index 000000000000..338e2f503125 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/CloudWatchAlarms.java @@ -0,0 +1,157 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** + * Resource collection API of CloudWatchAlarms. + */ +public interface CloudWatchAlarms { + /** + * List CloudWatchAlarm resources by subscription ID. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a CloudWatchAlarm list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable list(); + + /** + * List CloudWatchAlarm resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a CloudWatchAlarm list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable list(Context context); + + /** + * List CloudWatchAlarm resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a CloudWatchAlarm list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * List CloudWatchAlarm resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a CloudWatchAlarm list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Get a CloudWatchAlarm. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of CloudWatchAlarm. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a CloudWatchAlarm along with {@link Response}. + */ + Response getByResourceGroupWithResponse(String resourceGroupName, String name, Context context); + + /** + * Get a CloudWatchAlarm. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of CloudWatchAlarm. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a CloudWatchAlarm. + */ + CloudWatchAlarm getByResourceGroup(String resourceGroupName, String name); + + /** + * Delete a CloudWatchAlarm. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of CloudWatchAlarm. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByResourceGroup(String resourceGroupName, String name); + + /** + * Delete a CloudWatchAlarm. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of CloudWatchAlarm. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String name, Context context); + + /** + * Get a CloudWatchAlarm. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a CloudWatchAlarm along with {@link Response}. + */ + CloudWatchAlarm getById(String id); + + /** + * Get a CloudWatchAlarm. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a CloudWatchAlarm along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Delete a CloudWatchAlarm. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteById(String id); + + /** + * Delete a CloudWatchAlarm. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new CloudWatchAlarm resource. + * + * @param name resource name. + * @return the first stage of the new CloudWatchAlarm definition. + */ + CloudWatchAlarm.DefinitionStages.Blank define(String name); +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/CloudWatchLogsConfig.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/CloudWatchLogsConfig.java new file mode 100644 index 000000000000..64c0cbb9e04f --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/CloudWatchLogsConfig.java @@ -0,0 +1,176 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of CloudWatchLogsConfig. + */ +@Fluent +public final class CloudWatchLogsConfig implements JsonSerializable { + /* + *

The group name of the logs in CloudWatch Logs. For more information, see Working + * with Log Groups and Log Streams.

+ */ + private String groupName; + + /* + *

The current status of the logs in CloudWatch Logs for a build project. Valid values are:

  • + * ENABLED: CloudWatch Logs are enabled for this build project.

  • + * DISABLED: CloudWatch Logs are not enabled for this build project.

+ */ + private LogsConfigStatusTypeEnumValue status; + + /* + *

The prefix of the stream name of the CloudWatch Logs. For more information, see Working + * with Log Groups and Log Streams.

+ */ + private String streamName; + + /** + * Creates an instance of CloudWatchLogsConfig class. + */ + public CloudWatchLogsConfig() { + } + + /** + * Get the groupName property: <p> The group name of the logs in CloudWatch Logs. For more information, see + * <a + * href='https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/Working-with-log-groups-and-streams.html'>Working + * with Log Groups and Log Streams</a>. </p>. + * + * @return the groupName value. + */ + public String groupName() { + return this.groupName; + } + + /** + * Set the groupName property: <p> The group name of the logs in CloudWatch Logs. For more information, see + * <a + * href='https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/Working-with-log-groups-and-streams.html'>Working + * with Log Groups and Log Streams</a>. </p>. + * + * @param groupName the groupName value to set. + * @return the CloudWatchLogsConfig object itself. + */ + public CloudWatchLogsConfig withGroupName(String groupName) { + this.groupName = groupName; + return this; + } + + /** + * Get the status property: <p>The current status of the logs in CloudWatch Logs for a build project. Valid + * values are:</p> <ul> <li> <p> <code>ENABLED</code>: CloudWatch Logs are + * enabled for this build project.</p> </li> <li> <p> <code>DISABLED</code>: + * CloudWatch Logs are not enabled for this build project.</p> </li> </ul>. + * + * @return the status value. + */ + public LogsConfigStatusTypeEnumValue status() { + return this.status; + } + + /** + * Set the status property: <p>The current status of the logs in CloudWatch Logs for a build project. Valid + * values are:</p> <ul> <li> <p> <code>ENABLED</code>: CloudWatch Logs are + * enabled for this build project.</p> </li> <li> <p> <code>DISABLED</code>: + * CloudWatch Logs are not enabled for this build project.</p> </li> </ul>. + * + * @param status the status value to set. + * @return the CloudWatchLogsConfig object itself. + */ + public CloudWatchLogsConfig withStatus(LogsConfigStatusTypeEnumValue status) { + this.status = status; + return this; + } + + /** + * Get the streamName property: <p> The prefix of the stream name of the CloudWatch Logs. For more + * information, see <a + * href='https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/Working-with-log-groups-and-streams.html'>Working + * with Log Groups and Log Streams</a>. </p>. + * + * @return the streamName value. + */ + public String streamName() { + return this.streamName; + } + + /** + * Set the streamName property: <p> The prefix of the stream name of the CloudWatch Logs. For more + * information, see <a + * href='https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/Working-with-log-groups-and-streams.html'>Working + * with Log Groups and Log Streams</a>. </p>. + * + * @param streamName the streamName value to set. + * @return the CloudWatchLogsConfig object itself. + */ + public CloudWatchLogsConfig withStreamName(String streamName) { + this.streamName = streamName; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (status() != null) { + status().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("groupName", this.groupName); + jsonWriter.writeJsonField("status", this.status); + jsonWriter.writeStringField("streamName", this.streamName); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of CloudWatchLogsConfig from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of CloudWatchLogsConfig if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the CloudWatchLogsConfig. + */ + public static CloudWatchLogsConfig fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + CloudWatchLogsConfig deserializedCloudWatchLogsConfig = new CloudWatchLogsConfig(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("groupName".equals(fieldName)) { + deserializedCloudWatchLogsConfig.groupName = reader.getString(); + } else if ("status".equals(fieldName)) { + deserializedCloudWatchLogsConfig.status = LogsConfigStatusTypeEnumValue.fromJson(reader); + } else if ("streamName".equals(fieldName)) { + deserializedCloudWatchLogsConfig.streamName = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedCloudWatchLogsConfig; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ClusterConfig.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ClusterConfig.java new file mode 100644 index 000000000000..317268c367b7 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ClusterConfig.java @@ -0,0 +1,449 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of ClusterConfig. + */ +@Fluent +public final class ClusterConfig implements JsonSerializable { + /* + *

Container for cold storage configuration options.

+ */ + private ColdStorageOptions coldStorageOptions; + + /* + *

Number of dedicated master nodes in the cluster. This number must be greater than 2 and not 4, otherwise you + * receive a validation exception.

+ */ + private Integer dedicatedMasterCount; + + /* + *

Indicates whether dedicated master nodes are enabled for the cluster.True if the cluster will use + * a dedicated master node.False if the cluster will not.

+ */ + private Boolean dedicatedMasterEnabled; + + /* + *

OpenSearch Service instance type of the dedicated master nodes in the cluster.

+ */ + private OpenSearchPartitionInstanceTypeEnumValue dedicatedMasterType; + + /* + *

Number of data nodes in the cluster. This number must be greater than 1, otherwise you receive a validation + * exception.

+ */ + private Integer instanceCount; + + /* + *

Instance type of data nodes in the cluster.

+ */ + private OpenSearchPartitionInstanceTypeEnumValue instanceType; + + /* + *

A boolean that indicates whether a multi-AZ domain is turned on with a standby AZ. For more information, see + * + * Configuring a multi-AZ domain in Amazon OpenSearch Service.

+ */ + private Boolean multiAZWithStandbyEnabled; + + /* + *

The number of warm nodes in the cluster.

+ */ + private Integer warmCount; + + /* + *

Whether to enable warm storage for the cluster.

+ */ + private Boolean warmEnabled; + + /* + *

The instance type for the cluster's warm nodes.

+ */ + private OpenSearchWarmPartitionInstanceTypeEnumValue warmType; + + /* + *

Container for zone awareness configuration options. Only required if ZoneAwarenessEnabled is + * true.

+ */ + private ZoneAwarenessConfig zoneAwarenessConfig; + + /* + *

Indicates whether multiple Availability Zones are enabled. For more information, see + * Configuring a multi-AZ domain in Amazon OpenSearch Service.

+ */ + private Boolean zoneAwarenessEnabled; + + /** + * Creates an instance of ClusterConfig class. + */ + public ClusterConfig() { + } + + /** + * Get the coldStorageOptions property: <p>Container for cold storage configuration options.</p>. + * + * @return the coldStorageOptions value. + */ + public ColdStorageOptions coldStorageOptions() { + return this.coldStorageOptions; + } + + /** + * Set the coldStorageOptions property: <p>Container for cold storage configuration options.</p>. + * + * @param coldStorageOptions the coldStorageOptions value to set. + * @return the ClusterConfig object itself. + */ + public ClusterConfig withColdStorageOptions(ColdStorageOptions coldStorageOptions) { + this.coldStorageOptions = coldStorageOptions; + return this; + } + + /** + * Get the dedicatedMasterCount property: <p>Number of dedicated master nodes in the cluster. This number must + * be greater than 2 and not 4, otherwise you receive a validation exception.</p>. + * + * @return the dedicatedMasterCount value. + */ + public Integer dedicatedMasterCount() { + return this.dedicatedMasterCount; + } + + /** + * Set the dedicatedMasterCount property: <p>Number of dedicated master nodes in the cluster. This number must + * be greater than 2 and not 4, otherwise you receive a validation exception.</p>. + * + * @param dedicatedMasterCount the dedicatedMasterCount value to set. + * @return the ClusterConfig object itself. + */ + public ClusterConfig withDedicatedMasterCount(Integer dedicatedMasterCount) { + this.dedicatedMasterCount = dedicatedMasterCount; + return this; + } + + /** + * Get the dedicatedMasterEnabled property: <p>Indicates whether dedicated master nodes are enabled for the + * cluster.<code>True</code> if the cluster will use a dedicated master + * node.<code>False</code> if the cluster will not.</p>. + * + * @return the dedicatedMasterEnabled value. + */ + public Boolean dedicatedMasterEnabled() { + return this.dedicatedMasterEnabled; + } + + /** + * Set the dedicatedMasterEnabled property: <p>Indicates whether dedicated master nodes are enabled for the + * cluster.<code>True</code> if the cluster will use a dedicated master + * node.<code>False</code> if the cluster will not.</p>. + * + * @param dedicatedMasterEnabled the dedicatedMasterEnabled value to set. + * @return the ClusterConfig object itself. + */ + public ClusterConfig withDedicatedMasterEnabled(Boolean dedicatedMasterEnabled) { + this.dedicatedMasterEnabled = dedicatedMasterEnabled; + return this; + } + + /** + * Get the dedicatedMasterType property: <p>OpenSearch Service instance type of the dedicated master nodes in + * the cluster.</p>. + * + * @return the dedicatedMasterType value. + */ + public OpenSearchPartitionInstanceTypeEnumValue dedicatedMasterType() { + return this.dedicatedMasterType; + } + + /** + * Set the dedicatedMasterType property: <p>OpenSearch Service instance type of the dedicated master nodes in + * the cluster.</p>. + * + * @param dedicatedMasterType the dedicatedMasterType value to set. + * @return the ClusterConfig object itself. + */ + public ClusterConfig withDedicatedMasterType(OpenSearchPartitionInstanceTypeEnumValue dedicatedMasterType) { + this.dedicatedMasterType = dedicatedMasterType; + return this; + } + + /** + * Get the instanceCount property: <p>Number of data nodes in the cluster. This number must be greater than 1, + * otherwise you receive a validation exception.</p>. + * + * @return the instanceCount value. + */ + public Integer instanceCount() { + return this.instanceCount; + } + + /** + * Set the instanceCount property: <p>Number of data nodes in the cluster. This number must be greater than 1, + * otherwise you receive a validation exception.</p>. + * + * @param instanceCount the instanceCount value to set. + * @return the ClusterConfig object itself. + */ + public ClusterConfig withInstanceCount(Integer instanceCount) { + this.instanceCount = instanceCount; + return this; + } + + /** + * Get the instanceType property: <p>Instance type of data nodes in the cluster.</p>. + * + * @return the instanceType value. + */ + public OpenSearchPartitionInstanceTypeEnumValue instanceType() { + return this.instanceType; + } + + /** + * Set the instanceType property: <p>Instance type of data nodes in the cluster.</p>. + * + * @param instanceType the instanceType value to set. + * @return the ClusterConfig object itself. + */ + public ClusterConfig withInstanceType(OpenSearchPartitionInstanceTypeEnumValue instanceType) { + this.instanceType = instanceType; + return this; + } + + /** + * Get the multiAZWithStandbyEnabled property: <p>A boolean that indicates whether a multi-AZ domain is turned + * on with a standby AZ. For more information, see <a + * href='https://docs.aws.amazon.com/opensearch-service/latest/developerguide/managedomains-multiaz.html'>Configuring + * a multi-AZ domain in Amazon OpenSearch Service</a>. </p>. + * + * @return the multiAZWithStandbyEnabled value. + */ + public Boolean multiAZWithStandbyEnabled() { + return this.multiAZWithStandbyEnabled; + } + + /** + * Set the multiAZWithStandbyEnabled property: <p>A boolean that indicates whether a multi-AZ domain is turned + * on with a standby AZ. For more information, see <a + * href='https://docs.aws.amazon.com/opensearch-service/latest/developerguide/managedomains-multiaz.html'>Configuring + * a multi-AZ domain in Amazon OpenSearch Service</a>. </p>. + * + * @param multiAZWithStandbyEnabled the multiAZWithStandbyEnabled value to set. + * @return the ClusterConfig object itself. + */ + public ClusterConfig withMultiAZWithStandbyEnabled(Boolean multiAZWithStandbyEnabled) { + this.multiAZWithStandbyEnabled = multiAZWithStandbyEnabled; + return this; + } + + /** + * Get the warmCount property: <p>The number of warm nodes in the cluster.</p>. + * + * @return the warmCount value. + */ + public Integer warmCount() { + return this.warmCount; + } + + /** + * Set the warmCount property: <p>The number of warm nodes in the cluster.</p>. + * + * @param warmCount the warmCount value to set. + * @return the ClusterConfig object itself. + */ + public ClusterConfig withWarmCount(Integer warmCount) { + this.warmCount = warmCount; + return this; + } + + /** + * Get the warmEnabled property: <p>Whether to enable warm storage for the cluster.</p>. + * + * @return the warmEnabled value. + */ + public Boolean warmEnabled() { + return this.warmEnabled; + } + + /** + * Set the warmEnabled property: <p>Whether to enable warm storage for the cluster.</p>. + * + * @param warmEnabled the warmEnabled value to set. + * @return the ClusterConfig object itself. + */ + public ClusterConfig withWarmEnabled(Boolean warmEnabled) { + this.warmEnabled = warmEnabled; + return this; + } + + /** + * Get the warmType property: <p>The instance type for the cluster's warm nodes.</p>. + * + * @return the warmType value. + */ + public OpenSearchWarmPartitionInstanceTypeEnumValue warmType() { + return this.warmType; + } + + /** + * Set the warmType property: <p>The instance type for the cluster's warm nodes.</p>. + * + * @param warmType the warmType value to set. + * @return the ClusterConfig object itself. + */ + public ClusterConfig withWarmType(OpenSearchWarmPartitionInstanceTypeEnumValue warmType) { + this.warmType = warmType; + return this; + } + + /** + * Get the zoneAwarenessConfig property: <p>Container for zone awareness configuration options. Only required + * if <code>ZoneAwarenessEnabled</code> is <code>true</code>.</p>. + * + * @return the zoneAwarenessConfig value. + */ + public ZoneAwarenessConfig zoneAwarenessConfig() { + return this.zoneAwarenessConfig; + } + + /** + * Set the zoneAwarenessConfig property: <p>Container for zone awareness configuration options. Only required + * if <code>ZoneAwarenessEnabled</code> is <code>true</code>.</p>. + * + * @param zoneAwarenessConfig the zoneAwarenessConfig value to set. + * @return the ClusterConfig object itself. + */ + public ClusterConfig withZoneAwarenessConfig(ZoneAwarenessConfig zoneAwarenessConfig) { + this.zoneAwarenessConfig = zoneAwarenessConfig; + return this; + } + + /** + * Get the zoneAwarenessEnabled property: <p>Indicates whether multiple Availability Zones are enabled. For + * more information, see <a + * href='https://docs.aws.amazon.com/opensearch-service/latest/developerguide/managedomains-multiaz.html'>Configuring + * a multi-AZ domain in Amazon OpenSearch Service</a>.</p>. + * + * @return the zoneAwarenessEnabled value. + */ + public Boolean zoneAwarenessEnabled() { + return this.zoneAwarenessEnabled; + } + + /** + * Set the zoneAwarenessEnabled property: <p>Indicates whether multiple Availability Zones are enabled. For + * more information, see <a + * href='https://docs.aws.amazon.com/opensearch-service/latest/developerguide/managedomains-multiaz.html'>Configuring + * a multi-AZ domain in Amazon OpenSearch Service</a>.</p>. + * + * @param zoneAwarenessEnabled the zoneAwarenessEnabled value to set. + * @return the ClusterConfig object itself. + */ + public ClusterConfig withZoneAwarenessEnabled(Boolean zoneAwarenessEnabled) { + this.zoneAwarenessEnabled = zoneAwarenessEnabled; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (coldStorageOptions() != null) { + coldStorageOptions().validate(); + } + if (dedicatedMasterType() != null) { + dedicatedMasterType().validate(); + } + if (instanceType() != null) { + instanceType().validate(); + } + if (warmType() != null) { + warmType().validate(); + } + if (zoneAwarenessConfig() != null) { + zoneAwarenessConfig().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("coldStorageOptions", this.coldStorageOptions); + jsonWriter.writeNumberField("dedicatedMasterCount", this.dedicatedMasterCount); + jsonWriter.writeBooleanField("dedicatedMasterEnabled", this.dedicatedMasterEnabled); + jsonWriter.writeJsonField("dedicatedMasterType", this.dedicatedMasterType); + jsonWriter.writeNumberField("instanceCount", this.instanceCount); + jsonWriter.writeJsonField("instanceType", this.instanceType); + jsonWriter.writeBooleanField("multiAZWithStandbyEnabled", this.multiAZWithStandbyEnabled); + jsonWriter.writeNumberField("warmCount", this.warmCount); + jsonWriter.writeBooleanField("warmEnabled", this.warmEnabled); + jsonWriter.writeJsonField("warmType", this.warmType); + jsonWriter.writeJsonField("zoneAwarenessConfig", this.zoneAwarenessConfig); + jsonWriter.writeBooleanField("zoneAwarenessEnabled", this.zoneAwarenessEnabled); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ClusterConfig from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ClusterConfig if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the ClusterConfig. + */ + public static ClusterConfig fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ClusterConfig deserializedClusterConfig = new ClusterConfig(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("coldStorageOptions".equals(fieldName)) { + deserializedClusterConfig.coldStorageOptions = ColdStorageOptions.fromJson(reader); + } else if ("dedicatedMasterCount".equals(fieldName)) { + deserializedClusterConfig.dedicatedMasterCount = reader.getNullable(JsonReader::getInt); + } else if ("dedicatedMasterEnabled".equals(fieldName)) { + deserializedClusterConfig.dedicatedMasterEnabled = reader.getNullable(JsonReader::getBoolean); + } else if ("dedicatedMasterType".equals(fieldName)) { + deserializedClusterConfig.dedicatedMasterType + = OpenSearchPartitionInstanceTypeEnumValue.fromJson(reader); + } else if ("instanceCount".equals(fieldName)) { + deserializedClusterConfig.instanceCount = reader.getNullable(JsonReader::getInt); + } else if ("instanceType".equals(fieldName)) { + deserializedClusterConfig.instanceType = OpenSearchPartitionInstanceTypeEnumValue.fromJson(reader); + } else if ("multiAZWithStandbyEnabled".equals(fieldName)) { + deserializedClusterConfig.multiAZWithStandbyEnabled = reader.getNullable(JsonReader::getBoolean); + } else if ("warmCount".equals(fieldName)) { + deserializedClusterConfig.warmCount = reader.getNullable(JsonReader::getInt); + } else if ("warmEnabled".equals(fieldName)) { + deserializedClusterConfig.warmEnabled = reader.getNullable(JsonReader::getBoolean); + } else if ("warmType".equals(fieldName)) { + deserializedClusterConfig.warmType = OpenSearchWarmPartitionInstanceTypeEnumValue.fromJson(reader); + } else if ("zoneAwarenessConfig".equals(fieldName)) { + deserializedClusterConfig.zoneAwarenessConfig = ZoneAwarenessConfig.fromJson(reader); + } else if ("zoneAwarenessEnabled".equals(fieldName)) { + deserializedClusterConfig.zoneAwarenessEnabled = reader.getNullable(JsonReader::getBoolean); + } else { + reader.skipChildren(); + } + } + + return deserializedClusterConfig; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ClusterConfiguration.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ClusterConfiguration.java new file mode 100644 index 000000000000..bfdf97832666 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ClusterConfiguration.java @@ -0,0 +1,100 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of ClusterConfiguration. + */ +@Fluent +public final class ClusterConfiguration implements JsonSerializable { + /* + * The details of the execute command configuration. The details of the execute command configuration. + */ + private ExecuteCommandConfiguration executeCommandConfiguration; + + /** + * Creates an instance of ClusterConfiguration class. + */ + public ClusterConfiguration() { + } + + /** + * Get the executeCommandConfiguration property: The details of the execute command configuration. The details of + * the execute command configuration. + * + * @return the executeCommandConfiguration value. + */ + public ExecuteCommandConfiguration executeCommandConfiguration() { + return this.executeCommandConfiguration; + } + + /** + * Set the executeCommandConfiguration property: The details of the execute command configuration. The details of + * the execute command configuration. + * + * @param executeCommandConfiguration the executeCommandConfiguration value to set. + * @return the ClusterConfiguration object itself. + */ + public ClusterConfiguration + withExecuteCommandConfiguration(ExecuteCommandConfiguration executeCommandConfiguration) { + this.executeCommandConfiguration = executeCommandConfiguration; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (executeCommandConfiguration() != null) { + executeCommandConfiguration().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("executeCommandConfiguration", this.executeCommandConfiguration); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ClusterConfiguration from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ClusterConfiguration if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the ClusterConfiguration. + */ + public static ClusterConfiguration fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ClusterConfiguration deserializedClusterConfiguration = new ClusterConfiguration(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("executeCommandConfiguration".equals(fieldName)) { + deserializedClusterConfiguration.executeCommandConfiguration + = ExecuteCommandConfiguration.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedClusterConfiguration; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ClusterEndpointEncryptionType.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ClusterEndpointEncryptionType.java new file mode 100644 index 000000000000..4974df0fc334 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ClusterEndpointEncryptionType.java @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * ClusterEndpointEncryptionType enum. + */ +public final class ClusterEndpointEncryptionType extends ExpandableStringEnum { + /** + * Static value NONE for ClusterEndpointEncryptionType. + */ + public static final ClusterEndpointEncryptionType NONE = fromString("NONE"); + + /** + * Static value TLS for ClusterEndpointEncryptionType. + */ + public static final ClusterEndpointEncryptionType TLS = fromString("TLS"); + + /** + * Creates a new instance of ClusterEndpointEncryptionType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ClusterEndpointEncryptionType() { + } + + /** + * Creates or finds a ClusterEndpointEncryptionType from its string representation. + * + * @param name a name to look for. + * @return the corresponding ClusterEndpointEncryptionType. + */ + public static ClusterEndpointEncryptionType fromString(String name) { + return fromString(name, ClusterEndpointEncryptionType.class); + } + + /** + * Gets known ClusterEndpointEncryptionType values. + * + * @return known ClusterEndpointEncryptionType values. + */ + public static Collection values() { + return values(ClusterEndpointEncryptionType.class); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ClusterEndpointEncryptionTypeEnumValue.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ClusterEndpointEncryptionTypeEnumValue.java new file mode 100644 index 000000000000..765a451eeccd --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ClusterEndpointEncryptionTypeEnumValue.java @@ -0,0 +1,96 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of ClusterEndpointEncryptionTypeEnumValue. + */ +@Fluent +public final class ClusterEndpointEncryptionTypeEnumValue + implements JsonSerializable { + /* + * Property value + */ + private ClusterEndpointEncryptionType value; + + /** + * Creates an instance of ClusterEndpointEncryptionTypeEnumValue class. + */ + public ClusterEndpointEncryptionTypeEnumValue() { + } + + /** + * Get the value property: Property value. + * + * @return the value value. + */ + public ClusterEndpointEncryptionType value() { + return this.value; + } + + /** + * Set the value property: Property value. + * + * @param value the value value to set. + * @return the ClusterEndpointEncryptionTypeEnumValue object itself. + */ + public ClusterEndpointEncryptionTypeEnumValue withValue(ClusterEndpointEncryptionType value) { + this.value = value; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("value", this.value == null ? null : this.value.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ClusterEndpointEncryptionTypeEnumValue from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ClusterEndpointEncryptionTypeEnumValue if the JsonReader was pointing to an instance of + * it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ClusterEndpointEncryptionTypeEnumValue. + */ + public static ClusterEndpointEncryptionTypeEnumValue fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ClusterEndpointEncryptionTypeEnumValue deserializedClusterEndpointEncryptionTypeEnumValue + = new ClusterEndpointEncryptionTypeEnumValue(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + deserializedClusterEndpointEncryptionTypeEnumValue.value + = ClusterEndpointEncryptionType.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedClusterEndpointEncryptionTypeEnumValue; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ClusterHealth.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ClusterHealth.java new file mode 100644 index 000000000000..8f005a1c0def --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ClusterHealth.java @@ -0,0 +1,101 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Definition of ClusterHealth. + */ +@Fluent +public final class ClusterHealth implements JsonSerializable { + /* + *

An object representing the health issues of your local Amazon EKS cluster on an Amazon Web Services + * Outpost.

+ */ + private List issues; + + /** + * Creates an instance of ClusterHealth class. + */ + public ClusterHealth() { + } + + /** + * Get the issues property: <p>An object representing the health issues of your local Amazon EKS cluster on an + * Amazon Web Services Outpost.</p>. + * + * @return the issues value. + */ + public List issues() { + return this.issues; + } + + /** + * Set the issues property: <p>An object representing the health issues of your local Amazon EKS cluster on an + * Amazon Web Services Outpost.</p>. + * + * @param issues the issues value to set. + * @return the ClusterHealth object itself. + */ + public ClusterHealth withIssues(List issues) { + this.issues = issues; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (issues() != null) { + issues().forEach(e -> e.validate()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("issues", this.issues, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ClusterHealth from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ClusterHealth if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the ClusterHealth. + */ + public static ClusterHealth fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ClusterHealth deserializedClusterHealth = new ClusterHealth(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("issues".equals(fieldName)) { + List issues = reader.readArray(reader1 -> ClusterIssue.fromJson(reader1)); + deserializedClusterHealth.issues = issues; + } else { + reader.skipChildren(); + } + } + + return deserializedClusterHealth; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ClusterIssue.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ClusterIssue.java new file mode 100644 index 000000000000..29a51269cf76 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ClusterIssue.java @@ -0,0 +1,154 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Definition of ClusterIssue. + */ +@Fluent +public final class ClusterIssue implements JsonSerializable { + /* + *

The error code of the issue.

+ */ + private ClusterIssueCodeEnumValue code; + + /* + *

A description of the issue.

+ */ + private String message; + + /* + *

The resource IDs that the issue relates to.

+ */ + private List resourceIds; + + /** + * Creates an instance of ClusterIssue class. + */ + public ClusterIssue() { + } + + /** + * Get the code property: <p>The error code of the issue.</p>. + * + * @return the code value. + */ + public ClusterIssueCodeEnumValue code() { + return this.code; + } + + /** + * Set the code property: <p>The error code of the issue.</p>. + * + * @param code the code value to set. + * @return the ClusterIssue object itself. + */ + public ClusterIssue withCode(ClusterIssueCodeEnumValue code) { + this.code = code; + return this; + } + + /** + * Get the message property: <p>A description of the issue.</p>. + * + * @return the message value. + */ + public String message() { + return this.message; + } + + /** + * Set the message property: <p>A description of the issue.</p>. + * + * @param message the message value to set. + * @return the ClusterIssue object itself. + */ + public ClusterIssue withMessage(String message) { + this.message = message; + return this; + } + + /** + * Get the resourceIds property: <p>The resource IDs that the issue relates to.</p>. + * + * @return the resourceIds value. + */ + public List resourceIds() { + return this.resourceIds; + } + + /** + * Set the resourceIds property: <p>The resource IDs that the issue relates to.</p>. + * + * @param resourceIds the resourceIds value to set. + * @return the ClusterIssue object itself. + */ + public ClusterIssue withResourceIds(List resourceIds) { + this.resourceIds = resourceIds; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (code() != null) { + code().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("code", this.code); + jsonWriter.writeStringField("message", this.message); + jsonWriter.writeArrayField("resourceIds", this.resourceIds, (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ClusterIssue from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ClusterIssue if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the ClusterIssue. + */ + public static ClusterIssue fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ClusterIssue deserializedClusterIssue = new ClusterIssue(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("code".equals(fieldName)) { + deserializedClusterIssue.code = ClusterIssueCodeEnumValue.fromJson(reader); + } else if ("message".equals(fieldName)) { + deserializedClusterIssue.message = reader.getString(); + } else if ("resourceIds".equals(fieldName)) { + List resourceIds = reader.readArray(reader1 -> reader1.getString()); + deserializedClusterIssue.resourceIds = resourceIds; + } else { + reader.skipChildren(); + } + } + + return deserializedClusterIssue; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ClusterIssueCode.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ClusterIssueCode.java new file mode 100644 index 000000000000..2c5b360995eb --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ClusterIssueCode.java @@ -0,0 +1,136 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * ClusterIssueCode enum. + */ +public final class ClusterIssueCode extends ExpandableStringEnum { + /** + * Static value AccessDenied for ClusterIssueCode. + */ + public static final ClusterIssueCode ACCESS_DENIED = fromString("AccessDenied"); + + /** + * Static value ClusterUnreachable for ClusterIssueCode. + */ + public static final ClusterIssueCode CLUSTER_UNREACHABLE = fromString("ClusterUnreachable"); + + /** + * Static value ConfigurationConflict for ClusterIssueCode. + */ + public static final ClusterIssueCode CONFIGURATION_CONFLICT = fromString("ConfigurationConflict"); + + /** + * Static value Ec2SecurityGroupNotFound for ClusterIssueCode. + */ + public static final ClusterIssueCode EC2SECURITY_GROUP_NOT_FOUND = fromString("Ec2SecurityGroupNotFound"); + + /** + * Static value Ec2ServiceNotSubscribed for ClusterIssueCode. + */ + public static final ClusterIssueCode EC2SERVICE_NOT_SUBSCRIBED = fromString("Ec2ServiceNotSubscribed"); + + /** + * Static value Ec2SubnetNotFound for ClusterIssueCode. + */ + public static final ClusterIssueCode EC2SUBNET_NOT_FOUND = fromString("Ec2SubnetNotFound"); + + /** + * Static value IamRoleNotFound for ClusterIssueCode. + */ + public static final ClusterIssueCode IAM_ROLE_NOT_FOUND = fromString("IamRoleNotFound"); + + /** + * Static value InsufficientFreeAddresses for ClusterIssueCode. + */ + public static final ClusterIssueCode INSUFFICIENT_FREE_ADDRESSES = fromString("InsufficientFreeAddresses"); + + /** + * Static value InternalFailure for ClusterIssueCode. + */ + public static final ClusterIssueCode INTERNAL_FAILURE = fromString("InternalFailure"); + + /** + * Static value KmsGrantRevoked for ClusterIssueCode. + */ + public static final ClusterIssueCode KMS_GRANT_REVOKED = fromString("KmsGrantRevoked"); + + /** + * Static value KmsKeyDisabled for ClusterIssueCode. + */ + public static final ClusterIssueCode KMS_KEY_DISABLED = fromString("KmsKeyDisabled"); + + /** + * Static value KmsKeyMarkedForDeletion for ClusterIssueCode. + */ + public static final ClusterIssueCode KMS_KEY_MARKED_FOR_DELETION = fromString("KmsKeyMarkedForDeletion"); + + /** + * Static value KmsKeyNotFound for ClusterIssueCode. + */ + public static final ClusterIssueCode KMS_KEY_NOT_FOUND = fromString("KmsKeyNotFound"); + + /** + * Static value Other for ClusterIssueCode. + */ + public static final ClusterIssueCode OTHER = fromString("Other"); + + /** + * Static value ResourceLimitExceeded for ClusterIssueCode. + */ + public static final ClusterIssueCode RESOURCE_LIMIT_EXCEEDED = fromString("ResourceLimitExceeded"); + + /** + * Static value ResourceNotFound for ClusterIssueCode. + */ + public static final ClusterIssueCode RESOURCE_NOT_FOUND = fromString("ResourceNotFound"); + + /** + * Static value StsRegionalEndpointDisabled for ClusterIssueCode. + */ + public static final ClusterIssueCode STS_REGIONAL_ENDPOINT_DISABLED = fromString("StsRegionalEndpointDisabled"); + + /** + * Static value UnsupportedVersion for ClusterIssueCode. + */ + public static final ClusterIssueCode UNSUPPORTED_VERSION = fromString("UnsupportedVersion"); + + /** + * Static value VpcNotFound for ClusterIssueCode. + */ + public static final ClusterIssueCode VPC_NOT_FOUND = fromString("VpcNotFound"); + + /** + * Creates a new instance of ClusterIssueCode value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ClusterIssueCode() { + } + + /** + * Creates or finds a ClusterIssueCode from its string representation. + * + * @param name a name to look for. + * @return the corresponding ClusterIssueCode. + */ + public static ClusterIssueCode fromString(String name) { + return fromString(name, ClusterIssueCode.class); + } + + /** + * Gets known ClusterIssueCode values. + * + * @return known ClusterIssueCode values. + */ + public static Collection values() { + return values(ClusterIssueCode.class); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ClusterIssueCodeEnumValue.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ClusterIssueCodeEnumValue.java new file mode 100644 index 000000000000..9bc87f2dcb0f --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ClusterIssueCodeEnumValue.java @@ -0,0 +1,93 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of ClusterIssueCodeEnumValue. + */ +@Fluent +public final class ClusterIssueCodeEnumValue implements JsonSerializable { + /* + * Property value + */ + private ClusterIssueCode value; + + /** + * Creates an instance of ClusterIssueCodeEnumValue class. + */ + public ClusterIssueCodeEnumValue() { + } + + /** + * Get the value property: Property value. + * + * @return the value value. + */ + public ClusterIssueCode value() { + return this.value; + } + + /** + * Set the value property: Property value. + * + * @param value the value value to set. + * @return the ClusterIssueCodeEnumValue object itself. + */ + public ClusterIssueCodeEnumValue withValue(ClusterIssueCode value) { + this.value = value; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("value", this.value == null ? null : this.value.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ClusterIssueCodeEnumValue from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ClusterIssueCodeEnumValue if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ClusterIssueCodeEnumValue. + */ + public static ClusterIssueCodeEnumValue fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ClusterIssueCodeEnumValue deserializedClusterIssueCodeEnumValue = new ClusterIssueCodeEnumValue(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + deserializedClusterIssueCodeEnumValue.value = ClusterIssueCode.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedClusterIssueCodeEnumValue; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ClusterSettings.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ClusterSettings.java new file mode 100644 index 000000000000..bcad64f8f80a --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ClusterSettings.java @@ -0,0 +1,137 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of ClusterSettings. + */ +@Fluent +public final class ClusterSettings implements JsonSerializable { + /* + * The name of the cluster setting. The value is ``containerInsights`` . + */ + private String name; + + /* + * The value to set for the cluster setting. The supported values are ``enabled`` and ``disabled``. If you set + * ``name`` to ``containerInsights`` and ``value`` to ``enabled``, CloudWatch Container Insights will be on for the + * cluster, otherwise it will be off unless the ``containerInsights`` account setting is turned on. If a cluster + * value is specified, it will override the ``containerInsights`` value set with + * [PutAccountSetting](https://docs.aws.amazon.com/AmazonECS/latest/APIReference/API_PutAccountSetting.html) or + * [PutAccountSettingDefault](https://docs.aws.amazon.com/AmazonECS/latest/APIReference/API_PutAccountSettingDefault + * .html). + */ + private String value; + + /** + * Creates an instance of ClusterSettings class. + */ + public ClusterSettings() { + } + + /** + * Get the name property: The name of the cluster setting. The value is ``containerInsights`` . + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: The name of the cluster setting. The value is ``containerInsights`` . + * + * @param name the name value to set. + * @return the ClusterSettings object itself. + */ + public ClusterSettings withName(String name) { + this.name = name; + return this; + } + + /** + * Get the value property: The value to set for the cluster setting. The supported values are ``enabled`` and + * ``disabled``. If you set ``name`` to ``containerInsights`` and ``value`` to ``enabled``, CloudWatch Container + * Insights will be on for the cluster, otherwise it will be off unless the ``containerInsights`` account setting is + * turned on. If a cluster value is specified, it will override the ``containerInsights`` value set with + * [PutAccountSetting](https://docs.aws.amazon.com/AmazonECS/latest/APIReference/API_PutAccountSetting.html) or + * [PutAccountSettingDefault](https://docs.aws.amazon.com/AmazonECS/latest/APIReference/API_PutAccountSettingDefault.html). + * + * @return the value value. + */ + public String value() { + return this.value; + } + + /** + * Set the value property: The value to set for the cluster setting. The supported values are ``enabled`` and + * ``disabled``. If you set ``name`` to ``containerInsights`` and ``value`` to ``enabled``, CloudWatch Container + * Insights will be on for the cluster, otherwise it will be off unless the ``containerInsights`` account setting is + * turned on. If a cluster value is specified, it will override the ``containerInsights`` value set with + * [PutAccountSetting](https://docs.aws.amazon.com/AmazonECS/latest/APIReference/API_PutAccountSetting.html) or + * [PutAccountSettingDefault](https://docs.aws.amazon.com/AmazonECS/latest/APIReference/API_PutAccountSettingDefault.html). + * + * @param value the value value to set. + * @return the ClusterSettings object itself. + */ + public ClusterSettings withValue(String value) { + this.value = value; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("name", this.name); + jsonWriter.writeStringField("value", this.value); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ClusterSettings from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ClusterSettings if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the ClusterSettings. + */ + public static ClusterSettings fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ClusterSettings deserializedClusterSettings = new ClusterSettings(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("name".equals(fieldName)) { + deserializedClusterSettings.name = reader.getString(); + } else if ("value".equals(fieldName)) { + deserializedClusterSettings.value = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedClusterSettings; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ClusterState.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ClusterState.java new file mode 100644 index 000000000000..fdacf9678832 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ClusterState.java @@ -0,0 +1,76 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * ClusterState enum. + */ +public final class ClusterState extends ExpandableStringEnum { + /** + * Static value BOOTSTRAPPING for ClusterState. + */ + public static final ClusterState BOOTSTRAPPING = fromString("BOOTSTRAPPING"); + + /** + * Static value RUNNING for ClusterState. + */ + public static final ClusterState RUNNING = fromString("RUNNING"); + + /** + * Static value STARTING for ClusterState. + */ + public static final ClusterState STARTING = fromString("STARTING"); + + /** + * Static value TERMINATED for ClusterState. + */ + public static final ClusterState TERMINATED = fromString("TERMINATED"); + + /** + * Static value TERMINATED_WITH_ERRORS for ClusterState. + */ + public static final ClusterState TERMINATED_WITH_ERRORS = fromString("TERMINATED_WITH_ERRORS"); + + /** + * Static value TERMINATING for ClusterState. + */ + public static final ClusterState TERMINATING = fromString("TERMINATING"); + + /** + * Static value WAITING for ClusterState. + */ + public static final ClusterState WAITING = fromString("WAITING"); + + /** + * Creates a new instance of ClusterState value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ClusterState() { + } + + /** + * Creates or finds a ClusterState from its string representation. + * + * @param name a name to look for. + * @return the corresponding ClusterState. + */ + public static ClusterState fromString(String name) { + return fromString(name, ClusterState.class); + } + + /** + * Gets known ClusterState values. + * + * @return known ClusterState values. + */ + public static Collection values() { + return values(ClusterState.class); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ClusterStateChangeReason.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ClusterStateChangeReason.java new file mode 100644 index 000000000000..6b77c4e97df3 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ClusterStateChangeReason.java @@ -0,0 +1,124 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of ClusterStateChangeReason. + */ +@Fluent +public final class ClusterStateChangeReason implements JsonSerializable { + /* + *

The programmatic code for the state change reason.

+ */ + private ClusterStateChangeReasonCodeEnumValue code; + + /* + *

The descriptive message for the state change reason.

+ */ + private String message; + + /** + * Creates an instance of ClusterStateChangeReason class. + */ + public ClusterStateChangeReason() { + } + + /** + * Get the code property: <p>The programmatic code for the state change reason.</p>. + * + * @return the code value. + */ + public ClusterStateChangeReasonCodeEnumValue code() { + return this.code; + } + + /** + * Set the code property: <p>The programmatic code for the state change reason.</p>. + * + * @param code the code value to set. + * @return the ClusterStateChangeReason object itself. + */ + public ClusterStateChangeReason withCode(ClusterStateChangeReasonCodeEnumValue code) { + this.code = code; + return this; + } + + /** + * Get the message property: <p>The descriptive message for the state change reason.</p>. + * + * @return the message value. + */ + public String message() { + return this.message; + } + + /** + * Set the message property: <p>The descriptive message for the state change reason.</p>. + * + * @param message the message value to set. + * @return the ClusterStateChangeReason object itself. + */ + public ClusterStateChangeReason withMessage(String message) { + this.message = message; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (code() != null) { + code().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("code", this.code); + jsonWriter.writeStringField("message", this.message); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ClusterStateChangeReason from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ClusterStateChangeReason if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ClusterStateChangeReason. + */ + public static ClusterStateChangeReason fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ClusterStateChangeReason deserializedClusterStateChangeReason = new ClusterStateChangeReason(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("code".equals(fieldName)) { + deserializedClusterStateChangeReason.code = ClusterStateChangeReasonCodeEnumValue.fromJson(reader); + } else if ("message".equals(fieldName)) { + deserializedClusterStateChangeReason.message = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedClusterStateChangeReason; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ClusterStateChangeReasonCode.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ClusterStateChangeReasonCode.java new file mode 100644 index 000000000000..ba51f8a7ec45 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ClusterStateChangeReasonCode.java @@ -0,0 +1,81 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * ClusterStateChangeReasonCode enum. + */ +public final class ClusterStateChangeReasonCode extends ExpandableStringEnum { + /** + * Static value ALL_STEPS_COMPLETED for ClusterStateChangeReasonCode. + */ + public static final ClusterStateChangeReasonCode ALL_STEPS_COMPLETED = fromString("ALL_STEPS_COMPLETED"); + + /** + * Static value BOOTSTRAP_FAILURE for ClusterStateChangeReasonCode. + */ + public static final ClusterStateChangeReasonCode BOOTSTRAP_FAILURE = fromString("BOOTSTRAP_FAILURE"); + + /** + * Static value INSTANCE_FAILURE for ClusterStateChangeReasonCode. + */ + public static final ClusterStateChangeReasonCode INSTANCE_FAILURE = fromString("INSTANCE_FAILURE"); + + /** + * Static value INSTANCE_FLEET_TIMEOUT for ClusterStateChangeReasonCode. + */ + public static final ClusterStateChangeReasonCode INSTANCE_FLEET_TIMEOUT = fromString("INSTANCE_FLEET_TIMEOUT"); + + /** + * Static value INTERNAL_ERROR for ClusterStateChangeReasonCode. + */ + public static final ClusterStateChangeReasonCode INTERNAL_ERROR = fromString("INTERNAL_ERROR"); + + /** + * Static value STEP_FAILURE for ClusterStateChangeReasonCode. + */ + public static final ClusterStateChangeReasonCode STEP_FAILURE = fromString("STEP_FAILURE"); + + /** + * Static value USER_REQUEST for ClusterStateChangeReasonCode. + */ + public static final ClusterStateChangeReasonCode USER_REQUEST = fromString("USER_REQUEST"); + + /** + * Static value VALIDATION_ERROR for ClusterStateChangeReasonCode. + */ + public static final ClusterStateChangeReasonCode VALIDATION_ERROR = fromString("VALIDATION_ERROR"); + + /** + * Creates a new instance of ClusterStateChangeReasonCode value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ClusterStateChangeReasonCode() { + } + + /** + * Creates or finds a ClusterStateChangeReasonCode from its string representation. + * + * @param name a name to look for. + * @return the corresponding ClusterStateChangeReasonCode. + */ + public static ClusterStateChangeReasonCode fromString(String name) { + return fromString(name, ClusterStateChangeReasonCode.class); + } + + /** + * Gets known ClusterStateChangeReasonCode values. + * + * @return known ClusterStateChangeReasonCode values. + */ + public static Collection values() { + return values(ClusterStateChangeReasonCode.class); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ClusterStateChangeReasonCodeEnumValue.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ClusterStateChangeReasonCodeEnumValue.java new file mode 100644 index 000000000000..81ce4d7c1e72 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ClusterStateChangeReasonCodeEnumValue.java @@ -0,0 +1,96 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of ClusterStateChangeReasonCodeEnumValue. + */ +@Fluent +public final class ClusterStateChangeReasonCodeEnumValue + implements JsonSerializable { + /* + * Property value + */ + private ClusterStateChangeReasonCode value; + + /** + * Creates an instance of ClusterStateChangeReasonCodeEnumValue class. + */ + public ClusterStateChangeReasonCodeEnumValue() { + } + + /** + * Get the value property: Property value. + * + * @return the value value. + */ + public ClusterStateChangeReasonCode value() { + return this.value; + } + + /** + * Set the value property: Property value. + * + * @param value the value value to set. + * @return the ClusterStateChangeReasonCodeEnumValue object itself. + */ + public ClusterStateChangeReasonCodeEnumValue withValue(ClusterStateChangeReasonCode value) { + this.value = value; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("value", this.value == null ? null : this.value.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ClusterStateChangeReasonCodeEnumValue from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ClusterStateChangeReasonCodeEnumValue if the JsonReader was pointing to an instance of it, + * or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ClusterStateChangeReasonCodeEnumValue. + */ + public static ClusterStateChangeReasonCodeEnumValue fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ClusterStateChangeReasonCodeEnumValue deserializedClusterStateChangeReasonCodeEnumValue + = new ClusterStateChangeReasonCodeEnumValue(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + deserializedClusterStateChangeReasonCodeEnumValue.value + = ClusterStateChangeReasonCode.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedClusterStateChangeReasonCodeEnumValue; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ClusterStateEnumValue.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ClusterStateEnumValue.java new file mode 100644 index 000000000000..583482b8ce20 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ClusterStateEnumValue.java @@ -0,0 +1,93 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of ClusterStateEnumValue. + */ +@Fluent +public final class ClusterStateEnumValue implements JsonSerializable { + /* + * Property value + */ + private ClusterState value; + + /** + * Creates an instance of ClusterStateEnumValue class. + */ + public ClusterStateEnumValue() { + } + + /** + * Get the value property: Property value. + * + * @return the value value. + */ + public ClusterState value() { + return this.value; + } + + /** + * Set the value property: Property value. + * + * @param value the value value to set. + * @return the ClusterStateEnumValue object itself. + */ + public ClusterStateEnumValue withValue(ClusterState value) { + this.value = value; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("value", this.value == null ? null : this.value.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ClusterStateEnumValue from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ClusterStateEnumValue if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the ClusterStateEnumValue. + */ + public static ClusterStateEnumValue fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ClusterStateEnumValue deserializedClusterStateEnumValue = new ClusterStateEnumValue(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + deserializedClusterStateEnumValue.value = ClusterState.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedClusterStateEnumValue; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ClusterStatus.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ClusterStatus.java new file mode 100644 index 000000000000..abbb6ca5549d --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ClusterStatus.java @@ -0,0 +1,71 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * ClusterStatus enum. + */ +public final class ClusterStatus extends ExpandableStringEnum { + /** + * Static value ACTIVE for ClusterStatus. + */ + public static final ClusterStatus ACTIVE = fromString("ACTIVE"); + + /** + * Static value CREATING for ClusterStatus. + */ + public static final ClusterStatus CREATING = fromString("CREATING"); + + /** + * Static value DELETING for ClusterStatus. + */ + public static final ClusterStatus DELETING = fromString("DELETING"); + + /** + * Static value FAILED for ClusterStatus. + */ + public static final ClusterStatus FAILED = fromString("FAILED"); + + /** + * Static value PENDING for ClusterStatus. + */ + public static final ClusterStatus PENDING = fromString("PENDING"); + + /** + * Static value UPDATING for ClusterStatus. + */ + public static final ClusterStatus UPDATING = fromString("UPDATING"); + + /** + * Creates a new instance of ClusterStatus value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ClusterStatus() { + } + + /** + * Creates or finds a ClusterStatus from its string representation. + * + * @param name a name to look for. + * @return the corresponding ClusterStatus. + */ + public static ClusterStatus fromString(String name) { + return fromString(name, ClusterStatus.class); + } + + /** + * Gets known ClusterStatus values. + * + * @return known ClusterStatus values. + */ + public static Collection values() { + return values(ClusterStatus.class); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ClusterStatusAutoGenerated.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ClusterStatusAutoGenerated.java new file mode 100644 index 000000000000..8d4e7deba1b2 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ClusterStatusAutoGenerated.java @@ -0,0 +1,200 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Definition of ClusterStatus. + */ +@Fluent +public final class ClusterStatusAutoGenerated implements JsonSerializable { + /* + *

A list of tuples that provides information about the errors that caused a cluster to terminate. This structure + * can contain up to 10 different ErrorDetail tuples.

+ */ + private List errorDetails; + + /* + *

The current state of the cluster.

+ */ + private ClusterStateEnumValue state; + + /* + *

The reason for the cluster status change.

+ */ + private ClusterStateChangeReason stateChangeReason; + + /* + *

A timeline that represents the status of a cluster over the lifetime of the cluster.

+ */ + private ClusterTimeline timeline; + + /** + * Creates an instance of ClusterStatusAutoGenerated class. + */ + public ClusterStatusAutoGenerated() { + } + + /** + * Get the errorDetails property: <p>A list of tuples that provides information about the errors that caused a + * cluster to terminate. This structure can contain up to 10 different <code>ErrorDetail</code> + * tuples.</p>. + * + * @return the errorDetails value. + */ + public List errorDetails() { + return this.errorDetails; + } + + /** + * Set the errorDetails property: <p>A list of tuples that provides information about the errors that caused a + * cluster to terminate. This structure can contain up to 10 different <code>ErrorDetail</code> + * tuples.</p>. + * + * @param errorDetails the errorDetails value to set. + * @return the ClusterStatusAutoGenerated object itself. + */ + public ClusterStatusAutoGenerated withErrorDetails(List errorDetails) { + this.errorDetails = errorDetails; + return this; + } + + /** + * Get the state property: <p>The current state of the cluster.</p>. + * + * @return the state value. + */ + public ClusterStateEnumValue state() { + return this.state; + } + + /** + * Set the state property: <p>The current state of the cluster.</p>. + * + * @param state the state value to set. + * @return the ClusterStatusAutoGenerated object itself. + */ + public ClusterStatusAutoGenerated withState(ClusterStateEnumValue state) { + this.state = state; + return this; + } + + /** + * Get the stateChangeReason property: <p>The reason for the cluster status change.</p>. + * + * @return the stateChangeReason value. + */ + public ClusterStateChangeReason stateChangeReason() { + return this.stateChangeReason; + } + + /** + * Set the stateChangeReason property: <p>The reason for the cluster status change.</p>. + * + * @param stateChangeReason the stateChangeReason value to set. + * @return the ClusterStatusAutoGenerated object itself. + */ + public ClusterStatusAutoGenerated withStateChangeReason(ClusterStateChangeReason stateChangeReason) { + this.stateChangeReason = stateChangeReason; + return this; + } + + /** + * Get the timeline property: <p>A timeline that represents the status of a cluster over the lifetime of the + * cluster.</p>. + * + * @return the timeline value. + */ + public ClusterTimeline timeline() { + return this.timeline; + } + + /** + * Set the timeline property: <p>A timeline that represents the status of a cluster over the lifetime of the + * cluster.</p>. + * + * @param timeline the timeline value to set. + * @return the ClusterStatusAutoGenerated object itself. + */ + public ClusterStatusAutoGenerated withTimeline(ClusterTimeline timeline) { + this.timeline = timeline; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (errorDetails() != null) { + errorDetails().forEach(e -> e.validate()); + } + if (state() != null) { + state().validate(); + } + if (stateChangeReason() != null) { + stateChangeReason().validate(); + } + if (timeline() != null) { + timeline().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("errorDetails", this.errorDetails, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeJsonField("state", this.state); + jsonWriter.writeJsonField("stateChangeReason", this.stateChangeReason); + jsonWriter.writeJsonField("timeline", this.timeline); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ClusterStatusAutoGenerated from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ClusterStatusAutoGenerated if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ClusterStatusAutoGenerated. + */ + public static ClusterStatusAutoGenerated fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ClusterStatusAutoGenerated deserializedClusterStatusAutoGenerated = new ClusterStatusAutoGenerated(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("errorDetails".equals(fieldName)) { + List errorDetails + = reader.readArray(reader1 -> ErrorDetailAutoGenerated.fromJson(reader1)); + deserializedClusterStatusAutoGenerated.errorDetails = errorDetails; + } else if ("state".equals(fieldName)) { + deserializedClusterStatusAutoGenerated.state = ClusterStateEnumValue.fromJson(reader); + } else if ("stateChangeReason".equals(fieldName)) { + deserializedClusterStatusAutoGenerated.stateChangeReason + = ClusterStateChangeReason.fromJson(reader); + } else if ("timeline".equals(fieldName)) { + deserializedClusterStatusAutoGenerated.timeline = ClusterTimeline.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedClusterStatusAutoGenerated; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ClusterStatusEnumValue.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ClusterStatusEnumValue.java new file mode 100644 index 000000000000..e5ee193217f4 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ClusterStatusEnumValue.java @@ -0,0 +1,93 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of ClusterStatusEnumValue. + */ +@Fluent +public final class ClusterStatusEnumValue implements JsonSerializable { + /* + * Property value + */ + private ClusterStatus value; + + /** + * Creates an instance of ClusterStatusEnumValue class. + */ + public ClusterStatusEnumValue() { + } + + /** + * Get the value property: Property value. + * + * @return the value value. + */ + public ClusterStatus value() { + return this.value; + } + + /** + * Set the value property: Property value. + * + * @param value the value value to set. + * @return the ClusterStatusEnumValue object itself. + */ + public ClusterStatusEnumValue withValue(ClusterStatus value) { + this.value = value; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("value", this.value == null ? null : this.value.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ClusterStatusEnumValue from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ClusterStatusEnumValue if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the ClusterStatusEnumValue. + */ + public static ClusterStatusEnumValue fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ClusterStatusEnumValue deserializedClusterStatusEnumValue = new ClusterStatusEnumValue(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + deserializedClusterStatusEnumValue.value = ClusterStatus.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedClusterStatusEnumValue; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ClusterTimeline.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ClusterTimeline.java new file mode 100644 index 000000000000..3f807fe80032 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ClusterTimeline.java @@ -0,0 +1,160 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.time.OffsetDateTime; +import java.time.format.DateTimeFormatter; + +/** + * Definition of ClusterTimeline. + */ +@Fluent +public final class ClusterTimeline implements JsonSerializable { + /* + *

The creation date and time of the cluster.

+ */ + private OffsetDateTime creationDateTime; + + /* + *

The date and time when the cluster was terminated.

+ */ + private OffsetDateTime endDateTime; + + /* + *

The date and time when the cluster was ready to run steps.

+ */ + private OffsetDateTime readyDateTime; + + /** + * Creates an instance of ClusterTimeline class. + */ + public ClusterTimeline() { + } + + /** + * Get the creationDateTime property: <p>The creation date and time of the cluster.</p>. + * + * @return the creationDateTime value. + */ + public OffsetDateTime creationDateTime() { + return this.creationDateTime; + } + + /** + * Set the creationDateTime property: <p>The creation date and time of the cluster.</p>. + * + * @param creationDateTime the creationDateTime value to set. + * @return the ClusterTimeline object itself. + */ + public ClusterTimeline withCreationDateTime(OffsetDateTime creationDateTime) { + this.creationDateTime = creationDateTime; + return this; + } + + /** + * Get the endDateTime property: <p>The date and time when the cluster was terminated.</p>. + * + * @return the endDateTime value. + */ + public OffsetDateTime endDateTime() { + return this.endDateTime; + } + + /** + * Set the endDateTime property: <p>The date and time when the cluster was terminated.</p>. + * + * @param endDateTime the endDateTime value to set. + * @return the ClusterTimeline object itself. + */ + public ClusterTimeline withEndDateTime(OffsetDateTime endDateTime) { + this.endDateTime = endDateTime; + return this; + } + + /** + * Get the readyDateTime property: <p>The date and time when the cluster was ready to run steps.</p>. + * + * @return the readyDateTime value. + */ + public OffsetDateTime readyDateTime() { + return this.readyDateTime; + } + + /** + * Set the readyDateTime property: <p>The date and time when the cluster was ready to run steps.</p>. + * + * @param readyDateTime the readyDateTime value to set. + * @return the ClusterTimeline object itself. + */ + public ClusterTimeline withReadyDateTime(OffsetDateTime readyDateTime) { + this.readyDateTime = readyDateTime; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("creationDateTime", + this.creationDateTime == null + ? null + : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.creationDateTime)); + jsonWriter.writeStringField("endDateTime", + this.endDateTime == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.endDateTime)); + jsonWriter.writeStringField("readyDateTime", + this.readyDateTime == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.readyDateTime)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ClusterTimeline from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ClusterTimeline if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the ClusterTimeline. + */ + public static ClusterTimeline fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ClusterTimeline deserializedClusterTimeline = new ClusterTimeline(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("creationDateTime".equals(fieldName)) { + deserializedClusterTimeline.creationDateTime = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("endDateTime".equals(fieldName)) { + deserializedClusterTimeline.endDateTime = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("readyDateTime".equals(fieldName)) { + deserializedClusterTimeline.readyDateTime = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else { + reader.skipChildren(); + } + } + + return deserializedClusterTimeline; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/Code.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/Code.java new file mode 100644 index 000000000000..dd869600334e --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/Code.java @@ -0,0 +1,240 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of Code. + */ +@Fluent +public final class Code implements JsonSerializable { + /* + * URI of a [container image](https://docs.aws.amazon.com/lambda/latest/dg/lambda-images.html) in the Amazon ECR + * registry. + */ + private String imageUri; + + /* + * An Amazon S3 bucket in the same AWS-Region as your function. The bucket can be in a different AWS-account. + */ + private String s3Bucket; + + /* + * The Amazon S3 key of the deployment package. + */ + private String s3Key; + + /* + * For versioned objects, the version of the deployment package object to use. + */ + private String s3ObjectVersion; + + /* + * (Node.js and Python) The source code of your Lambda function. If you include your function source inline with + * this parameter, CFN places it in a file named ``index`` and zips it to create a [deployment + * package](https://docs.aws.amazon.com/lambda/latest/dg/gettingstarted-package.html). This zip file cannot exceed + * 4MB. For the ``Handler`` property, the first part of the handler identifier must be ``index``. For example, + * ``index.handler``. For JSON, you must escape quotes and special characters such as newline (``\n``) with a + * backslash. If you specify a function that interacts with an AWS CloudFormation custom resource, you don't have to + * write your own functions to send responses to the custom resource that invoked the function. AWS CloudFormation + * provides a response module + * ([cfn-response](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/cfn-lambda-function-code- + * cfnresponsemodule.html)) that simplifies sending responses. See [Using Lambda with + * CloudFormation](https://docs.aws.amazon.com/lambda/latest/dg/services-cloudformation.html) for details. + */ + private String zipFile; + + /** + * Creates an instance of Code class. + */ + public Code() { + } + + /** + * Get the imageUri property: URI of a [container + * image](https://docs.aws.amazon.com/lambda/latest/dg/lambda-images.html) in the Amazon ECR registry. + * + * @return the imageUri value. + */ + public String imageUri() { + return this.imageUri; + } + + /** + * Set the imageUri property: URI of a [container + * image](https://docs.aws.amazon.com/lambda/latest/dg/lambda-images.html) in the Amazon ECR registry. + * + * @param imageUri the imageUri value to set. + * @return the Code object itself. + */ + public Code withImageUri(String imageUri) { + this.imageUri = imageUri; + return this; + } + + /** + * Get the s3Bucket property: An Amazon S3 bucket in the same AWS-Region as your function. The bucket can be in a + * different AWS-account. + * + * @return the s3Bucket value. + */ + public String s3Bucket() { + return this.s3Bucket; + } + + /** + * Set the s3Bucket property: An Amazon S3 bucket in the same AWS-Region as your function. The bucket can be in a + * different AWS-account. + * + * @param s3Bucket the s3Bucket value to set. + * @return the Code object itself. + */ + public Code withS3Bucket(String s3Bucket) { + this.s3Bucket = s3Bucket; + return this; + } + + /** + * Get the s3Key property: The Amazon S3 key of the deployment package. + * + * @return the s3Key value. + */ + public String s3Key() { + return this.s3Key; + } + + /** + * Set the s3Key property: The Amazon S3 key of the deployment package. + * + * @param s3Key the s3Key value to set. + * @return the Code object itself. + */ + public Code withS3Key(String s3Key) { + this.s3Key = s3Key; + return this; + } + + /** + * Get the s3ObjectVersion property: For versioned objects, the version of the deployment package object to use. + * + * @return the s3ObjectVersion value. + */ + public String s3ObjectVersion() { + return this.s3ObjectVersion; + } + + /** + * Set the s3ObjectVersion property: For versioned objects, the version of the deployment package object to use. + * + * @param s3ObjectVersion the s3ObjectVersion value to set. + * @return the Code object itself. + */ + public Code withS3ObjectVersion(String s3ObjectVersion) { + this.s3ObjectVersion = s3ObjectVersion; + return this; + } + + /** + * Get the zipFile property: (Node.js and Python) The source code of your Lambda function. If you include your + * function source inline with this parameter, CFN places it in a file named ``index`` and zips it to create a + * [deployment package](https://docs.aws.amazon.com/lambda/latest/dg/gettingstarted-package.html). This zip file + * cannot exceed 4MB. For the ``Handler`` property, the first part of the handler identifier must be ``index``. For + * example, ``index.handler``. For JSON, you must escape quotes and special characters such as newline (``\n``) with + * a backslash. If you specify a function that interacts with an AWS CloudFormation custom resource, you don't have + * to write your own functions to send responses to the custom resource that invoked the function. AWS + * CloudFormation provides a response module + * ([cfn-response](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/cfn-lambda-function-code-cfnresponsemodule.html)) + * that simplifies sending responses. See [Using Lambda with + * CloudFormation](https://docs.aws.amazon.com/lambda/latest/dg/services-cloudformation.html) for details. + * + * @return the zipFile value. + */ + public String zipFile() { + return this.zipFile; + } + + /** + * Set the zipFile property: (Node.js and Python) The source code of your Lambda function. If you include your + * function source inline with this parameter, CFN places it in a file named ``index`` and zips it to create a + * [deployment package](https://docs.aws.amazon.com/lambda/latest/dg/gettingstarted-package.html). This zip file + * cannot exceed 4MB. For the ``Handler`` property, the first part of the handler identifier must be ``index``. For + * example, ``index.handler``. For JSON, you must escape quotes and special characters such as newline (``\n``) with + * a backslash. If you specify a function that interacts with an AWS CloudFormation custom resource, you don't have + * to write your own functions to send responses to the custom resource that invoked the function. AWS + * CloudFormation provides a response module + * ([cfn-response](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/cfn-lambda-function-code-cfnresponsemodule.html)) + * that simplifies sending responses. See [Using Lambda with + * CloudFormation](https://docs.aws.amazon.com/lambda/latest/dg/services-cloudformation.html) for details. + * + * @param zipFile the zipFile value to set. + * @return the Code object itself. + */ + public Code withZipFile(String zipFile) { + this.zipFile = zipFile; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("imageUri", this.imageUri); + jsonWriter.writeStringField("s3Bucket", this.s3Bucket); + jsonWriter.writeStringField("s3Key", this.s3Key); + jsonWriter.writeStringField("s3ObjectVersion", this.s3ObjectVersion); + jsonWriter.writeStringField("zipFile", this.zipFile); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of Code from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of Code if the JsonReader was pointing to an instance of it, or null if it was pointing to + * JSON null. + * @throws IOException If an error occurs while reading the Code. + */ + public static Code fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + Code deserializedCode = new Code(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("imageUri".equals(fieldName)) { + deserializedCode.imageUri = reader.getString(); + } else if ("s3Bucket".equals(fieldName)) { + deserializedCode.s3Bucket = reader.getString(); + } else if ("s3Key".equals(fieldName)) { + deserializedCode.s3Key = reader.getString(); + } else if ("s3ObjectVersion".equals(fieldName)) { + deserializedCode.s3ObjectVersion = reader.getString(); + } else if ("zipFile".equals(fieldName)) { + deserializedCode.zipFile = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedCode; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/CodeBuildProject.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/CodeBuildProject.java new file mode 100644 index 000000000000..725370c8fc84 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/CodeBuildProject.java @@ -0,0 +1,252 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.awsconnector.fluent.models.CodeBuildProjectInner; +import java.util.Map; + +/** + * An immutable client-side representation of CodeBuildProject. + */ +public interface CodeBuildProject { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the location property: The geo-location where the resource lives. + * + * @return the location value. + */ + String location(); + + /** + * Gets the tags property: Resource tags. + * + * @return the tags value. + */ + Map tags(); + + /** + * Gets the properties property: The resource-specific properties for this resource. + * + * @return the properties value. + */ + CodeBuildProjectProperties properties(); + + /** + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the region of the resource. + * + * @return the region of the resource. + */ + Region region(); + + /** + * Gets the name of the resource region. + * + * @return the name of the resource region. + */ + String regionName(); + + /** + * Gets the name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + + /** + * Gets the inner com.azure.resourcemanager.awsconnector.fluent.models.CodeBuildProjectInner object. + * + * @return the inner object. + */ + CodeBuildProjectInner innerModel(); + + /** + * The entirety of the CodeBuildProject definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithLocation, + DefinitionStages.WithResourceGroup, DefinitionStages.WithCreate { + } + + /** + * The CodeBuildProject definition stages. + */ + interface DefinitionStages { + /** + * The first stage of the CodeBuildProject definition. + */ + interface Blank extends WithLocation { + } + + /** + * The stage of the CodeBuildProject definition allowing to specify location. + */ + interface WithLocation { + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithResourceGroup withRegion(Region location); + + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithResourceGroup withRegion(String location); + } + + /** + * The stage of the CodeBuildProject definition allowing to specify parent resource. + */ + interface WithResourceGroup { + /** + * Specifies resourceGroupName. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @return the next definition stage. + */ + WithCreate withExistingResourceGroup(String resourceGroupName); + } + + /** + * The stage of the CodeBuildProject 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.WithProperties { + /** + * Executes the create request. + * + * @return the created resource. + */ + CodeBuildProject create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + CodeBuildProject create(Context context); + } + + /** + * The stage of the CodeBuildProject definition allowing to specify tags. + */ + interface WithTags { + /** + * Specifies the tags property: Resource tags.. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + WithCreate withTags(Map tags); + } + + /** + * The stage of the CodeBuildProject definition allowing to specify properties. + */ + interface WithProperties { + /** + * Specifies the properties property: The resource-specific properties for this resource.. + * + * @param properties The resource-specific properties for this resource. + * @return the next definition stage. + */ + WithCreate withProperties(CodeBuildProjectProperties properties); + } + } + + /** + * Begins update for the CodeBuildProject resource. + * + * @return the stage of resource update. + */ + CodeBuildProject.Update update(); + + /** + * The template for CodeBuildProject update. + */ + interface Update extends UpdateStages.WithTags { + /** + * Executes the update request. + * + * @return the updated resource. + */ + CodeBuildProject apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + CodeBuildProject apply(Context context); + } + + /** + * The CodeBuildProject update stages. + */ + interface UpdateStages { + /** + * The stage of the CodeBuildProject update allowing to specify tags. + */ + interface WithTags { + /** + * Specifies the tags property: Resource tags.. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + Update withTags(Map tags); + } + } + + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + CodeBuildProject refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + CodeBuildProject refresh(Context context); +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/CodeBuildProjectListResult.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/CodeBuildProjectListResult.java new file mode 100644 index 000000000000..b927788ec06d --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/CodeBuildProjectListResult.java @@ -0,0 +1,136 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.awsconnector.fluent.models.CodeBuildProjectInner; +import java.io.IOException; +import java.util.List; + +/** + * The response of a CodeBuildProject list operation. + */ +@Fluent +public final class CodeBuildProjectListResult implements JsonSerializable { + /* + * The CodeBuildProject items on this page + */ + private List value; + + /* + * The link to the next page of items + */ + private String nextLink; + + /** + * Creates an instance of CodeBuildProjectListResult class. + */ + public CodeBuildProjectListResult() { + } + + /** + * Get the value property: The CodeBuildProject items on this page. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The CodeBuildProject items on this page. + * + * @param value the value value to set. + * @return the CodeBuildProjectListResult object itself. + */ + public CodeBuildProjectListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The link to the next page of items. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: The link to the next page of items. + * + * @param nextLink the nextLink value to set. + * @return the CodeBuildProjectListResult object itself. + */ + public CodeBuildProjectListResult withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property value in model CodeBuildProjectListResult")); + } else { + value().forEach(e -> e.validate()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(CodeBuildProjectListResult.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("nextLink", this.nextLink); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of CodeBuildProjectListResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of CodeBuildProjectListResult if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the CodeBuildProjectListResult. + */ + public static CodeBuildProjectListResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + CodeBuildProjectListResult deserializedCodeBuildProjectListResult = new CodeBuildProjectListResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> CodeBuildProjectInner.fromJson(reader1)); + deserializedCodeBuildProjectListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedCodeBuildProjectListResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedCodeBuildProjectListResult; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/CodeBuildProjectProperties.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/CodeBuildProjectProperties.java new file mode 100644 index 000000000000..e50e4433bd33 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/CodeBuildProjectProperties.java @@ -0,0 +1,312 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.Map; + +/** + * Definition of CodeBuildProject. + */ +@Fluent +public final class CodeBuildProjectProperties implements JsonSerializable { + /* + * AWS Properties + */ + private AwsCodeBuildProjectProperties awsProperties; + + /* + * Public Cloud Connectors Resource ID + */ + private String publicCloudConnectorsResourceId; + + /* + * AWS Account ID + */ + private String awsAccountId; + + /* + * Amazon Resource Name (ARN) + */ + private String arn; + + /* + * Public Cloud Resource Name + */ + private String publicCloudResourceName; + + /* + * AWS Source Schema + */ + private String awsSourceSchema; + + /* + * AWS Region + */ + private String awsRegion; + + /* + * AWS Tags + */ + private Map awsTags; + + /* + * The status of the last operation. + */ + private ProvisioningState provisioningState; + + /** + * Creates an instance of CodeBuildProjectProperties class. + */ + public CodeBuildProjectProperties() { + } + + /** + * Get the awsProperties property: AWS Properties. + * + * @return the awsProperties value. + */ + public AwsCodeBuildProjectProperties awsProperties() { + return this.awsProperties; + } + + /** + * Set the awsProperties property: AWS Properties. + * + * @param awsProperties the awsProperties value to set. + * @return the CodeBuildProjectProperties object itself. + */ + public CodeBuildProjectProperties withAwsProperties(AwsCodeBuildProjectProperties awsProperties) { + this.awsProperties = awsProperties; + return this; + } + + /** + * Get the publicCloudConnectorsResourceId property: Public Cloud Connectors Resource ID. + * + * @return the publicCloudConnectorsResourceId value. + */ + public String publicCloudConnectorsResourceId() { + return this.publicCloudConnectorsResourceId; + } + + /** + * Set the publicCloudConnectorsResourceId property: Public Cloud Connectors Resource ID. + * + * @param publicCloudConnectorsResourceId the publicCloudConnectorsResourceId value to set. + * @return the CodeBuildProjectProperties object itself. + */ + public CodeBuildProjectProperties withPublicCloudConnectorsResourceId(String publicCloudConnectorsResourceId) { + this.publicCloudConnectorsResourceId = publicCloudConnectorsResourceId; + return this; + } + + /** + * Get the awsAccountId property: AWS Account ID. + * + * @return the awsAccountId value. + */ + public String awsAccountId() { + return this.awsAccountId; + } + + /** + * Set the awsAccountId property: AWS Account ID. + * + * @param awsAccountId the awsAccountId value to set. + * @return the CodeBuildProjectProperties object itself. + */ + public CodeBuildProjectProperties withAwsAccountId(String awsAccountId) { + this.awsAccountId = awsAccountId; + return this; + } + + /** + * Get the arn property: Amazon Resource Name (ARN). + * + * @return the arn value. + */ + public String arn() { + return this.arn; + } + + /** + * Set the arn property: Amazon Resource Name (ARN). + * + * @param arn the arn value to set. + * @return the CodeBuildProjectProperties object itself. + */ + public CodeBuildProjectProperties withArn(String arn) { + this.arn = arn; + return this; + } + + /** + * Get the publicCloudResourceName property: Public Cloud Resource Name. + * + * @return the publicCloudResourceName value. + */ + public String publicCloudResourceName() { + return this.publicCloudResourceName; + } + + /** + * Set the publicCloudResourceName property: Public Cloud Resource Name. + * + * @param publicCloudResourceName the publicCloudResourceName value to set. + * @return the CodeBuildProjectProperties object itself. + */ + public CodeBuildProjectProperties withPublicCloudResourceName(String publicCloudResourceName) { + this.publicCloudResourceName = publicCloudResourceName; + return this; + } + + /** + * Get the awsSourceSchema property: AWS Source Schema. + * + * @return the awsSourceSchema value. + */ + public String awsSourceSchema() { + return this.awsSourceSchema; + } + + /** + * Set the awsSourceSchema property: AWS Source Schema. + * + * @param awsSourceSchema the awsSourceSchema value to set. + * @return the CodeBuildProjectProperties object itself. + */ + public CodeBuildProjectProperties withAwsSourceSchema(String awsSourceSchema) { + this.awsSourceSchema = awsSourceSchema; + return this; + } + + /** + * Get the awsRegion property: AWS Region. + * + * @return the awsRegion value. + */ + public String awsRegion() { + return this.awsRegion; + } + + /** + * Set the awsRegion property: AWS Region. + * + * @param awsRegion the awsRegion value to set. + * @return the CodeBuildProjectProperties object itself. + */ + public CodeBuildProjectProperties withAwsRegion(String awsRegion) { + this.awsRegion = awsRegion; + return this; + } + + /** + * Get the awsTags property: AWS Tags. + * + * @return the awsTags value. + */ + public Map awsTags() { + return this.awsTags; + } + + /** + * Set the awsTags property: AWS Tags. + * + * @param awsTags the awsTags value to set. + * @return the CodeBuildProjectProperties object itself. + */ + public CodeBuildProjectProperties withAwsTags(Map awsTags) { + this.awsTags = awsTags; + return this; + } + + /** + * Get the provisioningState property: The status of the last operation. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (awsProperties() != null) { + awsProperties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("awsProperties", this.awsProperties); + jsonWriter.writeStringField("publicCloudConnectorsResourceId", this.publicCloudConnectorsResourceId); + jsonWriter.writeStringField("awsAccountId", this.awsAccountId); + jsonWriter.writeStringField("arn", this.arn); + jsonWriter.writeStringField("publicCloudResourceName", this.publicCloudResourceName); + jsonWriter.writeStringField("awsSourceSchema", this.awsSourceSchema); + jsonWriter.writeStringField("awsRegion", this.awsRegion); + jsonWriter.writeMapField("awsTags", this.awsTags, (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of CodeBuildProjectProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of CodeBuildProjectProperties if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IOException If an error occurs while reading the CodeBuildProjectProperties. + */ + public static CodeBuildProjectProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + CodeBuildProjectProperties deserializedCodeBuildProjectProperties = new CodeBuildProjectProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("awsProperties".equals(fieldName)) { + deserializedCodeBuildProjectProperties.awsProperties + = AwsCodeBuildProjectProperties.fromJson(reader); + } else if ("publicCloudConnectorsResourceId".equals(fieldName)) { + deserializedCodeBuildProjectProperties.publicCloudConnectorsResourceId = reader.getString(); + } else if ("awsAccountId".equals(fieldName)) { + deserializedCodeBuildProjectProperties.awsAccountId = reader.getString(); + } else if ("arn".equals(fieldName)) { + deserializedCodeBuildProjectProperties.arn = reader.getString(); + } else if ("publicCloudResourceName".equals(fieldName)) { + deserializedCodeBuildProjectProperties.publicCloudResourceName = reader.getString(); + } else if ("awsSourceSchema".equals(fieldName)) { + deserializedCodeBuildProjectProperties.awsSourceSchema = reader.getString(); + } else if ("awsRegion".equals(fieldName)) { + deserializedCodeBuildProjectProperties.awsRegion = reader.getString(); + } else if ("awsTags".equals(fieldName)) { + Map awsTags = reader.readMap(reader1 -> reader1.getString()); + deserializedCodeBuildProjectProperties.awsTags = awsTags; + } else if ("provisioningState".equals(fieldName)) { + deserializedCodeBuildProjectProperties.provisioningState + = ProvisioningState.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedCodeBuildProjectProperties; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/CodeBuildProjectTagsUpdate.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/CodeBuildProjectTagsUpdate.java new file mode 100644 index 000000000000..aa9fe63b6b1a --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/CodeBuildProjectTagsUpdate.java @@ -0,0 +1,95 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.Map; + +/** + * The type used for updating tags in CodeBuildProject resources. + */ +@Fluent +public final class CodeBuildProjectTagsUpdate implements JsonSerializable { + /* + * Resource tags. + */ + private Map tags; + + /** + * Creates an instance of CodeBuildProjectTagsUpdate class. + */ + public CodeBuildProjectTagsUpdate() { + } + + /** + * Get the tags property: Resource tags. + * + * @return the tags value. + */ + public Map tags() { + return this.tags; + } + + /** + * Set the tags property: Resource tags. + * + * @param tags the tags value to set. + * @return the CodeBuildProjectTagsUpdate object itself. + */ + public CodeBuildProjectTagsUpdate withTags(Map tags) { + this.tags = tags; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeMapField("tags", this.tags, (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of CodeBuildProjectTagsUpdate from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of CodeBuildProjectTagsUpdate if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IOException If an error occurs while reading the CodeBuildProjectTagsUpdate. + */ + public static CodeBuildProjectTagsUpdate fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + CodeBuildProjectTagsUpdate deserializedCodeBuildProjectTagsUpdate = new CodeBuildProjectTagsUpdate(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedCodeBuildProjectTagsUpdate.tags = tags; + } else { + reader.skipChildren(); + } + } + + return deserializedCodeBuildProjectTagsUpdate; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/CodeBuildProjects.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/CodeBuildProjects.java new file mode 100644 index 000000000000..65733b4086b0 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/CodeBuildProjects.java @@ -0,0 +1,157 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** + * Resource collection API of CodeBuildProjects. + */ +public interface CodeBuildProjects { + /** + * List CodeBuildProject resources by subscription ID. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a CodeBuildProject list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable list(); + + /** + * List CodeBuildProject resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a CodeBuildProject list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable list(Context context); + + /** + * List CodeBuildProject resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a CodeBuildProject list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * List CodeBuildProject resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a CodeBuildProject list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Get a CodeBuildProject. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of CodeBuildProject. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a CodeBuildProject along with {@link Response}. + */ + Response getByResourceGroupWithResponse(String resourceGroupName, String name, Context context); + + /** + * Get a CodeBuildProject. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of CodeBuildProject. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a CodeBuildProject. + */ + CodeBuildProject getByResourceGroup(String resourceGroupName, String name); + + /** + * Delete a CodeBuildProject. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of CodeBuildProject. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByResourceGroup(String resourceGroupName, String name); + + /** + * Delete a CodeBuildProject. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of CodeBuildProject. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String name, Context context); + + /** + * Get a CodeBuildProject. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a CodeBuildProject along with {@link Response}. + */ + CodeBuildProject getById(String id); + + /** + * Get a CodeBuildProject. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a CodeBuildProject along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Delete a CodeBuildProject. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteById(String id); + + /** + * Delete a CodeBuildProject. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new CodeBuildProject resource. + * + * @param name resource name. + * @return the first stage of the new CodeBuildProject definition. + */ + CodeBuildProject.DefinitionStages.Blank define(String name); +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/CodeBuildSourceCredentialsInfo.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/CodeBuildSourceCredentialsInfo.java new file mode 100644 index 000000000000..0b8a2c79eb9a --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/CodeBuildSourceCredentialsInfo.java @@ -0,0 +1,252 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.awsconnector.fluent.models.CodeBuildSourceCredentialsInfoInner; +import java.util.Map; + +/** + * An immutable client-side representation of CodeBuildSourceCredentialsInfo. + */ +public interface CodeBuildSourceCredentialsInfo { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the location property: The geo-location where the resource lives. + * + * @return the location value. + */ + String location(); + + /** + * Gets the tags property: Resource tags. + * + * @return the tags value. + */ + Map tags(); + + /** + * Gets the properties property: The resource-specific properties for this resource. + * + * @return the properties value. + */ + CodeBuildSourceCredentialsInfoProperties properties(); + + /** + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the region of the resource. + * + * @return the region of the resource. + */ + Region region(); + + /** + * Gets the name of the resource region. + * + * @return the name of the resource region. + */ + String regionName(); + + /** + * Gets the name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + + /** + * Gets the inner com.azure.resourcemanager.awsconnector.fluent.models.CodeBuildSourceCredentialsInfoInner object. + * + * @return the inner object. + */ + CodeBuildSourceCredentialsInfoInner innerModel(); + + /** + * The entirety of the CodeBuildSourceCredentialsInfo definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithLocation, + DefinitionStages.WithResourceGroup, DefinitionStages.WithCreate { + } + + /** + * The CodeBuildSourceCredentialsInfo definition stages. + */ + interface DefinitionStages { + /** + * The first stage of the CodeBuildSourceCredentialsInfo definition. + */ + interface Blank extends WithLocation { + } + + /** + * The stage of the CodeBuildSourceCredentialsInfo definition allowing to specify location. + */ + interface WithLocation { + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithResourceGroup withRegion(Region location); + + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithResourceGroup withRegion(String location); + } + + /** + * The stage of the CodeBuildSourceCredentialsInfo definition allowing to specify parent resource. + */ + interface WithResourceGroup { + /** + * Specifies resourceGroupName. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @return the next definition stage. + */ + WithCreate withExistingResourceGroup(String resourceGroupName); + } + + /** + * The stage of the CodeBuildSourceCredentialsInfo 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.WithProperties { + /** + * Executes the create request. + * + * @return the created resource. + */ + CodeBuildSourceCredentialsInfo create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + CodeBuildSourceCredentialsInfo create(Context context); + } + + /** + * The stage of the CodeBuildSourceCredentialsInfo definition allowing to specify tags. + */ + interface WithTags { + /** + * Specifies the tags property: Resource tags.. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + WithCreate withTags(Map tags); + } + + /** + * The stage of the CodeBuildSourceCredentialsInfo definition allowing to specify properties. + */ + interface WithProperties { + /** + * Specifies the properties property: The resource-specific properties for this resource.. + * + * @param properties The resource-specific properties for this resource. + * @return the next definition stage. + */ + WithCreate withProperties(CodeBuildSourceCredentialsInfoProperties properties); + } + } + + /** + * Begins update for the CodeBuildSourceCredentialsInfo resource. + * + * @return the stage of resource update. + */ + CodeBuildSourceCredentialsInfo.Update update(); + + /** + * The template for CodeBuildSourceCredentialsInfo update. + */ + interface Update extends UpdateStages.WithTags { + /** + * Executes the update request. + * + * @return the updated resource. + */ + CodeBuildSourceCredentialsInfo apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + CodeBuildSourceCredentialsInfo apply(Context context); + } + + /** + * The CodeBuildSourceCredentialsInfo update stages. + */ + interface UpdateStages { + /** + * The stage of the CodeBuildSourceCredentialsInfo update allowing to specify tags. + */ + interface WithTags { + /** + * Specifies the tags property: Resource tags.. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + Update withTags(Map tags); + } + } + + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + CodeBuildSourceCredentialsInfo refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + CodeBuildSourceCredentialsInfo refresh(Context context); +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/CodeBuildSourceCredentialsInfoListResult.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/CodeBuildSourceCredentialsInfoListResult.java new file mode 100644 index 000000000000..57cb510e602e --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/CodeBuildSourceCredentialsInfoListResult.java @@ -0,0 +1,138 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.awsconnector.fluent.models.CodeBuildSourceCredentialsInfoInner; +import java.io.IOException; +import java.util.List; + +/** + * The response of a CodeBuildSourceCredentialsInfo list operation. + */ +@Fluent +public final class CodeBuildSourceCredentialsInfoListResult + implements JsonSerializable { + /* + * The CodeBuildSourceCredentialsInfo items on this page + */ + private List value; + + /* + * The link to the next page of items + */ + private String nextLink; + + /** + * Creates an instance of CodeBuildSourceCredentialsInfoListResult class. + */ + public CodeBuildSourceCredentialsInfoListResult() { + } + + /** + * Get the value property: The CodeBuildSourceCredentialsInfo items on this page. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The CodeBuildSourceCredentialsInfo items on this page. + * + * @param value the value value to set. + * @return the CodeBuildSourceCredentialsInfoListResult object itself. + */ + public CodeBuildSourceCredentialsInfoListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The link to the next page of items. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: The link to the next page of items. + * + * @param nextLink the nextLink value to set. + * @return the CodeBuildSourceCredentialsInfoListResult object itself. + */ + public CodeBuildSourceCredentialsInfoListResult withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property value in model CodeBuildSourceCredentialsInfoListResult")); + } else { + value().forEach(e -> e.validate()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(CodeBuildSourceCredentialsInfoListResult.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("nextLink", this.nextLink); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of CodeBuildSourceCredentialsInfoListResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of CodeBuildSourceCredentialsInfoListResult if the JsonReader was pointing to an instance of + * it, or null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the CodeBuildSourceCredentialsInfoListResult. + */ + public static CodeBuildSourceCredentialsInfoListResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + CodeBuildSourceCredentialsInfoListResult deserializedCodeBuildSourceCredentialsInfoListResult + = new CodeBuildSourceCredentialsInfoListResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> CodeBuildSourceCredentialsInfoInner.fromJson(reader1)); + deserializedCodeBuildSourceCredentialsInfoListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedCodeBuildSourceCredentialsInfoListResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedCodeBuildSourceCredentialsInfoListResult; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/CodeBuildSourceCredentialsInfoProperties.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/CodeBuildSourceCredentialsInfoProperties.java new file mode 100644 index 000000000000..495e8b5c2e66 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/CodeBuildSourceCredentialsInfoProperties.java @@ -0,0 +1,317 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.Map; + +/** + * Definition of CodeBuildSourceCredentialsInfo. + */ +@Fluent +public final class CodeBuildSourceCredentialsInfoProperties + implements JsonSerializable { + /* + * AWS Properties + */ + private AwsCodeBuildSourceCredentialsInfoProperties awsProperties; + + /* + * Public Cloud Connectors Resource ID + */ + private String publicCloudConnectorsResourceId; + + /* + * AWS Account ID + */ + private String awsAccountId; + + /* + * Amazon Resource Name (ARN) + */ + private String arn; + + /* + * Public Cloud Resource Name + */ + private String publicCloudResourceName; + + /* + * AWS Source Schema + */ + private String awsSourceSchema; + + /* + * AWS Region + */ + private String awsRegion; + + /* + * AWS Tags + */ + private Map awsTags; + + /* + * The status of the last operation. + */ + private ProvisioningState provisioningState; + + /** + * Creates an instance of CodeBuildSourceCredentialsInfoProperties class. + */ + public CodeBuildSourceCredentialsInfoProperties() { + } + + /** + * Get the awsProperties property: AWS Properties. + * + * @return the awsProperties value. + */ + public AwsCodeBuildSourceCredentialsInfoProperties awsProperties() { + return this.awsProperties; + } + + /** + * Set the awsProperties property: AWS Properties. + * + * @param awsProperties the awsProperties value to set. + * @return the CodeBuildSourceCredentialsInfoProperties object itself. + */ + public CodeBuildSourceCredentialsInfoProperties + withAwsProperties(AwsCodeBuildSourceCredentialsInfoProperties awsProperties) { + this.awsProperties = awsProperties; + return this; + } + + /** + * Get the publicCloudConnectorsResourceId property: Public Cloud Connectors Resource ID. + * + * @return the publicCloudConnectorsResourceId value. + */ + public String publicCloudConnectorsResourceId() { + return this.publicCloudConnectorsResourceId; + } + + /** + * Set the publicCloudConnectorsResourceId property: Public Cloud Connectors Resource ID. + * + * @param publicCloudConnectorsResourceId the publicCloudConnectorsResourceId value to set. + * @return the CodeBuildSourceCredentialsInfoProperties object itself. + */ + public CodeBuildSourceCredentialsInfoProperties + withPublicCloudConnectorsResourceId(String publicCloudConnectorsResourceId) { + this.publicCloudConnectorsResourceId = publicCloudConnectorsResourceId; + return this; + } + + /** + * Get the awsAccountId property: AWS Account ID. + * + * @return the awsAccountId value. + */ + public String awsAccountId() { + return this.awsAccountId; + } + + /** + * Set the awsAccountId property: AWS Account ID. + * + * @param awsAccountId the awsAccountId value to set. + * @return the CodeBuildSourceCredentialsInfoProperties object itself. + */ + public CodeBuildSourceCredentialsInfoProperties withAwsAccountId(String awsAccountId) { + this.awsAccountId = awsAccountId; + return this; + } + + /** + * Get the arn property: Amazon Resource Name (ARN). + * + * @return the arn value. + */ + public String arn() { + return this.arn; + } + + /** + * Set the arn property: Amazon Resource Name (ARN). + * + * @param arn the arn value to set. + * @return the CodeBuildSourceCredentialsInfoProperties object itself. + */ + public CodeBuildSourceCredentialsInfoProperties withArn(String arn) { + this.arn = arn; + return this; + } + + /** + * Get the publicCloudResourceName property: Public Cloud Resource Name. + * + * @return the publicCloudResourceName value. + */ + public String publicCloudResourceName() { + return this.publicCloudResourceName; + } + + /** + * Set the publicCloudResourceName property: Public Cloud Resource Name. + * + * @param publicCloudResourceName the publicCloudResourceName value to set. + * @return the CodeBuildSourceCredentialsInfoProperties object itself. + */ + public CodeBuildSourceCredentialsInfoProperties withPublicCloudResourceName(String publicCloudResourceName) { + this.publicCloudResourceName = publicCloudResourceName; + return this; + } + + /** + * Get the awsSourceSchema property: AWS Source Schema. + * + * @return the awsSourceSchema value. + */ + public String awsSourceSchema() { + return this.awsSourceSchema; + } + + /** + * Set the awsSourceSchema property: AWS Source Schema. + * + * @param awsSourceSchema the awsSourceSchema value to set. + * @return the CodeBuildSourceCredentialsInfoProperties object itself. + */ + public CodeBuildSourceCredentialsInfoProperties withAwsSourceSchema(String awsSourceSchema) { + this.awsSourceSchema = awsSourceSchema; + return this; + } + + /** + * Get the awsRegion property: AWS Region. + * + * @return the awsRegion value. + */ + public String awsRegion() { + return this.awsRegion; + } + + /** + * Set the awsRegion property: AWS Region. + * + * @param awsRegion the awsRegion value to set. + * @return the CodeBuildSourceCredentialsInfoProperties object itself. + */ + public CodeBuildSourceCredentialsInfoProperties withAwsRegion(String awsRegion) { + this.awsRegion = awsRegion; + return this; + } + + /** + * Get the awsTags property: AWS Tags. + * + * @return the awsTags value. + */ + public Map awsTags() { + return this.awsTags; + } + + /** + * Set the awsTags property: AWS Tags. + * + * @param awsTags the awsTags value to set. + * @return the CodeBuildSourceCredentialsInfoProperties object itself. + */ + public CodeBuildSourceCredentialsInfoProperties withAwsTags(Map awsTags) { + this.awsTags = awsTags; + return this; + } + + /** + * Get the provisioningState property: The status of the last operation. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (awsProperties() != null) { + awsProperties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("awsProperties", this.awsProperties); + jsonWriter.writeStringField("publicCloudConnectorsResourceId", this.publicCloudConnectorsResourceId); + jsonWriter.writeStringField("awsAccountId", this.awsAccountId); + jsonWriter.writeStringField("arn", this.arn); + jsonWriter.writeStringField("publicCloudResourceName", this.publicCloudResourceName); + jsonWriter.writeStringField("awsSourceSchema", this.awsSourceSchema); + jsonWriter.writeStringField("awsRegion", this.awsRegion); + jsonWriter.writeMapField("awsTags", this.awsTags, (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of CodeBuildSourceCredentialsInfoProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of CodeBuildSourceCredentialsInfoProperties if the JsonReader was pointing to an instance of + * it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the CodeBuildSourceCredentialsInfoProperties. + */ + public static CodeBuildSourceCredentialsInfoProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + CodeBuildSourceCredentialsInfoProperties deserializedCodeBuildSourceCredentialsInfoProperties + = new CodeBuildSourceCredentialsInfoProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("awsProperties".equals(fieldName)) { + deserializedCodeBuildSourceCredentialsInfoProperties.awsProperties + = AwsCodeBuildSourceCredentialsInfoProperties.fromJson(reader); + } else if ("publicCloudConnectorsResourceId".equals(fieldName)) { + deserializedCodeBuildSourceCredentialsInfoProperties.publicCloudConnectorsResourceId + = reader.getString(); + } else if ("awsAccountId".equals(fieldName)) { + deserializedCodeBuildSourceCredentialsInfoProperties.awsAccountId = reader.getString(); + } else if ("arn".equals(fieldName)) { + deserializedCodeBuildSourceCredentialsInfoProperties.arn = reader.getString(); + } else if ("publicCloudResourceName".equals(fieldName)) { + deserializedCodeBuildSourceCredentialsInfoProperties.publicCloudResourceName = reader.getString(); + } else if ("awsSourceSchema".equals(fieldName)) { + deserializedCodeBuildSourceCredentialsInfoProperties.awsSourceSchema = reader.getString(); + } else if ("awsRegion".equals(fieldName)) { + deserializedCodeBuildSourceCredentialsInfoProperties.awsRegion = reader.getString(); + } else if ("awsTags".equals(fieldName)) { + Map awsTags = reader.readMap(reader1 -> reader1.getString()); + deserializedCodeBuildSourceCredentialsInfoProperties.awsTags = awsTags; + } else if ("provisioningState".equals(fieldName)) { + deserializedCodeBuildSourceCredentialsInfoProperties.provisioningState + = ProvisioningState.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedCodeBuildSourceCredentialsInfoProperties; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/CodeBuildSourceCredentialsInfoTagsUpdate.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/CodeBuildSourceCredentialsInfoTagsUpdate.java new file mode 100644 index 000000000000..00341fd934ad --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/CodeBuildSourceCredentialsInfoTagsUpdate.java @@ -0,0 +1,97 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.Map; + +/** + * The type used for updating tags in CodeBuildSourceCredentialsInfo resources. + */ +@Fluent +public final class CodeBuildSourceCredentialsInfoTagsUpdate + implements JsonSerializable { + /* + * Resource tags. + */ + private Map tags; + + /** + * Creates an instance of CodeBuildSourceCredentialsInfoTagsUpdate class. + */ + public CodeBuildSourceCredentialsInfoTagsUpdate() { + } + + /** + * Get the tags property: Resource tags. + * + * @return the tags value. + */ + public Map tags() { + return this.tags; + } + + /** + * Set the tags property: Resource tags. + * + * @param tags the tags value to set. + * @return the CodeBuildSourceCredentialsInfoTagsUpdate object itself. + */ + public CodeBuildSourceCredentialsInfoTagsUpdate withTags(Map tags) { + this.tags = tags; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeMapField("tags", this.tags, (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of CodeBuildSourceCredentialsInfoTagsUpdate from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of CodeBuildSourceCredentialsInfoTagsUpdate if the JsonReader was pointing to an instance of + * it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the CodeBuildSourceCredentialsInfoTagsUpdate. + */ + public static CodeBuildSourceCredentialsInfoTagsUpdate fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + CodeBuildSourceCredentialsInfoTagsUpdate deserializedCodeBuildSourceCredentialsInfoTagsUpdate + = new CodeBuildSourceCredentialsInfoTagsUpdate(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedCodeBuildSourceCredentialsInfoTagsUpdate.tags = tags; + } else { + reader.skipChildren(); + } + } + + return deserializedCodeBuildSourceCredentialsInfoTagsUpdate; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/CodeBuildSourceCredentialsInfos.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/CodeBuildSourceCredentialsInfos.java new file mode 100644 index 000000000000..5038c122e6b4 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/CodeBuildSourceCredentialsInfos.java @@ -0,0 +1,162 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** + * Resource collection API of CodeBuildSourceCredentialsInfos. + */ +public interface CodeBuildSourceCredentialsInfos { + /** + * List CodeBuildSourceCredentialsInfo resources by subscription ID. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a CodeBuildSourceCredentialsInfo list operation as paginated response with + * {@link PagedIterable}. + */ + PagedIterable list(); + + /** + * List CodeBuildSourceCredentialsInfo resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a CodeBuildSourceCredentialsInfo list operation as paginated response with + * {@link PagedIterable}. + */ + PagedIterable list(Context context); + + /** + * List CodeBuildSourceCredentialsInfo resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a CodeBuildSourceCredentialsInfo list operation as paginated response with + * {@link PagedIterable}. + */ + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * List CodeBuildSourceCredentialsInfo resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a CodeBuildSourceCredentialsInfo list operation as paginated response with + * {@link PagedIterable}. + */ + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Get a CodeBuildSourceCredentialsInfo. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of CodeBuildSourceCredentialsInfo. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a CodeBuildSourceCredentialsInfo along with {@link Response}. + */ + Response getByResourceGroupWithResponse(String resourceGroupName, String name, + Context context); + + /** + * Get a CodeBuildSourceCredentialsInfo. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of CodeBuildSourceCredentialsInfo. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a CodeBuildSourceCredentialsInfo. + */ + CodeBuildSourceCredentialsInfo getByResourceGroup(String resourceGroupName, String name); + + /** + * Delete a CodeBuildSourceCredentialsInfo. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of CodeBuildSourceCredentialsInfo. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByResourceGroup(String resourceGroupName, String name); + + /** + * Delete a CodeBuildSourceCredentialsInfo. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of CodeBuildSourceCredentialsInfo. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String name, Context context); + + /** + * Get a CodeBuildSourceCredentialsInfo. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a CodeBuildSourceCredentialsInfo along with {@link Response}. + */ + CodeBuildSourceCredentialsInfo getById(String id); + + /** + * Get a CodeBuildSourceCredentialsInfo. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a CodeBuildSourceCredentialsInfo along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Delete a CodeBuildSourceCredentialsInfo. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteById(String id); + + /** + * Delete a CodeBuildSourceCredentialsInfo. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new CodeBuildSourceCredentialsInfo resource. + * + * @param name resource name. + * @return the first stage of the new CodeBuildSourceCredentialsInfo definition. + */ + CodeBuildSourceCredentialsInfo.DefinitionStages.Blank define(String name); +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/CognitoOptions.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/CognitoOptions.java new file mode 100644 index 000000000000..002a77ef1eb1 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/CognitoOptions.java @@ -0,0 +1,188 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of CognitoOptions. + */ +@Fluent +public final class CognitoOptions implements JsonSerializable { + /* + *

Whether to enable or disable Amazon Cognito authentication for OpenSearch Dashboards.

+ */ + private Boolean enabled; + + /* + *

The Amazon Cognito identity pool ID that you want OpenSearch Service to use for OpenSearch Dashboards + * authentication.

+ */ + private String identityPoolId; + + /* + *

The AmazonOpenSearchServiceCognitoAccess role that allows OpenSearch Service to configure your + * user pool and identity pool.

+ */ + private String roleArn; + + /* + *

The Amazon Cognito user pool ID that you want OpenSearch Service to use for OpenSearch Dashboards + * authentication.

+ */ + private String userPoolId; + + /** + * Creates an instance of CognitoOptions class. + */ + public CognitoOptions() { + } + + /** + * Get the enabled property: <p>Whether to enable or disable Amazon Cognito authentication for OpenSearch + * Dashboards.</p>. + * + * @return the enabled value. + */ + public Boolean enabled() { + return this.enabled; + } + + /** + * Set the enabled property: <p>Whether to enable or disable Amazon Cognito authentication for OpenSearch + * Dashboards.</p>. + * + * @param enabled the enabled value to set. + * @return the CognitoOptions object itself. + */ + public CognitoOptions withEnabled(Boolean enabled) { + this.enabled = enabled; + return this; + } + + /** + * Get the identityPoolId property: <p>The Amazon Cognito identity pool ID that you want OpenSearch Service to + * use for OpenSearch Dashboards authentication.</p>. + * + * @return the identityPoolId value. + */ + public String identityPoolId() { + return this.identityPoolId; + } + + /** + * Set the identityPoolId property: <p>The Amazon Cognito identity pool ID that you want OpenSearch Service to + * use for OpenSearch Dashboards authentication.</p>. + * + * @param identityPoolId the identityPoolId value to set. + * @return the CognitoOptions object itself. + */ + public CognitoOptions withIdentityPoolId(String identityPoolId) { + this.identityPoolId = identityPoolId; + return this; + } + + /** + * Get the roleArn property: <p>The <code>AmazonOpenSearchServiceCognitoAccess</code> role that + * allows OpenSearch Service to configure your user pool and identity pool.</p>. + * + * @return the roleArn value. + */ + public String roleArn() { + return this.roleArn; + } + + /** + * Set the roleArn property: <p>The <code>AmazonOpenSearchServiceCognitoAccess</code> role that + * allows OpenSearch Service to configure your user pool and identity pool.</p>. + * + * @param roleArn the roleArn value to set. + * @return the CognitoOptions object itself. + */ + public CognitoOptions withRoleArn(String roleArn) { + this.roleArn = roleArn; + return this; + } + + /** + * Get the userPoolId property: <p>The Amazon Cognito user pool ID that you want OpenSearch Service to use for + * OpenSearch Dashboards authentication.</p>. + * + * @return the userPoolId value. + */ + public String userPoolId() { + return this.userPoolId; + } + + /** + * Set the userPoolId property: <p>The Amazon Cognito user pool ID that you want OpenSearch Service to use for + * OpenSearch Dashboards authentication.</p>. + * + * @param userPoolId the userPoolId value to set. + * @return the CognitoOptions object itself. + */ + public CognitoOptions withUserPoolId(String userPoolId) { + this.userPoolId = userPoolId; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeBooleanField("enabled", this.enabled); + jsonWriter.writeStringField("identityPoolId", this.identityPoolId); + jsonWriter.writeStringField("roleArn", this.roleArn); + jsonWriter.writeStringField("userPoolId", this.userPoolId); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of CognitoOptions from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of CognitoOptions if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the CognitoOptions. + */ + public static CognitoOptions fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + CognitoOptions deserializedCognitoOptions = new CognitoOptions(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("enabled".equals(fieldName)) { + deserializedCognitoOptions.enabled = reader.getNullable(JsonReader::getBoolean); + } else if ("identityPoolId".equals(fieldName)) { + deserializedCognitoOptions.identityPoolId = reader.getString(); + } else if ("roleArn".equals(fieldName)) { + deserializedCognitoOptions.roleArn = reader.getString(); + } else if ("userPoolId".equals(fieldName)) { + deserializedCognitoOptions.userPoolId = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedCognitoOptions; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/CognitoUserPoolConfig.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/CognitoUserPoolConfig.java new file mode 100644 index 000000000000..4f93cd0f6acb --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/CognitoUserPoolConfig.java @@ -0,0 +1,154 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of CognitoUserPoolConfig. + */ +@Fluent +public final class CognitoUserPoolConfig implements JsonSerializable { + /* + *

A regular expression for validating the incoming Amazon Cognito user pool app client ID. If this value isn't + * set, no filtering is applied.

+ */ + private String appIdClientRegex; + + /* + *

The Amazon Web Services Region in which the user pool was created.

+ */ + private String awsRegion; + + /* + *

The user pool ID.

+ */ + private String userPoolId; + + /** + * Creates an instance of CognitoUserPoolConfig class. + */ + public CognitoUserPoolConfig() { + } + + /** + * Get the appIdClientRegex property: <p>A regular expression for validating the incoming Amazon Cognito user + * pool app client ID. If this value isn't set, no filtering is applied.</p>. + * + * @return the appIdClientRegex value. + */ + public String appIdClientRegex() { + return this.appIdClientRegex; + } + + /** + * Set the appIdClientRegex property: <p>A regular expression for validating the incoming Amazon Cognito user + * pool app client ID. If this value isn't set, no filtering is applied.</p>. + * + * @param appIdClientRegex the appIdClientRegex value to set. + * @return the CognitoUserPoolConfig object itself. + */ + public CognitoUserPoolConfig withAppIdClientRegex(String appIdClientRegex) { + this.appIdClientRegex = appIdClientRegex; + return this; + } + + /** + * Get the awsRegion property: <p>The Amazon Web Services Region in which the user pool was + * created.</p>. + * + * @return the awsRegion value. + */ + public String awsRegion() { + return this.awsRegion; + } + + /** + * Set the awsRegion property: <p>The Amazon Web Services Region in which the user pool was + * created.</p>. + * + * @param awsRegion the awsRegion value to set. + * @return the CognitoUserPoolConfig object itself. + */ + public CognitoUserPoolConfig withAwsRegion(String awsRegion) { + this.awsRegion = awsRegion; + return this; + } + + /** + * Get the userPoolId property: <p>The user pool ID.</p>. + * + * @return the userPoolId value. + */ + public String userPoolId() { + return this.userPoolId; + } + + /** + * Set the userPoolId property: <p>The user pool ID.</p>. + * + * @param userPoolId the userPoolId value to set. + * @return the CognitoUserPoolConfig object itself. + */ + public CognitoUserPoolConfig withUserPoolId(String userPoolId) { + this.userPoolId = userPoolId; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("appIdClientRegex", this.appIdClientRegex); + jsonWriter.writeStringField("awsRegion", this.awsRegion); + jsonWriter.writeStringField("userPoolId", this.userPoolId); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of CognitoUserPoolConfig from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of CognitoUserPoolConfig if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the CognitoUserPoolConfig. + */ + public static CognitoUserPoolConfig fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + CognitoUserPoolConfig deserializedCognitoUserPoolConfig = new CognitoUserPoolConfig(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("appIdClientRegex".equals(fieldName)) { + deserializedCognitoUserPoolConfig.appIdClientRegex = reader.getString(); + } else if ("awsRegion".equals(fieldName)) { + deserializedCognitoUserPoolConfig.awsRegion = reader.getString(); + } else if ("userPoolId".equals(fieldName)) { + deserializedCognitoUserPoolConfig.userPoolId = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedCognitoUserPoolConfig; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ColdStorageOptions.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ColdStorageOptions.java new file mode 100644 index 000000000000..aeb202454fcc --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ColdStorageOptions.java @@ -0,0 +1,96 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of ColdStorageOptions. + */ +@Fluent +public final class ColdStorageOptions implements JsonSerializable { + /* + *

Whether to enable or disable cold storage on the domain. You must enable UltraWarm storage to enable cold + * storage.

+ */ + private Boolean enabled; + + /** + * Creates an instance of ColdStorageOptions class. + */ + public ColdStorageOptions() { + } + + /** + * Get the enabled property: <p>Whether to enable or disable cold storage on the domain. You must enable + * UltraWarm storage to enable cold storage.</p>. + * + * @return the enabled value. + */ + public Boolean enabled() { + return this.enabled; + } + + /** + * Set the enabled property: <p>Whether to enable or disable cold storage on the domain. You must enable + * UltraWarm storage to enable cold storage.</p>. + * + * @param enabled the enabled value to set. + * @return the ColdStorageOptions object itself. + */ + public ColdStorageOptions withEnabled(Boolean enabled) { + this.enabled = enabled; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeBooleanField("enabled", this.enabled); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ColdStorageOptions from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ColdStorageOptions if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the ColdStorageOptions. + */ + public static ColdStorageOptions fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ColdStorageOptions deserializedColdStorageOptions = new ColdStorageOptions(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("enabled".equals(fieldName)) { + deserializedColdStorageOptions.enabled = reader.getNullable(JsonReader::getBoolean); + } else { + reader.skipChildren(); + } + } + + return deserializedColdStorageOptions; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ComplianceExecutionSummary.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ComplianceExecutionSummary.java new file mode 100644 index 000000000000..de295ca8e0d4 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ComplianceExecutionSummary.java @@ -0,0 +1,164 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.time.OffsetDateTime; +import java.time.format.DateTimeFormatter; + +/** + * Definition of ComplianceExecutionSummary. + */ +@Fluent +public final class ComplianceExecutionSummary implements JsonSerializable { + /* + *

An ID created by the system when PutComplianceItems was called. For example, + * CommandID is a valid execution ID. You can use this ID in subsequent calls.

+ */ + private String executionId; + + /* + *

The time the execution ran as a datetime object that is saved in the following format: + * yyyy-MM-dd'T'HH:mm:ss'Z'

+ */ + private OffsetDateTime executionTime; + + /* + *

The type of execution. For example, Command is a valid execution type.

+ */ + private String executionType; + + /** + * Creates an instance of ComplianceExecutionSummary class. + */ + public ComplianceExecutionSummary() { + } + + /** + * Get the executionId property: <p>An ID created by the system when + * <code>PutComplianceItems</code> was called. For example, <code>CommandID</code> is a + * valid execution ID. You can use this ID in subsequent calls.</p>. + * + * @return the executionId value. + */ + public String executionId() { + return this.executionId; + } + + /** + * Set the executionId property: <p>An ID created by the system when + * <code>PutComplianceItems</code> was called. For example, <code>CommandID</code> is a + * valid execution ID. You can use this ID in subsequent calls.</p>. + * + * @param executionId the executionId value to set. + * @return the ComplianceExecutionSummary object itself. + */ + public ComplianceExecutionSummary withExecutionId(String executionId) { + this.executionId = executionId; + return this; + } + + /** + * Get the executionTime property: <p>The time the execution ran as a datetime object that is saved in the + * following format: <code>yyyy-MM-dd'T'HH:mm:ss'Z'</code> </p>. + * + * @return the executionTime value. + */ + public OffsetDateTime executionTime() { + return this.executionTime; + } + + /** + * Set the executionTime property: <p>The time the execution ran as a datetime object that is saved in the + * following format: <code>yyyy-MM-dd'T'HH:mm:ss'Z'</code> </p>. + * + * @param executionTime the executionTime value to set. + * @return the ComplianceExecutionSummary object itself. + */ + public ComplianceExecutionSummary withExecutionTime(OffsetDateTime executionTime) { + this.executionTime = executionTime; + return this; + } + + /** + * Get the executionType property: <p>The type of execution. For example, <code>Command</code> is + * a valid execution type.</p>. + * + * @return the executionType value. + */ + public String executionType() { + return this.executionType; + } + + /** + * Set the executionType property: <p>The type of execution. For example, <code>Command</code> is + * a valid execution type.</p>. + * + * @param executionType the executionType value to set. + * @return the ComplianceExecutionSummary object itself. + */ + public ComplianceExecutionSummary withExecutionType(String executionType) { + this.executionType = executionType; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("executionId", this.executionId); + jsonWriter.writeStringField("executionTime", + this.executionTime == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.executionTime)); + jsonWriter.writeStringField("executionType", this.executionType); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ComplianceExecutionSummary from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ComplianceExecutionSummary if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ComplianceExecutionSummary. + */ + public static ComplianceExecutionSummary fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ComplianceExecutionSummary deserializedComplianceExecutionSummary = new ComplianceExecutionSummary(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("executionId".equals(fieldName)) { + deserializedComplianceExecutionSummary.executionId = reader.getString(); + } else if ("executionTime".equals(fieldName)) { + deserializedComplianceExecutionSummary.executionTime = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("executionType".equals(fieldName)) { + deserializedComplianceExecutionSummary.executionType = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedComplianceExecutionSummary; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ComplianceSeverity.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ComplianceSeverity.java new file mode 100644 index 000000000000..036d4fc86b68 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ComplianceSeverity.java @@ -0,0 +1,71 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * ComplianceSeverity enum. + */ +public final class ComplianceSeverity extends ExpandableStringEnum { + /** + * Static value CRITICAL for ComplianceSeverity. + */ + public static final ComplianceSeverity CRITICAL = fromString("CRITICAL"); + + /** + * Static value HIGH for ComplianceSeverity. + */ + public static final ComplianceSeverity HIGH = fromString("HIGH"); + + /** + * Static value INFORMATIONAL for ComplianceSeverity. + */ + public static final ComplianceSeverity INFORMATIONAL = fromString("INFORMATIONAL"); + + /** + * Static value LOW for ComplianceSeverity. + */ + public static final ComplianceSeverity LOW = fromString("LOW"); + + /** + * Static value MEDIUM for ComplianceSeverity. + */ + public static final ComplianceSeverity MEDIUM = fromString("MEDIUM"); + + /** + * Static value UNSPECIFIED for ComplianceSeverity. + */ + public static final ComplianceSeverity UNSPECIFIED = fromString("UNSPECIFIED"); + + /** + * Creates a new instance of ComplianceSeverity value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ComplianceSeverity() { + } + + /** + * Creates or finds a ComplianceSeverity from its string representation. + * + * @param name a name to look for. + * @return the corresponding ComplianceSeverity. + */ + public static ComplianceSeverity fromString(String name) { + return fromString(name, ComplianceSeverity.class); + } + + /** + * Gets known ComplianceSeverity values. + * + * @return known ComplianceSeverity values. + */ + public static Collection values() { + return values(ComplianceSeverity.class); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ComplianceSeverityEnumValue.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ComplianceSeverityEnumValue.java new file mode 100644 index 000000000000..b413996313eb --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ComplianceSeverityEnumValue.java @@ -0,0 +1,93 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of ComplianceSeverityEnumValue. + */ +@Fluent +public final class ComplianceSeverityEnumValue implements JsonSerializable { + /* + * Property value + */ + private ComplianceSeverity value; + + /** + * Creates an instance of ComplianceSeverityEnumValue class. + */ + public ComplianceSeverityEnumValue() { + } + + /** + * Get the value property: Property value. + * + * @return the value value. + */ + public ComplianceSeverity value() { + return this.value; + } + + /** + * Set the value property: Property value. + * + * @param value the value value to set. + * @return the ComplianceSeverityEnumValue object itself. + */ + public ComplianceSeverityEnumValue withValue(ComplianceSeverity value) { + this.value = value; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("value", this.value == null ? null : this.value.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ComplianceSeverityEnumValue from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ComplianceSeverityEnumValue if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ComplianceSeverityEnumValue. + */ + public static ComplianceSeverityEnumValue fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ComplianceSeverityEnumValue deserializedComplianceSeverityEnumValue = new ComplianceSeverityEnumValue(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + deserializedComplianceSeverityEnumValue.value = ComplianceSeverity.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedComplianceSeverityEnumValue; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ComplianceStatus.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ComplianceStatus.java new file mode 100644 index 000000000000..025ede926dc9 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ComplianceStatus.java @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * ComplianceStatus enum. + */ +public final class ComplianceStatus extends ExpandableStringEnum { + /** + * Static value COMPLIANT for ComplianceStatus. + */ + public static final ComplianceStatus COMPLIANT = fromString("COMPLIANT"); + + /** + * Static value NON_COMPLIANT for ComplianceStatus. + */ + public static final ComplianceStatus NON_COMPLIANT = fromString("NON_COMPLIANT"); + + /** + * Creates a new instance of ComplianceStatus value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ComplianceStatus() { + } + + /** + * Creates or finds a ComplianceStatus from its string representation. + * + * @param name a name to look for. + * @return the corresponding ComplianceStatus. + */ + public static ComplianceStatus fromString(String name) { + return fromString(name, ComplianceStatus.class); + } + + /** + * Gets known ComplianceStatus values. + * + * @return known ComplianceStatus values. + */ + public static Collection values() { + return values(ComplianceStatus.class); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ComplianceStatusEnumValue.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ComplianceStatusEnumValue.java new file mode 100644 index 000000000000..93765e220cf3 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ComplianceStatusEnumValue.java @@ -0,0 +1,93 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of ComplianceStatusEnumValue. + */ +@Fluent +public final class ComplianceStatusEnumValue implements JsonSerializable { + /* + * Property value + */ + private ComplianceStatus value; + + /** + * Creates an instance of ComplianceStatusEnumValue class. + */ + public ComplianceStatusEnumValue() { + } + + /** + * Get the value property: Property value. + * + * @return the value value. + */ + public ComplianceStatus value() { + return this.value; + } + + /** + * Set the value property: Property value. + * + * @param value the value value to set. + * @return the ComplianceStatusEnumValue object itself. + */ + public ComplianceStatusEnumValue withValue(ComplianceStatus value) { + this.value = value; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("value", this.value == null ? null : this.value.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ComplianceStatusEnumValue from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ComplianceStatusEnumValue if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ComplianceStatusEnumValue. + */ + public static ComplianceStatusEnumValue fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ComplianceStatusEnumValue deserializedComplianceStatusEnumValue = new ComplianceStatusEnumValue(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + deserializedComplianceStatusEnumValue.value = ComplianceStatus.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedComplianceStatusEnumValue; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/CompliantSummary.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/CompliantSummary.java new file mode 100644 index 000000000000..1d70d6f9afa0 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/CompliantSummary.java @@ -0,0 +1,124 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of CompliantSummary. + */ +@Fluent +public final class CompliantSummary implements JsonSerializable { + /* + *

The total number of resources that are compliant.

+ */ + private Integer compliantCount; + + /* + *

A summary of the compliance severity by compliance type.

+ */ + private SeveritySummary severitySummary; + + /** + * Creates an instance of CompliantSummary class. + */ + public CompliantSummary() { + } + + /** + * Get the compliantCount property: <p>The total number of resources that are compliant.</p>. + * + * @return the compliantCount value. + */ + public Integer compliantCount() { + return this.compliantCount; + } + + /** + * Set the compliantCount property: <p>The total number of resources that are compliant.</p>. + * + * @param compliantCount the compliantCount value to set. + * @return the CompliantSummary object itself. + */ + public CompliantSummary withCompliantCount(Integer compliantCount) { + this.compliantCount = compliantCount; + return this; + } + + /** + * Get the severitySummary property: <p>A summary of the compliance severity by compliance type.</p>. + * + * @return the severitySummary value. + */ + public SeveritySummary severitySummary() { + return this.severitySummary; + } + + /** + * Set the severitySummary property: <p>A summary of the compliance severity by compliance type.</p>. + * + * @param severitySummary the severitySummary value to set. + * @return the CompliantSummary object itself. + */ + public CompliantSummary withSeveritySummary(SeveritySummary severitySummary) { + this.severitySummary = severitySummary; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (severitySummary() != null) { + severitySummary().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeNumberField("compliantCount", this.compliantCount); + jsonWriter.writeJsonField("severitySummary", this.severitySummary); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of CompliantSummary from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of CompliantSummary if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the CompliantSummary. + */ + public static CompliantSummary fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + CompliantSummary deserializedCompliantSummary = new CompliantSummary(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("compliantCount".equals(fieldName)) { + deserializedCompliantSummary.compliantCount = reader.getNullable(JsonReader::getInt); + } else if ("severitySummary".equals(fieldName)) { + deserializedCompliantSummary.severitySummary = SeveritySummary.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedCompliantSummary; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ComputeType.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ComputeType.java new file mode 100644 index 000000000000..d01d849ad44a --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ComputeType.java @@ -0,0 +1,91 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * ComputeType enum. + */ +public final class ComputeType extends ExpandableStringEnum { + /** + * Static value BUILD_GENERAL1_2XLARGE for ComputeType. + */ + public static final ComputeType BUILD_GENERAL1_2XLARGE = fromString("BUILD_GENERAL1_2XLARGE"); + + /** + * Static value BUILD_GENERAL1_LARGE for ComputeType. + */ + public static final ComputeType BUILD_GENERAL1_LARGE = fromString("BUILD_GENERAL1_LARGE"); + + /** + * Static value BUILD_GENERAL1_MEDIUM for ComputeType. + */ + public static final ComputeType BUILD_GENERAL1_MEDIUM = fromString("BUILD_GENERAL1_MEDIUM"); + + /** + * Static value BUILD_GENERAL1_SMALL for ComputeType. + */ + public static final ComputeType BUILD_GENERAL1_SMALL = fromString("BUILD_GENERAL1_SMALL"); + + /** + * Static value BUILD_GENERAL1_XLARGE for ComputeType. + */ + public static final ComputeType BUILD_GENERAL1_XLARGE = fromString("BUILD_GENERAL1_XLARGE"); + + /** + * Static value BUILD_LAMBDA_10GB for ComputeType. + */ + public static final ComputeType BUILD_LAMBDA_10GB = fromString("BUILD_LAMBDA_10GB"); + + /** + * Static value BUILD_LAMBDA_1GB for ComputeType. + */ + public static final ComputeType BUILD_LAMBDA_1GB = fromString("BUILD_LAMBDA_1GB"); + + /** + * Static value BUILD_LAMBDA_2GB for ComputeType. + */ + public static final ComputeType BUILD_LAMBDA_2GB = fromString("BUILD_LAMBDA_2GB"); + + /** + * Static value BUILD_LAMBDA_4GB for ComputeType. + */ + public static final ComputeType BUILD_LAMBDA_4GB = fromString("BUILD_LAMBDA_4GB"); + + /** + * Static value BUILD_LAMBDA_8GB for ComputeType. + */ + public static final ComputeType BUILD_LAMBDA_8GB = fromString("BUILD_LAMBDA_8GB"); + + /** + * Creates a new instance of ComputeType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ComputeType() { + } + + /** + * Creates or finds a ComputeType from its string representation. + * + * @param name a name to look for. + * @return the corresponding ComputeType. + */ + public static ComputeType fromString(String name) { + return fromString(name, ComputeType.class); + } + + /** + * Gets known ComputeType values. + * + * @return known ComputeType values. + */ + public static Collection values() { + return values(ComputeType.class); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ComputeTypeEnumValue.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ComputeTypeEnumValue.java new file mode 100644 index 000000000000..2eae23c36b41 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ComputeTypeEnumValue.java @@ -0,0 +1,93 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of ComputeTypeEnumValue. + */ +@Fluent +public final class ComputeTypeEnumValue implements JsonSerializable { + /* + * Property value + */ + private ComputeType value; + + /** + * Creates an instance of ComputeTypeEnumValue class. + */ + public ComputeTypeEnumValue() { + } + + /** + * Get the value property: Property value. + * + * @return the value value. + */ + public ComputeType value() { + return this.value; + } + + /** + * Set the value property: Property value. + * + * @param value the value value to set. + * @return the ComputeTypeEnumValue object itself. + */ + public ComputeTypeEnumValue withValue(ComputeType value) { + this.value = value; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("value", this.value == null ? null : this.value.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ComputeTypeEnumValue from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ComputeTypeEnumValue if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the ComputeTypeEnumValue. + */ + public static ComputeTypeEnumValue fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ComputeTypeEnumValue deserializedComputeTypeEnumValue = new ComputeTypeEnumValue(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + deserializedComputeTypeEnumValue.value = ComputeType.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedComputeTypeEnumValue; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/Condition.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/Condition.java new file mode 100644 index 000000000000..998b3dd18ed1 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/Condition.java @@ -0,0 +1,127 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of Condition. + */ +@Fluent +public final class Condition implements JsonSerializable { + /* + * A single action condition. + */ + private ActionConditionModelProperties actionCondition; + + /* + * A single label name condition. + */ + private LabelNameConditionModelProperties labelNameCondition; + + /** + * Creates an instance of Condition class. + */ + public Condition() { + } + + /** + * Get the actionCondition property: A single action condition. + * + * @return the actionCondition value. + */ + public ActionConditionModelProperties actionCondition() { + return this.actionCondition; + } + + /** + * Set the actionCondition property: A single action condition. + * + * @param actionCondition the actionCondition value to set. + * @return the Condition object itself. + */ + public Condition withActionCondition(ActionConditionModelProperties actionCondition) { + this.actionCondition = actionCondition; + return this; + } + + /** + * Get the labelNameCondition property: A single label name condition. + * + * @return the labelNameCondition value. + */ + public LabelNameConditionModelProperties labelNameCondition() { + return this.labelNameCondition; + } + + /** + * Set the labelNameCondition property: A single label name condition. + * + * @param labelNameCondition the labelNameCondition value to set. + * @return the Condition object itself. + */ + public Condition withLabelNameCondition(LabelNameConditionModelProperties labelNameCondition) { + this.labelNameCondition = labelNameCondition; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (actionCondition() != null) { + actionCondition().validate(); + } + if (labelNameCondition() != null) { + labelNameCondition().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("actionCondition", this.actionCondition); + jsonWriter.writeJsonField("labelNameCondition", this.labelNameCondition); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of Condition from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of Condition if the JsonReader was pointing to an instance of it, or null if it was pointing + * to JSON null. + * @throws IOException If an error occurs while reading the Condition. + */ + public static Condition fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + Condition deserializedCondition = new Condition(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("actionCondition".equals(fieldName)) { + deserializedCondition.actionCondition = ActionConditionModelProperties.fromJson(reader); + } else if ("labelNameCondition".equals(fieldName)) { + deserializedCondition.labelNameCondition = LabelNameConditionModelProperties.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedCondition; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ConfigChangeStatus.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ConfigChangeStatus.java new file mode 100644 index 000000000000..d211837a9dc2 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ConfigChangeStatus.java @@ -0,0 +1,81 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * ConfigChangeStatus enum. + */ +public final class ConfigChangeStatus extends ExpandableStringEnum { + /** + * Static value ApplyingChanges for ConfigChangeStatus. + */ + public static final ConfigChangeStatus APPLYING_CHANGES = fromString("ApplyingChanges"); + + /** + * Static value Cancelled for ConfigChangeStatus. + */ + public static final ConfigChangeStatus CANCELLED = fromString("Cancelled"); + + /** + * Static value Completed for ConfigChangeStatus. + */ + public static final ConfigChangeStatus COMPLETED = fromString("Completed"); + + /** + * Static value Initializing for ConfigChangeStatus. + */ + public static final ConfigChangeStatus INITIALIZING = fromString("Initializing"); + + /** + * Static value Pending for ConfigChangeStatus. + */ + public static final ConfigChangeStatus PENDING = fromString("Pending"); + + /** + * Static value PendingUserInput for ConfigChangeStatus. + */ + public static final ConfigChangeStatus PENDING_USER_INPUT = fromString("PendingUserInput"); + + /** + * Static value Validating for ConfigChangeStatus. + */ + public static final ConfigChangeStatus VALIDATING = fromString("Validating"); + + /** + * Static value ValidationFailed for ConfigChangeStatus. + */ + public static final ConfigChangeStatus VALIDATION_FAILED = fromString("ValidationFailed"); + + /** + * Creates a new instance of ConfigChangeStatus value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ConfigChangeStatus() { + } + + /** + * Creates or finds a ConfigChangeStatus from its string representation. + * + * @param name a name to look for. + * @return the corresponding ConfigChangeStatus. + */ + public static ConfigChangeStatus fromString(String name) { + return fromString(name, ConfigChangeStatus.class); + } + + /** + * Gets known ConfigChangeStatus values. + * + * @return known ConfigChangeStatus values. + */ + public static Collection values() { + return values(ConfigChangeStatus.class); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ConfigChangeStatusEnumValue.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ConfigChangeStatusEnumValue.java new file mode 100644 index 000000000000..327db8afdeed --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ConfigChangeStatusEnumValue.java @@ -0,0 +1,93 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of ConfigChangeStatusEnumValue. + */ +@Fluent +public final class ConfigChangeStatusEnumValue implements JsonSerializable { + /* + * Property value + */ + private ConfigChangeStatus value; + + /** + * Creates an instance of ConfigChangeStatusEnumValue class. + */ + public ConfigChangeStatusEnumValue() { + } + + /** + * Get the value property: Property value. + * + * @return the value value. + */ + public ConfigChangeStatus value() { + return this.value; + } + + /** + * Set the value property: Property value. + * + * @param value the value value to set. + * @return the ConfigChangeStatusEnumValue object itself. + */ + public ConfigChangeStatusEnumValue withValue(ConfigChangeStatus value) { + this.value = value; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("value", this.value == null ? null : this.value.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ConfigChangeStatusEnumValue from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ConfigChangeStatusEnumValue if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ConfigChangeStatusEnumValue. + */ + public static ConfigChangeStatusEnumValue fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ConfigChangeStatusEnumValue deserializedConfigChangeStatusEnumValue = new ConfigChangeStatusEnumValue(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + deserializedConfigChangeStatusEnumValue.value = ConfigChangeStatus.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedConfigChangeStatusEnumValue; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ConfigServiceConfigurationRecorder.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ConfigServiceConfigurationRecorder.java new file mode 100644 index 000000000000..feb174a43aba --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ConfigServiceConfigurationRecorder.java @@ -0,0 +1,253 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.awsconnector.fluent.models.ConfigServiceConfigurationRecorderInner; +import java.util.Map; + +/** + * An immutable client-side representation of ConfigServiceConfigurationRecorder. + */ +public interface ConfigServiceConfigurationRecorder { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the location property: The geo-location where the resource lives. + * + * @return the location value. + */ + String location(); + + /** + * Gets the tags property: Resource tags. + * + * @return the tags value. + */ + Map tags(); + + /** + * Gets the properties property: The resource-specific properties for this resource. + * + * @return the properties value. + */ + ConfigServiceConfigurationRecorderProperties properties(); + + /** + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the region of the resource. + * + * @return the region of the resource. + */ + Region region(); + + /** + * Gets the name of the resource region. + * + * @return the name of the resource region. + */ + String regionName(); + + /** + * Gets the name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + + /** + * Gets the inner com.azure.resourcemanager.awsconnector.fluent.models.ConfigServiceConfigurationRecorderInner + * object. + * + * @return the inner object. + */ + ConfigServiceConfigurationRecorderInner innerModel(); + + /** + * The entirety of the ConfigServiceConfigurationRecorder definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithLocation, + DefinitionStages.WithResourceGroup, DefinitionStages.WithCreate { + } + + /** + * The ConfigServiceConfigurationRecorder definition stages. + */ + interface DefinitionStages { + /** + * The first stage of the ConfigServiceConfigurationRecorder definition. + */ + interface Blank extends WithLocation { + } + + /** + * The stage of the ConfigServiceConfigurationRecorder definition allowing to specify location. + */ + interface WithLocation { + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithResourceGroup withRegion(Region location); + + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithResourceGroup withRegion(String location); + } + + /** + * The stage of the ConfigServiceConfigurationRecorder definition allowing to specify parent resource. + */ + interface WithResourceGroup { + /** + * Specifies resourceGroupName. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @return the next definition stage. + */ + WithCreate withExistingResourceGroup(String resourceGroupName); + } + + /** + * The stage of the ConfigServiceConfigurationRecorder 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.WithProperties { + /** + * Executes the create request. + * + * @return the created resource. + */ + ConfigServiceConfigurationRecorder create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + ConfigServiceConfigurationRecorder create(Context context); + } + + /** + * The stage of the ConfigServiceConfigurationRecorder definition allowing to specify tags. + */ + interface WithTags { + /** + * Specifies the tags property: Resource tags.. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + WithCreate withTags(Map tags); + } + + /** + * The stage of the ConfigServiceConfigurationRecorder definition allowing to specify properties. + */ + interface WithProperties { + /** + * Specifies the properties property: The resource-specific properties for this resource.. + * + * @param properties The resource-specific properties for this resource. + * @return the next definition stage. + */ + WithCreate withProperties(ConfigServiceConfigurationRecorderProperties properties); + } + } + + /** + * Begins update for the ConfigServiceConfigurationRecorder resource. + * + * @return the stage of resource update. + */ + ConfigServiceConfigurationRecorder.Update update(); + + /** + * The template for ConfigServiceConfigurationRecorder update. + */ + interface Update extends UpdateStages.WithTags { + /** + * Executes the update request. + * + * @return the updated resource. + */ + ConfigServiceConfigurationRecorder apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + ConfigServiceConfigurationRecorder apply(Context context); + } + + /** + * The ConfigServiceConfigurationRecorder update stages. + */ + interface UpdateStages { + /** + * The stage of the ConfigServiceConfigurationRecorder update allowing to specify tags. + */ + interface WithTags { + /** + * Specifies the tags property: Resource tags.. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + Update withTags(Map tags); + } + } + + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + ConfigServiceConfigurationRecorder refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + ConfigServiceConfigurationRecorder refresh(Context context); +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ConfigServiceConfigurationRecorderListResult.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ConfigServiceConfigurationRecorderListResult.java new file mode 100644 index 000000000000..c3428dda0620 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ConfigServiceConfigurationRecorderListResult.java @@ -0,0 +1,138 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.awsconnector.fluent.models.ConfigServiceConfigurationRecorderInner; +import java.io.IOException; +import java.util.List; + +/** + * The response of a ConfigServiceConfigurationRecorder list operation. + */ +@Fluent +public final class ConfigServiceConfigurationRecorderListResult + implements JsonSerializable { + /* + * The ConfigServiceConfigurationRecorder items on this page + */ + private List value; + + /* + * The link to the next page of items + */ + private String nextLink; + + /** + * Creates an instance of ConfigServiceConfigurationRecorderListResult class. + */ + public ConfigServiceConfigurationRecorderListResult() { + } + + /** + * Get the value property: The ConfigServiceConfigurationRecorder items on this page. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The ConfigServiceConfigurationRecorder items on this page. + * + * @param value the value value to set. + * @return the ConfigServiceConfigurationRecorderListResult object itself. + */ + public ConfigServiceConfigurationRecorderListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The link to the next page of items. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: The link to the next page of items. + * + * @param nextLink the nextLink value to set. + * @return the ConfigServiceConfigurationRecorderListResult object itself. + */ + public ConfigServiceConfigurationRecorderListResult withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property value in model ConfigServiceConfigurationRecorderListResult")); + } else { + value().forEach(e -> e.validate()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(ConfigServiceConfigurationRecorderListResult.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("nextLink", this.nextLink); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ConfigServiceConfigurationRecorderListResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ConfigServiceConfigurationRecorderListResult if the JsonReader was pointing to an instance + * of it, or null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the ConfigServiceConfigurationRecorderListResult. + */ + public static ConfigServiceConfigurationRecorderListResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ConfigServiceConfigurationRecorderListResult deserializedConfigServiceConfigurationRecorderListResult + = new ConfigServiceConfigurationRecorderListResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> ConfigServiceConfigurationRecorderInner.fromJson(reader1)); + deserializedConfigServiceConfigurationRecorderListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedConfigServiceConfigurationRecorderListResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedConfigServiceConfigurationRecorderListResult; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ConfigServiceConfigurationRecorderProperties.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ConfigServiceConfigurationRecorderProperties.java new file mode 100644 index 000000000000..92d2cb3f49fa --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ConfigServiceConfigurationRecorderProperties.java @@ -0,0 +1,318 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.Map; + +/** + * Definition of ConfigServiceConfigurationRecorder. + */ +@Fluent +public final class ConfigServiceConfigurationRecorderProperties + implements JsonSerializable { + /* + * AWS Properties + */ + private AwsConfigServiceConfigurationRecorderProperties awsProperties; + + /* + * Public Cloud Connectors Resource ID + */ + private String publicCloudConnectorsResourceId; + + /* + * AWS Account ID + */ + private String awsAccountId; + + /* + * Amazon Resource Name (ARN) + */ + private String arn; + + /* + * Public Cloud Resource Name + */ + private String publicCloudResourceName; + + /* + * AWS Source Schema + */ + private String awsSourceSchema; + + /* + * AWS Region + */ + private String awsRegion; + + /* + * AWS Tags + */ + private Map awsTags; + + /* + * The status of the last operation. + */ + private ProvisioningState provisioningState; + + /** + * Creates an instance of ConfigServiceConfigurationRecorderProperties class. + */ + public ConfigServiceConfigurationRecorderProperties() { + } + + /** + * Get the awsProperties property: AWS Properties. + * + * @return the awsProperties value. + */ + public AwsConfigServiceConfigurationRecorderProperties awsProperties() { + return this.awsProperties; + } + + /** + * Set the awsProperties property: AWS Properties. + * + * @param awsProperties the awsProperties value to set. + * @return the ConfigServiceConfigurationRecorderProperties object itself. + */ + public ConfigServiceConfigurationRecorderProperties + withAwsProperties(AwsConfigServiceConfigurationRecorderProperties awsProperties) { + this.awsProperties = awsProperties; + return this; + } + + /** + * Get the publicCloudConnectorsResourceId property: Public Cloud Connectors Resource ID. + * + * @return the publicCloudConnectorsResourceId value. + */ + public String publicCloudConnectorsResourceId() { + return this.publicCloudConnectorsResourceId; + } + + /** + * Set the publicCloudConnectorsResourceId property: Public Cloud Connectors Resource ID. + * + * @param publicCloudConnectorsResourceId the publicCloudConnectorsResourceId value to set. + * @return the ConfigServiceConfigurationRecorderProperties object itself. + */ + public ConfigServiceConfigurationRecorderProperties + withPublicCloudConnectorsResourceId(String publicCloudConnectorsResourceId) { + this.publicCloudConnectorsResourceId = publicCloudConnectorsResourceId; + return this; + } + + /** + * Get the awsAccountId property: AWS Account ID. + * + * @return the awsAccountId value. + */ + public String awsAccountId() { + return this.awsAccountId; + } + + /** + * Set the awsAccountId property: AWS Account ID. + * + * @param awsAccountId the awsAccountId value to set. + * @return the ConfigServiceConfigurationRecorderProperties object itself. + */ + public ConfigServiceConfigurationRecorderProperties withAwsAccountId(String awsAccountId) { + this.awsAccountId = awsAccountId; + return this; + } + + /** + * Get the arn property: Amazon Resource Name (ARN). + * + * @return the arn value. + */ + public String arn() { + return this.arn; + } + + /** + * Set the arn property: Amazon Resource Name (ARN). + * + * @param arn the arn value to set. + * @return the ConfigServiceConfigurationRecorderProperties object itself. + */ + public ConfigServiceConfigurationRecorderProperties withArn(String arn) { + this.arn = arn; + return this; + } + + /** + * Get the publicCloudResourceName property: Public Cloud Resource Name. + * + * @return the publicCloudResourceName value. + */ + public String publicCloudResourceName() { + return this.publicCloudResourceName; + } + + /** + * Set the publicCloudResourceName property: Public Cloud Resource Name. + * + * @param publicCloudResourceName the publicCloudResourceName value to set. + * @return the ConfigServiceConfigurationRecorderProperties object itself. + */ + public ConfigServiceConfigurationRecorderProperties withPublicCloudResourceName(String publicCloudResourceName) { + this.publicCloudResourceName = publicCloudResourceName; + return this; + } + + /** + * Get the awsSourceSchema property: AWS Source Schema. + * + * @return the awsSourceSchema value. + */ + public String awsSourceSchema() { + return this.awsSourceSchema; + } + + /** + * Set the awsSourceSchema property: AWS Source Schema. + * + * @param awsSourceSchema the awsSourceSchema value to set. + * @return the ConfigServiceConfigurationRecorderProperties object itself. + */ + public ConfigServiceConfigurationRecorderProperties withAwsSourceSchema(String awsSourceSchema) { + this.awsSourceSchema = awsSourceSchema; + return this; + } + + /** + * Get the awsRegion property: AWS Region. + * + * @return the awsRegion value. + */ + public String awsRegion() { + return this.awsRegion; + } + + /** + * Set the awsRegion property: AWS Region. + * + * @param awsRegion the awsRegion value to set. + * @return the ConfigServiceConfigurationRecorderProperties object itself. + */ + public ConfigServiceConfigurationRecorderProperties withAwsRegion(String awsRegion) { + this.awsRegion = awsRegion; + return this; + } + + /** + * Get the awsTags property: AWS Tags. + * + * @return the awsTags value. + */ + public Map awsTags() { + return this.awsTags; + } + + /** + * Set the awsTags property: AWS Tags. + * + * @param awsTags the awsTags value to set. + * @return the ConfigServiceConfigurationRecorderProperties object itself. + */ + public ConfigServiceConfigurationRecorderProperties withAwsTags(Map awsTags) { + this.awsTags = awsTags; + return this; + } + + /** + * Get the provisioningState property: The status of the last operation. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (awsProperties() != null) { + awsProperties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("awsProperties", this.awsProperties); + jsonWriter.writeStringField("publicCloudConnectorsResourceId", this.publicCloudConnectorsResourceId); + jsonWriter.writeStringField("awsAccountId", this.awsAccountId); + jsonWriter.writeStringField("arn", this.arn); + jsonWriter.writeStringField("publicCloudResourceName", this.publicCloudResourceName); + jsonWriter.writeStringField("awsSourceSchema", this.awsSourceSchema); + jsonWriter.writeStringField("awsRegion", this.awsRegion); + jsonWriter.writeMapField("awsTags", this.awsTags, (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ConfigServiceConfigurationRecorderProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ConfigServiceConfigurationRecorderProperties if the JsonReader was pointing to an instance + * of it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ConfigServiceConfigurationRecorderProperties. + */ + public static ConfigServiceConfigurationRecorderProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ConfigServiceConfigurationRecorderProperties deserializedConfigServiceConfigurationRecorderProperties + = new ConfigServiceConfigurationRecorderProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("awsProperties".equals(fieldName)) { + deserializedConfigServiceConfigurationRecorderProperties.awsProperties + = AwsConfigServiceConfigurationRecorderProperties.fromJson(reader); + } else if ("publicCloudConnectorsResourceId".equals(fieldName)) { + deserializedConfigServiceConfigurationRecorderProperties.publicCloudConnectorsResourceId + = reader.getString(); + } else if ("awsAccountId".equals(fieldName)) { + deserializedConfigServiceConfigurationRecorderProperties.awsAccountId = reader.getString(); + } else if ("arn".equals(fieldName)) { + deserializedConfigServiceConfigurationRecorderProperties.arn = reader.getString(); + } else if ("publicCloudResourceName".equals(fieldName)) { + deserializedConfigServiceConfigurationRecorderProperties.publicCloudResourceName + = reader.getString(); + } else if ("awsSourceSchema".equals(fieldName)) { + deserializedConfigServiceConfigurationRecorderProperties.awsSourceSchema = reader.getString(); + } else if ("awsRegion".equals(fieldName)) { + deserializedConfigServiceConfigurationRecorderProperties.awsRegion = reader.getString(); + } else if ("awsTags".equals(fieldName)) { + Map awsTags = reader.readMap(reader1 -> reader1.getString()); + deserializedConfigServiceConfigurationRecorderProperties.awsTags = awsTags; + } else if ("provisioningState".equals(fieldName)) { + deserializedConfigServiceConfigurationRecorderProperties.provisioningState + = ProvisioningState.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedConfigServiceConfigurationRecorderProperties; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ConfigServiceConfigurationRecorderStatus.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ConfigServiceConfigurationRecorderStatus.java new file mode 100644 index 000000000000..58f771bbfab8 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ConfigServiceConfigurationRecorderStatus.java @@ -0,0 +1,253 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.awsconnector.fluent.models.ConfigServiceConfigurationRecorderStatusInner; +import java.util.Map; + +/** + * An immutable client-side representation of ConfigServiceConfigurationRecorderStatus. + */ +public interface ConfigServiceConfigurationRecorderStatus { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the location property: The geo-location where the resource lives. + * + * @return the location value. + */ + String location(); + + /** + * Gets the tags property: Resource tags. + * + * @return the tags value. + */ + Map tags(); + + /** + * Gets the properties property: The resource-specific properties for this resource. + * + * @return the properties value. + */ + ConfigServiceConfigurationRecorderStatusProperties properties(); + + /** + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the region of the resource. + * + * @return the region of the resource. + */ + Region region(); + + /** + * Gets the name of the resource region. + * + * @return the name of the resource region. + */ + String regionName(); + + /** + * Gets the name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + + /** + * Gets the inner com.azure.resourcemanager.awsconnector.fluent.models.ConfigServiceConfigurationRecorderStatusInner + * object. + * + * @return the inner object. + */ + ConfigServiceConfigurationRecorderStatusInner innerModel(); + + /** + * The entirety of the ConfigServiceConfigurationRecorderStatus definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithLocation, + DefinitionStages.WithResourceGroup, DefinitionStages.WithCreate { + } + + /** + * The ConfigServiceConfigurationRecorderStatus definition stages. + */ + interface DefinitionStages { + /** + * The first stage of the ConfigServiceConfigurationRecorderStatus definition. + */ + interface Blank extends WithLocation { + } + + /** + * The stage of the ConfigServiceConfigurationRecorderStatus definition allowing to specify location. + */ + interface WithLocation { + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithResourceGroup withRegion(Region location); + + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithResourceGroup withRegion(String location); + } + + /** + * The stage of the ConfigServiceConfigurationRecorderStatus definition allowing to specify parent resource. + */ + interface WithResourceGroup { + /** + * Specifies resourceGroupName. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @return the next definition stage. + */ + WithCreate withExistingResourceGroup(String resourceGroupName); + } + + /** + * The stage of the ConfigServiceConfigurationRecorderStatus 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.WithProperties { + /** + * Executes the create request. + * + * @return the created resource. + */ + ConfigServiceConfigurationRecorderStatus create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + ConfigServiceConfigurationRecorderStatus create(Context context); + } + + /** + * The stage of the ConfigServiceConfigurationRecorderStatus definition allowing to specify tags. + */ + interface WithTags { + /** + * Specifies the tags property: Resource tags.. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + WithCreate withTags(Map tags); + } + + /** + * The stage of the ConfigServiceConfigurationRecorderStatus definition allowing to specify properties. + */ + interface WithProperties { + /** + * Specifies the properties property: The resource-specific properties for this resource.. + * + * @param properties The resource-specific properties for this resource. + * @return the next definition stage. + */ + WithCreate withProperties(ConfigServiceConfigurationRecorderStatusProperties properties); + } + } + + /** + * Begins update for the ConfigServiceConfigurationRecorderStatus resource. + * + * @return the stage of resource update. + */ + ConfigServiceConfigurationRecorderStatus.Update update(); + + /** + * The template for ConfigServiceConfigurationRecorderStatus update. + */ + interface Update extends UpdateStages.WithTags { + /** + * Executes the update request. + * + * @return the updated resource. + */ + ConfigServiceConfigurationRecorderStatus apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + ConfigServiceConfigurationRecorderStatus apply(Context context); + } + + /** + * The ConfigServiceConfigurationRecorderStatus update stages. + */ + interface UpdateStages { + /** + * The stage of the ConfigServiceConfigurationRecorderStatus update allowing to specify tags. + */ + interface WithTags { + /** + * Specifies the tags property: Resource tags.. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + Update withTags(Map tags); + } + } + + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + ConfigServiceConfigurationRecorderStatus refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + ConfigServiceConfigurationRecorderStatus refresh(Context context); +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ConfigServiceConfigurationRecorderStatusListResult.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ConfigServiceConfigurationRecorderStatusListResult.java new file mode 100644 index 000000000000..b7e08d0a8799 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ConfigServiceConfigurationRecorderStatusListResult.java @@ -0,0 +1,141 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.awsconnector.fluent.models.ConfigServiceConfigurationRecorderStatusInner; +import java.io.IOException; +import java.util.List; + +/** + * The response of a ConfigServiceConfigurationRecorderStatus list operation. + */ +@Fluent +public final class ConfigServiceConfigurationRecorderStatusListResult + implements JsonSerializable { + /* + * The ConfigServiceConfigurationRecorderStatus items on this page + */ + private List value; + + /* + * The link to the next page of items + */ + private String nextLink; + + /** + * Creates an instance of ConfigServiceConfigurationRecorderStatusListResult class. + */ + public ConfigServiceConfigurationRecorderStatusListResult() { + } + + /** + * Get the value property: The ConfigServiceConfigurationRecorderStatus items on this page. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The ConfigServiceConfigurationRecorderStatus items on this page. + * + * @param value the value value to set. + * @return the ConfigServiceConfigurationRecorderStatusListResult object itself. + */ + public ConfigServiceConfigurationRecorderStatusListResult + withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The link to the next page of items. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: The link to the next page of items. + * + * @param nextLink the nextLink value to set. + * @return the ConfigServiceConfigurationRecorderStatusListResult object itself. + */ + public ConfigServiceConfigurationRecorderStatusListResult withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property value in model ConfigServiceConfigurationRecorderStatusListResult")); + } else { + value().forEach(e -> e.validate()); + } + } + + private static final ClientLogger LOGGER + = new ClientLogger(ConfigServiceConfigurationRecorderStatusListResult.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("nextLink", this.nextLink); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ConfigServiceConfigurationRecorderStatusListResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ConfigServiceConfigurationRecorderStatusListResult if the JsonReader was pointing to an + * instance of it, or null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the ConfigServiceConfigurationRecorderStatusListResult. + */ + public static ConfigServiceConfigurationRecorderStatusListResult fromJson(JsonReader jsonReader) + throws IOException { + return jsonReader.readObject(reader -> { + ConfigServiceConfigurationRecorderStatusListResult deserializedConfigServiceConfigurationRecorderStatusListResult + = new ConfigServiceConfigurationRecorderStatusListResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> ConfigServiceConfigurationRecorderStatusInner.fromJson(reader1)); + deserializedConfigServiceConfigurationRecorderStatusListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedConfigServiceConfigurationRecorderStatusListResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedConfigServiceConfigurationRecorderStatusListResult; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ConfigServiceConfigurationRecorderStatusProperties.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ConfigServiceConfigurationRecorderStatusProperties.java new file mode 100644 index 000000000000..a06df9f86f3a --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ConfigServiceConfigurationRecorderStatusProperties.java @@ -0,0 +1,320 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.Map; + +/** + * Definition of ConfigServiceConfigurationRecorderStatus. + */ +@Fluent +public final class ConfigServiceConfigurationRecorderStatusProperties + implements JsonSerializable { + /* + * AWS Properties + */ + private AwsConfigServiceConfigurationRecorderStatusProperties awsProperties; + + /* + * Public Cloud Connectors Resource ID + */ + private String publicCloudConnectorsResourceId; + + /* + * AWS Account ID + */ + private String awsAccountId; + + /* + * Amazon Resource Name (ARN) + */ + private String arn; + + /* + * Public Cloud Resource Name + */ + private String publicCloudResourceName; + + /* + * AWS Source Schema + */ + private String awsSourceSchema; + + /* + * AWS Region + */ + private String awsRegion; + + /* + * AWS Tags + */ + private Map awsTags; + + /* + * The status of the last operation. + */ + private ProvisioningState provisioningState; + + /** + * Creates an instance of ConfigServiceConfigurationRecorderStatusProperties class. + */ + public ConfigServiceConfigurationRecorderStatusProperties() { + } + + /** + * Get the awsProperties property: AWS Properties. + * + * @return the awsProperties value. + */ + public AwsConfigServiceConfigurationRecorderStatusProperties awsProperties() { + return this.awsProperties; + } + + /** + * Set the awsProperties property: AWS Properties. + * + * @param awsProperties the awsProperties value to set. + * @return the ConfigServiceConfigurationRecorderStatusProperties object itself. + */ + public ConfigServiceConfigurationRecorderStatusProperties + withAwsProperties(AwsConfigServiceConfigurationRecorderStatusProperties awsProperties) { + this.awsProperties = awsProperties; + return this; + } + + /** + * Get the publicCloudConnectorsResourceId property: Public Cloud Connectors Resource ID. + * + * @return the publicCloudConnectorsResourceId value. + */ + public String publicCloudConnectorsResourceId() { + return this.publicCloudConnectorsResourceId; + } + + /** + * Set the publicCloudConnectorsResourceId property: Public Cloud Connectors Resource ID. + * + * @param publicCloudConnectorsResourceId the publicCloudConnectorsResourceId value to set. + * @return the ConfigServiceConfigurationRecorderStatusProperties object itself. + */ + public ConfigServiceConfigurationRecorderStatusProperties + withPublicCloudConnectorsResourceId(String publicCloudConnectorsResourceId) { + this.publicCloudConnectorsResourceId = publicCloudConnectorsResourceId; + return this; + } + + /** + * Get the awsAccountId property: AWS Account ID. + * + * @return the awsAccountId value. + */ + public String awsAccountId() { + return this.awsAccountId; + } + + /** + * Set the awsAccountId property: AWS Account ID. + * + * @param awsAccountId the awsAccountId value to set. + * @return the ConfigServiceConfigurationRecorderStatusProperties object itself. + */ + public ConfigServiceConfigurationRecorderStatusProperties withAwsAccountId(String awsAccountId) { + this.awsAccountId = awsAccountId; + return this; + } + + /** + * Get the arn property: Amazon Resource Name (ARN). + * + * @return the arn value. + */ + public String arn() { + return this.arn; + } + + /** + * Set the arn property: Amazon Resource Name (ARN). + * + * @param arn the arn value to set. + * @return the ConfigServiceConfigurationRecorderStatusProperties object itself. + */ + public ConfigServiceConfigurationRecorderStatusProperties withArn(String arn) { + this.arn = arn; + return this; + } + + /** + * Get the publicCloudResourceName property: Public Cloud Resource Name. + * + * @return the publicCloudResourceName value. + */ + public String publicCloudResourceName() { + return this.publicCloudResourceName; + } + + /** + * Set the publicCloudResourceName property: Public Cloud Resource Name. + * + * @param publicCloudResourceName the publicCloudResourceName value to set. + * @return the ConfigServiceConfigurationRecorderStatusProperties object itself. + */ + public ConfigServiceConfigurationRecorderStatusProperties + withPublicCloudResourceName(String publicCloudResourceName) { + this.publicCloudResourceName = publicCloudResourceName; + return this; + } + + /** + * Get the awsSourceSchema property: AWS Source Schema. + * + * @return the awsSourceSchema value. + */ + public String awsSourceSchema() { + return this.awsSourceSchema; + } + + /** + * Set the awsSourceSchema property: AWS Source Schema. + * + * @param awsSourceSchema the awsSourceSchema value to set. + * @return the ConfigServiceConfigurationRecorderStatusProperties object itself. + */ + public ConfigServiceConfigurationRecorderStatusProperties withAwsSourceSchema(String awsSourceSchema) { + this.awsSourceSchema = awsSourceSchema; + return this; + } + + /** + * Get the awsRegion property: AWS Region. + * + * @return the awsRegion value. + */ + public String awsRegion() { + return this.awsRegion; + } + + /** + * Set the awsRegion property: AWS Region. + * + * @param awsRegion the awsRegion value to set. + * @return the ConfigServiceConfigurationRecorderStatusProperties object itself. + */ + public ConfigServiceConfigurationRecorderStatusProperties withAwsRegion(String awsRegion) { + this.awsRegion = awsRegion; + return this; + } + + /** + * Get the awsTags property: AWS Tags. + * + * @return the awsTags value. + */ + public Map awsTags() { + return this.awsTags; + } + + /** + * Set the awsTags property: AWS Tags. + * + * @param awsTags the awsTags value to set. + * @return the ConfigServiceConfigurationRecorderStatusProperties object itself. + */ + public ConfigServiceConfigurationRecorderStatusProperties withAwsTags(Map awsTags) { + this.awsTags = awsTags; + return this; + } + + /** + * Get the provisioningState property: The status of the last operation. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (awsProperties() != null) { + awsProperties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("awsProperties", this.awsProperties); + jsonWriter.writeStringField("publicCloudConnectorsResourceId", this.publicCloudConnectorsResourceId); + jsonWriter.writeStringField("awsAccountId", this.awsAccountId); + jsonWriter.writeStringField("arn", this.arn); + jsonWriter.writeStringField("publicCloudResourceName", this.publicCloudResourceName); + jsonWriter.writeStringField("awsSourceSchema", this.awsSourceSchema); + jsonWriter.writeStringField("awsRegion", this.awsRegion); + jsonWriter.writeMapField("awsTags", this.awsTags, (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ConfigServiceConfigurationRecorderStatusProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ConfigServiceConfigurationRecorderStatusProperties if the JsonReader was pointing to an + * instance of it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ConfigServiceConfigurationRecorderStatusProperties. + */ + public static ConfigServiceConfigurationRecorderStatusProperties fromJson(JsonReader jsonReader) + throws IOException { + return jsonReader.readObject(reader -> { + ConfigServiceConfigurationRecorderStatusProperties deserializedConfigServiceConfigurationRecorderStatusProperties + = new ConfigServiceConfigurationRecorderStatusProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("awsProperties".equals(fieldName)) { + deserializedConfigServiceConfigurationRecorderStatusProperties.awsProperties + = AwsConfigServiceConfigurationRecorderStatusProperties.fromJson(reader); + } else if ("publicCloudConnectorsResourceId".equals(fieldName)) { + deserializedConfigServiceConfigurationRecorderStatusProperties.publicCloudConnectorsResourceId + = reader.getString(); + } else if ("awsAccountId".equals(fieldName)) { + deserializedConfigServiceConfigurationRecorderStatusProperties.awsAccountId = reader.getString(); + } else if ("arn".equals(fieldName)) { + deserializedConfigServiceConfigurationRecorderStatusProperties.arn = reader.getString(); + } else if ("publicCloudResourceName".equals(fieldName)) { + deserializedConfigServiceConfigurationRecorderStatusProperties.publicCloudResourceName + = reader.getString(); + } else if ("awsSourceSchema".equals(fieldName)) { + deserializedConfigServiceConfigurationRecorderStatusProperties.awsSourceSchema = reader.getString(); + } else if ("awsRegion".equals(fieldName)) { + deserializedConfigServiceConfigurationRecorderStatusProperties.awsRegion = reader.getString(); + } else if ("awsTags".equals(fieldName)) { + Map awsTags = reader.readMap(reader1 -> reader1.getString()); + deserializedConfigServiceConfigurationRecorderStatusProperties.awsTags = awsTags; + } else if ("provisioningState".equals(fieldName)) { + deserializedConfigServiceConfigurationRecorderStatusProperties.provisioningState + = ProvisioningState.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedConfigServiceConfigurationRecorderStatusProperties; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ConfigServiceConfigurationRecorderStatusTagsUpdate.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ConfigServiceConfigurationRecorderStatusTagsUpdate.java new file mode 100644 index 000000000000..709758ad0f96 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ConfigServiceConfigurationRecorderStatusTagsUpdate.java @@ -0,0 +1,98 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.Map; + +/** + * The type used for updating tags in ConfigServiceConfigurationRecorderStatus resources. + */ +@Fluent +public final class ConfigServiceConfigurationRecorderStatusTagsUpdate + implements JsonSerializable { + /* + * Resource tags. + */ + private Map tags; + + /** + * Creates an instance of ConfigServiceConfigurationRecorderStatusTagsUpdate class. + */ + public ConfigServiceConfigurationRecorderStatusTagsUpdate() { + } + + /** + * Get the tags property: Resource tags. + * + * @return the tags value. + */ + public Map tags() { + return this.tags; + } + + /** + * Set the tags property: Resource tags. + * + * @param tags the tags value to set. + * @return the ConfigServiceConfigurationRecorderStatusTagsUpdate object itself. + */ + public ConfigServiceConfigurationRecorderStatusTagsUpdate withTags(Map tags) { + this.tags = tags; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeMapField("tags", this.tags, (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ConfigServiceConfigurationRecorderStatusTagsUpdate from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ConfigServiceConfigurationRecorderStatusTagsUpdate if the JsonReader was pointing to an + * instance of it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ConfigServiceConfigurationRecorderStatusTagsUpdate. + */ + public static ConfigServiceConfigurationRecorderStatusTagsUpdate fromJson(JsonReader jsonReader) + throws IOException { + return jsonReader.readObject(reader -> { + ConfigServiceConfigurationRecorderStatusTagsUpdate deserializedConfigServiceConfigurationRecorderStatusTagsUpdate + = new ConfigServiceConfigurationRecorderStatusTagsUpdate(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedConfigServiceConfigurationRecorderStatusTagsUpdate.tags = tags; + } else { + reader.skipChildren(); + } + } + + return deserializedConfigServiceConfigurationRecorderStatusTagsUpdate; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ConfigServiceConfigurationRecorderStatuses.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ConfigServiceConfigurationRecorderStatuses.java new file mode 100644 index 000000000000..d9abd3008f8d --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ConfigServiceConfigurationRecorderStatuses.java @@ -0,0 +1,163 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** + * Resource collection API of ConfigServiceConfigurationRecorderStatuses. + */ +public interface ConfigServiceConfigurationRecorderStatuses { + /** + * List ConfigServiceConfigurationRecorderStatus resources by subscription ID. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a ConfigServiceConfigurationRecorderStatus list operation as paginated response with + * {@link PagedIterable}. + */ + PagedIterable list(); + + /** + * List ConfigServiceConfigurationRecorderStatus resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a ConfigServiceConfigurationRecorderStatus list operation as paginated response with + * {@link PagedIterable}. + */ + PagedIterable list(Context context); + + /** + * List ConfigServiceConfigurationRecorderStatus resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a ConfigServiceConfigurationRecorderStatus list operation as paginated response with + * {@link PagedIterable}. + */ + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * List ConfigServiceConfigurationRecorderStatus resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a ConfigServiceConfigurationRecorderStatus list operation as paginated response with + * {@link PagedIterable}. + */ + PagedIterable listByResourceGroup(String resourceGroupName, + Context context); + + /** + * Get a ConfigServiceConfigurationRecorderStatus. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ConfigServiceConfigurationRecorderStatus. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a ConfigServiceConfigurationRecorderStatus along with {@link Response}. + */ + Response getByResourceGroupWithResponse(String resourceGroupName, + String name, Context context); + + /** + * Get a ConfigServiceConfigurationRecorderStatus. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ConfigServiceConfigurationRecorderStatus. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a ConfigServiceConfigurationRecorderStatus. + */ + ConfigServiceConfigurationRecorderStatus getByResourceGroup(String resourceGroupName, String name); + + /** + * Delete a ConfigServiceConfigurationRecorderStatus. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ConfigServiceConfigurationRecorderStatus. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByResourceGroup(String resourceGroupName, String name); + + /** + * Delete a ConfigServiceConfigurationRecorderStatus. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ConfigServiceConfigurationRecorderStatus. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String name, Context context); + + /** + * Get a ConfigServiceConfigurationRecorderStatus. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a ConfigServiceConfigurationRecorderStatus along with {@link Response}. + */ + ConfigServiceConfigurationRecorderStatus getById(String id); + + /** + * Get a ConfigServiceConfigurationRecorderStatus. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a ConfigServiceConfigurationRecorderStatus along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Delete a ConfigServiceConfigurationRecorderStatus. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteById(String id); + + /** + * Delete a ConfigServiceConfigurationRecorderStatus. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new ConfigServiceConfigurationRecorderStatus resource. + * + * @param name resource name. + * @return the first stage of the new ConfigServiceConfigurationRecorderStatus definition. + */ + ConfigServiceConfigurationRecorderStatus.DefinitionStages.Blank define(String name); +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ConfigServiceConfigurationRecorderTagsUpdate.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ConfigServiceConfigurationRecorderTagsUpdate.java new file mode 100644 index 000000000000..d53033510d82 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ConfigServiceConfigurationRecorderTagsUpdate.java @@ -0,0 +1,97 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.Map; + +/** + * The type used for updating tags in ConfigServiceConfigurationRecorder resources. + */ +@Fluent +public final class ConfigServiceConfigurationRecorderTagsUpdate + implements JsonSerializable { + /* + * Resource tags. + */ + private Map tags; + + /** + * Creates an instance of ConfigServiceConfigurationRecorderTagsUpdate class. + */ + public ConfigServiceConfigurationRecorderTagsUpdate() { + } + + /** + * Get the tags property: Resource tags. + * + * @return the tags value. + */ + public Map tags() { + return this.tags; + } + + /** + * Set the tags property: Resource tags. + * + * @param tags the tags value to set. + * @return the ConfigServiceConfigurationRecorderTagsUpdate object itself. + */ + public ConfigServiceConfigurationRecorderTagsUpdate withTags(Map tags) { + this.tags = tags; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeMapField("tags", this.tags, (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ConfigServiceConfigurationRecorderTagsUpdate from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ConfigServiceConfigurationRecorderTagsUpdate if the JsonReader was pointing to an instance + * of it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ConfigServiceConfigurationRecorderTagsUpdate. + */ + public static ConfigServiceConfigurationRecorderTagsUpdate fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ConfigServiceConfigurationRecorderTagsUpdate deserializedConfigServiceConfigurationRecorderTagsUpdate + = new ConfigServiceConfigurationRecorderTagsUpdate(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedConfigServiceConfigurationRecorderTagsUpdate.tags = tags; + } else { + reader.skipChildren(); + } + } + + return deserializedConfigServiceConfigurationRecorderTagsUpdate; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ConfigServiceConfigurationRecorders.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ConfigServiceConfigurationRecorders.java new file mode 100644 index 000000000000..14366694fe72 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ConfigServiceConfigurationRecorders.java @@ -0,0 +1,162 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** + * Resource collection API of ConfigServiceConfigurationRecorders. + */ +public interface ConfigServiceConfigurationRecorders { + /** + * List ConfigServiceConfigurationRecorder resources by subscription ID. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a ConfigServiceConfigurationRecorder list operation as paginated response with + * {@link PagedIterable}. + */ + PagedIterable list(); + + /** + * List ConfigServiceConfigurationRecorder resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a ConfigServiceConfigurationRecorder list operation as paginated response with + * {@link PagedIterable}. + */ + PagedIterable list(Context context); + + /** + * List ConfigServiceConfigurationRecorder resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a ConfigServiceConfigurationRecorder list operation as paginated response with + * {@link PagedIterable}. + */ + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * List ConfigServiceConfigurationRecorder resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a ConfigServiceConfigurationRecorder list operation as paginated response with + * {@link PagedIterable}. + */ + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Get a ConfigServiceConfigurationRecorder. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ConfigServiceConfigurationRecorder. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a ConfigServiceConfigurationRecorder along with {@link Response}. + */ + Response getByResourceGroupWithResponse(String resourceGroupName, String name, + Context context); + + /** + * Get a ConfigServiceConfigurationRecorder. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ConfigServiceConfigurationRecorder. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a ConfigServiceConfigurationRecorder. + */ + ConfigServiceConfigurationRecorder getByResourceGroup(String resourceGroupName, String name); + + /** + * Delete a ConfigServiceConfigurationRecorder. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ConfigServiceConfigurationRecorder. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByResourceGroup(String resourceGroupName, String name); + + /** + * Delete a ConfigServiceConfigurationRecorder. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ConfigServiceConfigurationRecorder. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String name, Context context); + + /** + * Get a ConfigServiceConfigurationRecorder. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a ConfigServiceConfigurationRecorder along with {@link Response}. + */ + ConfigServiceConfigurationRecorder getById(String id); + + /** + * Get a ConfigServiceConfigurationRecorder. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a ConfigServiceConfigurationRecorder along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Delete a ConfigServiceConfigurationRecorder. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteById(String id); + + /** + * Delete a ConfigServiceConfigurationRecorder. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new ConfigServiceConfigurationRecorder resource. + * + * @param name resource name. + * @return the first stage of the new ConfigServiceConfigurationRecorder definition. + */ + ConfigServiceConfigurationRecorder.DefinitionStages.Blank define(String name); +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ConfigServiceDeliveryChannel.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ConfigServiceDeliveryChannel.java new file mode 100644 index 000000000000..e4dc08d34402 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ConfigServiceDeliveryChannel.java @@ -0,0 +1,252 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.awsconnector.fluent.models.ConfigServiceDeliveryChannelInner; +import java.util.Map; + +/** + * An immutable client-side representation of ConfigServiceDeliveryChannel. + */ +public interface ConfigServiceDeliveryChannel { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the location property: The geo-location where the resource lives. + * + * @return the location value. + */ + String location(); + + /** + * Gets the tags property: Resource tags. + * + * @return the tags value. + */ + Map tags(); + + /** + * Gets the properties property: The resource-specific properties for this resource. + * + * @return the properties value. + */ + ConfigServiceDeliveryChannelProperties properties(); + + /** + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the region of the resource. + * + * @return the region of the resource. + */ + Region region(); + + /** + * Gets the name of the resource region. + * + * @return the name of the resource region. + */ + String regionName(); + + /** + * Gets the name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + + /** + * Gets the inner com.azure.resourcemanager.awsconnector.fluent.models.ConfigServiceDeliveryChannelInner object. + * + * @return the inner object. + */ + ConfigServiceDeliveryChannelInner innerModel(); + + /** + * The entirety of the ConfigServiceDeliveryChannel definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithLocation, + DefinitionStages.WithResourceGroup, DefinitionStages.WithCreate { + } + + /** + * The ConfigServiceDeliveryChannel definition stages. + */ + interface DefinitionStages { + /** + * The first stage of the ConfigServiceDeliveryChannel definition. + */ + interface Blank extends WithLocation { + } + + /** + * The stage of the ConfigServiceDeliveryChannel definition allowing to specify location. + */ + interface WithLocation { + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithResourceGroup withRegion(Region location); + + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithResourceGroup withRegion(String location); + } + + /** + * The stage of the ConfigServiceDeliveryChannel definition allowing to specify parent resource. + */ + interface WithResourceGroup { + /** + * Specifies resourceGroupName. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @return the next definition stage. + */ + WithCreate withExistingResourceGroup(String resourceGroupName); + } + + /** + * The stage of the ConfigServiceDeliveryChannel 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.WithProperties { + /** + * Executes the create request. + * + * @return the created resource. + */ + ConfigServiceDeliveryChannel create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + ConfigServiceDeliveryChannel create(Context context); + } + + /** + * The stage of the ConfigServiceDeliveryChannel definition allowing to specify tags. + */ + interface WithTags { + /** + * Specifies the tags property: Resource tags.. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + WithCreate withTags(Map tags); + } + + /** + * The stage of the ConfigServiceDeliveryChannel definition allowing to specify properties. + */ + interface WithProperties { + /** + * Specifies the properties property: The resource-specific properties for this resource.. + * + * @param properties The resource-specific properties for this resource. + * @return the next definition stage. + */ + WithCreate withProperties(ConfigServiceDeliveryChannelProperties properties); + } + } + + /** + * Begins update for the ConfigServiceDeliveryChannel resource. + * + * @return the stage of resource update. + */ + ConfigServiceDeliveryChannel.Update update(); + + /** + * The template for ConfigServiceDeliveryChannel update. + */ + interface Update extends UpdateStages.WithTags { + /** + * Executes the update request. + * + * @return the updated resource. + */ + ConfigServiceDeliveryChannel apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + ConfigServiceDeliveryChannel apply(Context context); + } + + /** + * The ConfigServiceDeliveryChannel update stages. + */ + interface UpdateStages { + /** + * The stage of the ConfigServiceDeliveryChannel update allowing to specify tags. + */ + interface WithTags { + /** + * Specifies the tags property: Resource tags.. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + Update withTags(Map tags); + } + } + + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + ConfigServiceDeliveryChannel refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + ConfigServiceDeliveryChannel refresh(Context context); +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ConfigServiceDeliveryChannelListResult.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ConfigServiceDeliveryChannelListResult.java new file mode 100644 index 000000000000..bd15657064e0 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ConfigServiceDeliveryChannelListResult.java @@ -0,0 +1,138 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.awsconnector.fluent.models.ConfigServiceDeliveryChannelInner; +import java.io.IOException; +import java.util.List; + +/** + * The response of a ConfigServiceDeliveryChannel list operation. + */ +@Fluent +public final class ConfigServiceDeliveryChannelListResult + implements JsonSerializable { + /* + * The ConfigServiceDeliveryChannel items on this page + */ + private List value; + + /* + * The link to the next page of items + */ + private String nextLink; + + /** + * Creates an instance of ConfigServiceDeliveryChannelListResult class. + */ + public ConfigServiceDeliveryChannelListResult() { + } + + /** + * Get the value property: The ConfigServiceDeliveryChannel items on this page. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The ConfigServiceDeliveryChannel items on this page. + * + * @param value the value value to set. + * @return the ConfigServiceDeliveryChannelListResult object itself. + */ + public ConfigServiceDeliveryChannelListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The link to the next page of items. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: The link to the next page of items. + * + * @param nextLink the nextLink value to set. + * @return the ConfigServiceDeliveryChannelListResult object itself. + */ + public ConfigServiceDeliveryChannelListResult withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property value in model ConfigServiceDeliveryChannelListResult")); + } else { + value().forEach(e -> e.validate()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(ConfigServiceDeliveryChannelListResult.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("nextLink", this.nextLink); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ConfigServiceDeliveryChannelListResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ConfigServiceDeliveryChannelListResult if the JsonReader was pointing to an instance of + * it, or null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the ConfigServiceDeliveryChannelListResult. + */ + public static ConfigServiceDeliveryChannelListResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ConfigServiceDeliveryChannelListResult deserializedConfigServiceDeliveryChannelListResult + = new ConfigServiceDeliveryChannelListResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> ConfigServiceDeliveryChannelInner.fromJson(reader1)); + deserializedConfigServiceDeliveryChannelListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedConfigServiceDeliveryChannelListResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedConfigServiceDeliveryChannelListResult; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ConfigServiceDeliveryChannelProperties.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ConfigServiceDeliveryChannelProperties.java new file mode 100644 index 000000000000..484839fbabe5 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ConfigServiceDeliveryChannelProperties.java @@ -0,0 +1,317 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.Map; + +/** + * Definition of ConfigServiceDeliveryChannel. + */ +@Fluent +public final class ConfigServiceDeliveryChannelProperties + implements JsonSerializable { + /* + * AWS Properties + */ + private AwsConfigServiceDeliveryChannelProperties awsProperties; + + /* + * Public Cloud Connectors Resource ID + */ + private String publicCloudConnectorsResourceId; + + /* + * AWS Account ID + */ + private String awsAccountId; + + /* + * Amazon Resource Name (ARN) + */ + private String arn; + + /* + * Public Cloud Resource Name + */ + private String publicCloudResourceName; + + /* + * AWS Source Schema + */ + private String awsSourceSchema; + + /* + * AWS Region + */ + private String awsRegion; + + /* + * AWS Tags + */ + private Map awsTags; + + /* + * The status of the last operation. + */ + private ProvisioningState provisioningState; + + /** + * Creates an instance of ConfigServiceDeliveryChannelProperties class. + */ + public ConfigServiceDeliveryChannelProperties() { + } + + /** + * Get the awsProperties property: AWS Properties. + * + * @return the awsProperties value. + */ + public AwsConfigServiceDeliveryChannelProperties awsProperties() { + return this.awsProperties; + } + + /** + * Set the awsProperties property: AWS Properties. + * + * @param awsProperties the awsProperties value to set. + * @return the ConfigServiceDeliveryChannelProperties object itself. + */ + public ConfigServiceDeliveryChannelProperties + withAwsProperties(AwsConfigServiceDeliveryChannelProperties awsProperties) { + this.awsProperties = awsProperties; + return this; + } + + /** + * Get the publicCloudConnectorsResourceId property: Public Cloud Connectors Resource ID. + * + * @return the publicCloudConnectorsResourceId value. + */ + public String publicCloudConnectorsResourceId() { + return this.publicCloudConnectorsResourceId; + } + + /** + * Set the publicCloudConnectorsResourceId property: Public Cloud Connectors Resource ID. + * + * @param publicCloudConnectorsResourceId the publicCloudConnectorsResourceId value to set. + * @return the ConfigServiceDeliveryChannelProperties object itself. + */ + public ConfigServiceDeliveryChannelProperties + withPublicCloudConnectorsResourceId(String publicCloudConnectorsResourceId) { + this.publicCloudConnectorsResourceId = publicCloudConnectorsResourceId; + return this; + } + + /** + * Get the awsAccountId property: AWS Account ID. + * + * @return the awsAccountId value. + */ + public String awsAccountId() { + return this.awsAccountId; + } + + /** + * Set the awsAccountId property: AWS Account ID. + * + * @param awsAccountId the awsAccountId value to set. + * @return the ConfigServiceDeliveryChannelProperties object itself. + */ + public ConfigServiceDeliveryChannelProperties withAwsAccountId(String awsAccountId) { + this.awsAccountId = awsAccountId; + return this; + } + + /** + * Get the arn property: Amazon Resource Name (ARN). + * + * @return the arn value. + */ + public String arn() { + return this.arn; + } + + /** + * Set the arn property: Amazon Resource Name (ARN). + * + * @param arn the arn value to set. + * @return the ConfigServiceDeliveryChannelProperties object itself. + */ + public ConfigServiceDeliveryChannelProperties withArn(String arn) { + this.arn = arn; + return this; + } + + /** + * Get the publicCloudResourceName property: Public Cloud Resource Name. + * + * @return the publicCloudResourceName value. + */ + public String publicCloudResourceName() { + return this.publicCloudResourceName; + } + + /** + * Set the publicCloudResourceName property: Public Cloud Resource Name. + * + * @param publicCloudResourceName the publicCloudResourceName value to set. + * @return the ConfigServiceDeliveryChannelProperties object itself. + */ + public ConfigServiceDeliveryChannelProperties withPublicCloudResourceName(String publicCloudResourceName) { + this.publicCloudResourceName = publicCloudResourceName; + return this; + } + + /** + * Get the awsSourceSchema property: AWS Source Schema. + * + * @return the awsSourceSchema value. + */ + public String awsSourceSchema() { + return this.awsSourceSchema; + } + + /** + * Set the awsSourceSchema property: AWS Source Schema. + * + * @param awsSourceSchema the awsSourceSchema value to set. + * @return the ConfigServiceDeliveryChannelProperties object itself. + */ + public ConfigServiceDeliveryChannelProperties withAwsSourceSchema(String awsSourceSchema) { + this.awsSourceSchema = awsSourceSchema; + return this; + } + + /** + * Get the awsRegion property: AWS Region. + * + * @return the awsRegion value. + */ + public String awsRegion() { + return this.awsRegion; + } + + /** + * Set the awsRegion property: AWS Region. + * + * @param awsRegion the awsRegion value to set. + * @return the ConfigServiceDeliveryChannelProperties object itself. + */ + public ConfigServiceDeliveryChannelProperties withAwsRegion(String awsRegion) { + this.awsRegion = awsRegion; + return this; + } + + /** + * Get the awsTags property: AWS Tags. + * + * @return the awsTags value. + */ + public Map awsTags() { + return this.awsTags; + } + + /** + * Set the awsTags property: AWS Tags. + * + * @param awsTags the awsTags value to set. + * @return the ConfigServiceDeliveryChannelProperties object itself. + */ + public ConfigServiceDeliveryChannelProperties withAwsTags(Map awsTags) { + this.awsTags = awsTags; + return this; + } + + /** + * Get the provisioningState property: The status of the last operation. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (awsProperties() != null) { + awsProperties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("awsProperties", this.awsProperties); + jsonWriter.writeStringField("publicCloudConnectorsResourceId", this.publicCloudConnectorsResourceId); + jsonWriter.writeStringField("awsAccountId", this.awsAccountId); + jsonWriter.writeStringField("arn", this.arn); + jsonWriter.writeStringField("publicCloudResourceName", this.publicCloudResourceName); + jsonWriter.writeStringField("awsSourceSchema", this.awsSourceSchema); + jsonWriter.writeStringField("awsRegion", this.awsRegion); + jsonWriter.writeMapField("awsTags", this.awsTags, (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ConfigServiceDeliveryChannelProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ConfigServiceDeliveryChannelProperties if the JsonReader was pointing to an instance of + * it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ConfigServiceDeliveryChannelProperties. + */ + public static ConfigServiceDeliveryChannelProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ConfigServiceDeliveryChannelProperties deserializedConfigServiceDeliveryChannelProperties + = new ConfigServiceDeliveryChannelProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("awsProperties".equals(fieldName)) { + deserializedConfigServiceDeliveryChannelProperties.awsProperties + = AwsConfigServiceDeliveryChannelProperties.fromJson(reader); + } else if ("publicCloudConnectorsResourceId".equals(fieldName)) { + deserializedConfigServiceDeliveryChannelProperties.publicCloudConnectorsResourceId + = reader.getString(); + } else if ("awsAccountId".equals(fieldName)) { + deserializedConfigServiceDeliveryChannelProperties.awsAccountId = reader.getString(); + } else if ("arn".equals(fieldName)) { + deserializedConfigServiceDeliveryChannelProperties.arn = reader.getString(); + } else if ("publicCloudResourceName".equals(fieldName)) { + deserializedConfigServiceDeliveryChannelProperties.publicCloudResourceName = reader.getString(); + } else if ("awsSourceSchema".equals(fieldName)) { + deserializedConfigServiceDeliveryChannelProperties.awsSourceSchema = reader.getString(); + } else if ("awsRegion".equals(fieldName)) { + deserializedConfigServiceDeliveryChannelProperties.awsRegion = reader.getString(); + } else if ("awsTags".equals(fieldName)) { + Map awsTags = reader.readMap(reader1 -> reader1.getString()); + deserializedConfigServiceDeliveryChannelProperties.awsTags = awsTags; + } else if ("provisioningState".equals(fieldName)) { + deserializedConfigServiceDeliveryChannelProperties.provisioningState + = ProvisioningState.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedConfigServiceDeliveryChannelProperties; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ConfigServiceDeliveryChannelTagsUpdate.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ConfigServiceDeliveryChannelTagsUpdate.java new file mode 100644 index 000000000000..1386f693da73 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ConfigServiceDeliveryChannelTagsUpdate.java @@ -0,0 +1,97 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.Map; + +/** + * The type used for updating tags in ConfigServiceDeliveryChannel resources. + */ +@Fluent +public final class ConfigServiceDeliveryChannelTagsUpdate + implements JsonSerializable { + /* + * Resource tags. + */ + private Map tags; + + /** + * Creates an instance of ConfigServiceDeliveryChannelTagsUpdate class. + */ + public ConfigServiceDeliveryChannelTagsUpdate() { + } + + /** + * Get the tags property: Resource tags. + * + * @return the tags value. + */ + public Map tags() { + return this.tags; + } + + /** + * Set the tags property: Resource tags. + * + * @param tags the tags value to set. + * @return the ConfigServiceDeliveryChannelTagsUpdate object itself. + */ + public ConfigServiceDeliveryChannelTagsUpdate withTags(Map tags) { + this.tags = tags; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeMapField("tags", this.tags, (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ConfigServiceDeliveryChannelTagsUpdate from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ConfigServiceDeliveryChannelTagsUpdate if the JsonReader was pointing to an instance of + * it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ConfigServiceDeliveryChannelTagsUpdate. + */ + public static ConfigServiceDeliveryChannelTagsUpdate fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ConfigServiceDeliveryChannelTagsUpdate deserializedConfigServiceDeliveryChannelTagsUpdate + = new ConfigServiceDeliveryChannelTagsUpdate(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedConfigServiceDeliveryChannelTagsUpdate.tags = tags; + } else { + reader.skipChildren(); + } + } + + return deserializedConfigServiceDeliveryChannelTagsUpdate; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ConfigServiceDeliveryChannels.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ConfigServiceDeliveryChannels.java new file mode 100644 index 000000000000..4dc8fc6e3d28 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ConfigServiceDeliveryChannels.java @@ -0,0 +1,162 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** + * Resource collection API of ConfigServiceDeliveryChannels. + */ +public interface ConfigServiceDeliveryChannels { + /** + * List ConfigServiceDeliveryChannel resources by subscription ID. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a ConfigServiceDeliveryChannel list operation as paginated response with + * {@link PagedIterable}. + */ + PagedIterable list(); + + /** + * List ConfigServiceDeliveryChannel resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a ConfigServiceDeliveryChannel list operation as paginated response with + * {@link PagedIterable}. + */ + PagedIterable list(Context context); + + /** + * List ConfigServiceDeliveryChannel resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a ConfigServiceDeliveryChannel list operation as paginated response with + * {@link PagedIterable}. + */ + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * List ConfigServiceDeliveryChannel resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a ConfigServiceDeliveryChannel list operation as paginated response with + * {@link PagedIterable}. + */ + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Get a ConfigServiceDeliveryChannel. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ConfigServiceDeliveryChannel. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a ConfigServiceDeliveryChannel along with {@link Response}. + */ + Response getByResourceGroupWithResponse(String resourceGroupName, String name, + Context context); + + /** + * Get a ConfigServiceDeliveryChannel. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ConfigServiceDeliveryChannel. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a ConfigServiceDeliveryChannel. + */ + ConfigServiceDeliveryChannel getByResourceGroup(String resourceGroupName, String name); + + /** + * Delete a ConfigServiceDeliveryChannel. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ConfigServiceDeliveryChannel. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByResourceGroup(String resourceGroupName, String name); + + /** + * Delete a ConfigServiceDeliveryChannel. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ConfigServiceDeliveryChannel. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String name, Context context); + + /** + * Get a ConfigServiceDeliveryChannel. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a ConfigServiceDeliveryChannel along with {@link Response}. + */ + ConfigServiceDeliveryChannel getById(String id); + + /** + * Get a ConfigServiceDeliveryChannel. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a ConfigServiceDeliveryChannel along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Delete a ConfigServiceDeliveryChannel. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteById(String id); + + /** + * Delete a ConfigServiceDeliveryChannel. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new ConfigServiceDeliveryChannel resource. + * + * @param name resource name. + * @return the first stage of the new ConfigServiceDeliveryChannel definition. + */ + ConfigServiceDeliveryChannel.DefinitionStages.Blank define(String name); +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ConfigSnapshotDeliveryProperties.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ConfigSnapshotDeliveryProperties.java new file mode 100644 index 000000000000..de699baca6c0 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ConfigSnapshotDeliveryProperties.java @@ -0,0 +1,101 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of ConfigSnapshotDeliveryProperties. + */ +@Fluent +public final class ConfigSnapshotDeliveryProperties implements JsonSerializable { + /* + *

The frequency with which Config delivers configuration snapshots.

+ */ + private MaximumExecutionFrequencyEnumValue deliveryFrequency; + + /** + * Creates an instance of ConfigSnapshotDeliveryProperties class. + */ + public ConfigSnapshotDeliveryProperties() { + } + + /** + * Get the deliveryFrequency property: <p>The frequency with which Config delivers configuration + * snapshots.</p>. + * + * @return the deliveryFrequency value. + */ + public MaximumExecutionFrequencyEnumValue deliveryFrequency() { + return this.deliveryFrequency; + } + + /** + * Set the deliveryFrequency property: <p>The frequency with which Config delivers configuration + * snapshots.</p>. + * + * @param deliveryFrequency the deliveryFrequency value to set. + * @return the ConfigSnapshotDeliveryProperties object itself. + */ + public ConfigSnapshotDeliveryProperties + withDeliveryFrequency(MaximumExecutionFrequencyEnumValue deliveryFrequency) { + this.deliveryFrequency = deliveryFrequency; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (deliveryFrequency() != null) { + deliveryFrequency().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("deliveryFrequency", this.deliveryFrequency); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ConfigSnapshotDeliveryProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ConfigSnapshotDeliveryProperties if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ConfigSnapshotDeliveryProperties. + */ + public static ConfigSnapshotDeliveryProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ConfigSnapshotDeliveryProperties deserializedConfigSnapshotDeliveryProperties + = new ConfigSnapshotDeliveryProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("deliveryFrequency".equals(fieldName)) { + deserializedConfigSnapshotDeliveryProperties.deliveryFrequency + = MaximumExecutionFrequencyEnumValue.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedConfigSnapshotDeliveryProperties; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/Configuration.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/Configuration.java new file mode 100644 index 000000000000..455a9d1e77bf --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/Configuration.java @@ -0,0 +1,161 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; +import java.util.Map; + +/** + * Definition of Configuration. + */ +@Fluent +public final class Configuration implements JsonSerializable { + /* + *

The classification within a configuration.

+ */ + private String classification; + + /* + *

A list of additional configurations to apply within a configuration object.

+ */ + private List configurations; + + /* + *

A set of properties specified within a configuration classification.

+ */ + private Map properties; + + /** + * Creates an instance of Configuration class. + */ + public Configuration() { + } + + /** + * Get the classification property: <p>The classification within a configuration.</p>. + * + * @return the classification value. + */ + public String classification() { + return this.classification; + } + + /** + * Set the classification property: <p>The classification within a configuration.</p>. + * + * @param classification the classification value to set. + * @return the Configuration object itself. + */ + public Configuration withClassification(String classification) { + this.classification = classification; + return this; + } + + /** + * Get the configurations property: <p>A list of additional configurations to apply within a configuration + * object.</p>. + * + * @return the configurations value. + */ + public List configurations() { + return this.configurations; + } + + /** + * Set the configurations property: <p>A list of additional configurations to apply within a configuration + * object.</p>. + * + * @param configurations the configurations value to set. + * @return the Configuration object itself. + */ + public Configuration withConfigurations(List configurations) { + this.configurations = configurations; + return this; + } + + /** + * Get the properties property: <p>A set of properties specified within a configuration + * classification.</p>. + * + * @return the properties value. + */ + public Map properties() { + return this.properties; + } + + /** + * Set the properties property: <p>A set of properties specified within a configuration + * classification.</p>. + * + * @param properties the properties value to set. + * @return the Configuration object itself. + */ + public Configuration withProperties(Map properties) { + this.properties = properties; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (configurations() != null) { + configurations().forEach(e -> e.validate()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("classification", this.classification); + jsonWriter.writeArrayField("configurations", this.configurations, + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeMapField("properties", this.properties, (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of Configuration from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of Configuration if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the Configuration. + */ + public static Configuration fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + Configuration deserializedConfiguration = new Configuration(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("classification".equals(fieldName)) { + deserializedConfiguration.classification = reader.getString(); + } else if ("configurations".equals(fieldName)) { + List configurations = reader.readArray(reader1 -> Configuration.fromJson(reader1)); + deserializedConfiguration.configurations = configurations; + } else if ("properties".equals(fieldName)) { + Map properties = reader.readMap(reader1 -> reader1.getString()); + deserializedConfiguration.properties = properties; + } else { + reader.skipChildren(); + } + } + + return deserializedConfiguration; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ConfigurationOptionSetting.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ConfigurationOptionSetting.java new file mode 100644 index 000000000000..2c2ae9e3b76b --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ConfigurationOptionSetting.java @@ -0,0 +1,179 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of ConfigurationOptionSetting. + */ +@Fluent +public final class ConfigurationOptionSetting implements JsonSerializable { + /* + * A unique namespace that identifies the option's associated AWS resource. + */ + private String namespace; + + /* + * The name of the configuration option. + */ + private String optionName; + + /* + * A unique resource name for the option setting. Use it for a time–based scaling configuration option. + */ + private String resourceName; + + /* + * The current value for the configuration option. + */ + private String value; + + /** + * Creates an instance of ConfigurationOptionSetting class. + */ + public ConfigurationOptionSetting() { + } + + /** + * Get the namespace property: A unique namespace that identifies the option's associated AWS resource. + * + * @return the namespace value. + */ + public String namespace() { + return this.namespace; + } + + /** + * Set the namespace property: A unique namespace that identifies the option's associated AWS resource. + * + * @param namespace the namespace value to set. + * @return the ConfigurationOptionSetting object itself. + */ + public ConfigurationOptionSetting withNamespace(String namespace) { + this.namespace = namespace; + return this; + } + + /** + * Get the optionName property: The name of the configuration option. + * + * @return the optionName value. + */ + public String optionName() { + return this.optionName; + } + + /** + * Set the optionName property: The name of the configuration option. + * + * @param optionName the optionName value to set. + * @return the ConfigurationOptionSetting object itself. + */ + public ConfigurationOptionSetting withOptionName(String optionName) { + this.optionName = optionName; + return this; + } + + /** + * Get the resourceName property: A unique resource name for the option setting. Use it for a time–based scaling + * configuration option. + * + * @return the resourceName value. + */ + public String resourceName() { + return this.resourceName; + } + + /** + * Set the resourceName property: A unique resource name for the option setting. Use it for a time–based scaling + * configuration option. + * + * @param resourceName the resourceName value to set. + * @return the ConfigurationOptionSetting object itself. + */ + public ConfigurationOptionSetting withResourceName(String resourceName) { + this.resourceName = resourceName; + return this; + } + + /** + * Get the value property: The current value for the configuration option. + * + * @return the value value. + */ + public String value() { + return this.value; + } + + /** + * Set the value property: The current value for the configuration option. + * + * @param value the value value to set. + * @return the ConfigurationOptionSetting object itself. + */ + public ConfigurationOptionSetting withValue(String value) { + this.value = value; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("namespace", this.namespace); + jsonWriter.writeStringField("optionName", this.optionName); + jsonWriter.writeStringField("resourceName", this.resourceName); + jsonWriter.writeStringField("value", this.value); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ConfigurationOptionSetting from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ConfigurationOptionSetting if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ConfigurationOptionSetting. + */ + public static ConfigurationOptionSetting fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ConfigurationOptionSetting deserializedConfigurationOptionSetting = new ConfigurationOptionSetting(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("namespace".equals(fieldName)) { + deserializedConfigurationOptionSetting.namespace = reader.getString(); + } else if ("optionName".equals(fieldName)) { + deserializedConfigurationOptionSetting.optionName = reader.getString(); + } else if ("resourceName".equals(fieldName)) { + deserializedConfigurationOptionSetting.resourceName = reader.getString(); + } else if ("value".equals(fieldName)) { + deserializedConfigurationOptionSetting.value = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedConfigurationOptionSetting; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ConnectionTrackingSpecification.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ConnectionTrackingSpecification.java new file mode 100644 index 000000000000..8626776e7f40 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ConnectionTrackingSpecification.java @@ -0,0 +1,152 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of ConnectionTrackingSpecification. + */ +@Fluent +public final class ConnectionTrackingSpecification implements JsonSerializable { + /* + * Property tcpEstablishedTimeout + */ + private Integer tcpEstablishedTimeout; + + /* + * Property udpStreamTimeout + */ + private Integer udpStreamTimeout; + + /* + * Property udpTimeout + */ + private Integer udpTimeout; + + /** + * Creates an instance of ConnectionTrackingSpecification class. + */ + public ConnectionTrackingSpecification() { + } + + /** + * Get the tcpEstablishedTimeout property: Property tcpEstablishedTimeout. + * + * @return the tcpEstablishedTimeout value. + */ + public Integer tcpEstablishedTimeout() { + return this.tcpEstablishedTimeout; + } + + /** + * Set the tcpEstablishedTimeout property: Property tcpEstablishedTimeout. + * + * @param tcpEstablishedTimeout the tcpEstablishedTimeout value to set. + * @return the ConnectionTrackingSpecification object itself. + */ + public ConnectionTrackingSpecification withTcpEstablishedTimeout(Integer tcpEstablishedTimeout) { + this.tcpEstablishedTimeout = tcpEstablishedTimeout; + return this; + } + + /** + * Get the udpStreamTimeout property: Property udpStreamTimeout. + * + * @return the udpStreamTimeout value. + */ + public Integer udpStreamTimeout() { + return this.udpStreamTimeout; + } + + /** + * Set the udpStreamTimeout property: Property udpStreamTimeout. + * + * @param udpStreamTimeout the udpStreamTimeout value to set. + * @return the ConnectionTrackingSpecification object itself. + */ + public ConnectionTrackingSpecification withUdpStreamTimeout(Integer udpStreamTimeout) { + this.udpStreamTimeout = udpStreamTimeout; + return this; + } + + /** + * Get the udpTimeout property: Property udpTimeout. + * + * @return the udpTimeout value. + */ + public Integer udpTimeout() { + return this.udpTimeout; + } + + /** + * Set the udpTimeout property: Property udpTimeout. + * + * @param udpTimeout the udpTimeout value to set. + * @return the ConnectionTrackingSpecification object itself. + */ + public ConnectionTrackingSpecification withUdpTimeout(Integer udpTimeout) { + this.udpTimeout = udpTimeout; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeNumberField("tcpEstablishedTimeout", this.tcpEstablishedTimeout); + jsonWriter.writeNumberField("udpStreamTimeout", this.udpStreamTimeout); + jsonWriter.writeNumberField("udpTimeout", this.udpTimeout); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ConnectionTrackingSpecification from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ConnectionTrackingSpecification if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ConnectionTrackingSpecification. + */ + public static ConnectionTrackingSpecification fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ConnectionTrackingSpecification deserializedConnectionTrackingSpecification + = new ConnectionTrackingSpecification(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("tcpEstablishedTimeout".equals(fieldName)) { + deserializedConnectionTrackingSpecification.tcpEstablishedTimeout + = reader.getNullable(JsonReader::getInt); + } else if ("udpStreamTimeout".equals(fieldName)) { + deserializedConnectionTrackingSpecification.udpStreamTimeout + = reader.getNullable(JsonReader::getInt); + } else if ("udpTimeout".equals(fieldName)) { + deserializedConnectionTrackingSpecification.udpTimeout = reader.getNullable(JsonReader::getInt); + } else { + reader.skipChildren(); + } + } + + return deserializedConnectionTrackingSpecification; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ConnectionTrackingSpecificationResponse.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ConnectionTrackingSpecificationResponse.java new file mode 100644 index 000000000000..a4cd3a985e53 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ConnectionTrackingSpecificationResponse.java @@ -0,0 +1,169 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of ConnectionTrackingSpecificationResponse. + */ +@Fluent +public final class ConnectionTrackingSpecificationResponse + implements JsonSerializable { + /* + *

Timeout (in seconds) for idle TCP connections in an established state. Min: 60 seconds. Max: 432000 seconds (5 + * days). Default: 432000 seconds. Recommended: Less than 432000 seconds.

+ */ + private Integer tcpEstablishedTimeout; + + /* + *

Timeout (in seconds) for idle UDP flows classified as streams which have seen more than one request-response + * transaction. Min: 60 seconds. Max: 180 seconds (3 minutes). Default: 180 seconds.

+ */ + private Integer udpStreamTimeout; + + /* + *

Timeout (in seconds) for idle UDP flows that have seen traffic only in a single direction or a single + * request-response transaction. Min: 30 seconds. Max: 60 seconds. Default: 30 seconds.

+ */ + private Integer udpTimeout; + + /** + * Creates an instance of ConnectionTrackingSpecificationResponse class. + */ + public ConnectionTrackingSpecificationResponse() { + } + + /** + * Get the tcpEstablishedTimeout property: <p>Timeout (in seconds) for idle TCP connections in an established + * state. Min: 60 seconds. Max: 432000 seconds (5 days). Default: 432000 seconds. Recommended: Less than 432000 + * seconds.</p>. + * + * @return the tcpEstablishedTimeout value. + */ + public Integer tcpEstablishedTimeout() { + return this.tcpEstablishedTimeout; + } + + /** + * Set the tcpEstablishedTimeout property: <p>Timeout (in seconds) for idle TCP connections in an established + * state. Min: 60 seconds. Max: 432000 seconds (5 days). Default: 432000 seconds. Recommended: Less than 432000 + * seconds.</p>. + * + * @param tcpEstablishedTimeout the tcpEstablishedTimeout value to set. + * @return the ConnectionTrackingSpecificationResponse object itself. + */ + public ConnectionTrackingSpecificationResponse withTcpEstablishedTimeout(Integer tcpEstablishedTimeout) { + this.tcpEstablishedTimeout = tcpEstablishedTimeout; + return this; + } + + /** + * Get the udpStreamTimeout property: <p>Timeout (in seconds) for idle UDP flows classified as streams which + * have seen more than one request-response transaction. Min: 60 seconds. Max: 180 seconds (3 minutes). Default: 180 + * seconds.</p>. + * + * @return the udpStreamTimeout value. + */ + public Integer udpStreamTimeout() { + return this.udpStreamTimeout; + } + + /** + * Set the udpStreamTimeout property: <p>Timeout (in seconds) for idle UDP flows classified as streams which + * have seen more than one request-response transaction. Min: 60 seconds. Max: 180 seconds (3 minutes). Default: 180 + * seconds.</p>. + * + * @param udpStreamTimeout the udpStreamTimeout value to set. + * @return the ConnectionTrackingSpecificationResponse object itself. + */ + public ConnectionTrackingSpecificationResponse withUdpStreamTimeout(Integer udpStreamTimeout) { + this.udpStreamTimeout = udpStreamTimeout; + return this; + } + + /** + * Get the udpTimeout property: <p>Timeout (in seconds) for idle UDP flows that have seen traffic only in a + * single direction or a single request-response transaction. Min: 30 seconds. Max: 60 seconds. Default: 30 + * seconds.</p>. + * + * @return the udpTimeout value. + */ + public Integer udpTimeout() { + return this.udpTimeout; + } + + /** + * Set the udpTimeout property: <p>Timeout (in seconds) for idle UDP flows that have seen traffic only in a + * single direction or a single request-response transaction. Min: 30 seconds. Max: 60 seconds. Default: 30 + * seconds.</p>. + * + * @param udpTimeout the udpTimeout value to set. + * @return the ConnectionTrackingSpecificationResponse object itself. + */ + public ConnectionTrackingSpecificationResponse withUdpTimeout(Integer udpTimeout) { + this.udpTimeout = udpTimeout; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeNumberField("tcpEstablishedTimeout", this.tcpEstablishedTimeout); + jsonWriter.writeNumberField("udpStreamTimeout", this.udpStreamTimeout); + jsonWriter.writeNumberField("udpTimeout", this.udpTimeout); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ConnectionTrackingSpecificationResponse from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ConnectionTrackingSpecificationResponse if the JsonReader was pointing to an instance of + * it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ConnectionTrackingSpecificationResponse. + */ + public static ConnectionTrackingSpecificationResponse fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ConnectionTrackingSpecificationResponse deserializedConnectionTrackingSpecificationResponse + = new ConnectionTrackingSpecificationResponse(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("tcpEstablishedTimeout".equals(fieldName)) { + deserializedConnectionTrackingSpecificationResponse.tcpEstablishedTimeout + = reader.getNullable(JsonReader::getInt); + } else if ("udpStreamTimeout".equals(fieldName)) { + deserializedConnectionTrackingSpecificationResponse.udpStreamTimeout + = reader.getNullable(JsonReader::getInt); + } else if ("udpTimeout".equals(fieldName)) { + deserializedConnectionTrackingSpecificationResponse.udpTimeout + = reader.getNullable(JsonReader::getInt); + } else { + reader.skipChildren(); + } + } + + return deserializedConnectionTrackingSpecificationResponse; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ConnectorConfigResponse.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ConnectorConfigResponse.java new file mode 100644 index 000000000000..7771e79f2955 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ConnectorConfigResponse.java @@ -0,0 +1,222 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.time.OffsetDateTime; +import java.time.format.DateTimeFormatter; + +/** + * Definition of ConnectorConfigResponse. + */ +@Fluent +public final class ConnectorConfigResponse implements JsonSerializable { + /* + *

A unique code associated with the cluster for registration purposes.

+ */ + private String activationCode; + + /* + *

The expiration time of the connected cluster. The cluster's YAML file must be applied through the native + * provider.

+ */ + private OffsetDateTime activationExpiry; + + /* + *

A unique ID associated with the cluster for registration purposes.

+ */ + private String activationId; + + /* + *

The cluster's cloud service provider.

+ */ + private String provider; + + /* + *

The Amazon Resource Name (ARN) of the role to communicate with services from the connected Kubernetes + * cluster.

+ */ + private String roleArn; + + /** + * Creates an instance of ConnectorConfigResponse class. + */ + public ConnectorConfigResponse() { + } + + /** + * Get the activationCode property: <p>A unique code associated with the cluster for registration + * purposes.</p>. + * + * @return the activationCode value. + */ + public String activationCode() { + return this.activationCode; + } + + /** + * Set the activationCode property: <p>A unique code associated with the cluster for registration + * purposes.</p>. + * + * @param activationCode the activationCode value to set. + * @return the ConnectorConfigResponse object itself. + */ + public ConnectorConfigResponse withActivationCode(String activationCode) { + this.activationCode = activationCode; + return this; + } + + /** + * Get the activationExpiry property: <p>The expiration time of the connected cluster. The cluster's YAML file + * must be applied through the native provider.</p>. + * + * @return the activationExpiry value. + */ + public OffsetDateTime activationExpiry() { + return this.activationExpiry; + } + + /** + * Set the activationExpiry property: <p>The expiration time of the connected cluster. The cluster's YAML file + * must be applied through the native provider.</p>. + * + * @param activationExpiry the activationExpiry value to set. + * @return the ConnectorConfigResponse object itself. + */ + public ConnectorConfigResponse withActivationExpiry(OffsetDateTime activationExpiry) { + this.activationExpiry = activationExpiry; + return this; + } + + /** + * Get the activationId property: <p>A unique ID associated with the cluster for registration + * purposes.</p>. + * + * @return the activationId value. + */ + public String activationId() { + return this.activationId; + } + + /** + * Set the activationId property: <p>A unique ID associated with the cluster for registration + * purposes.</p>. + * + * @param activationId the activationId value to set. + * @return the ConnectorConfigResponse object itself. + */ + public ConnectorConfigResponse withActivationId(String activationId) { + this.activationId = activationId; + return this; + } + + /** + * Get the provider property: <p>The cluster's cloud service provider.</p>. + * + * @return the provider value. + */ + public String provider() { + return this.provider; + } + + /** + * Set the provider property: <p>The cluster's cloud service provider.</p>. + * + * @param provider the provider value to set. + * @return the ConnectorConfigResponse object itself. + */ + public ConnectorConfigResponse withProvider(String provider) { + this.provider = provider; + return this; + } + + /** + * Get the roleArn property: <p>The Amazon Resource Name (ARN) of the role to communicate with services from + * the connected Kubernetes cluster.</p>. + * + * @return the roleArn value. + */ + public String roleArn() { + return this.roleArn; + } + + /** + * Set the roleArn property: <p>The Amazon Resource Name (ARN) of the role to communicate with services from + * the connected Kubernetes cluster.</p>. + * + * @param roleArn the roleArn value to set. + * @return the ConnectorConfigResponse object itself. + */ + public ConnectorConfigResponse withRoleArn(String roleArn) { + this.roleArn = roleArn; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("activationCode", this.activationCode); + jsonWriter.writeStringField("activationExpiry", + this.activationExpiry == null + ? null + : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.activationExpiry)); + jsonWriter.writeStringField("activationId", this.activationId); + jsonWriter.writeStringField("provider", this.provider); + jsonWriter.writeStringField("roleArn", this.roleArn); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ConnectorConfigResponse from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ConnectorConfigResponse if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the ConnectorConfigResponse. + */ + public static ConnectorConfigResponse fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ConnectorConfigResponse deserializedConnectorConfigResponse = new ConnectorConfigResponse(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("activationCode".equals(fieldName)) { + deserializedConnectorConfigResponse.activationCode = reader.getString(); + } else if ("activationExpiry".equals(fieldName)) { + deserializedConnectorConfigResponse.activationExpiry = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("activationId".equals(fieldName)) { + deserializedConnectorConfigResponse.activationId = reader.getString(); + } else if ("provider".equals(fieldName)) { + deserializedConnectorConfigResponse.provider = reader.getString(); + } else if ("roleArn".equals(fieldName)) { + deserializedConnectorConfigResponse.roleArn = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedConnectorConfigResponse; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ContainerDefinition.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ContainerDefinition.java new file mode 100644 index 000000000000..67261ae53943 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ContainerDefinition.java @@ -0,0 +1,2453 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Definition of ContainerDefinition. + */ +@Fluent +public final class ContainerDefinition implements JsonSerializable { + /* + * The command that's passed to the container. This parameter maps to ``Cmd`` in the [Create a + * container](https://docs.aws.amazon.com/https://docs.docker.com/engine/api/v1.35/#operation/ContainerCreate) + * section of the [Docker Remote API](https://docs.aws.amazon.com/https://docs.docker.com/engine/api/v1.35/) and the + * ``COMMAND`` parameter to [docker + * run](https://docs.aws.amazon.com/https://docs.docker.com/engine/reference/run/#security-configuration). For more + * information, see + * [https://docs.docker.com/engine/reference/builder/#cmd](https://docs.aws.amazon.com/https://docs.docker.com/ + * engine/reference/builder/#cmd). If there are multiple arguments, each argument is a separated string in the + * array. + */ + private List command; + + /* + * The number of ``cpu`` units reserved for the container. This parameter maps to ``CpuShares`` in the [Create a + * container](https://docs.aws.amazon.com/https://docs.docker.com/engine/api/v1.35/#operation/ContainerCreate) + * section of the [Docker Remote API](https://docs.aws.amazon.com/https://docs.docker.com/engine/api/v1.35/) and the + * ``--cpu-shares`` option to [docker + * run](https://docs.aws.amazon.com/https://docs.docker.com/engine/reference/run/#security-configuration). This + * field is optional for tasks using the Fargate launch type, and the only requirement is that the total amount of + * CPU reserved for all containers within a task be lower than the task-level ``cpu`` value. You can determine the + * number of CPU units that are available per EC2 instance type by multiplying the vCPUs listed for that instance + * type on the [Amazon EC2 Instances](https://docs.aws.amazon.com/ec2/instance-types/) detail page by 1,024. Linux + * containers share unallocated CPU units with other containers on the container instance with the same ratio as + * their allocated amount. For example, if you run a single-container task on a single-core instance type with 512 + * CPU units specified for that container, and that's the only task running on the container instance, that + * container could use the full 1,024 CPU unit share at any given time. However, if you launched another copy of the + * same task on that container instance, each task is guaranteed a minimum of 512 CPU units when needed. Moreover, + * each container could float to higher CPU usage if the other container was not using it. If both tasks were 100% + * active all of the time, they would be limited to 512 CPU units. On Linux container instances, the Docker daemon + * on the container instance uses the CPU value to calculate the relative CPU share ratios for running containers. + * For more information, see [CPU share + * constraint](https://docs.aws.amazon.com/https://docs.docker.com/engine/reference/run/#cpu-share-constraint) in + * the Docker documentation. The minimum valid CPU share value that the Linux kernel allows is 2. However, the CPU + * parameter isn't required, and you can use CPU values below 2 in your container definitions. For CPU values below + * 2 (including null), the behavior varies based on your Amazon ECS container agent version: + *Agent versions less + * than or equal to 1.1.0:* Null and zero CPU values are passed to Docker as 0, which Docker then converts to 1,024 + * CPU shares. CPU values of 1 are passed to Docker as 1, which the Linux kernel converts to two CPU shares. + + * *Agent versions greater than or equal to 1.2.0:* Null, zero, and CPU values of 1 are passed to Docker as 2. On + * Windows container instances, the CPU limit is enforced as an absolute limit, or a quota. Windows containers only + * have access to the specified amount of CPU that's described in the task definition. A null or zero CPU value is + * passed to Docker as ``0``, which Windows interprets as 1% of one CPU. + */ + private Integer cpu; + + /* + * A list of ARNs in SSM or Amazon S3 to a credential spec (``CredSpec``) file that configures the container for + * Active Directory authentication. We recommend that you use this parameter instead of the + * ``dockerSecurityOptions``. The maximum number of ARNs is 1. There are two formats for each ARN. + + * credentialspecdomainless:MyARN You use credentialspecdomainless:MyARN to provide a CredSpec with an additional + * section for a secret in . You provide the login credentials to the domain in the secret. Each task that runs on + * any container instance can join different domains. You can use this format without joining the container instance + * to a domain. + credentialspec:MyARN You use credentialspec:MyARN to provide a CredSpec for a single domain. You + * must join the container instance to the domain before you start any tasks that use this task definition. In both + * formats, replace ``MyARN`` with the ARN in SSM or Amazon S3. If you provide a ``credentialspecdomainless:MyARN``, + * the ``credspec`` must provide a ARN in ASMlong for a secret containing the username, password, and the domain to + * connect to. For better security, the instance isn't joined to the domain for domainless authentication. Other + * applications on the instance can't use the domainless credentials. You can use this parameter to run tasks on the + * same instance, even it the tasks need to join different domains. For more information, see [Using gMSAs for + * Windows Containers](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/windows-gmsa.html) and [Using + * gMSAs for Linux Containers](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/linux-gmsa.html). + */ + private List credentialSpecs; + + /* + * The dependencies defined for container startup and shutdown. A container can contain multiple dependencies. When + * a dependency is defined for container startup, for container shutdown it is reversed. For tasks using the EC2 + * launch type, the container instances require at least version 1.26.0 of the container agent to turn on container + * dependencies. However, we recommend using the latest container agent version. For information about checking your + * agent version and updating to the latest version, see [Updating the Amazon ECS Container + * Agent](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/ecs-agent-update.html) in the *Amazon Elastic + * Container Service Developer Guide*. If you're using an Amazon ECS-optimized Linux AMI, your instance needs at + * least version 1.26.0-1 of the ``ecs-init`` package. If your container instances are launched from version + * ``20190301`` or later, then they contain the required versions of the container agent and ``ecs-init``. For more + * information, see [Amazon ECS-optimized Linux + * AMI](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/ecs-optimized_AMI.html) in the *Amazon Elastic + * Container Service Developer Guide*. For tasks using the Fargate launch type, the task or service requires the + * following platforms: + Linux platform version ``1.3.0`` or later. + Windows platform version ``1.0.0`` or later. + * If the task definition is used in a blue/green deployment that uses [AWS::CodeDeploy::DeploymentGroup + * BlueGreenDeploymentConfiguration](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties- + * codedeploy-deploymentgroup-bluegreendeploymentconfiguration.html), the ``dependsOn`` parameter is not supported. + * For more information see [Issue + * #680](https://docs.aws.amazon.com/https://github.com/aws-cloudformation/cloudformation-coverage-roadmap/issues/ + * 680) on the on the GitHub website. + */ + private List dependsOn; + + /* + * When this parameter is true, networking is off within the container. This parameter maps to ``NetworkDisabled`` + * in the [Create a + * container](https://docs.aws.amazon.com/https://docs.docker.com/engine/api/v1.35/#operation/ContainerCreate) + * section of the [Docker Remote API](https://docs.aws.amazon.com/https://docs.docker.com/engine/api/v1.35/). This + * parameter is not supported for Windows containers. + */ + private Boolean disableNetworking; + + /* + * A list of DNS search domains that are presented to the container. This parameter maps to ``DnsSearch`` in the + * [Create a + * container](https://docs.aws.amazon.com/https://docs.docker.com/engine/api/v1.35/#operation/ContainerCreate) + * section of the [Docker Remote API](https://docs.aws.amazon.com/https://docs.docker.com/engine/api/v1.35/) and the + * ``--dns-search`` option to [docker + * run](https://docs.aws.amazon.com/https://docs.docker.com/engine/reference/run/#security-configuration). This + * parameter is not supported for Windows containers. + */ + private List dnsSearchDomains; + + /* + * A list of DNS servers that are presented to the container. This parameter maps to ``Dns`` in the [Create a + * container](https://docs.aws.amazon.com/https://docs.docker.com/engine/api/v1.35/#operation/ContainerCreate) + * section of the [Docker Remote API](https://docs.aws.amazon.com/https://docs.docker.com/engine/api/v1.35/) and the + * ``--dns`` option to [docker + * run](https://docs.aws.amazon.com/https://docs.docker.com/engine/reference/run/#security-configuration). This + * parameter is not supported for Windows containers. + */ + private List dnsServers; + + /* + * A key/value map of labels to add to the container. This parameter maps to ``Labels`` in the [Create a + * container](https://docs.aws.amazon.com/https://docs.docker.com/engine/api/v1.35/#operation/ContainerCreate) + * section of the [Docker Remote API](https://docs.aws.amazon.com/https://docs.docker.com/engine/api/v1.35/) and the + * ``--label`` option to [docker + * run](https://docs.aws.amazon.com/https://docs.docker.com/engine/reference/run/#security-configuration). This + * parameter requires version 1.18 of the Docker Remote API or greater on your container instance. To check the + * Docker Remote API version on your container instance, log in to your container instance and run the following + * command: ``sudo docker version --format '{{.Server.APIVersion}}'`` + */ + private Object dockerLabels; + + /* + * A list of strings to provide custom configuration for multiple security systems. For more information about valid + * values, see [Docker Run Security + * Configuration](https://docs.aws.amazon.com/https://docs.docker.com/engine/reference/run/#security-configuration). + * This field isn't valid for containers in tasks using the Fargate launch type. For Linux tasks on EC2, this + * parameter can be used to reference custom labels for SELinux and AppArmor multi-level security systems. For any + * tasks on EC2, this parameter can be used to reference a credential spec file that configures a container for + * Active Directory authentication. For more information, see [Using gMSAs for Windows + * Containers](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/windows-gmsa.html) and [Using gMSAs for + * Linux Containers](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/linux-gmsa.html) in the *Amazon + * Elastic Container Service Developer Guide*. This parameter maps to ``SecurityOpt`` in the [Create a + * container](https://docs.aws.amazon.com/https://docs.docker.com/engine/api/v1.35/#operation/ContainerCreate) + * section of the [Docker Remote API](https://docs.aws.amazon.com/https://docs.docker.com/engine/api/v1.35/) and the + * ``--security-opt`` option to [docker + * run](https://docs.aws.amazon.com/https://docs.docker.com/engine/reference/run/#security-configuration). The + * Amazon ECS container agent running on a container instance must register with the ``ECS_SELINUX_CAPABLE=true`` or + * ``ECS_APPARMOR_CAPABLE=true`` environment variables before containers placed on that instance can use these + * security options. For more information, see [Amazon ECS Container Agent + * Configuration](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/ecs-agent-config.html) in the *Amazon + * Elastic Container Service Developer Guide*. For more information about valid values, see [Docker Run Security + * Configuration](https://docs.aws.amazon.com/https://docs.docker.com/engine/reference/run/#security-configuration). + * Valid values: 'no-new-privileges' | 'apparmor:PROFILE' | 'label:value' | 'credentialspec:CredentialSpecFilePath' + */ + private List dockerSecurityOptions; + + /* + * Early versions of the Amazon ECS container agent don't properly handle ``entryPoint`` parameters. If you have + * problems using ``entryPoint``, update your container agent or enter your commands and arguments as ``command`` + * array items instead. The entry point that's passed to the container. This parameter maps to ``Entrypoint`` in the + * [Create a + * container](https://docs.aws.amazon.com/https://docs.docker.com/engine/api/v1.35/#operation/ContainerCreate) + * section of the [Docker Remote API](https://docs.aws.amazon.com/https://docs.docker.com/engine/api/v1.35/) and the + * ``--entrypoint`` option to [docker + * run](https://docs.aws.amazon.com/https://docs.docker.com/engine/reference/run/#security-configuration). For more + * information, see + * [https://docs.docker.com/engine/reference/builder/#entrypoint](https://docs.aws.amazon.com/https://docs.docker. + * com/engine/reference/builder/#entrypoint). + */ + private List entryPoint; + + /* + * The environment variables to pass to a container. This parameter maps to ``Env`` in the [Create a + * container](https://docs.aws.amazon.com/https://docs.docker.com/engine/api/v1.35/#operation/ContainerCreate) + * section of the [Docker Remote API](https://docs.aws.amazon.com/https://docs.docker.com/engine/api/v1.35/) and the + * ``--env`` option to [docker + * run](https://docs.aws.amazon.com/https://docs.docker.com/engine/reference/run/#security-configuration). We don't + * recommend that you use plaintext environment variables for sensitive information, such as credential data. + */ + private List environment; + + /* + * A list of files containing the environment variables to pass to a container. This parameter maps to the + * ``--env-file`` option to [docker + * run](https://docs.aws.amazon.com/https://docs.docker.com/engine/reference/run/#security-configuration). You can + * specify up to ten environment files. The file must have a ``.env`` file extension. Each line in an environment + * file contains an environment variable in ``VARIABLE=VALUE`` format. Lines beginning with ``#`` are treated as + * comments and are ignored. For more information about the environment variable file syntax, see [Declare default + * environment variables in file](https://docs.aws.amazon.com/https://docs.docker.com/compose/env-file/). If there + * are environment variables specified using the ``environment`` parameter in a container definition, they take + * precedence over the variables contained within an environment file. If multiple environment files are specified + * that contain the same variable, they're processed from the top down. We recommend that you use unique variable + * names. For more information, see [Specifying Environment + * Variables](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/taskdef-envfiles.html) in the *Amazon + * Elastic Container Service Developer Guide*. + */ + private List environmentFiles; + + /* + * If the ``essential`` parameter of a container is marked as ``true``, and that container fails or stops for any + * reason, all other containers that are part of the task are stopped. If the ``essential`` parameter of a container + * is marked as ``false``, its failure doesn't affect the rest of the containers in a task. If this parameter is + * omitted, a container is assumed to be essential. All tasks must have at least one essential container. If you + * have an application that's composed of multiple containers, group containers that are used for a common purpose + * into components, and separate the different components into multiple task definitions. For more information, see + * [Application + * Architecture](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/application_architecture.html) in the + * *Amazon Elastic Container Service Developer Guide*. + */ + private Boolean essential; + + /* + * A list of hostnames and IP address mappings to append to the ``/etc/hosts`` file on the container. This parameter + * maps to ``ExtraHosts`` in the [Create a + * container](https://docs.aws.amazon.com/https://docs.docker.com/engine/api/v1.35/#operation/ContainerCreate) + * section of the [Docker Remote API](https://docs.aws.amazon.com/https://docs.docker.com/engine/api/v1.35/) and the + * ``--add-host`` option to [docker + * run](https://docs.aws.amazon.com/https://docs.docker.com/engine/reference/run/#security-configuration). This + * parameter isn't supported for Windows containers or tasks that use the ``awsvpc`` network mode. + */ + private List extraHosts; + + /* + * The FireLens configuration for the container. This is used to specify and configure a log router for container + * logs. For more information, see [Custom Log + * Routing](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/using_firelens.html) in the *Amazon Elastic + * Container Service Developer Guide*. The FireLens configuration for the container. This is used to specify and + * configure a log router for container logs. For more information, see [Custom log + * routing](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/using_firelens.html) in the *Amazon Elastic + * Container Service Developer Guide*. + */ + private FirelensConfiguration firelensConfiguration; + + /* + * The container health check command and associated configuration parameters for the container. This parameter maps + * to ``HealthCheck`` in the [Create a + * container](https://docs.aws.amazon.com/https://docs.docker.com/engine/api/v1.35/#operation/ContainerCreate) + * section of the [Docker Remote API](https://docs.aws.amazon.com/https://docs.docker.com/engine/api/v1.35/) and the + * ``HEALTHCHECK`` parameter of [docker + * run](https://docs.aws.amazon.com/https://docs.docker.com/engine/reference/run/#security-configuration). The + * ``HealthCheck`` property specifies an object representing a container health check. Health check parameters that + * are specified in a container definition override any Docker health checks that exist in the container image (such + * as those specified in a parent image or from the image's Dockerfile). This configuration maps to the + * ``HEALTHCHECK`` parameter of [docker + * run](https://docs.aws.amazon.com/https://docs.docker.com/engine/reference/run/). The Amazon ECS container agent + * only monitors and reports on the health checks specified in the task definition. Amazon ECS does not monitor + * Docker health checks that are embedded in a container image and not specified in the container definition. Health + * check parameters that are specified in a container definition override any Docker health checks that exist in the + * container image. If a task is run manually, and not as part of a service, the task will continue its lifecycle + * regardless of its health status. For tasks that are part of a service, if the task reports as unhealthy then the + * task will be stopped and the service scheduler will replace it. The following are notes about container health + * check support: + Container health checks require version 1.17.0 or greater of the Amazon ECS container agent. For + * more information, see [Updating the Amazon ECS Container + * Agent](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/ecs-agent-update.html). + Container health + * checks are supported for Fargate tasks if you are using platform version 1.1.0 or greater. For more information, + * see [Platform Versions](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/platform_versions.html). + + * Container health checks are not supported for tasks that are part of a service that is configured to use a + * Classic Load Balancer. + */ + private HealthCheck healthCheck; + + /* + * The hostname to use for your container. This parameter maps to ``Hostname`` in the [Create a + * container](https://docs.aws.amazon.com/https://docs.docker.com/engine/api/v1.35/#operation/ContainerCreate) + * section of the [Docker Remote API](https://docs.aws.amazon.com/https://docs.docker.com/engine/api/v1.35/) and the + * ``--hostname`` option to [docker + * run](https://docs.aws.amazon.com/https://docs.docker.com/engine/reference/run/#security-configuration). The + * ``hostname`` parameter is not supported if you're using the ``awsvpc`` network mode. + */ + private String hostname; + + /* + * The image used to start a container. This string is passed directly to the Docker daemon. By default, images in + * the Docker Hub registry are available. Other repositories are specified with either ``repository-url/image:tag`` + * or ``repository-url/image@digest``. Up to 255 letters (uppercase and lowercase), numbers, hyphens, underscores, + * colons, periods, forward slashes, and number signs are allowed. This parameter maps to ``Image`` in the [Create a + * container](https://docs.aws.amazon.com/https://docs.docker.com/engine/api/v1.35/#operation/ContainerCreate) + * section of the [Docker Remote API](https://docs.aws.amazon.com/https://docs.docker.com/engine/api/v1.35/) and the + * ``IMAGE`` parameter of [docker + * run](https://docs.aws.amazon.com/https://docs.docker.com/engine/reference/run/#security-configuration). + When a + * new task starts, the Amazon ECS container agent pulls the latest version of the specified image and tag for the + * container to use. However, subsequent updates to a repository image aren't propagated to already running tasks. + + * Images in Amazon ECR repositories can be specified by either using the full ``registry/repository:tag`` or + * ``registry/repository@digest``. For example, + * ``012345678910.dkr.ecr..amazonaws.com/:latest`` or + * ``012345678910.dkr.ecr..amazonaws.com/@sha256: + * 94afd1f2e64d908bc90dbca0035a5b567EXAMPLE``. + Images in official repositories on Docker Hub use a single name + * (for example, ``ubuntu`` or ``mongo``). + Images in other repositories on Docker Hub are qualified with an + * organization name (for example, ``amazon/amazon-ecs-agent``). + Images in other online repositories are qualified + * further by a domain name (for example, ``quay.io/assemblyline/ubuntu``). + */ + private String image; + + /* + * When this parameter is ``true``, you can deploy containerized applications that require ``stdin`` or a ``tty`` to + * be allocated. This parameter maps to ``OpenStdin`` in the [Create a + * container](https://docs.aws.amazon.com/https://docs.docker.com/engine/api/v1.35/#operation/ContainerCreate) + * section of the [Docker Remote API](https://docs.aws.amazon.com/https://docs.docker.com/engine/api/v1.35/) and the + * ``--interactive`` option to [docker + * run](https://docs.aws.amazon.com/https://docs.docker.com/engine/reference/run/#security-configuration). + */ + private Boolean interactive; + + /* + * The ``links`` parameter allows containers to communicate with each other without the need for port mappings. This + * parameter is only supported if the network mode of a task definition is ``bridge``. The ``name:internalName`` + * construct is analogous to ``name:alias`` in Docker links. Up to 255 letters (uppercase and lowercase), numbers, + * underscores, and hyphens are allowed. For more information about linking Docker containers, go to [Legacy + * container links](https://docs.aws.amazon.com/https://docs.docker.com/network/links/) in the Docker documentation. + * This parameter maps to ``Links`` in the [Create a + * container](https://docs.aws.amazon.com/https://docs.docker.com/engine/api/v1.35/#operation/ContainerCreate) + * section of the [Docker Remote API](https://docs.aws.amazon.com/https://docs.docker.com/engine/api/v1.35/) and the + * ``--link`` option to [docker + * run](https://docs.aws.amazon.com/https://docs.docker.com/engine/reference/run/#security-configuration). This + * parameter is not supported for Windows containers. Containers that are collocated on a single container instance + * may be able to communicate with each other without requiring links or host port mappings. Network isolation is + * achieved on the container instance using security groups and VPC settings. + */ + private List links; + + /* + * Linux-specific modifications that are applied to the container, such as Linux kernel capabilities. For more + * information see + * [KernelCapabilities](https://docs.aws.amazon.com/AmazonECS/latest/APIReference/API_KernelCapabilities.html). This + * parameter is not supported for Windows containers. The Linux-specific options that are applied to the container, + * such as Linux + * [KernelCapabilities](https://docs.aws.amazon.com/AmazonECS/latest/APIReference/API_KernelCapabilities.html). + */ + private LinuxParameters linuxParameters; + + /* + * The log configuration specification for the container. This parameter maps to ``LogConfig`` in the [Create a + * container](https://docs.aws.amazon.com/https://docs.docker.com/engine/api/v1.35/#operation/ContainerCreate) + * section of the [Docker Remote API](https://docs.aws.amazon.com/https://docs.docker.com/engine/api/v1.35/) and the + * ``--log-driver`` option to [docker + * run](https://docs.aws.amazon.com/https://docs.docker.com/engine/reference/run/). By default, containers use the + * same logging driver that the Docker daemon uses. However, the container may use a different logging driver than + * the Docker daemon by specifying a log driver with this parameter in the container definition. To use a different + * logging driver for a container, the log system must be configured properly on the container instance (or on a + * different log server for remote logging options). For more information on the options for different supported log + * drivers, see [Configure logging + * drivers](https://docs.aws.amazon.com/https://docs.docker.com/engine/admin/logging/overview/) in the Docker + * documentation. Amazon ECS currently supports a subset of the logging drivers available to the Docker daemon + * (shown in the + * [LogConfiguration](https://docs.aws.amazon.com/AmazonECS/latest/APIReference/API_LogConfiguration.html) data + * type). Additional log drivers may be available in future releases of the Amazon ECS container agent. This + * parameter requires version 1.18 of the Docker Remote API or greater on your container instance. To check the + * Docker Remote API version on your container instance, log in to your container instance and run the following + * command: ``sudo docker version --format '{{.Server.APIVersion}}'`` The Amazon ECS container agent running on a + * container instance must register the logging drivers available on that instance with the + * ``ECS_AVAILABLE_LOGGING_DRIVERS`` environment variable before containers placed on that instance can use these + * log configuration options. For more information, see [Amazon ECS Container Agent + * Configuration](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/ecs-agent-config.html) in the *Amazon + * Elastic Container Service Developer Guide*. The ``LogConfiguration`` property specifies log configuration options + * to send to a custom log driver for the container. + */ + private LogConfiguration logConfiguration; + + /* + * The amount (in MiB) of memory to present to the container. If your container attempts to exceed the memory + * specified here, the container is killed. The total amount of memory reserved for all containers within a task + * must be lower than the task ``memory`` value, if one is specified. This parameter maps to ``Memory`` in the + * [Create a + * container](https://docs.aws.amazon.com/https://docs.docker.com/engine/api/v1.35/#operation/ContainerCreate) + * section of the [Docker Remote API](https://docs.aws.amazon.com/https://docs.docker.com/engine/api/v1.35/) and the + * ``--memory`` option to [docker + * run](https://docs.aws.amazon.com/https://docs.docker.com/engine/reference/run/#security-configuration). If using + * the Fargate launch type, this parameter is optional. If using the EC2 launch type, you must specify either a + * task-level memory value or a container-level memory value. If you specify both a container-level ``memory`` and + * ``memoryReservation`` value, ``memory`` must be greater than ``memoryReservation``. If you specify + * ``memoryReservation``, then that value is subtracted from the available memory resources for the container + * instance where the container is placed. Otherwise, the value of ``memory`` is used. The Docker 20.10.0 or later + * daemon reserves a minimum of 6 MiB of memory for a container, so you should not specify fewer than 6 MiB of + * memory for your containers. The Docker 19.03.13-ce or earlier daemon reserves a minimum of 4 MiB of memory for a + * container, so you should not specify fewer than 4 MiB of memory for your containers. + */ + private Integer memory; + + /* + * The soft limit (in MiB) of memory to reserve for the container. When system memory is under heavy contention, + * Docker attempts to keep the container memory to this soft limit. However, your container can consume more memory + * when it needs to, up to either the hard limit specified with the ``memory`` parameter (if applicable), or all of + * the available memory on the container instance, whichever comes first. This parameter maps to + * ``MemoryReservation`` in the [Create a + * container](https://docs.aws.amazon.com/https://docs.docker.com/engine/api/v1.35/#operation/ContainerCreate) + * section of the [Docker Remote API](https://docs.aws.amazon.com/https://docs.docker.com/engine/api/v1.35/) and the + * ``--memory-reservation`` option to [docker + * run](https://docs.aws.amazon.com/https://docs.docker.com/engine/reference/run/#security-configuration). If a + * task-level memory value is not specified, you must specify a non-zero integer for one or both of ``memory`` or + * ``memoryReservation`` in a container definition. If you specify both, ``memory`` must be greater than + * ``memoryReservation``. If you specify ``memoryReservation``, then that value is subtracted from the available + * memory resources for the container instance where the container is placed. Otherwise, the value of ``memory`` is + * used. For example, if your container normally uses 128 MiB of memory, but occasionally bursts to 256 MiB of + * memory for short periods of time, you can set a ``memoryReservation`` of 128 MiB, and a ``memory`` hard limit of + * 300 MiB. This configuration would allow the container to only reserve 128 MiB of memory from the remaining + * resources on the container instance, but also allow the container to consume more memory resources when needed. + * The Docker 20.10.0 or later daemon reserves a minimum of 6 MiB of memory for a container. So, don't specify less + * than 6 MiB of memory for your containers. The Docker 19.03.13-ce or earlier daemon reserves a minimum of 4 MiB of + * memory for a container. So, don't specify less than 4 MiB of memory for your containers. + */ + private Integer memoryReservation; + + /* + * The mount points for data volumes in your container. This parameter maps to ``Volumes`` in the [Create a + * container](https://docs.aws.amazon.com/https://docs.docker.com/engine/api/v1.35/#operation/ContainerCreate) + * section of the [Docker Remote API](https://docs.aws.amazon.com/https://docs.docker.com/engine/api/v1.35/) and the + * ``--volume`` option to [docker + * run](https://docs.aws.amazon.com/https://docs.docker.com/engine/reference/run/#security-configuration). Windows + * containers can mount whole directories on the same drive as ``$env:ProgramData``. Windows containers can't mount + * directories on a different drive, and mount point can't be across drives. + */ + private List mountPoints; + + /* + * The name of a container. If you're linking multiple containers together in a task definition, the ``name`` of one + * container can be entered in the ``links`` of another container to connect the containers. Up to 255 letters + * (uppercase and lowercase), numbers, underscores, and hyphens are allowed. This parameter maps to ``name`` in the + * [Create a + * container](https://docs.aws.amazon.com/https://docs.docker.com/engine/api/v1.35/#operation/ContainerCreate) + * section of the [Docker Remote API](https://docs.aws.amazon.com/https://docs.docker.com/engine/api/v1.35/) and the + * ``--name`` option to [docker + * run](https://docs.aws.amazon.com/https://docs.docker.com/engine/reference/run/#security-configuration). + */ + private String name; + + /* + * The list of port mappings for the container. Port mappings allow containers to access ports on the host container + * instance to send or receive traffic. For task definitions that use the ``awsvpc`` network mode, you should only + * specify the ``containerPort``. The ``hostPort`` can be left blank or it must be the same value as the + * ``containerPort``. Port mappings on Windows use the ``NetNAT`` gateway address rather than ``localhost``. There + * is no loopback for port mappings on Windows, so you cannot access a container's mapped port from the host itself. + * This parameter maps to ``PortBindings`` in the [Create a + * container](https://docs.aws.amazon.com/https://docs.docker.com/engine/api/v1.35/#operation/ContainerCreate) + * section of the [Docker Remote API](https://docs.aws.amazon.com/https://docs.docker.com/engine/api/v1.35/) and the + * ``--publish`` option to [docker run](https://docs.aws.amazon.com/https://docs.docker.com/engine/reference/run/). + * If the network mode of a task definition is set to ``none``, then you can't specify port mappings. If the network + * mode of a task definition is set to ``host``, then host ports must either be undefined or they must match the + * container port in the port mapping. After a task reaches the ``RUNNING`` status, manual and automatic host and + * container port assignments are visible in the *Network Bindings* section of a container description for a + * selected task in the Amazon ECS console. The assignments are also visible in the ``networkBindings`` section + * [DescribeTasks](https://docs.aws.amazon.com/AmazonECS/latest/APIReference/API_DescribeTasks.html) responses. + */ + private List portMappings; + + /* + * When this parameter is true, the container is given elevated privileges on the host container instance (similar + * to the ``root`` user). This parameter maps to ``Privileged`` in the [Create a + * container](https://docs.aws.amazon.com/https://docs.docker.com/engine/api/v1.35/#operation/ContainerCreate) + * section of the [Docker Remote API](https://docs.aws.amazon.com/https://docs.docker.com/engine/api/v1.35/) and the + * ``--privileged`` option to [docker + * run](https://docs.aws.amazon.com/https://docs.docker.com/engine/reference/run/#security-configuration). This + * parameter is not supported for Windows containers or tasks run on FARGATElong. + */ + private Boolean privileged; + + /* + * When this parameter is ``true``, a TTY is allocated. This parameter maps to ``Tty`` in the [Create a + * container](https://docs.aws.amazon.com/https://docs.docker.com/engine/api/v1.35/#operation/ContainerCreate) + * section of the [Docker Remote API](https://docs.aws.amazon.com/https://docs.docker.com/engine/api/v1.35/) and the + * ``--tty`` option to [docker + * run](https://docs.aws.amazon.com/https://docs.docker.com/engine/reference/run/#security-configuration). + */ + private Boolean pseudoTerminal; + + /* + * When this parameter is true, the container is given read-only access to its root file system. This parameter maps + * to ``ReadonlyRootfs`` in the [Create a + * container](https://docs.aws.amazon.com/https://docs.docker.com/engine/api/v1.35/#operation/ContainerCreate) + * section of the [Docker Remote API](https://docs.aws.amazon.com/https://docs.docker.com/engine/api/v1.35/) and the + * ``--read-only`` option to [docker + * run](https://docs.aws.amazon.com/https://docs.docker.com/engine/reference/run/#security-configuration). This + * parameter is not supported for Windows containers. + */ + private Boolean readonlyRootFilesystem; + + /* + * The private repository authentication credentials to use. The repository credentials for private registry + * authentication. + */ + private RepositoryCredentials repositoryCredentials; + + /* + * The type and amount of a resource to assign to a container. The only supported resource is a GPU. + */ + private List resourceRequirements; + + /* + * The secrets to pass to the container. For more information, see [Specifying Sensitive + * Data](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/specifying-sensitive-data.html) in the *Amazon + * Elastic Container Service Developer Guide*. + */ + private List secrets; + + /* + * Time duration (in seconds) to wait before giving up on resolving dependencies for a container. For example, you + * specify two containers in a task definition with containerA having a dependency on containerB reaching a + * ``COMPLETE``, ``SUCCESS``, or ``HEALTHY`` status. If a ``startTimeout`` value is specified for containerB and it + * doesn't reach the desired status within that time then containerA gives up and not start. This results in the + * task transitioning to a ``STOPPED`` state. When the ``ECS_CONTAINER_START_TIMEOUT`` container agent configuration + * variable is used, it's enforced independently from this start timeout value. For tasks using the Fargate launch + * type, the task or service requires the following platforms: + Linux platform version ``1.3.0`` or later. + + * Windows platform version ``1.0.0`` or later. For tasks using the EC2 launch type, your container instances + * require at least version ``1.26.0`` of the container agent to use a container start timeout value. However, we + * recommend using the latest container agent version. For information about checking your agent version and + * updating to the latest version, see [Updating the Amazon ECS Container + * Agent](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/ecs-agent-update.html) in the *Amazon Elastic + * Container Service Developer Guide*. If you're using an Amazon ECS-optimized Linux AMI, your instance needs at + * least version ``1.26.0-1`` of the ``ecs-init`` package. If your container instances are launched from version + * ``20190301`` or later, then they contain the required versions of the container agent and ``ecs-init``. For more + * information, see [Amazon ECS-optimized Linux + * AMI](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/ecs-optimized_AMI.html) in the *Amazon Elastic + * Container Service Developer Guide*. The valid values are 2-120 seconds. + */ + private Integer startTimeout; + + /* + * Time duration (in seconds) to wait before the container is forcefully killed if it doesn't exit normally on its + * own. For tasks using the Fargate launch type, the task or service requires the following platforms: + Linux + * platform version ``1.3.0`` or later. + Windows platform version ``1.0.0`` or later. The max stop timeout value is + * 120 seconds and if the parameter is not specified, the default value of 30 seconds is used. For tasks that use + * the EC2 launch type, if the ``stopTimeout`` parameter isn't specified, the value set for the Amazon ECS container + * agent configuration variable ``ECS_CONTAINER_STOP_TIMEOUT`` is used. If neither the ``stopTimeout`` parameter or + * the ``ECS_CONTAINER_STOP_TIMEOUT`` agent configuration variable are set, then the default values of 30 seconds + * for Linux containers and 30 seconds on Windows containers are used. Your container instances require at least + * version 1.26.0 of the container agent to use a container stop timeout value. However, we recommend using the + * latest container agent version. For information about checking your agent version and updating to the latest + * version, see [Updating the Amazon ECS Container + * Agent](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/ecs-agent-update.html) in the *Amazon Elastic + * Container Service Developer Guide*. If you're using an Amazon ECS-optimized Linux AMI, your instance needs at + * least version 1.26.0-1 of the ``ecs-init`` package. If your container instances are launched from version + * ``20190301`` or later, then they contain the required versions of the container agent and ``ecs-init``. For more + * information, see [Amazon ECS-optimized Linux + * AMI](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/ecs-optimized_AMI.html) in the *Amazon Elastic + * Container Service Developer Guide*. The valid values are 2-120 seconds. + */ + private Integer stopTimeout; + + /* + * A list of namespaced kernel parameters to set in the container. This parameter maps to ``Sysctls`` in the [Create + * a container](https://docs.aws.amazon.com/https://docs.docker.com/engine/api/v1.35/#operation/ContainerCreate) + * section of the [Docker Remote API](https://docs.aws.amazon.com/https://docs.docker.com/engine/api/v1.35/) and the + * ``--sysctl`` option to [docker + * run](https://docs.aws.amazon.com/https://docs.docker.com/engine/reference/run/#security-configuration). For + * example, you can configure ``net.ipv4.tcp_keepalive_time`` setting to maintain longer lived connections. + */ + private List systemControls; + + /* + * A list of ``ulimits`` to set in the container. This parameter maps to ``Ulimits`` in the [Create a + * container](https://docs.aws.amazon.com/https://docs.docker.com/engine/api/v1.35/#operation/ContainerCreate) + * section of the [Docker Remote API](https://docs.aws.amazon.com/https://docs.docker.com/engine/api/v1.35/) and the + * ``--ulimit`` option to [docker run](https://docs.aws.amazon.com/https://docs.docker.com/engine/reference/run/). + * Valid naming values are displayed in the + * [Ulimit](https://docs.aws.amazon.com/AmazonECS/latest/APIReference/API_Ulimit.html) data type. This parameter + * requires version 1.18 of the Docker Remote API or greater on your container instance. To check the Docker Remote + * API version on your container instance, log in to your container instance and run the following command: ``sudo + * docker version --format '{{.Server.APIVersion}}'`` This parameter is not supported for Windows containers. + */ + private List ulimits; + + /* + * The user to use inside the container. This parameter maps to ``User`` in the [Create a + * container](https://docs.aws.amazon.com/https://docs.docker.com/engine/api/v1.35/#operation/ContainerCreate) + * section of the [Docker Remote API](https://docs.aws.amazon.com/https://docs.docker.com/engine/api/v1.35/) and the + * ``--user`` option to [docker + * run](https://docs.aws.amazon.com/https://docs.docker.com/engine/reference/run/#security-configuration). When + * running tasks using the ``host`` network mode, don't run containers using the root user (UID 0). We recommend + * using a non-root user for better security. You can specify the ``user`` using the following formats. If + * specifying a UID or GID, you must specify it as a positive integer. + ``user`` + ``user:group`` + ``uid`` + + * ``uid:gid`` + ``user:gid`` + ``uid:group`` This parameter is not supported for Windows containers. + */ + private String user; + + /* + * Data volumes to mount from another container. This parameter maps to ``VolumesFrom`` in the [Create a + * container](https://docs.aws.amazon.com/https://docs.docker.com/engine/api/v1.35/#operation/ContainerCreate) + * section of the [Docker Remote API](https://docs.aws.amazon.com/https://docs.docker.com/engine/api/v1.35/) and the + * ``--volumes-from`` option to [docker + * run](https://docs.aws.amazon.com/https://docs.docker.com/engine/reference/run/#security-configuration). + */ + private List volumesFrom; + + /* + * The working directory to run commands inside the container in. This parameter maps to ``WorkingDir`` in the + * [Create a + * container](https://docs.aws.amazon.com/https://docs.docker.com/engine/api/v1.35/#operation/ContainerCreate) + * section of the [Docker Remote API](https://docs.aws.amazon.com/https://docs.docker.com/engine/api/v1.35/) and the + * ``--workdir`` option to [docker + * run](https://docs.aws.amazon.com/https://docs.docker.com/engine/reference/run/#security-configuration). + */ + private String workingDirectory; + + /** + * Creates an instance of ContainerDefinition class. + */ + public ContainerDefinition() { + } + + /** + * Get the command property: The command that's passed to the container. This parameter maps to ``Cmd`` in the + * [Create a + * container](https://docs.aws.amazon.com/https://docs.docker.com/engine/api/v1.35/#operation/ContainerCreate) + * section of the [Docker Remote API](https://docs.aws.amazon.com/https://docs.docker.com/engine/api/v1.35/) and the + * ``COMMAND`` parameter to [docker + * run](https://docs.aws.amazon.com/https://docs.docker.com/engine/reference/run/#security-configuration). For more + * information, see + * [https://docs.docker.com/engine/reference/builder/#cmd](https://docs.aws.amazon.com/https://docs.docker.com/engine/reference/builder/#cmd). + * If there are multiple arguments, each argument is a separated string in the array. + * + * @return the command value. + */ + public List command() { + return this.command; + } + + /** + * Set the command property: The command that's passed to the container. This parameter maps to ``Cmd`` in the + * [Create a + * container](https://docs.aws.amazon.com/https://docs.docker.com/engine/api/v1.35/#operation/ContainerCreate) + * section of the [Docker Remote API](https://docs.aws.amazon.com/https://docs.docker.com/engine/api/v1.35/) and the + * ``COMMAND`` parameter to [docker + * run](https://docs.aws.amazon.com/https://docs.docker.com/engine/reference/run/#security-configuration). For more + * information, see + * [https://docs.docker.com/engine/reference/builder/#cmd](https://docs.aws.amazon.com/https://docs.docker.com/engine/reference/builder/#cmd). + * If there are multiple arguments, each argument is a separated string in the array. + * + * @param command the command value to set. + * @return the ContainerDefinition object itself. + */ + public ContainerDefinition withCommand(List command) { + this.command = command; + return this; + } + + /** + * Get the cpu property: The number of ``cpu`` units reserved for the container. This parameter maps to + * ``CpuShares`` in the [Create a + * container](https://docs.aws.amazon.com/https://docs.docker.com/engine/api/v1.35/#operation/ContainerCreate) + * section of the [Docker Remote API](https://docs.aws.amazon.com/https://docs.docker.com/engine/api/v1.35/) and the + * ``--cpu-shares`` option to [docker + * run](https://docs.aws.amazon.com/https://docs.docker.com/engine/reference/run/#security-configuration). This + * field is optional for tasks using the Fargate launch type, and the only requirement is that the total amount of + * CPU reserved for all containers within a task be lower than the task-level ``cpu`` value. You can determine the + * number of CPU units that are available per EC2 instance type by multiplying the vCPUs listed for that instance + * type on the [Amazon EC2 Instances](https://docs.aws.amazon.com/ec2/instance-types/) detail page by 1,024. Linux + * containers share unallocated CPU units with other containers on the container instance with the same ratio as + * their allocated amount. For example, if you run a single-container task on a single-core instance type with 512 + * CPU units specified for that container, and that's the only task running on the container instance, that + * container could use the full 1,024 CPU unit share at any given time. However, if you launched another copy of the + * same task on that container instance, each task is guaranteed a minimum of 512 CPU units when needed. Moreover, + * each container could float to higher CPU usage if the other container was not using it. If both tasks were 100% + * active all of the time, they would be limited to 512 CPU units. On Linux container instances, the Docker daemon + * on the container instance uses the CPU value to calculate the relative CPU share ratios for running containers. + * For more information, see [CPU share + * constraint](https://docs.aws.amazon.com/https://docs.docker.com/engine/reference/run/#cpu-share-constraint) in + * the Docker documentation. The minimum valid CPU share value that the Linux kernel allows is 2. However, the CPU + * parameter isn't required, and you can use CPU values below 2 in your container definitions. For CPU values below + * 2 (including null), the behavior varies based on your Amazon ECS container agent version: + *Agent versions less + * than or equal to 1.1.0:* Null and zero CPU values are passed to Docker as 0, which Docker then converts to 1,024 + * CPU shares. CPU values of 1 are passed to Docker as 1, which the Linux kernel converts to two CPU shares. + + * *Agent versions greater than or equal to 1.2.0:* Null, zero, and CPU values of 1 are passed to Docker as 2. On + * Windows container instances, the CPU limit is enforced as an absolute limit, or a quota. Windows containers only + * have access to the specified amount of CPU that's described in the task definition. A null or zero CPU value is + * passed to Docker as ``0``, which Windows interprets as 1% of one CPU. + * + * @return the cpu value. + */ + public Integer cpu() { + return this.cpu; + } + + /** + * Set the cpu property: The number of ``cpu`` units reserved for the container. This parameter maps to + * ``CpuShares`` in the [Create a + * container](https://docs.aws.amazon.com/https://docs.docker.com/engine/api/v1.35/#operation/ContainerCreate) + * section of the [Docker Remote API](https://docs.aws.amazon.com/https://docs.docker.com/engine/api/v1.35/) and the + * ``--cpu-shares`` option to [docker + * run](https://docs.aws.amazon.com/https://docs.docker.com/engine/reference/run/#security-configuration). This + * field is optional for tasks using the Fargate launch type, and the only requirement is that the total amount of + * CPU reserved for all containers within a task be lower than the task-level ``cpu`` value. You can determine the + * number of CPU units that are available per EC2 instance type by multiplying the vCPUs listed for that instance + * type on the [Amazon EC2 Instances](https://docs.aws.amazon.com/ec2/instance-types/) detail page by 1,024. Linux + * containers share unallocated CPU units with other containers on the container instance with the same ratio as + * their allocated amount. For example, if you run a single-container task on a single-core instance type with 512 + * CPU units specified for that container, and that's the only task running on the container instance, that + * container could use the full 1,024 CPU unit share at any given time. However, if you launched another copy of the + * same task on that container instance, each task is guaranteed a minimum of 512 CPU units when needed. Moreover, + * each container could float to higher CPU usage if the other container was not using it. If both tasks were 100% + * active all of the time, they would be limited to 512 CPU units. On Linux container instances, the Docker daemon + * on the container instance uses the CPU value to calculate the relative CPU share ratios for running containers. + * For more information, see [CPU share + * constraint](https://docs.aws.amazon.com/https://docs.docker.com/engine/reference/run/#cpu-share-constraint) in + * the Docker documentation. The minimum valid CPU share value that the Linux kernel allows is 2. However, the CPU + * parameter isn't required, and you can use CPU values below 2 in your container definitions. For CPU values below + * 2 (including null), the behavior varies based on your Amazon ECS container agent version: + *Agent versions less + * than or equal to 1.1.0:* Null and zero CPU values are passed to Docker as 0, which Docker then converts to 1,024 + * CPU shares. CPU values of 1 are passed to Docker as 1, which the Linux kernel converts to two CPU shares. + + * *Agent versions greater than or equal to 1.2.0:* Null, zero, and CPU values of 1 are passed to Docker as 2. On + * Windows container instances, the CPU limit is enforced as an absolute limit, or a quota. Windows containers only + * have access to the specified amount of CPU that's described in the task definition. A null or zero CPU value is + * passed to Docker as ``0``, which Windows interprets as 1% of one CPU. + * + * @param cpu the cpu value to set. + * @return the ContainerDefinition object itself. + */ + public ContainerDefinition withCpu(Integer cpu) { + this.cpu = cpu; + return this; + } + + /** + * Get the credentialSpecs property: A list of ARNs in SSM or Amazon S3 to a credential spec (``CredSpec``) file + * that configures the container for Active Directory authentication. We recommend that you use this parameter + * instead of the ``dockerSecurityOptions``. The maximum number of ARNs is 1. There are two formats for each ARN. + + * credentialspecdomainless:MyARN You use credentialspecdomainless:MyARN to provide a CredSpec with an additional + * section for a secret in . You provide the login credentials to the domain in the secret. Each task that runs on + * any container instance can join different domains. You can use this format without joining the container instance + * to a domain. + credentialspec:MyARN You use credentialspec:MyARN to provide a CredSpec for a single domain. You + * must join the container instance to the domain before you start any tasks that use this task definition. In both + * formats, replace ``MyARN`` with the ARN in SSM or Amazon S3. If you provide a ``credentialspecdomainless:MyARN``, + * the ``credspec`` must provide a ARN in ASMlong for a secret containing the username, password, and the domain to + * connect to. For better security, the instance isn't joined to the domain for domainless authentication. Other + * applications on the instance can't use the domainless credentials. You can use this parameter to run tasks on the + * same instance, even it the tasks need to join different domains. For more information, see [Using gMSAs for + * Windows Containers](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/windows-gmsa.html) and [Using + * gMSAs for Linux Containers](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/linux-gmsa.html). + * + * @return the credentialSpecs value. + */ + public List credentialSpecs() { + return this.credentialSpecs; + } + + /** + * Set the credentialSpecs property: A list of ARNs in SSM or Amazon S3 to a credential spec (``CredSpec``) file + * that configures the container for Active Directory authentication. We recommend that you use this parameter + * instead of the ``dockerSecurityOptions``. The maximum number of ARNs is 1. There are two formats for each ARN. + + * credentialspecdomainless:MyARN You use credentialspecdomainless:MyARN to provide a CredSpec with an additional + * section for a secret in . You provide the login credentials to the domain in the secret. Each task that runs on + * any container instance can join different domains. You can use this format without joining the container instance + * to a domain. + credentialspec:MyARN You use credentialspec:MyARN to provide a CredSpec for a single domain. You + * must join the container instance to the domain before you start any tasks that use this task definition. In both + * formats, replace ``MyARN`` with the ARN in SSM or Amazon S3. If you provide a ``credentialspecdomainless:MyARN``, + * the ``credspec`` must provide a ARN in ASMlong for a secret containing the username, password, and the domain to + * connect to. For better security, the instance isn't joined to the domain for domainless authentication. Other + * applications on the instance can't use the domainless credentials. You can use this parameter to run tasks on the + * same instance, even it the tasks need to join different domains. For more information, see [Using gMSAs for + * Windows Containers](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/windows-gmsa.html) and [Using + * gMSAs for Linux Containers](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/linux-gmsa.html). + * + * @param credentialSpecs the credentialSpecs value to set. + * @return the ContainerDefinition object itself. + */ + public ContainerDefinition withCredentialSpecs(List credentialSpecs) { + this.credentialSpecs = credentialSpecs; + return this; + } + + /** + * Get the dependsOn property: The dependencies defined for container startup and shutdown. A container can contain + * multiple dependencies. When a dependency is defined for container startup, for container shutdown it is reversed. + * For tasks using the EC2 launch type, the container instances require at least version 1.26.0 of the container + * agent to turn on container dependencies. However, we recommend using the latest container agent version. For + * information about checking your agent version and updating to the latest version, see [Updating the Amazon ECS + * Container Agent](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/ecs-agent-update.html) in the + * *Amazon Elastic Container Service Developer Guide*. If you're using an Amazon ECS-optimized Linux AMI, your + * instance needs at least version 1.26.0-1 of the ``ecs-init`` package. If your container instances are launched + * from version ``20190301`` or later, then they contain the required versions of the container agent and + * ``ecs-init``. For more information, see [Amazon ECS-optimized Linux + * AMI](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/ecs-optimized_AMI.html) in the *Amazon Elastic + * Container Service Developer Guide*. For tasks using the Fargate launch type, the task or service requires the + * following platforms: + Linux platform version ``1.3.0`` or later. + Windows platform version ``1.0.0`` or later. + * If the task definition is used in a blue/green deployment that uses [AWS::CodeDeploy::DeploymentGroup + * BlueGreenDeploymentConfiguration](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-codedeploy-deploymentgroup-bluegreendeploymentconfiguration.html), + * the ``dependsOn`` parameter is not supported. For more information see [Issue + * #680](https://docs.aws.amazon.com/https://github.com/aws-cloudformation/cloudformation-coverage-roadmap/issues/680) + * on the on the GitHub website. + * + * @return the dependsOn value. + */ + public List dependsOn() { + return this.dependsOn; + } + + /** + * Set the dependsOn property: The dependencies defined for container startup and shutdown. A container can contain + * multiple dependencies. When a dependency is defined for container startup, for container shutdown it is reversed. + * For tasks using the EC2 launch type, the container instances require at least version 1.26.0 of the container + * agent to turn on container dependencies. However, we recommend using the latest container agent version. For + * information about checking your agent version and updating to the latest version, see [Updating the Amazon ECS + * Container Agent](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/ecs-agent-update.html) in the + * *Amazon Elastic Container Service Developer Guide*. If you're using an Amazon ECS-optimized Linux AMI, your + * instance needs at least version 1.26.0-1 of the ``ecs-init`` package. If your container instances are launched + * from version ``20190301`` or later, then they contain the required versions of the container agent and + * ``ecs-init``. For more information, see [Amazon ECS-optimized Linux + * AMI](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/ecs-optimized_AMI.html) in the *Amazon Elastic + * Container Service Developer Guide*. For tasks using the Fargate launch type, the task or service requires the + * following platforms: + Linux platform version ``1.3.0`` or later. + Windows platform version ``1.0.0`` or later. + * If the task definition is used in a blue/green deployment that uses [AWS::CodeDeploy::DeploymentGroup + * BlueGreenDeploymentConfiguration](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-codedeploy-deploymentgroup-bluegreendeploymentconfiguration.html), + * the ``dependsOn`` parameter is not supported. For more information see [Issue + * #680](https://docs.aws.amazon.com/https://github.com/aws-cloudformation/cloudformation-coverage-roadmap/issues/680) + * on the on the GitHub website. + * + * @param dependsOn the dependsOn value to set. + * @return the ContainerDefinition object itself. + */ + public ContainerDefinition withDependsOn(List dependsOn) { + this.dependsOn = dependsOn; + return this; + } + + /** + * Get the disableNetworking property: When this parameter is true, networking is off within the container. This + * parameter maps to ``NetworkDisabled`` in the [Create a + * container](https://docs.aws.amazon.com/https://docs.docker.com/engine/api/v1.35/#operation/ContainerCreate) + * section of the [Docker Remote API](https://docs.aws.amazon.com/https://docs.docker.com/engine/api/v1.35/). This + * parameter is not supported for Windows containers. + * + * @return the disableNetworking value. + */ + public Boolean disableNetworking() { + return this.disableNetworking; + } + + /** + * Set the disableNetworking property: When this parameter is true, networking is off within the container. This + * parameter maps to ``NetworkDisabled`` in the [Create a + * container](https://docs.aws.amazon.com/https://docs.docker.com/engine/api/v1.35/#operation/ContainerCreate) + * section of the [Docker Remote API](https://docs.aws.amazon.com/https://docs.docker.com/engine/api/v1.35/). This + * parameter is not supported for Windows containers. + * + * @param disableNetworking the disableNetworking value to set. + * @return the ContainerDefinition object itself. + */ + public ContainerDefinition withDisableNetworking(Boolean disableNetworking) { + this.disableNetworking = disableNetworking; + return this; + } + + /** + * Get the dnsSearchDomains property: A list of DNS search domains that are presented to the container. This + * parameter maps to ``DnsSearch`` in the [Create a + * container](https://docs.aws.amazon.com/https://docs.docker.com/engine/api/v1.35/#operation/ContainerCreate) + * section of the [Docker Remote API](https://docs.aws.amazon.com/https://docs.docker.com/engine/api/v1.35/) and the + * ``--dns-search`` option to [docker + * run](https://docs.aws.amazon.com/https://docs.docker.com/engine/reference/run/#security-configuration). This + * parameter is not supported for Windows containers. + * + * @return the dnsSearchDomains value. + */ + public List dnsSearchDomains() { + return this.dnsSearchDomains; + } + + /** + * Set the dnsSearchDomains property: A list of DNS search domains that are presented to the container. This + * parameter maps to ``DnsSearch`` in the [Create a + * container](https://docs.aws.amazon.com/https://docs.docker.com/engine/api/v1.35/#operation/ContainerCreate) + * section of the [Docker Remote API](https://docs.aws.amazon.com/https://docs.docker.com/engine/api/v1.35/) and the + * ``--dns-search`` option to [docker + * run](https://docs.aws.amazon.com/https://docs.docker.com/engine/reference/run/#security-configuration). This + * parameter is not supported for Windows containers. + * + * @param dnsSearchDomains the dnsSearchDomains value to set. + * @return the ContainerDefinition object itself. + */ + public ContainerDefinition withDnsSearchDomains(List dnsSearchDomains) { + this.dnsSearchDomains = dnsSearchDomains; + return this; + } + + /** + * Get the dnsServers property: A list of DNS servers that are presented to the container. This parameter maps to + * ``Dns`` in the [Create a + * container](https://docs.aws.amazon.com/https://docs.docker.com/engine/api/v1.35/#operation/ContainerCreate) + * section of the [Docker Remote API](https://docs.aws.amazon.com/https://docs.docker.com/engine/api/v1.35/) and the + * ``--dns`` option to [docker + * run](https://docs.aws.amazon.com/https://docs.docker.com/engine/reference/run/#security-configuration). This + * parameter is not supported for Windows containers. + * + * @return the dnsServers value. + */ + public List dnsServers() { + return this.dnsServers; + } + + /** + * Set the dnsServers property: A list of DNS servers that are presented to the container. This parameter maps to + * ``Dns`` in the [Create a + * container](https://docs.aws.amazon.com/https://docs.docker.com/engine/api/v1.35/#operation/ContainerCreate) + * section of the [Docker Remote API](https://docs.aws.amazon.com/https://docs.docker.com/engine/api/v1.35/) and the + * ``--dns`` option to [docker + * run](https://docs.aws.amazon.com/https://docs.docker.com/engine/reference/run/#security-configuration). This + * parameter is not supported for Windows containers. + * + * @param dnsServers the dnsServers value to set. + * @return the ContainerDefinition object itself. + */ + public ContainerDefinition withDnsServers(List dnsServers) { + this.dnsServers = dnsServers; + return this; + } + + /** + * Get the dockerLabels property: A key/value map of labels to add to the container. This parameter maps to + * ``Labels`` in the [Create a + * container](https://docs.aws.amazon.com/https://docs.docker.com/engine/api/v1.35/#operation/ContainerCreate) + * section of the [Docker Remote API](https://docs.aws.amazon.com/https://docs.docker.com/engine/api/v1.35/) and the + * ``--label`` option to [docker + * run](https://docs.aws.amazon.com/https://docs.docker.com/engine/reference/run/#security-configuration). This + * parameter requires version 1.18 of the Docker Remote API or greater on your container instance. To check the + * Docker Remote API version on your container instance, log in to your container instance and run the following + * command: ``sudo docker version --format '{{.Server.APIVersion}}'``. + * + * @return the dockerLabels value. + */ + public Object dockerLabels() { + return this.dockerLabels; + } + + /** + * Set the dockerLabels property: A key/value map of labels to add to the container. This parameter maps to + * ``Labels`` in the [Create a + * container](https://docs.aws.amazon.com/https://docs.docker.com/engine/api/v1.35/#operation/ContainerCreate) + * section of the [Docker Remote API](https://docs.aws.amazon.com/https://docs.docker.com/engine/api/v1.35/) and the + * ``--label`` option to [docker + * run](https://docs.aws.amazon.com/https://docs.docker.com/engine/reference/run/#security-configuration). This + * parameter requires version 1.18 of the Docker Remote API or greater on your container instance. To check the + * Docker Remote API version on your container instance, log in to your container instance and run the following + * command: ``sudo docker version --format '{{.Server.APIVersion}}'``. + * + * @param dockerLabels the dockerLabels value to set. + * @return the ContainerDefinition object itself. + */ + public ContainerDefinition withDockerLabels(Object dockerLabels) { + this.dockerLabels = dockerLabels; + return this; + } + + /** + * Get the dockerSecurityOptions property: A list of strings to provide custom configuration for multiple security + * systems. For more information about valid values, see [Docker Run Security + * Configuration](https://docs.aws.amazon.com/https://docs.docker.com/engine/reference/run/#security-configuration). + * This field isn't valid for containers in tasks using the Fargate launch type. For Linux tasks on EC2, this + * parameter can be used to reference custom labels for SELinux and AppArmor multi-level security systems. For any + * tasks on EC2, this parameter can be used to reference a credential spec file that configures a container for + * Active Directory authentication. For more information, see [Using gMSAs for Windows + * Containers](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/windows-gmsa.html) and [Using gMSAs for + * Linux Containers](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/linux-gmsa.html) in the *Amazon + * Elastic Container Service Developer Guide*. This parameter maps to ``SecurityOpt`` in the [Create a + * container](https://docs.aws.amazon.com/https://docs.docker.com/engine/api/v1.35/#operation/ContainerCreate) + * section of the [Docker Remote API](https://docs.aws.amazon.com/https://docs.docker.com/engine/api/v1.35/) and the + * ``--security-opt`` option to [docker + * run](https://docs.aws.amazon.com/https://docs.docker.com/engine/reference/run/#security-configuration). The + * Amazon ECS container agent running on a container instance must register with the ``ECS_SELINUX_CAPABLE=true`` or + * ``ECS_APPARMOR_CAPABLE=true`` environment variables before containers placed on that instance can use these + * security options. For more information, see [Amazon ECS Container Agent + * Configuration](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/ecs-agent-config.html) in the *Amazon + * Elastic Container Service Developer Guide*. For more information about valid values, see [Docker Run Security + * Configuration](https://docs.aws.amazon.com/https://docs.docker.com/engine/reference/run/#security-configuration). + * Valid values: 'no-new-privileges' | 'apparmor:PROFILE' | 'label:value' | 'credentialspec:CredentialSpecFilePath'. + * + * @return the dockerSecurityOptions value. + */ + public List dockerSecurityOptions() { + return this.dockerSecurityOptions; + } + + /** + * Set the dockerSecurityOptions property: A list of strings to provide custom configuration for multiple security + * systems. For more information about valid values, see [Docker Run Security + * Configuration](https://docs.aws.amazon.com/https://docs.docker.com/engine/reference/run/#security-configuration). + * This field isn't valid for containers in tasks using the Fargate launch type. For Linux tasks on EC2, this + * parameter can be used to reference custom labels for SELinux and AppArmor multi-level security systems. For any + * tasks on EC2, this parameter can be used to reference a credential spec file that configures a container for + * Active Directory authentication. For more information, see [Using gMSAs for Windows + * Containers](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/windows-gmsa.html) and [Using gMSAs for + * Linux Containers](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/linux-gmsa.html) in the *Amazon + * Elastic Container Service Developer Guide*. This parameter maps to ``SecurityOpt`` in the [Create a + * container](https://docs.aws.amazon.com/https://docs.docker.com/engine/api/v1.35/#operation/ContainerCreate) + * section of the [Docker Remote API](https://docs.aws.amazon.com/https://docs.docker.com/engine/api/v1.35/) and the + * ``--security-opt`` option to [docker + * run](https://docs.aws.amazon.com/https://docs.docker.com/engine/reference/run/#security-configuration). The + * Amazon ECS container agent running on a container instance must register with the ``ECS_SELINUX_CAPABLE=true`` or + * ``ECS_APPARMOR_CAPABLE=true`` environment variables before containers placed on that instance can use these + * security options. For more information, see [Amazon ECS Container Agent + * Configuration](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/ecs-agent-config.html) in the *Amazon + * Elastic Container Service Developer Guide*. For more information about valid values, see [Docker Run Security + * Configuration](https://docs.aws.amazon.com/https://docs.docker.com/engine/reference/run/#security-configuration). + * Valid values: 'no-new-privileges' | 'apparmor:PROFILE' | 'label:value' | 'credentialspec:CredentialSpecFilePath'. + * + * @param dockerSecurityOptions the dockerSecurityOptions value to set. + * @return the ContainerDefinition object itself. + */ + public ContainerDefinition withDockerSecurityOptions(List dockerSecurityOptions) { + this.dockerSecurityOptions = dockerSecurityOptions; + return this; + } + + /** + * Get the entryPoint property: Early versions of the Amazon ECS container agent don't properly handle + * ``entryPoint`` parameters. If you have problems using ``entryPoint``, update your container agent or enter your + * commands and arguments as ``command`` array items instead. The entry point that's passed to the container. This + * parameter maps to ``Entrypoint`` in the [Create a + * container](https://docs.aws.amazon.com/https://docs.docker.com/engine/api/v1.35/#operation/ContainerCreate) + * section of the [Docker Remote API](https://docs.aws.amazon.com/https://docs.docker.com/engine/api/v1.35/) and the + * ``--entrypoint`` option to [docker + * run](https://docs.aws.amazon.com/https://docs.docker.com/engine/reference/run/#security-configuration). For more + * information, see + * [https://docs.docker.com/engine/reference/builder/#entrypoint](https://docs.aws.amazon.com/https://docs.docker.com/engine/reference/builder/#entrypoint). + * + * @return the entryPoint value. + */ + public List entryPoint() { + return this.entryPoint; + } + + /** + * Set the entryPoint property: Early versions of the Amazon ECS container agent don't properly handle + * ``entryPoint`` parameters. If you have problems using ``entryPoint``, update your container agent or enter your + * commands and arguments as ``command`` array items instead. The entry point that's passed to the container. This + * parameter maps to ``Entrypoint`` in the [Create a + * container](https://docs.aws.amazon.com/https://docs.docker.com/engine/api/v1.35/#operation/ContainerCreate) + * section of the [Docker Remote API](https://docs.aws.amazon.com/https://docs.docker.com/engine/api/v1.35/) and the + * ``--entrypoint`` option to [docker + * run](https://docs.aws.amazon.com/https://docs.docker.com/engine/reference/run/#security-configuration). For more + * information, see + * [https://docs.docker.com/engine/reference/builder/#entrypoint](https://docs.aws.amazon.com/https://docs.docker.com/engine/reference/builder/#entrypoint). + * + * @param entryPoint the entryPoint value to set. + * @return the ContainerDefinition object itself. + */ + public ContainerDefinition withEntryPoint(List entryPoint) { + this.entryPoint = entryPoint; + return this; + } + + /** + * Get the environment property: The environment variables to pass to a container. This parameter maps to ``Env`` in + * the [Create a + * container](https://docs.aws.amazon.com/https://docs.docker.com/engine/api/v1.35/#operation/ContainerCreate) + * section of the [Docker Remote API](https://docs.aws.amazon.com/https://docs.docker.com/engine/api/v1.35/) and the + * ``--env`` option to [docker + * run](https://docs.aws.amazon.com/https://docs.docker.com/engine/reference/run/#security-configuration). We don't + * recommend that you use plaintext environment variables for sensitive information, such as credential data. + * + * @return the environment value. + */ + public List environment() { + return this.environment; + } + + /** + * Set the environment property: The environment variables to pass to a container. This parameter maps to ``Env`` in + * the [Create a + * container](https://docs.aws.amazon.com/https://docs.docker.com/engine/api/v1.35/#operation/ContainerCreate) + * section of the [Docker Remote API](https://docs.aws.amazon.com/https://docs.docker.com/engine/api/v1.35/) and the + * ``--env`` option to [docker + * run](https://docs.aws.amazon.com/https://docs.docker.com/engine/reference/run/#security-configuration). We don't + * recommend that you use plaintext environment variables for sensitive information, such as credential data. + * + * @param environment the environment value to set. + * @return the ContainerDefinition object itself. + */ + public ContainerDefinition withEnvironment(List environment) { + this.environment = environment; + return this; + } + + /** + * Get the environmentFiles property: A list of files containing the environment variables to pass to a container. + * This parameter maps to the ``--env-file`` option to [docker + * run](https://docs.aws.amazon.com/https://docs.docker.com/engine/reference/run/#security-configuration). You can + * specify up to ten environment files. The file must have a ``.env`` file extension. Each line in an environment + * file contains an environment variable in ``VARIABLE=VALUE`` format. Lines beginning with ``#`` are treated as + * comments and are ignored. For more information about the environment variable file syntax, see [Declare default + * environment variables in file](https://docs.aws.amazon.com/https://docs.docker.com/compose/env-file/). If there + * are environment variables specified using the ``environment`` parameter in a container definition, they take + * precedence over the variables contained within an environment file. If multiple environment files are specified + * that contain the same variable, they're processed from the top down. We recommend that you use unique variable + * names. For more information, see [Specifying Environment + * Variables](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/taskdef-envfiles.html) in the *Amazon + * Elastic Container Service Developer Guide*. + * + * @return the environmentFiles value. + */ + public List environmentFiles() { + return this.environmentFiles; + } + + /** + * Set the environmentFiles property: A list of files containing the environment variables to pass to a container. + * This parameter maps to the ``--env-file`` option to [docker + * run](https://docs.aws.amazon.com/https://docs.docker.com/engine/reference/run/#security-configuration). You can + * specify up to ten environment files. The file must have a ``.env`` file extension. Each line in an environment + * file contains an environment variable in ``VARIABLE=VALUE`` format. Lines beginning with ``#`` are treated as + * comments and are ignored. For more information about the environment variable file syntax, see [Declare default + * environment variables in file](https://docs.aws.amazon.com/https://docs.docker.com/compose/env-file/). If there + * are environment variables specified using the ``environment`` parameter in a container definition, they take + * precedence over the variables contained within an environment file. If multiple environment files are specified + * that contain the same variable, they're processed from the top down. We recommend that you use unique variable + * names. For more information, see [Specifying Environment + * Variables](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/taskdef-envfiles.html) in the *Amazon + * Elastic Container Service Developer Guide*. + * + * @param environmentFiles the environmentFiles value to set. + * @return the ContainerDefinition object itself. + */ + public ContainerDefinition withEnvironmentFiles(List environmentFiles) { + this.environmentFiles = environmentFiles; + return this; + } + + /** + * Get the essential property: If the ``essential`` parameter of a container is marked as ``true``, and that + * container fails or stops for any reason, all other containers that are part of the task are stopped. If the + * ``essential`` parameter of a container is marked as ``false``, its failure doesn't affect the rest of the + * containers in a task. If this parameter is omitted, a container is assumed to be essential. All tasks must have + * at least one essential container. If you have an application that's composed of multiple containers, group + * containers that are used for a common purpose into components, and separate the different components into + * multiple task definitions. For more information, see [Application + * Architecture](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/application_architecture.html) in the + * *Amazon Elastic Container Service Developer Guide*. + * + * @return the essential value. + */ + public Boolean essential() { + return this.essential; + } + + /** + * Set the essential property: If the ``essential`` parameter of a container is marked as ``true``, and that + * container fails or stops for any reason, all other containers that are part of the task are stopped. If the + * ``essential`` parameter of a container is marked as ``false``, its failure doesn't affect the rest of the + * containers in a task. If this parameter is omitted, a container is assumed to be essential. All tasks must have + * at least one essential container. If you have an application that's composed of multiple containers, group + * containers that are used for a common purpose into components, and separate the different components into + * multiple task definitions. For more information, see [Application + * Architecture](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/application_architecture.html) in the + * *Amazon Elastic Container Service Developer Guide*. + * + * @param essential the essential value to set. + * @return the ContainerDefinition object itself. + */ + public ContainerDefinition withEssential(Boolean essential) { + this.essential = essential; + return this; + } + + /** + * Get the extraHosts property: A list of hostnames and IP address mappings to append to the ``/etc/hosts`` file on + * the container. This parameter maps to ``ExtraHosts`` in the [Create a + * container](https://docs.aws.amazon.com/https://docs.docker.com/engine/api/v1.35/#operation/ContainerCreate) + * section of the [Docker Remote API](https://docs.aws.amazon.com/https://docs.docker.com/engine/api/v1.35/) and the + * ``--add-host`` option to [docker + * run](https://docs.aws.amazon.com/https://docs.docker.com/engine/reference/run/#security-configuration). This + * parameter isn't supported for Windows containers or tasks that use the ``awsvpc`` network mode. + * + * @return the extraHosts value. + */ + public List extraHosts() { + return this.extraHosts; + } + + /** + * Set the extraHosts property: A list of hostnames and IP address mappings to append to the ``/etc/hosts`` file on + * the container. This parameter maps to ``ExtraHosts`` in the [Create a + * container](https://docs.aws.amazon.com/https://docs.docker.com/engine/api/v1.35/#operation/ContainerCreate) + * section of the [Docker Remote API](https://docs.aws.amazon.com/https://docs.docker.com/engine/api/v1.35/) and the + * ``--add-host`` option to [docker + * run](https://docs.aws.amazon.com/https://docs.docker.com/engine/reference/run/#security-configuration). This + * parameter isn't supported for Windows containers or tasks that use the ``awsvpc`` network mode. + * + * @param extraHosts the extraHosts value to set. + * @return the ContainerDefinition object itself. + */ + public ContainerDefinition withExtraHosts(List extraHosts) { + this.extraHosts = extraHosts; + return this; + } + + /** + * Get the firelensConfiguration property: The FireLens configuration for the container. This is used to specify and + * configure a log router for container logs. For more information, see [Custom Log + * Routing](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/using_firelens.html) in the *Amazon Elastic + * Container Service Developer Guide*. The FireLens configuration for the container. This is used to specify and + * configure a log router for container logs. For more information, see [Custom log + * routing](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/using_firelens.html) in the *Amazon Elastic + * Container Service Developer Guide*. + * + * @return the firelensConfiguration value. + */ + public FirelensConfiguration firelensConfiguration() { + return this.firelensConfiguration; + } + + /** + * Set the firelensConfiguration property: The FireLens configuration for the container. This is used to specify and + * configure a log router for container logs. For more information, see [Custom Log + * Routing](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/using_firelens.html) in the *Amazon Elastic + * Container Service Developer Guide*. The FireLens configuration for the container. This is used to specify and + * configure a log router for container logs. For more information, see [Custom log + * routing](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/using_firelens.html) in the *Amazon Elastic + * Container Service Developer Guide*. + * + * @param firelensConfiguration the firelensConfiguration value to set. + * @return the ContainerDefinition object itself. + */ + public ContainerDefinition withFirelensConfiguration(FirelensConfiguration firelensConfiguration) { + this.firelensConfiguration = firelensConfiguration; + return this; + } + + /** + * Get the healthCheck property: The container health check command and associated configuration parameters for the + * container. This parameter maps to ``HealthCheck`` in the [Create a + * container](https://docs.aws.amazon.com/https://docs.docker.com/engine/api/v1.35/#operation/ContainerCreate) + * section of the [Docker Remote API](https://docs.aws.amazon.com/https://docs.docker.com/engine/api/v1.35/) and the + * ``HEALTHCHECK`` parameter of [docker + * run](https://docs.aws.amazon.com/https://docs.docker.com/engine/reference/run/#security-configuration). The + * ``HealthCheck`` property specifies an object representing a container health check. Health check parameters that + * are specified in a container definition override any Docker health checks that exist in the container image (such + * as those specified in a parent image or from the image's Dockerfile). This configuration maps to the + * ``HEALTHCHECK`` parameter of [docker + * run](https://docs.aws.amazon.com/https://docs.docker.com/engine/reference/run/). The Amazon ECS container agent + * only monitors and reports on the health checks specified in the task definition. Amazon ECS does not monitor + * Docker health checks that are embedded in a container image and not specified in the container definition. Health + * check parameters that are specified in a container definition override any Docker health checks that exist in the + * container image. If a task is run manually, and not as part of a service, the task will continue its lifecycle + * regardless of its health status. For tasks that are part of a service, if the task reports as unhealthy then the + * task will be stopped and the service scheduler will replace it. The following are notes about container health + * check support: + Container health checks require version 1.17.0 or greater of the Amazon ECS container agent. For + * more information, see [Updating the Amazon ECS Container + * Agent](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/ecs-agent-update.html). + Container health + * checks are supported for Fargate tasks if you are using platform version 1.1.0 or greater. For more information, + * see [Platform Versions](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/platform_versions.html). + + * Container health checks are not supported for tasks that are part of a service that is configured to use a + * Classic Load Balancer. + * + * @return the healthCheck value. + */ + public HealthCheck healthCheck() { + return this.healthCheck; + } + + /** + * Set the healthCheck property: The container health check command and associated configuration parameters for the + * container. This parameter maps to ``HealthCheck`` in the [Create a + * container](https://docs.aws.amazon.com/https://docs.docker.com/engine/api/v1.35/#operation/ContainerCreate) + * section of the [Docker Remote API](https://docs.aws.amazon.com/https://docs.docker.com/engine/api/v1.35/) and the + * ``HEALTHCHECK`` parameter of [docker + * run](https://docs.aws.amazon.com/https://docs.docker.com/engine/reference/run/#security-configuration). The + * ``HealthCheck`` property specifies an object representing a container health check. Health check parameters that + * are specified in a container definition override any Docker health checks that exist in the container image (such + * as those specified in a parent image or from the image's Dockerfile). This configuration maps to the + * ``HEALTHCHECK`` parameter of [docker + * run](https://docs.aws.amazon.com/https://docs.docker.com/engine/reference/run/). The Amazon ECS container agent + * only monitors and reports on the health checks specified in the task definition. Amazon ECS does not monitor + * Docker health checks that are embedded in a container image and not specified in the container definition. Health + * check parameters that are specified in a container definition override any Docker health checks that exist in the + * container image. If a task is run manually, and not as part of a service, the task will continue its lifecycle + * regardless of its health status. For tasks that are part of a service, if the task reports as unhealthy then the + * task will be stopped and the service scheduler will replace it. The following are notes about container health + * check support: + Container health checks require version 1.17.0 or greater of the Amazon ECS container agent. For + * more information, see [Updating the Amazon ECS Container + * Agent](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/ecs-agent-update.html). + Container health + * checks are supported for Fargate tasks if you are using platform version 1.1.0 or greater. For more information, + * see [Platform Versions](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/platform_versions.html). + + * Container health checks are not supported for tasks that are part of a service that is configured to use a + * Classic Load Balancer. + * + * @param healthCheck the healthCheck value to set. + * @return the ContainerDefinition object itself. + */ + public ContainerDefinition withHealthCheck(HealthCheck healthCheck) { + this.healthCheck = healthCheck; + return this; + } + + /** + * Get the hostname property: The hostname to use for your container. This parameter maps to ``Hostname`` in the + * [Create a + * container](https://docs.aws.amazon.com/https://docs.docker.com/engine/api/v1.35/#operation/ContainerCreate) + * section of the [Docker Remote API](https://docs.aws.amazon.com/https://docs.docker.com/engine/api/v1.35/) and the + * ``--hostname`` option to [docker + * run](https://docs.aws.amazon.com/https://docs.docker.com/engine/reference/run/#security-configuration). The + * ``hostname`` parameter is not supported if you're using the ``awsvpc`` network mode. + * + * @return the hostname value. + */ + public String hostname() { + return this.hostname; + } + + /** + * Set the hostname property: The hostname to use for your container. This parameter maps to ``Hostname`` in the + * [Create a + * container](https://docs.aws.amazon.com/https://docs.docker.com/engine/api/v1.35/#operation/ContainerCreate) + * section of the [Docker Remote API](https://docs.aws.amazon.com/https://docs.docker.com/engine/api/v1.35/) and the + * ``--hostname`` option to [docker + * run](https://docs.aws.amazon.com/https://docs.docker.com/engine/reference/run/#security-configuration). The + * ``hostname`` parameter is not supported if you're using the ``awsvpc`` network mode. + * + * @param hostname the hostname value to set. + * @return the ContainerDefinition object itself. + */ + public ContainerDefinition withHostname(String hostname) { + this.hostname = hostname; + return this; + } + + /** + * Get the image property: The image used to start a container. This string is passed directly to the Docker daemon. + * By default, images in the Docker Hub registry are available. Other repositories are specified with either + * ``repository-url/image:tag`` or ``repository-url/image@digest``. Up to 255 letters (uppercase and + * lowercase), numbers, hyphens, underscores, colons, periods, forward slashes, and number signs are allowed. This + * parameter maps to ``Image`` in the [Create a + * container](https://docs.aws.amazon.com/https://docs.docker.com/engine/api/v1.35/#operation/ContainerCreate) + * section of the [Docker Remote API](https://docs.aws.amazon.com/https://docs.docker.com/engine/api/v1.35/) and the + * ``IMAGE`` parameter of [docker + * run](https://docs.aws.amazon.com/https://docs.docker.com/engine/reference/run/#security-configuration). + When a + * new task starts, the Amazon ECS container agent pulls the latest version of the specified image and tag for the + * container to use. However, subsequent updates to a repository image aren't propagated to already running tasks. + + * Images in Amazon ECR repositories can be specified by either using the full ``registry/repository:tag`` or + * ``registry/repository@digest``. For example, + * ``012345678910.dkr.ecr.<region-name>.amazonaws.com/<repository-name>:latest`` or + * ``012345678910.dkr.ecr.<region-name>.amazonaws.com/<repository-name>@sha256:94afd1f2e64d908bc90dbca0035a5b567EXAMPLE``. + * + Images in official repositories on Docker Hub use a single name (for example, ``ubuntu`` or ``mongo``). + + * Images in other repositories on Docker Hub are qualified with an organization name (for example, + * ``amazon/amazon-ecs-agent``). + Images in other online repositories are qualified further by a domain name (for + * example, ``quay.io/assemblyline/ubuntu``). + * + * @return the image value. + */ + public String image() { + return this.image; + } + + /** + * Set the image property: The image used to start a container. This string is passed directly to the Docker daemon. + * By default, images in the Docker Hub registry are available. Other repositories are specified with either + * ``repository-url/image:tag`` or ``repository-url/image@digest``. Up to 255 letters (uppercase and + * lowercase), numbers, hyphens, underscores, colons, periods, forward slashes, and number signs are allowed. This + * parameter maps to ``Image`` in the [Create a + * container](https://docs.aws.amazon.com/https://docs.docker.com/engine/api/v1.35/#operation/ContainerCreate) + * section of the [Docker Remote API](https://docs.aws.amazon.com/https://docs.docker.com/engine/api/v1.35/) and the + * ``IMAGE`` parameter of [docker + * run](https://docs.aws.amazon.com/https://docs.docker.com/engine/reference/run/#security-configuration). + When a + * new task starts, the Amazon ECS container agent pulls the latest version of the specified image and tag for the + * container to use. However, subsequent updates to a repository image aren't propagated to already running tasks. + + * Images in Amazon ECR repositories can be specified by either using the full ``registry/repository:tag`` or + * ``registry/repository@digest``. For example, + * ``012345678910.dkr.ecr.<region-name>.amazonaws.com/<repository-name>:latest`` or + * ``012345678910.dkr.ecr.<region-name>.amazonaws.com/<repository-name>@sha256:94afd1f2e64d908bc90dbca0035a5b567EXAMPLE``. + * + Images in official repositories on Docker Hub use a single name (for example, ``ubuntu`` or ``mongo``). + + * Images in other repositories on Docker Hub are qualified with an organization name (for example, + * ``amazon/amazon-ecs-agent``). + Images in other online repositories are qualified further by a domain name (for + * example, ``quay.io/assemblyline/ubuntu``). + * + * @param image the image value to set. + * @return the ContainerDefinition object itself. + */ + public ContainerDefinition withImage(String image) { + this.image = image; + return this; + } + + /** + * Get the interactive property: When this parameter is ``true``, you can deploy containerized applications that + * require ``stdin`` or a ``tty`` to be allocated. This parameter maps to ``OpenStdin`` in the [Create a + * container](https://docs.aws.amazon.com/https://docs.docker.com/engine/api/v1.35/#operation/ContainerCreate) + * section of the [Docker Remote API](https://docs.aws.amazon.com/https://docs.docker.com/engine/api/v1.35/) and the + * ``--interactive`` option to [docker + * run](https://docs.aws.amazon.com/https://docs.docker.com/engine/reference/run/#security-configuration). + * + * @return the interactive value. + */ + public Boolean interactive() { + return this.interactive; + } + + /** + * Set the interactive property: When this parameter is ``true``, you can deploy containerized applications that + * require ``stdin`` or a ``tty`` to be allocated. This parameter maps to ``OpenStdin`` in the [Create a + * container](https://docs.aws.amazon.com/https://docs.docker.com/engine/api/v1.35/#operation/ContainerCreate) + * section of the [Docker Remote API](https://docs.aws.amazon.com/https://docs.docker.com/engine/api/v1.35/) and the + * ``--interactive`` option to [docker + * run](https://docs.aws.amazon.com/https://docs.docker.com/engine/reference/run/#security-configuration). + * + * @param interactive the interactive value to set. + * @return the ContainerDefinition object itself. + */ + public ContainerDefinition withInteractive(Boolean interactive) { + this.interactive = interactive; + return this; + } + + /** + * Get the links property: The ``links`` parameter allows containers to communicate with each other without the need + * for port mappings. This parameter is only supported if the network mode of a task definition is ``bridge``. The + * ``name:internalName`` construct is analogous to ``name:alias`` in Docker links. Up to 255 letters (uppercase and + * lowercase), numbers, underscores, and hyphens are allowed. For more information about linking Docker containers, + * go to [Legacy container links](https://docs.aws.amazon.com/https://docs.docker.com/network/links/) in the Docker + * documentation. This parameter maps to ``Links`` in the [Create a + * container](https://docs.aws.amazon.com/https://docs.docker.com/engine/api/v1.35/#operation/ContainerCreate) + * section of the [Docker Remote API](https://docs.aws.amazon.com/https://docs.docker.com/engine/api/v1.35/) and the + * ``--link`` option to [docker + * run](https://docs.aws.amazon.com/https://docs.docker.com/engine/reference/run/#security-configuration). This + * parameter is not supported for Windows containers. Containers that are collocated on a single container instance + * may be able to communicate with each other without requiring links or host port mappings. Network isolation is + * achieved on the container instance using security groups and VPC settings. + * + * @return the links value. + */ + public List links() { + return this.links; + } + + /** + * Set the links property: The ``links`` parameter allows containers to communicate with each other without the need + * for port mappings. This parameter is only supported if the network mode of a task definition is ``bridge``. The + * ``name:internalName`` construct is analogous to ``name:alias`` in Docker links. Up to 255 letters (uppercase and + * lowercase), numbers, underscores, and hyphens are allowed. For more information about linking Docker containers, + * go to [Legacy container links](https://docs.aws.amazon.com/https://docs.docker.com/network/links/) in the Docker + * documentation. This parameter maps to ``Links`` in the [Create a + * container](https://docs.aws.amazon.com/https://docs.docker.com/engine/api/v1.35/#operation/ContainerCreate) + * section of the [Docker Remote API](https://docs.aws.amazon.com/https://docs.docker.com/engine/api/v1.35/) and the + * ``--link`` option to [docker + * run](https://docs.aws.amazon.com/https://docs.docker.com/engine/reference/run/#security-configuration). This + * parameter is not supported for Windows containers. Containers that are collocated on a single container instance + * may be able to communicate with each other without requiring links or host port mappings. Network isolation is + * achieved on the container instance using security groups and VPC settings. + * + * @param links the links value to set. + * @return the ContainerDefinition object itself. + */ + public ContainerDefinition withLinks(List links) { + this.links = links; + return this; + } + + /** + * Get the linuxParameters property: Linux-specific modifications that are applied to the container, such as Linux + * kernel capabilities. For more information see + * [KernelCapabilities](https://docs.aws.amazon.com/AmazonECS/latest/APIReference/API_KernelCapabilities.html). This + * parameter is not supported for Windows containers. The Linux-specific options that are applied to the container, + * such as Linux + * [KernelCapabilities](https://docs.aws.amazon.com/AmazonECS/latest/APIReference/API_KernelCapabilities.html). + * + * @return the linuxParameters value. + */ + public LinuxParameters linuxParameters() { + return this.linuxParameters; + } + + /** + * Set the linuxParameters property: Linux-specific modifications that are applied to the container, such as Linux + * kernel capabilities. For more information see + * [KernelCapabilities](https://docs.aws.amazon.com/AmazonECS/latest/APIReference/API_KernelCapabilities.html). This + * parameter is not supported for Windows containers. The Linux-specific options that are applied to the container, + * such as Linux + * [KernelCapabilities](https://docs.aws.amazon.com/AmazonECS/latest/APIReference/API_KernelCapabilities.html). + * + * @param linuxParameters the linuxParameters value to set. + * @return the ContainerDefinition object itself. + */ + public ContainerDefinition withLinuxParameters(LinuxParameters linuxParameters) { + this.linuxParameters = linuxParameters; + return this; + } + + /** + * Get the logConfiguration property: The log configuration specification for the container. This parameter maps to + * ``LogConfig`` in the [Create a + * container](https://docs.aws.amazon.com/https://docs.docker.com/engine/api/v1.35/#operation/ContainerCreate) + * section of the [Docker Remote API](https://docs.aws.amazon.com/https://docs.docker.com/engine/api/v1.35/) and the + * ``--log-driver`` option to [docker + * run](https://docs.aws.amazon.com/https://docs.docker.com/engine/reference/run/). By default, containers use the + * same logging driver that the Docker daemon uses. However, the container may use a different logging driver than + * the Docker daemon by specifying a log driver with this parameter in the container definition. To use a different + * logging driver for a container, the log system must be configured properly on the container instance (or on a + * different log server for remote logging options). For more information on the options for different supported log + * drivers, see [Configure logging + * drivers](https://docs.aws.amazon.com/https://docs.docker.com/engine/admin/logging/overview/) in the Docker + * documentation. Amazon ECS currently supports a subset of the logging drivers available to the Docker daemon + * (shown in the + * [LogConfiguration](https://docs.aws.amazon.com/AmazonECS/latest/APIReference/API_LogConfiguration.html) data + * type). Additional log drivers may be available in future releases of the Amazon ECS container agent. This + * parameter requires version 1.18 of the Docker Remote API or greater on your container instance. To check the + * Docker Remote API version on your container instance, log in to your container instance and run the following + * command: ``sudo docker version --format '{{.Server.APIVersion}}'`` The Amazon ECS container agent running on a + * container instance must register the logging drivers available on that instance with the + * ``ECS_AVAILABLE_LOGGING_DRIVERS`` environment variable before containers placed on that instance can use these + * log configuration options. For more information, see [Amazon ECS Container Agent + * Configuration](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/ecs-agent-config.html) in the *Amazon + * Elastic Container Service Developer Guide*. The ``LogConfiguration`` property specifies log configuration options + * to send to a custom log driver for the container. + * + * @return the logConfiguration value. + */ + public LogConfiguration logConfiguration() { + return this.logConfiguration; + } + + /** + * Set the logConfiguration property: The log configuration specification for the container. This parameter maps to + * ``LogConfig`` in the [Create a + * container](https://docs.aws.amazon.com/https://docs.docker.com/engine/api/v1.35/#operation/ContainerCreate) + * section of the [Docker Remote API](https://docs.aws.amazon.com/https://docs.docker.com/engine/api/v1.35/) and the + * ``--log-driver`` option to [docker + * run](https://docs.aws.amazon.com/https://docs.docker.com/engine/reference/run/). By default, containers use the + * same logging driver that the Docker daemon uses. However, the container may use a different logging driver than + * the Docker daemon by specifying a log driver with this parameter in the container definition. To use a different + * logging driver for a container, the log system must be configured properly on the container instance (or on a + * different log server for remote logging options). For more information on the options for different supported log + * drivers, see [Configure logging + * drivers](https://docs.aws.amazon.com/https://docs.docker.com/engine/admin/logging/overview/) in the Docker + * documentation. Amazon ECS currently supports a subset of the logging drivers available to the Docker daemon + * (shown in the + * [LogConfiguration](https://docs.aws.amazon.com/AmazonECS/latest/APIReference/API_LogConfiguration.html) data + * type). Additional log drivers may be available in future releases of the Amazon ECS container agent. This + * parameter requires version 1.18 of the Docker Remote API or greater on your container instance. To check the + * Docker Remote API version on your container instance, log in to your container instance and run the following + * command: ``sudo docker version --format '{{.Server.APIVersion}}'`` The Amazon ECS container agent running on a + * container instance must register the logging drivers available on that instance with the + * ``ECS_AVAILABLE_LOGGING_DRIVERS`` environment variable before containers placed on that instance can use these + * log configuration options. For more information, see [Amazon ECS Container Agent + * Configuration](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/ecs-agent-config.html) in the *Amazon + * Elastic Container Service Developer Guide*. The ``LogConfiguration`` property specifies log configuration options + * to send to a custom log driver for the container. + * + * @param logConfiguration the logConfiguration value to set. + * @return the ContainerDefinition object itself. + */ + public ContainerDefinition withLogConfiguration(LogConfiguration logConfiguration) { + this.logConfiguration = logConfiguration; + return this; + } + + /** + * Get the memory property: The amount (in MiB) of memory to present to the container. If your container attempts to + * exceed the memory specified here, the container is killed. The total amount of memory reserved for all containers + * within a task must be lower than the task ``memory`` value, if one is specified. This parameter maps to + * ``Memory`` in the [Create a + * container](https://docs.aws.amazon.com/https://docs.docker.com/engine/api/v1.35/#operation/ContainerCreate) + * section of the [Docker Remote API](https://docs.aws.amazon.com/https://docs.docker.com/engine/api/v1.35/) and the + * ``--memory`` option to [docker + * run](https://docs.aws.amazon.com/https://docs.docker.com/engine/reference/run/#security-configuration). If using + * the Fargate launch type, this parameter is optional. If using the EC2 launch type, you must specify either a + * task-level memory value or a container-level memory value. If you specify both a container-level ``memory`` and + * ``memoryReservation`` value, ``memory`` must be greater than ``memoryReservation``. If you specify + * ``memoryReservation``, then that value is subtracted from the available memory resources for the container + * instance where the container is placed. Otherwise, the value of ``memory`` is used. The Docker 20.10.0 or later + * daemon reserves a minimum of 6 MiB of memory for a container, so you should not specify fewer than 6 MiB of + * memory for your containers. The Docker 19.03.13-ce or earlier daemon reserves a minimum of 4 MiB of memory for a + * container, so you should not specify fewer than 4 MiB of memory for your containers. + * + * @return the memory value. + */ + public Integer memory() { + return this.memory; + } + + /** + * Set the memory property: The amount (in MiB) of memory to present to the container. If your container attempts to + * exceed the memory specified here, the container is killed. The total amount of memory reserved for all containers + * within a task must be lower than the task ``memory`` value, if one is specified. This parameter maps to + * ``Memory`` in the [Create a + * container](https://docs.aws.amazon.com/https://docs.docker.com/engine/api/v1.35/#operation/ContainerCreate) + * section of the [Docker Remote API](https://docs.aws.amazon.com/https://docs.docker.com/engine/api/v1.35/) and the + * ``--memory`` option to [docker + * run](https://docs.aws.amazon.com/https://docs.docker.com/engine/reference/run/#security-configuration). If using + * the Fargate launch type, this parameter is optional. If using the EC2 launch type, you must specify either a + * task-level memory value or a container-level memory value. If you specify both a container-level ``memory`` and + * ``memoryReservation`` value, ``memory`` must be greater than ``memoryReservation``. If you specify + * ``memoryReservation``, then that value is subtracted from the available memory resources for the container + * instance where the container is placed. Otherwise, the value of ``memory`` is used. The Docker 20.10.0 or later + * daemon reserves a minimum of 6 MiB of memory for a container, so you should not specify fewer than 6 MiB of + * memory for your containers. The Docker 19.03.13-ce or earlier daemon reserves a minimum of 4 MiB of memory for a + * container, so you should not specify fewer than 4 MiB of memory for your containers. + * + * @param memory the memory value to set. + * @return the ContainerDefinition object itself. + */ + public ContainerDefinition withMemory(Integer memory) { + this.memory = memory; + return this; + } + + /** + * Get the memoryReservation property: The soft limit (in MiB) of memory to reserve for the container. When system + * memory is under heavy contention, Docker attempts to keep the container memory to this soft limit. However, your + * container can consume more memory when it needs to, up to either the hard limit specified with the ``memory`` + * parameter (if applicable), or all of the available memory on the container instance, whichever comes first. This + * parameter maps to ``MemoryReservation`` in the [Create a + * container](https://docs.aws.amazon.com/https://docs.docker.com/engine/api/v1.35/#operation/ContainerCreate) + * section of the [Docker Remote API](https://docs.aws.amazon.com/https://docs.docker.com/engine/api/v1.35/) and the + * ``--memory-reservation`` option to [docker + * run](https://docs.aws.amazon.com/https://docs.docker.com/engine/reference/run/#security-configuration). If a + * task-level memory value is not specified, you must specify a non-zero integer for one or both of ``memory`` or + * ``memoryReservation`` in a container definition. If you specify both, ``memory`` must be greater than + * ``memoryReservation``. If you specify ``memoryReservation``, then that value is subtracted from the available + * memory resources for the container instance where the container is placed. Otherwise, the value of ``memory`` is + * used. For example, if your container normally uses 128 MiB of memory, but occasionally bursts to 256 MiB of + * memory for short periods of time, you can set a ``memoryReservation`` of 128 MiB, and a ``memory`` hard limit of + * 300 MiB. This configuration would allow the container to only reserve 128 MiB of memory from the remaining + * resources on the container instance, but also allow the container to consume more memory resources when needed. + * The Docker 20.10.0 or later daemon reserves a minimum of 6 MiB of memory for a container. So, don't specify less + * than 6 MiB of memory for your containers. The Docker 19.03.13-ce or earlier daemon reserves a minimum of 4 MiB of + * memory for a container. So, don't specify less than 4 MiB of memory for your containers. + * + * @return the memoryReservation value. + */ + public Integer memoryReservation() { + return this.memoryReservation; + } + + /** + * Set the memoryReservation property: The soft limit (in MiB) of memory to reserve for the container. When system + * memory is under heavy contention, Docker attempts to keep the container memory to this soft limit. However, your + * container can consume more memory when it needs to, up to either the hard limit specified with the ``memory`` + * parameter (if applicable), or all of the available memory on the container instance, whichever comes first. This + * parameter maps to ``MemoryReservation`` in the [Create a + * container](https://docs.aws.amazon.com/https://docs.docker.com/engine/api/v1.35/#operation/ContainerCreate) + * section of the [Docker Remote API](https://docs.aws.amazon.com/https://docs.docker.com/engine/api/v1.35/) and the + * ``--memory-reservation`` option to [docker + * run](https://docs.aws.amazon.com/https://docs.docker.com/engine/reference/run/#security-configuration). If a + * task-level memory value is not specified, you must specify a non-zero integer for one or both of ``memory`` or + * ``memoryReservation`` in a container definition. If you specify both, ``memory`` must be greater than + * ``memoryReservation``. If you specify ``memoryReservation``, then that value is subtracted from the available + * memory resources for the container instance where the container is placed. Otherwise, the value of ``memory`` is + * used. For example, if your container normally uses 128 MiB of memory, but occasionally bursts to 256 MiB of + * memory for short periods of time, you can set a ``memoryReservation`` of 128 MiB, and a ``memory`` hard limit of + * 300 MiB. This configuration would allow the container to only reserve 128 MiB of memory from the remaining + * resources on the container instance, but also allow the container to consume more memory resources when needed. + * The Docker 20.10.0 or later daemon reserves a minimum of 6 MiB of memory for a container. So, don't specify less + * than 6 MiB of memory for your containers. The Docker 19.03.13-ce or earlier daemon reserves a minimum of 4 MiB of + * memory for a container. So, don't specify less than 4 MiB of memory for your containers. + * + * @param memoryReservation the memoryReservation value to set. + * @return the ContainerDefinition object itself. + */ + public ContainerDefinition withMemoryReservation(Integer memoryReservation) { + this.memoryReservation = memoryReservation; + return this; + } + + /** + * Get the mountPoints property: The mount points for data volumes in your container. This parameter maps to + * ``Volumes`` in the [Create a + * container](https://docs.aws.amazon.com/https://docs.docker.com/engine/api/v1.35/#operation/ContainerCreate) + * section of the [Docker Remote API](https://docs.aws.amazon.com/https://docs.docker.com/engine/api/v1.35/) and the + * ``--volume`` option to [docker + * run](https://docs.aws.amazon.com/https://docs.docker.com/engine/reference/run/#security-configuration). Windows + * containers can mount whole directories on the same drive as ``$env:ProgramData``. Windows containers can't mount + * directories on a different drive, and mount point can't be across drives. + * + * @return the mountPoints value. + */ + public List mountPoints() { + return this.mountPoints; + } + + /** + * Set the mountPoints property: The mount points for data volumes in your container. This parameter maps to + * ``Volumes`` in the [Create a + * container](https://docs.aws.amazon.com/https://docs.docker.com/engine/api/v1.35/#operation/ContainerCreate) + * section of the [Docker Remote API](https://docs.aws.amazon.com/https://docs.docker.com/engine/api/v1.35/) and the + * ``--volume`` option to [docker + * run](https://docs.aws.amazon.com/https://docs.docker.com/engine/reference/run/#security-configuration). Windows + * containers can mount whole directories on the same drive as ``$env:ProgramData``. Windows containers can't mount + * directories on a different drive, and mount point can't be across drives. + * + * @param mountPoints the mountPoints value to set. + * @return the ContainerDefinition object itself. + */ + public ContainerDefinition withMountPoints(List mountPoints) { + this.mountPoints = mountPoints; + return this; + } + + /** + * Get the name property: The name of a container. If you're linking multiple containers together in a task + * definition, the ``name`` of one container can be entered in the ``links`` of another container to connect the + * containers. Up to 255 letters (uppercase and lowercase), numbers, underscores, and hyphens are allowed. This + * parameter maps to ``name`` in the [Create a + * container](https://docs.aws.amazon.com/https://docs.docker.com/engine/api/v1.35/#operation/ContainerCreate) + * section of the [Docker Remote API](https://docs.aws.amazon.com/https://docs.docker.com/engine/api/v1.35/) and the + * ``--name`` option to [docker + * run](https://docs.aws.amazon.com/https://docs.docker.com/engine/reference/run/#security-configuration). + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: The name of a container. If you're linking multiple containers together in a task + * definition, the ``name`` of one container can be entered in the ``links`` of another container to connect the + * containers. Up to 255 letters (uppercase and lowercase), numbers, underscores, and hyphens are allowed. This + * parameter maps to ``name`` in the [Create a + * container](https://docs.aws.amazon.com/https://docs.docker.com/engine/api/v1.35/#operation/ContainerCreate) + * section of the [Docker Remote API](https://docs.aws.amazon.com/https://docs.docker.com/engine/api/v1.35/) and the + * ``--name`` option to [docker + * run](https://docs.aws.amazon.com/https://docs.docker.com/engine/reference/run/#security-configuration). + * + * @param name the name value to set. + * @return the ContainerDefinition object itself. + */ + public ContainerDefinition withName(String name) { + this.name = name; + return this; + } + + /** + * Get the portMappings property: The list of port mappings for the container. Port mappings allow containers to + * access ports on the host container instance to send or receive traffic. For task definitions that use the + * ``awsvpc`` network mode, you should only specify the ``containerPort``. The ``hostPort`` can be left blank or it + * must be the same value as the ``containerPort``. Port mappings on Windows use the ``NetNAT`` gateway address + * rather than ``localhost``. There is no loopback for port mappings on Windows, so you cannot access a container's + * mapped port from the host itself. This parameter maps to ``PortBindings`` in the [Create a + * container](https://docs.aws.amazon.com/https://docs.docker.com/engine/api/v1.35/#operation/ContainerCreate) + * section of the [Docker Remote API](https://docs.aws.amazon.com/https://docs.docker.com/engine/api/v1.35/) and the + * ``--publish`` option to [docker run](https://docs.aws.amazon.com/https://docs.docker.com/engine/reference/run/). + * If the network mode of a task definition is set to ``none``, then you can't specify port mappings. If the network + * mode of a task definition is set to ``host``, then host ports must either be undefined or they must match the + * container port in the port mapping. After a task reaches the ``RUNNING`` status, manual and automatic host and + * container port assignments are visible in the *Network Bindings* section of a container description for a + * selected task in the Amazon ECS console. The assignments are also visible in the ``networkBindings`` section + * [DescribeTasks](https://docs.aws.amazon.com/AmazonECS/latest/APIReference/API_DescribeTasks.html) responses. + * + * @return the portMappings value. + */ + public List portMappings() { + return this.portMappings; + } + + /** + * Set the portMappings property: The list of port mappings for the container. Port mappings allow containers to + * access ports on the host container instance to send or receive traffic. For task definitions that use the + * ``awsvpc`` network mode, you should only specify the ``containerPort``. The ``hostPort`` can be left blank or it + * must be the same value as the ``containerPort``. Port mappings on Windows use the ``NetNAT`` gateway address + * rather than ``localhost``. There is no loopback for port mappings on Windows, so you cannot access a container's + * mapped port from the host itself. This parameter maps to ``PortBindings`` in the [Create a + * container](https://docs.aws.amazon.com/https://docs.docker.com/engine/api/v1.35/#operation/ContainerCreate) + * section of the [Docker Remote API](https://docs.aws.amazon.com/https://docs.docker.com/engine/api/v1.35/) and the + * ``--publish`` option to [docker run](https://docs.aws.amazon.com/https://docs.docker.com/engine/reference/run/). + * If the network mode of a task definition is set to ``none``, then you can't specify port mappings. If the network + * mode of a task definition is set to ``host``, then host ports must either be undefined or they must match the + * container port in the port mapping. After a task reaches the ``RUNNING`` status, manual and automatic host and + * container port assignments are visible in the *Network Bindings* section of a container description for a + * selected task in the Amazon ECS console. The assignments are also visible in the ``networkBindings`` section + * [DescribeTasks](https://docs.aws.amazon.com/AmazonECS/latest/APIReference/API_DescribeTasks.html) responses. + * + * @param portMappings the portMappings value to set. + * @return the ContainerDefinition object itself. + */ + public ContainerDefinition withPortMappings(List portMappings) { + this.portMappings = portMappings; + return this; + } + + /** + * Get the privileged property: When this parameter is true, the container is given elevated privileges on the host + * container instance (similar to the ``root`` user). This parameter maps to ``Privileged`` in the [Create a + * container](https://docs.aws.amazon.com/https://docs.docker.com/engine/api/v1.35/#operation/ContainerCreate) + * section of the [Docker Remote API](https://docs.aws.amazon.com/https://docs.docker.com/engine/api/v1.35/) and the + * ``--privileged`` option to [docker + * run](https://docs.aws.amazon.com/https://docs.docker.com/engine/reference/run/#security-configuration). This + * parameter is not supported for Windows containers or tasks run on FARGATElong. + * + * @return the privileged value. + */ + public Boolean privileged() { + return this.privileged; + } + + /** + * Set the privileged property: When this parameter is true, the container is given elevated privileges on the host + * container instance (similar to the ``root`` user). This parameter maps to ``Privileged`` in the [Create a + * container](https://docs.aws.amazon.com/https://docs.docker.com/engine/api/v1.35/#operation/ContainerCreate) + * section of the [Docker Remote API](https://docs.aws.amazon.com/https://docs.docker.com/engine/api/v1.35/) and the + * ``--privileged`` option to [docker + * run](https://docs.aws.amazon.com/https://docs.docker.com/engine/reference/run/#security-configuration). This + * parameter is not supported for Windows containers or tasks run on FARGATElong. + * + * @param privileged the privileged value to set. + * @return the ContainerDefinition object itself. + */ + public ContainerDefinition withPrivileged(Boolean privileged) { + this.privileged = privileged; + return this; + } + + /** + * Get the pseudoTerminal property: When this parameter is ``true``, a TTY is allocated. This parameter maps to + * ``Tty`` in the [Create a + * container](https://docs.aws.amazon.com/https://docs.docker.com/engine/api/v1.35/#operation/ContainerCreate) + * section of the [Docker Remote API](https://docs.aws.amazon.com/https://docs.docker.com/engine/api/v1.35/) and the + * ``--tty`` option to [docker + * run](https://docs.aws.amazon.com/https://docs.docker.com/engine/reference/run/#security-configuration). + * + * @return the pseudoTerminal value. + */ + public Boolean pseudoTerminal() { + return this.pseudoTerminal; + } + + /** + * Set the pseudoTerminal property: When this parameter is ``true``, a TTY is allocated. This parameter maps to + * ``Tty`` in the [Create a + * container](https://docs.aws.amazon.com/https://docs.docker.com/engine/api/v1.35/#operation/ContainerCreate) + * section of the [Docker Remote API](https://docs.aws.amazon.com/https://docs.docker.com/engine/api/v1.35/) and the + * ``--tty`` option to [docker + * run](https://docs.aws.amazon.com/https://docs.docker.com/engine/reference/run/#security-configuration). + * + * @param pseudoTerminal the pseudoTerminal value to set. + * @return the ContainerDefinition object itself. + */ + public ContainerDefinition withPseudoTerminal(Boolean pseudoTerminal) { + this.pseudoTerminal = pseudoTerminal; + return this; + } + + /** + * Get the readonlyRootFilesystem property: When this parameter is true, the container is given read-only access to + * its root file system. This parameter maps to ``ReadonlyRootfs`` in the [Create a + * container](https://docs.aws.amazon.com/https://docs.docker.com/engine/api/v1.35/#operation/ContainerCreate) + * section of the [Docker Remote API](https://docs.aws.amazon.com/https://docs.docker.com/engine/api/v1.35/) and the + * ``--read-only`` option to [docker + * run](https://docs.aws.amazon.com/https://docs.docker.com/engine/reference/run/#security-configuration). This + * parameter is not supported for Windows containers. + * + * @return the readonlyRootFilesystem value. + */ + public Boolean readonlyRootFilesystem() { + return this.readonlyRootFilesystem; + } + + /** + * Set the readonlyRootFilesystem property: When this parameter is true, the container is given read-only access to + * its root file system. This parameter maps to ``ReadonlyRootfs`` in the [Create a + * container](https://docs.aws.amazon.com/https://docs.docker.com/engine/api/v1.35/#operation/ContainerCreate) + * section of the [Docker Remote API](https://docs.aws.amazon.com/https://docs.docker.com/engine/api/v1.35/) and the + * ``--read-only`` option to [docker + * run](https://docs.aws.amazon.com/https://docs.docker.com/engine/reference/run/#security-configuration). This + * parameter is not supported for Windows containers. + * + * @param readonlyRootFilesystem the readonlyRootFilesystem value to set. + * @return the ContainerDefinition object itself. + */ + public ContainerDefinition withReadonlyRootFilesystem(Boolean readonlyRootFilesystem) { + this.readonlyRootFilesystem = readonlyRootFilesystem; + return this; + } + + /** + * Get the repositoryCredentials property: The private repository authentication credentials to use. The repository + * credentials for private registry authentication. + * + * @return the repositoryCredentials value. + */ + public RepositoryCredentials repositoryCredentials() { + return this.repositoryCredentials; + } + + /** + * Set the repositoryCredentials property: The private repository authentication credentials to use. The repository + * credentials for private registry authentication. + * + * @param repositoryCredentials the repositoryCredentials value to set. + * @return the ContainerDefinition object itself. + */ + public ContainerDefinition withRepositoryCredentials(RepositoryCredentials repositoryCredentials) { + this.repositoryCredentials = repositoryCredentials; + return this; + } + + /** + * Get the resourceRequirements property: The type and amount of a resource to assign to a container. The only + * supported resource is a GPU. + * + * @return the resourceRequirements value. + */ + public List resourceRequirements() { + return this.resourceRequirements; + } + + /** + * Set the resourceRequirements property: The type and amount of a resource to assign to a container. The only + * supported resource is a GPU. + * + * @param resourceRequirements the resourceRequirements value to set. + * @return the ContainerDefinition object itself. + */ + public ContainerDefinition withResourceRequirements(List resourceRequirements) { + this.resourceRequirements = resourceRequirements; + return this; + } + + /** + * Get the secrets property: The secrets to pass to the container. For more information, see [Specifying Sensitive + * Data](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/specifying-sensitive-data.html) in the *Amazon + * Elastic Container Service Developer Guide*. + * + * @return the secrets value. + */ + public List secrets() { + return this.secrets; + } + + /** + * Set the secrets property: The secrets to pass to the container. For more information, see [Specifying Sensitive + * Data](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/specifying-sensitive-data.html) in the *Amazon + * Elastic Container Service Developer Guide*. + * + * @param secrets the secrets value to set. + * @return the ContainerDefinition object itself. + */ + public ContainerDefinition withSecrets(List secrets) { + this.secrets = secrets; + return this; + } + + /** + * Get the startTimeout property: Time duration (in seconds) to wait before giving up on resolving dependencies for + * a container. For example, you specify two containers in a task definition with containerA having a dependency on + * containerB reaching a ``COMPLETE``, ``SUCCESS``, or ``HEALTHY`` status. If a ``startTimeout`` value is specified + * for containerB and it doesn't reach the desired status within that time then containerA gives up and not start. + * This results in the task transitioning to a ``STOPPED`` state. When the ``ECS_CONTAINER_START_TIMEOUT`` container + * agent configuration variable is used, it's enforced independently from this start timeout value. For tasks using + * the Fargate launch type, the task or service requires the following platforms: + Linux platform version ``1.3.0`` + * or later. + Windows platform version ``1.0.0`` or later. For tasks using the EC2 launch type, your container + * instances require at least version ``1.26.0`` of the container agent to use a container start timeout value. + * However, we recommend using the latest container agent version. For information about checking your agent version + * and updating to the latest version, see [Updating the Amazon ECS Container + * Agent](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/ecs-agent-update.html) in the *Amazon Elastic + * Container Service Developer Guide*. If you're using an Amazon ECS-optimized Linux AMI, your instance needs at + * least version ``1.26.0-1`` of the ``ecs-init`` package. If your container instances are launched from version + * ``20190301`` or later, then they contain the required versions of the container agent and ``ecs-init``. For more + * information, see [Amazon ECS-optimized Linux + * AMI](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/ecs-optimized_AMI.html) in the *Amazon Elastic + * Container Service Developer Guide*. The valid values are 2-120 seconds. + * + * @return the startTimeout value. + */ + public Integer startTimeout() { + return this.startTimeout; + } + + /** + * Set the startTimeout property: Time duration (in seconds) to wait before giving up on resolving dependencies for + * a container. For example, you specify two containers in a task definition with containerA having a dependency on + * containerB reaching a ``COMPLETE``, ``SUCCESS``, or ``HEALTHY`` status. If a ``startTimeout`` value is specified + * for containerB and it doesn't reach the desired status within that time then containerA gives up and not start. + * This results in the task transitioning to a ``STOPPED`` state. When the ``ECS_CONTAINER_START_TIMEOUT`` container + * agent configuration variable is used, it's enforced independently from this start timeout value. For tasks using + * the Fargate launch type, the task or service requires the following platforms: + Linux platform version ``1.3.0`` + * or later. + Windows platform version ``1.0.0`` or later. For tasks using the EC2 launch type, your container + * instances require at least version ``1.26.0`` of the container agent to use a container start timeout value. + * However, we recommend using the latest container agent version. For information about checking your agent version + * and updating to the latest version, see [Updating the Amazon ECS Container + * Agent](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/ecs-agent-update.html) in the *Amazon Elastic + * Container Service Developer Guide*. If you're using an Amazon ECS-optimized Linux AMI, your instance needs at + * least version ``1.26.0-1`` of the ``ecs-init`` package. If your container instances are launched from version + * ``20190301`` or later, then they contain the required versions of the container agent and ``ecs-init``. For more + * information, see [Amazon ECS-optimized Linux + * AMI](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/ecs-optimized_AMI.html) in the *Amazon Elastic + * Container Service Developer Guide*. The valid values are 2-120 seconds. + * + * @param startTimeout the startTimeout value to set. + * @return the ContainerDefinition object itself. + */ + public ContainerDefinition withStartTimeout(Integer startTimeout) { + this.startTimeout = startTimeout; + return this; + } + + /** + * Get the stopTimeout property: Time duration (in seconds) to wait before the container is forcefully killed if it + * doesn't exit normally on its own. For tasks using the Fargate launch type, the task or service requires the + * following platforms: + Linux platform version ``1.3.0`` or later. + Windows platform version ``1.0.0`` or later. + * The max stop timeout value is 120 seconds and if the parameter is not specified, the default value of 30 seconds + * is used. For tasks that use the EC2 launch type, if the ``stopTimeout`` parameter isn't specified, the value set + * for the Amazon ECS container agent configuration variable ``ECS_CONTAINER_STOP_TIMEOUT`` is used. If neither the + * ``stopTimeout`` parameter or the ``ECS_CONTAINER_STOP_TIMEOUT`` agent configuration variable are set, then the + * default values of 30 seconds for Linux containers and 30 seconds on Windows containers are used. Your container + * instances require at least version 1.26.0 of the container agent to use a container stop timeout value. However, + * we recommend using the latest container agent version. For information about checking your agent version and + * updating to the latest version, see [Updating the Amazon ECS Container + * Agent](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/ecs-agent-update.html) in the *Amazon Elastic + * Container Service Developer Guide*. If you're using an Amazon ECS-optimized Linux AMI, your instance needs at + * least version 1.26.0-1 of the ``ecs-init`` package. If your container instances are launched from version + * ``20190301`` or later, then they contain the required versions of the container agent and ``ecs-init``. For more + * information, see [Amazon ECS-optimized Linux + * AMI](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/ecs-optimized_AMI.html) in the *Amazon Elastic + * Container Service Developer Guide*. The valid values are 2-120 seconds. + * + * @return the stopTimeout value. + */ + public Integer stopTimeout() { + return this.stopTimeout; + } + + /** + * Set the stopTimeout property: Time duration (in seconds) to wait before the container is forcefully killed if it + * doesn't exit normally on its own. For tasks using the Fargate launch type, the task or service requires the + * following platforms: + Linux platform version ``1.3.0`` or later. + Windows platform version ``1.0.0`` or later. + * The max stop timeout value is 120 seconds and if the parameter is not specified, the default value of 30 seconds + * is used. For tasks that use the EC2 launch type, if the ``stopTimeout`` parameter isn't specified, the value set + * for the Amazon ECS container agent configuration variable ``ECS_CONTAINER_STOP_TIMEOUT`` is used. If neither the + * ``stopTimeout`` parameter or the ``ECS_CONTAINER_STOP_TIMEOUT`` agent configuration variable are set, then the + * default values of 30 seconds for Linux containers and 30 seconds on Windows containers are used. Your container + * instances require at least version 1.26.0 of the container agent to use a container stop timeout value. However, + * we recommend using the latest container agent version. For information about checking your agent version and + * updating to the latest version, see [Updating the Amazon ECS Container + * Agent](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/ecs-agent-update.html) in the *Amazon Elastic + * Container Service Developer Guide*. If you're using an Amazon ECS-optimized Linux AMI, your instance needs at + * least version 1.26.0-1 of the ``ecs-init`` package. If your container instances are launched from version + * ``20190301`` or later, then they contain the required versions of the container agent and ``ecs-init``. For more + * information, see [Amazon ECS-optimized Linux + * AMI](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/ecs-optimized_AMI.html) in the *Amazon Elastic + * Container Service Developer Guide*. The valid values are 2-120 seconds. + * + * @param stopTimeout the stopTimeout value to set. + * @return the ContainerDefinition object itself. + */ + public ContainerDefinition withStopTimeout(Integer stopTimeout) { + this.stopTimeout = stopTimeout; + return this; + } + + /** + * Get the systemControls property: A list of namespaced kernel parameters to set in the container. This parameter + * maps to ``Sysctls`` in the [Create a + * container](https://docs.aws.amazon.com/https://docs.docker.com/engine/api/v1.35/#operation/ContainerCreate) + * section of the [Docker Remote API](https://docs.aws.amazon.com/https://docs.docker.com/engine/api/v1.35/) and the + * ``--sysctl`` option to [docker + * run](https://docs.aws.amazon.com/https://docs.docker.com/engine/reference/run/#security-configuration). For + * example, you can configure ``net.ipv4.tcp_keepalive_time`` setting to maintain longer lived connections. + * + * @return the systemControls value. + */ + public List systemControls() { + return this.systemControls; + } + + /** + * Set the systemControls property: A list of namespaced kernel parameters to set in the container. This parameter + * maps to ``Sysctls`` in the [Create a + * container](https://docs.aws.amazon.com/https://docs.docker.com/engine/api/v1.35/#operation/ContainerCreate) + * section of the [Docker Remote API](https://docs.aws.amazon.com/https://docs.docker.com/engine/api/v1.35/) and the + * ``--sysctl`` option to [docker + * run](https://docs.aws.amazon.com/https://docs.docker.com/engine/reference/run/#security-configuration). For + * example, you can configure ``net.ipv4.tcp_keepalive_time`` setting to maintain longer lived connections. + * + * @param systemControls the systemControls value to set. + * @return the ContainerDefinition object itself. + */ + public ContainerDefinition withSystemControls(List systemControls) { + this.systemControls = systemControls; + return this; + } + + /** + * Get the ulimits property: A list of ``ulimits`` to set in the container. This parameter maps to ``Ulimits`` in + * the [Create a + * container](https://docs.aws.amazon.com/https://docs.docker.com/engine/api/v1.35/#operation/ContainerCreate) + * section of the [Docker Remote API](https://docs.aws.amazon.com/https://docs.docker.com/engine/api/v1.35/) and the + * ``--ulimit`` option to [docker run](https://docs.aws.amazon.com/https://docs.docker.com/engine/reference/run/). + * Valid naming values are displayed in the + * [Ulimit](https://docs.aws.amazon.com/AmazonECS/latest/APIReference/API_Ulimit.html) data type. This parameter + * requires version 1.18 of the Docker Remote API or greater on your container instance. To check the Docker Remote + * API version on your container instance, log in to your container instance and run the following command: ``sudo + * docker version --format '{{.Server.APIVersion}}'`` This parameter is not supported for Windows containers. + * + * @return the ulimits value. + */ + public List ulimits() { + return this.ulimits; + } + + /** + * Set the ulimits property: A list of ``ulimits`` to set in the container. This parameter maps to ``Ulimits`` in + * the [Create a + * container](https://docs.aws.amazon.com/https://docs.docker.com/engine/api/v1.35/#operation/ContainerCreate) + * section of the [Docker Remote API](https://docs.aws.amazon.com/https://docs.docker.com/engine/api/v1.35/) and the + * ``--ulimit`` option to [docker run](https://docs.aws.amazon.com/https://docs.docker.com/engine/reference/run/). + * Valid naming values are displayed in the + * [Ulimit](https://docs.aws.amazon.com/AmazonECS/latest/APIReference/API_Ulimit.html) data type. This parameter + * requires version 1.18 of the Docker Remote API or greater on your container instance. To check the Docker Remote + * API version on your container instance, log in to your container instance and run the following command: ``sudo + * docker version --format '{{.Server.APIVersion}}'`` This parameter is not supported for Windows containers. + * + * @param ulimits the ulimits value to set. + * @return the ContainerDefinition object itself. + */ + public ContainerDefinition withUlimits(List ulimits) { + this.ulimits = ulimits; + return this; + } + + /** + * Get the user property: The user to use inside the container. This parameter maps to ``User`` in the [Create a + * container](https://docs.aws.amazon.com/https://docs.docker.com/engine/api/v1.35/#operation/ContainerCreate) + * section of the [Docker Remote API](https://docs.aws.amazon.com/https://docs.docker.com/engine/api/v1.35/) and the + * ``--user`` option to [docker + * run](https://docs.aws.amazon.com/https://docs.docker.com/engine/reference/run/#security-configuration). When + * running tasks using the ``host`` network mode, don't run containers using the root user (UID 0). We recommend + * using a non-root user for better security. You can specify the ``user`` using the following formats. If + * specifying a UID or GID, you must specify it as a positive integer. + ``user`` + ``user:group`` + ``uid`` + + * ``uid:gid`` + ``user:gid`` + ``uid:group`` This parameter is not supported for Windows containers. + * + * @return the user value. + */ + public String user() { + return this.user; + } + + /** + * Set the user property: The user to use inside the container. This parameter maps to ``User`` in the [Create a + * container](https://docs.aws.amazon.com/https://docs.docker.com/engine/api/v1.35/#operation/ContainerCreate) + * section of the [Docker Remote API](https://docs.aws.amazon.com/https://docs.docker.com/engine/api/v1.35/) and the + * ``--user`` option to [docker + * run](https://docs.aws.amazon.com/https://docs.docker.com/engine/reference/run/#security-configuration). When + * running tasks using the ``host`` network mode, don't run containers using the root user (UID 0). We recommend + * using a non-root user for better security. You can specify the ``user`` using the following formats. If + * specifying a UID or GID, you must specify it as a positive integer. + ``user`` + ``user:group`` + ``uid`` + + * ``uid:gid`` + ``user:gid`` + ``uid:group`` This parameter is not supported for Windows containers. + * + * @param user the user value to set. + * @return the ContainerDefinition object itself. + */ + public ContainerDefinition withUser(String user) { + this.user = user; + return this; + } + + /** + * Get the volumesFrom property: Data volumes to mount from another container. This parameter maps to + * ``VolumesFrom`` in the [Create a + * container](https://docs.aws.amazon.com/https://docs.docker.com/engine/api/v1.35/#operation/ContainerCreate) + * section of the [Docker Remote API](https://docs.aws.amazon.com/https://docs.docker.com/engine/api/v1.35/) and the + * ``--volumes-from`` option to [docker + * run](https://docs.aws.amazon.com/https://docs.docker.com/engine/reference/run/#security-configuration). + * + * @return the volumesFrom value. + */ + public List volumesFrom() { + return this.volumesFrom; + } + + /** + * Set the volumesFrom property: Data volumes to mount from another container. This parameter maps to + * ``VolumesFrom`` in the [Create a + * container](https://docs.aws.amazon.com/https://docs.docker.com/engine/api/v1.35/#operation/ContainerCreate) + * section of the [Docker Remote API](https://docs.aws.amazon.com/https://docs.docker.com/engine/api/v1.35/) and the + * ``--volumes-from`` option to [docker + * run](https://docs.aws.amazon.com/https://docs.docker.com/engine/reference/run/#security-configuration). + * + * @param volumesFrom the volumesFrom value to set. + * @return the ContainerDefinition object itself. + */ + public ContainerDefinition withVolumesFrom(List volumesFrom) { + this.volumesFrom = volumesFrom; + return this; + } + + /** + * Get the workingDirectory property: The working directory to run commands inside the container in. This parameter + * maps to ``WorkingDir`` in the [Create a + * container](https://docs.aws.amazon.com/https://docs.docker.com/engine/api/v1.35/#operation/ContainerCreate) + * section of the [Docker Remote API](https://docs.aws.amazon.com/https://docs.docker.com/engine/api/v1.35/) and the + * ``--workdir`` option to [docker + * run](https://docs.aws.amazon.com/https://docs.docker.com/engine/reference/run/#security-configuration). + * + * @return the workingDirectory value. + */ + public String workingDirectory() { + return this.workingDirectory; + } + + /** + * Set the workingDirectory property: The working directory to run commands inside the container in. This parameter + * maps to ``WorkingDir`` in the [Create a + * container](https://docs.aws.amazon.com/https://docs.docker.com/engine/api/v1.35/#operation/ContainerCreate) + * section of the [Docker Remote API](https://docs.aws.amazon.com/https://docs.docker.com/engine/api/v1.35/) and the + * ``--workdir`` option to [docker + * run](https://docs.aws.amazon.com/https://docs.docker.com/engine/reference/run/#security-configuration). + * + * @param workingDirectory the workingDirectory value to set. + * @return the ContainerDefinition object itself. + */ + public ContainerDefinition withWorkingDirectory(String workingDirectory) { + this.workingDirectory = workingDirectory; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (dependsOn() != null) { + dependsOn().forEach(e -> e.validate()); + } + if (environment() != null) { + environment().forEach(e -> e.validate()); + } + if (environmentFiles() != null) { + environmentFiles().forEach(e -> e.validate()); + } + if (extraHosts() != null) { + extraHosts().forEach(e -> e.validate()); + } + if (firelensConfiguration() != null) { + firelensConfiguration().validate(); + } + if (healthCheck() != null) { + healthCheck().validate(); + } + if (linuxParameters() != null) { + linuxParameters().validate(); + } + if (logConfiguration() != null) { + logConfiguration().validate(); + } + if (mountPoints() != null) { + mountPoints().forEach(e -> e.validate()); + } + if (portMappings() != null) { + portMappings().forEach(e -> e.validate()); + } + if (repositoryCredentials() != null) { + repositoryCredentials().validate(); + } + if (resourceRequirements() != null) { + resourceRequirements().forEach(e -> e.validate()); + } + if (secrets() != null) { + secrets().forEach(e -> e.validate()); + } + if (systemControls() != null) { + systemControls().forEach(e -> e.validate()); + } + if (ulimits() != null) { + ulimits().forEach(e -> e.validate()); + } + if (volumesFrom() != null) { + volumesFrom().forEach(e -> e.validate()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("command", this.command, (writer, element) -> writer.writeString(element)); + jsonWriter.writeNumberField("cpu", this.cpu); + jsonWriter.writeArrayField("credentialSpecs", this.credentialSpecs, + (writer, element) -> writer.writeString(element)); + jsonWriter.writeArrayField("dependsOn", this.dependsOn, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeBooleanField("disableNetworking", this.disableNetworking); + jsonWriter.writeArrayField("dnsSearchDomains", this.dnsSearchDomains, + (writer, element) -> writer.writeString(element)); + jsonWriter.writeArrayField("dnsServers", this.dnsServers, (writer, element) -> writer.writeString(element)); + jsonWriter.writeUntypedField("dockerLabels", this.dockerLabels); + jsonWriter.writeArrayField("dockerSecurityOptions", this.dockerSecurityOptions, + (writer, element) -> writer.writeString(element)); + jsonWriter.writeArrayField("entryPoint", this.entryPoint, (writer, element) -> writer.writeString(element)); + jsonWriter.writeArrayField("environment", this.environment, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("environmentFiles", this.environmentFiles, + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeBooleanField("essential", this.essential); + jsonWriter.writeArrayField("extraHosts", this.extraHosts, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeJsonField("firelensConfiguration", this.firelensConfiguration); + jsonWriter.writeJsonField("healthCheck", this.healthCheck); + jsonWriter.writeStringField("hostname", this.hostname); + jsonWriter.writeStringField("image", this.image); + jsonWriter.writeBooleanField("interactive", this.interactive); + jsonWriter.writeArrayField("links", this.links, (writer, element) -> writer.writeString(element)); + jsonWriter.writeJsonField("linuxParameters", this.linuxParameters); + jsonWriter.writeJsonField("logConfiguration", this.logConfiguration); + jsonWriter.writeNumberField("memory", this.memory); + jsonWriter.writeNumberField("memoryReservation", this.memoryReservation); + jsonWriter.writeArrayField("mountPoints", this.mountPoints, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("name", this.name); + jsonWriter.writeArrayField("portMappings", this.portMappings, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeBooleanField("privileged", this.privileged); + jsonWriter.writeBooleanField("pseudoTerminal", this.pseudoTerminal); + jsonWriter.writeBooleanField("readonlyRootFilesystem", this.readonlyRootFilesystem); + jsonWriter.writeJsonField("repositoryCredentials", this.repositoryCredentials); + jsonWriter.writeArrayField("resourceRequirements", this.resourceRequirements, + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("secrets", this.secrets, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeNumberField("startTimeout", this.startTimeout); + jsonWriter.writeNumberField("stopTimeout", this.stopTimeout); + jsonWriter.writeArrayField("systemControls", this.systemControls, + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("ulimits", this.ulimits, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("user", this.user); + jsonWriter.writeArrayField("volumesFrom", this.volumesFrom, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("workingDirectory", this.workingDirectory); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ContainerDefinition from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ContainerDefinition if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the ContainerDefinition. + */ + public static ContainerDefinition fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ContainerDefinition deserializedContainerDefinition = new ContainerDefinition(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("command".equals(fieldName)) { + List command = reader.readArray(reader1 -> reader1.getString()); + deserializedContainerDefinition.command = command; + } else if ("cpu".equals(fieldName)) { + deserializedContainerDefinition.cpu = reader.getNullable(JsonReader::getInt); + } else if ("credentialSpecs".equals(fieldName)) { + List credentialSpecs = reader.readArray(reader1 -> reader1.getString()); + deserializedContainerDefinition.credentialSpecs = credentialSpecs; + } else if ("dependsOn".equals(fieldName)) { + List dependsOn + = reader.readArray(reader1 -> ContainerDependency.fromJson(reader1)); + deserializedContainerDefinition.dependsOn = dependsOn; + } else if ("disableNetworking".equals(fieldName)) { + deserializedContainerDefinition.disableNetworking = reader.getNullable(JsonReader::getBoolean); + } else if ("dnsSearchDomains".equals(fieldName)) { + List dnsSearchDomains = reader.readArray(reader1 -> reader1.getString()); + deserializedContainerDefinition.dnsSearchDomains = dnsSearchDomains; + } else if ("dnsServers".equals(fieldName)) { + List dnsServers = reader.readArray(reader1 -> reader1.getString()); + deserializedContainerDefinition.dnsServers = dnsServers; + } else if ("dockerLabels".equals(fieldName)) { + deserializedContainerDefinition.dockerLabels = reader.readUntyped(); + } else if ("dockerSecurityOptions".equals(fieldName)) { + List dockerSecurityOptions = reader.readArray(reader1 -> reader1.getString()); + deserializedContainerDefinition.dockerSecurityOptions = dockerSecurityOptions; + } else if ("entryPoint".equals(fieldName)) { + List entryPoint = reader.readArray(reader1 -> reader1.getString()); + deserializedContainerDefinition.entryPoint = entryPoint; + } else if ("environment".equals(fieldName)) { + List environment = reader.readArray(reader1 -> KeyValuePair.fromJson(reader1)); + deserializedContainerDefinition.environment = environment; + } else if ("environmentFiles".equals(fieldName)) { + List environmentFiles + = reader.readArray(reader1 -> EnvironmentFile.fromJson(reader1)); + deserializedContainerDefinition.environmentFiles = environmentFiles; + } else if ("essential".equals(fieldName)) { + deserializedContainerDefinition.essential = reader.getNullable(JsonReader::getBoolean); + } else if ("extraHosts".equals(fieldName)) { + List extraHosts = reader.readArray(reader1 -> HostEntry.fromJson(reader1)); + deserializedContainerDefinition.extraHosts = extraHosts; + } else if ("firelensConfiguration".equals(fieldName)) { + deserializedContainerDefinition.firelensConfiguration = FirelensConfiguration.fromJson(reader); + } else if ("healthCheck".equals(fieldName)) { + deserializedContainerDefinition.healthCheck = HealthCheck.fromJson(reader); + } else if ("hostname".equals(fieldName)) { + deserializedContainerDefinition.hostname = reader.getString(); + } else if ("image".equals(fieldName)) { + deserializedContainerDefinition.image = reader.getString(); + } else if ("interactive".equals(fieldName)) { + deserializedContainerDefinition.interactive = reader.getNullable(JsonReader::getBoolean); + } else if ("links".equals(fieldName)) { + List links = reader.readArray(reader1 -> reader1.getString()); + deserializedContainerDefinition.links = links; + } else if ("linuxParameters".equals(fieldName)) { + deserializedContainerDefinition.linuxParameters = LinuxParameters.fromJson(reader); + } else if ("logConfiguration".equals(fieldName)) { + deserializedContainerDefinition.logConfiguration = LogConfiguration.fromJson(reader); + } else if ("memory".equals(fieldName)) { + deserializedContainerDefinition.memory = reader.getNullable(JsonReader::getInt); + } else if ("memoryReservation".equals(fieldName)) { + deserializedContainerDefinition.memoryReservation = reader.getNullable(JsonReader::getInt); + } else if ("mountPoints".equals(fieldName)) { + List mountPoints = reader.readArray(reader1 -> MountPoint.fromJson(reader1)); + deserializedContainerDefinition.mountPoints = mountPoints; + } else if ("name".equals(fieldName)) { + deserializedContainerDefinition.name = reader.getString(); + } else if ("portMappings".equals(fieldName)) { + List portMappings = reader.readArray(reader1 -> PortMapping.fromJson(reader1)); + deserializedContainerDefinition.portMappings = portMappings; + } else if ("privileged".equals(fieldName)) { + deserializedContainerDefinition.privileged = reader.getNullable(JsonReader::getBoolean); + } else if ("pseudoTerminal".equals(fieldName)) { + deserializedContainerDefinition.pseudoTerminal = reader.getNullable(JsonReader::getBoolean); + } else if ("readonlyRootFilesystem".equals(fieldName)) { + deserializedContainerDefinition.readonlyRootFilesystem = reader.getNullable(JsonReader::getBoolean); + } else if ("repositoryCredentials".equals(fieldName)) { + deserializedContainerDefinition.repositoryCredentials = RepositoryCredentials.fromJson(reader); + } else if ("resourceRequirements".equals(fieldName)) { + List resourceRequirements + = reader.readArray(reader1 -> ResourceRequirement.fromJson(reader1)); + deserializedContainerDefinition.resourceRequirements = resourceRequirements; + } else if ("secrets".equals(fieldName)) { + List secrets = reader.readArray(reader1 -> Secret.fromJson(reader1)); + deserializedContainerDefinition.secrets = secrets; + } else if ("startTimeout".equals(fieldName)) { + deserializedContainerDefinition.startTimeout = reader.getNullable(JsonReader::getInt); + } else if ("stopTimeout".equals(fieldName)) { + deserializedContainerDefinition.stopTimeout = reader.getNullable(JsonReader::getInt); + } else if ("systemControls".equals(fieldName)) { + List systemControls = reader.readArray(reader1 -> SystemControl.fromJson(reader1)); + deserializedContainerDefinition.systemControls = systemControls; + } else if ("ulimits".equals(fieldName)) { + List ulimits = reader.readArray(reader1 -> Ulimit.fromJson(reader1)); + deserializedContainerDefinition.ulimits = ulimits; + } else if ("user".equals(fieldName)) { + deserializedContainerDefinition.user = reader.getString(); + } else if ("volumesFrom".equals(fieldName)) { + List volumesFrom = reader.readArray(reader1 -> VolumeFrom.fromJson(reader1)); + deserializedContainerDefinition.volumesFrom = volumesFrom; + } else if ("workingDirectory".equals(fieldName)) { + deserializedContainerDefinition.workingDirectory = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedContainerDefinition; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ContainerDependency.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ContainerDependency.java new file mode 100644 index 000000000000..a2404c4f09c0 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ContainerDependency.java @@ -0,0 +1,148 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of ContainerDependency. + */ +@Fluent +public final class ContainerDependency implements JsonSerializable { + /* + * The dependency condition of the container. The following are the available conditions and their behavior: + + * ``START`` - This condition emulates the behavior of links and volumes today. It validates that a dependent + * container is started before permitting other containers to start. + ``COMPLETE`` - This condition validates that + * a dependent container runs to completion (exits) before permitting other containers to start. This can be useful + * for nonessential containers that run a script and then exit. This condition can't be set on an essential + * container. + ``SUCCESS`` - This condition is the same as ``COMPLETE``, but it also requires that the container + * exits with a ``zero`` status. This condition can't be set on an essential container. + ``HEALTHY`` - This + * condition validates that the dependent container passes its Docker health check before permitting other + * containers to start. This requires that the dependent container has health checks configured. This condition is + * confirmed only at task startup. + */ + private String condition; + + /* + * The name of a container. + */ + private String containerName; + + /** + * Creates an instance of ContainerDependency class. + */ + public ContainerDependency() { + } + + /** + * Get the condition property: The dependency condition of the container. The following are the available conditions + * and their behavior: + ``START`` - This condition emulates the behavior of links and volumes today. It validates + * that a dependent container is started before permitting other containers to start. + ``COMPLETE`` - This + * condition validates that a dependent container runs to completion (exits) before permitting other containers to + * start. This can be useful for nonessential containers that run a script and then exit. This condition can't be + * set on an essential container. + ``SUCCESS`` - This condition is the same as ``COMPLETE``, but it also requires + * that the container exits with a ``zero`` status. This condition can't be set on an essential container. + + * ``HEALTHY`` - This condition validates that the dependent container passes its Docker health check before + * permitting other containers to start. This requires that the dependent container has health checks configured. + * This condition is confirmed only at task startup. + * + * @return the condition value. + */ + public String condition() { + return this.condition; + } + + /** + * Set the condition property: The dependency condition of the container. The following are the available conditions + * and their behavior: + ``START`` - This condition emulates the behavior of links and volumes today. It validates + * that a dependent container is started before permitting other containers to start. + ``COMPLETE`` - This + * condition validates that a dependent container runs to completion (exits) before permitting other containers to + * start. This can be useful for nonessential containers that run a script and then exit. This condition can't be + * set on an essential container. + ``SUCCESS`` - This condition is the same as ``COMPLETE``, but it also requires + * that the container exits with a ``zero`` status. This condition can't be set on an essential container. + + * ``HEALTHY`` - This condition validates that the dependent container passes its Docker health check before + * permitting other containers to start. This requires that the dependent container has health checks configured. + * This condition is confirmed only at task startup. + * + * @param condition the condition value to set. + * @return the ContainerDependency object itself. + */ + public ContainerDependency withCondition(String condition) { + this.condition = condition; + return this; + } + + /** + * Get the containerName property: The name of a container. + * + * @return the containerName value. + */ + public String containerName() { + return this.containerName; + } + + /** + * Set the containerName property: The name of a container. + * + * @param containerName the containerName value to set. + * @return the ContainerDependency object itself. + */ + public ContainerDependency withContainerName(String containerName) { + this.containerName = containerName; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("condition", this.condition); + jsonWriter.writeStringField("containerName", this.containerName); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ContainerDependency from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ContainerDependency if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the ContainerDependency. + */ + public static ContainerDependency fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ContainerDependency deserializedContainerDependency = new ContainerDependency(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("condition".equals(fieldName)) { + deserializedContainerDependency.condition = reader.getString(); + } else if ("containerName".equals(fieldName)) { + deserializedContainerDependency.containerName = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedContainerDependency; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ContinuousBackupsStatus.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ContinuousBackupsStatus.java new file mode 100644 index 000000000000..842ec32f404e --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ContinuousBackupsStatus.java @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * ContinuousBackupsStatus enum. + */ +public final class ContinuousBackupsStatus extends ExpandableStringEnum { + /** + * Static value DISABLED for ContinuousBackupsStatus. + */ + public static final ContinuousBackupsStatus DISABLED = fromString("DISABLED"); + + /** + * Static value ENABLED for ContinuousBackupsStatus. + */ + public static final ContinuousBackupsStatus ENABLED = fromString("ENABLED"); + + /** + * Creates a new instance of ContinuousBackupsStatus value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ContinuousBackupsStatus() { + } + + /** + * Creates or finds a ContinuousBackupsStatus from its string representation. + * + * @param name a name to look for. + * @return the corresponding ContinuousBackupsStatus. + */ + public static ContinuousBackupsStatus fromString(String name) { + return fromString(name, ContinuousBackupsStatus.class); + } + + /** + * Gets known ContinuousBackupsStatus values. + * + * @return known ContinuousBackupsStatus values. + */ + public static Collection values() { + return values(ContinuousBackupsStatus.class); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ContinuousBackupsStatusEnumValue.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ContinuousBackupsStatusEnumValue.java new file mode 100644 index 000000000000..e605584902cc --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ContinuousBackupsStatusEnumValue.java @@ -0,0 +1,95 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of ContinuousBackupsStatusEnumValue. + */ +@Fluent +public final class ContinuousBackupsStatusEnumValue implements JsonSerializable { + /* + * Property value + */ + private ContinuousBackupsStatus value; + + /** + * Creates an instance of ContinuousBackupsStatusEnumValue class. + */ + public ContinuousBackupsStatusEnumValue() { + } + + /** + * Get the value property: Property value. + * + * @return the value value. + */ + public ContinuousBackupsStatus value() { + return this.value; + } + + /** + * Set the value property: Property value. + * + * @param value the value value to set. + * @return the ContinuousBackupsStatusEnumValue object itself. + */ + public ContinuousBackupsStatusEnumValue withValue(ContinuousBackupsStatus value) { + this.value = value; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("value", this.value == null ? null : this.value.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ContinuousBackupsStatusEnumValue from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ContinuousBackupsStatusEnumValue if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ContinuousBackupsStatusEnumValue. + */ + public static ContinuousBackupsStatusEnumValue fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ContinuousBackupsStatusEnumValue deserializedContinuousBackupsStatusEnumValue + = new ContinuousBackupsStatusEnumValue(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + deserializedContinuousBackupsStatusEnumValue.value + = ContinuousBackupsStatus.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedContinuousBackupsStatusEnumValue; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ContributorInsightsSpecification.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ContributorInsightsSpecification.java new file mode 100644 index 000000000000..d823bb569784 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ContributorInsightsSpecification.java @@ -0,0 +1,96 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of ContributorInsightsSpecification. + */ +@Fluent +public final class ContributorInsightsSpecification implements JsonSerializable { + /* + * Indicates whether CloudWatch Contributor Insights are to be enabled (true) or disabled (false). + */ + private Boolean enabled; + + /** + * Creates an instance of ContributorInsightsSpecification class. + */ + public ContributorInsightsSpecification() { + } + + /** + * Get the enabled property: Indicates whether CloudWatch Contributor Insights are to be enabled (true) or disabled + * (false). + * + * @return the enabled value. + */ + public Boolean enabled() { + return this.enabled; + } + + /** + * Set the enabled property: Indicates whether CloudWatch Contributor Insights are to be enabled (true) or disabled + * (false). + * + * @param enabled the enabled value to set. + * @return the ContributorInsightsSpecification object itself. + */ + public ContributorInsightsSpecification withEnabled(Boolean enabled) { + this.enabled = enabled; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeBooleanField("enabled", this.enabled); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ContributorInsightsSpecification from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ContributorInsightsSpecification if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ContributorInsightsSpecification. + */ + public static ContributorInsightsSpecification fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ContributorInsightsSpecification deserializedContributorInsightsSpecification + = new ContributorInsightsSpecification(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("enabled".equals(fieldName)) { + deserializedContributorInsightsSpecification.enabled = reader.getNullable(JsonReader::getBoolean); + } else { + reader.skipChildren(); + } + } + + return deserializedContributorInsightsSpecification; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ControlPlanePlacementResponse.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ControlPlanePlacementResponse.java new file mode 100644 index 000000000000..d89b9dbe5cdf --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ControlPlanePlacementResponse.java @@ -0,0 +1,96 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of ControlPlanePlacementResponse. + */ +@Fluent +public final class ControlPlanePlacementResponse implements JsonSerializable { + /* + *

The name of the placement group for the Kubernetes control plane instances.

+ */ + private String groupName; + + /** + * Creates an instance of ControlPlanePlacementResponse class. + */ + public ControlPlanePlacementResponse() { + } + + /** + * Get the groupName property: <p>The name of the placement group for the Kubernetes control plane + * instances.</p>. + * + * @return the groupName value. + */ + public String groupName() { + return this.groupName; + } + + /** + * Set the groupName property: <p>The name of the placement group for the Kubernetes control plane + * instances.</p>. + * + * @param groupName the groupName value to set. + * @return the ControlPlanePlacementResponse object itself. + */ + public ControlPlanePlacementResponse withGroupName(String groupName) { + this.groupName = groupName; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("groupName", this.groupName); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ControlPlanePlacementResponse from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ControlPlanePlacementResponse if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ControlPlanePlacementResponse. + */ + public static ControlPlanePlacementResponse fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ControlPlanePlacementResponse deserializedControlPlanePlacementResponse + = new ControlPlanePlacementResponse(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("groupName".equals(fieldName)) { + deserializedControlPlanePlacementResponse.groupName = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedControlPlanePlacementResponse; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/Cookies.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/Cookies.java new file mode 100644 index 000000000000..6509b19d0584 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/Cookies.java @@ -0,0 +1,177 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Definition of Cookies. + */ +@Fluent +public final class Cookies implements JsonSerializable { + /* + * This field is deprecated. We recommend that you use a cache policy or an origin request policy instead of this + * field. If you want to include cookies in the cache key, use a cache policy. For more information, see [Creating + * cache + * policies](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/controlling-the-cache-key.html#cache + * -key-create-cache-policy) in the *Amazon CloudFront Developer Guide*. If you want to send cookies to the origin + * but not include them in the cache key, use origin request policy. For more information, see [Creating origin + * request + * policies](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/controlling-origin-requests.html# + * origin-request-create-origin-request-policy) in the *Amazon CloudFront Developer Guide*. Specifies which cookies + * to forward to the origin for this cache behavior: all, none, or the list of cookies specified in the + * ``WhitelistedNames`` complex type. Amazon S3 doesn't process cookies. When the cache behavior is forwarding + * requests to an Amazon S3 origin, specify none for the ``Forward`` element. + */ + private String forward; + + /* + * This field is deprecated. We recommend that you use a cache policy or an origin request policy instead of this + * field. If you want to include cookies in the cache key, use a cache policy. For more information, see [Creating + * cache + * policies](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/controlling-the-cache-key.html#cache + * -key-create-cache-policy) in the *Amazon CloudFront Developer Guide*. If you want to send cookies to the origin + * but not include them in the cache key, use an origin request policy. For more information, see [Creating origin + * request + * policies](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/controlling-origin-requests.html# + * origin-request-create-origin-request-policy) in the *Amazon CloudFront Developer Guide*. + */ + private List whitelistedNames; + + /** + * Creates an instance of Cookies class. + */ + public Cookies() { + } + + /** + * Get the forward property: This field is deprecated. We recommend that you use a cache policy or an origin request + * policy instead of this field. If you want to include cookies in the cache key, use a cache policy. For more + * information, see [Creating cache + * policies](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/controlling-the-cache-key.html#cache-key-create-cache-policy) + * in the *Amazon CloudFront Developer Guide*. If you want to send cookies to the origin but not include them in the + * cache key, use origin request policy. For more information, see [Creating origin request + * policies](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/controlling-origin-requests.html#origin-request-create-origin-request-policy) + * in the *Amazon CloudFront Developer Guide*. Specifies which cookies to forward to the origin for this cache + * behavior: all, none, or the list of cookies specified in the ``WhitelistedNames`` complex type. Amazon S3 doesn't + * process cookies. When the cache behavior is forwarding requests to an Amazon S3 origin, specify none for the + * ``Forward`` element. + * + * @return the forward value. + */ + public String forward() { + return this.forward; + } + + /** + * Set the forward property: This field is deprecated. We recommend that you use a cache policy or an origin request + * policy instead of this field. If you want to include cookies in the cache key, use a cache policy. For more + * information, see [Creating cache + * policies](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/controlling-the-cache-key.html#cache-key-create-cache-policy) + * in the *Amazon CloudFront Developer Guide*. If you want to send cookies to the origin but not include them in the + * cache key, use origin request policy. For more information, see [Creating origin request + * policies](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/controlling-origin-requests.html#origin-request-create-origin-request-policy) + * in the *Amazon CloudFront Developer Guide*. Specifies which cookies to forward to the origin for this cache + * behavior: all, none, or the list of cookies specified in the ``WhitelistedNames`` complex type. Amazon S3 doesn't + * process cookies. When the cache behavior is forwarding requests to an Amazon S3 origin, specify none for the + * ``Forward`` element. + * + * @param forward the forward value to set. + * @return the Cookies object itself. + */ + public Cookies withForward(String forward) { + this.forward = forward; + return this; + } + + /** + * Get the whitelistedNames property: This field is deprecated. We recommend that you use a cache policy or an + * origin request policy instead of this field. If you want to include cookies in the cache key, use a cache policy. + * For more information, see [Creating cache + * policies](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/controlling-the-cache-key.html#cache-key-create-cache-policy) + * in the *Amazon CloudFront Developer Guide*. If you want to send cookies to the origin but not include them in the + * cache key, use an origin request policy. For more information, see [Creating origin request + * policies](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/controlling-origin-requests.html#origin-request-create-origin-request-policy) + * in the *Amazon CloudFront Developer Guide*. + * + * @return the whitelistedNames value. + */ + public List whitelistedNames() { + return this.whitelistedNames; + } + + /** + * Set the whitelistedNames property: This field is deprecated. We recommend that you use a cache policy or an + * origin request policy instead of this field. If you want to include cookies in the cache key, use a cache policy. + * For more information, see [Creating cache + * policies](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/controlling-the-cache-key.html#cache-key-create-cache-policy) + * in the *Amazon CloudFront Developer Guide*. If you want to send cookies to the origin but not include them in the + * cache key, use an origin request policy. For more information, see [Creating origin request + * policies](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/controlling-origin-requests.html#origin-request-create-origin-request-policy) + * in the *Amazon CloudFront Developer Guide*. + * + * @param whitelistedNames the whitelistedNames value to set. + * @return the Cookies object itself. + */ + public Cookies withWhitelistedNames(List whitelistedNames) { + this.whitelistedNames = whitelistedNames; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("forward", this.forward); + jsonWriter.writeArrayField("whitelistedNames", this.whitelistedNames, + (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of Cookies from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of Cookies if the JsonReader was pointing to an instance of it, or null if it was pointing to + * JSON null. + * @throws IOException If an error occurs while reading the Cookies. + */ + public static Cookies fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + Cookies deserializedCookies = new Cookies(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("forward".equals(fieldName)) { + deserializedCookies.forward = reader.getString(); + } else if ("whitelistedNames".equals(fieldName)) { + List whitelistedNames = reader.readArray(reader1 -> reader1.getString()); + deserializedCookies.whitelistedNames = whitelistedNames; + } else { + reader.skipChildren(); + } + } + + return deserializedCookies; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/Coordinates.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/Coordinates.java new file mode 100644 index 000000000000..27955235e224 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/Coordinates.java @@ -0,0 +1,127 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of Coordinates. + */ +@Fluent +public final class Coordinates implements JsonSerializable { + /* + *

Specifies a coordinate of the north–south position of a geographic point on the surface of the Earth (-90 - + * 90).

+ */ + private String latitude; + + /* + *

Specifies a coordinate of the east–west position of a geographic point on the surface of the Earth (-180 - + * 180).

+ */ + private String longitude; + + /** + * Creates an instance of Coordinates class. + */ + public Coordinates() { + } + + /** + * Get the latitude property: <p> Specifies a coordinate of the north–south position of a geographic point on + * the surface of the Earth (-90 - 90). </p>. + * + * @return the latitude value. + */ + public String latitude() { + return this.latitude; + } + + /** + * Set the latitude property: <p> Specifies a coordinate of the north–south position of a geographic point on + * the surface of the Earth (-90 - 90). </p>. + * + * @param latitude the latitude value to set. + * @return the Coordinates object itself. + */ + public Coordinates withLatitude(String latitude) { + this.latitude = latitude; + return this; + } + + /** + * Get the longitude property: <p> Specifies a coordinate of the east–west position of a geographic point on + * the surface of the Earth (-180 - 180). </p>. + * + * @return the longitude value. + */ + public String longitude() { + return this.longitude; + } + + /** + * Set the longitude property: <p> Specifies a coordinate of the east–west position of a geographic point on + * the surface of the Earth (-180 - 180). </p>. + * + * @param longitude the longitude value to set. + * @return the Coordinates object itself. + */ + public Coordinates withLongitude(String longitude) { + this.longitude = longitude; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("latitude", this.latitude); + jsonWriter.writeStringField("longitude", this.longitude); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of Coordinates from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of Coordinates if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the Coordinates. + */ + public static Coordinates fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + Coordinates deserializedCoordinates = new Coordinates(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("latitude".equals(fieldName)) { + deserializedCoordinates.latitude = reader.getString(); + } else if ("longitude".equals(fieldName)) { + deserializedCoordinates.longitude = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedCoordinates; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/CorsConfiguration.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/CorsConfiguration.java new file mode 100644 index 000000000000..33ac80521c34 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/CorsConfiguration.java @@ -0,0 +1,101 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Definition of CorsConfiguration. + */ +@Fluent +public final class CorsConfiguration implements JsonSerializable { + /* + * A set of origins and methods (cross-origin access that you want to allow). You can add up to 100 rules to the + * configuration. + */ + private List corsRules; + + /** + * Creates an instance of CorsConfiguration class. + */ + public CorsConfiguration() { + } + + /** + * Get the corsRules property: A set of origins and methods (cross-origin access that you want to allow). You can + * add up to 100 rules to the configuration. + * + * @return the corsRules value. + */ + public List corsRules() { + return this.corsRules; + } + + /** + * Set the corsRules property: A set of origins and methods (cross-origin access that you want to allow). You can + * add up to 100 rules to the configuration. + * + * @param corsRules the corsRules value to set. + * @return the CorsConfiguration object itself. + */ + public CorsConfiguration withCorsRules(List corsRules) { + this.corsRules = corsRules; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (corsRules() != null) { + corsRules().forEach(e -> e.validate()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("corsRules", this.corsRules, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of CorsConfiguration from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of CorsConfiguration if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the CorsConfiguration. + */ + public static CorsConfiguration fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + CorsConfiguration deserializedCorsConfiguration = new CorsConfiguration(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("corsRules".equals(fieldName)) { + List corsRules = reader.readArray(reader1 -> CorsRule.fromJson(reader1)); + deserializedCorsConfiguration.corsRules = corsRules; + } else { + reader.skipChildren(); + } + } + + return deserializedCorsConfiguration; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/CorsRule.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/CorsRule.java new file mode 100644 index 000000000000..6a2debd26a8f --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/CorsRule.java @@ -0,0 +1,257 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Definition of CorsRule. + */ +@Fluent +public final class CorsRule implements JsonSerializable { + /* + * Headers that are specified in the ``Access-Control-Request-Headers`` header. These headers are allowed in a + * preflight OPTIONS request. In response to any preflight OPTIONS request, Amazon S3 returns any requested headers + * that are allowed. + */ + private List allowedHeaders; + + /* + * An HTTP method that you allow the origin to run. *Allowed values*: ``GET`` | ``PUT`` | ``HEAD`` | ``POST`` | + * ``DELETE`` + */ + private List allowedMethods; + + /* + * One or more origins you want customers to be able to access the bucket from. + */ + private List allowedOrigins; + + /* + * One or more headers in the response that you want customers to be able to access from their applications (for + * example, from a JavaScript ``XMLHttpRequest`` object). + */ + private List exposedHeaders; + + /* + * A unique identifier for this rule. The value must be no more than 255 characters. + */ + private String id; + + /* + * The time in seconds that your browser is to cache the preflight response for the specified resource. + */ + private Integer maxAge; + + /** + * Creates an instance of CorsRule class. + */ + public CorsRule() { + } + + /** + * Get the allowedHeaders property: Headers that are specified in the ``Access-Control-Request-Headers`` header. + * These headers are allowed in a preflight OPTIONS request. In response to any preflight OPTIONS request, Amazon S3 + * returns any requested headers that are allowed. + * + * @return the allowedHeaders value. + */ + public List allowedHeaders() { + return this.allowedHeaders; + } + + /** + * Set the allowedHeaders property: Headers that are specified in the ``Access-Control-Request-Headers`` header. + * These headers are allowed in a preflight OPTIONS request. In response to any preflight OPTIONS request, Amazon S3 + * returns any requested headers that are allowed. + * + * @param allowedHeaders the allowedHeaders value to set. + * @return the CorsRule object itself. + */ + public CorsRule withAllowedHeaders(List allowedHeaders) { + this.allowedHeaders = allowedHeaders; + return this; + } + + /** + * Get the allowedMethods property: An HTTP method that you allow the origin to run. *Allowed values*: ``GET`` | + * ``PUT`` | ``HEAD`` | ``POST`` | ``DELETE``. + * + * @return the allowedMethods value. + */ + public List allowedMethods() { + return this.allowedMethods; + } + + /** + * Set the allowedMethods property: An HTTP method that you allow the origin to run. *Allowed values*: ``GET`` | + * ``PUT`` | ``HEAD`` | ``POST`` | ``DELETE``. + * + * @param allowedMethods the allowedMethods value to set. + * @return the CorsRule object itself. + */ + public CorsRule withAllowedMethods(List allowedMethods) { + this.allowedMethods = allowedMethods; + return this; + } + + /** + * Get the allowedOrigins property: One or more origins you want customers to be able to access the bucket from. + * + * @return the allowedOrigins value. + */ + public List allowedOrigins() { + return this.allowedOrigins; + } + + /** + * Set the allowedOrigins property: One or more origins you want customers to be able to access the bucket from. + * + * @param allowedOrigins the allowedOrigins value to set. + * @return the CorsRule object itself. + */ + public CorsRule withAllowedOrigins(List allowedOrigins) { + this.allowedOrigins = allowedOrigins; + return this; + } + + /** + * Get the exposedHeaders property: One or more headers in the response that you want customers to be able to access + * from their applications (for example, from a JavaScript ``XMLHttpRequest`` object). + * + * @return the exposedHeaders value. + */ + public List exposedHeaders() { + return this.exposedHeaders; + } + + /** + * Set the exposedHeaders property: One or more headers in the response that you want customers to be able to access + * from their applications (for example, from a JavaScript ``XMLHttpRequest`` object). + * + * @param exposedHeaders the exposedHeaders value to set. + * @return the CorsRule object itself. + */ + public CorsRule withExposedHeaders(List exposedHeaders) { + this.exposedHeaders = exposedHeaders; + return this; + } + + /** + * Get the id property: A unique identifier for this rule. The value must be no more than 255 characters. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Set the id property: A unique identifier for this rule. The value must be no more than 255 characters. + * + * @param id the id value to set. + * @return the CorsRule object itself. + */ + public CorsRule withId(String id) { + this.id = id; + return this; + } + + /** + * Get the maxAge property: The time in seconds that your browser is to cache the preflight response for the + * specified resource. + * + * @return the maxAge value. + */ + public Integer maxAge() { + return this.maxAge; + } + + /** + * Set the maxAge property: The time in seconds that your browser is to cache the preflight response for the + * specified resource. + * + * @param maxAge the maxAge value to set. + * @return the CorsRule object itself. + */ + public CorsRule withMaxAge(Integer maxAge) { + this.maxAge = maxAge; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("allowedHeaders", this.allowedHeaders, + (writer, element) -> writer.writeString(element)); + jsonWriter.writeArrayField("allowedMethods", this.allowedMethods, + (writer, element) -> writer.writeString(element == null ? null : element.toString())); + jsonWriter.writeArrayField("allowedOrigins", this.allowedOrigins, + (writer, element) -> writer.writeString(element)); + jsonWriter.writeArrayField("exposedHeaders", this.exposedHeaders, + (writer, element) -> writer.writeString(element)); + jsonWriter.writeStringField("id", this.id); + jsonWriter.writeNumberField("maxAge", this.maxAge); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of CorsRule from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of CorsRule if the JsonReader was pointing to an instance of it, or null if it was pointing + * to JSON null. + * @throws IOException If an error occurs while reading the CorsRule. + */ + public static CorsRule fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + CorsRule deserializedCorsRule = new CorsRule(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("allowedHeaders".equals(fieldName)) { + List allowedHeaders = reader.readArray(reader1 -> reader1.getString()); + deserializedCorsRule.allowedHeaders = allowedHeaders; + } else if ("allowedMethods".equals(fieldName)) { + List allowedMethods + = reader.readArray(reader1 -> CorsRuleAllowedMethods.fromString(reader1.getString())); + deserializedCorsRule.allowedMethods = allowedMethods; + } else if ("allowedOrigins".equals(fieldName)) { + List allowedOrigins = reader.readArray(reader1 -> reader1.getString()); + deserializedCorsRule.allowedOrigins = allowedOrigins; + } else if ("exposedHeaders".equals(fieldName)) { + List exposedHeaders = reader.readArray(reader1 -> reader1.getString()); + deserializedCorsRule.exposedHeaders = exposedHeaders; + } else if ("id".equals(fieldName)) { + deserializedCorsRule.id = reader.getString(); + } else if ("maxAge".equals(fieldName)) { + deserializedCorsRule.maxAge = reader.getNullable(JsonReader::getInt); + } else { + reader.skipChildren(); + } + } + + return deserializedCorsRule; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/CorsRuleAllowedMethods.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/CorsRuleAllowedMethods.java new file mode 100644 index 000000000000..de852357681d --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/CorsRuleAllowedMethods.java @@ -0,0 +1,66 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * CorsRuleAllowedMethods enum. + */ +public final class CorsRuleAllowedMethods extends ExpandableStringEnum { + /** + * Static value DELETE for CorsRuleAllowedMethods. + */ + public static final CorsRuleAllowedMethods DELETE = fromString("DELETE"); + + /** + * Static value GET for CorsRuleAllowedMethods. + */ + public static final CorsRuleAllowedMethods GET = fromString("GET"); + + /** + * Static value HEAD for CorsRuleAllowedMethods. + */ + public static final CorsRuleAllowedMethods HEAD = fromString("HEAD"); + + /** + * Static value POST for CorsRuleAllowedMethods. + */ + public static final CorsRuleAllowedMethods POST = fromString("POST"); + + /** + * Static value PUT for CorsRuleAllowedMethods. + */ + public static final CorsRuleAllowedMethods PUT = fromString("PUT"); + + /** + * Creates a new instance of CorsRuleAllowedMethods value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public CorsRuleAllowedMethods() { + } + + /** + * Creates or finds a CorsRuleAllowedMethods from its string representation. + * + * @param name a name to look for. + * @return the corresponding CorsRuleAllowedMethods. + */ + public static CorsRuleAllowedMethods fromString(String name) { + return fromString(name, CorsRuleAllowedMethods.class); + } + + /** + * Gets known CorsRuleAllowedMethods values. + * + * @return known CorsRuleAllowedMethods values. + */ + public static Collection values() { + return values(CorsRuleAllowedMethods.class); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/CpuOptions.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/CpuOptions.java new file mode 100644 index 000000000000..6b9b9a5e5244 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/CpuOptions.java @@ -0,0 +1,157 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of CpuOptions. + */ +@Fluent +public final class CpuOptions implements JsonSerializable { + /* + *

Indicates whether the instance is enabled for AMD SEV-SNP. For more information, see AMD SEV-SNP.

+ */ + private AmdSevSnpSpecificationEnumValue amdSevSnp; + + /* + *

The number of CPU cores for the instance.

+ */ + private Integer coreCount; + + /* + *

The number of threads per CPU core.

+ */ + private Integer threadsPerCore; + + /** + * Creates an instance of CpuOptions class. + */ + public CpuOptions() { + } + + /** + * Get the amdSevSnp property: <p>Indicates whether the instance is enabled for AMD SEV-SNP. For more + * information, see <a href='https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/sev-snp.html'>AMD + * SEV-SNP</a>.</p>. + * + * @return the amdSevSnp value. + */ + public AmdSevSnpSpecificationEnumValue amdSevSnp() { + return this.amdSevSnp; + } + + /** + * Set the amdSevSnp property: <p>Indicates whether the instance is enabled for AMD SEV-SNP. For more + * information, see <a href='https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/sev-snp.html'>AMD + * SEV-SNP</a>.</p>. + * + * @param amdSevSnp the amdSevSnp value to set. + * @return the CpuOptions object itself. + */ + public CpuOptions withAmdSevSnp(AmdSevSnpSpecificationEnumValue amdSevSnp) { + this.amdSevSnp = amdSevSnp; + return this; + } + + /** + * Get the coreCount property: <p>The number of CPU cores for the instance.</p>. + * + * @return the coreCount value. + */ + public Integer coreCount() { + return this.coreCount; + } + + /** + * Set the coreCount property: <p>The number of CPU cores for the instance.</p>. + * + * @param coreCount the coreCount value to set. + * @return the CpuOptions object itself. + */ + public CpuOptions withCoreCount(Integer coreCount) { + this.coreCount = coreCount; + return this; + } + + /** + * Get the threadsPerCore property: <p>The number of threads per CPU core.</p>. + * + * @return the threadsPerCore value. + */ + public Integer threadsPerCore() { + return this.threadsPerCore; + } + + /** + * Set the threadsPerCore property: <p>The number of threads per CPU core.</p>. + * + * @param threadsPerCore the threadsPerCore value to set. + * @return the CpuOptions object itself. + */ + public CpuOptions withThreadsPerCore(Integer threadsPerCore) { + this.threadsPerCore = threadsPerCore; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (amdSevSnp() != null) { + amdSevSnp().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("amdSevSnp", this.amdSevSnp); + jsonWriter.writeNumberField("coreCount", this.coreCount); + jsonWriter.writeNumberField("threadsPerCore", this.threadsPerCore); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of CpuOptions from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of CpuOptions if the JsonReader was pointing to an instance of it, or null if it was pointing + * to JSON null. + * @throws IOException If an error occurs while reading the CpuOptions. + */ + public static CpuOptions fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + CpuOptions deserializedCpuOptions = new CpuOptions(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("amdSevSnp".equals(fieldName)) { + deserializedCpuOptions.amdSevSnp = AmdSevSnpSpecificationEnumValue.fromJson(reader); + } else if ("coreCount".equals(fieldName)) { + deserializedCpuOptions.coreCount = reader.getNullable(JsonReader::getInt); + } else if ("threadsPerCore".equals(fieldName)) { + deserializedCpuOptions.threadsPerCore = reader.getNullable(JsonReader::getInt); + } else { + reader.skipChildren(); + } + } + + return deserializedCpuOptions; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/CredentialProviderType.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/CredentialProviderType.java new file mode 100644 index 000000000000..7bcd9ec6c1dc --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/CredentialProviderType.java @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * CredentialProviderType enum. + */ +public final class CredentialProviderType extends ExpandableStringEnum { + /** + * Static value SECRETS_MANAGER for CredentialProviderType. + */ + public static final CredentialProviderType SECRETS_MANAGER = fromString("SECRETS_MANAGER"); + + /** + * Creates a new instance of CredentialProviderType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public CredentialProviderType() { + } + + /** + * Creates or finds a CredentialProviderType from its string representation. + * + * @param name a name to look for. + * @return the corresponding CredentialProviderType. + */ + public static CredentialProviderType fromString(String name) { + return fromString(name, CredentialProviderType.class); + } + + /** + * Gets known CredentialProviderType values. + * + * @return known CredentialProviderType values. + */ + public static Collection values() { + return values(CredentialProviderType.class); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/CredentialProviderTypeEnumValue.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/CredentialProviderTypeEnumValue.java new file mode 100644 index 000000000000..d64505e6c816 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/CredentialProviderTypeEnumValue.java @@ -0,0 +1,95 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of CredentialProviderTypeEnumValue. + */ +@Fluent +public final class CredentialProviderTypeEnumValue implements JsonSerializable { + /* + * Property value + */ + private CredentialProviderType value; + + /** + * Creates an instance of CredentialProviderTypeEnumValue class. + */ + public CredentialProviderTypeEnumValue() { + } + + /** + * Get the value property: Property value. + * + * @return the value value. + */ + public CredentialProviderType value() { + return this.value; + } + + /** + * Set the value property: Property value. + * + * @param value the value value to set. + * @return the CredentialProviderTypeEnumValue object itself. + */ + public CredentialProviderTypeEnumValue withValue(CredentialProviderType value) { + this.value = value; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("value", this.value == null ? null : this.value.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of CredentialProviderTypeEnumValue from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of CredentialProviderTypeEnumValue if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the CredentialProviderTypeEnumValue. + */ + public static CredentialProviderTypeEnumValue fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + CredentialProviderTypeEnumValue deserializedCredentialProviderTypeEnumValue + = new CredentialProviderTypeEnumValue(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + deserializedCredentialProviderTypeEnumValue.value + = CredentialProviderType.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedCredentialProviderTypeEnumValue; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/Criteria.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/Criteria.java new file mode 100644 index 000000000000..f0a6abe36eea --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/Criteria.java @@ -0,0 +1,124 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of Criteria. + */ +@Fluent +public final class Criteria implements JsonSerializable { + /* + * The S3 object key for the AllowList. + */ + private String regex; + + /* + * The S3 location for the AllowList. + */ + private S3WordsList s3WordsList; + + /** + * Creates an instance of Criteria class. + */ + public Criteria() { + } + + /** + * Get the regex property: The S3 object key for the AllowList. + * + * @return the regex value. + */ + public String regex() { + return this.regex; + } + + /** + * Set the regex property: The S3 object key for the AllowList. + * + * @param regex the regex value to set. + * @return the Criteria object itself. + */ + public Criteria withRegex(String regex) { + this.regex = regex; + return this; + } + + /** + * Get the s3WordsList property: The S3 location for the AllowList. + * + * @return the s3WordsList value. + */ + public S3WordsList s3WordsList() { + return this.s3WordsList; + } + + /** + * Set the s3WordsList property: The S3 location for the AllowList. + * + * @param s3WordsList the s3WordsList value to set. + * @return the Criteria object itself. + */ + public Criteria withS3WordsList(S3WordsList s3WordsList) { + this.s3WordsList = s3WordsList; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (s3WordsList() != null) { + s3WordsList().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("regex", this.regex); + jsonWriter.writeJsonField("s3WordsList", this.s3WordsList); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of Criteria from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of Criteria if the JsonReader was pointing to an instance of it, or null if it was pointing + * to JSON null. + * @throws IOException If an error occurs while reading the Criteria. + */ + public static Criteria fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + Criteria deserializedCriteria = new Criteria(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("regex".equals(fieldName)) { + deserializedCriteria.regex = reader.getString(); + } else if ("s3WordsList".equals(fieldName)) { + deserializedCriteria.s3WordsList = S3WordsList.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedCriteria; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/CriteriaBlockForJob.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/CriteriaBlockForJob.java new file mode 100644 index 000000000000..3bb2a52abe8b --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/CriteriaBlockForJob.java @@ -0,0 +1,103 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Definition of CriteriaBlockForJob. + */ +@Fluent +public final class CriteriaBlockForJob implements JsonSerializable { + /* + *

An array of conditions, one for each condition that determines which buckets to include or exclude from the + * job. If you specify more than one condition, Amazon Macie uses AND logic to join the conditions.

+ */ + private List and; + + /** + * Creates an instance of CriteriaBlockForJob class. + */ + public CriteriaBlockForJob() { + } + + /** + * Get the and property: <p>An array of conditions, one for each condition that determines which buckets to + * include or exclude from the job. If you specify more than one condition, Amazon Macie uses AND logic to join the + * conditions.</p>. + * + * @return the and value. + */ + public List and() { + return this.and; + } + + /** + * Set the and property: <p>An array of conditions, one for each condition that determines which buckets to + * include or exclude from the job. If you specify more than one condition, Amazon Macie uses AND logic to join the + * conditions.</p>. + * + * @param and the and value to set. + * @return the CriteriaBlockForJob object itself. + */ + public CriteriaBlockForJob withAnd(List and) { + this.and = and; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (and() != null) { + and().forEach(e -> e.validate()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("and", this.and, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of CriteriaBlockForJob from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of CriteriaBlockForJob if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the CriteriaBlockForJob. + */ + public static CriteriaBlockForJob fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + CriteriaBlockForJob deserializedCriteriaBlockForJob = new CriteriaBlockForJob(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("and".equals(fieldName)) { + List and = reader.readArray(reader1 -> CriteriaForJob.fromJson(reader1)); + deserializedCriteriaBlockForJob.and = and; + } else { + reader.skipChildren(); + } + } + + return deserializedCriteriaBlockForJob; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/CriteriaForJob.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/CriteriaForJob.java new file mode 100644 index 000000000000..023e12756699 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/CriteriaForJob.java @@ -0,0 +1,133 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of CriteriaForJob. + */ +@Fluent +public final class CriteriaForJob implements JsonSerializable { + /* + *

A property-based condition that defines a property, operator, and one or more values for including or + * excluding buckets from the job.

+ */ + private SimpleCriterionForJob simpleCriterion; + + /* + *

A tag-based condition that defines an operator and tag keys, tag values, or tag key and value pairs for + * including or excluding buckets from the job.

+ */ + private TagCriterionForJob tagCriterion; + + /** + * Creates an instance of CriteriaForJob class. + */ + public CriteriaForJob() { + } + + /** + * Get the simpleCriterion property: <p>A property-based condition that defines a property, operator, and one + * or more values for including or excluding buckets from the job.</p>. + * + * @return the simpleCriterion value. + */ + public SimpleCriterionForJob simpleCriterion() { + return this.simpleCriterion; + } + + /** + * Set the simpleCriterion property: <p>A property-based condition that defines a property, operator, and one + * or more values for including or excluding buckets from the job.</p>. + * + * @param simpleCriterion the simpleCriterion value to set. + * @return the CriteriaForJob object itself. + */ + public CriteriaForJob withSimpleCriterion(SimpleCriterionForJob simpleCriterion) { + this.simpleCriterion = simpleCriterion; + return this; + } + + /** + * Get the tagCriterion property: <p>A tag-based condition that defines an operator and tag keys, tag values, + * or tag key and value pairs for including or excluding buckets from the job.</p>. + * + * @return the tagCriterion value. + */ + public TagCriterionForJob tagCriterion() { + return this.tagCriterion; + } + + /** + * Set the tagCriterion property: <p>A tag-based condition that defines an operator and tag keys, tag values, + * or tag key and value pairs for including or excluding buckets from the job.</p>. + * + * @param tagCriterion the tagCriterion value to set. + * @return the CriteriaForJob object itself. + */ + public CriteriaForJob withTagCriterion(TagCriterionForJob tagCriterion) { + this.tagCriterion = tagCriterion; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (simpleCriterion() != null) { + simpleCriterion().validate(); + } + if (tagCriterion() != null) { + tagCriterion().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("simpleCriterion", this.simpleCriterion); + jsonWriter.writeJsonField("tagCriterion", this.tagCriterion); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of CriteriaForJob from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of CriteriaForJob if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the CriteriaForJob. + */ + public static CriteriaForJob fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + CriteriaForJob deserializedCriteriaForJob = new CriteriaForJob(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("simpleCriterion".equals(fieldName)) { + deserializedCriteriaForJob.simpleCriterion = SimpleCriterionForJob.fromJson(reader); + } else if ("tagCriterion".equals(fieldName)) { + deserializedCriteriaForJob.tagCriterion = TagCriterionForJob.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedCriteriaForJob; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/Csv.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/Csv.java new file mode 100644 index 000000000000..3d8d4060ee40 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/Csv.java @@ -0,0 +1,129 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Definition of Csv. + */ +@Fluent +public final class Csv implements JsonSerializable { + /* + * The delimiter used for separating items in the CSV file being imported. + */ + private String delimiter; + + /* + * List of the headers used to specify a common header for all source CSV files being imported. If this field is + * specified then the first line of each CSV file is treated as data instead of the header. If this field is not + * specified the the first line of each CSV file is treated as the header. + */ + private List headerList; + + /** + * Creates an instance of Csv class. + */ + public Csv() { + } + + /** + * Get the delimiter property: The delimiter used for separating items in the CSV file being imported. + * + * @return the delimiter value. + */ + public String delimiter() { + return this.delimiter; + } + + /** + * Set the delimiter property: The delimiter used for separating items in the CSV file being imported. + * + * @param delimiter the delimiter value to set. + * @return the Csv object itself. + */ + public Csv withDelimiter(String delimiter) { + this.delimiter = delimiter; + return this; + } + + /** + * Get the headerList property: List of the headers used to specify a common header for all source CSV files being + * imported. If this field is specified then the first line of each CSV file is treated as data instead of the + * header. If this field is not specified the the first line of each CSV file is treated as the header. + * + * @return the headerList value. + */ + public List headerList() { + return this.headerList; + } + + /** + * Set the headerList property: List of the headers used to specify a common header for all source CSV files being + * imported. If this field is specified then the first line of each CSV file is treated as data instead of the + * header. If this field is not specified the the first line of each CSV file is treated as the header. + * + * @param headerList the headerList value to set. + * @return the Csv object itself. + */ + public Csv withHeaderList(List headerList) { + this.headerList = headerList; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("delimiter", this.delimiter); + jsonWriter.writeArrayField("headerList", this.headerList, (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of Csv from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of Csv if the JsonReader was pointing to an instance of it, or null if it was pointing to + * JSON null. + * @throws IOException If an error occurs while reading the Csv. + */ + public static Csv fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + Csv deserializedCsv = new Csv(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("delimiter".equals(fieldName)) { + deserializedCsv.delimiter = reader.getString(); + } else if ("headerList".equals(fieldName)) { + List headerList = reader.readArray(reader1 -> reader1.getString()); + deserializedCsv.headerList = headerList; + } else { + reader.skipChildren(); + } + } + + return deserializedCsv; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/CustomAction.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/CustomAction.java new file mode 100644 index 000000000000..266f6ffd95a4 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/CustomAction.java @@ -0,0 +1,124 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of CustomAction. + */ +@Fluent +public final class CustomAction implements JsonSerializable { + /* + * Property actionDefinition + */ + private ActionDefinition actionDefinition; + + /* + * Property actionName + */ + private String actionName; + + /** + * Creates an instance of CustomAction class. + */ + public CustomAction() { + } + + /** + * Get the actionDefinition property: Property actionDefinition. + * + * @return the actionDefinition value. + */ + public ActionDefinition actionDefinition() { + return this.actionDefinition; + } + + /** + * Set the actionDefinition property: Property actionDefinition. + * + * @param actionDefinition the actionDefinition value to set. + * @return the CustomAction object itself. + */ + public CustomAction withActionDefinition(ActionDefinition actionDefinition) { + this.actionDefinition = actionDefinition; + return this; + } + + /** + * Get the actionName property: Property actionName. + * + * @return the actionName value. + */ + public String actionName() { + return this.actionName; + } + + /** + * Set the actionName property: Property actionName. + * + * @param actionName the actionName value to set. + * @return the CustomAction object itself. + */ + public CustomAction withActionName(String actionName) { + this.actionName = actionName; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (actionDefinition() != null) { + actionDefinition().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("actionDefinition", this.actionDefinition); + jsonWriter.writeStringField("actionName", this.actionName); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of CustomAction from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of CustomAction if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the CustomAction. + */ + public static CustomAction fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + CustomAction deserializedCustomAction = new CustomAction(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("actionDefinition".equals(fieldName)) { + deserializedCustomAction.actionDefinition = ActionDefinition.fromJson(reader); + } else if ("actionName".equals(fieldName)) { + deserializedCustomAction.actionName = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedCustomAction; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/CustomActionAutoGenerated.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/CustomActionAutoGenerated.java new file mode 100644 index 000000000000..40d7c310f48e --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/CustomActionAutoGenerated.java @@ -0,0 +1,125 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of CustomAction. + */ +@Fluent +public final class CustomActionAutoGenerated implements JsonSerializable { + /* + * Property actionDefinition + */ + private ActionDefinitionAutoGenerated actionDefinition; + + /* + * Property actionName + */ + private String actionName; + + /** + * Creates an instance of CustomActionAutoGenerated class. + */ + public CustomActionAutoGenerated() { + } + + /** + * Get the actionDefinition property: Property actionDefinition. + * + * @return the actionDefinition value. + */ + public ActionDefinitionAutoGenerated actionDefinition() { + return this.actionDefinition; + } + + /** + * Set the actionDefinition property: Property actionDefinition. + * + * @param actionDefinition the actionDefinition value to set. + * @return the CustomActionAutoGenerated object itself. + */ + public CustomActionAutoGenerated withActionDefinition(ActionDefinitionAutoGenerated actionDefinition) { + this.actionDefinition = actionDefinition; + return this; + } + + /** + * Get the actionName property: Property actionName. + * + * @return the actionName value. + */ + public String actionName() { + return this.actionName; + } + + /** + * Set the actionName property: Property actionName. + * + * @param actionName the actionName value to set. + * @return the CustomActionAutoGenerated object itself. + */ + public CustomActionAutoGenerated withActionName(String actionName) { + this.actionName = actionName; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (actionDefinition() != null) { + actionDefinition().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("actionDefinition", this.actionDefinition); + jsonWriter.writeStringField("actionName", this.actionName); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of CustomActionAutoGenerated from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of CustomActionAutoGenerated if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IOException If an error occurs while reading the CustomActionAutoGenerated. + */ + public static CustomActionAutoGenerated fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + CustomActionAutoGenerated deserializedCustomActionAutoGenerated = new CustomActionAutoGenerated(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("actionDefinition".equals(fieldName)) { + deserializedCustomActionAutoGenerated.actionDefinition + = ActionDefinitionAutoGenerated.fromJson(reader); + } else if ("actionName".equals(fieldName)) { + deserializedCustomActionAutoGenerated.actionName = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedCustomActionAutoGenerated; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/CustomErrorResponse.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/CustomErrorResponse.java new file mode 100644 index 000000000000..eb50c0237679 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/CustomErrorResponse.java @@ -0,0 +1,251 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of CustomErrorResponse. + */ +@Fluent +public final class CustomErrorResponse implements JsonSerializable { + /* + * The minimum amount of time, in seconds, that you want CloudFront to cache the HTTP status code specified in + * ``ErrorCode``. When this time period has elapsed, CloudFront queries your origin to see whether the problem that + * caused the error has been resolved and the requested object is now available. For more information, see + * [Customizing Error + * Responses](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/custom-error-pages.html) in the + * *Amazon CloudFront Developer Guide*. + */ + private Integer errorCachingMinTtl; + + /* + * The HTTP status code for which you want to specify a custom error page and/or a caching duration. + */ + private Integer errorCode; + + /* + * The HTTP status code that you want CloudFront to return to the viewer along with the custom error page. There are + * a variety of reasons that you might want CloudFront to return a status code different from the status code that + * your origin returned to CloudFront, for example: + Some Internet devices (some firewalls and corporate proxies, + * for example) intercept HTTP 4xx and 5xx and prevent the response from being returned to the viewer. If you + * substitute ``200``, the response typically won't be intercepted. + If you don't care about distinguishing among + * different client errors or server errors, you can specify ``400`` or ``500`` as the ``ResponseCode`` for all 4xx + * or 5xx errors. + You might want to return a ``200`` status code (OK) and static website so your customers don't + * know that your website is down. If you specify a value for ``ResponseCode``, you must also specify a value for + * ``ResponsePagePath``. + */ + private Integer responseCode; + + /* + * The path to the custom error page that you want CloudFront to return to a viewer when your origin returns the + * HTTP status code specified by ``ErrorCode``, for example, ``/4xx-errors/403-forbidden.html``. If you want to + * store your objects and your custom error pages in different locations, your distribution must include a cache + * behavior for which the following is true: + The value of ``PathPattern`` matches the path to your custom error + * messages. For example, suppose you saved custom error pages for 4xx errors in an Amazon S3 bucket in a directory + * named ``/4xx-errors``. Your distribution must include a cache behavior for which the path pattern routes requests + * for your custom error pages to that location, for example, ``/4xx-errors/*``. + The value of ``TargetOriginId`` + * specifies the value of the ``ID`` element for the origin that contains your custom error pages. If you specify a + * value for ``ResponsePagePath``, you must also specify a value for ``ResponseCode``. We recommend that you store + * custom error pages in an Amazon S3 bucket. If you store custom error pages on an HTTP server and the server + * starts to return 5xx errors, CloudFront can't get the files that you want to return to viewers because the origin + * server is unavailable. + */ + private String responsePagePath; + + /** + * Creates an instance of CustomErrorResponse class. + */ + public CustomErrorResponse() { + } + + /** + * Get the errorCachingMinTtl property: The minimum amount of time, in seconds, that you want CloudFront to cache + * the HTTP status code specified in ``ErrorCode``. When this time period has elapsed, CloudFront queries your + * origin to see whether the problem that caused the error has been resolved and the requested object is now + * available. For more information, see [Customizing Error + * Responses](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/custom-error-pages.html) in the + * *Amazon CloudFront Developer Guide*. + * + * @return the errorCachingMinTtl value. + */ + public Integer errorCachingMinTtl() { + return this.errorCachingMinTtl; + } + + /** + * Set the errorCachingMinTtl property: The minimum amount of time, in seconds, that you want CloudFront to cache + * the HTTP status code specified in ``ErrorCode``. When this time period has elapsed, CloudFront queries your + * origin to see whether the problem that caused the error has been resolved and the requested object is now + * available. For more information, see [Customizing Error + * Responses](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/custom-error-pages.html) in the + * *Amazon CloudFront Developer Guide*. + * + * @param errorCachingMinTtl the errorCachingMinTtl value to set. + * @return the CustomErrorResponse object itself. + */ + public CustomErrorResponse withErrorCachingMinTtl(Integer errorCachingMinTtl) { + this.errorCachingMinTtl = errorCachingMinTtl; + return this; + } + + /** + * Get the errorCode property: The HTTP status code for which you want to specify a custom error page and/or a + * caching duration. + * + * @return the errorCode value. + */ + public Integer errorCode() { + return this.errorCode; + } + + /** + * Set the errorCode property: The HTTP status code for which you want to specify a custom error page and/or a + * caching duration. + * + * @param errorCode the errorCode value to set. + * @return the CustomErrorResponse object itself. + */ + public CustomErrorResponse withErrorCode(Integer errorCode) { + this.errorCode = errorCode; + return this; + } + + /** + * Get the responseCode property: The HTTP status code that you want CloudFront to return to the viewer along with + * the custom error page. There are a variety of reasons that you might want CloudFront to return a status code + * different from the status code that your origin returned to CloudFront, for example: + Some Internet devices + * (some firewalls and corporate proxies, for example) intercept HTTP 4xx and 5xx and prevent the response from + * being returned to the viewer. If you substitute ``200``, the response typically won't be intercepted. + If you + * don't care about distinguishing among different client errors or server errors, you can specify ``400`` or + * ``500`` as the ``ResponseCode`` for all 4xx or 5xx errors. + You might want to return a ``200`` status code (OK) + * and static website so your customers don't know that your website is down. If you specify a value for + * ``ResponseCode``, you must also specify a value for ``ResponsePagePath``. + * + * @return the responseCode value. + */ + public Integer responseCode() { + return this.responseCode; + } + + /** + * Set the responseCode property: The HTTP status code that you want CloudFront to return to the viewer along with + * the custom error page. There are a variety of reasons that you might want CloudFront to return a status code + * different from the status code that your origin returned to CloudFront, for example: + Some Internet devices + * (some firewalls and corporate proxies, for example) intercept HTTP 4xx and 5xx and prevent the response from + * being returned to the viewer. If you substitute ``200``, the response typically won't be intercepted. + If you + * don't care about distinguishing among different client errors or server errors, you can specify ``400`` or + * ``500`` as the ``ResponseCode`` for all 4xx or 5xx errors. + You might want to return a ``200`` status code (OK) + * and static website so your customers don't know that your website is down. If you specify a value for + * ``ResponseCode``, you must also specify a value for ``ResponsePagePath``. + * + * @param responseCode the responseCode value to set. + * @return the CustomErrorResponse object itself. + */ + public CustomErrorResponse withResponseCode(Integer responseCode) { + this.responseCode = responseCode; + return this; + } + + /** + * Get the responsePagePath property: The path to the custom error page that you want CloudFront to return to a + * viewer when your origin returns the HTTP status code specified by ``ErrorCode``, for example, + * ``/4xx-errors/403-forbidden.html``. If you want to store your objects and your custom error pages in different + * locations, your distribution must include a cache behavior for which the following is true: + The value of + * ``PathPattern`` matches the path to your custom error messages. For example, suppose you saved custom error pages + * for 4xx errors in an Amazon S3 bucket in a directory named ``/4xx-errors``. Your distribution must include a + * cache behavior for which the path pattern routes requests for your custom error pages to that location, for + * example, ``/4xx-errors/*``. + The value of ``TargetOriginId`` specifies the value of the ``ID`` element for the + * origin that contains your custom error pages. If you specify a value for ``ResponsePagePath``, you must also + * specify a value for ``ResponseCode``. We recommend that you store custom error pages in an Amazon S3 bucket. If + * you store custom error pages on an HTTP server and the server starts to return 5xx errors, CloudFront can't get + * the files that you want to return to viewers because the origin server is unavailable. + * + * @return the responsePagePath value. + */ + public String responsePagePath() { + return this.responsePagePath; + } + + /** + * Set the responsePagePath property: The path to the custom error page that you want CloudFront to return to a + * viewer when your origin returns the HTTP status code specified by ``ErrorCode``, for example, + * ``/4xx-errors/403-forbidden.html``. If you want to store your objects and your custom error pages in different + * locations, your distribution must include a cache behavior for which the following is true: + The value of + * ``PathPattern`` matches the path to your custom error messages. For example, suppose you saved custom error pages + * for 4xx errors in an Amazon S3 bucket in a directory named ``/4xx-errors``. Your distribution must include a + * cache behavior for which the path pattern routes requests for your custom error pages to that location, for + * example, ``/4xx-errors/*``. + The value of ``TargetOriginId`` specifies the value of the ``ID`` element for the + * origin that contains your custom error pages. If you specify a value for ``ResponsePagePath``, you must also + * specify a value for ``ResponseCode``. We recommend that you store custom error pages in an Amazon S3 bucket. If + * you store custom error pages on an HTTP server and the server starts to return 5xx errors, CloudFront can't get + * the files that you want to return to viewers because the origin server is unavailable. + * + * @param responsePagePath the responsePagePath value to set. + * @return the CustomErrorResponse object itself. + */ + public CustomErrorResponse withResponsePagePath(String responsePagePath) { + this.responsePagePath = responsePagePath; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeNumberField("errorCachingMinTTL", this.errorCachingMinTtl); + jsonWriter.writeNumberField("errorCode", this.errorCode); + jsonWriter.writeNumberField("responseCode", this.responseCode); + jsonWriter.writeStringField("responsePagePath", this.responsePagePath); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of CustomErrorResponse from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of CustomErrorResponse if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the CustomErrorResponse. + */ + public static CustomErrorResponse fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + CustomErrorResponse deserializedCustomErrorResponse = new CustomErrorResponse(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("errorCachingMinTTL".equals(fieldName)) { + deserializedCustomErrorResponse.errorCachingMinTtl = reader.getNullable(JsonReader::getInt); + } else if ("errorCode".equals(fieldName)) { + deserializedCustomErrorResponse.errorCode = reader.getNullable(JsonReader::getInt); + } else if ("responseCode".equals(fieldName)) { + deserializedCustomErrorResponse.responseCode = reader.getNullable(JsonReader::getInt); + } else if ("responsePagePath".equals(fieldName)) { + deserializedCustomErrorResponse.responsePagePath = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedCustomErrorResponse; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/CustomOriginConfig.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/CustomOriginConfig.java new file mode 100644 index 000000000000..096defeed67a --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/CustomOriginConfig.java @@ -0,0 +1,286 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Definition of CustomOriginConfig. + */ +@Fluent +public final class CustomOriginConfig implements JsonSerializable { + /* + * The HTTP port that CloudFront uses to connect to the origin. Specify the HTTP port that the origin listens on. + */ + private Integer httpPort; + + /* + * The HTTPS port that CloudFront uses to connect to the origin. Specify the HTTPS port that the origin listens on. + */ + private Integer httpsPort; + + /* + * Specifies how long, in seconds, CloudFront persists its connection to the origin. The minimum timeout is 1 + * second, the maximum is 60 seconds, and the default (if you don't specify otherwise) is 5 seconds. For more + * information, see [Origin Keep-alive + * Timeout](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/distribution-web-values-specify.html# + * DownloadDistValuesOriginKeepaliveTimeout) in the *Amazon CloudFront Developer Guide*. + */ + private Integer originKeepaliveTimeout; + + /* + * Specifies the protocol (HTTP or HTTPS) that CloudFront uses to connect to the origin. Valid values are: + + * ``http-only`` – CloudFront always uses HTTP to connect to the origin. + ``match-viewer`` – CloudFront connects to + * the origin using the same protocol that the viewer used to connect to CloudFront. + ``https-only`` – CloudFront + * always uses HTTPS to connect to the origin. + */ + private String originProtocolPolicy; + + /* + * Specifies how long, in seconds, CloudFront waits for a response from the origin. This is also known as the + * *origin response timeout*. The minimum timeout is 1 second, the maximum is 60 seconds, and the default (if you + * don't specify otherwise) is 30 seconds. For more information, see [Origin Response + * Timeout](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/distribution-web-values-specify.html# + * DownloadDistValuesOriginResponseTimeout) in the *Amazon CloudFront Developer Guide*. + */ + private Integer originReadTimeout; + + /* + * Specifies the minimum SSL/TLS protocol that CloudFront uses when connecting to your origin over HTTPS. Valid + * values include ``SSLv3``, ``TLSv1``, ``TLSv1.1``, and ``TLSv1.2``. For more information, see [Minimum Origin SSL + * Protocol](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/distribution-web-values-specify.html + * #DownloadDistValuesOriginSSLProtocols) in the *Amazon CloudFront Developer Guide*. + */ + private List originSslProtocols; + + /** + * Creates an instance of CustomOriginConfig class. + */ + public CustomOriginConfig() { + } + + /** + * Get the httpPort property: The HTTP port that CloudFront uses to connect to the origin. Specify the HTTP port + * that the origin listens on. + * + * @return the httpPort value. + */ + public Integer httpPort() { + return this.httpPort; + } + + /** + * Set the httpPort property: The HTTP port that CloudFront uses to connect to the origin. Specify the HTTP port + * that the origin listens on. + * + * @param httpPort the httpPort value to set. + * @return the CustomOriginConfig object itself. + */ + public CustomOriginConfig withHttpPort(Integer httpPort) { + this.httpPort = httpPort; + return this; + } + + /** + * Get the httpsPort property: The HTTPS port that CloudFront uses to connect to the origin. Specify the HTTPS port + * that the origin listens on. + * + * @return the httpsPort value. + */ + public Integer httpsPort() { + return this.httpsPort; + } + + /** + * Set the httpsPort property: The HTTPS port that CloudFront uses to connect to the origin. Specify the HTTPS port + * that the origin listens on. + * + * @param httpsPort the httpsPort value to set. + * @return the CustomOriginConfig object itself. + */ + public CustomOriginConfig withHttpsPort(Integer httpsPort) { + this.httpsPort = httpsPort; + return this; + } + + /** + * Get the originKeepaliveTimeout property: Specifies how long, in seconds, CloudFront persists its connection to + * the origin. The minimum timeout is 1 second, the maximum is 60 seconds, and the default (if you don't specify + * otherwise) is 5 seconds. For more information, see [Origin Keep-alive + * Timeout](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/distribution-web-values-specify.html#DownloadDistValuesOriginKeepaliveTimeout) + * in the *Amazon CloudFront Developer Guide*. + * + * @return the originKeepaliveTimeout value. + */ + public Integer originKeepaliveTimeout() { + return this.originKeepaliveTimeout; + } + + /** + * Set the originKeepaliveTimeout property: Specifies how long, in seconds, CloudFront persists its connection to + * the origin. The minimum timeout is 1 second, the maximum is 60 seconds, and the default (if you don't specify + * otherwise) is 5 seconds. For more information, see [Origin Keep-alive + * Timeout](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/distribution-web-values-specify.html#DownloadDistValuesOriginKeepaliveTimeout) + * in the *Amazon CloudFront Developer Guide*. + * + * @param originKeepaliveTimeout the originKeepaliveTimeout value to set. + * @return the CustomOriginConfig object itself. + */ + public CustomOriginConfig withOriginKeepaliveTimeout(Integer originKeepaliveTimeout) { + this.originKeepaliveTimeout = originKeepaliveTimeout; + return this; + } + + /** + * Get the originProtocolPolicy property: Specifies the protocol (HTTP or HTTPS) that CloudFront uses to connect to + * the origin. Valid values are: + ``http-only`` – CloudFront always uses HTTP to connect to the origin. + + * ``match-viewer`` – CloudFront connects to the origin using the same protocol that the viewer used to connect to + * CloudFront. + ``https-only`` – CloudFront always uses HTTPS to connect to the origin. + * + * @return the originProtocolPolicy value. + */ + public String originProtocolPolicy() { + return this.originProtocolPolicy; + } + + /** + * Set the originProtocolPolicy property: Specifies the protocol (HTTP or HTTPS) that CloudFront uses to connect to + * the origin. Valid values are: + ``http-only`` – CloudFront always uses HTTP to connect to the origin. + + * ``match-viewer`` – CloudFront connects to the origin using the same protocol that the viewer used to connect to + * CloudFront. + ``https-only`` – CloudFront always uses HTTPS to connect to the origin. + * + * @param originProtocolPolicy the originProtocolPolicy value to set. + * @return the CustomOriginConfig object itself. + */ + public CustomOriginConfig withOriginProtocolPolicy(String originProtocolPolicy) { + this.originProtocolPolicy = originProtocolPolicy; + return this; + } + + /** + * Get the originReadTimeout property: Specifies how long, in seconds, CloudFront waits for a response from the + * origin. This is also known as the *origin response timeout*. The minimum timeout is 1 second, the maximum is 60 + * seconds, and the default (if you don't specify otherwise) is 30 seconds. For more information, see [Origin + * Response + * Timeout](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/distribution-web-values-specify.html#DownloadDistValuesOriginResponseTimeout) + * in the *Amazon CloudFront Developer Guide*. + * + * @return the originReadTimeout value. + */ + public Integer originReadTimeout() { + return this.originReadTimeout; + } + + /** + * Set the originReadTimeout property: Specifies how long, in seconds, CloudFront waits for a response from the + * origin. This is also known as the *origin response timeout*. The minimum timeout is 1 second, the maximum is 60 + * seconds, and the default (if you don't specify otherwise) is 30 seconds. For more information, see [Origin + * Response + * Timeout](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/distribution-web-values-specify.html#DownloadDistValuesOriginResponseTimeout) + * in the *Amazon CloudFront Developer Guide*. + * + * @param originReadTimeout the originReadTimeout value to set. + * @return the CustomOriginConfig object itself. + */ + public CustomOriginConfig withOriginReadTimeout(Integer originReadTimeout) { + this.originReadTimeout = originReadTimeout; + return this; + } + + /** + * Get the originSslProtocols property: Specifies the minimum SSL/TLS protocol that CloudFront uses when connecting + * to your origin over HTTPS. Valid values include ``SSLv3``, ``TLSv1``, ``TLSv1.1``, and ``TLSv1.2``. For more + * information, see [Minimum Origin SSL + * Protocol](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/distribution-web-values-specify.html#DownloadDistValuesOriginSSLProtocols) + * in the *Amazon CloudFront Developer Guide*. + * + * @return the originSslProtocols value. + */ + public List originSslProtocols() { + return this.originSslProtocols; + } + + /** + * Set the originSslProtocols property: Specifies the minimum SSL/TLS protocol that CloudFront uses when connecting + * to your origin over HTTPS. Valid values include ``SSLv3``, ``TLSv1``, ``TLSv1.1``, and ``TLSv1.2``. For more + * information, see [Minimum Origin SSL + * Protocol](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/distribution-web-values-specify.html#DownloadDistValuesOriginSSLProtocols) + * in the *Amazon CloudFront Developer Guide*. + * + * @param originSslProtocols the originSslProtocols value to set. + * @return the CustomOriginConfig object itself. + */ + public CustomOriginConfig withOriginSslProtocols(List originSslProtocols) { + this.originSslProtocols = originSslProtocols; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeNumberField("httpPort", this.httpPort); + jsonWriter.writeNumberField("httpsPort", this.httpsPort); + jsonWriter.writeNumberField("originKeepaliveTimeout", this.originKeepaliveTimeout); + jsonWriter.writeStringField("originProtocolPolicy", this.originProtocolPolicy); + jsonWriter.writeNumberField("originReadTimeout", this.originReadTimeout); + jsonWriter.writeArrayField("originSSLProtocols", this.originSslProtocols, + (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of CustomOriginConfig from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of CustomOriginConfig if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the CustomOriginConfig. + */ + public static CustomOriginConfig fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + CustomOriginConfig deserializedCustomOriginConfig = new CustomOriginConfig(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("httpPort".equals(fieldName)) { + deserializedCustomOriginConfig.httpPort = reader.getNullable(JsonReader::getInt); + } else if ("httpsPort".equals(fieldName)) { + deserializedCustomOriginConfig.httpsPort = reader.getNullable(JsonReader::getInt); + } else if ("originKeepaliveTimeout".equals(fieldName)) { + deserializedCustomOriginConfig.originKeepaliveTimeout = reader.getNullable(JsonReader::getInt); + } else if ("originProtocolPolicy".equals(fieldName)) { + deserializedCustomOriginConfig.originProtocolPolicy = reader.getString(); + } else if ("originReadTimeout".equals(fieldName)) { + deserializedCustomOriginConfig.originReadTimeout = reader.getNullable(JsonReader::getInt); + } else if ("originSSLProtocols".equals(fieldName)) { + List originSslProtocols = reader.readArray(reader1 -> reader1.getString()); + deserializedCustomOriginConfig.originSslProtocols = originSslProtocols; + } else { + reader.skipChildren(); + } + } + + return deserializedCustomOriginConfig; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/DBClusterRole.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/DBClusterRole.java new file mode 100644 index 000000000000..59e1bf604a03 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/DBClusterRole.java @@ -0,0 +1,124 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of DBClusterRole. + */ +@Fluent +public final class DBClusterRole implements JsonSerializable { + /* + * The name of the feature associated with the AWS Identity and Access Management (IAM) role. For the list of + * supported feature names, see DBEngineVersion in the Amazon RDS API Reference. + */ + private String featureName; + + /* + * The Amazon Resource Name (ARN) of the IAM role that is associated with the DB cluster. + */ + private String roleArn; + + /** + * Creates an instance of DBClusterRole class. + */ + public DBClusterRole() { + } + + /** + * Get the featureName property: The name of the feature associated with the AWS Identity and Access Management + * (IAM) role. For the list of supported feature names, see DBEngineVersion in the Amazon RDS API Reference. + * + * @return the featureName value. + */ + public String featureName() { + return this.featureName; + } + + /** + * Set the featureName property: The name of the feature associated with the AWS Identity and Access Management + * (IAM) role. For the list of supported feature names, see DBEngineVersion in the Amazon RDS API Reference. + * + * @param featureName the featureName value to set. + * @return the DBClusterRole object itself. + */ + public DBClusterRole withFeatureName(String featureName) { + this.featureName = featureName; + return this; + } + + /** + * Get the roleArn property: The Amazon Resource Name (ARN) of the IAM role that is associated with the DB cluster. + * + * @return the roleArn value. + */ + public String roleArn() { + return this.roleArn; + } + + /** + * Set the roleArn property: The Amazon Resource Name (ARN) of the IAM role that is associated with the DB cluster. + * + * @param roleArn the roleArn value to set. + * @return the DBClusterRole object itself. + */ + public DBClusterRole withRoleArn(String roleArn) { + this.roleArn = roleArn; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("featureName", this.featureName); + jsonWriter.writeStringField("roleArn", this.roleArn); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of DBClusterRole from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of DBClusterRole if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the DBClusterRole. + */ + public static DBClusterRole fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + DBClusterRole deserializedDBClusterRole = new DBClusterRole(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("featureName".equals(fieldName)) { + deserializedDBClusterRole.featureName = reader.getString(); + } else if ("roleArn".equals(fieldName)) { + deserializedDBClusterRole.roleArn = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedDBClusterRole; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/DBInstanceRole.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/DBInstanceRole.java new file mode 100644 index 000000000000..0ee71fb9444d --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/DBInstanceRole.java @@ -0,0 +1,135 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of DBInstanceRole. + */ +@Fluent +public final class DBInstanceRole implements JsonSerializable { + /* + * The name of the feature associated with the AWS Identity and Access Management (IAM) role. IAM roles that are + * associated with a DB instance grant permission for the DB instance to access other AWS services on your behalf. + * For the list of supported feature names, see the ``SupportedFeatureNames`` description in + * [DBEngineVersion](https://docs.aws.amazon.com/AmazonRDS/latest/APIReference/API_DBEngineVersion.html) in the + * *Amazon RDS API Reference*. + */ + private String featureName; + + /* + * The Amazon Resource Name (ARN) of the IAM role that is associated with the DB instance. + */ + private String roleArn; + + /** + * Creates an instance of DBInstanceRole class. + */ + public DBInstanceRole() { + } + + /** + * Get the featureName property: The name of the feature associated with the AWS Identity and Access Management + * (IAM) role. IAM roles that are associated with a DB instance grant permission for the DB instance to access other + * AWS services on your behalf. For the list of supported feature names, see the ``SupportedFeatureNames`` + * description in + * [DBEngineVersion](https://docs.aws.amazon.com/AmazonRDS/latest/APIReference/API_DBEngineVersion.html) in the + * *Amazon RDS API Reference*. + * + * @return the featureName value. + */ + public String featureName() { + return this.featureName; + } + + /** + * Set the featureName property: The name of the feature associated with the AWS Identity and Access Management + * (IAM) role. IAM roles that are associated with a DB instance grant permission for the DB instance to access other + * AWS services on your behalf. For the list of supported feature names, see the ``SupportedFeatureNames`` + * description in + * [DBEngineVersion](https://docs.aws.amazon.com/AmazonRDS/latest/APIReference/API_DBEngineVersion.html) in the + * *Amazon RDS API Reference*. + * + * @param featureName the featureName value to set. + * @return the DBInstanceRole object itself. + */ + public DBInstanceRole withFeatureName(String featureName) { + this.featureName = featureName; + return this; + } + + /** + * Get the roleArn property: The Amazon Resource Name (ARN) of the IAM role that is associated with the DB instance. + * + * @return the roleArn value. + */ + public String roleArn() { + return this.roleArn; + } + + /** + * Set the roleArn property: The Amazon Resource Name (ARN) of the IAM role that is associated with the DB instance. + * + * @param roleArn the roleArn value to set. + * @return the DBInstanceRole object itself. + */ + public DBInstanceRole withRoleArn(String roleArn) { + this.roleArn = roleArn; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("featureName", this.featureName); + jsonWriter.writeStringField("roleArn", this.roleArn); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of DBInstanceRole from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of DBInstanceRole if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the DBInstanceRole. + */ + public static DBInstanceRole fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + DBInstanceRole deserializedDBInstanceRole = new DBInstanceRole(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("featureName".equals(fieldName)) { + deserializedDBInstanceRole.featureName = reader.getString(); + } else if ("roleArn".equals(fieldName)) { + deserializedDBInstanceRole.roleArn = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedDBInstanceRole; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/DBSnapshotAttribute.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/DBSnapshotAttribute.java new file mode 100644 index 000000000000..0ce4d104f094 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/DBSnapshotAttribute.java @@ -0,0 +1,143 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Definition of DBSnapshotAttribute. + */ +@Fluent +public final class DBSnapshotAttribute implements JsonSerializable { + /* + *

The name of the manual DB snapshot attribute.

The attribute named restore refers to the + * list of Amazon Web Services accounts that have permission to copy or restore the manual DB cluster snapshot. For + * more information, see the ModifyDBSnapshotAttribute API action.

+ */ + private String attributeName; + + /* + *

The value or values for the manual DB snapshot attribute.

If the AttributeName field is + * set to restore, then this element returns a list of IDs of the Amazon Web Services accounts that are + * authorized to copy or restore the manual DB snapshot. If a value of all is in the list, then the + * manual DB snapshot is public and available for any Amazon Web Services account to copy or restore.

+ */ + private List attributeValues; + + /** + * Creates an instance of DBSnapshotAttribute class. + */ + public DBSnapshotAttribute() { + } + + /** + * Get the attributeName property: <p>The name of the manual DB snapshot attribute.</p> <p>The + * attribute named <code>restore</code> refers to the list of Amazon Web Services accounts that have + * permission to copy or restore the manual DB cluster snapshot. For more information, see the + * <code>ModifyDBSnapshotAttribute</code> API action.</p>. + * + * @return the attributeName value. + */ + public String attributeName() { + return this.attributeName; + } + + /** + * Set the attributeName property: <p>The name of the manual DB snapshot attribute.</p> <p>The + * attribute named <code>restore</code> refers to the list of Amazon Web Services accounts that have + * permission to copy or restore the manual DB cluster snapshot. For more information, see the + * <code>ModifyDBSnapshotAttribute</code> API action.</p>. + * + * @param attributeName the attributeName value to set. + * @return the DBSnapshotAttribute object itself. + */ + public DBSnapshotAttribute withAttributeName(String attributeName) { + this.attributeName = attributeName; + return this; + } + + /** + * Get the attributeValues property: <p>The value or values for the manual DB snapshot attribute.</p> + * <p>If the <code>AttributeName</code> field is set to <code>restore</code>, then + * this element returns a list of IDs of the Amazon Web Services accounts that are authorized to copy or restore the + * manual DB snapshot. If a value of <code>all</code> is in the list, then the manual DB snapshot is + * public and available for any Amazon Web Services account to copy or restore.</p>. + * + * @return the attributeValues value. + */ + public List attributeValues() { + return this.attributeValues; + } + + /** + * Set the attributeValues property: <p>The value or values for the manual DB snapshot attribute.</p> + * <p>If the <code>AttributeName</code> field is set to <code>restore</code>, then + * this element returns a list of IDs of the Amazon Web Services accounts that are authorized to copy or restore the + * manual DB snapshot. If a value of <code>all</code> is in the list, then the manual DB snapshot is + * public and available for any Amazon Web Services account to copy or restore.</p>. + * + * @param attributeValues the attributeValues value to set. + * @return the DBSnapshotAttribute object itself. + */ + public DBSnapshotAttribute withAttributeValues(List attributeValues) { + this.attributeValues = attributeValues; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("attributeName", this.attributeName); + jsonWriter.writeArrayField("attributeValues", this.attributeValues, + (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of DBSnapshotAttribute from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of DBSnapshotAttribute if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the DBSnapshotAttribute. + */ + public static DBSnapshotAttribute fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + DBSnapshotAttribute deserializedDBSnapshotAttribute = new DBSnapshotAttribute(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("attributeName".equals(fieldName)) { + deserializedDBSnapshotAttribute.attributeName = reader.getString(); + } else if ("attributeValues".equals(fieldName)) { + List attributeValues = reader.readArray(reader1 -> reader1.getString()); + deserializedDBSnapshotAttribute.attributeValues = attributeValues; + } else { + reader.skipChildren(); + } + } + + return deserializedDBSnapshotAttribute; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/DataExport.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/DataExport.java new file mode 100644 index 000000000000..5503458a08ec --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/DataExport.java @@ -0,0 +1,129 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of DataExport. + */ +@Fluent +public final class DataExport implements JsonSerializable { + /* + * The place to store the data for an analysis. Specifies information about where to publish analysis or + * configuration results for an Amazon S3 bucket. + */ + private Destination destination; + + /* + * The version of the output schema to use when exporting data. Must be ``V_1``. + */ + private String outputSchemaVersion; + + /** + * Creates an instance of DataExport class. + */ + public DataExport() { + } + + /** + * Get the destination property: The place to store the data for an analysis. Specifies information about where to + * publish analysis or configuration results for an Amazon S3 bucket. + * + * @return the destination value. + */ + public Destination destination() { + return this.destination; + } + + /** + * Set the destination property: The place to store the data for an analysis. Specifies information about where to + * publish analysis or configuration results for an Amazon S3 bucket. + * + * @param destination the destination value to set. + * @return the DataExport object itself. + */ + public DataExport withDestination(Destination destination) { + this.destination = destination; + return this; + } + + /** + * Get the outputSchemaVersion property: The version of the output schema to use when exporting data. Must be + * ``V_1``. + * + * @return the outputSchemaVersion value. + */ + public String outputSchemaVersion() { + return this.outputSchemaVersion; + } + + /** + * Set the outputSchemaVersion property: The version of the output schema to use when exporting data. Must be + * ``V_1``. + * + * @param outputSchemaVersion the outputSchemaVersion value to set. + * @return the DataExport object itself. + */ + public DataExport withOutputSchemaVersion(String outputSchemaVersion) { + this.outputSchemaVersion = outputSchemaVersion; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (destination() != null) { + destination().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("destination", this.destination); + jsonWriter.writeStringField("outputSchemaVersion", this.outputSchemaVersion); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of DataExport from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of DataExport if the JsonReader was pointing to an instance of it, or null if it was pointing + * to JSON null. + * @throws IOException If an error occurs while reading the DataExport. + */ + public static DataExport fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + DataExport deserializedDataExport = new DataExport(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("destination".equals(fieldName)) { + deserializedDataExport.destination = Destination.fromJson(reader); + } else if ("outputSchemaVersion".equals(fieldName)) { + deserializedDataExport.outputSchemaVersion = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedDataExport; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/DataResource.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/DataResource.java new file mode 100644 index 000000000000..4e3b0486c588 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/DataResource.java @@ -0,0 +1,128 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Definition of DataResource. + */ +@Fluent +public final class DataResource implements JsonSerializable { + /* + * The resource type in which you want to log data events. You can specify AWS::S3::Object or AWS::Lambda::Function + * resources. + */ + private String type; + + /* + * An array of Amazon Resource Name (ARN) strings or partial ARN strings for the specified objects. + */ + private List values; + + /** + * Creates an instance of DataResource class. + */ + public DataResource() { + } + + /** + * Get the type property: The resource type in which you want to log data events. You can specify AWS::S3::Object or + * AWS::Lambda::Function resources. + * + * @return the type value. + */ + public String type() { + return this.type; + } + + /** + * Set the type property: The resource type in which you want to log data events. You can specify AWS::S3::Object or + * AWS::Lambda::Function resources. + * + * @param type the type value to set. + * @return the DataResource object itself. + */ + public DataResource withType(String type) { + this.type = type; + return this; + } + + /** + * Get the values property: An array of Amazon Resource Name (ARN) strings or partial ARN strings for the specified + * objects. + * + * @return the values value. + */ + public List values() { + return this.values; + } + + /** + * Set the values property: An array of Amazon Resource Name (ARN) strings or partial ARN strings for the specified + * objects. + * + * @param values the values value to set. + * @return the DataResource object itself. + */ + public DataResource withValues(List values) { + this.values = values; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("type", this.type); + jsonWriter.writeArrayField("values", this.values, (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of DataResource from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of DataResource if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the DataResource. + */ + public static DataResource fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + DataResource deserializedDataResource = new DataResource(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("type".equals(fieldName)) { + deserializedDataResource.type = reader.getString(); + } else if ("values".equals(fieldName)) { + List values = reader.readArray(reader1 -> reader1.getString()); + deserializedDataResource.values = values; + } else { + reader.skipChildren(); + } + } + + return deserializedDataResource; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/DataSourceLevelMetricsBehavior.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/DataSourceLevelMetricsBehavior.java new file mode 100644 index 000000000000..6fbdf31977ef --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/DataSourceLevelMetricsBehavior.java @@ -0,0 +1,52 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * DataSourceLevelMetricsBehavior enum. + */ +public final class DataSourceLevelMetricsBehavior extends ExpandableStringEnum { + /** + * Static value FULL_REQUEST_DATA_SOURCE_METRICS for DataSourceLevelMetricsBehavior. + */ + public static final DataSourceLevelMetricsBehavior FULL_REQUEST_DATA_SOURCE_METRICS + = fromString("FULL_REQUEST_DATA_SOURCE_METRICS"); + + /** + * Static value PER_DATA_SOURCE_METRICS for DataSourceLevelMetricsBehavior. + */ + public static final DataSourceLevelMetricsBehavior PER_DATA_SOURCE_METRICS = fromString("PER_DATA_SOURCE_METRICS"); + + /** + * Creates a new instance of DataSourceLevelMetricsBehavior value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public DataSourceLevelMetricsBehavior() { + } + + /** + * Creates or finds a DataSourceLevelMetricsBehavior from its string representation. + * + * @param name a name to look for. + * @return the corresponding DataSourceLevelMetricsBehavior. + */ + public static DataSourceLevelMetricsBehavior fromString(String name) { + return fromString(name, DataSourceLevelMetricsBehavior.class); + } + + /** + * Gets known DataSourceLevelMetricsBehavior values. + * + * @return known DataSourceLevelMetricsBehavior values. + */ + public static Collection values() { + return values(DataSourceLevelMetricsBehavior.class); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/DataSourceLevelMetricsBehaviorEnumValue.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/DataSourceLevelMetricsBehaviorEnumValue.java new file mode 100644 index 000000000000..34f9fed2a2f7 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/DataSourceLevelMetricsBehaviorEnumValue.java @@ -0,0 +1,96 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of DataSourceLevelMetricsBehaviorEnumValue. + */ +@Fluent +public final class DataSourceLevelMetricsBehaviorEnumValue + implements JsonSerializable { + /* + * Property value + */ + private DataSourceLevelMetricsBehavior value; + + /** + * Creates an instance of DataSourceLevelMetricsBehaviorEnumValue class. + */ + public DataSourceLevelMetricsBehaviorEnumValue() { + } + + /** + * Get the value property: Property value. + * + * @return the value value. + */ + public DataSourceLevelMetricsBehavior value() { + return this.value; + } + + /** + * Set the value property: Property value. + * + * @param value the value value to set. + * @return the DataSourceLevelMetricsBehaviorEnumValue object itself. + */ + public DataSourceLevelMetricsBehaviorEnumValue withValue(DataSourceLevelMetricsBehavior value) { + this.value = value; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("value", this.value == null ? null : this.value.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of DataSourceLevelMetricsBehaviorEnumValue from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of DataSourceLevelMetricsBehaviorEnumValue if the JsonReader was pointing to an instance of + * it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the DataSourceLevelMetricsBehaviorEnumValue. + */ + public static DataSourceLevelMetricsBehaviorEnumValue fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + DataSourceLevelMetricsBehaviorEnumValue deserializedDataSourceLevelMetricsBehaviorEnumValue + = new DataSourceLevelMetricsBehaviorEnumValue(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + deserializedDataSourceLevelMetricsBehaviorEnumValue.value + = DataSourceLevelMetricsBehavior.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedDataSourceLevelMetricsBehaviorEnumValue; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/DataType.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/DataType.java new file mode 100644 index 000000000000..5750aedff824 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/DataType.java @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * DataType enum. + */ +public final class DataType extends ExpandableStringEnum { + /** + * Static value aws:ec2:image for DataType. + */ + public static final DataType AWS_EC2_IMAGE = fromString("aws:ec2:image"); + + /** + * Static value text for DataType. + */ + public static final DataType TEXT = fromString("text"); + + /** + * Creates a new instance of DataType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public DataType() { + } + + /** + * Creates or finds a DataType from its string representation. + * + * @param name a name to look for. + * @return the corresponding DataType. + */ + public static DataType fromString(String name) { + return fromString(name, DataType.class); + } + + /** + * Gets known DataType values. + * + * @return known DataType values. + */ + public static Collection values() { + return values(DataType.class); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/DatabaseMigrationServiceReplicationInstance.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/DatabaseMigrationServiceReplicationInstance.java new file mode 100644 index 000000000000..2b6418038b25 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/DatabaseMigrationServiceReplicationInstance.java @@ -0,0 +1,254 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.awsconnector.fluent.models.DatabaseMigrationServiceReplicationInstanceInner; +import java.util.Map; + +/** + * An immutable client-side representation of DatabaseMigrationServiceReplicationInstance. + */ +public interface DatabaseMigrationServiceReplicationInstance { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the location property: The geo-location where the resource lives. + * + * @return the location value. + */ + String location(); + + /** + * Gets the tags property: Resource tags. + * + * @return the tags value. + */ + Map tags(); + + /** + * Gets the properties property: The resource-specific properties for this resource. + * + * @return the properties value. + */ + DatabaseMigrationServiceReplicationInstanceProperties properties(); + + /** + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the region of the resource. + * + * @return the region of the resource. + */ + Region region(); + + /** + * Gets the name of the resource region. + * + * @return the name of the resource region. + */ + String regionName(); + + /** + * Gets the name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + + /** + * Gets the inner + * com.azure.resourcemanager.awsconnector.fluent.models.DatabaseMigrationServiceReplicationInstanceInner object. + * + * @return the inner object. + */ + DatabaseMigrationServiceReplicationInstanceInner innerModel(); + + /** + * The entirety of the DatabaseMigrationServiceReplicationInstance definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithLocation, + DefinitionStages.WithResourceGroup, DefinitionStages.WithCreate { + } + + /** + * The DatabaseMigrationServiceReplicationInstance definition stages. + */ + interface DefinitionStages { + /** + * The first stage of the DatabaseMigrationServiceReplicationInstance definition. + */ + interface Blank extends WithLocation { + } + + /** + * The stage of the DatabaseMigrationServiceReplicationInstance definition allowing to specify location. + */ + interface WithLocation { + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithResourceGroup withRegion(Region location); + + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithResourceGroup withRegion(String location); + } + + /** + * The stage of the DatabaseMigrationServiceReplicationInstance definition allowing to specify parent resource. + */ + interface WithResourceGroup { + /** + * Specifies resourceGroupName. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @return the next definition stage. + */ + WithCreate withExistingResourceGroup(String resourceGroupName); + } + + /** + * The stage of the DatabaseMigrationServiceReplicationInstance 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.WithProperties { + /** + * Executes the create request. + * + * @return the created resource. + */ + DatabaseMigrationServiceReplicationInstance create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + DatabaseMigrationServiceReplicationInstance create(Context context); + } + + /** + * The stage of the DatabaseMigrationServiceReplicationInstance definition allowing to specify tags. + */ + interface WithTags { + /** + * Specifies the tags property: Resource tags.. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + WithCreate withTags(Map tags); + } + + /** + * The stage of the DatabaseMigrationServiceReplicationInstance definition allowing to specify properties. + */ + interface WithProperties { + /** + * Specifies the properties property: The resource-specific properties for this resource.. + * + * @param properties The resource-specific properties for this resource. + * @return the next definition stage. + */ + WithCreate withProperties(DatabaseMigrationServiceReplicationInstanceProperties properties); + } + } + + /** + * Begins update for the DatabaseMigrationServiceReplicationInstance resource. + * + * @return the stage of resource update. + */ + DatabaseMigrationServiceReplicationInstance.Update update(); + + /** + * The template for DatabaseMigrationServiceReplicationInstance update. + */ + interface Update extends UpdateStages.WithTags { + /** + * Executes the update request. + * + * @return the updated resource. + */ + DatabaseMigrationServiceReplicationInstance apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + DatabaseMigrationServiceReplicationInstance apply(Context context); + } + + /** + * The DatabaseMigrationServiceReplicationInstance update stages. + */ + interface UpdateStages { + /** + * The stage of the DatabaseMigrationServiceReplicationInstance update allowing to specify tags. + */ + interface WithTags { + /** + * Specifies the tags property: Resource tags.. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + Update withTags(Map tags); + } + } + + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + DatabaseMigrationServiceReplicationInstance refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + DatabaseMigrationServiceReplicationInstance refresh(Context context); +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/DatabaseMigrationServiceReplicationInstanceListResult.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/DatabaseMigrationServiceReplicationInstanceListResult.java new file mode 100644 index 000000000000..323e0237f6d5 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/DatabaseMigrationServiceReplicationInstanceListResult.java @@ -0,0 +1,141 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.awsconnector.fluent.models.DatabaseMigrationServiceReplicationInstanceInner; +import java.io.IOException; +import java.util.List; + +/** + * The response of a DatabaseMigrationServiceReplicationInstance list operation. + */ +@Fluent +public final class DatabaseMigrationServiceReplicationInstanceListResult + implements JsonSerializable { + /* + * The DatabaseMigrationServiceReplicationInstance items on this page + */ + private List value; + + /* + * The link to the next page of items + */ + private String nextLink; + + /** + * Creates an instance of DatabaseMigrationServiceReplicationInstanceListResult class. + */ + public DatabaseMigrationServiceReplicationInstanceListResult() { + } + + /** + * Get the value property: The DatabaseMigrationServiceReplicationInstance items on this page. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The DatabaseMigrationServiceReplicationInstance items on this page. + * + * @param value the value value to set. + * @return the DatabaseMigrationServiceReplicationInstanceListResult object itself. + */ + public DatabaseMigrationServiceReplicationInstanceListResult + withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The link to the next page of items. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: The link to the next page of items. + * + * @param nextLink the nextLink value to set. + * @return the DatabaseMigrationServiceReplicationInstanceListResult object itself. + */ + public DatabaseMigrationServiceReplicationInstanceListResult withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property value in model DatabaseMigrationServiceReplicationInstanceListResult")); + } else { + value().forEach(e -> e.validate()); + } + } + + private static final ClientLogger LOGGER + = new ClientLogger(DatabaseMigrationServiceReplicationInstanceListResult.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("nextLink", this.nextLink); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of DatabaseMigrationServiceReplicationInstanceListResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of DatabaseMigrationServiceReplicationInstanceListResult if the JsonReader was pointing to an + * instance of it, or null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the DatabaseMigrationServiceReplicationInstanceListResult. + */ + public static DatabaseMigrationServiceReplicationInstanceListResult fromJson(JsonReader jsonReader) + throws IOException { + return jsonReader.readObject(reader -> { + DatabaseMigrationServiceReplicationInstanceListResult deserializedDatabaseMigrationServiceReplicationInstanceListResult + = new DatabaseMigrationServiceReplicationInstanceListResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value = reader + .readArray(reader1 -> DatabaseMigrationServiceReplicationInstanceInner.fromJson(reader1)); + deserializedDatabaseMigrationServiceReplicationInstanceListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedDatabaseMigrationServiceReplicationInstanceListResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedDatabaseMigrationServiceReplicationInstanceListResult; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/DatabaseMigrationServiceReplicationInstanceProperties.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/DatabaseMigrationServiceReplicationInstanceProperties.java new file mode 100644 index 000000000000..087f6fa51e19 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/DatabaseMigrationServiceReplicationInstanceProperties.java @@ -0,0 +1,321 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.Map; + +/** + * Definition of DatabaseMigrationServiceReplicationInstance. + */ +@Fluent +public final class DatabaseMigrationServiceReplicationInstanceProperties + implements JsonSerializable { + /* + * AWS Properties + */ + private AwsDatabaseMigrationServiceReplicationInstanceProperties awsProperties; + + /* + * Public Cloud Connectors Resource ID + */ + private String publicCloudConnectorsResourceId; + + /* + * AWS Account ID + */ + private String awsAccountId; + + /* + * Amazon Resource Name (ARN) + */ + private String arn; + + /* + * Public Cloud Resource Name + */ + private String publicCloudResourceName; + + /* + * AWS Source Schema + */ + private String awsSourceSchema; + + /* + * AWS Region + */ + private String awsRegion; + + /* + * AWS Tags + */ + private Map awsTags; + + /* + * The status of the last operation. + */ + private ProvisioningState provisioningState; + + /** + * Creates an instance of DatabaseMigrationServiceReplicationInstanceProperties class. + */ + public DatabaseMigrationServiceReplicationInstanceProperties() { + } + + /** + * Get the awsProperties property: AWS Properties. + * + * @return the awsProperties value. + */ + public AwsDatabaseMigrationServiceReplicationInstanceProperties awsProperties() { + return this.awsProperties; + } + + /** + * Set the awsProperties property: AWS Properties. + * + * @param awsProperties the awsProperties value to set. + * @return the DatabaseMigrationServiceReplicationInstanceProperties object itself. + */ + public DatabaseMigrationServiceReplicationInstanceProperties + withAwsProperties(AwsDatabaseMigrationServiceReplicationInstanceProperties awsProperties) { + this.awsProperties = awsProperties; + return this; + } + + /** + * Get the publicCloudConnectorsResourceId property: Public Cloud Connectors Resource ID. + * + * @return the publicCloudConnectorsResourceId value. + */ + public String publicCloudConnectorsResourceId() { + return this.publicCloudConnectorsResourceId; + } + + /** + * Set the publicCloudConnectorsResourceId property: Public Cloud Connectors Resource ID. + * + * @param publicCloudConnectorsResourceId the publicCloudConnectorsResourceId value to set. + * @return the DatabaseMigrationServiceReplicationInstanceProperties object itself. + */ + public DatabaseMigrationServiceReplicationInstanceProperties + withPublicCloudConnectorsResourceId(String publicCloudConnectorsResourceId) { + this.publicCloudConnectorsResourceId = publicCloudConnectorsResourceId; + return this; + } + + /** + * Get the awsAccountId property: AWS Account ID. + * + * @return the awsAccountId value. + */ + public String awsAccountId() { + return this.awsAccountId; + } + + /** + * Set the awsAccountId property: AWS Account ID. + * + * @param awsAccountId the awsAccountId value to set. + * @return the DatabaseMigrationServiceReplicationInstanceProperties object itself. + */ + public DatabaseMigrationServiceReplicationInstanceProperties withAwsAccountId(String awsAccountId) { + this.awsAccountId = awsAccountId; + return this; + } + + /** + * Get the arn property: Amazon Resource Name (ARN). + * + * @return the arn value. + */ + public String arn() { + return this.arn; + } + + /** + * Set the arn property: Amazon Resource Name (ARN). + * + * @param arn the arn value to set. + * @return the DatabaseMigrationServiceReplicationInstanceProperties object itself. + */ + public DatabaseMigrationServiceReplicationInstanceProperties withArn(String arn) { + this.arn = arn; + return this; + } + + /** + * Get the publicCloudResourceName property: Public Cloud Resource Name. + * + * @return the publicCloudResourceName value. + */ + public String publicCloudResourceName() { + return this.publicCloudResourceName; + } + + /** + * Set the publicCloudResourceName property: Public Cloud Resource Name. + * + * @param publicCloudResourceName the publicCloudResourceName value to set. + * @return the DatabaseMigrationServiceReplicationInstanceProperties object itself. + */ + public DatabaseMigrationServiceReplicationInstanceProperties + withPublicCloudResourceName(String publicCloudResourceName) { + this.publicCloudResourceName = publicCloudResourceName; + return this; + } + + /** + * Get the awsSourceSchema property: AWS Source Schema. + * + * @return the awsSourceSchema value. + */ + public String awsSourceSchema() { + return this.awsSourceSchema; + } + + /** + * Set the awsSourceSchema property: AWS Source Schema. + * + * @param awsSourceSchema the awsSourceSchema value to set. + * @return the DatabaseMigrationServiceReplicationInstanceProperties object itself. + */ + public DatabaseMigrationServiceReplicationInstanceProperties withAwsSourceSchema(String awsSourceSchema) { + this.awsSourceSchema = awsSourceSchema; + return this; + } + + /** + * Get the awsRegion property: AWS Region. + * + * @return the awsRegion value. + */ + public String awsRegion() { + return this.awsRegion; + } + + /** + * Set the awsRegion property: AWS Region. + * + * @param awsRegion the awsRegion value to set. + * @return the DatabaseMigrationServiceReplicationInstanceProperties object itself. + */ + public DatabaseMigrationServiceReplicationInstanceProperties withAwsRegion(String awsRegion) { + this.awsRegion = awsRegion; + return this; + } + + /** + * Get the awsTags property: AWS Tags. + * + * @return the awsTags value. + */ + public Map awsTags() { + return this.awsTags; + } + + /** + * Set the awsTags property: AWS Tags. + * + * @param awsTags the awsTags value to set. + * @return the DatabaseMigrationServiceReplicationInstanceProperties object itself. + */ + public DatabaseMigrationServiceReplicationInstanceProperties withAwsTags(Map awsTags) { + this.awsTags = awsTags; + return this; + } + + /** + * Get the provisioningState property: The status of the last operation. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (awsProperties() != null) { + awsProperties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("awsProperties", this.awsProperties); + jsonWriter.writeStringField("publicCloudConnectorsResourceId", this.publicCloudConnectorsResourceId); + jsonWriter.writeStringField("awsAccountId", this.awsAccountId); + jsonWriter.writeStringField("arn", this.arn); + jsonWriter.writeStringField("publicCloudResourceName", this.publicCloudResourceName); + jsonWriter.writeStringField("awsSourceSchema", this.awsSourceSchema); + jsonWriter.writeStringField("awsRegion", this.awsRegion); + jsonWriter.writeMapField("awsTags", this.awsTags, (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of DatabaseMigrationServiceReplicationInstanceProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of DatabaseMigrationServiceReplicationInstanceProperties if the JsonReader was pointing to an + * instance of it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the DatabaseMigrationServiceReplicationInstanceProperties. + */ + public static DatabaseMigrationServiceReplicationInstanceProperties fromJson(JsonReader jsonReader) + throws IOException { + return jsonReader.readObject(reader -> { + DatabaseMigrationServiceReplicationInstanceProperties deserializedDatabaseMigrationServiceReplicationInstanceProperties + = new DatabaseMigrationServiceReplicationInstanceProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("awsProperties".equals(fieldName)) { + deserializedDatabaseMigrationServiceReplicationInstanceProperties.awsProperties + = AwsDatabaseMigrationServiceReplicationInstanceProperties.fromJson(reader); + } else if ("publicCloudConnectorsResourceId".equals(fieldName)) { + deserializedDatabaseMigrationServiceReplicationInstanceProperties.publicCloudConnectorsResourceId + = reader.getString(); + } else if ("awsAccountId".equals(fieldName)) { + deserializedDatabaseMigrationServiceReplicationInstanceProperties.awsAccountId = reader.getString(); + } else if ("arn".equals(fieldName)) { + deserializedDatabaseMigrationServiceReplicationInstanceProperties.arn = reader.getString(); + } else if ("publicCloudResourceName".equals(fieldName)) { + deserializedDatabaseMigrationServiceReplicationInstanceProperties.publicCloudResourceName + = reader.getString(); + } else if ("awsSourceSchema".equals(fieldName)) { + deserializedDatabaseMigrationServiceReplicationInstanceProperties.awsSourceSchema + = reader.getString(); + } else if ("awsRegion".equals(fieldName)) { + deserializedDatabaseMigrationServiceReplicationInstanceProperties.awsRegion = reader.getString(); + } else if ("awsTags".equals(fieldName)) { + Map awsTags = reader.readMap(reader1 -> reader1.getString()); + deserializedDatabaseMigrationServiceReplicationInstanceProperties.awsTags = awsTags; + } else if ("provisioningState".equals(fieldName)) { + deserializedDatabaseMigrationServiceReplicationInstanceProperties.provisioningState + = ProvisioningState.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedDatabaseMigrationServiceReplicationInstanceProperties; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/DatabaseMigrationServiceReplicationInstanceTagsUpdate.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/DatabaseMigrationServiceReplicationInstanceTagsUpdate.java new file mode 100644 index 000000000000..c8a04445d3b6 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/DatabaseMigrationServiceReplicationInstanceTagsUpdate.java @@ -0,0 +1,98 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.Map; + +/** + * The type used for updating tags in DatabaseMigrationServiceReplicationInstance resources. + */ +@Fluent +public final class DatabaseMigrationServiceReplicationInstanceTagsUpdate + implements JsonSerializable { + /* + * Resource tags. + */ + private Map tags; + + /** + * Creates an instance of DatabaseMigrationServiceReplicationInstanceTagsUpdate class. + */ + public DatabaseMigrationServiceReplicationInstanceTagsUpdate() { + } + + /** + * Get the tags property: Resource tags. + * + * @return the tags value. + */ + public Map tags() { + return this.tags; + } + + /** + * Set the tags property: Resource tags. + * + * @param tags the tags value to set. + * @return the DatabaseMigrationServiceReplicationInstanceTagsUpdate object itself. + */ + public DatabaseMigrationServiceReplicationInstanceTagsUpdate withTags(Map tags) { + this.tags = tags; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeMapField("tags", this.tags, (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of DatabaseMigrationServiceReplicationInstanceTagsUpdate from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of DatabaseMigrationServiceReplicationInstanceTagsUpdate if the JsonReader was pointing to an + * instance of it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the DatabaseMigrationServiceReplicationInstanceTagsUpdate. + */ + public static DatabaseMigrationServiceReplicationInstanceTagsUpdate fromJson(JsonReader jsonReader) + throws IOException { + return jsonReader.readObject(reader -> { + DatabaseMigrationServiceReplicationInstanceTagsUpdate deserializedDatabaseMigrationServiceReplicationInstanceTagsUpdate + = new DatabaseMigrationServiceReplicationInstanceTagsUpdate(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedDatabaseMigrationServiceReplicationInstanceTagsUpdate.tags = tags; + } else { + reader.skipChildren(); + } + } + + return deserializedDatabaseMigrationServiceReplicationInstanceTagsUpdate; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/DatabaseMigrationServiceReplicationInstances.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/DatabaseMigrationServiceReplicationInstances.java new file mode 100644 index 000000000000..f711cf64fb98 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/DatabaseMigrationServiceReplicationInstances.java @@ -0,0 +1,163 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** + * Resource collection API of DatabaseMigrationServiceReplicationInstances. + */ +public interface DatabaseMigrationServiceReplicationInstances { + /** + * List DatabaseMigrationServiceReplicationInstance resources by subscription ID. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a DatabaseMigrationServiceReplicationInstance list operation as paginated response with + * {@link PagedIterable}. + */ + PagedIterable list(); + + /** + * List DatabaseMigrationServiceReplicationInstance resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a DatabaseMigrationServiceReplicationInstance list operation as paginated response with + * {@link PagedIterable}. + */ + PagedIterable list(Context context); + + /** + * List DatabaseMigrationServiceReplicationInstance resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a DatabaseMigrationServiceReplicationInstance list operation as paginated response with + * {@link PagedIterable}. + */ + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * List DatabaseMigrationServiceReplicationInstance resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a DatabaseMigrationServiceReplicationInstance list operation as paginated response with + * {@link PagedIterable}. + */ + PagedIterable listByResourceGroup(String resourceGroupName, + Context context); + + /** + * Get a DatabaseMigrationServiceReplicationInstance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of DatabaseMigrationServiceReplicationInstance. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a DatabaseMigrationServiceReplicationInstance along with {@link Response}. + */ + Response getByResourceGroupWithResponse(String resourceGroupName, + String name, Context context); + + /** + * Get a DatabaseMigrationServiceReplicationInstance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of DatabaseMigrationServiceReplicationInstance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a DatabaseMigrationServiceReplicationInstance. + */ + DatabaseMigrationServiceReplicationInstance getByResourceGroup(String resourceGroupName, String name); + + /** + * Delete a DatabaseMigrationServiceReplicationInstance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of DatabaseMigrationServiceReplicationInstance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByResourceGroup(String resourceGroupName, String name); + + /** + * Delete a DatabaseMigrationServiceReplicationInstance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of DatabaseMigrationServiceReplicationInstance. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String name, Context context); + + /** + * Get a DatabaseMigrationServiceReplicationInstance. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a DatabaseMigrationServiceReplicationInstance along with {@link Response}. + */ + DatabaseMigrationServiceReplicationInstance getById(String id); + + /** + * Get a DatabaseMigrationServiceReplicationInstance. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a DatabaseMigrationServiceReplicationInstance along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Delete a DatabaseMigrationServiceReplicationInstance. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteById(String id); + + /** + * Delete a DatabaseMigrationServiceReplicationInstance. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new DatabaseMigrationServiceReplicationInstance resource. + * + * @param name resource name. + * @return the first stage of the new DatabaseMigrationServiceReplicationInstance definition. + */ + DatabaseMigrationServiceReplicationInstance.DefinitionStages.Blank define(String name); +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/DaxCluster.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/DaxCluster.java new file mode 100644 index 000000000000..9239e5eb8e1c --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/DaxCluster.java @@ -0,0 +1,252 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.awsconnector.fluent.models.DaxClusterInner; +import java.util.Map; + +/** + * An immutable client-side representation of DaxCluster. + */ +public interface DaxCluster { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the location property: The geo-location where the resource lives. + * + * @return the location value. + */ + String location(); + + /** + * Gets the tags property: Resource tags. + * + * @return the tags value. + */ + Map tags(); + + /** + * Gets the properties property: The resource-specific properties for this resource. + * + * @return the properties value. + */ + DaxClusterProperties properties(); + + /** + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the region of the resource. + * + * @return the region of the resource. + */ + Region region(); + + /** + * Gets the name of the resource region. + * + * @return the name of the resource region. + */ + String regionName(); + + /** + * Gets the name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + + /** + * Gets the inner com.azure.resourcemanager.awsconnector.fluent.models.DaxClusterInner object. + * + * @return the inner object. + */ + DaxClusterInner innerModel(); + + /** + * The entirety of the DaxCluster definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithLocation, + DefinitionStages.WithResourceGroup, DefinitionStages.WithCreate { + } + + /** + * The DaxCluster definition stages. + */ + interface DefinitionStages { + /** + * The first stage of the DaxCluster definition. + */ + interface Blank extends WithLocation { + } + + /** + * The stage of the DaxCluster definition allowing to specify location. + */ + interface WithLocation { + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithResourceGroup withRegion(Region location); + + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithResourceGroup withRegion(String location); + } + + /** + * The stage of the DaxCluster definition allowing to specify parent resource. + */ + interface WithResourceGroup { + /** + * Specifies resourceGroupName. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @return the next definition stage. + */ + WithCreate withExistingResourceGroup(String resourceGroupName); + } + + /** + * The stage of the DaxCluster 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.WithProperties { + /** + * Executes the create request. + * + * @return the created resource. + */ + DaxCluster create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + DaxCluster create(Context context); + } + + /** + * The stage of the DaxCluster definition allowing to specify tags. + */ + interface WithTags { + /** + * Specifies the tags property: Resource tags.. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + WithCreate withTags(Map tags); + } + + /** + * The stage of the DaxCluster definition allowing to specify properties. + */ + interface WithProperties { + /** + * Specifies the properties property: The resource-specific properties for this resource.. + * + * @param properties The resource-specific properties for this resource. + * @return the next definition stage. + */ + WithCreate withProperties(DaxClusterProperties properties); + } + } + + /** + * Begins update for the DaxCluster resource. + * + * @return the stage of resource update. + */ + DaxCluster.Update update(); + + /** + * The template for DaxCluster update. + */ + interface Update extends UpdateStages.WithTags { + /** + * Executes the update request. + * + * @return the updated resource. + */ + DaxCluster apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + DaxCluster apply(Context context); + } + + /** + * The DaxCluster update stages. + */ + interface UpdateStages { + /** + * The stage of the DaxCluster update allowing to specify tags. + */ + interface WithTags { + /** + * Specifies the tags property: Resource tags.. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + Update withTags(Map tags); + } + } + + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + DaxCluster refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + DaxCluster refresh(Context context); +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/DaxClusterListResult.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/DaxClusterListResult.java new file mode 100644 index 000000000000..b0c18b9c5620 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/DaxClusterListResult.java @@ -0,0 +1,134 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.awsconnector.fluent.models.DaxClusterInner; +import java.io.IOException; +import java.util.List; + +/** + * The response of a DaxCluster list operation. + */ +@Fluent +public final class DaxClusterListResult implements JsonSerializable { + /* + * The DaxCluster items on this page + */ + private List value; + + /* + * The link to the next page of items + */ + private String nextLink; + + /** + * Creates an instance of DaxClusterListResult class. + */ + public DaxClusterListResult() { + } + + /** + * Get the value property: The DaxCluster items on this page. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The DaxCluster items on this page. + * + * @param value the value value to set. + * @return the DaxClusterListResult object itself. + */ + public DaxClusterListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The link to the next page of items. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: The link to the next page of items. + * + * @param nextLink the nextLink value to set. + * @return the DaxClusterListResult object itself. + */ + public DaxClusterListResult withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property value in model DaxClusterListResult")); + } else { + value().forEach(e -> e.validate()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(DaxClusterListResult.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("nextLink", this.nextLink); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of DaxClusterListResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of DaxClusterListResult if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the DaxClusterListResult. + */ + public static DaxClusterListResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + DaxClusterListResult deserializedDaxClusterListResult = new DaxClusterListResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value = reader.readArray(reader1 -> DaxClusterInner.fromJson(reader1)); + deserializedDaxClusterListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedDaxClusterListResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedDaxClusterListResult; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/DaxClusterProperties.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/DaxClusterProperties.java new file mode 100644 index 000000000000..8d3a34f3589b --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/DaxClusterProperties.java @@ -0,0 +1,311 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.Map; + +/** + * Definition of DaxCluster. + */ +@Fluent +public final class DaxClusterProperties implements JsonSerializable { + /* + * AWS Properties + */ + private AwsDaxClusterProperties awsProperties; + + /* + * Public Cloud Connectors Resource ID + */ + private String publicCloudConnectorsResourceId; + + /* + * AWS Account ID + */ + private String awsAccountId; + + /* + * Amazon Resource Name (ARN) + */ + private String arn; + + /* + * Public Cloud Resource Name + */ + private String publicCloudResourceName; + + /* + * AWS Source Schema + */ + private String awsSourceSchema; + + /* + * AWS Region + */ + private String awsRegion; + + /* + * AWS Tags + */ + private Map awsTags; + + /* + * The status of the last operation. + */ + private ProvisioningState provisioningState; + + /** + * Creates an instance of DaxClusterProperties class. + */ + public DaxClusterProperties() { + } + + /** + * Get the awsProperties property: AWS Properties. + * + * @return the awsProperties value. + */ + public AwsDaxClusterProperties awsProperties() { + return this.awsProperties; + } + + /** + * Set the awsProperties property: AWS Properties. + * + * @param awsProperties the awsProperties value to set. + * @return the DaxClusterProperties object itself. + */ + public DaxClusterProperties withAwsProperties(AwsDaxClusterProperties awsProperties) { + this.awsProperties = awsProperties; + return this; + } + + /** + * Get the publicCloudConnectorsResourceId property: Public Cloud Connectors Resource ID. + * + * @return the publicCloudConnectorsResourceId value. + */ + public String publicCloudConnectorsResourceId() { + return this.publicCloudConnectorsResourceId; + } + + /** + * Set the publicCloudConnectorsResourceId property: Public Cloud Connectors Resource ID. + * + * @param publicCloudConnectorsResourceId the publicCloudConnectorsResourceId value to set. + * @return the DaxClusterProperties object itself. + */ + public DaxClusterProperties withPublicCloudConnectorsResourceId(String publicCloudConnectorsResourceId) { + this.publicCloudConnectorsResourceId = publicCloudConnectorsResourceId; + return this; + } + + /** + * Get the awsAccountId property: AWS Account ID. + * + * @return the awsAccountId value. + */ + public String awsAccountId() { + return this.awsAccountId; + } + + /** + * Set the awsAccountId property: AWS Account ID. + * + * @param awsAccountId the awsAccountId value to set. + * @return the DaxClusterProperties object itself. + */ + public DaxClusterProperties withAwsAccountId(String awsAccountId) { + this.awsAccountId = awsAccountId; + return this; + } + + /** + * Get the arn property: Amazon Resource Name (ARN). + * + * @return the arn value. + */ + public String arn() { + return this.arn; + } + + /** + * Set the arn property: Amazon Resource Name (ARN). + * + * @param arn the arn value to set. + * @return the DaxClusterProperties object itself. + */ + public DaxClusterProperties withArn(String arn) { + this.arn = arn; + return this; + } + + /** + * Get the publicCloudResourceName property: Public Cloud Resource Name. + * + * @return the publicCloudResourceName value. + */ + public String publicCloudResourceName() { + return this.publicCloudResourceName; + } + + /** + * Set the publicCloudResourceName property: Public Cloud Resource Name. + * + * @param publicCloudResourceName the publicCloudResourceName value to set. + * @return the DaxClusterProperties object itself. + */ + public DaxClusterProperties withPublicCloudResourceName(String publicCloudResourceName) { + this.publicCloudResourceName = publicCloudResourceName; + return this; + } + + /** + * Get the awsSourceSchema property: AWS Source Schema. + * + * @return the awsSourceSchema value. + */ + public String awsSourceSchema() { + return this.awsSourceSchema; + } + + /** + * Set the awsSourceSchema property: AWS Source Schema. + * + * @param awsSourceSchema the awsSourceSchema value to set. + * @return the DaxClusterProperties object itself. + */ + public DaxClusterProperties withAwsSourceSchema(String awsSourceSchema) { + this.awsSourceSchema = awsSourceSchema; + return this; + } + + /** + * Get the awsRegion property: AWS Region. + * + * @return the awsRegion value. + */ + public String awsRegion() { + return this.awsRegion; + } + + /** + * Set the awsRegion property: AWS Region. + * + * @param awsRegion the awsRegion value to set. + * @return the DaxClusterProperties object itself. + */ + public DaxClusterProperties withAwsRegion(String awsRegion) { + this.awsRegion = awsRegion; + return this; + } + + /** + * Get the awsTags property: AWS Tags. + * + * @return the awsTags value. + */ + public Map awsTags() { + return this.awsTags; + } + + /** + * Set the awsTags property: AWS Tags. + * + * @param awsTags the awsTags value to set. + * @return the DaxClusterProperties object itself. + */ + public DaxClusterProperties withAwsTags(Map awsTags) { + this.awsTags = awsTags; + return this; + } + + /** + * Get the provisioningState property: The status of the last operation. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (awsProperties() != null) { + awsProperties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("awsProperties", this.awsProperties); + jsonWriter.writeStringField("publicCloudConnectorsResourceId", this.publicCloudConnectorsResourceId); + jsonWriter.writeStringField("awsAccountId", this.awsAccountId); + jsonWriter.writeStringField("arn", this.arn); + jsonWriter.writeStringField("publicCloudResourceName", this.publicCloudResourceName); + jsonWriter.writeStringField("awsSourceSchema", this.awsSourceSchema); + jsonWriter.writeStringField("awsRegion", this.awsRegion); + jsonWriter.writeMapField("awsTags", this.awsTags, (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of DaxClusterProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of DaxClusterProperties if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the DaxClusterProperties. + */ + public static DaxClusterProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + DaxClusterProperties deserializedDaxClusterProperties = new DaxClusterProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("awsProperties".equals(fieldName)) { + deserializedDaxClusterProperties.awsProperties = AwsDaxClusterProperties.fromJson(reader); + } else if ("publicCloudConnectorsResourceId".equals(fieldName)) { + deserializedDaxClusterProperties.publicCloudConnectorsResourceId = reader.getString(); + } else if ("awsAccountId".equals(fieldName)) { + deserializedDaxClusterProperties.awsAccountId = reader.getString(); + } else if ("arn".equals(fieldName)) { + deserializedDaxClusterProperties.arn = reader.getString(); + } else if ("publicCloudResourceName".equals(fieldName)) { + deserializedDaxClusterProperties.publicCloudResourceName = reader.getString(); + } else if ("awsSourceSchema".equals(fieldName)) { + deserializedDaxClusterProperties.awsSourceSchema = reader.getString(); + } else if ("awsRegion".equals(fieldName)) { + deserializedDaxClusterProperties.awsRegion = reader.getString(); + } else if ("awsTags".equals(fieldName)) { + Map awsTags = reader.readMap(reader1 -> reader1.getString()); + deserializedDaxClusterProperties.awsTags = awsTags; + } else if ("provisioningState".equals(fieldName)) { + deserializedDaxClusterProperties.provisioningState + = ProvisioningState.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedDaxClusterProperties; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/DaxClusterTagsUpdate.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/DaxClusterTagsUpdate.java new file mode 100644 index 000000000000..f0f1c5392559 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/DaxClusterTagsUpdate.java @@ -0,0 +1,95 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.Map; + +/** + * The type used for updating tags in DaxCluster resources. + */ +@Fluent +public final class DaxClusterTagsUpdate implements JsonSerializable { + /* + * Resource tags. + */ + private Map tags; + + /** + * Creates an instance of DaxClusterTagsUpdate class. + */ + public DaxClusterTagsUpdate() { + } + + /** + * Get the tags property: Resource tags. + * + * @return the tags value. + */ + public Map tags() { + return this.tags; + } + + /** + * Set the tags property: Resource tags. + * + * @param tags the tags value to set. + * @return the DaxClusterTagsUpdate object itself. + */ + public DaxClusterTagsUpdate withTags(Map tags) { + this.tags = tags; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeMapField("tags", this.tags, (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of DaxClusterTagsUpdate from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of DaxClusterTagsUpdate if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the DaxClusterTagsUpdate. + */ + public static DaxClusterTagsUpdate fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + DaxClusterTagsUpdate deserializedDaxClusterTagsUpdate = new DaxClusterTagsUpdate(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedDaxClusterTagsUpdate.tags = tags; + } else { + reader.skipChildren(); + } + } + + return deserializedDaxClusterTagsUpdate; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/DaxClusters.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/DaxClusters.java new file mode 100644 index 000000000000..a4460afb2d44 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/DaxClusters.java @@ -0,0 +1,157 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** + * Resource collection API of DaxClusters. + */ +public interface DaxClusters { + /** + * List DaxCluster resources by subscription ID. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a DaxCluster list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable list(); + + /** + * List DaxCluster resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a DaxCluster list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable list(Context context); + + /** + * List DaxCluster resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a DaxCluster list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * List DaxCluster resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a DaxCluster list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Get a DaxCluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of DaxCluster. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a DaxCluster along with {@link Response}. + */ + Response getByResourceGroupWithResponse(String resourceGroupName, String name, Context context); + + /** + * Get a DaxCluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of DaxCluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a DaxCluster. + */ + DaxCluster getByResourceGroup(String resourceGroupName, String name); + + /** + * Delete a DaxCluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of DaxCluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByResourceGroup(String resourceGroupName, String name); + + /** + * Delete a DaxCluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of DaxCluster. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String name, Context context); + + /** + * Get a DaxCluster. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a DaxCluster along with {@link Response}. + */ + DaxCluster getById(String id); + + /** + * Get a DaxCluster. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a DaxCluster along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Delete a DaxCluster. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteById(String id); + + /** + * Delete a DaxCluster. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new DaxCluster resource. + * + * @param name resource name. + * @return the first stage of the new DaxCluster definition. + */ + DaxCluster.DefinitionStages.Blank define(String name); +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/DeadLetterConfig.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/DeadLetterConfig.java new file mode 100644 index 000000000000..675dcb3f3fe3 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/DeadLetterConfig.java @@ -0,0 +1,93 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of DeadLetterConfig. + */ +@Fluent +public final class DeadLetterConfig implements JsonSerializable { + /* + * The Amazon Resource Name (ARN) of an Amazon SQS queue or Amazon SNS topic. + */ + private String targetArn; + + /** + * Creates an instance of DeadLetterConfig class. + */ + public DeadLetterConfig() { + } + + /** + * Get the targetArn property: The Amazon Resource Name (ARN) of an Amazon SQS queue or Amazon SNS topic. + * + * @return the targetArn value. + */ + public String targetArn() { + return this.targetArn; + } + + /** + * Set the targetArn property: The Amazon Resource Name (ARN) of an Amazon SQS queue or Amazon SNS topic. + * + * @param targetArn the targetArn value to set. + * @return the DeadLetterConfig object itself. + */ + public DeadLetterConfig withTargetArn(String targetArn) { + this.targetArn = targetArn; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("targetArn", this.targetArn); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of DeadLetterConfig from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of DeadLetterConfig if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the DeadLetterConfig. + */ + public static DeadLetterConfig fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + DeadLetterConfig deserializedDeadLetterConfig = new DeadLetterConfig(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("targetArn".equals(fieldName)) { + deserializedDeadLetterConfig.targetArn = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedDeadLetterConfig; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/DefaultAction.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/DefaultAction.java new file mode 100644 index 000000000000..12d17e0c9c05 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/DefaultAction.java @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * DefaultAction enum. + */ +public final class DefaultAction extends ExpandableStringEnum { + /** + * Static value ALLOW for DefaultAction. + */ + public static final DefaultAction ALLOW = fromString("ALLOW"); + + /** + * Static value DENY for DefaultAction. + */ + public static final DefaultAction DENY = fromString("DENY"); + + /** + * Creates a new instance of DefaultAction value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public DefaultAction() { + } + + /** + * Creates or finds a DefaultAction from its string representation. + * + * @param name a name to look for. + * @return the corresponding DefaultAction. + */ + public static DefaultAction fromString(String name) { + return fromString(name, DefaultAction.class); + } + + /** + * Gets known DefaultAction values. + * + * @return known DefaultAction values. + */ + public static Collection values() { + return values(DefaultAction.class); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/DefaultActionEnumValue.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/DefaultActionEnumValue.java new file mode 100644 index 000000000000..7d01c6d25095 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/DefaultActionEnumValue.java @@ -0,0 +1,93 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of DefaultActionEnumValue. + */ +@Fluent +public final class DefaultActionEnumValue implements JsonSerializable { + /* + * Property value + */ + private DefaultAction value; + + /** + * Creates an instance of DefaultActionEnumValue class. + */ + public DefaultActionEnumValue() { + } + + /** + * Get the value property: Property value. + * + * @return the value value. + */ + public DefaultAction value() { + return this.value; + } + + /** + * Set the value property: Property value. + * + * @param value the value value to set. + * @return the DefaultActionEnumValue object itself. + */ + public DefaultActionEnumValue withValue(DefaultAction value) { + this.value = value; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("value", this.value == null ? null : this.value.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of DefaultActionEnumValue from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of DefaultActionEnumValue if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the DefaultActionEnumValue. + */ + public static DefaultActionEnumValue fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + DefaultActionEnumValue deserializedDefaultActionEnumValue = new DefaultActionEnumValue(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + deserializedDefaultActionEnumValue.value = DefaultAction.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedDefaultActionEnumValue; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/DefaultBehavior.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/DefaultBehavior.java new file mode 100644 index 000000000000..da53312d7a8f --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/DefaultBehavior.java @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * DefaultBehavior enum. + */ +public final class DefaultBehavior extends ExpandableStringEnum { + /** + * Static value DROP for DefaultBehavior. + */ + public static final DefaultBehavior DROP = fromString("DROP"); + + /** + * Static value KEEP for DefaultBehavior. + */ + public static final DefaultBehavior KEEP = fromString("KEEP"); + + /** + * Creates a new instance of DefaultBehavior value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public DefaultBehavior() { + } + + /** + * Creates or finds a DefaultBehavior from its string representation. + * + * @param name a name to look for. + * @return the corresponding DefaultBehavior. + */ + public static DefaultBehavior fromString(String name) { + return fromString(name, DefaultBehavior.class); + } + + /** + * Gets known DefaultBehavior values. + * + * @return known DefaultBehavior values. + */ + public static Collection values() { + return values(DefaultBehavior.class); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/DefaultCacheBehavior.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/DefaultCacheBehavior.java new file mode 100644 index 000000000000..1712407ed2e1 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/DefaultCacheBehavior.java @@ -0,0 +1,969 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Definition of DefaultCacheBehavior. + */ +@Fluent +public final class DefaultCacheBehavior implements JsonSerializable { + /* + * A complex type that controls which HTTP methods CloudFront processes and forwards to your Amazon S3 bucket or + * your custom origin. There are three choices: + CloudFront forwards only ``GET`` and ``HEAD`` requests. + + * CloudFront forwards only ``GET``, ``HEAD``, and ``OPTIONS`` requests. + CloudFront forwards ``GET, HEAD, OPTIONS, + * PUT, PATCH, POST``, and ``DELETE`` requests. If you pick the third choice, you may need to restrict access to + * your Amazon S3 bucket or to your custom origin so users can't perform operations that you don't want them to. For + * example, you might not want users to have permissions to delete objects from your origin. + */ + private List allowedMethods; + + /* + * The unique identifier of the cache policy that is attached to the default cache behavior. For more information, + * see [Creating cache + * policies](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/controlling-the-cache-key.html#cache + * -key-create-cache-policy) or [Using the managed cache + * policies](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/using-managed-cache-policies.html) + * in the *Amazon CloudFront Developer Guide*. A ``DefaultCacheBehavior`` must include either a ``CachePolicyId`` or + * ``ForwardedValues``. We recommend that you use a ``CachePolicyId``. + */ + private String cachePolicyId; + + /* + * A complex type that controls whether CloudFront caches the response to requests using the specified HTTP methods. + * There are two choices: + CloudFront caches responses to ``GET`` and ``HEAD`` requests. + CloudFront caches + * responses to ``GET``, ``HEAD``, and ``OPTIONS`` requests. If you pick the second choice for your Amazon S3 + * Origin, you may need to forward Access-Control-Request-Method, Access-Control-Request-Headers, and Origin headers + * for the responses to be cached correctly. + */ + private List cachedMethods; + + /* + * Whether you want CloudFront to automatically compress certain files for this cache behavior. If so, specify + * ``true``; if not, specify ``false``. For more information, see [Serving Compressed + * Files](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/ServingCompressedFiles.html) in the + * *Amazon CloudFront Developer Guide*. + */ + private Boolean compress; + + /* + * This field is deprecated. We recommend that you use the ``DefaultTTL`` field in a cache policy instead of this + * field. For more information, see [Creating cache + * policies](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/controlling-the-cache-key.html#cache + * -key-create-cache-policy) or [Using the managed cache + * policies](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/using-managed-cache-policies.html) + * in the *Amazon CloudFront Developer Guide*. The default amount of time that you want objects to stay in + * CloudFront caches before CloudFront forwards another request to your origin to determine whether the object has + * been updated. The value that you specify applies only when your origin does not add HTTP headers such as + * ``Cache-Control max-age``, ``Cache-Control s-maxage``, and ``Expires`` to objects. For more information, see + * [Managing How Long Content Stays in an Edge Cache + * (Expiration)](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/Expiration.html) in the *Amazon + * CloudFront Developer Guide*. + */ + private Integer defaultTtl; + + /* + * The value of ``ID`` for the field-level encryption configuration that you want CloudFront to use for encrypting + * specific fields of data for the default cache behavior. + */ + private String fieldLevelEncryptionId; + + /* + * This field is deprecated. We recommend that you use a cache policy or an origin request policy instead of this + * field. For more information, see [Working with + * policies](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/working-with-policies.html) in the + * *Amazon CloudFront Developer Guide*. If you want to include values in the cache key, use a cache policy. For more + * information, see [Creating cache + * policies](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/controlling-the-cache-key.html#cache + * -key-create-cache-policy) or [Using the managed cache + * policies](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/using-managed-cache-policies.html) + * in the *Amazon CloudFront Developer Guide*. If you want to send values to the origin but not include them in the + * cache key, use an origin request policy. For more information, see [Creating origin request + * policies](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/controlling-origin-requests.html# + * origin-request-create-origin-request-policy) or [Using the managed origin request + * policies](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/using-managed-origin-request- + * policies.html) in the *Amazon CloudFront Developer Guide*. A ``DefaultCacheBehavior`` must include either a + * ``CachePolicyId`` or ``ForwardedValues``. We recommend that you use a ``CachePolicyId``. A complex type that + * specifies how CloudFront handles query strings, cookies, and HTTP headers. This field is deprecated. We recommend + * that you use a cache policy or an origin request policy instead of this field. If you want to include values in + * the cache key, use a cache policy. For more information, see [Creating cache + * policies](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/controlling-the-cache-key.html#cache + * -key-create-cache-policy) in the *Amazon CloudFront Developer Guide*. If you want to send values to the origin + * but not include them in the cache key, use an origin request policy. For more information, see [Creating origin + * request + * policies](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/controlling-origin-requests.html# + * origin-request-create-origin-request-policy) in the *Amazon CloudFront Developer Guide*. A complex type that + * specifies how CloudFront handles query strings, cookies, and HTTP headers. + */ + private ForwardedValues forwardedValues; + + /* + * A list of CloudFront functions that are associated with this cache behavior. CloudFront functions must be + * published to the ``LIVE`` stage to associate them with a cache behavior. + */ + private List functionAssociations; + + /* + * A complex type that contains zero or more Lambda@Edge function associations for a cache behavior. + */ + private List lambdaFunctionAssociations; + + /* + * This field is deprecated. We recommend that you use the ``MaxTTL`` field in a cache policy instead of this field. + * For more information, see [Creating cache + * policies](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/controlling-the-cache-key.html#cache + * -key-create-cache-policy) or [Using the managed cache + * policies](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/using-managed-cache-policies.html) + * in the *Amazon CloudFront Developer Guide*. The maximum amount of time that you want objects to stay in + * CloudFront caches before CloudFront forwards another request to your origin to determine whether the object has + * been updated. The value that you specify applies only when your origin adds HTTP headers such as ``Cache-Control + * max-age``, ``Cache-Control s-maxage``, and ``Expires`` to objects. For more information, see [Managing How Long + * Content Stays in an Edge Cache + * (Expiration)](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/Expiration.html) in the *Amazon + * CloudFront Developer Guide*. + */ + private Integer maxTtl; + + /* + * This field is deprecated. We recommend that you use the ``MinTTL`` field in a cache policy instead of this field. + * For more information, see [Creating cache + * policies](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/controlling-the-cache-key.html#cache + * -key-create-cache-policy) or [Using the managed cache + * policies](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/using-managed-cache-policies.html) + * in the *Amazon CloudFront Developer Guide*. The minimum amount of time that you want objects to stay in + * CloudFront caches before CloudFront forwards another request to your origin to determine whether the object has + * been updated. For more information, see [Managing How Long Content Stays in an Edge Cache + * (Expiration)](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/Expiration.html) in the *Amazon + * CloudFront Developer Guide*. You must specify ``0`` for ``MinTTL`` if you configure CloudFront to forward all + * headers to your origin (under ``Headers``, if you specify ``1`` for ``Quantity`` and ``*`` for ``Name``). + */ + private Integer minTtl; + + /* + * The unique identifier of the origin request policy that is attached to the default cache behavior. For more + * information, see [Creating origin request + * policies](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/controlling-origin-requests.html# + * origin-request-create-origin-request-policy) or [Using the managed origin request + * policies](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/using-managed-origin-request- + * policies.html) in the *Amazon CloudFront Developer Guide*. + */ + private String originRequestPolicyId; + + /* + * The Amazon Resource Name (ARN) of the real-time log configuration that is attached to this cache behavior. For + * more information, see [Real-time + * logs](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/real-time-logs.html) in the *Amazon + * CloudFront Developer Guide*. + */ + private String realtimeLogConfigArn; + + /* + * The identifier for a response headers policy. + */ + private String responseHeadersPolicyId; + + /* + * Indicates whether you want to distribute media files in the Microsoft Smooth Streaming format using the origin + * that is associated with this cache behavior. If so, specify ``true``; if not, specify ``false``. If you specify + * ``true`` for ``SmoothStreaming``, you can still distribute other content using this cache behavior if the content + * matches the value of ``PathPattern``. + */ + private Boolean smoothStreaming; + + /* + * The value of ``ID`` for the origin that you want CloudFront to route requests to when they use the default cache + * behavior. + */ + private String targetOriginId; + + /* + * A list of key groups that CloudFront can use to validate signed URLs or signed cookies. When a cache behavior + * contains trusted key groups, CloudFront requires signed URLs or signed cookies for all requests that match the + * cache behavior. The URLs or cookies must be signed with a private key whose corresponding public key is in the + * key group. The signed URL or cookie contains information about which public key CloudFront should use to verify + * the signature. For more information, see [Serving private + * content](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/PrivateContent.html) in the *Amazon + * CloudFront Developer Guide*. + */ + private List trustedKeyGroups; + + /* + * We recommend using ``TrustedKeyGroups`` instead of ``TrustedSigners``. A list of AWS-account IDs whose public + * keys CloudFront can use to validate signed URLs or signed cookies. When a cache behavior contains trusted + * signers, CloudFront requires signed URLs or signed cookies for all requests that match the cache behavior. The + * URLs or cookies must be signed with the private key of a CloudFront key pair in a trusted signer's AWS-account. + * The signed URL or cookie contains information about which public key CloudFront should use to verify the + * signature. For more information, see [Serving private + * content](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/PrivateContent.html) in the *Amazon + * CloudFront Developer Guide*. + */ + private List trustedSigners; + + /* + * The protocol that viewers can use to access the files in the origin specified by ``TargetOriginId`` when a + * request matches the path pattern in ``PathPattern``. You can specify the following options: + ``allow-all``: + * Viewers can use HTTP or HTTPS. + ``redirect-to-https``: If a viewer submits an HTTP request, CloudFront returns + * an HTTP status code of 301 (Moved Permanently) to the viewer along with the HTTPS URL. The viewer then resubmits + * the request using the new URL. + ``https-only``: If a viewer sends an HTTP request, CloudFront returns an HTTP + * status code of 403 (Forbidden). For more information about requiring the HTTPS protocol, see [Requiring HTTPS + * Between Viewers and + * CloudFront](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/using-https-viewers-to-cloudfront. + * html) in the *Amazon CloudFront Developer Guide*. The only way to guarantee that viewers retrieve an object that + * was fetched from the origin using HTTPS is never to use any other protocol to fetch the object. If you have + * recently changed from HTTP to HTTPS, we recommend that you clear your objects' cache because cached objects are + * protocol agnostic. That means that an edge location will return an object from the cache regardless of whether + * the current request protocol matches the protocol used previously. For more information, see [Managing Cache + * Expiration](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/Expiration.html) in the *Amazon + * CloudFront Developer Guide*. + */ + private String viewerProtocolPolicy; + + /** + * Creates an instance of DefaultCacheBehavior class. + */ + public DefaultCacheBehavior() { + } + + /** + * Get the allowedMethods property: A complex type that controls which HTTP methods CloudFront processes and + * forwards to your Amazon S3 bucket or your custom origin. There are three choices: + CloudFront forwards only + * ``GET`` and ``HEAD`` requests. + CloudFront forwards only ``GET``, ``HEAD``, and ``OPTIONS`` requests. + + * CloudFront forwards ``GET, HEAD, OPTIONS, PUT, PATCH, POST``, and ``DELETE`` requests. If you pick the third + * choice, you may need to restrict access to your Amazon S3 bucket or to your custom origin so users can't perform + * operations that you don't want them to. For example, you might not want users to have permissions to delete + * objects from your origin. + * + * @return the allowedMethods value. + */ + public List allowedMethods() { + return this.allowedMethods; + } + + /** + * Set the allowedMethods property: A complex type that controls which HTTP methods CloudFront processes and + * forwards to your Amazon S3 bucket or your custom origin. There are three choices: + CloudFront forwards only + * ``GET`` and ``HEAD`` requests. + CloudFront forwards only ``GET``, ``HEAD``, and ``OPTIONS`` requests. + + * CloudFront forwards ``GET, HEAD, OPTIONS, PUT, PATCH, POST``, and ``DELETE`` requests. If you pick the third + * choice, you may need to restrict access to your Amazon S3 bucket or to your custom origin so users can't perform + * operations that you don't want them to. For example, you might not want users to have permissions to delete + * objects from your origin. + * + * @param allowedMethods the allowedMethods value to set. + * @return the DefaultCacheBehavior object itself. + */ + public DefaultCacheBehavior withAllowedMethods(List allowedMethods) { + this.allowedMethods = allowedMethods; + return this; + } + + /** + * Get the cachePolicyId property: The unique identifier of the cache policy that is attached to the default cache + * behavior. For more information, see [Creating cache + * policies](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/controlling-the-cache-key.html#cache-key-create-cache-policy) + * or [Using the managed cache + * policies](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/using-managed-cache-policies.html) + * in the *Amazon CloudFront Developer Guide*. A ``DefaultCacheBehavior`` must include either a ``CachePolicyId`` or + * ``ForwardedValues``. We recommend that you use a ``CachePolicyId``. + * + * @return the cachePolicyId value. + */ + public String cachePolicyId() { + return this.cachePolicyId; + } + + /** + * Set the cachePolicyId property: The unique identifier of the cache policy that is attached to the default cache + * behavior. For more information, see [Creating cache + * policies](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/controlling-the-cache-key.html#cache-key-create-cache-policy) + * or [Using the managed cache + * policies](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/using-managed-cache-policies.html) + * in the *Amazon CloudFront Developer Guide*. A ``DefaultCacheBehavior`` must include either a ``CachePolicyId`` or + * ``ForwardedValues``. We recommend that you use a ``CachePolicyId``. + * + * @param cachePolicyId the cachePolicyId value to set. + * @return the DefaultCacheBehavior object itself. + */ + public DefaultCacheBehavior withCachePolicyId(String cachePolicyId) { + this.cachePolicyId = cachePolicyId; + return this; + } + + /** + * Get the cachedMethods property: A complex type that controls whether CloudFront caches the response to requests + * using the specified HTTP methods. There are two choices: + CloudFront caches responses to ``GET`` and ``HEAD`` + * requests. + CloudFront caches responses to ``GET``, ``HEAD``, and ``OPTIONS`` requests. If you pick the second + * choice for your Amazon S3 Origin, you may need to forward Access-Control-Request-Method, + * Access-Control-Request-Headers, and Origin headers for the responses to be cached correctly. + * + * @return the cachedMethods value. + */ + public List cachedMethods() { + return this.cachedMethods; + } + + /** + * Set the cachedMethods property: A complex type that controls whether CloudFront caches the response to requests + * using the specified HTTP methods. There are two choices: + CloudFront caches responses to ``GET`` and ``HEAD`` + * requests. + CloudFront caches responses to ``GET``, ``HEAD``, and ``OPTIONS`` requests. If you pick the second + * choice for your Amazon S3 Origin, you may need to forward Access-Control-Request-Method, + * Access-Control-Request-Headers, and Origin headers for the responses to be cached correctly. + * + * @param cachedMethods the cachedMethods value to set. + * @return the DefaultCacheBehavior object itself. + */ + public DefaultCacheBehavior withCachedMethods(List cachedMethods) { + this.cachedMethods = cachedMethods; + return this; + } + + /** + * Get the compress property: Whether you want CloudFront to automatically compress certain files for this cache + * behavior. If so, specify ``true``; if not, specify ``false``. For more information, see [Serving Compressed + * Files](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/ServingCompressedFiles.html) in the + * *Amazon CloudFront Developer Guide*. + * + * @return the compress value. + */ + public Boolean compress() { + return this.compress; + } + + /** + * Set the compress property: Whether you want CloudFront to automatically compress certain files for this cache + * behavior. If so, specify ``true``; if not, specify ``false``. For more information, see [Serving Compressed + * Files](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/ServingCompressedFiles.html) in the + * *Amazon CloudFront Developer Guide*. + * + * @param compress the compress value to set. + * @return the DefaultCacheBehavior object itself. + */ + public DefaultCacheBehavior withCompress(Boolean compress) { + this.compress = compress; + return this; + } + + /** + * Get the defaultTtl property: This field is deprecated. We recommend that you use the ``DefaultTTL`` field in a + * cache policy instead of this field. For more information, see [Creating cache + * policies](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/controlling-the-cache-key.html#cache-key-create-cache-policy) + * or [Using the managed cache + * policies](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/using-managed-cache-policies.html) + * in the *Amazon CloudFront Developer Guide*. The default amount of time that you want objects to stay in + * CloudFront caches before CloudFront forwards another request to your origin to determine whether the object has + * been updated. The value that you specify applies only when your origin does not add HTTP headers such as + * ``Cache-Control max-age``, ``Cache-Control s-maxage``, and ``Expires`` to objects. For more information, see + * [Managing How Long Content Stays in an Edge Cache + * (Expiration)](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/Expiration.html) in the *Amazon + * CloudFront Developer Guide*. + * + * @return the defaultTtl value. + */ + public Integer defaultTtl() { + return this.defaultTtl; + } + + /** + * Set the defaultTtl property: This field is deprecated. We recommend that you use the ``DefaultTTL`` field in a + * cache policy instead of this field. For more information, see [Creating cache + * policies](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/controlling-the-cache-key.html#cache-key-create-cache-policy) + * or [Using the managed cache + * policies](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/using-managed-cache-policies.html) + * in the *Amazon CloudFront Developer Guide*. The default amount of time that you want objects to stay in + * CloudFront caches before CloudFront forwards another request to your origin to determine whether the object has + * been updated. The value that you specify applies only when your origin does not add HTTP headers such as + * ``Cache-Control max-age``, ``Cache-Control s-maxage``, and ``Expires`` to objects. For more information, see + * [Managing How Long Content Stays in an Edge Cache + * (Expiration)](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/Expiration.html) in the *Amazon + * CloudFront Developer Guide*. + * + * @param defaultTtl the defaultTtl value to set. + * @return the DefaultCacheBehavior object itself. + */ + public DefaultCacheBehavior withDefaultTtl(Integer defaultTtl) { + this.defaultTtl = defaultTtl; + return this; + } + + /** + * Get the fieldLevelEncryptionId property: The value of ``ID`` for the field-level encryption configuration that + * you want CloudFront to use for encrypting specific fields of data for the default cache behavior. + * + * @return the fieldLevelEncryptionId value. + */ + public String fieldLevelEncryptionId() { + return this.fieldLevelEncryptionId; + } + + /** + * Set the fieldLevelEncryptionId property: The value of ``ID`` for the field-level encryption configuration that + * you want CloudFront to use for encrypting specific fields of data for the default cache behavior. + * + * @param fieldLevelEncryptionId the fieldLevelEncryptionId value to set. + * @return the DefaultCacheBehavior object itself. + */ + public DefaultCacheBehavior withFieldLevelEncryptionId(String fieldLevelEncryptionId) { + this.fieldLevelEncryptionId = fieldLevelEncryptionId; + return this; + } + + /** + * Get the forwardedValues property: This field is deprecated. We recommend that you use a cache policy or an origin + * request policy instead of this field. For more information, see [Working with + * policies](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/working-with-policies.html) in the + * *Amazon CloudFront Developer Guide*. If you want to include values in the cache key, use a cache policy. For more + * information, see [Creating cache + * policies](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/controlling-the-cache-key.html#cache-key-create-cache-policy) + * or [Using the managed cache + * policies](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/using-managed-cache-policies.html) + * in the *Amazon CloudFront Developer Guide*. If you want to send values to the origin but not include them in the + * cache key, use an origin request policy. For more information, see [Creating origin request + * policies](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/controlling-origin-requests.html#origin-request-create-origin-request-policy) + * or [Using the managed origin request + * policies](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/using-managed-origin-request-policies.html) + * in the *Amazon CloudFront Developer Guide*. A ``DefaultCacheBehavior`` must include either a ``CachePolicyId`` or + * ``ForwardedValues``. We recommend that you use a ``CachePolicyId``. A complex type that specifies how CloudFront + * handles query strings, cookies, and HTTP headers. This field is deprecated. We recommend that you use a cache + * policy or an origin request policy instead of this field. If you want to include values in the cache key, use a + * cache policy. For more information, see [Creating cache + * policies](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/controlling-the-cache-key.html#cache-key-create-cache-policy) + * in the *Amazon CloudFront Developer Guide*. If you want to send values to the origin but not include them in the + * cache key, use an origin request policy. For more information, see [Creating origin request + * policies](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/controlling-origin-requests.html#origin-request-create-origin-request-policy) + * in the *Amazon CloudFront Developer Guide*. A complex type that specifies how CloudFront handles query strings, + * cookies, and HTTP headers. + * + * @return the forwardedValues value. + */ + public ForwardedValues forwardedValues() { + return this.forwardedValues; + } + + /** + * Set the forwardedValues property: This field is deprecated. We recommend that you use a cache policy or an origin + * request policy instead of this field. For more information, see [Working with + * policies](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/working-with-policies.html) in the + * *Amazon CloudFront Developer Guide*. If you want to include values in the cache key, use a cache policy. For more + * information, see [Creating cache + * policies](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/controlling-the-cache-key.html#cache-key-create-cache-policy) + * or [Using the managed cache + * policies](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/using-managed-cache-policies.html) + * in the *Amazon CloudFront Developer Guide*. If you want to send values to the origin but not include them in the + * cache key, use an origin request policy. For more information, see [Creating origin request + * policies](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/controlling-origin-requests.html#origin-request-create-origin-request-policy) + * or [Using the managed origin request + * policies](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/using-managed-origin-request-policies.html) + * in the *Amazon CloudFront Developer Guide*. A ``DefaultCacheBehavior`` must include either a ``CachePolicyId`` or + * ``ForwardedValues``. We recommend that you use a ``CachePolicyId``. A complex type that specifies how CloudFront + * handles query strings, cookies, and HTTP headers. This field is deprecated. We recommend that you use a cache + * policy or an origin request policy instead of this field. If you want to include values in the cache key, use a + * cache policy. For more information, see [Creating cache + * policies](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/controlling-the-cache-key.html#cache-key-create-cache-policy) + * in the *Amazon CloudFront Developer Guide*. If you want to send values to the origin but not include them in the + * cache key, use an origin request policy. For more information, see [Creating origin request + * policies](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/controlling-origin-requests.html#origin-request-create-origin-request-policy) + * in the *Amazon CloudFront Developer Guide*. A complex type that specifies how CloudFront handles query strings, + * cookies, and HTTP headers. + * + * @param forwardedValues the forwardedValues value to set. + * @return the DefaultCacheBehavior object itself. + */ + public DefaultCacheBehavior withForwardedValues(ForwardedValues forwardedValues) { + this.forwardedValues = forwardedValues; + return this; + } + + /** + * Get the functionAssociations property: A list of CloudFront functions that are associated with this cache + * behavior. CloudFront functions must be published to the ``LIVE`` stage to associate them with a cache behavior. + * + * @return the functionAssociations value. + */ + public List functionAssociations() { + return this.functionAssociations; + } + + /** + * Set the functionAssociations property: A list of CloudFront functions that are associated with this cache + * behavior. CloudFront functions must be published to the ``LIVE`` stage to associate them with a cache behavior. + * + * @param functionAssociations the functionAssociations value to set. + * @return the DefaultCacheBehavior object itself. + */ + public DefaultCacheBehavior withFunctionAssociations(List functionAssociations) { + this.functionAssociations = functionAssociations; + return this; + } + + /** + * Get the lambdaFunctionAssociations property: A complex type that contains zero or more Lambda@Edge function + * associations for a cache behavior. + * + * @return the lambdaFunctionAssociations value. + */ + public List lambdaFunctionAssociations() { + return this.lambdaFunctionAssociations; + } + + /** + * Set the lambdaFunctionAssociations property: A complex type that contains zero or more Lambda@Edge function + * associations for a cache behavior. + * + * @param lambdaFunctionAssociations the lambdaFunctionAssociations value to set. + * @return the DefaultCacheBehavior object itself. + */ + public DefaultCacheBehavior + withLambdaFunctionAssociations(List lambdaFunctionAssociations) { + this.lambdaFunctionAssociations = lambdaFunctionAssociations; + return this; + } + + /** + * Get the maxTtl property: This field is deprecated. We recommend that you use the ``MaxTTL`` field in a cache + * policy instead of this field. For more information, see [Creating cache + * policies](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/controlling-the-cache-key.html#cache-key-create-cache-policy) + * or [Using the managed cache + * policies](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/using-managed-cache-policies.html) + * in the *Amazon CloudFront Developer Guide*. The maximum amount of time that you want objects to stay in + * CloudFront caches before CloudFront forwards another request to your origin to determine whether the object has + * been updated. The value that you specify applies only when your origin adds HTTP headers such as ``Cache-Control + * max-age``, ``Cache-Control s-maxage``, and ``Expires`` to objects. For more information, see [Managing How Long + * Content Stays in an Edge Cache + * (Expiration)](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/Expiration.html) in the *Amazon + * CloudFront Developer Guide*. + * + * @return the maxTtl value. + */ + public Integer maxTtl() { + return this.maxTtl; + } + + /** + * Set the maxTtl property: This field is deprecated. We recommend that you use the ``MaxTTL`` field in a cache + * policy instead of this field. For more information, see [Creating cache + * policies](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/controlling-the-cache-key.html#cache-key-create-cache-policy) + * or [Using the managed cache + * policies](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/using-managed-cache-policies.html) + * in the *Amazon CloudFront Developer Guide*. The maximum amount of time that you want objects to stay in + * CloudFront caches before CloudFront forwards another request to your origin to determine whether the object has + * been updated. The value that you specify applies only when your origin adds HTTP headers such as ``Cache-Control + * max-age``, ``Cache-Control s-maxage``, and ``Expires`` to objects. For more information, see [Managing How Long + * Content Stays in an Edge Cache + * (Expiration)](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/Expiration.html) in the *Amazon + * CloudFront Developer Guide*. + * + * @param maxTtl the maxTtl value to set. + * @return the DefaultCacheBehavior object itself. + */ + public DefaultCacheBehavior withMaxTtl(Integer maxTtl) { + this.maxTtl = maxTtl; + return this; + } + + /** + * Get the minTtl property: This field is deprecated. We recommend that you use the ``MinTTL`` field in a cache + * policy instead of this field. For more information, see [Creating cache + * policies](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/controlling-the-cache-key.html#cache-key-create-cache-policy) + * or [Using the managed cache + * policies](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/using-managed-cache-policies.html) + * in the *Amazon CloudFront Developer Guide*. The minimum amount of time that you want objects to stay in + * CloudFront caches before CloudFront forwards another request to your origin to determine whether the object has + * been updated. For more information, see [Managing How Long Content Stays in an Edge Cache + * (Expiration)](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/Expiration.html) in the *Amazon + * CloudFront Developer Guide*. You must specify ``0`` for ``MinTTL`` if you configure CloudFront to forward all + * headers to your origin (under ``Headers``, if you specify ``1`` for ``Quantity`` and ``*`` for ``Name``). + * + * @return the minTtl value. + */ + public Integer minTtl() { + return this.minTtl; + } + + /** + * Set the minTtl property: This field is deprecated. We recommend that you use the ``MinTTL`` field in a cache + * policy instead of this field. For more information, see [Creating cache + * policies](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/controlling-the-cache-key.html#cache-key-create-cache-policy) + * or [Using the managed cache + * policies](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/using-managed-cache-policies.html) + * in the *Amazon CloudFront Developer Guide*. The minimum amount of time that you want objects to stay in + * CloudFront caches before CloudFront forwards another request to your origin to determine whether the object has + * been updated. For more information, see [Managing How Long Content Stays in an Edge Cache + * (Expiration)](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/Expiration.html) in the *Amazon + * CloudFront Developer Guide*. You must specify ``0`` for ``MinTTL`` if you configure CloudFront to forward all + * headers to your origin (under ``Headers``, if you specify ``1`` for ``Quantity`` and ``*`` for ``Name``). + * + * @param minTtl the minTtl value to set. + * @return the DefaultCacheBehavior object itself. + */ + public DefaultCacheBehavior withMinTtl(Integer minTtl) { + this.minTtl = minTtl; + return this; + } + + /** + * Get the originRequestPolicyId property: The unique identifier of the origin request policy that is attached to + * the default cache behavior. For more information, see [Creating origin request + * policies](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/controlling-origin-requests.html#origin-request-create-origin-request-policy) + * or [Using the managed origin request + * policies](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/using-managed-origin-request-policies.html) + * in the *Amazon CloudFront Developer Guide*. + * + * @return the originRequestPolicyId value. + */ + public String originRequestPolicyId() { + return this.originRequestPolicyId; + } + + /** + * Set the originRequestPolicyId property: The unique identifier of the origin request policy that is attached to + * the default cache behavior. For more information, see [Creating origin request + * policies](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/controlling-origin-requests.html#origin-request-create-origin-request-policy) + * or [Using the managed origin request + * policies](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/using-managed-origin-request-policies.html) + * in the *Amazon CloudFront Developer Guide*. + * + * @param originRequestPolicyId the originRequestPolicyId value to set. + * @return the DefaultCacheBehavior object itself. + */ + public DefaultCacheBehavior withOriginRequestPolicyId(String originRequestPolicyId) { + this.originRequestPolicyId = originRequestPolicyId; + return this; + } + + /** + * Get the realtimeLogConfigArn property: The Amazon Resource Name (ARN) of the real-time log configuration that is + * attached to this cache behavior. For more information, see [Real-time + * logs](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/real-time-logs.html) in the *Amazon + * CloudFront Developer Guide*. + * + * @return the realtimeLogConfigArn value. + */ + public String realtimeLogConfigArn() { + return this.realtimeLogConfigArn; + } + + /** + * Set the realtimeLogConfigArn property: The Amazon Resource Name (ARN) of the real-time log configuration that is + * attached to this cache behavior. For more information, see [Real-time + * logs](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/real-time-logs.html) in the *Amazon + * CloudFront Developer Guide*. + * + * @param realtimeLogConfigArn the realtimeLogConfigArn value to set. + * @return the DefaultCacheBehavior object itself. + */ + public DefaultCacheBehavior withRealtimeLogConfigArn(String realtimeLogConfigArn) { + this.realtimeLogConfigArn = realtimeLogConfigArn; + return this; + } + + /** + * Get the responseHeadersPolicyId property: The identifier for a response headers policy. + * + * @return the responseHeadersPolicyId value. + */ + public String responseHeadersPolicyId() { + return this.responseHeadersPolicyId; + } + + /** + * Set the responseHeadersPolicyId property: The identifier for a response headers policy. + * + * @param responseHeadersPolicyId the responseHeadersPolicyId value to set. + * @return the DefaultCacheBehavior object itself. + */ + public DefaultCacheBehavior withResponseHeadersPolicyId(String responseHeadersPolicyId) { + this.responseHeadersPolicyId = responseHeadersPolicyId; + return this; + } + + /** + * Get the smoothStreaming property: Indicates whether you want to distribute media files in the Microsoft Smooth + * Streaming format using the origin that is associated with this cache behavior. If so, specify ``true``; if not, + * specify ``false``. If you specify ``true`` for ``SmoothStreaming``, you can still distribute other content using + * this cache behavior if the content matches the value of ``PathPattern``. + * + * @return the smoothStreaming value. + */ + public Boolean smoothStreaming() { + return this.smoothStreaming; + } + + /** + * Set the smoothStreaming property: Indicates whether you want to distribute media files in the Microsoft Smooth + * Streaming format using the origin that is associated with this cache behavior. If so, specify ``true``; if not, + * specify ``false``. If you specify ``true`` for ``SmoothStreaming``, you can still distribute other content using + * this cache behavior if the content matches the value of ``PathPattern``. + * + * @param smoothStreaming the smoothStreaming value to set. + * @return the DefaultCacheBehavior object itself. + */ + public DefaultCacheBehavior withSmoothStreaming(Boolean smoothStreaming) { + this.smoothStreaming = smoothStreaming; + return this; + } + + /** + * Get the targetOriginId property: The value of ``ID`` for the origin that you want CloudFront to route requests to + * when they use the default cache behavior. + * + * @return the targetOriginId value. + */ + public String targetOriginId() { + return this.targetOriginId; + } + + /** + * Set the targetOriginId property: The value of ``ID`` for the origin that you want CloudFront to route requests to + * when they use the default cache behavior. + * + * @param targetOriginId the targetOriginId value to set. + * @return the DefaultCacheBehavior object itself. + */ + public DefaultCacheBehavior withTargetOriginId(String targetOriginId) { + this.targetOriginId = targetOriginId; + return this; + } + + /** + * Get the trustedKeyGroups property: A list of key groups that CloudFront can use to validate signed URLs or signed + * cookies. When a cache behavior contains trusted key groups, CloudFront requires signed URLs or signed cookies for + * all requests that match the cache behavior. The URLs or cookies must be signed with a private key whose + * corresponding public key is in the key group. The signed URL or cookie contains information about which public + * key CloudFront should use to verify the signature. For more information, see [Serving private + * content](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/PrivateContent.html) in the *Amazon + * CloudFront Developer Guide*. + * + * @return the trustedKeyGroups value. + */ + public List trustedKeyGroups() { + return this.trustedKeyGroups; + } + + /** + * Set the trustedKeyGroups property: A list of key groups that CloudFront can use to validate signed URLs or signed + * cookies. When a cache behavior contains trusted key groups, CloudFront requires signed URLs or signed cookies for + * all requests that match the cache behavior. The URLs or cookies must be signed with a private key whose + * corresponding public key is in the key group. The signed URL or cookie contains information about which public + * key CloudFront should use to verify the signature. For more information, see [Serving private + * content](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/PrivateContent.html) in the *Amazon + * CloudFront Developer Guide*. + * + * @param trustedKeyGroups the trustedKeyGroups value to set. + * @return the DefaultCacheBehavior object itself. + */ + public DefaultCacheBehavior withTrustedKeyGroups(List trustedKeyGroups) { + this.trustedKeyGroups = trustedKeyGroups; + return this; + } + + /** + * Get the trustedSigners property: We recommend using ``TrustedKeyGroups`` instead of ``TrustedSigners``. A list of + * AWS-account IDs whose public keys CloudFront can use to validate signed URLs or signed cookies. When a cache + * behavior contains trusted signers, CloudFront requires signed URLs or signed cookies for all requests that match + * the cache behavior. The URLs or cookies must be signed with the private key of a CloudFront key pair in a trusted + * signer's AWS-account. The signed URL or cookie contains information about which public key CloudFront should use + * to verify the signature. For more information, see [Serving private + * content](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/PrivateContent.html) in the *Amazon + * CloudFront Developer Guide*. + * + * @return the trustedSigners value. + */ + public List trustedSigners() { + return this.trustedSigners; + } + + /** + * Set the trustedSigners property: We recommend using ``TrustedKeyGroups`` instead of ``TrustedSigners``. A list of + * AWS-account IDs whose public keys CloudFront can use to validate signed URLs or signed cookies. When a cache + * behavior contains trusted signers, CloudFront requires signed URLs or signed cookies for all requests that match + * the cache behavior. The URLs or cookies must be signed with the private key of a CloudFront key pair in a trusted + * signer's AWS-account. The signed URL or cookie contains information about which public key CloudFront should use + * to verify the signature. For more information, see [Serving private + * content](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/PrivateContent.html) in the *Amazon + * CloudFront Developer Guide*. + * + * @param trustedSigners the trustedSigners value to set. + * @return the DefaultCacheBehavior object itself. + */ + public DefaultCacheBehavior withTrustedSigners(List trustedSigners) { + this.trustedSigners = trustedSigners; + return this; + } + + /** + * Get the viewerProtocolPolicy property: The protocol that viewers can use to access the files in the origin + * specified by ``TargetOriginId`` when a request matches the path pattern in ``PathPattern``. You can specify the + * following options: + ``allow-all``: Viewers can use HTTP or HTTPS. + ``redirect-to-https``: If a viewer submits + * an HTTP request, CloudFront returns an HTTP status code of 301 (Moved Permanently) to the viewer along with the + * HTTPS URL. The viewer then resubmits the request using the new URL. + ``https-only``: If a viewer sends an HTTP + * request, CloudFront returns an HTTP status code of 403 (Forbidden). For more information about requiring the + * HTTPS protocol, see [Requiring HTTPS Between Viewers and + * CloudFront](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/using-https-viewers-to-cloudfront.html) + * in the *Amazon CloudFront Developer Guide*. The only way to guarantee that viewers retrieve an object that was + * fetched from the origin using HTTPS is never to use any other protocol to fetch the object. If you have recently + * changed from HTTP to HTTPS, we recommend that you clear your objects' cache because cached objects are protocol + * agnostic. That means that an edge location will return an object from the cache regardless of whether the current + * request protocol matches the protocol used previously. For more information, see [Managing Cache + * Expiration](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/Expiration.html) in the *Amazon + * CloudFront Developer Guide*. + * + * @return the viewerProtocolPolicy value. + */ + public String viewerProtocolPolicy() { + return this.viewerProtocolPolicy; + } + + /** + * Set the viewerProtocolPolicy property: The protocol that viewers can use to access the files in the origin + * specified by ``TargetOriginId`` when a request matches the path pattern in ``PathPattern``. You can specify the + * following options: + ``allow-all``: Viewers can use HTTP or HTTPS. + ``redirect-to-https``: If a viewer submits + * an HTTP request, CloudFront returns an HTTP status code of 301 (Moved Permanently) to the viewer along with the + * HTTPS URL. The viewer then resubmits the request using the new URL. + ``https-only``: If a viewer sends an HTTP + * request, CloudFront returns an HTTP status code of 403 (Forbidden). For more information about requiring the + * HTTPS protocol, see [Requiring HTTPS Between Viewers and + * CloudFront](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/using-https-viewers-to-cloudfront.html) + * in the *Amazon CloudFront Developer Guide*. The only way to guarantee that viewers retrieve an object that was + * fetched from the origin using HTTPS is never to use any other protocol to fetch the object. If you have recently + * changed from HTTP to HTTPS, we recommend that you clear your objects' cache because cached objects are protocol + * agnostic. That means that an edge location will return an object from the cache regardless of whether the current + * request protocol matches the protocol used previously. For more information, see [Managing Cache + * Expiration](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/Expiration.html) in the *Amazon + * CloudFront Developer Guide*. + * + * @param viewerProtocolPolicy the viewerProtocolPolicy value to set. + * @return the DefaultCacheBehavior object itself. + */ + public DefaultCacheBehavior withViewerProtocolPolicy(String viewerProtocolPolicy) { + this.viewerProtocolPolicy = viewerProtocolPolicy; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (forwardedValues() != null) { + forwardedValues().validate(); + } + if (functionAssociations() != null) { + functionAssociations().forEach(e -> e.validate()); + } + if (lambdaFunctionAssociations() != null) { + lambdaFunctionAssociations().forEach(e -> e.validate()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("allowedMethods", this.allowedMethods, + (writer, element) -> writer.writeString(element)); + jsonWriter.writeStringField("cachePolicyId", this.cachePolicyId); + jsonWriter.writeArrayField("cachedMethods", this.cachedMethods, + (writer, element) -> writer.writeString(element)); + jsonWriter.writeBooleanField("compress", this.compress); + jsonWriter.writeNumberField("defaultTTL", this.defaultTtl); + jsonWriter.writeStringField("fieldLevelEncryptionId", this.fieldLevelEncryptionId); + jsonWriter.writeJsonField("forwardedValues", this.forwardedValues); + jsonWriter.writeArrayField("functionAssociations", this.functionAssociations, + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("lambdaFunctionAssociations", this.lambdaFunctionAssociations, + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeNumberField("maxTTL", this.maxTtl); + jsonWriter.writeNumberField("minTTL", this.minTtl); + jsonWriter.writeStringField("originRequestPolicyId", this.originRequestPolicyId); + jsonWriter.writeStringField("realtimeLogConfigArn", this.realtimeLogConfigArn); + jsonWriter.writeStringField("responseHeadersPolicyId", this.responseHeadersPolicyId); + jsonWriter.writeBooleanField("smoothStreaming", this.smoothStreaming); + jsonWriter.writeStringField("targetOriginId", this.targetOriginId); + jsonWriter.writeArrayField("trustedKeyGroups", this.trustedKeyGroups, + (writer, element) -> writer.writeString(element)); + jsonWriter.writeArrayField("trustedSigners", this.trustedSigners, + (writer, element) -> writer.writeString(element)); + jsonWriter.writeStringField("viewerProtocolPolicy", this.viewerProtocolPolicy); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of DefaultCacheBehavior from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of DefaultCacheBehavior if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the DefaultCacheBehavior. + */ + public static DefaultCacheBehavior fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + DefaultCacheBehavior deserializedDefaultCacheBehavior = new DefaultCacheBehavior(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("allowedMethods".equals(fieldName)) { + List allowedMethods = reader.readArray(reader1 -> reader1.getString()); + deserializedDefaultCacheBehavior.allowedMethods = allowedMethods; + } else if ("cachePolicyId".equals(fieldName)) { + deserializedDefaultCacheBehavior.cachePolicyId = reader.getString(); + } else if ("cachedMethods".equals(fieldName)) { + List cachedMethods = reader.readArray(reader1 -> reader1.getString()); + deserializedDefaultCacheBehavior.cachedMethods = cachedMethods; + } else if ("compress".equals(fieldName)) { + deserializedDefaultCacheBehavior.compress = reader.getNullable(JsonReader::getBoolean); + } else if ("defaultTTL".equals(fieldName)) { + deserializedDefaultCacheBehavior.defaultTtl = reader.getNullable(JsonReader::getInt); + } else if ("fieldLevelEncryptionId".equals(fieldName)) { + deserializedDefaultCacheBehavior.fieldLevelEncryptionId = reader.getString(); + } else if ("forwardedValues".equals(fieldName)) { + deserializedDefaultCacheBehavior.forwardedValues = ForwardedValues.fromJson(reader); + } else if ("functionAssociations".equals(fieldName)) { + List functionAssociations + = reader.readArray(reader1 -> FunctionAssociation.fromJson(reader1)); + deserializedDefaultCacheBehavior.functionAssociations = functionAssociations; + } else if ("lambdaFunctionAssociations".equals(fieldName)) { + List lambdaFunctionAssociations + = reader.readArray(reader1 -> LambdaFunctionAssociation.fromJson(reader1)); + deserializedDefaultCacheBehavior.lambdaFunctionAssociations = lambdaFunctionAssociations; + } else if ("maxTTL".equals(fieldName)) { + deserializedDefaultCacheBehavior.maxTtl = reader.getNullable(JsonReader::getInt); + } else if ("minTTL".equals(fieldName)) { + deserializedDefaultCacheBehavior.minTtl = reader.getNullable(JsonReader::getInt); + } else if ("originRequestPolicyId".equals(fieldName)) { + deserializedDefaultCacheBehavior.originRequestPolicyId = reader.getString(); + } else if ("realtimeLogConfigArn".equals(fieldName)) { + deserializedDefaultCacheBehavior.realtimeLogConfigArn = reader.getString(); + } else if ("responseHeadersPolicyId".equals(fieldName)) { + deserializedDefaultCacheBehavior.responseHeadersPolicyId = reader.getString(); + } else if ("smoothStreaming".equals(fieldName)) { + deserializedDefaultCacheBehavior.smoothStreaming = reader.getNullable(JsonReader::getBoolean); + } else if ("targetOriginId".equals(fieldName)) { + deserializedDefaultCacheBehavior.targetOriginId = reader.getString(); + } else if ("trustedKeyGroups".equals(fieldName)) { + List trustedKeyGroups = reader.readArray(reader1 -> reader1.getString()); + deserializedDefaultCacheBehavior.trustedKeyGroups = trustedKeyGroups; + } else if ("trustedSigners".equals(fieldName)) { + List trustedSigners = reader.readArray(reader1 -> reader1.getString()); + deserializedDefaultCacheBehavior.trustedSigners = trustedSigners; + } else if ("viewerProtocolPolicy".equals(fieldName)) { + deserializedDefaultCacheBehavior.viewerProtocolPolicy = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedDefaultCacheBehavior; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/DefaultRetention.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/DefaultRetention.java new file mode 100644 index 000000000000..3cda5398b1ee --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/DefaultRetention.java @@ -0,0 +1,160 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of DefaultRetention. + */ +@Fluent +public final class DefaultRetention implements JsonSerializable { + /* + * The number of days that you want to specify for the default retention period. If Object Lock is turned on, you + * must specify ``Mode`` and specify either ``Days`` or ``Years``. + */ + private Integer days; + + /* + * The default Object Lock retention mode you want to apply to new objects placed in the specified bucket. If Object + * Lock is turned on, you must specify ``Mode`` and specify either ``Days`` or ``Years``. + */ + private DefaultRetentionMode mode; + + /* + * The number of years that you want to specify for the default retention period. If Object Lock is turned on, you + * must specify ``Mode`` and specify either ``Days`` or ``Years``. + */ + private Integer years; + + /** + * Creates an instance of DefaultRetention class. + */ + public DefaultRetention() { + } + + /** + * Get the days property: The number of days that you want to specify for the default retention period. If Object + * Lock is turned on, you must specify ``Mode`` and specify either ``Days`` or ``Years``. + * + * @return the days value. + */ + public Integer days() { + return this.days; + } + + /** + * Set the days property: The number of days that you want to specify for the default retention period. If Object + * Lock is turned on, you must specify ``Mode`` and specify either ``Days`` or ``Years``. + * + * @param days the days value to set. + * @return the DefaultRetention object itself. + */ + public DefaultRetention withDays(Integer days) { + this.days = days; + return this; + } + + /** + * Get the mode property: The default Object Lock retention mode you want to apply to new objects placed in the + * specified bucket. If Object Lock is turned on, you must specify ``Mode`` and specify either ``Days`` or + * ``Years``. + * + * @return the mode value. + */ + public DefaultRetentionMode mode() { + return this.mode; + } + + /** + * Set the mode property: The default Object Lock retention mode you want to apply to new objects placed in the + * specified bucket. If Object Lock is turned on, you must specify ``Mode`` and specify either ``Days`` or + * ``Years``. + * + * @param mode the mode value to set. + * @return the DefaultRetention object itself. + */ + public DefaultRetention withMode(DefaultRetentionMode mode) { + this.mode = mode; + return this; + } + + /** + * Get the years property: The number of years that you want to specify for the default retention period. If Object + * Lock is turned on, you must specify ``Mode`` and specify either ``Days`` or ``Years``. + * + * @return the years value. + */ + public Integer years() { + return this.years; + } + + /** + * Set the years property: The number of years that you want to specify for the default retention period. If Object + * Lock is turned on, you must specify ``Mode`` and specify either ``Days`` or ``Years``. + * + * @param years the years value to set. + * @return the DefaultRetention object itself. + */ + public DefaultRetention withYears(Integer years) { + this.years = years; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeNumberField("days", this.days); + jsonWriter.writeStringField("mode", this.mode == null ? null : this.mode.toString()); + jsonWriter.writeNumberField("years", this.years); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of DefaultRetention from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of DefaultRetention if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the DefaultRetention. + */ + public static DefaultRetention fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + DefaultRetention deserializedDefaultRetention = new DefaultRetention(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("days".equals(fieldName)) { + deserializedDefaultRetention.days = reader.getNullable(JsonReader::getInt); + } else if ("mode".equals(fieldName)) { + deserializedDefaultRetention.mode = DefaultRetentionMode.fromString(reader.getString()); + } else if ("years".equals(fieldName)) { + deserializedDefaultRetention.years = reader.getNullable(JsonReader::getInt); + } else { + reader.skipChildren(); + } + } + + return deserializedDefaultRetention; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/DefaultRetentionMode.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/DefaultRetentionMode.java new file mode 100644 index 000000000000..4c2830a65744 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/DefaultRetentionMode.java @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * DefaultRetentionMode enum. + */ +public final class DefaultRetentionMode extends ExpandableStringEnum { + /** + * Static value COMPLIANCE for DefaultRetentionMode. + */ + public static final DefaultRetentionMode COMPLIANCE = fromString("COMPLIANCE"); + + /** + * Static value GOVERNANCE for DefaultRetentionMode. + */ + public static final DefaultRetentionMode GOVERNANCE = fromString("GOVERNANCE"); + + /** + * Creates a new instance of DefaultRetentionMode value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public DefaultRetentionMode() { + } + + /** + * Creates or finds a DefaultRetentionMode from its string representation. + * + * @param name a name to look for. + * @return the corresponding DefaultRetentionMode. + */ + public static DefaultRetentionMode fromString(String name) { + return fromString(name, DefaultRetentionMode.class); + } + + /** + * Gets known DefaultRetentionMode values. + * + * @return known DefaultRetentionMode values. + */ + public static Collection values() { + return values(DefaultRetentionMode.class); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/DeleteMarkerReplication.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/DeleteMarkerReplication.java new file mode 100644 index 000000000000..e84cddb19e59 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/DeleteMarkerReplication.java @@ -0,0 +1,94 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of DeleteMarkerReplication. + */ +@Fluent +public final class DeleteMarkerReplication implements JsonSerializable { + /* + * Indicates whether to replicate delete markers. Disabled by default. + */ + private DeleteMarkerReplicationStatus status; + + /** + * Creates an instance of DeleteMarkerReplication class. + */ + public DeleteMarkerReplication() { + } + + /** + * Get the status property: Indicates whether to replicate delete markers. Disabled by default. + * + * @return the status value. + */ + public DeleteMarkerReplicationStatus status() { + return this.status; + } + + /** + * Set the status property: Indicates whether to replicate delete markers. Disabled by default. + * + * @param status the status value to set. + * @return the DeleteMarkerReplication object itself. + */ + public DeleteMarkerReplication withStatus(DeleteMarkerReplicationStatus status) { + this.status = status; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("status", this.status == null ? null : this.status.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of DeleteMarkerReplication from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of DeleteMarkerReplication if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the DeleteMarkerReplication. + */ + public static DeleteMarkerReplication fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + DeleteMarkerReplication deserializedDeleteMarkerReplication = new DeleteMarkerReplication(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("status".equals(fieldName)) { + deserializedDeleteMarkerReplication.status + = DeleteMarkerReplicationStatus.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedDeleteMarkerReplication; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/DeleteMarkerReplicationStatus.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/DeleteMarkerReplicationStatus.java new file mode 100644 index 000000000000..20a7200e7e20 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/DeleteMarkerReplicationStatus.java @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * DeleteMarkerReplicationStatus enum. + */ +public final class DeleteMarkerReplicationStatus extends ExpandableStringEnum { + /** + * Static value Disabled for DeleteMarkerReplicationStatus. + */ + public static final DeleteMarkerReplicationStatus DISABLED = fromString("Disabled"); + + /** + * Static value Enabled for DeleteMarkerReplicationStatus. + */ + public static final DeleteMarkerReplicationStatus ENABLED = fromString("Enabled"); + + /** + * Creates a new instance of DeleteMarkerReplicationStatus value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public DeleteMarkerReplicationStatus() { + } + + /** + * Creates or finds a DeleteMarkerReplicationStatus from its string representation. + * + * @param name a name to look for. + * @return the corresponding DeleteMarkerReplicationStatus. + */ + public static DeleteMarkerReplicationStatus fromString(String name) { + return fromString(name, DeleteMarkerReplicationStatus.class); + } + + /** + * Gets known DeleteMarkerReplicationStatus values. + * + * @return known DeleteMarkerReplicationStatus values. + */ + public static Collection values() { + return values(DeleteMarkerReplicationStatus.class); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/DeploymentAlarms.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/DeploymentAlarms.java new file mode 100644 index 000000000000..8927d169c56f --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/DeploymentAlarms.java @@ -0,0 +1,157 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Definition of DeploymentAlarms. + */ +@Fluent +public final class DeploymentAlarms implements JsonSerializable { + /* + * One or more CloudWatch alarm names. Use a ',' to separate the alarms. + */ + private List alarmNames; + + /* + * Determines whether to use the CloudWatch alarm option in the service deployment process. + */ + private Boolean enable; + + /* + * Determines whether to configure Amazon ECS to roll back the service if a service deployment fails. If rollback is + * used, when a service deployment fails, the service is rolled back to the last deployment that completed + * successfully. + */ + private Boolean rollback; + + /** + * Creates an instance of DeploymentAlarms class. + */ + public DeploymentAlarms() { + } + + /** + * Get the alarmNames property: One or more CloudWatch alarm names. Use a ',' to separate the alarms. + * + * @return the alarmNames value. + */ + public List alarmNames() { + return this.alarmNames; + } + + /** + * Set the alarmNames property: One or more CloudWatch alarm names. Use a ',' to separate the alarms. + * + * @param alarmNames the alarmNames value to set. + * @return the DeploymentAlarms object itself. + */ + public DeploymentAlarms withAlarmNames(List alarmNames) { + this.alarmNames = alarmNames; + return this; + } + + /** + * Get the enable property: Determines whether to use the CloudWatch alarm option in the service deployment process. + * + * @return the enable value. + */ + public Boolean enable() { + return this.enable; + } + + /** + * Set the enable property: Determines whether to use the CloudWatch alarm option in the service deployment process. + * + * @param enable the enable value to set. + * @return the DeploymentAlarms object itself. + */ + public DeploymentAlarms withEnable(Boolean enable) { + this.enable = enable; + return this; + } + + /** + * Get the rollback property: Determines whether to configure Amazon ECS to roll back the service if a service + * deployment fails. If rollback is used, when a service deployment fails, the service is rolled back to the last + * deployment that completed successfully. + * + * @return the rollback value. + */ + public Boolean rollback() { + return this.rollback; + } + + /** + * Set the rollback property: Determines whether to configure Amazon ECS to roll back the service if a service + * deployment fails. If rollback is used, when a service deployment fails, the service is rolled back to the last + * deployment that completed successfully. + * + * @param rollback the rollback value to set. + * @return the DeploymentAlarms object itself. + */ + public DeploymentAlarms withRollback(Boolean rollback) { + this.rollback = rollback; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("alarmNames", this.alarmNames, (writer, element) -> writer.writeString(element)); + jsonWriter.writeBooleanField("enable", this.enable); + jsonWriter.writeBooleanField("rollback", this.rollback); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of DeploymentAlarms from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of DeploymentAlarms if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the DeploymentAlarms. + */ + public static DeploymentAlarms fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + DeploymentAlarms deserializedDeploymentAlarms = new DeploymentAlarms(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("alarmNames".equals(fieldName)) { + List alarmNames = reader.readArray(reader1 -> reader1.getString()); + deserializedDeploymentAlarms.alarmNames = alarmNames; + } else if ("enable".equals(fieldName)) { + deserializedDeploymentAlarms.enable = reader.getNullable(JsonReader::getBoolean); + } else if ("rollback".equals(fieldName)) { + deserializedDeploymentAlarms.rollback = reader.getNullable(JsonReader::getBoolean); + } else { + reader.skipChildren(); + } + } + + return deserializedDeploymentAlarms; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/DeploymentCircuitBreaker.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/DeploymentCircuitBreaker.java new file mode 100644 index 000000000000..faeb1477e83f --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/DeploymentCircuitBreaker.java @@ -0,0 +1,127 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of DeploymentCircuitBreaker. + */ +@Fluent +public final class DeploymentCircuitBreaker implements JsonSerializable { + /* + * Determines whether to use the deployment circuit breaker logic for the service. + */ + private Boolean enable; + + /* + * Determines whether to configure Amazon ECS to roll back the service if a service deployment fails. If rollback is + * on, when a service deployment fails, the service is rolled back to the last deployment that completed + * successfully. + */ + private Boolean rollback; + + /** + * Creates an instance of DeploymentCircuitBreaker class. + */ + public DeploymentCircuitBreaker() { + } + + /** + * Get the enable property: Determines whether to use the deployment circuit breaker logic for the service. + * + * @return the enable value. + */ + public Boolean enable() { + return this.enable; + } + + /** + * Set the enable property: Determines whether to use the deployment circuit breaker logic for the service. + * + * @param enable the enable value to set. + * @return the DeploymentCircuitBreaker object itself. + */ + public DeploymentCircuitBreaker withEnable(Boolean enable) { + this.enable = enable; + return this; + } + + /** + * Get the rollback property: Determines whether to configure Amazon ECS to roll back the service if a service + * deployment fails. If rollback is on, when a service deployment fails, the service is rolled back to the last + * deployment that completed successfully. + * + * @return the rollback value. + */ + public Boolean rollback() { + return this.rollback; + } + + /** + * Set the rollback property: Determines whether to configure Amazon ECS to roll back the service if a service + * deployment fails. If rollback is on, when a service deployment fails, the service is rolled back to the last + * deployment that completed successfully. + * + * @param rollback the rollback value to set. + * @return the DeploymentCircuitBreaker object itself. + */ + public DeploymentCircuitBreaker withRollback(Boolean rollback) { + this.rollback = rollback; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeBooleanField("enable", this.enable); + jsonWriter.writeBooleanField("rollback", this.rollback); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of DeploymentCircuitBreaker from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of DeploymentCircuitBreaker if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IOException If an error occurs while reading the DeploymentCircuitBreaker. + */ + public static DeploymentCircuitBreaker fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + DeploymentCircuitBreaker deserializedDeploymentCircuitBreaker = new DeploymentCircuitBreaker(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("enable".equals(fieldName)) { + deserializedDeploymentCircuitBreaker.enable = reader.getNullable(JsonReader::getBoolean); + } else if ("rollback".equals(fieldName)) { + deserializedDeploymentCircuitBreaker.rollback = reader.getNullable(JsonReader::getBoolean); + } else { + reader.skipChildren(); + } + } + + return deserializedDeploymentCircuitBreaker; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/DeploymentConfiguration.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/DeploymentConfiguration.java new file mode 100644 index 000000000000..e66d3ee3f199 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/DeploymentConfiguration.java @@ -0,0 +1,356 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of DeploymentConfiguration. + */ +@Fluent +public final class DeploymentConfiguration implements JsonSerializable { + /* + * Information about the CloudWatch alarms. One of the methods which provide a way for you to quickly identify when + * a deployment has failed, and then to optionally roll back the failure to the last working deployment. When the + * alarms are generated, Amazon ECS sets the service deployment to failed. Set the rollback parameter to have Amazon + * ECS to roll back your service to the last completed deployment after a failure. You can only use the + * ``DeploymentAlarms`` method to detect failures when the ``DeploymentController`` is set to ``ECS`` (rolling + * update). For more information, see [Rolling + * update](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/deployment-type-ecs.html) in the *Amazon + * Elastic Container Service Developer Guide*. + */ + private DeploymentAlarms alarms; + + /* + * The deployment circuit breaker can only be used for services using the rolling update (``ECS``) deployment type. + * The *deployment circuit breaker* determines whether a service deployment will fail if the service can't reach a + * steady state. If you use the deployment circuit breaker, a service deployment will transition to a failed state + * and stop launching new tasks. If you use the rollback option, when a service deployment fails, the service is + * rolled back to the last deployment that completed successfully. For more information, see [Rolling + * update](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/deployment-type-ecs.html) in the *Amazon + * Elastic Container Service Developer Guide* The deployment circuit breaker can only be used for services using the + * rolling update (``ECS``) deployment type. The *deployment circuit breaker* determines whether a service + * deployment will fail if the service can't reach a steady state. If it is turned on, a service deployment will + * transition to a failed state and stop launching new tasks. You can also configure Amazon ECS to roll back your + * service to the last completed deployment after a failure. For more information, see [Rolling + * update](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/deployment-type-ecs.html) in the *Amazon + * Elastic Container Service Developer Guide*. For more information about API failure reasons, see [API failure + * reasons](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/api_failures_messages.html) in the *Amazon + * Elastic Container Service Developer Guide*. + */ + private DeploymentCircuitBreaker deploymentCircuitBreaker; + + /* + * If a service is using the rolling update (``ECS``) deployment type, the ``maximumPercent`` parameter represents + * an upper limit on the number of your service's tasks that are allowed in the ``RUNNING`` or ``PENDING`` state + * during a deployment, as a percentage of the ``desiredCount`` (rounded down to the nearest integer). This + * parameter enables you to define the deployment batch size. For example, if your service is using the ``REPLICA`` + * service scheduler and has a ``desiredCount`` of four tasks and a ``maximumPercent`` value of 200%, the scheduler + * may start four new tasks before stopping the four older tasks (provided that the cluster resources required to do + * this are available). The default ``maximumPercent`` value for a service using the ``REPLICA`` service scheduler + * is 200%. If a service is using either the blue/green (``CODE_DEPLOY``) or ``EXTERNAL`` deployment types and tasks + * that use the EC2 launch type, the *maximum percent* value is set to the default value and is used to define the + * upper limit on the number of the tasks in the service that remain in the ``RUNNING`` state while the container + * instances are in the ``DRAINING`` state. If the tasks in the service use the Fargate launch type, the maximum + * percent value is not used, although it is returned when describing your service. + */ + private Integer maximumPercent; + + /* + * If a service is using the rolling update (``ECS``) deployment type, the ``minimumHealthyPercent`` represents a + * lower limit on the number of your service's tasks that must remain in the ``RUNNING`` state during a deployment, + * as a percentage of the ``desiredCount`` (rounded up to the nearest integer). This parameter enables you to deploy + * without using additional cluster capacity. For example, if your service has a ``desiredCount`` of four tasks and + * a ``minimumHealthyPercent`` of 50%, the service scheduler may stop two existing tasks to free up cluster capacity + * before starting two new tasks. For services that *do not* use a load balancer, the following should be noted: + A + * service is considered healthy if all essential containers within the tasks in the service pass their health + * checks. + If a task has no essential containers with a health check defined, the service scheduler will wait for + * 40 seconds after a task reaches a ``RUNNING`` state before the task is counted towards the minimum healthy + * percent total. + If a task has one or more essential containers with a health check defined, the service + * scheduler will wait for the task to reach a healthy status before counting it towards the minimum healthy percent + * total. A task is considered healthy when all essential containers within the task have passed their health + * checks. The amount of time the service scheduler can wait for is determined by the container health check + * settings. For services that *do* use a load balancer, the following should be noted: + If a task has no essential + * containers with a health check defined, the service scheduler will wait for the load balancer target group health + * check to return a healthy status before counting the task towards the minimum healthy percent total. + If a task + * has an essential container with a health check defined, the service scheduler will wait for both the task to + * reach a healthy status and the load balancer target group health check to return a healthy status before counting + * the task towards the minimum healthy percent total. If a service is using either the blue/green (``CODE_DEPLOY``) + * or ``EXTERNAL`` deployment types and is running tasks that use the EC2 launch type, the *minimum healthy percent* + * value is set to the default value and is used to define the lower limit on the number of the tasks in the service + * that remain in the ``RUNNING`` state while the container instances are in the ``DRAINING`` state. If a service is + * using either the blue/green (``CODE_DEPLOY``) or ``EXTERNAL`` deployment types and is running tasks that use the + * Fargate launch type, the minimum healthy percent value is not used, although it is returned when describing your + * service. + */ + private Integer minimumHealthyPercent; + + /** + * Creates an instance of DeploymentConfiguration class. + */ + public DeploymentConfiguration() { + } + + /** + * Get the alarms property: Information about the CloudWatch alarms. One of the methods which provide a way for you + * to quickly identify when a deployment has failed, and then to optionally roll back the failure to the last + * working deployment. When the alarms are generated, Amazon ECS sets the service deployment to failed. Set the + * rollback parameter to have Amazon ECS to roll back your service to the last completed deployment after a failure. + * You can only use the ``DeploymentAlarms`` method to detect failures when the ``DeploymentController`` is set to + * ``ECS`` (rolling update). For more information, see [Rolling + * update](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/deployment-type-ecs.html) in the *Amazon + * Elastic Container Service Developer Guide*. + * + * @return the alarms value. + */ + public DeploymentAlarms alarms() { + return this.alarms; + } + + /** + * Set the alarms property: Information about the CloudWatch alarms. One of the methods which provide a way for you + * to quickly identify when a deployment has failed, and then to optionally roll back the failure to the last + * working deployment. When the alarms are generated, Amazon ECS sets the service deployment to failed. Set the + * rollback parameter to have Amazon ECS to roll back your service to the last completed deployment after a failure. + * You can only use the ``DeploymentAlarms`` method to detect failures when the ``DeploymentController`` is set to + * ``ECS`` (rolling update). For more information, see [Rolling + * update](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/deployment-type-ecs.html) in the *Amazon + * Elastic Container Service Developer Guide*. + * + * @param alarms the alarms value to set. + * @return the DeploymentConfiguration object itself. + */ + public DeploymentConfiguration withAlarms(DeploymentAlarms alarms) { + this.alarms = alarms; + return this; + } + + /** + * Get the deploymentCircuitBreaker property: The deployment circuit breaker can only be used for services using the + * rolling update (``ECS``) deployment type. The *deployment circuit breaker* determines whether a service + * deployment will fail if the service can't reach a steady state. If you use the deployment circuit breaker, a + * service deployment will transition to a failed state and stop launching new tasks. If you use the rollback + * option, when a service deployment fails, the service is rolled back to the last deployment that completed + * successfully. For more information, see [Rolling + * update](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/deployment-type-ecs.html) in the *Amazon + * Elastic Container Service Developer Guide* The deployment circuit breaker can only be used for services using the + * rolling update (``ECS``) deployment type. The *deployment circuit breaker* determines whether a service + * deployment will fail if the service can't reach a steady state. If it is turned on, a service deployment will + * transition to a failed state and stop launching new tasks. You can also configure Amazon ECS to roll back your + * service to the last completed deployment after a failure. For more information, see [Rolling + * update](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/deployment-type-ecs.html) in the *Amazon + * Elastic Container Service Developer Guide*. For more information about API failure reasons, see [API failure + * reasons](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/api_failures_messages.html) in the *Amazon + * Elastic Container Service Developer Guide*. + * + * @return the deploymentCircuitBreaker value. + */ + public DeploymentCircuitBreaker deploymentCircuitBreaker() { + return this.deploymentCircuitBreaker; + } + + /** + * Set the deploymentCircuitBreaker property: The deployment circuit breaker can only be used for services using the + * rolling update (``ECS``) deployment type. The *deployment circuit breaker* determines whether a service + * deployment will fail if the service can't reach a steady state. If you use the deployment circuit breaker, a + * service deployment will transition to a failed state and stop launching new tasks. If you use the rollback + * option, when a service deployment fails, the service is rolled back to the last deployment that completed + * successfully. For more information, see [Rolling + * update](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/deployment-type-ecs.html) in the *Amazon + * Elastic Container Service Developer Guide* The deployment circuit breaker can only be used for services using the + * rolling update (``ECS``) deployment type. The *deployment circuit breaker* determines whether a service + * deployment will fail if the service can't reach a steady state. If it is turned on, a service deployment will + * transition to a failed state and stop launching new tasks. You can also configure Amazon ECS to roll back your + * service to the last completed deployment after a failure. For more information, see [Rolling + * update](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/deployment-type-ecs.html) in the *Amazon + * Elastic Container Service Developer Guide*. For more information about API failure reasons, see [API failure + * reasons](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/api_failures_messages.html) in the *Amazon + * Elastic Container Service Developer Guide*. + * + * @param deploymentCircuitBreaker the deploymentCircuitBreaker value to set. + * @return the DeploymentConfiguration object itself. + */ + public DeploymentConfiguration withDeploymentCircuitBreaker(DeploymentCircuitBreaker deploymentCircuitBreaker) { + this.deploymentCircuitBreaker = deploymentCircuitBreaker; + return this; + } + + /** + * Get the maximumPercent property: If a service is using the rolling update (``ECS``) deployment type, the + * ``maximumPercent`` parameter represents an upper limit on the number of your service's tasks that are allowed in + * the ``RUNNING`` or ``PENDING`` state during a deployment, as a percentage of the ``desiredCount`` (rounded down + * to the nearest integer). This parameter enables you to define the deployment batch size. For example, if your + * service is using the ``REPLICA`` service scheduler and has a ``desiredCount`` of four tasks and a + * ``maximumPercent`` value of 200%, the scheduler may start four new tasks before stopping the four older tasks + * (provided that the cluster resources required to do this are available). The default ``maximumPercent`` value for + * a service using the ``REPLICA`` service scheduler is 200%. If a service is using either the blue/green + * (``CODE_DEPLOY``) or ``EXTERNAL`` deployment types and tasks that use the EC2 launch type, the *maximum percent* + * value is set to the default value and is used to define the upper limit on the number of the tasks in the service + * that remain in the ``RUNNING`` state while the container instances are in the ``DRAINING`` state. If the tasks in + * the service use the Fargate launch type, the maximum percent value is not used, although it is returned when + * describing your service. + * + * @return the maximumPercent value. + */ + public Integer maximumPercent() { + return this.maximumPercent; + } + + /** + * Set the maximumPercent property: If a service is using the rolling update (``ECS``) deployment type, the + * ``maximumPercent`` parameter represents an upper limit on the number of your service's tasks that are allowed in + * the ``RUNNING`` or ``PENDING`` state during a deployment, as a percentage of the ``desiredCount`` (rounded down + * to the nearest integer). This parameter enables you to define the deployment batch size. For example, if your + * service is using the ``REPLICA`` service scheduler and has a ``desiredCount`` of four tasks and a + * ``maximumPercent`` value of 200%, the scheduler may start four new tasks before stopping the four older tasks + * (provided that the cluster resources required to do this are available). The default ``maximumPercent`` value for + * a service using the ``REPLICA`` service scheduler is 200%. If a service is using either the blue/green + * (``CODE_DEPLOY``) or ``EXTERNAL`` deployment types and tasks that use the EC2 launch type, the *maximum percent* + * value is set to the default value and is used to define the upper limit on the number of the tasks in the service + * that remain in the ``RUNNING`` state while the container instances are in the ``DRAINING`` state. If the tasks in + * the service use the Fargate launch type, the maximum percent value is not used, although it is returned when + * describing your service. + * + * @param maximumPercent the maximumPercent value to set. + * @return the DeploymentConfiguration object itself. + */ + public DeploymentConfiguration withMaximumPercent(Integer maximumPercent) { + this.maximumPercent = maximumPercent; + return this; + } + + /** + * Get the minimumHealthyPercent property: If a service is using the rolling update (``ECS``) deployment type, the + * ``minimumHealthyPercent`` represents a lower limit on the number of your service's tasks that must remain in the + * ``RUNNING`` state during a deployment, as a percentage of the ``desiredCount`` (rounded up to the nearest + * integer). This parameter enables you to deploy without using additional cluster capacity. For example, if your + * service has a ``desiredCount`` of four tasks and a ``minimumHealthyPercent`` of 50%, the service scheduler may + * stop two existing tasks to free up cluster capacity before starting two new tasks. For services that *do not* use + * a load balancer, the following should be noted: + A service is considered healthy if all essential containers + * within the tasks in the service pass their health checks. + If a task has no essential containers with a health + * check defined, the service scheduler will wait for 40 seconds after a task reaches a ``RUNNING`` state before the + * task is counted towards the minimum healthy percent total. + If a task has one or more essential containers with + * a health check defined, the service scheduler will wait for the task to reach a healthy status before counting it + * towards the minimum healthy percent total. A task is considered healthy when all essential containers within the + * task have passed their health checks. The amount of time the service scheduler can wait for is determined by the + * container health check settings. For services that *do* use a load balancer, the following should be noted: + If + * a task has no essential containers with a health check defined, the service scheduler will wait for the load + * balancer target group health check to return a healthy status before counting the task towards the minimum + * healthy percent total. + If a task has an essential container with a health check defined, the service scheduler + * will wait for both the task to reach a healthy status and the load balancer target group health check to return a + * healthy status before counting the task towards the minimum healthy percent total. If a service is using either + * the blue/green (``CODE_DEPLOY``) or ``EXTERNAL`` deployment types and is running tasks that use the EC2 launch + * type, the *minimum healthy percent* value is set to the default value and is used to define the lower limit on + * the number of the tasks in the service that remain in the ``RUNNING`` state while the container instances are in + * the ``DRAINING`` state. If a service is using either the blue/green (``CODE_DEPLOY``) or ``EXTERNAL`` deployment + * types and is running tasks that use the Fargate launch type, the minimum healthy percent value is not used, + * although it is returned when describing your service. + * + * @return the minimumHealthyPercent value. + */ + public Integer minimumHealthyPercent() { + return this.minimumHealthyPercent; + } + + /** + * Set the minimumHealthyPercent property: If a service is using the rolling update (``ECS``) deployment type, the + * ``minimumHealthyPercent`` represents a lower limit on the number of your service's tasks that must remain in the + * ``RUNNING`` state during a deployment, as a percentage of the ``desiredCount`` (rounded up to the nearest + * integer). This parameter enables you to deploy without using additional cluster capacity. For example, if your + * service has a ``desiredCount`` of four tasks and a ``minimumHealthyPercent`` of 50%, the service scheduler may + * stop two existing tasks to free up cluster capacity before starting two new tasks. For services that *do not* use + * a load balancer, the following should be noted: + A service is considered healthy if all essential containers + * within the tasks in the service pass their health checks. + If a task has no essential containers with a health + * check defined, the service scheduler will wait for 40 seconds after a task reaches a ``RUNNING`` state before the + * task is counted towards the minimum healthy percent total. + If a task has one or more essential containers with + * a health check defined, the service scheduler will wait for the task to reach a healthy status before counting it + * towards the minimum healthy percent total. A task is considered healthy when all essential containers within the + * task have passed their health checks. The amount of time the service scheduler can wait for is determined by the + * container health check settings. For services that *do* use a load balancer, the following should be noted: + If + * a task has no essential containers with a health check defined, the service scheduler will wait for the load + * balancer target group health check to return a healthy status before counting the task towards the minimum + * healthy percent total. + If a task has an essential container with a health check defined, the service scheduler + * will wait for both the task to reach a healthy status and the load balancer target group health check to return a + * healthy status before counting the task towards the minimum healthy percent total. If a service is using either + * the blue/green (``CODE_DEPLOY``) or ``EXTERNAL`` deployment types and is running tasks that use the EC2 launch + * type, the *minimum healthy percent* value is set to the default value and is used to define the lower limit on + * the number of the tasks in the service that remain in the ``RUNNING`` state while the container instances are in + * the ``DRAINING`` state. If a service is using either the blue/green (``CODE_DEPLOY``) or ``EXTERNAL`` deployment + * types and is running tasks that use the Fargate launch type, the minimum healthy percent value is not used, + * although it is returned when describing your service. + * + * @param minimumHealthyPercent the minimumHealthyPercent value to set. + * @return the DeploymentConfiguration object itself. + */ + public DeploymentConfiguration withMinimumHealthyPercent(Integer minimumHealthyPercent) { + this.minimumHealthyPercent = minimumHealthyPercent; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (alarms() != null) { + alarms().validate(); + } + if (deploymentCircuitBreaker() != null) { + deploymentCircuitBreaker().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("alarms", this.alarms); + jsonWriter.writeJsonField("deploymentCircuitBreaker", this.deploymentCircuitBreaker); + jsonWriter.writeNumberField("maximumPercent", this.maximumPercent); + jsonWriter.writeNumberField("minimumHealthyPercent", this.minimumHealthyPercent); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of DeploymentConfiguration from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of DeploymentConfiguration if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the DeploymentConfiguration. + */ + public static DeploymentConfiguration fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + DeploymentConfiguration deserializedDeploymentConfiguration = new DeploymentConfiguration(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("alarms".equals(fieldName)) { + deserializedDeploymentConfiguration.alarms = DeploymentAlarms.fromJson(reader); + } else if ("deploymentCircuitBreaker".equals(fieldName)) { + deserializedDeploymentConfiguration.deploymentCircuitBreaker + = DeploymentCircuitBreaker.fromJson(reader); + } else if ("maximumPercent".equals(fieldName)) { + deserializedDeploymentConfiguration.maximumPercent = reader.getNullable(JsonReader::getInt); + } else if ("minimumHealthyPercent".equals(fieldName)) { + deserializedDeploymentConfiguration.minimumHealthyPercent = reader.getNullable(JsonReader::getInt); + } else { + reader.skipChildren(); + } + } + + return deserializedDeploymentConfiguration; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/DeploymentController.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/DeploymentController.java new file mode 100644 index 000000000000..32413c1586a3 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/DeploymentController.java @@ -0,0 +1,116 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of DeploymentController. + */ +@Fluent +public final class DeploymentController implements JsonSerializable { + /* + * The deployment controller type to use. There are three deployment controller types available: + ECS The rolling + * update (ECS) deployment type involves replacing the current running version of the container with the latest + * version. The number of containers Amazon ECS adds or removes from the service during a rolling update is + * controlled by adjusting the minimum and maximum number of healthy tasks allowed during a service deployment, as + * specified in the DeploymentConfiguration. + CODE_DEPLOY The blue/green (CODE_DEPLOY) deployment type uses the + * blue/green deployment model powered by , which allows you to verify a new deployment of a service before sending + * production traffic to it. + EXTERNAL The external (EXTERNAL) deployment type enables you to use any third-party + * deployment controller for full control over the deployment process for an Amazon ECS service. + */ + private DeploymentControllerType type; + + /** + * Creates an instance of DeploymentController class. + */ + public DeploymentController() { + } + + /** + * Get the type property: The deployment controller type to use. There are three deployment controller types + * available: + ECS The rolling update (ECS) deployment type involves replacing the current running version of the + * container with the latest version. The number of containers Amazon ECS adds or removes from the service during a + * rolling update is controlled by adjusting the minimum and maximum number of healthy tasks allowed during a + * service deployment, as specified in the DeploymentConfiguration. + CODE_DEPLOY The blue/green (CODE_DEPLOY) + * deployment type uses the blue/green deployment model powered by , which allows you to verify a new deployment of + * a service before sending production traffic to it. + EXTERNAL The external (EXTERNAL) deployment type enables you + * to use any third-party deployment controller for full control over the deployment process for an Amazon ECS + * service. + * + * @return the type value. + */ + public DeploymentControllerType type() { + return this.type; + } + + /** + * Set the type property: The deployment controller type to use. There are three deployment controller types + * available: + ECS The rolling update (ECS) deployment type involves replacing the current running version of the + * container with the latest version. The number of containers Amazon ECS adds or removes from the service during a + * rolling update is controlled by adjusting the minimum and maximum number of healthy tasks allowed during a + * service deployment, as specified in the DeploymentConfiguration. + CODE_DEPLOY The blue/green (CODE_DEPLOY) + * deployment type uses the blue/green deployment model powered by , which allows you to verify a new deployment of + * a service before sending production traffic to it. + EXTERNAL The external (EXTERNAL) deployment type enables you + * to use any third-party deployment controller for full control over the deployment process for an Amazon ECS + * service. + * + * @param type the type value to set. + * @return the DeploymentController object itself. + */ + public DeploymentController withType(DeploymentControllerType type) { + this.type = type; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("type", this.type == null ? null : this.type.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of DeploymentController from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of DeploymentController if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the DeploymentController. + */ + public static DeploymentController fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + DeploymentController deserializedDeploymentController = new DeploymentController(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("type".equals(fieldName)) { + deserializedDeploymentController.type = DeploymentControllerType.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedDeploymentController; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/DeploymentControllerType.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/DeploymentControllerType.java new file mode 100644 index 000000000000..2dacae402558 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/DeploymentControllerType.java @@ -0,0 +1,56 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * DeploymentControllerType enum. + */ +public final class DeploymentControllerType extends ExpandableStringEnum { + /** + * Static value CODE_DEPLOY for DeploymentControllerType. + */ + public static final DeploymentControllerType CODE_DEPLOY = fromString("CODE_DEPLOY"); + + /** + * Static value ECS for DeploymentControllerType. + */ + public static final DeploymentControllerType ECS = fromString("ECS"); + + /** + * Static value EXTERNAL for DeploymentControllerType. + */ + public static final DeploymentControllerType EXTERNAL = fromString("EXTERNAL"); + + /** + * Creates a new instance of DeploymentControllerType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public DeploymentControllerType() { + } + + /** + * Creates or finds a DeploymentControllerType from its string representation. + * + * @param name a name to look for. + * @return the corresponding DeploymentControllerType. + */ + public static DeploymentControllerType fromString(String name) { + return fromString(name, DeploymentControllerType.class); + } + + /** + * Gets known DeploymentControllerType values. + * + * @return known DeploymentControllerType values. + */ + public static Collection values() { + return values(DeploymentControllerType.class); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/DeploymentStatus.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/DeploymentStatus.java new file mode 100644 index 000000000000..306b23731abc --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/DeploymentStatus.java @@ -0,0 +1,66 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * DeploymentStatus enum. + */ +public final class DeploymentStatus extends ExpandableStringEnum { + /** + * Static value COMPLETED for DeploymentStatus. + */ + public static final DeploymentStatus COMPLETED = fromString("COMPLETED"); + + /** + * Static value ELIGIBLE for DeploymentStatus. + */ + public static final DeploymentStatus ELIGIBLE = fromString("ELIGIBLE"); + + /** + * Static value IN_PROGRESS for DeploymentStatus. + */ + public static final DeploymentStatus IN_PROGRESS = fromString("IN_PROGRESS"); + + /** + * Static value NOT_ELIGIBLE for DeploymentStatus. + */ + public static final DeploymentStatus NOT_ELIGIBLE = fromString("NOT_ELIGIBLE"); + + /** + * Static value PENDING_UPDATE for DeploymentStatus. + */ + public static final DeploymentStatus PENDING_UPDATE = fromString("PENDING_UPDATE"); + + /** + * Creates a new instance of DeploymentStatus value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public DeploymentStatus() { + } + + /** + * Creates or finds a DeploymentStatus from its string representation. + * + * @param name a name to look for. + * @return the corresponding DeploymentStatus. + */ + public static DeploymentStatus fromString(String name) { + return fromString(name, DeploymentStatus.class); + } + + /** + * Gets known DeploymentStatus values. + * + * @return known DeploymentStatus values. + */ + public static Collection values() { + return values(DeploymentStatus.class); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/DeploymentStatusEnumValue.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/DeploymentStatusEnumValue.java new file mode 100644 index 000000000000..51767551f65b --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/DeploymentStatusEnumValue.java @@ -0,0 +1,93 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of DeploymentStatusEnumValue. + */ +@Fluent +public final class DeploymentStatusEnumValue implements JsonSerializable { + /* + * Property value + */ + private DeploymentStatus value; + + /** + * Creates an instance of DeploymentStatusEnumValue class. + */ + public DeploymentStatusEnumValue() { + } + + /** + * Get the value property: Property value. + * + * @return the value value. + */ + public DeploymentStatus value() { + return this.value; + } + + /** + * Set the value property: Property value. + * + * @param value the value value to set. + * @return the DeploymentStatusEnumValue object itself. + */ + public DeploymentStatusEnumValue withValue(DeploymentStatus value) { + this.value = value; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("value", this.value == null ? null : this.value.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of DeploymentStatusEnumValue from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of DeploymentStatusEnumValue if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IOException If an error occurs while reading the DeploymentStatusEnumValue. + */ + public static DeploymentStatusEnumValue fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + DeploymentStatusEnumValue deserializedDeploymentStatusEnumValue = new DeploymentStatusEnumValue(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + deserializedDeploymentStatusEnumValue.value = DeploymentStatus.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedDeploymentStatusEnumValue; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/DeploymentTargets.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/DeploymentTargets.java new file mode 100644 index 000000000000..38f700b4d208 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/DeploymentTargets.java @@ -0,0 +1,185 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Definition of DeploymentTargets. + */ +@Fluent +public final class DeploymentTargets implements JsonSerializable { + /* + * The filter type you want to apply on organizational units and accounts. + */ + private DeploymentTargetsAccountFilterType accountFilterType; + + /* + * AWS accounts that you want to create stack instances in the specified Region(s) for. + */ + private List accounts; + + /* + * Returns the value of the AccountsUrl property. + */ + private String accountsUrl; + + /* + * The organization root ID or organizational unit (OU) IDs to which StackSets deploys. + */ + private List organizationalUnitIds; + + /** + * Creates an instance of DeploymentTargets class. + */ + public DeploymentTargets() { + } + + /** + * Get the accountFilterType property: The filter type you want to apply on organizational units and accounts. + * + * @return the accountFilterType value. + */ + public DeploymentTargetsAccountFilterType accountFilterType() { + return this.accountFilterType; + } + + /** + * Set the accountFilterType property: The filter type you want to apply on organizational units and accounts. + * + * @param accountFilterType the accountFilterType value to set. + * @return the DeploymentTargets object itself. + */ + public DeploymentTargets withAccountFilterType(DeploymentTargetsAccountFilterType accountFilterType) { + this.accountFilterType = accountFilterType; + return this; + } + + /** + * Get the accounts property: AWS accounts that you want to create stack instances in the specified Region(s) for. + * + * @return the accounts value. + */ + public List accounts() { + return this.accounts; + } + + /** + * Set the accounts property: AWS accounts that you want to create stack instances in the specified Region(s) for. + * + * @param accounts the accounts value to set. + * @return the DeploymentTargets object itself. + */ + public DeploymentTargets withAccounts(List accounts) { + this.accounts = accounts; + return this; + } + + /** + * Get the accountsUrl property: Returns the value of the AccountsUrl property. + * + * @return the accountsUrl value. + */ + public String accountsUrl() { + return this.accountsUrl; + } + + /** + * Set the accountsUrl property: Returns the value of the AccountsUrl property. + * + * @param accountsUrl the accountsUrl value to set. + * @return the DeploymentTargets object itself. + */ + public DeploymentTargets withAccountsUrl(String accountsUrl) { + this.accountsUrl = accountsUrl; + return this; + } + + /** + * Get the organizationalUnitIds property: The organization root ID or organizational unit (OU) IDs to which + * StackSets deploys. + * + * @return the organizationalUnitIds value. + */ + public List organizationalUnitIds() { + return this.organizationalUnitIds; + } + + /** + * Set the organizationalUnitIds property: The organization root ID or organizational unit (OU) IDs to which + * StackSets deploys. + * + * @param organizationalUnitIds the organizationalUnitIds value to set. + * @return the DeploymentTargets object itself. + */ + public DeploymentTargets withOrganizationalUnitIds(List organizationalUnitIds) { + this.organizationalUnitIds = organizationalUnitIds; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("accountFilterType", + this.accountFilterType == null ? null : this.accountFilterType.toString()); + jsonWriter.writeArrayField("accounts", this.accounts, (writer, element) -> writer.writeString(element)); + jsonWriter.writeStringField("accountsUrl", this.accountsUrl); + jsonWriter.writeArrayField("organizationalUnitIds", this.organizationalUnitIds, + (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of DeploymentTargets from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of DeploymentTargets if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the DeploymentTargets. + */ + public static DeploymentTargets fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + DeploymentTargets deserializedDeploymentTargets = new DeploymentTargets(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("accountFilterType".equals(fieldName)) { + deserializedDeploymentTargets.accountFilterType + = DeploymentTargetsAccountFilterType.fromString(reader.getString()); + } else if ("accounts".equals(fieldName)) { + List accounts = reader.readArray(reader1 -> reader1.getString()); + deserializedDeploymentTargets.accounts = accounts; + } else if ("accountsUrl".equals(fieldName)) { + deserializedDeploymentTargets.accountsUrl = reader.getString(); + } else if ("organizationalUnitIds".equals(fieldName)) { + List organizationalUnitIds = reader.readArray(reader1 -> reader1.getString()); + deserializedDeploymentTargets.organizationalUnitIds = organizationalUnitIds; + } else { + reader.skipChildren(); + } + } + + return deserializedDeploymentTargets; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/DeploymentTargetsAccountFilterType.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/DeploymentTargetsAccountFilterType.java new file mode 100644 index 000000000000..8e915d8a1178 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/DeploymentTargetsAccountFilterType.java @@ -0,0 +1,61 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * DeploymentTargetsAccountFilterType enum. + */ +public final class DeploymentTargetsAccountFilterType extends ExpandableStringEnum { + /** + * Static value DIFFERENCE for DeploymentTargetsAccountFilterType. + */ + public static final DeploymentTargetsAccountFilterType DIFFERENCE = fromString("DIFFERENCE"); + + /** + * Static value INTERSECTION for DeploymentTargetsAccountFilterType. + */ + public static final DeploymentTargetsAccountFilterType INTERSECTION = fromString("INTERSECTION"); + + /** + * Static value NONE for DeploymentTargetsAccountFilterType. + */ + public static final DeploymentTargetsAccountFilterType NONE = fromString("NONE"); + + /** + * Static value UNION for DeploymentTargetsAccountFilterType. + */ + public static final DeploymentTargetsAccountFilterType UNION = fromString("UNION"); + + /** + * Creates a new instance of DeploymentTargetsAccountFilterType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public DeploymentTargetsAccountFilterType() { + } + + /** + * Creates or finds a DeploymentTargetsAccountFilterType from its string representation. + * + * @param name a name to look for. + * @return the corresponding DeploymentTargetsAccountFilterType. + */ + public static DeploymentTargetsAccountFilterType fromString(String name) { + return fromString(name, DeploymentTargetsAccountFilterType.class); + } + + /** + * Gets known DeploymentTargetsAccountFilterType values. + * + * @return known DeploymentTargetsAccountFilterType values. + */ + public static Collection values() { + return values(DeploymentTargetsAccountFilterType.class); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/Destination.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/Destination.java new file mode 100644 index 000000000000..e084b705e00a --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/Destination.java @@ -0,0 +1,186 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of Destination. + */ +@Fluent +public final class Destination implements JsonSerializable { + /* + * The account ID that owns the destination S3 bucket. If no account ID is provided, the owner is not validated + * before exporting data. Although this value is optional, we strongly recommend that you set it to help prevent + * problems if the destination bucket ownership changes. + */ + private String bucketAccountId; + + /* + * The Amazon Resource Name (ARN) of the bucket to which data is exported. + */ + private String bucketArn; + + /* + * Specifies the file format used when exporting data to Amazon S3. *Allowed values*: ``CSV`` | ``ORC`` | + * ``Parquet`` + */ + private DestinationFormat format; + + /* + * The prefix to use when exporting data. The prefix is prepended to all results. + */ + private String prefix; + + /** + * Creates an instance of Destination class. + */ + public Destination() { + } + + /** + * Get the bucketAccountId property: The account ID that owns the destination S3 bucket. If no account ID is + * provided, the owner is not validated before exporting data. Although this value is optional, we strongly + * recommend that you set it to help prevent problems if the destination bucket ownership changes. + * + * @return the bucketAccountId value. + */ + public String bucketAccountId() { + return this.bucketAccountId; + } + + /** + * Set the bucketAccountId property: The account ID that owns the destination S3 bucket. If no account ID is + * provided, the owner is not validated before exporting data. Although this value is optional, we strongly + * recommend that you set it to help prevent problems if the destination bucket ownership changes. + * + * @param bucketAccountId the bucketAccountId value to set. + * @return the Destination object itself. + */ + public Destination withBucketAccountId(String bucketAccountId) { + this.bucketAccountId = bucketAccountId; + return this; + } + + /** + * Get the bucketArn property: The Amazon Resource Name (ARN) of the bucket to which data is exported. + * + * @return the bucketArn value. + */ + public String bucketArn() { + return this.bucketArn; + } + + /** + * Set the bucketArn property: The Amazon Resource Name (ARN) of the bucket to which data is exported. + * + * @param bucketArn the bucketArn value to set. + * @return the Destination object itself. + */ + public Destination withBucketArn(String bucketArn) { + this.bucketArn = bucketArn; + return this; + } + + /** + * Get the format property: Specifies the file format used when exporting data to Amazon S3. *Allowed values*: + * ``CSV`` | ``ORC`` | ``Parquet``. + * + * @return the format value. + */ + public DestinationFormat format() { + return this.format; + } + + /** + * Set the format property: Specifies the file format used when exporting data to Amazon S3. *Allowed values*: + * ``CSV`` | ``ORC`` | ``Parquet``. + * + * @param format the format value to set. + * @return the Destination object itself. + */ + public Destination withFormat(DestinationFormat format) { + this.format = format; + return this; + } + + /** + * Get the prefix property: The prefix to use when exporting data. The prefix is prepended to all results. + * + * @return the prefix value. + */ + public String prefix() { + return this.prefix; + } + + /** + * Set the prefix property: The prefix to use when exporting data. The prefix is prepended to all results. + * + * @param prefix the prefix value to set. + * @return the Destination object itself. + */ + public Destination withPrefix(String prefix) { + this.prefix = prefix; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("bucketAccountId", this.bucketAccountId); + jsonWriter.writeStringField("bucketArn", this.bucketArn); + jsonWriter.writeStringField("format", this.format == null ? null : this.format.toString()); + jsonWriter.writeStringField("prefix", this.prefix); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of Destination from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of Destination if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the Destination. + */ + public static Destination fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + Destination deserializedDestination = new Destination(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("bucketAccountId".equals(fieldName)) { + deserializedDestination.bucketAccountId = reader.getString(); + } else if ("bucketArn".equals(fieldName)) { + deserializedDestination.bucketArn = reader.getString(); + } else if ("format".equals(fieldName)) { + deserializedDestination.format = DestinationFormat.fromString(reader.getString()); + } else if ("prefix".equals(fieldName)) { + deserializedDestination.prefix = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedDestination; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/DestinationFormat.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/DestinationFormat.java new file mode 100644 index 000000000000..0925c6982134 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/DestinationFormat.java @@ -0,0 +1,56 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * DestinationFormat enum. + */ +public final class DestinationFormat extends ExpandableStringEnum { + /** + * Static value CSV for DestinationFormat. + */ + public static final DestinationFormat CSV = fromString("CSV"); + + /** + * Static value ORC for DestinationFormat. + */ + public static final DestinationFormat ORC = fromString("ORC"); + + /** + * Static value Parquet for DestinationFormat. + */ + public static final DestinationFormat PARQUET = fromString("Parquet"); + + /** + * Creates a new instance of DestinationFormat value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public DestinationFormat() { + } + + /** + * Creates or finds a DestinationFormat from its string representation. + * + * @param name a name to look for. + * @return the corresponding DestinationFormat. + */ + public static DestinationFormat fromString(String name) { + return fromString(name, DestinationFormat.class); + } + + /** + * Gets known DestinationFormat values. + * + * @return known DestinationFormat values. + */ + public static Collection values() { + return values(DestinationFormat.class); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/DestinationOptionsModelProperties.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/DestinationOptionsModelProperties.java new file mode 100644 index 000000000000..530139d59bdc --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/DestinationOptionsModelProperties.java @@ -0,0 +1,153 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of DestinationOptionsModelProperties. + */ +@Fluent +public final class DestinationOptionsModelProperties implements JsonSerializable { + /* + * Property fileFormat + */ + private FileFormat fileFormat; + + /* + * Property hiveCompatiblePartitions + */ + private Boolean hiveCompatiblePartitions; + + /* + * Property perHourPartition + */ + private Boolean perHourPartition; + + /** + * Creates an instance of DestinationOptionsModelProperties class. + */ + public DestinationOptionsModelProperties() { + } + + /** + * Get the fileFormat property: Property fileFormat. + * + * @return the fileFormat value. + */ + public FileFormat fileFormat() { + return this.fileFormat; + } + + /** + * Set the fileFormat property: Property fileFormat. + * + * @param fileFormat the fileFormat value to set. + * @return the DestinationOptionsModelProperties object itself. + */ + public DestinationOptionsModelProperties withFileFormat(FileFormat fileFormat) { + this.fileFormat = fileFormat; + return this; + } + + /** + * Get the hiveCompatiblePartitions property: Property hiveCompatiblePartitions. + * + * @return the hiveCompatiblePartitions value. + */ + public Boolean hiveCompatiblePartitions() { + return this.hiveCompatiblePartitions; + } + + /** + * Set the hiveCompatiblePartitions property: Property hiveCompatiblePartitions. + * + * @param hiveCompatiblePartitions the hiveCompatiblePartitions value to set. + * @return the DestinationOptionsModelProperties object itself. + */ + public DestinationOptionsModelProperties withHiveCompatiblePartitions(Boolean hiveCompatiblePartitions) { + this.hiveCompatiblePartitions = hiveCompatiblePartitions; + return this; + } + + /** + * Get the perHourPartition property: Property perHourPartition. + * + * @return the perHourPartition value. + */ + public Boolean perHourPartition() { + return this.perHourPartition; + } + + /** + * Set the perHourPartition property: Property perHourPartition. + * + * @param perHourPartition the perHourPartition value to set. + * @return the DestinationOptionsModelProperties object itself. + */ + public DestinationOptionsModelProperties withPerHourPartition(Boolean perHourPartition) { + this.perHourPartition = perHourPartition; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("fileFormat", this.fileFormat == null ? null : this.fileFormat.toString()); + jsonWriter.writeBooleanField("hiveCompatiblePartitions", this.hiveCompatiblePartitions); + jsonWriter.writeBooleanField("perHourPartition", this.perHourPartition); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of DestinationOptionsModelProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of DestinationOptionsModelProperties if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the DestinationOptionsModelProperties. + */ + public static DestinationOptionsModelProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + DestinationOptionsModelProperties deserializedDestinationOptionsModelProperties + = new DestinationOptionsModelProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("fileFormat".equals(fieldName)) { + deserializedDestinationOptionsModelProperties.fileFormat + = FileFormat.fromString(reader.getString()); + } else if ("hiveCompatiblePartitions".equals(fieldName)) { + deserializedDestinationOptionsModelProperties.hiveCompatiblePartitions + = reader.getNullable(JsonReader::getBoolean); + } else if ("perHourPartition".equals(fieldName)) { + deserializedDestinationOptionsModelProperties.perHourPartition + = reader.getNullable(JsonReader::getBoolean); + } else { + reader.skipChildren(); + } + } + + return deserializedDestinationOptionsModelProperties; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/Device.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/Device.java new file mode 100644 index 000000000000..b189a29f3062 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/Device.java @@ -0,0 +1,154 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Definition of Device. + */ +@Fluent +public final class Device implements JsonSerializable { + /* + * The path inside the container at which to expose the host device. + */ + private String containerPath; + + /* + * The path for the device on the host container instance. + */ + private String hostPath; + + /* + * The explicit permissions to provide to the container for the device. By default, the container has permissions + * for ``read``, ``write``, and ``mknod`` for the device. + */ + private List permissions; + + /** + * Creates an instance of Device class. + */ + public Device() { + } + + /** + * Get the containerPath property: The path inside the container at which to expose the host device. + * + * @return the containerPath value. + */ + public String containerPath() { + return this.containerPath; + } + + /** + * Set the containerPath property: The path inside the container at which to expose the host device. + * + * @param containerPath the containerPath value to set. + * @return the Device object itself. + */ + public Device withContainerPath(String containerPath) { + this.containerPath = containerPath; + return this; + } + + /** + * Get the hostPath property: The path for the device on the host container instance. + * + * @return the hostPath value. + */ + public String hostPath() { + return this.hostPath; + } + + /** + * Set the hostPath property: The path for the device on the host container instance. + * + * @param hostPath the hostPath value to set. + * @return the Device object itself. + */ + public Device withHostPath(String hostPath) { + this.hostPath = hostPath; + return this; + } + + /** + * Get the permissions property: The explicit permissions to provide to the container for the device. By default, + * the container has permissions for ``read``, ``write``, and ``mknod`` for the device. + * + * @return the permissions value. + */ + public List permissions() { + return this.permissions; + } + + /** + * Set the permissions property: The explicit permissions to provide to the container for the device. By default, + * the container has permissions for ``read``, ``write``, and ``mknod`` for the device. + * + * @param permissions the permissions value to set. + * @return the Device object itself. + */ + public Device withPermissions(List permissions) { + this.permissions = permissions; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("containerPath", this.containerPath); + jsonWriter.writeStringField("hostPath", this.hostPath); + jsonWriter.writeArrayField("permissions", this.permissions, (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of Device from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of Device if the JsonReader was pointing to an instance of it, or null if it was pointing to + * JSON null. + * @throws IOException If an error occurs while reading the Device. + */ + public static Device fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + Device deserializedDevice = new Device(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("containerPath".equals(fieldName)) { + deserializedDevice.containerPath = reader.getString(); + } else if ("hostPath".equals(fieldName)) { + deserializedDevice.hostPath = reader.getString(); + } else if ("permissions".equals(fieldName)) { + List permissions = reader.readArray(reader1 -> reader1.getString()); + deserializedDevice.permissions = permissions; + } else { + reader.skipChildren(); + } + } + + return deserializedDevice; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/DeviceType.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/DeviceType.java new file mode 100644 index 000000000000..e123f748a4c6 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/DeviceType.java @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * DeviceType enum. + */ +public final class DeviceType extends ExpandableStringEnum { + /** + * Static value ebs for DeviceType. + */ + public static final DeviceType EBS = fromString("ebs"); + + /** + * Static value instance-store for DeviceType. + */ + public static final DeviceType INSTANCE_STORE = fromString("instance-store"); + + /** + * Creates a new instance of DeviceType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public DeviceType() { + } + + /** + * Creates or finds a DeviceType from its string representation. + * + * @param name a name to look for. + * @return the corresponding DeviceType. + */ + public static DeviceType fromString(String name) { + return fromString(name, DeviceType.class); + } + + /** + * Gets known DeviceType values. + * + * @return known DeviceType values. + */ + public static Collection values() { + return values(DeviceType.class); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/DeviceTypeEnumValue.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/DeviceTypeEnumValue.java new file mode 100644 index 000000000000..c85247d73ce6 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/DeviceTypeEnumValue.java @@ -0,0 +1,93 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of DeviceTypeEnumValue. + */ +@Fluent +public final class DeviceTypeEnumValue implements JsonSerializable { + /* + * Property value + */ + private DeviceType value; + + /** + * Creates an instance of DeviceTypeEnumValue class. + */ + public DeviceTypeEnumValue() { + } + + /** + * Get the value property: Property value. + * + * @return the value value. + */ + public DeviceType value() { + return this.value; + } + + /** + * Set the value property: Property value. + * + * @param value the value value to set. + * @return the DeviceTypeEnumValue object itself. + */ + public DeviceTypeEnumValue withValue(DeviceType value) { + this.value = value; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("value", this.value == null ? null : this.value.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of DeviceTypeEnumValue from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of DeviceTypeEnumValue if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the DeviceTypeEnumValue. + */ + public static DeviceTypeEnumValue fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + DeviceTypeEnumValue deserializedDeviceTypeEnumValue = new DeviceTypeEnumValue(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + deserializedDeviceTypeEnumValue.value = DeviceType.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedDeviceTypeEnumValue; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/Dimension.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/Dimension.java new file mode 100644 index 000000000000..0666f9f02233 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/Dimension.java @@ -0,0 +1,124 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of Dimension. + */ +@Fluent +public final class Dimension implements JsonSerializable { + /* + * The name of the dimension, from 1–255 characters in length. This dimension name must have been included when the + * metric was published. + */ + private String name; + + /* + * The value for the dimension, from 1–255 characters in length. + */ + private String value; + + /** + * Creates an instance of Dimension class. + */ + public Dimension() { + } + + /** + * Get the name property: The name of the dimension, from 1–255 characters in length. This dimension name must have + * been included when the metric was published. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: The name of the dimension, from 1–255 characters in length. This dimension name must have + * been included when the metric was published. + * + * @param name the name value to set. + * @return the Dimension object itself. + */ + public Dimension withName(String name) { + this.name = name; + return this; + } + + /** + * Get the value property: The value for the dimension, from 1–255 characters in length. + * + * @return the value value. + */ + public String value() { + return this.value; + } + + /** + * Set the value property: The value for the dimension, from 1–255 characters in length. + * + * @param value the value value to set. + * @return the Dimension object itself. + */ + public Dimension withValue(String value) { + this.value = value; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("name", this.name); + jsonWriter.writeStringField("value", this.value); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of Dimension from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of Dimension if the JsonReader was pointing to an instance of it, or null if it was pointing + * to JSON null. + * @throws IOException If an error occurs while reading the Dimension. + */ + public static Dimension fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + Dimension deserializedDimension = new Dimension(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("name".equals(fieldName)) { + deserializedDimension.name = reader.getString(); + } else if ("value".equals(fieldName)) { + deserializedDimension.value = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedDimension; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/DimensionAutoGenerated.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/DimensionAutoGenerated.java new file mode 100644 index 000000000000..5661f4c984f8 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/DimensionAutoGenerated.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.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of Dimension. + */ +@Fluent +public final class DimensionAutoGenerated implements JsonSerializable { + /* + * The name for the CW metric dimension that the metric filter creates. Dimension names must contain only ASCII + * characters, must include at least one non-whitespace character, and cannot start with a colon (:). + */ + private String key; + + /* + * The log event field that will contain the value for this dimension. This dimension will only be published for a + * metric if the value is found in the log event. For example, ``$.eventType`` for JSON log events, or ``$server`` + * for space-delimited log events. + */ + private String value; + + /** + * Creates an instance of DimensionAutoGenerated class. + */ + public DimensionAutoGenerated() { + } + + /** + * Get the key property: The name for the CW metric dimension that the metric filter creates. Dimension names must + * contain only ASCII characters, must include at least one non-whitespace character, and cannot start with a colon + * (:). + * + * @return the key value. + */ + public String key() { + return this.key; + } + + /** + * Set the key property: The name for the CW metric dimension that the metric filter creates. Dimension names must + * contain only ASCII characters, must include at least one non-whitespace character, and cannot start with a colon + * (:). + * + * @param key the key value to set. + * @return the DimensionAutoGenerated object itself. + */ + public DimensionAutoGenerated withKey(String key) { + this.key = key; + return this; + } + + /** + * Get the value property: The log event field that will contain the value for this dimension. This dimension will + * only be published for a metric if the value is found in the log event. For example, ``$.eventType`` for JSON log + * events, or ``$server`` for space-delimited log events. + * + * @return the value value. + */ + public String value() { + return this.value; + } + + /** + * Set the value property: The log event field that will contain the value for this dimension. This dimension will + * only be published for a metric if the value is found in the log event. For example, ``$.eventType`` for JSON log + * events, or ``$server`` for space-delimited log events. + * + * @param value the value value to set. + * @return the DimensionAutoGenerated object itself. + */ + public DimensionAutoGenerated withValue(String value) { + this.value = value; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("key", this.key); + jsonWriter.writeStringField("value", this.value); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of DimensionAutoGenerated from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of DimensionAutoGenerated if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the DimensionAutoGenerated. + */ + public static DimensionAutoGenerated fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + DimensionAutoGenerated deserializedDimensionAutoGenerated = new DimensionAutoGenerated(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("key".equals(fieldName)) { + deserializedDimensionAutoGenerated.key = reader.getString(); + } else if ("value".equals(fieldName)) { + deserializedDimensionAutoGenerated.value = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedDimensionAutoGenerated; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/DimensionAutoGenerated2.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/DimensionAutoGenerated2.java new file mode 100644 index 000000000000..b3e62fce69ab --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/DimensionAutoGenerated2.java @@ -0,0 +1,93 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of Dimension. + */ +@Fluent +public final class DimensionAutoGenerated2 implements JsonSerializable { + /* + * Property value + */ + private String value; + + /** + * Creates an instance of DimensionAutoGenerated2 class. + */ + public DimensionAutoGenerated2() { + } + + /** + * Get the value property: Property value. + * + * @return the value value. + */ + public String value() { + return this.value; + } + + /** + * Set the value property: Property value. + * + * @param value the value value to set. + * @return the DimensionAutoGenerated2 object itself. + */ + public DimensionAutoGenerated2 withValue(String value) { + this.value = value; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("value", this.value); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of DimensionAutoGenerated2 from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of DimensionAutoGenerated2 if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the DimensionAutoGenerated2. + */ + public static DimensionAutoGenerated2 fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + DimensionAutoGenerated2 deserializedDimensionAutoGenerated2 = new DimensionAutoGenerated2(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + deserializedDimensionAutoGenerated2.value = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedDimensionAutoGenerated2; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/DimensionAutoGenerated3.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/DimensionAutoGenerated3.java new file mode 100644 index 000000000000..9b895566b096 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/DimensionAutoGenerated3.java @@ -0,0 +1,93 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of Dimension. + */ +@Fluent +public final class DimensionAutoGenerated3 implements JsonSerializable { + /* + * Property value + */ + private String value; + + /** + * Creates an instance of DimensionAutoGenerated3 class. + */ + public DimensionAutoGenerated3() { + } + + /** + * Get the value property: Property value. + * + * @return the value value. + */ + public String value() { + return this.value; + } + + /** + * Set the value property: Property value. + * + * @param value the value value to set. + * @return the DimensionAutoGenerated3 object itself. + */ + public DimensionAutoGenerated3 withValue(String value) { + this.value = value; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("value", this.value); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of DimensionAutoGenerated3 from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of DimensionAutoGenerated3 if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the DimensionAutoGenerated3. + */ + public static DimensionAutoGenerated3 fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + DimensionAutoGenerated3 deserializedDimensionAutoGenerated3 = new DimensionAutoGenerated3(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + deserializedDimensionAutoGenerated3.value = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedDimensionAutoGenerated3; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/Disk.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/Disk.java new file mode 100644 index 000000000000..ec5fcb055ac0 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/Disk.java @@ -0,0 +1,261 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of Disk. + */ +@Fluent +public final class Disk implements JsonSerializable { + /* + * Instance attached to the disk. + */ + private String attachedTo; + + /* + * Attachment state of the disk. + */ + private String attachmentState; + + /* + * The names to use for your new Lightsail disk. + */ + private String diskName; + + /* + * IOPS of disk. + */ + private Integer iops; + + /* + * Is the Attached disk is the system disk of the Instance. + */ + private Boolean isSystemDisk; + + /* + * Path of the disk attached to the instance. + */ + private String path; + + /* + * Size of the disk attached to the Instance. + */ + private String sizeInGb; + + /** + * Creates an instance of Disk class. + */ + public Disk() { + } + + /** + * Get the attachedTo property: Instance attached to the disk. + * + * @return the attachedTo value. + */ + public String attachedTo() { + return this.attachedTo; + } + + /** + * Set the attachedTo property: Instance attached to the disk. + * + * @param attachedTo the attachedTo value to set. + * @return the Disk object itself. + */ + public Disk withAttachedTo(String attachedTo) { + this.attachedTo = attachedTo; + return this; + } + + /** + * Get the attachmentState property: Attachment state of the disk. + * + * @return the attachmentState value. + */ + public String attachmentState() { + return this.attachmentState; + } + + /** + * Set the attachmentState property: Attachment state of the disk. + * + * @param attachmentState the attachmentState value to set. + * @return the Disk object itself. + */ + public Disk withAttachmentState(String attachmentState) { + this.attachmentState = attachmentState; + return this; + } + + /** + * Get the diskName property: The names to use for your new Lightsail disk. + * + * @return the diskName value. + */ + public String diskName() { + return this.diskName; + } + + /** + * Set the diskName property: The names to use for your new Lightsail disk. + * + * @param diskName the diskName value to set. + * @return the Disk object itself. + */ + public Disk withDiskName(String diskName) { + this.diskName = diskName; + return this; + } + + /** + * Get the iops property: IOPS of disk. + * + * @return the iops value. + */ + public Integer iops() { + return this.iops; + } + + /** + * Set the iops property: IOPS of disk. + * + * @param iops the iops value to set. + * @return the Disk object itself. + */ + public Disk withIops(Integer iops) { + this.iops = iops; + return this; + } + + /** + * Get the isSystemDisk property: Is the Attached disk is the system disk of the Instance. + * + * @return the isSystemDisk value. + */ + public Boolean isSystemDisk() { + return this.isSystemDisk; + } + + /** + * Set the isSystemDisk property: Is the Attached disk is the system disk of the Instance. + * + * @param isSystemDisk the isSystemDisk value to set. + * @return the Disk object itself. + */ + public Disk withIsSystemDisk(Boolean isSystemDisk) { + this.isSystemDisk = isSystemDisk; + return this; + } + + /** + * Get the path property: Path of the disk attached to the instance. + * + * @return the path value. + */ + public String path() { + return this.path; + } + + /** + * Set the path property: Path of the disk attached to the instance. + * + * @param path the path value to set. + * @return the Disk object itself. + */ + public Disk withPath(String path) { + this.path = path; + return this; + } + + /** + * Get the sizeInGb property: Size of the disk attached to the Instance. + * + * @return the sizeInGb value. + */ + public String sizeInGb() { + return this.sizeInGb; + } + + /** + * Set the sizeInGb property: Size of the disk attached to the Instance. + * + * @param sizeInGb the sizeInGb value to set. + * @return the Disk object itself. + */ + public Disk withSizeInGb(String sizeInGb) { + this.sizeInGb = sizeInGb; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("attachedTo", this.attachedTo); + jsonWriter.writeStringField("attachmentState", this.attachmentState); + jsonWriter.writeStringField("diskName", this.diskName); + jsonWriter.writeNumberField("iops", this.iops); + jsonWriter.writeBooleanField("isSystemDisk", this.isSystemDisk); + jsonWriter.writeStringField("path", this.path); + jsonWriter.writeStringField("sizeInGb", this.sizeInGb); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of Disk from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of Disk if the JsonReader was pointing to an instance of it, or null if it was pointing to + * JSON null. + * @throws IOException If an error occurs while reading the Disk. + */ + public static Disk fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + Disk deserializedDisk = new Disk(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("attachedTo".equals(fieldName)) { + deserializedDisk.attachedTo = reader.getString(); + } else if ("attachmentState".equals(fieldName)) { + deserializedDisk.attachmentState = reader.getString(); + } else if ("diskName".equals(fieldName)) { + deserializedDisk.diskName = reader.getString(); + } else if ("iops".equals(fieldName)) { + deserializedDisk.iops = reader.getNullable(JsonReader::getInt); + } else if ("isSystemDisk".equals(fieldName)) { + deserializedDisk.isSystemDisk = reader.getNullable(JsonReader::getBoolean); + } else if ("path".equals(fieldName)) { + deserializedDisk.path = reader.getString(); + } else if ("sizeInGb".equals(fieldName)) { + deserializedDisk.sizeInGb = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedDisk; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/Distribution.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/Distribution.java new file mode 100644 index 000000000000..a43550c2a162 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/Distribution.java @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Distribution enum. + */ +public final class Distribution extends ExpandableStringEnum { + /** + * Static value ByLogStream for Distribution. + */ + public static final Distribution BY_LOG_STREAM = fromString("ByLogStream"); + + /** + * Static value Random for Distribution. + */ + public static final Distribution RANDOM = fromString("Random"); + + /** + * Creates a new instance of Distribution value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public Distribution() { + } + + /** + * Creates or finds a Distribution from its string representation. + * + * @param name a name to look for. + * @return the corresponding Distribution. + */ + public static Distribution fromString(String name) { + return fromString(name, Distribution.class); + } + + /** + * Gets known Distribution values. + * + * @return known Distribution values. + */ + public static Collection values() { + return values(Distribution.class); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/DistributionConfig.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/DistributionConfig.java new file mode 100644 index 000000000000..71fa0d021ce8 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/DistributionConfig.java @@ -0,0 +1,998 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Definition of DistributionConfig. + */ +@Fluent +public final class DistributionConfig implements JsonSerializable { + /* + * A complex type that contains information about CNAMEs (alternate domain names), if any, for this distribution. + */ + private List aliases; + + /* + * Property cnamEs + */ + private List cnamEs; + + /* + * A complex type that contains zero or more ``CacheBehavior`` elements. + */ + private List cacheBehaviors; + + /* + * A comment to describe the distribution. The comment cannot be longer than 128 characters. + */ + private String comment; + + /* + * The identifier of a continuous deployment policy. For more information, see ``CreateContinuousDeploymentPolicy``. + */ + private String continuousDeploymentPolicyId; + + /* + * A complex type that controls the following: + Whether CloudFront replaces HTTP status codes in the 4xx and 5xx + * range with custom error messages before returning the response to the viewer. + How long CloudFront caches HTTP + * status codes in the 4xx and 5xx range. For more information about custom error pages, see [Customizing Error + * Responses](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/custom-error-pages.html) in the + * *Amazon CloudFront Developer Guide*. + */ + private List customErrorResponses; + + /* + * Property customOrigin + */ + private LegacyCustomOrigin customOrigin; + + /* + * A complex type that describes the default cache behavior if you don't specify a ``CacheBehavior`` element or if + * files don't match any of the values of ``PathPattern`` in ``CacheBehavior`` elements. You must create exactly one + * default cache behavior. A complex type that describes the default cache behavior if you don't specify a + * ``CacheBehavior`` element or if request URLs don't match any of the values of ``PathPattern`` in + * ``CacheBehavior`` elements. You must create exactly one default cache behavior. + */ + private DefaultCacheBehavior defaultCacheBehavior; + + /* + * The object that you want CloudFront to request from your origin (for example, ``index.html``) when a viewer + * requests the root URL for your distribution (``https://www.example.com``) instead of an object in your + * distribution (``https://www.example.com/product-description.html``). Specifying a default root object avoids + * exposing the contents of your distribution. Specify only the object name, for example, ``index.html``. Don't add + * a ``/`` before the object name. If you don't want to specify a default root object when you create a + * distribution, include an empty ``DefaultRootObject`` element. To delete the default root object from an existing + * distribution, update the distribution configuration and include an empty ``DefaultRootObject`` element. To + * replace the default root object, update the distribution configuration and specify the new object. For more + * information about the default root object, see [Creating a Default Root + * Object](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/DefaultRootObject.html) in the *Amazon + * CloudFront Developer Guide*. + */ + private String defaultRootObject; + + /* + * From this field, you can enable or disable the selected distribution. + */ + private Boolean enabled; + + /* + * (Optional) Specify the maximum HTTP version(s) that you want viewers to use to communicate with CF. The default + * value for new distributions is ``http1.1``. For viewers and CF to use HTTP/2, viewers must support TLSv1.2 or + * later, and must support Server Name Indication (SNI). For viewers and CF to use HTTP/3, viewers must support + * TLSv1.3 and Server Name Indication (SNI). CF supports HTTP/3 connection migration to allow the viewer to switch + * networks without losing connection. For more information about connection migration, see [Connection + * Migration](https://docs.aws.amazon.com/https://www.rfc-editor.org/rfc/rfc9000.html#name-connection-migration) at + * RFC 9000. For more information about supported TLSv1.3 ciphers, see [Supported protocols and ciphers between + * viewers and + * CloudFront](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/secure-connections-supported- + * viewer-protocols-ciphers.html). + */ + private String httpVersion; + + /* + * If you want CloudFront to respond to IPv6 DNS requests with an IPv6 address for your distribution, specify + * ``true``. If you specify ``false``, CloudFront responds to IPv6 DNS requests with the DNS response code + * ``NOERROR`` and with no IP addresses. This allows viewers to submit a second request, for an IPv4 address for + * your distribution. In general, you should enable IPv6 if you have users on IPv6 networks who want to access your + * content. However, if you're using signed URLs or signed cookies to restrict access to your content, and if you're + * using a custom policy that includes the ``IpAddress`` parameter to restrict the IP addresses that can access your + * content, don't enable IPv6. If you want to restrict access to some content by IP address and not restrict access + * to other content (or restrict access but not by IP address), you can create two distributions. For more + * information, see [Creating a Signed URL Using a Custom + * Policy](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/private-content-creating-signed-url- + * custom-policy.html) in the *Amazon CloudFront Developer Guide*. If you're using an R53AWSIntlong alias resource + * record set to route traffic to your CloudFront distribution, you need to create a second alias resource record + * set when both of the following are true: + You enable IPv6 for the distribution + You're using alternate domain + * names in the URLs for your objects For more information, see [Routing Traffic to an Amazon CloudFront Web + * Distribution by Using Your Domain + * Name](https://docs.aws.amazon.com/Route53/latest/DeveloperGuide/routing-to-cloudfront-distribution.html) in the + * *Developer Guide*. If you created a CNAME resource record set, either with R53AWSIntlong or with another DNS + * service, you don't need to make any changes. A CNAME record will route traffic to your distribution regardless of + * the IP address format of the viewer request. + */ + private Boolean ipV6Enabled; + + /* + * A complex type that controls whether access logs are written for the distribution. For more information about + * logging, see [Access Logs](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/AccessLogs.html) in + * the *Amazon CloudFront Developer Guide*. A complex type that controls whether access logs are written for the + * distribution. + */ + private Logging logging; + + /* + * A complex type that contains information about origin groups for this distribution. A complex data type for the + * origin groups specified for a distribution. + */ + private OriginGroups originGroups; + + /* + * A complex type that contains information about origins for this distribution. + */ + private List origins; + + /* + * The price class that corresponds with the maximum price that you want to pay for CloudFront service. If you + * specify ``PriceClass_All``, CloudFront responds to requests for your objects from all CloudFront edge locations. + * If you specify a price class other than ``PriceClass_All``, CloudFront serves your objects from the CloudFront + * edge location that has the lowest latency among the edge locations in your price class. Viewers who are in or + * near regions that are excluded from your specified price class may encounter slower performance. For more + * information about price classes, see [Choosing the Price Class for a CloudFront + * Distribution](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/PriceClass.html) in the *Amazon + * CloudFront Developer Guide*. For information about CloudFront pricing, including how price classes (such as Price + * Class 100) map to CloudFront regions, see [Amazon CloudFront + * Pricing](https://docs.aws.amazon.com/cloudfront/pricing/). + */ + private String priceClass; + + /* + * A complex type that identifies ways in which you want to restrict distribution of your content. A complex type + * that identifies ways in which you want to restrict distribution of your content. + */ + private Restrictions restrictions; + + /* + * Property s3Origin + */ + private LegacyS3Origin s3Origin; + + /* + * A Boolean that indicates whether this is a staging distribution. When this value is ``true``, this is a staging + * distribution. When this value is ``false``, this is not a staging distribution. + */ + private Boolean staging; + + /* + * A complex type that determines the distribution's SSL/TLS configuration for communicating with viewers. A complex + * type that determines the distribution's SSL/TLS configuration for communicating with viewers. If the distribution + * doesn't use ``Aliases`` (also known as alternate domain names or CNAMEs)—that is, if the distribution uses the + * CloudFront domain name such as ``d111111abcdef8.cloudfront.net``—set ``CloudFrontDefaultCertificate`` to ``true`` + * and leave all other fields empty. If the distribution uses ``Aliases`` (alternate domain names or CNAMEs), use + * the fields in this type to specify the following settings: + Which viewers the distribution accepts HTTPS + * connections from: only viewers that support [server name indication + * (SNI)](https://docs.aws.amazon.com/https://en.wikipedia.org/wiki/Server_Name_Indication) (recommended), or all + * viewers including those that don't support SNI. + To accept HTTPS connections from only viewers that support SNI, + * set ``SSLSupportMethod`` to ``sni-only``. This is recommended. Most browsers and clients support SNI. (In + * CloudFormation, the field name is ``SslSupportMethod``. Note the different capitalization.) + To accept HTTPS + * connections from all viewers, including those that don't support SNI, set ``SSLSupportMethod`` to ``vip``. This + * is not recommended, and results in additional monthly charges from CloudFront. (In CloudFormation, the field name + * is ``SslSupportMethod``. Note the different capitalization.) + The minimum SSL/TLS protocol version that the + * distribution can use to communicate with viewers. To specify a minimum version, choose a value for + * ``MinimumProtocolVersion``. For more information, see [Security + * Policy](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/distribution-web-values-specify.html# + * DownloadDistValues-security-policy) in the *Amazon CloudFront Developer Guide*. + The location of the SSL/TLS + * certificate, [(ACM)](https://docs.aws.amazon.com/acm/latest/userguide/acm-overview.html) (recommended) or + * [(IAM)](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_server-certs.html). You specify the + * location by setting a value in one of the following fields (not both): + ``ACMCertificateArn`` (In + * CloudFormation, this field name is ``AcmCertificateArn``. Note the different capitalization.) + + * ``IAMCertificateId`` (In CloudFormation, this field name is ``IamCertificateId``. Note the different + * capitalization.) All distributions support HTTPS connections from viewers. To require viewers to use HTTPS only, + * or to redirect them from HTTP to HTTPS, use ``ViewerProtocolPolicy`` in the ``CacheBehavior`` or + * ``DefaultCacheBehavior``. To specify how CloudFront should use SSL/TLS to communicate with your custom origin, + * use ``CustomOriginConfig``. For more information, see [Using HTTPS with + * CloudFront](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/using-https.html) and [Using + * Alternate Domain Names and + * HTTPS](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/using-https-alternate-domain-names. + * html) in the *Amazon CloudFront Developer Guide*. + */ + private ViewerCertificate viewerCertificate; + + /* + * A unique identifier that specifies the WAF web ACL, if any, to associate with this distribution. To specify a web + * ACL created using the latest version of WAF, use the ACL ARN, for example + * ``arn:aws:wafv2:us-east-1:123456789012:global/webacl/ExampleWebACL/473e64fd-f30b-4765-81a0-62ad96dd167a``. To + * specify a web ACL created using WAF Classic, use the ACL ID, for example + * ``473e64fd-f30b-4765-81a0-62ad96dd167a``. WAF is a web application firewall that lets you monitor the HTTP and + * HTTPS requests that are forwarded to CloudFront, and lets you control access to your content. Based on conditions + * that you specify, such as the IP addresses that requests originate from or the values of query strings, + * CloudFront responds to requests either with the requested content or with an HTTP 403 status code (Forbidden). + * You can also configure CloudFront to return a custom error page when a request is blocked. For more information + * about WAF, see the [Developer Guide](https://docs.aws.amazon.com/waf/latest/developerguide/what-is-aws-waf.html). + */ + private String webAclId; + + /** + * Creates an instance of DistributionConfig class. + */ + public DistributionConfig() { + } + + /** + * Get the aliases property: A complex type that contains information about CNAMEs (alternate domain names), if any, + * for this distribution. + * + * @return the aliases value. + */ + public List aliases() { + return this.aliases; + } + + /** + * Set the aliases property: A complex type that contains information about CNAMEs (alternate domain names), if any, + * for this distribution. + * + * @param aliases the aliases value to set. + * @return the DistributionConfig object itself. + */ + public DistributionConfig withAliases(List aliases) { + this.aliases = aliases; + return this; + } + + /** + * Get the cnamEs property: Property cnamEs. + * + * @return the cnamEs value. + */ + public List cnamEs() { + return this.cnamEs; + } + + /** + * Set the cnamEs property: Property cnamEs. + * + * @param cnamEs the cnamEs value to set. + * @return the DistributionConfig object itself. + */ + public DistributionConfig withCnamEs(List cnamEs) { + this.cnamEs = cnamEs; + return this; + } + + /** + * Get the cacheBehaviors property: A complex type that contains zero or more ``CacheBehavior`` elements. + * + * @return the cacheBehaviors value. + */ + public List cacheBehaviors() { + return this.cacheBehaviors; + } + + /** + * Set the cacheBehaviors property: A complex type that contains zero or more ``CacheBehavior`` elements. + * + * @param cacheBehaviors the cacheBehaviors value to set. + * @return the DistributionConfig object itself. + */ + public DistributionConfig withCacheBehaviors(List cacheBehaviors) { + this.cacheBehaviors = cacheBehaviors; + return this; + } + + /** + * Get the comment property: A comment to describe the distribution. The comment cannot be longer than 128 + * characters. + * + * @return the comment value. + */ + public String comment() { + return this.comment; + } + + /** + * Set the comment property: A comment to describe the distribution. The comment cannot be longer than 128 + * characters. + * + * @param comment the comment value to set. + * @return the DistributionConfig object itself. + */ + public DistributionConfig withComment(String comment) { + this.comment = comment; + return this; + } + + /** + * Get the continuousDeploymentPolicyId property: The identifier of a continuous deployment policy. For more + * information, see ``CreateContinuousDeploymentPolicy``. + * + * @return the continuousDeploymentPolicyId value. + */ + public String continuousDeploymentPolicyId() { + return this.continuousDeploymentPolicyId; + } + + /** + * Set the continuousDeploymentPolicyId property: The identifier of a continuous deployment policy. For more + * information, see ``CreateContinuousDeploymentPolicy``. + * + * @param continuousDeploymentPolicyId the continuousDeploymentPolicyId value to set. + * @return the DistributionConfig object itself. + */ + public DistributionConfig withContinuousDeploymentPolicyId(String continuousDeploymentPolicyId) { + this.continuousDeploymentPolicyId = continuousDeploymentPolicyId; + return this; + } + + /** + * Get the customErrorResponses property: A complex type that controls the following: + Whether CloudFront replaces + * HTTP status codes in the 4xx and 5xx range with custom error messages before returning the response to the + * viewer. + How long CloudFront caches HTTP status codes in the 4xx and 5xx range. For more information about + * custom error pages, see [Customizing Error + * Responses](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/custom-error-pages.html) in the + * *Amazon CloudFront Developer Guide*. + * + * @return the customErrorResponses value. + */ + public List customErrorResponses() { + return this.customErrorResponses; + } + + /** + * Set the customErrorResponses property: A complex type that controls the following: + Whether CloudFront replaces + * HTTP status codes in the 4xx and 5xx range with custom error messages before returning the response to the + * viewer. + How long CloudFront caches HTTP status codes in the 4xx and 5xx range. For more information about + * custom error pages, see [Customizing Error + * Responses](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/custom-error-pages.html) in the + * *Amazon CloudFront Developer Guide*. + * + * @param customErrorResponses the customErrorResponses value to set. + * @return the DistributionConfig object itself. + */ + public DistributionConfig withCustomErrorResponses(List customErrorResponses) { + this.customErrorResponses = customErrorResponses; + return this; + } + + /** + * Get the customOrigin property: Property customOrigin. + * + * @return the customOrigin value. + */ + public LegacyCustomOrigin customOrigin() { + return this.customOrigin; + } + + /** + * Set the customOrigin property: Property customOrigin. + * + * @param customOrigin the customOrigin value to set. + * @return the DistributionConfig object itself. + */ + public DistributionConfig withCustomOrigin(LegacyCustomOrigin customOrigin) { + this.customOrigin = customOrigin; + return this; + } + + /** + * Get the defaultCacheBehavior property: A complex type that describes the default cache behavior if you don't + * specify a ``CacheBehavior`` element or if files don't match any of the values of ``PathPattern`` in + * ``CacheBehavior`` elements. You must create exactly one default cache behavior. A complex type that describes the + * default cache behavior if you don't specify a ``CacheBehavior`` element or if request URLs don't match any of the + * values of ``PathPattern`` in ``CacheBehavior`` elements. You must create exactly one default cache behavior. + * + * @return the defaultCacheBehavior value. + */ + public DefaultCacheBehavior defaultCacheBehavior() { + return this.defaultCacheBehavior; + } + + /** + * Set the defaultCacheBehavior property: A complex type that describes the default cache behavior if you don't + * specify a ``CacheBehavior`` element or if files don't match any of the values of ``PathPattern`` in + * ``CacheBehavior`` elements. You must create exactly one default cache behavior. A complex type that describes the + * default cache behavior if you don't specify a ``CacheBehavior`` element or if request URLs don't match any of the + * values of ``PathPattern`` in ``CacheBehavior`` elements. You must create exactly one default cache behavior. + * + * @param defaultCacheBehavior the defaultCacheBehavior value to set. + * @return the DistributionConfig object itself. + */ + public DistributionConfig withDefaultCacheBehavior(DefaultCacheBehavior defaultCacheBehavior) { + this.defaultCacheBehavior = defaultCacheBehavior; + return this; + } + + /** + * Get the defaultRootObject property: The object that you want CloudFront to request from your origin (for example, + * ``index.html``) when a viewer requests the root URL for your distribution (``https://www.example.com``) instead + * of an object in your distribution (``https://www.example.com/product-description.html``). Specifying a default + * root object avoids exposing the contents of your distribution. Specify only the object name, for example, + * ``index.html``. Don't add a ``/`` before the object name. If you don't want to specify a default root object when + * you create a distribution, include an empty ``DefaultRootObject`` element. To delete the default root object from + * an existing distribution, update the distribution configuration and include an empty ``DefaultRootObject`` + * element. To replace the default root object, update the distribution configuration and specify the new object. + * For more information about the default root object, see [Creating a Default Root + * Object](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/DefaultRootObject.html) in the *Amazon + * CloudFront Developer Guide*. + * + * @return the defaultRootObject value. + */ + public String defaultRootObject() { + return this.defaultRootObject; + } + + /** + * Set the defaultRootObject property: The object that you want CloudFront to request from your origin (for example, + * ``index.html``) when a viewer requests the root URL for your distribution (``https://www.example.com``) instead + * of an object in your distribution (``https://www.example.com/product-description.html``). Specifying a default + * root object avoids exposing the contents of your distribution. Specify only the object name, for example, + * ``index.html``. Don't add a ``/`` before the object name. If you don't want to specify a default root object when + * you create a distribution, include an empty ``DefaultRootObject`` element. To delete the default root object from + * an existing distribution, update the distribution configuration and include an empty ``DefaultRootObject`` + * element. To replace the default root object, update the distribution configuration and specify the new object. + * For more information about the default root object, see [Creating a Default Root + * Object](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/DefaultRootObject.html) in the *Amazon + * CloudFront Developer Guide*. + * + * @param defaultRootObject the defaultRootObject value to set. + * @return the DistributionConfig object itself. + */ + public DistributionConfig withDefaultRootObject(String defaultRootObject) { + this.defaultRootObject = defaultRootObject; + return this; + } + + /** + * Get the enabled property: From this field, you can enable or disable the selected distribution. + * + * @return the enabled value. + */ + public Boolean enabled() { + return this.enabled; + } + + /** + * Set the enabled property: From this field, you can enable or disable the selected distribution. + * + * @param enabled the enabled value to set. + * @return the DistributionConfig object itself. + */ + public DistributionConfig withEnabled(Boolean enabled) { + this.enabled = enabled; + return this; + } + + /** + * Get the httpVersion property: (Optional) Specify the maximum HTTP version(s) that you want viewers to use to + * communicate with CF. The default value for new distributions is ``http1.1``. For viewers and CF to use HTTP/2, + * viewers must support TLSv1.2 or later, and must support Server Name Indication (SNI). For viewers and CF to use + * HTTP/3, viewers must support TLSv1.3 and Server Name Indication (SNI). CF supports HTTP/3 connection migration to + * allow the viewer to switch networks without losing connection. For more information about connection migration, + * see [Connection + * Migration](https://docs.aws.amazon.com/https://www.rfc-editor.org/rfc/rfc9000.html#name-connection-migration) at + * RFC 9000. For more information about supported TLSv1.3 ciphers, see [Supported protocols and ciphers between + * viewers and + * CloudFront](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/secure-connections-supported-viewer-protocols-ciphers.html). + * + * @return the httpVersion value. + */ + public String httpVersion() { + return this.httpVersion; + } + + /** + * Set the httpVersion property: (Optional) Specify the maximum HTTP version(s) that you want viewers to use to + * communicate with CF. The default value for new distributions is ``http1.1``. For viewers and CF to use HTTP/2, + * viewers must support TLSv1.2 or later, and must support Server Name Indication (SNI). For viewers and CF to use + * HTTP/3, viewers must support TLSv1.3 and Server Name Indication (SNI). CF supports HTTP/3 connection migration to + * allow the viewer to switch networks without losing connection. For more information about connection migration, + * see [Connection + * Migration](https://docs.aws.amazon.com/https://www.rfc-editor.org/rfc/rfc9000.html#name-connection-migration) at + * RFC 9000. For more information about supported TLSv1.3 ciphers, see [Supported protocols and ciphers between + * viewers and + * CloudFront](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/secure-connections-supported-viewer-protocols-ciphers.html). + * + * @param httpVersion the httpVersion value to set. + * @return the DistributionConfig object itself. + */ + public DistributionConfig withHttpVersion(String httpVersion) { + this.httpVersion = httpVersion; + return this; + } + + /** + * Get the ipV6Enabled property: If you want CloudFront to respond to IPv6 DNS requests with an IPv6 address for + * your distribution, specify ``true``. If you specify ``false``, CloudFront responds to IPv6 DNS requests with the + * DNS response code ``NOERROR`` and with no IP addresses. This allows viewers to submit a second request, for an + * IPv4 address for your distribution. In general, you should enable IPv6 if you have users on IPv6 networks who + * want to access your content. However, if you're using signed URLs or signed cookies to restrict access to your + * content, and if you're using a custom policy that includes the ``IpAddress`` parameter to restrict the IP + * addresses that can access your content, don't enable IPv6. If you want to restrict access to some content by IP + * address and not restrict access to other content (or restrict access but not by IP address), you can create two + * distributions. For more information, see [Creating a Signed URL Using a Custom + * Policy](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/private-content-creating-signed-url-custom-policy.html) + * in the *Amazon CloudFront Developer Guide*. If you're using an R53AWSIntlong alias resource record set to route + * traffic to your CloudFront distribution, you need to create a second alias resource record set when both of the + * following are true: + You enable IPv6 for the distribution + You're using alternate domain names in the URLs for + * your objects For more information, see [Routing Traffic to an Amazon CloudFront Web Distribution by Using Your + * Domain Name](https://docs.aws.amazon.com/Route53/latest/DeveloperGuide/routing-to-cloudfront-distribution.html) + * in the *Developer Guide*. If you created a CNAME resource record set, either with R53AWSIntlong or with another + * DNS service, you don't need to make any changes. A CNAME record will route traffic to your distribution + * regardless of the IP address format of the viewer request. + * + * @return the ipV6Enabled value. + */ + public Boolean ipV6Enabled() { + return this.ipV6Enabled; + } + + /** + * Set the ipV6Enabled property: If you want CloudFront to respond to IPv6 DNS requests with an IPv6 address for + * your distribution, specify ``true``. If you specify ``false``, CloudFront responds to IPv6 DNS requests with the + * DNS response code ``NOERROR`` and with no IP addresses. This allows viewers to submit a second request, for an + * IPv4 address for your distribution. In general, you should enable IPv6 if you have users on IPv6 networks who + * want to access your content. However, if you're using signed URLs or signed cookies to restrict access to your + * content, and if you're using a custom policy that includes the ``IpAddress`` parameter to restrict the IP + * addresses that can access your content, don't enable IPv6. If you want to restrict access to some content by IP + * address and not restrict access to other content (or restrict access but not by IP address), you can create two + * distributions. For more information, see [Creating a Signed URL Using a Custom + * Policy](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/private-content-creating-signed-url-custom-policy.html) + * in the *Amazon CloudFront Developer Guide*. If you're using an R53AWSIntlong alias resource record set to route + * traffic to your CloudFront distribution, you need to create a second alias resource record set when both of the + * following are true: + You enable IPv6 for the distribution + You're using alternate domain names in the URLs for + * your objects For more information, see [Routing Traffic to an Amazon CloudFront Web Distribution by Using Your + * Domain Name](https://docs.aws.amazon.com/Route53/latest/DeveloperGuide/routing-to-cloudfront-distribution.html) + * in the *Developer Guide*. If you created a CNAME resource record set, either with R53AWSIntlong or with another + * DNS service, you don't need to make any changes. A CNAME record will route traffic to your distribution + * regardless of the IP address format of the viewer request. + * + * @param ipV6Enabled the ipV6Enabled value to set. + * @return the DistributionConfig object itself. + */ + public DistributionConfig withIpV6Enabled(Boolean ipV6Enabled) { + this.ipV6Enabled = ipV6Enabled; + return this; + } + + /** + * Get the logging property: A complex type that controls whether access logs are written for the distribution. For + * more information about logging, see [Access + * Logs](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/AccessLogs.html) in the *Amazon + * CloudFront Developer Guide*. A complex type that controls whether access logs are written for the distribution. + * + * @return the logging value. + */ + public Logging logging() { + return this.logging; + } + + /** + * Set the logging property: A complex type that controls whether access logs are written for the distribution. For + * more information about logging, see [Access + * Logs](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/AccessLogs.html) in the *Amazon + * CloudFront Developer Guide*. A complex type that controls whether access logs are written for the distribution. + * + * @param logging the logging value to set. + * @return the DistributionConfig object itself. + */ + public DistributionConfig withLogging(Logging logging) { + this.logging = logging; + return this; + } + + /** + * Get the originGroups property: A complex type that contains information about origin groups for this + * distribution. A complex data type for the origin groups specified for a distribution. + * + * @return the originGroups value. + */ + public OriginGroups originGroups() { + return this.originGroups; + } + + /** + * Set the originGroups property: A complex type that contains information about origin groups for this + * distribution. A complex data type for the origin groups specified for a distribution. + * + * @param originGroups the originGroups value to set. + * @return the DistributionConfig object itself. + */ + public DistributionConfig withOriginGroups(OriginGroups originGroups) { + this.originGroups = originGroups; + return this; + } + + /** + * Get the origins property: A complex type that contains information about origins for this distribution. + * + * @return the origins value. + */ + public List origins() { + return this.origins; + } + + /** + * Set the origins property: A complex type that contains information about origins for this distribution. + * + * @param origins the origins value to set. + * @return the DistributionConfig object itself. + */ + public DistributionConfig withOrigins(List origins) { + this.origins = origins; + return this; + } + + /** + * Get the priceClass property: The price class that corresponds with the maximum price that you want to pay for + * CloudFront service. If you specify ``PriceClass_All``, CloudFront responds to requests for your objects from all + * CloudFront edge locations. If you specify a price class other than ``PriceClass_All``, CloudFront serves your + * objects from the CloudFront edge location that has the lowest latency among the edge locations in your price + * class. Viewers who are in or near regions that are excluded from your specified price class may encounter slower + * performance. For more information about price classes, see [Choosing the Price Class for a CloudFront + * Distribution](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/PriceClass.html) in the *Amazon + * CloudFront Developer Guide*. For information about CloudFront pricing, including how price classes (such as Price + * Class 100) map to CloudFront regions, see [Amazon CloudFront + * Pricing](https://docs.aws.amazon.com/cloudfront/pricing/). + * + * @return the priceClass value. + */ + public String priceClass() { + return this.priceClass; + } + + /** + * Set the priceClass property: The price class that corresponds with the maximum price that you want to pay for + * CloudFront service. If you specify ``PriceClass_All``, CloudFront responds to requests for your objects from all + * CloudFront edge locations. If you specify a price class other than ``PriceClass_All``, CloudFront serves your + * objects from the CloudFront edge location that has the lowest latency among the edge locations in your price + * class. Viewers who are in or near regions that are excluded from your specified price class may encounter slower + * performance. For more information about price classes, see [Choosing the Price Class for a CloudFront + * Distribution](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/PriceClass.html) in the *Amazon + * CloudFront Developer Guide*. For information about CloudFront pricing, including how price classes (such as Price + * Class 100) map to CloudFront regions, see [Amazon CloudFront + * Pricing](https://docs.aws.amazon.com/cloudfront/pricing/). + * + * @param priceClass the priceClass value to set. + * @return the DistributionConfig object itself. + */ + public DistributionConfig withPriceClass(String priceClass) { + this.priceClass = priceClass; + return this; + } + + /** + * Get the restrictions property: A complex type that identifies ways in which you want to restrict distribution of + * your content. A complex type that identifies ways in which you want to restrict distribution of your content. + * + * @return the restrictions value. + */ + public Restrictions restrictions() { + return this.restrictions; + } + + /** + * Set the restrictions property: A complex type that identifies ways in which you want to restrict distribution of + * your content. A complex type that identifies ways in which you want to restrict distribution of your content. + * + * @param restrictions the restrictions value to set. + * @return the DistributionConfig object itself. + */ + public DistributionConfig withRestrictions(Restrictions restrictions) { + this.restrictions = restrictions; + return this; + } + + /** + * Get the s3Origin property: Property s3Origin. + * + * @return the s3Origin value. + */ + public LegacyS3Origin s3Origin() { + return this.s3Origin; + } + + /** + * Set the s3Origin property: Property s3Origin. + * + * @param s3Origin the s3Origin value to set. + * @return the DistributionConfig object itself. + */ + public DistributionConfig withS3Origin(LegacyS3Origin s3Origin) { + this.s3Origin = s3Origin; + return this; + } + + /** + * Get the staging property: A Boolean that indicates whether this is a staging distribution. When this value is + * ``true``, this is a staging distribution. When this value is ``false``, this is not a staging distribution. + * + * @return the staging value. + */ + public Boolean staging() { + return this.staging; + } + + /** + * Set the staging property: A Boolean that indicates whether this is a staging distribution. When this value is + * ``true``, this is a staging distribution. When this value is ``false``, this is not a staging distribution. + * + * @param staging the staging value to set. + * @return the DistributionConfig object itself. + */ + public DistributionConfig withStaging(Boolean staging) { + this.staging = staging; + return this; + } + + /** + * Get the viewerCertificate property: A complex type that determines the distribution's SSL/TLS configuration for + * communicating with viewers. A complex type that determines the distribution's SSL/TLS configuration for + * communicating with viewers. If the distribution doesn't use ``Aliases`` (also known as alternate domain names or + * CNAMEs)—that is, if the distribution uses the CloudFront domain name such as + * ``d111111abcdef8.cloudfront.net``—set ``CloudFrontDefaultCertificate`` to ``true`` and leave all other fields + * empty. If the distribution uses ``Aliases`` (alternate domain names or CNAMEs), use the fields in this type to + * specify the following settings: + Which viewers the distribution accepts HTTPS connections from: only viewers + * that support [server name indication + * (SNI)](https://docs.aws.amazon.com/https://en.wikipedia.org/wiki/Server_Name_Indication) (recommended), or all + * viewers including those that don't support SNI. + To accept HTTPS connections from only viewers that support SNI, + * set ``SSLSupportMethod`` to ``sni-only``. This is recommended. Most browsers and clients support SNI. (In + * CloudFormation, the field name is ``SslSupportMethod``. Note the different capitalization.) + To accept HTTPS + * connections from all viewers, including those that don't support SNI, set ``SSLSupportMethod`` to ``vip``. This + * is not recommended, and results in additional monthly charges from CloudFront. (In CloudFormation, the field name + * is ``SslSupportMethod``. Note the different capitalization.) + The minimum SSL/TLS protocol version that the + * distribution can use to communicate with viewers. To specify a minimum version, choose a value for + * ``MinimumProtocolVersion``. For more information, see [Security + * Policy](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/distribution-web-values-specify.html#DownloadDistValues-security-policy) + * in the *Amazon CloudFront Developer Guide*. + The location of the SSL/TLS certificate, + * [(ACM)](https://docs.aws.amazon.com/acm/latest/userguide/acm-overview.html) (recommended) or + * [(IAM)](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_server-certs.html). You specify the + * location by setting a value in one of the following fields (not both): + ``ACMCertificateArn`` (In + * CloudFormation, this field name is ``AcmCertificateArn``. Note the different capitalization.) + + * ``IAMCertificateId`` (In CloudFormation, this field name is ``IamCertificateId``. Note the different + * capitalization.) All distributions support HTTPS connections from viewers. To require viewers to use HTTPS only, + * or to redirect them from HTTP to HTTPS, use ``ViewerProtocolPolicy`` in the ``CacheBehavior`` or + * ``DefaultCacheBehavior``. To specify how CloudFront should use SSL/TLS to communicate with your custom origin, + * use ``CustomOriginConfig``. For more information, see [Using HTTPS with + * CloudFront](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/using-https.html) and [Using + * Alternate Domain Names and + * HTTPS](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/using-https-alternate-domain-names.html) + * in the *Amazon CloudFront Developer Guide*. + * + * @return the viewerCertificate value. + */ + public ViewerCertificate viewerCertificate() { + return this.viewerCertificate; + } + + /** + * Set the viewerCertificate property: A complex type that determines the distribution's SSL/TLS configuration for + * communicating with viewers. A complex type that determines the distribution's SSL/TLS configuration for + * communicating with viewers. If the distribution doesn't use ``Aliases`` (also known as alternate domain names or + * CNAMEs)—that is, if the distribution uses the CloudFront domain name such as + * ``d111111abcdef8.cloudfront.net``—set ``CloudFrontDefaultCertificate`` to ``true`` and leave all other fields + * empty. If the distribution uses ``Aliases`` (alternate domain names or CNAMEs), use the fields in this type to + * specify the following settings: + Which viewers the distribution accepts HTTPS connections from: only viewers + * that support [server name indication + * (SNI)](https://docs.aws.amazon.com/https://en.wikipedia.org/wiki/Server_Name_Indication) (recommended), or all + * viewers including those that don't support SNI. + To accept HTTPS connections from only viewers that support SNI, + * set ``SSLSupportMethod`` to ``sni-only``. This is recommended. Most browsers and clients support SNI. (In + * CloudFormation, the field name is ``SslSupportMethod``. Note the different capitalization.) + To accept HTTPS + * connections from all viewers, including those that don't support SNI, set ``SSLSupportMethod`` to ``vip``. This + * is not recommended, and results in additional monthly charges from CloudFront. (In CloudFormation, the field name + * is ``SslSupportMethod``. Note the different capitalization.) + The minimum SSL/TLS protocol version that the + * distribution can use to communicate with viewers. To specify a minimum version, choose a value for + * ``MinimumProtocolVersion``. For more information, see [Security + * Policy](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/distribution-web-values-specify.html#DownloadDistValues-security-policy) + * in the *Amazon CloudFront Developer Guide*. + The location of the SSL/TLS certificate, + * [(ACM)](https://docs.aws.amazon.com/acm/latest/userguide/acm-overview.html) (recommended) or + * [(IAM)](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_server-certs.html). You specify the + * location by setting a value in one of the following fields (not both): + ``ACMCertificateArn`` (In + * CloudFormation, this field name is ``AcmCertificateArn``. Note the different capitalization.) + + * ``IAMCertificateId`` (In CloudFormation, this field name is ``IamCertificateId``. Note the different + * capitalization.) All distributions support HTTPS connections from viewers. To require viewers to use HTTPS only, + * or to redirect them from HTTP to HTTPS, use ``ViewerProtocolPolicy`` in the ``CacheBehavior`` or + * ``DefaultCacheBehavior``. To specify how CloudFront should use SSL/TLS to communicate with your custom origin, + * use ``CustomOriginConfig``. For more information, see [Using HTTPS with + * CloudFront](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/using-https.html) and [Using + * Alternate Domain Names and + * HTTPS](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/using-https-alternate-domain-names.html) + * in the *Amazon CloudFront Developer Guide*. + * + * @param viewerCertificate the viewerCertificate value to set. + * @return the DistributionConfig object itself. + */ + public DistributionConfig withViewerCertificate(ViewerCertificate viewerCertificate) { + this.viewerCertificate = viewerCertificate; + return this; + } + + /** + * Get the webAclId property: A unique identifier that specifies the WAF web ACL, if any, to associate with this + * distribution. To specify a web ACL created using the latest version of WAF, use the ACL ARN, for example + * ``arn:aws:wafv2:us-east-1:123456789012:global/webacl/ExampleWebACL/473e64fd-f30b-4765-81a0-62ad96dd167a``. To + * specify a web ACL created using WAF Classic, use the ACL ID, for example + * ``473e64fd-f30b-4765-81a0-62ad96dd167a``. WAF is a web application firewall that lets you monitor the HTTP and + * HTTPS requests that are forwarded to CloudFront, and lets you control access to your content. Based on conditions + * that you specify, such as the IP addresses that requests originate from or the values of query strings, + * CloudFront responds to requests either with the requested content or with an HTTP 403 status code (Forbidden). + * You can also configure CloudFront to return a custom error page when a request is blocked. For more information + * about WAF, see the [Developer Guide](https://docs.aws.amazon.com/waf/latest/developerguide/what-is-aws-waf.html). + * + * @return the webAclId value. + */ + public String webAclId() { + return this.webAclId; + } + + /** + * Set the webAclId property: A unique identifier that specifies the WAF web ACL, if any, to associate with this + * distribution. To specify a web ACL created using the latest version of WAF, use the ACL ARN, for example + * ``arn:aws:wafv2:us-east-1:123456789012:global/webacl/ExampleWebACL/473e64fd-f30b-4765-81a0-62ad96dd167a``. To + * specify a web ACL created using WAF Classic, use the ACL ID, for example + * ``473e64fd-f30b-4765-81a0-62ad96dd167a``. WAF is a web application firewall that lets you monitor the HTTP and + * HTTPS requests that are forwarded to CloudFront, and lets you control access to your content. Based on conditions + * that you specify, such as the IP addresses that requests originate from or the values of query strings, + * CloudFront responds to requests either with the requested content or with an HTTP 403 status code (Forbidden). + * You can also configure CloudFront to return a custom error page when a request is blocked. For more information + * about WAF, see the [Developer Guide](https://docs.aws.amazon.com/waf/latest/developerguide/what-is-aws-waf.html). + * + * @param webAclId the webAclId value to set. + * @return the DistributionConfig object itself. + */ + public DistributionConfig withWebAclId(String webAclId) { + this.webAclId = webAclId; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (cacheBehaviors() != null) { + cacheBehaviors().forEach(e -> e.validate()); + } + if (customErrorResponses() != null) { + customErrorResponses().forEach(e -> e.validate()); + } + if (customOrigin() != null) { + customOrigin().validate(); + } + if (defaultCacheBehavior() != null) { + defaultCacheBehavior().validate(); + } + if (logging() != null) { + logging().validate(); + } + if (originGroups() != null) { + originGroups().validate(); + } + if (origins() != null) { + origins().forEach(e -> e.validate()); + } + if (restrictions() != null) { + restrictions().validate(); + } + if (s3Origin() != null) { + s3Origin().validate(); + } + if (viewerCertificate() != null) { + viewerCertificate().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("aliases", this.aliases, (writer, element) -> writer.writeString(element)); + jsonWriter.writeArrayField("cnamEs", this.cnamEs, (writer, element) -> writer.writeString(element)); + jsonWriter.writeArrayField("cacheBehaviors", this.cacheBehaviors, + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("comment", this.comment); + jsonWriter.writeStringField("continuousDeploymentPolicyId", this.continuousDeploymentPolicyId); + jsonWriter.writeArrayField("customErrorResponses", this.customErrorResponses, + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeJsonField("customOrigin", this.customOrigin); + jsonWriter.writeJsonField("defaultCacheBehavior", this.defaultCacheBehavior); + jsonWriter.writeStringField("defaultRootObject", this.defaultRootObject); + jsonWriter.writeBooleanField("enabled", this.enabled); + jsonWriter.writeStringField("httpVersion", this.httpVersion); + jsonWriter.writeBooleanField("ipV6Enabled", this.ipV6Enabled); + jsonWriter.writeJsonField("logging", this.logging); + jsonWriter.writeJsonField("originGroups", this.originGroups); + jsonWriter.writeArrayField("origins", this.origins, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("priceClass", this.priceClass); + jsonWriter.writeJsonField("restrictions", this.restrictions); + jsonWriter.writeJsonField("s3Origin", this.s3Origin); + jsonWriter.writeBooleanField("staging", this.staging); + jsonWriter.writeJsonField("viewerCertificate", this.viewerCertificate); + jsonWriter.writeStringField("webACLId", this.webAclId); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of DistributionConfig from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of DistributionConfig if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the DistributionConfig. + */ + public static DistributionConfig fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + DistributionConfig deserializedDistributionConfig = new DistributionConfig(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("aliases".equals(fieldName)) { + List aliases = reader.readArray(reader1 -> reader1.getString()); + deserializedDistributionConfig.aliases = aliases; + } else if ("cnamEs".equals(fieldName)) { + List cnamEs = reader.readArray(reader1 -> reader1.getString()); + deserializedDistributionConfig.cnamEs = cnamEs; + } else if ("cacheBehaviors".equals(fieldName)) { + List cacheBehaviors = reader.readArray(reader1 -> CacheBehavior.fromJson(reader1)); + deserializedDistributionConfig.cacheBehaviors = cacheBehaviors; + } else if ("comment".equals(fieldName)) { + deserializedDistributionConfig.comment = reader.getString(); + } else if ("continuousDeploymentPolicyId".equals(fieldName)) { + deserializedDistributionConfig.continuousDeploymentPolicyId = reader.getString(); + } else if ("customErrorResponses".equals(fieldName)) { + List customErrorResponses + = reader.readArray(reader1 -> CustomErrorResponse.fromJson(reader1)); + deserializedDistributionConfig.customErrorResponses = customErrorResponses; + } else if ("customOrigin".equals(fieldName)) { + deserializedDistributionConfig.customOrigin = LegacyCustomOrigin.fromJson(reader); + } else if ("defaultCacheBehavior".equals(fieldName)) { + deserializedDistributionConfig.defaultCacheBehavior = DefaultCacheBehavior.fromJson(reader); + } else if ("defaultRootObject".equals(fieldName)) { + deserializedDistributionConfig.defaultRootObject = reader.getString(); + } else if ("enabled".equals(fieldName)) { + deserializedDistributionConfig.enabled = reader.getNullable(JsonReader::getBoolean); + } else if ("httpVersion".equals(fieldName)) { + deserializedDistributionConfig.httpVersion = reader.getString(); + } else if ("ipV6Enabled".equals(fieldName)) { + deserializedDistributionConfig.ipV6Enabled = reader.getNullable(JsonReader::getBoolean); + } else if ("logging".equals(fieldName)) { + deserializedDistributionConfig.logging = Logging.fromJson(reader); + } else if ("originGroups".equals(fieldName)) { + deserializedDistributionConfig.originGroups = OriginGroups.fromJson(reader); + } else if ("origins".equals(fieldName)) { + List origins + = reader.readArray(reader1 -> OriginAutoGenerated.fromJson(reader1)); + deserializedDistributionConfig.origins = origins; + } else if ("priceClass".equals(fieldName)) { + deserializedDistributionConfig.priceClass = reader.getString(); + } else if ("restrictions".equals(fieldName)) { + deserializedDistributionConfig.restrictions = Restrictions.fromJson(reader); + } else if ("s3Origin".equals(fieldName)) { + deserializedDistributionConfig.s3Origin = LegacyS3Origin.fromJson(reader); + } else if ("staging".equals(fieldName)) { + deserializedDistributionConfig.staging = reader.getNullable(JsonReader::getBoolean); + } else if ("viewerCertificate".equals(fieldName)) { + deserializedDistributionConfig.viewerCertificate = ViewerCertificate.fromJson(reader); + } else if ("webACLId".equals(fieldName)) { + deserializedDistributionConfig.webAclId = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedDistributionConfig; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/DockerVolumeConfiguration.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/DockerVolumeConfiguration.java new file mode 100644 index 000000000000..14b8a95dfd33 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/DockerVolumeConfiguration.java @@ -0,0 +1,267 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of DockerVolumeConfiguration. + */ +@Fluent +public final class DockerVolumeConfiguration implements JsonSerializable { + /* + * If this value is ``true``, the Docker volume is created if it doesn't already exist. This field is only used if + * the ``scope`` is ``shared``. + */ + private Boolean autoprovision; + + /* + * The Docker volume driver to use. The driver value must match the driver name provided by Docker because it is + * used for task placement. If the driver was installed using the Docker plugin CLI, use ``docker plugin ls`` to + * retrieve the driver name from your container instance. If the driver was installed using another method, use + * Docker plugin discovery to retrieve the driver name. For more information, see [Docker plugin + * discovery](https://docs.aws.amazon.com/https://docs.docker.com/engine/extend/plugin_api/#plugin-discovery). This + * parameter maps to ``Driver`` in the [Create a + * volume](https://docs.aws.amazon.com/https://docs.docker.com/engine/api/v1.35/#operation/VolumeCreate) section of + * the [Docker Remote API](https://docs.aws.amazon.com/https://docs.docker.com/engine/api/v1.35/) and the + * ``xxdriver`` option to [docker volume + * create](https://docs.aws.amazon.com/https://docs.docker.com/engine/reference/commandline/volume_create/). + */ + private String driver; + + /* + * A map of Docker driver-specific options passed through. This parameter maps to ``DriverOpts`` in the [Create a + * volume](https://docs.aws.amazon.com/https://docs.docker.com/engine/api/v1.35/#operation/VolumeCreate) section of + * the [Docker Remote API](https://docs.aws.amazon.com/https://docs.docker.com/engine/api/v1.35/) and the ``xxopt`` + * option to [docker volume + * create](https://docs.aws.amazon.com/https://docs.docker.com/engine/reference/commandline/volume_create/). + */ + private Object driverOpts; + + /* + * Custom metadata to add to your Docker volume. This parameter maps to ``Labels`` in the [Create a + * volume](https://docs.aws.amazon.com/https://docs.docker.com/engine/api/v1.35/#operation/VolumeCreate) section of + * the [Docker Remote API](https://docs.aws.amazon.com/https://docs.docker.com/engine/api/v1.35/) and the + * ``xxlabel`` option to [docker volume + * create](https://docs.aws.amazon.com/https://docs.docker.com/engine/reference/commandline/volume_create/). + */ + private Object labels; + + /* + * The scope for the Docker volume that determines its lifecycle. Docker volumes that are scoped to a ``task`` are + * automatically provisioned when the task starts and destroyed when the task stops. Docker volumes that are scoped + * as ``shared`` persist after the task stops. + */ + private String scope; + + /** + * Creates an instance of DockerVolumeConfiguration class. + */ + public DockerVolumeConfiguration() { + } + + /** + * Get the autoprovision property: If this value is ``true``, the Docker volume is created if it doesn't already + * exist. This field is only used if the ``scope`` is ``shared``. + * + * @return the autoprovision value. + */ + public Boolean autoprovision() { + return this.autoprovision; + } + + /** + * Set the autoprovision property: If this value is ``true``, the Docker volume is created if it doesn't already + * exist. This field is only used if the ``scope`` is ``shared``. + * + * @param autoprovision the autoprovision value to set. + * @return the DockerVolumeConfiguration object itself. + */ + public DockerVolumeConfiguration withAutoprovision(Boolean autoprovision) { + this.autoprovision = autoprovision; + return this; + } + + /** + * Get the driver property: The Docker volume driver to use. The driver value must match the driver name provided by + * Docker because it is used for task placement. If the driver was installed using the Docker plugin CLI, use + * ``docker plugin ls`` to retrieve the driver name from your container instance. If the driver was installed using + * another method, use Docker plugin discovery to retrieve the driver name. For more information, see [Docker plugin + * discovery](https://docs.aws.amazon.com/https://docs.docker.com/engine/extend/plugin_api/#plugin-discovery). This + * parameter maps to ``Driver`` in the [Create a + * volume](https://docs.aws.amazon.com/https://docs.docker.com/engine/api/v1.35/#operation/VolumeCreate) section of + * the [Docker Remote API](https://docs.aws.amazon.com/https://docs.docker.com/engine/api/v1.35/) and the + * ``xxdriver`` option to [docker volume + * create](https://docs.aws.amazon.com/https://docs.docker.com/engine/reference/commandline/volume_create/). + * + * @return the driver value. + */ + public String driver() { + return this.driver; + } + + /** + * Set the driver property: The Docker volume driver to use. The driver value must match the driver name provided by + * Docker because it is used for task placement. If the driver was installed using the Docker plugin CLI, use + * ``docker plugin ls`` to retrieve the driver name from your container instance. If the driver was installed using + * another method, use Docker plugin discovery to retrieve the driver name. For more information, see [Docker plugin + * discovery](https://docs.aws.amazon.com/https://docs.docker.com/engine/extend/plugin_api/#plugin-discovery). This + * parameter maps to ``Driver`` in the [Create a + * volume](https://docs.aws.amazon.com/https://docs.docker.com/engine/api/v1.35/#operation/VolumeCreate) section of + * the [Docker Remote API](https://docs.aws.amazon.com/https://docs.docker.com/engine/api/v1.35/) and the + * ``xxdriver`` option to [docker volume + * create](https://docs.aws.amazon.com/https://docs.docker.com/engine/reference/commandline/volume_create/). + * + * @param driver the driver value to set. + * @return the DockerVolumeConfiguration object itself. + */ + public DockerVolumeConfiguration withDriver(String driver) { + this.driver = driver; + return this; + } + + /** + * Get the driverOpts property: A map of Docker driver-specific options passed through. This parameter maps to + * ``DriverOpts`` in the [Create a + * volume](https://docs.aws.amazon.com/https://docs.docker.com/engine/api/v1.35/#operation/VolumeCreate) section of + * the [Docker Remote API](https://docs.aws.amazon.com/https://docs.docker.com/engine/api/v1.35/) and the ``xxopt`` + * option to [docker volume + * create](https://docs.aws.amazon.com/https://docs.docker.com/engine/reference/commandline/volume_create/). + * + * @return the driverOpts value. + */ + public Object driverOpts() { + return this.driverOpts; + } + + /** + * Set the driverOpts property: A map of Docker driver-specific options passed through. This parameter maps to + * ``DriverOpts`` in the [Create a + * volume](https://docs.aws.amazon.com/https://docs.docker.com/engine/api/v1.35/#operation/VolumeCreate) section of + * the [Docker Remote API](https://docs.aws.amazon.com/https://docs.docker.com/engine/api/v1.35/) and the ``xxopt`` + * option to [docker volume + * create](https://docs.aws.amazon.com/https://docs.docker.com/engine/reference/commandline/volume_create/). + * + * @param driverOpts the driverOpts value to set. + * @return the DockerVolumeConfiguration object itself. + */ + public DockerVolumeConfiguration withDriverOpts(Object driverOpts) { + this.driverOpts = driverOpts; + return this; + } + + /** + * Get the labels property: Custom metadata to add to your Docker volume. This parameter maps to ``Labels`` in the + * [Create a volume](https://docs.aws.amazon.com/https://docs.docker.com/engine/api/v1.35/#operation/VolumeCreate) + * section of the [Docker Remote API](https://docs.aws.amazon.com/https://docs.docker.com/engine/api/v1.35/) and the + * ``xxlabel`` option to [docker volume + * create](https://docs.aws.amazon.com/https://docs.docker.com/engine/reference/commandline/volume_create/). + * + * @return the labels value. + */ + public Object labels() { + return this.labels; + } + + /** + * Set the labels property: Custom metadata to add to your Docker volume. This parameter maps to ``Labels`` in the + * [Create a volume](https://docs.aws.amazon.com/https://docs.docker.com/engine/api/v1.35/#operation/VolumeCreate) + * section of the [Docker Remote API](https://docs.aws.amazon.com/https://docs.docker.com/engine/api/v1.35/) and the + * ``xxlabel`` option to [docker volume + * create](https://docs.aws.amazon.com/https://docs.docker.com/engine/reference/commandline/volume_create/). + * + * @param labels the labels value to set. + * @return the DockerVolumeConfiguration object itself. + */ + public DockerVolumeConfiguration withLabels(Object labels) { + this.labels = labels; + return this; + } + + /** + * Get the scope property: The scope for the Docker volume that determines its lifecycle. Docker volumes that are + * scoped to a ``task`` are automatically provisioned when the task starts and destroyed when the task stops. Docker + * volumes that are scoped as ``shared`` persist after the task stops. + * + * @return the scope value. + */ + public String scope() { + return this.scope; + } + + /** + * Set the scope property: The scope for the Docker volume that determines its lifecycle. Docker volumes that are + * scoped to a ``task`` are automatically provisioned when the task starts and destroyed when the task stops. Docker + * volumes that are scoped as ``shared`` persist after the task stops. + * + * @param scope the scope value to set. + * @return the DockerVolumeConfiguration object itself. + */ + public DockerVolumeConfiguration withScope(String scope) { + this.scope = scope; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeBooleanField("autoprovision", this.autoprovision); + jsonWriter.writeStringField("driver", this.driver); + jsonWriter.writeUntypedField("driverOpts", this.driverOpts); + jsonWriter.writeUntypedField("labels", this.labels); + jsonWriter.writeStringField("scope", this.scope); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of DockerVolumeConfiguration from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of DockerVolumeConfiguration if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IOException If an error occurs while reading the DockerVolumeConfiguration. + */ + public static DockerVolumeConfiguration fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + DockerVolumeConfiguration deserializedDockerVolumeConfiguration = new DockerVolumeConfiguration(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("autoprovision".equals(fieldName)) { + deserializedDockerVolumeConfiguration.autoprovision = reader.getNullable(JsonReader::getBoolean); + } else if ("driver".equals(fieldName)) { + deserializedDockerVolumeConfiguration.driver = reader.getString(); + } else if ("driverOpts".equals(fieldName)) { + deserializedDockerVolumeConfiguration.driverOpts = reader.readUntyped(); + } else if ("labels".equals(fieldName)) { + deserializedDockerVolumeConfiguration.labels = reader.readUntyped(); + } else if ("scope".equals(fieldName)) { + deserializedDockerVolumeConfiguration.scope = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedDockerVolumeConfiguration; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/DomainEndpointOptions.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/DomainEndpointOptions.java new file mode 100644 index 000000000000..47c6fe5904d5 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/DomainEndpointOptions.java @@ -0,0 +1,229 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of DomainEndpointOptions. + */ +@Fluent +public final class DomainEndpointOptions implements JsonSerializable { + /* + *

The fully qualified URL for the custom endpoint.

+ */ + private String customEndpoint; + + /* + *

The ARN for your security certificate, managed in Amazon Web Services Certificate Manager (ACM).

+ */ + private String customEndpointCertificateArn; + + /* + *

Whether to enable a custom endpoint for the domain.

+ */ + private Boolean customEndpointEnabled; + + /* + *

True to require that all traffic to the domain arrive over HTTPS.

+ */ + private Boolean enforceHttps; + + /* + *

Specify the TLS security policy to apply to the HTTPS endpoint of the domain. The policy can be one of the + * following values:

  • Policy-Min-TLS-1-0-2019-07: TLS security policy that supports TLS + * version 1.0 to TLS version 1.2

  • Policy-Min-TLS-1-2-2019-07: TLS security policy that + * supports only TLS version 1.2

  • Policy-Min-TLS-1-2-PFS-2023-10: TLS security policy that + * supports TLS version 1.2 to TLS version 1.3 with perfect forward secrecy cipher suites

+ */ + private TlsSecurityPolicyEnumValue tlsSecurityPolicy; + + /** + * Creates an instance of DomainEndpointOptions class. + */ + public DomainEndpointOptions() { + } + + /** + * Get the customEndpoint property: <p>The fully qualified URL for the custom endpoint.</p>. + * + * @return the customEndpoint value. + */ + public String customEndpoint() { + return this.customEndpoint; + } + + /** + * Set the customEndpoint property: <p>The fully qualified URL for the custom endpoint.</p>. + * + * @param customEndpoint the customEndpoint value to set. + * @return the DomainEndpointOptions object itself. + */ + public DomainEndpointOptions withCustomEndpoint(String customEndpoint) { + this.customEndpoint = customEndpoint; + return this; + } + + /** + * Get the customEndpointCertificateArn property: <p>The ARN for your security certificate, managed in Amazon + * Web Services Certificate Manager (ACM).</p>. + * + * @return the customEndpointCertificateArn value. + */ + public String customEndpointCertificateArn() { + return this.customEndpointCertificateArn; + } + + /** + * Set the customEndpointCertificateArn property: <p>The ARN for your security certificate, managed in Amazon + * Web Services Certificate Manager (ACM).</p>. + * + * @param customEndpointCertificateArn the customEndpointCertificateArn value to set. + * @return the DomainEndpointOptions object itself. + */ + public DomainEndpointOptions withCustomEndpointCertificateArn(String customEndpointCertificateArn) { + this.customEndpointCertificateArn = customEndpointCertificateArn; + return this; + } + + /** + * Get the customEndpointEnabled property: <p>Whether to enable a custom endpoint for the domain.</p>. + * + * @return the customEndpointEnabled value. + */ + public Boolean customEndpointEnabled() { + return this.customEndpointEnabled; + } + + /** + * Set the customEndpointEnabled property: <p>Whether to enable a custom endpoint for the domain.</p>. + * + * @param customEndpointEnabled the customEndpointEnabled value to set. + * @return the DomainEndpointOptions object itself. + */ + public DomainEndpointOptions withCustomEndpointEnabled(Boolean customEndpointEnabled) { + this.customEndpointEnabled = customEndpointEnabled; + return this; + } + + /** + * Get the enforceHttps property: <p>True to require that all traffic to the domain arrive over + * HTTPS.</p>. + * + * @return the enforceHttps value. + */ + public Boolean enforceHttps() { + return this.enforceHttps; + } + + /** + * Set the enforceHttps property: <p>True to require that all traffic to the domain arrive over + * HTTPS.</p>. + * + * @param enforceHttps the enforceHttps value to set. + * @return the DomainEndpointOptions object itself. + */ + public DomainEndpointOptions withEnforceHttps(Boolean enforceHttps) { + this.enforceHttps = enforceHttps; + return this; + } + + /** + * Get the tlsSecurityPolicy property: <p>Specify the TLS security policy to apply to the HTTPS endpoint of + * the domain. The policy can be one of the following values:</p> <ul> <li> <p> + * <b>Policy-Min-TLS-1-0-2019-07:</b> TLS security policy that supports TLS version 1.0 to TLS version + * 1.2</p> </li> <li> <p> <b>Policy-Min-TLS-1-2-2019-07:</b> TLS security policy + * that supports only TLS version 1.2</p> </li> <li> <p> + * <b>Policy-Min-TLS-1-2-PFS-2023-10:</b> TLS security policy that supports TLS version 1.2 to TLS + * version 1.3 with perfect forward secrecy cipher suites</p> </li> </ul>. + * + * @return the tlsSecurityPolicy value. + */ + public TlsSecurityPolicyEnumValue tlsSecurityPolicy() { + return this.tlsSecurityPolicy; + } + + /** + * Set the tlsSecurityPolicy property: <p>Specify the TLS security policy to apply to the HTTPS endpoint of + * the domain. The policy can be one of the following values:</p> <ul> <li> <p> + * <b>Policy-Min-TLS-1-0-2019-07:</b> TLS security policy that supports TLS version 1.0 to TLS version + * 1.2</p> </li> <li> <p> <b>Policy-Min-TLS-1-2-2019-07:</b> TLS security policy + * that supports only TLS version 1.2</p> </li> <li> <p> + * <b>Policy-Min-TLS-1-2-PFS-2023-10:</b> TLS security policy that supports TLS version 1.2 to TLS + * version 1.3 with perfect forward secrecy cipher suites</p> </li> </ul>. + * + * @param tlsSecurityPolicy the tlsSecurityPolicy value to set. + * @return the DomainEndpointOptions object itself. + */ + public DomainEndpointOptions withTlsSecurityPolicy(TlsSecurityPolicyEnumValue tlsSecurityPolicy) { + this.tlsSecurityPolicy = tlsSecurityPolicy; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (tlsSecurityPolicy() != null) { + tlsSecurityPolicy().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("customEndpoint", this.customEndpoint); + jsonWriter.writeStringField("customEndpointCertificateArn", this.customEndpointCertificateArn); + jsonWriter.writeBooleanField("customEndpointEnabled", this.customEndpointEnabled); + jsonWriter.writeBooleanField("enforceHTTPS", this.enforceHttps); + jsonWriter.writeJsonField("tlsSecurityPolicy", this.tlsSecurityPolicy); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of DomainEndpointOptions from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of DomainEndpointOptions if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the DomainEndpointOptions. + */ + public static DomainEndpointOptions fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + DomainEndpointOptions deserializedDomainEndpointOptions = new DomainEndpointOptions(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("customEndpoint".equals(fieldName)) { + deserializedDomainEndpointOptions.customEndpoint = reader.getString(); + } else if ("customEndpointCertificateArn".equals(fieldName)) { + deserializedDomainEndpointOptions.customEndpointCertificateArn = reader.getString(); + } else if ("customEndpointEnabled".equals(fieldName)) { + deserializedDomainEndpointOptions.customEndpointEnabled + = reader.getNullable(JsonReader::getBoolean); + } else if ("enforceHTTPS".equals(fieldName)) { + deserializedDomainEndpointOptions.enforceHttps = reader.getNullable(JsonReader::getBoolean); + } else if ("tlsSecurityPolicy".equals(fieldName)) { + deserializedDomainEndpointOptions.tlsSecurityPolicy = TlsSecurityPolicyEnumValue.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedDomainEndpointOptions; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/DomainProcessingStatusType.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/DomainProcessingStatusType.java new file mode 100644 index 000000000000..ee0d2f590c6b --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/DomainProcessingStatusType.java @@ -0,0 +1,76 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * DomainProcessingStatusType enum. + */ +public final class DomainProcessingStatusType extends ExpandableStringEnum { + /** + * Static value Active for DomainProcessingStatusType. + */ + public static final DomainProcessingStatusType ACTIVE = fromString("Active"); + + /** + * Static value Creating for DomainProcessingStatusType. + */ + public static final DomainProcessingStatusType CREATING = fromString("Creating"); + + /** + * Static value Deleting for DomainProcessingStatusType. + */ + public static final DomainProcessingStatusType DELETING = fromString("Deleting"); + + /** + * Static value Isolated for DomainProcessingStatusType. + */ + public static final DomainProcessingStatusType ISOLATED = fromString("Isolated"); + + /** + * Static value Modifying for DomainProcessingStatusType. + */ + public static final DomainProcessingStatusType MODIFYING = fromString("Modifying"); + + /** + * Static value UpdatingServiceSoftware for DomainProcessingStatusType. + */ + public static final DomainProcessingStatusType UPDATING_SERVICE_SOFTWARE = fromString("UpdatingServiceSoftware"); + + /** + * Static value UpgradingEngineVersion for DomainProcessingStatusType. + */ + public static final DomainProcessingStatusType UPGRADING_ENGINE_VERSION = fromString("UpgradingEngineVersion"); + + /** + * Creates a new instance of DomainProcessingStatusType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public DomainProcessingStatusType() { + } + + /** + * Creates or finds a DomainProcessingStatusType from its string representation. + * + * @param name a name to look for. + * @return the corresponding DomainProcessingStatusType. + */ + public static DomainProcessingStatusType fromString(String name) { + return fromString(name, DomainProcessingStatusType.class); + } + + /** + * Gets known DomainProcessingStatusType values. + * + * @return known DomainProcessingStatusType values. + */ + public static Collection values() { + return values(DomainProcessingStatusType.class); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/DomainProcessingStatusTypeEnumValue.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/DomainProcessingStatusTypeEnumValue.java new file mode 100644 index 000000000000..a29f0827f8b0 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/DomainProcessingStatusTypeEnumValue.java @@ -0,0 +1,96 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of DomainProcessingStatusTypeEnumValue. + */ +@Fluent +public final class DomainProcessingStatusTypeEnumValue + implements JsonSerializable { + /* + * Property value + */ + private DomainProcessingStatusType value; + + /** + * Creates an instance of DomainProcessingStatusTypeEnumValue class. + */ + public DomainProcessingStatusTypeEnumValue() { + } + + /** + * Get the value property: Property value. + * + * @return the value value. + */ + public DomainProcessingStatusType value() { + return this.value; + } + + /** + * Set the value property: Property value. + * + * @param value the value value to set. + * @return the DomainProcessingStatusTypeEnumValue object itself. + */ + public DomainProcessingStatusTypeEnumValue withValue(DomainProcessingStatusType value) { + this.value = value; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("value", this.value == null ? null : this.value.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of DomainProcessingStatusTypeEnumValue from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of DomainProcessingStatusTypeEnumValue if the JsonReader was pointing to an instance of it, + * or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the DomainProcessingStatusTypeEnumValue. + */ + public static DomainProcessingStatusTypeEnumValue fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + DomainProcessingStatusTypeEnumValue deserializedDomainProcessingStatusTypeEnumValue + = new DomainProcessingStatusTypeEnumValue(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + deserializedDomainProcessingStatusTypeEnumValue.value + = DomainProcessingStatusType.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedDomainProcessingStatusTypeEnumValue; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/DomainType.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/DomainType.java new file mode 100644 index 000000000000..351b1a8b9cde --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/DomainType.java @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * DomainType enum. + */ +public final class DomainType extends ExpandableStringEnum { + /** + * Static value standard for DomainType. + */ + public static final DomainType STANDARD = fromString("standard"); + + /** + * Static value vpc for DomainType. + */ + public static final DomainType VPC = fromString("vpc"); + + /** + * Creates a new instance of DomainType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public DomainType() { + } + + /** + * Creates or finds a DomainType from its string representation. + * + * @param name a name to look for. + * @return the corresponding DomainType. + */ + public static DomainType fromString(String name) { + return fromString(name, DomainType.class); + } + + /** + * Gets known DomainType values. + * + * @return known DomainType values. + */ + public static Collection values() { + return values(DomainType.class); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/DomainTypeEnumValue.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/DomainTypeEnumValue.java new file mode 100644 index 000000000000..825180ae813a --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/DomainTypeEnumValue.java @@ -0,0 +1,93 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of DomainTypeEnumValue. + */ +@Fluent +public final class DomainTypeEnumValue implements JsonSerializable { + /* + * Property value + */ + private DomainType value; + + /** + * Creates an instance of DomainTypeEnumValue class. + */ + public DomainTypeEnumValue() { + } + + /** + * Get the value property: Property value. + * + * @return the value value. + */ + public DomainType value() { + return this.value; + } + + /** + * Set the value property: Property value. + * + * @param value the value value to set. + * @return the DomainTypeEnumValue object itself. + */ + public DomainTypeEnumValue withValue(DomainType value) { + this.value = value; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("value", this.value == null ? null : this.value.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of DomainTypeEnumValue from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of DomainTypeEnumValue if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the DomainTypeEnumValue. + */ + public static DomainTypeEnumValue fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + DomainTypeEnumValue deserializedDomainTypeEnumValue = new DomainTypeEnumValue(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + deserializedDomainTypeEnumValue.value = DomainType.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedDomainTypeEnumValue; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/DynamoDBContinuousBackupsDescription.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/DynamoDBContinuousBackupsDescription.java new file mode 100644 index 000000000000..08ac2bed8192 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/DynamoDBContinuousBackupsDescription.java @@ -0,0 +1,253 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.awsconnector.fluent.models.DynamoDBContinuousBackupsDescriptionInner; +import java.util.Map; + +/** + * An immutable client-side representation of DynamoDBContinuousBackupsDescription. + */ +public interface DynamoDBContinuousBackupsDescription { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the location property: The geo-location where the resource lives. + * + * @return the location value. + */ + String location(); + + /** + * Gets the tags property: Resource tags. + * + * @return the tags value. + */ + Map tags(); + + /** + * Gets the properties property: The resource-specific properties for this resource. + * + * @return the properties value. + */ + DynamoDBContinuousBackupsDescriptionProperties properties(); + + /** + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the region of the resource. + * + * @return the region of the resource. + */ + Region region(); + + /** + * Gets the name of the resource region. + * + * @return the name of the resource region. + */ + String regionName(); + + /** + * Gets the name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + + /** + * Gets the inner com.azure.resourcemanager.awsconnector.fluent.models.DynamoDBContinuousBackupsDescriptionInner + * object. + * + * @return the inner object. + */ + DynamoDBContinuousBackupsDescriptionInner innerModel(); + + /** + * The entirety of the DynamoDBContinuousBackupsDescription definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithLocation, + DefinitionStages.WithResourceGroup, DefinitionStages.WithCreate { + } + + /** + * The DynamoDBContinuousBackupsDescription definition stages. + */ + interface DefinitionStages { + /** + * The first stage of the DynamoDBContinuousBackupsDescription definition. + */ + interface Blank extends WithLocation { + } + + /** + * The stage of the DynamoDBContinuousBackupsDescription definition allowing to specify location. + */ + interface WithLocation { + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithResourceGroup withRegion(Region location); + + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithResourceGroup withRegion(String location); + } + + /** + * The stage of the DynamoDBContinuousBackupsDescription definition allowing to specify parent resource. + */ + interface WithResourceGroup { + /** + * Specifies resourceGroupName. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @return the next definition stage. + */ + WithCreate withExistingResourceGroup(String resourceGroupName); + } + + /** + * The stage of the DynamoDBContinuousBackupsDescription 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.WithProperties { + /** + * Executes the create request. + * + * @return the created resource. + */ + DynamoDBContinuousBackupsDescription create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + DynamoDBContinuousBackupsDescription create(Context context); + } + + /** + * The stage of the DynamoDBContinuousBackupsDescription definition allowing to specify tags. + */ + interface WithTags { + /** + * Specifies the tags property: Resource tags.. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + WithCreate withTags(Map tags); + } + + /** + * The stage of the DynamoDBContinuousBackupsDescription definition allowing to specify properties. + */ + interface WithProperties { + /** + * Specifies the properties property: The resource-specific properties for this resource.. + * + * @param properties The resource-specific properties for this resource. + * @return the next definition stage. + */ + WithCreate withProperties(DynamoDBContinuousBackupsDescriptionProperties properties); + } + } + + /** + * Begins update for the DynamoDBContinuousBackupsDescription resource. + * + * @return the stage of resource update. + */ + DynamoDBContinuousBackupsDescription.Update update(); + + /** + * The template for DynamoDBContinuousBackupsDescription update. + */ + interface Update extends UpdateStages.WithTags { + /** + * Executes the update request. + * + * @return the updated resource. + */ + DynamoDBContinuousBackupsDescription apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + DynamoDBContinuousBackupsDescription apply(Context context); + } + + /** + * The DynamoDBContinuousBackupsDescription update stages. + */ + interface UpdateStages { + /** + * The stage of the DynamoDBContinuousBackupsDescription update allowing to specify tags. + */ + interface WithTags { + /** + * Specifies the tags property: Resource tags.. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + Update withTags(Map tags); + } + } + + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + DynamoDBContinuousBackupsDescription refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + DynamoDBContinuousBackupsDescription refresh(Context context); +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/DynamoDBContinuousBackupsDescriptionListResult.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/DynamoDBContinuousBackupsDescriptionListResult.java new file mode 100644 index 000000000000..96ce1de067cb --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/DynamoDBContinuousBackupsDescriptionListResult.java @@ -0,0 +1,139 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.awsconnector.fluent.models.DynamoDBContinuousBackupsDescriptionInner; +import java.io.IOException; +import java.util.List; + +/** + * The response of a DynamoDBContinuousBackupsDescription list operation. + */ +@Fluent +public final class DynamoDBContinuousBackupsDescriptionListResult + implements JsonSerializable { + /* + * The DynamoDBContinuousBackupsDescription items on this page + */ + private List value; + + /* + * The link to the next page of items + */ + private String nextLink; + + /** + * Creates an instance of DynamoDBContinuousBackupsDescriptionListResult class. + */ + public DynamoDBContinuousBackupsDescriptionListResult() { + } + + /** + * Get the value property: The DynamoDBContinuousBackupsDescription items on this page. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The DynamoDBContinuousBackupsDescription items on this page. + * + * @param value the value value to set. + * @return the DynamoDBContinuousBackupsDescriptionListResult object itself. + */ + public DynamoDBContinuousBackupsDescriptionListResult + withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The link to the next page of items. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: The link to the next page of items. + * + * @param nextLink the nextLink value to set. + * @return the DynamoDBContinuousBackupsDescriptionListResult object itself. + */ + public DynamoDBContinuousBackupsDescriptionListResult withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property value in model DynamoDBContinuousBackupsDescriptionListResult")); + } else { + value().forEach(e -> e.validate()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(DynamoDBContinuousBackupsDescriptionListResult.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("nextLink", this.nextLink); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of DynamoDBContinuousBackupsDescriptionListResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of DynamoDBContinuousBackupsDescriptionListResult if the JsonReader was pointing to an + * instance of it, or null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the DynamoDBContinuousBackupsDescriptionListResult. + */ + public static DynamoDBContinuousBackupsDescriptionListResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + DynamoDBContinuousBackupsDescriptionListResult deserializedDynamoDBContinuousBackupsDescriptionListResult + = new DynamoDBContinuousBackupsDescriptionListResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> DynamoDBContinuousBackupsDescriptionInner.fromJson(reader1)); + deserializedDynamoDBContinuousBackupsDescriptionListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedDynamoDBContinuousBackupsDescriptionListResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedDynamoDBContinuousBackupsDescriptionListResult; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/DynamoDBContinuousBackupsDescriptionProperties.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/DynamoDBContinuousBackupsDescriptionProperties.java new file mode 100644 index 000000000000..8134a762b9ec --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/DynamoDBContinuousBackupsDescriptionProperties.java @@ -0,0 +1,318 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.Map; + +/** + * Definition of DynamoDBContinuousBackupsDescription. + */ +@Fluent +public final class DynamoDBContinuousBackupsDescriptionProperties + implements JsonSerializable { + /* + * AWS Properties + */ + private AwsDynamoDBContinuousBackupsDescriptionProperties awsProperties; + + /* + * Public Cloud Connectors Resource ID + */ + private String publicCloudConnectorsResourceId; + + /* + * AWS Account ID + */ + private String awsAccountId; + + /* + * Amazon Resource Name (ARN) + */ + private String arn; + + /* + * Public Cloud Resource Name + */ + private String publicCloudResourceName; + + /* + * AWS Source Schema + */ + private String awsSourceSchema; + + /* + * AWS Region + */ + private String awsRegion; + + /* + * AWS Tags + */ + private Map awsTags; + + /* + * The status of the last operation. + */ + private ProvisioningState provisioningState; + + /** + * Creates an instance of DynamoDBContinuousBackupsDescriptionProperties class. + */ + public DynamoDBContinuousBackupsDescriptionProperties() { + } + + /** + * Get the awsProperties property: AWS Properties. + * + * @return the awsProperties value. + */ + public AwsDynamoDBContinuousBackupsDescriptionProperties awsProperties() { + return this.awsProperties; + } + + /** + * Set the awsProperties property: AWS Properties. + * + * @param awsProperties the awsProperties value to set. + * @return the DynamoDBContinuousBackupsDescriptionProperties object itself. + */ + public DynamoDBContinuousBackupsDescriptionProperties + withAwsProperties(AwsDynamoDBContinuousBackupsDescriptionProperties awsProperties) { + this.awsProperties = awsProperties; + return this; + } + + /** + * Get the publicCloudConnectorsResourceId property: Public Cloud Connectors Resource ID. + * + * @return the publicCloudConnectorsResourceId value. + */ + public String publicCloudConnectorsResourceId() { + return this.publicCloudConnectorsResourceId; + } + + /** + * Set the publicCloudConnectorsResourceId property: Public Cloud Connectors Resource ID. + * + * @param publicCloudConnectorsResourceId the publicCloudConnectorsResourceId value to set. + * @return the DynamoDBContinuousBackupsDescriptionProperties object itself. + */ + public DynamoDBContinuousBackupsDescriptionProperties + withPublicCloudConnectorsResourceId(String publicCloudConnectorsResourceId) { + this.publicCloudConnectorsResourceId = publicCloudConnectorsResourceId; + return this; + } + + /** + * Get the awsAccountId property: AWS Account ID. + * + * @return the awsAccountId value. + */ + public String awsAccountId() { + return this.awsAccountId; + } + + /** + * Set the awsAccountId property: AWS Account ID. + * + * @param awsAccountId the awsAccountId value to set. + * @return the DynamoDBContinuousBackupsDescriptionProperties object itself. + */ + public DynamoDBContinuousBackupsDescriptionProperties withAwsAccountId(String awsAccountId) { + this.awsAccountId = awsAccountId; + return this; + } + + /** + * Get the arn property: Amazon Resource Name (ARN). + * + * @return the arn value. + */ + public String arn() { + return this.arn; + } + + /** + * Set the arn property: Amazon Resource Name (ARN). + * + * @param arn the arn value to set. + * @return the DynamoDBContinuousBackupsDescriptionProperties object itself. + */ + public DynamoDBContinuousBackupsDescriptionProperties withArn(String arn) { + this.arn = arn; + return this; + } + + /** + * Get the publicCloudResourceName property: Public Cloud Resource Name. + * + * @return the publicCloudResourceName value. + */ + public String publicCloudResourceName() { + return this.publicCloudResourceName; + } + + /** + * Set the publicCloudResourceName property: Public Cloud Resource Name. + * + * @param publicCloudResourceName the publicCloudResourceName value to set. + * @return the DynamoDBContinuousBackupsDescriptionProperties object itself. + */ + public DynamoDBContinuousBackupsDescriptionProperties withPublicCloudResourceName(String publicCloudResourceName) { + this.publicCloudResourceName = publicCloudResourceName; + return this; + } + + /** + * Get the awsSourceSchema property: AWS Source Schema. + * + * @return the awsSourceSchema value. + */ + public String awsSourceSchema() { + return this.awsSourceSchema; + } + + /** + * Set the awsSourceSchema property: AWS Source Schema. + * + * @param awsSourceSchema the awsSourceSchema value to set. + * @return the DynamoDBContinuousBackupsDescriptionProperties object itself. + */ + public DynamoDBContinuousBackupsDescriptionProperties withAwsSourceSchema(String awsSourceSchema) { + this.awsSourceSchema = awsSourceSchema; + return this; + } + + /** + * Get the awsRegion property: AWS Region. + * + * @return the awsRegion value. + */ + public String awsRegion() { + return this.awsRegion; + } + + /** + * Set the awsRegion property: AWS Region. + * + * @param awsRegion the awsRegion value to set. + * @return the DynamoDBContinuousBackupsDescriptionProperties object itself. + */ + public DynamoDBContinuousBackupsDescriptionProperties withAwsRegion(String awsRegion) { + this.awsRegion = awsRegion; + return this; + } + + /** + * Get the awsTags property: AWS Tags. + * + * @return the awsTags value. + */ + public Map awsTags() { + return this.awsTags; + } + + /** + * Set the awsTags property: AWS Tags. + * + * @param awsTags the awsTags value to set. + * @return the DynamoDBContinuousBackupsDescriptionProperties object itself. + */ + public DynamoDBContinuousBackupsDescriptionProperties withAwsTags(Map awsTags) { + this.awsTags = awsTags; + return this; + } + + /** + * Get the provisioningState property: The status of the last operation. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (awsProperties() != null) { + awsProperties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("awsProperties", this.awsProperties); + jsonWriter.writeStringField("publicCloudConnectorsResourceId", this.publicCloudConnectorsResourceId); + jsonWriter.writeStringField("awsAccountId", this.awsAccountId); + jsonWriter.writeStringField("arn", this.arn); + jsonWriter.writeStringField("publicCloudResourceName", this.publicCloudResourceName); + jsonWriter.writeStringField("awsSourceSchema", this.awsSourceSchema); + jsonWriter.writeStringField("awsRegion", this.awsRegion); + jsonWriter.writeMapField("awsTags", this.awsTags, (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of DynamoDBContinuousBackupsDescriptionProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of DynamoDBContinuousBackupsDescriptionProperties if the JsonReader was pointing to an + * instance of it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the DynamoDBContinuousBackupsDescriptionProperties. + */ + public static DynamoDBContinuousBackupsDescriptionProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + DynamoDBContinuousBackupsDescriptionProperties deserializedDynamoDBContinuousBackupsDescriptionProperties + = new DynamoDBContinuousBackupsDescriptionProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("awsProperties".equals(fieldName)) { + deserializedDynamoDBContinuousBackupsDescriptionProperties.awsProperties + = AwsDynamoDBContinuousBackupsDescriptionProperties.fromJson(reader); + } else if ("publicCloudConnectorsResourceId".equals(fieldName)) { + deserializedDynamoDBContinuousBackupsDescriptionProperties.publicCloudConnectorsResourceId + = reader.getString(); + } else if ("awsAccountId".equals(fieldName)) { + deserializedDynamoDBContinuousBackupsDescriptionProperties.awsAccountId = reader.getString(); + } else if ("arn".equals(fieldName)) { + deserializedDynamoDBContinuousBackupsDescriptionProperties.arn = reader.getString(); + } else if ("publicCloudResourceName".equals(fieldName)) { + deserializedDynamoDBContinuousBackupsDescriptionProperties.publicCloudResourceName + = reader.getString(); + } else if ("awsSourceSchema".equals(fieldName)) { + deserializedDynamoDBContinuousBackupsDescriptionProperties.awsSourceSchema = reader.getString(); + } else if ("awsRegion".equals(fieldName)) { + deserializedDynamoDBContinuousBackupsDescriptionProperties.awsRegion = reader.getString(); + } else if ("awsTags".equals(fieldName)) { + Map awsTags = reader.readMap(reader1 -> reader1.getString()); + deserializedDynamoDBContinuousBackupsDescriptionProperties.awsTags = awsTags; + } else if ("provisioningState".equals(fieldName)) { + deserializedDynamoDBContinuousBackupsDescriptionProperties.provisioningState + = ProvisioningState.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedDynamoDBContinuousBackupsDescriptionProperties; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/DynamoDBContinuousBackupsDescriptionTagsUpdate.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/DynamoDBContinuousBackupsDescriptionTagsUpdate.java new file mode 100644 index 000000000000..2396476baf5e --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/DynamoDBContinuousBackupsDescriptionTagsUpdate.java @@ -0,0 +1,97 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.Map; + +/** + * The type used for updating tags in DynamoDBContinuousBackupsDescription resources. + */ +@Fluent +public final class DynamoDBContinuousBackupsDescriptionTagsUpdate + implements JsonSerializable { + /* + * Resource tags. + */ + private Map tags; + + /** + * Creates an instance of DynamoDBContinuousBackupsDescriptionTagsUpdate class. + */ + public DynamoDBContinuousBackupsDescriptionTagsUpdate() { + } + + /** + * Get the tags property: Resource tags. + * + * @return the tags value. + */ + public Map tags() { + return this.tags; + } + + /** + * Set the tags property: Resource tags. + * + * @param tags the tags value to set. + * @return the DynamoDBContinuousBackupsDescriptionTagsUpdate object itself. + */ + public DynamoDBContinuousBackupsDescriptionTagsUpdate withTags(Map tags) { + this.tags = tags; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeMapField("tags", this.tags, (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of DynamoDBContinuousBackupsDescriptionTagsUpdate from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of DynamoDBContinuousBackupsDescriptionTagsUpdate if the JsonReader was pointing to an + * instance of it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the DynamoDBContinuousBackupsDescriptionTagsUpdate. + */ + public static DynamoDBContinuousBackupsDescriptionTagsUpdate fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + DynamoDBContinuousBackupsDescriptionTagsUpdate deserializedDynamoDBContinuousBackupsDescriptionTagsUpdate + = new DynamoDBContinuousBackupsDescriptionTagsUpdate(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedDynamoDBContinuousBackupsDescriptionTagsUpdate.tags = tags; + } else { + reader.skipChildren(); + } + } + + return deserializedDynamoDBContinuousBackupsDescriptionTagsUpdate; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/DynamoDBTable.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/DynamoDBTable.java new file mode 100644 index 000000000000..24ff80e050aa --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/DynamoDBTable.java @@ -0,0 +1,252 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.awsconnector.fluent.models.DynamoDBTableInner; +import java.util.Map; + +/** + * An immutable client-side representation of DynamoDBTable. + */ +public interface DynamoDBTable { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the location property: The geo-location where the resource lives. + * + * @return the location value. + */ + String location(); + + /** + * Gets the tags property: Resource tags. + * + * @return the tags value. + */ + Map tags(); + + /** + * Gets the properties property: The resource-specific properties for this resource. + * + * @return the properties value. + */ + DynamoDBTableProperties properties(); + + /** + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the region of the resource. + * + * @return the region of the resource. + */ + Region region(); + + /** + * Gets the name of the resource region. + * + * @return the name of the resource region. + */ + String regionName(); + + /** + * Gets the name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + + /** + * Gets the inner com.azure.resourcemanager.awsconnector.fluent.models.DynamoDBTableInner object. + * + * @return the inner object. + */ + DynamoDBTableInner innerModel(); + + /** + * The entirety of the DynamoDBTable definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithLocation, + DefinitionStages.WithResourceGroup, DefinitionStages.WithCreate { + } + + /** + * The DynamoDBTable definition stages. + */ + interface DefinitionStages { + /** + * The first stage of the DynamoDBTable definition. + */ + interface Blank extends WithLocation { + } + + /** + * The stage of the DynamoDBTable definition allowing to specify location. + */ + interface WithLocation { + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithResourceGroup withRegion(Region location); + + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithResourceGroup withRegion(String location); + } + + /** + * The stage of the DynamoDBTable definition allowing to specify parent resource. + */ + interface WithResourceGroup { + /** + * Specifies resourceGroupName. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @return the next definition stage. + */ + WithCreate withExistingResourceGroup(String resourceGroupName); + } + + /** + * The stage of the DynamoDBTable 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.WithProperties { + /** + * Executes the create request. + * + * @return the created resource. + */ + DynamoDBTable create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + DynamoDBTable create(Context context); + } + + /** + * The stage of the DynamoDBTable definition allowing to specify tags. + */ + interface WithTags { + /** + * Specifies the tags property: Resource tags.. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + WithCreate withTags(Map tags); + } + + /** + * The stage of the DynamoDBTable definition allowing to specify properties. + */ + interface WithProperties { + /** + * Specifies the properties property: The resource-specific properties for this resource.. + * + * @param properties The resource-specific properties for this resource. + * @return the next definition stage. + */ + WithCreate withProperties(DynamoDBTableProperties properties); + } + } + + /** + * Begins update for the DynamoDBTable resource. + * + * @return the stage of resource update. + */ + DynamoDBTable.Update update(); + + /** + * The template for DynamoDBTable update. + */ + interface Update extends UpdateStages.WithTags { + /** + * Executes the update request. + * + * @return the updated resource. + */ + DynamoDBTable apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + DynamoDBTable apply(Context context); + } + + /** + * The DynamoDBTable update stages. + */ + interface UpdateStages { + /** + * The stage of the DynamoDBTable update allowing to specify tags. + */ + interface WithTags { + /** + * Specifies the tags property: Resource tags.. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + Update withTags(Map tags); + } + } + + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + DynamoDBTable refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + DynamoDBTable refresh(Context context); +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/DynamoDBTableListResult.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/DynamoDBTableListResult.java new file mode 100644 index 000000000000..fa2dd67eb9c6 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/DynamoDBTableListResult.java @@ -0,0 +1,134 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.awsconnector.fluent.models.DynamoDBTableInner; +import java.io.IOException; +import java.util.List; + +/** + * The response of a DynamoDBTable list operation. + */ +@Fluent +public final class DynamoDBTableListResult implements JsonSerializable { + /* + * The DynamoDBTable items on this page + */ + private List value; + + /* + * The link to the next page of items + */ + private String nextLink; + + /** + * Creates an instance of DynamoDBTableListResult class. + */ + public DynamoDBTableListResult() { + } + + /** + * Get the value property: The DynamoDBTable items on this page. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The DynamoDBTable items on this page. + * + * @param value the value value to set. + * @return the DynamoDBTableListResult object itself. + */ + public DynamoDBTableListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The link to the next page of items. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: The link to the next page of items. + * + * @param nextLink the nextLink value to set. + * @return the DynamoDBTableListResult object itself. + */ + public DynamoDBTableListResult withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property value in model DynamoDBTableListResult")); + } else { + value().forEach(e -> e.validate()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(DynamoDBTableListResult.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("nextLink", this.nextLink); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of DynamoDBTableListResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of DynamoDBTableListResult if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the DynamoDBTableListResult. + */ + public static DynamoDBTableListResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + DynamoDBTableListResult deserializedDynamoDBTableListResult = new DynamoDBTableListResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value = reader.readArray(reader1 -> DynamoDBTableInner.fromJson(reader1)); + deserializedDynamoDBTableListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedDynamoDBTableListResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedDynamoDBTableListResult; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/DynamoDBTableProperties.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/DynamoDBTableProperties.java new file mode 100644 index 000000000000..e59348dabc32 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/DynamoDBTableProperties.java @@ -0,0 +1,311 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.Map; + +/** + * Definition of DynamoDBTable. + */ +@Fluent +public final class DynamoDBTableProperties implements JsonSerializable { + /* + * AWS Properties + */ + private AwsDynamoDBTableProperties awsProperties; + + /* + * Public Cloud Connectors Resource ID + */ + private String publicCloudConnectorsResourceId; + + /* + * AWS Account ID + */ + private String awsAccountId; + + /* + * Amazon Resource Name (ARN) + */ + private String arn; + + /* + * Public Cloud Resource Name + */ + private String publicCloudResourceName; + + /* + * AWS Source Schema + */ + private String awsSourceSchema; + + /* + * AWS Region + */ + private String awsRegion; + + /* + * AWS Tags + */ + private Map awsTags; + + /* + * The status of the last operation. + */ + private ProvisioningState provisioningState; + + /** + * Creates an instance of DynamoDBTableProperties class. + */ + public DynamoDBTableProperties() { + } + + /** + * Get the awsProperties property: AWS Properties. + * + * @return the awsProperties value. + */ + public AwsDynamoDBTableProperties awsProperties() { + return this.awsProperties; + } + + /** + * Set the awsProperties property: AWS Properties. + * + * @param awsProperties the awsProperties value to set. + * @return the DynamoDBTableProperties object itself. + */ + public DynamoDBTableProperties withAwsProperties(AwsDynamoDBTableProperties awsProperties) { + this.awsProperties = awsProperties; + return this; + } + + /** + * Get the publicCloudConnectorsResourceId property: Public Cloud Connectors Resource ID. + * + * @return the publicCloudConnectorsResourceId value. + */ + public String publicCloudConnectorsResourceId() { + return this.publicCloudConnectorsResourceId; + } + + /** + * Set the publicCloudConnectorsResourceId property: Public Cloud Connectors Resource ID. + * + * @param publicCloudConnectorsResourceId the publicCloudConnectorsResourceId value to set. + * @return the DynamoDBTableProperties object itself. + */ + public DynamoDBTableProperties withPublicCloudConnectorsResourceId(String publicCloudConnectorsResourceId) { + this.publicCloudConnectorsResourceId = publicCloudConnectorsResourceId; + return this; + } + + /** + * Get the awsAccountId property: AWS Account ID. + * + * @return the awsAccountId value. + */ + public String awsAccountId() { + return this.awsAccountId; + } + + /** + * Set the awsAccountId property: AWS Account ID. + * + * @param awsAccountId the awsAccountId value to set. + * @return the DynamoDBTableProperties object itself. + */ + public DynamoDBTableProperties withAwsAccountId(String awsAccountId) { + this.awsAccountId = awsAccountId; + return this; + } + + /** + * Get the arn property: Amazon Resource Name (ARN). + * + * @return the arn value. + */ + public String arn() { + return this.arn; + } + + /** + * Set the arn property: Amazon Resource Name (ARN). + * + * @param arn the arn value to set. + * @return the DynamoDBTableProperties object itself. + */ + public DynamoDBTableProperties withArn(String arn) { + this.arn = arn; + return this; + } + + /** + * Get the publicCloudResourceName property: Public Cloud Resource Name. + * + * @return the publicCloudResourceName value. + */ + public String publicCloudResourceName() { + return this.publicCloudResourceName; + } + + /** + * Set the publicCloudResourceName property: Public Cloud Resource Name. + * + * @param publicCloudResourceName the publicCloudResourceName value to set. + * @return the DynamoDBTableProperties object itself. + */ + public DynamoDBTableProperties withPublicCloudResourceName(String publicCloudResourceName) { + this.publicCloudResourceName = publicCloudResourceName; + return this; + } + + /** + * Get the awsSourceSchema property: AWS Source Schema. + * + * @return the awsSourceSchema value. + */ + public String awsSourceSchema() { + return this.awsSourceSchema; + } + + /** + * Set the awsSourceSchema property: AWS Source Schema. + * + * @param awsSourceSchema the awsSourceSchema value to set. + * @return the DynamoDBTableProperties object itself. + */ + public DynamoDBTableProperties withAwsSourceSchema(String awsSourceSchema) { + this.awsSourceSchema = awsSourceSchema; + return this; + } + + /** + * Get the awsRegion property: AWS Region. + * + * @return the awsRegion value. + */ + public String awsRegion() { + return this.awsRegion; + } + + /** + * Set the awsRegion property: AWS Region. + * + * @param awsRegion the awsRegion value to set. + * @return the DynamoDBTableProperties object itself. + */ + public DynamoDBTableProperties withAwsRegion(String awsRegion) { + this.awsRegion = awsRegion; + return this; + } + + /** + * Get the awsTags property: AWS Tags. + * + * @return the awsTags value. + */ + public Map awsTags() { + return this.awsTags; + } + + /** + * Set the awsTags property: AWS Tags. + * + * @param awsTags the awsTags value to set. + * @return the DynamoDBTableProperties object itself. + */ + public DynamoDBTableProperties withAwsTags(Map awsTags) { + this.awsTags = awsTags; + return this; + } + + /** + * Get the provisioningState property: The status of the last operation. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (awsProperties() != null) { + awsProperties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("awsProperties", this.awsProperties); + jsonWriter.writeStringField("publicCloudConnectorsResourceId", this.publicCloudConnectorsResourceId); + jsonWriter.writeStringField("awsAccountId", this.awsAccountId); + jsonWriter.writeStringField("arn", this.arn); + jsonWriter.writeStringField("publicCloudResourceName", this.publicCloudResourceName); + jsonWriter.writeStringField("awsSourceSchema", this.awsSourceSchema); + jsonWriter.writeStringField("awsRegion", this.awsRegion); + jsonWriter.writeMapField("awsTags", this.awsTags, (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of DynamoDBTableProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of DynamoDBTableProperties if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the DynamoDBTableProperties. + */ + public static DynamoDBTableProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + DynamoDBTableProperties deserializedDynamoDBTableProperties = new DynamoDBTableProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("awsProperties".equals(fieldName)) { + deserializedDynamoDBTableProperties.awsProperties = AwsDynamoDBTableProperties.fromJson(reader); + } else if ("publicCloudConnectorsResourceId".equals(fieldName)) { + deserializedDynamoDBTableProperties.publicCloudConnectorsResourceId = reader.getString(); + } else if ("awsAccountId".equals(fieldName)) { + deserializedDynamoDBTableProperties.awsAccountId = reader.getString(); + } else if ("arn".equals(fieldName)) { + deserializedDynamoDBTableProperties.arn = reader.getString(); + } else if ("publicCloudResourceName".equals(fieldName)) { + deserializedDynamoDBTableProperties.publicCloudResourceName = reader.getString(); + } else if ("awsSourceSchema".equals(fieldName)) { + deserializedDynamoDBTableProperties.awsSourceSchema = reader.getString(); + } else if ("awsRegion".equals(fieldName)) { + deserializedDynamoDBTableProperties.awsRegion = reader.getString(); + } else if ("awsTags".equals(fieldName)) { + Map awsTags = reader.readMap(reader1 -> reader1.getString()); + deserializedDynamoDBTableProperties.awsTags = awsTags; + } else if ("provisioningState".equals(fieldName)) { + deserializedDynamoDBTableProperties.provisioningState + = ProvisioningState.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedDynamoDBTableProperties; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/DynamoDBTableTagsUpdate.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/DynamoDBTableTagsUpdate.java new file mode 100644 index 000000000000..7c0871560c99 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/DynamoDBTableTagsUpdate.java @@ -0,0 +1,95 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.Map; + +/** + * The type used for updating tags in DynamoDBTable resources. + */ +@Fluent +public final class DynamoDBTableTagsUpdate implements JsonSerializable { + /* + * Resource tags. + */ + private Map tags; + + /** + * Creates an instance of DynamoDBTableTagsUpdate class. + */ + public DynamoDBTableTagsUpdate() { + } + + /** + * Get the tags property: Resource tags. + * + * @return the tags value. + */ + public Map tags() { + return this.tags; + } + + /** + * Set the tags property: Resource tags. + * + * @param tags the tags value to set. + * @return the DynamoDBTableTagsUpdate object itself. + */ + public DynamoDBTableTagsUpdate withTags(Map tags) { + this.tags = tags; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeMapField("tags", this.tags, (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of DynamoDBTableTagsUpdate from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of DynamoDBTableTagsUpdate if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the DynamoDBTableTagsUpdate. + */ + public static DynamoDBTableTagsUpdate fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + DynamoDBTableTagsUpdate deserializedDynamoDBTableTagsUpdate = new DynamoDBTableTagsUpdate(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedDynamoDBTableTagsUpdate.tags = tags; + } else { + reader.skipChildren(); + } + } + + return deserializedDynamoDBTableTagsUpdate; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/DynamoDbContinuousBackupsDescriptions.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/DynamoDbContinuousBackupsDescriptions.java new file mode 100644 index 000000000000..8fb390784a6e --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/DynamoDbContinuousBackupsDescriptions.java @@ -0,0 +1,162 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** + * Resource collection API of DynamoDbContinuousBackupsDescriptions. + */ +public interface DynamoDbContinuousBackupsDescriptions { + /** + * List DynamoDBContinuousBackupsDescription resources by subscription ID. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a DynamoDBContinuousBackupsDescription list operation as paginated response with + * {@link PagedIterable}. + */ + PagedIterable list(); + + /** + * List DynamoDBContinuousBackupsDescription resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a DynamoDBContinuousBackupsDescription list operation as paginated response with + * {@link PagedIterable}. + */ + PagedIterable list(Context context); + + /** + * List DynamoDBContinuousBackupsDescription resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a DynamoDBContinuousBackupsDescription list operation as paginated response with + * {@link PagedIterable}. + */ + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * List DynamoDBContinuousBackupsDescription resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a DynamoDBContinuousBackupsDescription list operation as paginated response with + * {@link PagedIterable}. + */ + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Get a DynamoDBContinuousBackupsDescription. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of DynamoDBContinuousBackupsDescription. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a DynamoDBContinuousBackupsDescription along with {@link Response}. + */ + Response getByResourceGroupWithResponse(String resourceGroupName, String name, + Context context); + + /** + * Get a DynamoDBContinuousBackupsDescription. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of DynamoDBContinuousBackupsDescription. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a DynamoDBContinuousBackupsDescription. + */ + DynamoDBContinuousBackupsDescription getByResourceGroup(String resourceGroupName, String name); + + /** + * Delete a DynamoDBContinuousBackupsDescription. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of DynamoDBContinuousBackupsDescription. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByResourceGroup(String resourceGroupName, String name); + + /** + * Delete a DynamoDBContinuousBackupsDescription. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of DynamoDBContinuousBackupsDescription. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String name, Context context); + + /** + * Get a DynamoDBContinuousBackupsDescription. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a DynamoDBContinuousBackupsDescription along with {@link Response}. + */ + DynamoDBContinuousBackupsDescription getById(String id); + + /** + * Get a DynamoDBContinuousBackupsDescription. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a DynamoDBContinuousBackupsDescription along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Delete a DynamoDBContinuousBackupsDescription. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteById(String id); + + /** + * Delete a DynamoDBContinuousBackupsDescription. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new DynamoDBContinuousBackupsDescription resource. + * + * @param name resource name. + * @return the first stage of the new DynamoDBContinuousBackupsDescription definition. + */ + DynamoDBContinuousBackupsDescription.DefinitionStages.Blank define(String name); +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/DynamoDbTables.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/DynamoDbTables.java new file mode 100644 index 000000000000..b06423e99b7f --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/DynamoDbTables.java @@ -0,0 +1,157 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** + * Resource collection API of DynamoDbTables. + */ +public interface DynamoDbTables { + /** + * List DynamoDBTable resources by subscription ID. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a DynamoDBTable list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable list(); + + /** + * List DynamoDBTable resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a DynamoDBTable list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable list(Context context); + + /** + * List DynamoDBTable resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a DynamoDBTable list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * List DynamoDBTable resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a DynamoDBTable list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Get a DynamoDBTable. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of DynamoDBTable. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a DynamoDBTable along with {@link Response}. + */ + Response getByResourceGroupWithResponse(String resourceGroupName, String name, Context context); + + /** + * Get a DynamoDBTable. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of DynamoDBTable. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a DynamoDBTable. + */ + DynamoDBTable getByResourceGroup(String resourceGroupName, String name); + + /** + * Delete a DynamoDBTable. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of DynamoDBTable. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByResourceGroup(String resourceGroupName, String name); + + /** + * Delete a DynamoDBTable. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of DynamoDBTable. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String name, Context context); + + /** + * Get a DynamoDBTable. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a DynamoDBTable along with {@link Response}. + */ + DynamoDBTable getById(String id); + + /** + * Get a DynamoDBTable. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a DynamoDBTable along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Delete a DynamoDBTable. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteById(String id); + + /** + * Delete a DynamoDBTable. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new DynamoDBTable resource. + * + * @param name resource name. + * @return the first stage of the new DynamoDBTable definition. + */ + DynamoDBTable.DefinitionStages.Blank define(String name); +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/EbsBlockDevice.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/EbsBlockDevice.java new file mode 100644 index 000000000000..1e070a7fc9f6 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/EbsBlockDevice.java @@ -0,0 +1,493 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of EbsBlockDevice. + */ +@Fluent +public final class EbsBlockDevice implements JsonSerializable { + /* + *

Indicates whether the EBS volume is deleted on instance termination. For more information, see Preserving Amazon EBS volumes on instance termination in the Amazon EC2 User Guide.

+ */ + private Boolean deleteOnTermination; + + /* + *

Indicates whether the encryption state of an EBS volume is changed while being restored from a backing + * snapshot. The effect of setting the encryption state to true depends on the volume origin (new or + * from a snapshot), starting encryption state, ownership, and whether encryption by default is enabled. For more + * information, see Amazon EBS + * encryption in the Amazon EBS User Guide.

In no case can you remove encryption from an encrypted + * volume.

Encrypted volumes can only be attached to instances that support Amazon EBS encryption. For more + * information, see Supported instance types.

This parameter is not returned by + * DescribeImageAttribute.

For CreateImage and RegisterImage, whether you can include + * this parameter, and the allowed values differ depending on the type of block device mapping you are creating.

+ *
  • If you are creating a block device mapping for a new (empty) volume, you can include this + * parameter, and specify either true for an encrypted volume, or false for an unencrypted + * volume. If you omit this parameter, it defaults to false (unencrypted).

  • If you are + * creating a block device mapping from an existing encrypted or unencrypted snapshot, you must omit this + * parameter. If you include this parameter, the request will fail, regardless of the value that you specify.

    + *
  • If you are creating a block device mapping from an existing unencrypted volume, you can + * include this parameter, but you must specify false. If you specify true, the request + * will fail. In this case, we recommend that you omit the parameter.

  • If you are creating a block + * device mapping from an existing encrypted volume, you can include this parameter, and specify either + * true or false. However, if you specify false, the parameter is ignored and + * the block device mapping is always encrypted. In this case, we recommend that you omit the parameter.

  • + *
+ */ + private Boolean encrypted; + + /* + *

The number of I/O operations per second (IOPS). For gp3, io1, and io2 + * volumes, this represents the number of IOPS that are provisioned for the volume. For gp2 volumes, + * this represents the baseline performance of the volume and the rate at which the volume accumulates I/O credits + * for bursting.

The following are the supported values for each volume type:

  • + * gp3: 3,000 - 16,000 IOPS

  • io1: 100 - 64,000 IOPS

  • + * io2: 100 - 256,000 IOPS

For io2 volumes, you can achieve up to + * 256,000 IOPS on instances + * built on the Nitro System. On other instances, you can achieve performance up to 32,000 IOPS.

This + * parameter is required for io1 and io2 volumes. The default for gp3 volumes + * is 3,000 IOPS.

+ */ + private Integer iops; + + /* + *

Identifier (key ID, key alias, ID ARN, or alias ARN) for a customer managed CMK under which the EBS volume is + * encrypted.

This parameter is only supported on BlockDeviceMapping objects called by RunInstances, RequestSpotFleet, and + * RequestSpotInstances< + * /a>.

+ */ + private String kmsKeyId; + + /* + *

The ARN of the Outpost on which the snapshot is stored.

This parameter is not supported when using CreateImage.

+ */ + private String outpostArn; + + /* + *

The ID of the snapshot.

+ */ + private String snapshotId; + + /* + *

The throughput that the volume supports, in MiB/s.

This parameter is valid only for gp3 + * volumes.

Valid Range: Minimum value of 125. Maximum value of 1000.

+ */ + private Integer throughput; + + /* + *

The size of the volume, in GiBs. You must specify either a snapshot ID or a volume size. If you specify a + * snapshot, the default is the snapshot size. You can specify a volume size that is equal to or larger than the + * snapshot size.

The following are the supported sizes for each volume type:

  • + * gp2 and gp3: 1 - 16,384 GiB

  • io1: 4 - 16,384 GiB

    + *
  • io2: 4 - 65,536 GiB

  • st1 and sc1: 125 - + * 16,384 GiB

  • standard: 1 - 1024 GiB

+ */ + private Integer volumeSize; + + /* + *

The volume type. For more information, see Amazon EBS volume types in the + * Amazon EBS User Guide.

+ */ + private VolumeTypeEnumValue volumeType; + + /** + * Creates an instance of EbsBlockDevice class. + */ + public EbsBlockDevice() { + } + + /** + * Get the deleteOnTermination property: <p>Indicates whether the EBS volume is deleted on instance + * termination. For more information, see <a + * href='https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/terminating-instances.html#preserving-volumes-on-termination'>Preserving + * Amazon EBS volumes on instance termination</a> in the <i>Amazon EC2 User Guide</i>.</p>. + * + * @return the deleteOnTermination value. + */ + public Boolean deleteOnTermination() { + return this.deleteOnTermination; + } + + /** + * Set the deleteOnTermination property: <p>Indicates whether the EBS volume is deleted on instance + * termination. For more information, see <a + * href='https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/terminating-instances.html#preserving-volumes-on-termination'>Preserving + * Amazon EBS volumes on instance termination</a> in the <i>Amazon EC2 User Guide</i>.</p>. + * + * @param deleteOnTermination the deleteOnTermination value to set. + * @return the EbsBlockDevice object itself. + */ + public EbsBlockDevice withDeleteOnTermination(Boolean deleteOnTermination) { + this.deleteOnTermination = deleteOnTermination; + return this; + } + + /** + * Get the encrypted property: <p>Indicates whether the encryption state of an EBS volume is changed while + * being restored from a backing snapshot. The effect of setting the encryption state to + * <code>true</code> depends on the volume origin (new or from a snapshot), starting encryption state, + * ownership, and whether encryption by default is enabled. For more information, see <a + * href='https://docs.aws.amazon.com/ebs/latest/userguide/ebs-encryption.html#encryption-parameters'>Amazon EBS + * encryption</a> in the <i>Amazon EBS User Guide</i>.</p> <p>In no case can you + * remove encryption from an encrypted volume.</p> <p>Encrypted volumes can only be attached to + * instances that support Amazon EBS encryption. For more information, see <a + * href='https://docs.aws.amazon.com/ebs/latest/userguide/ebs-encryption-requirements.html#ebs-encryption_supported_instances'>Supported + * instance types</a>.</p> <p>This parameter is not returned by + * <a>DescribeImageAttribute</a>.</p> <p>For <a>CreateImage</a> and + * <a>RegisterImage</a>, whether you can include this parameter, and the allowed values differ depending + * on the type of block device mapping you are creating.</p> <ul> <li> <p>If you are + * creating a block device mapping for a <b>new (empty) volume</b>, you can include this parameter, and + * specify either <code>true</code> for an encrypted volume, or <code>false</code> for an + * unencrypted volume. If you omit this parameter, it defaults to <code>false</code> + * (unencrypted).</p> </li> <li> <p>If you are creating a block device mapping from an + * <b>existing encrypted or unencrypted snapshot</b>, you must omit this parameter. If you include this + * parameter, the request will fail, regardless of the value that you specify.</p> </li> <li> + * <p>If you are creating a block device mapping from an <b>existing unencrypted volume</b>, you + * can include this parameter, but you must specify <code>false</code>. If you specify + * <code>true</code>, the request will fail. In this case, we recommend that you omit the + * parameter.</p> </li> <li> <p>If you are creating a block device mapping from an + * <b>existing encrypted volume</b>, you can include this parameter, and specify either + * <code>true</code> or <code>false</code>. However, if you specify + * <code>false</code>, the parameter is ignored and the block device mapping is always encrypted. In + * this case, we recommend that you omit the parameter.</p> </li> </ul>. + * + * @return the encrypted value. + */ + public Boolean encrypted() { + return this.encrypted; + } + + /** + * Set the encrypted property: <p>Indicates whether the encryption state of an EBS volume is changed while + * being restored from a backing snapshot. The effect of setting the encryption state to + * <code>true</code> depends on the volume origin (new or from a snapshot), starting encryption state, + * ownership, and whether encryption by default is enabled. For more information, see <a + * href='https://docs.aws.amazon.com/ebs/latest/userguide/ebs-encryption.html#encryption-parameters'>Amazon EBS + * encryption</a> in the <i>Amazon EBS User Guide</i>.</p> <p>In no case can you + * remove encryption from an encrypted volume.</p> <p>Encrypted volumes can only be attached to + * instances that support Amazon EBS encryption. For more information, see <a + * href='https://docs.aws.amazon.com/ebs/latest/userguide/ebs-encryption-requirements.html#ebs-encryption_supported_instances'>Supported + * instance types</a>.</p> <p>This parameter is not returned by + * <a>DescribeImageAttribute</a>.</p> <p>For <a>CreateImage</a> and + * <a>RegisterImage</a>, whether you can include this parameter, and the allowed values differ depending + * on the type of block device mapping you are creating.</p> <ul> <li> <p>If you are + * creating a block device mapping for a <b>new (empty) volume</b>, you can include this parameter, and + * specify either <code>true</code> for an encrypted volume, or <code>false</code> for an + * unencrypted volume. If you omit this parameter, it defaults to <code>false</code> + * (unencrypted).</p> </li> <li> <p>If you are creating a block device mapping from an + * <b>existing encrypted or unencrypted snapshot</b>, you must omit this parameter. If you include this + * parameter, the request will fail, regardless of the value that you specify.</p> </li> <li> + * <p>If you are creating a block device mapping from an <b>existing unencrypted volume</b>, you + * can include this parameter, but you must specify <code>false</code>. If you specify + * <code>true</code>, the request will fail. In this case, we recommend that you omit the + * parameter.</p> </li> <li> <p>If you are creating a block device mapping from an + * <b>existing encrypted volume</b>, you can include this parameter, and specify either + * <code>true</code> or <code>false</code>. However, if you specify + * <code>false</code>, the parameter is ignored and the block device mapping is always encrypted. In + * this case, we recommend that you omit the parameter.</p> </li> </ul>. + * + * @param encrypted the encrypted value to set. + * @return the EbsBlockDevice object itself. + */ + public EbsBlockDevice withEncrypted(Boolean encrypted) { + this.encrypted = encrypted; + return this; + } + + /** + * Get the iops property: <p>The number of I/O operations per second (IOPS). For <code>gp3</code>, + * <code>io1</code>, and <code>io2</code> volumes, this represents the number of IOPS that + * are provisioned for the volume. For <code>gp2</code> volumes, this represents the baseline + * performance of the volume and the rate at which the volume accumulates I/O credits for bursting.</p> + * <p>The following are the supported values for each volume type:</p> <ul> <li> <p> + * <code>gp3</code>: 3,000 - 16,000 IOPS</p> </li> <li> <p> + * <code>io1</code>: 100 - 64,000 IOPS</p> </li> <li> <p> + * <code>io2</code>: 100 - 256,000 IOPS</p> </li> </ul> <p>For + * <code>io2</code> volumes, you can achieve up to 256,000 IOPS on <a + * href='https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/instance-types.html#ec2-nitro-instances'>instances + * built on the Nitro System</a>. On other instances, you can achieve performance up to 32,000 IOPS.</p> + * <p>This parameter is required for <code>io1</code> and <code>io2</code> volumes. + * The default for <code>gp3</code> volumes is 3,000 IOPS.</p>. + * + * @return the iops value. + */ + public Integer iops() { + return this.iops; + } + + /** + * Set the iops property: <p>The number of I/O operations per second (IOPS). For <code>gp3</code>, + * <code>io1</code>, and <code>io2</code> volumes, this represents the number of IOPS that + * are provisioned for the volume. For <code>gp2</code> volumes, this represents the baseline + * performance of the volume and the rate at which the volume accumulates I/O credits for bursting.</p> + * <p>The following are the supported values for each volume type:</p> <ul> <li> <p> + * <code>gp3</code>: 3,000 - 16,000 IOPS</p> </li> <li> <p> + * <code>io1</code>: 100 - 64,000 IOPS</p> </li> <li> <p> + * <code>io2</code>: 100 - 256,000 IOPS</p> </li> </ul> <p>For + * <code>io2</code> volumes, you can achieve up to 256,000 IOPS on <a + * href='https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/instance-types.html#ec2-nitro-instances'>instances + * built on the Nitro System</a>. On other instances, you can achieve performance up to 32,000 IOPS.</p> + * <p>This parameter is required for <code>io1</code> and <code>io2</code> volumes. + * The default for <code>gp3</code> volumes is 3,000 IOPS.</p>. + * + * @param iops the iops value to set. + * @return the EbsBlockDevice object itself. + */ + public EbsBlockDevice withIops(Integer iops) { + this.iops = iops; + return this; + } + + /** + * Get the kmsKeyId property: <p>Identifier (key ID, key alias, ID ARN, or alias ARN) for a customer managed + * CMK under which the EBS volume is encrypted.</p> <p>This parameter is only supported on + * <code>BlockDeviceMapping</code> objects called by <a + * href='https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_RunInstances.html'>RunInstances</a>, + * <a + * href='https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_RequestSpotFleet.html'>RequestSpotFleet</a>, + * and <a + * href='https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_RequestSpotInstances.html'>RequestSpotInstances</a>.</p>. + * + * @return the kmsKeyId value. + */ + public String kmsKeyId() { + return this.kmsKeyId; + } + + /** + * Set the kmsKeyId property: <p>Identifier (key ID, key alias, ID ARN, or alias ARN) for a customer managed + * CMK under which the EBS volume is encrypted.</p> <p>This parameter is only supported on + * <code>BlockDeviceMapping</code> objects called by <a + * href='https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_RunInstances.html'>RunInstances</a>, + * <a + * href='https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_RequestSpotFleet.html'>RequestSpotFleet</a>, + * and <a + * href='https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_RequestSpotInstances.html'>RequestSpotInstances</a>.</p>. + * + * @param kmsKeyId the kmsKeyId value to set. + * @return the EbsBlockDevice object itself. + */ + public EbsBlockDevice withKmsKeyId(String kmsKeyId) { + this.kmsKeyId = kmsKeyId; + return this; + } + + /** + * Get the outpostArn property: <p>The ARN of the Outpost on which the snapshot is stored.</p> + * <p>This parameter is not supported when using <a + * href='https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_CreateImage.html'>CreateImage</a>.</p>. + * + * @return the outpostArn value. + */ + public String outpostArn() { + return this.outpostArn; + } + + /** + * Set the outpostArn property: <p>The ARN of the Outpost on which the snapshot is stored.</p> + * <p>This parameter is not supported when using <a + * href='https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_CreateImage.html'>CreateImage</a>.</p>. + * + * @param outpostArn the outpostArn value to set. + * @return the EbsBlockDevice object itself. + */ + public EbsBlockDevice withOutpostArn(String outpostArn) { + this.outpostArn = outpostArn; + return this; + } + + /** + * Get the snapshotId property: <p>The ID of the snapshot.</p>. + * + * @return the snapshotId value. + */ + public String snapshotId() { + return this.snapshotId; + } + + /** + * Set the snapshotId property: <p>The ID of the snapshot.</p>. + * + * @param snapshotId the snapshotId value to set. + * @return the EbsBlockDevice object itself. + */ + public EbsBlockDevice withSnapshotId(String snapshotId) { + this.snapshotId = snapshotId; + return this; + } + + /** + * Get the throughput property: <p>The throughput that the volume supports, in MiB/s.</p> <p>This + * parameter is valid only for <code>gp3</code> volumes.</p> <p>Valid Range: Minimum value + * of 125. Maximum value of 1000.</p>. + * + * @return the throughput value. + */ + public Integer throughput() { + return this.throughput; + } + + /** + * Set the throughput property: <p>The throughput that the volume supports, in MiB/s.</p> <p>This + * parameter is valid only for <code>gp3</code> volumes.</p> <p>Valid Range: Minimum value + * of 125. Maximum value of 1000.</p>. + * + * @param throughput the throughput value to set. + * @return the EbsBlockDevice object itself. + */ + public EbsBlockDevice withThroughput(Integer throughput) { + this.throughput = throughput; + return this; + } + + /** + * Get the volumeSize property: <p>The size of the volume, in GiBs. You must specify either a snapshot ID or a + * volume size. If you specify a snapshot, the default is the snapshot size. You can specify a volume size that is + * equal to or larger than the snapshot size.</p> <p>The following are the supported sizes for each + * volume type:</p> <ul> <li> <p> <code>gp2</code> and + * <code>gp3</code>: 1 - 16,384 GiB</p> </li> <li> <p> + * <code>io1</code>: 4 - 16,384 GiB</p> </li> <li> <p> + * <code>io2</code>: 4 - 65,536 GiB</p> </li> <li> <p> + * <code>st1</code> and <code>sc1</code>: 125 - 16,384 GiB</p> </li> <li> + * <p> <code>standard</code>: 1 - 1024 GiB</p> </li> </ul>. + * + * @return the volumeSize value. + */ + public Integer volumeSize() { + return this.volumeSize; + } + + /** + * Set the volumeSize property: <p>The size of the volume, in GiBs. You must specify either a snapshot ID or a + * volume size. If you specify a snapshot, the default is the snapshot size. You can specify a volume size that is + * equal to or larger than the snapshot size.</p> <p>The following are the supported sizes for each + * volume type:</p> <ul> <li> <p> <code>gp2</code> and + * <code>gp3</code>: 1 - 16,384 GiB</p> </li> <li> <p> + * <code>io1</code>: 4 - 16,384 GiB</p> </li> <li> <p> + * <code>io2</code>: 4 - 65,536 GiB</p> </li> <li> <p> + * <code>st1</code> and <code>sc1</code>: 125 - 16,384 GiB</p> </li> <li> + * <p> <code>standard</code>: 1 - 1024 GiB</p> </li> </ul>. + * + * @param volumeSize the volumeSize value to set. + * @return the EbsBlockDevice object itself. + */ + public EbsBlockDevice withVolumeSize(Integer volumeSize) { + this.volumeSize = volumeSize; + return this; + } + + /** + * Get the volumeType property: <p>The volume type. For more information, see <a + * href='https://docs.aws.amazon.com/ebs/latest/userguide/ebs-volume-types.html'>Amazon EBS volume + * types</a> in the <i>Amazon EBS User Guide</i>.</p>. + * + * @return the volumeType value. + */ + public VolumeTypeEnumValue volumeType() { + return this.volumeType; + } + + /** + * Set the volumeType property: <p>The volume type. For more information, see <a + * href='https://docs.aws.amazon.com/ebs/latest/userguide/ebs-volume-types.html'>Amazon EBS volume + * types</a> in the <i>Amazon EBS User Guide</i>.</p>. + * + * @param volumeType the volumeType value to set. + * @return the EbsBlockDevice object itself. + */ + public EbsBlockDevice withVolumeType(VolumeTypeEnumValue volumeType) { + this.volumeType = volumeType; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (volumeType() != null) { + volumeType().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeBooleanField("deleteOnTermination", this.deleteOnTermination); + jsonWriter.writeBooleanField("encrypted", this.encrypted); + jsonWriter.writeNumberField("iops", this.iops); + jsonWriter.writeStringField("kmsKeyId", this.kmsKeyId); + jsonWriter.writeStringField("outpostArn", this.outpostArn); + jsonWriter.writeStringField("snapshotId", this.snapshotId); + jsonWriter.writeNumberField("throughput", this.throughput); + jsonWriter.writeNumberField("volumeSize", this.volumeSize); + jsonWriter.writeJsonField("volumeType", this.volumeType); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of EbsBlockDevice from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of EbsBlockDevice if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the EbsBlockDevice. + */ + public static EbsBlockDevice fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + EbsBlockDevice deserializedEbsBlockDevice = new EbsBlockDevice(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("deleteOnTermination".equals(fieldName)) { + deserializedEbsBlockDevice.deleteOnTermination = reader.getNullable(JsonReader::getBoolean); + } else if ("encrypted".equals(fieldName)) { + deserializedEbsBlockDevice.encrypted = reader.getNullable(JsonReader::getBoolean); + } else if ("iops".equals(fieldName)) { + deserializedEbsBlockDevice.iops = reader.getNullable(JsonReader::getInt); + } else if ("kmsKeyId".equals(fieldName)) { + deserializedEbsBlockDevice.kmsKeyId = reader.getString(); + } else if ("outpostArn".equals(fieldName)) { + deserializedEbsBlockDevice.outpostArn = reader.getString(); + } else if ("snapshotId".equals(fieldName)) { + deserializedEbsBlockDevice.snapshotId = reader.getString(); + } else if ("throughput".equals(fieldName)) { + deserializedEbsBlockDevice.throughput = reader.getNullable(JsonReader::getInt); + } else if ("volumeSize".equals(fieldName)) { + deserializedEbsBlockDevice.volumeSize = reader.getNullable(JsonReader::getInt); + } else if ("volumeType".equals(fieldName)) { + deserializedEbsBlockDevice.volumeType = VolumeTypeEnumValue.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedEbsBlockDevice; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/EbsInstanceBlockDevice.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/EbsInstanceBlockDevice.java new file mode 100644 index 000000000000..5100456e5e22 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/EbsInstanceBlockDevice.java @@ -0,0 +1,250 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.time.OffsetDateTime; +import java.time.format.DateTimeFormatter; + +/** + * Definition of EbsInstanceBlockDevice. + */ +@Fluent +public final class EbsInstanceBlockDevice implements JsonSerializable { + /* + *

The ARN of the Amazon ECS or Fargate task to which the volume is attached.

+ */ + private String associatedResource; + + /* + *

The time stamp when the attachment initiated.

+ */ + private OffsetDateTime attachTime; + + /* + *

Indicates whether the volume is deleted on instance termination.

+ */ + private Boolean deleteOnTermination; + + /* + *

The attachment state.

+ */ + private AttachmentStatusEnumValue status; + + /* + *

The ID of the EBS volume.

+ */ + private String volumeId; + + /* + *

The ID of the Amazon Web Services account that owns the volume.

This parameter is returned only for + * volumes that are attached to Fargate tasks.

+ */ + private String volumeOwnerId; + + /** + * Creates an instance of EbsInstanceBlockDevice class. + */ + public EbsInstanceBlockDevice() { + } + + /** + * Get the associatedResource property: <p>The ARN of the Amazon ECS or Fargate task to which the volume is + * attached.</p>. + * + * @return the associatedResource value. + */ + public String associatedResource() { + return this.associatedResource; + } + + /** + * Set the associatedResource property: <p>The ARN of the Amazon ECS or Fargate task to which the volume is + * attached.</p>. + * + * @param associatedResource the associatedResource value to set. + * @return the EbsInstanceBlockDevice object itself. + */ + public EbsInstanceBlockDevice withAssociatedResource(String associatedResource) { + this.associatedResource = associatedResource; + return this; + } + + /** + * Get the attachTime property: <p>The time stamp when the attachment initiated.</p>. + * + * @return the attachTime value. + */ + public OffsetDateTime attachTime() { + return this.attachTime; + } + + /** + * Set the attachTime property: <p>The time stamp when the attachment initiated.</p>. + * + * @param attachTime the attachTime value to set. + * @return the EbsInstanceBlockDevice object itself. + */ + public EbsInstanceBlockDevice withAttachTime(OffsetDateTime attachTime) { + this.attachTime = attachTime; + return this; + } + + /** + * Get the deleteOnTermination property: <p>Indicates whether the volume is deleted on instance + * termination.</p>. + * + * @return the deleteOnTermination value. + */ + public Boolean deleteOnTermination() { + return this.deleteOnTermination; + } + + /** + * Set the deleteOnTermination property: <p>Indicates whether the volume is deleted on instance + * termination.</p>. + * + * @param deleteOnTermination the deleteOnTermination value to set. + * @return the EbsInstanceBlockDevice object itself. + */ + public EbsInstanceBlockDevice withDeleteOnTermination(Boolean deleteOnTermination) { + this.deleteOnTermination = deleteOnTermination; + return this; + } + + /** + * Get the status property: <p>The attachment state.</p>. + * + * @return the status value. + */ + public AttachmentStatusEnumValue status() { + return this.status; + } + + /** + * Set the status property: <p>The attachment state.</p>. + * + * @param status the status value to set. + * @return the EbsInstanceBlockDevice object itself. + */ + public EbsInstanceBlockDevice withStatus(AttachmentStatusEnumValue status) { + this.status = status; + return this; + } + + /** + * Get the volumeId property: <p>The ID of the EBS volume.</p>. + * + * @return the volumeId value. + */ + public String volumeId() { + return this.volumeId; + } + + /** + * Set the volumeId property: <p>The ID of the EBS volume.</p>. + * + * @param volumeId the volumeId value to set. + * @return the EbsInstanceBlockDevice object itself. + */ + public EbsInstanceBlockDevice withVolumeId(String volumeId) { + this.volumeId = volumeId; + return this; + } + + /** + * Get the volumeOwnerId property: <p>The ID of the Amazon Web Services account that owns the + * volume.</p> <p>This parameter is returned only for volumes that are attached to Fargate + * tasks.</p>. + * + * @return the volumeOwnerId value. + */ + public String volumeOwnerId() { + return this.volumeOwnerId; + } + + /** + * Set the volumeOwnerId property: <p>The ID of the Amazon Web Services account that owns the + * volume.</p> <p>This parameter is returned only for volumes that are attached to Fargate + * tasks.</p>. + * + * @param volumeOwnerId the volumeOwnerId value to set. + * @return the EbsInstanceBlockDevice object itself. + */ + public EbsInstanceBlockDevice withVolumeOwnerId(String volumeOwnerId) { + this.volumeOwnerId = volumeOwnerId; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (status() != null) { + status().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("associatedResource", this.associatedResource); + jsonWriter.writeStringField("attachTime", + this.attachTime == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.attachTime)); + jsonWriter.writeBooleanField("deleteOnTermination", this.deleteOnTermination); + jsonWriter.writeJsonField("status", this.status); + jsonWriter.writeStringField("volumeId", this.volumeId); + jsonWriter.writeStringField("volumeOwnerId", this.volumeOwnerId); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of EbsInstanceBlockDevice from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of EbsInstanceBlockDevice if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the EbsInstanceBlockDevice. + */ + public static EbsInstanceBlockDevice fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + EbsInstanceBlockDevice deserializedEbsInstanceBlockDevice = new EbsInstanceBlockDevice(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("associatedResource".equals(fieldName)) { + deserializedEbsInstanceBlockDevice.associatedResource = reader.getString(); + } else if ("attachTime".equals(fieldName)) { + deserializedEbsInstanceBlockDevice.attachTime = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("deleteOnTermination".equals(fieldName)) { + deserializedEbsInstanceBlockDevice.deleteOnTermination = reader.getNullable(JsonReader::getBoolean); + } else if ("status".equals(fieldName)) { + deserializedEbsInstanceBlockDevice.status = AttachmentStatusEnumValue.fromJson(reader); + } else if ("volumeId".equals(fieldName)) { + deserializedEbsInstanceBlockDevice.volumeId = reader.getString(); + } else if ("volumeOwnerId".equals(fieldName)) { + deserializedEbsInstanceBlockDevice.volumeOwnerId = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedEbsInstanceBlockDevice; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/EbsOptions.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/EbsOptions.java new file mode 100644 index 000000000000..4748e62ec028 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/EbsOptions.java @@ -0,0 +1,220 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of EBSOptions. + */ +@Fluent +public final class EbsOptions implements JsonSerializable { + /* + *

Indicates whether EBS volumes are attached to data nodes in an OpenSearch Service domain.

+ */ + private Boolean ebsEnabled; + + /* + *

Specifies the baseline input/output (I/O) performance of EBS volumes attached to data nodes. Applicable only + * for the gp3 and provisioned IOPS EBS volume types.

+ */ + private Integer iops; + + /* + *

Specifies the throughput (in MiB/s) of the EBS volumes attached to data nodes. Applicable only for the + * gp3 volume type.

+ */ + private Integer throughput; + + /* + *

Specifies the size (in GiB) of EBS volumes attached to data nodes.

+ */ + private Integer volumeSize; + + /* + *

Specifies the type of EBS volumes attached to data nodes.

+ */ + private VolumeTypeEnumValue volumeType; + + /** + * Creates an instance of EbsOptions class. + */ + public EbsOptions() { + } + + /** + * Get the ebsEnabled property: <p>Indicates whether EBS volumes are attached to data nodes in an OpenSearch + * Service domain.</p>. + * + * @return the ebsEnabled value. + */ + public Boolean ebsEnabled() { + return this.ebsEnabled; + } + + /** + * Set the ebsEnabled property: <p>Indicates whether EBS volumes are attached to data nodes in an OpenSearch + * Service domain.</p>. + * + * @param ebsEnabled the ebsEnabled value to set. + * @return the EbsOptions object itself. + */ + public EbsOptions withEbsEnabled(Boolean ebsEnabled) { + this.ebsEnabled = ebsEnabled; + return this; + } + + /** + * Get the iops property: <p>Specifies the baseline input/output (I/O) performance of EBS volumes attached to + * data nodes. Applicable only for the <code>gp3</code> and provisioned IOPS EBS volume + * types.</p>. + * + * @return the iops value. + */ + public Integer iops() { + return this.iops; + } + + /** + * Set the iops property: <p>Specifies the baseline input/output (I/O) performance of EBS volumes attached to + * data nodes. Applicable only for the <code>gp3</code> and provisioned IOPS EBS volume + * types.</p>. + * + * @param iops the iops value to set. + * @return the EbsOptions object itself. + */ + public EbsOptions withIops(Integer iops) { + this.iops = iops; + return this; + } + + /** + * Get the throughput property: <p>Specifies the throughput (in MiB/s) of the EBS volumes attached to data + * nodes. Applicable only for the <code>gp3</code> volume type.</p>. + * + * @return the throughput value. + */ + public Integer throughput() { + return this.throughput; + } + + /** + * Set the throughput property: <p>Specifies the throughput (in MiB/s) of the EBS volumes attached to data + * nodes. Applicable only for the <code>gp3</code> volume type.</p>. + * + * @param throughput the throughput value to set. + * @return the EbsOptions object itself. + */ + public EbsOptions withThroughput(Integer throughput) { + this.throughput = throughput; + return this; + } + + /** + * Get the volumeSize property: <p>Specifies the size (in GiB) of EBS volumes attached to data + * nodes.</p>. + * + * @return the volumeSize value. + */ + public Integer volumeSize() { + return this.volumeSize; + } + + /** + * Set the volumeSize property: <p>Specifies the size (in GiB) of EBS volumes attached to data + * nodes.</p>. + * + * @param volumeSize the volumeSize value to set. + * @return the EbsOptions object itself. + */ + public EbsOptions withVolumeSize(Integer volumeSize) { + this.volumeSize = volumeSize; + return this; + } + + /** + * Get the volumeType property: <p>Specifies the type of EBS volumes attached to data nodes.</p>. + * + * @return the volumeType value. + */ + public VolumeTypeEnumValue volumeType() { + return this.volumeType; + } + + /** + * Set the volumeType property: <p>Specifies the type of EBS volumes attached to data nodes.</p>. + * + * @param volumeType the volumeType value to set. + * @return the EbsOptions object itself. + */ + public EbsOptions withVolumeType(VolumeTypeEnumValue volumeType) { + this.volumeType = volumeType; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (volumeType() != null) { + volumeType().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeBooleanField("ebsEnabled", this.ebsEnabled); + jsonWriter.writeNumberField("iops", this.iops); + jsonWriter.writeNumberField("throughput", this.throughput); + jsonWriter.writeNumberField("volumeSize", this.volumeSize); + jsonWriter.writeJsonField("volumeType", this.volumeType); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of EbsOptions from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of EbsOptions if the JsonReader was pointing to an instance of it, or null if it was pointing + * to JSON null. + * @throws IOException If an error occurs while reading the EbsOptions. + */ + public static EbsOptions fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + EbsOptions deserializedEbsOptions = new EbsOptions(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("ebsEnabled".equals(fieldName)) { + deserializedEbsOptions.ebsEnabled = reader.getNullable(JsonReader::getBoolean); + } else if ("iops".equals(fieldName)) { + deserializedEbsOptions.iops = reader.getNullable(JsonReader::getInt); + } else if ("throughput".equals(fieldName)) { + deserializedEbsOptions.throughput = reader.getNullable(JsonReader::getInt); + } else if ("volumeSize".equals(fieldName)) { + deserializedEbsOptions.volumeSize = reader.getNullable(JsonReader::getInt); + } else if ("volumeType".equals(fieldName)) { + deserializedEbsOptions.volumeType = VolumeTypeEnumValue.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedEbsOptions; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/EbsTagSpecification.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/EbsTagSpecification.java new file mode 100644 index 000000000000..edee5a8318c0 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/EbsTagSpecification.java @@ -0,0 +1,167 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Definition of EBSTagSpecification. + */ +@Fluent +public final class EbsTagSpecification implements JsonSerializable { + /* + * Determines whether to propagate the tags from the task definition to + * the Amazon EBS volume. Tags can only propagate to a ``SERVICE`` specified in + * ``ServiceVolumeConfiguration``. If no value is specified, the tags aren't + * propagated. + */ + private EbsTagSpecificationPropagateTags propagateTags; + + /* + * The type of volume resource. + */ + private String resourceType; + + /* + * The tags applied to this Amazon EBS volume. ``AmazonECSCreated`` and ``AmazonECSManaged`` are reserved tags that + * can't be used. + */ + private List tags; + + /** + * Creates an instance of EbsTagSpecification class. + */ + public EbsTagSpecification() { + } + + /** + * Get the propagateTags property: Determines whether to propagate the tags from the task definition to + * the Amazon EBS volume. Tags can only propagate to a ``SERVICE`` specified in + * ``ServiceVolumeConfiguration``. If no value is specified, the tags aren't + * propagated. + * + * @return the propagateTags value. + */ + public EbsTagSpecificationPropagateTags propagateTags() { + return this.propagateTags; + } + + /** + * Set the propagateTags property: Determines whether to propagate the tags from the task definition to + * the Amazon EBS volume. Tags can only propagate to a ``SERVICE`` specified in + * ``ServiceVolumeConfiguration``. If no value is specified, the tags aren't + * propagated. + * + * @param propagateTags the propagateTags value to set. + * @return the EbsTagSpecification object itself. + */ + public EbsTagSpecification withPropagateTags(EbsTagSpecificationPropagateTags propagateTags) { + this.propagateTags = propagateTags; + return this; + } + + /** + * Get the resourceType property: The type of volume resource. + * + * @return the resourceType value. + */ + public String resourceType() { + return this.resourceType; + } + + /** + * Set the resourceType property: The type of volume resource. + * + * @param resourceType the resourceType value to set. + * @return the EbsTagSpecification object itself. + */ + public EbsTagSpecification withResourceType(String resourceType) { + this.resourceType = resourceType; + return this; + } + + /** + * Get the tags property: The tags applied to this Amazon EBS volume. ``AmazonECSCreated`` and ``AmazonECSManaged`` + * are reserved tags that can't be used. + * + * @return the tags value. + */ + public List tags() { + return this.tags; + } + + /** + * Set the tags property: The tags applied to this Amazon EBS volume. ``AmazonECSCreated`` and ``AmazonECSManaged`` + * are reserved tags that can't be used. + * + * @param tags the tags value to set. + * @return the EbsTagSpecification object itself. + */ + public EbsTagSpecification withTags(List tags) { + this.tags = tags; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (tags() != null) { + tags().forEach(e -> e.validate()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("propagateTags", this.propagateTags == null ? null : this.propagateTags.toString()); + jsonWriter.writeStringField("resourceType", this.resourceType); + jsonWriter.writeArrayField("tags", this.tags, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of EbsTagSpecification from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of EbsTagSpecification if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the EbsTagSpecification. + */ + public static EbsTagSpecification fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + EbsTagSpecification deserializedEbsTagSpecification = new EbsTagSpecification(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("propagateTags".equals(fieldName)) { + deserializedEbsTagSpecification.propagateTags + = EbsTagSpecificationPropagateTags.fromString(reader.getString()); + } else if ("resourceType".equals(fieldName)) { + deserializedEbsTagSpecification.resourceType = reader.getString(); + } else if ("tags".equals(fieldName)) { + List tags = reader.readArray(reader1 -> TagAutoGenerated26.fromJson(reader1)); + deserializedEbsTagSpecification.tags = tags; + } else { + reader.skipChildren(); + } + } + + return deserializedEbsTagSpecification; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/EbsTagSpecificationPropagateTags.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/EbsTagSpecificationPropagateTags.java new file mode 100644 index 000000000000..6dd2d828254a --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/EbsTagSpecificationPropagateTags.java @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * EBSTagSpecificationPropagateTags enum. + */ +public final class EbsTagSpecificationPropagateTags extends ExpandableStringEnum { + /** + * Static value SERVICE for EbsTagSpecificationPropagateTags. + */ + public static final EbsTagSpecificationPropagateTags SERVICE = fromString("SERVICE"); + + /** + * Static value TASK_DEFINITION for EbsTagSpecificationPropagateTags. + */ + public static final EbsTagSpecificationPropagateTags TASK_DEFINITION = fromString("TASK_DEFINITION"); + + /** + * Creates a new instance of EbsTagSpecificationPropagateTags value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public EbsTagSpecificationPropagateTags() { + } + + /** + * Creates or finds a EbsTagSpecificationPropagateTags from its string representation. + * + * @param name a name to look for. + * @return the corresponding EbsTagSpecificationPropagateTags. + */ + public static EbsTagSpecificationPropagateTags fromString(String name) { + return fromString(name, EbsTagSpecificationPropagateTags.class); + } + + /** + * Gets known EbsTagSpecificationPropagateTags values. + * + * @return known EbsTagSpecificationPropagateTags values. + */ + public static Collection values() { + return values(EbsTagSpecificationPropagateTags.class); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/Ec2AccountAttribute.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/Ec2AccountAttribute.java new file mode 100644 index 000000000000..18cbb0bf5ac7 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/Ec2AccountAttribute.java @@ -0,0 +1,252 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.awsconnector.fluent.models.Ec2AccountAttributeInner; +import java.util.Map; + +/** + * An immutable client-side representation of Ec2AccountAttribute. + */ +public interface Ec2AccountAttribute { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the location property: The geo-location where the resource lives. + * + * @return the location value. + */ + String location(); + + /** + * Gets the tags property: Resource tags. + * + * @return the tags value. + */ + Map tags(); + + /** + * Gets the properties property: The resource-specific properties for this resource. + * + * @return the properties value. + */ + Ec2AccountAttributeProperties properties(); + + /** + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the region of the resource. + * + * @return the region of the resource. + */ + Region region(); + + /** + * Gets the name of the resource region. + * + * @return the name of the resource region. + */ + String regionName(); + + /** + * Gets the name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + + /** + * Gets the inner com.azure.resourcemanager.awsconnector.fluent.models.Ec2AccountAttributeInner object. + * + * @return the inner object. + */ + Ec2AccountAttributeInner innerModel(); + + /** + * The entirety of the Ec2AccountAttribute definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithLocation, + DefinitionStages.WithResourceGroup, DefinitionStages.WithCreate { + } + + /** + * The Ec2AccountAttribute definition stages. + */ + interface DefinitionStages { + /** + * The first stage of the Ec2AccountAttribute definition. + */ + interface Blank extends WithLocation { + } + + /** + * The stage of the Ec2AccountAttribute definition allowing to specify location. + */ + interface WithLocation { + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithResourceGroup withRegion(Region location); + + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithResourceGroup withRegion(String location); + } + + /** + * The stage of the Ec2AccountAttribute definition allowing to specify parent resource. + */ + interface WithResourceGroup { + /** + * Specifies resourceGroupName. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @return the next definition stage. + */ + WithCreate withExistingResourceGroup(String resourceGroupName); + } + + /** + * The stage of the Ec2AccountAttribute 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.WithProperties { + /** + * Executes the create request. + * + * @return the created resource. + */ + Ec2AccountAttribute create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + Ec2AccountAttribute create(Context context); + } + + /** + * The stage of the Ec2AccountAttribute definition allowing to specify tags. + */ + interface WithTags { + /** + * Specifies the tags property: Resource tags.. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + WithCreate withTags(Map tags); + } + + /** + * The stage of the Ec2AccountAttribute definition allowing to specify properties. + */ + interface WithProperties { + /** + * Specifies the properties property: The resource-specific properties for this resource.. + * + * @param properties The resource-specific properties for this resource. + * @return the next definition stage. + */ + WithCreate withProperties(Ec2AccountAttributeProperties properties); + } + } + + /** + * Begins update for the Ec2AccountAttribute resource. + * + * @return the stage of resource update. + */ + Ec2AccountAttribute.Update update(); + + /** + * The template for Ec2AccountAttribute update. + */ + interface Update extends UpdateStages.WithTags { + /** + * Executes the update request. + * + * @return the updated resource. + */ + Ec2AccountAttribute apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + Ec2AccountAttribute apply(Context context); + } + + /** + * The Ec2AccountAttribute update stages. + */ + interface UpdateStages { + /** + * The stage of the Ec2AccountAttribute update allowing to specify tags. + */ + interface WithTags { + /** + * Specifies the tags property: Resource tags.. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + Update withTags(Map tags); + } + } + + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + Ec2AccountAttribute refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + Ec2AccountAttribute refresh(Context context); +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/Ec2AccountAttributeListResult.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/Ec2AccountAttributeListResult.java new file mode 100644 index 000000000000..b27542802734 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/Ec2AccountAttributeListResult.java @@ -0,0 +1,137 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.awsconnector.fluent.models.Ec2AccountAttributeInner; +import java.io.IOException; +import java.util.List; + +/** + * The response of a Ec2AccountAttribute list operation. + */ +@Fluent +public final class Ec2AccountAttributeListResult implements JsonSerializable { + /* + * The Ec2AccountAttribute items on this page + */ + private List value; + + /* + * The link to the next page of items + */ + private String nextLink; + + /** + * Creates an instance of Ec2AccountAttributeListResult class. + */ + public Ec2AccountAttributeListResult() { + } + + /** + * Get the value property: The Ec2AccountAttribute items on this page. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The Ec2AccountAttribute items on this page. + * + * @param value the value value to set. + * @return the Ec2AccountAttributeListResult object itself. + */ + public Ec2AccountAttributeListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The link to the next page of items. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: The link to the next page of items. + * + * @param nextLink the nextLink value to set. + * @return the Ec2AccountAttributeListResult object itself. + */ + public Ec2AccountAttributeListResult withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property value in model Ec2AccountAttributeListResult")); + } else { + value().forEach(e -> e.validate()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(Ec2AccountAttributeListResult.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("nextLink", this.nextLink); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of Ec2AccountAttributeListResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of Ec2AccountAttributeListResult if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the Ec2AccountAttributeListResult. + */ + public static Ec2AccountAttributeListResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + Ec2AccountAttributeListResult deserializedEc2AccountAttributeListResult + = new Ec2AccountAttributeListResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> Ec2AccountAttributeInner.fromJson(reader1)); + deserializedEc2AccountAttributeListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedEc2AccountAttributeListResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedEc2AccountAttributeListResult; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/Ec2AccountAttributeProperties.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/Ec2AccountAttributeProperties.java new file mode 100644 index 000000000000..2d40de438f0f --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/Ec2AccountAttributeProperties.java @@ -0,0 +1,313 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.Map; + +/** + * Definition of Ec2AccountAttribute. + */ +@Fluent +public final class Ec2AccountAttributeProperties implements JsonSerializable { + /* + * AWS Properties + */ + private AwsEc2AccountAttributeProperties awsProperties; + + /* + * Public Cloud Connectors Resource ID + */ + private String publicCloudConnectorsResourceId; + + /* + * AWS Account ID + */ + private String awsAccountId; + + /* + * Amazon Resource Name (ARN) + */ + private String arn; + + /* + * Public Cloud Resource Name + */ + private String publicCloudResourceName; + + /* + * AWS Source Schema + */ + private String awsSourceSchema; + + /* + * AWS Region + */ + private String awsRegion; + + /* + * AWS Tags + */ + private Map awsTags; + + /* + * The status of the last operation. + */ + private ProvisioningState provisioningState; + + /** + * Creates an instance of Ec2AccountAttributeProperties class. + */ + public Ec2AccountAttributeProperties() { + } + + /** + * Get the awsProperties property: AWS Properties. + * + * @return the awsProperties value. + */ + public AwsEc2AccountAttributeProperties awsProperties() { + return this.awsProperties; + } + + /** + * Set the awsProperties property: AWS Properties. + * + * @param awsProperties the awsProperties value to set. + * @return the Ec2AccountAttributeProperties object itself. + */ + public Ec2AccountAttributeProperties withAwsProperties(AwsEc2AccountAttributeProperties awsProperties) { + this.awsProperties = awsProperties; + return this; + } + + /** + * Get the publicCloudConnectorsResourceId property: Public Cloud Connectors Resource ID. + * + * @return the publicCloudConnectorsResourceId value. + */ + public String publicCloudConnectorsResourceId() { + return this.publicCloudConnectorsResourceId; + } + + /** + * Set the publicCloudConnectorsResourceId property: Public Cloud Connectors Resource ID. + * + * @param publicCloudConnectorsResourceId the publicCloudConnectorsResourceId value to set. + * @return the Ec2AccountAttributeProperties object itself. + */ + public Ec2AccountAttributeProperties withPublicCloudConnectorsResourceId(String publicCloudConnectorsResourceId) { + this.publicCloudConnectorsResourceId = publicCloudConnectorsResourceId; + return this; + } + + /** + * Get the awsAccountId property: AWS Account ID. + * + * @return the awsAccountId value. + */ + public String awsAccountId() { + return this.awsAccountId; + } + + /** + * Set the awsAccountId property: AWS Account ID. + * + * @param awsAccountId the awsAccountId value to set. + * @return the Ec2AccountAttributeProperties object itself. + */ + public Ec2AccountAttributeProperties withAwsAccountId(String awsAccountId) { + this.awsAccountId = awsAccountId; + return this; + } + + /** + * Get the arn property: Amazon Resource Name (ARN). + * + * @return the arn value. + */ + public String arn() { + return this.arn; + } + + /** + * Set the arn property: Amazon Resource Name (ARN). + * + * @param arn the arn value to set. + * @return the Ec2AccountAttributeProperties object itself. + */ + public Ec2AccountAttributeProperties withArn(String arn) { + this.arn = arn; + return this; + } + + /** + * Get the publicCloudResourceName property: Public Cloud Resource Name. + * + * @return the publicCloudResourceName value. + */ + public String publicCloudResourceName() { + return this.publicCloudResourceName; + } + + /** + * Set the publicCloudResourceName property: Public Cloud Resource Name. + * + * @param publicCloudResourceName the publicCloudResourceName value to set. + * @return the Ec2AccountAttributeProperties object itself. + */ + public Ec2AccountAttributeProperties withPublicCloudResourceName(String publicCloudResourceName) { + this.publicCloudResourceName = publicCloudResourceName; + return this; + } + + /** + * Get the awsSourceSchema property: AWS Source Schema. + * + * @return the awsSourceSchema value. + */ + public String awsSourceSchema() { + return this.awsSourceSchema; + } + + /** + * Set the awsSourceSchema property: AWS Source Schema. + * + * @param awsSourceSchema the awsSourceSchema value to set. + * @return the Ec2AccountAttributeProperties object itself. + */ + public Ec2AccountAttributeProperties withAwsSourceSchema(String awsSourceSchema) { + this.awsSourceSchema = awsSourceSchema; + return this; + } + + /** + * Get the awsRegion property: AWS Region. + * + * @return the awsRegion value. + */ + public String awsRegion() { + return this.awsRegion; + } + + /** + * Set the awsRegion property: AWS Region. + * + * @param awsRegion the awsRegion value to set. + * @return the Ec2AccountAttributeProperties object itself. + */ + public Ec2AccountAttributeProperties withAwsRegion(String awsRegion) { + this.awsRegion = awsRegion; + return this; + } + + /** + * Get the awsTags property: AWS Tags. + * + * @return the awsTags value. + */ + public Map awsTags() { + return this.awsTags; + } + + /** + * Set the awsTags property: AWS Tags. + * + * @param awsTags the awsTags value to set. + * @return the Ec2AccountAttributeProperties object itself. + */ + public Ec2AccountAttributeProperties withAwsTags(Map awsTags) { + this.awsTags = awsTags; + return this; + } + + /** + * Get the provisioningState property: The status of the last operation. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (awsProperties() != null) { + awsProperties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("awsProperties", this.awsProperties); + jsonWriter.writeStringField("publicCloudConnectorsResourceId", this.publicCloudConnectorsResourceId); + jsonWriter.writeStringField("awsAccountId", this.awsAccountId); + jsonWriter.writeStringField("arn", this.arn); + jsonWriter.writeStringField("publicCloudResourceName", this.publicCloudResourceName); + jsonWriter.writeStringField("awsSourceSchema", this.awsSourceSchema); + jsonWriter.writeStringField("awsRegion", this.awsRegion); + jsonWriter.writeMapField("awsTags", this.awsTags, (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of Ec2AccountAttributeProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of Ec2AccountAttributeProperties if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the Ec2AccountAttributeProperties. + */ + public static Ec2AccountAttributeProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + Ec2AccountAttributeProperties deserializedEc2AccountAttributeProperties + = new Ec2AccountAttributeProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("awsProperties".equals(fieldName)) { + deserializedEc2AccountAttributeProperties.awsProperties + = AwsEc2AccountAttributeProperties.fromJson(reader); + } else if ("publicCloudConnectorsResourceId".equals(fieldName)) { + deserializedEc2AccountAttributeProperties.publicCloudConnectorsResourceId = reader.getString(); + } else if ("awsAccountId".equals(fieldName)) { + deserializedEc2AccountAttributeProperties.awsAccountId = reader.getString(); + } else if ("arn".equals(fieldName)) { + deserializedEc2AccountAttributeProperties.arn = reader.getString(); + } else if ("publicCloudResourceName".equals(fieldName)) { + deserializedEc2AccountAttributeProperties.publicCloudResourceName = reader.getString(); + } else if ("awsSourceSchema".equals(fieldName)) { + deserializedEc2AccountAttributeProperties.awsSourceSchema = reader.getString(); + } else if ("awsRegion".equals(fieldName)) { + deserializedEc2AccountAttributeProperties.awsRegion = reader.getString(); + } else if ("awsTags".equals(fieldName)) { + Map awsTags = reader.readMap(reader1 -> reader1.getString()); + deserializedEc2AccountAttributeProperties.awsTags = awsTags; + } else if ("provisioningState".equals(fieldName)) { + deserializedEc2AccountAttributeProperties.provisioningState + = ProvisioningState.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedEc2AccountAttributeProperties; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/Ec2AccountAttributeTagsUpdate.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/Ec2AccountAttributeTagsUpdate.java new file mode 100644 index 000000000000..5d91f17ecc65 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/Ec2AccountAttributeTagsUpdate.java @@ -0,0 +1,96 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.Map; + +/** + * The type used for updating tags in Ec2AccountAttribute resources. + */ +@Fluent +public final class Ec2AccountAttributeTagsUpdate implements JsonSerializable { + /* + * Resource tags. + */ + private Map tags; + + /** + * Creates an instance of Ec2AccountAttributeTagsUpdate class. + */ + public Ec2AccountAttributeTagsUpdate() { + } + + /** + * Get the tags property: Resource tags. + * + * @return the tags value. + */ + public Map tags() { + return this.tags; + } + + /** + * Set the tags property: Resource tags. + * + * @param tags the tags value to set. + * @return the Ec2AccountAttributeTagsUpdate object itself. + */ + public Ec2AccountAttributeTagsUpdate withTags(Map tags) { + this.tags = tags; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeMapField("tags", this.tags, (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of Ec2AccountAttributeTagsUpdate from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of Ec2AccountAttributeTagsUpdate if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the Ec2AccountAttributeTagsUpdate. + */ + public static Ec2AccountAttributeTagsUpdate fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + Ec2AccountAttributeTagsUpdate deserializedEc2AccountAttributeTagsUpdate + = new Ec2AccountAttributeTagsUpdate(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedEc2AccountAttributeTagsUpdate.tags = tags; + } else { + reader.skipChildren(); + } + } + + return deserializedEc2AccountAttributeTagsUpdate; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/Ec2AccountAttributes.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/Ec2AccountAttributes.java new file mode 100644 index 000000000000..930789c5a52b --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/Ec2AccountAttributes.java @@ -0,0 +1,158 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** + * Resource collection API of Ec2AccountAttributes. + */ +public interface Ec2AccountAttributes { + /** + * List Ec2AccountAttribute resources by subscription ID. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Ec2AccountAttribute list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable list(); + + /** + * List Ec2AccountAttribute resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Ec2AccountAttribute list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable list(Context context); + + /** + * List Ec2AccountAttribute resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Ec2AccountAttribute list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * List Ec2AccountAttribute resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Ec2AccountAttribute list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Get a Ec2AccountAttribute. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2AccountAttribute. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Ec2AccountAttribute along with {@link Response}. + */ + Response getByResourceGroupWithResponse(String resourceGroupName, String name, + Context context); + + /** + * Get a Ec2AccountAttribute. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2AccountAttribute. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Ec2AccountAttribute. + */ + Ec2AccountAttribute getByResourceGroup(String resourceGroupName, String name); + + /** + * Delete a Ec2AccountAttribute. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2AccountAttribute. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByResourceGroup(String resourceGroupName, String name); + + /** + * Delete a Ec2AccountAttribute. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2AccountAttribute. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String name, Context context); + + /** + * Get a Ec2AccountAttribute. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Ec2AccountAttribute along with {@link Response}. + */ + Ec2AccountAttribute getById(String id); + + /** + * Get a Ec2AccountAttribute. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Ec2AccountAttribute along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Delete a Ec2AccountAttribute. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteById(String id); + + /** + * Delete a Ec2AccountAttribute. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new Ec2AccountAttribute resource. + * + * @param name resource name. + * @return the first stage of the new Ec2AccountAttribute definition. + */ + Ec2AccountAttribute.DefinitionStages.Blank define(String name); +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/Ec2Address.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/Ec2Address.java new file mode 100644 index 000000000000..cf7b7c18e46e --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/Ec2Address.java @@ -0,0 +1,252 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.awsconnector.fluent.models.Ec2AddressInner; +import java.util.Map; + +/** + * An immutable client-side representation of Ec2Address. + */ +public interface Ec2Address { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the location property: The geo-location where the resource lives. + * + * @return the location value. + */ + String location(); + + /** + * Gets the tags property: Resource tags. + * + * @return the tags value. + */ + Map tags(); + + /** + * Gets the properties property: The resource-specific properties for this resource. + * + * @return the properties value. + */ + Ec2AddressProperties properties(); + + /** + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the region of the resource. + * + * @return the region of the resource. + */ + Region region(); + + /** + * Gets the name of the resource region. + * + * @return the name of the resource region. + */ + String regionName(); + + /** + * Gets the name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + + /** + * Gets the inner com.azure.resourcemanager.awsconnector.fluent.models.Ec2AddressInner object. + * + * @return the inner object. + */ + Ec2AddressInner innerModel(); + + /** + * The entirety of the Ec2Address definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithLocation, + DefinitionStages.WithResourceGroup, DefinitionStages.WithCreate { + } + + /** + * The Ec2Address definition stages. + */ + interface DefinitionStages { + /** + * The first stage of the Ec2Address definition. + */ + interface Blank extends WithLocation { + } + + /** + * The stage of the Ec2Address definition allowing to specify location. + */ + interface WithLocation { + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithResourceGroup withRegion(Region location); + + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithResourceGroup withRegion(String location); + } + + /** + * The stage of the Ec2Address definition allowing to specify parent resource. + */ + interface WithResourceGroup { + /** + * Specifies resourceGroupName. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @return the next definition stage. + */ + WithCreate withExistingResourceGroup(String resourceGroupName); + } + + /** + * The stage of the Ec2Address 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.WithProperties { + /** + * Executes the create request. + * + * @return the created resource. + */ + Ec2Address create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + Ec2Address create(Context context); + } + + /** + * The stage of the Ec2Address definition allowing to specify tags. + */ + interface WithTags { + /** + * Specifies the tags property: Resource tags.. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + WithCreate withTags(Map tags); + } + + /** + * The stage of the Ec2Address definition allowing to specify properties. + */ + interface WithProperties { + /** + * Specifies the properties property: The resource-specific properties for this resource.. + * + * @param properties The resource-specific properties for this resource. + * @return the next definition stage. + */ + WithCreate withProperties(Ec2AddressProperties properties); + } + } + + /** + * Begins update for the Ec2Address resource. + * + * @return the stage of resource update. + */ + Ec2Address.Update update(); + + /** + * The template for Ec2Address update. + */ + interface Update extends UpdateStages.WithTags { + /** + * Executes the update request. + * + * @return the updated resource. + */ + Ec2Address apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + Ec2Address apply(Context context); + } + + /** + * The Ec2Address update stages. + */ + interface UpdateStages { + /** + * The stage of the Ec2Address update allowing to specify tags. + */ + interface WithTags { + /** + * Specifies the tags property: Resource tags.. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + Update withTags(Map tags); + } + } + + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + Ec2Address refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + Ec2Address refresh(Context context); +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/Ec2AddressListResult.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/Ec2AddressListResult.java new file mode 100644 index 000000000000..fbf155bd3a8e --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/Ec2AddressListResult.java @@ -0,0 +1,134 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.awsconnector.fluent.models.Ec2AddressInner; +import java.io.IOException; +import java.util.List; + +/** + * The response of a Ec2Address list operation. + */ +@Fluent +public final class Ec2AddressListResult implements JsonSerializable { + /* + * The Ec2Address items on this page + */ + private List value; + + /* + * The link to the next page of items + */ + private String nextLink; + + /** + * Creates an instance of Ec2AddressListResult class. + */ + public Ec2AddressListResult() { + } + + /** + * Get the value property: The Ec2Address items on this page. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The Ec2Address items on this page. + * + * @param value the value value to set. + * @return the Ec2AddressListResult object itself. + */ + public Ec2AddressListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The link to the next page of items. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: The link to the next page of items. + * + * @param nextLink the nextLink value to set. + * @return the Ec2AddressListResult object itself. + */ + public Ec2AddressListResult withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property value in model Ec2AddressListResult")); + } else { + value().forEach(e -> e.validate()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(Ec2AddressListResult.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("nextLink", this.nextLink); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of Ec2AddressListResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of Ec2AddressListResult if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the Ec2AddressListResult. + */ + public static Ec2AddressListResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + Ec2AddressListResult deserializedEc2AddressListResult = new Ec2AddressListResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value = reader.readArray(reader1 -> Ec2AddressInner.fromJson(reader1)); + deserializedEc2AddressListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedEc2AddressListResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedEc2AddressListResult; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/Ec2AddressProperties.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/Ec2AddressProperties.java new file mode 100644 index 000000000000..cf99b6681b48 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/Ec2AddressProperties.java @@ -0,0 +1,311 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.Map; + +/** + * Definition of Ec2Address. + */ +@Fluent +public final class Ec2AddressProperties implements JsonSerializable { + /* + * AWS Properties + */ + private AwsEc2AddressProperties awsProperties; + + /* + * Public Cloud Connectors Resource ID + */ + private String publicCloudConnectorsResourceId; + + /* + * AWS Account ID + */ + private String awsAccountId; + + /* + * Amazon Resource Name (ARN) + */ + private String arn; + + /* + * Public Cloud Resource Name + */ + private String publicCloudResourceName; + + /* + * AWS Source Schema + */ + private String awsSourceSchema; + + /* + * AWS Region + */ + private String awsRegion; + + /* + * AWS Tags + */ + private Map awsTags; + + /* + * The status of the last operation. + */ + private ProvisioningState provisioningState; + + /** + * Creates an instance of Ec2AddressProperties class. + */ + public Ec2AddressProperties() { + } + + /** + * Get the awsProperties property: AWS Properties. + * + * @return the awsProperties value. + */ + public AwsEc2AddressProperties awsProperties() { + return this.awsProperties; + } + + /** + * Set the awsProperties property: AWS Properties. + * + * @param awsProperties the awsProperties value to set. + * @return the Ec2AddressProperties object itself. + */ + public Ec2AddressProperties withAwsProperties(AwsEc2AddressProperties awsProperties) { + this.awsProperties = awsProperties; + return this; + } + + /** + * Get the publicCloudConnectorsResourceId property: Public Cloud Connectors Resource ID. + * + * @return the publicCloudConnectorsResourceId value. + */ + public String publicCloudConnectorsResourceId() { + return this.publicCloudConnectorsResourceId; + } + + /** + * Set the publicCloudConnectorsResourceId property: Public Cloud Connectors Resource ID. + * + * @param publicCloudConnectorsResourceId the publicCloudConnectorsResourceId value to set. + * @return the Ec2AddressProperties object itself. + */ + public Ec2AddressProperties withPublicCloudConnectorsResourceId(String publicCloudConnectorsResourceId) { + this.publicCloudConnectorsResourceId = publicCloudConnectorsResourceId; + return this; + } + + /** + * Get the awsAccountId property: AWS Account ID. + * + * @return the awsAccountId value. + */ + public String awsAccountId() { + return this.awsAccountId; + } + + /** + * Set the awsAccountId property: AWS Account ID. + * + * @param awsAccountId the awsAccountId value to set. + * @return the Ec2AddressProperties object itself. + */ + public Ec2AddressProperties withAwsAccountId(String awsAccountId) { + this.awsAccountId = awsAccountId; + return this; + } + + /** + * Get the arn property: Amazon Resource Name (ARN). + * + * @return the arn value. + */ + public String arn() { + return this.arn; + } + + /** + * Set the arn property: Amazon Resource Name (ARN). + * + * @param arn the arn value to set. + * @return the Ec2AddressProperties object itself. + */ + public Ec2AddressProperties withArn(String arn) { + this.arn = arn; + return this; + } + + /** + * Get the publicCloudResourceName property: Public Cloud Resource Name. + * + * @return the publicCloudResourceName value. + */ + public String publicCloudResourceName() { + return this.publicCloudResourceName; + } + + /** + * Set the publicCloudResourceName property: Public Cloud Resource Name. + * + * @param publicCloudResourceName the publicCloudResourceName value to set. + * @return the Ec2AddressProperties object itself. + */ + public Ec2AddressProperties withPublicCloudResourceName(String publicCloudResourceName) { + this.publicCloudResourceName = publicCloudResourceName; + return this; + } + + /** + * Get the awsSourceSchema property: AWS Source Schema. + * + * @return the awsSourceSchema value. + */ + public String awsSourceSchema() { + return this.awsSourceSchema; + } + + /** + * Set the awsSourceSchema property: AWS Source Schema. + * + * @param awsSourceSchema the awsSourceSchema value to set. + * @return the Ec2AddressProperties object itself. + */ + public Ec2AddressProperties withAwsSourceSchema(String awsSourceSchema) { + this.awsSourceSchema = awsSourceSchema; + return this; + } + + /** + * Get the awsRegion property: AWS Region. + * + * @return the awsRegion value. + */ + public String awsRegion() { + return this.awsRegion; + } + + /** + * Set the awsRegion property: AWS Region. + * + * @param awsRegion the awsRegion value to set. + * @return the Ec2AddressProperties object itself. + */ + public Ec2AddressProperties withAwsRegion(String awsRegion) { + this.awsRegion = awsRegion; + return this; + } + + /** + * Get the awsTags property: AWS Tags. + * + * @return the awsTags value. + */ + public Map awsTags() { + return this.awsTags; + } + + /** + * Set the awsTags property: AWS Tags. + * + * @param awsTags the awsTags value to set. + * @return the Ec2AddressProperties object itself. + */ + public Ec2AddressProperties withAwsTags(Map awsTags) { + this.awsTags = awsTags; + return this; + } + + /** + * Get the provisioningState property: The status of the last operation. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (awsProperties() != null) { + awsProperties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("awsProperties", this.awsProperties); + jsonWriter.writeStringField("publicCloudConnectorsResourceId", this.publicCloudConnectorsResourceId); + jsonWriter.writeStringField("awsAccountId", this.awsAccountId); + jsonWriter.writeStringField("arn", this.arn); + jsonWriter.writeStringField("publicCloudResourceName", this.publicCloudResourceName); + jsonWriter.writeStringField("awsSourceSchema", this.awsSourceSchema); + jsonWriter.writeStringField("awsRegion", this.awsRegion); + jsonWriter.writeMapField("awsTags", this.awsTags, (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of Ec2AddressProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of Ec2AddressProperties if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the Ec2AddressProperties. + */ + public static Ec2AddressProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + Ec2AddressProperties deserializedEc2AddressProperties = new Ec2AddressProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("awsProperties".equals(fieldName)) { + deserializedEc2AddressProperties.awsProperties = AwsEc2AddressProperties.fromJson(reader); + } else if ("publicCloudConnectorsResourceId".equals(fieldName)) { + deserializedEc2AddressProperties.publicCloudConnectorsResourceId = reader.getString(); + } else if ("awsAccountId".equals(fieldName)) { + deserializedEc2AddressProperties.awsAccountId = reader.getString(); + } else if ("arn".equals(fieldName)) { + deserializedEc2AddressProperties.arn = reader.getString(); + } else if ("publicCloudResourceName".equals(fieldName)) { + deserializedEc2AddressProperties.publicCloudResourceName = reader.getString(); + } else if ("awsSourceSchema".equals(fieldName)) { + deserializedEc2AddressProperties.awsSourceSchema = reader.getString(); + } else if ("awsRegion".equals(fieldName)) { + deserializedEc2AddressProperties.awsRegion = reader.getString(); + } else if ("awsTags".equals(fieldName)) { + Map awsTags = reader.readMap(reader1 -> reader1.getString()); + deserializedEc2AddressProperties.awsTags = awsTags; + } else if ("provisioningState".equals(fieldName)) { + deserializedEc2AddressProperties.provisioningState + = ProvisioningState.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedEc2AddressProperties; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/Ec2AddressTagsUpdate.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/Ec2AddressTagsUpdate.java new file mode 100644 index 000000000000..6d541d8f4454 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/Ec2AddressTagsUpdate.java @@ -0,0 +1,95 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.Map; + +/** + * The type used for updating tags in Ec2Address resources. + */ +@Fluent +public final class Ec2AddressTagsUpdate implements JsonSerializable { + /* + * Resource tags. + */ + private Map tags; + + /** + * Creates an instance of Ec2AddressTagsUpdate class. + */ + public Ec2AddressTagsUpdate() { + } + + /** + * Get the tags property: Resource tags. + * + * @return the tags value. + */ + public Map tags() { + return this.tags; + } + + /** + * Set the tags property: Resource tags. + * + * @param tags the tags value to set. + * @return the Ec2AddressTagsUpdate object itself. + */ + public Ec2AddressTagsUpdate withTags(Map tags) { + this.tags = tags; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeMapField("tags", this.tags, (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of Ec2AddressTagsUpdate from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of Ec2AddressTagsUpdate if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the Ec2AddressTagsUpdate. + */ + public static Ec2AddressTagsUpdate fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + Ec2AddressTagsUpdate deserializedEc2AddressTagsUpdate = new Ec2AddressTagsUpdate(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedEc2AddressTagsUpdate.tags = tags; + } else { + reader.skipChildren(); + } + } + + return deserializedEc2AddressTagsUpdate; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/Ec2Addresses.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/Ec2Addresses.java new file mode 100644 index 000000000000..e88e72806419 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/Ec2Addresses.java @@ -0,0 +1,157 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** + * Resource collection API of Ec2Addresses. + */ +public interface Ec2Addresses { + /** + * List Ec2Address resources by subscription ID. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Ec2Address list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable list(); + + /** + * List Ec2Address resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Ec2Address list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable list(Context context); + + /** + * List Ec2Address resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Ec2Address list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * List Ec2Address resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Ec2Address list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Get a Ec2Address. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2Address. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Ec2Address along with {@link Response}. + */ + Response getByResourceGroupWithResponse(String resourceGroupName, String name, Context context); + + /** + * Get a Ec2Address. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2Address. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Ec2Address. + */ + Ec2Address getByResourceGroup(String resourceGroupName, String name); + + /** + * Delete a Ec2Address. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2Address. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByResourceGroup(String resourceGroupName, String name); + + /** + * Delete a Ec2Address. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2Address. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String name, Context context); + + /** + * Get a Ec2Address. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Ec2Address along with {@link Response}. + */ + Ec2Address getById(String id); + + /** + * Get a Ec2Address. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Ec2Address along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Delete a Ec2Address. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteById(String id); + + /** + * Delete a Ec2Address. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new Ec2Address resource. + * + * @param name resource name. + * @return the first stage of the new Ec2Address definition. + */ + Ec2Address.DefinitionStages.Blank define(String name); +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/Ec2FlowLog.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/Ec2FlowLog.java new file mode 100644 index 000000000000..281a5c5634dc --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/Ec2FlowLog.java @@ -0,0 +1,252 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.awsconnector.fluent.models.Ec2FlowLogInner; +import java.util.Map; + +/** + * An immutable client-side representation of Ec2FlowLog. + */ +public interface Ec2FlowLog { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the location property: The geo-location where the resource lives. + * + * @return the location value. + */ + String location(); + + /** + * Gets the tags property: Resource tags. + * + * @return the tags value. + */ + Map tags(); + + /** + * Gets the properties property: The resource-specific properties for this resource. + * + * @return the properties value. + */ + Ec2FlowLogProperties properties(); + + /** + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the region of the resource. + * + * @return the region of the resource. + */ + Region region(); + + /** + * Gets the name of the resource region. + * + * @return the name of the resource region. + */ + String regionName(); + + /** + * Gets the name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + + /** + * Gets the inner com.azure.resourcemanager.awsconnector.fluent.models.Ec2FlowLogInner object. + * + * @return the inner object. + */ + Ec2FlowLogInner innerModel(); + + /** + * The entirety of the Ec2FlowLog definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithLocation, + DefinitionStages.WithResourceGroup, DefinitionStages.WithCreate { + } + + /** + * The Ec2FlowLog definition stages. + */ + interface DefinitionStages { + /** + * The first stage of the Ec2FlowLog definition. + */ + interface Blank extends WithLocation { + } + + /** + * The stage of the Ec2FlowLog definition allowing to specify location. + */ + interface WithLocation { + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithResourceGroup withRegion(Region location); + + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithResourceGroup withRegion(String location); + } + + /** + * The stage of the Ec2FlowLog definition allowing to specify parent resource. + */ + interface WithResourceGroup { + /** + * Specifies resourceGroupName. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @return the next definition stage. + */ + WithCreate withExistingResourceGroup(String resourceGroupName); + } + + /** + * The stage of the Ec2FlowLog 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.WithProperties { + /** + * Executes the create request. + * + * @return the created resource. + */ + Ec2FlowLog create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + Ec2FlowLog create(Context context); + } + + /** + * The stage of the Ec2FlowLog definition allowing to specify tags. + */ + interface WithTags { + /** + * Specifies the tags property: Resource tags.. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + WithCreate withTags(Map tags); + } + + /** + * The stage of the Ec2FlowLog definition allowing to specify properties. + */ + interface WithProperties { + /** + * Specifies the properties property: The resource-specific properties for this resource.. + * + * @param properties The resource-specific properties for this resource. + * @return the next definition stage. + */ + WithCreate withProperties(Ec2FlowLogProperties properties); + } + } + + /** + * Begins update for the Ec2FlowLog resource. + * + * @return the stage of resource update. + */ + Ec2FlowLog.Update update(); + + /** + * The template for Ec2FlowLog update. + */ + interface Update extends UpdateStages.WithTags { + /** + * Executes the update request. + * + * @return the updated resource. + */ + Ec2FlowLog apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + Ec2FlowLog apply(Context context); + } + + /** + * The Ec2FlowLog update stages. + */ + interface UpdateStages { + /** + * The stage of the Ec2FlowLog update allowing to specify tags. + */ + interface WithTags { + /** + * Specifies the tags property: Resource tags.. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + Update withTags(Map tags); + } + } + + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + Ec2FlowLog refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + Ec2FlowLog refresh(Context context); +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/Ec2FlowLogListResult.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/Ec2FlowLogListResult.java new file mode 100644 index 000000000000..f0b24a5e002d --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/Ec2FlowLogListResult.java @@ -0,0 +1,134 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.awsconnector.fluent.models.Ec2FlowLogInner; +import java.io.IOException; +import java.util.List; + +/** + * The response of a Ec2FlowLog list operation. + */ +@Fluent +public final class Ec2FlowLogListResult implements JsonSerializable { + /* + * The Ec2FlowLog items on this page + */ + private List value; + + /* + * The link to the next page of items + */ + private String nextLink; + + /** + * Creates an instance of Ec2FlowLogListResult class. + */ + public Ec2FlowLogListResult() { + } + + /** + * Get the value property: The Ec2FlowLog items on this page. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The Ec2FlowLog items on this page. + * + * @param value the value value to set. + * @return the Ec2FlowLogListResult object itself. + */ + public Ec2FlowLogListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The link to the next page of items. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: The link to the next page of items. + * + * @param nextLink the nextLink value to set. + * @return the Ec2FlowLogListResult object itself. + */ + public Ec2FlowLogListResult withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property value in model Ec2FlowLogListResult")); + } else { + value().forEach(e -> e.validate()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(Ec2FlowLogListResult.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("nextLink", this.nextLink); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of Ec2FlowLogListResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of Ec2FlowLogListResult if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the Ec2FlowLogListResult. + */ + public static Ec2FlowLogListResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + Ec2FlowLogListResult deserializedEc2FlowLogListResult = new Ec2FlowLogListResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value = reader.readArray(reader1 -> Ec2FlowLogInner.fromJson(reader1)); + deserializedEc2FlowLogListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedEc2FlowLogListResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedEc2FlowLogListResult; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/Ec2FlowLogProperties.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/Ec2FlowLogProperties.java new file mode 100644 index 000000000000..82adaf317104 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/Ec2FlowLogProperties.java @@ -0,0 +1,311 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.Map; + +/** + * Definition of Ec2FlowLog. + */ +@Fluent +public final class Ec2FlowLogProperties implements JsonSerializable { + /* + * AWS Properties + */ + private AwsEc2FlowLogProperties awsProperties; + + /* + * Public Cloud Connectors Resource ID + */ + private String publicCloudConnectorsResourceId; + + /* + * AWS Account ID + */ + private String awsAccountId; + + /* + * Amazon Resource Name (ARN) + */ + private String arn; + + /* + * Public Cloud Resource Name + */ + private String publicCloudResourceName; + + /* + * AWS Source Schema + */ + private String awsSourceSchema; + + /* + * AWS Region + */ + private String awsRegion; + + /* + * AWS Tags + */ + private Map awsTags; + + /* + * The status of the last operation. + */ + private ProvisioningState provisioningState; + + /** + * Creates an instance of Ec2FlowLogProperties class. + */ + public Ec2FlowLogProperties() { + } + + /** + * Get the awsProperties property: AWS Properties. + * + * @return the awsProperties value. + */ + public AwsEc2FlowLogProperties awsProperties() { + return this.awsProperties; + } + + /** + * Set the awsProperties property: AWS Properties. + * + * @param awsProperties the awsProperties value to set. + * @return the Ec2FlowLogProperties object itself. + */ + public Ec2FlowLogProperties withAwsProperties(AwsEc2FlowLogProperties awsProperties) { + this.awsProperties = awsProperties; + return this; + } + + /** + * Get the publicCloudConnectorsResourceId property: Public Cloud Connectors Resource ID. + * + * @return the publicCloudConnectorsResourceId value. + */ + public String publicCloudConnectorsResourceId() { + return this.publicCloudConnectorsResourceId; + } + + /** + * Set the publicCloudConnectorsResourceId property: Public Cloud Connectors Resource ID. + * + * @param publicCloudConnectorsResourceId the publicCloudConnectorsResourceId value to set. + * @return the Ec2FlowLogProperties object itself. + */ + public Ec2FlowLogProperties withPublicCloudConnectorsResourceId(String publicCloudConnectorsResourceId) { + this.publicCloudConnectorsResourceId = publicCloudConnectorsResourceId; + return this; + } + + /** + * Get the awsAccountId property: AWS Account ID. + * + * @return the awsAccountId value. + */ + public String awsAccountId() { + return this.awsAccountId; + } + + /** + * Set the awsAccountId property: AWS Account ID. + * + * @param awsAccountId the awsAccountId value to set. + * @return the Ec2FlowLogProperties object itself. + */ + public Ec2FlowLogProperties withAwsAccountId(String awsAccountId) { + this.awsAccountId = awsAccountId; + return this; + } + + /** + * Get the arn property: Amazon Resource Name (ARN). + * + * @return the arn value. + */ + public String arn() { + return this.arn; + } + + /** + * Set the arn property: Amazon Resource Name (ARN). + * + * @param arn the arn value to set. + * @return the Ec2FlowLogProperties object itself. + */ + public Ec2FlowLogProperties withArn(String arn) { + this.arn = arn; + return this; + } + + /** + * Get the publicCloudResourceName property: Public Cloud Resource Name. + * + * @return the publicCloudResourceName value. + */ + public String publicCloudResourceName() { + return this.publicCloudResourceName; + } + + /** + * Set the publicCloudResourceName property: Public Cloud Resource Name. + * + * @param publicCloudResourceName the publicCloudResourceName value to set. + * @return the Ec2FlowLogProperties object itself. + */ + public Ec2FlowLogProperties withPublicCloudResourceName(String publicCloudResourceName) { + this.publicCloudResourceName = publicCloudResourceName; + return this; + } + + /** + * Get the awsSourceSchema property: AWS Source Schema. + * + * @return the awsSourceSchema value. + */ + public String awsSourceSchema() { + return this.awsSourceSchema; + } + + /** + * Set the awsSourceSchema property: AWS Source Schema. + * + * @param awsSourceSchema the awsSourceSchema value to set. + * @return the Ec2FlowLogProperties object itself. + */ + public Ec2FlowLogProperties withAwsSourceSchema(String awsSourceSchema) { + this.awsSourceSchema = awsSourceSchema; + return this; + } + + /** + * Get the awsRegion property: AWS Region. + * + * @return the awsRegion value. + */ + public String awsRegion() { + return this.awsRegion; + } + + /** + * Set the awsRegion property: AWS Region. + * + * @param awsRegion the awsRegion value to set. + * @return the Ec2FlowLogProperties object itself. + */ + public Ec2FlowLogProperties withAwsRegion(String awsRegion) { + this.awsRegion = awsRegion; + return this; + } + + /** + * Get the awsTags property: AWS Tags. + * + * @return the awsTags value. + */ + public Map awsTags() { + return this.awsTags; + } + + /** + * Set the awsTags property: AWS Tags. + * + * @param awsTags the awsTags value to set. + * @return the Ec2FlowLogProperties object itself. + */ + public Ec2FlowLogProperties withAwsTags(Map awsTags) { + this.awsTags = awsTags; + return this; + } + + /** + * Get the provisioningState property: The status of the last operation. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (awsProperties() != null) { + awsProperties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("awsProperties", this.awsProperties); + jsonWriter.writeStringField("publicCloudConnectorsResourceId", this.publicCloudConnectorsResourceId); + jsonWriter.writeStringField("awsAccountId", this.awsAccountId); + jsonWriter.writeStringField("arn", this.arn); + jsonWriter.writeStringField("publicCloudResourceName", this.publicCloudResourceName); + jsonWriter.writeStringField("awsSourceSchema", this.awsSourceSchema); + jsonWriter.writeStringField("awsRegion", this.awsRegion); + jsonWriter.writeMapField("awsTags", this.awsTags, (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of Ec2FlowLogProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of Ec2FlowLogProperties if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the Ec2FlowLogProperties. + */ + public static Ec2FlowLogProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + Ec2FlowLogProperties deserializedEc2FlowLogProperties = new Ec2FlowLogProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("awsProperties".equals(fieldName)) { + deserializedEc2FlowLogProperties.awsProperties = AwsEc2FlowLogProperties.fromJson(reader); + } else if ("publicCloudConnectorsResourceId".equals(fieldName)) { + deserializedEc2FlowLogProperties.publicCloudConnectorsResourceId = reader.getString(); + } else if ("awsAccountId".equals(fieldName)) { + deserializedEc2FlowLogProperties.awsAccountId = reader.getString(); + } else if ("arn".equals(fieldName)) { + deserializedEc2FlowLogProperties.arn = reader.getString(); + } else if ("publicCloudResourceName".equals(fieldName)) { + deserializedEc2FlowLogProperties.publicCloudResourceName = reader.getString(); + } else if ("awsSourceSchema".equals(fieldName)) { + deserializedEc2FlowLogProperties.awsSourceSchema = reader.getString(); + } else if ("awsRegion".equals(fieldName)) { + deserializedEc2FlowLogProperties.awsRegion = reader.getString(); + } else if ("awsTags".equals(fieldName)) { + Map awsTags = reader.readMap(reader1 -> reader1.getString()); + deserializedEc2FlowLogProperties.awsTags = awsTags; + } else if ("provisioningState".equals(fieldName)) { + deserializedEc2FlowLogProperties.provisioningState + = ProvisioningState.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedEc2FlowLogProperties; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/Ec2FlowLogTagsUpdate.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/Ec2FlowLogTagsUpdate.java new file mode 100644 index 000000000000..f64ad4ecd4e7 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/Ec2FlowLogTagsUpdate.java @@ -0,0 +1,95 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.Map; + +/** + * The type used for updating tags in Ec2FlowLog resources. + */ +@Fluent +public final class Ec2FlowLogTagsUpdate implements JsonSerializable { + /* + * Resource tags. + */ + private Map tags; + + /** + * Creates an instance of Ec2FlowLogTagsUpdate class. + */ + public Ec2FlowLogTagsUpdate() { + } + + /** + * Get the tags property: Resource tags. + * + * @return the tags value. + */ + public Map tags() { + return this.tags; + } + + /** + * Set the tags property: Resource tags. + * + * @param tags the tags value to set. + * @return the Ec2FlowLogTagsUpdate object itself. + */ + public Ec2FlowLogTagsUpdate withTags(Map tags) { + this.tags = tags; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeMapField("tags", this.tags, (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of Ec2FlowLogTagsUpdate from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of Ec2FlowLogTagsUpdate if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the Ec2FlowLogTagsUpdate. + */ + public static Ec2FlowLogTagsUpdate fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + Ec2FlowLogTagsUpdate deserializedEc2FlowLogTagsUpdate = new Ec2FlowLogTagsUpdate(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedEc2FlowLogTagsUpdate.tags = tags; + } else { + reader.skipChildren(); + } + } + + return deserializedEc2FlowLogTagsUpdate; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/Ec2FlowLogs.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/Ec2FlowLogs.java new file mode 100644 index 000000000000..3d81aee66886 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/Ec2FlowLogs.java @@ -0,0 +1,157 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** + * Resource collection API of Ec2FlowLogs. + */ +public interface Ec2FlowLogs { + /** + * List Ec2FlowLog resources by subscription ID. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Ec2FlowLog list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable list(); + + /** + * List Ec2FlowLog resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Ec2FlowLog list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable list(Context context); + + /** + * List Ec2FlowLog resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Ec2FlowLog list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * List Ec2FlowLog resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Ec2FlowLog list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Get a Ec2FlowLog. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2FlowLog. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Ec2FlowLog along with {@link Response}. + */ + Response getByResourceGroupWithResponse(String resourceGroupName, String name, Context context); + + /** + * Get a Ec2FlowLog. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2FlowLog. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Ec2FlowLog. + */ + Ec2FlowLog getByResourceGroup(String resourceGroupName, String name); + + /** + * Delete a Ec2FlowLog. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2FlowLog. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByResourceGroup(String resourceGroupName, String name); + + /** + * Delete a Ec2FlowLog. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2FlowLog. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String name, Context context); + + /** + * Get a Ec2FlowLog. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Ec2FlowLog along with {@link Response}. + */ + Ec2FlowLog getById(String id); + + /** + * Get a Ec2FlowLog. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Ec2FlowLog along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Delete a Ec2FlowLog. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteById(String id); + + /** + * Delete a Ec2FlowLog. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new Ec2FlowLog resource. + * + * @param name resource name. + * @return the first stage of the new Ec2FlowLog definition. + */ + Ec2FlowLog.DefinitionStages.Blank define(String name); +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/Ec2Image.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/Ec2Image.java new file mode 100644 index 000000000000..e50ca4a014a4 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/Ec2Image.java @@ -0,0 +1,252 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.awsconnector.fluent.models.Ec2ImageInner; +import java.util.Map; + +/** + * An immutable client-side representation of Ec2Image. + */ +public interface Ec2Image { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the location property: The geo-location where the resource lives. + * + * @return the location value. + */ + String location(); + + /** + * Gets the tags property: Resource tags. + * + * @return the tags value. + */ + Map tags(); + + /** + * Gets the properties property: The resource-specific properties for this resource. + * + * @return the properties value. + */ + Ec2ImageProperties properties(); + + /** + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the region of the resource. + * + * @return the region of the resource. + */ + Region region(); + + /** + * Gets the name of the resource region. + * + * @return the name of the resource region. + */ + String regionName(); + + /** + * Gets the name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + + /** + * Gets the inner com.azure.resourcemanager.awsconnector.fluent.models.Ec2ImageInner object. + * + * @return the inner object. + */ + Ec2ImageInner innerModel(); + + /** + * The entirety of the Ec2Image definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithLocation, + DefinitionStages.WithResourceGroup, DefinitionStages.WithCreate { + } + + /** + * The Ec2Image definition stages. + */ + interface DefinitionStages { + /** + * The first stage of the Ec2Image definition. + */ + interface Blank extends WithLocation { + } + + /** + * The stage of the Ec2Image definition allowing to specify location. + */ + interface WithLocation { + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithResourceGroup withRegion(Region location); + + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithResourceGroup withRegion(String location); + } + + /** + * The stage of the Ec2Image definition allowing to specify parent resource. + */ + interface WithResourceGroup { + /** + * Specifies resourceGroupName. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @return the next definition stage. + */ + WithCreate withExistingResourceGroup(String resourceGroupName); + } + + /** + * The stage of the Ec2Image 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.WithProperties { + /** + * Executes the create request. + * + * @return the created resource. + */ + Ec2Image create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + Ec2Image create(Context context); + } + + /** + * The stage of the Ec2Image definition allowing to specify tags. + */ + interface WithTags { + /** + * Specifies the tags property: Resource tags.. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + WithCreate withTags(Map tags); + } + + /** + * The stage of the Ec2Image definition allowing to specify properties. + */ + interface WithProperties { + /** + * Specifies the properties property: The resource-specific properties for this resource.. + * + * @param properties The resource-specific properties for this resource. + * @return the next definition stage. + */ + WithCreate withProperties(Ec2ImageProperties properties); + } + } + + /** + * Begins update for the Ec2Image resource. + * + * @return the stage of resource update. + */ + Ec2Image.Update update(); + + /** + * The template for Ec2Image update. + */ + interface Update extends UpdateStages.WithTags { + /** + * Executes the update request. + * + * @return the updated resource. + */ + Ec2Image apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + Ec2Image apply(Context context); + } + + /** + * The Ec2Image update stages. + */ + interface UpdateStages { + /** + * The stage of the Ec2Image update allowing to specify tags. + */ + interface WithTags { + /** + * Specifies the tags property: Resource tags.. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + Update withTags(Map tags); + } + } + + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + Ec2Image refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + Ec2Image refresh(Context context); +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/Ec2ImageListResult.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/Ec2ImageListResult.java new file mode 100644 index 000000000000..88cc6a09471e --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/Ec2ImageListResult.java @@ -0,0 +1,134 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.awsconnector.fluent.models.Ec2ImageInner; +import java.io.IOException; +import java.util.List; + +/** + * The response of a Ec2Image list operation. + */ +@Fluent +public final class Ec2ImageListResult implements JsonSerializable { + /* + * The Ec2Image items on this page + */ + private List value; + + /* + * The link to the next page of items + */ + private String nextLink; + + /** + * Creates an instance of Ec2ImageListResult class. + */ + public Ec2ImageListResult() { + } + + /** + * Get the value property: The Ec2Image items on this page. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The Ec2Image items on this page. + * + * @param value the value value to set. + * @return the Ec2ImageListResult object itself. + */ + public Ec2ImageListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The link to the next page of items. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: The link to the next page of items. + * + * @param nextLink the nextLink value to set. + * @return the Ec2ImageListResult object itself. + */ + public Ec2ImageListResult withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property value in model Ec2ImageListResult")); + } else { + value().forEach(e -> e.validate()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(Ec2ImageListResult.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("nextLink", this.nextLink); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of Ec2ImageListResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of Ec2ImageListResult if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the Ec2ImageListResult. + */ + public static Ec2ImageListResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + Ec2ImageListResult deserializedEc2ImageListResult = new Ec2ImageListResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value = reader.readArray(reader1 -> Ec2ImageInner.fromJson(reader1)); + deserializedEc2ImageListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedEc2ImageListResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedEc2ImageListResult; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/Ec2ImageProperties.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/Ec2ImageProperties.java new file mode 100644 index 000000000000..a406304e48b1 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/Ec2ImageProperties.java @@ -0,0 +1,310 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.Map; + +/** + * Definition of Ec2Image. + */ +@Fluent +public final class Ec2ImageProperties implements JsonSerializable { + /* + * AWS Properties + */ + private AwsEc2ImageProperties awsProperties; + + /* + * Public Cloud Connectors Resource ID + */ + private String publicCloudConnectorsResourceId; + + /* + * AWS Account ID + */ + private String awsAccountId; + + /* + * Amazon Resource Name (ARN) + */ + private String arn; + + /* + * Public Cloud Resource Name + */ + private String publicCloudResourceName; + + /* + * AWS Source Schema + */ + private String awsSourceSchema; + + /* + * AWS Region + */ + private String awsRegion; + + /* + * AWS Tags + */ + private Map awsTags; + + /* + * The status of the last operation. + */ + private ProvisioningState provisioningState; + + /** + * Creates an instance of Ec2ImageProperties class. + */ + public Ec2ImageProperties() { + } + + /** + * Get the awsProperties property: AWS Properties. + * + * @return the awsProperties value. + */ + public AwsEc2ImageProperties awsProperties() { + return this.awsProperties; + } + + /** + * Set the awsProperties property: AWS Properties. + * + * @param awsProperties the awsProperties value to set. + * @return the Ec2ImageProperties object itself. + */ + public Ec2ImageProperties withAwsProperties(AwsEc2ImageProperties awsProperties) { + this.awsProperties = awsProperties; + return this; + } + + /** + * Get the publicCloudConnectorsResourceId property: Public Cloud Connectors Resource ID. + * + * @return the publicCloudConnectorsResourceId value. + */ + public String publicCloudConnectorsResourceId() { + return this.publicCloudConnectorsResourceId; + } + + /** + * Set the publicCloudConnectorsResourceId property: Public Cloud Connectors Resource ID. + * + * @param publicCloudConnectorsResourceId the publicCloudConnectorsResourceId value to set. + * @return the Ec2ImageProperties object itself. + */ + public Ec2ImageProperties withPublicCloudConnectorsResourceId(String publicCloudConnectorsResourceId) { + this.publicCloudConnectorsResourceId = publicCloudConnectorsResourceId; + return this; + } + + /** + * Get the awsAccountId property: AWS Account ID. + * + * @return the awsAccountId value. + */ + public String awsAccountId() { + return this.awsAccountId; + } + + /** + * Set the awsAccountId property: AWS Account ID. + * + * @param awsAccountId the awsAccountId value to set. + * @return the Ec2ImageProperties object itself. + */ + public Ec2ImageProperties withAwsAccountId(String awsAccountId) { + this.awsAccountId = awsAccountId; + return this; + } + + /** + * Get the arn property: Amazon Resource Name (ARN). + * + * @return the arn value. + */ + public String arn() { + return this.arn; + } + + /** + * Set the arn property: Amazon Resource Name (ARN). + * + * @param arn the arn value to set. + * @return the Ec2ImageProperties object itself. + */ + public Ec2ImageProperties withArn(String arn) { + this.arn = arn; + return this; + } + + /** + * Get the publicCloudResourceName property: Public Cloud Resource Name. + * + * @return the publicCloudResourceName value. + */ + public String publicCloudResourceName() { + return this.publicCloudResourceName; + } + + /** + * Set the publicCloudResourceName property: Public Cloud Resource Name. + * + * @param publicCloudResourceName the publicCloudResourceName value to set. + * @return the Ec2ImageProperties object itself. + */ + public Ec2ImageProperties withPublicCloudResourceName(String publicCloudResourceName) { + this.publicCloudResourceName = publicCloudResourceName; + return this; + } + + /** + * Get the awsSourceSchema property: AWS Source Schema. + * + * @return the awsSourceSchema value. + */ + public String awsSourceSchema() { + return this.awsSourceSchema; + } + + /** + * Set the awsSourceSchema property: AWS Source Schema. + * + * @param awsSourceSchema the awsSourceSchema value to set. + * @return the Ec2ImageProperties object itself. + */ + public Ec2ImageProperties withAwsSourceSchema(String awsSourceSchema) { + this.awsSourceSchema = awsSourceSchema; + return this; + } + + /** + * Get the awsRegion property: AWS Region. + * + * @return the awsRegion value. + */ + public String awsRegion() { + return this.awsRegion; + } + + /** + * Set the awsRegion property: AWS Region. + * + * @param awsRegion the awsRegion value to set. + * @return the Ec2ImageProperties object itself. + */ + public Ec2ImageProperties withAwsRegion(String awsRegion) { + this.awsRegion = awsRegion; + return this; + } + + /** + * Get the awsTags property: AWS Tags. + * + * @return the awsTags value. + */ + public Map awsTags() { + return this.awsTags; + } + + /** + * Set the awsTags property: AWS Tags. + * + * @param awsTags the awsTags value to set. + * @return the Ec2ImageProperties object itself. + */ + public Ec2ImageProperties withAwsTags(Map awsTags) { + this.awsTags = awsTags; + return this; + } + + /** + * Get the provisioningState property: The status of the last operation. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (awsProperties() != null) { + awsProperties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("awsProperties", this.awsProperties); + jsonWriter.writeStringField("publicCloudConnectorsResourceId", this.publicCloudConnectorsResourceId); + jsonWriter.writeStringField("awsAccountId", this.awsAccountId); + jsonWriter.writeStringField("arn", this.arn); + jsonWriter.writeStringField("publicCloudResourceName", this.publicCloudResourceName); + jsonWriter.writeStringField("awsSourceSchema", this.awsSourceSchema); + jsonWriter.writeStringField("awsRegion", this.awsRegion); + jsonWriter.writeMapField("awsTags", this.awsTags, (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of Ec2ImageProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of Ec2ImageProperties if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the Ec2ImageProperties. + */ + public static Ec2ImageProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + Ec2ImageProperties deserializedEc2ImageProperties = new Ec2ImageProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("awsProperties".equals(fieldName)) { + deserializedEc2ImageProperties.awsProperties = AwsEc2ImageProperties.fromJson(reader); + } else if ("publicCloudConnectorsResourceId".equals(fieldName)) { + deserializedEc2ImageProperties.publicCloudConnectorsResourceId = reader.getString(); + } else if ("awsAccountId".equals(fieldName)) { + deserializedEc2ImageProperties.awsAccountId = reader.getString(); + } else if ("arn".equals(fieldName)) { + deserializedEc2ImageProperties.arn = reader.getString(); + } else if ("publicCloudResourceName".equals(fieldName)) { + deserializedEc2ImageProperties.publicCloudResourceName = reader.getString(); + } else if ("awsSourceSchema".equals(fieldName)) { + deserializedEc2ImageProperties.awsSourceSchema = reader.getString(); + } else if ("awsRegion".equals(fieldName)) { + deserializedEc2ImageProperties.awsRegion = reader.getString(); + } else if ("awsTags".equals(fieldName)) { + Map awsTags = reader.readMap(reader1 -> reader1.getString()); + deserializedEc2ImageProperties.awsTags = awsTags; + } else if ("provisioningState".equals(fieldName)) { + deserializedEc2ImageProperties.provisioningState = ProvisioningState.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedEc2ImageProperties; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/Ec2ImageTagsUpdate.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/Ec2ImageTagsUpdate.java new file mode 100644 index 000000000000..a3597e73ffa8 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/Ec2ImageTagsUpdate.java @@ -0,0 +1,95 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.Map; + +/** + * The type used for updating tags in Ec2Image resources. + */ +@Fluent +public final class Ec2ImageTagsUpdate implements JsonSerializable { + /* + * Resource tags. + */ + private Map tags; + + /** + * Creates an instance of Ec2ImageTagsUpdate class. + */ + public Ec2ImageTagsUpdate() { + } + + /** + * Get the tags property: Resource tags. + * + * @return the tags value. + */ + public Map tags() { + return this.tags; + } + + /** + * Set the tags property: Resource tags. + * + * @param tags the tags value to set. + * @return the Ec2ImageTagsUpdate object itself. + */ + public Ec2ImageTagsUpdate withTags(Map tags) { + this.tags = tags; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeMapField("tags", this.tags, (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of Ec2ImageTagsUpdate from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of Ec2ImageTagsUpdate if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the Ec2ImageTagsUpdate. + */ + public static Ec2ImageTagsUpdate fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + Ec2ImageTagsUpdate deserializedEc2ImageTagsUpdate = new Ec2ImageTagsUpdate(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedEc2ImageTagsUpdate.tags = tags; + } else { + reader.skipChildren(); + } + } + + return deserializedEc2ImageTagsUpdate; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/Ec2Images.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/Ec2Images.java new file mode 100644 index 000000000000..8460f444ad56 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/Ec2Images.java @@ -0,0 +1,157 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** + * Resource collection API of Ec2Images. + */ +public interface Ec2Images { + /** + * List Ec2Image resources by subscription ID. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Ec2Image list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable list(); + + /** + * List Ec2Image resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Ec2Image list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable list(Context context); + + /** + * List Ec2Image resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Ec2Image list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * List Ec2Image resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Ec2Image list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Get a Ec2Image. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2Image. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Ec2Image along with {@link Response}. + */ + Response getByResourceGroupWithResponse(String resourceGroupName, String name, Context context); + + /** + * Get a Ec2Image. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2Image. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Ec2Image. + */ + Ec2Image getByResourceGroup(String resourceGroupName, String name); + + /** + * Delete a Ec2Image. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2Image. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByResourceGroup(String resourceGroupName, String name); + + /** + * Delete a Ec2Image. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2Image. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String name, Context context); + + /** + * Get a Ec2Image. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Ec2Image along with {@link Response}. + */ + Ec2Image getById(String id); + + /** + * Get a Ec2Image. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Ec2Image along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Delete a Ec2Image. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteById(String id); + + /** + * Delete a Ec2Image. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new Ec2Image resource. + * + * @param name resource name. + * @return the first stage of the new Ec2Image definition. + */ + Ec2Image.DefinitionStages.Blank define(String name); +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/Ec2Instance.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/Ec2Instance.java new file mode 100644 index 000000000000..31b9acaaf30f --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/Ec2Instance.java @@ -0,0 +1,55 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.awsconnector.fluent.models.Ec2InstanceInner; + +/** + * An immutable client-side representation of Ec2Instance. + */ +public interface Ec2Instance { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the properties property: The resource-specific properties for this resource. + * + * @return the properties value. + */ + Ec2InstanceProperties properties(); + + /** + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the inner com.azure.resourcemanager.awsconnector.fluent.models.Ec2InstanceInner object. + * + * @return the inner object. + */ + Ec2InstanceInner innerModel(); +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/Ec2InstanceAttributes.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/Ec2InstanceAttributes.java new file mode 100644 index 000000000000..9012f0b8c113 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/Ec2InstanceAttributes.java @@ -0,0 +1,446 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Definition of Ec2InstanceAttributes. + */ +@Fluent +public final class Ec2InstanceAttributes implements JsonSerializable { + /* + *

A list of additional Amazon EC2 security group IDs for the master node.

+ */ + private List additionalMasterSecurityGroups; + + /* + *

A list of additional Amazon EC2 security group IDs for the core and task nodes.

+ */ + private List additionalSlaveSecurityGroups; + + /* + *

The Availability Zone in which the cluster will run.

+ */ + private String ec2AvailabilityZone; + + /* + *

The name of the Amazon EC2 key pair to use when connecting with SSH into the master node as a user named + * 'hadoop'.

+ */ + private String ec2KeyName; + + /* + *

Set this parameter to the identifier of the Amazon VPC subnet where you want the cluster to launch. If you do + * not specify this value, and your account supports EC2-Classic, the cluster launches in EC2-Classic.

+ */ + private String ec2SubnetId; + + /* + *

The identifier of the Amazon EC2 security group for the master node.

+ */ + private String emrManagedMasterSecurityGroup; + + /* + *

The identifier of the Amazon EC2 security group for the core and task nodes.

+ */ + private String emrManagedSlaveSecurityGroup; + + /* + *

The IAM role that was specified when the cluster was launched. The Amazon EC2 instances of the cluster assume + * this role.

+ */ + private String iamInstanceProfile; + + /* + *

Applies to clusters configured with the instance fleets option. Specifies one or more Availability Zones in + * which to launch Amazon EC2 cluster instances when the EC2-Classic network configuration is supported. Amazon EMR + * chooses the Availability Zone with the best fit from among the list of + * RequestedEc2AvailabilityZones, and then launches all cluster instances within that Availability + * Zone. If you do not specify this value, Amazon EMR chooses the Availability Zone for you. + * RequestedEc2SubnetIDs and RequestedEc2AvailabilityZones cannot be specified + * together.

+ */ + private List requestedEc2AvailabilityZones; + + /* + *

Applies to clusters configured with the instance fleets option. Specifies the unique identifier of one or more + * Amazon EC2 subnets in which to launch Amazon EC2 cluster instances. Subnets must exist within the same VPC. + * Amazon EMR chooses the Amazon EC2 subnet with the best fit from among the list of + * RequestedEc2SubnetIds, and then launches all cluster instances within that Subnet. If this value is + * not specified, and the account and Region support EC2-Classic networks, the cluster launches instances in the + * EC2-Classic network and uses RequestedEc2AvailabilityZones instead of this setting. If EC2-Classic + * is not supported, and no Subnet is specified, Amazon EMR chooses the subnet for you. + * RequestedEc2SubnetIDs and RequestedEc2AvailabilityZones cannot be specified + * together.

+ */ + private List requestedEc2SubnetIds; + + /* + *

The identifier of the Amazon EC2 security group for the Amazon EMR service to access clusters in VPC private + * subnets.

+ */ + private String serviceAccessSecurityGroup; + + /** + * Creates an instance of Ec2InstanceAttributes class. + */ + public Ec2InstanceAttributes() { + } + + /** + * Get the additionalMasterSecurityGroups property: <p>A list of additional Amazon EC2 security group IDs for + * the master node.</p>. + * + * @return the additionalMasterSecurityGroups value. + */ + public List additionalMasterSecurityGroups() { + return this.additionalMasterSecurityGroups; + } + + /** + * Set the additionalMasterSecurityGroups property: <p>A list of additional Amazon EC2 security group IDs for + * the master node.</p>. + * + * @param additionalMasterSecurityGroups the additionalMasterSecurityGroups value to set. + * @return the Ec2InstanceAttributes object itself. + */ + public Ec2InstanceAttributes withAdditionalMasterSecurityGroups(List additionalMasterSecurityGroups) { + this.additionalMasterSecurityGroups = additionalMasterSecurityGroups; + return this; + } + + /** + * Get the additionalSlaveSecurityGroups property: <p>A list of additional Amazon EC2 security group IDs for + * the core and task nodes.</p>. + * + * @return the additionalSlaveSecurityGroups value. + */ + public List additionalSlaveSecurityGroups() { + return this.additionalSlaveSecurityGroups; + } + + /** + * Set the additionalSlaveSecurityGroups property: <p>A list of additional Amazon EC2 security group IDs for + * the core and task nodes.</p>. + * + * @param additionalSlaveSecurityGroups the additionalSlaveSecurityGroups value to set. + * @return the Ec2InstanceAttributes object itself. + */ + public Ec2InstanceAttributes withAdditionalSlaveSecurityGroups(List additionalSlaveSecurityGroups) { + this.additionalSlaveSecurityGroups = additionalSlaveSecurityGroups; + return this; + } + + /** + * Get the ec2AvailabilityZone property: <p>The Availability Zone in which the cluster will run. </p>. + * + * @return the ec2AvailabilityZone value. + */ + public String ec2AvailabilityZone() { + return this.ec2AvailabilityZone; + } + + /** + * Set the ec2AvailabilityZone property: <p>The Availability Zone in which the cluster will run. </p>. + * + * @param ec2AvailabilityZone the ec2AvailabilityZone value to set. + * @return the Ec2InstanceAttributes object itself. + */ + public Ec2InstanceAttributes withEc2AvailabilityZone(String ec2AvailabilityZone) { + this.ec2AvailabilityZone = ec2AvailabilityZone; + return this; + } + + /** + * Get the ec2KeyName property: <p>The name of the Amazon EC2 key pair to use when connecting with SSH into + * the master node as a user named 'hadoop'.</p>. + * + * @return the ec2KeyName value. + */ + public String ec2KeyName() { + return this.ec2KeyName; + } + + /** + * Set the ec2KeyName property: <p>The name of the Amazon EC2 key pair to use when connecting with SSH into + * the master node as a user named 'hadoop'.</p>. + * + * @param ec2KeyName the ec2KeyName value to set. + * @return the Ec2InstanceAttributes object itself. + */ + public Ec2InstanceAttributes withEc2KeyName(String ec2KeyName) { + this.ec2KeyName = ec2KeyName; + return this; + } + + /** + * Get the ec2SubnetId property: <p>Set this parameter to the identifier of the Amazon VPC subnet where you + * want the cluster to launch. If you do not specify this value, and your account supports EC2-Classic, the cluster + * launches in EC2-Classic.</p>. + * + * @return the ec2SubnetId value. + */ + public String ec2SubnetId() { + return this.ec2SubnetId; + } + + /** + * Set the ec2SubnetId property: <p>Set this parameter to the identifier of the Amazon VPC subnet where you + * want the cluster to launch. If you do not specify this value, and your account supports EC2-Classic, the cluster + * launches in EC2-Classic.</p>. + * + * @param ec2SubnetId the ec2SubnetId value to set. + * @return the Ec2InstanceAttributes object itself. + */ + public Ec2InstanceAttributes withEc2SubnetId(String ec2SubnetId) { + this.ec2SubnetId = ec2SubnetId; + return this; + } + + /** + * Get the emrManagedMasterSecurityGroup property: <p>The identifier of the Amazon EC2 security group for the + * master node.</p>. + * + * @return the emrManagedMasterSecurityGroup value. + */ + public String emrManagedMasterSecurityGroup() { + return this.emrManagedMasterSecurityGroup; + } + + /** + * Set the emrManagedMasterSecurityGroup property: <p>The identifier of the Amazon EC2 security group for the + * master node.</p>. + * + * @param emrManagedMasterSecurityGroup the emrManagedMasterSecurityGroup value to set. + * @return the Ec2InstanceAttributes object itself. + */ + public Ec2InstanceAttributes withEmrManagedMasterSecurityGroup(String emrManagedMasterSecurityGroup) { + this.emrManagedMasterSecurityGroup = emrManagedMasterSecurityGroup; + return this; + } + + /** + * Get the emrManagedSlaveSecurityGroup property: <p>The identifier of the Amazon EC2 security group for the + * core and task nodes.</p>. + * + * @return the emrManagedSlaveSecurityGroup value. + */ + public String emrManagedSlaveSecurityGroup() { + return this.emrManagedSlaveSecurityGroup; + } + + /** + * Set the emrManagedSlaveSecurityGroup property: <p>The identifier of the Amazon EC2 security group for the + * core and task nodes.</p>. + * + * @param emrManagedSlaveSecurityGroup the emrManagedSlaveSecurityGroup value to set. + * @return the Ec2InstanceAttributes object itself. + */ + public Ec2InstanceAttributes withEmrManagedSlaveSecurityGroup(String emrManagedSlaveSecurityGroup) { + this.emrManagedSlaveSecurityGroup = emrManagedSlaveSecurityGroup; + return this; + } + + /** + * Get the iamInstanceProfile property: <p>The IAM role that was specified when the cluster was launched. The + * Amazon EC2 instances of the cluster assume this role.</p>. + * + * @return the iamInstanceProfile value. + */ + public String iamInstanceProfile() { + return this.iamInstanceProfile; + } + + /** + * Set the iamInstanceProfile property: <p>The IAM role that was specified when the cluster was launched. The + * Amazon EC2 instances of the cluster assume this role.</p>. + * + * @param iamInstanceProfile the iamInstanceProfile value to set. + * @return the Ec2InstanceAttributes object itself. + */ + public Ec2InstanceAttributes withIamInstanceProfile(String iamInstanceProfile) { + this.iamInstanceProfile = iamInstanceProfile; + return this; + } + + /** + * Get the requestedEc2AvailabilityZones property: <p>Applies to clusters configured with the instance fleets + * option. Specifies one or more Availability Zones in which to launch Amazon EC2 cluster instances when the + * EC2-Classic network configuration is supported. Amazon EMR chooses the Availability Zone with the best fit from + * among the list of <code>RequestedEc2AvailabilityZones</code>, and then launches all cluster instances + * within that Availability Zone. If you do not specify this value, Amazon EMR chooses the Availability Zone for + * you. <code>RequestedEc2SubnetIDs</code> and <code>RequestedEc2AvailabilityZones</code> + * cannot be specified together.</p>. + * + * @return the requestedEc2AvailabilityZones value. + */ + public List requestedEc2AvailabilityZones() { + return this.requestedEc2AvailabilityZones; + } + + /** + * Set the requestedEc2AvailabilityZones property: <p>Applies to clusters configured with the instance fleets + * option. Specifies one or more Availability Zones in which to launch Amazon EC2 cluster instances when the + * EC2-Classic network configuration is supported. Amazon EMR chooses the Availability Zone with the best fit from + * among the list of <code>RequestedEc2AvailabilityZones</code>, and then launches all cluster instances + * within that Availability Zone. If you do not specify this value, Amazon EMR chooses the Availability Zone for + * you. <code>RequestedEc2SubnetIDs</code> and <code>RequestedEc2AvailabilityZones</code> + * cannot be specified together.</p>. + * + * @param requestedEc2AvailabilityZones the requestedEc2AvailabilityZones value to set. + * @return the Ec2InstanceAttributes object itself. + */ + public Ec2InstanceAttributes withRequestedEc2AvailabilityZones(List requestedEc2AvailabilityZones) { + this.requestedEc2AvailabilityZones = requestedEc2AvailabilityZones; + return this; + } + + /** + * Get the requestedEc2SubnetIds property: <p>Applies to clusters configured with the instance fleets option. + * Specifies the unique identifier of one or more Amazon EC2 subnets in which to launch Amazon EC2 cluster + * instances. Subnets must exist within the same VPC. Amazon EMR chooses the Amazon EC2 subnet with the best fit + * from among the list of <code>RequestedEc2SubnetIds</code>, and then launches all cluster instances + * within that Subnet. If this value is not specified, and the account and Region support EC2-Classic networks, the + * cluster launches instances in the EC2-Classic network and uses + * <code>RequestedEc2AvailabilityZones</code> instead of this setting. If EC2-Classic is not supported, + * and no Subnet is specified, Amazon EMR chooses the subnet for you. <code>RequestedEc2SubnetIDs</code> + * and <code>RequestedEc2AvailabilityZones</code> cannot be specified together.</p>. + * + * @return the requestedEc2SubnetIds value. + */ + public List requestedEc2SubnetIds() { + return this.requestedEc2SubnetIds; + } + + /** + * Set the requestedEc2SubnetIds property: <p>Applies to clusters configured with the instance fleets option. + * Specifies the unique identifier of one or more Amazon EC2 subnets in which to launch Amazon EC2 cluster + * instances. Subnets must exist within the same VPC. Amazon EMR chooses the Amazon EC2 subnet with the best fit + * from among the list of <code>RequestedEc2SubnetIds</code>, and then launches all cluster instances + * within that Subnet. If this value is not specified, and the account and Region support EC2-Classic networks, the + * cluster launches instances in the EC2-Classic network and uses + * <code>RequestedEc2AvailabilityZones</code> instead of this setting. If EC2-Classic is not supported, + * and no Subnet is specified, Amazon EMR chooses the subnet for you. <code>RequestedEc2SubnetIDs</code> + * and <code>RequestedEc2AvailabilityZones</code> cannot be specified together.</p>. + * + * @param requestedEc2SubnetIds the requestedEc2SubnetIds value to set. + * @return the Ec2InstanceAttributes object itself. + */ + public Ec2InstanceAttributes withRequestedEc2SubnetIds(List requestedEc2SubnetIds) { + this.requestedEc2SubnetIds = requestedEc2SubnetIds; + return this; + } + + /** + * Get the serviceAccessSecurityGroup property: <p>The identifier of the Amazon EC2 security group for the + * Amazon EMR service to access clusters in VPC private subnets.</p>. + * + * @return the serviceAccessSecurityGroup value. + */ + public String serviceAccessSecurityGroup() { + return this.serviceAccessSecurityGroup; + } + + /** + * Set the serviceAccessSecurityGroup property: <p>The identifier of the Amazon EC2 security group for the + * Amazon EMR service to access clusters in VPC private subnets.</p>. + * + * @param serviceAccessSecurityGroup the serviceAccessSecurityGroup value to set. + * @return the Ec2InstanceAttributes object itself. + */ + public Ec2InstanceAttributes withServiceAccessSecurityGroup(String serviceAccessSecurityGroup) { + this.serviceAccessSecurityGroup = serviceAccessSecurityGroup; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("additionalMasterSecurityGroups", this.additionalMasterSecurityGroups, + (writer, element) -> writer.writeString(element)); + jsonWriter.writeArrayField("additionalSlaveSecurityGroups", this.additionalSlaveSecurityGroups, + (writer, element) -> writer.writeString(element)); + jsonWriter.writeStringField("ec2AvailabilityZone", this.ec2AvailabilityZone); + jsonWriter.writeStringField("ec2KeyName", this.ec2KeyName); + jsonWriter.writeStringField("ec2SubnetId", this.ec2SubnetId); + jsonWriter.writeStringField("emrManagedMasterSecurityGroup", this.emrManagedMasterSecurityGroup); + jsonWriter.writeStringField("emrManagedSlaveSecurityGroup", this.emrManagedSlaveSecurityGroup); + jsonWriter.writeStringField("iamInstanceProfile", this.iamInstanceProfile); + jsonWriter.writeArrayField("requestedEc2AvailabilityZones", this.requestedEc2AvailabilityZones, + (writer, element) -> writer.writeString(element)); + jsonWriter.writeArrayField("requestedEc2SubnetIds", this.requestedEc2SubnetIds, + (writer, element) -> writer.writeString(element)); + jsonWriter.writeStringField("serviceAccessSecurityGroup", this.serviceAccessSecurityGroup); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of Ec2InstanceAttributes from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of Ec2InstanceAttributes if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the Ec2InstanceAttributes. + */ + public static Ec2InstanceAttributes fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + Ec2InstanceAttributes deserializedEc2InstanceAttributes = new Ec2InstanceAttributes(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("additionalMasterSecurityGroups".equals(fieldName)) { + List additionalMasterSecurityGroups = reader.readArray(reader1 -> reader1.getString()); + deserializedEc2InstanceAttributes.additionalMasterSecurityGroups = additionalMasterSecurityGroups; + } else if ("additionalSlaveSecurityGroups".equals(fieldName)) { + List additionalSlaveSecurityGroups = reader.readArray(reader1 -> reader1.getString()); + deserializedEc2InstanceAttributes.additionalSlaveSecurityGroups = additionalSlaveSecurityGroups; + } else if ("ec2AvailabilityZone".equals(fieldName)) { + deserializedEc2InstanceAttributes.ec2AvailabilityZone = reader.getString(); + } else if ("ec2KeyName".equals(fieldName)) { + deserializedEc2InstanceAttributes.ec2KeyName = reader.getString(); + } else if ("ec2SubnetId".equals(fieldName)) { + deserializedEc2InstanceAttributes.ec2SubnetId = reader.getString(); + } else if ("emrManagedMasterSecurityGroup".equals(fieldName)) { + deserializedEc2InstanceAttributes.emrManagedMasterSecurityGroup = reader.getString(); + } else if ("emrManagedSlaveSecurityGroup".equals(fieldName)) { + deserializedEc2InstanceAttributes.emrManagedSlaveSecurityGroup = reader.getString(); + } else if ("iamInstanceProfile".equals(fieldName)) { + deserializedEc2InstanceAttributes.iamInstanceProfile = reader.getString(); + } else if ("requestedEc2AvailabilityZones".equals(fieldName)) { + List requestedEc2AvailabilityZones = reader.readArray(reader1 -> reader1.getString()); + deserializedEc2InstanceAttributes.requestedEc2AvailabilityZones = requestedEc2AvailabilityZones; + } else if ("requestedEc2SubnetIds".equals(fieldName)) { + List requestedEc2SubnetIds = reader.readArray(reader1 -> reader1.getString()); + deserializedEc2InstanceAttributes.requestedEc2SubnetIds = requestedEc2SubnetIds; + } else if ("serviceAccessSecurityGroup".equals(fieldName)) { + deserializedEc2InstanceAttributes.serviceAccessSecurityGroup = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedEc2InstanceAttributes; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/Ec2InstanceListResult.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/Ec2InstanceListResult.java new file mode 100644 index 000000000000..3d28e8a1d01f --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/Ec2InstanceListResult.java @@ -0,0 +1,134 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.awsconnector.fluent.models.Ec2InstanceInner; +import java.io.IOException; +import java.util.List; + +/** + * The response of a Ec2Instance list operation. + */ +@Fluent +public final class Ec2InstanceListResult implements JsonSerializable { + /* + * The Ec2Instance items on this page + */ + private List value; + + /* + * The link to the next page of items + */ + private String nextLink; + + /** + * Creates an instance of Ec2InstanceListResult class. + */ + public Ec2InstanceListResult() { + } + + /** + * Get the value property: The Ec2Instance items on this page. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The Ec2Instance items on this page. + * + * @param value the value value to set. + * @return the Ec2InstanceListResult object itself. + */ + public Ec2InstanceListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The link to the next page of items. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: The link to the next page of items. + * + * @param nextLink the nextLink value to set. + * @return the Ec2InstanceListResult object itself. + */ + public Ec2InstanceListResult withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property value in model Ec2InstanceListResult")); + } else { + value().forEach(e -> e.validate()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(Ec2InstanceListResult.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("nextLink", this.nextLink); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of Ec2InstanceListResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of Ec2InstanceListResult if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the Ec2InstanceListResult. + */ + public static Ec2InstanceListResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + Ec2InstanceListResult deserializedEc2InstanceListResult = new Ec2InstanceListResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value = reader.readArray(reader1 -> Ec2InstanceInner.fromJson(reader1)); + deserializedEc2InstanceListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedEc2InstanceListResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedEc2InstanceListResult; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/Ec2InstanceProperties.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/Ec2InstanceProperties.java new file mode 100644 index 000000000000..c1b3ce792aa9 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/Ec2InstanceProperties.java @@ -0,0 +1,311 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.Map; + +/** + * Definition of Ec2Instance. + */ +@Fluent +public final class Ec2InstanceProperties implements JsonSerializable { + /* + * AWS Properties + */ + private AwsEc2InstanceProperties awsProperties; + + /* + * Public Cloud Connectors Resource ID + */ + private String publicCloudConnectorsResourceId; + + /* + * AWS Account ID + */ + private String awsAccountId; + + /* + * Amazon Resource Name (ARN) + */ + private String arn; + + /* + * Public Cloud Resource Name + */ + private String publicCloudResourceName; + + /* + * AWS Source Schema + */ + private String awsSourceSchema; + + /* + * AWS Region + */ + private String awsRegion; + + /* + * AWS Tags + */ + private Map awsTags; + + /* + * The status of the last operation. + */ + private ProvisioningState provisioningState; + + /** + * Creates an instance of Ec2InstanceProperties class. + */ + public Ec2InstanceProperties() { + } + + /** + * Get the awsProperties property: AWS Properties. + * + * @return the awsProperties value. + */ + public AwsEc2InstanceProperties awsProperties() { + return this.awsProperties; + } + + /** + * Set the awsProperties property: AWS Properties. + * + * @param awsProperties the awsProperties value to set. + * @return the Ec2InstanceProperties object itself. + */ + public Ec2InstanceProperties withAwsProperties(AwsEc2InstanceProperties awsProperties) { + this.awsProperties = awsProperties; + return this; + } + + /** + * Get the publicCloudConnectorsResourceId property: Public Cloud Connectors Resource ID. + * + * @return the publicCloudConnectorsResourceId value. + */ + public String publicCloudConnectorsResourceId() { + return this.publicCloudConnectorsResourceId; + } + + /** + * Set the publicCloudConnectorsResourceId property: Public Cloud Connectors Resource ID. + * + * @param publicCloudConnectorsResourceId the publicCloudConnectorsResourceId value to set. + * @return the Ec2InstanceProperties object itself. + */ + public Ec2InstanceProperties withPublicCloudConnectorsResourceId(String publicCloudConnectorsResourceId) { + this.publicCloudConnectorsResourceId = publicCloudConnectorsResourceId; + return this; + } + + /** + * Get the awsAccountId property: AWS Account ID. + * + * @return the awsAccountId value. + */ + public String awsAccountId() { + return this.awsAccountId; + } + + /** + * Set the awsAccountId property: AWS Account ID. + * + * @param awsAccountId the awsAccountId value to set. + * @return the Ec2InstanceProperties object itself. + */ + public Ec2InstanceProperties withAwsAccountId(String awsAccountId) { + this.awsAccountId = awsAccountId; + return this; + } + + /** + * Get the arn property: Amazon Resource Name (ARN). + * + * @return the arn value. + */ + public String arn() { + return this.arn; + } + + /** + * Set the arn property: Amazon Resource Name (ARN). + * + * @param arn the arn value to set. + * @return the Ec2InstanceProperties object itself. + */ + public Ec2InstanceProperties withArn(String arn) { + this.arn = arn; + return this; + } + + /** + * Get the publicCloudResourceName property: Public Cloud Resource Name. + * + * @return the publicCloudResourceName value. + */ + public String publicCloudResourceName() { + return this.publicCloudResourceName; + } + + /** + * Set the publicCloudResourceName property: Public Cloud Resource Name. + * + * @param publicCloudResourceName the publicCloudResourceName value to set. + * @return the Ec2InstanceProperties object itself. + */ + public Ec2InstanceProperties withPublicCloudResourceName(String publicCloudResourceName) { + this.publicCloudResourceName = publicCloudResourceName; + return this; + } + + /** + * Get the awsSourceSchema property: AWS Source Schema. + * + * @return the awsSourceSchema value. + */ + public String awsSourceSchema() { + return this.awsSourceSchema; + } + + /** + * Set the awsSourceSchema property: AWS Source Schema. + * + * @param awsSourceSchema the awsSourceSchema value to set. + * @return the Ec2InstanceProperties object itself. + */ + public Ec2InstanceProperties withAwsSourceSchema(String awsSourceSchema) { + this.awsSourceSchema = awsSourceSchema; + return this; + } + + /** + * Get the awsRegion property: AWS Region. + * + * @return the awsRegion value. + */ + public String awsRegion() { + return this.awsRegion; + } + + /** + * Set the awsRegion property: AWS Region. + * + * @param awsRegion the awsRegion value to set. + * @return the Ec2InstanceProperties object itself. + */ + public Ec2InstanceProperties withAwsRegion(String awsRegion) { + this.awsRegion = awsRegion; + return this; + } + + /** + * Get the awsTags property: AWS Tags. + * + * @return the awsTags value. + */ + public Map awsTags() { + return this.awsTags; + } + + /** + * Set the awsTags property: AWS Tags. + * + * @param awsTags the awsTags value to set. + * @return the Ec2InstanceProperties object itself. + */ + public Ec2InstanceProperties withAwsTags(Map awsTags) { + this.awsTags = awsTags; + return this; + } + + /** + * Get the provisioningState property: The status of the last operation. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (awsProperties() != null) { + awsProperties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("awsProperties", this.awsProperties); + jsonWriter.writeStringField("publicCloudConnectorsResourceId", this.publicCloudConnectorsResourceId); + jsonWriter.writeStringField("awsAccountId", this.awsAccountId); + jsonWriter.writeStringField("arn", this.arn); + jsonWriter.writeStringField("publicCloudResourceName", this.publicCloudResourceName); + jsonWriter.writeStringField("awsSourceSchema", this.awsSourceSchema); + jsonWriter.writeStringField("awsRegion", this.awsRegion); + jsonWriter.writeMapField("awsTags", this.awsTags, (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of Ec2InstanceProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of Ec2InstanceProperties if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the Ec2InstanceProperties. + */ + public static Ec2InstanceProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + Ec2InstanceProperties deserializedEc2InstanceProperties = new Ec2InstanceProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("awsProperties".equals(fieldName)) { + deserializedEc2InstanceProperties.awsProperties = AwsEc2InstanceProperties.fromJson(reader); + } else if ("publicCloudConnectorsResourceId".equals(fieldName)) { + deserializedEc2InstanceProperties.publicCloudConnectorsResourceId = reader.getString(); + } else if ("awsAccountId".equals(fieldName)) { + deserializedEc2InstanceProperties.awsAccountId = reader.getString(); + } else if ("arn".equals(fieldName)) { + deserializedEc2InstanceProperties.arn = reader.getString(); + } else if ("publicCloudResourceName".equals(fieldName)) { + deserializedEc2InstanceProperties.publicCloudResourceName = reader.getString(); + } else if ("awsSourceSchema".equals(fieldName)) { + deserializedEc2InstanceProperties.awsSourceSchema = reader.getString(); + } else if ("awsRegion".equals(fieldName)) { + deserializedEc2InstanceProperties.awsRegion = reader.getString(); + } else if ("awsTags".equals(fieldName)) { + Map awsTags = reader.readMap(reader1 -> reader1.getString()); + deserializedEc2InstanceProperties.awsTags = awsTags; + } else if ("provisioningState".equals(fieldName)) { + deserializedEc2InstanceProperties.provisioningState + = ProvisioningState.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedEc2InstanceProperties; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/Ec2InstanceStatus.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/Ec2InstanceStatus.java new file mode 100644 index 000000000000..6330526dad67 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/Ec2InstanceStatus.java @@ -0,0 +1,252 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.awsconnector.fluent.models.Ec2InstanceStatusInner; +import java.util.Map; + +/** + * An immutable client-side representation of Ec2InstanceStatus. + */ +public interface Ec2InstanceStatus { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the location property: The geo-location where the resource lives. + * + * @return the location value. + */ + String location(); + + /** + * Gets the tags property: Resource tags. + * + * @return the tags value. + */ + Map tags(); + + /** + * Gets the properties property: The resource-specific properties for this resource. + * + * @return the properties value. + */ + Ec2InstanceStatusProperties properties(); + + /** + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the region of the resource. + * + * @return the region of the resource. + */ + Region region(); + + /** + * Gets the name of the resource region. + * + * @return the name of the resource region. + */ + String regionName(); + + /** + * Gets the name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + + /** + * Gets the inner com.azure.resourcemanager.awsconnector.fluent.models.Ec2InstanceStatusInner object. + * + * @return the inner object. + */ + Ec2InstanceStatusInner innerModel(); + + /** + * The entirety of the Ec2InstanceStatus definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithLocation, + DefinitionStages.WithResourceGroup, DefinitionStages.WithCreate { + } + + /** + * The Ec2InstanceStatus definition stages. + */ + interface DefinitionStages { + /** + * The first stage of the Ec2InstanceStatus definition. + */ + interface Blank extends WithLocation { + } + + /** + * The stage of the Ec2InstanceStatus definition allowing to specify location. + */ + interface WithLocation { + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithResourceGroup withRegion(Region location); + + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithResourceGroup withRegion(String location); + } + + /** + * The stage of the Ec2InstanceStatus definition allowing to specify parent resource. + */ + interface WithResourceGroup { + /** + * Specifies resourceGroupName. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @return the next definition stage. + */ + WithCreate withExistingResourceGroup(String resourceGroupName); + } + + /** + * The stage of the Ec2InstanceStatus 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.WithProperties { + /** + * Executes the create request. + * + * @return the created resource. + */ + Ec2InstanceStatus create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + Ec2InstanceStatus create(Context context); + } + + /** + * The stage of the Ec2InstanceStatus definition allowing to specify tags. + */ + interface WithTags { + /** + * Specifies the tags property: Resource tags.. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + WithCreate withTags(Map tags); + } + + /** + * The stage of the Ec2InstanceStatus definition allowing to specify properties. + */ + interface WithProperties { + /** + * Specifies the properties property: The resource-specific properties for this resource.. + * + * @param properties The resource-specific properties for this resource. + * @return the next definition stage. + */ + WithCreate withProperties(Ec2InstanceStatusProperties properties); + } + } + + /** + * Begins update for the Ec2InstanceStatus resource. + * + * @return the stage of resource update. + */ + Ec2InstanceStatus.Update update(); + + /** + * The template for Ec2InstanceStatus update. + */ + interface Update extends UpdateStages.WithTags { + /** + * Executes the update request. + * + * @return the updated resource. + */ + Ec2InstanceStatus apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + Ec2InstanceStatus apply(Context context); + } + + /** + * The Ec2InstanceStatus update stages. + */ + interface UpdateStages { + /** + * The stage of the Ec2InstanceStatus update allowing to specify tags. + */ + interface WithTags { + /** + * Specifies the tags property: Resource tags.. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + Update withTags(Map tags); + } + } + + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + Ec2InstanceStatus refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + Ec2InstanceStatus refresh(Context context); +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/Ec2InstanceStatusListResult.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/Ec2InstanceStatusListResult.java new file mode 100644 index 000000000000..902ad40aff48 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/Ec2InstanceStatusListResult.java @@ -0,0 +1,136 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.awsconnector.fluent.models.Ec2InstanceStatusInner; +import java.io.IOException; +import java.util.List; + +/** + * The response of a Ec2InstanceStatus list operation. + */ +@Fluent +public final class Ec2InstanceStatusListResult implements JsonSerializable { + /* + * The Ec2InstanceStatus items on this page + */ + private List value; + + /* + * The link to the next page of items + */ + private String nextLink; + + /** + * Creates an instance of Ec2InstanceStatusListResult class. + */ + public Ec2InstanceStatusListResult() { + } + + /** + * Get the value property: The Ec2InstanceStatus items on this page. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The Ec2InstanceStatus items on this page. + * + * @param value the value value to set. + * @return the Ec2InstanceStatusListResult object itself. + */ + public Ec2InstanceStatusListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The link to the next page of items. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: The link to the next page of items. + * + * @param nextLink the nextLink value to set. + * @return the Ec2InstanceStatusListResult object itself. + */ + public Ec2InstanceStatusListResult withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property value in model Ec2InstanceStatusListResult")); + } else { + value().forEach(e -> e.validate()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(Ec2InstanceStatusListResult.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("nextLink", this.nextLink); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of Ec2InstanceStatusListResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of Ec2InstanceStatusListResult if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the Ec2InstanceStatusListResult. + */ + public static Ec2InstanceStatusListResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + Ec2InstanceStatusListResult deserializedEc2InstanceStatusListResult = new Ec2InstanceStatusListResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> Ec2InstanceStatusInner.fromJson(reader1)); + deserializedEc2InstanceStatusListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedEc2InstanceStatusListResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedEc2InstanceStatusListResult; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/Ec2InstanceStatusProperties.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/Ec2InstanceStatusProperties.java new file mode 100644 index 000000000000..f5f9305acd02 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/Ec2InstanceStatusProperties.java @@ -0,0 +1,312 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.Map; + +/** + * Definition of Ec2InstanceStatus. + */ +@Fluent +public final class Ec2InstanceStatusProperties implements JsonSerializable { + /* + * AWS Properties + */ + private AwsEc2InstanceStatusProperties awsProperties; + + /* + * Public Cloud Connectors Resource ID + */ + private String publicCloudConnectorsResourceId; + + /* + * AWS Account ID + */ + private String awsAccountId; + + /* + * Amazon Resource Name (ARN) + */ + private String arn; + + /* + * Public Cloud Resource Name + */ + private String publicCloudResourceName; + + /* + * AWS Source Schema + */ + private String awsSourceSchema; + + /* + * AWS Region + */ + private String awsRegion; + + /* + * AWS Tags + */ + private Map awsTags; + + /* + * The status of the last operation. + */ + private ProvisioningState provisioningState; + + /** + * Creates an instance of Ec2InstanceStatusProperties class. + */ + public Ec2InstanceStatusProperties() { + } + + /** + * Get the awsProperties property: AWS Properties. + * + * @return the awsProperties value. + */ + public AwsEc2InstanceStatusProperties awsProperties() { + return this.awsProperties; + } + + /** + * Set the awsProperties property: AWS Properties. + * + * @param awsProperties the awsProperties value to set. + * @return the Ec2InstanceStatusProperties object itself. + */ + public Ec2InstanceStatusProperties withAwsProperties(AwsEc2InstanceStatusProperties awsProperties) { + this.awsProperties = awsProperties; + return this; + } + + /** + * Get the publicCloudConnectorsResourceId property: Public Cloud Connectors Resource ID. + * + * @return the publicCloudConnectorsResourceId value. + */ + public String publicCloudConnectorsResourceId() { + return this.publicCloudConnectorsResourceId; + } + + /** + * Set the publicCloudConnectorsResourceId property: Public Cloud Connectors Resource ID. + * + * @param publicCloudConnectorsResourceId the publicCloudConnectorsResourceId value to set. + * @return the Ec2InstanceStatusProperties object itself. + */ + public Ec2InstanceStatusProperties withPublicCloudConnectorsResourceId(String publicCloudConnectorsResourceId) { + this.publicCloudConnectorsResourceId = publicCloudConnectorsResourceId; + return this; + } + + /** + * Get the awsAccountId property: AWS Account ID. + * + * @return the awsAccountId value. + */ + public String awsAccountId() { + return this.awsAccountId; + } + + /** + * Set the awsAccountId property: AWS Account ID. + * + * @param awsAccountId the awsAccountId value to set. + * @return the Ec2InstanceStatusProperties object itself. + */ + public Ec2InstanceStatusProperties withAwsAccountId(String awsAccountId) { + this.awsAccountId = awsAccountId; + return this; + } + + /** + * Get the arn property: Amazon Resource Name (ARN). + * + * @return the arn value. + */ + public String arn() { + return this.arn; + } + + /** + * Set the arn property: Amazon Resource Name (ARN). + * + * @param arn the arn value to set. + * @return the Ec2InstanceStatusProperties object itself. + */ + public Ec2InstanceStatusProperties withArn(String arn) { + this.arn = arn; + return this; + } + + /** + * Get the publicCloudResourceName property: Public Cloud Resource Name. + * + * @return the publicCloudResourceName value. + */ + public String publicCloudResourceName() { + return this.publicCloudResourceName; + } + + /** + * Set the publicCloudResourceName property: Public Cloud Resource Name. + * + * @param publicCloudResourceName the publicCloudResourceName value to set. + * @return the Ec2InstanceStatusProperties object itself. + */ + public Ec2InstanceStatusProperties withPublicCloudResourceName(String publicCloudResourceName) { + this.publicCloudResourceName = publicCloudResourceName; + return this; + } + + /** + * Get the awsSourceSchema property: AWS Source Schema. + * + * @return the awsSourceSchema value. + */ + public String awsSourceSchema() { + return this.awsSourceSchema; + } + + /** + * Set the awsSourceSchema property: AWS Source Schema. + * + * @param awsSourceSchema the awsSourceSchema value to set. + * @return the Ec2InstanceStatusProperties object itself. + */ + public Ec2InstanceStatusProperties withAwsSourceSchema(String awsSourceSchema) { + this.awsSourceSchema = awsSourceSchema; + return this; + } + + /** + * Get the awsRegion property: AWS Region. + * + * @return the awsRegion value. + */ + public String awsRegion() { + return this.awsRegion; + } + + /** + * Set the awsRegion property: AWS Region. + * + * @param awsRegion the awsRegion value to set. + * @return the Ec2InstanceStatusProperties object itself. + */ + public Ec2InstanceStatusProperties withAwsRegion(String awsRegion) { + this.awsRegion = awsRegion; + return this; + } + + /** + * Get the awsTags property: AWS Tags. + * + * @return the awsTags value. + */ + public Map awsTags() { + return this.awsTags; + } + + /** + * Set the awsTags property: AWS Tags. + * + * @param awsTags the awsTags value to set. + * @return the Ec2InstanceStatusProperties object itself. + */ + public Ec2InstanceStatusProperties withAwsTags(Map awsTags) { + this.awsTags = awsTags; + return this; + } + + /** + * Get the provisioningState property: The status of the last operation. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (awsProperties() != null) { + awsProperties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("awsProperties", this.awsProperties); + jsonWriter.writeStringField("publicCloudConnectorsResourceId", this.publicCloudConnectorsResourceId); + jsonWriter.writeStringField("awsAccountId", this.awsAccountId); + jsonWriter.writeStringField("arn", this.arn); + jsonWriter.writeStringField("publicCloudResourceName", this.publicCloudResourceName); + jsonWriter.writeStringField("awsSourceSchema", this.awsSourceSchema); + jsonWriter.writeStringField("awsRegion", this.awsRegion); + jsonWriter.writeMapField("awsTags", this.awsTags, (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of Ec2InstanceStatusProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of Ec2InstanceStatusProperties if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the Ec2InstanceStatusProperties. + */ + public static Ec2InstanceStatusProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + Ec2InstanceStatusProperties deserializedEc2InstanceStatusProperties = new Ec2InstanceStatusProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("awsProperties".equals(fieldName)) { + deserializedEc2InstanceStatusProperties.awsProperties + = AwsEc2InstanceStatusProperties.fromJson(reader); + } else if ("publicCloudConnectorsResourceId".equals(fieldName)) { + deserializedEc2InstanceStatusProperties.publicCloudConnectorsResourceId = reader.getString(); + } else if ("awsAccountId".equals(fieldName)) { + deserializedEc2InstanceStatusProperties.awsAccountId = reader.getString(); + } else if ("arn".equals(fieldName)) { + deserializedEc2InstanceStatusProperties.arn = reader.getString(); + } else if ("publicCloudResourceName".equals(fieldName)) { + deserializedEc2InstanceStatusProperties.publicCloudResourceName = reader.getString(); + } else if ("awsSourceSchema".equals(fieldName)) { + deserializedEc2InstanceStatusProperties.awsSourceSchema = reader.getString(); + } else if ("awsRegion".equals(fieldName)) { + deserializedEc2InstanceStatusProperties.awsRegion = reader.getString(); + } else if ("awsTags".equals(fieldName)) { + Map awsTags = reader.readMap(reader1 -> reader1.getString()); + deserializedEc2InstanceStatusProperties.awsTags = awsTags; + } else if ("provisioningState".equals(fieldName)) { + deserializedEc2InstanceStatusProperties.provisioningState + = ProvisioningState.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedEc2InstanceStatusProperties; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/Ec2InstanceStatusTagsUpdate.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/Ec2InstanceStatusTagsUpdate.java new file mode 100644 index 000000000000..058cde3efea5 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/Ec2InstanceStatusTagsUpdate.java @@ -0,0 +1,95 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.Map; + +/** + * The type used for updating tags in Ec2InstanceStatus resources. + */ +@Fluent +public final class Ec2InstanceStatusTagsUpdate implements JsonSerializable { + /* + * Resource tags. + */ + private Map tags; + + /** + * Creates an instance of Ec2InstanceStatusTagsUpdate class. + */ + public Ec2InstanceStatusTagsUpdate() { + } + + /** + * Get the tags property: Resource tags. + * + * @return the tags value. + */ + public Map tags() { + return this.tags; + } + + /** + * Set the tags property: Resource tags. + * + * @param tags the tags value to set. + * @return the Ec2InstanceStatusTagsUpdate object itself. + */ + public Ec2InstanceStatusTagsUpdate withTags(Map tags) { + this.tags = tags; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeMapField("tags", this.tags, (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of Ec2InstanceStatusTagsUpdate from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of Ec2InstanceStatusTagsUpdate if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the Ec2InstanceStatusTagsUpdate. + */ + public static Ec2InstanceStatusTagsUpdate fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + Ec2InstanceStatusTagsUpdate deserializedEc2InstanceStatusTagsUpdate = new Ec2InstanceStatusTagsUpdate(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedEc2InstanceStatusTagsUpdate.tags = tags; + } else { + reader.skipChildren(); + } + } + + return deserializedEc2InstanceStatusTagsUpdate; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/Ec2InstanceStatuses.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/Ec2InstanceStatuses.java new file mode 100644 index 000000000000..b60f5dc6a3db --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/Ec2InstanceStatuses.java @@ -0,0 +1,157 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** + * Resource collection API of Ec2InstanceStatuses. + */ +public interface Ec2InstanceStatuses { + /** + * List Ec2InstanceStatus resources by subscription ID. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Ec2InstanceStatus list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable list(); + + /** + * List Ec2InstanceStatus resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Ec2InstanceStatus list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable list(Context context); + + /** + * List Ec2InstanceStatus resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Ec2InstanceStatus list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * List Ec2InstanceStatus resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Ec2InstanceStatus list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Get a Ec2InstanceStatus. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2InstanceStatus. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Ec2InstanceStatus along with {@link Response}. + */ + Response getByResourceGroupWithResponse(String resourceGroupName, String name, Context context); + + /** + * Get a Ec2InstanceStatus. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2InstanceStatus. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Ec2InstanceStatus. + */ + Ec2InstanceStatus getByResourceGroup(String resourceGroupName, String name); + + /** + * Delete a Ec2InstanceStatus. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2InstanceStatus. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByResourceGroup(String resourceGroupName, String name); + + /** + * Delete a Ec2InstanceStatus. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2InstanceStatus. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String name, Context context); + + /** + * Get a Ec2InstanceStatus. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Ec2InstanceStatus along with {@link Response}. + */ + Ec2InstanceStatus getById(String id); + + /** + * Get a Ec2InstanceStatus. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Ec2InstanceStatus along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Delete a Ec2InstanceStatus. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteById(String id); + + /** + * Delete a Ec2InstanceStatus. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new Ec2InstanceStatus resource. + * + * @param name resource name. + * @return the first stage of the new Ec2InstanceStatus definition. + */ + Ec2InstanceStatus.DefinitionStages.Blank define(String name); +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/Ec2Instances.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/Ec2Instances.java new file mode 100644 index 000000000000..95966d74b6ca --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/Ec2Instances.java @@ -0,0 +1,157 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.awsconnector.fluent.models.Ec2InstanceInner; + +/** + * Resource collection API of Ec2Instances. + */ +public interface Ec2Instances { + /** + * List Ec2Instance resources by parent. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Ec2Instance list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable list(String resourceUri); + + /** + * List Ec2Instance resources by parent. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Ec2Instance list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable list(String resourceUri, Context context); + + /** + * Get a Ec2Instance. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Ec2Instance along with {@link Response}. + */ + Response getWithResponse(String resourceUri, Context context); + + /** + * Get a Ec2Instance. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Ec2Instance. + */ + Ec2Instance get(String resourceUri); + + /** + * Create a Ec2Instance. Please note that end user resource creation is currently restricted, but it will be enabled + * in the future. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + Ec2Instance createOrReplace(String resourceUri, Ec2InstanceInner resource); + + /** + * Create a Ec2Instance. Please note that end user resource creation is currently restricted, but it will be enabled + * in the future. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + Ec2Instance createOrReplace(String resourceUri, Ec2InstanceInner resource, Context context); + + /** + * Delete a Ec2Instance. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceUri); + + /** + * Delete a Ec2Instance. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceUri, Context context); + + /** + * A long-running resource action. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the current status of an async operation. + */ + OperationStatusResult start(String resourceUri); + + /** + * A long-running resource action. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the current status of an async operation. + */ + OperationStatusResult start(String resourceUri, Context context); + + /** + * A long-running resource action. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. + * @param body The content of the action request. + * @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 current status of an async operation. + */ + OperationStatusResult stop(String resourceUri, StopEc2InstanceOptions body); + + /** + * A long-running resource action. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. + * @param body The content of the action request. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the current status of an async operation. + */ + OperationStatusResult stop(String resourceUri, StopEc2InstanceOptions body, Context context); +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/Ec2Ipam.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/Ec2Ipam.java new file mode 100644 index 000000000000..0fbba487f678 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/Ec2Ipam.java @@ -0,0 +1,252 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.awsconnector.fluent.models.Ec2IpamInner; +import java.util.Map; + +/** + * An immutable client-side representation of Ec2Ipam. + */ +public interface Ec2Ipam { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the location property: The geo-location where the resource lives. + * + * @return the location value. + */ + String location(); + + /** + * Gets the tags property: Resource tags. + * + * @return the tags value. + */ + Map tags(); + + /** + * Gets the properties property: The resource-specific properties for this resource. + * + * @return the properties value. + */ + Ec2IpamProperties properties(); + + /** + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the region of the resource. + * + * @return the region of the resource. + */ + Region region(); + + /** + * Gets the name of the resource region. + * + * @return the name of the resource region. + */ + String regionName(); + + /** + * Gets the name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + + /** + * Gets the inner com.azure.resourcemanager.awsconnector.fluent.models.Ec2IpamInner object. + * + * @return the inner object. + */ + Ec2IpamInner innerModel(); + + /** + * The entirety of the Ec2Ipam definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithLocation, + DefinitionStages.WithResourceGroup, DefinitionStages.WithCreate { + } + + /** + * The Ec2Ipam definition stages. + */ + interface DefinitionStages { + /** + * The first stage of the Ec2Ipam definition. + */ + interface Blank extends WithLocation { + } + + /** + * The stage of the Ec2Ipam definition allowing to specify location. + */ + interface WithLocation { + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithResourceGroup withRegion(Region location); + + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithResourceGroup withRegion(String location); + } + + /** + * The stage of the Ec2Ipam definition allowing to specify parent resource. + */ + interface WithResourceGroup { + /** + * Specifies resourceGroupName. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @return the next definition stage. + */ + WithCreate withExistingResourceGroup(String resourceGroupName); + } + + /** + * The stage of the Ec2Ipam 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.WithProperties { + /** + * Executes the create request. + * + * @return the created resource. + */ + Ec2Ipam create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + Ec2Ipam create(Context context); + } + + /** + * The stage of the Ec2Ipam definition allowing to specify tags. + */ + interface WithTags { + /** + * Specifies the tags property: Resource tags.. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + WithCreate withTags(Map tags); + } + + /** + * The stage of the Ec2Ipam definition allowing to specify properties. + */ + interface WithProperties { + /** + * Specifies the properties property: The resource-specific properties for this resource.. + * + * @param properties The resource-specific properties for this resource. + * @return the next definition stage. + */ + WithCreate withProperties(Ec2IpamProperties properties); + } + } + + /** + * Begins update for the Ec2Ipam resource. + * + * @return the stage of resource update. + */ + Ec2Ipam.Update update(); + + /** + * The template for Ec2Ipam update. + */ + interface Update extends UpdateStages.WithTags { + /** + * Executes the update request. + * + * @return the updated resource. + */ + Ec2Ipam apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + Ec2Ipam apply(Context context); + } + + /** + * The Ec2Ipam update stages. + */ + interface UpdateStages { + /** + * The stage of the Ec2Ipam update allowing to specify tags. + */ + interface WithTags { + /** + * Specifies the tags property: Resource tags.. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + Update withTags(Map tags); + } + } + + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + Ec2Ipam refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + Ec2Ipam refresh(Context context); +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/Ec2IpamListResult.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/Ec2IpamListResult.java new file mode 100644 index 000000000000..a79fc150b423 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/Ec2IpamListResult.java @@ -0,0 +1,134 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.awsconnector.fluent.models.Ec2IpamInner; +import java.io.IOException; +import java.util.List; + +/** + * The response of a Ec2Ipam list operation. + */ +@Fluent +public final class Ec2IpamListResult implements JsonSerializable { + /* + * The Ec2Ipam items on this page + */ + private List value; + + /* + * The link to the next page of items + */ + private String nextLink; + + /** + * Creates an instance of Ec2IpamListResult class. + */ + public Ec2IpamListResult() { + } + + /** + * Get the value property: The Ec2Ipam items on this page. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The Ec2Ipam items on this page. + * + * @param value the value value to set. + * @return the Ec2IpamListResult object itself. + */ + public Ec2IpamListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The link to the next page of items. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: The link to the next page of items. + * + * @param nextLink the nextLink value to set. + * @return the Ec2IpamListResult object itself. + */ + public Ec2IpamListResult withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property value in model Ec2IpamListResult")); + } else { + value().forEach(e -> e.validate()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(Ec2IpamListResult.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("nextLink", this.nextLink); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of Ec2IpamListResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of Ec2IpamListResult if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the Ec2IpamListResult. + */ + public static Ec2IpamListResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + Ec2IpamListResult deserializedEc2IpamListResult = new Ec2IpamListResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value = reader.readArray(reader1 -> Ec2IpamInner.fromJson(reader1)); + deserializedEc2IpamListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedEc2IpamListResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedEc2IpamListResult; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/Ec2IpamProperties.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/Ec2IpamProperties.java new file mode 100644 index 000000000000..34736369d82f --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/Ec2IpamProperties.java @@ -0,0 +1,310 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.Map; + +/** + * Definition of Ec2Ipam. + */ +@Fluent +public final class Ec2IpamProperties implements JsonSerializable { + /* + * AWS Properties + */ + private AwsEc2IpamProperties awsProperties; + + /* + * Public Cloud Connectors Resource ID + */ + private String publicCloudConnectorsResourceId; + + /* + * AWS Account ID + */ + private String awsAccountId; + + /* + * Amazon Resource Name (ARN) + */ + private String arn; + + /* + * Public Cloud Resource Name + */ + private String publicCloudResourceName; + + /* + * AWS Source Schema + */ + private String awsSourceSchema; + + /* + * AWS Region + */ + private String awsRegion; + + /* + * AWS Tags + */ + private Map awsTags; + + /* + * The status of the last operation. + */ + private ProvisioningState provisioningState; + + /** + * Creates an instance of Ec2IpamProperties class. + */ + public Ec2IpamProperties() { + } + + /** + * Get the awsProperties property: AWS Properties. + * + * @return the awsProperties value. + */ + public AwsEc2IpamProperties awsProperties() { + return this.awsProperties; + } + + /** + * Set the awsProperties property: AWS Properties. + * + * @param awsProperties the awsProperties value to set. + * @return the Ec2IpamProperties object itself. + */ + public Ec2IpamProperties withAwsProperties(AwsEc2IpamProperties awsProperties) { + this.awsProperties = awsProperties; + return this; + } + + /** + * Get the publicCloudConnectorsResourceId property: Public Cloud Connectors Resource ID. + * + * @return the publicCloudConnectorsResourceId value. + */ + public String publicCloudConnectorsResourceId() { + return this.publicCloudConnectorsResourceId; + } + + /** + * Set the publicCloudConnectorsResourceId property: Public Cloud Connectors Resource ID. + * + * @param publicCloudConnectorsResourceId the publicCloudConnectorsResourceId value to set. + * @return the Ec2IpamProperties object itself. + */ + public Ec2IpamProperties withPublicCloudConnectorsResourceId(String publicCloudConnectorsResourceId) { + this.publicCloudConnectorsResourceId = publicCloudConnectorsResourceId; + return this; + } + + /** + * Get the awsAccountId property: AWS Account ID. + * + * @return the awsAccountId value. + */ + public String awsAccountId() { + return this.awsAccountId; + } + + /** + * Set the awsAccountId property: AWS Account ID. + * + * @param awsAccountId the awsAccountId value to set. + * @return the Ec2IpamProperties object itself. + */ + public Ec2IpamProperties withAwsAccountId(String awsAccountId) { + this.awsAccountId = awsAccountId; + return this; + } + + /** + * Get the arn property: Amazon Resource Name (ARN). + * + * @return the arn value. + */ + public String arn() { + return this.arn; + } + + /** + * Set the arn property: Amazon Resource Name (ARN). + * + * @param arn the arn value to set. + * @return the Ec2IpamProperties object itself. + */ + public Ec2IpamProperties withArn(String arn) { + this.arn = arn; + return this; + } + + /** + * Get the publicCloudResourceName property: Public Cloud Resource Name. + * + * @return the publicCloudResourceName value. + */ + public String publicCloudResourceName() { + return this.publicCloudResourceName; + } + + /** + * Set the publicCloudResourceName property: Public Cloud Resource Name. + * + * @param publicCloudResourceName the publicCloudResourceName value to set. + * @return the Ec2IpamProperties object itself. + */ + public Ec2IpamProperties withPublicCloudResourceName(String publicCloudResourceName) { + this.publicCloudResourceName = publicCloudResourceName; + return this; + } + + /** + * Get the awsSourceSchema property: AWS Source Schema. + * + * @return the awsSourceSchema value. + */ + public String awsSourceSchema() { + return this.awsSourceSchema; + } + + /** + * Set the awsSourceSchema property: AWS Source Schema. + * + * @param awsSourceSchema the awsSourceSchema value to set. + * @return the Ec2IpamProperties object itself. + */ + public Ec2IpamProperties withAwsSourceSchema(String awsSourceSchema) { + this.awsSourceSchema = awsSourceSchema; + return this; + } + + /** + * Get the awsRegion property: AWS Region. + * + * @return the awsRegion value. + */ + public String awsRegion() { + return this.awsRegion; + } + + /** + * Set the awsRegion property: AWS Region. + * + * @param awsRegion the awsRegion value to set. + * @return the Ec2IpamProperties object itself. + */ + public Ec2IpamProperties withAwsRegion(String awsRegion) { + this.awsRegion = awsRegion; + return this; + } + + /** + * Get the awsTags property: AWS Tags. + * + * @return the awsTags value. + */ + public Map awsTags() { + return this.awsTags; + } + + /** + * Set the awsTags property: AWS Tags. + * + * @param awsTags the awsTags value to set. + * @return the Ec2IpamProperties object itself. + */ + public Ec2IpamProperties withAwsTags(Map awsTags) { + this.awsTags = awsTags; + return this; + } + + /** + * Get the provisioningState property: The status of the last operation. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (awsProperties() != null) { + awsProperties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("awsProperties", this.awsProperties); + jsonWriter.writeStringField("publicCloudConnectorsResourceId", this.publicCloudConnectorsResourceId); + jsonWriter.writeStringField("awsAccountId", this.awsAccountId); + jsonWriter.writeStringField("arn", this.arn); + jsonWriter.writeStringField("publicCloudResourceName", this.publicCloudResourceName); + jsonWriter.writeStringField("awsSourceSchema", this.awsSourceSchema); + jsonWriter.writeStringField("awsRegion", this.awsRegion); + jsonWriter.writeMapField("awsTags", this.awsTags, (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of Ec2IpamProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of Ec2IpamProperties if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the Ec2IpamProperties. + */ + public static Ec2IpamProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + Ec2IpamProperties deserializedEc2IpamProperties = new Ec2IpamProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("awsProperties".equals(fieldName)) { + deserializedEc2IpamProperties.awsProperties = AwsEc2IpamProperties.fromJson(reader); + } else if ("publicCloudConnectorsResourceId".equals(fieldName)) { + deserializedEc2IpamProperties.publicCloudConnectorsResourceId = reader.getString(); + } else if ("awsAccountId".equals(fieldName)) { + deserializedEc2IpamProperties.awsAccountId = reader.getString(); + } else if ("arn".equals(fieldName)) { + deserializedEc2IpamProperties.arn = reader.getString(); + } else if ("publicCloudResourceName".equals(fieldName)) { + deserializedEc2IpamProperties.publicCloudResourceName = reader.getString(); + } else if ("awsSourceSchema".equals(fieldName)) { + deserializedEc2IpamProperties.awsSourceSchema = reader.getString(); + } else if ("awsRegion".equals(fieldName)) { + deserializedEc2IpamProperties.awsRegion = reader.getString(); + } else if ("awsTags".equals(fieldName)) { + Map awsTags = reader.readMap(reader1 -> reader1.getString()); + deserializedEc2IpamProperties.awsTags = awsTags; + } else if ("provisioningState".equals(fieldName)) { + deserializedEc2IpamProperties.provisioningState = ProvisioningState.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedEc2IpamProperties; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/Ec2IpamTagsUpdate.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/Ec2IpamTagsUpdate.java new file mode 100644 index 000000000000..4d1ad2e885b8 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/Ec2IpamTagsUpdate.java @@ -0,0 +1,95 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.Map; + +/** + * The type used for updating tags in Ec2Ipam resources. + */ +@Fluent +public final class Ec2IpamTagsUpdate implements JsonSerializable { + /* + * Resource tags. + */ + private Map tags; + + /** + * Creates an instance of Ec2IpamTagsUpdate class. + */ + public Ec2IpamTagsUpdate() { + } + + /** + * Get the tags property: Resource tags. + * + * @return the tags value. + */ + public Map tags() { + return this.tags; + } + + /** + * Set the tags property: Resource tags. + * + * @param tags the tags value to set. + * @return the Ec2IpamTagsUpdate object itself. + */ + public Ec2IpamTagsUpdate withTags(Map tags) { + this.tags = tags; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeMapField("tags", this.tags, (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of Ec2IpamTagsUpdate from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of Ec2IpamTagsUpdate if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the Ec2IpamTagsUpdate. + */ + public static Ec2IpamTagsUpdate fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + Ec2IpamTagsUpdate deserializedEc2IpamTagsUpdate = new Ec2IpamTagsUpdate(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedEc2IpamTagsUpdate.tags = tags; + } else { + reader.skipChildren(); + } + } + + return deserializedEc2IpamTagsUpdate; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/Ec2Ipams.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/Ec2Ipams.java new file mode 100644 index 000000000000..3b66fb463bce --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/Ec2Ipams.java @@ -0,0 +1,157 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** + * Resource collection API of Ec2Ipams. + */ +public interface Ec2Ipams { + /** + * List Ec2Ipam resources by subscription ID. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Ec2Ipam list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable list(); + + /** + * List Ec2Ipam resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Ec2Ipam list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable list(Context context); + + /** + * List Ec2Ipam resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Ec2Ipam list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * List Ec2Ipam resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Ec2Ipam list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Get a Ec2Ipam. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2Ipam. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Ec2Ipam along with {@link Response}. + */ + Response getByResourceGroupWithResponse(String resourceGroupName, String name, Context context); + + /** + * Get a Ec2Ipam. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2Ipam. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Ec2Ipam. + */ + Ec2Ipam getByResourceGroup(String resourceGroupName, String name); + + /** + * Delete a Ec2Ipam. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2Ipam. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByResourceGroup(String resourceGroupName, String name); + + /** + * Delete a Ec2Ipam. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2Ipam. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String name, Context context); + + /** + * Get a Ec2Ipam. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Ec2Ipam along with {@link Response}. + */ + Ec2Ipam getById(String id); + + /** + * Get a Ec2Ipam. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Ec2Ipam along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Delete a Ec2Ipam. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteById(String id); + + /** + * Delete a Ec2Ipam. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new Ec2Ipam resource. + * + * @param name resource name. + * @return the first stage of the new Ec2Ipam definition. + */ + Ec2Ipam.DefinitionStages.Blank define(String name); +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/Ec2KeyPair.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/Ec2KeyPair.java new file mode 100644 index 000000000000..c6575ae365eb --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/Ec2KeyPair.java @@ -0,0 +1,252 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.awsconnector.fluent.models.Ec2KeyPairInner; +import java.util.Map; + +/** + * An immutable client-side representation of Ec2KeyPair. + */ +public interface Ec2KeyPair { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the location property: The geo-location where the resource lives. + * + * @return the location value. + */ + String location(); + + /** + * Gets the tags property: Resource tags. + * + * @return the tags value. + */ + Map tags(); + + /** + * Gets the properties property: The resource-specific properties for this resource. + * + * @return the properties value. + */ + Ec2KeyPairProperties properties(); + + /** + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the region of the resource. + * + * @return the region of the resource. + */ + Region region(); + + /** + * Gets the name of the resource region. + * + * @return the name of the resource region. + */ + String regionName(); + + /** + * Gets the name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + + /** + * Gets the inner com.azure.resourcemanager.awsconnector.fluent.models.Ec2KeyPairInner object. + * + * @return the inner object. + */ + Ec2KeyPairInner innerModel(); + + /** + * The entirety of the Ec2KeyPair definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithLocation, + DefinitionStages.WithResourceGroup, DefinitionStages.WithCreate { + } + + /** + * The Ec2KeyPair definition stages. + */ + interface DefinitionStages { + /** + * The first stage of the Ec2KeyPair definition. + */ + interface Blank extends WithLocation { + } + + /** + * The stage of the Ec2KeyPair definition allowing to specify location. + */ + interface WithLocation { + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithResourceGroup withRegion(Region location); + + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithResourceGroup withRegion(String location); + } + + /** + * The stage of the Ec2KeyPair definition allowing to specify parent resource. + */ + interface WithResourceGroup { + /** + * Specifies resourceGroupName. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @return the next definition stage. + */ + WithCreate withExistingResourceGroup(String resourceGroupName); + } + + /** + * The stage of the Ec2KeyPair 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.WithProperties { + /** + * Executes the create request. + * + * @return the created resource. + */ + Ec2KeyPair create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + Ec2KeyPair create(Context context); + } + + /** + * The stage of the Ec2KeyPair definition allowing to specify tags. + */ + interface WithTags { + /** + * Specifies the tags property: Resource tags.. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + WithCreate withTags(Map tags); + } + + /** + * The stage of the Ec2KeyPair definition allowing to specify properties. + */ + interface WithProperties { + /** + * Specifies the properties property: The resource-specific properties for this resource.. + * + * @param properties The resource-specific properties for this resource. + * @return the next definition stage. + */ + WithCreate withProperties(Ec2KeyPairProperties properties); + } + } + + /** + * Begins update for the Ec2KeyPair resource. + * + * @return the stage of resource update. + */ + Ec2KeyPair.Update update(); + + /** + * The template for Ec2KeyPair update. + */ + interface Update extends UpdateStages.WithTags { + /** + * Executes the update request. + * + * @return the updated resource. + */ + Ec2KeyPair apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + Ec2KeyPair apply(Context context); + } + + /** + * The Ec2KeyPair update stages. + */ + interface UpdateStages { + /** + * The stage of the Ec2KeyPair update allowing to specify tags. + */ + interface WithTags { + /** + * Specifies the tags property: Resource tags.. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + Update withTags(Map tags); + } + } + + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + Ec2KeyPair refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + Ec2KeyPair refresh(Context context); +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/Ec2KeyPairListResult.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/Ec2KeyPairListResult.java new file mode 100644 index 000000000000..3d94307e68e2 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/Ec2KeyPairListResult.java @@ -0,0 +1,134 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.awsconnector.fluent.models.Ec2KeyPairInner; +import java.io.IOException; +import java.util.List; + +/** + * The response of a Ec2KeyPair list operation. + */ +@Fluent +public final class Ec2KeyPairListResult implements JsonSerializable { + /* + * The Ec2KeyPair items on this page + */ + private List value; + + /* + * The link to the next page of items + */ + private String nextLink; + + /** + * Creates an instance of Ec2KeyPairListResult class. + */ + public Ec2KeyPairListResult() { + } + + /** + * Get the value property: The Ec2KeyPair items on this page. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The Ec2KeyPair items on this page. + * + * @param value the value value to set. + * @return the Ec2KeyPairListResult object itself. + */ + public Ec2KeyPairListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The link to the next page of items. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: The link to the next page of items. + * + * @param nextLink the nextLink value to set. + * @return the Ec2KeyPairListResult object itself. + */ + public Ec2KeyPairListResult withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property value in model Ec2KeyPairListResult")); + } else { + value().forEach(e -> e.validate()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(Ec2KeyPairListResult.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("nextLink", this.nextLink); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of Ec2KeyPairListResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of Ec2KeyPairListResult if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the Ec2KeyPairListResult. + */ + public static Ec2KeyPairListResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + Ec2KeyPairListResult deserializedEc2KeyPairListResult = new Ec2KeyPairListResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value = reader.readArray(reader1 -> Ec2KeyPairInner.fromJson(reader1)); + deserializedEc2KeyPairListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedEc2KeyPairListResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedEc2KeyPairListResult; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/Ec2KeyPairProperties.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/Ec2KeyPairProperties.java new file mode 100644 index 000000000000..7c3711da4ca4 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/Ec2KeyPairProperties.java @@ -0,0 +1,311 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.Map; + +/** + * Definition of Ec2KeyPair. + */ +@Fluent +public final class Ec2KeyPairProperties implements JsonSerializable { + /* + * AWS Properties + */ + private AwsEc2KeyPairProperties awsProperties; + + /* + * Public Cloud Connectors Resource ID + */ + private String publicCloudConnectorsResourceId; + + /* + * AWS Account ID + */ + private String awsAccountId; + + /* + * Amazon Resource Name (ARN) + */ + private String arn; + + /* + * Public Cloud Resource Name + */ + private String publicCloudResourceName; + + /* + * AWS Source Schema + */ + private String awsSourceSchema; + + /* + * AWS Region + */ + private String awsRegion; + + /* + * AWS Tags + */ + private Map awsTags; + + /* + * The status of the last operation. + */ + private ProvisioningState provisioningState; + + /** + * Creates an instance of Ec2KeyPairProperties class. + */ + public Ec2KeyPairProperties() { + } + + /** + * Get the awsProperties property: AWS Properties. + * + * @return the awsProperties value. + */ + public AwsEc2KeyPairProperties awsProperties() { + return this.awsProperties; + } + + /** + * Set the awsProperties property: AWS Properties. + * + * @param awsProperties the awsProperties value to set. + * @return the Ec2KeyPairProperties object itself. + */ + public Ec2KeyPairProperties withAwsProperties(AwsEc2KeyPairProperties awsProperties) { + this.awsProperties = awsProperties; + return this; + } + + /** + * Get the publicCloudConnectorsResourceId property: Public Cloud Connectors Resource ID. + * + * @return the publicCloudConnectorsResourceId value. + */ + public String publicCloudConnectorsResourceId() { + return this.publicCloudConnectorsResourceId; + } + + /** + * Set the publicCloudConnectorsResourceId property: Public Cloud Connectors Resource ID. + * + * @param publicCloudConnectorsResourceId the publicCloudConnectorsResourceId value to set. + * @return the Ec2KeyPairProperties object itself. + */ + public Ec2KeyPairProperties withPublicCloudConnectorsResourceId(String publicCloudConnectorsResourceId) { + this.publicCloudConnectorsResourceId = publicCloudConnectorsResourceId; + return this; + } + + /** + * Get the awsAccountId property: AWS Account ID. + * + * @return the awsAccountId value. + */ + public String awsAccountId() { + return this.awsAccountId; + } + + /** + * Set the awsAccountId property: AWS Account ID. + * + * @param awsAccountId the awsAccountId value to set. + * @return the Ec2KeyPairProperties object itself. + */ + public Ec2KeyPairProperties withAwsAccountId(String awsAccountId) { + this.awsAccountId = awsAccountId; + return this; + } + + /** + * Get the arn property: Amazon Resource Name (ARN). + * + * @return the arn value. + */ + public String arn() { + return this.arn; + } + + /** + * Set the arn property: Amazon Resource Name (ARN). + * + * @param arn the arn value to set. + * @return the Ec2KeyPairProperties object itself. + */ + public Ec2KeyPairProperties withArn(String arn) { + this.arn = arn; + return this; + } + + /** + * Get the publicCloudResourceName property: Public Cloud Resource Name. + * + * @return the publicCloudResourceName value. + */ + public String publicCloudResourceName() { + return this.publicCloudResourceName; + } + + /** + * Set the publicCloudResourceName property: Public Cloud Resource Name. + * + * @param publicCloudResourceName the publicCloudResourceName value to set. + * @return the Ec2KeyPairProperties object itself. + */ + public Ec2KeyPairProperties withPublicCloudResourceName(String publicCloudResourceName) { + this.publicCloudResourceName = publicCloudResourceName; + return this; + } + + /** + * Get the awsSourceSchema property: AWS Source Schema. + * + * @return the awsSourceSchema value. + */ + public String awsSourceSchema() { + return this.awsSourceSchema; + } + + /** + * Set the awsSourceSchema property: AWS Source Schema. + * + * @param awsSourceSchema the awsSourceSchema value to set. + * @return the Ec2KeyPairProperties object itself. + */ + public Ec2KeyPairProperties withAwsSourceSchema(String awsSourceSchema) { + this.awsSourceSchema = awsSourceSchema; + return this; + } + + /** + * Get the awsRegion property: AWS Region. + * + * @return the awsRegion value. + */ + public String awsRegion() { + return this.awsRegion; + } + + /** + * Set the awsRegion property: AWS Region. + * + * @param awsRegion the awsRegion value to set. + * @return the Ec2KeyPairProperties object itself. + */ + public Ec2KeyPairProperties withAwsRegion(String awsRegion) { + this.awsRegion = awsRegion; + return this; + } + + /** + * Get the awsTags property: AWS Tags. + * + * @return the awsTags value. + */ + public Map awsTags() { + return this.awsTags; + } + + /** + * Set the awsTags property: AWS Tags. + * + * @param awsTags the awsTags value to set. + * @return the Ec2KeyPairProperties object itself. + */ + public Ec2KeyPairProperties withAwsTags(Map awsTags) { + this.awsTags = awsTags; + return this; + } + + /** + * Get the provisioningState property: The status of the last operation. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (awsProperties() != null) { + awsProperties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("awsProperties", this.awsProperties); + jsonWriter.writeStringField("publicCloudConnectorsResourceId", this.publicCloudConnectorsResourceId); + jsonWriter.writeStringField("awsAccountId", this.awsAccountId); + jsonWriter.writeStringField("arn", this.arn); + jsonWriter.writeStringField("publicCloudResourceName", this.publicCloudResourceName); + jsonWriter.writeStringField("awsSourceSchema", this.awsSourceSchema); + jsonWriter.writeStringField("awsRegion", this.awsRegion); + jsonWriter.writeMapField("awsTags", this.awsTags, (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of Ec2KeyPairProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of Ec2KeyPairProperties if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the Ec2KeyPairProperties. + */ + public static Ec2KeyPairProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + Ec2KeyPairProperties deserializedEc2KeyPairProperties = new Ec2KeyPairProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("awsProperties".equals(fieldName)) { + deserializedEc2KeyPairProperties.awsProperties = AwsEc2KeyPairProperties.fromJson(reader); + } else if ("publicCloudConnectorsResourceId".equals(fieldName)) { + deserializedEc2KeyPairProperties.publicCloudConnectorsResourceId = reader.getString(); + } else if ("awsAccountId".equals(fieldName)) { + deserializedEc2KeyPairProperties.awsAccountId = reader.getString(); + } else if ("arn".equals(fieldName)) { + deserializedEc2KeyPairProperties.arn = reader.getString(); + } else if ("publicCloudResourceName".equals(fieldName)) { + deserializedEc2KeyPairProperties.publicCloudResourceName = reader.getString(); + } else if ("awsSourceSchema".equals(fieldName)) { + deserializedEc2KeyPairProperties.awsSourceSchema = reader.getString(); + } else if ("awsRegion".equals(fieldName)) { + deserializedEc2KeyPairProperties.awsRegion = reader.getString(); + } else if ("awsTags".equals(fieldName)) { + Map awsTags = reader.readMap(reader1 -> reader1.getString()); + deserializedEc2KeyPairProperties.awsTags = awsTags; + } else if ("provisioningState".equals(fieldName)) { + deserializedEc2KeyPairProperties.provisioningState + = ProvisioningState.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedEc2KeyPairProperties; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/Ec2KeyPairTagsUpdate.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/Ec2KeyPairTagsUpdate.java new file mode 100644 index 000000000000..37c7f77771f6 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/Ec2KeyPairTagsUpdate.java @@ -0,0 +1,95 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.Map; + +/** + * The type used for updating tags in Ec2KeyPair resources. + */ +@Fluent +public final class Ec2KeyPairTagsUpdate implements JsonSerializable { + /* + * Resource tags. + */ + private Map tags; + + /** + * Creates an instance of Ec2KeyPairTagsUpdate class. + */ + public Ec2KeyPairTagsUpdate() { + } + + /** + * Get the tags property: Resource tags. + * + * @return the tags value. + */ + public Map tags() { + return this.tags; + } + + /** + * Set the tags property: Resource tags. + * + * @param tags the tags value to set. + * @return the Ec2KeyPairTagsUpdate object itself. + */ + public Ec2KeyPairTagsUpdate withTags(Map tags) { + this.tags = tags; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeMapField("tags", this.tags, (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of Ec2KeyPairTagsUpdate from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of Ec2KeyPairTagsUpdate if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the Ec2KeyPairTagsUpdate. + */ + public static Ec2KeyPairTagsUpdate fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + Ec2KeyPairTagsUpdate deserializedEc2KeyPairTagsUpdate = new Ec2KeyPairTagsUpdate(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedEc2KeyPairTagsUpdate.tags = tags; + } else { + reader.skipChildren(); + } + } + + return deserializedEc2KeyPairTagsUpdate; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/Ec2KeyPairs.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/Ec2KeyPairs.java new file mode 100644 index 000000000000..0cb91ec81b3c --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/Ec2KeyPairs.java @@ -0,0 +1,157 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** + * Resource collection API of Ec2KeyPairs. + */ +public interface Ec2KeyPairs { + /** + * List Ec2KeyPair resources by subscription ID. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Ec2KeyPair list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable list(); + + /** + * List Ec2KeyPair resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Ec2KeyPair list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable list(Context context); + + /** + * List Ec2KeyPair resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Ec2KeyPair list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * List Ec2KeyPair resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Ec2KeyPair list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Get a Ec2KeyPair. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2KeyPair. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Ec2KeyPair along with {@link Response}. + */ + Response getByResourceGroupWithResponse(String resourceGroupName, String name, Context context); + + /** + * Get a Ec2KeyPair. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2KeyPair. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Ec2KeyPair. + */ + Ec2KeyPair getByResourceGroup(String resourceGroupName, String name); + + /** + * Delete a Ec2KeyPair. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2KeyPair. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByResourceGroup(String resourceGroupName, String name); + + /** + * Delete a Ec2KeyPair. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2KeyPair. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String name, Context context); + + /** + * Get a Ec2KeyPair. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Ec2KeyPair along with {@link Response}. + */ + Ec2KeyPair getById(String id); + + /** + * Get a Ec2KeyPair. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Ec2KeyPair along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Delete a Ec2KeyPair. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteById(String id); + + /** + * Delete a Ec2KeyPair. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new Ec2KeyPair resource. + * + * @param name resource name. + * @return the first stage of the new Ec2KeyPair definition. + */ + Ec2KeyPair.DefinitionStages.Blank define(String name); +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/Ec2NetworkAcl.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/Ec2NetworkAcl.java new file mode 100644 index 000000000000..39867757f202 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/Ec2NetworkAcl.java @@ -0,0 +1,252 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.awsconnector.fluent.models.Ec2NetworkAclInner; +import java.util.Map; + +/** + * An immutable client-side representation of Ec2NetworkAcl. + */ +public interface Ec2NetworkAcl { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the location property: The geo-location where the resource lives. + * + * @return the location value. + */ + String location(); + + /** + * Gets the tags property: Resource tags. + * + * @return the tags value. + */ + Map tags(); + + /** + * Gets the properties property: The resource-specific properties for this resource. + * + * @return the properties value. + */ + Ec2NetworkAclProperties properties(); + + /** + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the region of the resource. + * + * @return the region of the resource. + */ + Region region(); + + /** + * Gets the name of the resource region. + * + * @return the name of the resource region. + */ + String regionName(); + + /** + * Gets the name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + + /** + * Gets the inner com.azure.resourcemanager.awsconnector.fluent.models.Ec2NetworkAclInner object. + * + * @return the inner object. + */ + Ec2NetworkAclInner innerModel(); + + /** + * The entirety of the Ec2NetworkAcl definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithLocation, + DefinitionStages.WithResourceGroup, DefinitionStages.WithCreate { + } + + /** + * The Ec2NetworkAcl definition stages. + */ + interface DefinitionStages { + /** + * The first stage of the Ec2NetworkAcl definition. + */ + interface Blank extends WithLocation { + } + + /** + * The stage of the Ec2NetworkAcl definition allowing to specify location. + */ + interface WithLocation { + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithResourceGroup withRegion(Region location); + + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithResourceGroup withRegion(String location); + } + + /** + * The stage of the Ec2NetworkAcl definition allowing to specify parent resource. + */ + interface WithResourceGroup { + /** + * Specifies resourceGroupName. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @return the next definition stage. + */ + WithCreate withExistingResourceGroup(String resourceGroupName); + } + + /** + * The stage of the Ec2NetworkAcl 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.WithProperties { + /** + * Executes the create request. + * + * @return the created resource. + */ + Ec2NetworkAcl create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + Ec2NetworkAcl create(Context context); + } + + /** + * The stage of the Ec2NetworkAcl definition allowing to specify tags. + */ + interface WithTags { + /** + * Specifies the tags property: Resource tags.. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + WithCreate withTags(Map tags); + } + + /** + * The stage of the Ec2NetworkAcl definition allowing to specify properties. + */ + interface WithProperties { + /** + * Specifies the properties property: The resource-specific properties for this resource.. + * + * @param properties The resource-specific properties for this resource. + * @return the next definition stage. + */ + WithCreate withProperties(Ec2NetworkAclProperties properties); + } + } + + /** + * Begins update for the Ec2NetworkAcl resource. + * + * @return the stage of resource update. + */ + Ec2NetworkAcl.Update update(); + + /** + * The template for Ec2NetworkAcl update. + */ + interface Update extends UpdateStages.WithTags { + /** + * Executes the update request. + * + * @return the updated resource. + */ + Ec2NetworkAcl apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + Ec2NetworkAcl apply(Context context); + } + + /** + * The Ec2NetworkAcl update stages. + */ + interface UpdateStages { + /** + * The stage of the Ec2NetworkAcl update allowing to specify tags. + */ + interface WithTags { + /** + * Specifies the tags property: Resource tags.. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + Update withTags(Map tags); + } + } + + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + Ec2NetworkAcl refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + Ec2NetworkAcl refresh(Context context); +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/Ec2NetworkAclListResult.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/Ec2NetworkAclListResult.java new file mode 100644 index 000000000000..a6a4fe335e04 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/Ec2NetworkAclListResult.java @@ -0,0 +1,134 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.awsconnector.fluent.models.Ec2NetworkAclInner; +import java.io.IOException; +import java.util.List; + +/** + * The response of a Ec2NetworkAcl list operation. + */ +@Fluent +public final class Ec2NetworkAclListResult implements JsonSerializable { + /* + * The Ec2NetworkAcl items on this page + */ + private List value; + + /* + * The link to the next page of items + */ + private String nextLink; + + /** + * Creates an instance of Ec2NetworkAclListResult class. + */ + public Ec2NetworkAclListResult() { + } + + /** + * Get the value property: The Ec2NetworkAcl items on this page. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The Ec2NetworkAcl items on this page. + * + * @param value the value value to set. + * @return the Ec2NetworkAclListResult object itself. + */ + public Ec2NetworkAclListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The link to the next page of items. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: The link to the next page of items. + * + * @param nextLink the nextLink value to set. + * @return the Ec2NetworkAclListResult object itself. + */ + public Ec2NetworkAclListResult withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property value in model Ec2NetworkAclListResult")); + } else { + value().forEach(e -> e.validate()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(Ec2NetworkAclListResult.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("nextLink", this.nextLink); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of Ec2NetworkAclListResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of Ec2NetworkAclListResult if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the Ec2NetworkAclListResult. + */ + public static Ec2NetworkAclListResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + Ec2NetworkAclListResult deserializedEc2NetworkAclListResult = new Ec2NetworkAclListResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value = reader.readArray(reader1 -> Ec2NetworkAclInner.fromJson(reader1)); + deserializedEc2NetworkAclListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedEc2NetworkAclListResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedEc2NetworkAclListResult; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/Ec2NetworkAclProperties.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/Ec2NetworkAclProperties.java new file mode 100644 index 000000000000..a5a94b53d417 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/Ec2NetworkAclProperties.java @@ -0,0 +1,311 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.Map; + +/** + * Definition of Ec2NetworkAcl. + */ +@Fluent +public final class Ec2NetworkAclProperties implements JsonSerializable { + /* + * AWS Properties + */ + private AwsEc2NetworkAclProperties awsProperties; + + /* + * Public Cloud Connectors Resource ID + */ + private String publicCloudConnectorsResourceId; + + /* + * AWS Account ID + */ + private String awsAccountId; + + /* + * Amazon Resource Name (ARN) + */ + private String arn; + + /* + * Public Cloud Resource Name + */ + private String publicCloudResourceName; + + /* + * AWS Source Schema + */ + private String awsSourceSchema; + + /* + * AWS Region + */ + private String awsRegion; + + /* + * AWS Tags + */ + private Map awsTags; + + /* + * The status of the last operation. + */ + private ProvisioningState provisioningState; + + /** + * Creates an instance of Ec2NetworkAclProperties class. + */ + public Ec2NetworkAclProperties() { + } + + /** + * Get the awsProperties property: AWS Properties. + * + * @return the awsProperties value. + */ + public AwsEc2NetworkAclProperties awsProperties() { + return this.awsProperties; + } + + /** + * Set the awsProperties property: AWS Properties. + * + * @param awsProperties the awsProperties value to set. + * @return the Ec2NetworkAclProperties object itself. + */ + public Ec2NetworkAclProperties withAwsProperties(AwsEc2NetworkAclProperties awsProperties) { + this.awsProperties = awsProperties; + return this; + } + + /** + * Get the publicCloudConnectorsResourceId property: Public Cloud Connectors Resource ID. + * + * @return the publicCloudConnectorsResourceId value. + */ + public String publicCloudConnectorsResourceId() { + return this.publicCloudConnectorsResourceId; + } + + /** + * Set the publicCloudConnectorsResourceId property: Public Cloud Connectors Resource ID. + * + * @param publicCloudConnectorsResourceId the publicCloudConnectorsResourceId value to set. + * @return the Ec2NetworkAclProperties object itself. + */ + public Ec2NetworkAclProperties withPublicCloudConnectorsResourceId(String publicCloudConnectorsResourceId) { + this.publicCloudConnectorsResourceId = publicCloudConnectorsResourceId; + return this; + } + + /** + * Get the awsAccountId property: AWS Account ID. + * + * @return the awsAccountId value. + */ + public String awsAccountId() { + return this.awsAccountId; + } + + /** + * Set the awsAccountId property: AWS Account ID. + * + * @param awsAccountId the awsAccountId value to set. + * @return the Ec2NetworkAclProperties object itself. + */ + public Ec2NetworkAclProperties withAwsAccountId(String awsAccountId) { + this.awsAccountId = awsAccountId; + return this; + } + + /** + * Get the arn property: Amazon Resource Name (ARN). + * + * @return the arn value. + */ + public String arn() { + return this.arn; + } + + /** + * Set the arn property: Amazon Resource Name (ARN). + * + * @param arn the arn value to set. + * @return the Ec2NetworkAclProperties object itself. + */ + public Ec2NetworkAclProperties withArn(String arn) { + this.arn = arn; + return this; + } + + /** + * Get the publicCloudResourceName property: Public Cloud Resource Name. + * + * @return the publicCloudResourceName value. + */ + public String publicCloudResourceName() { + return this.publicCloudResourceName; + } + + /** + * Set the publicCloudResourceName property: Public Cloud Resource Name. + * + * @param publicCloudResourceName the publicCloudResourceName value to set. + * @return the Ec2NetworkAclProperties object itself. + */ + public Ec2NetworkAclProperties withPublicCloudResourceName(String publicCloudResourceName) { + this.publicCloudResourceName = publicCloudResourceName; + return this; + } + + /** + * Get the awsSourceSchema property: AWS Source Schema. + * + * @return the awsSourceSchema value. + */ + public String awsSourceSchema() { + return this.awsSourceSchema; + } + + /** + * Set the awsSourceSchema property: AWS Source Schema. + * + * @param awsSourceSchema the awsSourceSchema value to set. + * @return the Ec2NetworkAclProperties object itself. + */ + public Ec2NetworkAclProperties withAwsSourceSchema(String awsSourceSchema) { + this.awsSourceSchema = awsSourceSchema; + return this; + } + + /** + * Get the awsRegion property: AWS Region. + * + * @return the awsRegion value. + */ + public String awsRegion() { + return this.awsRegion; + } + + /** + * Set the awsRegion property: AWS Region. + * + * @param awsRegion the awsRegion value to set. + * @return the Ec2NetworkAclProperties object itself. + */ + public Ec2NetworkAclProperties withAwsRegion(String awsRegion) { + this.awsRegion = awsRegion; + return this; + } + + /** + * Get the awsTags property: AWS Tags. + * + * @return the awsTags value. + */ + public Map awsTags() { + return this.awsTags; + } + + /** + * Set the awsTags property: AWS Tags. + * + * @param awsTags the awsTags value to set. + * @return the Ec2NetworkAclProperties object itself. + */ + public Ec2NetworkAclProperties withAwsTags(Map awsTags) { + this.awsTags = awsTags; + return this; + } + + /** + * Get the provisioningState property: The status of the last operation. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (awsProperties() != null) { + awsProperties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("awsProperties", this.awsProperties); + jsonWriter.writeStringField("publicCloudConnectorsResourceId", this.publicCloudConnectorsResourceId); + jsonWriter.writeStringField("awsAccountId", this.awsAccountId); + jsonWriter.writeStringField("arn", this.arn); + jsonWriter.writeStringField("publicCloudResourceName", this.publicCloudResourceName); + jsonWriter.writeStringField("awsSourceSchema", this.awsSourceSchema); + jsonWriter.writeStringField("awsRegion", this.awsRegion); + jsonWriter.writeMapField("awsTags", this.awsTags, (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of Ec2NetworkAclProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of Ec2NetworkAclProperties if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the Ec2NetworkAclProperties. + */ + public static Ec2NetworkAclProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + Ec2NetworkAclProperties deserializedEc2NetworkAclProperties = new Ec2NetworkAclProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("awsProperties".equals(fieldName)) { + deserializedEc2NetworkAclProperties.awsProperties = AwsEc2NetworkAclProperties.fromJson(reader); + } else if ("publicCloudConnectorsResourceId".equals(fieldName)) { + deserializedEc2NetworkAclProperties.publicCloudConnectorsResourceId = reader.getString(); + } else if ("awsAccountId".equals(fieldName)) { + deserializedEc2NetworkAclProperties.awsAccountId = reader.getString(); + } else if ("arn".equals(fieldName)) { + deserializedEc2NetworkAclProperties.arn = reader.getString(); + } else if ("publicCloudResourceName".equals(fieldName)) { + deserializedEc2NetworkAclProperties.publicCloudResourceName = reader.getString(); + } else if ("awsSourceSchema".equals(fieldName)) { + deserializedEc2NetworkAclProperties.awsSourceSchema = reader.getString(); + } else if ("awsRegion".equals(fieldName)) { + deserializedEc2NetworkAclProperties.awsRegion = reader.getString(); + } else if ("awsTags".equals(fieldName)) { + Map awsTags = reader.readMap(reader1 -> reader1.getString()); + deserializedEc2NetworkAclProperties.awsTags = awsTags; + } else if ("provisioningState".equals(fieldName)) { + deserializedEc2NetworkAclProperties.provisioningState + = ProvisioningState.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedEc2NetworkAclProperties; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/Ec2NetworkAclTagsUpdate.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/Ec2NetworkAclTagsUpdate.java new file mode 100644 index 000000000000..00499cb55798 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/Ec2NetworkAclTagsUpdate.java @@ -0,0 +1,95 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.Map; + +/** + * The type used for updating tags in Ec2NetworkAcl resources. + */ +@Fluent +public final class Ec2NetworkAclTagsUpdate implements JsonSerializable { + /* + * Resource tags. + */ + private Map tags; + + /** + * Creates an instance of Ec2NetworkAclTagsUpdate class. + */ + public Ec2NetworkAclTagsUpdate() { + } + + /** + * Get the tags property: Resource tags. + * + * @return the tags value. + */ + public Map tags() { + return this.tags; + } + + /** + * Set the tags property: Resource tags. + * + * @param tags the tags value to set. + * @return the Ec2NetworkAclTagsUpdate object itself. + */ + public Ec2NetworkAclTagsUpdate withTags(Map tags) { + this.tags = tags; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeMapField("tags", this.tags, (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of Ec2NetworkAclTagsUpdate from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of Ec2NetworkAclTagsUpdate if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the Ec2NetworkAclTagsUpdate. + */ + public static Ec2NetworkAclTagsUpdate fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + Ec2NetworkAclTagsUpdate deserializedEc2NetworkAclTagsUpdate = new Ec2NetworkAclTagsUpdate(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedEc2NetworkAclTagsUpdate.tags = tags; + } else { + reader.skipChildren(); + } + } + + return deserializedEc2NetworkAclTagsUpdate; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/Ec2NetworkAcls.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/Ec2NetworkAcls.java new file mode 100644 index 000000000000..5166b33c182f --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/Ec2NetworkAcls.java @@ -0,0 +1,157 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** + * Resource collection API of Ec2NetworkAcls. + */ +public interface Ec2NetworkAcls { + /** + * List Ec2NetworkAcl resources by subscription ID. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Ec2NetworkAcl list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable list(); + + /** + * List Ec2NetworkAcl resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Ec2NetworkAcl list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable list(Context context); + + /** + * List Ec2NetworkAcl resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Ec2NetworkAcl list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * List Ec2NetworkAcl resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Ec2NetworkAcl list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Get a Ec2NetworkAcl. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2NetworkAcl. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Ec2NetworkAcl along with {@link Response}. + */ + Response getByResourceGroupWithResponse(String resourceGroupName, String name, Context context); + + /** + * Get a Ec2NetworkAcl. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2NetworkAcl. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Ec2NetworkAcl. + */ + Ec2NetworkAcl getByResourceGroup(String resourceGroupName, String name); + + /** + * Delete a Ec2NetworkAcl. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2NetworkAcl. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByResourceGroup(String resourceGroupName, String name); + + /** + * Delete a Ec2NetworkAcl. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2NetworkAcl. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String name, Context context); + + /** + * Get a Ec2NetworkAcl. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Ec2NetworkAcl along with {@link Response}. + */ + Ec2NetworkAcl getById(String id); + + /** + * Get a Ec2NetworkAcl. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Ec2NetworkAcl along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Delete a Ec2NetworkAcl. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteById(String id); + + /** + * Delete a Ec2NetworkAcl. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new Ec2NetworkAcl resource. + * + * @param name resource name. + * @return the first stage of the new Ec2NetworkAcl definition. + */ + Ec2NetworkAcl.DefinitionStages.Blank define(String name); +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/Ec2NetworkInterface.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/Ec2NetworkInterface.java new file mode 100644 index 000000000000..2cfd1f687810 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/Ec2NetworkInterface.java @@ -0,0 +1,252 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.awsconnector.fluent.models.Ec2NetworkInterfaceInner; +import java.util.Map; + +/** + * An immutable client-side representation of Ec2NetworkInterface. + */ +public interface Ec2NetworkInterface { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the location property: The geo-location where the resource lives. + * + * @return the location value. + */ + String location(); + + /** + * Gets the tags property: Resource tags. + * + * @return the tags value. + */ + Map tags(); + + /** + * Gets the properties property: The resource-specific properties for this resource. + * + * @return the properties value. + */ + Ec2NetworkInterfaceProperties properties(); + + /** + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the region of the resource. + * + * @return the region of the resource. + */ + Region region(); + + /** + * Gets the name of the resource region. + * + * @return the name of the resource region. + */ + String regionName(); + + /** + * Gets the name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + + /** + * Gets the inner com.azure.resourcemanager.awsconnector.fluent.models.Ec2NetworkInterfaceInner object. + * + * @return the inner object. + */ + Ec2NetworkInterfaceInner innerModel(); + + /** + * The entirety of the Ec2NetworkInterface definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithLocation, + DefinitionStages.WithResourceGroup, DefinitionStages.WithCreate { + } + + /** + * The Ec2NetworkInterface definition stages. + */ + interface DefinitionStages { + /** + * The first stage of the Ec2NetworkInterface definition. + */ + interface Blank extends WithLocation { + } + + /** + * The stage of the Ec2NetworkInterface definition allowing to specify location. + */ + interface WithLocation { + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithResourceGroup withRegion(Region location); + + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithResourceGroup withRegion(String location); + } + + /** + * The stage of the Ec2NetworkInterface definition allowing to specify parent resource. + */ + interface WithResourceGroup { + /** + * Specifies resourceGroupName. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @return the next definition stage. + */ + WithCreate withExistingResourceGroup(String resourceGroupName); + } + + /** + * The stage of the Ec2NetworkInterface 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.WithProperties { + /** + * Executes the create request. + * + * @return the created resource. + */ + Ec2NetworkInterface create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + Ec2NetworkInterface create(Context context); + } + + /** + * The stage of the Ec2NetworkInterface definition allowing to specify tags. + */ + interface WithTags { + /** + * Specifies the tags property: Resource tags.. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + WithCreate withTags(Map tags); + } + + /** + * The stage of the Ec2NetworkInterface definition allowing to specify properties. + */ + interface WithProperties { + /** + * Specifies the properties property: The resource-specific properties for this resource.. + * + * @param properties The resource-specific properties for this resource. + * @return the next definition stage. + */ + WithCreate withProperties(Ec2NetworkInterfaceProperties properties); + } + } + + /** + * Begins update for the Ec2NetworkInterface resource. + * + * @return the stage of resource update. + */ + Ec2NetworkInterface.Update update(); + + /** + * The template for Ec2NetworkInterface update. + */ + interface Update extends UpdateStages.WithTags { + /** + * Executes the update request. + * + * @return the updated resource. + */ + Ec2NetworkInterface apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + Ec2NetworkInterface apply(Context context); + } + + /** + * The Ec2NetworkInterface update stages. + */ + interface UpdateStages { + /** + * The stage of the Ec2NetworkInterface update allowing to specify tags. + */ + interface WithTags { + /** + * Specifies the tags property: Resource tags.. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + Update withTags(Map tags); + } + } + + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + Ec2NetworkInterface refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + Ec2NetworkInterface refresh(Context context); +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/Ec2NetworkInterfaceListResult.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/Ec2NetworkInterfaceListResult.java new file mode 100644 index 000000000000..48607f283e7f --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/Ec2NetworkInterfaceListResult.java @@ -0,0 +1,137 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.awsconnector.fluent.models.Ec2NetworkInterfaceInner; +import java.io.IOException; +import java.util.List; + +/** + * The response of a Ec2NetworkInterface list operation. + */ +@Fluent +public final class Ec2NetworkInterfaceListResult implements JsonSerializable { + /* + * The Ec2NetworkInterface items on this page + */ + private List value; + + /* + * The link to the next page of items + */ + private String nextLink; + + /** + * Creates an instance of Ec2NetworkInterfaceListResult class. + */ + public Ec2NetworkInterfaceListResult() { + } + + /** + * Get the value property: The Ec2NetworkInterface items on this page. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The Ec2NetworkInterface items on this page. + * + * @param value the value value to set. + * @return the Ec2NetworkInterfaceListResult object itself. + */ + public Ec2NetworkInterfaceListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The link to the next page of items. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: The link to the next page of items. + * + * @param nextLink the nextLink value to set. + * @return the Ec2NetworkInterfaceListResult object itself. + */ + public Ec2NetworkInterfaceListResult withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property value in model Ec2NetworkInterfaceListResult")); + } else { + value().forEach(e -> e.validate()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(Ec2NetworkInterfaceListResult.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("nextLink", this.nextLink); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of Ec2NetworkInterfaceListResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of Ec2NetworkInterfaceListResult if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the Ec2NetworkInterfaceListResult. + */ + public static Ec2NetworkInterfaceListResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + Ec2NetworkInterfaceListResult deserializedEc2NetworkInterfaceListResult + = new Ec2NetworkInterfaceListResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> Ec2NetworkInterfaceInner.fromJson(reader1)); + deserializedEc2NetworkInterfaceListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedEc2NetworkInterfaceListResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedEc2NetworkInterfaceListResult; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/Ec2NetworkInterfaceProperties.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/Ec2NetworkInterfaceProperties.java new file mode 100644 index 000000000000..56b6f7093519 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/Ec2NetworkInterfaceProperties.java @@ -0,0 +1,313 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.Map; + +/** + * Definition of Ec2NetworkInterface. + */ +@Fluent +public final class Ec2NetworkInterfaceProperties implements JsonSerializable { + /* + * AWS Properties + */ + private AwsEc2NetworkInterfaceProperties awsProperties; + + /* + * Public Cloud Connectors Resource ID + */ + private String publicCloudConnectorsResourceId; + + /* + * AWS Account ID + */ + private String awsAccountId; + + /* + * Amazon Resource Name (ARN) + */ + private String arn; + + /* + * Public Cloud Resource Name + */ + private String publicCloudResourceName; + + /* + * AWS Source Schema + */ + private String awsSourceSchema; + + /* + * AWS Region + */ + private String awsRegion; + + /* + * AWS Tags + */ + private Map awsTags; + + /* + * The status of the last operation. + */ + private ProvisioningState provisioningState; + + /** + * Creates an instance of Ec2NetworkInterfaceProperties class. + */ + public Ec2NetworkInterfaceProperties() { + } + + /** + * Get the awsProperties property: AWS Properties. + * + * @return the awsProperties value. + */ + public AwsEc2NetworkInterfaceProperties awsProperties() { + return this.awsProperties; + } + + /** + * Set the awsProperties property: AWS Properties. + * + * @param awsProperties the awsProperties value to set. + * @return the Ec2NetworkInterfaceProperties object itself. + */ + public Ec2NetworkInterfaceProperties withAwsProperties(AwsEc2NetworkInterfaceProperties awsProperties) { + this.awsProperties = awsProperties; + return this; + } + + /** + * Get the publicCloudConnectorsResourceId property: Public Cloud Connectors Resource ID. + * + * @return the publicCloudConnectorsResourceId value. + */ + public String publicCloudConnectorsResourceId() { + return this.publicCloudConnectorsResourceId; + } + + /** + * Set the publicCloudConnectorsResourceId property: Public Cloud Connectors Resource ID. + * + * @param publicCloudConnectorsResourceId the publicCloudConnectorsResourceId value to set. + * @return the Ec2NetworkInterfaceProperties object itself. + */ + public Ec2NetworkInterfaceProperties withPublicCloudConnectorsResourceId(String publicCloudConnectorsResourceId) { + this.publicCloudConnectorsResourceId = publicCloudConnectorsResourceId; + return this; + } + + /** + * Get the awsAccountId property: AWS Account ID. + * + * @return the awsAccountId value. + */ + public String awsAccountId() { + return this.awsAccountId; + } + + /** + * Set the awsAccountId property: AWS Account ID. + * + * @param awsAccountId the awsAccountId value to set. + * @return the Ec2NetworkInterfaceProperties object itself. + */ + public Ec2NetworkInterfaceProperties withAwsAccountId(String awsAccountId) { + this.awsAccountId = awsAccountId; + return this; + } + + /** + * Get the arn property: Amazon Resource Name (ARN). + * + * @return the arn value. + */ + public String arn() { + return this.arn; + } + + /** + * Set the arn property: Amazon Resource Name (ARN). + * + * @param arn the arn value to set. + * @return the Ec2NetworkInterfaceProperties object itself. + */ + public Ec2NetworkInterfaceProperties withArn(String arn) { + this.arn = arn; + return this; + } + + /** + * Get the publicCloudResourceName property: Public Cloud Resource Name. + * + * @return the publicCloudResourceName value. + */ + public String publicCloudResourceName() { + return this.publicCloudResourceName; + } + + /** + * Set the publicCloudResourceName property: Public Cloud Resource Name. + * + * @param publicCloudResourceName the publicCloudResourceName value to set. + * @return the Ec2NetworkInterfaceProperties object itself. + */ + public Ec2NetworkInterfaceProperties withPublicCloudResourceName(String publicCloudResourceName) { + this.publicCloudResourceName = publicCloudResourceName; + return this; + } + + /** + * Get the awsSourceSchema property: AWS Source Schema. + * + * @return the awsSourceSchema value. + */ + public String awsSourceSchema() { + return this.awsSourceSchema; + } + + /** + * Set the awsSourceSchema property: AWS Source Schema. + * + * @param awsSourceSchema the awsSourceSchema value to set. + * @return the Ec2NetworkInterfaceProperties object itself. + */ + public Ec2NetworkInterfaceProperties withAwsSourceSchema(String awsSourceSchema) { + this.awsSourceSchema = awsSourceSchema; + return this; + } + + /** + * Get the awsRegion property: AWS Region. + * + * @return the awsRegion value. + */ + public String awsRegion() { + return this.awsRegion; + } + + /** + * Set the awsRegion property: AWS Region. + * + * @param awsRegion the awsRegion value to set. + * @return the Ec2NetworkInterfaceProperties object itself. + */ + public Ec2NetworkInterfaceProperties withAwsRegion(String awsRegion) { + this.awsRegion = awsRegion; + return this; + } + + /** + * Get the awsTags property: AWS Tags. + * + * @return the awsTags value. + */ + public Map awsTags() { + return this.awsTags; + } + + /** + * Set the awsTags property: AWS Tags. + * + * @param awsTags the awsTags value to set. + * @return the Ec2NetworkInterfaceProperties object itself. + */ + public Ec2NetworkInterfaceProperties withAwsTags(Map awsTags) { + this.awsTags = awsTags; + return this; + } + + /** + * Get the provisioningState property: The status of the last operation. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (awsProperties() != null) { + awsProperties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("awsProperties", this.awsProperties); + jsonWriter.writeStringField("publicCloudConnectorsResourceId", this.publicCloudConnectorsResourceId); + jsonWriter.writeStringField("awsAccountId", this.awsAccountId); + jsonWriter.writeStringField("arn", this.arn); + jsonWriter.writeStringField("publicCloudResourceName", this.publicCloudResourceName); + jsonWriter.writeStringField("awsSourceSchema", this.awsSourceSchema); + jsonWriter.writeStringField("awsRegion", this.awsRegion); + jsonWriter.writeMapField("awsTags", this.awsTags, (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of Ec2NetworkInterfaceProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of Ec2NetworkInterfaceProperties if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the Ec2NetworkInterfaceProperties. + */ + public static Ec2NetworkInterfaceProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + Ec2NetworkInterfaceProperties deserializedEc2NetworkInterfaceProperties + = new Ec2NetworkInterfaceProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("awsProperties".equals(fieldName)) { + deserializedEc2NetworkInterfaceProperties.awsProperties + = AwsEc2NetworkInterfaceProperties.fromJson(reader); + } else if ("publicCloudConnectorsResourceId".equals(fieldName)) { + deserializedEc2NetworkInterfaceProperties.publicCloudConnectorsResourceId = reader.getString(); + } else if ("awsAccountId".equals(fieldName)) { + deserializedEc2NetworkInterfaceProperties.awsAccountId = reader.getString(); + } else if ("arn".equals(fieldName)) { + deserializedEc2NetworkInterfaceProperties.arn = reader.getString(); + } else if ("publicCloudResourceName".equals(fieldName)) { + deserializedEc2NetworkInterfaceProperties.publicCloudResourceName = reader.getString(); + } else if ("awsSourceSchema".equals(fieldName)) { + deserializedEc2NetworkInterfaceProperties.awsSourceSchema = reader.getString(); + } else if ("awsRegion".equals(fieldName)) { + deserializedEc2NetworkInterfaceProperties.awsRegion = reader.getString(); + } else if ("awsTags".equals(fieldName)) { + Map awsTags = reader.readMap(reader1 -> reader1.getString()); + deserializedEc2NetworkInterfaceProperties.awsTags = awsTags; + } else if ("provisioningState".equals(fieldName)) { + deserializedEc2NetworkInterfaceProperties.provisioningState + = ProvisioningState.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedEc2NetworkInterfaceProperties; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/Ec2NetworkInterfaceTagsUpdate.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/Ec2NetworkInterfaceTagsUpdate.java new file mode 100644 index 000000000000..21d749064ec3 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/Ec2NetworkInterfaceTagsUpdate.java @@ -0,0 +1,96 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.Map; + +/** + * The type used for updating tags in Ec2NetworkInterface resources. + */ +@Fluent +public final class Ec2NetworkInterfaceTagsUpdate implements JsonSerializable { + /* + * Resource tags. + */ + private Map tags; + + /** + * Creates an instance of Ec2NetworkInterfaceTagsUpdate class. + */ + public Ec2NetworkInterfaceTagsUpdate() { + } + + /** + * Get the tags property: Resource tags. + * + * @return the tags value. + */ + public Map tags() { + return this.tags; + } + + /** + * Set the tags property: Resource tags. + * + * @param tags the tags value to set. + * @return the Ec2NetworkInterfaceTagsUpdate object itself. + */ + public Ec2NetworkInterfaceTagsUpdate withTags(Map tags) { + this.tags = tags; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeMapField("tags", this.tags, (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of Ec2NetworkInterfaceTagsUpdate from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of Ec2NetworkInterfaceTagsUpdate if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the Ec2NetworkInterfaceTagsUpdate. + */ + public static Ec2NetworkInterfaceTagsUpdate fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + Ec2NetworkInterfaceTagsUpdate deserializedEc2NetworkInterfaceTagsUpdate + = new Ec2NetworkInterfaceTagsUpdate(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedEc2NetworkInterfaceTagsUpdate.tags = tags; + } else { + reader.skipChildren(); + } + } + + return deserializedEc2NetworkInterfaceTagsUpdate; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/Ec2NetworkInterfaces.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/Ec2NetworkInterfaces.java new file mode 100644 index 000000000000..304c53f018f3 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/Ec2NetworkInterfaces.java @@ -0,0 +1,158 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** + * Resource collection API of Ec2NetworkInterfaces. + */ +public interface Ec2NetworkInterfaces { + /** + * List Ec2NetworkInterface resources by subscription ID. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Ec2NetworkInterface list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable list(); + + /** + * List Ec2NetworkInterface resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Ec2NetworkInterface list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable list(Context context); + + /** + * List Ec2NetworkInterface resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Ec2NetworkInterface list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * List Ec2NetworkInterface resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Ec2NetworkInterface list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Get a Ec2NetworkInterface. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2NetworkInterface. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Ec2NetworkInterface along with {@link Response}. + */ + Response getByResourceGroupWithResponse(String resourceGroupName, String name, + Context context); + + /** + * Get a Ec2NetworkInterface. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2NetworkInterface. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Ec2NetworkInterface. + */ + Ec2NetworkInterface getByResourceGroup(String resourceGroupName, String name); + + /** + * Delete a Ec2NetworkInterface. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2NetworkInterface. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByResourceGroup(String resourceGroupName, String name); + + /** + * Delete a Ec2NetworkInterface. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2NetworkInterface. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String name, Context context); + + /** + * Get a Ec2NetworkInterface. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Ec2NetworkInterface along with {@link Response}. + */ + Ec2NetworkInterface getById(String id); + + /** + * Get a Ec2NetworkInterface. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Ec2NetworkInterface along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Delete a Ec2NetworkInterface. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteById(String id); + + /** + * Delete a Ec2NetworkInterface. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new Ec2NetworkInterface resource. + * + * @param name resource name. + * @return the first stage of the new Ec2NetworkInterface definition. + */ + Ec2NetworkInterface.DefinitionStages.Blank define(String name); +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/Ec2RouteTable.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/Ec2RouteTable.java new file mode 100644 index 000000000000..267b9c0b783a --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/Ec2RouteTable.java @@ -0,0 +1,252 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.awsconnector.fluent.models.Ec2RouteTableInner; +import java.util.Map; + +/** + * An immutable client-side representation of Ec2RouteTable. + */ +public interface Ec2RouteTable { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the location property: The geo-location where the resource lives. + * + * @return the location value. + */ + String location(); + + /** + * Gets the tags property: Resource tags. + * + * @return the tags value. + */ + Map tags(); + + /** + * Gets the properties property: The resource-specific properties for this resource. + * + * @return the properties value. + */ + Ec2RouteTableProperties properties(); + + /** + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the region of the resource. + * + * @return the region of the resource. + */ + Region region(); + + /** + * Gets the name of the resource region. + * + * @return the name of the resource region. + */ + String regionName(); + + /** + * Gets the name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + + /** + * Gets the inner com.azure.resourcemanager.awsconnector.fluent.models.Ec2RouteTableInner object. + * + * @return the inner object. + */ + Ec2RouteTableInner innerModel(); + + /** + * The entirety of the Ec2RouteTable definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithLocation, + DefinitionStages.WithResourceGroup, DefinitionStages.WithCreate { + } + + /** + * The Ec2RouteTable definition stages. + */ + interface DefinitionStages { + /** + * The first stage of the Ec2RouteTable definition. + */ + interface Blank extends WithLocation { + } + + /** + * The stage of the Ec2RouteTable definition allowing to specify location. + */ + interface WithLocation { + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithResourceGroup withRegion(Region location); + + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithResourceGroup withRegion(String location); + } + + /** + * The stage of the Ec2RouteTable definition allowing to specify parent resource. + */ + interface WithResourceGroup { + /** + * Specifies resourceGroupName. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @return the next definition stage. + */ + WithCreate withExistingResourceGroup(String resourceGroupName); + } + + /** + * The stage of the Ec2RouteTable 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.WithProperties { + /** + * Executes the create request. + * + * @return the created resource. + */ + Ec2RouteTable create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + Ec2RouteTable create(Context context); + } + + /** + * The stage of the Ec2RouteTable definition allowing to specify tags. + */ + interface WithTags { + /** + * Specifies the tags property: Resource tags.. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + WithCreate withTags(Map tags); + } + + /** + * The stage of the Ec2RouteTable definition allowing to specify properties. + */ + interface WithProperties { + /** + * Specifies the properties property: The resource-specific properties for this resource.. + * + * @param properties The resource-specific properties for this resource. + * @return the next definition stage. + */ + WithCreate withProperties(Ec2RouteTableProperties properties); + } + } + + /** + * Begins update for the Ec2RouteTable resource. + * + * @return the stage of resource update. + */ + Ec2RouteTable.Update update(); + + /** + * The template for Ec2RouteTable update. + */ + interface Update extends UpdateStages.WithTags { + /** + * Executes the update request. + * + * @return the updated resource. + */ + Ec2RouteTable apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + Ec2RouteTable apply(Context context); + } + + /** + * The Ec2RouteTable update stages. + */ + interface UpdateStages { + /** + * The stage of the Ec2RouteTable update allowing to specify tags. + */ + interface WithTags { + /** + * Specifies the tags property: Resource tags.. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + Update withTags(Map tags); + } + } + + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + Ec2RouteTable refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + Ec2RouteTable refresh(Context context); +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/Ec2RouteTableListResult.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/Ec2RouteTableListResult.java new file mode 100644 index 000000000000..c79b0f7c2380 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/Ec2RouteTableListResult.java @@ -0,0 +1,134 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.awsconnector.fluent.models.Ec2RouteTableInner; +import java.io.IOException; +import java.util.List; + +/** + * The response of a Ec2RouteTable list operation. + */ +@Fluent +public final class Ec2RouteTableListResult implements JsonSerializable { + /* + * The Ec2RouteTable items on this page + */ + private List value; + + /* + * The link to the next page of items + */ + private String nextLink; + + /** + * Creates an instance of Ec2RouteTableListResult class. + */ + public Ec2RouteTableListResult() { + } + + /** + * Get the value property: The Ec2RouteTable items on this page. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The Ec2RouteTable items on this page. + * + * @param value the value value to set. + * @return the Ec2RouteTableListResult object itself. + */ + public Ec2RouteTableListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The link to the next page of items. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: The link to the next page of items. + * + * @param nextLink the nextLink value to set. + * @return the Ec2RouteTableListResult object itself. + */ + public Ec2RouteTableListResult withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property value in model Ec2RouteTableListResult")); + } else { + value().forEach(e -> e.validate()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(Ec2RouteTableListResult.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("nextLink", this.nextLink); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of Ec2RouteTableListResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of Ec2RouteTableListResult if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the Ec2RouteTableListResult. + */ + public static Ec2RouteTableListResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + Ec2RouteTableListResult deserializedEc2RouteTableListResult = new Ec2RouteTableListResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value = reader.readArray(reader1 -> Ec2RouteTableInner.fromJson(reader1)); + deserializedEc2RouteTableListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedEc2RouteTableListResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedEc2RouteTableListResult; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/Ec2RouteTableProperties.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/Ec2RouteTableProperties.java new file mode 100644 index 000000000000..fb04162fe2fd --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/Ec2RouteTableProperties.java @@ -0,0 +1,311 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.Map; + +/** + * Definition of Ec2RouteTable. + */ +@Fluent +public final class Ec2RouteTableProperties implements JsonSerializable { + /* + * AWS Properties + */ + private AwsEc2RouteTableProperties awsProperties; + + /* + * Public Cloud Connectors Resource ID + */ + private String publicCloudConnectorsResourceId; + + /* + * AWS Account ID + */ + private String awsAccountId; + + /* + * Amazon Resource Name (ARN) + */ + private String arn; + + /* + * Public Cloud Resource Name + */ + private String publicCloudResourceName; + + /* + * AWS Source Schema + */ + private String awsSourceSchema; + + /* + * AWS Region + */ + private String awsRegion; + + /* + * AWS Tags + */ + private Map awsTags; + + /* + * The status of the last operation. + */ + private ProvisioningState provisioningState; + + /** + * Creates an instance of Ec2RouteTableProperties class. + */ + public Ec2RouteTableProperties() { + } + + /** + * Get the awsProperties property: AWS Properties. + * + * @return the awsProperties value. + */ + public AwsEc2RouteTableProperties awsProperties() { + return this.awsProperties; + } + + /** + * Set the awsProperties property: AWS Properties. + * + * @param awsProperties the awsProperties value to set. + * @return the Ec2RouteTableProperties object itself. + */ + public Ec2RouteTableProperties withAwsProperties(AwsEc2RouteTableProperties awsProperties) { + this.awsProperties = awsProperties; + return this; + } + + /** + * Get the publicCloudConnectorsResourceId property: Public Cloud Connectors Resource ID. + * + * @return the publicCloudConnectorsResourceId value. + */ + public String publicCloudConnectorsResourceId() { + return this.publicCloudConnectorsResourceId; + } + + /** + * Set the publicCloudConnectorsResourceId property: Public Cloud Connectors Resource ID. + * + * @param publicCloudConnectorsResourceId the publicCloudConnectorsResourceId value to set. + * @return the Ec2RouteTableProperties object itself. + */ + public Ec2RouteTableProperties withPublicCloudConnectorsResourceId(String publicCloudConnectorsResourceId) { + this.publicCloudConnectorsResourceId = publicCloudConnectorsResourceId; + return this; + } + + /** + * Get the awsAccountId property: AWS Account ID. + * + * @return the awsAccountId value. + */ + public String awsAccountId() { + return this.awsAccountId; + } + + /** + * Set the awsAccountId property: AWS Account ID. + * + * @param awsAccountId the awsAccountId value to set. + * @return the Ec2RouteTableProperties object itself. + */ + public Ec2RouteTableProperties withAwsAccountId(String awsAccountId) { + this.awsAccountId = awsAccountId; + return this; + } + + /** + * Get the arn property: Amazon Resource Name (ARN). + * + * @return the arn value. + */ + public String arn() { + return this.arn; + } + + /** + * Set the arn property: Amazon Resource Name (ARN). + * + * @param arn the arn value to set. + * @return the Ec2RouteTableProperties object itself. + */ + public Ec2RouteTableProperties withArn(String arn) { + this.arn = arn; + return this; + } + + /** + * Get the publicCloudResourceName property: Public Cloud Resource Name. + * + * @return the publicCloudResourceName value. + */ + public String publicCloudResourceName() { + return this.publicCloudResourceName; + } + + /** + * Set the publicCloudResourceName property: Public Cloud Resource Name. + * + * @param publicCloudResourceName the publicCloudResourceName value to set. + * @return the Ec2RouteTableProperties object itself. + */ + public Ec2RouteTableProperties withPublicCloudResourceName(String publicCloudResourceName) { + this.publicCloudResourceName = publicCloudResourceName; + return this; + } + + /** + * Get the awsSourceSchema property: AWS Source Schema. + * + * @return the awsSourceSchema value. + */ + public String awsSourceSchema() { + return this.awsSourceSchema; + } + + /** + * Set the awsSourceSchema property: AWS Source Schema. + * + * @param awsSourceSchema the awsSourceSchema value to set. + * @return the Ec2RouteTableProperties object itself. + */ + public Ec2RouteTableProperties withAwsSourceSchema(String awsSourceSchema) { + this.awsSourceSchema = awsSourceSchema; + return this; + } + + /** + * Get the awsRegion property: AWS Region. + * + * @return the awsRegion value. + */ + public String awsRegion() { + return this.awsRegion; + } + + /** + * Set the awsRegion property: AWS Region. + * + * @param awsRegion the awsRegion value to set. + * @return the Ec2RouteTableProperties object itself. + */ + public Ec2RouteTableProperties withAwsRegion(String awsRegion) { + this.awsRegion = awsRegion; + return this; + } + + /** + * Get the awsTags property: AWS Tags. + * + * @return the awsTags value. + */ + public Map awsTags() { + return this.awsTags; + } + + /** + * Set the awsTags property: AWS Tags. + * + * @param awsTags the awsTags value to set. + * @return the Ec2RouteTableProperties object itself. + */ + public Ec2RouteTableProperties withAwsTags(Map awsTags) { + this.awsTags = awsTags; + return this; + } + + /** + * Get the provisioningState property: The status of the last operation. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (awsProperties() != null) { + awsProperties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("awsProperties", this.awsProperties); + jsonWriter.writeStringField("publicCloudConnectorsResourceId", this.publicCloudConnectorsResourceId); + jsonWriter.writeStringField("awsAccountId", this.awsAccountId); + jsonWriter.writeStringField("arn", this.arn); + jsonWriter.writeStringField("publicCloudResourceName", this.publicCloudResourceName); + jsonWriter.writeStringField("awsSourceSchema", this.awsSourceSchema); + jsonWriter.writeStringField("awsRegion", this.awsRegion); + jsonWriter.writeMapField("awsTags", this.awsTags, (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of Ec2RouteTableProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of Ec2RouteTableProperties if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the Ec2RouteTableProperties. + */ + public static Ec2RouteTableProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + Ec2RouteTableProperties deserializedEc2RouteTableProperties = new Ec2RouteTableProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("awsProperties".equals(fieldName)) { + deserializedEc2RouteTableProperties.awsProperties = AwsEc2RouteTableProperties.fromJson(reader); + } else if ("publicCloudConnectorsResourceId".equals(fieldName)) { + deserializedEc2RouteTableProperties.publicCloudConnectorsResourceId = reader.getString(); + } else if ("awsAccountId".equals(fieldName)) { + deserializedEc2RouteTableProperties.awsAccountId = reader.getString(); + } else if ("arn".equals(fieldName)) { + deserializedEc2RouteTableProperties.arn = reader.getString(); + } else if ("publicCloudResourceName".equals(fieldName)) { + deserializedEc2RouteTableProperties.publicCloudResourceName = reader.getString(); + } else if ("awsSourceSchema".equals(fieldName)) { + deserializedEc2RouteTableProperties.awsSourceSchema = reader.getString(); + } else if ("awsRegion".equals(fieldName)) { + deserializedEc2RouteTableProperties.awsRegion = reader.getString(); + } else if ("awsTags".equals(fieldName)) { + Map awsTags = reader.readMap(reader1 -> reader1.getString()); + deserializedEc2RouteTableProperties.awsTags = awsTags; + } else if ("provisioningState".equals(fieldName)) { + deserializedEc2RouteTableProperties.provisioningState + = ProvisioningState.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedEc2RouteTableProperties; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/Ec2RouteTableTagsUpdate.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/Ec2RouteTableTagsUpdate.java new file mode 100644 index 000000000000..dcdc3f8ae4ce --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/Ec2RouteTableTagsUpdate.java @@ -0,0 +1,95 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.Map; + +/** + * The type used for updating tags in Ec2RouteTable resources. + */ +@Fluent +public final class Ec2RouteTableTagsUpdate implements JsonSerializable { + /* + * Resource tags. + */ + private Map tags; + + /** + * Creates an instance of Ec2RouteTableTagsUpdate class. + */ + public Ec2RouteTableTagsUpdate() { + } + + /** + * Get the tags property: Resource tags. + * + * @return the tags value. + */ + public Map tags() { + return this.tags; + } + + /** + * Set the tags property: Resource tags. + * + * @param tags the tags value to set. + * @return the Ec2RouteTableTagsUpdate object itself. + */ + public Ec2RouteTableTagsUpdate withTags(Map tags) { + this.tags = tags; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeMapField("tags", this.tags, (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of Ec2RouteTableTagsUpdate from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of Ec2RouteTableTagsUpdate if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the Ec2RouteTableTagsUpdate. + */ + public static Ec2RouteTableTagsUpdate fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + Ec2RouteTableTagsUpdate deserializedEc2RouteTableTagsUpdate = new Ec2RouteTableTagsUpdate(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedEc2RouteTableTagsUpdate.tags = tags; + } else { + reader.skipChildren(); + } + } + + return deserializedEc2RouteTableTagsUpdate; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/Ec2RouteTables.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/Ec2RouteTables.java new file mode 100644 index 000000000000..3f493ba18d81 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/Ec2RouteTables.java @@ -0,0 +1,157 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** + * Resource collection API of Ec2RouteTables. + */ +public interface Ec2RouteTables { + /** + * List Ec2RouteTable resources by subscription ID. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Ec2RouteTable list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable list(); + + /** + * List Ec2RouteTable resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Ec2RouteTable list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable list(Context context); + + /** + * List Ec2RouteTable resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Ec2RouteTable list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * List Ec2RouteTable resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Ec2RouteTable list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Get a Ec2RouteTable. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2RouteTable. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Ec2RouteTable along with {@link Response}. + */ + Response getByResourceGroupWithResponse(String resourceGroupName, String name, Context context); + + /** + * Get a Ec2RouteTable. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2RouteTable. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Ec2RouteTable. + */ + Ec2RouteTable getByResourceGroup(String resourceGroupName, String name); + + /** + * Delete a Ec2RouteTable. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2RouteTable. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByResourceGroup(String resourceGroupName, String name); + + /** + * Delete a Ec2RouteTable. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2RouteTable. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String name, Context context); + + /** + * Get a Ec2RouteTable. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Ec2RouteTable along with {@link Response}. + */ + Ec2RouteTable getById(String id); + + /** + * Get a Ec2RouteTable. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Ec2RouteTable along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Delete a Ec2RouteTable. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteById(String id); + + /** + * Delete a Ec2RouteTable. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new Ec2RouteTable resource. + * + * @param name resource name. + * @return the first stage of the new Ec2RouteTable definition. + */ + Ec2RouteTable.DefinitionStages.Blank define(String name); +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/Ec2SecurityGroup.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/Ec2SecurityGroup.java new file mode 100644 index 000000000000..14c7d0238c03 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/Ec2SecurityGroup.java @@ -0,0 +1,252 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.awsconnector.fluent.models.Ec2SecurityGroupInner; +import java.util.Map; + +/** + * An immutable client-side representation of Ec2SecurityGroup. + */ +public interface Ec2SecurityGroup { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the location property: The geo-location where the resource lives. + * + * @return the location value. + */ + String location(); + + /** + * Gets the tags property: Resource tags. + * + * @return the tags value. + */ + Map tags(); + + /** + * Gets the properties property: The resource-specific properties for this resource. + * + * @return the properties value. + */ + Ec2SecurityGroupProperties properties(); + + /** + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the region of the resource. + * + * @return the region of the resource. + */ + Region region(); + + /** + * Gets the name of the resource region. + * + * @return the name of the resource region. + */ + String regionName(); + + /** + * Gets the name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + + /** + * Gets the inner com.azure.resourcemanager.awsconnector.fluent.models.Ec2SecurityGroupInner object. + * + * @return the inner object. + */ + Ec2SecurityGroupInner innerModel(); + + /** + * The entirety of the Ec2SecurityGroup definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithLocation, + DefinitionStages.WithResourceGroup, DefinitionStages.WithCreate { + } + + /** + * The Ec2SecurityGroup definition stages. + */ + interface DefinitionStages { + /** + * The first stage of the Ec2SecurityGroup definition. + */ + interface Blank extends WithLocation { + } + + /** + * The stage of the Ec2SecurityGroup definition allowing to specify location. + */ + interface WithLocation { + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithResourceGroup withRegion(Region location); + + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithResourceGroup withRegion(String location); + } + + /** + * The stage of the Ec2SecurityGroup definition allowing to specify parent resource. + */ + interface WithResourceGroup { + /** + * Specifies resourceGroupName. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @return the next definition stage. + */ + WithCreate withExistingResourceGroup(String resourceGroupName); + } + + /** + * The stage of the Ec2SecurityGroup 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.WithProperties { + /** + * Executes the create request. + * + * @return the created resource. + */ + Ec2SecurityGroup create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + Ec2SecurityGroup create(Context context); + } + + /** + * The stage of the Ec2SecurityGroup definition allowing to specify tags. + */ + interface WithTags { + /** + * Specifies the tags property: Resource tags.. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + WithCreate withTags(Map tags); + } + + /** + * The stage of the Ec2SecurityGroup definition allowing to specify properties. + */ + interface WithProperties { + /** + * Specifies the properties property: The resource-specific properties for this resource.. + * + * @param properties The resource-specific properties for this resource. + * @return the next definition stage. + */ + WithCreate withProperties(Ec2SecurityGroupProperties properties); + } + } + + /** + * Begins update for the Ec2SecurityGroup resource. + * + * @return the stage of resource update. + */ + Ec2SecurityGroup.Update update(); + + /** + * The template for Ec2SecurityGroup update. + */ + interface Update extends UpdateStages.WithTags { + /** + * Executes the update request. + * + * @return the updated resource. + */ + Ec2SecurityGroup apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + Ec2SecurityGroup apply(Context context); + } + + /** + * The Ec2SecurityGroup update stages. + */ + interface UpdateStages { + /** + * The stage of the Ec2SecurityGroup update allowing to specify tags. + */ + interface WithTags { + /** + * Specifies the tags property: Resource tags.. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + Update withTags(Map tags); + } + } + + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + Ec2SecurityGroup refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + Ec2SecurityGroup refresh(Context context); +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/Ec2SecurityGroupListResult.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/Ec2SecurityGroupListResult.java new file mode 100644 index 000000000000..275b4c8f72cb --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/Ec2SecurityGroupListResult.java @@ -0,0 +1,136 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.awsconnector.fluent.models.Ec2SecurityGroupInner; +import java.io.IOException; +import java.util.List; + +/** + * The response of a Ec2SecurityGroup list operation. + */ +@Fluent +public final class Ec2SecurityGroupListResult implements JsonSerializable { + /* + * The Ec2SecurityGroup items on this page + */ + private List value; + + /* + * The link to the next page of items + */ + private String nextLink; + + /** + * Creates an instance of Ec2SecurityGroupListResult class. + */ + public Ec2SecurityGroupListResult() { + } + + /** + * Get the value property: The Ec2SecurityGroup items on this page. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The Ec2SecurityGroup items on this page. + * + * @param value the value value to set. + * @return the Ec2SecurityGroupListResult object itself. + */ + public Ec2SecurityGroupListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The link to the next page of items. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: The link to the next page of items. + * + * @param nextLink the nextLink value to set. + * @return the Ec2SecurityGroupListResult object itself. + */ + public Ec2SecurityGroupListResult withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property value in model Ec2SecurityGroupListResult")); + } else { + value().forEach(e -> e.validate()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(Ec2SecurityGroupListResult.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("nextLink", this.nextLink); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of Ec2SecurityGroupListResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of Ec2SecurityGroupListResult if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the Ec2SecurityGroupListResult. + */ + public static Ec2SecurityGroupListResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + Ec2SecurityGroupListResult deserializedEc2SecurityGroupListResult = new Ec2SecurityGroupListResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> Ec2SecurityGroupInner.fromJson(reader1)); + deserializedEc2SecurityGroupListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedEc2SecurityGroupListResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedEc2SecurityGroupListResult; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/Ec2SecurityGroupProperties.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/Ec2SecurityGroupProperties.java new file mode 100644 index 000000000000..0b9b9c681b8b --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/Ec2SecurityGroupProperties.java @@ -0,0 +1,312 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.Map; + +/** + * Definition of Ec2SecurityGroup. + */ +@Fluent +public final class Ec2SecurityGroupProperties implements JsonSerializable { + /* + * AWS Properties + */ + private AwsEc2SecurityGroupProperties awsProperties; + + /* + * Public Cloud Connectors Resource ID + */ + private String publicCloudConnectorsResourceId; + + /* + * AWS Account ID + */ + private String awsAccountId; + + /* + * Amazon Resource Name (ARN) + */ + private String arn; + + /* + * Public Cloud Resource Name + */ + private String publicCloudResourceName; + + /* + * AWS Source Schema + */ + private String awsSourceSchema; + + /* + * AWS Region + */ + private String awsRegion; + + /* + * AWS Tags + */ + private Map awsTags; + + /* + * The status of the last operation. + */ + private ProvisioningState provisioningState; + + /** + * Creates an instance of Ec2SecurityGroupProperties class. + */ + public Ec2SecurityGroupProperties() { + } + + /** + * Get the awsProperties property: AWS Properties. + * + * @return the awsProperties value. + */ + public AwsEc2SecurityGroupProperties awsProperties() { + return this.awsProperties; + } + + /** + * Set the awsProperties property: AWS Properties. + * + * @param awsProperties the awsProperties value to set. + * @return the Ec2SecurityGroupProperties object itself. + */ + public Ec2SecurityGroupProperties withAwsProperties(AwsEc2SecurityGroupProperties awsProperties) { + this.awsProperties = awsProperties; + return this; + } + + /** + * Get the publicCloudConnectorsResourceId property: Public Cloud Connectors Resource ID. + * + * @return the publicCloudConnectorsResourceId value. + */ + public String publicCloudConnectorsResourceId() { + return this.publicCloudConnectorsResourceId; + } + + /** + * Set the publicCloudConnectorsResourceId property: Public Cloud Connectors Resource ID. + * + * @param publicCloudConnectorsResourceId the publicCloudConnectorsResourceId value to set. + * @return the Ec2SecurityGroupProperties object itself. + */ + public Ec2SecurityGroupProperties withPublicCloudConnectorsResourceId(String publicCloudConnectorsResourceId) { + this.publicCloudConnectorsResourceId = publicCloudConnectorsResourceId; + return this; + } + + /** + * Get the awsAccountId property: AWS Account ID. + * + * @return the awsAccountId value. + */ + public String awsAccountId() { + return this.awsAccountId; + } + + /** + * Set the awsAccountId property: AWS Account ID. + * + * @param awsAccountId the awsAccountId value to set. + * @return the Ec2SecurityGroupProperties object itself. + */ + public Ec2SecurityGroupProperties withAwsAccountId(String awsAccountId) { + this.awsAccountId = awsAccountId; + return this; + } + + /** + * Get the arn property: Amazon Resource Name (ARN). + * + * @return the arn value. + */ + public String arn() { + return this.arn; + } + + /** + * Set the arn property: Amazon Resource Name (ARN). + * + * @param arn the arn value to set. + * @return the Ec2SecurityGroupProperties object itself. + */ + public Ec2SecurityGroupProperties withArn(String arn) { + this.arn = arn; + return this; + } + + /** + * Get the publicCloudResourceName property: Public Cloud Resource Name. + * + * @return the publicCloudResourceName value. + */ + public String publicCloudResourceName() { + return this.publicCloudResourceName; + } + + /** + * Set the publicCloudResourceName property: Public Cloud Resource Name. + * + * @param publicCloudResourceName the publicCloudResourceName value to set. + * @return the Ec2SecurityGroupProperties object itself. + */ + public Ec2SecurityGroupProperties withPublicCloudResourceName(String publicCloudResourceName) { + this.publicCloudResourceName = publicCloudResourceName; + return this; + } + + /** + * Get the awsSourceSchema property: AWS Source Schema. + * + * @return the awsSourceSchema value. + */ + public String awsSourceSchema() { + return this.awsSourceSchema; + } + + /** + * Set the awsSourceSchema property: AWS Source Schema. + * + * @param awsSourceSchema the awsSourceSchema value to set. + * @return the Ec2SecurityGroupProperties object itself. + */ + public Ec2SecurityGroupProperties withAwsSourceSchema(String awsSourceSchema) { + this.awsSourceSchema = awsSourceSchema; + return this; + } + + /** + * Get the awsRegion property: AWS Region. + * + * @return the awsRegion value. + */ + public String awsRegion() { + return this.awsRegion; + } + + /** + * Set the awsRegion property: AWS Region. + * + * @param awsRegion the awsRegion value to set. + * @return the Ec2SecurityGroupProperties object itself. + */ + public Ec2SecurityGroupProperties withAwsRegion(String awsRegion) { + this.awsRegion = awsRegion; + return this; + } + + /** + * Get the awsTags property: AWS Tags. + * + * @return the awsTags value. + */ + public Map awsTags() { + return this.awsTags; + } + + /** + * Set the awsTags property: AWS Tags. + * + * @param awsTags the awsTags value to set. + * @return the Ec2SecurityGroupProperties object itself. + */ + public Ec2SecurityGroupProperties withAwsTags(Map awsTags) { + this.awsTags = awsTags; + return this; + } + + /** + * Get the provisioningState property: The status of the last operation. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (awsProperties() != null) { + awsProperties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("awsProperties", this.awsProperties); + jsonWriter.writeStringField("publicCloudConnectorsResourceId", this.publicCloudConnectorsResourceId); + jsonWriter.writeStringField("awsAccountId", this.awsAccountId); + jsonWriter.writeStringField("arn", this.arn); + jsonWriter.writeStringField("publicCloudResourceName", this.publicCloudResourceName); + jsonWriter.writeStringField("awsSourceSchema", this.awsSourceSchema); + jsonWriter.writeStringField("awsRegion", this.awsRegion); + jsonWriter.writeMapField("awsTags", this.awsTags, (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of Ec2SecurityGroupProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of Ec2SecurityGroupProperties if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IOException If an error occurs while reading the Ec2SecurityGroupProperties. + */ + public static Ec2SecurityGroupProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + Ec2SecurityGroupProperties deserializedEc2SecurityGroupProperties = new Ec2SecurityGroupProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("awsProperties".equals(fieldName)) { + deserializedEc2SecurityGroupProperties.awsProperties + = AwsEc2SecurityGroupProperties.fromJson(reader); + } else if ("publicCloudConnectorsResourceId".equals(fieldName)) { + deserializedEc2SecurityGroupProperties.publicCloudConnectorsResourceId = reader.getString(); + } else if ("awsAccountId".equals(fieldName)) { + deserializedEc2SecurityGroupProperties.awsAccountId = reader.getString(); + } else if ("arn".equals(fieldName)) { + deserializedEc2SecurityGroupProperties.arn = reader.getString(); + } else if ("publicCloudResourceName".equals(fieldName)) { + deserializedEc2SecurityGroupProperties.publicCloudResourceName = reader.getString(); + } else if ("awsSourceSchema".equals(fieldName)) { + deserializedEc2SecurityGroupProperties.awsSourceSchema = reader.getString(); + } else if ("awsRegion".equals(fieldName)) { + deserializedEc2SecurityGroupProperties.awsRegion = reader.getString(); + } else if ("awsTags".equals(fieldName)) { + Map awsTags = reader.readMap(reader1 -> reader1.getString()); + deserializedEc2SecurityGroupProperties.awsTags = awsTags; + } else if ("provisioningState".equals(fieldName)) { + deserializedEc2SecurityGroupProperties.provisioningState + = ProvisioningState.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedEc2SecurityGroupProperties; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/Ec2SecurityGroupTagsUpdate.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/Ec2SecurityGroupTagsUpdate.java new file mode 100644 index 000000000000..76bb8fb3f0f7 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/Ec2SecurityGroupTagsUpdate.java @@ -0,0 +1,95 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.Map; + +/** + * The type used for updating tags in Ec2SecurityGroup resources. + */ +@Fluent +public final class Ec2SecurityGroupTagsUpdate implements JsonSerializable { + /* + * Resource tags. + */ + private Map tags; + + /** + * Creates an instance of Ec2SecurityGroupTagsUpdate class. + */ + public Ec2SecurityGroupTagsUpdate() { + } + + /** + * Get the tags property: Resource tags. + * + * @return the tags value. + */ + public Map tags() { + return this.tags; + } + + /** + * Set the tags property: Resource tags. + * + * @param tags the tags value to set. + * @return the Ec2SecurityGroupTagsUpdate object itself. + */ + public Ec2SecurityGroupTagsUpdate withTags(Map tags) { + this.tags = tags; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeMapField("tags", this.tags, (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of Ec2SecurityGroupTagsUpdate from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of Ec2SecurityGroupTagsUpdate if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IOException If an error occurs while reading the Ec2SecurityGroupTagsUpdate. + */ + public static Ec2SecurityGroupTagsUpdate fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + Ec2SecurityGroupTagsUpdate deserializedEc2SecurityGroupTagsUpdate = new Ec2SecurityGroupTagsUpdate(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedEc2SecurityGroupTagsUpdate.tags = tags; + } else { + reader.skipChildren(); + } + } + + return deserializedEc2SecurityGroupTagsUpdate; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/Ec2SecurityGroups.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/Ec2SecurityGroups.java new file mode 100644 index 000000000000..acbc25ca6e3f --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/Ec2SecurityGroups.java @@ -0,0 +1,157 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** + * Resource collection API of Ec2SecurityGroups. + */ +public interface Ec2SecurityGroups { + /** + * List Ec2SecurityGroup resources by subscription ID. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Ec2SecurityGroup list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable list(); + + /** + * List Ec2SecurityGroup resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Ec2SecurityGroup list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable list(Context context); + + /** + * List Ec2SecurityGroup resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Ec2SecurityGroup list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * List Ec2SecurityGroup resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Ec2SecurityGroup list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Get a Ec2SecurityGroup. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2SecurityGroup. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Ec2SecurityGroup along with {@link Response}. + */ + Response getByResourceGroupWithResponse(String resourceGroupName, String name, Context context); + + /** + * Get a Ec2SecurityGroup. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2SecurityGroup. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Ec2SecurityGroup. + */ + Ec2SecurityGroup getByResourceGroup(String resourceGroupName, String name); + + /** + * Delete a Ec2SecurityGroup. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2SecurityGroup. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByResourceGroup(String resourceGroupName, String name); + + /** + * Delete a Ec2SecurityGroup. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2SecurityGroup. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String name, Context context); + + /** + * Get a Ec2SecurityGroup. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Ec2SecurityGroup along with {@link Response}. + */ + Ec2SecurityGroup getById(String id); + + /** + * Get a Ec2SecurityGroup. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Ec2SecurityGroup along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Delete a Ec2SecurityGroup. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteById(String id); + + /** + * Delete a Ec2SecurityGroup. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new Ec2SecurityGroup resource. + * + * @param name resource name. + * @return the first stage of the new Ec2SecurityGroup definition. + */ + Ec2SecurityGroup.DefinitionStages.Blank define(String name); +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/Ec2Snapshot.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/Ec2Snapshot.java new file mode 100644 index 000000000000..43ad1a21b3c5 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/Ec2Snapshot.java @@ -0,0 +1,252 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.awsconnector.fluent.models.Ec2SnapshotInner; +import java.util.Map; + +/** + * An immutable client-side representation of Ec2Snapshot. + */ +public interface Ec2Snapshot { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the location property: The geo-location where the resource lives. + * + * @return the location value. + */ + String location(); + + /** + * Gets the tags property: Resource tags. + * + * @return the tags value. + */ + Map tags(); + + /** + * Gets the properties property: The resource-specific properties for this resource. + * + * @return the properties value. + */ + Ec2SnapshotProperties properties(); + + /** + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the region of the resource. + * + * @return the region of the resource. + */ + Region region(); + + /** + * Gets the name of the resource region. + * + * @return the name of the resource region. + */ + String regionName(); + + /** + * Gets the name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + + /** + * Gets the inner com.azure.resourcemanager.awsconnector.fluent.models.Ec2SnapshotInner object. + * + * @return the inner object. + */ + Ec2SnapshotInner innerModel(); + + /** + * The entirety of the Ec2Snapshot definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithLocation, + DefinitionStages.WithResourceGroup, DefinitionStages.WithCreate { + } + + /** + * The Ec2Snapshot definition stages. + */ + interface DefinitionStages { + /** + * The first stage of the Ec2Snapshot definition. + */ + interface Blank extends WithLocation { + } + + /** + * The stage of the Ec2Snapshot definition allowing to specify location. + */ + interface WithLocation { + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithResourceGroup withRegion(Region location); + + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithResourceGroup withRegion(String location); + } + + /** + * The stage of the Ec2Snapshot definition allowing to specify parent resource. + */ + interface WithResourceGroup { + /** + * Specifies resourceGroupName. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @return the next definition stage. + */ + WithCreate withExistingResourceGroup(String resourceGroupName); + } + + /** + * The stage of the Ec2Snapshot 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.WithProperties { + /** + * Executes the create request. + * + * @return the created resource. + */ + Ec2Snapshot create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + Ec2Snapshot create(Context context); + } + + /** + * The stage of the Ec2Snapshot definition allowing to specify tags. + */ + interface WithTags { + /** + * Specifies the tags property: Resource tags.. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + WithCreate withTags(Map tags); + } + + /** + * The stage of the Ec2Snapshot definition allowing to specify properties. + */ + interface WithProperties { + /** + * Specifies the properties property: The resource-specific properties for this resource.. + * + * @param properties The resource-specific properties for this resource. + * @return the next definition stage. + */ + WithCreate withProperties(Ec2SnapshotProperties properties); + } + } + + /** + * Begins update for the Ec2Snapshot resource. + * + * @return the stage of resource update. + */ + Ec2Snapshot.Update update(); + + /** + * The template for Ec2Snapshot update. + */ + interface Update extends UpdateStages.WithTags { + /** + * Executes the update request. + * + * @return the updated resource. + */ + Ec2Snapshot apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + Ec2Snapshot apply(Context context); + } + + /** + * The Ec2Snapshot update stages. + */ + interface UpdateStages { + /** + * The stage of the Ec2Snapshot update allowing to specify tags. + */ + interface WithTags { + /** + * Specifies the tags property: Resource tags.. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + Update withTags(Map tags); + } + } + + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + Ec2Snapshot refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + Ec2Snapshot refresh(Context context); +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/Ec2SnapshotListResult.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/Ec2SnapshotListResult.java new file mode 100644 index 000000000000..195ccbb32355 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/Ec2SnapshotListResult.java @@ -0,0 +1,134 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.awsconnector.fluent.models.Ec2SnapshotInner; +import java.io.IOException; +import java.util.List; + +/** + * The response of a Ec2Snapshot list operation. + */ +@Fluent +public final class Ec2SnapshotListResult implements JsonSerializable { + /* + * The Ec2Snapshot items on this page + */ + private List value; + + /* + * The link to the next page of items + */ + private String nextLink; + + /** + * Creates an instance of Ec2SnapshotListResult class. + */ + public Ec2SnapshotListResult() { + } + + /** + * Get the value property: The Ec2Snapshot items on this page. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The Ec2Snapshot items on this page. + * + * @param value the value value to set. + * @return the Ec2SnapshotListResult object itself. + */ + public Ec2SnapshotListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The link to the next page of items. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: The link to the next page of items. + * + * @param nextLink the nextLink value to set. + * @return the Ec2SnapshotListResult object itself. + */ + public Ec2SnapshotListResult withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property value in model Ec2SnapshotListResult")); + } else { + value().forEach(e -> e.validate()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(Ec2SnapshotListResult.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("nextLink", this.nextLink); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of Ec2SnapshotListResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of Ec2SnapshotListResult if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the Ec2SnapshotListResult. + */ + public static Ec2SnapshotListResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + Ec2SnapshotListResult deserializedEc2SnapshotListResult = new Ec2SnapshotListResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value = reader.readArray(reader1 -> Ec2SnapshotInner.fromJson(reader1)); + deserializedEc2SnapshotListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedEc2SnapshotListResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedEc2SnapshotListResult; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/Ec2SnapshotProperties.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/Ec2SnapshotProperties.java new file mode 100644 index 000000000000..5cb13f1eb535 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/Ec2SnapshotProperties.java @@ -0,0 +1,311 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.Map; + +/** + * Definition of Ec2Snapshot. + */ +@Fluent +public final class Ec2SnapshotProperties implements JsonSerializable { + /* + * AWS Properties + */ + private AwsEc2SnapshotProperties awsProperties; + + /* + * Public Cloud Connectors Resource ID + */ + private String publicCloudConnectorsResourceId; + + /* + * AWS Account ID + */ + private String awsAccountId; + + /* + * Amazon Resource Name (ARN) + */ + private String arn; + + /* + * Public Cloud Resource Name + */ + private String publicCloudResourceName; + + /* + * AWS Source Schema + */ + private String awsSourceSchema; + + /* + * AWS Region + */ + private String awsRegion; + + /* + * AWS Tags + */ + private Map awsTags; + + /* + * The status of the last operation. + */ + private ProvisioningState provisioningState; + + /** + * Creates an instance of Ec2SnapshotProperties class. + */ + public Ec2SnapshotProperties() { + } + + /** + * Get the awsProperties property: AWS Properties. + * + * @return the awsProperties value. + */ + public AwsEc2SnapshotProperties awsProperties() { + return this.awsProperties; + } + + /** + * Set the awsProperties property: AWS Properties. + * + * @param awsProperties the awsProperties value to set. + * @return the Ec2SnapshotProperties object itself. + */ + public Ec2SnapshotProperties withAwsProperties(AwsEc2SnapshotProperties awsProperties) { + this.awsProperties = awsProperties; + return this; + } + + /** + * Get the publicCloudConnectorsResourceId property: Public Cloud Connectors Resource ID. + * + * @return the publicCloudConnectorsResourceId value. + */ + public String publicCloudConnectorsResourceId() { + return this.publicCloudConnectorsResourceId; + } + + /** + * Set the publicCloudConnectorsResourceId property: Public Cloud Connectors Resource ID. + * + * @param publicCloudConnectorsResourceId the publicCloudConnectorsResourceId value to set. + * @return the Ec2SnapshotProperties object itself. + */ + public Ec2SnapshotProperties withPublicCloudConnectorsResourceId(String publicCloudConnectorsResourceId) { + this.publicCloudConnectorsResourceId = publicCloudConnectorsResourceId; + return this; + } + + /** + * Get the awsAccountId property: AWS Account ID. + * + * @return the awsAccountId value. + */ + public String awsAccountId() { + return this.awsAccountId; + } + + /** + * Set the awsAccountId property: AWS Account ID. + * + * @param awsAccountId the awsAccountId value to set. + * @return the Ec2SnapshotProperties object itself. + */ + public Ec2SnapshotProperties withAwsAccountId(String awsAccountId) { + this.awsAccountId = awsAccountId; + return this; + } + + /** + * Get the arn property: Amazon Resource Name (ARN). + * + * @return the arn value. + */ + public String arn() { + return this.arn; + } + + /** + * Set the arn property: Amazon Resource Name (ARN). + * + * @param arn the arn value to set. + * @return the Ec2SnapshotProperties object itself. + */ + public Ec2SnapshotProperties withArn(String arn) { + this.arn = arn; + return this; + } + + /** + * Get the publicCloudResourceName property: Public Cloud Resource Name. + * + * @return the publicCloudResourceName value. + */ + public String publicCloudResourceName() { + return this.publicCloudResourceName; + } + + /** + * Set the publicCloudResourceName property: Public Cloud Resource Name. + * + * @param publicCloudResourceName the publicCloudResourceName value to set. + * @return the Ec2SnapshotProperties object itself. + */ + public Ec2SnapshotProperties withPublicCloudResourceName(String publicCloudResourceName) { + this.publicCloudResourceName = publicCloudResourceName; + return this; + } + + /** + * Get the awsSourceSchema property: AWS Source Schema. + * + * @return the awsSourceSchema value. + */ + public String awsSourceSchema() { + return this.awsSourceSchema; + } + + /** + * Set the awsSourceSchema property: AWS Source Schema. + * + * @param awsSourceSchema the awsSourceSchema value to set. + * @return the Ec2SnapshotProperties object itself. + */ + public Ec2SnapshotProperties withAwsSourceSchema(String awsSourceSchema) { + this.awsSourceSchema = awsSourceSchema; + return this; + } + + /** + * Get the awsRegion property: AWS Region. + * + * @return the awsRegion value. + */ + public String awsRegion() { + return this.awsRegion; + } + + /** + * Set the awsRegion property: AWS Region. + * + * @param awsRegion the awsRegion value to set. + * @return the Ec2SnapshotProperties object itself. + */ + public Ec2SnapshotProperties withAwsRegion(String awsRegion) { + this.awsRegion = awsRegion; + return this; + } + + /** + * Get the awsTags property: AWS Tags. + * + * @return the awsTags value. + */ + public Map awsTags() { + return this.awsTags; + } + + /** + * Set the awsTags property: AWS Tags. + * + * @param awsTags the awsTags value to set. + * @return the Ec2SnapshotProperties object itself. + */ + public Ec2SnapshotProperties withAwsTags(Map awsTags) { + this.awsTags = awsTags; + return this; + } + + /** + * Get the provisioningState property: The status of the last operation. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (awsProperties() != null) { + awsProperties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("awsProperties", this.awsProperties); + jsonWriter.writeStringField("publicCloudConnectorsResourceId", this.publicCloudConnectorsResourceId); + jsonWriter.writeStringField("awsAccountId", this.awsAccountId); + jsonWriter.writeStringField("arn", this.arn); + jsonWriter.writeStringField("publicCloudResourceName", this.publicCloudResourceName); + jsonWriter.writeStringField("awsSourceSchema", this.awsSourceSchema); + jsonWriter.writeStringField("awsRegion", this.awsRegion); + jsonWriter.writeMapField("awsTags", this.awsTags, (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of Ec2SnapshotProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of Ec2SnapshotProperties if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the Ec2SnapshotProperties. + */ + public static Ec2SnapshotProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + Ec2SnapshotProperties deserializedEc2SnapshotProperties = new Ec2SnapshotProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("awsProperties".equals(fieldName)) { + deserializedEc2SnapshotProperties.awsProperties = AwsEc2SnapshotProperties.fromJson(reader); + } else if ("publicCloudConnectorsResourceId".equals(fieldName)) { + deserializedEc2SnapshotProperties.publicCloudConnectorsResourceId = reader.getString(); + } else if ("awsAccountId".equals(fieldName)) { + deserializedEc2SnapshotProperties.awsAccountId = reader.getString(); + } else if ("arn".equals(fieldName)) { + deserializedEc2SnapshotProperties.arn = reader.getString(); + } else if ("publicCloudResourceName".equals(fieldName)) { + deserializedEc2SnapshotProperties.publicCloudResourceName = reader.getString(); + } else if ("awsSourceSchema".equals(fieldName)) { + deserializedEc2SnapshotProperties.awsSourceSchema = reader.getString(); + } else if ("awsRegion".equals(fieldName)) { + deserializedEc2SnapshotProperties.awsRegion = reader.getString(); + } else if ("awsTags".equals(fieldName)) { + Map awsTags = reader.readMap(reader1 -> reader1.getString()); + deserializedEc2SnapshotProperties.awsTags = awsTags; + } else if ("provisioningState".equals(fieldName)) { + deserializedEc2SnapshotProperties.provisioningState + = ProvisioningState.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedEc2SnapshotProperties; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/Ec2SnapshotTagsUpdate.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/Ec2SnapshotTagsUpdate.java new file mode 100644 index 000000000000..84964fcc5b80 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/Ec2SnapshotTagsUpdate.java @@ -0,0 +1,95 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.Map; + +/** + * The type used for updating tags in Ec2Snapshot resources. + */ +@Fluent +public final class Ec2SnapshotTagsUpdate implements JsonSerializable { + /* + * Resource tags. + */ + private Map tags; + + /** + * Creates an instance of Ec2SnapshotTagsUpdate class. + */ + public Ec2SnapshotTagsUpdate() { + } + + /** + * Get the tags property: Resource tags. + * + * @return the tags value. + */ + public Map tags() { + return this.tags; + } + + /** + * Set the tags property: Resource tags. + * + * @param tags the tags value to set. + * @return the Ec2SnapshotTagsUpdate object itself. + */ + public Ec2SnapshotTagsUpdate withTags(Map tags) { + this.tags = tags; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeMapField("tags", this.tags, (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of Ec2SnapshotTagsUpdate from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of Ec2SnapshotTagsUpdate if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the Ec2SnapshotTagsUpdate. + */ + public static Ec2SnapshotTagsUpdate fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + Ec2SnapshotTagsUpdate deserializedEc2SnapshotTagsUpdate = new Ec2SnapshotTagsUpdate(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedEc2SnapshotTagsUpdate.tags = tags; + } else { + reader.skipChildren(); + } + } + + return deserializedEc2SnapshotTagsUpdate; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/Ec2Snapshots.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/Ec2Snapshots.java new file mode 100644 index 000000000000..cccefd9d51d3 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/Ec2Snapshots.java @@ -0,0 +1,157 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** + * Resource collection API of Ec2Snapshots. + */ +public interface Ec2Snapshots { + /** + * List Ec2Snapshot resources by subscription ID. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Ec2Snapshot list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable list(); + + /** + * List Ec2Snapshot resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Ec2Snapshot list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable list(Context context); + + /** + * List Ec2Snapshot resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Ec2Snapshot list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * List Ec2Snapshot resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Ec2Snapshot list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Get a Ec2Snapshot. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2Snapshot. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Ec2Snapshot along with {@link Response}. + */ + Response getByResourceGroupWithResponse(String resourceGroupName, String name, Context context); + + /** + * Get a Ec2Snapshot. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2Snapshot. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Ec2Snapshot. + */ + Ec2Snapshot getByResourceGroup(String resourceGroupName, String name); + + /** + * Delete a Ec2Snapshot. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2Snapshot. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByResourceGroup(String resourceGroupName, String name); + + /** + * Delete a Ec2Snapshot. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2Snapshot. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String name, Context context); + + /** + * Get a Ec2Snapshot. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Ec2Snapshot along with {@link Response}. + */ + Ec2Snapshot getById(String id); + + /** + * Get a Ec2Snapshot. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Ec2Snapshot along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Delete a Ec2Snapshot. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteById(String id); + + /** + * Delete a Ec2Snapshot. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new Ec2Snapshot resource. + * + * @param name resource name. + * @return the first stage of the new Ec2Snapshot definition. + */ + Ec2Snapshot.DefinitionStages.Blank define(String name); +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/Ec2Subnet.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/Ec2Subnet.java new file mode 100644 index 000000000000..f2045f5a8dee --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/Ec2Subnet.java @@ -0,0 +1,252 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.awsconnector.fluent.models.Ec2SubnetInner; +import java.util.Map; + +/** + * An immutable client-side representation of Ec2Subnet. + */ +public interface Ec2Subnet { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the location property: The geo-location where the resource lives. + * + * @return the location value. + */ + String location(); + + /** + * Gets the tags property: Resource tags. + * + * @return the tags value. + */ + Map tags(); + + /** + * Gets the properties property: The resource-specific properties for this resource. + * + * @return the properties value. + */ + Ec2SubnetProperties properties(); + + /** + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the region of the resource. + * + * @return the region of the resource. + */ + Region region(); + + /** + * Gets the name of the resource region. + * + * @return the name of the resource region. + */ + String regionName(); + + /** + * Gets the name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + + /** + * Gets the inner com.azure.resourcemanager.awsconnector.fluent.models.Ec2SubnetInner object. + * + * @return the inner object. + */ + Ec2SubnetInner innerModel(); + + /** + * The entirety of the Ec2Subnet definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithLocation, + DefinitionStages.WithResourceGroup, DefinitionStages.WithCreate { + } + + /** + * The Ec2Subnet definition stages. + */ + interface DefinitionStages { + /** + * The first stage of the Ec2Subnet definition. + */ + interface Blank extends WithLocation { + } + + /** + * The stage of the Ec2Subnet definition allowing to specify location. + */ + interface WithLocation { + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithResourceGroup withRegion(Region location); + + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithResourceGroup withRegion(String location); + } + + /** + * The stage of the Ec2Subnet definition allowing to specify parent resource. + */ + interface WithResourceGroup { + /** + * Specifies resourceGroupName. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @return the next definition stage. + */ + WithCreate withExistingResourceGroup(String resourceGroupName); + } + + /** + * The stage of the Ec2Subnet 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.WithProperties { + /** + * Executes the create request. + * + * @return the created resource. + */ + Ec2Subnet create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + Ec2Subnet create(Context context); + } + + /** + * The stage of the Ec2Subnet definition allowing to specify tags. + */ + interface WithTags { + /** + * Specifies the tags property: Resource tags.. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + WithCreate withTags(Map tags); + } + + /** + * The stage of the Ec2Subnet definition allowing to specify properties. + */ + interface WithProperties { + /** + * Specifies the properties property: The resource-specific properties for this resource.. + * + * @param properties The resource-specific properties for this resource. + * @return the next definition stage. + */ + WithCreate withProperties(Ec2SubnetProperties properties); + } + } + + /** + * Begins update for the Ec2Subnet resource. + * + * @return the stage of resource update. + */ + Ec2Subnet.Update update(); + + /** + * The template for Ec2Subnet update. + */ + interface Update extends UpdateStages.WithTags { + /** + * Executes the update request. + * + * @return the updated resource. + */ + Ec2Subnet apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + Ec2Subnet apply(Context context); + } + + /** + * The Ec2Subnet update stages. + */ + interface UpdateStages { + /** + * The stage of the Ec2Subnet update allowing to specify tags. + */ + interface WithTags { + /** + * Specifies the tags property: Resource tags.. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + Update withTags(Map tags); + } + } + + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + Ec2Subnet refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + Ec2Subnet refresh(Context context); +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/Ec2SubnetListResult.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/Ec2SubnetListResult.java new file mode 100644 index 000000000000..89baeef6f696 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/Ec2SubnetListResult.java @@ -0,0 +1,134 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.awsconnector.fluent.models.Ec2SubnetInner; +import java.io.IOException; +import java.util.List; + +/** + * The response of a Ec2Subnet list operation. + */ +@Fluent +public final class Ec2SubnetListResult implements JsonSerializable { + /* + * The Ec2Subnet items on this page + */ + private List value; + + /* + * The link to the next page of items + */ + private String nextLink; + + /** + * Creates an instance of Ec2SubnetListResult class. + */ + public Ec2SubnetListResult() { + } + + /** + * Get the value property: The Ec2Subnet items on this page. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The Ec2Subnet items on this page. + * + * @param value the value value to set. + * @return the Ec2SubnetListResult object itself. + */ + public Ec2SubnetListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The link to the next page of items. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: The link to the next page of items. + * + * @param nextLink the nextLink value to set. + * @return the Ec2SubnetListResult object itself. + */ + public Ec2SubnetListResult withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property value in model Ec2SubnetListResult")); + } else { + value().forEach(e -> e.validate()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(Ec2SubnetListResult.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("nextLink", this.nextLink); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of Ec2SubnetListResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of Ec2SubnetListResult if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the Ec2SubnetListResult. + */ + public static Ec2SubnetListResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + Ec2SubnetListResult deserializedEc2SubnetListResult = new Ec2SubnetListResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value = reader.readArray(reader1 -> Ec2SubnetInner.fromJson(reader1)); + deserializedEc2SubnetListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedEc2SubnetListResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedEc2SubnetListResult; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/Ec2SubnetProperties.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/Ec2SubnetProperties.java new file mode 100644 index 000000000000..e1e2c062a3f3 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/Ec2SubnetProperties.java @@ -0,0 +1,311 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.Map; + +/** + * Definition of Ec2Subnet. + */ +@Fluent +public final class Ec2SubnetProperties implements JsonSerializable { + /* + * AWS Properties + */ + private AwsEc2SubnetProperties awsProperties; + + /* + * Public Cloud Connectors Resource ID + */ + private String publicCloudConnectorsResourceId; + + /* + * AWS Account ID + */ + private String awsAccountId; + + /* + * Amazon Resource Name (ARN) + */ + private String arn; + + /* + * Public Cloud Resource Name + */ + private String publicCloudResourceName; + + /* + * AWS Source Schema + */ + private String awsSourceSchema; + + /* + * AWS Region + */ + private String awsRegion; + + /* + * AWS Tags + */ + private Map awsTags; + + /* + * The status of the last operation. + */ + private ProvisioningState provisioningState; + + /** + * Creates an instance of Ec2SubnetProperties class. + */ + public Ec2SubnetProperties() { + } + + /** + * Get the awsProperties property: AWS Properties. + * + * @return the awsProperties value. + */ + public AwsEc2SubnetProperties awsProperties() { + return this.awsProperties; + } + + /** + * Set the awsProperties property: AWS Properties. + * + * @param awsProperties the awsProperties value to set. + * @return the Ec2SubnetProperties object itself. + */ + public Ec2SubnetProperties withAwsProperties(AwsEc2SubnetProperties awsProperties) { + this.awsProperties = awsProperties; + return this; + } + + /** + * Get the publicCloudConnectorsResourceId property: Public Cloud Connectors Resource ID. + * + * @return the publicCloudConnectorsResourceId value. + */ + public String publicCloudConnectorsResourceId() { + return this.publicCloudConnectorsResourceId; + } + + /** + * Set the publicCloudConnectorsResourceId property: Public Cloud Connectors Resource ID. + * + * @param publicCloudConnectorsResourceId the publicCloudConnectorsResourceId value to set. + * @return the Ec2SubnetProperties object itself. + */ + public Ec2SubnetProperties withPublicCloudConnectorsResourceId(String publicCloudConnectorsResourceId) { + this.publicCloudConnectorsResourceId = publicCloudConnectorsResourceId; + return this; + } + + /** + * Get the awsAccountId property: AWS Account ID. + * + * @return the awsAccountId value. + */ + public String awsAccountId() { + return this.awsAccountId; + } + + /** + * Set the awsAccountId property: AWS Account ID. + * + * @param awsAccountId the awsAccountId value to set. + * @return the Ec2SubnetProperties object itself. + */ + public Ec2SubnetProperties withAwsAccountId(String awsAccountId) { + this.awsAccountId = awsAccountId; + return this; + } + + /** + * Get the arn property: Amazon Resource Name (ARN). + * + * @return the arn value. + */ + public String arn() { + return this.arn; + } + + /** + * Set the arn property: Amazon Resource Name (ARN). + * + * @param arn the arn value to set. + * @return the Ec2SubnetProperties object itself. + */ + public Ec2SubnetProperties withArn(String arn) { + this.arn = arn; + return this; + } + + /** + * Get the publicCloudResourceName property: Public Cloud Resource Name. + * + * @return the publicCloudResourceName value. + */ + public String publicCloudResourceName() { + return this.publicCloudResourceName; + } + + /** + * Set the publicCloudResourceName property: Public Cloud Resource Name. + * + * @param publicCloudResourceName the publicCloudResourceName value to set. + * @return the Ec2SubnetProperties object itself. + */ + public Ec2SubnetProperties withPublicCloudResourceName(String publicCloudResourceName) { + this.publicCloudResourceName = publicCloudResourceName; + return this; + } + + /** + * Get the awsSourceSchema property: AWS Source Schema. + * + * @return the awsSourceSchema value. + */ + public String awsSourceSchema() { + return this.awsSourceSchema; + } + + /** + * Set the awsSourceSchema property: AWS Source Schema. + * + * @param awsSourceSchema the awsSourceSchema value to set. + * @return the Ec2SubnetProperties object itself. + */ + public Ec2SubnetProperties withAwsSourceSchema(String awsSourceSchema) { + this.awsSourceSchema = awsSourceSchema; + return this; + } + + /** + * Get the awsRegion property: AWS Region. + * + * @return the awsRegion value. + */ + public String awsRegion() { + return this.awsRegion; + } + + /** + * Set the awsRegion property: AWS Region. + * + * @param awsRegion the awsRegion value to set. + * @return the Ec2SubnetProperties object itself. + */ + public Ec2SubnetProperties withAwsRegion(String awsRegion) { + this.awsRegion = awsRegion; + return this; + } + + /** + * Get the awsTags property: AWS Tags. + * + * @return the awsTags value. + */ + public Map awsTags() { + return this.awsTags; + } + + /** + * Set the awsTags property: AWS Tags. + * + * @param awsTags the awsTags value to set. + * @return the Ec2SubnetProperties object itself. + */ + public Ec2SubnetProperties withAwsTags(Map awsTags) { + this.awsTags = awsTags; + return this; + } + + /** + * Get the provisioningState property: The status of the last operation. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (awsProperties() != null) { + awsProperties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("awsProperties", this.awsProperties); + jsonWriter.writeStringField("publicCloudConnectorsResourceId", this.publicCloudConnectorsResourceId); + jsonWriter.writeStringField("awsAccountId", this.awsAccountId); + jsonWriter.writeStringField("arn", this.arn); + jsonWriter.writeStringField("publicCloudResourceName", this.publicCloudResourceName); + jsonWriter.writeStringField("awsSourceSchema", this.awsSourceSchema); + jsonWriter.writeStringField("awsRegion", this.awsRegion); + jsonWriter.writeMapField("awsTags", this.awsTags, (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of Ec2SubnetProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of Ec2SubnetProperties if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the Ec2SubnetProperties. + */ + public static Ec2SubnetProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + Ec2SubnetProperties deserializedEc2SubnetProperties = new Ec2SubnetProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("awsProperties".equals(fieldName)) { + deserializedEc2SubnetProperties.awsProperties = AwsEc2SubnetProperties.fromJson(reader); + } else if ("publicCloudConnectorsResourceId".equals(fieldName)) { + deserializedEc2SubnetProperties.publicCloudConnectorsResourceId = reader.getString(); + } else if ("awsAccountId".equals(fieldName)) { + deserializedEc2SubnetProperties.awsAccountId = reader.getString(); + } else if ("arn".equals(fieldName)) { + deserializedEc2SubnetProperties.arn = reader.getString(); + } else if ("publicCloudResourceName".equals(fieldName)) { + deserializedEc2SubnetProperties.publicCloudResourceName = reader.getString(); + } else if ("awsSourceSchema".equals(fieldName)) { + deserializedEc2SubnetProperties.awsSourceSchema = reader.getString(); + } else if ("awsRegion".equals(fieldName)) { + deserializedEc2SubnetProperties.awsRegion = reader.getString(); + } else if ("awsTags".equals(fieldName)) { + Map awsTags = reader.readMap(reader1 -> reader1.getString()); + deserializedEc2SubnetProperties.awsTags = awsTags; + } else if ("provisioningState".equals(fieldName)) { + deserializedEc2SubnetProperties.provisioningState + = ProvisioningState.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedEc2SubnetProperties; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/Ec2SubnetTagsUpdate.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/Ec2SubnetTagsUpdate.java new file mode 100644 index 000000000000..c21b88a76d7b --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/Ec2SubnetTagsUpdate.java @@ -0,0 +1,95 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.Map; + +/** + * The type used for updating tags in Ec2Subnet resources. + */ +@Fluent +public final class Ec2SubnetTagsUpdate implements JsonSerializable { + /* + * Resource tags. + */ + private Map tags; + + /** + * Creates an instance of Ec2SubnetTagsUpdate class. + */ + public Ec2SubnetTagsUpdate() { + } + + /** + * Get the tags property: Resource tags. + * + * @return the tags value. + */ + public Map tags() { + return this.tags; + } + + /** + * Set the tags property: Resource tags. + * + * @param tags the tags value to set. + * @return the Ec2SubnetTagsUpdate object itself. + */ + public Ec2SubnetTagsUpdate withTags(Map tags) { + this.tags = tags; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeMapField("tags", this.tags, (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of Ec2SubnetTagsUpdate from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of Ec2SubnetTagsUpdate if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the Ec2SubnetTagsUpdate. + */ + public static Ec2SubnetTagsUpdate fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + Ec2SubnetTagsUpdate deserializedEc2SubnetTagsUpdate = new Ec2SubnetTagsUpdate(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedEc2SubnetTagsUpdate.tags = tags; + } else { + reader.skipChildren(); + } + } + + return deserializedEc2SubnetTagsUpdate; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/Ec2Subnets.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/Ec2Subnets.java new file mode 100644 index 000000000000..132f6e22dd4b --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/Ec2Subnets.java @@ -0,0 +1,157 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** + * Resource collection API of Ec2Subnets. + */ +public interface Ec2Subnets { + /** + * List Ec2Subnet resources by subscription ID. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Ec2Subnet list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable list(); + + /** + * List Ec2Subnet resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Ec2Subnet list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable list(Context context); + + /** + * List Ec2Subnet resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Ec2Subnet list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * List Ec2Subnet resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Ec2Subnet list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Get a Ec2Subnet. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2Subnet. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Ec2Subnet along with {@link Response}. + */ + Response getByResourceGroupWithResponse(String resourceGroupName, String name, Context context); + + /** + * Get a Ec2Subnet. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2Subnet. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Ec2Subnet. + */ + Ec2Subnet getByResourceGroup(String resourceGroupName, String name); + + /** + * Delete a Ec2Subnet. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2Subnet. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByResourceGroup(String resourceGroupName, String name); + + /** + * Delete a Ec2Subnet. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2Subnet. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String name, Context context); + + /** + * Get a Ec2Subnet. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Ec2Subnet along with {@link Response}. + */ + Ec2Subnet getById(String id); + + /** + * Get a Ec2Subnet. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Ec2Subnet along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Delete a Ec2Subnet. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteById(String id); + + /** + * Delete a Ec2Subnet. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new Ec2Subnet resource. + * + * @param name resource name. + * @return the first stage of the new Ec2Subnet definition. + */ + Ec2Subnet.DefinitionStages.Blank define(String name); +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/Ec2Volume.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/Ec2Volume.java new file mode 100644 index 000000000000..878042d5e7cd --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/Ec2Volume.java @@ -0,0 +1,252 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.awsconnector.fluent.models.Ec2VolumeInner; +import java.util.Map; + +/** + * An immutable client-side representation of Ec2Volume. + */ +public interface Ec2Volume { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the location property: The geo-location where the resource lives. + * + * @return the location value. + */ + String location(); + + /** + * Gets the tags property: Resource tags. + * + * @return the tags value. + */ + Map tags(); + + /** + * Gets the properties property: The resource-specific properties for this resource. + * + * @return the properties value. + */ + Ec2VolumeProperties properties(); + + /** + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the region of the resource. + * + * @return the region of the resource. + */ + Region region(); + + /** + * Gets the name of the resource region. + * + * @return the name of the resource region. + */ + String regionName(); + + /** + * Gets the name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + + /** + * Gets the inner com.azure.resourcemanager.awsconnector.fluent.models.Ec2VolumeInner object. + * + * @return the inner object. + */ + Ec2VolumeInner innerModel(); + + /** + * The entirety of the Ec2Volume definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithLocation, + DefinitionStages.WithResourceGroup, DefinitionStages.WithCreate { + } + + /** + * The Ec2Volume definition stages. + */ + interface DefinitionStages { + /** + * The first stage of the Ec2Volume definition. + */ + interface Blank extends WithLocation { + } + + /** + * The stage of the Ec2Volume definition allowing to specify location. + */ + interface WithLocation { + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithResourceGroup withRegion(Region location); + + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithResourceGroup withRegion(String location); + } + + /** + * The stage of the Ec2Volume definition allowing to specify parent resource. + */ + interface WithResourceGroup { + /** + * Specifies resourceGroupName. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @return the next definition stage. + */ + WithCreate withExistingResourceGroup(String resourceGroupName); + } + + /** + * The stage of the Ec2Volume 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.WithProperties { + /** + * Executes the create request. + * + * @return the created resource. + */ + Ec2Volume create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + Ec2Volume create(Context context); + } + + /** + * The stage of the Ec2Volume definition allowing to specify tags. + */ + interface WithTags { + /** + * Specifies the tags property: Resource tags.. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + WithCreate withTags(Map tags); + } + + /** + * The stage of the Ec2Volume definition allowing to specify properties. + */ + interface WithProperties { + /** + * Specifies the properties property: The resource-specific properties for this resource.. + * + * @param properties The resource-specific properties for this resource. + * @return the next definition stage. + */ + WithCreate withProperties(Ec2VolumeProperties properties); + } + } + + /** + * Begins update for the Ec2Volume resource. + * + * @return the stage of resource update. + */ + Ec2Volume.Update update(); + + /** + * The template for Ec2Volume update. + */ + interface Update extends UpdateStages.WithTags { + /** + * Executes the update request. + * + * @return the updated resource. + */ + Ec2Volume apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + Ec2Volume apply(Context context); + } + + /** + * The Ec2Volume update stages. + */ + interface UpdateStages { + /** + * The stage of the Ec2Volume update allowing to specify tags. + */ + interface WithTags { + /** + * Specifies the tags property: Resource tags.. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + Update withTags(Map tags); + } + } + + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + Ec2Volume refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + Ec2Volume refresh(Context context); +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/Ec2VolumeListResult.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/Ec2VolumeListResult.java new file mode 100644 index 000000000000..93158bba97b7 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/Ec2VolumeListResult.java @@ -0,0 +1,134 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.awsconnector.fluent.models.Ec2VolumeInner; +import java.io.IOException; +import java.util.List; + +/** + * The response of a Ec2Volume list operation. + */ +@Fluent +public final class Ec2VolumeListResult implements JsonSerializable { + /* + * The Ec2Volume items on this page + */ + private List value; + + /* + * The link to the next page of items + */ + private String nextLink; + + /** + * Creates an instance of Ec2VolumeListResult class. + */ + public Ec2VolumeListResult() { + } + + /** + * Get the value property: The Ec2Volume items on this page. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The Ec2Volume items on this page. + * + * @param value the value value to set. + * @return the Ec2VolumeListResult object itself. + */ + public Ec2VolumeListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The link to the next page of items. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: The link to the next page of items. + * + * @param nextLink the nextLink value to set. + * @return the Ec2VolumeListResult object itself. + */ + public Ec2VolumeListResult withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property value in model Ec2VolumeListResult")); + } else { + value().forEach(e -> e.validate()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(Ec2VolumeListResult.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("nextLink", this.nextLink); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of Ec2VolumeListResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of Ec2VolumeListResult if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the Ec2VolumeListResult. + */ + public static Ec2VolumeListResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + Ec2VolumeListResult deserializedEc2VolumeListResult = new Ec2VolumeListResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value = reader.readArray(reader1 -> Ec2VolumeInner.fromJson(reader1)); + deserializedEc2VolumeListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedEc2VolumeListResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedEc2VolumeListResult; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/Ec2VolumeProperties.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/Ec2VolumeProperties.java new file mode 100644 index 000000000000..c17ba1c45598 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/Ec2VolumeProperties.java @@ -0,0 +1,311 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.Map; + +/** + * Definition of Ec2Volume. + */ +@Fluent +public final class Ec2VolumeProperties implements JsonSerializable { + /* + * AWS Properties + */ + private AwsEc2VolumeProperties awsProperties; + + /* + * Public Cloud Connectors Resource ID + */ + private String publicCloudConnectorsResourceId; + + /* + * AWS Account ID + */ + private String awsAccountId; + + /* + * Amazon Resource Name (ARN) + */ + private String arn; + + /* + * Public Cloud Resource Name + */ + private String publicCloudResourceName; + + /* + * AWS Source Schema + */ + private String awsSourceSchema; + + /* + * AWS Region + */ + private String awsRegion; + + /* + * AWS Tags + */ + private Map awsTags; + + /* + * The status of the last operation. + */ + private ProvisioningState provisioningState; + + /** + * Creates an instance of Ec2VolumeProperties class. + */ + public Ec2VolumeProperties() { + } + + /** + * Get the awsProperties property: AWS Properties. + * + * @return the awsProperties value. + */ + public AwsEc2VolumeProperties awsProperties() { + return this.awsProperties; + } + + /** + * Set the awsProperties property: AWS Properties. + * + * @param awsProperties the awsProperties value to set. + * @return the Ec2VolumeProperties object itself. + */ + public Ec2VolumeProperties withAwsProperties(AwsEc2VolumeProperties awsProperties) { + this.awsProperties = awsProperties; + return this; + } + + /** + * Get the publicCloudConnectorsResourceId property: Public Cloud Connectors Resource ID. + * + * @return the publicCloudConnectorsResourceId value. + */ + public String publicCloudConnectorsResourceId() { + return this.publicCloudConnectorsResourceId; + } + + /** + * Set the publicCloudConnectorsResourceId property: Public Cloud Connectors Resource ID. + * + * @param publicCloudConnectorsResourceId the publicCloudConnectorsResourceId value to set. + * @return the Ec2VolumeProperties object itself. + */ + public Ec2VolumeProperties withPublicCloudConnectorsResourceId(String publicCloudConnectorsResourceId) { + this.publicCloudConnectorsResourceId = publicCloudConnectorsResourceId; + return this; + } + + /** + * Get the awsAccountId property: AWS Account ID. + * + * @return the awsAccountId value. + */ + public String awsAccountId() { + return this.awsAccountId; + } + + /** + * Set the awsAccountId property: AWS Account ID. + * + * @param awsAccountId the awsAccountId value to set. + * @return the Ec2VolumeProperties object itself. + */ + public Ec2VolumeProperties withAwsAccountId(String awsAccountId) { + this.awsAccountId = awsAccountId; + return this; + } + + /** + * Get the arn property: Amazon Resource Name (ARN). + * + * @return the arn value. + */ + public String arn() { + return this.arn; + } + + /** + * Set the arn property: Amazon Resource Name (ARN). + * + * @param arn the arn value to set. + * @return the Ec2VolumeProperties object itself. + */ + public Ec2VolumeProperties withArn(String arn) { + this.arn = arn; + return this; + } + + /** + * Get the publicCloudResourceName property: Public Cloud Resource Name. + * + * @return the publicCloudResourceName value. + */ + public String publicCloudResourceName() { + return this.publicCloudResourceName; + } + + /** + * Set the publicCloudResourceName property: Public Cloud Resource Name. + * + * @param publicCloudResourceName the publicCloudResourceName value to set. + * @return the Ec2VolumeProperties object itself. + */ + public Ec2VolumeProperties withPublicCloudResourceName(String publicCloudResourceName) { + this.publicCloudResourceName = publicCloudResourceName; + return this; + } + + /** + * Get the awsSourceSchema property: AWS Source Schema. + * + * @return the awsSourceSchema value. + */ + public String awsSourceSchema() { + return this.awsSourceSchema; + } + + /** + * Set the awsSourceSchema property: AWS Source Schema. + * + * @param awsSourceSchema the awsSourceSchema value to set. + * @return the Ec2VolumeProperties object itself. + */ + public Ec2VolumeProperties withAwsSourceSchema(String awsSourceSchema) { + this.awsSourceSchema = awsSourceSchema; + return this; + } + + /** + * Get the awsRegion property: AWS Region. + * + * @return the awsRegion value. + */ + public String awsRegion() { + return this.awsRegion; + } + + /** + * Set the awsRegion property: AWS Region. + * + * @param awsRegion the awsRegion value to set. + * @return the Ec2VolumeProperties object itself. + */ + public Ec2VolumeProperties withAwsRegion(String awsRegion) { + this.awsRegion = awsRegion; + return this; + } + + /** + * Get the awsTags property: AWS Tags. + * + * @return the awsTags value. + */ + public Map awsTags() { + return this.awsTags; + } + + /** + * Set the awsTags property: AWS Tags. + * + * @param awsTags the awsTags value to set. + * @return the Ec2VolumeProperties object itself. + */ + public Ec2VolumeProperties withAwsTags(Map awsTags) { + this.awsTags = awsTags; + return this; + } + + /** + * Get the provisioningState property: The status of the last operation. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (awsProperties() != null) { + awsProperties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("awsProperties", this.awsProperties); + jsonWriter.writeStringField("publicCloudConnectorsResourceId", this.publicCloudConnectorsResourceId); + jsonWriter.writeStringField("awsAccountId", this.awsAccountId); + jsonWriter.writeStringField("arn", this.arn); + jsonWriter.writeStringField("publicCloudResourceName", this.publicCloudResourceName); + jsonWriter.writeStringField("awsSourceSchema", this.awsSourceSchema); + jsonWriter.writeStringField("awsRegion", this.awsRegion); + jsonWriter.writeMapField("awsTags", this.awsTags, (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of Ec2VolumeProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of Ec2VolumeProperties if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the Ec2VolumeProperties. + */ + public static Ec2VolumeProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + Ec2VolumeProperties deserializedEc2VolumeProperties = new Ec2VolumeProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("awsProperties".equals(fieldName)) { + deserializedEc2VolumeProperties.awsProperties = AwsEc2VolumeProperties.fromJson(reader); + } else if ("publicCloudConnectorsResourceId".equals(fieldName)) { + deserializedEc2VolumeProperties.publicCloudConnectorsResourceId = reader.getString(); + } else if ("awsAccountId".equals(fieldName)) { + deserializedEc2VolumeProperties.awsAccountId = reader.getString(); + } else if ("arn".equals(fieldName)) { + deserializedEc2VolumeProperties.arn = reader.getString(); + } else if ("publicCloudResourceName".equals(fieldName)) { + deserializedEc2VolumeProperties.publicCloudResourceName = reader.getString(); + } else if ("awsSourceSchema".equals(fieldName)) { + deserializedEc2VolumeProperties.awsSourceSchema = reader.getString(); + } else if ("awsRegion".equals(fieldName)) { + deserializedEc2VolumeProperties.awsRegion = reader.getString(); + } else if ("awsTags".equals(fieldName)) { + Map awsTags = reader.readMap(reader1 -> reader1.getString()); + deserializedEc2VolumeProperties.awsTags = awsTags; + } else if ("provisioningState".equals(fieldName)) { + deserializedEc2VolumeProperties.provisioningState + = ProvisioningState.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedEc2VolumeProperties; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/Ec2VolumeTagsUpdate.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/Ec2VolumeTagsUpdate.java new file mode 100644 index 000000000000..2ade8c90dfcc --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/Ec2VolumeTagsUpdate.java @@ -0,0 +1,95 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.Map; + +/** + * The type used for updating tags in Ec2Volume resources. + */ +@Fluent +public final class Ec2VolumeTagsUpdate implements JsonSerializable { + /* + * Resource tags. + */ + private Map tags; + + /** + * Creates an instance of Ec2VolumeTagsUpdate class. + */ + public Ec2VolumeTagsUpdate() { + } + + /** + * Get the tags property: Resource tags. + * + * @return the tags value. + */ + public Map tags() { + return this.tags; + } + + /** + * Set the tags property: Resource tags. + * + * @param tags the tags value to set. + * @return the Ec2VolumeTagsUpdate object itself. + */ + public Ec2VolumeTagsUpdate withTags(Map tags) { + this.tags = tags; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeMapField("tags", this.tags, (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of Ec2VolumeTagsUpdate from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of Ec2VolumeTagsUpdate if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the Ec2VolumeTagsUpdate. + */ + public static Ec2VolumeTagsUpdate fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + Ec2VolumeTagsUpdate deserializedEc2VolumeTagsUpdate = new Ec2VolumeTagsUpdate(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedEc2VolumeTagsUpdate.tags = tags; + } else { + reader.skipChildren(); + } + } + + return deserializedEc2VolumeTagsUpdate; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/Ec2Volumes.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/Ec2Volumes.java new file mode 100644 index 000000000000..8e5aa62e6ca4 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/Ec2Volumes.java @@ -0,0 +1,157 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** + * Resource collection API of Ec2Volumes. + */ +public interface Ec2Volumes { + /** + * List Ec2Volume resources by subscription ID. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Ec2Volume list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable list(); + + /** + * List Ec2Volume resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Ec2Volume list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable list(Context context); + + /** + * List Ec2Volume resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Ec2Volume list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * List Ec2Volume resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Ec2Volume list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Get a Ec2Volume. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2Volume. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Ec2Volume along with {@link Response}. + */ + Response getByResourceGroupWithResponse(String resourceGroupName, String name, Context context); + + /** + * Get a Ec2Volume. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2Volume. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Ec2Volume. + */ + Ec2Volume getByResourceGroup(String resourceGroupName, String name); + + /** + * Delete a Ec2Volume. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2Volume. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByResourceGroup(String resourceGroupName, String name); + + /** + * Delete a Ec2Volume. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2Volume. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String name, Context context); + + /** + * Get a Ec2Volume. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Ec2Volume along with {@link Response}. + */ + Ec2Volume getById(String id); + + /** + * Get a Ec2Volume. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Ec2Volume along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Delete a Ec2Volume. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteById(String id); + + /** + * Delete a Ec2Volume. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new Ec2Volume resource. + * + * @param name resource name. + * @return the first stage of the new Ec2Volume definition. + */ + Ec2Volume.DefinitionStages.Blank define(String name); +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/Ec2Vpc.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/Ec2Vpc.java new file mode 100644 index 000000000000..7515decaa3d5 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/Ec2Vpc.java @@ -0,0 +1,252 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.awsconnector.fluent.models.Ec2VpcInner; +import java.util.Map; + +/** + * An immutable client-side representation of Ec2Vpc. + */ +public interface Ec2Vpc { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the location property: The geo-location where the resource lives. + * + * @return the location value. + */ + String location(); + + /** + * Gets the tags property: Resource tags. + * + * @return the tags value. + */ + Map tags(); + + /** + * Gets the properties property: The resource-specific properties for this resource. + * + * @return the properties value. + */ + Ec2VpcProperties properties(); + + /** + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the region of the resource. + * + * @return the region of the resource. + */ + Region region(); + + /** + * Gets the name of the resource region. + * + * @return the name of the resource region. + */ + String regionName(); + + /** + * Gets the name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + + /** + * Gets the inner com.azure.resourcemanager.awsconnector.fluent.models.Ec2VpcInner object. + * + * @return the inner object. + */ + Ec2VpcInner innerModel(); + + /** + * The entirety of the Ec2Vpc definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithLocation, + DefinitionStages.WithResourceGroup, DefinitionStages.WithCreate { + } + + /** + * The Ec2Vpc definition stages. + */ + interface DefinitionStages { + /** + * The first stage of the Ec2Vpc definition. + */ + interface Blank extends WithLocation { + } + + /** + * The stage of the Ec2Vpc definition allowing to specify location. + */ + interface WithLocation { + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithResourceGroup withRegion(Region location); + + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithResourceGroup withRegion(String location); + } + + /** + * The stage of the Ec2Vpc definition allowing to specify parent resource. + */ + interface WithResourceGroup { + /** + * Specifies resourceGroupName. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @return the next definition stage. + */ + WithCreate withExistingResourceGroup(String resourceGroupName); + } + + /** + * The stage of the Ec2Vpc 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.WithProperties { + /** + * Executes the create request. + * + * @return the created resource. + */ + Ec2Vpc create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + Ec2Vpc create(Context context); + } + + /** + * The stage of the Ec2Vpc definition allowing to specify tags. + */ + interface WithTags { + /** + * Specifies the tags property: Resource tags.. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + WithCreate withTags(Map tags); + } + + /** + * The stage of the Ec2Vpc definition allowing to specify properties. + */ + interface WithProperties { + /** + * Specifies the properties property: The resource-specific properties for this resource.. + * + * @param properties The resource-specific properties for this resource. + * @return the next definition stage. + */ + WithCreate withProperties(Ec2VpcProperties properties); + } + } + + /** + * Begins update for the Ec2Vpc resource. + * + * @return the stage of resource update. + */ + Ec2Vpc.Update update(); + + /** + * The template for Ec2Vpc update. + */ + interface Update extends UpdateStages.WithTags { + /** + * Executes the update request. + * + * @return the updated resource. + */ + Ec2Vpc apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + Ec2Vpc apply(Context context); + } + + /** + * The Ec2Vpc update stages. + */ + interface UpdateStages { + /** + * The stage of the Ec2Vpc update allowing to specify tags. + */ + interface WithTags { + /** + * Specifies the tags property: Resource tags.. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + Update withTags(Map tags); + } + } + + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + Ec2Vpc refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + Ec2Vpc refresh(Context context); +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/Ec2VpcEndpoint.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/Ec2VpcEndpoint.java new file mode 100644 index 000000000000..06aae19028c5 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/Ec2VpcEndpoint.java @@ -0,0 +1,252 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.awsconnector.fluent.models.Ec2VpcEndpointInner; +import java.util.Map; + +/** + * An immutable client-side representation of Ec2VpcEndpoint. + */ +public interface Ec2VpcEndpoint { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the location property: The geo-location where the resource lives. + * + * @return the location value. + */ + String location(); + + /** + * Gets the tags property: Resource tags. + * + * @return the tags value. + */ + Map tags(); + + /** + * Gets the properties property: The resource-specific properties for this resource. + * + * @return the properties value. + */ + Ec2VpcEndpointProperties properties(); + + /** + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the region of the resource. + * + * @return the region of the resource. + */ + Region region(); + + /** + * Gets the name of the resource region. + * + * @return the name of the resource region. + */ + String regionName(); + + /** + * Gets the name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + + /** + * Gets the inner com.azure.resourcemanager.awsconnector.fluent.models.Ec2VpcEndpointInner object. + * + * @return the inner object. + */ + Ec2VpcEndpointInner innerModel(); + + /** + * The entirety of the Ec2VpcEndpoint definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithLocation, + DefinitionStages.WithResourceGroup, DefinitionStages.WithCreate { + } + + /** + * The Ec2VpcEndpoint definition stages. + */ + interface DefinitionStages { + /** + * The first stage of the Ec2VpcEndpoint definition. + */ + interface Blank extends WithLocation { + } + + /** + * The stage of the Ec2VpcEndpoint definition allowing to specify location. + */ + interface WithLocation { + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithResourceGroup withRegion(Region location); + + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithResourceGroup withRegion(String location); + } + + /** + * The stage of the Ec2VpcEndpoint definition allowing to specify parent resource. + */ + interface WithResourceGroup { + /** + * Specifies resourceGroupName. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @return the next definition stage. + */ + WithCreate withExistingResourceGroup(String resourceGroupName); + } + + /** + * The stage of the Ec2VpcEndpoint 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.WithProperties { + /** + * Executes the create request. + * + * @return the created resource. + */ + Ec2VpcEndpoint create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + Ec2VpcEndpoint create(Context context); + } + + /** + * The stage of the Ec2VpcEndpoint definition allowing to specify tags. + */ + interface WithTags { + /** + * Specifies the tags property: Resource tags.. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + WithCreate withTags(Map tags); + } + + /** + * The stage of the Ec2VpcEndpoint definition allowing to specify properties. + */ + interface WithProperties { + /** + * Specifies the properties property: The resource-specific properties for this resource.. + * + * @param properties The resource-specific properties for this resource. + * @return the next definition stage. + */ + WithCreate withProperties(Ec2VpcEndpointProperties properties); + } + } + + /** + * Begins update for the Ec2VpcEndpoint resource. + * + * @return the stage of resource update. + */ + Ec2VpcEndpoint.Update update(); + + /** + * The template for Ec2VpcEndpoint update. + */ + interface Update extends UpdateStages.WithTags { + /** + * Executes the update request. + * + * @return the updated resource. + */ + Ec2VpcEndpoint apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + Ec2VpcEndpoint apply(Context context); + } + + /** + * The Ec2VpcEndpoint update stages. + */ + interface UpdateStages { + /** + * The stage of the Ec2VpcEndpoint update allowing to specify tags. + */ + interface WithTags { + /** + * Specifies the tags property: Resource tags.. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + Update withTags(Map tags); + } + } + + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + Ec2VpcEndpoint refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + Ec2VpcEndpoint refresh(Context context); +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/Ec2VpcEndpointListResult.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/Ec2VpcEndpointListResult.java new file mode 100644 index 000000000000..66943891b578 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/Ec2VpcEndpointListResult.java @@ -0,0 +1,135 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.awsconnector.fluent.models.Ec2VpcEndpointInner; +import java.io.IOException; +import java.util.List; + +/** + * The response of a Ec2VPCEndpoint list operation. + */ +@Fluent +public final class Ec2VpcEndpointListResult implements JsonSerializable { + /* + * The Ec2VPCEndpoint items on this page + */ + private List value; + + /* + * The link to the next page of items + */ + private String nextLink; + + /** + * Creates an instance of Ec2VpcEndpointListResult class. + */ + public Ec2VpcEndpointListResult() { + } + + /** + * Get the value property: The Ec2VPCEndpoint items on this page. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The Ec2VPCEndpoint items on this page. + * + * @param value the value value to set. + * @return the Ec2VpcEndpointListResult object itself. + */ + public Ec2VpcEndpointListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The link to the next page of items. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: The link to the next page of items. + * + * @param nextLink the nextLink value to set. + * @return the Ec2VpcEndpointListResult object itself. + */ + public Ec2VpcEndpointListResult withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property value in model Ec2VpcEndpointListResult")); + } else { + value().forEach(e -> e.validate()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(Ec2VpcEndpointListResult.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("nextLink", this.nextLink); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of Ec2VpcEndpointListResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of Ec2VpcEndpointListResult if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the Ec2VpcEndpointListResult. + */ + public static Ec2VpcEndpointListResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + Ec2VpcEndpointListResult deserializedEc2VpcEndpointListResult = new Ec2VpcEndpointListResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> Ec2VpcEndpointInner.fromJson(reader1)); + deserializedEc2VpcEndpointListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedEc2VpcEndpointListResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedEc2VpcEndpointListResult; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/Ec2VpcEndpointProperties.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/Ec2VpcEndpointProperties.java new file mode 100644 index 000000000000..6b8044dc119d --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/Ec2VpcEndpointProperties.java @@ -0,0 +1,311 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.Map; + +/** + * Definition of Ec2VPCEndpoint. + */ +@Fluent +public final class Ec2VpcEndpointProperties implements JsonSerializable { + /* + * AWS Properties + */ + private AwsEc2VpcEndpointProperties awsProperties; + + /* + * Public Cloud Connectors Resource ID + */ + private String publicCloudConnectorsResourceId; + + /* + * AWS Account ID + */ + private String awsAccountId; + + /* + * Amazon Resource Name (ARN) + */ + private String arn; + + /* + * Public Cloud Resource Name + */ + private String publicCloudResourceName; + + /* + * AWS Source Schema + */ + private String awsSourceSchema; + + /* + * AWS Region + */ + private String awsRegion; + + /* + * AWS Tags + */ + private Map awsTags; + + /* + * The status of the last operation. + */ + private ProvisioningState provisioningState; + + /** + * Creates an instance of Ec2VpcEndpointProperties class. + */ + public Ec2VpcEndpointProperties() { + } + + /** + * Get the awsProperties property: AWS Properties. + * + * @return the awsProperties value. + */ + public AwsEc2VpcEndpointProperties awsProperties() { + return this.awsProperties; + } + + /** + * Set the awsProperties property: AWS Properties. + * + * @param awsProperties the awsProperties value to set. + * @return the Ec2VpcEndpointProperties object itself. + */ + public Ec2VpcEndpointProperties withAwsProperties(AwsEc2VpcEndpointProperties awsProperties) { + this.awsProperties = awsProperties; + return this; + } + + /** + * Get the publicCloudConnectorsResourceId property: Public Cloud Connectors Resource ID. + * + * @return the publicCloudConnectorsResourceId value. + */ + public String publicCloudConnectorsResourceId() { + return this.publicCloudConnectorsResourceId; + } + + /** + * Set the publicCloudConnectorsResourceId property: Public Cloud Connectors Resource ID. + * + * @param publicCloudConnectorsResourceId the publicCloudConnectorsResourceId value to set. + * @return the Ec2VpcEndpointProperties object itself. + */ + public Ec2VpcEndpointProperties withPublicCloudConnectorsResourceId(String publicCloudConnectorsResourceId) { + this.publicCloudConnectorsResourceId = publicCloudConnectorsResourceId; + return this; + } + + /** + * Get the awsAccountId property: AWS Account ID. + * + * @return the awsAccountId value. + */ + public String awsAccountId() { + return this.awsAccountId; + } + + /** + * Set the awsAccountId property: AWS Account ID. + * + * @param awsAccountId the awsAccountId value to set. + * @return the Ec2VpcEndpointProperties object itself. + */ + public Ec2VpcEndpointProperties withAwsAccountId(String awsAccountId) { + this.awsAccountId = awsAccountId; + return this; + } + + /** + * Get the arn property: Amazon Resource Name (ARN). + * + * @return the arn value. + */ + public String arn() { + return this.arn; + } + + /** + * Set the arn property: Amazon Resource Name (ARN). + * + * @param arn the arn value to set. + * @return the Ec2VpcEndpointProperties object itself. + */ + public Ec2VpcEndpointProperties withArn(String arn) { + this.arn = arn; + return this; + } + + /** + * Get the publicCloudResourceName property: Public Cloud Resource Name. + * + * @return the publicCloudResourceName value. + */ + public String publicCloudResourceName() { + return this.publicCloudResourceName; + } + + /** + * Set the publicCloudResourceName property: Public Cloud Resource Name. + * + * @param publicCloudResourceName the publicCloudResourceName value to set. + * @return the Ec2VpcEndpointProperties object itself. + */ + public Ec2VpcEndpointProperties withPublicCloudResourceName(String publicCloudResourceName) { + this.publicCloudResourceName = publicCloudResourceName; + return this; + } + + /** + * Get the awsSourceSchema property: AWS Source Schema. + * + * @return the awsSourceSchema value. + */ + public String awsSourceSchema() { + return this.awsSourceSchema; + } + + /** + * Set the awsSourceSchema property: AWS Source Schema. + * + * @param awsSourceSchema the awsSourceSchema value to set. + * @return the Ec2VpcEndpointProperties object itself. + */ + public Ec2VpcEndpointProperties withAwsSourceSchema(String awsSourceSchema) { + this.awsSourceSchema = awsSourceSchema; + return this; + } + + /** + * Get the awsRegion property: AWS Region. + * + * @return the awsRegion value. + */ + public String awsRegion() { + return this.awsRegion; + } + + /** + * Set the awsRegion property: AWS Region. + * + * @param awsRegion the awsRegion value to set. + * @return the Ec2VpcEndpointProperties object itself. + */ + public Ec2VpcEndpointProperties withAwsRegion(String awsRegion) { + this.awsRegion = awsRegion; + return this; + } + + /** + * Get the awsTags property: AWS Tags. + * + * @return the awsTags value. + */ + public Map awsTags() { + return this.awsTags; + } + + /** + * Set the awsTags property: AWS Tags. + * + * @param awsTags the awsTags value to set. + * @return the Ec2VpcEndpointProperties object itself. + */ + public Ec2VpcEndpointProperties withAwsTags(Map awsTags) { + this.awsTags = awsTags; + return this; + } + + /** + * Get the provisioningState property: The status of the last operation. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (awsProperties() != null) { + awsProperties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("awsProperties", this.awsProperties); + jsonWriter.writeStringField("publicCloudConnectorsResourceId", this.publicCloudConnectorsResourceId); + jsonWriter.writeStringField("awsAccountId", this.awsAccountId); + jsonWriter.writeStringField("arn", this.arn); + jsonWriter.writeStringField("publicCloudResourceName", this.publicCloudResourceName); + jsonWriter.writeStringField("awsSourceSchema", this.awsSourceSchema); + jsonWriter.writeStringField("awsRegion", this.awsRegion); + jsonWriter.writeMapField("awsTags", this.awsTags, (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of Ec2VpcEndpointProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of Ec2VpcEndpointProperties if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IOException If an error occurs while reading the Ec2VpcEndpointProperties. + */ + public static Ec2VpcEndpointProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + Ec2VpcEndpointProperties deserializedEc2VpcEndpointProperties = new Ec2VpcEndpointProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("awsProperties".equals(fieldName)) { + deserializedEc2VpcEndpointProperties.awsProperties = AwsEc2VpcEndpointProperties.fromJson(reader); + } else if ("publicCloudConnectorsResourceId".equals(fieldName)) { + deserializedEc2VpcEndpointProperties.publicCloudConnectorsResourceId = reader.getString(); + } else if ("awsAccountId".equals(fieldName)) { + deserializedEc2VpcEndpointProperties.awsAccountId = reader.getString(); + } else if ("arn".equals(fieldName)) { + deserializedEc2VpcEndpointProperties.arn = reader.getString(); + } else if ("publicCloudResourceName".equals(fieldName)) { + deserializedEc2VpcEndpointProperties.publicCloudResourceName = reader.getString(); + } else if ("awsSourceSchema".equals(fieldName)) { + deserializedEc2VpcEndpointProperties.awsSourceSchema = reader.getString(); + } else if ("awsRegion".equals(fieldName)) { + deserializedEc2VpcEndpointProperties.awsRegion = reader.getString(); + } else if ("awsTags".equals(fieldName)) { + Map awsTags = reader.readMap(reader1 -> reader1.getString()); + deserializedEc2VpcEndpointProperties.awsTags = awsTags; + } else if ("provisioningState".equals(fieldName)) { + deserializedEc2VpcEndpointProperties.provisioningState + = ProvisioningState.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedEc2VpcEndpointProperties; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/Ec2VpcEndpointTagsUpdate.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/Ec2VpcEndpointTagsUpdate.java new file mode 100644 index 000000000000..4960f55da71a --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/Ec2VpcEndpointTagsUpdate.java @@ -0,0 +1,95 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.Map; + +/** + * The type used for updating tags in Ec2VPCEndpoint resources. + */ +@Fluent +public final class Ec2VpcEndpointTagsUpdate implements JsonSerializable { + /* + * Resource tags. + */ + private Map tags; + + /** + * Creates an instance of Ec2VpcEndpointTagsUpdate class. + */ + public Ec2VpcEndpointTagsUpdate() { + } + + /** + * Get the tags property: Resource tags. + * + * @return the tags value. + */ + public Map tags() { + return this.tags; + } + + /** + * Set the tags property: Resource tags. + * + * @param tags the tags value to set. + * @return the Ec2VpcEndpointTagsUpdate object itself. + */ + public Ec2VpcEndpointTagsUpdate withTags(Map tags) { + this.tags = tags; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeMapField("tags", this.tags, (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of Ec2VpcEndpointTagsUpdate from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of Ec2VpcEndpointTagsUpdate if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IOException If an error occurs while reading the Ec2VpcEndpointTagsUpdate. + */ + public static Ec2VpcEndpointTagsUpdate fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + Ec2VpcEndpointTagsUpdate deserializedEc2VpcEndpointTagsUpdate = new Ec2VpcEndpointTagsUpdate(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedEc2VpcEndpointTagsUpdate.tags = tags; + } else { + reader.skipChildren(); + } + } + + return deserializedEc2VpcEndpointTagsUpdate; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/Ec2VpcEndpoints.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/Ec2VpcEndpoints.java new file mode 100644 index 000000000000..9e8c202022de --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/Ec2VpcEndpoints.java @@ -0,0 +1,157 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** + * Resource collection API of Ec2VpcEndpoints. + */ +public interface Ec2VpcEndpoints { + /** + * List Ec2VPCEndpoint resources by subscription ID. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Ec2VPCEndpoint list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable list(); + + /** + * List Ec2VPCEndpoint resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Ec2VPCEndpoint list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable list(Context context); + + /** + * List Ec2VPCEndpoint resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Ec2VPCEndpoint list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * List Ec2VPCEndpoint resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Ec2VPCEndpoint list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Get a Ec2VPCEndpoint. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2VPCEndpoint. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Ec2VPCEndpoint along with {@link Response}. + */ + Response getByResourceGroupWithResponse(String resourceGroupName, String name, Context context); + + /** + * Get a Ec2VPCEndpoint. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2VPCEndpoint. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Ec2VPCEndpoint. + */ + Ec2VpcEndpoint getByResourceGroup(String resourceGroupName, String name); + + /** + * Delete a Ec2VPCEndpoint. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2VPCEndpoint. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByResourceGroup(String resourceGroupName, String name); + + /** + * Delete a Ec2VPCEndpoint. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2VPCEndpoint. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String name, Context context); + + /** + * Get a Ec2VPCEndpoint. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Ec2VPCEndpoint along with {@link Response}. + */ + Ec2VpcEndpoint getById(String id); + + /** + * Get a Ec2VPCEndpoint. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Ec2VPCEndpoint along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Delete a Ec2VPCEndpoint. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteById(String id); + + /** + * Delete a Ec2VPCEndpoint. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new Ec2VpcEndpoint resource. + * + * @param name resource name. + * @return the first stage of the new Ec2VpcEndpoint definition. + */ + Ec2VpcEndpoint.DefinitionStages.Blank define(String name); +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/Ec2VpcListResult.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/Ec2VpcListResult.java new file mode 100644 index 000000000000..7f688a6dbb02 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/Ec2VpcListResult.java @@ -0,0 +1,134 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.awsconnector.fluent.models.Ec2VpcInner; +import java.io.IOException; +import java.util.List; + +/** + * The response of a Ec2Vpc list operation. + */ +@Fluent +public final class Ec2VpcListResult implements JsonSerializable { + /* + * The Ec2Vpc items on this page + */ + private List value; + + /* + * The link to the next page of items + */ + private String nextLink; + + /** + * Creates an instance of Ec2VpcListResult class. + */ + public Ec2VpcListResult() { + } + + /** + * Get the value property: The Ec2Vpc items on this page. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The Ec2Vpc items on this page. + * + * @param value the value value to set. + * @return the Ec2VpcListResult object itself. + */ + public Ec2VpcListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The link to the next page of items. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: The link to the next page of items. + * + * @param nextLink the nextLink value to set. + * @return the Ec2VpcListResult object itself. + */ + public Ec2VpcListResult withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property value in model Ec2VpcListResult")); + } else { + value().forEach(e -> e.validate()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(Ec2VpcListResult.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("nextLink", this.nextLink); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of Ec2VpcListResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of Ec2VpcListResult if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the Ec2VpcListResult. + */ + public static Ec2VpcListResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + Ec2VpcListResult deserializedEc2VpcListResult = new Ec2VpcListResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value = reader.readArray(reader1 -> Ec2VpcInner.fromJson(reader1)); + deserializedEc2VpcListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedEc2VpcListResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedEc2VpcListResult; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/Ec2VpcPeeringConnection.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/Ec2VpcPeeringConnection.java new file mode 100644 index 000000000000..9535a1a16e77 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/Ec2VpcPeeringConnection.java @@ -0,0 +1,252 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.awsconnector.fluent.models.Ec2VpcPeeringConnectionInner; +import java.util.Map; + +/** + * An immutable client-side representation of Ec2VpcPeeringConnection. + */ +public interface Ec2VpcPeeringConnection { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the location property: The geo-location where the resource lives. + * + * @return the location value. + */ + String location(); + + /** + * Gets the tags property: Resource tags. + * + * @return the tags value. + */ + Map tags(); + + /** + * Gets the properties property: The resource-specific properties for this resource. + * + * @return the properties value. + */ + Ec2VpcPeeringConnectionProperties properties(); + + /** + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the region of the resource. + * + * @return the region of the resource. + */ + Region region(); + + /** + * Gets the name of the resource region. + * + * @return the name of the resource region. + */ + String regionName(); + + /** + * Gets the name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + + /** + * Gets the inner com.azure.resourcemanager.awsconnector.fluent.models.Ec2VpcPeeringConnectionInner object. + * + * @return the inner object. + */ + Ec2VpcPeeringConnectionInner innerModel(); + + /** + * The entirety of the Ec2VpcPeeringConnection definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithLocation, + DefinitionStages.WithResourceGroup, DefinitionStages.WithCreate { + } + + /** + * The Ec2VpcPeeringConnection definition stages. + */ + interface DefinitionStages { + /** + * The first stage of the Ec2VpcPeeringConnection definition. + */ + interface Blank extends WithLocation { + } + + /** + * The stage of the Ec2VpcPeeringConnection definition allowing to specify location. + */ + interface WithLocation { + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithResourceGroup withRegion(Region location); + + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithResourceGroup withRegion(String location); + } + + /** + * The stage of the Ec2VpcPeeringConnection definition allowing to specify parent resource. + */ + interface WithResourceGroup { + /** + * Specifies resourceGroupName. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @return the next definition stage. + */ + WithCreate withExistingResourceGroup(String resourceGroupName); + } + + /** + * The stage of the Ec2VpcPeeringConnection 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.WithProperties { + /** + * Executes the create request. + * + * @return the created resource. + */ + Ec2VpcPeeringConnection create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + Ec2VpcPeeringConnection create(Context context); + } + + /** + * The stage of the Ec2VpcPeeringConnection definition allowing to specify tags. + */ + interface WithTags { + /** + * Specifies the tags property: Resource tags.. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + WithCreate withTags(Map tags); + } + + /** + * The stage of the Ec2VpcPeeringConnection definition allowing to specify properties. + */ + interface WithProperties { + /** + * Specifies the properties property: The resource-specific properties for this resource.. + * + * @param properties The resource-specific properties for this resource. + * @return the next definition stage. + */ + WithCreate withProperties(Ec2VpcPeeringConnectionProperties properties); + } + } + + /** + * Begins update for the Ec2VpcPeeringConnection resource. + * + * @return the stage of resource update. + */ + Ec2VpcPeeringConnection.Update update(); + + /** + * The template for Ec2VpcPeeringConnection update. + */ + interface Update extends UpdateStages.WithTags { + /** + * Executes the update request. + * + * @return the updated resource. + */ + Ec2VpcPeeringConnection apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + Ec2VpcPeeringConnection apply(Context context); + } + + /** + * The Ec2VpcPeeringConnection update stages. + */ + interface UpdateStages { + /** + * The stage of the Ec2VpcPeeringConnection update allowing to specify tags. + */ + interface WithTags { + /** + * Specifies the tags property: Resource tags.. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + Update withTags(Map tags); + } + } + + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + Ec2VpcPeeringConnection refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + Ec2VpcPeeringConnection refresh(Context context); +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/Ec2VpcPeeringConnectionListResult.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/Ec2VpcPeeringConnectionListResult.java new file mode 100644 index 000000000000..b38bd31eb5ca --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/Ec2VpcPeeringConnectionListResult.java @@ -0,0 +1,137 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.awsconnector.fluent.models.Ec2VpcPeeringConnectionInner; +import java.io.IOException; +import java.util.List; + +/** + * The response of a Ec2VPCPeeringConnection list operation. + */ +@Fluent +public final class Ec2VpcPeeringConnectionListResult implements JsonSerializable { + /* + * The Ec2VPCPeeringConnection items on this page + */ + private List value; + + /* + * The link to the next page of items + */ + private String nextLink; + + /** + * Creates an instance of Ec2VpcPeeringConnectionListResult class. + */ + public Ec2VpcPeeringConnectionListResult() { + } + + /** + * Get the value property: The Ec2VPCPeeringConnection items on this page. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The Ec2VPCPeeringConnection items on this page. + * + * @param value the value value to set. + * @return the Ec2VpcPeeringConnectionListResult object itself. + */ + public Ec2VpcPeeringConnectionListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The link to the next page of items. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: The link to the next page of items. + * + * @param nextLink the nextLink value to set. + * @return the Ec2VpcPeeringConnectionListResult object itself. + */ + public Ec2VpcPeeringConnectionListResult withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property value in model Ec2VpcPeeringConnectionListResult")); + } else { + value().forEach(e -> e.validate()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(Ec2VpcPeeringConnectionListResult.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("nextLink", this.nextLink); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of Ec2VpcPeeringConnectionListResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of Ec2VpcPeeringConnectionListResult if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the Ec2VpcPeeringConnectionListResult. + */ + public static Ec2VpcPeeringConnectionListResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + Ec2VpcPeeringConnectionListResult deserializedEc2VpcPeeringConnectionListResult + = new Ec2VpcPeeringConnectionListResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> Ec2VpcPeeringConnectionInner.fromJson(reader1)); + deserializedEc2VpcPeeringConnectionListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedEc2VpcPeeringConnectionListResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedEc2VpcPeeringConnectionListResult; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/Ec2VpcPeeringConnectionProperties.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/Ec2VpcPeeringConnectionProperties.java new file mode 100644 index 000000000000..03b00cb960ed --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/Ec2VpcPeeringConnectionProperties.java @@ -0,0 +1,314 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.Map; + +/** + * Definition of Ec2VPCPeeringConnection. + */ +@Fluent +public final class Ec2VpcPeeringConnectionProperties implements JsonSerializable { + /* + * AWS Properties + */ + private AwsEc2VpcPeeringConnectionProperties awsProperties; + + /* + * Public Cloud Connectors Resource ID + */ + private String publicCloudConnectorsResourceId; + + /* + * AWS Account ID + */ + private String awsAccountId; + + /* + * Amazon Resource Name (ARN) + */ + private String arn; + + /* + * Public Cloud Resource Name + */ + private String publicCloudResourceName; + + /* + * AWS Source Schema + */ + private String awsSourceSchema; + + /* + * AWS Region + */ + private String awsRegion; + + /* + * AWS Tags + */ + private Map awsTags; + + /* + * The status of the last operation. + */ + private ProvisioningState provisioningState; + + /** + * Creates an instance of Ec2VpcPeeringConnectionProperties class. + */ + public Ec2VpcPeeringConnectionProperties() { + } + + /** + * Get the awsProperties property: AWS Properties. + * + * @return the awsProperties value. + */ + public AwsEc2VpcPeeringConnectionProperties awsProperties() { + return this.awsProperties; + } + + /** + * Set the awsProperties property: AWS Properties. + * + * @param awsProperties the awsProperties value to set. + * @return the Ec2VpcPeeringConnectionProperties object itself. + */ + public Ec2VpcPeeringConnectionProperties withAwsProperties(AwsEc2VpcPeeringConnectionProperties awsProperties) { + this.awsProperties = awsProperties; + return this; + } + + /** + * Get the publicCloudConnectorsResourceId property: Public Cloud Connectors Resource ID. + * + * @return the publicCloudConnectorsResourceId value. + */ + public String publicCloudConnectorsResourceId() { + return this.publicCloudConnectorsResourceId; + } + + /** + * Set the publicCloudConnectorsResourceId property: Public Cloud Connectors Resource ID. + * + * @param publicCloudConnectorsResourceId the publicCloudConnectorsResourceId value to set. + * @return the Ec2VpcPeeringConnectionProperties object itself. + */ + public Ec2VpcPeeringConnectionProperties + withPublicCloudConnectorsResourceId(String publicCloudConnectorsResourceId) { + this.publicCloudConnectorsResourceId = publicCloudConnectorsResourceId; + return this; + } + + /** + * Get the awsAccountId property: AWS Account ID. + * + * @return the awsAccountId value. + */ + public String awsAccountId() { + return this.awsAccountId; + } + + /** + * Set the awsAccountId property: AWS Account ID. + * + * @param awsAccountId the awsAccountId value to set. + * @return the Ec2VpcPeeringConnectionProperties object itself. + */ + public Ec2VpcPeeringConnectionProperties withAwsAccountId(String awsAccountId) { + this.awsAccountId = awsAccountId; + return this; + } + + /** + * Get the arn property: Amazon Resource Name (ARN). + * + * @return the arn value. + */ + public String arn() { + return this.arn; + } + + /** + * Set the arn property: Amazon Resource Name (ARN). + * + * @param arn the arn value to set. + * @return the Ec2VpcPeeringConnectionProperties object itself. + */ + public Ec2VpcPeeringConnectionProperties withArn(String arn) { + this.arn = arn; + return this; + } + + /** + * Get the publicCloudResourceName property: Public Cloud Resource Name. + * + * @return the publicCloudResourceName value. + */ + public String publicCloudResourceName() { + return this.publicCloudResourceName; + } + + /** + * Set the publicCloudResourceName property: Public Cloud Resource Name. + * + * @param publicCloudResourceName the publicCloudResourceName value to set. + * @return the Ec2VpcPeeringConnectionProperties object itself. + */ + public Ec2VpcPeeringConnectionProperties withPublicCloudResourceName(String publicCloudResourceName) { + this.publicCloudResourceName = publicCloudResourceName; + return this; + } + + /** + * Get the awsSourceSchema property: AWS Source Schema. + * + * @return the awsSourceSchema value. + */ + public String awsSourceSchema() { + return this.awsSourceSchema; + } + + /** + * Set the awsSourceSchema property: AWS Source Schema. + * + * @param awsSourceSchema the awsSourceSchema value to set. + * @return the Ec2VpcPeeringConnectionProperties object itself. + */ + public Ec2VpcPeeringConnectionProperties withAwsSourceSchema(String awsSourceSchema) { + this.awsSourceSchema = awsSourceSchema; + return this; + } + + /** + * Get the awsRegion property: AWS Region. + * + * @return the awsRegion value. + */ + public String awsRegion() { + return this.awsRegion; + } + + /** + * Set the awsRegion property: AWS Region. + * + * @param awsRegion the awsRegion value to set. + * @return the Ec2VpcPeeringConnectionProperties object itself. + */ + public Ec2VpcPeeringConnectionProperties withAwsRegion(String awsRegion) { + this.awsRegion = awsRegion; + return this; + } + + /** + * Get the awsTags property: AWS Tags. + * + * @return the awsTags value. + */ + public Map awsTags() { + return this.awsTags; + } + + /** + * Set the awsTags property: AWS Tags. + * + * @param awsTags the awsTags value to set. + * @return the Ec2VpcPeeringConnectionProperties object itself. + */ + public Ec2VpcPeeringConnectionProperties withAwsTags(Map awsTags) { + this.awsTags = awsTags; + return this; + } + + /** + * Get the provisioningState property: The status of the last operation. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (awsProperties() != null) { + awsProperties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("awsProperties", this.awsProperties); + jsonWriter.writeStringField("publicCloudConnectorsResourceId", this.publicCloudConnectorsResourceId); + jsonWriter.writeStringField("awsAccountId", this.awsAccountId); + jsonWriter.writeStringField("arn", this.arn); + jsonWriter.writeStringField("publicCloudResourceName", this.publicCloudResourceName); + jsonWriter.writeStringField("awsSourceSchema", this.awsSourceSchema); + jsonWriter.writeStringField("awsRegion", this.awsRegion); + jsonWriter.writeMapField("awsTags", this.awsTags, (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of Ec2VpcPeeringConnectionProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of Ec2VpcPeeringConnectionProperties if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the Ec2VpcPeeringConnectionProperties. + */ + public static Ec2VpcPeeringConnectionProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + Ec2VpcPeeringConnectionProperties deserializedEc2VpcPeeringConnectionProperties + = new Ec2VpcPeeringConnectionProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("awsProperties".equals(fieldName)) { + deserializedEc2VpcPeeringConnectionProperties.awsProperties + = AwsEc2VpcPeeringConnectionProperties.fromJson(reader); + } else if ("publicCloudConnectorsResourceId".equals(fieldName)) { + deserializedEc2VpcPeeringConnectionProperties.publicCloudConnectorsResourceId = reader.getString(); + } else if ("awsAccountId".equals(fieldName)) { + deserializedEc2VpcPeeringConnectionProperties.awsAccountId = reader.getString(); + } else if ("arn".equals(fieldName)) { + deserializedEc2VpcPeeringConnectionProperties.arn = reader.getString(); + } else if ("publicCloudResourceName".equals(fieldName)) { + deserializedEc2VpcPeeringConnectionProperties.publicCloudResourceName = reader.getString(); + } else if ("awsSourceSchema".equals(fieldName)) { + deserializedEc2VpcPeeringConnectionProperties.awsSourceSchema = reader.getString(); + } else if ("awsRegion".equals(fieldName)) { + deserializedEc2VpcPeeringConnectionProperties.awsRegion = reader.getString(); + } else if ("awsTags".equals(fieldName)) { + Map awsTags = reader.readMap(reader1 -> reader1.getString()); + deserializedEc2VpcPeeringConnectionProperties.awsTags = awsTags; + } else if ("provisioningState".equals(fieldName)) { + deserializedEc2VpcPeeringConnectionProperties.provisioningState + = ProvisioningState.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedEc2VpcPeeringConnectionProperties; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/Ec2VpcPeeringConnectionTagsUpdate.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/Ec2VpcPeeringConnectionTagsUpdate.java new file mode 100644 index 000000000000..70ee7081e58e --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/Ec2VpcPeeringConnectionTagsUpdate.java @@ -0,0 +1,96 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.Map; + +/** + * The type used for updating tags in Ec2VPCPeeringConnection resources. + */ +@Fluent +public final class Ec2VpcPeeringConnectionTagsUpdate implements JsonSerializable { + /* + * Resource tags. + */ + private Map tags; + + /** + * Creates an instance of Ec2VpcPeeringConnectionTagsUpdate class. + */ + public Ec2VpcPeeringConnectionTagsUpdate() { + } + + /** + * Get the tags property: Resource tags. + * + * @return the tags value. + */ + public Map tags() { + return this.tags; + } + + /** + * Set the tags property: Resource tags. + * + * @param tags the tags value to set. + * @return the Ec2VpcPeeringConnectionTagsUpdate object itself. + */ + public Ec2VpcPeeringConnectionTagsUpdate withTags(Map tags) { + this.tags = tags; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeMapField("tags", this.tags, (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of Ec2VpcPeeringConnectionTagsUpdate from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of Ec2VpcPeeringConnectionTagsUpdate if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the Ec2VpcPeeringConnectionTagsUpdate. + */ + public static Ec2VpcPeeringConnectionTagsUpdate fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + Ec2VpcPeeringConnectionTagsUpdate deserializedEc2VpcPeeringConnectionTagsUpdate + = new Ec2VpcPeeringConnectionTagsUpdate(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedEc2VpcPeeringConnectionTagsUpdate.tags = tags; + } else { + reader.skipChildren(); + } + } + + return deserializedEc2VpcPeeringConnectionTagsUpdate; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/Ec2VpcPeeringConnections.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/Ec2VpcPeeringConnections.java new file mode 100644 index 000000000000..e3ecb880599c --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/Ec2VpcPeeringConnections.java @@ -0,0 +1,162 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** + * Resource collection API of Ec2VpcPeeringConnections. + */ +public interface Ec2VpcPeeringConnections { + /** + * List Ec2VPCPeeringConnection resources by subscription ID. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Ec2VPCPeeringConnection list operation as paginated response with + * {@link PagedIterable}. + */ + PagedIterable list(); + + /** + * List Ec2VPCPeeringConnection resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Ec2VPCPeeringConnection list operation as paginated response with + * {@link PagedIterable}. + */ + PagedIterable list(Context context); + + /** + * List Ec2VPCPeeringConnection resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Ec2VPCPeeringConnection list operation as paginated response with + * {@link PagedIterable}. + */ + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * List Ec2VPCPeeringConnection resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Ec2VPCPeeringConnection list operation as paginated response with + * {@link PagedIterable}. + */ + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Get a Ec2VPCPeeringConnection. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2VPCPeeringConnection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Ec2VPCPeeringConnection along with {@link Response}. + */ + Response getByResourceGroupWithResponse(String resourceGroupName, String name, + Context context); + + /** + * Get a Ec2VPCPeeringConnection. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2VPCPeeringConnection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Ec2VPCPeeringConnection. + */ + Ec2VpcPeeringConnection getByResourceGroup(String resourceGroupName, String name); + + /** + * Delete a Ec2VPCPeeringConnection. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2VPCPeeringConnection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByResourceGroup(String resourceGroupName, String name); + + /** + * Delete a Ec2VPCPeeringConnection. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2VPCPeeringConnection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String name, Context context); + + /** + * Get a Ec2VPCPeeringConnection. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Ec2VPCPeeringConnection along with {@link Response}. + */ + Ec2VpcPeeringConnection getById(String id); + + /** + * Get a Ec2VPCPeeringConnection. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Ec2VPCPeeringConnection along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Delete a Ec2VPCPeeringConnection. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteById(String id); + + /** + * Delete a Ec2VPCPeeringConnection. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new Ec2VpcPeeringConnection resource. + * + * @param name resource name. + * @return the first stage of the new Ec2VpcPeeringConnection definition. + */ + Ec2VpcPeeringConnection.DefinitionStages.Blank define(String name); +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/Ec2VpcProperties.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/Ec2VpcProperties.java new file mode 100644 index 000000000000..44b7a69ccba9 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/Ec2VpcProperties.java @@ -0,0 +1,310 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.Map; + +/** + * Definition of Ec2Vpc. + */ +@Fluent +public final class Ec2VpcProperties implements JsonSerializable { + /* + * AWS Properties + */ + private AwsEc2VpcProperties awsProperties; + + /* + * Public Cloud Connectors Resource ID + */ + private String publicCloudConnectorsResourceId; + + /* + * AWS Account ID + */ + private String awsAccountId; + + /* + * Amazon Resource Name (ARN) + */ + private String arn; + + /* + * Public Cloud Resource Name + */ + private String publicCloudResourceName; + + /* + * AWS Source Schema + */ + private String awsSourceSchema; + + /* + * AWS Region + */ + private String awsRegion; + + /* + * AWS Tags + */ + private Map awsTags; + + /* + * The status of the last operation. + */ + private ProvisioningState provisioningState; + + /** + * Creates an instance of Ec2VpcProperties class. + */ + public Ec2VpcProperties() { + } + + /** + * Get the awsProperties property: AWS Properties. + * + * @return the awsProperties value. + */ + public AwsEc2VpcProperties awsProperties() { + return this.awsProperties; + } + + /** + * Set the awsProperties property: AWS Properties. + * + * @param awsProperties the awsProperties value to set. + * @return the Ec2VpcProperties object itself. + */ + public Ec2VpcProperties withAwsProperties(AwsEc2VpcProperties awsProperties) { + this.awsProperties = awsProperties; + return this; + } + + /** + * Get the publicCloudConnectorsResourceId property: Public Cloud Connectors Resource ID. + * + * @return the publicCloudConnectorsResourceId value. + */ + public String publicCloudConnectorsResourceId() { + return this.publicCloudConnectorsResourceId; + } + + /** + * Set the publicCloudConnectorsResourceId property: Public Cloud Connectors Resource ID. + * + * @param publicCloudConnectorsResourceId the publicCloudConnectorsResourceId value to set. + * @return the Ec2VpcProperties object itself. + */ + public Ec2VpcProperties withPublicCloudConnectorsResourceId(String publicCloudConnectorsResourceId) { + this.publicCloudConnectorsResourceId = publicCloudConnectorsResourceId; + return this; + } + + /** + * Get the awsAccountId property: AWS Account ID. + * + * @return the awsAccountId value. + */ + public String awsAccountId() { + return this.awsAccountId; + } + + /** + * Set the awsAccountId property: AWS Account ID. + * + * @param awsAccountId the awsAccountId value to set. + * @return the Ec2VpcProperties object itself. + */ + public Ec2VpcProperties withAwsAccountId(String awsAccountId) { + this.awsAccountId = awsAccountId; + return this; + } + + /** + * Get the arn property: Amazon Resource Name (ARN). + * + * @return the arn value. + */ + public String arn() { + return this.arn; + } + + /** + * Set the arn property: Amazon Resource Name (ARN). + * + * @param arn the arn value to set. + * @return the Ec2VpcProperties object itself. + */ + public Ec2VpcProperties withArn(String arn) { + this.arn = arn; + return this; + } + + /** + * Get the publicCloudResourceName property: Public Cloud Resource Name. + * + * @return the publicCloudResourceName value. + */ + public String publicCloudResourceName() { + return this.publicCloudResourceName; + } + + /** + * Set the publicCloudResourceName property: Public Cloud Resource Name. + * + * @param publicCloudResourceName the publicCloudResourceName value to set. + * @return the Ec2VpcProperties object itself. + */ + public Ec2VpcProperties withPublicCloudResourceName(String publicCloudResourceName) { + this.publicCloudResourceName = publicCloudResourceName; + return this; + } + + /** + * Get the awsSourceSchema property: AWS Source Schema. + * + * @return the awsSourceSchema value. + */ + public String awsSourceSchema() { + return this.awsSourceSchema; + } + + /** + * Set the awsSourceSchema property: AWS Source Schema. + * + * @param awsSourceSchema the awsSourceSchema value to set. + * @return the Ec2VpcProperties object itself. + */ + public Ec2VpcProperties withAwsSourceSchema(String awsSourceSchema) { + this.awsSourceSchema = awsSourceSchema; + return this; + } + + /** + * Get the awsRegion property: AWS Region. + * + * @return the awsRegion value. + */ + public String awsRegion() { + return this.awsRegion; + } + + /** + * Set the awsRegion property: AWS Region. + * + * @param awsRegion the awsRegion value to set. + * @return the Ec2VpcProperties object itself. + */ + public Ec2VpcProperties withAwsRegion(String awsRegion) { + this.awsRegion = awsRegion; + return this; + } + + /** + * Get the awsTags property: AWS Tags. + * + * @return the awsTags value. + */ + public Map awsTags() { + return this.awsTags; + } + + /** + * Set the awsTags property: AWS Tags. + * + * @param awsTags the awsTags value to set. + * @return the Ec2VpcProperties object itself. + */ + public Ec2VpcProperties withAwsTags(Map awsTags) { + this.awsTags = awsTags; + return this; + } + + /** + * Get the provisioningState property: The status of the last operation. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (awsProperties() != null) { + awsProperties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("awsProperties", this.awsProperties); + jsonWriter.writeStringField("publicCloudConnectorsResourceId", this.publicCloudConnectorsResourceId); + jsonWriter.writeStringField("awsAccountId", this.awsAccountId); + jsonWriter.writeStringField("arn", this.arn); + jsonWriter.writeStringField("publicCloudResourceName", this.publicCloudResourceName); + jsonWriter.writeStringField("awsSourceSchema", this.awsSourceSchema); + jsonWriter.writeStringField("awsRegion", this.awsRegion); + jsonWriter.writeMapField("awsTags", this.awsTags, (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of Ec2VpcProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of Ec2VpcProperties if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the Ec2VpcProperties. + */ + public static Ec2VpcProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + Ec2VpcProperties deserializedEc2VpcProperties = new Ec2VpcProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("awsProperties".equals(fieldName)) { + deserializedEc2VpcProperties.awsProperties = AwsEc2VpcProperties.fromJson(reader); + } else if ("publicCloudConnectorsResourceId".equals(fieldName)) { + deserializedEc2VpcProperties.publicCloudConnectorsResourceId = reader.getString(); + } else if ("awsAccountId".equals(fieldName)) { + deserializedEc2VpcProperties.awsAccountId = reader.getString(); + } else if ("arn".equals(fieldName)) { + deserializedEc2VpcProperties.arn = reader.getString(); + } else if ("publicCloudResourceName".equals(fieldName)) { + deserializedEc2VpcProperties.publicCloudResourceName = reader.getString(); + } else if ("awsSourceSchema".equals(fieldName)) { + deserializedEc2VpcProperties.awsSourceSchema = reader.getString(); + } else if ("awsRegion".equals(fieldName)) { + deserializedEc2VpcProperties.awsRegion = reader.getString(); + } else if ("awsTags".equals(fieldName)) { + Map awsTags = reader.readMap(reader1 -> reader1.getString()); + deserializedEc2VpcProperties.awsTags = awsTags; + } else if ("provisioningState".equals(fieldName)) { + deserializedEc2VpcProperties.provisioningState = ProvisioningState.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedEc2VpcProperties; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/Ec2VpcTagsUpdate.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/Ec2VpcTagsUpdate.java new file mode 100644 index 000000000000..928fbeba1d53 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/Ec2VpcTagsUpdate.java @@ -0,0 +1,95 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.Map; + +/** + * The type used for updating tags in Ec2Vpc resources. + */ +@Fluent +public final class Ec2VpcTagsUpdate implements JsonSerializable { + /* + * Resource tags. + */ + private Map tags; + + /** + * Creates an instance of Ec2VpcTagsUpdate class. + */ + public Ec2VpcTagsUpdate() { + } + + /** + * Get the tags property: Resource tags. + * + * @return the tags value. + */ + public Map tags() { + return this.tags; + } + + /** + * Set the tags property: Resource tags. + * + * @param tags the tags value to set. + * @return the Ec2VpcTagsUpdate object itself. + */ + public Ec2VpcTagsUpdate withTags(Map tags) { + this.tags = tags; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeMapField("tags", this.tags, (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of Ec2VpcTagsUpdate from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of Ec2VpcTagsUpdate if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the Ec2VpcTagsUpdate. + */ + public static Ec2VpcTagsUpdate fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + Ec2VpcTagsUpdate deserializedEc2VpcTagsUpdate = new Ec2VpcTagsUpdate(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedEc2VpcTagsUpdate.tags = tags; + } else { + reader.skipChildren(); + } + } + + return deserializedEc2VpcTagsUpdate; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/Ec2Vpcs.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/Ec2Vpcs.java new file mode 100644 index 000000000000..4b29f0032e95 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/Ec2Vpcs.java @@ -0,0 +1,157 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** + * Resource collection API of Ec2Vpcs. + */ +public interface Ec2Vpcs { + /** + * List Ec2Vpc resources by subscription ID. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Ec2Vpc list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable list(); + + /** + * List Ec2Vpc resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Ec2Vpc list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable list(Context context); + + /** + * List Ec2Vpc resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Ec2Vpc list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * List Ec2Vpc resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Ec2Vpc list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Get a Ec2Vpc. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2Vpc. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Ec2Vpc along with {@link Response}. + */ + Response getByResourceGroupWithResponse(String resourceGroupName, String name, Context context); + + /** + * Get a Ec2Vpc. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2Vpc. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Ec2Vpc. + */ + Ec2Vpc getByResourceGroup(String resourceGroupName, String name); + + /** + * Delete a Ec2Vpc. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2Vpc. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByResourceGroup(String resourceGroupName, String name); + + /** + * Delete a Ec2Vpc. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Ec2Vpc. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String name, Context context); + + /** + * Get a Ec2Vpc. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Ec2Vpc along with {@link Response}. + */ + Ec2Vpc getById(String id); + + /** + * Get a Ec2Vpc. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Ec2Vpc along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Delete a Ec2Vpc. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteById(String id); + + /** + * Delete a Ec2Vpc. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new Ec2Vpc resource. + * + * @param name resource name. + * @return the first stage of the new Ec2Vpc definition. + */ + Ec2Vpc.DefinitionStages.Blank define(String name); +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/EcrImageDetail.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/EcrImageDetail.java new file mode 100644 index 000000000000..6645f99fb327 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/EcrImageDetail.java @@ -0,0 +1,252 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.awsconnector.fluent.models.EcrImageDetailInner; +import java.util.Map; + +/** + * An immutable client-side representation of EcrImageDetail. + */ +public interface EcrImageDetail { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the location property: The geo-location where the resource lives. + * + * @return the location value. + */ + String location(); + + /** + * Gets the tags property: Resource tags. + * + * @return the tags value. + */ + Map tags(); + + /** + * Gets the properties property: The resource-specific properties for this resource. + * + * @return the properties value. + */ + EcrImageDetailProperties properties(); + + /** + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the region of the resource. + * + * @return the region of the resource. + */ + Region region(); + + /** + * Gets the name of the resource region. + * + * @return the name of the resource region. + */ + String regionName(); + + /** + * Gets the name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + + /** + * Gets the inner com.azure.resourcemanager.awsconnector.fluent.models.EcrImageDetailInner object. + * + * @return the inner object. + */ + EcrImageDetailInner innerModel(); + + /** + * The entirety of the EcrImageDetail definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithLocation, + DefinitionStages.WithResourceGroup, DefinitionStages.WithCreate { + } + + /** + * The EcrImageDetail definition stages. + */ + interface DefinitionStages { + /** + * The first stage of the EcrImageDetail definition. + */ + interface Blank extends WithLocation { + } + + /** + * The stage of the EcrImageDetail definition allowing to specify location. + */ + interface WithLocation { + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithResourceGroup withRegion(Region location); + + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithResourceGroup withRegion(String location); + } + + /** + * The stage of the EcrImageDetail definition allowing to specify parent resource. + */ + interface WithResourceGroup { + /** + * Specifies resourceGroupName. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @return the next definition stage. + */ + WithCreate withExistingResourceGroup(String resourceGroupName); + } + + /** + * The stage of the EcrImageDetail 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.WithProperties { + /** + * Executes the create request. + * + * @return the created resource. + */ + EcrImageDetail create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + EcrImageDetail create(Context context); + } + + /** + * The stage of the EcrImageDetail definition allowing to specify tags. + */ + interface WithTags { + /** + * Specifies the tags property: Resource tags.. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + WithCreate withTags(Map tags); + } + + /** + * The stage of the EcrImageDetail definition allowing to specify properties. + */ + interface WithProperties { + /** + * Specifies the properties property: The resource-specific properties for this resource.. + * + * @param properties The resource-specific properties for this resource. + * @return the next definition stage. + */ + WithCreate withProperties(EcrImageDetailProperties properties); + } + } + + /** + * Begins update for the EcrImageDetail resource. + * + * @return the stage of resource update. + */ + EcrImageDetail.Update update(); + + /** + * The template for EcrImageDetail update. + */ + interface Update extends UpdateStages.WithTags { + /** + * Executes the update request. + * + * @return the updated resource. + */ + EcrImageDetail apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + EcrImageDetail apply(Context context); + } + + /** + * The EcrImageDetail update stages. + */ + interface UpdateStages { + /** + * The stage of the EcrImageDetail update allowing to specify tags. + */ + interface WithTags { + /** + * Specifies the tags property: Resource tags.. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + Update withTags(Map tags); + } + } + + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + EcrImageDetail refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + EcrImageDetail refresh(Context context); +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/EcrImageDetailListResult.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/EcrImageDetailListResult.java new file mode 100644 index 000000000000..a06d1bcb86ec --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/EcrImageDetailListResult.java @@ -0,0 +1,135 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.awsconnector.fluent.models.EcrImageDetailInner; +import java.io.IOException; +import java.util.List; + +/** + * The response of a EcrImageDetail list operation. + */ +@Fluent +public final class EcrImageDetailListResult implements JsonSerializable { + /* + * The EcrImageDetail items on this page + */ + private List value; + + /* + * The link to the next page of items + */ + private String nextLink; + + /** + * Creates an instance of EcrImageDetailListResult class. + */ + public EcrImageDetailListResult() { + } + + /** + * Get the value property: The EcrImageDetail items on this page. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The EcrImageDetail items on this page. + * + * @param value the value value to set. + * @return the EcrImageDetailListResult object itself. + */ + public EcrImageDetailListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The link to the next page of items. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: The link to the next page of items. + * + * @param nextLink the nextLink value to set. + * @return the EcrImageDetailListResult object itself. + */ + public EcrImageDetailListResult withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property value in model EcrImageDetailListResult")); + } else { + value().forEach(e -> e.validate()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(EcrImageDetailListResult.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("nextLink", this.nextLink); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of EcrImageDetailListResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of EcrImageDetailListResult if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the EcrImageDetailListResult. + */ + public static EcrImageDetailListResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + EcrImageDetailListResult deserializedEcrImageDetailListResult = new EcrImageDetailListResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> EcrImageDetailInner.fromJson(reader1)); + deserializedEcrImageDetailListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedEcrImageDetailListResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedEcrImageDetailListResult; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/EcrImageDetailProperties.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/EcrImageDetailProperties.java new file mode 100644 index 000000000000..1e1b4a6e2cab --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/EcrImageDetailProperties.java @@ -0,0 +1,311 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.Map; + +/** + * Definition of EcrImageDetail. + */ +@Fluent +public final class EcrImageDetailProperties implements JsonSerializable { + /* + * AWS Properties + */ + private AwsEcrImageDetailProperties awsProperties; + + /* + * Public Cloud Connectors Resource ID + */ + private String publicCloudConnectorsResourceId; + + /* + * AWS Account ID + */ + private String awsAccountId; + + /* + * Amazon Resource Name (ARN) + */ + private String arn; + + /* + * Public Cloud Resource Name + */ + private String publicCloudResourceName; + + /* + * AWS Source Schema + */ + private String awsSourceSchema; + + /* + * AWS Region + */ + private String awsRegion; + + /* + * AWS Tags + */ + private Map awsTags; + + /* + * The status of the last operation. + */ + private ProvisioningState provisioningState; + + /** + * Creates an instance of EcrImageDetailProperties class. + */ + public EcrImageDetailProperties() { + } + + /** + * Get the awsProperties property: AWS Properties. + * + * @return the awsProperties value. + */ + public AwsEcrImageDetailProperties awsProperties() { + return this.awsProperties; + } + + /** + * Set the awsProperties property: AWS Properties. + * + * @param awsProperties the awsProperties value to set. + * @return the EcrImageDetailProperties object itself. + */ + public EcrImageDetailProperties withAwsProperties(AwsEcrImageDetailProperties awsProperties) { + this.awsProperties = awsProperties; + return this; + } + + /** + * Get the publicCloudConnectorsResourceId property: Public Cloud Connectors Resource ID. + * + * @return the publicCloudConnectorsResourceId value. + */ + public String publicCloudConnectorsResourceId() { + return this.publicCloudConnectorsResourceId; + } + + /** + * Set the publicCloudConnectorsResourceId property: Public Cloud Connectors Resource ID. + * + * @param publicCloudConnectorsResourceId the publicCloudConnectorsResourceId value to set. + * @return the EcrImageDetailProperties object itself. + */ + public EcrImageDetailProperties withPublicCloudConnectorsResourceId(String publicCloudConnectorsResourceId) { + this.publicCloudConnectorsResourceId = publicCloudConnectorsResourceId; + return this; + } + + /** + * Get the awsAccountId property: AWS Account ID. + * + * @return the awsAccountId value. + */ + public String awsAccountId() { + return this.awsAccountId; + } + + /** + * Set the awsAccountId property: AWS Account ID. + * + * @param awsAccountId the awsAccountId value to set. + * @return the EcrImageDetailProperties object itself. + */ + public EcrImageDetailProperties withAwsAccountId(String awsAccountId) { + this.awsAccountId = awsAccountId; + return this; + } + + /** + * Get the arn property: Amazon Resource Name (ARN). + * + * @return the arn value. + */ + public String arn() { + return this.arn; + } + + /** + * Set the arn property: Amazon Resource Name (ARN). + * + * @param arn the arn value to set. + * @return the EcrImageDetailProperties object itself. + */ + public EcrImageDetailProperties withArn(String arn) { + this.arn = arn; + return this; + } + + /** + * Get the publicCloudResourceName property: Public Cloud Resource Name. + * + * @return the publicCloudResourceName value. + */ + public String publicCloudResourceName() { + return this.publicCloudResourceName; + } + + /** + * Set the publicCloudResourceName property: Public Cloud Resource Name. + * + * @param publicCloudResourceName the publicCloudResourceName value to set. + * @return the EcrImageDetailProperties object itself. + */ + public EcrImageDetailProperties withPublicCloudResourceName(String publicCloudResourceName) { + this.publicCloudResourceName = publicCloudResourceName; + return this; + } + + /** + * Get the awsSourceSchema property: AWS Source Schema. + * + * @return the awsSourceSchema value. + */ + public String awsSourceSchema() { + return this.awsSourceSchema; + } + + /** + * Set the awsSourceSchema property: AWS Source Schema. + * + * @param awsSourceSchema the awsSourceSchema value to set. + * @return the EcrImageDetailProperties object itself. + */ + public EcrImageDetailProperties withAwsSourceSchema(String awsSourceSchema) { + this.awsSourceSchema = awsSourceSchema; + return this; + } + + /** + * Get the awsRegion property: AWS Region. + * + * @return the awsRegion value. + */ + public String awsRegion() { + return this.awsRegion; + } + + /** + * Set the awsRegion property: AWS Region. + * + * @param awsRegion the awsRegion value to set. + * @return the EcrImageDetailProperties object itself. + */ + public EcrImageDetailProperties withAwsRegion(String awsRegion) { + this.awsRegion = awsRegion; + return this; + } + + /** + * Get the awsTags property: AWS Tags. + * + * @return the awsTags value. + */ + public Map awsTags() { + return this.awsTags; + } + + /** + * Set the awsTags property: AWS Tags. + * + * @param awsTags the awsTags value to set. + * @return the EcrImageDetailProperties object itself. + */ + public EcrImageDetailProperties withAwsTags(Map awsTags) { + this.awsTags = awsTags; + return this; + } + + /** + * Get the provisioningState property: The status of the last operation. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (awsProperties() != null) { + awsProperties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("awsProperties", this.awsProperties); + jsonWriter.writeStringField("publicCloudConnectorsResourceId", this.publicCloudConnectorsResourceId); + jsonWriter.writeStringField("awsAccountId", this.awsAccountId); + jsonWriter.writeStringField("arn", this.arn); + jsonWriter.writeStringField("publicCloudResourceName", this.publicCloudResourceName); + jsonWriter.writeStringField("awsSourceSchema", this.awsSourceSchema); + jsonWriter.writeStringField("awsRegion", this.awsRegion); + jsonWriter.writeMapField("awsTags", this.awsTags, (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of EcrImageDetailProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of EcrImageDetailProperties if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IOException If an error occurs while reading the EcrImageDetailProperties. + */ + public static EcrImageDetailProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + EcrImageDetailProperties deserializedEcrImageDetailProperties = new EcrImageDetailProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("awsProperties".equals(fieldName)) { + deserializedEcrImageDetailProperties.awsProperties = AwsEcrImageDetailProperties.fromJson(reader); + } else if ("publicCloudConnectorsResourceId".equals(fieldName)) { + deserializedEcrImageDetailProperties.publicCloudConnectorsResourceId = reader.getString(); + } else if ("awsAccountId".equals(fieldName)) { + deserializedEcrImageDetailProperties.awsAccountId = reader.getString(); + } else if ("arn".equals(fieldName)) { + deserializedEcrImageDetailProperties.arn = reader.getString(); + } else if ("publicCloudResourceName".equals(fieldName)) { + deserializedEcrImageDetailProperties.publicCloudResourceName = reader.getString(); + } else if ("awsSourceSchema".equals(fieldName)) { + deserializedEcrImageDetailProperties.awsSourceSchema = reader.getString(); + } else if ("awsRegion".equals(fieldName)) { + deserializedEcrImageDetailProperties.awsRegion = reader.getString(); + } else if ("awsTags".equals(fieldName)) { + Map awsTags = reader.readMap(reader1 -> reader1.getString()); + deserializedEcrImageDetailProperties.awsTags = awsTags; + } else if ("provisioningState".equals(fieldName)) { + deserializedEcrImageDetailProperties.provisioningState + = ProvisioningState.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedEcrImageDetailProperties; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/EcrImageDetailTagsUpdate.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/EcrImageDetailTagsUpdate.java new file mode 100644 index 000000000000..f1f74deac2f8 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/EcrImageDetailTagsUpdate.java @@ -0,0 +1,95 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.Map; + +/** + * The type used for updating tags in EcrImageDetail resources. + */ +@Fluent +public final class EcrImageDetailTagsUpdate implements JsonSerializable { + /* + * Resource tags. + */ + private Map tags; + + /** + * Creates an instance of EcrImageDetailTagsUpdate class. + */ + public EcrImageDetailTagsUpdate() { + } + + /** + * Get the tags property: Resource tags. + * + * @return the tags value. + */ + public Map tags() { + return this.tags; + } + + /** + * Set the tags property: Resource tags. + * + * @param tags the tags value to set. + * @return the EcrImageDetailTagsUpdate object itself. + */ + public EcrImageDetailTagsUpdate withTags(Map tags) { + this.tags = tags; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeMapField("tags", this.tags, (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of EcrImageDetailTagsUpdate from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of EcrImageDetailTagsUpdate if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IOException If an error occurs while reading the EcrImageDetailTagsUpdate. + */ + public static EcrImageDetailTagsUpdate fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + EcrImageDetailTagsUpdate deserializedEcrImageDetailTagsUpdate = new EcrImageDetailTagsUpdate(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedEcrImageDetailTagsUpdate.tags = tags; + } else { + reader.skipChildren(); + } + } + + return deserializedEcrImageDetailTagsUpdate; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/EcrImageDetails.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/EcrImageDetails.java new file mode 100644 index 000000000000..8eec65b43fc1 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/EcrImageDetails.java @@ -0,0 +1,157 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** + * Resource collection API of EcrImageDetails. + */ +public interface EcrImageDetails { + /** + * List EcrImageDetail resources by subscription ID. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a EcrImageDetail list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable list(); + + /** + * List EcrImageDetail resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a EcrImageDetail list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable list(Context context); + + /** + * List EcrImageDetail resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a EcrImageDetail list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * List EcrImageDetail resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a EcrImageDetail list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Get a EcrImageDetail. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of EcrImageDetail. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a EcrImageDetail along with {@link Response}. + */ + Response getByResourceGroupWithResponse(String resourceGroupName, String name, Context context); + + /** + * Get a EcrImageDetail. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of EcrImageDetail. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a EcrImageDetail. + */ + EcrImageDetail getByResourceGroup(String resourceGroupName, String name); + + /** + * Delete a EcrImageDetail. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of EcrImageDetail. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByResourceGroup(String resourceGroupName, String name); + + /** + * Delete a EcrImageDetail. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of EcrImageDetail. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String name, Context context); + + /** + * Get a EcrImageDetail. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a EcrImageDetail along with {@link Response}. + */ + EcrImageDetail getById(String id); + + /** + * Get a EcrImageDetail. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a EcrImageDetail along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Delete a EcrImageDetail. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteById(String id); + + /** + * Delete a EcrImageDetail. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new EcrImageDetail resource. + * + * @param name resource name. + * @return the first stage of the new EcrImageDetail definition. + */ + EcrImageDetail.DefinitionStages.Blank define(String name); +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/EcrRepositories.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/EcrRepositories.java new file mode 100644 index 000000000000..641edfffa0db --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/EcrRepositories.java @@ -0,0 +1,157 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** + * Resource collection API of EcrRepositories. + */ +public interface EcrRepositories { + /** + * List EcrRepository resources by subscription ID. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a EcrRepository list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable list(); + + /** + * List EcrRepository resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a EcrRepository list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable list(Context context); + + /** + * List EcrRepository resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a EcrRepository list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * List EcrRepository resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a EcrRepository list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Get a EcrRepository. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of EcrRepository. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a EcrRepository along with {@link Response}. + */ + Response getByResourceGroupWithResponse(String resourceGroupName, String name, Context context); + + /** + * Get a EcrRepository. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of EcrRepository. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a EcrRepository. + */ + EcrRepository getByResourceGroup(String resourceGroupName, String name); + + /** + * Delete a EcrRepository. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of EcrRepository. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByResourceGroup(String resourceGroupName, String name); + + /** + * Delete a EcrRepository. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of EcrRepository. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String name, Context context); + + /** + * Get a EcrRepository. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a EcrRepository along with {@link Response}. + */ + EcrRepository getById(String id); + + /** + * Get a EcrRepository. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a EcrRepository along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Delete a EcrRepository. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteById(String id); + + /** + * Delete a EcrRepository. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new EcrRepository resource. + * + * @param name resource name. + * @return the first stage of the new EcrRepository definition. + */ + EcrRepository.DefinitionStages.Blank define(String name); +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/EcrRepository.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/EcrRepository.java new file mode 100644 index 000000000000..3df2be3596b5 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/EcrRepository.java @@ -0,0 +1,252 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.awsconnector.fluent.models.EcrRepositoryInner; +import java.util.Map; + +/** + * An immutable client-side representation of EcrRepository. + */ +public interface EcrRepository { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the location property: The geo-location where the resource lives. + * + * @return the location value. + */ + String location(); + + /** + * Gets the tags property: Resource tags. + * + * @return the tags value. + */ + Map tags(); + + /** + * Gets the properties property: The resource-specific properties for this resource. + * + * @return the properties value. + */ + EcrRepositoryProperties properties(); + + /** + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the region of the resource. + * + * @return the region of the resource. + */ + Region region(); + + /** + * Gets the name of the resource region. + * + * @return the name of the resource region. + */ + String regionName(); + + /** + * Gets the name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + + /** + * Gets the inner com.azure.resourcemanager.awsconnector.fluent.models.EcrRepositoryInner object. + * + * @return the inner object. + */ + EcrRepositoryInner innerModel(); + + /** + * The entirety of the EcrRepository definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithLocation, + DefinitionStages.WithResourceGroup, DefinitionStages.WithCreate { + } + + /** + * The EcrRepository definition stages. + */ + interface DefinitionStages { + /** + * The first stage of the EcrRepository definition. + */ + interface Blank extends WithLocation { + } + + /** + * The stage of the EcrRepository definition allowing to specify location. + */ + interface WithLocation { + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithResourceGroup withRegion(Region location); + + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithResourceGroup withRegion(String location); + } + + /** + * The stage of the EcrRepository definition allowing to specify parent resource. + */ + interface WithResourceGroup { + /** + * Specifies resourceGroupName. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @return the next definition stage. + */ + WithCreate withExistingResourceGroup(String resourceGroupName); + } + + /** + * The stage of the EcrRepository 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.WithProperties { + /** + * Executes the create request. + * + * @return the created resource. + */ + EcrRepository create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + EcrRepository create(Context context); + } + + /** + * The stage of the EcrRepository definition allowing to specify tags. + */ + interface WithTags { + /** + * Specifies the tags property: Resource tags.. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + WithCreate withTags(Map tags); + } + + /** + * The stage of the EcrRepository definition allowing to specify properties. + */ + interface WithProperties { + /** + * Specifies the properties property: The resource-specific properties for this resource.. + * + * @param properties The resource-specific properties for this resource. + * @return the next definition stage. + */ + WithCreate withProperties(EcrRepositoryProperties properties); + } + } + + /** + * Begins update for the EcrRepository resource. + * + * @return the stage of resource update. + */ + EcrRepository.Update update(); + + /** + * The template for EcrRepository update. + */ + interface Update extends UpdateStages.WithTags { + /** + * Executes the update request. + * + * @return the updated resource. + */ + EcrRepository apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + EcrRepository apply(Context context); + } + + /** + * The EcrRepository update stages. + */ + interface UpdateStages { + /** + * The stage of the EcrRepository update allowing to specify tags. + */ + interface WithTags { + /** + * Specifies the tags property: Resource tags.. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + Update withTags(Map tags); + } + } + + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + EcrRepository refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + EcrRepository refresh(Context context); +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/EcrRepositoryListResult.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/EcrRepositoryListResult.java new file mode 100644 index 000000000000..0c769aa594b6 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/EcrRepositoryListResult.java @@ -0,0 +1,134 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.awsconnector.fluent.models.EcrRepositoryInner; +import java.io.IOException; +import java.util.List; + +/** + * The response of a EcrRepository list operation. + */ +@Fluent +public final class EcrRepositoryListResult implements JsonSerializable { + /* + * The EcrRepository items on this page + */ + private List value; + + /* + * The link to the next page of items + */ + private String nextLink; + + /** + * Creates an instance of EcrRepositoryListResult class. + */ + public EcrRepositoryListResult() { + } + + /** + * Get the value property: The EcrRepository items on this page. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The EcrRepository items on this page. + * + * @param value the value value to set. + * @return the EcrRepositoryListResult object itself. + */ + public EcrRepositoryListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The link to the next page of items. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: The link to the next page of items. + * + * @param nextLink the nextLink value to set. + * @return the EcrRepositoryListResult object itself. + */ + public EcrRepositoryListResult withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property value in model EcrRepositoryListResult")); + } else { + value().forEach(e -> e.validate()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(EcrRepositoryListResult.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("nextLink", this.nextLink); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of EcrRepositoryListResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of EcrRepositoryListResult if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the EcrRepositoryListResult. + */ + public static EcrRepositoryListResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + EcrRepositoryListResult deserializedEcrRepositoryListResult = new EcrRepositoryListResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value = reader.readArray(reader1 -> EcrRepositoryInner.fromJson(reader1)); + deserializedEcrRepositoryListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedEcrRepositoryListResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedEcrRepositoryListResult; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/EcrRepositoryProperties.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/EcrRepositoryProperties.java new file mode 100644 index 000000000000..abb138952e6b --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/EcrRepositoryProperties.java @@ -0,0 +1,311 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.Map; + +/** + * Definition of EcrRepository. + */ +@Fluent +public final class EcrRepositoryProperties implements JsonSerializable { + /* + * AWS Properties + */ + private AwsEcrRepositoryProperties awsProperties; + + /* + * Public Cloud Connectors Resource ID + */ + private String publicCloudConnectorsResourceId; + + /* + * AWS Account ID + */ + private String awsAccountId; + + /* + * Amazon Resource Name (ARN) + */ + private String arn; + + /* + * Public Cloud Resource Name + */ + private String publicCloudResourceName; + + /* + * AWS Source Schema + */ + private String awsSourceSchema; + + /* + * AWS Region + */ + private String awsRegion; + + /* + * AWS Tags + */ + private Map awsTags; + + /* + * The status of the last operation. + */ + private ProvisioningState provisioningState; + + /** + * Creates an instance of EcrRepositoryProperties class. + */ + public EcrRepositoryProperties() { + } + + /** + * Get the awsProperties property: AWS Properties. + * + * @return the awsProperties value. + */ + public AwsEcrRepositoryProperties awsProperties() { + return this.awsProperties; + } + + /** + * Set the awsProperties property: AWS Properties. + * + * @param awsProperties the awsProperties value to set. + * @return the EcrRepositoryProperties object itself. + */ + public EcrRepositoryProperties withAwsProperties(AwsEcrRepositoryProperties awsProperties) { + this.awsProperties = awsProperties; + return this; + } + + /** + * Get the publicCloudConnectorsResourceId property: Public Cloud Connectors Resource ID. + * + * @return the publicCloudConnectorsResourceId value. + */ + public String publicCloudConnectorsResourceId() { + return this.publicCloudConnectorsResourceId; + } + + /** + * Set the publicCloudConnectorsResourceId property: Public Cloud Connectors Resource ID. + * + * @param publicCloudConnectorsResourceId the publicCloudConnectorsResourceId value to set. + * @return the EcrRepositoryProperties object itself. + */ + public EcrRepositoryProperties withPublicCloudConnectorsResourceId(String publicCloudConnectorsResourceId) { + this.publicCloudConnectorsResourceId = publicCloudConnectorsResourceId; + return this; + } + + /** + * Get the awsAccountId property: AWS Account ID. + * + * @return the awsAccountId value. + */ + public String awsAccountId() { + return this.awsAccountId; + } + + /** + * Set the awsAccountId property: AWS Account ID. + * + * @param awsAccountId the awsAccountId value to set. + * @return the EcrRepositoryProperties object itself. + */ + public EcrRepositoryProperties withAwsAccountId(String awsAccountId) { + this.awsAccountId = awsAccountId; + return this; + } + + /** + * Get the arn property: Amazon Resource Name (ARN). + * + * @return the arn value. + */ + public String arn() { + return this.arn; + } + + /** + * Set the arn property: Amazon Resource Name (ARN). + * + * @param arn the arn value to set. + * @return the EcrRepositoryProperties object itself. + */ + public EcrRepositoryProperties withArn(String arn) { + this.arn = arn; + return this; + } + + /** + * Get the publicCloudResourceName property: Public Cloud Resource Name. + * + * @return the publicCloudResourceName value. + */ + public String publicCloudResourceName() { + return this.publicCloudResourceName; + } + + /** + * Set the publicCloudResourceName property: Public Cloud Resource Name. + * + * @param publicCloudResourceName the publicCloudResourceName value to set. + * @return the EcrRepositoryProperties object itself. + */ + public EcrRepositoryProperties withPublicCloudResourceName(String publicCloudResourceName) { + this.publicCloudResourceName = publicCloudResourceName; + return this; + } + + /** + * Get the awsSourceSchema property: AWS Source Schema. + * + * @return the awsSourceSchema value. + */ + public String awsSourceSchema() { + return this.awsSourceSchema; + } + + /** + * Set the awsSourceSchema property: AWS Source Schema. + * + * @param awsSourceSchema the awsSourceSchema value to set. + * @return the EcrRepositoryProperties object itself. + */ + public EcrRepositoryProperties withAwsSourceSchema(String awsSourceSchema) { + this.awsSourceSchema = awsSourceSchema; + return this; + } + + /** + * Get the awsRegion property: AWS Region. + * + * @return the awsRegion value. + */ + public String awsRegion() { + return this.awsRegion; + } + + /** + * Set the awsRegion property: AWS Region. + * + * @param awsRegion the awsRegion value to set. + * @return the EcrRepositoryProperties object itself. + */ + public EcrRepositoryProperties withAwsRegion(String awsRegion) { + this.awsRegion = awsRegion; + return this; + } + + /** + * Get the awsTags property: AWS Tags. + * + * @return the awsTags value. + */ + public Map awsTags() { + return this.awsTags; + } + + /** + * Set the awsTags property: AWS Tags. + * + * @param awsTags the awsTags value to set. + * @return the EcrRepositoryProperties object itself. + */ + public EcrRepositoryProperties withAwsTags(Map awsTags) { + this.awsTags = awsTags; + return this; + } + + /** + * Get the provisioningState property: The status of the last operation. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (awsProperties() != null) { + awsProperties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("awsProperties", this.awsProperties); + jsonWriter.writeStringField("publicCloudConnectorsResourceId", this.publicCloudConnectorsResourceId); + jsonWriter.writeStringField("awsAccountId", this.awsAccountId); + jsonWriter.writeStringField("arn", this.arn); + jsonWriter.writeStringField("publicCloudResourceName", this.publicCloudResourceName); + jsonWriter.writeStringField("awsSourceSchema", this.awsSourceSchema); + jsonWriter.writeStringField("awsRegion", this.awsRegion); + jsonWriter.writeMapField("awsTags", this.awsTags, (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of EcrRepositoryProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of EcrRepositoryProperties if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the EcrRepositoryProperties. + */ + public static EcrRepositoryProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + EcrRepositoryProperties deserializedEcrRepositoryProperties = new EcrRepositoryProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("awsProperties".equals(fieldName)) { + deserializedEcrRepositoryProperties.awsProperties = AwsEcrRepositoryProperties.fromJson(reader); + } else if ("publicCloudConnectorsResourceId".equals(fieldName)) { + deserializedEcrRepositoryProperties.publicCloudConnectorsResourceId = reader.getString(); + } else if ("awsAccountId".equals(fieldName)) { + deserializedEcrRepositoryProperties.awsAccountId = reader.getString(); + } else if ("arn".equals(fieldName)) { + deserializedEcrRepositoryProperties.arn = reader.getString(); + } else if ("publicCloudResourceName".equals(fieldName)) { + deserializedEcrRepositoryProperties.publicCloudResourceName = reader.getString(); + } else if ("awsSourceSchema".equals(fieldName)) { + deserializedEcrRepositoryProperties.awsSourceSchema = reader.getString(); + } else if ("awsRegion".equals(fieldName)) { + deserializedEcrRepositoryProperties.awsRegion = reader.getString(); + } else if ("awsTags".equals(fieldName)) { + Map awsTags = reader.readMap(reader1 -> reader1.getString()); + deserializedEcrRepositoryProperties.awsTags = awsTags; + } else if ("provisioningState".equals(fieldName)) { + deserializedEcrRepositoryProperties.provisioningState + = ProvisioningState.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedEcrRepositoryProperties; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/EcrRepositoryTagsUpdate.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/EcrRepositoryTagsUpdate.java new file mode 100644 index 000000000000..45b964c82f96 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/EcrRepositoryTagsUpdate.java @@ -0,0 +1,95 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.Map; + +/** + * The type used for updating tags in EcrRepository resources. + */ +@Fluent +public final class EcrRepositoryTagsUpdate implements JsonSerializable { + /* + * Resource tags. + */ + private Map tags; + + /** + * Creates an instance of EcrRepositoryTagsUpdate class. + */ + public EcrRepositoryTagsUpdate() { + } + + /** + * Get the tags property: Resource tags. + * + * @return the tags value. + */ + public Map tags() { + return this.tags; + } + + /** + * Set the tags property: Resource tags. + * + * @param tags the tags value to set. + * @return the EcrRepositoryTagsUpdate object itself. + */ + public EcrRepositoryTagsUpdate withTags(Map tags) { + this.tags = tags; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeMapField("tags", this.tags, (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of EcrRepositoryTagsUpdate from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of EcrRepositoryTagsUpdate if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the EcrRepositoryTagsUpdate. + */ + public static EcrRepositoryTagsUpdate fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + EcrRepositoryTagsUpdate deserializedEcrRepositoryTagsUpdate = new EcrRepositoryTagsUpdate(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedEcrRepositoryTagsUpdate.tags = tags; + } else { + reader.skipChildren(); + } + } + + return deserializedEcrRepositoryTagsUpdate; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/EcsCluster.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/EcsCluster.java new file mode 100644 index 000000000000..079ede9d1b54 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/EcsCluster.java @@ -0,0 +1,252 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.awsconnector.fluent.models.EcsClusterInner; +import java.util.Map; + +/** + * An immutable client-side representation of EcsCluster. + */ +public interface EcsCluster { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the location property: The geo-location where the resource lives. + * + * @return the location value. + */ + String location(); + + /** + * Gets the tags property: Resource tags. + * + * @return the tags value. + */ + Map tags(); + + /** + * Gets the properties property: The resource-specific properties for this resource. + * + * @return the properties value. + */ + EcsClusterProperties properties(); + + /** + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the region of the resource. + * + * @return the region of the resource. + */ + Region region(); + + /** + * Gets the name of the resource region. + * + * @return the name of the resource region. + */ + String regionName(); + + /** + * Gets the name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + + /** + * Gets the inner com.azure.resourcemanager.awsconnector.fluent.models.EcsClusterInner object. + * + * @return the inner object. + */ + EcsClusterInner innerModel(); + + /** + * The entirety of the EcsCluster definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithLocation, + DefinitionStages.WithResourceGroup, DefinitionStages.WithCreate { + } + + /** + * The EcsCluster definition stages. + */ + interface DefinitionStages { + /** + * The first stage of the EcsCluster definition. + */ + interface Blank extends WithLocation { + } + + /** + * The stage of the EcsCluster definition allowing to specify location. + */ + interface WithLocation { + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithResourceGroup withRegion(Region location); + + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithResourceGroup withRegion(String location); + } + + /** + * The stage of the EcsCluster definition allowing to specify parent resource. + */ + interface WithResourceGroup { + /** + * Specifies resourceGroupName. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @return the next definition stage. + */ + WithCreate withExistingResourceGroup(String resourceGroupName); + } + + /** + * The stage of the EcsCluster 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.WithProperties { + /** + * Executes the create request. + * + * @return the created resource. + */ + EcsCluster create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + EcsCluster create(Context context); + } + + /** + * The stage of the EcsCluster definition allowing to specify tags. + */ + interface WithTags { + /** + * Specifies the tags property: Resource tags.. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + WithCreate withTags(Map tags); + } + + /** + * The stage of the EcsCluster definition allowing to specify properties. + */ + interface WithProperties { + /** + * Specifies the properties property: The resource-specific properties for this resource.. + * + * @param properties The resource-specific properties for this resource. + * @return the next definition stage. + */ + WithCreate withProperties(EcsClusterProperties properties); + } + } + + /** + * Begins update for the EcsCluster resource. + * + * @return the stage of resource update. + */ + EcsCluster.Update update(); + + /** + * The template for EcsCluster update. + */ + interface Update extends UpdateStages.WithTags { + /** + * Executes the update request. + * + * @return the updated resource. + */ + EcsCluster apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + EcsCluster apply(Context context); + } + + /** + * The EcsCluster update stages. + */ + interface UpdateStages { + /** + * The stage of the EcsCluster update allowing to specify tags. + */ + interface WithTags { + /** + * Specifies the tags property: Resource tags.. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + Update withTags(Map tags); + } + } + + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + EcsCluster refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + EcsCluster refresh(Context context); +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/EcsClusterListResult.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/EcsClusterListResult.java new file mode 100644 index 000000000000..dbc2cf958e7f --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/EcsClusterListResult.java @@ -0,0 +1,134 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.awsconnector.fluent.models.EcsClusterInner; +import java.io.IOException; +import java.util.List; + +/** + * The response of a EcsCluster list operation. + */ +@Fluent +public final class EcsClusterListResult implements JsonSerializable { + /* + * The EcsCluster items on this page + */ + private List value; + + /* + * The link to the next page of items + */ + private String nextLink; + + /** + * Creates an instance of EcsClusterListResult class. + */ + public EcsClusterListResult() { + } + + /** + * Get the value property: The EcsCluster items on this page. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The EcsCluster items on this page. + * + * @param value the value value to set. + * @return the EcsClusterListResult object itself. + */ + public EcsClusterListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The link to the next page of items. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: The link to the next page of items. + * + * @param nextLink the nextLink value to set. + * @return the EcsClusterListResult object itself. + */ + public EcsClusterListResult withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property value in model EcsClusterListResult")); + } else { + value().forEach(e -> e.validate()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(EcsClusterListResult.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("nextLink", this.nextLink); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of EcsClusterListResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of EcsClusterListResult if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the EcsClusterListResult. + */ + public static EcsClusterListResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + EcsClusterListResult deserializedEcsClusterListResult = new EcsClusterListResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value = reader.readArray(reader1 -> EcsClusterInner.fromJson(reader1)); + deserializedEcsClusterListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedEcsClusterListResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedEcsClusterListResult; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/EcsClusterProperties.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/EcsClusterProperties.java new file mode 100644 index 000000000000..228aba7a7dd5 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/EcsClusterProperties.java @@ -0,0 +1,311 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.Map; + +/** + * Definition of EcsCluster. + */ +@Fluent +public final class EcsClusterProperties implements JsonSerializable { + /* + * AWS Properties + */ + private AwsEcsClusterProperties awsProperties; + + /* + * Public Cloud Connectors Resource ID + */ + private String publicCloudConnectorsResourceId; + + /* + * AWS Account ID + */ + private String awsAccountId; + + /* + * Amazon Resource Name (ARN) + */ + private String arn; + + /* + * Public Cloud Resource Name + */ + private String publicCloudResourceName; + + /* + * AWS Source Schema + */ + private String awsSourceSchema; + + /* + * AWS Region + */ + private String awsRegion; + + /* + * AWS Tags + */ + private Map awsTags; + + /* + * The status of the last operation. + */ + private ProvisioningState provisioningState; + + /** + * Creates an instance of EcsClusterProperties class. + */ + public EcsClusterProperties() { + } + + /** + * Get the awsProperties property: AWS Properties. + * + * @return the awsProperties value. + */ + public AwsEcsClusterProperties awsProperties() { + return this.awsProperties; + } + + /** + * Set the awsProperties property: AWS Properties. + * + * @param awsProperties the awsProperties value to set. + * @return the EcsClusterProperties object itself. + */ + public EcsClusterProperties withAwsProperties(AwsEcsClusterProperties awsProperties) { + this.awsProperties = awsProperties; + return this; + } + + /** + * Get the publicCloudConnectorsResourceId property: Public Cloud Connectors Resource ID. + * + * @return the publicCloudConnectorsResourceId value. + */ + public String publicCloudConnectorsResourceId() { + return this.publicCloudConnectorsResourceId; + } + + /** + * Set the publicCloudConnectorsResourceId property: Public Cloud Connectors Resource ID. + * + * @param publicCloudConnectorsResourceId the publicCloudConnectorsResourceId value to set. + * @return the EcsClusterProperties object itself. + */ + public EcsClusterProperties withPublicCloudConnectorsResourceId(String publicCloudConnectorsResourceId) { + this.publicCloudConnectorsResourceId = publicCloudConnectorsResourceId; + return this; + } + + /** + * Get the awsAccountId property: AWS Account ID. + * + * @return the awsAccountId value. + */ + public String awsAccountId() { + return this.awsAccountId; + } + + /** + * Set the awsAccountId property: AWS Account ID. + * + * @param awsAccountId the awsAccountId value to set. + * @return the EcsClusterProperties object itself. + */ + public EcsClusterProperties withAwsAccountId(String awsAccountId) { + this.awsAccountId = awsAccountId; + return this; + } + + /** + * Get the arn property: Amazon Resource Name (ARN). + * + * @return the arn value. + */ + public String arn() { + return this.arn; + } + + /** + * Set the arn property: Amazon Resource Name (ARN). + * + * @param arn the arn value to set. + * @return the EcsClusterProperties object itself. + */ + public EcsClusterProperties withArn(String arn) { + this.arn = arn; + return this; + } + + /** + * Get the publicCloudResourceName property: Public Cloud Resource Name. + * + * @return the publicCloudResourceName value. + */ + public String publicCloudResourceName() { + return this.publicCloudResourceName; + } + + /** + * Set the publicCloudResourceName property: Public Cloud Resource Name. + * + * @param publicCloudResourceName the publicCloudResourceName value to set. + * @return the EcsClusterProperties object itself. + */ + public EcsClusterProperties withPublicCloudResourceName(String publicCloudResourceName) { + this.publicCloudResourceName = publicCloudResourceName; + return this; + } + + /** + * Get the awsSourceSchema property: AWS Source Schema. + * + * @return the awsSourceSchema value. + */ + public String awsSourceSchema() { + return this.awsSourceSchema; + } + + /** + * Set the awsSourceSchema property: AWS Source Schema. + * + * @param awsSourceSchema the awsSourceSchema value to set. + * @return the EcsClusterProperties object itself. + */ + public EcsClusterProperties withAwsSourceSchema(String awsSourceSchema) { + this.awsSourceSchema = awsSourceSchema; + return this; + } + + /** + * Get the awsRegion property: AWS Region. + * + * @return the awsRegion value. + */ + public String awsRegion() { + return this.awsRegion; + } + + /** + * Set the awsRegion property: AWS Region. + * + * @param awsRegion the awsRegion value to set. + * @return the EcsClusterProperties object itself. + */ + public EcsClusterProperties withAwsRegion(String awsRegion) { + this.awsRegion = awsRegion; + return this; + } + + /** + * Get the awsTags property: AWS Tags. + * + * @return the awsTags value. + */ + public Map awsTags() { + return this.awsTags; + } + + /** + * Set the awsTags property: AWS Tags. + * + * @param awsTags the awsTags value to set. + * @return the EcsClusterProperties object itself. + */ + public EcsClusterProperties withAwsTags(Map awsTags) { + this.awsTags = awsTags; + return this; + } + + /** + * Get the provisioningState property: The status of the last operation. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (awsProperties() != null) { + awsProperties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("awsProperties", this.awsProperties); + jsonWriter.writeStringField("publicCloudConnectorsResourceId", this.publicCloudConnectorsResourceId); + jsonWriter.writeStringField("awsAccountId", this.awsAccountId); + jsonWriter.writeStringField("arn", this.arn); + jsonWriter.writeStringField("publicCloudResourceName", this.publicCloudResourceName); + jsonWriter.writeStringField("awsSourceSchema", this.awsSourceSchema); + jsonWriter.writeStringField("awsRegion", this.awsRegion); + jsonWriter.writeMapField("awsTags", this.awsTags, (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of EcsClusterProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of EcsClusterProperties if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the EcsClusterProperties. + */ + public static EcsClusterProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + EcsClusterProperties deserializedEcsClusterProperties = new EcsClusterProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("awsProperties".equals(fieldName)) { + deserializedEcsClusterProperties.awsProperties = AwsEcsClusterProperties.fromJson(reader); + } else if ("publicCloudConnectorsResourceId".equals(fieldName)) { + deserializedEcsClusterProperties.publicCloudConnectorsResourceId = reader.getString(); + } else if ("awsAccountId".equals(fieldName)) { + deserializedEcsClusterProperties.awsAccountId = reader.getString(); + } else if ("arn".equals(fieldName)) { + deserializedEcsClusterProperties.arn = reader.getString(); + } else if ("publicCloudResourceName".equals(fieldName)) { + deserializedEcsClusterProperties.publicCloudResourceName = reader.getString(); + } else if ("awsSourceSchema".equals(fieldName)) { + deserializedEcsClusterProperties.awsSourceSchema = reader.getString(); + } else if ("awsRegion".equals(fieldName)) { + deserializedEcsClusterProperties.awsRegion = reader.getString(); + } else if ("awsTags".equals(fieldName)) { + Map awsTags = reader.readMap(reader1 -> reader1.getString()); + deserializedEcsClusterProperties.awsTags = awsTags; + } else if ("provisioningState".equals(fieldName)) { + deserializedEcsClusterProperties.provisioningState + = ProvisioningState.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedEcsClusterProperties; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/EcsClusterTagsUpdate.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/EcsClusterTagsUpdate.java new file mode 100644 index 000000000000..88781fc2c149 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/EcsClusterTagsUpdate.java @@ -0,0 +1,95 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.Map; + +/** + * The type used for updating tags in EcsCluster resources. + */ +@Fluent +public final class EcsClusterTagsUpdate implements JsonSerializable { + /* + * Resource tags. + */ + private Map tags; + + /** + * Creates an instance of EcsClusterTagsUpdate class. + */ + public EcsClusterTagsUpdate() { + } + + /** + * Get the tags property: Resource tags. + * + * @return the tags value. + */ + public Map tags() { + return this.tags; + } + + /** + * Set the tags property: Resource tags. + * + * @param tags the tags value to set. + * @return the EcsClusterTagsUpdate object itself. + */ + public EcsClusterTagsUpdate withTags(Map tags) { + this.tags = tags; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeMapField("tags", this.tags, (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of EcsClusterTagsUpdate from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of EcsClusterTagsUpdate if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the EcsClusterTagsUpdate. + */ + public static EcsClusterTagsUpdate fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + EcsClusterTagsUpdate deserializedEcsClusterTagsUpdate = new EcsClusterTagsUpdate(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedEcsClusterTagsUpdate.tags = tags; + } else { + reader.skipChildren(); + } + } + + return deserializedEcsClusterTagsUpdate; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/EcsClusters.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/EcsClusters.java new file mode 100644 index 000000000000..4e00a37bda65 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/EcsClusters.java @@ -0,0 +1,157 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** + * Resource collection API of EcsClusters. + */ +public interface EcsClusters { + /** + * List EcsCluster resources by subscription ID. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a EcsCluster list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable list(); + + /** + * List EcsCluster resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a EcsCluster list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable list(Context context); + + /** + * List EcsCluster resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a EcsCluster list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * List EcsCluster resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a EcsCluster list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Get a EcsCluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of EcsCluster. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a EcsCluster along with {@link Response}. + */ + Response getByResourceGroupWithResponse(String resourceGroupName, String name, Context context); + + /** + * Get a EcsCluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of EcsCluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a EcsCluster. + */ + EcsCluster getByResourceGroup(String resourceGroupName, String name); + + /** + * Delete a EcsCluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of EcsCluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByResourceGroup(String resourceGroupName, String name); + + /** + * Delete a EcsCluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of EcsCluster. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String name, Context context); + + /** + * Get a EcsCluster. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a EcsCluster along with {@link Response}. + */ + EcsCluster getById(String id); + + /** + * Get a EcsCluster. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a EcsCluster along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Delete a EcsCluster. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteById(String id); + + /** + * Delete a EcsCluster. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new EcsCluster resource. + * + * @param name resource name. + * @return the first stage of the new EcsCluster definition. + */ + EcsCluster.DefinitionStages.Blank define(String name); +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/EcsService.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/EcsService.java new file mode 100644 index 000000000000..bf2b37f0b880 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/EcsService.java @@ -0,0 +1,252 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.awsconnector.fluent.models.EcsServiceInner; +import java.util.Map; + +/** + * An immutable client-side representation of EcsService. + */ +public interface EcsService { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the location property: The geo-location where the resource lives. + * + * @return the location value. + */ + String location(); + + /** + * Gets the tags property: Resource tags. + * + * @return the tags value. + */ + Map tags(); + + /** + * Gets the properties property: The resource-specific properties for this resource. + * + * @return the properties value. + */ + EcsServiceProperties properties(); + + /** + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the region of the resource. + * + * @return the region of the resource. + */ + Region region(); + + /** + * Gets the name of the resource region. + * + * @return the name of the resource region. + */ + String regionName(); + + /** + * Gets the name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + + /** + * Gets the inner com.azure.resourcemanager.awsconnector.fluent.models.EcsServiceInner object. + * + * @return the inner object. + */ + EcsServiceInner innerModel(); + + /** + * The entirety of the EcsService definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithLocation, + DefinitionStages.WithResourceGroup, DefinitionStages.WithCreate { + } + + /** + * The EcsService definition stages. + */ + interface DefinitionStages { + /** + * The first stage of the EcsService definition. + */ + interface Blank extends WithLocation { + } + + /** + * The stage of the EcsService definition allowing to specify location. + */ + interface WithLocation { + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithResourceGroup withRegion(Region location); + + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithResourceGroup withRegion(String location); + } + + /** + * The stage of the EcsService definition allowing to specify parent resource. + */ + interface WithResourceGroup { + /** + * Specifies resourceGroupName. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @return the next definition stage. + */ + WithCreate withExistingResourceGroup(String resourceGroupName); + } + + /** + * The stage of the EcsService 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.WithProperties { + /** + * Executes the create request. + * + * @return the created resource. + */ + EcsService create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + EcsService create(Context context); + } + + /** + * The stage of the EcsService definition allowing to specify tags. + */ + interface WithTags { + /** + * Specifies the tags property: Resource tags.. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + WithCreate withTags(Map tags); + } + + /** + * The stage of the EcsService definition allowing to specify properties. + */ + interface WithProperties { + /** + * Specifies the properties property: The resource-specific properties for this resource.. + * + * @param properties The resource-specific properties for this resource. + * @return the next definition stage. + */ + WithCreate withProperties(EcsServiceProperties properties); + } + } + + /** + * Begins update for the EcsService resource. + * + * @return the stage of resource update. + */ + EcsService.Update update(); + + /** + * The template for EcsService update. + */ + interface Update extends UpdateStages.WithTags { + /** + * Executes the update request. + * + * @return the updated resource. + */ + EcsService apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + EcsService apply(Context context); + } + + /** + * The EcsService update stages. + */ + interface UpdateStages { + /** + * The stage of the EcsService update allowing to specify tags. + */ + interface WithTags { + /** + * Specifies the tags property: Resource tags.. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + Update withTags(Map tags); + } + } + + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + EcsService refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + EcsService refresh(Context context); +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/EcsServiceListResult.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/EcsServiceListResult.java new file mode 100644 index 000000000000..bdf997153efa --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/EcsServiceListResult.java @@ -0,0 +1,134 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.awsconnector.fluent.models.EcsServiceInner; +import java.io.IOException; +import java.util.List; + +/** + * The response of a EcsService list operation. + */ +@Fluent +public final class EcsServiceListResult implements JsonSerializable { + /* + * The EcsService items on this page + */ + private List value; + + /* + * The link to the next page of items + */ + private String nextLink; + + /** + * Creates an instance of EcsServiceListResult class. + */ + public EcsServiceListResult() { + } + + /** + * Get the value property: The EcsService items on this page. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The EcsService items on this page. + * + * @param value the value value to set. + * @return the EcsServiceListResult object itself. + */ + public EcsServiceListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The link to the next page of items. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: The link to the next page of items. + * + * @param nextLink the nextLink value to set. + * @return the EcsServiceListResult object itself. + */ + public EcsServiceListResult withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property value in model EcsServiceListResult")); + } else { + value().forEach(e -> e.validate()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(EcsServiceListResult.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("nextLink", this.nextLink); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of EcsServiceListResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of EcsServiceListResult if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the EcsServiceListResult. + */ + public static EcsServiceListResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + EcsServiceListResult deserializedEcsServiceListResult = new EcsServiceListResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value = reader.readArray(reader1 -> EcsServiceInner.fromJson(reader1)); + deserializedEcsServiceListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedEcsServiceListResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedEcsServiceListResult; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/EcsServiceProperties.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/EcsServiceProperties.java new file mode 100644 index 000000000000..3bd527fadbef --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/EcsServiceProperties.java @@ -0,0 +1,311 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.Map; + +/** + * Definition of EcsService. + */ +@Fluent +public final class EcsServiceProperties implements JsonSerializable { + /* + * AWS Properties + */ + private AwsEcsServiceProperties awsProperties; + + /* + * Public Cloud Connectors Resource ID + */ + private String publicCloudConnectorsResourceId; + + /* + * AWS Account ID + */ + private String awsAccountId; + + /* + * Amazon Resource Name (ARN) + */ + private String arn; + + /* + * Public Cloud Resource Name + */ + private String publicCloudResourceName; + + /* + * AWS Source Schema + */ + private String awsSourceSchema; + + /* + * AWS Region + */ + private String awsRegion; + + /* + * AWS Tags + */ + private Map awsTags; + + /* + * The status of the last operation. + */ + private ProvisioningState provisioningState; + + /** + * Creates an instance of EcsServiceProperties class. + */ + public EcsServiceProperties() { + } + + /** + * Get the awsProperties property: AWS Properties. + * + * @return the awsProperties value. + */ + public AwsEcsServiceProperties awsProperties() { + return this.awsProperties; + } + + /** + * Set the awsProperties property: AWS Properties. + * + * @param awsProperties the awsProperties value to set. + * @return the EcsServiceProperties object itself. + */ + public EcsServiceProperties withAwsProperties(AwsEcsServiceProperties awsProperties) { + this.awsProperties = awsProperties; + return this; + } + + /** + * Get the publicCloudConnectorsResourceId property: Public Cloud Connectors Resource ID. + * + * @return the publicCloudConnectorsResourceId value. + */ + public String publicCloudConnectorsResourceId() { + return this.publicCloudConnectorsResourceId; + } + + /** + * Set the publicCloudConnectorsResourceId property: Public Cloud Connectors Resource ID. + * + * @param publicCloudConnectorsResourceId the publicCloudConnectorsResourceId value to set. + * @return the EcsServiceProperties object itself. + */ + public EcsServiceProperties withPublicCloudConnectorsResourceId(String publicCloudConnectorsResourceId) { + this.publicCloudConnectorsResourceId = publicCloudConnectorsResourceId; + return this; + } + + /** + * Get the awsAccountId property: AWS Account ID. + * + * @return the awsAccountId value. + */ + public String awsAccountId() { + return this.awsAccountId; + } + + /** + * Set the awsAccountId property: AWS Account ID. + * + * @param awsAccountId the awsAccountId value to set. + * @return the EcsServiceProperties object itself. + */ + public EcsServiceProperties withAwsAccountId(String awsAccountId) { + this.awsAccountId = awsAccountId; + return this; + } + + /** + * Get the arn property: Amazon Resource Name (ARN). + * + * @return the arn value. + */ + public String arn() { + return this.arn; + } + + /** + * Set the arn property: Amazon Resource Name (ARN). + * + * @param arn the arn value to set. + * @return the EcsServiceProperties object itself. + */ + public EcsServiceProperties withArn(String arn) { + this.arn = arn; + return this; + } + + /** + * Get the publicCloudResourceName property: Public Cloud Resource Name. + * + * @return the publicCloudResourceName value. + */ + public String publicCloudResourceName() { + return this.publicCloudResourceName; + } + + /** + * Set the publicCloudResourceName property: Public Cloud Resource Name. + * + * @param publicCloudResourceName the publicCloudResourceName value to set. + * @return the EcsServiceProperties object itself. + */ + public EcsServiceProperties withPublicCloudResourceName(String publicCloudResourceName) { + this.publicCloudResourceName = publicCloudResourceName; + return this; + } + + /** + * Get the awsSourceSchema property: AWS Source Schema. + * + * @return the awsSourceSchema value. + */ + public String awsSourceSchema() { + return this.awsSourceSchema; + } + + /** + * Set the awsSourceSchema property: AWS Source Schema. + * + * @param awsSourceSchema the awsSourceSchema value to set. + * @return the EcsServiceProperties object itself. + */ + public EcsServiceProperties withAwsSourceSchema(String awsSourceSchema) { + this.awsSourceSchema = awsSourceSchema; + return this; + } + + /** + * Get the awsRegion property: AWS Region. + * + * @return the awsRegion value. + */ + public String awsRegion() { + return this.awsRegion; + } + + /** + * Set the awsRegion property: AWS Region. + * + * @param awsRegion the awsRegion value to set. + * @return the EcsServiceProperties object itself. + */ + public EcsServiceProperties withAwsRegion(String awsRegion) { + this.awsRegion = awsRegion; + return this; + } + + /** + * Get the awsTags property: AWS Tags. + * + * @return the awsTags value. + */ + public Map awsTags() { + return this.awsTags; + } + + /** + * Set the awsTags property: AWS Tags. + * + * @param awsTags the awsTags value to set. + * @return the EcsServiceProperties object itself. + */ + public EcsServiceProperties withAwsTags(Map awsTags) { + this.awsTags = awsTags; + return this; + } + + /** + * Get the provisioningState property: The status of the last operation. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (awsProperties() != null) { + awsProperties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("awsProperties", this.awsProperties); + jsonWriter.writeStringField("publicCloudConnectorsResourceId", this.publicCloudConnectorsResourceId); + jsonWriter.writeStringField("awsAccountId", this.awsAccountId); + jsonWriter.writeStringField("arn", this.arn); + jsonWriter.writeStringField("publicCloudResourceName", this.publicCloudResourceName); + jsonWriter.writeStringField("awsSourceSchema", this.awsSourceSchema); + jsonWriter.writeStringField("awsRegion", this.awsRegion); + jsonWriter.writeMapField("awsTags", this.awsTags, (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of EcsServiceProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of EcsServiceProperties if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the EcsServiceProperties. + */ + public static EcsServiceProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + EcsServiceProperties deserializedEcsServiceProperties = new EcsServiceProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("awsProperties".equals(fieldName)) { + deserializedEcsServiceProperties.awsProperties = AwsEcsServiceProperties.fromJson(reader); + } else if ("publicCloudConnectorsResourceId".equals(fieldName)) { + deserializedEcsServiceProperties.publicCloudConnectorsResourceId = reader.getString(); + } else if ("awsAccountId".equals(fieldName)) { + deserializedEcsServiceProperties.awsAccountId = reader.getString(); + } else if ("arn".equals(fieldName)) { + deserializedEcsServiceProperties.arn = reader.getString(); + } else if ("publicCloudResourceName".equals(fieldName)) { + deserializedEcsServiceProperties.publicCloudResourceName = reader.getString(); + } else if ("awsSourceSchema".equals(fieldName)) { + deserializedEcsServiceProperties.awsSourceSchema = reader.getString(); + } else if ("awsRegion".equals(fieldName)) { + deserializedEcsServiceProperties.awsRegion = reader.getString(); + } else if ("awsTags".equals(fieldName)) { + Map awsTags = reader.readMap(reader1 -> reader1.getString()); + deserializedEcsServiceProperties.awsTags = awsTags; + } else if ("provisioningState".equals(fieldName)) { + deserializedEcsServiceProperties.provisioningState + = ProvisioningState.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedEcsServiceProperties; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/EcsServiceTagsUpdate.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/EcsServiceTagsUpdate.java new file mode 100644 index 000000000000..cb88bb91ee61 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/EcsServiceTagsUpdate.java @@ -0,0 +1,95 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.Map; + +/** + * The type used for updating tags in EcsService resources. + */ +@Fluent +public final class EcsServiceTagsUpdate implements JsonSerializable { + /* + * Resource tags. + */ + private Map tags; + + /** + * Creates an instance of EcsServiceTagsUpdate class. + */ + public EcsServiceTagsUpdate() { + } + + /** + * Get the tags property: Resource tags. + * + * @return the tags value. + */ + public Map tags() { + return this.tags; + } + + /** + * Set the tags property: Resource tags. + * + * @param tags the tags value to set. + * @return the EcsServiceTagsUpdate object itself. + */ + public EcsServiceTagsUpdate withTags(Map tags) { + this.tags = tags; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeMapField("tags", this.tags, (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of EcsServiceTagsUpdate from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of EcsServiceTagsUpdate if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the EcsServiceTagsUpdate. + */ + public static EcsServiceTagsUpdate fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + EcsServiceTagsUpdate deserializedEcsServiceTagsUpdate = new EcsServiceTagsUpdate(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedEcsServiceTagsUpdate.tags = tags; + } else { + reader.skipChildren(); + } + } + + return deserializedEcsServiceTagsUpdate; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/EcsServices.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/EcsServices.java new file mode 100644 index 000000000000..488c086c879a --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/EcsServices.java @@ -0,0 +1,157 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** + * Resource collection API of EcsServices. + */ +public interface EcsServices { + /** + * List EcsService resources by subscription ID. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a EcsService list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable list(); + + /** + * List EcsService resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a EcsService list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable list(Context context); + + /** + * List EcsService resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a EcsService list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * List EcsService resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a EcsService list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Get a EcsService. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of EcsService. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a EcsService along with {@link Response}. + */ + Response getByResourceGroupWithResponse(String resourceGroupName, String name, Context context); + + /** + * Get a EcsService. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of EcsService. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a EcsService. + */ + EcsService getByResourceGroup(String resourceGroupName, String name); + + /** + * Delete a EcsService. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of EcsService. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByResourceGroup(String resourceGroupName, String name); + + /** + * Delete a EcsService. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of EcsService. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String name, Context context); + + /** + * Get a EcsService. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a EcsService along with {@link Response}. + */ + EcsService getById(String id); + + /** + * Get a EcsService. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a EcsService along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Delete a EcsService. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteById(String id); + + /** + * Delete a EcsService. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new EcsService resource. + * + * @param name resource name. + * @return the first stage of the new EcsService definition. + */ + EcsService.DefinitionStages.Blank define(String name); +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/EcsTaskDefinition.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/EcsTaskDefinition.java new file mode 100644 index 000000000000..2625f719c720 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/EcsTaskDefinition.java @@ -0,0 +1,252 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.awsconnector.fluent.models.EcsTaskDefinitionInner; +import java.util.Map; + +/** + * An immutable client-side representation of EcsTaskDefinition. + */ +public interface EcsTaskDefinition { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the location property: The geo-location where the resource lives. + * + * @return the location value. + */ + String location(); + + /** + * Gets the tags property: Resource tags. + * + * @return the tags value. + */ + Map tags(); + + /** + * Gets the properties property: The resource-specific properties for this resource. + * + * @return the properties value. + */ + EcsTaskDefinitionProperties properties(); + + /** + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the region of the resource. + * + * @return the region of the resource. + */ + Region region(); + + /** + * Gets the name of the resource region. + * + * @return the name of the resource region. + */ + String regionName(); + + /** + * Gets the name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + + /** + * Gets the inner com.azure.resourcemanager.awsconnector.fluent.models.EcsTaskDefinitionInner object. + * + * @return the inner object. + */ + EcsTaskDefinitionInner innerModel(); + + /** + * The entirety of the EcsTaskDefinition definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithLocation, + DefinitionStages.WithResourceGroup, DefinitionStages.WithCreate { + } + + /** + * The EcsTaskDefinition definition stages. + */ + interface DefinitionStages { + /** + * The first stage of the EcsTaskDefinition definition. + */ + interface Blank extends WithLocation { + } + + /** + * The stage of the EcsTaskDefinition definition allowing to specify location. + */ + interface WithLocation { + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithResourceGroup withRegion(Region location); + + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithResourceGroup withRegion(String location); + } + + /** + * The stage of the EcsTaskDefinition definition allowing to specify parent resource. + */ + interface WithResourceGroup { + /** + * Specifies resourceGroupName. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @return the next definition stage. + */ + WithCreate withExistingResourceGroup(String resourceGroupName); + } + + /** + * The stage of the EcsTaskDefinition 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.WithProperties { + /** + * Executes the create request. + * + * @return the created resource. + */ + EcsTaskDefinition create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + EcsTaskDefinition create(Context context); + } + + /** + * The stage of the EcsTaskDefinition definition allowing to specify tags. + */ + interface WithTags { + /** + * Specifies the tags property: Resource tags.. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + WithCreate withTags(Map tags); + } + + /** + * The stage of the EcsTaskDefinition definition allowing to specify properties. + */ + interface WithProperties { + /** + * Specifies the properties property: The resource-specific properties for this resource.. + * + * @param properties The resource-specific properties for this resource. + * @return the next definition stage. + */ + WithCreate withProperties(EcsTaskDefinitionProperties properties); + } + } + + /** + * Begins update for the EcsTaskDefinition resource. + * + * @return the stage of resource update. + */ + EcsTaskDefinition.Update update(); + + /** + * The template for EcsTaskDefinition update. + */ + interface Update extends UpdateStages.WithTags { + /** + * Executes the update request. + * + * @return the updated resource. + */ + EcsTaskDefinition apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + EcsTaskDefinition apply(Context context); + } + + /** + * The EcsTaskDefinition update stages. + */ + interface UpdateStages { + /** + * The stage of the EcsTaskDefinition update allowing to specify tags. + */ + interface WithTags { + /** + * Specifies the tags property: Resource tags.. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + Update withTags(Map tags); + } + } + + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + EcsTaskDefinition refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + EcsTaskDefinition refresh(Context context); +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/EcsTaskDefinitionListResult.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/EcsTaskDefinitionListResult.java new file mode 100644 index 000000000000..d07f6d028bc6 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/EcsTaskDefinitionListResult.java @@ -0,0 +1,136 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.awsconnector.fluent.models.EcsTaskDefinitionInner; +import java.io.IOException; +import java.util.List; + +/** + * The response of a EcsTaskDefinition list operation. + */ +@Fluent +public final class EcsTaskDefinitionListResult implements JsonSerializable { + /* + * The EcsTaskDefinition items on this page + */ + private List value; + + /* + * The link to the next page of items + */ + private String nextLink; + + /** + * Creates an instance of EcsTaskDefinitionListResult class. + */ + public EcsTaskDefinitionListResult() { + } + + /** + * Get the value property: The EcsTaskDefinition items on this page. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The EcsTaskDefinition items on this page. + * + * @param value the value value to set. + * @return the EcsTaskDefinitionListResult object itself. + */ + public EcsTaskDefinitionListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The link to the next page of items. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: The link to the next page of items. + * + * @param nextLink the nextLink value to set. + * @return the EcsTaskDefinitionListResult object itself. + */ + public EcsTaskDefinitionListResult withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property value in model EcsTaskDefinitionListResult")); + } else { + value().forEach(e -> e.validate()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(EcsTaskDefinitionListResult.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("nextLink", this.nextLink); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of EcsTaskDefinitionListResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of EcsTaskDefinitionListResult if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the EcsTaskDefinitionListResult. + */ + public static EcsTaskDefinitionListResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + EcsTaskDefinitionListResult deserializedEcsTaskDefinitionListResult = new EcsTaskDefinitionListResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> EcsTaskDefinitionInner.fromJson(reader1)); + deserializedEcsTaskDefinitionListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedEcsTaskDefinitionListResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedEcsTaskDefinitionListResult; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/EcsTaskDefinitionProperties.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/EcsTaskDefinitionProperties.java new file mode 100644 index 000000000000..39261a85c6c9 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/EcsTaskDefinitionProperties.java @@ -0,0 +1,312 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.Map; + +/** + * Definition of EcsTaskDefinition. + */ +@Fluent +public final class EcsTaskDefinitionProperties implements JsonSerializable { + /* + * AWS Properties + */ + private AwsEcsTaskDefinitionProperties awsProperties; + + /* + * Public Cloud Connectors Resource ID + */ + private String publicCloudConnectorsResourceId; + + /* + * AWS Account ID + */ + private String awsAccountId; + + /* + * Amazon Resource Name (ARN) + */ + private String arn; + + /* + * Public Cloud Resource Name + */ + private String publicCloudResourceName; + + /* + * AWS Source Schema + */ + private String awsSourceSchema; + + /* + * AWS Region + */ + private String awsRegion; + + /* + * AWS Tags + */ + private Map awsTags; + + /* + * The status of the last operation. + */ + private ProvisioningState provisioningState; + + /** + * Creates an instance of EcsTaskDefinitionProperties class. + */ + public EcsTaskDefinitionProperties() { + } + + /** + * Get the awsProperties property: AWS Properties. + * + * @return the awsProperties value. + */ + public AwsEcsTaskDefinitionProperties awsProperties() { + return this.awsProperties; + } + + /** + * Set the awsProperties property: AWS Properties. + * + * @param awsProperties the awsProperties value to set. + * @return the EcsTaskDefinitionProperties object itself. + */ + public EcsTaskDefinitionProperties withAwsProperties(AwsEcsTaskDefinitionProperties awsProperties) { + this.awsProperties = awsProperties; + return this; + } + + /** + * Get the publicCloudConnectorsResourceId property: Public Cloud Connectors Resource ID. + * + * @return the publicCloudConnectorsResourceId value. + */ + public String publicCloudConnectorsResourceId() { + return this.publicCloudConnectorsResourceId; + } + + /** + * Set the publicCloudConnectorsResourceId property: Public Cloud Connectors Resource ID. + * + * @param publicCloudConnectorsResourceId the publicCloudConnectorsResourceId value to set. + * @return the EcsTaskDefinitionProperties object itself. + */ + public EcsTaskDefinitionProperties withPublicCloudConnectorsResourceId(String publicCloudConnectorsResourceId) { + this.publicCloudConnectorsResourceId = publicCloudConnectorsResourceId; + return this; + } + + /** + * Get the awsAccountId property: AWS Account ID. + * + * @return the awsAccountId value. + */ + public String awsAccountId() { + return this.awsAccountId; + } + + /** + * Set the awsAccountId property: AWS Account ID. + * + * @param awsAccountId the awsAccountId value to set. + * @return the EcsTaskDefinitionProperties object itself. + */ + public EcsTaskDefinitionProperties withAwsAccountId(String awsAccountId) { + this.awsAccountId = awsAccountId; + return this; + } + + /** + * Get the arn property: Amazon Resource Name (ARN). + * + * @return the arn value. + */ + public String arn() { + return this.arn; + } + + /** + * Set the arn property: Amazon Resource Name (ARN). + * + * @param arn the arn value to set. + * @return the EcsTaskDefinitionProperties object itself. + */ + public EcsTaskDefinitionProperties withArn(String arn) { + this.arn = arn; + return this; + } + + /** + * Get the publicCloudResourceName property: Public Cloud Resource Name. + * + * @return the publicCloudResourceName value. + */ + public String publicCloudResourceName() { + return this.publicCloudResourceName; + } + + /** + * Set the publicCloudResourceName property: Public Cloud Resource Name. + * + * @param publicCloudResourceName the publicCloudResourceName value to set. + * @return the EcsTaskDefinitionProperties object itself. + */ + public EcsTaskDefinitionProperties withPublicCloudResourceName(String publicCloudResourceName) { + this.publicCloudResourceName = publicCloudResourceName; + return this; + } + + /** + * Get the awsSourceSchema property: AWS Source Schema. + * + * @return the awsSourceSchema value. + */ + public String awsSourceSchema() { + return this.awsSourceSchema; + } + + /** + * Set the awsSourceSchema property: AWS Source Schema. + * + * @param awsSourceSchema the awsSourceSchema value to set. + * @return the EcsTaskDefinitionProperties object itself. + */ + public EcsTaskDefinitionProperties withAwsSourceSchema(String awsSourceSchema) { + this.awsSourceSchema = awsSourceSchema; + return this; + } + + /** + * Get the awsRegion property: AWS Region. + * + * @return the awsRegion value. + */ + public String awsRegion() { + return this.awsRegion; + } + + /** + * Set the awsRegion property: AWS Region. + * + * @param awsRegion the awsRegion value to set. + * @return the EcsTaskDefinitionProperties object itself. + */ + public EcsTaskDefinitionProperties withAwsRegion(String awsRegion) { + this.awsRegion = awsRegion; + return this; + } + + /** + * Get the awsTags property: AWS Tags. + * + * @return the awsTags value. + */ + public Map awsTags() { + return this.awsTags; + } + + /** + * Set the awsTags property: AWS Tags. + * + * @param awsTags the awsTags value to set. + * @return the EcsTaskDefinitionProperties object itself. + */ + public EcsTaskDefinitionProperties withAwsTags(Map awsTags) { + this.awsTags = awsTags; + return this; + } + + /** + * Get the provisioningState property: The status of the last operation. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (awsProperties() != null) { + awsProperties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("awsProperties", this.awsProperties); + jsonWriter.writeStringField("publicCloudConnectorsResourceId", this.publicCloudConnectorsResourceId); + jsonWriter.writeStringField("awsAccountId", this.awsAccountId); + jsonWriter.writeStringField("arn", this.arn); + jsonWriter.writeStringField("publicCloudResourceName", this.publicCloudResourceName); + jsonWriter.writeStringField("awsSourceSchema", this.awsSourceSchema); + jsonWriter.writeStringField("awsRegion", this.awsRegion); + jsonWriter.writeMapField("awsTags", this.awsTags, (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of EcsTaskDefinitionProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of EcsTaskDefinitionProperties if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the EcsTaskDefinitionProperties. + */ + public static EcsTaskDefinitionProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + EcsTaskDefinitionProperties deserializedEcsTaskDefinitionProperties = new EcsTaskDefinitionProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("awsProperties".equals(fieldName)) { + deserializedEcsTaskDefinitionProperties.awsProperties + = AwsEcsTaskDefinitionProperties.fromJson(reader); + } else if ("publicCloudConnectorsResourceId".equals(fieldName)) { + deserializedEcsTaskDefinitionProperties.publicCloudConnectorsResourceId = reader.getString(); + } else if ("awsAccountId".equals(fieldName)) { + deserializedEcsTaskDefinitionProperties.awsAccountId = reader.getString(); + } else if ("arn".equals(fieldName)) { + deserializedEcsTaskDefinitionProperties.arn = reader.getString(); + } else if ("publicCloudResourceName".equals(fieldName)) { + deserializedEcsTaskDefinitionProperties.publicCloudResourceName = reader.getString(); + } else if ("awsSourceSchema".equals(fieldName)) { + deserializedEcsTaskDefinitionProperties.awsSourceSchema = reader.getString(); + } else if ("awsRegion".equals(fieldName)) { + deserializedEcsTaskDefinitionProperties.awsRegion = reader.getString(); + } else if ("awsTags".equals(fieldName)) { + Map awsTags = reader.readMap(reader1 -> reader1.getString()); + deserializedEcsTaskDefinitionProperties.awsTags = awsTags; + } else if ("provisioningState".equals(fieldName)) { + deserializedEcsTaskDefinitionProperties.provisioningState + = ProvisioningState.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedEcsTaskDefinitionProperties; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/EcsTaskDefinitionTagsUpdate.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/EcsTaskDefinitionTagsUpdate.java new file mode 100644 index 000000000000..db05674df746 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/EcsTaskDefinitionTagsUpdate.java @@ -0,0 +1,95 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.Map; + +/** + * The type used for updating tags in EcsTaskDefinition resources. + */ +@Fluent +public final class EcsTaskDefinitionTagsUpdate implements JsonSerializable { + /* + * Resource tags. + */ + private Map tags; + + /** + * Creates an instance of EcsTaskDefinitionTagsUpdate class. + */ + public EcsTaskDefinitionTagsUpdate() { + } + + /** + * Get the tags property: Resource tags. + * + * @return the tags value. + */ + public Map tags() { + return this.tags; + } + + /** + * Set the tags property: Resource tags. + * + * @param tags the tags value to set. + * @return the EcsTaskDefinitionTagsUpdate object itself. + */ + public EcsTaskDefinitionTagsUpdate withTags(Map tags) { + this.tags = tags; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeMapField("tags", this.tags, (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of EcsTaskDefinitionTagsUpdate from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of EcsTaskDefinitionTagsUpdate if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the EcsTaskDefinitionTagsUpdate. + */ + public static EcsTaskDefinitionTagsUpdate fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + EcsTaskDefinitionTagsUpdate deserializedEcsTaskDefinitionTagsUpdate = new EcsTaskDefinitionTagsUpdate(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedEcsTaskDefinitionTagsUpdate.tags = tags; + } else { + reader.skipChildren(); + } + } + + return deserializedEcsTaskDefinitionTagsUpdate; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/EcsTaskDefinitions.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/EcsTaskDefinitions.java new file mode 100644 index 000000000000..4f8708f4c672 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/EcsTaskDefinitions.java @@ -0,0 +1,157 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** + * Resource collection API of EcsTaskDefinitions. + */ +public interface EcsTaskDefinitions { + /** + * List EcsTaskDefinition resources by subscription ID. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a EcsTaskDefinition list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable list(); + + /** + * List EcsTaskDefinition resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a EcsTaskDefinition list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable list(Context context); + + /** + * List EcsTaskDefinition resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a EcsTaskDefinition list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * List EcsTaskDefinition resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a EcsTaskDefinition list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Get a EcsTaskDefinition. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of EcsTaskDefinition. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a EcsTaskDefinition along with {@link Response}. + */ + Response getByResourceGroupWithResponse(String resourceGroupName, String name, Context context); + + /** + * Get a EcsTaskDefinition. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of EcsTaskDefinition. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a EcsTaskDefinition. + */ + EcsTaskDefinition getByResourceGroup(String resourceGroupName, String name); + + /** + * Delete a EcsTaskDefinition. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of EcsTaskDefinition. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByResourceGroup(String resourceGroupName, String name); + + /** + * Delete a EcsTaskDefinition. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of EcsTaskDefinition. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String name, Context context); + + /** + * Get a EcsTaskDefinition. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a EcsTaskDefinition along with {@link Response}. + */ + EcsTaskDefinition getById(String id); + + /** + * Get a EcsTaskDefinition. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a EcsTaskDefinition along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Delete a EcsTaskDefinition. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteById(String id); + + /** + * Delete a EcsTaskDefinition. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new EcsTaskDefinition resource. + * + * @param name resource name. + * @return the first stage of the new EcsTaskDefinition definition. + */ + EcsTaskDefinition.DefinitionStages.Blank define(String name); +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/EfsFileSystem.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/EfsFileSystem.java new file mode 100644 index 000000000000..d8b17b9d59e2 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/EfsFileSystem.java @@ -0,0 +1,252 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.awsconnector.fluent.models.EfsFileSystemInner; +import java.util.Map; + +/** + * An immutable client-side representation of EfsFileSystem. + */ +public interface EfsFileSystem { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the location property: The geo-location where the resource lives. + * + * @return the location value. + */ + String location(); + + /** + * Gets the tags property: Resource tags. + * + * @return the tags value. + */ + Map tags(); + + /** + * Gets the properties property: The resource-specific properties for this resource. + * + * @return the properties value. + */ + EfsFileSystemProperties properties(); + + /** + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the region of the resource. + * + * @return the region of the resource. + */ + Region region(); + + /** + * Gets the name of the resource region. + * + * @return the name of the resource region. + */ + String regionName(); + + /** + * Gets the name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + + /** + * Gets the inner com.azure.resourcemanager.awsconnector.fluent.models.EfsFileSystemInner object. + * + * @return the inner object. + */ + EfsFileSystemInner innerModel(); + + /** + * The entirety of the EfsFileSystem definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithLocation, + DefinitionStages.WithResourceGroup, DefinitionStages.WithCreate { + } + + /** + * The EfsFileSystem definition stages. + */ + interface DefinitionStages { + /** + * The first stage of the EfsFileSystem definition. + */ + interface Blank extends WithLocation { + } + + /** + * The stage of the EfsFileSystem definition allowing to specify location. + */ + interface WithLocation { + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithResourceGroup withRegion(Region location); + + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithResourceGroup withRegion(String location); + } + + /** + * The stage of the EfsFileSystem definition allowing to specify parent resource. + */ + interface WithResourceGroup { + /** + * Specifies resourceGroupName. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @return the next definition stage. + */ + WithCreate withExistingResourceGroup(String resourceGroupName); + } + + /** + * The stage of the EfsFileSystem 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.WithProperties { + /** + * Executes the create request. + * + * @return the created resource. + */ + EfsFileSystem create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + EfsFileSystem create(Context context); + } + + /** + * The stage of the EfsFileSystem definition allowing to specify tags. + */ + interface WithTags { + /** + * Specifies the tags property: Resource tags.. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + WithCreate withTags(Map tags); + } + + /** + * The stage of the EfsFileSystem definition allowing to specify properties. + */ + interface WithProperties { + /** + * Specifies the properties property: The resource-specific properties for this resource.. + * + * @param properties The resource-specific properties for this resource. + * @return the next definition stage. + */ + WithCreate withProperties(EfsFileSystemProperties properties); + } + } + + /** + * Begins update for the EfsFileSystem resource. + * + * @return the stage of resource update. + */ + EfsFileSystem.Update update(); + + /** + * The template for EfsFileSystem update. + */ + interface Update extends UpdateStages.WithTags { + /** + * Executes the update request. + * + * @return the updated resource. + */ + EfsFileSystem apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + EfsFileSystem apply(Context context); + } + + /** + * The EfsFileSystem update stages. + */ + interface UpdateStages { + /** + * The stage of the EfsFileSystem update allowing to specify tags. + */ + interface WithTags { + /** + * Specifies the tags property: Resource tags.. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + Update withTags(Map tags); + } + } + + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + EfsFileSystem refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + EfsFileSystem refresh(Context context); +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/EfsFileSystemListResult.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/EfsFileSystemListResult.java new file mode 100644 index 000000000000..c0784e5479d2 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/EfsFileSystemListResult.java @@ -0,0 +1,134 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.awsconnector.fluent.models.EfsFileSystemInner; +import java.io.IOException; +import java.util.List; + +/** + * The response of a EfsFileSystem list operation. + */ +@Fluent +public final class EfsFileSystemListResult implements JsonSerializable { + /* + * The EfsFileSystem items on this page + */ + private List value; + + /* + * The link to the next page of items + */ + private String nextLink; + + /** + * Creates an instance of EfsFileSystemListResult class. + */ + public EfsFileSystemListResult() { + } + + /** + * Get the value property: The EfsFileSystem items on this page. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The EfsFileSystem items on this page. + * + * @param value the value value to set. + * @return the EfsFileSystemListResult object itself. + */ + public EfsFileSystemListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The link to the next page of items. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: The link to the next page of items. + * + * @param nextLink the nextLink value to set. + * @return the EfsFileSystemListResult object itself. + */ + public EfsFileSystemListResult withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property value in model EfsFileSystemListResult")); + } else { + value().forEach(e -> e.validate()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(EfsFileSystemListResult.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("nextLink", this.nextLink); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of EfsFileSystemListResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of EfsFileSystemListResult if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the EfsFileSystemListResult. + */ + public static EfsFileSystemListResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + EfsFileSystemListResult deserializedEfsFileSystemListResult = new EfsFileSystemListResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value = reader.readArray(reader1 -> EfsFileSystemInner.fromJson(reader1)); + deserializedEfsFileSystemListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedEfsFileSystemListResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedEfsFileSystemListResult; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/EfsFileSystemProperties.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/EfsFileSystemProperties.java new file mode 100644 index 000000000000..99fd2a57c544 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/EfsFileSystemProperties.java @@ -0,0 +1,311 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.Map; + +/** + * Definition of EfsFileSystem. + */ +@Fluent +public final class EfsFileSystemProperties implements JsonSerializable { + /* + * AWS Properties + */ + private AwsEfsFileSystemProperties awsProperties; + + /* + * Public Cloud Connectors Resource ID + */ + private String publicCloudConnectorsResourceId; + + /* + * AWS Account ID + */ + private String awsAccountId; + + /* + * Amazon Resource Name (ARN) + */ + private String arn; + + /* + * Public Cloud Resource Name + */ + private String publicCloudResourceName; + + /* + * AWS Source Schema + */ + private String awsSourceSchema; + + /* + * AWS Region + */ + private String awsRegion; + + /* + * AWS Tags + */ + private Map awsTags; + + /* + * The status of the last operation. + */ + private ProvisioningState provisioningState; + + /** + * Creates an instance of EfsFileSystemProperties class. + */ + public EfsFileSystemProperties() { + } + + /** + * Get the awsProperties property: AWS Properties. + * + * @return the awsProperties value. + */ + public AwsEfsFileSystemProperties awsProperties() { + return this.awsProperties; + } + + /** + * Set the awsProperties property: AWS Properties. + * + * @param awsProperties the awsProperties value to set. + * @return the EfsFileSystemProperties object itself. + */ + public EfsFileSystemProperties withAwsProperties(AwsEfsFileSystemProperties awsProperties) { + this.awsProperties = awsProperties; + return this; + } + + /** + * Get the publicCloudConnectorsResourceId property: Public Cloud Connectors Resource ID. + * + * @return the publicCloudConnectorsResourceId value. + */ + public String publicCloudConnectorsResourceId() { + return this.publicCloudConnectorsResourceId; + } + + /** + * Set the publicCloudConnectorsResourceId property: Public Cloud Connectors Resource ID. + * + * @param publicCloudConnectorsResourceId the publicCloudConnectorsResourceId value to set. + * @return the EfsFileSystemProperties object itself. + */ + public EfsFileSystemProperties withPublicCloudConnectorsResourceId(String publicCloudConnectorsResourceId) { + this.publicCloudConnectorsResourceId = publicCloudConnectorsResourceId; + return this; + } + + /** + * Get the awsAccountId property: AWS Account ID. + * + * @return the awsAccountId value. + */ + public String awsAccountId() { + return this.awsAccountId; + } + + /** + * Set the awsAccountId property: AWS Account ID. + * + * @param awsAccountId the awsAccountId value to set. + * @return the EfsFileSystemProperties object itself. + */ + public EfsFileSystemProperties withAwsAccountId(String awsAccountId) { + this.awsAccountId = awsAccountId; + return this; + } + + /** + * Get the arn property: Amazon Resource Name (ARN). + * + * @return the arn value. + */ + public String arn() { + return this.arn; + } + + /** + * Set the arn property: Amazon Resource Name (ARN). + * + * @param arn the arn value to set. + * @return the EfsFileSystemProperties object itself. + */ + public EfsFileSystemProperties withArn(String arn) { + this.arn = arn; + return this; + } + + /** + * Get the publicCloudResourceName property: Public Cloud Resource Name. + * + * @return the publicCloudResourceName value. + */ + public String publicCloudResourceName() { + return this.publicCloudResourceName; + } + + /** + * Set the publicCloudResourceName property: Public Cloud Resource Name. + * + * @param publicCloudResourceName the publicCloudResourceName value to set. + * @return the EfsFileSystemProperties object itself. + */ + public EfsFileSystemProperties withPublicCloudResourceName(String publicCloudResourceName) { + this.publicCloudResourceName = publicCloudResourceName; + return this; + } + + /** + * Get the awsSourceSchema property: AWS Source Schema. + * + * @return the awsSourceSchema value. + */ + public String awsSourceSchema() { + return this.awsSourceSchema; + } + + /** + * Set the awsSourceSchema property: AWS Source Schema. + * + * @param awsSourceSchema the awsSourceSchema value to set. + * @return the EfsFileSystemProperties object itself. + */ + public EfsFileSystemProperties withAwsSourceSchema(String awsSourceSchema) { + this.awsSourceSchema = awsSourceSchema; + return this; + } + + /** + * Get the awsRegion property: AWS Region. + * + * @return the awsRegion value. + */ + public String awsRegion() { + return this.awsRegion; + } + + /** + * Set the awsRegion property: AWS Region. + * + * @param awsRegion the awsRegion value to set. + * @return the EfsFileSystemProperties object itself. + */ + public EfsFileSystemProperties withAwsRegion(String awsRegion) { + this.awsRegion = awsRegion; + return this; + } + + /** + * Get the awsTags property: AWS Tags. + * + * @return the awsTags value. + */ + public Map awsTags() { + return this.awsTags; + } + + /** + * Set the awsTags property: AWS Tags. + * + * @param awsTags the awsTags value to set. + * @return the EfsFileSystemProperties object itself. + */ + public EfsFileSystemProperties withAwsTags(Map awsTags) { + this.awsTags = awsTags; + return this; + } + + /** + * Get the provisioningState property: The status of the last operation. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (awsProperties() != null) { + awsProperties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("awsProperties", this.awsProperties); + jsonWriter.writeStringField("publicCloudConnectorsResourceId", this.publicCloudConnectorsResourceId); + jsonWriter.writeStringField("awsAccountId", this.awsAccountId); + jsonWriter.writeStringField("arn", this.arn); + jsonWriter.writeStringField("publicCloudResourceName", this.publicCloudResourceName); + jsonWriter.writeStringField("awsSourceSchema", this.awsSourceSchema); + jsonWriter.writeStringField("awsRegion", this.awsRegion); + jsonWriter.writeMapField("awsTags", this.awsTags, (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of EfsFileSystemProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of EfsFileSystemProperties if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the EfsFileSystemProperties. + */ + public static EfsFileSystemProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + EfsFileSystemProperties deserializedEfsFileSystemProperties = new EfsFileSystemProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("awsProperties".equals(fieldName)) { + deserializedEfsFileSystemProperties.awsProperties = AwsEfsFileSystemProperties.fromJson(reader); + } else if ("publicCloudConnectorsResourceId".equals(fieldName)) { + deserializedEfsFileSystemProperties.publicCloudConnectorsResourceId = reader.getString(); + } else if ("awsAccountId".equals(fieldName)) { + deserializedEfsFileSystemProperties.awsAccountId = reader.getString(); + } else if ("arn".equals(fieldName)) { + deserializedEfsFileSystemProperties.arn = reader.getString(); + } else if ("publicCloudResourceName".equals(fieldName)) { + deserializedEfsFileSystemProperties.publicCloudResourceName = reader.getString(); + } else if ("awsSourceSchema".equals(fieldName)) { + deserializedEfsFileSystemProperties.awsSourceSchema = reader.getString(); + } else if ("awsRegion".equals(fieldName)) { + deserializedEfsFileSystemProperties.awsRegion = reader.getString(); + } else if ("awsTags".equals(fieldName)) { + Map awsTags = reader.readMap(reader1 -> reader1.getString()); + deserializedEfsFileSystemProperties.awsTags = awsTags; + } else if ("provisioningState".equals(fieldName)) { + deserializedEfsFileSystemProperties.provisioningState + = ProvisioningState.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedEfsFileSystemProperties; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/EfsFileSystemTagsUpdate.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/EfsFileSystemTagsUpdate.java new file mode 100644 index 000000000000..388057c6a6fb --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/EfsFileSystemTagsUpdate.java @@ -0,0 +1,95 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.Map; + +/** + * The type used for updating tags in EfsFileSystem resources. + */ +@Fluent +public final class EfsFileSystemTagsUpdate implements JsonSerializable { + /* + * Resource tags. + */ + private Map tags; + + /** + * Creates an instance of EfsFileSystemTagsUpdate class. + */ + public EfsFileSystemTagsUpdate() { + } + + /** + * Get the tags property: Resource tags. + * + * @return the tags value. + */ + public Map tags() { + return this.tags; + } + + /** + * Set the tags property: Resource tags. + * + * @param tags the tags value to set. + * @return the EfsFileSystemTagsUpdate object itself. + */ + public EfsFileSystemTagsUpdate withTags(Map tags) { + this.tags = tags; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeMapField("tags", this.tags, (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of EfsFileSystemTagsUpdate from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of EfsFileSystemTagsUpdate if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the EfsFileSystemTagsUpdate. + */ + public static EfsFileSystemTagsUpdate fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + EfsFileSystemTagsUpdate deserializedEfsFileSystemTagsUpdate = new EfsFileSystemTagsUpdate(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedEfsFileSystemTagsUpdate.tags = tags; + } else { + reader.skipChildren(); + } + } + + return deserializedEfsFileSystemTagsUpdate; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/EfsFileSystems.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/EfsFileSystems.java new file mode 100644 index 000000000000..76b87d90081e --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/EfsFileSystems.java @@ -0,0 +1,157 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** + * Resource collection API of EfsFileSystems. + */ +public interface EfsFileSystems { + /** + * List EfsFileSystem resources by subscription ID. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a EfsFileSystem list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable list(); + + /** + * List EfsFileSystem resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a EfsFileSystem list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable list(Context context); + + /** + * List EfsFileSystem resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a EfsFileSystem list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * List EfsFileSystem resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a EfsFileSystem list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Get a EfsFileSystem. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of EfsFileSystem. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a EfsFileSystem along with {@link Response}. + */ + Response getByResourceGroupWithResponse(String resourceGroupName, String name, Context context); + + /** + * Get a EfsFileSystem. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of EfsFileSystem. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a EfsFileSystem. + */ + EfsFileSystem getByResourceGroup(String resourceGroupName, String name); + + /** + * Delete a EfsFileSystem. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of EfsFileSystem. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByResourceGroup(String resourceGroupName, String name); + + /** + * Delete a EfsFileSystem. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of EfsFileSystem. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String name, Context context); + + /** + * Get a EfsFileSystem. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a EfsFileSystem along with {@link Response}. + */ + EfsFileSystem getById(String id); + + /** + * Get a EfsFileSystem. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a EfsFileSystem along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Delete a EfsFileSystem. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteById(String id); + + /** + * Delete a EfsFileSystem. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new EfsFileSystem resource. + * + * @param name resource name. + * @return the first stage of the new EfsFileSystem definition. + */ + EfsFileSystem.DefinitionStages.Blank define(String name); +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/EfsMountTarget.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/EfsMountTarget.java new file mode 100644 index 000000000000..22f5fe12ea22 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/EfsMountTarget.java @@ -0,0 +1,252 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.awsconnector.fluent.models.EfsMountTargetInner; +import java.util.Map; + +/** + * An immutable client-side representation of EfsMountTarget. + */ +public interface EfsMountTarget { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the location property: The geo-location where the resource lives. + * + * @return the location value. + */ + String location(); + + /** + * Gets the tags property: Resource tags. + * + * @return the tags value. + */ + Map tags(); + + /** + * Gets the properties property: The resource-specific properties for this resource. + * + * @return the properties value. + */ + EfsMountTargetProperties properties(); + + /** + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the region of the resource. + * + * @return the region of the resource. + */ + Region region(); + + /** + * Gets the name of the resource region. + * + * @return the name of the resource region. + */ + String regionName(); + + /** + * Gets the name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + + /** + * Gets the inner com.azure.resourcemanager.awsconnector.fluent.models.EfsMountTargetInner object. + * + * @return the inner object. + */ + EfsMountTargetInner innerModel(); + + /** + * The entirety of the EfsMountTarget definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithLocation, + DefinitionStages.WithResourceGroup, DefinitionStages.WithCreate { + } + + /** + * The EfsMountTarget definition stages. + */ + interface DefinitionStages { + /** + * The first stage of the EfsMountTarget definition. + */ + interface Blank extends WithLocation { + } + + /** + * The stage of the EfsMountTarget definition allowing to specify location. + */ + interface WithLocation { + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithResourceGroup withRegion(Region location); + + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithResourceGroup withRegion(String location); + } + + /** + * The stage of the EfsMountTarget definition allowing to specify parent resource. + */ + interface WithResourceGroup { + /** + * Specifies resourceGroupName. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @return the next definition stage. + */ + WithCreate withExistingResourceGroup(String resourceGroupName); + } + + /** + * The stage of the EfsMountTarget 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.WithProperties { + /** + * Executes the create request. + * + * @return the created resource. + */ + EfsMountTarget create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + EfsMountTarget create(Context context); + } + + /** + * The stage of the EfsMountTarget definition allowing to specify tags. + */ + interface WithTags { + /** + * Specifies the tags property: Resource tags.. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + WithCreate withTags(Map tags); + } + + /** + * The stage of the EfsMountTarget definition allowing to specify properties. + */ + interface WithProperties { + /** + * Specifies the properties property: The resource-specific properties for this resource.. + * + * @param properties The resource-specific properties for this resource. + * @return the next definition stage. + */ + WithCreate withProperties(EfsMountTargetProperties properties); + } + } + + /** + * Begins update for the EfsMountTarget resource. + * + * @return the stage of resource update. + */ + EfsMountTarget.Update update(); + + /** + * The template for EfsMountTarget update. + */ + interface Update extends UpdateStages.WithTags { + /** + * Executes the update request. + * + * @return the updated resource. + */ + EfsMountTarget apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + EfsMountTarget apply(Context context); + } + + /** + * The EfsMountTarget update stages. + */ + interface UpdateStages { + /** + * The stage of the EfsMountTarget update allowing to specify tags. + */ + interface WithTags { + /** + * Specifies the tags property: Resource tags.. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + Update withTags(Map tags); + } + } + + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + EfsMountTarget refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + EfsMountTarget refresh(Context context); +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/EfsMountTargetListResult.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/EfsMountTargetListResult.java new file mode 100644 index 000000000000..8764decadf99 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/EfsMountTargetListResult.java @@ -0,0 +1,135 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.awsconnector.fluent.models.EfsMountTargetInner; +import java.io.IOException; +import java.util.List; + +/** + * The response of a EfsMountTarget list operation. + */ +@Fluent +public final class EfsMountTargetListResult implements JsonSerializable { + /* + * The EfsMountTarget items on this page + */ + private List value; + + /* + * The link to the next page of items + */ + private String nextLink; + + /** + * Creates an instance of EfsMountTargetListResult class. + */ + public EfsMountTargetListResult() { + } + + /** + * Get the value property: The EfsMountTarget items on this page. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The EfsMountTarget items on this page. + * + * @param value the value value to set. + * @return the EfsMountTargetListResult object itself. + */ + public EfsMountTargetListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The link to the next page of items. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: The link to the next page of items. + * + * @param nextLink the nextLink value to set. + * @return the EfsMountTargetListResult object itself. + */ + public EfsMountTargetListResult withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property value in model EfsMountTargetListResult")); + } else { + value().forEach(e -> e.validate()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(EfsMountTargetListResult.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("nextLink", this.nextLink); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of EfsMountTargetListResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of EfsMountTargetListResult if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the EfsMountTargetListResult. + */ + public static EfsMountTargetListResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + EfsMountTargetListResult deserializedEfsMountTargetListResult = new EfsMountTargetListResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> EfsMountTargetInner.fromJson(reader1)); + deserializedEfsMountTargetListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedEfsMountTargetListResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedEfsMountTargetListResult; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/EfsMountTargetProperties.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/EfsMountTargetProperties.java new file mode 100644 index 000000000000..141fe89f68bd --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/EfsMountTargetProperties.java @@ -0,0 +1,311 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.Map; + +/** + * Definition of EfsMountTarget. + */ +@Fluent +public final class EfsMountTargetProperties implements JsonSerializable { + /* + * AWS Properties + */ + private AwsEfsMountTargetProperties awsProperties; + + /* + * Public Cloud Connectors Resource ID + */ + private String publicCloudConnectorsResourceId; + + /* + * AWS Account ID + */ + private String awsAccountId; + + /* + * Amazon Resource Name (ARN) + */ + private String arn; + + /* + * Public Cloud Resource Name + */ + private String publicCloudResourceName; + + /* + * AWS Source Schema + */ + private String awsSourceSchema; + + /* + * AWS Region + */ + private String awsRegion; + + /* + * AWS Tags + */ + private Map awsTags; + + /* + * The status of the last operation. + */ + private ProvisioningState provisioningState; + + /** + * Creates an instance of EfsMountTargetProperties class. + */ + public EfsMountTargetProperties() { + } + + /** + * Get the awsProperties property: AWS Properties. + * + * @return the awsProperties value. + */ + public AwsEfsMountTargetProperties awsProperties() { + return this.awsProperties; + } + + /** + * Set the awsProperties property: AWS Properties. + * + * @param awsProperties the awsProperties value to set. + * @return the EfsMountTargetProperties object itself. + */ + public EfsMountTargetProperties withAwsProperties(AwsEfsMountTargetProperties awsProperties) { + this.awsProperties = awsProperties; + return this; + } + + /** + * Get the publicCloudConnectorsResourceId property: Public Cloud Connectors Resource ID. + * + * @return the publicCloudConnectorsResourceId value. + */ + public String publicCloudConnectorsResourceId() { + return this.publicCloudConnectorsResourceId; + } + + /** + * Set the publicCloudConnectorsResourceId property: Public Cloud Connectors Resource ID. + * + * @param publicCloudConnectorsResourceId the publicCloudConnectorsResourceId value to set. + * @return the EfsMountTargetProperties object itself. + */ + public EfsMountTargetProperties withPublicCloudConnectorsResourceId(String publicCloudConnectorsResourceId) { + this.publicCloudConnectorsResourceId = publicCloudConnectorsResourceId; + return this; + } + + /** + * Get the awsAccountId property: AWS Account ID. + * + * @return the awsAccountId value. + */ + public String awsAccountId() { + return this.awsAccountId; + } + + /** + * Set the awsAccountId property: AWS Account ID. + * + * @param awsAccountId the awsAccountId value to set. + * @return the EfsMountTargetProperties object itself. + */ + public EfsMountTargetProperties withAwsAccountId(String awsAccountId) { + this.awsAccountId = awsAccountId; + return this; + } + + /** + * Get the arn property: Amazon Resource Name (ARN). + * + * @return the arn value. + */ + public String arn() { + return this.arn; + } + + /** + * Set the arn property: Amazon Resource Name (ARN). + * + * @param arn the arn value to set. + * @return the EfsMountTargetProperties object itself. + */ + public EfsMountTargetProperties withArn(String arn) { + this.arn = arn; + return this; + } + + /** + * Get the publicCloudResourceName property: Public Cloud Resource Name. + * + * @return the publicCloudResourceName value. + */ + public String publicCloudResourceName() { + return this.publicCloudResourceName; + } + + /** + * Set the publicCloudResourceName property: Public Cloud Resource Name. + * + * @param publicCloudResourceName the publicCloudResourceName value to set. + * @return the EfsMountTargetProperties object itself. + */ + public EfsMountTargetProperties withPublicCloudResourceName(String publicCloudResourceName) { + this.publicCloudResourceName = publicCloudResourceName; + return this; + } + + /** + * Get the awsSourceSchema property: AWS Source Schema. + * + * @return the awsSourceSchema value. + */ + public String awsSourceSchema() { + return this.awsSourceSchema; + } + + /** + * Set the awsSourceSchema property: AWS Source Schema. + * + * @param awsSourceSchema the awsSourceSchema value to set. + * @return the EfsMountTargetProperties object itself. + */ + public EfsMountTargetProperties withAwsSourceSchema(String awsSourceSchema) { + this.awsSourceSchema = awsSourceSchema; + return this; + } + + /** + * Get the awsRegion property: AWS Region. + * + * @return the awsRegion value. + */ + public String awsRegion() { + return this.awsRegion; + } + + /** + * Set the awsRegion property: AWS Region. + * + * @param awsRegion the awsRegion value to set. + * @return the EfsMountTargetProperties object itself. + */ + public EfsMountTargetProperties withAwsRegion(String awsRegion) { + this.awsRegion = awsRegion; + return this; + } + + /** + * Get the awsTags property: AWS Tags. + * + * @return the awsTags value. + */ + public Map awsTags() { + return this.awsTags; + } + + /** + * Set the awsTags property: AWS Tags. + * + * @param awsTags the awsTags value to set. + * @return the EfsMountTargetProperties object itself. + */ + public EfsMountTargetProperties withAwsTags(Map awsTags) { + this.awsTags = awsTags; + return this; + } + + /** + * Get the provisioningState property: The status of the last operation. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (awsProperties() != null) { + awsProperties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("awsProperties", this.awsProperties); + jsonWriter.writeStringField("publicCloudConnectorsResourceId", this.publicCloudConnectorsResourceId); + jsonWriter.writeStringField("awsAccountId", this.awsAccountId); + jsonWriter.writeStringField("arn", this.arn); + jsonWriter.writeStringField("publicCloudResourceName", this.publicCloudResourceName); + jsonWriter.writeStringField("awsSourceSchema", this.awsSourceSchema); + jsonWriter.writeStringField("awsRegion", this.awsRegion); + jsonWriter.writeMapField("awsTags", this.awsTags, (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of EfsMountTargetProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of EfsMountTargetProperties if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IOException If an error occurs while reading the EfsMountTargetProperties. + */ + public static EfsMountTargetProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + EfsMountTargetProperties deserializedEfsMountTargetProperties = new EfsMountTargetProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("awsProperties".equals(fieldName)) { + deserializedEfsMountTargetProperties.awsProperties = AwsEfsMountTargetProperties.fromJson(reader); + } else if ("publicCloudConnectorsResourceId".equals(fieldName)) { + deserializedEfsMountTargetProperties.publicCloudConnectorsResourceId = reader.getString(); + } else if ("awsAccountId".equals(fieldName)) { + deserializedEfsMountTargetProperties.awsAccountId = reader.getString(); + } else if ("arn".equals(fieldName)) { + deserializedEfsMountTargetProperties.arn = reader.getString(); + } else if ("publicCloudResourceName".equals(fieldName)) { + deserializedEfsMountTargetProperties.publicCloudResourceName = reader.getString(); + } else if ("awsSourceSchema".equals(fieldName)) { + deserializedEfsMountTargetProperties.awsSourceSchema = reader.getString(); + } else if ("awsRegion".equals(fieldName)) { + deserializedEfsMountTargetProperties.awsRegion = reader.getString(); + } else if ("awsTags".equals(fieldName)) { + Map awsTags = reader.readMap(reader1 -> reader1.getString()); + deserializedEfsMountTargetProperties.awsTags = awsTags; + } else if ("provisioningState".equals(fieldName)) { + deserializedEfsMountTargetProperties.provisioningState + = ProvisioningState.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedEfsMountTargetProperties; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/EfsMountTargetTagsUpdate.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/EfsMountTargetTagsUpdate.java new file mode 100644 index 000000000000..439b4c1d4498 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/EfsMountTargetTagsUpdate.java @@ -0,0 +1,95 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.Map; + +/** + * The type used for updating tags in EfsMountTarget resources. + */ +@Fluent +public final class EfsMountTargetTagsUpdate implements JsonSerializable { + /* + * Resource tags. + */ + private Map tags; + + /** + * Creates an instance of EfsMountTargetTagsUpdate class. + */ + public EfsMountTargetTagsUpdate() { + } + + /** + * Get the tags property: Resource tags. + * + * @return the tags value. + */ + public Map tags() { + return this.tags; + } + + /** + * Set the tags property: Resource tags. + * + * @param tags the tags value to set. + * @return the EfsMountTargetTagsUpdate object itself. + */ + public EfsMountTargetTagsUpdate withTags(Map tags) { + this.tags = tags; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeMapField("tags", this.tags, (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of EfsMountTargetTagsUpdate from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of EfsMountTargetTagsUpdate if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IOException If an error occurs while reading the EfsMountTargetTagsUpdate. + */ + public static EfsMountTargetTagsUpdate fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + EfsMountTargetTagsUpdate deserializedEfsMountTargetTagsUpdate = new EfsMountTargetTagsUpdate(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedEfsMountTargetTagsUpdate.tags = tags; + } else { + reader.skipChildren(); + } + } + + return deserializedEfsMountTargetTagsUpdate; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/EfsMountTargets.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/EfsMountTargets.java new file mode 100644 index 000000000000..45a0c3c3bfc6 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/EfsMountTargets.java @@ -0,0 +1,157 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** + * Resource collection API of EfsMountTargets. + */ +public interface EfsMountTargets { + /** + * List EfsMountTarget resources by subscription ID. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a EfsMountTarget list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable list(); + + /** + * List EfsMountTarget resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a EfsMountTarget list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable list(Context context); + + /** + * List EfsMountTarget resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a EfsMountTarget list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * List EfsMountTarget resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a EfsMountTarget list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Get a EfsMountTarget. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of EfsMountTarget. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a EfsMountTarget along with {@link Response}. + */ + Response getByResourceGroupWithResponse(String resourceGroupName, String name, Context context); + + /** + * Get a EfsMountTarget. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of EfsMountTarget. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a EfsMountTarget. + */ + EfsMountTarget getByResourceGroup(String resourceGroupName, String name); + + /** + * Delete a EfsMountTarget. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of EfsMountTarget. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByResourceGroup(String resourceGroupName, String name); + + /** + * Delete a EfsMountTarget. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of EfsMountTarget. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String name, Context context); + + /** + * Get a EfsMountTarget. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a EfsMountTarget along with {@link Response}. + */ + EfsMountTarget getById(String id); + + /** + * Get a EfsMountTarget. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a EfsMountTarget along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Delete a EfsMountTarget. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteById(String id); + + /** + * Delete a EfsMountTarget. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new EfsMountTarget resource. + * + * @param name resource name. + * @return the first stage of the new EfsMountTarget definition. + */ + EfsMountTarget.DefinitionStages.Blank define(String name); +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/EfsVolumeConfiguration.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/EfsVolumeConfiguration.java new file mode 100644 index 000000000000..631ce716858e --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/EfsVolumeConfiguration.java @@ -0,0 +1,249 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of EFSVolumeConfiguration. + */ +@Fluent +public final class EfsVolumeConfiguration implements JsonSerializable { + /* + * The authorization configuration details for the Amazon EFS file system. The authorization configuration details + * for the Amazon EFS file system. + */ + private AuthorizationConfig authorizationConfig; + + /* + * The Amazon EFS file system ID to use. + */ + private String filesystemId; + + /* + * The directory within the Amazon EFS file system to mount as the root directory inside the host. If this parameter + * is omitted, the root of the Amazon EFS volume will be used. Specifying ``/`` will have the same effect as + * omitting this parameter. If an EFS access point is specified in the ``authorizationConfig``, the root directory + * parameter must either be omitted or set to ``/`` which will enforce the path set on the EFS access point. + */ + private String rootDirectory; + + /* + * Determines whether to use encryption for Amazon EFS data in transit between the Amazon ECS host and the Amazon + * EFS server. Transit encryption must be turned on if Amazon EFS IAM authorization is used. If this parameter is + * omitted, the default value of ``DISABLED`` is used. For more information, see [Encrypting data in + * transit](https://docs.aws.amazon.com/efs/latest/ug/encryption-in-transit.html) in the *Amazon Elastic File System + * User Guide*. + */ + private EfsVolumeConfigurationTransitEncryption transitEncryption; + + /* + * The port to use when sending encrypted data between the Amazon ECS host and the Amazon EFS server. If you do not + * specify a transit encryption port, it will use the port selection strategy that the Amazon EFS mount helper uses. + * For more information, see [EFS mount helper](https://docs.aws.amazon.com/efs/latest/ug/efs-mount-helper.html) in + * the *Amazon Elastic File System User Guide*. + */ + private Integer transitEncryptionPort; + + /** + * Creates an instance of EfsVolumeConfiguration class. + */ + public EfsVolumeConfiguration() { + } + + /** + * Get the authorizationConfig property: The authorization configuration details for the Amazon EFS file system. The + * authorization configuration details for the Amazon EFS file system. + * + * @return the authorizationConfig value. + */ + public AuthorizationConfig authorizationConfig() { + return this.authorizationConfig; + } + + /** + * Set the authorizationConfig property: The authorization configuration details for the Amazon EFS file system. The + * authorization configuration details for the Amazon EFS file system. + * + * @param authorizationConfig the authorizationConfig value to set. + * @return the EfsVolumeConfiguration object itself. + */ + public EfsVolumeConfiguration withAuthorizationConfig(AuthorizationConfig authorizationConfig) { + this.authorizationConfig = authorizationConfig; + return this; + } + + /** + * Get the filesystemId property: The Amazon EFS file system ID to use. + * + * @return the filesystemId value. + */ + public String filesystemId() { + return this.filesystemId; + } + + /** + * Set the filesystemId property: The Amazon EFS file system ID to use. + * + * @param filesystemId the filesystemId value to set. + * @return the EfsVolumeConfiguration object itself. + */ + public EfsVolumeConfiguration withFilesystemId(String filesystemId) { + this.filesystemId = filesystemId; + return this; + } + + /** + * Get the rootDirectory property: The directory within the Amazon EFS file system to mount as the root directory + * inside the host. If this parameter is omitted, the root of the Amazon EFS volume will be used. Specifying ``/`` + * will have the same effect as omitting this parameter. If an EFS access point is specified in the + * ``authorizationConfig``, the root directory parameter must either be omitted or set to ``/`` which will enforce + * the path set on the EFS access point. + * + * @return the rootDirectory value. + */ + public String rootDirectory() { + return this.rootDirectory; + } + + /** + * Set the rootDirectory property: The directory within the Amazon EFS file system to mount as the root directory + * inside the host. If this parameter is omitted, the root of the Amazon EFS volume will be used. Specifying ``/`` + * will have the same effect as omitting this parameter. If an EFS access point is specified in the + * ``authorizationConfig``, the root directory parameter must either be omitted or set to ``/`` which will enforce + * the path set on the EFS access point. + * + * @param rootDirectory the rootDirectory value to set. + * @return the EfsVolumeConfiguration object itself. + */ + public EfsVolumeConfiguration withRootDirectory(String rootDirectory) { + this.rootDirectory = rootDirectory; + return this; + } + + /** + * Get the transitEncryption property: Determines whether to use encryption for Amazon EFS data in transit between + * the Amazon ECS host and the Amazon EFS server. Transit encryption must be turned on if Amazon EFS IAM + * authorization is used. If this parameter is omitted, the default value of ``DISABLED`` is used. For more + * information, see [Encrypting data in + * transit](https://docs.aws.amazon.com/efs/latest/ug/encryption-in-transit.html) in the *Amazon Elastic File System + * User Guide*. + * + * @return the transitEncryption value. + */ + public EfsVolumeConfigurationTransitEncryption transitEncryption() { + return this.transitEncryption; + } + + /** + * Set the transitEncryption property: Determines whether to use encryption for Amazon EFS data in transit between + * the Amazon ECS host and the Amazon EFS server. Transit encryption must be turned on if Amazon EFS IAM + * authorization is used. If this parameter is omitted, the default value of ``DISABLED`` is used. For more + * information, see [Encrypting data in + * transit](https://docs.aws.amazon.com/efs/latest/ug/encryption-in-transit.html) in the *Amazon Elastic File System + * User Guide*. + * + * @param transitEncryption the transitEncryption value to set. + * @return the EfsVolumeConfiguration object itself. + */ + public EfsVolumeConfiguration withTransitEncryption(EfsVolumeConfigurationTransitEncryption transitEncryption) { + this.transitEncryption = transitEncryption; + return this; + } + + /** + * Get the transitEncryptionPort property: The port to use when sending encrypted data between the Amazon ECS host + * and the Amazon EFS server. If you do not specify a transit encryption port, it will use the port selection + * strategy that the Amazon EFS mount helper uses. For more information, see [EFS mount + * helper](https://docs.aws.amazon.com/efs/latest/ug/efs-mount-helper.html) in the *Amazon Elastic File System User + * Guide*. + * + * @return the transitEncryptionPort value. + */ + public Integer transitEncryptionPort() { + return this.transitEncryptionPort; + } + + /** + * Set the transitEncryptionPort property: The port to use when sending encrypted data between the Amazon ECS host + * and the Amazon EFS server. If you do not specify a transit encryption port, it will use the port selection + * strategy that the Amazon EFS mount helper uses. For more information, see [EFS mount + * helper](https://docs.aws.amazon.com/efs/latest/ug/efs-mount-helper.html) in the *Amazon Elastic File System User + * Guide*. + * + * @param transitEncryptionPort the transitEncryptionPort value to set. + * @return the EfsVolumeConfiguration object itself. + */ + public EfsVolumeConfiguration withTransitEncryptionPort(Integer transitEncryptionPort) { + this.transitEncryptionPort = transitEncryptionPort; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (authorizationConfig() != null) { + authorizationConfig().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("authorizationConfig", this.authorizationConfig); + jsonWriter.writeStringField("filesystemId", this.filesystemId); + jsonWriter.writeStringField("rootDirectory", this.rootDirectory); + jsonWriter.writeStringField("transitEncryption", + this.transitEncryption == null ? null : this.transitEncryption.toString()); + jsonWriter.writeNumberField("transitEncryptionPort", this.transitEncryptionPort); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of EfsVolumeConfiguration from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of EfsVolumeConfiguration if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the EfsVolumeConfiguration. + */ + public static EfsVolumeConfiguration fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + EfsVolumeConfiguration deserializedEfsVolumeConfiguration = new EfsVolumeConfiguration(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("authorizationConfig".equals(fieldName)) { + deserializedEfsVolumeConfiguration.authorizationConfig = AuthorizationConfig.fromJson(reader); + } else if ("filesystemId".equals(fieldName)) { + deserializedEfsVolumeConfiguration.filesystemId = reader.getString(); + } else if ("rootDirectory".equals(fieldName)) { + deserializedEfsVolumeConfiguration.rootDirectory = reader.getString(); + } else if ("transitEncryption".equals(fieldName)) { + deserializedEfsVolumeConfiguration.transitEncryption + = EfsVolumeConfigurationTransitEncryption.fromString(reader.getString()); + } else if ("transitEncryptionPort".equals(fieldName)) { + deserializedEfsVolumeConfiguration.transitEncryptionPort = reader.getNullable(JsonReader::getInt); + } else { + reader.skipChildren(); + } + } + + return deserializedEfsVolumeConfiguration; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/EfsVolumeConfigurationTransitEncryption.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/EfsVolumeConfigurationTransitEncryption.java new file mode 100644 index 000000000000..b117a8b69389 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/EfsVolumeConfigurationTransitEncryption.java @@ -0,0 +1,52 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * EFSVolumeConfigurationTransitEncryption enum. + */ +public final class EfsVolumeConfigurationTransitEncryption + extends ExpandableStringEnum { + /** + * Static value DISABLED for EfsVolumeConfigurationTransitEncryption. + */ + public static final EfsVolumeConfigurationTransitEncryption DISABLED = fromString("DISABLED"); + + /** + * Static value ENABLED for EfsVolumeConfigurationTransitEncryption. + */ + public static final EfsVolumeConfigurationTransitEncryption ENABLED = fromString("ENABLED"); + + /** + * Creates a new instance of EfsVolumeConfigurationTransitEncryption value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public EfsVolumeConfigurationTransitEncryption() { + } + + /** + * Creates or finds a EfsVolumeConfigurationTransitEncryption from its string representation. + * + * @param name a name to look for. + * @return the corresponding EfsVolumeConfigurationTransitEncryption. + */ + public static EfsVolumeConfigurationTransitEncryption fromString(String name) { + return fromString(name, EfsVolumeConfigurationTransitEncryption.class); + } + + /** + * Gets known EfsVolumeConfigurationTransitEncryption values. + * + * @return known EfsVolumeConfigurationTransitEncryption values. + */ + public static Collection values() { + return values(EfsVolumeConfigurationTransitEncryption.class); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/EksCluster.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/EksCluster.java new file mode 100644 index 000000000000..c473a4c1d25e --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/EksCluster.java @@ -0,0 +1,55 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.awsconnector.fluent.models.EksClusterInner; + +/** + * An immutable client-side representation of EksCluster. + */ +public interface EksCluster { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the properties property: The resource-specific properties for this resource. + * + * @return the properties value. + */ + EksClusterProperties properties(); + + /** + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the inner com.azure.resourcemanager.awsconnector.fluent.models.EksClusterInner object. + * + * @return the inner object. + */ + EksClusterInner innerModel(); +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/EksClusterListResult.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/EksClusterListResult.java new file mode 100644 index 000000000000..c730cc0b9de3 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/EksClusterListResult.java @@ -0,0 +1,134 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.awsconnector.fluent.models.EksClusterInner; +import java.io.IOException; +import java.util.List; + +/** + * The response of a EksCluster list operation. + */ +@Fluent +public final class EksClusterListResult implements JsonSerializable { + /* + * The EksCluster items on this page + */ + private List value; + + /* + * The link to the next page of items + */ + private String nextLink; + + /** + * Creates an instance of EksClusterListResult class. + */ + public EksClusterListResult() { + } + + /** + * Get the value property: The EksCluster items on this page. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The EksCluster items on this page. + * + * @param value the value value to set. + * @return the EksClusterListResult object itself. + */ + public EksClusterListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The link to the next page of items. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: The link to the next page of items. + * + * @param nextLink the nextLink value to set. + * @return the EksClusterListResult object itself. + */ + public EksClusterListResult withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property value in model EksClusterListResult")); + } else { + value().forEach(e -> e.validate()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(EksClusterListResult.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("nextLink", this.nextLink); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of EksClusterListResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of EksClusterListResult if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the EksClusterListResult. + */ + public static EksClusterListResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + EksClusterListResult deserializedEksClusterListResult = new EksClusterListResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value = reader.readArray(reader1 -> EksClusterInner.fromJson(reader1)); + deserializedEksClusterListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedEksClusterListResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedEksClusterListResult; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/EksClusterProperties.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/EksClusterProperties.java new file mode 100644 index 000000000000..a34f619660f6 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/EksClusterProperties.java @@ -0,0 +1,311 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.Map; + +/** + * Definition of EksCluster. + */ +@Fluent +public final class EksClusterProperties implements JsonSerializable { + /* + * AWS Properties + */ + private AwsEksClusterProperties awsProperties; + + /* + * Public Cloud Connectors Resource ID + */ + private String publicCloudConnectorsResourceId; + + /* + * AWS Account ID + */ + private String awsAccountId; + + /* + * Amazon Resource Name (ARN) + */ + private String arn; + + /* + * Public Cloud Resource Name + */ + private String publicCloudResourceName; + + /* + * AWS Source Schema + */ + private String awsSourceSchema; + + /* + * AWS Region + */ + private String awsRegion; + + /* + * AWS Tags + */ + private Map awsTags; + + /* + * The status of the last operation. + */ + private ProvisioningState provisioningState; + + /** + * Creates an instance of EksClusterProperties class. + */ + public EksClusterProperties() { + } + + /** + * Get the awsProperties property: AWS Properties. + * + * @return the awsProperties value. + */ + public AwsEksClusterProperties awsProperties() { + return this.awsProperties; + } + + /** + * Set the awsProperties property: AWS Properties. + * + * @param awsProperties the awsProperties value to set. + * @return the EksClusterProperties object itself. + */ + public EksClusterProperties withAwsProperties(AwsEksClusterProperties awsProperties) { + this.awsProperties = awsProperties; + return this; + } + + /** + * Get the publicCloudConnectorsResourceId property: Public Cloud Connectors Resource ID. + * + * @return the publicCloudConnectorsResourceId value. + */ + public String publicCloudConnectorsResourceId() { + return this.publicCloudConnectorsResourceId; + } + + /** + * Set the publicCloudConnectorsResourceId property: Public Cloud Connectors Resource ID. + * + * @param publicCloudConnectorsResourceId the publicCloudConnectorsResourceId value to set. + * @return the EksClusterProperties object itself. + */ + public EksClusterProperties withPublicCloudConnectorsResourceId(String publicCloudConnectorsResourceId) { + this.publicCloudConnectorsResourceId = publicCloudConnectorsResourceId; + return this; + } + + /** + * Get the awsAccountId property: AWS Account ID. + * + * @return the awsAccountId value. + */ + public String awsAccountId() { + return this.awsAccountId; + } + + /** + * Set the awsAccountId property: AWS Account ID. + * + * @param awsAccountId the awsAccountId value to set. + * @return the EksClusterProperties object itself. + */ + public EksClusterProperties withAwsAccountId(String awsAccountId) { + this.awsAccountId = awsAccountId; + return this; + } + + /** + * Get the arn property: Amazon Resource Name (ARN). + * + * @return the arn value. + */ + public String arn() { + return this.arn; + } + + /** + * Set the arn property: Amazon Resource Name (ARN). + * + * @param arn the arn value to set. + * @return the EksClusterProperties object itself. + */ + public EksClusterProperties withArn(String arn) { + this.arn = arn; + return this; + } + + /** + * Get the publicCloudResourceName property: Public Cloud Resource Name. + * + * @return the publicCloudResourceName value. + */ + public String publicCloudResourceName() { + return this.publicCloudResourceName; + } + + /** + * Set the publicCloudResourceName property: Public Cloud Resource Name. + * + * @param publicCloudResourceName the publicCloudResourceName value to set. + * @return the EksClusterProperties object itself. + */ + public EksClusterProperties withPublicCloudResourceName(String publicCloudResourceName) { + this.publicCloudResourceName = publicCloudResourceName; + return this; + } + + /** + * Get the awsSourceSchema property: AWS Source Schema. + * + * @return the awsSourceSchema value. + */ + public String awsSourceSchema() { + return this.awsSourceSchema; + } + + /** + * Set the awsSourceSchema property: AWS Source Schema. + * + * @param awsSourceSchema the awsSourceSchema value to set. + * @return the EksClusterProperties object itself. + */ + public EksClusterProperties withAwsSourceSchema(String awsSourceSchema) { + this.awsSourceSchema = awsSourceSchema; + return this; + } + + /** + * Get the awsRegion property: AWS Region. + * + * @return the awsRegion value. + */ + public String awsRegion() { + return this.awsRegion; + } + + /** + * Set the awsRegion property: AWS Region. + * + * @param awsRegion the awsRegion value to set. + * @return the EksClusterProperties object itself. + */ + public EksClusterProperties withAwsRegion(String awsRegion) { + this.awsRegion = awsRegion; + return this; + } + + /** + * Get the awsTags property: AWS Tags. + * + * @return the awsTags value. + */ + public Map awsTags() { + return this.awsTags; + } + + /** + * Set the awsTags property: AWS Tags. + * + * @param awsTags the awsTags value to set. + * @return the EksClusterProperties object itself. + */ + public EksClusterProperties withAwsTags(Map awsTags) { + this.awsTags = awsTags; + return this; + } + + /** + * Get the provisioningState property: The status of the last operation. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (awsProperties() != null) { + awsProperties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("awsProperties", this.awsProperties); + jsonWriter.writeStringField("publicCloudConnectorsResourceId", this.publicCloudConnectorsResourceId); + jsonWriter.writeStringField("awsAccountId", this.awsAccountId); + jsonWriter.writeStringField("arn", this.arn); + jsonWriter.writeStringField("publicCloudResourceName", this.publicCloudResourceName); + jsonWriter.writeStringField("awsSourceSchema", this.awsSourceSchema); + jsonWriter.writeStringField("awsRegion", this.awsRegion); + jsonWriter.writeMapField("awsTags", this.awsTags, (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of EksClusterProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of EksClusterProperties if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the EksClusterProperties. + */ + public static EksClusterProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + EksClusterProperties deserializedEksClusterProperties = new EksClusterProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("awsProperties".equals(fieldName)) { + deserializedEksClusterProperties.awsProperties = AwsEksClusterProperties.fromJson(reader); + } else if ("publicCloudConnectorsResourceId".equals(fieldName)) { + deserializedEksClusterProperties.publicCloudConnectorsResourceId = reader.getString(); + } else if ("awsAccountId".equals(fieldName)) { + deserializedEksClusterProperties.awsAccountId = reader.getString(); + } else if ("arn".equals(fieldName)) { + deserializedEksClusterProperties.arn = reader.getString(); + } else if ("publicCloudResourceName".equals(fieldName)) { + deserializedEksClusterProperties.publicCloudResourceName = reader.getString(); + } else if ("awsSourceSchema".equals(fieldName)) { + deserializedEksClusterProperties.awsSourceSchema = reader.getString(); + } else if ("awsRegion".equals(fieldName)) { + deserializedEksClusterProperties.awsRegion = reader.getString(); + } else if ("awsTags".equals(fieldName)) { + Map awsTags = reader.readMap(reader1 -> reader1.getString()); + deserializedEksClusterProperties.awsTags = awsTags; + } else if ("provisioningState".equals(fieldName)) { + deserializedEksClusterProperties.provisioningState + = ProvisioningState.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedEksClusterProperties; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/EksClusters.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/EksClusters.java new file mode 100644 index 000000000000..20e67bc9f000 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/EksClusters.java @@ -0,0 +1,109 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.awsconnector.fluent.models.EksClusterInner; + +/** + * Resource collection API of EksClusters. + */ +public interface EksClusters { + /** + * List EksCluster resources by parent. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a EksCluster list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable list(String resourceUri); + + /** + * List EksCluster resources by parent. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a EksCluster list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable list(String resourceUri, Context context); + + /** + * Get a EksCluster. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a EksCluster along with {@link Response}. + */ + Response getWithResponse(String resourceUri, Context context); + + /** + * Get a EksCluster. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a EksCluster. + */ + EksCluster get(String resourceUri); + + /** + * Create a EksCluster. Please note that end user resource creation is currently restricted, but it will be enabled + * in the future. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + EksCluster createOrReplace(String resourceUri, EksClusterInner resource); + + /** + * Create a EksCluster. Please note that end user resource creation is currently restricted, but it will be enabled + * in the future. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Microsoft.AwsConnector resource. + */ + EksCluster createOrReplace(String resourceUri, EksClusterInner resource, Context context); + + /** + * Delete a EksCluster. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceUri); + + /** + * Delete a EksCluster. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceUri, Context context); +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/EksNodegroup.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/EksNodegroup.java new file mode 100644 index 000000000000..77e15a37ebeb --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/EksNodegroup.java @@ -0,0 +1,252 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.awsconnector.fluent.models.EksNodegroupInner; +import java.util.Map; + +/** + * An immutable client-side representation of EksNodegroup. + */ +public interface EksNodegroup { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the location property: The geo-location where the resource lives. + * + * @return the location value. + */ + String location(); + + /** + * Gets the tags property: Resource tags. + * + * @return the tags value. + */ + Map tags(); + + /** + * Gets the properties property: The resource-specific properties for this resource. + * + * @return the properties value. + */ + EksNodegroupProperties properties(); + + /** + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the region of the resource. + * + * @return the region of the resource. + */ + Region region(); + + /** + * Gets the name of the resource region. + * + * @return the name of the resource region. + */ + String regionName(); + + /** + * Gets the name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + + /** + * Gets the inner com.azure.resourcemanager.awsconnector.fluent.models.EksNodegroupInner object. + * + * @return the inner object. + */ + EksNodegroupInner innerModel(); + + /** + * The entirety of the EksNodegroup definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithLocation, + DefinitionStages.WithResourceGroup, DefinitionStages.WithCreate { + } + + /** + * The EksNodegroup definition stages. + */ + interface DefinitionStages { + /** + * The first stage of the EksNodegroup definition. + */ + interface Blank extends WithLocation { + } + + /** + * The stage of the EksNodegroup definition allowing to specify location. + */ + interface WithLocation { + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithResourceGroup withRegion(Region location); + + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithResourceGroup withRegion(String location); + } + + /** + * The stage of the EksNodegroup definition allowing to specify parent resource. + */ + interface WithResourceGroup { + /** + * Specifies resourceGroupName. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @return the next definition stage. + */ + WithCreate withExistingResourceGroup(String resourceGroupName); + } + + /** + * The stage of the EksNodegroup 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.WithProperties { + /** + * Executes the create request. + * + * @return the created resource. + */ + EksNodegroup create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + EksNodegroup create(Context context); + } + + /** + * The stage of the EksNodegroup definition allowing to specify tags. + */ + interface WithTags { + /** + * Specifies the tags property: Resource tags.. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + WithCreate withTags(Map tags); + } + + /** + * The stage of the EksNodegroup definition allowing to specify properties. + */ + interface WithProperties { + /** + * Specifies the properties property: The resource-specific properties for this resource.. + * + * @param properties The resource-specific properties for this resource. + * @return the next definition stage. + */ + WithCreate withProperties(EksNodegroupProperties properties); + } + } + + /** + * Begins update for the EksNodegroup resource. + * + * @return the stage of resource update. + */ + EksNodegroup.Update update(); + + /** + * The template for EksNodegroup update. + */ + interface Update extends UpdateStages.WithTags { + /** + * Executes the update request. + * + * @return the updated resource. + */ + EksNodegroup apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + EksNodegroup apply(Context context); + } + + /** + * The EksNodegroup update stages. + */ + interface UpdateStages { + /** + * The stage of the EksNodegroup update allowing to specify tags. + */ + interface WithTags { + /** + * Specifies the tags property: Resource tags.. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + Update withTags(Map tags); + } + } + + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + EksNodegroup refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + EksNodegroup refresh(Context context); +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/EksNodegroupListResult.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/EksNodegroupListResult.java new file mode 100644 index 000000000000..1088b652d3c9 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/EksNodegroupListResult.java @@ -0,0 +1,134 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.awsconnector.fluent.models.EksNodegroupInner; +import java.io.IOException; +import java.util.List; + +/** + * The response of a EksNodegroup list operation. + */ +@Fluent +public final class EksNodegroupListResult implements JsonSerializable { + /* + * The EksNodegroup items on this page + */ + private List value; + + /* + * The link to the next page of items + */ + private String nextLink; + + /** + * Creates an instance of EksNodegroupListResult class. + */ + public EksNodegroupListResult() { + } + + /** + * Get the value property: The EksNodegroup items on this page. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The EksNodegroup items on this page. + * + * @param value the value value to set. + * @return the EksNodegroupListResult object itself. + */ + public EksNodegroupListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The link to the next page of items. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: The link to the next page of items. + * + * @param nextLink the nextLink value to set. + * @return the EksNodegroupListResult object itself. + */ + public EksNodegroupListResult withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property value in model EksNodegroupListResult")); + } else { + value().forEach(e -> e.validate()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(EksNodegroupListResult.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("nextLink", this.nextLink); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of EksNodegroupListResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of EksNodegroupListResult if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the EksNodegroupListResult. + */ + public static EksNodegroupListResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + EksNodegroupListResult deserializedEksNodegroupListResult = new EksNodegroupListResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value = reader.readArray(reader1 -> EksNodegroupInner.fromJson(reader1)); + deserializedEksNodegroupListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedEksNodegroupListResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedEksNodegroupListResult; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/EksNodegroupProperties.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/EksNodegroupProperties.java new file mode 100644 index 000000000000..96eaf73f58b9 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/EksNodegroupProperties.java @@ -0,0 +1,311 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.Map; + +/** + * Definition of EksNodegroup. + */ +@Fluent +public final class EksNodegroupProperties implements JsonSerializable { + /* + * AWS Properties + */ + private AwsEksNodegroupProperties awsProperties; + + /* + * Public Cloud Connectors Resource ID + */ + private String publicCloudConnectorsResourceId; + + /* + * AWS Account ID + */ + private String awsAccountId; + + /* + * Amazon Resource Name (ARN) + */ + private String arn; + + /* + * Public Cloud Resource Name + */ + private String publicCloudResourceName; + + /* + * AWS Source Schema + */ + private String awsSourceSchema; + + /* + * AWS Region + */ + private String awsRegion; + + /* + * AWS Tags + */ + private Map awsTags; + + /* + * The status of the last operation. + */ + private ProvisioningState provisioningState; + + /** + * Creates an instance of EksNodegroupProperties class. + */ + public EksNodegroupProperties() { + } + + /** + * Get the awsProperties property: AWS Properties. + * + * @return the awsProperties value. + */ + public AwsEksNodegroupProperties awsProperties() { + return this.awsProperties; + } + + /** + * Set the awsProperties property: AWS Properties. + * + * @param awsProperties the awsProperties value to set. + * @return the EksNodegroupProperties object itself. + */ + public EksNodegroupProperties withAwsProperties(AwsEksNodegroupProperties awsProperties) { + this.awsProperties = awsProperties; + return this; + } + + /** + * Get the publicCloudConnectorsResourceId property: Public Cloud Connectors Resource ID. + * + * @return the publicCloudConnectorsResourceId value. + */ + public String publicCloudConnectorsResourceId() { + return this.publicCloudConnectorsResourceId; + } + + /** + * Set the publicCloudConnectorsResourceId property: Public Cloud Connectors Resource ID. + * + * @param publicCloudConnectorsResourceId the publicCloudConnectorsResourceId value to set. + * @return the EksNodegroupProperties object itself. + */ + public EksNodegroupProperties withPublicCloudConnectorsResourceId(String publicCloudConnectorsResourceId) { + this.publicCloudConnectorsResourceId = publicCloudConnectorsResourceId; + return this; + } + + /** + * Get the awsAccountId property: AWS Account ID. + * + * @return the awsAccountId value. + */ + public String awsAccountId() { + return this.awsAccountId; + } + + /** + * Set the awsAccountId property: AWS Account ID. + * + * @param awsAccountId the awsAccountId value to set. + * @return the EksNodegroupProperties object itself. + */ + public EksNodegroupProperties withAwsAccountId(String awsAccountId) { + this.awsAccountId = awsAccountId; + return this; + } + + /** + * Get the arn property: Amazon Resource Name (ARN). + * + * @return the arn value. + */ + public String arn() { + return this.arn; + } + + /** + * Set the arn property: Amazon Resource Name (ARN). + * + * @param arn the arn value to set. + * @return the EksNodegroupProperties object itself. + */ + public EksNodegroupProperties withArn(String arn) { + this.arn = arn; + return this; + } + + /** + * Get the publicCloudResourceName property: Public Cloud Resource Name. + * + * @return the publicCloudResourceName value. + */ + public String publicCloudResourceName() { + return this.publicCloudResourceName; + } + + /** + * Set the publicCloudResourceName property: Public Cloud Resource Name. + * + * @param publicCloudResourceName the publicCloudResourceName value to set. + * @return the EksNodegroupProperties object itself. + */ + public EksNodegroupProperties withPublicCloudResourceName(String publicCloudResourceName) { + this.publicCloudResourceName = publicCloudResourceName; + return this; + } + + /** + * Get the awsSourceSchema property: AWS Source Schema. + * + * @return the awsSourceSchema value. + */ + public String awsSourceSchema() { + return this.awsSourceSchema; + } + + /** + * Set the awsSourceSchema property: AWS Source Schema. + * + * @param awsSourceSchema the awsSourceSchema value to set. + * @return the EksNodegroupProperties object itself. + */ + public EksNodegroupProperties withAwsSourceSchema(String awsSourceSchema) { + this.awsSourceSchema = awsSourceSchema; + return this; + } + + /** + * Get the awsRegion property: AWS Region. + * + * @return the awsRegion value. + */ + public String awsRegion() { + return this.awsRegion; + } + + /** + * Set the awsRegion property: AWS Region. + * + * @param awsRegion the awsRegion value to set. + * @return the EksNodegroupProperties object itself. + */ + public EksNodegroupProperties withAwsRegion(String awsRegion) { + this.awsRegion = awsRegion; + return this; + } + + /** + * Get the awsTags property: AWS Tags. + * + * @return the awsTags value. + */ + public Map awsTags() { + return this.awsTags; + } + + /** + * Set the awsTags property: AWS Tags. + * + * @param awsTags the awsTags value to set. + * @return the EksNodegroupProperties object itself. + */ + public EksNodegroupProperties withAwsTags(Map awsTags) { + this.awsTags = awsTags; + return this; + } + + /** + * Get the provisioningState property: The status of the last operation. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (awsProperties() != null) { + awsProperties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("awsProperties", this.awsProperties); + jsonWriter.writeStringField("publicCloudConnectorsResourceId", this.publicCloudConnectorsResourceId); + jsonWriter.writeStringField("awsAccountId", this.awsAccountId); + jsonWriter.writeStringField("arn", this.arn); + jsonWriter.writeStringField("publicCloudResourceName", this.publicCloudResourceName); + jsonWriter.writeStringField("awsSourceSchema", this.awsSourceSchema); + jsonWriter.writeStringField("awsRegion", this.awsRegion); + jsonWriter.writeMapField("awsTags", this.awsTags, (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of EksNodegroupProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of EksNodegroupProperties if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the EksNodegroupProperties. + */ + public static EksNodegroupProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + EksNodegroupProperties deserializedEksNodegroupProperties = new EksNodegroupProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("awsProperties".equals(fieldName)) { + deserializedEksNodegroupProperties.awsProperties = AwsEksNodegroupProperties.fromJson(reader); + } else if ("publicCloudConnectorsResourceId".equals(fieldName)) { + deserializedEksNodegroupProperties.publicCloudConnectorsResourceId = reader.getString(); + } else if ("awsAccountId".equals(fieldName)) { + deserializedEksNodegroupProperties.awsAccountId = reader.getString(); + } else if ("arn".equals(fieldName)) { + deserializedEksNodegroupProperties.arn = reader.getString(); + } else if ("publicCloudResourceName".equals(fieldName)) { + deserializedEksNodegroupProperties.publicCloudResourceName = reader.getString(); + } else if ("awsSourceSchema".equals(fieldName)) { + deserializedEksNodegroupProperties.awsSourceSchema = reader.getString(); + } else if ("awsRegion".equals(fieldName)) { + deserializedEksNodegroupProperties.awsRegion = reader.getString(); + } else if ("awsTags".equals(fieldName)) { + Map awsTags = reader.readMap(reader1 -> reader1.getString()); + deserializedEksNodegroupProperties.awsTags = awsTags; + } else if ("provisioningState".equals(fieldName)) { + deserializedEksNodegroupProperties.provisioningState + = ProvisioningState.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedEksNodegroupProperties; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/EksNodegroupTagsUpdate.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/EksNodegroupTagsUpdate.java new file mode 100644 index 000000000000..b5e5cda1d2af --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/EksNodegroupTagsUpdate.java @@ -0,0 +1,95 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.Map; + +/** + * The type used for updating tags in EksNodegroup resources. + */ +@Fluent +public final class EksNodegroupTagsUpdate implements JsonSerializable { + /* + * Resource tags. + */ + private Map tags; + + /** + * Creates an instance of EksNodegroupTagsUpdate class. + */ + public EksNodegroupTagsUpdate() { + } + + /** + * Get the tags property: Resource tags. + * + * @return the tags value. + */ + public Map tags() { + return this.tags; + } + + /** + * Set the tags property: Resource tags. + * + * @param tags the tags value to set. + * @return the EksNodegroupTagsUpdate object itself. + */ + public EksNodegroupTagsUpdate withTags(Map tags) { + this.tags = tags; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeMapField("tags", this.tags, (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of EksNodegroupTagsUpdate from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of EksNodegroupTagsUpdate if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the EksNodegroupTagsUpdate. + */ + public static EksNodegroupTagsUpdate fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + EksNodegroupTagsUpdate deserializedEksNodegroupTagsUpdate = new EksNodegroupTagsUpdate(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedEksNodegroupTagsUpdate.tags = tags; + } else { + reader.skipChildren(); + } + } + + return deserializedEksNodegroupTagsUpdate; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/EksNodegroups.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/EksNodegroups.java new file mode 100644 index 000000000000..bd02434c79ce --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/EksNodegroups.java @@ -0,0 +1,157 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** + * Resource collection API of EksNodegroups. + */ +public interface EksNodegroups { + /** + * List EksNodegroup resources by subscription ID. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a EksNodegroup list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable list(); + + /** + * List EksNodegroup resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a EksNodegroup list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable list(Context context); + + /** + * List EksNodegroup resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a EksNodegroup list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * List EksNodegroup resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a EksNodegroup list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Get a EksNodegroup. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of EksNodegroup. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a EksNodegroup along with {@link Response}. + */ + Response getByResourceGroupWithResponse(String resourceGroupName, String name, Context context); + + /** + * Get a EksNodegroup. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of EksNodegroup. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a EksNodegroup. + */ + EksNodegroup getByResourceGroup(String resourceGroupName, String name); + + /** + * Delete a EksNodegroup. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of EksNodegroup. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByResourceGroup(String resourceGroupName, String name); + + /** + * Delete a EksNodegroup. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of EksNodegroup. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String name, Context context); + + /** + * Get a EksNodegroup. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a EksNodegroup along with {@link Response}. + */ + EksNodegroup getById(String id); + + /** + * Get a EksNodegroup. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a EksNodegroup along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Delete a EksNodegroup. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteById(String id); + + /** + * Delete a EksNodegroup. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new EksNodegroup resource. + * + * @param name resource name. + * @return the first stage of the new EksNodegroup definition. + */ + EksNodegroup.DefinitionStages.Blank define(String name); +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ElasticBeanstalkApplication.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ElasticBeanstalkApplication.java new file mode 100644 index 000000000000..d8d58c23f453 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ElasticBeanstalkApplication.java @@ -0,0 +1,252 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.awsconnector.fluent.models.ElasticBeanstalkApplicationInner; +import java.util.Map; + +/** + * An immutable client-side representation of ElasticBeanstalkApplication. + */ +public interface ElasticBeanstalkApplication { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the location property: The geo-location where the resource lives. + * + * @return the location value. + */ + String location(); + + /** + * Gets the tags property: Resource tags. + * + * @return the tags value. + */ + Map tags(); + + /** + * Gets the properties property: The resource-specific properties for this resource. + * + * @return the properties value. + */ + ElasticBeanstalkApplicationProperties properties(); + + /** + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the region of the resource. + * + * @return the region of the resource. + */ + Region region(); + + /** + * Gets the name of the resource region. + * + * @return the name of the resource region. + */ + String regionName(); + + /** + * Gets the name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + + /** + * Gets the inner com.azure.resourcemanager.awsconnector.fluent.models.ElasticBeanstalkApplicationInner object. + * + * @return the inner object. + */ + ElasticBeanstalkApplicationInner innerModel(); + + /** + * The entirety of the ElasticBeanstalkApplication definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithLocation, + DefinitionStages.WithResourceGroup, DefinitionStages.WithCreate { + } + + /** + * The ElasticBeanstalkApplication definition stages. + */ + interface DefinitionStages { + /** + * The first stage of the ElasticBeanstalkApplication definition. + */ + interface Blank extends WithLocation { + } + + /** + * The stage of the ElasticBeanstalkApplication definition allowing to specify location. + */ + interface WithLocation { + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithResourceGroup withRegion(Region location); + + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithResourceGroup withRegion(String location); + } + + /** + * The stage of the ElasticBeanstalkApplication definition allowing to specify parent resource. + */ + interface WithResourceGroup { + /** + * Specifies resourceGroupName. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @return the next definition stage. + */ + WithCreate withExistingResourceGroup(String resourceGroupName); + } + + /** + * The stage of the ElasticBeanstalkApplication 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.WithProperties { + /** + * Executes the create request. + * + * @return the created resource. + */ + ElasticBeanstalkApplication create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + ElasticBeanstalkApplication create(Context context); + } + + /** + * The stage of the ElasticBeanstalkApplication definition allowing to specify tags. + */ + interface WithTags { + /** + * Specifies the tags property: Resource tags.. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + WithCreate withTags(Map tags); + } + + /** + * The stage of the ElasticBeanstalkApplication definition allowing to specify properties. + */ + interface WithProperties { + /** + * Specifies the properties property: The resource-specific properties for this resource.. + * + * @param properties The resource-specific properties for this resource. + * @return the next definition stage. + */ + WithCreate withProperties(ElasticBeanstalkApplicationProperties properties); + } + } + + /** + * Begins update for the ElasticBeanstalkApplication resource. + * + * @return the stage of resource update. + */ + ElasticBeanstalkApplication.Update update(); + + /** + * The template for ElasticBeanstalkApplication update. + */ + interface Update extends UpdateStages.WithTags { + /** + * Executes the update request. + * + * @return the updated resource. + */ + ElasticBeanstalkApplication apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + ElasticBeanstalkApplication apply(Context context); + } + + /** + * The ElasticBeanstalkApplication update stages. + */ + interface UpdateStages { + /** + * The stage of the ElasticBeanstalkApplication update allowing to specify tags. + */ + interface WithTags { + /** + * Specifies the tags property: Resource tags.. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + Update withTags(Map tags); + } + } + + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + ElasticBeanstalkApplication refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + ElasticBeanstalkApplication refresh(Context context); +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ElasticBeanstalkApplicationListResult.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ElasticBeanstalkApplicationListResult.java new file mode 100644 index 000000000000..76deee7086b3 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ElasticBeanstalkApplicationListResult.java @@ -0,0 +1,138 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.awsconnector.fluent.models.ElasticBeanstalkApplicationInner; +import java.io.IOException; +import java.util.List; + +/** + * The response of a ElasticBeanstalkApplication list operation. + */ +@Fluent +public final class ElasticBeanstalkApplicationListResult + implements JsonSerializable { + /* + * The ElasticBeanstalkApplication items on this page + */ + private List value; + + /* + * The link to the next page of items + */ + private String nextLink; + + /** + * Creates an instance of ElasticBeanstalkApplicationListResult class. + */ + public ElasticBeanstalkApplicationListResult() { + } + + /** + * Get the value property: The ElasticBeanstalkApplication items on this page. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The ElasticBeanstalkApplication items on this page. + * + * @param value the value value to set. + * @return the ElasticBeanstalkApplicationListResult object itself. + */ + public ElasticBeanstalkApplicationListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The link to the next page of items. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: The link to the next page of items. + * + * @param nextLink the nextLink value to set. + * @return the ElasticBeanstalkApplicationListResult object itself. + */ + public ElasticBeanstalkApplicationListResult withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property value in model ElasticBeanstalkApplicationListResult")); + } else { + value().forEach(e -> e.validate()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(ElasticBeanstalkApplicationListResult.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("nextLink", this.nextLink); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ElasticBeanstalkApplicationListResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ElasticBeanstalkApplicationListResult if the JsonReader was pointing to an instance of it, + * or null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the ElasticBeanstalkApplicationListResult. + */ + public static ElasticBeanstalkApplicationListResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ElasticBeanstalkApplicationListResult deserializedElasticBeanstalkApplicationListResult + = new ElasticBeanstalkApplicationListResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> ElasticBeanstalkApplicationInner.fromJson(reader1)); + deserializedElasticBeanstalkApplicationListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedElasticBeanstalkApplicationListResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedElasticBeanstalkApplicationListResult; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ElasticBeanstalkApplicationProperties.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ElasticBeanstalkApplicationProperties.java new file mode 100644 index 000000000000..db0774b7c069 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ElasticBeanstalkApplicationProperties.java @@ -0,0 +1,317 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.Map; + +/** + * Definition of ElasticBeanstalkApplication. + */ +@Fluent +public final class ElasticBeanstalkApplicationProperties + implements JsonSerializable { + /* + * AWS Properties + */ + private AwsElasticBeanstalkApplicationProperties awsProperties; + + /* + * Public Cloud Connectors Resource ID + */ + private String publicCloudConnectorsResourceId; + + /* + * AWS Account ID + */ + private String awsAccountId; + + /* + * Amazon Resource Name (ARN) + */ + private String arn; + + /* + * Public Cloud Resource Name + */ + private String publicCloudResourceName; + + /* + * AWS Source Schema + */ + private String awsSourceSchema; + + /* + * AWS Region + */ + private String awsRegion; + + /* + * AWS Tags + */ + private Map awsTags; + + /* + * The status of the last operation. + */ + private ProvisioningState provisioningState; + + /** + * Creates an instance of ElasticBeanstalkApplicationProperties class. + */ + public ElasticBeanstalkApplicationProperties() { + } + + /** + * Get the awsProperties property: AWS Properties. + * + * @return the awsProperties value. + */ + public AwsElasticBeanstalkApplicationProperties awsProperties() { + return this.awsProperties; + } + + /** + * Set the awsProperties property: AWS Properties. + * + * @param awsProperties the awsProperties value to set. + * @return the ElasticBeanstalkApplicationProperties object itself. + */ + public ElasticBeanstalkApplicationProperties + withAwsProperties(AwsElasticBeanstalkApplicationProperties awsProperties) { + this.awsProperties = awsProperties; + return this; + } + + /** + * Get the publicCloudConnectorsResourceId property: Public Cloud Connectors Resource ID. + * + * @return the publicCloudConnectorsResourceId value. + */ + public String publicCloudConnectorsResourceId() { + return this.publicCloudConnectorsResourceId; + } + + /** + * Set the publicCloudConnectorsResourceId property: Public Cloud Connectors Resource ID. + * + * @param publicCloudConnectorsResourceId the publicCloudConnectorsResourceId value to set. + * @return the ElasticBeanstalkApplicationProperties object itself. + */ + public ElasticBeanstalkApplicationProperties + withPublicCloudConnectorsResourceId(String publicCloudConnectorsResourceId) { + this.publicCloudConnectorsResourceId = publicCloudConnectorsResourceId; + return this; + } + + /** + * Get the awsAccountId property: AWS Account ID. + * + * @return the awsAccountId value. + */ + public String awsAccountId() { + return this.awsAccountId; + } + + /** + * Set the awsAccountId property: AWS Account ID. + * + * @param awsAccountId the awsAccountId value to set. + * @return the ElasticBeanstalkApplicationProperties object itself. + */ + public ElasticBeanstalkApplicationProperties withAwsAccountId(String awsAccountId) { + this.awsAccountId = awsAccountId; + return this; + } + + /** + * Get the arn property: Amazon Resource Name (ARN). + * + * @return the arn value. + */ + public String arn() { + return this.arn; + } + + /** + * Set the arn property: Amazon Resource Name (ARN). + * + * @param arn the arn value to set. + * @return the ElasticBeanstalkApplicationProperties object itself. + */ + public ElasticBeanstalkApplicationProperties withArn(String arn) { + this.arn = arn; + return this; + } + + /** + * Get the publicCloudResourceName property: Public Cloud Resource Name. + * + * @return the publicCloudResourceName value. + */ + public String publicCloudResourceName() { + return this.publicCloudResourceName; + } + + /** + * Set the publicCloudResourceName property: Public Cloud Resource Name. + * + * @param publicCloudResourceName the publicCloudResourceName value to set. + * @return the ElasticBeanstalkApplicationProperties object itself. + */ + public ElasticBeanstalkApplicationProperties withPublicCloudResourceName(String publicCloudResourceName) { + this.publicCloudResourceName = publicCloudResourceName; + return this; + } + + /** + * Get the awsSourceSchema property: AWS Source Schema. + * + * @return the awsSourceSchema value. + */ + public String awsSourceSchema() { + return this.awsSourceSchema; + } + + /** + * Set the awsSourceSchema property: AWS Source Schema. + * + * @param awsSourceSchema the awsSourceSchema value to set. + * @return the ElasticBeanstalkApplicationProperties object itself. + */ + public ElasticBeanstalkApplicationProperties withAwsSourceSchema(String awsSourceSchema) { + this.awsSourceSchema = awsSourceSchema; + return this; + } + + /** + * Get the awsRegion property: AWS Region. + * + * @return the awsRegion value. + */ + public String awsRegion() { + return this.awsRegion; + } + + /** + * Set the awsRegion property: AWS Region. + * + * @param awsRegion the awsRegion value to set. + * @return the ElasticBeanstalkApplicationProperties object itself. + */ + public ElasticBeanstalkApplicationProperties withAwsRegion(String awsRegion) { + this.awsRegion = awsRegion; + return this; + } + + /** + * Get the awsTags property: AWS Tags. + * + * @return the awsTags value. + */ + public Map awsTags() { + return this.awsTags; + } + + /** + * Set the awsTags property: AWS Tags. + * + * @param awsTags the awsTags value to set. + * @return the ElasticBeanstalkApplicationProperties object itself. + */ + public ElasticBeanstalkApplicationProperties withAwsTags(Map awsTags) { + this.awsTags = awsTags; + return this; + } + + /** + * Get the provisioningState property: The status of the last operation. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (awsProperties() != null) { + awsProperties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("awsProperties", this.awsProperties); + jsonWriter.writeStringField("publicCloudConnectorsResourceId", this.publicCloudConnectorsResourceId); + jsonWriter.writeStringField("awsAccountId", this.awsAccountId); + jsonWriter.writeStringField("arn", this.arn); + jsonWriter.writeStringField("publicCloudResourceName", this.publicCloudResourceName); + jsonWriter.writeStringField("awsSourceSchema", this.awsSourceSchema); + jsonWriter.writeStringField("awsRegion", this.awsRegion); + jsonWriter.writeMapField("awsTags", this.awsTags, (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ElasticBeanstalkApplicationProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ElasticBeanstalkApplicationProperties if the JsonReader was pointing to an instance of it, + * or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ElasticBeanstalkApplicationProperties. + */ + public static ElasticBeanstalkApplicationProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ElasticBeanstalkApplicationProperties deserializedElasticBeanstalkApplicationProperties + = new ElasticBeanstalkApplicationProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("awsProperties".equals(fieldName)) { + deserializedElasticBeanstalkApplicationProperties.awsProperties + = AwsElasticBeanstalkApplicationProperties.fromJson(reader); + } else if ("publicCloudConnectorsResourceId".equals(fieldName)) { + deserializedElasticBeanstalkApplicationProperties.publicCloudConnectorsResourceId + = reader.getString(); + } else if ("awsAccountId".equals(fieldName)) { + deserializedElasticBeanstalkApplicationProperties.awsAccountId = reader.getString(); + } else if ("arn".equals(fieldName)) { + deserializedElasticBeanstalkApplicationProperties.arn = reader.getString(); + } else if ("publicCloudResourceName".equals(fieldName)) { + deserializedElasticBeanstalkApplicationProperties.publicCloudResourceName = reader.getString(); + } else if ("awsSourceSchema".equals(fieldName)) { + deserializedElasticBeanstalkApplicationProperties.awsSourceSchema = reader.getString(); + } else if ("awsRegion".equals(fieldName)) { + deserializedElasticBeanstalkApplicationProperties.awsRegion = reader.getString(); + } else if ("awsTags".equals(fieldName)) { + Map awsTags = reader.readMap(reader1 -> reader1.getString()); + deserializedElasticBeanstalkApplicationProperties.awsTags = awsTags; + } else if ("provisioningState".equals(fieldName)) { + deserializedElasticBeanstalkApplicationProperties.provisioningState + = ProvisioningState.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedElasticBeanstalkApplicationProperties; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ElasticBeanstalkApplicationTagsUpdate.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ElasticBeanstalkApplicationTagsUpdate.java new file mode 100644 index 000000000000..32c83122ef02 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ElasticBeanstalkApplicationTagsUpdate.java @@ -0,0 +1,97 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.Map; + +/** + * The type used for updating tags in ElasticBeanstalkApplication resources. + */ +@Fluent +public final class ElasticBeanstalkApplicationTagsUpdate + implements JsonSerializable { + /* + * Resource tags. + */ + private Map tags; + + /** + * Creates an instance of ElasticBeanstalkApplicationTagsUpdate class. + */ + public ElasticBeanstalkApplicationTagsUpdate() { + } + + /** + * Get the tags property: Resource tags. + * + * @return the tags value. + */ + public Map tags() { + return this.tags; + } + + /** + * Set the tags property: Resource tags. + * + * @param tags the tags value to set. + * @return the ElasticBeanstalkApplicationTagsUpdate object itself. + */ + public ElasticBeanstalkApplicationTagsUpdate withTags(Map tags) { + this.tags = tags; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeMapField("tags", this.tags, (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ElasticBeanstalkApplicationTagsUpdate from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ElasticBeanstalkApplicationTagsUpdate if the JsonReader was pointing to an instance of it, + * or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ElasticBeanstalkApplicationTagsUpdate. + */ + public static ElasticBeanstalkApplicationTagsUpdate fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ElasticBeanstalkApplicationTagsUpdate deserializedElasticBeanstalkApplicationTagsUpdate + = new ElasticBeanstalkApplicationTagsUpdate(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedElasticBeanstalkApplicationTagsUpdate.tags = tags; + } else { + reader.skipChildren(); + } + } + + return deserializedElasticBeanstalkApplicationTagsUpdate; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ElasticBeanstalkApplications.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ElasticBeanstalkApplications.java new file mode 100644 index 000000000000..9815a68f1331 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ElasticBeanstalkApplications.java @@ -0,0 +1,162 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** + * Resource collection API of ElasticBeanstalkApplications. + */ +public interface ElasticBeanstalkApplications { + /** + * List ElasticBeanstalkApplication resources by subscription ID. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a ElasticBeanstalkApplication list operation as paginated response with + * {@link PagedIterable}. + */ + PagedIterable list(); + + /** + * List ElasticBeanstalkApplication resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a ElasticBeanstalkApplication list operation as paginated response with + * {@link PagedIterable}. + */ + PagedIterable list(Context context); + + /** + * List ElasticBeanstalkApplication resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a ElasticBeanstalkApplication list operation as paginated response with + * {@link PagedIterable}. + */ + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * List ElasticBeanstalkApplication resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a ElasticBeanstalkApplication list operation as paginated response with + * {@link PagedIterable}. + */ + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Get a ElasticBeanstalkApplication. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ElasticBeanstalkApplication. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a ElasticBeanstalkApplication along with {@link Response}. + */ + Response getByResourceGroupWithResponse(String resourceGroupName, String name, + Context context); + + /** + * Get a ElasticBeanstalkApplication. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ElasticBeanstalkApplication. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a ElasticBeanstalkApplication. + */ + ElasticBeanstalkApplication getByResourceGroup(String resourceGroupName, String name); + + /** + * Delete a ElasticBeanstalkApplication. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ElasticBeanstalkApplication. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByResourceGroup(String resourceGroupName, String name); + + /** + * Delete a ElasticBeanstalkApplication. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ElasticBeanstalkApplication. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String name, Context context); + + /** + * Get a ElasticBeanstalkApplication. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a ElasticBeanstalkApplication along with {@link Response}. + */ + ElasticBeanstalkApplication getById(String id); + + /** + * Get a ElasticBeanstalkApplication. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a ElasticBeanstalkApplication along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Delete a ElasticBeanstalkApplication. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteById(String id); + + /** + * Delete a ElasticBeanstalkApplication. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new ElasticBeanstalkApplication resource. + * + * @param name resource name. + * @return the first stage of the new ElasticBeanstalkApplication definition. + */ + ElasticBeanstalkApplication.DefinitionStages.Blank define(String name); +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ElasticBeanstalkConfigurationTemplate.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ElasticBeanstalkConfigurationTemplate.java new file mode 100644 index 000000000000..fd33d0dc1df1 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ElasticBeanstalkConfigurationTemplate.java @@ -0,0 +1,253 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.awsconnector.fluent.models.ElasticBeanstalkConfigurationTemplateInner; +import java.util.Map; + +/** + * An immutable client-side representation of ElasticBeanstalkConfigurationTemplate. + */ +public interface ElasticBeanstalkConfigurationTemplate { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the location property: The geo-location where the resource lives. + * + * @return the location value. + */ + String location(); + + /** + * Gets the tags property: Resource tags. + * + * @return the tags value. + */ + Map tags(); + + /** + * Gets the properties property: The resource-specific properties for this resource. + * + * @return the properties value. + */ + ElasticBeanstalkConfigurationTemplateProperties properties(); + + /** + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the region of the resource. + * + * @return the region of the resource. + */ + Region region(); + + /** + * Gets the name of the resource region. + * + * @return the name of the resource region. + */ + String regionName(); + + /** + * Gets the name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + + /** + * Gets the inner com.azure.resourcemanager.awsconnector.fluent.models.ElasticBeanstalkConfigurationTemplateInner + * object. + * + * @return the inner object. + */ + ElasticBeanstalkConfigurationTemplateInner innerModel(); + + /** + * The entirety of the ElasticBeanstalkConfigurationTemplate definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithLocation, + DefinitionStages.WithResourceGroup, DefinitionStages.WithCreate { + } + + /** + * The ElasticBeanstalkConfigurationTemplate definition stages. + */ + interface DefinitionStages { + /** + * The first stage of the ElasticBeanstalkConfigurationTemplate definition. + */ + interface Blank extends WithLocation { + } + + /** + * The stage of the ElasticBeanstalkConfigurationTemplate definition allowing to specify location. + */ + interface WithLocation { + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithResourceGroup withRegion(Region location); + + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithResourceGroup withRegion(String location); + } + + /** + * The stage of the ElasticBeanstalkConfigurationTemplate definition allowing to specify parent resource. + */ + interface WithResourceGroup { + /** + * Specifies resourceGroupName. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @return the next definition stage. + */ + WithCreate withExistingResourceGroup(String resourceGroupName); + } + + /** + * The stage of the ElasticBeanstalkConfigurationTemplate 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.WithProperties { + /** + * Executes the create request. + * + * @return the created resource. + */ + ElasticBeanstalkConfigurationTemplate create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + ElasticBeanstalkConfigurationTemplate create(Context context); + } + + /** + * The stage of the ElasticBeanstalkConfigurationTemplate definition allowing to specify tags. + */ + interface WithTags { + /** + * Specifies the tags property: Resource tags.. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + WithCreate withTags(Map tags); + } + + /** + * The stage of the ElasticBeanstalkConfigurationTemplate definition allowing to specify properties. + */ + interface WithProperties { + /** + * Specifies the properties property: The resource-specific properties for this resource.. + * + * @param properties The resource-specific properties for this resource. + * @return the next definition stage. + */ + WithCreate withProperties(ElasticBeanstalkConfigurationTemplateProperties properties); + } + } + + /** + * Begins update for the ElasticBeanstalkConfigurationTemplate resource. + * + * @return the stage of resource update. + */ + ElasticBeanstalkConfigurationTemplate.Update update(); + + /** + * The template for ElasticBeanstalkConfigurationTemplate update. + */ + interface Update extends UpdateStages.WithTags { + /** + * Executes the update request. + * + * @return the updated resource. + */ + ElasticBeanstalkConfigurationTemplate apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + ElasticBeanstalkConfigurationTemplate apply(Context context); + } + + /** + * The ElasticBeanstalkConfigurationTemplate update stages. + */ + interface UpdateStages { + /** + * The stage of the ElasticBeanstalkConfigurationTemplate update allowing to specify tags. + */ + interface WithTags { + /** + * Specifies the tags property: Resource tags.. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + Update withTags(Map tags); + } + } + + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + ElasticBeanstalkConfigurationTemplate refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + ElasticBeanstalkConfigurationTemplate refresh(Context context); +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ElasticBeanstalkConfigurationTemplateListResult.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ElasticBeanstalkConfigurationTemplateListResult.java new file mode 100644 index 000000000000..3becbdc58085 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ElasticBeanstalkConfigurationTemplateListResult.java @@ -0,0 +1,139 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.awsconnector.fluent.models.ElasticBeanstalkConfigurationTemplateInner; +import java.io.IOException; +import java.util.List; + +/** + * The response of a ElasticBeanstalkConfigurationTemplate list operation. + */ +@Fluent +public final class ElasticBeanstalkConfigurationTemplateListResult + implements JsonSerializable { + /* + * The ElasticBeanstalkConfigurationTemplate items on this page + */ + private List value; + + /* + * The link to the next page of items + */ + private String nextLink; + + /** + * Creates an instance of ElasticBeanstalkConfigurationTemplateListResult class. + */ + public ElasticBeanstalkConfigurationTemplateListResult() { + } + + /** + * Get the value property: The ElasticBeanstalkConfigurationTemplate items on this page. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The ElasticBeanstalkConfigurationTemplate items on this page. + * + * @param value the value value to set. + * @return the ElasticBeanstalkConfigurationTemplateListResult object itself. + */ + public ElasticBeanstalkConfigurationTemplateListResult + withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The link to the next page of items. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: The link to the next page of items. + * + * @param nextLink the nextLink value to set. + * @return the ElasticBeanstalkConfigurationTemplateListResult object itself. + */ + public ElasticBeanstalkConfigurationTemplateListResult withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property value in model ElasticBeanstalkConfigurationTemplateListResult")); + } else { + value().forEach(e -> e.validate()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(ElasticBeanstalkConfigurationTemplateListResult.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("nextLink", this.nextLink); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ElasticBeanstalkConfigurationTemplateListResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ElasticBeanstalkConfigurationTemplateListResult if the JsonReader was pointing to an + * instance of it, or null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the ElasticBeanstalkConfigurationTemplateListResult. + */ + public static ElasticBeanstalkConfigurationTemplateListResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ElasticBeanstalkConfigurationTemplateListResult deserializedElasticBeanstalkConfigurationTemplateListResult + = new ElasticBeanstalkConfigurationTemplateListResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> ElasticBeanstalkConfigurationTemplateInner.fromJson(reader1)); + deserializedElasticBeanstalkConfigurationTemplateListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedElasticBeanstalkConfigurationTemplateListResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedElasticBeanstalkConfigurationTemplateListResult; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ElasticBeanstalkConfigurationTemplateProperties.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ElasticBeanstalkConfigurationTemplateProperties.java new file mode 100644 index 000000000000..f0b9d2b4ca37 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ElasticBeanstalkConfigurationTemplateProperties.java @@ -0,0 +1,318 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.Map; + +/** + * Definition of ElasticBeanstalkConfigurationTemplate. + */ +@Fluent +public final class ElasticBeanstalkConfigurationTemplateProperties + implements JsonSerializable { + /* + * AWS Properties + */ + private AwsElasticBeanstalkConfigurationTemplateProperties awsProperties; + + /* + * Public Cloud Connectors Resource ID + */ + private String publicCloudConnectorsResourceId; + + /* + * AWS Account ID + */ + private String awsAccountId; + + /* + * Amazon Resource Name (ARN) + */ + private String arn; + + /* + * Public Cloud Resource Name + */ + private String publicCloudResourceName; + + /* + * AWS Source Schema + */ + private String awsSourceSchema; + + /* + * AWS Region + */ + private String awsRegion; + + /* + * AWS Tags + */ + private Map awsTags; + + /* + * The status of the last operation. + */ + private ProvisioningState provisioningState; + + /** + * Creates an instance of ElasticBeanstalkConfigurationTemplateProperties class. + */ + public ElasticBeanstalkConfigurationTemplateProperties() { + } + + /** + * Get the awsProperties property: AWS Properties. + * + * @return the awsProperties value. + */ + public AwsElasticBeanstalkConfigurationTemplateProperties awsProperties() { + return this.awsProperties; + } + + /** + * Set the awsProperties property: AWS Properties. + * + * @param awsProperties the awsProperties value to set. + * @return the ElasticBeanstalkConfigurationTemplateProperties object itself. + */ + public ElasticBeanstalkConfigurationTemplateProperties + withAwsProperties(AwsElasticBeanstalkConfigurationTemplateProperties awsProperties) { + this.awsProperties = awsProperties; + return this; + } + + /** + * Get the publicCloudConnectorsResourceId property: Public Cloud Connectors Resource ID. + * + * @return the publicCloudConnectorsResourceId value. + */ + public String publicCloudConnectorsResourceId() { + return this.publicCloudConnectorsResourceId; + } + + /** + * Set the publicCloudConnectorsResourceId property: Public Cloud Connectors Resource ID. + * + * @param publicCloudConnectorsResourceId the publicCloudConnectorsResourceId value to set. + * @return the ElasticBeanstalkConfigurationTemplateProperties object itself. + */ + public ElasticBeanstalkConfigurationTemplateProperties + withPublicCloudConnectorsResourceId(String publicCloudConnectorsResourceId) { + this.publicCloudConnectorsResourceId = publicCloudConnectorsResourceId; + return this; + } + + /** + * Get the awsAccountId property: AWS Account ID. + * + * @return the awsAccountId value. + */ + public String awsAccountId() { + return this.awsAccountId; + } + + /** + * Set the awsAccountId property: AWS Account ID. + * + * @param awsAccountId the awsAccountId value to set. + * @return the ElasticBeanstalkConfigurationTemplateProperties object itself. + */ + public ElasticBeanstalkConfigurationTemplateProperties withAwsAccountId(String awsAccountId) { + this.awsAccountId = awsAccountId; + return this; + } + + /** + * Get the arn property: Amazon Resource Name (ARN). + * + * @return the arn value. + */ + public String arn() { + return this.arn; + } + + /** + * Set the arn property: Amazon Resource Name (ARN). + * + * @param arn the arn value to set. + * @return the ElasticBeanstalkConfigurationTemplateProperties object itself. + */ + public ElasticBeanstalkConfigurationTemplateProperties withArn(String arn) { + this.arn = arn; + return this; + } + + /** + * Get the publicCloudResourceName property: Public Cloud Resource Name. + * + * @return the publicCloudResourceName value. + */ + public String publicCloudResourceName() { + return this.publicCloudResourceName; + } + + /** + * Set the publicCloudResourceName property: Public Cloud Resource Name. + * + * @param publicCloudResourceName the publicCloudResourceName value to set. + * @return the ElasticBeanstalkConfigurationTemplateProperties object itself. + */ + public ElasticBeanstalkConfigurationTemplateProperties withPublicCloudResourceName(String publicCloudResourceName) { + this.publicCloudResourceName = publicCloudResourceName; + return this; + } + + /** + * Get the awsSourceSchema property: AWS Source Schema. + * + * @return the awsSourceSchema value. + */ + public String awsSourceSchema() { + return this.awsSourceSchema; + } + + /** + * Set the awsSourceSchema property: AWS Source Schema. + * + * @param awsSourceSchema the awsSourceSchema value to set. + * @return the ElasticBeanstalkConfigurationTemplateProperties object itself. + */ + public ElasticBeanstalkConfigurationTemplateProperties withAwsSourceSchema(String awsSourceSchema) { + this.awsSourceSchema = awsSourceSchema; + return this; + } + + /** + * Get the awsRegion property: AWS Region. + * + * @return the awsRegion value. + */ + public String awsRegion() { + return this.awsRegion; + } + + /** + * Set the awsRegion property: AWS Region. + * + * @param awsRegion the awsRegion value to set. + * @return the ElasticBeanstalkConfigurationTemplateProperties object itself. + */ + public ElasticBeanstalkConfigurationTemplateProperties withAwsRegion(String awsRegion) { + this.awsRegion = awsRegion; + return this; + } + + /** + * Get the awsTags property: AWS Tags. + * + * @return the awsTags value. + */ + public Map awsTags() { + return this.awsTags; + } + + /** + * Set the awsTags property: AWS Tags. + * + * @param awsTags the awsTags value to set. + * @return the ElasticBeanstalkConfigurationTemplateProperties object itself. + */ + public ElasticBeanstalkConfigurationTemplateProperties withAwsTags(Map awsTags) { + this.awsTags = awsTags; + return this; + } + + /** + * Get the provisioningState property: The status of the last operation. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (awsProperties() != null) { + awsProperties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("awsProperties", this.awsProperties); + jsonWriter.writeStringField("publicCloudConnectorsResourceId", this.publicCloudConnectorsResourceId); + jsonWriter.writeStringField("awsAccountId", this.awsAccountId); + jsonWriter.writeStringField("arn", this.arn); + jsonWriter.writeStringField("publicCloudResourceName", this.publicCloudResourceName); + jsonWriter.writeStringField("awsSourceSchema", this.awsSourceSchema); + jsonWriter.writeStringField("awsRegion", this.awsRegion); + jsonWriter.writeMapField("awsTags", this.awsTags, (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ElasticBeanstalkConfigurationTemplateProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ElasticBeanstalkConfigurationTemplateProperties if the JsonReader was pointing to an + * instance of it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ElasticBeanstalkConfigurationTemplateProperties. + */ + public static ElasticBeanstalkConfigurationTemplateProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ElasticBeanstalkConfigurationTemplateProperties deserializedElasticBeanstalkConfigurationTemplateProperties + = new ElasticBeanstalkConfigurationTemplateProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("awsProperties".equals(fieldName)) { + deserializedElasticBeanstalkConfigurationTemplateProperties.awsProperties + = AwsElasticBeanstalkConfigurationTemplateProperties.fromJson(reader); + } else if ("publicCloudConnectorsResourceId".equals(fieldName)) { + deserializedElasticBeanstalkConfigurationTemplateProperties.publicCloudConnectorsResourceId + = reader.getString(); + } else if ("awsAccountId".equals(fieldName)) { + deserializedElasticBeanstalkConfigurationTemplateProperties.awsAccountId = reader.getString(); + } else if ("arn".equals(fieldName)) { + deserializedElasticBeanstalkConfigurationTemplateProperties.arn = reader.getString(); + } else if ("publicCloudResourceName".equals(fieldName)) { + deserializedElasticBeanstalkConfigurationTemplateProperties.publicCloudResourceName + = reader.getString(); + } else if ("awsSourceSchema".equals(fieldName)) { + deserializedElasticBeanstalkConfigurationTemplateProperties.awsSourceSchema = reader.getString(); + } else if ("awsRegion".equals(fieldName)) { + deserializedElasticBeanstalkConfigurationTemplateProperties.awsRegion = reader.getString(); + } else if ("awsTags".equals(fieldName)) { + Map awsTags = reader.readMap(reader1 -> reader1.getString()); + deserializedElasticBeanstalkConfigurationTemplateProperties.awsTags = awsTags; + } else if ("provisioningState".equals(fieldName)) { + deserializedElasticBeanstalkConfigurationTemplateProperties.provisioningState + = ProvisioningState.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedElasticBeanstalkConfigurationTemplateProperties; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ElasticBeanstalkConfigurationTemplateTagsUpdate.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ElasticBeanstalkConfigurationTemplateTagsUpdate.java new file mode 100644 index 000000000000..e6b22cc71bc0 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ElasticBeanstalkConfigurationTemplateTagsUpdate.java @@ -0,0 +1,97 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.Map; + +/** + * The type used for updating tags in ElasticBeanstalkConfigurationTemplate resources. + */ +@Fluent +public final class ElasticBeanstalkConfigurationTemplateTagsUpdate + implements JsonSerializable { + /* + * Resource tags. + */ + private Map tags; + + /** + * Creates an instance of ElasticBeanstalkConfigurationTemplateTagsUpdate class. + */ + public ElasticBeanstalkConfigurationTemplateTagsUpdate() { + } + + /** + * Get the tags property: Resource tags. + * + * @return the tags value. + */ + public Map tags() { + return this.tags; + } + + /** + * Set the tags property: Resource tags. + * + * @param tags the tags value to set. + * @return the ElasticBeanstalkConfigurationTemplateTagsUpdate object itself. + */ + public ElasticBeanstalkConfigurationTemplateTagsUpdate withTags(Map tags) { + this.tags = tags; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeMapField("tags", this.tags, (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ElasticBeanstalkConfigurationTemplateTagsUpdate from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ElasticBeanstalkConfigurationTemplateTagsUpdate if the JsonReader was pointing to an + * instance of it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ElasticBeanstalkConfigurationTemplateTagsUpdate. + */ + public static ElasticBeanstalkConfigurationTemplateTagsUpdate fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ElasticBeanstalkConfigurationTemplateTagsUpdate deserializedElasticBeanstalkConfigurationTemplateTagsUpdate + = new ElasticBeanstalkConfigurationTemplateTagsUpdate(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedElasticBeanstalkConfigurationTemplateTagsUpdate.tags = tags; + } else { + reader.skipChildren(); + } + } + + return deserializedElasticBeanstalkConfigurationTemplateTagsUpdate; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ElasticBeanstalkConfigurationTemplates.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ElasticBeanstalkConfigurationTemplates.java new file mode 100644 index 000000000000..49c215abe526 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ElasticBeanstalkConfigurationTemplates.java @@ -0,0 +1,162 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** + * Resource collection API of ElasticBeanstalkConfigurationTemplates. + */ +public interface ElasticBeanstalkConfigurationTemplates { + /** + * List ElasticBeanstalkConfigurationTemplate resources by subscription ID. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a ElasticBeanstalkConfigurationTemplate list operation as paginated response with + * {@link PagedIterable}. + */ + PagedIterable list(); + + /** + * List ElasticBeanstalkConfigurationTemplate resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a ElasticBeanstalkConfigurationTemplate list operation as paginated response with + * {@link PagedIterable}. + */ + PagedIterable list(Context context); + + /** + * List ElasticBeanstalkConfigurationTemplate resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a ElasticBeanstalkConfigurationTemplate list operation as paginated response with + * {@link PagedIterable}. + */ + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * List ElasticBeanstalkConfigurationTemplate resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a ElasticBeanstalkConfigurationTemplate list operation as paginated response with + * {@link PagedIterable}. + */ + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Get a ElasticBeanstalkConfigurationTemplate. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ElasticBeanstalkConfigurationTemplate. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a ElasticBeanstalkConfigurationTemplate along with {@link Response}. + */ + Response getByResourceGroupWithResponse(String resourceGroupName, + String name, Context context); + + /** + * Get a ElasticBeanstalkConfigurationTemplate. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ElasticBeanstalkConfigurationTemplate. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a ElasticBeanstalkConfigurationTemplate. + */ + ElasticBeanstalkConfigurationTemplate getByResourceGroup(String resourceGroupName, String name); + + /** + * Delete a ElasticBeanstalkConfigurationTemplate. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ElasticBeanstalkConfigurationTemplate. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByResourceGroup(String resourceGroupName, String name); + + /** + * Delete a ElasticBeanstalkConfigurationTemplate. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ElasticBeanstalkConfigurationTemplate. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String name, Context context); + + /** + * Get a ElasticBeanstalkConfigurationTemplate. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a ElasticBeanstalkConfigurationTemplate along with {@link Response}. + */ + ElasticBeanstalkConfigurationTemplate getById(String id); + + /** + * Get a ElasticBeanstalkConfigurationTemplate. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a ElasticBeanstalkConfigurationTemplate along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Delete a ElasticBeanstalkConfigurationTemplate. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteById(String id); + + /** + * Delete a ElasticBeanstalkConfigurationTemplate. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new ElasticBeanstalkConfigurationTemplate resource. + * + * @param name resource name. + * @return the first stage of the new ElasticBeanstalkConfigurationTemplate definition. + */ + ElasticBeanstalkConfigurationTemplate.DefinitionStages.Blank define(String name); +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ElasticBeanstalkEnvironment.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ElasticBeanstalkEnvironment.java new file mode 100644 index 000000000000..87a021bdca03 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ElasticBeanstalkEnvironment.java @@ -0,0 +1,252 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.awsconnector.fluent.models.ElasticBeanstalkEnvironmentInner; +import java.util.Map; + +/** + * An immutable client-side representation of ElasticBeanstalkEnvironment. + */ +public interface ElasticBeanstalkEnvironment { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the location property: The geo-location where the resource lives. + * + * @return the location value. + */ + String location(); + + /** + * Gets the tags property: Resource tags. + * + * @return the tags value. + */ + Map tags(); + + /** + * Gets the properties property: The resource-specific properties for this resource. + * + * @return the properties value. + */ + ElasticBeanstalkEnvironmentProperties properties(); + + /** + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the region of the resource. + * + * @return the region of the resource. + */ + Region region(); + + /** + * Gets the name of the resource region. + * + * @return the name of the resource region. + */ + String regionName(); + + /** + * Gets the name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + + /** + * Gets the inner com.azure.resourcemanager.awsconnector.fluent.models.ElasticBeanstalkEnvironmentInner object. + * + * @return the inner object. + */ + ElasticBeanstalkEnvironmentInner innerModel(); + + /** + * The entirety of the ElasticBeanstalkEnvironment definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithLocation, + DefinitionStages.WithResourceGroup, DefinitionStages.WithCreate { + } + + /** + * The ElasticBeanstalkEnvironment definition stages. + */ + interface DefinitionStages { + /** + * The first stage of the ElasticBeanstalkEnvironment definition. + */ + interface Blank extends WithLocation { + } + + /** + * The stage of the ElasticBeanstalkEnvironment definition allowing to specify location. + */ + interface WithLocation { + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithResourceGroup withRegion(Region location); + + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithResourceGroup withRegion(String location); + } + + /** + * The stage of the ElasticBeanstalkEnvironment definition allowing to specify parent resource. + */ + interface WithResourceGroup { + /** + * Specifies resourceGroupName. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @return the next definition stage. + */ + WithCreate withExistingResourceGroup(String resourceGroupName); + } + + /** + * The stage of the ElasticBeanstalkEnvironment 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.WithProperties { + /** + * Executes the create request. + * + * @return the created resource. + */ + ElasticBeanstalkEnvironment create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + ElasticBeanstalkEnvironment create(Context context); + } + + /** + * The stage of the ElasticBeanstalkEnvironment definition allowing to specify tags. + */ + interface WithTags { + /** + * Specifies the tags property: Resource tags.. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + WithCreate withTags(Map tags); + } + + /** + * The stage of the ElasticBeanstalkEnvironment definition allowing to specify properties. + */ + interface WithProperties { + /** + * Specifies the properties property: The resource-specific properties for this resource.. + * + * @param properties The resource-specific properties for this resource. + * @return the next definition stage. + */ + WithCreate withProperties(ElasticBeanstalkEnvironmentProperties properties); + } + } + + /** + * Begins update for the ElasticBeanstalkEnvironment resource. + * + * @return the stage of resource update. + */ + ElasticBeanstalkEnvironment.Update update(); + + /** + * The template for ElasticBeanstalkEnvironment update. + */ + interface Update extends UpdateStages.WithTags { + /** + * Executes the update request. + * + * @return the updated resource. + */ + ElasticBeanstalkEnvironment apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + ElasticBeanstalkEnvironment apply(Context context); + } + + /** + * The ElasticBeanstalkEnvironment update stages. + */ + interface UpdateStages { + /** + * The stage of the ElasticBeanstalkEnvironment update allowing to specify tags. + */ + interface WithTags { + /** + * Specifies the tags property: Resource tags.. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + Update withTags(Map tags); + } + } + + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + ElasticBeanstalkEnvironment refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + ElasticBeanstalkEnvironment refresh(Context context); +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ElasticBeanstalkEnvironmentListResult.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ElasticBeanstalkEnvironmentListResult.java new file mode 100644 index 000000000000..7d1001038f3c --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ElasticBeanstalkEnvironmentListResult.java @@ -0,0 +1,138 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.awsconnector.fluent.models.ElasticBeanstalkEnvironmentInner; +import java.io.IOException; +import java.util.List; + +/** + * The response of a ElasticBeanstalkEnvironment list operation. + */ +@Fluent +public final class ElasticBeanstalkEnvironmentListResult + implements JsonSerializable { + /* + * The ElasticBeanstalkEnvironment items on this page + */ + private List value; + + /* + * The link to the next page of items + */ + private String nextLink; + + /** + * Creates an instance of ElasticBeanstalkEnvironmentListResult class. + */ + public ElasticBeanstalkEnvironmentListResult() { + } + + /** + * Get the value property: The ElasticBeanstalkEnvironment items on this page. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The ElasticBeanstalkEnvironment items on this page. + * + * @param value the value value to set. + * @return the ElasticBeanstalkEnvironmentListResult object itself. + */ + public ElasticBeanstalkEnvironmentListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The link to the next page of items. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: The link to the next page of items. + * + * @param nextLink the nextLink value to set. + * @return the ElasticBeanstalkEnvironmentListResult object itself. + */ + public ElasticBeanstalkEnvironmentListResult withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property value in model ElasticBeanstalkEnvironmentListResult")); + } else { + value().forEach(e -> e.validate()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(ElasticBeanstalkEnvironmentListResult.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("nextLink", this.nextLink); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ElasticBeanstalkEnvironmentListResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ElasticBeanstalkEnvironmentListResult if the JsonReader was pointing to an instance of it, + * or null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the ElasticBeanstalkEnvironmentListResult. + */ + public static ElasticBeanstalkEnvironmentListResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ElasticBeanstalkEnvironmentListResult deserializedElasticBeanstalkEnvironmentListResult + = new ElasticBeanstalkEnvironmentListResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> ElasticBeanstalkEnvironmentInner.fromJson(reader1)); + deserializedElasticBeanstalkEnvironmentListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedElasticBeanstalkEnvironmentListResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedElasticBeanstalkEnvironmentListResult; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ElasticBeanstalkEnvironmentProperties.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ElasticBeanstalkEnvironmentProperties.java new file mode 100644 index 000000000000..9a4b48798647 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ElasticBeanstalkEnvironmentProperties.java @@ -0,0 +1,317 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.Map; + +/** + * Definition of ElasticBeanstalkEnvironment. + */ +@Fluent +public final class ElasticBeanstalkEnvironmentProperties + implements JsonSerializable { + /* + * AWS Properties + */ + private AwsElasticBeanstalkEnvironmentProperties awsProperties; + + /* + * Public Cloud Connectors Resource ID + */ + private String publicCloudConnectorsResourceId; + + /* + * AWS Account ID + */ + private String awsAccountId; + + /* + * Amazon Resource Name (ARN) + */ + private String arn; + + /* + * Public Cloud Resource Name + */ + private String publicCloudResourceName; + + /* + * AWS Source Schema + */ + private String awsSourceSchema; + + /* + * AWS Region + */ + private String awsRegion; + + /* + * AWS Tags + */ + private Map awsTags; + + /* + * The status of the last operation. + */ + private ProvisioningState provisioningState; + + /** + * Creates an instance of ElasticBeanstalkEnvironmentProperties class. + */ + public ElasticBeanstalkEnvironmentProperties() { + } + + /** + * Get the awsProperties property: AWS Properties. + * + * @return the awsProperties value. + */ + public AwsElasticBeanstalkEnvironmentProperties awsProperties() { + return this.awsProperties; + } + + /** + * Set the awsProperties property: AWS Properties. + * + * @param awsProperties the awsProperties value to set. + * @return the ElasticBeanstalkEnvironmentProperties object itself. + */ + public ElasticBeanstalkEnvironmentProperties + withAwsProperties(AwsElasticBeanstalkEnvironmentProperties awsProperties) { + this.awsProperties = awsProperties; + return this; + } + + /** + * Get the publicCloudConnectorsResourceId property: Public Cloud Connectors Resource ID. + * + * @return the publicCloudConnectorsResourceId value. + */ + public String publicCloudConnectorsResourceId() { + return this.publicCloudConnectorsResourceId; + } + + /** + * Set the publicCloudConnectorsResourceId property: Public Cloud Connectors Resource ID. + * + * @param publicCloudConnectorsResourceId the publicCloudConnectorsResourceId value to set. + * @return the ElasticBeanstalkEnvironmentProperties object itself. + */ + public ElasticBeanstalkEnvironmentProperties + withPublicCloudConnectorsResourceId(String publicCloudConnectorsResourceId) { + this.publicCloudConnectorsResourceId = publicCloudConnectorsResourceId; + return this; + } + + /** + * Get the awsAccountId property: AWS Account ID. + * + * @return the awsAccountId value. + */ + public String awsAccountId() { + return this.awsAccountId; + } + + /** + * Set the awsAccountId property: AWS Account ID. + * + * @param awsAccountId the awsAccountId value to set. + * @return the ElasticBeanstalkEnvironmentProperties object itself. + */ + public ElasticBeanstalkEnvironmentProperties withAwsAccountId(String awsAccountId) { + this.awsAccountId = awsAccountId; + return this; + } + + /** + * Get the arn property: Amazon Resource Name (ARN). + * + * @return the arn value. + */ + public String arn() { + return this.arn; + } + + /** + * Set the arn property: Amazon Resource Name (ARN). + * + * @param arn the arn value to set. + * @return the ElasticBeanstalkEnvironmentProperties object itself. + */ + public ElasticBeanstalkEnvironmentProperties withArn(String arn) { + this.arn = arn; + return this; + } + + /** + * Get the publicCloudResourceName property: Public Cloud Resource Name. + * + * @return the publicCloudResourceName value. + */ + public String publicCloudResourceName() { + return this.publicCloudResourceName; + } + + /** + * Set the publicCloudResourceName property: Public Cloud Resource Name. + * + * @param publicCloudResourceName the publicCloudResourceName value to set. + * @return the ElasticBeanstalkEnvironmentProperties object itself. + */ + public ElasticBeanstalkEnvironmentProperties withPublicCloudResourceName(String publicCloudResourceName) { + this.publicCloudResourceName = publicCloudResourceName; + return this; + } + + /** + * Get the awsSourceSchema property: AWS Source Schema. + * + * @return the awsSourceSchema value. + */ + public String awsSourceSchema() { + return this.awsSourceSchema; + } + + /** + * Set the awsSourceSchema property: AWS Source Schema. + * + * @param awsSourceSchema the awsSourceSchema value to set. + * @return the ElasticBeanstalkEnvironmentProperties object itself. + */ + public ElasticBeanstalkEnvironmentProperties withAwsSourceSchema(String awsSourceSchema) { + this.awsSourceSchema = awsSourceSchema; + return this; + } + + /** + * Get the awsRegion property: AWS Region. + * + * @return the awsRegion value. + */ + public String awsRegion() { + return this.awsRegion; + } + + /** + * Set the awsRegion property: AWS Region. + * + * @param awsRegion the awsRegion value to set. + * @return the ElasticBeanstalkEnvironmentProperties object itself. + */ + public ElasticBeanstalkEnvironmentProperties withAwsRegion(String awsRegion) { + this.awsRegion = awsRegion; + return this; + } + + /** + * Get the awsTags property: AWS Tags. + * + * @return the awsTags value. + */ + public Map awsTags() { + return this.awsTags; + } + + /** + * Set the awsTags property: AWS Tags. + * + * @param awsTags the awsTags value to set. + * @return the ElasticBeanstalkEnvironmentProperties object itself. + */ + public ElasticBeanstalkEnvironmentProperties withAwsTags(Map awsTags) { + this.awsTags = awsTags; + return this; + } + + /** + * Get the provisioningState property: The status of the last operation. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (awsProperties() != null) { + awsProperties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("awsProperties", this.awsProperties); + jsonWriter.writeStringField("publicCloudConnectorsResourceId", this.publicCloudConnectorsResourceId); + jsonWriter.writeStringField("awsAccountId", this.awsAccountId); + jsonWriter.writeStringField("arn", this.arn); + jsonWriter.writeStringField("publicCloudResourceName", this.publicCloudResourceName); + jsonWriter.writeStringField("awsSourceSchema", this.awsSourceSchema); + jsonWriter.writeStringField("awsRegion", this.awsRegion); + jsonWriter.writeMapField("awsTags", this.awsTags, (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ElasticBeanstalkEnvironmentProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ElasticBeanstalkEnvironmentProperties if the JsonReader was pointing to an instance of it, + * or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ElasticBeanstalkEnvironmentProperties. + */ + public static ElasticBeanstalkEnvironmentProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ElasticBeanstalkEnvironmentProperties deserializedElasticBeanstalkEnvironmentProperties + = new ElasticBeanstalkEnvironmentProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("awsProperties".equals(fieldName)) { + deserializedElasticBeanstalkEnvironmentProperties.awsProperties + = AwsElasticBeanstalkEnvironmentProperties.fromJson(reader); + } else if ("publicCloudConnectorsResourceId".equals(fieldName)) { + deserializedElasticBeanstalkEnvironmentProperties.publicCloudConnectorsResourceId + = reader.getString(); + } else if ("awsAccountId".equals(fieldName)) { + deserializedElasticBeanstalkEnvironmentProperties.awsAccountId = reader.getString(); + } else if ("arn".equals(fieldName)) { + deserializedElasticBeanstalkEnvironmentProperties.arn = reader.getString(); + } else if ("publicCloudResourceName".equals(fieldName)) { + deserializedElasticBeanstalkEnvironmentProperties.publicCloudResourceName = reader.getString(); + } else if ("awsSourceSchema".equals(fieldName)) { + deserializedElasticBeanstalkEnvironmentProperties.awsSourceSchema = reader.getString(); + } else if ("awsRegion".equals(fieldName)) { + deserializedElasticBeanstalkEnvironmentProperties.awsRegion = reader.getString(); + } else if ("awsTags".equals(fieldName)) { + Map awsTags = reader.readMap(reader1 -> reader1.getString()); + deserializedElasticBeanstalkEnvironmentProperties.awsTags = awsTags; + } else if ("provisioningState".equals(fieldName)) { + deserializedElasticBeanstalkEnvironmentProperties.provisioningState + = ProvisioningState.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedElasticBeanstalkEnvironmentProperties; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ElasticBeanstalkEnvironmentTagsUpdate.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ElasticBeanstalkEnvironmentTagsUpdate.java new file mode 100644 index 000000000000..9b3ddfc05bdb --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ElasticBeanstalkEnvironmentTagsUpdate.java @@ -0,0 +1,97 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.Map; + +/** + * The type used for updating tags in ElasticBeanstalkEnvironment resources. + */ +@Fluent +public final class ElasticBeanstalkEnvironmentTagsUpdate + implements JsonSerializable { + /* + * Resource tags. + */ + private Map tags; + + /** + * Creates an instance of ElasticBeanstalkEnvironmentTagsUpdate class. + */ + public ElasticBeanstalkEnvironmentTagsUpdate() { + } + + /** + * Get the tags property: Resource tags. + * + * @return the tags value. + */ + public Map tags() { + return this.tags; + } + + /** + * Set the tags property: Resource tags. + * + * @param tags the tags value to set. + * @return the ElasticBeanstalkEnvironmentTagsUpdate object itself. + */ + public ElasticBeanstalkEnvironmentTagsUpdate withTags(Map tags) { + this.tags = tags; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeMapField("tags", this.tags, (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ElasticBeanstalkEnvironmentTagsUpdate from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ElasticBeanstalkEnvironmentTagsUpdate if the JsonReader was pointing to an instance of it, + * or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ElasticBeanstalkEnvironmentTagsUpdate. + */ + public static ElasticBeanstalkEnvironmentTagsUpdate fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ElasticBeanstalkEnvironmentTagsUpdate deserializedElasticBeanstalkEnvironmentTagsUpdate + = new ElasticBeanstalkEnvironmentTagsUpdate(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedElasticBeanstalkEnvironmentTagsUpdate.tags = tags; + } else { + reader.skipChildren(); + } + } + + return deserializedElasticBeanstalkEnvironmentTagsUpdate; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ElasticBeanstalkEnvironments.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ElasticBeanstalkEnvironments.java new file mode 100644 index 000000000000..933a858a1a1a --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ElasticBeanstalkEnvironments.java @@ -0,0 +1,162 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** + * Resource collection API of ElasticBeanstalkEnvironments. + */ +public interface ElasticBeanstalkEnvironments { + /** + * List ElasticBeanstalkEnvironment resources by subscription ID. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a ElasticBeanstalkEnvironment list operation as paginated response with + * {@link PagedIterable}. + */ + PagedIterable list(); + + /** + * List ElasticBeanstalkEnvironment resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a ElasticBeanstalkEnvironment list operation as paginated response with + * {@link PagedIterable}. + */ + PagedIterable list(Context context); + + /** + * List ElasticBeanstalkEnvironment resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a ElasticBeanstalkEnvironment list operation as paginated response with + * {@link PagedIterable}. + */ + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * List ElasticBeanstalkEnvironment resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a ElasticBeanstalkEnvironment list operation as paginated response with + * {@link PagedIterable}. + */ + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Get a ElasticBeanstalkEnvironment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ElasticBeanstalkEnvironment. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a ElasticBeanstalkEnvironment along with {@link Response}. + */ + Response getByResourceGroupWithResponse(String resourceGroupName, String name, + Context context); + + /** + * Get a ElasticBeanstalkEnvironment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ElasticBeanstalkEnvironment. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a ElasticBeanstalkEnvironment. + */ + ElasticBeanstalkEnvironment getByResourceGroup(String resourceGroupName, String name); + + /** + * Delete a ElasticBeanstalkEnvironment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ElasticBeanstalkEnvironment. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByResourceGroup(String resourceGroupName, String name); + + /** + * Delete a ElasticBeanstalkEnvironment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ElasticBeanstalkEnvironment. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String name, Context context); + + /** + * Get a ElasticBeanstalkEnvironment. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a ElasticBeanstalkEnvironment along with {@link Response}. + */ + ElasticBeanstalkEnvironment getById(String id); + + /** + * Get a ElasticBeanstalkEnvironment. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a ElasticBeanstalkEnvironment along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Delete a ElasticBeanstalkEnvironment. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteById(String id); + + /** + * Delete a ElasticBeanstalkEnvironment. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new ElasticBeanstalkEnvironment resource. + * + * @param name resource name. + * @return the first stage of the new ElasticBeanstalkEnvironment definition. + */ + ElasticBeanstalkEnvironment.DefinitionStages.Blank define(String name); +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ElasticFileSystemTag.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ElasticFileSystemTag.java new file mode 100644 index 000000000000..5c67df78c34f --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ElasticFileSystemTag.java @@ -0,0 +1,121 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of ElasticFileSystemTag. + */ +@Fluent +public final class ElasticFileSystemTag implements JsonSerializable { + /* + * The tag key (String). The key can't start with ``aws:``. + */ + private String key; + + /* + * The value of the tag key. + */ + private String value; + + /** + * Creates an instance of ElasticFileSystemTag class. + */ + public ElasticFileSystemTag() { + } + + /** + * Get the key property: The tag key (String). The key can't start with ``aws:``. + * + * @return the key value. + */ + public String key() { + return this.key; + } + + /** + * Set the key property: The tag key (String). The key can't start with ``aws:``. + * + * @param key the key value to set. + * @return the ElasticFileSystemTag object itself. + */ + public ElasticFileSystemTag withKey(String key) { + this.key = key; + return this; + } + + /** + * Get the value property: The value of the tag key. + * + * @return the value value. + */ + public String value() { + return this.value; + } + + /** + * Set the value property: The value of the tag key. + * + * @param value the value value to set. + * @return the ElasticFileSystemTag object itself. + */ + public ElasticFileSystemTag withValue(String value) { + this.value = value; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("key", this.key); + jsonWriter.writeStringField("value", this.value); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ElasticFileSystemTag from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ElasticFileSystemTag if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the ElasticFileSystemTag. + */ + public static ElasticFileSystemTag fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ElasticFileSystemTag deserializedElasticFileSystemTag = new ElasticFileSystemTag(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("key".equals(fieldName)) { + deserializedElasticFileSystemTag.key = reader.getString(); + } else if ("value".equals(fieldName)) { + deserializedElasticFileSystemTag.value = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedElasticFileSystemTag; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ElasticGpuAssociation.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ElasticGpuAssociation.java new file mode 100644 index 000000000000..3fca161cf779 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ElasticGpuAssociation.java @@ -0,0 +1,181 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of ElasticGpuAssociation. + */ +@Fluent +public final class ElasticGpuAssociation implements JsonSerializable { + /* + *

The ID of the association.

+ */ + private String elasticGpuAssociationId; + + /* + *

The state of the association between the instance and the Elastic Graphics accelerator.

+ */ + private String elasticGpuAssociationState; + + /* + *

The time the Elastic Graphics accelerator was associated with the instance.

+ */ + private String elasticGpuAssociationTime; + + /* + *

The ID of the Elastic Graphics accelerator.

+ */ + private String elasticGpuId; + + /** + * Creates an instance of ElasticGpuAssociation class. + */ + public ElasticGpuAssociation() { + } + + /** + * Get the elasticGpuAssociationId property: <p>The ID of the association.</p>. + * + * @return the elasticGpuAssociationId value. + */ + public String elasticGpuAssociationId() { + return this.elasticGpuAssociationId; + } + + /** + * Set the elasticGpuAssociationId property: <p>The ID of the association.</p>. + * + * @param elasticGpuAssociationId the elasticGpuAssociationId value to set. + * @return the ElasticGpuAssociation object itself. + */ + public ElasticGpuAssociation withElasticGpuAssociationId(String elasticGpuAssociationId) { + this.elasticGpuAssociationId = elasticGpuAssociationId; + return this; + } + + /** + * Get the elasticGpuAssociationState property: <p>The state of the association between the instance and the + * Elastic Graphics accelerator.</p>. + * + * @return the elasticGpuAssociationState value. + */ + public String elasticGpuAssociationState() { + return this.elasticGpuAssociationState; + } + + /** + * Set the elasticGpuAssociationState property: <p>The state of the association between the instance and the + * Elastic Graphics accelerator.</p>. + * + * @param elasticGpuAssociationState the elasticGpuAssociationState value to set. + * @return the ElasticGpuAssociation object itself. + */ + public ElasticGpuAssociation withElasticGpuAssociationState(String elasticGpuAssociationState) { + this.elasticGpuAssociationState = elasticGpuAssociationState; + return this; + } + + /** + * Get the elasticGpuAssociationTime property: <p>The time the Elastic Graphics accelerator was associated + * with the instance.</p>. + * + * @return the elasticGpuAssociationTime value. + */ + public String elasticGpuAssociationTime() { + return this.elasticGpuAssociationTime; + } + + /** + * Set the elasticGpuAssociationTime property: <p>The time the Elastic Graphics accelerator was associated + * with the instance.</p>. + * + * @param elasticGpuAssociationTime the elasticGpuAssociationTime value to set. + * @return the ElasticGpuAssociation object itself. + */ + public ElasticGpuAssociation withElasticGpuAssociationTime(String elasticGpuAssociationTime) { + this.elasticGpuAssociationTime = elasticGpuAssociationTime; + return this; + } + + /** + * Get the elasticGpuId property: <p>The ID of the Elastic Graphics accelerator.</p>. + * + * @return the elasticGpuId value. + */ + public String elasticGpuId() { + return this.elasticGpuId; + } + + /** + * Set the elasticGpuId property: <p>The ID of the Elastic Graphics accelerator.</p>. + * + * @param elasticGpuId the elasticGpuId value to set. + * @return the ElasticGpuAssociation object itself. + */ + public ElasticGpuAssociation withElasticGpuId(String elasticGpuId) { + this.elasticGpuId = elasticGpuId; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("elasticGpuAssociationId", this.elasticGpuAssociationId); + jsonWriter.writeStringField("elasticGpuAssociationState", this.elasticGpuAssociationState); + jsonWriter.writeStringField("elasticGpuAssociationTime", this.elasticGpuAssociationTime); + jsonWriter.writeStringField("elasticGpuId", this.elasticGpuId); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ElasticGpuAssociation from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ElasticGpuAssociation if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the ElasticGpuAssociation. + */ + public static ElasticGpuAssociation fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ElasticGpuAssociation deserializedElasticGpuAssociation = new ElasticGpuAssociation(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("elasticGpuAssociationId".equals(fieldName)) { + deserializedElasticGpuAssociation.elasticGpuAssociationId = reader.getString(); + } else if ("elasticGpuAssociationState".equals(fieldName)) { + deserializedElasticGpuAssociation.elasticGpuAssociationState = reader.getString(); + } else if ("elasticGpuAssociationTime".equals(fieldName)) { + deserializedElasticGpuAssociation.elasticGpuAssociationTime = reader.getString(); + } else if ("elasticGpuId".equals(fieldName)) { + deserializedElasticGpuAssociation.elasticGpuId = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedElasticGpuAssociation; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ElasticInferenceAcceleratorAssociation.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ElasticInferenceAcceleratorAssociation.java new file mode 100644 index 000000000000..79fd34c067aa --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ElasticInferenceAcceleratorAssociation.java @@ -0,0 +1,202 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.time.OffsetDateTime; +import java.time.format.DateTimeFormatter; + +/** + * Definition of ElasticInferenceAcceleratorAssociation. + */ +@Fluent +public final class ElasticInferenceAcceleratorAssociation + implements JsonSerializable { + /* + *

The Amazon Resource Name (ARN) of the elastic inference accelerator.

+ */ + private String elasticInferenceAcceleratorArn; + + /* + *

The ID of the association.

+ */ + private String elasticInferenceAcceleratorAssociationId; + + /* + *

The state of the elastic inference accelerator.

+ */ + private String elasticInferenceAcceleratorAssociationState; + + /* + *

The time at which the elastic inference accelerator is associated with an instance.

+ */ + private OffsetDateTime elasticInferenceAcceleratorAssociationTime; + + /** + * Creates an instance of ElasticInferenceAcceleratorAssociation class. + */ + public ElasticInferenceAcceleratorAssociation() { + } + + /** + * Get the elasticInferenceAcceleratorArn property: <p> The Amazon Resource Name (ARN) of the elastic + * inference accelerator. </p>. + * + * @return the elasticInferenceAcceleratorArn value. + */ + public String elasticInferenceAcceleratorArn() { + return this.elasticInferenceAcceleratorArn; + } + + /** + * Set the elasticInferenceAcceleratorArn property: <p> The Amazon Resource Name (ARN) of the elastic + * inference accelerator. </p>. + * + * @param elasticInferenceAcceleratorArn the elasticInferenceAcceleratorArn value to set. + * @return the ElasticInferenceAcceleratorAssociation object itself. + */ + public ElasticInferenceAcceleratorAssociation + withElasticInferenceAcceleratorArn(String elasticInferenceAcceleratorArn) { + this.elasticInferenceAcceleratorArn = elasticInferenceAcceleratorArn; + return this; + } + + /** + * Get the elasticInferenceAcceleratorAssociationId property: <p> The ID of the association. </p>. + * + * @return the elasticInferenceAcceleratorAssociationId value. + */ + public String elasticInferenceAcceleratorAssociationId() { + return this.elasticInferenceAcceleratorAssociationId; + } + + /** + * Set the elasticInferenceAcceleratorAssociationId property: <p> The ID of the association. </p>. + * + * @param elasticInferenceAcceleratorAssociationId the elasticInferenceAcceleratorAssociationId value to set. + * @return the ElasticInferenceAcceleratorAssociation object itself. + */ + public ElasticInferenceAcceleratorAssociation + withElasticInferenceAcceleratorAssociationId(String elasticInferenceAcceleratorAssociationId) { + this.elasticInferenceAcceleratorAssociationId = elasticInferenceAcceleratorAssociationId; + return this; + } + + /** + * Get the elasticInferenceAcceleratorAssociationState property: <p> The state of the elastic inference + * accelerator. </p>. + * + * @return the elasticInferenceAcceleratorAssociationState value. + */ + public String elasticInferenceAcceleratorAssociationState() { + return this.elasticInferenceAcceleratorAssociationState; + } + + /** + * Set the elasticInferenceAcceleratorAssociationState property: <p> The state of the elastic inference + * accelerator. </p>. + * + * @param elasticInferenceAcceleratorAssociationState the elasticInferenceAcceleratorAssociationState value to set. + * @return the ElasticInferenceAcceleratorAssociation object itself. + */ + public ElasticInferenceAcceleratorAssociation + withElasticInferenceAcceleratorAssociationState(String elasticInferenceAcceleratorAssociationState) { + this.elasticInferenceAcceleratorAssociationState = elasticInferenceAcceleratorAssociationState; + return this; + } + + /** + * Get the elasticInferenceAcceleratorAssociationTime property: <p> The time at which the elastic inference + * accelerator is associated with an instance. </p>. + * + * @return the elasticInferenceAcceleratorAssociationTime value. + */ + public OffsetDateTime elasticInferenceAcceleratorAssociationTime() { + return this.elasticInferenceAcceleratorAssociationTime; + } + + /** + * Set the elasticInferenceAcceleratorAssociationTime property: <p> The time at which the elastic inference + * accelerator is associated with an instance. </p>. + * + * @param elasticInferenceAcceleratorAssociationTime the elasticInferenceAcceleratorAssociationTime value to set. + * @return the ElasticInferenceAcceleratorAssociation object itself. + */ + public ElasticInferenceAcceleratorAssociation + withElasticInferenceAcceleratorAssociationTime(OffsetDateTime elasticInferenceAcceleratorAssociationTime) { + this.elasticInferenceAcceleratorAssociationTime = elasticInferenceAcceleratorAssociationTime; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("elasticInferenceAcceleratorArn", this.elasticInferenceAcceleratorArn); + jsonWriter.writeStringField("elasticInferenceAcceleratorAssociationId", + this.elasticInferenceAcceleratorAssociationId); + jsonWriter.writeStringField("elasticInferenceAcceleratorAssociationState", + this.elasticInferenceAcceleratorAssociationState); + jsonWriter.writeStringField("elasticInferenceAcceleratorAssociationTime", + this.elasticInferenceAcceleratorAssociationTime == null + ? null + : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.elasticInferenceAcceleratorAssociationTime)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ElasticInferenceAcceleratorAssociation from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ElasticInferenceAcceleratorAssociation if the JsonReader was pointing to an instance of + * it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ElasticInferenceAcceleratorAssociation. + */ + public static ElasticInferenceAcceleratorAssociation fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ElasticInferenceAcceleratorAssociation deserializedElasticInferenceAcceleratorAssociation + = new ElasticInferenceAcceleratorAssociation(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("elasticInferenceAcceleratorArn".equals(fieldName)) { + deserializedElasticInferenceAcceleratorAssociation.elasticInferenceAcceleratorArn + = reader.getString(); + } else if ("elasticInferenceAcceleratorAssociationId".equals(fieldName)) { + deserializedElasticInferenceAcceleratorAssociation.elasticInferenceAcceleratorAssociationId + = reader.getString(); + } else if ("elasticInferenceAcceleratorAssociationState".equals(fieldName)) { + deserializedElasticInferenceAcceleratorAssociation.elasticInferenceAcceleratorAssociationState + = reader.getString(); + } else if ("elasticInferenceAcceleratorAssociationTime".equals(fieldName)) { + deserializedElasticInferenceAcceleratorAssociation.elasticInferenceAcceleratorAssociationTime + = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else { + reader.skipChildren(); + } + } + + return deserializedElasticInferenceAcceleratorAssociation; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ElasticLoadBalancingV2Listener.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ElasticLoadBalancingV2Listener.java new file mode 100644 index 000000000000..e0bbaf9bfd4a --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ElasticLoadBalancingV2Listener.java @@ -0,0 +1,252 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.awsconnector.fluent.models.ElasticLoadBalancingV2ListenerInner; +import java.util.Map; + +/** + * An immutable client-side representation of ElasticLoadBalancingV2Listener. + */ +public interface ElasticLoadBalancingV2Listener { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the location property: The geo-location where the resource lives. + * + * @return the location value. + */ + String location(); + + /** + * Gets the tags property: Resource tags. + * + * @return the tags value. + */ + Map tags(); + + /** + * Gets the properties property: The resource-specific properties for this resource. + * + * @return the properties value. + */ + ElasticLoadBalancingV2ListenerProperties properties(); + + /** + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the region of the resource. + * + * @return the region of the resource. + */ + Region region(); + + /** + * Gets the name of the resource region. + * + * @return the name of the resource region. + */ + String regionName(); + + /** + * Gets the name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + + /** + * Gets the inner com.azure.resourcemanager.awsconnector.fluent.models.ElasticLoadBalancingV2ListenerInner object. + * + * @return the inner object. + */ + ElasticLoadBalancingV2ListenerInner innerModel(); + + /** + * The entirety of the ElasticLoadBalancingV2Listener definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithLocation, + DefinitionStages.WithResourceGroup, DefinitionStages.WithCreate { + } + + /** + * The ElasticLoadBalancingV2Listener definition stages. + */ + interface DefinitionStages { + /** + * The first stage of the ElasticLoadBalancingV2Listener definition. + */ + interface Blank extends WithLocation { + } + + /** + * The stage of the ElasticLoadBalancingV2Listener definition allowing to specify location. + */ + interface WithLocation { + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithResourceGroup withRegion(Region location); + + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithResourceGroup withRegion(String location); + } + + /** + * The stage of the ElasticLoadBalancingV2Listener definition allowing to specify parent resource. + */ + interface WithResourceGroup { + /** + * Specifies resourceGroupName. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @return the next definition stage. + */ + WithCreate withExistingResourceGroup(String resourceGroupName); + } + + /** + * The stage of the ElasticLoadBalancingV2Listener 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.WithProperties { + /** + * Executes the create request. + * + * @return the created resource. + */ + ElasticLoadBalancingV2Listener create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + ElasticLoadBalancingV2Listener create(Context context); + } + + /** + * The stage of the ElasticLoadBalancingV2Listener definition allowing to specify tags. + */ + interface WithTags { + /** + * Specifies the tags property: Resource tags.. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + WithCreate withTags(Map tags); + } + + /** + * The stage of the ElasticLoadBalancingV2Listener definition allowing to specify properties. + */ + interface WithProperties { + /** + * Specifies the properties property: The resource-specific properties for this resource.. + * + * @param properties The resource-specific properties for this resource. + * @return the next definition stage. + */ + WithCreate withProperties(ElasticLoadBalancingV2ListenerProperties properties); + } + } + + /** + * Begins update for the ElasticLoadBalancingV2Listener resource. + * + * @return the stage of resource update. + */ + ElasticLoadBalancingV2Listener.Update update(); + + /** + * The template for ElasticLoadBalancingV2Listener update. + */ + interface Update extends UpdateStages.WithTags { + /** + * Executes the update request. + * + * @return the updated resource. + */ + ElasticLoadBalancingV2Listener apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + ElasticLoadBalancingV2Listener apply(Context context); + } + + /** + * The ElasticLoadBalancingV2Listener update stages. + */ + interface UpdateStages { + /** + * The stage of the ElasticLoadBalancingV2Listener update allowing to specify tags. + */ + interface WithTags { + /** + * Specifies the tags property: Resource tags.. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + Update withTags(Map tags); + } + } + + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + ElasticLoadBalancingV2Listener refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + ElasticLoadBalancingV2Listener refresh(Context context); +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ElasticLoadBalancingV2ListenerListResult.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ElasticLoadBalancingV2ListenerListResult.java new file mode 100644 index 000000000000..695c4e67f27b --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ElasticLoadBalancingV2ListenerListResult.java @@ -0,0 +1,138 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.awsconnector.fluent.models.ElasticLoadBalancingV2ListenerInner; +import java.io.IOException; +import java.util.List; + +/** + * The response of a ElasticLoadBalancingV2Listener list operation. + */ +@Fluent +public final class ElasticLoadBalancingV2ListenerListResult + implements JsonSerializable { + /* + * The ElasticLoadBalancingV2Listener items on this page + */ + private List value; + + /* + * The link to the next page of items + */ + private String nextLink; + + /** + * Creates an instance of ElasticLoadBalancingV2ListenerListResult class. + */ + public ElasticLoadBalancingV2ListenerListResult() { + } + + /** + * Get the value property: The ElasticLoadBalancingV2Listener items on this page. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The ElasticLoadBalancingV2Listener items on this page. + * + * @param value the value value to set. + * @return the ElasticLoadBalancingV2ListenerListResult object itself. + */ + public ElasticLoadBalancingV2ListenerListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The link to the next page of items. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: The link to the next page of items. + * + * @param nextLink the nextLink value to set. + * @return the ElasticLoadBalancingV2ListenerListResult object itself. + */ + public ElasticLoadBalancingV2ListenerListResult withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property value in model ElasticLoadBalancingV2ListenerListResult")); + } else { + value().forEach(e -> e.validate()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(ElasticLoadBalancingV2ListenerListResult.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("nextLink", this.nextLink); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ElasticLoadBalancingV2ListenerListResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ElasticLoadBalancingV2ListenerListResult if the JsonReader was pointing to an instance of + * it, or null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the ElasticLoadBalancingV2ListenerListResult. + */ + public static ElasticLoadBalancingV2ListenerListResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ElasticLoadBalancingV2ListenerListResult deserializedElasticLoadBalancingV2ListenerListResult + = new ElasticLoadBalancingV2ListenerListResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> ElasticLoadBalancingV2ListenerInner.fromJson(reader1)); + deserializedElasticLoadBalancingV2ListenerListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedElasticLoadBalancingV2ListenerListResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedElasticLoadBalancingV2ListenerListResult; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ElasticLoadBalancingV2ListenerProperties.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ElasticLoadBalancingV2ListenerProperties.java new file mode 100644 index 000000000000..697dcf92c9c2 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ElasticLoadBalancingV2ListenerProperties.java @@ -0,0 +1,317 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.Map; + +/** + * Definition of ElasticLoadBalancingV2Listener. + */ +@Fluent +public final class ElasticLoadBalancingV2ListenerProperties + implements JsonSerializable { + /* + * AWS Properties + */ + private AwsElasticLoadBalancingV2ListenerProperties awsProperties; + + /* + * Public Cloud Connectors Resource ID + */ + private String publicCloudConnectorsResourceId; + + /* + * AWS Account ID + */ + private String awsAccountId; + + /* + * Amazon Resource Name (ARN) + */ + private String arn; + + /* + * Public Cloud Resource Name + */ + private String publicCloudResourceName; + + /* + * AWS Source Schema + */ + private String awsSourceSchema; + + /* + * AWS Region + */ + private String awsRegion; + + /* + * AWS Tags + */ + private Map awsTags; + + /* + * The status of the last operation. + */ + private ProvisioningState provisioningState; + + /** + * Creates an instance of ElasticLoadBalancingV2ListenerProperties class. + */ + public ElasticLoadBalancingV2ListenerProperties() { + } + + /** + * Get the awsProperties property: AWS Properties. + * + * @return the awsProperties value. + */ + public AwsElasticLoadBalancingV2ListenerProperties awsProperties() { + return this.awsProperties; + } + + /** + * Set the awsProperties property: AWS Properties. + * + * @param awsProperties the awsProperties value to set. + * @return the ElasticLoadBalancingV2ListenerProperties object itself. + */ + public ElasticLoadBalancingV2ListenerProperties + withAwsProperties(AwsElasticLoadBalancingV2ListenerProperties awsProperties) { + this.awsProperties = awsProperties; + return this; + } + + /** + * Get the publicCloudConnectorsResourceId property: Public Cloud Connectors Resource ID. + * + * @return the publicCloudConnectorsResourceId value. + */ + public String publicCloudConnectorsResourceId() { + return this.publicCloudConnectorsResourceId; + } + + /** + * Set the publicCloudConnectorsResourceId property: Public Cloud Connectors Resource ID. + * + * @param publicCloudConnectorsResourceId the publicCloudConnectorsResourceId value to set. + * @return the ElasticLoadBalancingV2ListenerProperties object itself. + */ + public ElasticLoadBalancingV2ListenerProperties + withPublicCloudConnectorsResourceId(String publicCloudConnectorsResourceId) { + this.publicCloudConnectorsResourceId = publicCloudConnectorsResourceId; + return this; + } + + /** + * Get the awsAccountId property: AWS Account ID. + * + * @return the awsAccountId value. + */ + public String awsAccountId() { + return this.awsAccountId; + } + + /** + * Set the awsAccountId property: AWS Account ID. + * + * @param awsAccountId the awsAccountId value to set. + * @return the ElasticLoadBalancingV2ListenerProperties object itself. + */ + public ElasticLoadBalancingV2ListenerProperties withAwsAccountId(String awsAccountId) { + this.awsAccountId = awsAccountId; + return this; + } + + /** + * Get the arn property: Amazon Resource Name (ARN). + * + * @return the arn value. + */ + public String arn() { + return this.arn; + } + + /** + * Set the arn property: Amazon Resource Name (ARN). + * + * @param arn the arn value to set. + * @return the ElasticLoadBalancingV2ListenerProperties object itself. + */ + public ElasticLoadBalancingV2ListenerProperties withArn(String arn) { + this.arn = arn; + return this; + } + + /** + * Get the publicCloudResourceName property: Public Cloud Resource Name. + * + * @return the publicCloudResourceName value. + */ + public String publicCloudResourceName() { + return this.publicCloudResourceName; + } + + /** + * Set the publicCloudResourceName property: Public Cloud Resource Name. + * + * @param publicCloudResourceName the publicCloudResourceName value to set. + * @return the ElasticLoadBalancingV2ListenerProperties object itself. + */ + public ElasticLoadBalancingV2ListenerProperties withPublicCloudResourceName(String publicCloudResourceName) { + this.publicCloudResourceName = publicCloudResourceName; + return this; + } + + /** + * Get the awsSourceSchema property: AWS Source Schema. + * + * @return the awsSourceSchema value. + */ + public String awsSourceSchema() { + return this.awsSourceSchema; + } + + /** + * Set the awsSourceSchema property: AWS Source Schema. + * + * @param awsSourceSchema the awsSourceSchema value to set. + * @return the ElasticLoadBalancingV2ListenerProperties object itself. + */ + public ElasticLoadBalancingV2ListenerProperties withAwsSourceSchema(String awsSourceSchema) { + this.awsSourceSchema = awsSourceSchema; + return this; + } + + /** + * Get the awsRegion property: AWS Region. + * + * @return the awsRegion value. + */ + public String awsRegion() { + return this.awsRegion; + } + + /** + * Set the awsRegion property: AWS Region. + * + * @param awsRegion the awsRegion value to set. + * @return the ElasticLoadBalancingV2ListenerProperties object itself. + */ + public ElasticLoadBalancingV2ListenerProperties withAwsRegion(String awsRegion) { + this.awsRegion = awsRegion; + return this; + } + + /** + * Get the awsTags property: AWS Tags. + * + * @return the awsTags value. + */ + public Map awsTags() { + return this.awsTags; + } + + /** + * Set the awsTags property: AWS Tags. + * + * @param awsTags the awsTags value to set. + * @return the ElasticLoadBalancingV2ListenerProperties object itself. + */ + public ElasticLoadBalancingV2ListenerProperties withAwsTags(Map awsTags) { + this.awsTags = awsTags; + return this; + } + + /** + * Get the provisioningState property: The status of the last operation. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (awsProperties() != null) { + awsProperties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("awsProperties", this.awsProperties); + jsonWriter.writeStringField("publicCloudConnectorsResourceId", this.publicCloudConnectorsResourceId); + jsonWriter.writeStringField("awsAccountId", this.awsAccountId); + jsonWriter.writeStringField("arn", this.arn); + jsonWriter.writeStringField("publicCloudResourceName", this.publicCloudResourceName); + jsonWriter.writeStringField("awsSourceSchema", this.awsSourceSchema); + jsonWriter.writeStringField("awsRegion", this.awsRegion); + jsonWriter.writeMapField("awsTags", this.awsTags, (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ElasticLoadBalancingV2ListenerProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ElasticLoadBalancingV2ListenerProperties if the JsonReader was pointing to an instance of + * it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ElasticLoadBalancingV2ListenerProperties. + */ + public static ElasticLoadBalancingV2ListenerProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ElasticLoadBalancingV2ListenerProperties deserializedElasticLoadBalancingV2ListenerProperties + = new ElasticLoadBalancingV2ListenerProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("awsProperties".equals(fieldName)) { + deserializedElasticLoadBalancingV2ListenerProperties.awsProperties + = AwsElasticLoadBalancingV2ListenerProperties.fromJson(reader); + } else if ("publicCloudConnectorsResourceId".equals(fieldName)) { + deserializedElasticLoadBalancingV2ListenerProperties.publicCloudConnectorsResourceId + = reader.getString(); + } else if ("awsAccountId".equals(fieldName)) { + deserializedElasticLoadBalancingV2ListenerProperties.awsAccountId = reader.getString(); + } else if ("arn".equals(fieldName)) { + deserializedElasticLoadBalancingV2ListenerProperties.arn = reader.getString(); + } else if ("publicCloudResourceName".equals(fieldName)) { + deserializedElasticLoadBalancingV2ListenerProperties.publicCloudResourceName = reader.getString(); + } else if ("awsSourceSchema".equals(fieldName)) { + deserializedElasticLoadBalancingV2ListenerProperties.awsSourceSchema = reader.getString(); + } else if ("awsRegion".equals(fieldName)) { + deserializedElasticLoadBalancingV2ListenerProperties.awsRegion = reader.getString(); + } else if ("awsTags".equals(fieldName)) { + Map awsTags = reader.readMap(reader1 -> reader1.getString()); + deserializedElasticLoadBalancingV2ListenerProperties.awsTags = awsTags; + } else if ("provisioningState".equals(fieldName)) { + deserializedElasticLoadBalancingV2ListenerProperties.provisioningState + = ProvisioningState.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedElasticLoadBalancingV2ListenerProperties; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ElasticLoadBalancingV2ListenerTagsUpdate.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ElasticLoadBalancingV2ListenerTagsUpdate.java new file mode 100644 index 000000000000..b4a1e64880ed --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ElasticLoadBalancingV2ListenerTagsUpdate.java @@ -0,0 +1,97 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.Map; + +/** + * The type used for updating tags in ElasticLoadBalancingV2Listener resources. + */ +@Fluent +public final class ElasticLoadBalancingV2ListenerTagsUpdate + implements JsonSerializable { + /* + * Resource tags. + */ + private Map tags; + + /** + * Creates an instance of ElasticLoadBalancingV2ListenerTagsUpdate class. + */ + public ElasticLoadBalancingV2ListenerTagsUpdate() { + } + + /** + * Get the tags property: Resource tags. + * + * @return the tags value. + */ + public Map tags() { + return this.tags; + } + + /** + * Set the tags property: Resource tags. + * + * @param tags the tags value to set. + * @return the ElasticLoadBalancingV2ListenerTagsUpdate object itself. + */ + public ElasticLoadBalancingV2ListenerTagsUpdate withTags(Map tags) { + this.tags = tags; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeMapField("tags", this.tags, (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ElasticLoadBalancingV2ListenerTagsUpdate from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ElasticLoadBalancingV2ListenerTagsUpdate if the JsonReader was pointing to an instance of + * it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ElasticLoadBalancingV2ListenerTagsUpdate. + */ + public static ElasticLoadBalancingV2ListenerTagsUpdate fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ElasticLoadBalancingV2ListenerTagsUpdate deserializedElasticLoadBalancingV2ListenerTagsUpdate + = new ElasticLoadBalancingV2ListenerTagsUpdate(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedElasticLoadBalancingV2ListenerTagsUpdate.tags = tags; + } else { + reader.skipChildren(); + } + } + + return deserializedElasticLoadBalancingV2ListenerTagsUpdate; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ElasticLoadBalancingV2Listeners.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ElasticLoadBalancingV2Listeners.java new file mode 100644 index 000000000000..6ace626313e7 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ElasticLoadBalancingV2Listeners.java @@ -0,0 +1,162 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** + * Resource collection API of ElasticLoadBalancingV2Listeners. + */ +public interface ElasticLoadBalancingV2Listeners { + /** + * List ElasticLoadBalancingV2Listener resources by subscription ID. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a ElasticLoadBalancingV2Listener list operation as paginated response with + * {@link PagedIterable}. + */ + PagedIterable list(); + + /** + * List ElasticLoadBalancingV2Listener resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a ElasticLoadBalancingV2Listener list operation as paginated response with + * {@link PagedIterable}. + */ + PagedIterable list(Context context); + + /** + * List ElasticLoadBalancingV2Listener resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a ElasticLoadBalancingV2Listener list operation as paginated response with + * {@link PagedIterable}. + */ + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * List ElasticLoadBalancingV2Listener resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a ElasticLoadBalancingV2Listener list operation as paginated response with + * {@link PagedIterable}. + */ + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Get a ElasticLoadBalancingV2Listener. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ElasticLoadBalancingV2Listener. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a ElasticLoadBalancingV2Listener along with {@link Response}. + */ + Response getByResourceGroupWithResponse(String resourceGroupName, String name, + Context context); + + /** + * Get a ElasticLoadBalancingV2Listener. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ElasticLoadBalancingV2Listener. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a ElasticLoadBalancingV2Listener. + */ + ElasticLoadBalancingV2Listener getByResourceGroup(String resourceGroupName, String name); + + /** + * Delete a ElasticLoadBalancingV2Listener. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ElasticLoadBalancingV2Listener. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByResourceGroup(String resourceGroupName, String name); + + /** + * Delete a ElasticLoadBalancingV2Listener. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ElasticLoadBalancingV2Listener. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String name, Context context); + + /** + * Get a ElasticLoadBalancingV2Listener. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a ElasticLoadBalancingV2Listener along with {@link Response}. + */ + ElasticLoadBalancingV2Listener getById(String id); + + /** + * Get a ElasticLoadBalancingV2Listener. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a ElasticLoadBalancingV2Listener along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Delete a ElasticLoadBalancingV2Listener. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteById(String id); + + /** + * Delete a ElasticLoadBalancingV2Listener. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new ElasticLoadBalancingV2Listener resource. + * + * @param name resource name. + * @return the first stage of the new ElasticLoadBalancingV2Listener definition. + */ + ElasticLoadBalancingV2Listener.DefinitionStages.Blank define(String name); +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ElasticLoadBalancingV2LoadBalancer.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ElasticLoadBalancingV2LoadBalancer.java new file mode 100644 index 000000000000..4a6dc909e8eb --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ElasticLoadBalancingV2LoadBalancer.java @@ -0,0 +1,253 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.awsconnector.fluent.models.ElasticLoadBalancingV2LoadBalancerInner; +import java.util.Map; + +/** + * An immutable client-side representation of ElasticLoadBalancingV2LoadBalancer. + */ +public interface ElasticLoadBalancingV2LoadBalancer { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the location property: The geo-location where the resource lives. + * + * @return the location value. + */ + String location(); + + /** + * Gets the tags property: Resource tags. + * + * @return the tags value. + */ + Map tags(); + + /** + * Gets the properties property: The resource-specific properties for this resource. + * + * @return the properties value. + */ + ElasticLoadBalancingV2LoadBalancerProperties properties(); + + /** + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the region of the resource. + * + * @return the region of the resource. + */ + Region region(); + + /** + * Gets the name of the resource region. + * + * @return the name of the resource region. + */ + String regionName(); + + /** + * Gets the name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + + /** + * Gets the inner com.azure.resourcemanager.awsconnector.fluent.models.ElasticLoadBalancingV2LoadBalancerInner + * object. + * + * @return the inner object. + */ + ElasticLoadBalancingV2LoadBalancerInner innerModel(); + + /** + * The entirety of the ElasticLoadBalancingV2LoadBalancer definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithLocation, + DefinitionStages.WithResourceGroup, DefinitionStages.WithCreate { + } + + /** + * The ElasticLoadBalancingV2LoadBalancer definition stages. + */ + interface DefinitionStages { + /** + * The first stage of the ElasticLoadBalancingV2LoadBalancer definition. + */ + interface Blank extends WithLocation { + } + + /** + * The stage of the ElasticLoadBalancingV2LoadBalancer definition allowing to specify location. + */ + interface WithLocation { + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithResourceGroup withRegion(Region location); + + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithResourceGroup withRegion(String location); + } + + /** + * The stage of the ElasticLoadBalancingV2LoadBalancer definition allowing to specify parent resource. + */ + interface WithResourceGroup { + /** + * Specifies resourceGroupName. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @return the next definition stage. + */ + WithCreate withExistingResourceGroup(String resourceGroupName); + } + + /** + * The stage of the ElasticLoadBalancingV2LoadBalancer 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.WithProperties { + /** + * Executes the create request. + * + * @return the created resource. + */ + ElasticLoadBalancingV2LoadBalancer create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + ElasticLoadBalancingV2LoadBalancer create(Context context); + } + + /** + * The stage of the ElasticLoadBalancingV2LoadBalancer definition allowing to specify tags. + */ + interface WithTags { + /** + * Specifies the tags property: Resource tags.. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + WithCreate withTags(Map tags); + } + + /** + * The stage of the ElasticLoadBalancingV2LoadBalancer definition allowing to specify properties. + */ + interface WithProperties { + /** + * Specifies the properties property: The resource-specific properties for this resource.. + * + * @param properties The resource-specific properties for this resource. + * @return the next definition stage. + */ + WithCreate withProperties(ElasticLoadBalancingV2LoadBalancerProperties properties); + } + } + + /** + * Begins update for the ElasticLoadBalancingV2LoadBalancer resource. + * + * @return the stage of resource update. + */ + ElasticLoadBalancingV2LoadBalancer.Update update(); + + /** + * The template for ElasticLoadBalancingV2LoadBalancer update. + */ + interface Update extends UpdateStages.WithTags { + /** + * Executes the update request. + * + * @return the updated resource. + */ + ElasticLoadBalancingV2LoadBalancer apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + ElasticLoadBalancingV2LoadBalancer apply(Context context); + } + + /** + * The ElasticLoadBalancingV2LoadBalancer update stages. + */ + interface UpdateStages { + /** + * The stage of the ElasticLoadBalancingV2LoadBalancer update allowing to specify tags. + */ + interface WithTags { + /** + * Specifies the tags property: Resource tags.. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + Update withTags(Map tags); + } + } + + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + ElasticLoadBalancingV2LoadBalancer refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + ElasticLoadBalancingV2LoadBalancer refresh(Context context); +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ElasticLoadBalancingV2LoadBalancerListResult.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ElasticLoadBalancingV2LoadBalancerListResult.java new file mode 100644 index 000000000000..eaf11b993312 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ElasticLoadBalancingV2LoadBalancerListResult.java @@ -0,0 +1,138 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.awsconnector.fluent.models.ElasticLoadBalancingV2LoadBalancerInner; +import java.io.IOException; +import java.util.List; + +/** + * The response of a ElasticLoadBalancingV2LoadBalancer list operation. + */ +@Fluent +public final class ElasticLoadBalancingV2LoadBalancerListResult + implements JsonSerializable { + /* + * The ElasticLoadBalancingV2LoadBalancer items on this page + */ + private List value; + + /* + * The link to the next page of items + */ + private String nextLink; + + /** + * Creates an instance of ElasticLoadBalancingV2LoadBalancerListResult class. + */ + public ElasticLoadBalancingV2LoadBalancerListResult() { + } + + /** + * Get the value property: The ElasticLoadBalancingV2LoadBalancer items on this page. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The ElasticLoadBalancingV2LoadBalancer items on this page. + * + * @param value the value value to set. + * @return the ElasticLoadBalancingV2LoadBalancerListResult object itself. + */ + public ElasticLoadBalancingV2LoadBalancerListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The link to the next page of items. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: The link to the next page of items. + * + * @param nextLink the nextLink value to set. + * @return the ElasticLoadBalancingV2LoadBalancerListResult object itself. + */ + public ElasticLoadBalancingV2LoadBalancerListResult withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property value in model ElasticLoadBalancingV2LoadBalancerListResult")); + } else { + value().forEach(e -> e.validate()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(ElasticLoadBalancingV2LoadBalancerListResult.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("nextLink", this.nextLink); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ElasticLoadBalancingV2LoadBalancerListResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ElasticLoadBalancingV2LoadBalancerListResult if the JsonReader was pointing to an instance + * of it, or null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the ElasticLoadBalancingV2LoadBalancerListResult. + */ + public static ElasticLoadBalancingV2LoadBalancerListResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ElasticLoadBalancingV2LoadBalancerListResult deserializedElasticLoadBalancingV2LoadBalancerListResult + = new ElasticLoadBalancingV2LoadBalancerListResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> ElasticLoadBalancingV2LoadBalancerInner.fromJson(reader1)); + deserializedElasticLoadBalancingV2LoadBalancerListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedElasticLoadBalancingV2LoadBalancerListResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedElasticLoadBalancingV2LoadBalancerListResult; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ElasticLoadBalancingV2LoadBalancerProperties.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ElasticLoadBalancingV2LoadBalancerProperties.java new file mode 100644 index 000000000000..479d6a63a038 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ElasticLoadBalancingV2LoadBalancerProperties.java @@ -0,0 +1,318 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.Map; + +/** + * Definition of ElasticLoadBalancingV2LoadBalancer. + */ +@Fluent +public final class ElasticLoadBalancingV2LoadBalancerProperties + implements JsonSerializable { + /* + * AWS Properties + */ + private AwsElasticLoadBalancingV2LoadBalancerProperties awsProperties; + + /* + * Public Cloud Connectors Resource ID + */ + private String publicCloudConnectorsResourceId; + + /* + * AWS Account ID + */ + private String awsAccountId; + + /* + * Amazon Resource Name (ARN) + */ + private String arn; + + /* + * Public Cloud Resource Name + */ + private String publicCloudResourceName; + + /* + * AWS Source Schema + */ + private String awsSourceSchema; + + /* + * AWS Region + */ + private String awsRegion; + + /* + * AWS Tags + */ + private Map awsTags; + + /* + * The status of the last operation. + */ + private ProvisioningState provisioningState; + + /** + * Creates an instance of ElasticLoadBalancingV2LoadBalancerProperties class. + */ + public ElasticLoadBalancingV2LoadBalancerProperties() { + } + + /** + * Get the awsProperties property: AWS Properties. + * + * @return the awsProperties value. + */ + public AwsElasticLoadBalancingV2LoadBalancerProperties awsProperties() { + return this.awsProperties; + } + + /** + * Set the awsProperties property: AWS Properties. + * + * @param awsProperties the awsProperties value to set. + * @return the ElasticLoadBalancingV2LoadBalancerProperties object itself. + */ + public ElasticLoadBalancingV2LoadBalancerProperties + withAwsProperties(AwsElasticLoadBalancingV2LoadBalancerProperties awsProperties) { + this.awsProperties = awsProperties; + return this; + } + + /** + * Get the publicCloudConnectorsResourceId property: Public Cloud Connectors Resource ID. + * + * @return the publicCloudConnectorsResourceId value. + */ + public String publicCloudConnectorsResourceId() { + return this.publicCloudConnectorsResourceId; + } + + /** + * Set the publicCloudConnectorsResourceId property: Public Cloud Connectors Resource ID. + * + * @param publicCloudConnectorsResourceId the publicCloudConnectorsResourceId value to set. + * @return the ElasticLoadBalancingV2LoadBalancerProperties object itself. + */ + public ElasticLoadBalancingV2LoadBalancerProperties + withPublicCloudConnectorsResourceId(String publicCloudConnectorsResourceId) { + this.publicCloudConnectorsResourceId = publicCloudConnectorsResourceId; + return this; + } + + /** + * Get the awsAccountId property: AWS Account ID. + * + * @return the awsAccountId value. + */ + public String awsAccountId() { + return this.awsAccountId; + } + + /** + * Set the awsAccountId property: AWS Account ID. + * + * @param awsAccountId the awsAccountId value to set. + * @return the ElasticLoadBalancingV2LoadBalancerProperties object itself. + */ + public ElasticLoadBalancingV2LoadBalancerProperties withAwsAccountId(String awsAccountId) { + this.awsAccountId = awsAccountId; + return this; + } + + /** + * Get the arn property: Amazon Resource Name (ARN). + * + * @return the arn value. + */ + public String arn() { + return this.arn; + } + + /** + * Set the arn property: Amazon Resource Name (ARN). + * + * @param arn the arn value to set. + * @return the ElasticLoadBalancingV2LoadBalancerProperties object itself. + */ + public ElasticLoadBalancingV2LoadBalancerProperties withArn(String arn) { + this.arn = arn; + return this; + } + + /** + * Get the publicCloudResourceName property: Public Cloud Resource Name. + * + * @return the publicCloudResourceName value. + */ + public String publicCloudResourceName() { + return this.publicCloudResourceName; + } + + /** + * Set the publicCloudResourceName property: Public Cloud Resource Name. + * + * @param publicCloudResourceName the publicCloudResourceName value to set. + * @return the ElasticLoadBalancingV2LoadBalancerProperties object itself. + */ + public ElasticLoadBalancingV2LoadBalancerProperties withPublicCloudResourceName(String publicCloudResourceName) { + this.publicCloudResourceName = publicCloudResourceName; + return this; + } + + /** + * Get the awsSourceSchema property: AWS Source Schema. + * + * @return the awsSourceSchema value. + */ + public String awsSourceSchema() { + return this.awsSourceSchema; + } + + /** + * Set the awsSourceSchema property: AWS Source Schema. + * + * @param awsSourceSchema the awsSourceSchema value to set. + * @return the ElasticLoadBalancingV2LoadBalancerProperties object itself. + */ + public ElasticLoadBalancingV2LoadBalancerProperties withAwsSourceSchema(String awsSourceSchema) { + this.awsSourceSchema = awsSourceSchema; + return this; + } + + /** + * Get the awsRegion property: AWS Region. + * + * @return the awsRegion value. + */ + public String awsRegion() { + return this.awsRegion; + } + + /** + * Set the awsRegion property: AWS Region. + * + * @param awsRegion the awsRegion value to set. + * @return the ElasticLoadBalancingV2LoadBalancerProperties object itself. + */ + public ElasticLoadBalancingV2LoadBalancerProperties withAwsRegion(String awsRegion) { + this.awsRegion = awsRegion; + return this; + } + + /** + * Get the awsTags property: AWS Tags. + * + * @return the awsTags value. + */ + public Map awsTags() { + return this.awsTags; + } + + /** + * Set the awsTags property: AWS Tags. + * + * @param awsTags the awsTags value to set. + * @return the ElasticLoadBalancingV2LoadBalancerProperties object itself. + */ + public ElasticLoadBalancingV2LoadBalancerProperties withAwsTags(Map awsTags) { + this.awsTags = awsTags; + return this; + } + + /** + * Get the provisioningState property: The status of the last operation. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (awsProperties() != null) { + awsProperties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("awsProperties", this.awsProperties); + jsonWriter.writeStringField("publicCloudConnectorsResourceId", this.publicCloudConnectorsResourceId); + jsonWriter.writeStringField("awsAccountId", this.awsAccountId); + jsonWriter.writeStringField("arn", this.arn); + jsonWriter.writeStringField("publicCloudResourceName", this.publicCloudResourceName); + jsonWriter.writeStringField("awsSourceSchema", this.awsSourceSchema); + jsonWriter.writeStringField("awsRegion", this.awsRegion); + jsonWriter.writeMapField("awsTags", this.awsTags, (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ElasticLoadBalancingV2LoadBalancerProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ElasticLoadBalancingV2LoadBalancerProperties if the JsonReader was pointing to an instance + * of it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ElasticLoadBalancingV2LoadBalancerProperties. + */ + public static ElasticLoadBalancingV2LoadBalancerProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ElasticLoadBalancingV2LoadBalancerProperties deserializedElasticLoadBalancingV2LoadBalancerProperties + = new ElasticLoadBalancingV2LoadBalancerProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("awsProperties".equals(fieldName)) { + deserializedElasticLoadBalancingV2LoadBalancerProperties.awsProperties + = AwsElasticLoadBalancingV2LoadBalancerProperties.fromJson(reader); + } else if ("publicCloudConnectorsResourceId".equals(fieldName)) { + deserializedElasticLoadBalancingV2LoadBalancerProperties.publicCloudConnectorsResourceId + = reader.getString(); + } else if ("awsAccountId".equals(fieldName)) { + deserializedElasticLoadBalancingV2LoadBalancerProperties.awsAccountId = reader.getString(); + } else if ("arn".equals(fieldName)) { + deserializedElasticLoadBalancingV2LoadBalancerProperties.arn = reader.getString(); + } else if ("publicCloudResourceName".equals(fieldName)) { + deserializedElasticLoadBalancingV2LoadBalancerProperties.publicCloudResourceName + = reader.getString(); + } else if ("awsSourceSchema".equals(fieldName)) { + deserializedElasticLoadBalancingV2LoadBalancerProperties.awsSourceSchema = reader.getString(); + } else if ("awsRegion".equals(fieldName)) { + deserializedElasticLoadBalancingV2LoadBalancerProperties.awsRegion = reader.getString(); + } else if ("awsTags".equals(fieldName)) { + Map awsTags = reader.readMap(reader1 -> reader1.getString()); + deserializedElasticLoadBalancingV2LoadBalancerProperties.awsTags = awsTags; + } else if ("provisioningState".equals(fieldName)) { + deserializedElasticLoadBalancingV2LoadBalancerProperties.provisioningState + = ProvisioningState.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedElasticLoadBalancingV2LoadBalancerProperties; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ElasticLoadBalancingV2LoadBalancerTagsUpdate.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ElasticLoadBalancingV2LoadBalancerTagsUpdate.java new file mode 100644 index 000000000000..625f8e17f156 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ElasticLoadBalancingV2LoadBalancerTagsUpdate.java @@ -0,0 +1,97 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.Map; + +/** + * The type used for updating tags in ElasticLoadBalancingV2LoadBalancer resources. + */ +@Fluent +public final class ElasticLoadBalancingV2LoadBalancerTagsUpdate + implements JsonSerializable { + /* + * Resource tags. + */ + private Map tags; + + /** + * Creates an instance of ElasticLoadBalancingV2LoadBalancerTagsUpdate class. + */ + public ElasticLoadBalancingV2LoadBalancerTagsUpdate() { + } + + /** + * Get the tags property: Resource tags. + * + * @return the tags value. + */ + public Map tags() { + return this.tags; + } + + /** + * Set the tags property: Resource tags. + * + * @param tags the tags value to set. + * @return the ElasticLoadBalancingV2LoadBalancerTagsUpdate object itself. + */ + public ElasticLoadBalancingV2LoadBalancerTagsUpdate withTags(Map tags) { + this.tags = tags; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeMapField("tags", this.tags, (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ElasticLoadBalancingV2LoadBalancerTagsUpdate from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ElasticLoadBalancingV2LoadBalancerTagsUpdate if the JsonReader was pointing to an instance + * of it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ElasticLoadBalancingV2LoadBalancerTagsUpdate. + */ + public static ElasticLoadBalancingV2LoadBalancerTagsUpdate fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ElasticLoadBalancingV2LoadBalancerTagsUpdate deserializedElasticLoadBalancingV2LoadBalancerTagsUpdate + = new ElasticLoadBalancingV2LoadBalancerTagsUpdate(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedElasticLoadBalancingV2LoadBalancerTagsUpdate.tags = tags; + } else { + reader.skipChildren(); + } + } + + return deserializedElasticLoadBalancingV2LoadBalancerTagsUpdate; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ElasticLoadBalancingV2LoadBalancers.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ElasticLoadBalancingV2LoadBalancers.java new file mode 100644 index 000000000000..da0e57afb75d --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ElasticLoadBalancingV2LoadBalancers.java @@ -0,0 +1,162 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** + * Resource collection API of ElasticLoadBalancingV2LoadBalancers. + */ +public interface ElasticLoadBalancingV2LoadBalancers { + /** + * List ElasticLoadBalancingV2LoadBalancer resources by subscription ID. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a ElasticLoadBalancingV2LoadBalancer list operation as paginated response with + * {@link PagedIterable}. + */ + PagedIterable list(); + + /** + * List ElasticLoadBalancingV2LoadBalancer resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a ElasticLoadBalancingV2LoadBalancer list operation as paginated response with + * {@link PagedIterable}. + */ + PagedIterable list(Context context); + + /** + * List ElasticLoadBalancingV2LoadBalancer resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a ElasticLoadBalancingV2LoadBalancer list operation as paginated response with + * {@link PagedIterable}. + */ + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * List ElasticLoadBalancingV2LoadBalancer resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a ElasticLoadBalancingV2LoadBalancer list operation as paginated response with + * {@link PagedIterable}. + */ + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Get a ElasticLoadBalancingV2LoadBalancer. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ElasticLoadBalancingV2LoadBalancer. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a ElasticLoadBalancingV2LoadBalancer along with {@link Response}. + */ + Response getByResourceGroupWithResponse(String resourceGroupName, String name, + Context context); + + /** + * Get a ElasticLoadBalancingV2LoadBalancer. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ElasticLoadBalancingV2LoadBalancer. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a ElasticLoadBalancingV2LoadBalancer. + */ + ElasticLoadBalancingV2LoadBalancer getByResourceGroup(String resourceGroupName, String name); + + /** + * Delete a ElasticLoadBalancingV2LoadBalancer. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ElasticLoadBalancingV2LoadBalancer. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByResourceGroup(String resourceGroupName, String name); + + /** + * Delete a ElasticLoadBalancingV2LoadBalancer. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ElasticLoadBalancingV2LoadBalancer. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String name, Context context); + + /** + * Get a ElasticLoadBalancingV2LoadBalancer. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a ElasticLoadBalancingV2LoadBalancer along with {@link Response}. + */ + ElasticLoadBalancingV2LoadBalancer getById(String id); + + /** + * Get a ElasticLoadBalancingV2LoadBalancer. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a ElasticLoadBalancingV2LoadBalancer along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Delete a ElasticLoadBalancingV2LoadBalancer. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteById(String id); + + /** + * Delete a ElasticLoadBalancingV2LoadBalancer. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new ElasticLoadBalancingV2LoadBalancer resource. + * + * @param name resource name. + * @return the first stage of the new ElasticLoadBalancingV2LoadBalancer definition. + */ + ElasticLoadBalancingV2LoadBalancer.DefinitionStages.Blank define(String name); +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ElasticLoadBalancingV2TargetGroup.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ElasticLoadBalancingV2TargetGroup.java new file mode 100644 index 000000000000..6c14d7a7bd46 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ElasticLoadBalancingV2TargetGroup.java @@ -0,0 +1,253 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.awsconnector.fluent.models.ElasticLoadBalancingV2TargetGroupInner; +import java.util.Map; + +/** + * An immutable client-side representation of ElasticLoadBalancingV2TargetGroup. + */ +public interface ElasticLoadBalancingV2TargetGroup { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the location property: The geo-location where the resource lives. + * + * @return the location value. + */ + String location(); + + /** + * Gets the tags property: Resource tags. + * + * @return the tags value. + */ + Map tags(); + + /** + * Gets the properties property: The resource-specific properties for this resource. + * + * @return the properties value. + */ + ElasticLoadBalancingV2TargetGroupProperties properties(); + + /** + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the region of the resource. + * + * @return the region of the resource. + */ + Region region(); + + /** + * Gets the name of the resource region. + * + * @return the name of the resource region. + */ + String regionName(); + + /** + * Gets the name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + + /** + * Gets the inner com.azure.resourcemanager.awsconnector.fluent.models.ElasticLoadBalancingV2TargetGroupInner + * object. + * + * @return the inner object. + */ + ElasticLoadBalancingV2TargetGroupInner innerModel(); + + /** + * The entirety of the ElasticLoadBalancingV2TargetGroup definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithLocation, + DefinitionStages.WithResourceGroup, DefinitionStages.WithCreate { + } + + /** + * The ElasticLoadBalancingV2TargetGroup definition stages. + */ + interface DefinitionStages { + /** + * The first stage of the ElasticLoadBalancingV2TargetGroup definition. + */ + interface Blank extends WithLocation { + } + + /** + * The stage of the ElasticLoadBalancingV2TargetGroup definition allowing to specify location. + */ + interface WithLocation { + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithResourceGroup withRegion(Region location); + + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithResourceGroup withRegion(String location); + } + + /** + * The stage of the ElasticLoadBalancingV2TargetGroup definition allowing to specify parent resource. + */ + interface WithResourceGroup { + /** + * Specifies resourceGroupName. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @return the next definition stage. + */ + WithCreate withExistingResourceGroup(String resourceGroupName); + } + + /** + * The stage of the ElasticLoadBalancingV2TargetGroup 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.WithProperties { + /** + * Executes the create request. + * + * @return the created resource. + */ + ElasticLoadBalancingV2TargetGroup create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + ElasticLoadBalancingV2TargetGroup create(Context context); + } + + /** + * The stage of the ElasticLoadBalancingV2TargetGroup definition allowing to specify tags. + */ + interface WithTags { + /** + * Specifies the tags property: Resource tags.. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + WithCreate withTags(Map tags); + } + + /** + * The stage of the ElasticLoadBalancingV2TargetGroup definition allowing to specify properties. + */ + interface WithProperties { + /** + * Specifies the properties property: The resource-specific properties for this resource.. + * + * @param properties The resource-specific properties for this resource. + * @return the next definition stage. + */ + WithCreate withProperties(ElasticLoadBalancingV2TargetGroupProperties properties); + } + } + + /** + * Begins update for the ElasticLoadBalancingV2TargetGroup resource. + * + * @return the stage of resource update. + */ + ElasticLoadBalancingV2TargetGroup.Update update(); + + /** + * The template for ElasticLoadBalancingV2TargetGroup update. + */ + interface Update extends UpdateStages.WithTags { + /** + * Executes the update request. + * + * @return the updated resource. + */ + ElasticLoadBalancingV2TargetGroup apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + ElasticLoadBalancingV2TargetGroup apply(Context context); + } + + /** + * The ElasticLoadBalancingV2TargetGroup update stages. + */ + interface UpdateStages { + /** + * The stage of the ElasticLoadBalancingV2TargetGroup update allowing to specify tags. + */ + interface WithTags { + /** + * Specifies the tags property: Resource tags.. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + Update withTags(Map tags); + } + } + + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + ElasticLoadBalancingV2TargetGroup refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + ElasticLoadBalancingV2TargetGroup refresh(Context context); +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ElasticLoadBalancingV2TargetGroupListResult.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ElasticLoadBalancingV2TargetGroupListResult.java new file mode 100644 index 000000000000..0f9aee9b17e4 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ElasticLoadBalancingV2TargetGroupListResult.java @@ -0,0 +1,138 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.awsconnector.fluent.models.ElasticLoadBalancingV2TargetGroupInner; +import java.io.IOException; +import java.util.List; + +/** + * The response of a ElasticLoadBalancingV2TargetGroup list operation. + */ +@Fluent +public final class ElasticLoadBalancingV2TargetGroupListResult + implements JsonSerializable { + /* + * The ElasticLoadBalancingV2TargetGroup items on this page + */ + private List value; + + /* + * The link to the next page of items + */ + private String nextLink; + + /** + * Creates an instance of ElasticLoadBalancingV2TargetGroupListResult class. + */ + public ElasticLoadBalancingV2TargetGroupListResult() { + } + + /** + * Get the value property: The ElasticLoadBalancingV2TargetGroup items on this page. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The ElasticLoadBalancingV2TargetGroup items on this page. + * + * @param value the value value to set. + * @return the ElasticLoadBalancingV2TargetGroupListResult object itself. + */ + public ElasticLoadBalancingV2TargetGroupListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The link to the next page of items. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: The link to the next page of items. + * + * @param nextLink the nextLink value to set. + * @return the ElasticLoadBalancingV2TargetGroupListResult object itself. + */ + public ElasticLoadBalancingV2TargetGroupListResult withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property value in model ElasticLoadBalancingV2TargetGroupListResult")); + } else { + value().forEach(e -> e.validate()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(ElasticLoadBalancingV2TargetGroupListResult.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("nextLink", this.nextLink); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ElasticLoadBalancingV2TargetGroupListResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ElasticLoadBalancingV2TargetGroupListResult if the JsonReader was pointing to an instance + * of it, or null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the ElasticLoadBalancingV2TargetGroupListResult. + */ + public static ElasticLoadBalancingV2TargetGroupListResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ElasticLoadBalancingV2TargetGroupListResult deserializedElasticLoadBalancingV2TargetGroupListResult + = new ElasticLoadBalancingV2TargetGroupListResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> ElasticLoadBalancingV2TargetGroupInner.fromJson(reader1)); + deserializedElasticLoadBalancingV2TargetGroupListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedElasticLoadBalancingV2TargetGroupListResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedElasticLoadBalancingV2TargetGroupListResult; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ElasticLoadBalancingV2TargetGroupProperties.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ElasticLoadBalancingV2TargetGroupProperties.java new file mode 100644 index 000000000000..f08679f34aef --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ElasticLoadBalancingV2TargetGroupProperties.java @@ -0,0 +1,318 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.Map; + +/** + * Definition of ElasticLoadBalancingV2TargetGroup. + */ +@Fluent +public final class ElasticLoadBalancingV2TargetGroupProperties + implements JsonSerializable { + /* + * AWS Properties + */ + private AwsElasticLoadBalancingV2TargetGroupProperties awsProperties; + + /* + * Public Cloud Connectors Resource ID + */ + private String publicCloudConnectorsResourceId; + + /* + * AWS Account ID + */ + private String awsAccountId; + + /* + * Amazon Resource Name (ARN) + */ + private String arn; + + /* + * Public Cloud Resource Name + */ + private String publicCloudResourceName; + + /* + * AWS Source Schema + */ + private String awsSourceSchema; + + /* + * AWS Region + */ + private String awsRegion; + + /* + * AWS Tags + */ + private Map awsTags; + + /* + * The status of the last operation. + */ + private ProvisioningState provisioningState; + + /** + * Creates an instance of ElasticLoadBalancingV2TargetGroupProperties class. + */ + public ElasticLoadBalancingV2TargetGroupProperties() { + } + + /** + * Get the awsProperties property: AWS Properties. + * + * @return the awsProperties value. + */ + public AwsElasticLoadBalancingV2TargetGroupProperties awsProperties() { + return this.awsProperties; + } + + /** + * Set the awsProperties property: AWS Properties. + * + * @param awsProperties the awsProperties value to set. + * @return the ElasticLoadBalancingV2TargetGroupProperties object itself. + */ + public ElasticLoadBalancingV2TargetGroupProperties + withAwsProperties(AwsElasticLoadBalancingV2TargetGroupProperties awsProperties) { + this.awsProperties = awsProperties; + return this; + } + + /** + * Get the publicCloudConnectorsResourceId property: Public Cloud Connectors Resource ID. + * + * @return the publicCloudConnectorsResourceId value. + */ + public String publicCloudConnectorsResourceId() { + return this.publicCloudConnectorsResourceId; + } + + /** + * Set the publicCloudConnectorsResourceId property: Public Cloud Connectors Resource ID. + * + * @param publicCloudConnectorsResourceId the publicCloudConnectorsResourceId value to set. + * @return the ElasticLoadBalancingV2TargetGroupProperties object itself. + */ + public ElasticLoadBalancingV2TargetGroupProperties + withPublicCloudConnectorsResourceId(String publicCloudConnectorsResourceId) { + this.publicCloudConnectorsResourceId = publicCloudConnectorsResourceId; + return this; + } + + /** + * Get the awsAccountId property: AWS Account ID. + * + * @return the awsAccountId value. + */ + public String awsAccountId() { + return this.awsAccountId; + } + + /** + * Set the awsAccountId property: AWS Account ID. + * + * @param awsAccountId the awsAccountId value to set. + * @return the ElasticLoadBalancingV2TargetGroupProperties object itself. + */ + public ElasticLoadBalancingV2TargetGroupProperties withAwsAccountId(String awsAccountId) { + this.awsAccountId = awsAccountId; + return this; + } + + /** + * Get the arn property: Amazon Resource Name (ARN). + * + * @return the arn value. + */ + public String arn() { + return this.arn; + } + + /** + * Set the arn property: Amazon Resource Name (ARN). + * + * @param arn the arn value to set. + * @return the ElasticLoadBalancingV2TargetGroupProperties object itself. + */ + public ElasticLoadBalancingV2TargetGroupProperties withArn(String arn) { + this.arn = arn; + return this; + } + + /** + * Get the publicCloudResourceName property: Public Cloud Resource Name. + * + * @return the publicCloudResourceName value. + */ + public String publicCloudResourceName() { + return this.publicCloudResourceName; + } + + /** + * Set the publicCloudResourceName property: Public Cloud Resource Name. + * + * @param publicCloudResourceName the publicCloudResourceName value to set. + * @return the ElasticLoadBalancingV2TargetGroupProperties object itself. + */ + public ElasticLoadBalancingV2TargetGroupProperties withPublicCloudResourceName(String publicCloudResourceName) { + this.publicCloudResourceName = publicCloudResourceName; + return this; + } + + /** + * Get the awsSourceSchema property: AWS Source Schema. + * + * @return the awsSourceSchema value. + */ + public String awsSourceSchema() { + return this.awsSourceSchema; + } + + /** + * Set the awsSourceSchema property: AWS Source Schema. + * + * @param awsSourceSchema the awsSourceSchema value to set. + * @return the ElasticLoadBalancingV2TargetGroupProperties object itself. + */ + public ElasticLoadBalancingV2TargetGroupProperties withAwsSourceSchema(String awsSourceSchema) { + this.awsSourceSchema = awsSourceSchema; + return this; + } + + /** + * Get the awsRegion property: AWS Region. + * + * @return the awsRegion value. + */ + public String awsRegion() { + return this.awsRegion; + } + + /** + * Set the awsRegion property: AWS Region. + * + * @param awsRegion the awsRegion value to set. + * @return the ElasticLoadBalancingV2TargetGroupProperties object itself. + */ + public ElasticLoadBalancingV2TargetGroupProperties withAwsRegion(String awsRegion) { + this.awsRegion = awsRegion; + return this; + } + + /** + * Get the awsTags property: AWS Tags. + * + * @return the awsTags value. + */ + public Map awsTags() { + return this.awsTags; + } + + /** + * Set the awsTags property: AWS Tags. + * + * @param awsTags the awsTags value to set. + * @return the ElasticLoadBalancingV2TargetGroupProperties object itself. + */ + public ElasticLoadBalancingV2TargetGroupProperties withAwsTags(Map awsTags) { + this.awsTags = awsTags; + return this; + } + + /** + * Get the provisioningState property: The status of the last operation. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (awsProperties() != null) { + awsProperties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("awsProperties", this.awsProperties); + jsonWriter.writeStringField("publicCloudConnectorsResourceId", this.publicCloudConnectorsResourceId); + jsonWriter.writeStringField("awsAccountId", this.awsAccountId); + jsonWriter.writeStringField("arn", this.arn); + jsonWriter.writeStringField("publicCloudResourceName", this.publicCloudResourceName); + jsonWriter.writeStringField("awsSourceSchema", this.awsSourceSchema); + jsonWriter.writeStringField("awsRegion", this.awsRegion); + jsonWriter.writeMapField("awsTags", this.awsTags, (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ElasticLoadBalancingV2TargetGroupProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ElasticLoadBalancingV2TargetGroupProperties if the JsonReader was pointing to an instance + * of it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ElasticLoadBalancingV2TargetGroupProperties. + */ + public static ElasticLoadBalancingV2TargetGroupProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ElasticLoadBalancingV2TargetGroupProperties deserializedElasticLoadBalancingV2TargetGroupProperties + = new ElasticLoadBalancingV2TargetGroupProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("awsProperties".equals(fieldName)) { + deserializedElasticLoadBalancingV2TargetGroupProperties.awsProperties + = AwsElasticLoadBalancingV2TargetGroupProperties.fromJson(reader); + } else if ("publicCloudConnectorsResourceId".equals(fieldName)) { + deserializedElasticLoadBalancingV2TargetGroupProperties.publicCloudConnectorsResourceId + = reader.getString(); + } else if ("awsAccountId".equals(fieldName)) { + deserializedElasticLoadBalancingV2TargetGroupProperties.awsAccountId = reader.getString(); + } else if ("arn".equals(fieldName)) { + deserializedElasticLoadBalancingV2TargetGroupProperties.arn = reader.getString(); + } else if ("publicCloudResourceName".equals(fieldName)) { + deserializedElasticLoadBalancingV2TargetGroupProperties.publicCloudResourceName + = reader.getString(); + } else if ("awsSourceSchema".equals(fieldName)) { + deserializedElasticLoadBalancingV2TargetGroupProperties.awsSourceSchema = reader.getString(); + } else if ("awsRegion".equals(fieldName)) { + deserializedElasticLoadBalancingV2TargetGroupProperties.awsRegion = reader.getString(); + } else if ("awsTags".equals(fieldName)) { + Map awsTags = reader.readMap(reader1 -> reader1.getString()); + deserializedElasticLoadBalancingV2TargetGroupProperties.awsTags = awsTags; + } else if ("provisioningState".equals(fieldName)) { + deserializedElasticLoadBalancingV2TargetGroupProperties.provisioningState + = ProvisioningState.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedElasticLoadBalancingV2TargetGroupProperties; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ElasticLoadBalancingV2TargetGroupTagsUpdate.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ElasticLoadBalancingV2TargetGroupTagsUpdate.java new file mode 100644 index 000000000000..2e4cc7beef65 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ElasticLoadBalancingV2TargetGroupTagsUpdate.java @@ -0,0 +1,97 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.Map; + +/** + * The type used for updating tags in ElasticLoadBalancingV2TargetGroup resources. + */ +@Fluent +public final class ElasticLoadBalancingV2TargetGroupTagsUpdate + implements JsonSerializable { + /* + * Resource tags. + */ + private Map tags; + + /** + * Creates an instance of ElasticLoadBalancingV2TargetGroupTagsUpdate class. + */ + public ElasticLoadBalancingV2TargetGroupTagsUpdate() { + } + + /** + * Get the tags property: Resource tags. + * + * @return the tags value. + */ + public Map tags() { + return this.tags; + } + + /** + * Set the tags property: Resource tags. + * + * @param tags the tags value to set. + * @return the ElasticLoadBalancingV2TargetGroupTagsUpdate object itself. + */ + public ElasticLoadBalancingV2TargetGroupTagsUpdate withTags(Map tags) { + this.tags = tags; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeMapField("tags", this.tags, (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ElasticLoadBalancingV2TargetGroupTagsUpdate from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ElasticLoadBalancingV2TargetGroupTagsUpdate if the JsonReader was pointing to an instance + * of it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ElasticLoadBalancingV2TargetGroupTagsUpdate. + */ + public static ElasticLoadBalancingV2TargetGroupTagsUpdate fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ElasticLoadBalancingV2TargetGroupTagsUpdate deserializedElasticLoadBalancingV2TargetGroupTagsUpdate + = new ElasticLoadBalancingV2TargetGroupTagsUpdate(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedElasticLoadBalancingV2TargetGroupTagsUpdate.tags = tags; + } else { + reader.skipChildren(); + } + } + + return deserializedElasticLoadBalancingV2TargetGroupTagsUpdate; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ElasticLoadBalancingV2TargetGroups.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ElasticLoadBalancingV2TargetGroups.java new file mode 100644 index 000000000000..2da813bcdac8 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ElasticLoadBalancingV2TargetGroups.java @@ -0,0 +1,162 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** + * Resource collection API of ElasticLoadBalancingV2TargetGroups. + */ +public interface ElasticLoadBalancingV2TargetGroups { + /** + * List ElasticLoadBalancingV2TargetGroup resources by subscription ID. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a ElasticLoadBalancingV2TargetGroup list operation as paginated response with + * {@link PagedIterable}. + */ + PagedIterable list(); + + /** + * List ElasticLoadBalancingV2TargetGroup resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a ElasticLoadBalancingV2TargetGroup list operation as paginated response with + * {@link PagedIterable}. + */ + PagedIterable list(Context context); + + /** + * List ElasticLoadBalancingV2TargetGroup resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a ElasticLoadBalancingV2TargetGroup list operation as paginated response with + * {@link PagedIterable}. + */ + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * List ElasticLoadBalancingV2TargetGroup resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a ElasticLoadBalancingV2TargetGroup list operation as paginated response with + * {@link PagedIterable}. + */ + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Get a ElasticLoadBalancingV2TargetGroup. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ElasticLoadBalancingV2TargetGroup. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a ElasticLoadBalancingV2TargetGroup along with {@link Response}. + */ + Response getByResourceGroupWithResponse(String resourceGroupName, String name, + Context context); + + /** + * Get a ElasticLoadBalancingV2TargetGroup. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ElasticLoadBalancingV2TargetGroup. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a ElasticLoadBalancingV2TargetGroup. + */ + ElasticLoadBalancingV2TargetGroup getByResourceGroup(String resourceGroupName, String name); + + /** + * Delete a ElasticLoadBalancingV2TargetGroup. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ElasticLoadBalancingV2TargetGroup. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByResourceGroup(String resourceGroupName, String name); + + /** + * Delete a ElasticLoadBalancingV2TargetGroup. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ElasticLoadBalancingV2TargetGroup. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String name, Context context); + + /** + * Get a ElasticLoadBalancingV2TargetGroup. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a ElasticLoadBalancingV2TargetGroup along with {@link Response}. + */ + ElasticLoadBalancingV2TargetGroup getById(String id); + + /** + * Get a ElasticLoadBalancingV2TargetGroup. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a ElasticLoadBalancingV2TargetGroup along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Delete a ElasticLoadBalancingV2TargetGroup. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteById(String id); + + /** + * Delete a ElasticLoadBalancingV2TargetGroup. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new ElasticLoadBalancingV2TargetGroup resource. + * + * @param name resource name. + * @return the first stage of the new ElasticLoadBalancingV2TargetGroup definition. + */ + ElasticLoadBalancingV2TargetGroup.DefinitionStages.Blank define(String name); +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ElasticLoadBalancingv2TargetHealthDescription.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ElasticLoadBalancingv2TargetHealthDescription.java new file mode 100644 index 000000000000..8459a2d6f335 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ElasticLoadBalancingv2TargetHealthDescription.java @@ -0,0 +1,255 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.awsconnector.fluent.models.ElasticLoadBalancingv2TargetHealthDescriptionInner; +import java.util.Map; + +/** + * An immutable client-side representation of ElasticLoadBalancingv2TargetHealthDescription. + */ +public interface ElasticLoadBalancingv2TargetHealthDescription { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the location property: The geo-location where the resource lives. + * + * @return the location value. + */ + String location(); + + /** + * Gets the tags property: Resource tags. + * + * @return the tags value. + */ + Map tags(); + + /** + * Gets the properties property: The resource-specific properties for this resource. + * + * @return the properties value. + */ + ElasticLoadBalancingv2TargetHealthDescriptionProperties properties(); + + /** + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the region of the resource. + * + * @return the region of the resource. + */ + Region region(); + + /** + * Gets the name of the resource region. + * + * @return the name of the resource region. + */ + String regionName(); + + /** + * Gets the name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + + /** + * Gets the inner + * com.azure.resourcemanager.awsconnector.fluent.models.ElasticLoadBalancingv2TargetHealthDescriptionInner object. + * + * @return the inner object. + */ + ElasticLoadBalancingv2TargetHealthDescriptionInner innerModel(); + + /** + * The entirety of the ElasticLoadBalancingv2TargetHealthDescription definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithLocation, + DefinitionStages.WithResourceGroup, DefinitionStages.WithCreate { + } + + /** + * The ElasticLoadBalancingv2TargetHealthDescription definition stages. + */ + interface DefinitionStages { + /** + * The first stage of the ElasticLoadBalancingv2TargetHealthDescription definition. + */ + interface Blank extends WithLocation { + } + + /** + * The stage of the ElasticLoadBalancingv2TargetHealthDescription definition allowing to specify location. + */ + interface WithLocation { + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithResourceGroup withRegion(Region location); + + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithResourceGroup withRegion(String location); + } + + /** + * The stage of the ElasticLoadBalancingv2TargetHealthDescription definition allowing to specify parent + * resource. + */ + interface WithResourceGroup { + /** + * Specifies resourceGroupName. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @return the next definition stage. + */ + WithCreate withExistingResourceGroup(String resourceGroupName); + } + + /** + * The stage of the ElasticLoadBalancingv2TargetHealthDescription 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.WithProperties { + /** + * Executes the create request. + * + * @return the created resource. + */ + ElasticLoadBalancingv2TargetHealthDescription create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + ElasticLoadBalancingv2TargetHealthDescription create(Context context); + } + + /** + * The stage of the ElasticLoadBalancingv2TargetHealthDescription definition allowing to specify tags. + */ + interface WithTags { + /** + * Specifies the tags property: Resource tags.. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + WithCreate withTags(Map tags); + } + + /** + * The stage of the ElasticLoadBalancingv2TargetHealthDescription definition allowing to specify properties. + */ + interface WithProperties { + /** + * Specifies the properties property: The resource-specific properties for this resource.. + * + * @param properties The resource-specific properties for this resource. + * @return the next definition stage. + */ + WithCreate withProperties(ElasticLoadBalancingv2TargetHealthDescriptionProperties properties); + } + } + + /** + * Begins update for the ElasticLoadBalancingv2TargetHealthDescription resource. + * + * @return the stage of resource update. + */ + ElasticLoadBalancingv2TargetHealthDescription.Update update(); + + /** + * The template for ElasticLoadBalancingv2TargetHealthDescription update. + */ + interface Update extends UpdateStages.WithTags { + /** + * Executes the update request. + * + * @return the updated resource. + */ + ElasticLoadBalancingv2TargetHealthDescription apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + ElasticLoadBalancingv2TargetHealthDescription apply(Context context); + } + + /** + * The ElasticLoadBalancingv2TargetHealthDescription update stages. + */ + interface UpdateStages { + /** + * The stage of the ElasticLoadBalancingv2TargetHealthDescription update allowing to specify tags. + */ + interface WithTags { + /** + * Specifies the tags property: Resource tags.. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + Update withTags(Map tags); + } + } + + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + ElasticLoadBalancingv2TargetHealthDescription refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + ElasticLoadBalancingv2TargetHealthDescription refresh(Context context); +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ElasticLoadBalancingv2TargetHealthDescriptionListResult.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ElasticLoadBalancingv2TargetHealthDescriptionListResult.java new file mode 100644 index 000000000000..de450ddca18d --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ElasticLoadBalancingv2TargetHealthDescriptionListResult.java @@ -0,0 +1,141 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.awsconnector.fluent.models.ElasticLoadBalancingv2TargetHealthDescriptionInner; +import java.io.IOException; +import java.util.List; + +/** + * The response of a ElasticLoadBalancingv2TargetHealthDescription list operation. + */ +@Fluent +public final class ElasticLoadBalancingv2TargetHealthDescriptionListResult + implements JsonSerializable { + /* + * The ElasticLoadBalancingv2TargetHealthDescription items on this page + */ + private List value; + + /* + * The link to the next page of items + */ + private String nextLink; + + /** + * Creates an instance of ElasticLoadBalancingv2TargetHealthDescriptionListResult class. + */ + public ElasticLoadBalancingv2TargetHealthDescriptionListResult() { + } + + /** + * Get the value property: The ElasticLoadBalancingv2TargetHealthDescription items on this page. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The ElasticLoadBalancingv2TargetHealthDescription items on this page. + * + * @param value the value value to set. + * @return the ElasticLoadBalancingv2TargetHealthDescriptionListResult object itself. + */ + public ElasticLoadBalancingv2TargetHealthDescriptionListResult + withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The link to the next page of items. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: The link to the next page of items. + * + * @param nextLink the nextLink value to set. + * @return the ElasticLoadBalancingv2TargetHealthDescriptionListResult object itself. + */ + public ElasticLoadBalancingv2TargetHealthDescriptionListResult withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property value in model ElasticLoadBalancingv2TargetHealthDescriptionListResult")); + } else { + value().forEach(e -> e.validate()); + } + } + + private static final ClientLogger LOGGER + = new ClientLogger(ElasticLoadBalancingv2TargetHealthDescriptionListResult.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("nextLink", this.nextLink); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ElasticLoadBalancingv2TargetHealthDescriptionListResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ElasticLoadBalancingv2TargetHealthDescriptionListResult if the JsonReader was pointing to + * an instance of it, or null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the ElasticLoadBalancingv2TargetHealthDescriptionListResult. + */ + public static ElasticLoadBalancingv2TargetHealthDescriptionListResult fromJson(JsonReader jsonReader) + throws IOException { + return jsonReader.readObject(reader -> { + ElasticLoadBalancingv2TargetHealthDescriptionListResult deserializedElasticLoadBalancingv2TargetHealthDescriptionListResult + = new ElasticLoadBalancingv2TargetHealthDescriptionListResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value = reader + .readArray(reader1 -> ElasticLoadBalancingv2TargetHealthDescriptionInner.fromJson(reader1)); + deserializedElasticLoadBalancingv2TargetHealthDescriptionListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedElasticLoadBalancingv2TargetHealthDescriptionListResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedElasticLoadBalancingv2TargetHealthDescriptionListResult; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ElasticLoadBalancingv2TargetHealthDescriptionProperties.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ElasticLoadBalancingv2TargetHealthDescriptionProperties.java new file mode 100644 index 000000000000..d3a35af417c9 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ElasticLoadBalancingv2TargetHealthDescriptionProperties.java @@ -0,0 +1,322 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.Map; + +/** + * Definition of ElasticLoadBalancingv2TargetHealthDescription. + */ +@Fluent +public final class ElasticLoadBalancingv2TargetHealthDescriptionProperties + implements JsonSerializable { + /* + * AWS Properties + */ + private AwsElasticLoadBalancingv2TargetHealthDescriptionProperties awsProperties; + + /* + * Public Cloud Connectors Resource ID + */ + private String publicCloudConnectorsResourceId; + + /* + * AWS Account ID + */ + private String awsAccountId; + + /* + * Amazon Resource Name (ARN) + */ + private String arn; + + /* + * Public Cloud Resource Name + */ + private String publicCloudResourceName; + + /* + * AWS Source Schema + */ + private String awsSourceSchema; + + /* + * AWS Region + */ + private String awsRegion; + + /* + * AWS Tags + */ + private Map awsTags; + + /* + * The status of the last operation. + */ + private ProvisioningState provisioningState; + + /** + * Creates an instance of ElasticLoadBalancingv2TargetHealthDescriptionProperties class. + */ + public ElasticLoadBalancingv2TargetHealthDescriptionProperties() { + } + + /** + * Get the awsProperties property: AWS Properties. + * + * @return the awsProperties value. + */ + public AwsElasticLoadBalancingv2TargetHealthDescriptionProperties awsProperties() { + return this.awsProperties; + } + + /** + * Set the awsProperties property: AWS Properties. + * + * @param awsProperties the awsProperties value to set. + * @return the ElasticLoadBalancingv2TargetHealthDescriptionProperties object itself. + */ + public ElasticLoadBalancingv2TargetHealthDescriptionProperties + withAwsProperties(AwsElasticLoadBalancingv2TargetHealthDescriptionProperties awsProperties) { + this.awsProperties = awsProperties; + return this; + } + + /** + * Get the publicCloudConnectorsResourceId property: Public Cloud Connectors Resource ID. + * + * @return the publicCloudConnectorsResourceId value. + */ + public String publicCloudConnectorsResourceId() { + return this.publicCloudConnectorsResourceId; + } + + /** + * Set the publicCloudConnectorsResourceId property: Public Cloud Connectors Resource ID. + * + * @param publicCloudConnectorsResourceId the publicCloudConnectorsResourceId value to set. + * @return the ElasticLoadBalancingv2TargetHealthDescriptionProperties object itself. + */ + public ElasticLoadBalancingv2TargetHealthDescriptionProperties + withPublicCloudConnectorsResourceId(String publicCloudConnectorsResourceId) { + this.publicCloudConnectorsResourceId = publicCloudConnectorsResourceId; + return this; + } + + /** + * Get the awsAccountId property: AWS Account ID. + * + * @return the awsAccountId value. + */ + public String awsAccountId() { + return this.awsAccountId; + } + + /** + * Set the awsAccountId property: AWS Account ID. + * + * @param awsAccountId the awsAccountId value to set. + * @return the ElasticLoadBalancingv2TargetHealthDescriptionProperties object itself. + */ + public ElasticLoadBalancingv2TargetHealthDescriptionProperties withAwsAccountId(String awsAccountId) { + this.awsAccountId = awsAccountId; + return this; + } + + /** + * Get the arn property: Amazon Resource Name (ARN). + * + * @return the arn value. + */ + public String arn() { + return this.arn; + } + + /** + * Set the arn property: Amazon Resource Name (ARN). + * + * @param arn the arn value to set. + * @return the ElasticLoadBalancingv2TargetHealthDescriptionProperties object itself. + */ + public ElasticLoadBalancingv2TargetHealthDescriptionProperties withArn(String arn) { + this.arn = arn; + return this; + } + + /** + * Get the publicCloudResourceName property: Public Cloud Resource Name. + * + * @return the publicCloudResourceName value. + */ + public String publicCloudResourceName() { + return this.publicCloudResourceName; + } + + /** + * Set the publicCloudResourceName property: Public Cloud Resource Name. + * + * @param publicCloudResourceName the publicCloudResourceName value to set. + * @return the ElasticLoadBalancingv2TargetHealthDescriptionProperties object itself. + */ + public ElasticLoadBalancingv2TargetHealthDescriptionProperties + withPublicCloudResourceName(String publicCloudResourceName) { + this.publicCloudResourceName = publicCloudResourceName; + return this; + } + + /** + * Get the awsSourceSchema property: AWS Source Schema. + * + * @return the awsSourceSchema value. + */ + public String awsSourceSchema() { + return this.awsSourceSchema; + } + + /** + * Set the awsSourceSchema property: AWS Source Schema. + * + * @param awsSourceSchema the awsSourceSchema value to set. + * @return the ElasticLoadBalancingv2TargetHealthDescriptionProperties object itself. + */ + public ElasticLoadBalancingv2TargetHealthDescriptionProperties withAwsSourceSchema(String awsSourceSchema) { + this.awsSourceSchema = awsSourceSchema; + return this; + } + + /** + * Get the awsRegion property: AWS Region. + * + * @return the awsRegion value. + */ + public String awsRegion() { + return this.awsRegion; + } + + /** + * Set the awsRegion property: AWS Region. + * + * @param awsRegion the awsRegion value to set. + * @return the ElasticLoadBalancingv2TargetHealthDescriptionProperties object itself. + */ + public ElasticLoadBalancingv2TargetHealthDescriptionProperties withAwsRegion(String awsRegion) { + this.awsRegion = awsRegion; + return this; + } + + /** + * Get the awsTags property: AWS Tags. + * + * @return the awsTags value. + */ + public Map awsTags() { + return this.awsTags; + } + + /** + * Set the awsTags property: AWS Tags. + * + * @param awsTags the awsTags value to set. + * @return the ElasticLoadBalancingv2TargetHealthDescriptionProperties object itself. + */ + public ElasticLoadBalancingv2TargetHealthDescriptionProperties withAwsTags(Map awsTags) { + this.awsTags = awsTags; + return this; + } + + /** + * Get the provisioningState property: The status of the last operation. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (awsProperties() != null) { + awsProperties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("awsProperties", this.awsProperties); + jsonWriter.writeStringField("publicCloudConnectorsResourceId", this.publicCloudConnectorsResourceId); + jsonWriter.writeStringField("awsAccountId", this.awsAccountId); + jsonWriter.writeStringField("arn", this.arn); + jsonWriter.writeStringField("publicCloudResourceName", this.publicCloudResourceName); + jsonWriter.writeStringField("awsSourceSchema", this.awsSourceSchema); + jsonWriter.writeStringField("awsRegion", this.awsRegion); + jsonWriter.writeMapField("awsTags", this.awsTags, (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ElasticLoadBalancingv2TargetHealthDescriptionProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ElasticLoadBalancingv2TargetHealthDescriptionProperties if the JsonReader was pointing to + * an instance of it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ElasticLoadBalancingv2TargetHealthDescriptionProperties. + */ + public static ElasticLoadBalancingv2TargetHealthDescriptionProperties fromJson(JsonReader jsonReader) + throws IOException { + return jsonReader.readObject(reader -> { + ElasticLoadBalancingv2TargetHealthDescriptionProperties deserializedElasticLoadBalancingv2TargetHealthDescriptionProperties + = new ElasticLoadBalancingv2TargetHealthDescriptionProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("awsProperties".equals(fieldName)) { + deserializedElasticLoadBalancingv2TargetHealthDescriptionProperties.awsProperties + = AwsElasticLoadBalancingv2TargetHealthDescriptionProperties.fromJson(reader); + } else if ("publicCloudConnectorsResourceId".equals(fieldName)) { + deserializedElasticLoadBalancingv2TargetHealthDescriptionProperties.publicCloudConnectorsResourceId + = reader.getString(); + } else if ("awsAccountId".equals(fieldName)) { + deserializedElasticLoadBalancingv2TargetHealthDescriptionProperties.awsAccountId + = reader.getString(); + } else if ("arn".equals(fieldName)) { + deserializedElasticLoadBalancingv2TargetHealthDescriptionProperties.arn = reader.getString(); + } else if ("publicCloudResourceName".equals(fieldName)) { + deserializedElasticLoadBalancingv2TargetHealthDescriptionProperties.publicCloudResourceName + = reader.getString(); + } else if ("awsSourceSchema".equals(fieldName)) { + deserializedElasticLoadBalancingv2TargetHealthDescriptionProperties.awsSourceSchema + = reader.getString(); + } else if ("awsRegion".equals(fieldName)) { + deserializedElasticLoadBalancingv2TargetHealthDescriptionProperties.awsRegion = reader.getString(); + } else if ("awsTags".equals(fieldName)) { + Map awsTags = reader.readMap(reader1 -> reader1.getString()); + deserializedElasticLoadBalancingv2TargetHealthDescriptionProperties.awsTags = awsTags; + } else if ("provisioningState".equals(fieldName)) { + deserializedElasticLoadBalancingv2TargetHealthDescriptionProperties.provisioningState + = ProvisioningState.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedElasticLoadBalancingv2TargetHealthDescriptionProperties; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ElasticLoadBalancingv2TargetHealthDescriptionTagsUpdate.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ElasticLoadBalancingv2TargetHealthDescriptionTagsUpdate.java new file mode 100644 index 000000000000..1b3c7457c5e2 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ElasticLoadBalancingv2TargetHealthDescriptionTagsUpdate.java @@ -0,0 +1,98 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.Map; + +/** + * The type used for updating tags in ElasticLoadBalancingv2TargetHealthDescription resources. + */ +@Fluent +public final class ElasticLoadBalancingv2TargetHealthDescriptionTagsUpdate + implements JsonSerializable { + /* + * Resource tags. + */ + private Map tags; + + /** + * Creates an instance of ElasticLoadBalancingv2TargetHealthDescriptionTagsUpdate class. + */ + public ElasticLoadBalancingv2TargetHealthDescriptionTagsUpdate() { + } + + /** + * Get the tags property: Resource tags. + * + * @return the tags value. + */ + public Map tags() { + return this.tags; + } + + /** + * Set the tags property: Resource tags. + * + * @param tags the tags value to set. + * @return the ElasticLoadBalancingv2TargetHealthDescriptionTagsUpdate object itself. + */ + public ElasticLoadBalancingv2TargetHealthDescriptionTagsUpdate withTags(Map tags) { + this.tags = tags; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeMapField("tags", this.tags, (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ElasticLoadBalancingv2TargetHealthDescriptionTagsUpdate from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ElasticLoadBalancingv2TargetHealthDescriptionTagsUpdate if the JsonReader was pointing to + * an instance of it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ElasticLoadBalancingv2TargetHealthDescriptionTagsUpdate. + */ + public static ElasticLoadBalancingv2TargetHealthDescriptionTagsUpdate fromJson(JsonReader jsonReader) + throws IOException { + return jsonReader.readObject(reader -> { + ElasticLoadBalancingv2TargetHealthDescriptionTagsUpdate deserializedElasticLoadBalancingv2TargetHealthDescriptionTagsUpdate + = new ElasticLoadBalancingv2TargetHealthDescriptionTagsUpdate(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedElasticLoadBalancingv2TargetHealthDescriptionTagsUpdate.tags = tags; + } else { + reader.skipChildren(); + } + } + + return deserializedElasticLoadBalancingv2TargetHealthDescriptionTagsUpdate; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ElasticLoadBalancingv2TargetHealthDescriptions.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ElasticLoadBalancingv2TargetHealthDescriptions.java new file mode 100644 index 000000000000..cda8ad213a14 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ElasticLoadBalancingv2TargetHealthDescriptions.java @@ -0,0 +1,163 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** + * Resource collection API of ElasticLoadBalancingv2TargetHealthDescriptions. + */ +public interface ElasticLoadBalancingv2TargetHealthDescriptions { + /** + * List ElasticLoadBalancingv2TargetHealthDescription resources by subscription ID. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a ElasticLoadBalancingv2TargetHealthDescription list operation as paginated response with + * {@link PagedIterable}. + */ + PagedIterable list(); + + /** + * List ElasticLoadBalancingv2TargetHealthDescription resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a ElasticLoadBalancingv2TargetHealthDescription list operation as paginated response with + * {@link PagedIterable}. + */ + PagedIterable list(Context context); + + /** + * List ElasticLoadBalancingv2TargetHealthDescription resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a ElasticLoadBalancingv2TargetHealthDescription list operation as paginated response with + * {@link PagedIterable}. + */ + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * List ElasticLoadBalancingv2TargetHealthDescription resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a ElasticLoadBalancingv2TargetHealthDescription list operation as paginated response with + * {@link PagedIterable}. + */ + PagedIterable listByResourceGroup(String resourceGroupName, + Context context); + + /** + * Get a ElasticLoadBalancingv2TargetHealthDescription. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ElasticLoadBalancingv2TargetHealthDescription. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a ElasticLoadBalancingv2TargetHealthDescription along with {@link Response}. + */ + Response getByResourceGroupWithResponse(String resourceGroupName, + String name, Context context); + + /** + * Get a ElasticLoadBalancingv2TargetHealthDescription. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ElasticLoadBalancingv2TargetHealthDescription. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a ElasticLoadBalancingv2TargetHealthDescription. + */ + ElasticLoadBalancingv2TargetHealthDescription getByResourceGroup(String resourceGroupName, String name); + + /** + * Delete a ElasticLoadBalancingv2TargetHealthDescription. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ElasticLoadBalancingv2TargetHealthDescription. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByResourceGroup(String resourceGroupName, String name); + + /** + * Delete a ElasticLoadBalancingv2TargetHealthDescription. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of ElasticLoadBalancingv2TargetHealthDescription. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String name, Context context); + + /** + * Get a ElasticLoadBalancingv2TargetHealthDescription. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a ElasticLoadBalancingv2TargetHealthDescription along with {@link Response}. + */ + ElasticLoadBalancingv2TargetHealthDescription getById(String id); + + /** + * Get a ElasticLoadBalancingv2TargetHealthDescription. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a ElasticLoadBalancingv2TargetHealthDescription along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Delete a ElasticLoadBalancingv2TargetHealthDescription. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteById(String id); + + /** + * Delete a ElasticLoadBalancingv2TargetHealthDescription. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new ElasticLoadBalancingv2TargetHealthDescription resource. + * + * @param name resource name. + * @return the first stage of the new ElasticLoadBalancingv2TargetHealthDescription definition. + */ + ElasticLoadBalancingv2TargetHealthDescription.DefinitionStages.Blank define(String name); +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/EmrCluster.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/EmrCluster.java new file mode 100644 index 000000000000..8b20144b4ec5 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/EmrCluster.java @@ -0,0 +1,252 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.awsconnector.fluent.models.EmrClusterInner; +import java.util.Map; + +/** + * An immutable client-side representation of EmrCluster. + */ +public interface EmrCluster { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the location property: The geo-location where the resource lives. + * + * @return the location value. + */ + String location(); + + /** + * Gets the tags property: Resource tags. + * + * @return the tags value. + */ + Map tags(); + + /** + * Gets the properties property: The resource-specific properties for this resource. + * + * @return the properties value. + */ + EmrClusterProperties properties(); + + /** + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the region of the resource. + * + * @return the region of the resource. + */ + Region region(); + + /** + * Gets the name of the resource region. + * + * @return the name of the resource region. + */ + String regionName(); + + /** + * Gets the name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + + /** + * Gets the inner com.azure.resourcemanager.awsconnector.fluent.models.EmrClusterInner object. + * + * @return the inner object. + */ + EmrClusterInner innerModel(); + + /** + * The entirety of the EmrCluster definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithLocation, + DefinitionStages.WithResourceGroup, DefinitionStages.WithCreate { + } + + /** + * The EmrCluster definition stages. + */ + interface DefinitionStages { + /** + * The first stage of the EmrCluster definition. + */ + interface Blank extends WithLocation { + } + + /** + * The stage of the EmrCluster definition allowing to specify location. + */ + interface WithLocation { + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithResourceGroup withRegion(Region location); + + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithResourceGroup withRegion(String location); + } + + /** + * The stage of the EmrCluster definition allowing to specify parent resource. + */ + interface WithResourceGroup { + /** + * Specifies resourceGroupName. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @return the next definition stage. + */ + WithCreate withExistingResourceGroup(String resourceGroupName); + } + + /** + * The stage of the EmrCluster 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.WithProperties { + /** + * Executes the create request. + * + * @return the created resource. + */ + EmrCluster create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + EmrCluster create(Context context); + } + + /** + * The stage of the EmrCluster definition allowing to specify tags. + */ + interface WithTags { + /** + * Specifies the tags property: Resource tags.. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + WithCreate withTags(Map tags); + } + + /** + * The stage of the EmrCluster definition allowing to specify properties. + */ + interface WithProperties { + /** + * Specifies the properties property: The resource-specific properties for this resource.. + * + * @param properties The resource-specific properties for this resource. + * @return the next definition stage. + */ + WithCreate withProperties(EmrClusterProperties properties); + } + } + + /** + * Begins update for the EmrCluster resource. + * + * @return the stage of resource update. + */ + EmrCluster.Update update(); + + /** + * The template for EmrCluster update. + */ + interface Update extends UpdateStages.WithTags { + /** + * Executes the update request. + * + * @return the updated resource. + */ + EmrCluster apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + EmrCluster apply(Context context); + } + + /** + * The EmrCluster update stages. + */ + interface UpdateStages { + /** + * The stage of the EmrCluster update allowing to specify tags. + */ + interface WithTags { + /** + * Specifies the tags property: Resource tags.. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + Update withTags(Map tags); + } + } + + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + EmrCluster refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + EmrCluster refresh(Context context); +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/EmrClusterListResult.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/EmrClusterListResult.java new file mode 100644 index 000000000000..519c55d2e14f --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/EmrClusterListResult.java @@ -0,0 +1,134 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.awsconnector.fluent.models.EmrClusterInner; +import java.io.IOException; +import java.util.List; + +/** + * The response of a EmrCluster list operation. + */ +@Fluent +public final class EmrClusterListResult implements JsonSerializable { + /* + * The EmrCluster items on this page + */ + private List value; + + /* + * The link to the next page of items + */ + private String nextLink; + + /** + * Creates an instance of EmrClusterListResult class. + */ + public EmrClusterListResult() { + } + + /** + * Get the value property: The EmrCluster items on this page. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The EmrCluster items on this page. + * + * @param value the value value to set. + * @return the EmrClusterListResult object itself. + */ + public EmrClusterListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The link to the next page of items. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: The link to the next page of items. + * + * @param nextLink the nextLink value to set. + * @return the EmrClusterListResult object itself. + */ + public EmrClusterListResult withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property value in model EmrClusterListResult")); + } else { + value().forEach(e -> e.validate()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(EmrClusterListResult.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("nextLink", this.nextLink); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of EmrClusterListResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of EmrClusterListResult if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the EmrClusterListResult. + */ + public static EmrClusterListResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + EmrClusterListResult deserializedEmrClusterListResult = new EmrClusterListResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value = reader.readArray(reader1 -> EmrClusterInner.fromJson(reader1)); + deserializedEmrClusterListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedEmrClusterListResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedEmrClusterListResult; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/EmrClusterProperties.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/EmrClusterProperties.java new file mode 100644 index 000000000000..db8fde03b2b4 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/EmrClusterProperties.java @@ -0,0 +1,311 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.Map; + +/** + * Definition of EmrCluster. + */ +@Fluent +public final class EmrClusterProperties implements JsonSerializable { + /* + * AWS Properties + */ + private AwsEmrClusterProperties awsProperties; + + /* + * Public Cloud Connectors Resource ID + */ + private String publicCloudConnectorsResourceId; + + /* + * AWS Account ID + */ + private String awsAccountId; + + /* + * Amazon Resource Name (ARN) + */ + private String arn; + + /* + * Public Cloud Resource Name + */ + private String publicCloudResourceName; + + /* + * AWS Source Schema + */ + private String awsSourceSchema; + + /* + * AWS Region + */ + private String awsRegion; + + /* + * AWS Tags + */ + private Map awsTags; + + /* + * The status of the last operation. + */ + private ProvisioningState provisioningState; + + /** + * Creates an instance of EmrClusterProperties class. + */ + public EmrClusterProperties() { + } + + /** + * Get the awsProperties property: AWS Properties. + * + * @return the awsProperties value. + */ + public AwsEmrClusterProperties awsProperties() { + return this.awsProperties; + } + + /** + * Set the awsProperties property: AWS Properties. + * + * @param awsProperties the awsProperties value to set. + * @return the EmrClusterProperties object itself. + */ + public EmrClusterProperties withAwsProperties(AwsEmrClusterProperties awsProperties) { + this.awsProperties = awsProperties; + return this; + } + + /** + * Get the publicCloudConnectorsResourceId property: Public Cloud Connectors Resource ID. + * + * @return the publicCloudConnectorsResourceId value. + */ + public String publicCloudConnectorsResourceId() { + return this.publicCloudConnectorsResourceId; + } + + /** + * Set the publicCloudConnectorsResourceId property: Public Cloud Connectors Resource ID. + * + * @param publicCloudConnectorsResourceId the publicCloudConnectorsResourceId value to set. + * @return the EmrClusterProperties object itself. + */ + public EmrClusterProperties withPublicCloudConnectorsResourceId(String publicCloudConnectorsResourceId) { + this.publicCloudConnectorsResourceId = publicCloudConnectorsResourceId; + return this; + } + + /** + * Get the awsAccountId property: AWS Account ID. + * + * @return the awsAccountId value. + */ + public String awsAccountId() { + return this.awsAccountId; + } + + /** + * Set the awsAccountId property: AWS Account ID. + * + * @param awsAccountId the awsAccountId value to set. + * @return the EmrClusterProperties object itself. + */ + public EmrClusterProperties withAwsAccountId(String awsAccountId) { + this.awsAccountId = awsAccountId; + return this; + } + + /** + * Get the arn property: Amazon Resource Name (ARN). + * + * @return the arn value. + */ + public String arn() { + return this.arn; + } + + /** + * Set the arn property: Amazon Resource Name (ARN). + * + * @param arn the arn value to set. + * @return the EmrClusterProperties object itself. + */ + public EmrClusterProperties withArn(String arn) { + this.arn = arn; + return this; + } + + /** + * Get the publicCloudResourceName property: Public Cloud Resource Name. + * + * @return the publicCloudResourceName value. + */ + public String publicCloudResourceName() { + return this.publicCloudResourceName; + } + + /** + * Set the publicCloudResourceName property: Public Cloud Resource Name. + * + * @param publicCloudResourceName the publicCloudResourceName value to set. + * @return the EmrClusterProperties object itself. + */ + public EmrClusterProperties withPublicCloudResourceName(String publicCloudResourceName) { + this.publicCloudResourceName = publicCloudResourceName; + return this; + } + + /** + * Get the awsSourceSchema property: AWS Source Schema. + * + * @return the awsSourceSchema value. + */ + public String awsSourceSchema() { + return this.awsSourceSchema; + } + + /** + * Set the awsSourceSchema property: AWS Source Schema. + * + * @param awsSourceSchema the awsSourceSchema value to set. + * @return the EmrClusterProperties object itself. + */ + public EmrClusterProperties withAwsSourceSchema(String awsSourceSchema) { + this.awsSourceSchema = awsSourceSchema; + return this; + } + + /** + * Get the awsRegion property: AWS Region. + * + * @return the awsRegion value. + */ + public String awsRegion() { + return this.awsRegion; + } + + /** + * Set the awsRegion property: AWS Region. + * + * @param awsRegion the awsRegion value to set. + * @return the EmrClusterProperties object itself. + */ + public EmrClusterProperties withAwsRegion(String awsRegion) { + this.awsRegion = awsRegion; + return this; + } + + /** + * Get the awsTags property: AWS Tags. + * + * @return the awsTags value. + */ + public Map awsTags() { + return this.awsTags; + } + + /** + * Set the awsTags property: AWS Tags. + * + * @param awsTags the awsTags value to set. + * @return the EmrClusterProperties object itself. + */ + public EmrClusterProperties withAwsTags(Map awsTags) { + this.awsTags = awsTags; + return this; + } + + /** + * Get the provisioningState property: The status of the last operation. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (awsProperties() != null) { + awsProperties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("awsProperties", this.awsProperties); + jsonWriter.writeStringField("publicCloudConnectorsResourceId", this.publicCloudConnectorsResourceId); + jsonWriter.writeStringField("awsAccountId", this.awsAccountId); + jsonWriter.writeStringField("arn", this.arn); + jsonWriter.writeStringField("publicCloudResourceName", this.publicCloudResourceName); + jsonWriter.writeStringField("awsSourceSchema", this.awsSourceSchema); + jsonWriter.writeStringField("awsRegion", this.awsRegion); + jsonWriter.writeMapField("awsTags", this.awsTags, (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of EmrClusterProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of EmrClusterProperties if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the EmrClusterProperties. + */ + public static EmrClusterProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + EmrClusterProperties deserializedEmrClusterProperties = new EmrClusterProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("awsProperties".equals(fieldName)) { + deserializedEmrClusterProperties.awsProperties = AwsEmrClusterProperties.fromJson(reader); + } else if ("publicCloudConnectorsResourceId".equals(fieldName)) { + deserializedEmrClusterProperties.publicCloudConnectorsResourceId = reader.getString(); + } else if ("awsAccountId".equals(fieldName)) { + deserializedEmrClusterProperties.awsAccountId = reader.getString(); + } else if ("arn".equals(fieldName)) { + deserializedEmrClusterProperties.arn = reader.getString(); + } else if ("publicCloudResourceName".equals(fieldName)) { + deserializedEmrClusterProperties.publicCloudResourceName = reader.getString(); + } else if ("awsSourceSchema".equals(fieldName)) { + deserializedEmrClusterProperties.awsSourceSchema = reader.getString(); + } else if ("awsRegion".equals(fieldName)) { + deserializedEmrClusterProperties.awsRegion = reader.getString(); + } else if ("awsTags".equals(fieldName)) { + Map awsTags = reader.readMap(reader1 -> reader1.getString()); + deserializedEmrClusterProperties.awsTags = awsTags; + } else if ("provisioningState".equals(fieldName)) { + deserializedEmrClusterProperties.provisioningState + = ProvisioningState.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedEmrClusterProperties; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/EmrClusterSummaries.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/EmrClusterSummaries.java new file mode 100644 index 000000000000..9ffd6c28b2c0 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/EmrClusterSummaries.java @@ -0,0 +1,157 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** + * Resource collection API of EmrClusterSummaries. + */ +public interface EmrClusterSummaries { + /** + * List EmrClusterSummary resources by subscription ID. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a EmrClusterSummary list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable list(); + + /** + * List EmrClusterSummary resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a EmrClusterSummary list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable list(Context context); + + /** + * List EmrClusterSummary resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a EmrClusterSummary list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * List EmrClusterSummary resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a EmrClusterSummary list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Get a EmrClusterSummary. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of EmrClusterSummary. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a EmrClusterSummary along with {@link Response}. + */ + Response getByResourceGroupWithResponse(String resourceGroupName, String name, Context context); + + /** + * Get a EmrClusterSummary. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of EmrClusterSummary. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a EmrClusterSummary. + */ + EmrClusterSummary getByResourceGroup(String resourceGroupName, String name); + + /** + * Delete a EmrClusterSummary. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of EmrClusterSummary. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByResourceGroup(String resourceGroupName, String name); + + /** + * Delete a EmrClusterSummary. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of EmrClusterSummary. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String name, Context context); + + /** + * Get a EmrClusterSummary. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a EmrClusterSummary along with {@link Response}. + */ + EmrClusterSummary getById(String id); + + /** + * Get a EmrClusterSummary. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a EmrClusterSummary along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Delete a EmrClusterSummary. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteById(String id); + + /** + * Delete a EmrClusterSummary. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new EmrClusterSummary resource. + * + * @param name resource name. + * @return the first stage of the new EmrClusterSummary definition. + */ + EmrClusterSummary.DefinitionStages.Blank define(String name); +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/EmrClusterSummary.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/EmrClusterSummary.java new file mode 100644 index 000000000000..5084e156f852 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/EmrClusterSummary.java @@ -0,0 +1,252 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.awsconnector.fluent.models.EmrClusterSummaryInner; +import java.util.Map; + +/** + * An immutable client-side representation of EmrClusterSummary. + */ +public interface EmrClusterSummary { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the location property: The geo-location where the resource lives. + * + * @return the location value. + */ + String location(); + + /** + * Gets the tags property: Resource tags. + * + * @return the tags value. + */ + Map tags(); + + /** + * Gets the properties property: The resource-specific properties for this resource. + * + * @return the properties value. + */ + EmrClusterSummaryProperties properties(); + + /** + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the region of the resource. + * + * @return the region of the resource. + */ + Region region(); + + /** + * Gets the name of the resource region. + * + * @return the name of the resource region. + */ + String regionName(); + + /** + * Gets the name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + + /** + * Gets the inner com.azure.resourcemanager.awsconnector.fluent.models.EmrClusterSummaryInner object. + * + * @return the inner object. + */ + EmrClusterSummaryInner innerModel(); + + /** + * The entirety of the EmrClusterSummary definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithLocation, + DefinitionStages.WithResourceGroup, DefinitionStages.WithCreate { + } + + /** + * The EmrClusterSummary definition stages. + */ + interface DefinitionStages { + /** + * The first stage of the EmrClusterSummary definition. + */ + interface Blank extends WithLocation { + } + + /** + * The stage of the EmrClusterSummary definition allowing to specify location. + */ + interface WithLocation { + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithResourceGroup withRegion(Region location); + + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithResourceGroup withRegion(String location); + } + + /** + * The stage of the EmrClusterSummary definition allowing to specify parent resource. + */ + interface WithResourceGroup { + /** + * Specifies resourceGroupName. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @return the next definition stage. + */ + WithCreate withExistingResourceGroup(String resourceGroupName); + } + + /** + * The stage of the EmrClusterSummary 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.WithProperties { + /** + * Executes the create request. + * + * @return the created resource. + */ + EmrClusterSummary create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + EmrClusterSummary create(Context context); + } + + /** + * The stage of the EmrClusterSummary definition allowing to specify tags. + */ + interface WithTags { + /** + * Specifies the tags property: Resource tags.. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + WithCreate withTags(Map tags); + } + + /** + * The stage of the EmrClusterSummary definition allowing to specify properties. + */ + interface WithProperties { + /** + * Specifies the properties property: The resource-specific properties for this resource.. + * + * @param properties The resource-specific properties for this resource. + * @return the next definition stage. + */ + WithCreate withProperties(EmrClusterSummaryProperties properties); + } + } + + /** + * Begins update for the EmrClusterSummary resource. + * + * @return the stage of resource update. + */ + EmrClusterSummary.Update update(); + + /** + * The template for EmrClusterSummary update. + */ + interface Update extends UpdateStages.WithTags { + /** + * Executes the update request. + * + * @return the updated resource. + */ + EmrClusterSummary apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + EmrClusterSummary apply(Context context); + } + + /** + * The EmrClusterSummary update stages. + */ + interface UpdateStages { + /** + * The stage of the EmrClusterSummary update allowing to specify tags. + */ + interface WithTags { + /** + * Specifies the tags property: Resource tags.. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + Update withTags(Map tags); + } + } + + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + EmrClusterSummary refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + EmrClusterSummary refresh(Context context); +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/EmrClusterSummaryListResult.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/EmrClusterSummaryListResult.java new file mode 100644 index 000000000000..c7a2d640f247 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/EmrClusterSummaryListResult.java @@ -0,0 +1,136 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.awsconnector.fluent.models.EmrClusterSummaryInner; +import java.io.IOException; +import java.util.List; + +/** + * The response of a EmrClusterSummary list operation. + */ +@Fluent +public final class EmrClusterSummaryListResult implements JsonSerializable { + /* + * The EmrClusterSummary items on this page + */ + private List value; + + /* + * The link to the next page of items + */ + private String nextLink; + + /** + * Creates an instance of EmrClusterSummaryListResult class. + */ + public EmrClusterSummaryListResult() { + } + + /** + * Get the value property: The EmrClusterSummary items on this page. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The EmrClusterSummary items on this page. + * + * @param value the value value to set. + * @return the EmrClusterSummaryListResult object itself. + */ + public EmrClusterSummaryListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The link to the next page of items. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: The link to the next page of items. + * + * @param nextLink the nextLink value to set. + * @return the EmrClusterSummaryListResult object itself. + */ + public EmrClusterSummaryListResult withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property value in model EmrClusterSummaryListResult")); + } else { + value().forEach(e -> e.validate()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(EmrClusterSummaryListResult.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("nextLink", this.nextLink); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of EmrClusterSummaryListResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of EmrClusterSummaryListResult if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the EmrClusterSummaryListResult. + */ + public static EmrClusterSummaryListResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + EmrClusterSummaryListResult deserializedEmrClusterSummaryListResult = new EmrClusterSummaryListResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> EmrClusterSummaryInner.fromJson(reader1)); + deserializedEmrClusterSummaryListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedEmrClusterSummaryListResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedEmrClusterSummaryListResult; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/EmrClusterSummaryProperties.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/EmrClusterSummaryProperties.java new file mode 100644 index 000000000000..669d72fc94c6 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/EmrClusterSummaryProperties.java @@ -0,0 +1,312 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.Map; + +/** + * Definition of EmrClusterSummary. + */ +@Fluent +public final class EmrClusterSummaryProperties implements JsonSerializable { + /* + * AWS Properties + */ + private AwsEmrClusterSummaryProperties awsProperties; + + /* + * Public Cloud Connectors Resource ID + */ + private String publicCloudConnectorsResourceId; + + /* + * AWS Account ID + */ + private String awsAccountId; + + /* + * Amazon Resource Name (ARN) + */ + private String arn; + + /* + * Public Cloud Resource Name + */ + private String publicCloudResourceName; + + /* + * AWS Source Schema + */ + private String awsSourceSchema; + + /* + * AWS Region + */ + private String awsRegion; + + /* + * AWS Tags + */ + private Map awsTags; + + /* + * The status of the last operation. + */ + private ProvisioningState provisioningState; + + /** + * Creates an instance of EmrClusterSummaryProperties class. + */ + public EmrClusterSummaryProperties() { + } + + /** + * Get the awsProperties property: AWS Properties. + * + * @return the awsProperties value. + */ + public AwsEmrClusterSummaryProperties awsProperties() { + return this.awsProperties; + } + + /** + * Set the awsProperties property: AWS Properties. + * + * @param awsProperties the awsProperties value to set. + * @return the EmrClusterSummaryProperties object itself. + */ + public EmrClusterSummaryProperties withAwsProperties(AwsEmrClusterSummaryProperties awsProperties) { + this.awsProperties = awsProperties; + return this; + } + + /** + * Get the publicCloudConnectorsResourceId property: Public Cloud Connectors Resource ID. + * + * @return the publicCloudConnectorsResourceId value. + */ + public String publicCloudConnectorsResourceId() { + return this.publicCloudConnectorsResourceId; + } + + /** + * Set the publicCloudConnectorsResourceId property: Public Cloud Connectors Resource ID. + * + * @param publicCloudConnectorsResourceId the publicCloudConnectorsResourceId value to set. + * @return the EmrClusterSummaryProperties object itself. + */ + public EmrClusterSummaryProperties withPublicCloudConnectorsResourceId(String publicCloudConnectorsResourceId) { + this.publicCloudConnectorsResourceId = publicCloudConnectorsResourceId; + return this; + } + + /** + * Get the awsAccountId property: AWS Account ID. + * + * @return the awsAccountId value. + */ + public String awsAccountId() { + return this.awsAccountId; + } + + /** + * Set the awsAccountId property: AWS Account ID. + * + * @param awsAccountId the awsAccountId value to set. + * @return the EmrClusterSummaryProperties object itself. + */ + public EmrClusterSummaryProperties withAwsAccountId(String awsAccountId) { + this.awsAccountId = awsAccountId; + return this; + } + + /** + * Get the arn property: Amazon Resource Name (ARN). + * + * @return the arn value. + */ + public String arn() { + return this.arn; + } + + /** + * Set the arn property: Amazon Resource Name (ARN). + * + * @param arn the arn value to set. + * @return the EmrClusterSummaryProperties object itself. + */ + public EmrClusterSummaryProperties withArn(String arn) { + this.arn = arn; + return this; + } + + /** + * Get the publicCloudResourceName property: Public Cloud Resource Name. + * + * @return the publicCloudResourceName value. + */ + public String publicCloudResourceName() { + return this.publicCloudResourceName; + } + + /** + * Set the publicCloudResourceName property: Public Cloud Resource Name. + * + * @param publicCloudResourceName the publicCloudResourceName value to set. + * @return the EmrClusterSummaryProperties object itself. + */ + public EmrClusterSummaryProperties withPublicCloudResourceName(String publicCloudResourceName) { + this.publicCloudResourceName = publicCloudResourceName; + return this; + } + + /** + * Get the awsSourceSchema property: AWS Source Schema. + * + * @return the awsSourceSchema value. + */ + public String awsSourceSchema() { + return this.awsSourceSchema; + } + + /** + * Set the awsSourceSchema property: AWS Source Schema. + * + * @param awsSourceSchema the awsSourceSchema value to set. + * @return the EmrClusterSummaryProperties object itself. + */ + public EmrClusterSummaryProperties withAwsSourceSchema(String awsSourceSchema) { + this.awsSourceSchema = awsSourceSchema; + return this; + } + + /** + * Get the awsRegion property: AWS Region. + * + * @return the awsRegion value. + */ + public String awsRegion() { + return this.awsRegion; + } + + /** + * Set the awsRegion property: AWS Region. + * + * @param awsRegion the awsRegion value to set. + * @return the EmrClusterSummaryProperties object itself. + */ + public EmrClusterSummaryProperties withAwsRegion(String awsRegion) { + this.awsRegion = awsRegion; + return this; + } + + /** + * Get the awsTags property: AWS Tags. + * + * @return the awsTags value. + */ + public Map awsTags() { + return this.awsTags; + } + + /** + * Set the awsTags property: AWS Tags. + * + * @param awsTags the awsTags value to set. + * @return the EmrClusterSummaryProperties object itself. + */ + public EmrClusterSummaryProperties withAwsTags(Map awsTags) { + this.awsTags = awsTags; + return this; + } + + /** + * Get the provisioningState property: The status of the last operation. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (awsProperties() != null) { + awsProperties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("awsProperties", this.awsProperties); + jsonWriter.writeStringField("publicCloudConnectorsResourceId", this.publicCloudConnectorsResourceId); + jsonWriter.writeStringField("awsAccountId", this.awsAccountId); + jsonWriter.writeStringField("arn", this.arn); + jsonWriter.writeStringField("publicCloudResourceName", this.publicCloudResourceName); + jsonWriter.writeStringField("awsSourceSchema", this.awsSourceSchema); + jsonWriter.writeStringField("awsRegion", this.awsRegion); + jsonWriter.writeMapField("awsTags", this.awsTags, (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of EmrClusterSummaryProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of EmrClusterSummaryProperties if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the EmrClusterSummaryProperties. + */ + public static EmrClusterSummaryProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + EmrClusterSummaryProperties deserializedEmrClusterSummaryProperties = new EmrClusterSummaryProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("awsProperties".equals(fieldName)) { + deserializedEmrClusterSummaryProperties.awsProperties + = AwsEmrClusterSummaryProperties.fromJson(reader); + } else if ("publicCloudConnectorsResourceId".equals(fieldName)) { + deserializedEmrClusterSummaryProperties.publicCloudConnectorsResourceId = reader.getString(); + } else if ("awsAccountId".equals(fieldName)) { + deserializedEmrClusterSummaryProperties.awsAccountId = reader.getString(); + } else if ("arn".equals(fieldName)) { + deserializedEmrClusterSummaryProperties.arn = reader.getString(); + } else if ("publicCloudResourceName".equals(fieldName)) { + deserializedEmrClusterSummaryProperties.publicCloudResourceName = reader.getString(); + } else if ("awsSourceSchema".equals(fieldName)) { + deserializedEmrClusterSummaryProperties.awsSourceSchema = reader.getString(); + } else if ("awsRegion".equals(fieldName)) { + deserializedEmrClusterSummaryProperties.awsRegion = reader.getString(); + } else if ("awsTags".equals(fieldName)) { + Map awsTags = reader.readMap(reader1 -> reader1.getString()); + deserializedEmrClusterSummaryProperties.awsTags = awsTags; + } else if ("provisioningState".equals(fieldName)) { + deserializedEmrClusterSummaryProperties.provisioningState + = ProvisioningState.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedEmrClusterSummaryProperties; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/EmrClusterSummaryTagsUpdate.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/EmrClusterSummaryTagsUpdate.java new file mode 100644 index 000000000000..d94a077eb1ef --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/EmrClusterSummaryTagsUpdate.java @@ -0,0 +1,95 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.Map; + +/** + * The type used for updating tags in EmrClusterSummary resources. + */ +@Fluent +public final class EmrClusterSummaryTagsUpdate implements JsonSerializable { + /* + * Resource tags. + */ + private Map tags; + + /** + * Creates an instance of EmrClusterSummaryTagsUpdate class. + */ + public EmrClusterSummaryTagsUpdate() { + } + + /** + * Get the tags property: Resource tags. + * + * @return the tags value. + */ + public Map tags() { + return this.tags; + } + + /** + * Set the tags property: Resource tags. + * + * @param tags the tags value to set. + * @return the EmrClusterSummaryTagsUpdate object itself. + */ + public EmrClusterSummaryTagsUpdate withTags(Map tags) { + this.tags = tags; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeMapField("tags", this.tags, (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of EmrClusterSummaryTagsUpdate from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of EmrClusterSummaryTagsUpdate if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the EmrClusterSummaryTagsUpdate. + */ + public static EmrClusterSummaryTagsUpdate fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + EmrClusterSummaryTagsUpdate deserializedEmrClusterSummaryTagsUpdate = new EmrClusterSummaryTagsUpdate(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedEmrClusterSummaryTagsUpdate.tags = tags; + } else { + reader.skipChildren(); + } + } + + return deserializedEmrClusterSummaryTagsUpdate; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/EmrClusterTagsUpdate.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/EmrClusterTagsUpdate.java new file mode 100644 index 000000000000..c8a5fc589dc8 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/EmrClusterTagsUpdate.java @@ -0,0 +1,95 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.Map; + +/** + * The type used for updating tags in EmrCluster resources. + */ +@Fluent +public final class EmrClusterTagsUpdate implements JsonSerializable { + /* + * Resource tags. + */ + private Map tags; + + /** + * Creates an instance of EmrClusterTagsUpdate class. + */ + public EmrClusterTagsUpdate() { + } + + /** + * Get the tags property: Resource tags. + * + * @return the tags value. + */ + public Map tags() { + return this.tags; + } + + /** + * Set the tags property: Resource tags. + * + * @param tags the tags value to set. + * @return the EmrClusterTagsUpdate object itself. + */ + public EmrClusterTagsUpdate withTags(Map tags) { + this.tags = tags; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeMapField("tags", this.tags, (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of EmrClusterTagsUpdate from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of EmrClusterTagsUpdate if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the EmrClusterTagsUpdate. + */ + public static EmrClusterTagsUpdate fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + EmrClusterTagsUpdate deserializedEmrClusterTagsUpdate = new EmrClusterTagsUpdate(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedEmrClusterTagsUpdate.tags = tags; + } else { + reader.skipChildren(); + } + } + + return deserializedEmrClusterTagsUpdate; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/EmrClusters.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/EmrClusters.java new file mode 100644 index 000000000000..b60e98db157f --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/EmrClusters.java @@ -0,0 +1,157 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** + * Resource collection API of EmrClusters. + */ +public interface EmrClusters { + /** + * List EmrCluster resources by subscription ID. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a EmrCluster list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable list(); + + /** + * List EmrCluster resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a EmrCluster list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable list(Context context); + + /** + * List EmrCluster resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a EmrCluster list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * List EmrCluster resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a EmrCluster list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Get a EmrCluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of EmrCluster. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a EmrCluster along with {@link Response}. + */ + Response getByResourceGroupWithResponse(String resourceGroupName, String name, Context context); + + /** + * Get a EmrCluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of EmrCluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a EmrCluster. + */ + EmrCluster getByResourceGroup(String resourceGroupName, String name); + + /** + * Delete a EmrCluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of EmrCluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByResourceGroup(String resourceGroupName, String name); + + /** + * Delete a EmrCluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of EmrCluster. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String name, Context context); + + /** + * Get a EmrCluster. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a EmrCluster along with {@link Response}. + */ + EmrCluster getById(String id); + + /** + * Get a EmrCluster. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a EmrCluster along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Delete a EmrCluster. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteById(String id); + + /** + * Delete a EmrCluster. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new EmrCluster resource. + * + * @param name resource name. + * @return the first stage of the new EmrCluster definition. + */ + EmrCluster.DefinitionStages.Blank define(String name); +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/EnclaveOptions.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/EnclaveOptions.java new file mode 100644 index 000000000000..7ccc65c794d5 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/EnclaveOptions.java @@ -0,0 +1,98 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of EnclaveOptions. + */ +@Fluent +public final class EnclaveOptions implements JsonSerializable { + /* + *

If this parameter is set to true, the instance is enabled for Amazon Web Services Nitro Enclaves; + * otherwise, it is not enabled for Amazon Web Services Nitro Enclaves.

+ */ + private Boolean enabled; + + /** + * Creates an instance of EnclaveOptions class. + */ + public EnclaveOptions() { + } + + /** + * Get the enabled property: <p>If this parameter is set to <code>true</code>, the instance is + * enabled for Amazon Web Services Nitro Enclaves; otherwise, it is not enabled for Amazon Web Services Nitro + * Enclaves.</p>. + * + * @return the enabled value. + */ + public Boolean enabled() { + return this.enabled; + } + + /** + * Set the enabled property: <p>If this parameter is set to <code>true</code>, the instance is + * enabled for Amazon Web Services Nitro Enclaves; otherwise, it is not enabled for Amazon Web Services Nitro + * Enclaves.</p>. + * + * @param enabled the enabled value to set. + * @return the EnclaveOptions object itself. + */ + public EnclaveOptions withEnabled(Boolean enabled) { + this.enabled = enabled; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeBooleanField("enabled", this.enabled); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of EnclaveOptions from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of EnclaveOptions if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the EnclaveOptions. + */ + public static EnclaveOptions fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + EnclaveOptions deserializedEnclaveOptions = new EnclaveOptions(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("enabled".equals(fieldName)) { + deserializedEnclaveOptions.enabled = reader.getNullable(JsonReader::getBoolean); + } else { + reader.skipChildren(); + } + } + + return deserializedEnclaveOptions; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/EncryptionAtRestOptions.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/EncryptionAtRestOptions.java new file mode 100644 index 000000000000..e53802a919d6 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/EncryptionAtRestOptions.java @@ -0,0 +1,123 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of EncryptionAtRestOptions. + */ +@Fluent +public final class EncryptionAtRestOptions implements JsonSerializable { + /* + *

True to enable encryption at rest.

+ */ + private Boolean enabled; + + /* + *

The KMS key ID. Takes the form 1a2a3a4-1a2a-3a4a-5a6a-1a2a3a4a5a6a.

+ */ + private String kmsKeyId; + + /** + * Creates an instance of EncryptionAtRestOptions class. + */ + public EncryptionAtRestOptions() { + } + + /** + * Get the enabled property: <p>True to enable encryption at rest.</p>. + * + * @return the enabled value. + */ + public Boolean enabled() { + return this.enabled; + } + + /** + * Set the enabled property: <p>True to enable encryption at rest.</p>. + * + * @param enabled the enabled value to set. + * @return the EncryptionAtRestOptions object itself. + */ + public EncryptionAtRestOptions withEnabled(Boolean enabled) { + this.enabled = enabled; + return this; + } + + /** + * Get the kmsKeyId property: <p>The KMS key ID. Takes the form + * <code>1a2a3a4-1a2a-3a4a-5a6a-1a2a3a4a5a6a</code>.</p>. + * + * @return the kmsKeyId value. + */ + public String kmsKeyId() { + return this.kmsKeyId; + } + + /** + * Set the kmsKeyId property: <p>The KMS key ID. Takes the form + * <code>1a2a3a4-1a2a-3a4a-5a6a-1a2a3a4a5a6a</code>.</p>. + * + * @param kmsKeyId the kmsKeyId value to set. + * @return the EncryptionAtRestOptions object itself. + */ + public EncryptionAtRestOptions withKmsKeyId(String kmsKeyId) { + this.kmsKeyId = kmsKeyId; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeBooleanField("enabled", this.enabled); + jsonWriter.writeStringField("kmsKeyId", this.kmsKeyId); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of EncryptionAtRestOptions from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of EncryptionAtRestOptions if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the EncryptionAtRestOptions. + */ + public static EncryptionAtRestOptions fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + EncryptionAtRestOptions deserializedEncryptionAtRestOptions = new EncryptionAtRestOptions(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("enabled".equals(fieldName)) { + deserializedEncryptionAtRestOptions.enabled = reader.getNullable(JsonReader::getBoolean); + } else if ("kmsKeyId".equals(fieldName)) { + deserializedEncryptionAtRestOptions.kmsKeyId = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedEncryptionAtRestOptions; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/EncryptionConfig.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/EncryptionConfig.java new file mode 100644 index 000000000000..3169039447fa --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/EncryptionConfig.java @@ -0,0 +1,130 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Definition of EncryptionConfig. + */ +@Fluent +public final class EncryptionConfig implements JsonSerializable { + /* + *

Key Management Service (KMS) key. Either the ARN or the alias can be used.

+ */ + private Provider provider; + + /* + *

Specifies the resources to be encrypted. The only supported value is secrets.

+ */ + private List resources; + + /** + * Creates an instance of EncryptionConfig class. + */ + public EncryptionConfig() { + } + + /** + * Get the provider property: <p>Key Management Service (KMS) key. Either the ARN or the alias can be + * used.</p>. + * + * @return the provider value. + */ + public Provider provider() { + return this.provider; + } + + /** + * Set the provider property: <p>Key Management Service (KMS) key. Either the ARN or the alias can be + * used.</p>. + * + * @param provider the provider value to set. + * @return the EncryptionConfig object itself. + */ + public EncryptionConfig withProvider(Provider provider) { + this.provider = provider; + return this; + } + + /** + * Get the resources property: <p>Specifies the resources to be encrypted. The only supported value is + * <code>secrets</code>.</p>. + * + * @return the resources value. + */ + public List resources() { + return this.resources; + } + + /** + * Set the resources property: <p>Specifies the resources to be encrypted. The only supported value is + * <code>secrets</code>.</p>. + * + * @param resources the resources value to set. + * @return the EncryptionConfig object itself. + */ + public EncryptionConfig withResources(List resources) { + this.resources = resources; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (provider() != null) { + provider().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("provider", this.provider); + jsonWriter.writeArrayField("resources", this.resources, (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of EncryptionConfig from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of EncryptionConfig if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the EncryptionConfig. + */ + public static EncryptionConfig fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + EncryptionConfig deserializedEncryptionConfig = new EncryptionConfig(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("provider".equals(fieldName)) { + deserializedEncryptionConfig.provider = Provider.fromJson(reader); + } else if ("resources".equals(fieldName)) { + List resources = reader.readArray(reader1 -> reader1.getString()); + deserializedEncryptionConfig.resources = resources; + } else { + reader.skipChildren(); + } + } + + return deserializedEncryptionConfig; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/EncryptionConfiguration.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/EncryptionConfiguration.java new file mode 100644 index 000000000000..171f1d54f2b5 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/EncryptionConfiguration.java @@ -0,0 +1,167 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of EncryptionConfiguration. + */ +@Fluent +public final class EncryptionConfiguration implements JsonSerializable { + /* + * The encryption type to use. If you use the ``KMS`` encryption type, the contents of the repository will be + * encrypted using server-side encryption with KMSlong key stored in KMS. When you use KMS to encrypt your data, you + * can either use the default AWS managed KMS key for Amazon ECR, or specify your own KMS key, which you already + * created. For more information, see [Protecting data using server-side encryption with an key stored in + * (SSE-KMS)](https://docs.aws.amazon.com/AmazonS3/latest/dev/UsingKMSEncryption.html) in the *Amazon Simple Storage + * Service Console Developer Guide*. If you use the ``AES256`` encryption type, Amazon ECR uses server-side + * encryption with Amazon S3-managed encryption keys which encrypts the images in the repository using an AES-256 + * encryption algorithm. For more information, see [Protecting data using server-side encryption with Amazon + * S3-managed encryption keys + * (SSE-S3)](https://docs.aws.amazon.com/AmazonS3/latest/dev/UsingServerSideEncryption.html) in the *Ama The + * encryption type to use. + */ + private EncryptionConfigurationEncryptionType encryptionType; + + /* + * If you use the ``KMS`` encryption type, specify the KMS key to use for encryption. The alias, key ID, or full ARN + * of the KMS key can be specified. The key must exist in the same Region as the repository. If no key is specified, + * the default AWS managed KMS key for Amazon ECR will be used. If you use the KMS encryption type, specify the CMK + * to use for encryption. The alias, key ID, or full ARN of the CMK can be specified. The key must exist in the same + * Region as the repository. If no key is specified, the default AWS managed CMK for Amazon ECR will be used. + */ + private String kmsKey; + + /** + * Creates an instance of EncryptionConfiguration class. + */ + public EncryptionConfiguration() { + } + + /** + * Get the encryptionType property: The encryption type to use. If you use the ``KMS`` encryption type, the contents + * of the repository will be encrypted using server-side encryption with KMSlong key stored in KMS. When you use KMS + * to encrypt your data, you can either use the default AWS managed KMS key for Amazon ECR, or specify your own KMS + * key, which you already created. For more information, see [Protecting data using server-side encryption with an + * key stored in (SSE-KMS)](https://docs.aws.amazon.com/AmazonS3/latest/dev/UsingKMSEncryption.html) in the *Amazon + * Simple Storage Service Console Developer Guide*. If you use the ``AES256`` encryption type, Amazon ECR uses + * server-side encryption with Amazon S3-managed encryption keys which encrypts the images in the repository using + * an AES-256 encryption algorithm. For more information, see [Protecting data using server-side encryption with + * Amazon S3-managed encryption keys + * (SSE-S3)](https://docs.aws.amazon.com/AmazonS3/latest/dev/UsingServerSideEncryption.html) in the *Ama The + * encryption type to use. + * + * @return the encryptionType value. + */ + public EncryptionConfigurationEncryptionType encryptionType() { + return this.encryptionType; + } + + /** + * Set the encryptionType property: The encryption type to use. If you use the ``KMS`` encryption type, the contents + * of the repository will be encrypted using server-side encryption with KMSlong key stored in KMS. When you use KMS + * to encrypt your data, you can either use the default AWS managed KMS key for Amazon ECR, or specify your own KMS + * key, which you already created. For more information, see [Protecting data using server-side encryption with an + * key stored in (SSE-KMS)](https://docs.aws.amazon.com/AmazonS3/latest/dev/UsingKMSEncryption.html) in the *Amazon + * Simple Storage Service Console Developer Guide*. If you use the ``AES256`` encryption type, Amazon ECR uses + * server-side encryption with Amazon S3-managed encryption keys which encrypts the images in the repository using + * an AES-256 encryption algorithm. For more information, see [Protecting data using server-side encryption with + * Amazon S3-managed encryption keys + * (SSE-S3)](https://docs.aws.amazon.com/AmazonS3/latest/dev/UsingServerSideEncryption.html) in the *Ama The + * encryption type to use. + * + * @param encryptionType the encryptionType value to set. + * @return the EncryptionConfiguration object itself. + */ + public EncryptionConfiguration withEncryptionType(EncryptionConfigurationEncryptionType encryptionType) { + this.encryptionType = encryptionType; + return this; + } + + /** + * Get the kmsKey property: If you use the ``KMS`` encryption type, specify the KMS key to use for encryption. The + * alias, key ID, or full ARN of the KMS key can be specified. The key must exist in the same Region as the + * repository. If no key is specified, the default AWS managed KMS key for Amazon ECR will be used. If you use the + * KMS encryption type, specify the CMK to use for encryption. The alias, key ID, or full ARN of the CMK can be + * specified. The key must exist in the same Region as the repository. If no key is specified, the default AWS + * managed CMK for Amazon ECR will be used. + * + * @return the kmsKey value. + */ + public String kmsKey() { + return this.kmsKey; + } + + /** + * Set the kmsKey property: If you use the ``KMS`` encryption type, specify the KMS key to use for encryption. The + * alias, key ID, or full ARN of the KMS key can be specified. The key must exist in the same Region as the + * repository. If no key is specified, the default AWS managed KMS key for Amazon ECR will be used. If you use the + * KMS encryption type, specify the CMK to use for encryption. The alias, key ID, or full ARN of the CMK can be + * specified. The key must exist in the same Region as the repository. If no key is specified, the default AWS + * managed CMK for Amazon ECR will be used. + * + * @param kmsKey the kmsKey value to set. + * @return the EncryptionConfiguration object itself. + */ + public EncryptionConfiguration withKmsKey(String kmsKey) { + this.kmsKey = kmsKey; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("encryptionType", + this.encryptionType == null ? null : this.encryptionType.toString()); + jsonWriter.writeStringField("kmsKey", this.kmsKey); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of EncryptionConfiguration from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of EncryptionConfiguration if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the EncryptionConfiguration. + */ + public static EncryptionConfiguration fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + EncryptionConfiguration deserializedEncryptionConfiguration = new EncryptionConfiguration(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("encryptionType".equals(fieldName)) { + deserializedEncryptionConfiguration.encryptionType + = EncryptionConfigurationEncryptionType.fromString(reader.getString()); + } else if ("kmsKey".equals(fieldName)) { + deserializedEncryptionConfiguration.kmsKey = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedEncryptionConfiguration; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/EncryptionConfigurationAutoGenerated.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/EncryptionConfigurationAutoGenerated.java new file mode 100644 index 000000000000..536a39f40503 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/EncryptionConfigurationAutoGenerated.java @@ -0,0 +1,107 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of EncryptionConfiguration. + */ +@Fluent +public final class EncryptionConfigurationAutoGenerated + implements JsonSerializable { + /* + * Specifies the ID (Key ARN or Alias ARN) of the customer managed AWS KMS key stored in AWS Key Management Service + * (KMS) for the destination bucket. Amazon S3 uses this key to encrypt replica objects. Amazon S3 only supports + * symmetric encryption KMS keys. For more information, see [Asymmetric keys in + * KMS](https://docs.aws.amazon.com//kms/latest/developerguide/symmetric-asymmetric.html) in the *Key Management + * Service Developer Guide*. + */ + private String replicaKmsKeyId; + + /** + * Creates an instance of EncryptionConfigurationAutoGenerated class. + */ + public EncryptionConfigurationAutoGenerated() { + } + + /** + * Get the replicaKmsKeyId property: Specifies the ID (Key ARN or Alias ARN) of the customer managed AWS KMS key + * stored in AWS Key Management Service (KMS) for the destination bucket. Amazon S3 uses this key to encrypt replica + * objects. Amazon S3 only supports symmetric encryption KMS keys. For more information, see [Asymmetric keys in + * KMS](https://docs.aws.amazon.com//kms/latest/developerguide/symmetric-asymmetric.html) in the *Key Management + * Service Developer Guide*. + * + * @return the replicaKmsKeyId value. + */ + public String replicaKmsKeyId() { + return this.replicaKmsKeyId; + } + + /** + * Set the replicaKmsKeyId property: Specifies the ID (Key ARN or Alias ARN) of the customer managed AWS KMS key + * stored in AWS Key Management Service (KMS) for the destination bucket. Amazon S3 uses this key to encrypt replica + * objects. Amazon S3 only supports symmetric encryption KMS keys. For more information, see [Asymmetric keys in + * KMS](https://docs.aws.amazon.com//kms/latest/developerguide/symmetric-asymmetric.html) in the *Key Management + * Service Developer Guide*. + * + * @param replicaKmsKeyId the replicaKmsKeyId value to set. + * @return the EncryptionConfigurationAutoGenerated object itself. + */ + public EncryptionConfigurationAutoGenerated withReplicaKmsKeyId(String replicaKmsKeyId) { + this.replicaKmsKeyId = replicaKmsKeyId; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("replicaKmsKeyID", this.replicaKmsKeyId); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of EncryptionConfigurationAutoGenerated from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of EncryptionConfigurationAutoGenerated if the JsonReader was pointing to an instance of it, + * or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the EncryptionConfigurationAutoGenerated. + */ + public static EncryptionConfigurationAutoGenerated fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + EncryptionConfigurationAutoGenerated deserializedEncryptionConfigurationAutoGenerated + = new EncryptionConfigurationAutoGenerated(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("replicaKmsKeyID".equals(fieldName)) { + deserializedEncryptionConfigurationAutoGenerated.replicaKmsKeyId = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedEncryptionConfigurationAutoGenerated; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/EncryptionConfigurationEncryptionType.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/EncryptionConfigurationEncryptionType.java new file mode 100644 index 000000000000..87e4392a8fe7 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/EncryptionConfigurationEncryptionType.java @@ -0,0 +1,52 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * EncryptionConfigurationEncryptionType enum. + */ +public final class EncryptionConfigurationEncryptionType + extends ExpandableStringEnum { + /** + * Static value AES256 for EncryptionConfigurationEncryptionType. + */ + public static final EncryptionConfigurationEncryptionType AES256 = fromString("AES256"); + + /** + * Static value KMS for EncryptionConfigurationEncryptionType. + */ + public static final EncryptionConfigurationEncryptionType KMS = fromString("KMS"); + + /** + * Creates a new instance of EncryptionConfigurationEncryptionType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public EncryptionConfigurationEncryptionType() { + } + + /** + * Creates or finds a EncryptionConfigurationEncryptionType from its string representation. + * + * @param name a name to look for. + * @return the corresponding EncryptionConfigurationEncryptionType. + */ + public static EncryptionConfigurationEncryptionType fromString(String name) { + return fromString(name, EncryptionConfigurationEncryptionType.class); + } + + /** + * Gets known EncryptionConfigurationEncryptionType values. + * + * @return known EncryptionConfigurationEncryptionType values. + */ + public static Collection values() { + return values(EncryptionConfigurationEncryptionType.class); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/Endpoint.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/Endpoint.java new file mode 100644 index 000000000000..f012179e4b26 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/Endpoint.java @@ -0,0 +1,154 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of Endpoint. + */ +@Fluent +public final class Endpoint implements JsonSerializable { + /* + *

The DNS hostname of the endpoint.

+ */ + private String address; + + /* + *

The port number that applications should use to connect to the endpoint.

+ */ + private Integer port; + + /* + *

The URL that applications should use to connect to the endpoint. The default ports are 8111 for the 'dax' + * protocol and 9111 for the 'daxs' protocol.

+ */ + private String url; + + /** + * Creates an instance of Endpoint class. + */ + public Endpoint() { + } + + /** + * Get the address property: <p>The DNS hostname of the endpoint.</p>. + * + * @return the address value. + */ + public String address() { + return this.address; + } + + /** + * Set the address property: <p>The DNS hostname of the endpoint.</p>. + * + * @param address the address value to set. + * @return the Endpoint object itself. + */ + public Endpoint withAddress(String address) { + this.address = address; + return this; + } + + /** + * Get the port property: <p>The port number that applications should use to connect to the + * endpoint.</p>. + * + * @return the port value. + */ + public Integer port() { + return this.port; + } + + /** + * Set the port property: <p>The port number that applications should use to connect to the + * endpoint.</p>. + * + * @param port the port value to set. + * @return the Endpoint object itself. + */ + public Endpoint withPort(Integer port) { + this.port = port; + return this; + } + + /** + * Get the url property: <p>The URL that applications should use to connect to the endpoint. The default ports + * are 8111 for the 'dax' protocol and 9111 for the 'daxs' protocol.</p>. + * + * @return the url value. + */ + public String url() { + return this.url; + } + + /** + * Set the url property: <p>The URL that applications should use to connect to the endpoint. The default ports + * are 8111 for the 'dax' protocol and 9111 for the 'daxs' protocol.</p>. + * + * @param url the url value to set. + * @return the Endpoint object itself. + */ + public Endpoint withUrl(String url) { + this.url = url; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("address", this.address); + jsonWriter.writeNumberField("port", this.port); + jsonWriter.writeStringField("url", this.url); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of Endpoint from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of Endpoint if the JsonReader was pointing to an instance of it, or null if it was pointing + * to JSON null. + * @throws IOException If an error occurs while reading the Endpoint. + */ + public static Endpoint fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + Endpoint deserializedEndpoint = new Endpoint(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("address".equals(fieldName)) { + deserializedEndpoint.address = reader.getString(); + } else if ("port".equals(fieldName)) { + deserializedEndpoint.port = reader.getNullable(JsonReader::getInt); + } else if ("url".equals(fieldName)) { + deserializedEndpoint.url = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedEndpoint; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/EndpointAutoGenerated.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/EndpointAutoGenerated.java new file mode 100644 index 000000000000..325fc4737962 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/EndpointAutoGenerated.java @@ -0,0 +1,121 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of Endpoint. + */ +@Fluent +public final class EndpointAutoGenerated implements JsonSerializable { + /* + * The connection endpoint for the DB cluster. + */ + private String address; + + /* + * The port number that will accept connections on this DB cluster. + */ + private String port; + + /** + * Creates an instance of EndpointAutoGenerated class. + */ + public EndpointAutoGenerated() { + } + + /** + * Get the address property: The connection endpoint for the DB cluster. + * + * @return the address value. + */ + public String address() { + return this.address; + } + + /** + * Set the address property: The connection endpoint for the DB cluster. + * + * @param address the address value to set. + * @return the EndpointAutoGenerated object itself. + */ + public EndpointAutoGenerated withAddress(String address) { + this.address = address; + return this; + } + + /** + * Get the port property: The port number that will accept connections on this DB cluster. + * + * @return the port value. + */ + public String port() { + return this.port; + } + + /** + * Set the port property: The port number that will accept connections on this DB cluster. + * + * @param port the port value to set. + * @return the EndpointAutoGenerated object itself. + */ + public EndpointAutoGenerated withPort(String port) { + this.port = port; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("address", this.address); + jsonWriter.writeStringField("port", this.port); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of EndpointAutoGenerated from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of EndpointAutoGenerated if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the EndpointAutoGenerated. + */ + public static EndpointAutoGenerated fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + EndpointAutoGenerated deserializedEndpointAutoGenerated = new EndpointAutoGenerated(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("address".equals(fieldName)) { + deserializedEndpointAutoGenerated.address = reader.getString(); + } else if ("port".equals(fieldName)) { + deserializedEndpointAutoGenerated.port = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedEndpointAutoGenerated; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/EndpointAutoGenerated2.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/EndpointAutoGenerated2.java new file mode 100644 index 000000000000..829f55930d91 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/EndpointAutoGenerated2.java @@ -0,0 +1,149 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of Endpoint. + */ +@Fluent +public final class EndpointAutoGenerated2 implements JsonSerializable { + /* + * Specifies the DNS address of the DB instance. + */ + private String address; + + /* + * Specifies the ID that Amazon Route 53 assigns when you create a hosted zone. + */ + private String hostedZoneId; + + /* + * Specifies the port that the database engine is listening on. + */ + private String port; + + /** + * Creates an instance of EndpointAutoGenerated2 class. + */ + public EndpointAutoGenerated2() { + } + + /** + * Get the address property: Specifies the DNS address of the DB instance. + * + * @return the address value. + */ + public String address() { + return this.address; + } + + /** + * Set the address property: Specifies the DNS address of the DB instance. + * + * @param address the address value to set. + * @return the EndpointAutoGenerated2 object itself. + */ + public EndpointAutoGenerated2 withAddress(String address) { + this.address = address; + return this; + } + + /** + * Get the hostedZoneId property: Specifies the ID that Amazon Route 53 assigns when you create a hosted zone. + * + * @return the hostedZoneId value. + */ + public String hostedZoneId() { + return this.hostedZoneId; + } + + /** + * Set the hostedZoneId property: Specifies the ID that Amazon Route 53 assigns when you create a hosted zone. + * + * @param hostedZoneId the hostedZoneId value to set. + * @return the EndpointAutoGenerated2 object itself. + */ + public EndpointAutoGenerated2 withHostedZoneId(String hostedZoneId) { + this.hostedZoneId = hostedZoneId; + return this; + } + + /** + * Get the port property: Specifies the port that the database engine is listening on. + * + * @return the port value. + */ + public String port() { + return this.port; + } + + /** + * Set the port property: Specifies the port that the database engine is listening on. + * + * @param port the port value to set. + * @return the EndpointAutoGenerated2 object itself. + */ + public EndpointAutoGenerated2 withPort(String port) { + this.port = port; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("address", this.address); + jsonWriter.writeStringField("hostedZoneId", this.hostedZoneId); + jsonWriter.writeStringField("port", this.port); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of EndpointAutoGenerated2 from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of EndpointAutoGenerated2 if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the EndpointAutoGenerated2. + */ + public static EndpointAutoGenerated2 fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + EndpointAutoGenerated2 deserializedEndpointAutoGenerated2 = new EndpointAutoGenerated2(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("address".equals(fieldName)) { + deserializedEndpointAutoGenerated2.address = reader.getString(); + } else if ("hostedZoneId".equals(fieldName)) { + deserializedEndpointAutoGenerated2.hostedZoneId = reader.getString(); + } else if ("port".equals(fieldName)) { + deserializedEndpointAutoGenerated2.port = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedEndpointAutoGenerated2; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/EndpointAutoGenerated3.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/EndpointAutoGenerated3.java new file mode 100644 index 000000000000..2f0f326966be --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/EndpointAutoGenerated3.java @@ -0,0 +1,121 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of Endpoint. + */ +@Fluent +public final class EndpointAutoGenerated3 implements JsonSerializable { + /* + * Property address + */ + private String address; + + /* + * Property port + */ + private String port; + + /** + * Creates an instance of EndpointAutoGenerated3 class. + */ + public EndpointAutoGenerated3() { + } + + /** + * Get the address property: Property address. + * + * @return the address value. + */ + public String address() { + return this.address; + } + + /** + * Set the address property: Property address. + * + * @param address the address value to set. + * @return the EndpointAutoGenerated3 object itself. + */ + public EndpointAutoGenerated3 withAddress(String address) { + this.address = address; + return this; + } + + /** + * Get the port property: Property port. + * + * @return the port value. + */ + public String port() { + return this.port; + } + + /** + * Set the port property: Property port. + * + * @param port the port value to set. + * @return the EndpointAutoGenerated3 object itself. + */ + public EndpointAutoGenerated3 withPort(String port) { + this.port = port; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("address", this.address); + jsonWriter.writeStringField("port", this.port); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of EndpointAutoGenerated3 from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of EndpointAutoGenerated3 if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the EndpointAutoGenerated3. + */ + public static EndpointAutoGenerated3 fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + EndpointAutoGenerated3 deserializedEndpointAutoGenerated3 = new EndpointAutoGenerated3(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("address".equals(fieldName)) { + deserializedEndpointAutoGenerated3.address = reader.getString(); + } else if ("port".equals(fieldName)) { + deserializedEndpointAutoGenerated3.port = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedEndpointAutoGenerated3; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/EndpointConfiguration.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/EndpointConfiguration.java new file mode 100644 index 000000000000..84c3e6b778fb --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/EndpointConfiguration.java @@ -0,0 +1,134 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Definition of EndpointConfiguration. + */ +@Fluent +public final class EndpointConfiguration implements JsonSerializable { + /* + * A list of endpoint types of an API (RestApi) or its custom domain name (DomainName). For an edge-optimized API + * and its custom domain name, the endpoint type is ``'EDGE'``. For a regional API and its custom domain name, the + * endpoint type is ``REGIONAL``. For a private API, the endpoint type is ``PRIVATE``. + */ + private List types; + + /* + * A list of VpcEndpointIds of an API (RestApi) against which to create Route53 ALIASes. It is only supported for + * ``PRIVATE`` endpoint type. + */ + private List vpcEndpointIds; + + /** + * Creates an instance of EndpointConfiguration class. + */ + public EndpointConfiguration() { + } + + /** + * Get the types property: A list of endpoint types of an API (RestApi) or its custom domain name (DomainName). For + * an edge-optimized API and its custom domain name, the endpoint type is ``'EDGE'``. For a regional API and its + * custom domain name, the endpoint type is ``REGIONAL``. For a private API, the endpoint type is ``PRIVATE``. + * + * @return the types value. + */ + public List types() { + return this.types; + } + + /** + * Set the types property: A list of endpoint types of an API (RestApi) or its custom domain name (DomainName). For + * an edge-optimized API and its custom domain name, the endpoint type is ``'EDGE'``. For a regional API and its + * custom domain name, the endpoint type is ``REGIONAL``. For a private API, the endpoint type is ``PRIVATE``. + * + * @param types the types value to set. + * @return the EndpointConfiguration object itself. + */ + public EndpointConfiguration withTypes(List types) { + this.types = types; + return this; + } + + /** + * Get the vpcEndpointIds property: A list of VpcEndpointIds of an API (RestApi) against which to create Route53 + * ALIASes. It is only supported for ``PRIVATE`` endpoint type. + * + * @return the vpcEndpointIds value. + */ + public List vpcEndpointIds() { + return this.vpcEndpointIds; + } + + /** + * Set the vpcEndpointIds property: A list of VpcEndpointIds of an API (RestApi) against which to create Route53 + * ALIASes. It is only supported for ``PRIVATE`` endpoint type. + * + * @param vpcEndpointIds the vpcEndpointIds value to set. + * @return the EndpointConfiguration object itself. + */ + public EndpointConfiguration withVpcEndpointIds(List vpcEndpointIds) { + this.vpcEndpointIds = vpcEndpointIds; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("types", this.types, (writer, element) -> writer.writeString(element)); + jsonWriter.writeArrayField("vpcEndpointIds", this.vpcEndpointIds, + (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of EndpointConfiguration from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of EndpointConfiguration if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the EndpointConfiguration. + */ + public static EndpointConfiguration fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + EndpointConfiguration deserializedEndpointConfiguration = new EndpointConfiguration(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("types".equals(fieldName)) { + List types = reader.readArray(reader1 -> reader1.getString()); + deserializedEndpointConfiguration.types = types; + } else if ("vpcEndpointIds".equals(fieldName)) { + List vpcEndpointIds = reader.readArray(reader1 -> reader1.getString()); + deserializedEndpointConfiguration.vpcEndpointIds = vpcEndpointIds; + } else { + reader.skipChildren(); + } + } + + return deserializedEndpointConfiguration; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/EnhancedMetricsConfig.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/EnhancedMetricsConfig.java new file mode 100644 index 000000000000..3370683ebf3a --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/EnhancedMetricsConfig.java @@ -0,0 +1,243 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of EnhancedMetricsConfig. + */ +@Fluent +public final class EnhancedMetricsConfig implements JsonSerializable { + /* + *

Controls how data source metrics will be emitted to CloudWatch. Data source metrics include:

  • + *

    Requests: The number of invocations that occured during a request.

  • Latency: The time to + * complete a data source invocation.

  • Errors: The number of errors that occurred during a data + * source invocation.

These metrics can be emitted to CloudWatch per data source or for all data + * sources in the request. Metrics will be recorded by API ID and data source name. + * dataSourceLevelMetricsBehavior accepts one of these values at a time:

  • + * FULL_REQUEST_DATA_SOURCE_METRICS: Records and emits metric data for all data sources in the + * request.

  • PER_DATA_SOURCE_METRICS: Records and emits metric data for data sources + * that have the metricsConfig value set to ENABLED.

+ */ + private DataSourceLevelMetricsBehaviorEnumValue dataSourceLevelMetricsBehavior; + + /* + *

Controls how operation metrics will be emitted to CloudWatch. Operation metrics include:

  • + *

    Requests: The number of times a specified GraphQL operation was called.

  • GraphQL errors: The + * number of GraphQL errors that occurred during a specified GraphQL operation.

Metrics will be + * recorded by API ID and operation name. You can set the value to ENABLED or + * DISABLED.

+ */ + private OperationLevelMetricsConfigEnumValue operationLevelMetricsConfig; + + /* + *

Controls how resolver metrics will be emitted to CloudWatch. Resolver metrics include:

  • + *

    GraphQL errors: The number of GraphQL errors that occurred.

  • Requests: The number of + * invocations that occurred during a request.

  • Latency: The time to complete a resolver + * invocation.

  • Cache hits: The number of cache hits during a request.

  • Cache + * misses: The number of cache misses during a request.

These metrics can be emitted to + * CloudWatch per resolver or for all resolvers in the request. Metrics will be recorded by API ID and resolver + * name. resolverLevelMetricsBehavior accepts one of these values at a time:

  • + * FULL_REQUEST_RESOLVER_METRICS: Records and emits metric data for all resolvers in the request.

    + *
  • PER_RESOLVER_METRICS: Records and emits metric data for resolvers that have the + * metricsConfig value set to ENABLED.

+ */ + private ResolverLevelMetricsBehaviorEnumValue resolverLevelMetricsBehavior; + + /** + * Creates an instance of EnhancedMetricsConfig class. + */ + public EnhancedMetricsConfig() { + } + + /** + * Get the dataSourceLevelMetricsBehavior property: <p>Controls how data source metrics will be emitted to + * CloudWatch. Data source metrics include:</p> <ul> <li> <p>Requests: The number of + * invocations that occured during a request.</p> </li> <li> <p>Latency: The time to + * complete a data source invocation.</p> </li> <li> <p>Errors: The number of errors that + * occurred during a data source invocation.</p> </li> </ul> <p>These metrics can be emitted + * to CloudWatch per data source or for all data sources in the request. Metrics will be recorded by API ID and data + * source name. <code>dataSourceLevelMetricsBehavior</code> accepts one of these values at a + * time:</p> <ul> <li> <p> <code>FULL_REQUEST_DATA_SOURCE_METRICS</code>: + * Records and emits metric data for all data sources in the request.</p> </li> <li> <p> + * <code>PER_DATA_SOURCE_METRICS</code>: Records and emits metric data for data sources that have the + * <code>metricsConfig</code> value set to <code>ENABLED</code>.</p> </li> + * </ul>. + * + * @return the dataSourceLevelMetricsBehavior value. + */ + public DataSourceLevelMetricsBehaviorEnumValue dataSourceLevelMetricsBehavior() { + return this.dataSourceLevelMetricsBehavior; + } + + /** + * Set the dataSourceLevelMetricsBehavior property: <p>Controls how data source metrics will be emitted to + * CloudWatch. Data source metrics include:</p> <ul> <li> <p>Requests: The number of + * invocations that occured during a request.</p> </li> <li> <p>Latency: The time to + * complete a data source invocation.</p> </li> <li> <p>Errors: The number of errors that + * occurred during a data source invocation.</p> </li> </ul> <p>These metrics can be emitted + * to CloudWatch per data source or for all data sources in the request. Metrics will be recorded by API ID and data + * source name. <code>dataSourceLevelMetricsBehavior</code> accepts one of these values at a + * time:</p> <ul> <li> <p> <code>FULL_REQUEST_DATA_SOURCE_METRICS</code>: + * Records and emits metric data for all data sources in the request.</p> </li> <li> <p> + * <code>PER_DATA_SOURCE_METRICS</code>: Records and emits metric data for data sources that have the + * <code>metricsConfig</code> value set to <code>ENABLED</code>.</p> </li> + * </ul>. + * + * @param dataSourceLevelMetricsBehavior the dataSourceLevelMetricsBehavior value to set. + * @return the EnhancedMetricsConfig object itself. + */ + public EnhancedMetricsConfig + withDataSourceLevelMetricsBehavior(DataSourceLevelMetricsBehaviorEnumValue dataSourceLevelMetricsBehavior) { + this.dataSourceLevelMetricsBehavior = dataSourceLevelMetricsBehavior; + return this; + } + + /** + * Get the operationLevelMetricsConfig property: <p> Controls how operation metrics will be emitted to + * CloudWatch. Operation metrics include:</p> <ul> <li> <p>Requests: The number of times a + * specified GraphQL operation was called.</p> </li> <li> <p>GraphQL errors: The number of + * GraphQL errors that occurred during a specified GraphQL operation.</p> </li> </ul> + * <p>Metrics will be recorded by API ID and operation name. You can set the value to + * <code>ENABLED</code> or <code>DISABLED</code>.</p>. + * + * @return the operationLevelMetricsConfig value. + */ + public OperationLevelMetricsConfigEnumValue operationLevelMetricsConfig() { + return this.operationLevelMetricsConfig; + } + + /** + * Set the operationLevelMetricsConfig property: <p> Controls how operation metrics will be emitted to + * CloudWatch. Operation metrics include:</p> <ul> <li> <p>Requests: The number of times a + * specified GraphQL operation was called.</p> </li> <li> <p>GraphQL errors: The number of + * GraphQL errors that occurred during a specified GraphQL operation.</p> </li> </ul> + * <p>Metrics will be recorded by API ID and operation name. You can set the value to + * <code>ENABLED</code> or <code>DISABLED</code>.</p>. + * + * @param operationLevelMetricsConfig the operationLevelMetricsConfig value to set. + * @return the EnhancedMetricsConfig object itself. + */ + public EnhancedMetricsConfig + withOperationLevelMetricsConfig(OperationLevelMetricsConfigEnumValue operationLevelMetricsConfig) { + this.operationLevelMetricsConfig = operationLevelMetricsConfig; + return this; + } + + /** + * Get the resolverLevelMetricsBehavior property: <p>Controls how resolver metrics will be emitted to + * CloudWatch. Resolver metrics include:</p> <ul> <li> <p>GraphQL errors: The number of + * GraphQL errors that occurred.</p> </li> <li> <p>Requests: The number of invocations that + * occurred during a request. </p> </li> <li> <p>Latency: The time to complete a resolver + * invocation.</p> </li> <li> <p>Cache hits: The number of cache hits during a + * request.</p> </li> <li> <p>Cache misses: The number of cache misses during a + * request.</p> </li> </ul> <p>These metrics can be emitted to CloudWatch per resolver or + * for all resolvers in the request. Metrics will be recorded by API ID and resolver name. + * <code>resolverLevelMetricsBehavior</code> accepts one of these values at a time:</p> <ul> + * <li> <p> <code>FULL_REQUEST_RESOLVER_METRICS</code>: Records and emits metric data for + * all resolvers in the request.</p> </li> <li> <p> + * <code>PER_RESOLVER_METRICS</code>: Records and emits metric data for resolvers that have the + * <code>metricsConfig</code> value set to <code>ENABLED</code>.</p> </li> + * </ul>. + * + * @return the resolverLevelMetricsBehavior value. + */ + public ResolverLevelMetricsBehaviorEnumValue resolverLevelMetricsBehavior() { + return this.resolverLevelMetricsBehavior; + } + + /** + * Set the resolverLevelMetricsBehavior property: <p>Controls how resolver metrics will be emitted to + * CloudWatch. Resolver metrics include:</p> <ul> <li> <p>GraphQL errors: The number of + * GraphQL errors that occurred.</p> </li> <li> <p>Requests: The number of invocations that + * occurred during a request. </p> </li> <li> <p>Latency: The time to complete a resolver + * invocation.</p> </li> <li> <p>Cache hits: The number of cache hits during a + * request.</p> </li> <li> <p>Cache misses: The number of cache misses during a + * request.</p> </li> </ul> <p>These metrics can be emitted to CloudWatch per resolver or + * for all resolvers in the request. Metrics will be recorded by API ID and resolver name. + * <code>resolverLevelMetricsBehavior</code> accepts one of these values at a time:</p> <ul> + * <li> <p> <code>FULL_REQUEST_RESOLVER_METRICS</code>: Records and emits metric data for + * all resolvers in the request.</p> </li> <li> <p> + * <code>PER_RESOLVER_METRICS</code>: Records and emits metric data for resolvers that have the + * <code>metricsConfig</code> value set to <code>ENABLED</code>.</p> </li> + * </ul>. + * + * @param resolverLevelMetricsBehavior the resolverLevelMetricsBehavior value to set. + * @return the EnhancedMetricsConfig object itself. + */ + public EnhancedMetricsConfig + withResolverLevelMetricsBehavior(ResolverLevelMetricsBehaviorEnumValue resolverLevelMetricsBehavior) { + this.resolverLevelMetricsBehavior = resolverLevelMetricsBehavior; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (dataSourceLevelMetricsBehavior() != null) { + dataSourceLevelMetricsBehavior().validate(); + } + if (operationLevelMetricsConfig() != null) { + operationLevelMetricsConfig().validate(); + } + if (resolverLevelMetricsBehavior() != null) { + resolverLevelMetricsBehavior().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("dataSourceLevelMetricsBehavior", this.dataSourceLevelMetricsBehavior); + jsonWriter.writeJsonField("operationLevelMetricsConfig", this.operationLevelMetricsConfig); + jsonWriter.writeJsonField("resolverLevelMetricsBehavior", this.resolverLevelMetricsBehavior); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of EnhancedMetricsConfig from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of EnhancedMetricsConfig if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the EnhancedMetricsConfig. + */ + public static EnhancedMetricsConfig fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + EnhancedMetricsConfig deserializedEnhancedMetricsConfig = new EnhancedMetricsConfig(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("dataSourceLevelMetricsBehavior".equals(fieldName)) { + deserializedEnhancedMetricsConfig.dataSourceLevelMetricsBehavior + = DataSourceLevelMetricsBehaviorEnumValue.fromJson(reader); + } else if ("operationLevelMetricsConfig".equals(fieldName)) { + deserializedEnhancedMetricsConfig.operationLevelMetricsConfig + = OperationLevelMetricsConfigEnumValue.fromJson(reader); + } else if ("resolverLevelMetricsBehavior".equals(fieldName)) { + deserializedEnhancedMetricsConfig.resolverLevelMetricsBehavior + = ResolverLevelMetricsBehaviorEnumValue.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedEnhancedMetricsConfig; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/Environment.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/Environment.java new file mode 100644 index 000000000000..3fec66322037 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/Environment.java @@ -0,0 +1,98 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.Map; + +/** + * Definition of Environment. + */ +@Fluent +public final class Environment implements JsonSerializable { + /* + * Environment variable key-value pairs. For more information, see [Using Lambda environment + * variables](https://docs.aws.amazon.com/lambda/latest/dg/configuration-envvars.html). + */ + private Map variables; + + /** + * Creates an instance of Environment class. + */ + public Environment() { + } + + /** + * Get the variables property: Environment variable key-value pairs. For more information, see [Using Lambda + * environment variables](https://docs.aws.amazon.com/lambda/latest/dg/configuration-envvars.html). + * + * @return the variables value. + */ + public Map variables() { + return this.variables; + } + + /** + * Set the variables property: Environment variable key-value pairs. For more information, see [Using Lambda + * environment variables](https://docs.aws.amazon.com/lambda/latest/dg/configuration-envvars.html). + * + * @param variables the variables value to set. + * @return the Environment object itself. + */ + public Environment withVariables(Map variables) { + this.variables = variables; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeMapField("variables", this.variables, (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of Environment from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of Environment if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the Environment. + */ + public static Environment fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + Environment deserializedEnvironment = new Environment(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("variables".equals(fieldName)) { + Map variables = reader.readMap(reader1 -> reader1.getString()); + deserializedEnvironment.variables = variables; + } else { + reader.skipChildren(); + } + } + + return deserializedEnvironment; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/EnvironmentFile.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/EnvironmentFile.java new file mode 100644 index 000000000000..5a350363588f --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/EnvironmentFile.java @@ -0,0 +1,125 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of EnvironmentFile. + */ +@Fluent +public final class EnvironmentFile implements JsonSerializable { + /* + * The file type to use. Environment files are objects in Amazon S3. The only supported value is ``s3``. + */ + private String type; + + /* + * The Amazon Resource Name (ARN) of the Amazon S3 object containing the environment variable file. + */ + private String value; + + /** + * Creates an instance of EnvironmentFile class. + */ + public EnvironmentFile() { + } + + /** + * Get the type property: The file type to use. Environment files are objects in Amazon S3. The only supported value + * is ``s3``. + * + * @return the type value. + */ + public String type() { + return this.type; + } + + /** + * Set the type property: The file type to use. Environment files are objects in Amazon S3. The only supported value + * is ``s3``. + * + * @param type the type value to set. + * @return the EnvironmentFile object itself. + */ + public EnvironmentFile withType(String type) { + this.type = type; + return this; + } + + /** + * Get the value property: The Amazon Resource Name (ARN) of the Amazon S3 object containing the environment + * variable file. + * + * @return the value value. + */ + public String value() { + return this.value; + } + + /** + * Set the value property: The Amazon Resource Name (ARN) of the Amazon S3 object containing the environment + * variable file. + * + * @param value the value value to set. + * @return the EnvironmentFile object itself. + */ + public EnvironmentFile withValue(String value) { + this.value = value; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("type", this.type); + jsonWriter.writeStringField("value", this.value); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of EnvironmentFile from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of EnvironmentFile if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the EnvironmentFile. + */ + public static EnvironmentFile fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + EnvironmentFile deserializedEnvironmentFile = new EnvironmentFile(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("type".equals(fieldName)) { + deserializedEnvironmentFile.type = reader.getString(); + } else if ("value".equals(fieldName)) { + deserializedEnvironmentFile.value = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedEnvironmentFile; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/EnvironmentType.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/EnvironmentType.java new file mode 100644 index 000000000000..a9ff3b92939a --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/EnvironmentType.java @@ -0,0 +1,76 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * EnvironmentType enum. + */ +public final class EnvironmentType extends ExpandableStringEnum { + /** + * Static value ARM_CONTAINER for EnvironmentType. + */ + public static final EnvironmentType ARM_CONTAINER = fromString("ARM_CONTAINER"); + + /** + * Static value ARM_LAMBDA_CONTAINER for EnvironmentType. + */ + public static final EnvironmentType ARM_LAMBDA_CONTAINER = fromString("ARM_LAMBDA_CONTAINER"); + + /** + * Static value LINUX_CONTAINER for EnvironmentType. + */ + public static final EnvironmentType LINUX_CONTAINER = fromString("LINUX_CONTAINER"); + + /** + * Static value LINUX_GPU_CONTAINER for EnvironmentType. + */ + public static final EnvironmentType LINUX_GPU_CONTAINER = fromString("LINUX_GPU_CONTAINER"); + + /** + * Static value LINUX_LAMBDA_CONTAINER for EnvironmentType. + */ + public static final EnvironmentType LINUX_LAMBDA_CONTAINER = fromString("LINUX_LAMBDA_CONTAINER"); + + /** + * Static value WINDOWS_CONTAINER for EnvironmentType. + */ + public static final EnvironmentType WINDOWS_CONTAINER = fromString("WINDOWS_CONTAINER"); + + /** + * Static value WINDOWS_SERVER_2019_CONTAINER for EnvironmentType. + */ + public static final EnvironmentType WINDOWS_SERVER_2019_CONTAINER = fromString("WINDOWS_SERVER_2019_CONTAINER"); + + /** + * Creates a new instance of EnvironmentType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public EnvironmentType() { + } + + /** + * Creates or finds a EnvironmentType from its string representation. + * + * @param name a name to look for. + * @return the corresponding EnvironmentType. + */ + public static EnvironmentType fromString(String name) { + return fromString(name, EnvironmentType.class); + } + + /** + * Gets known EnvironmentType values. + * + * @return known EnvironmentType values. + */ + public static Collection values() { + return values(EnvironmentType.class); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/EnvironmentTypeEnumValue.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/EnvironmentTypeEnumValue.java new file mode 100644 index 000000000000..3b73e8f14168 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/EnvironmentTypeEnumValue.java @@ -0,0 +1,93 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of EnvironmentTypeEnumValue. + */ +@Fluent +public final class EnvironmentTypeEnumValue implements JsonSerializable { + /* + * Property value + */ + private EnvironmentType value; + + /** + * Creates an instance of EnvironmentTypeEnumValue class. + */ + public EnvironmentTypeEnumValue() { + } + + /** + * Get the value property: Property value. + * + * @return the value value. + */ + public EnvironmentType value() { + return this.value; + } + + /** + * Set the value property: Property value. + * + * @param value the value value to set. + * @return the EnvironmentTypeEnumValue object itself. + */ + public EnvironmentTypeEnumValue withValue(EnvironmentType value) { + this.value = value; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("value", this.value == null ? null : this.value.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of EnvironmentTypeEnumValue from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of EnvironmentTypeEnumValue if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IOException If an error occurs while reading the EnvironmentTypeEnumValue. + */ + public static EnvironmentTypeEnumValue fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + EnvironmentTypeEnumValue deserializedEnvironmentTypeEnumValue = new EnvironmentTypeEnumValue(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + deserializedEnvironmentTypeEnumValue.value = EnvironmentType.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedEnvironmentTypeEnumValue; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/EnvironmentVariable.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/EnvironmentVariable.java new file mode 100644 index 000000000000..f491d7a2d162 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/EnvironmentVariable.java @@ -0,0 +1,209 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of EnvironmentVariable. + */ +@Fluent +public final class EnvironmentVariable implements JsonSerializable { + /* + *

The name or key of the environment variable.

+ */ + private String name; + + /* + *

The type of environment variable. Valid values include:

  • PARAMETER_STORE: An + * environment variable stored in Systems Manager Parameter Store. For environment variables of this type, specify + * the name of the parameter as the value of the EnvironmentVariable. The parameter value will be + * substituted for the name at runtime. You can also define Parameter Store environment variables in the buildspec. + * To learn how to do so, see + * env/parameter-store in the CodeBuild User Guide.

  • PLAINTEXT: An + * environment variable in plain text format. This is the default value.

  • + * SECRETS_MANAGER: An environment variable stored in Secrets Manager. For environment variables of + * this type, specify the name of the secret as the value of the EnvironmentVariable. The secret value + * will be substituted for the name at runtime. You can also define Secrets Manager environment variables in the + * buildspec. To learn how to do so, see + * env/secrets-manager in the CodeBuild User Guide.

+ */ + private EnvironmentVariableTypeEnumValue type; + + /* + *

The value of the environment variable.

We strongly discourage the use of + * PLAINTEXT environment variables to store sensitive values, especially Amazon Web Services secret key + * IDs. PLAINTEXT environment variables can be displayed in plain text using the CodeBuild console and + * the CLI. For sensitive values, we recommend you use an environment variable of type PARAMETER_STORE + * or SECRETS_MANAGER.

+ */ + private String value; + + /** + * Creates an instance of EnvironmentVariable class. + */ + public EnvironmentVariable() { + } + + /** + * Get the name property: <p>The name or key of the environment variable.</p>. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: <p>The name or key of the environment variable.</p>. + * + * @param name the name value to set. + * @return the EnvironmentVariable object itself. + */ + public EnvironmentVariable withName(String name) { + this.name = name; + return this; + } + + /** + * Get the type property: <p>The type of environment variable. Valid values include:</p> <ul> + * <li> <p> <code>PARAMETER_STORE</code>: An environment variable stored in Systems Manager + * Parameter Store. For environment variables of this type, specify the name of the parameter as the + * <code>value</code> of the EnvironmentVariable. The parameter value will be substituted for the name + * at runtime. You can also define Parameter Store environment variables in the buildspec. To learn how to do so, + * see <a + * href='https://docs.aws.amazon.com/codebuild/latest/userguide/build-spec-ref.html#build-spec.env.parameter-store'>env/parameter-store</a> + * in the <i>CodeBuild User Guide</i>.</p> </li> <li> <p> + * <code>PLAINTEXT</code>: An environment variable in plain text format. This is the default + * value.</p> </li> <li> <p> <code>SECRETS_MANAGER</code>: An environment + * variable stored in Secrets Manager. For environment variables of this type, specify the name of the secret as the + * <code>value</code> of the EnvironmentVariable. The secret value will be substituted for the name at + * runtime. You can also define Secrets Manager environment variables in the buildspec. To learn how to do so, see + * <a + * href='https://docs.aws.amazon.com/codebuild/latest/userguide/build-spec-ref.html#build-spec.env.secrets-manager'>env/secrets-manager</a> + * in the <i>CodeBuild User Guide</i>.</p> </li> </ul>. + * + * @return the type value. + */ + public EnvironmentVariableTypeEnumValue type() { + return this.type; + } + + /** + * Set the type property: <p>The type of environment variable. Valid values include:</p> <ul> + * <li> <p> <code>PARAMETER_STORE</code>: An environment variable stored in Systems Manager + * Parameter Store. For environment variables of this type, specify the name of the parameter as the + * <code>value</code> of the EnvironmentVariable. The parameter value will be substituted for the name + * at runtime. You can also define Parameter Store environment variables in the buildspec. To learn how to do so, + * see <a + * href='https://docs.aws.amazon.com/codebuild/latest/userguide/build-spec-ref.html#build-spec.env.parameter-store'>env/parameter-store</a> + * in the <i>CodeBuild User Guide</i>.</p> </li> <li> <p> + * <code>PLAINTEXT</code>: An environment variable in plain text format. This is the default + * value.</p> </li> <li> <p> <code>SECRETS_MANAGER</code>: An environment + * variable stored in Secrets Manager. For environment variables of this type, specify the name of the secret as the + * <code>value</code> of the EnvironmentVariable. The secret value will be substituted for the name at + * runtime. You can also define Secrets Manager environment variables in the buildspec. To learn how to do so, see + * <a + * href='https://docs.aws.amazon.com/codebuild/latest/userguide/build-spec-ref.html#build-spec.env.secrets-manager'>env/secrets-manager</a> + * in the <i>CodeBuild User Guide</i>.</p> </li> </ul>. + * + * @param type the type value to set. + * @return the EnvironmentVariable object itself. + */ + public EnvironmentVariable withType(EnvironmentVariableTypeEnumValue type) { + this.type = type; + return this; + } + + /** + * Get the value property: <p>The value of the environment variable.</p> <important> <p>We + * strongly discourage the use of <code>PLAINTEXT</code> environment variables to store sensitive + * values, especially Amazon Web Services secret key IDs. <code>PLAINTEXT</code> environment variables + * can be displayed in plain text using the CodeBuild console and the CLI. For sensitive values, we recommend you + * use an environment variable of type <code>PARAMETER_STORE</code> or + * <code>SECRETS_MANAGER</code>. </p> </important>. + * + * @return the value value. + */ + public String value() { + return this.value; + } + + /** + * Set the value property: <p>The value of the environment variable.</p> <important> <p>We + * strongly discourage the use of <code>PLAINTEXT</code> environment variables to store sensitive + * values, especially Amazon Web Services secret key IDs. <code>PLAINTEXT</code> environment variables + * can be displayed in plain text using the CodeBuild console and the CLI. For sensitive values, we recommend you + * use an environment variable of type <code>PARAMETER_STORE</code> or + * <code>SECRETS_MANAGER</code>. </p> </important>. + * + * @param value the value value to set. + * @return the EnvironmentVariable object itself. + */ + public EnvironmentVariable withValue(String value) { + this.value = value; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (type() != null) { + type().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("name", this.name); + jsonWriter.writeJsonField("type", this.type); + jsonWriter.writeStringField("value", this.value); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of EnvironmentVariable from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of EnvironmentVariable if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the EnvironmentVariable. + */ + public static EnvironmentVariable fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + EnvironmentVariable deserializedEnvironmentVariable = new EnvironmentVariable(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("name".equals(fieldName)) { + deserializedEnvironmentVariable.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedEnvironmentVariable.type = EnvironmentVariableTypeEnumValue.fromJson(reader); + } else if ("value".equals(fieldName)) { + deserializedEnvironmentVariable.value = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedEnvironmentVariable; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/EnvironmentVariableType.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/EnvironmentVariableType.java new file mode 100644 index 000000000000..dc096273af90 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/EnvironmentVariableType.java @@ -0,0 +1,56 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * EnvironmentVariableType enum. + */ +public final class EnvironmentVariableType extends ExpandableStringEnum { + /** + * Static value PARAMETER_STORE for EnvironmentVariableType. + */ + public static final EnvironmentVariableType PARAMETER_STORE = fromString("PARAMETER_STORE"); + + /** + * Static value PLAINTEXT for EnvironmentVariableType. + */ + public static final EnvironmentVariableType PLAINTEXT = fromString("PLAINTEXT"); + + /** + * Static value SECRETS_MANAGER for EnvironmentVariableType. + */ + public static final EnvironmentVariableType SECRETS_MANAGER = fromString("SECRETS_MANAGER"); + + /** + * Creates a new instance of EnvironmentVariableType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public EnvironmentVariableType() { + } + + /** + * Creates or finds a EnvironmentVariableType from its string representation. + * + * @param name a name to look for. + * @return the corresponding EnvironmentVariableType. + */ + public static EnvironmentVariableType fromString(String name) { + return fromString(name, EnvironmentVariableType.class); + } + + /** + * Gets known EnvironmentVariableType values. + * + * @return known EnvironmentVariableType values. + */ + public static Collection values() { + return values(EnvironmentVariableType.class); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/EnvironmentVariableTypeEnumValue.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/EnvironmentVariableTypeEnumValue.java new file mode 100644 index 000000000000..6eb22ad03ced --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/EnvironmentVariableTypeEnumValue.java @@ -0,0 +1,95 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of EnvironmentVariableTypeEnumValue. + */ +@Fluent +public final class EnvironmentVariableTypeEnumValue implements JsonSerializable { + /* + * Property value + */ + private EnvironmentVariableType value; + + /** + * Creates an instance of EnvironmentVariableTypeEnumValue class. + */ + public EnvironmentVariableTypeEnumValue() { + } + + /** + * Get the value property: Property value. + * + * @return the value value. + */ + public EnvironmentVariableType value() { + return this.value; + } + + /** + * Set the value property: Property value. + * + * @param value the value value to set. + * @return the EnvironmentVariableTypeEnumValue object itself. + */ + public EnvironmentVariableTypeEnumValue withValue(EnvironmentVariableType value) { + this.value = value; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("value", this.value == null ? null : this.value.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of EnvironmentVariableTypeEnumValue from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of EnvironmentVariableTypeEnumValue if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the EnvironmentVariableTypeEnumValue. + */ + public static EnvironmentVariableTypeEnumValue fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + EnvironmentVariableTypeEnumValue deserializedEnvironmentVariableTypeEnumValue + = new EnvironmentVariableTypeEnumValue(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + deserializedEnvironmentVariableTypeEnumValue.value + = EnvironmentVariableType.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedEnvironmentVariableTypeEnumValue; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/EphemeralStorage.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/EphemeralStorage.java new file mode 100644 index 000000000000..051c7ac489d9 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/EphemeralStorage.java @@ -0,0 +1,96 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of EphemeralStorage. + */ +@Fluent +public final class EphemeralStorage implements JsonSerializable { + /* + * The total amount, in GiB, of ephemeral storage to set for the task. The minimum supported value is ``20`` GiB and + * the maximum supported value is ``200`` GiB. + */ + private Integer sizeInGiB; + + /** + * Creates an instance of EphemeralStorage class. + */ + public EphemeralStorage() { + } + + /** + * Get the sizeInGiB property: The total amount, in GiB, of ephemeral storage to set for the task. The minimum + * supported value is ``20`` GiB and the maximum supported value is ``200`` GiB. + * + * @return the sizeInGiB value. + */ + public Integer sizeInGiB() { + return this.sizeInGiB; + } + + /** + * Set the sizeInGiB property: The total amount, in GiB, of ephemeral storage to set for the task. The minimum + * supported value is ``20`` GiB and the maximum supported value is ``200`` GiB. + * + * @param sizeInGiB the sizeInGiB value to set. + * @return the EphemeralStorage object itself. + */ + public EphemeralStorage withSizeInGiB(Integer sizeInGiB) { + this.sizeInGiB = sizeInGiB; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeNumberField("sizeInGiB", this.sizeInGiB); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of EphemeralStorage from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of EphemeralStorage if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the EphemeralStorage. + */ + public static EphemeralStorage fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + EphemeralStorage deserializedEphemeralStorage = new EphemeralStorage(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("sizeInGiB".equals(fieldName)) { + deserializedEphemeralStorage.sizeInGiB = reader.getNullable(JsonReader::getInt); + } else { + reader.skipChildren(); + } + } + + return deserializedEphemeralStorage; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/EphemeralStorageAutoGenerated.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/EphemeralStorageAutoGenerated.java new file mode 100644 index 000000000000..fe7e8222fbbb --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/EphemeralStorageAutoGenerated.java @@ -0,0 +1,94 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of EphemeralStorage. + */ +@Fluent +public final class EphemeralStorageAutoGenerated implements JsonSerializable { + /* + * The size of the function's ``/tmp`` directory. + */ + private Integer size; + + /** + * Creates an instance of EphemeralStorageAutoGenerated class. + */ + public EphemeralStorageAutoGenerated() { + } + + /** + * Get the size property: The size of the function's ``/tmp`` directory. + * + * @return the size value. + */ + public Integer size() { + return this.size; + } + + /** + * Set the size property: The size of the function's ``/tmp`` directory. + * + * @param size the size value to set. + * @return the EphemeralStorageAutoGenerated object itself. + */ + public EphemeralStorageAutoGenerated withSize(Integer size) { + this.size = size; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeNumberField("size", this.size); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of EphemeralStorageAutoGenerated from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of EphemeralStorageAutoGenerated if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the EphemeralStorageAutoGenerated. + */ + public static EphemeralStorageAutoGenerated fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + EphemeralStorageAutoGenerated deserializedEphemeralStorageAutoGenerated + = new EphemeralStorageAutoGenerated(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("size".equals(fieldName)) { + deserializedEphemeralStorageAutoGenerated.size = reader.getNullable(JsonReader::getInt); + } else { + reader.skipChildren(); + } + } + + return deserializedEphemeralStorageAutoGenerated; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ErrorDetailAutoGenerated.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ErrorDetailAutoGenerated.java new file mode 100644 index 000000000000..cfb52841651d --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ErrorDetailAutoGenerated.java @@ -0,0 +1,153 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Definition of ErrorDetail. + */ +@Fluent +public final class ErrorDetailAutoGenerated implements JsonSerializable { + /* + *

The name or code associated with the error.

+ */ + private String errorCode; + + /* + *

A list of key value pairs that provides contextual information about why an error occured.

+ */ + private List errorData; + + /* + *

A message that describes the error.

+ */ + private String errorMessage; + + /** + * Creates an instance of ErrorDetailAutoGenerated class. + */ + public ErrorDetailAutoGenerated() { + } + + /** + * Get the errorCode property: <p>The name or code associated with the error.</p>. + * + * @return the errorCode value. + */ + public String errorCode() { + return this.errorCode; + } + + /** + * Set the errorCode property: <p>The name or code associated with the error.</p>. + * + * @param errorCode the errorCode value to set. + * @return the ErrorDetailAutoGenerated object itself. + */ + public ErrorDetailAutoGenerated withErrorCode(String errorCode) { + this.errorCode = errorCode; + return this; + } + + /** + * Get the errorData property: <p>A list of key value pairs that provides contextual information about why an + * error occured.</p>. + * + * @return the errorData value. + */ + public List errorData() { + return this.errorData; + } + + /** + * Set the errorData property: <p>A list of key value pairs that provides contextual information about why an + * error occured.</p>. + * + * @param errorData the errorData value to set. + * @return the ErrorDetailAutoGenerated object itself. + */ + public ErrorDetailAutoGenerated withErrorData(List errorData) { + this.errorData = errorData; + return this; + } + + /** + * Get the errorMessage property: <p>A message that describes the error.</p>. + * + * @return the errorMessage value. + */ + public String errorMessage() { + return this.errorMessage; + } + + /** + * Set the errorMessage property: <p>A message that describes the error.</p>. + * + * @param errorMessage the errorMessage value to set. + * @return the ErrorDetailAutoGenerated object itself. + */ + public ErrorDetailAutoGenerated withErrorMessage(String errorMessage) { + this.errorMessage = errorMessage; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("errorCode", this.errorCode); + jsonWriter.writeArrayField("errorData", this.errorData, (writer, element) -> writer.writeUntyped(element)); + jsonWriter.writeStringField("errorMessage", this.errorMessage); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ErrorDetailAutoGenerated from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ErrorDetailAutoGenerated if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ErrorDetailAutoGenerated. + */ + public static ErrorDetailAutoGenerated fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ErrorDetailAutoGenerated deserializedErrorDetailAutoGenerated = new ErrorDetailAutoGenerated(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("errorCode".equals(fieldName)) { + deserializedErrorDetailAutoGenerated.errorCode = reader.getString(); + } else if ("errorData".equals(fieldName)) { + List errorData = reader.readArray(reader1 -> reader1.readUntyped()); + deserializedErrorDetailAutoGenerated.errorData = errorData; + } else if ("errorMessage".equals(fieldName)) { + deserializedErrorDetailAutoGenerated.errorMessage = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedErrorDetailAutoGenerated; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/EstablishedMultiRegionAccessPointPolicy.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/EstablishedMultiRegionAccessPointPolicy.java new file mode 100644 index 000000000000..ffc32880e2e4 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/EstablishedMultiRegionAccessPointPolicy.java @@ -0,0 +1,95 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of EstablishedMultiRegionAccessPointPolicy. + */ +@Fluent +public final class EstablishedMultiRegionAccessPointPolicy + implements JsonSerializable { + /* + *

The details of the last established policy.

+ */ + private String policy; + + /** + * Creates an instance of EstablishedMultiRegionAccessPointPolicy class. + */ + public EstablishedMultiRegionAccessPointPolicy() { + } + + /** + * Get the policy property: <p>The details of the last established policy.</p>. + * + * @return the policy value. + */ + public String policy() { + return this.policy; + } + + /** + * Set the policy property: <p>The details of the last established policy.</p>. + * + * @param policy the policy value to set. + * @return the EstablishedMultiRegionAccessPointPolicy object itself. + */ + public EstablishedMultiRegionAccessPointPolicy withPolicy(String policy) { + this.policy = policy; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("policy", this.policy); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of EstablishedMultiRegionAccessPointPolicy from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of EstablishedMultiRegionAccessPointPolicy if the JsonReader was pointing to an instance of + * it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the EstablishedMultiRegionAccessPointPolicy. + */ + public static EstablishedMultiRegionAccessPointPolicy fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + EstablishedMultiRegionAccessPointPolicy deserializedEstablishedMultiRegionAccessPointPolicy + = new EstablishedMultiRegionAccessPointPolicy(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("policy".equals(fieldName)) { + deserializedEstablishedMultiRegionAccessPointPolicy.policy = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedEstablishedMultiRegionAccessPointPolicy; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/EventBridgeConfiguration.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/EventBridgeConfiguration.java new file mode 100644 index 000000000000..5da1fb881efb --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/EventBridgeConfiguration.java @@ -0,0 +1,94 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of EventBridgeConfiguration. + */ +@Fluent +public final class EventBridgeConfiguration implements JsonSerializable { + /* + * Enables delivery of events to Amazon EventBridge. + */ + private Boolean eventBridgeEnabled; + + /** + * Creates an instance of EventBridgeConfiguration class. + */ + public EventBridgeConfiguration() { + } + + /** + * Get the eventBridgeEnabled property: Enables delivery of events to Amazon EventBridge. + * + * @return the eventBridgeEnabled value. + */ + public Boolean eventBridgeEnabled() { + return this.eventBridgeEnabled; + } + + /** + * Set the eventBridgeEnabled property: Enables delivery of events to Amazon EventBridge. + * + * @param eventBridgeEnabled the eventBridgeEnabled value to set. + * @return the EventBridgeConfiguration object itself. + */ + public EventBridgeConfiguration withEventBridgeEnabled(Boolean eventBridgeEnabled) { + this.eventBridgeEnabled = eventBridgeEnabled; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeBooleanField("eventBridgeEnabled", this.eventBridgeEnabled); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of EventBridgeConfiguration from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of EventBridgeConfiguration if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IOException If an error occurs while reading the EventBridgeConfiguration. + */ + public static EventBridgeConfiguration fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + EventBridgeConfiguration deserializedEventBridgeConfiguration = new EventBridgeConfiguration(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("eventBridgeEnabled".equals(fieldName)) { + deserializedEventBridgeConfiguration.eventBridgeEnabled + = reader.getNullable(JsonReader::getBoolean); + } else { + reader.skipChildren(); + } + } + + return deserializedEventBridgeConfiguration; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/EventCode.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/EventCode.java new file mode 100644 index 000000000000..6f3547402bcb --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/EventCode.java @@ -0,0 +1,66 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * EventCode enum. + */ +public final class EventCode extends ExpandableStringEnum { + /** + * Static value instance-reboot for EventCode. + */ + public static final EventCode INSTANCE_REBOOT = fromString("instance-reboot"); + + /** + * Static value instance-retirement for EventCode. + */ + public static final EventCode INSTANCE_RETIREMENT = fromString("instance-retirement"); + + /** + * Static value instance-stop for EventCode. + */ + public static final EventCode INSTANCE_STOP = fromString("instance-stop"); + + /** + * Static value system-maintenance for EventCode. + */ + public static final EventCode SYSTEM_MAINTENANCE = fromString("system-maintenance"); + + /** + * Static value system-reboot for EventCode. + */ + public static final EventCode SYSTEM_REBOOT = fromString("system-reboot"); + + /** + * Creates a new instance of EventCode value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public EventCode() { + } + + /** + * Creates or finds a EventCode from its string representation. + * + * @param name a name to look for. + * @return the corresponding EventCode. + */ + public static EventCode fromString(String name) { + return fromString(name, EventCode.class); + } + + /** + * Gets known EventCode values. + * + * @return known EventCode values. + */ + public static Collection values() { + return values(EventCode.class); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/EventCodeEnumValue.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/EventCodeEnumValue.java new file mode 100644 index 000000000000..43ca772c18ec --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/EventCodeEnumValue.java @@ -0,0 +1,93 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of EventCodeEnumValue. + */ +@Fluent +public final class EventCodeEnumValue implements JsonSerializable { + /* + * Property value + */ + private EventCode value; + + /** + * Creates an instance of EventCodeEnumValue class. + */ + public EventCodeEnumValue() { + } + + /** + * Get the value property: Property value. + * + * @return the value value. + */ + public EventCode value() { + return this.value; + } + + /** + * Set the value property: Property value. + * + * @param value the value value to set. + * @return the EventCodeEnumValue object itself. + */ + public EventCodeEnumValue withValue(EventCode value) { + this.value = value; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("value", this.value == null ? null : this.value.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of EventCodeEnumValue from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of EventCodeEnumValue if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the EventCodeEnumValue. + */ + public static EventCodeEnumValue fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + EventCodeEnumValue deserializedEventCodeEnumValue = new EventCodeEnumValue(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + deserializedEventCodeEnumValue.value = EventCode.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedEventCodeEnumValue; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/EventSelector.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/EventSelector.java new file mode 100644 index 000000000000..87678c58d352 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/EventSelector.java @@ -0,0 +1,200 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Definition of EventSelector. + */ +@Fluent +public final class EventSelector implements JsonSerializable { + /* + * Property dataResources + */ + private List dataResources; + + /* + * An optional list of service event sources from which you do not want management events to be logged on your + * trail. In this release, the list can be empty (disables the filter), or it can filter out AWS Key Management + * Service events by containing 'kms.amazonaws.com'. By default, ExcludeManagementEventSources is empty, and AWS KMS + * events are included in events that are logged to your trail. + */ + private List excludeManagementEventSources; + + /* + * Specify if you want your event selector to include management events for your trail. + */ + private Boolean includeManagementEvents; + + /* + * Specify if you want your trail to log read-only events, write-only events, or all. For example, the EC2 + * GetConsoleOutput is a read-only API operation and RunInstances is a write-only API operation. + */ + private EventSelectorReadWriteType readWriteType; + + /** + * Creates an instance of EventSelector class. + */ + public EventSelector() { + } + + /** + * Get the dataResources property: Property dataResources. + * + * @return the dataResources value. + */ + public List dataResources() { + return this.dataResources; + } + + /** + * Set the dataResources property: Property dataResources. + * + * @param dataResources the dataResources value to set. + * @return the EventSelector object itself. + */ + public EventSelector withDataResources(List dataResources) { + this.dataResources = dataResources; + return this; + } + + /** + * Get the excludeManagementEventSources property: An optional list of service event sources from which you do not + * want management events to be logged on your trail. In this release, the list can be empty (disables the filter), + * or it can filter out AWS Key Management Service events by containing 'kms.amazonaws.com'. By default, + * ExcludeManagementEventSources is empty, and AWS KMS events are included in events that are logged to your trail. + * + * @return the excludeManagementEventSources value. + */ + public List excludeManagementEventSources() { + return this.excludeManagementEventSources; + } + + /** + * Set the excludeManagementEventSources property: An optional list of service event sources from which you do not + * want management events to be logged on your trail. In this release, the list can be empty (disables the filter), + * or it can filter out AWS Key Management Service events by containing 'kms.amazonaws.com'. By default, + * ExcludeManagementEventSources is empty, and AWS KMS events are included in events that are logged to your trail. + * + * @param excludeManagementEventSources the excludeManagementEventSources value to set. + * @return the EventSelector object itself. + */ + public EventSelector withExcludeManagementEventSources(List excludeManagementEventSources) { + this.excludeManagementEventSources = excludeManagementEventSources; + return this; + } + + /** + * Get the includeManagementEvents property: Specify if you want your event selector to include management events + * for your trail. + * + * @return the includeManagementEvents value. + */ + public Boolean includeManagementEvents() { + return this.includeManagementEvents; + } + + /** + * Set the includeManagementEvents property: Specify if you want your event selector to include management events + * for your trail. + * + * @param includeManagementEvents the includeManagementEvents value to set. + * @return the EventSelector object itself. + */ + public EventSelector withIncludeManagementEvents(Boolean includeManagementEvents) { + this.includeManagementEvents = includeManagementEvents; + return this; + } + + /** + * Get the readWriteType property: Specify if you want your trail to log read-only events, write-only events, or + * all. For example, the EC2 GetConsoleOutput is a read-only API operation and RunInstances is a write-only API + * operation. + * + * @return the readWriteType value. + */ + public EventSelectorReadWriteType readWriteType() { + return this.readWriteType; + } + + /** + * Set the readWriteType property: Specify if you want your trail to log read-only events, write-only events, or + * all. For example, the EC2 GetConsoleOutput is a read-only API operation and RunInstances is a write-only API + * operation. + * + * @param readWriteType the readWriteType value to set. + * @return the EventSelector object itself. + */ + public EventSelector withReadWriteType(EventSelectorReadWriteType readWriteType) { + this.readWriteType = readWriteType; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (dataResources() != null) { + dataResources().forEach(e -> e.validate()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("dataResources", this.dataResources, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("excludeManagementEventSources", this.excludeManagementEventSources, + (writer, element) -> writer.writeString(element)); + jsonWriter.writeBooleanField("includeManagementEvents", this.includeManagementEvents); + jsonWriter.writeStringField("readWriteType", this.readWriteType == null ? null : this.readWriteType.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of EventSelector from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of EventSelector if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the EventSelector. + */ + public static EventSelector fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + EventSelector deserializedEventSelector = new EventSelector(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("dataResources".equals(fieldName)) { + List dataResources = reader.readArray(reader1 -> DataResource.fromJson(reader1)); + deserializedEventSelector.dataResources = dataResources; + } else if ("excludeManagementEventSources".equals(fieldName)) { + List excludeManagementEventSources = reader.readArray(reader1 -> reader1.getString()); + deserializedEventSelector.excludeManagementEventSources = excludeManagementEventSources; + } else if ("includeManagementEvents".equals(fieldName)) { + deserializedEventSelector.includeManagementEvents = reader.getNullable(JsonReader::getBoolean); + } else if ("readWriteType".equals(fieldName)) { + deserializedEventSelector.readWriteType = EventSelectorReadWriteType.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedEventSelector; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/EventSelectorReadWriteType.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/EventSelectorReadWriteType.java new file mode 100644 index 000000000000..2e6885b95e9f --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/EventSelectorReadWriteType.java @@ -0,0 +1,56 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * EventSelectorReadWriteType enum. + */ +public final class EventSelectorReadWriteType extends ExpandableStringEnum { + /** + * Static value All for EventSelectorReadWriteType. + */ + public static final EventSelectorReadWriteType ALL = fromString("All"); + + /** + * Static value ReadOnly for EventSelectorReadWriteType. + */ + public static final EventSelectorReadWriteType READ_ONLY = fromString("ReadOnly"); + + /** + * Static value WriteOnly for EventSelectorReadWriteType. + */ + public static final EventSelectorReadWriteType WRITE_ONLY = fromString("WriteOnly"); + + /** + * Creates a new instance of EventSelectorReadWriteType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public EventSelectorReadWriteType() { + } + + /** + * Creates or finds a EventSelectorReadWriteType from its string representation. + * + * @param name a name to look for. + * @return the corresponding EventSelectorReadWriteType. + */ + public static EventSelectorReadWriteType fromString(String name) { + return fromString(name, EventSelectorReadWriteType.class); + } + + /** + * Gets known EventSelectorReadWriteType values. + * + * @return known EventSelectorReadWriteType values. + */ + public static Collection values() { + return values(EventSelectorReadWriteType.class); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ExclusionByResourceTypes.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ExclusionByResourceTypes.java new file mode 100644 index 000000000000..9e8d5f845d3e --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ExclusionByResourceTypes.java @@ -0,0 +1,99 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Definition of ExclusionByResourceTypes. + */ +@Fluent +public final class ExclusionByResourceTypes implements JsonSerializable { + /* + *

A comma-separated list of resource types to exclude from recording by the configuration recorder.

+ */ + private List resourceTypes; + + /** + * Creates an instance of ExclusionByResourceTypes class. + */ + public ExclusionByResourceTypes() { + } + + /** + * Get the resourceTypes property: <p>A comma-separated list of resource types to exclude from recording by + * the configuration recorder.</p>. + * + * @return the resourceTypes value. + */ + public List resourceTypes() { + return this.resourceTypes; + } + + /** + * Set the resourceTypes property: <p>A comma-separated list of resource types to exclude from recording by + * the configuration recorder.</p>. + * + * @param resourceTypes the resourceTypes value to set. + * @return the ExclusionByResourceTypes object itself. + */ + public ExclusionByResourceTypes withResourceTypes(List resourceTypes) { + this.resourceTypes = resourceTypes; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("resourceTypes", this.resourceTypes, + (writer, element) -> writer.writeString(element == null ? null : element.toString())); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ExclusionByResourceTypes from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ExclusionByResourceTypes if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ExclusionByResourceTypes. + */ + public static ExclusionByResourceTypes fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ExclusionByResourceTypes deserializedExclusionByResourceTypes = new ExclusionByResourceTypes(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("resourceTypes".equals(fieldName)) { + List resourceTypes + = reader.readArray(reader1 -> ResourceType.fromString(reader1.getString())); + deserializedExclusionByResourceTypes.resourceTypes = resourceTypes; + } else { + reader.skipChildren(); + } + } + + return deserializedExclusionByResourceTypes; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ExecuteCommandConfiguration.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ExecuteCommandConfiguration.java new file mode 100644 index 000000000000..83b8fd5fc4ee --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ExecuteCommandConfiguration.java @@ -0,0 +1,179 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of ExecuteCommandConfiguration. + */ +@Fluent +public final class ExecuteCommandConfiguration implements JsonSerializable { + /* + * Specify an KMSlong key ID to encrypt the data between the local client and the container. + */ + private String kmsKeyId; + + /* + * The log configuration for the results of the execute command actions. The logs can be sent to CloudWatch Logs or + * an Amazon S3 bucket. When ``logging=OVERRIDE`` is specified, a ``logConfiguration`` must be provided. The log + * configuration for the results of the execute command actions. The logs can be sent to CloudWatch Logs or an + * Amazon S3 bucket. + */ + private ExecuteCommandLogConfiguration logConfiguration; + + /* + * The log setting to use for redirecting logs for your execute command results. The following log settings are + * available. + ``NONE``: The execute command session is not logged. + ``DEFAULT``: The ``awslogs`` configuration in + * the task definition is used. If no logging parameter is specified, it defaults to this value. If no ``awslogs`` + * log driver is configured in the task definition, the output won't be logged. + ``OVERRIDE``: Specify the logging + * details as a part of ``logConfiguration``. If the ``OVERRIDE`` logging option is specified, the + * ``logConfiguration`` is required. + */ + private String logging; + + /** + * Creates an instance of ExecuteCommandConfiguration class. + */ + public ExecuteCommandConfiguration() { + } + + /** + * Get the kmsKeyId property: Specify an KMSlong key ID to encrypt the data between the local client and the + * container. + * + * @return the kmsKeyId value. + */ + public String kmsKeyId() { + return this.kmsKeyId; + } + + /** + * Set the kmsKeyId property: Specify an KMSlong key ID to encrypt the data between the local client and the + * container. + * + * @param kmsKeyId the kmsKeyId value to set. + * @return the ExecuteCommandConfiguration object itself. + */ + public ExecuteCommandConfiguration withKmsKeyId(String kmsKeyId) { + this.kmsKeyId = kmsKeyId; + return this; + } + + /** + * Get the logConfiguration property: The log configuration for the results of the execute command actions. The logs + * can be sent to CloudWatch Logs or an Amazon S3 bucket. When ``logging=OVERRIDE`` is specified, a + * ``logConfiguration`` must be provided. The log configuration for the results of the execute command actions. The + * logs can be sent to CloudWatch Logs or an Amazon S3 bucket. + * + * @return the logConfiguration value. + */ + public ExecuteCommandLogConfiguration logConfiguration() { + return this.logConfiguration; + } + + /** + * Set the logConfiguration property: The log configuration for the results of the execute command actions. The logs + * can be sent to CloudWatch Logs or an Amazon S3 bucket. When ``logging=OVERRIDE`` is specified, a + * ``logConfiguration`` must be provided. The log configuration for the results of the execute command actions. The + * logs can be sent to CloudWatch Logs or an Amazon S3 bucket. + * + * @param logConfiguration the logConfiguration value to set. + * @return the ExecuteCommandConfiguration object itself. + */ + public ExecuteCommandConfiguration withLogConfiguration(ExecuteCommandLogConfiguration logConfiguration) { + this.logConfiguration = logConfiguration; + return this; + } + + /** + * Get the logging property: The log setting to use for redirecting logs for your execute command results. The + * following log settings are available. + ``NONE``: The execute command session is not logged. + ``DEFAULT``: The + * ``awslogs`` configuration in the task definition is used. If no logging parameter is specified, it defaults to + * this value. If no ``awslogs`` log driver is configured in the task definition, the output won't be logged. + + * ``OVERRIDE``: Specify the logging details as a part of ``logConfiguration``. If the ``OVERRIDE`` logging option + * is specified, the ``logConfiguration`` is required. + * + * @return the logging value. + */ + public String logging() { + return this.logging; + } + + /** + * Set the logging property: The log setting to use for redirecting logs for your execute command results. The + * following log settings are available. + ``NONE``: The execute command session is not logged. + ``DEFAULT``: The + * ``awslogs`` configuration in the task definition is used. If no logging parameter is specified, it defaults to + * this value. If no ``awslogs`` log driver is configured in the task definition, the output won't be logged. + + * ``OVERRIDE``: Specify the logging details as a part of ``logConfiguration``. If the ``OVERRIDE`` logging option + * is specified, the ``logConfiguration`` is required. + * + * @param logging the logging value to set. + * @return the ExecuteCommandConfiguration object itself. + */ + public ExecuteCommandConfiguration withLogging(String logging) { + this.logging = logging; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (logConfiguration() != null) { + logConfiguration().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("kmsKeyId", this.kmsKeyId); + jsonWriter.writeJsonField("logConfiguration", this.logConfiguration); + jsonWriter.writeStringField("logging", this.logging); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ExecuteCommandConfiguration from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ExecuteCommandConfiguration if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ExecuteCommandConfiguration. + */ + public static ExecuteCommandConfiguration fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ExecuteCommandConfiguration deserializedExecuteCommandConfiguration = new ExecuteCommandConfiguration(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("kmsKeyId".equals(fieldName)) { + deserializedExecuteCommandConfiguration.kmsKeyId = reader.getString(); + } else if ("logConfiguration".equals(fieldName)) { + deserializedExecuteCommandConfiguration.logConfiguration + = ExecuteCommandLogConfiguration.fromJson(reader); + } else if ("logging".equals(fieldName)) { + deserializedExecuteCommandConfiguration.logging = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedExecuteCommandConfiguration; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ExecuteCommandLogConfiguration.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ExecuteCommandLogConfiguration.java new file mode 100644 index 000000000000..b0fee6bc7419 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ExecuteCommandLogConfiguration.java @@ -0,0 +1,214 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of ExecuteCommandLogConfiguration. + */ +@Fluent +public final class ExecuteCommandLogConfiguration implements JsonSerializable { + /* + * Determines whether to use encryption on the CloudWatch logs. If not specified, encryption will be off. + */ + private Boolean cloudWatchEncryptionEnabled; + + /* + * The name of the CloudWatch log group to send logs to. The CloudWatch log group must already be created. + */ + private String cloudWatchLogGroupName; + + /* + * The name of the S3 bucket to send logs to. The S3 bucket must already be created. + */ + private String s3BucketName; + + /* + * Determines whether to use encryption on the S3 logs. If not specified, encryption is not used. + */ + private Boolean s3EncryptionEnabled; + + /* + * An optional folder in the S3 bucket to place logs in. + */ + private String s3KeyPrefix; + + /** + * Creates an instance of ExecuteCommandLogConfiguration class. + */ + public ExecuteCommandLogConfiguration() { + } + + /** + * Get the cloudWatchEncryptionEnabled property: Determines whether to use encryption on the CloudWatch logs. If not + * specified, encryption will be off. + * + * @return the cloudWatchEncryptionEnabled value. + */ + public Boolean cloudWatchEncryptionEnabled() { + return this.cloudWatchEncryptionEnabled; + } + + /** + * Set the cloudWatchEncryptionEnabled property: Determines whether to use encryption on the CloudWatch logs. If not + * specified, encryption will be off. + * + * @param cloudWatchEncryptionEnabled the cloudWatchEncryptionEnabled value to set. + * @return the ExecuteCommandLogConfiguration object itself. + */ + public ExecuteCommandLogConfiguration withCloudWatchEncryptionEnabled(Boolean cloudWatchEncryptionEnabled) { + this.cloudWatchEncryptionEnabled = cloudWatchEncryptionEnabled; + return this; + } + + /** + * Get the cloudWatchLogGroupName property: The name of the CloudWatch log group to send logs to. The CloudWatch log + * group must already be created. + * + * @return the cloudWatchLogGroupName value. + */ + public String cloudWatchLogGroupName() { + return this.cloudWatchLogGroupName; + } + + /** + * Set the cloudWatchLogGroupName property: The name of the CloudWatch log group to send logs to. The CloudWatch log + * group must already be created. + * + * @param cloudWatchLogGroupName the cloudWatchLogGroupName value to set. + * @return the ExecuteCommandLogConfiguration object itself. + */ + public ExecuteCommandLogConfiguration withCloudWatchLogGroupName(String cloudWatchLogGroupName) { + this.cloudWatchLogGroupName = cloudWatchLogGroupName; + return this; + } + + /** + * Get the s3BucketName property: The name of the S3 bucket to send logs to. The S3 bucket must already be created. + * + * @return the s3BucketName value. + */ + public String s3BucketName() { + return this.s3BucketName; + } + + /** + * Set the s3BucketName property: The name of the S3 bucket to send logs to. The S3 bucket must already be created. + * + * @param s3BucketName the s3BucketName value to set. + * @return the ExecuteCommandLogConfiguration object itself. + */ + public ExecuteCommandLogConfiguration withS3BucketName(String s3BucketName) { + this.s3BucketName = s3BucketName; + return this; + } + + /** + * Get the s3EncryptionEnabled property: Determines whether to use encryption on the S3 logs. If not specified, + * encryption is not used. + * + * @return the s3EncryptionEnabled value. + */ + public Boolean s3EncryptionEnabled() { + return this.s3EncryptionEnabled; + } + + /** + * Set the s3EncryptionEnabled property: Determines whether to use encryption on the S3 logs. If not specified, + * encryption is not used. + * + * @param s3EncryptionEnabled the s3EncryptionEnabled value to set. + * @return the ExecuteCommandLogConfiguration object itself. + */ + public ExecuteCommandLogConfiguration withS3EncryptionEnabled(Boolean s3EncryptionEnabled) { + this.s3EncryptionEnabled = s3EncryptionEnabled; + return this; + } + + /** + * Get the s3KeyPrefix property: An optional folder in the S3 bucket to place logs in. + * + * @return the s3KeyPrefix value. + */ + public String s3KeyPrefix() { + return this.s3KeyPrefix; + } + + /** + * Set the s3KeyPrefix property: An optional folder in the S3 bucket to place logs in. + * + * @param s3KeyPrefix the s3KeyPrefix value to set. + * @return the ExecuteCommandLogConfiguration object itself. + */ + public ExecuteCommandLogConfiguration withS3KeyPrefix(String s3KeyPrefix) { + this.s3KeyPrefix = s3KeyPrefix; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeBooleanField("cloudWatchEncryptionEnabled", this.cloudWatchEncryptionEnabled); + jsonWriter.writeStringField("cloudWatchLogGroupName", this.cloudWatchLogGroupName); + jsonWriter.writeStringField("s3BucketName", this.s3BucketName); + jsonWriter.writeBooleanField("s3EncryptionEnabled", this.s3EncryptionEnabled); + jsonWriter.writeStringField("s3KeyPrefix", this.s3KeyPrefix); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ExecuteCommandLogConfiguration from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ExecuteCommandLogConfiguration if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ExecuteCommandLogConfiguration. + */ + public static ExecuteCommandLogConfiguration fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ExecuteCommandLogConfiguration deserializedExecuteCommandLogConfiguration + = new ExecuteCommandLogConfiguration(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("cloudWatchEncryptionEnabled".equals(fieldName)) { + deserializedExecuteCommandLogConfiguration.cloudWatchEncryptionEnabled + = reader.getNullable(JsonReader::getBoolean); + } else if ("cloudWatchLogGroupName".equals(fieldName)) { + deserializedExecuteCommandLogConfiguration.cloudWatchLogGroupName = reader.getString(); + } else if ("s3BucketName".equals(fieldName)) { + deserializedExecuteCommandLogConfiguration.s3BucketName = reader.getString(); + } else if ("s3EncryptionEnabled".equals(fieldName)) { + deserializedExecuteCommandLogConfiguration.s3EncryptionEnabled + = reader.getNullable(JsonReader::getBoolean); + } else if ("s3KeyPrefix".equals(fieldName)) { + deserializedExecuteCommandLogConfiguration.s3KeyPrefix = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedExecuteCommandLogConfiguration; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ExportSourceType.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ExportSourceType.java new file mode 100644 index 000000000000..61820e787d59 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ExportSourceType.java @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * ExportSourceType enum. + */ +public final class ExportSourceType extends ExpandableStringEnum { + /** + * Static value CLUSTER for ExportSourceType. + */ + public static final ExportSourceType CLUSTER = fromString("CLUSTER"); + + /** + * Static value SNAPSHOT for ExportSourceType. + */ + public static final ExportSourceType SNAPSHOT = fromString("SNAPSHOT"); + + /** + * Creates a new instance of ExportSourceType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ExportSourceType() { + } + + /** + * Creates or finds a ExportSourceType from its string representation. + * + * @param name a name to look for. + * @return the corresponding ExportSourceType. + */ + public static ExportSourceType fromString(String name) { + return fromString(name, ExportSourceType.class); + } + + /** + * Gets known ExportSourceType values. + * + * @return known ExportSourceType values. + */ + public static Collection values() { + return values(ExportSourceType.class); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ExportSourceTypeEnumValue.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ExportSourceTypeEnumValue.java new file mode 100644 index 000000000000..46044cbb3435 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ExportSourceTypeEnumValue.java @@ -0,0 +1,93 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of ExportSourceTypeEnumValue. + */ +@Fluent +public final class ExportSourceTypeEnumValue implements JsonSerializable { + /* + * Property value + */ + private ExportSourceType value; + + /** + * Creates an instance of ExportSourceTypeEnumValue class. + */ + public ExportSourceTypeEnumValue() { + } + + /** + * Get the value property: Property value. + * + * @return the value value. + */ + public ExportSourceType value() { + return this.value; + } + + /** + * Set the value property: Property value. + * + * @param value the value value to set. + * @return the ExportSourceTypeEnumValue object itself. + */ + public ExportSourceTypeEnumValue withValue(ExportSourceType value) { + this.value = value; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("value", this.value == null ? null : this.value.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ExportSourceTypeEnumValue from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ExportSourceTypeEnumValue if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ExportSourceTypeEnumValue. + */ + public static ExportSourceTypeEnumValue fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ExportSourceTypeEnumValue deserializedExportSourceTypeEnumValue = new ExportSourceTypeEnumValue(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + deserializedExportSourceTypeEnumValue.value = ExportSourceType.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedExportSourceTypeEnumValue; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ExtendedKeyUsageName.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ExtendedKeyUsageName.java new file mode 100644 index 000000000000..c09ad5dc03b3 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ExtendedKeyUsageName.java @@ -0,0 +1,103 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * ExtendedKeyUsageName enum. + */ +public final class ExtendedKeyUsageName extends ExpandableStringEnum { + /** + * Static value ANY for ExtendedKeyUsageName. + */ + public static final ExtendedKeyUsageName ANY = fromString("ANY"); + + /** + * Static value CODE_SIGNING for ExtendedKeyUsageName. + */ + public static final ExtendedKeyUsageName CODE_SIGNING = fromString("CODE_SIGNING"); + + /** + * Static value CUSTOM for ExtendedKeyUsageName. + */ + public static final ExtendedKeyUsageName CUSTOM = fromString("CUSTOM"); + + /** + * Static value EMAIL_PROTECTION for ExtendedKeyUsageName. + */ + public static final ExtendedKeyUsageName EMAIL_PROTECTION = fromString("EMAIL_PROTECTION"); + + /** + * Static value IPSEC_END_SYSTEM for ExtendedKeyUsageName. + */ + public static final ExtendedKeyUsageName IPSEC_END_SYSTEM = fromString("IPSEC_END_SYSTEM"); + + /** + * Static value IPSEC_TUNNEL for ExtendedKeyUsageName. + */ + public static final ExtendedKeyUsageName IPSEC_TUNNEL = fromString("IPSEC_TUNNEL"); + + /** + * Static value IPSEC_USER for ExtendedKeyUsageName. + */ + public static final ExtendedKeyUsageName IPSEC_USER = fromString("IPSEC_USER"); + + /** + * Static value NONE for ExtendedKeyUsageName. + */ + public static final ExtendedKeyUsageName NONE = fromString("NONE"); + + /** + * Static value OCSP_SIGNING for ExtendedKeyUsageName. + */ + public static final ExtendedKeyUsageName OCSP_SIGNING = fromString("OCSP_SIGNING"); + + /** + * Static value TIME_STAMPING for ExtendedKeyUsageName. + */ + public static final ExtendedKeyUsageName TIME_STAMPING = fromString("TIME_STAMPING"); + + /** + * Static value TLS_WEB_CLIENT_AUTHENTICATION for ExtendedKeyUsageName. + */ + public static final ExtendedKeyUsageName TLS_WEB_CLIENT_AUTHENTICATION + = fromString("TLS_WEB_CLIENT_AUTHENTICATION"); + + /** + * Static value TLS_WEB_SERVER_AUTHENTICATION for ExtendedKeyUsageName. + */ + public static final ExtendedKeyUsageName TLS_WEB_SERVER_AUTHENTICATION + = fromString("TLS_WEB_SERVER_AUTHENTICATION"); + + /** + * Creates a new instance of ExtendedKeyUsageName value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ExtendedKeyUsageName() { + } + + /** + * Creates or finds a ExtendedKeyUsageName from its string representation. + * + * @param name a name to look for. + * @return the corresponding ExtendedKeyUsageName. + */ + public static ExtendedKeyUsageName fromString(String name) { + return fromString(name, ExtendedKeyUsageName.class); + } + + /** + * Gets known ExtendedKeyUsageName values. + * + * @return known ExtendedKeyUsageName values. + */ + public static Collection values() { + return values(ExtendedKeyUsageName.class); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/FSxAuthorizationConfig.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/FSxAuthorizationConfig.java new file mode 100644 index 000000000000..1736f9f0e4e9 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/FSxAuthorizationConfig.java @@ -0,0 +1,121 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of FSxAuthorizationConfig. + */ +@Fluent +public final class FSxAuthorizationConfig implements JsonSerializable { + /* + * Property credentialsParameter + */ + private String credentialsParameter; + + /* + * Property domain + */ + private String domain; + + /** + * Creates an instance of FSxAuthorizationConfig class. + */ + public FSxAuthorizationConfig() { + } + + /** + * Get the credentialsParameter property: Property credentialsParameter. + * + * @return the credentialsParameter value. + */ + public String credentialsParameter() { + return this.credentialsParameter; + } + + /** + * Set the credentialsParameter property: Property credentialsParameter. + * + * @param credentialsParameter the credentialsParameter value to set. + * @return the FSxAuthorizationConfig object itself. + */ + public FSxAuthorizationConfig withCredentialsParameter(String credentialsParameter) { + this.credentialsParameter = credentialsParameter; + return this; + } + + /** + * Get the domain property: Property domain. + * + * @return the domain value. + */ + public String domain() { + return this.domain; + } + + /** + * Set the domain property: Property domain. + * + * @param domain the domain value to set. + * @return the FSxAuthorizationConfig object itself. + */ + public FSxAuthorizationConfig withDomain(String domain) { + this.domain = domain; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("credentialsParameter", this.credentialsParameter); + jsonWriter.writeStringField("domain", this.domain); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of FSxAuthorizationConfig from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of FSxAuthorizationConfig if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the FSxAuthorizationConfig. + */ + public static FSxAuthorizationConfig fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + FSxAuthorizationConfig deserializedFSxAuthorizationConfig = new FSxAuthorizationConfig(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("credentialsParameter".equals(fieldName)) { + deserializedFSxAuthorizationConfig.credentialsParameter = reader.getString(); + } else if ("domain".equals(fieldName)) { + deserializedFSxAuthorizationConfig.domain = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedFSxAuthorizationConfig; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/FSxWindowsFileServerVolumeConfiguration.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/FSxWindowsFileServerVolumeConfiguration.java new file mode 100644 index 000000000000..964835f3deb1 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/FSxWindowsFileServerVolumeConfiguration.java @@ -0,0 +1,160 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of FSxWindowsFileServerVolumeConfiguration. + */ +@Fluent +public final class FSxWindowsFileServerVolumeConfiguration + implements JsonSerializable { + /* + * The authorization configuration details for the Amazon FSx for Windows File Server file system. + */ + private FSxAuthorizationConfig authorizationConfig; + + /* + * The Amazon FSx for Windows File Server file system ID to use. + */ + private String fileSystemId; + + /* + * The directory within the Amazon FSx for Windows File Server file system to mount as the root directory inside the + * host. + */ + private String rootDirectory; + + /** + * Creates an instance of FSxWindowsFileServerVolumeConfiguration class. + */ + public FSxWindowsFileServerVolumeConfiguration() { + } + + /** + * Get the authorizationConfig property: The authorization configuration details for the Amazon FSx for Windows File + * Server file system. + * + * @return the authorizationConfig value. + */ + public FSxAuthorizationConfig authorizationConfig() { + return this.authorizationConfig; + } + + /** + * Set the authorizationConfig property: The authorization configuration details for the Amazon FSx for Windows File + * Server file system. + * + * @param authorizationConfig the authorizationConfig value to set. + * @return the FSxWindowsFileServerVolumeConfiguration object itself. + */ + public FSxWindowsFileServerVolumeConfiguration withAuthorizationConfig(FSxAuthorizationConfig authorizationConfig) { + this.authorizationConfig = authorizationConfig; + return this; + } + + /** + * Get the fileSystemId property: The Amazon FSx for Windows File Server file system ID to use. + * + * @return the fileSystemId value. + */ + public String fileSystemId() { + return this.fileSystemId; + } + + /** + * Set the fileSystemId property: The Amazon FSx for Windows File Server file system ID to use. + * + * @param fileSystemId the fileSystemId value to set. + * @return the FSxWindowsFileServerVolumeConfiguration object itself. + */ + public FSxWindowsFileServerVolumeConfiguration withFileSystemId(String fileSystemId) { + this.fileSystemId = fileSystemId; + return this; + } + + /** + * Get the rootDirectory property: The directory within the Amazon FSx for Windows File Server file system to mount + * as the root directory inside the host. + * + * @return the rootDirectory value. + */ + public String rootDirectory() { + return this.rootDirectory; + } + + /** + * Set the rootDirectory property: The directory within the Amazon FSx for Windows File Server file system to mount + * as the root directory inside the host. + * + * @param rootDirectory the rootDirectory value to set. + * @return the FSxWindowsFileServerVolumeConfiguration object itself. + */ + public FSxWindowsFileServerVolumeConfiguration withRootDirectory(String rootDirectory) { + this.rootDirectory = rootDirectory; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (authorizationConfig() != null) { + authorizationConfig().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("authorizationConfig", this.authorizationConfig); + jsonWriter.writeStringField("fileSystemId", this.fileSystemId); + jsonWriter.writeStringField("rootDirectory", this.rootDirectory); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of FSxWindowsFileServerVolumeConfiguration from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of FSxWindowsFileServerVolumeConfiguration if the JsonReader was pointing to an instance of + * it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the FSxWindowsFileServerVolumeConfiguration. + */ + public static FSxWindowsFileServerVolumeConfiguration fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + FSxWindowsFileServerVolumeConfiguration deserializedFSxWindowsFileServerVolumeConfiguration + = new FSxWindowsFileServerVolumeConfiguration(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("authorizationConfig".equals(fieldName)) { + deserializedFSxWindowsFileServerVolumeConfiguration.authorizationConfig + = FSxAuthorizationConfig.fromJson(reader); + } else if ("fileSystemId".equals(fieldName)) { + deserializedFSxWindowsFileServerVolumeConfiguration.fileSystemId = reader.getString(); + } else if ("rootDirectory".equals(fieldName)) { + deserializedFSxWindowsFileServerVolumeConfiguration.rootDirectory = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedFSxWindowsFileServerVolumeConfiguration; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/FeatureSet.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/FeatureSet.java new file mode 100644 index 000000000000..51b075a7ef68 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/FeatureSet.java @@ -0,0 +1,52 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Specifies the feature set supported by the new organization. Each feature set supports different levels of + * functionality. + */ +public final class FeatureSet extends ExpandableStringEnum { + /** + * Static value ALL for FeatureSet. + */ + public static final FeatureSet ALL = fromString("ALL"); + + /** + * Static value CONSOLIDATED_BILLING for FeatureSet. + */ + public static final FeatureSet CONSOLIDATED_BILLING = fromString("CONSOLIDATED_BILLING"); + + /** + * Creates a new instance of FeatureSet value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public FeatureSet() { + } + + /** + * Creates or finds a FeatureSet from its string representation. + * + * @param name a name to look for. + * @return the corresponding FeatureSet. + */ + public static FeatureSet fromString(String name) { + return fromString(name, FeatureSet.class); + } + + /** + * Gets known FeatureSet values. + * + * @return known FeatureSet values. + */ + public static Collection values() { + return values(FeatureSet.class); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/FieldLogLevel.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/FieldLogLevel.java new file mode 100644 index 000000000000..3dd59817dd1a --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/FieldLogLevel.java @@ -0,0 +1,56 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * FieldLogLevel enum. + */ +public final class FieldLogLevel extends ExpandableStringEnum { + /** + * Static value ALL for FieldLogLevel. + */ + public static final FieldLogLevel ALL = fromString("ALL"); + + /** + * Static value ERROR for FieldLogLevel. + */ + public static final FieldLogLevel ERROR = fromString("ERROR"); + + /** + * Static value NONE for FieldLogLevel. + */ + public static final FieldLogLevel NONE = fromString("NONE"); + + /** + * Creates a new instance of FieldLogLevel value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public FieldLogLevel() { + } + + /** + * Creates or finds a FieldLogLevel from its string representation. + * + * @param name a name to look for. + * @return the corresponding FieldLogLevel. + */ + public static FieldLogLevel fromString(String name) { + return fromString(name, FieldLogLevel.class); + } + + /** + * Gets known FieldLogLevel values. + * + * @return known FieldLogLevel values. + */ + public static Collection values() { + return values(FieldLogLevel.class); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/FieldLogLevelEnumValue.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/FieldLogLevelEnumValue.java new file mode 100644 index 000000000000..96c3a2f8b240 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/FieldLogLevelEnumValue.java @@ -0,0 +1,93 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of FieldLogLevelEnumValue. + */ +@Fluent +public final class FieldLogLevelEnumValue implements JsonSerializable { + /* + * Property value + */ + private FieldLogLevel value; + + /** + * Creates an instance of FieldLogLevelEnumValue class. + */ + public FieldLogLevelEnumValue() { + } + + /** + * Get the value property: Property value. + * + * @return the value value. + */ + public FieldLogLevel value() { + return this.value; + } + + /** + * Set the value property: Property value. + * + * @param value the value value to set. + * @return the FieldLogLevelEnumValue object itself. + */ + public FieldLogLevelEnumValue withValue(FieldLogLevel value) { + this.value = value; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("value", this.value == null ? null : this.value.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of FieldLogLevelEnumValue from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of FieldLogLevelEnumValue if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the FieldLogLevelEnumValue. + */ + public static FieldLogLevelEnumValue fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + FieldLogLevelEnumValue deserializedFieldLogLevelEnumValue = new FieldLogLevelEnumValue(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + deserializedFieldLogLevelEnumValue.value = FieldLogLevel.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedFieldLogLevelEnumValue; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/FieldToMatch.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/FieldToMatch.java new file mode 100644 index 000000000000..7c875f19564d --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/FieldToMatch.java @@ -0,0 +1,191 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of FieldToMatch. + */ +@Fluent +public final class FieldToMatch implements JsonSerializable { + /* + * Inspect the HTTP method. The method indicates the type of operation that the request is asking the origin to + * perform. + */ + private Object method; + + /* + * Inspect the query string. This is the part of a URL that appears after a ? character, if any. + */ + private Object queryString; + + /* + * Inspect a single header. Provide the name of the header to inspect, for example, User-Agent or Referer. This + * setting isn't case sensitive. + */ + private SingleHeaderModelProperties singleHeader; + + /* + * Inspect the request URI path. This is the part of a web request that identifies a resource, for example, + * /images/daily-ad.jpg. + */ + private Object uriPath; + + /** + * Creates an instance of FieldToMatch class. + */ + public FieldToMatch() { + } + + /** + * Get the method property: Inspect the HTTP method. The method indicates the type of operation that the request is + * asking the origin to perform. + * + * @return the method value. + */ + public Object method() { + return this.method; + } + + /** + * Set the method property: Inspect the HTTP method. The method indicates the type of operation that the request is + * asking the origin to perform. + * + * @param method the method value to set. + * @return the FieldToMatch object itself. + */ + public FieldToMatch withMethod(Object method) { + this.method = method; + return this; + } + + /** + * Get the queryString property: Inspect the query string. This is the part of a URL that appears after a ? + * character, if any. + * + * @return the queryString value. + */ + public Object queryString() { + return this.queryString; + } + + /** + * Set the queryString property: Inspect the query string. This is the part of a URL that appears after a ? + * character, if any. + * + * @param queryString the queryString value to set. + * @return the FieldToMatch object itself. + */ + public FieldToMatch withQueryString(Object queryString) { + this.queryString = queryString; + return this; + } + + /** + * Get the singleHeader property: Inspect a single header. Provide the name of the header to inspect, for example, + * User-Agent or Referer. This setting isn't case sensitive. + * + * @return the singleHeader value. + */ + public SingleHeaderModelProperties singleHeader() { + return this.singleHeader; + } + + /** + * Set the singleHeader property: Inspect a single header. Provide the name of the header to inspect, for example, + * User-Agent or Referer. This setting isn't case sensitive. + * + * @param singleHeader the singleHeader value to set. + * @return the FieldToMatch object itself. + */ + public FieldToMatch withSingleHeader(SingleHeaderModelProperties singleHeader) { + this.singleHeader = singleHeader; + return this; + } + + /** + * Get the uriPath property: Inspect the request URI path. This is the part of a web request that identifies a + * resource, for example, /images/daily-ad.jpg. + * + * @return the uriPath value. + */ + public Object uriPath() { + return this.uriPath; + } + + /** + * Set the uriPath property: Inspect the request URI path. This is the part of a web request that identifies a + * resource, for example, /images/daily-ad.jpg. + * + * @param uriPath the uriPath value to set. + * @return the FieldToMatch object itself. + */ + public FieldToMatch withUriPath(Object uriPath) { + this.uriPath = uriPath; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (singleHeader() != null) { + singleHeader().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeUntypedField("method", this.method); + jsonWriter.writeUntypedField("queryString", this.queryString); + jsonWriter.writeJsonField("singleHeader", this.singleHeader); + jsonWriter.writeUntypedField("uriPath", this.uriPath); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of FieldToMatch from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of FieldToMatch if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the FieldToMatch. + */ + public static FieldToMatch fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + FieldToMatch deserializedFieldToMatch = new FieldToMatch(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("method".equals(fieldName)) { + deserializedFieldToMatch.method = reader.readUntyped(); + } else if ("queryString".equals(fieldName)) { + deserializedFieldToMatch.queryString = reader.readUntyped(); + } else if ("singleHeader".equals(fieldName)) { + deserializedFieldToMatch.singleHeader = SingleHeaderModelProperties.fromJson(reader); + } else if ("uriPath".equals(fieldName)) { + deserializedFieldToMatch.uriPath = reader.readUntyped(); + } else { + reader.skipChildren(); + } + } + + return deserializedFieldToMatch; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/FileFormat.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/FileFormat.java new file mode 100644 index 000000000000..9fb556716914 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/FileFormat.java @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * FileFormat enum. + */ +public final class FileFormat extends ExpandableStringEnum { + /** + * Static value parquet for FileFormat. + */ + public static final FileFormat PARQUET = fromString("parquet"); + + /** + * Static value plain-text for FileFormat. + */ + public static final FileFormat PLAIN_TEXT = fromString("plain-text"); + + /** + * Creates a new instance of FileFormat value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public FileFormat() { + } + + /** + * Creates or finds a FileFormat from its string representation. + * + * @param name a name to look for. + * @return the corresponding FileFormat. + */ + public static FileFormat fromString(String name) { + return fromString(name, FileFormat.class); + } + + /** + * Gets known FileFormat values. + * + * @return known FileFormat values. + */ + public static Collection values() { + return values(FileFormat.class); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/FileSystemConfig.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/FileSystemConfig.java new file mode 100644 index 000000000000..1abe65d39b95 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/FileSystemConfig.java @@ -0,0 +1,123 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of FileSystemConfig. + */ +@Fluent +public final class FileSystemConfig implements JsonSerializable { + /* + * The Amazon Resource Name (ARN) of the Amazon EFS access point that provides access to the file system. + */ + private String arn; + + /* + * The path where the function can access the file system, starting with ``/mnt/``. + */ + private String localMountPath; + + /** + * Creates an instance of FileSystemConfig class. + */ + public FileSystemConfig() { + } + + /** + * Get the arn property: The Amazon Resource Name (ARN) of the Amazon EFS access point that provides access to the + * file system. + * + * @return the arn value. + */ + public String arn() { + return this.arn; + } + + /** + * Set the arn property: The Amazon Resource Name (ARN) of the Amazon EFS access point that provides access to the + * file system. + * + * @param arn the arn value to set. + * @return the FileSystemConfig object itself. + */ + public FileSystemConfig withArn(String arn) { + this.arn = arn; + return this; + } + + /** + * Get the localMountPath property: The path where the function can access the file system, starting with ``/mnt/``. + * + * @return the localMountPath value. + */ + public String localMountPath() { + return this.localMountPath; + } + + /** + * Set the localMountPath property: The path where the function can access the file system, starting with ``/mnt/``. + * + * @param localMountPath the localMountPath value to set. + * @return the FileSystemConfig object itself. + */ + public FileSystemConfig withLocalMountPath(String localMountPath) { + this.localMountPath = localMountPath; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("arn", this.arn); + jsonWriter.writeStringField("localMountPath", this.localMountPath); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of FileSystemConfig from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of FileSystemConfig if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the FileSystemConfig. + */ + public static FileSystemConfig fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + FileSystemConfig deserializedFileSystemConfig = new FileSystemConfig(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("arn".equals(fieldName)) { + deserializedFileSystemConfig.arn = reader.getString(); + } else if ("localMountPath".equals(fieldName)) { + deserializedFileSystemConfig.localMountPath = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedFileSystemConfig; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/FileSystemProtection.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/FileSystemProtection.java new file mode 100644 index 000000000000..d5802ad2a2de --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/FileSystemProtection.java @@ -0,0 +1,117 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of FileSystemProtection. + */ +@Fluent +public final class FileSystemProtection implements JsonSerializable { + /* + * The status of the file system's replication overwrite protection. + ``ENABLED`` – The file system cannot be used + * as the destination file system in a replication configuration. The file system is writeable. Replication + * overwrite protection is ``ENABLED`` by default. + ``DISABLED`` – The file system can be used as the destination + * file system in a replication configuration. The file system is read-only and can only be modified by EFS + * replication. + ``REPLICATING`` – The file system is being used as the destination file system in a replication + * configuration. The file system is read-only and is only modified only by EFS replication. If the replication + * configuration is deleted, the file system's replication overwrite protection is re-enabled, the file system + * becomes writeable. + */ + private FileSystemProtectionReplicationOverwriteProtection replicationOverwriteProtection; + + /** + * Creates an instance of FileSystemProtection class. + */ + public FileSystemProtection() { + } + + /** + * Get the replicationOverwriteProtection property: The status of the file system's replication overwrite + * protection. + ``ENABLED`` – The file system cannot be used as the destination file system in a replication + * configuration. The file system is writeable. Replication overwrite protection is ``ENABLED`` by default. + + * ``DISABLED`` – The file system can be used as the destination file system in a replication configuration. The + * file system is read-only and can only be modified by EFS replication. + ``REPLICATING`` – The file system is + * being used as the destination file system in a replication configuration. The file system is read-only and is + * only modified only by EFS replication. If the replication configuration is deleted, the file system's replication + * overwrite protection is re-enabled, the file system becomes writeable. + * + * @return the replicationOverwriteProtection value. + */ + public FileSystemProtectionReplicationOverwriteProtection replicationOverwriteProtection() { + return this.replicationOverwriteProtection; + } + + /** + * Set the replicationOverwriteProtection property: The status of the file system's replication overwrite + * protection. + ``ENABLED`` – The file system cannot be used as the destination file system in a replication + * configuration. The file system is writeable. Replication overwrite protection is ``ENABLED`` by default. + + * ``DISABLED`` – The file system can be used as the destination file system in a replication configuration. The + * file system is read-only and can only be modified by EFS replication. + ``REPLICATING`` – The file system is + * being used as the destination file system in a replication configuration. The file system is read-only and is + * only modified only by EFS replication. If the replication configuration is deleted, the file system's replication + * overwrite protection is re-enabled, the file system becomes writeable. + * + * @param replicationOverwriteProtection the replicationOverwriteProtection value to set. + * @return the FileSystemProtection object itself. + */ + public FileSystemProtection withReplicationOverwriteProtection( + FileSystemProtectionReplicationOverwriteProtection replicationOverwriteProtection) { + this.replicationOverwriteProtection = replicationOverwriteProtection; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("replicationOverwriteProtection", + this.replicationOverwriteProtection == null ? null : this.replicationOverwriteProtection.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of FileSystemProtection from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of FileSystemProtection if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the FileSystemProtection. + */ + public static FileSystemProtection fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + FileSystemProtection deserializedFileSystemProtection = new FileSystemProtection(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("replicationOverwriteProtection".equals(fieldName)) { + deserializedFileSystemProtection.replicationOverwriteProtection + = FileSystemProtectionReplicationOverwriteProtection.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedFileSystemProtection; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/FileSystemProtectionReplicationOverwriteProtection.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/FileSystemProtectionReplicationOverwriteProtection.java new file mode 100644 index 000000000000..87ceb945830c --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/FileSystemProtectionReplicationOverwriteProtection.java @@ -0,0 +1,52 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * FileSystemProtectionReplicationOverwriteProtection enum. + */ +public final class FileSystemProtectionReplicationOverwriteProtection + extends ExpandableStringEnum { + /** + * Static value DISABLED for FileSystemProtectionReplicationOverwriteProtection. + */ + public static final FileSystemProtectionReplicationOverwriteProtection DISABLED = fromString("DISABLED"); + + /** + * Static value ENABLED for FileSystemProtectionReplicationOverwriteProtection. + */ + public static final FileSystemProtectionReplicationOverwriteProtection ENABLED = fromString("ENABLED"); + + /** + * Creates a new instance of FileSystemProtectionReplicationOverwriteProtection value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public FileSystemProtectionReplicationOverwriteProtection() { + } + + /** + * Creates or finds a FileSystemProtectionReplicationOverwriteProtection from its string representation. + * + * @param name a name to look for. + * @return the corresponding FileSystemProtectionReplicationOverwriteProtection. + */ + public static FileSystemProtectionReplicationOverwriteProtection fromString(String name) { + return fromString(name, FileSystemProtectionReplicationOverwriteProtection.class); + } + + /** + * Gets known FileSystemProtectionReplicationOverwriteProtection values. + * + * @return known FileSystemProtectionReplicationOverwriteProtection values. + */ + public static Collection values() { + return values(FileSystemProtectionReplicationOverwriteProtection.class); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/FileSystemType.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/FileSystemType.java new file mode 100644 index 000000000000..321a721284eb --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/FileSystemType.java @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * FileSystemType enum. + */ +public final class FileSystemType extends ExpandableStringEnum { + /** + * Static value EFS for FileSystemType. + */ + public static final FileSystemType EFS = fromString("EFS"); + + /** + * Creates a new instance of FileSystemType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public FileSystemType() { + } + + /** + * Creates or finds a FileSystemType from its string representation. + * + * @param name a name to look for. + * @return the corresponding FileSystemType. + */ + public static FileSystemType fromString(String name) { + return fromString(name, FileSystemType.class); + } + + /** + * Gets known FileSystemType values. + * + * @return known FileSystemType values. + */ + public static Collection values() { + return values(FileSystemType.class); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/FileSystemTypeEnumValue.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/FileSystemTypeEnumValue.java new file mode 100644 index 000000000000..fa580df5af55 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/FileSystemTypeEnumValue.java @@ -0,0 +1,93 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of FileSystemTypeEnumValue. + */ +@Fluent +public final class FileSystemTypeEnumValue implements JsonSerializable { + /* + * Property value + */ + private FileSystemType value; + + /** + * Creates an instance of FileSystemTypeEnumValue class. + */ + public FileSystemTypeEnumValue() { + } + + /** + * Get the value property: Property value. + * + * @return the value value. + */ + public FileSystemType value() { + return this.value; + } + + /** + * Set the value property: Property value. + * + * @param value the value value to set. + * @return the FileSystemTypeEnumValue object itself. + */ + public FileSystemTypeEnumValue withValue(FileSystemType value) { + this.value = value; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("value", this.value == null ? null : this.value.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of FileSystemTypeEnumValue from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of FileSystemTypeEnumValue if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the FileSystemTypeEnumValue. + */ + public static FileSystemTypeEnumValue fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + FileSystemTypeEnumValue deserializedFileSystemTypeEnumValue = new FileSystemTypeEnumValue(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + deserializedFileSystemTypeEnumValue.value = FileSystemType.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedFileSystemTypeEnumValue; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/Filter.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/Filter.java new file mode 100644 index 000000000000..9631ad6d86a7 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/Filter.java @@ -0,0 +1,209 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Definition of Filter. + */ +@Fluent +public final class Filter implements JsonSerializable { + /* + * Property contains + */ + private List contains; + + /* + * Property eq + */ + private List eq; + + /* + * Property exists + */ + private Boolean exists; + + /* + * Property neq + */ + private List neq; + + /* + * Property property + */ + private String property; + + /** + * Creates an instance of Filter class. + */ + public Filter() { + } + + /** + * Get the contains property: Property contains. + * + * @return the contains value. + */ + public List contains() { + return this.contains; + } + + /** + * Set the contains property: Property contains. + * + * @param contains the contains value to set. + * @return the Filter object itself. + */ + public Filter withContains(List contains) { + this.contains = contains; + return this; + } + + /** + * Get the eq property: Property eq. + * + * @return the eq value. + */ + public List eq() { + return this.eq; + } + + /** + * Set the eq property: Property eq. + * + * @param eq the eq value to set. + * @return the Filter object itself. + */ + public Filter withEq(List eq) { + this.eq = eq; + return this; + } + + /** + * Get the exists property: Property exists. + * + * @return the exists value. + */ + public Boolean exists() { + return this.exists; + } + + /** + * Set the exists property: Property exists. + * + * @param exists the exists value to set. + * @return the Filter object itself. + */ + public Filter withExists(Boolean exists) { + this.exists = exists; + return this; + } + + /** + * Get the neq property: Property neq. + * + * @return the neq value. + */ + public List neq() { + return this.neq; + } + + /** + * Set the neq property: Property neq. + * + * @param neq the neq value to set. + * @return the Filter object itself. + */ + public Filter withNeq(List neq) { + this.neq = neq; + return this; + } + + /** + * Get the property property: Property property. + * + * @return the property value. + */ + public String property() { + return this.property; + } + + /** + * Set the property property: Property property. + * + * @param property the property value to set. + * @return the Filter object itself. + */ + public Filter withProperty(String property) { + this.property = property; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("contains", this.contains, (writer, element) -> writer.writeString(element)); + jsonWriter.writeArrayField("eq", this.eq, (writer, element) -> writer.writeString(element)); + jsonWriter.writeBooleanField("exists", this.exists); + jsonWriter.writeArrayField("neq", this.neq, (writer, element) -> writer.writeString(element)); + jsonWriter.writeStringField("property", this.property); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of Filter from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of Filter if the JsonReader was pointing to an instance of it, or null if it was pointing to + * JSON null. + * @throws IOException If an error occurs while reading the Filter. + */ + public static Filter fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + Filter deserializedFilter = new Filter(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("contains".equals(fieldName)) { + List contains = reader.readArray(reader1 -> reader1.getString()); + deserializedFilter.contains = contains; + } else if ("eq".equals(fieldName)) { + List eq = reader.readArray(reader1 -> reader1.getString()); + deserializedFilter.eq = eq; + } else if ("exists".equals(fieldName)) { + deserializedFilter.exists = reader.getNullable(JsonReader::getBoolean); + } else if ("neq".equals(fieldName)) { + List neq = reader.readArray(reader1 -> reader1.getString()); + deserializedFilter.neq = neq; + } else if ("property".equals(fieldName)) { + deserializedFilter.property = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedFilter; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/FilterAutoGenerated.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/FilterAutoGenerated.java new file mode 100644 index 000000000000..c0de06b93c48 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/FilterAutoGenerated.java @@ -0,0 +1,157 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Definition of Filter. + */ +@Fluent +public final class FilterAutoGenerated implements JsonSerializable { + /* + * How to handle logs that satisfy the filter's conditions and requirement. + */ + private FilterBehavior behavior; + + /* + * Match conditions for the filter. + */ + private List conditions; + + /* + * Logic to apply to the filtering conditions. You can specify that, in order to satisfy the filter, a log must + * match all conditions or must match at least one condition. + */ + private FilterRequirement requirement; + + /** + * Creates an instance of FilterAutoGenerated class. + */ + public FilterAutoGenerated() { + } + + /** + * Get the behavior property: How to handle logs that satisfy the filter's conditions and requirement. + * + * @return the behavior value. + */ + public FilterBehavior behavior() { + return this.behavior; + } + + /** + * Set the behavior property: How to handle logs that satisfy the filter's conditions and requirement. + * + * @param behavior the behavior value to set. + * @return the FilterAutoGenerated object itself. + */ + public FilterAutoGenerated withBehavior(FilterBehavior behavior) { + this.behavior = behavior; + return this; + } + + /** + * Get the conditions property: Match conditions for the filter. + * + * @return the conditions value. + */ + public List conditions() { + return this.conditions; + } + + /** + * Set the conditions property: Match conditions for the filter. + * + * @param conditions the conditions value to set. + * @return the FilterAutoGenerated object itself. + */ + public FilterAutoGenerated withConditions(List conditions) { + this.conditions = conditions; + return this; + } + + /** + * Get the requirement property: Logic to apply to the filtering conditions. You can specify that, in order to + * satisfy the filter, a log must match all conditions or must match at least one condition. + * + * @return the requirement value. + */ + public FilterRequirement requirement() { + return this.requirement; + } + + /** + * Set the requirement property: Logic to apply to the filtering conditions. You can specify that, in order to + * satisfy the filter, a log must match all conditions or must match at least one condition. + * + * @param requirement the requirement value to set. + * @return the FilterAutoGenerated object itself. + */ + public FilterAutoGenerated withRequirement(FilterRequirement requirement) { + this.requirement = requirement; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (conditions() != null) { + conditions().forEach(e -> e.validate()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("behavior", this.behavior == null ? null : this.behavior.toString()); + jsonWriter.writeArrayField("conditions", this.conditions, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("requirement", this.requirement == null ? null : this.requirement.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of FilterAutoGenerated from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of FilterAutoGenerated if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the FilterAutoGenerated. + */ + public static FilterAutoGenerated fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + FilterAutoGenerated deserializedFilterAutoGenerated = new FilterAutoGenerated(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("behavior".equals(fieldName)) { + deserializedFilterAutoGenerated.behavior = FilterBehavior.fromString(reader.getString()); + } else if ("conditions".equals(fieldName)) { + List conditions = reader.readArray(reader1 -> Condition.fromJson(reader1)); + deserializedFilterAutoGenerated.conditions = conditions; + } else if ("requirement".equals(fieldName)) { + deserializedFilterAutoGenerated.requirement = FilterRequirement.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedFilterAutoGenerated; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/FilterBehavior.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/FilterBehavior.java new file mode 100644 index 000000000000..a0bf7d5a01d7 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/FilterBehavior.java @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * FilterBehavior enum. + */ +public final class FilterBehavior extends ExpandableStringEnum { + /** + * Static value DROP for FilterBehavior. + */ + public static final FilterBehavior DROP = fromString("DROP"); + + /** + * Static value KEEP for FilterBehavior. + */ + public static final FilterBehavior KEEP = fromString("KEEP"); + + /** + * Creates a new instance of FilterBehavior value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public FilterBehavior() { + } + + /** + * Creates or finds a FilterBehavior from its string representation. + * + * @param name a name to look for. + * @return the corresponding FilterBehavior. + */ + public static FilterBehavior fromString(String name) { + return fromString(name, FilterBehavior.class); + } + + /** + * Gets known FilterBehavior values. + * + * @return known FilterBehavior values. + */ + public static Collection values() { + return values(FilterBehavior.class); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/FilterGroup.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/FilterGroup.java new file mode 100644 index 000000000000..0254962345bb --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/FilterGroup.java @@ -0,0 +1,96 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of FilterGroup. + */ +@Fluent +public final class FilterGroup implements JsonSerializable { + /* + * Property webhookFilter + */ + private WebhookFilter webhookFilter; + + /** + * Creates an instance of FilterGroup class. + */ + public FilterGroup() { + } + + /** + * Get the webhookFilter property: Property webhookFilter. + * + * @return the webhookFilter value. + */ + public WebhookFilter webhookFilter() { + return this.webhookFilter; + } + + /** + * Set the webhookFilter property: Property webhookFilter. + * + * @param webhookFilter the webhookFilter value to set. + * @return the FilterGroup object itself. + */ + public FilterGroup withWebhookFilter(WebhookFilter webhookFilter) { + this.webhookFilter = webhookFilter; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (webhookFilter() != null) { + webhookFilter().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("webhookFilter", this.webhookFilter); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of FilterGroup from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of FilterGroup if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the FilterGroup. + */ + public static FilterGroup fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + FilterGroup deserializedFilterGroup = new FilterGroup(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("webhookFilter".equals(fieldName)) { + deserializedFilterGroup.webhookFilter = WebhookFilter.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedFilterGroup; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/FilterRequirement.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/FilterRequirement.java new file mode 100644 index 000000000000..ff52636f06b3 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/FilterRequirement.java @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * FilterRequirement enum. + */ +public final class FilterRequirement extends ExpandableStringEnum { + /** + * Static value MEETS_ALL for FilterRequirement. + */ + public static final FilterRequirement MEETS_ALL = fromString("MEETS_ALL"); + + /** + * Static value MEETS_ANY for FilterRequirement. + */ + public static final FilterRequirement MEETS_ANY = fromString("MEETS_ANY"); + + /** + * Creates a new instance of FilterRequirement value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public FilterRequirement() { + } + + /** + * Creates or finds a FilterRequirement from its string representation. + * + * @param name a name to look for. + * @return the corresponding FilterRequirement. + */ + public static FilterRequirement fromString(String name) { + return fromString(name, FilterRequirement.class); + } + + /** + * Gets known FilterRequirement values. + * + * @return known FilterRequirement values. + */ + public static Collection values() { + return values(FilterRequirement.class); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/FilterRule.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/FilterRule.java new file mode 100644 index 000000000000..96c51fa33446 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/FilterRule.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.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of FilterRule. + */ +@Fluent +public final class FilterRule implements JsonSerializable { + /* + * The object key name prefix or suffix identifying one or more objects to which the filtering rule applies. The + * maximum length is 1,024 characters. Overlapping prefixes and suffixes are not supported. For more information, + * see [Configuring Event Notifications](https://docs.aws.amazon.com/AmazonS3/latest/dev/NotificationHowTo.html) in + * the *Amazon S3 User Guide*. + */ + private String name; + + /* + * The value that the filter searches for in object key names. + */ + private String value; + + /** + * Creates an instance of FilterRule class. + */ + public FilterRule() { + } + + /** + * Get the name property: The object key name prefix or suffix identifying one or more objects to which the + * filtering rule applies. The maximum length is 1,024 characters. Overlapping prefixes and suffixes are not + * supported. For more information, see [Configuring Event + * Notifications](https://docs.aws.amazon.com/AmazonS3/latest/dev/NotificationHowTo.html) in the *Amazon S3 User + * Guide*. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: The object key name prefix or suffix identifying one or more objects to which the + * filtering rule applies. The maximum length is 1,024 characters. Overlapping prefixes and suffixes are not + * supported. For more information, see [Configuring Event + * Notifications](https://docs.aws.amazon.com/AmazonS3/latest/dev/NotificationHowTo.html) in the *Amazon S3 User + * Guide*. + * + * @param name the name value to set. + * @return the FilterRule object itself. + */ + public FilterRule withName(String name) { + this.name = name; + return this; + } + + /** + * Get the value property: The value that the filter searches for in object key names. + * + * @return the value value. + */ + public String value() { + return this.value; + } + + /** + * Set the value property: The value that the filter searches for in object key names. + * + * @param value the value value to set. + * @return the FilterRule object itself. + */ + public FilterRule withValue(String value) { + this.value = value; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("name", this.name); + jsonWriter.writeStringField("value", this.value); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of FilterRule from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of FilterRule if the JsonReader was pointing to an instance of it, or null if it was pointing + * to JSON null. + * @throws IOException If an error occurs while reading the FilterRule. + */ + public static FilterRule fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + FilterRule deserializedFilterRule = new FilterRule(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("name".equals(fieldName)) { + deserializedFilterRule.name = reader.getString(); + } else if ("value".equals(fieldName)) { + deserializedFilterRule.value = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedFilterRule; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/FirelensConfiguration.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/FirelensConfiguration.java new file mode 100644 index 000000000000..42c412be88e1 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/FirelensConfiguration.java @@ -0,0 +1,133 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of FirelensConfiguration. + */ +@Fluent +public final class FirelensConfiguration implements JsonSerializable { + /* + * The options to use when configuring the log router. This field is optional and can be used to add additional + * metadata, such as the task, task definition, cluster, and container instance details to the log event. If + * specified, valid option keys are: + ``enable-ecs-log-metadata``, which can be ``true`` or ``false`` + + * ``config-file-type``, which can be ``s3`` or ``file`` + ``config-file-value``, which is either an S3 ARN or a + * file path + */ + private Object options; + + /* + * The log router to use. The valid values are ``fluentd`` or ``fluentbit``. + */ + private String type; + + /** + * Creates an instance of FirelensConfiguration class. + */ + public FirelensConfiguration() { + } + + /** + * Get the options property: The options to use when configuring the log router. This field is optional and can be + * used to add additional metadata, such as the task, task definition, cluster, and container instance details to + * the log event. If specified, valid option keys are: + ``enable-ecs-log-metadata``, which can be ``true`` or + * ``false`` + ``config-file-type``, which can be ``s3`` or ``file`` + ``config-file-value``, which is either an S3 + * ARN or a file path. + * + * @return the options value. + */ + public Object options() { + return this.options; + } + + /** + * Set the options property: The options to use when configuring the log router. This field is optional and can be + * used to add additional metadata, such as the task, task definition, cluster, and container instance details to + * the log event. If specified, valid option keys are: + ``enable-ecs-log-metadata``, which can be ``true`` or + * ``false`` + ``config-file-type``, which can be ``s3`` or ``file`` + ``config-file-value``, which is either an S3 + * ARN or a file path. + * + * @param options the options value to set. + * @return the FirelensConfiguration object itself. + */ + public FirelensConfiguration withOptions(Object options) { + this.options = options; + return this; + } + + /** + * Get the type property: The log router to use. The valid values are ``fluentd`` or ``fluentbit``. + * + * @return the type value. + */ + public String type() { + return this.type; + } + + /** + * Set the type property: The log router to use. The valid values are ``fluentd`` or ``fluentbit``. + * + * @param type the type value to set. + * @return the FirelensConfiguration object itself. + */ + public FirelensConfiguration withType(String type) { + this.type = type; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeUntypedField("options", this.options); + jsonWriter.writeStringField("type", this.type); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of FirelensConfiguration from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of FirelensConfiguration if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the FirelensConfiguration. + */ + public static FirelensConfiguration fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + FirelensConfiguration deserializedFirelensConfiguration = new FirelensConfiguration(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("options".equals(fieldName)) { + deserializedFirelensConfiguration.options = reader.readUntyped(); + } else if ("type".equals(fieldName)) { + deserializedFirelensConfiguration.type = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedFirelensConfiguration; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/FirewallPolicy.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/FirewallPolicy.java new file mode 100644 index 000000000000..daf4bb2a3884 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/FirewallPolicy.java @@ -0,0 +1,350 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Definition of FirewallPolicy. + */ +@Fluent +public final class FirewallPolicy implements JsonSerializable { + /* + * Property policyVariables + */ + private RuleVariablesModel policyVariables; + + /* + * Property statefulDefaultActions + */ + private List statefulDefaultActions; + + /* + * Property statefulEngineOptions + */ + private StatefulEngineOptions statefulEngineOptions; + + /* + * Property statefulRuleGroupReferences + */ + private List statefulRuleGroupReferences; + + /* + * Property statelessCustomActions + */ + private List statelessCustomActions; + + /* + * Property statelessDefaultActions + */ + private List statelessDefaultActions; + + /* + * Property statelessFragmentDefaultActions + */ + private List statelessFragmentDefaultActions; + + /* + * Property statelessRuleGroupReferences + */ + private List statelessRuleGroupReferences; + + /* + * A resource ARN. + */ + private String tlsInspectionConfigurationArn; + + /** + * Creates an instance of FirewallPolicy class. + */ + public FirewallPolicy() { + } + + /** + * Get the policyVariables property: Property policyVariables. + * + * @return the policyVariables value. + */ + public RuleVariablesModel policyVariables() { + return this.policyVariables; + } + + /** + * Set the policyVariables property: Property policyVariables. + * + * @param policyVariables the policyVariables value to set. + * @return the FirewallPolicy object itself. + */ + public FirewallPolicy withPolicyVariables(RuleVariablesModel policyVariables) { + this.policyVariables = policyVariables; + return this; + } + + /** + * Get the statefulDefaultActions property: Property statefulDefaultActions. + * + * @return the statefulDefaultActions value. + */ + public List statefulDefaultActions() { + return this.statefulDefaultActions; + } + + /** + * Set the statefulDefaultActions property: Property statefulDefaultActions. + * + * @param statefulDefaultActions the statefulDefaultActions value to set. + * @return the FirewallPolicy object itself. + */ + public FirewallPolicy withStatefulDefaultActions(List statefulDefaultActions) { + this.statefulDefaultActions = statefulDefaultActions; + return this; + } + + /** + * Get the statefulEngineOptions property: Property statefulEngineOptions. + * + * @return the statefulEngineOptions value. + */ + public StatefulEngineOptions statefulEngineOptions() { + return this.statefulEngineOptions; + } + + /** + * Set the statefulEngineOptions property: Property statefulEngineOptions. + * + * @param statefulEngineOptions the statefulEngineOptions value to set. + * @return the FirewallPolicy object itself. + */ + public FirewallPolicy withStatefulEngineOptions(StatefulEngineOptions statefulEngineOptions) { + this.statefulEngineOptions = statefulEngineOptions; + return this; + } + + /** + * Get the statefulRuleGroupReferences property: Property statefulRuleGroupReferences. + * + * @return the statefulRuleGroupReferences value. + */ + public List statefulRuleGroupReferences() { + return this.statefulRuleGroupReferences; + } + + /** + * Set the statefulRuleGroupReferences property: Property statefulRuleGroupReferences. + * + * @param statefulRuleGroupReferences the statefulRuleGroupReferences value to set. + * @return the FirewallPolicy object itself. + */ + public FirewallPolicy + withStatefulRuleGroupReferences(List statefulRuleGroupReferences) { + this.statefulRuleGroupReferences = statefulRuleGroupReferences; + return this; + } + + /** + * Get the statelessCustomActions property: Property statelessCustomActions. + * + * @return the statelessCustomActions value. + */ + public List statelessCustomActions() { + return this.statelessCustomActions; + } + + /** + * Set the statelessCustomActions property: Property statelessCustomActions. + * + * @param statelessCustomActions the statelessCustomActions value to set. + * @return the FirewallPolicy object itself. + */ + public FirewallPolicy withStatelessCustomActions(List statelessCustomActions) { + this.statelessCustomActions = statelessCustomActions; + return this; + } + + /** + * Get the statelessDefaultActions property: Property statelessDefaultActions. + * + * @return the statelessDefaultActions value. + */ + public List statelessDefaultActions() { + return this.statelessDefaultActions; + } + + /** + * Set the statelessDefaultActions property: Property statelessDefaultActions. + * + * @param statelessDefaultActions the statelessDefaultActions value to set. + * @return the FirewallPolicy object itself. + */ + public FirewallPolicy withStatelessDefaultActions(List statelessDefaultActions) { + this.statelessDefaultActions = statelessDefaultActions; + return this; + } + + /** + * Get the statelessFragmentDefaultActions property: Property statelessFragmentDefaultActions. + * + * @return the statelessFragmentDefaultActions value. + */ + public List statelessFragmentDefaultActions() { + return this.statelessFragmentDefaultActions; + } + + /** + * Set the statelessFragmentDefaultActions property: Property statelessFragmentDefaultActions. + * + * @param statelessFragmentDefaultActions the statelessFragmentDefaultActions value to set. + * @return the FirewallPolicy object itself. + */ + public FirewallPolicy withStatelessFragmentDefaultActions(List statelessFragmentDefaultActions) { + this.statelessFragmentDefaultActions = statelessFragmentDefaultActions; + return this; + } + + /** + * Get the statelessRuleGroupReferences property: Property statelessRuleGroupReferences. + * + * @return the statelessRuleGroupReferences value. + */ + public List statelessRuleGroupReferences() { + return this.statelessRuleGroupReferences; + } + + /** + * Set the statelessRuleGroupReferences property: Property statelessRuleGroupReferences. + * + * @param statelessRuleGroupReferences the statelessRuleGroupReferences value to set. + * @return the FirewallPolicy object itself. + */ + public FirewallPolicy + withStatelessRuleGroupReferences(List statelessRuleGroupReferences) { + this.statelessRuleGroupReferences = statelessRuleGroupReferences; + return this; + } + + /** + * Get the tlsInspectionConfigurationArn property: A resource ARN. + * + * @return the tlsInspectionConfigurationArn value. + */ + public String tlsInspectionConfigurationArn() { + return this.tlsInspectionConfigurationArn; + } + + /** + * Set the tlsInspectionConfigurationArn property: A resource ARN. + * + * @param tlsInspectionConfigurationArn the tlsInspectionConfigurationArn value to set. + * @return the FirewallPolicy object itself. + */ + public FirewallPolicy withTlsInspectionConfigurationArn(String tlsInspectionConfigurationArn) { + this.tlsInspectionConfigurationArn = tlsInspectionConfigurationArn; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (policyVariables() != null) { + policyVariables().validate(); + } + if (statefulEngineOptions() != null) { + statefulEngineOptions().validate(); + } + if (statefulRuleGroupReferences() != null) { + statefulRuleGroupReferences().forEach(e -> e.validate()); + } + if (statelessCustomActions() != null) { + statelessCustomActions().forEach(e -> e.validate()); + } + if (statelessRuleGroupReferences() != null) { + statelessRuleGroupReferences().forEach(e -> e.validate()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("policyVariables", this.policyVariables); + jsonWriter.writeArrayField("statefulDefaultActions", this.statefulDefaultActions, + (writer, element) -> writer.writeString(element)); + jsonWriter.writeJsonField("statefulEngineOptions", this.statefulEngineOptions); + jsonWriter.writeArrayField("statefulRuleGroupReferences", this.statefulRuleGroupReferences, + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("statelessCustomActions", this.statelessCustomActions, + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("statelessDefaultActions", this.statelessDefaultActions, + (writer, element) -> writer.writeString(element)); + jsonWriter.writeArrayField("statelessFragmentDefaultActions", this.statelessFragmentDefaultActions, + (writer, element) -> writer.writeString(element)); + jsonWriter.writeArrayField("statelessRuleGroupReferences", this.statelessRuleGroupReferences, + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("tlsInspectionConfigurationArn", this.tlsInspectionConfigurationArn); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of FirewallPolicy from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of FirewallPolicy if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the FirewallPolicy. + */ + public static FirewallPolicy fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + FirewallPolicy deserializedFirewallPolicy = new FirewallPolicy(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("policyVariables".equals(fieldName)) { + deserializedFirewallPolicy.policyVariables = RuleVariablesModel.fromJson(reader); + } else if ("statefulDefaultActions".equals(fieldName)) { + List statefulDefaultActions = reader.readArray(reader1 -> reader1.getString()); + deserializedFirewallPolicy.statefulDefaultActions = statefulDefaultActions; + } else if ("statefulEngineOptions".equals(fieldName)) { + deserializedFirewallPolicy.statefulEngineOptions = StatefulEngineOptions.fromJson(reader); + } else if ("statefulRuleGroupReferences".equals(fieldName)) { + List statefulRuleGroupReferences + = reader.readArray(reader1 -> StatefulRuleGroupReference.fromJson(reader1)); + deserializedFirewallPolicy.statefulRuleGroupReferences = statefulRuleGroupReferences; + } else if ("statelessCustomActions".equals(fieldName)) { + List statelessCustomActions + = reader.readArray(reader1 -> CustomAction.fromJson(reader1)); + deserializedFirewallPolicy.statelessCustomActions = statelessCustomActions; + } else if ("statelessDefaultActions".equals(fieldName)) { + List statelessDefaultActions = reader.readArray(reader1 -> reader1.getString()); + deserializedFirewallPolicy.statelessDefaultActions = statelessDefaultActions; + } else if ("statelessFragmentDefaultActions".equals(fieldName)) { + List statelessFragmentDefaultActions = reader.readArray(reader1 -> reader1.getString()); + deserializedFirewallPolicy.statelessFragmentDefaultActions = statelessFragmentDefaultActions; + } else if ("statelessRuleGroupReferences".equals(fieldName)) { + List statelessRuleGroupReferences + = reader.readArray(reader1 -> StatelessRuleGroupReference.fromJson(reader1)); + deserializedFirewallPolicy.statelessRuleGroupReferences = statelessRuleGroupReferences; + } else if ("tlsInspectionConfigurationArn".equals(fieldName)) { + deserializedFirewallPolicy.tlsInspectionConfigurationArn = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedFirewallPolicy; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/FixedResponseConfig.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/FixedResponseConfig.java new file mode 100644 index 000000000000..b3616c4c1bca --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/FixedResponseConfig.java @@ -0,0 +1,151 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of FixedResponseConfig. + */ +@Fluent +public final class FixedResponseConfig implements JsonSerializable { + /* + * The content type. Valid Values: text/plain | text/css | text/html | application/javascript | application/json + */ + private String contentType; + + /* + * The message. + */ + private String messageBody; + + /* + * The HTTP response code (2XX, 4XX, or 5XX). + */ + private String statusCode; + + /** + * Creates an instance of FixedResponseConfig class. + */ + public FixedResponseConfig() { + } + + /** + * Get the contentType property: The content type. Valid Values: text/plain | text/css | text/html | + * application/javascript | application/json. + * + * @return the contentType value. + */ + public String contentType() { + return this.contentType; + } + + /** + * Set the contentType property: The content type. Valid Values: text/plain | text/css | text/html | + * application/javascript | application/json. + * + * @param contentType the contentType value to set. + * @return the FixedResponseConfig object itself. + */ + public FixedResponseConfig withContentType(String contentType) { + this.contentType = contentType; + return this; + } + + /** + * Get the messageBody property: The message. + * + * @return the messageBody value. + */ + public String messageBody() { + return this.messageBody; + } + + /** + * Set the messageBody property: The message. + * + * @param messageBody the messageBody value to set. + * @return the FixedResponseConfig object itself. + */ + public FixedResponseConfig withMessageBody(String messageBody) { + this.messageBody = messageBody; + return this; + } + + /** + * Get the statusCode property: The HTTP response code (2XX, 4XX, or 5XX). + * + * @return the statusCode value. + */ + public String statusCode() { + return this.statusCode; + } + + /** + * Set the statusCode property: The HTTP response code (2XX, 4XX, or 5XX). + * + * @param statusCode the statusCode value to set. + * @return the FixedResponseConfig object itself. + */ + public FixedResponseConfig withStatusCode(String statusCode) { + this.statusCode = statusCode; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("contentType", this.contentType); + jsonWriter.writeStringField("messageBody", this.messageBody); + jsonWriter.writeStringField("statusCode", this.statusCode); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of FixedResponseConfig from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of FixedResponseConfig if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the FixedResponseConfig. + */ + public static FixedResponseConfig fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + FixedResponseConfig deserializedFixedResponseConfig = new FixedResponseConfig(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("contentType".equals(fieldName)) { + deserializedFixedResponseConfig.contentType = reader.getString(); + } else if ("messageBody".equals(fieldName)) { + deserializedFixedResponseConfig.messageBody = reader.getString(); + } else if ("statusCode".equals(fieldName)) { + deserializedFixedResponseConfig.statusCode = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedFixedResponseConfig; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ForwardConfig.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ForwardConfig.java new file mode 100644 index 000000000000..fc3cb6b6beab --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ForwardConfig.java @@ -0,0 +1,136 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Definition of ForwardConfig. + */ +@Fluent +public final class ForwardConfig implements JsonSerializable { + /* + * Information about the target group stickiness for a rule. Information about the target group stickiness for a + * rule. + */ + private TargetGroupStickinessConfig targetGroupStickinessConfig; + + /* + * Information about how traffic will be distributed between multiple target groups in a forward rule. + */ + private List targetGroups; + + /** + * Creates an instance of ForwardConfig class. + */ + public ForwardConfig() { + } + + /** + * Get the targetGroupStickinessConfig property: Information about the target group stickiness for a rule. + * Information about the target group stickiness for a rule. + * + * @return the targetGroupStickinessConfig value. + */ + public TargetGroupStickinessConfig targetGroupStickinessConfig() { + return this.targetGroupStickinessConfig; + } + + /** + * Set the targetGroupStickinessConfig property: Information about the target group stickiness for a rule. + * Information about the target group stickiness for a rule. + * + * @param targetGroupStickinessConfig the targetGroupStickinessConfig value to set. + * @return the ForwardConfig object itself. + */ + public ForwardConfig withTargetGroupStickinessConfig(TargetGroupStickinessConfig targetGroupStickinessConfig) { + this.targetGroupStickinessConfig = targetGroupStickinessConfig; + return this; + } + + /** + * Get the targetGroups property: Information about how traffic will be distributed between multiple target groups + * in a forward rule. + * + * @return the targetGroups value. + */ + public List targetGroups() { + return this.targetGroups; + } + + /** + * Set the targetGroups property: Information about how traffic will be distributed between multiple target groups + * in a forward rule. + * + * @param targetGroups the targetGroups value to set. + * @return the ForwardConfig object itself. + */ + public ForwardConfig withTargetGroups(List targetGroups) { + this.targetGroups = targetGroups; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (targetGroupStickinessConfig() != null) { + targetGroupStickinessConfig().validate(); + } + if (targetGroups() != null) { + targetGroups().forEach(e -> e.validate()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("targetGroupStickinessConfig", this.targetGroupStickinessConfig); + jsonWriter.writeArrayField("targetGroups", this.targetGroups, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ForwardConfig from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ForwardConfig if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the ForwardConfig. + */ + public static ForwardConfig fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ForwardConfig deserializedForwardConfig = new ForwardConfig(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("targetGroupStickinessConfig".equals(fieldName)) { + deserializedForwardConfig.targetGroupStickinessConfig + = TargetGroupStickinessConfig.fromJson(reader); + } else if ("targetGroups".equals(fieldName)) { + List targetGroups + = reader.readArray(reader1 -> TargetGroupTuple.fromJson(reader1)); + deserializedForwardConfig.targetGroups = targetGroups; + } else { + reader.skipChildren(); + } + } + + return deserializedForwardConfig; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ForwardedValues.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ForwardedValues.java new file mode 100644 index 000000000000..5546f611b873 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ForwardedValues.java @@ -0,0 +1,374 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Definition of ForwardedValues. + */ +@Fluent +public final class ForwardedValues implements JsonSerializable { + /* + * This field is deprecated. We recommend that you use a cache policy or an origin request policy instead of this + * field. If you want to include cookies in the cache key, use a cache policy. For more information, see [Creating + * cache + * policies](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/controlling-the-cache-key.html#cache + * -key-create-cache-policy) in the *Amazon CloudFront Developer Guide*. If you want to send cookies to the origin + * but not include them in the cache key, use an origin request policy. For more information, see [Creating origin + * request + * policies](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/controlling-origin-requests.html# + * origin-request-create-origin-request-policy) in the *Amazon CloudFront Developer Guide*. A complex type that + * specifies whether you want CloudFront to forward cookies to the origin and, if so, which ones. For more + * information about forwarding cookies to the origin, see [How CloudFront Forwards, Caches, and Logs + * Cookies](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/Cookies.html) in the *Amazon + * CloudFront Developer Guide*. This field is deprecated. We recommend that you use a cache policy or an origin + * request policy instead of this field. If you want to include cookies in the cache key, use a cache policy. For + * more information, see [Creating cache + * policies](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/controlling-the-cache-key.html#cache + * -key-create-cache-policy) in the *Amazon CloudFront Developer Guide*. If you want to send cookies to the origin + * but not include them in the cache key, use an origin request policy. For more information, see [Creating origin + * request + * policies](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/controlling-origin-requests.html# + * origin-request-create-origin-request-policy) in the *Amazon CloudFront Developer Guide*. A complex type that + * specifies whether you want CloudFront to forward cookies to the origin and, if so, which ones. For more + * information about forwarding cookies to the origin, see [How CloudFront Forwards, Caches, and Logs + * Cookies](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/Cookies.html) in the *Amazon + * CloudFront Developer Guide*. + */ + private Cookies cookies; + + /* + * This field is deprecated. We recommend that you use a cache policy or an origin request policy instead of this + * field. If you want to include headers in the cache key, use a cache policy. For more information, see [Creating + * cache + * policies](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/controlling-the-cache-key.html#cache + * -key-create-cache-policy) in the *Amazon CloudFront Developer Guide*. If you want to send headers to the origin + * but not include them in the cache key, use an origin request policy. For more information, see [Creating origin + * request + * policies](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/controlling-origin-requests.html# + * origin-request-create-origin-request-policy) in the *Amazon CloudFront Developer Guide*. A complex type that + * specifies the ``Headers``, if any, that you want CloudFront to forward to the origin for this cache behavior + * (whitelisted headers). For the headers that you specify, CloudFront also caches separate versions of a specified + * object that is based on the header values in viewer requests. For more information, see [Caching Content Based on + * Request Headers](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/header-caching.html) in the + * *Amazon CloudFront Developer Guide*. + */ + private List headers; + + /* + * This field is deprecated. We recommend that you use a cache policy or an origin request policy instead of this + * field. If you want to include query strings in the cache key, use a cache policy. For more information, see + * [Creating cache + * policies](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/controlling-the-cache-key.html#cache + * -key-create-cache-policy) in the *Amazon CloudFront Developer Guide*. If you want to send query strings to the + * origin but not include them in the cache key, use an origin request policy. For more information, see [Creating + * origin request + * policies](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/controlling-origin-requests.html# + * origin-request-create-origin-request-policy) in the *Amazon CloudFront Developer Guide*. Indicates whether you + * want CloudFront to forward query strings to the origin that is associated with this cache behavior and cache + * based on the query string parameters. CloudFront behavior depends on the value of ``QueryString`` and on the + * values that you specify for ``QueryStringCacheKeys``, if any: If you specify true for ``QueryString`` and you + * don't specify any values for ``QueryStringCacheKeys``, CloudFront forwards all query string parameters to the + * origin and caches based on all query string parameters. Depending on how many query string parameters and values + * you have, this can adversely affect performance because CloudFront must forward more requests to the origin. If + * you specify true for ``QueryString`` and you specify one or more values for ``QueryStringCacheKeys``, CloudFront + * forwards all query string parameters to the origin, but it only caches based on the query string parameters that + * you specify. If you specify false for ``QueryString``, CloudFront doesn't forward any query string parameters to + * the origin, and doesn't cache based on query string parameters. For more information, see [Configuring CloudFront + * to Cache Based on Query String + * Parameters](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/QueryStringParameters.html) in the + * *Amazon CloudFront Developer Guide*. + */ + private Boolean queryString; + + /* + * This field is deprecated. We recommend that you use a cache policy or an origin request policy instead of this + * field. If you want to include query strings in the cache key, use a cache policy. For more information, see + * [Creating cache + * policies](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/controlling-the-cache-key.html#cache + * -key-create-cache-policy) in the *Amazon CloudFront Developer Guide*. If you want to send query strings to the + * origin but not include them in the cache key, use an origin request policy. For more information, see [Creating + * origin request + * policies](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/controlling-origin-requests.html# + * origin-request-create-origin-request-policy) in the *Amazon CloudFront Developer Guide*. A complex type that + * contains information about the query string parameters that you want CloudFront to use for caching for this cache + * behavior. + */ + private List queryStringCacheKeys; + + /** + * Creates an instance of ForwardedValues class. + */ + public ForwardedValues() { + } + + /** + * Get the cookies property: This field is deprecated. We recommend that you use a cache policy or an origin request + * policy instead of this field. If you want to include cookies in the cache key, use a cache policy. For more + * information, see [Creating cache + * policies](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/controlling-the-cache-key.html#cache-key-create-cache-policy) + * in the *Amazon CloudFront Developer Guide*. If you want to send cookies to the origin but not include them in the + * cache key, use an origin request policy. For more information, see [Creating origin request + * policies](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/controlling-origin-requests.html#origin-request-create-origin-request-policy) + * in the *Amazon CloudFront Developer Guide*. A complex type that specifies whether you want CloudFront to forward + * cookies to the origin and, if so, which ones. For more information about forwarding cookies to the origin, see + * [How CloudFront Forwards, Caches, and Logs + * Cookies](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/Cookies.html) in the *Amazon + * CloudFront Developer Guide*. This field is deprecated. We recommend that you use a cache policy or an origin + * request policy instead of this field. If you want to include cookies in the cache key, use a cache policy. For + * more information, see [Creating cache + * policies](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/controlling-the-cache-key.html#cache-key-create-cache-policy) + * in the *Amazon CloudFront Developer Guide*. If you want to send cookies to the origin but not include them in the + * cache key, use an origin request policy. For more information, see [Creating origin request + * policies](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/controlling-origin-requests.html#origin-request-create-origin-request-policy) + * in the *Amazon CloudFront Developer Guide*. A complex type that specifies whether you want CloudFront to forward + * cookies to the origin and, if so, which ones. For more information about forwarding cookies to the origin, see + * [How CloudFront Forwards, Caches, and Logs + * Cookies](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/Cookies.html) in the *Amazon + * CloudFront Developer Guide*. + * + * @return the cookies value. + */ + public Cookies cookies() { + return this.cookies; + } + + /** + * Set the cookies property: This field is deprecated. We recommend that you use a cache policy or an origin request + * policy instead of this field. If you want to include cookies in the cache key, use a cache policy. For more + * information, see [Creating cache + * policies](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/controlling-the-cache-key.html#cache-key-create-cache-policy) + * in the *Amazon CloudFront Developer Guide*. If you want to send cookies to the origin but not include them in the + * cache key, use an origin request policy. For more information, see [Creating origin request + * policies](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/controlling-origin-requests.html#origin-request-create-origin-request-policy) + * in the *Amazon CloudFront Developer Guide*. A complex type that specifies whether you want CloudFront to forward + * cookies to the origin and, if so, which ones. For more information about forwarding cookies to the origin, see + * [How CloudFront Forwards, Caches, and Logs + * Cookies](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/Cookies.html) in the *Amazon + * CloudFront Developer Guide*. This field is deprecated. We recommend that you use a cache policy or an origin + * request policy instead of this field. If you want to include cookies in the cache key, use a cache policy. For + * more information, see [Creating cache + * policies](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/controlling-the-cache-key.html#cache-key-create-cache-policy) + * in the *Amazon CloudFront Developer Guide*. If you want to send cookies to the origin but not include them in the + * cache key, use an origin request policy. For more information, see [Creating origin request + * policies](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/controlling-origin-requests.html#origin-request-create-origin-request-policy) + * in the *Amazon CloudFront Developer Guide*. A complex type that specifies whether you want CloudFront to forward + * cookies to the origin and, if so, which ones. For more information about forwarding cookies to the origin, see + * [How CloudFront Forwards, Caches, and Logs + * Cookies](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/Cookies.html) in the *Amazon + * CloudFront Developer Guide*. + * + * @param cookies the cookies value to set. + * @return the ForwardedValues object itself. + */ + public ForwardedValues withCookies(Cookies cookies) { + this.cookies = cookies; + return this; + } + + /** + * Get the headers property: This field is deprecated. We recommend that you use a cache policy or an origin request + * policy instead of this field. If you want to include headers in the cache key, use a cache policy. For more + * information, see [Creating cache + * policies](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/controlling-the-cache-key.html#cache-key-create-cache-policy) + * in the *Amazon CloudFront Developer Guide*. If you want to send headers to the origin but not include them in the + * cache key, use an origin request policy. For more information, see [Creating origin request + * policies](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/controlling-origin-requests.html#origin-request-create-origin-request-policy) + * in the *Amazon CloudFront Developer Guide*. A complex type that specifies the ``Headers``, if any, that you want + * CloudFront to forward to the origin for this cache behavior (whitelisted headers). For the headers that you + * specify, CloudFront also caches separate versions of a specified object that is based on the header values in + * viewer requests. For more information, see [Caching Content Based on Request + * Headers](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/header-caching.html) in the *Amazon + * CloudFront Developer Guide*. + * + * @return the headers value. + */ + public List headers() { + return this.headers; + } + + /** + * Set the headers property: This field is deprecated. We recommend that you use a cache policy or an origin request + * policy instead of this field. If you want to include headers in the cache key, use a cache policy. For more + * information, see [Creating cache + * policies](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/controlling-the-cache-key.html#cache-key-create-cache-policy) + * in the *Amazon CloudFront Developer Guide*. If you want to send headers to the origin but not include them in the + * cache key, use an origin request policy. For more information, see [Creating origin request + * policies](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/controlling-origin-requests.html#origin-request-create-origin-request-policy) + * in the *Amazon CloudFront Developer Guide*. A complex type that specifies the ``Headers``, if any, that you want + * CloudFront to forward to the origin for this cache behavior (whitelisted headers). For the headers that you + * specify, CloudFront also caches separate versions of a specified object that is based on the header values in + * viewer requests. For more information, see [Caching Content Based on Request + * Headers](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/header-caching.html) in the *Amazon + * CloudFront Developer Guide*. + * + * @param headers the headers value to set. + * @return the ForwardedValues object itself. + */ + public ForwardedValues withHeaders(List headers) { + this.headers = headers; + return this; + } + + /** + * Get the queryString property: This field is deprecated. We recommend that you use a cache policy or an origin + * request policy instead of this field. If you want to include query strings in the cache key, use a cache policy. + * For more information, see [Creating cache + * policies](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/controlling-the-cache-key.html#cache-key-create-cache-policy) + * in the *Amazon CloudFront Developer Guide*. If you want to send query strings to the origin but not include them + * in the cache key, use an origin request policy. For more information, see [Creating origin request + * policies](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/controlling-origin-requests.html#origin-request-create-origin-request-policy) + * in the *Amazon CloudFront Developer Guide*. Indicates whether you want CloudFront to forward query strings to the + * origin that is associated with this cache behavior and cache based on the query string parameters. CloudFront + * behavior depends on the value of ``QueryString`` and on the values that you specify for ``QueryStringCacheKeys``, + * if any: If you specify true for ``QueryString`` and you don't specify any values for ``QueryStringCacheKeys``, + * CloudFront forwards all query string parameters to the origin and caches based on all query string parameters. + * Depending on how many query string parameters and values you have, this can adversely affect performance because + * CloudFront must forward more requests to the origin. If you specify true for ``QueryString`` and you specify one + * or more values for ``QueryStringCacheKeys``, CloudFront forwards all query string parameters to the origin, but + * it only caches based on the query string parameters that you specify. If you specify false for ``QueryString``, + * CloudFront doesn't forward any query string parameters to the origin, and doesn't cache based on query string + * parameters. For more information, see [Configuring CloudFront to Cache Based on Query String + * Parameters](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/QueryStringParameters.html) in the + * *Amazon CloudFront Developer Guide*. + * + * @return the queryString value. + */ + public Boolean queryString() { + return this.queryString; + } + + /** + * Set the queryString property: This field is deprecated. We recommend that you use a cache policy or an origin + * request policy instead of this field. If you want to include query strings in the cache key, use a cache policy. + * For more information, see [Creating cache + * policies](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/controlling-the-cache-key.html#cache-key-create-cache-policy) + * in the *Amazon CloudFront Developer Guide*. If you want to send query strings to the origin but not include them + * in the cache key, use an origin request policy. For more information, see [Creating origin request + * policies](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/controlling-origin-requests.html#origin-request-create-origin-request-policy) + * in the *Amazon CloudFront Developer Guide*. Indicates whether you want CloudFront to forward query strings to the + * origin that is associated with this cache behavior and cache based on the query string parameters. CloudFront + * behavior depends on the value of ``QueryString`` and on the values that you specify for ``QueryStringCacheKeys``, + * if any: If you specify true for ``QueryString`` and you don't specify any values for ``QueryStringCacheKeys``, + * CloudFront forwards all query string parameters to the origin and caches based on all query string parameters. + * Depending on how many query string parameters and values you have, this can adversely affect performance because + * CloudFront must forward more requests to the origin. If you specify true for ``QueryString`` and you specify one + * or more values for ``QueryStringCacheKeys``, CloudFront forwards all query string parameters to the origin, but + * it only caches based on the query string parameters that you specify. If you specify false for ``QueryString``, + * CloudFront doesn't forward any query string parameters to the origin, and doesn't cache based on query string + * parameters. For more information, see [Configuring CloudFront to Cache Based on Query String + * Parameters](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/QueryStringParameters.html) in the + * *Amazon CloudFront Developer Guide*. + * + * @param queryString the queryString value to set. + * @return the ForwardedValues object itself. + */ + public ForwardedValues withQueryString(Boolean queryString) { + this.queryString = queryString; + return this; + } + + /** + * Get the queryStringCacheKeys property: This field is deprecated. We recommend that you use a cache policy or an + * origin request policy instead of this field. If you want to include query strings in the cache key, use a cache + * policy. For more information, see [Creating cache + * policies](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/controlling-the-cache-key.html#cache-key-create-cache-policy) + * in the *Amazon CloudFront Developer Guide*. If you want to send query strings to the origin but not include them + * in the cache key, use an origin request policy. For more information, see [Creating origin request + * policies](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/controlling-origin-requests.html#origin-request-create-origin-request-policy) + * in the *Amazon CloudFront Developer Guide*. A complex type that contains information about the query string + * parameters that you want CloudFront to use for caching for this cache behavior. + * + * @return the queryStringCacheKeys value. + */ + public List queryStringCacheKeys() { + return this.queryStringCacheKeys; + } + + /** + * Set the queryStringCacheKeys property: This field is deprecated. We recommend that you use a cache policy or an + * origin request policy instead of this field. If you want to include query strings in the cache key, use a cache + * policy. For more information, see [Creating cache + * policies](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/controlling-the-cache-key.html#cache-key-create-cache-policy) + * in the *Amazon CloudFront Developer Guide*. If you want to send query strings to the origin but not include them + * in the cache key, use an origin request policy. For more information, see [Creating origin request + * policies](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/controlling-origin-requests.html#origin-request-create-origin-request-policy) + * in the *Amazon CloudFront Developer Guide*. A complex type that contains information about the query string + * parameters that you want CloudFront to use for caching for this cache behavior. + * + * @param queryStringCacheKeys the queryStringCacheKeys value to set. + * @return the ForwardedValues object itself. + */ + public ForwardedValues withQueryStringCacheKeys(List queryStringCacheKeys) { + this.queryStringCacheKeys = queryStringCacheKeys; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (cookies() != null) { + cookies().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("cookies", this.cookies); + jsonWriter.writeArrayField("headers", this.headers, (writer, element) -> writer.writeString(element)); + jsonWriter.writeBooleanField("queryString", this.queryString); + jsonWriter.writeArrayField("queryStringCacheKeys", this.queryStringCacheKeys, + (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ForwardedValues from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ForwardedValues if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the ForwardedValues. + */ + public static ForwardedValues fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ForwardedValues deserializedForwardedValues = new ForwardedValues(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("cookies".equals(fieldName)) { + deserializedForwardedValues.cookies = Cookies.fromJson(reader); + } else if ("headers".equals(fieldName)) { + List headers = reader.readArray(reader1 -> reader1.getString()); + deserializedForwardedValues.headers = headers; + } else if ("queryString".equals(fieldName)) { + deserializedForwardedValues.queryString = reader.getNullable(JsonReader::getBoolean); + } else if ("queryStringCacheKeys".equals(fieldName)) { + List queryStringCacheKeys = reader.readArray(reader1 -> reader1.getString()); + deserializedForwardedValues.queryStringCacheKeys = queryStringCacheKeys; + } else { + reader.skipChildren(); + } + } + + return deserializedForwardedValues; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/FunctionAssociation.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/FunctionAssociation.java new file mode 100644 index 000000000000..84c88fa7ed1f --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/FunctionAssociation.java @@ -0,0 +1,124 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of FunctionAssociation. + */ +@Fluent +public final class FunctionAssociation implements JsonSerializable { + /* + * The event type of the function, either ``viewer-request`` or ``viewer-response``. You cannot use origin-facing + * event types (``origin-request`` and ``origin-response``) with a CloudFront function. + */ + private String eventType; + + /* + * The Amazon Resource Name (ARN) of the function. + */ + private String functionArn; + + /** + * Creates an instance of FunctionAssociation class. + */ + public FunctionAssociation() { + } + + /** + * Get the eventType property: The event type of the function, either ``viewer-request`` or ``viewer-response``. You + * cannot use origin-facing event types (``origin-request`` and ``origin-response``) with a CloudFront function. + * + * @return the eventType value. + */ + public String eventType() { + return this.eventType; + } + + /** + * Set the eventType property: The event type of the function, either ``viewer-request`` or ``viewer-response``. You + * cannot use origin-facing event types (``origin-request`` and ``origin-response``) with a CloudFront function. + * + * @param eventType the eventType value to set. + * @return the FunctionAssociation object itself. + */ + public FunctionAssociation withEventType(String eventType) { + this.eventType = eventType; + return this; + } + + /** + * Get the functionArn property: The Amazon Resource Name (ARN) of the function. + * + * @return the functionArn value. + */ + public String functionArn() { + return this.functionArn; + } + + /** + * Set the functionArn property: The Amazon Resource Name (ARN) of the function. + * + * @param functionArn the functionArn value to set. + * @return the FunctionAssociation object itself. + */ + public FunctionAssociation withFunctionArn(String functionArn) { + this.functionArn = functionArn; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("eventType", this.eventType); + jsonWriter.writeStringField("functionARN", this.functionArn); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of FunctionAssociation from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of FunctionAssociation if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the FunctionAssociation. + */ + public static FunctionAssociation fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + FunctionAssociation deserializedFunctionAssociation = new FunctionAssociation(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("eventType".equals(fieldName)) { + deserializedFunctionAssociation.eventType = reader.getString(); + } else if ("functionARN".equals(fieldName)) { + deserializedFunctionAssociation.functionArn = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedFunctionAssociation; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/GenerateSecretString.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/GenerateSecretString.java new file mode 100644 index 000000000000..e2cc574e3d28 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/GenerateSecretString.java @@ -0,0 +1,379 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of GenerateSecretString. + */ +@Fluent +public final class GenerateSecretString implements JsonSerializable { + /* + * A string of the characters that you don't want in the password. + */ + private String excludeCharacters; + + /* + * Specifies whether to exclude lowercase letters from the password. If you don't include this switch, the password + * can contain lowercase letters. + */ + private Boolean excludeLowercase; + + /* + * Specifies whether to exclude numbers from the password. If you don't include this switch, the password can + * contain numbers. + */ + private Boolean excludeNumbers; + + /* + * Specifies whether to exclude the following punctuation characters from the password: ``! ' # $ % & ' ( ) * + , - + * . / : ; < = > ? @ [ \ ] ^ _ ` { | } ~``. If you don't include this switch, the password can contain punctuation. + */ + private Boolean excludePunctuation; + + /* + * Specifies whether to exclude uppercase letters from the password. If you don't include this switch, the password + * can contain uppercase letters. + */ + private Boolean excludeUppercase; + + /* + * The JSON key name for the key/value pair, where the value is the generated password. This pair is added to the + * JSON structure specified by the ``SecretStringTemplate`` parameter. If you specify this parameter, then you must + * also specify ``SecretStringTemplate``. + */ + private String generateStringKey; + + /* + * Specifies whether to include the space character. If you include this switch, the password can contain space + * characters. + */ + private Boolean includeSpace; + + /* + * The length of the password. If you don't include this parameter, the default length is 32 characters. + */ + private Integer passwordLength; + + /* + * Specifies whether to include at least one upper and lowercase letter, one number, and one punctuation. If you + * don't include this switch, the password contains at least one of every character type. + */ + private Boolean requireEachIncludedType; + + /* + * A template that the generated string must match. When you make a change to this property, a new secret version is + * created. + */ + private String secretStringTemplate; + + /** + * Creates an instance of GenerateSecretString class. + */ + public GenerateSecretString() { + } + + /** + * Get the excludeCharacters property: A string of the characters that you don't want in the password. + * + * @return the excludeCharacters value. + */ + public String excludeCharacters() { + return this.excludeCharacters; + } + + /** + * Set the excludeCharacters property: A string of the characters that you don't want in the password. + * + * @param excludeCharacters the excludeCharacters value to set. + * @return the GenerateSecretString object itself. + */ + public GenerateSecretString withExcludeCharacters(String excludeCharacters) { + this.excludeCharacters = excludeCharacters; + return this; + } + + /** + * Get the excludeLowercase property: Specifies whether to exclude lowercase letters from the password. If you don't + * include this switch, the password can contain lowercase letters. + * + * @return the excludeLowercase value. + */ + public Boolean excludeLowercase() { + return this.excludeLowercase; + } + + /** + * Set the excludeLowercase property: Specifies whether to exclude lowercase letters from the password. If you don't + * include this switch, the password can contain lowercase letters. + * + * @param excludeLowercase the excludeLowercase value to set. + * @return the GenerateSecretString object itself. + */ + public GenerateSecretString withExcludeLowercase(Boolean excludeLowercase) { + this.excludeLowercase = excludeLowercase; + return this; + } + + /** + * Get the excludeNumbers property: Specifies whether to exclude numbers from the password. If you don't include + * this switch, the password can contain numbers. + * + * @return the excludeNumbers value. + */ + public Boolean excludeNumbers() { + return this.excludeNumbers; + } + + /** + * Set the excludeNumbers property: Specifies whether to exclude numbers from the password. If you don't include + * this switch, the password can contain numbers. + * + * @param excludeNumbers the excludeNumbers value to set. + * @return the GenerateSecretString object itself. + */ + public GenerateSecretString withExcludeNumbers(Boolean excludeNumbers) { + this.excludeNumbers = excludeNumbers; + return this; + } + + /** + * Get the excludePunctuation property: Specifies whether to exclude the following punctuation characters from the + * password: ``! ' # $ % & ' ( ) * + , - . / : ; < = > ? @ [ \ ] ^ _ ` { | } ~``. If you don't + * include this switch, the password can contain punctuation. + * + * @return the excludePunctuation value. + */ + public Boolean excludePunctuation() { + return this.excludePunctuation; + } + + /** + * Set the excludePunctuation property: Specifies whether to exclude the following punctuation characters from the + * password: ``! ' # $ % & ' ( ) * + , - . / : ; < = > ? @ [ \ ] ^ _ ` { | } ~``. If you don't + * include this switch, the password can contain punctuation. + * + * @param excludePunctuation the excludePunctuation value to set. + * @return the GenerateSecretString object itself. + */ + public GenerateSecretString withExcludePunctuation(Boolean excludePunctuation) { + this.excludePunctuation = excludePunctuation; + return this; + } + + /** + * Get the excludeUppercase property: Specifies whether to exclude uppercase letters from the password. If you don't + * include this switch, the password can contain uppercase letters. + * + * @return the excludeUppercase value. + */ + public Boolean excludeUppercase() { + return this.excludeUppercase; + } + + /** + * Set the excludeUppercase property: Specifies whether to exclude uppercase letters from the password. If you don't + * include this switch, the password can contain uppercase letters. + * + * @param excludeUppercase the excludeUppercase value to set. + * @return the GenerateSecretString object itself. + */ + public GenerateSecretString withExcludeUppercase(Boolean excludeUppercase) { + this.excludeUppercase = excludeUppercase; + return this; + } + + /** + * Get the generateStringKey property: The JSON key name for the key/value pair, where the value is the generated + * password. This pair is added to the JSON structure specified by the ``SecretStringTemplate`` parameter. If you + * specify this parameter, then you must also specify ``SecretStringTemplate``. + * + * @return the generateStringKey value. + */ + public String generateStringKey() { + return this.generateStringKey; + } + + /** + * Set the generateStringKey property: The JSON key name for the key/value pair, where the value is the generated + * password. This pair is added to the JSON structure specified by the ``SecretStringTemplate`` parameter. If you + * specify this parameter, then you must also specify ``SecretStringTemplate``. + * + * @param generateStringKey the generateStringKey value to set. + * @return the GenerateSecretString object itself. + */ + public GenerateSecretString withGenerateStringKey(String generateStringKey) { + this.generateStringKey = generateStringKey; + return this; + } + + /** + * Get the includeSpace property: Specifies whether to include the space character. If you include this switch, the + * password can contain space characters. + * + * @return the includeSpace value. + */ + public Boolean includeSpace() { + return this.includeSpace; + } + + /** + * Set the includeSpace property: Specifies whether to include the space character. If you include this switch, the + * password can contain space characters. + * + * @param includeSpace the includeSpace value to set. + * @return the GenerateSecretString object itself. + */ + public GenerateSecretString withIncludeSpace(Boolean includeSpace) { + this.includeSpace = includeSpace; + return this; + } + + /** + * Get the passwordLength property: The length of the password. If you don't include this parameter, the default + * length is 32 characters. + * + * @return the passwordLength value. + */ + public Integer passwordLength() { + return this.passwordLength; + } + + /** + * Set the passwordLength property: The length of the password. If you don't include this parameter, the default + * length is 32 characters. + * + * @param passwordLength the passwordLength value to set. + * @return the GenerateSecretString object itself. + */ + public GenerateSecretString withPasswordLength(Integer passwordLength) { + this.passwordLength = passwordLength; + return this; + } + + /** + * Get the requireEachIncludedType property: Specifies whether to include at least one upper and lowercase letter, + * one number, and one punctuation. If you don't include this switch, the password contains at least one of every + * character type. + * + * @return the requireEachIncludedType value. + */ + public Boolean requireEachIncludedType() { + return this.requireEachIncludedType; + } + + /** + * Set the requireEachIncludedType property: Specifies whether to include at least one upper and lowercase letter, + * one number, and one punctuation. If you don't include this switch, the password contains at least one of every + * character type. + * + * @param requireEachIncludedType the requireEachIncludedType value to set. + * @return the GenerateSecretString object itself. + */ + public GenerateSecretString withRequireEachIncludedType(Boolean requireEachIncludedType) { + this.requireEachIncludedType = requireEachIncludedType; + return this; + } + + /** + * Get the secretStringTemplate property: A template that the generated string must match. When you make a change to + * this property, a new secret version is created. + * + * @return the secretStringTemplate value. + */ + public String secretStringTemplate() { + return this.secretStringTemplate; + } + + /** + * Set the secretStringTemplate property: A template that the generated string must match. When you make a change to + * this property, a new secret version is created. + * + * @param secretStringTemplate the secretStringTemplate value to set. + * @return the GenerateSecretString object itself. + */ + public GenerateSecretString withSecretStringTemplate(String secretStringTemplate) { + this.secretStringTemplate = secretStringTemplate; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("excludeCharacters", this.excludeCharacters); + jsonWriter.writeBooleanField("excludeLowercase", this.excludeLowercase); + jsonWriter.writeBooleanField("excludeNumbers", this.excludeNumbers); + jsonWriter.writeBooleanField("excludePunctuation", this.excludePunctuation); + jsonWriter.writeBooleanField("excludeUppercase", this.excludeUppercase); + jsonWriter.writeStringField("generateStringKey", this.generateStringKey); + jsonWriter.writeBooleanField("includeSpace", this.includeSpace); + jsonWriter.writeNumberField("passwordLength", this.passwordLength); + jsonWriter.writeBooleanField("requireEachIncludedType", this.requireEachIncludedType); + jsonWriter.writeStringField("secretStringTemplate", this.secretStringTemplate); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of GenerateSecretString from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of GenerateSecretString if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the GenerateSecretString. + */ + public static GenerateSecretString fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + GenerateSecretString deserializedGenerateSecretString = new GenerateSecretString(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("excludeCharacters".equals(fieldName)) { + deserializedGenerateSecretString.excludeCharacters = reader.getString(); + } else if ("excludeLowercase".equals(fieldName)) { + deserializedGenerateSecretString.excludeLowercase = reader.getNullable(JsonReader::getBoolean); + } else if ("excludeNumbers".equals(fieldName)) { + deserializedGenerateSecretString.excludeNumbers = reader.getNullable(JsonReader::getBoolean); + } else if ("excludePunctuation".equals(fieldName)) { + deserializedGenerateSecretString.excludePunctuation = reader.getNullable(JsonReader::getBoolean); + } else if ("excludeUppercase".equals(fieldName)) { + deserializedGenerateSecretString.excludeUppercase = reader.getNullable(JsonReader::getBoolean); + } else if ("generateStringKey".equals(fieldName)) { + deserializedGenerateSecretString.generateStringKey = reader.getString(); + } else if ("includeSpace".equals(fieldName)) { + deserializedGenerateSecretString.includeSpace = reader.getNullable(JsonReader::getBoolean); + } else if ("passwordLength".equals(fieldName)) { + deserializedGenerateSecretString.passwordLength = reader.getNullable(JsonReader::getInt); + } else if ("requireEachIncludedType".equals(fieldName)) { + deserializedGenerateSecretString.requireEachIncludedType + = reader.getNullable(JsonReader::getBoolean); + } else if ("secretStringTemplate".equals(fieldName)) { + deserializedGenerateSecretString.secretStringTemplate = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedGenerateSecretString; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/GeoLocation.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/GeoLocation.java new file mode 100644 index 000000000000..e29e3547be7a --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/GeoLocation.java @@ -0,0 +1,191 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of GeoLocation. + */ +@Fluent +public final class GeoLocation implements JsonSerializable { + /* + *

The two-letter code for the continent.

Amazon Route 53 supports the following continent codes:

    + *
  • AF: Africa

  • AN: Antarctica

  • AS: Asia

  • + *
  • EU: Europe

  • OC: Oceania

  • NA: North America

    + *
  • SA: South America

Constraint: Specifying ContinentCode with + * either CountryCode or SubdivisionCode returns an InvalidInput error.

+ */ + private String continentCode; + + /* + *

For geolocation resource record sets, the two-letter code for a country.

Amazon Route 53 uses the + * two-letter country codes that are specified in ISO + * standard 3166-1 alpha-2.

Route 53 also supports the country code UA for Ukraine.

+ */ + private String countryCode; + + /* + *

For geolocation resource record sets, the two-letter code for a state of the United States. Route 53 doesn't + * support any other values for SubdivisionCode. For a list of state abbreviations, see Appendix B: Two–Letter State and Possession Abbreviations on + * the United States Postal Service website.

If you specify subdivisioncode, you must also + * specify US for CountryCode.

+ */ + private String subdivisionCode; + + /** + * Creates an instance of GeoLocation class. + */ + public GeoLocation() { + } + + /** + * Get the continentCode property: <p>The two-letter code for the continent.</p> <p>Amazon Route + * 53 supports the following continent codes:</p> <ul> <li> <p> <b>AF</b>: + * Africa</p> </li> <li> <p> <b>AN</b>: Antarctica</p> </li> + * <li> <p> <b>AS</b>: Asia</p> </li> <li> <p> + * <b>EU</b>: Europe</p> </li> <li> <p> <b>OC</b>: Oceania</p> + * </li> <li> <p> <b>NA</b>: North America</p> </li> <li> <p> + * <b>SA</b>: South America</p> </li> </ul> <p>Constraint: Specifying + * <code>ContinentCode</code> with either <code>CountryCode</code> or + * <code>SubdivisionCode</code> returns an <code>InvalidInput</code> error.</p>. + * + * @return the continentCode value. + */ + public String continentCode() { + return this.continentCode; + } + + /** + * Set the continentCode property: <p>The two-letter code for the continent.</p> <p>Amazon Route + * 53 supports the following continent codes:</p> <ul> <li> <p> <b>AF</b>: + * Africa</p> </li> <li> <p> <b>AN</b>: Antarctica</p> </li> + * <li> <p> <b>AS</b>: Asia</p> </li> <li> <p> + * <b>EU</b>: Europe</p> </li> <li> <p> <b>OC</b>: Oceania</p> + * </li> <li> <p> <b>NA</b>: North America</p> </li> <li> <p> + * <b>SA</b>: South America</p> </li> </ul> <p>Constraint: Specifying + * <code>ContinentCode</code> with either <code>CountryCode</code> or + * <code>SubdivisionCode</code> returns an <code>InvalidInput</code> error.</p>. + * + * @param continentCode the continentCode value to set. + * @return the GeoLocation object itself. + */ + public GeoLocation withContinentCode(String continentCode) { + this.continentCode = continentCode; + return this; + } + + /** + * Get the countryCode property: <p>For geolocation resource record sets, the two-letter code for a + * country.</p> <p>Amazon Route 53 uses the two-letter country codes that are specified in <a + * href='https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2'>ISO standard 3166-1 alpha-2</a>.</p> + * <p>Route 53 also supports the country code <b>UA</b> for Ukraine.</p>. + * + * @return the countryCode value. + */ + public String countryCode() { + return this.countryCode; + } + + /** + * Set the countryCode property: <p>For geolocation resource record sets, the two-letter code for a + * country.</p> <p>Amazon Route 53 uses the two-letter country codes that are specified in <a + * href='https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2'>ISO standard 3166-1 alpha-2</a>.</p> + * <p>Route 53 also supports the country code <b>UA</b> for Ukraine.</p>. + * + * @param countryCode the countryCode value to set. + * @return the GeoLocation object itself. + */ + public GeoLocation withCountryCode(String countryCode) { + this.countryCode = countryCode; + return this; + } + + /** + * Get the subdivisionCode property: <p>For geolocation resource record sets, the two-letter code for a state + * of the United States. Route 53 doesn't support any other values for <code>SubdivisionCode</code>. For + * a list of state abbreviations, see <a href='https://pe.usps.com/text/pub28/28apb.htm'>Appendix B: + * Two–Letter State and Possession Abbreviations</a> on the United States Postal Service website. </p> + * <p>If you specify <code>subdivisioncode</code>, you must also specify + * <code>US</code> for <code>CountryCode</code>. </p>. + * + * @return the subdivisionCode value. + */ + public String subdivisionCode() { + return this.subdivisionCode; + } + + /** + * Set the subdivisionCode property: <p>For geolocation resource record sets, the two-letter code for a state + * of the United States. Route 53 doesn't support any other values for <code>SubdivisionCode</code>. For + * a list of state abbreviations, see <a href='https://pe.usps.com/text/pub28/28apb.htm'>Appendix B: + * Two–Letter State and Possession Abbreviations</a> on the United States Postal Service website. </p> + * <p>If you specify <code>subdivisioncode</code>, you must also specify + * <code>US</code> for <code>CountryCode</code>. </p>. + * + * @param subdivisionCode the subdivisionCode value to set. + * @return the GeoLocation object itself. + */ + public GeoLocation withSubdivisionCode(String subdivisionCode) { + this.subdivisionCode = subdivisionCode; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("continentCode", this.continentCode); + jsonWriter.writeStringField("countryCode", this.countryCode); + jsonWriter.writeStringField("subdivisionCode", this.subdivisionCode); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of GeoLocation from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of GeoLocation if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the GeoLocation. + */ + public static GeoLocation fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + GeoLocation deserializedGeoLocation = new GeoLocation(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("continentCode".equals(fieldName)) { + deserializedGeoLocation.continentCode = reader.getString(); + } else if ("countryCode".equals(fieldName)) { + deserializedGeoLocation.countryCode = reader.getString(); + } else if ("subdivisionCode".equals(fieldName)) { + deserializedGeoLocation.subdivisionCode = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedGeoLocation; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/GeoProximityLocation.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/GeoProximityLocation.java new file mode 100644 index 000000000000..edb2fb001692 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/GeoProximityLocation.java @@ -0,0 +1,225 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of GeoProximityLocation. + */ +@Fluent +public final class GeoProximityLocation implements JsonSerializable { + /* + *

The Amazon Web Services Region the resource you are directing DNS traffic to, is in.

+ */ + private String awsRegion; + + /* + *

The bias increases or decreases the size of the geographic region from which Route 53 routes traffic to a + * resource.

To use Bias to change the size of the geographic region, specify the applicable + * value for the bias:

  • To expand the size of the geographic region from which Route 53 routes + * traffic to a resource, specify a positive integer from 1 to 99 for the bias. Route 53 shrinks the size of + * adjacent regions.

  • To shrink the size of the geographic region from which Route 53 routes + * traffic to a resource, specify a negative bias of -1 to -99. Route 53 expands the size of adjacent regions.

    + *
+ */ + private Integer bias; + + /* + *

Contains the longitude and latitude for a geographic region.

+ */ + private Coordinates coordinates; + + /* + *

Specifies an Amazon Web Services Local Zone Group.

A local Zone Group is usually the Local Zone code + * without the ending character. For example, if the Local Zone is us-east-1-bue-1a the Local Zone + * Group is us-east-1-bue-1.

You can identify the Local Zones Group for a specific Local Zone by + * using the describe- + * availability-zones CLI command:

This command returns: 'GroupName': 'us-west-2-den-1', + * specifying that the Local Zone us-west-2-den-1a belongs to the Local Zone Group + * us-west-2-den-1.

+ */ + private String localZoneGroup; + + /** + * Creates an instance of GeoProximityLocation class. + */ + public GeoProximityLocation() { + } + + /** + * Get the awsRegion property: <p> The Amazon Web Services Region the resource you are directing DNS traffic + * to, is in. </p>. + * + * @return the awsRegion value. + */ + public String awsRegion() { + return this.awsRegion; + } + + /** + * Set the awsRegion property: <p> The Amazon Web Services Region the resource you are directing DNS traffic + * to, is in. </p>. + * + * @param awsRegion the awsRegion value to set. + * @return the GeoProximityLocation object itself. + */ + public GeoProximityLocation withAwsRegion(String awsRegion) { + this.awsRegion = awsRegion; + return this; + } + + /** + * Get the bias property: <p> The bias increases or decreases the size of the geographic region from which + * Route 53 routes traffic to a resource. </p> <p>To use <code>Bias</code> to change the + * size of the geographic region, specify the applicable value for the bias:</p> <ul> <li> + * <p>To expand the size of the geographic region from which Route 53 routes traffic to a resource, specify a + * positive integer from 1 to 99 for the bias. Route 53 shrinks the size of adjacent regions. </p> </li> + * <li> <p>To shrink the size of the geographic region from which Route 53 routes traffic to a resource, + * specify a negative bias of -1 to -99. Route 53 expands the size of adjacent regions. </p> </li> + * </ul>. + * + * @return the bias value. + */ + public Integer bias() { + return this.bias; + } + + /** + * Set the bias property: <p> The bias increases or decreases the size of the geographic region from which + * Route 53 routes traffic to a resource. </p> <p>To use <code>Bias</code> to change the + * size of the geographic region, specify the applicable value for the bias:</p> <ul> <li> + * <p>To expand the size of the geographic region from which Route 53 routes traffic to a resource, specify a + * positive integer from 1 to 99 for the bias. Route 53 shrinks the size of adjacent regions. </p> </li> + * <li> <p>To shrink the size of the geographic region from which Route 53 routes traffic to a resource, + * specify a negative bias of -1 to -99. Route 53 expands the size of adjacent regions. </p> </li> + * </ul>. + * + * @param bias the bias value to set. + * @return the GeoProximityLocation object itself. + */ + public GeoProximityLocation withBias(Integer bias) { + this.bias = bias; + return this; + } + + /** + * Get the coordinates property: <p> Contains the longitude and latitude for a geographic region. </p>. + * + * @return the coordinates value. + */ + public Coordinates coordinates() { + return this.coordinates; + } + + /** + * Set the coordinates property: <p> Contains the longitude and latitude for a geographic region. </p>. + * + * @param coordinates the coordinates value to set. + * @return the GeoProximityLocation object itself. + */ + public GeoProximityLocation withCoordinates(Coordinates coordinates) { + this.coordinates = coordinates; + return this; + } + + /** + * Get the localZoneGroup property: <p> Specifies an Amazon Web Services Local Zone Group. </p> + * <p>A local Zone Group is usually the Local Zone code without the ending character. For example, if the + * Local Zone is <code>us-east-1-bue-1a</code> the Local Zone Group is + * <code>us-east-1-bue-1</code>.</p> <p>You can identify the Local Zones Group for a + * specific Local Zone by using the <a + * href='https://docs.aws.amazon.com/cli/latest/reference/ec2/describe-availability-zones.html'>describe-availability-zones</a> + * CLI command:</p> <p>This command returns: <code>'GroupName': 'us-west-2-den-1'</code>, + * specifying that the Local Zone <code>us-west-2-den-1a</code> belongs to the Local Zone Group + * <code>us-west-2-den-1</code>.</p>. + * + * @return the localZoneGroup value. + */ + public String localZoneGroup() { + return this.localZoneGroup; + } + + /** + * Set the localZoneGroup property: <p> Specifies an Amazon Web Services Local Zone Group. </p> + * <p>A local Zone Group is usually the Local Zone code without the ending character. For example, if the + * Local Zone is <code>us-east-1-bue-1a</code> the Local Zone Group is + * <code>us-east-1-bue-1</code>.</p> <p>You can identify the Local Zones Group for a + * specific Local Zone by using the <a + * href='https://docs.aws.amazon.com/cli/latest/reference/ec2/describe-availability-zones.html'>describe-availability-zones</a> + * CLI command:</p> <p>This command returns: <code>'GroupName': 'us-west-2-den-1'</code>, + * specifying that the Local Zone <code>us-west-2-den-1a</code> belongs to the Local Zone Group + * <code>us-west-2-den-1</code>.</p>. + * + * @param localZoneGroup the localZoneGroup value to set. + * @return the GeoProximityLocation object itself. + */ + public GeoProximityLocation withLocalZoneGroup(String localZoneGroup) { + this.localZoneGroup = localZoneGroup; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (coordinates() != null) { + coordinates().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("awsRegion", this.awsRegion); + jsonWriter.writeNumberField("bias", this.bias); + jsonWriter.writeJsonField("coordinates", this.coordinates); + jsonWriter.writeStringField("localZoneGroup", this.localZoneGroup); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of GeoProximityLocation from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of GeoProximityLocation if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the GeoProximityLocation. + */ + public static GeoProximityLocation fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + GeoProximityLocation deserializedGeoProximityLocation = new GeoProximityLocation(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("awsRegion".equals(fieldName)) { + deserializedGeoProximityLocation.awsRegion = reader.getString(); + } else if ("bias".equals(fieldName)) { + deserializedGeoProximityLocation.bias = reader.getNullable(JsonReader::getInt); + } else if ("coordinates".equals(fieldName)) { + deserializedGeoProximityLocation.coordinates = Coordinates.fromJson(reader); + } else if ("localZoneGroup".equals(fieldName)) { + deserializedGeoProximityLocation.localZoneGroup = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedGeoProximityLocation; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/GeoRestriction.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/GeoRestriction.java new file mode 100644 index 000000000000..b9fb97d5704e --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/GeoRestriction.java @@ -0,0 +1,128 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Definition of GeoRestriction. + */ +@Fluent +public final class GeoRestriction implements JsonSerializable { + /* + * A complex type that contains a ``Location`` element for each country in which you want CloudFront either to + * distribute your content or not distribute your content. + */ + private List locations; + + /* + * The method that you want to use to restrict distribution of your content by country. + */ + private String restrictionType; + + /** + * Creates an instance of GeoRestriction class. + */ + public GeoRestriction() { + } + + /** + * Get the locations property: A complex type that contains a ``Location`` element for each country in which you + * want CloudFront either to distribute your content or not distribute your content. + * + * @return the locations value. + */ + public List locations() { + return this.locations; + } + + /** + * Set the locations property: A complex type that contains a ``Location`` element for each country in which you + * want CloudFront either to distribute your content or not distribute your content. + * + * @param locations the locations value to set. + * @return the GeoRestriction object itself. + */ + public GeoRestriction withLocations(List locations) { + this.locations = locations; + return this; + } + + /** + * Get the restrictionType property: The method that you want to use to restrict distribution of your content by + * country. + * + * @return the restrictionType value. + */ + public String restrictionType() { + return this.restrictionType; + } + + /** + * Set the restrictionType property: The method that you want to use to restrict distribution of your content by + * country. + * + * @param restrictionType the restrictionType value to set. + * @return the GeoRestriction object itself. + */ + public GeoRestriction withRestrictionType(String restrictionType) { + this.restrictionType = restrictionType; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("locations", this.locations, (writer, element) -> writer.writeString(element)); + jsonWriter.writeStringField("restrictionType", this.restrictionType); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of GeoRestriction from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of GeoRestriction if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the GeoRestriction. + */ + public static GeoRestriction fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + GeoRestriction deserializedGeoRestriction = new GeoRestriction(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("locations".equals(fieldName)) { + List locations = reader.readArray(reader1 -> reader1.getString()); + deserializedGeoRestriction.locations = locations; + } else if ("restrictionType".equals(fieldName)) { + deserializedGeoRestriction.restrictionType = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedGeoRestriction; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/GitSubmodulesConfig.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/GitSubmodulesConfig.java new file mode 100644 index 000000000000..403974bcbc87 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/GitSubmodulesConfig.java @@ -0,0 +1,95 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of GitSubmodulesConfig. + */ +@Fluent +public final class GitSubmodulesConfig implements JsonSerializable { + /* + *

Set to true to fetch Git submodules for your CodeBuild build project.

+ */ + private Boolean fetchSubmodules; + + /** + * Creates an instance of GitSubmodulesConfig class. + */ + public GitSubmodulesConfig() { + } + + /** + * Get the fetchSubmodules property: <p> Set to true to fetch Git submodules for your CodeBuild build project. + * </p>. + * + * @return the fetchSubmodules value. + */ + public Boolean fetchSubmodules() { + return this.fetchSubmodules; + } + + /** + * Set the fetchSubmodules property: <p> Set to true to fetch Git submodules for your CodeBuild build project. + * </p>. + * + * @param fetchSubmodules the fetchSubmodules value to set. + * @return the GitSubmodulesConfig object itself. + */ + public GitSubmodulesConfig withFetchSubmodules(Boolean fetchSubmodules) { + this.fetchSubmodules = fetchSubmodules; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeBooleanField("fetchSubmodules", this.fetchSubmodules); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of GitSubmodulesConfig from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of GitSubmodulesConfig if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the GitSubmodulesConfig. + */ + public static GitSubmodulesConfig fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + GitSubmodulesConfig deserializedGitSubmodulesConfig = new GitSubmodulesConfig(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("fetchSubmodules".equals(fieldName)) { + deserializedGitSubmodulesConfig.fetchSubmodules = reader.getNullable(JsonReader::getBoolean); + } else { + reader.skipChildren(); + } + } + + return deserializedGitSubmodulesConfig; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/GlobalSecondaryIndex.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/GlobalSecondaryIndex.java new file mode 100644 index 000000000000..948f7ab239dc --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/GlobalSecondaryIndex.java @@ -0,0 +1,270 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Definition of GlobalSecondaryIndex. + */ +@Fluent +public final class GlobalSecondaryIndex implements JsonSerializable { + /* + * The settings used to enable or disable CloudWatch Contributor Insights for the specified global secondary index. + * The settings used to enable or disable CloudWatch Contributor Insights. + */ + private ContributorInsightsSpecification contributorInsightsSpecification; + + /* + * The name of the global secondary index. The name must be unique among all other indexes on this table. + */ + private String indexName; + + /* + * The complete key schema for a global secondary index, which consists of one or more pairs of attribute names and + * key types: + ``HASH`` - partition key + ``RANGE`` - sort key The partition key of an item is also known as its + * *hash attribute*. The term 'hash attribute' derives from DynamoDB's usage of an internal hash function to evenly + * distribute data items across partitions, based on their partition key values. The sort key of an item is also + * known as its *range attribute*. The term 'range attribute' derives from the way DynamoDB stores items with the + * same partition key physically close together, in sorted order by the sort key value. + */ + private List keySchema; + + /* + * Represents attributes that are copied (projected) from the table into the global secondary index. These are in + * addition to the primary key attributes and index key attributes, which are automatically projected. Represents + * attributes that are copied (projected) from the table into an index. These are in addition to the primary key + * attributes and index key attributes, which are automatically projected. + */ + private Projection projection; + + /* + * Represents the provisioned throughput settings for the specified global secondary index. For current minimum and + * maximum provisioned throughput values, see [Service, Account, and Table + * Quotas](https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Limits.html) in the *Amazon DynamoDB + * Developer Guide*. Throughput for the specified table, which consists of values for ``ReadCapacityUnits`` and + * ``WriteCapacityUnits``. For more information about the contents of a provisioned throughput structure, see [Table + * ProvisionedThroughput](https://docs.aws.amazon.com/amazondynamodb/latest/APIReference/API_ProvisionedThroughput. + * html). + */ + private ProvisionedThroughput provisionedThroughput; + + /** + * Creates an instance of GlobalSecondaryIndex class. + */ + public GlobalSecondaryIndex() { + } + + /** + * Get the contributorInsightsSpecification property: The settings used to enable or disable CloudWatch Contributor + * Insights for the specified global secondary index. The settings used to enable or disable CloudWatch Contributor + * Insights. + * + * @return the contributorInsightsSpecification value. + */ + public ContributorInsightsSpecification contributorInsightsSpecification() { + return this.contributorInsightsSpecification; + } + + /** + * Set the contributorInsightsSpecification property: The settings used to enable or disable CloudWatch Contributor + * Insights for the specified global secondary index. The settings used to enable or disable CloudWatch Contributor + * Insights. + * + * @param contributorInsightsSpecification the contributorInsightsSpecification value to set. + * @return the GlobalSecondaryIndex object itself. + */ + public GlobalSecondaryIndex + withContributorInsightsSpecification(ContributorInsightsSpecification contributorInsightsSpecification) { + this.contributorInsightsSpecification = contributorInsightsSpecification; + return this; + } + + /** + * Get the indexName property: The name of the global secondary index. The name must be unique among all other + * indexes on this table. + * + * @return the indexName value. + */ + public String indexName() { + return this.indexName; + } + + /** + * Set the indexName property: The name of the global secondary index. The name must be unique among all other + * indexes on this table. + * + * @param indexName the indexName value to set. + * @return the GlobalSecondaryIndex object itself. + */ + public GlobalSecondaryIndex withIndexName(String indexName) { + this.indexName = indexName; + return this; + } + + /** + * Get the keySchema property: The complete key schema for a global secondary index, which consists of one or more + * pairs of attribute names and key types: + ``HASH`` - partition key + ``RANGE`` - sort key The partition key of an + * item is also known as its *hash attribute*. The term 'hash attribute' derives from DynamoDB's usage of an + * internal hash function to evenly distribute data items across partitions, based on their partition key values. + * The sort key of an item is also known as its *range attribute*. The term 'range attribute' derives from the way + * DynamoDB stores items with the same partition key physically close together, in sorted order by the sort key + * value. + * + * @return the keySchema value. + */ + public List keySchema() { + return this.keySchema; + } + + /** + * Set the keySchema property: The complete key schema for a global secondary index, which consists of one or more + * pairs of attribute names and key types: + ``HASH`` - partition key + ``RANGE`` - sort key The partition key of an + * item is also known as its *hash attribute*. The term 'hash attribute' derives from DynamoDB's usage of an + * internal hash function to evenly distribute data items across partitions, based on their partition key values. + * The sort key of an item is also known as its *range attribute*. The term 'range attribute' derives from the way + * DynamoDB stores items with the same partition key physically close together, in sorted order by the sort key + * value. + * + * @param keySchema the keySchema value to set. + * @return the GlobalSecondaryIndex object itself. + */ + public GlobalSecondaryIndex withKeySchema(List keySchema) { + this.keySchema = keySchema; + return this; + } + + /** + * Get the projection property: Represents attributes that are copied (projected) from the table into the global + * secondary index. These are in addition to the primary key attributes and index key attributes, which are + * automatically projected. Represents attributes that are copied (projected) from the table into an index. These + * are in addition to the primary key attributes and index key attributes, which are automatically projected. + * + * @return the projection value. + */ + public Projection projection() { + return this.projection; + } + + /** + * Set the projection property: Represents attributes that are copied (projected) from the table into the global + * secondary index. These are in addition to the primary key attributes and index key attributes, which are + * automatically projected. Represents attributes that are copied (projected) from the table into an index. These + * are in addition to the primary key attributes and index key attributes, which are automatically projected. + * + * @param projection the projection value to set. + * @return the GlobalSecondaryIndex object itself. + */ + public GlobalSecondaryIndex withProjection(Projection projection) { + this.projection = projection; + return this; + } + + /** + * Get the provisionedThroughput property: Represents the provisioned throughput settings for the specified global + * secondary index. For current minimum and maximum provisioned throughput values, see [Service, Account, and Table + * Quotas](https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Limits.html) in the *Amazon DynamoDB + * Developer Guide*. Throughput for the specified table, which consists of values for ``ReadCapacityUnits`` and + * ``WriteCapacityUnits``. For more information about the contents of a provisioned throughput structure, see [Table + * ProvisionedThroughput](https://docs.aws.amazon.com/amazondynamodb/latest/APIReference/API_ProvisionedThroughput.html). + * + * @return the provisionedThroughput value. + */ + public ProvisionedThroughput provisionedThroughput() { + return this.provisionedThroughput; + } + + /** + * Set the provisionedThroughput property: Represents the provisioned throughput settings for the specified global + * secondary index. For current minimum and maximum provisioned throughput values, see [Service, Account, and Table + * Quotas](https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Limits.html) in the *Amazon DynamoDB + * Developer Guide*. Throughput for the specified table, which consists of values for ``ReadCapacityUnits`` and + * ``WriteCapacityUnits``. For more information about the contents of a provisioned throughput structure, see [Table + * ProvisionedThroughput](https://docs.aws.amazon.com/amazondynamodb/latest/APIReference/API_ProvisionedThroughput.html). + * + * @param provisionedThroughput the provisionedThroughput value to set. + * @return the GlobalSecondaryIndex object itself. + */ + public GlobalSecondaryIndex withProvisionedThroughput(ProvisionedThroughput provisionedThroughput) { + this.provisionedThroughput = provisionedThroughput; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (contributorInsightsSpecification() != null) { + contributorInsightsSpecification().validate(); + } + if (keySchema() != null) { + keySchema().forEach(e -> e.validate()); + } + if (projection() != null) { + projection().validate(); + } + if (provisionedThroughput() != null) { + provisionedThroughput().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("contributorInsightsSpecification", this.contributorInsightsSpecification); + jsonWriter.writeStringField("indexName", this.indexName); + jsonWriter.writeArrayField("keySchema", this.keySchema, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeJsonField("projection", this.projection); + jsonWriter.writeJsonField("provisionedThroughput", this.provisionedThroughput); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of GlobalSecondaryIndex from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of GlobalSecondaryIndex if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the GlobalSecondaryIndex. + */ + public static GlobalSecondaryIndex fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + GlobalSecondaryIndex deserializedGlobalSecondaryIndex = new GlobalSecondaryIndex(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("contributorInsightsSpecification".equals(fieldName)) { + deserializedGlobalSecondaryIndex.contributorInsightsSpecification + = ContributorInsightsSpecification.fromJson(reader); + } else if ("indexName".equals(fieldName)) { + deserializedGlobalSecondaryIndex.indexName = reader.getString(); + } else if ("keySchema".equals(fieldName)) { + List keySchema = reader.readArray(reader1 -> KeySchema.fromJson(reader1)); + deserializedGlobalSecondaryIndex.keySchema = keySchema; + } else if ("projection".equals(fieldName)) { + deserializedGlobalSecondaryIndex.projection = Projection.fromJson(reader); + } else if ("provisionedThroughput".equals(fieldName)) { + deserializedGlobalSecondaryIndex.provisionedThroughput = ProvisionedThroughput.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedGlobalSecondaryIndex; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/GraphQLApiIntrospectionConfig.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/GraphQLApiIntrospectionConfig.java new file mode 100644 index 000000000000..f8b5b8147904 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/GraphQLApiIntrospectionConfig.java @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * GraphQLApiIntrospectionConfig enum. + */ +public final class GraphQLApiIntrospectionConfig extends ExpandableStringEnum { + /** + * Static value DISABLED for GraphQLApiIntrospectionConfig. + */ + public static final GraphQLApiIntrospectionConfig DISABLED = fromString("DISABLED"); + + /** + * Static value ENABLED for GraphQLApiIntrospectionConfig. + */ + public static final GraphQLApiIntrospectionConfig ENABLED = fromString("ENABLED"); + + /** + * Creates a new instance of GraphQLApiIntrospectionConfig value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public GraphQLApiIntrospectionConfig() { + } + + /** + * Creates or finds a GraphQLApiIntrospectionConfig from its string representation. + * + * @param name a name to look for. + * @return the corresponding GraphQLApiIntrospectionConfig. + */ + public static GraphQLApiIntrospectionConfig fromString(String name) { + return fromString(name, GraphQLApiIntrospectionConfig.class); + } + + /** + * Gets known GraphQLApiIntrospectionConfig values. + * + * @return known GraphQLApiIntrospectionConfig values. + */ + public static Collection values() { + return values(GraphQLApiIntrospectionConfig.class); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/GraphQLApiIntrospectionConfigEnumValue.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/GraphQLApiIntrospectionConfigEnumValue.java new file mode 100644 index 000000000000..1b024765967b --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/GraphQLApiIntrospectionConfigEnumValue.java @@ -0,0 +1,96 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of GraphQLApiIntrospectionConfigEnumValue. + */ +@Fluent +public final class GraphQLApiIntrospectionConfigEnumValue + implements JsonSerializable { + /* + * Property value + */ + private GraphQLApiIntrospectionConfig value; + + /** + * Creates an instance of GraphQLApiIntrospectionConfigEnumValue class. + */ + public GraphQLApiIntrospectionConfigEnumValue() { + } + + /** + * Get the value property: Property value. + * + * @return the value value. + */ + public GraphQLApiIntrospectionConfig value() { + return this.value; + } + + /** + * Set the value property: Property value. + * + * @param value the value value to set. + * @return the GraphQLApiIntrospectionConfigEnumValue object itself. + */ + public GraphQLApiIntrospectionConfigEnumValue withValue(GraphQLApiIntrospectionConfig value) { + this.value = value; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("value", this.value == null ? null : this.value.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of GraphQLApiIntrospectionConfigEnumValue from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of GraphQLApiIntrospectionConfigEnumValue if the JsonReader was pointing to an instance of + * it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the GraphQLApiIntrospectionConfigEnumValue. + */ + public static GraphQLApiIntrospectionConfigEnumValue fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + GraphQLApiIntrospectionConfigEnumValue deserializedGraphQLApiIntrospectionConfigEnumValue + = new GraphQLApiIntrospectionConfigEnumValue(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + deserializedGraphQLApiIntrospectionConfigEnumValue.value + = GraphQLApiIntrospectionConfig.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedGraphQLApiIntrospectionConfigEnumValue; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/GraphQLApiType.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/GraphQLApiType.java new file mode 100644 index 000000000000..b7c787e445f9 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/GraphQLApiType.java @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * GraphQLApiType enum. + */ +public final class GraphQLApiType extends ExpandableStringEnum { + /** + * Static value GRAPHQL for GraphQLApiType. + */ + public static final GraphQLApiType GRAPHQL = fromString("GRAPHQL"); + + /** + * Static value MERGED for GraphQLApiType. + */ + public static final GraphQLApiType MERGED = fromString("MERGED"); + + /** + * Creates a new instance of GraphQLApiType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public GraphQLApiType() { + } + + /** + * Creates or finds a GraphQLApiType from its string representation. + * + * @param name a name to look for. + * @return the corresponding GraphQLApiType. + */ + public static GraphQLApiType fromString(String name) { + return fromString(name, GraphQLApiType.class); + } + + /** + * Gets known GraphQLApiType values. + * + * @return known GraphQLApiType values. + */ + public static Collection values() { + return values(GraphQLApiType.class); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/GraphQLApiTypeEnumValue.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/GraphQLApiTypeEnumValue.java new file mode 100644 index 000000000000..42cda3a04744 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/GraphQLApiTypeEnumValue.java @@ -0,0 +1,93 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of GraphQLApiTypeEnumValue. + */ +@Fluent +public final class GraphQLApiTypeEnumValue implements JsonSerializable { + /* + * Property value + */ + private GraphQLApiType value; + + /** + * Creates an instance of GraphQLApiTypeEnumValue class. + */ + public GraphQLApiTypeEnumValue() { + } + + /** + * Get the value property: Property value. + * + * @return the value value. + */ + public GraphQLApiType value() { + return this.value; + } + + /** + * Set the value property: Property value. + * + * @param value the value value to set. + * @return the GraphQLApiTypeEnumValue object itself. + */ + public GraphQLApiTypeEnumValue withValue(GraphQLApiType value) { + this.value = value; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("value", this.value == null ? null : this.value.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of GraphQLApiTypeEnumValue from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of GraphQLApiTypeEnumValue if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the GraphQLApiTypeEnumValue. + */ + public static GraphQLApiTypeEnumValue fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + GraphQLApiTypeEnumValue deserializedGraphQLApiTypeEnumValue = new GraphQLApiTypeEnumValue(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + deserializedGraphQLApiTypeEnumValue.value = GraphQLApiType.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedGraphQLApiTypeEnumValue; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/GraphQLApiVisibility.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/GraphQLApiVisibility.java new file mode 100644 index 000000000000..a9ab13f39527 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/GraphQLApiVisibility.java @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * GraphQLApiVisibility enum. + */ +public final class GraphQLApiVisibility extends ExpandableStringEnum { + /** + * Static value GLOBAL for GraphQLApiVisibility. + */ + public static final GraphQLApiVisibility GLOBAL = fromString("GLOBAL"); + + /** + * Static value PRIVATE for GraphQLApiVisibility. + */ + public static final GraphQLApiVisibility PRIVATE = fromString("PRIVATE"); + + /** + * Creates a new instance of GraphQLApiVisibility value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public GraphQLApiVisibility() { + } + + /** + * Creates or finds a GraphQLApiVisibility from its string representation. + * + * @param name a name to look for. + * @return the corresponding GraphQLApiVisibility. + */ + public static GraphQLApiVisibility fromString(String name) { + return fromString(name, GraphQLApiVisibility.class); + } + + /** + * Gets known GraphQLApiVisibility values. + * + * @return known GraphQLApiVisibility values. + */ + public static Collection values() { + return values(GraphQLApiVisibility.class); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/GraphQLApiVisibilityEnumValue.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/GraphQLApiVisibilityEnumValue.java new file mode 100644 index 000000000000..91f8b46646d9 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/GraphQLApiVisibilityEnumValue.java @@ -0,0 +1,95 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of GraphQLApiVisibilityEnumValue. + */ +@Fluent +public final class GraphQLApiVisibilityEnumValue implements JsonSerializable { + /* + * Property value + */ + private GraphQLApiVisibility value; + + /** + * Creates an instance of GraphQLApiVisibilityEnumValue class. + */ + public GraphQLApiVisibilityEnumValue() { + } + + /** + * Get the value property: Property value. + * + * @return the value value. + */ + public GraphQLApiVisibility value() { + return this.value; + } + + /** + * Set the value property: Property value. + * + * @param value the value value to set. + * @return the GraphQLApiVisibilityEnumValue object itself. + */ + public GraphQLApiVisibilityEnumValue withValue(GraphQLApiVisibility value) { + this.value = value; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("value", this.value == null ? null : this.value.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of GraphQLApiVisibilityEnumValue from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of GraphQLApiVisibilityEnumValue if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the GraphQLApiVisibilityEnumValue. + */ + public static GraphQLApiVisibilityEnumValue fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + GraphQLApiVisibilityEnumValue deserializedGraphQLApiVisibilityEnumValue + = new GraphQLApiVisibilityEnumValue(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + deserializedGraphQLApiVisibilityEnumValue.value + = GraphQLApiVisibility.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedGraphQLApiVisibilityEnumValue; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/GroupIdentifier.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/GroupIdentifier.java new file mode 100644 index 000000000000..c7eeffd53be1 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/GroupIdentifier.java @@ -0,0 +1,121 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of GroupIdentifier. + */ +@Fluent +public final class GroupIdentifier implements JsonSerializable { + /* + *

The ID of the security group.

+ */ + private String groupId; + + /* + *

The name of the security group.

+ */ + private String groupName; + + /** + * Creates an instance of GroupIdentifier class. + */ + public GroupIdentifier() { + } + + /** + * Get the groupId property: <p>The ID of the security group.</p>. + * + * @return the groupId value. + */ + public String groupId() { + return this.groupId; + } + + /** + * Set the groupId property: <p>The ID of the security group.</p>. + * + * @param groupId the groupId value to set. + * @return the GroupIdentifier object itself. + */ + public GroupIdentifier withGroupId(String groupId) { + this.groupId = groupId; + return this; + } + + /** + * Get the groupName property: <p>The name of the security group.</p>. + * + * @return the groupName value. + */ + public String groupName() { + return this.groupName; + } + + /** + * Set the groupName property: <p>The name of the security group.</p>. + * + * @param groupName the groupName value to set. + * @return the GroupIdentifier object itself. + */ + public GroupIdentifier withGroupName(String groupName) { + this.groupName = groupName; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("groupId", this.groupId); + jsonWriter.writeStringField("groupName", this.groupName); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of GroupIdentifier from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of GroupIdentifier if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the GroupIdentifier. + */ + public static GroupIdentifier fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + GroupIdentifier deserializedGroupIdentifier = new GroupIdentifier(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("groupId".equals(fieldName)) { + deserializedGroupIdentifier.groupId = reader.getString(); + } else if ("groupName".equals(fieldName)) { + deserializedGroupIdentifier.groupName = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedGroupIdentifier; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/GuardDutyDetector.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/GuardDutyDetector.java new file mode 100644 index 000000000000..de6a7391c0b2 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/GuardDutyDetector.java @@ -0,0 +1,252 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.awsconnector.fluent.models.GuardDutyDetectorInner; +import java.util.Map; + +/** + * An immutable client-side representation of GuardDutyDetector. + */ +public interface GuardDutyDetector { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the location property: The geo-location where the resource lives. + * + * @return the location value. + */ + String location(); + + /** + * Gets the tags property: Resource tags. + * + * @return the tags value. + */ + Map tags(); + + /** + * Gets the properties property: The resource-specific properties for this resource. + * + * @return the properties value. + */ + GuardDutyDetectorProperties properties(); + + /** + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the region of the resource. + * + * @return the region of the resource. + */ + Region region(); + + /** + * Gets the name of the resource region. + * + * @return the name of the resource region. + */ + String regionName(); + + /** + * Gets the name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + + /** + * Gets the inner com.azure.resourcemanager.awsconnector.fluent.models.GuardDutyDetectorInner object. + * + * @return the inner object. + */ + GuardDutyDetectorInner innerModel(); + + /** + * The entirety of the GuardDutyDetector definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithLocation, + DefinitionStages.WithResourceGroup, DefinitionStages.WithCreate { + } + + /** + * The GuardDutyDetector definition stages. + */ + interface DefinitionStages { + /** + * The first stage of the GuardDutyDetector definition. + */ + interface Blank extends WithLocation { + } + + /** + * The stage of the GuardDutyDetector definition allowing to specify location. + */ + interface WithLocation { + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithResourceGroup withRegion(Region location); + + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithResourceGroup withRegion(String location); + } + + /** + * The stage of the GuardDutyDetector definition allowing to specify parent resource. + */ + interface WithResourceGroup { + /** + * Specifies resourceGroupName. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @return the next definition stage. + */ + WithCreate withExistingResourceGroup(String resourceGroupName); + } + + /** + * The stage of the GuardDutyDetector 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.WithProperties { + /** + * Executes the create request. + * + * @return the created resource. + */ + GuardDutyDetector create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + GuardDutyDetector create(Context context); + } + + /** + * The stage of the GuardDutyDetector definition allowing to specify tags. + */ + interface WithTags { + /** + * Specifies the tags property: Resource tags.. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + WithCreate withTags(Map tags); + } + + /** + * The stage of the GuardDutyDetector definition allowing to specify properties. + */ + interface WithProperties { + /** + * Specifies the properties property: The resource-specific properties for this resource.. + * + * @param properties The resource-specific properties for this resource. + * @return the next definition stage. + */ + WithCreate withProperties(GuardDutyDetectorProperties properties); + } + } + + /** + * Begins update for the GuardDutyDetector resource. + * + * @return the stage of resource update. + */ + GuardDutyDetector.Update update(); + + /** + * The template for GuardDutyDetector update. + */ + interface Update extends UpdateStages.WithTags { + /** + * Executes the update request. + * + * @return the updated resource. + */ + GuardDutyDetector apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + GuardDutyDetector apply(Context context); + } + + /** + * The GuardDutyDetector update stages. + */ + interface UpdateStages { + /** + * The stage of the GuardDutyDetector update allowing to specify tags. + */ + interface WithTags { + /** + * Specifies the tags property: Resource tags.. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + Update withTags(Map tags); + } + } + + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + GuardDutyDetector refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + GuardDutyDetector refresh(Context context); +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/GuardDutyDetectorListResult.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/GuardDutyDetectorListResult.java new file mode 100644 index 000000000000..bd4bb1e65e64 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/GuardDutyDetectorListResult.java @@ -0,0 +1,136 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.awsconnector.fluent.models.GuardDutyDetectorInner; +import java.io.IOException; +import java.util.List; + +/** + * The response of a GuardDutyDetector list operation. + */ +@Fluent +public final class GuardDutyDetectorListResult implements JsonSerializable { + /* + * The GuardDutyDetector items on this page + */ + private List value; + + /* + * The link to the next page of items + */ + private String nextLink; + + /** + * Creates an instance of GuardDutyDetectorListResult class. + */ + public GuardDutyDetectorListResult() { + } + + /** + * Get the value property: The GuardDutyDetector items on this page. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The GuardDutyDetector items on this page. + * + * @param value the value value to set. + * @return the GuardDutyDetectorListResult object itself. + */ + public GuardDutyDetectorListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The link to the next page of items. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: The link to the next page of items. + * + * @param nextLink the nextLink value to set. + * @return the GuardDutyDetectorListResult object itself. + */ + public GuardDutyDetectorListResult withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property value in model GuardDutyDetectorListResult")); + } else { + value().forEach(e -> e.validate()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(GuardDutyDetectorListResult.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("nextLink", this.nextLink); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of GuardDutyDetectorListResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of GuardDutyDetectorListResult if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the GuardDutyDetectorListResult. + */ + public static GuardDutyDetectorListResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + GuardDutyDetectorListResult deserializedGuardDutyDetectorListResult = new GuardDutyDetectorListResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> GuardDutyDetectorInner.fromJson(reader1)); + deserializedGuardDutyDetectorListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedGuardDutyDetectorListResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedGuardDutyDetectorListResult; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/GuardDutyDetectorProperties.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/GuardDutyDetectorProperties.java new file mode 100644 index 000000000000..f189b007fdd1 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/GuardDutyDetectorProperties.java @@ -0,0 +1,312 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.Map; + +/** + * Definition of GuardDutyDetector. + */ +@Fluent +public final class GuardDutyDetectorProperties implements JsonSerializable { + /* + * AWS Properties + */ + private AwsGuardDutyDetectorProperties awsProperties; + + /* + * Public Cloud Connectors Resource ID + */ + private String publicCloudConnectorsResourceId; + + /* + * AWS Account ID + */ + private String awsAccountId; + + /* + * Amazon Resource Name (ARN) + */ + private String arn; + + /* + * Public Cloud Resource Name + */ + private String publicCloudResourceName; + + /* + * AWS Source Schema + */ + private String awsSourceSchema; + + /* + * AWS Region + */ + private String awsRegion; + + /* + * AWS Tags + */ + private Map awsTags; + + /* + * The status of the last operation. + */ + private ProvisioningState provisioningState; + + /** + * Creates an instance of GuardDutyDetectorProperties class. + */ + public GuardDutyDetectorProperties() { + } + + /** + * Get the awsProperties property: AWS Properties. + * + * @return the awsProperties value. + */ + public AwsGuardDutyDetectorProperties awsProperties() { + return this.awsProperties; + } + + /** + * Set the awsProperties property: AWS Properties. + * + * @param awsProperties the awsProperties value to set. + * @return the GuardDutyDetectorProperties object itself. + */ + public GuardDutyDetectorProperties withAwsProperties(AwsGuardDutyDetectorProperties awsProperties) { + this.awsProperties = awsProperties; + return this; + } + + /** + * Get the publicCloudConnectorsResourceId property: Public Cloud Connectors Resource ID. + * + * @return the publicCloudConnectorsResourceId value. + */ + public String publicCloudConnectorsResourceId() { + return this.publicCloudConnectorsResourceId; + } + + /** + * Set the publicCloudConnectorsResourceId property: Public Cloud Connectors Resource ID. + * + * @param publicCloudConnectorsResourceId the publicCloudConnectorsResourceId value to set. + * @return the GuardDutyDetectorProperties object itself. + */ + public GuardDutyDetectorProperties withPublicCloudConnectorsResourceId(String publicCloudConnectorsResourceId) { + this.publicCloudConnectorsResourceId = publicCloudConnectorsResourceId; + return this; + } + + /** + * Get the awsAccountId property: AWS Account ID. + * + * @return the awsAccountId value. + */ + public String awsAccountId() { + return this.awsAccountId; + } + + /** + * Set the awsAccountId property: AWS Account ID. + * + * @param awsAccountId the awsAccountId value to set. + * @return the GuardDutyDetectorProperties object itself. + */ + public GuardDutyDetectorProperties withAwsAccountId(String awsAccountId) { + this.awsAccountId = awsAccountId; + return this; + } + + /** + * Get the arn property: Amazon Resource Name (ARN). + * + * @return the arn value. + */ + public String arn() { + return this.arn; + } + + /** + * Set the arn property: Amazon Resource Name (ARN). + * + * @param arn the arn value to set. + * @return the GuardDutyDetectorProperties object itself. + */ + public GuardDutyDetectorProperties withArn(String arn) { + this.arn = arn; + return this; + } + + /** + * Get the publicCloudResourceName property: Public Cloud Resource Name. + * + * @return the publicCloudResourceName value. + */ + public String publicCloudResourceName() { + return this.publicCloudResourceName; + } + + /** + * Set the publicCloudResourceName property: Public Cloud Resource Name. + * + * @param publicCloudResourceName the publicCloudResourceName value to set. + * @return the GuardDutyDetectorProperties object itself. + */ + public GuardDutyDetectorProperties withPublicCloudResourceName(String publicCloudResourceName) { + this.publicCloudResourceName = publicCloudResourceName; + return this; + } + + /** + * Get the awsSourceSchema property: AWS Source Schema. + * + * @return the awsSourceSchema value. + */ + public String awsSourceSchema() { + return this.awsSourceSchema; + } + + /** + * Set the awsSourceSchema property: AWS Source Schema. + * + * @param awsSourceSchema the awsSourceSchema value to set. + * @return the GuardDutyDetectorProperties object itself. + */ + public GuardDutyDetectorProperties withAwsSourceSchema(String awsSourceSchema) { + this.awsSourceSchema = awsSourceSchema; + return this; + } + + /** + * Get the awsRegion property: AWS Region. + * + * @return the awsRegion value. + */ + public String awsRegion() { + return this.awsRegion; + } + + /** + * Set the awsRegion property: AWS Region. + * + * @param awsRegion the awsRegion value to set. + * @return the GuardDutyDetectorProperties object itself. + */ + public GuardDutyDetectorProperties withAwsRegion(String awsRegion) { + this.awsRegion = awsRegion; + return this; + } + + /** + * Get the awsTags property: AWS Tags. + * + * @return the awsTags value. + */ + public Map awsTags() { + return this.awsTags; + } + + /** + * Set the awsTags property: AWS Tags. + * + * @param awsTags the awsTags value to set. + * @return the GuardDutyDetectorProperties object itself. + */ + public GuardDutyDetectorProperties withAwsTags(Map awsTags) { + this.awsTags = awsTags; + return this; + } + + /** + * Get the provisioningState property: The status of the last operation. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (awsProperties() != null) { + awsProperties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("awsProperties", this.awsProperties); + jsonWriter.writeStringField("publicCloudConnectorsResourceId", this.publicCloudConnectorsResourceId); + jsonWriter.writeStringField("awsAccountId", this.awsAccountId); + jsonWriter.writeStringField("arn", this.arn); + jsonWriter.writeStringField("publicCloudResourceName", this.publicCloudResourceName); + jsonWriter.writeStringField("awsSourceSchema", this.awsSourceSchema); + jsonWriter.writeStringField("awsRegion", this.awsRegion); + jsonWriter.writeMapField("awsTags", this.awsTags, (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of GuardDutyDetectorProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of GuardDutyDetectorProperties if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the GuardDutyDetectorProperties. + */ + public static GuardDutyDetectorProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + GuardDutyDetectorProperties deserializedGuardDutyDetectorProperties = new GuardDutyDetectorProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("awsProperties".equals(fieldName)) { + deserializedGuardDutyDetectorProperties.awsProperties + = AwsGuardDutyDetectorProperties.fromJson(reader); + } else if ("publicCloudConnectorsResourceId".equals(fieldName)) { + deserializedGuardDutyDetectorProperties.publicCloudConnectorsResourceId = reader.getString(); + } else if ("awsAccountId".equals(fieldName)) { + deserializedGuardDutyDetectorProperties.awsAccountId = reader.getString(); + } else if ("arn".equals(fieldName)) { + deserializedGuardDutyDetectorProperties.arn = reader.getString(); + } else if ("publicCloudResourceName".equals(fieldName)) { + deserializedGuardDutyDetectorProperties.publicCloudResourceName = reader.getString(); + } else if ("awsSourceSchema".equals(fieldName)) { + deserializedGuardDutyDetectorProperties.awsSourceSchema = reader.getString(); + } else if ("awsRegion".equals(fieldName)) { + deserializedGuardDutyDetectorProperties.awsRegion = reader.getString(); + } else if ("awsTags".equals(fieldName)) { + Map awsTags = reader.readMap(reader1 -> reader1.getString()); + deserializedGuardDutyDetectorProperties.awsTags = awsTags; + } else if ("provisioningState".equals(fieldName)) { + deserializedGuardDutyDetectorProperties.provisioningState + = ProvisioningState.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedGuardDutyDetectorProperties; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/GuardDutyDetectorTagsUpdate.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/GuardDutyDetectorTagsUpdate.java new file mode 100644 index 000000000000..9c2222a75d7f --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/GuardDutyDetectorTagsUpdate.java @@ -0,0 +1,95 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.Map; + +/** + * The type used for updating tags in GuardDutyDetector resources. + */ +@Fluent +public final class GuardDutyDetectorTagsUpdate implements JsonSerializable { + /* + * Resource tags. + */ + private Map tags; + + /** + * Creates an instance of GuardDutyDetectorTagsUpdate class. + */ + public GuardDutyDetectorTagsUpdate() { + } + + /** + * Get the tags property: Resource tags. + * + * @return the tags value. + */ + public Map tags() { + return this.tags; + } + + /** + * Set the tags property: Resource tags. + * + * @param tags the tags value to set. + * @return the GuardDutyDetectorTagsUpdate object itself. + */ + public GuardDutyDetectorTagsUpdate withTags(Map tags) { + this.tags = tags; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeMapField("tags", this.tags, (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of GuardDutyDetectorTagsUpdate from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of GuardDutyDetectorTagsUpdate if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the GuardDutyDetectorTagsUpdate. + */ + public static GuardDutyDetectorTagsUpdate fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + GuardDutyDetectorTagsUpdate deserializedGuardDutyDetectorTagsUpdate = new GuardDutyDetectorTagsUpdate(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedGuardDutyDetectorTagsUpdate.tags = tags; + } else { + reader.skipChildren(); + } + } + + return deserializedGuardDutyDetectorTagsUpdate; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/GuardDutyDetectors.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/GuardDutyDetectors.java new file mode 100644 index 000000000000..b364cf2d9f92 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/GuardDutyDetectors.java @@ -0,0 +1,157 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** + * Resource collection API of GuardDutyDetectors. + */ +public interface GuardDutyDetectors { + /** + * List GuardDutyDetector resources by subscription ID. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a GuardDutyDetector list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable list(); + + /** + * List GuardDutyDetector resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a GuardDutyDetector list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable list(Context context); + + /** + * List GuardDutyDetector resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a GuardDutyDetector list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * List GuardDutyDetector resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a GuardDutyDetector list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Get a GuardDutyDetector. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of GuardDutyDetector. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a GuardDutyDetector along with {@link Response}. + */ + Response getByResourceGroupWithResponse(String resourceGroupName, String name, Context context); + + /** + * Get a GuardDutyDetector. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of GuardDutyDetector. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a GuardDutyDetector. + */ + GuardDutyDetector getByResourceGroup(String resourceGroupName, String name); + + /** + * Delete a GuardDutyDetector. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of GuardDutyDetector. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByResourceGroup(String resourceGroupName, String name); + + /** + * Delete a GuardDutyDetector. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of GuardDutyDetector. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String name, Context context); + + /** + * Get a GuardDutyDetector. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a GuardDutyDetector along with {@link Response}. + */ + GuardDutyDetector getById(String id); + + /** + * Get a GuardDutyDetector. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a GuardDutyDetector along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Delete a GuardDutyDetector. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteById(String id); + + /** + * Delete a GuardDutyDetector. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new GuardDutyDetector resource. + * + * @param name resource name. + * @return the first stage of the new GuardDutyDetector definition. + */ + GuardDutyDetector.DefinitionStages.Blank define(String name); +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/Hardware.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/Hardware.java new file mode 100644 index 000000000000..b542c3a6c8b9 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/Hardware.java @@ -0,0 +1,154 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Definition of Hardware. + */ +@Fluent +public final class Hardware implements JsonSerializable { + /* + * CPU count of the Instance. + */ + private Integer cpuCount; + + /* + * Disks attached to the Instance. + */ + private List disks; + + /* + * RAM Size of the Instance. + */ + private Integer ramSizeInGb; + + /** + * Creates an instance of Hardware class. + */ + public Hardware() { + } + + /** + * Get the cpuCount property: CPU count of the Instance. + * + * @return the cpuCount value. + */ + public Integer cpuCount() { + return this.cpuCount; + } + + /** + * Set the cpuCount property: CPU count of the Instance. + * + * @param cpuCount the cpuCount value to set. + * @return the Hardware object itself. + */ + public Hardware withCpuCount(Integer cpuCount) { + this.cpuCount = cpuCount; + return this; + } + + /** + * Get the disks property: Disks attached to the Instance. + * + * @return the disks value. + */ + public List disks() { + return this.disks; + } + + /** + * Set the disks property: Disks attached to the Instance. + * + * @param disks the disks value to set. + * @return the Hardware object itself. + */ + public Hardware withDisks(List disks) { + this.disks = disks; + return this; + } + + /** + * Get the ramSizeInGb property: RAM Size of the Instance. + * + * @return the ramSizeInGb value. + */ + public Integer ramSizeInGb() { + return this.ramSizeInGb; + } + + /** + * Set the ramSizeInGb property: RAM Size of the Instance. + * + * @param ramSizeInGb the ramSizeInGb value to set. + * @return the Hardware object itself. + */ + public Hardware withRamSizeInGb(Integer ramSizeInGb) { + this.ramSizeInGb = ramSizeInGb; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (disks() != null) { + disks().forEach(e -> e.validate()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeNumberField("cpuCount", this.cpuCount); + jsonWriter.writeArrayField("disks", this.disks, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeNumberField("ramSizeInGb", this.ramSizeInGb); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of Hardware from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of Hardware if the JsonReader was pointing to an instance of it, or null if it was pointing + * to JSON null. + * @throws IOException If an error occurs while reading the Hardware. + */ + public static Hardware fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + Hardware deserializedHardware = new Hardware(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("cpuCount".equals(fieldName)) { + deserializedHardware.cpuCount = reader.getNullable(JsonReader::getInt); + } else if ("disks".equals(fieldName)) { + List disks = reader.readArray(reader1 -> Disk.fromJson(reader1)); + deserializedHardware.disks = disks; + } else if ("ramSizeInGb".equals(fieldName)) { + deserializedHardware.ramSizeInGb = reader.getNullable(JsonReader::getInt); + } else { + reader.skipChildren(); + } + } + + return deserializedHardware; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/Header.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/Header.java new file mode 100644 index 000000000000..4a61e7558cde --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/Header.java @@ -0,0 +1,233 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of Header. + */ +@Fluent +public final class Header implements JsonSerializable
{ + /* + * Property destination + */ + private String destination; + + /* + * Property destinationPort + */ + private String destinationPort; + + /* + * Property direction + */ + private HeaderDirection direction; + + /* + * Property protocol + */ + private HeaderProtocol protocol; + + /* + * Property source + */ + private String source; + + /* + * Property sourcePort + */ + private String sourcePort; + + /** + * Creates an instance of Header class. + */ + public Header() { + } + + /** + * Get the destination property: Property destination. + * + * @return the destination value. + */ + public String destination() { + return this.destination; + } + + /** + * Set the destination property: Property destination. + * + * @param destination the destination value to set. + * @return the Header object itself. + */ + public Header withDestination(String destination) { + this.destination = destination; + return this; + } + + /** + * Get the destinationPort property: Property destinationPort. + * + * @return the destinationPort value. + */ + public String destinationPort() { + return this.destinationPort; + } + + /** + * Set the destinationPort property: Property destinationPort. + * + * @param destinationPort the destinationPort value to set. + * @return the Header object itself. + */ + public Header withDestinationPort(String destinationPort) { + this.destinationPort = destinationPort; + return this; + } + + /** + * Get the direction property: Property direction. + * + * @return the direction value. + */ + public HeaderDirection direction() { + return this.direction; + } + + /** + * Set the direction property: Property direction. + * + * @param direction the direction value to set. + * @return the Header object itself. + */ + public Header withDirection(HeaderDirection direction) { + this.direction = direction; + return this; + } + + /** + * Get the protocol property: Property protocol. + * + * @return the protocol value. + */ + public HeaderProtocol protocol() { + return this.protocol; + } + + /** + * Set the protocol property: Property protocol. + * + * @param protocol the protocol value to set. + * @return the Header object itself. + */ + public Header withProtocol(HeaderProtocol protocol) { + this.protocol = protocol; + return this; + } + + /** + * Get the source property: Property source. + * + * @return the source value. + */ + public String source() { + return this.source; + } + + /** + * Set the source property: Property source. + * + * @param source the source value to set. + * @return the Header object itself. + */ + public Header withSource(String source) { + this.source = source; + return this; + } + + /** + * Get the sourcePort property: Property sourcePort. + * + * @return the sourcePort value. + */ + public String sourcePort() { + return this.sourcePort; + } + + /** + * Set the sourcePort property: Property sourcePort. + * + * @param sourcePort the sourcePort value to set. + * @return the Header object itself. + */ + public Header withSourcePort(String sourcePort) { + this.sourcePort = sourcePort; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("destination", this.destination); + jsonWriter.writeStringField("destinationPort", this.destinationPort); + jsonWriter.writeStringField("direction", this.direction == null ? null : this.direction.toString()); + jsonWriter.writeStringField("protocol", this.protocol == null ? null : this.protocol.toString()); + jsonWriter.writeStringField("source", this.source); + jsonWriter.writeStringField("sourcePort", this.sourcePort); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of Header from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of Header if the JsonReader was pointing to an instance of it, or null if it was pointing to + * JSON null. + * @throws IOException If an error occurs while reading the Header. + */ + public static Header fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + Header deserializedHeader = new Header(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("destination".equals(fieldName)) { + deserializedHeader.destination = reader.getString(); + } else if ("destinationPort".equals(fieldName)) { + deserializedHeader.destinationPort = reader.getString(); + } else if ("direction".equals(fieldName)) { + deserializedHeader.direction = HeaderDirection.fromString(reader.getString()); + } else if ("protocol".equals(fieldName)) { + deserializedHeader.protocol = HeaderProtocol.fromString(reader.getString()); + } else if ("source".equals(fieldName)) { + deserializedHeader.source = reader.getString(); + } else if ("sourcePort".equals(fieldName)) { + deserializedHeader.sourcePort = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedHeader; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/HeaderDirection.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/HeaderDirection.java new file mode 100644 index 000000000000..35622e9c223d --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/HeaderDirection.java @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * HeaderDirection enum. + */ +public final class HeaderDirection extends ExpandableStringEnum { + /** + * Static value ANY for HeaderDirection. + */ + public static final HeaderDirection ANY = fromString("ANY"); + + /** + * Static value FORWARD for HeaderDirection. + */ + public static final HeaderDirection FORWARD = fromString("FORWARD"); + + /** + * Creates a new instance of HeaderDirection value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public HeaderDirection() { + } + + /** + * Creates or finds a HeaderDirection from its string representation. + * + * @param name a name to look for. + * @return the corresponding HeaderDirection. + */ + public static HeaderDirection fromString(String name) { + return fromString(name, HeaderDirection.class); + } + + /** + * Gets known HeaderDirection values. + * + * @return known HeaderDirection values. + */ + public static Collection values() { + return values(HeaderDirection.class); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/HeaderProtocol.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/HeaderProtocol.java new file mode 100644 index 000000000000..9c5b3607e3b2 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/HeaderProtocol.java @@ -0,0 +1,136 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * HeaderProtocol enum. + */ +public final class HeaderProtocol extends ExpandableStringEnum { + /** + * Static value DCERPC for HeaderProtocol. + */ + public static final HeaderProtocol DCERPC = fromString("DCERPC"); + + /** + * Static value DHCP for HeaderProtocol. + */ + public static final HeaderProtocol DHCP = fromString("DHCP"); + + /** + * Static value DNS for HeaderProtocol. + */ + public static final HeaderProtocol DNS = fromString("DNS"); + + /** + * Static value FTP for HeaderProtocol. + */ + public static final HeaderProtocol FTP = fromString("FTP"); + + /** + * Static value HTTP for HeaderProtocol. + */ + public static final HeaderProtocol HTTP = fromString("HTTP"); + + /** + * Static value ICMP for HeaderProtocol. + */ + public static final HeaderProtocol ICMP = fromString("ICMP"); + + /** + * Static value IKEV2 for HeaderProtocol. + */ + public static final HeaderProtocol IKEV2 = fromString("IKEV2"); + + /** + * Static value IMAP for HeaderProtocol. + */ + public static final HeaderProtocol IMAP = fromString("IMAP"); + + /** + * Static value IP for HeaderProtocol. + */ + public static final HeaderProtocol IP = fromString("IP"); + + /** + * Static value KRB5 for HeaderProtocol. + */ + public static final HeaderProtocol KRB5 = fromString("KRB5"); + + /** + * Static value MSN for HeaderProtocol. + */ + public static final HeaderProtocol MSN = fromString("MSN"); + + /** + * Static value NTP for HeaderProtocol. + */ + public static final HeaderProtocol NTP = fromString("NTP"); + + /** + * Static value SMB for HeaderProtocol. + */ + public static final HeaderProtocol SMB = fromString("SMB"); + + /** + * Static value SMTP for HeaderProtocol. + */ + public static final HeaderProtocol SMTP = fromString("SMTP"); + + /** + * Static value SSH for HeaderProtocol. + */ + public static final HeaderProtocol SSH = fromString("SSH"); + + /** + * Static value TCP for HeaderProtocol. + */ + public static final HeaderProtocol TCP = fromString("TCP"); + + /** + * Static value TFTP for HeaderProtocol. + */ + public static final HeaderProtocol TFTP = fromString("TFTP"); + + /** + * Static value TLS for HeaderProtocol. + */ + public static final HeaderProtocol TLS = fromString("TLS"); + + /** + * Static value UDP for HeaderProtocol. + */ + public static final HeaderProtocol UDP = fromString("UDP"); + + /** + * Creates a new instance of HeaderProtocol value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public HeaderProtocol() { + } + + /** + * Creates or finds a HeaderProtocol from its string representation. + * + * @param name a name to look for. + * @return the corresponding HeaderProtocol. + */ + public static HeaderProtocol fromString(String name) { + return fromString(name, HeaderProtocol.class); + } + + /** + * Gets known HeaderProtocol values. + * + * @return known HeaderProtocol values. + */ + public static Collection values() { + return values(HeaderProtocol.class); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/HealthCheck.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/HealthCheck.java new file mode 100644 index 000000000000..7c04cbe0d921 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/HealthCheck.java @@ -0,0 +1,249 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Definition of HealthCheck. + */ +@Fluent +public final class HealthCheck implements JsonSerializable { + /* + * A string array representing the command that the container runs to determine if it is healthy. The string array + * must start with ``CMD`` to run the command arguments directly, or ``CMD-SHELL`` to run the command with the + * container's default shell. When you use the AWS Management Console JSON panel, the CLIlong, or the APIs, enclose + * the list of commands in double quotes and brackets. ``[ 'CMD-SHELL', 'curl -f http://localhost/ || exit 1' ]`` + * You don't include the double quotes and brackets when you use the AWS Management Console. ``CMD-SHELL, curl -f + * http://localhost/ || exit 1`` An exit code of 0 indicates success, and non-zero exit code indicates failure. For + * more information, see ``HealthCheck`` in the [Create a + * container](https://docs.aws.amazon.com/https://docs.docker.com/engine/api/v1.35/#operation/ContainerCreate) + * section of the [Docker Remote API](https://docs.aws.amazon.com/https://docs.docker.com/engine/api/v1.35/). + */ + private List command; + + /* + * The time period in seconds between each health check execution. You may specify between 5 and 300 seconds. The + * default value is 30 seconds. + */ + private Integer interval; + + /* + * The number of times to retry a failed health check before the container is considered unhealthy. You may specify + * between 1 and 10 retries. The default value is 3. + */ + private Integer retries; + + /* + * The optional grace period to provide containers time to bootstrap before failed health checks count towards the + * maximum number of retries. You can specify between 0 and 300 seconds. By default, the ``startPeriod`` is off. If + * a health check succeeds within the ``startPeriod``, then the container is considered healthy and any subsequent + * failures count toward the maximum number of retries. + */ + private Integer startPeriod; + + /* + * The time period in seconds to wait for a health check to succeed before it is considered a failure. You may + * specify between 2 and 60 seconds. The default value is 5. + */ + private Integer timeout; + + /** + * Creates an instance of HealthCheck class. + */ + public HealthCheck() { + } + + /** + * Get the command property: A string array representing the command that the container runs to determine if it is + * healthy. The string array must start with ``CMD`` to run the command arguments directly, or ``CMD-SHELL`` to run + * the command with the container's default shell. When you use the AWS Management Console JSON panel, the CLIlong, + * or the APIs, enclose the list of commands in double quotes and brackets. ``[ 'CMD-SHELL', 'curl -f + * http://localhost/ || exit 1' ]`` You don't include the double quotes and brackets when you use the AWS Management + * Console. ``CMD-SHELL, curl -f http://localhost/ || exit 1`` An exit code of 0 indicates success, and non-zero + * exit code indicates failure. For more information, see ``HealthCheck`` in the [Create a + * container](https://docs.aws.amazon.com/https://docs.docker.com/engine/api/v1.35/#operation/ContainerCreate) + * section of the [Docker Remote API](https://docs.aws.amazon.com/https://docs.docker.com/engine/api/v1.35/). + * + * @return the command value. + */ + public List command() { + return this.command; + } + + /** + * Set the command property: A string array representing the command that the container runs to determine if it is + * healthy. The string array must start with ``CMD`` to run the command arguments directly, or ``CMD-SHELL`` to run + * the command with the container's default shell. When you use the AWS Management Console JSON panel, the CLIlong, + * or the APIs, enclose the list of commands in double quotes and brackets. ``[ 'CMD-SHELL', 'curl -f + * http://localhost/ || exit 1' ]`` You don't include the double quotes and brackets when you use the AWS Management + * Console. ``CMD-SHELL, curl -f http://localhost/ || exit 1`` An exit code of 0 indicates success, and non-zero + * exit code indicates failure. For more information, see ``HealthCheck`` in the [Create a + * container](https://docs.aws.amazon.com/https://docs.docker.com/engine/api/v1.35/#operation/ContainerCreate) + * section of the [Docker Remote API](https://docs.aws.amazon.com/https://docs.docker.com/engine/api/v1.35/). + * + * @param command the command value to set. + * @return the HealthCheck object itself. + */ + public HealthCheck withCommand(List command) { + this.command = command; + return this; + } + + /** + * Get the interval property: The time period in seconds between each health check execution. You may specify + * between 5 and 300 seconds. The default value is 30 seconds. + * + * @return the interval value. + */ + public Integer interval() { + return this.interval; + } + + /** + * Set the interval property: The time period in seconds between each health check execution. You may specify + * between 5 and 300 seconds. The default value is 30 seconds. + * + * @param interval the interval value to set. + * @return the HealthCheck object itself. + */ + public HealthCheck withInterval(Integer interval) { + this.interval = interval; + return this; + } + + /** + * Get the retries property: The number of times to retry a failed health check before the container is considered + * unhealthy. You may specify between 1 and 10 retries. The default value is 3. + * + * @return the retries value. + */ + public Integer retries() { + return this.retries; + } + + /** + * Set the retries property: The number of times to retry a failed health check before the container is considered + * unhealthy. You may specify between 1 and 10 retries. The default value is 3. + * + * @param retries the retries value to set. + * @return the HealthCheck object itself. + */ + public HealthCheck withRetries(Integer retries) { + this.retries = retries; + return this; + } + + /** + * Get the startPeriod property: The optional grace period to provide containers time to bootstrap before failed + * health checks count towards the maximum number of retries. You can specify between 0 and 300 seconds. By default, + * the ``startPeriod`` is off. If a health check succeeds within the ``startPeriod``, then the container is + * considered healthy and any subsequent failures count toward the maximum number of retries. + * + * @return the startPeriod value. + */ + public Integer startPeriod() { + return this.startPeriod; + } + + /** + * Set the startPeriod property: The optional grace period to provide containers time to bootstrap before failed + * health checks count towards the maximum number of retries. You can specify between 0 and 300 seconds. By default, + * the ``startPeriod`` is off. If a health check succeeds within the ``startPeriod``, then the container is + * considered healthy and any subsequent failures count toward the maximum number of retries. + * + * @param startPeriod the startPeriod value to set. + * @return the HealthCheck object itself. + */ + public HealthCheck withStartPeriod(Integer startPeriod) { + this.startPeriod = startPeriod; + return this; + } + + /** + * Get the timeout property: The time period in seconds to wait for a health check to succeed before it is + * considered a failure. You may specify between 2 and 60 seconds. The default value is 5. + * + * @return the timeout value. + */ + public Integer timeout() { + return this.timeout; + } + + /** + * Set the timeout property: The time period in seconds to wait for a health check to succeed before it is + * considered a failure. You may specify between 2 and 60 seconds. The default value is 5. + * + * @param timeout the timeout value to set. + * @return the HealthCheck object itself. + */ + public HealthCheck withTimeout(Integer timeout) { + this.timeout = timeout; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("command", this.command, (writer, element) -> writer.writeString(element)); + jsonWriter.writeNumberField("interval", this.interval); + jsonWriter.writeNumberField("retries", this.retries); + jsonWriter.writeNumberField("startPeriod", this.startPeriod); + jsonWriter.writeNumberField("timeout", this.timeout); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of HealthCheck from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of HealthCheck if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the HealthCheck. + */ + public static HealthCheck fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + HealthCheck deserializedHealthCheck = new HealthCheck(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("command".equals(fieldName)) { + List command = reader.readArray(reader1 -> reader1.getString()); + deserializedHealthCheck.command = command; + } else if ("interval".equals(fieldName)) { + deserializedHealthCheck.interval = reader.getNullable(JsonReader::getInt); + } else if ("retries".equals(fieldName)) { + deserializedHealthCheck.retries = reader.getNullable(JsonReader::getInt); + } else if ("startPeriod".equals(fieldName)) { + deserializedHealthCheck.startPeriod = reader.getNullable(JsonReader::getInt); + } else if ("timeout".equals(fieldName)) { + deserializedHealthCheck.timeout = reader.getNullable(JsonReader::getInt); + } else { + reader.skipChildren(); + } + } + + return deserializedHealthCheck; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/HibernationOptions.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/HibernationOptions.java new file mode 100644 index 000000000000..03a15503fe9e --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/HibernationOptions.java @@ -0,0 +1,96 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of HibernationOptions. + */ +@Fluent +public final class HibernationOptions implements JsonSerializable { + /* + *

If true, your instance is enabled for hibernation; otherwise, it is not enabled for + * hibernation.

+ */ + private Boolean configured; + + /** + * Creates an instance of HibernationOptions class. + */ + public HibernationOptions() { + } + + /** + * Get the configured property: <p>If <code>true</code>, your instance is enabled for hibernation; + * otherwise, it is not enabled for hibernation.</p>. + * + * @return the configured value. + */ + public Boolean configured() { + return this.configured; + } + + /** + * Set the configured property: <p>If <code>true</code>, your instance is enabled for hibernation; + * otherwise, it is not enabled for hibernation.</p>. + * + * @param configured the configured value to set. + * @return the HibernationOptions object itself. + */ + public HibernationOptions withConfigured(Boolean configured) { + this.configured = configured; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeBooleanField("configured", this.configured); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of HibernationOptions from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of HibernationOptions if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the HibernationOptions. + */ + public static HibernationOptions fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + HibernationOptions deserializedHibernationOptions = new HibernationOptions(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("configured".equals(fieldName)) { + deserializedHibernationOptions.configured = reader.getNullable(JsonReader::getBoolean); + } else { + reader.skipChildren(); + } + } + + return deserializedHibernationOptions; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/HostEntry.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/HostEntry.java new file mode 100644 index 000000000000..44e42e421a49 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/HostEntry.java @@ -0,0 +1,121 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of HostEntry. + */ +@Fluent +public final class HostEntry implements JsonSerializable { + /* + * The hostname to use in the ``/etc/hosts`` entry. + */ + private String hostname; + + /* + * The IP address to use in the ``/etc/hosts`` entry. + */ + private String ipAddress; + + /** + * Creates an instance of HostEntry class. + */ + public HostEntry() { + } + + /** + * Get the hostname property: The hostname to use in the ``/etc/hosts`` entry. + * + * @return the hostname value. + */ + public String hostname() { + return this.hostname; + } + + /** + * Set the hostname property: The hostname to use in the ``/etc/hosts`` entry. + * + * @param hostname the hostname value to set. + * @return the HostEntry object itself. + */ + public HostEntry withHostname(String hostname) { + this.hostname = hostname; + return this; + } + + /** + * Get the ipAddress property: The IP address to use in the ``/etc/hosts`` entry. + * + * @return the ipAddress value. + */ + public String ipAddress() { + return this.ipAddress; + } + + /** + * Set the ipAddress property: The IP address to use in the ``/etc/hosts`` entry. + * + * @param ipAddress the ipAddress value to set. + * @return the HostEntry object itself. + */ + public HostEntry withIpAddress(String ipAddress) { + this.ipAddress = ipAddress; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("hostname", this.hostname); + jsonWriter.writeStringField("ipAddress", this.ipAddress); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of HostEntry from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of HostEntry if the JsonReader was pointing to an instance of it, or null if it was pointing + * to JSON null. + * @throws IOException If an error occurs while reading the HostEntry. + */ + public static HostEntry fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + HostEntry deserializedHostEntry = new HostEntry(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("hostname".equals(fieldName)) { + deserializedHostEntry.hostname = reader.getString(); + } else if ("ipAddress".equals(fieldName)) { + deserializedHostEntry.ipAddress = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedHostEntry; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/HostVolumeProperties.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/HostVolumeProperties.java new file mode 100644 index 000000000000..f80eea1cf766 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/HostVolumeProperties.java @@ -0,0 +1,111 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of HostVolumeProperties. + */ +@Fluent +public final class HostVolumeProperties implements JsonSerializable { + /* + * When the ``host`` parameter is used, specify a ``sourcePath`` to declare the path on the host container instance + * that's presented to the container. If this parameter is empty, then the Docker daemon has assigned a host path + * for you. If the ``host`` parameter contains a ``sourcePath`` file location, then the data volume persists at the + * specified location on the host container instance until you delete it manually. If the ``sourcePath`` value + * doesn't exist on the host container instance, the Docker daemon creates it. If the location does exist, the + * contents of the source path folder are exported. If you're using the Fargate launch type, the ``sourcePath`` + * parameter is not supported. + */ + private String sourcePath; + + /** + * Creates an instance of HostVolumeProperties class. + */ + public HostVolumeProperties() { + } + + /** + * Get the sourcePath property: When the ``host`` parameter is used, specify a ``sourcePath`` to declare the path on + * the host container instance that's presented to the container. If this parameter is empty, then the Docker daemon + * has assigned a host path for you. If the ``host`` parameter contains a ``sourcePath`` file location, then the + * data volume persists at the specified location on the host container instance until you delete it manually. If + * the ``sourcePath`` value doesn't exist on the host container instance, the Docker daemon creates it. If the + * location does exist, the contents of the source path folder are exported. If you're using the Fargate launch + * type, the ``sourcePath`` parameter is not supported. + * + * @return the sourcePath value. + */ + public String sourcePath() { + return this.sourcePath; + } + + /** + * Set the sourcePath property: When the ``host`` parameter is used, specify a ``sourcePath`` to declare the path on + * the host container instance that's presented to the container. If this parameter is empty, then the Docker daemon + * has assigned a host path for you. If the ``host`` parameter contains a ``sourcePath`` file location, then the + * data volume persists at the specified location on the host container instance until you delete it manually. If + * the ``sourcePath`` value doesn't exist on the host container instance, the Docker daemon creates it. If the + * location does exist, the contents of the source path folder are exported. If you're using the Fargate launch + * type, the ``sourcePath`` parameter is not supported. + * + * @param sourcePath the sourcePath value to set. + * @return the HostVolumeProperties object itself. + */ + public HostVolumeProperties withSourcePath(String sourcePath) { + this.sourcePath = sourcePath; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("sourcePath", this.sourcePath); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of HostVolumeProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of HostVolumeProperties if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the HostVolumeProperties. + */ + public static HostVolumeProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + HostVolumeProperties deserializedHostVolumeProperties = new HostVolumeProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("sourcePath".equals(fieldName)) { + deserializedHostVolumeProperties.sourcePath = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedHostVolumeProperties; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/HostedZoneConfig.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/HostedZoneConfig.java new file mode 100644 index 000000000000..409d8514f068 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/HostedZoneConfig.java @@ -0,0 +1,93 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of HostedZoneConfig. + */ +@Fluent +public final class HostedZoneConfig implements JsonSerializable { + /* + * Any comments that you want to include about the hosted zone. + */ + private String comment; + + /** + * Creates an instance of HostedZoneConfig class. + */ + public HostedZoneConfig() { + } + + /** + * Get the comment property: Any comments that you want to include about the hosted zone. + * + * @return the comment value. + */ + public String comment() { + return this.comment; + } + + /** + * Set the comment property: Any comments that you want to include about the hosted zone. + * + * @param comment the comment value to set. + * @return the HostedZoneConfig object itself. + */ + public HostedZoneConfig withComment(String comment) { + this.comment = comment; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("comment", this.comment); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of HostedZoneConfig from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of HostedZoneConfig if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the HostedZoneConfig. + */ + public static HostedZoneConfig fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + HostedZoneConfig deserializedHostedZoneConfig = new HostedZoneConfig(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("comment".equals(fieldName)) { + deserializedHostedZoneConfig.comment = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedHostedZoneConfig; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/HostedZoneTag.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/HostedZoneTag.java new file mode 100644 index 000000000000..b80d3f558887 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/HostedZoneTag.java @@ -0,0 +1,141 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of HostedZoneTag. + */ +@Fluent +public final class HostedZoneTag implements JsonSerializable { + /* + * The value of ``Key`` depends on the operation that you want to perform: + *Add a tag to a health check or hosted + * zone*: ``Key`` is the name that you want to give the new tag. + *Edit a tag*: ``Key`` is the name of the tag that + * you want to change the ``Value`` for. + *Delete a key*: ``Key`` is the name of the tag you want to remove. + + * *Give a name to a health check*: Edit the default ``Name`` tag. In the Amazon Route 53 console, the list of your + * health checks includes a *Name* column that lets you see the name that you've given to each health check. + */ + private String key; + + /* + * The value of ``Value`` depends on the operation that you want to perform: + *Add a tag to a health check or + * hosted zone*: ``Value`` is the value that you want to give the new tag. + *Edit a tag*: ``Value`` is the new + * value that you want to assign the tag. + */ + private String value; + + /** + * Creates an instance of HostedZoneTag class. + */ + public HostedZoneTag() { + } + + /** + * Get the key property: The value of ``Key`` depends on the operation that you want to perform: + *Add a tag to a + * health check or hosted zone*: ``Key`` is the name that you want to give the new tag. + *Edit a tag*: ``Key`` is + * the name of the tag that you want to change the ``Value`` for. + *Delete a key*: ``Key`` is the name of the tag + * you want to remove. + *Give a name to a health check*: Edit the default ``Name`` tag. In the Amazon Route 53 + * console, the list of your health checks includes a *Name* column that lets you see the name that you've given to + * each health check. + * + * @return the key value. + */ + public String key() { + return this.key; + } + + /** + * Set the key property: The value of ``Key`` depends on the operation that you want to perform: + *Add a tag to a + * health check or hosted zone*: ``Key`` is the name that you want to give the new tag. + *Edit a tag*: ``Key`` is + * the name of the tag that you want to change the ``Value`` for. + *Delete a key*: ``Key`` is the name of the tag + * you want to remove. + *Give a name to a health check*: Edit the default ``Name`` tag. In the Amazon Route 53 + * console, the list of your health checks includes a *Name* column that lets you see the name that you've given to + * each health check. + * + * @param key the key value to set. + * @return the HostedZoneTag object itself. + */ + public HostedZoneTag withKey(String key) { + this.key = key; + return this; + } + + /** + * Get the value property: The value of ``Value`` depends on the operation that you want to perform: + *Add a tag to + * a health check or hosted zone*: ``Value`` is the value that you want to give the new tag. + *Edit a tag*: + * ``Value`` is the new value that you want to assign the tag. + * + * @return the value value. + */ + public String value() { + return this.value; + } + + /** + * Set the value property: The value of ``Value`` depends on the operation that you want to perform: + *Add a tag to + * a health check or hosted zone*: ``Value`` is the value that you want to give the new tag. + *Edit a tag*: + * ``Value`` is the new value that you want to assign the tag. + * + * @param value the value value to set. + * @return the HostedZoneTag object itself. + */ + public HostedZoneTag withValue(String value) { + this.value = value; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("key", this.key); + jsonWriter.writeStringField("value", this.value); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of HostedZoneTag from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of HostedZoneTag if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the HostedZoneTag. + */ + public static HostedZoneTag fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + HostedZoneTag deserializedHostedZoneTag = new HostedZoneTag(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("key".equals(fieldName)) { + deserializedHostedZoneTag.key = reader.getString(); + } else if ("value".equals(fieldName)) { + deserializedHostedZoneTag.value = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedHostedZoneTag; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/HostnameType.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/HostnameType.java new file mode 100644 index 000000000000..d9808a974319 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/HostnameType.java @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * HostnameType enum. + */ +public final class HostnameType extends ExpandableStringEnum { + /** + * Static value ip-name for HostnameType. + */ + public static final HostnameType IP_NAME = fromString("ip-name"); + + /** + * Static value resource-name for HostnameType. + */ + public static final HostnameType RESOURCE_NAME = fromString("resource-name"); + + /** + * Creates a new instance of HostnameType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public HostnameType() { + } + + /** + * Creates or finds a HostnameType from its string representation. + * + * @param name a name to look for. + * @return the corresponding HostnameType. + */ + public static HostnameType fromString(String name) { + return fromString(name, HostnameType.class); + } + + /** + * Gets known HostnameType values. + * + * @return known HostnameType values. + */ + public static Collection values() { + return values(HostnameType.class); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/HostnameTypeEnumValue.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/HostnameTypeEnumValue.java new file mode 100644 index 000000000000..909ba6267d2d --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/HostnameTypeEnumValue.java @@ -0,0 +1,93 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of HostnameTypeEnumValue. + */ +@Fluent +public final class HostnameTypeEnumValue implements JsonSerializable { + /* + * Property value + */ + private HostnameType value; + + /** + * Creates an instance of HostnameTypeEnumValue class. + */ + public HostnameTypeEnumValue() { + } + + /** + * Get the value property: Property value. + * + * @return the value value. + */ + public HostnameType value() { + return this.value; + } + + /** + * Set the value property: Property value. + * + * @param value the value value to set. + * @return the HostnameTypeEnumValue object itself. + */ + public HostnameTypeEnumValue withValue(HostnameType value) { + this.value = value; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("value", this.value == null ? null : this.value.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of HostnameTypeEnumValue from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of HostnameTypeEnumValue if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the HostnameTypeEnumValue. + */ + public static HostnameTypeEnumValue fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + HostnameTypeEnumValue deserializedHostnameTypeEnumValue = new HostnameTypeEnumValue(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + deserializedHostnameTypeEnumValue.value = HostnameType.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedHostnameTypeEnumValue; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/HttpTokensState.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/HttpTokensState.java new file mode 100644 index 000000000000..71b40a0618b2 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/HttpTokensState.java @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * HttpTokensState enum. + */ +public final class HttpTokensState extends ExpandableStringEnum { + /** + * Static value optional for HttpTokensState. + */ + public static final HttpTokensState OPTIONAL = fromString("optional"); + + /** + * Static value required for HttpTokensState. + */ + public static final HttpTokensState REQUIRED = fromString("required"); + + /** + * Creates a new instance of HttpTokensState value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public HttpTokensState() { + } + + /** + * Creates or finds a HttpTokensState from its string representation. + * + * @param name a name to look for. + * @return the corresponding HttpTokensState. + */ + public static HttpTokensState fromString(String name) { + return fromString(name, HttpTokensState.class); + } + + /** + * Gets known HttpTokensState values. + * + * @return known HttpTokensState values. + */ + public static Collection values() { + return values(HttpTokensState.class); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/HttpTokensStateEnumValue.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/HttpTokensStateEnumValue.java new file mode 100644 index 000000000000..1d2caa0ebec9 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/HttpTokensStateEnumValue.java @@ -0,0 +1,93 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of HttpTokensStateEnumValue. + */ +@Fluent +public final class HttpTokensStateEnumValue implements JsonSerializable { + /* + * Property value + */ + private HttpTokensState value; + + /** + * Creates an instance of HttpTokensStateEnumValue class. + */ + public HttpTokensStateEnumValue() { + } + + /** + * Get the value property: Property value. + * + * @return the value value. + */ + public HttpTokensState value() { + return this.value; + } + + /** + * Set the value property: Property value. + * + * @param value the value value to set. + * @return the HttpTokensStateEnumValue object itself. + */ + public HttpTokensStateEnumValue withValue(HttpTokensState value) { + this.value = value; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("value", this.value == null ? null : this.value.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of HttpTokensStateEnumValue from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of HttpTokensStateEnumValue if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IOException If an error occurs while reading the HttpTokensStateEnumValue. + */ + public static HttpTokensStateEnumValue fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + HttpTokensStateEnumValue deserializedHttpTokensStateEnumValue = new HttpTokensStateEnumValue(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + deserializedHttpTokensStateEnumValue.value = HttpTokensState.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedHttpTokensStateEnumValue; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/HypervisorType.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/HypervisorType.java new file mode 100644 index 000000000000..5e2f01d6b33c --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/HypervisorType.java @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * HypervisorType enum. + */ +public final class HypervisorType extends ExpandableStringEnum { + /** + * Static value ovm for HypervisorType. + */ + public static final HypervisorType OVM = fromString("ovm"); + + /** + * Static value xen for HypervisorType. + */ + public static final HypervisorType XEN = fromString("xen"); + + /** + * Creates a new instance of HypervisorType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public HypervisorType() { + } + + /** + * Creates or finds a HypervisorType from its string representation. + * + * @param name a name to look for. + * @return the corresponding HypervisorType. + */ + public static HypervisorType fromString(String name) { + return fromString(name, HypervisorType.class); + } + + /** + * Gets known HypervisorType values. + * + * @return known HypervisorType values. + */ + public static Collection values() { + return values(HypervisorType.class); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/HypervisorTypeEnumValue.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/HypervisorTypeEnumValue.java new file mode 100644 index 000000000000..6f5b0beb1e60 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/HypervisorTypeEnumValue.java @@ -0,0 +1,93 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of HypervisorTypeEnumValue. + */ +@Fluent +public final class HypervisorTypeEnumValue implements JsonSerializable { + /* + * Property value + */ + private HypervisorType value; + + /** + * Creates an instance of HypervisorTypeEnumValue class. + */ + public HypervisorTypeEnumValue() { + } + + /** + * Get the value property: Property value. + * + * @return the value value. + */ + public HypervisorType value() { + return this.value; + } + + /** + * Set the value property: Property value. + * + * @param value the value value to set. + * @return the HypervisorTypeEnumValue object itself. + */ + public HypervisorTypeEnumValue withValue(HypervisorType value) { + this.value = value; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("value", this.value == null ? null : this.value.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of HypervisorTypeEnumValue from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of HypervisorTypeEnumValue if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the HypervisorTypeEnumValue. + */ + public static HypervisorTypeEnumValue fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + HypervisorTypeEnumValue deserializedHypervisorTypeEnumValue = new HypervisorTypeEnumValue(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + deserializedHypervisorTypeEnumValue.value = HypervisorType.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedHypervisorTypeEnumValue; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/IamAccessKeyLastUsed.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/IamAccessKeyLastUsed.java new file mode 100644 index 000000000000..808f44c9f826 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/IamAccessKeyLastUsed.java @@ -0,0 +1,252 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.awsconnector.fluent.models.IamAccessKeyLastUsedInner; +import java.util.Map; + +/** + * An immutable client-side representation of IamAccessKeyLastUsed. + */ +public interface IamAccessKeyLastUsed { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the location property: The geo-location where the resource lives. + * + * @return the location value. + */ + String location(); + + /** + * Gets the tags property: Resource tags. + * + * @return the tags value. + */ + Map tags(); + + /** + * Gets the properties property: The resource-specific properties for this resource. + * + * @return the properties value. + */ + IamAccessKeyLastUsedProperties properties(); + + /** + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the region of the resource. + * + * @return the region of the resource. + */ + Region region(); + + /** + * Gets the name of the resource region. + * + * @return the name of the resource region. + */ + String regionName(); + + /** + * Gets the name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + + /** + * Gets the inner com.azure.resourcemanager.awsconnector.fluent.models.IamAccessKeyLastUsedInner object. + * + * @return the inner object. + */ + IamAccessKeyLastUsedInner innerModel(); + + /** + * The entirety of the IamAccessKeyLastUsed definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithLocation, + DefinitionStages.WithResourceGroup, DefinitionStages.WithCreate { + } + + /** + * The IamAccessKeyLastUsed definition stages. + */ + interface DefinitionStages { + /** + * The first stage of the IamAccessKeyLastUsed definition. + */ + interface Blank extends WithLocation { + } + + /** + * The stage of the IamAccessKeyLastUsed definition allowing to specify location. + */ + interface WithLocation { + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithResourceGroup withRegion(Region location); + + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithResourceGroup withRegion(String location); + } + + /** + * The stage of the IamAccessKeyLastUsed definition allowing to specify parent resource. + */ + interface WithResourceGroup { + /** + * Specifies resourceGroupName. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @return the next definition stage. + */ + WithCreate withExistingResourceGroup(String resourceGroupName); + } + + /** + * The stage of the IamAccessKeyLastUsed 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.WithProperties { + /** + * Executes the create request. + * + * @return the created resource. + */ + IamAccessKeyLastUsed create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + IamAccessKeyLastUsed create(Context context); + } + + /** + * The stage of the IamAccessKeyLastUsed definition allowing to specify tags. + */ + interface WithTags { + /** + * Specifies the tags property: Resource tags.. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + WithCreate withTags(Map tags); + } + + /** + * The stage of the IamAccessKeyLastUsed definition allowing to specify properties. + */ + interface WithProperties { + /** + * Specifies the properties property: The resource-specific properties for this resource.. + * + * @param properties The resource-specific properties for this resource. + * @return the next definition stage. + */ + WithCreate withProperties(IamAccessKeyLastUsedProperties properties); + } + } + + /** + * Begins update for the IamAccessKeyLastUsed resource. + * + * @return the stage of resource update. + */ + IamAccessKeyLastUsed.Update update(); + + /** + * The template for IamAccessKeyLastUsed update. + */ + interface Update extends UpdateStages.WithTags { + /** + * Executes the update request. + * + * @return the updated resource. + */ + IamAccessKeyLastUsed apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + IamAccessKeyLastUsed apply(Context context); + } + + /** + * The IamAccessKeyLastUsed update stages. + */ + interface UpdateStages { + /** + * The stage of the IamAccessKeyLastUsed update allowing to specify tags. + */ + interface WithTags { + /** + * Specifies the tags property: Resource tags.. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + Update withTags(Map tags); + } + } + + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + IamAccessKeyLastUsed refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + IamAccessKeyLastUsed refresh(Context context); +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/IamAccessKeyLastUsedListResult.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/IamAccessKeyLastUsedListResult.java new file mode 100644 index 000000000000..5bab4ed54e9c --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/IamAccessKeyLastUsedListResult.java @@ -0,0 +1,137 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.awsconnector.fluent.models.IamAccessKeyLastUsedInner; +import java.io.IOException; +import java.util.List; + +/** + * The response of a IamAccessKeyLastUsed list operation. + */ +@Fluent +public final class IamAccessKeyLastUsedListResult implements JsonSerializable { + /* + * The IamAccessKeyLastUsed items on this page + */ + private List value; + + /* + * The link to the next page of items + */ + private String nextLink; + + /** + * Creates an instance of IamAccessKeyLastUsedListResult class. + */ + public IamAccessKeyLastUsedListResult() { + } + + /** + * Get the value property: The IamAccessKeyLastUsed items on this page. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The IamAccessKeyLastUsed items on this page. + * + * @param value the value value to set. + * @return the IamAccessKeyLastUsedListResult object itself. + */ + public IamAccessKeyLastUsedListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The link to the next page of items. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: The link to the next page of items. + * + * @param nextLink the nextLink value to set. + * @return the IamAccessKeyLastUsedListResult object itself. + */ + public IamAccessKeyLastUsedListResult withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property value in model IamAccessKeyLastUsedListResult")); + } else { + value().forEach(e -> e.validate()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(IamAccessKeyLastUsedListResult.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("nextLink", this.nextLink); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of IamAccessKeyLastUsedListResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of IamAccessKeyLastUsedListResult if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the IamAccessKeyLastUsedListResult. + */ + public static IamAccessKeyLastUsedListResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + IamAccessKeyLastUsedListResult deserializedIamAccessKeyLastUsedListResult + = new IamAccessKeyLastUsedListResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> IamAccessKeyLastUsedInner.fromJson(reader1)); + deserializedIamAccessKeyLastUsedListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedIamAccessKeyLastUsedListResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedIamAccessKeyLastUsedListResult; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/IamAccessKeyLastUsedProperties.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/IamAccessKeyLastUsedProperties.java new file mode 100644 index 000000000000..c932a60279df --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/IamAccessKeyLastUsedProperties.java @@ -0,0 +1,313 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.Map; + +/** + * Definition of IamAccessKeyLastUsed. + */ +@Fluent +public final class IamAccessKeyLastUsedProperties implements JsonSerializable { + /* + * AWS Properties + */ + private AwsIamAccessKeyLastUsedProperties awsProperties; + + /* + * Public Cloud Connectors Resource ID + */ + private String publicCloudConnectorsResourceId; + + /* + * AWS Account ID + */ + private String awsAccountId; + + /* + * Amazon Resource Name (ARN) + */ + private String arn; + + /* + * Public Cloud Resource Name + */ + private String publicCloudResourceName; + + /* + * AWS Source Schema + */ + private String awsSourceSchema; + + /* + * AWS Region + */ + private String awsRegion; + + /* + * AWS Tags + */ + private Map awsTags; + + /* + * The status of the last operation. + */ + private ProvisioningState provisioningState; + + /** + * Creates an instance of IamAccessKeyLastUsedProperties class. + */ + public IamAccessKeyLastUsedProperties() { + } + + /** + * Get the awsProperties property: AWS Properties. + * + * @return the awsProperties value. + */ + public AwsIamAccessKeyLastUsedProperties awsProperties() { + return this.awsProperties; + } + + /** + * Set the awsProperties property: AWS Properties. + * + * @param awsProperties the awsProperties value to set. + * @return the IamAccessKeyLastUsedProperties object itself. + */ + public IamAccessKeyLastUsedProperties withAwsProperties(AwsIamAccessKeyLastUsedProperties awsProperties) { + this.awsProperties = awsProperties; + return this; + } + + /** + * Get the publicCloudConnectorsResourceId property: Public Cloud Connectors Resource ID. + * + * @return the publicCloudConnectorsResourceId value. + */ + public String publicCloudConnectorsResourceId() { + return this.publicCloudConnectorsResourceId; + } + + /** + * Set the publicCloudConnectorsResourceId property: Public Cloud Connectors Resource ID. + * + * @param publicCloudConnectorsResourceId the publicCloudConnectorsResourceId value to set. + * @return the IamAccessKeyLastUsedProperties object itself. + */ + public IamAccessKeyLastUsedProperties withPublicCloudConnectorsResourceId(String publicCloudConnectorsResourceId) { + this.publicCloudConnectorsResourceId = publicCloudConnectorsResourceId; + return this; + } + + /** + * Get the awsAccountId property: AWS Account ID. + * + * @return the awsAccountId value. + */ + public String awsAccountId() { + return this.awsAccountId; + } + + /** + * Set the awsAccountId property: AWS Account ID. + * + * @param awsAccountId the awsAccountId value to set. + * @return the IamAccessKeyLastUsedProperties object itself. + */ + public IamAccessKeyLastUsedProperties withAwsAccountId(String awsAccountId) { + this.awsAccountId = awsAccountId; + return this; + } + + /** + * Get the arn property: Amazon Resource Name (ARN). + * + * @return the arn value. + */ + public String arn() { + return this.arn; + } + + /** + * Set the arn property: Amazon Resource Name (ARN). + * + * @param arn the arn value to set. + * @return the IamAccessKeyLastUsedProperties object itself. + */ + public IamAccessKeyLastUsedProperties withArn(String arn) { + this.arn = arn; + return this; + } + + /** + * Get the publicCloudResourceName property: Public Cloud Resource Name. + * + * @return the publicCloudResourceName value. + */ + public String publicCloudResourceName() { + return this.publicCloudResourceName; + } + + /** + * Set the publicCloudResourceName property: Public Cloud Resource Name. + * + * @param publicCloudResourceName the publicCloudResourceName value to set. + * @return the IamAccessKeyLastUsedProperties object itself. + */ + public IamAccessKeyLastUsedProperties withPublicCloudResourceName(String publicCloudResourceName) { + this.publicCloudResourceName = publicCloudResourceName; + return this; + } + + /** + * Get the awsSourceSchema property: AWS Source Schema. + * + * @return the awsSourceSchema value. + */ + public String awsSourceSchema() { + return this.awsSourceSchema; + } + + /** + * Set the awsSourceSchema property: AWS Source Schema. + * + * @param awsSourceSchema the awsSourceSchema value to set. + * @return the IamAccessKeyLastUsedProperties object itself. + */ + public IamAccessKeyLastUsedProperties withAwsSourceSchema(String awsSourceSchema) { + this.awsSourceSchema = awsSourceSchema; + return this; + } + + /** + * Get the awsRegion property: AWS Region. + * + * @return the awsRegion value. + */ + public String awsRegion() { + return this.awsRegion; + } + + /** + * Set the awsRegion property: AWS Region. + * + * @param awsRegion the awsRegion value to set. + * @return the IamAccessKeyLastUsedProperties object itself. + */ + public IamAccessKeyLastUsedProperties withAwsRegion(String awsRegion) { + this.awsRegion = awsRegion; + return this; + } + + /** + * Get the awsTags property: AWS Tags. + * + * @return the awsTags value. + */ + public Map awsTags() { + return this.awsTags; + } + + /** + * Set the awsTags property: AWS Tags. + * + * @param awsTags the awsTags value to set. + * @return the IamAccessKeyLastUsedProperties object itself. + */ + public IamAccessKeyLastUsedProperties withAwsTags(Map awsTags) { + this.awsTags = awsTags; + return this; + } + + /** + * Get the provisioningState property: The status of the last operation. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (awsProperties() != null) { + awsProperties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("awsProperties", this.awsProperties); + jsonWriter.writeStringField("publicCloudConnectorsResourceId", this.publicCloudConnectorsResourceId); + jsonWriter.writeStringField("awsAccountId", this.awsAccountId); + jsonWriter.writeStringField("arn", this.arn); + jsonWriter.writeStringField("publicCloudResourceName", this.publicCloudResourceName); + jsonWriter.writeStringField("awsSourceSchema", this.awsSourceSchema); + jsonWriter.writeStringField("awsRegion", this.awsRegion); + jsonWriter.writeMapField("awsTags", this.awsTags, (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of IamAccessKeyLastUsedProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of IamAccessKeyLastUsedProperties if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the IamAccessKeyLastUsedProperties. + */ + public static IamAccessKeyLastUsedProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + IamAccessKeyLastUsedProperties deserializedIamAccessKeyLastUsedProperties + = new IamAccessKeyLastUsedProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("awsProperties".equals(fieldName)) { + deserializedIamAccessKeyLastUsedProperties.awsProperties + = AwsIamAccessKeyLastUsedProperties.fromJson(reader); + } else if ("publicCloudConnectorsResourceId".equals(fieldName)) { + deserializedIamAccessKeyLastUsedProperties.publicCloudConnectorsResourceId = reader.getString(); + } else if ("awsAccountId".equals(fieldName)) { + deserializedIamAccessKeyLastUsedProperties.awsAccountId = reader.getString(); + } else if ("arn".equals(fieldName)) { + deserializedIamAccessKeyLastUsedProperties.arn = reader.getString(); + } else if ("publicCloudResourceName".equals(fieldName)) { + deserializedIamAccessKeyLastUsedProperties.publicCloudResourceName = reader.getString(); + } else if ("awsSourceSchema".equals(fieldName)) { + deserializedIamAccessKeyLastUsedProperties.awsSourceSchema = reader.getString(); + } else if ("awsRegion".equals(fieldName)) { + deserializedIamAccessKeyLastUsedProperties.awsRegion = reader.getString(); + } else if ("awsTags".equals(fieldName)) { + Map awsTags = reader.readMap(reader1 -> reader1.getString()); + deserializedIamAccessKeyLastUsedProperties.awsTags = awsTags; + } else if ("provisioningState".equals(fieldName)) { + deserializedIamAccessKeyLastUsedProperties.provisioningState + = ProvisioningState.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedIamAccessKeyLastUsedProperties; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/IamAccessKeyLastUsedTagsUpdate.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/IamAccessKeyLastUsedTagsUpdate.java new file mode 100644 index 000000000000..3ed6110ac403 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/IamAccessKeyLastUsedTagsUpdate.java @@ -0,0 +1,96 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.Map; + +/** + * The type used for updating tags in IamAccessKeyLastUsed resources. + */ +@Fluent +public final class IamAccessKeyLastUsedTagsUpdate implements JsonSerializable { + /* + * Resource tags. + */ + private Map tags; + + /** + * Creates an instance of IamAccessKeyLastUsedTagsUpdate class. + */ + public IamAccessKeyLastUsedTagsUpdate() { + } + + /** + * Get the tags property: Resource tags. + * + * @return the tags value. + */ + public Map tags() { + return this.tags; + } + + /** + * Set the tags property: Resource tags. + * + * @param tags the tags value to set. + * @return the IamAccessKeyLastUsedTagsUpdate object itself. + */ + public IamAccessKeyLastUsedTagsUpdate withTags(Map tags) { + this.tags = tags; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeMapField("tags", this.tags, (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of IamAccessKeyLastUsedTagsUpdate from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of IamAccessKeyLastUsedTagsUpdate if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the IamAccessKeyLastUsedTagsUpdate. + */ + public static IamAccessKeyLastUsedTagsUpdate fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + IamAccessKeyLastUsedTagsUpdate deserializedIamAccessKeyLastUsedTagsUpdate + = new IamAccessKeyLastUsedTagsUpdate(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedIamAccessKeyLastUsedTagsUpdate.tags = tags; + } else { + reader.skipChildren(); + } + } + + return deserializedIamAccessKeyLastUsedTagsUpdate; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/IamAccessKeyLastUseds.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/IamAccessKeyLastUseds.java new file mode 100644 index 000000000000..4fe6504f978f --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/IamAccessKeyLastUseds.java @@ -0,0 +1,158 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** + * Resource collection API of IamAccessKeyLastUseds. + */ +public interface IamAccessKeyLastUseds { + /** + * List IamAccessKeyLastUsed resources by subscription ID. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a IamAccessKeyLastUsed list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable list(); + + /** + * List IamAccessKeyLastUsed resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a IamAccessKeyLastUsed list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable list(Context context); + + /** + * List IamAccessKeyLastUsed resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a IamAccessKeyLastUsed list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * List IamAccessKeyLastUsed resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a IamAccessKeyLastUsed list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Get a IamAccessKeyLastUsed. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of IamAccessKeyLastUsed. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a IamAccessKeyLastUsed along with {@link Response}. + */ + Response getByResourceGroupWithResponse(String resourceGroupName, String name, + Context context); + + /** + * Get a IamAccessKeyLastUsed. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of IamAccessKeyLastUsed. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a IamAccessKeyLastUsed. + */ + IamAccessKeyLastUsed getByResourceGroup(String resourceGroupName, String name); + + /** + * Delete a IamAccessKeyLastUsed. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of IamAccessKeyLastUsed. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByResourceGroup(String resourceGroupName, String name); + + /** + * Delete a IamAccessKeyLastUsed. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of IamAccessKeyLastUsed. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String name, Context context); + + /** + * Get a IamAccessKeyLastUsed. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a IamAccessKeyLastUsed along with {@link Response}. + */ + IamAccessKeyLastUsed getById(String id); + + /** + * Get a IamAccessKeyLastUsed. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a IamAccessKeyLastUsed along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Delete a IamAccessKeyLastUsed. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteById(String id); + + /** + * Delete a IamAccessKeyLastUsed. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new IamAccessKeyLastUsed resource. + * + * @param name resource name. + * @return the first stage of the new IamAccessKeyLastUsed definition. + */ + IamAccessKeyLastUsed.DefinitionStages.Blank define(String name); +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/IamAccessKeyMetadata.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/IamAccessKeyMetadata.java new file mode 100644 index 000000000000..bbc5691a0205 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/IamAccessKeyMetadata.java @@ -0,0 +1,252 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.awsconnector.fluent.models.IamAccessKeyMetadataInner; +import java.util.Map; + +/** + * An immutable client-side representation of IamAccessKeyMetadata. + */ +public interface IamAccessKeyMetadata { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the location property: The geo-location where the resource lives. + * + * @return the location value. + */ + String location(); + + /** + * Gets the tags property: Resource tags. + * + * @return the tags value. + */ + Map tags(); + + /** + * Gets the properties property: The resource-specific properties for this resource. + * + * @return the properties value. + */ + IamAccessKeyMetadataProperties properties(); + + /** + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the region of the resource. + * + * @return the region of the resource. + */ + Region region(); + + /** + * Gets the name of the resource region. + * + * @return the name of the resource region. + */ + String regionName(); + + /** + * Gets the name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + + /** + * Gets the inner com.azure.resourcemanager.awsconnector.fluent.models.IamAccessKeyMetadataInner object. + * + * @return the inner object. + */ + IamAccessKeyMetadataInner innerModel(); + + /** + * The entirety of the IamAccessKeyMetadata definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithLocation, + DefinitionStages.WithResourceGroup, DefinitionStages.WithCreate { + } + + /** + * The IamAccessKeyMetadata definition stages. + */ + interface DefinitionStages { + /** + * The first stage of the IamAccessKeyMetadata definition. + */ + interface Blank extends WithLocation { + } + + /** + * The stage of the IamAccessKeyMetadata definition allowing to specify location. + */ + interface WithLocation { + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithResourceGroup withRegion(Region location); + + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithResourceGroup withRegion(String location); + } + + /** + * The stage of the IamAccessKeyMetadata definition allowing to specify parent resource. + */ + interface WithResourceGroup { + /** + * Specifies resourceGroupName. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @return the next definition stage. + */ + WithCreate withExistingResourceGroup(String resourceGroupName); + } + + /** + * The stage of the IamAccessKeyMetadata 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.WithProperties { + /** + * Executes the create request. + * + * @return the created resource. + */ + IamAccessKeyMetadata create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + IamAccessKeyMetadata create(Context context); + } + + /** + * The stage of the IamAccessKeyMetadata definition allowing to specify tags. + */ + interface WithTags { + /** + * Specifies the tags property: Resource tags.. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + WithCreate withTags(Map tags); + } + + /** + * The stage of the IamAccessKeyMetadata definition allowing to specify properties. + */ + interface WithProperties { + /** + * Specifies the properties property: The resource-specific properties for this resource.. + * + * @param properties The resource-specific properties for this resource. + * @return the next definition stage. + */ + WithCreate withProperties(IamAccessKeyMetadataProperties properties); + } + } + + /** + * Begins update for the IamAccessKeyMetadata resource. + * + * @return the stage of resource update. + */ + IamAccessKeyMetadata.Update update(); + + /** + * The template for IamAccessKeyMetadata update. + */ + interface Update extends UpdateStages.WithTags { + /** + * Executes the update request. + * + * @return the updated resource. + */ + IamAccessKeyMetadata apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + IamAccessKeyMetadata apply(Context context); + } + + /** + * The IamAccessKeyMetadata update stages. + */ + interface UpdateStages { + /** + * The stage of the IamAccessKeyMetadata update allowing to specify tags. + */ + interface WithTags { + /** + * Specifies the tags property: Resource tags.. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + Update withTags(Map tags); + } + } + + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + IamAccessKeyMetadata refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + IamAccessKeyMetadata refresh(Context context); +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/IamAccessKeyMetadataInfoes.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/IamAccessKeyMetadataInfoes.java new file mode 100644 index 000000000000..fff7b610bbf9 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/IamAccessKeyMetadataInfoes.java @@ -0,0 +1,158 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** + * Resource collection API of IamAccessKeyMetadataInfoes. + */ +public interface IamAccessKeyMetadataInfoes { + /** + * List IamAccessKeyMetadata resources by subscription ID. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a IamAccessKeyMetadata list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable list(); + + /** + * List IamAccessKeyMetadata resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a IamAccessKeyMetadata list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable list(Context context); + + /** + * List IamAccessKeyMetadata resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a IamAccessKeyMetadata list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * List IamAccessKeyMetadata resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a IamAccessKeyMetadata list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Get a IamAccessKeyMetadata. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of IamAccessKeyMetadata. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a IamAccessKeyMetadata along with {@link Response}. + */ + Response getByResourceGroupWithResponse(String resourceGroupName, String name, + Context context); + + /** + * Get a IamAccessKeyMetadata. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of IamAccessKeyMetadata. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a IamAccessKeyMetadata. + */ + IamAccessKeyMetadata getByResourceGroup(String resourceGroupName, String name); + + /** + * Delete a IamAccessKeyMetadata. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of IamAccessKeyMetadata. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByResourceGroup(String resourceGroupName, String name); + + /** + * Delete a IamAccessKeyMetadata. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of IamAccessKeyMetadata. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String name, Context context); + + /** + * Get a IamAccessKeyMetadata. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a IamAccessKeyMetadata along with {@link Response}. + */ + IamAccessKeyMetadata getById(String id); + + /** + * Get a IamAccessKeyMetadata. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a IamAccessKeyMetadata along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Delete a IamAccessKeyMetadata. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteById(String id); + + /** + * Delete a IamAccessKeyMetadata. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new IamAccessKeyMetadata resource. + * + * @param name resource name. + * @return the first stage of the new IamAccessKeyMetadata definition. + */ + IamAccessKeyMetadata.DefinitionStages.Blank define(String name); +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/IamAccessKeyMetadataListResult.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/IamAccessKeyMetadataListResult.java new file mode 100644 index 000000000000..3b60efa64fda --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/IamAccessKeyMetadataListResult.java @@ -0,0 +1,137 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.awsconnector.fluent.models.IamAccessKeyMetadataInner; +import java.io.IOException; +import java.util.List; + +/** + * The response of a IamAccessKeyMetadata list operation. + */ +@Fluent +public final class IamAccessKeyMetadataListResult implements JsonSerializable { + /* + * The IamAccessKeyMetadata items on this page + */ + private List value; + + /* + * The link to the next page of items + */ + private String nextLink; + + /** + * Creates an instance of IamAccessKeyMetadataListResult class. + */ + public IamAccessKeyMetadataListResult() { + } + + /** + * Get the value property: The IamAccessKeyMetadata items on this page. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The IamAccessKeyMetadata items on this page. + * + * @param value the value value to set. + * @return the IamAccessKeyMetadataListResult object itself. + */ + public IamAccessKeyMetadataListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The link to the next page of items. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: The link to the next page of items. + * + * @param nextLink the nextLink value to set. + * @return the IamAccessKeyMetadataListResult object itself. + */ + public IamAccessKeyMetadataListResult withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property value in model IamAccessKeyMetadataListResult")); + } else { + value().forEach(e -> e.validate()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(IamAccessKeyMetadataListResult.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("nextLink", this.nextLink); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of IamAccessKeyMetadataListResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of IamAccessKeyMetadataListResult if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the IamAccessKeyMetadataListResult. + */ + public static IamAccessKeyMetadataListResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + IamAccessKeyMetadataListResult deserializedIamAccessKeyMetadataListResult + = new IamAccessKeyMetadataListResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> IamAccessKeyMetadataInner.fromJson(reader1)); + deserializedIamAccessKeyMetadataListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedIamAccessKeyMetadataListResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedIamAccessKeyMetadataListResult; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/IamAccessKeyMetadataProperties.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/IamAccessKeyMetadataProperties.java new file mode 100644 index 000000000000..7635b5712aaa --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/IamAccessKeyMetadataProperties.java @@ -0,0 +1,313 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.Map; + +/** + * Definition of IamAccessKeyMetadata. + */ +@Fluent +public final class IamAccessKeyMetadataProperties implements JsonSerializable { + /* + * AWS Properties + */ + private AwsIamAccessKeyMetadataProperties awsProperties; + + /* + * Public Cloud Connectors Resource ID + */ + private String publicCloudConnectorsResourceId; + + /* + * AWS Account ID + */ + private String awsAccountId; + + /* + * Amazon Resource Name (ARN) + */ + private String arn; + + /* + * Public Cloud Resource Name + */ + private String publicCloudResourceName; + + /* + * AWS Source Schema + */ + private String awsSourceSchema; + + /* + * AWS Region + */ + private String awsRegion; + + /* + * AWS Tags + */ + private Map awsTags; + + /* + * The status of the last operation. + */ + private ProvisioningState provisioningState; + + /** + * Creates an instance of IamAccessKeyMetadataProperties class. + */ + public IamAccessKeyMetadataProperties() { + } + + /** + * Get the awsProperties property: AWS Properties. + * + * @return the awsProperties value. + */ + public AwsIamAccessKeyMetadataProperties awsProperties() { + return this.awsProperties; + } + + /** + * Set the awsProperties property: AWS Properties. + * + * @param awsProperties the awsProperties value to set. + * @return the IamAccessKeyMetadataProperties object itself. + */ + public IamAccessKeyMetadataProperties withAwsProperties(AwsIamAccessKeyMetadataProperties awsProperties) { + this.awsProperties = awsProperties; + return this; + } + + /** + * Get the publicCloudConnectorsResourceId property: Public Cloud Connectors Resource ID. + * + * @return the publicCloudConnectorsResourceId value. + */ + public String publicCloudConnectorsResourceId() { + return this.publicCloudConnectorsResourceId; + } + + /** + * Set the publicCloudConnectorsResourceId property: Public Cloud Connectors Resource ID. + * + * @param publicCloudConnectorsResourceId the publicCloudConnectorsResourceId value to set. + * @return the IamAccessKeyMetadataProperties object itself. + */ + public IamAccessKeyMetadataProperties withPublicCloudConnectorsResourceId(String publicCloudConnectorsResourceId) { + this.publicCloudConnectorsResourceId = publicCloudConnectorsResourceId; + return this; + } + + /** + * Get the awsAccountId property: AWS Account ID. + * + * @return the awsAccountId value. + */ + public String awsAccountId() { + return this.awsAccountId; + } + + /** + * Set the awsAccountId property: AWS Account ID. + * + * @param awsAccountId the awsAccountId value to set. + * @return the IamAccessKeyMetadataProperties object itself. + */ + public IamAccessKeyMetadataProperties withAwsAccountId(String awsAccountId) { + this.awsAccountId = awsAccountId; + return this; + } + + /** + * Get the arn property: Amazon Resource Name (ARN). + * + * @return the arn value. + */ + public String arn() { + return this.arn; + } + + /** + * Set the arn property: Amazon Resource Name (ARN). + * + * @param arn the arn value to set. + * @return the IamAccessKeyMetadataProperties object itself. + */ + public IamAccessKeyMetadataProperties withArn(String arn) { + this.arn = arn; + return this; + } + + /** + * Get the publicCloudResourceName property: Public Cloud Resource Name. + * + * @return the publicCloudResourceName value. + */ + public String publicCloudResourceName() { + return this.publicCloudResourceName; + } + + /** + * Set the publicCloudResourceName property: Public Cloud Resource Name. + * + * @param publicCloudResourceName the publicCloudResourceName value to set. + * @return the IamAccessKeyMetadataProperties object itself. + */ + public IamAccessKeyMetadataProperties withPublicCloudResourceName(String publicCloudResourceName) { + this.publicCloudResourceName = publicCloudResourceName; + return this; + } + + /** + * Get the awsSourceSchema property: AWS Source Schema. + * + * @return the awsSourceSchema value. + */ + public String awsSourceSchema() { + return this.awsSourceSchema; + } + + /** + * Set the awsSourceSchema property: AWS Source Schema. + * + * @param awsSourceSchema the awsSourceSchema value to set. + * @return the IamAccessKeyMetadataProperties object itself. + */ + public IamAccessKeyMetadataProperties withAwsSourceSchema(String awsSourceSchema) { + this.awsSourceSchema = awsSourceSchema; + return this; + } + + /** + * Get the awsRegion property: AWS Region. + * + * @return the awsRegion value. + */ + public String awsRegion() { + return this.awsRegion; + } + + /** + * Set the awsRegion property: AWS Region. + * + * @param awsRegion the awsRegion value to set. + * @return the IamAccessKeyMetadataProperties object itself. + */ + public IamAccessKeyMetadataProperties withAwsRegion(String awsRegion) { + this.awsRegion = awsRegion; + return this; + } + + /** + * Get the awsTags property: AWS Tags. + * + * @return the awsTags value. + */ + public Map awsTags() { + return this.awsTags; + } + + /** + * Set the awsTags property: AWS Tags. + * + * @param awsTags the awsTags value to set. + * @return the IamAccessKeyMetadataProperties object itself. + */ + public IamAccessKeyMetadataProperties withAwsTags(Map awsTags) { + this.awsTags = awsTags; + return this; + } + + /** + * Get the provisioningState property: The status of the last operation. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (awsProperties() != null) { + awsProperties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("awsProperties", this.awsProperties); + jsonWriter.writeStringField("publicCloudConnectorsResourceId", this.publicCloudConnectorsResourceId); + jsonWriter.writeStringField("awsAccountId", this.awsAccountId); + jsonWriter.writeStringField("arn", this.arn); + jsonWriter.writeStringField("publicCloudResourceName", this.publicCloudResourceName); + jsonWriter.writeStringField("awsSourceSchema", this.awsSourceSchema); + jsonWriter.writeStringField("awsRegion", this.awsRegion); + jsonWriter.writeMapField("awsTags", this.awsTags, (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of IamAccessKeyMetadataProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of IamAccessKeyMetadataProperties if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the IamAccessKeyMetadataProperties. + */ + public static IamAccessKeyMetadataProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + IamAccessKeyMetadataProperties deserializedIamAccessKeyMetadataProperties + = new IamAccessKeyMetadataProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("awsProperties".equals(fieldName)) { + deserializedIamAccessKeyMetadataProperties.awsProperties + = AwsIamAccessKeyMetadataProperties.fromJson(reader); + } else if ("publicCloudConnectorsResourceId".equals(fieldName)) { + deserializedIamAccessKeyMetadataProperties.publicCloudConnectorsResourceId = reader.getString(); + } else if ("awsAccountId".equals(fieldName)) { + deserializedIamAccessKeyMetadataProperties.awsAccountId = reader.getString(); + } else if ("arn".equals(fieldName)) { + deserializedIamAccessKeyMetadataProperties.arn = reader.getString(); + } else if ("publicCloudResourceName".equals(fieldName)) { + deserializedIamAccessKeyMetadataProperties.publicCloudResourceName = reader.getString(); + } else if ("awsSourceSchema".equals(fieldName)) { + deserializedIamAccessKeyMetadataProperties.awsSourceSchema = reader.getString(); + } else if ("awsRegion".equals(fieldName)) { + deserializedIamAccessKeyMetadataProperties.awsRegion = reader.getString(); + } else if ("awsTags".equals(fieldName)) { + Map awsTags = reader.readMap(reader1 -> reader1.getString()); + deserializedIamAccessKeyMetadataProperties.awsTags = awsTags; + } else if ("provisioningState".equals(fieldName)) { + deserializedIamAccessKeyMetadataProperties.provisioningState + = ProvisioningState.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedIamAccessKeyMetadataProperties; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/IamAccessKeyMetadataTagsUpdate.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/IamAccessKeyMetadataTagsUpdate.java new file mode 100644 index 000000000000..e24d6b165d21 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/IamAccessKeyMetadataTagsUpdate.java @@ -0,0 +1,96 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.Map; + +/** + * The type used for updating tags in IamAccessKeyMetadata resources. + */ +@Fluent +public final class IamAccessKeyMetadataTagsUpdate implements JsonSerializable { + /* + * Resource tags. + */ + private Map tags; + + /** + * Creates an instance of IamAccessKeyMetadataTagsUpdate class. + */ + public IamAccessKeyMetadataTagsUpdate() { + } + + /** + * Get the tags property: Resource tags. + * + * @return the tags value. + */ + public Map tags() { + return this.tags; + } + + /** + * Set the tags property: Resource tags. + * + * @param tags the tags value to set. + * @return the IamAccessKeyMetadataTagsUpdate object itself. + */ + public IamAccessKeyMetadataTagsUpdate withTags(Map tags) { + this.tags = tags; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeMapField("tags", this.tags, (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of IamAccessKeyMetadataTagsUpdate from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of IamAccessKeyMetadataTagsUpdate if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the IamAccessKeyMetadataTagsUpdate. + */ + public static IamAccessKeyMetadataTagsUpdate fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + IamAccessKeyMetadataTagsUpdate deserializedIamAccessKeyMetadataTagsUpdate + = new IamAccessKeyMetadataTagsUpdate(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedIamAccessKeyMetadataTagsUpdate.tags = tags; + } else { + reader.skipChildren(); + } + } + + return deserializedIamAccessKeyMetadataTagsUpdate; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/IamGroup.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/IamGroup.java new file mode 100644 index 000000000000..946b5bbe2886 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/IamGroup.java @@ -0,0 +1,252 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.awsconnector.fluent.models.IamGroupInner; +import java.util.Map; + +/** + * An immutable client-side representation of IamGroup. + */ +public interface IamGroup { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the location property: The geo-location where the resource lives. + * + * @return the location value. + */ + String location(); + + /** + * Gets the tags property: Resource tags. + * + * @return the tags value. + */ + Map tags(); + + /** + * Gets the properties property: The resource-specific properties for this resource. + * + * @return the properties value. + */ + IamGroupProperties properties(); + + /** + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the region of the resource. + * + * @return the region of the resource. + */ + Region region(); + + /** + * Gets the name of the resource region. + * + * @return the name of the resource region. + */ + String regionName(); + + /** + * Gets the name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + + /** + * Gets the inner com.azure.resourcemanager.awsconnector.fluent.models.IamGroupInner object. + * + * @return the inner object. + */ + IamGroupInner innerModel(); + + /** + * The entirety of the IamGroup definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithLocation, + DefinitionStages.WithResourceGroup, DefinitionStages.WithCreate { + } + + /** + * The IamGroup definition stages. + */ + interface DefinitionStages { + /** + * The first stage of the IamGroup definition. + */ + interface Blank extends WithLocation { + } + + /** + * The stage of the IamGroup definition allowing to specify location. + */ + interface WithLocation { + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithResourceGroup withRegion(Region location); + + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithResourceGroup withRegion(String location); + } + + /** + * The stage of the IamGroup definition allowing to specify parent resource. + */ + interface WithResourceGroup { + /** + * Specifies resourceGroupName. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @return the next definition stage. + */ + WithCreate withExistingResourceGroup(String resourceGroupName); + } + + /** + * The stage of the IamGroup 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.WithProperties { + /** + * Executes the create request. + * + * @return the created resource. + */ + IamGroup create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + IamGroup create(Context context); + } + + /** + * The stage of the IamGroup definition allowing to specify tags. + */ + interface WithTags { + /** + * Specifies the tags property: Resource tags.. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + WithCreate withTags(Map tags); + } + + /** + * The stage of the IamGroup definition allowing to specify properties. + */ + interface WithProperties { + /** + * Specifies the properties property: The resource-specific properties for this resource.. + * + * @param properties The resource-specific properties for this resource. + * @return the next definition stage. + */ + WithCreate withProperties(IamGroupProperties properties); + } + } + + /** + * Begins update for the IamGroup resource. + * + * @return the stage of resource update. + */ + IamGroup.Update update(); + + /** + * The template for IamGroup update. + */ + interface Update extends UpdateStages.WithTags { + /** + * Executes the update request. + * + * @return the updated resource. + */ + IamGroup apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + IamGroup apply(Context context); + } + + /** + * The IamGroup update stages. + */ + interface UpdateStages { + /** + * The stage of the IamGroup update allowing to specify tags. + */ + interface WithTags { + /** + * Specifies the tags property: Resource tags.. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + Update withTags(Map tags); + } + } + + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + IamGroup refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + IamGroup refresh(Context context); +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/IamGroupListResult.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/IamGroupListResult.java new file mode 100644 index 000000000000..7db96bc062c6 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/IamGroupListResult.java @@ -0,0 +1,134 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.awsconnector.fluent.models.IamGroupInner; +import java.io.IOException; +import java.util.List; + +/** + * The response of a IamGroup list operation. + */ +@Fluent +public final class IamGroupListResult implements JsonSerializable { + /* + * The IamGroup items on this page + */ + private List value; + + /* + * The link to the next page of items + */ + private String nextLink; + + /** + * Creates an instance of IamGroupListResult class. + */ + public IamGroupListResult() { + } + + /** + * Get the value property: The IamGroup items on this page. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The IamGroup items on this page. + * + * @param value the value value to set. + * @return the IamGroupListResult object itself. + */ + public IamGroupListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The link to the next page of items. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: The link to the next page of items. + * + * @param nextLink the nextLink value to set. + * @return the IamGroupListResult object itself. + */ + public IamGroupListResult withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property value in model IamGroupListResult")); + } else { + value().forEach(e -> e.validate()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(IamGroupListResult.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("nextLink", this.nextLink); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of IamGroupListResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of IamGroupListResult if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the IamGroupListResult. + */ + public static IamGroupListResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + IamGroupListResult deserializedIamGroupListResult = new IamGroupListResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value = reader.readArray(reader1 -> IamGroupInner.fromJson(reader1)); + deserializedIamGroupListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedIamGroupListResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedIamGroupListResult; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/IamGroupProperties.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/IamGroupProperties.java new file mode 100644 index 000000000000..0e7a1e666843 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/IamGroupProperties.java @@ -0,0 +1,310 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.Map; + +/** + * Definition of IamGroup. + */ +@Fluent +public final class IamGroupProperties implements JsonSerializable { + /* + * AWS Properties + */ + private AwsIamGroupProperties awsProperties; + + /* + * Public Cloud Connectors Resource ID + */ + private String publicCloudConnectorsResourceId; + + /* + * AWS Account ID + */ + private String awsAccountId; + + /* + * Amazon Resource Name (ARN) + */ + private String arn; + + /* + * Public Cloud Resource Name + */ + private String publicCloudResourceName; + + /* + * AWS Source Schema + */ + private String awsSourceSchema; + + /* + * AWS Region + */ + private String awsRegion; + + /* + * AWS Tags + */ + private Map awsTags; + + /* + * The status of the last operation. + */ + private ProvisioningState provisioningState; + + /** + * Creates an instance of IamGroupProperties class. + */ + public IamGroupProperties() { + } + + /** + * Get the awsProperties property: AWS Properties. + * + * @return the awsProperties value. + */ + public AwsIamGroupProperties awsProperties() { + return this.awsProperties; + } + + /** + * Set the awsProperties property: AWS Properties. + * + * @param awsProperties the awsProperties value to set. + * @return the IamGroupProperties object itself. + */ + public IamGroupProperties withAwsProperties(AwsIamGroupProperties awsProperties) { + this.awsProperties = awsProperties; + return this; + } + + /** + * Get the publicCloudConnectorsResourceId property: Public Cloud Connectors Resource ID. + * + * @return the publicCloudConnectorsResourceId value. + */ + public String publicCloudConnectorsResourceId() { + return this.publicCloudConnectorsResourceId; + } + + /** + * Set the publicCloudConnectorsResourceId property: Public Cloud Connectors Resource ID. + * + * @param publicCloudConnectorsResourceId the publicCloudConnectorsResourceId value to set. + * @return the IamGroupProperties object itself. + */ + public IamGroupProperties withPublicCloudConnectorsResourceId(String publicCloudConnectorsResourceId) { + this.publicCloudConnectorsResourceId = publicCloudConnectorsResourceId; + return this; + } + + /** + * Get the awsAccountId property: AWS Account ID. + * + * @return the awsAccountId value. + */ + public String awsAccountId() { + return this.awsAccountId; + } + + /** + * Set the awsAccountId property: AWS Account ID. + * + * @param awsAccountId the awsAccountId value to set. + * @return the IamGroupProperties object itself. + */ + public IamGroupProperties withAwsAccountId(String awsAccountId) { + this.awsAccountId = awsAccountId; + return this; + } + + /** + * Get the arn property: Amazon Resource Name (ARN). + * + * @return the arn value. + */ + public String arn() { + return this.arn; + } + + /** + * Set the arn property: Amazon Resource Name (ARN). + * + * @param arn the arn value to set. + * @return the IamGroupProperties object itself. + */ + public IamGroupProperties withArn(String arn) { + this.arn = arn; + return this; + } + + /** + * Get the publicCloudResourceName property: Public Cloud Resource Name. + * + * @return the publicCloudResourceName value. + */ + public String publicCloudResourceName() { + return this.publicCloudResourceName; + } + + /** + * Set the publicCloudResourceName property: Public Cloud Resource Name. + * + * @param publicCloudResourceName the publicCloudResourceName value to set. + * @return the IamGroupProperties object itself. + */ + public IamGroupProperties withPublicCloudResourceName(String publicCloudResourceName) { + this.publicCloudResourceName = publicCloudResourceName; + return this; + } + + /** + * Get the awsSourceSchema property: AWS Source Schema. + * + * @return the awsSourceSchema value. + */ + public String awsSourceSchema() { + return this.awsSourceSchema; + } + + /** + * Set the awsSourceSchema property: AWS Source Schema. + * + * @param awsSourceSchema the awsSourceSchema value to set. + * @return the IamGroupProperties object itself. + */ + public IamGroupProperties withAwsSourceSchema(String awsSourceSchema) { + this.awsSourceSchema = awsSourceSchema; + return this; + } + + /** + * Get the awsRegion property: AWS Region. + * + * @return the awsRegion value. + */ + public String awsRegion() { + return this.awsRegion; + } + + /** + * Set the awsRegion property: AWS Region. + * + * @param awsRegion the awsRegion value to set. + * @return the IamGroupProperties object itself. + */ + public IamGroupProperties withAwsRegion(String awsRegion) { + this.awsRegion = awsRegion; + return this; + } + + /** + * Get the awsTags property: AWS Tags. + * + * @return the awsTags value. + */ + public Map awsTags() { + return this.awsTags; + } + + /** + * Set the awsTags property: AWS Tags. + * + * @param awsTags the awsTags value to set. + * @return the IamGroupProperties object itself. + */ + public IamGroupProperties withAwsTags(Map awsTags) { + this.awsTags = awsTags; + return this; + } + + /** + * Get the provisioningState property: The status of the last operation. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (awsProperties() != null) { + awsProperties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("awsProperties", this.awsProperties); + jsonWriter.writeStringField("publicCloudConnectorsResourceId", this.publicCloudConnectorsResourceId); + jsonWriter.writeStringField("awsAccountId", this.awsAccountId); + jsonWriter.writeStringField("arn", this.arn); + jsonWriter.writeStringField("publicCloudResourceName", this.publicCloudResourceName); + jsonWriter.writeStringField("awsSourceSchema", this.awsSourceSchema); + jsonWriter.writeStringField("awsRegion", this.awsRegion); + jsonWriter.writeMapField("awsTags", this.awsTags, (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of IamGroupProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of IamGroupProperties if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the IamGroupProperties. + */ + public static IamGroupProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + IamGroupProperties deserializedIamGroupProperties = new IamGroupProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("awsProperties".equals(fieldName)) { + deserializedIamGroupProperties.awsProperties = AwsIamGroupProperties.fromJson(reader); + } else if ("publicCloudConnectorsResourceId".equals(fieldName)) { + deserializedIamGroupProperties.publicCloudConnectorsResourceId = reader.getString(); + } else if ("awsAccountId".equals(fieldName)) { + deserializedIamGroupProperties.awsAccountId = reader.getString(); + } else if ("arn".equals(fieldName)) { + deserializedIamGroupProperties.arn = reader.getString(); + } else if ("publicCloudResourceName".equals(fieldName)) { + deserializedIamGroupProperties.publicCloudResourceName = reader.getString(); + } else if ("awsSourceSchema".equals(fieldName)) { + deserializedIamGroupProperties.awsSourceSchema = reader.getString(); + } else if ("awsRegion".equals(fieldName)) { + deserializedIamGroupProperties.awsRegion = reader.getString(); + } else if ("awsTags".equals(fieldName)) { + Map awsTags = reader.readMap(reader1 -> reader1.getString()); + deserializedIamGroupProperties.awsTags = awsTags; + } else if ("provisioningState".equals(fieldName)) { + deserializedIamGroupProperties.provisioningState = ProvisioningState.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedIamGroupProperties; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/IamGroupTagsUpdate.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/IamGroupTagsUpdate.java new file mode 100644 index 000000000000..d587afefcacb --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/IamGroupTagsUpdate.java @@ -0,0 +1,95 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.Map; + +/** + * The type used for updating tags in IamGroup resources. + */ +@Fluent +public final class IamGroupTagsUpdate implements JsonSerializable { + /* + * Resource tags. + */ + private Map tags; + + /** + * Creates an instance of IamGroupTagsUpdate class. + */ + public IamGroupTagsUpdate() { + } + + /** + * Get the tags property: Resource tags. + * + * @return the tags value. + */ + public Map tags() { + return this.tags; + } + + /** + * Set the tags property: Resource tags. + * + * @param tags the tags value to set. + * @return the IamGroupTagsUpdate object itself. + */ + public IamGroupTagsUpdate withTags(Map tags) { + this.tags = tags; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeMapField("tags", this.tags, (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of IamGroupTagsUpdate from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of IamGroupTagsUpdate if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the IamGroupTagsUpdate. + */ + public static IamGroupTagsUpdate fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + IamGroupTagsUpdate deserializedIamGroupTagsUpdate = new IamGroupTagsUpdate(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedIamGroupTagsUpdate.tags = tags; + } else { + reader.skipChildren(); + } + } + + return deserializedIamGroupTagsUpdate; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/IamGroups.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/IamGroups.java new file mode 100644 index 000000000000..8e30b35670fb --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/IamGroups.java @@ -0,0 +1,157 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** + * Resource collection API of IamGroups. + */ +public interface IamGroups { + /** + * List IamGroup resources by subscription ID. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a IamGroup list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable list(); + + /** + * List IamGroup resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a IamGroup list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable list(Context context); + + /** + * List IamGroup resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a IamGroup list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * List IamGroup resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a IamGroup list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Get a IamGroup. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of IamGroup. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a IamGroup along with {@link Response}. + */ + Response getByResourceGroupWithResponse(String resourceGroupName, String name, Context context); + + /** + * Get a IamGroup. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of IamGroup. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a IamGroup. + */ + IamGroup getByResourceGroup(String resourceGroupName, String name); + + /** + * Delete a IamGroup. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of IamGroup. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByResourceGroup(String resourceGroupName, String name); + + /** + * Delete a IamGroup. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of IamGroup. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String name, Context context); + + /** + * Get a IamGroup. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a IamGroup along with {@link Response}. + */ + IamGroup getById(String id); + + /** + * Get a IamGroup. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a IamGroup along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Delete a IamGroup. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteById(String id); + + /** + * Delete a IamGroup. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new IamGroup resource. + * + * @param name resource name. + * @return the first stage of the new IamGroup definition. + */ + IamGroup.DefinitionStages.Blank define(String name); +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/IamInstanceProfile.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/IamInstanceProfile.java new file mode 100644 index 000000000000..bbdcca765f14 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/IamInstanceProfile.java @@ -0,0 +1,121 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of IamInstanceProfile. + */ +@Fluent +public final class IamInstanceProfile implements JsonSerializable { + /* + *

The Amazon Resource Name (ARN) of the instance profile.

+ */ + private String arn; + + /* + *

The ID of the instance profile.

+ */ + private String id; + + /** + * Creates an instance of IamInstanceProfile class. + */ + public IamInstanceProfile() { + } + + /** + * Get the arn property: <p>The Amazon Resource Name (ARN) of the instance profile.</p>. + * + * @return the arn value. + */ + public String arn() { + return this.arn; + } + + /** + * Set the arn property: <p>The Amazon Resource Name (ARN) of the instance profile.</p>. + * + * @param arn the arn value to set. + * @return the IamInstanceProfile object itself. + */ + public IamInstanceProfile withArn(String arn) { + this.arn = arn; + return this; + } + + /** + * Get the id property: <p>The ID of the instance profile.</p>. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Set the id property: <p>The ID of the instance profile.</p>. + * + * @param id the id value to set. + * @return the IamInstanceProfile object itself. + */ + public IamInstanceProfile withId(String id) { + this.id = id; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("arn", this.arn); + jsonWriter.writeStringField("id", this.id); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of IamInstanceProfile from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of IamInstanceProfile if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the IamInstanceProfile. + */ + public static IamInstanceProfile fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + IamInstanceProfile deserializedIamInstanceProfile = new IamInstanceProfile(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("arn".equals(fieldName)) { + deserializedIamInstanceProfile.arn = reader.getString(); + } else if ("id".equals(fieldName)) { + deserializedIamInstanceProfile.id = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedIamInstanceProfile; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/IamInstanceProfileAutoGenerated.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/IamInstanceProfileAutoGenerated.java new file mode 100644 index 000000000000..2383b501139c --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/IamInstanceProfileAutoGenerated.java @@ -0,0 +1,252 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.awsconnector.fluent.models.IamInstanceProfileAutoGeneratedInner; +import java.util.Map; + +/** + * An immutable client-side representation of IamInstanceProfileAutoGenerated. + */ +public interface IamInstanceProfileAutoGenerated { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the location property: The geo-location where the resource lives. + * + * @return the location value. + */ + String location(); + + /** + * Gets the tags property: Resource tags. + * + * @return the tags value. + */ + Map tags(); + + /** + * Gets the properties property: The resource-specific properties for this resource. + * + * @return the properties value. + */ + IamInstanceProfileProperties properties(); + + /** + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the region of the resource. + * + * @return the region of the resource. + */ + Region region(); + + /** + * Gets the name of the resource region. + * + * @return the name of the resource region. + */ + String regionName(); + + /** + * Gets the name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + + /** + * Gets the inner com.azure.resourcemanager.awsconnector.fluent.models.IamInstanceProfileAutoGeneratedInner object. + * + * @return the inner object. + */ + IamInstanceProfileAutoGeneratedInner innerModel(); + + /** + * The entirety of the IamInstanceProfileAutoGenerated definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithLocation, + DefinitionStages.WithResourceGroup, DefinitionStages.WithCreate { + } + + /** + * The IamInstanceProfileAutoGenerated definition stages. + */ + interface DefinitionStages { + /** + * The first stage of the IamInstanceProfileAutoGenerated definition. + */ + interface Blank extends WithLocation { + } + + /** + * The stage of the IamInstanceProfileAutoGenerated definition allowing to specify location. + */ + interface WithLocation { + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithResourceGroup withRegion(Region location); + + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithResourceGroup withRegion(String location); + } + + /** + * The stage of the IamInstanceProfileAutoGenerated definition allowing to specify parent resource. + */ + interface WithResourceGroup { + /** + * Specifies resourceGroupName. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @return the next definition stage. + */ + WithCreate withExistingResourceGroup(String resourceGroupName); + } + + /** + * The stage of the IamInstanceProfileAutoGenerated 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.WithProperties { + /** + * Executes the create request. + * + * @return the created resource. + */ + IamInstanceProfileAutoGenerated create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + IamInstanceProfileAutoGenerated create(Context context); + } + + /** + * The stage of the IamInstanceProfileAutoGenerated definition allowing to specify tags. + */ + interface WithTags { + /** + * Specifies the tags property: Resource tags.. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + WithCreate withTags(Map tags); + } + + /** + * The stage of the IamInstanceProfileAutoGenerated definition allowing to specify properties. + */ + interface WithProperties { + /** + * Specifies the properties property: The resource-specific properties for this resource.. + * + * @param properties The resource-specific properties for this resource. + * @return the next definition stage. + */ + WithCreate withProperties(IamInstanceProfileProperties properties); + } + } + + /** + * Begins update for the IamInstanceProfileAutoGenerated resource. + * + * @return the stage of resource update. + */ + IamInstanceProfileAutoGenerated.Update update(); + + /** + * The template for IamInstanceProfileAutoGenerated update. + */ + interface Update extends UpdateStages.WithTags { + /** + * Executes the update request. + * + * @return the updated resource. + */ + IamInstanceProfileAutoGenerated apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + IamInstanceProfileAutoGenerated apply(Context context); + } + + /** + * The IamInstanceProfileAutoGenerated update stages. + */ + interface UpdateStages { + /** + * The stage of the IamInstanceProfileAutoGenerated update allowing to specify tags. + */ + interface WithTags { + /** + * Specifies the tags property: Resource tags.. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + Update withTags(Map tags); + } + } + + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + IamInstanceProfileAutoGenerated refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + IamInstanceProfileAutoGenerated refresh(Context context); +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/IamInstanceProfileListResult.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/IamInstanceProfileListResult.java new file mode 100644 index 000000000000..78d395101040 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/IamInstanceProfileListResult.java @@ -0,0 +1,136 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.awsconnector.fluent.models.IamInstanceProfileAutoGeneratedInner; +import java.io.IOException; +import java.util.List; + +/** + * The response of a IamInstanceProfile list operation. + */ +@Fluent +public final class IamInstanceProfileListResult implements JsonSerializable { + /* + * The IamInstanceProfile items on this page + */ + private List value; + + /* + * The link to the next page of items + */ + private String nextLink; + + /** + * Creates an instance of IamInstanceProfileListResult class. + */ + public IamInstanceProfileListResult() { + } + + /** + * Get the value property: The IamInstanceProfile items on this page. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The IamInstanceProfile items on this page. + * + * @param value the value value to set. + * @return the IamInstanceProfileListResult object itself. + */ + public IamInstanceProfileListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The link to the next page of items. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: The link to the next page of items. + * + * @param nextLink the nextLink value to set. + * @return the IamInstanceProfileListResult object itself. + */ + public IamInstanceProfileListResult withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property value in model IamInstanceProfileListResult")); + } else { + value().forEach(e -> e.validate()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(IamInstanceProfileListResult.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("nextLink", this.nextLink); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of IamInstanceProfileListResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of IamInstanceProfileListResult if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the IamInstanceProfileListResult. + */ + public static IamInstanceProfileListResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + IamInstanceProfileListResult deserializedIamInstanceProfileListResult = new IamInstanceProfileListResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> IamInstanceProfileAutoGeneratedInner.fromJson(reader1)); + deserializedIamInstanceProfileListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedIamInstanceProfileListResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedIamInstanceProfileListResult; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/IamInstanceProfileProperties.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/IamInstanceProfileProperties.java new file mode 100644 index 000000000000..76361a153733 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/IamInstanceProfileProperties.java @@ -0,0 +1,312 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.Map; + +/** + * Definition of IamInstanceProfile. + */ +@Fluent +public final class IamInstanceProfileProperties implements JsonSerializable { + /* + * AWS Properties + */ + private AwsIamInstanceProfileProperties awsProperties; + + /* + * Public Cloud Connectors Resource ID + */ + private String publicCloudConnectorsResourceId; + + /* + * AWS Account ID + */ + private String awsAccountId; + + /* + * Amazon Resource Name (ARN) + */ + private String arn; + + /* + * Public Cloud Resource Name + */ + private String publicCloudResourceName; + + /* + * AWS Source Schema + */ + private String awsSourceSchema; + + /* + * AWS Region + */ + private String awsRegion; + + /* + * AWS Tags + */ + private Map awsTags; + + /* + * The status of the last operation. + */ + private ProvisioningState provisioningState; + + /** + * Creates an instance of IamInstanceProfileProperties class. + */ + public IamInstanceProfileProperties() { + } + + /** + * Get the awsProperties property: AWS Properties. + * + * @return the awsProperties value. + */ + public AwsIamInstanceProfileProperties awsProperties() { + return this.awsProperties; + } + + /** + * Set the awsProperties property: AWS Properties. + * + * @param awsProperties the awsProperties value to set. + * @return the IamInstanceProfileProperties object itself. + */ + public IamInstanceProfileProperties withAwsProperties(AwsIamInstanceProfileProperties awsProperties) { + this.awsProperties = awsProperties; + return this; + } + + /** + * Get the publicCloudConnectorsResourceId property: Public Cloud Connectors Resource ID. + * + * @return the publicCloudConnectorsResourceId value. + */ + public String publicCloudConnectorsResourceId() { + return this.publicCloudConnectorsResourceId; + } + + /** + * Set the publicCloudConnectorsResourceId property: Public Cloud Connectors Resource ID. + * + * @param publicCloudConnectorsResourceId the publicCloudConnectorsResourceId value to set. + * @return the IamInstanceProfileProperties object itself. + */ + public IamInstanceProfileProperties withPublicCloudConnectorsResourceId(String publicCloudConnectorsResourceId) { + this.publicCloudConnectorsResourceId = publicCloudConnectorsResourceId; + return this; + } + + /** + * Get the awsAccountId property: AWS Account ID. + * + * @return the awsAccountId value. + */ + public String awsAccountId() { + return this.awsAccountId; + } + + /** + * Set the awsAccountId property: AWS Account ID. + * + * @param awsAccountId the awsAccountId value to set. + * @return the IamInstanceProfileProperties object itself. + */ + public IamInstanceProfileProperties withAwsAccountId(String awsAccountId) { + this.awsAccountId = awsAccountId; + return this; + } + + /** + * Get the arn property: Amazon Resource Name (ARN). + * + * @return the arn value. + */ + public String arn() { + return this.arn; + } + + /** + * Set the arn property: Amazon Resource Name (ARN). + * + * @param arn the arn value to set. + * @return the IamInstanceProfileProperties object itself. + */ + public IamInstanceProfileProperties withArn(String arn) { + this.arn = arn; + return this; + } + + /** + * Get the publicCloudResourceName property: Public Cloud Resource Name. + * + * @return the publicCloudResourceName value. + */ + public String publicCloudResourceName() { + return this.publicCloudResourceName; + } + + /** + * Set the publicCloudResourceName property: Public Cloud Resource Name. + * + * @param publicCloudResourceName the publicCloudResourceName value to set. + * @return the IamInstanceProfileProperties object itself. + */ + public IamInstanceProfileProperties withPublicCloudResourceName(String publicCloudResourceName) { + this.publicCloudResourceName = publicCloudResourceName; + return this; + } + + /** + * Get the awsSourceSchema property: AWS Source Schema. + * + * @return the awsSourceSchema value. + */ + public String awsSourceSchema() { + return this.awsSourceSchema; + } + + /** + * Set the awsSourceSchema property: AWS Source Schema. + * + * @param awsSourceSchema the awsSourceSchema value to set. + * @return the IamInstanceProfileProperties object itself. + */ + public IamInstanceProfileProperties withAwsSourceSchema(String awsSourceSchema) { + this.awsSourceSchema = awsSourceSchema; + return this; + } + + /** + * Get the awsRegion property: AWS Region. + * + * @return the awsRegion value. + */ + public String awsRegion() { + return this.awsRegion; + } + + /** + * Set the awsRegion property: AWS Region. + * + * @param awsRegion the awsRegion value to set. + * @return the IamInstanceProfileProperties object itself. + */ + public IamInstanceProfileProperties withAwsRegion(String awsRegion) { + this.awsRegion = awsRegion; + return this; + } + + /** + * Get the awsTags property: AWS Tags. + * + * @return the awsTags value. + */ + public Map awsTags() { + return this.awsTags; + } + + /** + * Set the awsTags property: AWS Tags. + * + * @param awsTags the awsTags value to set. + * @return the IamInstanceProfileProperties object itself. + */ + public IamInstanceProfileProperties withAwsTags(Map awsTags) { + this.awsTags = awsTags; + return this; + } + + /** + * Get the provisioningState property: The status of the last operation. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (awsProperties() != null) { + awsProperties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("awsProperties", this.awsProperties); + jsonWriter.writeStringField("publicCloudConnectorsResourceId", this.publicCloudConnectorsResourceId); + jsonWriter.writeStringField("awsAccountId", this.awsAccountId); + jsonWriter.writeStringField("arn", this.arn); + jsonWriter.writeStringField("publicCloudResourceName", this.publicCloudResourceName); + jsonWriter.writeStringField("awsSourceSchema", this.awsSourceSchema); + jsonWriter.writeStringField("awsRegion", this.awsRegion); + jsonWriter.writeMapField("awsTags", this.awsTags, (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of IamInstanceProfileProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of IamInstanceProfileProperties if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the IamInstanceProfileProperties. + */ + public static IamInstanceProfileProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + IamInstanceProfileProperties deserializedIamInstanceProfileProperties = new IamInstanceProfileProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("awsProperties".equals(fieldName)) { + deserializedIamInstanceProfileProperties.awsProperties + = AwsIamInstanceProfileProperties.fromJson(reader); + } else if ("publicCloudConnectorsResourceId".equals(fieldName)) { + deserializedIamInstanceProfileProperties.publicCloudConnectorsResourceId = reader.getString(); + } else if ("awsAccountId".equals(fieldName)) { + deserializedIamInstanceProfileProperties.awsAccountId = reader.getString(); + } else if ("arn".equals(fieldName)) { + deserializedIamInstanceProfileProperties.arn = reader.getString(); + } else if ("publicCloudResourceName".equals(fieldName)) { + deserializedIamInstanceProfileProperties.publicCloudResourceName = reader.getString(); + } else if ("awsSourceSchema".equals(fieldName)) { + deserializedIamInstanceProfileProperties.awsSourceSchema = reader.getString(); + } else if ("awsRegion".equals(fieldName)) { + deserializedIamInstanceProfileProperties.awsRegion = reader.getString(); + } else if ("awsTags".equals(fieldName)) { + Map awsTags = reader.readMap(reader1 -> reader1.getString()); + deserializedIamInstanceProfileProperties.awsTags = awsTags; + } else if ("provisioningState".equals(fieldName)) { + deserializedIamInstanceProfileProperties.provisioningState + = ProvisioningState.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedIamInstanceProfileProperties; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/IamInstanceProfileTagsUpdate.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/IamInstanceProfileTagsUpdate.java new file mode 100644 index 000000000000..8051cfea4aaa --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/IamInstanceProfileTagsUpdate.java @@ -0,0 +1,95 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.Map; + +/** + * The type used for updating tags in IamInstanceProfile resources. + */ +@Fluent +public final class IamInstanceProfileTagsUpdate implements JsonSerializable { + /* + * Resource tags. + */ + private Map tags; + + /** + * Creates an instance of IamInstanceProfileTagsUpdate class. + */ + public IamInstanceProfileTagsUpdate() { + } + + /** + * Get the tags property: Resource tags. + * + * @return the tags value. + */ + public Map tags() { + return this.tags; + } + + /** + * Set the tags property: Resource tags. + * + * @param tags the tags value to set. + * @return the IamInstanceProfileTagsUpdate object itself. + */ + public IamInstanceProfileTagsUpdate withTags(Map tags) { + this.tags = tags; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeMapField("tags", this.tags, (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of IamInstanceProfileTagsUpdate from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of IamInstanceProfileTagsUpdate if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the IamInstanceProfileTagsUpdate. + */ + public static IamInstanceProfileTagsUpdate fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + IamInstanceProfileTagsUpdate deserializedIamInstanceProfileTagsUpdate = new IamInstanceProfileTagsUpdate(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedIamInstanceProfileTagsUpdate.tags = tags; + } else { + reader.skipChildren(); + } + } + + return deserializedIamInstanceProfileTagsUpdate; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/IamInstanceProfiles.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/IamInstanceProfiles.java new file mode 100644 index 000000000000..db9ab8e272a0 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/IamInstanceProfiles.java @@ -0,0 +1,158 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** + * Resource collection API of IamInstanceProfiles. + */ +public interface IamInstanceProfiles { + /** + * List IamInstanceProfile resources by subscription ID. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a IamInstanceProfile list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable list(); + + /** + * List IamInstanceProfile resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a IamInstanceProfile list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable list(Context context); + + /** + * List IamInstanceProfile resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a IamInstanceProfile list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * List IamInstanceProfile resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a IamInstanceProfile list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Get a IamInstanceProfile. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of IamInstanceProfile. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a IamInstanceProfile along with {@link Response}. + */ + Response getByResourceGroupWithResponse(String resourceGroupName, String name, + Context context); + + /** + * Get a IamInstanceProfile. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of IamInstanceProfile. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a IamInstanceProfile. + */ + IamInstanceProfileAutoGenerated getByResourceGroup(String resourceGroupName, String name); + + /** + * Delete a IamInstanceProfile. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of IamInstanceProfile. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByResourceGroup(String resourceGroupName, String name); + + /** + * Delete a IamInstanceProfile. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of IamInstanceProfile. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String name, Context context); + + /** + * Get a IamInstanceProfile. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a IamInstanceProfile along with {@link Response}. + */ + IamInstanceProfileAutoGenerated getById(String id); + + /** + * Get a IamInstanceProfile. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a IamInstanceProfile along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Delete a IamInstanceProfile. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteById(String id); + + /** + * Delete a IamInstanceProfile. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new IamInstanceProfileAutoGenerated resource. + * + * @param name resource name. + * @return the first stage of the new IamInstanceProfileAutoGenerated definition. + */ + IamInstanceProfileAutoGenerated.DefinitionStages.Blank define(String name); +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/IamMfaDevice.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/IamMfaDevice.java new file mode 100644 index 000000000000..08e01908ed90 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/IamMfaDevice.java @@ -0,0 +1,252 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.awsconnector.fluent.models.IamMfaDeviceInner; +import java.util.Map; + +/** + * An immutable client-side representation of IamMfaDevice. + */ +public interface IamMfaDevice { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the location property: The geo-location where the resource lives. + * + * @return the location value. + */ + String location(); + + /** + * Gets the tags property: Resource tags. + * + * @return the tags value. + */ + Map tags(); + + /** + * Gets the properties property: The resource-specific properties for this resource. + * + * @return the properties value. + */ + IamMfaDeviceProperties properties(); + + /** + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the region of the resource. + * + * @return the region of the resource. + */ + Region region(); + + /** + * Gets the name of the resource region. + * + * @return the name of the resource region. + */ + String regionName(); + + /** + * Gets the name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + + /** + * Gets the inner com.azure.resourcemanager.awsconnector.fluent.models.IamMfaDeviceInner object. + * + * @return the inner object. + */ + IamMfaDeviceInner innerModel(); + + /** + * The entirety of the IamMfaDevice definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithLocation, + DefinitionStages.WithResourceGroup, DefinitionStages.WithCreate { + } + + /** + * The IamMfaDevice definition stages. + */ + interface DefinitionStages { + /** + * The first stage of the IamMfaDevice definition. + */ + interface Blank extends WithLocation { + } + + /** + * The stage of the IamMfaDevice definition allowing to specify location. + */ + interface WithLocation { + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithResourceGroup withRegion(Region location); + + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithResourceGroup withRegion(String location); + } + + /** + * The stage of the IamMfaDevice definition allowing to specify parent resource. + */ + interface WithResourceGroup { + /** + * Specifies resourceGroupName. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @return the next definition stage. + */ + WithCreate withExistingResourceGroup(String resourceGroupName); + } + + /** + * The stage of the IamMfaDevice 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.WithProperties { + /** + * Executes the create request. + * + * @return the created resource. + */ + IamMfaDevice create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + IamMfaDevice create(Context context); + } + + /** + * The stage of the IamMfaDevice definition allowing to specify tags. + */ + interface WithTags { + /** + * Specifies the tags property: Resource tags.. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + WithCreate withTags(Map tags); + } + + /** + * The stage of the IamMfaDevice definition allowing to specify properties. + */ + interface WithProperties { + /** + * Specifies the properties property: The resource-specific properties for this resource.. + * + * @param properties The resource-specific properties for this resource. + * @return the next definition stage. + */ + WithCreate withProperties(IamMfaDeviceProperties properties); + } + } + + /** + * Begins update for the IamMfaDevice resource. + * + * @return the stage of resource update. + */ + IamMfaDevice.Update update(); + + /** + * The template for IamMfaDevice update. + */ + interface Update extends UpdateStages.WithTags { + /** + * Executes the update request. + * + * @return the updated resource. + */ + IamMfaDevice apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + IamMfaDevice apply(Context context); + } + + /** + * The IamMfaDevice update stages. + */ + interface UpdateStages { + /** + * The stage of the IamMfaDevice update allowing to specify tags. + */ + interface WithTags { + /** + * Specifies the tags property: Resource tags.. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + Update withTags(Map tags); + } + } + + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + IamMfaDevice refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + IamMfaDevice refresh(Context context); +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/IamMfaDeviceListResult.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/IamMfaDeviceListResult.java new file mode 100644 index 000000000000..a4098bc91320 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/IamMfaDeviceListResult.java @@ -0,0 +1,134 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.awsconnector.fluent.models.IamMfaDeviceInner; +import java.io.IOException; +import java.util.List; + +/** + * The response of a IamMFADevice list operation. + */ +@Fluent +public final class IamMfaDeviceListResult implements JsonSerializable { + /* + * The IamMFADevice items on this page + */ + private List value; + + /* + * The link to the next page of items + */ + private String nextLink; + + /** + * Creates an instance of IamMfaDeviceListResult class. + */ + public IamMfaDeviceListResult() { + } + + /** + * Get the value property: The IamMFADevice items on this page. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The IamMFADevice items on this page. + * + * @param value the value value to set. + * @return the IamMfaDeviceListResult object itself. + */ + public IamMfaDeviceListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The link to the next page of items. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: The link to the next page of items. + * + * @param nextLink the nextLink value to set. + * @return the IamMfaDeviceListResult object itself. + */ + public IamMfaDeviceListResult withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property value in model IamMfaDeviceListResult")); + } else { + value().forEach(e -> e.validate()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(IamMfaDeviceListResult.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("nextLink", this.nextLink); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of IamMfaDeviceListResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of IamMfaDeviceListResult if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the IamMfaDeviceListResult. + */ + public static IamMfaDeviceListResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + IamMfaDeviceListResult deserializedIamMfaDeviceListResult = new IamMfaDeviceListResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value = reader.readArray(reader1 -> IamMfaDeviceInner.fromJson(reader1)); + deserializedIamMfaDeviceListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedIamMfaDeviceListResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedIamMfaDeviceListResult; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/IamMfaDeviceProperties.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/IamMfaDeviceProperties.java new file mode 100644 index 000000000000..9035b793616e --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/IamMfaDeviceProperties.java @@ -0,0 +1,311 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.Map; + +/** + * Definition of IamMFADevice. + */ +@Fluent +public final class IamMfaDeviceProperties implements JsonSerializable { + /* + * AWS Properties + */ + private AwsIamMfaDeviceProperties awsProperties; + + /* + * Public Cloud Connectors Resource ID + */ + private String publicCloudConnectorsResourceId; + + /* + * AWS Account ID + */ + private String awsAccountId; + + /* + * Amazon Resource Name (ARN) + */ + private String arn; + + /* + * Public Cloud Resource Name + */ + private String publicCloudResourceName; + + /* + * AWS Source Schema + */ + private String awsSourceSchema; + + /* + * AWS Region + */ + private String awsRegion; + + /* + * AWS Tags + */ + private Map awsTags; + + /* + * The status of the last operation. + */ + private ProvisioningState provisioningState; + + /** + * Creates an instance of IamMfaDeviceProperties class. + */ + public IamMfaDeviceProperties() { + } + + /** + * Get the awsProperties property: AWS Properties. + * + * @return the awsProperties value. + */ + public AwsIamMfaDeviceProperties awsProperties() { + return this.awsProperties; + } + + /** + * Set the awsProperties property: AWS Properties. + * + * @param awsProperties the awsProperties value to set. + * @return the IamMfaDeviceProperties object itself. + */ + public IamMfaDeviceProperties withAwsProperties(AwsIamMfaDeviceProperties awsProperties) { + this.awsProperties = awsProperties; + return this; + } + + /** + * Get the publicCloudConnectorsResourceId property: Public Cloud Connectors Resource ID. + * + * @return the publicCloudConnectorsResourceId value. + */ + public String publicCloudConnectorsResourceId() { + return this.publicCloudConnectorsResourceId; + } + + /** + * Set the publicCloudConnectorsResourceId property: Public Cloud Connectors Resource ID. + * + * @param publicCloudConnectorsResourceId the publicCloudConnectorsResourceId value to set. + * @return the IamMfaDeviceProperties object itself. + */ + public IamMfaDeviceProperties withPublicCloudConnectorsResourceId(String publicCloudConnectorsResourceId) { + this.publicCloudConnectorsResourceId = publicCloudConnectorsResourceId; + return this; + } + + /** + * Get the awsAccountId property: AWS Account ID. + * + * @return the awsAccountId value. + */ + public String awsAccountId() { + return this.awsAccountId; + } + + /** + * Set the awsAccountId property: AWS Account ID. + * + * @param awsAccountId the awsAccountId value to set. + * @return the IamMfaDeviceProperties object itself. + */ + public IamMfaDeviceProperties withAwsAccountId(String awsAccountId) { + this.awsAccountId = awsAccountId; + return this; + } + + /** + * Get the arn property: Amazon Resource Name (ARN). + * + * @return the arn value. + */ + public String arn() { + return this.arn; + } + + /** + * Set the arn property: Amazon Resource Name (ARN). + * + * @param arn the arn value to set. + * @return the IamMfaDeviceProperties object itself. + */ + public IamMfaDeviceProperties withArn(String arn) { + this.arn = arn; + return this; + } + + /** + * Get the publicCloudResourceName property: Public Cloud Resource Name. + * + * @return the publicCloudResourceName value. + */ + public String publicCloudResourceName() { + return this.publicCloudResourceName; + } + + /** + * Set the publicCloudResourceName property: Public Cloud Resource Name. + * + * @param publicCloudResourceName the publicCloudResourceName value to set. + * @return the IamMfaDeviceProperties object itself. + */ + public IamMfaDeviceProperties withPublicCloudResourceName(String publicCloudResourceName) { + this.publicCloudResourceName = publicCloudResourceName; + return this; + } + + /** + * Get the awsSourceSchema property: AWS Source Schema. + * + * @return the awsSourceSchema value. + */ + public String awsSourceSchema() { + return this.awsSourceSchema; + } + + /** + * Set the awsSourceSchema property: AWS Source Schema. + * + * @param awsSourceSchema the awsSourceSchema value to set. + * @return the IamMfaDeviceProperties object itself. + */ + public IamMfaDeviceProperties withAwsSourceSchema(String awsSourceSchema) { + this.awsSourceSchema = awsSourceSchema; + return this; + } + + /** + * Get the awsRegion property: AWS Region. + * + * @return the awsRegion value. + */ + public String awsRegion() { + return this.awsRegion; + } + + /** + * Set the awsRegion property: AWS Region. + * + * @param awsRegion the awsRegion value to set. + * @return the IamMfaDeviceProperties object itself. + */ + public IamMfaDeviceProperties withAwsRegion(String awsRegion) { + this.awsRegion = awsRegion; + return this; + } + + /** + * Get the awsTags property: AWS Tags. + * + * @return the awsTags value. + */ + public Map awsTags() { + return this.awsTags; + } + + /** + * Set the awsTags property: AWS Tags. + * + * @param awsTags the awsTags value to set. + * @return the IamMfaDeviceProperties object itself. + */ + public IamMfaDeviceProperties withAwsTags(Map awsTags) { + this.awsTags = awsTags; + return this; + } + + /** + * Get the provisioningState property: The status of the last operation. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (awsProperties() != null) { + awsProperties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("awsProperties", this.awsProperties); + jsonWriter.writeStringField("publicCloudConnectorsResourceId", this.publicCloudConnectorsResourceId); + jsonWriter.writeStringField("awsAccountId", this.awsAccountId); + jsonWriter.writeStringField("arn", this.arn); + jsonWriter.writeStringField("publicCloudResourceName", this.publicCloudResourceName); + jsonWriter.writeStringField("awsSourceSchema", this.awsSourceSchema); + jsonWriter.writeStringField("awsRegion", this.awsRegion); + jsonWriter.writeMapField("awsTags", this.awsTags, (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of IamMfaDeviceProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of IamMfaDeviceProperties if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the IamMfaDeviceProperties. + */ + public static IamMfaDeviceProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + IamMfaDeviceProperties deserializedIamMfaDeviceProperties = new IamMfaDeviceProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("awsProperties".equals(fieldName)) { + deserializedIamMfaDeviceProperties.awsProperties = AwsIamMfaDeviceProperties.fromJson(reader); + } else if ("publicCloudConnectorsResourceId".equals(fieldName)) { + deserializedIamMfaDeviceProperties.publicCloudConnectorsResourceId = reader.getString(); + } else if ("awsAccountId".equals(fieldName)) { + deserializedIamMfaDeviceProperties.awsAccountId = reader.getString(); + } else if ("arn".equals(fieldName)) { + deserializedIamMfaDeviceProperties.arn = reader.getString(); + } else if ("publicCloudResourceName".equals(fieldName)) { + deserializedIamMfaDeviceProperties.publicCloudResourceName = reader.getString(); + } else if ("awsSourceSchema".equals(fieldName)) { + deserializedIamMfaDeviceProperties.awsSourceSchema = reader.getString(); + } else if ("awsRegion".equals(fieldName)) { + deserializedIamMfaDeviceProperties.awsRegion = reader.getString(); + } else if ("awsTags".equals(fieldName)) { + Map awsTags = reader.readMap(reader1 -> reader1.getString()); + deserializedIamMfaDeviceProperties.awsTags = awsTags; + } else if ("provisioningState".equals(fieldName)) { + deserializedIamMfaDeviceProperties.provisioningState + = ProvisioningState.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedIamMfaDeviceProperties; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/IamMfaDeviceTagsUpdate.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/IamMfaDeviceTagsUpdate.java new file mode 100644 index 000000000000..a27ee1f27f68 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/IamMfaDeviceTagsUpdate.java @@ -0,0 +1,95 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.Map; + +/** + * The type used for updating tags in IamMFADevice resources. + */ +@Fluent +public final class IamMfaDeviceTagsUpdate implements JsonSerializable { + /* + * Resource tags. + */ + private Map tags; + + /** + * Creates an instance of IamMfaDeviceTagsUpdate class. + */ + public IamMfaDeviceTagsUpdate() { + } + + /** + * Get the tags property: Resource tags. + * + * @return the tags value. + */ + public Map tags() { + return this.tags; + } + + /** + * Set the tags property: Resource tags. + * + * @param tags the tags value to set. + * @return the IamMfaDeviceTagsUpdate object itself. + */ + public IamMfaDeviceTagsUpdate withTags(Map tags) { + this.tags = tags; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeMapField("tags", this.tags, (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of IamMfaDeviceTagsUpdate from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of IamMfaDeviceTagsUpdate if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the IamMfaDeviceTagsUpdate. + */ + public static IamMfaDeviceTagsUpdate fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + IamMfaDeviceTagsUpdate deserializedIamMfaDeviceTagsUpdate = new IamMfaDeviceTagsUpdate(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedIamMfaDeviceTagsUpdate.tags = tags; + } else { + reader.skipChildren(); + } + } + + return deserializedIamMfaDeviceTagsUpdate; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/IamMfaDevices.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/IamMfaDevices.java new file mode 100644 index 000000000000..6cf98db63390 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/IamMfaDevices.java @@ -0,0 +1,157 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** + * Resource collection API of IamMfaDevices. + */ +public interface IamMfaDevices { + /** + * List IamMFADevice resources by subscription ID. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a IamMFADevice list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable list(); + + /** + * List IamMFADevice resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a IamMFADevice list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable list(Context context); + + /** + * List IamMFADevice resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a IamMFADevice list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * List IamMFADevice resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a IamMFADevice list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Get a IamMFADevice. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of IamMFADevice. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a IamMFADevice along with {@link Response}. + */ + Response getByResourceGroupWithResponse(String resourceGroupName, String name, Context context); + + /** + * Get a IamMFADevice. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of IamMFADevice. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a IamMFADevice. + */ + IamMfaDevice getByResourceGroup(String resourceGroupName, String name); + + /** + * Delete a IamMFADevice. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of IamMFADevice. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByResourceGroup(String resourceGroupName, String name); + + /** + * Delete a IamMFADevice. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of IamMFADevice. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String name, Context context); + + /** + * Get a IamMFADevice. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a IamMFADevice along with {@link Response}. + */ + IamMfaDevice getById(String id); + + /** + * Get a IamMFADevice. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a IamMFADevice along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Delete a IamMFADevice. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteById(String id); + + /** + * Delete a IamMFADevice. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new IamMfaDevice resource. + * + * @param name resource name. + * @return the first stage of the new IamMfaDevice definition. + */ + IamMfaDevice.DefinitionStages.Blank define(String name); +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/IamPasswordPolicies.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/IamPasswordPolicies.java new file mode 100644 index 000000000000..a62e506502df --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/IamPasswordPolicies.java @@ -0,0 +1,157 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** + * Resource collection API of IamPasswordPolicies. + */ +public interface IamPasswordPolicies { + /** + * List IamPasswordPolicy resources by subscription ID. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a IamPasswordPolicy list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable list(); + + /** + * List IamPasswordPolicy resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a IamPasswordPolicy list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable list(Context context); + + /** + * List IamPasswordPolicy resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a IamPasswordPolicy list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * List IamPasswordPolicy resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a IamPasswordPolicy list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Get a IamPasswordPolicy. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of IamPasswordPolicy. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a IamPasswordPolicy along with {@link Response}. + */ + Response getByResourceGroupWithResponse(String resourceGroupName, String name, Context context); + + /** + * Get a IamPasswordPolicy. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of IamPasswordPolicy. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a IamPasswordPolicy. + */ + IamPasswordPolicy getByResourceGroup(String resourceGroupName, String name); + + /** + * Delete a IamPasswordPolicy. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of IamPasswordPolicy. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByResourceGroup(String resourceGroupName, String name); + + /** + * Delete a IamPasswordPolicy. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of IamPasswordPolicy. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String name, Context context); + + /** + * Get a IamPasswordPolicy. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a IamPasswordPolicy along with {@link Response}. + */ + IamPasswordPolicy getById(String id); + + /** + * Get a IamPasswordPolicy. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a IamPasswordPolicy along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Delete a IamPasswordPolicy. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteById(String id); + + /** + * Delete a IamPasswordPolicy. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new IamPasswordPolicy resource. + * + * @param name resource name. + * @return the first stage of the new IamPasswordPolicy definition. + */ + IamPasswordPolicy.DefinitionStages.Blank define(String name); +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/IamPasswordPolicy.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/IamPasswordPolicy.java new file mode 100644 index 000000000000..e42347930818 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/IamPasswordPolicy.java @@ -0,0 +1,252 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.awsconnector.fluent.models.IamPasswordPolicyInner; +import java.util.Map; + +/** + * An immutable client-side representation of IamPasswordPolicy. + */ +public interface IamPasswordPolicy { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the location property: The geo-location where the resource lives. + * + * @return the location value. + */ + String location(); + + /** + * Gets the tags property: Resource tags. + * + * @return the tags value. + */ + Map tags(); + + /** + * Gets the properties property: The resource-specific properties for this resource. + * + * @return the properties value. + */ + IamPasswordPolicyProperties properties(); + + /** + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the region of the resource. + * + * @return the region of the resource. + */ + Region region(); + + /** + * Gets the name of the resource region. + * + * @return the name of the resource region. + */ + String regionName(); + + /** + * Gets the name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + + /** + * Gets the inner com.azure.resourcemanager.awsconnector.fluent.models.IamPasswordPolicyInner object. + * + * @return the inner object. + */ + IamPasswordPolicyInner innerModel(); + + /** + * The entirety of the IamPasswordPolicy definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithLocation, + DefinitionStages.WithResourceGroup, DefinitionStages.WithCreate { + } + + /** + * The IamPasswordPolicy definition stages. + */ + interface DefinitionStages { + /** + * The first stage of the IamPasswordPolicy definition. + */ + interface Blank extends WithLocation { + } + + /** + * The stage of the IamPasswordPolicy definition allowing to specify location. + */ + interface WithLocation { + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithResourceGroup withRegion(Region location); + + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithResourceGroup withRegion(String location); + } + + /** + * The stage of the IamPasswordPolicy definition allowing to specify parent resource. + */ + interface WithResourceGroup { + /** + * Specifies resourceGroupName. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @return the next definition stage. + */ + WithCreate withExistingResourceGroup(String resourceGroupName); + } + + /** + * The stage of the IamPasswordPolicy 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.WithProperties { + /** + * Executes the create request. + * + * @return the created resource. + */ + IamPasswordPolicy create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + IamPasswordPolicy create(Context context); + } + + /** + * The stage of the IamPasswordPolicy definition allowing to specify tags. + */ + interface WithTags { + /** + * Specifies the tags property: Resource tags.. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + WithCreate withTags(Map tags); + } + + /** + * The stage of the IamPasswordPolicy definition allowing to specify properties. + */ + interface WithProperties { + /** + * Specifies the properties property: The resource-specific properties for this resource.. + * + * @param properties The resource-specific properties for this resource. + * @return the next definition stage. + */ + WithCreate withProperties(IamPasswordPolicyProperties properties); + } + } + + /** + * Begins update for the IamPasswordPolicy resource. + * + * @return the stage of resource update. + */ + IamPasswordPolicy.Update update(); + + /** + * The template for IamPasswordPolicy update. + */ + interface Update extends UpdateStages.WithTags { + /** + * Executes the update request. + * + * @return the updated resource. + */ + IamPasswordPolicy apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + IamPasswordPolicy apply(Context context); + } + + /** + * The IamPasswordPolicy update stages. + */ + interface UpdateStages { + /** + * The stage of the IamPasswordPolicy update allowing to specify tags. + */ + interface WithTags { + /** + * Specifies the tags property: Resource tags.. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + Update withTags(Map tags); + } + } + + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + IamPasswordPolicy refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + IamPasswordPolicy refresh(Context context); +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/IamPasswordPolicyListResult.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/IamPasswordPolicyListResult.java new file mode 100644 index 000000000000..0318cfbd528e --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/IamPasswordPolicyListResult.java @@ -0,0 +1,136 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.awsconnector.fluent.models.IamPasswordPolicyInner; +import java.io.IOException; +import java.util.List; + +/** + * The response of a IamPasswordPolicy list operation. + */ +@Fluent +public final class IamPasswordPolicyListResult implements JsonSerializable { + /* + * The IamPasswordPolicy items on this page + */ + private List value; + + /* + * The link to the next page of items + */ + private String nextLink; + + /** + * Creates an instance of IamPasswordPolicyListResult class. + */ + public IamPasswordPolicyListResult() { + } + + /** + * Get the value property: The IamPasswordPolicy items on this page. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The IamPasswordPolicy items on this page. + * + * @param value the value value to set. + * @return the IamPasswordPolicyListResult object itself. + */ + public IamPasswordPolicyListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The link to the next page of items. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: The link to the next page of items. + * + * @param nextLink the nextLink value to set. + * @return the IamPasswordPolicyListResult object itself. + */ + public IamPasswordPolicyListResult withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property value in model IamPasswordPolicyListResult")); + } else { + value().forEach(e -> e.validate()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(IamPasswordPolicyListResult.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("nextLink", this.nextLink); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of IamPasswordPolicyListResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of IamPasswordPolicyListResult if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the IamPasswordPolicyListResult. + */ + public static IamPasswordPolicyListResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + IamPasswordPolicyListResult deserializedIamPasswordPolicyListResult = new IamPasswordPolicyListResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> IamPasswordPolicyInner.fromJson(reader1)); + deserializedIamPasswordPolicyListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedIamPasswordPolicyListResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedIamPasswordPolicyListResult; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/IamPasswordPolicyProperties.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/IamPasswordPolicyProperties.java new file mode 100644 index 000000000000..d677f686060f --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/IamPasswordPolicyProperties.java @@ -0,0 +1,312 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.Map; + +/** + * Definition of IamPasswordPolicy. + */ +@Fluent +public final class IamPasswordPolicyProperties implements JsonSerializable { + /* + * AWS Properties + */ + private AwsIamPasswordPolicyProperties awsProperties; + + /* + * Public Cloud Connectors Resource ID + */ + private String publicCloudConnectorsResourceId; + + /* + * AWS Account ID + */ + private String awsAccountId; + + /* + * Amazon Resource Name (ARN) + */ + private String arn; + + /* + * Public Cloud Resource Name + */ + private String publicCloudResourceName; + + /* + * AWS Source Schema + */ + private String awsSourceSchema; + + /* + * AWS Region + */ + private String awsRegion; + + /* + * AWS Tags + */ + private Map awsTags; + + /* + * The status of the last operation. + */ + private ProvisioningState provisioningState; + + /** + * Creates an instance of IamPasswordPolicyProperties class. + */ + public IamPasswordPolicyProperties() { + } + + /** + * Get the awsProperties property: AWS Properties. + * + * @return the awsProperties value. + */ + public AwsIamPasswordPolicyProperties awsProperties() { + return this.awsProperties; + } + + /** + * Set the awsProperties property: AWS Properties. + * + * @param awsProperties the awsProperties value to set. + * @return the IamPasswordPolicyProperties object itself. + */ + public IamPasswordPolicyProperties withAwsProperties(AwsIamPasswordPolicyProperties awsProperties) { + this.awsProperties = awsProperties; + return this; + } + + /** + * Get the publicCloudConnectorsResourceId property: Public Cloud Connectors Resource ID. + * + * @return the publicCloudConnectorsResourceId value. + */ + public String publicCloudConnectorsResourceId() { + return this.publicCloudConnectorsResourceId; + } + + /** + * Set the publicCloudConnectorsResourceId property: Public Cloud Connectors Resource ID. + * + * @param publicCloudConnectorsResourceId the publicCloudConnectorsResourceId value to set. + * @return the IamPasswordPolicyProperties object itself. + */ + public IamPasswordPolicyProperties withPublicCloudConnectorsResourceId(String publicCloudConnectorsResourceId) { + this.publicCloudConnectorsResourceId = publicCloudConnectorsResourceId; + return this; + } + + /** + * Get the awsAccountId property: AWS Account ID. + * + * @return the awsAccountId value. + */ + public String awsAccountId() { + return this.awsAccountId; + } + + /** + * Set the awsAccountId property: AWS Account ID. + * + * @param awsAccountId the awsAccountId value to set. + * @return the IamPasswordPolicyProperties object itself. + */ + public IamPasswordPolicyProperties withAwsAccountId(String awsAccountId) { + this.awsAccountId = awsAccountId; + return this; + } + + /** + * Get the arn property: Amazon Resource Name (ARN). + * + * @return the arn value. + */ + public String arn() { + return this.arn; + } + + /** + * Set the arn property: Amazon Resource Name (ARN). + * + * @param arn the arn value to set. + * @return the IamPasswordPolicyProperties object itself. + */ + public IamPasswordPolicyProperties withArn(String arn) { + this.arn = arn; + return this; + } + + /** + * Get the publicCloudResourceName property: Public Cloud Resource Name. + * + * @return the publicCloudResourceName value. + */ + public String publicCloudResourceName() { + return this.publicCloudResourceName; + } + + /** + * Set the publicCloudResourceName property: Public Cloud Resource Name. + * + * @param publicCloudResourceName the publicCloudResourceName value to set. + * @return the IamPasswordPolicyProperties object itself. + */ + public IamPasswordPolicyProperties withPublicCloudResourceName(String publicCloudResourceName) { + this.publicCloudResourceName = publicCloudResourceName; + return this; + } + + /** + * Get the awsSourceSchema property: AWS Source Schema. + * + * @return the awsSourceSchema value. + */ + public String awsSourceSchema() { + return this.awsSourceSchema; + } + + /** + * Set the awsSourceSchema property: AWS Source Schema. + * + * @param awsSourceSchema the awsSourceSchema value to set. + * @return the IamPasswordPolicyProperties object itself. + */ + public IamPasswordPolicyProperties withAwsSourceSchema(String awsSourceSchema) { + this.awsSourceSchema = awsSourceSchema; + return this; + } + + /** + * Get the awsRegion property: AWS Region. + * + * @return the awsRegion value. + */ + public String awsRegion() { + return this.awsRegion; + } + + /** + * Set the awsRegion property: AWS Region. + * + * @param awsRegion the awsRegion value to set. + * @return the IamPasswordPolicyProperties object itself. + */ + public IamPasswordPolicyProperties withAwsRegion(String awsRegion) { + this.awsRegion = awsRegion; + return this; + } + + /** + * Get the awsTags property: AWS Tags. + * + * @return the awsTags value. + */ + public Map awsTags() { + return this.awsTags; + } + + /** + * Set the awsTags property: AWS Tags. + * + * @param awsTags the awsTags value to set. + * @return the IamPasswordPolicyProperties object itself. + */ + public IamPasswordPolicyProperties withAwsTags(Map awsTags) { + this.awsTags = awsTags; + return this; + } + + /** + * Get the provisioningState property: The status of the last operation. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (awsProperties() != null) { + awsProperties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("awsProperties", this.awsProperties); + jsonWriter.writeStringField("publicCloudConnectorsResourceId", this.publicCloudConnectorsResourceId); + jsonWriter.writeStringField("awsAccountId", this.awsAccountId); + jsonWriter.writeStringField("arn", this.arn); + jsonWriter.writeStringField("publicCloudResourceName", this.publicCloudResourceName); + jsonWriter.writeStringField("awsSourceSchema", this.awsSourceSchema); + jsonWriter.writeStringField("awsRegion", this.awsRegion); + jsonWriter.writeMapField("awsTags", this.awsTags, (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of IamPasswordPolicyProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of IamPasswordPolicyProperties if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the IamPasswordPolicyProperties. + */ + public static IamPasswordPolicyProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + IamPasswordPolicyProperties deserializedIamPasswordPolicyProperties = new IamPasswordPolicyProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("awsProperties".equals(fieldName)) { + deserializedIamPasswordPolicyProperties.awsProperties + = AwsIamPasswordPolicyProperties.fromJson(reader); + } else if ("publicCloudConnectorsResourceId".equals(fieldName)) { + deserializedIamPasswordPolicyProperties.publicCloudConnectorsResourceId = reader.getString(); + } else if ("awsAccountId".equals(fieldName)) { + deserializedIamPasswordPolicyProperties.awsAccountId = reader.getString(); + } else if ("arn".equals(fieldName)) { + deserializedIamPasswordPolicyProperties.arn = reader.getString(); + } else if ("publicCloudResourceName".equals(fieldName)) { + deserializedIamPasswordPolicyProperties.publicCloudResourceName = reader.getString(); + } else if ("awsSourceSchema".equals(fieldName)) { + deserializedIamPasswordPolicyProperties.awsSourceSchema = reader.getString(); + } else if ("awsRegion".equals(fieldName)) { + deserializedIamPasswordPolicyProperties.awsRegion = reader.getString(); + } else if ("awsTags".equals(fieldName)) { + Map awsTags = reader.readMap(reader1 -> reader1.getString()); + deserializedIamPasswordPolicyProperties.awsTags = awsTags; + } else if ("provisioningState".equals(fieldName)) { + deserializedIamPasswordPolicyProperties.provisioningState + = ProvisioningState.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedIamPasswordPolicyProperties; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/IamPasswordPolicyTagsUpdate.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/IamPasswordPolicyTagsUpdate.java new file mode 100644 index 000000000000..65572e041e87 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/IamPasswordPolicyTagsUpdate.java @@ -0,0 +1,95 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.Map; + +/** + * The type used for updating tags in IamPasswordPolicy resources. + */ +@Fluent +public final class IamPasswordPolicyTagsUpdate implements JsonSerializable { + /* + * Resource tags. + */ + private Map tags; + + /** + * Creates an instance of IamPasswordPolicyTagsUpdate class. + */ + public IamPasswordPolicyTagsUpdate() { + } + + /** + * Get the tags property: Resource tags. + * + * @return the tags value. + */ + public Map tags() { + return this.tags; + } + + /** + * Set the tags property: Resource tags. + * + * @param tags the tags value to set. + * @return the IamPasswordPolicyTagsUpdate object itself. + */ + public IamPasswordPolicyTagsUpdate withTags(Map tags) { + this.tags = tags; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeMapField("tags", this.tags, (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of IamPasswordPolicyTagsUpdate from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of IamPasswordPolicyTagsUpdate if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the IamPasswordPolicyTagsUpdate. + */ + public static IamPasswordPolicyTagsUpdate fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + IamPasswordPolicyTagsUpdate deserializedIamPasswordPolicyTagsUpdate = new IamPasswordPolicyTagsUpdate(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedIamPasswordPolicyTagsUpdate.tags = tags; + } else { + reader.skipChildren(); + } + } + + return deserializedIamPasswordPolicyTagsUpdate; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/IamPolicyVersion.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/IamPolicyVersion.java new file mode 100644 index 000000000000..c673fa9865a6 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/IamPolicyVersion.java @@ -0,0 +1,252 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.awsconnector.fluent.models.IamPolicyVersionInner; +import java.util.Map; + +/** + * An immutable client-side representation of IamPolicyVersion. + */ +public interface IamPolicyVersion { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the location property: The geo-location where the resource lives. + * + * @return the location value. + */ + String location(); + + /** + * Gets the tags property: Resource tags. + * + * @return the tags value. + */ + Map tags(); + + /** + * Gets the properties property: The resource-specific properties for this resource. + * + * @return the properties value. + */ + IamPolicyVersionProperties properties(); + + /** + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the region of the resource. + * + * @return the region of the resource. + */ + Region region(); + + /** + * Gets the name of the resource region. + * + * @return the name of the resource region. + */ + String regionName(); + + /** + * Gets the name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + + /** + * Gets the inner com.azure.resourcemanager.awsconnector.fluent.models.IamPolicyVersionInner object. + * + * @return the inner object. + */ + IamPolicyVersionInner innerModel(); + + /** + * The entirety of the IamPolicyVersion definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithLocation, + DefinitionStages.WithResourceGroup, DefinitionStages.WithCreate { + } + + /** + * The IamPolicyVersion definition stages. + */ + interface DefinitionStages { + /** + * The first stage of the IamPolicyVersion definition. + */ + interface Blank extends WithLocation { + } + + /** + * The stage of the IamPolicyVersion definition allowing to specify location. + */ + interface WithLocation { + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithResourceGroup withRegion(Region location); + + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithResourceGroup withRegion(String location); + } + + /** + * The stage of the IamPolicyVersion definition allowing to specify parent resource. + */ + interface WithResourceGroup { + /** + * Specifies resourceGroupName. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @return the next definition stage. + */ + WithCreate withExistingResourceGroup(String resourceGroupName); + } + + /** + * The stage of the IamPolicyVersion 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.WithProperties { + /** + * Executes the create request. + * + * @return the created resource. + */ + IamPolicyVersion create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + IamPolicyVersion create(Context context); + } + + /** + * The stage of the IamPolicyVersion definition allowing to specify tags. + */ + interface WithTags { + /** + * Specifies the tags property: Resource tags.. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + WithCreate withTags(Map tags); + } + + /** + * The stage of the IamPolicyVersion definition allowing to specify properties. + */ + interface WithProperties { + /** + * Specifies the properties property: The resource-specific properties for this resource.. + * + * @param properties The resource-specific properties for this resource. + * @return the next definition stage. + */ + WithCreate withProperties(IamPolicyVersionProperties properties); + } + } + + /** + * Begins update for the IamPolicyVersion resource. + * + * @return the stage of resource update. + */ + IamPolicyVersion.Update update(); + + /** + * The template for IamPolicyVersion update. + */ + interface Update extends UpdateStages.WithTags { + /** + * Executes the update request. + * + * @return the updated resource. + */ + IamPolicyVersion apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + IamPolicyVersion apply(Context context); + } + + /** + * The IamPolicyVersion update stages. + */ + interface UpdateStages { + /** + * The stage of the IamPolicyVersion update allowing to specify tags. + */ + interface WithTags { + /** + * Specifies the tags property: Resource tags.. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + Update withTags(Map tags); + } + } + + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + IamPolicyVersion refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + IamPolicyVersion refresh(Context context); +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/IamPolicyVersionListResult.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/IamPolicyVersionListResult.java new file mode 100644 index 000000000000..8383f9109f8e --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/IamPolicyVersionListResult.java @@ -0,0 +1,136 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.awsconnector.fluent.models.IamPolicyVersionInner; +import java.io.IOException; +import java.util.List; + +/** + * The response of a IamPolicyVersion list operation. + */ +@Fluent +public final class IamPolicyVersionListResult implements JsonSerializable { + /* + * The IamPolicyVersion items on this page + */ + private List value; + + /* + * The link to the next page of items + */ + private String nextLink; + + /** + * Creates an instance of IamPolicyVersionListResult class. + */ + public IamPolicyVersionListResult() { + } + + /** + * Get the value property: The IamPolicyVersion items on this page. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The IamPolicyVersion items on this page. + * + * @param value the value value to set. + * @return the IamPolicyVersionListResult object itself. + */ + public IamPolicyVersionListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The link to the next page of items. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: The link to the next page of items. + * + * @param nextLink the nextLink value to set. + * @return the IamPolicyVersionListResult object itself. + */ + public IamPolicyVersionListResult withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property value in model IamPolicyVersionListResult")); + } else { + value().forEach(e -> e.validate()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(IamPolicyVersionListResult.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("nextLink", this.nextLink); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of IamPolicyVersionListResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of IamPolicyVersionListResult if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the IamPolicyVersionListResult. + */ + public static IamPolicyVersionListResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + IamPolicyVersionListResult deserializedIamPolicyVersionListResult = new IamPolicyVersionListResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> IamPolicyVersionInner.fromJson(reader1)); + deserializedIamPolicyVersionListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedIamPolicyVersionListResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedIamPolicyVersionListResult; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/IamPolicyVersionProperties.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/IamPolicyVersionProperties.java new file mode 100644 index 000000000000..a2ca5718436d --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/IamPolicyVersionProperties.java @@ -0,0 +1,312 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.Map; + +/** + * Definition of IamPolicyVersion. + */ +@Fluent +public final class IamPolicyVersionProperties implements JsonSerializable { + /* + * AWS Properties + */ + private AwsIamPolicyVersionProperties awsProperties; + + /* + * Public Cloud Connectors Resource ID + */ + private String publicCloudConnectorsResourceId; + + /* + * AWS Account ID + */ + private String awsAccountId; + + /* + * Amazon Resource Name (ARN) + */ + private String arn; + + /* + * Public Cloud Resource Name + */ + private String publicCloudResourceName; + + /* + * AWS Source Schema + */ + private String awsSourceSchema; + + /* + * AWS Region + */ + private String awsRegion; + + /* + * AWS Tags + */ + private Map awsTags; + + /* + * The status of the last operation. + */ + private ProvisioningState provisioningState; + + /** + * Creates an instance of IamPolicyVersionProperties class. + */ + public IamPolicyVersionProperties() { + } + + /** + * Get the awsProperties property: AWS Properties. + * + * @return the awsProperties value. + */ + public AwsIamPolicyVersionProperties awsProperties() { + return this.awsProperties; + } + + /** + * Set the awsProperties property: AWS Properties. + * + * @param awsProperties the awsProperties value to set. + * @return the IamPolicyVersionProperties object itself. + */ + public IamPolicyVersionProperties withAwsProperties(AwsIamPolicyVersionProperties awsProperties) { + this.awsProperties = awsProperties; + return this; + } + + /** + * Get the publicCloudConnectorsResourceId property: Public Cloud Connectors Resource ID. + * + * @return the publicCloudConnectorsResourceId value. + */ + public String publicCloudConnectorsResourceId() { + return this.publicCloudConnectorsResourceId; + } + + /** + * Set the publicCloudConnectorsResourceId property: Public Cloud Connectors Resource ID. + * + * @param publicCloudConnectorsResourceId the publicCloudConnectorsResourceId value to set. + * @return the IamPolicyVersionProperties object itself. + */ + public IamPolicyVersionProperties withPublicCloudConnectorsResourceId(String publicCloudConnectorsResourceId) { + this.publicCloudConnectorsResourceId = publicCloudConnectorsResourceId; + return this; + } + + /** + * Get the awsAccountId property: AWS Account ID. + * + * @return the awsAccountId value. + */ + public String awsAccountId() { + return this.awsAccountId; + } + + /** + * Set the awsAccountId property: AWS Account ID. + * + * @param awsAccountId the awsAccountId value to set. + * @return the IamPolicyVersionProperties object itself. + */ + public IamPolicyVersionProperties withAwsAccountId(String awsAccountId) { + this.awsAccountId = awsAccountId; + return this; + } + + /** + * Get the arn property: Amazon Resource Name (ARN). + * + * @return the arn value. + */ + public String arn() { + return this.arn; + } + + /** + * Set the arn property: Amazon Resource Name (ARN). + * + * @param arn the arn value to set. + * @return the IamPolicyVersionProperties object itself. + */ + public IamPolicyVersionProperties withArn(String arn) { + this.arn = arn; + return this; + } + + /** + * Get the publicCloudResourceName property: Public Cloud Resource Name. + * + * @return the publicCloudResourceName value. + */ + public String publicCloudResourceName() { + return this.publicCloudResourceName; + } + + /** + * Set the publicCloudResourceName property: Public Cloud Resource Name. + * + * @param publicCloudResourceName the publicCloudResourceName value to set. + * @return the IamPolicyVersionProperties object itself. + */ + public IamPolicyVersionProperties withPublicCloudResourceName(String publicCloudResourceName) { + this.publicCloudResourceName = publicCloudResourceName; + return this; + } + + /** + * Get the awsSourceSchema property: AWS Source Schema. + * + * @return the awsSourceSchema value. + */ + public String awsSourceSchema() { + return this.awsSourceSchema; + } + + /** + * Set the awsSourceSchema property: AWS Source Schema. + * + * @param awsSourceSchema the awsSourceSchema value to set. + * @return the IamPolicyVersionProperties object itself. + */ + public IamPolicyVersionProperties withAwsSourceSchema(String awsSourceSchema) { + this.awsSourceSchema = awsSourceSchema; + return this; + } + + /** + * Get the awsRegion property: AWS Region. + * + * @return the awsRegion value. + */ + public String awsRegion() { + return this.awsRegion; + } + + /** + * Set the awsRegion property: AWS Region. + * + * @param awsRegion the awsRegion value to set. + * @return the IamPolicyVersionProperties object itself. + */ + public IamPolicyVersionProperties withAwsRegion(String awsRegion) { + this.awsRegion = awsRegion; + return this; + } + + /** + * Get the awsTags property: AWS Tags. + * + * @return the awsTags value. + */ + public Map awsTags() { + return this.awsTags; + } + + /** + * Set the awsTags property: AWS Tags. + * + * @param awsTags the awsTags value to set. + * @return the IamPolicyVersionProperties object itself. + */ + public IamPolicyVersionProperties withAwsTags(Map awsTags) { + this.awsTags = awsTags; + return this; + } + + /** + * Get the provisioningState property: The status of the last operation. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (awsProperties() != null) { + awsProperties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("awsProperties", this.awsProperties); + jsonWriter.writeStringField("publicCloudConnectorsResourceId", this.publicCloudConnectorsResourceId); + jsonWriter.writeStringField("awsAccountId", this.awsAccountId); + jsonWriter.writeStringField("arn", this.arn); + jsonWriter.writeStringField("publicCloudResourceName", this.publicCloudResourceName); + jsonWriter.writeStringField("awsSourceSchema", this.awsSourceSchema); + jsonWriter.writeStringField("awsRegion", this.awsRegion); + jsonWriter.writeMapField("awsTags", this.awsTags, (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of IamPolicyVersionProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of IamPolicyVersionProperties if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IOException If an error occurs while reading the IamPolicyVersionProperties. + */ + public static IamPolicyVersionProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + IamPolicyVersionProperties deserializedIamPolicyVersionProperties = new IamPolicyVersionProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("awsProperties".equals(fieldName)) { + deserializedIamPolicyVersionProperties.awsProperties + = AwsIamPolicyVersionProperties.fromJson(reader); + } else if ("publicCloudConnectorsResourceId".equals(fieldName)) { + deserializedIamPolicyVersionProperties.publicCloudConnectorsResourceId = reader.getString(); + } else if ("awsAccountId".equals(fieldName)) { + deserializedIamPolicyVersionProperties.awsAccountId = reader.getString(); + } else if ("arn".equals(fieldName)) { + deserializedIamPolicyVersionProperties.arn = reader.getString(); + } else if ("publicCloudResourceName".equals(fieldName)) { + deserializedIamPolicyVersionProperties.publicCloudResourceName = reader.getString(); + } else if ("awsSourceSchema".equals(fieldName)) { + deserializedIamPolicyVersionProperties.awsSourceSchema = reader.getString(); + } else if ("awsRegion".equals(fieldName)) { + deserializedIamPolicyVersionProperties.awsRegion = reader.getString(); + } else if ("awsTags".equals(fieldName)) { + Map awsTags = reader.readMap(reader1 -> reader1.getString()); + deserializedIamPolicyVersionProperties.awsTags = awsTags; + } else if ("provisioningState".equals(fieldName)) { + deserializedIamPolicyVersionProperties.provisioningState + = ProvisioningState.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedIamPolicyVersionProperties; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/IamPolicyVersionTagsUpdate.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/IamPolicyVersionTagsUpdate.java new file mode 100644 index 000000000000..745a3f9d97d6 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/IamPolicyVersionTagsUpdate.java @@ -0,0 +1,95 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.Map; + +/** + * The type used for updating tags in IamPolicyVersion resources. + */ +@Fluent +public final class IamPolicyVersionTagsUpdate implements JsonSerializable { + /* + * Resource tags. + */ + private Map tags; + + /** + * Creates an instance of IamPolicyVersionTagsUpdate class. + */ + public IamPolicyVersionTagsUpdate() { + } + + /** + * Get the tags property: Resource tags. + * + * @return the tags value. + */ + public Map tags() { + return this.tags; + } + + /** + * Set the tags property: Resource tags. + * + * @param tags the tags value to set. + * @return the IamPolicyVersionTagsUpdate object itself. + */ + public IamPolicyVersionTagsUpdate withTags(Map tags) { + this.tags = tags; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeMapField("tags", this.tags, (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of IamPolicyVersionTagsUpdate from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of IamPolicyVersionTagsUpdate if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IOException If an error occurs while reading the IamPolicyVersionTagsUpdate. + */ + public static IamPolicyVersionTagsUpdate fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + IamPolicyVersionTagsUpdate deserializedIamPolicyVersionTagsUpdate = new IamPolicyVersionTagsUpdate(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedIamPolicyVersionTagsUpdate.tags = tags; + } else { + reader.skipChildren(); + } + } + + return deserializedIamPolicyVersionTagsUpdate; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/IamPolicyVersions.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/IamPolicyVersions.java new file mode 100644 index 000000000000..dd426b1be28f --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/IamPolicyVersions.java @@ -0,0 +1,157 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** + * Resource collection API of IamPolicyVersions. + */ +public interface IamPolicyVersions { + /** + * List IamPolicyVersion resources by subscription ID. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a IamPolicyVersion list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable list(); + + /** + * List IamPolicyVersion resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a IamPolicyVersion list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable list(Context context); + + /** + * List IamPolicyVersion resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a IamPolicyVersion list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * List IamPolicyVersion resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a IamPolicyVersion list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Get a IamPolicyVersion. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of IamPolicyVersion. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a IamPolicyVersion along with {@link Response}. + */ + Response getByResourceGroupWithResponse(String resourceGroupName, String name, Context context); + + /** + * Get a IamPolicyVersion. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of IamPolicyVersion. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a IamPolicyVersion. + */ + IamPolicyVersion getByResourceGroup(String resourceGroupName, String name); + + /** + * Delete a IamPolicyVersion. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of IamPolicyVersion. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByResourceGroup(String resourceGroupName, String name); + + /** + * Delete a IamPolicyVersion. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of IamPolicyVersion. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String name, Context context); + + /** + * Get a IamPolicyVersion. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a IamPolicyVersion along with {@link Response}. + */ + IamPolicyVersion getById(String id); + + /** + * Get a IamPolicyVersion. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a IamPolicyVersion along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Delete a IamPolicyVersion. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteById(String id); + + /** + * Delete a IamPolicyVersion. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new IamPolicyVersion resource. + * + * @param name resource name. + * @return the first stage of the new IamPolicyVersion definition. + */ + IamPolicyVersion.DefinitionStages.Blank define(String name); +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/IamRole.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/IamRole.java new file mode 100644 index 000000000000..9c93770b86f4 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/IamRole.java @@ -0,0 +1,252 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.awsconnector.fluent.models.IamRoleInner; +import java.util.Map; + +/** + * An immutable client-side representation of IamRole. + */ +public interface IamRole { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the location property: The geo-location where the resource lives. + * + * @return the location value. + */ + String location(); + + /** + * Gets the tags property: Resource tags. + * + * @return the tags value. + */ + Map tags(); + + /** + * Gets the properties property: The resource-specific properties for this resource. + * + * @return the properties value. + */ + IamRoleProperties properties(); + + /** + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the region of the resource. + * + * @return the region of the resource. + */ + Region region(); + + /** + * Gets the name of the resource region. + * + * @return the name of the resource region. + */ + String regionName(); + + /** + * Gets the name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + + /** + * Gets the inner com.azure.resourcemanager.awsconnector.fluent.models.IamRoleInner object. + * + * @return the inner object. + */ + IamRoleInner innerModel(); + + /** + * The entirety of the IamRole definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithLocation, + DefinitionStages.WithResourceGroup, DefinitionStages.WithCreate { + } + + /** + * The IamRole definition stages. + */ + interface DefinitionStages { + /** + * The first stage of the IamRole definition. + */ + interface Blank extends WithLocation { + } + + /** + * The stage of the IamRole definition allowing to specify location. + */ + interface WithLocation { + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithResourceGroup withRegion(Region location); + + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithResourceGroup withRegion(String location); + } + + /** + * The stage of the IamRole definition allowing to specify parent resource. + */ + interface WithResourceGroup { + /** + * Specifies resourceGroupName. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @return the next definition stage. + */ + WithCreate withExistingResourceGroup(String resourceGroupName); + } + + /** + * The stage of the IamRole 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.WithProperties { + /** + * Executes the create request. + * + * @return the created resource. + */ + IamRole create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + IamRole create(Context context); + } + + /** + * The stage of the IamRole definition allowing to specify tags. + */ + interface WithTags { + /** + * Specifies the tags property: Resource tags.. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + WithCreate withTags(Map tags); + } + + /** + * The stage of the IamRole definition allowing to specify properties. + */ + interface WithProperties { + /** + * Specifies the properties property: The resource-specific properties for this resource.. + * + * @param properties The resource-specific properties for this resource. + * @return the next definition stage. + */ + WithCreate withProperties(IamRoleProperties properties); + } + } + + /** + * Begins update for the IamRole resource. + * + * @return the stage of resource update. + */ + IamRole.Update update(); + + /** + * The template for IamRole update. + */ + interface Update extends UpdateStages.WithTags { + /** + * Executes the update request. + * + * @return the updated resource. + */ + IamRole apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + IamRole apply(Context context); + } + + /** + * The IamRole update stages. + */ + interface UpdateStages { + /** + * The stage of the IamRole update allowing to specify tags. + */ + interface WithTags { + /** + * Specifies the tags property: Resource tags.. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + Update withTags(Map tags); + } + } + + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + IamRole refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + IamRole refresh(Context context); +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/IamRoleListResult.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/IamRoleListResult.java new file mode 100644 index 000000000000..768be3c4858c --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/IamRoleListResult.java @@ -0,0 +1,134 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.awsconnector.fluent.models.IamRoleInner; +import java.io.IOException; +import java.util.List; + +/** + * The response of a IamRole list operation. + */ +@Fluent +public final class IamRoleListResult implements JsonSerializable { + /* + * The IamRole items on this page + */ + private List value; + + /* + * The link to the next page of items + */ + private String nextLink; + + /** + * Creates an instance of IamRoleListResult class. + */ + public IamRoleListResult() { + } + + /** + * Get the value property: The IamRole items on this page. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The IamRole items on this page. + * + * @param value the value value to set. + * @return the IamRoleListResult object itself. + */ + public IamRoleListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The link to the next page of items. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: The link to the next page of items. + * + * @param nextLink the nextLink value to set. + * @return the IamRoleListResult object itself. + */ + public IamRoleListResult withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property value in model IamRoleListResult")); + } else { + value().forEach(e -> e.validate()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(IamRoleListResult.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("nextLink", this.nextLink); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of IamRoleListResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of IamRoleListResult if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the IamRoleListResult. + */ + public static IamRoleListResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + IamRoleListResult deserializedIamRoleListResult = new IamRoleListResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value = reader.readArray(reader1 -> IamRoleInner.fromJson(reader1)); + deserializedIamRoleListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedIamRoleListResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedIamRoleListResult; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/IamRoleProperties.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/IamRoleProperties.java new file mode 100644 index 000000000000..63e3b6a96d36 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/IamRoleProperties.java @@ -0,0 +1,310 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.Map; + +/** + * Definition of IamRole. + */ +@Fluent +public final class IamRoleProperties implements JsonSerializable { + /* + * AWS Properties + */ + private AwsIamRoleProperties awsProperties; + + /* + * Public Cloud Connectors Resource ID + */ + private String publicCloudConnectorsResourceId; + + /* + * AWS Account ID + */ + private String awsAccountId; + + /* + * Amazon Resource Name (ARN) + */ + private String arn; + + /* + * Public Cloud Resource Name + */ + private String publicCloudResourceName; + + /* + * AWS Source Schema + */ + private String awsSourceSchema; + + /* + * AWS Region + */ + private String awsRegion; + + /* + * AWS Tags + */ + private Map awsTags; + + /* + * The status of the last operation. + */ + private ProvisioningState provisioningState; + + /** + * Creates an instance of IamRoleProperties class. + */ + public IamRoleProperties() { + } + + /** + * Get the awsProperties property: AWS Properties. + * + * @return the awsProperties value. + */ + public AwsIamRoleProperties awsProperties() { + return this.awsProperties; + } + + /** + * Set the awsProperties property: AWS Properties. + * + * @param awsProperties the awsProperties value to set. + * @return the IamRoleProperties object itself. + */ + public IamRoleProperties withAwsProperties(AwsIamRoleProperties awsProperties) { + this.awsProperties = awsProperties; + return this; + } + + /** + * Get the publicCloudConnectorsResourceId property: Public Cloud Connectors Resource ID. + * + * @return the publicCloudConnectorsResourceId value. + */ + public String publicCloudConnectorsResourceId() { + return this.publicCloudConnectorsResourceId; + } + + /** + * Set the publicCloudConnectorsResourceId property: Public Cloud Connectors Resource ID. + * + * @param publicCloudConnectorsResourceId the publicCloudConnectorsResourceId value to set. + * @return the IamRoleProperties object itself. + */ + public IamRoleProperties withPublicCloudConnectorsResourceId(String publicCloudConnectorsResourceId) { + this.publicCloudConnectorsResourceId = publicCloudConnectorsResourceId; + return this; + } + + /** + * Get the awsAccountId property: AWS Account ID. + * + * @return the awsAccountId value. + */ + public String awsAccountId() { + return this.awsAccountId; + } + + /** + * Set the awsAccountId property: AWS Account ID. + * + * @param awsAccountId the awsAccountId value to set. + * @return the IamRoleProperties object itself. + */ + public IamRoleProperties withAwsAccountId(String awsAccountId) { + this.awsAccountId = awsAccountId; + return this; + } + + /** + * Get the arn property: Amazon Resource Name (ARN). + * + * @return the arn value. + */ + public String arn() { + return this.arn; + } + + /** + * Set the arn property: Amazon Resource Name (ARN). + * + * @param arn the arn value to set. + * @return the IamRoleProperties object itself. + */ + public IamRoleProperties withArn(String arn) { + this.arn = arn; + return this; + } + + /** + * Get the publicCloudResourceName property: Public Cloud Resource Name. + * + * @return the publicCloudResourceName value. + */ + public String publicCloudResourceName() { + return this.publicCloudResourceName; + } + + /** + * Set the publicCloudResourceName property: Public Cloud Resource Name. + * + * @param publicCloudResourceName the publicCloudResourceName value to set. + * @return the IamRoleProperties object itself. + */ + public IamRoleProperties withPublicCloudResourceName(String publicCloudResourceName) { + this.publicCloudResourceName = publicCloudResourceName; + return this; + } + + /** + * Get the awsSourceSchema property: AWS Source Schema. + * + * @return the awsSourceSchema value. + */ + public String awsSourceSchema() { + return this.awsSourceSchema; + } + + /** + * Set the awsSourceSchema property: AWS Source Schema. + * + * @param awsSourceSchema the awsSourceSchema value to set. + * @return the IamRoleProperties object itself. + */ + public IamRoleProperties withAwsSourceSchema(String awsSourceSchema) { + this.awsSourceSchema = awsSourceSchema; + return this; + } + + /** + * Get the awsRegion property: AWS Region. + * + * @return the awsRegion value. + */ + public String awsRegion() { + return this.awsRegion; + } + + /** + * Set the awsRegion property: AWS Region. + * + * @param awsRegion the awsRegion value to set. + * @return the IamRoleProperties object itself. + */ + public IamRoleProperties withAwsRegion(String awsRegion) { + this.awsRegion = awsRegion; + return this; + } + + /** + * Get the awsTags property: AWS Tags. + * + * @return the awsTags value. + */ + public Map awsTags() { + return this.awsTags; + } + + /** + * Set the awsTags property: AWS Tags. + * + * @param awsTags the awsTags value to set. + * @return the IamRoleProperties object itself. + */ + public IamRoleProperties withAwsTags(Map awsTags) { + this.awsTags = awsTags; + return this; + } + + /** + * Get the provisioningState property: The status of the last operation. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (awsProperties() != null) { + awsProperties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("awsProperties", this.awsProperties); + jsonWriter.writeStringField("publicCloudConnectorsResourceId", this.publicCloudConnectorsResourceId); + jsonWriter.writeStringField("awsAccountId", this.awsAccountId); + jsonWriter.writeStringField("arn", this.arn); + jsonWriter.writeStringField("publicCloudResourceName", this.publicCloudResourceName); + jsonWriter.writeStringField("awsSourceSchema", this.awsSourceSchema); + jsonWriter.writeStringField("awsRegion", this.awsRegion); + jsonWriter.writeMapField("awsTags", this.awsTags, (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of IamRoleProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of IamRoleProperties if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the IamRoleProperties. + */ + public static IamRoleProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + IamRoleProperties deserializedIamRoleProperties = new IamRoleProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("awsProperties".equals(fieldName)) { + deserializedIamRoleProperties.awsProperties = AwsIamRoleProperties.fromJson(reader); + } else if ("publicCloudConnectorsResourceId".equals(fieldName)) { + deserializedIamRoleProperties.publicCloudConnectorsResourceId = reader.getString(); + } else if ("awsAccountId".equals(fieldName)) { + deserializedIamRoleProperties.awsAccountId = reader.getString(); + } else if ("arn".equals(fieldName)) { + deserializedIamRoleProperties.arn = reader.getString(); + } else if ("publicCloudResourceName".equals(fieldName)) { + deserializedIamRoleProperties.publicCloudResourceName = reader.getString(); + } else if ("awsSourceSchema".equals(fieldName)) { + deserializedIamRoleProperties.awsSourceSchema = reader.getString(); + } else if ("awsRegion".equals(fieldName)) { + deserializedIamRoleProperties.awsRegion = reader.getString(); + } else if ("awsTags".equals(fieldName)) { + Map awsTags = reader.readMap(reader1 -> reader1.getString()); + deserializedIamRoleProperties.awsTags = awsTags; + } else if ("provisioningState".equals(fieldName)) { + deserializedIamRoleProperties.provisioningState = ProvisioningState.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedIamRoleProperties; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/IamRoleTagsUpdate.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/IamRoleTagsUpdate.java new file mode 100644 index 000000000000..2b0cf03fa213 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/IamRoleTagsUpdate.java @@ -0,0 +1,95 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.Map; + +/** + * The type used for updating tags in IamRole resources. + */ +@Fluent +public final class IamRoleTagsUpdate implements JsonSerializable { + /* + * Resource tags. + */ + private Map tags; + + /** + * Creates an instance of IamRoleTagsUpdate class. + */ + public IamRoleTagsUpdate() { + } + + /** + * Get the tags property: Resource tags. + * + * @return the tags value. + */ + public Map tags() { + return this.tags; + } + + /** + * Set the tags property: Resource tags. + * + * @param tags the tags value to set. + * @return the IamRoleTagsUpdate object itself. + */ + public IamRoleTagsUpdate withTags(Map tags) { + this.tags = tags; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeMapField("tags", this.tags, (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of IamRoleTagsUpdate from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of IamRoleTagsUpdate if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the IamRoleTagsUpdate. + */ + public static IamRoleTagsUpdate fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + IamRoleTagsUpdate deserializedIamRoleTagsUpdate = new IamRoleTagsUpdate(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedIamRoleTagsUpdate.tags = tags; + } else { + reader.skipChildren(); + } + } + + return deserializedIamRoleTagsUpdate; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/IamRoles.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/IamRoles.java new file mode 100644 index 000000000000..e8968b91e27b --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/IamRoles.java @@ -0,0 +1,157 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** + * Resource collection API of IamRoles. + */ +public interface IamRoles { + /** + * List IamRole resources by subscription ID. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a IamRole list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable list(); + + /** + * List IamRole resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a IamRole list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable list(Context context); + + /** + * List IamRole resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a IamRole list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * List IamRole resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a IamRole list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Get a IamRole. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of IamRole. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a IamRole along with {@link Response}. + */ + Response getByResourceGroupWithResponse(String resourceGroupName, String name, Context context); + + /** + * Get a IamRole. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of IamRole. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a IamRole. + */ + IamRole getByResourceGroup(String resourceGroupName, String name); + + /** + * Delete a IamRole. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of IamRole. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByResourceGroup(String resourceGroupName, String name); + + /** + * Delete a IamRole. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of IamRole. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String name, Context context); + + /** + * Get a IamRole. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a IamRole along with {@link Response}. + */ + IamRole getById(String id); + + /** + * Get a IamRole. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a IamRole along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Delete a IamRole. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteById(String id); + + /** + * Delete a IamRole. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new IamRole resource. + * + * @param name resource name. + * @return the first stage of the new IamRole definition. + */ + IamRole.DefinitionStages.Blank define(String name); +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/IamServerCertificate.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/IamServerCertificate.java new file mode 100644 index 000000000000..806a57806dcc --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/IamServerCertificate.java @@ -0,0 +1,252 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.awsconnector.fluent.models.IamServerCertificateInner; +import java.util.Map; + +/** + * An immutable client-side representation of IamServerCertificate. + */ +public interface IamServerCertificate { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the location property: The geo-location where the resource lives. + * + * @return the location value. + */ + String location(); + + /** + * Gets the tags property: Resource tags. + * + * @return the tags value. + */ + Map tags(); + + /** + * Gets the properties property: The resource-specific properties for this resource. + * + * @return the properties value. + */ + IamServerCertificateProperties properties(); + + /** + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the region of the resource. + * + * @return the region of the resource. + */ + Region region(); + + /** + * Gets the name of the resource region. + * + * @return the name of the resource region. + */ + String regionName(); + + /** + * Gets the name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + + /** + * Gets the inner com.azure.resourcemanager.awsconnector.fluent.models.IamServerCertificateInner object. + * + * @return the inner object. + */ + IamServerCertificateInner innerModel(); + + /** + * The entirety of the IamServerCertificate definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithLocation, + DefinitionStages.WithResourceGroup, DefinitionStages.WithCreate { + } + + /** + * The IamServerCertificate definition stages. + */ + interface DefinitionStages { + /** + * The first stage of the IamServerCertificate definition. + */ + interface Blank extends WithLocation { + } + + /** + * The stage of the IamServerCertificate definition allowing to specify location. + */ + interface WithLocation { + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithResourceGroup withRegion(Region location); + + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithResourceGroup withRegion(String location); + } + + /** + * The stage of the IamServerCertificate definition allowing to specify parent resource. + */ + interface WithResourceGroup { + /** + * Specifies resourceGroupName. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @return the next definition stage. + */ + WithCreate withExistingResourceGroup(String resourceGroupName); + } + + /** + * The stage of the IamServerCertificate 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.WithProperties { + /** + * Executes the create request. + * + * @return the created resource. + */ + IamServerCertificate create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + IamServerCertificate create(Context context); + } + + /** + * The stage of the IamServerCertificate definition allowing to specify tags. + */ + interface WithTags { + /** + * Specifies the tags property: Resource tags.. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + WithCreate withTags(Map tags); + } + + /** + * The stage of the IamServerCertificate definition allowing to specify properties. + */ + interface WithProperties { + /** + * Specifies the properties property: The resource-specific properties for this resource.. + * + * @param properties The resource-specific properties for this resource. + * @return the next definition stage. + */ + WithCreate withProperties(IamServerCertificateProperties properties); + } + } + + /** + * Begins update for the IamServerCertificate resource. + * + * @return the stage of resource update. + */ + IamServerCertificate.Update update(); + + /** + * The template for IamServerCertificate update. + */ + interface Update extends UpdateStages.WithTags { + /** + * Executes the update request. + * + * @return the updated resource. + */ + IamServerCertificate apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + IamServerCertificate apply(Context context); + } + + /** + * The IamServerCertificate update stages. + */ + interface UpdateStages { + /** + * The stage of the IamServerCertificate update allowing to specify tags. + */ + interface WithTags { + /** + * Specifies the tags property: Resource tags.. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + Update withTags(Map tags); + } + } + + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + IamServerCertificate refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + IamServerCertificate refresh(Context context); +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/IamServerCertificateListResult.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/IamServerCertificateListResult.java new file mode 100644 index 000000000000..106078a4bca4 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/IamServerCertificateListResult.java @@ -0,0 +1,137 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.awsconnector.fluent.models.IamServerCertificateInner; +import java.io.IOException; +import java.util.List; + +/** + * The response of a IamServerCertificate list operation. + */ +@Fluent +public final class IamServerCertificateListResult implements JsonSerializable { + /* + * The IamServerCertificate items on this page + */ + private List value; + + /* + * The link to the next page of items + */ + private String nextLink; + + /** + * Creates an instance of IamServerCertificateListResult class. + */ + public IamServerCertificateListResult() { + } + + /** + * Get the value property: The IamServerCertificate items on this page. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The IamServerCertificate items on this page. + * + * @param value the value value to set. + * @return the IamServerCertificateListResult object itself. + */ + public IamServerCertificateListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The link to the next page of items. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: The link to the next page of items. + * + * @param nextLink the nextLink value to set. + * @return the IamServerCertificateListResult object itself. + */ + public IamServerCertificateListResult withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property value in model IamServerCertificateListResult")); + } else { + value().forEach(e -> e.validate()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(IamServerCertificateListResult.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("nextLink", this.nextLink); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of IamServerCertificateListResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of IamServerCertificateListResult if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the IamServerCertificateListResult. + */ + public static IamServerCertificateListResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + IamServerCertificateListResult deserializedIamServerCertificateListResult + = new IamServerCertificateListResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> IamServerCertificateInner.fromJson(reader1)); + deserializedIamServerCertificateListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedIamServerCertificateListResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedIamServerCertificateListResult; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/IamServerCertificateProperties.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/IamServerCertificateProperties.java new file mode 100644 index 000000000000..90c1a8a32e0c --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/IamServerCertificateProperties.java @@ -0,0 +1,313 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.Map; + +/** + * Definition of IamServerCertificate. + */ +@Fluent +public final class IamServerCertificateProperties implements JsonSerializable { + /* + * AWS Properties + */ + private AwsIamServerCertificateProperties awsProperties; + + /* + * Public Cloud Connectors Resource ID + */ + private String publicCloudConnectorsResourceId; + + /* + * AWS Account ID + */ + private String awsAccountId; + + /* + * Amazon Resource Name (ARN) + */ + private String arn; + + /* + * Public Cloud Resource Name + */ + private String publicCloudResourceName; + + /* + * AWS Source Schema + */ + private String awsSourceSchema; + + /* + * AWS Region + */ + private String awsRegion; + + /* + * AWS Tags + */ + private Map awsTags; + + /* + * The status of the last operation. + */ + private ProvisioningState provisioningState; + + /** + * Creates an instance of IamServerCertificateProperties class. + */ + public IamServerCertificateProperties() { + } + + /** + * Get the awsProperties property: AWS Properties. + * + * @return the awsProperties value. + */ + public AwsIamServerCertificateProperties awsProperties() { + return this.awsProperties; + } + + /** + * Set the awsProperties property: AWS Properties. + * + * @param awsProperties the awsProperties value to set. + * @return the IamServerCertificateProperties object itself. + */ + public IamServerCertificateProperties withAwsProperties(AwsIamServerCertificateProperties awsProperties) { + this.awsProperties = awsProperties; + return this; + } + + /** + * Get the publicCloudConnectorsResourceId property: Public Cloud Connectors Resource ID. + * + * @return the publicCloudConnectorsResourceId value. + */ + public String publicCloudConnectorsResourceId() { + return this.publicCloudConnectorsResourceId; + } + + /** + * Set the publicCloudConnectorsResourceId property: Public Cloud Connectors Resource ID. + * + * @param publicCloudConnectorsResourceId the publicCloudConnectorsResourceId value to set. + * @return the IamServerCertificateProperties object itself. + */ + public IamServerCertificateProperties withPublicCloudConnectorsResourceId(String publicCloudConnectorsResourceId) { + this.publicCloudConnectorsResourceId = publicCloudConnectorsResourceId; + return this; + } + + /** + * Get the awsAccountId property: AWS Account ID. + * + * @return the awsAccountId value. + */ + public String awsAccountId() { + return this.awsAccountId; + } + + /** + * Set the awsAccountId property: AWS Account ID. + * + * @param awsAccountId the awsAccountId value to set. + * @return the IamServerCertificateProperties object itself. + */ + public IamServerCertificateProperties withAwsAccountId(String awsAccountId) { + this.awsAccountId = awsAccountId; + return this; + } + + /** + * Get the arn property: Amazon Resource Name (ARN). + * + * @return the arn value. + */ + public String arn() { + return this.arn; + } + + /** + * Set the arn property: Amazon Resource Name (ARN). + * + * @param arn the arn value to set. + * @return the IamServerCertificateProperties object itself. + */ + public IamServerCertificateProperties withArn(String arn) { + this.arn = arn; + return this; + } + + /** + * Get the publicCloudResourceName property: Public Cloud Resource Name. + * + * @return the publicCloudResourceName value. + */ + public String publicCloudResourceName() { + return this.publicCloudResourceName; + } + + /** + * Set the publicCloudResourceName property: Public Cloud Resource Name. + * + * @param publicCloudResourceName the publicCloudResourceName value to set. + * @return the IamServerCertificateProperties object itself. + */ + public IamServerCertificateProperties withPublicCloudResourceName(String publicCloudResourceName) { + this.publicCloudResourceName = publicCloudResourceName; + return this; + } + + /** + * Get the awsSourceSchema property: AWS Source Schema. + * + * @return the awsSourceSchema value. + */ + public String awsSourceSchema() { + return this.awsSourceSchema; + } + + /** + * Set the awsSourceSchema property: AWS Source Schema. + * + * @param awsSourceSchema the awsSourceSchema value to set. + * @return the IamServerCertificateProperties object itself. + */ + public IamServerCertificateProperties withAwsSourceSchema(String awsSourceSchema) { + this.awsSourceSchema = awsSourceSchema; + return this; + } + + /** + * Get the awsRegion property: AWS Region. + * + * @return the awsRegion value. + */ + public String awsRegion() { + return this.awsRegion; + } + + /** + * Set the awsRegion property: AWS Region. + * + * @param awsRegion the awsRegion value to set. + * @return the IamServerCertificateProperties object itself. + */ + public IamServerCertificateProperties withAwsRegion(String awsRegion) { + this.awsRegion = awsRegion; + return this; + } + + /** + * Get the awsTags property: AWS Tags. + * + * @return the awsTags value. + */ + public Map awsTags() { + return this.awsTags; + } + + /** + * Set the awsTags property: AWS Tags. + * + * @param awsTags the awsTags value to set. + * @return the IamServerCertificateProperties object itself. + */ + public IamServerCertificateProperties withAwsTags(Map awsTags) { + this.awsTags = awsTags; + return this; + } + + /** + * Get the provisioningState property: The status of the last operation. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (awsProperties() != null) { + awsProperties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("awsProperties", this.awsProperties); + jsonWriter.writeStringField("publicCloudConnectorsResourceId", this.publicCloudConnectorsResourceId); + jsonWriter.writeStringField("awsAccountId", this.awsAccountId); + jsonWriter.writeStringField("arn", this.arn); + jsonWriter.writeStringField("publicCloudResourceName", this.publicCloudResourceName); + jsonWriter.writeStringField("awsSourceSchema", this.awsSourceSchema); + jsonWriter.writeStringField("awsRegion", this.awsRegion); + jsonWriter.writeMapField("awsTags", this.awsTags, (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of IamServerCertificateProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of IamServerCertificateProperties if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the IamServerCertificateProperties. + */ + public static IamServerCertificateProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + IamServerCertificateProperties deserializedIamServerCertificateProperties + = new IamServerCertificateProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("awsProperties".equals(fieldName)) { + deserializedIamServerCertificateProperties.awsProperties + = AwsIamServerCertificateProperties.fromJson(reader); + } else if ("publicCloudConnectorsResourceId".equals(fieldName)) { + deserializedIamServerCertificateProperties.publicCloudConnectorsResourceId = reader.getString(); + } else if ("awsAccountId".equals(fieldName)) { + deserializedIamServerCertificateProperties.awsAccountId = reader.getString(); + } else if ("arn".equals(fieldName)) { + deserializedIamServerCertificateProperties.arn = reader.getString(); + } else if ("publicCloudResourceName".equals(fieldName)) { + deserializedIamServerCertificateProperties.publicCloudResourceName = reader.getString(); + } else if ("awsSourceSchema".equals(fieldName)) { + deserializedIamServerCertificateProperties.awsSourceSchema = reader.getString(); + } else if ("awsRegion".equals(fieldName)) { + deserializedIamServerCertificateProperties.awsRegion = reader.getString(); + } else if ("awsTags".equals(fieldName)) { + Map awsTags = reader.readMap(reader1 -> reader1.getString()); + deserializedIamServerCertificateProperties.awsTags = awsTags; + } else if ("provisioningState".equals(fieldName)) { + deserializedIamServerCertificateProperties.provisioningState + = ProvisioningState.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedIamServerCertificateProperties; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/IamServerCertificateTagsUpdate.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/IamServerCertificateTagsUpdate.java new file mode 100644 index 000000000000..c84a6168215b --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/IamServerCertificateTagsUpdate.java @@ -0,0 +1,96 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.Map; + +/** + * The type used for updating tags in IamServerCertificate resources. + */ +@Fluent +public final class IamServerCertificateTagsUpdate implements JsonSerializable { + /* + * Resource tags. + */ + private Map tags; + + /** + * Creates an instance of IamServerCertificateTagsUpdate class. + */ + public IamServerCertificateTagsUpdate() { + } + + /** + * Get the tags property: Resource tags. + * + * @return the tags value. + */ + public Map tags() { + return this.tags; + } + + /** + * Set the tags property: Resource tags. + * + * @param tags the tags value to set. + * @return the IamServerCertificateTagsUpdate object itself. + */ + public IamServerCertificateTagsUpdate withTags(Map tags) { + this.tags = tags; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeMapField("tags", this.tags, (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of IamServerCertificateTagsUpdate from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of IamServerCertificateTagsUpdate if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the IamServerCertificateTagsUpdate. + */ + public static IamServerCertificateTagsUpdate fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + IamServerCertificateTagsUpdate deserializedIamServerCertificateTagsUpdate + = new IamServerCertificateTagsUpdate(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedIamServerCertificateTagsUpdate.tags = tags; + } else { + reader.skipChildren(); + } + } + + return deserializedIamServerCertificateTagsUpdate; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/IamServerCertificates.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/IamServerCertificates.java new file mode 100644 index 000000000000..ad92b1d07be9 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/IamServerCertificates.java @@ -0,0 +1,158 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** + * Resource collection API of IamServerCertificates. + */ +public interface IamServerCertificates { + /** + * List IamServerCertificate resources by subscription ID. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a IamServerCertificate list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable list(); + + /** + * List IamServerCertificate resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a IamServerCertificate list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable list(Context context); + + /** + * List IamServerCertificate resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a IamServerCertificate list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * List IamServerCertificate resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a IamServerCertificate list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Get a IamServerCertificate. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of IamServerCertificate. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a IamServerCertificate along with {@link Response}. + */ + Response getByResourceGroupWithResponse(String resourceGroupName, String name, + Context context); + + /** + * Get a IamServerCertificate. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of IamServerCertificate. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a IamServerCertificate. + */ + IamServerCertificate getByResourceGroup(String resourceGroupName, String name); + + /** + * Delete a IamServerCertificate. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of IamServerCertificate. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByResourceGroup(String resourceGroupName, String name); + + /** + * Delete a IamServerCertificate. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of IamServerCertificate. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String name, Context context); + + /** + * Get a IamServerCertificate. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a IamServerCertificate along with {@link Response}. + */ + IamServerCertificate getById(String id); + + /** + * Get a IamServerCertificate. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a IamServerCertificate along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Delete a IamServerCertificate. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteById(String id); + + /** + * Delete a IamServerCertificate. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new IamServerCertificate resource. + * + * @param name resource name. + * @return the first stage of the new IamServerCertificate definition. + */ + IamServerCertificate.DefinitionStages.Blank define(String name); +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/IamVirtualMfaDevice.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/IamVirtualMfaDevice.java new file mode 100644 index 000000000000..cd18337284f3 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/IamVirtualMfaDevice.java @@ -0,0 +1,252 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.awsconnector.fluent.models.IamVirtualMfaDeviceInner; +import java.util.Map; + +/** + * An immutable client-side representation of IamVirtualMfaDevice. + */ +public interface IamVirtualMfaDevice { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the location property: The geo-location where the resource lives. + * + * @return the location value. + */ + String location(); + + /** + * Gets the tags property: Resource tags. + * + * @return the tags value. + */ + Map tags(); + + /** + * Gets the properties property: The resource-specific properties for this resource. + * + * @return the properties value. + */ + IamVirtualMfaDeviceProperties properties(); + + /** + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the region of the resource. + * + * @return the region of the resource. + */ + Region region(); + + /** + * Gets the name of the resource region. + * + * @return the name of the resource region. + */ + String regionName(); + + /** + * Gets the name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + + /** + * Gets the inner com.azure.resourcemanager.awsconnector.fluent.models.IamVirtualMfaDeviceInner object. + * + * @return the inner object. + */ + IamVirtualMfaDeviceInner innerModel(); + + /** + * The entirety of the IamVirtualMfaDevice definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithLocation, + DefinitionStages.WithResourceGroup, DefinitionStages.WithCreate { + } + + /** + * The IamVirtualMfaDevice definition stages. + */ + interface DefinitionStages { + /** + * The first stage of the IamVirtualMfaDevice definition. + */ + interface Blank extends WithLocation { + } + + /** + * The stage of the IamVirtualMfaDevice definition allowing to specify location. + */ + interface WithLocation { + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithResourceGroup withRegion(Region location); + + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithResourceGroup withRegion(String location); + } + + /** + * The stage of the IamVirtualMfaDevice definition allowing to specify parent resource. + */ + interface WithResourceGroup { + /** + * Specifies resourceGroupName. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @return the next definition stage. + */ + WithCreate withExistingResourceGroup(String resourceGroupName); + } + + /** + * The stage of the IamVirtualMfaDevice 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.WithProperties { + /** + * Executes the create request. + * + * @return the created resource. + */ + IamVirtualMfaDevice create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + IamVirtualMfaDevice create(Context context); + } + + /** + * The stage of the IamVirtualMfaDevice definition allowing to specify tags. + */ + interface WithTags { + /** + * Specifies the tags property: Resource tags.. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + WithCreate withTags(Map tags); + } + + /** + * The stage of the IamVirtualMfaDevice definition allowing to specify properties. + */ + interface WithProperties { + /** + * Specifies the properties property: The resource-specific properties for this resource.. + * + * @param properties The resource-specific properties for this resource. + * @return the next definition stage. + */ + WithCreate withProperties(IamVirtualMfaDeviceProperties properties); + } + } + + /** + * Begins update for the IamVirtualMfaDevice resource. + * + * @return the stage of resource update. + */ + IamVirtualMfaDevice.Update update(); + + /** + * The template for IamVirtualMfaDevice update. + */ + interface Update extends UpdateStages.WithTags { + /** + * Executes the update request. + * + * @return the updated resource. + */ + IamVirtualMfaDevice apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + IamVirtualMfaDevice apply(Context context); + } + + /** + * The IamVirtualMfaDevice update stages. + */ + interface UpdateStages { + /** + * The stage of the IamVirtualMfaDevice update allowing to specify tags. + */ + interface WithTags { + /** + * Specifies the tags property: Resource tags.. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + Update withTags(Map tags); + } + } + + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + IamVirtualMfaDevice refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + IamVirtualMfaDevice refresh(Context context); +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/IamVirtualMfaDeviceListResult.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/IamVirtualMfaDeviceListResult.java new file mode 100644 index 000000000000..075034bf468d --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/IamVirtualMfaDeviceListResult.java @@ -0,0 +1,137 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.awsconnector.fluent.models.IamVirtualMfaDeviceInner; +import java.io.IOException; +import java.util.List; + +/** + * The response of a IamVirtualMFADevice list operation. + */ +@Fluent +public final class IamVirtualMfaDeviceListResult implements JsonSerializable { + /* + * The IamVirtualMFADevice items on this page + */ + private List value; + + /* + * The link to the next page of items + */ + private String nextLink; + + /** + * Creates an instance of IamVirtualMfaDeviceListResult class. + */ + public IamVirtualMfaDeviceListResult() { + } + + /** + * Get the value property: The IamVirtualMFADevice items on this page. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The IamVirtualMFADevice items on this page. + * + * @param value the value value to set. + * @return the IamVirtualMfaDeviceListResult object itself. + */ + public IamVirtualMfaDeviceListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The link to the next page of items. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: The link to the next page of items. + * + * @param nextLink the nextLink value to set. + * @return the IamVirtualMfaDeviceListResult object itself. + */ + public IamVirtualMfaDeviceListResult withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property value in model IamVirtualMfaDeviceListResult")); + } else { + value().forEach(e -> e.validate()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(IamVirtualMfaDeviceListResult.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("nextLink", this.nextLink); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of IamVirtualMfaDeviceListResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of IamVirtualMfaDeviceListResult if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the IamVirtualMfaDeviceListResult. + */ + public static IamVirtualMfaDeviceListResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + IamVirtualMfaDeviceListResult deserializedIamVirtualMfaDeviceListResult + = new IamVirtualMfaDeviceListResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> IamVirtualMfaDeviceInner.fromJson(reader1)); + deserializedIamVirtualMfaDeviceListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedIamVirtualMfaDeviceListResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedIamVirtualMfaDeviceListResult; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/IamVirtualMfaDeviceProperties.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/IamVirtualMfaDeviceProperties.java new file mode 100644 index 000000000000..83af57d63f4e --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/IamVirtualMfaDeviceProperties.java @@ -0,0 +1,313 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.Map; + +/** + * Definition of IamVirtualMFADevice. + */ +@Fluent +public final class IamVirtualMfaDeviceProperties implements JsonSerializable { + /* + * AWS Properties + */ + private AwsIamVirtualMfaDeviceProperties awsProperties; + + /* + * Public Cloud Connectors Resource ID + */ + private String publicCloudConnectorsResourceId; + + /* + * AWS Account ID + */ + private String awsAccountId; + + /* + * Amazon Resource Name (ARN) + */ + private String arn; + + /* + * Public Cloud Resource Name + */ + private String publicCloudResourceName; + + /* + * AWS Source Schema + */ + private String awsSourceSchema; + + /* + * AWS Region + */ + private String awsRegion; + + /* + * AWS Tags + */ + private Map awsTags; + + /* + * The status of the last operation. + */ + private ProvisioningState provisioningState; + + /** + * Creates an instance of IamVirtualMfaDeviceProperties class. + */ + public IamVirtualMfaDeviceProperties() { + } + + /** + * Get the awsProperties property: AWS Properties. + * + * @return the awsProperties value. + */ + public AwsIamVirtualMfaDeviceProperties awsProperties() { + return this.awsProperties; + } + + /** + * Set the awsProperties property: AWS Properties. + * + * @param awsProperties the awsProperties value to set. + * @return the IamVirtualMfaDeviceProperties object itself. + */ + public IamVirtualMfaDeviceProperties withAwsProperties(AwsIamVirtualMfaDeviceProperties awsProperties) { + this.awsProperties = awsProperties; + return this; + } + + /** + * Get the publicCloudConnectorsResourceId property: Public Cloud Connectors Resource ID. + * + * @return the publicCloudConnectorsResourceId value. + */ + public String publicCloudConnectorsResourceId() { + return this.publicCloudConnectorsResourceId; + } + + /** + * Set the publicCloudConnectorsResourceId property: Public Cloud Connectors Resource ID. + * + * @param publicCloudConnectorsResourceId the publicCloudConnectorsResourceId value to set. + * @return the IamVirtualMfaDeviceProperties object itself. + */ + public IamVirtualMfaDeviceProperties withPublicCloudConnectorsResourceId(String publicCloudConnectorsResourceId) { + this.publicCloudConnectorsResourceId = publicCloudConnectorsResourceId; + return this; + } + + /** + * Get the awsAccountId property: AWS Account ID. + * + * @return the awsAccountId value. + */ + public String awsAccountId() { + return this.awsAccountId; + } + + /** + * Set the awsAccountId property: AWS Account ID. + * + * @param awsAccountId the awsAccountId value to set. + * @return the IamVirtualMfaDeviceProperties object itself. + */ + public IamVirtualMfaDeviceProperties withAwsAccountId(String awsAccountId) { + this.awsAccountId = awsAccountId; + return this; + } + + /** + * Get the arn property: Amazon Resource Name (ARN). + * + * @return the arn value. + */ + public String arn() { + return this.arn; + } + + /** + * Set the arn property: Amazon Resource Name (ARN). + * + * @param arn the arn value to set. + * @return the IamVirtualMfaDeviceProperties object itself. + */ + public IamVirtualMfaDeviceProperties withArn(String arn) { + this.arn = arn; + return this; + } + + /** + * Get the publicCloudResourceName property: Public Cloud Resource Name. + * + * @return the publicCloudResourceName value. + */ + public String publicCloudResourceName() { + return this.publicCloudResourceName; + } + + /** + * Set the publicCloudResourceName property: Public Cloud Resource Name. + * + * @param publicCloudResourceName the publicCloudResourceName value to set. + * @return the IamVirtualMfaDeviceProperties object itself. + */ + public IamVirtualMfaDeviceProperties withPublicCloudResourceName(String publicCloudResourceName) { + this.publicCloudResourceName = publicCloudResourceName; + return this; + } + + /** + * Get the awsSourceSchema property: AWS Source Schema. + * + * @return the awsSourceSchema value. + */ + public String awsSourceSchema() { + return this.awsSourceSchema; + } + + /** + * Set the awsSourceSchema property: AWS Source Schema. + * + * @param awsSourceSchema the awsSourceSchema value to set. + * @return the IamVirtualMfaDeviceProperties object itself. + */ + public IamVirtualMfaDeviceProperties withAwsSourceSchema(String awsSourceSchema) { + this.awsSourceSchema = awsSourceSchema; + return this; + } + + /** + * Get the awsRegion property: AWS Region. + * + * @return the awsRegion value. + */ + public String awsRegion() { + return this.awsRegion; + } + + /** + * Set the awsRegion property: AWS Region. + * + * @param awsRegion the awsRegion value to set. + * @return the IamVirtualMfaDeviceProperties object itself. + */ + public IamVirtualMfaDeviceProperties withAwsRegion(String awsRegion) { + this.awsRegion = awsRegion; + return this; + } + + /** + * Get the awsTags property: AWS Tags. + * + * @return the awsTags value. + */ + public Map awsTags() { + return this.awsTags; + } + + /** + * Set the awsTags property: AWS Tags. + * + * @param awsTags the awsTags value to set. + * @return the IamVirtualMfaDeviceProperties object itself. + */ + public IamVirtualMfaDeviceProperties withAwsTags(Map awsTags) { + this.awsTags = awsTags; + return this; + } + + /** + * Get the provisioningState property: The status of the last operation. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (awsProperties() != null) { + awsProperties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("awsProperties", this.awsProperties); + jsonWriter.writeStringField("publicCloudConnectorsResourceId", this.publicCloudConnectorsResourceId); + jsonWriter.writeStringField("awsAccountId", this.awsAccountId); + jsonWriter.writeStringField("arn", this.arn); + jsonWriter.writeStringField("publicCloudResourceName", this.publicCloudResourceName); + jsonWriter.writeStringField("awsSourceSchema", this.awsSourceSchema); + jsonWriter.writeStringField("awsRegion", this.awsRegion); + jsonWriter.writeMapField("awsTags", this.awsTags, (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of IamVirtualMfaDeviceProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of IamVirtualMfaDeviceProperties if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the IamVirtualMfaDeviceProperties. + */ + public static IamVirtualMfaDeviceProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + IamVirtualMfaDeviceProperties deserializedIamVirtualMfaDeviceProperties + = new IamVirtualMfaDeviceProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("awsProperties".equals(fieldName)) { + deserializedIamVirtualMfaDeviceProperties.awsProperties + = AwsIamVirtualMfaDeviceProperties.fromJson(reader); + } else if ("publicCloudConnectorsResourceId".equals(fieldName)) { + deserializedIamVirtualMfaDeviceProperties.publicCloudConnectorsResourceId = reader.getString(); + } else if ("awsAccountId".equals(fieldName)) { + deserializedIamVirtualMfaDeviceProperties.awsAccountId = reader.getString(); + } else if ("arn".equals(fieldName)) { + deserializedIamVirtualMfaDeviceProperties.arn = reader.getString(); + } else if ("publicCloudResourceName".equals(fieldName)) { + deserializedIamVirtualMfaDeviceProperties.publicCloudResourceName = reader.getString(); + } else if ("awsSourceSchema".equals(fieldName)) { + deserializedIamVirtualMfaDeviceProperties.awsSourceSchema = reader.getString(); + } else if ("awsRegion".equals(fieldName)) { + deserializedIamVirtualMfaDeviceProperties.awsRegion = reader.getString(); + } else if ("awsTags".equals(fieldName)) { + Map awsTags = reader.readMap(reader1 -> reader1.getString()); + deserializedIamVirtualMfaDeviceProperties.awsTags = awsTags; + } else if ("provisioningState".equals(fieldName)) { + deserializedIamVirtualMfaDeviceProperties.provisioningState + = ProvisioningState.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedIamVirtualMfaDeviceProperties; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/IamVirtualMfaDeviceTagsUpdate.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/IamVirtualMfaDeviceTagsUpdate.java new file mode 100644 index 000000000000..2805391c70e2 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/IamVirtualMfaDeviceTagsUpdate.java @@ -0,0 +1,96 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.Map; + +/** + * The type used for updating tags in IamVirtualMFADevice resources. + */ +@Fluent +public final class IamVirtualMfaDeviceTagsUpdate implements JsonSerializable { + /* + * Resource tags. + */ + private Map tags; + + /** + * Creates an instance of IamVirtualMfaDeviceTagsUpdate class. + */ + public IamVirtualMfaDeviceTagsUpdate() { + } + + /** + * Get the tags property: Resource tags. + * + * @return the tags value. + */ + public Map tags() { + return this.tags; + } + + /** + * Set the tags property: Resource tags. + * + * @param tags the tags value to set. + * @return the IamVirtualMfaDeviceTagsUpdate object itself. + */ + public IamVirtualMfaDeviceTagsUpdate withTags(Map tags) { + this.tags = tags; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeMapField("tags", this.tags, (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of IamVirtualMfaDeviceTagsUpdate from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of IamVirtualMfaDeviceTagsUpdate if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the IamVirtualMfaDeviceTagsUpdate. + */ + public static IamVirtualMfaDeviceTagsUpdate fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + IamVirtualMfaDeviceTagsUpdate deserializedIamVirtualMfaDeviceTagsUpdate + = new IamVirtualMfaDeviceTagsUpdate(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedIamVirtualMfaDeviceTagsUpdate.tags = tags; + } else { + reader.skipChildren(); + } + } + + return deserializedIamVirtualMfaDeviceTagsUpdate; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/IamVirtualMfaDevices.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/IamVirtualMfaDevices.java new file mode 100644 index 000000000000..8b1cf30ff9c5 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/IamVirtualMfaDevices.java @@ -0,0 +1,158 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** + * Resource collection API of IamVirtualMfaDevices. + */ +public interface IamVirtualMfaDevices { + /** + * List IamVirtualMFADevice resources by subscription ID. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a IamVirtualMFADevice list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable list(); + + /** + * List IamVirtualMFADevice resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a IamVirtualMFADevice list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable list(Context context); + + /** + * List IamVirtualMFADevice resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a IamVirtualMFADevice list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * List IamVirtualMFADevice resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a IamVirtualMFADevice list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Get a IamVirtualMFADevice. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of IamVirtualMFADevice. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a IamVirtualMFADevice along with {@link Response}. + */ + Response getByResourceGroupWithResponse(String resourceGroupName, String name, + Context context); + + /** + * Get a IamVirtualMFADevice. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of IamVirtualMFADevice. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a IamVirtualMFADevice. + */ + IamVirtualMfaDevice getByResourceGroup(String resourceGroupName, String name); + + /** + * Delete a IamVirtualMFADevice. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of IamVirtualMFADevice. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByResourceGroup(String resourceGroupName, String name); + + /** + * Delete a IamVirtualMFADevice. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of IamVirtualMFADevice. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String name, Context context); + + /** + * Get a IamVirtualMFADevice. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a IamVirtualMFADevice along with {@link Response}. + */ + IamVirtualMfaDevice getById(String id); + + /** + * Get a IamVirtualMFADevice. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a IamVirtualMFADevice along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Delete a IamVirtualMFADevice. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteById(String id); + + /** + * Delete a IamVirtualMFADevice. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new IamVirtualMfaDevice resource. + * + * @param name resource name. + * @return the first stage of the new IamVirtualMfaDevice definition. + */ + IamVirtualMfaDevice.DefinitionStages.Blank define(String name); +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/Identity.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/Identity.java new file mode 100644 index 000000000000..8f91d8e35f5b --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/Identity.java @@ -0,0 +1,99 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of Identity. + */ +@Fluent +public final class Identity implements JsonSerializable { + /* + *

An object representing the OpenID Connect identity provider + * information.

+ */ + private Oidc oidc; + + /** + * Creates an instance of Identity class. + */ + public Identity() { + } + + /** + * Get the oidc property: <p>An object representing the <a href='https://openid.net/connect/'>OpenID + * Connect</a> identity provider information.</p>. + * + * @return the oidc value. + */ + public Oidc oidc() { + return this.oidc; + } + + /** + * Set the oidc property: <p>An object representing the <a href='https://openid.net/connect/'>OpenID + * Connect</a> identity provider information.</p>. + * + * @param oidc the oidc value to set. + * @return the Identity object itself. + */ + public Identity withOidc(Oidc oidc) { + this.oidc = oidc; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (oidc() != null) { + oidc().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("oidc", this.oidc); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of Identity from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of Identity if the JsonReader was pointing to an instance of it, or null if it was pointing + * to JSON null. + * @throws IOException If an error occurs while reading the Identity. + */ + public static Identity fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + Identity deserializedIdentity = new Identity(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("oidc".equals(fieldName)) { + deserializedIdentity.oidc = Oidc.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedIdentity; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ImageConfig.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ImageConfig.java new file mode 100644 index 000000000000..f1ddee89e231 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ImageConfig.java @@ -0,0 +1,160 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Definition of ImageConfig. + */ +@Fluent +public final class ImageConfig implements JsonSerializable { + /* + * Specifies parameters that you want to pass in with ENTRYPOINT. You can specify a maximum of 1,500 parameters in + * the list. + */ + private List command; + + /* + * Specifies the entry point to their application, which is typically the location of the runtime executable. You + * can specify a maximum of 1,500 string entries in the list. + */ + private List entryPoint; + + /* + * Specifies the working directory. The length of the directory string cannot exceed 1,000 characters. + */ + private String workingDirectory; + + /** + * Creates an instance of ImageConfig class. + */ + public ImageConfig() { + } + + /** + * Get the command property: Specifies parameters that you want to pass in with ENTRYPOINT. You can specify a + * maximum of 1,500 parameters in the list. + * + * @return the command value. + */ + public List command() { + return this.command; + } + + /** + * Set the command property: Specifies parameters that you want to pass in with ENTRYPOINT. You can specify a + * maximum of 1,500 parameters in the list. + * + * @param command the command value to set. + * @return the ImageConfig object itself. + */ + public ImageConfig withCommand(List command) { + this.command = command; + return this; + } + + /** + * Get the entryPoint property: Specifies the entry point to their application, which is typically the location of + * the runtime executable. You can specify a maximum of 1,500 string entries in the list. + * + * @return the entryPoint value. + */ + public List entryPoint() { + return this.entryPoint; + } + + /** + * Set the entryPoint property: Specifies the entry point to their application, which is typically the location of + * the runtime executable. You can specify a maximum of 1,500 string entries in the list. + * + * @param entryPoint the entryPoint value to set. + * @return the ImageConfig object itself. + */ + public ImageConfig withEntryPoint(List entryPoint) { + this.entryPoint = entryPoint; + return this; + } + + /** + * Get the workingDirectory property: Specifies the working directory. The length of the directory string cannot + * exceed 1,000 characters. + * + * @return the workingDirectory value. + */ + public String workingDirectory() { + return this.workingDirectory; + } + + /** + * Set the workingDirectory property: Specifies the working directory. The length of the directory string cannot + * exceed 1,000 characters. + * + * @param workingDirectory the workingDirectory value to set. + * @return the ImageConfig object itself. + */ + public ImageConfig withWorkingDirectory(String workingDirectory) { + this.workingDirectory = workingDirectory; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("command", this.command, (writer, element) -> writer.writeString(element)); + jsonWriter.writeArrayField("entryPoint", this.entryPoint, (writer, element) -> writer.writeString(element)); + jsonWriter.writeStringField("workingDirectory", this.workingDirectory); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ImageConfig from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ImageConfig if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the ImageConfig. + */ + public static ImageConfig fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ImageConfig deserializedImageConfig = new ImageConfig(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("command".equals(fieldName)) { + List command = reader.readArray(reader1 -> reader1.getString()); + deserializedImageConfig.command = command; + } else if ("entryPoint".equals(fieldName)) { + List entryPoint = reader.readArray(reader1 -> reader1.getString()); + deserializedImageConfig.entryPoint = entryPoint; + } else if ("workingDirectory".equals(fieldName)) { + deserializedImageConfig.workingDirectory = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedImageConfig; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ImagePullCredentialsType.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ImagePullCredentialsType.java new file mode 100644 index 000000000000..3532f2435ac8 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ImagePullCredentialsType.java @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * ImagePullCredentialsType enum. + */ +public final class ImagePullCredentialsType extends ExpandableStringEnum { + /** + * Static value CODEBUILD for ImagePullCredentialsType. + */ + public static final ImagePullCredentialsType CODEBUILD = fromString("CODEBUILD"); + + /** + * Static value SERVICE_ROLE for ImagePullCredentialsType. + */ + public static final ImagePullCredentialsType SERVICE_ROLE = fromString("SERVICE_ROLE"); + + /** + * Creates a new instance of ImagePullCredentialsType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ImagePullCredentialsType() { + } + + /** + * Creates or finds a ImagePullCredentialsType from its string representation. + * + * @param name a name to look for. + * @return the corresponding ImagePullCredentialsType. + */ + public static ImagePullCredentialsType fromString(String name) { + return fromString(name, ImagePullCredentialsType.class); + } + + /** + * Gets known ImagePullCredentialsType values. + * + * @return known ImagePullCredentialsType values. + */ + public static Collection values() { + return values(ImagePullCredentialsType.class); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ImagePullCredentialsTypeEnumValue.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ImagePullCredentialsTypeEnumValue.java new file mode 100644 index 000000000000..44ff1f41c474 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ImagePullCredentialsTypeEnumValue.java @@ -0,0 +1,95 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of ImagePullCredentialsTypeEnumValue. + */ +@Fluent +public final class ImagePullCredentialsTypeEnumValue implements JsonSerializable { + /* + * Property value + */ + private ImagePullCredentialsType value; + + /** + * Creates an instance of ImagePullCredentialsTypeEnumValue class. + */ + public ImagePullCredentialsTypeEnumValue() { + } + + /** + * Get the value property: Property value. + * + * @return the value value. + */ + public ImagePullCredentialsType value() { + return this.value; + } + + /** + * Set the value property: Property value. + * + * @param value the value value to set. + * @return the ImagePullCredentialsTypeEnumValue object itself. + */ + public ImagePullCredentialsTypeEnumValue withValue(ImagePullCredentialsType value) { + this.value = value; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("value", this.value == null ? null : this.value.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ImagePullCredentialsTypeEnumValue from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ImagePullCredentialsTypeEnumValue if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ImagePullCredentialsTypeEnumValue. + */ + public static ImagePullCredentialsTypeEnumValue fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ImagePullCredentialsTypeEnumValue deserializedImagePullCredentialsTypeEnumValue + = new ImagePullCredentialsTypeEnumValue(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + deserializedImagePullCredentialsTypeEnumValue.value + = ImagePullCredentialsType.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedImagePullCredentialsTypeEnumValue; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ImageScanFindingsSummary.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ImageScanFindingsSummary.java new file mode 100644 index 000000000000..7516619cb513 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ImageScanFindingsSummary.java @@ -0,0 +1,165 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.time.OffsetDateTime; +import java.time.format.DateTimeFormatter; +import java.util.Map; + +/** + * Definition of ImageScanFindingsSummary. + */ +@Fluent +public final class ImageScanFindingsSummary implements JsonSerializable { + /* + *

The image vulnerability counts, sorted by severity.

+ */ + private Map findingSeverityCounts; + + /* + *

The time of the last completed image scan.

+ */ + private OffsetDateTime imageScanCompletedAt; + + /* + *

The time when the vulnerability data was last scanned.

+ */ + private OffsetDateTime vulnerabilitySourceUpdatedAt; + + /** + * Creates an instance of ImageScanFindingsSummary class. + */ + public ImageScanFindingsSummary() { + } + + /** + * Get the findingSeverityCounts property: <p>The image vulnerability counts, sorted by severity.</p>. + * + * @return the findingSeverityCounts value. + */ + public Map findingSeverityCounts() { + return this.findingSeverityCounts; + } + + /** + * Set the findingSeverityCounts property: <p>The image vulnerability counts, sorted by severity.</p>. + * + * @param findingSeverityCounts the findingSeverityCounts value to set. + * @return the ImageScanFindingsSummary object itself. + */ + public ImageScanFindingsSummary withFindingSeverityCounts(Map findingSeverityCounts) { + this.findingSeverityCounts = findingSeverityCounts; + return this; + } + + /** + * Get the imageScanCompletedAt property: <p>The time of the last completed image scan.</p>. + * + * @return the imageScanCompletedAt value. + */ + public OffsetDateTime imageScanCompletedAt() { + return this.imageScanCompletedAt; + } + + /** + * Set the imageScanCompletedAt property: <p>The time of the last completed image scan.</p>. + * + * @param imageScanCompletedAt the imageScanCompletedAt value to set. + * @return the ImageScanFindingsSummary object itself. + */ + public ImageScanFindingsSummary withImageScanCompletedAt(OffsetDateTime imageScanCompletedAt) { + this.imageScanCompletedAt = imageScanCompletedAt; + return this; + } + + /** + * Get the vulnerabilitySourceUpdatedAt property: <p>The time when the vulnerability data was last + * scanned.</p>. + * + * @return the vulnerabilitySourceUpdatedAt value. + */ + public OffsetDateTime vulnerabilitySourceUpdatedAt() { + return this.vulnerabilitySourceUpdatedAt; + } + + /** + * Set the vulnerabilitySourceUpdatedAt property: <p>The time when the vulnerability data was last + * scanned.</p>. + * + * @param vulnerabilitySourceUpdatedAt the vulnerabilitySourceUpdatedAt value to set. + * @return the ImageScanFindingsSummary object itself. + */ + public ImageScanFindingsSummary withVulnerabilitySourceUpdatedAt(OffsetDateTime vulnerabilitySourceUpdatedAt) { + this.vulnerabilitySourceUpdatedAt = vulnerabilitySourceUpdatedAt; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeMapField("findingSeverityCounts", this.findingSeverityCounts, + (writer, element) -> writer.writeInt(element)); + jsonWriter.writeStringField("imageScanCompletedAt", + this.imageScanCompletedAt == null + ? null + : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.imageScanCompletedAt)); + jsonWriter.writeStringField("vulnerabilitySourceUpdatedAt", + this.vulnerabilitySourceUpdatedAt == null + ? null + : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.vulnerabilitySourceUpdatedAt)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ImageScanFindingsSummary from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ImageScanFindingsSummary if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ImageScanFindingsSummary. + */ + public static ImageScanFindingsSummary fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ImageScanFindingsSummary deserializedImageScanFindingsSummary = new ImageScanFindingsSummary(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("findingSeverityCounts".equals(fieldName)) { + Map findingSeverityCounts = reader.readMap(reader1 -> reader1.getInt()); + deserializedImageScanFindingsSummary.findingSeverityCounts = findingSeverityCounts; + } else if ("imageScanCompletedAt".equals(fieldName)) { + deserializedImageScanFindingsSummary.imageScanCompletedAt = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("vulnerabilitySourceUpdatedAt".equals(fieldName)) { + deserializedImageScanFindingsSummary.vulnerabilitySourceUpdatedAt = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else { + reader.skipChildren(); + } + } + + return deserializedImageScanFindingsSummary; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ImageScanStatus.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ImageScanStatus.java new file mode 100644 index 000000000000..93d8baf7912d --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ImageScanStatus.java @@ -0,0 +1,124 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of ImageScanStatus. + */ +@Fluent +public final class ImageScanStatus implements JsonSerializable { + /* + *

The description of the image scan status.

+ */ + private String description; + + /* + *

The current state of an image scan.

+ */ + private ScanStatusEnumValue status; + + /** + * Creates an instance of ImageScanStatus class. + */ + public ImageScanStatus() { + } + + /** + * Get the description property: <p>The description of the image scan status.</p>. + * + * @return the description value. + */ + public String description() { + return this.description; + } + + /** + * Set the description property: <p>The description of the image scan status.</p>. + * + * @param description the description value to set. + * @return the ImageScanStatus object itself. + */ + public ImageScanStatus withDescription(String description) { + this.description = description; + return this; + } + + /** + * Get the status property: <p>The current state of an image scan.</p>. + * + * @return the status value. + */ + public ScanStatusEnumValue status() { + return this.status; + } + + /** + * Set the status property: <p>The current state of an image scan.</p>. + * + * @param status the status value to set. + * @return the ImageScanStatus object itself. + */ + public ImageScanStatus withStatus(ScanStatusEnumValue status) { + this.status = status; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (status() != null) { + status().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("description", this.description); + jsonWriter.writeJsonField("status", this.status); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ImageScanStatus from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ImageScanStatus if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the ImageScanStatus. + */ + public static ImageScanStatus fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ImageScanStatus deserializedImageScanStatus = new ImageScanStatus(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("description".equals(fieldName)) { + deserializedImageScanStatus.description = reader.getString(); + } else if ("status".equals(fieldName)) { + deserializedImageScanStatus.status = ScanStatusEnumValue.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedImageScanStatus; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ImageScanningConfiguration.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ImageScanningConfiguration.java new file mode 100644 index 000000000000..0a6decc5914d --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ImageScanningConfiguration.java @@ -0,0 +1,102 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of ImageScanningConfiguration. + */ +@Fluent +public final class ImageScanningConfiguration implements JsonSerializable { + /* + * The setting that determines whether images are scanned after being pushed to a repository. If set to ``true``, + * images will be scanned after being pushed. If this parameter is not specified, it will default to ``false`` and + * images will not be scanned unless a scan is manually started. The setting that determines whether images are + * scanned after being pushed to a repository. + */ + private Boolean scanOnPush; + + /** + * Creates an instance of ImageScanningConfiguration class. + */ + public ImageScanningConfiguration() { + } + + /** + * Get the scanOnPush property: The setting that determines whether images are scanned after being pushed to a + * repository. If set to ``true``, images will be scanned after being pushed. If this parameter is not specified, it + * will default to ``false`` and images will not be scanned unless a scan is manually started. The setting that + * determines whether images are scanned after being pushed to a repository. + * + * @return the scanOnPush value. + */ + public Boolean scanOnPush() { + return this.scanOnPush; + } + + /** + * Set the scanOnPush property: The setting that determines whether images are scanned after being pushed to a + * repository. If set to ``true``, images will be scanned after being pushed. If this parameter is not specified, it + * will default to ``false`` and images will not be scanned unless a scan is manually started. The setting that + * determines whether images are scanned after being pushed to a repository. + * + * @param scanOnPush the scanOnPush value to set. + * @return the ImageScanningConfiguration object itself. + */ + public ImageScanningConfiguration withScanOnPush(Boolean scanOnPush) { + this.scanOnPush = scanOnPush; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeBooleanField("scanOnPush", this.scanOnPush); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ImageScanningConfiguration from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ImageScanningConfiguration if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ImageScanningConfiguration. + */ + public static ImageScanningConfiguration fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ImageScanningConfiguration deserializedImageScanningConfiguration = new ImageScanningConfiguration(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("scanOnPush".equals(fieldName)) { + deserializedImageScanningConfiguration.scanOnPush = reader.getNullable(JsonReader::getBoolean); + } else { + reader.skipChildren(); + } + } + + return deserializedImageScanningConfiguration; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ImageState.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ImageState.java new file mode 100644 index 000000000000..9d89dcb88f9c --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ImageState.java @@ -0,0 +1,81 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * ImageState enum. + */ +public final class ImageState extends ExpandableStringEnum { + /** + * Static value available for ImageState. + */ + public static final ImageState AVAILABLE = fromString("available"); + + /** + * Static value deregistered for ImageState. + */ + public static final ImageState DEREGISTERED = fromString("deregistered"); + + /** + * Static value disabled for ImageState. + */ + public static final ImageState DISABLED = fromString("disabled"); + + /** + * Static value error for ImageState. + */ + public static final ImageState ERROR = fromString("error"); + + /** + * Static value failed for ImageState. + */ + public static final ImageState FAILED = fromString("failed"); + + /** + * Static value invalid for ImageState. + */ + public static final ImageState INVALID = fromString("invalid"); + + /** + * Static value pending for ImageState. + */ + public static final ImageState PENDING = fromString("pending"); + + /** + * Static value transient for ImageState. + */ + public static final ImageState TRANSIENT = fromString("transient"); + + /** + * Creates a new instance of ImageState value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ImageState() { + } + + /** + * Creates or finds a ImageState from its string representation. + * + * @param name a name to look for. + * @return the corresponding ImageState. + */ + public static ImageState fromString(String name) { + return fromString(name, ImageState.class); + } + + /** + * Gets known ImageState values. + * + * @return known ImageState values. + */ + public static Collection values() { + return values(ImageState.class); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ImageStateEnumValue.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ImageStateEnumValue.java new file mode 100644 index 000000000000..1e33001fb774 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ImageStateEnumValue.java @@ -0,0 +1,93 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of ImageStateEnumValue. + */ +@Fluent +public final class ImageStateEnumValue implements JsonSerializable { + /* + * Property value + */ + private ImageState value; + + /** + * Creates an instance of ImageStateEnumValue class. + */ + public ImageStateEnumValue() { + } + + /** + * Get the value property: Property value. + * + * @return the value value. + */ + public ImageState value() { + return this.value; + } + + /** + * Set the value property: Property value. + * + * @param value the value value to set. + * @return the ImageStateEnumValue object itself. + */ + public ImageStateEnumValue withValue(ImageState value) { + this.value = value; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("value", this.value == null ? null : this.value.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ImageStateEnumValue from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ImageStateEnumValue if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the ImageStateEnumValue. + */ + public static ImageStateEnumValue fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ImageStateEnumValue deserializedImageStateEnumValue = new ImageStateEnumValue(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + deserializedImageStateEnumValue.value = ImageState.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedImageStateEnumValue; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ImageTagMutability.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ImageTagMutability.java new file mode 100644 index 000000000000..acdf021c12c3 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ImageTagMutability.java @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * ImageTagMutability enum. + */ +public final class ImageTagMutability extends ExpandableStringEnum { + /** + * Static value IMMUTABLE for ImageTagMutability. + */ + public static final ImageTagMutability IMMUTABLE = fromString("IMMUTABLE"); + + /** + * Static value MUTABLE for ImageTagMutability. + */ + public static final ImageTagMutability MUTABLE = fromString("MUTABLE"); + + /** + * Creates a new instance of ImageTagMutability value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ImageTagMutability() { + } + + /** + * Creates or finds a ImageTagMutability from its string representation. + * + * @param name a name to look for. + * @return the corresponding ImageTagMutability. + */ + public static ImageTagMutability fromString(String name) { + return fromString(name, ImageTagMutability.class); + } + + /** + * Gets known ImageTagMutability values. + * + * @return known ImageTagMutability values. + */ + public static Collection values() { + return values(ImageTagMutability.class); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ImageTypeValues.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ImageTypeValues.java new file mode 100644 index 000000000000..3a756e0df868 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ImageTypeValues.java @@ -0,0 +1,56 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * ImageTypeValues enum. + */ +public final class ImageTypeValues extends ExpandableStringEnum { + /** + * Static value kernel for ImageTypeValues. + */ + public static final ImageTypeValues KERNEL = fromString("kernel"); + + /** + * Static value machine for ImageTypeValues. + */ + public static final ImageTypeValues MACHINE = fromString("machine"); + + /** + * Static value ramdisk for ImageTypeValues. + */ + public static final ImageTypeValues RAMDISK = fromString("ramdisk"); + + /** + * Creates a new instance of ImageTypeValues value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ImageTypeValues() { + } + + /** + * Creates or finds a ImageTypeValues from its string representation. + * + * @param name a name to look for. + * @return the corresponding ImageTypeValues. + */ + public static ImageTypeValues fromString(String name) { + return fromString(name, ImageTypeValues.class); + } + + /** + * Gets known ImageTypeValues values. + * + * @return known ImageTypeValues values. + */ + public static Collection values() { + return values(ImageTypeValues.class); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ImageTypeValuesEnumValue.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ImageTypeValuesEnumValue.java new file mode 100644 index 000000000000..99ee31286871 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ImageTypeValuesEnumValue.java @@ -0,0 +1,93 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of ImageTypeValuesEnumValue. + */ +@Fluent +public final class ImageTypeValuesEnumValue implements JsonSerializable { + /* + * Property value + */ + private ImageTypeValues value; + + /** + * Creates an instance of ImageTypeValuesEnumValue class. + */ + public ImageTypeValuesEnumValue() { + } + + /** + * Get the value property: Property value. + * + * @return the value value. + */ + public ImageTypeValues value() { + return this.value; + } + + /** + * Set the value property: Property value. + * + * @param value the value value to set. + * @return the ImageTypeValuesEnumValue object itself. + */ + public ImageTypeValuesEnumValue withValue(ImageTypeValues value) { + this.value = value; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("value", this.value == null ? null : this.value.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ImageTypeValuesEnumValue from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ImageTypeValuesEnumValue if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ImageTypeValuesEnumValue. + */ + public static ImageTypeValuesEnumValue fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ImageTypeValuesEnumValue deserializedImageTypeValuesEnumValue = new ImageTypeValuesEnumValue(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + deserializedImageTypeValuesEnumValue.value = ImageTypeValues.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedImageTypeValuesEnumValue; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ImdsSupportValues.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ImdsSupportValues.java new file mode 100644 index 000000000000..8d92624a7718 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ImdsSupportValues.java @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * ImdsSupportValues enum. + */ +public final class ImdsSupportValues extends ExpandableStringEnum { + /** + * Static value v2.0 for ImdsSupportValues. + */ + public static final ImdsSupportValues V2_0 = fromString("v2.0"); + + /** + * Creates a new instance of ImdsSupportValues value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ImdsSupportValues() { + } + + /** + * Creates or finds a ImdsSupportValues from its string representation. + * + * @param name a name to look for. + * @return the corresponding ImdsSupportValues. + */ + public static ImdsSupportValues fromString(String name) { + return fromString(name, ImdsSupportValues.class); + } + + /** + * Gets known ImdsSupportValues values. + * + * @return known ImdsSupportValues values. + */ + public static Collection values() { + return values(ImdsSupportValues.class); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ImdsSupportValuesEnumValue.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ImdsSupportValuesEnumValue.java new file mode 100644 index 000000000000..3e4e2b6f0371 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ImdsSupportValuesEnumValue.java @@ -0,0 +1,93 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of ImdsSupportValuesEnumValue. + */ +@Fluent +public final class ImdsSupportValuesEnumValue implements JsonSerializable { + /* + * Property value + */ + private ImdsSupportValues value; + + /** + * Creates an instance of ImdsSupportValuesEnumValue class. + */ + public ImdsSupportValuesEnumValue() { + } + + /** + * Get the value property: Property value. + * + * @return the value value. + */ + public ImdsSupportValues value() { + return this.value; + } + + /** + * Set the value property: Property value. + * + * @param value the value value to set. + * @return the ImdsSupportValuesEnumValue object itself. + */ + public ImdsSupportValuesEnumValue withValue(ImdsSupportValues value) { + this.value = value; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("value", this.value == null ? null : this.value.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ImdsSupportValuesEnumValue from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ImdsSupportValuesEnumValue if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ImdsSupportValuesEnumValue. + */ + public static ImdsSupportValuesEnumValue fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ImdsSupportValuesEnumValue deserializedImdsSupportValuesEnumValue = new ImdsSupportValuesEnumValue(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + deserializedImdsSupportValuesEnumValue.value = ImdsSupportValues.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedImdsSupportValuesEnumValue; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ImportSourceSpecification.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ImportSourceSpecification.java new file mode 100644 index 000000000000..d1bad7e0a0f5 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ImportSourceSpecification.java @@ -0,0 +1,192 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of ImportSourceSpecification. + */ +@Fluent +public final class ImportSourceSpecification implements JsonSerializable { + /* + * Type of compression to be used on the input coming from the imported table. + */ + private String inputCompressionType; + + /* + * The format of the source data. Valid values for ``ImportFormat`` are ``CSV``, ``DYNAMODB_JSON`` or ``ION``. + */ + private String inputFormat; + + /* + * Additional properties that specify how the input is formatted, The format options for the data that was imported + * into the target table. There is one value, CsvOption. + */ + private InputFormatOptions inputFormatOptions; + + /* + * The S3 bucket that provides the source for the import. The S3 bucket that is being imported from. + */ + private S3BucketSource s3BucketSource; + + /** + * Creates an instance of ImportSourceSpecification class. + */ + public ImportSourceSpecification() { + } + + /** + * Get the inputCompressionType property: Type of compression to be used on the input coming from the imported + * table. + * + * @return the inputCompressionType value. + */ + public String inputCompressionType() { + return this.inputCompressionType; + } + + /** + * Set the inputCompressionType property: Type of compression to be used on the input coming from the imported + * table. + * + * @param inputCompressionType the inputCompressionType value to set. + * @return the ImportSourceSpecification object itself. + */ + public ImportSourceSpecification withInputCompressionType(String inputCompressionType) { + this.inputCompressionType = inputCompressionType; + return this; + } + + /** + * Get the inputFormat property: The format of the source data. Valid values for ``ImportFormat`` are ``CSV``, + * ``DYNAMODB_JSON`` or ``ION``. + * + * @return the inputFormat value. + */ + public String inputFormat() { + return this.inputFormat; + } + + /** + * Set the inputFormat property: The format of the source data. Valid values for ``ImportFormat`` are ``CSV``, + * ``DYNAMODB_JSON`` or ``ION``. + * + * @param inputFormat the inputFormat value to set. + * @return the ImportSourceSpecification object itself. + */ + public ImportSourceSpecification withInputFormat(String inputFormat) { + this.inputFormat = inputFormat; + return this; + } + + /** + * Get the inputFormatOptions property: Additional properties that specify how the input is formatted, The format + * options for the data that was imported into the target table. There is one value, CsvOption. + * + * @return the inputFormatOptions value. + */ + public InputFormatOptions inputFormatOptions() { + return this.inputFormatOptions; + } + + /** + * Set the inputFormatOptions property: Additional properties that specify how the input is formatted, The format + * options for the data that was imported into the target table. There is one value, CsvOption. + * + * @param inputFormatOptions the inputFormatOptions value to set. + * @return the ImportSourceSpecification object itself. + */ + public ImportSourceSpecification withInputFormatOptions(InputFormatOptions inputFormatOptions) { + this.inputFormatOptions = inputFormatOptions; + return this; + } + + /** + * Get the s3BucketSource property: The S3 bucket that provides the source for the import. The S3 bucket that is + * being imported from. + * + * @return the s3BucketSource value. + */ + public S3BucketSource s3BucketSource() { + return this.s3BucketSource; + } + + /** + * Set the s3BucketSource property: The S3 bucket that provides the source for the import. The S3 bucket that is + * being imported from. + * + * @param s3BucketSource the s3BucketSource value to set. + * @return the ImportSourceSpecification object itself. + */ + public ImportSourceSpecification withS3BucketSource(S3BucketSource s3BucketSource) { + this.s3BucketSource = s3BucketSource; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (inputFormatOptions() != null) { + inputFormatOptions().validate(); + } + if (s3BucketSource() != null) { + s3BucketSource().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("inputCompressionType", this.inputCompressionType); + jsonWriter.writeStringField("inputFormat", this.inputFormat); + jsonWriter.writeJsonField("inputFormatOptions", this.inputFormatOptions); + jsonWriter.writeJsonField("s3BucketSource", this.s3BucketSource); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ImportSourceSpecification from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ImportSourceSpecification if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ImportSourceSpecification. + */ + public static ImportSourceSpecification fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ImportSourceSpecification deserializedImportSourceSpecification = new ImportSourceSpecification(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("inputCompressionType".equals(fieldName)) { + deserializedImportSourceSpecification.inputCompressionType = reader.getString(); + } else if ("inputFormat".equals(fieldName)) { + deserializedImportSourceSpecification.inputFormat = reader.getString(); + } else if ("inputFormatOptions".equals(fieldName)) { + deserializedImportSourceSpecification.inputFormatOptions = InputFormatOptions.fromJson(reader); + } else if ("s3BucketSource".equals(fieldName)) { + deserializedImportSourceSpecification.s3BucketSource = S3BucketSource.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedImportSourceSpecification; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/InferenceAccelerator.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/InferenceAccelerator.java new file mode 100644 index 000000000000..9795b8b74803 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/InferenceAccelerator.java @@ -0,0 +1,127 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of InferenceAccelerator. + */ +@Fluent +public final class InferenceAccelerator implements JsonSerializable { + /* + * The Elastic Inference accelerator device name. The ``deviceName`` must also be referenced in a container + * definition as a + * [ResourceRequirement](https://docs.aws.amazon.com/AmazonECS/latest/APIReference/API_ResourceRequirement.html). + */ + private String deviceName; + + /* + * The Elastic Inference accelerator type to use. + */ + private String deviceType; + + /** + * Creates an instance of InferenceAccelerator class. + */ + public InferenceAccelerator() { + } + + /** + * Get the deviceName property: The Elastic Inference accelerator device name. The ``deviceName`` must also be + * referenced in a container definition as a + * [ResourceRequirement](https://docs.aws.amazon.com/AmazonECS/latest/APIReference/API_ResourceRequirement.html). + * + * @return the deviceName value. + */ + public String deviceName() { + return this.deviceName; + } + + /** + * Set the deviceName property: The Elastic Inference accelerator device name. The ``deviceName`` must also be + * referenced in a container definition as a + * [ResourceRequirement](https://docs.aws.amazon.com/AmazonECS/latest/APIReference/API_ResourceRequirement.html). + * + * @param deviceName the deviceName value to set. + * @return the InferenceAccelerator object itself. + */ + public InferenceAccelerator withDeviceName(String deviceName) { + this.deviceName = deviceName; + return this; + } + + /** + * Get the deviceType property: The Elastic Inference accelerator type to use. + * + * @return the deviceType value. + */ + public String deviceType() { + return this.deviceType; + } + + /** + * Set the deviceType property: The Elastic Inference accelerator type to use. + * + * @param deviceType the deviceType value to set. + * @return the InferenceAccelerator object itself. + */ + public InferenceAccelerator withDeviceType(String deviceType) { + this.deviceType = deviceType; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("deviceName", this.deviceName); + jsonWriter.writeStringField("deviceType", this.deviceType); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of InferenceAccelerator from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of InferenceAccelerator if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the InferenceAccelerator. + */ + public static InferenceAccelerator fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + InferenceAccelerator deserializedInferenceAccelerator = new InferenceAccelerator(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("deviceName".equals(fieldName)) { + deserializedInferenceAccelerator.deviceName = reader.getString(); + } else if ("deviceType".equals(fieldName)) { + deserializedInferenceAccelerator.deviceType = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedInferenceAccelerator; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/InitiatedBy.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/InitiatedBy.java new file mode 100644 index 000000000000..5fa35b6d0d72 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/InitiatedBy.java @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * InitiatedBy enum. + */ +public final class InitiatedBy extends ExpandableStringEnum { + /** + * Static value CUSTOMER for InitiatedBy. + */ + public static final InitiatedBy CUSTOMER = fromString("CUSTOMER"); + + /** + * Static value SERVICE for InitiatedBy. + */ + public static final InitiatedBy SERVICE = fromString("SERVICE"); + + /** + * Creates a new instance of InitiatedBy value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public InitiatedBy() { + } + + /** + * Creates or finds a InitiatedBy from its string representation. + * + * @param name a name to look for. + * @return the corresponding InitiatedBy. + */ + public static InitiatedBy fromString(String name) { + return fromString(name, InitiatedBy.class); + } + + /** + * Gets known InitiatedBy values. + * + * @return known InitiatedBy values. + */ + public static Collection values() { + return values(InitiatedBy.class); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/InitiatedByEnumValue.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/InitiatedByEnumValue.java new file mode 100644 index 000000000000..ef9f414048b7 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/InitiatedByEnumValue.java @@ -0,0 +1,93 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of InitiatedByEnumValue. + */ +@Fluent +public final class InitiatedByEnumValue implements JsonSerializable { + /* + * Property value + */ + private InitiatedBy value; + + /** + * Creates an instance of InitiatedByEnumValue class. + */ + public InitiatedByEnumValue() { + } + + /** + * Get the value property: Property value. + * + * @return the value value. + */ + public InitiatedBy value() { + return this.value; + } + + /** + * Set the value property: Property value. + * + * @param value the value value to set. + * @return the InitiatedByEnumValue object itself. + */ + public InitiatedByEnumValue withValue(InitiatedBy value) { + this.value = value; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("value", this.value == null ? null : this.value.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of InitiatedByEnumValue from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of InitiatedByEnumValue if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the InitiatedByEnumValue. + */ + public static InitiatedByEnumValue fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + InitiatedByEnumValue deserializedInitiatedByEnumValue = new InitiatedByEnumValue(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + deserializedInitiatedByEnumValue.value = InitiatedBy.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedInitiatedByEnumValue; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/InputFormatOptions.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/InputFormatOptions.java new file mode 100644 index 000000000000..db165c8bcbae --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/InputFormatOptions.java @@ -0,0 +1,99 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of InputFormatOptions. + */ +@Fluent +public final class InputFormatOptions implements JsonSerializable { + /* + * The options for imported source files in CSV format. The values are Delimiter and HeaderList. The options for + * imported source files in CSV format. The values are Delimiter and HeaderList. + */ + private Csv csv; + + /** + * Creates an instance of InputFormatOptions class. + */ + public InputFormatOptions() { + } + + /** + * Get the csv property: The options for imported source files in CSV format. The values are Delimiter and + * HeaderList. The options for imported source files in CSV format. The values are Delimiter and HeaderList. + * + * @return the csv value. + */ + public Csv csv() { + return this.csv; + } + + /** + * Set the csv property: The options for imported source files in CSV format. The values are Delimiter and + * HeaderList. The options for imported source files in CSV format. The values are Delimiter and HeaderList. + * + * @param csv the csv value to set. + * @return the InputFormatOptions object itself. + */ + public InputFormatOptions withCsv(Csv csv) { + this.csv = csv; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (csv() != null) { + csv().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("csv", this.csv); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of InputFormatOptions from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of InputFormatOptions if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the InputFormatOptions. + */ + public static InputFormatOptions fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + InputFormatOptions deserializedInputFormatOptions = new InputFormatOptions(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("csv".equals(fieldName)) { + deserializedInputFormatOptions.csv = Csv.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedInputFormatOptions; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/InsightSelector.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/InsightSelector.java new file mode 100644 index 000000000000..362b3929518b --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/InsightSelector.java @@ -0,0 +1,93 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of InsightSelector. + */ +@Fluent +public final class InsightSelector implements JsonSerializable { + /* + * The type of insight to log on a trail. + */ + private String insightType; + + /** + * Creates an instance of InsightSelector class. + */ + public InsightSelector() { + } + + /** + * Get the insightType property: The type of insight to log on a trail. + * + * @return the insightType value. + */ + public String insightType() { + return this.insightType; + } + + /** + * Set the insightType property: The type of insight to log on a trail. + * + * @param insightType the insightType value to set. + * @return the InsightSelector object itself. + */ + public InsightSelector withInsightType(String insightType) { + this.insightType = insightType; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("insightType", this.insightType); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of InsightSelector from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of InsightSelector if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the InsightSelector. + */ + public static InsightSelector fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + InsightSelector deserializedInsightSelector = new InsightSelector(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("insightType".equals(fieldName)) { + deserializedInsightSelector.insightType = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedInsightSelector; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/InstanceAggregatedAssociationOverview.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/InstanceAggregatedAssociationOverview.java new file mode 100644 index 000000000000..af643080c346 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/InstanceAggregatedAssociationOverview.java @@ -0,0 +1,133 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.Map; + +/** + * Definition of InstanceAggregatedAssociationOverview. + */ +@Fluent +public final class InstanceAggregatedAssociationOverview + implements JsonSerializable { + /* + *

Detailed status information about the aggregated associations.

+ */ + private String detailedStatus; + + /* + *

The number of associations for the managed nodes.

+ */ + private Map instanceAssociationStatusAggregatedCount; + + /** + * Creates an instance of InstanceAggregatedAssociationOverview class. + */ + public InstanceAggregatedAssociationOverview() { + } + + /** + * Get the detailedStatus property: <p>Detailed status information about the aggregated + * associations.</p>. + * + * @return the detailedStatus value. + */ + public String detailedStatus() { + return this.detailedStatus; + } + + /** + * Set the detailedStatus property: <p>Detailed status information about the aggregated + * associations.</p>. + * + * @param detailedStatus the detailedStatus value to set. + * @return the InstanceAggregatedAssociationOverview object itself. + */ + public InstanceAggregatedAssociationOverview withDetailedStatus(String detailedStatus) { + this.detailedStatus = detailedStatus; + return this; + } + + /** + * Get the instanceAssociationStatusAggregatedCount property: <p>The number of associations for the managed + * nodes.</p>. + * + * @return the instanceAssociationStatusAggregatedCount value. + */ + public Map instanceAssociationStatusAggregatedCount() { + return this.instanceAssociationStatusAggregatedCount; + } + + /** + * Set the instanceAssociationStatusAggregatedCount property: <p>The number of associations for the managed + * nodes.</p>. + * + * @param instanceAssociationStatusAggregatedCount the instanceAssociationStatusAggregatedCount value to set. + * @return the InstanceAggregatedAssociationOverview object itself. + */ + public InstanceAggregatedAssociationOverview + withInstanceAssociationStatusAggregatedCount(Map instanceAssociationStatusAggregatedCount) { + this.instanceAssociationStatusAggregatedCount = instanceAssociationStatusAggregatedCount; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("detailedStatus", this.detailedStatus); + jsonWriter.writeMapField("instanceAssociationStatusAggregatedCount", + this.instanceAssociationStatusAggregatedCount, (writer, element) -> writer.writeInt(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of InstanceAggregatedAssociationOverview from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of InstanceAggregatedAssociationOverview if the JsonReader was pointing to an instance of it, + * or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the InstanceAggregatedAssociationOverview. + */ + public static InstanceAggregatedAssociationOverview fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + InstanceAggregatedAssociationOverview deserializedInstanceAggregatedAssociationOverview + = new InstanceAggregatedAssociationOverview(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("detailedStatus".equals(fieldName)) { + deserializedInstanceAggregatedAssociationOverview.detailedStatus = reader.getString(); + } else if ("instanceAssociationStatusAggregatedCount".equals(fieldName)) { + Map instanceAssociationStatusAggregatedCount + = reader.readMap(reader1 -> reader1.getInt()); + deserializedInstanceAggregatedAssociationOverview.instanceAssociationStatusAggregatedCount + = instanceAssociationStatusAggregatedCount; + } else { + reader.skipChildren(); + } + } + + return deserializedInstanceAggregatedAssociationOverview; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/InstanceAttachmentEnaSrdSpecification.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/InstanceAttachmentEnaSrdSpecification.java new file mode 100644 index 000000000000..d77f2048623f --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/InstanceAttachmentEnaSrdSpecification.java @@ -0,0 +1,131 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of InstanceAttachmentEnaSrdSpecification. + */ +@Fluent +public final class InstanceAttachmentEnaSrdSpecification + implements JsonSerializable { + /* + *

Indicates whether ENA Express is enabled for the network interface.

+ */ + private Boolean enaSrdEnabled; + + /* + *

Configures ENA Express for UDP network traffic.

+ */ + private InstanceAttachmentEnaSrdUdpSpecification enaSrdUdpSpecification; + + /** + * Creates an instance of InstanceAttachmentEnaSrdSpecification class. + */ + public InstanceAttachmentEnaSrdSpecification() { + } + + /** + * Get the enaSrdEnabled property: <p>Indicates whether ENA Express is enabled for the network + * interface.</p>. + * + * @return the enaSrdEnabled value. + */ + public Boolean enaSrdEnabled() { + return this.enaSrdEnabled; + } + + /** + * Set the enaSrdEnabled property: <p>Indicates whether ENA Express is enabled for the network + * interface.</p>. + * + * @param enaSrdEnabled the enaSrdEnabled value to set. + * @return the InstanceAttachmentEnaSrdSpecification object itself. + */ + public InstanceAttachmentEnaSrdSpecification withEnaSrdEnabled(Boolean enaSrdEnabled) { + this.enaSrdEnabled = enaSrdEnabled; + return this; + } + + /** + * Get the enaSrdUdpSpecification property: <p>Configures ENA Express for UDP network traffic.</p>. + * + * @return the enaSrdUdpSpecification value. + */ + public InstanceAttachmentEnaSrdUdpSpecification enaSrdUdpSpecification() { + return this.enaSrdUdpSpecification; + } + + /** + * Set the enaSrdUdpSpecification property: <p>Configures ENA Express for UDP network traffic.</p>. + * + * @param enaSrdUdpSpecification the enaSrdUdpSpecification value to set. + * @return the InstanceAttachmentEnaSrdSpecification object itself. + */ + public InstanceAttachmentEnaSrdSpecification + withEnaSrdUdpSpecification(InstanceAttachmentEnaSrdUdpSpecification enaSrdUdpSpecification) { + this.enaSrdUdpSpecification = enaSrdUdpSpecification; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (enaSrdUdpSpecification() != null) { + enaSrdUdpSpecification().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeBooleanField("enaSrdEnabled", this.enaSrdEnabled); + jsonWriter.writeJsonField("enaSrdUdpSpecification", this.enaSrdUdpSpecification); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of InstanceAttachmentEnaSrdSpecification from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of InstanceAttachmentEnaSrdSpecification if the JsonReader was pointing to an instance of it, + * or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the InstanceAttachmentEnaSrdSpecification. + */ + public static InstanceAttachmentEnaSrdSpecification fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + InstanceAttachmentEnaSrdSpecification deserializedInstanceAttachmentEnaSrdSpecification + = new InstanceAttachmentEnaSrdSpecification(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("enaSrdEnabled".equals(fieldName)) { + deserializedInstanceAttachmentEnaSrdSpecification.enaSrdEnabled + = reader.getNullable(JsonReader::getBoolean); + } else if ("enaSrdUdpSpecification".equals(fieldName)) { + deserializedInstanceAttachmentEnaSrdSpecification.enaSrdUdpSpecification + = InstanceAttachmentEnaSrdUdpSpecification.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedInstanceAttachmentEnaSrdSpecification; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/InstanceAttachmentEnaSrdUdpSpecification.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/InstanceAttachmentEnaSrdUdpSpecification.java new file mode 100644 index 000000000000..8d64064baf18 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/InstanceAttachmentEnaSrdUdpSpecification.java @@ -0,0 +1,99 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of InstanceAttachmentEnaSrdUdpSpecification. + */ +@Fluent +public final class InstanceAttachmentEnaSrdUdpSpecification + implements JsonSerializable { + /* + *

Indicates whether UDP traffic to and from the instance uses ENA Express. To specify this setting, you must + * first enable ENA Express.

+ */ + private Boolean enaSrdUdpEnabled; + + /** + * Creates an instance of InstanceAttachmentEnaSrdUdpSpecification class. + */ + public InstanceAttachmentEnaSrdUdpSpecification() { + } + + /** + * Get the enaSrdUdpEnabled property: <p>Indicates whether UDP traffic to and from the instance uses ENA + * Express. To specify this setting, you must first enable ENA Express.</p>. + * + * @return the enaSrdUdpEnabled value. + */ + public Boolean enaSrdUdpEnabled() { + return this.enaSrdUdpEnabled; + } + + /** + * Set the enaSrdUdpEnabled property: <p>Indicates whether UDP traffic to and from the instance uses ENA + * Express. To specify this setting, you must first enable ENA Express.</p>. + * + * @param enaSrdUdpEnabled the enaSrdUdpEnabled value to set. + * @return the InstanceAttachmentEnaSrdUdpSpecification object itself. + */ + public InstanceAttachmentEnaSrdUdpSpecification withEnaSrdUdpEnabled(Boolean enaSrdUdpEnabled) { + this.enaSrdUdpEnabled = enaSrdUdpEnabled; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeBooleanField("enaSrdUdpEnabled", this.enaSrdUdpEnabled); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of InstanceAttachmentEnaSrdUdpSpecification from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of InstanceAttachmentEnaSrdUdpSpecification if the JsonReader was pointing to an instance of + * it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the InstanceAttachmentEnaSrdUdpSpecification. + */ + public static InstanceAttachmentEnaSrdUdpSpecification fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + InstanceAttachmentEnaSrdUdpSpecification deserializedInstanceAttachmentEnaSrdUdpSpecification + = new InstanceAttachmentEnaSrdUdpSpecification(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("enaSrdUdpEnabled".equals(fieldName)) { + deserializedInstanceAttachmentEnaSrdUdpSpecification.enaSrdUdpEnabled + = reader.getNullable(JsonReader::getBoolean); + } else { + reader.skipChildren(); + } + } + + return deserializedInstanceAttachmentEnaSrdUdpSpecification; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/InstanceAutoRecoveryState.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/InstanceAutoRecoveryState.java new file mode 100644 index 000000000000..66a069b297df --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/InstanceAutoRecoveryState.java @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * InstanceAutoRecoveryState enum. + */ +public final class InstanceAutoRecoveryState extends ExpandableStringEnum { + /** + * Static value default for InstanceAutoRecoveryState. + */ + public static final InstanceAutoRecoveryState DEFAULT = fromString("default"); + + /** + * Static value disabled for InstanceAutoRecoveryState. + */ + public static final InstanceAutoRecoveryState DISABLED = fromString("disabled"); + + /** + * Creates a new instance of InstanceAutoRecoveryState value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public InstanceAutoRecoveryState() { + } + + /** + * Creates or finds a InstanceAutoRecoveryState from its string representation. + * + * @param name a name to look for. + * @return the corresponding InstanceAutoRecoveryState. + */ + public static InstanceAutoRecoveryState fromString(String name) { + return fromString(name, InstanceAutoRecoveryState.class); + } + + /** + * Gets known InstanceAutoRecoveryState values. + * + * @return known InstanceAutoRecoveryState values. + */ + public static Collection values() { + return values(InstanceAutoRecoveryState.class); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/InstanceAutoRecoveryStateEnumValue.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/InstanceAutoRecoveryStateEnumValue.java new file mode 100644 index 000000000000..13b037bcf8c6 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/InstanceAutoRecoveryStateEnumValue.java @@ -0,0 +1,95 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of InstanceAutoRecoveryStateEnumValue. + */ +@Fluent +public final class InstanceAutoRecoveryStateEnumValue implements JsonSerializable { + /* + * Property value + */ + private InstanceAutoRecoveryState value; + + /** + * Creates an instance of InstanceAutoRecoveryStateEnumValue class. + */ + public InstanceAutoRecoveryStateEnumValue() { + } + + /** + * Get the value property: Property value. + * + * @return the value value. + */ + public InstanceAutoRecoveryState value() { + return this.value; + } + + /** + * Set the value property: Property value. + * + * @param value the value value to set. + * @return the InstanceAutoRecoveryStateEnumValue object itself. + */ + public InstanceAutoRecoveryStateEnumValue withValue(InstanceAutoRecoveryState value) { + this.value = value; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("value", this.value == null ? null : this.value.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of InstanceAutoRecoveryStateEnumValue from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of InstanceAutoRecoveryStateEnumValue if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the InstanceAutoRecoveryStateEnumValue. + */ + public static InstanceAutoRecoveryStateEnumValue fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + InstanceAutoRecoveryStateEnumValue deserializedInstanceAutoRecoveryStateEnumValue + = new InstanceAutoRecoveryStateEnumValue(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + deserializedInstanceAutoRecoveryStateEnumValue.value + = InstanceAutoRecoveryState.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedInstanceAutoRecoveryStateEnumValue; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/InstanceBlockDeviceMapping.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/InstanceBlockDeviceMapping.java new file mode 100644 index 000000000000..8e6842f42cd9 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/InstanceBlockDeviceMapping.java @@ -0,0 +1,128 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of InstanceBlockDeviceMapping. + */ +@Fluent +public final class InstanceBlockDeviceMapping implements JsonSerializable { + /* + *

The device name (for example, /dev/sdh or xvdh).

+ */ + private String deviceName; + + /* + *

Parameters used to automatically set up EBS volumes when the instance is launched.

+ */ + private EbsInstanceBlockDevice ebs; + + /** + * Creates an instance of InstanceBlockDeviceMapping class. + */ + public InstanceBlockDeviceMapping() { + } + + /** + * Get the deviceName property: <p>The device name (for example, <code>/dev/sdh</code> or + * <code>xvdh</code>).</p>. + * + * @return the deviceName value. + */ + public String deviceName() { + return this.deviceName; + } + + /** + * Set the deviceName property: <p>The device name (for example, <code>/dev/sdh</code> or + * <code>xvdh</code>).</p>. + * + * @param deviceName the deviceName value to set. + * @return the InstanceBlockDeviceMapping object itself. + */ + public InstanceBlockDeviceMapping withDeviceName(String deviceName) { + this.deviceName = deviceName; + return this; + } + + /** + * Get the ebs property: <p>Parameters used to automatically set up EBS volumes when the instance is + * launched.</p>. + * + * @return the ebs value. + */ + public EbsInstanceBlockDevice ebs() { + return this.ebs; + } + + /** + * Set the ebs property: <p>Parameters used to automatically set up EBS volumes when the instance is + * launched.</p>. + * + * @param ebs the ebs value to set. + * @return the InstanceBlockDeviceMapping object itself. + */ + public InstanceBlockDeviceMapping withEbs(EbsInstanceBlockDevice ebs) { + this.ebs = ebs; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (ebs() != null) { + ebs().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("deviceName", this.deviceName); + jsonWriter.writeJsonField("ebs", this.ebs); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of InstanceBlockDeviceMapping from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of InstanceBlockDeviceMapping if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IOException If an error occurs while reading the InstanceBlockDeviceMapping. + */ + public static InstanceBlockDeviceMapping fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + InstanceBlockDeviceMapping deserializedInstanceBlockDeviceMapping = new InstanceBlockDeviceMapping(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("deviceName".equals(fieldName)) { + deserializedInstanceBlockDeviceMapping.deviceName = reader.getString(); + } else if ("ebs".equals(fieldName)) { + deserializedInstanceBlockDeviceMapping.ebs = EbsInstanceBlockDevice.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedInstanceBlockDeviceMapping; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/InstanceBootModeValues.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/InstanceBootModeValues.java new file mode 100644 index 000000000000..49f5113380e6 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/InstanceBootModeValues.java @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * InstanceBootModeValues enum. + */ +public final class InstanceBootModeValues extends ExpandableStringEnum { + /** + * Static value legacy-bios for InstanceBootModeValues. + */ + public static final InstanceBootModeValues LEGACY_BIOS = fromString("legacy-bios"); + + /** + * Static value uefi for InstanceBootModeValues. + */ + public static final InstanceBootModeValues UEFI = fromString("uefi"); + + /** + * Creates a new instance of InstanceBootModeValues value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public InstanceBootModeValues() { + } + + /** + * Creates or finds a InstanceBootModeValues from its string representation. + * + * @param name a name to look for. + * @return the corresponding InstanceBootModeValues. + */ + public static InstanceBootModeValues fromString(String name) { + return fromString(name, InstanceBootModeValues.class); + } + + /** + * Gets known InstanceBootModeValues values. + * + * @return known InstanceBootModeValues values. + */ + public static Collection values() { + return values(InstanceBootModeValues.class); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/InstanceBootModeValuesEnumValue.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/InstanceBootModeValuesEnumValue.java new file mode 100644 index 000000000000..24b92df8c822 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/InstanceBootModeValuesEnumValue.java @@ -0,0 +1,95 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of InstanceBootModeValuesEnumValue. + */ +@Fluent +public final class InstanceBootModeValuesEnumValue implements JsonSerializable { + /* + * Property value + */ + private InstanceBootModeValues value; + + /** + * Creates an instance of InstanceBootModeValuesEnumValue class. + */ + public InstanceBootModeValuesEnumValue() { + } + + /** + * Get the value property: Property value. + * + * @return the value value. + */ + public InstanceBootModeValues value() { + return this.value; + } + + /** + * Set the value property: Property value. + * + * @param value the value value to set. + * @return the InstanceBootModeValuesEnumValue object itself. + */ + public InstanceBootModeValuesEnumValue withValue(InstanceBootModeValues value) { + this.value = value; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("value", this.value == null ? null : this.value.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of InstanceBootModeValuesEnumValue from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of InstanceBootModeValuesEnumValue if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the InstanceBootModeValuesEnumValue. + */ + public static InstanceBootModeValuesEnumValue fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + InstanceBootModeValuesEnumValue deserializedInstanceBootModeValuesEnumValue + = new InstanceBootModeValuesEnumValue(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + deserializedInstanceBootModeValuesEnumValue.value + = InstanceBootModeValues.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedInstanceBootModeValuesEnumValue; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/InstanceCollectionType.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/InstanceCollectionType.java new file mode 100644 index 000000000000..f75e05f48c28 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/InstanceCollectionType.java @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * InstanceCollectionType enum. + */ +public final class InstanceCollectionType extends ExpandableStringEnum { + /** + * Static value INSTANCE_FLEET for InstanceCollectionType. + */ + public static final InstanceCollectionType INSTANCE_FLEET = fromString("INSTANCE_FLEET"); + + /** + * Static value INSTANCE_GROUP for InstanceCollectionType. + */ + public static final InstanceCollectionType INSTANCE_GROUP = fromString("INSTANCE_GROUP"); + + /** + * Creates a new instance of InstanceCollectionType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public InstanceCollectionType() { + } + + /** + * Creates or finds a InstanceCollectionType from its string representation. + * + * @param name a name to look for. + * @return the corresponding InstanceCollectionType. + */ + public static InstanceCollectionType fromString(String name) { + return fromString(name, InstanceCollectionType.class); + } + + /** + * Gets known InstanceCollectionType values. + * + * @return known InstanceCollectionType values. + */ + public static Collection values() { + return values(InstanceCollectionType.class); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/InstanceCollectionTypeEnumValue.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/InstanceCollectionTypeEnumValue.java new file mode 100644 index 000000000000..0b9f8b366df5 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/InstanceCollectionTypeEnumValue.java @@ -0,0 +1,95 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of InstanceCollectionTypeEnumValue. + */ +@Fluent +public final class InstanceCollectionTypeEnumValue implements JsonSerializable { + /* + * Property value + */ + private InstanceCollectionType value; + + /** + * Creates an instance of InstanceCollectionTypeEnumValue class. + */ + public InstanceCollectionTypeEnumValue() { + } + + /** + * Get the value property: Property value. + * + * @return the value value. + */ + public InstanceCollectionType value() { + return this.value; + } + + /** + * Set the value property: Property value. + * + * @param value the value value to set. + * @return the InstanceCollectionTypeEnumValue object itself. + */ + public InstanceCollectionTypeEnumValue withValue(InstanceCollectionType value) { + this.value = value; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("value", this.value == null ? null : this.value.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of InstanceCollectionTypeEnumValue from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of InstanceCollectionTypeEnumValue if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the InstanceCollectionTypeEnumValue. + */ + public static InstanceCollectionTypeEnumValue fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + InstanceCollectionTypeEnumValue deserializedInstanceCollectionTypeEnumValue + = new InstanceCollectionTypeEnumValue(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + deserializedInstanceCollectionTypeEnumValue.value + = InstanceCollectionType.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedInstanceCollectionTypeEnumValue; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/InstanceIpv4Prefix.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/InstanceIpv4Prefix.java new file mode 100644 index 000000000000..2116660316a6 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/InstanceIpv4Prefix.java @@ -0,0 +1,93 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of InstanceIpv4Prefix. + */ +@Fluent +public final class InstanceIpv4Prefix implements JsonSerializable { + /* + *

One or more IPv4 prefixes assigned to the network interface.

+ */ + private String ipv4Prefix; + + /** + * Creates an instance of InstanceIpv4Prefix class. + */ + public InstanceIpv4Prefix() { + } + + /** + * Get the ipv4Prefix property: <p>One or more IPv4 prefixes assigned to the network interface.</p>. + * + * @return the ipv4Prefix value. + */ + public String ipv4Prefix() { + return this.ipv4Prefix; + } + + /** + * Set the ipv4Prefix property: <p>One or more IPv4 prefixes assigned to the network interface.</p>. + * + * @param ipv4Prefix the ipv4Prefix value to set. + * @return the InstanceIpv4Prefix object itself. + */ + public InstanceIpv4Prefix withIpv4Prefix(String ipv4Prefix) { + this.ipv4Prefix = ipv4Prefix; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("ipv4Prefix", this.ipv4Prefix); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of InstanceIpv4Prefix from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of InstanceIpv4Prefix if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the InstanceIpv4Prefix. + */ + public static InstanceIpv4Prefix fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + InstanceIpv4Prefix deserializedInstanceIpv4Prefix = new InstanceIpv4Prefix(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("ipv4Prefix".equals(fieldName)) { + deserializedInstanceIpv4Prefix.ipv4Prefix = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedInstanceIpv4Prefix; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/InstanceIpv6Address.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/InstanceIpv6Address.java new file mode 100644 index 000000000000..9bf43a0e6423 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/InstanceIpv6Address.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.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of InstanceIpv6Address. + */ +@Fluent +public final class InstanceIpv6Address implements JsonSerializable { + /* + *

The IPv6 address.

+ */ + private String ipv6Address; + + /* + *

Determines if an IPv6 address associated with a network interface is the primary IPv6 address. When you enable + * an IPv6 GUA address to be a primary IPv6, the first IPv6 GUA will be made the primary IPv6 address until the + * instance is terminated or the network interface is detached. For more information, see RunInstances.

+ */ + private Boolean isPrimaryIpv6; + + /** + * Creates an instance of InstanceIpv6Address class. + */ + public InstanceIpv6Address() { + } + + /** + * Get the ipv6Address property: <p>The IPv6 address.</p>. + * + * @return the ipv6Address value. + */ + public String ipv6Address() { + return this.ipv6Address; + } + + /** + * Set the ipv6Address property: <p>The IPv6 address.</p>. + * + * @param ipv6Address the ipv6Address value to set. + * @return the InstanceIpv6Address object itself. + */ + public InstanceIpv6Address withIpv6Address(String ipv6Address) { + this.ipv6Address = ipv6Address; + return this; + } + + /** + * Get the isPrimaryIpv6 property: <p>Determines if an IPv6 address associated with a network interface is the + * primary IPv6 address. When you enable an IPv6 GUA address to be a primary IPv6, the first IPv6 GUA will be made + * the primary IPv6 address until the instance is terminated or the network interface is detached. For more + * information, see <a + * href='https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_RunInstances.html'>RunInstances</a>.</p>. + * + * @return the isPrimaryIpv6 value. + */ + public Boolean isPrimaryIpv6() { + return this.isPrimaryIpv6; + } + + /** + * Set the isPrimaryIpv6 property: <p>Determines if an IPv6 address associated with a network interface is the + * primary IPv6 address. When you enable an IPv6 GUA address to be a primary IPv6, the first IPv6 GUA will be made + * the primary IPv6 address until the instance is terminated or the network interface is detached. For more + * information, see <a + * href='https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_RunInstances.html'>RunInstances</a>.</p>. + * + * @param isPrimaryIpv6 the isPrimaryIpv6 value to set. + * @return the InstanceIpv6Address object itself. + */ + public InstanceIpv6Address withIsPrimaryIpv6(Boolean isPrimaryIpv6) { + this.isPrimaryIpv6 = isPrimaryIpv6; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("ipv6Address", this.ipv6Address); + jsonWriter.writeBooleanField("isPrimaryIpv6", this.isPrimaryIpv6); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of InstanceIpv6Address from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of InstanceIpv6Address if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the InstanceIpv6Address. + */ + public static InstanceIpv6Address fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + InstanceIpv6Address deserializedInstanceIpv6Address = new InstanceIpv6Address(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("ipv6Address".equals(fieldName)) { + deserializedInstanceIpv6Address.ipv6Address = reader.getString(); + } else if ("isPrimaryIpv6".equals(fieldName)) { + deserializedInstanceIpv6Address.isPrimaryIpv6 = reader.getNullable(JsonReader::getBoolean); + } else { + reader.skipChildren(); + } + } + + return deserializedInstanceIpv6Address; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/InstanceIpv6AddressAutoGenerated.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/InstanceIpv6AddressAutoGenerated.java new file mode 100644 index 000000000000..0b5b0cc4b22d --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/InstanceIpv6AddressAutoGenerated.java @@ -0,0 +1,94 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of InstanceIpv6Address. + */ +@Fluent +public final class InstanceIpv6AddressAutoGenerated implements JsonSerializable { + /* + * Property ipv6Address + */ + private String ipv6Address; + + /** + * Creates an instance of InstanceIpv6AddressAutoGenerated class. + */ + public InstanceIpv6AddressAutoGenerated() { + } + + /** + * Get the ipv6Address property: Property ipv6Address. + * + * @return the ipv6Address value. + */ + public String ipv6Address() { + return this.ipv6Address; + } + + /** + * Set the ipv6Address property: Property ipv6Address. + * + * @param ipv6Address the ipv6Address value to set. + * @return the InstanceIpv6AddressAutoGenerated object itself. + */ + public InstanceIpv6AddressAutoGenerated withIpv6Address(String ipv6Address) { + this.ipv6Address = ipv6Address; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("ipv6Address", this.ipv6Address); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of InstanceIpv6AddressAutoGenerated from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of InstanceIpv6AddressAutoGenerated if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the InstanceIpv6AddressAutoGenerated. + */ + public static InstanceIpv6AddressAutoGenerated fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + InstanceIpv6AddressAutoGenerated deserializedInstanceIpv6AddressAutoGenerated + = new InstanceIpv6AddressAutoGenerated(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("ipv6Address".equals(fieldName)) { + deserializedInstanceIpv6AddressAutoGenerated.ipv6Address = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedInstanceIpv6AddressAutoGenerated; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/InstanceIpv6Prefix.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/InstanceIpv6Prefix.java new file mode 100644 index 000000000000..259b8c1f4e18 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/InstanceIpv6Prefix.java @@ -0,0 +1,93 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of InstanceIpv6Prefix. + */ +@Fluent +public final class InstanceIpv6Prefix implements JsonSerializable { + /* + *

One or more IPv6 prefixes assigned to the network interface.

+ */ + private String ipv6Prefix; + + /** + * Creates an instance of InstanceIpv6Prefix class. + */ + public InstanceIpv6Prefix() { + } + + /** + * Get the ipv6Prefix property: <p>One or more IPv6 prefixes assigned to the network interface.</p>. + * + * @return the ipv6Prefix value. + */ + public String ipv6Prefix() { + return this.ipv6Prefix; + } + + /** + * Set the ipv6Prefix property: <p>One or more IPv6 prefixes assigned to the network interface.</p>. + * + * @param ipv6Prefix the ipv6Prefix value to set. + * @return the InstanceIpv6Prefix object itself. + */ + public InstanceIpv6Prefix withIpv6Prefix(String ipv6Prefix) { + this.ipv6Prefix = ipv6Prefix; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("ipv6Prefix", this.ipv6Prefix); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of InstanceIpv6Prefix from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of InstanceIpv6Prefix if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the InstanceIpv6Prefix. + */ + public static InstanceIpv6Prefix fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + InstanceIpv6Prefix deserializedInstanceIpv6Prefix = new InstanceIpv6Prefix(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("ipv6Prefix".equals(fieldName)) { + deserializedInstanceIpv6Prefix.ipv6Prefix = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedInstanceIpv6Prefix; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/InstanceLifecycleType.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/InstanceLifecycleType.java new file mode 100644 index 000000000000..5d3cfd06a209 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/InstanceLifecycleType.java @@ -0,0 +1,56 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * InstanceLifecycleType enum. + */ +public final class InstanceLifecycleType extends ExpandableStringEnum { + /** + * Static value capacity-block for InstanceLifecycleType. + */ + public static final InstanceLifecycleType CAPACITY_BLOCK = fromString("capacity-block"); + + /** + * Static value scheduled for InstanceLifecycleType. + */ + public static final InstanceLifecycleType SCHEDULED = fromString("scheduled"); + + /** + * Static value spot for InstanceLifecycleType. + */ + public static final InstanceLifecycleType SPOT = fromString("spot"); + + /** + * Creates a new instance of InstanceLifecycleType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public InstanceLifecycleType() { + } + + /** + * Creates or finds a InstanceLifecycleType from its string representation. + * + * @param name a name to look for. + * @return the corresponding InstanceLifecycleType. + */ + public static InstanceLifecycleType fromString(String name) { + return fromString(name, InstanceLifecycleType.class); + } + + /** + * Gets known InstanceLifecycleType values. + * + * @return known InstanceLifecycleType values. + */ + public static Collection values() { + return values(InstanceLifecycleType.class); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/InstanceLifecycleTypeEnumValue.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/InstanceLifecycleTypeEnumValue.java new file mode 100644 index 000000000000..98c2541eadba --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/InstanceLifecycleTypeEnumValue.java @@ -0,0 +1,95 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of InstanceLifecycleTypeEnumValue. + */ +@Fluent +public final class InstanceLifecycleTypeEnumValue implements JsonSerializable { + /* + * Property value + */ + private InstanceLifecycleType value; + + /** + * Creates an instance of InstanceLifecycleTypeEnumValue class. + */ + public InstanceLifecycleTypeEnumValue() { + } + + /** + * Get the value property: Property value. + * + * @return the value value. + */ + public InstanceLifecycleType value() { + return this.value; + } + + /** + * Set the value property: Property value. + * + * @param value the value value to set. + * @return the InstanceLifecycleTypeEnumValue object itself. + */ + public InstanceLifecycleTypeEnumValue withValue(InstanceLifecycleType value) { + this.value = value; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("value", this.value == null ? null : this.value.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of InstanceLifecycleTypeEnumValue from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of InstanceLifecycleTypeEnumValue if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the InstanceLifecycleTypeEnumValue. + */ + public static InstanceLifecycleTypeEnumValue fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + InstanceLifecycleTypeEnumValue deserializedInstanceLifecycleTypeEnumValue + = new InstanceLifecycleTypeEnumValue(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + deserializedInstanceLifecycleTypeEnumValue.value + = InstanceLifecycleType.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedInstanceLifecycleTypeEnumValue; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/InstanceMaintenanceOptions.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/InstanceMaintenanceOptions.java new file mode 100644 index 000000000000..630ec48091be --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/InstanceMaintenanceOptions.java @@ -0,0 +1,99 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of InstanceMaintenanceOptions. + */ +@Fluent +public final class InstanceMaintenanceOptions implements JsonSerializable { + /* + *

Provides information on the current automatic recovery behavior of your instance.

+ */ + private InstanceAutoRecoveryStateEnumValue autoRecovery; + + /** + * Creates an instance of InstanceMaintenanceOptions class. + */ + public InstanceMaintenanceOptions() { + } + + /** + * Get the autoRecovery property: <p>Provides information on the current automatic recovery behavior of your + * instance.</p>. + * + * @return the autoRecovery value. + */ + public InstanceAutoRecoveryStateEnumValue autoRecovery() { + return this.autoRecovery; + } + + /** + * Set the autoRecovery property: <p>Provides information on the current automatic recovery behavior of your + * instance.</p>. + * + * @param autoRecovery the autoRecovery value to set. + * @return the InstanceMaintenanceOptions object itself. + */ + public InstanceMaintenanceOptions withAutoRecovery(InstanceAutoRecoveryStateEnumValue autoRecovery) { + this.autoRecovery = autoRecovery; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (autoRecovery() != null) { + autoRecovery().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("autoRecovery", this.autoRecovery); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of InstanceMaintenanceOptions from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of InstanceMaintenanceOptions if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IOException If an error occurs while reading the InstanceMaintenanceOptions. + */ + public static InstanceMaintenanceOptions fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + InstanceMaintenanceOptions deserializedInstanceMaintenanceOptions = new InstanceMaintenanceOptions(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("autoRecovery".equals(fieldName)) { + deserializedInstanceMaintenanceOptions.autoRecovery + = InstanceAutoRecoveryStateEnumValue.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedInstanceMaintenanceOptions; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/InstanceMaintenancePolicy.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/InstanceMaintenancePolicy.java new file mode 100644 index 000000000000..76957c4e8f8d --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/InstanceMaintenancePolicy.java @@ -0,0 +1,143 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of InstanceMaintenancePolicy. + */ +@Fluent +public final class InstanceMaintenancePolicy implements JsonSerializable { + /* + * Specifies the upper threshold as a percentage of the desired capacity of the Auto Scaling group. It represents + * the maximum percentage of the group that can be in service and healthy, or pending, to support your workload when + * replacing instances. Value range is 100 to 200. To clear a previously set value, specify a value of ``-1``. Both + * ``MinHealthyPercentage`` and ``MaxHealthyPercentage`` must be specified, and the difference between them cannot + * be greater than 100. A large range increases the number of instances that can be replaced at the same time. + */ + private Integer maxHealthyPercentage; + + /* + * Specifies the lower threshold as a percentage of the desired capacity of the Auto Scaling group. It represents + * the minimum percentage of the group to keep in service, healthy, and ready to use to support your workload when + * replacing instances. Value range is 0 to 100. To clear a previously set value, specify a value of ``-1``. + */ + private Integer minHealthyPercentage; + + /** + * Creates an instance of InstanceMaintenancePolicy class. + */ + public InstanceMaintenancePolicy() { + } + + /** + * Get the maxHealthyPercentage property: Specifies the upper threshold as a percentage of the desired capacity of + * the Auto Scaling group. It represents the maximum percentage of the group that can be in service and healthy, or + * pending, to support your workload when replacing instances. Value range is 100 to 200. To clear a previously set + * value, specify a value of ``-1``. Both ``MinHealthyPercentage`` and ``MaxHealthyPercentage`` must be specified, + * and the difference between them cannot be greater than 100. A large range increases the number of instances that + * can be replaced at the same time. + * + * @return the maxHealthyPercentage value. + */ + public Integer maxHealthyPercentage() { + return this.maxHealthyPercentage; + } + + /** + * Set the maxHealthyPercentage property: Specifies the upper threshold as a percentage of the desired capacity of + * the Auto Scaling group. It represents the maximum percentage of the group that can be in service and healthy, or + * pending, to support your workload when replacing instances. Value range is 100 to 200. To clear a previously set + * value, specify a value of ``-1``. Both ``MinHealthyPercentage`` and ``MaxHealthyPercentage`` must be specified, + * and the difference between them cannot be greater than 100. A large range increases the number of instances that + * can be replaced at the same time. + * + * @param maxHealthyPercentage the maxHealthyPercentage value to set. + * @return the InstanceMaintenancePolicy object itself. + */ + public InstanceMaintenancePolicy withMaxHealthyPercentage(Integer maxHealthyPercentage) { + this.maxHealthyPercentage = maxHealthyPercentage; + return this; + } + + /** + * Get the minHealthyPercentage property: Specifies the lower threshold as a percentage of the desired capacity of + * the Auto Scaling group. It represents the minimum percentage of the group to keep in service, healthy, and ready + * to use to support your workload when replacing instances. Value range is 0 to 100. To clear a previously set + * value, specify a value of ``-1``. + * + * @return the minHealthyPercentage value. + */ + public Integer minHealthyPercentage() { + return this.minHealthyPercentage; + } + + /** + * Set the minHealthyPercentage property: Specifies the lower threshold as a percentage of the desired capacity of + * the Auto Scaling group. It represents the minimum percentage of the group to keep in service, healthy, and ready + * to use to support your workload when replacing instances. Value range is 0 to 100. To clear a previously set + * value, specify a value of ``-1``. + * + * @param minHealthyPercentage the minHealthyPercentage value to set. + * @return the InstanceMaintenancePolicy object itself. + */ + public InstanceMaintenancePolicy withMinHealthyPercentage(Integer minHealthyPercentage) { + this.minHealthyPercentage = minHealthyPercentage; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeNumberField("maxHealthyPercentage", this.maxHealthyPercentage); + jsonWriter.writeNumberField("minHealthyPercentage", this.minHealthyPercentage); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of InstanceMaintenancePolicy from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of InstanceMaintenancePolicy if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IOException If an error occurs while reading the InstanceMaintenancePolicy. + */ + public static InstanceMaintenancePolicy fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + InstanceMaintenancePolicy deserializedInstanceMaintenancePolicy = new InstanceMaintenancePolicy(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("maxHealthyPercentage".equals(fieldName)) { + deserializedInstanceMaintenancePolicy.maxHealthyPercentage = reader.getNullable(JsonReader::getInt); + } else if ("minHealthyPercentage".equals(fieldName)) { + deserializedInstanceMaintenancePolicy.minHealthyPercentage = reader.getNullable(JsonReader::getInt); + } else { + reader.skipChildren(); + } + } + + return deserializedInstanceMaintenancePolicy; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/InstanceMetadataEndpointState.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/InstanceMetadataEndpointState.java new file mode 100644 index 000000000000..06afdf6b3f77 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/InstanceMetadataEndpointState.java @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * InstanceMetadataEndpointState enum. + */ +public final class InstanceMetadataEndpointState extends ExpandableStringEnum { + /** + * Static value disabled for InstanceMetadataEndpointState. + */ + public static final InstanceMetadataEndpointState DISABLED = fromString("disabled"); + + /** + * Static value enabled for InstanceMetadataEndpointState. + */ + public static final InstanceMetadataEndpointState ENABLED = fromString("enabled"); + + /** + * Creates a new instance of InstanceMetadataEndpointState value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public InstanceMetadataEndpointState() { + } + + /** + * Creates or finds a InstanceMetadataEndpointState from its string representation. + * + * @param name a name to look for. + * @return the corresponding InstanceMetadataEndpointState. + */ + public static InstanceMetadataEndpointState fromString(String name) { + return fromString(name, InstanceMetadataEndpointState.class); + } + + /** + * Gets known InstanceMetadataEndpointState values. + * + * @return known InstanceMetadataEndpointState values. + */ + public static Collection values() { + return values(InstanceMetadataEndpointState.class); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/InstanceMetadataEndpointStateEnumValue.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/InstanceMetadataEndpointStateEnumValue.java new file mode 100644 index 000000000000..a2359f88a5b4 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/InstanceMetadataEndpointStateEnumValue.java @@ -0,0 +1,96 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of InstanceMetadataEndpointStateEnumValue. + */ +@Fluent +public final class InstanceMetadataEndpointStateEnumValue + implements JsonSerializable { + /* + * Property value + */ + private InstanceMetadataEndpointState value; + + /** + * Creates an instance of InstanceMetadataEndpointStateEnumValue class. + */ + public InstanceMetadataEndpointStateEnumValue() { + } + + /** + * Get the value property: Property value. + * + * @return the value value. + */ + public InstanceMetadataEndpointState value() { + return this.value; + } + + /** + * Set the value property: Property value. + * + * @param value the value value to set. + * @return the InstanceMetadataEndpointStateEnumValue object itself. + */ + public InstanceMetadataEndpointStateEnumValue withValue(InstanceMetadataEndpointState value) { + this.value = value; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("value", this.value == null ? null : this.value.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of InstanceMetadataEndpointStateEnumValue from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of InstanceMetadataEndpointStateEnumValue if the JsonReader was pointing to an instance of + * it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the InstanceMetadataEndpointStateEnumValue. + */ + public static InstanceMetadataEndpointStateEnumValue fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + InstanceMetadataEndpointStateEnumValue deserializedInstanceMetadataEndpointStateEnumValue + = new InstanceMetadataEndpointStateEnumValue(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + deserializedInstanceMetadataEndpointStateEnumValue.value + = InstanceMetadataEndpointState.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedInstanceMetadataEndpointStateEnumValue; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/InstanceMetadataOptionsResponse.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/InstanceMetadataOptionsResponse.java new file mode 100644 index 000000000000..af396de95704 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/InstanceMetadataOptionsResponse.java @@ -0,0 +1,294 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of InstanceMetadataOptionsResponse. + */ +@Fluent +public final class InstanceMetadataOptionsResponse implements JsonSerializable { + /* + *

Indicates whether the HTTP metadata endpoint on your instances is enabled or disabled.

If the value is + * disabled, you cannot access your instance metadata.

+ */ + private InstanceMetadataEndpointStateEnumValue httpEndpoint; + + /* + *

Indicates whether the IPv6 endpoint for the instance metadata service is enabled or disabled.

Default: + * disabled

+ */ + private InstanceMetadataProtocolStateEnumValue httpProtocolIpv6; + + /* + *

The maximum number of hops that the metadata token can travel.

Possible values: Integers from + * 1 to 64

+ */ + private Integer httpPutResponseHopLimit; + + /* + *

Indicates whether IMDSv2 is required.

  • optional - IMDSv2 is optional, which + * means that you can use either IMDSv2 or IMDSv1.

  • required - IMDSv2 is required, + * which means that IMDSv1 is disabled, and you must use IMDSv2.

+ */ + private HttpTokensStateEnumValue httpTokens; + + /* + *

Indicates whether access to instance tags from the instance metadata is enabled or disabled. For more + * information, see Work with + * instance tags using the instance metadata.

+ */ + private InstanceMetadataTagsStateEnumValue instanceMetadataTags; + + /* + *

The state of the metadata option changes.

pending - The metadata options are being + * updated and the instance is not ready to process metadata traffic with the new selection.

+ * applied - The metadata options have been successfully applied on the instance.

+ */ + private InstanceMetadataOptionsStateEnumValue state; + + /** + * Creates an instance of InstanceMetadataOptionsResponse class. + */ + public InstanceMetadataOptionsResponse() { + } + + /** + * Get the httpEndpoint property: <p>Indicates whether the HTTP metadata endpoint on your instances is enabled + * or disabled.</p> <p>If the value is <code>disabled</code>, you cannot access your + * instance metadata.</p>. + * + * @return the httpEndpoint value. + */ + public InstanceMetadataEndpointStateEnumValue httpEndpoint() { + return this.httpEndpoint; + } + + /** + * Set the httpEndpoint property: <p>Indicates whether the HTTP metadata endpoint on your instances is enabled + * or disabled.</p> <p>If the value is <code>disabled</code>, you cannot access your + * instance metadata.</p>. + * + * @param httpEndpoint the httpEndpoint value to set. + * @return the InstanceMetadataOptionsResponse object itself. + */ + public InstanceMetadataOptionsResponse withHttpEndpoint(InstanceMetadataEndpointStateEnumValue httpEndpoint) { + this.httpEndpoint = httpEndpoint; + return this; + } + + /** + * Get the httpProtocolIpv6 property: <p>Indicates whether the IPv6 endpoint for the instance metadata service + * is enabled or disabled.</p> <p>Default: <code>disabled</code> </p>. + * + * @return the httpProtocolIpv6 value. + */ + public InstanceMetadataProtocolStateEnumValue httpProtocolIpv6() { + return this.httpProtocolIpv6; + } + + /** + * Set the httpProtocolIpv6 property: <p>Indicates whether the IPv6 endpoint for the instance metadata service + * is enabled or disabled.</p> <p>Default: <code>disabled</code> </p>. + * + * @param httpProtocolIpv6 the httpProtocolIpv6 value to set. + * @return the InstanceMetadataOptionsResponse object itself. + */ + public InstanceMetadataOptionsResponse + withHttpProtocolIpv6(InstanceMetadataProtocolStateEnumValue httpProtocolIpv6) { + this.httpProtocolIpv6 = httpProtocolIpv6; + return this; + } + + /** + * Get the httpPutResponseHopLimit property: <p>The maximum number of hops that the metadata token can + * travel.</p> <p>Possible values: Integers from <code>1</code> to + * <code>64</code> </p>. + * + * @return the httpPutResponseHopLimit value. + */ + public Integer httpPutResponseHopLimit() { + return this.httpPutResponseHopLimit; + } + + /** + * Set the httpPutResponseHopLimit property: <p>The maximum number of hops that the metadata token can + * travel.</p> <p>Possible values: Integers from <code>1</code> to + * <code>64</code> </p>. + * + * @param httpPutResponseHopLimit the httpPutResponseHopLimit value to set. + * @return the InstanceMetadataOptionsResponse object itself. + */ + public InstanceMetadataOptionsResponse withHttpPutResponseHopLimit(Integer httpPutResponseHopLimit) { + this.httpPutResponseHopLimit = httpPutResponseHopLimit; + return this; + } + + /** + * Get the httpTokens property: <p>Indicates whether IMDSv2 is required.</p> <ul> <li> + * <p> <code>optional</code> - IMDSv2 is optional, which means that you can use either IMDSv2 or + * IMDSv1.</p> </li> <li> <p> <code>required</code> - IMDSv2 is required, which + * means that IMDSv1 is disabled, and you must use IMDSv2.</p> </li> </ul>. + * + * @return the httpTokens value. + */ + public HttpTokensStateEnumValue httpTokens() { + return this.httpTokens; + } + + /** + * Set the httpTokens property: <p>Indicates whether IMDSv2 is required.</p> <ul> <li> + * <p> <code>optional</code> - IMDSv2 is optional, which means that you can use either IMDSv2 or + * IMDSv1.</p> </li> <li> <p> <code>required</code> - IMDSv2 is required, which + * means that IMDSv1 is disabled, and you must use IMDSv2.</p> </li> </ul>. + * + * @param httpTokens the httpTokens value to set. + * @return the InstanceMetadataOptionsResponse object itself. + */ + public InstanceMetadataOptionsResponse withHttpTokens(HttpTokensStateEnumValue httpTokens) { + this.httpTokens = httpTokens; + return this; + } + + /** + * Get the instanceMetadataTags property: <p>Indicates whether access to instance tags from the instance + * metadata is enabled or disabled. For more information, see <a + * href='https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Using_Tags.html#work-with-tags-in-IMDS'>Work with + * instance tags using the instance metadata</a>.</p>. + * + * @return the instanceMetadataTags value. + */ + public InstanceMetadataTagsStateEnumValue instanceMetadataTags() { + return this.instanceMetadataTags; + } + + /** + * Set the instanceMetadataTags property: <p>Indicates whether access to instance tags from the instance + * metadata is enabled or disabled. For more information, see <a + * href='https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Using_Tags.html#work-with-tags-in-IMDS'>Work with + * instance tags using the instance metadata</a>.</p>. + * + * @param instanceMetadataTags the instanceMetadataTags value to set. + * @return the InstanceMetadataOptionsResponse object itself. + */ + public InstanceMetadataOptionsResponse + withInstanceMetadataTags(InstanceMetadataTagsStateEnumValue instanceMetadataTags) { + this.instanceMetadataTags = instanceMetadataTags; + return this; + } + + /** + * Get the state property: <p>The state of the metadata option changes.</p> <p> + * <code>pending</code> - The metadata options are being updated and the instance is not ready to + * process metadata traffic with the new selection.</p> <p> <code>applied</code> - The + * metadata options have been successfully applied on the instance.</p>. + * + * @return the state value. + */ + public InstanceMetadataOptionsStateEnumValue state() { + return this.state; + } + + /** + * Set the state property: <p>The state of the metadata option changes.</p> <p> + * <code>pending</code> - The metadata options are being updated and the instance is not ready to + * process metadata traffic with the new selection.</p> <p> <code>applied</code> - The + * metadata options have been successfully applied on the instance.</p>. + * + * @param state the state value to set. + * @return the InstanceMetadataOptionsResponse object itself. + */ + public InstanceMetadataOptionsResponse withState(InstanceMetadataOptionsStateEnumValue state) { + this.state = state; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (httpEndpoint() != null) { + httpEndpoint().validate(); + } + if (httpProtocolIpv6() != null) { + httpProtocolIpv6().validate(); + } + if (httpTokens() != null) { + httpTokens().validate(); + } + if (instanceMetadataTags() != null) { + instanceMetadataTags().validate(); + } + if (state() != null) { + state().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("httpEndpoint", this.httpEndpoint); + jsonWriter.writeJsonField("httpProtocolIpv6", this.httpProtocolIpv6); + jsonWriter.writeNumberField("httpPutResponseHopLimit", this.httpPutResponseHopLimit); + jsonWriter.writeJsonField("httpTokens", this.httpTokens); + jsonWriter.writeJsonField("instanceMetadataTags", this.instanceMetadataTags); + jsonWriter.writeJsonField("state", this.state); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of InstanceMetadataOptionsResponse from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of InstanceMetadataOptionsResponse if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the InstanceMetadataOptionsResponse. + */ + public static InstanceMetadataOptionsResponse fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + InstanceMetadataOptionsResponse deserializedInstanceMetadataOptionsResponse + = new InstanceMetadataOptionsResponse(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("httpEndpoint".equals(fieldName)) { + deserializedInstanceMetadataOptionsResponse.httpEndpoint + = InstanceMetadataEndpointStateEnumValue.fromJson(reader); + } else if ("httpProtocolIpv6".equals(fieldName)) { + deserializedInstanceMetadataOptionsResponse.httpProtocolIpv6 + = InstanceMetadataProtocolStateEnumValue.fromJson(reader); + } else if ("httpPutResponseHopLimit".equals(fieldName)) { + deserializedInstanceMetadataOptionsResponse.httpPutResponseHopLimit + = reader.getNullable(JsonReader::getInt); + } else if ("httpTokens".equals(fieldName)) { + deserializedInstanceMetadataOptionsResponse.httpTokens = HttpTokensStateEnumValue.fromJson(reader); + } else if ("instanceMetadataTags".equals(fieldName)) { + deserializedInstanceMetadataOptionsResponse.instanceMetadataTags + = InstanceMetadataTagsStateEnumValue.fromJson(reader); + } else if ("state".equals(fieldName)) { + deserializedInstanceMetadataOptionsResponse.state + = InstanceMetadataOptionsStateEnumValue.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedInstanceMetadataOptionsResponse; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/InstanceMetadataOptionsState.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/InstanceMetadataOptionsState.java new file mode 100644 index 000000000000..2fd0fa24154f --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/InstanceMetadataOptionsState.java @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * InstanceMetadataOptionsState enum. + */ +public final class InstanceMetadataOptionsState extends ExpandableStringEnum { + /** + * Static value applied for InstanceMetadataOptionsState. + */ + public static final InstanceMetadataOptionsState APPLIED = fromString("applied"); + + /** + * Static value pending for InstanceMetadataOptionsState. + */ + public static final InstanceMetadataOptionsState PENDING = fromString("pending"); + + /** + * Creates a new instance of InstanceMetadataOptionsState value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public InstanceMetadataOptionsState() { + } + + /** + * Creates or finds a InstanceMetadataOptionsState from its string representation. + * + * @param name a name to look for. + * @return the corresponding InstanceMetadataOptionsState. + */ + public static InstanceMetadataOptionsState fromString(String name) { + return fromString(name, InstanceMetadataOptionsState.class); + } + + /** + * Gets known InstanceMetadataOptionsState values. + * + * @return known InstanceMetadataOptionsState values. + */ + public static Collection values() { + return values(InstanceMetadataOptionsState.class); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/InstanceMetadataOptionsStateEnumValue.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/InstanceMetadataOptionsStateEnumValue.java new file mode 100644 index 000000000000..ff7bc4188965 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/InstanceMetadataOptionsStateEnumValue.java @@ -0,0 +1,96 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of InstanceMetadataOptionsStateEnumValue. + */ +@Fluent +public final class InstanceMetadataOptionsStateEnumValue + implements JsonSerializable { + /* + * Property value + */ + private InstanceMetadataOptionsState value; + + /** + * Creates an instance of InstanceMetadataOptionsStateEnumValue class. + */ + public InstanceMetadataOptionsStateEnumValue() { + } + + /** + * Get the value property: Property value. + * + * @return the value value. + */ + public InstanceMetadataOptionsState value() { + return this.value; + } + + /** + * Set the value property: Property value. + * + * @param value the value value to set. + * @return the InstanceMetadataOptionsStateEnumValue object itself. + */ + public InstanceMetadataOptionsStateEnumValue withValue(InstanceMetadataOptionsState value) { + this.value = value; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("value", this.value == null ? null : this.value.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of InstanceMetadataOptionsStateEnumValue from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of InstanceMetadataOptionsStateEnumValue if the JsonReader was pointing to an instance of it, + * or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the InstanceMetadataOptionsStateEnumValue. + */ + public static InstanceMetadataOptionsStateEnumValue fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + InstanceMetadataOptionsStateEnumValue deserializedInstanceMetadataOptionsStateEnumValue + = new InstanceMetadataOptionsStateEnumValue(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + deserializedInstanceMetadataOptionsStateEnumValue.value + = InstanceMetadataOptionsState.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedInstanceMetadataOptionsStateEnumValue; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/InstanceMetadataProtocolState.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/InstanceMetadataProtocolState.java new file mode 100644 index 000000000000..d037e7c3177b --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/InstanceMetadataProtocolState.java @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * InstanceMetadataProtocolState enum. + */ +public final class InstanceMetadataProtocolState extends ExpandableStringEnum { + /** + * Static value disabled for InstanceMetadataProtocolState. + */ + public static final InstanceMetadataProtocolState DISABLED = fromString("disabled"); + + /** + * Static value enabled for InstanceMetadataProtocolState. + */ + public static final InstanceMetadataProtocolState ENABLED = fromString("enabled"); + + /** + * Creates a new instance of InstanceMetadataProtocolState value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public InstanceMetadataProtocolState() { + } + + /** + * Creates or finds a InstanceMetadataProtocolState from its string representation. + * + * @param name a name to look for. + * @return the corresponding InstanceMetadataProtocolState. + */ + public static InstanceMetadataProtocolState fromString(String name) { + return fromString(name, InstanceMetadataProtocolState.class); + } + + /** + * Gets known InstanceMetadataProtocolState values. + * + * @return known InstanceMetadataProtocolState values. + */ + public static Collection values() { + return values(InstanceMetadataProtocolState.class); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/InstanceMetadataProtocolStateEnumValue.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/InstanceMetadataProtocolStateEnumValue.java new file mode 100644 index 000000000000..73b7601111dd --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/InstanceMetadataProtocolStateEnumValue.java @@ -0,0 +1,96 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of InstanceMetadataProtocolStateEnumValue. + */ +@Fluent +public final class InstanceMetadataProtocolStateEnumValue + implements JsonSerializable { + /* + * Property value + */ + private InstanceMetadataProtocolState value; + + /** + * Creates an instance of InstanceMetadataProtocolStateEnumValue class. + */ + public InstanceMetadataProtocolStateEnumValue() { + } + + /** + * Get the value property: Property value. + * + * @return the value value. + */ + public InstanceMetadataProtocolState value() { + return this.value; + } + + /** + * Set the value property: Property value. + * + * @param value the value value to set. + * @return the InstanceMetadataProtocolStateEnumValue object itself. + */ + public InstanceMetadataProtocolStateEnumValue withValue(InstanceMetadataProtocolState value) { + this.value = value; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("value", this.value == null ? null : this.value.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of InstanceMetadataProtocolStateEnumValue from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of InstanceMetadataProtocolStateEnumValue if the JsonReader was pointing to an instance of + * it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the InstanceMetadataProtocolStateEnumValue. + */ + public static InstanceMetadataProtocolStateEnumValue fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + InstanceMetadataProtocolStateEnumValue deserializedInstanceMetadataProtocolStateEnumValue + = new InstanceMetadataProtocolStateEnumValue(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + deserializedInstanceMetadataProtocolStateEnumValue.value + = InstanceMetadataProtocolState.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedInstanceMetadataProtocolStateEnumValue; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/InstanceMetadataTagsState.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/InstanceMetadataTagsState.java new file mode 100644 index 000000000000..b8888850cdce --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/InstanceMetadataTagsState.java @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * InstanceMetadataTagsState enum. + */ +public final class InstanceMetadataTagsState extends ExpandableStringEnum { + /** + * Static value disabled for InstanceMetadataTagsState. + */ + public static final InstanceMetadataTagsState DISABLED = fromString("disabled"); + + /** + * Static value enabled for InstanceMetadataTagsState. + */ + public static final InstanceMetadataTagsState ENABLED = fromString("enabled"); + + /** + * Creates a new instance of InstanceMetadataTagsState value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public InstanceMetadataTagsState() { + } + + /** + * Creates or finds a InstanceMetadataTagsState from its string representation. + * + * @param name a name to look for. + * @return the corresponding InstanceMetadataTagsState. + */ + public static InstanceMetadataTagsState fromString(String name) { + return fromString(name, InstanceMetadataTagsState.class); + } + + /** + * Gets known InstanceMetadataTagsState values. + * + * @return known InstanceMetadataTagsState values. + */ + public static Collection values() { + return values(InstanceMetadataTagsState.class); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/InstanceMetadataTagsStateEnumValue.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/InstanceMetadataTagsStateEnumValue.java new file mode 100644 index 000000000000..ee10bd95ee1f --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/InstanceMetadataTagsStateEnumValue.java @@ -0,0 +1,95 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of InstanceMetadataTagsStateEnumValue. + */ +@Fluent +public final class InstanceMetadataTagsStateEnumValue implements JsonSerializable { + /* + * Property value + */ + private InstanceMetadataTagsState value; + + /** + * Creates an instance of InstanceMetadataTagsStateEnumValue class. + */ + public InstanceMetadataTagsStateEnumValue() { + } + + /** + * Get the value property: Property value. + * + * @return the value value. + */ + public InstanceMetadataTagsState value() { + return this.value; + } + + /** + * Set the value property: Property value. + * + * @param value the value value to set. + * @return the InstanceMetadataTagsStateEnumValue object itself. + */ + public InstanceMetadataTagsStateEnumValue withValue(InstanceMetadataTagsState value) { + this.value = value; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("value", this.value == null ? null : this.value.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of InstanceMetadataTagsStateEnumValue from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of InstanceMetadataTagsStateEnumValue if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the InstanceMetadataTagsStateEnumValue. + */ + public static InstanceMetadataTagsStateEnumValue fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + InstanceMetadataTagsStateEnumValue deserializedInstanceMetadataTagsStateEnumValue + = new InstanceMetadataTagsStateEnumValue(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + deserializedInstanceMetadataTagsStateEnumValue.value + = InstanceMetadataTagsState.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedInstanceMetadataTagsStateEnumValue; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/InstanceNetworkInterface.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/InstanceNetworkInterface.java new file mode 100644 index 000000000000..9d2255b225fd --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/InstanceNetworkInterface.java @@ -0,0 +1,665 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Definition of InstanceNetworkInterface. + */ +@Fluent +public final class InstanceNetworkInterface implements JsonSerializable { + /* + *

The association information for an Elastic IPv4 associated with the network interface.

+ */ + private InstanceNetworkInterfaceAssociation association; + + /* + *

The network interface attachment.

+ */ + private InstanceNetworkInterfaceAttachment attachment; + + /* + *

A security group connection tracking configuration that enables you to set the timeout for connection tracking + * on an Elastic network interface. For more information, see Connection tracking timeouts in the Amazon Elastic Compute Cloud User Guide.

+ */ + private ConnectionTrackingSpecificationResponse connectionTrackingConfiguration; + + /* + *

The description.

+ */ + private String description; + + /* + *

The security groups.

+ */ + private List groups; + + /* + *

The type of network interface.

Valid values: interface | efa | + * trunk

+ */ + private String interfaceType; + + /* + *

The IPv4 delegated prefixes that are assigned to the network interface.

+ */ + private List ipv4Prefixes; + + /* + *

The IPv6 addresses associated with the network interface.

+ */ + private List ipv6Addresses; + + /* + *

The IPv6 delegated prefixes that are assigned to the network interface.

+ */ + private List ipv6Prefixes; + + /* + *

The MAC address.

+ */ + private String macAddress; + + /* + *

The ID of the network interface.

+ */ + private String networkInterfaceId; + + /* + *

The ID of the Amazon Web Services account that created the network interface.

+ */ + private String ownerId; + + /* + *

The private DNS name.

+ */ + private String privateDnsName; + + /* + *

The IPv4 address of the network interface within the subnet.

+ */ + private String privateIpAddress; + + /* + *

The private IPv4 addresses associated with the network interface.

+ */ + private List privateIpAddresses; + + /* + *

Indicates whether source/destination checking is enabled.

+ */ + private Boolean sourceDestCheck; + + /* + *

The status of the network interface.

+ */ + private NetworkInterfaceStatusEnumValue status; + + /* + *

The ID of the subnet.

+ */ + private String subnetId; + + /* + *

The ID of the VPC.

+ */ + private String vpcId; + + /** + * Creates an instance of InstanceNetworkInterface class. + */ + public InstanceNetworkInterface() { + } + + /** + * Get the association property: <p>The association information for an Elastic IPv4 associated with the + * network interface.</p>. + * + * @return the association value. + */ + public InstanceNetworkInterfaceAssociation association() { + return this.association; + } + + /** + * Set the association property: <p>The association information for an Elastic IPv4 associated with the + * network interface.</p>. + * + * @param association the association value to set. + * @return the InstanceNetworkInterface object itself. + */ + public InstanceNetworkInterface withAssociation(InstanceNetworkInterfaceAssociation association) { + this.association = association; + return this; + } + + /** + * Get the attachment property: <p>The network interface attachment.</p>. + * + * @return the attachment value. + */ + public InstanceNetworkInterfaceAttachment attachment() { + return this.attachment; + } + + /** + * Set the attachment property: <p>The network interface attachment.</p>. + * + * @param attachment the attachment value to set. + * @return the InstanceNetworkInterface object itself. + */ + public InstanceNetworkInterface withAttachment(InstanceNetworkInterfaceAttachment attachment) { + this.attachment = attachment; + return this; + } + + /** + * Get the connectionTrackingConfiguration property: <p>A security group connection tracking configuration + * that enables you to set the timeout for connection tracking on an Elastic network interface. For more + * information, see <a + * href='https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/security-group-connection-tracking.html#connection-tracking-timeouts'>Connection + * tracking timeouts</a> in the <i>Amazon Elastic Compute Cloud User Guide</i>.</p>. + * + * @return the connectionTrackingConfiguration value. + */ + public ConnectionTrackingSpecificationResponse connectionTrackingConfiguration() { + return this.connectionTrackingConfiguration; + } + + /** + * Set the connectionTrackingConfiguration property: <p>A security group connection tracking configuration + * that enables you to set the timeout for connection tracking on an Elastic network interface. For more + * information, see <a + * href='https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/security-group-connection-tracking.html#connection-tracking-timeouts'>Connection + * tracking timeouts</a> in the <i>Amazon Elastic Compute Cloud User Guide</i>.</p>. + * + * @param connectionTrackingConfiguration the connectionTrackingConfiguration value to set. + * @return the InstanceNetworkInterface object itself. + */ + public InstanceNetworkInterface + withConnectionTrackingConfiguration(ConnectionTrackingSpecificationResponse connectionTrackingConfiguration) { + this.connectionTrackingConfiguration = connectionTrackingConfiguration; + return this; + } + + /** + * Get the description property: <p>The description.</p>. + * + * @return the description value. + */ + public String description() { + return this.description; + } + + /** + * Set the description property: <p>The description.</p>. + * + * @param description the description value to set. + * @return the InstanceNetworkInterface object itself. + */ + public InstanceNetworkInterface withDescription(String description) { + this.description = description; + return this; + } + + /** + * Get the groups property: <p>The security groups.</p>. + * + * @return the groups value. + */ + public List groups() { + return this.groups; + } + + /** + * Set the groups property: <p>The security groups.</p>. + * + * @param groups the groups value to set. + * @return the InstanceNetworkInterface object itself. + */ + public InstanceNetworkInterface withGroups(List groups) { + this.groups = groups; + return this; + } + + /** + * Get the interfaceType property: <p>The type of network interface.</p> <p>Valid values: + * <code>interface</code> | <code>efa</code> | <code>trunk</code> </p>. + * + * @return the interfaceType value. + */ + public String interfaceType() { + return this.interfaceType; + } + + /** + * Set the interfaceType property: <p>The type of network interface.</p> <p>Valid values: + * <code>interface</code> | <code>efa</code> | <code>trunk</code> </p>. + * + * @param interfaceType the interfaceType value to set. + * @return the InstanceNetworkInterface object itself. + */ + public InstanceNetworkInterface withInterfaceType(String interfaceType) { + this.interfaceType = interfaceType; + return this; + } + + /** + * Get the ipv4Prefixes property: <p>The IPv4 delegated prefixes that are assigned to the network + * interface.</p>. + * + * @return the ipv4Prefixes value. + */ + public List ipv4Prefixes() { + return this.ipv4Prefixes; + } + + /** + * Set the ipv4Prefixes property: <p>The IPv4 delegated prefixes that are assigned to the network + * interface.</p>. + * + * @param ipv4Prefixes the ipv4Prefixes value to set. + * @return the InstanceNetworkInterface object itself. + */ + public InstanceNetworkInterface withIpv4Prefixes(List ipv4Prefixes) { + this.ipv4Prefixes = ipv4Prefixes; + return this; + } + + /** + * Get the ipv6Addresses property: <p>The IPv6 addresses associated with the network interface.</p>. + * + * @return the ipv6Addresses value. + */ + public List ipv6Addresses() { + return this.ipv6Addresses; + } + + /** + * Set the ipv6Addresses property: <p>The IPv6 addresses associated with the network interface.</p>. + * + * @param ipv6Addresses the ipv6Addresses value to set. + * @return the InstanceNetworkInterface object itself. + */ + public InstanceNetworkInterface withIpv6Addresses(List ipv6Addresses) { + this.ipv6Addresses = ipv6Addresses; + return this; + } + + /** + * Get the ipv6Prefixes property: <p>The IPv6 delegated prefixes that are assigned to the network + * interface.</p>. + * + * @return the ipv6Prefixes value. + */ + public List ipv6Prefixes() { + return this.ipv6Prefixes; + } + + /** + * Set the ipv6Prefixes property: <p>The IPv6 delegated prefixes that are assigned to the network + * interface.</p>. + * + * @param ipv6Prefixes the ipv6Prefixes value to set. + * @return the InstanceNetworkInterface object itself. + */ + public InstanceNetworkInterface withIpv6Prefixes(List ipv6Prefixes) { + this.ipv6Prefixes = ipv6Prefixes; + return this; + } + + /** + * Get the macAddress property: <p>The MAC address.</p>. + * + * @return the macAddress value. + */ + public String macAddress() { + return this.macAddress; + } + + /** + * Set the macAddress property: <p>The MAC address.</p>. + * + * @param macAddress the macAddress value to set. + * @return the InstanceNetworkInterface object itself. + */ + public InstanceNetworkInterface withMacAddress(String macAddress) { + this.macAddress = macAddress; + return this; + } + + /** + * Get the networkInterfaceId property: <p>The ID of the network interface.</p>. + * + * @return the networkInterfaceId value. + */ + public String networkInterfaceId() { + return this.networkInterfaceId; + } + + /** + * Set the networkInterfaceId property: <p>The ID of the network interface.</p>. + * + * @param networkInterfaceId the networkInterfaceId value to set. + * @return the InstanceNetworkInterface object itself. + */ + public InstanceNetworkInterface withNetworkInterfaceId(String networkInterfaceId) { + this.networkInterfaceId = networkInterfaceId; + return this; + } + + /** + * Get the ownerId property: <p>The ID of the Amazon Web Services account that created the network + * interface.</p>. + * + * @return the ownerId value. + */ + public String ownerId() { + return this.ownerId; + } + + /** + * Set the ownerId property: <p>The ID of the Amazon Web Services account that created the network + * interface.</p>. + * + * @param ownerId the ownerId value to set. + * @return the InstanceNetworkInterface object itself. + */ + public InstanceNetworkInterface withOwnerId(String ownerId) { + this.ownerId = ownerId; + return this; + } + + /** + * Get the privateDnsName property: <p>The private DNS name.</p>. + * + * @return the privateDnsName value. + */ + public String privateDnsName() { + return this.privateDnsName; + } + + /** + * Set the privateDnsName property: <p>The private DNS name.</p>. + * + * @param privateDnsName the privateDnsName value to set. + * @return the InstanceNetworkInterface object itself. + */ + public InstanceNetworkInterface withPrivateDnsName(String privateDnsName) { + this.privateDnsName = privateDnsName; + return this; + } + + /** + * Get the privateIpAddress property: <p>The IPv4 address of the network interface within the + * subnet.</p>. + * + * @return the privateIpAddress value. + */ + public String privateIpAddress() { + return this.privateIpAddress; + } + + /** + * Set the privateIpAddress property: <p>The IPv4 address of the network interface within the + * subnet.</p>. + * + * @param privateIpAddress the privateIpAddress value to set. + * @return the InstanceNetworkInterface object itself. + */ + public InstanceNetworkInterface withPrivateIpAddress(String privateIpAddress) { + this.privateIpAddress = privateIpAddress; + return this; + } + + /** + * Get the privateIpAddresses property: <p>The private IPv4 addresses associated with the network + * interface.</p>. + * + * @return the privateIpAddresses value. + */ + public List privateIpAddresses() { + return this.privateIpAddresses; + } + + /** + * Set the privateIpAddresses property: <p>The private IPv4 addresses associated with the network + * interface.</p>. + * + * @param privateIpAddresses the privateIpAddresses value to set. + * @return the InstanceNetworkInterface object itself. + */ + public InstanceNetworkInterface withPrivateIpAddresses(List privateIpAddresses) { + this.privateIpAddresses = privateIpAddresses; + return this; + } + + /** + * Get the sourceDestCheck property: <p>Indicates whether source/destination checking is enabled.</p>. + * + * @return the sourceDestCheck value. + */ + public Boolean sourceDestCheck() { + return this.sourceDestCheck; + } + + /** + * Set the sourceDestCheck property: <p>Indicates whether source/destination checking is enabled.</p>. + * + * @param sourceDestCheck the sourceDestCheck value to set. + * @return the InstanceNetworkInterface object itself. + */ + public InstanceNetworkInterface withSourceDestCheck(Boolean sourceDestCheck) { + this.sourceDestCheck = sourceDestCheck; + return this; + } + + /** + * Get the status property: <p>The status of the network interface.</p>. + * + * @return the status value. + */ + public NetworkInterfaceStatusEnumValue status() { + return this.status; + } + + /** + * Set the status property: <p>The status of the network interface.</p>. + * + * @param status the status value to set. + * @return the InstanceNetworkInterface object itself. + */ + public InstanceNetworkInterface withStatus(NetworkInterfaceStatusEnumValue status) { + this.status = status; + return this; + } + + /** + * Get the subnetId property: <p>The ID of the subnet.</p>. + * + * @return the subnetId value. + */ + public String subnetId() { + return this.subnetId; + } + + /** + * Set the subnetId property: <p>The ID of the subnet.</p>. + * + * @param subnetId the subnetId value to set. + * @return the InstanceNetworkInterface object itself. + */ + public InstanceNetworkInterface withSubnetId(String subnetId) { + this.subnetId = subnetId; + return this; + } + + /** + * Get the vpcId property: <p>The ID of the VPC.</p>. + * + * @return the vpcId value. + */ + public String vpcId() { + return this.vpcId; + } + + /** + * Set the vpcId property: <p>The ID of the VPC.</p>. + * + * @param vpcId the vpcId value to set. + * @return the InstanceNetworkInterface object itself. + */ + public InstanceNetworkInterface withVpcId(String vpcId) { + this.vpcId = vpcId; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (association() != null) { + association().validate(); + } + if (attachment() != null) { + attachment().validate(); + } + if (connectionTrackingConfiguration() != null) { + connectionTrackingConfiguration().validate(); + } + if (groups() != null) { + groups().forEach(e -> e.validate()); + } + if (ipv4Prefixes() != null) { + ipv4Prefixes().forEach(e -> e.validate()); + } + if (ipv6Addresses() != null) { + ipv6Addresses().forEach(e -> e.validate()); + } + if (ipv6Prefixes() != null) { + ipv6Prefixes().forEach(e -> e.validate()); + } + if (privateIpAddresses() != null) { + privateIpAddresses().forEach(e -> e.validate()); + } + if (status() != null) { + status().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("association", this.association); + jsonWriter.writeJsonField("attachment", this.attachment); + jsonWriter.writeJsonField("connectionTrackingConfiguration", this.connectionTrackingConfiguration); + jsonWriter.writeStringField("description", this.description); + jsonWriter.writeArrayField("groups", this.groups, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("interfaceType", this.interfaceType); + jsonWriter.writeArrayField("ipv4Prefixes", this.ipv4Prefixes, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("ipv6Addresses", this.ipv6Addresses, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("ipv6Prefixes", this.ipv6Prefixes, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("macAddress", this.macAddress); + jsonWriter.writeStringField("networkInterfaceId", this.networkInterfaceId); + jsonWriter.writeStringField("ownerId", this.ownerId); + jsonWriter.writeStringField("privateDnsName", this.privateDnsName); + jsonWriter.writeStringField("privateIpAddress", this.privateIpAddress); + jsonWriter.writeArrayField("privateIpAddresses", this.privateIpAddresses, + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeBooleanField("sourceDestCheck", this.sourceDestCheck); + jsonWriter.writeJsonField("status", this.status); + jsonWriter.writeStringField("subnetId", this.subnetId); + jsonWriter.writeStringField("vpcId", this.vpcId); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of InstanceNetworkInterface from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of InstanceNetworkInterface if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IOException If an error occurs while reading the InstanceNetworkInterface. + */ + public static InstanceNetworkInterface fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + InstanceNetworkInterface deserializedInstanceNetworkInterface = new InstanceNetworkInterface(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("association".equals(fieldName)) { + deserializedInstanceNetworkInterface.association + = InstanceNetworkInterfaceAssociation.fromJson(reader); + } else if ("attachment".equals(fieldName)) { + deserializedInstanceNetworkInterface.attachment + = InstanceNetworkInterfaceAttachment.fromJson(reader); + } else if ("connectionTrackingConfiguration".equals(fieldName)) { + deserializedInstanceNetworkInterface.connectionTrackingConfiguration + = ConnectionTrackingSpecificationResponse.fromJson(reader); + } else if ("description".equals(fieldName)) { + deserializedInstanceNetworkInterface.description = reader.getString(); + } else if ("groups".equals(fieldName)) { + List groups = reader.readArray(reader1 -> GroupIdentifier.fromJson(reader1)); + deserializedInstanceNetworkInterface.groups = groups; + } else if ("interfaceType".equals(fieldName)) { + deserializedInstanceNetworkInterface.interfaceType = reader.getString(); + } else if ("ipv4Prefixes".equals(fieldName)) { + List ipv4Prefixes + = reader.readArray(reader1 -> InstanceIpv4Prefix.fromJson(reader1)); + deserializedInstanceNetworkInterface.ipv4Prefixes = ipv4Prefixes; + } else if ("ipv6Addresses".equals(fieldName)) { + List ipv6Addresses + = reader.readArray(reader1 -> InstanceIpv6Address.fromJson(reader1)); + deserializedInstanceNetworkInterface.ipv6Addresses = ipv6Addresses; + } else if ("ipv6Prefixes".equals(fieldName)) { + List ipv6Prefixes + = reader.readArray(reader1 -> InstanceIpv6Prefix.fromJson(reader1)); + deserializedInstanceNetworkInterface.ipv6Prefixes = ipv6Prefixes; + } else if ("macAddress".equals(fieldName)) { + deserializedInstanceNetworkInterface.macAddress = reader.getString(); + } else if ("networkInterfaceId".equals(fieldName)) { + deserializedInstanceNetworkInterface.networkInterfaceId = reader.getString(); + } else if ("ownerId".equals(fieldName)) { + deserializedInstanceNetworkInterface.ownerId = reader.getString(); + } else if ("privateDnsName".equals(fieldName)) { + deserializedInstanceNetworkInterface.privateDnsName = reader.getString(); + } else if ("privateIpAddress".equals(fieldName)) { + deserializedInstanceNetworkInterface.privateIpAddress = reader.getString(); + } else if ("privateIpAddresses".equals(fieldName)) { + List privateIpAddresses + = reader.readArray(reader1 -> InstancePrivateIpAddress.fromJson(reader1)); + deserializedInstanceNetworkInterface.privateIpAddresses = privateIpAddresses; + } else if ("sourceDestCheck".equals(fieldName)) { + deserializedInstanceNetworkInterface.sourceDestCheck = reader.getNullable(JsonReader::getBoolean); + } else if ("status".equals(fieldName)) { + deserializedInstanceNetworkInterface.status = NetworkInterfaceStatusEnumValue.fromJson(reader); + } else if ("subnetId".equals(fieldName)) { + deserializedInstanceNetworkInterface.subnetId = reader.getString(); + } else if ("vpcId".equals(fieldName)) { + deserializedInstanceNetworkInterface.vpcId = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedInstanceNetworkInterface; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/InstanceNetworkInterfaceAssociation.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/InstanceNetworkInterfaceAssociation.java new file mode 100644 index 000000000000..eb517dcd2c27 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/InstanceNetworkInterfaceAssociation.java @@ -0,0 +1,211 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of InstanceNetworkInterfaceAssociation. + */ +@Fluent +public final class InstanceNetworkInterfaceAssociation + implements JsonSerializable { + /* + *

The carrier IP address associated with the network interface.

+ */ + private String carrierIp; + + /* + *

The customer-owned IP address associated with the network interface.

+ */ + private String customerOwnedIp; + + /* + *

The ID of the owner of the Elastic IP address.

+ */ + private String ipOwnerId; + + /* + *

The public DNS name.

+ */ + private String publicDnsName; + + /* + *

The public IP address or Elastic IP address bound to the network interface.

+ */ + private String publicIp; + + /** + * Creates an instance of InstanceNetworkInterfaceAssociation class. + */ + public InstanceNetworkInterfaceAssociation() { + } + + /** + * Get the carrierIp property: <p>The carrier IP address associated with the network interface.</p>. + * + * @return the carrierIp value. + */ + public String carrierIp() { + return this.carrierIp; + } + + /** + * Set the carrierIp property: <p>The carrier IP address associated with the network interface.</p>. + * + * @param carrierIp the carrierIp value to set. + * @return the InstanceNetworkInterfaceAssociation object itself. + */ + public InstanceNetworkInterfaceAssociation withCarrierIp(String carrierIp) { + this.carrierIp = carrierIp; + return this; + } + + /** + * Get the customerOwnedIp property: <p>The customer-owned IP address associated with the network + * interface.</p>. + * + * @return the customerOwnedIp value. + */ + public String customerOwnedIp() { + return this.customerOwnedIp; + } + + /** + * Set the customerOwnedIp property: <p>The customer-owned IP address associated with the network + * interface.</p>. + * + * @param customerOwnedIp the customerOwnedIp value to set. + * @return the InstanceNetworkInterfaceAssociation object itself. + */ + public InstanceNetworkInterfaceAssociation withCustomerOwnedIp(String customerOwnedIp) { + this.customerOwnedIp = customerOwnedIp; + return this; + } + + /** + * Get the ipOwnerId property: <p>The ID of the owner of the Elastic IP address.</p>. + * + * @return the ipOwnerId value. + */ + public String ipOwnerId() { + return this.ipOwnerId; + } + + /** + * Set the ipOwnerId property: <p>The ID of the owner of the Elastic IP address.</p>. + * + * @param ipOwnerId the ipOwnerId value to set. + * @return the InstanceNetworkInterfaceAssociation object itself. + */ + public InstanceNetworkInterfaceAssociation withIpOwnerId(String ipOwnerId) { + this.ipOwnerId = ipOwnerId; + return this; + } + + /** + * Get the publicDnsName property: <p>The public DNS name.</p>. + * + * @return the publicDnsName value. + */ + public String publicDnsName() { + return this.publicDnsName; + } + + /** + * Set the publicDnsName property: <p>The public DNS name.</p>. + * + * @param publicDnsName the publicDnsName value to set. + * @return the InstanceNetworkInterfaceAssociation object itself. + */ + public InstanceNetworkInterfaceAssociation withPublicDnsName(String publicDnsName) { + this.publicDnsName = publicDnsName; + return this; + } + + /** + * Get the publicIp property: <p>The public IP address or Elastic IP address bound to the network + * interface.</p>. + * + * @return the publicIp value. + */ + public String publicIp() { + return this.publicIp; + } + + /** + * Set the publicIp property: <p>The public IP address or Elastic IP address bound to the network + * interface.</p>. + * + * @param publicIp the publicIp value to set. + * @return the InstanceNetworkInterfaceAssociation object itself. + */ + public InstanceNetworkInterfaceAssociation withPublicIp(String publicIp) { + this.publicIp = publicIp; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("carrierIp", this.carrierIp); + jsonWriter.writeStringField("customerOwnedIp", this.customerOwnedIp); + jsonWriter.writeStringField("ipOwnerId", this.ipOwnerId); + jsonWriter.writeStringField("publicDnsName", this.publicDnsName); + jsonWriter.writeStringField("publicIp", this.publicIp); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of InstanceNetworkInterfaceAssociation from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of InstanceNetworkInterfaceAssociation if the JsonReader was pointing to an instance of it, + * or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the InstanceNetworkInterfaceAssociation. + */ + public static InstanceNetworkInterfaceAssociation fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + InstanceNetworkInterfaceAssociation deserializedInstanceNetworkInterfaceAssociation + = new InstanceNetworkInterfaceAssociation(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("carrierIp".equals(fieldName)) { + deserializedInstanceNetworkInterfaceAssociation.carrierIp = reader.getString(); + } else if ("customerOwnedIp".equals(fieldName)) { + deserializedInstanceNetworkInterfaceAssociation.customerOwnedIp = reader.getString(); + } else if ("ipOwnerId".equals(fieldName)) { + deserializedInstanceNetworkInterfaceAssociation.ipOwnerId = reader.getString(); + } else if ("publicDnsName".equals(fieldName)) { + deserializedInstanceNetworkInterfaceAssociation.publicDnsName = reader.getString(); + } else if ("publicIp".equals(fieldName)) { + deserializedInstanceNetworkInterfaceAssociation.publicIp = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedInstanceNetworkInterfaceAssociation; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/InstanceNetworkInterfaceAttachment.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/InstanceNetworkInterfaceAttachment.java new file mode 100644 index 000000000000..9de9fe3fdd4e --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/InstanceNetworkInterfaceAttachment.java @@ -0,0 +1,283 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.time.OffsetDateTime; +import java.time.format.DateTimeFormatter; + +/** + * Definition of InstanceNetworkInterfaceAttachment. + */ +@Fluent +public final class InstanceNetworkInterfaceAttachment implements JsonSerializable { + /* + *

The time stamp when the attachment initiated.

+ */ + private OffsetDateTime attachTime; + + /* + *

The ID of the network interface attachment.

+ */ + private String attachmentId; + + /* + *

Indicates whether the network interface is deleted when the instance is terminated.

+ */ + private Boolean deleteOnTermination; + + /* + *

The index of the device on the instance for the network interface attachment.

+ */ + private Integer deviceIndex; + + /* + *

Contains the ENA Express settings for the network interface that's attached to the instance.

+ */ + private InstanceAttachmentEnaSrdSpecification enaSrdSpecification; + + /* + *

The index of the network card.

+ */ + private Integer networkCardIndex; + + /* + *

The attachment state.

+ */ + private AttachmentStatusEnumValue status; + + /** + * Creates an instance of InstanceNetworkInterfaceAttachment class. + */ + public InstanceNetworkInterfaceAttachment() { + } + + /** + * Get the attachTime property: <p>The time stamp when the attachment initiated.</p>. + * + * @return the attachTime value. + */ + public OffsetDateTime attachTime() { + return this.attachTime; + } + + /** + * Set the attachTime property: <p>The time stamp when the attachment initiated.</p>. + * + * @param attachTime the attachTime value to set. + * @return the InstanceNetworkInterfaceAttachment object itself. + */ + public InstanceNetworkInterfaceAttachment withAttachTime(OffsetDateTime attachTime) { + this.attachTime = attachTime; + return this; + } + + /** + * Get the attachmentId property: <p>The ID of the network interface attachment.</p>. + * + * @return the attachmentId value. + */ + public String attachmentId() { + return this.attachmentId; + } + + /** + * Set the attachmentId property: <p>The ID of the network interface attachment.</p>. + * + * @param attachmentId the attachmentId value to set. + * @return the InstanceNetworkInterfaceAttachment object itself. + */ + public InstanceNetworkInterfaceAttachment withAttachmentId(String attachmentId) { + this.attachmentId = attachmentId; + return this; + } + + /** + * Get the deleteOnTermination property: <p>Indicates whether the network interface is deleted when the + * instance is terminated.</p>. + * + * @return the deleteOnTermination value. + */ + public Boolean deleteOnTermination() { + return this.deleteOnTermination; + } + + /** + * Set the deleteOnTermination property: <p>Indicates whether the network interface is deleted when the + * instance is terminated.</p>. + * + * @param deleteOnTermination the deleteOnTermination value to set. + * @return the InstanceNetworkInterfaceAttachment object itself. + */ + public InstanceNetworkInterfaceAttachment withDeleteOnTermination(Boolean deleteOnTermination) { + this.deleteOnTermination = deleteOnTermination; + return this; + } + + /** + * Get the deviceIndex property: <p>The index of the device on the instance for the network interface + * attachment.</p>. + * + * @return the deviceIndex value. + */ + public Integer deviceIndex() { + return this.deviceIndex; + } + + /** + * Set the deviceIndex property: <p>The index of the device on the instance for the network interface + * attachment.</p>. + * + * @param deviceIndex the deviceIndex value to set. + * @return the InstanceNetworkInterfaceAttachment object itself. + */ + public InstanceNetworkInterfaceAttachment withDeviceIndex(Integer deviceIndex) { + this.deviceIndex = deviceIndex; + return this; + } + + /** + * Get the enaSrdSpecification property: <p>Contains the ENA Express settings for the network interface that's + * attached to the instance.</p>. + * + * @return the enaSrdSpecification value. + */ + public InstanceAttachmentEnaSrdSpecification enaSrdSpecification() { + return this.enaSrdSpecification; + } + + /** + * Set the enaSrdSpecification property: <p>Contains the ENA Express settings for the network interface that's + * attached to the instance.</p>. + * + * @param enaSrdSpecification the enaSrdSpecification value to set. + * @return the InstanceNetworkInterfaceAttachment object itself. + */ + public InstanceNetworkInterfaceAttachment + withEnaSrdSpecification(InstanceAttachmentEnaSrdSpecification enaSrdSpecification) { + this.enaSrdSpecification = enaSrdSpecification; + return this; + } + + /** + * Get the networkCardIndex property: <p>The index of the network card.</p>. + * + * @return the networkCardIndex value. + */ + public Integer networkCardIndex() { + return this.networkCardIndex; + } + + /** + * Set the networkCardIndex property: <p>The index of the network card.</p>. + * + * @param networkCardIndex the networkCardIndex value to set. + * @return the InstanceNetworkInterfaceAttachment object itself. + */ + public InstanceNetworkInterfaceAttachment withNetworkCardIndex(Integer networkCardIndex) { + this.networkCardIndex = networkCardIndex; + return this; + } + + /** + * Get the status property: <p>The attachment state.</p>. + * + * @return the status value. + */ + public AttachmentStatusEnumValue status() { + return this.status; + } + + /** + * Set the status property: <p>The attachment state.</p>. + * + * @param status the status value to set. + * @return the InstanceNetworkInterfaceAttachment object itself. + */ + public InstanceNetworkInterfaceAttachment withStatus(AttachmentStatusEnumValue status) { + this.status = status; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (enaSrdSpecification() != null) { + enaSrdSpecification().validate(); + } + if (status() != null) { + status().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("attachTime", + this.attachTime == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.attachTime)); + jsonWriter.writeStringField("attachmentId", this.attachmentId); + jsonWriter.writeBooleanField("deleteOnTermination", this.deleteOnTermination); + jsonWriter.writeNumberField("deviceIndex", this.deviceIndex); + jsonWriter.writeJsonField("enaSrdSpecification", this.enaSrdSpecification); + jsonWriter.writeNumberField("networkCardIndex", this.networkCardIndex); + jsonWriter.writeJsonField("status", this.status); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of InstanceNetworkInterfaceAttachment from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of InstanceNetworkInterfaceAttachment if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the InstanceNetworkInterfaceAttachment. + */ + public static InstanceNetworkInterfaceAttachment fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + InstanceNetworkInterfaceAttachment deserializedInstanceNetworkInterfaceAttachment + = new InstanceNetworkInterfaceAttachment(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("attachTime".equals(fieldName)) { + deserializedInstanceNetworkInterfaceAttachment.attachTime = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("attachmentId".equals(fieldName)) { + deserializedInstanceNetworkInterfaceAttachment.attachmentId = reader.getString(); + } else if ("deleteOnTermination".equals(fieldName)) { + deserializedInstanceNetworkInterfaceAttachment.deleteOnTermination + = reader.getNullable(JsonReader::getBoolean); + } else if ("deviceIndex".equals(fieldName)) { + deserializedInstanceNetworkInterfaceAttachment.deviceIndex = reader.getNullable(JsonReader::getInt); + } else if ("enaSrdSpecification".equals(fieldName)) { + deserializedInstanceNetworkInterfaceAttachment.enaSrdSpecification + = InstanceAttachmentEnaSrdSpecification.fromJson(reader); + } else if ("networkCardIndex".equals(fieldName)) { + deserializedInstanceNetworkInterfaceAttachment.networkCardIndex + = reader.getNullable(JsonReader::getInt); + } else if ("status".equals(fieldName)) { + deserializedInstanceNetworkInterfaceAttachment.status = AttachmentStatusEnumValue.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedInstanceNetworkInterfaceAttachment; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/InstancePrivateIpAddress.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/InstancePrivateIpAddress.java new file mode 100644 index 000000000000..9baf9f4aaafe --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/InstancePrivateIpAddress.java @@ -0,0 +1,185 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of InstancePrivateIpAddress. + */ +@Fluent +public final class InstancePrivateIpAddress implements JsonSerializable { + /* + *

The association information for an Elastic IP address for the network interface.

+ */ + private InstanceNetworkInterfaceAssociation association; + + /* + *

Indicates whether this IPv4 address is the primary private IP address of the network interface.

+ */ + private Boolean primary; + + /* + *

The private IPv4 DNS name.

+ */ + private String privateDnsName; + + /* + *

The private IPv4 address of the network interface.

+ */ + private String privateIpAddress; + + /** + * Creates an instance of InstancePrivateIpAddress class. + */ + public InstancePrivateIpAddress() { + } + + /** + * Get the association property: <p>The association information for an Elastic IP address for the network + * interface.</p>. + * + * @return the association value. + */ + public InstanceNetworkInterfaceAssociation association() { + return this.association; + } + + /** + * Set the association property: <p>The association information for an Elastic IP address for the network + * interface.</p>. + * + * @param association the association value to set. + * @return the InstancePrivateIpAddress object itself. + */ + public InstancePrivateIpAddress withAssociation(InstanceNetworkInterfaceAssociation association) { + this.association = association; + return this; + } + + /** + * Get the primary property: <p>Indicates whether this IPv4 address is the primary private IP address of the + * network interface.</p>. + * + * @return the primary value. + */ + public Boolean primary() { + return this.primary; + } + + /** + * Set the primary property: <p>Indicates whether this IPv4 address is the primary private IP address of the + * network interface.</p>. + * + * @param primary the primary value to set. + * @return the InstancePrivateIpAddress object itself. + */ + public InstancePrivateIpAddress withPrimary(Boolean primary) { + this.primary = primary; + return this; + } + + /** + * Get the privateDnsName property: <p>The private IPv4 DNS name.</p>. + * + * @return the privateDnsName value. + */ + public String privateDnsName() { + return this.privateDnsName; + } + + /** + * Set the privateDnsName property: <p>The private IPv4 DNS name.</p>. + * + * @param privateDnsName the privateDnsName value to set. + * @return the InstancePrivateIpAddress object itself. + */ + public InstancePrivateIpAddress withPrivateDnsName(String privateDnsName) { + this.privateDnsName = privateDnsName; + return this; + } + + /** + * Get the privateIpAddress property: <p>The private IPv4 address of the network interface.</p>. + * + * @return the privateIpAddress value. + */ + public String privateIpAddress() { + return this.privateIpAddress; + } + + /** + * Set the privateIpAddress property: <p>The private IPv4 address of the network interface.</p>. + * + * @param privateIpAddress the privateIpAddress value to set. + * @return the InstancePrivateIpAddress object itself. + */ + public InstancePrivateIpAddress withPrivateIpAddress(String privateIpAddress) { + this.privateIpAddress = privateIpAddress; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (association() != null) { + association().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("association", this.association); + jsonWriter.writeBooleanField("primary", this.primary); + jsonWriter.writeStringField("privateDnsName", this.privateDnsName); + jsonWriter.writeStringField("privateIpAddress", this.privateIpAddress); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of InstancePrivateIpAddress from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of InstancePrivateIpAddress if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IOException If an error occurs while reading the InstancePrivateIpAddress. + */ + public static InstancePrivateIpAddress fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + InstancePrivateIpAddress deserializedInstancePrivateIpAddress = new InstancePrivateIpAddress(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("association".equals(fieldName)) { + deserializedInstancePrivateIpAddress.association + = InstanceNetworkInterfaceAssociation.fromJson(reader); + } else if ("primary".equals(fieldName)) { + deserializedInstancePrivateIpAddress.primary = reader.getNullable(JsonReader::getBoolean); + } else if ("privateDnsName".equals(fieldName)) { + deserializedInstancePrivateIpAddress.privateDnsName = reader.getString(); + } else if ("privateIpAddress".equals(fieldName)) { + deserializedInstancePrivateIpAddress.privateIpAddress = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedInstancePrivateIpAddress; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/InstanceRequirements.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/InstanceRequirements.java new file mode 100644 index 000000000000..3991b952bdfb --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/InstanceRequirements.java @@ -0,0 +1,1155 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Definition of InstanceRequirements. + */ +@Fluent +public final class InstanceRequirements implements JsonSerializable { + /* + * The minimum and maximum number of accelerators (GPUs, FPGAs, or AWS Inferentia chips) for an instance type. To + * exclude accelerator-enabled instance types, set ``Max`` to ``0``. Default: No minimum or maximum limits + * ``AcceleratorCountRequest`` is a property of the ``InstanceRequirements`` property of the + * [AWS::AutoScaling::AutoScalingGroup + * LaunchTemplateOverrides](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties- + * autoscaling-autoscalinggroup-launchtemplateoverrides.html) property type that describes the minimum and maximum + * number of accelerators for an instance type. + */ + private AcceleratorCountRequest acceleratorCount; + + /* + * Indicates whether instance types must have accelerators by specific manufacturers. + For instance types with + * NVIDIA devices, specify ``nvidia``. + For instance types with AMD devices, specify ``amd``. + For instance types + * with AWS devices, specify ``amazon-web-services``. + For instance types with Xilinx devices, specify ``xilinx``. + * Default: Any manufacturer + */ + private List acceleratorManufacturers; + + /* + * Lists the accelerators that must be on an instance type. + For instance types with NVIDIA A100 GPUs, specify + * ``a100``. + For instance types with NVIDIA V100 GPUs, specify ``v100``. + For instance types with NVIDIA K80 + * GPUs, specify ``k80``. + For instance types with NVIDIA T4 GPUs, specify ``t4``. + For instance types with NVIDIA + * M60 GPUs, specify ``m60``. + For instance types with AMD Radeon Pro V520 GPUs, specify ``radeon-pro-v520``. + For + * instance types with Xilinx VU9P FPGAs, specify ``vu9p``. Default: Any accelerator + */ + private List acceleratorNames; + + /* + * The minimum and maximum total memory size for the accelerators on an instance type, in MiB. Default: No minimum + * or maximum limits ``AcceleratorTotalMemoryMiBRequest`` is a property of the ``InstanceRequirements`` property of + * the [AWS::AutoScaling::AutoScalingGroup + * LaunchTemplateOverrides](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties- + * autoscaling-autoscalinggroup-launchtemplateoverrides.html) property type that describes the minimum and maximum + * total memory size for the accelerators for an instance type, in MiB. + */ + private AcceleratorTotalMemoryMiBRequest acceleratorTotalMemoryMiB; + + /* + * Lists the accelerator types that must be on an instance type. + For instance types with GPU accelerators, specify + * ``gpu``. + For instance types with FPGA accelerators, specify ``fpga``. + For instance types with inference + * accelerators, specify ``inference``. Default: Any accelerator type + */ + private List acceleratorTypes; + + /* + * The instance types to apply your specified attributes against. All other instance types are ignored, even if they + * match your specified attributes. You can use strings with one or more wild cards, represented by an asterisk + * (``*``), to allow an instance type, size, or generation. The following are examples: ``m5.8xlarge``, ``c5*.*``, + * ``m5a.*``, ``r*``, ``*3*``. For example, if you specify ``c5*``, Amazon EC2 Auto Scaling will allow the entire C5 + * instance family, which includes all C5a and C5n instance types. If you specify ``m5a.*``, Amazon EC2 Auto Scaling + * will allow all the M5a instance types, but not the M5n instance types. If you specify ``AllowedInstanceTypes``, + * you can't specify ``ExcludedInstanceTypes``. Default: All instance types + */ + private List allowedInstanceTypes; + + /* + * Indicates whether bare metal instance types are included, excluded, or required. Default: ``excluded`` + */ + private String bareMetal; + + /* + * The minimum and maximum baseline bandwidth performance for an instance type, in Mbps. For more information, see + * [Amazon EBS–optimized instances](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ebs-optimized.html) in the + * *Amazon EC2 User Guide for Linux Instances*. Default: No minimum or maximum limits + * ``BaselineEbsBandwidthMbpsRequest`` is a property of the ``InstanceRequirements`` property of the + * [AWS::AutoScaling::AutoScalingGroup + * LaunchTemplateOverrides](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties- + * autoscaling-autoscalinggroup-launchtemplateoverrides.html) property type that describes the minimum and maximum + * baseline bandwidth performance for an instance type, in Mbps. + */ + private BaselineEbsBandwidthMbpsRequest baselineEbsBandwidthMbps; + + /* + * Indicates whether burstable performance instance types are included, excluded, or required. For more information, + * see [Burstable performance + * instances](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/burstable-performance-instances.html) in the + * *Amazon EC2 User Guide for Linux Instances*. Default: ``excluded`` + */ + private String burstablePerformance; + + /* + * Lists which specific CPU manufacturers to include. + For instance types with Intel CPUs, specify ``intel``. + For + * instance types with AMD CPUs, specify ``amd``. + For instance types with AWS CPUs, specify + * ``amazon-web-services``. Don't confuse the CPU hardware manufacturer with the CPU hardware architecture. + * Instances will be launched with a compatible CPU architecture based on the Amazon Machine Image (AMI) that you + * specify in your launch template. Default: Any manufacturer + */ + private List cpuManufacturers; + + /* + * The instance types to exclude. You can use strings with one or more wild cards, represented by an asterisk + * (``*``), to exclude an instance family, type, size, or generation. The following are examples: ``m5.8xlarge``, + * ``c5*.*``, ``m5a.*``, ``r*``, ``*3*``. For example, if you specify ``c5*``, you are excluding the entire C5 + * instance family, which includes all C5a and C5n instance types. If you specify ``m5a.*``, Amazon EC2 Auto Scaling + * will exclude all the M5a instance types, but not the M5n instance types. If you specify + * ``ExcludedInstanceTypes``, you can't specify ``AllowedInstanceTypes``. Default: No excluded instance types + */ + private List excludedInstanceTypes; + + /* + * Indicates whether current or previous generation instance types are included. + For current generation instance + * types, specify ``current``. The current generation includes EC2 instance types currently recommended for use. + * This typically includes the latest two to three generations in each instance family. For more information, see + * [Instance types](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/instance-types.html) in the *Amazon EC2 User + * Guide for Linux Instances*. + For previous generation instance types, specify ``previous``. Default: Any current + * or previous generation + */ + private List instanceGenerations; + + /* + * Indicates whether instance types with instance store volumes are included, excluded, or required. For more + * information, see [Amazon EC2 instance + * store](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/InstanceStorage.html) in the *Amazon EC2 User Guide + * for Linux Instances*. Default: ``included`` + */ + private String localStorage; + + /* + * Indicates the type of local storage that is required. + For instance types with hard disk drive (HDD) storage, + * specify ``hdd``. + For instance types with solid state drive (SSD) storage, specify ``ssd``. Default: Any local + * storage type + */ + private List localStorageTypes; + + /* + * [Price protection] The price protection threshold for Spot Instances, as a percentage of an identified On-Demand + * price. The identified On-Demand price is the price of the lowest priced current generation C, M, or R instance + * type with your specified attributes. If no current generation C, M, or R instance type matches your attributes, + * then the identified price is from either the lowest priced current generation instance types or, failing that, + * the lowest priced previous generation instance types that match your attributes. When Amazon EC2 Auto Scaling + * selects instance types with your attributes, we will exclude instance types whose price exceeds your specified + * threshold. The parameter accepts an integer, which Amazon EC2 Auto Scaling interprets as a percentage. To + * indicate no price protection threshold, specify a high value, such as ``999999``. If you set + * ``DesiredCapacityType`` to ``vcpu`` or ``memory-mib``, the price protection threshold is based on the per-vCPU or + * per-memory price instead of the per instance price. Only one of ``SpotMaxPricePercentageOverLowestPrice`` or + * ``MaxSpotPriceAsPercentageOfOptimalOnDemandPrice`` can be specified. If you don't specify either, then + * ``SpotMaxPricePercentageOverLowestPrice`` is used and the value for that parameter defaults to ``100``. + */ + private Integer maxSpotPriceAsPercentageOfOptimalOnDemandPrice; + + /* + * The minimum and maximum amount of memory per vCPU for an instance type, in GiB. Default: No minimum or maximum + * limits ``MemoryGiBPerVCpuRequest`` is a property of the ``InstanceRequirements`` property of the + * [AWS::AutoScaling::AutoScalingGroup + * LaunchTemplateOverrides](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties- + * autoscaling-autoscalinggroup-launchtemplateoverrides.html) property type that describes the minimum and maximum + * amount of memory per vCPU for an instance type, in GiB. + */ + private MemoryGiBPerVCpuRequest memoryGiBPerVCpu; + + /* + * The minimum and maximum instance memory size for an instance type, in MiB. ``MemoryMiBRequest`` is a property of + * the ``InstanceRequirements`` property of the [AWS::AutoScaling::AutoScalingGroup + * LaunchTemplateOverrides](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties- + * autoscaling-autoscalinggroup-launchtemplateoverrides.html) property type that describes the minimum and maximum + * instance memory size for an instance type, in MiB. + */ + private MemoryMiBRequest memoryMiB; + + /* + * The minimum and maximum amount of network bandwidth, in gigabits per second (Gbps). Default: No minimum or + * maximum limits ``NetworkBandwidthGbpsRequest`` is a property of the ``InstanceRequirements`` property of the + * [AWS::AutoScaling::AutoScalingGroup + * LaunchTemplateOverrides](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties- + * autoscaling-autoscalinggroup-launchtemplateoverrides.html) property type that describes the minimum and maximum + * network bandwidth for an instance type, in Gbps. Setting the minimum bandwidth does not guarantee that your + * instance will achieve the minimum bandwidth. Amazon EC2 will identify instance types that support the specified + * minimum bandwidth, but the actual bandwidth of your instance might go below the specified minimum at times. For + * more information, see [Available instance + * bandwidth](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-instance-network-bandwidth.html#available- + * instance-bandwidth) in the *Amazon EC2 User Guide for Linux Instances*. + */ + private NetworkBandwidthGbpsRequest networkBandwidthGbps; + + /* + * The minimum and maximum number of network interfaces for an instance type. Default: No minimum or maximum limits + * ``NetworkInterfaceCountRequest`` is a property of the ``InstanceRequirements`` property of the + * [AWS::AutoScaling::AutoScalingGroup + * LaunchTemplateOverrides](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties- + * autoscaling-autoscalinggroup-launchtemplateoverrides.html) property type that describes the minimum and maximum + * number of network interfaces for an instance type. + */ + private NetworkInterfaceCountRequest networkInterfaceCount; + + /* + * [Price protection] The price protection threshold for On-Demand Instances, as a percentage higher than an + * identified On-Demand price. The identified On-Demand price is the price of the lowest priced current generation + * C, M, or R instance type with your specified attributes. If no current generation C, M, or R instance type + * matches your attributes, then the identified price is from either the lowest priced current generation instance + * types or, failing that, the lowest priced previous generation instance types that match your attributes. When + * Amazon EC2 Auto Scaling selects instance types with your attributes, we will exclude instance types whose price + * exceeds your specified threshold. The parameter accepts an integer, which Amazon EC2 Auto Scaling interprets as a + * percentage. To turn off price protection, specify a high value, such as ``999999``. If you set + * ``DesiredCapacityType`` to ``vcpu`` or ``memory-mib``, the price protection threshold is applied based on the + * per-vCPU or per-memory price instead of the per instance price. Default: ``20`` + */ + private Integer onDemandMaxPricePercentageOverLowestPrice; + + /* + * Indicates whether instance types must provide On-Demand Instance hibernation support. Default: ``false`` + */ + private Boolean requireHibernateSupport; + + /* + * [Price protection] The price protection threshold for Spot Instances, as a percentage higher than an identified + * Spot price. The identified Spot price is the price of the lowest priced current generation C, M, or R instance + * type with your specified attributes. If no current generation C, M, or R instance type matches your attributes, + * then the identified price is from either the lowest priced current generation instance types or, failing that, + * the lowest priced previous generation instance types that match your attributes. When Amazon EC2 Auto Scaling + * selects instance types with your attributes, we will exclude instance types whose price exceeds your specified + * threshold. The parameter accepts an integer, which Amazon EC2 Auto Scaling interprets as a percentage. To turn + * off price protection, specify a high value, such as ``999999``. If you set ``DesiredCapacityType`` to ``vcpu`` or + * ``memory-mib``, the price protection threshold is based on the per-vCPU or per-memory price instead of the per + * instance price. Only one of ``SpotMaxPricePercentageOverLowestPrice`` or + * ``MaxSpotPriceAsPercentageOfOptimalOnDemandPrice`` can be specified. Default: ``100`` + */ + private Integer spotMaxPricePercentageOverLowestPrice; + + /* + * The minimum and maximum total local storage size for an instance type, in GB. Default: No minimum or maximum + * limits ``TotalLocalStorageGBRequest`` is a property of the ``InstanceRequirements`` property of the + * [AWS::AutoScaling::AutoScalingGroup + * LaunchTemplateOverrides](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties- + * autoscaling-autoscalinggroup-launchtemplateoverrides.html) property type that describes the minimum and maximum + * total local storage size for an instance type, in GB. + */ + private TotalLocalStorageGBRequest totalLocalStorageGB; + + /* + * The minimum and maximum number of vCPUs for an instance type. ``VCpuCountRequest`` is a property of the + * ``InstanceRequirements`` property of the [AWS::AutoScaling::AutoScalingGroup + * LaunchTemplateOverrides](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties- + * autoscaling-autoscalinggroup-launchtemplateoverrides.html) property type that describes the minimum and maximum + * number of vCPUs for an instance type. + */ + private VCpuCountRequest vCpuCount; + + /** + * Creates an instance of InstanceRequirements class. + */ + public InstanceRequirements() { + } + + /** + * Get the acceleratorCount property: The minimum and maximum number of accelerators (GPUs, FPGAs, or AWS Inferentia + * chips) for an instance type. To exclude accelerator-enabled instance types, set ``Max`` to ``0``. Default: No + * minimum or maximum limits ``AcceleratorCountRequest`` is a property of the ``InstanceRequirements`` property of + * the [AWS::AutoScaling::AutoScalingGroup + * LaunchTemplateOverrides](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-autoscaling-autoscalinggroup-launchtemplateoverrides.html) + * property type that describes the minimum and maximum number of accelerators for an instance type. + * + * @return the acceleratorCount value. + */ + public AcceleratorCountRequest acceleratorCount() { + return this.acceleratorCount; + } + + /** + * Set the acceleratorCount property: The minimum and maximum number of accelerators (GPUs, FPGAs, or AWS Inferentia + * chips) for an instance type. To exclude accelerator-enabled instance types, set ``Max`` to ``0``. Default: No + * minimum or maximum limits ``AcceleratorCountRequest`` is a property of the ``InstanceRequirements`` property of + * the [AWS::AutoScaling::AutoScalingGroup + * LaunchTemplateOverrides](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-autoscaling-autoscalinggroup-launchtemplateoverrides.html) + * property type that describes the minimum and maximum number of accelerators for an instance type. + * + * @param acceleratorCount the acceleratorCount value to set. + * @return the InstanceRequirements object itself. + */ + public InstanceRequirements withAcceleratorCount(AcceleratorCountRequest acceleratorCount) { + this.acceleratorCount = acceleratorCount; + return this; + } + + /** + * Get the acceleratorManufacturers property: Indicates whether instance types must have accelerators by specific + * manufacturers. + For instance types with NVIDIA devices, specify ``nvidia``. + For instance types with AMD + * devices, specify ``amd``. + For instance types with AWS devices, specify ``amazon-web-services``. + For instance + * types with Xilinx devices, specify ``xilinx``. Default: Any manufacturer. + * + * @return the acceleratorManufacturers value. + */ + public List acceleratorManufacturers() { + return this.acceleratorManufacturers; + } + + /** + * Set the acceleratorManufacturers property: Indicates whether instance types must have accelerators by specific + * manufacturers. + For instance types with NVIDIA devices, specify ``nvidia``. + For instance types with AMD + * devices, specify ``amd``. + For instance types with AWS devices, specify ``amazon-web-services``. + For instance + * types with Xilinx devices, specify ``xilinx``. Default: Any manufacturer. + * + * @param acceleratorManufacturers the acceleratorManufacturers value to set. + * @return the InstanceRequirements object itself. + */ + public InstanceRequirements withAcceleratorManufacturers(List acceleratorManufacturers) { + this.acceleratorManufacturers = acceleratorManufacturers; + return this; + } + + /** + * Get the acceleratorNames property: Lists the accelerators that must be on an instance type. + For instance types + * with NVIDIA A100 GPUs, specify ``a100``. + For instance types with NVIDIA V100 GPUs, specify ``v100``. + For + * instance types with NVIDIA K80 GPUs, specify ``k80``. + For instance types with NVIDIA T4 GPUs, specify ``t4``. + + * For instance types with NVIDIA M60 GPUs, specify ``m60``. + For instance types with AMD Radeon Pro V520 GPUs, + * specify ``radeon-pro-v520``. + For instance types with Xilinx VU9P FPGAs, specify ``vu9p``. Default: Any + * accelerator. + * + * @return the acceleratorNames value. + */ + public List acceleratorNames() { + return this.acceleratorNames; + } + + /** + * Set the acceleratorNames property: Lists the accelerators that must be on an instance type. + For instance types + * with NVIDIA A100 GPUs, specify ``a100``. + For instance types with NVIDIA V100 GPUs, specify ``v100``. + For + * instance types with NVIDIA K80 GPUs, specify ``k80``. + For instance types with NVIDIA T4 GPUs, specify ``t4``. + + * For instance types with NVIDIA M60 GPUs, specify ``m60``. + For instance types with AMD Radeon Pro V520 GPUs, + * specify ``radeon-pro-v520``. + For instance types with Xilinx VU9P FPGAs, specify ``vu9p``. Default: Any + * accelerator. + * + * @param acceleratorNames the acceleratorNames value to set. + * @return the InstanceRequirements object itself. + */ + public InstanceRequirements withAcceleratorNames(List acceleratorNames) { + this.acceleratorNames = acceleratorNames; + return this; + } + + /** + * Get the acceleratorTotalMemoryMiB property: The minimum and maximum total memory size for the accelerators on an + * instance type, in MiB. Default: No minimum or maximum limits ``AcceleratorTotalMemoryMiBRequest`` is a property + * of the ``InstanceRequirements`` property of the [AWS::AutoScaling::AutoScalingGroup + * LaunchTemplateOverrides](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-autoscaling-autoscalinggroup-launchtemplateoverrides.html) + * property type that describes the minimum and maximum total memory size for the accelerators for an instance type, + * in MiB. + * + * @return the acceleratorTotalMemoryMiB value. + */ + public AcceleratorTotalMemoryMiBRequest acceleratorTotalMemoryMiB() { + return this.acceleratorTotalMemoryMiB; + } + + /** + * Set the acceleratorTotalMemoryMiB property: The minimum and maximum total memory size for the accelerators on an + * instance type, in MiB. Default: No minimum or maximum limits ``AcceleratorTotalMemoryMiBRequest`` is a property + * of the ``InstanceRequirements`` property of the [AWS::AutoScaling::AutoScalingGroup + * LaunchTemplateOverrides](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-autoscaling-autoscalinggroup-launchtemplateoverrides.html) + * property type that describes the minimum and maximum total memory size for the accelerators for an instance type, + * in MiB. + * + * @param acceleratorTotalMemoryMiB the acceleratorTotalMemoryMiB value to set. + * @return the InstanceRequirements object itself. + */ + public InstanceRequirements + withAcceleratorTotalMemoryMiB(AcceleratorTotalMemoryMiBRequest acceleratorTotalMemoryMiB) { + this.acceleratorTotalMemoryMiB = acceleratorTotalMemoryMiB; + return this; + } + + /** + * Get the acceleratorTypes property: Lists the accelerator types that must be on an instance type. + For instance + * types with GPU accelerators, specify ``gpu``. + For instance types with FPGA accelerators, specify ``fpga``. + + * For instance types with inference accelerators, specify ``inference``. Default: Any accelerator type. + * + * @return the acceleratorTypes value. + */ + public List acceleratorTypes() { + return this.acceleratorTypes; + } + + /** + * Set the acceleratorTypes property: Lists the accelerator types that must be on an instance type. + For instance + * types with GPU accelerators, specify ``gpu``. + For instance types with FPGA accelerators, specify ``fpga``. + + * For instance types with inference accelerators, specify ``inference``. Default: Any accelerator type. + * + * @param acceleratorTypes the acceleratorTypes value to set. + * @return the InstanceRequirements object itself. + */ + public InstanceRequirements withAcceleratorTypes(List acceleratorTypes) { + this.acceleratorTypes = acceleratorTypes; + return this; + } + + /** + * Get the allowedInstanceTypes property: The instance types to apply your specified attributes against. All other + * instance types are ignored, even if they match your specified attributes. You can use strings with one or more + * wild cards, represented by an asterisk (``*``), to allow an instance type, size, or generation. The following are + * examples: ``m5.8xlarge``, ``c5*.*``, ``m5a.*``, ``r*``, ``*3*``. For example, if you specify ``c5*``, Amazon EC2 + * Auto Scaling will allow the entire C5 instance family, which includes all C5a and C5n instance types. If you + * specify ``m5a.*``, Amazon EC2 Auto Scaling will allow all the M5a instance types, but not the M5n instance types. + * If you specify ``AllowedInstanceTypes``, you can't specify ``ExcludedInstanceTypes``. Default: All instance + * types. + * + * @return the allowedInstanceTypes value. + */ + public List allowedInstanceTypes() { + return this.allowedInstanceTypes; + } + + /** + * Set the allowedInstanceTypes property: The instance types to apply your specified attributes against. All other + * instance types are ignored, even if they match your specified attributes. You can use strings with one or more + * wild cards, represented by an asterisk (``*``), to allow an instance type, size, or generation. The following are + * examples: ``m5.8xlarge``, ``c5*.*``, ``m5a.*``, ``r*``, ``*3*``. For example, if you specify ``c5*``, Amazon EC2 + * Auto Scaling will allow the entire C5 instance family, which includes all C5a and C5n instance types. If you + * specify ``m5a.*``, Amazon EC2 Auto Scaling will allow all the M5a instance types, but not the M5n instance types. + * If you specify ``AllowedInstanceTypes``, you can't specify ``ExcludedInstanceTypes``. Default: All instance + * types. + * + * @param allowedInstanceTypes the allowedInstanceTypes value to set. + * @return the InstanceRequirements object itself. + */ + public InstanceRequirements withAllowedInstanceTypes(List allowedInstanceTypes) { + this.allowedInstanceTypes = allowedInstanceTypes; + return this; + } + + /** + * Get the bareMetal property: Indicates whether bare metal instance types are included, excluded, or required. + * Default: ``excluded``. + * + * @return the bareMetal value. + */ + public String bareMetal() { + return this.bareMetal; + } + + /** + * Set the bareMetal property: Indicates whether bare metal instance types are included, excluded, or required. + * Default: ``excluded``. + * + * @param bareMetal the bareMetal value to set. + * @return the InstanceRequirements object itself. + */ + public InstanceRequirements withBareMetal(String bareMetal) { + this.bareMetal = bareMetal; + return this; + } + + /** + * Get the baselineEbsBandwidthMbps property: The minimum and maximum baseline bandwidth performance for an instance + * type, in Mbps. For more information, see [Amazon EBS–optimized + * instances](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ebs-optimized.html) in the *Amazon EC2 User Guide + * for Linux Instances*. Default: No minimum or maximum limits ``BaselineEbsBandwidthMbpsRequest`` is a property of + * the ``InstanceRequirements`` property of the [AWS::AutoScaling::AutoScalingGroup + * LaunchTemplateOverrides](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-autoscaling-autoscalinggroup-launchtemplateoverrides.html) + * property type that describes the minimum and maximum baseline bandwidth performance for an instance type, in + * Mbps. + * + * @return the baselineEbsBandwidthMbps value. + */ + public BaselineEbsBandwidthMbpsRequest baselineEbsBandwidthMbps() { + return this.baselineEbsBandwidthMbps; + } + + /** + * Set the baselineEbsBandwidthMbps property: The minimum and maximum baseline bandwidth performance for an instance + * type, in Mbps. For more information, see [Amazon EBS–optimized + * instances](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ebs-optimized.html) in the *Amazon EC2 User Guide + * for Linux Instances*. Default: No minimum or maximum limits ``BaselineEbsBandwidthMbpsRequest`` is a property of + * the ``InstanceRequirements`` property of the [AWS::AutoScaling::AutoScalingGroup + * LaunchTemplateOverrides](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-autoscaling-autoscalinggroup-launchtemplateoverrides.html) + * property type that describes the minimum and maximum baseline bandwidth performance for an instance type, in + * Mbps. + * + * @param baselineEbsBandwidthMbps the baselineEbsBandwidthMbps value to set. + * @return the InstanceRequirements object itself. + */ + public InstanceRequirements withBaselineEbsBandwidthMbps(BaselineEbsBandwidthMbpsRequest baselineEbsBandwidthMbps) { + this.baselineEbsBandwidthMbps = baselineEbsBandwidthMbps; + return this; + } + + /** + * Get the burstablePerformance property: Indicates whether burstable performance instance types are included, + * excluded, or required. For more information, see [Burstable performance + * instances](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/burstable-performance-instances.html) in the + * *Amazon EC2 User Guide for Linux Instances*. Default: ``excluded``. + * + * @return the burstablePerformance value. + */ + public String burstablePerformance() { + return this.burstablePerformance; + } + + /** + * Set the burstablePerformance property: Indicates whether burstable performance instance types are included, + * excluded, or required. For more information, see [Burstable performance + * instances](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/burstable-performance-instances.html) in the + * *Amazon EC2 User Guide for Linux Instances*. Default: ``excluded``. + * + * @param burstablePerformance the burstablePerformance value to set. + * @return the InstanceRequirements object itself. + */ + public InstanceRequirements withBurstablePerformance(String burstablePerformance) { + this.burstablePerformance = burstablePerformance; + return this; + } + + /** + * Get the cpuManufacturers property: Lists which specific CPU manufacturers to include. + For instance types with + * Intel CPUs, specify ``intel``. + For instance types with AMD CPUs, specify ``amd``. + For instance types with AWS + * CPUs, specify ``amazon-web-services``. Don't confuse the CPU hardware manufacturer with the CPU hardware + * architecture. Instances will be launched with a compatible CPU architecture based on the Amazon Machine Image + * (AMI) that you specify in your launch template. Default: Any manufacturer. + * + * @return the cpuManufacturers value. + */ + public List cpuManufacturers() { + return this.cpuManufacturers; + } + + /** + * Set the cpuManufacturers property: Lists which specific CPU manufacturers to include. + For instance types with + * Intel CPUs, specify ``intel``. + For instance types with AMD CPUs, specify ``amd``. + For instance types with AWS + * CPUs, specify ``amazon-web-services``. Don't confuse the CPU hardware manufacturer with the CPU hardware + * architecture. Instances will be launched with a compatible CPU architecture based on the Amazon Machine Image + * (AMI) that you specify in your launch template. Default: Any manufacturer. + * + * @param cpuManufacturers the cpuManufacturers value to set. + * @return the InstanceRequirements object itself. + */ + public InstanceRequirements withCpuManufacturers(List cpuManufacturers) { + this.cpuManufacturers = cpuManufacturers; + return this; + } + + /** + * Get the excludedInstanceTypes property: The instance types to exclude. You can use strings with one or more wild + * cards, represented by an asterisk (``*``), to exclude an instance family, type, size, or generation. The + * following are examples: ``m5.8xlarge``, ``c5*.*``, ``m5a.*``, ``r*``, ``*3*``. For example, if you specify + * ``c5*``, you are excluding the entire C5 instance family, which includes all C5a and C5n instance types. If you + * specify ``m5a.*``, Amazon EC2 Auto Scaling will exclude all the M5a instance types, but not the M5n instance + * types. If you specify ``ExcludedInstanceTypes``, you can't specify ``AllowedInstanceTypes``. Default: No excluded + * instance types. + * + * @return the excludedInstanceTypes value. + */ + public List excludedInstanceTypes() { + return this.excludedInstanceTypes; + } + + /** + * Set the excludedInstanceTypes property: The instance types to exclude. You can use strings with one or more wild + * cards, represented by an asterisk (``*``), to exclude an instance family, type, size, or generation. The + * following are examples: ``m5.8xlarge``, ``c5*.*``, ``m5a.*``, ``r*``, ``*3*``. For example, if you specify + * ``c5*``, you are excluding the entire C5 instance family, which includes all C5a and C5n instance types. If you + * specify ``m5a.*``, Amazon EC2 Auto Scaling will exclude all the M5a instance types, but not the M5n instance + * types. If you specify ``ExcludedInstanceTypes``, you can't specify ``AllowedInstanceTypes``. Default: No excluded + * instance types. + * + * @param excludedInstanceTypes the excludedInstanceTypes value to set. + * @return the InstanceRequirements object itself. + */ + public InstanceRequirements withExcludedInstanceTypes(List excludedInstanceTypes) { + this.excludedInstanceTypes = excludedInstanceTypes; + return this; + } + + /** + * Get the instanceGenerations property: Indicates whether current or previous generation instance types are + * included. + For current generation instance types, specify ``current``. The current generation includes EC2 + * instance types currently recommended for use. This typically includes the latest two to three generations in each + * instance family. For more information, see [Instance + * types](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/instance-types.html) in the *Amazon EC2 User Guide for + * Linux Instances*. + For previous generation instance types, specify ``previous``. Default: Any current or + * previous generation. + * + * @return the instanceGenerations value. + */ + public List instanceGenerations() { + return this.instanceGenerations; + } + + /** + * Set the instanceGenerations property: Indicates whether current or previous generation instance types are + * included. + For current generation instance types, specify ``current``. The current generation includes EC2 + * instance types currently recommended for use. This typically includes the latest two to three generations in each + * instance family. For more information, see [Instance + * types](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/instance-types.html) in the *Amazon EC2 User Guide for + * Linux Instances*. + For previous generation instance types, specify ``previous``. Default: Any current or + * previous generation. + * + * @param instanceGenerations the instanceGenerations value to set. + * @return the InstanceRequirements object itself. + */ + public InstanceRequirements withInstanceGenerations(List instanceGenerations) { + this.instanceGenerations = instanceGenerations; + return this; + } + + /** + * Get the localStorage property: Indicates whether instance types with instance store volumes are included, + * excluded, or required. For more information, see [Amazon EC2 instance + * store](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/InstanceStorage.html) in the *Amazon EC2 User Guide + * for Linux Instances*. Default: ``included``. + * + * @return the localStorage value. + */ + public String localStorage() { + return this.localStorage; + } + + /** + * Set the localStorage property: Indicates whether instance types with instance store volumes are included, + * excluded, or required. For more information, see [Amazon EC2 instance + * store](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/InstanceStorage.html) in the *Amazon EC2 User Guide + * for Linux Instances*. Default: ``included``. + * + * @param localStorage the localStorage value to set. + * @return the InstanceRequirements object itself. + */ + public InstanceRequirements withLocalStorage(String localStorage) { + this.localStorage = localStorage; + return this; + } + + /** + * Get the localStorageTypes property: Indicates the type of local storage that is required. + For instance types + * with hard disk drive (HDD) storage, specify ``hdd``. + For instance types with solid state drive (SSD) storage, + * specify ``ssd``. Default: Any local storage type. + * + * @return the localStorageTypes value. + */ + public List localStorageTypes() { + return this.localStorageTypes; + } + + /** + * Set the localStorageTypes property: Indicates the type of local storage that is required. + For instance types + * with hard disk drive (HDD) storage, specify ``hdd``. + For instance types with solid state drive (SSD) storage, + * specify ``ssd``. Default: Any local storage type. + * + * @param localStorageTypes the localStorageTypes value to set. + * @return the InstanceRequirements object itself. + */ + public InstanceRequirements withLocalStorageTypes(List localStorageTypes) { + this.localStorageTypes = localStorageTypes; + return this; + } + + /** + * Get the maxSpotPriceAsPercentageOfOptimalOnDemandPrice property: [Price protection] The price protection + * threshold for Spot Instances, as a percentage of an identified On-Demand price. The identified On-Demand price is + * the price of the lowest priced current generation C, M, or R instance type with your specified attributes. If no + * current generation C, M, or R instance type matches your attributes, then the identified price is from either the + * lowest priced current generation instance types or, failing that, the lowest priced previous generation instance + * types that match your attributes. When Amazon EC2 Auto Scaling selects instance types with your attributes, we + * will exclude instance types whose price exceeds your specified threshold. The parameter accepts an integer, which + * Amazon EC2 Auto Scaling interprets as a percentage. To indicate no price protection threshold, specify a high + * value, such as ``999999``. If you set ``DesiredCapacityType`` to ``vcpu`` or ``memory-mib``, the price protection + * threshold is based on the per-vCPU or per-memory price instead of the per instance price. Only one of + * ``SpotMaxPricePercentageOverLowestPrice`` or ``MaxSpotPriceAsPercentageOfOptimalOnDemandPrice`` can be specified. + * If you don't specify either, then ``SpotMaxPricePercentageOverLowestPrice`` is used and the value for that + * parameter defaults to ``100``. + * + * @return the maxSpotPriceAsPercentageOfOptimalOnDemandPrice value. + */ + public Integer maxSpotPriceAsPercentageOfOptimalOnDemandPrice() { + return this.maxSpotPriceAsPercentageOfOptimalOnDemandPrice; + } + + /** + * Set the maxSpotPriceAsPercentageOfOptimalOnDemandPrice property: [Price protection] The price protection + * threshold for Spot Instances, as a percentage of an identified On-Demand price. The identified On-Demand price is + * the price of the lowest priced current generation C, M, or R instance type with your specified attributes. If no + * current generation C, M, or R instance type matches your attributes, then the identified price is from either the + * lowest priced current generation instance types or, failing that, the lowest priced previous generation instance + * types that match your attributes. When Amazon EC2 Auto Scaling selects instance types with your attributes, we + * will exclude instance types whose price exceeds your specified threshold. The parameter accepts an integer, which + * Amazon EC2 Auto Scaling interprets as a percentage. To indicate no price protection threshold, specify a high + * value, such as ``999999``. If you set ``DesiredCapacityType`` to ``vcpu`` or ``memory-mib``, the price protection + * threshold is based on the per-vCPU or per-memory price instead of the per instance price. Only one of + * ``SpotMaxPricePercentageOverLowestPrice`` or ``MaxSpotPriceAsPercentageOfOptimalOnDemandPrice`` can be specified. + * If you don't specify either, then ``SpotMaxPricePercentageOverLowestPrice`` is used and the value for that + * parameter defaults to ``100``. + * + * @param maxSpotPriceAsPercentageOfOptimalOnDemandPrice the maxSpotPriceAsPercentageOfOptimalOnDemandPrice value to + * set. + * @return the InstanceRequirements object itself. + */ + public InstanceRequirements + withMaxSpotPriceAsPercentageOfOptimalOnDemandPrice(Integer maxSpotPriceAsPercentageOfOptimalOnDemandPrice) { + this.maxSpotPriceAsPercentageOfOptimalOnDemandPrice = maxSpotPriceAsPercentageOfOptimalOnDemandPrice; + return this; + } + + /** + * Get the memoryGiBPerVCpu property: The minimum and maximum amount of memory per vCPU for an instance type, in + * GiB. Default: No minimum or maximum limits ``MemoryGiBPerVCpuRequest`` is a property of the + * ``InstanceRequirements`` property of the [AWS::AutoScaling::AutoScalingGroup + * LaunchTemplateOverrides](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-autoscaling-autoscalinggroup-launchtemplateoverrides.html) + * property type that describes the minimum and maximum amount of memory per vCPU for an instance type, in GiB. + * + * @return the memoryGiBPerVCpu value. + */ + public MemoryGiBPerVCpuRequest memoryGiBPerVCpu() { + return this.memoryGiBPerVCpu; + } + + /** + * Set the memoryGiBPerVCpu property: The minimum and maximum amount of memory per vCPU for an instance type, in + * GiB. Default: No minimum or maximum limits ``MemoryGiBPerVCpuRequest`` is a property of the + * ``InstanceRequirements`` property of the [AWS::AutoScaling::AutoScalingGroup + * LaunchTemplateOverrides](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-autoscaling-autoscalinggroup-launchtemplateoverrides.html) + * property type that describes the minimum and maximum amount of memory per vCPU for an instance type, in GiB. + * + * @param memoryGiBPerVCpu the memoryGiBPerVCpu value to set. + * @return the InstanceRequirements object itself. + */ + public InstanceRequirements withMemoryGiBPerVCpu(MemoryGiBPerVCpuRequest memoryGiBPerVCpu) { + this.memoryGiBPerVCpu = memoryGiBPerVCpu; + return this; + } + + /** + * Get the memoryMiB property: The minimum and maximum instance memory size for an instance type, in MiB. + * ``MemoryMiBRequest`` is a property of the ``InstanceRequirements`` property of the + * [AWS::AutoScaling::AutoScalingGroup + * LaunchTemplateOverrides](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-autoscaling-autoscalinggroup-launchtemplateoverrides.html) + * property type that describes the minimum and maximum instance memory size for an instance type, in MiB. + * + * @return the memoryMiB value. + */ + public MemoryMiBRequest memoryMiB() { + return this.memoryMiB; + } + + /** + * Set the memoryMiB property: The minimum and maximum instance memory size for an instance type, in MiB. + * ``MemoryMiBRequest`` is a property of the ``InstanceRequirements`` property of the + * [AWS::AutoScaling::AutoScalingGroup + * LaunchTemplateOverrides](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-autoscaling-autoscalinggroup-launchtemplateoverrides.html) + * property type that describes the minimum and maximum instance memory size for an instance type, in MiB. + * + * @param memoryMiB the memoryMiB value to set. + * @return the InstanceRequirements object itself. + */ + public InstanceRequirements withMemoryMiB(MemoryMiBRequest memoryMiB) { + this.memoryMiB = memoryMiB; + return this; + } + + /** + * Get the networkBandwidthGbps property: The minimum and maximum amount of network bandwidth, in gigabits per + * second (Gbps). Default: No minimum or maximum limits ``NetworkBandwidthGbpsRequest`` is a property of the + * ``InstanceRequirements`` property of the [AWS::AutoScaling::AutoScalingGroup + * LaunchTemplateOverrides](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-autoscaling-autoscalinggroup-launchtemplateoverrides.html) + * property type that describes the minimum and maximum network bandwidth for an instance type, in Gbps. Setting the + * minimum bandwidth does not guarantee that your instance will achieve the minimum bandwidth. Amazon EC2 will + * identify instance types that support the specified minimum bandwidth, but the actual bandwidth of your instance + * might go below the specified minimum at times. For more information, see [Available instance + * bandwidth](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-instance-network-bandwidth.html#available-instance-bandwidth) + * in the *Amazon EC2 User Guide for Linux Instances*. + * + * @return the networkBandwidthGbps value. + */ + public NetworkBandwidthGbpsRequest networkBandwidthGbps() { + return this.networkBandwidthGbps; + } + + /** + * Set the networkBandwidthGbps property: The minimum and maximum amount of network bandwidth, in gigabits per + * second (Gbps). Default: No minimum or maximum limits ``NetworkBandwidthGbpsRequest`` is a property of the + * ``InstanceRequirements`` property of the [AWS::AutoScaling::AutoScalingGroup + * LaunchTemplateOverrides](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-autoscaling-autoscalinggroup-launchtemplateoverrides.html) + * property type that describes the minimum and maximum network bandwidth for an instance type, in Gbps. Setting the + * minimum bandwidth does not guarantee that your instance will achieve the minimum bandwidth. Amazon EC2 will + * identify instance types that support the specified minimum bandwidth, but the actual bandwidth of your instance + * might go below the specified minimum at times. For more information, see [Available instance + * bandwidth](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-instance-network-bandwidth.html#available-instance-bandwidth) + * in the *Amazon EC2 User Guide for Linux Instances*. + * + * @param networkBandwidthGbps the networkBandwidthGbps value to set. + * @return the InstanceRequirements object itself. + */ + public InstanceRequirements withNetworkBandwidthGbps(NetworkBandwidthGbpsRequest networkBandwidthGbps) { + this.networkBandwidthGbps = networkBandwidthGbps; + return this; + } + + /** + * Get the networkInterfaceCount property: The minimum and maximum number of network interfaces for an instance + * type. Default: No minimum or maximum limits ``NetworkInterfaceCountRequest`` is a property of the + * ``InstanceRequirements`` property of the [AWS::AutoScaling::AutoScalingGroup + * LaunchTemplateOverrides](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-autoscaling-autoscalinggroup-launchtemplateoverrides.html) + * property type that describes the minimum and maximum number of network interfaces for an instance type. + * + * @return the networkInterfaceCount value. + */ + public NetworkInterfaceCountRequest networkInterfaceCount() { + return this.networkInterfaceCount; + } + + /** + * Set the networkInterfaceCount property: The minimum and maximum number of network interfaces for an instance + * type. Default: No minimum or maximum limits ``NetworkInterfaceCountRequest`` is a property of the + * ``InstanceRequirements`` property of the [AWS::AutoScaling::AutoScalingGroup + * LaunchTemplateOverrides](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-autoscaling-autoscalinggroup-launchtemplateoverrides.html) + * property type that describes the minimum and maximum number of network interfaces for an instance type. + * + * @param networkInterfaceCount the networkInterfaceCount value to set. + * @return the InstanceRequirements object itself. + */ + public InstanceRequirements withNetworkInterfaceCount(NetworkInterfaceCountRequest networkInterfaceCount) { + this.networkInterfaceCount = networkInterfaceCount; + return this; + } + + /** + * Get the onDemandMaxPricePercentageOverLowestPrice property: [Price protection] The price protection threshold for + * On-Demand Instances, as a percentage higher than an identified On-Demand price. The identified On-Demand price is + * the price of the lowest priced current generation C, M, or R instance type with your specified attributes. If no + * current generation C, M, or R instance type matches your attributes, then the identified price is from either the + * lowest priced current generation instance types or, failing that, the lowest priced previous generation instance + * types that match your attributes. When Amazon EC2 Auto Scaling selects instance types with your attributes, we + * will exclude instance types whose price exceeds your specified threshold. The parameter accepts an integer, which + * Amazon EC2 Auto Scaling interprets as a percentage. To turn off price protection, specify a high value, such as + * ``999999``. If you set ``DesiredCapacityType`` to ``vcpu`` or ``memory-mib``, the price protection threshold is + * applied based on the per-vCPU or per-memory price instead of the per instance price. Default: ``20``. + * + * @return the onDemandMaxPricePercentageOverLowestPrice value. + */ + public Integer onDemandMaxPricePercentageOverLowestPrice() { + return this.onDemandMaxPricePercentageOverLowestPrice; + } + + /** + * Set the onDemandMaxPricePercentageOverLowestPrice property: [Price protection] The price protection threshold for + * On-Demand Instances, as a percentage higher than an identified On-Demand price. The identified On-Demand price is + * the price of the lowest priced current generation C, M, or R instance type with your specified attributes. If no + * current generation C, M, or R instance type matches your attributes, then the identified price is from either the + * lowest priced current generation instance types or, failing that, the lowest priced previous generation instance + * types that match your attributes. When Amazon EC2 Auto Scaling selects instance types with your attributes, we + * will exclude instance types whose price exceeds your specified threshold. The parameter accepts an integer, which + * Amazon EC2 Auto Scaling interprets as a percentage. To turn off price protection, specify a high value, such as + * ``999999``. If you set ``DesiredCapacityType`` to ``vcpu`` or ``memory-mib``, the price protection threshold is + * applied based on the per-vCPU or per-memory price instead of the per instance price. Default: ``20``. + * + * @param onDemandMaxPricePercentageOverLowestPrice the onDemandMaxPricePercentageOverLowestPrice value to set. + * @return the InstanceRequirements object itself. + */ + public InstanceRequirements + withOnDemandMaxPricePercentageOverLowestPrice(Integer onDemandMaxPricePercentageOverLowestPrice) { + this.onDemandMaxPricePercentageOverLowestPrice = onDemandMaxPricePercentageOverLowestPrice; + return this; + } + + /** + * Get the requireHibernateSupport property: Indicates whether instance types must provide On-Demand Instance + * hibernation support. Default: ``false``. + * + * @return the requireHibernateSupport value. + */ + public Boolean requireHibernateSupport() { + return this.requireHibernateSupport; + } + + /** + * Set the requireHibernateSupport property: Indicates whether instance types must provide On-Demand Instance + * hibernation support. Default: ``false``. + * + * @param requireHibernateSupport the requireHibernateSupport value to set. + * @return the InstanceRequirements object itself. + */ + public InstanceRequirements withRequireHibernateSupport(Boolean requireHibernateSupport) { + this.requireHibernateSupport = requireHibernateSupport; + return this; + } + + /** + * Get the spotMaxPricePercentageOverLowestPrice property: [Price protection] The price protection threshold for + * Spot Instances, as a percentage higher than an identified Spot price. The identified Spot price is the price of + * the lowest priced current generation C, M, or R instance type with your specified attributes. If no current + * generation C, M, or R instance type matches your attributes, then the identified price is from either the lowest + * priced current generation instance types or, failing that, the lowest priced previous generation instance types + * that match your attributes. When Amazon EC2 Auto Scaling selects instance types with your attributes, we will + * exclude instance types whose price exceeds your specified threshold. The parameter accepts an integer, which + * Amazon EC2 Auto Scaling interprets as a percentage. To turn off price protection, specify a high value, such as + * ``999999``. If you set ``DesiredCapacityType`` to ``vcpu`` or ``memory-mib``, the price protection threshold is + * based on the per-vCPU or per-memory price instead of the per instance price. Only one of + * ``SpotMaxPricePercentageOverLowestPrice`` or ``MaxSpotPriceAsPercentageOfOptimalOnDemandPrice`` can be specified. + * Default: ``100``. + * + * @return the spotMaxPricePercentageOverLowestPrice value. + */ + public Integer spotMaxPricePercentageOverLowestPrice() { + return this.spotMaxPricePercentageOverLowestPrice; + } + + /** + * Set the spotMaxPricePercentageOverLowestPrice property: [Price protection] The price protection threshold for + * Spot Instances, as a percentage higher than an identified Spot price. The identified Spot price is the price of + * the lowest priced current generation C, M, or R instance type with your specified attributes. If no current + * generation C, M, or R instance type matches your attributes, then the identified price is from either the lowest + * priced current generation instance types or, failing that, the lowest priced previous generation instance types + * that match your attributes. When Amazon EC2 Auto Scaling selects instance types with your attributes, we will + * exclude instance types whose price exceeds your specified threshold. The parameter accepts an integer, which + * Amazon EC2 Auto Scaling interprets as a percentage. To turn off price protection, specify a high value, such as + * ``999999``. If you set ``DesiredCapacityType`` to ``vcpu`` or ``memory-mib``, the price protection threshold is + * based on the per-vCPU or per-memory price instead of the per instance price. Only one of + * ``SpotMaxPricePercentageOverLowestPrice`` or ``MaxSpotPriceAsPercentageOfOptimalOnDemandPrice`` can be specified. + * Default: ``100``. + * + * @param spotMaxPricePercentageOverLowestPrice the spotMaxPricePercentageOverLowestPrice value to set. + * @return the InstanceRequirements object itself. + */ + public InstanceRequirements + withSpotMaxPricePercentageOverLowestPrice(Integer spotMaxPricePercentageOverLowestPrice) { + this.spotMaxPricePercentageOverLowestPrice = spotMaxPricePercentageOverLowestPrice; + return this; + } + + /** + * Get the totalLocalStorageGB property: The minimum and maximum total local storage size for an instance type, in + * GB. Default: No minimum or maximum limits ``TotalLocalStorageGBRequest`` is a property of the + * ``InstanceRequirements`` property of the [AWS::AutoScaling::AutoScalingGroup + * LaunchTemplateOverrides](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-autoscaling-autoscalinggroup-launchtemplateoverrides.html) + * property type that describes the minimum and maximum total local storage size for an instance type, in GB. + * + * @return the totalLocalStorageGB value. + */ + public TotalLocalStorageGBRequest totalLocalStorageGB() { + return this.totalLocalStorageGB; + } + + /** + * Set the totalLocalStorageGB property: The minimum and maximum total local storage size for an instance type, in + * GB. Default: No minimum or maximum limits ``TotalLocalStorageGBRequest`` is a property of the + * ``InstanceRequirements`` property of the [AWS::AutoScaling::AutoScalingGroup + * LaunchTemplateOverrides](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-autoscaling-autoscalinggroup-launchtemplateoverrides.html) + * property type that describes the minimum and maximum total local storage size for an instance type, in GB. + * + * @param totalLocalStorageGB the totalLocalStorageGB value to set. + * @return the InstanceRequirements object itself. + */ + public InstanceRequirements withTotalLocalStorageGB(TotalLocalStorageGBRequest totalLocalStorageGB) { + this.totalLocalStorageGB = totalLocalStorageGB; + return this; + } + + /** + * Get the vCpuCount property: The minimum and maximum number of vCPUs for an instance type. ``VCpuCountRequest`` is + * a property of the ``InstanceRequirements`` property of the [AWS::AutoScaling::AutoScalingGroup + * LaunchTemplateOverrides](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-autoscaling-autoscalinggroup-launchtemplateoverrides.html) + * property type that describes the minimum and maximum number of vCPUs for an instance type. + * + * @return the vCpuCount value. + */ + public VCpuCountRequest vCpuCount() { + return this.vCpuCount; + } + + /** + * Set the vCpuCount property: The minimum and maximum number of vCPUs for an instance type. ``VCpuCountRequest`` is + * a property of the ``InstanceRequirements`` property of the [AWS::AutoScaling::AutoScalingGroup + * LaunchTemplateOverrides](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-autoscaling-autoscalinggroup-launchtemplateoverrides.html) + * property type that describes the minimum and maximum number of vCPUs for an instance type. + * + * @param vCpuCount the vCpuCount value to set. + * @return the InstanceRequirements object itself. + */ + public InstanceRequirements withVCpuCount(VCpuCountRequest vCpuCount) { + this.vCpuCount = vCpuCount; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (acceleratorCount() != null) { + acceleratorCount().validate(); + } + if (acceleratorTotalMemoryMiB() != null) { + acceleratorTotalMemoryMiB().validate(); + } + if (baselineEbsBandwidthMbps() != null) { + baselineEbsBandwidthMbps().validate(); + } + if (memoryGiBPerVCpu() != null) { + memoryGiBPerVCpu().validate(); + } + if (memoryMiB() != null) { + memoryMiB().validate(); + } + if (networkBandwidthGbps() != null) { + networkBandwidthGbps().validate(); + } + if (networkInterfaceCount() != null) { + networkInterfaceCount().validate(); + } + if (totalLocalStorageGB() != null) { + totalLocalStorageGB().validate(); + } + if (vCpuCount() != null) { + vCpuCount().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("acceleratorCount", this.acceleratorCount); + jsonWriter.writeArrayField("acceleratorManufacturers", this.acceleratorManufacturers, + (writer, element) -> writer.writeString(element)); + jsonWriter.writeArrayField("acceleratorNames", this.acceleratorNames, + (writer, element) -> writer.writeString(element)); + jsonWriter.writeJsonField("acceleratorTotalMemoryMiB", this.acceleratorTotalMemoryMiB); + jsonWriter.writeArrayField("acceleratorTypes", this.acceleratorTypes, + (writer, element) -> writer.writeString(element)); + jsonWriter.writeArrayField("allowedInstanceTypes", this.allowedInstanceTypes, + (writer, element) -> writer.writeString(element)); + jsonWriter.writeStringField("bareMetal", this.bareMetal); + jsonWriter.writeJsonField("baselineEbsBandwidthMbps", this.baselineEbsBandwidthMbps); + jsonWriter.writeStringField("burstablePerformance", this.burstablePerformance); + jsonWriter.writeArrayField("cpuManufacturers", this.cpuManufacturers, + (writer, element) -> writer.writeString(element)); + jsonWriter.writeArrayField("excludedInstanceTypes", this.excludedInstanceTypes, + (writer, element) -> writer.writeString(element)); + jsonWriter.writeArrayField("instanceGenerations", this.instanceGenerations, + (writer, element) -> writer.writeString(element)); + jsonWriter.writeStringField("localStorage", this.localStorage); + jsonWriter.writeArrayField("localStorageTypes", this.localStorageTypes, + (writer, element) -> writer.writeString(element)); + jsonWriter.writeNumberField("maxSpotPriceAsPercentageOfOptimalOnDemandPrice", + this.maxSpotPriceAsPercentageOfOptimalOnDemandPrice); + jsonWriter.writeJsonField("memoryGiBPerVCpu", this.memoryGiBPerVCpu); + jsonWriter.writeJsonField("memoryMiB", this.memoryMiB); + jsonWriter.writeJsonField("networkBandwidthGbps", this.networkBandwidthGbps); + jsonWriter.writeJsonField("networkInterfaceCount", this.networkInterfaceCount); + jsonWriter.writeNumberField("onDemandMaxPricePercentageOverLowestPrice", + this.onDemandMaxPricePercentageOverLowestPrice); + jsonWriter.writeBooleanField("requireHibernateSupport", this.requireHibernateSupport); + jsonWriter.writeNumberField("spotMaxPricePercentageOverLowestPrice", + this.spotMaxPricePercentageOverLowestPrice); + jsonWriter.writeJsonField("totalLocalStorageGB", this.totalLocalStorageGB); + jsonWriter.writeJsonField("vCpuCount", this.vCpuCount); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of InstanceRequirements from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of InstanceRequirements if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the InstanceRequirements. + */ + public static InstanceRequirements fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + InstanceRequirements deserializedInstanceRequirements = new InstanceRequirements(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("acceleratorCount".equals(fieldName)) { + deserializedInstanceRequirements.acceleratorCount = AcceleratorCountRequest.fromJson(reader); + } else if ("acceleratorManufacturers".equals(fieldName)) { + List acceleratorManufacturers = reader.readArray(reader1 -> reader1.getString()); + deserializedInstanceRequirements.acceleratorManufacturers = acceleratorManufacturers; + } else if ("acceleratorNames".equals(fieldName)) { + List acceleratorNames = reader.readArray(reader1 -> reader1.getString()); + deserializedInstanceRequirements.acceleratorNames = acceleratorNames; + } else if ("acceleratorTotalMemoryMiB".equals(fieldName)) { + deserializedInstanceRequirements.acceleratorTotalMemoryMiB + = AcceleratorTotalMemoryMiBRequest.fromJson(reader); + } else if ("acceleratorTypes".equals(fieldName)) { + List acceleratorTypes = reader.readArray(reader1 -> reader1.getString()); + deserializedInstanceRequirements.acceleratorTypes = acceleratorTypes; + } else if ("allowedInstanceTypes".equals(fieldName)) { + List allowedInstanceTypes = reader.readArray(reader1 -> reader1.getString()); + deserializedInstanceRequirements.allowedInstanceTypes = allowedInstanceTypes; + } else if ("bareMetal".equals(fieldName)) { + deserializedInstanceRequirements.bareMetal = reader.getString(); + } else if ("baselineEbsBandwidthMbps".equals(fieldName)) { + deserializedInstanceRequirements.baselineEbsBandwidthMbps + = BaselineEbsBandwidthMbpsRequest.fromJson(reader); + } else if ("burstablePerformance".equals(fieldName)) { + deserializedInstanceRequirements.burstablePerformance = reader.getString(); + } else if ("cpuManufacturers".equals(fieldName)) { + List cpuManufacturers = reader.readArray(reader1 -> reader1.getString()); + deserializedInstanceRequirements.cpuManufacturers = cpuManufacturers; + } else if ("excludedInstanceTypes".equals(fieldName)) { + List excludedInstanceTypes = reader.readArray(reader1 -> reader1.getString()); + deserializedInstanceRequirements.excludedInstanceTypes = excludedInstanceTypes; + } else if ("instanceGenerations".equals(fieldName)) { + List instanceGenerations = reader.readArray(reader1 -> reader1.getString()); + deserializedInstanceRequirements.instanceGenerations = instanceGenerations; + } else if ("localStorage".equals(fieldName)) { + deserializedInstanceRequirements.localStorage = reader.getString(); + } else if ("localStorageTypes".equals(fieldName)) { + List localStorageTypes = reader.readArray(reader1 -> reader1.getString()); + deserializedInstanceRequirements.localStorageTypes = localStorageTypes; + } else if ("maxSpotPriceAsPercentageOfOptimalOnDemandPrice".equals(fieldName)) { + deserializedInstanceRequirements.maxSpotPriceAsPercentageOfOptimalOnDemandPrice + = reader.getNullable(JsonReader::getInt); + } else if ("memoryGiBPerVCpu".equals(fieldName)) { + deserializedInstanceRequirements.memoryGiBPerVCpu = MemoryGiBPerVCpuRequest.fromJson(reader); + } else if ("memoryMiB".equals(fieldName)) { + deserializedInstanceRequirements.memoryMiB = MemoryMiBRequest.fromJson(reader); + } else if ("networkBandwidthGbps".equals(fieldName)) { + deserializedInstanceRequirements.networkBandwidthGbps + = NetworkBandwidthGbpsRequest.fromJson(reader); + } else if ("networkInterfaceCount".equals(fieldName)) { + deserializedInstanceRequirements.networkInterfaceCount + = NetworkInterfaceCountRequest.fromJson(reader); + } else if ("onDemandMaxPricePercentageOverLowestPrice".equals(fieldName)) { + deserializedInstanceRequirements.onDemandMaxPricePercentageOverLowestPrice + = reader.getNullable(JsonReader::getInt); + } else if ("requireHibernateSupport".equals(fieldName)) { + deserializedInstanceRequirements.requireHibernateSupport + = reader.getNullable(JsonReader::getBoolean); + } else if ("spotMaxPricePercentageOverLowestPrice".equals(fieldName)) { + deserializedInstanceRequirements.spotMaxPricePercentageOverLowestPrice + = reader.getNullable(JsonReader::getInt); + } else if ("totalLocalStorageGB".equals(fieldName)) { + deserializedInstanceRequirements.totalLocalStorageGB = TotalLocalStorageGBRequest.fromJson(reader); + } else if ("vCpuCount".equals(fieldName)) { + deserializedInstanceRequirements.vCpuCount = VCpuCountRequest.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedInstanceRequirements; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/InstanceRoleType.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/InstanceRoleType.java new file mode 100644 index 000000000000..9c613b885214 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/InstanceRoleType.java @@ -0,0 +1,56 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * InstanceRoleType enum. + */ +public final class InstanceRoleType extends ExpandableStringEnum { + /** + * Static value CORE for InstanceRoleType. + */ + public static final InstanceRoleType CORE = fromString("CORE"); + + /** + * Static value MASTER for InstanceRoleType. + */ + public static final InstanceRoleType MASTER = fromString("MASTER"); + + /** + * Static value TASK for InstanceRoleType. + */ + public static final InstanceRoleType TASK = fromString("TASK"); + + /** + * Creates a new instance of InstanceRoleType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public InstanceRoleType() { + } + + /** + * Creates or finds a InstanceRoleType from its string representation. + * + * @param name a name to look for. + * @return the corresponding InstanceRoleType. + */ + public static InstanceRoleType fromString(String name) { + return fromString(name, InstanceRoleType.class); + } + + /** + * Gets known InstanceRoleType values. + * + * @return known InstanceRoleType values. + */ + public static Collection values() { + return values(InstanceRoleType.class); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/InstanceRoleTypeEnumValue.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/InstanceRoleTypeEnumValue.java new file mode 100644 index 000000000000..edc1df7b5446 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/InstanceRoleTypeEnumValue.java @@ -0,0 +1,93 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of InstanceRoleTypeEnumValue. + */ +@Fluent +public final class InstanceRoleTypeEnumValue implements JsonSerializable { + /* + * Property value + */ + private InstanceRoleType value; + + /** + * Creates an instance of InstanceRoleTypeEnumValue class. + */ + public InstanceRoleTypeEnumValue() { + } + + /** + * Get the value property: Property value. + * + * @return the value value. + */ + public InstanceRoleType value() { + return this.value; + } + + /** + * Set the value property: Property value. + * + * @param value the value value to set. + * @return the InstanceRoleTypeEnumValue object itself. + */ + public InstanceRoleTypeEnumValue withValue(InstanceRoleType value) { + this.value = value; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("value", this.value == null ? null : this.value.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of InstanceRoleTypeEnumValue from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of InstanceRoleTypeEnumValue if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IOException If an error occurs while reading the InstanceRoleTypeEnumValue. + */ + public static InstanceRoleTypeEnumValue fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + InstanceRoleTypeEnumValue deserializedInstanceRoleTypeEnumValue = new InstanceRoleTypeEnumValue(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + deserializedInstanceRoleTypeEnumValue.value = InstanceRoleType.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedInstanceRoleTypeEnumValue; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/InstanceState.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/InstanceState.java new file mode 100644 index 000000000000..57782c504fdc --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/InstanceState.java @@ -0,0 +1,156 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of InstanceState. + */ +@Fluent +public final class InstanceState implements JsonSerializable { + /* + *

The state of the instance as a 16-bit unsigned integer.

The high byte is all of the bits between 2^8 + * and (2^16)-1, which equals decimal values between 256 and 65,535. These numerical values are used for internal + * purposes and should be ignored.

The low byte is all of the bits between 2^0 and (2^8)-1, which equals + * decimal values between 0 and 255.

The valid values for instance-state-code will all be in the range of + * the low byte and they are:

  • 0 : pending

  • + * 16 : running

  • 32 : shutting-down

    + *
  • 48 : terminated

  • 64 : + * stopping

  • 80 : stopped

You can + * ignore the high byte value by zeroing out all of the bits above 2^8 or 256 in decimal.

+ */ + private Integer code; + + /* + *

The current state of the instance.

+ */ + private InstanceStateNameEnumValue name; + + /** + * Creates an instance of InstanceState class. + */ + public InstanceState() { + } + + /** + * Get the code property: <p>The state of the instance as a 16-bit unsigned integer. </p> <p>The + * high byte is all of the bits between 2^8 and (2^16)-1, which equals decimal values between 256 and 65,535. These + * numerical values are used for internal purposes and should be ignored.</p> <p>The low byte is all of + * the bits between 2^0 and (2^8)-1, which equals decimal values between 0 and 255. </p> <p>The valid + * values for instance-state-code will all be in the range of the low byte and they are:</p> <ul> + * <li> <p> <code>0</code> : <code>pending</code> </p> </li> + * <li> <p> <code>16</code> : <code>running</code> </p> </li> + * <li> <p> <code>32</code> : <code>shutting-down</code> </p> </li> + * <li> <p> <code>48</code> : <code>terminated</code> </p> </li> + * <li> <p> <code>64</code> : <code>stopping</code> </p> </li> + * <li> <p> <code>80</code> : <code>stopped</code> </p> </li> + * </ul> <p>You can ignore the high byte value by zeroing out all of the bits above 2^8 or 256 in + * decimal.</p>. + * + * @return the code value. + */ + public Integer code() { + return this.code; + } + + /** + * Set the code property: <p>The state of the instance as a 16-bit unsigned integer. </p> <p>The + * high byte is all of the bits between 2^8 and (2^16)-1, which equals decimal values between 256 and 65,535. These + * numerical values are used for internal purposes and should be ignored.</p> <p>The low byte is all of + * the bits between 2^0 and (2^8)-1, which equals decimal values between 0 and 255. </p> <p>The valid + * values for instance-state-code will all be in the range of the low byte and they are:</p> <ul> + * <li> <p> <code>0</code> : <code>pending</code> </p> </li> + * <li> <p> <code>16</code> : <code>running</code> </p> </li> + * <li> <p> <code>32</code> : <code>shutting-down</code> </p> </li> + * <li> <p> <code>48</code> : <code>terminated</code> </p> </li> + * <li> <p> <code>64</code> : <code>stopping</code> </p> </li> + * <li> <p> <code>80</code> : <code>stopped</code> </p> </li> + * </ul> <p>You can ignore the high byte value by zeroing out all of the bits above 2^8 or 256 in + * decimal.</p>. + * + * @param code the code value to set. + * @return the InstanceState object itself. + */ + public InstanceState withCode(Integer code) { + this.code = code; + return this; + } + + /** + * Get the name property: <p>The current state of the instance.</p>. + * + * @return the name value. + */ + public InstanceStateNameEnumValue name() { + return this.name; + } + + /** + * Set the name property: <p>The current state of the instance.</p>. + * + * @param name the name value to set. + * @return the InstanceState object itself. + */ + public InstanceState withName(InstanceStateNameEnumValue name) { + this.name = name; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (name() != null) { + name().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeNumberField("code", this.code); + jsonWriter.writeJsonField("name", this.name); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of InstanceState from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of InstanceState if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the InstanceState. + */ + public static InstanceState fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + InstanceState deserializedInstanceState = new InstanceState(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("code".equals(fieldName)) { + deserializedInstanceState.code = reader.getNullable(JsonReader::getInt); + } else if ("name".equals(fieldName)) { + deserializedInstanceState.name = InstanceStateNameEnumValue.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedInstanceState; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/InstanceStateName.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/InstanceStateName.java new file mode 100644 index 000000000000..2aac635fd614 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/InstanceStateName.java @@ -0,0 +1,71 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * InstanceStateName enum. + */ +public final class InstanceStateName extends ExpandableStringEnum { + /** + * Static value pending for InstanceStateName. + */ + public static final InstanceStateName PENDING = fromString("pending"); + + /** + * Static value running for InstanceStateName. + */ + public static final InstanceStateName RUNNING = fromString("running"); + + /** + * Static value shutting-down for InstanceStateName. + */ + public static final InstanceStateName SHUTTING_DOWN = fromString("shutting-down"); + + /** + * Static value stopped for InstanceStateName. + */ + public static final InstanceStateName STOPPED = fromString("stopped"); + + /** + * Static value stopping for InstanceStateName. + */ + public static final InstanceStateName STOPPING = fromString("stopping"); + + /** + * Static value terminated for InstanceStateName. + */ + public static final InstanceStateName TERMINATED = fromString("terminated"); + + /** + * Creates a new instance of InstanceStateName value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public InstanceStateName() { + } + + /** + * Creates or finds a InstanceStateName from its string representation. + * + * @param name a name to look for. + * @return the corresponding InstanceStateName. + */ + public static InstanceStateName fromString(String name) { + return fromString(name, InstanceStateName.class); + } + + /** + * Gets known InstanceStateName values. + * + * @return known InstanceStateName values. + */ + public static Collection values() { + return values(InstanceStateName.class); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/InstanceStateNameEnumValue.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/InstanceStateNameEnumValue.java new file mode 100644 index 000000000000..a82e221052d1 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/InstanceStateNameEnumValue.java @@ -0,0 +1,93 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of InstanceStateNameEnumValue. + */ +@Fluent +public final class InstanceStateNameEnumValue implements JsonSerializable { + /* + * Property value + */ + private InstanceStateName value; + + /** + * Creates an instance of InstanceStateNameEnumValue class. + */ + public InstanceStateNameEnumValue() { + } + + /** + * Get the value property: Property value. + * + * @return the value value. + */ + public InstanceStateName value() { + return this.value; + } + + /** + * Set the value property: Property value. + * + * @param value the value value to set. + * @return the InstanceStateNameEnumValue object itself. + */ + public InstanceStateNameEnumValue withValue(InstanceStateName value) { + this.value = value; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("value", this.value == null ? null : this.value.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of InstanceStateNameEnumValue from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of InstanceStateNameEnumValue if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IOException If an error occurs while reading the InstanceStateNameEnumValue. + */ + public static InstanceStateNameEnumValue fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + InstanceStateNameEnumValue deserializedInstanceStateNameEnumValue = new InstanceStateNameEnumValue(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + deserializedInstanceStateNameEnumValue.value = InstanceStateName.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedInstanceStateNameEnumValue; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/InstanceStatusDetails.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/InstanceStatusDetails.java new file mode 100644 index 000000000000..c6e84f3b5635 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/InstanceStatusDetails.java @@ -0,0 +1,163 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.time.OffsetDateTime; +import java.time.format.DateTimeFormatter; + +/** + * Definition of InstanceStatusDetails. + */ +@Fluent +public final class InstanceStatusDetails implements JsonSerializable { + /* + *

The time when a status check failed. For an instance that was launched and impaired, this is the time when the + * instance was launched.

+ */ + private OffsetDateTime impairedSince; + + /* + *

The type of instance status.

+ */ + private StatusNameEnumValue name; + + /* + *

The status.

+ */ + private StatusTypeEnumValue status; + + /** + * Creates an instance of InstanceStatusDetails class. + */ + public InstanceStatusDetails() { + } + + /** + * Get the impairedSince property: <p>The time when a status check failed. For an instance that was launched + * and impaired, this is the time when the instance was launched.</p>. + * + * @return the impairedSince value. + */ + public OffsetDateTime impairedSince() { + return this.impairedSince; + } + + /** + * Set the impairedSince property: <p>The time when a status check failed. For an instance that was launched + * and impaired, this is the time when the instance was launched.</p>. + * + * @param impairedSince the impairedSince value to set. + * @return the InstanceStatusDetails object itself. + */ + public InstanceStatusDetails withImpairedSince(OffsetDateTime impairedSince) { + this.impairedSince = impairedSince; + return this; + } + + /** + * Get the name property: <p>The type of instance status.</p>. + * + * @return the name value. + */ + public StatusNameEnumValue name() { + return this.name; + } + + /** + * Set the name property: <p>The type of instance status.</p>. + * + * @param name the name value to set. + * @return the InstanceStatusDetails object itself. + */ + public InstanceStatusDetails withName(StatusNameEnumValue name) { + this.name = name; + return this; + } + + /** + * Get the status property: <p>The status.</p>. + * + * @return the status value. + */ + public StatusTypeEnumValue status() { + return this.status; + } + + /** + * Set the status property: <p>The status.</p>. + * + * @param status the status value to set. + * @return the InstanceStatusDetails object itself. + */ + public InstanceStatusDetails withStatus(StatusTypeEnumValue status) { + this.status = status; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (name() != null) { + name().validate(); + } + if (status() != null) { + status().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("impairedSince", + this.impairedSince == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.impairedSince)); + jsonWriter.writeJsonField("name", this.name); + jsonWriter.writeJsonField("status", this.status); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of InstanceStatusDetails from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of InstanceStatusDetails if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the InstanceStatusDetails. + */ + public static InstanceStatusDetails fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + InstanceStatusDetails deserializedInstanceStatusDetails = new InstanceStatusDetails(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("impairedSince".equals(fieldName)) { + deserializedInstanceStatusDetails.impairedSince = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("name".equals(fieldName)) { + deserializedInstanceStatusDetails.name = StatusNameEnumValue.fromJson(reader); + } else if ("status".equals(fieldName)) { + deserializedInstanceStatusDetails.status = StatusTypeEnumValue.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedInstanceStatusDetails; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/InstanceStatusEvent.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/InstanceStatusEvent.java new file mode 100644 index 000000000000..da62edc4dec6 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/InstanceStatusEvent.java @@ -0,0 +1,252 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.time.OffsetDateTime; +import java.time.format.DateTimeFormatter; + +/** + * Definition of InstanceStatusEvent. + */ +@Fluent +public final class InstanceStatusEvent implements JsonSerializable { + /* + *

The event code.

+ */ + private EventCodeEnumValue code; + + /* + *

A description of the event.

After a scheduled event is completed, it can still be described for up to a + * week. If the event has been completed, this description starts with the following text: [Completed].

+ */ + private String description; + + /* + *

The ID of the event.

+ */ + private String instanceEventId; + + /* + *

The latest scheduled end time for the event.

+ */ + private OffsetDateTime notAfter; + + /* + *

The earliest scheduled start time for the event.

+ */ + private OffsetDateTime notBefore; + + /* + *

The deadline for starting the event.

+ */ + private OffsetDateTime notBeforeDeadline; + + /** + * Creates an instance of InstanceStatusEvent class. + */ + public InstanceStatusEvent() { + } + + /** + * Get the code property: <p>The event code.</p>. + * + * @return the code value. + */ + public EventCodeEnumValue code() { + return this.code; + } + + /** + * Set the code property: <p>The event code.</p>. + * + * @param code the code value to set. + * @return the InstanceStatusEvent object itself. + */ + public InstanceStatusEvent withCode(EventCodeEnumValue code) { + this.code = code; + return this; + } + + /** + * Get the description property: <p>A description of the event.</p> <p>After a scheduled event is + * completed, it can still be described for up to a week. If the event has been completed, this description starts + * with the following text: [Completed].</p>. + * + * @return the description value. + */ + public String description() { + return this.description; + } + + /** + * Set the description property: <p>A description of the event.</p> <p>After a scheduled event is + * completed, it can still be described for up to a week. If the event has been completed, this description starts + * with the following text: [Completed].</p>. + * + * @param description the description value to set. + * @return the InstanceStatusEvent object itself. + */ + public InstanceStatusEvent withDescription(String description) { + this.description = description; + return this; + } + + /** + * Get the instanceEventId property: <p>The ID of the event.</p>. + * + * @return the instanceEventId value. + */ + public String instanceEventId() { + return this.instanceEventId; + } + + /** + * Set the instanceEventId property: <p>The ID of the event.</p>. + * + * @param instanceEventId the instanceEventId value to set. + * @return the InstanceStatusEvent object itself. + */ + public InstanceStatusEvent withInstanceEventId(String instanceEventId) { + this.instanceEventId = instanceEventId; + return this; + } + + /** + * Get the notAfter property: <p>The latest scheduled end time for the event.</p>. + * + * @return the notAfter value. + */ + public OffsetDateTime notAfter() { + return this.notAfter; + } + + /** + * Set the notAfter property: <p>The latest scheduled end time for the event.</p>. + * + * @param notAfter the notAfter value to set. + * @return the InstanceStatusEvent object itself. + */ + public InstanceStatusEvent withNotAfter(OffsetDateTime notAfter) { + this.notAfter = notAfter; + return this; + } + + /** + * Get the notBefore property: <p>The earliest scheduled start time for the event.</p>. + * + * @return the notBefore value. + */ + public OffsetDateTime notBefore() { + return this.notBefore; + } + + /** + * Set the notBefore property: <p>The earliest scheduled start time for the event.</p>. + * + * @param notBefore the notBefore value to set. + * @return the InstanceStatusEvent object itself. + */ + public InstanceStatusEvent withNotBefore(OffsetDateTime notBefore) { + this.notBefore = notBefore; + return this; + } + + /** + * Get the notBeforeDeadline property: <p>The deadline for starting the event.</p>. + * + * @return the notBeforeDeadline value. + */ + public OffsetDateTime notBeforeDeadline() { + return this.notBeforeDeadline; + } + + /** + * Set the notBeforeDeadline property: <p>The deadline for starting the event.</p>. + * + * @param notBeforeDeadline the notBeforeDeadline value to set. + * @return the InstanceStatusEvent object itself. + */ + public InstanceStatusEvent withNotBeforeDeadline(OffsetDateTime notBeforeDeadline) { + this.notBeforeDeadline = notBeforeDeadline; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (code() != null) { + code().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("code", this.code); + jsonWriter.writeStringField("description", this.description); + jsonWriter.writeStringField("instanceEventId", this.instanceEventId); + jsonWriter.writeStringField("notAfter", + this.notAfter == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.notAfter)); + jsonWriter.writeStringField("notBefore", + this.notBefore == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.notBefore)); + jsonWriter.writeStringField("notBeforeDeadline", + this.notBeforeDeadline == null + ? null + : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.notBeforeDeadline)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of InstanceStatusEvent from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of InstanceStatusEvent if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the InstanceStatusEvent. + */ + public static InstanceStatusEvent fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + InstanceStatusEvent deserializedInstanceStatusEvent = new InstanceStatusEvent(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("code".equals(fieldName)) { + deserializedInstanceStatusEvent.code = EventCodeEnumValue.fromJson(reader); + } else if ("description".equals(fieldName)) { + deserializedInstanceStatusEvent.description = reader.getString(); + } else if ("instanceEventId".equals(fieldName)) { + deserializedInstanceStatusEvent.instanceEventId = reader.getString(); + } else if ("notAfter".equals(fieldName)) { + deserializedInstanceStatusEvent.notAfter = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("notBefore".equals(fieldName)) { + deserializedInstanceStatusEvent.notBefore = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("notBeforeDeadline".equals(fieldName)) { + deserializedInstanceStatusEvent.notBeforeDeadline = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else { + reader.skipChildren(); + } + } + + return deserializedInstanceStatusEvent; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/InstanceStatusSummary.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/InstanceStatusSummary.java new file mode 100644 index 000000000000..605113f73af1 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/InstanceStatusSummary.java @@ -0,0 +1,130 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Definition of InstanceStatusSummary. + */ +@Fluent +public final class InstanceStatusSummary implements JsonSerializable { + /* + *

The system instance health or application instance health.

+ */ + private List details; + + /* + *

The status.

+ */ + private SummaryStatusEnumValue status; + + /** + * Creates an instance of InstanceStatusSummary class. + */ + public InstanceStatusSummary() { + } + + /** + * Get the details property: <p>The system instance health or application instance health.</p>. + * + * @return the details value. + */ + public List details() { + return this.details; + } + + /** + * Set the details property: <p>The system instance health or application instance health.</p>. + * + * @param details the details value to set. + * @return the InstanceStatusSummary object itself. + */ + public InstanceStatusSummary withDetails(List details) { + this.details = details; + return this; + } + + /** + * Get the status property: <p>The status.</p>. + * + * @return the status value. + */ + public SummaryStatusEnumValue status() { + return this.status; + } + + /** + * Set the status property: <p>The status.</p>. + * + * @param status the status value to set. + * @return the InstanceStatusSummary object itself. + */ + public InstanceStatusSummary withStatus(SummaryStatusEnumValue status) { + this.status = status; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (details() != null) { + details().forEach(e -> e.validate()); + } + if (status() != null) { + status().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("details", this.details, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeJsonField("status", this.status); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of InstanceStatusSummary from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of InstanceStatusSummary if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the InstanceStatusSummary. + */ + public static InstanceStatusSummary fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + InstanceStatusSummary deserializedInstanceStatusSummary = new InstanceStatusSummary(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("details".equals(fieldName)) { + List details + = reader.readArray(reader1 -> InstanceStatusDetails.fromJson(reader1)); + deserializedInstanceStatusSummary.details = details; + } else if ("status".equals(fieldName)) { + deserializedInstanceStatusSummary.status = SummaryStatusEnumValue.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedInstanceStatusSummary; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/InstanceType.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/InstanceType.java new file mode 100644 index 000000000000..bf6b1569b820 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/InstanceType.java @@ -0,0 +1,4021 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * InstanceType enum. + */ +public final class InstanceType extends ExpandableStringEnum { + /** + * Static value a1.2xlarge for InstanceType. + */ + public static final InstanceType A1_2XLARGE = fromString("a1.2xlarge"); + + /** + * Static value a1.4xlarge for InstanceType. + */ + public static final InstanceType A1_4XLARGE = fromString("a1.4xlarge"); + + /** + * Static value a1.large for InstanceType. + */ + public static final InstanceType A1_LARGE = fromString("a1.large"); + + /** + * Static value a1.medium for InstanceType. + */ + public static final InstanceType A1_MEDIUM = fromString("a1.medium"); + + /** + * Static value a1.metal for InstanceType. + */ + public static final InstanceType A1_METAL = fromString("a1.metal"); + + /** + * Static value a1.xlarge for InstanceType. + */ + public static final InstanceType A1_XLARGE = fromString("a1.xlarge"); + + /** + * Static value c1.medium for InstanceType. + */ + public static final InstanceType C1_MEDIUM = fromString("c1.medium"); + + /** + * Static value c1.xlarge for InstanceType. + */ + public static final InstanceType C1_XLARGE = fromString("c1.xlarge"); + + /** + * Static value c3.2xlarge for InstanceType. + */ + public static final InstanceType C3_2XLARGE = fromString("c3.2xlarge"); + + /** + * Static value c3.4xlarge for InstanceType. + */ + public static final InstanceType C3_4XLARGE = fromString("c3.4xlarge"); + + /** + * Static value c3.8xlarge for InstanceType. + */ + public static final InstanceType C3_8XLARGE = fromString("c3.8xlarge"); + + /** + * Static value c3.large for InstanceType. + */ + public static final InstanceType C3_LARGE = fromString("c3.large"); + + /** + * Static value c3.xlarge for InstanceType. + */ + public static final InstanceType C3_XLARGE = fromString("c3.xlarge"); + + /** + * Static value c4.2xlarge for InstanceType. + */ + public static final InstanceType C4_2XLARGE = fromString("c4.2xlarge"); + + /** + * Static value c4.4xlarge for InstanceType. + */ + public static final InstanceType C4_4XLARGE = fromString("c4.4xlarge"); + + /** + * Static value c4.8xlarge for InstanceType. + */ + public static final InstanceType C4_8XLARGE = fromString("c4.8xlarge"); + + /** + * Static value c4.large for InstanceType. + */ + public static final InstanceType C4_LARGE = fromString("c4.large"); + + /** + * Static value c4.xlarge for InstanceType. + */ + public static final InstanceType C4_XLARGE = fromString("c4.xlarge"); + + /** + * Static value c5.12xlarge for InstanceType. + */ + public static final InstanceType C5_12XLARGE = fromString("c5.12xlarge"); + + /** + * Static value c5.18xlarge for InstanceType. + */ + public static final InstanceType C5_18XLARGE = fromString("c5.18xlarge"); + + /** + * Static value c5.24xlarge for InstanceType. + */ + public static final InstanceType C5_24XLARGE = fromString("c5.24xlarge"); + + /** + * Static value c5.2xlarge for InstanceType. + */ + public static final InstanceType C5_2XLARGE = fromString("c5.2xlarge"); + + /** + * Static value c5.4xlarge for InstanceType. + */ + public static final InstanceType C5_4XLARGE = fromString("c5.4xlarge"); + + /** + * Static value c5.9xlarge for InstanceType. + */ + public static final InstanceType C5_9XLARGE = fromString("c5.9xlarge"); + + /** + * Static value c5.large for InstanceType. + */ + public static final InstanceType C5_LARGE = fromString("c5.large"); + + /** + * Static value c5.metal for InstanceType. + */ + public static final InstanceType C5_METAL = fromString("c5.metal"); + + /** + * Static value c5.xlarge for InstanceType. + */ + public static final InstanceType C5_XLARGE = fromString("c5.xlarge"); + + /** + * Static value c5a.12xlarge for InstanceType. + */ + public static final InstanceType C5A_12XLARGE = fromString("c5a.12xlarge"); + + /** + * Static value c5a.16xlarge for InstanceType. + */ + public static final InstanceType C5A_16XLARGE = fromString("c5a.16xlarge"); + + /** + * Static value c5a.24xlarge for InstanceType. + */ + public static final InstanceType C5A_24XLARGE = fromString("c5a.24xlarge"); + + /** + * Static value c5a.2xlarge for InstanceType. + */ + public static final InstanceType C5A_2XLARGE = fromString("c5a.2xlarge"); + + /** + * Static value c5a.4xlarge for InstanceType. + */ + public static final InstanceType C5A_4XLARGE = fromString("c5a.4xlarge"); + + /** + * Static value c5a.8xlarge for InstanceType. + */ + public static final InstanceType C5A_8XLARGE = fromString("c5a.8xlarge"); + + /** + * Static value c5a.large for InstanceType. + */ + public static final InstanceType C5A_LARGE = fromString("c5a.large"); + + /** + * Static value c5a.xlarge for InstanceType. + */ + public static final InstanceType C5A_XLARGE = fromString("c5a.xlarge"); + + /** + * Static value c5ad.12xlarge for InstanceType. + */ + public static final InstanceType C5AD_12XLARGE = fromString("c5ad.12xlarge"); + + /** + * Static value c5ad.16xlarge for InstanceType. + */ + public static final InstanceType C5AD_16XLARGE = fromString("c5ad.16xlarge"); + + /** + * Static value c5ad.24xlarge for InstanceType. + */ + public static final InstanceType C5AD_24XLARGE = fromString("c5ad.24xlarge"); + + /** + * Static value c5ad.2xlarge for InstanceType. + */ + public static final InstanceType C5AD_2XLARGE = fromString("c5ad.2xlarge"); + + /** + * Static value c5ad.4xlarge for InstanceType. + */ + public static final InstanceType C5AD_4XLARGE = fromString("c5ad.4xlarge"); + + /** + * Static value c5ad.8xlarge for InstanceType. + */ + public static final InstanceType C5AD_8XLARGE = fromString("c5ad.8xlarge"); + + /** + * Static value c5ad.large for InstanceType. + */ + public static final InstanceType C5AD_LARGE = fromString("c5ad.large"); + + /** + * Static value c5ad.xlarge for InstanceType. + */ + public static final InstanceType C5AD_XLARGE = fromString("c5ad.xlarge"); + + /** + * Static value c5d.12xlarge for InstanceType. + */ + public static final InstanceType C5D_12XLARGE = fromString("c5d.12xlarge"); + + /** + * Static value c5d.18xlarge for InstanceType. + */ + public static final InstanceType C5D_18XLARGE = fromString("c5d.18xlarge"); + + /** + * Static value c5d.24xlarge for InstanceType. + */ + public static final InstanceType C5D_24XLARGE = fromString("c5d.24xlarge"); + + /** + * Static value c5d.2xlarge for InstanceType. + */ + public static final InstanceType C5D_2XLARGE = fromString("c5d.2xlarge"); + + /** + * Static value c5d.4xlarge for InstanceType. + */ + public static final InstanceType C5D_4XLARGE = fromString("c5d.4xlarge"); + + /** + * Static value c5d.9xlarge for InstanceType. + */ + public static final InstanceType C5D_9XLARGE = fromString("c5d.9xlarge"); + + /** + * Static value c5d.large for InstanceType. + */ + public static final InstanceType C5D_LARGE = fromString("c5d.large"); + + /** + * Static value c5d.metal for InstanceType. + */ + public static final InstanceType C5D_METAL = fromString("c5d.metal"); + + /** + * Static value c5d.xlarge for InstanceType. + */ + public static final InstanceType C5D_XLARGE = fromString("c5d.xlarge"); + + /** + * Static value c5n.18xlarge for InstanceType. + */ + public static final InstanceType C5N_18XLARGE = fromString("c5n.18xlarge"); + + /** + * Static value c5n.2xlarge for InstanceType. + */ + public static final InstanceType C5N_2XLARGE = fromString("c5n.2xlarge"); + + /** + * Static value c5n.4xlarge for InstanceType. + */ + public static final InstanceType C5N_4XLARGE = fromString("c5n.4xlarge"); + + /** + * Static value c5n.9xlarge for InstanceType. + */ + public static final InstanceType C5N_9XLARGE = fromString("c5n.9xlarge"); + + /** + * Static value c5n.large for InstanceType. + */ + public static final InstanceType C5N_LARGE = fromString("c5n.large"); + + /** + * Static value c5n.metal for InstanceType. + */ + public static final InstanceType C5N_METAL = fromString("c5n.metal"); + + /** + * Static value c5n.xlarge for InstanceType. + */ + public static final InstanceType C5N_XLARGE = fromString("c5n.xlarge"); + + /** + * Static value c6a.12xlarge for InstanceType. + */ + public static final InstanceType C6A_12XLARGE = fromString("c6a.12xlarge"); + + /** + * Static value c6a.16xlarge for InstanceType. + */ + public static final InstanceType C6A_16XLARGE = fromString("c6a.16xlarge"); + + /** + * Static value c6a.24xlarge for InstanceType. + */ + public static final InstanceType C6A_24XLARGE = fromString("c6a.24xlarge"); + + /** + * Static value c6a.2xlarge for InstanceType. + */ + public static final InstanceType C6A_2XLARGE = fromString("c6a.2xlarge"); + + /** + * Static value c6a.32xlarge for InstanceType. + */ + public static final InstanceType C6A_32XLARGE = fromString("c6a.32xlarge"); + + /** + * Static value c6a.48xlarge for InstanceType. + */ + public static final InstanceType C6A_48XLARGE = fromString("c6a.48xlarge"); + + /** + * Static value c6a.4xlarge for InstanceType. + */ + public static final InstanceType C6A_4XLARGE = fromString("c6a.4xlarge"); + + /** + * Static value c6a.8xlarge for InstanceType. + */ + public static final InstanceType C6A_8XLARGE = fromString("c6a.8xlarge"); + + /** + * Static value c6a.large for InstanceType. + */ + public static final InstanceType C6A_LARGE = fromString("c6a.large"); + + /** + * Static value c6a.metal for InstanceType. + */ + public static final InstanceType C6A_METAL = fromString("c6a.metal"); + + /** + * Static value c6a.xlarge for InstanceType. + */ + public static final InstanceType C6A_XLARGE = fromString("c6a.xlarge"); + + /** + * Static value c6g.12xlarge for InstanceType. + */ + public static final InstanceType C6G_12XLARGE = fromString("c6g.12xlarge"); + + /** + * Static value c6g.16xlarge for InstanceType. + */ + public static final InstanceType C6G_16XLARGE = fromString("c6g.16xlarge"); + + /** + * Static value c6g.2xlarge for InstanceType. + */ + public static final InstanceType C6G_2XLARGE = fromString("c6g.2xlarge"); + + /** + * Static value c6g.4xlarge for InstanceType. + */ + public static final InstanceType C6G_4XLARGE = fromString("c6g.4xlarge"); + + /** + * Static value c6g.8xlarge for InstanceType. + */ + public static final InstanceType C6G_8XLARGE = fromString("c6g.8xlarge"); + + /** + * Static value c6g.large for InstanceType. + */ + public static final InstanceType C6G_LARGE = fromString("c6g.large"); + + /** + * Static value c6g.medium for InstanceType. + */ + public static final InstanceType C6G_MEDIUM = fromString("c6g.medium"); + + /** + * Static value c6g.metal for InstanceType. + */ + public static final InstanceType C6G_METAL = fromString("c6g.metal"); + + /** + * Static value c6g.xlarge for InstanceType. + */ + public static final InstanceType C6G_XLARGE = fromString("c6g.xlarge"); + + /** + * Static value c6gd.12xlarge for InstanceType. + */ + public static final InstanceType C6GD_12XLARGE = fromString("c6gd.12xlarge"); + + /** + * Static value c6gd.16xlarge for InstanceType. + */ + public static final InstanceType C6GD_16XLARGE = fromString("c6gd.16xlarge"); + + /** + * Static value c6gd.2xlarge for InstanceType. + */ + public static final InstanceType C6GD_2XLARGE = fromString("c6gd.2xlarge"); + + /** + * Static value c6gd.4xlarge for InstanceType. + */ + public static final InstanceType C6GD_4XLARGE = fromString("c6gd.4xlarge"); + + /** + * Static value c6gd.8xlarge for InstanceType. + */ + public static final InstanceType C6GD_8XLARGE = fromString("c6gd.8xlarge"); + + /** + * Static value c6gd.large for InstanceType. + */ + public static final InstanceType C6GD_LARGE = fromString("c6gd.large"); + + /** + * Static value c6gd.medium for InstanceType. + */ + public static final InstanceType C6GD_MEDIUM = fromString("c6gd.medium"); + + /** + * Static value c6gd.metal for InstanceType. + */ + public static final InstanceType C6GD_METAL = fromString("c6gd.metal"); + + /** + * Static value c6gd.xlarge for InstanceType. + */ + public static final InstanceType C6GD_XLARGE = fromString("c6gd.xlarge"); + + /** + * Static value c6gn.12xlarge for InstanceType. + */ + public static final InstanceType C6GN_12XLARGE = fromString("c6gn.12xlarge"); + + /** + * Static value c6gn.16xlarge for InstanceType. + */ + public static final InstanceType C6GN_16XLARGE = fromString("c6gn.16xlarge"); + + /** + * Static value c6gn.2xlarge for InstanceType. + */ + public static final InstanceType C6GN_2XLARGE = fromString("c6gn.2xlarge"); + + /** + * Static value c6gn.4xlarge for InstanceType. + */ + public static final InstanceType C6GN_4XLARGE = fromString("c6gn.4xlarge"); + + /** + * Static value c6gn.8xlarge for InstanceType. + */ + public static final InstanceType C6GN_8XLARGE = fromString("c6gn.8xlarge"); + + /** + * Static value c6gn.large for InstanceType. + */ + public static final InstanceType C6GN_LARGE = fromString("c6gn.large"); + + /** + * Static value c6gn.medium for InstanceType. + */ + public static final InstanceType C6GN_MEDIUM = fromString("c6gn.medium"); + + /** + * Static value c6gn.xlarge for InstanceType. + */ + public static final InstanceType C6GN_XLARGE = fromString("c6gn.xlarge"); + + /** + * Static value c6i.12xlarge for InstanceType. + */ + public static final InstanceType C6I_12XLARGE = fromString("c6i.12xlarge"); + + /** + * Static value c6i.16xlarge for InstanceType. + */ + public static final InstanceType C6I_16XLARGE = fromString("c6i.16xlarge"); + + /** + * Static value c6i.24xlarge for InstanceType. + */ + public static final InstanceType C6I_24XLARGE = fromString("c6i.24xlarge"); + + /** + * Static value c6i.2xlarge for InstanceType. + */ + public static final InstanceType C6I_2XLARGE = fromString("c6i.2xlarge"); + + /** + * Static value c6i.32xlarge for InstanceType. + */ + public static final InstanceType C6I_32XLARGE = fromString("c6i.32xlarge"); + + /** + * Static value c6i.4xlarge for InstanceType. + */ + public static final InstanceType C6I_4XLARGE = fromString("c6i.4xlarge"); + + /** + * Static value c6i.8xlarge for InstanceType. + */ + public static final InstanceType C6I_8XLARGE = fromString("c6i.8xlarge"); + + /** + * Static value c6i.large for InstanceType. + */ + public static final InstanceType C6I_LARGE = fromString("c6i.large"); + + /** + * Static value c6i.metal for InstanceType. + */ + public static final InstanceType C6I_METAL = fromString("c6i.metal"); + + /** + * Static value c6i.xlarge for InstanceType. + */ + public static final InstanceType C6I_XLARGE = fromString("c6i.xlarge"); + + /** + * Static value c6id.12xlarge for InstanceType. + */ + public static final InstanceType C6ID_12XLARGE = fromString("c6id.12xlarge"); + + /** + * Static value c6id.16xlarge for InstanceType. + */ + public static final InstanceType C6ID_16XLARGE = fromString("c6id.16xlarge"); + + /** + * Static value c6id.24xlarge for InstanceType. + */ + public static final InstanceType C6ID_24XLARGE = fromString("c6id.24xlarge"); + + /** + * Static value c6id.2xlarge for InstanceType. + */ + public static final InstanceType C6ID_2XLARGE = fromString("c6id.2xlarge"); + + /** + * Static value c6id.32xlarge for InstanceType. + */ + public static final InstanceType C6ID_32XLARGE = fromString("c6id.32xlarge"); + + /** + * Static value c6id.4xlarge for InstanceType. + */ + public static final InstanceType C6ID_4XLARGE = fromString("c6id.4xlarge"); + + /** + * Static value c6id.8xlarge for InstanceType. + */ + public static final InstanceType C6ID_8XLARGE = fromString("c6id.8xlarge"); + + /** + * Static value c6id.large for InstanceType. + */ + public static final InstanceType C6ID_LARGE = fromString("c6id.large"); + + /** + * Static value c6id.metal for InstanceType. + */ + public static final InstanceType C6ID_METAL = fromString("c6id.metal"); + + /** + * Static value c6id.xlarge for InstanceType. + */ + public static final InstanceType C6ID_XLARGE = fromString("c6id.xlarge"); + + /** + * Static value c6in.12xlarge for InstanceType. + */ + public static final InstanceType C6IN_12XLARGE = fromString("c6in.12xlarge"); + + /** + * Static value c6in.16xlarge for InstanceType. + */ + public static final InstanceType C6IN_16XLARGE = fromString("c6in.16xlarge"); + + /** + * Static value c6in.24xlarge for InstanceType. + */ + public static final InstanceType C6IN_24XLARGE = fromString("c6in.24xlarge"); + + /** + * Static value c6in.2xlarge for InstanceType. + */ + public static final InstanceType C6IN_2XLARGE = fromString("c6in.2xlarge"); + + /** + * Static value c6in.32xlarge for InstanceType. + */ + public static final InstanceType C6IN_32XLARGE = fromString("c6in.32xlarge"); + + /** + * Static value c6in.4xlarge for InstanceType. + */ + public static final InstanceType C6IN_4XLARGE = fromString("c6in.4xlarge"); + + /** + * Static value c6in.8xlarge for InstanceType. + */ + public static final InstanceType C6IN_8XLARGE = fromString("c6in.8xlarge"); + + /** + * Static value c6in.large for InstanceType. + */ + public static final InstanceType C6IN_LARGE = fromString("c6in.large"); + + /** + * Static value c6in.metal for InstanceType. + */ + public static final InstanceType C6IN_METAL = fromString("c6in.metal"); + + /** + * Static value c6in.xlarge for InstanceType. + */ + public static final InstanceType C6IN_XLARGE = fromString("c6in.xlarge"); + + /** + * Static value c7a.12xlarge for InstanceType. + */ + public static final InstanceType C7A_12XLARGE = fromString("c7a.12xlarge"); + + /** + * Static value c7a.16xlarge for InstanceType. + */ + public static final InstanceType C7A_16XLARGE = fromString("c7a.16xlarge"); + + /** + * Static value c7a.24xlarge for InstanceType. + */ + public static final InstanceType C7A_24XLARGE = fromString("c7a.24xlarge"); + + /** + * Static value c7a.2xlarge for InstanceType. + */ + public static final InstanceType C7A_2XLARGE = fromString("c7a.2xlarge"); + + /** + * Static value c7a.32xlarge for InstanceType. + */ + public static final InstanceType C7A_32XLARGE = fromString("c7a.32xlarge"); + + /** + * Static value c7a.48xlarge for InstanceType. + */ + public static final InstanceType C7A_48XLARGE = fromString("c7a.48xlarge"); + + /** + * Static value c7a.4xlarge for InstanceType. + */ + public static final InstanceType C7A_4XLARGE = fromString("c7a.4xlarge"); + + /** + * Static value c7a.8xlarge for InstanceType. + */ + public static final InstanceType C7A_8XLARGE = fromString("c7a.8xlarge"); + + /** + * Static value c7a.large for InstanceType. + */ + public static final InstanceType C7A_LARGE = fromString("c7a.large"); + + /** + * Static value c7a.medium for InstanceType. + */ + public static final InstanceType C7A_MEDIUM = fromString("c7a.medium"); + + /** + * Static value c7a.metal-48xl for InstanceType. + */ + public static final InstanceType C7A_METAL_48XL = fromString("c7a.metal-48xl"); + + /** + * Static value c7a.xlarge for InstanceType. + */ + public static final InstanceType C7A_XLARGE = fromString("c7a.xlarge"); + + /** + * Static value c7g.12xlarge for InstanceType. + */ + public static final InstanceType C7G_12XLARGE = fromString("c7g.12xlarge"); + + /** + * Static value c7g.16xlarge for InstanceType. + */ + public static final InstanceType C7G_16XLARGE = fromString("c7g.16xlarge"); + + /** + * Static value c7g.2xlarge for InstanceType. + */ + public static final InstanceType C7G_2XLARGE = fromString("c7g.2xlarge"); + + /** + * Static value c7g.4xlarge for InstanceType. + */ + public static final InstanceType C7G_4XLARGE = fromString("c7g.4xlarge"); + + /** + * Static value c7g.8xlarge for InstanceType. + */ + public static final InstanceType C7G_8XLARGE = fromString("c7g.8xlarge"); + + /** + * Static value c7g.large for InstanceType. + */ + public static final InstanceType C7G_LARGE = fromString("c7g.large"); + + /** + * Static value c7g.medium for InstanceType. + */ + public static final InstanceType C7G_MEDIUM = fromString("c7g.medium"); + + /** + * Static value c7g.metal for InstanceType. + */ + public static final InstanceType C7G_METAL = fromString("c7g.metal"); + + /** + * Static value c7g.xlarge for InstanceType. + */ + public static final InstanceType C7G_XLARGE = fromString("c7g.xlarge"); + + /** + * Static value c7gd.12xlarge for InstanceType. + */ + public static final InstanceType C7GD_12XLARGE = fromString("c7gd.12xlarge"); + + /** + * Static value c7gd.16xlarge for InstanceType. + */ + public static final InstanceType C7GD_16XLARGE = fromString("c7gd.16xlarge"); + + /** + * Static value c7gd.2xlarge for InstanceType. + */ + public static final InstanceType C7GD_2XLARGE = fromString("c7gd.2xlarge"); + + /** + * Static value c7gd.4xlarge for InstanceType. + */ + public static final InstanceType C7GD_4XLARGE = fromString("c7gd.4xlarge"); + + /** + * Static value c7gd.8xlarge for InstanceType. + */ + public static final InstanceType C7GD_8XLARGE = fromString("c7gd.8xlarge"); + + /** + * Static value c7gd.large for InstanceType. + */ + public static final InstanceType C7GD_LARGE = fromString("c7gd.large"); + + /** + * Static value c7gd.medium for InstanceType. + */ + public static final InstanceType C7GD_MEDIUM = fromString("c7gd.medium"); + + /** + * Static value c7gd.metal for InstanceType. + */ + public static final InstanceType C7GD_METAL = fromString("c7gd.metal"); + + /** + * Static value c7gd.xlarge for InstanceType. + */ + public static final InstanceType C7GD_XLARGE = fromString("c7gd.xlarge"); + + /** + * Static value c7gn.12xlarge for InstanceType. + */ + public static final InstanceType C7GN_12XLARGE = fromString("c7gn.12xlarge"); + + /** + * Static value c7gn.16xlarge for InstanceType. + */ + public static final InstanceType C7GN_16XLARGE = fromString("c7gn.16xlarge"); + + /** + * Static value c7gn.2xlarge for InstanceType. + */ + public static final InstanceType C7GN_2XLARGE = fromString("c7gn.2xlarge"); + + /** + * Static value c7gn.4xlarge for InstanceType. + */ + public static final InstanceType C7GN_4XLARGE = fromString("c7gn.4xlarge"); + + /** + * Static value c7gn.8xlarge for InstanceType. + */ + public static final InstanceType C7GN_8XLARGE = fromString("c7gn.8xlarge"); + + /** + * Static value c7gn.large for InstanceType. + */ + public static final InstanceType C7GN_LARGE = fromString("c7gn.large"); + + /** + * Static value c7gn.medium for InstanceType. + */ + public static final InstanceType C7GN_MEDIUM = fromString("c7gn.medium"); + + /** + * Static value c7gn.xlarge for InstanceType. + */ + public static final InstanceType C7GN_XLARGE = fromString("c7gn.xlarge"); + + /** + * Static value c7i.12xlarge for InstanceType. + */ + public static final InstanceType C7I_12XLARGE = fromString("c7i.12xlarge"); + + /** + * Static value c7i.16xlarge for InstanceType. + */ + public static final InstanceType C7I_16XLARGE = fromString("c7i.16xlarge"); + + /** + * Static value c7i.24xlarge for InstanceType. + */ + public static final InstanceType C7I_24XLARGE = fromString("c7i.24xlarge"); + + /** + * Static value c7i.2xlarge for InstanceType. + */ + public static final InstanceType C7I_2XLARGE = fromString("c7i.2xlarge"); + + /** + * Static value c7i.48xlarge for InstanceType. + */ + public static final InstanceType C7I_48XLARGE = fromString("c7i.48xlarge"); + + /** + * Static value c7i.4xlarge for InstanceType. + */ + public static final InstanceType C7I_4XLARGE = fromString("c7i.4xlarge"); + + /** + * Static value c7i.8xlarge for InstanceType. + */ + public static final InstanceType C7I_8XLARGE = fromString("c7i.8xlarge"); + + /** + * Static value c7i.large for InstanceType. + */ + public static final InstanceType C7I_LARGE = fromString("c7i.large"); + + /** + * Static value c7i.metal-24xl for InstanceType. + */ + public static final InstanceType C7I_METAL_24XL = fromString("c7i.metal-24xl"); + + /** + * Static value c7i.metal-48xl for InstanceType. + */ + public static final InstanceType C7I_METAL_48XL = fromString("c7i.metal-48xl"); + + /** + * Static value c7i.xlarge for InstanceType. + */ + public static final InstanceType C7I_XLARGE = fromString("c7i.xlarge"); + + /** + * Static value cc1.4xlarge for InstanceType. + */ + public static final InstanceType CC1_4XLARGE = fromString("cc1.4xlarge"); + + /** + * Static value cc2.8xlarge for InstanceType. + */ + public static final InstanceType CC2_8XLARGE = fromString("cc2.8xlarge"); + + /** + * Static value cg1.4xlarge for InstanceType. + */ + public static final InstanceType CG1_4XLARGE = fromString("cg1.4xlarge"); + + /** + * Static value cr1.8xlarge for InstanceType. + */ + public static final InstanceType CR1_8XLARGE = fromString("cr1.8xlarge"); + + /** + * Static value d2.2xlarge for InstanceType. + */ + public static final InstanceType D2_2XLARGE = fromString("d2.2xlarge"); + + /** + * Static value d2.4xlarge for InstanceType. + */ + public static final InstanceType D2_4XLARGE = fromString("d2.4xlarge"); + + /** + * Static value d2.8xlarge for InstanceType. + */ + public static final InstanceType D2_8XLARGE = fromString("d2.8xlarge"); + + /** + * Static value d2.xlarge for InstanceType. + */ + public static final InstanceType D2_XLARGE = fromString("d2.xlarge"); + + /** + * Static value d3.2xlarge for InstanceType. + */ + public static final InstanceType D3_2XLARGE = fromString("d3.2xlarge"); + + /** + * Static value d3.4xlarge for InstanceType. + */ + public static final InstanceType D3_4XLARGE = fromString("d3.4xlarge"); + + /** + * Static value d3.8xlarge for InstanceType. + */ + public static final InstanceType D3_8XLARGE = fromString("d3.8xlarge"); + + /** + * Static value d3.xlarge for InstanceType. + */ + public static final InstanceType D3_XLARGE = fromString("d3.xlarge"); + + /** + * Static value d3en.12xlarge for InstanceType. + */ + public static final InstanceType D3EN_12XLARGE = fromString("d3en.12xlarge"); + + /** + * Static value d3en.2xlarge for InstanceType. + */ + public static final InstanceType D3EN_2XLARGE = fromString("d3en.2xlarge"); + + /** + * Static value d3en.4xlarge for InstanceType. + */ + public static final InstanceType D3EN_4XLARGE = fromString("d3en.4xlarge"); + + /** + * Static value d3en.6xlarge for InstanceType. + */ + public static final InstanceType D3EN_6XLARGE = fromString("d3en.6xlarge"); + + /** + * Static value d3en.8xlarge for InstanceType. + */ + public static final InstanceType D3EN_8XLARGE = fromString("d3en.8xlarge"); + + /** + * Static value d3en.xlarge for InstanceType. + */ + public static final InstanceType D3EN_XLARGE = fromString("d3en.xlarge"); + + /** + * Static value dl1.24xlarge for InstanceType. + */ + public static final InstanceType DL1_24XLARGE = fromString("dl1.24xlarge"); + + /** + * Static value dl2q.24xlarge for InstanceType. + */ + public static final InstanceType DL2Q_24XLARGE = fromString("dl2q.24xlarge"); + + /** + * Static value f1.16xlarge for InstanceType. + */ + public static final InstanceType F1_16XLARGE = fromString("f1.16xlarge"); + + /** + * Static value f1.2xlarge for InstanceType. + */ + public static final InstanceType F1_2XLARGE = fromString("f1.2xlarge"); + + /** + * Static value f1.4xlarge for InstanceType. + */ + public static final InstanceType F1_4XLARGE = fromString("f1.4xlarge"); + + /** + * Static value g2.2xlarge for InstanceType. + */ + public static final InstanceType G2_2XLARGE = fromString("g2.2xlarge"); + + /** + * Static value g2.8xlarge for InstanceType. + */ + public static final InstanceType G2_8XLARGE = fromString("g2.8xlarge"); + + /** + * Static value g3.16xlarge for InstanceType. + */ + public static final InstanceType G3_16XLARGE = fromString("g3.16xlarge"); + + /** + * Static value g3.4xlarge for InstanceType. + */ + public static final InstanceType G3_4XLARGE = fromString("g3.4xlarge"); + + /** + * Static value g3.8xlarge for InstanceType. + */ + public static final InstanceType G3_8XLARGE = fromString("g3.8xlarge"); + + /** + * Static value g3s.xlarge for InstanceType. + */ + public static final InstanceType G3S_XLARGE = fromString("g3s.xlarge"); + + /** + * Static value g4ad.16xlarge for InstanceType. + */ + public static final InstanceType G4AD_16XLARGE = fromString("g4ad.16xlarge"); + + /** + * Static value g4ad.2xlarge for InstanceType. + */ + public static final InstanceType G4AD_2XLARGE = fromString("g4ad.2xlarge"); + + /** + * Static value g4ad.4xlarge for InstanceType. + */ + public static final InstanceType G4AD_4XLARGE = fromString("g4ad.4xlarge"); + + /** + * Static value g4ad.8xlarge for InstanceType. + */ + public static final InstanceType G4AD_8XLARGE = fromString("g4ad.8xlarge"); + + /** + * Static value g4ad.xlarge for InstanceType. + */ + public static final InstanceType G4AD_XLARGE = fromString("g4ad.xlarge"); + + /** + * Static value g4dn.12xlarge for InstanceType. + */ + public static final InstanceType G4DN_12XLARGE = fromString("g4dn.12xlarge"); + + /** + * Static value g4dn.16xlarge for InstanceType. + */ + public static final InstanceType G4DN_16XLARGE = fromString("g4dn.16xlarge"); + + /** + * Static value g4dn.2xlarge for InstanceType. + */ + public static final InstanceType G4DN_2XLARGE = fromString("g4dn.2xlarge"); + + /** + * Static value g4dn.4xlarge for InstanceType. + */ + public static final InstanceType G4DN_4XLARGE = fromString("g4dn.4xlarge"); + + /** + * Static value g4dn.8xlarge for InstanceType. + */ + public static final InstanceType G4DN_8XLARGE = fromString("g4dn.8xlarge"); + + /** + * Static value g4dn.metal for InstanceType. + */ + public static final InstanceType G4DN_METAL = fromString("g4dn.metal"); + + /** + * Static value g4dn.xlarge for InstanceType. + */ + public static final InstanceType G4DN_XLARGE = fromString("g4dn.xlarge"); + + /** + * Static value g5.12xlarge for InstanceType. + */ + public static final InstanceType G5_12XLARGE = fromString("g5.12xlarge"); + + /** + * Static value g5.16xlarge for InstanceType. + */ + public static final InstanceType G5_16XLARGE = fromString("g5.16xlarge"); + + /** + * Static value g5.24xlarge for InstanceType. + */ + public static final InstanceType G5_24XLARGE = fromString("g5.24xlarge"); + + /** + * Static value g5.2xlarge for InstanceType. + */ + public static final InstanceType G5_2XLARGE = fromString("g5.2xlarge"); + + /** + * Static value g5.48xlarge for InstanceType. + */ + public static final InstanceType G5_48XLARGE = fromString("g5.48xlarge"); + + /** + * Static value g5.4xlarge for InstanceType. + */ + public static final InstanceType G5_4XLARGE = fromString("g5.4xlarge"); + + /** + * Static value g5.8xlarge for InstanceType. + */ + public static final InstanceType G5_8XLARGE = fromString("g5.8xlarge"); + + /** + * Static value g5.xlarge for InstanceType. + */ + public static final InstanceType G5_XLARGE = fromString("g5.xlarge"); + + /** + * Static value g5g.16xlarge for InstanceType. + */ + public static final InstanceType G5G_16XLARGE = fromString("g5g.16xlarge"); + + /** + * Static value g5g.2xlarge for InstanceType. + */ + public static final InstanceType G5G_2XLARGE = fromString("g5g.2xlarge"); + + /** + * Static value g5g.4xlarge for InstanceType. + */ + public static final InstanceType G5G_4XLARGE = fromString("g5g.4xlarge"); + + /** + * Static value g5g.8xlarge for InstanceType. + */ + public static final InstanceType G5G_8XLARGE = fromString("g5g.8xlarge"); + + /** + * Static value g5g.metal for InstanceType. + */ + public static final InstanceType G5G_METAL = fromString("g5g.metal"); + + /** + * Static value g5g.xlarge for InstanceType. + */ + public static final InstanceType G5G_XLARGE = fromString("g5g.xlarge"); + + /** + * Static value g6.12xlarge for InstanceType. + */ + public static final InstanceType G6_12XLARGE = fromString("g6.12xlarge"); + + /** + * Static value g6.16xlarge for InstanceType. + */ + public static final InstanceType G6_16XLARGE = fromString("g6.16xlarge"); + + /** + * Static value g6.24xlarge for InstanceType. + */ + public static final InstanceType G6_24XLARGE = fromString("g6.24xlarge"); + + /** + * Static value g6.2xlarge for InstanceType. + */ + public static final InstanceType G6_2XLARGE = fromString("g6.2xlarge"); + + /** + * Static value g6.48xlarge for InstanceType. + */ + public static final InstanceType G6_48XLARGE = fromString("g6.48xlarge"); + + /** + * Static value g6.4xlarge for InstanceType. + */ + public static final InstanceType G6_4XLARGE = fromString("g6.4xlarge"); + + /** + * Static value g6.8xlarge for InstanceType. + */ + public static final InstanceType G6_8XLARGE = fromString("g6.8xlarge"); + + /** + * Static value g6.xlarge for InstanceType. + */ + public static final InstanceType G6_XLARGE = fromString("g6.xlarge"); + + /** + * Static value gr6.4xlarge for InstanceType. + */ + public static final InstanceType GR6_4XLARGE = fromString("gr6.4xlarge"); + + /** + * Static value gr6.8xlarge for InstanceType. + */ + public static final InstanceType GR6_8XLARGE = fromString("gr6.8xlarge"); + + /** + * Static value h1.16xlarge for InstanceType. + */ + public static final InstanceType H1_16XLARGE = fromString("h1.16xlarge"); + + /** + * Static value h1.2xlarge for InstanceType. + */ + public static final InstanceType H1_2XLARGE = fromString("h1.2xlarge"); + + /** + * Static value h1.4xlarge for InstanceType. + */ + public static final InstanceType H1_4XLARGE = fromString("h1.4xlarge"); + + /** + * Static value h1.8xlarge for InstanceType. + */ + public static final InstanceType H1_8XLARGE = fromString("h1.8xlarge"); + + /** + * Static value hi1.4xlarge for InstanceType. + */ + public static final InstanceType HI1_4XLARGE = fromString("hi1.4xlarge"); + + /** + * Static value hpc6a.48xlarge for InstanceType. + */ + public static final InstanceType HPC6A_48XLARGE = fromString("hpc6a.48xlarge"); + + /** + * Static value hpc6id.32xlarge for InstanceType. + */ + public static final InstanceType HPC6ID_32XLARGE = fromString("hpc6id.32xlarge"); + + /** + * Static value hpc7a.12xlarge for InstanceType. + */ + public static final InstanceType HPC7A_12XLARGE = fromString("hpc7a.12xlarge"); + + /** + * Static value hpc7a.24xlarge for InstanceType. + */ + public static final InstanceType HPC7A_24XLARGE = fromString("hpc7a.24xlarge"); + + /** + * Static value hpc7a.48xlarge for InstanceType. + */ + public static final InstanceType HPC7A_48XLARGE = fromString("hpc7a.48xlarge"); + + /** + * Static value hpc7a.96xlarge for InstanceType. + */ + public static final InstanceType HPC7A_96XLARGE = fromString("hpc7a.96xlarge"); + + /** + * Static value hpc7g.16xlarge for InstanceType. + */ + public static final InstanceType HPC7G_16XLARGE = fromString("hpc7g.16xlarge"); + + /** + * Static value hpc7g.4xlarge for InstanceType. + */ + public static final InstanceType HPC7G_4XLARGE = fromString("hpc7g.4xlarge"); + + /** + * Static value hpc7g.8xlarge for InstanceType. + */ + public static final InstanceType HPC7G_8XLARGE = fromString("hpc7g.8xlarge"); + + /** + * Static value hs1.8xlarge for InstanceType. + */ + public static final InstanceType HS1_8XLARGE = fromString("hs1.8xlarge"); + + /** + * Static value i2.2xlarge for InstanceType. + */ + public static final InstanceType I2_2XLARGE = fromString("i2.2xlarge"); + + /** + * Static value i2.4xlarge for InstanceType. + */ + public static final InstanceType I2_4XLARGE = fromString("i2.4xlarge"); + + /** + * Static value i2.8xlarge for InstanceType. + */ + public static final InstanceType I2_8XLARGE = fromString("i2.8xlarge"); + + /** + * Static value i2.xlarge for InstanceType. + */ + public static final InstanceType I2_XLARGE = fromString("i2.xlarge"); + + /** + * Static value i3.16xlarge for InstanceType. + */ + public static final InstanceType I3_16XLARGE = fromString("i3.16xlarge"); + + /** + * Static value i3.2xlarge for InstanceType. + */ + public static final InstanceType I3_2XLARGE = fromString("i3.2xlarge"); + + /** + * Static value i3.4xlarge for InstanceType. + */ + public static final InstanceType I3_4XLARGE = fromString("i3.4xlarge"); + + /** + * Static value i3.8xlarge for InstanceType. + */ + public static final InstanceType I3_8XLARGE = fromString("i3.8xlarge"); + + /** + * Static value i3.large for InstanceType. + */ + public static final InstanceType I3_LARGE = fromString("i3.large"); + + /** + * Static value i3.metal for InstanceType. + */ + public static final InstanceType I3_METAL = fromString("i3.metal"); + + /** + * Static value i3.xlarge for InstanceType. + */ + public static final InstanceType I3_XLARGE = fromString("i3.xlarge"); + + /** + * Static value i3en.12xlarge for InstanceType. + */ + public static final InstanceType I3EN_12XLARGE = fromString("i3en.12xlarge"); + + /** + * Static value i3en.24xlarge for InstanceType. + */ + public static final InstanceType I3EN_24XLARGE = fromString("i3en.24xlarge"); + + /** + * Static value i3en.2xlarge for InstanceType. + */ + public static final InstanceType I3EN_2XLARGE = fromString("i3en.2xlarge"); + + /** + * Static value i3en.3xlarge for InstanceType. + */ + public static final InstanceType I3EN_3XLARGE = fromString("i3en.3xlarge"); + + /** + * Static value i3en.6xlarge for InstanceType. + */ + public static final InstanceType I3EN_6XLARGE = fromString("i3en.6xlarge"); + + /** + * Static value i3en.large for InstanceType. + */ + public static final InstanceType I3EN_LARGE = fromString("i3en.large"); + + /** + * Static value i3en.metal for InstanceType. + */ + public static final InstanceType I3EN_METAL = fromString("i3en.metal"); + + /** + * Static value i3en.xlarge for InstanceType. + */ + public static final InstanceType I3EN_XLARGE = fromString("i3en.xlarge"); + + /** + * Static value i4g.16xlarge for InstanceType. + */ + public static final InstanceType I4G_16XLARGE = fromString("i4g.16xlarge"); + + /** + * Static value i4g.2xlarge for InstanceType. + */ + public static final InstanceType I4G_2XLARGE = fromString("i4g.2xlarge"); + + /** + * Static value i4g.4xlarge for InstanceType. + */ + public static final InstanceType I4G_4XLARGE = fromString("i4g.4xlarge"); + + /** + * Static value i4g.8xlarge for InstanceType. + */ + public static final InstanceType I4G_8XLARGE = fromString("i4g.8xlarge"); + + /** + * Static value i4g.large for InstanceType. + */ + public static final InstanceType I4G_LARGE = fromString("i4g.large"); + + /** + * Static value i4g.xlarge for InstanceType. + */ + public static final InstanceType I4G_XLARGE = fromString("i4g.xlarge"); + + /** + * Static value i4i.12xlarge for InstanceType. + */ + public static final InstanceType I4I_12XLARGE = fromString("i4i.12xlarge"); + + /** + * Static value i4i.16xlarge for InstanceType. + */ + public static final InstanceType I4I_16XLARGE = fromString("i4i.16xlarge"); + + /** + * Static value i4i.24xlarge for InstanceType. + */ + public static final InstanceType I4I_24XLARGE = fromString("i4i.24xlarge"); + + /** + * Static value i4i.2xlarge for InstanceType. + */ + public static final InstanceType I4I_2XLARGE = fromString("i4i.2xlarge"); + + /** + * Static value i4i.32xlarge for InstanceType. + */ + public static final InstanceType I4I_32XLARGE = fromString("i4i.32xlarge"); + + /** + * Static value i4i.4xlarge for InstanceType. + */ + public static final InstanceType I4I_4XLARGE = fromString("i4i.4xlarge"); + + /** + * Static value i4i.8xlarge for InstanceType. + */ + public static final InstanceType I4I_8XLARGE = fromString("i4i.8xlarge"); + + /** + * Static value i4i.large for InstanceType. + */ + public static final InstanceType I4I_LARGE = fromString("i4i.large"); + + /** + * Static value i4i.metal for InstanceType. + */ + public static final InstanceType I4I_METAL = fromString("i4i.metal"); + + /** + * Static value i4i.xlarge for InstanceType. + */ + public static final InstanceType I4I_XLARGE = fromString("i4i.xlarge"); + + /** + * Static value im4gn.16xlarge for InstanceType. + */ + public static final InstanceType IM4GN_16XLARGE = fromString("im4gn.16xlarge"); + + /** + * Static value im4gn.2xlarge for InstanceType. + */ + public static final InstanceType IM4GN_2XLARGE = fromString("im4gn.2xlarge"); + + /** + * Static value im4gn.4xlarge for InstanceType. + */ + public static final InstanceType IM4GN_4XLARGE = fromString("im4gn.4xlarge"); + + /** + * Static value im4gn.8xlarge for InstanceType. + */ + public static final InstanceType IM4GN_8XLARGE = fromString("im4gn.8xlarge"); + + /** + * Static value im4gn.large for InstanceType. + */ + public static final InstanceType IM4GN_LARGE = fromString("im4gn.large"); + + /** + * Static value im4gn.xlarge for InstanceType. + */ + public static final InstanceType IM4GN_XLARGE = fromString("im4gn.xlarge"); + + /** + * Static value inf1.24xlarge for InstanceType. + */ + public static final InstanceType INF1_24XLARGE = fromString("inf1.24xlarge"); + + /** + * Static value inf1.2xlarge for InstanceType. + */ + public static final InstanceType INF1_2XLARGE = fromString("inf1.2xlarge"); + + /** + * Static value inf1.6xlarge for InstanceType. + */ + public static final InstanceType INF1_6XLARGE = fromString("inf1.6xlarge"); + + /** + * Static value inf1.xlarge for InstanceType. + */ + public static final InstanceType INF1_XLARGE = fromString("inf1.xlarge"); + + /** + * Static value inf2.24xlarge for InstanceType. + */ + public static final InstanceType INF2_24XLARGE = fromString("inf2.24xlarge"); + + /** + * Static value inf2.48xlarge for InstanceType. + */ + public static final InstanceType INF2_48XLARGE = fromString("inf2.48xlarge"); + + /** + * Static value inf2.8xlarge for InstanceType. + */ + public static final InstanceType INF2_8XLARGE = fromString("inf2.8xlarge"); + + /** + * Static value inf2.xlarge for InstanceType. + */ + public static final InstanceType INF2_XLARGE = fromString("inf2.xlarge"); + + /** + * Static value is4gen.2xlarge for InstanceType. + */ + public static final InstanceType IS4GEN_2XLARGE = fromString("is4gen.2xlarge"); + + /** + * Static value is4gen.4xlarge for InstanceType. + */ + public static final InstanceType IS4GEN_4XLARGE = fromString("is4gen.4xlarge"); + + /** + * Static value is4gen.8xlarge for InstanceType. + */ + public static final InstanceType IS4GEN_8XLARGE = fromString("is4gen.8xlarge"); + + /** + * Static value is4gen.large for InstanceType. + */ + public static final InstanceType IS4GEN_LARGE = fromString("is4gen.large"); + + /** + * Static value is4gen.medium for InstanceType. + */ + public static final InstanceType IS4GEN_MEDIUM = fromString("is4gen.medium"); + + /** + * Static value is4gen.xlarge for InstanceType. + */ + public static final InstanceType IS4GEN_XLARGE = fromString("is4gen.xlarge"); + + /** + * Static value m1.large for InstanceType. + */ + public static final InstanceType M1_LARGE = fromString("m1.large"); + + /** + * Static value m1.medium for InstanceType. + */ + public static final InstanceType M1_MEDIUM = fromString("m1.medium"); + + /** + * Static value m1.small for InstanceType. + */ + public static final InstanceType M1_SMALL = fromString("m1.small"); + + /** + * Static value m1.xlarge for InstanceType. + */ + public static final InstanceType M1_XLARGE = fromString("m1.xlarge"); + + /** + * Static value m2.2xlarge for InstanceType. + */ + public static final InstanceType M2_2XLARGE = fromString("m2.2xlarge"); + + /** + * Static value m2.4xlarge for InstanceType. + */ + public static final InstanceType M2_4XLARGE = fromString("m2.4xlarge"); + + /** + * Static value m2.xlarge for InstanceType. + */ + public static final InstanceType M2_XLARGE = fromString("m2.xlarge"); + + /** + * Static value m3.2xlarge for InstanceType. + */ + public static final InstanceType M3_2XLARGE = fromString("m3.2xlarge"); + + /** + * Static value m3.large for InstanceType. + */ + public static final InstanceType M3_LARGE = fromString("m3.large"); + + /** + * Static value m3.medium for InstanceType. + */ + public static final InstanceType M3_MEDIUM = fromString("m3.medium"); + + /** + * Static value m3.xlarge for InstanceType. + */ + public static final InstanceType M3_XLARGE = fromString("m3.xlarge"); + + /** + * Static value m4.10xlarge for InstanceType. + */ + public static final InstanceType M4_10XLARGE = fromString("m4.10xlarge"); + + /** + * Static value m4.16xlarge for InstanceType. + */ + public static final InstanceType M4_16XLARGE = fromString("m4.16xlarge"); + + /** + * Static value m4.2xlarge for InstanceType. + */ + public static final InstanceType M4_2XLARGE = fromString("m4.2xlarge"); + + /** + * Static value m4.4xlarge for InstanceType. + */ + public static final InstanceType M4_4XLARGE = fromString("m4.4xlarge"); + + /** + * Static value m4.large for InstanceType. + */ + public static final InstanceType M4_LARGE = fromString("m4.large"); + + /** + * Static value m4.xlarge for InstanceType. + */ + public static final InstanceType M4_XLARGE = fromString("m4.xlarge"); + + /** + * Static value m5.12xlarge for InstanceType. + */ + public static final InstanceType M5_12XLARGE = fromString("m5.12xlarge"); + + /** + * Static value m5.16xlarge for InstanceType. + */ + public static final InstanceType M5_16XLARGE = fromString("m5.16xlarge"); + + /** + * Static value m5.24xlarge for InstanceType. + */ + public static final InstanceType M5_24XLARGE = fromString("m5.24xlarge"); + + /** + * Static value m5.2xlarge for InstanceType. + */ + public static final InstanceType M5_2XLARGE = fromString("m5.2xlarge"); + + /** + * Static value m5.4xlarge for InstanceType. + */ + public static final InstanceType M5_4XLARGE = fromString("m5.4xlarge"); + + /** + * Static value m5.8xlarge for InstanceType. + */ + public static final InstanceType M5_8XLARGE = fromString("m5.8xlarge"); + + /** + * Static value m5.large for InstanceType. + */ + public static final InstanceType M5_LARGE = fromString("m5.large"); + + /** + * Static value m5.metal for InstanceType. + */ + public static final InstanceType M5_METAL = fromString("m5.metal"); + + /** + * Static value m5.xlarge for InstanceType. + */ + public static final InstanceType M5_XLARGE = fromString("m5.xlarge"); + + /** + * Static value m5a.12xlarge for InstanceType. + */ + public static final InstanceType M5A_12XLARGE = fromString("m5a.12xlarge"); + + /** + * Static value m5a.16xlarge for InstanceType. + */ + public static final InstanceType M5A_16XLARGE = fromString("m5a.16xlarge"); + + /** + * Static value m5a.24xlarge for InstanceType. + */ + public static final InstanceType M5A_24XLARGE = fromString("m5a.24xlarge"); + + /** + * Static value m5a.2xlarge for InstanceType. + */ + public static final InstanceType M5A_2XLARGE = fromString("m5a.2xlarge"); + + /** + * Static value m5a.4xlarge for InstanceType. + */ + public static final InstanceType M5A_4XLARGE = fromString("m5a.4xlarge"); + + /** + * Static value m5a.8xlarge for InstanceType. + */ + public static final InstanceType M5A_8XLARGE = fromString("m5a.8xlarge"); + + /** + * Static value m5a.large for InstanceType. + */ + public static final InstanceType M5A_LARGE = fromString("m5a.large"); + + /** + * Static value m5a.xlarge for InstanceType. + */ + public static final InstanceType M5A_XLARGE = fromString("m5a.xlarge"); + + /** + * Static value m5ad.12xlarge for InstanceType. + */ + public static final InstanceType M5AD_12XLARGE = fromString("m5ad.12xlarge"); + + /** + * Static value m5ad.16xlarge for InstanceType. + */ + public static final InstanceType M5AD_16XLARGE = fromString("m5ad.16xlarge"); + + /** + * Static value m5ad.24xlarge for InstanceType. + */ + public static final InstanceType M5AD_24XLARGE = fromString("m5ad.24xlarge"); + + /** + * Static value m5ad.2xlarge for InstanceType. + */ + public static final InstanceType M5AD_2XLARGE = fromString("m5ad.2xlarge"); + + /** + * Static value m5ad.4xlarge for InstanceType. + */ + public static final InstanceType M5AD_4XLARGE = fromString("m5ad.4xlarge"); + + /** + * Static value m5ad.8xlarge for InstanceType. + */ + public static final InstanceType M5AD_8XLARGE = fromString("m5ad.8xlarge"); + + /** + * Static value m5ad.large for InstanceType. + */ + public static final InstanceType M5AD_LARGE = fromString("m5ad.large"); + + /** + * Static value m5ad.xlarge for InstanceType. + */ + public static final InstanceType M5AD_XLARGE = fromString("m5ad.xlarge"); + + /** + * Static value m5d.12xlarge for InstanceType. + */ + public static final InstanceType M5D_12XLARGE = fromString("m5d.12xlarge"); + + /** + * Static value m5d.16xlarge for InstanceType. + */ + public static final InstanceType M5D_16XLARGE = fromString("m5d.16xlarge"); + + /** + * Static value m5d.24xlarge for InstanceType. + */ + public static final InstanceType M5D_24XLARGE = fromString("m5d.24xlarge"); + + /** + * Static value m5d.2xlarge for InstanceType. + */ + public static final InstanceType M5D_2XLARGE = fromString("m5d.2xlarge"); + + /** + * Static value m5d.4xlarge for InstanceType. + */ + public static final InstanceType M5D_4XLARGE = fromString("m5d.4xlarge"); + + /** + * Static value m5d.8xlarge for InstanceType. + */ + public static final InstanceType M5D_8XLARGE = fromString("m5d.8xlarge"); + + /** + * Static value m5d.large for InstanceType. + */ + public static final InstanceType M5D_LARGE = fromString("m5d.large"); + + /** + * Static value m5d.metal for InstanceType. + */ + public static final InstanceType M5D_METAL = fromString("m5d.metal"); + + /** + * Static value m5d.xlarge for InstanceType. + */ + public static final InstanceType M5D_XLARGE = fromString("m5d.xlarge"); + + /** + * Static value m5dn.12xlarge for InstanceType. + */ + public static final InstanceType M5DN_12XLARGE = fromString("m5dn.12xlarge"); + + /** + * Static value m5dn.16xlarge for InstanceType. + */ + public static final InstanceType M5DN_16XLARGE = fromString("m5dn.16xlarge"); + + /** + * Static value m5dn.24xlarge for InstanceType. + */ + public static final InstanceType M5DN_24XLARGE = fromString("m5dn.24xlarge"); + + /** + * Static value m5dn.2xlarge for InstanceType. + */ + public static final InstanceType M5DN_2XLARGE = fromString("m5dn.2xlarge"); + + /** + * Static value m5dn.4xlarge for InstanceType. + */ + public static final InstanceType M5DN_4XLARGE = fromString("m5dn.4xlarge"); + + /** + * Static value m5dn.8xlarge for InstanceType. + */ + public static final InstanceType M5DN_8XLARGE = fromString("m5dn.8xlarge"); + + /** + * Static value m5dn.large for InstanceType. + */ + public static final InstanceType M5DN_LARGE = fromString("m5dn.large"); + + /** + * Static value m5dn.metal for InstanceType. + */ + public static final InstanceType M5DN_METAL = fromString("m5dn.metal"); + + /** + * Static value m5dn.xlarge for InstanceType. + */ + public static final InstanceType M5DN_XLARGE = fromString("m5dn.xlarge"); + + /** + * Static value m5n.12xlarge for InstanceType. + */ + public static final InstanceType M5N_12XLARGE = fromString("m5n.12xlarge"); + + /** + * Static value m5n.16xlarge for InstanceType. + */ + public static final InstanceType M5N_16XLARGE = fromString("m5n.16xlarge"); + + /** + * Static value m5n.24xlarge for InstanceType. + */ + public static final InstanceType M5N_24XLARGE = fromString("m5n.24xlarge"); + + /** + * Static value m5n.2xlarge for InstanceType. + */ + public static final InstanceType M5N_2XLARGE = fromString("m5n.2xlarge"); + + /** + * Static value m5n.4xlarge for InstanceType. + */ + public static final InstanceType M5N_4XLARGE = fromString("m5n.4xlarge"); + + /** + * Static value m5n.8xlarge for InstanceType. + */ + public static final InstanceType M5N_8XLARGE = fromString("m5n.8xlarge"); + + /** + * Static value m5n.large for InstanceType. + */ + public static final InstanceType M5N_LARGE = fromString("m5n.large"); + + /** + * Static value m5n.metal for InstanceType. + */ + public static final InstanceType M5N_METAL = fromString("m5n.metal"); + + /** + * Static value m5n.xlarge for InstanceType. + */ + public static final InstanceType M5N_XLARGE = fromString("m5n.xlarge"); + + /** + * Static value m5zn.12xlarge for InstanceType. + */ + public static final InstanceType M5ZN_12XLARGE = fromString("m5zn.12xlarge"); + + /** + * Static value m5zn.2xlarge for InstanceType. + */ + public static final InstanceType M5ZN_2XLARGE = fromString("m5zn.2xlarge"); + + /** + * Static value m5zn.3xlarge for InstanceType. + */ + public static final InstanceType M5ZN_3XLARGE = fromString("m5zn.3xlarge"); + + /** + * Static value m5zn.6xlarge for InstanceType. + */ + public static final InstanceType M5ZN_6XLARGE = fromString("m5zn.6xlarge"); + + /** + * Static value m5zn.large for InstanceType. + */ + public static final InstanceType M5ZN_LARGE = fromString("m5zn.large"); + + /** + * Static value m5zn.metal for InstanceType. + */ + public static final InstanceType M5ZN_METAL = fromString("m5zn.metal"); + + /** + * Static value m5zn.xlarge for InstanceType. + */ + public static final InstanceType M5ZN_XLARGE = fromString("m5zn.xlarge"); + + /** + * Static value m6a.12xlarge for InstanceType. + */ + public static final InstanceType M6A_12XLARGE = fromString("m6a.12xlarge"); + + /** + * Static value m6a.16xlarge for InstanceType. + */ + public static final InstanceType M6A_16XLARGE = fromString("m6a.16xlarge"); + + /** + * Static value m6a.24xlarge for InstanceType. + */ + public static final InstanceType M6A_24XLARGE = fromString("m6a.24xlarge"); + + /** + * Static value m6a.2xlarge for InstanceType. + */ + public static final InstanceType M6A_2XLARGE = fromString("m6a.2xlarge"); + + /** + * Static value m6a.32xlarge for InstanceType. + */ + public static final InstanceType M6A_32XLARGE = fromString("m6a.32xlarge"); + + /** + * Static value m6a.48xlarge for InstanceType. + */ + public static final InstanceType M6A_48XLARGE = fromString("m6a.48xlarge"); + + /** + * Static value m6a.4xlarge for InstanceType. + */ + public static final InstanceType M6A_4XLARGE = fromString("m6a.4xlarge"); + + /** + * Static value m6a.8xlarge for InstanceType. + */ + public static final InstanceType M6A_8XLARGE = fromString("m6a.8xlarge"); + + /** + * Static value m6a.large for InstanceType. + */ + public static final InstanceType M6A_LARGE = fromString("m6a.large"); + + /** + * Static value m6a.metal for InstanceType. + */ + public static final InstanceType M6A_METAL = fromString("m6a.metal"); + + /** + * Static value m6a.xlarge for InstanceType. + */ + public static final InstanceType M6A_XLARGE = fromString("m6a.xlarge"); + + /** + * Static value m6g.12xlarge for InstanceType. + */ + public static final InstanceType M6G_12XLARGE = fromString("m6g.12xlarge"); + + /** + * Static value m6g.16xlarge for InstanceType. + */ + public static final InstanceType M6G_16XLARGE = fromString("m6g.16xlarge"); + + /** + * Static value m6g.2xlarge for InstanceType. + */ + public static final InstanceType M6G_2XLARGE = fromString("m6g.2xlarge"); + + /** + * Static value m6g.4xlarge for InstanceType. + */ + public static final InstanceType M6G_4XLARGE = fromString("m6g.4xlarge"); + + /** + * Static value m6g.8xlarge for InstanceType. + */ + public static final InstanceType M6G_8XLARGE = fromString("m6g.8xlarge"); + + /** + * Static value m6g.large for InstanceType. + */ + public static final InstanceType M6G_LARGE = fromString("m6g.large"); + + /** + * Static value m6g.medium for InstanceType. + */ + public static final InstanceType M6G_MEDIUM = fromString("m6g.medium"); + + /** + * Static value m6g.metal for InstanceType. + */ + public static final InstanceType M6G_METAL = fromString("m6g.metal"); + + /** + * Static value m6g.xlarge for InstanceType. + */ + public static final InstanceType M6G_XLARGE = fromString("m6g.xlarge"); + + /** + * Static value m6gd.12xlarge for InstanceType. + */ + public static final InstanceType M6GD_12XLARGE = fromString("m6gd.12xlarge"); + + /** + * Static value m6gd.16xlarge for InstanceType. + */ + public static final InstanceType M6GD_16XLARGE = fromString("m6gd.16xlarge"); + + /** + * Static value m6gd.2xlarge for InstanceType. + */ + public static final InstanceType M6GD_2XLARGE = fromString("m6gd.2xlarge"); + + /** + * Static value m6gd.4xlarge for InstanceType. + */ + public static final InstanceType M6GD_4XLARGE = fromString("m6gd.4xlarge"); + + /** + * Static value m6gd.8xlarge for InstanceType. + */ + public static final InstanceType M6GD_8XLARGE = fromString("m6gd.8xlarge"); + + /** + * Static value m6gd.large for InstanceType. + */ + public static final InstanceType M6GD_LARGE = fromString("m6gd.large"); + + /** + * Static value m6gd.medium for InstanceType. + */ + public static final InstanceType M6GD_MEDIUM = fromString("m6gd.medium"); + + /** + * Static value m6gd.metal for InstanceType. + */ + public static final InstanceType M6GD_METAL = fromString("m6gd.metal"); + + /** + * Static value m6gd.xlarge for InstanceType. + */ + public static final InstanceType M6GD_XLARGE = fromString("m6gd.xlarge"); + + /** + * Static value m6i.12xlarge for InstanceType. + */ + public static final InstanceType M6I_12XLARGE = fromString("m6i.12xlarge"); + + /** + * Static value m6i.16xlarge for InstanceType. + */ + public static final InstanceType M6I_16XLARGE = fromString("m6i.16xlarge"); + + /** + * Static value m6i.24xlarge for InstanceType. + */ + public static final InstanceType M6I_24XLARGE = fromString("m6i.24xlarge"); + + /** + * Static value m6i.2xlarge for InstanceType. + */ + public static final InstanceType M6I_2XLARGE = fromString("m6i.2xlarge"); + + /** + * Static value m6i.32xlarge for InstanceType. + */ + public static final InstanceType M6I_32XLARGE = fromString("m6i.32xlarge"); + + /** + * Static value m6i.4xlarge for InstanceType. + */ + public static final InstanceType M6I_4XLARGE = fromString("m6i.4xlarge"); + + /** + * Static value m6i.8xlarge for InstanceType. + */ + public static final InstanceType M6I_8XLARGE = fromString("m6i.8xlarge"); + + /** + * Static value m6i.large for InstanceType. + */ + public static final InstanceType M6I_LARGE = fromString("m6i.large"); + + /** + * Static value m6i.metal for InstanceType. + */ + public static final InstanceType M6I_METAL = fromString("m6i.metal"); + + /** + * Static value m6i.xlarge for InstanceType. + */ + public static final InstanceType M6I_XLARGE = fromString("m6i.xlarge"); + + /** + * Static value m6id.12xlarge for InstanceType. + */ + public static final InstanceType M6ID_12XLARGE = fromString("m6id.12xlarge"); + + /** + * Static value m6id.16xlarge for InstanceType. + */ + public static final InstanceType M6ID_16XLARGE = fromString("m6id.16xlarge"); + + /** + * Static value m6id.24xlarge for InstanceType. + */ + public static final InstanceType M6ID_24XLARGE = fromString("m6id.24xlarge"); + + /** + * Static value m6id.2xlarge for InstanceType. + */ + public static final InstanceType M6ID_2XLARGE = fromString("m6id.2xlarge"); + + /** + * Static value m6id.32xlarge for InstanceType. + */ + public static final InstanceType M6ID_32XLARGE = fromString("m6id.32xlarge"); + + /** + * Static value m6id.4xlarge for InstanceType. + */ + public static final InstanceType M6ID_4XLARGE = fromString("m6id.4xlarge"); + + /** + * Static value m6id.8xlarge for InstanceType. + */ + public static final InstanceType M6ID_8XLARGE = fromString("m6id.8xlarge"); + + /** + * Static value m6id.large for InstanceType. + */ + public static final InstanceType M6ID_LARGE = fromString("m6id.large"); + + /** + * Static value m6id.metal for InstanceType. + */ + public static final InstanceType M6ID_METAL = fromString("m6id.metal"); + + /** + * Static value m6id.xlarge for InstanceType. + */ + public static final InstanceType M6ID_XLARGE = fromString("m6id.xlarge"); + + /** + * Static value m6idn.12xlarge for InstanceType. + */ + public static final InstanceType M6IDN_12XLARGE = fromString("m6idn.12xlarge"); + + /** + * Static value m6idn.16xlarge for InstanceType. + */ + public static final InstanceType M6IDN_16XLARGE = fromString("m6idn.16xlarge"); + + /** + * Static value m6idn.24xlarge for InstanceType. + */ + public static final InstanceType M6IDN_24XLARGE = fromString("m6idn.24xlarge"); + + /** + * Static value m6idn.2xlarge for InstanceType. + */ + public static final InstanceType M6IDN_2XLARGE = fromString("m6idn.2xlarge"); + + /** + * Static value m6idn.32xlarge for InstanceType. + */ + public static final InstanceType M6IDN_32XLARGE = fromString("m6idn.32xlarge"); + + /** + * Static value m6idn.4xlarge for InstanceType. + */ + public static final InstanceType M6IDN_4XLARGE = fromString("m6idn.4xlarge"); + + /** + * Static value m6idn.8xlarge for InstanceType. + */ + public static final InstanceType M6IDN_8XLARGE = fromString("m6idn.8xlarge"); + + /** + * Static value m6idn.large for InstanceType. + */ + public static final InstanceType M6IDN_LARGE = fromString("m6idn.large"); + + /** + * Static value m6idn.metal for InstanceType. + */ + public static final InstanceType M6IDN_METAL = fromString("m6idn.metal"); + + /** + * Static value m6idn.xlarge for InstanceType. + */ + public static final InstanceType M6IDN_XLARGE = fromString("m6idn.xlarge"); + + /** + * Static value m6in.12xlarge for InstanceType. + */ + public static final InstanceType M6IN_12XLARGE = fromString("m6in.12xlarge"); + + /** + * Static value m6in.16xlarge for InstanceType. + */ + public static final InstanceType M6IN_16XLARGE = fromString("m6in.16xlarge"); + + /** + * Static value m6in.24xlarge for InstanceType. + */ + public static final InstanceType M6IN_24XLARGE = fromString("m6in.24xlarge"); + + /** + * Static value m6in.2xlarge for InstanceType. + */ + public static final InstanceType M6IN_2XLARGE = fromString("m6in.2xlarge"); + + /** + * Static value m6in.32xlarge for InstanceType. + */ + public static final InstanceType M6IN_32XLARGE = fromString("m6in.32xlarge"); + + /** + * Static value m6in.4xlarge for InstanceType. + */ + public static final InstanceType M6IN_4XLARGE = fromString("m6in.4xlarge"); + + /** + * Static value m6in.8xlarge for InstanceType. + */ + public static final InstanceType M6IN_8XLARGE = fromString("m6in.8xlarge"); + + /** + * Static value m6in.large for InstanceType. + */ + public static final InstanceType M6IN_LARGE = fromString("m6in.large"); + + /** + * Static value m6in.metal for InstanceType. + */ + public static final InstanceType M6IN_METAL = fromString("m6in.metal"); + + /** + * Static value m6in.xlarge for InstanceType. + */ + public static final InstanceType M6IN_XLARGE = fromString("m6in.xlarge"); + + /** + * Static value m7a.12xlarge for InstanceType. + */ + public static final InstanceType M7A_12XLARGE = fromString("m7a.12xlarge"); + + /** + * Static value m7a.16xlarge for InstanceType. + */ + public static final InstanceType M7A_16XLARGE = fromString("m7a.16xlarge"); + + /** + * Static value m7a.24xlarge for InstanceType. + */ + public static final InstanceType M7A_24XLARGE = fromString("m7a.24xlarge"); + + /** + * Static value m7a.2xlarge for InstanceType. + */ + public static final InstanceType M7A_2XLARGE = fromString("m7a.2xlarge"); + + /** + * Static value m7a.32xlarge for InstanceType. + */ + public static final InstanceType M7A_32XLARGE = fromString("m7a.32xlarge"); + + /** + * Static value m7a.48xlarge for InstanceType. + */ + public static final InstanceType M7A_48XLARGE = fromString("m7a.48xlarge"); + + /** + * Static value m7a.4xlarge for InstanceType. + */ + public static final InstanceType M7A_4XLARGE = fromString("m7a.4xlarge"); + + /** + * Static value m7a.8xlarge for InstanceType. + */ + public static final InstanceType M7A_8XLARGE = fromString("m7a.8xlarge"); + + /** + * Static value m7a.large for InstanceType. + */ + public static final InstanceType M7A_LARGE = fromString("m7a.large"); + + /** + * Static value m7a.medium for InstanceType. + */ + public static final InstanceType M7A_MEDIUM = fromString("m7a.medium"); + + /** + * Static value m7a.metal-48xl for InstanceType. + */ + public static final InstanceType M7A_METAL_48XL = fromString("m7a.metal-48xl"); + + /** + * Static value m7a.xlarge for InstanceType. + */ + public static final InstanceType M7A_XLARGE = fromString("m7a.xlarge"); + + /** + * Static value m7g.12xlarge for InstanceType. + */ + public static final InstanceType M7G_12XLARGE = fromString("m7g.12xlarge"); + + /** + * Static value m7g.16xlarge for InstanceType. + */ + public static final InstanceType M7G_16XLARGE = fromString("m7g.16xlarge"); + + /** + * Static value m7g.2xlarge for InstanceType. + */ + public static final InstanceType M7G_2XLARGE = fromString("m7g.2xlarge"); + + /** + * Static value m7g.4xlarge for InstanceType. + */ + public static final InstanceType M7G_4XLARGE = fromString("m7g.4xlarge"); + + /** + * Static value m7g.8xlarge for InstanceType. + */ + public static final InstanceType M7G_8XLARGE = fromString("m7g.8xlarge"); + + /** + * Static value m7g.large for InstanceType. + */ + public static final InstanceType M7G_LARGE = fromString("m7g.large"); + + /** + * Static value m7g.medium for InstanceType. + */ + public static final InstanceType M7G_MEDIUM = fromString("m7g.medium"); + + /** + * Static value m7g.metal for InstanceType. + */ + public static final InstanceType M7G_METAL = fromString("m7g.metal"); + + /** + * Static value m7g.xlarge for InstanceType. + */ + public static final InstanceType M7G_XLARGE = fromString("m7g.xlarge"); + + /** + * Static value m7gd.12xlarge for InstanceType. + */ + public static final InstanceType M7GD_12XLARGE = fromString("m7gd.12xlarge"); + + /** + * Static value m7gd.16xlarge for InstanceType. + */ + public static final InstanceType M7GD_16XLARGE = fromString("m7gd.16xlarge"); + + /** + * Static value m7gd.2xlarge for InstanceType. + */ + public static final InstanceType M7GD_2XLARGE = fromString("m7gd.2xlarge"); + + /** + * Static value m7gd.4xlarge for InstanceType. + */ + public static final InstanceType M7GD_4XLARGE = fromString("m7gd.4xlarge"); + + /** + * Static value m7gd.8xlarge for InstanceType. + */ + public static final InstanceType M7GD_8XLARGE = fromString("m7gd.8xlarge"); + + /** + * Static value m7gd.large for InstanceType. + */ + public static final InstanceType M7GD_LARGE = fromString("m7gd.large"); + + /** + * Static value m7gd.medium for InstanceType. + */ + public static final InstanceType M7GD_MEDIUM = fromString("m7gd.medium"); + + /** + * Static value m7gd.metal for InstanceType. + */ + public static final InstanceType M7GD_METAL = fromString("m7gd.metal"); + + /** + * Static value m7gd.xlarge for InstanceType. + */ + public static final InstanceType M7GD_XLARGE = fromString("m7gd.xlarge"); + + /** + * Static value m7i-flex.2xlarge for InstanceType. + */ + public static final InstanceType M7I_FLEX_2XLARGE = fromString("m7i-flex.2xlarge"); + + /** + * Static value m7i-flex.4xlarge for InstanceType. + */ + public static final InstanceType M7I_FLEX_4XLARGE = fromString("m7i-flex.4xlarge"); + + /** + * Static value m7i-flex.8xlarge for InstanceType. + */ + public static final InstanceType M7I_FLEX_8XLARGE = fromString("m7i-flex.8xlarge"); + + /** + * Static value m7i-flex.large for InstanceType. + */ + public static final InstanceType M7I_FLEX_LARGE = fromString("m7i-flex.large"); + + /** + * Static value m7i-flex.xlarge for InstanceType. + */ + public static final InstanceType M7I_FLEX_XLARGE = fromString("m7i-flex.xlarge"); + + /** + * Static value m7i.12xlarge for InstanceType. + */ + public static final InstanceType M7I_12XLARGE = fromString("m7i.12xlarge"); + + /** + * Static value m7i.16xlarge for InstanceType. + */ + public static final InstanceType M7I_16XLARGE = fromString("m7i.16xlarge"); + + /** + * Static value m7i.24xlarge for InstanceType. + */ + public static final InstanceType M7I_24XLARGE = fromString("m7i.24xlarge"); + + /** + * Static value m7i.2xlarge for InstanceType. + */ + public static final InstanceType M7I_2XLARGE = fromString("m7i.2xlarge"); + + /** + * Static value m7i.48xlarge for InstanceType. + */ + public static final InstanceType M7I_48XLARGE = fromString("m7i.48xlarge"); + + /** + * Static value m7i.4xlarge for InstanceType. + */ + public static final InstanceType M7I_4XLARGE = fromString("m7i.4xlarge"); + + /** + * Static value m7i.8xlarge for InstanceType. + */ + public static final InstanceType M7I_8XLARGE = fromString("m7i.8xlarge"); + + /** + * Static value m7i.large for InstanceType. + */ + public static final InstanceType M7I_LARGE = fromString("m7i.large"); + + /** + * Static value m7i.metal-24xl for InstanceType. + */ + public static final InstanceType M7I_METAL_24XL = fromString("m7i.metal-24xl"); + + /** + * Static value m7i.metal-48xl for InstanceType. + */ + public static final InstanceType M7I_METAL_48XL = fromString("m7i.metal-48xl"); + + /** + * Static value m7i.xlarge for InstanceType. + */ + public static final InstanceType M7I_XLARGE = fromString("m7i.xlarge"); + + /** + * Static value mac1.metal for InstanceType. + */ + public static final InstanceType MAC1_METAL = fromString("mac1.metal"); + + /** + * Static value mac2-m2.metal for InstanceType. + */ + public static final InstanceType MAC2_M2_METAL = fromString("mac2-m2.metal"); + + /** + * Static value mac2-m2pro.metal for InstanceType. + */ + public static final InstanceType MAC2_M2PRO_METAL = fromString("mac2-m2pro.metal"); + + /** + * Static value mac2.metal for InstanceType. + */ + public static final InstanceType MAC2_METAL = fromString("mac2.metal"); + + /** + * Static value p2.16xlarge for InstanceType. + */ + public static final InstanceType P2_16XLARGE = fromString("p2.16xlarge"); + + /** + * Static value p2.8xlarge for InstanceType. + */ + public static final InstanceType P2_8XLARGE = fromString("p2.8xlarge"); + + /** + * Static value p2.xlarge for InstanceType. + */ + public static final InstanceType P2_XLARGE = fromString("p2.xlarge"); + + /** + * Static value p3.16xlarge for InstanceType. + */ + public static final InstanceType P3_16XLARGE = fromString("p3.16xlarge"); + + /** + * Static value p3.2xlarge for InstanceType. + */ + public static final InstanceType P3_2XLARGE = fromString("p3.2xlarge"); + + /** + * Static value p3.8xlarge for InstanceType. + */ + public static final InstanceType P3_8XLARGE = fromString("p3.8xlarge"); + + /** + * Static value p3dn.24xlarge for InstanceType. + */ + public static final InstanceType P3DN_24XLARGE = fromString("p3dn.24xlarge"); + + /** + * Static value p4d.24xlarge for InstanceType. + */ + public static final InstanceType P4D_24XLARGE = fromString("p4d.24xlarge"); + + /** + * Static value p4de.24xlarge for InstanceType. + */ + public static final InstanceType P4DE_24XLARGE = fromString("p4de.24xlarge"); + + /** + * Static value p5.48xlarge for InstanceType. + */ + public static final InstanceType P5_48XLARGE = fromString("p5.48xlarge"); + + /** + * Static value r3.2xlarge for InstanceType. + */ + public static final InstanceType R3_2XLARGE = fromString("r3.2xlarge"); + + /** + * Static value r3.4xlarge for InstanceType. + */ + public static final InstanceType R3_4XLARGE = fromString("r3.4xlarge"); + + /** + * Static value r3.8xlarge for InstanceType. + */ + public static final InstanceType R3_8XLARGE = fromString("r3.8xlarge"); + + /** + * Static value r3.large for InstanceType. + */ + public static final InstanceType R3_LARGE = fromString("r3.large"); + + /** + * Static value r3.xlarge for InstanceType. + */ + public static final InstanceType R3_XLARGE = fromString("r3.xlarge"); + + /** + * Static value r4.16xlarge for InstanceType. + */ + public static final InstanceType R4_16XLARGE = fromString("r4.16xlarge"); + + /** + * Static value r4.2xlarge for InstanceType. + */ + public static final InstanceType R4_2XLARGE = fromString("r4.2xlarge"); + + /** + * Static value r4.4xlarge for InstanceType. + */ + public static final InstanceType R4_4XLARGE = fromString("r4.4xlarge"); + + /** + * Static value r4.8xlarge for InstanceType. + */ + public static final InstanceType R4_8XLARGE = fromString("r4.8xlarge"); + + /** + * Static value r4.large for InstanceType. + */ + public static final InstanceType R4_LARGE = fromString("r4.large"); + + /** + * Static value r4.xlarge for InstanceType. + */ + public static final InstanceType R4_XLARGE = fromString("r4.xlarge"); + + /** + * Static value r5.12xlarge for InstanceType. + */ + public static final InstanceType R5_12XLARGE = fromString("r5.12xlarge"); + + /** + * Static value r5.16xlarge for InstanceType. + */ + public static final InstanceType R5_16XLARGE = fromString("r5.16xlarge"); + + /** + * Static value r5.24xlarge for InstanceType. + */ + public static final InstanceType R5_24XLARGE = fromString("r5.24xlarge"); + + /** + * Static value r5.2xlarge for InstanceType. + */ + public static final InstanceType R5_2XLARGE = fromString("r5.2xlarge"); + + /** + * Static value r5.4xlarge for InstanceType. + */ + public static final InstanceType R5_4XLARGE = fromString("r5.4xlarge"); + + /** + * Static value r5.8xlarge for InstanceType. + */ + public static final InstanceType R5_8XLARGE = fromString("r5.8xlarge"); + + /** + * Static value r5.large for InstanceType. + */ + public static final InstanceType R5_LARGE = fromString("r5.large"); + + /** + * Static value r5.metal for InstanceType. + */ + public static final InstanceType R5_METAL = fromString("r5.metal"); + + /** + * Static value r5.xlarge for InstanceType. + */ + public static final InstanceType R5_XLARGE = fromString("r5.xlarge"); + + /** + * Static value r5a.12xlarge for InstanceType. + */ + public static final InstanceType R5A_12XLARGE = fromString("r5a.12xlarge"); + + /** + * Static value r5a.16xlarge for InstanceType. + */ + public static final InstanceType R5A_16XLARGE = fromString("r5a.16xlarge"); + + /** + * Static value r5a.24xlarge for InstanceType. + */ + public static final InstanceType R5A_24XLARGE = fromString("r5a.24xlarge"); + + /** + * Static value r5a.2xlarge for InstanceType. + */ + public static final InstanceType R5A_2XLARGE = fromString("r5a.2xlarge"); + + /** + * Static value r5a.4xlarge for InstanceType. + */ + public static final InstanceType R5A_4XLARGE = fromString("r5a.4xlarge"); + + /** + * Static value r5a.8xlarge for InstanceType. + */ + public static final InstanceType R5A_8XLARGE = fromString("r5a.8xlarge"); + + /** + * Static value r5a.large for InstanceType. + */ + public static final InstanceType R5A_LARGE = fromString("r5a.large"); + + /** + * Static value r5a.xlarge for InstanceType. + */ + public static final InstanceType R5A_XLARGE = fromString("r5a.xlarge"); + + /** + * Static value r5ad.12xlarge for InstanceType. + */ + public static final InstanceType R5AD_12XLARGE = fromString("r5ad.12xlarge"); + + /** + * Static value r5ad.16xlarge for InstanceType. + */ + public static final InstanceType R5AD_16XLARGE = fromString("r5ad.16xlarge"); + + /** + * Static value r5ad.24xlarge for InstanceType. + */ + public static final InstanceType R5AD_24XLARGE = fromString("r5ad.24xlarge"); + + /** + * Static value r5ad.2xlarge for InstanceType. + */ + public static final InstanceType R5AD_2XLARGE = fromString("r5ad.2xlarge"); + + /** + * Static value r5ad.4xlarge for InstanceType. + */ + public static final InstanceType R5AD_4XLARGE = fromString("r5ad.4xlarge"); + + /** + * Static value r5ad.8xlarge for InstanceType. + */ + public static final InstanceType R5AD_8XLARGE = fromString("r5ad.8xlarge"); + + /** + * Static value r5ad.large for InstanceType. + */ + public static final InstanceType R5AD_LARGE = fromString("r5ad.large"); + + /** + * Static value r5ad.xlarge for InstanceType. + */ + public static final InstanceType R5AD_XLARGE = fromString("r5ad.xlarge"); + + /** + * Static value r5b.12xlarge for InstanceType. + */ + public static final InstanceType R5B_12XLARGE = fromString("r5b.12xlarge"); + + /** + * Static value r5b.16xlarge for InstanceType. + */ + public static final InstanceType R5B_16XLARGE = fromString("r5b.16xlarge"); + + /** + * Static value r5b.24xlarge for InstanceType. + */ + public static final InstanceType R5B_24XLARGE = fromString("r5b.24xlarge"); + + /** + * Static value r5b.2xlarge for InstanceType. + */ + public static final InstanceType R5B_2XLARGE = fromString("r5b.2xlarge"); + + /** + * Static value r5b.4xlarge for InstanceType. + */ + public static final InstanceType R5B_4XLARGE = fromString("r5b.4xlarge"); + + /** + * Static value r5b.8xlarge for InstanceType. + */ + public static final InstanceType R5B_8XLARGE = fromString("r5b.8xlarge"); + + /** + * Static value r5b.large for InstanceType. + */ + public static final InstanceType R5B_LARGE = fromString("r5b.large"); + + /** + * Static value r5b.metal for InstanceType. + */ + public static final InstanceType R5B_METAL = fromString("r5b.metal"); + + /** + * Static value r5b.xlarge for InstanceType. + */ + public static final InstanceType R5B_XLARGE = fromString("r5b.xlarge"); + + /** + * Static value r5d.12xlarge for InstanceType. + */ + public static final InstanceType R5D_12XLARGE = fromString("r5d.12xlarge"); + + /** + * Static value r5d.16xlarge for InstanceType. + */ + public static final InstanceType R5D_16XLARGE = fromString("r5d.16xlarge"); + + /** + * Static value r5d.24xlarge for InstanceType. + */ + public static final InstanceType R5D_24XLARGE = fromString("r5d.24xlarge"); + + /** + * Static value r5d.2xlarge for InstanceType. + */ + public static final InstanceType R5D_2XLARGE = fromString("r5d.2xlarge"); + + /** + * Static value r5d.4xlarge for InstanceType. + */ + public static final InstanceType R5D_4XLARGE = fromString("r5d.4xlarge"); + + /** + * Static value r5d.8xlarge for InstanceType. + */ + public static final InstanceType R5D_8XLARGE = fromString("r5d.8xlarge"); + + /** + * Static value r5d.large for InstanceType. + */ + public static final InstanceType R5D_LARGE = fromString("r5d.large"); + + /** + * Static value r5d.metal for InstanceType. + */ + public static final InstanceType R5D_METAL = fromString("r5d.metal"); + + /** + * Static value r5d.xlarge for InstanceType. + */ + public static final InstanceType R5D_XLARGE = fromString("r5d.xlarge"); + + /** + * Static value r5dn.12xlarge for InstanceType. + */ + public static final InstanceType R5DN_12XLARGE = fromString("r5dn.12xlarge"); + + /** + * Static value r5dn.16xlarge for InstanceType. + */ + public static final InstanceType R5DN_16XLARGE = fromString("r5dn.16xlarge"); + + /** + * Static value r5dn.24xlarge for InstanceType. + */ + public static final InstanceType R5DN_24XLARGE = fromString("r5dn.24xlarge"); + + /** + * Static value r5dn.2xlarge for InstanceType. + */ + public static final InstanceType R5DN_2XLARGE = fromString("r5dn.2xlarge"); + + /** + * Static value r5dn.4xlarge for InstanceType. + */ + public static final InstanceType R5DN_4XLARGE = fromString("r5dn.4xlarge"); + + /** + * Static value r5dn.8xlarge for InstanceType. + */ + public static final InstanceType R5DN_8XLARGE = fromString("r5dn.8xlarge"); + + /** + * Static value r5dn.large for InstanceType. + */ + public static final InstanceType R5DN_LARGE = fromString("r5dn.large"); + + /** + * Static value r5dn.metal for InstanceType. + */ + public static final InstanceType R5DN_METAL = fromString("r5dn.metal"); + + /** + * Static value r5dn.xlarge for InstanceType. + */ + public static final InstanceType R5DN_XLARGE = fromString("r5dn.xlarge"); + + /** + * Static value r5n.12xlarge for InstanceType. + */ + public static final InstanceType R5N_12XLARGE = fromString("r5n.12xlarge"); + + /** + * Static value r5n.16xlarge for InstanceType. + */ + public static final InstanceType R5N_16XLARGE = fromString("r5n.16xlarge"); + + /** + * Static value r5n.24xlarge for InstanceType. + */ + public static final InstanceType R5N_24XLARGE = fromString("r5n.24xlarge"); + + /** + * Static value r5n.2xlarge for InstanceType. + */ + public static final InstanceType R5N_2XLARGE = fromString("r5n.2xlarge"); + + /** + * Static value r5n.4xlarge for InstanceType. + */ + public static final InstanceType R5N_4XLARGE = fromString("r5n.4xlarge"); + + /** + * Static value r5n.8xlarge for InstanceType. + */ + public static final InstanceType R5N_8XLARGE = fromString("r5n.8xlarge"); + + /** + * Static value r5n.large for InstanceType. + */ + public static final InstanceType R5N_LARGE = fromString("r5n.large"); + + /** + * Static value r5n.metal for InstanceType. + */ + public static final InstanceType R5N_METAL = fromString("r5n.metal"); + + /** + * Static value r5n.xlarge for InstanceType. + */ + public static final InstanceType R5N_XLARGE = fromString("r5n.xlarge"); + + /** + * Static value r6a.12xlarge for InstanceType. + */ + public static final InstanceType R6A_12XLARGE = fromString("r6a.12xlarge"); + + /** + * Static value r6a.16xlarge for InstanceType. + */ + public static final InstanceType R6A_16XLARGE = fromString("r6a.16xlarge"); + + /** + * Static value r6a.24xlarge for InstanceType. + */ + public static final InstanceType R6A_24XLARGE = fromString("r6a.24xlarge"); + + /** + * Static value r6a.2xlarge for InstanceType. + */ + public static final InstanceType R6A_2XLARGE = fromString("r6a.2xlarge"); + + /** + * Static value r6a.32xlarge for InstanceType. + */ + public static final InstanceType R6A_32XLARGE = fromString("r6a.32xlarge"); + + /** + * Static value r6a.48xlarge for InstanceType. + */ + public static final InstanceType R6A_48XLARGE = fromString("r6a.48xlarge"); + + /** + * Static value r6a.4xlarge for InstanceType. + */ + public static final InstanceType R6A_4XLARGE = fromString("r6a.4xlarge"); + + /** + * Static value r6a.8xlarge for InstanceType. + */ + public static final InstanceType R6A_8XLARGE = fromString("r6a.8xlarge"); + + /** + * Static value r6a.large for InstanceType. + */ + public static final InstanceType R6A_LARGE = fromString("r6a.large"); + + /** + * Static value r6a.metal for InstanceType. + */ + public static final InstanceType R6A_METAL = fromString("r6a.metal"); + + /** + * Static value r6a.xlarge for InstanceType. + */ + public static final InstanceType R6A_XLARGE = fromString("r6a.xlarge"); + + /** + * Static value r6g.12xlarge for InstanceType. + */ + public static final InstanceType R6G_12XLARGE = fromString("r6g.12xlarge"); + + /** + * Static value r6g.16xlarge for InstanceType. + */ + public static final InstanceType R6G_16XLARGE = fromString("r6g.16xlarge"); + + /** + * Static value r6g.2xlarge for InstanceType. + */ + public static final InstanceType R6G_2XLARGE = fromString("r6g.2xlarge"); + + /** + * Static value r6g.4xlarge for InstanceType. + */ + public static final InstanceType R6G_4XLARGE = fromString("r6g.4xlarge"); + + /** + * Static value r6g.8xlarge for InstanceType. + */ + public static final InstanceType R6G_8XLARGE = fromString("r6g.8xlarge"); + + /** + * Static value r6g.large for InstanceType. + */ + public static final InstanceType R6G_LARGE = fromString("r6g.large"); + + /** + * Static value r6g.medium for InstanceType. + */ + public static final InstanceType R6G_MEDIUM = fromString("r6g.medium"); + + /** + * Static value r6g.metal for InstanceType. + */ + public static final InstanceType R6G_METAL = fromString("r6g.metal"); + + /** + * Static value r6g.xlarge for InstanceType. + */ + public static final InstanceType R6G_XLARGE = fromString("r6g.xlarge"); + + /** + * Static value r6gd.12xlarge for InstanceType. + */ + public static final InstanceType R6GD_12XLARGE = fromString("r6gd.12xlarge"); + + /** + * Static value r6gd.16xlarge for InstanceType. + */ + public static final InstanceType R6GD_16XLARGE = fromString("r6gd.16xlarge"); + + /** + * Static value r6gd.2xlarge for InstanceType. + */ + public static final InstanceType R6GD_2XLARGE = fromString("r6gd.2xlarge"); + + /** + * Static value r6gd.4xlarge for InstanceType. + */ + public static final InstanceType R6GD_4XLARGE = fromString("r6gd.4xlarge"); + + /** + * Static value r6gd.8xlarge for InstanceType. + */ + public static final InstanceType R6GD_8XLARGE = fromString("r6gd.8xlarge"); + + /** + * Static value r6gd.large for InstanceType. + */ + public static final InstanceType R6GD_LARGE = fromString("r6gd.large"); + + /** + * Static value r6gd.medium for InstanceType. + */ + public static final InstanceType R6GD_MEDIUM = fromString("r6gd.medium"); + + /** + * Static value r6gd.metal for InstanceType. + */ + public static final InstanceType R6GD_METAL = fromString("r6gd.metal"); + + /** + * Static value r6gd.xlarge for InstanceType. + */ + public static final InstanceType R6GD_XLARGE = fromString("r6gd.xlarge"); + + /** + * Static value r6i.12xlarge for InstanceType. + */ + public static final InstanceType R6I_12XLARGE = fromString("r6i.12xlarge"); + + /** + * Static value r6i.16xlarge for InstanceType. + */ + public static final InstanceType R6I_16XLARGE = fromString("r6i.16xlarge"); + + /** + * Static value r6i.24xlarge for InstanceType. + */ + public static final InstanceType R6I_24XLARGE = fromString("r6i.24xlarge"); + + /** + * Static value r6i.2xlarge for InstanceType. + */ + public static final InstanceType R6I_2XLARGE = fromString("r6i.2xlarge"); + + /** + * Static value r6i.32xlarge for InstanceType. + */ + public static final InstanceType R6I_32XLARGE = fromString("r6i.32xlarge"); + + /** + * Static value r6i.4xlarge for InstanceType. + */ + public static final InstanceType R6I_4XLARGE = fromString("r6i.4xlarge"); + + /** + * Static value r6i.8xlarge for InstanceType. + */ + public static final InstanceType R6I_8XLARGE = fromString("r6i.8xlarge"); + + /** + * Static value r6i.large for InstanceType. + */ + public static final InstanceType R6I_LARGE = fromString("r6i.large"); + + /** + * Static value r6i.metal for InstanceType. + */ + public static final InstanceType R6I_METAL = fromString("r6i.metal"); + + /** + * Static value r6i.xlarge for InstanceType. + */ + public static final InstanceType R6I_XLARGE = fromString("r6i.xlarge"); + + /** + * Static value r6id.12xlarge for InstanceType. + */ + public static final InstanceType R6ID_12XLARGE = fromString("r6id.12xlarge"); + + /** + * Static value r6id.16xlarge for InstanceType. + */ + public static final InstanceType R6ID_16XLARGE = fromString("r6id.16xlarge"); + + /** + * Static value r6id.24xlarge for InstanceType. + */ + public static final InstanceType R6ID_24XLARGE = fromString("r6id.24xlarge"); + + /** + * Static value r6id.2xlarge for InstanceType. + */ + public static final InstanceType R6ID_2XLARGE = fromString("r6id.2xlarge"); + + /** + * Static value r6id.32xlarge for InstanceType. + */ + public static final InstanceType R6ID_32XLARGE = fromString("r6id.32xlarge"); + + /** + * Static value r6id.4xlarge for InstanceType. + */ + public static final InstanceType R6ID_4XLARGE = fromString("r6id.4xlarge"); + + /** + * Static value r6id.8xlarge for InstanceType. + */ + public static final InstanceType R6ID_8XLARGE = fromString("r6id.8xlarge"); + + /** + * Static value r6id.large for InstanceType. + */ + public static final InstanceType R6ID_LARGE = fromString("r6id.large"); + + /** + * Static value r6id.metal for InstanceType. + */ + public static final InstanceType R6ID_METAL = fromString("r6id.metal"); + + /** + * Static value r6id.xlarge for InstanceType. + */ + public static final InstanceType R6ID_XLARGE = fromString("r6id.xlarge"); + + /** + * Static value r6idn.12xlarge for InstanceType. + */ + public static final InstanceType R6IDN_12XLARGE = fromString("r6idn.12xlarge"); + + /** + * Static value r6idn.16xlarge for InstanceType. + */ + public static final InstanceType R6IDN_16XLARGE = fromString("r6idn.16xlarge"); + + /** + * Static value r6idn.24xlarge for InstanceType. + */ + public static final InstanceType R6IDN_24XLARGE = fromString("r6idn.24xlarge"); + + /** + * Static value r6idn.2xlarge for InstanceType. + */ + public static final InstanceType R6IDN_2XLARGE = fromString("r6idn.2xlarge"); + + /** + * Static value r6idn.32xlarge for InstanceType. + */ + public static final InstanceType R6IDN_32XLARGE = fromString("r6idn.32xlarge"); + + /** + * Static value r6idn.4xlarge for InstanceType. + */ + public static final InstanceType R6IDN_4XLARGE = fromString("r6idn.4xlarge"); + + /** + * Static value r6idn.8xlarge for InstanceType. + */ + public static final InstanceType R6IDN_8XLARGE = fromString("r6idn.8xlarge"); + + /** + * Static value r6idn.large for InstanceType. + */ + public static final InstanceType R6IDN_LARGE = fromString("r6idn.large"); + + /** + * Static value r6idn.metal for InstanceType. + */ + public static final InstanceType R6IDN_METAL = fromString("r6idn.metal"); + + /** + * Static value r6idn.xlarge for InstanceType. + */ + public static final InstanceType R6IDN_XLARGE = fromString("r6idn.xlarge"); + + /** + * Static value r6in.12xlarge for InstanceType. + */ + public static final InstanceType R6IN_12XLARGE = fromString("r6in.12xlarge"); + + /** + * Static value r6in.16xlarge for InstanceType. + */ + public static final InstanceType R6IN_16XLARGE = fromString("r6in.16xlarge"); + + /** + * Static value r6in.24xlarge for InstanceType. + */ + public static final InstanceType R6IN_24XLARGE = fromString("r6in.24xlarge"); + + /** + * Static value r6in.2xlarge for InstanceType. + */ + public static final InstanceType R6IN_2XLARGE = fromString("r6in.2xlarge"); + + /** + * Static value r6in.32xlarge for InstanceType. + */ + public static final InstanceType R6IN_32XLARGE = fromString("r6in.32xlarge"); + + /** + * Static value r6in.4xlarge for InstanceType. + */ + public static final InstanceType R6IN_4XLARGE = fromString("r6in.4xlarge"); + + /** + * Static value r6in.8xlarge for InstanceType. + */ + public static final InstanceType R6IN_8XLARGE = fromString("r6in.8xlarge"); + + /** + * Static value r6in.large for InstanceType. + */ + public static final InstanceType R6IN_LARGE = fromString("r6in.large"); + + /** + * Static value r6in.metal for InstanceType. + */ + public static final InstanceType R6IN_METAL = fromString("r6in.metal"); + + /** + * Static value r6in.xlarge for InstanceType. + */ + public static final InstanceType R6IN_XLARGE = fromString("r6in.xlarge"); + + /** + * Static value r7a.12xlarge for InstanceType. + */ + public static final InstanceType R7A_12XLARGE = fromString("r7a.12xlarge"); + + /** + * Static value r7a.16xlarge for InstanceType. + */ + public static final InstanceType R7A_16XLARGE = fromString("r7a.16xlarge"); + + /** + * Static value r7a.24xlarge for InstanceType. + */ + public static final InstanceType R7A_24XLARGE = fromString("r7a.24xlarge"); + + /** + * Static value r7a.2xlarge for InstanceType. + */ + public static final InstanceType R7A_2XLARGE = fromString("r7a.2xlarge"); + + /** + * Static value r7a.32xlarge for InstanceType. + */ + public static final InstanceType R7A_32XLARGE = fromString("r7a.32xlarge"); + + /** + * Static value r7a.48xlarge for InstanceType. + */ + public static final InstanceType R7A_48XLARGE = fromString("r7a.48xlarge"); + + /** + * Static value r7a.4xlarge for InstanceType. + */ + public static final InstanceType R7A_4XLARGE = fromString("r7a.4xlarge"); + + /** + * Static value r7a.8xlarge for InstanceType. + */ + public static final InstanceType R7A_8XLARGE = fromString("r7a.8xlarge"); + + /** + * Static value r7a.large for InstanceType. + */ + public static final InstanceType R7A_LARGE = fromString("r7a.large"); + + /** + * Static value r7a.medium for InstanceType. + */ + public static final InstanceType R7A_MEDIUM = fromString("r7a.medium"); + + /** + * Static value r7a.metal-48xl for InstanceType. + */ + public static final InstanceType R7A_METAL_48XL = fromString("r7a.metal-48xl"); + + /** + * Static value r7a.xlarge for InstanceType. + */ + public static final InstanceType R7A_XLARGE = fromString("r7a.xlarge"); + + /** + * Static value r7g.12xlarge for InstanceType. + */ + public static final InstanceType R7G_12XLARGE = fromString("r7g.12xlarge"); + + /** + * Static value r7g.16xlarge for InstanceType. + */ + public static final InstanceType R7G_16XLARGE = fromString("r7g.16xlarge"); + + /** + * Static value r7g.2xlarge for InstanceType. + */ + public static final InstanceType R7G_2XLARGE = fromString("r7g.2xlarge"); + + /** + * Static value r7g.4xlarge for InstanceType. + */ + public static final InstanceType R7G_4XLARGE = fromString("r7g.4xlarge"); + + /** + * Static value r7g.8xlarge for InstanceType. + */ + public static final InstanceType R7G_8XLARGE = fromString("r7g.8xlarge"); + + /** + * Static value r7g.large for InstanceType. + */ + public static final InstanceType R7G_LARGE = fromString("r7g.large"); + + /** + * Static value r7g.medium for InstanceType. + */ + public static final InstanceType R7G_MEDIUM = fromString("r7g.medium"); + + /** + * Static value r7g.metal for InstanceType. + */ + public static final InstanceType R7G_METAL = fromString("r7g.metal"); + + /** + * Static value r7g.xlarge for InstanceType. + */ + public static final InstanceType R7G_XLARGE = fromString("r7g.xlarge"); + + /** + * Static value r7gd.12xlarge for InstanceType. + */ + public static final InstanceType R7GD_12XLARGE = fromString("r7gd.12xlarge"); + + /** + * Static value r7gd.16xlarge for InstanceType. + */ + public static final InstanceType R7GD_16XLARGE = fromString("r7gd.16xlarge"); + + /** + * Static value r7gd.2xlarge for InstanceType. + */ + public static final InstanceType R7GD_2XLARGE = fromString("r7gd.2xlarge"); + + /** + * Static value r7gd.4xlarge for InstanceType. + */ + public static final InstanceType R7GD_4XLARGE = fromString("r7gd.4xlarge"); + + /** + * Static value r7gd.8xlarge for InstanceType. + */ + public static final InstanceType R7GD_8XLARGE = fromString("r7gd.8xlarge"); + + /** + * Static value r7gd.large for InstanceType. + */ + public static final InstanceType R7GD_LARGE = fromString("r7gd.large"); + + /** + * Static value r7gd.medium for InstanceType. + */ + public static final InstanceType R7GD_MEDIUM = fromString("r7gd.medium"); + + /** + * Static value r7gd.metal for InstanceType. + */ + public static final InstanceType R7GD_METAL = fromString("r7gd.metal"); + + /** + * Static value r7gd.xlarge for InstanceType. + */ + public static final InstanceType R7GD_XLARGE = fromString("r7gd.xlarge"); + + /** + * Static value r7i.12xlarge for InstanceType. + */ + public static final InstanceType R7I_12XLARGE = fromString("r7i.12xlarge"); + + /** + * Static value r7i.16xlarge for InstanceType. + */ + public static final InstanceType R7I_16XLARGE = fromString("r7i.16xlarge"); + + /** + * Static value r7i.24xlarge for InstanceType. + */ + public static final InstanceType R7I_24XLARGE = fromString("r7i.24xlarge"); + + /** + * Static value r7i.2xlarge for InstanceType. + */ + public static final InstanceType R7I_2XLARGE = fromString("r7i.2xlarge"); + + /** + * Static value r7i.48xlarge for InstanceType. + */ + public static final InstanceType R7I_48XLARGE = fromString("r7i.48xlarge"); + + /** + * Static value r7i.4xlarge for InstanceType. + */ + public static final InstanceType R7I_4XLARGE = fromString("r7i.4xlarge"); + + /** + * Static value r7i.8xlarge for InstanceType. + */ + public static final InstanceType R7I_8XLARGE = fromString("r7i.8xlarge"); + + /** + * Static value r7i.large for InstanceType. + */ + public static final InstanceType R7I_LARGE = fromString("r7i.large"); + + /** + * Static value r7i.metal-24xl for InstanceType. + */ + public static final InstanceType R7I_METAL_24XL = fromString("r7i.metal-24xl"); + + /** + * Static value r7i.metal-48xl for InstanceType. + */ + public static final InstanceType R7I_METAL_48XL = fromString("r7i.metal-48xl"); + + /** + * Static value r7i.xlarge for InstanceType. + */ + public static final InstanceType R7I_XLARGE = fromString("r7i.xlarge"); + + /** + * Static value r7iz.12xlarge for InstanceType. + */ + public static final InstanceType R7IZ_12XLARGE = fromString("r7iz.12xlarge"); + + /** + * Static value r7iz.16xlarge for InstanceType. + */ + public static final InstanceType R7IZ_16XLARGE = fromString("r7iz.16xlarge"); + + /** + * Static value r7iz.2xlarge for InstanceType. + */ + public static final InstanceType R7IZ_2XLARGE = fromString("r7iz.2xlarge"); + + /** + * Static value r7iz.32xlarge for InstanceType. + */ + public static final InstanceType R7IZ_32XLARGE = fromString("r7iz.32xlarge"); + + /** + * Static value r7iz.4xlarge for InstanceType. + */ + public static final InstanceType R7IZ_4XLARGE = fromString("r7iz.4xlarge"); + + /** + * Static value r7iz.8xlarge for InstanceType. + */ + public static final InstanceType R7IZ_8XLARGE = fromString("r7iz.8xlarge"); + + /** + * Static value r7iz.large for InstanceType. + */ + public static final InstanceType R7IZ_LARGE = fromString("r7iz.large"); + + /** + * Static value r7iz.metal-16xl for InstanceType. + */ + public static final InstanceType R7IZ_METAL_16XL = fromString("r7iz.metal-16xl"); + + /** + * Static value r7iz.metal-32xl for InstanceType. + */ + public static final InstanceType R7IZ_METAL_32XL = fromString("r7iz.metal-32xl"); + + /** + * Static value r7iz.xlarge for InstanceType. + */ + public static final InstanceType R7IZ_XLARGE = fromString("r7iz.xlarge"); + + /** + * Static value t1.micro for InstanceType. + */ + public static final InstanceType T1_MICRO = fromString("t1.micro"); + + /** + * Static value t2.2xlarge for InstanceType. + */ + public static final InstanceType T2_2XLARGE = fromString("t2.2xlarge"); + + /** + * Static value t2.large for InstanceType. + */ + public static final InstanceType T2_LARGE = fromString("t2.large"); + + /** + * Static value t2.medium for InstanceType. + */ + public static final InstanceType T2_MEDIUM = fromString("t2.medium"); + + /** + * Static value t2.micro for InstanceType. + */ + public static final InstanceType T2_MICRO = fromString("t2.micro"); + + /** + * Static value t2.nano for InstanceType. + */ + public static final InstanceType T2_NANO = fromString("t2.nano"); + + /** + * Static value t2.small for InstanceType. + */ + public static final InstanceType T2_SMALL = fromString("t2.small"); + + /** + * Static value t2.xlarge for InstanceType. + */ + public static final InstanceType T2_XLARGE = fromString("t2.xlarge"); + + /** + * Static value t3.2xlarge for InstanceType. + */ + public static final InstanceType T3_2XLARGE = fromString("t3.2xlarge"); + + /** + * Static value t3.large for InstanceType. + */ + public static final InstanceType T3_LARGE = fromString("t3.large"); + + /** + * Static value t3.medium for InstanceType. + */ + public static final InstanceType T3_MEDIUM = fromString("t3.medium"); + + /** + * Static value t3.micro for InstanceType. + */ + public static final InstanceType T3_MICRO = fromString("t3.micro"); + + /** + * Static value t3.nano for InstanceType. + */ + public static final InstanceType T3_NANO = fromString("t3.nano"); + + /** + * Static value t3.small for InstanceType. + */ + public static final InstanceType T3_SMALL = fromString("t3.small"); + + /** + * Static value t3.xlarge for InstanceType. + */ + public static final InstanceType T3_XLARGE = fromString("t3.xlarge"); + + /** + * Static value t3a.2xlarge for InstanceType. + */ + public static final InstanceType T3A_2XLARGE = fromString("t3a.2xlarge"); + + /** + * Static value t3a.large for InstanceType. + */ + public static final InstanceType T3A_LARGE = fromString("t3a.large"); + + /** + * Static value t3a.medium for InstanceType. + */ + public static final InstanceType T3A_MEDIUM = fromString("t3a.medium"); + + /** + * Static value t3a.micro for InstanceType. + */ + public static final InstanceType T3A_MICRO = fromString("t3a.micro"); + + /** + * Static value t3a.nano for InstanceType. + */ + public static final InstanceType T3A_NANO = fromString("t3a.nano"); + + /** + * Static value t3a.small for InstanceType. + */ + public static final InstanceType T3A_SMALL = fromString("t3a.small"); + + /** + * Static value t3a.xlarge for InstanceType. + */ + public static final InstanceType T3A_XLARGE = fromString("t3a.xlarge"); + + /** + * Static value t4g.2xlarge for InstanceType. + */ + public static final InstanceType T4G_2XLARGE = fromString("t4g.2xlarge"); + + /** + * Static value t4g.large for InstanceType. + */ + public static final InstanceType T4G_LARGE = fromString("t4g.large"); + + /** + * Static value t4g.medium for InstanceType. + */ + public static final InstanceType T4G_MEDIUM = fromString("t4g.medium"); + + /** + * Static value t4g.micro for InstanceType. + */ + public static final InstanceType T4G_MICRO = fromString("t4g.micro"); + + /** + * Static value t4g.nano for InstanceType. + */ + public static final InstanceType T4G_NANO = fromString("t4g.nano"); + + /** + * Static value t4g.small for InstanceType. + */ + public static final InstanceType T4G_SMALL = fromString("t4g.small"); + + /** + * Static value t4g.xlarge for InstanceType. + */ + public static final InstanceType T4G_XLARGE = fromString("t4g.xlarge"); + + /** + * Static value trn1.2xlarge for InstanceType. + */ + public static final InstanceType TRN1_2XLARGE = fromString("trn1.2xlarge"); + + /** + * Static value trn1.32xlarge for InstanceType. + */ + public static final InstanceType TRN1_32XLARGE = fromString("trn1.32xlarge"); + + /** + * Static value trn1n.32xlarge for InstanceType. + */ + public static final InstanceType TRN1N_32XLARGE = fromString("trn1n.32xlarge"); + + /** + * Static value u-12tb1.112xlarge for InstanceType. + */ + public static final InstanceType U_12TB1_112XLARGE = fromString("u-12tb1.112xlarge"); + + /** + * Static value u-12tb1.metal for InstanceType. + */ + public static final InstanceType U_12TB1_METAL = fromString("u-12tb1.metal"); + + /** + * Static value u-18tb1.112xlarge for InstanceType. + */ + public static final InstanceType U_18TB1_112XLARGE = fromString("u-18tb1.112xlarge"); + + /** + * Static value u-18tb1.metal for InstanceType. + */ + public static final InstanceType U_18TB1_METAL = fromString("u-18tb1.metal"); + + /** + * Static value u-24tb1.112xlarge for InstanceType. + */ + public static final InstanceType U_24TB1_112XLARGE = fromString("u-24tb1.112xlarge"); + + /** + * Static value u-24tb1.metal for InstanceType. + */ + public static final InstanceType U_24TB1_METAL = fromString("u-24tb1.metal"); + + /** + * Static value u-3tb1.56xlarge for InstanceType. + */ + public static final InstanceType U_3TB1_56XLARGE = fromString("u-3tb1.56xlarge"); + + /** + * Static value u-6tb1.112xlarge for InstanceType. + */ + public static final InstanceType U_6TB1_112XLARGE = fromString("u-6tb1.112xlarge"); + + /** + * Static value u-6tb1.56xlarge for InstanceType. + */ + public static final InstanceType U_6TB1_56XLARGE = fromString("u-6tb1.56xlarge"); + + /** + * Static value u-6tb1.metal for InstanceType. + */ + public static final InstanceType U_6TB1_METAL = fromString("u-6tb1.metal"); + + /** + * Static value u-9tb1.112xlarge for InstanceType. + */ + public static final InstanceType U_9TB1_112XLARGE = fromString("u-9tb1.112xlarge"); + + /** + * Static value u-9tb1.metal for InstanceType. + */ + public static final InstanceType U_9TB1_METAL = fromString("u-9tb1.metal"); + + /** + * Static value vt1.24xlarge for InstanceType. + */ + public static final InstanceType VT1_24XLARGE = fromString("vt1.24xlarge"); + + /** + * Static value vt1.3xlarge for InstanceType. + */ + public static final InstanceType VT1_3XLARGE = fromString("vt1.3xlarge"); + + /** + * Static value vt1.6xlarge for InstanceType. + */ + public static final InstanceType VT1_6XLARGE = fromString("vt1.6xlarge"); + + /** + * Static value x1.16xlarge for InstanceType. + */ + public static final InstanceType X1_16XLARGE = fromString("x1.16xlarge"); + + /** + * Static value x1.32xlarge for InstanceType. + */ + public static final InstanceType X1_32XLARGE = fromString("x1.32xlarge"); + + /** + * Static value x1e.16xlarge for InstanceType. + */ + public static final InstanceType X1E_16XLARGE = fromString("x1e.16xlarge"); + + /** + * Static value x1e.2xlarge for InstanceType. + */ + public static final InstanceType X1E_2XLARGE = fromString("x1e.2xlarge"); + + /** + * Static value x1e.32xlarge for InstanceType. + */ + public static final InstanceType X1E_32XLARGE = fromString("x1e.32xlarge"); + + /** + * Static value x1e.4xlarge for InstanceType. + */ + public static final InstanceType X1E_4XLARGE = fromString("x1e.4xlarge"); + + /** + * Static value x1e.8xlarge for InstanceType. + */ + public static final InstanceType X1E_8XLARGE = fromString("x1e.8xlarge"); + + /** + * Static value x1e.xlarge for InstanceType. + */ + public static final InstanceType X1E_XLARGE = fromString("x1e.xlarge"); + + /** + * Static value x2gd.12xlarge for InstanceType. + */ + public static final InstanceType X2GD_12XLARGE = fromString("x2gd.12xlarge"); + + /** + * Static value x2gd.16xlarge for InstanceType. + */ + public static final InstanceType X2GD_16XLARGE = fromString("x2gd.16xlarge"); + + /** + * Static value x2gd.2xlarge for InstanceType. + */ + public static final InstanceType X2GD_2XLARGE = fromString("x2gd.2xlarge"); + + /** + * Static value x2gd.4xlarge for InstanceType. + */ + public static final InstanceType X2GD_4XLARGE = fromString("x2gd.4xlarge"); + + /** + * Static value x2gd.8xlarge for InstanceType. + */ + public static final InstanceType X2GD_8XLARGE = fromString("x2gd.8xlarge"); + + /** + * Static value x2gd.large for InstanceType. + */ + public static final InstanceType X2GD_LARGE = fromString("x2gd.large"); + + /** + * Static value x2gd.medium for InstanceType. + */ + public static final InstanceType X2GD_MEDIUM = fromString("x2gd.medium"); + + /** + * Static value x2gd.metal for InstanceType. + */ + public static final InstanceType X2GD_METAL = fromString("x2gd.metal"); + + /** + * Static value x2gd.xlarge for InstanceType. + */ + public static final InstanceType X2GD_XLARGE = fromString("x2gd.xlarge"); + + /** + * Static value x2idn.16xlarge for InstanceType. + */ + public static final InstanceType X2IDN_16XLARGE = fromString("x2idn.16xlarge"); + + /** + * Static value x2idn.24xlarge for InstanceType. + */ + public static final InstanceType X2IDN_24XLARGE = fromString("x2idn.24xlarge"); + + /** + * Static value x2idn.32xlarge for InstanceType. + */ + public static final InstanceType X2IDN_32XLARGE = fromString("x2idn.32xlarge"); + + /** + * Static value x2idn.metal for InstanceType. + */ + public static final InstanceType X2IDN_METAL = fromString("x2idn.metal"); + + /** + * Static value x2iedn.16xlarge for InstanceType. + */ + public static final InstanceType X2IEDN_16XLARGE = fromString("x2iedn.16xlarge"); + + /** + * Static value x2iedn.24xlarge for InstanceType. + */ + public static final InstanceType X2IEDN_24XLARGE = fromString("x2iedn.24xlarge"); + + /** + * Static value x2iedn.2xlarge for InstanceType. + */ + public static final InstanceType X2IEDN_2XLARGE = fromString("x2iedn.2xlarge"); + + /** + * Static value x2iedn.32xlarge for InstanceType. + */ + public static final InstanceType X2IEDN_32XLARGE = fromString("x2iedn.32xlarge"); + + /** + * Static value x2iedn.4xlarge for InstanceType. + */ + public static final InstanceType X2IEDN_4XLARGE = fromString("x2iedn.4xlarge"); + + /** + * Static value x2iedn.8xlarge for InstanceType. + */ + public static final InstanceType X2IEDN_8XLARGE = fromString("x2iedn.8xlarge"); + + /** + * Static value x2iedn.metal for InstanceType. + */ + public static final InstanceType X2IEDN_METAL = fromString("x2iedn.metal"); + + /** + * Static value x2iedn.xlarge for InstanceType. + */ + public static final InstanceType X2IEDN_XLARGE = fromString("x2iedn.xlarge"); + + /** + * Static value x2iezn.12xlarge for InstanceType. + */ + public static final InstanceType X2IEZN_12XLARGE = fromString("x2iezn.12xlarge"); + + /** + * Static value x2iezn.2xlarge for InstanceType. + */ + public static final InstanceType X2IEZN_2XLARGE = fromString("x2iezn.2xlarge"); + + /** + * Static value x2iezn.4xlarge for InstanceType. + */ + public static final InstanceType X2IEZN_4XLARGE = fromString("x2iezn.4xlarge"); + + /** + * Static value x2iezn.6xlarge for InstanceType. + */ + public static final InstanceType X2IEZN_6XLARGE = fromString("x2iezn.6xlarge"); + + /** + * Static value x2iezn.8xlarge for InstanceType. + */ + public static final InstanceType X2IEZN_8XLARGE = fromString("x2iezn.8xlarge"); + + /** + * Static value x2iezn.metal for InstanceType. + */ + public static final InstanceType X2IEZN_METAL = fromString("x2iezn.metal"); + + /** + * Static value z1d.12xlarge for InstanceType. + */ + public static final InstanceType Z1D_12XLARGE = fromString("z1d.12xlarge"); + + /** + * Static value z1d.2xlarge for InstanceType. + */ + public static final InstanceType Z1D_2XLARGE = fromString("z1d.2xlarge"); + + /** + * Static value z1d.3xlarge for InstanceType. + */ + public static final InstanceType Z1D_3XLARGE = fromString("z1d.3xlarge"); + + /** + * Static value z1d.6xlarge for InstanceType. + */ + public static final InstanceType Z1D_6XLARGE = fromString("z1d.6xlarge"); + + /** + * Static value z1d.large for InstanceType. + */ + public static final InstanceType Z1D_LARGE = fromString("z1d.large"); + + /** + * Static value z1d.metal for InstanceType. + */ + public static final InstanceType Z1D_METAL = fromString("z1d.metal"); + + /** + * Static value z1d.xlarge for InstanceType. + */ + public static final InstanceType Z1D_XLARGE = fromString("z1d.xlarge"); + + /** + * Creates a new instance of InstanceType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public InstanceType() { + } + + /** + * Creates or finds a InstanceType from its string representation. + * + * @param name a name to look for. + * @return the corresponding InstanceType. + */ + public static InstanceType fromString(String name) { + return fromString(name, InstanceType.class); + } + + /** + * Gets known InstanceType values. + * + * @return known InstanceType values. + */ + public static Collection values() { + return values(InstanceType.class); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/InstanceTypeEnumValue.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/InstanceTypeEnumValue.java new file mode 100644 index 000000000000..14d24011c611 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/InstanceTypeEnumValue.java @@ -0,0 +1,93 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of InstanceTypeEnumValue. + */ +@Fluent +public final class InstanceTypeEnumValue implements JsonSerializable { + /* + * Property value + */ + private InstanceType value; + + /** + * Creates an instance of InstanceTypeEnumValue class. + */ + public InstanceTypeEnumValue() { + } + + /** + * Get the value property: Property value. + * + * @return the value value. + */ + public InstanceType value() { + return this.value; + } + + /** + * Set the value property: Property value. + * + * @param value the value value to set. + * @return the InstanceTypeEnumValue object itself. + */ + public InstanceTypeEnumValue withValue(InstanceType value) { + this.value = value; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("value", this.value == null ? null : this.value.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of InstanceTypeEnumValue from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of InstanceTypeEnumValue if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the InstanceTypeEnumValue. + */ + public static InstanceTypeEnumValue fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + InstanceTypeEnumValue deserializedInstanceTypeEnumValue = new InstanceTypeEnumValue(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + deserializedInstanceTypeEnumValue.value = InstanceType.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedInstanceTypeEnumValue; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/InstancesDistribution.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/InstancesDistribution.java new file mode 100644 index 000000000000..162e7aee3b14 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/InstancesDistribution.java @@ -0,0 +1,364 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of InstancesDistribution. + */ +@Fluent +public final class InstancesDistribution implements JsonSerializable { + /* + * The allocation strategy to apply to your On-Demand Instances when they are launched. Possible instance types are + * determined by the launch template overrides that you specify. The following lists the valid values: + + * lowest-price Uses price to determine which instance types are the highest priority, launching the lowest priced + * instance types within an Availability Zone first. This is the default value for Auto Scaling groups that specify + * InstanceRequirements. + prioritized You set the order of instance types for the launch template overrides from + * highest to lowest priority (from first to last in the list). Amazon EC2 Auto Scaling launches your highest + * priority instance types first. If all your On-Demand capacity cannot be fulfilled using your highest priority + * instance type, then Amazon EC2 Auto Scaling launches the remaining capacity using the second priority instance + * type, and so on. This is the default value for Auto Scaling groups that don't specify InstanceRequirements and + * cannot be used for groups that do. + */ + private String onDemandAllocationStrategy; + + /* + * The minimum amount of the Auto Scaling group's capacity that must be fulfilled by On-Demand Instances. This base + * portion is launched first as your group scales. This number has the same unit of measurement as the group's + * desired capacity. If you change the default unit of measurement (number of instances) by specifying weighted + * capacity values in your launch template overrides list, or by changing the default desired capacity type setting + * of the group, you must specify this number using the same unit of measurement. Default: 0 An update to this + * setting means a gradual replacement of instances to adjust the current On-Demand Instance levels. When replacing + * instances, Amazon EC2 Auto Scaling launches new instances before terminating the previous ones. + */ + private Integer onDemandBaseCapacity; + + /* + * Controls the percentages of On-Demand Instances and Spot Instances for your additional capacity beyond + * ``OnDemandBaseCapacity``. Expressed as a number (for example, 20 specifies 20% On-Demand Instances, 80% Spot + * Instances). If set to 100, only On-Demand Instances are used. Default: 100 An update to this setting means a + * gradual replacement of instances to adjust the current On-Demand and Spot Instance levels for your additional + * capacity higher than the base capacity. When replacing instances, Amazon EC2 Auto Scaling launches new instances + * before terminating the previous ones. + */ + private Integer onDemandPercentageAboveBaseCapacity; + + /* + * The allocation strategy to apply to your Spot Instances when they are launched. Possible instance types are + * determined by the launch template overrides that you specify. The following lists the valid values: + + * capacity-optimized Requests Spot Instances using pools that are optimally chosen based on the available Spot + * capacity. This strategy has the lowest risk of interruption. To give certain instance types a higher chance of + * launching first, use capacity-optimized-prioritized. + capacity-optimized-prioritized You set the order of + * instance types for the launch template overrides from highest to lowest priority (from first to last in the + * list). Amazon EC2 Auto Scaling honors the instance type priorities on a best effort basis but optimizes for + * capacity first. Note that if the On-Demand allocation strategy is set to prioritized, the same priority is + * applied when fulfilling On-Demand capacity. This is not a valid value for Auto Scaling groups that specify + * InstanceRequirements. + lowest-price Requests Spot Instances using the lowest priced pools within an Availability + * Zone, across the number of Spot pools that you specify for the SpotInstancePools property. To ensure that your + * desired capacity is met, you might receive Spot Instances from several pools. This is the default value, but it + * might lead to high interruption rates because this strategy only considers instance price and not available + * capacity. + price-capacity-optimized (recommended) The price and capacity optimized allocation strategy looks at + * both price and capacity to select the Spot Instance pools that are the least likely to be interrupted and have + * the lowest possible price. + */ + private String spotAllocationStrategy; + + /* + * The number of Spot Instance pools across which to allocate your Spot Instances. The Spot pools are determined + * from the different instance types in the overrides. Valid only when the ``SpotAllocationStrategy`` is + * ``lowest-price``. Value must be in the range of 1–20. Default: 2 + */ + private Integer spotInstancePools; + + /* + * The maximum price per unit hour that you are willing to pay for a Spot Instance. If your maximum price is lower + * than the Spot price for the instance types that you selected, your Spot Instances are not launched. We do not + * recommend specifying a maximum price because it can lead to increased interruptions. When Spot Instances launch, + * you pay the current Spot price. To remove a maximum price that you previously set, include the property but + * specify an empty string ('') for the value. If you specify a maximum price, your instances will be interrupted + * more frequently than if you do not specify one. Valid Range: Minimum value of 0.001 + */ + private String spotMaxPrice; + + /** + * Creates an instance of InstancesDistribution class. + */ + public InstancesDistribution() { + } + + /** + * Get the onDemandAllocationStrategy property: The allocation strategy to apply to your On-Demand Instances when + * they are launched. Possible instance types are determined by the launch template overrides that you specify. The + * following lists the valid values: + lowest-price Uses price to determine which instance types are the highest + * priority, launching the lowest priced instance types within an Availability Zone first. This is the default value + * for Auto Scaling groups that specify InstanceRequirements. + prioritized You set the order of instance types for + * the launch template overrides from highest to lowest priority (from first to last in the list). Amazon EC2 Auto + * Scaling launches your highest priority instance types first. If all your On-Demand capacity cannot be fulfilled + * using your highest priority instance type, then Amazon EC2 Auto Scaling launches the remaining capacity using the + * second priority instance type, and so on. This is the default value for Auto Scaling groups that don't specify + * InstanceRequirements and cannot be used for groups that do. + * + * @return the onDemandAllocationStrategy value. + */ + public String onDemandAllocationStrategy() { + return this.onDemandAllocationStrategy; + } + + /** + * Set the onDemandAllocationStrategy property: The allocation strategy to apply to your On-Demand Instances when + * they are launched. Possible instance types are determined by the launch template overrides that you specify. The + * following lists the valid values: + lowest-price Uses price to determine which instance types are the highest + * priority, launching the lowest priced instance types within an Availability Zone first. This is the default value + * for Auto Scaling groups that specify InstanceRequirements. + prioritized You set the order of instance types for + * the launch template overrides from highest to lowest priority (from first to last in the list). Amazon EC2 Auto + * Scaling launches your highest priority instance types first. If all your On-Demand capacity cannot be fulfilled + * using your highest priority instance type, then Amazon EC2 Auto Scaling launches the remaining capacity using the + * second priority instance type, and so on. This is the default value for Auto Scaling groups that don't specify + * InstanceRequirements and cannot be used for groups that do. + * + * @param onDemandAllocationStrategy the onDemandAllocationStrategy value to set. + * @return the InstancesDistribution object itself. + */ + public InstancesDistribution withOnDemandAllocationStrategy(String onDemandAllocationStrategy) { + this.onDemandAllocationStrategy = onDemandAllocationStrategy; + return this; + } + + /** + * Get the onDemandBaseCapacity property: The minimum amount of the Auto Scaling group's capacity that must be + * fulfilled by On-Demand Instances. This base portion is launched first as your group scales. This number has the + * same unit of measurement as the group's desired capacity. If you change the default unit of measurement (number + * of instances) by specifying weighted capacity values in your launch template overrides list, or by changing the + * default desired capacity type setting of the group, you must specify this number using the same unit of + * measurement. Default: 0 An update to this setting means a gradual replacement of instances to adjust the current + * On-Demand Instance levels. When replacing instances, Amazon EC2 Auto Scaling launches new instances before + * terminating the previous ones. + * + * @return the onDemandBaseCapacity value. + */ + public Integer onDemandBaseCapacity() { + return this.onDemandBaseCapacity; + } + + /** + * Set the onDemandBaseCapacity property: The minimum amount of the Auto Scaling group's capacity that must be + * fulfilled by On-Demand Instances. This base portion is launched first as your group scales. This number has the + * same unit of measurement as the group's desired capacity. If you change the default unit of measurement (number + * of instances) by specifying weighted capacity values in your launch template overrides list, or by changing the + * default desired capacity type setting of the group, you must specify this number using the same unit of + * measurement. Default: 0 An update to this setting means a gradual replacement of instances to adjust the current + * On-Demand Instance levels. When replacing instances, Amazon EC2 Auto Scaling launches new instances before + * terminating the previous ones. + * + * @param onDemandBaseCapacity the onDemandBaseCapacity value to set. + * @return the InstancesDistribution object itself. + */ + public InstancesDistribution withOnDemandBaseCapacity(Integer onDemandBaseCapacity) { + this.onDemandBaseCapacity = onDemandBaseCapacity; + return this; + } + + /** + * Get the onDemandPercentageAboveBaseCapacity property: Controls the percentages of On-Demand Instances and Spot + * Instances for your additional capacity beyond ``OnDemandBaseCapacity``. Expressed as a number (for example, 20 + * specifies 20% On-Demand Instances, 80% Spot Instances). If set to 100, only On-Demand Instances are used. + * Default: 100 An update to this setting means a gradual replacement of instances to adjust the current On-Demand + * and Spot Instance levels for your additional capacity higher than the base capacity. When replacing instances, + * Amazon EC2 Auto Scaling launches new instances before terminating the previous ones. + * + * @return the onDemandPercentageAboveBaseCapacity value. + */ + public Integer onDemandPercentageAboveBaseCapacity() { + return this.onDemandPercentageAboveBaseCapacity; + } + + /** + * Set the onDemandPercentageAboveBaseCapacity property: Controls the percentages of On-Demand Instances and Spot + * Instances for your additional capacity beyond ``OnDemandBaseCapacity``. Expressed as a number (for example, 20 + * specifies 20% On-Demand Instances, 80% Spot Instances). If set to 100, only On-Demand Instances are used. + * Default: 100 An update to this setting means a gradual replacement of instances to adjust the current On-Demand + * and Spot Instance levels for your additional capacity higher than the base capacity. When replacing instances, + * Amazon EC2 Auto Scaling launches new instances before terminating the previous ones. + * + * @param onDemandPercentageAboveBaseCapacity the onDemandPercentageAboveBaseCapacity value to set. + * @return the InstancesDistribution object itself. + */ + public InstancesDistribution withOnDemandPercentageAboveBaseCapacity(Integer onDemandPercentageAboveBaseCapacity) { + this.onDemandPercentageAboveBaseCapacity = onDemandPercentageAboveBaseCapacity; + return this; + } + + /** + * Get the spotAllocationStrategy property: The allocation strategy to apply to your Spot Instances when they are + * launched. Possible instance types are determined by the launch template overrides that you specify. The following + * lists the valid values: + capacity-optimized Requests Spot Instances using pools that are optimally chosen based + * on the available Spot capacity. This strategy has the lowest risk of interruption. To give certain instance types + * a higher chance of launching first, use capacity-optimized-prioritized. + capacity-optimized-prioritized You set + * the order of instance types for the launch template overrides from highest to lowest priority (from first to last + * in the list). Amazon EC2 Auto Scaling honors the instance type priorities on a best effort basis but optimizes + * for capacity first. Note that if the On-Demand allocation strategy is set to prioritized, the same priority is + * applied when fulfilling On-Demand capacity. This is not a valid value for Auto Scaling groups that specify + * InstanceRequirements. + lowest-price Requests Spot Instances using the lowest priced pools within an Availability + * Zone, across the number of Spot pools that you specify for the SpotInstancePools property. To ensure that your + * desired capacity is met, you might receive Spot Instances from several pools. This is the default value, but it + * might lead to high interruption rates because this strategy only considers instance price and not available + * capacity. + price-capacity-optimized (recommended) The price and capacity optimized allocation strategy looks at + * both price and capacity to select the Spot Instance pools that are the least likely to be interrupted and have + * the lowest possible price. + * + * @return the spotAllocationStrategy value. + */ + public String spotAllocationStrategy() { + return this.spotAllocationStrategy; + } + + /** + * Set the spotAllocationStrategy property: The allocation strategy to apply to your Spot Instances when they are + * launched. Possible instance types are determined by the launch template overrides that you specify. The following + * lists the valid values: + capacity-optimized Requests Spot Instances using pools that are optimally chosen based + * on the available Spot capacity. This strategy has the lowest risk of interruption. To give certain instance types + * a higher chance of launching first, use capacity-optimized-prioritized. + capacity-optimized-prioritized You set + * the order of instance types for the launch template overrides from highest to lowest priority (from first to last + * in the list). Amazon EC2 Auto Scaling honors the instance type priorities on a best effort basis but optimizes + * for capacity first. Note that if the On-Demand allocation strategy is set to prioritized, the same priority is + * applied when fulfilling On-Demand capacity. This is not a valid value for Auto Scaling groups that specify + * InstanceRequirements. + lowest-price Requests Spot Instances using the lowest priced pools within an Availability + * Zone, across the number of Spot pools that you specify for the SpotInstancePools property. To ensure that your + * desired capacity is met, you might receive Spot Instances from several pools. This is the default value, but it + * might lead to high interruption rates because this strategy only considers instance price and not available + * capacity. + price-capacity-optimized (recommended) The price and capacity optimized allocation strategy looks at + * both price and capacity to select the Spot Instance pools that are the least likely to be interrupted and have + * the lowest possible price. + * + * @param spotAllocationStrategy the spotAllocationStrategy value to set. + * @return the InstancesDistribution object itself. + */ + public InstancesDistribution withSpotAllocationStrategy(String spotAllocationStrategy) { + this.spotAllocationStrategy = spotAllocationStrategy; + return this; + } + + /** + * Get the spotInstancePools property: The number of Spot Instance pools across which to allocate your Spot + * Instances. The Spot pools are determined from the different instance types in the overrides. Valid only when the + * ``SpotAllocationStrategy`` is ``lowest-price``. Value must be in the range of 1–20. Default: 2. + * + * @return the spotInstancePools value. + */ + public Integer spotInstancePools() { + return this.spotInstancePools; + } + + /** + * Set the spotInstancePools property: The number of Spot Instance pools across which to allocate your Spot + * Instances. The Spot pools are determined from the different instance types in the overrides. Valid only when the + * ``SpotAllocationStrategy`` is ``lowest-price``. Value must be in the range of 1–20. Default: 2. + * + * @param spotInstancePools the spotInstancePools value to set. + * @return the InstancesDistribution object itself. + */ + public InstancesDistribution withSpotInstancePools(Integer spotInstancePools) { + this.spotInstancePools = spotInstancePools; + return this; + } + + /** + * Get the spotMaxPrice property: The maximum price per unit hour that you are willing to pay for a Spot Instance. + * If your maximum price is lower than the Spot price for the instance types that you selected, your Spot Instances + * are not launched. We do not recommend specifying a maximum price because it can lead to increased interruptions. + * When Spot Instances launch, you pay the current Spot price. To remove a maximum price that you previously set, + * include the property but specify an empty string ('') for the value. If you specify a maximum price, your + * instances will be interrupted more frequently than if you do not specify one. Valid Range: Minimum value of + * 0.001. + * + * @return the spotMaxPrice value. + */ + public String spotMaxPrice() { + return this.spotMaxPrice; + } + + /** + * Set the spotMaxPrice property: The maximum price per unit hour that you are willing to pay for a Spot Instance. + * If your maximum price is lower than the Spot price for the instance types that you selected, your Spot Instances + * are not launched. We do not recommend specifying a maximum price because it can lead to increased interruptions. + * When Spot Instances launch, you pay the current Spot price. To remove a maximum price that you previously set, + * include the property but specify an empty string ('') for the value. If you specify a maximum price, your + * instances will be interrupted more frequently than if you do not specify one. Valid Range: Minimum value of + * 0.001. + * + * @param spotMaxPrice the spotMaxPrice value to set. + * @return the InstancesDistribution object itself. + */ + public InstancesDistribution withSpotMaxPrice(String spotMaxPrice) { + this.spotMaxPrice = spotMaxPrice; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("onDemandAllocationStrategy", this.onDemandAllocationStrategy); + jsonWriter.writeNumberField("onDemandBaseCapacity", this.onDemandBaseCapacity); + jsonWriter.writeNumberField("onDemandPercentageAboveBaseCapacity", this.onDemandPercentageAboveBaseCapacity); + jsonWriter.writeStringField("spotAllocationStrategy", this.spotAllocationStrategy); + jsonWriter.writeNumberField("spotInstancePools", this.spotInstancePools); + jsonWriter.writeStringField("spotMaxPrice", this.spotMaxPrice); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of InstancesDistribution from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of InstancesDistribution if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the InstancesDistribution. + */ + public static InstancesDistribution fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + InstancesDistribution deserializedInstancesDistribution = new InstancesDistribution(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("onDemandAllocationStrategy".equals(fieldName)) { + deserializedInstancesDistribution.onDemandAllocationStrategy = reader.getString(); + } else if ("onDemandBaseCapacity".equals(fieldName)) { + deserializedInstancesDistribution.onDemandBaseCapacity = reader.getNullable(JsonReader::getInt); + } else if ("onDemandPercentageAboveBaseCapacity".equals(fieldName)) { + deserializedInstancesDistribution.onDemandPercentageAboveBaseCapacity + = reader.getNullable(JsonReader::getInt); + } else if ("spotAllocationStrategy".equals(fieldName)) { + deserializedInstancesDistribution.spotAllocationStrategy = reader.getString(); + } else if ("spotInstancePools".equals(fieldName)) { + deserializedInstancesDistribution.spotInstancePools = reader.getNullable(JsonReader::getInt); + } else if ("spotMaxPrice".equals(fieldName)) { + deserializedInstancesDistribution.spotMaxPrice = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedInstancesDistribution; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/IntelligentTieringConfiguration.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/IntelligentTieringConfiguration.java new file mode 100644 index 000000000000..757445356814 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/IntelligentTieringConfiguration.java @@ -0,0 +1,230 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Definition of IntelligentTieringConfiguration. + */ +@Fluent +public final class IntelligentTieringConfiguration implements JsonSerializable { + /* + * The ID used to identify the S3 Intelligent-Tiering configuration. + */ + private String id; + + /* + * An object key name prefix that identifies the subset of objects to which the rule applies. + */ + private String prefix; + + /* + * Specifies the status of the configuration. + */ + private IntelligentTieringConfigurationStatus status; + + /* + * A container for a key-value pair. + */ + private List tagFilters; + + /* + * Specifies a list of S3 Intelligent-Tiering storage class tiers in the configuration. At least one tier must be + * defined in the list. At most, you can specify two tiers in the list, one for each available AccessTier: + * ``ARCHIVE_ACCESS`` and ``DEEP_ARCHIVE_ACCESS``. You only need Intelligent Tiering Configuration enabled on a + * bucket if you want to automatically move objects stored in the Intelligent-Tiering storage class to Archive + * Access or Deep Archive Access tiers. + */ + private List tierings; + + /** + * Creates an instance of IntelligentTieringConfiguration class. + */ + public IntelligentTieringConfiguration() { + } + + /** + * Get the id property: The ID used to identify the S3 Intelligent-Tiering configuration. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Set the id property: The ID used to identify the S3 Intelligent-Tiering configuration. + * + * @param id the id value to set. + * @return the IntelligentTieringConfiguration object itself. + */ + public IntelligentTieringConfiguration withId(String id) { + this.id = id; + return this; + } + + /** + * Get the prefix property: An object key name prefix that identifies the subset of objects to which the rule + * applies. + * + * @return the prefix value. + */ + public String prefix() { + return this.prefix; + } + + /** + * Set the prefix property: An object key name prefix that identifies the subset of objects to which the rule + * applies. + * + * @param prefix the prefix value to set. + * @return the IntelligentTieringConfiguration object itself. + */ + public IntelligentTieringConfiguration withPrefix(String prefix) { + this.prefix = prefix; + return this; + } + + /** + * Get the status property: Specifies the status of the configuration. + * + * @return the status value. + */ + public IntelligentTieringConfigurationStatus status() { + return this.status; + } + + /** + * Set the status property: Specifies the status of the configuration. + * + * @param status the status value to set. + * @return the IntelligentTieringConfiguration object itself. + */ + public IntelligentTieringConfiguration withStatus(IntelligentTieringConfigurationStatus status) { + this.status = status; + return this; + } + + /** + * Get the tagFilters property: A container for a key-value pair. + * + * @return the tagFilters value. + */ + public List tagFilters() { + return this.tagFilters; + } + + /** + * Set the tagFilters property: A container for a key-value pair. + * + * @param tagFilters the tagFilters value to set. + * @return the IntelligentTieringConfiguration object itself. + */ + public IntelligentTieringConfiguration withTagFilters(List tagFilters) { + this.tagFilters = tagFilters; + return this; + } + + /** + * Get the tierings property: Specifies a list of S3 Intelligent-Tiering storage class tiers in the configuration. + * At least one tier must be defined in the list. At most, you can specify two tiers in the list, one for each + * available AccessTier: ``ARCHIVE_ACCESS`` and ``DEEP_ARCHIVE_ACCESS``. You only need Intelligent Tiering + * Configuration enabled on a bucket if you want to automatically move objects stored in the Intelligent-Tiering + * storage class to Archive Access or Deep Archive Access tiers. + * + * @return the tierings value. + */ + public List tierings() { + return this.tierings; + } + + /** + * Set the tierings property: Specifies a list of S3 Intelligent-Tiering storage class tiers in the configuration. + * At least one tier must be defined in the list. At most, you can specify two tiers in the list, one for each + * available AccessTier: ``ARCHIVE_ACCESS`` and ``DEEP_ARCHIVE_ACCESS``. You only need Intelligent Tiering + * Configuration enabled on a bucket if you want to automatically move objects stored in the Intelligent-Tiering + * storage class to Archive Access or Deep Archive Access tiers. + * + * @param tierings the tierings value to set. + * @return the IntelligentTieringConfiguration object itself. + */ + public IntelligentTieringConfiguration withTierings(List tierings) { + this.tierings = tierings; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (tagFilters() != null) { + tagFilters().forEach(e -> e.validate()); + } + if (tierings() != null) { + tierings().forEach(e -> e.validate()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("id", this.id); + jsonWriter.writeStringField("prefix", this.prefix); + jsonWriter.writeStringField("status", this.status == null ? null : this.status.toString()); + jsonWriter.writeArrayField("tagFilters", this.tagFilters, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("tierings", this.tierings, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of IntelligentTieringConfiguration from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of IntelligentTieringConfiguration if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the IntelligentTieringConfiguration. + */ + public static IntelligentTieringConfiguration fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + IntelligentTieringConfiguration deserializedIntelligentTieringConfiguration + = new IntelligentTieringConfiguration(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedIntelligentTieringConfiguration.id = reader.getString(); + } else if ("prefix".equals(fieldName)) { + deserializedIntelligentTieringConfiguration.prefix = reader.getString(); + } else if ("status".equals(fieldName)) { + deserializedIntelligentTieringConfiguration.status + = IntelligentTieringConfigurationStatus.fromString(reader.getString()); + } else if ("tagFilters".equals(fieldName)) { + List tagFilters = reader.readArray(reader1 -> TagFilter.fromJson(reader1)); + deserializedIntelligentTieringConfiguration.tagFilters = tagFilters; + } else if ("tierings".equals(fieldName)) { + List tierings = reader.readArray(reader1 -> Tiering.fromJson(reader1)); + deserializedIntelligentTieringConfiguration.tierings = tierings; + } else { + reader.skipChildren(); + } + } + + return deserializedIntelligentTieringConfiguration; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/IntelligentTieringConfigurationStatus.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/IntelligentTieringConfigurationStatus.java new file mode 100644 index 000000000000..ddeef0a8c5a7 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/IntelligentTieringConfigurationStatus.java @@ -0,0 +1,52 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * IntelligentTieringConfigurationStatus enum. + */ +public final class IntelligentTieringConfigurationStatus + extends ExpandableStringEnum { + /** + * Static value Disabled for IntelligentTieringConfigurationStatus. + */ + public static final IntelligentTieringConfigurationStatus DISABLED = fromString("Disabled"); + + /** + * Static value Enabled for IntelligentTieringConfigurationStatus. + */ + public static final IntelligentTieringConfigurationStatus ENABLED = fromString("Enabled"); + + /** + * Creates a new instance of IntelligentTieringConfigurationStatus value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public IntelligentTieringConfigurationStatus() { + } + + /** + * Creates or finds a IntelligentTieringConfigurationStatus from its string representation. + * + * @param name a name to look for. + * @return the corresponding IntelligentTieringConfigurationStatus. + */ + public static IntelligentTieringConfigurationStatus fromString(String name) { + return fromString(name, IntelligentTieringConfigurationStatus.class); + } + + /** + * Gets known IntelligentTieringConfigurationStatus values. + * + * @return known IntelligentTieringConfigurationStatus values. + */ + public static Collection values() { + return values(IntelligentTieringConfigurationStatus.class); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/InventoryConfiguration.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/InventoryConfiguration.java new file mode 100644 index 000000000000..1a5500d14d21 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/InventoryConfiguration.java @@ -0,0 +1,285 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Definition of InventoryConfiguration. + */ +@Fluent +public final class InventoryConfiguration implements JsonSerializable { + /* + * Contains information about where to publish the inventory results. Specifies information about where to publish + * analysis or configuration results for an Amazon S3 bucket. + */ + private Destination destination; + + /* + * Specifies whether the inventory is enabled or disabled. If set to ``True``, an inventory list is generated. If + * set to ``False``, no inventory list is generated. + */ + private Boolean enabled; + + /* + * The ID used to identify the inventory configuration. + */ + private String id; + + /* + * Object versions to include in the inventory list. If set to ``All``, the list includes all the object versions, + * which adds the version-related fields ``VersionId``, ``IsLatest``, and ``DeleteMarker`` to the list. If set to + * ``Current``, the list does not contain these version-related fields. + */ + private InventoryConfigurationIncludedObjectVersions includedObjectVersions; + + /* + * Contains the optional fields that are included in the inventory results. + */ + private List optionalFields; + + /* + * Specifies the inventory filter prefix. + */ + private String prefix; + + /* + * Specifies the schedule for generating inventory results. + */ + private InventoryConfigurationScheduleFrequency scheduleFrequency; + + /** + * Creates an instance of InventoryConfiguration class. + */ + public InventoryConfiguration() { + } + + /** + * Get the destination property: Contains information about where to publish the inventory results. Specifies + * information about where to publish analysis or configuration results for an Amazon S3 bucket. + * + * @return the destination value. + */ + public Destination destination() { + return this.destination; + } + + /** + * Set the destination property: Contains information about where to publish the inventory results. Specifies + * information about where to publish analysis or configuration results for an Amazon S3 bucket. + * + * @param destination the destination value to set. + * @return the InventoryConfiguration object itself. + */ + public InventoryConfiguration withDestination(Destination destination) { + this.destination = destination; + return this; + } + + /** + * Get the enabled property: Specifies whether the inventory is enabled or disabled. If set to ``True``, an + * inventory list is generated. If set to ``False``, no inventory list is generated. + * + * @return the enabled value. + */ + public Boolean enabled() { + return this.enabled; + } + + /** + * Set the enabled property: Specifies whether the inventory is enabled or disabled. If set to ``True``, an + * inventory list is generated. If set to ``False``, no inventory list is generated. + * + * @param enabled the enabled value to set. + * @return the InventoryConfiguration object itself. + */ + public InventoryConfiguration withEnabled(Boolean enabled) { + this.enabled = enabled; + return this; + } + + /** + * Get the id property: The ID used to identify the inventory configuration. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Set the id property: The ID used to identify the inventory configuration. + * + * @param id the id value to set. + * @return the InventoryConfiguration object itself. + */ + public InventoryConfiguration withId(String id) { + this.id = id; + return this; + } + + /** + * Get the includedObjectVersions property: Object versions to include in the inventory list. If set to ``All``, the + * list includes all the object versions, which adds the version-related fields ``VersionId``, ``IsLatest``, and + * ``DeleteMarker`` to the list. If set to ``Current``, the list does not contain these version-related fields. + * + * @return the includedObjectVersions value. + */ + public InventoryConfigurationIncludedObjectVersions includedObjectVersions() { + return this.includedObjectVersions; + } + + /** + * Set the includedObjectVersions property: Object versions to include in the inventory list. If set to ``All``, the + * list includes all the object versions, which adds the version-related fields ``VersionId``, ``IsLatest``, and + * ``DeleteMarker`` to the list. If set to ``Current``, the list does not contain these version-related fields. + * + * @param includedObjectVersions the includedObjectVersions value to set. + * @return the InventoryConfiguration object itself. + */ + public InventoryConfiguration + withIncludedObjectVersions(InventoryConfigurationIncludedObjectVersions includedObjectVersions) { + this.includedObjectVersions = includedObjectVersions; + return this; + } + + /** + * Get the optionalFields property: Contains the optional fields that are included in the inventory results. + * + * @return the optionalFields value. + */ + public List optionalFields() { + return this.optionalFields; + } + + /** + * Set the optionalFields property: Contains the optional fields that are included in the inventory results. + * + * @param optionalFields the optionalFields value to set. + * @return the InventoryConfiguration object itself. + */ + public InventoryConfiguration withOptionalFields(List optionalFields) { + this.optionalFields = optionalFields; + return this; + } + + /** + * Get the prefix property: Specifies the inventory filter prefix. + * + * @return the prefix value. + */ + public String prefix() { + return this.prefix; + } + + /** + * Set the prefix property: Specifies the inventory filter prefix. + * + * @param prefix the prefix value to set. + * @return the InventoryConfiguration object itself. + */ + public InventoryConfiguration withPrefix(String prefix) { + this.prefix = prefix; + return this; + } + + /** + * Get the scheduleFrequency property: Specifies the schedule for generating inventory results. + * + * @return the scheduleFrequency value. + */ + public InventoryConfigurationScheduleFrequency scheduleFrequency() { + return this.scheduleFrequency; + } + + /** + * Set the scheduleFrequency property: Specifies the schedule for generating inventory results. + * + * @param scheduleFrequency the scheduleFrequency value to set. + * @return the InventoryConfiguration object itself. + */ + public InventoryConfiguration withScheduleFrequency(InventoryConfigurationScheduleFrequency scheduleFrequency) { + this.scheduleFrequency = scheduleFrequency; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (destination() != null) { + destination().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("destination", this.destination); + jsonWriter.writeBooleanField("enabled", this.enabled); + jsonWriter.writeStringField("id", this.id); + jsonWriter.writeStringField("includedObjectVersions", + this.includedObjectVersions == null ? null : this.includedObjectVersions.toString()); + jsonWriter.writeArrayField("optionalFields", this.optionalFields, + (writer, element) -> writer.writeString(element == null ? null : element.toString())); + jsonWriter.writeStringField("prefix", this.prefix); + jsonWriter.writeStringField("scheduleFrequency", + this.scheduleFrequency == null ? null : this.scheduleFrequency.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of InventoryConfiguration from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of InventoryConfiguration if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the InventoryConfiguration. + */ + public static InventoryConfiguration fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + InventoryConfiguration deserializedInventoryConfiguration = new InventoryConfiguration(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("destination".equals(fieldName)) { + deserializedInventoryConfiguration.destination = Destination.fromJson(reader); + } else if ("enabled".equals(fieldName)) { + deserializedInventoryConfiguration.enabled = reader.getNullable(JsonReader::getBoolean); + } else if ("id".equals(fieldName)) { + deserializedInventoryConfiguration.id = reader.getString(); + } else if ("includedObjectVersions".equals(fieldName)) { + deserializedInventoryConfiguration.includedObjectVersions + = InventoryConfigurationIncludedObjectVersions.fromString(reader.getString()); + } else if ("optionalFields".equals(fieldName)) { + List optionalFields = reader + .readArray(reader1 -> InventoryConfigurationOptionalFields.fromString(reader1.getString())); + deserializedInventoryConfiguration.optionalFields = optionalFields; + } else if ("prefix".equals(fieldName)) { + deserializedInventoryConfiguration.prefix = reader.getString(); + } else if ("scheduleFrequency".equals(fieldName)) { + deserializedInventoryConfiguration.scheduleFrequency + = InventoryConfigurationScheduleFrequency.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedInventoryConfiguration; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/InventoryConfigurationIncludedObjectVersions.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/InventoryConfigurationIncludedObjectVersions.java new file mode 100644 index 000000000000..ad4b31564cb3 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/InventoryConfigurationIncludedObjectVersions.java @@ -0,0 +1,52 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * InventoryConfigurationIncludedObjectVersions enum. + */ +public final class InventoryConfigurationIncludedObjectVersions + extends ExpandableStringEnum { + /** + * Static value All for InventoryConfigurationIncludedObjectVersions. + */ + public static final InventoryConfigurationIncludedObjectVersions ALL = fromString("All"); + + /** + * Static value Current for InventoryConfigurationIncludedObjectVersions. + */ + public static final InventoryConfigurationIncludedObjectVersions CURRENT = fromString("Current"); + + /** + * Creates a new instance of InventoryConfigurationIncludedObjectVersions value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public InventoryConfigurationIncludedObjectVersions() { + } + + /** + * Creates or finds a InventoryConfigurationIncludedObjectVersions from its string representation. + * + * @param name a name to look for. + * @return the corresponding InventoryConfigurationIncludedObjectVersions. + */ + public static InventoryConfigurationIncludedObjectVersions fromString(String name) { + return fromString(name, InventoryConfigurationIncludedObjectVersions.class); + } + + /** + * Gets known InventoryConfigurationIncludedObjectVersions values. + * + * @return known InventoryConfigurationIncludedObjectVersions values. + */ + public static Collection values() { + return values(InventoryConfigurationIncludedObjectVersions.class); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/InventoryConfigurationOptionalFields.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/InventoryConfigurationOptionalFields.java new file mode 100644 index 000000000000..ea2005ae2df5 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/InventoryConfigurationOptionalFields.java @@ -0,0 +1,121 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * InventoryConfigurationOptionalFields enum. + */ +public final class InventoryConfigurationOptionalFields + extends ExpandableStringEnum { + /** + * Static value BucketKeyStatus for InventoryConfigurationOptionalFields. + */ + public static final InventoryConfigurationOptionalFields BUCKET_KEY_STATUS = fromString("BucketKeyStatus"); + + /** + * Static value ChecksumAlgorithm for InventoryConfigurationOptionalFields. + */ + public static final InventoryConfigurationOptionalFields CHECKSUM_ALGORITHM = fromString("ChecksumAlgorithm"); + + /** + * Static value ETag for InventoryConfigurationOptionalFields. + */ + public static final InventoryConfigurationOptionalFields ETAG = fromString("ETag"); + + /** + * Static value EncryptionStatus for InventoryConfigurationOptionalFields. + */ + public static final InventoryConfigurationOptionalFields ENCRYPTION_STATUS = fromString("EncryptionStatus"); + + /** + * Static value IntelligentTieringAccessTier for InventoryConfigurationOptionalFields. + */ + public static final InventoryConfigurationOptionalFields INTELLIGENT_TIERING_ACCESS_TIER + = fromString("IntelligentTieringAccessTier"); + + /** + * Static value IsMultipartUploaded for InventoryConfigurationOptionalFields. + */ + public static final InventoryConfigurationOptionalFields IS_MULTIPART_UPLOADED = fromString("IsMultipartUploaded"); + + /** + * Static value LastModifiedDate for InventoryConfigurationOptionalFields. + */ + public static final InventoryConfigurationOptionalFields LAST_MODIFIED_DATE = fromString("LastModifiedDate"); + + /** + * Static value ObjectAccessControlList for InventoryConfigurationOptionalFields. + */ + public static final InventoryConfigurationOptionalFields OBJECT_ACCESS_CONTROL_LIST + = fromString("ObjectAccessControlList"); + + /** + * Static value ObjectLockLegalHoldStatus for InventoryConfigurationOptionalFields. + */ + public static final InventoryConfigurationOptionalFields OBJECT_LOCK_LEGAL_HOLD_STATUS + = fromString("ObjectLockLegalHoldStatus"); + + /** + * Static value ObjectLockMode for InventoryConfigurationOptionalFields. + */ + public static final InventoryConfigurationOptionalFields OBJECT_LOCK_MODE = fromString("ObjectLockMode"); + + /** + * Static value ObjectLockRetainUntilDate for InventoryConfigurationOptionalFields. + */ + public static final InventoryConfigurationOptionalFields OBJECT_LOCK_RETAIN_UNTIL_DATE + = fromString("ObjectLockRetainUntilDate"); + + /** + * Static value ObjectOwner for InventoryConfigurationOptionalFields. + */ + public static final InventoryConfigurationOptionalFields OBJECT_OWNER = fromString("ObjectOwner"); + + /** + * Static value ReplicationStatus for InventoryConfigurationOptionalFields. + */ + public static final InventoryConfigurationOptionalFields REPLICATION_STATUS = fromString("ReplicationStatus"); + + /** + * Static value Size for InventoryConfigurationOptionalFields. + */ + public static final InventoryConfigurationOptionalFields SIZE = fromString("Size"); + + /** + * Static value StorageClass for InventoryConfigurationOptionalFields. + */ + public static final InventoryConfigurationOptionalFields STORAGE_CLASS = fromString("StorageClass"); + + /** + * Creates a new instance of InventoryConfigurationOptionalFields value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public InventoryConfigurationOptionalFields() { + } + + /** + * Creates or finds a InventoryConfigurationOptionalFields from its string representation. + * + * @param name a name to look for. + * @return the corresponding InventoryConfigurationOptionalFields. + */ + public static InventoryConfigurationOptionalFields fromString(String name) { + return fromString(name, InventoryConfigurationOptionalFields.class); + } + + /** + * Gets known InventoryConfigurationOptionalFields values. + * + * @return known InventoryConfigurationOptionalFields values. + */ + public static Collection values() { + return values(InventoryConfigurationOptionalFields.class); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/InventoryConfigurationScheduleFrequency.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/InventoryConfigurationScheduleFrequency.java new file mode 100644 index 000000000000..4fc9c2618c09 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/InventoryConfigurationScheduleFrequency.java @@ -0,0 +1,52 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * InventoryConfigurationScheduleFrequency enum. + */ +public final class InventoryConfigurationScheduleFrequency + extends ExpandableStringEnum { + /** + * Static value Daily for InventoryConfigurationScheduleFrequency. + */ + public static final InventoryConfigurationScheduleFrequency DAILY = fromString("Daily"); + + /** + * Static value Weekly for InventoryConfigurationScheduleFrequency. + */ + public static final InventoryConfigurationScheduleFrequency WEEKLY = fromString("Weekly"); + + /** + * Creates a new instance of InventoryConfigurationScheduleFrequency value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public InventoryConfigurationScheduleFrequency() { + } + + /** + * Creates or finds a InventoryConfigurationScheduleFrequency from its string representation. + * + * @param name a name to look for. + * @return the corresponding InventoryConfigurationScheduleFrequency. + */ + public static InventoryConfigurationScheduleFrequency fromString(String name) { + return fromString(name, InventoryConfigurationScheduleFrequency.class); + } + + /** + * Gets known InventoryConfigurationScheduleFrequency values. + * + * @return known InventoryConfigurationScheduleFrequency values. + */ + public static Collection values() { + return values(InventoryConfigurationScheduleFrequency.class); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/IpAddressType.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/IpAddressType.java new file mode 100644 index 000000000000..d152fb111242 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/IpAddressType.java @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * IPAddressType enum. + */ +public final class IpAddressType extends ExpandableStringEnum { + /** + * Static value dualstack for IpAddressType. + */ + public static final IpAddressType DUALSTACK = fromString("dualstack"); + + /** + * Static value ipv4 for IpAddressType. + */ + public static final IpAddressType IPV4 = fromString("ipv4"); + + /** + * Creates a new instance of IpAddressType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public IpAddressType() { + } + + /** + * Creates or finds a IpAddressType from its string representation. + * + * @param name a name to look for. + * @return the corresponding IpAddressType. + */ + public static IpAddressType fromString(String name) { + return fromString(name, IpAddressType.class); + } + + /** + * Gets known IpAddressType values. + * + * @return known IpAddressType values. + */ + public static Collection values() { + return values(IpAddressType.class); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/IpAddressTypeEnumValue.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/IpAddressTypeEnumValue.java new file mode 100644 index 000000000000..7a0d5fd4ac25 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/IpAddressTypeEnumValue.java @@ -0,0 +1,93 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of IPAddressTypeEnumValue. + */ +@Fluent +public final class IpAddressTypeEnumValue implements JsonSerializable { + /* + * Property value + */ + private IpAddressType value; + + /** + * Creates an instance of IpAddressTypeEnumValue class. + */ + public IpAddressTypeEnumValue() { + } + + /** + * Get the value property: Property value. + * + * @return the value value. + */ + public IpAddressType value() { + return this.value; + } + + /** + * Set the value property: Property value. + * + * @param value the value value to set. + * @return the IpAddressTypeEnumValue object itself. + */ + public IpAddressTypeEnumValue withValue(IpAddressType value) { + this.value = value; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("value", this.value == null ? null : this.value.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of IpAddressTypeEnumValue from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of IpAddressTypeEnumValue if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the IpAddressTypeEnumValue. + */ + public static IpAddressTypeEnumValue fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + IpAddressTypeEnumValue deserializedIpAddressTypeEnumValue = new IpAddressTypeEnumValue(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + deserializedIpAddressTypeEnumValue.value = IpAddressType.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedIpAddressTypeEnumValue; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/IpFamily.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/IpFamily.java new file mode 100644 index 000000000000..177d84aa7a8d --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/IpFamily.java @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * IpFamily enum. + */ +public final class IpFamily extends ExpandableStringEnum { + /** + * Static value ipv4 for IpFamily. + */ + public static final IpFamily IPV4 = fromString("ipv4"); + + /** + * Static value ipv6 for IpFamily. + */ + public static final IpFamily IPV6 = fromString("ipv6"); + + /** + * Creates a new instance of IpFamily value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public IpFamily() { + } + + /** + * Creates or finds a IpFamily from its string representation. + * + * @param name a name to look for. + * @return the corresponding IpFamily. + */ + public static IpFamily fromString(String name) { + return fromString(name, IpFamily.class); + } + + /** + * Gets known IpFamily values. + * + * @return known IpFamily values. + */ + public static Collection values() { + return values(IpFamily.class); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/IpFamilyEnumValue.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/IpFamilyEnumValue.java new file mode 100644 index 000000000000..6bf5522f5aaf --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/IpFamilyEnumValue.java @@ -0,0 +1,93 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of IpFamilyEnumValue. + */ +@Fluent +public final class IpFamilyEnumValue implements JsonSerializable { + /* + * Property value + */ + private IpFamily value; + + /** + * Creates an instance of IpFamilyEnumValue class. + */ + public IpFamilyEnumValue() { + } + + /** + * Get the value property: Property value. + * + * @return the value value. + */ + public IpFamily value() { + return this.value; + } + + /** + * Set the value property: Property value. + * + * @param value the value value to set. + * @return the IpFamilyEnumValue object itself. + */ + public IpFamilyEnumValue withValue(IpFamily value) { + this.value = value; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("value", this.value == null ? null : this.value.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of IpFamilyEnumValue from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of IpFamilyEnumValue if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the IpFamilyEnumValue. + */ + public static IpFamilyEnumValue fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + IpFamilyEnumValue deserializedIpFamilyEnumValue = new IpFamilyEnumValue(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + deserializedIpFamilyEnumValue.value = IpFamily.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedIpFamilyEnumValue; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/IpPermission.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/IpPermission.java new file mode 100644 index 000000000000..762dc27b3116 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/IpPermission.java @@ -0,0 +1,315 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Definition of IpPermission. + */ +@Fluent +public final class IpPermission implements JsonSerializable { + /* + *

If the protocol is TCP or UDP, this is the start of the port range. If the protocol is ICMP or ICMPv6, this is + * the ICMP type or -1 (all ICMP types).

+ */ + private Integer fromPort; + + /* + *

The IP protocol name (tcp, udp, icmp, icmpv6) or number + * (see Protocol Numbers).

+ *

Use -1 to specify all protocols. When authorizing security group rules, specifying + * -1 or a protocol number other than tcp, udp, icmp, or + * icmpv6 allows traffic on all ports, regardless of any port range you specify. For tcp, + * udp, and icmp, you must specify a port range. For icmpv6, the port range + * is optional; if you omit the port range, traffic for all types and codes is allowed.

+ */ + private String ipProtocol; + + /* + *

The IPv4 address ranges.

+ */ + private List ipRanges; + + /* + *

The IPv6 address ranges.

+ */ + private List ipv6Ranges; + + /* + *

The prefix list IDs.

+ */ + private List prefixListIds; + + /* + *

If the protocol is TCP or UDP, this is the end of the port range. If the protocol is ICMP or ICMPv6, this is + * the ICMP code or -1 (all ICMP codes). If the start port is -1 (all ICMP types), then the end port must be -1 (all + * ICMP codes).

+ */ + private Integer toPort; + + /* + *

The security group and Amazon Web Services account ID pairs.

+ */ + private List userIdGroupPairs; + + /** + * Creates an instance of IpPermission class. + */ + public IpPermission() { + } + + /** + * Get the fromPort property: <p>If the protocol is TCP or UDP, this is the start of the port range. If the + * protocol is ICMP or ICMPv6, this is the ICMP type or -1 (all ICMP types).</p>. + * + * @return the fromPort value. + */ + public Integer fromPort() { + return this.fromPort; + } + + /** + * Set the fromPort property: <p>If the protocol is TCP or UDP, this is the start of the port range. If the + * protocol is ICMP or ICMPv6, this is the ICMP type or -1 (all ICMP types).</p>. + * + * @param fromPort the fromPort value to set. + * @return the IpPermission object itself. + */ + public IpPermission withFromPort(Integer fromPort) { + this.fromPort = fromPort; + return this; + } + + /** + * Get the ipProtocol property: <p>The IP protocol name (<code>tcp</code>, + * <code>udp</code>, <code>icmp</code>, <code>icmpv6</code>) or number (see + * <a href='http://www.iana.org/assignments/protocol-numbers/protocol-numbers.xhtml'>Protocol + * Numbers</a>).</p> <p>Use <code>-1</code> to specify all protocols. When authorizing + * security group rules, specifying <code>-1</code> or a protocol number other than + * <code>tcp</code>, <code>udp</code>, <code>icmp</code>, or + * <code>icmpv6</code> allows traffic on all ports, regardless of any port range you specify. For + * <code>tcp</code>, <code>udp</code>, and <code>icmp</code>, you must specify a + * port range. For <code>icmpv6</code>, the port range is optional; if you omit the port range, traffic + * for all types and codes is allowed.</p>. + * + * @return the ipProtocol value. + */ + public String ipProtocol() { + return this.ipProtocol; + } + + /** + * Set the ipProtocol property: <p>The IP protocol name (<code>tcp</code>, + * <code>udp</code>, <code>icmp</code>, <code>icmpv6</code>) or number (see + * <a href='http://www.iana.org/assignments/protocol-numbers/protocol-numbers.xhtml'>Protocol + * Numbers</a>).</p> <p>Use <code>-1</code> to specify all protocols. When authorizing + * security group rules, specifying <code>-1</code> or a protocol number other than + * <code>tcp</code>, <code>udp</code>, <code>icmp</code>, or + * <code>icmpv6</code> allows traffic on all ports, regardless of any port range you specify. For + * <code>tcp</code>, <code>udp</code>, and <code>icmp</code>, you must specify a + * port range. For <code>icmpv6</code>, the port range is optional; if you omit the port range, traffic + * for all types and codes is allowed.</p>. + * + * @param ipProtocol the ipProtocol value to set. + * @return the IpPermission object itself. + */ + public IpPermission withIpProtocol(String ipProtocol) { + this.ipProtocol = ipProtocol; + return this; + } + + /** + * Get the ipRanges property: <p>The IPv4 address ranges.</p>. + * + * @return the ipRanges value. + */ + public List ipRanges() { + return this.ipRanges; + } + + /** + * Set the ipRanges property: <p>The IPv4 address ranges.</p>. + * + * @param ipRanges the ipRanges value to set. + * @return the IpPermission object itself. + */ + public IpPermission withIpRanges(List ipRanges) { + this.ipRanges = ipRanges; + return this; + } + + /** + * Get the ipv6Ranges property: <p>The IPv6 address ranges.</p>. + * + * @return the ipv6Ranges value. + */ + public List ipv6Ranges() { + return this.ipv6Ranges; + } + + /** + * Set the ipv6Ranges property: <p>The IPv6 address ranges.</p>. + * + * @param ipv6Ranges the ipv6Ranges value to set. + * @return the IpPermission object itself. + */ + public IpPermission withIpv6Ranges(List ipv6Ranges) { + this.ipv6Ranges = ipv6Ranges; + return this; + } + + /** + * Get the prefixListIds property: <p>The prefix list IDs.</p>. + * + * @return the prefixListIds value. + */ + public List prefixListIds() { + return this.prefixListIds; + } + + /** + * Set the prefixListIds property: <p>The prefix list IDs.</p>. + * + * @param prefixListIds the prefixListIds value to set. + * @return the IpPermission object itself. + */ + public IpPermission withPrefixListIds(List prefixListIds) { + this.prefixListIds = prefixListIds; + return this; + } + + /** + * Get the toPort property: <p>If the protocol is TCP or UDP, this is the end of the port range. If the + * protocol is ICMP or ICMPv6, this is the ICMP code or -1 (all ICMP codes). If the start port is -1 (all ICMP + * types), then the end port must be -1 (all ICMP codes).</p>. + * + * @return the toPort value. + */ + public Integer toPort() { + return this.toPort; + } + + /** + * Set the toPort property: <p>If the protocol is TCP or UDP, this is the end of the port range. If the + * protocol is ICMP or ICMPv6, this is the ICMP code or -1 (all ICMP codes). If the start port is -1 (all ICMP + * types), then the end port must be -1 (all ICMP codes).</p>. + * + * @param toPort the toPort value to set. + * @return the IpPermission object itself. + */ + public IpPermission withToPort(Integer toPort) { + this.toPort = toPort; + return this; + } + + /** + * Get the userIdGroupPairs property: <p>The security group and Amazon Web Services account ID + * pairs.</p>. + * + * @return the userIdGroupPairs value. + */ + public List userIdGroupPairs() { + return this.userIdGroupPairs; + } + + /** + * Set the userIdGroupPairs property: <p>The security group and Amazon Web Services account ID + * pairs.</p>. + * + * @param userIdGroupPairs the userIdGroupPairs value to set. + * @return the IpPermission object itself. + */ + public IpPermission withUserIdGroupPairs(List userIdGroupPairs) { + this.userIdGroupPairs = userIdGroupPairs; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (ipRanges() != null) { + ipRanges().forEach(e -> e.validate()); + } + if (ipv6Ranges() != null) { + ipv6Ranges().forEach(e -> e.validate()); + } + if (prefixListIds() != null) { + prefixListIds().forEach(e -> e.validate()); + } + if (userIdGroupPairs() != null) { + userIdGroupPairs().forEach(e -> e.validate()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeNumberField("fromPort", this.fromPort); + jsonWriter.writeStringField("ipProtocol", this.ipProtocol); + jsonWriter.writeArrayField("ipRanges", this.ipRanges, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("ipv6Ranges", this.ipv6Ranges, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("prefixListIds", this.prefixListIds, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeNumberField("toPort", this.toPort); + jsonWriter.writeArrayField("userIdGroupPairs", this.userIdGroupPairs, + (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of IpPermission from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of IpPermission if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the IpPermission. + */ + public static IpPermission fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + IpPermission deserializedIpPermission = new IpPermission(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("fromPort".equals(fieldName)) { + deserializedIpPermission.fromPort = reader.getNullable(JsonReader::getInt); + } else if ("ipProtocol".equals(fieldName)) { + deserializedIpPermission.ipProtocol = reader.getString(); + } else if ("ipRanges".equals(fieldName)) { + List ipRanges = reader.readArray(reader1 -> IpRange.fromJson(reader1)); + deserializedIpPermission.ipRanges = ipRanges; + } else if ("ipv6Ranges".equals(fieldName)) { + List ipv6Ranges = reader.readArray(reader1 -> Ipv6Range.fromJson(reader1)); + deserializedIpPermission.ipv6Ranges = ipv6Ranges; + } else if ("prefixListIds".equals(fieldName)) { + List prefixListIds = reader.readArray(reader1 -> PrefixListId.fromJson(reader1)); + deserializedIpPermission.prefixListIds = prefixListIds; + } else if ("toPort".equals(fieldName)) { + deserializedIpPermission.toPort = reader.getNullable(JsonReader::getInt); + } else if ("userIdGroupPairs".equals(fieldName)) { + List userIdGroupPairs + = reader.readArray(reader1 -> UserIdGroupPair.fromJson(reader1)); + deserializedIpPermission.userIdGroupPairs = userIdGroupPairs; + } else { + reader.skipChildren(); + } + } + + return deserializedIpPermission; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/IpRange.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/IpRange.java new file mode 100644 index 000000000000..87d5202f7ad5 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/IpRange.java @@ -0,0 +1,129 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of IpRange. + */ +@Fluent +public final class IpRange implements JsonSerializable { + /* + *

The IPv4 address range. You can either specify a CIDR block or a source security group, not both. To specify a + * single IPv4 address, use the /32 prefix length.

+ */ + private String cidrIp; + + /* + *

A description for the security group rule that references this IPv4 address range.

Constraints: Up to + * 255 characters in length. Allowed characters are a-z, A-Z, 0-9, spaces, and ._-:/()#,@[]+=&;{}!$*

+ */ + private String description; + + /** + * Creates an instance of IpRange class. + */ + public IpRange() { + } + + /** + * Get the cidrIp property: <p>The IPv4 address range. You can either specify a CIDR block or a source + * security group, not both. To specify a single IPv4 address, use the /32 prefix length.</p>. + * + * @return the cidrIp value. + */ + public String cidrIp() { + return this.cidrIp; + } + + /** + * Set the cidrIp property: <p>The IPv4 address range. You can either specify a CIDR block or a source + * security group, not both. To specify a single IPv4 address, use the /32 prefix length.</p>. + * + * @param cidrIp the cidrIp value to set. + * @return the IpRange object itself. + */ + public IpRange withCidrIp(String cidrIp) { + this.cidrIp = cidrIp; + return this; + } + + /** + * Get the description property: <p>A description for the security group rule that references this IPv4 + * address range.</p> <p>Constraints: Up to 255 characters in length. Allowed characters are a-z, A-Z, + * 0-9, spaces, and ._-:/()#,@[]+=&amp;;{}!$*</p>. + * + * @return the description value. + */ + public String description() { + return this.description; + } + + /** + * Set the description property: <p>A description for the security group rule that references this IPv4 + * address range.</p> <p>Constraints: Up to 255 characters in length. Allowed characters are a-z, A-Z, + * 0-9, spaces, and ._-:/()#,@[]+=&amp;;{}!$*</p>. + * + * @param description the description value to set. + * @return the IpRange object itself. + */ + public IpRange withDescription(String description) { + this.description = description; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("cidrIp", this.cidrIp); + jsonWriter.writeStringField("description", this.description); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of IpRange from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of IpRange if the JsonReader was pointing to an instance of it, or null if it was pointing to + * JSON null. + * @throws IOException If an error occurs while reading the IpRange. + */ + public static IpRange fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + IpRange deserializedIpRange = new IpRange(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("cidrIp".equals(fieldName)) { + deserializedIpRange.cidrIp = reader.getString(); + } else if ("description".equals(fieldName)) { + deserializedIpRange.description = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedIpRange; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/IpSet.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/IpSet.java new file mode 100644 index 000000000000..82791d4db148 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/IpSet.java @@ -0,0 +1,95 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Definition of IPSet. + */ +@Fluent +public final class IpSet implements JsonSerializable { + /* + * Property definition + */ + private List definition; + + /** + * Creates an instance of IpSet class. + */ + public IpSet() { + } + + /** + * Get the definition property: Property definition. + * + * @return the definition value. + */ + public List definition() { + return this.definition; + } + + /** + * Set the definition property: Property definition. + * + * @param definition the definition value to set. + * @return the IpSet object itself. + */ + public IpSet withDefinition(List definition) { + this.definition = definition; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("definition", this.definition, (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of IpSet from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of IpSet if the JsonReader was pointing to an instance of it, or null if it was pointing to + * JSON null. + * @throws IOException If an error occurs while reading the IpSet. + */ + public static IpSet fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + IpSet deserializedIpSet = new IpSet(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("definition".equals(fieldName)) { + List definition = reader.readArray(reader1 -> reader1.getString()); + deserializedIpSet.definition = definition; + } else { + reader.skipChildren(); + } + } + + return deserializedIpSet; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/IpSetReference.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/IpSetReference.java new file mode 100644 index 000000000000..44924b38b6bc --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/IpSetReference.java @@ -0,0 +1,93 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of IPSetReference. + */ +@Fluent +public final class IpSetReference implements JsonSerializable { + /* + * A resource ARN. + */ + private String referenceArn; + + /** + * Creates an instance of IpSetReference class. + */ + public IpSetReference() { + } + + /** + * Get the referenceArn property: A resource ARN. + * + * @return the referenceArn value. + */ + public String referenceArn() { + return this.referenceArn; + } + + /** + * Set the referenceArn property: A resource ARN. + * + * @param referenceArn the referenceArn value to set. + * @return the IpSetReference object itself. + */ + public IpSetReference withReferenceArn(String referenceArn) { + this.referenceArn = referenceArn; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("referenceArn", this.referenceArn); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of IpSetReference from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of IpSetReference if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the IpSetReference. + */ + public static IpSetReference fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + IpSetReference deserializedIpSetReference = new IpSetReference(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("referenceArn".equals(fieldName)) { + deserializedIpSetReference.referenceArn = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedIpSetReference; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/IpamOperatingRegion.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/IpamOperatingRegion.java new file mode 100644 index 000000000000..ceddd2e4310f --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/IpamOperatingRegion.java @@ -0,0 +1,93 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of IpamOperatingRegion. + */ +@Fluent +public final class IpamOperatingRegion implements JsonSerializable { + /* + *

The name of the operating Region.

+ */ + private String regionName; + + /** + * Creates an instance of IpamOperatingRegion class. + */ + public IpamOperatingRegion() { + } + + /** + * Get the regionName property: <p>The name of the operating Region.</p>. + * + * @return the regionName value. + */ + public String regionName() { + return this.regionName; + } + + /** + * Set the regionName property: <p>The name of the operating Region.</p>. + * + * @param regionName the regionName value to set. + * @return the IpamOperatingRegion object itself. + */ + public IpamOperatingRegion withRegionName(String regionName) { + this.regionName = regionName; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("regionName", this.regionName); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of IpamOperatingRegion from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of IpamOperatingRegion if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the IpamOperatingRegion. + */ + public static IpamOperatingRegion fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + IpamOperatingRegion deserializedIpamOperatingRegion = new IpamOperatingRegion(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("regionName".equals(fieldName)) { + deserializedIpamOperatingRegion.regionName = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedIpamOperatingRegion; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/IpamState.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/IpamState.java new file mode 100644 index 000000000000..930b619d3231 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/IpamState.java @@ -0,0 +1,101 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * IpamState enum. + */ +public final class IpamState extends ExpandableStringEnum { + /** + * Static value create-complete for IpamState. + */ + public static final IpamState CREATE_COMPLETE = fromString("create-complete"); + + /** + * Static value create-failed for IpamState. + */ + public static final IpamState CREATE_FAILED = fromString("create-failed"); + + /** + * Static value create-in-progress for IpamState. + */ + public static final IpamState CREATE_IN_PROGRESS = fromString("create-in-progress"); + + /** + * Static value delete-complete for IpamState. + */ + public static final IpamState DELETE_COMPLETE = fromString("delete-complete"); + + /** + * Static value delete-failed for IpamState. + */ + public static final IpamState DELETE_FAILED = fromString("delete-failed"); + + /** + * Static value delete-in-progress for IpamState. + */ + public static final IpamState DELETE_IN_PROGRESS = fromString("delete-in-progress"); + + /** + * Static value isolate-complete for IpamState. + */ + public static final IpamState ISOLATE_COMPLETE = fromString("isolate-complete"); + + /** + * Static value isolate-in-progress for IpamState. + */ + public static final IpamState ISOLATE_IN_PROGRESS = fromString("isolate-in-progress"); + + /** + * Static value modify-complete for IpamState. + */ + public static final IpamState MODIFY_COMPLETE = fromString("modify-complete"); + + /** + * Static value modify-failed for IpamState. + */ + public static final IpamState MODIFY_FAILED = fromString("modify-failed"); + + /** + * Static value modify-in-progress for IpamState. + */ + public static final IpamState MODIFY_IN_PROGRESS = fromString("modify-in-progress"); + + /** + * Static value restore-in-progress for IpamState. + */ + public static final IpamState RESTORE_IN_PROGRESS = fromString("restore-in-progress"); + + /** + * Creates a new instance of IpamState value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public IpamState() { + } + + /** + * Creates or finds a IpamState from its string representation. + * + * @param name a name to look for. + * @return the corresponding IpamState. + */ + public static IpamState fromString(String name) { + return fromString(name, IpamState.class); + } + + /** + * Gets known IpamState values. + * + * @return known IpamState values. + */ + public static Collection values() { + return values(IpamState.class); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/IpamStateEnumValue.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/IpamStateEnumValue.java new file mode 100644 index 000000000000..c91c9ae65bb0 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/IpamStateEnumValue.java @@ -0,0 +1,93 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of IpamStateEnumValue. + */ +@Fluent +public final class IpamStateEnumValue implements JsonSerializable { + /* + * Property value + */ + private IpamState value; + + /** + * Creates an instance of IpamStateEnumValue class. + */ + public IpamStateEnumValue() { + } + + /** + * Get the value property: Property value. + * + * @return the value value. + */ + public IpamState value() { + return this.value; + } + + /** + * Set the value property: Property value. + * + * @param value the value value to set. + * @return the IpamStateEnumValue object itself. + */ + public IpamStateEnumValue withValue(IpamState value) { + this.value = value; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("value", this.value == null ? null : this.value.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of IpamStateEnumValue from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of IpamStateEnumValue if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the IpamStateEnumValue. + */ + public static IpamStateEnumValue fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + IpamStateEnumValue deserializedIpamStateEnumValue = new IpamStateEnumValue(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + deserializedIpamStateEnumValue.value = IpamState.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedIpamStateEnumValue; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/IpamTier.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/IpamTier.java new file mode 100644 index 000000000000..cc00f333a655 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/IpamTier.java @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * IpamTier enum. + */ +public final class IpamTier extends ExpandableStringEnum { + /** + * Static value advanced for IpamTier. + */ + public static final IpamTier ADVANCED = fromString("advanced"); + + /** + * Static value free for IpamTier. + */ + public static final IpamTier FREE = fromString("free"); + + /** + * Creates a new instance of IpamTier value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public IpamTier() { + } + + /** + * Creates or finds a IpamTier from its string representation. + * + * @param name a name to look for. + * @return the corresponding IpamTier. + */ + public static IpamTier fromString(String name) { + return fromString(name, IpamTier.class); + } + + /** + * Gets known IpamTier values. + * + * @return known IpamTier values. + */ + public static Collection values() { + return values(IpamTier.class); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/IpamTierEnumValue.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/IpamTierEnumValue.java new file mode 100644 index 000000000000..dd7d6ffc72dc --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/IpamTierEnumValue.java @@ -0,0 +1,93 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of IpamTierEnumValue. + */ +@Fluent +public final class IpamTierEnumValue implements JsonSerializable { + /* + * Property value + */ + private IpamTier value; + + /** + * Creates an instance of IpamTierEnumValue class. + */ + public IpamTierEnumValue() { + } + + /** + * Get the value property: Property value. + * + * @return the value value. + */ + public IpamTier value() { + return this.value; + } + + /** + * Set the value property: Property value. + * + * @param value the value value to set. + * @return the IpamTierEnumValue object itself. + */ + public IpamTierEnumValue withValue(IpamTier value) { + this.value = value; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("value", this.value == null ? null : this.value.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of IpamTierEnumValue from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of IpamTierEnumValue if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the IpamTierEnumValue. + */ + public static IpamTierEnumValue fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + IpamTierEnumValue deserializedIpamTierEnumValue = new IpamTierEnumValue(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + deserializedIpamTierEnumValue.value = IpamTier.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedIpamTierEnumValue; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/Ipv4PrefixSpecification.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/Ipv4PrefixSpecification.java new file mode 100644 index 000000000000..c212bbba1fea --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/Ipv4PrefixSpecification.java @@ -0,0 +1,93 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of Ipv4PrefixSpecification. + */ +@Fluent +public final class Ipv4PrefixSpecification implements JsonSerializable { + /* + * Property ipv4Prefix + */ + private String ipv4Prefix; + + /** + * Creates an instance of Ipv4PrefixSpecification class. + */ + public Ipv4PrefixSpecification() { + } + + /** + * Get the ipv4Prefix property: Property ipv4Prefix. + * + * @return the ipv4Prefix value. + */ + public String ipv4Prefix() { + return this.ipv4Prefix; + } + + /** + * Set the ipv4Prefix property: Property ipv4Prefix. + * + * @param ipv4Prefix the ipv4Prefix value to set. + * @return the Ipv4PrefixSpecification object itself. + */ + public Ipv4PrefixSpecification withIpv4Prefix(String ipv4Prefix) { + this.ipv4Prefix = ipv4Prefix; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("ipv4Prefix", this.ipv4Prefix); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of Ipv4PrefixSpecification from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of Ipv4PrefixSpecification if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the Ipv4PrefixSpecification. + */ + public static Ipv4PrefixSpecification fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + Ipv4PrefixSpecification deserializedIpv4PrefixSpecification = new Ipv4PrefixSpecification(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("ipv4Prefix".equals(fieldName)) { + deserializedIpv4PrefixSpecification.ipv4Prefix = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedIpv4PrefixSpecification; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/Ipv6PrefixSpecification.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/Ipv6PrefixSpecification.java new file mode 100644 index 000000000000..288082a37971 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/Ipv6PrefixSpecification.java @@ -0,0 +1,93 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of Ipv6PrefixSpecification. + */ +@Fluent +public final class Ipv6PrefixSpecification implements JsonSerializable { + /* + * Property ipv6Prefix + */ + private String ipv6Prefix; + + /** + * Creates an instance of Ipv6PrefixSpecification class. + */ + public Ipv6PrefixSpecification() { + } + + /** + * Get the ipv6Prefix property: Property ipv6Prefix. + * + * @return the ipv6Prefix value. + */ + public String ipv6Prefix() { + return this.ipv6Prefix; + } + + /** + * Set the ipv6Prefix property: Property ipv6Prefix. + * + * @param ipv6Prefix the ipv6Prefix value to set. + * @return the Ipv6PrefixSpecification object itself. + */ + public Ipv6PrefixSpecification withIpv6Prefix(String ipv6Prefix) { + this.ipv6Prefix = ipv6Prefix; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("ipv6Prefix", this.ipv6Prefix); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of Ipv6PrefixSpecification from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of Ipv6PrefixSpecification if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the Ipv6PrefixSpecification. + */ + public static Ipv6PrefixSpecification fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + Ipv6PrefixSpecification deserializedIpv6PrefixSpecification = new Ipv6PrefixSpecification(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("ipv6Prefix".equals(fieldName)) { + deserializedIpv6PrefixSpecification.ipv6Prefix = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedIpv6PrefixSpecification; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/Ipv6Range.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/Ipv6Range.java new file mode 100644 index 000000000000..f559f28e4797 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/Ipv6Range.java @@ -0,0 +1,129 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of Ipv6Range. + */ +@Fluent +public final class Ipv6Range implements JsonSerializable { + /* + *

The IPv6 address range. You can either specify a CIDR block or a source security group, not both. To specify a + * single IPv6 address, use the /128 prefix length.

+ */ + private String cidrIpv6; + + /* + *

A description for the security group rule that references this IPv6 address range.

Constraints: Up to + * 255 characters in length. Allowed characters are a-z, A-Z, 0-9, spaces, and ._-:/()#,@[]+=&;{}!$*

+ */ + private String description; + + /** + * Creates an instance of Ipv6Range class. + */ + public Ipv6Range() { + } + + /** + * Get the cidrIpv6 property: <p>The IPv6 address range. You can either specify a CIDR block or a source + * security group, not both. To specify a single IPv6 address, use the /128 prefix length.</p>. + * + * @return the cidrIpv6 value. + */ + public String cidrIpv6() { + return this.cidrIpv6; + } + + /** + * Set the cidrIpv6 property: <p>The IPv6 address range. You can either specify a CIDR block or a source + * security group, not both. To specify a single IPv6 address, use the /128 prefix length.</p>. + * + * @param cidrIpv6 the cidrIpv6 value to set. + * @return the Ipv6Range object itself. + */ + public Ipv6Range withCidrIpv6(String cidrIpv6) { + this.cidrIpv6 = cidrIpv6; + return this; + } + + /** + * Get the description property: <p>A description for the security group rule that references this IPv6 + * address range.</p> <p>Constraints: Up to 255 characters in length. Allowed characters are a-z, A-Z, + * 0-9, spaces, and ._-:/()#,@[]+=&amp;;{}!$*</p>. + * + * @return the description value. + */ + public String description() { + return this.description; + } + + /** + * Set the description property: <p>A description for the security group rule that references this IPv6 + * address range.</p> <p>Constraints: Up to 255 characters in length. Allowed characters are a-z, A-Z, + * 0-9, spaces, and ._-:/()#,@[]+=&amp;;{}!$*</p>. + * + * @param description the description value to set. + * @return the Ipv6Range object itself. + */ + public Ipv6Range withDescription(String description) { + this.description = description; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("cidrIpv6", this.cidrIpv6); + jsonWriter.writeStringField("description", this.description); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of Ipv6Range from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of Ipv6Range if the JsonReader was pointing to an instance of it, or null if it was pointing + * to JSON null. + * @throws IOException If an error occurs while reading the Ipv6Range. + */ + public static Ipv6Range fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + Ipv6Range deserializedIpv6Range = new Ipv6Range(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("cidrIpv6".equals(fieldName)) { + deserializedIpv6Range.cidrIpv6 = reader.getString(); + } else if ("description".equals(fieldName)) { + deserializedIpv6Range.description = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedIpv6Range; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/JobComparator.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/JobComparator.java new file mode 100644 index 000000000000..e986784c73eb --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/JobComparator.java @@ -0,0 +1,81 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * JobComparator enum. + */ +public final class JobComparator extends ExpandableStringEnum { + /** + * Static value CONTAINS for JobComparator. + */ + public static final JobComparator CONTAINS = fromString("CONTAINS"); + + /** + * Static value EQ for JobComparator. + */ + public static final JobComparator EQ = fromString("EQ"); + + /** + * Static value GT for JobComparator. + */ + public static final JobComparator GT = fromString("GT"); + + /** + * Static value GTE for JobComparator. + */ + public static final JobComparator GTE = fromString("GTE"); + + /** + * Static value LT for JobComparator. + */ + public static final JobComparator LT = fromString("LT"); + + /** + * Static value LTE for JobComparator. + */ + public static final JobComparator LTE = fromString("LTE"); + + /** + * Static value NE for JobComparator. + */ + public static final JobComparator NE = fromString("NE"); + + /** + * Static value STARTS_WITH for JobComparator. + */ + public static final JobComparator STARTS_WITH = fromString("STARTS_WITH"); + + /** + * Creates a new instance of JobComparator value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public JobComparator() { + } + + /** + * Creates or finds a JobComparator from its string representation. + * + * @param name a name to look for. + * @return the corresponding JobComparator. + */ + public static JobComparator fromString(String name) { + return fromString(name, JobComparator.class); + } + + /** + * Gets known JobComparator values. + * + * @return known JobComparator values. + */ + public static Collection values() { + return values(JobComparator.class); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/JobComparatorEnumValue.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/JobComparatorEnumValue.java new file mode 100644 index 000000000000..f75e91faa84c --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/JobComparatorEnumValue.java @@ -0,0 +1,93 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of JobComparatorEnumValue. + */ +@Fluent +public final class JobComparatorEnumValue implements JsonSerializable { + /* + * Property value + */ + private JobComparator value; + + /** + * Creates an instance of JobComparatorEnumValue class. + */ + public JobComparatorEnumValue() { + } + + /** + * Get the value property: Property value. + * + * @return the value value. + */ + public JobComparator value() { + return this.value; + } + + /** + * Set the value property: Property value. + * + * @param value the value value to set. + * @return the JobComparatorEnumValue object itself. + */ + public JobComparatorEnumValue withValue(JobComparator value) { + this.value = value; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("value", this.value == null ? null : this.value.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of JobComparatorEnumValue from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of JobComparatorEnumValue if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the JobComparatorEnumValue. + */ + public static JobComparatorEnumValue fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + JobComparatorEnumValue deserializedJobComparatorEnumValue = new JobComparatorEnumValue(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + deserializedJobComparatorEnumValue.value = JobComparator.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedJobComparatorEnumValue; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/JobStatus.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/JobStatus.java new file mode 100644 index 000000000000..df628cf7cf50 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/JobStatus.java @@ -0,0 +1,71 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * JobStatus enum. + */ +public final class JobStatus extends ExpandableStringEnum { + /** + * Static value CANCELLED for JobStatus. + */ + public static final JobStatus CANCELLED = fromString("CANCELLED"); + + /** + * Static value COMPLETE for JobStatus. + */ + public static final JobStatus COMPLETE = fromString("COMPLETE"); + + /** + * Static value IDLE for JobStatus. + */ + public static final JobStatus IDLE = fromString("IDLE"); + + /** + * Static value PAUSED for JobStatus. + */ + public static final JobStatus PAUSED = fromString("PAUSED"); + + /** + * Static value RUNNING for JobStatus. + */ + public static final JobStatus RUNNING = fromString("RUNNING"); + + /** + * Static value USER_PAUSED for JobStatus. + */ + public static final JobStatus USER_PAUSED = fromString("USER_PAUSED"); + + /** + * Creates a new instance of JobStatus value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public JobStatus() { + } + + /** + * Creates or finds a JobStatus from its string representation. + * + * @param name a name to look for. + * @return the corresponding JobStatus. + */ + public static JobStatus fromString(String name) { + return fromString(name, JobStatus.class); + } + + /** + * Gets known JobStatus values. + * + * @return known JobStatus values. + */ + public static Collection values() { + return values(JobStatus.class); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/JobStatusEnumValue.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/JobStatusEnumValue.java new file mode 100644 index 000000000000..0b5f9ac6e6e4 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/JobStatusEnumValue.java @@ -0,0 +1,93 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of JobStatusEnumValue. + */ +@Fluent +public final class JobStatusEnumValue implements JsonSerializable { + /* + * Property value + */ + private JobStatus value; + + /** + * Creates an instance of JobStatusEnumValue class. + */ + public JobStatusEnumValue() { + } + + /** + * Get the value property: Property value. + * + * @return the value value. + */ + public JobStatus value() { + return this.value; + } + + /** + * Set the value property: Property value. + * + * @param value the value value to set. + * @return the JobStatusEnumValue object itself. + */ + public JobStatusEnumValue withValue(JobStatus value) { + this.value = value; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("value", this.value == null ? null : this.value.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of JobStatusEnumValue from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of JobStatusEnumValue if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the JobStatusEnumValue. + */ + public static JobStatusEnumValue fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + JobStatusEnumValue deserializedJobStatusEnumValue = new JobStatusEnumValue(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + deserializedJobStatusEnumValue.value = JobStatus.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedJobStatusEnumValue; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/JobType.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/JobType.java new file mode 100644 index 000000000000..41e448f66eda --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/JobType.java @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * JobType enum. + */ +public final class JobType extends ExpandableStringEnum { + /** + * Static value ONE_TIME for JobType. + */ + public static final JobType ONE_TIME = fromString("ONE_TIME"); + + /** + * Static value SCHEDULED for JobType. + */ + public static final JobType SCHEDULED = fromString("SCHEDULED"); + + /** + * Creates a new instance of JobType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public JobType() { + } + + /** + * Creates or finds a JobType from its string representation. + * + * @param name a name to look for. + * @return the corresponding JobType. + */ + public static JobType fromString(String name) { + return fromString(name, JobType.class); + } + + /** + * Gets known JobType values. + * + * @return known JobType values. + */ + public static Collection values() { + return values(JobType.class); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/JobTypeEnumValue.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/JobTypeEnumValue.java new file mode 100644 index 000000000000..f69369936578 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/JobTypeEnumValue.java @@ -0,0 +1,93 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of JobTypeEnumValue. + */ +@Fluent +public final class JobTypeEnumValue implements JsonSerializable { + /* + * Property value + */ + private JobType value; + + /** + * Creates an instance of JobTypeEnumValue class. + */ + public JobTypeEnumValue() { + } + + /** + * Get the value property: Property value. + * + * @return the value value. + */ + public JobType value() { + return this.value; + } + + /** + * Set the value property: Property value. + * + * @param value the value value to set. + * @return the JobTypeEnumValue object itself. + */ + public JobTypeEnumValue withValue(JobType value) { + this.value = value; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("value", this.value == null ? null : this.value.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of JobTypeEnumValue from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of JobTypeEnumValue if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the JobTypeEnumValue. + */ + public static JobTypeEnumValue fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + JobTypeEnumValue deserializedJobTypeEnumValue = new JobTypeEnumValue(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + deserializedJobTypeEnumValue.value = JobType.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedJobTypeEnumValue; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/JoinedMethod.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/JoinedMethod.java new file mode 100644 index 000000000000..77e7599e85af --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/JoinedMethod.java @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * JoinedMethod enum. + */ +public final class JoinedMethod extends ExpandableStringEnum { + /** + * Static value CREATED for JoinedMethod. + */ + public static final JoinedMethod CREATED = fromString("CREATED"); + + /** + * Static value INVITED for JoinedMethod. + */ + public static final JoinedMethod INVITED = fromString("INVITED"); + + /** + * Creates a new instance of JoinedMethod value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public JoinedMethod() { + } + + /** + * Creates or finds a JoinedMethod from its string representation. + * + * @param name a name to look for. + * @return the corresponding JoinedMethod. + */ + public static JoinedMethod fromString(String name) { + return fromString(name, JoinedMethod.class); + } + + /** + * Gets known JoinedMethod values. + * + * @return known JoinedMethod values. + */ + public static Collection values() { + return values(JoinedMethod.class); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/KerberosAttributes.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/KerberosAttributes.java new file mode 100644 index 000000000000..7df791f18832 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/KerberosAttributes.java @@ -0,0 +1,223 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of KerberosAttributes. + */ +@Fluent +public final class KerberosAttributes implements JsonSerializable { + /* + *

The Active Directory password for ADDomainJoinUser.

+ */ + private String adDomainJoinPassword; + + /* + *

Required only when establishing a cross-realm trust with an Active Directory domain. A user with sufficient + * privileges to join resources to the domain.

+ */ + private String adDomainJoinUser; + + /* + *

Required only when establishing a cross-realm trust with a KDC in a different realm. The cross-realm principal + * password, which must be identical across realms.

+ */ + private String crossRealmTrustPrincipalPassword; + + /* + *

The password used within the cluster for the kadmin service on the cluster-dedicated KDC, which maintains + * Kerberos principals, password policies, and keytabs for the cluster.

+ */ + private String kdcAdminPassword; + + /* + *

The name of the Kerberos realm to which all nodes in a cluster belong. For example, EC2.INTERNAL. + *

+ */ + private String realm; + + /** + * Creates an instance of KerberosAttributes class. + */ + public KerberosAttributes() { + } + + /** + * Get the adDomainJoinPassword property: <p>The Active Directory password for + * <code>ADDomainJoinUser</code>.</p>. + * + * @return the adDomainJoinPassword value. + */ + public String adDomainJoinPassword() { + return this.adDomainJoinPassword; + } + + /** + * Set the adDomainJoinPassword property: <p>The Active Directory password for + * <code>ADDomainJoinUser</code>.</p>. + * + * @param adDomainJoinPassword the adDomainJoinPassword value to set. + * @return the KerberosAttributes object itself. + */ + public KerberosAttributes withAdDomainJoinPassword(String adDomainJoinPassword) { + this.adDomainJoinPassword = adDomainJoinPassword; + return this; + } + + /** + * Get the adDomainJoinUser property: <p>Required only when establishing a cross-realm trust with an Active + * Directory domain. A user with sufficient privileges to join resources to the domain.</p>. + * + * @return the adDomainJoinUser value. + */ + public String adDomainJoinUser() { + return this.adDomainJoinUser; + } + + /** + * Set the adDomainJoinUser property: <p>Required only when establishing a cross-realm trust with an Active + * Directory domain. A user with sufficient privileges to join resources to the domain.</p>. + * + * @param adDomainJoinUser the adDomainJoinUser value to set. + * @return the KerberosAttributes object itself. + */ + public KerberosAttributes withAdDomainJoinUser(String adDomainJoinUser) { + this.adDomainJoinUser = adDomainJoinUser; + return this; + } + + /** + * Get the crossRealmTrustPrincipalPassword property: <p>Required only when establishing a cross-realm trust + * with a KDC in a different realm. The cross-realm principal password, which must be identical across + * realms.</p>. + * + * @return the crossRealmTrustPrincipalPassword value. + */ + public String crossRealmTrustPrincipalPassword() { + return this.crossRealmTrustPrincipalPassword; + } + + /** + * Set the crossRealmTrustPrincipalPassword property: <p>Required only when establishing a cross-realm trust + * with a KDC in a different realm. The cross-realm principal password, which must be identical across + * realms.</p>. + * + * @param crossRealmTrustPrincipalPassword the crossRealmTrustPrincipalPassword value to set. + * @return the KerberosAttributes object itself. + */ + public KerberosAttributes withCrossRealmTrustPrincipalPassword(String crossRealmTrustPrincipalPassword) { + this.crossRealmTrustPrincipalPassword = crossRealmTrustPrincipalPassword; + return this; + } + + /** + * Get the kdcAdminPassword property: <p>The password used within the cluster for the kadmin service on the + * cluster-dedicated KDC, which maintains Kerberos principals, password policies, and keytabs for the + * cluster.</p>. + * + * @return the kdcAdminPassword value. + */ + public String kdcAdminPassword() { + return this.kdcAdminPassword; + } + + /** + * Set the kdcAdminPassword property: <p>The password used within the cluster for the kadmin service on the + * cluster-dedicated KDC, which maintains Kerberos principals, password policies, and keytabs for the + * cluster.</p>. + * + * @param kdcAdminPassword the kdcAdminPassword value to set. + * @return the KerberosAttributes object itself. + */ + public KerberosAttributes withKdcAdminPassword(String kdcAdminPassword) { + this.kdcAdminPassword = kdcAdminPassword; + return this; + } + + /** + * Get the realm property: <p>The name of the Kerberos realm to which all nodes in a cluster belong. For + * example, <code>EC2.INTERNAL</code>. </p>. + * + * @return the realm value. + */ + public String realm() { + return this.realm; + } + + /** + * Set the realm property: <p>The name of the Kerberos realm to which all nodes in a cluster belong. For + * example, <code>EC2.INTERNAL</code>. </p>. + * + * @param realm the realm value to set. + * @return the KerberosAttributes object itself. + */ + public KerberosAttributes withRealm(String realm) { + this.realm = realm; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("adDomainJoinPassword", this.adDomainJoinPassword); + jsonWriter.writeStringField("adDomainJoinUser", this.adDomainJoinUser); + jsonWriter.writeStringField("crossRealmTrustPrincipalPassword", this.crossRealmTrustPrincipalPassword); + jsonWriter.writeStringField("kdcAdminPassword", this.kdcAdminPassword); + jsonWriter.writeStringField("realm", this.realm); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of KerberosAttributes from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of KerberosAttributes if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the KerberosAttributes. + */ + public static KerberosAttributes fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + KerberosAttributes deserializedKerberosAttributes = new KerberosAttributes(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("adDomainJoinPassword".equals(fieldName)) { + deserializedKerberosAttributes.adDomainJoinPassword = reader.getString(); + } else if ("adDomainJoinUser".equals(fieldName)) { + deserializedKerberosAttributes.adDomainJoinUser = reader.getString(); + } else if ("crossRealmTrustPrincipalPassword".equals(fieldName)) { + deserializedKerberosAttributes.crossRealmTrustPrincipalPassword = reader.getString(); + } else if ("kdcAdminPassword".equals(fieldName)) { + deserializedKerberosAttributes.kdcAdminPassword = reader.getString(); + } else if ("realm".equals(fieldName)) { + deserializedKerberosAttributes.realm = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedKerberosAttributes; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/KernelCapabilities.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/KernelCapabilities.java new file mode 100644 index 000000000000..a147e890fd09 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/KernelCapabilities.java @@ -0,0 +1,190 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Definition of KernelCapabilities. + */ +@Fluent +public final class KernelCapabilities implements JsonSerializable { + /* + * The Linux capabilities for the container that have been added to the default configuration provided by Docker. + * This parameter maps to ``CapAdd`` in the [Create a + * container](https://docs.aws.amazon.com/https://docs.docker.com/engine/api/v1.35/#operation/ContainerCreate) + * section of the [Docker Remote API](https://docs.aws.amazon.com/https://docs.docker.com/engine/api/v1.35/) and the + * ``--cap-add`` option to [docker + * run](https://docs.aws.amazon.com/https://docs.docker.com/engine/reference/run/#security-configuration). Tasks + * launched on FARGATElong only support adding the ``SYS_PTRACE`` kernel capability. Valid values: ``'ALL' | + * 'AUDIT_CONTROL' | 'AUDIT_WRITE' | 'BLOCK_SUSPEND' | 'CHOWN' | 'DAC_OVERRIDE' | 'DAC_READ_SEARCH' | 'FOWNER' | + * 'FSETID' | 'IPC_LOCK' | 'IPC_OWNER' | 'KILL' | 'LEASE' | 'LINUX_IMMUTABLE' | 'MAC_ADMIN' | 'MAC_OVERRIDE' | + * 'MKNOD' | 'NET_ADMIN' | 'NET_BIND_SERVICE' | 'NET_BROADCAST' | 'NET_RAW' | 'SETFCAP' | 'SETGID' | 'SETPCAP' | + * 'SETUID' | 'SYS_ADMIN' | 'SYS_BOOT' | 'SYS_CHROOT' | 'SYS_MODULE' | 'SYS_NICE' | 'SYS_PACCT' | 'SYS_PTRACE' | + * 'SYS_RAWIO' | 'SYS_RESOURCE' | 'SYS_TIME' | 'SYS_TTY_CONFIG' | 'SYSLOG' | 'WAKE_ALARM'`` + */ + private List add; + + /* + * The Linux capabilities for the container that have been removed from the default configuration provided by + * Docker. This parameter maps to ``CapDrop`` in the [Create a + * container](https://docs.aws.amazon.com/https://docs.docker.com/engine/api/v1.35/#operation/ContainerCreate) + * section of the [Docker Remote API](https://docs.aws.amazon.com/https://docs.docker.com/engine/api/v1.35/) and the + * ``--cap-drop`` option to [docker + * run](https://docs.aws.amazon.com/https://docs.docker.com/engine/reference/run/#security-configuration). Valid + * values: ``'ALL' | 'AUDIT_CONTROL' | 'AUDIT_WRITE' | 'BLOCK_SUSPEND' | 'CHOWN' | 'DAC_OVERRIDE' | + * 'DAC_READ_SEARCH' | 'FOWNER' | 'FSETID' | 'IPC_LOCK' | 'IPC_OWNER' | 'KILL' | 'LEASE' | 'LINUX_IMMUTABLE' | + * 'MAC_ADMIN' | 'MAC_OVERRIDE' | 'MKNOD' | 'NET_ADMIN' | 'NET_BIND_SERVICE' | 'NET_BROADCAST' | 'NET_RAW' | + * 'SETFCAP' | 'SETGID' | 'SETPCAP' | 'SETUID' | 'SYS_ADMIN' | 'SYS_BOOT' | 'SYS_CHROOT' | 'SYS_MODULE' | 'SYS_NICE' + * | 'SYS_PACCT' | 'SYS_PTRACE' | 'SYS_RAWIO' | 'SYS_RESOURCE' | 'SYS_TIME' | 'SYS_TTY_CONFIG' | 'SYSLOG' | + * 'WAKE_ALARM'`` + */ + private List drop; + + /** + * Creates an instance of KernelCapabilities class. + */ + public KernelCapabilities() { + } + + /** + * Get the add property: The Linux capabilities for the container that have been added to the default configuration + * provided by Docker. This parameter maps to ``CapAdd`` in the [Create a + * container](https://docs.aws.amazon.com/https://docs.docker.com/engine/api/v1.35/#operation/ContainerCreate) + * section of the [Docker Remote API](https://docs.aws.amazon.com/https://docs.docker.com/engine/api/v1.35/) and the + * ``--cap-add`` option to [docker + * run](https://docs.aws.amazon.com/https://docs.docker.com/engine/reference/run/#security-configuration). Tasks + * launched on FARGATElong only support adding the ``SYS_PTRACE`` kernel capability. Valid values: ``'ALL' | + * 'AUDIT_CONTROL' | 'AUDIT_WRITE' | 'BLOCK_SUSPEND' | 'CHOWN' | 'DAC_OVERRIDE' | 'DAC_READ_SEARCH' | 'FOWNER' | + * 'FSETID' | 'IPC_LOCK' | 'IPC_OWNER' | 'KILL' | 'LEASE' | 'LINUX_IMMUTABLE' | 'MAC_ADMIN' | 'MAC_OVERRIDE' | + * 'MKNOD' | 'NET_ADMIN' | 'NET_BIND_SERVICE' | 'NET_BROADCAST' | 'NET_RAW' | 'SETFCAP' | 'SETGID' | 'SETPCAP' | + * 'SETUID' | 'SYS_ADMIN' | 'SYS_BOOT' | 'SYS_CHROOT' | 'SYS_MODULE' | 'SYS_NICE' | 'SYS_PACCT' | 'SYS_PTRACE' | + * 'SYS_RAWIO' | 'SYS_RESOURCE' | 'SYS_TIME' | 'SYS_TTY_CONFIG' | 'SYSLOG' | 'WAKE_ALARM'``. + * + * @return the add value. + */ + public List add() { + return this.add; + } + + /** + * Set the add property: The Linux capabilities for the container that have been added to the default configuration + * provided by Docker. This parameter maps to ``CapAdd`` in the [Create a + * container](https://docs.aws.amazon.com/https://docs.docker.com/engine/api/v1.35/#operation/ContainerCreate) + * section of the [Docker Remote API](https://docs.aws.amazon.com/https://docs.docker.com/engine/api/v1.35/) and the + * ``--cap-add`` option to [docker + * run](https://docs.aws.amazon.com/https://docs.docker.com/engine/reference/run/#security-configuration). Tasks + * launched on FARGATElong only support adding the ``SYS_PTRACE`` kernel capability. Valid values: ``'ALL' | + * 'AUDIT_CONTROL' | 'AUDIT_WRITE' | 'BLOCK_SUSPEND' | 'CHOWN' | 'DAC_OVERRIDE' | 'DAC_READ_SEARCH' | 'FOWNER' | + * 'FSETID' | 'IPC_LOCK' | 'IPC_OWNER' | 'KILL' | 'LEASE' | 'LINUX_IMMUTABLE' | 'MAC_ADMIN' | 'MAC_OVERRIDE' | + * 'MKNOD' | 'NET_ADMIN' | 'NET_BIND_SERVICE' | 'NET_BROADCAST' | 'NET_RAW' | 'SETFCAP' | 'SETGID' | 'SETPCAP' | + * 'SETUID' | 'SYS_ADMIN' | 'SYS_BOOT' | 'SYS_CHROOT' | 'SYS_MODULE' | 'SYS_NICE' | 'SYS_PACCT' | 'SYS_PTRACE' | + * 'SYS_RAWIO' | 'SYS_RESOURCE' | 'SYS_TIME' | 'SYS_TTY_CONFIG' | 'SYSLOG' | 'WAKE_ALARM'``. + * + * @param add the add value to set. + * @return the KernelCapabilities object itself. + */ + public KernelCapabilities withAdd(List add) { + this.add = add; + return this; + } + + /** + * Get the drop property: The Linux capabilities for the container that have been removed from the default + * configuration provided by Docker. This parameter maps to ``CapDrop`` in the [Create a + * container](https://docs.aws.amazon.com/https://docs.docker.com/engine/api/v1.35/#operation/ContainerCreate) + * section of the [Docker Remote API](https://docs.aws.amazon.com/https://docs.docker.com/engine/api/v1.35/) and the + * ``--cap-drop`` option to [docker + * run](https://docs.aws.amazon.com/https://docs.docker.com/engine/reference/run/#security-configuration). Valid + * values: ``'ALL' | 'AUDIT_CONTROL' | 'AUDIT_WRITE' | 'BLOCK_SUSPEND' | 'CHOWN' | 'DAC_OVERRIDE' | + * 'DAC_READ_SEARCH' | 'FOWNER' | 'FSETID' | 'IPC_LOCK' | 'IPC_OWNER' | 'KILL' | 'LEASE' | 'LINUX_IMMUTABLE' | + * 'MAC_ADMIN' | 'MAC_OVERRIDE' | 'MKNOD' | 'NET_ADMIN' | 'NET_BIND_SERVICE' | 'NET_BROADCAST' | 'NET_RAW' | + * 'SETFCAP' | 'SETGID' | 'SETPCAP' | 'SETUID' | 'SYS_ADMIN' | 'SYS_BOOT' | 'SYS_CHROOT' | 'SYS_MODULE' | 'SYS_NICE' + * | 'SYS_PACCT' | 'SYS_PTRACE' | 'SYS_RAWIO' | 'SYS_RESOURCE' | 'SYS_TIME' | 'SYS_TTY_CONFIG' | 'SYSLOG' | + * 'WAKE_ALARM'``. + * + * @return the drop value. + */ + public List drop() { + return this.drop; + } + + /** + * Set the drop property: The Linux capabilities for the container that have been removed from the default + * configuration provided by Docker. This parameter maps to ``CapDrop`` in the [Create a + * container](https://docs.aws.amazon.com/https://docs.docker.com/engine/api/v1.35/#operation/ContainerCreate) + * section of the [Docker Remote API](https://docs.aws.amazon.com/https://docs.docker.com/engine/api/v1.35/) and the + * ``--cap-drop`` option to [docker + * run](https://docs.aws.amazon.com/https://docs.docker.com/engine/reference/run/#security-configuration). Valid + * values: ``'ALL' | 'AUDIT_CONTROL' | 'AUDIT_WRITE' | 'BLOCK_SUSPEND' | 'CHOWN' | 'DAC_OVERRIDE' | + * 'DAC_READ_SEARCH' | 'FOWNER' | 'FSETID' | 'IPC_LOCK' | 'IPC_OWNER' | 'KILL' | 'LEASE' | 'LINUX_IMMUTABLE' | + * 'MAC_ADMIN' | 'MAC_OVERRIDE' | 'MKNOD' | 'NET_ADMIN' | 'NET_BIND_SERVICE' | 'NET_BROADCAST' | 'NET_RAW' | + * 'SETFCAP' | 'SETGID' | 'SETPCAP' | 'SETUID' | 'SYS_ADMIN' | 'SYS_BOOT' | 'SYS_CHROOT' | 'SYS_MODULE' | 'SYS_NICE' + * | 'SYS_PACCT' | 'SYS_PTRACE' | 'SYS_RAWIO' | 'SYS_RESOURCE' | 'SYS_TIME' | 'SYS_TTY_CONFIG' | 'SYSLOG' | + * 'WAKE_ALARM'``. + * + * @param drop the drop value to set. + * @return the KernelCapabilities object itself. + */ + public KernelCapabilities withDrop(List drop) { + this.drop = drop; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("add", this.add, (writer, element) -> writer.writeString(element)); + jsonWriter.writeArrayField("drop", this.drop, (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of KernelCapabilities from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of KernelCapabilities if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the KernelCapabilities. + */ + public static KernelCapabilities fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + KernelCapabilities deserializedKernelCapabilities = new KernelCapabilities(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("add".equals(fieldName)) { + List add = reader.readArray(reader1 -> reader1.getString()); + deserializedKernelCapabilities.add = add; + } else if ("drop".equals(fieldName)) { + List drop = reader.readArray(reader1 -> reader1.getString()); + deserializedKernelCapabilities.drop = drop; + } else { + reader.skipChildren(); + } + } + + return deserializedKernelCapabilities; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/KeyAlgorithm.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/KeyAlgorithm.java new file mode 100644 index 000000000000..33ec318b2467 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/KeyAlgorithm.java @@ -0,0 +1,76 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * KeyAlgorithm enum. + */ +public final class KeyAlgorithm extends ExpandableStringEnum { + /** + * Static value EC_prime256v1 for KeyAlgorithm. + */ + public static final KeyAlgorithm EC_PRIME256V1 = fromString("EC_prime256v1"); + + /** + * Static value EC_secp384r1 for KeyAlgorithm. + */ + public static final KeyAlgorithm EC_SECP384R1 = fromString("EC_secp384r1"); + + /** + * Static value EC_secp521r1 for KeyAlgorithm. + */ + public static final KeyAlgorithm EC_SECP521R1 = fromString("EC_secp521r1"); + + /** + * Static value RSA_1024 for KeyAlgorithm. + */ + public static final KeyAlgorithm RSA_1024 = fromString("RSA_1024"); + + /** + * Static value RSA_2048 for KeyAlgorithm. + */ + public static final KeyAlgorithm RSA_2048 = fromString("RSA_2048"); + + /** + * Static value RSA_3072 for KeyAlgorithm. + */ + public static final KeyAlgorithm RSA_3072 = fromString("RSA_3072"); + + /** + * Static value RSA_4096 for KeyAlgorithm. + */ + public static final KeyAlgorithm RSA_4096 = fromString("RSA_4096"); + + /** + * Creates a new instance of KeyAlgorithm value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public KeyAlgorithm() { + } + + /** + * Creates or finds a KeyAlgorithm from its string representation. + * + * @param name a name to look for. + * @return the corresponding KeyAlgorithm. + */ + public static KeyAlgorithm fromString(String name) { + return fromString(name, KeyAlgorithm.class); + } + + /** + * Gets known KeyAlgorithm values. + * + * @return known KeyAlgorithm values. + */ + public static Collection values() { + return values(KeyAlgorithm.class); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/KeyAlgorithmEnumValue.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/KeyAlgorithmEnumValue.java new file mode 100644 index 000000000000..f5d1902f3f2d --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/KeyAlgorithmEnumValue.java @@ -0,0 +1,93 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of KeyAlgorithmEnumValue. + */ +@Fluent +public final class KeyAlgorithmEnumValue implements JsonSerializable { + /* + * Property value + */ + private KeyAlgorithm value; + + /** + * Creates an instance of KeyAlgorithmEnumValue class. + */ + public KeyAlgorithmEnumValue() { + } + + /** + * Get the value property: Property value. + * + * @return the value value. + */ + public KeyAlgorithm value() { + return this.value; + } + + /** + * Set the value property: Property value. + * + * @param value the value value to set. + * @return the KeyAlgorithmEnumValue object itself. + */ + public KeyAlgorithmEnumValue withValue(KeyAlgorithm value) { + this.value = value; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("value", this.value == null ? null : this.value.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of KeyAlgorithmEnumValue from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of KeyAlgorithmEnumValue if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the KeyAlgorithmEnumValue. + */ + public static KeyAlgorithmEnumValue fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + KeyAlgorithmEnumValue deserializedKeyAlgorithmEnumValue = new KeyAlgorithmEnumValue(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + deserializedKeyAlgorithmEnumValue.value = KeyAlgorithm.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedKeyAlgorithmEnumValue; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/KeyFormat.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/KeyFormat.java new file mode 100644 index 000000000000..bbb3f72ed632 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/KeyFormat.java @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * The format of the key pair. Default: ``pem``. + */ +public final class KeyFormat extends ExpandableStringEnum { + /** + * Static value pem for KeyFormat. + */ + public static final KeyFormat PEM = fromString("pem"); + + /** + * Static value ppk for KeyFormat. + */ + public static final KeyFormat PPK = fromString("ppk"); + + /** + * Creates a new instance of KeyFormat value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public KeyFormat() { + } + + /** + * Creates or finds a KeyFormat from its string representation. + * + * @param name a name to look for. + * @return the corresponding KeyFormat. + */ + public static KeyFormat fromString(String name) { + return fromString(name, KeyFormat.class); + } + + /** + * Gets known KeyFormat values. + * + * @return known KeyFormat values. + */ + public static Collection values() { + return values(KeyFormat.class); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/KeySchema.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/KeySchema.java new file mode 100644 index 000000000000..70fedd4caea6 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/KeySchema.java @@ -0,0 +1,136 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of KeySchema. + */ +@Fluent +public final class KeySchema implements JsonSerializable { + /* + * The name of a key attribute. + */ + private String attributeName; + + /* + * The role that this key attribute will assume: + ``HASH`` - partition key + ``RANGE`` - sort key The partition key + * of an item is also known as its *hash attribute*. The term 'hash attribute' derives from DynamoDB's usage of an + * internal hash function to evenly distribute data items across partitions, based on their partition key values. + * The sort key of an item is also known as its *range attribute*. The term 'range attribute' derives from the way + * DynamoDB stores items with the same partition key physically close together, in sorted order by the sort key + * value. + */ + private String keyType; + + /** + * Creates an instance of KeySchema class. + */ + public KeySchema() { + } + + /** + * Get the attributeName property: The name of a key attribute. + * + * @return the attributeName value. + */ + public String attributeName() { + return this.attributeName; + } + + /** + * Set the attributeName property: The name of a key attribute. + * + * @param attributeName the attributeName value to set. + * @return the KeySchema object itself. + */ + public KeySchema withAttributeName(String attributeName) { + this.attributeName = attributeName; + return this; + } + + /** + * Get the keyType property: The role that this key attribute will assume: + ``HASH`` - partition key + ``RANGE`` - + * sort key The partition key of an item is also known as its *hash attribute*. The term 'hash attribute' derives + * from DynamoDB's usage of an internal hash function to evenly distribute data items across partitions, based on + * their partition key values. The sort key of an item is also known as its *range attribute*. The term 'range + * attribute' derives from the way DynamoDB stores items with the same partition key physically close together, in + * sorted order by the sort key value. + * + * @return the keyType value. + */ + public String keyType() { + return this.keyType; + } + + /** + * Set the keyType property: The role that this key attribute will assume: + ``HASH`` - partition key + ``RANGE`` - + * sort key The partition key of an item is also known as its *hash attribute*. The term 'hash attribute' derives + * from DynamoDB's usage of an internal hash function to evenly distribute data items across partitions, based on + * their partition key values. The sort key of an item is also known as its *range attribute*. The term 'range + * attribute' derives from the way DynamoDB stores items with the same partition key physically close together, in + * sorted order by the sort key value. + * + * @param keyType the keyType value to set. + * @return the KeySchema object itself. + */ + public KeySchema withKeyType(String keyType) { + this.keyType = keyType; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("attributeName", this.attributeName); + jsonWriter.writeStringField("keyType", this.keyType); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of KeySchema from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of KeySchema if the JsonReader was pointing to an instance of it, or null if it was pointing + * to JSON null. + * @throws IOException If an error occurs while reading the KeySchema. + */ + public static KeySchema fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + KeySchema deserializedKeySchema = new KeySchema(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("attributeName".equals(fieldName)) { + deserializedKeySchema.attributeName = reader.getString(); + } else if ("keyType".equals(fieldName)) { + deserializedKeySchema.keyType = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedKeySchema; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/KeySpec.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/KeySpec.java new file mode 100644 index 000000000000..b4923e36a6de --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/KeySpec.java @@ -0,0 +1,128 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Specifies the type of KMS key to create. The default value, ``SYMMETRIC_DEFAULT``, creates a KMS key with a 256-bit + * symmetric key for encryption and decryption. In China Regions, ``SYMMETRIC_DEFAULT`` creates a 128-bit symmetric key + * that uses SM4 encryption. You can't change the ``KeySpec`` value after the KMS key is created. For help choosing a + * key spec for your KMS key, see [Choosing a KMS key + * type](https://docs.aws.amazon.com/kms/latest/developerguide/symm-asymm-choose.html) in the *Developer Guide*. The + * ``KeySpec`` property determines the type of key material in the KMS key and the algorithms that the KMS key supports. + * To further restrict the algorithms that can be used with the KMS key, use a condition key in its key policy or IAM + * policy. For more information, see [condition + * keys](https://docs.aws.amazon.com/kms/latest/developerguide/policy-conditions.html#conditions-kms) in the *Developer + * Guide*. If you change the value of the ``KeySpec`` property on an existing KMS key, the update request fails, + * regardless of the value of the [UpdateReplacePolicy + * attribute](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-updatereplacepolicy.html). + * This prevents you from accidentally deleting a KMS key by changing an immutable property value. [services that are + * integrated with](https://docs.aws.amazon.com/kms/features/#AWS_Service_Integration) use symmetric encryption KMS keys + * to protect your data. These services do not support encryption with asymmetric KMS keys. For help determining whether + * a KMS key is asymmetric, see [Identifying asymmetric KMS + * keys](https://docs.aws.amazon.com/kms/latest/developerguide/find-symm-asymm.html) in the *Developer Guide*. KMS + * supports the following key specs for KMS keys: + Symmetric encryption key (default) + ``SYMMETRIC_DEFAULT`` + * (AES-256-GCM) + HMAC keys (symmetric) + ``HMAC_224`` + ``HMAC_256`` + ``HMAC_384`` + ``HMAC_512`` + Asymmetric RSA + * key pairs + ``RSA_2048`` + ``RSA_3072`` + ``RSA_4096`` + Asymmetric NIST-recommended elliptic curve key pairs + + * ``ECC_NIST_P256`` (secp256r1) + ``ECC_NIST_P384`` (secp384r1) + ``ECC_NIST_P521`` (secp521r1) + Other asymmetric + * elliptic curve key pairs + ``ECC_SECG_P256K1`` (secp256k1), commonly used for cryptocurrencies. + SM2 key pairs + * (China Regions only) + ``SM2``. + */ +public final class KeySpec extends ExpandableStringEnum { + /** + * Static value ECC_NIST_P256 for KeySpec. + */ + public static final KeySpec ECC_NIST_P256 = fromString("ECC_NIST_P256"); + + /** + * Static value ECC_NIST_P384 for KeySpec. + */ + public static final KeySpec ECC_NIST_P384 = fromString("ECC_NIST_P384"); + + /** + * Static value ECC_NIST_P521 for KeySpec. + */ + public static final KeySpec ECC_NIST_P521 = fromString("ECC_NIST_P521"); + + /** + * Static value ECC_SECG_P256K1 for KeySpec. + */ + public static final KeySpec ECC_SECG_P256K1 = fromString("ECC_SECG_P256K1"); + + /** + * Static value HMAC_224 for KeySpec. + */ + public static final KeySpec HMAC_224 = fromString("HMAC_224"); + + /** + * Static value HMAC_256 for KeySpec. + */ + public static final KeySpec HMAC_256 = fromString("HMAC_256"); + + /** + * Static value HMAC_384 for KeySpec. + */ + public static final KeySpec HMAC_384 = fromString("HMAC_384"); + + /** + * Static value HMAC_512 for KeySpec. + */ + public static final KeySpec HMAC_512 = fromString("HMAC_512"); + + /** + * Static value RSA_2048 for KeySpec. + */ + public static final KeySpec RSA_2048 = fromString("RSA_2048"); + + /** + * Static value RSA_3072 for KeySpec. + */ + public static final KeySpec RSA_3072 = fromString("RSA_3072"); + + /** + * Static value RSA_4096 for KeySpec. + */ + public static final KeySpec RSA_4096 = fromString("RSA_4096"); + + /** + * Static value SM2 for KeySpec. + */ + public static final KeySpec SM2 = fromString("SM2"); + + /** + * Static value SYMMETRIC_DEFAULT for KeySpec. + */ + public static final KeySpec SYMMETRIC_DEFAULT = fromString("SYMMETRIC_DEFAULT"); + + /** + * Creates a new instance of KeySpec value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public KeySpec() { + } + + /** + * Creates or finds a KeySpec from its string representation. + * + * @param name a name to look for. + * @return the corresponding KeySpec. + */ + public static KeySpec fromString(String name) { + return fromString(name, KeySpec.class); + } + + /** + * Gets known KeySpec values. + * + * @return known KeySpec values. + */ + public static Collection values() { + return values(KeySpec.class); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/KeyType.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/KeyType.java new file mode 100644 index 000000000000..8cf45767e591 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/KeyType.java @@ -0,0 +1,53 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * The type of key pair. Note that ED25519 keys are not supported for Windows instances. If the ``PublicKeyMaterial`` + * property is specified, the ``KeyType`` property is ignored, and the key type is inferred from the + * ``PublicKeyMaterial`` value. Default: ``rsa``. + */ +public final class KeyType extends ExpandableStringEnum { + /** + * Static value ed25519 for KeyType. + */ + public static final KeyType ED25519 = fromString("ed25519"); + + /** + * Static value rsa for KeyType. + */ + public static final KeyType RSA = fromString("rsa"); + + /** + * Creates a new instance of KeyType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public KeyType() { + } + + /** + * Creates or finds a KeyType from its string representation. + * + * @param name a name to look for. + * @return the corresponding KeyType. + */ + public static KeyType fromString(String name) { + return fromString(name, KeyType.class); + } + + /** + * Gets known KeyType values. + * + * @return known KeyType values. + */ + public static Collection values() { + return values(KeyType.class); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/KeyUsage.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/KeyUsage.java new file mode 100644 index 000000000000..449b7ad172b6 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/KeyUsage.java @@ -0,0 +1,67 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Determines the [cryptographic + * operations](https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#cryptographic-operations) for which + * you can use the KMS key. The default value is ``ENCRYPT_DECRYPT``. This property is required for asymmetric KMS keys + * and HMAC KMS keys. You can't change the ``KeyUsage`` value after the KMS key is created. If you change the value of + * the ``KeyUsage`` property on an existing KMS key, the update request fails, regardless of the value of the + * [UpdateReplacePolicy + * attribute](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-updatereplacepolicy.html). + * This prevents you from accidentally deleting a KMS key by changing an immutable property value. Select only one valid + * value. + For symmetric encryption KMS keys, omit the property or specify ``ENCRYPT_DECRYPT``. + For asymmetric KMS + * keys with RSA key material, specify ``ENCRYPT_DECRYPT`` or ``SIGN_VERIFY``. + For asymmetric KMS keys with ECC key + * material, specify ``SIGN_VERIFY``. + For asymmetric KMS keys with SM2 (China Regions only) key material, specify + * ``ENCRYPT_DECRYPT`` or ``SIGN_VERIFY``. + For HMAC KMS keys, specify ``GENERATE_VERIFY_MAC``. + */ +public final class KeyUsage extends ExpandableStringEnum { + /** + * Static value ENCRYPT_DECRYPT for KeyUsage. + */ + public static final KeyUsage ENCRYPT_DECRYPT = fromString("ENCRYPT_DECRYPT"); + + /** + * Static value GENERATE_VERIFY_MAC for KeyUsage. + */ + public static final KeyUsage GENERATE_VERIFY_MAC = fromString("GENERATE_VERIFY_MAC"); + + /** + * Static value SIGN_VERIFY for KeyUsage. + */ + public static final KeyUsage SIGN_VERIFY = fromString("SIGN_VERIFY"); + + /** + * Creates a new instance of KeyUsage value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public KeyUsage() { + } + + /** + * Creates or finds a KeyUsage from its string representation. + * + * @param name a name to look for. + * @return the corresponding KeyUsage. + */ + public static KeyUsage fromString(String name) { + return fromString(name, KeyUsage.class); + } + + /** + * Gets known KeyUsage values. + * + * @return known KeyUsage values. + */ + public static Collection values() { + return values(KeyUsage.class); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/KeyUsageName.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/KeyUsageName.java new file mode 100644 index 000000000000..97c5ddf3dd4a --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/KeyUsageName.java @@ -0,0 +1,96 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * KeyUsageName enum. + */ +public final class KeyUsageName extends ExpandableStringEnum { + /** + * Static value ANY for KeyUsageName. + */ + public static final KeyUsageName ANY = fromString("ANY"); + + /** + * Static value CERTIFICATE_SIGNING for KeyUsageName. + */ + public static final KeyUsageName CERTIFICATE_SIGNING = fromString("CERTIFICATE_SIGNING"); + + /** + * Static value CRL_SIGNING for KeyUsageName. + */ + public static final KeyUsageName CRL_SIGNING = fromString("CRL_SIGNING"); + + /** + * Static value CUSTOM for KeyUsageName. + */ + public static final KeyUsageName CUSTOM = fromString("CUSTOM"); + + /** + * Static value DATA_ENCIPHERMENT for KeyUsageName. + */ + public static final KeyUsageName DATA_ENCIPHERMENT = fromString("DATA_ENCIPHERMENT"); + + /** + * Static value DECIPHER_ONLY for KeyUsageName. + */ + public static final KeyUsageName DECIPHER_ONLY = fromString("DECIPHER_ONLY"); + + /** + * Static value DIGITAL_SIGNATURE for KeyUsageName. + */ + public static final KeyUsageName DIGITAL_SIGNATURE = fromString("DIGITAL_SIGNATURE"); + + /** + * Static value ENCIPHER_ONLY for KeyUsageName. + */ + public static final KeyUsageName ENCIPHER_ONLY = fromString("ENCIPHER_ONLY"); + + /** + * Static value KEY_AGREEMENT for KeyUsageName. + */ + public static final KeyUsageName KEY_AGREEMENT = fromString("KEY_AGREEMENT"); + + /** + * Static value KEY_ENCIPHERMENT for KeyUsageName. + */ + public static final KeyUsageName KEY_ENCIPHERMENT = fromString("KEY_ENCIPHERMENT"); + + /** + * Static value NON_REPUDIATION for KeyUsageName. + */ + public static final KeyUsageName NON_REPUDIATION = fromString("NON_REPUDIATION"); + + /** + * Creates a new instance of KeyUsageName value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public KeyUsageName() { + } + + /** + * Creates or finds a KeyUsageName from its string representation. + * + * @param name a name to look for. + * @return the corresponding KeyUsageName. + */ + public static KeyUsageName fromString(String name) { + return fromString(name, KeyUsageName.class); + } + + /** + * Gets known KeyUsageName values. + * + * @return known KeyUsageName values. + */ + public static Collection values() { + return values(KeyUsageName.class); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/KeyValuePair.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/KeyValuePair.java new file mode 100644 index 000000000000..174c0923109e --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/KeyValuePair.java @@ -0,0 +1,125 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of KeyValuePair. + */ +@Fluent +public final class KeyValuePair implements JsonSerializable { + /* + * The name of the key-value pair. For environment variables, this is the name of the environment variable. + */ + private String name; + + /* + * The value of the key-value pair. For environment variables, this is the value of the environment variable. + */ + private String value; + + /** + * Creates an instance of KeyValuePair class. + */ + public KeyValuePair() { + } + + /** + * Get the name property: The name of the key-value pair. For environment variables, this is the name of the + * environment variable. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: The name of the key-value pair. For environment variables, this is the name of the + * environment variable. + * + * @param name the name value to set. + * @return the KeyValuePair object itself. + */ + public KeyValuePair withName(String name) { + this.name = name; + return this; + } + + /** + * Get the value property: The value of the key-value pair. For environment variables, this is the value of the + * environment variable. + * + * @return the value value. + */ + public String value() { + return this.value; + } + + /** + * Set the value property: The value of the key-value pair. For environment variables, this is the value of the + * environment variable. + * + * @param value the value value to set. + * @return the KeyValuePair object itself. + */ + public KeyValuePair withValue(String value) { + this.value = value; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("name", this.name); + jsonWriter.writeStringField("value", this.value); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of KeyValuePair from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of KeyValuePair if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the KeyValuePair. + */ + public static KeyValuePair fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + KeyValuePair deserializedKeyValuePair = new KeyValuePair(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("name".equals(fieldName)) { + deserializedKeyValuePair.name = reader.getString(); + } else if ("value".equals(fieldName)) { + deserializedKeyValuePair.value = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedKeyValuePair; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/KinesisStreamSpecification.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/KinesisStreamSpecification.java new file mode 100644 index 000000000000..2b6044ea7486 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/KinesisStreamSpecification.java @@ -0,0 +1,130 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of KinesisStreamSpecification. + */ +@Fluent +public final class KinesisStreamSpecification implements JsonSerializable { + /* + * The precision for the time and date that the stream was created. + */ + private KinesisStreamSpecificationApproximateCreationDateTimePrecision approximateCreationDateTimePrecision; + + /* + * The ARN for a specific Kinesis data stream. Length Constraints: Minimum length of 37. Maximum length of 1024. + */ + private String streamArn; + + /** + * Creates an instance of KinesisStreamSpecification class. + */ + public KinesisStreamSpecification() { + } + + /** + * Get the approximateCreationDateTimePrecision property: The precision for the time and date that the stream was + * created. + * + * @return the approximateCreationDateTimePrecision value. + */ + public KinesisStreamSpecificationApproximateCreationDateTimePrecision approximateCreationDateTimePrecision() { + return this.approximateCreationDateTimePrecision; + } + + /** + * Set the approximateCreationDateTimePrecision property: The precision for the time and date that the stream was + * created. + * + * @param approximateCreationDateTimePrecision the approximateCreationDateTimePrecision value to set. + * @return the KinesisStreamSpecification object itself. + */ + public KinesisStreamSpecification withApproximateCreationDateTimePrecision( + KinesisStreamSpecificationApproximateCreationDateTimePrecision approximateCreationDateTimePrecision) { + this.approximateCreationDateTimePrecision = approximateCreationDateTimePrecision; + return this; + } + + /** + * Get the streamArn property: The ARN for a specific Kinesis data stream. Length Constraints: Minimum length of 37. + * Maximum length of 1024. + * + * @return the streamArn value. + */ + public String streamArn() { + return this.streamArn; + } + + /** + * Set the streamArn property: The ARN for a specific Kinesis data stream. Length Constraints: Minimum length of 37. + * Maximum length of 1024. + * + * @param streamArn the streamArn value to set. + * @return the KinesisStreamSpecification object itself. + */ + public KinesisStreamSpecification withStreamArn(String streamArn) { + this.streamArn = streamArn; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("approximateCreationDateTimePrecision", + this.approximateCreationDateTimePrecision == null + ? null + : this.approximateCreationDateTimePrecision.toString()); + jsonWriter.writeStringField("streamArn", this.streamArn); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of KinesisStreamSpecification from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of KinesisStreamSpecification if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IOException If an error occurs while reading the KinesisStreamSpecification. + */ + public static KinesisStreamSpecification fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + KinesisStreamSpecification deserializedKinesisStreamSpecification = new KinesisStreamSpecification(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("approximateCreationDateTimePrecision".equals(fieldName)) { + deserializedKinesisStreamSpecification.approximateCreationDateTimePrecision + = KinesisStreamSpecificationApproximateCreationDateTimePrecision.fromString(reader.getString()); + } else if ("streamArn".equals(fieldName)) { + deserializedKinesisStreamSpecification.streamArn = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedKinesisStreamSpecification; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/KinesisStreamSpecificationApproximateCreationDateTimePrecision.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/KinesisStreamSpecificationApproximateCreationDateTimePrecision.java new file mode 100644 index 000000000000..2f702266a967 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/KinesisStreamSpecificationApproximateCreationDateTimePrecision.java @@ -0,0 +1,54 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * KinesisStreamSpecificationApproximateCreationDateTimePrecision enum. + */ +public final class KinesisStreamSpecificationApproximateCreationDateTimePrecision + extends ExpandableStringEnum { + /** + * Static value MICROSECOND for KinesisStreamSpecificationApproximateCreationDateTimePrecision. + */ + public static final KinesisStreamSpecificationApproximateCreationDateTimePrecision MICROSECOND + = fromString("MICROSECOND"); + + /** + * Static value MILLISECOND for KinesisStreamSpecificationApproximateCreationDateTimePrecision. + */ + public static final KinesisStreamSpecificationApproximateCreationDateTimePrecision MILLISECOND + = fromString("MILLISECOND"); + + /** + * Creates a new instance of KinesisStreamSpecificationApproximateCreationDateTimePrecision value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public KinesisStreamSpecificationApproximateCreationDateTimePrecision() { + } + + /** + * Creates or finds a KinesisStreamSpecificationApproximateCreationDateTimePrecision from its string representation. + * + * @param name a name to look for. + * @return the corresponding KinesisStreamSpecificationApproximateCreationDateTimePrecision. + */ + public static KinesisStreamSpecificationApproximateCreationDateTimePrecision fromString(String name) { + return fromString(name, KinesisStreamSpecificationApproximateCreationDateTimePrecision.class); + } + + /** + * Gets known KinesisStreamSpecificationApproximateCreationDateTimePrecision values. + * + * @return known KinesisStreamSpecificationApproximateCreationDateTimePrecision values. + */ + public static Collection values() { + return values(KinesisStreamSpecificationApproximateCreationDateTimePrecision.class); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/KmsAlias.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/KmsAlias.java new file mode 100644 index 000000000000..1ebf240cb4fa --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/KmsAlias.java @@ -0,0 +1,252 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.awsconnector.fluent.models.KmsAliasInner; +import java.util.Map; + +/** + * An immutable client-side representation of KmsAlias. + */ +public interface KmsAlias { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the location property: The geo-location where the resource lives. + * + * @return the location value. + */ + String location(); + + /** + * Gets the tags property: Resource tags. + * + * @return the tags value. + */ + Map tags(); + + /** + * Gets the properties property: The resource-specific properties for this resource. + * + * @return the properties value. + */ + KmsAliasProperties properties(); + + /** + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the region of the resource. + * + * @return the region of the resource. + */ + Region region(); + + /** + * Gets the name of the resource region. + * + * @return the name of the resource region. + */ + String regionName(); + + /** + * Gets the name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + + /** + * Gets the inner com.azure.resourcemanager.awsconnector.fluent.models.KmsAliasInner object. + * + * @return the inner object. + */ + KmsAliasInner innerModel(); + + /** + * The entirety of the KmsAlias definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithLocation, + DefinitionStages.WithResourceGroup, DefinitionStages.WithCreate { + } + + /** + * The KmsAlias definition stages. + */ + interface DefinitionStages { + /** + * The first stage of the KmsAlias definition. + */ + interface Blank extends WithLocation { + } + + /** + * The stage of the KmsAlias definition allowing to specify location. + */ + interface WithLocation { + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithResourceGroup withRegion(Region location); + + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithResourceGroup withRegion(String location); + } + + /** + * The stage of the KmsAlias definition allowing to specify parent resource. + */ + interface WithResourceGroup { + /** + * Specifies resourceGroupName. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @return the next definition stage. + */ + WithCreate withExistingResourceGroup(String resourceGroupName); + } + + /** + * The stage of the KmsAlias 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.WithProperties { + /** + * Executes the create request. + * + * @return the created resource. + */ + KmsAlias create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + KmsAlias create(Context context); + } + + /** + * The stage of the KmsAlias definition allowing to specify tags. + */ + interface WithTags { + /** + * Specifies the tags property: Resource tags.. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + WithCreate withTags(Map tags); + } + + /** + * The stage of the KmsAlias definition allowing to specify properties. + */ + interface WithProperties { + /** + * Specifies the properties property: The resource-specific properties for this resource.. + * + * @param properties The resource-specific properties for this resource. + * @return the next definition stage. + */ + WithCreate withProperties(KmsAliasProperties properties); + } + } + + /** + * Begins update for the KmsAlias resource. + * + * @return the stage of resource update. + */ + KmsAlias.Update update(); + + /** + * The template for KmsAlias update. + */ + interface Update extends UpdateStages.WithTags { + /** + * Executes the update request. + * + * @return the updated resource. + */ + KmsAlias apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + KmsAlias apply(Context context); + } + + /** + * The KmsAlias update stages. + */ + interface UpdateStages { + /** + * The stage of the KmsAlias update allowing to specify tags. + */ + interface WithTags { + /** + * Specifies the tags property: Resource tags.. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + Update withTags(Map tags); + } + } + + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + KmsAlias refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + KmsAlias refresh(Context context); +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/KmsAliasListResult.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/KmsAliasListResult.java new file mode 100644 index 000000000000..4cdfd3c9de0d --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/KmsAliasListResult.java @@ -0,0 +1,134 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.awsconnector.fluent.models.KmsAliasInner; +import java.io.IOException; +import java.util.List; + +/** + * The response of a KmsAlias list operation. + */ +@Fluent +public final class KmsAliasListResult implements JsonSerializable { + /* + * The KmsAlias items on this page + */ + private List value; + + /* + * The link to the next page of items + */ + private String nextLink; + + /** + * Creates an instance of KmsAliasListResult class. + */ + public KmsAliasListResult() { + } + + /** + * Get the value property: The KmsAlias items on this page. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The KmsAlias items on this page. + * + * @param value the value value to set. + * @return the KmsAliasListResult object itself. + */ + public KmsAliasListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The link to the next page of items. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: The link to the next page of items. + * + * @param nextLink the nextLink value to set. + * @return the KmsAliasListResult object itself. + */ + public KmsAliasListResult withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property value in model KmsAliasListResult")); + } else { + value().forEach(e -> e.validate()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(KmsAliasListResult.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("nextLink", this.nextLink); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of KmsAliasListResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of KmsAliasListResult if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the KmsAliasListResult. + */ + public static KmsAliasListResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + KmsAliasListResult deserializedKmsAliasListResult = new KmsAliasListResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value = reader.readArray(reader1 -> KmsAliasInner.fromJson(reader1)); + deserializedKmsAliasListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedKmsAliasListResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedKmsAliasListResult; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/KmsAliasProperties.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/KmsAliasProperties.java new file mode 100644 index 000000000000..60c4af2f0304 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/KmsAliasProperties.java @@ -0,0 +1,310 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.Map; + +/** + * Definition of KmsAlias. + */ +@Fluent +public final class KmsAliasProperties implements JsonSerializable { + /* + * AWS Properties + */ + private AwsKmsAliasProperties awsProperties; + + /* + * Public Cloud Connectors Resource ID + */ + private String publicCloudConnectorsResourceId; + + /* + * AWS Account ID + */ + private String awsAccountId; + + /* + * Amazon Resource Name (ARN) + */ + private String arn; + + /* + * Public Cloud Resource Name + */ + private String publicCloudResourceName; + + /* + * AWS Source Schema + */ + private String awsSourceSchema; + + /* + * AWS Region + */ + private String awsRegion; + + /* + * AWS Tags + */ + private Map awsTags; + + /* + * The status of the last operation. + */ + private ProvisioningState provisioningState; + + /** + * Creates an instance of KmsAliasProperties class. + */ + public KmsAliasProperties() { + } + + /** + * Get the awsProperties property: AWS Properties. + * + * @return the awsProperties value. + */ + public AwsKmsAliasProperties awsProperties() { + return this.awsProperties; + } + + /** + * Set the awsProperties property: AWS Properties. + * + * @param awsProperties the awsProperties value to set. + * @return the KmsAliasProperties object itself. + */ + public KmsAliasProperties withAwsProperties(AwsKmsAliasProperties awsProperties) { + this.awsProperties = awsProperties; + return this; + } + + /** + * Get the publicCloudConnectorsResourceId property: Public Cloud Connectors Resource ID. + * + * @return the publicCloudConnectorsResourceId value. + */ + public String publicCloudConnectorsResourceId() { + return this.publicCloudConnectorsResourceId; + } + + /** + * Set the publicCloudConnectorsResourceId property: Public Cloud Connectors Resource ID. + * + * @param publicCloudConnectorsResourceId the publicCloudConnectorsResourceId value to set. + * @return the KmsAliasProperties object itself. + */ + public KmsAliasProperties withPublicCloudConnectorsResourceId(String publicCloudConnectorsResourceId) { + this.publicCloudConnectorsResourceId = publicCloudConnectorsResourceId; + return this; + } + + /** + * Get the awsAccountId property: AWS Account ID. + * + * @return the awsAccountId value. + */ + public String awsAccountId() { + return this.awsAccountId; + } + + /** + * Set the awsAccountId property: AWS Account ID. + * + * @param awsAccountId the awsAccountId value to set. + * @return the KmsAliasProperties object itself. + */ + public KmsAliasProperties withAwsAccountId(String awsAccountId) { + this.awsAccountId = awsAccountId; + return this; + } + + /** + * Get the arn property: Amazon Resource Name (ARN). + * + * @return the arn value. + */ + public String arn() { + return this.arn; + } + + /** + * Set the arn property: Amazon Resource Name (ARN). + * + * @param arn the arn value to set. + * @return the KmsAliasProperties object itself. + */ + public KmsAliasProperties withArn(String arn) { + this.arn = arn; + return this; + } + + /** + * Get the publicCloudResourceName property: Public Cloud Resource Name. + * + * @return the publicCloudResourceName value. + */ + public String publicCloudResourceName() { + return this.publicCloudResourceName; + } + + /** + * Set the publicCloudResourceName property: Public Cloud Resource Name. + * + * @param publicCloudResourceName the publicCloudResourceName value to set. + * @return the KmsAliasProperties object itself. + */ + public KmsAliasProperties withPublicCloudResourceName(String publicCloudResourceName) { + this.publicCloudResourceName = publicCloudResourceName; + return this; + } + + /** + * Get the awsSourceSchema property: AWS Source Schema. + * + * @return the awsSourceSchema value. + */ + public String awsSourceSchema() { + return this.awsSourceSchema; + } + + /** + * Set the awsSourceSchema property: AWS Source Schema. + * + * @param awsSourceSchema the awsSourceSchema value to set. + * @return the KmsAliasProperties object itself. + */ + public KmsAliasProperties withAwsSourceSchema(String awsSourceSchema) { + this.awsSourceSchema = awsSourceSchema; + return this; + } + + /** + * Get the awsRegion property: AWS Region. + * + * @return the awsRegion value. + */ + public String awsRegion() { + return this.awsRegion; + } + + /** + * Set the awsRegion property: AWS Region. + * + * @param awsRegion the awsRegion value to set. + * @return the KmsAliasProperties object itself. + */ + public KmsAliasProperties withAwsRegion(String awsRegion) { + this.awsRegion = awsRegion; + return this; + } + + /** + * Get the awsTags property: AWS Tags. + * + * @return the awsTags value. + */ + public Map awsTags() { + return this.awsTags; + } + + /** + * Set the awsTags property: AWS Tags. + * + * @param awsTags the awsTags value to set. + * @return the KmsAliasProperties object itself. + */ + public KmsAliasProperties withAwsTags(Map awsTags) { + this.awsTags = awsTags; + return this; + } + + /** + * Get the provisioningState property: The status of the last operation. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (awsProperties() != null) { + awsProperties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("awsProperties", this.awsProperties); + jsonWriter.writeStringField("publicCloudConnectorsResourceId", this.publicCloudConnectorsResourceId); + jsonWriter.writeStringField("awsAccountId", this.awsAccountId); + jsonWriter.writeStringField("arn", this.arn); + jsonWriter.writeStringField("publicCloudResourceName", this.publicCloudResourceName); + jsonWriter.writeStringField("awsSourceSchema", this.awsSourceSchema); + jsonWriter.writeStringField("awsRegion", this.awsRegion); + jsonWriter.writeMapField("awsTags", this.awsTags, (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of KmsAliasProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of KmsAliasProperties if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the KmsAliasProperties. + */ + public static KmsAliasProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + KmsAliasProperties deserializedKmsAliasProperties = new KmsAliasProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("awsProperties".equals(fieldName)) { + deserializedKmsAliasProperties.awsProperties = AwsKmsAliasProperties.fromJson(reader); + } else if ("publicCloudConnectorsResourceId".equals(fieldName)) { + deserializedKmsAliasProperties.publicCloudConnectorsResourceId = reader.getString(); + } else if ("awsAccountId".equals(fieldName)) { + deserializedKmsAliasProperties.awsAccountId = reader.getString(); + } else if ("arn".equals(fieldName)) { + deserializedKmsAliasProperties.arn = reader.getString(); + } else if ("publicCloudResourceName".equals(fieldName)) { + deserializedKmsAliasProperties.publicCloudResourceName = reader.getString(); + } else if ("awsSourceSchema".equals(fieldName)) { + deserializedKmsAliasProperties.awsSourceSchema = reader.getString(); + } else if ("awsRegion".equals(fieldName)) { + deserializedKmsAliasProperties.awsRegion = reader.getString(); + } else if ("awsTags".equals(fieldName)) { + Map awsTags = reader.readMap(reader1 -> reader1.getString()); + deserializedKmsAliasProperties.awsTags = awsTags; + } else if ("provisioningState".equals(fieldName)) { + deserializedKmsAliasProperties.provisioningState = ProvisioningState.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedKmsAliasProperties; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/KmsAliasTagsUpdate.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/KmsAliasTagsUpdate.java new file mode 100644 index 000000000000..610d1d481511 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/KmsAliasTagsUpdate.java @@ -0,0 +1,95 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.Map; + +/** + * The type used for updating tags in KmsAlias resources. + */ +@Fluent +public final class KmsAliasTagsUpdate implements JsonSerializable { + /* + * Resource tags. + */ + private Map tags; + + /** + * Creates an instance of KmsAliasTagsUpdate class. + */ + public KmsAliasTagsUpdate() { + } + + /** + * Get the tags property: Resource tags. + * + * @return the tags value. + */ + public Map tags() { + return this.tags; + } + + /** + * Set the tags property: Resource tags. + * + * @param tags the tags value to set. + * @return the KmsAliasTagsUpdate object itself. + */ + public KmsAliasTagsUpdate withTags(Map tags) { + this.tags = tags; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeMapField("tags", this.tags, (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of KmsAliasTagsUpdate from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of KmsAliasTagsUpdate if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the KmsAliasTagsUpdate. + */ + public static KmsAliasTagsUpdate fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + KmsAliasTagsUpdate deserializedKmsAliasTagsUpdate = new KmsAliasTagsUpdate(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedKmsAliasTagsUpdate.tags = tags; + } else { + reader.skipChildren(); + } + } + + return deserializedKmsAliasTagsUpdate; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/KmsAliases.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/KmsAliases.java new file mode 100644 index 000000000000..342df5b3cfc9 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/KmsAliases.java @@ -0,0 +1,157 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** + * Resource collection API of KmsAliases. + */ +public interface KmsAliases { + /** + * List KmsAlias resources by subscription ID. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a KmsAlias list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable list(); + + /** + * List KmsAlias resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a KmsAlias list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable list(Context context); + + /** + * List KmsAlias resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a KmsAlias list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * List KmsAlias resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a KmsAlias list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Get a KmsAlias. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of KmsAlias. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a KmsAlias along with {@link Response}. + */ + Response getByResourceGroupWithResponse(String resourceGroupName, String name, Context context); + + /** + * Get a KmsAlias. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of KmsAlias. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a KmsAlias. + */ + KmsAlias getByResourceGroup(String resourceGroupName, String name); + + /** + * Delete a KmsAlias. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of KmsAlias. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByResourceGroup(String resourceGroupName, String name); + + /** + * Delete a KmsAlias. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of KmsAlias. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String name, Context context); + + /** + * Get a KmsAlias. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a KmsAlias along with {@link Response}. + */ + KmsAlias getById(String id); + + /** + * Get a KmsAlias. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a KmsAlias along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Delete a KmsAlias. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteById(String id); + + /** + * Delete a KmsAlias. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new KmsAlias resource. + * + * @param name resource name. + * @return the first stage of the new KmsAlias definition. + */ + KmsAlias.DefinitionStages.Blank define(String name); +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/KmsKey.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/KmsKey.java new file mode 100644 index 000000000000..c1a823ad4eb7 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/KmsKey.java @@ -0,0 +1,252 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.awsconnector.fluent.models.KmsKeyInner; +import java.util.Map; + +/** + * An immutable client-side representation of KmsKey. + */ +public interface KmsKey { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the location property: The geo-location where the resource lives. + * + * @return the location value. + */ + String location(); + + /** + * Gets the tags property: Resource tags. + * + * @return the tags value. + */ + Map tags(); + + /** + * Gets the properties property: The resource-specific properties for this resource. + * + * @return the properties value. + */ + KmsKeyProperties properties(); + + /** + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the region of the resource. + * + * @return the region of the resource. + */ + Region region(); + + /** + * Gets the name of the resource region. + * + * @return the name of the resource region. + */ + String regionName(); + + /** + * Gets the name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + + /** + * Gets the inner com.azure.resourcemanager.awsconnector.fluent.models.KmsKeyInner object. + * + * @return the inner object. + */ + KmsKeyInner innerModel(); + + /** + * The entirety of the KmsKey definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithLocation, + DefinitionStages.WithResourceGroup, DefinitionStages.WithCreate { + } + + /** + * The KmsKey definition stages. + */ + interface DefinitionStages { + /** + * The first stage of the KmsKey definition. + */ + interface Blank extends WithLocation { + } + + /** + * The stage of the KmsKey definition allowing to specify location. + */ + interface WithLocation { + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithResourceGroup withRegion(Region location); + + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithResourceGroup withRegion(String location); + } + + /** + * The stage of the KmsKey definition allowing to specify parent resource. + */ + interface WithResourceGroup { + /** + * Specifies resourceGroupName. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @return the next definition stage. + */ + WithCreate withExistingResourceGroup(String resourceGroupName); + } + + /** + * The stage of the KmsKey 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.WithProperties { + /** + * Executes the create request. + * + * @return the created resource. + */ + KmsKey create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + KmsKey create(Context context); + } + + /** + * The stage of the KmsKey definition allowing to specify tags. + */ + interface WithTags { + /** + * Specifies the tags property: Resource tags.. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + WithCreate withTags(Map tags); + } + + /** + * The stage of the KmsKey definition allowing to specify properties. + */ + interface WithProperties { + /** + * Specifies the properties property: The resource-specific properties for this resource.. + * + * @param properties The resource-specific properties for this resource. + * @return the next definition stage. + */ + WithCreate withProperties(KmsKeyProperties properties); + } + } + + /** + * Begins update for the KmsKey resource. + * + * @return the stage of resource update. + */ + KmsKey.Update update(); + + /** + * The template for KmsKey update. + */ + interface Update extends UpdateStages.WithTags { + /** + * Executes the update request. + * + * @return the updated resource. + */ + KmsKey apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + KmsKey apply(Context context); + } + + /** + * The KmsKey update stages. + */ + interface UpdateStages { + /** + * The stage of the KmsKey update allowing to specify tags. + */ + interface WithTags { + /** + * Specifies the tags property: Resource tags.. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + Update withTags(Map tags); + } + } + + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + KmsKey refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + KmsKey refresh(Context context); +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/KmsKeyListResult.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/KmsKeyListResult.java new file mode 100644 index 000000000000..b9a4c23e8a81 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/KmsKeyListResult.java @@ -0,0 +1,134 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.awsconnector.fluent.models.KmsKeyInner; +import java.io.IOException; +import java.util.List; + +/** + * The response of a KmsKey list operation. + */ +@Fluent +public final class KmsKeyListResult implements JsonSerializable { + /* + * The KmsKey items on this page + */ + private List value; + + /* + * The link to the next page of items + */ + private String nextLink; + + /** + * Creates an instance of KmsKeyListResult class. + */ + public KmsKeyListResult() { + } + + /** + * Get the value property: The KmsKey items on this page. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The KmsKey items on this page. + * + * @param value the value value to set. + * @return the KmsKeyListResult object itself. + */ + public KmsKeyListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The link to the next page of items. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: The link to the next page of items. + * + * @param nextLink the nextLink value to set. + * @return the KmsKeyListResult object itself. + */ + public KmsKeyListResult withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property value in model KmsKeyListResult")); + } else { + value().forEach(e -> e.validate()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(KmsKeyListResult.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("nextLink", this.nextLink); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of KmsKeyListResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of KmsKeyListResult if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the KmsKeyListResult. + */ + public static KmsKeyListResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + KmsKeyListResult deserializedKmsKeyListResult = new KmsKeyListResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value = reader.readArray(reader1 -> KmsKeyInner.fromJson(reader1)); + deserializedKmsKeyListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedKmsKeyListResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedKmsKeyListResult; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/KmsKeyProperties.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/KmsKeyProperties.java new file mode 100644 index 000000000000..0551a8c73be5 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/KmsKeyProperties.java @@ -0,0 +1,310 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.Map; + +/** + * Definition of KmsKey. + */ +@Fluent +public final class KmsKeyProperties implements JsonSerializable { + /* + * AWS Properties + */ + private AwsKmsKeyProperties awsProperties; + + /* + * Public Cloud Connectors Resource ID + */ + private String publicCloudConnectorsResourceId; + + /* + * AWS Account ID + */ + private String awsAccountId; + + /* + * Amazon Resource Name (ARN) + */ + private String arn; + + /* + * Public Cloud Resource Name + */ + private String publicCloudResourceName; + + /* + * AWS Source Schema + */ + private String awsSourceSchema; + + /* + * AWS Region + */ + private String awsRegion; + + /* + * AWS Tags + */ + private Map awsTags; + + /* + * The status of the last operation. + */ + private ProvisioningState provisioningState; + + /** + * Creates an instance of KmsKeyProperties class. + */ + public KmsKeyProperties() { + } + + /** + * Get the awsProperties property: AWS Properties. + * + * @return the awsProperties value. + */ + public AwsKmsKeyProperties awsProperties() { + return this.awsProperties; + } + + /** + * Set the awsProperties property: AWS Properties. + * + * @param awsProperties the awsProperties value to set. + * @return the KmsKeyProperties object itself. + */ + public KmsKeyProperties withAwsProperties(AwsKmsKeyProperties awsProperties) { + this.awsProperties = awsProperties; + return this; + } + + /** + * Get the publicCloudConnectorsResourceId property: Public Cloud Connectors Resource ID. + * + * @return the publicCloudConnectorsResourceId value. + */ + public String publicCloudConnectorsResourceId() { + return this.publicCloudConnectorsResourceId; + } + + /** + * Set the publicCloudConnectorsResourceId property: Public Cloud Connectors Resource ID. + * + * @param publicCloudConnectorsResourceId the publicCloudConnectorsResourceId value to set. + * @return the KmsKeyProperties object itself. + */ + public KmsKeyProperties withPublicCloudConnectorsResourceId(String publicCloudConnectorsResourceId) { + this.publicCloudConnectorsResourceId = publicCloudConnectorsResourceId; + return this; + } + + /** + * Get the awsAccountId property: AWS Account ID. + * + * @return the awsAccountId value. + */ + public String awsAccountId() { + return this.awsAccountId; + } + + /** + * Set the awsAccountId property: AWS Account ID. + * + * @param awsAccountId the awsAccountId value to set. + * @return the KmsKeyProperties object itself. + */ + public KmsKeyProperties withAwsAccountId(String awsAccountId) { + this.awsAccountId = awsAccountId; + return this; + } + + /** + * Get the arn property: Amazon Resource Name (ARN). + * + * @return the arn value. + */ + public String arn() { + return this.arn; + } + + /** + * Set the arn property: Amazon Resource Name (ARN). + * + * @param arn the arn value to set. + * @return the KmsKeyProperties object itself. + */ + public KmsKeyProperties withArn(String arn) { + this.arn = arn; + return this; + } + + /** + * Get the publicCloudResourceName property: Public Cloud Resource Name. + * + * @return the publicCloudResourceName value. + */ + public String publicCloudResourceName() { + return this.publicCloudResourceName; + } + + /** + * Set the publicCloudResourceName property: Public Cloud Resource Name. + * + * @param publicCloudResourceName the publicCloudResourceName value to set. + * @return the KmsKeyProperties object itself. + */ + public KmsKeyProperties withPublicCloudResourceName(String publicCloudResourceName) { + this.publicCloudResourceName = publicCloudResourceName; + return this; + } + + /** + * Get the awsSourceSchema property: AWS Source Schema. + * + * @return the awsSourceSchema value. + */ + public String awsSourceSchema() { + return this.awsSourceSchema; + } + + /** + * Set the awsSourceSchema property: AWS Source Schema. + * + * @param awsSourceSchema the awsSourceSchema value to set. + * @return the KmsKeyProperties object itself. + */ + public KmsKeyProperties withAwsSourceSchema(String awsSourceSchema) { + this.awsSourceSchema = awsSourceSchema; + return this; + } + + /** + * Get the awsRegion property: AWS Region. + * + * @return the awsRegion value. + */ + public String awsRegion() { + return this.awsRegion; + } + + /** + * Set the awsRegion property: AWS Region. + * + * @param awsRegion the awsRegion value to set. + * @return the KmsKeyProperties object itself. + */ + public KmsKeyProperties withAwsRegion(String awsRegion) { + this.awsRegion = awsRegion; + return this; + } + + /** + * Get the awsTags property: AWS Tags. + * + * @return the awsTags value. + */ + public Map awsTags() { + return this.awsTags; + } + + /** + * Set the awsTags property: AWS Tags. + * + * @param awsTags the awsTags value to set. + * @return the KmsKeyProperties object itself. + */ + public KmsKeyProperties withAwsTags(Map awsTags) { + this.awsTags = awsTags; + return this; + } + + /** + * Get the provisioningState property: The status of the last operation. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (awsProperties() != null) { + awsProperties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("awsProperties", this.awsProperties); + jsonWriter.writeStringField("publicCloudConnectorsResourceId", this.publicCloudConnectorsResourceId); + jsonWriter.writeStringField("awsAccountId", this.awsAccountId); + jsonWriter.writeStringField("arn", this.arn); + jsonWriter.writeStringField("publicCloudResourceName", this.publicCloudResourceName); + jsonWriter.writeStringField("awsSourceSchema", this.awsSourceSchema); + jsonWriter.writeStringField("awsRegion", this.awsRegion); + jsonWriter.writeMapField("awsTags", this.awsTags, (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of KmsKeyProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of KmsKeyProperties if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the KmsKeyProperties. + */ + public static KmsKeyProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + KmsKeyProperties deserializedKmsKeyProperties = new KmsKeyProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("awsProperties".equals(fieldName)) { + deserializedKmsKeyProperties.awsProperties = AwsKmsKeyProperties.fromJson(reader); + } else if ("publicCloudConnectorsResourceId".equals(fieldName)) { + deserializedKmsKeyProperties.publicCloudConnectorsResourceId = reader.getString(); + } else if ("awsAccountId".equals(fieldName)) { + deserializedKmsKeyProperties.awsAccountId = reader.getString(); + } else if ("arn".equals(fieldName)) { + deserializedKmsKeyProperties.arn = reader.getString(); + } else if ("publicCloudResourceName".equals(fieldName)) { + deserializedKmsKeyProperties.publicCloudResourceName = reader.getString(); + } else if ("awsSourceSchema".equals(fieldName)) { + deserializedKmsKeyProperties.awsSourceSchema = reader.getString(); + } else if ("awsRegion".equals(fieldName)) { + deserializedKmsKeyProperties.awsRegion = reader.getString(); + } else if ("awsTags".equals(fieldName)) { + Map awsTags = reader.readMap(reader1 -> reader1.getString()); + deserializedKmsKeyProperties.awsTags = awsTags; + } else if ("provisioningState".equals(fieldName)) { + deserializedKmsKeyProperties.provisioningState = ProvisioningState.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedKmsKeyProperties; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/KmsKeyTagsUpdate.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/KmsKeyTagsUpdate.java new file mode 100644 index 000000000000..de229cd5cd9a --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/KmsKeyTagsUpdate.java @@ -0,0 +1,95 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.Map; + +/** + * The type used for updating tags in KmsKey resources. + */ +@Fluent +public final class KmsKeyTagsUpdate implements JsonSerializable { + /* + * Resource tags. + */ + private Map tags; + + /** + * Creates an instance of KmsKeyTagsUpdate class. + */ + public KmsKeyTagsUpdate() { + } + + /** + * Get the tags property: Resource tags. + * + * @return the tags value. + */ + public Map tags() { + return this.tags; + } + + /** + * Set the tags property: Resource tags. + * + * @param tags the tags value to set. + * @return the KmsKeyTagsUpdate object itself. + */ + public KmsKeyTagsUpdate withTags(Map tags) { + this.tags = tags; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeMapField("tags", this.tags, (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of KmsKeyTagsUpdate from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of KmsKeyTagsUpdate if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the KmsKeyTagsUpdate. + */ + public static KmsKeyTagsUpdate fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + KmsKeyTagsUpdate deserializedKmsKeyTagsUpdate = new KmsKeyTagsUpdate(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedKmsKeyTagsUpdate.tags = tags; + } else { + reader.skipChildren(); + } + } + + return deserializedKmsKeyTagsUpdate; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/KmsKeys.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/KmsKeys.java new file mode 100644 index 000000000000..cc11e7eacf1e --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/KmsKeys.java @@ -0,0 +1,157 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** + * Resource collection API of KmsKeys. + */ +public interface KmsKeys { + /** + * List KmsKey resources by subscription ID. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a KmsKey list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable list(); + + /** + * List KmsKey resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a KmsKey list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable list(Context context); + + /** + * List KmsKey resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a KmsKey list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * List KmsKey resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a KmsKey list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Get a KmsKey. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of KmsKey. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a KmsKey along with {@link Response}. + */ + Response getByResourceGroupWithResponse(String resourceGroupName, String name, Context context); + + /** + * Get a KmsKey. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of KmsKey. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a KmsKey. + */ + KmsKey getByResourceGroup(String resourceGroupName, String name); + + /** + * Delete a KmsKey. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of KmsKey. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByResourceGroup(String resourceGroupName, String name); + + /** + * Delete a KmsKey. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of KmsKey. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String name, Context context); + + /** + * Get a KmsKey. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a KmsKey along with {@link Response}. + */ + KmsKey getById(String id); + + /** + * Get a KmsKey. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a KmsKey along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Delete a KmsKey. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteById(String id); + + /** + * Delete a KmsKey. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new KmsKey resource. + * + * @param name resource name. + * @return the first stage of the new KmsKey definition. + */ + KmsKey.DefinitionStages.Blank define(String name); +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/KubernetesNetworkConfigResponse.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/KubernetesNetworkConfigResponse.java new file mode 100644 index 000000000000..65564d676910 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/KubernetesNetworkConfigResponse.java @@ -0,0 +1,189 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of KubernetesNetworkConfigResponse. + */ +@Fluent +public final class KubernetesNetworkConfigResponse implements JsonSerializable { + /* + *

The IP family used to assign Kubernetes Pod and Service objects IP addresses. The IP + * family is always ipv4, unless you have a 1.21 or later cluster running version + * 1.10.1 or later of the Amazon VPC CNI plugin for Kubernetes and specified ipv6 when you + * created the cluster.

+ */ + private IpFamilyEnumValue ipFamily; + + /* + *

The CIDR block that Kubernetes Pod and Service object IP addresses are assigned + * from. Kubernetes assigns addresses from an IPv4 CIDR block assigned to a subnet that the node is in. + * If you didn't specify a CIDR block when you created the cluster, then Kubernetes assigns addresses from either + * the 10.100.0.0/16 or 172.20.0.0/16 CIDR blocks. If this was specified, then it was + * specified when the cluster was created and it can't be changed.

+ */ + private String serviceIpv4Cidr; + + /* + *

The CIDR block that Kubernetes pod and service IP addresses are assigned from if you created a 1.21 or later + * cluster with version 1.10.1 or later of the Amazon VPC CNI add-on and specified ipv6 for + * ipFamily when you created the cluster. Kubernetes assigns service addresses from the unique local address + * range (fc00::/7) because you can't specify a custom IPv6 CIDR block when you create the cluster.

+ */ + private String serviceIpv6Cidr; + + /** + * Creates an instance of KubernetesNetworkConfigResponse class. + */ + public KubernetesNetworkConfigResponse() { + } + + /** + * Get the ipFamily property: <p>The IP family used to assign Kubernetes <code>Pod</code> and + * <code>Service</code> objects IP addresses. The IP family is always <code>ipv4</code>, + * unless you have a <code>1.21</code> or later cluster running version <code>1.10.1</code> + * or later of the Amazon VPC CNI plugin for Kubernetes and specified <code>ipv6</code> when you created + * the cluster. </p>. + * + * @return the ipFamily value. + */ + public IpFamilyEnumValue ipFamily() { + return this.ipFamily; + } + + /** + * Set the ipFamily property: <p>The IP family used to assign Kubernetes <code>Pod</code> and + * <code>Service</code> objects IP addresses. The IP family is always <code>ipv4</code>, + * unless you have a <code>1.21</code> or later cluster running version <code>1.10.1</code> + * or later of the Amazon VPC CNI plugin for Kubernetes and specified <code>ipv6</code> when you created + * the cluster. </p>. + * + * @param ipFamily the ipFamily value to set. + * @return the KubernetesNetworkConfigResponse object itself. + */ + public KubernetesNetworkConfigResponse withIpFamily(IpFamilyEnumValue ipFamily) { + this.ipFamily = ipFamily; + return this; + } + + /** + * Get the serviceIpv4Cidr property: <p>The CIDR block that Kubernetes <code>Pod</code> and + * <code>Service</code> object IP addresses are assigned from. Kubernetes assigns addresses from an + * <code>IPv4</code> CIDR block assigned to a subnet that the node is in. If you didn't specify a CIDR + * block when you created the cluster, then Kubernetes assigns addresses from either the + * <code>10.100.0.0/16</code> or <code>172.20.0.0/16</code> CIDR blocks. If this was + * specified, then it was specified when the cluster was created and it can't be changed.</p>. + * + * @return the serviceIpv4Cidr value. + */ + public String serviceIpv4Cidr() { + return this.serviceIpv4Cidr; + } + + /** + * Set the serviceIpv4Cidr property: <p>The CIDR block that Kubernetes <code>Pod</code> and + * <code>Service</code> object IP addresses are assigned from. Kubernetes assigns addresses from an + * <code>IPv4</code> CIDR block assigned to a subnet that the node is in. If you didn't specify a CIDR + * block when you created the cluster, then Kubernetes assigns addresses from either the + * <code>10.100.0.0/16</code> or <code>172.20.0.0/16</code> CIDR blocks. If this was + * specified, then it was specified when the cluster was created and it can't be changed.</p>. + * + * @param serviceIpv4Cidr the serviceIpv4Cidr value to set. + * @return the KubernetesNetworkConfigResponse object itself. + */ + public KubernetesNetworkConfigResponse withServiceIpv4Cidr(String serviceIpv4Cidr) { + this.serviceIpv4Cidr = serviceIpv4Cidr; + return this; + } + + /** + * Get the serviceIpv6Cidr property: <p>The CIDR block that Kubernetes pod and service IP addresses are + * assigned from if you created a 1.21 or later cluster with version 1.10.1 or later of the Amazon VPC CNI add-on + * and specified <code>ipv6</code> for <b>ipFamily</b> when you created the cluster. + * Kubernetes assigns service addresses from the unique local address range (<code>fc00::/7</code>) + * because you can't specify a custom IPv6 CIDR block when you create the cluster.</p>. + * + * @return the serviceIpv6Cidr value. + */ + public String serviceIpv6Cidr() { + return this.serviceIpv6Cidr; + } + + /** + * Set the serviceIpv6Cidr property: <p>The CIDR block that Kubernetes pod and service IP addresses are + * assigned from if you created a 1.21 or later cluster with version 1.10.1 or later of the Amazon VPC CNI add-on + * and specified <code>ipv6</code> for <b>ipFamily</b> when you created the cluster. + * Kubernetes assigns service addresses from the unique local address range (<code>fc00::/7</code>) + * because you can't specify a custom IPv6 CIDR block when you create the cluster.</p>. + * + * @param serviceIpv6Cidr the serviceIpv6Cidr value to set. + * @return the KubernetesNetworkConfigResponse object itself. + */ + public KubernetesNetworkConfigResponse withServiceIpv6Cidr(String serviceIpv6Cidr) { + this.serviceIpv6Cidr = serviceIpv6Cidr; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (ipFamily() != null) { + ipFamily().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("ipFamily", this.ipFamily); + jsonWriter.writeStringField("serviceIpv4Cidr", this.serviceIpv4Cidr); + jsonWriter.writeStringField("serviceIpv6Cidr", this.serviceIpv6Cidr); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of KubernetesNetworkConfigResponse from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of KubernetesNetworkConfigResponse if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the KubernetesNetworkConfigResponse. + */ + public static KubernetesNetworkConfigResponse fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + KubernetesNetworkConfigResponse deserializedKubernetesNetworkConfigResponse + = new KubernetesNetworkConfigResponse(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("ipFamily".equals(fieldName)) { + deserializedKubernetesNetworkConfigResponse.ipFamily = IpFamilyEnumValue.fromJson(reader); + } else if ("serviceIpv4Cidr".equals(fieldName)) { + deserializedKubernetesNetworkConfigResponse.serviceIpv4Cidr = reader.getString(); + } else if ("serviceIpv6Cidr".equals(fieldName)) { + deserializedKubernetesNetworkConfigResponse.serviceIpv6Cidr = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedKubernetesNetworkConfigResponse; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/LabelNameConditionModelProperties.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/LabelNameConditionModelProperties.java new file mode 100644 index 000000000000..fc4f490132d8 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/LabelNameConditionModelProperties.java @@ -0,0 +1,100 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of LabelNameConditionModelProperties. + */ +@Fluent +public final class LabelNameConditionModelProperties implements JsonSerializable { + /* + * The label name that a log record must contain in order to meet the condition. This must be a fully qualified + * label name. Fully qualified labels have a prefix, optional namespaces, and label name. The prefix identifies the + * rule group or web ACL context of the rule that added the label. + */ + private String labelName; + + /** + * Creates an instance of LabelNameConditionModelProperties class. + */ + public LabelNameConditionModelProperties() { + } + + /** + * Get the labelName property: The label name that a log record must contain in order to meet the condition. This + * must be a fully qualified label name. Fully qualified labels have a prefix, optional namespaces, and label name. + * The prefix identifies the rule group or web ACL context of the rule that added the label. + * + * @return the labelName value. + */ + public String labelName() { + return this.labelName; + } + + /** + * Set the labelName property: The label name that a log record must contain in order to meet the condition. This + * must be a fully qualified label name. Fully qualified labels have a prefix, optional namespaces, and label name. + * The prefix identifies the rule group or web ACL context of the rule that added the label. + * + * @param labelName the labelName value to set. + * @return the LabelNameConditionModelProperties object itself. + */ + public LabelNameConditionModelProperties withLabelName(String labelName) { + this.labelName = labelName; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("labelName", this.labelName); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of LabelNameConditionModelProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of LabelNameConditionModelProperties if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the LabelNameConditionModelProperties. + */ + public static LabelNameConditionModelProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + LabelNameConditionModelProperties deserializedLabelNameConditionModelProperties + = new LabelNameConditionModelProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("labelName".equals(fieldName)) { + deserializedLabelNameConditionModelProperties.labelName = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedLabelNameConditionModelProperties; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/LambdaAuthorizerConfig.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/LambdaAuthorizerConfig.java new file mode 100644 index 000000000000..ad17fe18f414 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/LambdaAuthorizerConfig.java @@ -0,0 +1,180 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of LambdaAuthorizerConfig. + */ +@Fluent +public final class LambdaAuthorizerConfig implements JsonSerializable { + /* + *

The number of seconds a response should be cached for. The default is 0 seconds, which disables caching. If + * you don't specify a value for authorizerResultTtlInSeconds, the default value is used. The maximum + * value is one hour (3600 seconds). The Lambda function can override this by returning a ttlOverride + * key in its response.

+ */ + private Integer authorizerResultTtlInSeconds; + + /* + *

The Amazon Resource Name (ARN) of the Lambda function to be called for authorization. This can be a standard + * Lambda ARN, a version ARN (.../v3), or an alias ARN.

Note: This Lambda function must + * have the following resource-based policy assigned to it. When configuring Lambda authorizers in the console, this + * is done for you. To use the Command Line Interface (CLI), run the following:

aws lambda + * add-permission --function-name 'arn:aws:lambda:us-east-2:111122223333:function:my-function' --statement-id + * 'appsync' --principal appsync.amazonaws.com --action lambda:InvokeFunction

+ */ + private String authorizerUri; + + /* + *

A regular expression for validation of tokens before the Lambda function is called.

+ */ + private String identityValidationExpression; + + /** + * Creates an instance of LambdaAuthorizerConfig class. + */ + public LambdaAuthorizerConfig() { + } + + /** + * Get the authorizerResultTtlInSeconds property: <p>The number of seconds a response should be cached for. + * The default is 0 seconds, which disables caching. If you don't specify a value for + * <code>authorizerResultTtlInSeconds</code>, the default value is used. The maximum value is one hour + * (3600 seconds). The Lambda function can override this by returning a <code>ttlOverride</code> key in + * its response.</p>. + * + * @return the authorizerResultTtlInSeconds value. + */ + public Integer authorizerResultTtlInSeconds() { + return this.authorizerResultTtlInSeconds; + } + + /** + * Set the authorizerResultTtlInSeconds property: <p>The number of seconds a response should be cached for. + * The default is 0 seconds, which disables caching. If you don't specify a value for + * <code>authorizerResultTtlInSeconds</code>, the default value is used. The maximum value is one hour + * (3600 seconds). The Lambda function can override this by returning a <code>ttlOverride</code> key in + * its response.</p>. + * + * @param authorizerResultTtlInSeconds the authorizerResultTtlInSeconds value to set. + * @return the LambdaAuthorizerConfig object itself. + */ + public LambdaAuthorizerConfig withAuthorizerResultTtlInSeconds(Integer authorizerResultTtlInSeconds) { + this.authorizerResultTtlInSeconds = authorizerResultTtlInSeconds; + return this; + } + + /** + * Get the authorizerUri property: <p>The Amazon Resource Name (ARN) of the Lambda function to be called for + * authorization. This can be a standard Lambda ARN, a version ARN (<code>.../v3</code>), or an alias + * ARN. </p> <p> <b>Note</b>: This Lambda function must have the following resource-based + * policy assigned to it. When configuring Lambda authorizers in the console, this is done for you. To use the + * Command Line Interface (CLI), run the following:</p> <p> <code>aws lambda add-permission + * --function-name 'arn:aws:lambda:us-east-2:111122223333:function:my-function' --statement-id 'appsync' --principal + * appsync.amazonaws.com --action lambda:InvokeFunction</code> </p>. + * + * @return the authorizerUri value. + */ + public String authorizerUri() { + return this.authorizerUri; + } + + /** + * Set the authorizerUri property: <p>The Amazon Resource Name (ARN) of the Lambda function to be called for + * authorization. This can be a standard Lambda ARN, a version ARN (<code>.../v3</code>), or an alias + * ARN. </p> <p> <b>Note</b>: This Lambda function must have the following resource-based + * policy assigned to it. When configuring Lambda authorizers in the console, this is done for you. To use the + * Command Line Interface (CLI), run the following:</p> <p> <code>aws lambda add-permission + * --function-name 'arn:aws:lambda:us-east-2:111122223333:function:my-function' --statement-id 'appsync' --principal + * appsync.amazonaws.com --action lambda:InvokeFunction</code> </p>. + * + * @param authorizerUri the authorizerUri value to set. + * @return the LambdaAuthorizerConfig object itself. + */ + public LambdaAuthorizerConfig withAuthorizerUri(String authorizerUri) { + this.authorizerUri = authorizerUri; + return this; + } + + /** + * Get the identityValidationExpression property: <p>A regular expression for validation of tokens before the + * Lambda function is called.</p>. + * + * @return the identityValidationExpression value. + */ + public String identityValidationExpression() { + return this.identityValidationExpression; + } + + /** + * Set the identityValidationExpression property: <p>A regular expression for validation of tokens before the + * Lambda function is called.</p>. + * + * @param identityValidationExpression the identityValidationExpression value to set. + * @return the LambdaAuthorizerConfig object itself. + */ + public LambdaAuthorizerConfig withIdentityValidationExpression(String identityValidationExpression) { + this.identityValidationExpression = identityValidationExpression; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeNumberField("authorizerResultTtlInSeconds", this.authorizerResultTtlInSeconds); + jsonWriter.writeStringField("authorizerUri", this.authorizerUri); + jsonWriter.writeStringField("identityValidationExpression", this.identityValidationExpression); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of LambdaAuthorizerConfig from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of LambdaAuthorizerConfig if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the LambdaAuthorizerConfig. + */ + public static LambdaAuthorizerConfig fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + LambdaAuthorizerConfig deserializedLambdaAuthorizerConfig = new LambdaAuthorizerConfig(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("authorizerResultTtlInSeconds".equals(fieldName)) { + deserializedLambdaAuthorizerConfig.authorizerResultTtlInSeconds + = reader.getNullable(JsonReader::getInt); + } else if ("authorizerUri".equals(fieldName)) { + deserializedLambdaAuthorizerConfig.authorizerUri = reader.getString(); + } else if ("identityValidationExpression".equals(fieldName)) { + deserializedLambdaAuthorizerConfig.identityValidationExpression = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedLambdaAuthorizerConfig; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/LambdaConfiguration.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/LambdaConfiguration.java new file mode 100644 index 000000000000..18a27397c49b --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/LambdaConfiguration.java @@ -0,0 +1,175 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of LambdaConfiguration. + */ +@Fluent +public final class LambdaConfiguration implements JsonSerializable { + /* + * The Amazon S3 bucket event for which to invoke the LAMlong function. For more information, see [Supported Event + * Types](https://docs.aws.amazon.com/AmazonS3/latest/dev/NotificationHowTo.html) in the *Amazon S3 User Guide*. + */ + private String event; + + /* + * The filtering rules that determine which objects invoke the AWS Lambda function. For example, you can create a + * filter so that only image files with a ``.jpg`` extension invoke the function when they are added to the Amazon + * S3 bucket. Specifies object key name filtering rules. For information about key name filtering, see [Configuring + * event notifications using object key name + * filtering](https://docs.aws.amazon.com/AmazonS3/latest/userguide/notification-how-to-filtering.html) in the + * *Amazon S3 User Guide*. + */ + private NotificationFilter filter; + + /* + * The Amazon Resource Name (ARN) of the LAMlong function that Amazon S3 invokes when the specified event type + * occurs. + */ + private String function; + + /** + * Creates an instance of LambdaConfiguration class. + */ + public LambdaConfiguration() { + } + + /** + * Get the event property: The Amazon S3 bucket event for which to invoke the LAMlong function. For more + * information, see [Supported Event Types](https://docs.aws.amazon.com/AmazonS3/latest/dev/NotificationHowTo.html) + * in the *Amazon S3 User Guide*. + * + * @return the event value. + */ + public String event() { + return this.event; + } + + /** + * Set the event property: The Amazon S3 bucket event for which to invoke the LAMlong function. For more + * information, see [Supported Event Types](https://docs.aws.amazon.com/AmazonS3/latest/dev/NotificationHowTo.html) + * in the *Amazon S3 User Guide*. + * + * @param event the event value to set. + * @return the LambdaConfiguration object itself. + */ + public LambdaConfiguration withEvent(String event) { + this.event = event; + return this; + } + + /** + * Get the filter property: The filtering rules that determine which objects invoke the AWS Lambda function. For + * example, you can create a filter so that only image files with a ``.jpg`` extension invoke the function when they + * are added to the Amazon S3 bucket. Specifies object key name filtering rules. For information about key name + * filtering, see [Configuring event notifications using object key name + * filtering](https://docs.aws.amazon.com/AmazonS3/latest/userguide/notification-how-to-filtering.html) in the + * *Amazon S3 User Guide*. + * + * @return the filter value. + */ + public NotificationFilter filter() { + return this.filter; + } + + /** + * Set the filter property: The filtering rules that determine which objects invoke the AWS Lambda function. For + * example, you can create a filter so that only image files with a ``.jpg`` extension invoke the function when they + * are added to the Amazon S3 bucket. Specifies object key name filtering rules. For information about key name + * filtering, see [Configuring event notifications using object key name + * filtering](https://docs.aws.amazon.com/AmazonS3/latest/userguide/notification-how-to-filtering.html) in the + * *Amazon S3 User Guide*. + * + * @param filter the filter value to set. + * @return the LambdaConfiguration object itself. + */ + public LambdaConfiguration withFilter(NotificationFilter filter) { + this.filter = filter; + return this; + } + + /** + * Get the function property: The Amazon Resource Name (ARN) of the LAMlong function that Amazon S3 invokes when the + * specified event type occurs. + * + * @return the function value. + */ + public String function() { + return this.function; + } + + /** + * Set the function property: The Amazon Resource Name (ARN) of the LAMlong function that Amazon S3 invokes when the + * specified event type occurs. + * + * @param function the function value to set. + * @return the LambdaConfiguration object itself. + */ + public LambdaConfiguration withFunction(String function) { + this.function = function; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (filter() != null) { + filter().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("event", this.event); + jsonWriter.writeJsonField("filter", this.filter); + jsonWriter.writeStringField("function", this.function); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of LambdaConfiguration from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of LambdaConfiguration if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the LambdaConfiguration. + */ + public static LambdaConfiguration fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + LambdaConfiguration deserializedLambdaConfiguration = new LambdaConfiguration(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("event".equals(fieldName)) { + deserializedLambdaConfiguration.event = reader.getString(); + } else if ("filter".equals(fieldName)) { + deserializedLambdaConfiguration.filter = NotificationFilter.fromJson(reader); + } else if ("function".equals(fieldName)) { + deserializedLambdaConfiguration.function = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedLambdaConfiguration; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/LambdaFunction.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/LambdaFunction.java new file mode 100644 index 000000000000..da00d7519281 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/LambdaFunction.java @@ -0,0 +1,252 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.awsconnector.fluent.models.LambdaFunctionInner; +import java.util.Map; + +/** + * An immutable client-side representation of LambdaFunction. + */ +public interface LambdaFunction { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the location property: The geo-location where the resource lives. + * + * @return the location value. + */ + String location(); + + /** + * Gets the tags property: Resource tags. + * + * @return the tags value. + */ + Map tags(); + + /** + * Gets the properties property: The resource-specific properties for this resource. + * + * @return the properties value. + */ + LambdaFunctionProperties properties(); + + /** + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the region of the resource. + * + * @return the region of the resource. + */ + Region region(); + + /** + * Gets the name of the resource region. + * + * @return the name of the resource region. + */ + String regionName(); + + /** + * Gets the name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + + /** + * Gets the inner com.azure.resourcemanager.awsconnector.fluent.models.LambdaFunctionInner object. + * + * @return the inner object. + */ + LambdaFunctionInner innerModel(); + + /** + * The entirety of the LambdaFunction definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithLocation, + DefinitionStages.WithResourceGroup, DefinitionStages.WithCreate { + } + + /** + * The LambdaFunction definition stages. + */ + interface DefinitionStages { + /** + * The first stage of the LambdaFunction definition. + */ + interface Blank extends WithLocation { + } + + /** + * The stage of the LambdaFunction definition allowing to specify location. + */ + interface WithLocation { + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithResourceGroup withRegion(Region location); + + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithResourceGroup withRegion(String location); + } + + /** + * The stage of the LambdaFunction definition allowing to specify parent resource. + */ + interface WithResourceGroup { + /** + * Specifies resourceGroupName. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @return the next definition stage. + */ + WithCreate withExistingResourceGroup(String resourceGroupName); + } + + /** + * The stage of the LambdaFunction 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.WithProperties { + /** + * Executes the create request. + * + * @return the created resource. + */ + LambdaFunction create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + LambdaFunction create(Context context); + } + + /** + * The stage of the LambdaFunction definition allowing to specify tags. + */ + interface WithTags { + /** + * Specifies the tags property: Resource tags.. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + WithCreate withTags(Map tags); + } + + /** + * The stage of the LambdaFunction definition allowing to specify properties. + */ + interface WithProperties { + /** + * Specifies the properties property: The resource-specific properties for this resource.. + * + * @param properties The resource-specific properties for this resource. + * @return the next definition stage. + */ + WithCreate withProperties(LambdaFunctionProperties properties); + } + } + + /** + * Begins update for the LambdaFunction resource. + * + * @return the stage of resource update. + */ + LambdaFunction.Update update(); + + /** + * The template for LambdaFunction update. + */ + interface Update extends UpdateStages.WithTags { + /** + * Executes the update request. + * + * @return the updated resource. + */ + LambdaFunction apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + LambdaFunction apply(Context context); + } + + /** + * The LambdaFunction update stages. + */ + interface UpdateStages { + /** + * The stage of the LambdaFunction update allowing to specify tags. + */ + interface WithTags { + /** + * Specifies the tags property: Resource tags.. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + Update withTags(Map tags); + } + } + + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + LambdaFunction refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + LambdaFunction refresh(Context context); +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/LambdaFunctionAssociation.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/LambdaFunctionAssociation.java new file mode 100644 index 000000000000..f4c5a828e688 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/LambdaFunctionAssociation.java @@ -0,0 +1,187 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of LambdaFunctionAssociation. + */ +@Fluent +public final class LambdaFunctionAssociation implements JsonSerializable { + /* + * Specifies the event type that triggers a Lambda@Edge function invocation. You can specify the following values: + + * ``viewer-request``: The function executes when CloudFront receives a request from a viewer and before it checks + * to see whether the requested object is in the edge cache. + ``origin-request``: The function executes only when + * CloudFront sends a request to your origin. When the requested object is in the edge cache, the function doesn't + * execute. + ``origin-response``: The function executes after CloudFront receives a response from the origin and + * before it caches the object in the response. When the requested object is in the edge cache, the function doesn't + * execute. + ``viewer-response``: The function executes before CloudFront returns the requested object to the + * viewer. The function executes regardless of whether the object was already in the edge cache. If the origin + * returns an HTTP status code other than HTTP 200 (OK), the function doesn't execute. + */ + private String eventType; + + /* + * A flag that allows a Lambda@Edge function to have read access to the body content. For more information, see + * [Accessing the Request Body by Choosing the Include Body + * Option](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/lambda-include-body-access.html) in + * the Amazon CloudFront Developer Guide. + */ + private Boolean includeBody; + + /* + * The ARN of the Lambda@Edge function. You must specify the ARN of a function version; you can't specify an alias + * or $LATEST. + */ + private String lambdaFunctionArn; + + /** + * Creates an instance of LambdaFunctionAssociation class. + */ + public LambdaFunctionAssociation() { + } + + /** + * Get the eventType property: Specifies the event type that triggers a Lambda@Edge function invocation. You + * can specify the following values: + ``viewer-request``: The function executes when CloudFront receives a request + * from a viewer and before it checks to see whether the requested object is in the edge cache. + + * ``origin-request``: The function executes only when CloudFront sends a request to your origin. When the requested + * object is in the edge cache, the function doesn't execute. + ``origin-response``: The function executes after + * CloudFront receives a response from the origin and before it caches the object in the response. When the + * requested object is in the edge cache, the function doesn't execute. + ``viewer-response``: The function executes + * before CloudFront returns the requested object to the viewer. The function executes regardless of whether the + * object was already in the edge cache. If the origin returns an HTTP status code other than HTTP 200 (OK), the + * function doesn't execute. + * + * @return the eventType value. + */ + public String eventType() { + return this.eventType; + } + + /** + * Set the eventType property: Specifies the event type that triggers a Lambda@Edge function invocation. You + * can specify the following values: + ``viewer-request``: The function executes when CloudFront receives a request + * from a viewer and before it checks to see whether the requested object is in the edge cache. + + * ``origin-request``: The function executes only when CloudFront sends a request to your origin. When the requested + * object is in the edge cache, the function doesn't execute. + ``origin-response``: The function executes after + * CloudFront receives a response from the origin and before it caches the object in the response. When the + * requested object is in the edge cache, the function doesn't execute. + ``viewer-response``: The function executes + * before CloudFront returns the requested object to the viewer. The function executes regardless of whether the + * object was already in the edge cache. If the origin returns an HTTP status code other than HTTP 200 (OK), the + * function doesn't execute. + * + * @param eventType the eventType value to set. + * @return the LambdaFunctionAssociation object itself. + */ + public LambdaFunctionAssociation withEventType(String eventType) { + this.eventType = eventType; + return this; + } + + /** + * Get the includeBody property: A flag that allows a Lambda@Edge function to have read access to the body + * content. For more information, see [Accessing the Request Body by Choosing the Include Body + * Option](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/lambda-include-body-access.html) in + * the Amazon CloudFront Developer Guide. + * + * @return the includeBody value. + */ + public Boolean includeBody() { + return this.includeBody; + } + + /** + * Set the includeBody property: A flag that allows a Lambda@Edge function to have read access to the body + * content. For more information, see [Accessing the Request Body by Choosing the Include Body + * Option](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/lambda-include-body-access.html) in + * the Amazon CloudFront Developer Guide. + * + * @param includeBody the includeBody value to set. + * @return the LambdaFunctionAssociation object itself. + */ + public LambdaFunctionAssociation withIncludeBody(Boolean includeBody) { + this.includeBody = includeBody; + return this; + } + + /** + * Get the lambdaFunctionArn property: The ARN of the Lambda@Edge function. You must specify the ARN of a + * function version; you can't specify an alias or $LATEST. + * + * @return the lambdaFunctionArn value. + */ + public String lambdaFunctionArn() { + return this.lambdaFunctionArn; + } + + /** + * Set the lambdaFunctionArn property: The ARN of the Lambda@Edge function. You must specify the ARN of a + * function version; you can't specify an alias or $LATEST. + * + * @param lambdaFunctionArn the lambdaFunctionArn value to set. + * @return the LambdaFunctionAssociation object itself. + */ + public LambdaFunctionAssociation withLambdaFunctionArn(String lambdaFunctionArn) { + this.lambdaFunctionArn = lambdaFunctionArn; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("eventType", this.eventType); + jsonWriter.writeBooleanField("includeBody", this.includeBody); + jsonWriter.writeStringField("lambdaFunctionARN", this.lambdaFunctionArn); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of LambdaFunctionAssociation from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of LambdaFunctionAssociation if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IOException If an error occurs while reading the LambdaFunctionAssociation. + */ + public static LambdaFunctionAssociation fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + LambdaFunctionAssociation deserializedLambdaFunctionAssociation = new LambdaFunctionAssociation(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("eventType".equals(fieldName)) { + deserializedLambdaFunctionAssociation.eventType = reader.getString(); + } else if ("includeBody".equals(fieldName)) { + deserializedLambdaFunctionAssociation.includeBody = reader.getNullable(JsonReader::getBoolean); + } else if ("lambdaFunctionARN".equals(fieldName)) { + deserializedLambdaFunctionAssociation.lambdaFunctionArn = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedLambdaFunctionAssociation; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/LambdaFunctionCodeLocation.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/LambdaFunctionCodeLocation.java new file mode 100644 index 000000000000..b94e1991c047 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/LambdaFunctionCodeLocation.java @@ -0,0 +1,252 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.awsconnector.fluent.models.LambdaFunctionCodeLocationInner; +import java.util.Map; + +/** + * An immutable client-side representation of LambdaFunctionCodeLocation. + */ +public interface LambdaFunctionCodeLocation { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the location property: The geo-location where the resource lives. + * + * @return the location value. + */ + String location(); + + /** + * Gets the tags property: Resource tags. + * + * @return the tags value. + */ + Map tags(); + + /** + * Gets the properties property: The resource-specific properties for this resource. + * + * @return the properties value. + */ + LambdaFunctionCodeLocationProperties properties(); + + /** + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the region of the resource. + * + * @return the region of the resource. + */ + Region region(); + + /** + * Gets the name of the resource region. + * + * @return the name of the resource region. + */ + String regionName(); + + /** + * Gets the name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + + /** + * Gets the inner com.azure.resourcemanager.awsconnector.fluent.models.LambdaFunctionCodeLocationInner object. + * + * @return the inner object. + */ + LambdaFunctionCodeLocationInner innerModel(); + + /** + * The entirety of the LambdaFunctionCodeLocation definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithLocation, + DefinitionStages.WithResourceGroup, DefinitionStages.WithCreate { + } + + /** + * The LambdaFunctionCodeLocation definition stages. + */ + interface DefinitionStages { + /** + * The first stage of the LambdaFunctionCodeLocation definition. + */ + interface Blank extends WithLocation { + } + + /** + * The stage of the LambdaFunctionCodeLocation definition allowing to specify location. + */ + interface WithLocation { + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithResourceGroup withRegion(Region location); + + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithResourceGroup withRegion(String location); + } + + /** + * The stage of the LambdaFunctionCodeLocation definition allowing to specify parent resource. + */ + interface WithResourceGroup { + /** + * Specifies resourceGroupName. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @return the next definition stage. + */ + WithCreate withExistingResourceGroup(String resourceGroupName); + } + + /** + * The stage of the LambdaFunctionCodeLocation 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.WithProperties { + /** + * Executes the create request. + * + * @return the created resource. + */ + LambdaFunctionCodeLocation create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + LambdaFunctionCodeLocation create(Context context); + } + + /** + * The stage of the LambdaFunctionCodeLocation definition allowing to specify tags. + */ + interface WithTags { + /** + * Specifies the tags property: Resource tags.. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + WithCreate withTags(Map tags); + } + + /** + * The stage of the LambdaFunctionCodeLocation definition allowing to specify properties. + */ + interface WithProperties { + /** + * Specifies the properties property: The resource-specific properties for this resource.. + * + * @param properties The resource-specific properties for this resource. + * @return the next definition stage. + */ + WithCreate withProperties(LambdaFunctionCodeLocationProperties properties); + } + } + + /** + * Begins update for the LambdaFunctionCodeLocation resource. + * + * @return the stage of resource update. + */ + LambdaFunctionCodeLocation.Update update(); + + /** + * The template for LambdaFunctionCodeLocation update. + */ + interface Update extends UpdateStages.WithTags { + /** + * Executes the update request. + * + * @return the updated resource. + */ + LambdaFunctionCodeLocation apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + LambdaFunctionCodeLocation apply(Context context); + } + + /** + * The LambdaFunctionCodeLocation update stages. + */ + interface UpdateStages { + /** + * The stage of the LambdaFunctionCodeLocation update allowing to specify tags. + */ + interface WithTags { + /** + * Specifies the tags property: Resource tags.. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + Update withTags(Map tags); + } + } + + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + LambdaFunctionCodeLocation refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + LambdaFunctionCodeLocation refresh(Context context); +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/LambdaFunctionCodeLocationListResult.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/LambdaFunctionCodeLocationListResult.java new file mode 100644 index 000000000000..84502d5db54b --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/LambdaFunctionCodeLocationListResult.java @@ -0,0 +1,138 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.awsconnector.fluent.models.LambdaFunctionCodeLocationInner; +import java.io.IOException; +import java.util.List; + +/** + * The response of a LambdaFunctionCodeLocation list operation. + */ +@Fluent +public final class LambdaFunctionCodeLocationListResult + implements JsonSerializable { + /* + * The LambdaFunctionCodeLocation items on this page + */ + private List value; + + /* + * The link to the next page of items + */ + private String nextLink; + + /** + * Creates an instance of LambdaFunctionCodeLocationListResult class. + */ + public LambdaFunctionCodeLocationListResult() { + } + + /** + * Get the value property: The LambdaFunctionCodeLocation items on this page. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The LambdaFunctionCodeLocation items on this page. + * + * @param value the value value to set. + * @return the LambdaFunctionCodeLocationListResult object itself. + */ + public LambdaFunctionCodeLocationListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The link to the next page of items. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: The link to the next page of items. + * + * @param nextLink the nextLink value to set. + * @return the LambdaFunctionCodeLocationListResult object itself. + */ + public LambdaFunctionCodeLocationListResult withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property value in model LambdaFunctionCodeLocationListResult")); + } else { + value().forEach(e -> e.validate()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(LambdaFunctionCodeLocationListResult.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("nextLink", this.nextLink); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of LambdaFunctionCodeLocationListResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of LambdaFunctionCodeLocationListResult if the JsonReader was pointing to an instance of it, + * or null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the LambdaFunctionCodeLocationListResult. + */ + public static LambdaFunctionCodeLocationListResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + LambdaFunctionCodeLocationListResult deserializedLambdaFunctionCodeLocationListResult + = new LambdaFunctionCodeLocationListResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> LambdaFunctionCodeLocationInner.fromJson(reader1)); + deserializedLambdaFunctionCodeLocationListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedLambdaFunctionCodeLocationListResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedLambdaFunctionCodeLocationListResult; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/LambdaFunctionCodeLocationProperties.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/LambdaFunctionCodeLocationProperties.java new file mode 100644 index 000000000000..cd953205641b --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/LambdaFunctionCodeLocationProperties.java @@ -0,0 +1,317 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.Map; + +/** + * Definition of LambdaFunctionCodeLocation. + */ +@Fluent +public final class LambdaFunctionCodeLocationProperties + implements JsonSerializable { + /* + * AWS Properties + */ + private AwsLambdaFunctionCodeLocationProperties awsProperties; + + /* + * Public Cloud Connectors Resource ID + */ + private String publicCloudConnectorsResourceId; + + /* + * AWS Account ID + */ + private String awsAccountId; + + /* + * Amazon Resource Name (ARN) + */ + private String arn; + + /* + * Public Cloud Resource Name + */ + private String publicCloudResourceName; + + /* + * AWS Source Schema + */ + private String awsSourceSchema; + + /* + * AWS Region + */ + private String awsRegion; + + /* + * AWS Tags + */ + private Map awsTags; + + /* + * The status of the last operation. + */ + private ProvisioningState provisioningState; + + /** + * Creates an instance of LambdaFunctionCodeLocationProperties class. + */ + public LambdaFunctionCodeLocationProperties() { + } + + /** + * Get the awsProperties property: AWS Properties. + * + * @return the awsProperties value. + */ + public AwsLambdaFunctionCodeLocationProperties awsProperties() { + return this.awsProperties; + } + + /** + * Set the awsProperties property: AWS Properties. + * + * @param awsProperties the awsProperties value to set. + * @return the LambdaFunctionCodeLocationProperties object itself. + */ + public LambdaFunctionCodeLocationProperties + withAwsProperties(AwsLambdaFunctionCodeLocationProperties awsProperties) { + this.awsProperties = awsProperties; + return this; + } + + /** + * Get the publicCloudConnectorsResourceId property: Public Cloud Connectors Resource ID. + * + * @return the publicCloudConnectorsResourceId value. + */ + public String publicCloudConnectorsResourceId() { + return this.publicCloudConnectorsResourceId; + } + + /** + * Set the publicCloudConnectorsResourceId property: Public Cloud Connectors Resource ID. + * + * @param publicCloudConnectorsResourceId the publicCloudConnectorsResourceId value to set. + * @return the LambdaFunctionCodeLocationProperties object itself. + */ + public LambdaFunctionCodeLocationProperties + withPublicCloudConnectorsResourceId(String publicCloudConnectorsResourceId) { + this.publicCloudConnectorsResourceId = publicCloudConnectorsResourceId; + return this; + } + + /** + * Get the awsAccountId property: AWS Account ID. + * + * @return the awsAccountId value. + */ + public String awsAccountId() { + return this.awsAccountId; + } + + /** + * Set the awsAccountId property: AWS Account ID. + * + * @param awsAccountId the awsAccountId value to set. + * @return the LambdaFunctionCodeLocationProperties object itself. + */ + public LambdaFunctionCodeLocationProperties withAwsAccountId(String awsAccountId) { + this.awsAccountId = awsAccountId; + return this; + } + + /** + * Get the arn property: Amazon Resource Name (ARN). + * + * @return the arn value. + */ + public String arn() { + return this.arn; + } + + /** + * Set the arn property: Amazon Resource Name (ARN). + * + * @param arn the arn value to set. + * @return the LambdaFunctionCodeLocationProperties object itself. + */ + public LambdaFunctionCodeLocationProperties withArn(String arn) { + this.arn = arn; + return this; + } + + /** + * Get the publicCloudResourceName property: Public Cloud Resource Name. + * + * @return the publicCloudResourceName value. + */ + public String publicCloudResourceName() { + return this.publicCloudResourceName; + } + + /** + * Set the publicCloudResourceName property: Public Cloud Resource Name. + * + * @param publicCloudResourceName the publicCloudResourceName value to set. + * @return the LambdaFunctionCodeLocationProperties object itself. + */ + public LambdaFunctionCodeLocationProperties withPublicCloudResourceName(String publicCloudResourceName) { + this.publicCloudResourceName = publicCloudResourceName; + return this; + } + + /** + * Get the awsSourceSchema property: AWS Source Schema. + * + * @return the awsSourceSchema value. + */ + public String awsSourceSchema() { + return this.awsSourceSchema; + } + + /** + * Set the awsSourceSchema property: AWS Source Schema. + * + * @param awsSourceSchema the awsSourceSchema value to set. + * @return the LambdaFunctionCodeLocationProperties object itself. + */ + public LambdaFunctionCodeLocationProperties withAwsSourceSchema(String awsSourceSchema) { + this.awsSourceSchema = awsSourceSchema; + return this; + } + + /** + * Get the awsRegion property: AWS Region. + * + * @return the awsRegion value. + */ + public String awsRegion() { + return this.awsRegion; + } + + /** + * Set the awsRegion property: AWS Region. + * + * @param awsRegion the awsRegion value to set. + * @return the LambdaFunctionCodeLocationProperties object itself. + */ + public LambdaFunctionCodeLocationProperties withAwsRegion(String awsRegion) { + this.awsRegion = awsRegion; + return this; + } + + /** + * Get the awsTags property: AWS Tags. + * + * @return the awsTags value. + */ + public Map awsTags() { + return this.awsTags; + } + + /** + * Set the awsTags property: AWS Tags. + * + * @param awsTags the awsTags value to set. + * @return the LambdaFunctionCodeLocationProperties object itself. + */ + public LambdaFunctionCodeLocationProperties withAwsTags(Map awsTags) { + this.awsTags = awsTags; + return this; + } + + /** + * Get the provisioningState property: The status of the last operation. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (awsProperties() != null) { + awsProperties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("awsProperties", this.awsProperties); + jsonWriter.writeStringField("publicCloudConnectorsResourceId", this.publicCloudConnectorsResourceId); + jsonWriter.writeStringField("awsAccountId", this.awsAccountId); + jsonWriter.writeStringField("arn", this.arn); + jsonWriter.writeStringField("publicCloudResourceName", this.publicCloudResourceName); + jsonWriter.writeStringField("awsSourceSchema", this.awsSourceSchema); + jsonWriter.writeStringField("awsRegion", this.awsRegion); + jsonWriter.writeMapField("awsTags", this.awsTags, (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of LambdaFunctionCodeLocationProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of LambdaFunctionCodeLocationProperties if the JsonReader was pointing to an instance of it, + * or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the LambdaFunctionCodeLocationProperties. + */ + public static LambdaFunctionCodeLocationProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + LambdaFunctionCodeLocationProperties deserializedLambdaFunctionCodeLocationProperties + = new LambdaFunctionCodeLocationProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("awsProperties".equals(fieldName)) { + deserializedLambdaFunctionCodeLocationProperties.awsProperties + = AwsLambdaFunctionCodeLocationProperties.fromJson(reader); + } else if ("publicCloudConnectorsResourceId".equals(fieldName)) { + deserializedLambdaFunctionCodeLocationProperties.publicCloudConnectorsResourceId + = reader.getString(); + } else if ("awsAccountId".equals(fieldName)) { + deserializedLambdaFunctionCodeLocationProperties.awsAccountId = reader.getString(); + } else if ("arn".equals(fieldName)) { + deserializedLambdaFunctionCodeLocationProperties.arn = reader.getString(); + } else if ("publicCloudResourceName".equals(fieldName)) { + deserializedLambdaFunctionCodeLocationProperties.publicCloudResourceName = reader.getString(); + } else if ("awsSourceSchema".equals(fieldName)) { + deserializedLambdaFunctionCodeLocationProperties.awsSourceSchema = reader.getString(); + } else if ("awsRegion".equals(fieldName)) { + deserializedLambdaFunctionCodeLocationProperties.awsRegion = reader.getString(); + } else if ("awsTags".equals(fieldName)) { + Map awsTags = reader.readMap(reader1 -> reader1.getString()); + deserializedLambdaFunctionCodeLocationProperties.awsTags = awsTags; + } else if ("provisioningState".equals(fieldName)) { + deserializedLambdaFunctionCodeLocationProperties.provisioningState + = ProvisioningState.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedLambdaFunctionCodeLocationProperties; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/LambdaFunctionCodeLocationTagsUpdate.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/LambdaFunctionCodeLocationTagsUpdate.java new file mode 100644 index 000000000000..3f149a176df6 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/LambdaFunctionCodeLocationTagsUpdate.java @@ -0,0 +1,97 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.Map; + +/** + * The type used for updating tags in LambdaFunctionCodeLocation resources. + */ +@Fluent +public final class LambdaFunctionCodeLocationTagsUpdate + implements JsonSerializable { + /* + * Resource tags. + */ + private Map tags; + + /** + * Creates an instance of LambdaFunctionCodeLocationTagsUpdate class. + */ + public LambdaFunctionCodeLocationTagsUpdate() { + } + + /** + * Get the tags property: Resource tags. + * + * @return the tags value. + */ + public Map tags() { + return this.tags; + } + + /** + * Set the tags property: Resource tags. + * + * @param tags the tags value to set. + * @return the LambdaFunctionCodeLocationTagsUpdate object itself. + */ + public LambdaFunctionCodeLocationTagsUpdate withTags(Map tags) { + this.tags = tags; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeMapField("tags", this.tags, (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of LambdaFunctionCodeLocationTagsUpdate from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of LambdaFunctionCodeLocationTagsUpdate if the JsonReader was pointing to an instance of it, + * or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the LambdaFunctionCodeLocationTagsUpdate. + */ + public static LambdaFunctionCodeLocationTagsUpdate fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + LambdaFunctionCodeLocationTagsUpdate deserializedLambdaFunctionCodeLocationTagsUpdate + = new LambdaFunctionCodeLocationTagsUpdate(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedLambdaFunctionCodeLocationTagsUpdate.tags = tags; + } else { + reader.skipChildren(); + } + } + + return deserializedLambdaFunctionCodeLocationTagsUpdate; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/LambdaFunctionCodeLocations.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/LambdaFunctionCodeLocations.java new file mode 100644 index 000000000000..46525198e39e --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/LambdaFunctionCodeLocations.java @@ -0,0 +1,162 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** + * Resource collection API of LambdaFunctionCodeLocations. + */ +public interface LambdaFunctionCodeLocations { + /** + * List LambdaFunctionCodeLocation resources by subscription ID. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a LambdaFunctionCodeLocation list operation as paginated response with + * {@link PagedIterable}. + */ + PagedIterable list(); + + /** + * List LambdaFunctionCodeLocation resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a LambdaFunctionCodeLocation list operation as paginated response with + * {@link PagedIterable}. + */ + PagedIterable list(Context context); + + /** + * List LambdaFunctionCodeLocation resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a LambdaFunctionCodeLocation list operation as paginated response with + * {@link PagedIterable}. + */ + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * List LambdaFunctionCodeLocation resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a LambdaFunctionCodeLocation list operation as paginated response with + * {@link PagedIterable}. + */ + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Get a LambdaFunctionCodeLocation. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of LambdaFunctionCodeLocation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a LambdaFunctionCodeLocation along with {@link Response}. + */ + Response getByResourceGroupWithResponse(String resourceGroupName, String name, + Context context); + + /** + * Get a LambdaFunctionCodeLocation. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of LambdaFunctionCodeLocation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a LambdaFunctionCodeLocation. + */ + LambdaFunctionCodeLocation getByResourceGroup(String resourceGroupName, String name); + + /** + * Delete a LambdaFunctionCodeLocation. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of LambdaFunctionCodeLocation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByResourceGroup(String resourceGroupName, String name); + + /** + * Delete a LambdaFunctionCodeLocation. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of LambdaFunctionCodeLocation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String name, Context context); + + /** + * Get a LambdaFunctionCodeLocation. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a LambdaFunctionCodeLocation along with {@link Response}. + */ + LambdaFunctionCodeLocation getById(String id); + + /** + * Get a LambdaFunctionCodeLocation. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a LambdaFunctionCodeLocation along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Delete a LambdaFunctionCodeLocation. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteById(String id); + + /** + * Delete a LambdaFunctionCodeLocation. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new LambdaFunctionCodeLocation resource. + * + * @param name resource name. + * @return the first stage of the new LambdaFunctionCodeLocation definition. + */ + LambdaFunctionCodeLocation.DefinitionStages.Blank define(String name); +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/LambdaFunctionListResult.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/LambdaFunctionListResult.java new file mode 100644 index 000000000000..f62a8a94445f --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/LambdaFunctionListResult.java @@ -0,0 +1,135 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.awsconnector.fluent.models.LambdaFunctionInner; +import java.io.IOException; +import java.util.List; + +/** + * The response of a LambdaFunction list operation. + */ +@Fluent +public final class LambdaFunctionListResult implements JsonSerializable { + /* + * The LambdaFunction items on this page + */ + private List value; + + /* + * The link to the next page of items + */ + private String nextLink; + + /** + * Creates an instance of LambdaFunctionListResult class. + */ + public LambdaFunctionListResult() { + } + + /** + * Get the value property: The LambdaFunction items on this page. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The LambdaFunction items on this page. + * + * @param value the value value to set. + * @return the LambdaFunctionListResult object itself. + */ + public LambdaFunctionListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The link to the next page of items. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: The link to the next page of items. + * + * @param nextLink the nextLink value to set. + * @return the LambdaFunctionListResult object itself. + */ + public LambdaFunctionListResult withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property value in model LambdaFunctionListResult")); + } else { + value().forEach(e -> e.validate()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(LambdaFunctionListResult.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("nextLink", this.nextLink); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of LambdaFunctionListResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of LambdaFunctionListResult if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the LambdaFunctionListResult. + */ + public static LambdaFunctionListResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + LambdaFunctionListResult deserializedLambdaFunctionListResult = new LambdaFunctionListResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> LambdaFunctionInner.fromJson(reader1)); + deserializedLambdaFunctionListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedLambdaFunctionListResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedLambdaFunctionListResult; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/LambdaFunctionProperties.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/LambdaFunctionProperties.java new file mode 100644 index 000000000000..9bb1d5e4c9b2 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/LambdaFunctionProperties.java @@ -0,0 +1,311 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.Map; + +/** + * Definition of LambdaFunction. + */ +@Fluent +public final class LambdaFunctionProperties implements JsonSerializable { + /* + * AWS Properties + */ + private AwsLambdaFunctionProperties awsProperties; + + /* + * Public Cloud Connectors Resource ID + */ + private String publicCloudConnectorsResourceId; + + /* + * AWS Account ID + */ + private String awsAccountId; + + /* + * Amazon Resource Name (ARN) + */ + private String arn; + + /* + * Public Cloud Resource Name + */ + private String publicCloudResourceName; + + /* + * AWS Source Schema + */ + private String awsSourceSchema; + + /* + * AWS Region + */ + private String awsRegion; + + /* + * AWS Tags + */ + private Map awsTags; + + /* + * The status of the last operation. + */ + private ProvisioningState provisioningState; + + /** + * Creates an instance of LambdaFunctionProperties class. + */ + public LambdaFunctionProperties() { + } + + /** + * Get the awsProperties property: AWS Properties. + * + * @return the awsProperties value. + */ + public AwsLambdaFunctionProperties awsProperties() { + return this.awsProperties; + } + + /** + * Set the awsProperties property: AWS Properties. + * + * @param awsProperties the awsProperties value to set. + * @return the LambdaFunctionProperties object itself. + */ + public LambdaFunctionProperties withAwsProperties(AwsLambdaFunctionProperties awsProperties) { + this.awsProperties = awsProperties; + return this; + } + + /** + * Get the publicCloudConnectorsResourceId property: Public Cloud Connectors Resource ID. + * + * @return the publicCloudConnectorsResourceId value. + */ + public String publicCloudConnectorsResourceId() { + return this.publicCloudConnectorsResourceId; + } + + /** + * Set the publicCloudConnectorsResourceId property: Public Cloud Connectors Resource ID. + * + * @param publicCloudConnectorsResourceId the publicCloudConnectorsResourceId value to set. + * @return the LambdaFunctionProperties object itself. + */ + public LambdaFunctionProperties withPublicCloudConnectorsResourceId(String publicCloudConnectorsResourceId) { + this.publicCloudConnectorsResourceId = publicCloudConnectorsResourceId; + return this; + } + + /** + * Get the awsAccountId property: AWS Account ID. + * + * @return the awsAccountId value. + */ + public String awsAccountId() { + return this.awsAccountId; + } + + /** + * Set the awsAccountId property: AWS Account ID. + * + * @param awsAccountId the awsAccountId value to set. + * @return the LambdaFunctionProperties object itself. + */ + public LambdaFunctionProperties withAwsAccountId(String awsAccountId) { + this.awsAccountId = awsAccountId; + return this; + } + + /** + * Get the arn property: Amazon Resource Name (ARN). + * + * @return the arn value. + */ + public String arn() { + return this.arn; + } + + /** + * Set the arn property: Amazon Resource Name (ARN). + * + * @param arn the arn value to set. + * @return the LambdaFunctionProperties object itself. + */ + public LambdaFunctionProperties withArn(String arn) { + this.arn = arn; + return this; + } + + /** + * Get the publicCloudResourceName property: Public Cloud Resource Name. + * + * @return the publicCloudResourceName value. + */ + public String publicCloudResourceName() { + return this.publicCloudResourceName; + } + + /** + * Set the publicCloudResourceName property: Public Cloud Resource Name. + * + * @param publicCloudResourceName the publicCloudResourceName value to set. + * @return the LambdaFunctionProperties object itself. + */ + public LambdaFunctionProperties withPublicCloudResourceName(String publicCloudResourceName) { + this.publicCloudResourceName = publicCloudResourceName; + return this; + } + + /** + * Get the awsSourceSchema property: AWS Source Schema. + * + * @return the awsSourceSchema value. + */ + public String awsSourceSchema() { + return this.awsSourceSchema; + } + + /** + * Set the awsSourceSchema property: AWS Source Schema. + * + * @param awsSourceSchema the awsSourceSchema value to set. + * @return the LambdaFunctionProperties object itself. + */ + public LambdaFunctionProperties withAwsSourceSchema(String awsSourceSchema) { + this.awsSourceSchema = awsSourceSchema; + return this; + } + + /** + * Get the awsRegion property: AWS Region. + * + * @return the awsRegion value. + */ + public String awsRegion() { + return this.awsRegion; + } + + /** + * Set the awsRegion property: AWS Region. + * + * @param awsRegion the awsRegion value to set. + * @return the LambdaFunctionProperties object itself. + */ + public LambdaFunctionProperties withAwsRegion(String awsRegion) { + this.awsRegion = awsRegion; + return this; + } + + /** + * Get the awsTags property: AWS Tags. + * + * @return the awsTags value. + */ + public Map awsTags() { + return this.awsTags; + } + + /** + * Set the awsTags property: AWS Tags. + * + * @param awsTags the awsTags value to set. + * @return the LambdaFunctionProperties object itself. + */ + public LambdaFunctionProperties withAwsTags(Map awsTags) { + this.awsTags = awsTags; + return this; + } + + /** + * Get the provisioningState property: The status of the last operation. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (awsProperties() != null) { + awsProperties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("awsProperties", this.awsProperties); + jsonWriter.writeStringField("publicCloudConnectorsResourceId", this.publicCloudConnectorsResourceId); + jsonWriter.writeStringField("awsAccountId", this.awsAccountId); + jsonWriter.writeStringField("arn", this.arn); + jsonWriter.writeStringField("publicCloudResourceName", this.publicCloudResourceName); + jsonWriter.writeStringField("awsSourceSchema", this.awsSourceSchema); + jsonWriter.writeStringField("awsRegion", this.awsRegion); + jsonWriter.writeMapField("awsTags", this.awsTags, (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of LambdaFunctionProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of LambdaFunctionProperties if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IOException If an error occurs while reading the LambdaFunctionProperties. + */ + public static LambdaFunctionProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + LambdaFunctionProperties deserializedLambdaFunctionProperties = new LambdaFunctionProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("awsProperties".equals(fieldName)) { + deserializedLambdaFunctionProperties.awsProperties = AwsLambdaFunctionProperties.fromJson(reader); + } else if ("publicCloudConnectorsResourceId".equals(fieldName)) { + deserializedLambdaFunctionProperties.publicCloudConnectorsResourceId = reader.getString(); + } else if ("awsAccountId".equals(fieldName)) { + deserializedLambdaFunctionProperties.awsAccountId = reader.getString(); + } else if ("arn".equals(fieldName)) { + deserializedLambdaFunctionProperties.arn = reader.getString(); + } else if ("publicCloudResourceName".equals(fieldName)) { + deserializedLambdaFunctionProperties.publicCloudResourceName = reader.getString(); + } else if ("awsSourceSchema".equals(fieldName)) { + deserializedLambdaFunctionProperties.awsSourceSchema = reader.getString(); + } else if ("awsRegion".equals(fieldName)) { + deserializedLambdaFunctionProperties.awsRegion = reader.getString(); + } else if ("awsTags".equals(fieldName)) { + Map awsTags = reader.readMap(reader1 -> reader1.getString()); + deserializedLambdaFunctionProperties.awsTags = awsTags; + } else if ("provisioningState".equals(fieldName)) { + deserializedLambdaFunctionProperties.provisioningState + = ProvisioningState.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedLambdaFunctionProperties; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/LambdaFunctionTagsUpdate.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/LambdaFunctionTagsUpdate.java new file mode 100644 index 000000000000..dac6f13d0a66 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/LambdaFunctionTagsUpdate.java @@ -0,0 +1,95 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.Map; + +/** + * The type used for updating tags in LambdaFunction resources. + */ +@Fluent +public final class LambdaFunctionTagsUpdate implements JsonSerializable { + /* + * Resource tags. + */ + private Map tags; + + /** + * Creates an instance of LambdaFunctionTagsUpdate class. + */ + public LambdaFunctionTagsUpdate() { + } + + /** + * Get the tags property: Resource tags. + * + * @return the tags value. + */ + public Map tags() { + return this.tags; + } + + /** + * Set the tags property: Resource tags. + * + * @param tags the tags value to set. + * @return the LambdaFunctionTagsUpdate object itself. + */ + public LambdaFunctionTagsUpdate withTags(Map tags) { + this.tags = tags; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeMapField("tags", this.tags, (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of LambdaFunctionTagsUpdate from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of LambdaFunctionTagsUpdate if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IOException If an error occurs while reading the LambdaFunctionTagsUpdate. + */ + public static LambdaFunctionTagsUpdate fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + LambdaFunctionTagsUpdate deserializedLambdaFunctionTagsUpdate = new LambdaFunctionTagsUpdate(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedLambdaFunctionTagsUpdate.tags = tags; + } else { + reader.skipChildren(); + } + } + + return deserializedLambdaFunctionTagsUpdate; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/LambdaFunctions.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/LambdaFunctions.java new file mode 100644 index 000000000000..7b4a0d4e1242 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/LambdaFunctions.java @@ -0,0 +1,157 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** + * Resource collection API of LambdaFunctions. + */ +public interface LambdaFunctions { + /** + * List LambdaFunction resources by subscription ID. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a LambdaFunction list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable list(); + + /** + * List LambdaFunction resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a LambdaFunction list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable list(Context context); + + /** + * List LambdaFunction resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a LambdaFunction list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * List LambdaFunction resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a LambdaFunction list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Get a LambdaFunction. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of LambdaFunction. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a LambdaFunction along with {@link Response}. + */ + Response getByResourceGroupWithResponse(String resourceGroupName, String name, Context context); + + /** + * Get a LambdaFunction. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of LambdaFunction. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a LambdaFunction. + */ + LambdaFunction getByResourceGroup(String resourceGroupName, String name); + + /** + * Delete a LambdaFunction. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of LambdaFunction. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByResourceGroup(String resourceGroupName, String name); + + /** + * Delete a LambdaFunction. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of LambdaFunction. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String name, Context context); + + /** + * Get a LambdaFunction. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a LambdaFunction along with {@link Response}. + */ + LambdaFunction getById(String id); + + /** + * Get a LambdaFunction. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a LambdaFunction along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Delete a LambdaFunction. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteById(String id); + + /** + * Delete a LambdaFunction. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new LambdaFunction resource. + * + * @param name resource name. + * @return the first stage of the new LambdaFunction definition. + */ + LambdaFunction.DefinitionStages.Blank define(String name); +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/LastRunErrorStatus.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/LastRunErrorStatus.java new file mode 100644 index 000000000000..ad65c78a6ede --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/LastRunErrorStatus.java @@ -0,0 +1,107 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of LastRunErrorStatus. + */ +@Fluent +public final class LastRunErrorStatus implements JsonSerializable { + /* + *

Specifies whether any account- or bucket-level access errors occurred when the job ran. For a recurring job, + * this value indicates the error status of the job's most recent run. Possible values are:

  • ERROR - + * One or more errors occurred. Amazon Macie didn't process all the data specified for the job.

  • NONE + * - No errors occurred. Macie processed all the data specified for the job.

+ */ + private LastRunErrorStatusCodeEnumValue code; + + /** + * Creates an instance of LastRunErrorStatus class. + */ + public LastRunErrorStatus() { + } + + /** + * Get the code property: <p>Specifies whether any account- or bucket-level access errors occurred when the + * job ran. For a recurring job, this value indicates the error status of the job's most recent run. Possible values + * are:</p> <ul><li><p>ERROR - One or more errors occurred. Amazon Macie didn't process all + * the data specified for the job.</p></li> <li><p>NONE - No errors occurred. Macie + * processed all the data specified for the job.</p></li></ul>. + * + * @return the code value. + */ + public LastRunErrorStatusCodeEnumValue code() { + return this.code; + } + + /** + * Set the code property: <p>Specifies whether any account- or bucket-level access errors occurred when the + * job ran. For a recurring job, this value indicates the error status of the job's most recent run. Possible values + * are:</p> <ul><li><p>ERROR - One or more errors occurred. Amazon Macie didn't process all + * the data specified for the job.</p></li> <li><p>NONE - No errors occurred. Macie + * processed all the data specified for the job.</p></li></ul>. + * + * @param code the code value to set. + * @return the LastRunErrorStatus object itself. + */ + public LastRunErrorStatus withCode(LastRunErrorStatusCodeEnumValue code) { + this.code = code; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (code() != null) { + code().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("code", this.code); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of LastRunErrorStatus from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of LastRunErrorStatus if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the LastRunErrorStatus. + */ + public static LastRunErrorStatus fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + LastRunErrorStatus deserializedLastRunErrorStatus = new LastRunErrorStatus(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("code".equals(fieldName)) { + deserializedLastRunErrorStatus.code = LastRunErrorStatusCodeEnumValue.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedLastRunErrorStatus; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/LastRunErrorStatusCode.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/LastRunErrorStatusCode.java new file mode 100644 index 000000000000..ade4e0f61274 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/LastRunErrorStatusCode.java @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * LastRunErrorStatusCode enum. + */ +public final class LastRunErrorStatusCode extends ExpandableStringEnum { + /** + * Static value ERROR for LastRunErrorStatusCode. + */ + public static final LastRunErrorStatusCode ERROR = fromString("ERROR"); + + /** + * Static value NONE for LastRunErrorStatusCode. + */ + public static final LastRunErrorStatusCode NONE = fromString("NONE"); + + /** + * Creates a new instance of LastRunErrorStatusCode value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public LastRunErrorStatusCode() { + } + + /** + * Creates or finds a LastRunErrorStatusCode from its string representation. + * + * @param name a name to look for. + * @return the corresponding LastRunErrorStatusCode. + */ + public static LastRunErrorStatusCode fromString(String name) { + return fromString(name, LastRunErrorStatusCode.class); + } + + /** + * Gets known LastRunErrorStatusCode values. + * + * @return known LastRunErrorStatusCode values. + */ + public static Collection values() { + return values(LastRunErrorStatusCode.class); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/LastRunErrorStatusCodeEnumValue.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/LastRunErrorStatusCodeEnumValue.java new file mode 100644 index 000000000000..76255985c42e --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/LastRunErrorStatusCodeEnumValue.java @@ -0,0 +1,95 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of LastRunErrorStatusCodeEnumValue. + */ +@Fluent +public final class LastRunErrorStatusCodeEnumValue implements JsonSerializable { + /* + * Property value + */ + private LastRunErrorStatusCode value; + + /** + * Creates an instance of LastRunErrorStatusCodeEnumValue class. + */ + public LastRunErrorStatusCodeEnumValue() { + } + + /** + * Get the value property: Property value. + * + * @return the value value. + */ + public LastRunErrorStatusCode value() { + return this.value; + } + + /** + * Set the value property: Property value. + * + * @param value the value value to set. + * @return the LastRunErrorStatusCodeEnumValue object itself. + */ + public LastRunErrorStatusCodeEnumValue withValue(LastRunErrorStatusCode value) { + this.value = value; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("value", this.value == null ? null : this.value.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of LastRunErrorStatusCodeEnumValue from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of LastRunErrorStatusCodeEnumValue if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the LastRunErrorStatusCodeEnumValue. + */ + public static LastRunErrorStatusCodeEnumValue fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + LastRunErrorStatusCodeEnumValue deserializedLastRunErrorStatusCodeEnumValue + = new LastRunErrorStatusCodeEnumValue(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + deserializedLastRunErrorStatusCodeEnumValue.value + = LastRunErrorStatusCode.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedLastRunErrorStatusCodeEnumValue; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/LaunchTemplate.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/LaunchTemplate.java new file mode 100644 index 000000000000..c398069e0495 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/LaunchTemplate.java @@ -0,0 +1,179 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Definition of LaunchTemplate. + */ +@Fluent +public final class LaunchTemplate implements JsonSerializable { + /* + * The launch template. Specifies a launch template to use when provisioning EC2 instances for an Auto Scaling + * group. You must specify the following: + The ID or the name of the launch template, but not both. + The version + * of the launch template. ``LaunchTemplateSpecification`` is property of the + * [AWS::AutoScaling::AutoScalingGroup](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource- + * autoscaling-autoscalinggroup.html) resource. It is also a property of the [AWS::AutoScaling::AutoScalingGroup + * LaunchTemplate](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-autoscaling- + * autoscalinggroup-launchtemplate.html) and [AWS::AutoScaling::AutoScalingGroup + * LaunchTemplateOverrides](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties- + * autoscaling-autoscalinggroup-launchtemplateoverrides.html) property types. For information about creating a + * launch template, see + * [AWS::EC2::LaunchTemplate](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ec2- + * launchtemplate.html) and [Create a launch template for an Auto Scaling + * group](https://docs.aws.amazon.com/autoscaling/ec2/userguide/create-launch-template.html) in the *Amazon EC2 Auto + * Scaling User Guide*. For examples of launch templates, see [Auto scaling template + * snippets](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/quickref-autoscaling.html) and the + * [Examples](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ec2-launchtemplate.html# + * aws-resource-ec2-launchtemplate--examples) section in the ``AWS::EC2::LaunchTemplate`` resource. + */ + private LaunchTemplateSpecification launchTemplateSpecification; + + /* + * Any properties that you specify override the same properties in the launch template. + */ + private List overrides; + + /** + * Creates an instance of LaunchTemplate class. + */ + public LaunchTemplate() { + } + + /** + * Get the launchTemplateSpecification property: The launch template. Specifies a launch template to use when + * provisioning EC2 instances for an Auto Scaling group. You must specify the following: + The ID or the name of the + * launch template, but not both. + The version of the launch template. ``LaunchTemplateSpecification`` is property + * of the + * [AWS::AutoScaling::AutoScalingGroup](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-autoscaling-autoscalinggroup.html) + * resource. It is also a property of the [AWS::AutoScaling::AutoScalingGroup + * LaunchTemplate](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-autoscaling-autoscalinggroup-launchtemplate.html) + * and [AWS::AutoScaling::AutoScalingGroup + * LaunchTemplateOverrides](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-autoscaling-autoscalinggroup-launchtemplateoverrides.html) + * property types. For information about creating a launch template, see + * [AWS::EC2::LaunchTemplate](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ec2-launchtemplate.html) + * and [Create a launch template for an Auto Scaling + * group](https://docs.aws.amazon.com/autoscaling/ec2/userguide/create-launch-template.html) in the *Amazon EC2 Auto + * Scaling User Guide*. For examples of launch templates, see [Auto scaling template + * snippets](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/quickref-autoscaling.html) and the + * [Examples](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ec2-launchtemplate.html#aws-resource-ec2-launchtemplate--examples) + * section in the ``AWS::EC2::LaunchTemplate`` resource. + * + * @return the launchTemplateSpecification value. + */ + public LaunchTemplateSpecification launchTemplateSpecification() { + return this.launchTemplateSpecification; + } + + /** + * Set the launchTemplateSpecification property: The launch template. Specifies a launch template to use when + * provisioning EC2 instances for an Auto Scaling group. You must specify the following: + The ID or the name of the + * launch template, but not both. + The version of the launch template. ``LaunchTemplateSpecification`` is property + * of the + * [AWS::AutoScaling::AutoScalingGroup](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-autoscaling-autoscalinggroup.html) + * resource. It is also a property of the [AWS::AutoScaling::AutoScalingGroup + * LaunchTemplate](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-autoscaling-autoscalinggroup-launchtemplate.html) + * and [AWS::AutoScaling::AutoScalingGroup + * LaunchTemplateOverrides](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-autoscaling-autoscalinggroup-launchtemplateoverrides.html) + * property types. For information about creating a launch template, see + * [AWS::EC2::LaunchTemplate](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ec2-launchtemplate.html) + * and [Create a launch template for an Auto Scaling + * group](https://docs.aws.amazon.com/autoscaling/ec2/userguide/create-launch-template.html) in the *Amazon EC2 Auto + * Scaling User Guide*. For examples of launch templates, see [Auto scaling template + * snippets](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/quickref-autoscaling.html) and the + * [Examples](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ec2-launchtemplate.html#aws-resource-ec2-launchtemplate--examples) + * section in the ``AWS::EC2::LaunchTemplate`` resource. + * + * @param launchTemplateSpecification the launchTemplateSpecification value to set. + * @return the LaunchTemplate object itself. + */ + public LaunchTemplate withLaunchTemplateSpecification(LaunchTemplateSpecification launchTemplateSpecification) { + this.launchTemplateSpecification = launchTemplateSpecification; + return this; + } + + /** + * Get the overrides property: Any properties that you specify override the same properties in the launch template. + * + * @return the overrides value. + */ + public List overrides() { + return this.overrides; + } + + /** + * Set the overrides property: Any properties that you specify override the same properties in the launch template. + * + * @param overrides the overrides value to set. + * @return the LaunchTemplate object itself. + */ + public LaunchTemplate withOverrides(List overrides) { + this.overrides = overrides; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (launchTemplateSpecification() != null) { + launchTemplateSpecification().validate(); + } + if (overrides() != null) { + overrides().forEach(e -> e.validate()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("launchTemplateSpecification", this.launchTemplateSpecification); + jsonWriter.writeArrayField("overrides", this.overrides, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of LaunchTemplate from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of LaunchTemplate if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the LaunchTemplate. + */ + public static LaunchTemplate fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + LaunchTemplate deserializedLaunchTemplate = new LaunchTemplate(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("launchTemplateSpecification".equals(fieldName)) { + deserializedLaunchTemplate.launchTemplateSpecification + = LaunchTemplateSpecification.fromJson(reader); + } else if ("overrides".equals(fieldName)) { + List overrides + = reader.readArray(reader1 -> LaunchTemplateOverrides.fromJson(reader1)); + deserializedLaunchTemplate.overrides = overrides; + } else { + reader.skipChildren(); + } + } + + return deserializedLaunchTemplate; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/LaunchTemplateOverrides.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/LaunchTemplateOverrides.java new file mode 100644 index 000000000000..dfbf7a2f6b17 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/LaunchTemplateOverrides.java @@ -0,0 +1,382 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of LaunchTemplateOverrides. + */ +@Fluent +public final class LaunchTemplateOverrides implements JsonSerializable { + /* + * The instance requirements. Amazon EC2 Auto Scaling uses your specified requirements to identify instance types. + * Then, it uses your On-Demand and Spot allocation strategies to launch instances from these instance types. You + * can specify up to four separate sets of instance requirements per Auto Scaling group. This is useful for + * provisioning instances from different Amazon Machine Images (AMIs) in the same Auto Scaling group. To do this, + * create the AMIs and create a new launch template for each AMI. Then, create a compatible set of instance + * requirements for each launch template. If you specify ``InstanceRequirements``, you can't specify + * ``InstanceType``. The attributes for the instance types for a mixed instances policy. Amazon EC2 Auto Scaling + * uses your specified requirements to identify instance types. Then, it uses your On-Demand and Spot allocation + * strategies to launch instances from these instance types. When you specify multiple attributes, you get instance + * types that satisfy all of the specified attributes. If you specify multiple values for an attribute, you get + * instance types that satisfy any of the specified values. To limit the list of instance types from which Amazon + * EC2 Auto Scaling can identify matching instance types, you can use one of the following parameters, but not both + * in the same request: + ``AllowedInstanceTypes`` - The instance types to include in the list. All other instance + * types are ignored, even if they match your specified attributes. + ``ExcludedInstanceTypes`` - The instance types + * to exclude from the list, even if they match your specified attributes. You must specify ``VCpuCount`` and + * ``MemoryMiB``. All other attributes are optional. Any unspecified optional attribute is set to its default. For + * an example template, see [Auto scaling template + * snippets](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/quickref-autoscaling.html). For more + * information, see [Creating an Auto Scaling group using attribute-based instance type + * selection](https://docs.aws.amazon.com/autoscaling/ec2/userguide/create-asg-instance-type-requirements.html) in + * the *Amazon EC2 Auto Scaling User Guide*. For help determining which instance types match your attributes before + * you apply them to your Auto Scaling group, see [Preview instance types with specified + * attributes](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-fleet-attribute-based-instance-type-selection + * .html#ec2fleet-get-instance-types-from-instance-requirements) in the *Amazon EC2 User Guide for Linux Instances*. + * ``InstanceRequirements`` is a property of the ``LaunchTemplateOverrides`` property of the + * [AWS::AutoScaling::AutoScalingGroup + * LaunchTemplate](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-autoscaling- + * autoscalinggroup-launchtemplate.html) property type. + */ + private InstanceRequirements instanceRequirements; + + /* + * The instance type, such as ``m3.xlarge``. You must specify an instance type that is supported in your requested + * Region and Availability Zones. For more information, see [Instance + * types](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/instance-types.html) in the *Amazon Elastic Compute + * Cloud User Guide*. You can specify up to 40 instance types per Auto Scaling group. + */ + private String instanceType; + + /* + * Provides a launch template for the specified instance type or set of instance requirements. For example, some + * instance types might require a launch template with a different AMI. If not provided, Amazon EC2 Auto Scaling + * uses the launch template that's specified in the ``LaunchTemplate`` definition. For more information, see + * [Specifying a different launch template for an instance + * type](https://docs.aws.amazon.com/autoscaling/ec2/userguide/ec2-auto-scaling-mixed-instances-groups-launch- + * template-overrides.html) in the *Amazon EC2 Auto Scaling User Guide*. You can specify up to 20 launch templates + * per Auto Scaling group. The launch templates specified in the overrides and in the ``LaunchTemplate`` definition + * count towards this limit. Specifies a launch template to use when provisioning EC2 instances for an Auto Scaling + * group. You must specify the following: + The ID or the name of the launch template, but not both. + The version + * of the launch template. ``LaunchTemplateSpecification`` is property of the + * [AWS::AutoScaling::AutoScalingGroup](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource- + * autoscaling-autoscalinggroup.html) resource. It is also a property of the [AWS::AutoScaling::AutoScalingGroup + * LaunchTemplate](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-autoscaling- + * autoscalinggroup-launchtemplate.html) and [AWS::AutoScaling::AutoScalingGroup + * LaunchTemplateOverrides](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties- + * autoscaling-autoscalinggroup-launchtemplateoverrides.html) property types. For information about creating a + * launch template, see + * [AWS::EC2::LaunchTemplate](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ec2- + * launchtemplate.html) and [Create a launch template for an Auto Scaling + * group](https://docs.aws.amazon.com/autoscaling/ec2/userguide/create-launch-template.html) in the *Amazon EC2 Auto + * Scaling User Guide*. For examples of launch templates, see [Auto scaling template + * snippets](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/quickref-autoscaling.html) and the + * [Examples](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ec2-launchtemplate.html# + * aws-resource-ec2-launchtemplate--examples) section in the ``AWS::EC2::LaunchTemplate`` resource. + */ + private LaunchTemplateSpecification launchTemplateSpecification; + + /* + * If you provide a list of instance types to use, you can specify the number of capacity units provided by each + * instance type in terms of virtual CPUs, memory, storage, throughput, or other relative performance + * characteristic. When a Spot or On-Demand Instance is launched, the capacity units count toward the desired + * capacity. Amazon EC2 Auto Scaling launches instances until the desired capacity is totally fulfilled, even if + * this results in an overage. For example, if there are two units remaining to fulfill capacity, and Amazon EC2 + * Auto Scaling can only launch an instance with a ``WeightedCapacity`` of five units, the instance is launched, and + * the desired capacity is exceeded by three units. For more information, see [Configure instance weighting for + * Amazon EC2 Auto + * Scaling](https://docs.aws.amazon.com/autoscaling/ec2/userguide/ec2-auto-scaling-mixed-instances-groups-instance- + * weighting.html) in the *Amazon EC2 Auto Scaling User Guide*. Value must be in the range of 1-999. If you specify + * a value for ``WeightedCapacity`` for one instance type, you must specify a value for ``WeightedCapacity`` for all + * of them. Every Auto Scaling group has three size parameters (``DesiredCapacity``, ``MaxSize``, and ``MinSize``). + * Usually, you set these sizes based on a specific number of instances. However, if you configure a mixed instances + * policy that defines weights for the instance types, you must specify these sizes with the same units that you use + * for weighting instances. + */ + private String weightedCapacity; + + /** + * Creates an instance of LaunchTemplateOverrides class. + */ + public LaunchTemplateOverrides() { + } + + /** + * Get the instanceRequirements property: The instance requirements. Amazon EC2 Auto Scaling uses your specified + * requirements to identify instance types. Then, it uses your On-Demand and Spot allocation strategies to launch + * instances from these instance types. You can specify up to four separate sets of instance requirements per Auto + * Scaling group. This is useful for provisioning instances from different Amazon Machine Images (AMIs) in the same + * Auto Scaling group. To do this, create the AMIs and create a new launch template for each AMI. Then, create a + * compatible set of instance requirements for each launch template. If you specify ``InstanceRequirements``, you + * can't specify ``InstanceType``. The attributes for the instance types for a mixed instances policy. Amazon EC2 + * Auto Scaling uses your specified requirements to identify instance types. Then, it uses your On-Demand and Spot + * allocation strategies to launch instances from these instance types. When you specify multiple attributes, you + * get instance types that satisfy all of the specified attributes. If you specify multiple values for an attribute, + * you get instance types that satisfy any of the specified values. To limit the list of instance types from which + * Amazon EC2 Auto Scaling can identify matching instance types, you can use one of the following parameters, but + * not both in the same request: + ``AllowedInstanceTypes`` - The instance types to include in the list. All other + * instance types are ignored, even if they match your specified attributes. + ``ExcludedInstanceTypes`` - The + * instance types to exclude from the list, even if they match your specified attributes. You must specify + * ``VCpuCount`` and ``MemoryMiB``. All other attributes are optional. Any unspecified optional attribute is set to + * its default. For an example template, see [Auto scaling template + * snippets](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/quickref-autoscaling.html). For more + * information, see [Creating an Auto Scaling group using attribute-based instance type + * selection](https://docs.aws.amazon.com/autoscaling/ec2/userguide/create-asg-instance-type-requirements.html) in + * the *Amazon EC2 Auto Scaling User Guide*. For help determining which instance types match your attributes before + * you apply them to your Auto Scaling group, see [Preview instance types with specified + * attributes](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-fleet-attribute-based-instance-type-selection.html#ec2fleet-get-instance-types-from-instance-requirements) + * in the *Amazon EC2 User Guide for Linux Instances*. ``InstanceRequirements`` is a property of the + * ``LaunchTemplateOverrides`` property of the [AWS::AutoScaling::AutoScalingGroup + * LaunchTemplate](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-autoscaling-autoscalinggroup-launchtemplate.html) + * property type. + * + * @return the instanceRequirements value. + */ + public InstanceRequirements instanceRequirements() { + return this.instanceRequirements; + } + + /** + * Set the instanceRequirements property: The instance requirements. Amazon EC2 Auto Scaling uses your specified + * requirements to identify instance types. Then, it uses your On-Demand and Spot allocation strategies to launch + * instances from these instance types. You can specify up to four separate sets of instance requirements per Auto + * Scaling group. This is useful for provisioning instances from different Amazon Machine Images (AMIs) in the same + * Auto Scaling group. To do this, create the AMIs and create a new launch template for each AMI. Then, create a + * compatible set of instance requirements for each launch template. If you specify ``InstanceRequirements``, you + * can't specify ``InstanceType``. The attributes for the instance types for a mixed instances policy. Amazon EC2 + * Auto Scaling uses your specified requirements to identify instance types. Then, it uses your On-Demand and Spot + * allocation strategies to launch instances from these instance types. When you specify multiple attributes, you + * get instance types that satisfy all of the specified attributes. If you specify multiple values for an attribute, + * you get instance types that satisfy any of the specified values. To limit the list of instance types from which + * Amazon EC2 Auto Scaling can identify matching instance types, you can use one of the following parameters, but + * not both in the same request: + ``AllowedInstanceTypes`` - The instance types to include in the list. All other + * instance types are ignored, even if they match your specified attributes. + ``ExcludedInstanceTypes`` - The + * instance types to exclude from the list, even if they match your specified attributes. You must specify + * ``VCpuCount`` and ``MemoryMiB``. All other attributes are optional. Any unspecified optional attribute is set to + * its default. For an example template, see [Auto scaling template + * snippets](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/quickref-autoscaling.html). For more + * information, see [Creating an Auto Scaling group using attribute-based instance type + * selection](https://docs.aws.amazon.com/autoscaling/ec2/userguide/create-asg-instance-type-requirements.html) in + * the *Amazon EC2 Auto Scaling User Guide*. For help determining which instance types match your attributes before + * you apply them to your Auto Scaling group, see [Preview instance types with specified + * attributes](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-fleet-attribute-based-instance-type-selection.html#ec2fleet-get-instance-types-from-instance-requirements) + * in the *Amazon EC2 User Guide for Linux Instances*. ``InstanceRequirements`` is a property of the + * ``LaunchTemplateOverrides`` property of the [AWS::AutoScaling::AutoScalingGroup + * LaunchTemplate](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-autoscaling-autoscalinggroup-launchtemplate.html) + * property type. + * + * @param instanceRequirements the instanceRequirements value to set. + * @return the LaunchTemplateOverrides object itself. + */ + public LaunchTemplateOverrides withInstanceRequirements(InstanceRequirements instanceRequirements) { + this.instanceRequirements = instanceRequirements; + return this; + } + + /** + * Get the instanceType property: The instance type, such as ``m3.xlarge``. You must specify an instance type that + * is supported in your requested Region and Availability Zones. For more information, see [Instance + * types](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/instance-types.html) in the *Amazon Elastic Compute + * Cloud User Guide*. You can specify up to 40 instance types per Auto Scaling group. + * + * @return the instanceType value. + */ + public String instanceType() { + return this.instanceType; + } + + /** + * Set the instanceType property: The instance type, such as ``m3.xlarge``. You must specify an instance type that + * is supported in your requested Region and Availability Zones. For more information, see [Instance + * types](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/instance-types.html) in the *Amazon Elastic Compute + * Cloud User Guide*. You can specify up to 40 instance types per Auto Scaling group. + * + * @param instanceType the instanceType value to set. + * @return the LaunchTemplateOverrides object itself. + */ + public LaunchTemplateOverrides withInstanceType(String instanceType) { + this.instanceType = instanceType; + return this; + } + + /** + * Get the launchTemplateSpecification property: Provides a launch template for the specified instance type or set + * of instance requirements. For example, some instance types might require a launch template with a different AMI. + * If not provided, Amazon EC2 Auto Scaling uses the launch template that's specified in the ``LaunchTemplate`` + * definition. For more information, see [Specifying a different launch template for an instance + * type](https://docs.aws.amazon.com/autoscaling/ec2/userguide/ec2-auto-scaling-mixed-instances-groups-launch-template-overrides.html) + * in the *Amazon EC2 Auto Scaling User Guide*. You can specify up to 20 launch templates per Auto Scaling group. + * The launch templates specified in the overrides and in the ``LaunchTemplate`` definition count towards this + * limit. Specifies a launch template to use when provisioning EC2 instances for an Auto Scaling group. You must + * specify the following: + The ID or the name of the launch template, but not both. + The version of the launch + * template. ``LaunchTemplateSpecification`` is property of the + * [AWS::AutoScaling::AutoScalingGroup](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-autoscaling-autoscalinggroup.html) + * resource. It is also a property of the [AWS::AutoScaling::AutoScalingGroup + * LaunchTemplate](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-autoscaling-autoscalinggroup-launchtemplate.html) + * and [AWS::AutoScaling::AutoScalingGroup + * LaunchTemplateOverrides](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-autoscaling-autoscalinggroup-launchtemplateoverrides.html) + * property types. For information about creating a launch template, see + * [AWS::EC2::LaunchTemplate](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ec2-launchtemplate.html) + * and [Create a launch template for an Auto Scaling + * group](https://docs.aws.amazon.com/autoscaling/ec2/userguide/create-launch-template.html) in the *Amazon EC2 Auto + * Scaling User Guide*. For examples of launch templates, see [Auto scaling template + * snippets](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/quickref-autoscaling.html) and the + * [Examples](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ec2-launchtemplate.html#aws-resource-ec2-launchtemplate--examples) + * section in the ``AWS::EC2::LaunchTemplate`` resource. + * + * @return the launchTemplateSpecification value. + */ + public LaunchTemplateSpecification launchTemplateSpecification() { + return this.launchTemplateSpecification; + } + + /** + * Set the launchTemplateSpecification property: Provides a launch template for the specified instance type or set + * of instance requirements. For example, some instance types might require a launch template with a different AMI. + * If not provided, Amazon EC2 Auto Scaling uses the launch template that's specified in the ``LaunchTemplate`` + * definition. For more information, see [Specifying a different launch template for an instance + * type](https://docs.aws.amazon.com/autoscaling/ec2/userguide/ec2-auto-scaling-mixed-instances-groups-launch-template-overrides.html) + * in the *Amazon EC2 Auto Scaling User Guide*. You can specify up to 20 launch templates per Auto Scaling group. + * The launch templates specified in the overrides and in the ``LaunchTemplate`` definition count towards this + * limit. Specifies a launch template to use when provisioning EC2 instances for an Auto Scaling group. You must + * specify the following: + The ID or the name of the launch template, but not both. + The version of the launch + * template. ``LaunchTemplateSpecification`` is property of the + * [AWS::AutoScaling::AutoScalingGroup](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-autoscaling-autoscalinggroup.html) + * resource. It is also a property of the [AWS::AutoScaling::AutoScalingGroup + * LaunchTemplate](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-autoscaling-autoscalinggroup-launchtemplate.html) + * and [AWS::AutoScaling::AutoScalingGroup + * LaunchTemplateOverrides](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-autoscaling-autoscalinggroup-launchtemplateoverrides.html) + * property types. For information about creating a launch template, see + * [AWS::EC2::LaunchTemplate](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ec2-launchtemplate.html) + * and [Create a launch template for an Auto Scaling + * group](https://docs.aws.amazon.com/autoscaling/ec2/userguide/create-launch-template.html) in the *Amazon EC2 Auto + * Scaling User Guide*. For examples of launch templates, see [Auto scaling template + * snippets](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/quickref-autoscaling.html) and the + * [Examples](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ec2-launchtemplate.html#aws-resource-ec2-launchtemplate--examples) + * section in the ``AWS::EC2::LaunchTemplate`` resource. + * + * @param launchTemplateSpecification the launchTemplateSpecification value to set. + * @return the LaunchTemplateOverrides object itself. + */ + public LaunchTemplateOverrides + withLaunchTemplateSpecification(LaunchTemplateSpecification launchTemplateSpecification) { + this.launchTemplateSpecification = launchTemplateSpecification; + return this; + } + + /** + * Get the weightedCapacity property: If you provide a list of instance types to use, you can specify the number of + * capacity units provided by each instance type in terms of virtual CPUs, memory, storage, throughput, or other + * relative performance characteristic. When a Spot or On-Demand Instance is launched, the capacity units count + * toward the desired capacity. Amazon EC2 Auto Scaling launches instances until the desired capacity is totally + * fulfilled, even if this results in an overage. For example, if there are two units remaining to fulfill capacity, + * and Amazon EC2 Auto Scaling can only launch an instance with a ``WeightedCapacity`` of five units, the instance + * is launched, and the desired capacity is exceeded by three units. For more information, see [Configure instance + * weighting for Amazon EC2 Auto + * Scaling](https://docs.aws.amazon.com/autoscaling/ec2/userguide/ec2-auto-scaling-mixed-instances-groups-instance-weighting.html) + * in the *Amazon EC2 Auto Scaling User Guide*. Value must be in the range of 1-999. If you specify a value for + * ``WeightedCapacity`` for one instance type, you must specify a value for ``WeightedCapacity`` for all of them. + * Every Auto Scaling group has three size parameters (``DesiredCapacity``, ``MaxSize``, and ``MinSize``). Usually, + * you set these sizes based on a specific number of instances. However, if you configure a mixed instances policy + * that defines weights for the instance types, you must specify these sizes with the same units that you use for + * weighting instances. + * + * @return the weightedCapacity value. + */ + public String weightedCapacity() { + return this.weightedCapacity; + } + + /** + * Set the weightedCapacity property: If you provide a list of instance types to use, you can specify the number of + * capacity units provided by each instance type in terms of virtual CPUs, memory, storage, throughput, or other + * relative performance characteristic. When a Spot or On-Demand Instance is launched, the capacity units count + * toward the desired capacity. Amazon EC2 Auto Scaling launches instances until the desired capacity is totally + * fulfilled, even if this results in an overage. For example, if there are two units remaining to fulfill capacity, + * and Amazon EC2 Auto Scaling can only launch an instance with a ``WeightedCapacity`` of five units, the instance + * is launched, and the desired capacity is exceeded by three units. For more information, see [Configure instance + * weighting for Amazon EC2 Auto + * Scaling](https://docs.aws.amazon.com/autoscaling/ec2/userguide/ec2-auto-scaling-mixed-instances-groups-instance-weighting.html) + * in the *Amazon EC2 Auto Scaling User Guide*. Value must be in the range of 1-999. If you specify a value for + * ``WeightedCapacity`` for one instance type, you must specify a value for ``WeightedCapacity`` for all of them. + * Every Auto Scaling group has three size parameters (``DesiredCapacity``, ``MaxSize``, and ``MinSize``). Usually, + * you set these sizes based on a specific number of instances. However, if you configure a mixed instances policy + * that defines weights for the instance types, you must specify these sizes with the same units that you use for + * weighting instances. + * + * @param weightedCapacity the weightedCapacity value to set. + * @return the LaunchTemplateOverrides object itself. + */ + public LaunchTemplateOverrides withWeightedCapacity(String weightedCapacity) { + this.weightedCapacity = weightedCapacity; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (instanceRequirements() != null) { + instanceRequirements().validate(); + } + if (launchTemplateSpecification() != null) { + launchTemplateSpecification().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("instanceRequirements", this.instanceRequirements); + jsonWriter.writeStringField("instanceType", this.instanceType); + jsonWriter.writeJsonField("launchTemplateSpecification", this.launchTemplateSpecification); + jsonWriter.writeStringField("weightedCapacity", this.weightedCapacity); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of LaunchTemplateOverrides from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of LaunchTemplateOverrides if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the LaunchTemplateOverrides. + */ + public static LaunchTemplateOverrides fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + LaunchTemplateOverrides deserializedLaunchTemplateOverrides = new LaunchTemplateOverrides(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("instanceRequirements".equals(fieldName)) { + deserializedLaunchTemplateOverrides.instanceRequirements = InstanceRequirements.fromJson(reader); + } else if ("instanceType".equals(fieldName)) { + deserializedLaunchTemplateOverrides.instanceType = reader.getString(); + } else if ("launchTemplateSpecification".equals(fieldName)) { + deserializedLaunchTemplateOverrides.launchTemplateSpecification + = LaunchTemplateSpecification.fromJson(reader); + } else if ("weightedCapacity".equals(fieldName)) { + deserializedLaunchTemplateOverrides.weightedCapacity = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedLaunchTemplateOverrides; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/LaunchTemplateSpecification.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/LaunchTemplateSpecification.java new file mode 100644 index 000000000000..70784f09340a --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/LaunchTemplateSpecification.java @@ -0,0 +1,174 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of LaunchTemplateSpecification. + */ +@Fluent +public final class LaunchTemplateSpecification implements JsonSerializable { + /* + * The ID of the launch template. You must specify the ``LaunchTemplateID`` or the ``LaunchTemplateName``, but not + * both. + */ + private String launchTemplateId; + + /* + * The name of the launch template. You must specify the ``LaunchTemplateName`` or the ``LaunchTemplateID``, but not + * both. + */ + private String launchTemplateName; + + /* + * The version number of the launch template. Specifying ``$Latest`` or ``$Default`` for the template version number + * is not supported. However, you can specify ``LatestVersionNumber`` or ``DefaultVersionNumber`` using the + * ``Fn::GetAtt`` intrinsic function. For more information, see + * [Fn::GetAtt](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/intrinsic-function-reference-getatt. + * html). For an example of using the ``Fn::GetAtt`` function, see the + * [Examples](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-autoscaling- + * autoscalinggroup.html#aws-resource-autoscaling-autoscalinggroup--examples) section of the + * ``AWS::AutoScaling::AutoScalingGroup`` resource. + */ + private String version; + + /** + * Creates an instance of LaunchTemplateSpecification class. + */ + public LaunchTemplateSpecification() { + } + + /** + * Get the launchTemplateId property: The ID of the launch template. You must specify the ``LaunchTemplateID`` or + * the ``LaunchTemplateName``, but not both. + * + * @return the launchTemplateId value. + */ + public String launchTemplateId() { + return this.launchTemplateId; + } + + /** + * Set the launchTemplateId property: The ID of the launch template. You must specify the ``LaunchTemplateID`` or + * the ``LaunchTemplateName``, but not both. + * + * @param launchTemplateId the launchTemplateId value to set. + * @return the LaunchTemplateSpecification object itself. + */ + public LaunchTemplateSpecification withLaunchTemplateId(String launchTemplateId) { + this.launchTemplateId = launchTemplateId; + return this; + } + + /** + * Get the launchTemplateName property: The name of the launch template. You must specify the ``LaunchTemplateName`` + * or the ``LaunchTemplateID``, but not both. + * + * @return the launchTemplateName value. + */ + public String launchTemplateName() { + return this.launchTemplateName; + } + + /** + * Set the launchTemplateName property: The name of the launch template. You must specify the ``LaunchTemplateName`` + * or the ``LaunchTemplateID``, but not both. + * + * @param launchTemplateName the launchTemplateName value to set. + * @return the LaunchTemplateSpecification object itself. + */ + public LaunchTemplateSpecification withLaunchTemplateName(String launchTemplateName) { + this.launchTemplateName = launchTemplateName; + return this; + } + + /** + * Get the version property: The version number of the launch template. Specifying ``$Latest`` or ``$Default`` for + * the template version number is not supported. However, you can specify ``LatestVersionNumber`` or + * ``DefaultVersionNumber`` using the ``Fn::GetAtt`` intrinsic function. For more information, see + * [Fn::GetAtt](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/intrinsic-function-reference-getatt.html). + * For an example of using the ``Fn::GetAtt`` function, see the + * [Examples](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-autoscaling-autoscalinggroup.html#aws-resource-autoscaling-autoscalinggroup--examples) + * section of the ``AWS::AutoScaling::AutoScalingGroup`` resource. + * + * @return the version value. + */ + public String version() { + return this.version; + } + + /** + * Set the version property: The version number of the launch template. Specifying ``$Latest`` or ``$Default`` for + * the template version number is not supported. However, you can specify ``LatestVersionNumber`` or + * ``DefaultVersionNumber`` using the ``Fn::GetAtt`` intrinsic function. For more information, see + * [Fn::GetAtt](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/intrinsic-function-reference-getatt.html). + * For an example of using the ``Fn::GetAtt`` function, see the + * [Examples](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-autoscaling-autoscalinggroup.html#aws-resource-autoscaling-autoscalinggroup--examples) + * section of the ``AWS::AutoScaling::AutoScalingGroup`` resource. + * + * @param version the version value to set. + * @return the LaunchTemplateSpecification object itself. + */ + public LaunchTemplateSpecification withVersion(String version) { + this.version = version; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("launchTemplateId", this.launchTemplateId); + jsonWriter.writeStringField("launchTemplateName", this.launchTemplateName); + jsonWriter.writeStringField("version", this.version); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of LaunchTemplateSpecification from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of LaunchTemplateSpecification if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the LaunchTemplateSpecification. + */ + public static LaunchTemplateSpecification fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + LaunchTemplateSpecification deserializedLaunchTemplateSpecification = new LaunchTemplateSpecification(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("launchTemplateId".equals(fieldName)) { + deserializedLaunchTemplateSpecification.launchTemplateId = reader.getString(); + } else if ("launchTemplateName".equals(fieldName)) { + deserializedLaunchTemplateSpecification.launchTemplateName = reader.getString(); + } else if ("version".equals(fieldName)) { + deserializedLaunchTemplateSpecification.version = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedLaunchTemplateSpecification; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/LaunchTemplateSpecificationAutoGenerated.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/LaunchTemplateSpecificationAutoGenerated.java new file mode 100644 index 000000000000..47a6489f6ccf --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/LaunchTemplateSpecificationAutoGenerated.java @@ -0,0 +1,151 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of LaunchTemplateSpecification. + */ +@Fluent +public final class LaunchTemplateSpecificationAutoGenerated + implements JsonSerializable { + /* + * Property id + */ + private String id; + + /* + * Property name + */ + private String name; + + /* + * Property version + */ + private String version; + + /** + * Creates an instance of LaunchTemplateSpecificationAutoGenerated class. + */ + public LaunchTemplateSpecificationAutoGenerated() { + } + + /** + * Get the id property: Property id. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Set the id property: Property id. + * + * @param id the id value to set. + * @return the LaunchTemplateSpecificationAutoGenerated object itself. + */ + public LaunchTemplateSpecificationAutoGenerated withId(String id) { + this.id = id; + return this; + } + + /** + * Get the name property: Property name. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: Property name. + * + * @param name the name value to set. + * @return the LaunchTemplateSpecificationAutoGenerated object itself. + */ + public LaunchTemplateSpecificationAutoGenerated withName(String name) { + this.name = name; + return this; + } + + /** + * Get the version property: Property version. + * + * @return the version value. + */ + public String version() { + return this.version; + } + + /** + * Set the version property: Property version. + * + * @param version the version value to set. + * @return the LaunchTemplateSpecificationAutoGenerated object itself. + */ + public LaunchTemplateSpecificationAutoGenerated withVersion(String version) { + this.version = version; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("id", this.id); + jsonWriter.writeStringField("name", this.name); + jsonWriter.writeStringField("version", this.version); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of LaunchTemplateSpecificationAutoGenerated from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of LaunchTemplateSpecificationAutoGenerated if the JsonReader was pointing to an instance of + * it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the LaunchTemplateSpecificationAutoGenerated. + */ + public static LaunchTemplateSpecificationAutoGenerated fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + LaunchTemplateSpecificationAutoGenerated deserializedLaunchTemplateSpecificationAutoGenerated + = new LaunchTemplateSpecificationAutoGenerated(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedLaunchTemplateSpecificationAutoGenerated.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedLaunchTemplateSpecificationAutoGenerated.name = reader.getString(); + } else if ("version".equals(fieldName)) { + deserializedLaunchTemplateSpecificationAutoGenerated.version = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedLaunchTemplateSpecificationAutoGenerated; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/LaunchType.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/LaunchType.java new file mode 100644 index 000000000000..a9d6f7a8b168 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/LaunchType.java @@ -0,0 +1,56 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * LaunchType enum. + */ +public final class LaunchType extends ExpandableStringEnum { + /** + * Static value EC2 for LaunchType. + */ + public static final LaunchType EC2 = fromString("EC2"); + + /** + * Static value EXTERNAL for LaunchType. + */ + public static final LaunchType EXTERNAL = fromString("EXTERNAL"); + + /** + * Static value FARGATE for LaunchType. + */ + public static final LaunchType FARGATE = fromString("FARGATE"); + + /** + * Creates a new instance of LaunchType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public LaunchType() { + } + + /** + * Creates or finds a LaunchType from its string representation. + * + * @param name a name to look for. + * @return the corresponding LaunchType. + */ + public static LaunchType fromString(String name) { + return fromString(name, LaunchType.class); + } + + /** + * Gets known LaunchType values. + * + * @return known LaunchType values. + */ + public static Collection values() { + return values(LaunchType.class); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/LegacyCustomOrigin.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/LegacyCustomOrigin.java new file mode 100644 index 000000000000..688a33df5c3d --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/LegacyCustomOrigin.java @@ -0,0 +1,208 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Definition of LegacyCustomOrigin. + */ +@Fluent +public final class LegacyCustomOrigin implements JsonSerializable { + /* + * Property dnsName + */ + private String dnsName; + + /* + * Property httpPort + */ + private Integer httpPort; + + /* + * Property httpsPort + */ + private Integer httpsPort; + + /* + * Property originProtocolPolicy + */ + private String originProtocolPolicy; + + /* + * Property originSSLProtocols + */ + private List originSslProtocols; + + /** + * Creates an instance of LegacyCustomOrigin class. + */ + public LegacyCustomOrigin() { + } + + /** + * Get the dnsName property: Property dnsName. + * + * @return the dnsName value. + */ + public String dnsName() { + return this.dnsName; + } + + /** + * Set the dnsName property: Property dnsName. + * + * @param dnsName the dnsName value to set. + * @return the LegacyCustomOrigin object itself. + */ + public LegacyCustomOrigin withDnsName(String dnsName) { + this.dnsName = dnsName; + return this; + } + + /** + * Get the httpPort property: Property httpPort. + * + * @return the httpPort value. + */ + public Integer httpPort() { + return this.httpPort; + } + + /** + * Set the httpPort property: Property httpPort. + * + * @param httpPort the httpPort value to set. + * @return the LegacyCustomOrigin object itself. + */ + public LegacyCustomOrigin withHttpPort(Integer httpPort) { + this.httpPort = httpPort; + return this; + } + + /** + * Get the httpsPort property: Property httpsPort. + * + * @return the httpsPort value. + */ + public Integer httpsPort() { + return this.httpsPort; + } + + /** + * Set the httpsPort property: Property httpsPort. + * + * @param httpsPort the httpsPort value to set. + * @return the LegacyCustomOrigin object itself. + */ + public LegacyCustomOrigin withHttpsPort(Integer httpsPort) { + this.httpsPort = httpsPort; + return this; + } + + /** + * Get the originProtocolPolicy property: Property originProtocolPolicy. + * + * @return the originProtocolPolicy value. + */ + public String originProtocolPolicy() { + return this.originProtocolPolicy; + } + + /** + * Set the originProtocolPolicy property: Property originProtocolPolicy. + * + * @param originProtocolPolicy the originProtocolPolicy value to set. + * @return the LegacyCustomOrigin object itself. + */ + public LegacyCustomOrigin withOriginProtocolPolicy(String originProtocolPolicy) { + this.originProtocolPolicy = originProtocolPolicy; + return this; + } + + /** + * Get the originSslProtocols property: Property originSSLProtocols. + * + * @return the originSslProtocols value. + */ + public List originSslProtocols() { + return this.originSslProtocols; + } + + /** + * Set the originSslProtocols property: Property originSSLProtocols. + * + * @param originSslProtocols the originSslProtocols value to set. + * @return the LegacyCustomOrigin object itself. + */ + public LegacyCustomOrigin withOriginSslProtocols(List originSslProtocols) { + this.originSslProtocols = originSslProtocols; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("dnsName", this.dnsName); + jsonWriter.writeNumberField("httpPort", this.httpPort); + jsonWriter.writeNumberField("httpsPort", this.httpsPort); + jsonWriter.writeStringField("originProtocolPolicy", this.originProtocolPolicy); + jsonWriter.writeArrayField("originSSLProtocols", this.originSslProtocols, + (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of LegacyCustomOrigin from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of LegacyCustomOrigin if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the LegacyCustomOrigin. + */ + public static LegacyCustomOrigin fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + LegacyCustomOrigin deserializedLegacyCustomOrigin = new LegacyCustomOrigin(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("dnsName".equals(fieldName)) { + deserializedLegacyCustomOrigin.dnsName = reader.getString(); + } else if ("httpPort".equals(fieldName)) { + deserializedLegacyCustomOrigin.httpPort = reader.getNullable(JsonReader::getInt); + } else if ("httpsPort".equals(fieldName)) { + deserializedLegacyCustomOrigin.httpsPort = reader.getNullable(JsonReader::getInt); + } else if ("originProtocolPolicy".equals(fieldName)) { + deserializedLegacyCustomOrigin.originProtocolPolicy = reader.getString(); + } else if ("originSSLProtocols".equals(fieldName)) { + List originSslProtocols = reader.readArray(reader1 -> reader1.getString()); + deserializedLegacyCustomOrigin.originSslProtocols = originSslProtocols; + } else { + reader.skipChildren(); + } + } + + return deserializedLegacyCustomOrigin; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/LegacyS3Origin.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/LegacyS3Origin.java new file mode 100644 index 000000000000..cf66d18b9e1e --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/LegacyS3Origin.java @@ -0,0 +1,121 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of LegacyS3Origin. + */ +@Fluent +public final class LegacyS3Origin implements JsonSerializable { + /* + * Property dnsName + */ + private String dnsName; + + /* + * Property originAccessIdentity + */ + private String originAccessIdentity; + + /** + * Creates an instance of LegacyS3Origin class. + */ + public LegacyS3Origin() { + } + + /** + * Get the dnsName property: Property dnsName. + * + * @return the dnsName value. + */ + public String dnsName() { + return this.dnsName; + } + + /** + * Set the dnsName property: Property dnsName. + * + * @param dnsName the dnsName value to set. + * @return the LegacyS3Origin object itself. + */ + public LegacyS3Origin withDnsName(String dnsName) { + this.dnsName = dnsName; + return this; + } + + /** + * Get the originAccessIdentity property: Property originAccessIdentity. + * + * @return the originAccessIdentity value. + */ + public String originAccessIdentity() { + return this.originAccessIdentity; + } + + /** + * Set the originAccessIdentity property: Property originAccessIdentity. + * + * @param originAccessIdentity the originAccessIdentity value to set. + * @return the LegacyS3Origin object itself. + */ + public LegacyS3Origin withOriginAccessIdentity(String originAccessIdentity) { + this.originAccessIdentity = originAccessIdentity; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("dnsName", this.dnsName); + jsonWriter.writeStringField("originAccessIdentity", this.originAccessIdentity); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of LegacyS3Origin from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of LegacyS3Origin if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the LegacyS3Origin. + */ + public static LegacyS3Origin fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + LegacyS3Origin deserializedLegacyS3Origin = new LegacyS3Origin(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("dnsName".equals(fieldName)) { + deserializedLegacyS3Origin.dnsName = reader.getString(); + } else if ("originAccessIdentity".equals(fieldName)) { + deserializedLegacyS3Origin.originAccessIdentity = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedLegacyS3Origin; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/LicenseConfiguration.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/LicenseConfiguration.java new file mode 100644 index 000000000000..2db34e356ce0 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/LicenseConfiguration.java @@ -0,0 +1,95 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of LicenseConfiguration. + */ +@Fluent +public final class LicenseConfiguration implements JsonSerializable { + /* + *

The Amazon Resource Name (ARN) of the license configuration.

+ */ + private String licenseConfigurationArn; + + /** + * Creates an instance of LicenseConfiguration class. + */ + public LicenseConfiguration() { + } + + /** + * Get the licenseConfigurationArn property: <p>The Amazon Resource Name (ARN) of the license + * configuration.</p>. + * + * @return the licenseConfigurationArn value. + */ + public String licenseConfigurationArn() { + return this.licenseConfigurationArn; + } + + /** + * Set the licenseConfigurationArn property: <p>The Amazon Resource Name (ARN) of the license + * configuration.</p>. + * + * @param licenseConfigurationArn the licenseConfigurationArn value to set. + * @return the LicenseConfiguration object itself. + */ + public LicenseConfiguration withLicenseConfigurationArn(String licenseConfigurationArn) { + this.licenseConfigurationArn = licenseConfigurationArn; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("licenseConfigurationArn", this.licenseConfigurationArn); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of LicenseConfiguration from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of LicenseConfiguration if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the LicenseConfiguration. + */ + public static LicenseConfiguration fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + LicenseConfiguration deserializedLicenseConfiguration = new LicenseConfiguration(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("licenseConfigurationArn".equals(fieldName)) { + deserializedLicenseConfiguration.licenseConfigurationArn = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedLicenseConfiguration; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/LifecycleConfiguration.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/LifecycleConfiguration.java new file mode 100644 index 000000000000..abf9dadb068d --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/LifecycleConfiguration.java @@ -0,0 +1,98 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Definition of LifecycleConfiguration. + */ +@Fluent +public final class LifecycleConfiguration implements JsonSerializable { + /* + * A lifecycle rule for individual objects in an Amazon S3 bucket. + */ + private List rules; + + /** + * Creates an instance of LifecycleConfiguration class. + */ + public LifecycleConfiguration() { + } + + /** + * Get the rules property: A lifecycle rule for individual objects in an Amazon S3 bucket. + * + * @return the rules value. + */ + public List rules() { + return this.rules; + } + + /** + * Set the rules property: A lifecycle rule for individual objects in an Amazon S3 bucket. + * + * @param rules the rules value to set. + * @return the LifecycleConfiguration object itself. + */ + public LifecycleConfiguration withRules(List rules) { + this.rules = rules; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (rules() != null) { + rules().forEach(e -> e.validate()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("rules", this.rules, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of LifecycleConfiguration from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of LifecycleConfiguration if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the LifecycleConfiguration. + */ + public static LifecycleConfiguration fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + LifecycleConfiguration deserializedLifecycleConfiguration = new LifecycleConfiguration(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("rules".equals(fieldName)) { + List rules = reader.readArray(reader1 -> Rule.fromJson(reader1)); + deserializedLifecycleConfiguration.rules = rules; + } else { + reader.skipChildren(); + } + } + + return deserializedLifecycleConfiguration; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/LifecycleHookSpecification.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/LifecycleHookSpecification.java new file mode 100644 index 000000000000..1d169691d324 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/LifecycleHookSpecification.java @@ -0,0 +1,298 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of LifecycleHookSpecification. + */ +@Fluent +public final class LifecycleHookSpecification implements JsonSerializable { + /* + * The action the Auto Scaling group takes when the lifecycle hook timeout elapses or if an unexpected failure + * occurs. The default value is ``ABANDON``. Valid values: ``CONTINUE`` | ``ABANDON`` + */ + private String defaultResult; + + /* + * The maximum time, in seconds, that can elapse before the lifecycle hook times out. The range is from ``30`` to + * ``7200`` seconds. The default value is ``3600`` seconds (1 hour). + */ + private Integer heartbeatTimeout; + + /* + * The name of the lifecycle hook. + */ + private String lifecycleHookName; + + /* + * The lifecycle transition. For Auto Scaling groups, there are two major lifecycle transitions. + To create a + * lifecycle hook for scale-out events, specify ``autoscaling:EC2_INSTANCE_LAUNCHING``. + To create a lifecycle hook + * for scale-in events, specify ``autoscaling:EC2_INSTANCE_TERMINATING``. + */ + private String lifecycleTransition; + + /* + * Additional information that you want to include any time Amazon EC2 Auto Scaling sends a message to the + * notification target. + */ + private String notificationMetadata; + + /* + * The Amazon Resource Name (ARN) of the notification target that Amazon EC2 Auto Scaling sends notifications to + * when an instance is in a wait state for the lifecycle hook. You can specify an Amazon SNS topic or an Amazon SQS + * queue. + */ + private String notificationTargetArn; + + /* + * The ARN of the IAM role that allows the Auto Scaling group to publish to the specified notification target. For + * information about creating this role, see [Configure a notification target for a lifecycle + * hook](https://docs.aws.amazon.com/autoscaling/ec2/userguide/prepare-for-lifecycle-notifications.html#lifecycle- + * hook-notification-target) in the *Amazon EC2 Auto Scaling User Guide*. Valid only if the notification target is + * an Amazon SNS topic or an Amazon SQS queue. + */ + private String roleArn; + + /** + * Creates an instance of LifecycleHookSpecification class. + */ + public LifecycleHookSpecification() { + } + + /** + * Get the defaultResult property: The action the Auto Scaling group takes when the lifecycle hook timeout elapses + * or if an unexpected failure occurs. The default value is ``ABANDON``. Valid values: ``CONTINUE`` | ``ABANDON``. + * + * @return the defaultResult value. + */ + public String defaultResult() { + return this.defaultResult; + } + + /** + * Set the defaultResult property: The action the Auto Scaling group takes when the lifecycle hook timeout elapses + * or if an unexpected failure occurs. The default value is ``ABANDON``. Valid values: ``CONTINUE`` | ``ABANDON``. + * + * @param defaultResult the defaultResult value to set. + * @return the LifecycleHookSpecification object itself. + */ + public LifecycleHookSpecification withDefaultResult(String defaultResult) { + this.defaultResult = defaultResult; + return this; + } + + /** + * Get the heartbeatTimeout property: The maximum time, in seconds, that can elapse before the lifecycle hook times + * out. The range is from ``30`` to ``7200`` seconds. The default value is ``3600`` seconds (1 hour). + * + * @return the heartbeatTimeout value. + */ + public Integer heartbeatTimeout() { + return this.heartbeatTimeout; + } + + /** + * Set the heartbeatTimeout property: The maximum time, in seconds, that can elapse before the lifecycle hook times + * out. The range is from ``30`` to ``7200`` seconds. The default value is ``3600`` seconds (1 hour). + * + * @param heartbeatTimeout the heartbeatTimeout value to set. + * @return the LifecycleHookSpecification object itself. + */ + public LifecycleHookSpecification withHeartbeatTimeout(Integer heartbeatTimeout) { + this.heartbeatTimeout = heartbeatTimeout; + return this; + } + + /** + * Get the lifecycleHookName property: The name of the lifecycle hook. + * + * @return the lifecycleHookName value. + */ + public String lifecycleHookName() { + return this.lifecycleHookName; + } + + /** + * Set the lifecycleHookName property: The name of the lifecycle hook. + * + * @param lifecycleHookName the lifecycleHookName value to set. + * @return the LifecycleHookSpecification object itself. + */ + public LifecycleHookSpecification withLifecycleHookName(String lifecycleHookName) { + this.lifecycleHookName = lifecycleHookName; + return this; + } + + /** + * Get the lifecycleTransition property: The lifecycle transition. For Auto Scaling groups, there are two major + * lifecycle transitions. + To create a lifecycle hook for scale-out events, specify + * ``autoscaling:EC2_INSTANCE_LAUNCHING``. + To create a lifecycle hook for scale-in events, specify + * ``autoscaling:EC2_INSTANCE_TERMINATING``. + * + * @return the lifecycleTransition value. + */ + public String lifecycleTransition() { + return this.lifecycleTransition; + } + + /** + * Set the lifecycleTransition property: The lifecycle transition. For Auto Scaling groups, there are two major + * lifecycle transitions. + To create a lifecycle hook for scale-out events, specify + * ``autoscaling:EC2_INSTANCE_LAUNCHING``. + To create a lifecycle hook for scale-in events, specify + * ``autoscaling:EC2_INSTANCE_TERMINATING``. + * + * @param lifecycleTransition the lifecycleTransition value to set. + * @return the LifecycleHookSpecification object itself. + */ + public LifecycleHookSpecification withLifecycleTransition(String lifecycleTransition) { + this.lifecycleTransition = lifecycleTransition; + return this; + } + + /** + * Get the notificationMetadata property: Additional information that you want to include any time Amazon EC2 Auto + * Scaling sends a message to the notification target. + * + * @return the notificationMetadata value. + */ + public String notificationMetadata() { + return this.notificationMetadata; + } + + /** + * Set the notificationMetadata property: Additional information that you want to include any time Amazon EC2 Auto + * Scaling sends a message to the notification target. + * + * @param notificationMetadata the notificationMetadata value to set. + * @return the LifecycleHookSpecification object itself. + */ + public LifecycleHookSpecification withNotificationMetadata(String notificationMetadata) { + this.notificationMetadata = notificationMetadata; + return this; + } + + /** + * Get the notificationTargetArn property: The Amazon Resource Name (ARN) of the notification target that Amazon EC2 + * Auto Scaling sends notifications to when an instance is in a wait state for the lifecycle hook. You can specify + * an Amazon SNS topic or an Amazon SQS queue. + * + * @return the notificationTargetArn value. + */ + public String notificationTargetArn() { + return this.notificationTargetArn; + } + + /** + * Set the notificationTargetArn property: The Amazon Resource Name (ARN) of the notification target that Amazon EC2 + * Auto Scaling sends notifications to when an instance is in a wait state for the lifecycle hook. You can specify + * an Amazon SNS topic or an Amazon SQS queue. + * + * @param notificationTargetArn the notificationTargetArn value to set. + * @return the LifecycleHookSpecification object itself. + */ + public LifecycleHookSpecification withNotificationTargetArn(String notificationTargetArn) { + this.notificationTargetArn = notificationTargetArn; + return this; + } + + /** + * Get the roleArn property: The ARN of the IAM role that allows the Auto Scaling group to publish to the specified + * notification target. For information about creating this role, see [Configure a notification target for a + * lifecycle + * hook](https://docs.aws.amazon.com/autoscaling/ec2/userguide/prepare-for-lifecycle-notifications.html#lifecycle-hook-notification-target) + * in the *Amazon EC2 Auto Scaling User Guide*. Valid only if the notification target is an Amazon SNS topic or an + * Amazon SQS queue. + * + * @return the roleArn value. + */ + public String roleArn() { + return this.roleArn; + } + + /** + * Set the roleArn property: The ARN of the IAM role that allows the Auto Scaling group to publish to the specified + * notification target. For information about creating this role, see [Configure a notification target for a + * lifecycle + * hook](https://docs.aws.amazon.com/autoscaling/ec2/userguide/prepare-for-lifecycle-notifications.html#lifecycle-hook-notification-target) + * in the *Amazon EC2 Auto Scaling User Guide*. Valid only if the notification target is an Amazon SNS topic or an + * Amazon SQS queue. + * + * @param roleArn the roleArn value to set. + * @return the LifecycleHookSpecification object itself. + */ + public LifecycleHookSpecification withRoleArn(String roleArn) { + this.roleArn = roleArn; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("defaultResult", this.defaultResult); + jsonWriter.writeNumberField("heartbeatTimeout", this.heartbeatTimeout); + jsonWriter.writeStringField("lifecycleHookName", this.lifecycleHookName); + jsonWriter.writeStringField("lifecycleTransition", this.lifecycleTransition); + jsonWriter.writeStringField("notificationMetadata", this.notificationMetadata); + jsonWriter.writeStringField("notificationTargetARN", this.notificationTargetArn); + jsonWriter.writeStringField("roleARN", this.roleArn); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of LifecycleHookSpecification from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of LifecycleHookSpecification if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IOException If an error occurs while reading the LifecycleHookSpecification. + */ + public static LifecycleHookSpecification fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + LifecycleHookSpecification deserializedLifecycleHookSpecification = new LifecycleHookSpecification(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("defaultResult".equals(fieldName)) { + deserializedLifecycleHookSpecification.defaultResult = reader.getString(); + } else if ("heartbeatTimeout".equals(fieldName)) { + deserializedLifecycleHookSpecification.heartbeatTimeout = reader.getNullable(JsonReader::getInt); + } else if ("lifecycleHookName".equals(fieldName)) { + deserializedLifecycleHookSpecification.lifecycleHookName = reader.getString(); + } else if ("lifecycleTransition".equals(fieldName)) { + deserializedLifecycleHookSpecification.lifecycleTransition = reader.getString(); + } else if ("notificationMetadata".equals(fieldName)) { + deserializedLifecycleHookSpecification.notificationMetadata = reader.getString(); + } else if ("notificationTargetARN".equals(fieldName)) { + deserializedLifecycleHookSpecification.notificationTargetArn = reader.getString(); + } else if ("roleARN".equals(fieldName)) { + deserializedLifecycleHookSpecification.roleArn = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedLifecycleHookSpecification; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/LifecyclePolicy.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/LifecyclePolicy.java new file mode 100644 index 000000000000..0afe4a599b2f --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/LifecyclePolicy.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.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of LifecyclePolicy. + */ +@Fluent +public final class LifecyclePolicy implements JsonSerializable { + /* + * The JSON repository policy text to apply to the repository. The JSON repository policy text to apply to the + * repository. + */ + private String lifecyclePolicyText; + + /* + * The AWS account ID associated with the registry that contains the repository. If you do + * not specify a registry, the default registry is assumed. The AWS account ID associated with the registry that + * contains the repository. If you do not specify a registry, the default registry is assumed. + */ + private String registryId; + + /** + * Creates an instance of LifecyclePolicy class. + */ + public LifecyclePolicy() { + } + + /** + * Get the lifecyclePolicyText property: The JSON repository policy text to apply to the repository. The JSON + * repository policy text to apply to the repository. + * + * @return the lifecyclePolicyText value. + */ + public String lifecyclePolicyText() { + return this.lifecyclePolicyText; + } + + /** + * Set the lifecyclePolicyText property: The JSON repository policy text to apply to the repository. The JSON + * repository policy text to apply to the repository. + * + * @param lifecyclePolicyText the lifecyclePolicyText value to set. + * @return the LifecyclePolicy object itself. + */ + public LifecyclePolicy withLifecyclePolicyText(String lifecyclePolicyText) { + this.lifecyclePolicyText = lifecyclePolicyText; + return this; + } + + /** + * Get the registryId property: The AWS account ID associated with the registry that contains the repository. If you + * do + * not specify a registry, the default registry is assumed. The AWS account ID associated with the registry that + * contains the repository. If you do not specify a registry, the default registry is assumed. + * + * @return the registryId value. + */ + public String registryId() { + return this.registryId; + } + + /** + * Set the registryId property: The AWS account ID associated with the registry that contains the repository. If you + * do + * not specify a registry, the default registry is assumed. The AWS account ID associated with the registry that + * contains the repository. If you do not specify a registry, the default registry is assumed. + * + * @param registryId the registryId value to set. + * @return the LifecyclePolicy object itself. + */ + public LifecyclePolicy withRegistryId(String registryId) { + this.registryId = registryId; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("lifecyclePolicyText", this.lifecyclePolicyText); + jsonWriter.writeStringField("registryId", this.registryId); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of LifecyclePolicy from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of LifecyclePolicy if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the LifecyclePolicy. + */ + public static LifecyclePolicy fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + LifecyclePolicy deserializedLifecyclePolicy = new LifecyclePolicy(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("lifecyclePolicyText".equals(fieldName)) { + deserializedLifecyclePolicy.lifecyclePolicyText = reader.getString(); + } else if ("registryId".equals(fieldName)) { + deserializedLifecyclePolicy.registryId = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedLifecyclePolicy; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/LifecyclePolicyAutoGenerated.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/LifecyclePolicyAutoGenerated.java new file mode 100644 index 000000000000..47eefd0c9223 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/LifecyclePolicyAutoGenerated.java @@ -0,0 +1,166 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of LifecyclePolicy. + */ +@Fluent +public final class LifecyclePolicyAutoGenerated implements JsonSerializable { + /* + * The number of days after files were last accessed in primary storage (the Standard storage class) at which to + * move them to Archive storage. Metadata operations such as listing the contents of a directory don't count as file + * access events. + */ + private String transitionToArchive; + + /* + * The number of days after files were last accessed in primary storage (the Standard storage class) at which to + * move them to Infrequent Access (IA) storage. Metadata operations such as listing the contents of a directory + * don't count as file access events. + */ + private String transitionToIA; + + /* + * Whether to move files back to primary (Standard) storage after they are accessed in IA or Archive storage. + * Metadata operations such as listing the contents of a directory don't count as file access events. + */ + private String transitionToPrimaryStorageClass; + + /** + * Creates an instance of LifecyclePolicyAutoGenerated class. + */ + public LifecyclePolicyAutoGenerated() { + } + + /** + * Get the transitionToArchive property: The number of days after files were last accessed in primary storage (the + * Standard storage class) at which to move them to Archive storage. Metadata operations such as listing the + * contents of a directory don't count as file access events. + * + * @return the transitionToArchive value. + */ + public String transitionToArchive() { + return this.transitionToArchive; + } + + /** + * Set the transitionToArchive property: The number of days after files were last accessed in primary storage (the + * Standard storage class) at which to move them to Archive storage. Metadata operations such as listing the + * contents of a directory don't count as file access events. + * + * @param transitionToArchive the transitionToArchive value to set. + * @return the LifecyclePolicyAutoGenerated object itself. + */ + public LifecyclePolicyAutoGenerated withTransitionToArchive(String transitionToArchive) { + this.transitionToArchive = transitionToArchive; + return this; + } + + /** + * Get the transitionToIA property: The number of days after files were last accessed in primary storage (the + * Standard storage class) at which to move them to Infrequent Access (IA) storage. Metadata operations such as + * listing the contents of a directory don't count as file access events. + * + * @return the transitionToIA value. + */ + public String transitionToIA() { + return this.transitionToIA; + } + + /** + * Set the transitionToIA property: The number of days after files were last accessed in primary storage (the + * Standard storage class) at which to move them to Infrequent Access (IA) storage. Metadata operations such as + * listing the contents of a directory don't count as file access events. + * + * @param transitionToIA the transitionToIA value to set. + * @return the LifecyclePolicyAutoGenerated object itself. + */ + public LifecyclePolicyAutoGenerated withTransitionToIA(String transitionToIA) { + this.transitionToIA = transitionToIA; + return this; + } + + /** + * Get the transitionToPrimaryStorageClass property: Whether to move files back to primary (Standard) storage after + * they are accessed in IA or Archive storage. Metadata operations such as listing the contents of a directory don't + * count as file access events. + * + * @return the transitionToPrimaryStorageClass value. + */ + public String transitionToPrimaryStorageClass() { + return this.transitionToPrimaryStorageClass; + } + + /** + * Set the transitionToPrimaryStorageClass property: Whether to move files back to primary (Standard) storage after + * they are accessed in IA or Archive storage. Metadata operations such as listing the contents of a directory don't + * count as file access events. + * + * @param transitionToPrimaryStorageClass the transitionToPrimaryStorageClass value to set. + * @return the LifecyclePolicyAutoGenerated object itself. + */ + public LifecyclePolicyAutoGenerated withTransitionToPrimaryStorageClass(String transitionToPrimaryStorageClass) { + this.transitionToPrimaryStorageClass = transitionToPrimaryStorageClass; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("transitionToArchive", this.transitionToArchive); + jsonWriter.writeStringField("transitionToIA", this.transitionToIA); + jsonWriter.writeStringField("transitionToPrimaryStorageClass", this.transitionToPrimaryStorageClass); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of LifecyclePolicyAutoGenerated from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of LifecyclePolicyAutoGenerated if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the LifecyclePolicyAutoGenerated. + */ + public static LifecyclePolicyAutoGenerated fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + LifecyclePolicyAutoGenerated deserializedLifecyclePolicyAutoGenerated = new LifecyclePolicyAutoGenerated(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("transitionToArchive".equals(fieldName)) { + deserializedLifecyclePolicyAutoGenerated.transitionToArchive = reader.getString(); + } else if ("transitionToIA".equals(fieldName)) { + deserializedLifecyclePolicyAutoGenerated.transitionToIA = reader.getString(); + } else if ("transitionToPrimaryStorageClass".equals(fieldName)) { + deserializedLifecyclePolicyAutoGenerated.transitionToPrimaryStorageClass = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedLifecyclePolicyAutoGenerated; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/LightsailBucket.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/LightsailBucket.java new file mode 100644 index 000000000000..58188d8d6334 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/LightsailBucket.java @@ -0,0 +1,252 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.awsconnector.fluent.models.LightsailBucketInner; +import java.util.Map; + +/** + * An immutable client-side representation of LightsailBucket. + */ +public interface LightsailBucket { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the location property: The geo-location where the resource lives. + * + * @return the location value. + */ + String location(); + + /** + * Gets the tags property: Resource tags. + * + * @return the tags value. + */ + Map tags(); + + /** + * Gets the properties property: The resource-specific properties for this resource. + * + * @return the properties value. + */ + LightsailBucketProperties properties(); + + /** + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the region of the resource. + * + * @return the region of the resource. + */ + Region region(); + + /** + * Gets the name of the resource region. + * + * @return the name of the resource region. + */ + String regionName(); + + /** + * Gets the name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + + /** + * Gets the inner com.azure.resourcemanager.awsconnector.fluent.models.LightsailBucketInner object. + * + * @return the inner object. + */ + LightsailBucketInner innerModel(); + + /** + * The entirety of the LightsailBucket definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithLocation, + DefinitionStages.WithResourceGroup, DefinitionStages.WithCreate { + } + + /** + * The LightsailBucket definition stages. + */ + interface DefinitionStages { + /** + * The first stage of the LightsailBucket definition. + */ + interface Blank extends WithLocation { + } + + /** + * The stage of the LightsailBucket definition allowing to specify location. + */ + interface WithLocation { + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithResourceGroup withRegion(Region location); + + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithResourceGroup withRegion(String location); + } + + /** + * The stage of the LightsailBucket definition allowing to specify parent resource. + */ + interface WithResourceGroup { + /** + * Specifies resourceGroupName. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @return the next definition stage. + */ + WithCreate withExistingResourceGroup(String resourceGroupName); + } + + /** + * The stage of the LightsailBucket 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.WithProperties { + /** + * Executes the create request. + * + * @return the created resource. + */ + LightsailBucket create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + LightsailBucket create(Context context); + } + + /** + * The stage of the LightsailBucket definition allowing to specify tags. + */ + interface WithTags { + /** + * Specifies the tags property: Resource tags.. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + WithCreate withTags(Map tags); + } + + /** + * The stage of the LightsailBucket definition allowing to specify properties. + */ + interface WithProperties { + /** + * Specifies the properties property: The resource-specific properties for this resource.. + * + * @param properties The resource-specific properties for this resource. + * @return the next definition stage. + */ + WithCreate withProperties(LightsailBucketProperties properties); + } + } + + /** + * Begins update for the LightsailBucket resource. + * + * @return the stage of resource update. + */ + LightsailBucket.Update update(); + + /** + * The template for LightsailBucket update. + */ + interface Update extends UpdateStages.WithTags { + /** + * Executes the update request. + * + * @return the updated resource. + */ + LightsailBucket apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + LightsailBucket apply(Context context); + } + + /** + * The LightsailBucket update stages. + */ + interface UpdateStages { + /** + * The stage of the LightsailBucket update allowing to specify tags. + */ + interface WithTags { + /** + * Specifies the tags property: Resource tags.. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + Update withTags(Map tags); + } + } + + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + LightsailBucket refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + LightsailBucket refresh(Context context); +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/LightsailBucketListResult.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/LightsailBucketListResult.java new file mode 100644 index 000000000000..e0aec49ac193 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/LightsailBucketListResult.java @@ -0,0 +1,136 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.awsconnector.fluent.models.LightsailBucketInner; +import java.io.IOException; +import java.util.List; + +/** + * The response of a LightsailBucket list operation. + */ +@Fluent +public final class LightsailBucketListResult implements JsonSerializable { + /* + * The LightsailBucket items on this page + */ + private List value; + + /* + * The link to the next page of items + */ + private String nextLink; + + /** + * Creates an instance of LightsailBucketListResult class. + */ + public LightsailBucketListResult() { + } + + /** + * Get the value property: The LightsailBucket items on this page. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The LightsailBucket items on this page. + * + * @param value the value value to set. + * @return the LightsailBucketListResult object itself. + */ + public LightsailBucketListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The link to the next page of items. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: The link to the next page of items. + * + * @param nextLink the nextLink value to set. + * @return the LightsailBucketListResult object itself. + */ + public LightsailBucketListResult withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() == null) { + throw LOGGER.atError() + .log( + new IllegalArgumentException("Missing required property value in model LightsailBucketListResult")); + } else { + value().forEach(e -> e.validate()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(LightsailBucketListResult.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("nextLink", this.nextLink); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of LightsailBucketListResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of LightsailBucketListResult if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the LightsailBucketListResult. + */ + public static LightsailBucketListResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + LightsailBucketListResult deserializedLightsailBucketListResult = new LightsailBucketListResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> LightsailBucketInner.fromJson(reader1)); + deserializedLightsailBucketListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedLightsailBucketListResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedLightsailBucketListResult; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/LightsailBucketProperties.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/LightsailBucketProperties.java new file mode 100644 index 000000000000..5d3b4fa4c44a --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/LightsailBucketProperties.java @@ -0,0 +1,311 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.Map; + +/** + * Definition of LightsailBucket. + */ +@Fluent +public final class LightsailBucketProperties implements JsonSerializable { + /* + * AWS Properties + */ + private AwsLightsailBucketProperties awsProperties; + + /* + * Public Cloud Connectors Resource ID + */ + private String publicCloudConnectorsResourceId; + + /* + * AWS Account ID + */ + private String awsAccountId; + + /* + * Amazon Resource Name (ARN) + */ + private String arn; + + /* + * Public Cloud Resource Name + */ + private String publicCloudResourceName; + + /* + * AWS Source Schema + */ + private String awsSourceSchema; + + /* + * AWS Region + */ + private String awsRegion; + + /* + * AWS Tags + */ + private Map awsTags; + + /* + * The status of the last operation. + */ + private ProvisioningState provisioningState; + + /** + * Creates an instance of LightsailBucketProperties class. + */ + public LightsailBucketProperties() { + } + + /** + * Get the awsProperties property: AWS Properties. + * + * @return the awsProperties value. + */ + public AwsLightsailBucketProperties awsProperties() { + return this.awsProperties; + } + + /** + * Set the awsProperties property: AWS Properties. + * + * @param awsProperties the awsProperties value to set. + * @return the LightsailBucketProperties object itself. + */ + public LightsailBucketProperties withAwsProperties(AwsLightsailBucketProperties awsProperties) { + this.awsProperties = awsProperties; + return this; + } + + /** + * Get the publicCloudConnectorsResourceId property: Public Cloud Connectors Resource ID. + * + * @return the publicCloudConnectorsResourceId value. + */ + public String publicCloudConnectorsResourceId() { + return this.publicCloudConnectorsResourceId; + } + + /** + * Set the publicCloudConnectorsResourceId property: Public Cloud Connectors Resource ID. + * + * @param publicCloudConnectorsResourceId the publicCloudConnectorsResourceId value to set. + * @return the LightsailBucketProperties object itself. + */ + public LightsailBucketProperties withPublicCloudConnectorsResourceId(String publicCloudConnectorsResourceId) { + this.publicCloudConnectorsResourceId = publicCloudConnectorsResourceId; + return this; + } + + /** + * Get the awsAccountId property: AWS Account ID. + * + * @return the awsAccountId value. + */ + public String awsAccountId() { + return this.awsAccountId; + } + + /** + * Set the awsAccountId property: AWS Account ID. + * + * @param awsAccountId the awsAccountId value to set. + * @return the LightsailBucketProperties object itself. + */ + public LightsailBucketProperties withAwsAccountId(String awsAccountId) { + this.awsAccountId = awsAccountId; + return this; + } + + /** + * Get the arn property: Amazon Resource Name (ARN). + * + * @return the arn value. + */ + public String arn() { + return this.arn; + } + + /** + * Set the arn property: Amazon Resource Name (ARN). + * + * @param arn the arn value to set. + * @return the LightsailBucketProperties object itself. + */ + public LightsailBucketProperties withArn(String arn) { + this.arn = arn; + return this; + } + + /** + * Get the publicCloudResourceName property: Public Cloud Resource Name. + * + * @return the publicCloudResourceName value. + */ + public String publicCloudResourceName() { + return this.publicCloudResourceName; + } + + /** + * Set the publicCloudResourceName property: Public Cloud Resource Name. + * + * @param publicCloudResourceName the publicCloudResourceName value to set. + * @return the LightsailBucketProperties object itself. + */ + public LightsailBucketProperties withPublicCloudResourceName(String publicCloudResourceName) { + this.publicCloudResourceName = publicCloudResourceName; + return this; + } + + /** + * Get the awsSourceSchema property: AWS Source Schema. + * + * @return the awsSourceSchema value. + */ + public String awsSourceSchema() { + return this.awsSourceSchema; + } + + /** + * Set the awsSourceSchema property: AWS Source Schema. + * + * @param awsSourceSchema the awsSourceSchema value to set. + * @return the LightsailBucketProperties object itself. + */ + public LightsailBucketProperties withAwsSourceSchema(String awsSourceSchema) { + this.awsSourceSchema = awsSourceSchema; + return this; + } + + /** + * Get the awsRegion property: AWS Region. + * + * @return the awsRegion value. + */ + public String awsRegion() { + return this.awsRegion; + } + + /** + * Set the awsRegion property: AWS Region. + * + * @param awsRegion the awsRegion value to set. + * @return the LightsailBucketProperties object itself. + */ + public LightsailBucketProperties withAwsRegion(String awsRegion) { + this.awsRegion = awsRegion; + return this; + } + + /** + * Get the awsTags property: AWS Tags. + * + * @return the awsTags value. + */ + public Map awsTags() { + return this.awsTags; + } + + /** + * Set the awsTags property: AWS Tags. + * + * @param awsTags the awsTags value to set. + * @return the LightsailBucketProperties object itself. + */ + public LightsailBucketProperties withAwsTags(Map awsTags) { + this.awsTags = awsTags; + return this; + } + + /** + * Get the provisioningState property: The status of the last operation. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (awsProperties() != null) { + awsProperties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("awsProperties", this.awsProperties); + jsonWriter.writeStringField("publicCloudConnectorsResourceId", this.publicCloudConnectorsResourceId); + jsonWriter.writeStringField("awsAccountId", this.awsAccountId); + jsonWriter.writeStringField("arn", this.arn); + jsonWriter.writeStringField("publicCloudResourceName", this.publicCloudResourceName); + jsonWriter.writeStringField("awsSourceSchema", this.awsSourceSchema); + jsonWriter.writeStringField("awsRegion", this.awsRegion); + jsonWriter.writeMapField("awsTags", this.awsTags, (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of LightsailBucketProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of LightsailBucketProperties if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IOException If an error occurs while reading the LightsailBucketProperties. + */ + public static LightsailBucketProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + LightsailBucketProperties deserializedLightsailBucketProperties = new LightsailBucketProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("awsProperties".equals(fieldName)) { + deserializedLightsailBucketProperties.awsProperties = AwsLightsailBucketProperties.fromJson(reader); + } else if ("publicCloudConnectorsResourceId".equals(fieldName)) { + deserializedLightsailBucketProperties.publicCloudConnectorsResourceId = reader.getString(); + } else if ("awsAccountId".equals(fieldName)) { + deserializedLightsailBucketProperties.awsAccountId = reader.getString(); + } else if ("arn".equals(fieldName)) { + deserializedLightsailBucketProperties.arn = reader.getString(); + } else if ("publicCloudResourceName".equals(fieldName)) { + deserializedLightsailBucketProperties.publicCloudResourceName = reader.getString(); + } else if ("awsSourceSchema".equals(fieldName)) { + deserializedLightsailBucketProperties.awsSourceSchema = reader.getString(); + } else if ("awsRegion".equals(fieldName)) { + deserializedLightsailBucketProperties.awsRegion = reader.getString(); + } else if ("awsTags".equals(fieldName)) { + Map awsTags = reader.readMap(reader1 -> reader1.getString()); + deserializedLightsailBucketProperties.awsTags = awsTags; + } else if ("provisioningState".equals(fieldName)) { + deserializedLightsailBucketProperties.provisioningState + = ProvisioningState.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedLightsailBucketProperties; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/LightsailBucketTagsUpdate.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/LightsailBucketTagsUpdate.java new file mode 100644 index 000000000000..7188c596d59f --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/LightsailBucketTagsUpdate.java @@ -0,0 +1,95 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.Map; + +/** + * The type used for updating tags in LightsailBucket resources. + */ +@Fluent +public final class LightsailBucketTagsUpdate implements JsonSerializable { + /* + * Resource tags. + */ + private Map tags; + + /** + * Creates an instance of LightsailBucketTagsUpdate class. + */ + public LightsailBucketTagsUpdate() { + } + + /** + * Get the tags property: Resource tags. + * + * @return the tags value. + */ + public Map tags() { + return this.tags; + } + + /** + * Set the tags property: Resource tags. + * + * @param tags the tags value to set. + * @return the LightsailBucketTagsUpdate object itself. + */ + public LightsailBucketTagsUpdate withTags(Map tags) { + this.tags = tags; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeMapField("tags", this.tags, (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of LightsailBucketTagsUpdate from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of LightsailBucketTagsUpdate if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IOException If an error occurs while reading the LightsailBucketTagsUpdate. + */ + public static LightsailBucketTagsUpdate fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + LightsailBucketTagsUpdate deserializedLightsailBucketTagsUpdate = new LightsailBucketTagsUpdate(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedLightsailBucketTagsUpdate.tags = tags; + } else { + reader.skipChildren(); + } + } + + return deserializedLightsailBucketTagsUpdate; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/LightsailBuckets.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/LightsailBuckets.java new file mode 100644 index 000000000000..fcd83b339dbe --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/LightsailBuckets.java @@ -0,0 +1,157 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** + * Resource collection API of LightsailBuckets. + */ +public interface LightsailBuckets { + /** + * List LightsailBucket resources by subscription ID. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a LightsailBucket list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable list(); + + /** + * List LightsailBucket resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a LightsailBucket list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable list(Context context); + + /** + * List LightsailBucket resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a LightsailBucket list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * List LightsailBucket resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a LightsailBucket list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Get a LightsailBucket. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of LightsailBucket. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a LightsailBucket along with {@link Response}. + */ + Response getByResourceGroupWithResponse(String resourceGroupName, String name, Context context); + + /** + * Get a LightsailBucket. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of LightsailBucket. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a LightsailBucket. + */ + LightsailBucket getByResourceGroup(String resourceGroupName, String name); + + /** + * Delete a LightsailBucket. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of LightsailBucket. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByResourceGroup(String resourceGroupName, String name); + + /** + * Delete a LightsailBucket. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of LightsailBucket. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String name, Context context); + + /** + * Get a LightsailBucket. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a LightsailBucket along with {@link Response}. + */ + LightsailBucket getById(String id); + + /** + * Get a LightsailBucket. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a LightsailBucket along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Delete a LightsailBucket. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteById(String id); + + /** + * Delete a LightsailBucket. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new LightsailBucket resource. + * + * @param name resource name. + * @return the first stage of the new LightsailBucket definition. + */ + LightsailBucket.DefinitionStages.Blank define(String name); +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/LightsailInstance.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/LightsailInstance.java new file mode 100644 index 000000000000..a53fac36cb6f --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/LightsailInstance.java @@ -0,0 +1,252 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.awsconnector.fluent.models.LightsailInstanceInner; +import java.util.Map; + +/** + * An immutable client-side representation of LightsailInstance. + */ +public interface LightsailInstance { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the location property: The geo-location where the resource lives. + * + * @return the location value. + */ + String location(); + + /** + * Gets the tags property: Resource tags. + * + * @return the tags value. + */ + Map tags(); + + /** + * Gets the properties property: The resource-specific properties for this resource. + * + * @return the properties value. + */ + LightsailInstanceProperties properties(); + + /** + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the region of the resource. + * + * @return the region of the resource. + */ + Region region(); + + /** + * Gets the name of the resource region. + * + * @return the name of the resource region. + */ + String regionName(); + + /** + * Gets the name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + + /** + * Gets the inner com.azure.resourcemanager.awsconnector.fluent.models.LightsailInstanceInner object. + * + * @return the inner object. + */ + LightsailInstanceInner innerModel(); + + /** + * The entirety of the LightsailInstance definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithLocation, + DefinitionStages.WithResourceGroup, DefinitionStages.WithCreate { + } + + /** + * The LightsailInstance definition stages. + */ + interface DefinitionStages { + /** + * The first stage of the LightsailInstance definition. + */ + interface Blank extends WithLocation { + } + + /** + * The stage of the LightsailInstance definition allowing to specify location. + */ + interface WithLocation { + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithResourceGroup withRegion(Region location); + + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithResourceGroup withRegion(String location); + } + + /** + * The stage of the LightsailInstance definition allowing to specify parent resource. + */ + interface WithResourceGroup { + /** + * Specifies resourceGroupName. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @return the next definition stage. + */ + WithCreate withExistingResourceGroup(String resourceGroupName); + } + + /** + * The stage of the LightsailInstance 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.WithProperties { + /** + * Executes the create request. + * + * @return the created resource. + */ + LightsailInstance create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + LightsailInstance create(Context context); + } + + /** + * The stage of the LightsailInstance definition allowing to specify tags. + */ + interface WithTags { + /** + * Specifies the tags property: Resource tags.. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + WithCreate withTags(Map tags); + } + + /** + * The stage of the LightsailInstance definition allowing to specify properties. + */ + interface WithProperties { + /** + * Specifies the properties property: The resource-specific properties for this resource.. + * + * @param properties The resource-specific properties for this resource. + * @return the next definition stage. + */ + WithCreate withProperties(LightsailInstanceProperties properties); + } + } + + /** + * Begins update for the LightsailInstance resource. + * + * @return the stage of resource update. + */ + LightsailInstance.Update update(); + + /** + * The template for LightsailInstance update. + */ + interface Update extends UpdateStages.WithTags { + /** + * Executes the update request. + * + * @return the updated resource. + */ + LightsailInstance apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + LightsailInstance apply(Context context); + } + + /** + * The LightsailInstance update stages. + */ + interface UpdateStages { + /** + * The stage of the LightsailInstance update allowing to specify tags. + */ + interface WithTags { + /** + * Specifies the tags property: Resource tags.. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + Update withTags(Map tags); + } + } + + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + LightsailInstance refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + LightsailInstance refresh(Context context); +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/LightsailInstanceListResult.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/LightsailInstanceListResult.java new file mode 100644 index 000000000000..0af5e4e63c77 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/LightsailInstanceListResult.java @@ -0,0 +1,136 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.awsconnector.fluent.models.LightsailInstanceInner; +import java.io.IOException; +import java.util.List; + +/** + * The response of a LightsailInstance list operation. + */ +@Fluent +public final class LightsailInstanceListResult implements JsonSerializable { + /* + * The LightsailInstance items on this page + */ + private List value; + + /* + * The link to the next page of items + */ + private String nextLink; + + /** + * Creates an instance of LightsailInstanceListResult class. + */ + public LightsailInstanceListResult() { + } + + /** + * Get the value property: The LightsailInstance items on this page. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The LightsailInstance items on this page. + * + * @param value the value value to set. + * @return the LightsailInstanceListResult object itself. + */ + public LightsailInstanceListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The link to the next page of items. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: The link to the next page of items. + * + * @param nextLink the nextLink value to set. + * @return the LightsailInstanceListResult object itself. + */ + public LightsailInstanceListResult withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property value in model LightsailInstanceListResult")); + } else { + value().forEach(e -> e.validate()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(LightsailInstanceListResult.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("nextLink", this.nextLink); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of LightsailInstanceListResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of LightsailInstanceListResult if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the LightsailInstanceListResult. + */ + public static LightsailInstanceListResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + LightsailInstanceListResult deserializedLightsailInstanceListResult = new LightsailInstanceListResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> LightsailInstanceInner.fromJson(reader1)); + deserializedLightsailInstanceListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedLightsailInstanceListResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedLightsailInstanceListResult; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/LightsailInstanceProperties.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/LightsailInstanceProperties.java new file mode 100644 index 000000000000..a9be7c1646d7 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/LightsailInstanceProperties.java @@ -0,0 +1,312 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.Map; + +/** + * Definition of LightsailInstance. + */ +@Fluent +public final class LightsailInstanceProperties implements JsonSerializable { + /* + * AWS Properties + */ + private AwsLightsailInstanceProperties awsProperties; + + /* + * Public Cloud Connectors Resource ID + */ + private String publicCloudConnectorsResourceId; + + /* + * AWS Account ID + */ + private String awsAccountId; + + /* + * Amazon Resource Name (ARN) + */ + private String arn; + + /* + * Public Cloud Resource Name + */ + private String publicCloudResourceName; + + /* + * AWS Source Schema + */ + private String awsSourceSchema; + + /* + * AWS Region + */ + private String awsRegion; + + /* + * AWS Tags + */ + private Map awsTags; + + /* + * The status of the last operation. + */ + private ProvisioningState provisioningState; + + /** + * Creates an instance of LightsailInstanceProperties class. + */ + public LightsailInstanceProperties() { + } + + /** + * Get the awsProperties property: AWS Properties. + * + * @return the awsProperties value. + */ + public AwsLightsailInstanceProperties awsProperties() { + return this.awsProperties; + } + + /** + * Set the awsProperties property: AWS Properties. + * + * @param awsProperties the awsProperties value to set. + * @return the LightsailInstanceProperties object itself. + */ + public LightsailInstanceProperties withAwsProperties(AwsLightsailInstanceProperties awsProperties) { + this.awsProperties = awsProperties; + return this; + } + + /** + * Get the publicCloudConnectorsResourceId property: Public Cloud Connectors Resource ID. + * + * @return the publicCloudConnectorsResourceId value. + */ + public String publicCloudConnectorsResourceId() { + return this.publicCloudConnectorsResourceId; + } + + /** + * Set the publicCloudConnectorsResourceId property: Public Cloud Connectors Resource ID. + * + * @param publicCloudConnectorsResourceId the publicCloudConnectorsResourceId value to set. + * @return the LightsailInstanceProperties object itself. + */ + public LightsailInstanceProperties withPublicCloudConnectorsResourceId(String publicCloudConnectorsResourceId) { + this.publicCloudConnectorsResourceId = publicCloudConnectorsResourceId; + return this; + } + + /** + * Get the awsAccountId property: AWS Account ID. + * + * @return the awsAccountId value. + */ + public String awsAccountId() { + return this.awsAccountId; + } + + /** + * Set the awsAccountId property: AWS Account ID. + * + * @param awsAccountId the awsAccountId value to set. + * @return the LightsailInstanceProperties object itself. + */ + public LightsailInstanceProperties withAwsAccountId(String awsAccountId) { + this.awsAccountId = awsAccountId; + return this; + } + + /** + * Get the arn property: Amazon Resource Name (ARN). + * + * @return the arn value. + */ + public String arn() { + return this.arn; + } + + /** + * Set the arn property: Amazon Resource Name (ARN). + * + * @param arn the arn value to set. + * @return the LightsailInstanceProperties object itself. + */ + public LightsailInstanceProperties withArn(String arn) { + this.arn = arn; + return this; + } + + /** + * Get the publicCloudResourceName property: Public Cloud Resource Name. + * + * @return the publicCloudResourceName value. + */ + public String publicCloudResourceName() { + return this.publicCloudResourceName; + } + + /** + * Set the publicCloudResourceName property: Public Cloud Resource Name. + * + * @param publicCloudResourceName the publicCloudResourceName value to set. + * @return the LightsailInstanceProperties object itself. + */ + public LightsailInstanceProperties withPublicCloudResourceName(String publicCloudResourceName) { + this.publicCloudResourceName = publicCloudResourceName; + return this; + } + + /** + * Get the awsSourceSchema property: AWS Source Schema. + * + * @return the awsSourceSchema value. + */ + public String awsSourceSchema() { + return this.awsSourceSchema; + } + + /** + * Set the awsSourceSchema property: AWS Source Schema. + * + * @param awsSourceSchema the awsSourceSchema value to set. + * @return the LightsailInstanceProperties object itself. + */ + public LightsailInstanceProperties withAwsSourceSchema(String awsSourceSchema) { + this.awsSourceSchema = awsSourceSchema; + return this; + } + + /** + * Get the awsRegion property: AWS Region. + * + * @return the awsRegion value. + */ + public String awsRegion() { + return this.awsRegion; + } + + /** + * Set the awsRegion property: AWS Region. + * + * @param awsRegion the awsRegion value to set. + * @return the LightsailInstanceProperties object itself. + */ + public LightsailInstanceProperties withAwsRegion(String awsRegion) { + this.awsRegion = awsRegion; + return this; + } + + /** + * Get the awsTags property: AWS Tags. + * + * @return the awsTags value. + */ + public Map awsTags() { + return this.awsTags; + } + + /** + * Set the awsTags property: AWS Tags. + * + * @param awsTags the awsTags value to set. + * @return the LightsailInstanceProperties object itself. + */ + public LightsailInstanceProperties withAwsTags(Map awsTags) { + this.awsTags = awsTags; + return this; + } + + /** + * Get the provisioningState property: The status of the last operation. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (awsProperties() != null) { + awsProperties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("awsProperties", this.awsProperties); + jsonWriter.writeStringField("publicCloudConnectorsResourceId", this.publicCloudConnectorsResourceId); + jsonWriter.writeStringField("awsAccountId", this.awsAccountId); + jsonWriter.writeStringField("arn", this.arn); + jsonWriter.writeStringField("publicCloudResourceName", this.publicCloudResourceName); + jsonWriter.writeStringField("awsSourceSchema", this.awsSourceSchema); + jsonWriter.writeStringField("awsRegion", this.awsRegion); + jsonWriter.writeMapField("awsTags", this.awsTags, (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of LightsailInstanceProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of LightsailInstanceProperties if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the LightsailInstanceProperties. + */ + public static LightsailInstanceProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + LightsailInstanceProperties deserializedLightsailInstanceProperties = new LightsailInstanceProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("awsProperties".equals(fieldName)) { + deserializedLightsailInstanceProperties.awsProperties + = AwsLightsailInstanceProperties.fromJson(reader); + } else if ("publicCloudConnectorsResourceId".equals(fieldName)) { + deserializedLightsailInstanceProperties.publicCloudConnectorsResourceId = reader.getString(); + } else if ("awsAccountId".equals(fieldName)) { + deserializedLightsailInstanceProperties.awsAccountId = reader.getString(); + } else if ("arn".equals(fieldName)) { + deserializedLightsailInstanceProperties.arn = reader.getString(); + } else if ("publicCloudResourceName".equals(fieldName)) { + deserializedLightsailInstanceProperties.publicCloudResourceName = reader.getString(); + } else if ("awsSourceSchema".equals(fieldName)) { + deserializedLightsailInstanceProperties.awsSourceSchema = reader.getString(); + } else if ("awsRegion".equals(fieldName)) { + deserializedLightsailInstanceProperties.awsRegion = reader.getString(); + } else if ("awsTags".equals(fieldName)) { + Map awsTags = reader.readMap(reader1 -> reader1.getString()); + deserializedLightsailInstanceProperties.awsTags = awsTags; + } else if ("provisioningState".equals(fieldName)) { + deserializedLightsailInstanceProperties.provisioningState + = ProvisioningState.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedLightsailInstanceProperties; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/LightsailInstanceTagsUpdate.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/LightsailInstanceTagsUpdate.java new file mode 100644 index 000000000000..4d7e601a4efb --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/LightsailInstanceTagsUpdate.java @@ -0,0 +1,95 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.Map; + +/** + * The type used for updating tags in LightsailInstance resources. + */ +@Fluent +public final class LightsailInstanceTagsUpdate implements JsonSerializable { + /* + * Resource tags. + */ + private Map tags; + + /** + * Creates an instance of LightsailInstanceTagsUpdate class. + */ + public LightsailInstanceTagsUpdate() { + } + + /** + * Get the tags property: Resource tags. + * + * @return the tags value. + */ + public Map tags() { + return this.tags; + } + + /** + * Set the tags property: Resource tags. + * + * @param tags the tags value to set. + * @return the LightsailInstanceTagsUpdate object itself. + */ + public LightsailInstanceTagsUpdate withTags(Map tags) { + this.tags = tags; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeMapField("tags", this.tags, (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of LightsailInstanceTagsUpdate from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of LightsailInstanceTagsUpdate if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the LightsailInstanceTagsUpdate. + */ + public static LightsailInstanceTagsUpdate fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + LightsailInstanceTagsUpdate deserializedLightsailInstanceTagsUpdate = new LightsailInstanceTagsUpdate(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedLightsailInstanceTagsUpdate.tags = tags; + } else { + reader.skipChildren(); + } + } + + return deserializedLightsailInstanceTagsUpdate; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/LightsailInstances.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/LightsailInstances.java new file mode 100644 index 000000000000..3da5232c70cd --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/LightsailInstances.java @@ -0,0 +1,157 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** + * Resource collection API of LightsailInstances. + */ +public interface LightsailInstances { + /** + * List LightsailInstance resources by subscription ID. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a LightsailInstance list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable list(); + + /** + * List LightsailInstance resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a LightsailInstance list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable list(Context context); + + /** + * List LightsailInstance resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a LightsailInstance list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * List LightsailInstance resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a LightsailInstance list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Get a LightsailInstance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of LightsailInstance. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a LightsailInstance along with {@link Response}. + */ + Response getByResourceGroupWithResponse(String resourceGroupName, String name, Context context); + + /** + * Get a LightsailInstance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of LightsailInstance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a LightsailInstance. + */ + LightsailInstance getByResourceGroup(String resourceGroupName, String name); + + /** + * Delete a LightsailInstance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of LightsailInstance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByResourceGroup(String resourceGroupName, String name); + + /** + * Delete a LightsailInstance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of LightsailInstance. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String name, Context context); + + /** + * Get a LightsailInstance. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a LightsailInstance along with {@link Response}. + */ + LightsailInstance getById(String id); + + /** + * Get a LightsailInstance. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a LightsailInstance along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Delete a LightsailInstance. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteById(String id); + + /** + * Delete a LightsailInstance. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new LightsailInstance resource. + * + * @param name resource name. + * @return the first stage of the new LightsailInstance definition. + */ + LightsailInstance.DefinitionStages.Blank define(String name); +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/LinuxParameters.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/LinuxParameters.java new file mode 100644 index 000000000000..f0ca17064dc7 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/LinuxParameters.java @@ -0,0 +1,394 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Definition of LinuxParameters. + */ +@Fluent +public final class LinuxParameters implements JsonSerializable { + /* + * The Linux capabilities for the container that are added to or dropped from the default configuration provided by + * Docker. For tasks that use the Fargate launch type, ``capabilities`` is supported for all platform versions but + * the ``add`` parameter is only supported if using platform version 1.4.0 or later. The Linux capabilities to add + * or remove from the default Docker configuration for a container defined in the task definition. For more + * information about the default capabilities and the non-default available capabilities, see [Runtime privilege and + * Linux + * capabilities](https://docs.aws.amazon.com/https://docs.docker.com/engine/reference/run/#runtime-privilege-and- + * linux-capabilities) in the *Docker run reference*. For more detailed information about these Linux capabilities, + * see the [capabilities(7)](https://docs.aws.amazon.com/http://man7.org/linux/man-pages/man7/capabilities.7.html) + * Linux manual page. + */ + private KernelCapabilities capabilities; + + /* + * Any host devices to expose to the container. This parameter maps to ``Devices`` in the [Create a + * container](https://docs.aws.amazon.com/https://docs.docker.com/engine/api/v1.35/#operation/ContainerCreate) + * section of the [Docker Remote API](https://docs.aws.amazon.com/https://docs.docker.com/engine/api/v1.35/) and the + * ``--device`` option to [docker + * run](https://docs.aws.amazon.com/https://docs.docker.com/engine/reference/run/#security-configuration). If you're + * using tasks that use the Fargate launch type, the ``devices`` parameter isn't supported. + */ + private List devices; + + /* + * Run an ``init`` process inside the container that forwards signals and reaps processes. This parameter maps to + * the ``--init`` option to [docker + * run](https://docs.aws.amazon.com/https://docs.docker.com/engine/reference/run/#security-configuration). This + * parameter requires version 1.25 of the Docker Remote API or greater on your container instance. To check the + * Docker Remote API version on your container instance, log in to your container instance and run the following + * command: ``sudo docker version --format '{{.Server.APIVersion}}'`` + */ + private Boolean initProcessEnabled; + + /* + * The total amount of swap memory (in MiB) a container can use. This parameter will be translated to the + * ``--memory-swap`` option to [docker + * run](https://docs.aws.amazon.com/https://docs.docker.com/engine/reference/run/#security-configuration) where the + * value would be the sum of the container memory plus the ``maxSwap`` value. If a ``maxSwap`` value of ``0`` is + * specified, the container will not use swap. Accepted values are ``0`` or any positive integer. If the ``maxSwap`` + * parameter is omitted, the container will use the swap configuration for the container instance it is running on. + * A ``maxSwap`` value must be set for the ``swappiness`` parameter to be used. If you're using tasks that use the + * Fargate launch type, the ``maxSwap`` parameter isn't supported. If you're using tasks on Amazon Linux 2023 the + * ``swappiness`` parameter isn't supported. + */ + private Integer maxSwap; + + /* + * The value for the size (in MiB) of the ``/dev/shm`` volume. This parameter maps to the ``--shm-size`` option to + * [docker run](https://docs.aws.amazon.com/https://docs.docker.com/engine/reference/run/#security-configuration). + * If you are using tasks that use the Fargate launch type, the ``sharedMemorySize`` parameter is not supported. + */ + private Integer sharedMemorySize; + + /* + * This allows you to tune a container's memory swappiness behavior. A ``swappiness`` value of ``0`` will cause + * swapping to not happen unless absolutely necessary. A ``swappiness`` value of ``100`` will cause pages to be + * swapped very aggressively. Accepted values are whole numbers between ``0`` and ``100``. If the ``swappiness`` + * parameter is not specified, a default value of ``60`` is used. If a value is not specified for ``maxSwap`` then + * this parameter is ignored. This parameter maps to the ``--memory-swappiness`` option to [docker + * run](https://docs.aws.amazon.com/https://docs.docker.com/engine/reference/run/#security-configuration). If you're + * using tasks that use the Fargate launch type, the ``swappiness`` parameter isn't supported. If you're using tasks + * on Amazon Linux 2023 the ``swappiness`` parameter isn't supported. + */ + private Integer swappiness; + + /* + * The container path, mount options, and size (in MiB) of the tmpfs mount. This parameter maps to the ``--tmpfs`` + * option to [docker + * run](https://docs.aws.amazon.com/https://docs.docker.com/engine/reference/run/#security-configuration). If you're + * using tasks that use the Fargate launch type, the ``tmpfs`` parameter isn't supported. + */ + private List tmpfs; + + /** + * Creates an instance of LinuxParameters class. + */ + public LinuxParameters() { + } + + /** + * Get the capabilities property: The Linux capabilities for the container that are added to or dropped from the + * default configuration provided by Docker. For tasks that use the Fargate launch type, ``capabilities`` is + * supported for all platform versions but the ``add`` parameter is only supported if using platform version 1.4.0 + * or later. The Linux capabilities to add or remove from the default Docker configuration for a container defined + * in the task definition. For more information about the default capabilities and the non-default available + * capabilities, see [Runtime privilege and Linux + * capabilities](https://docs.aws.amazon.com/https://docs.docker.com/engine/reference/run/#runtime-privilege-and-linux-capabilities) + * in the *Docker run reference*. For more detailed information about these Linux capabilities, see the + * [capabilities(7)](https://docs.aws.amazon.com/http://man7.org/linux/man-pages/man7/capabilities.7.html) Linux + * manual page. + * + * @return the capabilities value. + */ + public KernelCapabilities capabilities() { + return this.capabilities; + } + + /** + * Set the capabilities property: The Linux capabilities for the container that are added to or dropped from the + * default configuration provided by Docker. For tasks that use the Fargate launch type, ``capabilities`` is + * supported for all platform versions but the ``add`` parameter is only supported if using platform version 1.4.0 + * or later. The Linux capabilities to add or remove from the default Docker configuration for a container defined + * in the task definition. For more information about the default capabilities and the non-default available + * capabilities, see [Runtime privilege and Linux + * capabilities](https://docs.aws.amazon.com/https://docs.docker.com/engine/reference/run/#runtime-privilege-and-linux-capabilities) + * in the *Docker run reference*. For more detailed information about these Linux capabilities, see the + * [capabilities(7)](https://docs.aws.amazon.com/http://man7.org/linux/man-pages/man7/capabilities.7.html) Linux + * manual page. + * + * @param capabilities the capabilities value to set. + * @return the LinuxParameters object itself. + */ + public LinuxParameters withCapabilities(KernelCapabilities capabilities) { + this.capabilities = capabilities; + return this; + } + + /** + * Get the devices property: Any host devices to expose to the container. This parameter maps to ``Devices`` in the + * [Create a + * container](https://docs.aws.amazon.com/https://docs.docker.com/engine/api/v1.35/#operation/ContainerCreate) + * section of the [Docker Remote API](https://docs.aws.amazon.com/https://docs.docker.com/engine/api/v1.35/) and the + * ``--device`` option to [docker + * run](https://docs.aws.amazon.com/https://docs.docker.com/engine/reference/run/#security-configuration). If you're + * using tasks that use the Fargate launch type, the ``devices`` parameter isn't supported. + * + * @return the devices value. + */ + public List devices() { + return this.devices; + } + + /** + * Set the devices property: Any host devices to expose to the container. This parameter maps to ``Devices`` in the + * [Create a + * container](https://docs.aws.amazon.com/https://docs.docker.com/engine/api/v1.35/#operation/ContainerCreate) + * section of the [Docker Remote API](https://docs.aws.amazon.com/https://docs.docker.com/engine/api/v1.35/) and the + * ``--device`` option to [docker + * run](https://docs.aws.amazon.com/https://docs.docker.com/engine/reference/run/#security-configuration). If you're + * using tasks that use the Fargate launch type, the ``devices`` parameter isn't supported. + * + * @param devices the devices value to set. + * @return the LinuxParameters object itself. + */ + public LinuxParameters withDevices(List devices) { + this.devices = devices; + return this; + } + + /** + * Get the initProcessEnabled property: Run an ``init`` process inside the container that forwards signals and reaps + * processes. This parameter maps to the ``--init`` option to [docker + * run](https://docs.aws.amazon.com/https://docs.docker.com/engine/reference/run/#security-configuration). This + * parameter requires version 1.25 of the Docker Remote API or greater on your container instance. To check the + * Docker Remote API version on your container instance, log in to your container instance and run the following + * command: ``sudo docker version --format '{{.Server.APIVersion}}'``. + * + * @return the initProcessEnabled value. + */ + public Boolean initProcessEnabled() { + return this.initProcessEnabled; + } + + /** + * Set the initProcessEnabled property: Run an ``init`` process inside the container that forwards signals and reaps + * processes. This parameter maps to the ``--init`` option to [docker + * run](https://docs.aws.amazon.com/https://docs.docker.com/engine/reference/run/#security-configuration). This + * parameter requires version 1.25 of the Docker Remote API or greater on your container instance. To check the + * Docker Remote API version on your container instance, log in to your container instance and run the following + * command: ``sudo docker version --format '{{.Server.APIVersion}}'``. + * + * @param initProcessEnabled the initProcessEnabled value to set. + * @return the LinuxParameters object itself. + */ + public LinuxParameters withInitProcessEnabled(Boolean initProcessEnabled) { + this.initProcessEnabled = initProcessEnabled; + return this; + } + + /** + * Get the maxSwap property: The total amount of swap memory (in MiB) a container can use. This parameter will be + * translated to the ``--memory-swap`` option to [docker + * run](https://docs.aws.amazon.com/https://docs.docker.com/engine/reference/run/#security-configuration) where the + * value would be the sum of the container memory plus the ``maxSwap`` value. If a ``maxSwap`` value of ``0`` is + * specified, the container will not use swap. Accepted values are ``0`` or any positive integer. If the ``maxSwap`` + * parameter is omitted, the container will use the swap configuration for the container instance it is running on. + * A ``maxSwap`` value must be set for the ``swappiness`` parameter to be used. If you're using tasks that use the + * Fargate launch type, the ``maxSwap`` parameter isn't supported. If you're using tasks on Amazon Linux 2023 the + * ``swappiness`` parameter isn't supported. + * + * @return the maxSwap value. + */ + public Integer maxSwap() { + return this.maxSwap; + } + + /** + * Set the maxSwap property: The total amount of swap memory (in MiB) a container can use. This parameter will be + * translated to the ``--memory-swap`` option to [docker + * run](https://docs.aws.amazon.com/https://docs.docker.com/engine/reference/run/#security-configuration) where the + * value would be the sum of the container memory plus the ``maxSwap`` value. If a ``maxSwap`` value of ``0`` is + * specified, the container will not use swap. Accepted values are ``0`` or any positive integer. If the ``maxSwap`` + * parameter is omitted, the container will use the swap configuration for the container instance it is running on. + * A ``maxSwap`` value must be set for the ``swappiness`` parameter to be used. If you're using tasks that use the + * Fargate launch type, the ``maxSwap`` parameter isn't supported. If you're using tasks on Amazon Linux 2023 the + * ``swappiness`` parameter isn't supported. + * + * @param maxSwap the maxSwap value to set. + * @return the LinuxParameters object itself. + */ + public LinuxParameters withMaxSwap(Integer maxSwap) { + this.maxSwap = maxSwap; + return this; + } + + /** + * Get the sharedMemorySize property: The value for the size (in MiB) of the ``/dev/shm`` volume. This parameter + * maps to the ``--shm-size`` option to [docker + * run](https://docs.aws.amazon.com/https://docs.docker.com/engine/reference/run/#security-configuration). If you + * are using tasks that use the Fargate launch type, the ``sharedMemorySize`` parameter is not supported. + * + * @return the sharedMemorySize value. + */ + public Integer sharedMemorySize() { + return this.sharedMemorySize; + } + + /** + * Set the sharedMemorySize property: The value for the size (in MiB) of the ``/dev/shm`` volume. This parameter + * maps to the ``--shm-size`` option to [docker + * run](https://docs.aws.amazon.com/https://docs.docker.com/engine/reference/run/#security-configuration). If you + * are using tasks that use the Fargate launch type, the ``sharedMemorySize`` parameter is not supported. + * + * @param sharedMemorySize the sharedMemorySize value to set. + * @return the LinuxParameters object itself. + */ + public LinuxParameters withSharedMemorySize(Integer sharedMemorySize) { + this.sharedMemorySize = sharedMemorySize; + return this; + } + + /** + * Get the swappiness property: This allows you to tune a container's memory swappiness behavior. A ``swappiness`` + * value of ``0`` will cause swapping to not happen unless absolutely necessary. A ``swappiness`` value of ``100`` + * will cause pages to be swapped very aggressively. Accepted values are whole numbers between ``0`` and ``100``. If + * the ``swappiness`` parameter is not specified, a default value of ``60`` is used. If a value is not specified for + * ``maxSwap`` then this parameter is ignored. This parameter maps to the ``--memory-swappiness`` option to [docker + * run](https://docs.aws.amazon.com/https://docs.docker.com/engine/reference/run/#security-configuration). If you're + * using tasks that use the Fargate launch type, the ``swappiness`` parameter isn't supported. If you're using tasks + * on Amazon Linux 2023 the ``swappiness`` parameter isn't supported. + * + * @return the swappiness value. + */ + public Integer swappiness() { + return this.swappiness; + } + + /** + * Set the swappiness property: This allows you to tune a container's memory swappiness behavior. A ``swappiness`` + * value of ``0`` will cause swapping to not happen unless absolutely necessary. A ``swappiness`` value of ``100`` + * will cause pages to be swapped very aggressively. Accepted values are whole numbers between ``0`` and ``100``. If + * the ``swappiness`` parameter is not specified, a default value of ``60`` is used. If a value is not specified for + * ``maxSwap`` then this parameter is ignored. This parameter maps to the ``--memory-swappiness`` option to [docker + * run](https://docs.aws.amazon.com/https://docs.docker.com/engine/reference/run/#security-configuration). If you're + * using tasks that use the Fargate launch type, the ``swappiness`` parameter isn't supported. If you're using tasks + * on Amazon Linux 2023 the ``swappiness`` parameter isn't supported. + * + * @param swappiness the swappiness value to set. + * @return the LinuxParameters object itself. + */ + public LinuxParameters withSwappiness(Integer swappiness) { + this.swappiness = swappiness; + return this; + } + + /** + * Get the tmpfs property: The container path, mount options, and size (in MiB) of the tmpfs mount. This parameter + * maps to the ``--tmpfs`` option to [docker + * run](https://docs.aws.amazon.com/https://docs.docker.com/engine/reference/run/#security-configuration). If you're + * using tasks that use the Fargate launch type, the ``tmpfs`` parameter isn't supported. + * + * @return the tmpfs value. + */ + public List tmpfs() { + return this.tmpfs; + } + + /** + * Set the tmpfs property: The container path, mount options, and size (in MiB) of the tmpfs mount. This parameter + * maps to the ``--tmpfs`` option to [docker + * run](https://docs.aws.amazon.com/https://docs.docker.com/engine/reference/run/#security-configuration). If you're + * using tasks that use the Fargate launch type, the ``tmpfs`` parameter isn't supported. + * + * @param tmpfs the tmpfs value to set. + * @return the LinuxParameters object itself. + */ + public LinuxParameters withTmpfs(List tmpfs) { + this.tmpfs = tmpfs; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (capabilities() != null) { + capabilities().validate(); + } + if (devices() != null) { + devices().forEach(e -> e.validate()); + } + if (tmpfs() != null) { + tmpfs().forEach(e -> e.validate()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("capabilities", this.capabilities); + jsonWriter.writeArrayField("devices", this.devices, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeBooleanField("initProcessEnabled", this.initProcessEnabled); + jsonWriter.writeNumberField("maxSwap", this.maxSwap); + jsonWriter.writeNumberField("sharedMemorySize", this.sharedMemorySize); + jsonWriter.writeNumberField("swappiness", this.swappiness); + jsonWriter.writeArrayField("tmpfs", this.tmpfs, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of LinuxParameters from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of LinuxParameters if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the LinuxParameters. + */ + public static LinuxParameters fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + LinuxParameters deserializedLinuxParameters = new LinuxParameters(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("capabilities".equals(fieldName)) { + deserializedLinuxParameters.capabilities = KernelCapabilities.fromJson(reader); + } else if ("devices".equals(fieldName)) { + List devices = reader.readArray(reader1 -> Device.fromJson(reader1)); + deserializedLinuxParameters.devices = devices; + } else if ("initProcessEnabled".equals(fieldName)) { + deserializedLinuxParameters.initProcessEnabled = reader.getNullable(JsonReader::getBoolean); + } else if ("maxSwap".equals(fieldName)) { + deserializedLinuxParameters.maxSwap = reader.getNullable(JsonReader::getInt); + } else if ("sharedMemorySize".equals(fieldName)) { + deserializedLinuxParameters.sharedMemorySize = reader.getNullable(JsonReader::getInt); + } else if ("swappiness".equals(fieldName)) { + deserializedLinuxParameters.swappiness = reader.getNullable(JsonReader::getInt); + } else if ("tmpfs".equals(fieldName)) { + List tmpfs = reader.readArray(reader1 -> Tmpfs.fromJson(reader1)); + deserializedLinuxParameters.tmpfs = tmpfs; + } else { + reader.skipChildren(); + } + } + + return deserializedLinuxParameters; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/LoadBalancer.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/LoadBalancer.java new file mode 100644 index 000000000000..6cc44047ed34 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/LoadBalancer.java @@ -0,0 +1,231 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of LoadBalancer. + */ +@Fluent +public final class LoadBalancer implements JsonSerializable { + /* + * The name of the container (as it appears in a container definition) to associate with the load balancer. You need + * to specify the container name when configuring the target group for an Amazon ECS load balancer. + */ + private String containerName; + + /* + * The port on the container to associate with the load balancer. This port must correspond to a ``containerPort`` + * in the task definition the tasks in the service are using. For tasks that use the EC2 launch type, the container + * instance they're launched on must allow ingress traffic on the ``hostPort`` of the port mapping. + */ + private Integer containerPort; + + /* + * The name of the load balancer to associate with the Amazon ECS service or task set. If you are using an + * Application Load Balancer or a Network Load Balancer the load balancer name parameter should be omitted. + */ + private String loadBalancerName; + + /* + * The full Amazon Resource Name (ARN) of the Elastic Load Balancing target group or groups associated with a + * service or task set. A target group ARN is only specified when using an Application Load Balancer or Network Load + * Balancer. For services using the ``ECS`` deployment controller, you can specify one or multiple target groups. + * For more information, see [Registering multiple target groups with a + * service](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/register-multiple-targetgroups.html) in the + * *Amazon Elastic Container Service Developer Guide*. For services using the ``CODE_DEPLOY`` deployment controller, + * you're required to define two target groups for the load balancer. For more information, see [Blue/green + * deployment with + * CodeDeploy](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/deployment-type-bluegreen.html) in the + * *Amazon Elastic Container Service Developer Guide*. If your service's task definition uses the ``awsvpc`` network + * mode, you must choose ``ip`` as the target type, not ``instance``. Do this when creating your target groups + * because tasks that use the ``awsvpc`` network mode are associated with an elastic network interface, not an + * Amazon EC2 instance. This network mode is required for the Fargate launch type. + */ + private String targetGroupArn; + + /** + * Creates an instance of LoadBalancer class. + */ + public LoadBalancer() { + } + + /** + * Get the containerName property: The name of the container (as it appears in a container definition) to associate + * with the load balancer. You need to specify the container name when configuring the target group for an Amazon + * ECS load balancer. + * + * @return the containerName value. + */ + public String containerName() { + return this.containerName; + } + + /** + * Set the containerName property: The name of the container (as it appears in a container definition) to associate + * with the load balancer. You need to specify the container name when configuring the target group for an Amazon + * ECS load balancer. + * + * @param containerName the containerName value to set. + * @return the LoadBalancer object itself. + */ + public LoadBalancer withContainerName(String containerName) { + this.containerName = containerName; + return this; + } + + /** + * Get the containerPort property: The port on the container to associate with the load balancer. This port must + * correspond to a ``containerPort`` in the task definition the tasks in the service are using. For tasks that use + * the EC2 launch type, the container instance they're launched on must allow ingress traffic on the ``hostPort`` of + * the port mapping. + * + * @return the containerPort value. + */ + public Integer containerPort() { + return this.containerPort; + } + + /** + * Set the containerPort property: The port on the container to associate with the load balancer. This port must + * correspond to a ``containerPort`` in the task definition the tasks in the service are using. For tasks that use + * the EC2 launch type, the container instance they're launched on must allow ingress traffic on the ``hostPort`` of + * the port mapping. + * + * @param containerPort the containerPort value to set. + * @return the LoadBalancer object itself. + */ + public LoadBalancer withContainerPort(Integer containerPort) { + this.containerPort = containerPort; + return this; + } + + /** + * Get the loadBalancerName property: The name of the load balancer to associate with the Amazon ECS service or task + * set. If you are using an Application Load Balancer or a Network Load Balancer the load balancer name parameter + * should be omitted. + * + * @return the loadBalancerName value. + */ + public String loadBalancerName() { + return this.loadBalancerName; + } + + /** + * Set the loadBalancerName property: The name of the load balancer to associate with the Amazon ECS service or task + * set. If you are using an Application Load Balancer or a Network Load Balancer the load balancer name parameter + * should be omitted. + * + * @param loadBalancerName the loadBalancerName value to set. + * @return the LoadBalancer object itself. + */ + public LoadBalancer withLoadBalancerName(String loadBalancerName) { + this.loadBalancerName = loadBalancerName; + return this; + } + + /** + * Get the targetGroupArn property: The full Amazon Resource Name (ARN) of the Elastic Load Balancing target group + * or groups associated with a service or task set. A target group ARN is only specified when using an Application + * Load Balancer or Network Load Balancer. For services using the ``ECS`` deployment controller, you can specify one + * or multiple target groups. For more information, see [Registering multiple target groups with a + * service](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/register-multiple-targetgroups.html) in the + * *Amazon Elastic Container Service Developer Guide*. For services using the ``CODE_DEPLOY`` deployment controller, + * you're required to define two target groups for the load balancer. For more information, see [Blue/green + * deployment with + * CodeDeploy](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/deployment-type-bluegreen.html) in the + * *Amazon Elastic Container Service Developer Guide*. If your service's task definition uses the ``awsvpc`` network + * mode, you must choose ``ip`` as the target type, not ``instance``. Do this when creating your target groups + * because tasks that use the ``awsvpc`` network mode are associated with an elastic network interface, not an + * Amazon EC2 instance. This network mode is required for the Fargate launch type. + * + * @return the targetGroupArn value. + */ + public String targetGroupArn() { + return this.targetGroupArn; + } + + /** + * Set the targetGroupArn property: The full Amazon Resource Name (ARN) of the Elastic Load Balancing target group + * or groups associated with a service or task set. A target group ARN is only specified when using an Application + * Load Balancer or Network Load Balancer. For services using the ``ECS`` deployment controller, you can specify one + * or multiple target groups. For more information, see [Registering multiple target groups with a + * service](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/register-multiple-targetgroups.html) in the + * *Amazon Elastic Container Service Developer Guide*. For services using the ``CODE_DEPLOY`` deployment controller, + * you're required to define two target groups for the load balancer. For more information, see [Blue/green + * deployment with + * CodeDeploy](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/deployment-type-bluegreen.html) in the + * *Amazon Elastic Container Service Developer Guide*. If your service's task definition uses the ``awsvpc`` network + * mode, you must choose ``ip`` as the target type, not ``instance``. Do this when creating your target groups + * because tasks that use the ``awsvpc`` network mode are associated with an elastic network interface, not an + * Amazon EC2 instance. This network mode is required for the Fargate launch type. + * + * @param targetGroupArn the targetGroupArn value to set. + * @return the LoadBalancer object itself. + */ + public LoadBalancer withTargetGroupArn(String targetGroupArn) { + this.targetGroupArn = targetGroupArn; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("containerName", this.containerName); + jsonWriter.writeNumberField("containerPort", this.containerPort); + jsonWriter.writeStringField("loadBalancerName", this.loadBalancerName); + jsonWriter.writeStringField("targetGroupArn", this.targetGroupArn); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of LoadBalancer from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of LoadBalancer if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the LoadBalancer. + */ + public static LoadBalancer fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + LoadBalancer deserializedLoadBalancer = new LoadBalancer(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("containerName".equals(fieldName)) { + deserializedLoadBalancer.containerName = reader.getString(); + } else if ("containerPort".equals(fieldName)) { + deserializedLoadBalancer.containerPort = reader.getNullable(JsonReader::getInt); + } else if ("loadBalancerName".equals(fieldName)) { + deserializedLoadBalancer.loadBalancerName = reader.getString(); + } else if ("targetGroupArn".equals(fieldName)) { + deserializedLoadBalancer.targetGroupArn = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedLoadBalancer; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/LoadBalancerAttribute.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/LoadBalancerAttribute.java new file mode 100644 index 000000000000..27b3a78a1ca5 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/LoadBalancerAttribute.java @@ -0,0 +1,277 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of LoadBalancerAttribute. + */ +@Fluent +public final class LoadBalancerAttribute implements JsonSerializable { + /* + * The name of the attribute. The following attributes are supported by all load balancers: + + * ``deletion_protection.enabled`` - Indicates whether deletion protection is enabled. The value is ``true`` or + * ``false``. The default is ``false``. + ``load_balancing.cross_zone.enabled`` - Indicates whether cross-zone load + * balancing is enabled. The possible values are ``true`` and ``false``. The default for Network Load Balancers and + * Gateway Load Balancers is ``false``. The default for Application Load Balancers is ``true``, and cannot be + * changed. The following attributes are supported by both Application Load Balancers and Network Load Balancers: + + * ``access_logs.s3.enabled`` - Indicates whether access logs are enabled. The value is ``true`` or ``false``. The + * default is ``false``. + ``access_logs.s3.bucket`` - The name of the S3 bucket for the access logs. This attribute + * is required if access logs are enabled. The bucket must exist in the same region as the load balancer and have a + * bucket policy that grants Elastic Load Balancing permissions to write to the bucket. + ``access_logs.s3.prefix`` + * - The prefix for the location in the S3 bucket for the access logs. + ``ipv6.deny_all_igw_traffic`` - Blocks + * internet gateway (IGW) access to the load balancer. It is set to ``false`` for internet-facing load balancers and + * ``true`` for internal load balancers, preventing unintended access to your internal load balancer through an + * internet gateway. The following attributes are supported by only Application Load Balancers: + + * ``idle_timeout.timeout_seconds`` - The idle timeout value, in seconds. The valid range is 1-4000 seconds. The + * default is 60 seconds. + ``client_keep_alive.seconds`` - The client keep alive value, in seconds. The valid range + * is 60-604800 seconds. The default is 3600 seconds. + ``connection_logs.s3.enabled`` - Indicates whether + * connection logs are enabled. The value is ``true`` or ``false``. The default is ``false``. + + * ``connection_logs.s3.bucket`` - The name of the S3 bucket for the connection logs. This attribute is required if + * connection logs are enabled. The bucket must exist in the same region as the load balancer and have a bucket + * policy that grants Elastic Load Balancing permissions to write to the bucket. + ``connection_logs.s3.prefix`` - + * The prefix for the location in the S3 bucket for the connection logs. + ``routing.http.desync_mitigation_mode`` - + * Determines how the load balancer handles requests that might pose a security risk to your application. The + * possible values are ``monitor``, ``defensive``, and ``strictest``. The default is ``defensive``. + + * ``routing.http.drop_invalid_header_fields.enabled`` - Indicates whether HTTP headers with invalid header fields + * are removed by the load balancer (``true``) or routed to targets (``false``). The default is ``false``. + + * ``routing.http.preserve_host_header.enabled`` - Indicates whether the Application Load Balancer should preserve + * the ``Host`` header in the HTTP request and send it to the target without any change. The possible values are + * ``true`` and ``false``. The default is ``false``. + ``routing.http.x_amzn_tls_version_and_cipher_suite.enabled`` + * - Indicates whether the two headers (``x-amzn-tls-version`` and ``x-amzn-tls-cipher-suite``), which contain + * information about the negotiated TLS version and cipher suite, are added to the client request before sending it + * to the target. The ``x-amzn-tls-version`` header has information about the TLS protocol version negotiated with + * the client, and the ``x-amzn-tls-cipher-suite`` header has information about the cipher suite negotiated with the + * client. Both headers are in OpenSSL format. The possible values for the attribute are ``true`` and ``false``. The + * default is ``false``. + ``routing.http.xff_client_port.enabled`` - Indicates whether the ``X-Forwarded-For`` + * header should preserve the source port that the client used to connect to the load balancer. The possible values + * are ``true`` and ``false``. The default is ``false``. + ``routing.http.xff_header_processing.mode`` - Enables you + * to modify, preserve, or remove the ``X-Forwarded-For`` header in the HTTP request before the Application Load + * Balancer sends the request to the target. The possible values are ``append``, ``preserve``, and ``remove``. The + * default is ``append``. + If the value is ``append``, the Application Load Balancer adds the client IP address (of + * the last hop) to the ``X-Forwarded-For`` header in the HTTP request before it sends it to targets. + If the value + * is ``preserve`` the Application Load Balancer preserves the ``X-Forwarded-For`` header in the HTTP request, and + * sends it to targets without any change. + If the value is ``remove``, the Application Load Balancer removes the + * ``X-Forwarded-For`` header in the HTTP request before it sends it to targets. + ``routing.http2.enabled`` - + * Indicates whether HTTP/2 is enabled. The possible values are ``true`` and ``false``. The default is ``true``. + * Elastic Load Balancing requires that message header names contain only alphanumeric characters and hyphens. + + * ``waf.fail_open.enabled`` - Indicates whether to allow a WAF-enabled load balancer to route requests to targets + * if it is unable to forward the request to AWS WAF. The possible values are ``true`` and ``false``. The default is + * ``false``. The following attributes are supported by only Network Load Balancers: + + * ``dns_record.client_routing_policy`` - Indicates how traffic is distributed among the load balancer Availability + * Zones. The possible values are ``availability_zone_affinity`` with 100 percent zonal affinity, + * ``partial_availability_zone_affinity`` with 85 percent zonal affinity, and ``any_availability_zone`` with 0 + * percent zonal affinity. + */ + private String key; + + /* + * The value of the attribute. + */ + private String value; + + /** + * Creates an instance of LoadBalancerAttribute class. + */ + public LoadBalancerAttribute() { + } + + /** + * Get the key property: The name of the attribute. The following attributes are supported by all load balancers: + + * ``deletion_protection.enabled`` - Indicates whether deletion protection is enabled. The value is ``true`` or + * ``false``. The default is ``false``. + ``load_balancing.cross_zone.enabled`` - Indicates whether cross-zone load + * balancing is enabled. The possible values are ``true`` and ``false``. The default for Network Load Balancers and + * Gateway Load Balancers is ``false``. The default for Application Load Balancers is ``true``, and cannot be + * changed. The following attributes are supported by both Application Load Balancers and Network Load Balancers: + + * ``access_logs.s3.enabled`` - Indicates whether access logs are enabled. The value is ``true`` or ``false``. The + * default is ``false``. + ``access_logs.s3.bucket`` - The name of the S3 bucket for the access logs. This attribute + * is required if access logs are enabled. The bucket must exist in the same region as the load balancer and have a + * bucket policy that grants Elastic Load Balancing permissions to write to the bucket. + ``access_logs.s3.prefix`` + * - The prefix for the location in the S3 bucket for the access logs. + ``ipv6.deny_all_igw_traffic`` - Blocks + * internet gateway (IGW) access to the load balancer. It is set to ``false`` for internet-facing load balancers and + * ``true`` for internal load balancers, preventing unintended access to your internal load balancer through an + * internet gateway. The following attributes are supported by only Application Load Balancers: + + * ``idle_timeout.timeout_seconds`` - The idle timeout value, in seconds. The valid range is 1-4000 seconds. The + * default is 60 seconds. + ``client_keep_alive.seconds`` - The client keep alive value, in seconds. The valid range + * is 60-604800 seconds. The default is 3600 seconds. + ``connection_logs.s3.enabled`` - Indicates whether + * connection logs are enabled. The value is ``true`` or ``false``. The default is ``false``. + + * ``connection_logs.s3.bucket`` - The name of the S3 bucket for the connection logs. This attribute is required if + * connection logs are enabled. The bucket must exist in the same region as the load balancer and have a bucket + * policy that grants Elastic Load Balancing permissions to write to the bucket. + ``connection_logs.s3.prefix`` - + * The prefix for the location in the S3 bucket for the connection logs. + ``routing.http.desync_mitigation_mode`` - + * Determines how the load balancer handles requests that might pose a security risk to your application. The + * possible values are ``monitor``, ``defensive``, and ``strictest``. The default is ``defensive``. + + * ``routing.http.drop_invalid_header_fields.enabled`` - Indicates whether HTTP headers with invalid header fields + * are removed by the load balancer (``true``) or routed to targets (``false``). The default is ``false``. + + * ``routing.http.preserve_host_header.enabled`` - Indicates whether the Application Load Balancer should preserve + * the ``Host`` header in the HTTP request and send it to the target without any change. The possible values are + * ``true`` and ``false``. The default is ``false``. + ``routing.http.x_amzn_tls_version_and_cipher_suite.enabled`` + * - Indicates whether the two headers (``x-amzn-tls-version`` and ``x-amzn-tls-cipher-suite``), which contain + * information about the negotiated TLS version and cipher suite, are added to the client request before sending it + * to the target. The ``x-amzn-tls-version`` header has information about the TLS protocol version negotiated with + * the client, and the ``x-amzn-tls-cipher-suite`` header has information about the cipher suite negotiated with the + * client. Both headers are in OpenSSL format. The possible values for the attribute are ``true`` and ``false``. The + * default is ``false``. + ``routing.http.xff_client_port.enabled`` - Indicates whether the ``X-Forwarded-For`` + * header should preserve the source port that the client used to connect to the load balancer. The possible values + * are ``true`` and ``false``. The default is ``false``. + ``routing.http.xff_header_processing.mode`` - Enables you + * to modify, preserve, or remove the ``X-Forwarded-For`` header in the HTTP request before the Application Load + * Balancer sends the request to the target. The possible values are ``append``, ``preserve``, and ``remove``. The + * default is ``append``. + If the value is ``append``, the Application Load Balancer adds the client IP address (of + * the last hop) to the ``X-Forwarded-For`` header in the HTTP request before it sends it to targets. + If the value + * is ``preserve`` the Application Load Balancer preserves the ``X-Forwarded-For`` header in the HTTP request, and + * sends it to targets without any change. + If the value is ``remove``, the Application Load Balancer removes the + * ``X-Forwarded-For`` header in the HTTP request before it sends it to targets. + ``routing.http2.enabled`` - + * Indicates whether HTTP/2 is enabled. The possible values are ``true`` and ``false``. The default is ``true``. + * Elastic Load Balancing requires that message header names contain only alphanumeric characters and hyphens. + + * ``waf.fail_open.enabled`` - Indicates whether to allow a WAF-enabled load balancer to route requests to targets + * if it is unable to forward the request to AWS WAF. The possible values are ``true`` and ``false``. The default is + * ``false``. The following attributes are supported by only Network Load Balancers: + + * ``dns_record.client_routing_policy`` - Indicates how traffic is distributed among the load balancer Availability + * Zones. The possible values are ``availability_zone_affinity`` with 100 percent zonal affinity, + * ``partial_availability_zone_affinity`` with 85 percent zonal affinity, and ``any_availability_zone`` with 0 + * percent zonal affinity. + * + * @return the key value. + */ + public String key() { + return this.key; + } + + /** + * Set the key property: The name of the attribute. The following attributes are supported by all load balancers: + + * ``deletion_protection.enabled`` - Indicates whether deletion protection is enabled. The value is ``true`` or + * ``false``. The default is ``false``. + ``load_balancing.cross_zone.enabled`` - Indicates whether cross-zone load + * balancing is enabled. The possible values are ``true`` and ``false``. The default for Network Load Balancers and + * Gateway Load Balancers is ``false``. The default for Application Load Balancers is ``true``, and cannot be + * changed. The following attributes are supported by both Application Load Balancers and Network Load Balancers: + + * ``access_logs.s3.enabled`` - Indicates whether access logs are enabled. The value is ``true`` or ``false``. The + * default is ``false``. + ``access_logs.s3.bucket`` - The name of the S3 bucket for the access logs. This attribute + * is required if access logs are enabled. The bucket must exist in the same region as the load balancer and have a + * bucket policy that grants Elastic Load Balancing permissions to write to the bucket. + ``access_logs.s3.prefix`` + * - The prefix for the location in the S3 bucket for the access logs. + ``ipv6.deny_all_igw_traffic`` - Blocks + * internet gateway (IGW) access to the load balancer. It is set to ``false`` for internet-facing load balancers and + * ``true`` for internal load balancers, preventing unintended access to your internal load balancer through an + * internet gateway. The following attributes are supported by only Application Load Balancers: + + * ``idle_timeout.timeout_seconds`` - The idle timeout value, in seconds. The valid range is 1-4000 seconds. The + * default is 60 seconds. + ``client_keep_alive.seconds`` - The client keep alive value, in seconds. The valid range + * is 60-604800 seconds. The default is 3600 seconds. + ``connection_logs.s3.enabled`` - Indicates whether + * connection logs are enabled. The value is ``true`` or ``false``. The default is ``false``. + + * ``connection_logs.s3.bucket`` - The name of the S3 bucket for the connection logs. This attribute is required if + * connection logs are enabled. The bucket must exist in the same region as the load balancer and have a bucket + * policy that grants Elastic Load Balancing permissions to write to the bucket. + ``connection_logs.s3.prefix`` - + * The prefix for the location in the S3 bucket for the connection logs. + ``routing.http.desync_mitigation_mode`` - + * Determines how the load balancer handles requests that might pose a security risk to your application. The + * possible values are ``monitor``, ``defensive``, and ``strictest``. The default is ``defensive``. + + * ``routing.http.drop_invalid_header_fields.enabled`` - Indicates whether HTTP headers with invalid header fields + * are removed by the load balancer (``true``) or routed to targets (``false``). The default is ``false``. + + * ``routing.http.preserve_host_header.enabled`` - Indicates whether the Application Load Balancer should preserve + * the ``Host`` header in the HTTP request and send it to the target without any change. The possible values are + * ``true`` and ``false``. The default is ``false``. + ``routing.http.x_amzn_tls_version_and_cipher_suite.enabled`` + * - Indicates whether the two headers (``x-amzn-tls-version`` and ``x-amzn-tls-cipher-suite``), which contain + * information about the negotiated TLS version and cipher suite, are added to the client request before sending it + * to the target. The ``x-amzn-tls-version`` header has information about the TLS protocol version negotiated with + * the client, and the ``x-amzn-tls-cipher-suite`` header has information about the cipher suite negotiated with the + * client. Both headers are in OpenSSL format. The possible values for the attribute are ``true`` and ``false``. The + * default is ``false``. + ``routing.http.xff_client_port.enabled`` - Indicates whether the ``X-Forwarded-For`` + * header should preserve the source port that the client used to connect to the load balancer. The possible values + * are ``true`` and ``false``. The default is ``false``. + ``routing.http.xff_header_processing.mode`` - Enables you + * to modify, preserve, or remove the ``X-Forwarded-For`` header in the HTTP request before the Application Load + * Balancer sends the request to the target. The possible values are ``append``, ``preserve``, and ``remove``. The + * default is ``append``. + If the value is ``append``, the Application Load Balancer adds the client IP address (of + * the last hop) to the ``X-Forwarded-For`` header in the HTTP request before it sends it to targets. + If the value + * is ``preserve`` the Application Load Balancer preserves the ``X-Forwarded-For`` header in the HTTP request, and + * sends it to targets without any change. + If the value is ``remove``, the Application Load Balancer removes the + * ``X-Forwarded-For`` header in the HTTP request before it sends it to targets. + ``routing.http2.enabled`` - + * Indicates whether HTTP/2 is enabled. The possible values are ``true`` and ``false``. The default is ``true``. + * Elastic Load Balancing requires that message header names contain only alphanumeric characters and hyphens. + + * ``waf.fail_open.enabled`` - Indicates whether to allow a WAF-enabled load balancer to route requests to targets + * if it is unable to forward the request to AWS WAF. The possible values are ``true`` and ``false``. The default is + * ``false``. The following attributes are supported by only Network Load Balancers: + + * ``dns_record.client_routing_policy`` - Indicates how traffic is distributed among the load balancer Availability + * Zones. The possible values are ``availability_zone_affinity`` with 100 percent zonal affinity, + * ``partial_availability_zone_affinity`` with 85 percent zonal affinity, and ``any_availability_zone`` with 0 + * percent zonal affinity. + * + * @param key the key value to set. + * @return the LoadBalancerAttribute object itself. + */ + public LoadBalancerAttribute withKey(String key) { + this.key = key; + return this; + } + + /** + * Get the value property: The value of the attribute. + * + * @return the value value. + */ + public String value() { + return this.value; + } + + /** + * Set the value property: The value of the attribute. + * + * @param value the value value to set. + * @return the LoadBalancerAttribute object itself. + */ + public LoadBalancerAttribute withValue(String value) { + this.value = value; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("key", this.key); + jsonWriter.writeStringField("value", this.value); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of LoadBalancerAttribute from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of LoadBalancerAttribute if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the LoadBalancerAttribute. + */ + public static LoadBalancerAttribute fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + LoadBalancerAttribute deserializedLoadBalancerAttribute = new LoadBalancerAttribute(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("key".equals(fieldName)) { + deserializedLoadBalancerAttribute.key = reader.getString(); + } else if ("value".equals(fieldName)) { + deserializedLoadBalancerAttribute.value = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedLoadBalancerAttribute; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/LocalSecondaryIndex.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/LocalSecondaryIndex.java new file mode 100644 index 000000000000..22aa6882db7c --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/LocalSecondaryIndex.java @@ -0,0 +1,185 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Definition of LocalSecondaryIndex. + */ +@Fluent +public final class LocalSecondaryIndex implements JsonSerializable { + /* + * The name of the local secondary index. The name must be unique among all other indexes on this table. + */ + private String indexName; + + /* + * The complete key schema for the local secondary index, consisting of one or more pairs of attribute names and key + * types: + ``HASH`` - partition key + ``RANGE`` - sort key The partition key of an item is also known as its *hash + * attribute*. The term 'hash attribute' derives from DynamoDB's usage of an internal hash function to evenly + * distribute data items across partitions, based on their partition key values. The sort key of an item is also + * known as its *range attribute*. The term 'range attribute' derives from the way DynamoDB stores items with the + * same partition key physically close together, in sorted order by the sort key value. + */ + private List keySchema; + + /* + * Represents attributes that are copied (projected) from the table into the local secondary index. These are in + * addition to the primary key attributes and index key attributes, which are automatically projected. Represents + * attributes that are copied (projected) from the table into an index. These are in addition to the primary key + * attributes and index key attributes, which are automatically projected. + */ + private Projection projection; + + /** + * Creates an instance of LocalSecondaryIndex class. + */ + public LocalSecondaryIndex() { + } + + /** + * Get the indexName property: The name of the local secondary index. The name must be unique among all other + * indexes on this table. + * + * @return the indexName value. + */ + public String indexName() { + return this.indexName; + } + + /** + * Set the indexName property: The name of the local secondary index. The name must be unique among all other + * indexes on this table. + * + * @param indexName the indexName value to set. + * @return the LocalSecondaryIndex object itself. + */ + public LocalSecondaryIndex withIndexName(String indexName) { + this.indexName = indexName; + return this; + } + + /** + * Get the keySchema property: The complete key schema for the local secondary index, consisting of one or more + * pairs of attribute names and key types: + ``HASH`` - partition key + ``RANGE`` - sort key The partition key of an + * item is also known as its *hash attribute*. The term 'hash attribute' derives from DynamoDB's usage of an + * internal hash function to evenly distribute data items across partitions, based on their partition key values. + * The sort key of an item is also known as its *range attribute*. The term 'range attribute' derives from the way + * DynamoDB stores items with the same partition key physically close together, in sorted order by the sort key + * value. + * + * @return the keySchema value. + */ + public List keySchema() { + return this.keySchema; + } + + /** + * Set the keySchema property: The complete key schema for the local secondary index, consisting of one or more + * pairs of attribute names and key types: + ``HASH`` - partition key + ``RANGE`` - sort key The partition key of an + * item is also known as its *hash attribute*. The term 'hash attribute' derives from DynamoDB's usage of an + * internal hash function to evenly distribute data items across partitions, based on their partition key values. + * The sort key of an item is also known as its *range attribute*. The term 'range attribute' derives from the way + * DynamoDB stores items with the same partition key physically close together, in sorted order by the sort key + * value. + * + * @param keySchema the keySchema value to set. + * @return the LocalSecondaryIndex object itself. + */ + public LocalSecondaryIndex withKeySchema(List keySchema) { + this.keySchema = keySchema; + return this; + } + + /** + * Get the projection property: Represents attributes that are copied (projected) from the table into the local + * secondary index. These are in addition to the primary key attributes and index key attributes, which are + * automatically projected. Represents attributes that are copied (projected) from the table into an index. These + * are in addition to the primary key attributes and index key attributes, which are automatically projected. + * + * @return the projection value. + */ + public Projection projection() { + return this.projection; + } + + /** + * Set the projection property: Represents attributes that are copied (projected) from the table into the local + * secondary index. These are in addition to the primary key attributes and index key attributes, which are + * automatically projected. Represents attributes that are copied (projected) from the table into an index. These + * are in addition to the primary key attributes and index key attributes, which are automatically projected. + * + * @param projection the projection value to set. + * @return the LocalSecondaryIndex object itself. + */ + public LocalSecondaryIndex withProjection(Projection projection) { + this.projection = projection; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (keySchema() != null) { + keySchema().forEach(e -> e.validate()); + } + if (projection() != null) { + projection().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("indexName", this.indexName); + jsonWriter.writeArrayField("keySchema", this.keySchema, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeJsonField("projection", this.projection); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of LocalSecondaryIndex from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of LocalSecondaryIndex if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the LocalSecondaryIndex. + */ + public static LocalSecondaryIndex fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + LocalSecondaryIndex deserializedLocalSecondaryIndex = new LocalSecondaryIndex(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("indexName".equals(fieldName)) { + deserializedLocalSecondaryIndex.indexName = reader.getString(); + } else if ("keySchema".equals(fieldName)) { + List keySchema = reader.readArray(reader1 -> KeySchema.fromJson(reader1)); + deserializedLocalSecondaryIndex.keySchema = keySchema; + } else if ("projection".equals(fieldName)) { + deserializedLocalSecondaryIndex.projection = Projection.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedLocalSecondaryIndex; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/Location.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/Location.java new file mode 100644 index 000000000000..78ff8dbe337c --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/Location.java @@ -0,0 +1,124 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of Location. + */ +@Fluent +public final class Location implements JsonSerializable { + /* + * The Availability Zone in which to create your instance. Use the following format: us-east-2a (case sensitive). Be + * sure to add the include Availability Zones parameter to your request. + */ + private String availabilityZone; + + /* + * The Region Name in which to create your instance. + */ + private String regionName; + + /** + * Creates an instance of Location class. + */ + public Location() { + } + + /** + * Get the availabilityZone property: The Availability Zone in which to create your instance. Use the following + * format: us-east-2a (case sensitive). Be sure to add the include Availability Zones parameter to your request. + * + * @return the availabilityZone value. + */ + public String availabilityZone() { + return this.availabilityZone; + } + + /** + * Set the availabilityZone property: The Availability Zone in which to create your instance. Use the following + * format: us-east-2a (case sensitive). Be sure to add the include Availability Zones parameter to your request. + * + * @param availabilityZone the availabilityZone value to set. + * @return the Location object itself. + */ + public Location withAvailabilityZone(String availabilityZone) { + this.availabilityZone = availabilityZone; + return this; + } + + /** + * Get the regionName property: The Region Name in which to create your instance. + * + * @return the regionName value. + */ + public String regionName() { + return this.regionName; + } + + /** + * Set the regionName property: The Region Name in which to create your instance. + * + * @param regionName the regionName value to set. + * @return the Location object itself. + */ + public Location withRegionName(String regionName) { + this.regionName = regionName; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("availabilityZone", this.availabilityZone); + jsonWriter.writeStringField("regionName", this.regionName); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of Location from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of Location if the JsonReader was pointing to an instance of it, or null if it was pointing + * to JSON null. + * @throws IOException If an error occurs while reading the Location. + */ + public static Location fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + Location deserializedLocation = new Location(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("availabilityZone".equals(fieldName)) { + deserializedLocation.availabilityZone = reader.getString(); + } else if ("regionName".equals(fieldName)) { + deserializedLocation.regionName = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedLocation; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/LogConfig.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/LogConfig.java new file mode 100644 index 000000000000..4b1407e380a3 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/LogConfig.java @@ -0,0 +1,181 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of LogConfig. + */ +@Fluent +public final class LogConfig implements JsonSerializable { + /* + *

The service role that AppSync assumes to publish to CloudWatch logs in your account.

+ */ + private String cloudWatchLogsRoleArn; + + /* + *

Set to TRUE to exclude sections that contain information such as headers, context, and evaluated mapping + * templates, regardless of logging level.

+ */ + private Boolean excludeVerboseContent; + + /* + *

The field logging level. Values can be NONE, ERROR, or ALL.

  • NONE: No field-level logs + * are captured.

  • ERROR: Logs the following information only for the fields that are in + * error:

    • The error section in the server response.

    • Field-level errors.

    • + *
    • The generated request/response functions that got resolved for error fields.

  • + *

    ALL: The following information is logged for all fields in the query:

    • Field-level + * tracing information.

    • The generated request/response functions that got resolved for each + * field.

+ */ + private FieldLogLevelEnumValue fieldLogLevel; + + /** + * Creates an instance of LogConfig class. + */ + public LogConfig() { + } + + /** + * Get the cloudWatchLogsRoleArn property: <p>The service role that AppSync assumes to publish to CloudWatch + * logs in your account.</p>. + * + * @return the cloudWatchLogsRoleArn value. + */ + public String cloudWatchLogsRoleArn() { + return this.cloudWatchLogsRoleArn; + } + + /** + * Set the cloudWatchLogsRoleArn property: <p>The service role that AppSync assumes to publish to CloudWatch + * logs in your account.</p>. + * + * @param cloudWatchLogsRoleArn the cloudWatchLogsRoleArn value to set. + * @return the LogConfig object itself. + */ + public LogConfig withCloudWatchLogsRoleArn(String cloudWatchLogsRoleArn) { + this.cloudWatchLogsRoleArn = cloudWatchLogsRoleArn; + return this; + } + + /** + * Get the excludeVerboseContent property: <p>Set to TRUE to exclude sections that contain information such as + * headers, context, and evaluated mapping templates, regardless of logging level.</p>. + * + * @return the excludeVerboseContent value. + */ + public Boolean excludeVerboseContent() { + return this.excludeVerboseContent; + } + + /** + * Set the excludeVerboseContent property: <p>Set to TRUE to exclude sections that contain information such as + * headers, context, and evaluated mapping templates, regardless of logging level.</p>. + * + * @param excludeVerboseContent the excludeVerboseContent value to set. + * @return the LogConfig object itself. + */ + public LogConfig withExcludeVerboseContent(Boolean excludeVerboseContent) { + this.excludeVerboseContent = excludeVerboseContent; + return this; + } + + /** + * Get the fieldLogLevel property: <p>The field logging level. Values can be NONE, ERROR, or ALL.</p> + * <ul> <li> <p> <b>NONE</b>: No field-level logs are captured.</p> </li> + * <li> <p> <b>ERROR</b>: Logs the following information only for the fields that are in + * error:</p> <ul> <li> <p>The error section in the server response.</p> </li> + * <li> <p>Field-level errors.</p> </li> <li> <p>The generated request/response + * functions that got resolved for error fields.</p> </li> </ul> </li> <li> <p> + * <b>ALL</b>: The following information is logged for all fields in the query:</p> <ul> + * <li> <p>Field-level tracing information.</p> </li> <li> <p>The generated + * request/response functions that got resolved for each field.</p> </li> </ul> </li> + * </ul>. + * + * @return the fieldLogLevel value. + */ + public FieldLogLevelEnumValue fieldLogLevel() { + return this.fieldLogLevel; + } + + /** + * Set the fieldLogLevel property: <p>The field logging level. Values can be NONE, ERROR, or ALL.</p> + * <ul> <li> <p> <b>NONE</b>: No field-level logs are captured.</p> </li> + * <li> <p> <b>ERROR</b>: Logs the following information only for the fields that are in + * error:</p> <ul> <li> <p>The error section in the server response.</p> </li> + * <li> <p>Field-level errors.</p> </li> <li> <p>The generated request/response + * functions that got resolved for error fields.</p> </li> </ul> </li> <li> <p> + * <b>ALL</b>: The following information is logged for all fields in the query:</p> <ul> + * <li> <p>Field-level tracing information.</p> </li> <li> <p>The generated + * request/response functions that got resolved for each field.</p> </li> </ul> </li> + * </ul>. + * + * @param fieldLogLevel the fieldLogLevel value to set. + * @return the LogConfig object itself. + */ + public LogConfig withFieldLogLevel(FieldLogLevelEnumValue fieldLogLevel) { + this.fieldLogLevel = fieldLogLevel; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (fieldLogLevel() != null) { + fieldLogLevel().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("cloudWatchLogsRoleArn", this.cloudWatchLogsRoleArn); + jsonWriter.writeBooleanField("excludeVerboseContent", this.excludeVerboseContent); + jsonWriter.writeJsonField("fieldLogLevel", this.fieldLogLevel); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of LogConfig from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of LogConfig if the JsonReader was pointing to an instance of it, or null if it was pointing + * to JSON null. + * @throws IOException If an error occurs while reading the LogConfig. + */ + public static LogConfig fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + LogConfig deserializedLogConfig = new LogConfig(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("cloudWatchLogsRoleArn".equals(fieldName)) { + deserializedLogConfig.cloudWatchLogsRoleArn = reader.getString(); + } else if ("excludeVerboseContent".equals(fieldName)) { + deserializedLogConfig.excludeVerboseContent = reader.getNullable(JsonReader::getBoolean); + } else if ("fieldLogLevel".equals(fieldName)) { + deserializedLogConfig.fieldLogLevel = FieldLogLevelEnumValue.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedLogConfig; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/LogConfiguration.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/LogConfiguration.java new file mode 100644 index 000000000000..ee2f19d33588 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/LogConfiguration.java @@ -0,0 +1,204 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Definition of LogConfiguration. + */ +@Fluent +public final class LogConfiguration implements JsonSerializable { + /* + * The log driver to use for the container. For tasks on FARGATElong, the supported log drivers are ``awslogs``, + * ``splunk``, and ``awsfirelens``. For tasks hosted on Amazon EC2 instances, the supported log drivers are + * ``awslogs``, ``fluentd``, ``gelf``, ``json-file``, ``journald``, ``logentries``,``syslog``, ``splunk``, and + * ``awsfirelens``. For more information about using the ``awslogs`` log driver, see [Using the awslogs log + * driver](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/using_awslogs.html) in the *Amazon Elastic + * Container Service Developer Guide*. For more information about using the ``awsfirelens`` log driver, see [Custom + * log routing](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/using_firelens.html) in the *Amazon + * Elastic Container Service Developer Guide*. If you have a custom driver that isn't listed, you can fork the + * Amazon ECS container agent project that's [available on + * GitHub](https://docs.aws.amazon.com/https://github.com/aws/amazon-ecs-agent) and customize it to work with that + * driver. We encourage you to submit pull requests for changes that you would like to have included. However, we + * don't currently provide support for running modified copies of this software. + */ + private String logDriver; + + /* + * The configuration options to send to the log driver. This parameter requires version 1.19 of the Docker Remote + * API or greater on your container instance. To check the Docker Remote API version on your container instance, log + * in to your container instance and run the following command: ``sudo docker version --format + * '{{.Server.APIVersion}}'`` + */ + private Object options; + + /* + * The secrets to pass to the log configuration. For more information, see [Specifying sensitive + * data](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/specifying-sensitive-data.html) in the *Amazon + * Elastic Container Service Developer Guide*. + */ + private List secretOptions; + + /** + * Creates an instance of LogConfiguration class. + */ + public LogConfiguration() { + } + + /** + * Get the logDriver property: The log driver to use for the container. For tasks on FARGATElong, the supported log + * drivers are ``awslogs``, ``splunk``, and ``awsfirelens``. For tasks hosted on Amazon EC2 instances, the supported + * log drivers are ``awslogs``, ``fluentd``, ``gelf``, ``json-file``, ``journald``, ``logentries``,``syslog``, + * ``splunk``, and ``awsfirelens``. For more information about using the ``awslogs`` log driver, see [Using the + * awslogs log driver](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/using_awslogs.html) in the + * *Amazon Elastic Container Service Developer Guide*. For more information about using the ``awsfirelens`` log + * driver, see [Custom log routing](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/using_firelens.html) + * in the *Amazon Elastic Container Service Developer Guide*. If you have a custom driver that isn't listed, you can + * fork the Amazon ECS container agent project that's [available on + * GitHub](https://docs.aws.amazon.com/https://github.com/aws/amazon-ecs-agent) and customize it to work with that + * driver. We encourage you to submit pull requests for changes that you would like to have included. However, we + * don't currently provide support for running modified copies of this software. + * + * @return the logDriver value. + */ + public String logDriver() { + return this.logDriver; + } + + /** + * Set the logDriver property: The log driver to use for the container. For tasks on FARGATElong, the supported log + * drivers are ``awslogs``, ``splunk``, and ``awsfirelens``. For tasks hosted on Amazon EC2 instances, the supported + * log drivers are ``awslogs``, ``fluentd``, ``gelf``, ``json-file``, ``journald``, ``logentries``,``syslog``, + * ``splunk``, and ``awsfirelens``. For more information about using the ``awslogs`` log driver, see [Using the + * awslogs log driver](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/using_awslogs.html) in the + * *Amazon Elastic Container Service Developer Guide*. For more information about using the ``awsfirelens`` log + * driver, see [Custom log routing](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/using_firelens.html) + * in the *Amazon Elastic Container Service Developer Guide*. If you have a custom driver that isn't listed, you can + * fork the Amazon ECS container agent project that's [available on + * GitHub](https://docs.aws.amazon.com/https://github.com/aws/amazon-ecs-agent) and customize it to work with that + * driver. We encourage you to submit pull requests for changes that you would like to have included. However, we + * don't currently provide support for running modified copies of this software. + * + * @param logDriver the logDriver value to set. + * @return the LogConfiguration object itself. + */ + public LogConfiguration withLogDriver(String logDriver) { + this.logDriver = logDriver; + return this; + } + + /** + * Get the options property: The configuration options to send to the log driver. This parameter requires version + * 1.19 of the Docker Remote API or greater on your container instance. To check the Docker Remote API version on + * your container instance, log in to your container instance and run the following command: ``sudo docker version + * --format '{{.Server.APIVersion}}'``. + * + * @return the options value. + */ + public Object options() { + return this.options; + } + + /** + * Set the options property: The configuration options to send to the log driver. This parameter requires version + * 1.19 of the Docker Remote API or greater on your container instance. To check the Docker Remote API version on + * your container instance, log in to your container instance and run the following command: ``sudo docker version + * --format '{{.Server.APIVersion}}'``. + * + * @param options the options value to set. + * @return the LogConfiguration object itself. + */ + public LogConfiguration withOptions(Object options) { + this.options = options; + return this; + } + + /** + * Get the secretOptions property: The secrets to pass to the log configuration. For more information, see + * [Specifying sensitive + * data](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/specifying-sensitive-data.html) in the *Amazon + * Elastic Container Service Developer Guide*. + * + * @return the secretOptions value. + */ + public List secretOptions() { + return this.secretOptions; + } + + /** + * Set the secretOptions property: The secrets to pass to the log configuration. For more information, see + * [Specifying sensitive + * data](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/specifying-sensitive-data.html) in the *Amazon + * Elastic Container Service Developer Guide*. + * + * @param secretOptions the secretOptions value to set. + * @return the LogConfiguration object itself. + */ + public LogConfiguration withSecretOptions(List secretOptions) { + this.secretOptions = secretOptions; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (secretOptions() != null) { + secretOptions().forEach(e -> e.validate()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("logDriver", this.logDriver); + jsonWriter.writeUntypedField("options", this.options); + jsonWriter.writeArrayField("secretOptions", this.secretOptions, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of LogConfiguration from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of LogConfiguration if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the LogConfiguration. + */ + public static LogConfiguration fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + LogConfiguration deserializedLogConfiguration = new LogConfiguration(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("logDriver".equals(fieldName)) { + deserializedLogConfiguration.logDriver = reader.getString(); + } else if ("options".equals(fieldName)) { + deserializedLogConfiguration.options = reader.readUntyped(); + } else if ("secretOptions".equals(fieldName)) { + List secretOptions = reader.readArray(reader1 -> Secret.fromJson(reader1)); + deserializedLogConfiguration.secretOptions = secretOptions; + } else { + reader.skipChildren(); + } + } + + return deserializedLogConfiguration; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/LogDestinationType.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/LogDestinationType.java new file mode 100644 index 000000000000..9bcb5bec0827 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/LogDestinationType.java @@ -0,0 +1,56 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * LogDestinationType enum. + */ +public final class LogDestinationType extends ExpandableStringEnum { + /** + * Static value cloud-watch-logs for LogDestinationType. + */ + public static final LogDestinationType CLOUD_WATCH_LOGS = fromString("cloud-watch-logs"); + + /** + * Static value kinesis-data-firehose for LogDestinationType. + */ + public static final LogDestinationType KINESIS_DATA_FIREHOSE = fromString("kinesis-data-firehose"); + + /** + * Static value s3 for LogDestinationType. + */ + public static final LogDestinationType S3 = fromString("s3"); + + /** + * Creates a new instance of LogDestinationType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public LogDestinationType() { + } + + /** + * Creates or finds a LogDestinationType from its string representation. + * + * @param name a name to look for. + * @return the corresponding LogDestinationType. + */ + public static LogDestinationType fromString(String name) { + return fromString(name, LogDestinationType.class); + } + + /** + * Gets known LogDestinationType values. + * + * @return known LogDestinationType values. + */ + public static Collection values() { + return values(LogDestinationType.class); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/LogGroupClass.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/LogGroupClass.java new file mode 100644 index 000000000000..815fbacc3bf5 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/LogGroupClass.java @@ -0,0 +1,54 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Specifies the log group class for this log group. There are two classes: + The ``Standard`` log class supports all + * CWL features. + The ``Infrequent Access`` log class supports a subset of CWL features and incurs lower costs. For + * details about the features supported by each class, see [Log + * classes](https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/CloudWatch_Logs_Log_Classes.html). + */ +public final class LogGroupClass extends ExpandableStringEnum { + /** + * Static value INFREQUENT_ACCESS for LogGroupClass. + */ + public static final LogGroupClass INFREQUENT_ACCESS = fromString("INFREQUENT_ACCESS"); + + /** + * Static value STANDARD for LogGroupClass. + */ + public static final LogGroupClass STANDARD = fromString("STANDARD"); + + /** + * Creates a new instance of LogGroupClass value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public LogGroupClass() { + } + + /** + * Creates or finds a LogGroupClass from its string representation. + * + * @param name a name to look for. + * @return the corresponding LogGroupClass. + */ + public static LogGroupClass fromString(String name) { + return fromString(name, LogGroupClass.class); + } + + /** + * Gets known LogGroupClass values. + * + * @return known LogGroupClass values. + */ + public static Collection values() { + return values(LogGroupClass.class); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/LogPublishingOption.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/LogPublishingOption.java new file mode 100644 index 000000000000..72f5b83b6280 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/LogPublishingOption.java @@ -0,0 +1,123 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of LogPublishingOption. + */ +@Fluent +public final class LogPublishingOption implements JsonSerializable { + /* + *

The Amazon Resource Name (ARN) of the CloudWatch Logs group to publish logs to.

+ */ + private String cloudWatchLogsLogGroupArn; + + /* + *

Whether the log should be published.

+ */ + private Boolean enabled; + + /** + * Creates an instance of LogPublishingOption class. + */ + public LogPublishingOption() { + } + + /** + * Get the cloudWatchLogsLogGroupArn property: <p>The Amazon Resource Name (ARN) of the CloudWatch Logs group + * to publish logs to.</p>. + * + * @return the cloudWatchLogsLogGroupArn value. + */ + public String cloudWatchLogsLogGroupArn() { + return this.cloudWatchLogsLogGroupArn; + } + + /** + * Set the cloudWatchLogsLogGroupArn property: <p>The Amazon Resource Name (ARN) of the CloudWatch Logs group + * to publish logs to.</p>. + * + * @param cloudWatchLogsLogGroupArn the cloudWatchLogsLogGroupArn value to set. + * @return the LogPublishingOption object itself. + */ + public LogPublishingOption withCloudWatchLogsLogGroupArn(String cloudWatchLogsLogGroupArn) { + this.cloudWatchLogsLogGroupArn = cloudWatchLogsLogGroupArn; + return this; + } + + /** + * Get the enabled property: <p>Whether the log should be published.</p>. + * + * @return the enabled value. + */ + public Boolean enabled() { + return this.enabled; + } + + /** + * Set the enabled property: <p>Whether the log should be published.</p>. + * + * @param enabled the enabled value to set. + * @return the LogPublishingOption object itself. + */ + public LogPublishingOption withEnabled(Boolean enabled) { + this.enabled = enabled; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("cloudWatchLogsLogGroupArn", this.cloudWatchLogsLogGroupArn); + jsonWriter.writeBooleanField("enabled", this.enabled); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of LogPublishingOption from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of LogPublishingOption if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the LogPublishingOption. + */ + public static LogPublishingOption fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + LogPublishingOption deserializedLogPublishingOption = new LogPublishingOption(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("cloudWatchLogsLogGroupArn".equals(fieldName)) { + deserializedLogPublishingOption.cloudWatchLogsLogGroupArn = reader.getString(); + } else if ("enabled".equals(fieldName)) { + deserializedLogPublishingOption.enabled = reader.getNullable(JsonReader::getBoolean); + } else { + reader.skipChildren(); + } + } + + return deserializedLogPublishingOption; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/LogSetup.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/LogSetup.java new file mode 100644 index 000000000000..31b7561031cf --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/LogSetup.java @@ -0,0 +1,130 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Definition of LogSetup. + */ +@Fluent +public final class LogSetup implements JsonSerializable { + /* + *

If a log type is enabled, that log type exports its control plane logs to CloudWatch Logs. If a log type isn't + * enabled, that log type doesn't export its control plane logs. Each individual log type can be enabled or disabled + * independently.

+ */ + private Boolean enabled; + + /* + *

The available cluster control plane log types.

+ */ + private List types; + + /** + * Creates an instance of LogSetup class. + */ + public LogSetup() { + } + + /** + * Get the enabled property: <p>If a log type is enabled, that log type exports its control plane logs to + * CloudWatch Logs. If a log type isn't enabled, that log type doesn't export its control plane logs. Each + * individual log type can be enabled or disabled independently.</p>. + * + * @return the enabled value. + */ + public Boolean enabled() { + return this.enabled; + } + + /** + * Set the enabled property: <p>If a log type is enabled, that log type exports its control plane logs to + * CloudWatch Logs. If a log type isn't enabled, that log type doesn't export its control plane logs. Each + * individual log type can be enabled or disabled independently.</p>. + * + * @param enabled the enabled value to set. + * @return the LogSetup object itself. + */ + public LogSetup withEnabled(Boolean enabled) { + this.enabled = enabled; + return this; + } + + /** + * Get the types property: <p>The available cluster control plane log types.</p>. + * + * @return the types value. + */ + public List types() { + return this.types; + } + + /** + * Set the types property: <p>The available cluster control plane log types.</p>. + * + * @param types the types value to set. + * @return the LogSetup object itself. + */ + public LogSetup withTypes(List types) { + this.types = types; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeBooleanField("enabled", this.enabled); + jsonWriter.writeArrayField("types", this.types, + (writer, element) -> writer.writeString(element == null ? null : element.toString())); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of LogSetup from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of LogSetup if the JsonReader was pointing to an instance of it, or null if it was pointing + * to JSON null. + * @throws IOException If an error occurs while reading the LogSetup. + */ + public static LogSetup fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + LogSetup deserializedLogSetup = new LogSetup(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("enabled".equals(fieldName)) { + deserializedLogSetup.enabled = reader.getNullable(JsonReader::getBoolean); + } else if ("types".equals(fieldName)) { + List types = reader.readArray(reader1 -> LogType.fromString(reader1.getString())); + deserializedLogSetup.types = types; + } else { + reader.skipChildren(); + } + } + + return deserializedLogSetup; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/LogType.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/LogType.java new file mode 100644 index 000000000000..25d153603550 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/LogType.java @@ -0,0 +1,66 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * LogType enum. + */ +public final class LogType extends ExpandableStringEnum { + /** + * Static value api for LogType. + */ + public static final LogType API = fromString("api"); + + /** + * Static value audit for LogType. + */ + public static final LogType AUDIT = fromString("audit"); + + /** + * Static value authenticator for LogType. + */ + public static final LogType AUTHENTICATOR = fromString("authenticator"); + + /** + * Static value controllerManager for LogType. + */ + public static final LogType CONTROLLER_MANAGER = fromString("controllerManager"); + + /** + * Static value scheduler for LogType. + */ + public static final LogType SCHEDULER = fromString("scheduler"); + + /** + * Creates a new instance of LogType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public LogType() { + } + + /** + * Creates or finds a LogType from its string representation. + * + * @param name a name to look for. + * @return the corresponding LogType. + */ + public static LogType fromString(String name) { + return fromString(name, LogType.class); + } + + /** + * Gets known LogType values. + * + * @return known LogType values. + */ + public static Collection values() { + return values(LogType.class); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/Logging.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/Logging.java new file mode 100644 index 000000000000..276db7ec66bb --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/Logging.java @@ -0,0 +1,168 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of Logging. + */ +@Fluent +public final class Logging implements JsonSerializable { + /* + * The Amazon S3 bucket to store the access logs in, for example, ``myawslogbucket.s3.amazonaws.com``. + */ + private String bucket; + + /* + * Specifies whether you want CloudFront to include cookies in access logs, specify ``true`` for ``IncludeCookies``. + * If you choose to include cookies in logs, CloudFront logs all cookies regardless of how you configure the cache + * behaviors for this distribution. If you don't want to include cookies when you create a distribution or if you + * want to disable include cookies for an existing distribution, specify ``false`` for ``IncludeCookies``. + */ + private Boolean includeCookies; + + /* + * An optional string that you want CloudFront to prefix to the access log ``filenames`` for this distribution, for + * example, ``myprefix/``. If you want to enable logging, but you don't want to specify a prefix, you still must + * include an empty ``Prefix`` element in the ``Logging`` element. + */ + private String prefix; + + /** + * Creates an instance of Logging class. + */ + public Logging() { + } + + /** + * Get the bucket property: The Amazon S3 bucket to store the access logs in, for example, + * ``myawslogbucket.s3.amazonaws.com``. + * + * @return the bucket value. + */ + public String bucket() { + return this.bucket; + } + + /** + * Set the bucket property: The Amazon S3 bucket to store the access logs in, for example, + * ``myawslogbucket.s3.amazonaws.com``. + * + * @param bucket the bucket value to set. + * @return the Logging object itself. + */ + public Logging withBucket(String bucket) { + this.bucket = bucket; + return this; + } + + /** + * Get the includeCookies property: Specifies whether you want CloudFront to include cookies in access logs, specify + * ``true`` for ``IncludeCookies``. If you choose to include cookies in logs, CloudFront logs all cookies regardless + * of how you configure the cache behaviors for this distribution. If you don't want to include cookies when you + * create a distribution or if you want to disable include cookies for an existing distribution, specify ``false`` + * for ``IncludeCookies``. + * + * @return the includeCookies value. + */ + public Boolean includeCookies() { + return this.includeCookies; + } + + /** + * Set the includeCookies property: Specifies whether you want CloudFront to include cookies in access logs, specify + * ``true`` for ``IncludeCookies``. If you choose to include cookies in logs, CloudFront logs all cookies regardless + * of how you configure the cache behaviors for this distribution. If you don't want to include cookies when you + * create a distribution or if you want to disable include cookies for an existing distribution, specify ``false`` + * for ``IncludeCookies``. + * + * @param includeCookies the includeCookies value to set. + * @return the Logging object itself. + */ + public Logging withIncludeCookies(Boolean includeCookies) { + this.includeCookies = includeCookies; + return this; + } + + /** + * Get the prefix property: An optional string that you want CloudFront to prefix to the access log ``filenames`` + * for this distribution, for example, ``myprefix/``. If you want to enable logging, but you don't want to specify a + * prefix, you still must include an empty ``Prefix`` element in the ``Logging`` element. + * + * @return the prefix value. + */ + public String prefix() { + return this.prefix; + } + + /** + * Set the prefix property: An optional string that you want CloudFront to prefix to the access log ``filenames`` + * for this distribution, for example, ``myprefix/``. If you want to enable logging, but you don't want to specify a + * prefix, you still must include an empty ``Prefix`` element in the ``Logging`` element. + * + * @param prefix the prefix value to set. + * @return the Logging object itself. + */ + public Logging withPrefix(String prefix) { + this.prefix = prefix; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("bucket", this.bucket); + jsonWriter.writeBooleanField("includeCookies", this.includeCookies); + jsonWriter.writeStringField("prefix", this.prefix); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of Logging from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of Logging if the JsonReader was pointing to an instance of it, or null if it was pointing to + * JSON null. + * @throws IOException If an error occurs while reading the Logging. + */ + public static Logging fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + Logging deserializedLogging = new Logging(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("bucket".equals(fieldName)) { + deserializedLogging.bucket = reader.getString(); + } else if ("includeCookies".equals(fieldName)) { + deserializedLogging.includeCookies = reader.getNullable(JsonReader::getBoolean); + } else if ("prefix".equals(fieldName)) { + deserializedLogging.prefix = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedLogging; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/LoggingAutoGenerated.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/LoggingAutoGenerated.java new file mode 100644 index 000000000000..c2924442e430 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/LoggingAutoGenerated.java @@ -0,0 +1,101 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Definition of Logging. + */ +@Fluent +public final class LoggingAutoGenerated implements JsonSerializable { + /* + *

The cluster control plane logging configuration for your cluster.

+ */ + private List clusterLogging; + + /** + * Creates an instance of LoggingAutoGenerated class. + */ + public LoggingAutoGenerated() { + } + + /** + * Get the clusterLogging property: <p>The cluster control plane logging configuration for your + * cluster.</p>. + * + * @return the clusterLogging value. + */ + public List clusterLogging() { + return this.clusterLogging; + } + + /** + * Set the clusterLogging property: <p>The cluster control plane logging configuration for your + * cluster.</p>. + * + * @param clusterLogging the clusterLogging value to set. + * @return the LoggingAutoGenerated object itself. + */ + public LoggingAutoGenerated withClusterLogging(List clusterLogging) { + this.clusterLogging = clusterLogging; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (clusterLogging() != null) { + clusterLogging().forEach(e -> e.validate()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("clusterLogging", this.clusterLogging, + (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of LoggingAutoGenerated from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of LoggingAutoGenerated if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the LoggingAutoGenerated. + */ + public static LoggingAutoGenerated fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + LoggingAutoGenerated deserializedLoggingAutoGenerated = new LoggingAutoGenerated(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("clusterLogging".equals(fieldName)) { + List clusterLogging = reader.readArray(reader1 -> LogSetup.fromJson(reader1)); + deserializedLoggingAutoGenerated.clusterLogging = clusterLogging; + } else { + reader.skipChildren(); + } + } + + return deserializedLoggingAutoGenerated; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/LoggingConfig.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/LoggingConfig.java new file mode 100644 index 000000000000..2d3760fdead2 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/LoggingConfig.java @@ -0,0 +1,202 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of LoggingConfig. + */ +@Fluent +public final class LoggingConfig implements JsonSerializable { + /* + * Set this property to filter the application logs for your function that Lambda sends to CloudWatch. Lambda only + * sends application logs at the selected level of detail and lower, where ``TRACE`` is the highest level and + * ``FATAL`` is the lowest. + */ + private LoggingConfigApplicationLogLevel applicationLogLevel; + + /* + * The format in which Lambda sends your function's application and system logs to CloudWatch. Select between plain + * text and structured JSON. + */ + private LoggingConfigLogFormat logFormat; + + /* + * The name of the Amazon CloudWatch log group the function sends logs to. By default, Lambda functions send logs to + * a default log group named ``/aws/lambda/``. To use a different log group, enter an existing log + * group or enter a new log group name. + */ + private String logGroup; + + /* + * Set this property to filter the system logs for your function that Lambda sends to CloudWatch. Lambda only sends + * system logs at the selected level of detail and lower, where ``DEBUG`` is the highest level and ``WARN`` is the + * lowest. + */ + private LoggingConfigSystemLogLevel systemLogLevel; + + /** + * Creates an instance of LoggingConfig class. + */ + public LoggingConfig() { + } + + /** + * Get the applicationLogLevel property: Set this property to filter the application logs for your function that + * Lambda sends to CloudWatch. Lambda only sends application logs at the selected level of detail and lower, where + * ``TRACE`` is the highest level and ``FATAL`` is the lowest. + * + * @return the applicationLogLevel value. + */ + public LoggingConfigApplicationLogLevel applicationLogLevel() { + return this.applicationLogLevel; + } + + /** + * Set the applicationLogLevel property: Set this property to filter the application logs for your function that + * Lambda sends to CloudWatch. Lambda only sends application logs at the selected level of detail and lower, where + * ``TRACE`` is the highest level and ``FATAL`` is the lowest. + * + * @param applicationLogLevel the applicationLogLevel value to set. + * @return the LoggingConfig object itself. + */ + public LoggingConfig withApplicationLogLevel(LoggingConfigApplicationLogLevel applicationLogLevel) { + this.applicationLogLevel = applicationLogLevel; + return this; + } + + /** + * Get the logFormat property: The format in which Lambda sends your function's application and system logs to + * CloudWatch. Select between plain text and structured JSON. + * + * @return the logFormat value. + */ + public LoggingConfigLogFormat logFormat() { + return this.logFormat; + } + + /** + * Set the logFormat property: The format in which Lambda sends your function's application and system logs to + * CloudWatch. Select between plain text and structured JSON. + * + * @param logFormat the logFormat value to set. + * @return the LoggingConfig object itself. + */ + public LoggingConfig withLogFormat(LoggingConfigLogFormat logFormat) { + this.logFormat = logFormat; + return this; + } + + /** + * Get the logGroup property: The name of the Amazon CloudWatch log group the function sends logs to. By default, + * Lambda functions send logs to a default log group named ``/aws/lambda/<function name>``. To use a different + * log group, enter an existing log group or enter a new log group name. + * + * @return the logGroup value. + */ + public String logGroup() { + return this.logGroup; + } + + /** + * Set the logGroup property: The name of the Amazon CloudWatch log group the function sends logs to. By default, + * Lambda functions send logs to a default log group named ``/aws/lambda/<function name>``. To use a different + * log group, enter an existing log group or enter a new log group name. + * + * @param logGroup the logGroup value to set. + * @return the LoggingConfig object itself. + */ + public LoggingConfig withLogGroup(String logGroup) { + this.logGroup = logGroup; + return this; + } + + /** + * Get the systemLogLevel property: Set this property to filter the system logs for your function that Lambda sends + * to CloudWatch. Lambda only sends system logs at the selected level of detail and lower, where ``DEBUG`` is the + * highest level and ``WARN`` is the lowest. + * + * @return the systemLogLevel value. + */ + public LoggingConfigSystemLogLevel systemLogLevel() { + return this.systemLogLevel; + } + + /** + * Set the systemLogLevel property: Set this property to filter the system logs for your function that Lambda sends + * to CloudWatch. Lambda only sends system logs at the selected level of detail and lower, where ``DEBUG`` is the + * highest level and ``WARN`` is the lowest. + * + * @param systemLogLevel the systemLogLevel value to set. + * @return the LoggingConfig object itself. + */ + public LoggingConfig withSystemLogLevel(LoggingConfigSystemLogLevel systemLogLevel) { + this.systemLogLevel = systemLogLevel; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("applicationLogLevel", + this.applicationLogLevel == null ? null : this.applicationLogLevel.toString()); + jsonWriter.writeStringField("logFormat", this.logFormat == null ? null : this.logFormat.toString()); + jsonWriter.writeStringField("logGroup", this.logGroup); + jsonWriter.writeStringField("systemLogLevel", + this.systemLogLevel == null ? null : this.systemLogLevel.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of LoggingConfig from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of LoggingConfig if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the LoggingConfig. + */ + public static LoggingConfig fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + LoggingConfig deserializedLoggingConfig = new LoggingConfig(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("applicationLogLevel".equals(fieldName)) { + deserializedLoggingConfig.applicationLogLevel + = LoggingConfigApplicationLogLevel.fromString(reader.getString()); + } else if ("logFormat".equals(fieldName)) { + deserializedLoggingConfig.logFormat = LoggingConfigLogFormat.fromString(reader.getString()); + } else if ("logGroup".equals(fieldName)) { + deserializedLoggingConfig.logGroup = reader.getString(); + } else if ("systemLogLevel".equals(fieldName)) { + deserializedLoggingConfig.systemLogLevel + = LoggingConfigSystemLogLevel.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedLoggingConfig; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/LoggingConfigApplicationLogLevel.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/LoggingConfigApplicationLogLevel.java new file mode 100644 index 000000000000..875a8425dec5 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/LoggingConfigApplicationLogLevel.java @@ -0,0 +1,71 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * LoggingConfigApplicationLogLevel enum. + */ +public final class LoggingConfigApplicationLogLevel extends ExpandableStringEnum { + /** + * Static value DEBUG for LoggingConfigApplicationLogLevel. + */ + public static final LoggingConfigApplicationLogLevel DEBUG = fromString("DEBUG"); + + /** + * Static value ERROR for LoggingConfigApplicationLogLevel. + */ + public static final LoggingConfigApplicationLogLevel ERROR = fromString("ERROR"); + + /** + * Static value FATAL for LoggingConfigApplicationLogLevel. + */ + public static final LoggingConfigApplicationLogLevel FATAL = fromString("FATAL"); + + /** + * Static value INFO for LoggingConfigApplicationLogLevel. + */ + public static final LoggingConfigApplicationLogLevel INFO = fromString("INFO"); + + /** + * Static value TRACE for LoggingConfigApplicationLogLevel. + */ + public static final LoggingConfigApplicationLogLevel TRACE = fromString("TRACE"); + + /** + * Static value WARN for LoggingConfigApplicationLogLevel. + */ + public static final LoggingConfigApplicationLogLevel WARN = fromString("WARN"); + + /** + * Creates a new instance of LoggingConfigApplicationLogLevel value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public LoggingConfigApplicationLogLevel() { + } + + /** + * Creates or finds a LoggingConfigApplicationLogLevel from its string representation. + * + * @param name a name to look for. + * @return the corresponding LoggingConfigApplicationLogLevel. + */ + public static LoggingConfigApplicationLogLevel fromString(String name) { + return fromString(name, LoggingConfigApplicationLogLevel.class); + } + + /** + * Gets known LoggingConfigApplicationLogLevel values. + * + * @return known LoggingConfigApplicationLogLevel values. + */ + public static Collection values() { + return values(LoggingConfigApplicationLogLevel.class); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/LoggingConfigAutoGenerated.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/LoggingConfigAutoGenerated.java new file mode 100644 index 000000000000..836206524426 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/LoggingConfigAutoGenerated.java @@ -0,0 +1,178 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of LoggingConfig. + */ +@Fluent +public final class LoggingConfigAutoGenerated implements JsonSerializable { + /* + * Property failureFeedbackRoleArn + */ + private String failureFeedbackRoleArn; + + /* + * Property protocol + */ + private LoggingConfigProtocol protocol; + + /* + * Property successFeedbackRoleArn + */ + private String successFeedbackRoleArn; + + /* + * Property successFeedbackSampleRate + */ + private String successFeedbackSampleRate; + + /** + * Creates an instance of LoggingConfigAutoGenerated class. + */ + public LoggingConfigAutoGenerated() { + } + + /** + * Get the failureFeedbackRoleArn property: Property failureFeedbackRoleArn. + * + * @return the failureFeedbackRoleArn value. + */ + public String failureFeedbackRoleArn() { + return this.failureFeedbackRoleArn; + } + + /** + * Set the failureFeedbackRoleArn property: Property failureFeedbackRoleArn. + * + * @param failureFeedbackRoleArn the failureFeedbackRoleArn value to set. + * @return the LoggingConfigAutoGenerated object itself. + */ + public LoggingConfigAutoGenerated withFailureFeedbackRoleArn(String failureFeedbackRoleArn) { + this.failureFeedbackRoleArn = failureFeedbackRoleArn; + return this; + } + + /** + * Get the protocol property: Property protocol. + * + * @return the protocol value. + */ + public LoggingConfigProtocol protocol() { + return this.protocol; + } + + /** + * Set the protocol property: Property protocol. + * + * @param protocol the protocol value to set. + * @return the LoggingConfigAutoGenerated object itself. + */ + public LoggingConfigAutoGenerated withProtocol(LoggingConfigProtocol protocol) { + this.protocol = protocol; + return this; + } + + /** + * Get the successFeedbackRoleArn property: Property successFeedbackRoleArn. + * + * @return the successFeedbackRoleArn value. + */ + public String successFeedbackRoleArn() { + return this.successFeedbackRoleArn; + } + + /** + * Set the successFeedbackRoleArn property: Property successFeedbackRoleArn. + * + * @param successFeedbackRoleArn the successFeedbackRoleArn value to set. + * @return the LoggingConfigAutoGenerated object itself. + */ + public LoggingConfigAutoGenerated withSuccessFeedbackRoleArn(String successFeedbackRoleArn) { + this.successFeedbackRoleArn = successFeedbackRoleArn; + return this; + } + + /** + * Get the successFeedbackSampleRate property: Property successFeedbackSampleRate. + * + * @return the successFeedbackSampleRate value. + */ + public String successFeedbackSampleRate() { + return this.successFeedbackSampleRate; + } + + /** + * Set the successFeedbackSampleRate property: Property successFeedbackSampleRate. + * + * @param successFeedbackSampleRate the successFeedbackSampleRate value to set. + * @return the LoggingConfigAutoGenerated object itself. + */ + public LoggingConfigAutoGenerated withSuccessFeedbackSampleRate(String successFeedbackSampleRate) { + this.successFeedbackSampleRate = successFeedbackSampleRate; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("failureFeedbackRoleArn", this.failureFeedbackRoleArn); + jsonWriter.writeStringField("protocol", this.protocol == null ? null : this.protocol.toString()); + jsonWriter.writeStringField("successFeedbackRoleArn", this.successFeedbackRoleArn); + jsonWriter.writeStringField("successFeedbackSampleRate", this.successFeedbackSampleRate); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of LoggingConfigAutoGenerated from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of LoggingConfigAutoGenerated if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IOException If an error occurs while reading the LoggingConfigAutoGenerated. + */ + public static LoggingConfigAutoGenerated fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + LoggingConfigAutoGenerated deserializedLoggingConfigAutoGenerated = new LoggingConfigAutoGenerated(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("failureFeedbackRoleArn".equals(fieldName)) { + deserializedLoggingConfigAutoGenerated.failureFeedbackRoleArn = reader.getString(); + } else if ("protocol".equals(fieldName)) { + deserializedLoggingConfigAutoGenerated.protocol + = LoggingConfigProtocol.fromString(reader.getString()); + } else if ("successFeedbackRoleArn".equals(fieldName)) { + deserializedLoggingConfigAutoGenerated.successFeedbackRoleArn = reader.getString(); + } else if ("successFeedbackSampleRate".equals(fieldName)) { + deserializedLoggingConfigAutoGenerated.successFeedbackSampleRate = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedLoggingConfigAutoGenerated; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/LoggingConfigLogFormat.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/LoggingConfigLogFormat.java new file mode 100644 index 000000000000..96f38c4a26a7 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/LoggingConfigLogFormat.java @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * LoggingConfigLogFormat enum. + */ +public final class LoggingConfigLogFormat extends ExpandableStringEnum { + /** + * Static value JSON for LoggingConfigLogFormat. + */ + public static final LoggingConfigLogFormat JSON = fromString("JSON"); + + /** + * Static value Text for LoggingConfigLogFormat. + */ + public static final LoggingConfigLogFormat TEXT = fromString("Text"); + + /** + * Creates a new instance of LoggingConfigLogFormat value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public LoggingConfigLogFormat() { + } + + /** + * Creates or finds a LoggingConfigLogFormat from its string representation. + * + * @param name a name to look for. + * @return the corresponding LoggingConfigLogFormat. + */ + public static LoggingConfigLogFormat fromString(String name) { + return fromString(name, LoggingConfigLogFormat.class); + } + + /** + * Gets known LoggingConfigLogFormat values. + * + * @return known LoggingConfigLogFormat values. + */ + public static Collection values() { + return values(LoggingConfigLogFormat.class); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/LoggingConfigProtocol.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/LoggingConfigProtocol.java new file mode 100644 index 000000000000..cf5b01699f1c --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/LoggingConfigProtocol.java @@ -0,0 +1,66 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * LoggingConfigProtocol enum. + */ +public final class LoggingConfigProtocol extends ExpandableStringEnum { + /** + * Static value application for LoggingConfigProtocol. + */ + public static final LoggingConfigProtocol APPLICATION = fromString("application"); + + /** + * Static value firehose for LoggingConfigProtocol. + */ + public static final LoggingConfigProtocol FIREHOSE = fromString("firehose"); + + /** + * Static value http/s for LoggingConfigProtocol. + */ + public static final LoggingConfigProtocol HTTP_S = fromString("http/s"); + + /** + * Static value lambda for LoggingConfigProtocol. + */ + public static final LoggingConfigProtocol LAMBDA = fromString("lambda"); + + /** + * Static value sqs for LoggingConfigProtocol. + */ + public static final LoggingConfigProtocol SQS = fromString("sqs"); + + /** + * Creates a new instance of LoggingConfigProtocol value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public LoggingConfigProtocol() { + } + + /** + * Creates or finds a LoggingConfigProtocol from its string representation. + * + * @param name a name to look for. + * @return the corresponding LoggingConfigProtocol. + */ + public static LoggingConfigProtocol fromString(String name) { + return fromString(name, LoggingConfigProtocol.class); + } + + /** + * Gets known LoggingConfigProtocol values. + * + * @return known LoggingConfigProtocol values. + */ + public static Collection values() { + return values(LoggingConfigProtocol.class); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/LoggingConfigSystemLogLevel.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/LoggingConfigSystemLogLevel.java new file mode 100644 index 000000000000..63636ec3da64 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/LoggingConfigSystemLogLevel.java @@ -0,0 +1,56 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * LoggingConfigSystemLogLevel enum. + */ +public final class LoggingConfigSystemLogLevel extends ExpandableStringEnum { + /** + * Static value DEBUG for LoggingConfigSystemLogLevel. + */ + public static final LoggingConfigSystemLogLevel DEBUG = fromString("DEBUG"); + + /** + * Static value INFO for LoggingConfigSystemLogLevel. + */ + public static final LoggingConfigSystemLogLevel INFO = fromString("INFO"); + + /** + * Static value WARN for LoggingConfigSystemLogLevel. + */ + public static final LoggingConfigSystemLogLevel WARN = fromString("WARN"); + + /** + * Creates a new instance of LoggingConfigSystemLogLevel value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public LoggingConfigSystemLogLevel() { + } + + /** + * Creates or finds a LoggingConfigSystemLogLevel from its string representation. + * + * @param name a name to look for. + * @return the corresponding LoggingConfigSystemLogLevel. + */ + public static LoggingConfigSystemLogLevel fromString(String name) { + return fromString(name, LoggingConfigSystemLogLevel.class); + } + + /** + * Gets known LoggingConfigSystemLogLevel values. + * + * @return known LoggingConfigSystemLogLevel values. + */ + public static Collection values() { + return values(LoggingConfigSystemLogLevel.class); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/LoggingConfiguration.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/LoggingConfiguration.java new file mode 100644 index 000000000000..ba76195a90a1 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/LoggingConfiguration.java @@ -0,0 +1,167 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of LoggingConfiguration. + */ +@Fluent +public final class LoggingConfiguration implements JsonSerializable { + /* + * The name of the bucket where Amazon S3 should store server access log files. You can store log files in any + * bucket that you own. By default, logs are stored in the bucket where the ``LoggingConfiguration`` property is + * defined. + */ + private String destinationBucketName; + + /* + * A prefix for all log object keys. If you store log files from multiple Amazon S3 buckets in a single bucket, you + * can use a prefix to distinguish which log files came from which bucket. + */ + private String logFilePrefix; + + /* + * Amazon S3 key format for log objects. Only one format, either PartitionedPrefix or SimplePrefix, is allowed. + * Describes the key format for server access log file in the target bucket. You can choose between SimplePrefix and + * PartitionedPrefix. + */ + private TargetObjectKeyFormat targetObjectKeyFormat; + + /** + * Creates an instance of LoggingConfiguration class. + */ + public LoggingConfiguration() { + } + + /** + * Get the destinationBucketName property: The name of the bucket where Amazon S3 should store server access log + * files. You can store log files in any bucket that you own. By default, logs are stored in the bucket where the + * ``LoggingConfiguration`` property is defined. + * + * @return the destinationBucketName value. + */ + public String destinationBucketName() { + return this.destinationBucketName; + } + + /** + * Set the destinationBucketName property: The name of the bucket where Amazon S3 should store server access log + * files. You can store log files in any bucket that you own. By default, logs are stored in the bucket where the + * ``LoggingConfiguration`` property is defined. + * + * @param destinationBucketName the destinationBucketName value to set. + * @return the LoggingConfiguration object itself. + */ + public LoggingConfiguration withDestinationBucketName(String destinationBucketName) { + this.destinationBucketName = destinationBucketName; + return this; + } + + /** + * Get the logFilePrefix property: A prefix for all log object keys. If you store log files from multiple Amazon S3 + * buckets in a single bucket, you can use a prefix to distinguish which log files came from which bucket. + * + * @return the logFilePrefix value. + */ + public String logFilePrefix() { + return this.logFilePrefix; + } + + /** + * Set the logFilePrefix property: A prefix for all log object keys. If you store log files from multiple Amazon S3 + * buckets in a single bucket, you can use a prefix to distinguish which log files came from which bucket. + * + * @param logFilePrefix the logFilePrefix value to set. + * @return the LoggingConfiguration object itself. + */ + public LoggingConfiguration withLogFilePrefix(String logFilePrefix) { + this.logFilePrefix = logFilePrefix; + return this; + } + + /** + * Get the targetObjectKeyFormat property: Amazon S3 key format for log objects. Only one format, either + * PartitionedPrefix or SimplePrefix, is allowed. Describes the key format for server access log file in the target + * bucket. You can choose between SimplePrefix and PartitionedPrefix. + * + * @return the targetObjectKeyFormat value. + */ + public TargetObjectKeyFormat targetObjectKeyFormat() { + return this.targetObjectKeyFormat; + } + + /** + * Set the targetObjectKeyFormat property: Amazon S3 key format for log objects. Only one format, either + * PartitionedPrefix or SimplePrefix, is allowed. Describes the key format for server access log file in the target + * bucket. You can choose between SimplePrefix and PartitionedPrefix. + * + * @param targetObjectKeyFormat the targetObjectKeyFormat value to set. + * @return the LoggingConfiguration object itself. + */ + public LoggingConfiguration withTargetObjectKeyFormat(TargetObjectKeyFormat targetObjectKeyFormat) { + this.targetObjectKeyFormat = targetObjectKeyFormat; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (targetObjectKeyFormat() != null) { + targetObjectKeyFormat().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("destinationBucketName", this.destinationBucketName); + jsonWriter.writeStringField("logFilePrefix", this.logFilePrefix); + jsonWriter.writeJsonField("targetObjectKeyFormat", this.targetObjectKeyFormat); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of LoggingConfiguration from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of LoggingConfiguration if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the LoggingConfiguration. + */ + public static LoggingConfiguration fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + LoggingConfiguration deserializedLoggingConfiguration = new LoggingConfiguration(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("destinationBucketName".equals(fieldName)) { + deserializedLoggingConfiguration.destinationBucketName = reader.getString(); + } else if ("logFilePrefix".equals(fieldName)) { + deserializedLoggingConfiguration.logFilePrefix = reader.getString(); + } else if ("targetObjectKeyFormat".equals(fieldName)) { + deserializedLoggingConfiguration.targetObjectKeyFormat = TargetObjectKeyFormat.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedLoggingConfiguration; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/LoggingFilterModelProperties.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/LoggingFilterModelProperties.java new file mode 100644 index 000000000000..4c200809460a --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/LoggingFilterModelProperties.java @@ -0,0 +1,131 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Definition of LoggingFilterModelProperties. + */ +@Fluent +public final class LoggingFilterModelProperties implements JsonSerializable { + /* + * Default handling for logs that don't match any of the specified filtering conditions. + */ + private DefaultBehavior defaultBehavior; + + /* + * The filters that you want to apply to the logs. + */ + private List filters; + + /** + * Creates an instance of LoggingFilterModelProperties class. + */ + public LoggingFilterModelProperties() { + } + + /** + * Get the defaultBehavior property: Default handling for logs that don't match any of the specified filtering + * conditions. + * + * @return the defaultBehavior value. + */ + public DefaultBehavior defaultBehavior() { + return this.defaultBehavior; + } + + /** + * Set the defaultBehavior property: Default handling for logs that don't match any of the specified filtering + * conditions. + * + * @param defaultBehavior the defaultBehavior value to set. + * @return the LoggingFilterModelProperties object itself. + */ + public LoggingFilterModelProperties withDefaultBehavior(DefaultBehavior defaultBehavior) { + this.defaultBehavior = defaultBehavior; + return this; + } + + /** + * Get the filters property: The filters that you want to apply to the logs. + * + * @return the filters value. + */ + public List filters() { + return this.filters; + } + + /** + * Set the filters property: The filters that you want to apply to the logs. + * + * @param filters the filters value to set. + * @return the LoggingFilterModelProperties object itself. + */ + public LoggingFilterModelProperties withFilters(List filters) { + this.filters = filters; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (filters() != null) { + filters().forEach(e -> e.validate()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("defaultBehavior", + this.defaultBehavior == null ? null : this.defaultBehavior.toString()); + jsonWriter.writeArrayField("filters", this.filters, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of LoggingFilterModelProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of LoggingFilterModelProperties if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the LoggingFilterModelProperties. + */ + public static LoggingFilterModelProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + LoggingFilterModelProperties deserializedLoggingFilterModelProperties = new LoggingFilterModelProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("defaultBehavior".equals(fieldName)) { + deserializedLoggingFilterModelProperties.defaultBehavior + = DefaultBehavior.fromString(reader.getString()); + } else if ("filters".equals(fieldName)) { + List filters + = reader.readArray(reader1 -> FilterAutoGenerated.fromJson(reader1)); + deserializedLoggingFilterModelProperties.filters = filters; + } else { + reader.skipChildren(); + } + } + + return deserializedLoggingFilterModelProperties; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/LoggingProperties.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/LoggingProperties.java new file mode 100644 index 000000000000..28964de7110d --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/LoggingProperties.java @@ -0,0 +1,121 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of LoggingProperties. + */ +@Fluent +public final class LoggingProperties implements JsonSerializable { + /* + * Property bucketName + */ + private String bucketName; + + /* + * Property s3KeyPrefix + */ + private String s3KeyPrefix; + + /** + * Creates an instance of LoggingProperties class. + */ + public LoggingProperties() { + } + + /** + * Get the bucketName property: Property bucketName. + * + * @return the bucketName value. + */ + public String bucketName() { + return this.bucketName; + } + + /** + * Set the bucketName property: Property bucketName. + * + * @param bucketName the bucketName value to set. + * @return the LoggingProperties object itself. + */ + public LoggingProperties withBucketName(String bucketName) { + this.bucketName = bucketName; + return this; + } + + /** + * Get the s3KeyPrefix property: Property s3KeyPrefix. + * + * @return the s3KeyPrefix value. + */ + public String s3KeyPrefix() { + return this.s3KeyPrefix; + } + + /** + * Set the s3KeyPrefix property: Property s3KeyPrefix. + * + * @param s3KeyPrefix the s3KeyPrefix value to set. + * @return the LoggingProperties object itself. + */ + public LoggingProperties withS3KeyPrefix(String s3KeyPrefix) { + this.s3KeyPrefix = s3KeyPrefix; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("bucketName", this.bucketName); + jsonWriter.writeStringField("s3KeyPrefix", this.s3KeyPrefix); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of LoggingProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of LoggingProperties if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the LoggingProperties. + */ + public static LoggingProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + LoggingProperties deserializedLoggingProperties = new LoggingProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("bucketName".equals(fieldName)) { + deserializedLoggingProperties.bucketName = reader.getString(); + } else if ("s3KeyPrefix".equals(fieldName)) { + deserializedLoggingProperties.s3KeyPrefix = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedLoggingProperties; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/LogsConfig.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/LogsConfig.java new file mode 100644 index 000000000000..06ae2da572e7 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/LogsConfig.java @@ -0,0 +1,131 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of LogsConfig. + */ +@Fluent +public final class LogsConfig implements JsonSerializable { + /* + *

Information about CloudWatch Logs for a build project. CloudWatch Logs are enabled by default.

+ */ + private CloudWatchLogsConfig cloudWatchLogs; + + /* + *

Information about logs built to an S3 bucket for a build project. S3 logs are not enabled by default.

+ */ + private S3LogsConfig s3Logs; + + /** + * Creates an instance of LogsConfig class. + */ + public LogsConfig() { + } + + /** + * Get the cloudWatchLogs property: <p> Information about CloudWatch Logs for a build project. CloudWatch Logs + * are enabled by default. </p>. + * + * @return the cloudWatchLogs value. + */ + public CloudWatchLogsConfig cloudWatchLogs() { + return this.cloudWatchLogs; + } + + /** + * Set the cloudWatchLogs property: <p> Information about CloudWatch Logs for a build project. CloudWatch Logs + * are enabled by default. </p>. + * + * @param cloudWatchLogs the cloudWatchLogs value to set. + * @return the LogsConfig object itself. + */ + public LogsConfig withCloudWatchLogs(CloudWatchLogsConfig cloudWatchLogs) { + this.cloudWatchLogs = cloudWatchLogs; + return this; + } + + /** + * Get the s3Logs property: <p> Information about logs built to an S3 bucket for a build project. S3 logs are + * not enabled by default. </p>. + * + * @return the s3Logs value. + */ + public S3LogsConfig s3Logs() { + return this.s3Logs; + } + + /** + * Set the s3Logs property: <p> Information about logs built to an S3 bucket for a build project. S3 logs are + * not enabled by default. </p>. + * + * @param s3Logs the s3Logs value to set. + * @return the LogsConfig object itself. + */ + public LogsConfig withS3Logs(S3LogsConfig s3Logs) { + this.s3Logs = s3Logs; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (cloudWatchLogs() != null) { + cloudWatchLogs().validate(); + } + if (s3Logs() != null) { + s3Logs().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("cloudWatchLogs", this.cloudWatchLogs); + jsonWriter.writeJsonField("s3Logs", this.s3Logs); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of LogsConfig from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of LogsConfig if the JsonReader was pointing to an instance of it, or null if it was pointing + * to JSON null. + * @throws IOException If an error occurs while reading the LogsConfig. + */ + public static LogsConfig fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + LogsConfig deserializedLogsConfig = new LogsConfig(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("cloudWatchLogs".equals(fieldName)) { + deserializedLogsConfig.cloudWatchLogs = CloudWatchLogsConfig.fromJson(reader); + } else if ("s3Logs".equals(fieldName)) { + deserializedLogsConfig.s3Logs = S3LogsConfig.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedLogsConfig; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/LogsConfigStatusType.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/LogsConfigStatusType.java new file mode 100644 index 000000000000..ea947357fb70 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/LogsConfigStatusType.java @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * LogsConfigStatusType enum. + */ +public final class LogsConfigStatusType extends ExpandableStringEnum { + /** + * Static value DISABLED for LogsConfigStatusType. + */ + public static final LogsConfigStatusType DISABLED = fromString("DISABLED"); + + /** + * Static value ENABLED for LogsConfigStatusType. + */ + public static final LogsConfigStatusType ENABLED = fromString("ENABLED"); + + /** + * Creates a new instance of LogsConfigStatusType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public LogsConfigStatusType() { + } + + /** + * Creates or finds a LogsConfigStatusType from its string representation. + * + * @param name a name to look for. + * @return the corresponding LogsConfigStatusType. + */ + public static LogsConfigStatusType fromString(String name) { + return fromString(name, LogsConfigStatusType.class); + } + + /** + * Gets known LogsConfigStatusType values. + * + * @return known LogsConfigStatusType values. + */ + public static Collection values() { + return values(LogsConfigStatusType.class); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/LogsConfigStatusTypeEnumValue.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/LogsConfigStatusTypeEnumValue.java new file mode 100644 index 000000000000..0b6b97c27cb2 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/LogsConfigStatusTypeEnumValue.java @@ -0,0 +1,95 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of LogsConfigStatusTypeEnumValue. + */ +@Fluent +public final class LogsConfigStatusTypeEnumValue implements JsonSerializable { + /* + * Property value + */ + private LogsConfigStatusType value; + + /** + * Creates an instance of LogsConfigStatusTypeEnumValue class. + */ + public LogsConfigStatusTypeEnumValue() { + } + + /** + * Get the value property: Property value. + * + * @return the value value. + */ + public LogsConfigStatusType value() { + return this.value; + } + + /** + * Set the value property: Property value. + * + * @param value the value value to set. + * @return the LogsConfigStatusTypeEnumValue object itself. + */ + public LogsConfigStatusTypeEnumValue withValue(LogsConfigStatusType value) { + this.value = value; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("value", this.value == null ? null : this.value.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of LogsConfigStatusTypeEnumValue from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of LogsConfigStatusTypeEnumValue if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the LogsConfigStatusTypeEnumValue. + */ + public static LogsConfigStatusTypeEnumValue fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + LogsConfigStatusTypeEnumValue deserializedLogsConfigStatusTypeEnumValue + = new LogsConfigStatusTypeEnumValue(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + deserializedLogsConfigStatusTypeEnumValue.value + = LogsConfigStatusType.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedLogsConfigStatusTypeEnumValue; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/LogsLogGroup.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/LogsLogGroup.java new file mode 100644 index 000000000000..06b774e9711a --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/LogsLogGroup.java @@ -0,0 +1,252 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.awsconnector.fluent.models.LogsLogGroupInner; +import java.util.Map; + +/** + * An immutable client-side representation of LogsLogGroup. + */ +public interface LogsLogGroup { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the location property: The geo-location where the resource lives. + * + * @return the location value. + */ + String location(); + + /** + * Gets the tags property: Resource tags. + * + * @return the tags value. + */ + Map tags(); + + /** + * Gets the properties property: The resource-specific properties for this resource. + * + * @return the properties value. + */ + LogsLogGroupProperties properties(); + + /** + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the region of the resource. + * + * @return the region of the resource. + */ + Region region(); + + /** + * Gets the name of the resource region. + * + * @return the name of the resource region. + */ + String regionName(); + + /** + * Gets the name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + + /** + * Gets the inner com.azure.resourcemanager.awsconnector.fluent.models.LogsLogGroupInner object. + * + * @return the inner object. + */ + LogsLogGroupInner innerModel(); + + /** + * The entirety of the LogsLogGroup definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithLocation, + DefinitionStages.WithResourceGroup, DefinitionStages.WithCreate { + } + + /** + * The LogsLogGroup definition stages. + */ + interface DefinitionStages { + /** + * The first stage of the LogsLogGroup definition. + */ + interface Blank extends WithLocation { + } + + /** + * The stage of the LogsLogGroup definition allowing to specify location. + */ + interface WithLocation { + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithResourceGroup withRegion(Region location); + + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithResourceGroup withRegion(String location); + } + + /** + * The stage of the LogsLogGroup definition allowing to specify parent resource. + */ + interface WithResourceGroup { + /** + * Specifies resourceGroupName. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @return the next definition stage. + */ + WithCreate withExistingResourceGroup(String resourceGroupName); + } + + /** + * The stage of the LogsLogGroup 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.WithProperties { + /** + * Executes the create request. + * + * @return the created resource. + */ + LogsLogGroup create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + LogsLogGroup create(Context context); + } + + /** + * The stage of the LogsLogGroup definition allowing to specify tags. + */ + interface WithTags { + /** + * Specifies the tags property: Resource tags.. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + WithCreate withTags(Map tags); + } + + /** + * The stage of the LogsLogGroup definition allowing to specify properties. + */ + interface WithProperties { + /** + * Specifies the properties property: The resource-specific properties for this resource.. + * + * @param properties The resource-specific properties for this resource. + * @return the next definition stage. + */ + WithCreate withProperties(LogsLogGroupProperties properties); + } + } + + /** + * Begins update for the LogsLogGroup resource. + * + * @return the stage of resource update. + */ + LogsLogGroup.Update update(); + + /** + * The template for LogsLogGroup update. + */ + interface Update extends UpdateStages.WithTags { + /** + * Executes the update request. + * + * @return the updated resource. + */ + LogsLogGroup apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + LogsLogGroup apply(Context context); + } + + /** + * The LogsLogGroup update stages. + */ + interface UpdateStages { + /** + * The stage of the LogsLogGroup update allowing to specify tags. + */ + interface WithTags { + /** + * Specifies the tags property: Resource tags.. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + Update withTags(Map tags); + } + } + + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + LogsLogGroup refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + LogsLogGroup refresh(Context context); +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/LogsLogGroupListResult.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/LogsLogGroupListResult.java new file mode 100644 index 000000000000..eebfc776f555 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/LogsLogGroupListResult.java @@ -0,0 +1,134 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.awsconnector.fluent.models.LogsLogGroupInner; +import java.io.IOException; +import java.util.List; + +/** + * The response of a LogsLogGroup list operation. + */ +@Fluent +public final class LogsLogGroupListResult implements JsonSerializable { + /* + * The LogsLogGroup items on this page + */ + private List value; + + /* + * The link to the next page of items + */ + private String nextLink; + + /** + * Creates an instance of LogsLogGroupListResult class. + */ + public LogsLogGroupListResult() { + } + + /** + * Get the value property: The LogsLogGroup items on this page. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The LogsLogGroup items on this page. + * + * @param value the value value to set. + * @return the LogsLogGroupListResult object itself. + */ + public LogsLogGroupListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The link to the next page of items. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: The link to the next page of items. + * + * @param nextLink the nextLink value to set. + * @return the LogsLogGroupListResult object itself. + */ + public LogsLogGroupListResult withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property value in model LogsLogGroupListResult")); + } else { + value().forEach(e -> e.validate()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(LogsLogGroupListResult.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("nextLink", this.nextLink); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of LogsLogGroupListResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of LogsLogGroupListResult if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the LogsLogGroupListResult. + */ + public static LogsLogGroupListResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + LogsLogGroupListResult deserializedLogsLogGroupListResult = new LogsLogGroupListResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value = reader.readArray(reader1 -> LogsLogGroupInner.fromJson(reader1)); + deserializedLogsLogGroupListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedLogsLogGroupListResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedLogsLogGroupListResult; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/LogsLogGroupProperties.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/LogsLogGroupProperties.java new file mode 100644 index 000000000000..07bb7bd317ec --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/LogsLogGroupProperties.java @@ -0,0 +1,311 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.Map; + +/** + * Definition of LogsLogGroup. + */ +@Fluent +public final class LogsLogGroupProperties implements JsonSerializable { + /* + * AWS Properties + */ + private AwsLogsLogGroupProperties awsProperties; + + /* + * Public Cloud Connectors Resource ID + */ + private String publicCloudConnectorsResourceId; + + /* + * AWS Account ID + */ + private String awsAccountId; + + /* + * Amazon Resource Name (ARN) + */ + private String arn; + + /* + * Public Cloud Resource Name + */ + private String publicCloudResourceName; + + /* + * AWS Source Schema + */ + private String awsSourceSchema; + + /* + * AWS Region + */ + private String awsRegion; + + /* + * AWS Tags + */ + private Map awsTags; + + /* + * The status of the last operation. + */ + private ProvisioningState provisioningState; + + /** + * Creates an instance of LogsLogGroupProperties class. + */ + public LogsLogGroupProperties() { + } + + /** + * Get the awsProperties property: AWS Properties. + * + * @return the awsProperties value. + */ + public AwsLogsLogGroupProperties awsProperties() { + return this.awsProperties; + } + + /** + * Set the awsProperties property: AWS Properties. + * + * @param awsProperties the awsProperties value to set. + * @return the LogsLogGroupProperties object itself. + */ + public LogsLogGroupProperties withAwsProperties(AwsLogsLogGroupProperties awsProperties) { + this.awsProperties = awsProperties; + return this; + } + + /** + * Get the publicCloudConnectorsResourceId property: Public Cloud Connectors Resource ID. + * + * @return the publicCloudConnectorsResourceId value. + */ + public String publicCloudConnectorsResourceId() { + return this.publicCloudConnectorsResourceId; + } + + /** + * Set the publicCloudConnectorsResourceId property: Public Cloud Connectors Resource ID. + * + * @param publicCloudConnectorsResourceId the publicCloudConnectorsResourceId value to set. + * @return the LogsLogGroupProperties object itself. + */ + public LogsLogGroupProperties withPublicCloudConnectorsResourceId(String publicCloudConnectorsResourceId) { + this.publicCloudConnectorsResourceId = publicCloudConnectorsResourceId; + return this; + } + + /** + * Get the awsAccountId property: AWS Account ID. + * + * @return the awsAccountId value. + */ + public String awsAccountId() { + return this.awsAccountId; + } + + /** + * Set the awsAccountId property: AWS Account ID. + * + * @param awsAccountId the awsAccountId value to set. + * @return the LogsLogGroupProperties object itself. + */ + public LogsLogGroupProperties withAwsAccountId(String awsAccountId) { + this.awsAccountId = awsAccountId; + return this; + } + + /** + * Get the arn property: Amazon Resource Name (ARN). + * + * @return the arn value. + */ + public String arn() { + return this.arn; + } + + /** + * Set the arn property: Amazon Resource Name (ARN). + * + * @param arn the arn value to set. + * @return the LogsLogGroupProperties object itself. + */ + public LogsLogGroupProperties withArn(String arn) { + this.arn = arn; + return this; + } + + /** + * Get the publicCloudResourceName property: Public Cloud Resource Name. + * + * @return the publicCloudResourceName value. + */ + public String publicCloudResourceName() { + return this.publicCloudResourceName; + } + + /** + * Set the publicCloudResourceName property: Public Cloud Resource Name. + * + * @param publicCloudResourceName the publicCloudResourceName value to set. + * @return the LogsLogGroupProperties object itself. + */ + public LogsLogGroupProperties withPublicCloudResourceName(String publicCloudResourceName) { + this.publicCloudResourceName = publicCloudResourceName; + return this; + } + + /** + * Get the awsSourceSchema property: AWS Source Schema. + * + * @return the awsSourceSchema value. + */ + public String awsSourceSchema() { + return this.awsSourceSchema; + } + + /** + * Set the awsSourceSchema property: AWS Source Schema. + * + * @param awsSourceSchema the awsSourceSchema value to set. + * @return the LogsLogGroupProperties object itself. + */ + public LogsLogGroupProperties withAwsSourceSchema(String awsSourceSchema) { + this.awsSourceSchema = awsSourceSchema; + return this; + } + + /** + * Get the awsRegion property: AWS Region. + * + * @return the awsRegion value. + */ + public String awsRegion() { + return this.awsRegion; + } + + /** + * Set the awsRegion property: AWS Region. + * + * @param awsRegion the awsRegion value to set. + * @return the LogsLogGroupProperties object itself. + */ + public LogsLogGroupProperties withAwsRegion(String awsRegion) { + this.awsRegion = awsRegion; + return this; + } + + /** + * Get the awsTags property: AWS Tags. + * + * @return the awsTags value. + */ + public Map awsTags() { + return this.awsTags; + } + + /** + * Set the awsTags property: AWS Tags. + * + * @param awsTags the awsTags value to set. + * @return the LogsLogGroupProperties object itself. + */ + public LogsLogGroupProperties withAwsTags(Map awsTags) { + this.awsTags = awsTags; + return this; + } + + /** + * Get the provisioningState property: The status of the last operation. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (awsProperties() != null) { + awsProperties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("awsProperties", this.awsProperties); + jsonWriter.writeStringField("publicCloudConnectorsResourceId", this.publicCloudConnectorsResourceId); + jsonWriter.writeStringField("awsAccountId", this.awsAccountId); + jsonWriter.writeStringField("arn", this.arn); + jsonWriter.writeStringField("publicCloudResourceName", this.publicCloudResourceName); + jsonWriter.writeStringField("awsSourceSchema", this.awsSourceSchema); + jsonWriter.writeStringField("awsRegion", this.awsRegion); + jsonWriter.writeMapField("awsTags", this.awsTags, (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of LogsLogGroupProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of LogsLogGroupProperties if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the LogsLogGroupProperties. + */ + public static LogsLogGroupProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + LogsLogGroupProperties deserializedLogsLogGroupProperties = new LogsLogGroupProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("awsProperties".equals(fieldName)) { + deserializedLogsLogGroupProperties.awsProperties = AwsLogsLogGroupProperties.fromJson(reader); + } else if ("publicCloudConnectorsResourceId".equals(fieldName)) { + deserializedLogsLogGroupProperties.publicCloudConnectorsResourceId = reader.getString(); + } else if ("awsAccountId".equals(fieldName)) { + deserializedLogsLogGroupProperties.awsAccountId = reader.getString(); + } else if ("arn".equals(fieldName)) { + deserializedLogsLogGroupProperties.arn = reader.getString(); + } else if ("publicCloudResourceName".equals(fieldName)) { + deserializedLogsLogGroupProperties.publicCloudResourceName = reader.getString(); + } else if ("awsSourceSchema".equals(fieldName)) { + deserializedLogsLogGroupProperties.awsSourceSchema = reader.getString(); + } else if ("awsRegion".equals(fieldName)) { + deserializedLogsLogGroupProperties.awsRegion = reader.getString(); + } else if ("awsTags".equals(fieldName)) { + Map awsTags = reader.readMap(reader1 -> reader1.getString()); + deserializedLogsLogGroupProperties.awsTags = awsTags; + } else if ("provisioningState".equals(fieldName)) { + deserializedLogsLogGroupProperties.provisioningState + = ProvisioningState.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedLogsLogGroupProperties; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/LogsLogGroupTagsUpdate.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/LogsLogGroupTagsUpdate.java new file mode 100644 index 000000000000..7a4ae82f398a --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/LogsLogGroupTagsUpdate.java @@ -0,0 +1,95 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.Map; + +/** + * The type used for updating tags in LogsLogGroup resources. + */ +@Fluent +public final class LogsLogGroupTagsUpdate implements JsonSerializable { + /* + * Resource tags. + */ + private Map tags; + + /** + * Creates an instance of LogsLogGroupTagsUpdate class. + */ + public LogsLogGroupTagsUpdate() { + } + + /** + * Get the tags property: Resource tags. + * + * @return the tags value. + */ + public Map tags() { + return this.tags; + } + + /** + * Set the tags property: Resource tags. + * + * @param tags the tags value to set. + * @return the LogsLogGroupTagsUpdate object itself. + */ + public LogsLogGroupTagsUpdate withTags(Map tags) { + this.tags = tags; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeMapField("tags", this.tags, (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of LogsLogGroupTagsUpdate from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of LogsLogGroupTagsUpdate if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the LogsLogGroupTagsUpdate. + */ + public static LogsLogGroupTagsUpdate fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + LogsLogGroupTagsUpdate deserializedLogsLogGroupTagsUpdate = new LogsLogGroupTagsUpdate(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedLogsLogGroupTagsUpdate.tags = tags; + } else { + reader.skipChildren(); + } + } + + return deserializedLogsLogGroupTagsUpdate; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/LogsLogGroups.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/LogsLogGroups.java new file mode 100644 index 000000000000..25ffa8ce638b --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/LogsLogGroups.java @@ -0,0 +1,157 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** + * Resource collection API of LogsLogGroups. + */ +public interface LogsLogGroups { + /** + * List LogsLogGroup resources by subscription ID. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a LogsLogGroup list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable list(); + + /** + * List LogsLogGroup resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a LogsLogGroup list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable list(Context context); + + /** + * List LogsLogGroup resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a LogsLogGroup list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * List LogsLogGroup resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a LogsLogGroup list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Get a LogsLogGroup. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of LogsLogGroup. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a LogsLogGroup along with {@link Response}. + */ + Response getByResourceGroupWithResponse(String resourceGroupName, String name, Context context); + + /** + * Get a LogsLogGroup. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of LogsLogGroup. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a LogsLogGroup. + */ + LogsLogGroup getByResourceGroup(String resourceGroupName, String name); + + /** + * Delete a LogsLogGroup. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of LogsLogGroup. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByResourceGroup(String resourceGroupName, String name); + + /** + * Delete a LogsLogGroup. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of LogsLogGroup. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String name, Context context); + + /** + * Get a LogsLogGroup. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a LogsLogGroup along with {@link Response}. + */ + LogsLogGroup getById(String id); + + /** + * Get a LogsLogGroup. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a LogsLogGroup along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Delete a LogsLogGroup. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteById(String id); + + /** + * Delete a LogsLogGroup. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new LogsLogGroup resource. + * + * @param name resource name. + * @return the first stage of the new LogsLogGroup definition. + */ + LogsLogGroup.DefinitionStages.Blank define(String name); +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/LogsLogStream.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/LogsLogStream.java new file mode 100644 index 000000000000..794a3f0c7159 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/LogsLogStream.java @@ -0,0 +1,252 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.awsconnector.fluent.models.LogsLogStreamInner; +import java.util.Map; + +/** + * An immutable client-side representation of LogsLogStream. + */ +public interface LogsLogStream { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the location property: The geo-location where the resource lives. + * + * @return the location value. + */ + String location(); + + /** + * Gets the tags property: Resource tags. + * + * @return the tags value. + */ + Map tags(); + + /** + * Gets the properties property: The resource-specific properties for this resource. + * + * @return the properties value. + */ + LogsLogStreamProperties properties(); + + /** + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the region of the resource. + * + * @return the region of the resource. + */ + Region region(); + + /** + * Gets the name of the resource region. + * + * @return the name of the resource region. + */ + String regionName(); + + /** + * Gets the name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + + /** + * Gets the inner com.azure.resourcemanager.awsconnector.fluent.models.LogsLogStreamInner object. + * + * @return the inner object. + */ + LogsLogStreamInner innerModel(); + + /** + * The entirety of the LogsLogStream definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithLocation, + DefinitionStages.WithResourceGroup, DefinitionStages.WithCreate { + } + + /** + * The LogsLogStream definition stages. + */ + interface DefinitionStages { + /** + * The first stage of the LogsLogStream definition. + */ + interface Blank extends WithLocation { + } + + /** + * The stage of the LogsLogStream definition allowing to specify location. + */ + interface WithLocation { + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithResourceGroup withRegion(Region location); + + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithResourceGroup withRegion(String location); + } + + /** + * The stage of the LogsLogStream definition allowing to specify parent resource. + */ + interface WithResourceGroup { + /** + * Specifies resourceGroupName. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @return the next definition stage. + */ + WithCreate withExistingResourceGroup(String resourceGroupName); + } + + /** + * The stage of the LogsLogStream 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.WithProperties { + /** + * Executes the create request. + * + * @return the created resource. + */ + LogsLogStream create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + LogsLogStream create(Context context); + } + + /** + * The stage of the LogsLogStream definition allowing to specify tags. + */ + interface WithTags { + /** + * Specifies the tags property: Resource tags.. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + WithCreate withTags(Map tags); + } + + /** + * The stage of the LogsLogStream definition allowing to specify properties. + */ + interface WithProperties { + /** + * Specifies the properties property: The resource-specific properties for this resource.. + * + * @param properties The resource-specific properties for this resource. + * @return the next definition stage. + */ + WithCreate withProperties(LogsLogStreamProperties properties); + } + } + + /** + * Begins update for the LogsLogStream resource. + * + * @return the stage of resource update. + */ + LogsLogStream.Update update(); + + /** + * The template for LogsLogStream update. + */ + interface Update extends UpdateStages.WithTags { + /** + * Executes the update request. + * + * @return the updated resource. + */ + LogsLogStream apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + LogsLogStream apply(Context context); + } + + /** + * The LogsLogStream update stages. + */ + interface UpdateStages { + /** + * The stage of the LogsLogStream update allowing to specify tags. + */ + interface WithTags { + /** + * Specifies the tags property: Resource tags.. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + Update withTags(Map tags); + } + } + + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + LogsLogStream refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + LogsLogStream refresh(Context context); +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/LogsLogStreamListResult.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/LogsLogStreamListResult.java new file mode 100644 index 000000000000..d13d76acf5d5 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/LogsLogStreamListResult.java @@ -0,0 +1,134 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.awsconnector.fluent.models.LogsLogStreamInner; +import java.io.IOException; +import java.util.List; + +/** + * The response of a LogsLogStream list operation. + */ +@Fluent +public final class LogsLogStreamListResult implements JsonSerializable { + /* + * The LogsLogStream items on this page + */ + private List value; + + /* + * The link to the next page of items + */ + private String nextLink; + + /** + * Creates an instance of LogsLogStreamListResult class. + */ + public LogsLogStreamListResult() { + } + + /** + * Get the value property: The LogsLogStream items on this page. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The LogsLogStream items on this page. + * + * @param value the value value to set. + * @return the LogsLogStreamListResult object itself. + */ + public LogsLogStreamListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The link to the next page of items. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: The link to the next page of items. + * + * @param nextLink the nextLink value to set. + * @return the LogsLogStreamListResult object itself. + */ + public LogsLogStreamListResult withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property value in model LogsLogStreamListResult")); + } else { + value().forEach(e -> e.validate()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(LogsLogStreamListResult.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("nextLink", this.nextLink); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of LogsLogStreamListResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of LogsLogStreamListResult if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the LogsLogStreamListResult. + */ + public static LogsLogStreamListResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + LogsLogStreamListResult deserializedLogsLogStreamListResult = new LogsLogStreamListResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value = reader.readArray(reader1 -> LogsLogStreamInner.fromJson(reader1)); + deserializedLogsLogStreamListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedLogsLogStreamListResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedLogsLogStreamListResult; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/LogsLogStreamProperties.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/LogsLogStreamProperties.java new file mode 100644 index 000000000000..72bfda8cf1fd --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/LogsLogStreamProperties.java @@ -0,0 +1,311 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.Map; + +/** + * Definition of LogsLogStream. + */ +@Fluent +public final class LogsLogStreamProperties implements JsonSerializable { + /* + * AWS Properties + */ + private AwsLogsLogStreamProperties awsProperties; + + /* + * Public Cloud Connectors Resource ID + */ + private String publicCloudConnectorsResourceId; + + /* + * AWS Account ID + */ + private String awsAccountId; + + /* + * Amazon Resource Name (ARN) + */ + private String arn; + + /* + * Public Cloud Resource Name + */ + private String publicCloudResourceName; + + /* + * AWS Source Schema + */ + private String awsSourceSchema; + + /* + * AWS Region + */ + private String awsRegion; + + /* + * AWS Tags + */ + private Map awsTags; + + /* + * The status of the last operation. + */ + private ProvisioningState provisioningState; + + /** + * Creates an instance of LogsLogStreamProperties class. + */ + public LogsLogStreamProperties() { + } + + /** + * Get the awsProperties property: AWS Properties. + * + * @return the awsProperties value. + */ + public AwsLogsLogStreamProperties awsProperties() { + return this.awsProperties; + } + + /** + * Set the awsProperties property: AWS Properties. + * + * @param awsProperties the awsProperties value to set. + * @return the LogsLogStreamProperties object itself. + */ + public LogsLogStreamProperties withAwsProperties(AwsLogsLogStreamProperties awsProperties) { + this.awsProperties = awsProperties; + return this; + } + + /** + * Get the publicCloudConnectorsResourceId property: Public Cloud Connectors Resource ID. + * + * @return the publicCloudConnectorsResourceId value. + */ + public String publicCloudConnectorsResourceId() { + return this.publicCloudConnectorsResourceId; + } + + /** + * Set the publicCloudConnectorsResourceId property: Public Cloud Connectors Resource ID. + * + * @param publicCloudConnectorsResourceId the publicCloudConnectorsResourceId value to set. + * @return the LogsLogStreamProperties object itself. + */ + public LogsLogStreamProperties withPublicCloudConnectorsResourceId(String publicCloudConnectorsResourceId) { + this.publicCloudConnectorsResourceId = publicCloudConnectorsResourceId; + return this; + } + + /** + * Get the awsAccountId property: AWS Account ID. + * + * @return the awsAccountId value. + */ + public String awsAccountId() { + return this.awsAccountId; + } + + /** + * Set the awsAccountId property: AWS Account ID. + * + * @param awsAccountId the awsAccountId value to set. + * @return the LogsLogStreamProperties object itself. + */ + public LogsLogStreamProperties withAwsAccountId(String awsAccountId) { + this.awsAccountId = awsAccountId; + return this; + } + + /** + * Get the arn property: Amazon Resource Name (ARN). + * + * @return the arn value. + */ + public String arn() { + return this.arn; + } + + /** + * Set the arn property: Amazon Resource Name (ARN). + * + * @param arn the arn value to set. + * @return the LogsLogStreamProperties object itself. + */ + public LogsLogStreamProperties withArn(String arn) { + this.arn = arn; + return this; + } + + /** + * Get the publicCloudResourceName property: Public Cloud Resource Name. + * + * @return the publicCloudResourceName value. + */ + public String publicCloudResourceName() { + return this.publicCloudResourceName; + } + + /** + * Set the publicCloudResourceName property: Public Cloud Resource Name. + * + * @param publicCloudResourceName the publicCloudResourceName value to set. + * @return the LogsLogStreamProperties object itself. + */ + public LogsLogStreamProperties withPublicCloudResourceName(String publicCloudResourceName) { + this.publicCloudResourceName = publicCloudResourceName; + return this; + } + + /** + * Get the awsSourceSchema property: AWS Source Schema. + * + * @return the awsSourceSchema value. + */ + public String awsSourceSchema() { + return this.awsSourceSchema; + } + + /** + * Set the awsSourceSchema property: AWS Source Schema. + * + * @param awsSourceSchema the awsSourceSchema value to set. + * @return the LogsLogStreamProperties object itself. + */ + public LogsLogStreamProperties withAwsSourceSchema(String awsSourceSchema) { + this.awsSourceSchema = awsSourceSchema; + return this; + } + + /** + * Get the awsRegion property: AWS Region. + * + * @return the awsRegion value. + */ + public String awsRegion() { + return this.awsRegion; + } + + /** + * Set the awsRegion property: AWS Region. + * + * @param awsRegion the awsRegion value to set. + * @return the LogsLogStreamProperties object itself. + */ + public LogsLogStreamProperties withAwsRegion(String awsRegion) { + this.awsRegion = awsRegion; + return this; + } + + /** + * Get the awsTags property: AWS Tags. + * + * @return the awsTags value. + */ + public Map awsTags() { + return this.awsTags; + } + + /** + * Set the awsTags property: AWS Tags. + * + * @param awsTags the awsTags value to set. + * @return the LogsLogStreamProperties object itself. + */ + public LogsLogStreamProperties withAwsTags(Map awsTags) { + this.awsTags = awsTags; + return this; + } + + /** + * Get the provisioningState property: The status of the last operation. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (awsProperties() != null) { + awsProperties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("awsProperties", this.awsProperties); + jsonWriter.writeStringField("publicCloudConnectorsResourceId", this.publicCloudConnectorsResourceId); + jsonWriter.writeStringField("awsAccountId", this.awsAccountId); + jsonWriter.writeStringField("arn", this.arn); + jsonWriter.writeStringField("publicCloudResourceName", this.publicCloudResourceName); + jsonWriter.writeStringField("awsSourceSchema", this.awsSourceSchema); + jsonWriter.writeStringField("awsRegion", this.awsRegion); + jsonWriter.writeMapField("awsTags", this.awsTags, (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of LogsLogStreamProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of LogsLogStreamProperties if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the LogsLogStreamProperties. + */ + public static LogsLogStreamProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + LogsLogStreamProperties deserializedLogsLogStreamProperties = new LogsLogStreamProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("awsProperties".equals(fieldName)) { + deserializedLogsLogStreamProperties.awsProperties = AwsLogsLogStreamProperties.fromJson(reader); + } else if ("publicCloudConnectorsResourceId".equals(fieldName)) { + deserializedLogsLogStreamProperties.publicCloudConnectorsResourceId = reader.getString(); + } else if ("awsAccountId".equals(fieldName)) { + deserializedLogsLogStreamProperties.awsAccountId = reader.getString(); + } else if ("arn".equals(fieldName)) { + deserializedLogsLogStreamProperties.arn = reader.getString(); + } else if ("publicCloudResourceName".equals(fieldName)) { + deserializedLogsLogStreamProperties.publicCloudResourceName = reader.getString(); + } else if ("awsSourceSchema".equals(fieldName)) { + deserializedLogsLogStreamProperties.awsSourceSchema = reader.getString(); + } else if ("awsRegion".equals(fieldName)) { + deserializedLogsLogStreamProperties.awsRegion = reader.getString(); + } else if ("awsTags".equals(fieldName)) { + Map awsTags = reader.readMap(reader1 -> reader1.getString()); + deserializedLogsLogStreamProperties.awsTags = awsTags; + } else if ("provisioningState".equals(fieldName)) { + deserializedLogsLogStreamProperties.provisioningState + = ProvisioningState.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedLogsLogStreamProperties; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/LogsLogStreamTagsUpdate.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/LogsLogStreamTagsUpdate.java new file mode 100644 index 000000000000..d42d0ea95099 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/LogsLogStreamTagsUpdate.java @@ -0,0 +1,95 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.Map; + +/** + * The type used for updating tags in LogsLogStream resources. + */ +@Fluent +public final class LogsLogStreamTagsUpdate implements JsonSerializable { + /* + * Resource tags. + */ + private Map tags; + + /** + * Creates an instance of LogsLogStreamTagsUpdate class. + */ + public LogsLogStreamTagsUpdate() { + } + + /** + * Get the tags property: Resource tags. + * + * @return the tags value. + */ + public Map tags() { + return this.tags; + } + + /** + * Set the tags property: Resource tags. + * + * @param tags the tags value to set. + * @return the LogsLogStreamTagsUpdate object itself. + */ + public LogsLogStreamTagsUpdate withTags(Map tags) { + this.tags = tags; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeMapField("tags", this.tags, (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of LogsLogStreamTagsUpdate from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of LogsLogStreamTagsUpdate if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the LogsLogStreamTagsUpdate. + */ + public static LogsLogStreamTagsUpdate fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + LogsLogStreamTagsUpdate deserializedLogsLogStreamTagsUpdate = new LogsLogStreamTagsUpdate(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedLogsLogStreamTagsUpdate.tags = tags; + } else { + reader.skipChildren(); + } + } + + return deserializedLogsLogStreamTagsUpdate; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/LogsLogStreams.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/LogsLogStreams.java new file mode 100644 index 000000000000..7418b454136c --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/LogsLogStreams.java @@ -0,0 +1,157 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** + * Resource collection API of LogsLogStreams. + */ +public interface LogsLogStreams { + /** + * List LogsLogStream resources by subscription ID. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a LogsLogStream list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable list(); + + /** + * List LogsLogStream resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a LogsLogStream list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable list(Context context); + + /** + * List LogsLogStream resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a LogsLogStream list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * List LogsLogStream resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a LogsLogStream list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Get a LogsLogStream. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of LogsLogStream. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a LogsLogStream along with {@link Response}. + */ + Response getByResourceGroupWithResponse(String resourceGroupName, String name, Context context); + + /** + * Get a LogsLogStream. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of LogsLogStream. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a LogsLogStream. + */ + LogsLogStream getByResourceGroup(String resourceGroupName, String name); + + /** + * Delete a LogsLogStream. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of LogsLogStream. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByResourceGroup(String resourceGroupName, String name); + + /** + * Delete a LogsLogStream. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of LogsLogStream. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String name, Context context); + + /** + * Get a LogsLogStream. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a LogsLogStream along with {@link Response}. + */ + LogsLogStream getById(String id); + + /** + * Get a LogsLogStream. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a LogsLogStream along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Delete a LogsLogStream. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteById(String id); + + /** + * Delete a LogsLogStream. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new LogsLogStream resource. + * + * @param name resource name. + * @return the first stage of the new LogsLogStream definition. + */ + LogsLogStream.DefinitionStages.Blank define(String name); +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/LogsMetricFilter.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/LogsMetricFilter.java new file mode 100644 index 000000000000..7edc4927baf6 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/LogsMetricFilter.java @@ -0,0 +1,252 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.awsconnector.fluent.models.LogsMetricFilterInner; +import java.util.Map; + +/** + * An immutable client-side representation of LogsMetricFilter. + */ +public interface LogsMetricFilter { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the location property: The geo-location where the resource lives. + * + * @return the location value. + */ + String location(); + + /** + * Gets the tags property: Resource tags. + * + * @return the tags value. + */ + Map tags(); + + /** + * Gets the properties property: The resource-specific properties for this resource. + * + * @return the properties value. + */ + LogsMetricFilterProperties properties(); + + /** + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the region of the resource. + * + * @return the region of the resource. + */ + Region region(); + + /** + * Gets the name of the resource region. + * + * @return the name of the resource region. + */ + String regionName(); + + /** + * Gets the name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + + /** + * Gets the inner com.azure.resourcemanager.awsconnector.fluent.models.LogsMetricFilterInner object. + * + * @return the inner object. + */ + LogsMetricFilterInner innerModel(); + + /** + * The entirety of the LogsMetricFilter definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithLocation, + DefinitionStages.WithResourceGroup, DefinitionStages.WithCreate { + } + + /** + * The LogsMetricFilter definition stages. + */ + interface DefinitionStages { + /** + * The first stage of the LogsMetricFilter definition. + */ + interface Blank extends WithLocation { + } + + /** + * The stage of the LogsMetricFilter definition allowing to specify location. + */ + interface WithLocation { + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithResourceGroup withRegion(Region location); + + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithResourceGroup withRegion(String location); + } + + /** + * The stage of the LogsMetricFilter definition allowing to specify parent resource. + */ + interface WithResourceGroup { + /** + * Specifies resourceGroupName. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @return the next definition stage. + */ + WithCreate withExistingResourceGroup(String resourceGroupName); + } + + /** + * The stage of the LogsMetricFilter 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.WithProperties { + /** + * Executes the create request. + * + * @return the created resource. + */ + LogsMetricFilter create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + LogsMetricFilter create(Context context); + } + + /** + * The stage of the LogsMetricFilter definition allowing to specify tags. + */ + interface WithTags { + /** + * Specifies the tags property: Resource tags.. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + WithCreate withTags(Map tags); + } + + /** + * The stage of the LogsMetricFilter definition allowing to specify properties. + */ + interface WithProperties { + /** + * Specifies the properties property: The resource-specific properties for this resource.. + * + * @param properties The resource-specific properties for this resource. + * @return the next definition stage. + */ + WithCreate withProperties(LogsMetricFilterProperties properties); + } + } + + /** + * Begins update for the LogsMetricFilter resource. + * + * @return the stage of resource update. + */ + LogsMetricFilter.Update update(); + + /** + * The template for LogsMetricFilter update. + */ + interface Update extends UpdateStages.WithTags { + /** + * Executes the update request. + * + * @return the updated resource. + */ + LogsMetricFilter apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + LogsMetricFilter apply(Context context); + } + + /** + * The LogsMetricFilter update stages. + */ + interface UpdateStages { + /** + * The stage of the LogsMetricFilter update allowing to specify tags. + */ + interface WithTags { + /** + * Specifies the tags property: Resource tags.. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + Update withTags(Map tags); + } + } + + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + LogsMetricFilter refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + LogsMetricFilter refresh(Context context); +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/LogsMetricFilterListResult.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/LogsMetricFilterListResult.java new file mode 100644 index 000000000000..70b3baa4e36f --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/LogsMetricFilterListResult.java @@ -0,0 +1,136 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.awsconnector.fluent.models.LogsMetricFilterInner; +import java.io.IOException; +import java.util.List; + +/** + * The response of a LogsMetricFilter list operation. + */ +@Fluent +public final class LogsMetricFilterListResult implements JsonSerializable { + /* + * The LogsMetricFilter items on this page + */ + private List value; + + /* + * The link to the next page of items + */ + private String nextLink; + + /** + * Creates an instance of LogsMetricFilterListResult class. + */ + public LogsMetricFilterListResult() { + } + + /** + * Get the value property: The LogsMetricFilter items on this page. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The LogsMetricFilter items on this page. + * + * @param value the value value to set. + * @return the LogsMetricFilterListResult object itself. + */ + public LogsMetricFilterListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The link to the next page of items. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: The link to the next page of items. + * + * @param nextLink the nextLink value to set. + * @return the LogsMetricFilterListResult object itself. + */ + public LogsMetricFilterListResult withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property value in model LogsMetricFilterListResult")); + } else { + value().forEach(e -> e.validate()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(LogsMetricFilterListResult.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("nextLink", this.nextLink); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of LogsMetricFilterListResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of LogsMetricFilterListResult if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the LogsMetricFilterListResult. + */ + public static LogsMetricFilterListResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + LogsMetricFilterListResult deserializedLogsMetricFilterListResult = new LogsMetricFilterListResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> LogsMetricFilterInner.fromJson(reader1)); + deserializedLogsMetricFilterListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedLogsMetricFilterListResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedLogsMetricFilterListResult; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/LogsMetricFilterProperties.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/LogsMetricFilterProperties.java new file mode 100644 index 000000000000..90e882e978c3 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/LogsMetricFilterProperties.java @@ -0,0 +1,312 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.Map; + +/** + * Definition of LogsMetricFilter. + */ +@Fluent +public final class LogsMetricFilterProperties implements JsonSerializable { + /* + * AWS Properties + */ + private AwsLogsMetricFilterProperties awsProperties; + + /* + * Public Cloud Connectors Resource ID + */ + private String publicCloudConnectorsResourceId; + + /* + * AWS Account ID + */ + private String awsAccountId; + + /* + * Amazon Resource Name (ARN) + */ + private String arn; + + /* + * Public Cloud Resource Name + */ + private String publicCloudResourceName; + + /* + * AWS Source Schema + */ + private String awsSourceSchema; + + /* + * AWS Region + */ + private String awsRegion; + + /* + * AWS Tags + */ + private Map awsTags; + + /* + * The status of the last operation. + */ + private ProvisioningState provisioningState; + + /** + * Creates an instance of LogsMetricFilterProperties class. + */ + public LogsMetricFilterProperties() { + } + + /** + * Get the awsProperties property: AWS Properties. + * + * @return the awsProperties value. + */ + public AwsLogsMetricFilterProperties awsProperties() { + return this.awsProperties; + } + + /** + * Set the awsProperties property: AWS Properties. + * + * @param awsProperties the awsProperties value to set. + * @return the LogsMetricFilterProperties object itself. + */ + public LogsMetricFilterProperties withAwsProperties(AwsLogsMetricFilterProperties awsProperties) { + this.awsProperties = awsProperties; + return this; + } + + /** + * Get the publicCloudConnectorsResourceId property: Public Cloud Connectors Resource ID. + * + * @return the publicCloudConnectorsResourceId value. + */ + public String publicCloudConnectorsResourceId() { + return this.publicCloudConnectorsResourceId; + } + + /** + * Set the publicCloudConnectorsResourceId property: Public Cloud Connectors Resource ID. + * + * @param publicCloudConnectorsResourceId the publicCloudConnectorsResourceId value to set. + * @return the LogsMetricFilterProperties object itself. + */ + public LogsMetricFilterProperties withPublicCloudConnectorsResourceId(String publicCloudConnectorsResourceId) { + this.publicCloudConnectorsResourceId = publicCloudConnectorsResourceId; + return this; + } + + /** + * Get the awsAccountId property: AWS Account ID. + * + * @return the awsAccountId value. + */ + public String awsAccountId() { + return this.awsAccountId; + } + + /** + * Set the awsAccountId property: AWS Account ID. + * + * @param awsAccountId the awsAccountId value to set. + * @return the LogsMetricFilterProperties object itself. + */ + public LogsMetricFilterProperties withAwsAccountId(String awsAccountId) { + this.awsAccountId = awsAccountId; + return this; + } + + /** + * Get the arn property: Amazon Resource Name (ARN). + * + * @return the arn value. + */ + public String arn() { + return this.arn; + } + + /** + * Set the arn property: Amazon Resource Name (ARN). + * + * @param arn the arn value to set. + * @return the LogsMetricFilterProperties object itself. + */ + public LogsMetricFilterProperties withArn(String arn) { + this.arn = arn; + return this; + } + + /** + * Get the publicCloudResourceName property: Public Cloud Resource Name. + * + * @return the publicCloudResourceName value. + */ + public String publicCloudResourceName() { + return this.publicCloudResourceName; + } + + /** + * Set the publicCloudResourceName property: Public Cloud Resource Name. + * + * @param publicCloudResourceName the publicCloudResourceName value to set. + * @return the LogsMetricFilterProperties object itself. + */ + public LogsMetricFilterProperties withPublicCloudResourceName(String publicCloudResourceName) { + this.publicCloudResourceName = publicCloudResourceName; + return this; + } + + /** + * Get the awsSourceSchema property: AWS Source Schema. + * + * @return the awsSourceSchema value. + */ + public String awsSourceSchema() { + return this.awsSourceSchema; + } + + /** + * Set the awsSourceSchema property: AWS Source Schema. + * + * @param awsSourceSchema the awsSourceSchema value to set. + * @return the LogsMetricFilterProperties object itself. + */ + public LogsMetricFilterProperties withAwsSourceSchema(String awsSourceSchema) { + this.awsSourceSchema = awsSourceSchema; + return this; + } + + /** + * Get the awsRegion property: AWS Region. + * + * @return the awsRegion value. + */ + public String awsRegion() { + return this.awsRegion; + } + + /** + * Set the awsRegion property: AWS Region. + * + * @param awsRegion the awsRegion value to set. + * @return the LogsMetricFilterProperties object itself. + */ + public LogsMetricFilterProperties withAwsRegion(String awsRegion) { + this.awsRegion = awsRegion; + return this; + } + + /** + * Get the awsTags property: AWS Tags. + * + * @return the awsTags value. + */ + public Map awsTags() { + return this.awsTags; + } + + /** + * Set the awsTags property: AWS Tags. + * + * @param awsTags the awsTags value to set. + * @return the LogsMetricFilterProperties object itself. + */ + public LogsMetricFilterProperties withAwsTags(Map awsTags) { + this.awsTags = awsTags; + return this; + } + + /** + * Get the provisioningState property: The status of the last operation. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (awsProperties() != null) { + awsProperties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("awsProperties", this.awsProperties); + jsonWriter.writeStringField("publicCloudConnectorsResourceId", this.publicCloudConnectorsResourceId); + jsonWriter.writeStringField("awsAccountId", this.awsAccountId); + jsonWriter.writeStringField("arn", this.arn); + jsonWriter.writeStringField("publicCloudResourceName", this.publicCloudResourceName); + jsonWriter.writeStringField("awsSourceSchema", this.awsSourceSchema); + jsonWriter.writeStringField("awsRegion", this.awsRegion); + jsonWriter.writeMapField("awsTags", this.awsTags, (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of LogsMetricFilterProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of LogsMetricFilterProperties if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IOException If an error occurs while reading the LogsMetricFilterProperties. + */ + public static LogsMetricFilterProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + LogsMetricFilterProperties deserializedLogsMetricFilterProperties = new LogsMetricFilterProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("awsProperties".equals(fieldName)) { + deserializedLogsMetricFilterProperties.awsProperties + = AwsLogsMetricFilterProperties.fromJson(reader); + } else if ("publicCloudConnectorsResourceId".equals(fieldName)) { + deserializedLogsMetricFilterProperties.publicCloudConnectorsResourceId = reader.getString(); + } else if ("awsAccountId".equals(fieldName)) { + deserializedLogsMetricFilterProperties.awsAccountId = reader.getString(); + } else if ("arn".equals(fieldName)) { + deserializedLogsMetricFilterProperties.arn = reader.getString(); + } else if ("publicCloudResourceName".equals(fieldName)) { + deserializedLogsMetricFilterProperties.publicCloudResourceName = reader.getString(); + } else if ("awsSourceSchema".equals(fieldName)) { + deserializedLogsMetricFilterProperties.awsSourceSchema = reader.getString(); + } else if ("awsRegion".equals(fieldName)) { + deserializedLogsMetricFilterProperties.awsRegion = reader.getString(); + } else if ("awsTags".equals(fieldName)) { + Map awsTags = reader.readMap(reader1 -> reader1.getString()); + deserializedLogsMetricFilterProperties.awsTags = awsTags; + } else if ("provisioningState".equals(fieldName)) { + deserializedLogsMetricFilterProperties.provisioningState + = ProvisioningState.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedLogsMetricFilterProperties; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/LogsMetricFilterTagsUpdate.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/LogsMetricFilterTagsUpdate.java new file mode 100644 index 000000000000..9b1b46bd7711 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/LogsMetricFilterTagsUpdate.java @@ -0,0 +1,95 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.Map; + +/** + * The type used for updating tags in LogsMetricFilter resources. + */ +@Fluent +public final class LogsMetricFilterTagsUpdate implements JsonSerializable { + /* + * Resource tags. + */ + private Map tags; + + /** + * Creates an instance of LogsMetricFilterTagsUpdate class. + */ + public LogsMetricFilterTagsUpdate() { + } + + /** + * Get the tags property: Resource tags. + * + * @return the tags value. + */ + public Map tags() { + return this.tags; + } + + /** + * Set the tags property: Resource tags. + * + * @param tags the tags value to set. + * @return the LogsMetricFilterTagsUpdate object itself. + */ + public LogsMetricFilterTagsUpdate withTags(Map tags) { + this.tags = tags; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeMapField("tags", this.tags, (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of LogsMetricFilterTagsUpdate from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of LogsMetricFilterTagsUpdate if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IOException If an error occurs while reading the LogsMetricFilterTagsUpdate. + */ + public static LogsMetricFilterTagsUpdate fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + LogsMetricFilterTagsUpdate deserializedLogsMetricFilterTagsUpdate = new LogsMetricFilterTagsUpdate(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedLogsMetricFilterTagsUpdate.tags = tags; + } else { + reader.skipChildren(); + } + } + + return deserializedLogsMetricFilterTagsUpdate; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/LogsMetricFilters.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/LogsMetricFilters.java new file mode 100644 index 000000000000..29b9b97975d3 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/LogsMetricFilters.java @@ -0,0 +1,157 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** + * Resource collection API of LogsMetricFilters. + */ +public interface LogsMetricFilters { + /** + * List LogsMetricFilter resources by subscription ID. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a LogsMetricFilter list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable list(); + + /** + * List LogsMetricFilter resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a LogsMetricFilter list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable list(Context context); + + /** + * List LogsMetricFilter resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a LogsMetricFilter list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * List LogsMetricFilter resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a LogsMetricFilter list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Get a LogsMetricFilter. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of LogsMetricFilter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a LogsMetricFilter along with {@link Response}. + */ + Response getByResourceGroupWithResponse(String resourceGroupName, String name, Context context); + + /** + * Get a LogsMetricFilter. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of LogsMetricFilter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a LogsMetricFilter. + */ + LogsMetricFilter getByResourceGroup(String resourceGroupName, String name); + + /** + * Delete a LogsMetricFilter. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of LogsMetricFilter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByResourceGroup(String resourceGroupName, String name); + + /** + * Delete a LogsMetricFilter. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of LogsMetricFilter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String name, Context context); + + /** + * Get a LogsMetricFilter. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a LogsMetricFilter along with {@link Response}. + */ + LogsMetricFilter getById(String id); + + /** + * Get a LogsMetricFilter. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a LogsMetricFilter along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Delete a LogsMetricFilter. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteById(String id); + + /** + * Delete a LogsMetricFilter. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new LogsMetricFilter resource. + * + * @param name resource name. + * @return the first stage of the new LogsMetricFilter definition. + */ + LogsMetricFilter.DefinitionStages.Blank define(String name); +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/LogsSubscriptionFilter.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/LogsSubscriptionFilter.java new file mode 100644 index 000000000000..89f76e124ef0 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/LogsSubscriptionFilter.java @@ -0,0 +1,252 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.awsconnector.fluent.models.LogsSubscriptionFilterInner; +import java.util.Map; + +/** + * An immutable client-side representation of LogsSubscriptionFilter. + */ +public interface LogsSubscriptionFilter { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the location property: The geo-location where the resource lives. + * + * @return the location value. + */ + String location(); + + /** + * Gets the tags property: Resource tags. + * + * @return the tags value. + */ + Map tags(); + + /** + * Gets the properties property: The resource-specific properties for this resource. + * + * @return the properties value. + */ + LogsSubscriptionFilterProperties properties(); + + /** + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the region of the resource. + * + * @return the region of the resource. + */ + Region region(); + + /** + * Gets the name of the resource region. + * + * @return the name of the resource region. + */ + String regionName(); + + /** + * Gets the name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + + /** + * Gets the inner com.azure.resourcemanager.awsconnector.fluent.models.LogsSubscriptionFilterInner object. + * + * @return the inner object. + */ + LogsSubscriptionFilterInner innerModel(); + + /** + * The entirety of the LogsSubscriptionFilter definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithLocation, + DefinitionStages.WithResourceGroup, DefinitionStages.WithCreate { + } + + /** + * The LogsSubscriptionFilter definition stages. + */ + interface DefinitionStages { + /** + * The first stage of the LogsSubscriptionFilter definition. + */ + interface Blank extends WithLocation { + } + + /** + * The stage of the LogsSubscriptionFilter definition allowing to specify location. + */ + interface WithLocation { + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithResourceGroup withRegion(Region location); + + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithResourceGroup withRegion(String location); + } + + /** + * The stage of the LogsSubscriptionFilter definition allowing to specify parent resource. + */ + interface WithResourceGroup { + /** + * Specifies resourceGroupName. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @return the next definition stage. + */ + WithCreate withExistingResourceGroup(String resourceGroupName); + } + + /** + * The stage of the LogsSubscriptionFilter 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.WithProperties { + /** + * Executes the create request. + * + * @return the created resource. + */ + LogsSubscriptionFilter create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + LogsSubscriptionFilter create(Context context); + } + + /** + * The stage of the LogsSubscriptionFilter definition allowing to specify tags. + */ + interface WithTags { + /** + * Specifies the tags property: Resource tags.. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + WithCreate withTags(Map tags); + } + + /** + * The stage of the LogsSubscriptionFilter definition allowing to specify properties. + */ + interface WithProperties { + /** + * Specifies the properties property: The resource-specific properties for this resource.. + * + * @param properties The resource-specific properties for this resource. + * @return the next definition stage. + */ + WithCreate withProperties(LogsSubscriptionFilterProperties properties); + } + } + + /** + * Begins update for the LogsSubscriptionFilter resource. + * + * @return the stage of resource update. + */ + LogsSubscriptionFilter.Update update(); + + /** + * The template for LogsSubscriptionFilter update. + */ + interface Update extends UpdateStages.WithTags { + /** + * Executes the update request. + * + * @return the updated resource. + */ + LogsSubscriptionFilter apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + LogsSubscriptionFilter apply(Context context); + } + + /** + * The LogsSubscriptionFilter update stages. + */ + interface UpdateStages { + /** + * The stage of the LogsSubscriptionFilter update allowing to specify tags. + */ + interface WithTags { + /** + * Specifies the tags property: Resource tags.. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + Update withTags(Map tags); + } + } + + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + LogsSubscriptionFilter refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + LogsSubscriptionFilter refresh(Context context); +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/LogsSubscriptionFilterListResult.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/LogsSubscriptionFilterListResult.java new file mode 100644 index 000000000000..ccdbc59df7ec --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/LogsSubscriptionFilterListResult.java @@ -0,0 +1,137 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.awsconnector.fluent.models.LogsSubscriptionFilterInner; +import java.io.IOException; +import java.util.List; + +/** + * The response of a LogsSubscriptionFilter list operation. + */ +@Fluent +public final class LogsSubscriptionFilterListResult implements JsonSerializable { + /* + * The LogsSubscriptionFilter items on this page + */ + private List value; + + /* + * The link to the next page of items + */ + private String nextLink; + + /** + * Creates an instance of LogsSubscriptionFilterListResult class. + */ + public LogsSubscriptionFilterListResult() { + } + + /** + * Get the value property: The LogsSubscriptionFilter items on this page. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The LogsSubscriptionFilter items on this page. + * + * @param value the value value to set. + * @return the LogsSubscriptionFilterListResult object itself. + */ + public LogsSubscriptionFilterListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The link to the next page of items. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: The link to the next page of items. + * + * @param nextLink the nextLink value to set. + * @return the LogsSubscriptionFilterListResult object itself. + */ + public LogsSubscriptionFilterListResult withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property value in model LogsSubscriptionFilterListResult")); + } else { + value().forEach(e -> e.validate()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(LogsSubscriptionFilterListResult.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("nextLink", this.nextLink); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of LogsSubscriptionFilterListResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of LogsSubscriptionFilterListResult if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the LogsSubscriptionFilterListResult. + */ + public static LogsSubscriptionFilterListResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + LogsSubscriptionFilterListResult deserializedLogsSubscriptionFilterListResult + = new LogsSubscriptionFilterListResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> LogsSubscriptionFilterInner.fromJson(reader1)); + deserializedLogsSubscriptionFilterListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedLogsSubscriptionFilterListResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedLogsSubscriptionFilterListResult; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/LogsSubscriptionFilterProperties.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/LogsSubscriptionFilterProperties.java new file mode 100644 index 000000000000..bd36ee8d4e50 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/LogsSubscriptionFilterProperties.java @@ -0,0 +1,314 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.Map; + +/** + * Definition of LogsSubscriptionFilter. + */ +@Fluent +public final class LogsSubscriptionFilterProperties implements JsonSerializable { + /* + * AWS Properties + */ + private AwsLogsSubscriptionFilterProperties awsProperties; + + /* + * Public Cloud Connectors Resource ID + */ + private String publicCloudConnectorsResourceId; + + /* + * AWS Account ID + */ + private String awsAccountId; + + /* + * Amazon Resource Name (ARN) + */ + private String arn; + + /* + * Public Cloud Resource Name + */ + private String publicCloudResourceName; + + /* + * AWS Source Schema + */ + private String awsSourceSchema; + + /* + * AWS Region + */ + private String awsRegion; + + /* + * AWS Tags + */ + private Map awsTags; + + /* + * The status of the last operation. + */ + private ProvisioningState provisioningState; + + /** + * Creates an instance of LogsSubscriptionFilterProperties class. + */ + public LogsSubscriptionFilterProperties() { + } + + /** + * Get the awsProperties property: AWS Properties. + * + * @return the awsProperties value. + */ + public AwsLogsSubscriptionFilterProperties awsProperties() { + return this.awsProperties; + } + + /** + * Set the awsProperties property: AWS Properties. + * + * @param awsProperties the awsProperties value to set. + * @return the LogsSubscriptionFilterProperties object itself. + */ + public LogsSubscriptionFilterProperties withAwsProperties(AwsLogsSubscriptionFilterProperties awsProperties) { + this.awsProperties = awsProperties; + return this; + } + + /** + * Get the publicCloudConnectorsResourceId property: Public Cloud Connectors Resource ID. + * + * @return the publicCloudConnectorsResourceId value. + */ + public String publicCloudConnectorsResourceId() { + return this.publicCloudConnectorsResourceId; + } + + /** + * Set the publicCloudConnectorsResourceId property: Public Cloud Connectors Resource ID. + * + * @param publicCloudConnectorsResourceId the publicCloudConnectorsResourceId value to set. + * @return the LogsSubscriptionFilterProperties object itself. + */ + public LogsSubscriptionFilterProperties + withPublicCloudConnectorsResourceId(String publicCloudConnectorsResourceId) { + this.publicCloudConnectorsResourceId = publicCloudConnectorsResourceId; + return this; + } + + /** + * Get the awsAccountId property: AWS Account ID. + * + * @return the awsAccountId value. + */ + public String awsAccountId() { + return this.awsAccountId; + } + + /** + * Set the awsAccountId property: AWS Account ID. + * + * @param awsAccountId the awsAccountId value to set. + * @return the LogsSubscriptionFilterProperties object itself. + */ + public LogsSubscriptionFilterProperties withAwsAccountId(String awsAccountId) { + this.awsAccountId = awsAccountId; + return this; + } + + /** + * Get the arn property: Amazon Resource Name (ARN). + * + * @return the arn value. + */ + public String arn() { + return this.arn; + } + + /** + * Set the arn property: Amazon Resource Name (ARN). + * + * @param arn the arn value to set. + * @return the LogsSubscriptionFilterProperties object itself. + */ + public LogsSubscriptionFilterProperties withArn(String arn) { + this.arn = arn; + return this; + } + + /** + * Get the publicCloudResourceName property: Public Cloud Resource Name. + * + * @return the publicCloudResourceName value. + */ + public String publicCloudResourceName() { + return this.publicCloudResourceName; + } + + /** + * Set the publicCloudResourceName property: Public Cloud Resource Name. + * + * @param publicCloudResourceName the publicCloudResourceName value to set. + * @return the LogsSubscriptionFilterProperties object itself. + */ + public LogsSubscriptionFilterProperties withPublicCloudResourceName(String publicCloudResourceName) { + this.publicCloudResourceName = publicCloudResourceName; + return this; + } + + /** + * Get the awsSourceSchema property: AWS Source Schema. + * + * @return the awsSourceSchema value. + */ + public String awsSourceSchema() { + return this.awsSourceSchema; + } + + /** + * Set the awsSourceSchema property: AWS Source Schema. + * + * @param awsSourceSchema the awsSourceSchema value to set. + * @return the LogsSubscriptionFilterProperties object itself. + */ + public LogsSubscriptionFilterProperties withAwsSourceSchema(String awsSourceSchema) { + this.awsSourceSchema = awsSourceSchema; + return this; + } + + /** + * Get the awsRegion property: AWS Region. + * + * @return the awsRegion value. + */ + public String awsRegion() { + return this.awsRegion; + } + + /** + * Set the awsRegion property: AWS Region. + * + * @param awsRegion the awsRegion value to set. + * @return the LogsSubscriptionFilterProperties object itself. + */ + public LogsSubscriptionFilterProperties withAwsRegion(String awsRegion) { + this.awsRegion = awsRegion; + return this; + } + + /** + * Get the awsTags property: AWS Tags. + * + * @return the awsTags value. + */ + public Map awsTags() { + return this.awsTags; + } + + /** + * Set the awsTags property: AWS Tags. + * + * @param awsTags the awsTags value to set. + * @return the LogsSubscriptionFilterProperties object itself. + */ + public LogsSubscriptionFilterProperties withAwsTags(Map awsTags) { + this.awsTags = awsTags; + return this; + } + + /** + * Get the provisioningState property: The status of the last operation. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (awsProperties() != null) { + awsProperties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("awsProperties", this.awsProperties); + jsonWriter.writeStringField("publicCloudConnectorsResourceId", this.publicCloudConnectorsResourceId); + jsonWriter.writeStringField("awsAccountId", this.awsAccountId); + jsonWriter.writeStringField("arn", this.arn); + jsonWriter.writeStringField("publicCloudResourceName", this.publicCloudResourceName); + jsonWriter.writeStringField("awsSourceSchema", this.awsSourceSchema); + jsonWriter.writeStringField("awsRegion", this.awsRegion); + jsonWriter.writeMapField("awsTags", this.awsTags, (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of LogsSubscriptionFilterProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of LogsSubscriptionFilterProperties if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the LogsSubscriptionFilterProperties. + */ + public static LogsSubscriptionFilterProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + LogsSubscriptionFilterProperties deserializedLogsSubscriptionFilterProperties + = new LogsSubscriptionFilterProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("awsProperties".equals(fieldName)) { + deserializedLogsSubscriptionFilterProperties.awsProperties + = AwsLogsSubscriptionFilterProperties.fromJson(reader); + } else if ("publicCloudConnectorsResourceId".equals(fieldName)) { + deserializedLogsSubscriptionFilterProperties.publicCloudConnectorsResourceId = reader.getString(); + } else if ("awsAccountId".equals(fieldName)) { + deserializedLogsSubscriptionFilterProperties.awsAccountId = reader.getString(); + } else if ("arn".equals(fieldName)) { + deserializedLogsSubscriptionFilterProperties.arn = reader.getString(); + } else if ("publicCloudResourceName".equals(fieldName)) { + deserializedLogsSubscriptionFilterProperties.publicCloudResourceName = reader.getString(); + } else if ("awsSourceSchema".equals(fieldName)) { + deserializedLogsSubscriptionFilterProperties.awsSourceSchema = reader.getString(); + } else if ("awsRegion".equals(fieldName)) { + deserializedLogsSubscriptionFilterProperties.awsRegion = reader.getString(); + } else if ("awsTags".equals(fieldName)) { + Map awsTags = reader.readMap(reader1 -> reader1.getString()); + deserializedLogsSubscriptionFilterProperties.awsTags = awsTags; + } else if ("provisioningState".equals(fieldName)) { + deserializedLogsSubscriptionFilterProperties.provisioningState + = ProvisioningState.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedLogsSubscriptionFilterProperties; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/LogsSubscriptionFilterTagsUpdate.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/LogsSubscriptionFilterTagsUpdate.java new file mode 100644 index 000000000000..24f33a7bdda6 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/LogsSubscriptionFilterTagsUpdate.java @@ -0,0 +1,96 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.Map; + +/** + * The type used for updating tags in LogsSubscriptionFilter resources. + */ +@Fluent +public final class LogsSubscriptionFilterTagsUpdate implements JsonSerializable { + /* + * Resource tags. + */ + private Map tags; + + /** + * Creates an instance of LogsSubscriptionFilterTagsUpdate class. + */ + public LogsSubscriptionFilterTagsUpdate() { + } + + /** + * Get the tags property: Resource tags. + * + * @return the tags value. + */ + public Map tags() { + return this.tags; + } + + /** + * Set the tags property: Resource tags. + * + * @param tags the tags value to set. + * @return the LogsSubscriptionFilterTagsUpdate object itself. + */ + public LogsSubscriptionFilterTagsUpdate withTags(Map tags) { + this.tags = tags; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeMapField("tags", this.tags, (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of LogsSubscriptionFilterTagsUpdate from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of LogsSubscriptionFilterTagsUpdate if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the LogsSubscriptionFilterTagsUpdate. + */ + public static LogsSubscriptionFilterTagsUpdate fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + LogsSubscriptionFilterTagsUpdate deserializedLogsSubscriptionFilterTagsUpdate + = new LogsSubscriptionFilterTagsUpdate(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedLogsSubscriptionFilterTagsUpdate.tags = tags; + } else { + reader.skipChildren(); + } + } + + return deserializedLogsSubscriptionFilterTagsUpdate; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/LogsSubscriptionFilters.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/LogsSubscriptionFilters.java new file mode 100644 index 000000000000..127f4fbf2cb9 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/LogsSubscriptionFilters.java @@ -0,0 +1,158 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** + * Resource collection API of LogsSubscriptionFilters. + */ +public interface LogsSubscriptionFilters { + /** + * List LogsSubscriptionFilter resources by subscription ID. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a LogsSubscriptionFilter list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable list(); + + /** + * List LogsSubscriptionFilter resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a LogsSubscriptionFilter list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable list(Context context); + + /** + * List LogsSubscriptionFilter resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a LogsSubscriptionFilter list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * List LogsSubscriptionFilter resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a LogsSubscriptionFilter list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Get a LogsSubscriptionFilter. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of LogsSubscriptionFilter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a LogsSubscriptionFilter along with {@link Response}. + */ + Response getByResourceGroupWithResponse(String resourceGroupName, String name, + Context context); + + /** + * Get a LogsSubscriptionFilter. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of LogsSubscriptionFilter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a LogsSubscriptionFilter. + */ + LogsSubscriptionFilter getByResourceGroup(String resourceGroupName, String name); + + /** + * Delete a LogsSubscriptionFilter. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of LogsSubscriptionFilter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByResourceGroup(String resourceGroupName, String name); + + /** + * Delete a LogsSubscriptionFilter. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of LogsSubscriptionFilter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String name, Context context); + + /** + * Get a LogsSubscriptionFilter. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a LogsSubscriptionFilter along with {@link Response}. + */ + LogsSubscriptionFilter getById(String id); + + /** + * Get a LogsSubscriptionFilter. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a LogsSubscriptionFilter along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Delete a LogsSubscriptionFilter. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteById(String id); + + /** + * Delete a LogsSubscriptionFilter. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new LogsSubscriptionFilter resource. + * + * @param name resource name. + * @return the first stage of the new LogsSubscriptionFilter definition. + */ + LogsSubscriptionFilter.DefinitionStages.Blank define(String name); +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/Macie2JobSummaries.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/Macie2JobSummaries.java new file mode 100644 index 000000000000..70c08e6a3fb9 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/Macie2JobSummaries.java @@ -0,0 +1,157 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** + * Resource collection API of Macie2JobSummaries. + */ +public interface Macie2JobSummaries { + /** + * List Macie2JobSummary resources by subscription ID. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Macie2JobSummary list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable list(); + + /** + * List Macie2JobSummary resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Macie2JobSummary list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable list(Context context); + + /** + * List Macie2JobSummary resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Macie2JobSummary list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * List Macie2JobSummary resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Macie2JobSummary list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Get a Macie2JobSummary. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Macie2JobSummary. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Macie2JobSummary along with {@link Response}. + */ + Response getByResourceGroupWithResponse(String resourceGroupName, String name, Context context); + + /** + * Get a Macie2JobSummary. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Macie2JobSummary. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Macie2JobSummary. + */ + Macie2JobSummary getByResourceGroup(String resourceGroupName, String name); + + /** + * Delete a Macie2JobSummary. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Macie2JobSummary. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByResourceGroup(String resourceGroupName, String name); + + /** + * Delete a Macie2JobSummary. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Macie2JobSummary. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String name, Context context); + + /** + * Get a Macie2JobSummary. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Macie2JobSummary along with {@link Response}. + */ + Macie2JobSummary getById(String id); + + /** + * Get a Macie2JobSummary. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Macie2JobSummary along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Delete a Macie2JobSummary. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteById(String id); + + /** + * Delete a Macie2JobSummary. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new Macie2JobSummary resource. + * + * @param name resource name. + * @return the first stage of the new Macie2JobSummary definition. + */ + Macie2JobSummary.DefinitionStages.Blank define(String name); +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/Macie2JobSummary.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/Macie2JobSummary.java new file mode 100644 index 000000000000..786f04e7140f --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/Macie2JobSummary.java @@ -0,0 +1,252 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.awsconnector.fluent.models.Macie2JobSummaryInner; +import java.util.Map; + +/** + * An immutable client-side representation of Macie2JobSummary. + */ +public interface Macie2JobSummary { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the location property: The geo-location where the resource lives. + * + * @return the location value. + */ + String location(); + + /** + * Gets the tags property: Resource tags. + * + * @return the tags value. + */ + Map tags(); + + /** + * Gets the properties property: The resource-specific properties for this resource. + * + * @return the properties value. + */ + Macie2JobSummaryProperties properties(); + + /** + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the region of the resource. + * + * @return the region of the resource. + */ + Region region(); + + /** + * Gets the name of the resource region. + * + * @return the name of the resource region. + */ + String regionName(); + + /** + * Gets the name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + + /** + * Gets the inner com.azure.resourcemanager.awsconnector.fluent.models.Macie2JobSummaryInner object. + * + * @return the inner object. + */ + Macie2JobSummaryInner innerModel(); + + /** + * The entirety of the Macie2JobSummary definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithLocation, + DefinitionStages.WithResourceGroup, DefinitionStages.WithCreate { + } + + /** + * The Macie2JobSummary definition stages. + */ + interface DefinitionStages { + /** + * The first stage of the Macie2JobSummary definition. + */ + interface Blank extends WithLocation { + } + + /** + * The stage of the Macie2JobSummary definition allowing to specify location. + */ + interface WithLocation { + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithResourceGroup withRegion(Region location); + + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithResourceGroup withRegion(String location); + } + + /** + * The stage of the Macie2JobSummary definition allowing to specify parent resource. + */ + interface WithResourceGroup { + /** + * Specifies resourceGroupName. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @return the next definition stage. + */ + WithCreate withExistingResourceGroup(String resourceGroupName); + } + + /** + * The stage of the Macie2JobSummary 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.WithProperties { + /** + * Executes the create request. + * + * @return the created resource. + */ + Macie2JobSummary create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + Macie2JobSummary create(Context context); + } + + /** + * The stage of the Macie2JobSummary definition allowing to specify tags. + */ + interface WithTags { + /** + * Specifies the tags property: Resource tags.. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + WithCreate withTags(Map tags); + } + + /** + * The stage of the Macie2JobSummary definition allowing to specify properties. + */ + interface WithProperties { + /** + * Specifies the properties property: The resource-specific properties for this resource.. + * + * @param properties The resource-specific properties for this resource. + * @return the next definition stage. + */ + WithCreate withProperties(Macie2JobSummaryProperties properties); + } + } + + /** + * Begins update for the Macie2JobSummary resource. + * + * @return the stage of resource update. + */ + Macie2JobSummary.Update update(); + + /** + * The template for Macie2JobSummary update. + */ + interface Update extends UpdateStages.WithTags { + /** + * Executes the update request. + * + * @return the updated resource. + */ + Macie2JobSummary apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + Macie2JobSummary apply(Context context); + } + + /** + * The Macie2JobSummary update stages. + */ + interface UpdateStages { + /** + * The stage of the Macie2JobSummary update allowing to specify tags. + */ + interface WithTags { + /** + * Specifies the tags property: Resource tags.. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + Update withTags(Map tags); + } + } + + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + Macie2JobSummary refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + Macie2JobSummary refresh(Context context); +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/Macie2JobSummaryListResult.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/Macie2JobSummaryListResult.java new file mode 100644 index 000000000000..8685c9583cc2 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/Macie2JobSummaryListResult.java @@ -0,0 +1,136 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.awsconnector.fluent.models.Macie2JobSummaryInner; +import java.io.IOException; +import java.util.List; + +/** + * The response of a Macie2JobSummary list operation. + */ +@Fluent +public final class Macie2JobSummaryListResult implements JsonSerializable { + /* + * The Macie2JobSummary items on this page + */ + private List value; + + /* + * The link to the next page of items + */ + private String nextLink; + + /** + * Creates an instance of Macie2JobSummaryListResult class. + */ + public Macie2JobSummaryListResult() { + } + + /** + * Get the value property: The Macie2JobSummary items on this page. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The Macie2JobSummary items on this page. + * + * @param value the value value to set. + * @return the Macie2JobSummaryListResult object itself. + */ + public Macie2JobSummaryListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The link to the next page of items. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: The link to the next page of items. + * + * @param nextLink the nextLink value to set. + * @return the Macie2JobSummaryListResult object itself. + */ + public Macie2JobSummaryListResult withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property value in model Macie2JobSummaryListResult")); + } else { + value().forEach(e -> e.validate()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(Macie2JobSummaryListResult.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("nextLink", this.nextLink); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of Macie2JobSummaryListResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of Macie2JobSummaryListResult if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the Macie2JobSummaryListResult. + */ + public static Macie2JobSummaryListResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + Macie2JobSummaryListResult deserializedMacie2JobSummaryListResult = new Macie2JobSummaryListResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> Macie2JobSummaryInner.fromJson(reader1)); + deserializedMacie2JobSummaryListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedMacie2JobSummaryListResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedMacie2JobSummaryListResult; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/Macie2JobSummaryProperties.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/Macie2JobSummaryProperties.java new file mode 100644 index 000000000000..7b0a1bed4b55 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/Macie2JobSummaryProperties.java @@ -0,0 +1,312 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.Map; + +/** + * Definition of Macie2JobSummary. + */ +@Fluent +public final class Macie2JobSummaryProperties implements JsonSerializable { + /* + * AWS Properties + */ + private AwsMacie2JobSummaryProperties awsProperties; + + /* + * Public Cloud Connectors Resource ID + */ + private String publicCloudConnectorsResourceId; + + /* + * AWS Account ID + */ + private String awsAccountId; + + /* + * Amazon Resource Name (ARN) + */ + private String arn; + + /* + * Public Cloud Resource Name + */ + private String publicCloudResourceName; + + /* + * AWS Source Schema + */ + private String awsSourceSchema; + + /* + * AWS Region + */ + private String awsRegion; + + /* + * AWS Tags + */ + private Map awsTags; + + /* + * The status of the last operation. + */ + private ProvisioningState provisioningState; + + /** + * Creates an instance of Macie2JobSummaryProperties class. + */ + public Macie2JobSummaryProperties() { + } + + /** + * Get the awsProperties property: AWS Properties. + * + * @return the awsProperties value. + */ + public AwsMacie2JobSummaryProperties awsProperties() { + return this.awsProperties; + } + + /** + * Set the awsProperties property: AWS Properties. + * + * @param awsProperties the awsProperties value to set. + * @return the Macie2JobSummaryProperties object itself. + */ + public Macie2JobSummaryProperties withAwsProperties(AwsMacie2JobSummaryProperties awsProperties) { + this.awsProperties = awsProperties; + return this; + } + + /** + * Get the publicCloudConnectorsResourceId property: Public Cloud Connectors Resource ID. + * + * @return the publicCloudConnectorsResourceId value. + */ + public String publicCloudConnectorsResourceId() { + return this.publicCloudConnectorsResourceId; + } + + /** + * Set the publicCloudConnectorsResourceId property: Public Cloud Connectors Resource ID. + * + * @param publicCloudConnectorsResourceId the publicCloudConnectorsResourceId value to set. + * @return the Macie2JobSummaryProperties object itself. + */ + public Macie2JobSummaryProperties withPublicCloudConnectorsResourceId(String publicCloudConnectorsResourceId) { + this.publicCloudConnectorsResourceId = publicCloudConnectorsResourceId; + return this; + } + + /** + * Get the awsAccountId property: AWS Account ID. + * + * @return the awsAccountId value. + */ + public String awsAccountId() { + return this.awsAccountId; + } + + /** + * Set the awsAccountId property: AWS Account ID. + * + * @param awsAccountId the awsAccountId value to set. + * @return the Macie2JobSummaryProperties object itself. + */ + public Macie2JobSummaryProperties withAwsAccountId(String awsAccountId) { + this.awsAccountId = awsAccountId; + return this; + } + + /** + * Get the arn property: Amazon Resource Name (ARN). + * + * @return the arn value. + */ + public String arn() { + return this.arn; + } + + /** + * Set the arn property: Amazon Resource Name (ARN). + * + * @param arn the arn value to set. + * @return the Macie2JobSummaryProperties object itself. + */ + public Macie2JobSummaryProperties withArn(String arn) { + this.arn = arn; + return this; + } + + /** + * Get the publicCloudResourceName property: Public Cloud Resource Name. + * + * @return the publicCloudResourceName value. + */ + public String publicCloudResourceName() { + return this.publicCloudResourceName; + } + + /** + * Set the publicCloudResourceName property: Public Cloud Resource Name. + * + * @param publicCloudResourceName the publicCloudResourceName value to set. + * @return the Macie2JobSummaryProperties object itself. + */ + public Macie2JobSummaryProperties withPublicCloudResourceName(String publicCloudResourceName) { + this.publicCloudResourceName = publicCloudResourceName; + return this; + } + + /** + * Get the awsSourceSchema property: AWS Source Schema. + * + * @return the awsSourceSchema value. + */ + public String awsSourceSchema() { + return this.awsSourceSchema; + } + + /** + * Set the awsSourceSchema property: AWS Source Schema. + * + * @param awsSourceSchema the awsSourceSchema value to set. + * @return the Macie2JobSummaryProperties object itself. + */ + public Macie2JobSummaryProperties withAwsSourceSchema(String awsSourceSchema) { + this.awsSourceSchema = awsSourceSchema; + return this; + } + + /** + * Get the awsRegion property: AWS Region. + * + * @return the awsRegion value. + */ + public String awsRegion() { + return this.awsRegion; + } + + /** + * Set the awsRegion property: AWS Region. + * + * @param awsRegion the awsRegion value to set. + * @return the Macie2JobSummaryProperties object itself. + */ + public Macie2JobSummaryProperties withAwsRegion(String awsRegion) { + this.awsRegion = awsRegion; + return this; + } + + /** + * Get the awsTags property: AWS Tags. + * + * @return the awsTags value. + */ + public Map awsTags() { + return this.awsTags; + } + + /** + * Set the awsTags property: AWS Tags. + * + * @param awsTags the awsTags value to set. + * @return the Macie2JobSummaryProperties object itself. + */ + public Macie2JobSummaryProperties withAwsTags(Map awsTags) { + this.awsTags = awsTags; + return this; + } + + /** + * Get the provisioningState property: The status of the last operation. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (awsProperties() != null) { + awsProperties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("awsProperties", this.awsProperties); + jsonWriter.writeStringField("publicCloudConnectorsResourceId", this.publicCloudConnectorsResourceId); + jsonWriter.writeStringField("awsAccountId", this.awsAccountId); + jsonWriter.writeStringField("arn", this.arn); + jsonWriter.writeStringField("publicCloudResourceName", this.publicCloudResourceName); + jsonWriter.writeStringField("awsSourceSchema", this.awsSourceSchema); + jsonWriter.writeStringField("awsRegion", this.awsRegion); + jsonWriter.writeMapField("awsTags", this.awsTags, (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of Macie2JobSummaryProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of Macie2JobSummaryProperties if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IOException If an error occurs while reading the Macie2JobSummaryProperties. + */ + public static Macie2JobSummaryProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + Macie2JobSummaryProperties deserializedMacie2JobSummaryProperties = new Macie2JobSummaryProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("awsProperties".equals(fieldName)) { + deserializedMacie2JobSummaryProperties.awsProperties + = AwsMacie2JobSummaryProperties.fromJson(reader); + } else if ("publicCloudConnectorsResourceId".equals(fieldName)) { + deserializedMacie2JobSummaryProperties.publicCloudConnectorsResourceId = reader.getString(); + } else if ("awsAccountId".equals(fieldName)) { + deserializedMacie2JobSummaryProperties.awsAccountId = reader.getString(); + } else if ("arn".equals(fieldName)) { + deserializedMacie2JobSummaryProperties.arn = reader.getString(); + } else if ("publicCloudResourceName".equals(fieldName)) { + deserializedMacie2JobSummaryProperties.publicCloudResourceName = reader.getString(); + } else if ("awsSourceSchema".equals(fieldName)) { + deserializedMacie2JobSummaryProperties.awsSourceSchema = reader.getString(); + } else if ("awsRegion".equals(fieldName)) { + deserializedMacie2JobSummaryProperties.awsRegion = reader.getString(); + } else if ("awsTags".equals(fieldName)) { + Map awsTags = reader.readMap(reader1 -> reader1.getString()); + deserializedMacie2JobSummaryProperties.awsTags = awsTags; + } else if ("provisioningState".equals(fieldName)) { + deserializedMacie2JobSummaryProperties.provisioningState + = ProvisioningState.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedMacie2JobSummaryProperties; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/Macie2JobSummaryTagsUpdate.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/Macie2JobSummaryTagsUpdate.java new file mode 100644 index 000000000000..102b2ea949a3 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/Macie2JobSummaryTagsUpdate.java @@ -0,0 +1,95 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.Map; + +/** + * The type used for updating tags in Macie2JobSummary resources. + */ +@Fluent +public final class Macie2JobSummaryTagsUpdate implements JsonSerializable { + /* + * Resource tags. + */ + private Map tags; + + /** + * Creates an instance of Macie2JobSummaryTagsUpdate class. + */ + public Macie2JobSummaryTagsUpdate() { + } + + /** + * Get the tags property: Resource tags. + * + * @return the tags value. + */ + public Map tags() { + return this.tags; + } + + /** + * Set the tags property: Resource tags. + * + * @param tags the tags value to set. + * @return the Macie2JobSummaryTagsUpdate object itself. + */ + public Macie2JobSummaryTagsUpdate withTags(Map tags) { + this.tags = tags; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeMapField("tags", this.tags, (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of Macie2JobSummaryTagsUpdate from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of Macie2JobSummaryTagsUpdate if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IOException If an error occurs while reading the Macie2JobSummaryTagsUpdate. + */ + public static Macie2JobSummaryTagsUpdate fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + Macie2JobSummaryTagsUpdate deserializedMacie2JobSummaryTagsUpdate = new Macie2JobSummaryTagsUpdate(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedMacie2JobSummaryTagsUpdate.tags = tags; + } else { + reader.skipChildren(); + } + } + + return deserializedMacie2JobSummaryTagsUpdate; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/MacieAllowList.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/MacieAllowList.java new file mode 100644 index 000000000000..470df572ced3 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/MacieAllowList.java @@ -0,0 +1,252 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.awsconnector.fluent.models.MacieAllowListInner; +import java.util.Map; + +/** + * An immutable client-side representation of MacieAllowList. + */ +public interface MacieAllowList { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the location property: The geo-location where the resource lives. + * + * @return the location value. + */ + String location(); + + /** + * Gets the tags property: Resource tags. + * + * @return the tags value. + */ + Map tags(); + + /** + * Gets the properties property: The resource-specific properties for this resource. + * + * @return the properties value. + */ + MacieAllowListProperties properties(); + + /** + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the region of the resource. + * + * @return the region of the resource. + */ + Region region(); + + /** + * Gets the name of the resource region. + * + * @return the name of the resource region. + */ + String regionName(); + + /** + * Gets the name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + + /** + * Gets the inner com.azure.resourcemanager.awsconnector.fluent.models.MacieAllowListInner object. + * + * @return the inner object. + */ + MacieAllowListInner innerModel(); + + /** + * The entirety of the MacieAllowList definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithLocation, + DefinitionStages.WithResourceGroup, DefinitionStages.WithCreate { + } + + /** + * The MacieAllowList definition stages. + */ + interface DefinitionStages { + /** + * The first stage of the MacieAllowList definition. + */ + interface Blank extends WithLocation { + } + + /** + * The stage of the MacieAllowList definition allowing to specify location. + */ + interface WithLocation { + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithResourceGroup withRegion(Region location); + + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithResourceGroup withRegion(String location); + } + + /** + * The stage of the MacieAllowList definition allowing to specify parent resource. + */ + interface WithResourceGroup { + /** + * Specifies resourceGroupName. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @return the next definition stage. + */ + WithCreate withExistingResourceGroup(String resourceGroupName); + } + + /** + * The stage of the MacieAllowList 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.WithProperties { + /** + * Executes the create request. + * + * @return the created resource. + */ + MacieAllowList create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + MacieAllowList create(Context context); + } + + /** + * The stage of the MacieAllowList definition allowing to specify tags. + */ + interface WithTags { + /** + * Specifies the tags property: Resource tags.. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + WithCreate withTags(Map tags); + } + + /** + * The stage of the MacieAllowList definition allowing to specify properties. + */ + interface WithProperties { + /** + * Specifies the properties property: The resource-specific properties for this resource.. + * + * @param properties The resource-specific properties for this resource. + * @return the next definition stage. + */ + WithCreate withProperties(MacieAllowListProperties properties); + } + } + + /** + * Begins update for the MacieAllowList resource. + * + * @return the stage of resource update. + */ + MacieAllowList.Update update(); + + /** + * The template for MacieAllowList update. + */ + interface Update extends UpdateStages.WithTags { + /** + * Executes the update request. + * + * @return the updated resource. + */ + MacieAllowList apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + MacieAllowList apply(Context context); + } + + /** + * The MacieAllowList update stages. + */ + interface UpdateStages { + /** + * The stage of the MacieAllowList update allowing to specify tags. + */ + interface WithTags { + /** + * Specifies the tags property: Resource tags.. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + Update withTags(Map tags); + } + } + + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + MacieAllowList refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + MacieAllowList refresh(Context context); +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/MacieAllowListProperties.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/MacieAllowListProperties.java new file mode 100644 index 000000000000..25b4afb08dbe --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/MacieAllowListProperties.java @@ -0,0 +1,311 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.Map; + +/** + * Definition of MacieAllowList. + */ +@Fluent +public final class MacieAllowListProperties implements JsonSerializable { + /* + * AWS Properties + */ + private AwsMacieAllowListProperties awsProperties; + + /* + * Public Cloud Connectors Resource ID + */ + private String publicCloudConnectorsResourceId; + + /* + * AWS Account ID + */ + private String awsAccountId; + + /* + * Amazon Resource Name (ARN) + */ + private String arn; + + /* + * Public Cloud Resource Name + */ + private String publicCloudResourceName; + + /* + * AWS Source Schema + */ + private String awsSourceSchema; + + /* + * AWS Region + */ + private String awsRegion; + + /* + * AWS Tags + */ + private Map awsTags; + + /* + * The status of the last operation. + */ + private ProvisioningState provisioningState; + + /** + * Creates an instance of MacieAllowListProperties class. + */ + public MacieAllowListProperties() { + } + + /** + * Get the awsProperties property: AWS Properties. + * + * @return the awsProperties value. + */ + public AwsMacieAllowListProperties awsProperties() { + return this.awsProperties; + } + + /** + * Set the awsProperties property: AWS Properties. + * + * @param awsProperties the awsProperties value to set. + * @return the MacieAllowListProperties object itself. + */ + public MacieAllowListProperties withAwsProperties(AwsMacieAllowListProperties awsProperties) { + this.awsProperties = awsProperties; + return this; + } + + /** + * Get the publicCloudConnectorsResourceId property: Public Cloud Connectors Resource ID. + * + * @return the publicCloudConnectorsResourceId value. + */ + public String publicCloudConnectorsResourceId() { + return this.publicCloudConnectorsResourceId; + } + + /** + * Set the publicCloudConnectorsResourceId property: Public Cloud Connectors Resource ID. + * + * @param publicCloudConnectorsResourceId the publicCloudConnectorsResourceId value to set. + * @return the MacieAllowListProperties object itself. + */ + public MacieAllowListProperties withPublicCloudConnectorsResourceId(String publicCloudConnectorsResourceId) { + this.publicCloudConnectorsResourceId = publicCloudConnectorsResourceId; + return this; + } + + /** + * Get the awsAccountId property: AWS Account ID. + * + * @return the awsAccountId value. + */ + public String awsAccountId() { + return this.awsAccountId; + } + + /** + * Set the awsAccountId property: AWS Account ID. + * + * @param awsAccountId the awsAccountId value to set. + * @return the MacieAllowListProperties object itself. + */ + public MacieAllowListProperties withAwsAccountId(String awsAccountId) { + this.awsAccountId = awsAccountId; + return this; + } + + /** + * Get the arn property: Amazon Resource Name (ARN). + * + * @return the arn value. + */ + public String arn() { + return this.arn; + } + + /** + * Set the arn property: Amazon Resource Name (ARN). + * + * @param arn the arn value to set. + * @return the MacieAllowListProperties object itself. + */ + public MacieAllowListProperties withArn(String arn) { + this.arn = arn; + return this; + } + + /** + * Get the publicCloudResourceName property: Public Cloud Resource Name. + * + * @return the publicCloudResourceName value. + */ + public String publicCloudResourceName() { + return this.publicCloudResourceName; + } + + /** + * Set the publicCloudResourceName property: Public Cloud Resource Name. + * + * @param publicCloudResourceName the publicCloudResourceName value to set. + * @return the MacieAllowListProperties object itself. + */ + public MacieAllowListProperties withPublicCloudResourceName(String publicCloudResourceName) { + this.publicCloudResourceName = publicCloudResourceName; + return this; + } + + /** + * Get the awsSourceSchema property: AWS Source Schema. + * + * @return the awsSourceSchema value. + */ + public String awsSourceSchema() { + return this.awsSourceSchema; + } + + /** + * Set the awsSourceSchema property: AWS Source Schema. + * + * @param awsSourceSchema the awsSourceSchema value to set. + * @return the MacieAllowListProperties object itself. + */ + public MacieAllowListProperties withAwsSourceSchema(String awsSourceSchema) { + this.awsSourceSchema = awsSourceSchema; + return this; + } + + /** + * Get the awsRegion property: AWS Region. + * + * @return the awsRegion value. + */ + public String awsRegion() { + return this.awsRegion; + } + + /** + * Set the awsRegion property: AWS Region. + * + * @param awsRegion the awsRegion value to set. + * @return the MacieAllowListProperties object itself. + */ + public MacieAllowListProperties withAwsRegion(String awsRegion) { + this.awsRegion = awsRegion; + return this; + } + + /** + * Get the awsTags property: AWS Tags. + * + * @return the awsTags value. + */ + public Map awsTags() { + return this.awsTags; + } + + /** + * Set the awsTags property: AWS Tags. + * + * @param awsTags the awsTags value to set. + * @return the MacieAllowListProperties object itself. + */ + public MacieAllowListProperties withAwsTags(Map awsTags) { + this.awsTags = awsTags; + return this; + } + + /** + * Get the provisioningState property: The status of the last operation. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (awsProperties() != null) { + awsProperties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("awsProperties", this.awsProperties); + jsonWriter.writeStringField("publicCloudConnectorsResourceId", this.publicCloudConnectorsResourceId); + jsonWriter.writeStringField("awsAccountId", this.awsAccountId); + jsonWriter.writeStringField("arn", this.arn); + jsonWriter.writeStringField("publicCloudResourceName", this.publicCloudResourceName); + jsonWriter.writeStringField("awsSourceSchema", this.awsSourceSchema); + jsonWriter.writeStringField("awsRegion", this.awsRegion); + jsonWriter.writeMapField("awsTags", this.awsTags, (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MacieAllowListProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MacieAllowListProperties if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IOException If an error occurs while reading the MacieAllowListProperties. + */ + public static MacieAllowListProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MacieAllowListProperties deserializedMacieAllowListProperties = new MacieAllowListProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("awsProperties".equals(fieldName)) { + deserializedMacieAllowListProperties.awsProperties = AwsMacieAllowListProperties.fromJson(reader); + } else if ("publicCloudConnectorsResourceId".equals(fieldName)) { + deserializedMacieAllowListProperties.publicCloudConnectorsResourceId = reader.getString(); + } else if ("awsAccountId".equals(fieldName)) { + deserializedMacieAllowListProperties.awsAccountId = reader.getString(); + } else if ("arn".equals(fieldName)) { + deserializedMacieAllowListProperties.arn = reader.getString(); + } else if ("publicCloudResourceName".equals(fieldName)) { + deserializedMacieAllowListProperties.publicCloudResourceName = reader.getString(); + } else if ("awsSourceSchema".equals(fieldName)) { + deserializedMacieAllowListProperties.awsSourceSchema = reader.getString(); + } else if ("awsRegion".equals(fieldName)) { + deserializedMacieAllowListProperties.awsRegion = reader.getString(); + } else if ("awsTags".equals(fieldName)) { + Map awsTags = reader.readMap(reader1 -> reader1.getString()); + deserializedMacieAllowListProperties.awsTags = awsTags; + } else if ("provisioningState".equals(fieldName)) { + deserializedMacieAllowListProperties.provisioningState + = ProvisioningState.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedMacieAllowListProperties; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/MacieAllowListResult.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/MacieAllowListResult.java new file mode 100644 index 000000000000..2eeb05072cc5 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/MacieAllowListResult.java @@ -0,0 +1,135 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.awsconnector.fluent.models.MacieAllowListInner; +import java.io.IOException; +import java.util.List; + +/** + * The response of a MacieAllowList list operation. + */ +@Fluent +public final class MacieAllowListResult implements JsonSerializable { + /* + * The MacieAllowList items on this page + */ + private List value; + + /* + * The link to the next page of items + */ + private String nextLink; + + /** + * Creates an instance of MacieAllowListResult class. + */ + public MacieAllowListResult() { + } + + /** + * Get the value property: The MacieAllowList items on this page. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The MacieAllowList items on this page. + * + * @param value the value value to set. + * @return the MacieAllowListResult object itself. + */ + public MacieAllowListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The link to the next page of items. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: The link to the next page of items. + * + * @param nextLink the nextLink value to set. + * @return the MacieAllowListResult object itself. + */ + public MacieAllowListResult withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property value in model MacieAllowListResult")); + } else { + value().forEach(e -> e.validate()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(MacieAllowListResult.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("nextLink", this.nextLink); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MacieAllowListResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MacieAllowListResult if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the MacieAllowListResult. + */ + public static MacieAllowListResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MacieAllowListResult deserializedMacieAllowListResult = new MacieAllowListResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> MacieAllowListInner.fromJson(reader1)); + deserializedMacieAllowListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedMacieAllowListResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedMacieAllowListResult; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/MacieAllowListTagsUpdate.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/MacieAllowListTagsUpdate.java new file mode 100644 index 000000000000..3a01f3f5b256 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/MacieAllowListTagsUpdate.java @@ -0,0 +1,95 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.Map; + +/** + * The type used for updating tags in MacieAllowList resources. + */ +@Fluent +public final class MacieAllowListTagsUpdate implements JsonSerializable { + /* + * Resource tags. + */ + private Map tags; + + /** + * Creates an instance of MacieAllowListTagsUpdate class. + */ + public MacieAllowListTagsUpdate() { + } + + /** + * Get the tags property: Resource tags. + * + * @return the tags value. + */ + public Map tags() { + return this.tags; + } + + /** + * Set the tags property: Resource tags. + * + * @param tags the tags value to set. + * @return the MacieAllowListTagsUpdate object itself. + */ + public MacieAllowListTagsUpdate withTags(Map tags) { + this.tags = tags; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeMapField("tags", this.tags, (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MacieAllowListTagsUpdate from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MacieAllowListTagsUpdate if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IOException If an error occurs while reading the MacieAllowListTagsUpdate. + */ + public static MacieAllowListTagsUpdate fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MacieAllowListTagsUpdate deserializedMacieAllowListTagsUpdate = new MacieAllowListTagsUpdate(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedMacieAllowListTagsUpdate.tags = tags; + } else { + reader.skipChildren(); + } + } + + return deserializedMacieAllowListTagsUpdate; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/MacieAllowLists.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/MacieAllowLists.java new file mode 100644 index 000000000000..7b17391858c3 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/MacieAllowLists.java @@ -0,0 +1,157 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** + * Resource collection API of MacieAllowLists. + */ +public interface MacieAllowLists { + /** + * List MacieAllowList resources by subscription ID. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a MacieAllowList list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable list(); + + /** + * List MacieAllowList resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a MacieAllowList list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable list(Context context); + + /** + * List MacieAllowList resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a MacieAllowList list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * List MacieAllowList resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a MacieAllowList list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Get a MacieAllowList. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of MacieAllowList. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a MacieAllowList along with {@link Response}. + */ + Response getByResourceGroupWithResponse(String resourceGroupName, String name, Context context); + + /** + * Get a MacieAllowList. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of MacieAllowList. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a MacieAllowList. + */ + MacieAllowList getByResourceGroup(String resourceGroupName, String name); + + /** + * Delete a MacieAllowList. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of MacieAllowList. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByResourceGroup(String resourceGroupName, String name); + + /** + * Delete a MacieAllowList. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of MacieAllowList. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String name, Context context); + + /** + * Get a MacieAllowList. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a MacieAllowList along with {@link Response}. + */ + MacieAllowList getById(String id); + + /** + * Get a MacieAllowList. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a MacieAllowList along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Delete a MacieAllowList. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteById(String id); + + /** + * Delete a MacieAllowList. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new MacieAllowList resource. + * + * @param name resource name. + * @return the first stage of the new MacieAllowList definition. + */ + MacieAllowList.DefinitionStages.Blank define(String name); +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/MasterUserSecret.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/MasterUserSecret.java new file mode 100644 index 000000000000..6632cf922275 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/MasterUserSecret.java @@ -0,0 +1,121 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of MasterUserSecret. + */ +@Fluent +public final class MasterUserSecret implements JsonSerializable { + /* + * The AWS KMS key identifier that is used to encrypt the secret. + */ + private String kmsKeyId; + + /* + * The Amazon Resource Name (ARN) of the secret. + */ + private String secretArn; + + /** + * Creates an instance of MasterUserSecret class. + */ + public MasterUserSecret() { + } + + /** + * Get the kmsKeyId property: The AWS KMS key identifier that is used to encrypt the secret. + * + * @return the kmsKeyId value. + */ + public String kmsKeyId() { + return this.kmsKeyId; + } + + /** + * Set the kmsKeyId property: The AWS KMS key identifier that is used to encrypt the secret. + * + * @param kmsKeyId the kmsKeyId value to set. + * @return the MasterUserSecret object itself. + */ + public MasterUserSecret withKmsKeyId(String kmsKeyId) { + this.kmsKeyId = kmsKeyId; + return this; + } + + /** + * Get the secretArn property: The Amazon Resource Name (ARN) of the secret. + * + * @return the secretArn value. + */ + public String secretArn() { + return this.secretArn; + } + + /** + * Set the secretArn property: The Amazon Resource Name (ARN) of the secret. + * + * @param secretArn the secretArn value to set. + * @return the MasterUserSecret object itself. + */ + public MasterUserSecret withSecretArn(String secretArn) { + this.secretArn = secretArn; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("kmsKeyId", this.kmsKeyId); + jsonWriter.writeStringField("secretArn", this.secretArn); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MasterUserSecret from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MasterUserSecret if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the MasterUserSecret. + */ + public static MasterUserSecret fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MasterUserSecret deserializedMasterUserSecret = new MasterUserSecret(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("kmsKeyId".equals(fieldName)) { + deserializedMasterUserSecret.kmsKeyId = reader.getString(); + } else if ("secretArn".equals(fieldName)) { + deserializedMasterUserSecret.secretArn = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedMasterUserSecret; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/MatchAttributes.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/MatchAttributes.java new file mode 100644 index 000000000000..762bfd0f1fc2 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/MatchAttributes.java @@ -0,0 +1,256 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Definition of MatchAttributes. + */ +@Fluent +public final class MatchAttributes implements JsonSerializable { + /* + * Property destinationPorts + */ + private List destinationPorts; + + /* + * Property destinations + */ + private List
destinations; + + /* + * Property protocols + */ + private List protocols; + + /* + * Property sourcePorts + */ + private List sourcePorts; + + /* + * Property sources + */ + private List
sources; + + /* + * Property tcpFlags + */ + private List tcpFlags; + + /** + * Creates an instance of MatchAttributes class. + */ + public MatchAttributes() { + } + + /** + * Get the destinationPorts property: Property destinationPorts. + * + * @return the destinationPorts value. + */ + public List destinationPorts() { + return this.destinationPorts; + } + + /** + * Set the destinationPorts property: Property destinationPorts. + * + * @param destinationPorts the destinationPorts value to set. + * @return the MatchAttributes object itself. + */ + public MatchAttributes withDestinationPorts(List destinationPorts) { + this.destinationPorts = destinationPorts; + return this; + } + + /** + * Get the destinations property: Property destinations. + * + * @return the destinations value. + */ + public List
destinations() { + return this.destinations; + } + + /** + * Set the destinations property: Property destinations. + * + * @param destinations the destinations value to set. + * @return the MatchAttributes object itself. + */ + public MatchAttributes withDestinations(List
destinations) { + this.destinations = destinations; + return this; + } + + /** + * Get the protocols property: Property protocols. + * + * @return the protocols value. + */ + public List protocols() { + return this.protocols; + } + + /** + * Set the protocols property: Property protocols. + * + * @param protocols the protocols value to set. + * @return the MatchAttributes object itself. + */ + public MatchAttributes withProtocols(List protocols) { + this.protocols = protocols; + return this; + } + + /** + * Get the sourcePorts property: Property sourcePorts. + * + * @return the sourcePorts value. + */ + public List sourcePorts() { + return this.sourcePorts; + } + + /** + * Set the sourcePorts property: Property sourcePorts. + * + * @param sourcePorts the sourcePorts value to set. + * @return the MatchAttributes object itself. + */ + public MatchAttributes withSourcePorts(List sourcePorts) { + this.sourcePorts = sourcePorts; + return this; + } + + /** + * Get the sources property: Property sources. + * + * @return the sources value. + */ + public List
sources() { + return this.sources; + } + + /** + * Set the sources property: Property sources. + * + * @param sources the sources value to set. + * @return the MatchAttributes object itself. + */ + public MatchAttributes withSources(List
sources) { + this.sources = sources; + return this; + } + + /** + * Get the tcpFlags property: Property tcpFlags. + * + * @return the tcpFlags value. + */ + public List tcpFlags() { + return this.tcpFlags; + } + + /** + * Set the tcpFlags property: Property tcpFlags. + * + * @param tcpFlags the tcpFlags value to set. + * @return the MatchAttributes object itself. + */ + public MatchAttributes withTcpFlags(List tcpFlags) { + this.tcpFlags = tcpFlags; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (destinationPorts() != null) { + destinationPorts().forEach(e -> e.validate()); + } + if (destinations() != null) { + destinations().forEach(e -> e.validate()); + } + if (sourcePorts() != null) { + sourcePorts().forEach(e -> e.validate()); + } + if (sources() != null) { + sources().forEach(e -> e.validate()); + } + if (tcpFlags() != null) { + tcpFlags().forEach(e -> e.validate()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("destinationPorts", this.destinationPorts, + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("destinations", this.destinations, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("protocols", this.protocols, (writer, element) -> writer.writeInt(element)); + jsonWriter.writeArrayField("sourcePorts", this.sourcePorts, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("sources", this.sources, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("tcpFlags", this.tcpFlags, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MatchAttributes from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MatchAttributes if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the MatchAttributes. + */ + public static MatchAttributes fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MatchAttributes deserializedMatchAttributes = new MatchAttributes(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("destinationPorts".equals(fieldName)) { + List destinationPorts = reader.readArray(reader1 -> PortRange.fromJson(reader1)); + deserializedMatchAttributes.destinationPorts = destinationPorts; + } else if ("destinations".equals(fieldName)) { + List
destinations = reader.readArray(reader1 -> Address.fromJson(reader1)); + deserializedMatchAttributes.destinations = destinations; + } else if ("protocols".equals(fieldName)) { + List protocols = reader.readArray(reader1 -> reader1.getInt()); + deserializedMatchAttributes.protocols = protocols; + } else if ("sourcePorts".equals(fieldName)) { + List sourcePorts = reader.readArray(reader1 -> PortRange.fromJson(reader1)); + deserializedMatchAttributes.sourcePorts = sourcePorts; + } else if ("sources".equals(fieldName)) { + List
sources = reader.readArray(reader1 -> Address.fromJson(reader1)); + deserializedMatchAttributes.sources = sources; + } else if ("tcpFlags".equals(fieldName)) { + List tcpFlags = reader.readArray(reader1 -> TcpFlagField.fromJson(reader1)); + deserializedMatchAttributes.tcpFlags = tcpFlags; + } else { + reader.skipChildren(); + } + } + + return deserializedMatchAttributes; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/Matcher.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/Matcher.java new file mode 100644 index 000000000000..87a08232f068 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/Matcher.java @@ -0,0 +1,127 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of Matcher. + */ +@Fluent +public final class Matcher implements JsonSerializable { + /* + * You can specify values between 0 and 99. You can specify multiple values, or a range of values. The default value + * is 12. + */ + private String grpcCode; + + /* + * For Application Load Balancers, you can specify values between 200 and 499, and the default value is 200. You can + * specify multiple values or a range of values. + */ + private String httpCode; + + /** + * Creates an instance of Matcher class. + */ + public Matcher() { + } + + /** + * Get the grpcCode property: You can specify values between 0 and 99. You can specify multiple values, or a range + * of values. The default value is 12. + * + * @return the grpcCode value. + */ + public String grpcCode() { + return this.grpcCode; + } + + /** + * Set the grpcCode property: You can specify values between 0 and 99. You can specify multiple values, or a range + * of values. The default value is 12. + * + * @param grpcCode the grpcCode value to set. + * @return the Matcher object itself. + */ + public Matcher withGrpcCode(String grpcCode) { + this.grpcCode = grpcCode; + return this; + } + + /** + * Get the httpCode property: For Application Load Balancers, you can specify values between 200 and 499, and the + * default value is 200. You can specify multiple values or a range of values. + * + * @return the httpCode value. + */ + public String httpCode() { + return this.httpCode; + } + + /** + * Set the httpCode property: For Application Load Balancers, you can specify values between 200 and 499, and the + * default value is 200. You can specify multiple values or a range of values. + * + * @param httpCode the httpCode value to set. + * @return the Matcher object itself. + */ + public Matcher withHttpCode(String httpCode) { + this.httpCode = httpCode; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("grpcCode", this.grpcCode); + jsonWriter.writeStringField("httpCode", this.httpCode); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of Matcher from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of Matcher if the JsonReader was pointing to an instance of it, or null if it was pointing to + * JSON null. + * @throws IOException If an error occurs while reading the Matcher. + */ + public static Matcher fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + Matcher deserializedMatcher = new Matcher(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("grpcCode".equals(fieldName)) { + deserializedMatcher.grpcCode = reader.getString(); + } else if ("httpCode".equals(fieldName)) { + deserializedMatcher.httpCode = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedMatcher; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/MaxAgeRule.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/MaxAgeRule.java new file mode 100644 index 000000000000..9502dbf73082 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/MaxAgeRule.java @@ -0,0 +1,152 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of MaxAgeRule. + */ +@Fluent +public final class MaxAgeRule implements JsonSerializable { + /* + * Set to true to delete a version's source bundle from Amazon S3 when Elastic Beanstalk deletes the application + * version. + */ + private Boolean deleteSourceFromS3; + + /* + * Specify true to apply the rule, or false to disable it. + */ + private Boolean enabled; + + /* + * Specify the number of days to retain an application versions. + */ + private Integer maxAgeInDays; + + /** + * Creates an instance of MaxAgeRule class. + */ + public MaxAgeRule() { + } + + /** + * Get the deleteSourceFromS3 property: Set to true to delete a version's source bundle from Amazon S3 when Elastic + * Beanstalk deletes the application version. + * + * @return the deleteSourceFromS3 value. + */ + public Boolean deleteSourceFromS3() { + return this.deleteSourceFromS3; + } + + /** + * Set the deleteSourceFromS3 property: Set to true to delete a version's source bundle from Amazon S3 when Elastic + * Beanstalk deletes the application version. + * + * @param deleteSourceFromS3 the deleteSourceFromS3 value to set. + * @return the MaxAgeRule object itself. + */ + public MaxAgeRule withDeleteSourceFromS3(Boolean deleteSourceFromS3) { + this.deleteSourceFromS3 = deleteSourceFromS3; + return this; + } + + /** + * Get the enabled property: Specify true to apply the rule, or false to disable it. + * + * @return the enabled value. + */ + public Boolean enabled() { + return this.enabled; + } + + /** + * Set the enabled property: Specify true to apply the rule, or false to disable it. + * + * @param enabled the enabled value to set. + * @return the MaxAgeRule object itself. + */ + public MaxAgeRule withEnabled(Boolean enabled) { + this.enabled = enabled; + return this; + } + + /** + * Get the maxAgeInDays property: Specify the number of days to retain an application versions. + * + * @return the maxAgeInDays value. + */ + public Integer maxAgeInDays() { + return this.maxAgeInDays; + } + + /** + * Set the maxAgeInDays property: Specify the number of days to retain an application versions. + * + * @param maxAgeInDays the maxAgeInDays value to set. + * @return the MaxAgeRule object itself. + */ + public MaxAgeRule withMaxAgeInDays(Integer maxAgeInDays) { + this.maxAgeInDays = maxAgeInDays; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeBooleanField("deleteSourceFromS3", this.deleteSourceFromS3); + jsonWriter.writeBooleanField("enabled", this.enabled); + jsonWriter.writeNumberField("maxAgeInDays", this.maxAgeInDays); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MaxAgeRule from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MaxAgeRule if the JsonReader was pointing to an instance of it, or null if it was pointing + * to JSON null. + * @throws IOException If an error occurs while reading the MaxAgeRule. + */ + public static MaxAgeRule fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MaxAgeRule deserializedMaxAgeRule = new MaxAgeRule(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("deleteSourceFromS3".equals(fieldName)) { + deserializedMaxAgeRule.deleteSourceFromS3 = reader.getNullable(JsonReader::getBoolean); + } else if ("enabled".equals(fieldName)) { + deserializedMaxAgeRule.enabled = reader.getNullable(JsonReader::getBoolean); + } else if ("maxAgeInDays".equals(fieldName)) { + deserializedMaxAgeRule.maxAgeInDays = reader.getNullable(JsonReader::getInt); + } else { + reader.skipChildren(); + } + } + + return deserializedMaxAgeRule; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/MaxCountRule.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/MaxCountRule.java new file mode 100644 index 000000000000..2c60d08c7185 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/MaxCountRule.java @@ -0,0 +1,152 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of MaxCountRule. + */ +@Fluent +public final class MaxCountRule implements JsonSerializable { + /* + * Set to true to delete a version's source bundle from Amazon S3 when Elastic Beanstalk deletes the application + * version. + */ + private Boolean deleteSourceFromS3; + + /* + * Specify true to apply the rule, or false to disable it. + */ + private Boolean enabled; + + /* + * Specify the maximum number of application versions to retain. + */ + private Integer maxCount; + + /** + * Creates an instance of MaxCountRule class. + */ + public MaxCountRule() { + } + + /** + * Get the deleteSourceFromS3 property: Set to true to delete a version's source bundle from Amazon S3 when Elastic + * Beanstalk deletes the application version. + * + * @return the deleteSourceFromS3 value. + */ + public Boolean deleteSourceFromS3() { + return this.deleteSourceFromS3; + } + + /** + * Set the deleteSourceFromS3 property: Set to true to delete a version's source bundle from Amazon S3 when Elastic + * Beanstalk deletes the application version. + * + * @param deleteSourceFromS3 the deleteSourceFromS3 value to set. + * @return the MaxCountRule object itself. + */ + public MaxCountRule withDeleteSourceFromS3(Boolean deleteSourceFromS3) { + this.deleteSourceFromS3 = deleteSourceFromS3; + return this; + } + + /** + * Get the enabled property: Specify true to apply the rule, or false to disable it. + * + * @return the enabled value. + */ + public Boolean enabled() { + return this.enabled; + } + + /** + * Set the enabled property: Specify true to apply the rule, or false to disable it. + * + * @param enabled the enabled value to set. + * @return the MaxCountRule object itself. + */ + public MaxCountRule withEnabled(Boolean enabled) { + this.enabled = enabled; + return this; + } + + /** + * Get the maxCount property: Specify the maximum number of application versions to retain. + * + * @return the maxCount value. + */ + public Integer maxCount() { + return this.maxCount; + } + + /** + * Set the maxCount property: Specify the maximum number of application versions to retain. + * + * @param maxCount the maxCount value to set. + * @return the MaxCountRule object itself. + */ + public MaxCountRule withMaxCount(Integer maxCount) { + this.maxCount = maxCount; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeBooleanField("deleteSourceFromS3", this.deleteSourceFromS3); + jsonWriter.writeBooleanField("enabled", this.enabled); + jsonWriter.writeNumberField("maxCount", this.maxCount); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MaxCountRule from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MaxCountRule if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the MaxCountRule. + */ + public static MaxCountRule fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MaxCountRule deserializedMaxCountRule = new MaxCountRule(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("deleteSourceFromS3".equals(fieldName)) { + deserializedMaxCountRule.deleteSourceFromS3 = reader.getNullable(JsonReader::getBoolean); + } else if ("enabled".equals(fieldName)) { + deserializedMaxCountRule.enabled = reader.getNullable(JsonReader::getBoolean); + } else if ("maxCount".equals(fieldName)) { + deserializedMaxCountRule.maxCount = reader.getNullable(JsonReader::getInt); + } else { + reader.skipChildren(); + } + } + + return deserializedMaxCountRule; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/MaximumExecutionFrequency.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/MaximumExecutionFrequency.java new file mode 100644 index 000000000000..de41abe2ecc3 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/MaximumExecutionFrequency.java @@ -0,0 +1,66 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * MaximumExecutionFrequency enum. + */ +public final class MaximumExecutionFrequency extends ExpandableStringEnum { + /** + * Static value One_Hour for MaximumExecutionFrequency. + */ + public static final MaximumExecutionFrequency ONE_HOUR = fromString("One_Hour"); + + /** + * Static value Six_Hours for MaximumExecutionFrequency. + */ + public static final MaximumExecutionFrequency SIX_HOURS = fromString("Six_Hours"); + + /** + * Static value Three_Hours for MaximumExecutionFrequency. + */ + public static final MaximumExecutionFrequency THREE_HOURS = fromString("Three_Hours"); + + /** + * Static value Twelve_Hours for MaximumExecutionFrequency. + */ + public static final MaximumExecutionFrequency TWELVE_HOURS = fromString("Twelve_Hours"); + + /** + * Static value TwentyFour_Hours for MaximumExecutionFrequency. + */ + public static final MaximumExecutionFrequency TWENTY_FOUR_HOURS = fromString("TwentyFour_Hours"); + + /** + * Creates a new instance of MaximumExecutionFrequency value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public MaximumExecutionFrequency() { + } + + /** + * Creates or finds a MaximumExecutionFrequency from its string representation. + * + * @param name a name to look for. + * @return the corresponding MaximumExecutionFrequency. + */ + public static MaximumExecutionFrequency fromString(String name) { + return fromString(name, MaximumExecutionFrequency.class); + } + + /** + * Gets known MaximumExecutionFrequency values. + * + * @return known MaximumExecutionFrequency values. + */ + public static Collection values() { + return values(MaximumExecutionFrequency.class); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/MaximumExecutionFrequencyEnumValue.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/MaximumExecutionFrequencyEnumValue.java new file mode 100644 index 000000000000..80faadc85224 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/MaximumExecutionFrequencyEnumValue.java @@ -0,0 +1,95 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of MaximumExecutionFrequencyEnumValue. + */ +@Fluent +public final class MaximumExecutionFrequencyEnumValue implements JsonSerializable { + /* + * Property value + */ + private MaximumExecutionFrequency value; + + /** + * Creates an instance of MaximumExecutionFrequencyEnumValue class. + */ + public MaximumExecutionFrequencyEnumValue() { + } + + /** + * Get the value property: Property value. + * + * @return the value value. + */ + public MaximumExecutionFrequency value() { + return this.value; + } + + /** + * Set the value property: Property value. + * + * @param value the value value to set. + * @return the MaximumExecutionFrequencyEnumValue object itself. + */ + public MaximumExecutionFrequencyEnumValue withValue(MaximumExecutionFrequency value) { + this.value = value; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("value", this.value == null ? null : this.value.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MaximumExecutionFrequencyEnumValue from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MaximumExecutionFrequencyEnumValue if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the MaximumExecutionFrequencyEnumValue. + */ + public static MaximumExecutionFrequencyEnumValue fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MaximumExecutionFrequencyEnumValue deserializedMaximumExecutionFrequencyEnumValue + = new MaximumExecutionFrequencyEnumValue(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + deserializedMaximumExecutionFrequencyEnumValue.value + = MaximumExecutionFrequency.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedMaximumExecutionFrequencyEnumValue; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/MemoryGiBPerVCpuRequest.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/MemoryGiBPerVCpuRequest.java new file mode 100644 index 000000000000..35976ce216c0 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/MemoryGiBPerVCpuRequest.java @@ -0,0 +1,121 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of MemoryGiBPerVCpuRequest. + */ +@Fluent +public final class MemoryGiBPerVCpuRequest implements JsonSerializable { + /* + * The memory maximum in GiB. + */ + private Integer max; + + /* + * The memory minimum in GiB. + */ + private Integer min; + + /** + * Creates an instance of MemoryGiBPerVCpuRequest class. + */ + public MemoryGiBPerVCpuRequest() { + } + + /** + * Get the max property: The memory maximum in GiB. + * + * @return the max value. + */ + public Integer max() { + return this.max; + } + + /** + * Set the max property: The memory maximum in GiB. + * + * @param max the max value to set. + * @return the MemoryGiBPerVCpuRequest object itself. + */ + public MemoryGiBPerVCpuRequest withMax(Integer max) { + this.max = max; + return this; + } + + /** + * Get the min property: The memory minimum in GiB. + * + * @return the min value. + */ + public Integer min() { + return this.min; + } + + /** + * Set the min property: The memory minimum in GiB. + * + * @param min the min value to set. + * @return the MemoryGiBPerVCpuRequest object itself. + */ + public MemoryGiBPerVCpuRequest withMin(Integer min) { + this.min = min; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeNumberField("max", this.max); + jsonWriter.writeNumberField("min", this.min); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MemoryGiBPerVCpuRequest from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MemoryGiBPerVCpuRequest if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the MemoryGiBPerVCpuRequest. + */ + public static MemoryGiBPerVCpuRequest fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MemoryGiBPerVCpuRequest deserializedMemoryGiBPerVCpuRequest = new MemoryGiBPerVCpuRequest(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("max".equals(fieldName)) { + deserializedMemoryGiBPerVCpuRequest.max = reader.getNullable(JsonReader::getInt); + } else if ("min".equals(fieldName)) { + deserializedMemoryGiBPerVCpuRequest.min = reader.getNullable(JsonReader::getInt); + } else { + reader.skipChildren(); + } + } + + return deserializedMemoryGiBPerVCpuRequest; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/MemoryMiBRequest.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/MemoryMiBRequest.java new file mode 100644 index 000000000000..f1b0a5238568 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/MemoryMiBRequest.java @@ -0,0 +1,121 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of MemoryMiBRequest. + */ +@Fluent +public final class MemoryMiBRequest implements JsonSerializable { + /* + * The memory maximum in MiB. + */ + private Integer max; + + /* + * The memory minimum in MiB. + */ + private Integer min; + + /** + * Creates an instance of MemoryMiBRequest class. + */ + public MemoryMiBRequest() { + } + + /** + * Get the max property: The memory maximum in MiB. + * + * @return the max value. + */ + public Integer max() { + return this.max; + } + + /** + * Set the max property: The memory maximum in MiB. + * + * @param max the max value to set. + * @return the MemoryMiBRequest object itself. + */ + public MemoryMiBRequest withMax(Integer max) { + this.max = max; + return this; + } + + /** + * Get the min property: The memory minimum in MiB. + * + * @return the min value. + */ + public Integer min() { + return this.min; + } + + /** + * Set the min property: The memory minimum in MiB. + * + * @param min the min value to set. + * @return the MemoryMiBRequest object itself. + */ + public MemoryMiBRequest withMin(Integer min) { + this.min = min; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeNumberField("max", this.max); + jsonWriter.writeNumberField("min", this.min); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MemoryMiBRequest from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MemoryMiBRequest if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the MemoryMiBRequest. + */ + public static MemoryMiBRequest fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MemoryMiBRequest deserializedMemoryMiBRequest = new MemoryMiBRequest(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("max".equals(fieldName)) { + deserializedMemoryMiBRequest.max = reader.getNullable(JsonReader::getInt); + } else if ("min".equals(fieldName)) { + deserializedMemoryMiBRequest.min = reader.getNullable(JsonReader::getInt); + } else { + reader.skipChildren(); + } + } + + return deserializedMemoryMiBRequest; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/MethodSetting.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/MethodSetting.java new file mode 100644 index 000000000000..603704316684 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/MethodSetting.java @@ -0,0 +1,383 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of MethodSetting. + */ +@Fluent +public final class MethodSetting implements JsonSerializable { + /* + * Specifies whether the cached responses are encrypted. + */ + private Boolean cacheDataEncrypted; + + /* + * Specifies the time to live (TTL), in seconds, for cached responses. The higher the TTL, the longer the response + * will be cached. + */ + private Integer cacheTtlInSeconds; + + /* + * Specifies whether responses should be cached and returned for requests. A cache cluster must be enabled on the + * stage for responses to be cached. + */ + private Boolean cachingEnabled; + + /* + * Specifies whether data trace logging is enabled for this method, which affects the log entries pushed to Amazon + * CloudWatch Logs. This can be useful to troubleshoot APIs, but can result in logging sensitive data. We recommend + * that you don't enable this option for production APIs. + */ + private Boolean dataTraceEnabled; + + /* + * The HTTP method. To apply settings to multiple resources and methods, specify an asterisk (``*``) for the + * ``HttpMethod`` and ``/*`` for the ``ResourcePath``. This parameter is required when you specify a + * ``MethodSetting``. + */ + private String httpMethod; + + /* + * Specifies the logging level for this method, which affects the log entries pushed to Amazon CloudWatch Logs. + * Valid values are ``OFF``, ``ERROR``, and ``INFO``. Choose ``ERROR`` to write only error-level entries to + * CloudWatch Logs, or choose ``INFO`` to include all ``ERROR`` events as well as extra informational events. + */ + private String loggingLevel; + + /* + * Specifies whether Amazon CloudWatch metrics are enabled for this method. + */ + private Boolean metricsEnabled; + + /* + * The resource path for this method. Forward slashes (``/``) are encoded as ``~1`` and the initial slash must + * include a forward slash. For example, the path value ``/resource/subresource`` must be encoded as + * ``/~1resource~1subresource``. To specify the root path, use only a slash (``/``). To apply settings to multiple + * resources and methods, specify an asterisk (``*``) for the ``HttpMethod`` and ``/*`` for the ``ResourcePath``. + * This parameter is required when you specify a ``MethodSetting``. + */ + private String resourcePath; + + /* + * Specifies the throttling burst limit. + */ + private Integer throttlingBurstLimit; + + /* + * Specifies the throttling rate limit. + */ + private Integer throttlingRateLimit; + + /** + * Creates an instance of MethodSetting class. + */ + public MethodSetting() { + } + + /** + * Get the cacheDataEncrypted property: Specifies whether the cached responses are encrypted. + * + * @return the cacheDataEncrypted value. + */ + public Boolean cacheDataEncrypted() { + return this.cacheDataEncrypted; + } + + /** + * Set the cacheDataEncrypted property: Specifies whether the cached responses are encrypted. + * + * @param cacheDataEncrypted the cacheDataEncrypted value to set. + * @return the MethodSetting object itself. + */ + public MethodSetting withCacheDataEncrypted(Boolean cacheDataEncrypted) { + this.cacheDataEncrypted = cacheDataEncrypted; + return this; + } + + /** + * Get the cacheTtlInSeconds property: Specifies the time to live (TTL), in seconds, for cached responses. The + * higher the TTL, the longer the response will be cached. + * + * @return the cacheTtlInSeconds value. + */ + public Integer cacheTtlInSeconds() { + return this.cacheTtlInSeconds; + } + + /** + * Set the cacheTtlInSeconds property: Specifies the time to live (TTL), in seconds, for cached responses. The + * higher the TTL, the longer the response will be cached. + * + * @param cacheTtlInSeconds the cacheTtlInSeconds value to set. + * @return the MethodSetting object itself. + */ + public MethodSetting withCacheTtlInSeconds(Integer cacheTtlInSeconds) { + this.cacheTtlInSeconds = cacheTtlInSeconds; + return this; + } + + /** + * Get the cachingEnabled property: Specifies whether responses should be cached and returned for requests. A cache + * cluster must be enabled on the stage for responses to be cached. + * + * @return the cachingEnabled value. + */ + public Boolean cachingEnabled() { + return this.cachingEnabled; + } + + /** + * Set the cachingEnabled property: Specifies whether responses should be cached and returned for requests. A cache + * cluster must be enabled on the stage for responses to be cached. + * + * @param cachingEnabled the cachingEnabled value to set. + * @return the MethodSetting object itself. + */ + public MethodSetting withCachingEnabled(Boolean cachingEnabled) { + this.cachingEnabled = cachingEnabled; + return this; + } + + /** + * Get the dataTraceEnabled property: Specifies whether data trace logging is enabled for this method, which affects + * the log entries pushed to Amazon CloudWatch Logs. This can be useful to troubleshoot APIs, but can result in + * logging sensitive data. We recommend that you don't enable this option for production APIs. + * + * @return the dataTraceEnabled value. + */ + public Boolean dataTraceEnabled() { + return this.dataTraceEnabled; + } + + /** + * Set the dataTraceEnabled property: Specifies whether data trace logging is enabled for this method, which affects + * the log entries pushed to Amazon CloudWatch Logs. This can be useful to troubleshoot APIs, but can result in + * logging sensitive data. We recommend that you don't enable this option for production APIs. + * + * @param dataTraceEnabled the dataTraceEnabled value to set. + * @return the MethodSetting object itself. + */ + public MethodSetting withDataTraceEnabled(Boolean dataTraceEnabled) { + this.dataTraceEnabled = dataTraceEnabled; + return this; + } + + /** + * Get the httpMethod property: The HTTP method. To apply settings to multiple resources and methods, specify an + * asterisk (``*``) for the ``HttpMethod`` and ``/*`` for the ``ResourcePath``. This parameter is required when you + * specify a ``MethodSetting``. + * + * @return the httpMethod value. + */ + public String httpMethod() { + return this.httpMethod; + } + + /** + * Set the httpMethod property: The HTTP method. To apply settings to multiple resources and methods, specify an + * asterisk (``*``) for the ``HttpMethod`` and ``/*`` for the ``ResourcePath``. This parameter is required when you + * specify a ``MethodSetting``. + * + * @param httpMethod the httpMethod value to set. + * @return the MethodSetting object itself. + */ + public MethodSetting withHttpMethod(String httpMethod) { + this.httpMethod = httpMethod; + return this; + } + + /** + * Get the loggingLevel property: Specifies the logging level for this method, which affects the log entries pushed + * to Amazon CloudWatch Logs. Valid values are ``OFF``, ``ERROR``, and ``INFO``. Choose ``ERROR`` to write only + * error-level entries to CloudWatch Logs, or choose ``INFO`` to include all ``ERROR`` events as well as extra + * informational events. + * + * @return the loggingLevel value. + */ + public String loggingLevel() { + return this.loggingLevel; + } + + /** + * Set the loggingLevel property: Specifies the logging level for this method, which affects the log entries pushed + * to Amazon CloudWatch Logs. Valid values are ``OFF``, ``ERROR``, and ``INFO``. Choose ``ERROR`` to write only + * error-level entries to CloudWatch Logs, or choose ``INFO`` to include all ``ERROR`` events as well as extra + * informational events. + * + * @param loggingLevel the loggingLevel value to set. + * @return the MethodSetting object itself. + */ + public MethodSetting withLoggingLevel(String loggingLevel) { + this.loggingLevel = loggingLevel; + return this; + } + + /** + * Get the metricsEnabled property: Specifies whether Amazon CloudWatch metrics are enabled for this method. + * + * @return the metricsEnabled value. + */ + public Boolean metricsEnabled() { + return this.metricsEnabled; + } + + /** + * Set the metricsEnabled property: Specifies whether Amazon CloudWatch metrics are enabled for this method. + * + * @param metricsEnabled the metricsEnabled value to set. + * @return the MethodSetting object itself. + */ + public MethodSetting withMetricsEnabled(Boolean metricsEnabled) { + this.metricsEnabled = metricsEnabled; + return this; + } + + /** + * Get the resourcePath property: The resource path for this method. Forward slashes (``/``) are encoded as ``~1`` + * and the initial slash must include a forward slash. For example, the path value ``/resource/subresource`` must be + * encoded as ``/~1resource~1subresource``. To specify the root path, use only a slash (``/``). To apply settings to + * multiple resources and methods, specify an asterisk (``*``) for the ``HttpMethod`` and ``/*`` for the + * ``ResourcePath``. This parameter is required when you specify a ``MethodSetting``. + * + * @return the resourcePath value. + */ + public String resourcePath() { + return this.resourcePath; + } + + /** + * Set the resourcePath property: The resource path for this method. Forward slashes (``/``) are encoded as ``~1`` + * and the initial slash must include a forward slash. For example, the path value ``/resource/subresource`` must be + * encoded as ``/~1resource~1subresource``. To specify the root path, use only a slash (``/``). To apply settings to + * multiple resources and methods, specify an asterisk (``*``) for the ``HttpMethod`` and ``/*`` for the + * ``ResourcePath``. This parameter is required when you specify a ``MethodSetting``. + * + * @param resourcePath the resourcePath value to set. + * @return the MethodSetting object itself. + */ + public MethodSetting withResourcePath(String resourcePath) { + this.resourcePath = resourcePath; + return this; + } + + /** + * Get the throttlingBurstLimit property: Specifies the throttling burst limit. + * + * @return the throttlingBurstLimit value. + */ + public Integer throttlingBurstLimit() { + return this.throttlingBurstLimit; + } + + /** + * Set the throttlingBurstLimit property: Specifies the throttling burst limit. + * + * @param throttlingBurstLimit the throttlingBurstLimit value to set. + * @return the MethodSetting object itself. + */ + public MethodSetting withThrottlingBurstLimit(Integer throttlingBurstLimit) { + this.throttlingBurstLimit = throttlingBurstLimit; + return this; + } + + /** + * Get the throttlingRateLimit property: Specifies the throttling rate limit. + * + * @return the throttlingRateLimit value. + */ + public Integer throttlingRateLimit() { + return this.throttlingRateLimit; + } + + /** + * Set the throttlingRateLimit property: Specifies the throttling rate limit. + * + * @param throttlingRateLimit the throttlingRateLimit value to set. + * @return the MethodSetting object itself. + */ + public MethodSetting withThrottlingRateLimit(Integer throttlingRateLimit) { + this.throttlingRateLimit = throttlingRateLimit; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeBooleanField("cacheDataEncrypted", this.cacheDataEncrypted); + jsonWriter.writeNumberField("cacheTtlInSeconds", this.cacheTtlInSeconds); + jsonWriter.writeBooleanField("cachingEnabled", this.cachingEnabled); + jsonWriter.writeBooleanField("dataTraceEnabled", this.dataTraceEnabled); + jsonWriter.writeStringField("httpMethod", this.httpMethod); + jsonWriter.writeStringField("loggingLevel", this.loggingLevel); + jsonWriter.writeBooleanField("metricsEnabled", this.metricsEnabled); + jsonWriter.writeStringField("resourcePath", this.resourcePath); + jsonWriter.writeNumberField("throttlingBurstLimit", this.throttlingBurstLimit); + jsonWriter.writeNumberField("throttlingRateLimit", this.throttlingRateLimit); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MethodSetting from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MethodSetting if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the MethodSetting. + */ + public static MethodSetting fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MethodSetting deserializedMethodSetting = new MethodSetting(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("cacheDataEncrypted".equals(fieldName)) { + deserializedMethodSetting.cacheDataEncrypted = reader.getNullable(JsonReader::getBoolean); + } else if ("cacheTtlInSeconds".equals(fieldName)) { + deserializedMethodSetting.cacheTtlInSeconds = reader.getNullable(JsonReader::getInt); + } else if ("cachingEnabled".equals(fieldName)) { + deserializedMethodSetting.cachingEnabled = reader.getNullable(JsonReader::getBoolean); + } else if ("dataTraceEnabled".equals(fieldName)) { + deserializedMethodSetting.dataTraceEnabled = reader.getNullable(JsonReader::getBoolean); + } else if ("httpMethod".equals(fieldName)) { + deserializedMethodSetting.httpMethod = reader.getString(); + } else if ("loggingLevel".equals(fieldName)) { + deserializedMethodSetting.loggingLevel = reader.getString(); + } else if ("metricsEnabled".equals(fieldName)) { + deserializedMethodSetting.metricsEnabled = reader.getNullable(JsonReader::getBoolean); + } else if ("resourcePath".equals(fieldName)) { + deserializedMethodSetting.resourcePath = reader.getString(); + } else if ("throttlingBurstLimit".equals(fieldName)) { + deserializedMethodSetting.throttlingBurstLimit = reader.getNullable(JsonReader::getInt); + } else if ("throttlingRateLimit".equals(fieldName)) { + deserializedMethodSetting.throttlingRateLimit = reader.getNullable(JsonReader::getInt); + } else { + reader.skipChildren(); + } + } + + return deserializedMethodSetting; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/Metric.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/Metric.java new file mode 100644 index 000000000000..f710287b8e2c --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/Metric.java @@ -0,0 +1,156 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Definition of Metric. + */ +@Fluent +public final class Metric implements JsonSerializable { + /* + * The metric dimensions that you want to be used for the metric that the alarm will watch. + */ + private List dimensions; + + /* + * The name of the metric that you want the alarm to watch. This is a required field. + */ + private String metricName; + + /* + * The namespace of the metric that the alarm will watch. + */ + private String namespace; + + /** + * Creates an instance of Metric class. + */ + public Metric() { + } + + /** + * Get the dimensions property: The metric dimensions that you want to be used for the metric that the alarm will + * watch. + * + * @return the dimensions value. + */ + public List dimensions() { + return this.dimensions; + } + + /** + * Set the dimensions property: The metric dimensions that you want to be used for the metric that the alarm will + * watch. + * + * @param dimensions the dimensions value to set. + * @return the Metric object itself. + */ + public Metric withDimensions(List dimensions) { + this.dimensions = dimensions; + return this; + } + + /** + * Get the metricName property: The name of the metric that you want the alarm to watch. This is a required field. + * + * @return the metricName value. + */ + public String metricName() { + return this.metricName; + } + + /** + * Set the metricName property: The name of the metric that you want the alarm to watch. This is a required field. + * + * @param metricName the metricName value to set. + * @return the Metric object itself. + */ + public Metric withMetricName(String metricName) { + this.metricName = metricName; + return this; + } + + /** + * Get the namespace property: The namespace of the metric that the alarm will watch. + * + * @return the namespace value. + */ + public String namespace() { + return this.namespace; + } + + /** + * Set the namespace property: The namespace of the metric that the alarm will watch. + * + * @param namespace the namespace value to set. + * @return the Metric object itself. + */ + public Metric withNamespace(String namespace) { + this.namespace = namespace; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (dimensions() != null) { + dimensions().forEach(e -> e.validate()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("dimensions", this.dimensions, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("metricName", this.metricName); + jsonWriter.writeStringField("namespace", this.namespace); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of Metric from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of Metric if the JsonReader was pointing to an instance of it, or null if it was pointing to + * JSON null. + * @throws IOException If an error occurs while reading the Metric. + */ + public static Metric fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + Metric deserializedMetric = new Metric(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("dimensions".equals(fieldName)) { + List dimensions = reader.readArray(reader1 -> Dimension.fromJson(reader1)); + deserializedMetric.dimensions = dimensions; + } else if ("metricName".equals(fieldName)) { + deserializedMetric.metricName = reader.getString(); + } else if ("namespace".equals(fieldName)) { + deserializedMetric.namespace = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedMetric; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/MetricDataQuery.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/MetricDataQuery.java new file mode 100644 index 000000000000..8d8b6c6c9806 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/MetricDataQuery.java @@ -0,0 +1,337 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of MetricDataQuery. + */ +@Fluent +public final class MetricDataQuery implements JsonSerializable { + /* + * The ID of the account where the metrics are located, if this is a cross-account alarm. + */ + private String accountId; + + /* + * The math expression to be performed on the returned data, if this object is performing a math expression. This + * expression can use the ``Id`` of the other metrics to refer to those metrics, and can also use the ``Id`` of + * other expressions to use the result of those expressions. For more information about metric math expressions, see + * [Metric Math Syntax and + * Functions](https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/using-metric-math.html#metric-math- + * syntax) in the *User Guide*. Within each MetricDataQuery object, you must specify either ``Expression`` or + * ``MetricStat`` but not both. + */ + private String expression; + + /* + * A short name used to tie this object to the results in the response. This name must be unique within a single + * call to ``GetMetricData``. If you are performing math expressions on this set of data, this name represents that + * data and can serve as a variable in the mathematical expression. The valid characters are letters, numbers, and + * underscore. The first character must be a lowercase letter. + */ + private String id; + + /* + * A human-readable label for this metric or expression. This is especially useful if this is an expression, so that + * you know what the value represents. If the metric or expression is shown in a CW dashboard widget, the label is + * shown. If ``Label`` is omitted, CW generates a default. + */ + private String label; + + /* + * The metric to be returned, along with statistics, period, and units. Use this parameter only if this object is + * retrieving a metric and not performing a math expression on returned data. Within one MetricDataQuery object, you + * must specify either ``Expression`` or ``MetricStat`` but not both. This structure defines the metric to be + * returned, along with the statistics, period, and units. ``MetricStat`` is a property of the + * [MetricDataQuery](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudwatch-alarm- + * metricdataquery.html) property type. + */ + private MetricStat metricStat; + + /* + * The granularity, in seconds, of the returned data points. For metrics with regular resolution, a period can be as + * short as one minute (60 seconds) and must be a multiple of 60. For high-resolution metrics that are collected at + * intervals of less than one minute, the period can be 1, 5, 10, 30, 60, or any multiple of 60. High-resolution + * metrics are those metrics stored by a ``PutMetricData`` operation that includes a ``StorageResolution of 1 + * second``. + */ + private Integer period; + + /* + * This option indicates whether to return the timestamps and raw data values of this metric. When you create an + * alarm based on a metric math expression, specify ``True`` for this value for only the one math expression that + * the alarm is based on. You must specify ``False`` for ``ReturnData`` for all the other metrics and expressions + * used in the alarm. This field is required. + */ + private Boolean returnData; + + /** + * Creates an instance of MetricDataQuery class. + */ + public MetricDataQuery() { + } + + /** + * Get the accountId property: The ID of the account where the metrics are located, if this is a cross-account + * alarm. + * + * @return the accountId value. + */ + public String accountId() { + return this.accountId; + } + + /** + * Set the accountId property: The ID of the account where the metrics are located, if this is a cross-account + * alarm. + * + * @param accountId the accountId value to set. + * @return the MetricDataQuery object itself. + */ + public MetricDataQuery withAccountId(String accountId) { + this.accountId = accountId; + return this; + } + + /** + * Get the expression property: The math expression to be performed on the returned data, if this object is + * performing a math expression. This expression can use the ``Id`` of the other metrics to refer to those metrics, + * and can also use the ``Id`` of other expressions to use the result of those expressions. For more information + * about metric math expressions, see [Metric Math Syntax and + * Functions](https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/using-metric-math.html#metric-math-syntax) + * in the *User Guide*. Within each MetricDataQuery object, you must specify either ``Expression`` or ``MetricStat`` + * but not both. + * + * @return the expression value. + */ + public String expression() { + return this.expression; + } + + /** + * Set the expression property: The math expression to be performed on the returned data, if this object is + * performing a math expression. This expression can use the ``Id`` of the other metrics to refer to those metrics, + * and can also use the ``Id`` of other expressions to use the result of those expressions. For more information + * about metric math expressions, see [Metric Math Syntax and + * Functions](https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/using-metric-math.html#metric-math-syntax) + * in the *User Guide*. Within each MetricDataQuery object, you must specify either ``Expression`` or ``MetricStat`` + * but not both. + * + * @param expression the expression value to set. + * @return the MetricDataQuery object itself. + */ + public MetricDataQuery withExpression(String expression) { + this.expression = expression; + return this; + } + + /** + * Get the id property: A short name used to tie this object to the results in the response. This name must be + * unique within a single call to ``GetMetricData``. If you are performing math expressions on this set of data, + * this name represents that data and can serve as a variable in the mathematical expression. The valid characters + * are letters, numbers, and underscore. The first character must be a lowercase letter. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Set the id property: A short name used to tie this object to the results in the response. This name must be + * unique within a single call to ``GetMetricData``. If you are performing math expressions on this set of data, + * this name represents that data and can serve as a variable in the mathematical expression. The valid characters + * are letters, numbers, and underscore. The first character must be a lowercase letter. + * + * @param id the id value to set. + * @return the MetricDataQuery object itself. + */ + public MetricDataQuery withId(String id) { + this.id = id; + return this; + } + + /** + * Get the label property: A human-readable label for this metric or expression. This is especially useful if this + * is an expression, so that you know what the value represents. If the metric or expression is shown in a CW + * dashboard widget, the label is shown. If ``Label`` is omitted, CW generates a default. + * + * @return the label value. + */ + public String label() { + return this.label; + } + + /** + * Set the label property: A human-readable label for this metric or expression. This is especially useful if this + * is an expression, so that you know what the value represents. If the metric or expression is shown in a CW + * dashboard widget, the label is shown. If ``Label`` is omitted, CW generates a default. + * + * @param label the label value to set. + * @return the MetricDataQuery object itself. + */ + public MetricDataQuery withLabel(String label) { + this.label = label; + return this; + } + + /** + * Get the metricStat property: The metric to be returned, along with statistics, period, and units. Use this + * parameter only if this object is retrieving a metric and not performing a math expression on returned data. + * Within one MetricDataQuery object, you must specify either ``Expression`` or ``MetricStat`` but not both. This + * structure defines the metric to be returned, along with the statistics, period, and units. ``MetricStat`` is a + * property of the + * [MetricDataQuery](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudwatch-alarm-metricdataquery.html) + * property type. + * + * @return the metricStat value. + */ + public MetricStat metricStat() { + return this.metricStat; + } + + /** + * Set the metricStat property: The metric to be returned, along with statistics, period, and units. Use this + * parameter only if this object is retrieving a metric and not performing a math expression on returned data. + * Within one MetricDataQuery object, you must specify either ``Expression`` or ``MetricStat`` but not both. This + * structure defines the metric to be returned, along with the statistics, period, and units. ``MetricStat`` is a + * property of the + * [MetricDataQuery](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudwatch-alarm-metricdataquery.html) + * property type. + * + * @param metricStat the metricStat value to set. + * @return the MetricDataQuery object itself. + */ + public MetricDataQuery withMetricStat(MetricStat metricStat) { + this.metricStat = metricStat; + return this; + } + + /** + * Get the period property: The granularity, in seconds, of the returned data points. For metrics with regular + * resolution, a period can be as short as one minute (60 seconds) and must be a multiple of 60. For high-resolution + * metrics that are collected at intervals of less than one minute, the period can be 1, 5, 10, 30, 60, or any + * multiple of 60. High-resolution metrics are those metrics stored by a ``PutMetricData`` operation that includes a + * ``StorageResolution of 1 second``. + * + * @return the period value. + */ + public Integer period() { + return this.period; + } + + /** + * Set the period property: The granularity, in seconds, of the returned data points. For metrics with regular + * resolution, a period can be as short as one minute (60 seconds) and must be a multiple of 60. For high-resolution + * metrics that are collected at intervals of less than one minute, the period can be 1, 5, 10, 30, 60, or any + * multiple of 60. High-resolution metrics are those metrics stored by a ``PutMetricData`` operation that includes a + * ``StorageResolution of 1 second``. + * + * @param period the period value to set. + * @return the MetricDataQuery object itself. + */ + public MetricDataQuery withPeriod(Integer period) { + this.period = period; + return this; + } + + /** + * Get the returnData property: This option indicates whether to return the timestamps and raw data values of this + * metric. When you create an alarm based on a metric math expression, specify ``True`` for this value for only the + * one math expression that the alarm is based on. You must specify ``False`` for ``ReturnData`` for all the other + * metrics and expressions used in the alarm. This field is required. + * + * @return the returnData value. + */ + public Boolean returnData() { + return this.returnData; + } + + /** + * Set the returnData property: This option indicates whether to return the timestamps and raw data values of this + * metric. When you create an alarm based on a metric math expression, specify ``True`` for this value for only the + * one math expression that the alarm is based on. You must specify ``False`` for ``ReturnData`` for all the other + * metrics and expressions used in the alarm. This field is required. + * + * @param returnData the returnData value to set. + * @return the MetricDataQuery object itself. + */ + public MetricDataQuery withReturnData(Boolean returnData) { + this.returnData = returnData; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (metricStat() != null) { + metricStat().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("accountId", this.accountId); + jsonWriter.writeStringField("expression", this.expression); + jsonWriter.writeStringField("id", this.id); + jsonWriter.writeStringField("label", this.label); + jsonWriter.writeJsonField("metricStat", this.metricStat); + jsonWriter.writeNumberField("period", this.period); + jsonWriter.writeBooleanField("returnData", this.returnData); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MetricDataQuery from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MetricDataQuery if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the MetricDataQuery. + */ + public static MetricDataQuery fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MetricDataQuery deserializedMetricDataQuery = new MetricDataQuery(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("accountId".equals(fieldName)) { + deserializedMetricDataQuery.accountId = reader.getString(); + } else if ("expression".equals(fieldName)) { + deserializedMetricDataQuery.expression = reader.getString(); + } else if ("id".equals(fieldName)) { + deserializedMetricDataQuery.id = reader.getString(); + } else if ("label".equals(fieldName)) { + deserializedMetricDataQuery.label = reader.getString(); + } else if ("metricStat".equals(fieldName)) { + deserializedMetricDataQuery.metricStat = MetricStat.fromJson(reader); + } else if ("period".equals(fieldName)) { + deserializedMetricDataQuery.period = reader.getNullable(JsonReader::getInt); + } else if ("returnData".equals(fieldName)) { + deserializedMetricDataQuery.returnData = reader.getNullable(JsonReader::getBoolean); + } else { + reader.skipChildren(); + } + } + + return deserializedMetricDataQuery; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/MetricStat.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/MetricStat.java new file mode 100644 index 000000000000..64e2d90252ba --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/MetricStat.java @@ -0,0 +1,230 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of MetricStat. + */ +@Fluent +public final class MetricStat implements JsonSerializable { + /* + * The metric to return, including the metric name, namespace, and dimensions. The ``Metric`` property type + * represents a specific metric. ``Metric`` is a property of the + * [MetricStat](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudwatch-alarm- + * metricstat.html) property type. + */ + private Metric metric; + + /* + * The granularity, in seconds, of the returned data points. For metrics with regular resolution, a period can be as + * short as one minute (60 seconds) and must be a multiple of 60. For high-resolution metrics that are collected at + * intervals of less than one minute, the period can be 1, 5, 10, 30, 60, or any multiple of 60. High-resolution + * metrics are those metrics stored by a ``PutMetricData`` call that includes a ``StorageResolution`` of 1 second. + * If the ``StartTime`` parameter specifies a time stamp that is greater than 3 hours ago, you must specify the + * period as follows or no data points in that time range is returned: + Start time between 3 hours and 15 days ago + * - Use a multiple of 60 seconds (1 minute). + Start time between 15 and 63 days ago - Use a multiple of 300 + * seconds (5 minutes). + Start time greater than 63 days ago - Use a multiple of 3600 seconds (1 hour). + */ + private Integer period; + + /* + * The statistic to return. It can include any CW statistic or extended statistic. For a list of valid values, see + * the table in + * [Statistics](https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/cloudwatch_concepts.html#Statistic) + * in the *User Guide*. + */ + private String stat; + + /* + * The unit to use for the returned data points. Valid values are: Seconds, Microseconds, Milliseconds, Bytes, + * Kilobytes, Megabytes, Gigabytes, Terabytes, Bits, Kilobits, Megabits, Gigabits, Terabits, Percent, Count, + * Bytes/Second, Kilobytes/Second, Megabytes/Second, Gigabytes/Second, Terabytes/Second, Bits/Second, + * Kilobits/Second, Megabits/Second, Gigabits/Second, Terabits/Second, Count/Second, or None. + */ + private String unit; + + /** + * Creates an instance of MetricStat class. + */ + public MetricStat() { + } + + /** + * Get the metric property: The metric to return, including the metric name, namespace, and dimensions. The + * ``Metric`` property type represents a specific metric. ``Metric`` is a property of the + * [MetricStat](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudwatch-alarm-metricstat.html) + * property type. + * + * @return the metric value. + */ + public Metric metric() { + return this.metric; + } + + /** + * Set the metric property: The metric to return, including the metric name, namespace, and dimensions. The + * ``Metric`` property type represents a specific metric. ``Metric`` is a property of the + * [MetricStat](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudwatch-alarm-metricstat.html) + * property type. + * + * @param metric the metric value to set. + * @return the MetricStat object itself. + */ + public MetricStat withMetric(Metric metric) { + this.metric = metric; + return this; + } + + /** + * Get the period property: The granularity, in seconds, of the returned data points. For metrics with regular + * resolution, a period can be as short as one minute (60 seconds) and must be a multiple of 60. For high-resolution + * metrics that are collected at intervals of less than one minute, the period can be 1, 5, 10, 30, 60, or any + * multiple of 60. High-resolution metrics are those metrics stored by a ``PutMetricData`` call that includes a + * ``StorageResolution`` of 1 second. If the ``StartTime`` parameter specifies a time stamp that is greater than 3 + * hours ago, you must specify the period as follows or no data points in that time range is returned: + Start time + * between 3 hours and 15 days ago - Use a multiple of 60 seconds (1 minute). + Start time between 15 and 63 days + * ago - Use a multiple of 300 seconds (5 minutes). + Start time greater than 63 days ago - Use a multiple of 3600 + * seconds (1 hour). + * + * @return the period value. + */ + public Integer period() { + return this.period; + } + + /** + * Set the period property: The granularity, in seconds, of the returned data points. For metrics with regular + * resolution, a period can be as short as one minute (60 seconds) and must be a multiple of 60. For high-resolution + * metrics that are collected at intervals of less than one minute, the period can be 1, 5, 10, 30, 60, or any + * multiple of 60. High-resolution metrics are those metrics stored by a ``PutMetricData`` call that includes a + * ``StorageResolution`` of 1 second. If the ``StartTime`` parameter specifies a time stamp that is greater than 3 + * hours ago, you must specify the period as follows or no data points in that time range is returned: + Start time + * between 3 hours and 15 days ago - Use a multiple of 60 seconds (1 minute). + Start time between 15 and 63 days + * ago - Use a multiple of 300 seconds (5 minutes). + Start time greater than 63 days ago - Use a multiple of 3600 + * seconds (1 hour). + * + * @param period the period value to set. + * @return the MetricStat object itself. + */ + public MetricStat withPeriod(Integer period) { + this.period = period; + return this; + } + + /** + * Get the stat property: The statistic to return. It can include any CW statistic or extended statistic. For a list + * of valid values, see the table in + * [Statistics](https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/cloudwatch_concepts.html#Statistic) + * in the *User Guide*. + * + * @return the stat value. + */ + public String stat() { + return this.stat; + } + + /** + * Set the stat property: The statistic to return. It can include any CW statistic or extended statistic. For a list + * of valid values, see the table in + * [Statistics](https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/cloudwatch_concepts.html#Statistic) + * in the *User Guide*. + * + * @param stat the stat value to set. + * @return the MetricStat object itself. + */ + public MetricStat withStat(String stat) { + this.stat = stat; + return this; + } + + /** + * Get the unit property: The unit to use for the returned data points. Valid values are: Seconds, Microseconds, + * Milliseconds, Bytes, Kilobytes, Megabytes, Gigabytes, Terabytes, Bits, Kilobits, Megabits, Gigabits, Terabits, + * Percent, Count, Bytes/Second, Kilobytes/Second, Megabytes/Second, Gigabytes/Second, Terabytes/Second, + * Bits/Second, Kilobits/Second, Megabits/Second, Gigabits/Second, Terabits/Second, Count/Second, or None. + * + * @return the unit value. + */ + public String unit() { + return this.unit; + } + + /** + * Set the unit property: The unit to use for the returned data points. Valid values are: Seconds, Microseconds, + * Milliseconds, Bytes, Kilobytes, Megabytes, Gigabytes, Terabytes, Bits, Kilobits, Megabits, Gigabits, Terabits, + * Percent, Count, Bytes/Second, Kilobytes/Second, Megabytes/Second, Gigabytes/Second, Terabytes/Second, + * Bits/Second, Kilobits/Second, Megabits/Second, Gigabits/Second, Terabits/Second, Count/Second, or None. + * + * @param unit the unit value to set. + * @return the MetricStat object itself. + */ + public MetricStat withUnit(String unit) { + this.unit = unit; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (metric() != null) { + metric().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("metric", this.metric); + jsonWriter.writeNumberField("period", this.period); + jsonWriter.writeStringField("stat", this.stat); + jsonWriter.writeStringField("unit", this.unit); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MetricStat from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MetricStat if the JsonReader was pointing to an instance of it, or null if it was pointing + * to JSON null. + * @throws IOException If an error occurs while reading the MetricStat. + */ + public static MetricStat fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MetricStat deserializedMetricStat = new MetricStat(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("metric".equals(fieldName)) { + deserializedMetricStat.metric = Metric.fromJson(reader); + } else if ("period".equals(fieldName)) { + deserializedMetricStat.period = reader.getNullable(JsonReader::getInt); + } else if ("stat".equals(fieldName)) { + deserializedMetricStat.stat = reader.getString(); + } else if ("unit".equals(fieldName)) { + deserializedMetricStat.unit = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedMetricStat; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/MetricTransformation.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/MetricTransformation.java new file mode 100644 index 000000000000..80a3b3e22017 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/MetricTransformation.java @@ -0,0 +1,281 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Definition of MetricTransformation. + */ +@Fluent +public final class MetricTransformation implements JsonSerializable { + /* + * (Optional) The value to emit when a filter pattern does not match a log event. This value can be null. + */ + private Integer defaultValue; + + /* + * The fields to use as dimensions for the metric. One metric filter can include as many as three dimensions. + * Metrics extracted from log events are charged as custom metrics. To prevent unexpected high charges, do not + * specify high-cardinality fields such as ``IPAddress`` or ``requestID`` as dimensions. Each different value found + * for a dimension is treated as a separate metric and accrues charges as a separate custom metric. CloudWatch Logs + * disables a metric filter if it generates 1000 different name/value pairs for your specified dimensions within a + * certain amount of time. This helps to prevent accidental high charges. You can also set up a billing alarm to + * alert you if your charges are higher than expected. For more information, see [Creating a Billing Alarm to + * Monitor Your Estimated + * Charges](https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/monitor_estimated_charges_with_cloudwatch + * .html). + */ + private List dimensions; + + /* + * The name of the CloudWatch metric. + */ + private String metricName; + + /* + * A custom namespace to contain your metric in CloudWatch. Use namespaces to group together metrics that are + * similar. For more information, see + * [Namespaces](https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/cloudwatch_concepts.html#Namespace). + */ + private String metricNamespace; + + /* + * The value that is published to the CloudWatch metric. For example, if you're counting the occurrences of a + * particular term like ``Error``, specify 1 for the metric value. If you're counting the number of bytes + * transferred, reference the value that is in the log event by using $. followed by the name of the field that you + * specified in the filter pattern, such as ``$.size``. + */ + private String metricValue; + + /* + * The unit to assign to the metric. If you omit this, the unit is set as ``None``. + */ + private MetricTransformationUnit unit; + + /** + * Creates an instance of MetricTransformation class. + */ + public MetricTransformation() { + } + + /** + * Get the defaultValue property: (Optional) The value to emit when a filter pattern does not match a log event. + * This value can be null. + * + * @return the defaultValue value. + */ + public Integer defaultValue() { + return this.defaultValue; + } + + /** + * Set the defaultValue property: (Optional) The value to emit when a filter pattern does not match a log event. + * This value can be null. + * + * @param defaultValue the defaultValue value to set. + * @return the MetricTransformation object itself. + */ + public MetricTransformation withDefaultValue(Integer defaultValue) { + this.defaultValue = defaultValue; + return this; + } + + /** + * Get the dimensions property: The fields to use as dimensions for the metric. One metric filter can include as + * many as three dimensions. Metrics extracted from log events are charged as custom metrics. To prevent unexpected + * high charges, do not specify high-cardinality fields such as ``IPAddress`` or ``requestID`` as dimensions. Each + * different value found for a dimension is treated as a separate metric and accrues charges as a separate custom + * metric. CloudWatch Logs disables a metric filter if it generates 1000 different name/value pairs for your + * specified dimensions within a certain amount of time. This helps to prevent accidental high charges. You can also + * set up a billing alarm to alert you if your charges are higher than expected. For more information, see [Creating + * a Billing Alarm to Monitor Your Estimated + * Charges](https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/monitor_estimated_charges_with_cloudwatch.html). + * + * @return the dimensions value. + */ + public List dimensions() { + return this.dimensions; + } + + /** + * Set the dimensions property: The fields to use as dimensions for the metric. One metric filter can include as + * many as three dimensions. Metrics extracted from log events are charged as custom metrics. To prevent unexpected + * high charges, do not specify high-cardinality fields such as ``IPAddress`` or ``requestID`` as dimensions. Each + * different value found for a dimension is treated as a separate metric and accrues charges as a separate custom + * metric. CloudWatch Logs disables a metric filter if it generates 1000 different name/value pairs for your + * specified dimensions within a certain amount of time. This helps to prevent accidental high charges. You can also + * set up a billing alarm to alert you if your charges are higher than expected. For more information, see [Creating + * a Billing Alarm to Monitor Your Estimated + * Charges](https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/monitor_estimated_charges_with_cloudwatch.html). + * + * @param dimensions the dimensions value to set. + * @return the MetricTransformation object itself. + */ + public MetricTransformation withDimensions(List dimensions) { + this.dimensions = dimensions; + return this; + } + + /** + * Get the metricName property: The name of the CloudWatch metric. + * + * @return the metricName value. + */ + public String metricName() { + return this.metricName; + } + + /** + * Set the metricName property: The name of the CloudWatch metric. + * + * @param metricName the metricName value to set. + * @return the MetricTransformation object itself. + */ + public MetricTransformation withMetricName(String metricName) { + this.metricName = metricName; + return this; + } + + /** + * Get the metricNamespace property: A custom namespace to contain your metric in CloudWatch. Use namespaces to + * group together metrics that are similar. For more information, see + * [Namespaces](https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/cloudwatch_concepts.html#Namespace). + * + * @return the metricNamespace value. + */ + public String metricNamespace() { + return this.metricNamespace; + } + + /** + * Set the metricNamespace property: A custom namespace to contain your metric in CloudWatch. Use namespaces to + * group together metrics that are similar. For more information, see + * [Namespaces](https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/cloudwatch_concepts.html#Namespace). + * + * @param metricNamespace the metricNamespace value to set. + * @return the MetricTransformation object itself. + */ + public MetricTransformation withMetricNamespace(String metricNamespace) { + this.metricNamespace = metricNamespace; + return this; + } + + /** + * Get the metricValue property: The value that is published to the CloudWatch metric. For example, if you're + * counting the occurrences of a particular term like ``Error``, specify 1 for the metric value. If you're counting + * the number of bytes transferred, reference the value that is in the log event by using $. followed by the name of + * the field that you specified in the filter pattern, such as ``$.size``. + * + * @return the metricValue value. + */ + public String metricValue() { + return this.metricValue; + } + + /** + * Set the metricValue property: The value that is published to the CloudWatch metric. For example, if you're + * counting the occurrences of a particular term like ``Error``, specify 1 for the metric value. If you're counting + * the number of bytes transferred, reference the value that is in the log event by using $. followed by the name of + * the field that you specified in the filter pattern, such as ``$.size``. + * + * @param metricValue the metricValue value to set. + * @return the MetricTransformation object itself. + */ + public MetricTransformation withMetricValue(String metricValue) { + this.metricValue = metricValue; + return this; + } + + /** + * Get the unit property: The unit to assign to the metric. If you omit this, the unit is set as ``None``. + * + * @return the unit value. + */ + public MetricTransformationUnit unit() { + return this.unit; + } + + /** + * Set the unit property: The unit to assign to the metric. If you omit this, the unit is set as ``None``. + * + * @param unit the unit value to set. + * @return the MetricTransformation object itself. + */ + public MetricTransformation withUnit(MetricTransformationUnit unit) { + this.unit = unit; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (dimensions() != null) { + dimensions().forEach(e -> e.validate()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeNumberField("defaultValue", this.defaultValue); + jsonWriter.writeArrayField("dimensions", this.dimensions, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("metricName", this.metricName); + jsonWriter.writeStringField("metricNamespace", this.metricNamespace); + jsonWriter.writeStringField("metricValue", this.metricValue); + jsonWriter.writeStringField("unit", this.unit == null ? null : this.unit.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MetricTransformation from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MetricTransformation if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the MetricTransformation. + */ + public static MetricTransformation fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MetricTransformation deserializedMetricTransformation = new MetricTransformation(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("defaultValue".equals(fieldName)) { + deserializedMetricTransformation.defaultValue = reader.getNullable(JsonReader::getInt); + } else if ("dimensions".equals(fieldName)) { + List dimensions + = reader.readArray(reader1 -> DimensionAutoGenerated.fromJson(reader1)); + deserializedMetricTransformation.dimensions = dimensions; + } else if ("metricName".equals(fieldName)) { + deserializedMetricTransformation.metricName = reader.getString(); + } else if ("metricNamespace".equals(fieldName)) { + deserializedMetricTransformation.metricNamespace = reader.getString(); + } else if ("metricValue".equals(fieldName)) { + deserializedMetricTransformation.metricValue = reader.getString(); + } else if ("unit".equals(fieldName)) { + deserializedMetricTransformation.unit = MetricTransformationUnit.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedMetricTransformation; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/MetricTransformationUnit.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/MetricTransformationUnit.java new file mode 100644 index 000000000000..9e34be4ade5e --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/MetricTransformationUnit.java @@ -0,0 +1,176 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * MetricTransformationUnit enum. + */ +public final class MetricTransformationUnit extends ExpandableStringEnum { + /** + * Static value Bits for MetricTransformationUnit. + */ + public static final MetricTransformationUnit BITS = fromString("Bits"); + + /** + * Static value Bits/Second for MetricTransformationUnit. + */ + public static final MetricTransformationUnit BITS_SECOND = fromString("Bits/Second"); + + /** + * Static value Bytes for MetricTransformationUnit. + */ + public static final MetricTransformationUnit BYTES = fromString("Bytes"); + + /** + * Static value Bytes/Second for MetricTransformationUnit. + */ + public static final MetricTransformationUnit BYTES_SECOND = fromString("Bytes/Second"); + + /** + * Static value Count for MetricTransformationUnit. + */ + public static final MetricTransformationUnit COUNT = fromString("Count"); + + /** + * Static value Count/Second for MetricTransformationUnit. + */ + public static final MetricTransformationUnit COUNT_SECOND = fromString("Count/Second"); + + /** + * Static value Gigabits for MetricTransformationUnit. + */ + public static final MetricTransformationUnit GIGABITS = fromString("Gigabits"); + + /** + * Static value Gigabits/Second for MetricTransformationUnit. + */ + public static final MetricTransformationUnit GIGABITS_SECOND = fromString("Gigabits/Second"); + + /** + * Static value Gigabytes for MetricTransformationUnit. + */ + public static final MetricTransformationUnit GIGABYTES = fromString("Gigabytes"); + + /** + * Static value Gigabytes/Second for MetricTransformationUnit. + */ + public static final MetricTransformationUnit GIGABYTES_SECOND = fromString("Gigabytes/Second"); + + /** + * Static value Kilobits for MetricTransformationUnit. + */ + public static final MetricTransformationUnit KILOBITS = fromString("Kilobits"); + + /** + * Static value Kilobits/Second for MetricTransformationUnit. + */ + public static final MetricTransformationUnit KILOBITS_SECOND = fromString("Kilobits/Second"); + + /** + * Static value Kilobytes for MetricTransformationUnit. + */ + public static final MetricTransformationUnit KILOBYTES = fromString("Kilobytes"); + + /** + * Static value Kilobytes/Second for MetricTransformationUnit. + */ + public static final MetricTransformationUnit KILOBYTES_SECOND = fromString("Kilobytes/Second"); + + /** + * Static value Megabits for MetricTransformationUnit. + */ + public static final MetricTransformationUnit MEGABITS = fromString("Megabits"); + + /** + * Static value Megabits/Second for MetricTransformationUnit. + */ + public static final MetricTransformationUnit MEGABITS_SECOND = fromString("Megabits/Second"); + + /** + * Static value Megabytes for MetricTransformationUnit. + */ + public static final MetricTransformationUnit MEGABYTES = fromString("Megabytes"); + + /** + * Static value Megabytes/Second for MetricTransformationUnit. + */ + public static final MetricTransformationUnit MEGABYTES_SECOND = fromString("Megabytes/Second"); + + /** + * Static value Microseconds for MetricTransformationUnit. + */ + public static final MetricTransformationUnit MICROSECONDS = fromString("Microseconds"); + + /** + * Static value Milliseconds for MetricTransformationUnit. + */ + public static final MetricTransformationUnit MILLISECONDS = fromString("Milliseconds"); + + /** + * Static value None for MetricTransformationUnit. + */ + public static final MetricTransformationUnit NONE = fromString("None"); + + /** + * Static value Percent for MetricTransformationUnit. + */ + public static final MetricTransformationUnit PERCENT = fromString("Percent"); + + /** + * Static value Seconds for MetricTransformationUnit. + */ + public static final MetricTransformationUnit SECONDS = fromString("Seconds"); + + /** + * Static value Terabits for MetricTransformationUnit. + */ + public static final MetricTransformationUnit TERABITS = fromString("Terabits"); + + /** + * Static value Terabits/Second for MetricTransformationUnit. + */ + public static final MetricTransformationUnit TERABITS_SECOND = fromString("Terabits/Second"); + + /** + * Static value Terabytes for MetricTransformationUnit. + */ + public static final MetricTransformationUnit TERABYTES = fromString("Terabytes"); + + /** + * Static value Terabytes/Second for MetricTransformationUnit. + */ + public static final MetricTransformationUnit TERABYTES_SECOND = fromString("Terabytes/Second"); + + /** + * Creates a new instance of MetricTransformationUnit value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public MetricTransformationUnit() { + } + + /** + * Creates or finds a MetricTransformationUnit from its string representation. + * + * @param name a name to look for. + * @return the corresponding MetricTransformationUnit. + */ + public static MetricTransformationUnit fromString(String name) { + return fromString(name, MetricTransformationUnit.class); + } + + /** + * Gets known MetricTransformationUnit values. + * + * @return known MetricTransformationUnit values. + */ + public static Collection values() { + return values(MetricTransformationUnit.class); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/Metrics.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/Metrics.java new file mode 100644 index 000000000000..04c7a5b20123 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/Metrics.java @@ -0,0 +1,130 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of Metrics. + */ +@Fluent +public final class Metrics implements JsonSerializable { + /* + * A container specifying the time threshold for emitting the ``s3:Replication:OperationMissedThreshold`` event. A + * container specifying the time value for S3 Replication Time Control (S3 RTC) and replication metrics + * ``EventThreshold``. + */ + private ReplicationTimeValue eventThreshold; + + /* + * Specifies whether the replication metrics are enabled. + */ + private MetricsStatus status; + + /** + * Creates an instance of Metrics class. + */ + public Metrics() { + } + + /** + * Get the eventThreshold property: A container specifying the time threshold for emitting the + * ``s3:Replication:OperationMissedThreshold`` event. A container specifying the time value for S3 Replication Time + * Control (S3 RTC) and replication metrics ``EventThreshold``. + * + * @return the eventThreshold value. + */ + public ReplicationTimeValue eventThreshold() { + return this.eventThreshold; + } + + /** + * Set the eventThreshold property: A container specifying the time threshold for emitting the + * ``s3:Replication:OperationMissedThreshold`` event. A container specifying the time value for S3 Replication Time + * Control (S3 RTC) and replication metrics ``EventThreshold``. + * + * @param eventThreshold the eventThreshold value to set. + * @return the Metrics object itself. + */ + public Metrics withEventThreshold(ReplicationTimeValue eventThreshold) { + this.eventThreshold = eventThreshold; + return this; + } + + /** + * Get the status property: Specifies whether the replication metrics are enabled. + * + * @return the status value. + */ + public MetricsStatus status() { + return this.status; + } + + /** + * Set the status property: Specifies whether the replication metrics are enabled. + * + * @param status the status value to set. + * @return the Metrics object itself. + */ + public Metrics withStatus(MetricsStatus status) { + this.status = status; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (eventThreshold() != null) { + eventThreshold().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("eventThreshold", this.eventThreshold); + jsonWriter.writeStringField("status", this.status == null ? null : this.status.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of Metrics from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of Metrics if the JsonReader was pointing to an instance of it, or null if it was pointing to + * JSON null. + * @throws IOException If an error occurs while reading the Metrics. + */ + public static Metrics fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + Metrics deserializedMetrics = new Metrics(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("eventThreshold".equals(fieldName)) { + deserializedMetrics.eventThreshold = ReplicationTimeValue.fromJson(reader); + } else if ("status".equals(fieldName)) { + deserializedMetrics.status = MetricsStatus.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedMetrics; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/MetricsCollection.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/MetricsCollection.java new file mode 100644 index 000000000000..a594e2e304c3 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/MetricsCollection.java @@ -0,0 +1,153 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Definition of MetricsCollection. + */ +@Fluent +public final class MetricsCollection implements JsonSerializable { + /* + * The frequency at which Amazon EC2 Auto Scaling sends aggregated data to CloudWatch. The only valid value is + * ``1Minute``. + */ + private String granularity; + + /* + * Identifies the metrics to enable. You can specify one or more of the following metrics: + ``GroupMinSize`` + + * ``GroupMaxSize`` + ``GroupDesiredCapacity`` + ``GroupInServiceInstances`` + ``GroupPendingInstances`` + + * ``GroupStandbyInstances`` + ``GroupTerminatingInstances`` + ``GroupTotalInstances`` + ``GroupInServiceCapacity`` + * + ``GroupPendingCapacity`` + ``GroupStandbyCapacity`` + ``GroupTerminatingCapacity`` + ``GroupTotalCapacity`` + + * ``WarmPoolDesiredCapacity`` + ``WarmPoolWarmedCapacity`` + ``WarmPoolPendingCapacity`` + + * ``WarmPoolTerminatingCapacity`` + ``WarmPoolTotalCapacity`` + ``GroupAndWarmPoolDesiredCapacity`` + + * ``GroupAndWarmPoolTotalCapacity`` If you specify ``Granularity`` and don't specify any metrics, all metrics are + * enabled. For more information, see [Auto Scaling group + * metrics](https://docs.aws.amazon.com/autoscaling/ec2/userguide/ec2-auto-scaling-cloudwatch-monitoring.html#as- + * group-metrics) in the *Amazon EC2 Auto Scaling User Guide*. + */ + private List metrics; + + /** + * Creates an instance of MetricsCollection class. + */ + public MetricsCollection() { + } + + /** + * Get the granularity property: The frequency at which Amazon EC2 Auto Scaling sends aggregated data to CloudWatch. + * The only valid value is ``1Minute``. + * + * @return the granularity value. + */ + public String granularity() { + return this.granularity; + } + + /** + * Set the granularity property: The frequency at which Amazon EC2 Auto Scaling sends aggregated data to CloudWatch. + * The only valid value is ``1Minute``. + * + * @param granularity the granularity value to set. + * @return the MetricsCollection object itself. + */ + public MetricsCollection withGranularity(String granularity) { + this.granularity = granularity; + return this; + } + + /** + * Get the metrics property: Identifies the metrics to enable. You can specify one or more of the following metrics: + * + ``GroupMinSize`` + ``GroupMaxSize`` + ``GroupDesiredCapacity`` + ``GroupInServiceInstances`` + + * ``GroupPendingInstances`` + ``GroupStandbyInstances`` + ``GroupTerminatingInstances`` + ``GroupTotalInstances`` + + * ``GroupInServiceCapacity`` + ``GroupPendingCapacity`` + ``GroupStandbyCapacity`` + ``GroupTerminatingCapacity`` + + * ``GroupTotalCapacity`` + ``WarmPoolDesiredCapacity`` + ``WarmPoolWarmedCapacity`` + ``WarmPoolPendingCapacity`` + + * ``WarmPoolTerminatingCapacity`` + ``WarmPoolTotalCapacity`` + ``GroupAndWarmPoolDesiredCapacity`` + + * ``GroupAndWarmPoolTotalCapacity`` If you specify ``Granularity`` and don't specify any metrics, all metrics are + * enabled. For more information, see [Auto Scaling group + * metrics](https://docs.aws.amazon.com/autoscaling/ec2/userguide/ec2-auto-scaling-cloudwatch-monitoring.html#as-group-metrics) + * in the *Amazon EC2 Auto Scaling User Guide*. + * + * @return the metrics value. + */ + public List metrics() { + return this.metrics; + } + + /** + * Set the metrics property: Identifies the metrics to enable. You can specify one or more of the following metrics: + * + ``GroupMinSize`` + ``GroupMaxSize`` + ``GroupDesiredCapacity`` + ``GroupInServiceInstances`` + + * ``GroupPendingInstances`` + ``GroupStandbyInstances`` + ``GroupTerminatingInstances`` + ``GroupTotalInstances`` + + * ``GroupInServiceCapacity`` + ``GroupPendingCapacity`` + ``GroupStandbyCapacity`` + ``GroupTerminatingCapacity`` + + * ``GroupTotalCapacity`` + ``WarmPoolDesiredCapacity`` + ``WarmPoolWarmedCapacity`` + ``WarmPoolPendingCapacity`` + + * ``WarmPoolTerminatingCapacity`` + ``WarmPoolTotalCapacity`` + ``GroupAndWarmPoolDesiredCapacity`` + + * ``GroupAndWarmPoolTotalCapacity`` If you specify ``Granularity`` and don't specify any metrics, all metrics are + * enabled. For more information, see [Auto Scaling group + * metrics](https://docs.aws.amazon.com/autoscaling/ec2/userguide/ec2-auto-scaling-cloudwatch-monitoring.html#as-group-metrics) + * in the *Amazon EC2 Auto Scaling User Guide*. + * + * @param metrics the metrics value to set. + * @return the MetricsCollection object itself. + */ + public MetricsCollection withMetrics(List metrics) { + this.metrics = metrics; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("granularity", this.granularity); + jsonWriter.writeArrayField("metrics", this.metrics, (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MetricsCollection from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MetricsCollection if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the MetricsCollection. + */ + public static MetricsCollection fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MetricsCollection deserializedMetricsCollection = new MetricsCollection(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("granularity".equals(fieldName)) { + deserializedMetricsCollection.granularity = reader.getString(); + } else if ("metrics".equals(fieldName)) { + List metrics = reader.readArray(reader1 -> reader1.getString()); + deserializedMetricsCollection.metrics = metrics; + } else { + reader.skipChildren(); + } + } + + return deserializedMetricsCollection; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/MetricsConfiguration.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/MetricsConfiguration.java new file mode 100644 index 000000000000..d1031c6e705d --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/MetricsConfiguration.java @@ -0,0 +1,191 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Definition of MetricsConfiguration. + */ +@Fluent +public final class MetricsConfiguration implements JsonSerializable { + /* + * The access point that was used while performing operations on the object. The metrics configuration only includes + * objects that meet the filter's criteria. + */ + private String accessPointArn; + + /* + * The ID used to identify the metrics configuration. This can be any value you choose that helps you identify your + * metrics configuration. + */ + private String id; + + /* + * The prefix that an object must have to be included in the metrics results. + */ + private String prefix; + + /* + * Specifies a list of tag filters to use as a metrics configuration filter. The metrics configuration includes only + * objects that meet the filter's criteria. + */ + private List tagFilters; + + /** + * Creates an instance of MetricsConfiguration class. + */ + public MetricsConfiguration() { + } + + /** + * Get the accessPointArn property: The access point that was used while performing operations on the object. The + * metrics configuration only includes objects that meet the filter's criteria. + * + * @return the accessPointArn value. + */ + public String accessPointArn() { + return this.accessPointArn; + } + + /** + * Set the accessPointArn property: The access point that was used while performing operations on the object. The + * metrics configuration only includes objects that meet the filter's criteria. + * + * @param accessPointArn the accessPointArn value to set. + * @return the MetricsConfiguration object itself. + */ + public MetricsConfiguration withAccessPointArn(String accessPointArn) { + this.accessPointArn = accessPointArn; + return this; + } + + /** + * Get the id property: The ID used to identify the metrics configuration. This can be any value you choose that + * helps you identify your metrics configuration. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Set the id property: The ID used to identify the metrics configuration. This can be any value you choose that + * helps you identify your metrics configuration. + * + * @param id the id value to set. + * @return the MetricsConfiguration object itself. + */ + public MetricsConfiguration withId(String id) { + this.id = id; + return this; + } + + /** + * Get the prefix property: The prefix that an object must have to be included in the metrics results. + * + * @return the prefix value. + */ + public String prefix() { + return this.prefix; + } + + /** + * Set the prefix property: The prefix that an object must have to be included in the metrics results. + * + * @param prefix the prefix value to set. + * @return the MetricsConfiguration object itself. + */ + public MetricsConfiguration withPrefix(String prefix) { + this.prefix = prefix; + return this; + } + + /** + * Get the tagFilters property: Specifies a list of tag filters to use as a metrics configuration filter. The + * metrics configuration includes only objects that meet the filter's criteria. + * + * @return the tagFilters value. + */ + public List tagFilters() { + return this.tagFilters; + } + + /** + * Set the tagFilters property: Specifies a list of tag filters to use as a metrics configuration filter. The + * metrics configuration includes only objects that meet the filter's criteria. + * + * @param tagFilters the tagFilters value to set. + * @return the MetricsConfiguration object itself. + */ + public MetricsConfiguration withTagFilters(List tagFilters) { + this.tagFilters = tagFilters; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (tagFilters() != null) { + tagFilters().forEach(e -> e.validate()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("accessPointArn", this.accessPointArn); + jsonWriter.writeStringField("id", this.id); + jsonWriter.writeStringField("prefix", this.prefix); + jsonWriter.writeArrayField("tagFilters", this.tagFilters, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MetricsConfiguration from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MetricsConfiguration if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the MetricsConfiguration. + */ + public static MetricsConfiguration fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MetricsConfiguration deserializedMetricsConfiguration = new MetricsConfiguration(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("accessPointArn".equals(fieldName)) { + deserializedMetricsConfiguration.accessPointArn = reader.getString(); + } else if ("id".equals(fieldName)) { + deserializedMetricsConfiguration.id = reader.getString(); + } else if ("prefix".equals(fieldName)) { + deserializedMetricsConfiguration.prefix = reader.getString(); + } else if ("tagFilters".equals(fieldName)) { + List tagFilters = reader.readArray(reader1 -> TagFilter.fromJson(reader1)); + deserializedMetricsConfiguration.tagFilters = tagFilters; + } else { + reader.skipChildren(); + } + } + + return deserializedMetricsConfiguration; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/MetricsStatus.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/MetricsStatus.java new file mode 100644 index 000000000000..9e92be1354df --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/MetricsStatus.java @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * MetricsStatus enum. + */ +public final class MetricsStatus extends ExpandableStringEnum { + /** + * Static value Disabled for MetricsStatus. + */ + public static final MetricsStatus DISABLED = fromString("Disabled"); + + /** + * Static value Enabled for MetricsStatus. + */ + public static final MetricsStatus ENABLED = fromString("Enabled"); + + /** + * Creates a new instance of MetricsStatus value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public MetricsStatus() { + } + + /** + * Creates or finds a MetricsStatus from its string representation. + * + * @param name a name to look for. + * @return the corresponding MetricsStatus. + */ + public static MetricsStatus fromString(String name) { + return fromString(name, MetricsStatus.class); + } + + /** + * Gets known MetricsStatus values. + * + * @return known MetricsStatus values. + */ + public static Collection values() { + return values(MetricsStatus.class); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/MitigationInEffectEnum.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/MitigationInEffectEnum.java new file mode 100644 index 000000000000..f8c4206c75d8 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/MitigationInEffectEnum.java @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * MitigationInEffectEnum enum. + */ +public final class MitigationInEffectEnum extends ExpandableStringEnum { + /** + * Static value no for MitigationInEffectEnum. + */ + public static final MitigationInEffectEnum NO = fromString("no"); + + /** + * Static value yes for MitigationInEffectEnum. + */ + public static final MitigationInEffectEnum YES = fromString("yes"); + + /** + * Creates a new instance of MitigationInEffectEnum value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public MitigationInEffectEnum() { + } + + /** + * Creates or finds a MitigationInEffectEnum from its string representation. + * + * @param name a name to look for. + * @return the corresponding MitigationInEffectEnum. + */ + public static MitigationInEffectEnum fromString(String name) { + return fromString(name, MitigationInEffectEnum.class); + } + + /** + * Gets known MitigationInEffectEnum values. + * + * @return known MitigationInEffectEnum values. + */ + public static Collection values() { + return values(MitigationInEffectEnum.class); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/MitigationInEffectEnumValue.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/MitigationInEffectEnumValue.java new file mode 100644 index 000000000000..ae2aec9e299a --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/MitigationInEffectEnumValue.java @@ -0,0 +1,94 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of MitigationInEffectEnumEnumValue. + */ +@Fluent +public final class MitigationInEffectEnumValue implements JsonSerializable { + /* + * Property value + */ + private MitigationInEffectEnum value; + + /** + * Creates an instance of MitigationInEffectEnumValue class. + */ + public MitigationInEffectEnumValue() { + } + + /** + * Get the value property: Property value. + * + * @return the value value. + */ + public MitigationInEffectEnum value() { + return this.value; + } + + /** + * Set the value property: Property value. + * + * @param value the value value to set. + * @return the MitigationInEffectEnumValue object itself. + */ + public MitigationInEffectEnumValue withValue(MitigationInEffectEnum value) { + this.value = value; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("value", this.value == null ? null : this.value.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MitigationInEffectEnumValue from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MitigationInEffectEnumValue if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the MitigationInEffectEnumValue. + */ + public static MitigationInEffectEnumValue fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MitigationInEffectEnumValue deserializedMitigationInEffectEnumValue = new MitigationInEffectEnumValue(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + deserializedMitigationInEffectEnumValue.value + = MitigationInEffectEnum.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedMitigationInEffectEnumValue; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/MixedInstancesPolicy.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/MixedInstancesPolicy.java new file mode 100644 index 000000000000..f8ed47379137 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/MixedInstancesPolicy.java @@ -0,0 +1,164 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of MixedInstancesPolicy. + */ +@Fluent +public final class MixedInstancesPolicy implements JsonSerializable { + /* + * The instances distribution. Use this structure to specify the distribution of On-Demand Instances and Spot + * Instances and the allocation strategies used to fulfill On-Demand and Spot capacities for a mixed instances + * policy. For more information, see [Auto Scaling groups with multiple instance types and purchase + * options](https://docs.aws.amazon.com/autoscaling/ec2/userguide/ec2-auto-scaling-mixed-instances-groups.html) in + * the *Amazon EC2 Auto Scaling User Guide*. ``InstancesDistribution`` is a property of the + * [AWS::AutoScaling::AutoScalingGroup + * MixedInstancesPolicy](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-autoscaling- + * autoscalinggroup-mixedinstancespolicy.html) property type. + */ + private InstancesDistribution instancesDistribution; + + /* + * One or more launch templates and the instance types (overrides) that are used to launch EC2 instances to fulfill + * On-Demand and Spot capacities. Use this structure to specify the launch templates and instance types (overrides) + * for a mixed instances policy. ``LaunchTemplate`` is a property of the [AWS::AutoScaling::AutoScalingGroup + * MixedInstancesPolicy](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-autoscaling- + * autoscalinggroup-mixedinstancespolicy.html) property type. + */ + private LaunchTemplate launchTemplate; + + /** + * Creates an instance of MixedInstancesPolicy class. + */ + public MixedInstancesPolicy() { + } + + /** + * Get the instancesDistribution property: The instances distribution. Use this structure to specify the + * distribution of On-Demand Instances and Spot Instances and the allocation strategies used to fulfill On-Demand + * and Spot capacities for a mixed instances policy. For more information, see [Auto Scaling groups with multiple + * instance types and purchase + * options](https://docs.aws.amazon.com/autoscaling/ec2/userguide/ec2-auto-scaling-mixed-instances-groups.html) in + * the *Amazon EC2 Auto Scaling User Guide*. ``InstancesDistribution`` is a property of the + * [AWS::AutoScaling::AutoScalingGroup + * MixedInstancesPolicy](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-autoscaling-autoscalinggroup-mixedinstancespolicy.html) + * property type. + * + * @return the instancesDistribution value. + */ + public InstancesDistribution instancesDistribution() { + return this.instancesDistribution; + } + + /** + * Set the instancesDistribution property: The instances distribution. Use this structure to specify the + * distribution of On-Demand Instances and Spot Instances and the allocation strategies used to fulfill On-Demand + * and Spot capacities for a mixed instances policy. For more information, see [Auto Scaling groups with multiple + * instance types and purchase + * options](https://docs.aws.amazon.com/autoscaling/ec2/userguide/ec2-auto-scaling-mixed-instances-groups.html) in + * the *Amazon EC2 Auto Scaling User Guide*. ``InstancesDistribution`` is a property of the + * [AWS::AutoScaling::AutoScalingGroup + * MixedInstancesPolicy](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-autoscaling-autoscalinggroup-mixedinstancespolicy.html) + * property type. + * + * @param instancesDistribution the instancesDistribution value to set. + * @return the MixedInstancesPolicy object itself. + */ + public MixedInstancesPolicy withInstancesDistribution(InstancesDistribution instancesDistribution) { + this.instancesDistribution = instancesDistribution; + return this; + } + + /** + * Get the launchTemplate property: One or more launch templates and the instance types (overrides) that are used to + * launch EC2 instances to fulfill On-Demand and Spot capacities. Use this structure to specify the launch templates + * and instance types (overrides) for a mixed instances policy. ``LaunchTemplate`` is a property of the + * [AWS::AutoScaling::AutoScalingGroup + * MixedInstancesPolicy](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-autoscaling-autoscalinggroup-mixedinstancespolicy.html) + * property type. + * + * @return the launchTemplate value. + */ + public LaunchTemplate launchTemplate() { + return this.launchTemplate; + } + + /** + * Set the launchTemplate property: One or more launch templates and the instance types (overrides) that are used to + * launch EC2 instances to fulfill On-Demand and Spot capacities. Use this structure to specify the launch templates + * and instance types (overrides) for a mixed instances policy. ``LaunchTemplate`` is a property of the + * [AWS::AutoScaling::AutoScalingGroup + * MixedInstancesPolicy](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-autoscaling-autoscalinggroup-mixedinstancespolicy.html) + * property type. + * + * @param launchTemplate the launchTemplate value to set. + * @return the MixedInstancesPolicy object itself. + */ + public MixedInstancesPolicy withLaunchTemplate(LaunchTemplate launchTemplate) { + this.launchTemplate = launchTemplate; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (instancesDistribution() != null) { + instancesDistribution().validate(); + } + if (launchTemplate() != null) { + launchTemplate().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("instancesDistribution", this.instancesDistribution); + jsonWriter.writeJsonField("launchTemplate", this.launchTemplate); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MixedInstancesPolicy from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MixedInstancesPolicy if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the MixedInstancesPolicy. + */ + public static MixedInstancesPolicy fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MixedInstancesPolicy deserializedMixedInstancesPolicy = new MixedInstancesPolicy(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("instancesDistribution".equals(fieldName)) { + deserializedMixedInstancesPolicy.instancesDistribution = InstancesDistribution.fromJson(reader); + } else if ("launchTemplate".equals(fieldName)) { + deserializedMixedInstancesPolicy.launchTemplate = LaunchTemplate.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedMixedInstancesPolicy; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ModifyingProperties.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ModifyingProperties.java new file mode 100644 index 000000000000..18bc63c037de --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ModifyingProperties.java @@ -0,0 +1,194 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of ModifyingProperties. + */ +@Fluent +public final class ModifyingProperties implements JsonSerializable { + /* + *

The current value of the domain property that is being modified.

+ */ + private String activeValue; + + /* + *

The name of the property that is currently being modified.

+ */ + private String name; + + /* + *

The value that the property that is currently being modified will eventually have.

+ */ + private String pendingValue; + + /* + *

The type of value that is currently being modified. Properties can have two types:

  • + * PLAIN_TEXT: Contain direct values such as '1', 'True', or 'c5.large.search'.

  • + * STRINGIFIED_JSON: Contain content in JSON format, such as {'Enabled':'True'}'.

+ */ + private PropertyValueTypeEnumValue valueType; + + /** + * Creates an instance of ModifyingProperties class. + */ + public ModifyingProperties() { + } + + /** + * Get the activeValue property: <p>The current value of the domain property that is being + * modified.</p>. + * + * @return the activeValue value. + */ + public String activeValue() { + return this.activeValue; + } + + /** + * Set the activeValue property: <p>The current value of the domain property that is being + * modified.</p>. + * + * @param activeValue the activeValue value to set. + * @return the ModifyingProperties object itself. + */ + public ModifyingProperties withActiveValue(String activeValue) { + this.activeValue = activeValue; + return this; + } + + /** + * Get the name property: <p>The name of the property that is currently being modified.</p>. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: <p>The name of the property that is currently being modified.</p>. + * + * @param name the name value to set. + * @return the ModifyingProperties object itself. + */ + public ModifyingProperties withName(String name) { + this.name = name; + return this; + } + + /** + * Get the pendingValue property: <p>The value that the property that is currently being modified will + * eventually have.</p>. + * + * @return the pendingValue value. + */ + public String pendingValue() { + return this.pendingValue; + } + + /** + * Set the pendingValue property: <p>The value that the property that is currently being modified will + * eventually have.</p>. + * + * @param pendingValue the pendingValue value to set. + * @return the ModifyingProperties object itself. + */ + public ModifyingProperties withPendingValue(String pendingValue) { + this.pendingValue = pendingValue; + return this; + } + + /** + * Get the valueType property: <p>The type of value that is currently being modified. Properties can have two + * types:</p> <ul> <li> <p> <code>PLAIN_TEXT</code>: Contain direct values such + * as '1', 'True', or 'c5.large.search'.</p> </li> <li> <p> + * <code>STRINGIFIED_JSON</code>: Contain content in JSON format, such as {'Enabled':'True'}'.</p> + * </li> </ul>. + * + * @return the valueType value. + */ + public PropertyValueTypeEnumValue valueType() { + return this.valueType; + } + + /** + * Set the valueType property: <p>The type of value that is currently being modified. Properties can have two + * types:</p> <ul> <li> <p> <code>PLAIN_TEXT</code>: Contain direct values such + * as '1', 'True', or 'c5.large.search'.</p> </li> <li> <p> + * <code>STRINGIFIED_JSON</code>: Contain content in JSON format, such as {'Enabled':'True'}'.</p> + * </li> </ul>. + * + * @param valueType the valueType value to set. + * @return the ModifyingProperties object itself. + */ + public ModifyingProperties withValueType(PropertyValueTypeEnumValue valueType) { + this.valueType = valueType; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (valueType() != null) { + valueType().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("activeValue", this.activeValue); + jsonWriter.writeStringField("name", this.name); + jsonWriter.writeStringField("pendingValue", this.pendingValue); + jsonWriter.writeJsonField("valueType", this.valueType); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ModifyingProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ModifyingProperties if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the ModifyingProperties. + */ + public static ModifyingProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ModifyingProperties deserializedModifyingProperties = new ModifyingProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("activeValue".equals(fieldName)) { + deserializedModifyingProperties.activeValue = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedModifyingProperties.name = reader.getString(); + } else if ("pendingValue".equals(fieldName)) { + deserializedModifyingProperties.pendingValue = reader.getString(); + } else if ("valueType".equals(fieldName)) { + deserializedModifyingProperties.valueType = PropertyValueTypeEnumValue.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedModifyingProperties; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/Monitoring.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/Monitoring.java new file mode 100644 index 000000000000..5512f245e211 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/Monitoring.java @@ -0,0 +1,98 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of Monitoring. + */ +@Fluent +public final class Monitoring implements JsonSerializable { + /* + *

Indicates whether detailed monitoring is enabled. Otherwise, basic monitoring is enabled.

+ */ + private MonitoringStateEnumValue state; + + /** + * Creates an instance of Monitoring class. + */ + public Monitoring() { + } + + /** + * Get the state property: <p>Indicates whether detailed monitoring is enabled. Otherwise, basic monitoring is + * enabled.</p>. + * + * @return the state value. + */ + public MonitoringStateEnumValue state() { + return this.state; + } + + /** + * Set the state property: <p>Indicates whether detailed monitoring is enabled. Otherwise, basic monitoring is + * enabled.</p>. + * + * @param state the state value to set. + * @return the Monitoring object itself. + */ + public Monitoring withState(MonitoringStateEnumValue state) { + this.state = state; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (state() != null) { + state().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("state", this.state); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of Monitoring from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of Monitoring if the JsonReader was pointing to an instance of it, or null if it was pointing + * to JSON null. + * @throws IOException If an error occurs while reading the Monitoring. + */ + public static Monitoring fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + Monitoring deserializedMonitoring = new Monitoring(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("state".equals(fieldName)) { + deserializedMonitoring.state = MonitoringStateEnumValue.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedMonitoring; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/MonitoringState.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/MonitoringState.java new file mode 100644 index 000000000000..019891591ca7 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/MonitoringState.java @@ -0,0 +1,61 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * MonitoringState enum. + */ +public final class MonitoringState extends ExpandableStringEnum { + /** + * Static value disabled for MonitoringState. + */ + public static final MonitoringState DISABLED = fromString("disabled"); + + /** + * Static value disabling for MonitoringState. + */ + public static final MonitoringState DISABLING = fromString("disabling"); + + /** + * Static value enabled for MonitoringState. + */ + public static final MonitoringState ENABLED = fromString("enabled"); + + /** + * Static value pending for MonitoringState. + */ + public static final MonitoringState PENDING = fromString("pending"); + + /** + * Creates a new instance of MonitoringState value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public MonitoringState() { + } + + /** + * Creates or finds a MonitoringState from its string representation. + * + * @param name a name to look for. + * @return the corresponding MonitoringState. + */ + public static MonitoringState fromString(String name) { + return fromString(name, MonitoringState.class); + } + + /** + * Gets known MonitoringState values. + * + * @return known MonitoringState values. + */ + public static Collection values() { + return values(MonitoringState.class); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/MonitoringStateEnumValue.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/MonitoringStateEnumValue.java new file mode 100644 index 000000000000..fa5e88801239 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/MonitoringStateEnumValue.java @@ -0,0 +1,93 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of MonitoringStateEnumValue. + */ +@Fluent +public final class MonitoringStateEnumValue implements JsonSerializable { + /* + * Property value + */ + private MonitoringState value; + + /** + * Creates an instance of MonitoringStateEnumValue class. + */ + public MonitoringStateEnumValue() { + } + + /** + * Get the value property: Property value. + * + * @return the value value. + */ + public MonitoringState value() { + return this.value; + } + + /** + * Set the value property: Property value. + * + * @param value the value value to set. + * @return the MonitoringStateEnumValue object itself. + */ + public MonitoringStateEnumValue withValue(MonitoringState value) { + this.value = value; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("value", this.value == null ? null : this.value.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MonitoringStateEnumValue from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MonitoringStateEnumValue if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IOException If an error occurs while reading the MonitoringStateEnumValue. + */ + public static MonitoringStateEnumValue fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MonitoringStateEnumValue deserializedMonitoringStateEnumValue = new MonitoringStateEnumValue(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + deserializedMonitoringStateEnumValue.value = MonitoringState.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedMonitoringStateEnumValue; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/MonthlyTransfer.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/MonthlyTransfer.java new file mode 100644 index 000000000000..916db60ed3c0 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/MonthlyTransfer.java @@ -0,0 +1,93 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of MonthlyTransfer. + */ +@Fluent +public final class MonthlyTransfer implements JsonSerializable { + /* + * GbPerMonthAllocated of the Instance. + */ + private String gbPerMonthAllocated; + + /** + * Creates an instance of MonthlyTransfer class. + */ + public MonthlyTransfer() { + } + + /** + * Get the gbPerMonthAllocated property: GbPerMonthAllocated of the Instance. + * + * @return the gbPerMonthAllocated value. + */ + public String gbPerMonthAllocated() { + return this.gbPerMonthAllocated; + } + + /** + * Set the gbPerMonthAllocated property: GbPerMonthAllocated of the Instance. + * + * @param gbPerMonthAllocated the gbPerMonthAllocated value to set. + * @return the MonthlyTransfer object itself. + */ + public MonthlyTransfer withGbPerMonthAllocated(String gbPerMonthAllocated) { + this.gbPerMonthAllocated = gbPerMonthAllocated; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("gbPerMonthAllocated", this.gbPerMonthAllocated); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MonthlyTransfer from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MonthlyTransfer if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the MonthlyTransfer. + */ + public static MonthlyTransfer fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MonthlyTransfer deserializedMonthlyTransfer = new MonthlyTransfer(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("gbPerMonthAllocated".equals(fieldName)) { + deserializedMonthlyTransfer.gbPerMonthAllocated = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedMonthlyTransfer; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/MountPoint.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/MountPoint.java new file mode 100644 index 000000000000..d0265027837f --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/MountPoint.java @@ -0,0 +1,155 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of MountPoint. + */ +@Fluent +public final class MountPoint implements JsonSerializable { + /* + * The path on the container to mount the host volume at. + */ + private String containerPath; + + /* + * If this value is ``true``, the container has read-only access to the volume. If this value is ``false``, then the + * container can write to the volume. The default value is ``false``. + */ + private Boolean readOnly; + + /* + * The name of the volume to mount. Must be a volume name referenced in the ``name`` parameter of task definition + * ``volume``. + */ + private String sourceVolume; + + /** + * Creates an instance of MountPoint class. + */ + public MountPoint() { + } + + /** + * Get the containerPath property: The path on the container to mount the host volume at. + * + * @return the containerPath value. + */ + public String containerPath() { + return this.containerPath; + } + + /** + * Set the containerPath property: The path on the container to mount the host volume at. + * + * @param containerPath the containerPath value to set. + * @return the MountPoint object itself. + */ + public MountPoint withContainerPath(String containerPath) { + this.containerPath = containerPath; + return this; + } + + /** + * Get the readOnly property: If this value is ``true``, the container has read-only access to the volume. If this + * value is ``false``, then the container can write to the volume. The default value is ``false``. + * + * @return the readOnly value. + */ + public Boolean readOnly() { + return this.readOnly; + } + + /** + * Set the readOnly property: If this value is ``true``, the container has read-only access to the volume. If this + * value is ``false``, then the container can write to the volume. The default value is ``false``. + * + * @param readOnly the readOnly value to set. + * @return the MountPoint object itself. + */ + public MountPoint withReadOnly(Boolean readOnly) { + this.readOnly = readOnly; + return this; + } + + /** + * Get the sourceVolume property: The name of the volume to mount. Must be a volume name referenced in the ``name`` + * parameter of task definition ``volume``. + * + * @return the sourceVolume value. + */ + public String sourceVolume() { + return this.sourceVolume; + } + + /** + * Set the sourceVolume property: The name of the volume to mount. Must be a volume name referenced in the ``name`` + * parameter of task definition ``volume``. + * + * @param sourceVolume the sourceVolume value to set. + * @return the MountPoint object itself. + */ + public MountPoint withSourceVolume(String sourceVolume) { + this.sourceVolume = sourceVolume; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("containerPath", this.containerPath); + jsonWriter.writeBooleanField("readOnly", this.readOnly); + jsonWriter.writeStringField("sourceVolume", this.sourceVolume); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MountPoint from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MountPoint if the JsonReader was pointing to an instance of it, or null if it was pointing + * to JSON null. + * @throws IOException If an error occurs while reading the MountPoint. + */ + public static MountPoint fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MountPoint deserializedMountPoint = new MountPoint(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("containerPath".equals(fieldName)) { + deserializedMountPoint.containerPath = reader.getString(); + } else if ("readOnly".equals(fieldName)) { + deserializedMountPoint.readOnly = reader.getNullable(JsonReader::getBoolean); + } else if ("sourceVolume".equals(fieldName)) { + deserializedMountPoint.sourceVolume = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedMountPoint; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/MutualAuthentication.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/MutualAuthentication.java new file mode 100644 index 000000000000..93dce1b0e2b2 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/MutualAuthentication.java @@ -0,0 +1,153 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of MutualAuthentication. + */ +@Fluent +public final class MutualAuthentication implements JsonSerializable { + /* + * Indicates whether expired client certificates are ignored. + */ + private Boolean ignoreClientCertificateExpiry; + + /* + * The client certificate handling method. Options are ``off``, ``passthrough`` or ``verify``. The default value is + * ``off``. + */ + private String mode; + + /* + * The Amazon Resource Name (ARN) of the trust store. + */ + private String trustStoreArn; + + /** + * Creates an instance of MutualAuthentication class. + */ + public MutualAuthentication() { + } + + /** + * Get the ignoreClientCertificateExpiry property: Indicates whether expired client certificates are ignored. + * + * @return the ignoreClientCertificateExpiry value. + */ + public Boolean ignoreClientCertificateExpiry() { + return this.ignoreClientCertificateExpiry; + } + + /** + * Set the ignoreClientCertificateExpiry property: Indicates whether expired client certificates are ignored. + * + * @param ignoreClientCertificateExpiry the ignoreClientCertificateExpiry value to set. + * @return the MutualAuthentication object itself. + */ + public MutualAuthentication withIgnoreClientCertificateExpiry(Boolean ignoreClientCertificateExpiry) { + this.ignoreClientCertificateExpiry = ignoreClientCertificateExpiry; + return this; + } + + /** + * Get the mode property: The client certificate handling method. Options are ``off``, ``passthrough`` or + * ``verify``. The default value is ``off``. + * + * @return the mode value. + */ + public String mode() { + return this.mode; + } + + /** + * Set the mode property: The client certificate handling method. Options are ``off``, ``passthrough`` or + * ``verify``. The default value is ``off``. + * + * @param mode the mode value to set. + * @return the MutualAuthentication object itself. + */ + public MutualAuthentication withMode(String mode) { + this.mode = mode; + return this; + } + + /** + * Get the trustStoreArn property: The Amazon Resource Name (ARN) of the trust store. + * + * @return the trustStoreArn value. + */ + public String trustStoreArn() { + return this.trustStoreArn; + } + + /** + * Set the trustStoreArn property: The Amazon Resource Name (ARN) of the trust store. + * + * @param trustStoreArn the trustStoreArn value to set. + * @return the MutualAuthentication object itself. + */ + public MutualAuthentication withTrustStoreArn(String trustStoreArn) { + this.trustStoreArn = trustStoreArn; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeBooleanField("ignoreClientCertificateExpiry", this.ignoreClientCertificateExpiry); + jsonWriter.writeStringField("mode", this.mode); + jsonWriter.writeStringField("trustStoreArn", this.trustStoreArn); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MutualAuthentication from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MutualAuthentication if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the MutualAuthentication. + */ + public static MutualAuthentication fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MutualAuthentication deserializedMutualAuthentication = new MutualAuthentication(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("ignoreClientCertificateExpiry".equals(fieldName)) { + deserializedMutualAuthentication.ignoreClientCertificateExpiry + = reader.getNullable(JsonReader::getBoolean); + } else if ("mode".equals(fieldName)) { + deserializedMutualAuthentication.mode = reader.getString(); + } else if ("trustStoreArn".equals(fieldName)) { + deserializedMutualAuthentication.trustStoreArn = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedMutualAuthentication; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/NetworkBandwidthGbpsRequest.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/NetworkBandwidthGbpsRequest.java new file mode 100644 index 000000000000..9311f7a668bc --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/NetworkBandwidthGbpsRequest.java @@ -0,0 +1,121 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of NetworkBandwidthGbpsRequest. + */ +@Fluent +public final class NetworkBandwidthGbpsRequest implements JsonSerializable { + /* + * The maximum amount of network bandwidth, in gigabits per second (Gbps). + */ + private Integer max; + + /* + * The minimum amount of network bandwidth, in gigabits per second (Gbps). + */ + private Integer min; + + /** + * Creates an instance of NetworkBandwidthGbpsRequest class. + */ + public NetworkBandwidthGbpsRequest() { + } + + /** + * Get the max property: The maximum amount of network bandwidth, in gigabits per second (Gbps). + * + * @return the max value. + */ + public Integer max() { + return this.max; + } + + /** + * Set the max property: The maximum amount of network bandwidth, in gigabits per second (Gbps). + * + * @param max the max value to set. + * @return the NetworkBandwidthGbpsRequest object itself. + */ + public NetworkBandwidthGbpsRequest withMax(Integer max) { + this.max = max; + return this; + } + + /** + * Get the min property: The minimum amount of network bandwidth, in gigabits per second (Gbps). + * + * @return the min value. + */ + public Integer min() { + return this.min; + } + + /** + * Set the min property: The minimum amount of network bandwidth, in gigabits per second (Gbps). + * + * @param min the min value to set. + * @return the NetworkBandwidthGbpsRequest object itself. + */ + public NetworkBandwidthGbpsRequest withMin(Integer min) { + this.min = min; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeNumberField("max", this.max); + jsonWriter.writeNumberField("min", this.min); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of NetworkBandwidthGbpsRequest from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of NetworkBandwidthGbpsRequest if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the NetworkBandwidthGbpsRequest. + */ + public static NetworkBandwidthGbpsRequest fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + NetworkBandwidthGbpsRequest deserializedNetworkBandwidthGbpsRequest = new NetworkBandwidthGbpsRequest(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("max".equals(fieldName)) { + deserializedNetworkBandwidthGbpsRequest.max = reader.getNullable(JsonReader::getInt); + } else if ("min".equals(fieldName)) { + deserializedNetworkBandwidthGbpsRequest.min = reader.getNullable(JsonReader::getInt); + } else { + reader.skipChildren(); + } + } + + return deserializedNetworkBandwidthGbpsRequest; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/NetworkConfiguration.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/NetworkConfiguration.java new file mode 100644 index 000000000000..7b668d59e460 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/NetworkConfiguration.java @@ -0,0 +1,104 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of NetworkConfiguration. + */ +@Fluent +public final class NetworkConfiguration implements JsonSerializable { + /* + * The VPC subnets and security groups that are associated with a task. All specified subnets and security groups + * must be from the same VPC. An object representing the networking details for a task or service. For example + * ``awsvpcConfiguration={subnets=['subnet-12344321'],securityGroups=['sg-12344321']}`` + */ + private AwsVpcConfiguration awsvpcConfiguration; + + /** + * Creates an instance of NetworkConfiguration class. + */ + public NetworkConfiguration() { + } + + /** + * Get the awsvpcConfiguration property: The VPC subnets and security groups that are associated with a task. All + * specified subnets and security groups must be from the same VPC. An object representing the networking details + * for a task or service. For example + * ``awsvpcConfiguration={subnets=['subnet-12344321'],securityGroups=['sg-12344321']}``. + * + * @return the awsvpcConfiguration value. + */ + public AwsVpcConfiguration awsvpcConfiguration() { + return this.awsvpcConfiguration; + } + + /** + * Set the awsvpcConfiguration property: The VPC subnets and security groups that are associated with a task. All + * specified subnets and security groups must be from the same VPC. An object representing the networking details + * for a task or service. For example + * ``awsvpcConfiguration={subnets=['subnet-12344321'],securityGroups=['sg-12344321']}``. + * + * @param awsvpcConfiguration the awsvpcConfiguration value to set. + * @return the NetworkConfiguration object itself. + */ + public NetworkConfiguration withAwsvpcConfiguration(AwsVpcConfiguration awsvpcConfiguration) { + this.awsvpcConfiguration = awsvpcConfiguration; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (awsvpcConfiguration() != null) { + awsvpcConfiguration().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("awsvpcConfiguration", this.awsvpcConfiguration); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of NetworkConfiguration from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of NetworkConfiguration if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the NetworkConfiguration. + */ + public static NetworkConfiguration fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + NetworkConfiguration deserializedNetworkConfiguration = new NetworkConfiguration(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("awsvpcConfiguration".equals(fieldName)) { + deserializedNetworkConfiguration.awsvpcConfiguration = AwsVpcConfiguration.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedNetworkConfiguration; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/NetworkFirewall.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/NetworkFirewall.java new file mode 100644 index 000000000000..091ea5eae92e --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/NetworkFirewall.java @@ -0,0 +1,252 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.awsconnector.fluent.models.NetworkFirewallInner; +import java.util.Map; + +/** + * An immutable client-side representation of NetworkFirewall. + */ +public interface NetworkFirewall { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the location property: The geo-location where the resource lives. + * + * @return the location value. + */ + String location(); + + /** + * Gets the tags property: Resource tags. + * + * @return the tags value. + */ + Map tags(); + + /** + * Gets the properties property: The resource-specific properties for this resource. + * + * @return the properties value. + */ + NetworkFirewallProperties properties(); + + /** + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the region of the resource. + * + * @return the region of the resource. + */ + Region region(); + + /** + * Gets the name of the resource region. + * + * @return the name of the resource region. + */ + String regionName(); + + /** + * Gets the name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + + /** + * Gets the inner com.azure.resourcemanager.awsconnector.fluent.models.NetworkFirewallInner object. + * + * @return the inner object. + */ + NetworkFirewallInner innerModel(); + + /** + * The entirety of the NetworkFirewall definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithLocation, + DefinitionStages.WithResourceGroup, DefinitionStages.WithCreate { + } + + /** + * The NetworkFirewall definition stages. + */ + interface DefinitionStages { + /** + * The first stage of the NetworkFirewall definition. + */ + interface Blank extends WithLocation { + } + + /** + * The stage of the NetworkFirewall definition allowing to specify location. + */ + interface WithLocation { + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithResourceGroup withRegion(Region location); + + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithResourceGroup withRegion(String location); + } + + /** + * The stage of the NetworkFirewall definition allowing to specify parent resource. + */ + interface WithResourceGroup { + /** + * Specifies resourceGroupName. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @return the next definition stage. + */ + WithCreate withExistingResourceGroup(String resourceGroupName); + } + + /** + * The stage of the NetworkFirewall 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.WithProperties { + /** + * Executes the create request. + * + * @return the created resource. + */ + NetworkFirewall create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + NetworkFirewall create(Context context); + } + + /** + * The stage of the NetworkFirewall definition allowing to specify tags. + */ + interface WithTags { + /** + * Specifies the tags property: Resource tags.. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + WithCreate withTags(Map tags); + } + + /** + * The stage of the NetworkFirewall definition allowing to specify properties. + */ + interface WithProperties { + /** + * Specifies the properties property: The resource-specific properties for this resource.. + * + * @param properties The resource-specific properties for this resource. + * @return the next definition stage. + */ + WithCreate withProperties(NetworkFirewallProperties properties); + } + } + + /** + * Begins update for the NetworkFirewall resource. + * + * @return the stage of resource update. + */ + NetworkFirewall.Update update(); + + /** + * The template for NetworkFirewall update. + */ + interface Update extends UpdateStages.WithTags { + /** + * Executes the update request. + * + * @return the updated resource. + */ + NetworkFirewall apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + NetworkFirewall apply(Context context); + } + + /** + * The NetworkFirewall update stages. + */ + interface UpdateStages { + /** + * The stage of the NetworkFirewall update allowing to specify tags. + */ + interface WithTags { + /** + * Specifies the tags property: Resource tags.. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + Update withTags(Map tags); + } + } + + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + NetworkFirewall refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + NetworkFirewall refresh(Context context); +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/NetworkFirewallFirewallPolicies.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/NetworkFirewallFirewallPolicies.java new file mode 100644 index 000000000000..dd543cd461c2 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/NetworkFirewallFirewallPolicies.java @@ -0,0 +1,162 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** + * Resource collection API of NetworkFirewallFirewallPolicies. + */ +public interface NetworkFirewallFirewallPolicies { + /** + * List NetworkFirewallFirewallPolicy resources by subscription ID. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a NetworkFirewallFirewallPolicy list operation as paginated response with + * {@link PagedIterable}. + */ + PagedIterable list(); + + /** + * List NetworkFirewallFirewallPolicy resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a NetworkFirewallFirewallPolicy list operation as paginated response with + * {@link PagedIterable}. + */ + PagedIterable list(Context context); + + /** + * List NetworkFirewallFirewallPolicy resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a NetworkFirewallFirewallPolicy list operation as paginated response with + * {@link PagedIterable}. + */ + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * List NetworkFirewallFirewallPolicy resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a NetworkFirewallFirewallPolicy list operation as paginated response with + * {@link PagedIterable}. + */ + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Get a NetworkFirewallFirewallPolicy. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of NetworkFirewallFirewallPolicy. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a NetworkFirewallFirewallPolicy along with {@link Response}. + */ + Response getByResourceGroupWithResponse(String resourceGroupName, String name, + Context context); + + /** + * Get a NetworkFirewallFirewallPolicy. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of NetworkFirewallFirewallPolicy. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a NetworkFirewallFirewallPolicy. + */ + NetworkFirewallPolicy getByResourceGroup(String resourceGroupName, String name); + + /** + * Delete a NetworkFirewallFirewallPolicy. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of NetworkFirewallFirewallPolicy. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByResourceGroup(String resourceGroupName, String name); + + /** + * Delete a NetworkFirewallFirewallPolicy. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of NetworkFirewallFirewallPolicy. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String name, Context context); + + /** + * Get a NetworkFirewallFirewallPolicy. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a NetworkFirewallFirewallPolicy along with {@link Response}. + */ + NetworkFirewallPolicy getById(String id); + + /** + * Get a NetworkFirewallFirewallPolicy. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a NetworkFirewallFirewallPolicy along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Delete a NetworkFirewallFirewallPolicy. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteById(String id); + + /** + * Delete a NetworkFirewallFirewallPolicy. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new NetworkFirewallPolicy resource. + * + * @param name resource name. + * @return the first stage of the new NetworkFirewallPolicy definition. + */ + NetworkFirewallPolicy.DefinitionStages.Blank define(String name); +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/NetworkFirewallFirewalls.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/NetworkFirewallFirewalls.java new file mode 100644 index 000000000000..304c62285419 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/NetworkFirewallFirewalls.java @@ -0,0 +1,161 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** + * Resource collection API of NetworkFirewallFirewalls. + */ +public interface NetworkFirewallFirewalls { + /** + * List NetworkFirewallFirewall resources by subscription ID. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a NetworkFirewallFirewall list operation as paginated response with + * {@link PagedIterable}. + */ + PagedIterable list(); + + /** + * List NetworkFirewallFirewall resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a NetworkFirewallFirewall list operation as paginated response with + * {@link PagedIterable}. + */ + PagedIterable list(Context context); + + /** + * List NetworkFirewallFirewall resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a NetworkFirewallFirewall list operation as paginated response with + * {@link PagedIterable}. + */ + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * List NetworkFirewallFirewall resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a NetworkFirewallFirewall list operation as paginated response with + * {@link PagedIterable}. + */ + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Get a NetworkFirewallFirewall. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of NetworkFirewallFirewall. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a NetworkFirewallFirewall along with {@link Response}. + */ + Response getByResourceGroupWithResponse(String resourceGroupName, String name, Context context); + + /** + * Get a NetworkFirewallFirewall. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of NetworkFirewallFirewall. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a NetworkFirewallFirewall. + */ + NetworkFirewall getByResourceGroup(String resourceGroupName, String name); + + /** + * Delete a NetworkFirewallFirewall. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of NetworkFirewallFirewall. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByResourceGroup(String resourceGroupName, String name); + + /** + * Delete a NetworkFirewallFirewall. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of NetworkFirewallFirewall. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String name, Context context); + + /** + * Get a NetworkFirewallFirewall. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a NetworkFirewallFirewall along with {@link Response}. + */ + NetworkFirewall getById(String id); + + /** + * Get a NetworkFirewallFirewall. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a NetworkFirewallFirewall along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Delete a NetworkFirewallFirewall. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteById(String id); + + /** + * Delete a NetworkFirewallFirewall. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new NetworkFirewall resource. + * + * @param name resource name. + * @return the first stage of the new NetworkFirewall definition. + */ + NetworkFirewall.DefinitionStages.Blank define(String name); +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/NetworkFirewallListResult.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/NetworkFirewallListResult.java new file mode 100644 index 000000000000..9adb769fabba --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/NetworkFirewallListResult.java @@ -0,0 +1,136 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.awsconnector.fluent.models.NetworkFirewallInner; +import java.io.IOException; +import java.util.List; + +/** + * The response of a NetworkFirewallFirewall list operation. + */ +@Fluent +public final class NetworkFirewallListResult implements JsonSerializable { + /* + * The NetworkFirewallFirewall items on this page + */ + private List value; + + /* + * The link to the next page of items + */ + private String nextLink; + + /** + * Creates an instance of NetworkFirewallListResult class. + */ + public NetworkFirewallListResult() { + } + + /** + * Get the value property: The NetworkFirewallFirewall items on this page. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The NetworkFirewallFirewall items on this page. + * + * @param value the value value to set. + * @return the NetworkFirewallListResult object itself. + */ + public NetworkFirewallListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The link to the next page of items. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: The link to the next page of items. + * + * @param nextLink the nextLink value to set. + * @return the NetworkFirewallListResult object itself. + */ + public NetworkFirewallListResult withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() == null) { + throw LOGGER.atError() + .log( + new IllegalArgumentException("Missing required property value in model NetworkFirewallListResult")); + } else { + value().forEach(e -> e.validate()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(NetworkFirewallListResult.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("nextLink", this.nextLink); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of NetworkFirewallListResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of NetworkFirewallListResult if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the NetworkFirewallListResult. + */ + public static NetworkFirewallListResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + NetworkFirewallListResult deserializedNetworkFirewallListResult = new NetworkFirewallListResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> NetworkFirewallInner.fromJson(reader1)); + deserializedNetworkFirewallListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedNetworkFirewallListResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedNetworkFirewallListResult; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/NetworkFirewallPolicy.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/NetworkFirewallPolicy.java new file mode 100644 index 000000000000..5962e6592995 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/NetworkFirewallPolicy.java @@ -0,0 +1,252 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.awsconnector.fluent.models.NetworkFirewallPolicyInner; +import java.util.Map; + +/** + * An immutable client-side representation of NetworkFirewallPolicy. + */ +public interface NetworkFirewallPolicy { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the location property: The geo-location where the resource lives. + * + * @return the location value. + */ + String location(); + + /** + * Gets the tags property: Resource tags. + * + * @return the tags value. + */ + Map tags(); + + /** + * Gets the properties property: The resource-specific properties for this resource. + * + * @return the properties value. + */ + NetworkFirewallPolicyProperties properties(); + + /** + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the region of the resource. + * + * @return the region of the resource. + */ + Region region(); + + /** + * Gets the name of the resource region. + * + * @return the name of the resource region. + */ + String regionName(); + + /** + * Gets the name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + + /** + * Gets the inner com.azure.resourcemanager.awsconnector.fluent.models.NetworkFirewallPolicyInner object. + * + * @return the inner object. + */ + NetworkFirewallPolicyInner innerModel(); + + /** + * The entirety of the NetworkFirewallPolicy definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithLocation, + DefinitionStages.WithResourceGroup, DefinitionStages.WithCreate { + } + + /** + * The NetworkFirewallPolicy definition stages. + */ + interface DefinitionStages { + /** + * The first stage of the NetworkFirewallPolicy definition. + */ + interface Blank extends WithLocation { + } + + /** + * The stage of the NetworkFirewallPolicy definition allowing to specify location. + */ + interface WithLocation { + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithResourceGroup withRegion(Region location); + + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithResourceGroup withRegion(String location); + } + + /** + * The stage of the NetworkFirewallPolicy definition allowing to specify parent resource. + */ + interface WithResourceGroup { + /** + * Specifies resourceGroupName. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @return the next definition stage. + */ + WithCreate withExistingResourceGroup(String resourceGroupName); + } + + /** + * The stage of the NetworkFirewallPolicy 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.WithProperties { + /** + * Executes the create request. + * + * @return the created resource. + */ + NetworkFirewallPolicy create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + NetworkFirewallPolicy create(Context context); + } + + /** + * The stage of the NetworkFirewallPolicy definition allowing to specify tags. + */ + interface WithTags { + /** + * Specifies the tags property: Resource tags.. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + WithCreate withTags(Map tags); + } + + /** + * The stage of the NetworkFirewallPolicy definition allowing to specify properties. + */ + interface WithProperties { + /** + * Specifies the properties property: The resource-specific properties for this resource.. + * + * @param properties The resource-specific properties for this resource. + * @return the next definition stage. + */ + WithCreate withProperties(NetworkFirewallPolicyProperties properties); + } + } + + /** + * Begins update for the NetworkFirewallPolicy resource. + * + * @return the stage of resource update. + */ + NetworkFirewallPolicy.Update update(); + + /** + * The template for NetworkFirewallPolicy update. + */ + interface Update extends UpdateStages.WithTags { + /** + * Executes the update request. + * + * @return the updated resource. + */ + NetworkFirewallPolicy apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + NetworkFirewallPolicy apply(Context context); + } + + /** + * The NetworkFirewallPolicy update stages. + */ + interface UpdateStages { + /** + * The stage of the NetworkFirewallPolicy update allowing to specify tags. + */ + interface WithTags { + /** + * Specifies the tags property: Resource tags.. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + Update withTags(Map tags); + } + } + + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + NetworkFirewallPolicy refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + NetworkFirewallPolicy refresh(Context context); +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/NetworkFirewallPolicyListResult.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/NetworkFirewallPolicyListResult.java new file mode 100644 index 000000000000..a71e2013bb6a --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/NetworkFirewallPolicyListResult.java @@ -0,0 +1,137 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.awsconnector.fluent.models.NetworkFirewallPolicyInner; +import java.io.IOException; +import java.util.List; + +/** + * The response of a NetworkFirewallFirewallPolicy list operation. + */ +@Fluent +public final class NetworkFirewallPolicyListResult implements JsonSerializable { + /* + * The NetworkFirewallFirewallPolicy items on this page + */ + private List value; + + /* + * The link to the next page of items + */ + private String nextLink; + + /** + * Creates an instance of NetworkFirewallPolicyListResult class. + */ + public NetworkFirewallPolicyListResult() { + } + + /** + * Get the value property: The NetworkFirewallFirewallPolicy items on this page. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The NetworkFirewallFirewallPolicy items on this page. + * + * @param value the value value to set. + * @return the NetworkFirewallPolicyListResult object itself. + */ + public NetworkFirewallPolicyListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The link to the next page of items. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: The link to the next page of items. + * + * @param nextLink the nextLink value to set. + * @return the NetworkFirewallPolicyListResult object itself. + */ + public NetworkFirewallPolicyListResult withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property value in model NetworkFirewallPolicyListResult")); + } else { + value().forEach(e -> e.validate()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(NetworkFirewallPolicyListResult.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("nextLink", this.nextLink); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of NetworkFirewallPolicyListResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of NetworkFirewallPolicyListResult if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the NetworkFirewallPolicyListResult. + */ + public static NetworkFirewallPolicyListResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + NetworkFirewallPolicyListResult deserializedNetworkFirewallPolicyListResult + = new NetworkFirewallPolicyListResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> NetworkFirewallPolicyInner.fromJson(reader1)); + deserializedNetworkFirewallPolicyListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedNetworkFirewallPolicyListResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedNetworkFirewallPolicyListResult; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/NetworkFirewallPolicyProperties.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/NetworkFirewallPolicyProperties.java new file mode 100644 index 000000000000..5ccee2025f36 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/NetworkFirewallPolicyProperties.java @@ -0,0 +1,313 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.Map; + +/** + * Definition of NetworkFirewallFirewallPolicy. + */ +@Fluent +public final class NetworkFirewallPolicyProperties implements JsonSerializable { + /* + * AWS Properties + */ + private AwsNetworkFirewallPolicyProperties awsProperties; + + /* + * Public Cloud Connectors Resource ID + */ + private String publicCloudConnectorsResourceId; + + /* + * AWS Account ID + */ + private String awsAccountId; + + /* + * Amazon Resource Name (ARN) + */ + private String arn; + + /* + * Public Cloud Resource Name + */ + private String publicCloudResourceName; + + /* + * AWS Source Schema + */ + private String awsSourceSchema; + + /* + * AWS Region + */ + private String awsRegion; + + /* + * AWS Tags + */ + private Map awsTags; + + /* + * The status of the last operation. + */ + private ProvisioningState provisioningState; + + /** + * Creates an instance of NetworkFirewallPolicyProperties class. + */ + public NetworkFirewallPolicyProperties() { + } + + /** + * Get the awsProperties property: AWS Properties. + * + * @return the awsProperties value. + */ + public AwsNetworkFirewallPolicyProperties awsProperties() { + return this.awsProperties; + } + + /** + * Set the awsProperties property: AWS Properties. + * + * @param awsProperties the awsProperties value to set. + * @return the NetworkFirewallPolicyProperties object itself. + */ + public NetworkFirewallPolicyProperties withAwsProperties(AwsNetworkFirewallPolicyProperties awsProperties) { + this.awsProperties = awsProperties; + return this; + } + + /** + * Get the publicCloudConnectorsResourceId property: Public Cloud Connectors Resource ID. + * + * @return the publicCloudConnectorsResourceId value. + */ + public String publicCloudConnectorsResourceId() { + return this.publicCloudConnectorsResourceId; + } + + /** + * Set the publicCloudConnectorsResourceId property: Public Cloud Connectors Resource ID. + * + * @param publicCloudConnectorsResourceId the publicCloudConnectorsResourceId value to set. + * @return the NetworkFirewallPolicyProperties object itself. + */ + public NetworkFirewallPolicyProperties withPublicCloudConnectorsResourceId(String publicCloudConnectorsResourceId) { + this.publicCloudConnectorsResourceId = publicCloudConnectorsResourceId; + return this; + } + + /** + * Get the awsAccountId property: AWS Account ID. + * + * @return the awsAccountId value. + */ + public String awsAccountId() { + return this.awsAccountId; + } + + /** + * Set the awsAccountId property: AWS Account ID. + * + * @param awsAccountId the awsAccountId value to set. + * @return the NetworkFirewallPolicyProperties object itself. + */ + public NetworkFirewallPolicyProperties withAwsAccountId(String awsAccountId) { + this.awsAccountId = awsAccountId; + return this; + } + + /** + * Get the arn property: Amazon Resource Name (ARN). + * + * @return the arn value. + */ + public String arn() { + return this.arn; + } + + /** + * Set the arn property: Amazon Resource Name (ARN). + * + * @param arn the arn value to set. + * @return the NetworkFirewallPolicyProperties object itself. + */ + public NetworkFirewallPolicyProperties withArn(String arn) { + this.arn = arn; + return this; + } + + /** + * Get the publicCloudResourceName property: Public Cloud Resource Name. + * + * @return the publicCloudResourceName value. + */ + public String publicCloudResourceName() { + return this.publicCloudResourceName; + } + + /** + * Set the publicCloudResourceName property: Public Cloud Resource Name. + * + * @param publicCloudResourceName the publicCloudResourceName value to set. + * @return the NetworkFirewallPolicyProperties object itself. + */ + public NetworkFirewallPolicyProperties withPublicCloudResourceName(String publicCloudResourceName) { + this.publicCloudResourceName = publicCloudResourceName; + return this; + } + + /** + * Get the awsSourceSchema property: AWS Source Schema. + * + * @return the awsSourceSchema value. + */ + public String awsSourceSchema() { + return this.awsSourceSchema; + } + + /** + * Set the awsSourceSchema property: AWS Source Schema. + * + * @param awsSourceSchema the awsSourceSchema value to set. + * @return the NetworkFirewallPolicyProperties object itself. + */ + public NetworkFirewallPolicyProperties withAwsSourceSchema(String awsSourceSchema) { + this.awsSourceSchema = awsSourceSchema; + return this; + } + + /** + * Get the awsRegion property: AWS Region. + * + * @return the awsRegion value. + */ + public String awsRegion() { + return this.awsRegion; + } + + /** + * Set the awsRegion property: AWS Region. + * + * @param awsRegion the awsRegion value to set. + * @return the NetworkFirewallPolicyProperties object itself. + */ + public NetworkFirewallPolicyProperties withAwsRegion(String awsRegion) { + this.awsRegion = awsRegion; + return this; + } + + /** + * Get the awsTags property: AWS Tags. + * + * @return the awsTags value. + */ + public Map awsTags() { + return this.awsTags; + } + + /** + * Set the awsTags property: AWS Tags. + * + * @param awsTags the awsTags value to set. + * @return the NetworkFirewallPolicyProperties object itself. + */ + public NetworkFirewallPolicyProperties withAwsTags(Map awsTags) { + this.awsTags = awsTags; + return this; + } + + /** + * Get the provisioningState property: The status of the last operation. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (awsProperties() != null) { + awsProperties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("awsProperties", this.awsProperties); + jsonWriter.writeStringField("publicCloudConnectorsResourceId", this.publicCloudConnectorsResourceId); + jsonWriter.writeStringField("awsAccountId", this.awsAccountId); + jsonWriter.writeStringField("arn", this.arn); + jsonWriter.writeStringField("publicCloudResourceName", this.publicCloudResourceName); + jsonWriter.writeStringField("awsSourceSchema", this.awsSourceSchema); + jsonWriter.writeStringField("awsRegion", this.awsRegion); + jsonWriter.writeMapField("awsTags", this.awsTags, (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of NetworkFirewallPolicyProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of NetworkFirewallPolicyProperties if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the NetworkFirewallPolicyProperties. + */ + public static NetworkFirewallPolicyProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + NetworkFirewallPolicyProperties deserializedNetworkFirewallPolicyProperties + = new NetworkFirewallPolicyProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("awsProperties".equals(fieldName)) { + deserializedNetworkFirewallPolicyProperties.awsProperties + = AwsNetworkFirewallPolicyProperties.fromJson(reader); + } else if ("publicCloudConnectorsResourceId".equals(fieldName)) { + deserializedNetworkFirewallPolicyProperties.publicCloudConnectorsResourceId = reader.getString(); + } else if ("awsAccountId".equals(fieldName)) { + deserializedNetworkFirewallPolicyProperties.awsAccountId = reader.getString(); + } else if ("arn".equals(fieldName)) { + deserializedNetworkFirewallPolicyProperties.arn = reader.getString(); + } else if ("publicCloudResourceName".equals(fieldName)) { + deserializedNetworkFirewallPolicyProperties.publicCloudResourceName = reader.getString(); + } else if ("awsSourceSchema".equals(fieldName)) { + deserializedNetworkFirewallPolicyProperties.awsSourceSchema = reader.getString(); + } else if ("awsRegion".equals(fieldName)) { + deserializedNetworkFirewallPolicyProperties.awsRegion = reader.getString(); + } else if ("awsTags".equals(fieldName)) { + Map awsTags = reader.readMap(reader1 -> reader1.getString()); + deserializedNetworkFirewallPolicyProperties.awsTags = awsTags; + } else if ("provisioningState".equals(fieldName)) { + deserializedNetworkFirewallPolicyProperties.provisioningState + = ProvisioningState.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedNetworkFirewallPolicyProperties; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/NetworkFirewallPolicyTagsUpdate.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/NetworkFirewallPolicyTagsUpdate.java new file mode 100644 index 000000000000..365b8f9bde1f --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/NetworkFirewallPolicyTagsUpdate.java @@ -0,0 +1,96 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.Map; + +/** + * The type used for updating tags in NetworkFirewallFirewallPolicy resources. + */ +@Fluent +public final class NetworkFirewallPolicyTagsUpdate implements JsonSerializable { + /* + * Resource tags. + */ + private Map tags; + + /** + * Creates an instance of NetworkFirewallPolicyTagsUpdate class. + */ + public NetworkFirewallPolicyTagsUpdate() { + } + + /** + * Get the tags property: Resource tags. + * + * @return the tags value. + */ + public Map tags() { + return this.tags; + } + + /** + * Set the tags property: Resource tags. + * + * @param tags the tags value to set. + * @return the NetworkFirewallPolicyTagsUpdate object itself. + */ + public NetworkFirewallPolicyTagsUpdate withTags(Map tags) { + this.tags = tags; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeMapField("tags", this.tags, (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of NetworkFirewallPolicyTagsUpdate from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of NetworkFirewallPolicyTagsUpdate if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the NetworkFirewallPolicyTagsUpdate. + */ + public static NetworkFirewallPolicyTagsUpdate fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + NetworkFirewallPolicyTagsUpdate deserializedNetworkFirewallPolicyTagsUpdate + = new NetworkFirewallPolicyTagsUpdate(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedNetworkFirewallPolicyTagsUpdate.tags = tags; + } else { + reader.skipChildren(); + } + } + + return deserializedNetworkFirewallPolicyTagsUpdate; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/NetworkFirewallProperties.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/NetworkFirewallProperties.java new file mode 100644 index 000000000000..820382c04082 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/NetworkFirewallProperties.java @@ -0,0 +1,311 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.Map; + +/** + * Definition of NetworkFirewallFirewall. + */ +@Fluent +public final class NetworkFirewallProperties implements JsonSerializable { + /* + * AWS Properties + */ + private AwsNetworkFirewallProperties awsProperties; + + /* + * Public Cloud Connectors Resource ID + */ + private String publicCloudConnectorsResourceId; + + /* + * AWS Account ID + */ + private String awsAccountId; + + /* + * Amazon Resource Name (ARN) + */ + private String arn; + + /* + * Public Cloud Resource Name + */ + private String publicCloudResourceName; + + /* + * AWS Source Schema + */ + private String awsSourceSchema; + + /* + * AWS Region + */ + private String awsRegion; + + /* + * AWS Tags + */ + private Map awsTags; + + /* + * The status of the last operation. + */ + private ProvisioningState provisioningState; + + /** + * Creates an instance of NetworkFirewallProperties class. + */ + public NetworkFirewallProperties() { + } + + /** + * Get the awsProperties property: AWS Properties. + * + * @return the awsProperties value. + */ + public AwsNetworkFirewallProperties awsProperties() { + return this.awsProperties; + } + + /** + * Set the awsProperties property: AWS Properties. + * + * @param awsProperties the awsProperties value to set. + * @return the NetworkFirewallProperties object itself. + */ + public NetworkFirewallProperties withAwsProperties(AwsNetworkFirewallProperties awsProperties) { + this.awsProperties = awsProperties; + return this; + } + + /** + * Get the publicCloudConnectorsResourceId property: Public Cloud Connectors Resource ID. + * + * @return the publicCloudConnectorsResourceId value. + */ + public String publicCloudConnectorsResourceId() { + return this.publicCloudConnectorsResourceId; + } + + /** + * Set the publicCloudConnectorsResourceId property: Public Cloud Connectors Resource ID. + * + * @param publicCloudConnectorsResourceId the publicCloudConnectorsResourceId value to set. + * @return the NetworkFirewallProperties object itself. + */ + public NetworkFirewallProperties withPublicCloudConnectorsResourceId(String publicCloudConnectorsResourceId) { + this.publicCloudConnectorsResourceId = publicCloudConnectorsResourceId; + return this; + } + + /** + * Get the awsAccountId property: AWS Account ID. + * + * @return the awsAccountId value. + */ + public String awsAccountId() { + return this.awsAccountId; + } + + /** + * Set the awsAccountId property: AWS Account ID. + * + * @param awsAccountId the awsAccountId value to set. + * @return the NetworkFirewallProperties object itself. + */ + public NetworkFirewallProperties withAwsAccountId(String awsAccountId) { + this.awsAccountId = awsAccountId; + return this; + } + + /** + * Get the arn property: Amazon Resource Name (ARN). + * + * @return the arn value. + */ + public String arn() { + return this.arn; + } + + /** + * Set the arn property: Amazon Resource Name (ARN). + * + * @param arn the arn value to set. + * @return the NetworkFirewallProperties object itself. + */ + public NetworkFirewallProperties withArn(String arn) { + this.arn = arn; + return this; + } + + /** + * Get the publicCloudResourceName property: Public Cloud Resource Name. + * + * @return the publicCloudResourceName value. + */ + public String publicCloudResourceName() { + return this.publicCloudResourceName; + } + + /** + * Set the publicCloudResourceName property: Public Cloud Resource Name. + * + * @param publicCloudResourceName the publicCloudResourceName value to set. + * @return the NetworkFirewallProperties object itself. + */ + public NetworkFirewallProperties withPublicCloudResourceName(String publicCloudResourceName) { + this.publicCloudResourceName = publicCloudResourceName; + return this; + } + + /** + * Get the awsSourceSchema property: AWS Source Schema. + * + * @return the awsSourceSchema value. + */ + public String awsSourceSchema() { + return this.awsSourceSchema; + } + + /** + * Set the awsSourceSchema property: AWS Source Schema. + * + * @param awsSourceSchema the awsSourceSchema value to set. + * @return the NetworkFirewallProperties object itself. + */ + public NetworkFirewallProperties withAwsSourceSchema(String awsSourceSchema) { + this.awsSourceSchema = awsSourceSchema; + return this; + } + + /** + * Get the awsRegion property: AWS Region. + * + * @return the awsRegion value. + */ + public String awsRegion() { + return this.awsRegion; + } + + /** + * Set the awsRegion property: AWS Region. + * + * @param awsRegion the awsRegion value to set. + * @return the NetworkFirewallProperties object itself. + */ + public NetworkFirewallProperties withAwsRegion(String awsRegion) { + this.awsRegion = awsRegion; + return this; + } + + /** + * Get the awsTags property: AWS Tags. + * + * @return the awsTags value. + */ + public Map awsTags() { + return this.awsTags; + } + + /** + * Set the awsTags property: AWS Tags. + * + * @param awsTags the awsTags value to set. + * @return the NetworkFirewallProperties object itself. + */ + public NetworkFirewallProperties withAwsTags(Map awsTags) { + this.awsTags = awsTags; + return this; + } + + /** + * Get the provisioningState property: The status of the last operation. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (awsProperties() != null) { + awsProperties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("awsProperties", this.awsProperties); + jsonWriter.writeStringField("publicCloudConnectorsResourceId", this.publicCloudConnectorsResourceId); + jsonWriter.writeStringField("awsAccountId", this.awsAccountId); + jsonWriter.writeStringField("arn", this.arn); + jsonWriter.writeStringField("publicCloudResourceName", this.publicCloudResourceName); + jsonWriter.writeStringField("awsSourceSchema", this.awsSourceSchema); + jsonWriter.writeStringField("awsRegion", this.awsRegion); + jsonWriter.writeMapField("awsTags", this.awsTags, (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of NetworkFirewallProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of NetworkFirewallProperties if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IOException If an error occurs while reading the NetworkFirewallProperties. + */ + public static NetworkFirewallProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + NetworkFirewallProperties deserializedNetworkFirewallProperties = new NetworkFirewallProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("awsProperties".equals(fieldName)) { + deserializedNetworkFirewallProperties.awsProperties = AwsNetworkFirewallProperties.fromJson(reader); + } else if ("publicCloudConnectorsResourceId".equals(fieldName)) { + deserializedNetworkFirewallProperties.publicCloudConnectorsResourceId = reader.getString(); + } else if ("awsAccountId".equals(fieldName)) { + deserializedNetworkFirewallProperties.awsAccountId = reader.getString(); + } else if ("arn".equals(fieldName)) { + deserializedNetworkFirewallProperties.arn = reader.getString(); + } else if ("publicCloudResourceName".equals(fieldName)) { + deserializedNetworkFirewallProperties.publicCloudResourceName = reader.getString(); + } else if ("awsSourceSchema".equals(fieldName)) { + deserializedNetworkFirewallProperties.awsSourceSchema = reader.getString(); + } else if ("awsRegion".equals(fieldName)) { + deserializedNetworkFirewallProperties.awsRegion = reader.getString(); + } else if ("awsTags".equals(fieldName)) { + Map awsTags = reader.readMap(reader1 -> reader1.getString()); + deserializedNetworkFirewallProperties.awsTags = awsTags; + } else if ("provisioningState".equals(fieldName)) { + deserializedNetworkFirewallProperties.provisioningState + = ProvisioningState.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedNetworkFirewallProperties; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/NetworkFirewallRuleGroup.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/NetworkFirewallRuleGroup.java new file mode 100644 index 000000000000..609eb28dcc0f --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/NetworkFirewallRuleGroup.java @@ -0,0 +1,252 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.awsconnector.fluent.models.NetworkFirewallRuleGroupInner; +import java.util.Map; + +/** + * An immutable client-side representation of NetworkFirewallRuleGroup. + */ +public interface NetworkFirewallRuleGroup { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the location property: The geo-location where the resource lives. + * + * @return the location value. + */ + String location(); + + /** + * Gets the tags property: Resource tags. + * + * @return the tags value. + */ + Map tags(); + + /** + * Gets the properties property: The resource-specific properties for this resource. + * + * @return the properties value. + */ + NetworkFirewallRuleGroupProperties properties(); + + /** + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the region of the resource. + * + * @return the region of the resource. + */ + Region region(); + + /** + * Gets the name of the resource region. + * + * @return the name of the resource region. + */ + String regionName(); + + /** + * Gets the name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + + /** + * Gets the inner com.azure.resourcemanager.awsconnector.fluent.models.NetworkFirewallRuleGroupInner object. + * + * @return the inner object. + */ + NetworkFirewallRuleGroupInner innerModel(); + + /** + * The entirety of the NetworkFirewallRuleGroup definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithLocation, + DefinitionStages.WithResourceGroup, DefinitionStages.WithCreate { + } + + /** + * The NetworkFirewallRuleGroup definition stages. + */ + interface DefinitionStages { + /** + * The first stage of the NetworkFirewallRuleGroup definition. + */ + interface Blank extends WithLocation { + } + + /** + * The stage of the NetworkFirewallRuleGroup definition allowing to specify location. + */ + interface WithLocation { + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithResourceGroup withRegion(Region location); + + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithResourceGroup withRegion(String location); + } + + /** + * The stage of the NetworkFirewallRuleGroup definition allowing to specify parent resource. + */ + interface WithResourceGroup { + /** + * Specifies resourceGroupName. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @return the next definition stage. + */ + WithCreate withExistingResourceGroup(String resourceGroupName); + } + + /** + * The stage of the NetworkFirewallRuleGroup 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.WithProperties { + /** + * Executes the create request. + * + * @return the created resource. + */ + NetworkFirewallRuleGroup create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + NetworkFirewallRuleGroup create(Context context); + } + + /** + * The stage of the NetworkFirewallRuleGroup definition allowing to specify tags. + */ + interface WithTags { + /** + * Specifies the tags property: Resource tags.. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + WithCreate withTags(Map tags); + } + + /** + * The stage of the NetworkFirewallRuleGroup definition allowing to specify properties. + */ + interface WithProperties { + /** + * Specifies the properties property: The resource-specific properties for this resource.. + * + * @param properties The resource-specific properties for this resource. + * @return the next definition stage. + */ + WithCreate withProperties(NetworkFirewallRuleGroupProperties properties); + } + } + + /** + * Begins update for the NetworkFirewallRuleGroup resource. + * + * @return the stage of resource update. + */ + NetworkFirewallRuleGroup.Update update(); + + /** + * The template for NetworkFirewallRuleGroup update. + */ + interface Update extends UpdateStages.WithTags { + /** + * Executes the update request. + * + * @return the updated resource. + */ + NetworkFirewallRuleGroup apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + NetworkFirewallRuleGroup apply(Context context); + } + + /** + * The NetworkFirewallRuleGroup update stages. + */ + interface UpdateStages { + /** + * The stage of the NetworkFirewallRuleGroup update allowing to specify tags. + */ + interface WithTags { + /** + * Specifies the tags property: Resource tags.. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + Update withTags(Map tags); + } + } + + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + NetworkFirewallRuleGroup refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + NetworkFirewallRuleGroup refresh(Context context); +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/NetworkFirewallRuleGroupListResult.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/NetworkFirewallRuleGroupListResult.java new file mode 100644 index 000000000000..6e2d640b0934 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/NetworkFirewallRuleGroupListResult.java @@ -0,0 +1,137 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.awsconnector.fluent.models.NetworkFirewallRuleGroupInner; +import java.io.IOException; +import java.util.List; + +/** + * The response of a NetworkFirewallRuleGroup list operation. + */ +@Fluent +public final class NetworkFirewallRuleGroupListResult implements JsonSerializable { + /* + * The NetworkFirewallRuleGroup items on this page + */ + private List value; + + /* + * The link to the next page of items + */ + private String nextLink; + + /** + * Creates an instance of NetworkFirewallRuleGroupListResult class. + */ + public NetworkFirewallRuleGroupListResult() { + } + + /** + * Get the value property: The NetworkFirewallRuleGroup items on this page. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The NetworkFirewallRuleGroup items on this page. + * + * @param value the value value to set. + * @return the NetworkFirewallRuleGroupListResult object itself. + */ + public NetworkFirewallRuleGroupListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The link to the next page of items. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: The link to the next page of items. + * + * @param nextLink the nextLink value to set. + * @return the NetworkFirewallRuleGroupListResult object itself. + */ + public NetworkFirewallRuleGroupListResult withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property value in model NetworkFirewallRuleGroupListResult")); + } else { + value().forEach(e -> e.validate()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(NetworkFirewallRuleGroupListResult.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("nextLink", this.nextLink); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of NetworkFirewallRuleGroupListResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of NetworkFirewallRuleGroupListResult if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the NetworkFirewallRuleGroupListResult. + */ + public static NetworkFirewallRuleGroupListResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + NetworkFirewallRuleGroupListResult deserializedNetworkFirewallRuleGroupListResult + = new NetworkFirewallRuleGroupListResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> NetworkFirewallRuleGroupInner.fromJson(reader1)); + deserializedNetworkFirewallRuleGroupListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedNetworkFirewallRuleGroupListResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedNetworkFirewallRuleGroupListResult; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/NetworkFirewallRuleGroupProperties.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/NetworkFirewallRuleGroupProperties.java new file mode 100644 index 000000000000..bd8f092c66fe --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/NetworkFirewallRuleGroupProperties.java @@ -0,0 +1,314 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.Map; + +/** + * Definition of NetworkFirewallRuleGroup. + */ +@Fluent +public final class NetworkFirewallRuleGroupProperties implements JsonSerializable { + /* + * AWS Properties + */ + private AwsNetworkFirewallRuleGroupProperties awsProperties; + + /* + * Public Cloud Connectors Resource ID + */ + private String publicCloudConnectorsResourceId; + + /* + * AWS Account ID + */ + private String awsAccountId; + + /* + * Amazon Resource Name (ARN) + */ + private String arn; + + /* + * Public Cloud Resource Name + */ + private String publicCloudResourceName; + + /* + * AWS Source Schema + */ + private String awsSourceSchema; + + /* + * AWS Region + */ + private String awsRegion; + + /* + * AWS Tags + */ + private Map awsTags; + + /* + * The status of the last operation. + */ + private ProvisioningState provisioningState; + + /** + * Creates an instance of NetworkFirewallRuleGroupProperties class. + */ + public NetworkFirewallRuleGroupProperties() { + } + + /** + * Get the awsProperties property: AWS Properties. + * + * @return the awsProperties value. + */ + public AwsNetworkFirewallRuleGroupProperties awsProperties() { + return this.awsProperties; + } + + /** + * Set the awsProperties property: AWS Properties. + * + * @param awsProperties the awsProperties value to set. + * @return the NetworkFirewallRuleGroupProperties object itself. + */ + public NetworkFirewallRuleGroupProperties withAwsProperties(AwsNetworkFirewallRuleGroupProperties awsProperties) { + this.awsProperties = awsProperties; + return this; + } + + /** + * Get the publicCloudConnectorsResourceId property: Public Cloud Connectors Resource ID. + * + * @return the publicCloudConnectorsResourceId value. + */ + public String publicCloudConnectorsResourceId() { + return this.publicCloudConnectorsResourceId; + } + + /** + * Set the publicCloudConnectorsResourceId property: Public Cloud Connectors Resource ID. + * + * @param publicCloudConnectorsResourceId the publicCloudConnectorsResourceId value to set. + * @return the NetworkFirewallRuleGroupProperties object itself. + */ + public NetworkFirewallRuleGroupProperties + withPublicCloudConnectorsResourceId(String publicCloudConnectorsResourceId) { + this.publicCloudConnectorsResourceId = publicCloudConnectorsResourceId; + return this; + } + + /** + * Get the awsAccountId property: AWS Account ID. + * + * @return the awsAccountId value. + */ + public String awsAccountId() { + return this.awsAccountId; + } + + /** + * Set the awsAccountId property: AWS Account ID. + * + * @param awsAccountId the awsAccountId value to set. + * @return the NetworkFirewallRuleGroupProperties object itself. + */ + public NetworkFirewallRuleGroupProperties withAwsAccountId(String awsAccountId) { + this.awsAccountId = awsAccountId; + return this; + } + + /** + * Get the arn property: Amazon Resource Name (ARN). + * + * @return the arn value. + */ + public String arn() { + return this.arn; + } + + /** + * Set the arn property: Amazon Resource Name (ARN). + * + * @param arn the arn value to set. + * @return the NetworkFirewallRuleGroupProperties object itself. + */ + public NetworkFirewallRuleGroupProperties withArn(String arn) { + this.arn = arn; + return this; + } + + /** + * Get the publicCloudResourceName property: Public Cloud Resource Name. + * + * @return the publicCloudResourceName value. + */ + public String publicCloudResourceName() { + return this.publicCloudResourceName; + } + + /** + * Set the publicCloudResourceName property: Public Cloud Resource Name. + * + * @param publicCloudResourceName the publicCloudResourceName value to set. + * @return the NetworkFirewallRuleGroupProperties object itself. + */ + public NetworkFirewallRuleGroupProperties withPublicCloudResourceName(String publicCloudResourceName) { + this.publicCloudResourceName = publicCloudResourceName; + return this; + } + + /** + * Get the awsSourceSchema property: AWS Source Schema. + * + * @return the awsSourceSchema value. + */ + public String awsSourceSchema() { + return this.awsSourceSchema; + } + + /** + * Set the awsSourceSchema property: AWS Source Schema. + * + * @param awsSourceSchema the awsSourceSchema value to set. + * @return the NetworkFirewallRuleGroupProperties object itself. + */ + public NetworkFirewallRuleGroupProperties withAwsSourceSchema(String awsSourceSchema) { + this.awsSourceSchema = awsSourceSchema; + return this; + } + + /** + * Get the awsRegion property: AWS Region. + * + * @return the awsRegion value. + */ + public String awsRegion() { + return this.awsRegion; + } + + /** + * Set the awsRegion property: AWS Region. + * + * @param awsRegion the awsRegion value to set. + * @return the NetworkFirewallRuleGroupProperties object itself. + */ + public NetworkFirewallRuleGroupProperties withAwsRegion(String awsRegion) { + this.awsRegion = awsRegion; + return this; + } + + /** + * Get the awsTags property: AWS Tags. + * + * @return the awsTags value. + */ + public Map awsTags() { + return this.awsTags; + } + + /** + * Set the awsTags property: AWS Tags. + * + * @param awsTags the awsTags value to set. + * @return the NetworkFirewallRuleGroupProperties object itself. + */ + public NetworkFirewallRuleGroupProperties withAwsTags(Map awsTags) { + this.awsTags = awsTags; + return this; + } + + /** + * Get the provisioningState property: The status of the last operation. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (awsProperties() != null) { + awsProperties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("awsProperties", this.awsProperties); + jsonWriter.writeStringField("publicCloudConnectorsResourceId", this.publicCloudConnectorsResourceId); + jsonWriter.writeStringField("awsAccountId", this.awsAccountId); + jsonWriter.writeStringField("arn", this.arn); + jsonWriter.writeStringField("publicCloudResourceName", this.publicCloudResourceName); + jsonWriter.writeStringField("awsSourceSchema", this.awsSourceSchema); + jsonWriter.writeStringField("awsRegion", this.awsRegion); + jsonWriter.writeMapField("awsTags", this.awsTags, (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of NetworkFirewallRuleGroupProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of NetworkFirewallRuleGroupProperties if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the NetworkFirewallRuleGroupProperties. + */ + public static NetworkFirewallRuleGroupProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + NetworkFirewallRuleGroupProperties deserializedNetworkFirewallRuleGroupProperties + = new NetworkFirewallRuleGroupProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("awsProperties".equals(fieldName)) { + deserializedNetworkFirewallRuleGroupProperties.awsProperties + = AwsNetworkFirewallRuleGroupProperties.fromJson(reader); + } else if ("publicCloudConnectorsResourceId".equals(fieldName)) { + deserializedNetworkFirewallRuleGroupProperties.publicCloudConnectorsResourceId = reader.getString(); + } else if ("awsAccountId".equals(fieldName)) { + deserializedNetworkFirewallRuleGroupProperties.awsAccountId = reader.getString(); + } else if ("arn".equals(fieldName)) { + deserializedNetworkFirewallRuleGroupProperties.arn = reader.getString(); + } else if ("publicCloudResourceName".equals(fieldName)) { + deserializedNetworkFirewallRuleGroupProperties.publicCloudResourceName = reader.getString(); + } else if ("awsSourceSchema".equals(fieldName)) { + deserializedNetworkFirewallRuleGroupProperties.awsSourceSchema = reader.getString(); + } else if ("awsRegion".equals(fieldName)) { + deserializedNetworkFirewallRuleGroupProperties.awsRegion = reader.getString(); + } else if ("awsTags".equals(fieldName)) { + Map awsTags = reader.readMap(reader1 -> reader1.getString()); + deserializedNetworkFirewallRuleGroupProperties.awsTags = awsTags; + } else if ("provisioningState".equals(fieldName)) { + deserializedNetworkFirewallRuleGroupProperties.provisioningState + = ProvisioningState.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedNetworkFirewallRuleGroupProperties; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/NetworkFirewallRuleGroupTagsUpdate.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/NetworkFirewallRuleGroupTagsUpdate.java new file mode 100644 index 000000000000..8437b5f4eefc --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/NetworkFirewallRuleGroupTagsUpdate.java @@ -0,0 +1,96 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.Map; + +/** + * The type used for updating tags in NetworkFirewallRuleGroup resources. + */ +@Fluent +public final class NetworkFirewallRuleGroupTagsUpdate implements JsonSerializable { + /* + * Resource tags. + */ + private Map tags; + + /** + * Creates an instance of NetworkFirewallRuleGroupTagsUpdate class. + */ + public NetworkFirewallRuleGroupTagsUpdate() { + } + + /** + * Get the tags property: Resource tags. + * + * @return the tags value. + */ + public Map tags() { + return this.tags; + } + + /** + * Set the tags property: Resource tags. + * + * @param tags the tags value to set. + * @return the NetworkFirewallRuleGroupTagsUpdate object itself. + */ + public NetworkFirewallRuleGroupTagsUpdate withTags(Map tags) { + this.tags = tags; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeMapField("tags", this.tags, (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of NetworkFirewallRuleGroupTagsUpdate from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of NetworkFirewallRuleGroupTagsUpdate if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the NetworkFirewallRuleGroupTagsUpdate. + */ + public static NetworkFirewallRuleGroupTagsUpdate fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + NetworkFirewallRuleGroupTagsUpdate deserializedNetworkFirewallRuleGroupTagsUpdate + = new NetworkFirewallRuleGroupTagsUpdate(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedNetworkFirewallRuleGroupTagsUpdate.tags = tags; + } else { + reader.skipChildren(); + } + } + + return deserializedNetworkFirewallRuleGroupTagsUpdate; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/NetworkFirewallRuleGroups.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/NetworkFirewallRuleGroups.java new file mode 100644 index 000000000000..f525013bc057 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/NetworkFirewallRuleGroups.java @@ -0,0 +1,162 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** + * Resource collection API of NetworkFirewallRuleGroups. + */ +public interface NetworkFirewallRuleGroups { + /** + * List NetworkFirewallRuleGroup resources by subscription ID. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a NetworkFirewallRuleGroup list operation as paginated response with + * {@link PagedIterable}. + */ + PagedIterable list(); + + /** + * List NetworkFirewallRuleGroup resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a NetworkFirewallRuleGroup list operation as paginated response with + * {@link PagedIterable}. + */ + PagedIterable list(Context context); + + /** + * List NetworkFirewallRuleGroup resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a NetworkFirewallRuleGroup list operation as paginated response with + * {@link PagedIterable}. + */ + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * List NetworkFirewallRuleGroup resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a NetworkFirewallRuleGroup list operation as paginated response with + * {@link PagedIterable}. + */ + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Get a NetworkFirewallRuleGroup. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of NetworkFirewallRuleGroup. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a NetworkFirewallRuleGroup along with {@link Response}. + */ + Response getByResourceGroupWithResponse(String resourceGroupName, String name, + Context context); + + /** + * Get a NetworkFirewallRuleGroup. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of NetworkFirewallRuleGroup. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a NetworkFirewallRuleGroup. + */ + NetworkFirewallRuleGroup getByResourceGroup(String resourceGroupName, String name); + + /** + * Delete a NetworkFirewallRuleGroup. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of NetworkFirewallRuleGroup. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByResourceGroup(String resourceGroupName, String name); + + /** + * Delete a NetworkFirewallRuleGroup. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of NetworkFirewallRuleGroup. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String name, Context context); + + /** + * Get a NetworkFirewallRuleGroup. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a NetworkFirewallRuleGroup along with {@link Response}. + */ + NetworkFirewallRuleGroup getById(String id); + + /** + * Get a NetworkFirewallRuleGroup. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a NetworkFirewallRuleGroup along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Delete a NetworkFirewallRuleGroup. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteById(String id); + + /** + * Delete a NetworkFirewallRuleGroup. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new NetworkFirewallRuleGroup resource. + * + * @param name resource name. + * @return the first stage of the new NetworkFirewallRuleGroup definition. + */ + NetworkFirewallRuleGroup.DefinitionStages.Blank define(String name); +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/NetworkFirewallTagsUpdate.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/NetworkFirewallTagsUpdate.java new file mode 100644 index 000000000000..ad807865ac1e --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/NetworkFirewallTagsUpdate.java @@ -0,0 +1,95 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.Map; + +/** + * The type used for updating tags in NetworkFirewallFirewall resources. + */ +@Fluent +public final class NetworkFirewallTagsUpdate implements JsonSerializable { + /* + * Resource tags. + */ + private Map tags; + + /** + * Creates an instance of NetworkFirewallTagsUpdate class. + */ + public NetworkFirewallTagsUpdate() { + } + + /** + * Get the tags property: Resource tags. + * + * @return the tags value. + */ + public Map tags() { + return this.tags; + } + + /** + * Set the tags property: Resource tags. + * + * @param tags the tags value to set. + * @return the NetworkFirewallTagsUpdate object itself. + */ + public NetworkFirewallTagsUpdate withTags(Map tags) { + this.tags = tags; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeMapField("tags", this.tags, (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of NetworkFirewallTagsUpdate from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of NetworkFirewallTagsUpdate if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IOException If an error occurs while reading the NetworkFirewallTagsUpdate. + */ + public static NetworkFirewallTagsUpdate fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + NetworkFirewallTagsUpdate deserializedNetworkFirewallTagsUpdate = new NetworkFirewallTagsUpdate(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedNetworkFirewallTagsUpdate.tags = tags; + } else { + reader.skipChildren(); + } + } + + return deserializedNetworkFirewallTagsUpdate; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/NetworkInterfaceCountRequest.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/NetworkInterfaceCountRequest.java new file mode 100644 index 000000000000..f9d4573e51dd --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/NetworkInterfaceCountRequest.java @@ -0,0 +1,121 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of NetworkInterfaceCountRequest. + */ +@Fluent +public final class NetworkInterfaceCountRequest implements JsonSerializable { + /* + * The maximum number of network interfaces. + */ + private Integer max; + + /* + * The minimum number of network interfaces. + */ + private Integer min; + + /** + * Creates an instance of NetworkInterfaceCountRequest class. + */ + public NetworkInterfaceCountRequest() { + } + + /** + * Get the max property: The maximum number of network interfaces. + * + * @return the max value. + */ + public Integer max() { + return this.max; + } + + /** + * Set the max property: The maximum number of network interfaces. + * + * @param max the max value to set. + * @return the NetworkInterfaceCountRequest object itself. + */ + public NetworkInterfaceCountRequest withMax(Integer max) { + this.max = max; + return this; + } + + /** + * Get the min property: The minimum number of network interfaces. + * + * @return the min value. + */ + public Integer min() { + return this.min; + } + + /** + * Set the min property: The minimum number of network interfaces. + * + * @param min the min value to set. + * @return the NetworkInterfaceCountRequest object itself. + */ + public NetworkInterfaceCountRequest withMin(Integer min) { + this.min = min; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeNumberField("max", this.max); + jsonWriter.writeNumberField("min", this.min); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of NetworkInterfaceCountRequest from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of NetworkInterfaceCountRequest if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the NetworkInterfaceCountRequest. + */ + public static NetworkInterfaceCountRequest fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + NetworkInterfaceCountRequest deserializedNetworkInterfaceCountRequest = new NetworkInterfaceCountRequest(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("max".equals(fieldName)) { + deserializedNetworkInterfaceCountRequest.max = reader.getNullable(JsonReader::getInt); + } else if ("min".equals(fieldName)) { + deserializedNetworkInterfaceCountRequest.min = reader.getNullable(JsonReader::getInt); + } else { + reader.skipChildren(); + } + } + + return deserializedNetworkInterfaceCountRequest; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/NetworkInterfaceStatus.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/NetworkInterfaceStatus.java new file mode 100644 index 000000000000..8ccef8611cd8 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/NetworkInterfaceStatus.java @@ -0,0 +1,66 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * NetworkInterfaceStatus enum. + */ +public final class NetworkInterfaceStatus extends ExpandableStringEnum { + /** + * Static value associated for NetworkInterfaceStatus. + */ + public static final NetworkInterfaceStatus ASSOCIATED = fromString("associated"); + + /** + * Static value attaching for NetworkInterfaceStatus. + */ + public static final NetworkInterfaceStatus ATTACHING = fromString("attaching"); + + /** + * Static value available for NetworkInterfaceStatus. + */ + public static final NetworkInterfaceStatus AVAILABLE = fromString("available"); + + /** + * Static value detaching for NetworkInterfaceStatus. + */ + public static final NetworkInterfaceStatus DETACHING = fromString("detaching"); + + /** + * Static value in-use for NetworkInterfaceStatus. + */ + public static final NetworkInterfaceStatus IN_USE = fromString("in-use"); + + /** + * Creates a new instance of NetworkInterfaceStatus value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public NetworkInterfaceStatus() { + } + + /** + * Creates or finds a NetworkInterfaceStatus from its string representation. + * + * @param name a name to look for. + * @return the corresponding NetworkInterfaceStatus. + */ + public static NetworkInterfaceStatus fromString(String name) { + return fromString(name, NetworkInterfaceStatus.class); + } + + /** + * Gets known NetworkInterfaceStatus values. + * + * @return known NetworkInterfaceStatus values. + */ + public static Collection values() { + return values(NetworkInterfaceStatus.class); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/NetworkInterfaceStatusEnumValue.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/NetworkInterfaceStatusEnumValue.java new file mode 100644 index 000000000000..521f057ad945 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/NetworkInterfaceStatusEnumValue.java @@ -0,0 +1,95 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of NetworkInterfaceStatusEnumValue. + */ +@Fluent +public final class NetworkInterfaceStatusEnumValue implements JsonSerializable { + /* + * Property value + */ + private NetworkInterfaceStatus value; + + /** + * Creates an instance of NetworkInterfaceStatusEnumValue class. + */ + public NetworkInterfaceStatusEnumValue() { + } + + /** + * Get the value property: Property value. + * + * @return the value value. + */ + public NetworkInterfaceStatus value() { + return this.value; + } + + /** + * Set the value property: Property value. + * + * @param value the value value to set. + * @return the NetworkInterfaceStatusEnumValue object itself. + */ + public NetworkInterfaceStatusEnumValue withValue(NetworkInterfaceStatus value) { + this.value = value; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("value", this.value == null ? null : this.value.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of NetworkInterfaceStatusEnumValue from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of NetworkInterfaceStatusEnumValue if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the NetworkInterfaceStatusEnumValue. + */ + public static NetworkInterfaceStatusEnumValue fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + NetworkInterfaceStatusEnumValue deserializedNetworkInterfaceStatusEnumValue + = new NetworkInterfaceStatusEnumValue(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + deserializedNetworkInterfaceStatusEnumValue.value + = NetworkInterfaceStatus.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedNetworkInterfaceStatusEnumValue; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/NetworkOrigin.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/NetworkOrigin.java new file mode 100644 index 000000000000..b11ffaf24036 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/NetworkOrigin.java @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * NetworkOrigin enum. + */ +public final class NetworkOrigin extends ExpandableStringEnum { + /** + * Static value Internet for NetworkOrigin. + */ + public static final NetworkOrigin INTERNET = fromString("Internet"); + + /** + * Static value VPC for NetworkOrigin. + */ + public static final NetworkOrigin VPC = fromString("VPC"); + + /** + * Creates a new instance of NetworkOrigin value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public NetworkOrigin() { + } + + /** + * Creates or finds a NetworkOrigin from its string representation. + * + * @param name a name to look for. + * @return the corresponding NetworkOrigin. + */ + public static NetworkOrigin fromString(String name) { + return fromString(name, NetworkOrigin.class); + } + + /** + * Gets known NetworkOrigin values. + * + * @return known NetworkOrigin values. + */ + public static Collection values() { + return values(NetworkOrigin.class); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/Networking.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/Networking.java new file mode 100644 index 000000000000..8712f5df39c1 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/Networking.java @@ -0,0 +1,129 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Definition of Networking. + */ +@Fluent +public final class Networking implements JsonSerializable { + /* + * Monthly Transfer of the Instance. + */ + private MonthlyTransfer monthlyTransfer; + + /* + * Ports to the Instance. + */ + private List ports; + + /** + * Creates an instance of Networking class. + */ + public Networking() { + } + + /** + * Get the monthlyTransfer property: Monthly Transfer of the Instance. + * + * @return the monthlyTransfer value. + */ + public MonthlyTransfer monthlyTransfer() { + return this.monthlyTransfer; + } + + /** + * Set the monthlyTransfer property: Monthly Transfer of the Instance. + * + * @param monthlyTransfer the monthlyTransfer value to set. + * @return the Networking object itself. + */ + public Networking withMonthlyTransfer(MonthlyTransfer monthlyTransfer) { + this.monthlyTransfer = monthlyTransfer; + return this; + } + + /** + * Get the ports property: Ports to the Instance. + * + * @return the ports value. + */ + public List ports() { + return this.ports; + } + + /** + * Set the ports property: Ports to the Instance. + * + * @param ports the ports value to set. + * @return the Networking object itself. + */ + public Networking withPorts(List ports) { + this.ports = ports; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (monthlyTransfer() != null) { + monthlyTransfer().validate(); + } + if (ports() != null) { + ports().forEach(e -> e.validate()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("monthlyTransfer", this.monthlyTransfer); + jsonWriter.writeArrayField("ports", this.ports, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of Networking from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of Networking if the JsonReader was pointing to an instance of it, or null if it was pointing + * to JSON null. + * @throws IOException If an error occurs while reading the Networking. + */ + public static Networking fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + Networking deserializedNetworking = new Networking(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("monthlyTransfer".equals(fieldName)) { + deserializedNetworking.monthlyTransfer = MonthlyTransfer.fromJson(reader); + } else if ("ports".equals(fieldName)) { + List ports = reader.readArray(reader1 -> Port.fromJson(reader1)); + deserializedNetworking.ports = ports; + } else { + reader.skipChildren(); + } + } + + return deserializedNetworking; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/Node.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/Node.java new file mode 100644 index 000000000000..dfaa85e241ff --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/Node.java @@ -0,0 +1,255 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.time.OffsetDateTime; +import java.time.format.DateTimeFormatter; + +/** + * Definition of Node. + */ +@Fluent +public final class Node implements JsonSerializable { + /* + *

The Availability Zone (AZ) in which the node has been deployed.

+ */ + private String availabilityZone; + + /* + *

The endpoint for the node, consisting of a DNS name and a port number. Client applications can connect + * directly to a node endpoint, if desired (as an alternative to allowing DAX client software to intelligently route + * requests and responses to nodes in the DAX cluster.

+ */ + private Endpoint endpoint; + + /* + *

The date and time (in UNIX epoch format) when the node was launched.

+ */ + private OffsetDateTime nodeCreateTime; + + /* + *

A system-generated identifier for the node.

+ */ + private String nodeId; + + /* + *

The current status of the node. For example: available.

+ */ + private String nodeStatus; + + /* + *

The status of the parameter group associated with this node. For example, in-sync.

+ */ + private String parameterGroupStatus; + + /** + * Creates an instance of Node class. + */ + public Node() { + } + + /** + * Get the availabilityZone property: <p>The Availability Zone (AZ) in which the node has been + * deployed.</p>. + * + * @return the availabilityZone value. + */ + public String availabilityZone() { + return this.availabilityZone; + } + + /** + * Set the availabilityZone property: <p>The Availability Zone (AZ) in which the node has been + * deployed.</p>. + * + * @param availabilityZone the availabilityZone value to set. + * @return the Node object itself. + */ + public Node withAvailabilityZone(String availabilityZone) { + this.availabilityZone = availabilityZone; + return this; + } + + /** + * Get the endpoint property: <p>The endpoint for the node, consisting of a DNS name and a port number. Client + * applications can connect directly to a node endpoint, if desired (as an alternative to allowing DAX client + * software to intelligently route requests and responses to nodes in the DAX cluster.</p>. + * + * @return the endpoint value. + */ + public Endpoint endpoint() { + return this.endpoint; + } + + /** + * Set the endpoint property: <p>The endpoint for the node, consisting of a DNS name and a port number. Client + * applications can connect directly to a node endpoint, if desired (as an alternative to allowing DAX client + * software to intelligently route requests and responses to nodes in the DAX cluster.</p>. + * + * @param endpoint the endpoint value to set. + * @return the Node object itself. + */ + public Node withEndpoint(Endpoint endpoint) { + this.endpoint = endpoint; + return this; + } + + /** + * Get the nodeCreateTime property: <p>The date and time (in UNIX epoch format) when the node was + * launched.</p>. + * + * @return the nodeCreateTime value. + */ + public OffsetDateTime nodeCreateTime() { + return this.nodeCreateTime; + } + + /** + * Set the nodeCreateTime property: <p>The date and time (in UNIX epoch format) when the node was + * launched.</p>. + * + * @param nodeCreateTime the nodeCreateTime value to set. + * @return the Node object itself. + */ + public Node withNodeCreateTime(OffsetDateTime nodeCreateTime) { + this.nodeCreateTime = nodeCreateTime; + return this; + } + + /** + * Get the nodeId property: <p>A system-generated identifier for the node.</p>. + * + * @return the nodeId value. + */ + public String nodeId() { + return this.nodeId; + } + + /** + * Set the nodeId property: <p>A system-generated identifier for the node.</p>. + * + * @param nodeId the nodeId value to set. + * @return the Node object itself. + */ + public Node withNodeId(String nodeId) { + this.nodeId = nodeId; + return this; + } + + /** + * Get the nodeStatus property: <p>The current status of the node. For example: + * <code>available</code>.</p>. + * + * @return the nodeStatus value. + */ + public String nodeStatus() { + return this.nodeStatus; + } + + /** + * Set the nodeStatus property: <p>The current status of the node. For example: + * <code>available</code>.</p>. + * + * @param nodeStatus the nodeStatus value to set. + * @return the Node object itself. + */ + public Node withNodeStatus(String nodeStatus) { + this.nodeStatus = nodeStatus; + return this; + } + + /** + * Get the parameterGroupStatus property: <p>The status of the parameter group associated with this node. For + * example, <code>in-sync</code>.</p>. + * + * @return the parameterGroupStatus value. + */ + public String parameterGroupStatus() { + return this.parameterGroupStatus; + } + + /** + * Set the parameterGroupStatus property: <p>The status of the parameter group associated with this node. For + * example, <code>in-sync</code>.</p>. + * + * @param parameterGroupStatus the parameterGroupStatus value to set. + * @return the Node object itself. + */ + public Node withParameterGroupStatus(String parameterGroupStatus) { + this.parameterGroupStatus = parameterGroupStatus; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (endpoint() != null) { + endpoint().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("availabilityZone", this.availabilityZone); + jsonWriter.writeJsonField("endpoint", this.endpoint); + jsonWriter.writeStringField("nodeCreateTime", + this.nodeCreateTime == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.nodeCreateTime)); + jsonWriter.writeStringField("nodeId", this.nodeId); + jsonWriter.writeStringField("nodeStatus", this.nodeStatus); + jsonWriter.writeStringField("parameterGroupStatus", this.parameterGroupStatus); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of Node from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of Node if the JsonReader was pointing to an instance of it, or null if it was pointing to + * JSON null. + * @throws IOException If an error occurs while reading the Node. + */ + public static Node fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + Node deserializedNode = new Node(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("availabilityZone".equals(fieldName)) { + deserializedNode.availabilityZone = reader.getString(); + } else if ("endpoint".equals(fieldName)) { + deserializedNode.endpoint = Endpoint.fromJson(reader); + } else if ("nodeCreateTime".equals(fieldName)) { + deserializedNode.nodeCreateTime = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("nodeId".equals(fieldName)) { + deserializedNode.nodeId = reader.getString(); + } else if ("nodeStatus".equals(fieldName)) { + deserializedNode.nodeStatus = reader.getString(); + } else if ("parameterGroupStatus".equals(fieldName)) { + deserializedNode.parameterGroupStatus = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedNode; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/NodeToNodeEncryptionOptions.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/NodeToNodeEncryptionOptions.java new file mode 100644 index 000000000000..123659be5904 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/NodeToNodeEncryptionOptions.java @@ -0,0 +1,93 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of NodeToNodeEncryptionOptions. + */ +@Fluent +public final class NodeToNodeEncryptionOptions implements JsonSerializable { + /* + *

True to enable node-to-node encryption.

+ */ + private Boolean enabled; + + /** + * Creates an instance of NodeToNodeEncryptionOptions class. + */ + public NodeToNodeEncryptionOptions() { + } + + /** + * Get the enabled property: <p>True to enable node-to-node encryption.</p>. + * + * @return the enabled value. + */ + public Boolean enabled() { + return this.enabled; + } + + /** + * Set the enabled property: <p>True to enable node-to-node encryption.</p>. + * + * @param enabled the enabled value to set. + * @return the NodeToNodeEncryptionOptions object itself. + */ + public NodeToNodeEncryptionOptions withEnabled(Boolean enabled) { + this.enabled = enabled; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeBooleanField("enabled", this.enabled); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of NodeToNodeEncryptionOptions from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of NodeToNodeEncryptionOptions if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the NodeToNodeEncryptionOptions. + */ + public static NodeToNodeEncryptionOptions fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + NodeToNodeEncryptionOptions deserializedNodeToNodeEncryptionOptions = new NodeToNodeEncryptionOptions(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("enabled".equals(fieldName)) { + deserializedNodeToNodeEncryptionOptions.enabled = reader.getNullable(JsonReader::getBoolean); + } else { + reader.skipChildren(); + } + } + + return deserializedNodeToNodeEncryptionOptions; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/NonCompliantSummary.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/NonCompliantSummary.java new file mode 100644 index 000000000000..06b9e9ecdb6d --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/NonCompliantSummary.java @@ -0,0 +1,126 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of NonCompliantSummary. + */ +@Fluent +public final class NonCompliantSummary implements JsonSerializable { + /* + *

The total number of compliance items that aren't compliant.

+ */ + private Integer nonCompliantCount; + + /* + *

A summary of the non-compliance severity by compliance type

+ */ + private SeveritySummary severitySummary; + + /** + * Creates an instance of NonCompliantSummary class. + */ + public NonCompliantSummary() { + } + + /** + * Get the nonCompliantCount property: <p>The total number of compliance items that aren't + * compliant.</p>. + * + * @return the nonCompliantCount value. + */ + public Integer nonCompliantCount() { + return this.nonCompliantCount; + } + + /** + * Set the nonCompliantCount property: <p>The total number of compliance items that aren't + * compliant.</p>. + * + * @param nonCompliantCount the nonCompliantCount value to set. + * @return the NonCompliantSummary object itself. + */ + public NonCompliantSummary withNonCompliantCount(Integer nonCompliantCount) { + this.nonCompliantCount = nonCompliantCount; + return this; + } + + /** + * Get the severitySummary property: <p>A summary of the non-compliance severity by compliance type</p>. + * + * @return the severitySummary value. + */ + public SeveritySummary severitySummary() { + return this.severitySummary; + } + + /** + * Set the severitySummary property: <p>A summary of the non-compliance severity by compliance type</p>. + * + * @param severitySummary the severitySummary value to set. + * @return the NonCompliantSummary object itself. + */ + public NonCompliantSummary withSeveritySummary(SeveritySummary severitySummary) { + this.severitySummary = severitySummary; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (severitySummary() != null) { + severitySummary().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeNumberField("nonCompliantCount", this.nonCompliantCount); + jsonWriter.writeJsonField("severitySummary", this.severitySummary); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of NonCompliantSummary from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of NonCompliantSummary if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the NonCompliantSummary. + */ + public static NonCompliantSummary fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + NonCompliantSummary deserializedNonCompliantSummary = new NonCompliantSummary(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("nonCompliantCount".equals(fieldName)) { + deserializedNonCompliantSummary.nonCompliantCount = reader.getNullable(JsonReader::getInt); + } else if ("severitySummary".equals(fieldName)) { + deserializedNonCompliantSummary.severitySummary = SeveritySummary.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedNonCompliantSummary; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/NoncurrentVersionExpiration.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/NoncurrentVersionExpiration.java new file mode 100644 index 000000000000..3c5b232f7153 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/NoncurrentVersionExpiration.java @@ -0,0 +1,144 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of NoncurrentVersionExpiration. + */ +@Fluent +public final class NoncurrentVersionExpiration implements JsonSerializable { + /* + * Specifies how many noncurrent versions S3 will retain. If there are this many more recent noncurrent versions, S3 + * will take the associated action. For more information about noncurrent versions, see [Lifecycle configuration + * elements](https://docs.aws.amazon.com/AmazonS3/latest/userguide/intro-lifecycle-rules.html) in the *Amazon S3 + * User Guide*. + */ + private Integer newerNoncurrentVersions; + + /* + * Specifies the number of days an object is noncurrent before S3 can perform the associated action. For information + * about the noncurrent days calculations, see [How Amazon S3 Calculates When an Object Became + * Noncurrent](https://docs.aws.amazon.com/AmazonS3/latest/dev/intro-lifecycle-rules.html#non-current-days- + * calculations) in the *Amazon S3 User Guide*. + */ + private Integer noncurrentDays; + + /** + * Creates an instance of NoncurrentVersionExpiration class. + */ + public NoncurrentVersionExpiration() { + } + + /** + * Get the newerNoncurrentVersions property: Specifies how many noncurrent versions S3 will retain. If there are + * this many more recent noncurrent versions, S3 will take the associated action. For more information about + * noncurrent versions, see [Lifecycle configuration + * elements](https://docs.aws.amazon.com/AmazonS3/latest/userguide/intro-lifecycle-rules.html) in the *Amazon S3 + * User Guide*. + * + * @return the newerNoncurrentVersions value. + */ + public Integer newerNoncurrentVersions() { + return this.newerNoncurrentVersions; + } + + /** + * Set the newerNoncurrentVersions property: Specifies how many noncurrent versions S3 will retain. If there are + * this many more recent noncurrent versions, S3 will take the associated action. For more information about + * noncurrent versions, see [Lifecycle configuration + * elements](https://docs.aws.amazon.com/AmazonS3/latest/userguide/intro-lifecycle-rules.html) in the *Amazon S3 + * User Guide*. + * + * @param newerNoncurrentVersions the newerNoncurrentVersions value to set. + * @return the NoncurrentVersionExpiration object itself. + */ + public NoncurrentVersionExpiration withNewerNoncurrentVersions(Integer newerNoncurrentVersions) { + this.newerNoncurrentVersions = newerNoncurrentVersions; + return this; + } + + /** + * Get the noncurrentDays property: Specifies the number of days an object is noncurrent before S3 can perform the + * associated action. For information about the noncurrent days calculations, see [How Amazon S3 Calculates When an + * Object Became + * Noncurrent](https://docs.aws.amazon.com/AmazonS3/latest/dev/intro-lifecycle-rules.html#non-current-days-calculations) + * in the *Amazon S3 User Guide*. + * + * @return the noncurrentDays value. + */ + public Integer noncurrentDays() { + return this.noncurrentDays; + } + + /** + * Set the noncurrentDays property: Specifies the number of days an object is noncurrent before S3 can perform the + * associated action. For information about the noncurrent days calculations, see [How Amazon S3 Calculates When an + * Object Became + * Noncurrent](https://docs.aws.amazon.com/AmazonS3/latest/dev/intro-lifecycle-rules.html#non-current-days-calculations) + * in the *Amazon S3 User Guide*. + * + * @param noncurrentDays the noncurrentDays value to set. + * @return the NoncurrentVersionExpiration object itself. + */ + public NoncurrentVersionExpiration withNoncurrentDays(Integer noncurrentDays) { + this.noncurrentDays = noncurrentDays; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeNumberField("newerNoncurrentVersions", this.newerNoncurrentVersions); + jsonWriter.writeNumberField("noncurrentDays", this.noncurrentDays); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of NoncurrentVersionExpiration from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of NoncurrentVersionExpiration if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the NoncurrentVersionExpiration. + */ + public static NoncurrentVersionExpiration fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + NoncurrentVersionExpiration deserializedNoncurrentVersionExpiration = new NoncurrentVersionExpiration(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("newerNoncurrentVersions".equals(fieldName)) { + deserializedNoncurrentVersionExpiration.newerNoncurrentVersions + = reader.getNullable(JsonReader::getInt); + } else if ("noncurrentDays".equals(fieldName)) { + deserializedNoncurrentVersionExpiration.noncurrentDays = reader.getNullable(JsonReader::getInt); + } else { + reader.skipChildren(); + } + } + + return deserializedNoncurrentVersionExpiration; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/NoncurrentVersionTransition.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/NoncurrentVersionTransition.java new file mode 100644 index 000000000000..6e3af11a16ae --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/NoncurrentVersionTransition.java @@ -0,0 +1,173 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of NoncurrentVersionTransition. + */ +@Fluent +public final class NoncurrentVersionTransition implements JsonSerializable { + /* + * Specifies how many noncurrent versions S3 will retain. If there are this many more recent noncurrent versions, S3 + * will take the associated action. For more information about noncurrent versions, see [Lifecycle configuration + * elements](https://docs.aws.amazon.com/AmazonS3/latest/userguide/intro-lifecycle-rules.html) in the *Amazon S3 + * User Guide*. + */ + private Integer newerNoncurrentVersions; + + /* + * The class of storage used to store the object. + */ + private NoncurrentVersionTransitionStorageClass storageClass; + + /* + * Specifies the number of days an object is noncurrent before Amazon S3 can perform the associated action. For + * information about the noncurrent days calculations, see [How Amazon S3 Calculates How Long an Object Has Been + * Noncurrent](https://docs.aws.amazon.com/AmazonS3/latest/dev/intro-lifecycle-rules.html#non-current-days- + * calculations) in the *Amazon S3 User Guide*. + */ + private Integer transitionInDays; + + /** + * Creates an instance of NoncurrentVersionTransition class. + */ + public NoncurrentVersionTransition() { + } + + /** + * Get the newerNoncurrentVersions property: Specifies how many noncurrent versions S3 will retain. If there are + * this many more recent noncurrent versions, S3 will take the associated action. For more information about + * noncurrent versions, see [Lifecycle configuration + * elements](https://docs.aws.amazon.com/AmazonS3/latest/userguide/intro-lifecycle-rules.html) in the *Amazon S3 + * User Guide*. + * + * @return the newerNoncurrentVersions value. + */ + public Integer newerNoncurrentVersions() { + return this.newerNoncurrentVersions; + } + + /** + * Set the newerNoncurrentVersions property: Specifies how many noncurrent versions S3 will retain. If there are + * this many more recent noncurrent versions, S3 will take the associated action. For more information about + * noncurrent versions, see [Lifecycle configuration + * elements](https://docs.aws.amazon.com/AmazonS3/latest/userguide/intro-lifecycle-rules.html) in the *Amazon S3 + * User Guide*. + * + * @param newerNoncurrentVersions the newerNoncurrentVersions value to set. + * @return the NoncurrentVersionTransition object itself. + */ + public NoncurrentVersionTransition withNewerNoncurrentVersions(Integer newerNoncurrentVersions) { + this.newerNoncurrentVersions = newerNoncurrentVersions; + return this; + } + + /** + * Get the storageClass property: The class of storage used to store the object. + * + * @return the storageClass value. + */ + public NoncurrentVersionTransitionStorageClass storageClass() { + return this.storageClass; + } + + /** + * Set the storageClass property: The class of storage used to store the object. + * + * @param storageClass the storageClass value to set. + * @return the NoncurrentVersionTransition object itself. + */ + public NoncurrentVersionTransition withStorageClass(NoncurrentVersionTransitionStorageClass storageClass) { + this.storageClass = storageClass; + return this; + } + + /** + * Get the transitionInDays property: Specifies the number of days an object is noncurrent before Amazon S3 can + * perform the associated action. For information about the noncurrent days calculations, see [How Amazon S3 + * Calculates How Long an Object Has Been + * Noncurrent](https://docs.aws.amazon.com/AmazonS3/latest/dev/intro-lifecycle-rules.html#non-current-days-calculations) + * in the *Amazon S3 User Guide*. + * + * @return the transitionInDays value. + */ + public Integer transitionInDays() { + return this.transitionInDays; + } + + /** + * Set the transitionInDays property: Specifies the number of days an object is noncurrent before Amazon S3 can + * perform the associated action. For information about the noncurrent days calculations, see [How Amazon S3 + * Calculates How Long an Object Has Been + * Noncurrent](https://docs.aws.amazon.com/AmazonS3/latest/dev/intro-lifecycle-rules.html#non-current-days-calculations) + * in the *Amazon S3 User Guide*. + * + * @param transitionInDays the transitionInDays value to set. + * @return the NoncurrentVersionTransition object itself. + */ + public NoncurrentVersionTransition withTransitionInDays(Integer transitionInDays) { + this.transitionInDays = transitionInDays; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeNumberField("newerNoncurrentVersions", this.newerNoncurrentVersions); + jsonWriter.writeStringField("storageClass", this.storageClass == null ? null : this.storageClass.toString()); + jsonWriter.writeNumberField("transitionInDays", this.transitionInDays); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of NoncurrentVersionTransition from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of NoncurrentVersionTransition if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the NoncurrentVersionTransition. + */ + public static NoncurrentVersionTransition fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + NoncurrentVersionTransition deserializedNoncurrentVersionTransition = new NoncurrentVersionTransition(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("newerNoncurrentVersions".equals(fieldName)) { + deserializedNoncurrentVersionTransition.newerNoncurrentVersions + = reader.getNullable(JsonReader::getInt); + } else if ("storageClass".equals(fieldName)) { + deserializedNoncurrentVersionTransition.storageClass + = NoncurrentVersionTransitionStorageClass.fromString(reader.getString()); + } else if ("transitionInDays".equals(fieldName)) { + deserializedNoncurrentVersionTransition.transitionInDays = reader.getNullable(JsonReader::getInt); + } else { + reader.skipChildren(); + } + } + + return deserializedNoncurrentVersionTransition; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/NoncurrentVersionTransitionStorageClass.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/NoncurrentVersionTransitionStorageClass.java new file mode 100644 index 000000000000..1d91d4050012 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/NoncurrentVersionTransitionStorageClass.java @@ -0,0 +1,72 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * NoncurrentVersionTransitionStorageClass enum. + */ +public final class NoncurrentVersionTransitionStorageClass + extends ExpandableStringEnum { + /** + * Static value DEEP_ARCHIVE for NoncurrentVersionTransitionStorageClass. + */ + public static final NoncurrentVersionTransitionStorageClass DEEP_ARCHIVE = fromString("DEEP_ARCHIVE"); + + /** + * Static value GLACIER for NoncurrentVersionTransitionStorageClass. + */ + public static final NoncurrentVersionTransitionStorageClass GLACIER = fromString("GLACIER"); + + /** + * Static value GLACIER_IR for NoncurrentVersionTransitionStorageClass. + */ + public static final NoncurrentVersionTransitionStorageClass GLACIER_IR = fromString("GLACIER_IR"); + + /** + * Static value INTELLIGENT_TIERING for NoncurrentVersionTransitionStorageClass. + */ + public static final NoncurrentVersionTransitionStorageClass INTELLIGENT_TIERING = fromString("INTELLIGENT_TIERING"); + + /** + * Static value ONEZONE_IA for NoncurrentVersionTransitionStorageClass. + */ + public static final NoncurrentVersionTransitionStorageClass ONEZONE_IA = fromString("ONEZONE_IA"); + + /** + * Static value STANDARD_IA for NoncurrentVersionTransitionStorageClass. + */ + public static final NoncurrentVersionTransitionStorageClass STANDARD_IA = fromString("STANDARD_IA"); + + /** + * Creates a new instance of NoncurrentVersionTransitionStorageClass value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public NoncurrentVersionTransitionStorageClass() { + } + + /** + * Creates or finds a NoncurrentVersionTransitionStorageClass from its string representation. + * + * @param name a name to look for. + * @return the corresponding NoncurrentVersionTransitionStorageClass. + */ + public static NoncurrentVersionTransitionStorageClass fromString(String name) { + return fromString(name, NoncurrentVersionTransitionStorageClass.class); + } + + /** + * Gets known NoncurrentVersionTransitionStorageClass values. + * + * @return known NoncurrentVersionTransitionStorageClass values. + */ + public static Collection values() { + return values(NoncurrentVersionTransitionStorageClass.class); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/NotebookInstanceStatus.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/NotebookInstanceStatus.java new file mode 100644 index 000000000000..d541bcc3067f --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/NotebookInstanceStatus.java @@ -0,0 +1,76 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * NotebookInstanceStatus enum. + */ +public final class NotebookInstanceStatus extends ExpandableStringEnum { + /** + * Static value Deleting for NotebookInstanceStatus. + */ + public static final NotebookInstanceStatus DELETING = fromString("Deleting"); + + /** + * Static value Failed for NotebookInstanceStatus. + */ + public static final NotebookInstanceStatus FAILED = fromString("Failed"); + + /** + * Static value InService for NotebookInstanceStatus. + */ + public static final NotebookInstanceStatus IN_SERVICE = fromString("InService"); + + /** + * Static value Pending for NotebookInstanceStatus. + */ + public static final NotebookInstanceStatus PENDING = fromString("Pending"); + + /** + * Static value Stopped for NotebookInstanceStatus. + */ + public static final NotebookInstanceStatus STOPPED = fromString("Stopped"); + + /** + * Static value Stopping for NotebookInstanceStatus. + */ + public static final NotebookInstanceStatus STOPPING = fromString("Stopping"); + + /** + * Static value Updating for NotebookInstanceStatus. + */ + public static final NotebookInstanceStatus UPDATING = fromString("Updating"); + + /** + * Creates a new instance of NotebookInstanceStatus value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public NotebookInstanceStatus() { + } + + /** + * Creates or finds a NotebookInstanceStatus from its string representation. + * + * @param name a name to look for. + * @return the corresponding NotebookInstanceStatus. + */ + public static NotebookInstanceStatus fromString(String name) { + return fromString(name, NotebookInstanceStatus.class); + } + + /** + * Gets known NotebookInstanceStatus values. + * + * @return known NotebookInstanceStatus values. + */ + public static Collection values() { + return values(NotebookInstanceStatus.class); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/NotebookInstanceStatusEnumValue.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/NotebookInstanceStatusEnumValue.java new file mode 100644 index 000000000000..19b409b3e715 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/NotebookInstanceStatusEnumValue.java @@ -0,0 +1,95 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of NotebookInstanceStatusEnumValue. + */ +@Fluent +public final class NotebookInstanceStatusEnumValue implements JsonSerializable { + /* + * Property value + */ + private NotebookInstanceStatus value; + + /** + * Creates an instance of NotebookInstanceStatusEnumValue class. + */ + public NotebookInstanceStatusEnumValue() { + } + + /** + * Get the value property: Property value. + * + * @return the value value. + */ + public NotebookInstanceStatus value() { + return this.value; + } + + /** + * Set the value property: Property value. + * + * @param value the value value to set. + * @return the NotebookInstanceStatusEnumValue object itself. + */ + public NotebookInstanceStatusEnumValue withValue(NotebookInstanceStatus value) { + this.value = value; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("value", this.value == null ? null : this.value.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of NotebookInstanceStatusEnumValue from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of NotebookInstanceStatusEnumValue if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the NotebookInstanceStatusEnumValue. + */ + public static NotebookInstanceStatusEnumValue fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + NotebookInstanceStatusEnumValue deserializedNotebookInstanceStatusEnumValue + = new NotebookInstanceStatusEnumValue(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + deserializedNotebookInstanceStatusEnumValue.value + = NotebookInstanceStatus.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedNotebookInstanceStatusEnumValue; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/NotificationConfiguration.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/NotificationConfiguration.java new file mode 100644 index 000000000000..dda0a3c4e850 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/NotificationConfiguration.java @@ -0,0 +1,133 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Definition of NotificationConfiguration. + */ +@Fluent +public final class NotificationConfiguration implements JsonSerializable { + /* + * A list of event types that send a notification. Event types can include any of the following types. *Allowed + * values*: + ``autoscaling:EC2_INSTANCE_LAUNCH`` + ``autoscaling:EC2_INSTANCE_LAUNCH_ERROR`` + + * ``autoscaling:EC2_INSTANCE_TERMINATE`` + ``autoscaling:EC2_INSTANCE_TERMINATE_ERROR`` + + * ``autoscaling:TEST_NOTIFICATION`` + */ + private List notificationTypes; + + /* + * The Amazon Resource Name (ARN) of the Amazon SNS topic. + */ + private String topicArn; + + /** + * Creates an instance of NotificationConfiguration class. + */ + public NotificationConfiguration() { + } + + /** + * Get the notificationTypes property: A list of event types that send a notification. Event types can include any + * of the following types. *Allowed values*: + ``autoscaling:EC2_INSTANCE_LAUNCH`` + + * ``autoscaling:EC2_INSTANCE_LAUNCH_ERROR`` + ``autoscaling:EC2_INSTANCE_TERMINATE`` + + * ``autoscaling:EC2_INSTANCE_TERMINATE_ERROR`` + ``autoscaling:TEST_NOTIFICATION``. + * + * @return the notificationTypes value. + */ + public List notificationTypes() { + return this.notificationTypes; + } + + /** + * Set the notificationTypes property: A list of event types that send a notification. Event types can include any + * of the following types. *Allowed values*: + ``autoscaling:EC2_INSTANCE_LAUNCH`` + + * ``autoscaling:EC2_INSTANCE_LAUNCH_ERROR`` + ``autoscaling:EC2_INSTANCE_TERMINATE`` + + * ``autoscaling:EC2_INSTANCE_TERMINATE_ERROR`` + ``autoscaling:TEST_NOTIFICATION``. + * + * @param notificationTypes the notificationTypes value to set. + * @return the NotificationConfiguration object itself. + */ + public NotificationConfiguration withNotificationTypes(List notificationTypes) { + this.notificationTypes = notificationTypes; + return this; + } + + /** + * Get the topicArn property: The Amazon Resource Name (ARN) of the Amazon SNS topic. + * + * @return the topicArn value. + */ + public String topicArn() { + return this.topicArn; + } + + /** + * Set the topicArn property: The Amazon Resource Name (ARN) of the Amazon SNS topic. + * + * @param topicArn the topicArn value to set. + * @return the NotificationConfiguration object itself. + */ + public NotificationConfiguration withTopicArn(String topicArn) { + this.topicArn = topicArn; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("notificationTypes", this.notificationTypes, + (writer, element) -> writer.writeString(element)); + jsonWriter.writeStringField("topicARN", this.topicArn); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of NotificationConfiguration from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of NotificationConfiguration if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IOException If an error occurs while reading the NotificationConfiguration. + */ + public static NotificationConfiguration fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + NotificationConfiguration deserializedNotificationConfiguration = new NotificationConfiguration(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("notificationTypes".equals(fieldName)) { + List notificationTypes = reader.readArray(reader1 -> reader1.getString()); + deserializedNotificationConfiguration.notificationTypes = notificationTypes; + } else if ("topicARN".equals(fieldName)) { + deserializedNotificationConfiguration.topicArn = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedNotificationConfiguration; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/NotificationConfigurationAutoGenerated.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/NotificationConfigurationAutoGenerated.java new file mode 100644 index 000000000000..5deb074fc775 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/NotificationConfigurationAutoGenerated.java @@ -0,0 +1,128 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of NotificationConfiguration. + */ +@Fluent +public final class NotificationConfigurationAutoGenerated + implements JsonSerializable { + /* + *

The Amazon Resource Name (ARN) that identifies the topic.

+ */ + private String topicArn; + + /* + *

The current state of the topic. A value of “active” means that notifications will be sent to the topic. A + * value of “inactive” means that notifications will not be sent to the topic.

+ */ + private String topicStatus; + + /** + * Creates an instance of NotificationConfigurationAutoGenerated class. + */ + public NotificationConfigurationAutoGenerated() { + } + + /** + * Get the topicArn property: <p>The Amazon Resource Name (ARN) that identifies the topic. </p>. + * + * @return the topicArn value. + */ + public String topicArn() { + return this.topicArn; + } + + /** + * Set the topicArn property: <p>The Amazon Resource Name (ARN) that identifies the topic. </p>. + * + * @param topicArn the topicArn value to set. + * @return the NotificationConfigurationAutoGenerated object itself. + */ + public NotificationConfigurationAutoGenerated withTopicArn(String topicArn) { + this.topicArn = topicArn; + return this; + } + + /** + * Get the topicStatus property: <p>The current state of the topic. A value of “active” means that + * notifications will be sent to the topic. A value of “inactive” means that notifications will not be sent to the + * topic.</p>. + * + * @return the topicStatus value. + */ + public String topicStatus() { + return this.topicStatus; + } + + /** + * Set the topicStatus property: <p>The current state of the topic. A value of “active” means that + * notifications will be sent to the topic. A value of “inactive” means that notifications will not be sent to the + * topic.</p>. + * + * @param topicStatus the topicStatus value to set. + * @return the NotificationConfigurationAutoGenerated object itself. + */ + public NotificationConfigurationAutoGenerated withTopicStatus(String topicStatus) { + this.topicStatus = topicStatus; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("topicArn", this.topicArn); + jsonWriter.writeStringField("topicStatus", this.topicStatus); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of NotificationConfigurationAutoGenerated from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of NotificationConfigurationAutoGenerated if the JsonReader was pointing to an instance of + * it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the NotificationConfigurationAutoGenerated. + */ + public static NotificationConfigurationAutoGenerated fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + NotificationConfigurationAutoGenerated deserializedNotificationConfigurationAutoGenerated + = new NotificationConfigurationAutoGenerated(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("topicArn".equals(fieldName)) { + deserializedNotificationConfigurationAutoGenerated.topicArn = reader.getString(); + } else if ("topicStatus".equals(fieldName)) { + deserializedNotificationConfigurationAutoGenerated.topicStatus = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedNotificationConfigurationAutoGenerated; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/NotificationConfigurationAutoGenerated2.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/NotificationConfigurationAutoGenerated2.java new file mode 100644 index 000000000000..565986a6dc07 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/NotificationConfigurationAutoGenerated2.java @@ -0,0 +1,233 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Definition of NotificationConfiguration. + */ +@Fluent +public final class NotificationConfigurationAutoGenerated2 + implements JsonSerializable { + /* + * Enables delivery of events to Amazon EventBridge. Amazon S3 can send events to Amazon EventBridge whenever + * certain events happen in your bucket, see [Using + * EventBridge](https://docs.aws.amazon.com/AmazonS3/latest/userguide/EventBridge.html) in the *Amazon S3 User + * Guide*. Unlike other destinations, delivery of events to EventBridge can be either enabled or disabled for a + * bucket. If enabled, all events will be sent to EventBridge and you can use EventBridge rules to route events to + * additional targets. For more information, see [What Is Amazon + * EventBridge](https://docs.aws.amazon.com/eventbridge/latest/userguide/eb-what-is.html) in the *Amazon EventBridge + * User Guide* + */ + private EventBridgeConfiguration eventBridgeConfiguration; + + /* + * Describes the LAMlong functions to invoke and the events for which to invoke them. + */ + private List lambdaConfigurations; + + /* + * The Amazon Simple Queue Service queues to publish messages to and the events for which to publish messages. + */ + private List queueConfigurations; + + /* + * The topic to which notifications are sent and the events for which notifications are generated. + */ + private List topicConfigurations; + + /** + * Creates an instance of NotificationConfigurationAutoGenerated2 class. + */ + public NotificationConfigurationAutoGenerated2() { + } + + /** + * Get the eventBridgeConfiguration property: Enables delivery of events to Amazon EventBridge. Amazon S3 can send + * events to Amazon EventBridge whenever certain events happen in your bucket, see [Using + * EventBridge](https://docs.aws.amazon.com/AmazonS3/latest/userguide/EventBridge.html) in the *Amazon S3 User + * Guide*. Unlike other destinations, delivery of events to EventBridge can be either enabled or disabled for a + * bucket. If enabled, all events will be sent to EventBridge and you can use EventBridge rules to route events to + * additional targets. For more information, see [What Is Amazon + * EventBridge](https://docs.aws.amazon.com/eventbridge/latest/userguide/eb-what-is.html) in the *Amazon EventBridge + * User Guide*. + * + * @return the eventBridgeConfiguration value. + */ + public EventBridgeConfiguration eventBridgeConfiguration() { + return this.eventBridgeConfiguration; + } + + /** + * Set the eventBridgeConfiguration property: Enables delivery of events to Amazon EventBridge. Amazon S3 can send + * events to Amazon EventBridge whenever certain events happen in your bucket, see [Using + * EventBridge](https://docs.aws.amazon.com/AmazonS3/latest/userguide/EventBridge.html) in the *Amazon S3 User + * Guide*. Unlike other destinations, delivery of events to EventBridge can be either enabled or disabled for a + * bucket. If enabled, all events will be sent to EventBridge and you can use EventBridge rules to route events to + * additional targets. For more information, see [What Is Amazon + * EventBridge](https://docs.aws.amazon.com/eventbridge/latest/userguide/eb-what-is.html) in the *Amazon EventBridge + * User Guide*. + * + * @param eventBridgeConfiguration the eventBridgeConfiguration value to set. + * @return the NotificationConfigurationAutoGenerated2 object itself. + */ + public NotificationConfigurationAutoGenerated2 + withEventBridgeConfiguration(EventBridgeConfiguration eventBridgeConfiguration) { + this.eventBridgeConfiguration = eventBridgeConfiguration; + return this; + } + + /** + * Get the lambdaConfigurations property: Describes the LAMlong functions to invoke and the events for which to + * invoke them. + * + * @return the lambdaConfigurations value. + */ + public List lambdaConfigurations() { + return this.lambdaConfigurations; + } + + /** + * Set the lambdaConfigurations property: Describes the LAMlong functions to invoke and the events for which to + * invoke them. + * + * @param lambdaConfigurations the lambdaConfigurations value to set. + * @return the NotificationConfigurationAutoGenerated2 object itself. + */ + public NotificationConfigurationAutoGenerated2 + withLambdaConfigurations(List lambdaConfigurations) { + this.lambdaConfigurations = lambdaConfigurations; + return this; + } + + /** + * Get the queueConfigurations property: The Amazon Simple Queue Service queues to publish messages to and the + * events for which to publish messages. + * + * @return the queueConfigurations value. + */ + public List queueConfigurations() { + return this.queueConfigurations; + } + + /** + * Set the queueConfigurations property: The Amazon Simple Queue Service queues to publish messages to and the + * events for which to publish messages. + * + * @param queueConfigurations the queueConfigurations value to set. + * @return the NotificationConfigurationAutoGenerated2 object itself. + */ + public NotificationConfigurationAutoGenerated2 + withQueueConfigurations(List queueConfigurations) { + this.queueConfigurations = queueConfigurations; + return this; + } + + /** + * Get the topicConfigurations property: The topic to which notifications are sent and the events for which + * notifications are generated. + * + * @return the topicConfigurations value. + */ + public List topicConfigurations() { + return this.topicConfigurations; + } + + /** + * Set the topicConfigurations property: The topic to which notifications are sent and the events for which + * notifications are generated. + * + * @param topicConfigurations the topicConfigurations value to set. + * @return the NotificationConfigurationAutoGenerated2 object itself. + */ + public NotificationConfigurationAutoGenerated2 + withTopicConfigurations(List topicConfigurations) { + this.topicConfigurations = topicConfigurations; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (eventBridgeConfiguration() != null) { + eventBridgeConfiguration().validate(); + } + if (lambdaConfigurations() != null) { + lambdaConfigurations().forEach(e -> e.validate()); + } + if (queueConfigurations() != null) { + queueConfigurations().forEach(e -> e.validate()); + } + if (topicConfigurations() != null) { + topicConfigurations().forEach(e -> e.validate()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("eventBridgeConfiguration", this.eventBridgeConfiguration); + jsonWriter.writeArrayField("lambdaConfigurations", this.lambdaConfigurations, + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("queueConfigurations", this.queueConfigurations, + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("topicConfigurations", this.topicConfigurations, + (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of NotificationConfigurationAutoGenerated2 from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of NotificationConfigurationAutoGenerated2 if the JsonReader was pointing to an instance of + * it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the NotificationConfigurationAutoGenerated2. + */ + public static NotificationConfigurationAutoGenerated2 fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + NotificationConfigurationAutoGenerated2 deserializedNotificationConfigurationAutoGenerated2 + = new NotificationConfigurationAutoGenerated2(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("eventBridgeConfiguration".equals(fieldName)) { + deserializedNotificationConfigurationAutoGenerated2.eventBridgeConfiguration + = EventBridgeConfiguration.fromJson(reader); + } else if ("lambdaConfigurations".equals(fieldName)) { + List lambdaConfigurations + = reader.readArray(reader1 -> LambdaConfiguration.fromJson(reader1)); + deserializedNotificationConfigurationAutoGenerated2.lambdaConfigurations = lambdaConfigurations; + } else if ("queueConfigurations".equals(fieldName)) { + List queueConfigurations + = reader.readArray(reader1 -> QueueConfiguration.fromJson(reader1)); + deserializedNotificationConfigurationAutoGenerated2.queueConfigurations = queueConfigurations; + } else if ("topicConfigurations".equals(fieldName)) { + List topicConfigurations + = reader.readArray(reader1 -> TopicConfiguration.fromJson(reader1)); + deserializedNotificationConfigurationAutoGenerated2.topicConfigurations = topicConfigurations; + } else { + reader.skipChildren(); + } + } + + return deserializedNotificationConfigurationAutoGenerated2; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/NotificationFilter.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/NotificationFilter.java new file mode 100644 index 000000000000..f0f4fe2e73ed --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/NotificationFilter.java @@ -0,0 +1,111 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of NotificationFilter. + */ +@Fluent +public final class NotificationFilter implements JsonSerializable { + /* + * A container for object key name prefix and suffix filtering rules. A container for object key name prefix and + * suffix filtering rules. For more information about object key name filtering, see [Configuring event + * notifications using object key name + * filtering](https://docs.aws.amazon.com/AmazonS3/latest/userguide/notification-how-to-filtering.html) in the + * *Amazon S3 User Guide*. The same type of filter rule cannot be used more than once. For example, you cannot + * specify two prefix rules. + */ + private S3KeyFilter s3Key; + + /** + * Creates an instance of NotificationFilter class. + */ + public NotificationFilter() { + } + + /** + * Get the s3Key property: A container for object key name prefix and suffix filtering rules. A container for object + * key name prefix and suffix filtering rules. For more information about object key name filtering, see + * [Configuring event notifications using object key name + * filtering](https://docs.aws.amazon.com/AmazonS3/latest/userguide/notification-how-to-filtering.html) in the + * *Amazon S3 User Guide*. The same type of filter rule cannot be used more than once. For example, you cannot + * specify two prefix rules. + * + * @return the s3Key value. + */ + public S3KeyFilter s3Key() { + return this.s3Key; + } + + /** + * Set the s3Key property: A container for object key name prefix and suffix filtering rules. A container for object + * key name prefix and suffix filtering rules. For more information about object key name filtering, see + * [Configuring event notifications using object key name + * filtering](https://docs.aws.amazon.com/AmazonS3/latest/userguide/notification-how-to-filtering.html) in the + * *Amazon S3 User Guide*. The same type of filter rule cannot be used more than once. For example, you cannot + * specify two prefix rules. + * + * @param s3Key the s3Key value to set. + * @return the NotificationFilter object itself. + */ + public NotificationFilter withS3Key(S3KeyFilter s3Key) { + this.s3Key = s3Key; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (s3Key() != null) { + s3Key().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("s3Key", this.s3Key); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of NotificationFilter from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of NotificationFilter if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the NotificationFilter. + */ + public static NotificationFilter fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + NotificationFilter deserializedNotificationFilter = new NotificationFilter(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("s3Key".equals(fieldName)) { + deserializedNotificationFilter.s3Key = S3KeyFilter.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedNotificationFilter; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ObjectLockConfiguration.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ObjectLockConfiguration.java new file mode 100644 index 000000000000..f07ad1f5252b --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ObjectLockConfiguration.java @@ -0,0 +1,151 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of ObjectLockConfiguration. + */ +@Fluent +public final class ObjectLockConfiguration implements JsonSerializable { + /* + * Indicates whether this bucket has an Object Lock configuration enabled. Enable ``ObjectLockEnabled`` when you + * apply ``ObjectLockConfiguration`` to a bucket. + */ + private String objectLockEnabled; + + /* + * Specifies the Object Lock rule for the specified object. Enable this rule when you apply + * ``ObjectLockConfiguration`` to a bucket. If Object Lock is turned on, bucket settings require both ``Mode`` and a + * period of either ``Days`` or ``Years``. You cannot specify ``Days`` and ``Years`` at the same time. For more + * information, see + * [ObjectLockRule](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket- + * objectlockrule.html) and + * [DefaultRetention](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket- + * defaultretention.html). Specifies the Object Lock rule for the specified object. Enable the this rule when you + * apply ``ObjectLockConfiguration`` to a bucket. + */ + private ObjectLockRule rule; + + /** + * Creates an instance of ObjectLockConfiguration class. + */ + public ObjectLockConfiguration() { + } + + /** + * Get the objectLockEnabled property: Indicates whether this bucket has an Object Lock configuration enabled. + * Enable ``ObjectLockEnabled`` when you apply ``ObjectLockConfiguration`` to a bucket. + * + * @return the objectLockEnabled value. + */ + public String objectLockEnabled() { + return this.objectLockEnabled; + } + + /** + * Set the objectLockEnabled property: Indicates whether this bucket has an Object Lock configuration enabled. + * Enable ``ObjectLockEnabled`` when you apply ``ObjectLockConfiguration`` to a bucket. + * + * @param objectLockEnabled the objectLockEnabled value to set. + * @return the ObjectLockConfiguration object itself. + */ + public ObjectLockConfiguration withObjectLockEnabled(String objectLockEnabled) { + this.objectLockEnabled = objectLockEnabled; + return this; + } + + /** + * Get the rule property: Specifies the Object Lock rule for the specified object. Enable this rule when you apply + * ``ObjectLockConfiguration`` to a bucket. If Object Lock is turned on, bucket settings require both ``Mode`` and a + * period of either ``Days`` or ``Years``. You cannot specify ``Days`` and ``Years`` at the same time. For more + * information, see + * [ObjectLockRule](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-objectlockrule.html) + * and + * [DefaultRetention](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-defaultretention.html). + * Specifies the Object Lock rule for the specified object. Enable the this rule when you apply + * ``ObjectLockConfiguration`` to a bucket. + * + * @return the rule value. + */ + public ObjectLockRule rule() { + return this.rule; + } + + /** + * Set the rule property: Specifies the Object Lock rule for the specified object. Enable this rule when you apply + * ``ObjectLockConfiguration`` to a bucket. If Object Lock is turned on, bucket settings require both ``Mode`` and a + * period of either ``Days`` or ``Years``. You cannot specify ``Days`` and ``Years`` at the same time. For more + * information, see + * [ObjectLockRule](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-objectlockrule.html) + * and + * [DefaultRetention](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-defaultretention.html). + * Specifies the Object Lock rule for the specified object. Enable the this rule when you apply + * ``ObjectLockConfiguration`` to a bucket. + * + * @param rule the rule value to set. + * @return the ObjectLockConfiguration object itself. + */ + public ObjectLockConfiguration withRule(ObjectLockRule rule) { + this.rule = rule; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (rule() != null) { + rule().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("objectLockEnabled", this.objectLockEnabled); + jsonWriter.writeJsonField("rule", this.rule); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ObjectLockConfiguration from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ObjectLockConfiguration if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the ObjectLockConfiguration. + */ + public static ObjectLockConfiguration fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ObjectLockConfiguration deserializedObjectLockConfiguration = new ObjectLockConfiguration(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("objectLockEnabled".equals(fieldName)) { + deserializedObjectLockConfiguration.objectLockEnabled = reader.getString(); + } else if ("rule".equals(fieldName)) { + deserializedObjectLockConfiguration.rule = ObjectLockRule.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedObjectLockConfiguration; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ObjectLockRule.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ObjectLockRule.java new file mode 100644 index 000000000000..136f8dc0c6dd --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ObjectLockRule.java @@ -0,0 +1,120 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of ObjectLockRule. + */ +@Fluent +public final class ObjectLockRule implements JsonSerializable { + /* + * The default Object Lock retention mode and period that you want to apply to new objects placed in the specified + * bucket. If Object Lock is turned on, bucket settings require both ``Mode`` and a period of either ``Days`` or + * ``Years``. You cannot specify ``Days`` and ``Years`` at the same time. For more information about allowable + * values for mode and period, see + * [DefaultRetention](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket- + * defaultretention.html). The container element for specifying the default Object Lock retention settings for new + * objects placed in the specified bucket. + The ``DefaultRetention`` settings require both a mode and a period. + + * The ``DefaultRetention`` period can be either ``Days`` or ``Years`` but you must select one. You cannot specify + * ``Days`` and ``Years`` at the same time. + */ + private DefaultRetention defaultRetention; + + /** + * Creates an instance of ObjectLockRule class. + */ + public ObjectLockRule() { + } + + /** + * Get the defaultRetention property: The default Object Lock retention mode and period that you want to apply to + * new objects placed in the specified bucket. If Object Lock is turned on, bucket settings require both ``Mode`` + * and a period of either ``Days`` or ``Years``. You cannot specify ``Days`` and ``Years`` at the same time. For + * more information about allowable values for mode and period, see + * [DefaultRetention](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-defaultretention.html). + * The container element for specifying the default Object Lock retention settings for new objects placed in the + * specified bucket. + The ``DefaultRetention`` settings require both a mode and a period. + The + * ``DefaultRetention`` period can be either ``Days`` or ``Years`` but you must select one. You cannot specify + * ``Days`` and ``Years`` at the same time. + * + * @return the defaultRetention value. + */ + public DefaultRetention defaultRetention() { + return this.defaultRetention; + } + + /** + * Set the defaultRetention property: The default Object Lock retention mode and period that you want to apply to + * new objects placed in the specified bucket. If Object Lock is turned on, bucket settings require both ``Mode`` + * and a period of either ``Days`` or ``Years``. You cannot specify ``Days`` and ``Years`` at the same time. For + * more information about allowable values for mode and period, see + * [DefaultRetention](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-defaultretention.html). + * The container element for specifying the default Object Lock retention settings for new objects placed in the + * specified bucket. + The ``DefaultRetention`` settings require both a mode and a period. + The + * ``DefaultRetention`` period can be either ``Days`` or ``Years`` but you must select one. You cannot specify + * ``Days`` and ``Years`` at the same time. + * + * @param defaultRetention the defaultRetention value to set. + * @return the ObjectLockRule object itself. + */ + public ObjectLockRule withDefaultRetention(DefaultRetention defaultRetention) { + this.defaultRetention = defaultRetention; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (defaultRetention() != null) { + defaultRetention().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("defaultRetention", this.defaultRetention); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ObjectLockRule from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ObjectLockRule if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the ObjectLockRule. + */ + public static ObjectLockRule fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ObjectLockRule deserializedObjectLockRule = new ObjectLockRule(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("defaultRetention".equals(fieldName)) { + deserializedObjectLockRule.defaultRetention = DefaultRetention.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedObjectLockRule; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/OffPeakWindow.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/OffPeakWindow.java new file mode 100644 index 000000000000..d7f51ccffcec --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/OffPeakWindow.java @@ -0,0 +1,102 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of OffPeakWindow. + */ +@Fluent +public final class OffPeakWindow implements JsonSerializable { + /* + *

A custom start time for the off-peak window, in Coordinated Universal Time (UTC). The window length will + * always be 10 hours, so you can't specify an end time. For example, if you specify 11:00 P.M. UTC as a start time, + * the end time will automatically be set to 9:00 A.M.

+ */ + private WindowStartTime windowStartTime; + + /** + * Creates an instance of OffPeakWindow class. + */ + public OffPeakWindow() { + } + + /** + * Get the windowStartTime property: <p>A custom start time for the off-peak window, in Coordinated Universal + * Time (UTC). The window length will always be 10 hours, so you can't specify an end time. For example, if you + * specify 11:00 P.M. UTC as a start time, the end time will automatically be set to 9:00 A.M.</p>. + * + * @return the windowStartTime value. + */ + public WindowStartTime windowStartTime() { + return this.windowStartTime; + } + + /** + * Set the windowStartTime property: <p>A custom start time for the off-peak window, in Coordinated Universal + * Time (UTC). The window length will always be 10 hours, so you can't specify an end time. For example, if you + * specify 11:00 P.M. UTC as a start time, the end time will automatically be set to 9:00 A.M.</p>. + * + * @param windowStartTime the windowStartTime value to set. + * @return the OffPeakWindow object itself. + */ + public OffPeakWindow withWindowStartTime(WindowStartTime windowStartTime) { + this.windowStartTime = windowStartTime; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (windowStartTime() != null) { + windowStartTime().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("windowStartTime", this.windowStartTime); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of OffPeakWindow from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of OffPeakWindow if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the OffPeakWindow. + */ + public static OffPeakWindow fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + OffPeakWindow deserializedOffPeakWindow = new OffPeakWindow(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("windowStartTime".equals(fieldName)) { + deserializedOffPeakWindow.windowStartTime = WindowStartTime.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedOffPeakWindow; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/OffPeakWindowOptions.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/OffPeakWindowOptions.java new file mode 100644 index 000000000000..adcaa2085749 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/OffPeakWindowOptions.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.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of OffPeakWindowOptions. + */ +@Fluent +public final class OffPeakWindowOptions implements JsonSerializable { + /* + *

Whether to enable an off-peak window.

This option is only available when modifying a domain created + * prior to February 16, 2023, not when creating a new domain. All domains created after this date have the off-peak + * window enabled by default. You can't disable the off-peak window after it's enabled for a domain.

+ */ + private Boolean enabled; + + /* + *

Off-peak window settings for the domain.

+ */ + private OffPeakWindow offPeakWindow; + + /** + * Creates an instance of OffPeakWindowOptions class. + */ + public OffPeakWindowOptions() { + } + + /** + * Get the enabled property: <p>Whether to enable an off-peak window.</p> <p>This option is only + * available when modifying a domain created prior to February 16, 2023, not when creating a new domain. All domains + * created after this date have the off-peak window enabled by default. You can't disable the off-peak window after + * it's enabled for a domain.</p>. + * + * @return the enabled value. + */ + public Boolean enabled() { + return this.enabled; + } + + /** + * Set the enabled property: <p>Whether to enable an off-peak window.</p> <p>This option is only + * available when modifying a domain created prior to February 16, 2023, not when creating a new domain. All domains + * created after this date have the off-peak window enabled by default. You can't disable the off-peak window after + * it's enabled for a domain.</p>. + * + * @param enabled the enabled value to set. + * @return the OffPeakWindowOptions object itself. + */ + public OffPeakWindowOptions withEnabled(Boolean enabled) { + this.enabled = enabled; + return this; + } + + /** + * Get the offPeakWindow property: <p>Off-peak window settings for the domain.</p>. + * + * @return the offPeakWindow value. + */ + public OffPeakWindow offPeakWindow() { + return this.offPeakWindow; + } + + /** + * Set the offPeakWindow property: <p>Off-peak window settings for the domain.</p>. + * + * @param offPeakWindow the offPeakWindow value to set. + * @return the OffPeakWindowOptions object itself. + */ + public OffPeakWindowOptions withOffPeakWindow(OffPeakWindow offPeakWindow) { + this.offPeakWindow = offPeakWindow; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (offPeakWindow() != null) { + offPeakWindow().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeBooleanField("enabled", this.enabled); + jsonWriter.writeJsonField("offPeakWindow", this.offPeakWindow); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of OffPeakWindowOptions from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of OffPeakWindowOptions if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the OffPeakWindowOptions. + */ + public static OffPeakWindowOptions fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + OffPeakWindowOptions deserializedOffPeakWindowOptions = new OffPeakWindowOptions(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("enabled".equals(fieldName)) { + deserializedOffPeakWindowOptions.enabled = reader.getNullable(JsonReader::getBoolean); + } else if ("offPeakWindow".equals(fieldName)) { + deserializedOffPeakWindowOptions.offPeakWindow = OffPeakWindow.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedOffPeakWindowOptions; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/Oidc.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/Oidc.java new file mode 100644 index 000000000000..c4aeff20d010 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/Oidc.java @@ -0,0 +1,93 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of OIDC. + */ +@Fluent +public final class Oidc implements JsonSerializable { + /* + *

The issuer URL for the OIDC identity provider.

+ */ + private String issuer; + + /** + * Creates an instance of Oidc class. + */ + public Oidc() { + } + + /** + * Get the issuer property: <p>The issuer URL for the OIDC identity provider.</p>. + * + * @return the issuer value. + */ + public String issuer() { + return this.issuer; + } + + /** + * Set the issuer property: <p>The issuer URL for the OIDC identity provider.</p>. + * + * @param issuer the issuer value to set. + * @return the Oidc object itself. + */ + public Oidc withIssuer(String issuer) { + this.issuer = issuer; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("issuer", this.issuer); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of Oidc from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of Oidc if the JsonReader was pointing to an instance of it, or null if it was pointing to + * JSON null. + * @throws IOException If an error occurs while reading the Oidc. + */ + public static Oidc fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + Oidc deserializedOidc = new Oidc(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("issuer".equals(fieldName)) { + deserializedOidc.issuer = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedOidc; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/OpenIdConnectConfig.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/OpenIdConnectConfig.java new file mode 100644 index 000000000000..50fa846c12b7 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/OpenIdConnectConfig.java @@ -0,0 +1,192 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of OpenIDConnectConfig. + */ +@Fluent +public final class OpenIdConnectConfig implements JsonSerializable { + /* + *

The number of milliseconds that a token is valid after being authenticated.

+ */ + private Long authTtl; + + /* + *

The client identifier of the relying party at the OpenID identity provider. This identifier is typically + * obtained when the relying party is registered with the OpenID identity provider. You can specify a regular + * expression so that AppSync can validate against multiple client identifiers at a time.

+ */ + private String clientId; + + /* + *

The number of milliseconds that a token is valid after it's issued to a user.

+ */ + private Long iatTtl; + + /* + *

The issuer for the OIDC configuration. The issuer returned by discovery must exactly match the value of + * iss in the ID token.

+ */ + private String issuer; + + /** + * Creates an instance of OpenIdConnectConfig class. + */ + public OpenIdConnectConfig() { + } + + /** + * Get the authTtl property: <p>The number of milliseconds that a token is valid after being + * authenticated.</p>. + * + * @return the authTtl value. + */ + public Long authTtl() { + return this.authTtl; + } + + /** + * Set the authTtl property: <p>The number of milliseconds that a token is valid after being + * authenticated.</p>. + * + * @param authTtl the authTtl value to set. + * @return the OpenIdConnectConfig object itself. + */ + public OpenIdConnectConfig withAuthTtl(Long authTtl) { + this.authTtl = authTtl; + return this; + } + + /** + * Get the clientId property: <p>The client identifier of the relying party at the OpenID identity provider. + * This identifier is typically obtained when the relying party is registered with the OpenID identity provider. You + * can specify a regular expression so that AppSync can validate against multiple client identifiers at a + * time.</p>. + * + * @return the clientId value. + */ + public String clientId() { + return this.clientId; + } + + /** + * Set the clientId property: <p>The client identifier of the relying party at the OpenID identity provider. + * This identifier is typically obtained when the relying party is registered with the OpenID identity provider. You + * can specify a regular expression so that AppSync can validate against multiple client identifiers at a + * time.</p>. + * + * @param clientId the clientId value to set. + * @return the OpenIdConnectConfig object itself. + */ + public OpenIdConnectConfig withClientId(String clientId) { + this.clientId = clientId; + return this; + } + + /** + * Get the iatTtl property: <p>The number of milliseconds that a token is valid after it's issued to a + * user.</p>. + * + * @return the iatTtl value. + */ + public Long iatTtl() { + return this.iatTtl; + } + + /** + * Set the iatTtl property: <p>The number of milliseconds that a token is valid after it's issued to a + * user.</p>. + * + * @param iatTtl the iatTtl value to set. + * @return the OpenIdConnectConfig object itself. + */ + public OpenIdConnectConfig withIatTtl(Long iatTtl) { + this.iatTtl = iatTtl; + return this; + } + + /** + * Get the issuer property: <p>The issuer for the OIDC configuration. The issuer returned by discovery must + * exactly match the value of <code>iss</code> in the ID token.</p>. + * + * @return the issuer value. + */ + public String issuer() { + return this.issuer; + } + + /** + * Set the issuer property: <p>The issuer for the OIDC configuration. The issuer returned by discovery must + * exactly match the value of <code>iss</code> in the ID token.</p>. + * + * @param issuer the issuer value to set. + * @return the OpenIdConnectConfig object itself. + */ + public OpenIdConnectConfig withIssuer(String issuer) { + this.issuer = issuer; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeNumberField("authTTL", this.authTtl); + jsonWriter.writeStringField("clientId", this.clientId); + jsonWriter.writeNumberField("iatTTL", this.iatTtl); + jsonWriter.writeStringField("issuer", this.issuer); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of OpenIdConnectConfig from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of OpenIdConnectConfig if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the OpenIdConnectConfig. + */ + public static OpenIdConnectConfig fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + OpenIdConnectConfig deserializedOpenIdConnectConfig = new OpenIdConnectConfig(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("authTTL".equals(fieldName)) { + deserializedOpenIdConnectConfig.authTtl = reader.getNullable(JsonReader::getLong); + } else if ("clientId".equals(fieldName)) { + deserializedOpenIdConnectConfig.clientId = reader.getString(); + } else if ("iatTTL".equals(fieldName)) { + deserializedOpenIdConnectConfig.iatTtl = reader.getNullable(JsonReader::getLong); + } else if ("issuer".equals(fieldName)) { + deserializedOpenIdConnectConfig.issuer = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedOpenIdConnectConfig; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/OpenSearchDomainStatus.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/OpenSearchDomainStatus.java new file mode 100644 index 000000000000..601ca37bd1b2 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/OpenSearchDomainStatus.java @@ -0,0 +1,252 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.awsconnector.fluent.models.OpenSearchDomainStatusInner; +import java.util.Map; + +/** + * An immutable client-side representation of OpenSearchDomainStatus. + */ +public interface OpenSearchDomainStatus { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the location property: The geo-location where the resource lives. + * + * @return the location value. + */ + String location(); + + /** + * Gets the tags property: Resource tags. + * + * @return the tags value. + */ + Map tags(); + + /** + * Gets the properties property: The resource-specific properties for this resource. + * + * @return the properties value. + */ + OpenSearchDomainStatusProperties properties(); + + /** + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the region of the resource. + * + * @return the region of the resource. + */ + Region region(); + + /** + * Gets the name of the resource region. + * + * @return the name of the resource region. + */ + String regionName(); + + /** + * Gets the name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + + /** + * Gets the inner com.azure.resourcemanager.awsconnector.fluent.models.OpenSearchDomainStatusInner object. + * + * @return the inner object. + */ + OpenSearchDomainStatusInner innerModel(); + + /** + * The entirety of the OpenSearchDomainStatus definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithLocation, + DefinitionStages.WithResourceGroup, DefinitionStages.WithCreate { + } + + /** + * The OpenSearchDomainStatus definition stages. + */ + interface DefinitionStages { + /** + * The first stage of the OpenSearchDomainStatus definition. + */ + interface Blank extends WithLocation { + } + + /** + * The stage of the OpenSearchDomainStatus definition allowing to specify location. + */ + interface WithLocation { + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithResourceGroup withRegion(Region location); + + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithResourceGroup withRegion(String location); + } + + /** + * The stage of the OpenSearchDomainStatus definition allowing to specify parent resource. + */ + interface WithResourceGroup { + /** + * Specifies resourceGroupName. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @return the next definition stage. + */ + WithCreate withExistingResourceGroup(String resourceGroupName); + } + + /** + * The stage of the OpenSearchDomainStatus 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.WithProperties { + /** + * Executes the create request. + * + * @return the created resource. + */ + OpenSearchDomainStatus create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + OpenSearchDomainStatus create(Context context); + } + + /** + * The stage of the OpenSearchDomainStatus definition allowing to specify tags. + */ + interface WithTags { + /** + * Specifies the tags property: Resource tags.. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + WithCreate withTags(Map tags); + } + + /** + * The stage of the OpenSearchDomainStatus definition allowing to specify properties. + */ + interface WithProperties { + /** + * Specifies the properties property: The resource-specific properties for this resource.. + * + * @param properties The resource-specific properties for this resource. + * @return the next definition stage. + */ + WithCreate withProperties(OpenSearchDomainStatusProperties properties); + } + } + + /** + * Begins update for the OpenSearchDomainStatus resource. + * + * @return the stage of resource update. + */ + OpenSearchDomainStatus.Update update(); + + /** + * The template for OpenSearchDomainStatus update. + */ + interface Update extends UpdateStages.WithTags { + /** + * Executes the update request. + * + * @return the updated resource. + */ + OpenSearchDomainStatus apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + OpenSearchDomainStatus apply(Context context); + } + + /** + * The OpenSearchDomainStatus update stages. + */ + interface UpdateStages { + /** + * The stage of the OpenSearchDomainStatus update allowing to specify tags. + */ + interface WithTags { + /** + * Specifies the tags property: Resource tags.. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + Update withTags(Map tags); + } + } + + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + OpenSearchDomainStatus refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + OpenSearchDomainStatus refresh(Context context); +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/OpenSearchDomainStatusListResult.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/OpenSearchDomainStatusListResult.java new file mode 100644 index 000000000000..00f7019a0dc1 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/OpenSearchDomainStatusListResult.java @@ -0,0 +1,137 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.awsconnector.fluent.models.OpenSearchDomainStatusInner; +import java.io.IOException; +import java.util.List; + +/** + * The response of a OpenSearchDomainStatus list operation. + */ +@Fluent +public final class OpenSearchDomainStatusListResult implements JsonSerializable { + /* + * The OpenSearchDomainStatus items on this page + */ + private List value; + + /* + * The link to the next page of items + */ + private String nextLink; + + /** + * Creates an instance of OpenSearchDomainStatusListResult class. + */ + public OpenSearchDomainStatusListResult() { + } + + /** + * Get the value property: The OpenSearchDomainStatus items on this page. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The OpenSearchDomainStatus items on this page. + * + * @param value the value value to set. + * @return the OpenSearchDomainStatusListResult object itself. + */ + public OpenSearchDomainStatusListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The link to the next page of items. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: The link to the next page of items. + * + * @param nextLink the nextLink value to set. + * @return the OpenSearchDomainStatusListResult object itself. + */ + public OpenSearchDomainStatusListResult withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property value in model OpenSearchDomainStatusListResult")); + } else { + value().forEach(e -> e.validate()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(OpenSearchDomainStatusListResult.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("nextLink", this.nextLink); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of OpenSearchDomainStatusListResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of OpenSearchDomainStatusListResult if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the OpenSearchDomainStatusListResult. + */ + public static OpenSearchDomainStatusListResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + OpenSearchDomainStatusListResult deserializedOpenSearchDomainStatusListResult + = new OpenSearchDomainStatusListResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> OpenSearchDomainStatusInner.fromJson(reader1)); + deserializedOpenSearchDomainStatusListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedOpenSearchDomainStatusListResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedOpenSearchDomainStatusListResult; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/OpenSearchDomainStatusProperties.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/OpenSearchDomainStatusProperties.java new file mode 100644 index 000000000000..e1afbb711b9f --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/OpenSearchDomainStatusProperties.java @@ -0,0 +1,314 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.Map; + +/** + * Definition of OpenSearchDomainStatus. + */ +@Fluent +public final class OpenSearchDomainStatusProperties implements JsonSerializable { + /* + * AWS Properties + */ + private AwsOpenSearchDomainStatusProperties awsProperties; + + /* + * Public Cloud Connectors Resource ID + */ + private String publicCloudConnectorsResourceId; + + /* + * AWS Account ID + */ + private String awsAccountId; + + /* + * Amazon Resource Name (ARN) + */ + private String arn; + + /* + * Public Cloud Resource Name + */ + private String publicCloudResourceName; + + /* + * AWS Source Schema + */ + private String awsSourceSchema; + + /* + * AWS Region + */ + private String awsRegion; + + /* + * AWS Tags + */ + private Map awsTags; + + /* + * The status of the last operation. + */ + private ProvisioningState provisioningState; + + /** + * Creates an instance of OpenSearchDomainStatusProperties class. + */ + public OpenSearchDomainStatusProperties() { + } + + /** + * Get the awsProperties property: AWS Properties. + * + * @return the awsProperties value. + */ + public AwsOpenSearchDomainStatusProperties awsProperties() { + return this.awsProperties; + } + + /** + * Set the awsProperties property: AWS Properties. + * + * @param awsProperties the awsProperties value to set. + * @return the OpenSearchDomainStatusProperties object itself. + */ + public OpenSearchDomainStatusProperties withAwsProperties(AwsOpenSearchDomainStatusProperties awsProperties) { + this.awsProperties = awsProperties; + return this; + } + + /** + * Get the publicCloudConnectorsResourceId property: Public Cloud Connectors Resource ID. + * + * @return the publicCloudConnectorsResourceId value. + */ + public String publicCloudConnectorsResourceId() { + return this.publicCloudConnectorsResourceId; + } + + /** + * Set the publicCloudConnectorsResourceId property: Public Cloud Connectors Resource ID. + * + * @param publicCloudConnectorsResourceId the publicCloudConnectorsResourceId value to set. + * @return the OpenSearchDomainStatusProperties object itself. + */ + public OpenSearchDomainStatusProperties + withPublicCloudConnectorsResourceId(String publicCloudConnectorsResourceId) { + this.publicCloudConnectorsResourceId = publicCloudConnectorsResourceId; + return this; + } + + /** + * Get the awsAccountId property: AWS Account ID. + * + * @return the awsAccountId value. + */ + public String awsAccountId() { + return this.awsAccountId; + } + + /** + * Set the awsAccountId property: AWS Account ID. + * + * @param awsAccountId the awsAccountId value to set. + * @return the OpenSearchDomainStatusProperties object itself. + */ + public OpenSearchDomainStatusProperties withAwsAccountId(String awsAccountId) { + this.awsAccountId = awsAccountId; + return this; + } + + /** + * Get the arn property: Amazon Resource Name (ARN). + * + * @return the arn value. + */ + public String arn() { + return this.arn; + } + + /** + * Set the arn property: Amazon Resource Name (ARN). + * + * @param arn the arn value to set. + * @return the OpenSearchDomainStatusProperties object itself. + */ + public OpenSearchDomainStatusProperties withArn(String arn) { + this.arn = arn; + return this; + } + + /** + * Get the publicCloudResourceName property: Public Cloud Resource Name. + * + * @return the publicCloudResourceName value. + */ + public String publicCloudResourceName() { + return this.publicCloudResourceName; + } + + /** + * Set the publicCloudResourceName property: Public Cloud Resource Name. + * + * @param publicCloudResourceName the publicCloudResourceName value to set. + * @return the OpenSearchDomainStatusProperties object itself. + */ + public OpenSearchDomainStatusProperties withPublicCloudResourceName(String publicCloudResourceName) { + this.publicCloudResourceName = publicCloudResourceName; + return this; + } + + /** + * Get the awsSourceSchema property: AWS Source Schema. + * + * @return the awsSourceSchema value. + */ + public String awsSourceSchema() { + return this.awsSourceSchema; + } + + /** + * Set the awsSourceSchema property: AWS Source Schema. + * + * @param awsSourceSchema the awsSourceSchema value to set. + * @return the OpenSearchDomainStatusProperties object itself. + */ + public OpenSearchDomainStatusProperties withAwsSourceSchema(String awsSourceSchema) { + this.awsSourceSchema = awsSourceSchema; + return this; + } + + /** + * Get the awsRegion property: AWS Region. + * + * @return the awsRegion value. + */ + public String awsRegion() { + return this.awsRegion; + } + + /** + * Set the awsRegion property: AWS Region. + * + * @param awsRegion the awsRegion value to set. + * @return the OpenSearchDomainStatusProperties object itself. + */ + public OpenSearchDomainStatusProperties withAwsRegion(String awsRegion) { + this.awsRegion = awsRegion; + return this; + } + + /** + * Get the awsTags property: AWS Tags. + * + * @return the awsTags value. + */ + public Map awsTags() { + return this.awsTags; + } + + /** + * Set the awsTags property: AWS Tags. + * + * @param awsTags the awsTags value to set. + * @return the OpenSearchDomainStatusProperties object itself. + */ + public OpenSearchDomainStatusProperties withAwsTags(Map awsTags) { + this.awsTags = awsTags; + return this; + } + + /** + * Get the provisioningState property: The status of the last operation. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (awsProperties() != null) { + awsProperties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("awsProperties", this.awsProperties); + jsonWriter.writeStringField("publicCloudConnectorsResourceId", this.publicCloudConnectorsResourceId); + jsonWriter.writeStringField("awsAccountId", this.awsAccountId); + jsonWriter.writeStringField("arn", this.arn); + jsonWriter.writeStringField("publicCloudResourceName", this.publicCloudResourceName); + jsonWriter.writeStringField("awsSourceSchema", this.awsSourceSchema); + jsonWriter.writeStringField("awsRegion", this.awsRegion); + jsonWriter.writeMapField("awsTags", this.awsTags, (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of OpenSearchDomainStatusProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of OpenSearchDomainStatusProperties if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the OpenSearchDomainStatusProperties. + */ + public static OpenSearchDomainStatusProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + OpenSearchDomainStatusProperties deserializedOpenSearchDomainStatusProperties + = new OpenSearchDomainStatusProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("awsProperties".equals(fieldName)) { + deserializedOpenSearchDomainStatusProperties.awsProperties + = AwsOpenSearchDomainStatusProperties.fromJson(reader); + } else if ("publicCloudConnectorsResourceId".equals(fieldName)) { + deserializedOpenSearchDomainStatusProperties.publicCloudConnectorsResourceId = reader.getString(); + } else if ("awsAccountId".equals(fieldName)) { + deserializedOpenSearchDomainStatusProperties.awsAccountId = reader.getString(); + } else if ("arn".equals(fieldName)) { + deserializedOpenSearchDomainStatusProperties.arn = reader.getString(); + } else if ("publicCloudResourceName".equals(fieldName)) { + deserializedOpenSearchDomainStatusProperties.publicCloudResourceName = reader.getString(); + } else if ("awsSourceSchema".equals(fieldName)) { + deserializedOpenSearchDomainStatusProperties.awsSourceSchema = reader.getString(); + } else if ("awsRegion".equals(fieldName)) { + deserializedOpenSearchDomainStatusProperties.awsRegion = reader.getString(); + } else if ("awsTags".equals(fieldName)) { + Map awsTags = reader.readMap(reader1 -> reader1.getString()); + deserializedOpenSearchDomainStatusProperties.awsTags = awsTags; + } else if ("provisioningState".equals(fieldName)) { + deserializedOpenSearchDomainStatusProperties.provisioningState + = ProvisioningState.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedOpenSearchDomainStatusProperties; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/OpenSearchDomainStatusTagsUpdate.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/OpenSearchDomainStatusTagsUpdate.java new file mode 100644 index 000000000000..fdb3cfe9136e --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/OpenSearchDomainStatusTagsUpdate.java @@ -0,0 +1,96 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.Map; + +/** + * The type used for updating tags in OpenSearchDomainStatus resources. + */ +@Fluent +public final class OpenSearchDomainStatusTagsUpdate implements JsonSerializable { + /* + * Resource tags. + */ + private Map tags; + + /** + * Creates an instance of OpenSearchDomainStatusTagsUpdate class. + */ + public OpenSearchDomainStatusTagsUpdate() { + } + + /** + * Get the tags property: Resource tags. + * + * @return the tags value. + */ + public Map tags() { + return this.tags; + } + + /** + * Set the tags property: Resource tags. + * + * @param tags the tags value to set. + * @return the OpenSearchDomainStatusTagsUpdate object itself. + */ + public OpenSearchDomainStatusTagsUpdate withTags(Map tags) { + this.tags = tags; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeMapField("tags", this.tags, (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of OpenSearchDomainStatusTagsUpdate from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of OpenSearchDomainStatusTagsUpdate if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the OpenSearchDomainStatusTagsUpdate. + */ + public static OpenSearchDomainStatusTagsUpdate fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + OpenSearchDomainStatusTagsUpdate deserializedOpenSearchDomainStatusTagsUpdate + = new OpenSearchDomainStatusTagsUpdate(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedOpenSearchDomainStatusTagsUpdate.tags = tags; + } else { + reader.skipChildren(); + } + } + + return deserializedOpenSearchDomainStatusTagsUpdate; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/OpenSearchDomainStatuses.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/OpenSearchDomainStatuses.java new file mode 100644 index 000000000000..9d5b524c9c48 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/OpenSearchDomainStatuses.java @@ -0,0 +1,158 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** + * Resource collection API of OpenSearchDomainStatuses. + */ +public interface OpenSearchDomainStatuses { + /** + * List OpenSearchDomainStatus resources by subscription ID. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a OpenSearchDomainStatus list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable list(); + + /** + * List OpenSearchDomainStatus resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a OpenSearchDomainStatus list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable list(Context context); + + /** + * List OpenSearchDomainStatus resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a OpenSearchDomainStatus list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * List OpenSearchDomainStatus resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a OpenSearchDomainStatus list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Get a OpenSearchDomainStatus. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of OpenSearchDomainStatus. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a OpenSearchDomainStatus along with {@link Response}. + */ + Response getByResourceGroupWithResponse(String resourceGroupName, String name, + Context context); + + /** + * Get a OpenSearchDomainStatus. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of OpenSearchDomainStatus. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a OpenSearchDomainStatus. + */ + OpenSearchDomainStatus getByResourceGroup(String resourceGroupName, String name); + + /** + * Delete a OpenSearchDomainStatus. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of OpenSearchDomainStatus. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByResourceGroup(String resourceGroupName, String name); + + /** + * Delete a OpenSearchDomainStatus. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of OpenSearchDomainStatus. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String name, Context context); + + /** + * Get a OpenSearchDomainStatus. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a OpenSearchDomainStatus along with {@link Response}. + */ + OpenSearchDomainStatus getById(String id); + + /** + * Get a OpenSearchDomainStatus. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a OpenSearchDomainStatus along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Delete a OpenSearchDomainStatus. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteById(String id); + + /** + * Delete a OpenSearchDomainStatus. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new OpenSearchDomainStatus resource. + * + * @param name resource name. + * @return the first stage of the new OpenSearchDomainStatus definition. + */ + OpenSearchDomainStatus.DefinitionStages.Blank define(String name); +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/OpenSearchPartitionInstanceType.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/OpenSearchPartitionInstanceType.java new file mode 100644 index 000000000000..34c7775da113 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/OpenSearchPartitionInstanceType.java @@ -0,0 +1,558 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * OpenSearchPartitionInstanceType enum. + */ +public final class OpenSearchPartitionInstanceType extends ExpandableStringEnum { + /** + * Static value c4.2xlarge.search for OpenSearchPartitionInstanceType. + */ + public static final OpenSearchPartitionInstanceType C4_2XLARGE_SEARCH = fromString("c4.2xlarge.search"); + + /** + * Static value c4.4xlarge.search for OpenSearchPartitionInstanceType. + */ + public static final OpenSearchPartitionInstanceType C4_4XLARGE_SEARCH = fromString("c4.4xlarge.search"); + + /** + * Static value c4.8xlarge.search for OpenSearchPartitionInstanceType. + */ + public static final OpenSearchPartitionInstanceType C4_8XLARGE_SEARCH = fromString("c4.8xlarge.search"); + + /** + * Static value c4.large.search for OpenSearchPartitionInstanceType. + */ + public static final OpenSearchPartitionInstanceType C4_LARGE_SEARCH = fromString("c4.large.search"); + + /** + * Static value c4.xlarge.search for OpenSearchPartitionInstanceType. + */ + public static final OpenSearchPartitionInstanceType C4_XLARGE_SEARCH = fromString("c4.xlarge.search"); + + /** + * Static value c5.18xlarge.search for OpenSearchPartitionInstanceType. + */ + public static final OpenSearchPartitionInstanceType C5_18XLARGE_SEARCH = fromString("c5.18xlarge.search"); + + /** + * Static value c5.2xlarge.search for OpenSearchPartitionInstanceType. + */ + public static final OpenSearchPartitionInstanceType C5_2XLARGE_SEARCH = fromString("c5.2xlarge.search"); + + /** + * Static value c5.4xlarge.search for OpenSearchPartitionInstanceType. + */ + public static final OpenSearchPartitionInstanceType C5_4XLARGE_SEARCH = fromString("c5.4xlarge.search"); + + /** + * Static value c5.9xlarge.search for OpenSearchPartitionInstanceType. + */ + public static final OpenSearchPartitionInstanceType C5_9XLARGE_SEARCH = fromString("c5.9xlarge.search"); + + /** + * Static value c5.large.search for OpenSearchPartitionInstanceType. + */ + public static final OpenSearchPartitionInstanceType C5_LARGE_SEARCH = fromString("c5.large.search"); + + /** + * Static value c5.xlarge.search for OpenSearchPartitionInstanceType. + */ + public static final OpenSearchPartitionInstanceType C5_XLARGE_SEARCH = fromString("c5.xlarge.search"); + + /** + * Static value c6g.12xlarge.search for OpenSearchPartitionInstanceType. + */ + public static final OpenSearchPartitionInstanceType C6G_12XLARGE_SEARCH = fromString("c6g.12xlarge.search"); + + /** + * Static value c6g.2xlarge.search for OpenSearchPartitionInstanceType. + */ + public static final OpenSearchPartitionInstanceType C6G_2XLARGE_SEARCH = fromString("c6g.2xlarge.search"); + + /** + * Static value c6g.4xlarge.search for OpenSearchPartitionInstanceType. + */ + public static final OpenSearchPartitionInstanceType C6G_4XLARGE_SEARCH = fromString("c6g.4xlarge.search"); + + /** + * Static value c6g.8xlarge.search for OpenSearchPartitionInstanceType. + */ + public static final OpenSearchPartitionInstanceType C6G_8XLARGE_SEARCH = fromString("c6g.8xlarge.search"); + + /** + * Static value c6g.large.search for OpenSearchPartitionInstanceType. + */ + public static final OpenSearchPartitionInstanceType C6G_LARGE_SEARCH = fromString("c6g.large.search"); + + /** + * Static value c6g.xlarge.search for OpenSearchPartitionInstanceType. + */ + public static final OpenSearchPartitionInstanceType C6G_XLARGE_SEARCH = fromString("c6g.xlarge.search"); + + /** + * Static value d2.2xlarge.search for OpenSearchPartitionInstanceType. + */ + public static final OpenSearchPartitionInstanceType D2_2XLARGE_SEARCH = fromString("d2.2xlarge.search"); + + /** + * Static value d2.4xlarge.search for OpenSearchPartitionInstanceType. + */ + public static final OpenSearchPartitionInstanceType D2_4XLARGE_SEARCH = fromString("d2.4xlarge.search"); + + /** + * Static value d2.8xlarge.search for OpenSearchPartitionInstanceType. + */ + public static final OpenSearchPartitionInstanceType D2_8XLARGE_SEARCH = fromString("d2.8xlarge.search"); + + /** + * Static value d2.xlarge.search for OpenSearchPartitionInstanceType. + */ + public static final OpenSearchPartitionInstanceType D2_XLARGE_SEARCH = fromString("d2.xlarge.search"); + + /** + * Static value i2.2xlarge.search for OpenSearchPartitionInstanceType. + */ + public static final OpenSearchPartitionInstanceType I2_2XLARGE_SEARCH = fromString("i2.2xlarge.search"); + + /** + * Static value i2.xlarge.search for OpenSearchPartitionInstanceType. + */ + public static final OpenSearchPartitionInstanceType I2_XLARGE_SEARCH = fromString("i2.xlarge.search"); + + /** + * Static value i3.16xlarge.search for OpenSearchPartitionInstanceType. + */ + public static final OpenSearchPartitionInstanceType I3_16XLARGE_SEARCH = fromString("i3.16xlarge.search"); + + /** + * Static value i3.2xlarge.search for OpenSearchPartitionInstanceType. + */ + public static final OpenSearchPartitionInstanceType I3_2XLARGE_SEARCH = fromString("i3.2xlarge.search"); + + /** + * Static value i3.4xlarge.search for OpenSearchPartitionInstanceType. + */ + public static final OpenSearchPartitionInstanceType I3_4XLARGE_SEARCH = fromString("i3.4xlarge.search"); + + /** + * Static value i3.8xlarge.search for OpenSearchPartitionInstanceType. + */ + public static final OpenSearchPartitionInstanceType I3_8XLARGE_SEARCH = fromString("i3.8xlarge.search"); + + /** + * Static value i3.large.search for OpenSearchPartitionInstanceType. + */ + public static final OpenSearchPartitionInstanceType I3_LARGE_SEARCH = fromString("i3.large.search"); + + /** + * Static value i3.xlarge.search for OpenSearchPartitionInstanceType. + */ + public static final OpenSearchPartitionInstanceType I3_XLARGE_SEARCH = fromString("i3.xlarge.search"); + + /** + * Static value m3.2xlarge.search for OpenSearchPartitionInstanceType. + */ + public static final OpenSearchPartitionInstanceType M3_2XLARGE_SEARCH = fromString("m3.2xlarge.search"); + + /** + * Static value m3.large.search for OpenSearchPartitionInstanceType. + */ + public static final OpenSearchPartitionInstanceType M3_LARGE_SEARCH = fromString("m3.large.search"); + + /** + * Static value m3.medium.search for OpenSearchPartitionInstanceType. + */ + public static final OpenSearchPartitionInstanceType M3_MEDIUM_SEARCH = fromString("m3.medium.search"); + + /** + * Static value m3.xlarge.search for OpenSearchPartitionInstanceType. + */ + public static final OpenSearchPartitionInstanceType M3_XLARGE_SEARCH = fromString("m3.xlarge.search"); + + /** + * Static value m4.10xlarge.search for OpenSearchPartitionInstanceType. + */ + public static final OpenSearchPartitionInstanceType M4_10XLARGE_SEARCH = fromString("m4.10xlarge.search"); + + /** + * Static value m4.2xlarge.search for OpenSearchPartitionInstanceType. + */ + public static final OpenSearchPartitionInstanceType M4_2XLARGE_SEARCH = fromString("m4.2xlarge.search"); + + /** + * Static value m4.4xlarge.search for OpenSearchPartitionInstanceType. + */ + public static final OpenSearchPartitionInstanceType M4_4XLARGE_SEARCH = fromString("m4.4xlarge.search"); + + /** + * Static value m4.large.search for OpenSearchPartitionInstanceType. + */ + public static final OpenSearchPartitionInstanceType M4_LARGE_SEARCH = fromString("m4.large.search"); + + /** + * Static value m4.xlarge.search for OpenSearchPartitionInstanceType. + */ + public static final OpenSearchPartitionInstanceType M4_XLARGE_SEARCH = fromString("m4.xlarge.search"); + + /** + * Static value m5.12xlarge.search for OpenSearchPartitionInstanceType. + */ + public static final OpenSearchPartitionInstanceType M5_12XLARGE_SEARCH = fromString("m5.12xlarge.search"); + + /** + * Static value m5.24xlarge.search for OpenSearchPartitionInstanceType. + */ + public static final OpenSearchPartitionInstanceType M5_24XLARGE_SEARCH = fromString("m5.24xlarge.search"); + + /** + * Static value m5.2xlarge.search for OpenSearchPartitionInstanceType. + */ + public static final OpenSearchPartitionInstanceType M5_2XLARGE_SEARCH = fromString("m5.2xlarge.search"); + + /** + * Static value m5.4xlarge.search for OpenSearchPartitionInstanceType. + */ + public static final OpenSearchPartitionInstanceType M5_4XLARGE_SEARCH = fromString("m5.4xlarge.search"); + + /** + * Static value m5.large.search for OpenSearchPartitionInstanceType. + */ + public static final OpenSearchPartitionInstanceType M5_LARGE_SEARCH = fromString("m5.large.search"); + + /** + * Static value m5.xlarge.search for OpenSearchPartitionInstanceType. + */ + public static final OpenSearchPartitionInstanceType M5_XLARGE_SEARCH = fromString("m5.xlarge.search"); + + /** + * Static value m6g.12xlarge.search for OpenSearchPartitionInstanceType. + */ + public static final OpenSearchPartitionInstanceType M6G_12XLARGE_SEARCH = fromString("m6g.12xlarge.search"); + + /** + * Static value m6g.2xlarge.search for OpenSearchPartitionInstanceType. + */ + public static final OpenSearchPartitionInstanceType M6G_2XLARGE_SEARCH = fromString("m6g.2xlarge.search"); + + /** + * Static value m6g.4xlarge.search for OpenSearchPartitionInstanceType. + */ + public static final OpenSearchPartitionInstanceType M6G_4XLARGE_SEARCH = fromString("m6g.4xlarge.search"); + + /** + * Static value m6g.8xlarge.search for OpenSearchPartitionInstanceType. + */ + public static final OpenSearchPartitionInstanceType M6G_8XLARGE_SEARCH = fromString("m6g.8xlarge.search"); + + /** + * Static value m6g.large.search for OpenSearchPartitionInstanceType. + */ + public static final OpenSearchPartitionInstanceType M6G_LARGE_SEARCH = fromString("m6g.large.search"); + + /** + * Static value m6g.xlarge.search for OpenSearchPartitionInstanceType. + */ + public static final OpenSearchPartitionInstanceType M6G_XLARGE_SEARCH = fromString("m6g.xlarge.search"); + + /** + * Static value or1.12xlarge.search for OpenSearchPartitionInstanceType. + */ + public static final OpenSearchPartitionInstanceType OR1_12XLARGE_SEARCH = fromString("or1.12xlarge.search"); + + /** + * Static value or1.16xlarge.search for OpenSearchPartitionInstanceType. + */ + public static final OpenSearchPartitionInstanceType OR1_16XLARGE_SEARCH = fromString("or1.16xlarge.search"); + + /** + * Static value or1.2xlarge.search for OpenSearchPartitionInstanceType. + */ + public static final OpenSearchPartitionInstanceType OR1_2XLARGE_SEARCH = fromString("or1.2xlarge.search"); + + /** + * Static value or1.4xlarge.search for OpenSearchPartitionInstanceType. + */ + public static final OpenSearchPartitionInstanceType OR1_4XLARGE_SEARCH = fromString("or1.4xlarge.search"); + + /** + * Static value or1.8xlarge.search for OpenSearchPartitionInstanceType. + */ + public static final OpenSearchPartitionInstanceType OR1_8XLARGE_SEARCH = fromString("or1.8xlarge.search"); + + /** + * Static value or1.large.search for OpenSearchPartitionInstanceType. + */ + public static final OpenSearchPartitionInstanceType OR1_LARGE_SEARCH = fromString("or1.large.search"); + + /** + * Static value or1.medium.search for OpenSearchPartitionInstanceType. + */ + public static final OpenSearchPartitionInstanceType OR1_MEDIUM_SEARCH = fromString("or1.medium.search"); + + /** + * Static value or1.xlarge.search for OpenSearchPartitionInstanceType. + */ + public static final OpenSearchPartitionInstanceType OR1_XLARGE_SEARCH = fromString("or1.xlarge.search"); + + /** + * Static value r3.2xlarge.search for OpenSearchPartitionInstanceType. + */ + public static final OpenSearchPartitionInstanceType R3_2XLARGE_SEARCH = fromString("r3.2xlarge.search"); + + /** + * Static value r3.4xlarge.search for OpenSearchPartitionInstanceType. + */ + public static final OpenSearchPartitionInstanceType R3_4XLARGE_SEARCH = fromString("r3.4xlarge.search"); + + /** + * Static value r3.8xlarge.search for OpenSearchPartitionInstanceType. + */ + public static final OpenSearchPartitionInstanceType R3_8XLARGE_SEARCH = fromString("r3.8xlarge.search"); + + /** + * Static value r3.large.search for OpenSearchPartitionInstanceType. + */ + public static final OpenSearchPartitionInstanceType R3_LARGE_SEARCH = fromString("r3.large.search"); + + /** + * Static value r3.xlarge.search for OpenSearchPartitionInstanceType. + */ + public static final OpenSearchPartitionInstanceType R3_XLARGE_SEARCH = fromString("r3.xlarge.search"); + + /** + * Static value r4.16xlarge.search for OpenSearchPartitionInstanceType. + */ + public static final OpenSearchPartitionInstanceType R4_16XLARGE_SEARCH = fromString("r4.16xlarge.search"); + + /** + * Static value r4.2xlarge.search for OpenSearchPartitionInstanceType. + */ + public static final OpenSearchPartitionInstanceType R4_2XLARGE_SEARCH = fromString("r4.2xlarge.search"); + + /** + * Static value r4.4xlarge.search for OpenSearchPartitionInstanceType. + */ + public static final OpenSearchPartitionInstanceType R4_4XLARGE_SEARCH = fromString("r4.4xlarge.search"); + + /** + * Static value r4.8xlarge.search for OpenSearchPartitionInstanceType. + */ + public static final OpenSearchPartitionInstanceType R4_8XLARGE_SEARCH = fromString("r4.8xlarge.search"); + + /** + * Static value r4.large.search for OpenSearchPartitionInstanceType. + */ + public static final OpenSearchPartitionInstanceType R4_LARGE_SEARCH = fromString("r4.large.search"); + + /** + * Static value r4.xlarge.search for OpenSearchPartitionInstanceType. + */ + public static final OpenSearchPartitionInstanceType R4_XLARGE_SEARCH = fromString("r4.xlarge.search"); + + /** + * Static value r5.12xlarge.search for OpenSearchPartitionInstanceType. + */ + public static final OpenSearchPartitionInstanceType R5_12XLARGE_SEARCH = fromString("r5.12xlarge.search"); + + /** + * Static value r5.24xlarge.search for OpenSearchPartitionInstanceType. + */ + public static final OpenSearchPartitionInstanceType R5_24XLARGE_SEARCH = fromString("r5.24xlarge.search"); + + /** + * Static value r5.2xlarge.search for OpenSearchPartitionInstanceType. + */ + public static final OpenSearchPartitionInstanceType R5_2XLARGE_SEARCH = fromString("r5.2xlarge.search"); + + /** + * Static value r5.4xlarge.search for OpenSearchPartitionInstanceType. + */ + public static final OpenSearchPartitionInstanceType R5_4XLARGE_SEARCH = fromString("r5.4xlarge.search"); + + /** + * Static value r5.large.search for OpenSearchPartitionInstanceType. + */ + public static final OpenSearchPartitionInstanceType R5_LARGE_SEARCH = fromString("r5.large.search"); + + /** + * Static value r5.xlarge.search for OpenSearchPartitionInstanceType. + */ + public static final OpenSearchPartitionInstanceType R5_XLARGE_SEARCH = fromString("r5.xlarge.search"); + + /** + * Static value r6g.12xlarge.search for OpenSearchPartitionInstanceType. + */ + public static final OpenSearchPartitionInstanceType R6G_12XLARGE_SEARCH = fromString("r6g.12xlarge.search"); + + /** + * Static value r6g.2xlarge.search for OpenSearchPartitionInstanceType. + */ + public static final OpenSearchPartitionInstanceType R6G_2XLARGE_SEARCH = fromString("r6g.2xlarge.search"); + + /** + * Static value r6g.4xlarge.search for OpenSearchPartitionInstanceType. + */ + public static final OpenSearchPartitionInstanceType R6G_4XLARGE_SEARCH = fromString("r6g.4xlarge.search"); + + /** + * Static value r6g.8xlarge.search for OpenSearchPartitionInstanceType. + */ + public static final OpenSearchPartitionInstanceType R6G_8XLARGE_SEARCH = fromString("r6g.8xlarge.search"); + + /** + * Static value r6g.large.search for OpenSearchPartitionInstanceType. + */ + public static final OpenSearchPartitionInstanceType R6G_LARGE_SEARCH = fromString("r6g.large.search"); + + /** + * Static value r6g.xlarge.search for OpenSearchPartitionInstanceType. + */ + public static final OpenSearchPartitionInstanceType R6G_XLARGE_SEARCH = fromString("r6g.xlarge.search"); + + /** + * Static value r6gd.12xlarge.search for OpenSearchPartitionInstanceType. + */ + public static final OpenSearchPartitionInstanceType R6GD_12XLARGE_SEARCH = fromString("r6gd.12xlarge.search"); + + /** + * Static value r6gd.16xlarge.search for OpenSearchPartitionInstanceType. + */ + public static final OpenSearchPartitionInstanceType R6GD_16XLARGE_SEARCH = fromString("r6gd.16xlarge.search"); + + /** + * Static value r6gd.2xlarge.search for OpenSearchPartitionInstanceType. + */ + public static final OpenSearchPartitionInstanceType R6GD_2XLARGE_SEARCH = fromString("r6gd.2xlarge.search"); + + /** + * Static value r6gd.4xlarge.search for OpenSearchPartitionInstanceType. + */ + public static final OpenSearchPartitionInstanceType R6GD_4XLARGE_SEARCH = fromString("r6gd.4xlarge.search"); + + /** + * Static value r6gd.8xlarge.search for OpenSearchPartitionInstanceType. + */ + public static final OpenSearchPartitionInstanceType R6GD_8XLARGE_SEARCH = fromString("r6gd.8xlarge.search"); + + /** + * Static value r6gd.large.search for OpenSearchPartitionInstanceType. + */ + public static final OpenSearchPartitionInstanceType R6GD_LARGE_SEARCH = fromString("r6gd.large.search"); + + /** + * Static value r6gd.xlarge.search for OpenSearchPartitionInstanceType. + */ + public static final OpenSearchPartitionInstanceType R6GD_XLARGE_SEARCH = fromString("r6gd.xlarge.search"); + + /** + * Static value t2.medium.search for OpenSearchPartitionInstanceType. + */ + public static final OpenSearchPartitionInstanceType T2_MEDIUM_SEARCH = fromString("t2.medium.search"); + + /** + * Static value t2.micro.search for OpenSearchPartitionInstanceType. + */ + public static final OpenSearchPartitionInstanceType T2_MICRO_SEARCH = fromString("t2.micro.search"); + + /** + * Static value t2.small.search for OpenSearchPartitionInstanceType. + */ + public static final OpenSearchPartitionInstanceType T2_SMALL_SEARCH = fromString("t2.small.search"); + + /** + * Static value t3.2xlarge.search for OpenSearchPartitionInstanceType. + */ + public static final OpenSearchPartitionInstanceType T3_2XLARGE_SEARCH = fromString("t3.2xlarge.search"); + + /** + * Static value t3.large.search for OpenSearchPartitionInstanceType. + */ + public static final OpenSearchPartitionInstanceType T3_LARGE_SEARCH = fromString("t3.large.search"); + + /** + * Static value t3.medium.search for OpenSearchPartitionInstanceType. + */ + public static final OpenSearchPartitionInstanceType T3_MEDIUM_SEARCH = fromString("t3.medium.search"); + + /** + * Static value t3.micro.search for OpenSearchPartitionInstanceType. + */ + public static final OpenSearchPartitionInstanceType T3_MICRO_SEARCH = fromString("t3.micro.search"); + + /** + * Static value t3.nano.search for OpenSearchPartitionInstanceType. + */ + public static final OpenSearchPartitionInstanceType T3_NANO_SEARCH = fromString("t3.nano.search"); + + /** + * Static value t3.small.search for OpenSearchPartitionInstanceType. + */ + public static final OpenSearchPartitionInstanceType T3_SMALL_SEARCH = fromString("t3.small.search"); + + /** + * Static value t3.xlarge.search for OpenSearchPartitionInstanceType. + */ + public static final OpenSearchPartitionInstanceType T3_XLARGE_SEARCH = fromString("t3.xlarge.search"); + + /** + * Static value t4g.medium.search for OpenSearchPartitionInstanceType. + */ + public static final OpenSearchPartitionInstanceType T4G_MEDIUM_SEARCH = fromString("t4g.medium.search"); + + /** + * Static value t4g.small.search for OpenSearchPartitionInstanceType. + */ + public static final OpenSearchPartitionInstanceType T4G_SMALL_SEARCH = fromString("t4g.small.search"); + + /** + * Static value ultrawarm1.large.search for OpenSearchPartitionInstanceType. + */ + public static final OpenSearchPartitionInstanceType ULTRAWARM1_LARGE_SEARCH = fromString("ultrawarm1.large.search"); + + /** + * Static value ultrawarm1.medium.search for OpenSearchPartitionInstanceType. + */ + public static final OpenSearchPartitionInstanceType ULTRAWARM1_MEDIUM_SEARCH + = fromString("ultrawarm1.medium.search"); + + /** + * Static value ultrawarm1.xlarge.search for OpenSearchPartitionInstanceType. + */ + public static final OpenSearchPartitionInstanceType ULTRAWARM1_XLARGE_SEARCH + = fromString("ultrawarm1.xlarge.search"); + + /** + * Creates a new instance of OpenSearchPartitionInstanceType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public OpenSearchPartitionInstanceType() { + } + + /** + * Creates or finds a OpenSearchPartitionInstanceType from its string representation. + * + * @param name a name to look for. + * @return the corresponding OpenSearchPartitionInstanceType. + */ + public static OpenSearchPartitionInstanceType fromString(String name) { + return fromString(name, OpenSearchPartitionInstanceType.class); + } + + /** + * Gets known OpenSearchPartitionInstanceType values. + * + * @return known OpenSearchPartitionInstanceType values. + */ + public static Collection values() { + return values(OpenSearchPartitionInstanceType.class); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/OpenSearchPartitionInstanceTypeEnumValue.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/OpenSearchPartitionInstanceTypeEnumValue.java new file mode 100644 index 000000000000..c57c98025f3d --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/OpenSearchPartitionInstanceTypeEnumValue.java @@ -0,0 +1,96 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of OpenSearchPartitionInstanceTypeEnumValue. + */ +@Fluent +public final class OpenSearchPartitionInstanceTypeEnumValue + implements JsonSerializable { + /* + * Property value + */ + private OpenSearchPartitionInstanceType value; + + /** + * Creates an instance of OpenSearchPartitionInstanceTypeEnumValue class. + */ + public OpenSearchPartitionInstanceTypeEnumValue() { + } + + /** + * Get the value property: Property value. + * + * @return the value value. + */ + public OpenSearchPartitionInstanceType value() { + return this.value; + } + + /** + * Set the value property: Property value. + * + * @param value the value value to set. + * @return the OpenSearchPartitionInstanceTypeEnumValue object itself. + */ + public OpenSearchPartitionInstanceTypeEnumValue withValue(OpenSearchPartitionInstanceType value) { + this.value = value; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("value", this.value == null ? null : this.value.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of OpenSearchPartitionInstanceTypeEnumValue from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of OpenSearchPartitionInstanceTypeEnumValue if the JsonReader was pointing to an instance of + * it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the OpenSearchPartitionInstanceTypeEnumValue. + */ + public static OpenSearchPartitionInstanceTypeEnumValue fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + OpenSearchPartitionInstanceTypeEnumValue deserializedOpenSearchPartitionInstanceTypeEnumValue + = new OpenSearchPartitionInstanceTypeEnumValue(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + deserializedOpenSearchPartitionInstanceTypeEnumValue.value + = OpenSearchPartitionInstanceType.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedOpenSearchPartitionInstanceTypeEnumValue; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/OpenSearchWarmPartitionInstanceType.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/OpenSearchWarmPartitionInstanceType.java new file mode 100644 index 000000000000..099c606325f1 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/OpenSearchWarmPartitionInstanceType.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.awsconnector.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * OpenSearchWarmPartitionInstanceType enum. + */ +public final class OpenSearchWarmPartitionInstanceType + extends ExpandableStringEnum { + /** + * Static value ultrawarm1.large.search for OpenSearchWarmPartitionInstanceType. + */ + public static final OpenSearchWarmPartitionInstanceType ULTRAWARM1_LARGE_SEARCH + = fromString("ultrawarm1.large.search"); + + /** + * Static value ultrawarm1.medium.search for OpenSearchWarmPartitionInstanceType. + */ + public static final OpenSearchWarmPartitionInstanceType ULTRAWARM1_MEDIUM_SEARCH + = fromString("ultrawarm1.medium.search"); + + /** + * Static value ultrawarm1.xlarge.search for OpenSearchWarmPartitionInstanceType. + */ + public static final OpenSearchWarmPartitionInstanceType ULTRAWARM1_XLARGE_SEARCH + = fromString("ultrawarm1.xlarge.search"); + + /** + * Creates a new instance of OpenSearchWarmPartitionInstanceType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public OpenSearchWarmPartitionInstanceType() { + } + + /** + * Creates or finds a OpenSearchWarmPartitionInstanceType from its string representation. + * + * @param name a name to look for. + * @return the corresponding OpenSearchWarmPartitionInstanceType. + */ + public static OpenSearchWarmPartitionInstanceType fromString(String name) { + return fromString(name, OpenSearchWarmPartitionInstanceType.class); + } + + /** + * Gets known OpenSearchWarmPartitionInstanceType values. + * + * @return known OpenSearchWarmPartitionInstanceType values. + */ + public static Collection values() { + return values(OpenSearchWarmPartitionInstanceType.class); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/OpenSearchWarmPartitionInstanceTypeEnumValue.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/OpenSearchWarmPartitionInstanceTypeEnumValue.java new file mode 100644 index 000000000000..42d509360e8d --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/OpenSearchWarmPartitionInstanceTypeEnumValue.java @@ -0,0 +1,96 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of OpenSearchWarmPartitionInstanceTypeEnumValue. + */ +@Fluent +public final class OpenSearchWarmPartitionInstanceTypeEnumValue + implements JsonSerializable { + /* + * Property value + */ + private OpenSearchWarmPartitionInstanceType value; + + /** + * Creates an instance of OpenSearchWarmPartitionInstanceTypeEnumValue class. + */ + public OpenSearchWarmPartitionInstanceTypeEnumValue() { + } + + /** + * Get the value property: Property value. + * + * @return the value value. + */ + public OpenSearchWarmPartitionInstanceType value() { + return this.value; + } + + /** + * Set the value property: Property value. + * + * @param value the value value to set. + * @return the OpenSearchWarmPartitionInstanceTypeEnumValue object itself. + */ + public OpenSearchWarmPartitionInstanceTypeEnumValue withValue(OpenSearchWarmPartitionInstanceType value) { + this.value = value; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("value", this.value == null ? null : this.value.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of OpenSearchWarmPartitionInstanceTypeEnumValue from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of OpenSearchWarmPartitionInstanceTypeEnumValue if the JsonReader was pointing to an instance + * of it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the OpenSearchWarmPartitionInstanceTypeEnumValue. + */ + public static OpenSearchWarmPartitionInstanceTypeEnumValue fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + OpenSearchWarmPartitionInstanceTypeEnumValue deserializedOpenSearchWarmPartitionInstanceTypeEnumValue + = new OpenSearchWarmPartitionInstanceTypeEnumValue(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + deserializedOpenSearchWarmPartitionInstanceTypeEnumValue.value + = OpenSearchWarmPartitionInstanceType.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedOpenSearchWarmPartitionInstanceTypeEnumValue; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/Operation.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/Operation.java new file mode 100644 index 000000000000..612391a079f2 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/Operation.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.awsconnector.models; + +import com.azure.resourcemanager.awsconnector.fluent.models.OperationInner; + +/** + * An immutable client-side representation of Operation. + */ +public interface Operation { + /** + * Gets the name property: The name of the operation, as per Resource-Based Access Control (RBAC). Examples: + * "Microsoft.Compute/virtualMachines/write", "Microsoft.Compute/virtualMachines/capture/action". + * + * @return the name value. + */ + String name(); + + /** + * Gets the isDataAction property: Whether the operation applies to data-plane. This is "true" for data-plane + * operations and "false" for ARM/control-plane operations. + * + * @return the isDataAction value. + */ + Boolean isDataAction(); + + /** + * Gets the display property: Localized display information for this particular operation. + * + * @return the display value. + */ + OperationDisplay display(); + + /** + * Gets the origin property: The intended executor of the operation; as in Resource Based Access Control (RBAC) and + * audit logs UX. Default value is "user,system". + * + * @return the origin value. + */ + Origin origin(); + + /** + * Gets the actionType property: Enum. Indicates the action type. "Internal" refers to actions that are for internal + * only APIs. + * + * @return the actionType value. + */ + ActionType actionType(); + + /** + * Gets the inner com.azure.resourcemanager.awsconnector.fluent.models.OperationInner object. + * + * @return the inner object. + */ + OperationInner innerModel(); +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/OperationDisplay.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/OperationDisplay.java new file mode 100644 index 000000000000..e5f0490ea77a --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/OperationDisplay.java @@ -0,0 +1,136 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Localized display information for this particular operation. + */ +@Immutable +public final class OperationDisplay implements JsonSerializable { + /* + * The localized friendly form of the resource provider name, e.g. "Microsoft Monitoring Insights" or + * "Microsoft Compute". + */ + private String provider; + + /* + * The localized friendly name of the resource type related to this operation. E.g. "Virtual Machines" or + * "Job Schedule Collections". + */ + private String resource; + + /* + * The concise, localized friendly name for the operation; suitable for dropdowns. E.g. + * "Create or Update Virtual Machine", "Restart Virtual Machine". + */ + private String operation; + + /* + * The short, localized friendly description of the operation; suitable for tool tips and detailed views. + */ + private String description; + + /** + * Creates an instance of OperationDisplay class. + */ + public OperationDisplay() { + } + + /** + * Get the provider property: The localized friendly form of the resource provider name, e.g. "Microsoft Monitoring + * Insights" or "Microsoft Compute". + * + * @return the provider value. + */ + public String provider() { + return this.provider; + } + + /** + * Get the resource property: The localized friendly name of the resource type related to this operation. E.g. + * "Virtual Machines" or "Job Schedule Collections". + * + * @return the resource value. + */ + public String resource() { + return this.resource; + } + + /** + * Get the operation property: The concise, localized friendly name for the operation; suitable for dropdowns. E.g. + * "Create or Update Virtual Machine", "Restart Virtual Machine". + * + * @return the operation value. + */ + public String operation() { + return this.operation; + } + + /** + * Get the description property: The short, localized friendly description of the operation; suitable for tool tips + * and detailed views. + * + * @return the description value. + */ + public String description() { + return this.description; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of OperationDisplay from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of OperationDisplay if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the OperationDisplay. + */ + public static OperationDisplay fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + OperationDisplay deserializedOperationDisplay = new OperationDisplay(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("provider".equals(fieldName)) { + deserializedOperationDisplay.provider = reader.getString(); + } else if ("resource".equals(fieldName)) { + deserializedOperationDisplay.resource = reader.getString(); + } else if ("operation".equals(fieldName)) { + deserializedOperationDisplay.operation = reader.getString(); + } else if ("description".equals(fieldName)) { + deserializedOperationDisplay.description = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedOperationDisplay; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/OperationLevelMetricsConfig.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/OperationLevelMetricsConfig.java new file mode 100644 index 000000000000..3e3abe6af109 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/OperationLevelMetricsConfig.java @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * OperationLevelMetricsConfig enum. + */ +public final class OperationLevelMetricsConfig extends ExpandableStringEnum { + /** + * Static value DISABLED for OperationLevelMetricsConfig. + */ + public static final OperationLevelMetricsConfig DISABLED = fromString("DISABLED"); + + /** + * Static value ENABLED for OperationLevelMetricsConfig. + */ + public static final OperationLevelMetricsConfig ENABLED = fromString("ENABLED"); + + /** + * Creates a new instance of OperationLevelMetricsConfig value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public OperationLevelMetricsConfig() { + } + + /** + * Creates or finds a OperationLevelMetricsConfig from its string representation. + * + * @param name a name to look for. + * @return the corresponding OperationLevelMetricsConfig. + */ + public static OperationLevelMetricsConfig fromString(String name) { + return fromString(name, OperationLevelMetricsConfig.class); + } + + /** + * Gets known OperationLevelMetricsConfig values. + * + * @return known OperationLevelMetricsConfig values. + */ + public static Collection values() { + return values(OperationLevelMetricsConfig.class); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/OperationLevelMetricsConfigEnumValue.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/OperationLevelMetricsConfigEnumValue.java new file mode 100644 index 000000000000..95808afa0ae8 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/OperationLevelMetricsConfigEnumValue.java @@ -0,0 +1,96 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of OperationLevelMetricsConfigEnumValue. + */ +@Fluent +public final class OperationLevelMetricsConfigEnumValue + implements JsonSerializable { + /* + * Property value + */ + private OperationLevelMetricsConfig value; + + /** + * Creates an instance of OperationLevelMetricsConfigEnumValue class. + */ + public OperationLevelMetricsConfigEnumValue() { + } + + /** + * Get the value property: Property value. + * + * @return the value value. + */ + public OperationLevelMetricsConfig value() { + return this.value; + } + + /** + * Set the value property: Property value. + * + * @param value the value value to set. + * @return the OperationLevelMetricsConfigEnumValue object itself. + */ + public OperationLevelMetricsConfigEnumValue withValue(OperationLevelMetricsConfig value) { + this.value = value; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("value", this.value == null ? null : this.value.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of OperationLevelMetricsConfigEnumValue from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of OperationLevelMetricsConfigEnumValue if the JsonReader was pointing to an instance of it, + * or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the OperationLevelMetricsConfigEnumValue. + */ + public static OperationLevelMetricsConfigEnumValue fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + OperationLevelMetricsConfigEnumValue deserializedOperationLevelMetricsConfigEnumValue + = new OperationLevelMetricsConfigEnumValue(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + deserializedOperationLevelMetricsConfigEnumValue.value + = OperationLevelMetricsConfig.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedOperationLevelMetricsConfigEnumValue; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/OperationListResult.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/OperationListResult.java new file mode 100644 index 000000000000..598fed0cdbaa --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/OperationListResult.java @@ -0,0 +1,104 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.awsconnector.fluent.models.OperationInner; +import java.io.IOException; +import java.util.List; + +/** + * A list of REST API operations supported by an Azure Resource Provider. It contains an URL link to get the next set of + * results. + */ +@Immutable +public final class OperationListResult implements JsonSerializable { + /* + * List of operations supported by the resource provider + */ + private List value; + + /* + * URL to get the next set of operation list results (if there are any). + */ + private String nextLink; + + /** + * Creates an instance of OperationListResult class. + */ + public OperationListResult() { + } + + /** + * Get the value property: List of operations supported by the resource provider. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Get the nextLink property: URL to get the next set of operation list results (if there are any). + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of OperationListResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of OperationListResult if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the OperationListResult. + */ + public static OperationListResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + OperationListResult deserializedOperationListResult = new OperationListResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value = reader.readArray(reader1 -> OperationInner.fromJson(reader1)); + deserializedOperationListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedOperationListResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedOperationListResult; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/OperationPreferences.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/OperationPreferences.java new file mode 100644 index 000000000000..fd937b4f2319 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/OperationPreferences.java @@ -0,0 +1,241 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Definition of OperationPreferences. + */ +@Fluent +public final class OperationPreferences implements JsonSerializable { + /* + * Property failureToleranceCount + */ + private Integer failureToleranceCount; + + /* + * Property failureTolerancePercentage + */ + private Integer failureTolerancePercentage; + + /* + * Property maxConcurrentCount + */ + private Integer maxConcurrentCount; + + /* + * Property maxConcurrentPercentage + */ + private Integer maxConcurrentPercentage; + + /* + * The concurrency type of deploying StackSets operations in regions, could be in parallel or one region at a time + */ + private OperationPreferencesRegionConcurrencyType regionConcurrencyType; + + /* + * Property regionOrder + */ + private List regionOrder; + + /** + * Creates an instance of OperationPreferences class. + */ + public OperationPreferences() { + } + + /** + * Get the failureToleranceCount property: Property failureToleranceCount. + * + * @return the failureToleranceCount value. + */ + public Integer failureToleranceCount() { + return this.failureToleranceCount; + } + + /** + * Set the failureToleranceCount property: Property failureToleranceCount. + * + * @param failureToleranceCount the failureToleranceCount value to set. + * @return the OperationPreferences object itself. + */ + public OperationPreferences withFailureToleranceCount(Integer failureToleranceCount) { + this.failureToleranceCount = failureToleranceCount; + return this; + } + + /** + * Get the failureTolerancePercentage property: Property failureTolerancePercentage. + * + * @return the failureTolerancePercentage value. + */ + public Integer failureTolerancePercentage() { + return this.failureTolerancePercentage; + } + + /** + * Set the failureTolerancePercentage property: Property failureTolerancePercentage. + * + * @param failureTolerancePercentage the failureTolerancePercentage value to set. + * @return the OperationPreferences object itself. + */ + public OperationPreferences withFailureTolerancePercentage(Integer failureTolerancePercentage) { + this.failureTolerancePercentage = failureTolerancePercentage; + return this; + } + + /** + * Get the maxConcurrentCount property: Property maxConcurrentCount. + * + * @return the maxConcurrentCount value. + */ + public Integer maxConcurrentCount() { + return this.maxConcurrentCount; + } + + /** + * Set the maxConcurrentCount property: Property maxConcurrentCount. + * + * @param maxConcurrentCount the maxConcurrentCount value to set. + * @return the OperationPreferences object itself. + */ + public OperationPreferences withMaxConcurrentCount(Integer maxConcurrentCount) { + this.maxConcurrentCount = maxConcurrentCount; + return this; + } + + /** + * Get the maxConcurrentPercentage property: Property maxConcurrentPercentage. + * + * @return the maxConcurrentPercentage value. + */ + public Integer maxConcurrentPercentage() { + return this.maxConcurrentPercentage; + } + + /** + * Set the maxConcurrentPercentage property: Property maxConcurrentPercentage. + * + * @param maxConcurrentPercentage the maxConcurrentPercentage value to set. + * @return the OperationPreferences object itself. + */ + public OperationPreferences withMaxConcurrentPercentage(Integer maxConcurrentPercentage) { + this.maxConcurrentPercentage = maxConcurrentPercentage; + return this; + } + + /** + * Get the regionConcurrencyType property: The concurrency type of deploying StackSets operations in regions, could + * be in parallel or one region at a time. + * + * @return the regionConcurrencyType value. + */ + public OperationPreferencesRegionConcurrencyType regionConcurrencyType() { + return this.regionConcurrencyType; + } + + /** + * Set the regionConcurrencyType property: The concurrency type of deploying StackSets operations in regions, could + * be in parallel or one region at a time. + * + * @param regionConcurrencyType the regionConcurrencyType value to set. + * @return the OperationPreferences object itself. + */ + public OperationPreferences + withRegionConcurrencyType(OperationPreferencesRegionConcurrencyType regionConcurrencyType) { + this.regionConcurrencyType = regionConcurrencyType; + return this; + } + + /** + * Get the regionOrder property: Property regionOrder. + * + * @return the regionOrder value. + */ + public List regionOrder() { + return this.regionOrder; + } + + /** + * Set the regionOrder property: Property regionOrder. + * + * @param regionOrder the regionOrder value to set. + * @return the OperationPreferences object itself. + */ + public OperationPreferences withRegionOrder(List regionOrder) { + this.regionOrder = regionOrder; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeNumberField("failureToleranceCount", this.failureToleranceCount); + jsonWriter.writeNumberField("failureTolerancePercentage", this.failureTolerancePercentage); + jsonWriter.writeNumberField("maxConcurrentCount", this.maxConcurrentCount); + jsonWriter.writeNumberField("maxConcurrentPercentage", this.maxConcurrentPercentage); + jsonWriter.writeStringField("regionConcurrencyType", + this.regionConcurrencyType == null ? null : this.regionConcurrencyType.toString()); + jsonWriter.writeArrayField("regionOrder", this.regionOrder, (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of OperationPreferences from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of OperationPreferences if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the OperationPreferences. + */ + public static OperationPreferences fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + OperationPreferences deserializedOperationPreferences = new OperationPreferences(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("failureToleranceCount".equals(fieldName)) { + deserializedOperationPreferences.failureToleranceCount = reader.getNullable(JsonReader::getInt); + } else if ("failureTolerancePercentage".equals(fieldName)) { + deserializedOperationPreferences.failureTolerancePercentage + = reader.getNullable(JsonReader::getInt); + } else if ("maxConcurrentCount".equals(fieldName)) { + deserializedOperationPreferences.maxConcurrentCount = reader.getNullable(JsonReader::getInt); + } else if ("maxConcurrentPercentage".equals(fieldName)) { + deserializedOperationPreferences.maxConcurrentPercentage = reader.getNullable(JsonReader::getInt); + } else if ("regionConcurrencyType".equals(fieldName)) { + deserializedOperationPreferences.regionConcurrencyType + = OperationPreferencesRegionConcurrencyType.fromString(reader.getString()); + } else if ("regionOrder".equals(fieldName)) { + List regionOrder = reader.readArray(reader1 -> reader1.getString()); + deserializedOperationPreferences.regionOrder = regionOrder; + } else { + reader.skipChildren(); + } + } + + return deserializedOperationPreferences; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/OperationPreferencesRegionConcurrencyType.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/OperationPreferencesRegionConcurrencyType.java new file mode 100644 index 000000000000..929209deb173 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/OperationPreferencesRegionConcurrencyType.java @@ -0,0 +1,52 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * OperationPreferencesRegionConcurrencyType enum. + */ +public final class OperationPreferencesRegionConcurrencyType + extends ExpandableStringEnum { + /** + * Static value PARALLEL for OperationPreferencesRegionConcurrencyType. + */ + public static final OperationPreferencesRegionConcurrencyType PARALLEL = fromString("PARALLEL"); + + /** + * Static value SEQUENTIAL for OperationPreferencesRegionConcurrencyType. + */ + public static final OperationPreferencesRegionConcurrencyType SEQUENTIAL = fromString("SEQUENTIAL"); + + /** + * Creates a new instance of OperationPreferencesRegionConcurrencyType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public OperationPreferencesRegionConcurrencyType() { + } + + /** + * Creates or finds a OperationPreferencesRegionConcurrencyType from its string representation. + * + * @param name a name to look for. + * @return the corresponding OperationPreferencesRegionConcurrencyType. + */ + public static OperationPreferencesRegionConcurrencyType fromString(String name) { + return fromString(name, OperationPreferencesRegionConcurrencyType.class); + } + + /** + * Gets known OperationPreferencesRegionConcurrencyType values. + * + * @return known OperationPreferencesRegionConcurrencyType values. + */ + public static Collection values() { + return values(OperationPreferencesRegionConcurrencyType.class); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/OperationStatusResult.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/OperationStatusResult.java new file mode 100644 index 000000000000..ca82f91074d7 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/OperationStatusResult.java @@ -0,0 +1,86 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.management.exception.ManagementError; +import com.azure.resourcemanager.awsconnector.fluent.models.OperationStatusResultInner; +import java.time.OffsetDateTime; +import java.util.List; + +/** + * An immutable client-side representation of OperationStatusResult. + */ +public interface OperationStatusResult { + /** + * Gets the id property: Fully qualified ID for the async operation. + * + * @return the id value. + */ + String id(); + + /** + * Gets the resourceId property: Fully qualified ID of the resource against which the original async operation was + * started. + * + * @return the resourceId value. + */ + String resourceId(); + + /** + * Gets the name property: Name of the async operation. + * + * @return the name value. + */ + String name(); + + /** + * Gets the status property: Operation status. + * + * @return the status value. + */ + String status(); + + /** + * Gets the percentComplete property: Percent of the operation that is complete. + * + * @return the percentComplete value. + */ + Float percentComplete(); + + /** + * Gets the startTime property: The start time of the operation. + * + * @return the startTime value. + */ + OffsetDateTime startTime(); + + /** + * Gets the endTime property: The end time of the operation. + * + * @return the endTime value. + */ + OffsetDateTime endTime(); + + /** + * Gets the operations property: The operations list. + * + * @return the operations value. + */ + List operations(); + + /** + * Gets the error property: If present, details of the operation error. + * + * @return the error value. + */ + ManagementError error(); + + /** + * Gets the inner com.azure.resourcemanager.awsconnector.fluent.models.OperationStatusResultInner object. + * + * @return the inner object. + */ + OperationStatusResultInner innerModel(); +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/Operations.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/Operations.java new file mode 100644 index 000000000000..ad9a0070add3 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/Operations.java @@ -0,0 +1,35 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; + +/** + * Resource collection API of Operations. + */ +public interface Operations { + /** + * List the operations for the provider. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of REST API operations supported by an Azure Resource Provider as paginated response with + * {@link PagedIterable}. + */ + PagedIterable list(); + + /** + * List the operations for the provider. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of REST API operations supported by an Azure Resource Provider as paginated response with + * {@link PagedIterable}. + */ + PagedIterable list(Context context); +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/OptionSetting.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/OptionSetting.java new file mode 100644 index 000000000000..f418b5aa12c4 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/OptionSetting.java @@ -0,0 +1,179 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of OptionSetting. + */ +@Fluent +public final class OptionSetting implements JsonSerializable { + /* + * A unique namespace that identifies the option's associated AWS resource. + */ + private String namespace; + + /* + * The name of the configuration option. + */ + private String optionName; + + /* + * A unique resource name for the option setting. Use it for a time–based scaling configuration option. + */ + private String resourceName; + + /* + * The current value for the configuration option. + */ + private String value; + + /** + * Creates an instance of OptionSetting class. + */ + public OptionSetting() { + } + + /** + * Get the namespace property: A unique namespace that identifies the option's associated AWS resource. + * + * @return the namespace value. + */ + public String namespace() { + return this.namespace; + } + + /** + * Set the namespace property: A unique namespace that identifies the option's associated AWS resource. + * + * @param namespace the namespace value to set. + * @return the OptionSetting object itself. + */ + public OptionSetting withNamespace(String namespace) { + this.namespace = namespace; + return this; + } + + /** + * Get the optionName property: The name of the configuration option. + * + * @return the optionName value. + */ + public String optionName() { + return this.optionName; + } + + /** + * Set the optionName property: The name of the configuration option. + * + * @param optionName the optionName value to set. + * @return the OptionSetting object itself. + */ + public OptionSetting withOptionName(String optionName) { + this.optionName = optionName; + return this; + } + + /** + * Get the resourceName property: A unique resource name for the option setting. Use it for a time–based scaling + * configuration option. + * + * @return the resourceName value. + */ + public String resourceName() { + return this.resourceName; + } + + /** + * Set the resourceName property: A unique resource name for the option setting. Use it for a time–based scaling + * configuration option. + * + * @param resourceName the resourceName value to set. + * @return the OptionSetting object itself. + */ + public OptionSetting withResourceName(String resourceName) { + this.resourceName = resourceName; + return this; + } + + /** + * Get the value property: The current value for the configuration option. + * + * @return the value value. + */ + public String value() { + return this.value; + } + + /** + * Set the value property: The current value for the configuration option. + * + * @param value the value value to set. + * @return the OptionSetting object itself. + */ + public OptionSetting withValue(String value) { + this.value = value; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("namespace", this.namespace); + jsonWriter.writeStringField("optionName", this.optionName); + jsonWriter.writeStringField("resourceName", this.resourceName); + jsonWriter.writeStringField("value", this.value); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of OptionSetting from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of OptionSetting if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the OptionSetting. + */ + public static OptionSetting fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + OptionSetting deserializedOptionSetting = new OptionSetting(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("namespace".equals(fieldName)) { + deserializedOptionSetting.namespace = reader.getString(); + } else if ("optionName".equals(fieldName)) { + deserializedOptionSetting.optionName = reader.getString(); + } else if ("resourceName".equals(fieldName)) { + deserializedOptionSetting.resourceName = reader.getString(); + } else if ("value".equals(fieldName)) { + deserializedOptionSetting.value = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedOptionSetting; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/OrganizationsAccount.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/OrganizationsAccount.java new file mode 100644 index 000000000000..f6dd78e01cc2 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/OrganizationsAccount.java @@ -0,0 +1,252 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.awsconnector.fluent.models.OrganizationsAccountInner; +import java.util.Map; + +/** + * An immutable client-side representation of OrganizationsAccount. + */ +public interface OrganizationsAccount { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the location property: The geo-location where the resource lives. + * + * @return the location value. + */ + String location(); + + /** + * Gets the tags property: Resource tags. + * + * @return the tags value. + */ + Map tags(); + + /** + * Gets the properties property: The resource-specific properties for this resource. + * + * @return the properties value. + */ + OrganizationsAccountProperties properties(); + + /** + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the region of the resource. + * + * @return the region of the resource. + */ + Region region(); + + /** + * Gets the name of the resource region. + * + * @return the name of the resource region. + */ + String regionName(); + + /** + * Gets the name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + + /** + * Gets the inner com.azure.resourcemanager.awsconnector.fluent.models.OrganizationsAccountInner object. + * + * @return the inner object. + */ + OrganizationsAccountInner innerModel(); + + /** + * The entirety of the OrganizationsAccount definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithLocation, + DefinitionStages.WithResourceGroup, DefinitionStages.WithCreate { + } + + /** + * The OrganizationsAccount definition stages. + */ + interface DefinitionStages { + /** + * The first stage of the OrganizationsAccount definition. + */ + interface Blank extends WithLocation { + } + + /** + * The stage of the OrganizationsAccount definition allowing to specify location. + */ + interface WithLocation { + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithResourceGroup withRegion(Region location); + + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithResourceGroup withRegion(String location); + } + + /** + * The stage of the OrganizationsAccount definition allowing to specify parent resource. + */ + interface WithResourceGroup { + /** + * Specifies resourceGroupName. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @return the next definition stage. + */ + WithCreate withExistingResourceGroup(String resourceGroupName); + } + + /** + * The stage of the OrganizationsAccount 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.WithProperties { + /** + * Executes the create request. + * + * @return the created resource. + */ + OrganizationsAccount create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + OrganizationsAccount create(Context context); + } + + /** + * The stage of the OrganizationsAccount definition allowing to specify tags. + */ + interface WithTags { + /** + * Specifies the tags property: Resource tags.. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + WithCreate withTags(Map tags); + } + + /** + * The stage of the OrganizationsAccount definition allowing to specify properties. + */ + interface WithProperties { + /** + * Specifies the properties property: The resource-specific properties for this resource.. + * + * @param properties The resource-specific properties for this resource. + * @return the next definition stage. + */ + WithCreate withProperties(OrganizationsAccountProperties properties); + } + } + + /** + * Begins update for the OrganizationsAccount resource. + * + * @return the stage of resource update. + */ + OrganizationsAccount.Update update(); + + /** + * The template for OrganizationsAccount update. + */ + interface Update extends UpdateStages.WithTags { + /** + * Executes the update request. + * + * @return the updated resource. + */ + OrganizationsAccount apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + OrganizationsAccount apply(Context context); + } + + /** + * The OrganizationsAccount update stages. + */ + interface UpdateStages { + /** + * The stage of the OrganizationsAccount update allowing to specify tags. + */ + interface WithTags { + /** + * Specifies the tags property: Resource tags.. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + Update withTags(Map tags); + } + } + + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + OrganizationsAccount refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + OrganizationsAccount refresh(Context context); +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/OrganizationsAccountListResult.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/OrganizationsAccountListResult.java new file mode 100644 index 000000000000..da64d00d7473 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/OrganizationsAccountListResult.java @@ -0,0 +1,137 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.awsconnector.fluent.models.OrganizationsAccountInner; +import java.io.IOException; +import java.util.List; + +/** + * The response of a OrganizationsAccount list operation. + */ +@Fluent +public final class OrganizationsAccountListResult implements JsonSerializable { + /* + * The OrganizationsAccount items on this page + */ + private List value; + + /* + * The link to the next page of items + */ + private String nextLink; + + /** + * Creates an instance of OrganizationsAccountListResult class. + */ + public OrganizationsAccountListResult() { + } + + /** + * Get the value property: The OrganizationsAccount items on this page. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The OrganizationsAccount items on this page. + * + * @param value the value value to set. + * @return the OrganizationsAccountListResult object itself. + */ + public OrganizationsAccountListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The link to the next page of items. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: The link to the next page of items. + * + * @param nextLink the nextLink value to set. + * @return the OrganizationsAccountListResult object itself. + */ + public OrganizationsAccountListResult withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property value in model OrganizationsAccountListResult")); + } else { + value().forEach(e -> e.validate()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(OrganizationsAccountListResult.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("nextLink", this.nextLink); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of OrganizationsAccountListResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of OrganizationsAccountListResult if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the OrganizationsAccountListResult. + */ + public static OrganizationsAccountListResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + OrganizationsAccountListResult deserializedOrganizationsAccountListResult + = new OrganizationsAccountListResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> OrganizationsAccountInner.fromJson(reader1)); + deserializedOrganizationsAccountListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedOrganizationsAccountListResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedOrganizationsAccountListResult; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/OrganizationsAccountProperties.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/OrganizationsAccountProperties.java new file mode 100644 index 000000000000..1a7c902162c5 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/OrganizationsAccountProperties.java @@ -0,0 +1,313 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.Map; + +/** + * Definition of OrganizationsAccount. + */ +@Fluent +public final class OrganizationsAccountProperties implements JsonSerializable { + /* + * AWS Properties + */ + private AwsOrganizationsAccountProperties awsProperties; + + /* + * Public Cloud Connectors Resource ID + */ + private String publicCloudConnectorsResourceId; + + /* + * AWS Account ID + */ + private String awsAccountId; + + /* + * Amazon Resource Name (ARN) + */ + private String arn; + + /* + * Public Cloud Resource Name + */ + private String publicCloudResourceName; + + /* + * AWS Source Schema + */ + private String awsSourceSchema; + + /* + * AWS Region + */ + private String awsRegion; + + /* + * AWS Tags + */ + private Map awsTags; + + /* + * The status of the last operation. + */ + private ProvisioningState provisioningState; + + /** + * Creates an instance of OrganizationsAccountProperties class. + */ + public OrganizationsAccountProperties() { + } + + /** + * Get the awsProperties property: AWS Properties. + * + * @return the awsProperties value. + */ + public AwsOrganizationsAccountProperties awsProperties() { + return this.awsProperties; + } + + /** + * Set the awsProperties property: AWS Properties. + * + * @param awsProperties the awsProperties value to set. + * @return the OrganizationsAccountProperties object itself. + */ + public OrganizationsAccountProperties withAwsProperties(AwsOrganizationsAccountProperties awsProperties) { + this.awsProperties = awsProperties; + return this; + } + + /** + * Get the publicCloudConnectorsResourceId property: Public Cloud Connectors Resource ID. + * + * @return the publicCloudConnectorsResourceId value. + */ + public String publicCloudConnectorsResourceId() { + return this.publicCloudConnectorsResourceId; + } + + /** + * Set the publicCloudConnectorsResourceId property: Public Cloud Connectors Resource ID. + * + * @param publicCloudConnectorsResourceId the publicCloudConnectorsResourceId value to set. + * @return the OrganizationsAccountProperties object itself. + */ + public OrganizationsAccountProperties withPublicCloudConnectorsResourceId(String publicCloudConnectorsResourceId) { + this.publicCloudConnectorsResourceId = publicCloudConnectorsResourceId; + return this; + } + + /** + * Get the awsAccountId property: AWS Account ID. + * + * @return the awsAccountId value. + */ + public String awsAccountId() { + return this.awsAccountId; + } + + /** + * Set the awsAccountId property: AWS Account ID. + * + * @param awsAccountId the awsAccountId value to set. + * @return the OrganizationsAccountProperties object itself. + */ + public OrganizationsAccountProperties withAwsAccountId(String awsAccountId) { + this.awsAccountId = awsAccountId; + return this; + } + + /** + * Get the arn property: Amazon Resource Name (ARN). + * + * @return the arn value. + */ + public String arn() { + return this.arn; + } + + /** + * Set the arn property: Amazon Resource Name (ARN). + * + * @param arn the arn value to set. + * @return the OrganizationsAccountProperties object itself. + */ + public OrganizationsAccountProperties withArn(String arn) { + this.arn = arn; + return this; + } + + /** + * Get the publicCloudResourceName property: Public Cloud Resource Name. + * + * @return the publicCloudResourceName value. + */ + public String publicCloudResourceName() { + return this.publicCloudResourceName; + } + + /** + * Set the publicCloudResourceName property: Public Cloud Resource Name. + * + * @param publicCloudResourceName the publicCloudResourceName value to set. + * @return the OrganizationsAccountProperties object itself. + */ + public OrganizationsAccountProperties withPublicCloudResourceName(String publicCloudResourceName) { + this.publicCloudResourceName = publicCloudResourceName; + return this; + } + + /** + * Get the awsSourceSchema property: AWS Source Schema. + * + * @return the awsSourceSchema value. + */ + public String awsSourceSchema() { + return this.awsSourceSchema; + } + + /** + * Set the awsSourceSchema property: AWS Source Schema. + * + * @param awsSourceSchema the awsSourceSchema value to set. + * @return the OrganizationsAccountProperties object itself. + */ + public OrganizationsAccountProperties withAwsSourceSchema(String awsSourceSchema) { + this.awsSourceSchema = awsSourceSchema; + return this; + } + + /** + * Get the awsRegion property: AWS Region. + * + * @return the awsRegion value. + */ + public String awsRegion() { + return this.awsRegion; + } + + /** + * Set the awsRegion property: AWS Region. + * + * @param awsRegion the awsRegion value to set. + * @return the OrganizationsAccountProperties object itself. + */ + public OrganizationsAccountProperties withAwsRegion(String awsRegion) { + this.awsRegion = awsRegion; + return this; + } + + /** + * Get the awsTags property: AWS Tags. + * + * @return the awsTags value. + */ + public Map awsTags() { + return this.awsTags; + } + + /** + * Set the awsTags property: AWS Tags. + * + * @param awsTags the awsTags value to set. + * @return the OrganizationsAccountProperties object itself. + */ + public OrganizationsAccountProperties withAwsTags(Map awsTags) { + this.awsTags = awsTags; + return this; + } + + /** + * Get the provisioningState property: The status of the last operation. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (awsProperties() != null) { + awsProperties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("awsProperties", this.awsProperties); + jsonWriter.writeStringField("publicCloudConnectorsResourceId", this.publicCloudConnectorsResourceId); + jsonWriter.writeStringField("awsAccountId", this.awsAccountId); + jsonWriter.writeStringField("arn", this.arn); + jsonWriter.writeStringField("publicCloudResourceName", this.publicCloudResourceName); + jsonWriter.writeStringField("awsSourceSchema", this.awsSourceSchema); + jsonWriter.writeStringField("awsRegion", this.awsRegion); + jsonWriter.writeMapField("awsTags", this.awsTags, (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of OrganizationsAccountProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of OrganizationsAccountProperties if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the OrganizationsAccountProperties. + */ + public static OrganizationsAccountProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + OrganizationsAccountProperties deserializedOrganizationsAccountProperties + = new OrganizationsAccountProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("awsProperties".equals(fieldName)) { + deserializedOrganizationsAccountProperties.awsProperties + = AwsOrganizationsAccountProperties.fromJson(reader); + } else if ("publicCloudConnectorsResourceId".equals(fieldName)) { + deserializedOrganizationsAccountProperties.publicCloudConnectorsResourceId = reader.getString(); + } else if ("awsAccountId".equals(fieldName)) { + deserializedOrganizationsAccountProperties.awsAccountId = reader.getString(); + } else if ("arn".equals(fieldName)) { + deserializedOrganizationsAccountProperties.arn = reader.getString(); + } else if ("publicCloudResourceName".equals(fieldName)) { + deserializedOrganizationsAccountProperties.publicCloudResourceName = reader.getString(); + } else if ("awsSourceSchema".equals(fieldName)) { + deserializedOrganizationsAccountProperties.awsSourceSchema = reader.getString(); + } else if ("awsRegion".equals(fieldName)) { + deserializedOrganizationsAccountProperties.awsRegion = reader.getString(); + } else if ("awsTags".equals(fieldName)) { + Map awsTags = reader.readMap(reader1 -> reader1.getString()); + deserializedOrganizationsAccountProperties.awsTags = awsTags; + } else if ("provisioningState".equals(fieldName)) { + deserializedOrganizationsAccountProperties.provisioningState + = ProvisioningState.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedOrganizationsAccountProperties; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/OrganizationsAccountTagsUpdate.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/OrganizationsAccountTagsUpdate.java new file mode 100644 index 000000000000..d9d8e4517934 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/OrganizationsAccountTagsUpdate.java @@ -0,0 +1,96 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.Map; + +/** + * The type used for updating tags in OrganizationsAccount resources. + */ +@Fluent +public final class OrganizationsAccountTagsUpdate implements JsonSerializable { + /* + * Resource tags. + */ + private Map tags; + + /** + * Creates an instance of OrganizationsAccountTagsUpdate class. + */ + public OrganizationsAccountTagsUpdate() { + } + + /** + * Get the tags property: Resource tags. + * + * @return the tags value. + */ + public Map tags() { + return this.tags; + } + + /** + * Set the tags property: Resource tags. + * + * @param tags the tags value to set. + * @return the OrganizationsAccountTagsUpdate object itself. + */ + public OrganizationsAccountTagsUpdate withTags(Map tags) { + this.tags = tags; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeMapField("tags", this.tags, (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of OrganizationsAccountTagsUpdate from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of OrganizationsAccountTagsUpdate if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the OrganizationsAccountTagsUpdate. + */ + public static OrganizationsAccountTagsUpdate fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + OrganizationsAccountTagsUpdate deserializedOrganizationsAccountTagsUpdate + = new OrganizationsAccountTagsUpdate(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedOrganizationsAccountTagsUpdate.tags = tags; + } else { + reader.skipChildren(); + } + } + + return deserializedOrganizationsAccountTagsUpdate; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/OrganizationsAccounts.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/OrganizationsAccounts.java new file mode 100644 index 000000000000..5c2c11372f54 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/OrganizationsAccounts.java @@ -0,0 +1,158 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** + * Resource collection API of OrganizationsAccounts. + */ +public interface OrganizationsAccounts { + /** + * List OrganizationsAccount resources by subscription ID. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a OrganizationsAccount list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable list(); + + /** + * List OrganizationsAccount resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a OrganizationsAccount list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable list(Context context); + + /** + * List OrganizationsAccount resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a OrganizationsAccount list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * List OrganizationsAccount resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a OrganizationsAccount list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Get a OrganizationsAccount. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of OrganizationsAccount. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a OrganizationsAccount along with {@link Response}. + */ + Response getByResourceGroupWithResponse(String resourceGroupName, String name, + Context context); + + /** + * Get a OrganizationsAccount. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of OrganizationsAccount. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a OrganizationsAccount. + */ + OrganizationsAccount getByResourceGroup(String resourceGroupName, String name); + + /** + * Delete a OrganizationsAccount. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of OrganizationsAccount. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByResourceGroup(String resourceGroupName, String name); + + /** + * Delete a OrganizationsAccount. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of OrganizationsAccount. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String name, Context context); + + /** + * Get a OrganizationsAccount. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a OrganizationsAccount along with {@link Response}. + */ + OrganizationsAccount getById(String id); + + /** + * Get a OrganizationsAccount. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a OrganizationsAccount along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Delete a OrganizationsAccount. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteById(String id); + + /** + * Delete a OrganizationsAccount. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new OrganizationsAccount resource. + * + * @param name resource name. + * @return the first stage of the new OrganizationsAccount definition. + */ + OrganizationsAccount.DefinitionStages.Blank define(String name); +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/OrganizationsOrganization.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/OrganizationsOrganization.java new file mode 100644 index 000000000000..8f66a29baab1 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/OrganizationsOrganization.java @@ -0,0 +1,252 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.awsconnector.fluent.models.OrganizationsOrganizationInner; +import java.util.Map; + +/** + * An immutable client-side representation of OrganizationsOrganization. + */ +public interface OrganizationsOrganization { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the location property: The geo-location where the resource lives. + * + * @return the location value. + */ + String location(); + + /** + * Gets the tags property: Resource tags. + * + * @return the tags value. + */ + Map tags(); + + /** + * Gets the properties property: The resource-specific properties for this resource. + * + * @return the properties value. + */ + OrganizationsOrganizationProperties properties(); + + /** + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the region of the resource. + * + * @return the region of the resource. + */ + Region region(); + + /** + * Gets the name of the resource region. + * + * @return the name of the resource region. + */ + String regionName(); + + /** + * Gets the name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + + /** + * Gets the inner com.azure.resourcemanager.awsconnector.fluent.models.OrganizationsOrganizationInner object. + * + * @return the inner object. + */ + OrganizationsOrganizationInner innerModel(); + + /** + * The entirety of the OrganizationsOrganization definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithLocation, + DefinitionStages.WithResourceGroup, DefinitionStages.WithCreate { + } + + /** + * The OrganizationsOrganization definition stages. + */ + interface DefinitionStages { + /** + * The first stage of the OrganizationsOrganization definition. + */ + interface Blank extends WithLocation { + } + + /** + * The stage of the OrganizationsOrganization definition allowing to specify location. + */ + interface WithLocation { + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithResourceGroup withRegion(Region location); + + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithResourceGroup withRegion(String location); + } + + /** + * The stage of the OrganizationsOrganization definition allowing to specify parent resource. + */ + interface WithResourceGroup { + /** + * Specifies resourceGroupName. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @return the next definition stage. + */ + WithCreate withExistingResourceGroup(String resourceGroupName); + } + + /** + * The stage of the OrganizationsOrganization 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.WithProperties { + /** + * Executes the create request. + * + * @return the created resource. + */ + OrganizationsOrganization create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + OrganizationsOrganization create(Context context); + } + + /** + * The stage of the OrganizationsOrganization definition allowing to specify tags. + */ + interface WithTags { + /** + * Specifies the tags property: Resource tags.. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + WithCreate withTags(Map tags); + } + + /** + * The stage of the OrganizationsOrganization definition allowing to specify properties. + */ + interface WithProperties { + /** + * Specifies the properties property: The resource-specific properties for this resource.. + * + * @param properties The resource-specific properties for this resource. + * @return the next definition stage. + */ + WithCreate withProperties(OrganizationsOrganizationProperties properties); + } + } + + /** + * Begins update for the OrganizationsOrganization resource. + * + * @return the stage of resource update. + */ + OrganizationsOrganization.Update update(); + + /** + * The template for OrganizationsOrganization update. + */ + interface Update extends UpdateStages.WithTags { + /** + * Executes the update request. + * + * @return the updated resource. + */ + OrganizationsOrganization apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + OrganizationsOrganization apply(Context context); + } + + /** + * The OrganizationsOrganization update stages. + */ + interface UpdateStages { + /** + * The stage of the OrganizationsOrganization update allowing to specify tags. + */ + interface WithTags { + /** + * Specifies the tags property: Resource tags.. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + Update withTags(Map tags); + } + } + + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + OrganizationsOrganization refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + OrganizationsOrganization refresh(Context context); +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/OrganizationsOrganizationListResult.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/OrganizationsOrganizationListResult.java new file mode 100644 index 000000000000..2f8bb66f718b --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/OrganizationsOrganizationListResult.java @@ -0,0 +1,138 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.awsconnector.fluent.models.OrganizationsOrganizationInner; +import java.io.IOException; +import java.util.List; + +/** + * The response of a OrganizationsOrganization list operation. + */ +@Fluent +public final class OrganizationsOrganizationListResult + implements JsonSerializable { + /* + * The OrganizationsOrganization items on this page + */ + private List value; + + /* + * The link to the next page of items + */ + private String nextLink; + + /** + * Creates an instance of OrganizationsOrganizationListResult class. + */ + public OrganizationsOrganizationListResult() { + } + + /** + * Get the value property: The OrganizationsOrganization items on this page. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The OrganizationsOrganization items on this page. + * + * @param value the value value to set. + * @return the OrganizationsOrganizationListResult object itself. + */ + public OrganizationsOrganizationListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The link to the next page of items. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: The link to the next page of items. + * + * @param nextLink the nextLink value to set. + * @return the OrganizationsOrganizationListResult object itself. + */ + public OrganizationsOrganizationListResult withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property value in model OrganizationsOrganizationListResult")); + } else { + value().forEach(e -> e.validate()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(OrganizationsOrganizationListResult.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("nextLink", this.nextLink); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of OrganizationsOrganizationListResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of OrganizationsOrganizationListResult if the JsonReader was pointing to an instance of it, + * or null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the OrganizationsOrganizationListResult. + */ + public static OrganizationsOrganizationListResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + OrganizationsOrganizationListResult deserializedOrganizationsOrganizationListResult + = new OrganizationsOrganizationListResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> OrganizationsOrganizationInner.fromJson(reader1)); + deserializedOrganizationsOrganizationListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedOrganizationsOrganizationListResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedOrganizationsOrganizationListResult; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/OrganizationsOrganizationProperties.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/OrganizationsOrganizationProperties.java new file mode 100644 index 000000000000..07ced4ddad2e --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/OrganizationsOrganizationProperties.java @@ -0,0 +1,316 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.Map; + +/** + * Definition of OrganizationsOrganization. + */ +@Fluent +public final class OrganizationsOrganizationProperties + implements JsonSerializable { + /* + * AWS Properties + */ + private AwsOrganizationsOrganizationProperties awsProperties; + + /* + * Public Cloud Connectors Resource ID + */ + private String publicCloudConnectorsResourceId; + + /* + * AWS Account ID + */ + private String awsAccountId; + + /* + * Amazon Resource Name (ARN) + */ + private String arn; + + /* + * Public Cloud Resource Name + */ + private String publicCloudResourceName; + + /* + * AWS Source Schema + */ + private String awsSourceSchema; + + /* + * AWS Region + */ + private String awsRegion; + + /* + * AWS Tags + */ + private Map awsTags; + + /* + * The status of the last operation. + */ + private ProvisioningState provisioningState; + + /** + * Creates an instance of OrganizationsOrganizationProperties class. + */ + public OrganizationsOrganizationProperties() { + } + + /** + * Get the awsProperties property: AWS Properties. + * + * @return the awsProperties value. + */ + public AwsOrganizationsOrganizationProperties awsProperties() { + return this.awsProperties; + } + + /** + * Set the awsProperties property: AWS Properties. + * + * @param awsProperties the awsProperties value to set. + * @return the OrganizationsOrganizationProperties object itself. + */ + public OrganizationsOrganizationProperties withAwsProperties(AwsOrganizationsOrganizationProperties awsProperties) { + this.awsProperties = awsProperties; + return this; + } + + /** + * Get the publicCloudConnectorsResourceId property: Public Cloud Connectors Resource ID. + * + * @return the publicCloudConnectorsResourceId value. + */ + public String publicCloudConnectorsResourceId() { + return this.publicCloudConnectorsResourceId; + } + + /** + * Set the publicCloudConnectorsResourceId property: Public Cloud Connectors Resource ID. + * + * @param publicCloudConnectorsResourceId the publicCloudConnectorsResourceId value to set. + * @return the OrganizationsOrganizationProperties object itself. + */ + public OrganizationsOrganizationProperties + withPublicCloudConnectorsResourceId(String publicCloudConnectorsResourceId) { + this.publicCloudConnectorsResourceId = publicCloudConnectorsResourceId; + return this; + } + + /** + * Get the awsAccountId property: AWS Account ID. + * + * @return the awsAccountId value. + */ + public String awsAccountId() { + return this.awsAccountId; + } + + /** + * Set the awsAccountId property: AWS Account ID. + * + * @param awsAccountId the awsAccountId value to set. + * @return the OrganizationsOrganizationProperties object itself. + */ + public OrganizationsOrganizationProperties withAwsAccountId(String awsAccountId) { + this.awsAccountId = awsAccountId; + return this; + } + + /** + * Get the arn property: Amazon Resource Name (ARN). + * + * @return the arn value. + */ + public String arn() { + return this.arn; + } + + /** + * Set the arn property: Amazon Resource Name (ARN). + * + * @param arn the arn value to set. + * @return the OrganizationsOrganizationProperties object itself. + */ + public OrganizationsOrganizationProperties withArn(String arn) { + this.arn = arn; + return this; + } + + /** + * Get the publicCloudResourceName property: Public Cloud Resource Name. + * + * @return the publicCloudResourceName value. + */ + public String publicCloudResourceName() { + return this.publicCloudResourceName; + } + + /** + * Set the publicCloudResourceName property: Public Cloud Resource Name. + * + * @param publicCloudResourceName the publicCloudResourceName value to set. + * @return the OrganizationsOrganizationProperties object itself. + */ + public OrganizationsOrganizationProperties withPublicCloudResourceName(String publicCloudResourceName) { + this.publicCloudResourceName = publicCloudResourceName; + return this; + } + + /** + * Get the awsSourceSchema property: AWS Source Schema. + * + * @return the awsSourceSchema value. + */ + public String awsSourceSchema() { + return this.awsSourceSchema; + } + + /** + * Set the awsSourceSchema property: AWS Source Schema. + * + * @param awsSourceSchema the awsSourceSchema value to set. + * @return the OrganizationsOrganizationProperties object itself. + */ + public OrganizationsOrganizationProperties withAwsSourceSchema(String awsSourceSchema) { + this.awsSourceSchema = awsSourceSchema; + return this; + } + + /** + * Get the awsRegion property: AWS Region. + * + * @return the awsRegion value. + */ + public String awsRegion() { + return this.awsRegion; + } + + /** + * Set the awsRegion property: AWS Region. + * + * @param awsRegion the awsRegion value to set. + * @return the OrganizationsOrganizationProperties object itself. + */ + public OrganizationsOrganizationProperties withAwsRegion(String awsRegion) { + this.awsRegion = awsRegion; + return this; + } + + /** + * Get the awsTags property: AWS Tags. + * + * @return the awsTags value. + */ + public Map awsTags() { + return this.awsTags; + } + + /** + * Set the awsTags property: AWS Tags. + * + * @param awsTags the awsTags value to set. + * @return the OrganizationsOrganizationProperties object itself. + */ + public OrganizationsOrganizationProperties withAwsTags(Map awsTags) { + this.awsTags = awsTags; + return this; + } + + /** + * Get the provisioningState property: The status of the last operation. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (awsProperties() != null) { + awsProperties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("awsProperties", this.awsProperties); + jsonWriter.writeStringField("publicCloudConnectorsResourceId", this.publicCloudConnectorsResourceId); + jsonWriter.writeStringField("awsAccountId", this.awsAccountId); + jsonWriter.writeStringField("arn", this.arn); + jsonWriter.writeStringField("publicCloudResourceName", this.publicCloudResourceName); + jsonWriter.writeStringField("awsSourceSchema", this.awsSourceSchema); + jsonWriter.writeStringField("awsRegion", this.awsRegion); + jsonWriter.writeMapField("awsTags", this.awsTags, (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of OrganizationsOrganizationProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of OrganizationsOrganizationProperties if the JsonReader was pointing to an instance of it, + * or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the OrganizationsOrganizationProperties. + */ + public static OrganizationsOrganizationProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + OrganizationsOrganizationProperties deserializedOrganizationsOrganizationProperties + = new OrganizationsOrganizationProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("awsProperties".equals(fieldName)) { + deserializedOrganizationsOrganizationProperties.awsProperties + = AwsOrganizationsOrganizationProperties.fromJson(reader); + } else if ("publicCloudConnectorsResourceId".equals(fieldName)) { + deserializedOrganizationsOrganizationProperties.publicCloudConnectorsResourceId + = reader.getString(); + } else if ("awsAccountId".equals(fieldName)) { + deserializedOrganizationsOrganizationProperties.awsAccountId = reader.getString(); + } else if ("arn".equals(fieldName)) { + deserializedOrganizationsOrganizationProperties.arn = reader.getString(); + } else if ("publicCloudResourceName".equals(fieldName)) { + deserializedOrganizationsOrganizationProperties.publicCloudResourceName = reader.getString(); + } else if ("awsSourceSchema".equals(fieldName)) { + deserializedOrganizationsOrganizationProperties.awsSourceSchema = reader.getString(); + } else if ("awsRegion".equals(fieldName)) { + deserializedOrganizationsOrganizationProperties.awsRegion = reader.getString(); + } else if ("awsTags".equals(fieldName)) { + Map awsTags = reader.readMap(reader1 -> reader1.getString()); + deserializedOrganizationsOrganizationProperties.awsTags = awsTags; + } else if ("provisioningState".equals(fieldName)) { + deserializedOrganizationsOrganizationProperties.provisioningState + = ProvisioningState.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedOrganizationsOrganizationProperties; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/OrganizationsOrganizationTagsUpdate.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/OrganizationsOrganizationTagsUpdate.java new file mode 100644 index 000000000000..95fad8f634b9 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/OrganizationsOrganizationTagsUpdate.java @@ -0,0 +1,97 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.Map; + +/** + * The type used for updating tags in OrganizationsOrganization resources. + */ +@Fluent +public final class OrganizationsOrganizationTagsUpdate + implements JsonSerializable { + /* + * Resource tags. + */ + private Map tags; + + /** + * Creates an instance of OrganizationsOrganizationTagsUpdate class. + */ + public OrganizationsOrganizationTagsUpdate() { + } + + /** + * Get the tags property: Resource tags. + * + * @return the tags value. + */ + public Map tags() { + return this.tags; + } + + /** + * Set the tags property: Resource tags. + * + * @param tags the tags value to set. + * @return the OrganizationsOrganizationTagsUpdate object itself. + */ + public OrganizationsOrganizationTagsUpdate withTags(Map tags) { + this.tags = tags; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeMapField("tags", this.tags, (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of OrganizationsOrganizationTagsUpdate from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of OrganizationsOrganizationTagsUpdate if the JsonReader was pointing to an instance of it, + * or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the OrganizationsOrganizationTagsUpdate. + */ + public static OrganizationsOrganizationTagsUpdate fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + OrganizationsOrganizationTagsUpdate deserializedOrganizationsOrganizationTagsUpdate + = new OrganizationsOrganizationTagsUpdate(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedOrganizationsOrganizationTagsUpdate.tags = tags; + } else { + reader.skipChildren(); + } + } + + return deserializedOrganizationsOrganizationTagsUpdate; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/OrganizationsOrganizations.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/OrganizationsOrganizations.java new file mode 100644 index 000000000000..01b394cddb88 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/OrganizationsOrganizations.java @@ -0,0 +1,162 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** + * Resource collection API of OrganizationsOrganizations. + */ +public interface OrganizationsOrganizations { + /** + * List OrganizationsOrganization resources by subscription ID. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a OrganizationsOrganization list operation as paginated response with + * {@link PagedIterable}. + */ + PagedIterable list(); + + /** + * List OrganizationsOrganization resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a OrganizationsOrganization list operation as paginated response with + * {@link PagedIterable}. + */ + PagedIterable list(Context context); + + /** + * List OrganizationsOrganization resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a OrganizationsOrganization list operation as paginated response with + * {@link PagedIterable}. + */ + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * List OrganizationsOrganization resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a OrganizationsOrganization list operation as paginated response with + * {@link PagedIterable}. + */ + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Get a OrganizationsOrganization. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of OrganizationsOrganization. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a OrganizationsOrganization along with {@link Response}. + */ + Response getByResourceGroupWithResponse(String resourceGroupName, String name, + Context context); + + /** + * Get a OrganizationsOrganization. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of OrganizationsOrganization. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a OrganizationsOrganization. + */ + OrganizationsOrganization getByResourceGroup(String resourceGroupName, String name); + + /** + * Delete a OrganizationsOrganization. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of OrganizationsOrganization. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByResourceGroup(String resourceGroupName, String name); + + /** + * Delete a OrganizationsOrganization. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of OrganizationsOrganization. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String name, Context context); + + /** + * Get a OrganizationsOrganization. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a OrganizationsOrganization along with {@link Response}. + */ + OrganizationsOrganization getById(String id); + + /** + * Get a OrganizationsOrganization. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a OrganizationsOrganization along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Delete a OrganizationsOrganization. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteById(String id); + + /** + * Delete a OrganizationsOrganization. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new OrganizationsOrganization resource. + * + * @param name resource name. + * @return the first stage of the new OrganizationsOrganization definition. + */ + OrganizationsOrganization.DefinitionStages.Blank define(String name); +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/Origin.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/Origin.java new file mode 100644 index 000000000000..0df326328c34 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/Origin.java @@ -0,0 +1,67 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * The intended executor of the operation; as in Resource Based Access Control (RBAC) and audit logs UX. Default value + * is "user,system". + */ +public final class Origin extends ExpandableStringEnum { + /** + * Static value user for Origin. + */ + public static final Origin USER = fromString("user"); + + /** + * Static value system for Origin. + */ + public static final Origin SYSTEM = fromString("system"); + + /** + * Static value user,system for Origin. + */ + public static final Origin USER_SYSTEM = fromString("user,system"); + + /** + * Static value AWS_KMS for Origin. + */ + public static final Origin AWS_KMS = fromString("AWS_KMS"); + + /** + * Static value EXTERNAL for Origin. + */ + public static final Origin EXTERNAL = fromString("EXTERNAL"); + + /** + * Creates a new instance of Origin value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public Origin() { + } + + /** + * Creates or finds a Origin from its string representation. + * + * @param name a name to look for. + * @return the corresponding Origin. + */ + public static Origin fromString(String name) { + return fromString(name, Origin.class); + } + + /** + * Gets known Origin values. + * + * @return known Origin values. + */ + public static Collection values() { + return values(Origin.class); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/OriginAutoGenerated.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/OriginAutoGenerated.java new file mode 100644 index 000000000000..3ff61520fdee --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/OriginAutoGenerated.java @@ -0,0 +1,473 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Definition of Origin. + */ +@Fluent +public final class OriginAutoGenerated implements JsonSerializable { + /* + * The number of times that CloudFront attempts to connect to the origin. The minimum number is 1, the maximum is 3, + * and the default (if you don't specify otherwise) is 3. For a custom origin (including an Amazon S3 bucket that's + * configured with static website hosting), this value also specifies the number of times that CloudFront attempts + * to get a response from the origin, in the case of an [Origin Response + * Timeout](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/distribution-web-values-specify.html# + * DownloadDistValuesOriginResponseTimeout). For more information, see [Origin Connection + * Attempts](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/distribution-web-values-specify.html + * #origin-connection-attempts) in the *Amazon CloudFront Developer Guide*. + */ + private Integer connectionAttempts; + + /* + * The number of seconds that CloudFront waits when trying to establish a connection to the origin. The minimum + * timeout is 1 second, the maximum is 10 seconds, and the default (if you don't specify otherwise) is 10 seconds. + * For more information, see [Origin Connection + * Timeout](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/distribution-web-values-specify.html# + * origin-connection-timeout) in the *Amazon CloudFront Developer Guide*. + */ + private Integer connectionTimeout; + + /* + * Use this type to specify an origin that is not an Amazon S3 bucket, with one exception. If the Amazon S3 bucket + * is configured with static website hosting, use this type. If the Amazon S3 bucket is not configured with static + * website hosting, use the ``S3OriginConfig`` type instead. A custom origin. A custom origin is any origin that is + * *not* an Amazon S3 bucket, with one exception. An Amazon S3 bucket that is [configured with static website + * hosting](https://docs.aws.amazon.com/AmazonS3/latest/dev/WebsiteHosting.html) *is* a custom origin. + */ + private CustomOriginConfig customOriginConfig; + + /* + * The domain name for the origin. For more information, see [Origin Domain + * Name](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/distribution-web-values-specify.html# + * DownloadDistValuesDomainName) in the *Amazon CloudFront Developer Guide*. + */ + private String domainName; + + /* + * A unique identifier for the origin. This value must be unique within the distribution. Use this value to specify + * the ``TargetOriginId`` in a ``CacheBehavior`` or ``DefaultCacheBehavior``. + */ + private String id; + + /* + * The unique identifier of an origin access control for this origin. For more information, see [Restricting access + * to an Amazon S3 + * origin](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/private-content-restricting-access-to- + * s3.html) in the *Amazon CloudFront Developer Guide*. + */ + private String originAccessControlId; + + /* + * A list of HTTP header names and values that CloudFront adds to the requests that it sends to the origin. For more + * information, see [Adding Custom Headers to Origin + * Requests](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/add-origin-custom-headers.html) in + * the *Amazon CloudFront Developer Guide*. + */ + private List originCustomHeaders; + + /* + * An optional path that CloudFront appends to the origin domain name when CloudFront requests content from the + * origin. For more information, see [Origin + * Path](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/distribution-web-values-specify.html# + * DownloadDistValuesOriginPath) in the *Amazon CloudFront Developer Guide*. + */ + private String originPath; + + /* + * CloudFront Origin Shield. Using Origin Shield can help reduce the load on your origin. For more information, see + * [Using Origin Shield](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/origin-shield.html) in + * the *Amazon CloudFront Developer Guide*. CloudFront Origin Shield. Using Origin Shield can help reduce the load + * on your origin. For more information, see [Using Origin + * Shield](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/origin-shield.html) in the *Amazon + * CloudFront Developer Guide*. + */ + private OriginShield originShield; + + /* + * Use this type to specify an origin that is an Amazon S3 bucket that is not configured with static website + * hosting. To specify any other type of origin, including an Amazon S3 bucket that is configured with static + * website hosting, use the ``CustomOriginConfig`` type instead. A complex type that contains information about the + * Amazon S3 origin. If the origin is a custom origin or an S3 bucket that is configured as a website endpoint, use + * the ``CustomOriginConfig`` element instead. + */ + private S3OriginConfig s3OriginConfig; + + /** + * Creates an instance of OriginAutoGenerated class. + */ + public OriginAutoGenerated() { + } + + /** + * Get the connectionAttempts property: The number of times that CloudFront attempts to connect to the origin. The + * minimum number is 1, the maximum is 3, and the default (if you don't specify otherwise) is 3. For a custom origin + * (including an Amazon S3 bucket that's configured with static website hosting), this value also specifies the + * number of times that CloudFront attempts to get a response from the origin, in the case of an [Origin Response + * Timeout](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/distribution-web-values-specify.html#DownloadDistValuesOriginResponseTimeout). + * For more information, see [Origin Connection + * Attempts](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/distribution-web-values-specify.html#origin-connection-attempts) + * in the *Amazon CloudFront Developer Guide*. + * + * @return the connectionAttempts value. + */ + public Integer connectionAttempts() { + return this.connectionAttempts; + } + + /** + * Set the connectionAttempts property: The number of times that CloudFront attempts to connect to the origin. The + * minimum number is 1, the maximum is 3, and the default (if you don't specify otherwise) is 3. For a custom origin + * (including an Amazon S3 bucket that's configured with static website hosting), this value also specifies the + * number of times that CloudFront attempts to get a response from the origin, in the case of an [Origin Response + * Timeout](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/distribution-web-values-specify.html#DownloadDistValuesOriginResponseTimeout). + * For more information, see [Origin Connection + * Attempts](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/distribution-web-values-specify.html#origin-connection-attempts) + * in the *Amazon CloudFront Developer Guide*. + * + * @param connectionAttempts the connectionAttempts value to set. + * @return the OriginAutoGenerated object itself. + */ + public OriginAutoGenerated withConnectionAttempts(Integer connectionAttempts) { + this.connectionAttempts = connectionAttempts; + return this; + } + + /** + * Get the connectionTimeout property: The number of seconds that CloudFront waits when trying to establish a + * connection to the origin. The minimum timeout is 1 second, the maximum is 10 seconds, and the default (if you + * don't specify otherwise) is 10 seconds. For more information, see [Origin Connection + * Timeout](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/distribution-web-values-specify.html#origin-connection-timeout) + * in the *Amazon CloudFront Developer Guide*. + * + * @return the connectionTimeout value. + */ + public Integer connectionTimeout() { + return this.connectionTimeout; + } + + /** + * Set the connectionTimeout property: The number of seconds that CloudFront waits when trying to establish a + * connection to the origin. The minimum timeout is 1 second, the maximum is 10 seconds, and the default (if you + * don't specify otherwise) is 10 seconds. For more information, see [Origin Connection + * Timeout](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/distribution-web-values-specify.html#origin-connection-timeout) + * in the *Amazon CloudFront Developer Guide*. + * + * @param connectionTimeout the connectionTimeout value to set. + * @return the OriginAutoGenerated object itself. + */ + public OriginAutoGenerated withConnectionTimeout(Integer connectionTimeout) { + this.connectionTimeout = connectionTimeout; + return this; + } + + /** + * Get the customOriginConfig property: Use this type to specify an origin that is not an Amazon S3 bucket, with one + * exception. If the Amazon S3 bucket is configured with static website hosting, use this type. If the Amazon S3 + * bucket is not configured with static website hosting, use the ``S3OriginConfig`` type instead. A custom origin. A + * custom origin is any origin that is *not* an Amazon S3 bucket, with one exception. An Amazon S3 bucket that is + * [configured with static website hosting](https://docs.aws.amazon.com/AmazonS3/latest/dev/WebsiteHosting.html) + * *is* a custom origin. + * + * @return the customOriginConfig value. + */ + public CustomOriginConfig customOriginConfig() { + return this.customOriginConfig; + } + + /** + * Set the customOriginConfig property: Use this type to specify an origin that is not an Amazon S3 bucket, with one + * exception. If the Amazon S3 bucket is configured with static website hosting, use this type. If the Amazon S3 + * bucket is not configured with static website hosting, use the ``S3OriginConfig`` type instead. A custom origin. A + * custom origin is any origin that is *not* an Amazon S3 bucket, with one exception. An Amazon S3 bucket that is + * [configured with static website hosting](https://docs.aws.amazon.com/AmazonS3/latest/dev/WebsiteHosting.html) + * *is* a custom origin. + * + * @param customOriginConfig the customOriginConfig value to set. + * @return the OriginAutoGenerated object itself. + */ + public OriginAutoGenerated withCustomOriginConfig(CustomOriginConfig customOriginConfig) { + this.customOriginConfig = customOriginConfig; + return this; + } + + /** + * Get the domainName property: The domain name for the origin. For more information, see [Origin Domain + * Name](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/distribution-web-values-specify.html#DownloadDistValuesDomainName) + * in the *Amazon CloudFront Developer Guide*. + * + * @return the domainName value. + */ + public String domainName() { + return this.domainName; + } + + /** + * Set the domainName property: The domain name for the origin. For more information, see [Origin Domain + * Name](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/distribution-web-values-specify.html#DownloadDistValuesDomainName) + * in the *Amazon CloudFront Developer Guide*. + * + * @param domainName the domainName value to set. + * @return the OriginAutoGenerated object itself. + */ + public OriginAutoGenerated withDomainName(String domainName) { + this.domainName = domainName; + return this; + } + + /** + * Get the id property: A unique identifier for the origin. This value must be unique within the distribution. Use + * this value to specify the ``TargetOriginId`` in a ``CacheBehavior`` or ``DefaultCacheBehavior``. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Set the id property: A unique identifier for the origin. This value must be unique within the distribution. Use + * this value to specify the ``TargetOriginId`` in a ``CacheBehavior`` or ``DefaultCacheBehavior``. + * + * @param id the id value to set. + * @return the OriginAutoGenerated object itself. + */ + public OriginAutoGenerated withId(String id) { + this.id = id; + return this; + } + + /** + * Get the originAccessControlId property: The unique identifier of an origin access control for this origin. For + * more information, see [Restricting access to an Amazon S3 + * origin](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/private-content-restricting-access-to-s3.html) + * in the *Amazon CloudFront Developer Guide*. + * + * @return the originAccessControlId value. + */ + public String originAccessControlId() { + return this.originAccessControlId; + } + + /** + * Set the originAccessControlId property: The unique identifier of an origin access control for this origin. For + * more information, see [Restricting access to an Amazon S3 + * origin](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/private-content-restricting-access-to-s3.html) + * in the *Amazon CloudFront Developer Guide*. + * + * @param originAccessControlId the originAccessControlId value to set. + * @return the OriginAutoGenerated object itself. + */ + public OriginAutoGenerated withOriginAccessControlId(String originAccessControlId) { + this.originAccessControlId = originAccessControlId; + return this; + } + + /** + * Get the originCustomHeaders property: A list of HTTP header names and values that CloudFront adds to the requests + * that it sends to the origin. For more information, see [Adding Custom Headers to Origin + * Requests](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/add-origin-custom-headers.html) in + * the *Amazon CloudFront Developer Guide*. + * + * @return the originCustomHeaders value. + */ + public List originCustomHeaders() { + return this.originCustomHeaders; + } + + /** + * Set the originCustomHeaders property: A list of HTTP header names and values that CloudFront adds to the requests + * that it sends to the origin. For more information, see [Adding Custom Headers to Origin + * Requests](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/add-origin-custom-headers.html) in + * the *Amazon CloudFront Developer Guide*. + * + * @param originCustomHeaders the originCustomHeaders value to set. + * @return the OriginAutoGenerated object itself. + */ + public OriginAutoGenerated withOriginCustomHeaders(List originCustomHeaders) { + this.originCustomHeaders = originCustomHeaders; + return this; + } + + /** + * Get the originPath property: An optional path that CloudFront appends to the origin domain name when CloudFront + * requests content from the origin. For more information, see [Origin + * Path](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/distribution-web-values-specify.html#DownloadDistValuesOriginPath) + * in the *Amazon CloudFront Developer Guide*. + * + * @return the originPath value. + */ + public String originPath() { + return this.originPath; + } + + /** + * Set the originPath property: An optional path that CloudFront appends to the origin domain name when CloudFront + * requests content from the origin. For more information, see [Origin + * Path](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/distribution-web-values-specify.html#DownloadDistValuesOriginPath) + * in the *Amazon CloudFront Developer Guide*. + * + * @param originPath the originPath value to set. + * @return the OriginAutoGenerated object itself. + */ + public OriginAutoGenerated withOriginPath(String originPath) { + this.originPath = originPath; + return this; + } + + /** + * Get the originShield property: CloudFront Origin Shield. Using Origin Shield can help reduce the load on your + * origin. For more information, see [Using Origin + * Shield](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/origin-shield.html) in the *Amazon + * CloudFront Developer Guide*. CloudFront Origin Shield. Using Origin Shield can help reduce the load on your + * origin. For more information, see [Using Origin + * Shield](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/origin-shield.html) in the *Amazon + * CloudFront Developer Guide*. + * + * @return the originShield value. + */ + public OriginShield originShield() { + return this.originShield; + } + + /** + * Set the originShield property: CloudFront Origin Shield. Using Origin Shield can help reduce the load on your + * origin. For more information, see [Using Origin + * Shield](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/origin-shield.html) in the *Amazon + * CloudFront Developer Guide*. CloudFront Origin Shield. Using Origin Shield can help reduce the load on your + * origin. For more information, see [Using Origin + * Shield](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/origin-shield.html) in the *Amazon + * CloudFront Developer Guide*. + * + * @param originShield the originShield value to set. + * @return the OriginAutoGenerated object itself. + */ + public OriginAutoGenerated withOriginShield(OriginShield originShield) { + this.originShield = originShield; + return this; + } + + /** + * Get the s3OriginConfig property: Use this type to specify an origin that is an Amazon S3 bucket that is not + * configured with static website hosting. To specify any other type of origin, including an Amazon S3 bucket that + * is configured with static website hosting, use the ``CustomOriginConfig`` type instead. A complex type that + * contains information about the Amazon S3 origin. If the origin is a custom origin or an S3 bucket that is + * configured as a website endpoint, use the ``CustomOriginConfig`` element instead. + * + * @return the s3OriginConfig value. + */ + public S3OriginConfig s3OriginConfig() { + return this.s3OriginConfig; + } + + /** + * Set the s3OriginConfig property: Use this type to specify an origin that is an Amazon S3 bucket that is not + * configured with static website hosting. To specify any other type of origin, including an Amazon S3 bucket that + * is configured with static website hosting, use the ``CustomOriginConfig`` type instead. A complex type that + * contains information about the Amazon S3 origin. If the origin is a custom origin or an S3 bucket that is + * configured as a website endpoint, use the ``CustomOriginConfig`` element instead. + * + * @param s3OriginConfig the s3OriginConfig value to set. + * @return the OriginAutoGenerated object itself. + */ + public OriginAutoGenerated withS3OriginConfig(S3OriginConfig s3OriginConfig) { + this.s3OriginConfig = s3OriginConfig; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (customOriginConfig() != null) { + customOriginConfig().validate(); + } + if (originCustomHeaders() != null) { + originCustomHeaders().forEach(e -> e.validate()); + } + if (originShield() != null) { + originShield().validate(); + } + if (s3OriginConfig() != null) { + s3OriginConfig().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeNumberField("connectionAttempts", this.connectionAttempts); + jsonWriter.writeNumberField("connectionTimeout", this.connectionTimeout); + jsonWriter.writeJsonField("customOriginConfig", this.customOriginConfig); + jsonWriter.writeStringField("domainName", this.domainName); + jsonWriter.writeStringField("id", this.id); + jsonWriter.writeStringField("originAccessControlId", this.originAccessControlId); + jsonWriter.writeArrayField("originCustomHeaders", this.originCustomHeaders, + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("originPath", this.originPath); + jsonWriter.writeJsonField("originShield", this.originShield); + jsonWriter.writeJsonField("s3OriginConfig", this.s3OriginConfig); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of OriginAutoGenerated from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of OriginAutoGenerated if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the OriginAutoGenerated. + */ + public static OriginAutoGenerated fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + OriginAutoGenerated deserializedOriginAutoGenerated = new OriginAutoGenerated(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("connectionAttempts".equals(fieldName)) { + deserializedOriginAutoGenerated.connectionAttempts = reader.getNullable(JsonReader::getInt); + } else if ("connectionTimeout".equals(fieldName)) { + deserializedOriginAutoGenerated.connectionTimeout = reader.getNullable(JsonReader::getInt); + } else if ("customOriginConfig".equals(fieldName)) { + deserializedOriginAutoGenerated.customOriginConfig = CustomOriginConfig.fromJson(reader); + } else if ("domainName".equals(fieldName)) { + deserializedOriginAutoGenerated.domainName = reader.getString(); + } else if ("id".equals(fieldName)) { + deserializedOriginAutoGenerated.id = reader.getString(); + } else if ("originAccessControlId".equals(fieldName)) { + deserializedOriginAutoGenerated.originAccessControlId = reader.getString(); + } else if ("originCustomHeaders".equals(fieldName)) { + List originCustomHeaders + = reader.readArray(reader1 -> OriginCustomHeader.fromJson(reader1)); + deserializedOriginAutoGenerated.originCustomHeaders = originCustomHeaders; + } else if ("originPath".equals(fieldName)) { + deserializedOriginAutoGenerated.originPath = reader.getString(); + } else if ("originShield".equals(fieldName)) { + deserializedOriginAutoGenerated.originShield = OriginShield.fromJson(reader); + } else if ("s3OriginConfig".equals(fieldName)) { + deserializedOriginAutoGenerated.s3OriginConfig = S3OriginConfig.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedOriginAutoGenerated; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/OriginCustomHeader.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/OriginCustomHeader.java new file mode 100644 index 000000000000..13f2f6bc6eff --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/OriginCustomHeader.java @@ -0,0 +1,130 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of OriginCustomHeader. + */ +@Fluent +public final class OriginCustomHeader implements JsonSerializable { + /* + * The name of a header that you want CloudFront to send to your origin. For more information, see [Adding Custom + * Headers to Origin + * Requests](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/forward-custom-headers.html) in the + * *Amazon CloudFront Developer Guide*. + */ + private String headerName; + + /* + * The value for the header that you specified in the ``HeaderName`` field. + */ + private String headerValue; + + /** + * Creates an instance of OriginCustomHeader class. + */ + public OriginCustomHeader() { + } + + /** + * Get the headerName property: The name of a header that you want CloudFront to send to your origin. For more + * information, see [Adding Custom Headers to Origin + * Requests](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/forward-custom-headers.html) in the + * *Amazon CloudFront Developer Guide*. + * + * @return the headerName value. + */ + public String headerName() { + return this.headerName; + } + + /** + * Set the headerName property: The name of a header that you want CloudFront to send to your origin. For more + * information, see [Adding Custom Headers to Origin + * Requests](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/forward-custom-headers.html) in the + * *Amazon CloudFront Developer Guide*. + * + * @param headerName the headerName value to set. + * @return the OriginCustomHeader object itself. + */ + public OriginCustomHeader withHeaderName(String headerName) { + this.headerName = headerName; + return this; + } + + /** + * Get the headerValue property: The value for the header that you specified in the ``HeaderName`` field. + * + * @return the headerValue value. + */ + public String headerValue() { + return this.headerValue; + } + + /** + * Set the headerValue property: The value for the header that you specified in the ``HeaderName`` field. + * + * @param headerValue the headerValue value to set. + * @return the OriginCustomHeader object itself. + */ + public OriginCustomHeader withHeaderValue(String headerValue) { + this.headerValue = headerValue; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("headerName", this.headerName); + jsonWriter.writeStringField("headerValue", this.headerValue); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of OriginCustomHeader from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of OriginCustomHeader if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the OriginCustomHeader. + */ + public static OriginCustomHeader fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + OriginCustomHeader deserializedOriginCustomHeader = new OriginCustomHeader(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("headerName".equals(fieldName)) { + deserializedOriginCustomHeader.headerName = reader.getString(); + } else if ("headerValue".equals(fieldName)) { + deserializedOriginCustomHeader.headerValue = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedOriginCustomHeader; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/OriginGroup.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/OriginGroup.java new file mode 100644 index 000000000000..1011c09dc507 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/OriginGroup.java @@ -0,0 +1,164 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of OriginGroup. + */ +@Fluent +public final class OriginGroup implements JsonSerializable { + /* + * A complex type that contains information about the failover criteria for an origin group. A complex data type + * that includes information about the failover criteria for an origin group, including the status codes for which + * CloudFront will failover from the primary origin to the second origin. + */ + private OriginGroupFailoverCriteria failoverCriteria; + + /* + * The origin group's ID. + */ + private String id; + + /* + * A complex type that contains information about the origins in an origin group. A complex data type for the + * origins included in an origin group. + */ + private OriginGroupMembers members; + + /** + * Creates an instance of OriginGroup class. + */ + public OriginGroup() { + } + + /** + * Get the failoverCriteria property: A complex type that contains information about the failover criteria for an + * origin group. A complex data type that includes information about the failover criteria for an origin group, + * including the status codes for which CloudFront will failover from the primary origin to the second origin. + * + * @return the failoverCriteria value. + */ + public OriginGroupFailoverCriteria failoverCriteria() { + return this.failoverCriteria; + } + + /** + * Set the failoverCriteria property: A complex type that contains information about the failover criteria for an + * origin group. A complex data type that includes information about the failover criteria for an origin group, + * including the status codes for which CloudFront will failover from the primary origin to the second origin. + * + * @param failoverCriteria the failoverCriteria value to set. + * @return the OriginGroup object itself. + */ + public OriginGroup withFailoverCriteria(OriginGroupFailoverCriteria failoverCriteria) { + this.failoverCriteria = failoverCriteria; + return this; + } + + /** + * Get the id property: The origin group's ID. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Set the id property: The origin group's ID. + * + * @param id the id value to set. + * @return the OriginGroup object itself. + */ + public OriginGroup withId(String id) { + this.id = id; + return this; + } + + /** + * Get the members property: A complex type that contains information about the origins in an origin group. A + * complex data type for the origins included in an origin group. + * + * @return the members value. + */ + public OriginGroupMembers members() { + return this.members; + } + + /** + * Set the members property: A complex type that contains information about the origins in an origin group. A + * complex data type for the origins included in an origin group. + * + * @param members the members value to set. + * @return the OriginGroup object itself. + */ + public OriginGroup withMembers(OriginGroupMembers members) { + this.members = members; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (failoverCriteria() != null) { + failoverCriteria().validate(); + } + if (members() != null) { + members().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("failoverCriteria", this.failoverCriteria); + jsonWriter.writeStringField("id", this.id); + jsonWriter.writeJsonField("members", this.members); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of OriginGroup from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of OriginGroup if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the OriginGroup. + */ + public static OriginGroup fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + OriginGroup deserializedOriginGroup = new OriginGroup(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("failoverCriteria".equals(fieldName)) { + deserializedOriginGroup.failoverCriteria = OriginGroupFailoverCriteria.fromJson(reader); + } else if ("id".equals(fieldName)) { + deserializedOriginGroup.id = reader.getString(); + } else if ("members".equals(fieldName)) { + deserializedOriginGroup.members = OriginGroupMembers.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedOriginGroup; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/OriginGroupFailoverCriteria.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/OriginGroupFailoverCriteria.java new file mode 100644 index 000000000000..89425f1b9c77 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/OriginGroupFailoverCriteria.java @@ -0,0 +1,102 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of OriginGroupFailoverCriteria. + */ +@Fluent +public final class OriginGroupFailoverCriteria implements JsonSerializable { + /* + * The status codes that, when returned from the primary origin, will trigger CloudFront to failover to the second + * origin. A complex data type for the status codes that you specify that, when returned by a primary origin, + * trigger CloudFront to failover to a second origin. + */ + private StatusCodes statusCodes; + + /** + * Creates an instance of OriginGroupFailoverCriteria class. + */ + public OriginGroupFailoverCriteria() { + } + + /** + * Get the statusCodes property: The status codes that, when returned from the primary origin, will trigger + * CloudFront to failover to the second origin. A complex data type for the status codes that you specify that, when + * returned by a primary origin, trigger CloudFront to failover to a second origin. + * + * @return the statusCodes value. + */ + public StatusCodes statusCodes() { + return this.statusCodes; + } + + /** + * Set the statusCodes property: The status codes that, when returned from the primary origin, will trigger + * CloudFront to failover to the second origin. A complex data type for the status codes that you specify that, when + * returned by a primary origin, trigger CloudFront to failover to a second origin. + * + * @param statusCodes the statusCodes value to set. + * @return the OriginGroupFailoverCriteria object itself. + */ + public OriginGroupFailoverCriteria withStatusCodes(StatusCodes statusCodes) { + this.statusCodes = statusCodes; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (statusCodes() != null) { + statusCodes().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("statusCodes", this.statusCodes); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of OriginGroupFailoverCriteria from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of OriginGroupFailoverCriteria if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the OriginGroupFailoverCriteria. + */ + public static OriginGroupFailoverCriteria fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + OriginGroupFailoverCriteria deserializedOriginGroupFailoverCriteria = new OriginGroupFailoverCriteria(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("statusCodes".equals(fieldName)) { + deserializedOriginGroupFailoverCriteria.statusCodes = StatusCodes.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedOriginGroupFailoverCriteria; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/OriginGroupMember.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/OriginGroupMember.java new file mode 100644 index 000000000000..9081a345efa0 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/OriginGroupMember.java @@ -0,0 +1,93 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of OriginGroupMember. + */ +@Fluent +public final class OriginGroupMember implements JsonSerializable { + /* + * The ID for an origin in an origin group. + */ + private String originId; + + /** + * Creates an instance of OriginGroupMember class. + */ + public OriginGroupMember() { + } + + /** + * Get the originId property: The ID for an origin in an origin group. + * + * @return the originId value. + */ + public String originId() { + return this.originId; + } + + /** + * Set the originId property: The ID for an origin in an origin group. + * + * @param originId the originId value to set. + * @return the OriginGroupMember object itself. + */ + public OriginGroupMember withOriginId(String originId) { + this.originId = originId; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("originId", this.originId); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of OriginGroupMember from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of OriginGroupMember if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the OriginGroupMember. + */ + public static OriginGroupMember fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + OriginGroupMember deserializedOriginGroupMember = new OriginGroupMember(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("originId".equals(fieldName)) { + deserializedOriginGroupMember.originId = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedOriginGroupMember; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/OriginGroupMembers.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/OriginGroupMembers.java new file mode 100644 index 000000000000..0906719c1a18 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/OriginGroupMembers.java @@ -0,0 +1,126 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Definition of OriginGroupMembers. + */ +@Fluent +public final class OriginGroupMembers implements JsonSerializable { + /* + * Items (origins) in an origin group. + */ + private List items; + + /* + * The number of origins in an origin group. + */ + private Integer quantity; + + /** + * Creates an instance of OriginGroupMembers class. + */ + public OriginGroupMembers() { + } + + /** + * Get the items property: Items (origins) in an origin group. + * + * @return the items value. + */ + public List items() { + return this.items; + } + + /** + * Set the items property: Items (origins) in an origin group. + * + * @param items the items value to set. + * @return the OriginGroupMembers object itself. + */ + public OriginGroupMembers withItems(List items) { + this.items = items; + return this; + } + + /** + * Get the quantity property: The number of origins in an origin group. + * + * @return the quantity value. + */ + public Integer quantity() { + return this.quantity; + } + + /** + * Set the quantity property: The number of origins in an origin group. + * + * @param quantity the quantity value to set. + * @return the OriginGroupMembers object itself. + */ + public OriginGroupMembers withQuantity(Integer quantity) { + this.quantity = quantity; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (items() != null) { + items().forEach(e -> e.validate()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("items", this.items, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeNumberField("quantity", this.quantity); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of OriginGroupMembers from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of OriginGroupMembers if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the OriginGroupMembers. + */ + public static OriginGroupMembers fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + OriginGroupMembers deserializedOriginGroupMembers = new OriginGroupMembers(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("items".equals(fieldName)) { + List items = reader.readArray(reader1 -> OriginGroupMember.fromJson(reader1)); + deserializedOriginGroupMembers.items = items; + } else if ("quantity".equals(fieldName)) { + deserializedOriginGroupMembers.quantity = reader.getNullable(JsonReader::getInt); + } else { + reader.skipChildren(); + } + } + + return deserializedOriginGroupMembers; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/OriginGroups.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/OriginGroups.java new file mode 100644 index 000000000000..f09dc2f0e73b --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/OriginGroups.java @@ -0,0 +1,126 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Definition of OriginGroups. + */ +@Fluent +public final class OriginGroups implements JsonSerializable { + /* + * The items (origin groups) in a distribution. + */ + private List items; + + /* + * The number of origin groups. + */ + private Integer quantity; + + /** + * Creates an instance of OriginGroups class. + */ + public OriginGroups() { + } + + /** + * Get the items property: The items (origin groups) in a distribution. + * + * @return the items value. + */ + public List items() { + return this.items; + } + + /** + * Set the items property: The items (origin groups) in a distribution. + * + * @param items the items value to set. + * @return the OriginGroups object itself. + */ + public OriginGroups withItems(List items) { + this.items = items; + return this; + } + + /** + * Get the quantity property: The number of origin groups. + * + * @return the quantity value. + */ + public Integer quantity() { + return this.quantity; + } + + /** + * Set the quantity property: The number of origin groups. + * + * @param quantity the quantity value to set. + * @return the OriginGroups object itself. + */ + public OriginGroups withQuantity(Integer quantity) { + this.quantity = quantity; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (items() != null) { + items().forEach(e -> e.validate()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("items", this.items, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeNumberField("quantity", this.quantity); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of OriginGroups from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of OriginGroups if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the OriginGroups. + */ + public static OriginGroups fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + OriginGroups deserializedOriginGroups = new OriginGroups(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("items".equals(fieldName)) { + List items = reader.readArray(reader1 -> OriginGroup.fromJson(reader1)); + deserializedOriginGroups.items = items; + } else if ("quantity".equals(fieldName)) { + deserializedOriginGroups.quantity = reader.getNullable(JsonReader::getInt); + } else { + reader.skipChildren(); + } + } + + return deserializedOriginGroups; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/OriginShield.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/OriginShield.java new file mode 100644 index 000000000000..33e42b2e63e3 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/OriginShield.java @@ -0,0 +1,145 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of OriginShield. + */ +@Fluent +public final class OriginShield implements JsonSerializable { + /* + * A flag that specifies whether Origin Shield is enabled. When it's enabled, CloudFront routes all requests through + * Origin Shield, which can help protect your origin. When it's disabled, CloudFront might send requests directly to + * your origin from multiple edge locations or regional edge caches. + */ + private Boolean enabled; + + /* + * The AWS-Region for Origin Shield. Specify the AWS-Region that has the lowest latency to your origin. To specify a + * region, use the region code, not the region name. For example, specify the US East (Ohio) region as + * ``us-east-2``. When you enable CloudFront Origin Shield, you must specify the AWS-Region for Origin Shield. For + * the list of AWS-Regions that you can specify, and for help choosing the best Region for your origin, see + * [Choosing the for Origin + * Shield](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/origin-shield.html#choose-origin- + * shield-region) in the *Amazon CloudFront Developer Guide*. + */ + private String originShieldRegion; + + /** + * Creates an instance of OriginShield class. + */ + public OriginShield() { + } + + /** + * Get the enabled property: A flag that specifies whether Origin Shield is enabled. When it's enabled, CloudFront + * routes all requests through Origin Shield, which can help protect your origin. When it's disabled, CloudFront + * might send requests directly to your origin from multiple edge locations or regional edge caches. + * + * @return the enabled value. + */ + public Boolean enabled() { + return this.enabled; + } + + /** + * Set the enabled property: A flag that specifies whether Origin Shield is enabled. When it's enabled, CloudFront + * routes all requests through Origin Shield, which can help protect your origin. When it's disabled, CloudFront + * might send requests directly to your origin from multiple edge locations or regional edge caches. + * + * @param enabled the enabled value to set. + * @return the OriginShield object itself. + */ + public OriginShield withEnabled(Boolean enabled) { + this.enabled = enabled; + return this; + } + + /** + * Get the originShieldRegion property: The AWS-Region for Origin Shield. Specify the AWS-Region that has the lowest + * latency to your origin. To specify a region, use the region code, not the region name. For example, specify the + * US East (Ohio) region as ``us-east-2``. When you enable CloudFront Origin Shield, you must specify the AWS-Region + * for Origin Shield. For the list of AWS-Regions that you can specify, and for help choosing the best Region for + * your origin, see [Choosing the for Origin + * Shield](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/origin-shield.html#choose-origin-shield-region) + * in the *Amazon CloudFront Developer Guide*. + * + * @return the originShieldRegion value. + */ + public String originShieldRegion() { + return this.originShieldRegion; + } + + /** + * Set the originShieldRegion property: The AWS-Region for Origin Shield. Specify the AWS-Region that has the lowest + * latency to your origin. To specify a region, use the region code, not the region name. For example, specify the + * US East (Ohio) region as ``us-east-2``. When you enable CloudFront Origin Shield, you must specify the AWS-Region + * for Origin Shield. For the list of AWS-Regions that you can specify, and for help choosing the best Region for + * your origin, see [Choosing the for Origin + * Shield](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/origin-shield.html#choose-origin-shield-region) + * in the *Amazon CloudFront Developer Guide*. + * + * @param originShieldRegion the originShieldRegion value to set. + * @return the OriginShield object itself. + */ + public OriginShield withOriginShieldRegion(String originShieldRegion) { + this.originShieldRegion = originShieldRegion; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeBooleanField("enabled", this.enabled); + jsonWriter.writeStringField("originShieldRegion", this.originShieldRegion); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of OriginShield from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of OriginShield if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the OriginShield. + */ + public static OriginShield fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + OriginShield deserializedOriginShield = new OriginShield(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("enabled".equals(fieldName)) { + deserializedOriginShield.enabled = reader.getNullable(JsonReader::getBoolean); + } else if ("originShieldRegion".equals(fieldName)) { + deserializedOriginShield.originShieldRegion = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedOriginShield; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/OutpostConfigResponse.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/OutpostConfigResponse.java new file mode 100644 index 000000000000..1a4bd4408b5d --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/OutpostConfigResponse.java @@ -0,0 +1,171 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Definition of OutpostConfigResponse. + */ +@Fluent +public final class OutpostConfigResponse implements JsonSerializable { + /* + *

The Amazon EC2 instance type used for the control plane. The instance type is the same for all control plane + * instances.

+ */ + private String controlPlaneInstanceType; + + /* + *

An object representing the placement configuration for all the control plane instances of your local Amazon + * EKS cluster on an Amazon Web Services Outpost. For more information, see Capacity + * considerations in the Amazon EKS User Guide.

+ */ + private ControlPlanePlacementResponse controlPlanePlacement; + + /* + *

The ARN of the Outpost that you specified for use with your local Amazon EKS cluster on Outposts.

+ */ + private List outpostArns; + + /** + * Creates an instance of OutpostConfigResponse class. + */ + public OutpostConfigResponse() { + } + + /** + * Get the controlPlaneInstanceType property: <p>The Amazon EC2 instance type used for the control plane. The + * instance type is the same for all control plane instances.</p>. + * + * @return the controlPlaneInstanceType value. + */ + public String controlPlaneInstanceType() { + return this.controlPlaneInstanceType; + } + + /** + * Set the controlPlaneInstanceType property: <p>The Amazon EC2 instance type used for the control plane. The + * instance type is the same for all control plane instances.</p>. + * + * @param controlPlaneInstanceType the controlPlaneInstanceType value to set. + * @return the OutpostConfigResponse object itself. + */ + public OutpostConfigResponse withControlPlaneInstanceType(String controlPlaneInstanceType) { + this.controlPlaneInstanceType = controlPlaneInstanceType; + return this; + } + + /** + * Get the controlPlanePlacement property: <p>An object representing the placement configuration for all the + * control plane instances of your local Amazon EKS cluster on an Amazon Web Services Outpost. For more information, + * see <a + * href='https://docs.aws.amazon.com/eks/latest/userguide/eks-outposts-capacity-considerations.html'>Capacity + * considerations</a> in the <i>Amazon EKS User Guide</i>.</p>. + * + * @return the controlPlanePlacement value. + */ + public ControlPlanePlacementResponse controlPlanePlacement() { + return this.controlPlanePlacement; + } + + /** + * Set the controlPlanePlacement property: <p>An object representing the placement configuration for all the + * control plane instances of your local Amazon EKS cluster on an Amazon Web Services Outpost. For more information, + * see <a + * href='https://docs.aws.amazon.com/eks/latest/userguide/eks-outposts-capacity-considerations.html'>Capacity + * considerations</a> in the <i>Amazon EKS User Guide</i>.</p>. + * + * @param controlPlanePlacement the controlPlanePlacement value to set. + * @return the OutpostConfigResponse object itself. + */ + public OutpostConfigResponse withControlPlanePlacement(ControlPlanePlacementResponse controlPlanePlacement) { + this.controlPlanePlacement = controlPlanePlacement; + return this; + } + + /** + * Get the outpostArns property: <p>The ARN of the Outpost that you specified for use with your local Amazon + * EKS cluster on Outposts.</p>. + * + * @return the outpostArns value. + */ + public List outpostArns() { + return this.outpostArns; + } + + /** + * Set the outpostArns property: <p>The ARN of the Outpost that you specified for use with your local Amazon + * EKS cluster on Outposts.</p>. + * + * @param outpostArns the outpostArns value to set. + * @return the OutpostConfigResponse object itself. + */ + public OutpostConfigResponse withOutpostArns(List outpostArns) { + this.outpostArns = outpostArns; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (controlPlanePlacement() != null) { + controlPlanePlacement().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("controlPlaneInstanceType", this.controlPlaneInstanceType); + jsonWriter.writeJsonField("controlPlanePlacement", this.controlPlanePlacement); + jsonWriter.writeArrayField("outpostArns", this.outpostArns, (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of OutpostConfigResponse from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of OutpostConfigResponse if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the OutpostConfigResponse. + */ + public static OutpostConfigResponse fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + OutpostConfigResponse deserializedOutpostConfigResponse = new OutpostConfigResponse(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("controlPlaneInstanceType".equals(fieldName)) { + deserializedOutpostConfigResponse.controlPlaneInstanceType = reader.getString(); + } else if ("controlPlanePlacement".equals(fieldName)) { + deserializedOutpostConfigResponse.controlPlanePlacement + = ControlPlanePlacementResponse.fromJson(reader); + } else if ("outpostArns".equals(fieldName)) { + List outpostArns = reader.readArray(reader1 -> reader1.getString()); + deserializedOutpostConfigResponse.outpostArns = outpostArns; + } else { + reader.skipChildren(); + } + } + + return deserializedOutpostConfigResponse; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/Output.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/Output.java new file mode 100644 index 000000000000..82638e7507f1 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/Output.java @@ -0,0 +1,177 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of Output. + */ +@Fluent +public final class Output implements JsonSerializable { + /* + * Property description + */ + private String description; + + /* + * Property exportName + */ + private String exportName; + + /* + * Property outputKey + */ + private String outputKey; + + /* + * Property outputValue + */ + private String outputValue; + + /** + * Creates an instance of Output class. + */ + public Output() { + } + + /** + * Get the description property: Property description. + * + * @return the description value. + */ + public String description() { + return this.description; + } + + /** + * Set the description property: Property description. + * + * @param description the description value to set. + * @return the Output object itself. + */ + public Output withDescription(String description) { + this.description = description; + return this; + } + + /** + * Get the exportName property: Property exportName. + * + * @return the exportName value. + */ + public String exportName() { + return this.exportName; + } + + /** + * Set the exportName property: Property exportName. + * + * @param exportName the exportName value to set. + * @return the Output object itself. + */ + public Output withExportName(String exportName) { + this.exportName = exportName; + return this; + } + + /** + * Get the outputKey property: Property outputKey. + * + * @return the outputKey value. + */ + public String outputKey() { + return this.outputKey; + } + + /** + * Set the outputKey property: Property outputKey. + * + * @param outputKey the outputKey value to set. + * @return the Output object itself. + */ + public Output withOutputKey(String outputKey) { + this.outputKey = outputKey; + return this; + } + + /** + * Get the outputValue property: Property outputValue. + * + * @return the outputValue value. + */ + public String outputValue() { + return this.outputValue; + } + + /** + * Set the outputValue property: Property outputValue. + * + * @param outputValue the outputValue value to set. + * @return the Output object itself. + */ + public Output withOutputValue(String outputValue) { + this.outputValue = outputValue; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("description", this.description); + jsonWriter.writeStringField("exportName", this.exportName); + jsonWriter.writeStringField("outputKey", this.outputKey); + jsonWriter.writeStringField("outputValue", this.outputValue); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of Output from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of Output if the JsonReader was pointing to an instance of it, or null if it was pointing to + * JSON null. + * @throws IOException If an error occurs while reading the Output. + */ + public static Output fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + Output deserializedOutput = new Output(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("description".equals(fieldName)) { + deserializedOutput.description = reader.getString(); + } else if ("exportName".equals(fieldName)) { + deserializedOutput.exportName = reader.getString(); + } else if ("outputKey".equals(fieldName)) { + deserializedOutput.outputKey = reader.getString(); + } else if ("outputValue".equals(fieldName)) { + deserializedOutput.outputValue = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedOutput; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/OwnershipControls.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/OwnershipControls.java new file mode 100644 index 000000000000..07d54dacf7f5 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/OwnershipControls.java @@ -0,0 +1,99 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Definition of OwnershipControls. + */ +@Fluent +public final class OwnershipControls implements JsonSerializable { + /* + * Specifies the container element for Object Ownership rules. + */ + private List rules; + + /** + * Creates an instance of OwnershipControls class. + */ + public OwnershipControls() { + } + + /** + * Get the rules property: Specifies the container element for Object Ownership rules. + * + * @return the rules value. + */ + public List rules() { + return this.rules; + } + + /** + * Set the rules property: Specifies the container element for Object Ownership rules. + * + * @param rules the rules value to set. + * @return the OwnershipControls object itself. + */ + public OwnershipControls withRules(List rules) { + this.rules = rules; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (rules() != null) { + rules().forEach(e -> e.validate()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("rules", this.rules, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of OwnershipControls from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of OwnershipControls if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the OwnershipControls. + */ + public static OwnershipControls fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + OwnershipControls deserializedOwnershipControls = new OwnershipControls(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("rules".equals(fieldName)) { + List rules + = reader.readArray(reader1 -> OwnershipControlsRule.fromJson(reader1)); + deserializedOwnershipControls.rules = rules; + } else { + reader.skipChildren(); + } + } + + return deserializedOwnershipControls; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/OwnershipControlsRule.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/OwnershipControlsRule.java new file mode 100644 index 000000000000..1cd73a42aad3 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/OwnershipControlsRule.java @@ -0,0 +1,95 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of OwnershipControlsRule. + */ +@Fluent +public final class OwnershipControlsRule implements JsonSerializable { + /* + * Specifies an object ownership rule. + */ + private OwnershipControlsRuleObjectOwnership objectOwnership; + + /** + * Creates an instance of OwnershipControlsRule class. + */ + public OwnershipControlsRule() { + } + + /** + * Get the objectOwnership property: Specifies an object ownership rule. + * + * @return the objectOwnership value. + */ + public OwnershipControlsRuleObjectOwnership objectOwnership() { + return this.objectOwnership; + } + + /** + * Set the objectOwnership property: Specifies an object ownership rule. + * + * @param objectOwnership the objectOwnership value to set. + * @return the OwnershipControlsRule object itself. + */ + public OwnershipControlsRule withObjectOwnership(OwnershipControlsRuleObjectOwnership objectOwnership) { + this.objectOwnership = objectOwnership; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("objectOwnership", + this.objectOwnership == null ? null : this.objectOwnership.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of OwnershipControlsRule from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of OwnershipControlsRule if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the OwnershipControlsRule. + */ + public static OwnershipControlsRule fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + OwnershipControlsRule deserializedOwnershipControlsRule = new OwnershipControlsRule(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("objectOwnership".equals(fieldName)) { + deserializedOwnershipControlsRule.objectOwnership + = OwnershipControlsRuleObjectOwnership.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedOwnershipControlsRule; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/OwnershipControlsRuleObjectOwnership.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/OwnershipControlsRuleObjectOwnership.java new file mode 100644 index 000000000000..ebbc9b81d040 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/OwnershipControlsRuleObjectOwnership.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.awsconnector.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * OwnershipControlsRuleObjectOwnership enum. + */ +public final class OwnershipControlsRuleObjectOwnership + extends ExpandableStringEnum { + /** + * Static value BucketOwnerEnforced for OwnershipControlsRuleObjectOwnership. + */ + public static final OwnershipControlsRuleObjectOwnership BUCKET_OWNER_ENFORCED = fromString("BucketOwnerEnforced"); + + /** + * Static value BucketOwnerPreferred for OwnershipControlsRuleObjectOwnership. + */ + public static final OwnershipControlsRuleObjectOwnership BUCKET_OWNER_PREFERRED + = fromString("BucketOwnerPreferred"); + + /** + * Static value ObjectWriter for OwnershipControlsRuleObjectOwnership. + */ + public static final OwnershipControlsRuleObjectOwnership OBJECT_WRITER = fromString("ObjectWriter"); + + /** + * Creates a new instance of OwnershipControlsRuleObjectOwnership value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public OwnershipControlsRuleObjectOwnership() { + } + + /** + * Creates or finds a OwnershipControlsRuleObjectOwnership from its string representation. + * + * @param name a name to look for. + * @return the corresponding OwnershipControlsRuleObjectOwnership. + */ + public static OwnershipControlsRuleObjectOwnership fromString(String name) { + return fromString(name, OwnershipControlsRuleObjectOwnership.class); + } + + /** + * Gets known OwnershipControlsRuleObjectOwnership values. + * + * @return known OwnershipControlsRuleObjectOwnership values. + */ + public static Collection values() { + return values(OwnershipControlsRuleObjectOwnership.class); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/PackageType.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/PackageType.java new file mode 100644 index 000000000000..641d5ff48d2b --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/PackageType.java @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * PackageType enum. + */ +public final class PackageType extends ExpandableStringEnum { + /** + * Static value Image for PackageType. + */ + public static final PackageType IMAGE = fromString("Image"); + + /** + * Static value Zip for PackageType. + */ + public static final PackageType ZIP = fromString("Zip"); + + /** + * Creates a new instance of PackageType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public PackageType() { + } + + /** + * Creates or finds a PackageType from its string representation. + * + * @param name a name to look for. + * @return the corresponding PackageType. + */ + public static PackageType fromString(String name) { + return fromString(name, PackageType.class); + } + + /** + * Gets known PackageType values. + * + * @return known PackageType values. + */ + public static Collection values() { + return values(PackageType.class); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/Parameter.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/Parameter.java new file mode 100644 index 000000000000..b74558e678bf --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/Parameter.java @@ -0,0 +1,124 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of Parameter. + */ +@Fluent +public final class Parameter implements JsonSerializable { + /* + * The key associated with the parameter. If you don't specify a key and value for a particular parameter, AWS + * CloudFormation uses the default value that is specified in your template. + */ + private String parameterKey; + + /* + * The input value associated with the parameter. + */ + private String parameterValue; + + /** + * Creates an instance of Parameter class. + */ + public Parameter() { + } + + /** + * Get the parameterKey property: The key associated with the parameter. If you don't specify a key and value for a + * particular parameter, AWS CloudFormation uses the default value that is specified in your template. + * + * @return the parameterKey value. + */ + public String parameterKey() { + return this.parameterKey; + } + + /** + * Set the parameterKey property: The key associated with the parameter. If you don't specify a key and value for a + * particular parameter, AWS CloudFormation uses the default value that is specified in your template. + * + * @param parameterKey the parameterKey value to set. + * @return the Parameter object itself. + */ + public Parameter withParameterKey(String parameterKey) { + this.parameterKey = parameterKey; + return this; + } + + /** + * Get the parameterValue property: The input value associated with the parameter. + * + * @return the parameterValue value. + */ + public String parameterValue() { + return this.parameterValue; + } + + /** + * Set the parameterValue property: The input value associated with the parameter. + * + * @param parameterValue the parameterValue value to set. + * @return the Parameter object itself. + */ + public Parameter withParameterValue(String parameterValue) { + this.parameterValue = parameterValue; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("parameterKey", this.parameterKey); + jsonWriter.writeStringField("parameterValue", this.parameterValue); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of Parameter from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of Parameter if the JsonReader was pointing to an instance of it, or null if it was pointing + * to JSON null. + * @throws IOException If an error occurs while reading the Parameter. + */ + public static Parameter fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + Parameter deserializedParameter = new Parameter(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("parameterKey".equals(fieldName)) { + deserializedParameter.parameterKey = reader.getString(); + } else if ("parameterValue".equals(fieldName)) { + deserializedParameter.parameterValue = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedParameter; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ParameterAutoGenerated.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ParameterAutoGenerated.java new file mode 100644 index 000000000000..78a7877a8760 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ParameterAutoGenerated.java @@ -0,0 +1,124 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of Parameter. + */ +@Fluent +public final class ParameterAutoGenerated implements JsonSerializable { + /* + * The name of the parameter. + */ + private String parameterName; + + /* + * The value of the parameter. If `ParameterName` is `wlm_json_configuration`, then the maximum size of + * `ParameterValue` is 8000 characters. + */ + private String parameterValue; + + /** + * Creates an instance of ParameterAutoGenerated class. + */ + public ParameterAutoGenerated() { + } + + /** + * Get the parameterName property: The name of the parameter. + * + * @return the parameterName value. + */ + public String parameterName() { + return this.parameterName; + } + + /** + * Set the parameterName property: The name of the parameter. + * + * @param parameterName the parameterName value to set. + * @return the ParameterAutoGenerated object itself. + */ + public ParameterAutoGenerated withParameterName(String parameterName) { + this.parameterName = parameterName; + return this; + } + + /** + * Get the parameterValue property: The value of the parameter. If `ParameterName` is `wlm_json_configuration`, then + * the maximum size of `ParameterValue` is 8000 characters. + * + * @return the parameterValue value. + */ + public String parameterValue() { + return this.parameterValue; + } + + /** + * Set the parameterValue property: The value of the parameter. If `ParameterName` is `wlm_json_configuration`, then + * the maximum size of `ParameterValue` is 8000 characters. + * + * @param parameterValue the parameterValue value to set. + * @return the ParameterAutoGenerated object itself. + */ + public ParameterAutoGenerated withParameterValue(String parameterValue) { + this.parameterValue = parameterValue; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("parameterName", this.parameterName); + jsonWriter.writeStringField("parameterValue", this.parameterValue); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ParameterAutoGenerated from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ParameterAutoGenerated if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the ParameterAutoGenerated. + */ + public static ParameterAutoGenerated fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ParameterAutoGenerated deserializedParameterAutoGenerated = new ParameterAutoGenerated(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("parameterName".equals(fieldName)) { + deserializedParameterAutoGenerated.parameterName = reader.getString(); + } else if ("parameterValue".equals(fieldName)) { + deserializedParameterAutoGenerated.parameterValue = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedParameterAutoGenerated; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ParameterGroupStatus.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ParameterGroupStatus.java new file mode 100644 index 000000000000..eb3997580fff --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ParameterGroupStatus.java @@ -0,0 +1,152 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Definition of ParameterGroupStatus. + */ +@Fluent +public final class ParameterGroupStatus implements JsonSerializable { + /* + *

The node IDs of one or more nodes to be rebooted.

+ */ + private List nodeIdsToReboot; + + /* + *

The status of parameter updates.

+ */ + private String parameterApplyStatus; + + /* + *

The name of the parameter group.

+ */ + private String parameterGroupName; + + /** + * Creates an instance of ParameterGroupStatus class. + */ + public ParameterGroupStatus() { + } + + /** + * Get the nodeIdsToReboot property: <p>The node IDs of one or more nodes to be rebooted.</p>. + * + * @return the nodeIdsToReboot value. + */ + public List nodeIdsToReboot() { + return this.nodeIdsToReboot; + } + + /** + * Set the nodeIdsToReboot property: <p>The node IDs of one or more nodes to be rebooted.</p>. + * + * @param nodeIdsToReboot the nodeIdsToReboot value to set. + * @return the ParameterGroupStatus object itself. + */ + public ParameterGroupStatus withNodeIdsToReboot(List nodeIdsToReboot) { + this.nodeIdsToReboot = nodeIdsToReboot; + return this; + } + + /** + * Get the parameterApplyStatus property: <p>The status of parameter updates. </p>. + * + * @return the parameterApplyStatus value. + */ + public String parameterApplyStatus() { + return this.parameterApplyStatus; + } + + /** + * Set the parameterApplyStatus property: <p>The status of parameter updates. </p>. + * + * @param parameterApplyStatus the parameterApplyStatus value to set. + * @return the ParameterGroupStatus object itself. + */ + public ParameterGroupStatus withParameterApplyStatus(String parameterApplyStatus) { + this.parameterApplyStatus = parameterApplyStatus; + return this; + } + + /** + * Get the parameterGroupName property: <p>The name of the parameter group.</p>. + * + * @return the parameterGroupName value. + */ + public String parameterGroupName() { + return this.parameterGroupName; + } + + /** + * Set the parameterGroupName property: <p>The name of the parameter group.</p>. + * + * @param parameterGroupName the parameterGroupName value to set. + * @return the ParameterGroupStatus object itself. + */ + public ParameterGroupStatus withParameterGroupName(String parameterGroupName) { + this.parameterGroupName = parameterGroupName; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("nodeIdsToReboot", this.nodeIdsToReboot, + (writer, element) -> writer.writeString(element)); + jsonWriter.writeStringField("parameterApplyStatus", this.parameterApplyStatus); + jsonWriter.writeStringField("parameterGroupName", this.parameterGroupName); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ParameterGroupStatus from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ParameterGroupStatus if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the ParameterGroupStatus. + */ + public static ParameterGroupStatus fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ParameterGroupStatus deserializedParameterGroupStatus = new ParameterGroupStatus(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("nodeIdsToReboot".equals(fieldName)) { + List nodeIdsToReboot = reader.readArray(reader1 -> reader1.getString()); + deserializedParameterGroupStatus.nodeIdsToReboot = nodeIdsToReboot; + } else if ("parameterApplyStatus".equals(fieldName)) { + deserializedParameterGroupStatus.parameterApplyStatus = reader.getString(); + } else if ("parameterGroupName".equals(fieldName)) { + deserializedParameterGroupStatus.parameterGroupName = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedParameterGroupStatus; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/PartitionedPrefix.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/PartitionedPrefix.java new file mode 100644 index 000000000000..997c9828e283 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/PartitionedPrefix.java @@ -0,0 +1,98 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of PartitionedPrefix. + */ +@Fluent +public final class PartitionedPrefix implements JsonSerializable { + /* + * Specifies the partition date source for the partitioned prefix. PartitionDateSource can be EventTime or + * DeliveryTime. + */ + private PartitionedPrefixPartitionDateSource partitionDateSource; + + /** + * Creates an instance of PartitionedPrefix class. + */ + public PartitionedPrefix() { + } + + /** + * Get the partitionDateSource property: Specifies the partition date source for the partitioned prefix. + * PartitionDateSource can be EventTime or DeliveryTime. + * + * @return the partitionDateSource value. + */ + public PartitionedPrefixPartitionDateSource partitionDateSource() { + return this.partitionDateSource; + } + + /** + * Set the partitionDateSource property: Specifies the partition date source for the partitioned prefix. + * PartitionDateSource can be EventTime or DeliveryTime. + * + * @param partitionDateSource the partitionDateSource value to set. + * @return the PartitionedPrefix object itself. + */ + public PartitionedPrefix withPartitionDateSource(PartitionedPrefixPartitionDateSource partitionDateSource) { + this.partitionDateSource = partitionDateSource; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("partitionDateSource", + this.partitionDateSource == null ? null : this.partitionDateSource.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of PartitionedPrefix from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of PartitionedPrefix if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the PartitionedPrefix. + */ + public static PartitionedPrefix fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + PartitionedPrefix deserializedPartitionedPrefix = new PartitionedPrefix(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("partitionDateSource".equals(fieldName)) { + deserializedPartitionedPrefix.partitionDateSource + = PartitionedPrefixPartitionDateSource.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedPartitionedPrefix; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/PartitionedPrefixPartitionDateSource.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/PartitionedPrefixPartitionDateSource.java new file mode 100644 index 000000000000..c538032f3ad7 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/PartitionedPrefixPartitionDateSource.java @@ -0,0 +1,52 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * PartitionedPrefixPartitionDateSource enum. + */ +public final class PartitionedPrefixPartitionDateSource + extends ExpandableStringEnum { + /** + * Static value DeliveryTime for PartitionedPrefixPartitionDateSource. + */ + public static final PartitionedPrefixPartitionDateSource DELIVERY_TIME = fromString("DeliveryTime"); + + /** + * Static value EventTime for PartitionedPrefixPartitionDateSource. + */ + public static final PartitionedPrefixPartitionDateSource EVENT_TIME = fromString("EventTime"); + + /** + * Creates a new instance of PartitionedPrefixPartitionDateSource value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public PartitionedPrefixPartitionDateSource() { + } + + /** + * Creates or finds a PartitionedPrefixPartitionDateSource from its string representation. + * + * @param name a name to look for. + * @return the corresponding PartitionedPrefixPartitionDateSource. + */ + public static PartitionedPrefixPartitionDateSource fromString(String name) { + return fromString(name, PartitionedPrefixPartitionDateSource.class); + } + + /** + * Gets known PartitionedPrefixPartitionDateSource values. + * + * @return known PartitionedPrefixPartitionDateSource values. + */ + public static Collection values() { + return values(PartitionedPrefixPartitionDateSource.class); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/PermissionModel.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/PermissionModel.java new file mode 100644 index 000000000000..22113a09ea32 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/PermissionModel.java @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * PermissionModel enum. + */ +public final class PermissionModel extends ExpandableStringEnum { + /** + * Static value SELF_MANAGED for PermissionModel. + */ + public static final PermissionModel SELF_MANAGED = fromString("SELF_MANAGED"); + + /** + * Static value SERVICE_MANAGED for PermissionModel. + */ + public static final PermissionModel SERVICE_MANAGED = fromString("SERVICE_MANAGED"); + + /** + * Creates a new instance of PermissionModel value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public PermissionModel() { + } + + /** + * Creates or finds a PermissionModel from its string representation. + * + * @param name a name to look for. + * @return the corresponding PermissionModel. + */ + public static PermissionModel fromString(String name) { + return fromString(name, PermissionModel.class); + } + + /** + * Gets known PermissionModel values. + * + * @return known PermissionModel values. + */ + public static Collection values() { + return values(PermissionModel.class); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/PingStatus.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/PingStatus.java new file mode 100644 index 000000000000..c574e7404329 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/PingStatus.java @@ -0,0 +1,56 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * PingStatus enum. + */ +public final class PingStatus extends ExpandableStringEnum { + /** + * Static value ConnectionLost for PingStatus. + */ + public static final PingStatus CONNECTION_LOST = fromString("ConnectionLost"); + + /** + * Static value Inactive for PingStatus. + */ + public static final PingStatus INACTIVE = fromString("Inactive"); + + /** + * Static value Online for PingStatus. + */ + public static final PingStatus ONLINE = fromString("Online"); + + /** + * Creates a new instance of PingStatus value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public PingStatus() { + } + + /** + * Creates or finds a PingStatus from its string representation. + * + * @param name a name to look for. + * @return the corresponding PingStatus. + */ + public static PingStatus fromString(String name) { + return fromString(name, PingStatus.class); + } + + /** + * Gets known PingStatus values. + * + * @return known PingStatus values. + */ + public static Collection values() { + return values(PingStatus.class); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/PingStatusEnumValue.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/PingStatusEnumValue.java new file mode 100644 index 000000000000..8781991b9328 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/PingStatusEnumValue.java @@ -0,0 +1,93 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of PingStatusEnumValue. + */ +@Fluent +public final class PingStatusEnumValue implements JsonSerializable { + /* + * Property value + */ + private PingStatus value; + + /** + * Creates an instance of PingStatusEnumValue class. + */ + public PingStatusEnumValue() { + } + + /** + * Get the value property: Property value. + * + * @return the value value. + */ + public PingStatus value() { + return this.value; + } + + /** + * Set the value property: Property value. + * + * @param value the value value to set. + * @return the PingStatusEnumValue object itself. + */ + public PingStatusEnumValue withValue(PingStatus value) { + this.value = value; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("value", this.value == null ? null : this.value.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of PingStatusEnumValue from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of PingStatusEnumValue if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the PingStatusEnumValue. + */ + public static PingStatusEnumValue fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + PingStatusEnumValue deserializedPingStatusEnumValue = new PingStatusEnumValue(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + deserializedPingStatusEnumValue.value = PingStatus.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedPingStatusEnumValue; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/Placement.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/Placement.java new file mode 100644 index 000000000000..badaa7a8a751 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/Placement.java @@ -0,0 +1,383 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of Placement. + */ +@Fluent +public final class Placement implements JsonSerializable { + /* + *

The affinity setting for the instance on the Dedicated Host.

This parameter is not supported for CreateFleet or ImportInstance.

+ */ + private String affinity; + + /* + *

The Availability Zone of the instance.

If not specified, an Availability Zone will be automatically + * chosen for you based on the load balancing criteria for the Region.

This parameter is not supported for CreateFleet.

+ */ + private String availabilityZone; + + /* + *

The ID of the placement group that the instance is in. If you specify GroupId, you can't specify + * GroupName.

+ */ + private String groupId; + + /* + *

The name of the placement group that the instance is in. If you specify GroupName, you can't + * specify GroupId.

+ */ + private String groupName; + + /* + *

The ID of the Dedicated Host on which the instance resides.

This parameter is not supported for CreateFleet or ImportInstance.

+ */ + private String hostId; + + /* + *

The ARN of the host resource group in which to launch the instances.

If you specify this parameter, + * either omit the Tenancy parameter or set it to host.

This parameter is not supported + * for CreateFleet.

+ */ + private String hostResourceGroupArn; + + /* + *

The number of the partition that the instance is in. Valid only if the placement group strategy is set to + * partition.

This parameter is not supported for CreateFleet.

+ */ + private Integer partitionNumber; + + /* + *

Reserved for future use.

+ */ + private String spreadDomain; + + /* + *

The tenancy of the instance. An instance with a tenancy of dedicated runs on single-tenant + * hardware.

This parameter is not supported for CreateFleet. The + * host tenancy is not supported for ImportInstance or for + * T3 instances that are configured for the unlimited CPU credit option.

+ */ + private TenancyEnumValue tenancy; + + /** + * Creates an instance of Placement class. + */ + public Placement() { + } + + /** + * Get the affinity property: <p>The affinity setting for the instance on the Dedicated Host.</p> + * <p>This parameter is not supported for <a + * href='https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_CreateFleet'>CreateFleet</a> or <a + * href='https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_ImportInstance.html'>ImportInstance</a>.</p>. + * + * @return the affinity value. + */ + public String affinity() { + return this.affinity; + } + + /** + * Set the affinity property: <p>The affinity setting for the instance on the Dedicated Host.</p> + * <p>This parameter is not supported for <a + * href='https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_CreateFleet'>CreateFleet</a> or <a + * href='https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_ImportInstance.html'>ImportInstance</a>.</p>. + * + * @param affinity the affinity value to set. + * @return the Placement object itself. + */ + public Placement withAffinity(String affinity) { + this.affinity = affinity; + return this; + } + + /** + * Get the availabilityZone property: <p>The Availability Zone of the instance.</p> <p>If not + * specified, an Availability Zone will be automatically chosen for you based on the load balancing criteria for the + * Region.</p> <p>This parameter is not supported for <a + * href='https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_CreateFleet'>CreateFleet</a>.</p>. + * + * @return the availabilityZone value. + */ + public String availabilityZone() { + return this.availabilityZone; + } + + /** + * Set the availabilityZone property: <p>The Availability Zone of the instance.</p> <p>If not + * specified, an Availability Zone will be automatically chosen for you based on the load balancing criteria for the + * Region.</p> <p>This parameter is not supported for <a + * href='https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_CreateFleet'>CreateFleet</a>.</p>. + * + * @param availabilityZone the availabilityZone value to set. + * @return the Placement object itself. + */ + public Placement withAvailabilityZone(String availabilityZone) { + this.availabilityZone = availabilityZone; + return this; + } + + /** + * Get the groupId property: <p>The ID of the placement group that the instance is in. If you specify + * <code>GroupId</code>, you can't specify <code>GroupName</code>.</p>. + * + * @return the groupId value. + */ + public String groupId() { + return this.groupId; + } + + /** + * Set the groupId property: <p>The ID of the placement group that the instance is in. If you specify + * <code>GroupId</code>, you can't specify <code>GroupName</code>.</p>. + * + * @param groupId the groupId value to set. + * @return the Placement object itself. + */ + public Placement withGroupId(String groupId) { + this.groupId = groupId; + return this; + } + + /** + * Get the groupName property: <p>The name of the placement group that the instance is in. If you specify + * <code>GroupName</code>, you can't specify <code>GroupId</code>.</p>. + * + * @return the groupName value. + */ + public String groupName() { + return this.groupName; + } + + /** + * Set the groupName property: <p>The name of the placement group that the instance is in. If you specify + * <code>GroupName</code>, you can't specify <code>GroupId</code>.</p>. + * + * @param groupName the groupName value to set. + * @return the Placement object itself. + */ + public Placement withGroupName(String groupName) { + this.groupName = groupName; + return this; + } + + /** + * Get the hostId property: <p>The ID of the Dedicated Host on which the instance resides.</p> + * <p>This parameter is not supported for <a + * href='https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_CreateFleet'>CreateFleet</a> or <a + * href='https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_ImportInstance.html'>ImportInstance</a>.</p>. + * + * @return the hostId value. + */ + public String hostId() { + return this.hostId; + } + + /** + * Set the hostId property: <p>The ID of the Dedicated Host on which the instance resides.</p> + * <p>This parameter is not supported for <a + * href='https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_CreateFleet'>CreateFleet</a> or <a + * href='https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_ImportInstance.html'>ImportInstance</a>.</p>. + * + * @param hostId the hostId value to set. + * @return the Placement object itself. + */ + public Placement withHostId(String hostId) { + this.hostId = hostId; + return this; + } + + /** + * Get the hostResourceGroupArn property: <p>The ARN of the host resource group in which to launch the + * instances.</p> <p>If you specify this parameter, either omit the <b>Tenancy</b> parameter + * or set it to <code>host</code>.</p> <p>This parameter is not supported for <a + * href='https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_CreateFleet'>CreateFleet</a>.</p>. + * + * @return the hostResourceGroupArn value. + */ + public String hostResourceGroupArn() { + return this.hostResourceGroupArn; + } + + /** + * Set the hostResourceGroupArn property: <p>The ARN of the host resource group in which to launch the + * instances.</p> <p>If you specify this parameter, either omit the <b>Tenancy</b> parameter + * or set it to <code>host</code>.</p> <p>This parameter is not supported for <a + * href='https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_CreateFleet'>CreateFleet</a>.</p>. + * + * @param hostResourceGroupArn the hostResourceGroupArn value to set. + * @return the Placement object itself. + */ + public Placement withHostResourceGroupArn(String hostResourceGroupArn) { + this.hostResourceGroupArn = hostResourceGroupArn; + return this; + } + + /** + * Get the partitionNumber property: <p>The number of the partition that the instance is in. Valid only if the + * placement group strategy is set to <code>partition</code>.</p> <p>This parameter is not + * supported for <a + * href='https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_CreateFleet'>CreateFleet</a>.</p>. + * + * @return the partitionNumber value. + */ + public Integer partitionNumber() { + return this.partitionNumber; + } + + /** + * Set the partitionNumber property: <p>The number of the partition that the instance is in. Valid only if the + * placement group strategy is set to <code>partition</code>.</p> <p>This parameter is not + * supported for <a + * href='https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_CreateFleet'>CreateFleet</a>.</p>. + * + * @param partitionNumber the partitionNumber value to set. + * @return the Placement object itself. + */ + public Placement withPartitionNumber(Integer partitionNumber) { + this.partitionNumber = partitionNumber; + return this; + } + + /** + * Get the spreadDomain property: <p>Reserved for future use.</p>. + * + * @return the spreadDomain value. + */ + public String spreadDomain() { + return this.spreadDomain; + } + + /** + * Set the spreadDomain property: <p>Reserved for future use.</p>. + * + * @param spreadDomain the spreadDomain value to set. + * @return the Placement object itself. + */ + public Placement withSpreadDomain(String spreadDomain) { + this.spreadDomain = spreadDomain; + return this; + } + + /** + * Get the tenancy property: <p>The tenancy of the instance. An instance with a tenancy of + * <code>dedicated</code> runs on single-tenant hardware.</p> <p>This parameter is not + * supported for <a + * href='https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_CreateFleet'>CreateFleet</a>. The + * <code>host</code> tenancy is not supported for <a + * href='https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_ImportInstance.html'>ImportInstance</a> + * or for T3 instances that are configured for the <code>unlimited</code> CPU credit option.</p>. + * + * @return the tenancy value. + */ + public TenancyEnumValue tenancy() { + return this.tenancy; + } + + /** + * Set the tenancy property: <p>The tenancy of the instance. An instance with a tenancy of + * <code>dedicated</code> runs on single-tenant hardware.</p> <p>This parameter is not + * supported for <a + * href='https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_CreateFleet'>CreateFleet</a>. The + * <code>host</code> tenancy is not supported for <a + * href='https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_ImportInstance.html'>ImportInstance</a> + * or for T3 instances that are configured for the <code>unlimited</code> CPU credit option.</p>. + * + * @param tenancy the tenancy value to set. + * @return the Placement object itself. + */ + public Placement withTenancy(TenancyEnumValue tenancy) { + this.tenancy = tenancy; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (tenancy() != null) { + tenancy().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("affinity", this.affinity); + jsonWriter.writeStringField("availabilityZone", this.availabilityZone); + jsonWriter.writeStringField("groupId", this.groupId); + jsonWriter.writeStringField("groupName", this.groupName); + jsonWriter.writeStringField("hostId", this.hostId); + jsonWriter.writeStringField("hostResourceGroupArn", this.hostResourceGroupArn); + jsonWriter.writeNumberField("partitionNumber", this.partitionNumber); + jsonWriter.writeStringField("spreadDomain", this.spreadDomain); + jsonWriter.writeJsonField("tenancy", this.tenancy); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of Placement from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of Placement if the JsonReader was pointing to an instance of it, or null if it was pointing + * to JSON null. + * @throws IOException If an error occurs while reading the Placement. + */ + public static Placement fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + Placement deserializedPlacement = new Placement(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("affinity".equals(fieldName)) { + deserializedPlacement.affinity = reader.getString(); + } else if ("availabilityZone".equals(fieldName)) { + deserializedPlacement.availabilityZone = reader.getString(); + } else if ("groupId".equals(fieldName)) { + deserializedPlacement.groupId = reader.getString(); + } else if ("groupName".equals(fieldName)) { + deserializedPlacement.groupName = reader.getString(); + } else if ("hostId".equals(fieldName)) { + deserializedPlacement.hostId = reader.getString(); + } else if ("hostResourceGroupArn".equals(fieldName)) { + deserializedPlacement.hostResourceGroupArn = reader.getString(); + } else if ("partitionNumber".equals(fieldName)) { + deserializedPlacement.partitionNumber = reader.getNullable(JsonReader::getInt); + } else if ("spreadDomain".equals(fieldName)) { + deserializedPlacement.spreadDomain = reader.getString(); + } else if ("tenancy".equals(fieldName)) { + deserializedPlacement.tenancy = TenancyEnumValue.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedPlacement; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/PlacementConstraint.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/PlacementConstraint.java new file mode 100644 index 000000000000..f02363a18ee8 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/PlacementConstraint.java @@ -0,0 +1,138 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of PlacementConstraint. + */ +@Fluent +public final class PlacementConstraint implements JsonSerializable { + /* + * A cluster query language expression to apply to the constraint. The expression can have a maximum length of 2000 + * characters. You can't specify an expression if the constraint type is ``distinctInstance``. For more information, + * see [Cluster query + * language](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/cluster-query-language.html) in the *Amazon + * Elastic Container Service Developer Guide*. + */ + private String expression; + + /* + * The type of constraint. Use ``distinctInstance`` to ensure that each task in a particular group is running on a + * different container instance. Use ``memberOf`` to restrict the selection to a group of valid candidates. + */ + private PlacementConstraintType type; + + /** + * Creates an instance of PlacementConstraint class. + */ + public PlacementConstraint() { + } + + /** + * Get the expression property: A cluster query language expression to apply to the constraint. The expression can + * have a maximum length of 2000 characters. You can't specify an expression if the constraint type is + * ``distinctInstance``. For more information, see [Cluster query + * language](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/cluster-query-language.html) in the *Amazon + * Elastic Container Service Developer Guide*. + * + * @return the expression value. + */ + public String expression() { + return this.expression; + } + + /** + * Set the expression property: A cluster query language expression to apply to the constraint. The expression can + * have a maximum length of 2000 characters. You can't specify an expression if the constraint type is + * ``distinctInstance``. For more information, see [Cluster query + * language](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/cluster-query-language.html) in the *Amazon + * Elastic Container Service Developer Guide*. + * + * @param expression the expression value to set. + * @return the PlacementConstraint object itself. + */ + public PlacementConstraint withExpression(String expression) { + this.expression = expression; + return this; + } + + /** + * Get the type property: The type of constraint. Use ``distinctInstance`` to ensure that each task in a particular + * group is running on a different container instance. Use ``memberOf`` to restrict the selection to a group of + * valid candidates. + * + * @return the type value. + */ + public PlacementConstraintType type() { + return this.type; + } + + /** + * Set the type property: The type of constraint. Use ``distinctInstance`` to ensure that each task in a particular + * group is running on a different container instance. Use ``memberOf`` to restrict the selection to a group of + * valid candidates. + * + * @param type the type value to set. + * @return the PlacementConstraint object itself. + */ + public PlacementConstraint withType(PlacementConstraintType type) { + this.type = type; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("expression", this.expression); + jsonWriter.writeStringField("type", this.type == null ? null : this.type.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of PlacementConstraint from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of PlacementConstraint if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the PlacementConstraint. + */ + public static PlacementConstraint fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + PlacementConstraint deserializedPlacementConstraint = new PlacementConstraint(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("expression".equals(fieldName)) { + deserializedPlacementConstraint.expression = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedPlacementConstraint.type = PlacementConstraintType.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedPlacementConstraint; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/PlacementConstraintType.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/PlacementConstraintType.java new file mode 100644 index 000000000000..6316d9f09f60 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/PlacementConstraintType.java @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * PlacementConstraintType enum. + */ +public final class PlacementConstraintType extends ExpandableStringEnum { + /** + * Static value distinctInstance for PlacementConstraintType. + */ + public static final PlacementConstraintType DISTINCT_INSTANCE = fromString("distinctInstance"); + + /** + * Static value memberOf for PlacementConstraintType. + */ + public static final PlacementConstraintType MEMBER_OF = fromString("memberOf"); + + /** + * Creates a new instance of PlacementConstraintType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public PlacementConstraintType() { + } + + /** + * Creates or finds a PlacementConstraintType from its string representation. + * + * @param name a name to look for. + * @return the corresponding PlacementConstraintType. + */ + public static PlacementConstraintType fromString(String name) { + return fromString(name, PlacementConstraintType.class); + } + + /** + * Gets known PlacementConstraintType values. + * + * @return known PlacementConstraintType values. + */ + public static Collection values() { + return values(PlacementConstraintType.class); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/PlacementGroupConfig.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/PlacementGroupConfig.java new file mode 100644 index 000000000000..d1dd5974fd3f --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/PlacementGroupConfig.java @@ -0,0 +1,137 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of PlacementGroupConfig. + */ +@Fluent +public final class PlacementGroupConfig implements JsonSerializable { + /* + *

Role of the instance in the cluster.

Starting with Amazon EMR release 5.23.0, the only supported + * instance role is MASTER.

+ */ + private InstanceRoleTypeEnumValue instanceRole; + + /* + *

Amazon EC2 Placement Group strategy associated with instance role.

Starting with Amazon EMR release + * 5.23.0, the only supported placement strategy is SPREAD for the MASTER instance + * role.

+ */ + private PlacementGroupStrategyEnumValue placementStrategy; + + /** + * Creates an instance of PlacementGroupConfig class. + */ + public PlacementGroupConfig() { + } + + /** + * Get the instanceRole property: <p>Role of the instance in the cluster.</p> <p>Starting with + * Amazon EMR release 5.23.0, the only supported instance role is <code>MASTER</code>.</p>. + * + * @return the instanceRole value. + */ + public InstanceRoleTypeEnumValue instanceRole() { + return this.instanceRole; + } + + /** + * Set the instanceRole property: <p>Role of the instance in the cluster.</p> <p>Starting with + * Amazon EMR release 5.23.0, the only supported instance role is <code>MASTER</code>.</p>. + * + * @param instanceRole the instanceRole value to set. + * @return the PlacementGroupConfig object itself. + */ + public PlacementGroupConfig withInstanceRole(InstanceRoleTypeEnumValue instanceRole) { + this.instanceRole = instanceRole; + return this; + } + + /** + * Get the placementStrategy property: <p>Amazon EC2 Placement Group strategy associated with instance + * role.</p> <p>Starting with Amazon EMR release 5.23.0, the only supported placement strategy is + * <code>SPREAD</code> for the <code>MASTER</code> instance role.</p>. + * + * @return the placementStrategy value. + */ + public PlacementGroupStrategyEnumValue placementStrategy() { + return this.placementStrategy; + } + + /** + * Set the placementStrategy property: <p>Amazon EC2 Placement Group strategy associated with instance + * role.</p> <p>Starting with Amazon EMR release 5.23.0, the only supported placement strategy is + * <code>SPREAD</code> for the <code>MASTER</code> instance role.</p>. + * + * @param placementStrategy the placementStrategy value to set. + * @return the PlacementGroupConfig object itself. + */ + public PlacementGroupConfig withPlacementStrategy(PlacementGroupStrategyEnumValue placementStrategy) { + this.placementStrategy = placementStrategy; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (instanceRole() != null) { + instanceRole().validate(); + } + if (placementStrategy() != null) { + placementStrategy().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("instanceRole", this.instanceRole); + jsonWriter.writeJsonField("placementStrategy", this.placementStrategy); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of PlacementGroupConfig from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of PlacementGroupConfig if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the PlacementGroupConfig. + */ + public static PlacementGroupConfig fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + PlacementGroupConfig deserializedPlacementGroupConfig = new PlacementGroupConfig(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("instanceRole".equals(fieldName)) { + deserializedPlacementGroupConfig.instanceRole = InstanceRoleTypeEnumValue.fromJson(reader); + } else if ("placementStrategy".equals(fieldName)) { + deserializedPlacementGroupConfig.placementStrategy + = PlacementGroupStrategyEnumValue.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedPlacementGroupConfig; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/PlacementGroupStrategy.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/PlacementGroupStrategy.java new file mode 100644 index 000000000000..6a3d45a9b612 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/PlacementGroupStrategy.java @@ -0,0 +1,61 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * PlacementGroupStrategy enum. + */ +public final class PlacementGroupStrategy extends ExpandableStringEnum { + /** + * Static value CLUSTER for PlacementGroupStrategy. + */ + public static final PlacementGroupStrategy CLUSTER = fromString("CLUSTER"); + + /** + * Static value NONE for PlacementGroupStrategy. + */ + public static final PlacementGroupStrategy NONE = fromString("NONE"); + + /** + * Static value PARTITION for PlacementGroupStrategy. + */ + public static final PlacementGroupStrategy PARTITION = fromString("PARTITION"); + + /** + * Static value SPREAD for PlacementGroupStrategy. + */ + public static final PlacementGroupStrategy SPREAD = fromString("SPREAD"); + + /** + * Creates a new instance of PlacementGroupStrategy value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public PlacementGroupStrategy() { + } + + /** + * Creates or finds a PlacementGroupStrategy from its string representation. + * + * @param name a name to look for. + * @return the corresponding PlacementGroupStrategy. + */ + public static PlacementGroupStrategy fromString(String name) { + return fromString(name, PlacementGroupStrategy.class); + } + + /** + * Gets known PlacementGroupStrategy values. + * + * @return known PlacementGroupStrategy values. + */ + public static Collection values() { + return values(PlacementGroupStrategy.class); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/PlacementGroupStrategyEnumValue.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/PlacementGroupStrategyEnumValue.java new file mode 100644 index 000000000000..0839cd29a957 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/PlacementGroupStrategyEnumValue.java @@ -0,0 +1,95 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of PlacementGroupStrategyEnumValue. + */ +@Fluent +public final class PlacementGroupStrategyEnumValue implements JsonSerializable { + /* + * Property value + */ + private PlacementGroupStrategy value; + + /** + * Creates an instance of PlacementGroupStrategyEnumValue class. + */ + public PlacementGroupStrategyEnumValue() { + } + + /** + * Get the value property: Property value. + * + * @return the value value. + */ + public PlacementGroupStrategy value() { + return this.value; + } + + /** + * Set the value property: Property value. + * + * @param value the value value to set. + * @return the PlacementGroupStrategyEnumValue object itself. + */ + public PlacementGroupStrategyEnumValue withValue(PlacementGroupStrategy value) { + this.value = value; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("value", this.value == null ? null : this.value.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of PlacementGroupStrategyEnumValue from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of PlacementGroupStrategyEnumValue if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the PlacementGroupStrategyEnumValue. + */ + public static PlacementGroupStrategyEnumValue fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + PlacementGroupStrategyEnumValue deserializedPlacementGroupStrategyEnumValue + = new PlacementGroupStrategyEnumValue(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + deserializedPlacementGroupStrategyEnumValue.value + = PlacementGroupStrategy.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedPlacementGroupStrategyEnumValue; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/PlacementStrategy.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/PlacementStrategy.java new file mode 100644 index 000000000000..b00a1702d941 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/PlacementStrategy.java @@ -0,0 +1,146 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of PlacementStrategy. + */ +@Fluent +public final class PlacementStrategy implements JsonSerializable { + /* + * The field to apply the placement strategy against. For the ``spread`` placement strategy, valid values are + * ``instanceId`` (or ``host``, which has the same effect), or any platform or custom attribute that is applied to a + * container instance, such as ``attribute:ecs.availability-zone``. For the ``binpack`` placement strategy, valid + * values are ``CPU`` and ``MEMORY``. For the ``random`` placement strategy, this field is not used. + */ + private String field; + + /* + * The type of placement strategy. The ``random`` placement strategy randomly places tasks on available candidates. + * The ``spread`` placement strategy spreads placement across available candidates evenly based on the ``field`` + * parameter. The ``binpack`` strategy places tasks on available candidates that have the least available amount of + * the resource that's specified with the ``field`` parameter. For example, if you binpack on memory, a task is + * placed on the instance with the least amount of remaining memory but still enough to run the task. + */ + private PlacementStrategyType type; + + /** + * Creates an instance of PlacementStrategy class. + */ + public PlacementStrategy() { + } + + /** + * Get the field property: The field to apply the placement strategy against. For the ``spread`` placement strategy, + * valid values are ``instanceId`` (or ``host``, which has the same effect), or any platform or custom attribute + * that is applied to a container instance, such as ``attribute:ecs.availability-zone``. For the ``binpack`` + * placement strategy, valid values are ``CPU`` and ``MEMORY``. For the ``random`` placement strategy, this field is + * not used. + * + * @return the field value. + */ + public String field() { + return this.field; + } + + /** + * Set the field property: The field to apply the placement strategy against. For the ``spread`` placement strategy, + * valid values are ``instanceId`` (or ``host``, which has the same effect), or any platform or custom attribute + * that is applied to a container instance, such as ``attribute:ecs.availability-zone``. For the ``binpack`` + * placement strategy, valid values are ``CPU`` and ``MEMORY``. For the ``random`` placement strategy, this field is + * not used. + * + * @param field the field value to set. + * @return the PlacementStrategy object itself. + */ + public PlacementStrategy withField(String field) { + this.field = field; + return this; + } + + /** + * Get the type property: The type of placement strategy. The ``random`` placement strategy randomly places tasks on + * available candidates. The ``spread`` placement strategy spreads placement across available candidates evenly + * based on the ``field`` parameter. The ``binpack`` strategy places tasks on available candidates that have the + * least available amount of the resource that's specified with the ``field`` parameter. For example, if you binpack + * on memory, a task is placed on the instance with the least amount of remaining memory but still enough to run the + * task. + * + * @return the type value. + */ + public PlacementStrategyType type() { + return this.type; + } + + /** + * Set the type property: The type of placement strategy. The ``random`` placement strategy randomly places tasks on + * available candidates. The ``spread`` placement strategy spreads placement across available candidates evenly + * based on the ``field`` parameter. The ``binpack`` strategy places tasks on available candidates that have the + * least available amount of the resource that's specified with the ``field`` parameter. For example, if you binpack + * on memory, a task is placed on the instance with the least amount of remaining memory but still enough to run the + * task. + * + * @param type the type value to set. + * @return the PlacementStrategy object itself. + */ + public PlacementStrategy withType(PlacementStrategyType type) { + this.type = type; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("field", this.field); + jsonWriter.writeStringField("type", this.type == null ? null : this.type.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of PlacementStrategy from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of PlacementStrategy if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the PlacementStrategy. + */ + public static PlacementStrategy fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + PlacementStrategy deserializedPlacementStrategy = new PlacementStrategy(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("field".equals(fieldName)) { + deserializedPlacementStrategy.field = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedPlacementStrategy.type = PlacementStrategyType.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedPlacementStrategy; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/PlacementStrategyType.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/PlacementStrategyType.java new file mode 100644 index 000000000000..65357b661a1a --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/PlacementStrategyType.java @@ -0,0 +1,56 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * PlacementStrategyType enum. + */ +public final class PlacementStrategyType extends ExpandableStringEnum { + /** + * Static value binpack for PlacementStrategyType. + */ + public static final PlacementStrategyType BINPACK = fromString("binpack"); + + /** + * Static value random for PlacementStrategyType. + */ + public static final PlacementStrategyType RANDOM = fromString("random"); + + /** + * Static value spread for PlacementStrategyType. + */ + public static final PlacementStrategyType SPREAD = fromString("spread"); + + /** + * Creates a new instance of PlacementStrategyType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public PlacementStrategyType() { + } + + /** + * Creates or finds a PlacementStrategyType from its string representation. + * + * @param name a name to look for. + * @return the corresponding PlacementStrategyType. + */ + public static PlacementStrategyType fromString(String name) { + return fromString(name, PlacementStrategyType.class); + } + + /** + * Gets known PlacementStrategyType values. + * + * @return known PlacementStrategyType values. + */ + public static Collection values() { + return values(PlacementStrategyType.class); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/PlatformType.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/PlatformType.java new file mode 100644 index 000000000000..ac80ba8e1b53 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/PlatformType.java @@ -0,0 +1,56 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * PlatformType enum. + */ +public final class PlatformType extends ExpandableStringEnum { + /** + * Static value Linux for PlatformType. + */ + public static final PlatformType LINUX = fromString("Linux"); + + /** + * Static value MacOS for PlatformType. + */ + public static final PlatformType MAC_OS = fromString("MacOS"); + + /** + * Static value Windows for PlatformType. + */ + public static final PlatformType WINDOWS = fromString("Windows"); + + /** + * Creates a new instance of PlatformType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public PlatformType() { + } + + /** + * Creates or finds a PlatformType from its string representation. + * + * @param name a name to look for. + * @return the corresponding PlatformType. + */ + public static PlatformType fromString(String name) { + return fromString(name, PlatformType.class); + } + + /** + * Gets known PlatformType values. + * + * @return known PlatformType values. + */ + public static Collection values() { + return values(PlatformType.class); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/PlatformTypeEnumValue.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/PlatformTypeEnumValue.java new file mode 100644 index 000000000000..f4a6fb1ad79a --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/PlatformTypeEnumValue.java @@ -0,0 +1,93 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of PlatformTypeEnumValue. + */ +@Fluent +public final class PlatformTypeEnumValue implements JsonSerializable { + /* + * Property value + */ + private PlatformType value; + + /** + * Creates an instance of PlatformTypeEnumValue class. + */ + public PlatformTypeEnumValue() { + } + + /** + * Get the value property: Property value. + * + * @return the value value. + */ + public PlatformType value() { + return this.value; + } + + /** + * Set the value property: Property value. + * + * @param value the value value to set. + * @return the PlatformTypeEnumValue object itself. + */ + public PlatformTypeEnumValue withValue(PlatformType value) { + this.value = value; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("value", this.value == null ? null : this.value.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of PlatformTypeEnumValue from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of PlatformTypeEnumValue if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the PlatformTypeEnumValue. + */ + public static PlatformTypeEnumValue fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + PlatformTypeEnumValue deserializedPlatformTypeEnumValue = new PlatformTypeEnumValue(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + deserializedPlatformTypeEnumValue.value = PlatformType.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedPlatformTypeEnumValue; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/PlatformValues.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/PlatformValues.java new file mode 100644 index 000000000000..12a15e00fb6f --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/PlatformValues.java @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * PlatformValues enum. + */ +public final class PlatformValues extends ExpandableStringEnum { + /** + * Static value Windows for PlatformValues. + */ + public static final PlatformValues WINDOWS = fromString("Windows"); + + /** + * Creates a new instance of PlatformValues value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public PlatformValues() { + } + + /** + * Creates or finds a PlatformValues from its string representation. + * + * @param name a name to look for. + * @return the corresponding PlatformValues. + */ + public static PlatformValues fromString(String name) { + return fromString(name, PlatformValues.class); + } + + /** + * Gets known PlatformValues values. + * + * @return known PlatformValues values. + */ + public static Collection values() { + return values(PlatformValues.class); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/PlatformValuesEnumValue.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/PlatformValuesEnumValue.java new file mode 100644 index 000000000000..cc0a1351df76 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/PlatformValuesEnumValue.java @@ -0,0 +1,93 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of PlatformValuesEnumValue. + */ +@Fluent +public final class PlatformValuesEnumValue implements JsonSerializable { + /* + * Property value + */ + private PlatformValues value; + + /** + * Creates an instance of PlatformValuesEnumValue class. + */ + public PlatformValuesEnumValue() { + } + + /** + * Get the value property: Property value. + * + * @return the value value. + */ + public PlatformValues value() { + return this.value; + } + + /** + * Set the value property: Property value. + * + * @param value the value value to set. + * @return the PlatformValuesEnumValue object itself. + */ + public PlatformValuesEnumValue withValue(PlatformValues value) { + this.value = value; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("value", this.value == null ? null : this.value.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of PlatformValuesEnumValue from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of PlatformValuesEnumValue if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the PlatformValuesEnumValue. + */ + public static PlatformValuesEnumValue fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + PlatformValuesEnumValue deserializedPlatformValuesEnumValue = new PlatformValuesEnumValue(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + deserializedPlatformValuesEnumValue.value = PlatformValues.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedPlatformValuesEnumValue; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/PointInTimeRecoveryDescription.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/PointInTimeRecoveryDescription.java new file mode 100644 index 000000000000..0b3133d86857 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/PointInTimeRecoveryDescription.java @@ -0,0 +1,178 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.time.OffsetDateTime; +import java.time.format.DateTimeFormatter; + +/** + * Definition of PointInTimeRecoveryDescription. + */ +@Fluent +public final class PointInTimeRecoveryDescription implements JsonSerializable { + /* + *

Specifies the earliest point in time you can restore your table to. You can restore your table to any point in + * time during the last 35 days.

+ */ + private OffsetDateTime earliestRestorableDateTime; + + /* + *

LatestRestorableDateTime is typically 5 minutes before the current time.

+ */ + private OffsetDateTime latestRestorableDateTime; + + /* + *

The current state of point in time recovery:

  • ENABLED - Point in time recovery + * is enabled.

  • DISABLED - Point in time recovery is disabled.

+ */ + private PointInTimeRecoveryStatusEnumValue pointInTimeRecoveryStatus; + + /** + * Creates an instance of PointInTimeRecoveryDescription class. + */ + public PointInTimeRecoveryDescription() { + } + + /** + * Get the earliestRestorableDateTime property: <p>Specifies the earliest point in time you can restore your + * table to. You can restore your table to any point in time during the last 35 days. </p>. + * + * @return the earliestRestorableDateTime value. + */ + public OffsetDateTime earliestRestorableDateTime() { + return this.earliestRestorableDateTime; + } + + /** + * Set the earliestRestorableDateTime property: <p>Specifies the earliest point in time you can restore your + * table to. You can restore your table to any point in time during the last 35 days. </p>. + * + * @param earliestRestorableDateTime the earliestRestorableDateTime value to set. + * @return the PointInTimeRecoveryDescription object itself. + */ + public PointInTimeRecoveryDescription withEarliestRestorableDateTime(OffsetDateTime earliestRestorableDateTime) { + this.earliestRestorableDateTime = earliestRestorableDateTime; + return this; + } + + /** + * Get the latestRestorableDateTime property: <p> <code>LatestRestorableDateTime</code> is + * typically 5 minutes before the current time. </p>. + * + * @return the latestRestorableDateTime value. + */ + public OffsetDateTime latestRestorableDateTime() { + return this.latestRestorableDateTime; + } + + /** + * Set the latestRestorableDateTime property: <p> <code>LatestRestorableDateTime</code> is + * typically 5 minutes before the current time. </p>. + * + * @param latestRestorableDateTime the latestRestorableDateTime value to set. + * @return the PointInTimeRecoveryDescription object itself. + */ + public PointInTimeRecoveryDescription withLatestRestorableDateTime(OffsetDateTime latestRestorableDateTime) { + this.latestRestorableDateTime = latestRestorableDateTime; + return this; + } + + /** + * Get the pointInTimeRecoveryStatus property: <p>The current state of point in time recovery:</p> + * <ul> <li> <p> <code>ENABLED</code> - Point in time recovery is enabled.</p> + * </li> <li> <p> <code>DISABLED</code> - Point in time recovery is + * disabled.</p> </li> </ul>. + * + * @return the pointInTimeRecoveryStatus value. + */ + public PointInTimeRecoveryStatusEnumValue pointInTimeRecoveryStatus() { + return this.pointInTimeRecoveryStatus; + } + + /** + * Set the pointInTimeRecoveryStatus property: <p>The current state of point in time recovery:</p> + * <ul> <li> <p> <code>ENABLED</code> - Point in time recovery is enabled.</p> + * </li> <li> <p> <code>DISABLED</code> - Point in time recovery is + * disabled.</p> </li> </ul>. + * + * @param pointInTimeRecoveryStatus the pointInTimeRecoveryStatus value to set. + * @return the PointInTimeRecoveryDescription object itself. + */ + public PointInTimeRecoveryDescription + withPointInTimeRecoveryStatus(PointInTimeRecoveryStatusEnumValue pointInTimeRecoveryStatus) { + this.pointInTimeRecoveryStatus = pointInTimeRecoveryStatus; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (pointInTimeRecoveryStatus() != null) { + pointInTimeRecoveryStatus().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("earliestRestorableDateTime", + this.earliestRestorableDateTime == null + ? null + : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.earliestRestorableDateTime)); + jsonWriter.writeStringField("latestRestorableDateTime", + this.latestRestorableDateTime == null + ? null + : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.latestRestorableDateTime)); + jsonWriter.writeJsonField("pointInTimeRecoveryStatus", this.pointInTimeRecoveryStatus); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of PointInTimeRecoveryDescription from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of PointInTimeRecoveryDescription if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the PointInTimeRecoveryDescription. + */ + public static PointInTimeRecoveryDescription fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + PointInTimeRecoveryDescription deserializedPointInTimeRecoveryDescription + = new PointInTimeRecoveryDescription(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("earliestRestorableDateTime".equals(fieldName)) { + deserializedPointInTimeRecoveryDescription.earliestRestorableDateTime = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("latestRestorableDateTime".equals(fieldName)) { + deserializedPointInTimeRecoveryDescription.latestRestorableDateTime = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("pointInTimeRecoveryStatus".equals(fieldName)) { + deserializedPointInTimeRecoveryDescription.pointInTimeRecoveryStatus + = PointInTimeRecoveryStatusEnumValue.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedPointInTimeRecoveryDescription; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/PointInTimeRecoverySpecification.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/PointInTimeRecoverySpecification.java new file mode 100644 index 000000000000..2a37ddfcd737 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/PointInTimeRecoverySpecification.java @@ -0,0 +1,97 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of PointInTimeRecoverySpecification. + */ +@Fluent +public final class PointInTimeRecoverySpecification implements JsonSerializable { + /* + * Indicates whether point in time recovery is enabled (true) or disabled (false) on the table. + */ + private Boolean pointInTimeRecoveryEnabled; + + /** + * Creates an instance of PointInTimeRecoverySpecification class. + */ + public PointInTimeRecoverySpecification() { + } + + /** + * Get the pointInTimeRecoveryEnabled property: Indicates whether point in time recovery is enabled (true) or + * disabled (false) on the table. + * + * @return the pointInTimeRecoveryEnabled value. + */ + public Boolean pointInTimeRecoveryEnabled() { + return this.pointInTimeRecoveryEnabled; + } + + /** + * Set the pointInTimeRecoveryEnabled property: Indicates whether point in time recovery is enabled (true) or + * disabled (false) on the table. + * + * @param pointInTimeRecoveryEnabled the pointInTimeRecoveryEnabled value to set. + * @return the PointInTimeRecoverySpecification object itself. + */ + public PointInTimeRecoverySpecification withPointInTimeRecoveryEnabled(Boolean pointInTimeRecoveryEnabled) { + this.pointInTimeRecoveryEnabled = pointInTimeRecoveryEnabled; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeBooleanField("pointInTimeRecoveryEnabled", this.pointInTimeRecoveryEnabled); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of PointInTimeRecoverySpecification from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of PointInTimeRecoverySpecification if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the PointInTimeRecoverySpecification. + */ + public static PointInTimeRecoverySpecification fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + PointInTimeRecoverySpecification deserializedPointInTimeRecoverySpecification + = new PointInTimeRecoverySpecification(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("pointInTimeRecoveryEnabled".equals(fieldName)) { + deserializedPointInTimeRecoverySpecification.pointInTimeRecoveryEnabled + = reader.getNullable(JsonReader::getBoolean); + } else { + reader.skipChildren(); + } + } + + return deserializedPointInTimeRecoverySpecification; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/PointInTimeRecoveryStatus.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/PointInTimeRecoveryStatus.java new file mode 100644 index 000000000000..b4d11cea92f0 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/PointInTimeRecoveryStatus.java @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * PointInTimeRecoveryStatus enum. + */ +public final class PointInTimeRecoveryStatus extends ExpandableStringEnum { + /** + * Static value DISABLED for PointInTimeRecoveryStatus. + */ + public static final PointInTimeRecoveryStatus DISABLED = fromString("DISABLED"); + + /** + * Static value ENABLED for PointInTimeRecoveryStatus. + */ + public static final PointInTimeRecoveryStatus ENABLED = fromString("ENABLED"); + + /** + * Creates a new instance of PointInTimeRecoveryStatus value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public PointInTimeRecoveryStatus() { + } + + /** + * Creates or finds a PointInTimeRecoveryStatus from its string representation. + * + * @param name a name to look for. + * @return the corresponding PointInTimeRecoveryStatus. + */ + public static PointInTimeRecoveryStatus fromString(String name) { + return fromString(name, PointInTimeRecoveryStatus.class); + } + + /** + * Gets known PointInTimeRecoveryStatus values. + * + * @return known PointInTimeRecoveryStatus values. + */ + public static Collection values() { + return values(PointInTimeRecoveryStatus.class); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/PointInTimeRecoveryStatusEnumValue.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/PointInTimeRecoveryStatusEnumValue.java new file mode 100644 index 000000000000..c33e27299f7e --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/PointInTimeRecoveryStatusEnumValue.java @@ -0,0 +1,95 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of PointInTimeRecoveryStatusEnumValue. + */ +@Fluent +public final class PointInTimeRecoveryStatusEnumValue implements JsonSerializable { + /* + * Property value + */ + private PointInTimeRecoveryStatus value; + + /** + * Creates an instance of PointInTimeRecoveryStatusEnumValue class. + */ + public PointInTimeRecoveryStatusEnumValue() { + } + + /** + * Get the value property: Property value. + * + * @return the value value. + */ + public PointInTimeRecoveryStatus value() { + return this.value; + } + + /** + * Set the value property: Property value. + * + * @param value the value value to set. + * @return the PointInTimeRecoveryStatusEnumValue object itself. + */ + public PointInTimeRecoveryStatusEnumValue withValue(PointInTimeRecoveryStatus value) { + this.value = value; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("value", this.value == null ? null : this.value.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of PointInTimeRecoveryStatusEnumValue from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of PointInTimeRecoveryStatusEnumValue if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the PointInTimeRecoveryStatusEnumValue. + */ + public static PointInTimeRecoveryStatusEnumValue fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + PointInTimeRecoveryStatusEnumValue deserializedPointInTimeRecoveryStatusEnumValue + = new PointInTimeRecoveryStatusEnumValue(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + deserializedPointInTimeRecoveryStatusEnumValue.value + = PointInTimeRecoveryStatus.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedPointInTimeRecoveryStatusEnumValue; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/Policy.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/Policy.java new file mode 100644 index 000000000000..33ff01ce3e15 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/Policy.java @@ -0,0 +1,124 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.Map; + +/** + * Definition of Policy. + */ +@Fluent +public final class Policy implements JsonSerializable { + /* + * The policy document. + */ + private Map policyDocument; + + /* + * The friendly name (not ARN) identifying the policy. + */ + private String policyName; + + /** + * Creates an instance of Policy class. + */ + public Policy() { + } + + /** + * Get the policyDocument property: The policy document. + * + * @return the policyDocument value. + */ + public Map policyDocument() { + return this.policyDocument; + } + + /** + * Set the policyDocument property: The policy document. + * + * @param policyDocument the policyDocument value to set. + * @return the Policy object itself. + */ + public Policy withPolicyDocument(Map policyDocument) { + this.policyDocument = policyDocument; + return this; + } + + /** + * Get the policyName property: The friendly name (not ARN) identifying the policy. + * + * @return the policyName value. + */ + public String policyName() { + return this.policyName; + } + + /** + * Set the policyName property: The friendly name (not ARN) identifying the policy. + * + * @param policyName the policyName value to set. + * @return the Policy object itself. + */ + public Policy withPolicyName(String policyName) { + this.policyName = policyName; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeMapField("policyDocument", this.policyDocument, + (writer, element) -> writer.writeUntyped(element)); + jsonWriter.writeStringField("policyName", this.policyName); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of Policy from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of Policy if the JsonReader was pointing to an instance of it, or null if it was pointing to + * JSON null. + * @throws IOException If an error occurs while reading the Policy. + */ + public static Policy fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + Policy deserializedPolicy = new Policy(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("policyDocument".equals(fieldName)) { + Map policyDocument = reader.readMap(reader1 -> reader1.readUntyped()); + deserializedPolicy.policyDocument = policyDocument; + } else if ("policyName".equals(fieldName)) { + deserializedPolicy.policyName = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedPolicy; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/PolicyAutoGenerated.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/PolicyAutoGenerated.java new file mode 100644 index 000000000000..78052fc91f0c --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/PolicyAutoGenerated.java @@ -0,0 +1,129 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.Map; + +/** + * Definition of Policy. + */ +@Fluent +public final class PolicyAutoGenerated implements JsonSerializable { + /* + * The entire contents of the policy that defines permissions. For more information, see [Overview of JSON + * policies](https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies.html#access_policies-json). + */ + private Map policyDocument; + + /* + * The friendly name (not ARN) identifying the policy. + */ + private String policyName; + + /** + * Creates an instance of PolicyAutoGenerated class. + */ + public PolicyAutoGenerated() { + } + + /** + * Get the policyDocument property: The entire contents of the policy that defines permissions. For more + * information, see [Overview of JSON + * policies](https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies.html#access_policies-json). + * + * @return the policyDocument value. + */ + public Map policyDocument() { + return this.policyDocument; + } + + /** + * Set the policyDocument property: The entire contents of the policy that defines permissions. For more + * information, see [Overview of JSON + * policies](https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies.html#access_policies-json). + * + * @param policyDocument the policyDocument value to set. + * @return the PolicyAutoGenerated object itself. + */ + public PolicyAutoGenerated withPolicyDocument(Map policyDocument) { + this.policyDocument = policyDocument; + return this; + } + + /** + * Get the policyName property: The friendly name (not ARN) identifying the policy. + * + * @return the policyName value. + */ + public String policyName() { + return this.policyName; + } + + /** + * Set the policyName property: The friendly name (not ARN) identifying the policy. + * + * @param policyName the policyName value to set. + * @return the PolicyAutoGenerated object itself. + */ + public PolicyAutoGenerated withPolicyName(String policyName) { + this.policyName = policyName; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeMapField("policyDocument", this.policyDocument, + (writer, element) -> writer.writeUntyped(element)); + jsonWriter.writeStringField("policyName", this.policyName); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of PolicyAutoGenerated from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of PolicyAutoGenerated if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the PolicyAutoGenerated. + */ + public static PolicyAutoGenerated fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + PolicyAutoGenerated deserializedPolicyAutoGenerated = new PolicyAutoGenerated(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("policyDocument".equals(fieldName)) { + Map policyDocument = reader.readMap(reader1 -> reader1.readUntyped()); + deserializedPolicyAutoGenerated.policyDocument = policyDocument; + } else if ("policyName".equals(fieldName)) { + deserializedPolicyAutoGenerated.policyName = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedPolicyAutoGenerated; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/Port.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/Port.java new file mode 100644 index 000000000000..097e7fa78048 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/Port.java @@ -0,0 +1,350 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Definition of Port. + */ +@Fluent +public final class Port implements JsonSerializable { + /* + * Access Direction for Protocol of the Instance(inbound/outbound). + */ + private String accessDirection; + + /* + * Access From Protocol of the Instance. + */ + private String accessFrom; + + /* + * Access Type Protocol of the Instance. + */ + private String accessType; + + /* + * cidr List Aliases + */ + private List cidrListAliases; + + /* + * Property cidrs + */ + private List cidrs; + + /* + * CommonName for Protocol of the Instance. + */ + private String commonName; + + /* + * From Port of the Instance. + */ + private Integer fromPort; + + /* + * IPv6 Cidrs + */ + private List ipv6Cidrs; + + /* + * Port Protocol of the Instance. + */ + private String protocol; + + /* + * To Port of the Instance. + */ + private Integer toPort; + + /** + * Creates an instance of Port class. + */ + public Port() { + } + + /** + * Get the accessDirection property: Access Direction for Protocol of the Instance(inbound/outbound). + * + * @return the accessDirection value. + */ + public String accessDirection() { + return this.accessDirection; + } + + /** + * Set the accessDirection property: Access Direction for Protocol of the Instance(inbound/outbound). + * + * @param accessDirection the accessDirection value to set. + * @return the Port object itself. + */ + public Port withAccessDirection(String accessDirection) { + this.accessDirection = accessDirection; + return this; + } + + /** + * Get the accessFrom property: Access From Protocol of the Instance. + * + * @return the accessFrom value. + */ + public String accessFrom() { + return this.accessFrom; + } + + /** + * Set the accessFrom property: Access From Protocol of the Instance. + * + * @param accessFrom the accessFrom value to set. + * @return the Port object itself. + */ + public Port withAccessFrom(String accessFrom) { + this.accessFrom = accessFrom; + return this; + } + + /** + * Get the accessType property: Access Type Protocol of the Instance. + * + * @return the accessType value. + */ + public String accessType() { + return this.accessType; + } + + /** + * Set the accessType property: Access Type Protocol of the Instance. + * + * @param accessType the accessType value to set. + * @return the Port object itself. + */ + public Port withAccessType(String accessType) { + this.accessType = accessType; + return this; + } + + /** + * Get the cidrListAliases property: cidr List Aliases. + * + * @return the cidrListAliases value. + */ + public List cidrListAliases() { + return this.cidrListAliases; + } + + /** + * Set the cidrListAliases property: cidr List Aliases. + * + * @param cidrListAliases the cidrListAliases value to set. + * @return the Port object itself. + */ + public Port withCidrListAliases(List cidrListAliases) { + this.cidrListAliases = cidrListAliases; + return this; + } + + /** + * Get the cidrs property: Property cidrs. + * + * @return the cidrs value. + */ + public List cidrs() { + return this.cidrs; + } + + /** + * Set the cidrs property: Property cidrs. + * + * @param cidrs the cidrs value to set. + * @return the Port object itself. + */ + public Port withCidrs(List cidrs) { + this.cidrs = cidrs; + return this; + } + + /** + * Get the commonName property: CommonName for Protocol of the Instance. + * + * @return the commonName value. + */ + public String commonName() { + return this.commonName; + } + + /** + * Set the commonName property: CommonName for Protocol of the Instance. + * + * @param commonName the commonName value to set. + * @return the Port object itself. + */ + public Port withCommonName(String commonName) { + this.commonName = commonName; + return this; + } + + /** + * Get the fromPort property: From Port of the Instance. + * + * @return the fromPort value. + */ + public Integer fromPort() { + return this.fromPort; + } + + /** + * Set the fromPort property: From Port of the Instance. + * + * @param fromPort the fromPort value to set. + * @return the Port object itself. + */ + public Port withFromPort(Integer fromPort) { + this.fromPort = fromPort; + return this; + } + + /** + * Get the ipv6Cidrs property: IPv6 Cidrs. + * + * @return the ipv6Cidrs value. + */ + public List ipv6Cidrs() { + return this.ipv6Cidrs; + } + + /** + * Set the ipv6Cidrs property: IPv6 Cidrs. + * + * @param ipv6Cidrs the ipv6Cidrs value to set. + * @return the Port object itself. + */ + public Port withIpv6Cidrs(List ipv6Cidrs) { + this.ipv6Cidrs = ipv6Cidrs; + return this; + } + + /** + * Get the protocol property: Port Protocol of the Instance. + * + * @return the protocol value. + */ + public String protocol() { + return this.protocol; + } + + /** + * Set the protocol property: Port Protocol of the Instance. + * + * @param protocol the protocol value to set. + * @return the Port object itself. + */ + public Port withProtocol(String protocol) { + this.protocol = protocol; + return this; + } + + /** + * Get the toPort property: To Port of the Instance. + * + * @return the toPort value. + */ + public Integer toPort() { + return this.toPort; + } + + /** + * Set the toPort property: To Port of the Instance. + * + * @param toPort the toPort value to set. + * @return the Port object itself. + */ + public Port withToPort(Integer toPort) { + this.toPort = toPort; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("accessDirection", this.accessDirection); + jsonWriter.writeStringField("accessFrom", this.accessFrom); + jsonWriter.writeStringField("accessType", this.accessType); + jsonWriter.writeArrayField("cidrListAliases", this.cidrListAliases, + (writer, element) -> writer.writeString(element)); + jsonWriter.writeArrayField("cidrs", this.cidrs, (writer, element) -> writer.writeString(element)); + jsonWriter.writeStringField("commonName", this.commonName); + jsonWriter.writeNumberField("fromPort", this.fromPort); + jsonWriter.writeArrayField("ipv6Cidrs", this.ipv6Cidrs, (writer, element) -> writer.writeString(element)); + jsonWriter.writeStringField("protocol", this.protocol); + jsonWriter.writeNumberField("toPort", this.toPort); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of Port from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of Port if the JsonReader was pointing to an instance of it, or null if it was pointing to + * JSON null. + * @throws IOException If an error occurs while reading the Port. + */ + public static Port fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + Port deserializedPort = new Port(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("accessDirection".equals(fieldName)) { + deserializedPort.accessDirection = reader.getString(); + } else if ("accessFrom".equals(fieldName)) { + deserializedPort.accessFrom = reader.getString(); + } else if ("accessType".equals(fieldName)) { + deserializedPort.accessType = reader.getString(); + } else if ("cidrListAliases".equals(fieldName)) { + List cidrListAliases = reader.readArray(reader1 -> reader1.getString()); + deserializedPort.cidrListAliases = cidrListAliases; + } else if ("cidrs".equals(fieldName)) { + List cidrs = reader.readArray(reader1 -> reader1.getString()); + deserializedPort.cidrs = cidrs; + } else if ("commonName".equals(fieldName)) { + deserializedPort.commonName = reader.getString(); + } else if ("fromPort".equals(fieldName)) { + deserializedPort.fromPort = reader.getNullable(JsonReader::getInt); + } else if ("ipv6Cidrs".equals(fieldName)) { + List ipv6Cidrs = reader.readArray(reader1 -> reader1.getString()); + deserializedPort.ipv6Cidrs = ipv6Cidrs; + } else if ("protocol".equals(fieldName)) { + deserializedPort.protocol = reader.getString(); + } else if ("toPort".equals(fieldName)) { + deserializedPort.toPort = reader.getNullable(JsonReader::getInt); + } else { + reader.skipChildren(); + } + } + + return deserializedPort; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/PortMapping.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/PortMapping.java new file mode 100644 index 000000000000..e576f6db1a38 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/PortMapping.java @@ -0,0 +1,420 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of PortMapping. + */ +@Fluent +public final class PortMapping implements JsonSerializable { + /* + * The application protocol that's used for the port mapping. This parameter only applies to Service Connect. We + * recommend that you set this parameter to be consistent with the protocol that your application uses. If you set + * this parameter, Amazon ECS adds protocol-specific connection handling to the Service Connect proxy. If you set + * this parameter, Amazon ECS adds protocol-specific telemetry in the Amazon ECS console and CloudWatch. If you + * don't set a value for this parameter, then TCP is used. However, Amazon ECS doesn't add protocol-specific + * telemetry for TCP. ``appProtocol`` is immutable in a Service Connect service. Updating this field requires a + * service deletion and redeployment. Tasks that run in a namespace can use short names to connect to services in + * the namespace. Tasks can connect to services across all of the clusters in the namespace. Tasks connect through a + * managed proxy container that collects logs and metrics for increased visibility. Only the tasks that Amazon ECS + * services create are supported with Service Connect. For more information, see [Service + * Connect](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/service-connect.html) in the *Amazon Elastic + * Container Service Developer Guide*. + */ + private PortMappingAppProtocol appProtocol; + + /* + * The port number on the container that's bound to the user-specified or automatically assigned host port. If you + * use containers in a task with the ``awsvpc`` or ``host`` network mode, specify the exposed ports using + * ``containerPort``. If you use containers in a task with the ``bridge`` network mode and you specify a container + * port and not a host port, your container automatically receives a host port in the ephemeral port range. For more + * information, see ``hostPort``. Port mappings that are automatically assigned in this way do not count toward the + * 100 reserved ports limit of a container instance. + */ + private Integer containerPort; + + /* + * The port number range on the container that's bound to the dynamically mapped host port range. The following + * rules apply when you specify a ``containerPortRange``: + You must use either the ``bridge`` network mode or the + * ``awsvpc`` network mode. + This parameter is available for both the EC2 and FARGATElong launch types. + This + * parameter is available for both the Linux and Windows operating systems. + The container instance must have at + * least version 1.67.0 of the container agent and at least version 1.67.0-1 of the ``ecs-init`` package + You can + * specify a maximum of 100 port ranges per container. + You do not specify a ``hostPortRange``. The value of the + * ``hostPortRange`` is set as follows: + For containers in a task with the ``awsvpc`` network mode, the + * ``hostPortRange`` is set to the same value as the ``containerPortRange``. This is a static mapping strategy. + + * For containers in a task with the ``bridge`` network mode, the Amazon ECS agent finds open host ports from the + * default ephemeral range and passes it to docker to bind them to the container ports. + The ``containerPortRange`` + * valid values are between 1 and 65535. + A port can only be included in one port mapping per container. + You + * cannot specify overlapping port ranges. + The first port in the range must be less than last port in the range. + + * Docker recommends that you turn off the docker-proxy in the Docker daemon config file when you have a large + * number of ports. For more information, see [Issue + * #11185](https://docs.aws.amazon.com/https://github.com/moby/moby/issues/11185) on the Github website. For + * information about how to turn off the docker-proxy in the Docker daemon config file, see [Docker + * daemon](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/bootstrap_container_instance.html# + * bootstrap_docker_daemon) in the *Amazon ECS Developer Guide*. You can call + * [DescribeTasks](https://docs.aws.amazon.com/AmazonECS/latest/APIReference/API_DescribeTasks.html) to view the + * ``hostPortRange`` which are the host ports that are bound to the container ports. + */ + private String containerPortRange; + + /* + * The port number on the container instance to reserve for your container. If you specify a ``containerPortRange``, + * leave this field empty and the value of the ``hostPort`` is set as follows: + For containers in a task with the + * ``awsvpc`` network mode, the ``hostPort`` is set to the same value as the ``containerPort``. This is a static + * mapping strategy. + For containers in a task with the ``bridge`` network mode, the Amazon ECS agent finds open + * ports on the host and automatically binds them to the container ports. This is a dynamic mapping strategy. If you + * use containers in a task with the ``awsvpc`` or ``host`` network mode, the ``hostPort`` can either be left blank + * or set to the same value as the ``containerPort``. If you use containers in a task with the ``bridge`` network + * mode, you can specify a non-reserved host port for your container port mapping, or you can omit the ``hostPort`` + * (or set it to ``0``) while specifying a ``containerPort`` and your container automatically receives a port in the + * ephemeral port range for your container instance operating system and Docker version. The default ephemeral port + * range for Docker version 1.6.0 and later is listed on the instance under + * ``/proc/sys/net/ipv4/ip_local_port_range``. If this kernel parameter is unavailable, the default ephemeral port + * range from 49153 through 65535 (Linux) or 49152 through 65535 (Windows) is used. Do not attempt to specify a host + * port in the ephemeral port range as these are reserved for automatic assignment. In general, ports below 32768 + * are outside of the ephemeral port range. The default reserved ports are 22 for SSH, the Docker ports 2375 and + * 2376, and the Amazon ECS container agent ports 51678-51680. Any host port that was previously specified in a + * running task is also reserved while the task is running. That is, after a task stops, the host port is released. + * The current reserved ports are displayed in the ``remainingResources`` of + * [DescribeContainerInstances](https://docs.aws.amazon.com/AmazonECS/latest/APIReference/ + * API_DescribeContainerInstances.html) output. A container instance can have up to 100 reserved ports at a time. + * This number includes the default reserved ports. Automatically assigned ports aren't included in the 100 reserved + * ports quota. + */ + private Integer hostPort; + + /* + * The name that's used for the port mapping. This parameter only applies to Service Connect. This parameter is the + * name that you use in the ``serviceConnectConfiguration`` of a service. The name can include up to 64 characters. + * The characters can include lowercase letters, numbers, underscores (_), and hyphens (-). The name can't start + * with a hyphen. For more information, see [Service + * Connect](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/service-connect.html) in the *Amazon Elastic + * Container Service Developer Guide*. + */ + private String name; + + /* + * The protocol used for the port mapping. Valid values are ``tcp`` and ``udp``. The default is ``tcp``. + * ``protocol`` is immutable in a Service Connect service. Updating this field requires a service deletion and + * redeployment. + */ + private String protocol; + + /** + * Creates an instance of PortMapping class. + */ + public PortMapping() { + } + + /** + * Get the appProtocol property: The application protocol that's used for the port mapping. This parameter only + * applies to Service Connect. We recommend that you set this parameter to be consistent with the protocol that your + * application uses. If you set this parameter, Amazon ECS adds protocol-specific connection handling to the Service + * Connect proxy. If you set this parameter, Amazon ECS adds protocol-specific telemetry in the Amazon ECS console + * and CloudWatch. If you don't set a value for this parameter, then TCP is used. However, Amazon ECS doesn't add + * protocol-specific telemetry for TCP. ``appProtocol`` is immutable in a Service Connect service. Updating this + * field requires a service deletion and redeployment. Tasks that run in a namespace can use short names to connect + * to services in the namespace. Tasks can connect to services across all of the clusters in the namespace. Tasks + * connect through a managed proxy container that collects logs and metrics for increased visibility. Only the tasks + * that Amazon ECS services create are supported with Service Connect. For more information, see [Service + * Connect](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/service-connect.html) in the *Amazon Elastic + * Container Service Developer Guide*. + * + * @return the appProtocol value. + */ + public PortMappingAppProtocol appProtocol() { + return this.appProtocol; + } + + /** + * Set the appProtocol property: The application protocol that's used for the port mapping. This parameter only + * applies to Service Connect. We recommend that you set this parameter to be consistent with the protocol that your + * application uses. If you set this parameter, Amazon ECS adds protocol-specific connection handling to the Service + * Connect proxy. If you set this parameter, Amazon ECS adds protocol-specific telemetry in the Amazon ECS console + * and CloudWatch. If you don't set a value for this parameter, then TCP is used. However, Amazon ECS doesn't add + * protocol-specific telemetry for TCP. ``appProtocol`` is immutable in a Service Connect service. Updating this + * field requires a service deletion and redeployment. Tasks that run in a namespace can use short names to connect + * to services in the namespace. Tasks can connect to services across all of the clusters in the namespace. Tasks + * connect through a managed proxy container that collects logs and metrics for increased visibility. Only the tasks + * that Amazon ECS services create are supported with Service Connect. For more information, see [Service + * Connect](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/service-connect.html) in the *Amazon Elastic + * Container Service Developer Guide*. + * + * @param appProtocol the appProtocol value to set. + * @return the PortMapping object itself. + */ + public PortMapping withAppProtocol(PortMappingAppProtocol appProtocol) { + this.appProtocol = appProtocol; + return this; + } + + /** + * Get the containerPort property: The port number on the container that's bound to the user-specified or + * automatically assigned host port. If you use containers in a task with the ``awsvpc`` or ``host`` network mode, + * specify the exposed ports using ``containerPort``. If you use containers in a task with the ``bridge`` network + * mode and you specify a container port and not a host port, your container automatically receives a host port in + * the ephemeral port range. For more information, see ``hostPort``. Port mappings that are automatically assigned + * in this way do not count toward the 100 reserved ports limit of a container instance. + * + * @return the containerPort value. + */ + public Integer containerPort() { + return this.containerPort; + } + + /** + * Set the containerPort property: The port number on the container that's bound to the user-specified or + * automatically assigned host port. If you use containers in a task with the ``awsvpc`` or ``host`` network mode, + * specify the exposed ports using ``containerPort``. If you use containers in a task with the ``bridge`` network + * mode and you specify a container port and not a host port, your container automatically receives a host port in + * the ephemeral port range. For more information, see ``hostPort``. Port mappings that are automatically assigned + * in this way do not count toward the 100 reserved ports limit of a container instance. + * + * @param containerPort the containerPort value to set. + * @return the PortMapping object itself. + */ + public PortMapping withContainerPort(Integer containerPort) { + this.containerPort = containerPort; + return this; + } + + /** + * Get the containerPortRange property: The port number range on the container that's bound to the dynamically + * mapped host port range. The following rules apply when you specify a ``containerPortRange``: + You must use + * either the ``bridge`` network mode or the ``awsvpc`` network mode. + This parameter is available for both the EC2 + * and FARGATElong launch types. + This parameter is available for both the Linux and Windows operating systems. + + * The container instance must have at least version 1.67.0 of the container agent and at least version 1.67.0-1 of + * the ``ecs-init`` package + You can specify a maximum of 100 port ranges per container. + You do not specify a + * ``hostPortRange``. The value of the ``hostPortRange`` is set as follows: + For containers in a task with the + * ``awsvpc`` network mode, the ``hostPortRange`` is set to the same value as the ``containerPortRange``. This is a + * static mapping strategy. + For containers in a task with the ``bridge`` network mode, the Amazon ECS agent finds + * open host ports from the default ephemeral range and passes it to docker to bind them to the container ports. + + * The ``containerPortRange`` valid values are between 1 and 65535. + A port can only be included in one port + * mapping per container. + You cannot specify overlapping port ranges. + The first port in the range must be less + * than last port in the range. + Docker recommends that you turn off the docker-proxy in the Docker daemon config + * file when you have a large number of ports. For more information, see [Issue + * #11185](https://docs.aws.amazon.com/https://github.com/moby/moby/issues/11185) on the Github website. For + * information about how to turn off the docker-proxy in the Docker daemon config file, see [Docker + * daemon](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/bootstrap_container_instance.html#bootstrap_docker_daemon) + * in the *Amazon ECS Developer Guide*. You can call + * [DescribeTasks](https://docs.aws.amazon.com/AmazonECS/latest/APIReference/API_DescribeTasks.html) to view the + * ``hostPortRange`` which are the host ports that are bound to the container ports. + * + * @return the containerPortRange value. + */ + public String containerPortRange() { + return this.containerPortRange; + } + + /** + * Set the containerPortRange property: The port number range on the container that's bound to the dynamically + * mapped host port range. The following rules apply when you specify a ``containerPortRange``: + You must use + * either the ``bridge`` network mode or the ``awsvpc`` network mode. + This parameter is available for both the EC2 + * and FARGATElong launch types. + This parameter is available for both the Linux and Windows operating systems. + + * The container instance must have at least version 1.67.0 of the container agent and at least version 1.67.0-1 of + * the ``ecs-init`` package + You can specify a maximum of 100 port ranges per container. + You do not specify a + * ``hostPortRange``. The value of the ``hostPortRange`` is set as follows: + For containers in a task with the + * ``awsvpc`` network mode, the ``hostPortRange`` is set to the same value as the ``containerPortRange``. This is a + * static mapping strategy. + For containers in a task with the ``bridge`` network mode, the Amazon ECS agent finds + * open host ports from the default ephemeral range and passes it to docker to bind them to the container ports. + + * The ``containerPortRange`` valid values are between 1 and 65535. + A port can only be included in one port + * mapping per container. + You cannot specify overlapping port ranges. + The first port in the range must be less + * than last port in the range. + Docker recommends that you turn off the docker-proxy in the Docker daemon config + * file when you have a large number of ports. For more information, see [Issue + * #11185](https://docs.aws.amazon.com/https://github.com/moby/moby/issues/11185) on the Github website. For + * information about how to turn off the docker-proxy in the Docker daemon config file, see [Docker + * daemon](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/bootstrap_container_instance.html#bootstrap_docker_daemon) + * in the *Amazon ECS Developer Guide*. You can call + * [DescribeTasks](https://docs.aws.amazon.com/AmazonECS/latest/APIReference/API_DescribeTasks.html) to view the + * ``hostPortRange`` which are the host ports that are bound to the container ports. + * + * @param containerPortRange the containerPortRange value to set. + * @return the PortMapping object itself. + */ + public PortMapping withContainerPortRange(String containerPortRange) { + this.containerPortRange = containerPortRange; + return this; + } + + /** + * Get the hostPort property: The port number on the container instance to reserve for your container. If you + * specify a ``containerPortRange``, leave this field empty and the value of the ``hostPort`` is set as follows: + + * For containers in a task with the ``awsvpc`` network mode, the ``hostPort`` is set to the same value as the + * ``containerPort``. This is a static mapping strategy. + For containers in a task with the ``bridge`` network + * mode, the Amazon ECS agent finds open ports on the host and automatically binds them to the container ports. This + * is a dynamic mapping strategy. If you use containers in a task with the ``awsvpc`` or ``host`` network mode, the + * ``hostPort`` can either be left blank or set to the same value as the ``containerPort``. If you use containers in + * a task with the ``bridge`` network mode, you can specify a non-reserved host port for your container port + * mapping, or you can omit the ``hostPort`` (or set it to ``0``) while specifying a ``containerPort`` and your + * container automatically receives a port in the ephemeral port range for your container instance operating system + * and Docker version. The default ephemeral port range for Docker version 1.6.0 and later is listed on the instance + * under ``/proc/sys/net/ipv4/ip_local_port_range``. If this kernel parameter is unavailable, the default ephemeral + * port range from 49153 through 65535 (Linux) or 49152 through 65535 (Windows) is used. Do not attempt to specify a + * host port in the ephemeral port range as these are reserved for automatic assignment. In general, ports below + * 32768 are outside of the ephemeral port range. The default reserved ports are 22 for SSH, the Docker ports 2375 + * and 2376, and the Amazon ECS container agent ports 51678-51680. Any host port that was previously specified in a + * running task is also reserved while the task is running. That is, after a task stops, the host port is released. + * The current reserved ports are displayed in the ``remainingResources`` of + * [DescribeContainerInstances](https://docs.aws.amazon.com/AmazonECS/latest/APIReference/API_DescribeContainerInstances.html) + * output. A container instance can have up to 100 reserved ports at a time. This number includes the default + * reserved ports. Automatically assigned ports aren't included in the 100 reserved ports quota. + * + * @return the hostPort value. + */ + public Integer hostPort() { + return this.hostPort; + } + + /** + * Set the hostPort property: The port number on the container instance to reserve for your container. If you + * specify a ``containerPortRange``, leave this field empty and the value of the ``hostPort`` is set as follows: + + * For containers in a task with the ``awsvpc`` network mode, the ``hostPort`` is set to the same value as the + * ``containerPort``. This is a static mapping strategy. + For containers in a task with the ``bridge`` network + * mode, the Amazon ECS agent finds open ports on the host and automatically binds them to the container ports. This + * is a dynamic mapping strategy. If you use containers in a task with the ``awsvpc`` or ``host`` network mode, the + * ``hostPort`` can either be left blank or set to the same value as the ``containerPort``. If you use containers in + * a task with the ``bridge`` network mode, you can specify a non-reserved host port for your container port + * mapping, or you can omit the ``hostPort`` (or set it to ``0``) while specifying a ``containerPort`` and your + * container automatically receives a port in the ephemeral port range for your container instance operating system + * and Docker version. The default ephemeral port range for Docker version 1.6.0 and later is listed on the instance + * under ``/proc/sys/net/ipv4/ip_local_port_range``. If this kernel parameter is unavailable, the default ephemeral + * port range from 49153 through 65535 (Linux) or 49152 through 65535 (Windows) is used. Do not attempt to specify a + * host port in the ephemeral port range as these are reserved for automatic assignment. In general, ports below + * 32768 are outside of the ephemeral port range. The default reserved ports are 22 for SSH, the Docker ports 2375 + * and 2376, and the Amazon ECS container agent ports 51678-51680. Any host port that was previously specified in a + * running task is also reserved while the task is running. That is, after a task stops, the host port is released. + * The current reserved ports are displayed in the ``remainingResources`` of + * [DescribeContainerInstances](https://docs.aws.amazon.com/AmazonECS/latest/APIReference/API_DescribeContainerInstances.html) + * output. A container instance can have up to 100 reserved ports at a time. This number includes the default + * reserved ports. Automatically assigned ports aren't included in the 100 reserved ports quota. + * + * @param hostPort the hostPort value to set. + * @return the PortMapping object itself. + */ + public PortMapping withHostPort(Integer hostPort) { + this.hostPort = hostPort; + return this; + } + + /** + * Get the name property: The name that's used for the port mapping. This parameter only applies to Service Connect. + * This parameter is the name that you use in the ``serviceConnectConfiguration`` of a service. The name can include + * up to 64 characters. The characters can include lowercase letters, numbers, underscores (_), and hyphens (-). The + * name can't start with a hyphen. For more information, see [Service + * Connect](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/service-connect.html) in the *Amazon Elastic + * Container Service Developer Guide*. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: The name that's used for the port mapping. This parameter only applies to Service Connect. + * This parameter is the name that you use in the ``serviceConnectConfiguration`` of a service. The name can include + * up to 64 characters. The characters can include lowercase letters, numbers, underscores (_), and hyphens (-). The + * name can't start with a hyphen. For more information, see [Service + * Connect](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/service-connect.html) in the *Amazon Elastic + * Container Service Developer Guide*. + * + * @param name the name value to set. + * @return the PortMapping object itself. + */ + public PortMapping withName(String name) { + this.name = name; + return this; + } + + /** + * Get the protocol property: The protocol used for the port mapping. Valid values are ``tcp`` and ``udp``. The + * default is ``tcp``. ``protocol`` is immutable in a Service Connect service. Updating this field requires a + * service deletion and redeployment. + * + * @return the protocol value. + */ + public String protocol() { + return this.protocol; + } + + /** + * Set the protocol property: The protocol used for the port mapping. Valid values are ``tcp`` and ``udp``. The + * default is ``tcp``. ``protocol`` is immutable in a Service Connect service. Updating this field requires a + * service deletion and redeployment. + * + * @param protocol the protocol value to set. + * @return the PortMapping object itself. + */ + public PortMapping withProtocol(String protocol) { + this.protocol = protocol; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("appProtocol", this.appProtocol == null ? null : this.appProtocol.toString()); + jsonWriter.writeNumberField("containerPort", this.containerPort); + jsonWriter.writeStringField("containerPortRange", this.containerPortRange); + jsonWriter.writeNumberField("hostPort", this.hostPort); + jsonWriter.writeStringField("name", this.name); + jsonWriter.writeStringField("protocol", this.protocol); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of PortMapping from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of PortMapping if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the PortMapping. + */ + public static PortMapping fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + PortMapping deserializedPortMapping = new PortMapping(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("appProtocol".equals(fieldName)) { + deserializedPortMapping.appProtocol = PortMappingAppProtocol.fromString(reader.getString()); + } else if ("containerPort".equals(fieldName)) { + deserializedPortMapping.containerPort = reader.getNullable(JsonReader::getInt); + } else if ("containerPortRange".equals(fieldName)) { + deserializedPortMapping.containerPortRange = reader.getString(); + } else if ("hostPort".equals(fieldName)) { + deserializedPortMapping.hostPort = reader.getNullable(JsonReader::getInt); + } else if ("name".equals(fieldName)) { + deserializedPortMapping.name = reader.getString(); + } else if ("protocol".equals(fieldName)) { + deserializedPortMapping.protocol = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedPortMapping; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/PortMappingAppProtocol.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/PortMappingAppProtocol.java new file mode 100644 index 000000000000..01d451bb9b74 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/PortMappingAppProtocol.java @@ -0,0 +1,56 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * PortMappingAppProtocol enum. + */ +public final class PortMappingAppProtocol extends ExpandableStringEnum { + /** + * Static value grpc for PortMappingAppProtocol. + */ + public static final PortMappingAppProtocol GRPC = fromString("grpc"); + + /** + * Static value http for PortMappingAppProtocol. + */ + public static final PortMappingAppProtocol HTTP = fromString("http"); + + /** + * Static value http2 for PortMappingAppProtocol. + */ + public static final PortMappingAppProtocol HTTP2 = fromString("http2"); + + /** + * Creates a new instance of PortMappingAppProtocol value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public PortMappingAppProtocol() { + } + + /** + * Creates or finds a PortMappingAppProtocol from its string representation. + * + * @param name a name to look for. + * @return the corresponding PortMappingAppProtocol. + */ + public static PortMappingAppProtocol fromString(String name) { + return fromString(name, PortMappingAppProtocol.class); + } + + /** + * Gets known PortMappingAppProtocol values. + * + * @return known PortMappingAppProtocol values. + */ + public static Collection values() { + return values(PortMappingAppProtocol.class); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/PortRange.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/PortRange.java new file mode 100644 index 000000000000..99e9570e41fe --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/PortRange.java @@ -0,0 +1,121 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of PortRange. + */ +@Fluent +public final class PortRange implements JsonSerializable { + /* + * Property fromPort + */ + private Integer fromPort; + + /* + * Property toPort + */ + private Integer toPort; + + /** + * Creates an instance of PortRange class. + */ + public PortRange() { + } + + /** + * Get the fromPort property: Property fromPort. + * + * @return the fromPort value. + */ + public Integer fromPort() { + return this.fromPort; + } + + /** + * Set the fromPort property: Property fromPort. + * + * @param fromPort the fromPort value to set. + * @return the PortRange object itself. + */ + public PortRange withFromPort(Integer fromPort) { + this.fromPort = fromPort; + return this; + } + + /** + * Get the toPort property: Property toPort. + * + * @return the toPort value. + */ + public Integer toPort() { + return this.toPort; + } + + /** + * Set the toPort property: Property toPort. + * + * @param toPort the toPort value to set. + * @return the PortRange object itself. + */ + public PortRange withToPort(Integer toPort) { + this.toPort = toPort; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeNumberField("fromPort", this.fromPort); + jsonWriter.writeNumberField("toPort", this.toPort); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of PortRange from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of PortRange if the JsonReader was pointing to an instance of it, or null if it was pointing + * to JSON null. + * @throws IOException If an error occurs while reading the PortRange. + */ + public static PortRange fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + PortRange deserializedPortRange = new PortRange(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("fromPort".equals(fieldName)) { + deserializedPortRange.fromPort = reader.getNullable(JsonReader::getInt); + } else if ("toPort".equals(fieldName)) { + deserializedPortRange.toPort = reader.getNullable(JsonReader::getInt); + } else { + reader.skipChildren(); + } + } + + return deserializedPortRange; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/PortSet.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/PortSet.java new file mode 100644 index 000000000000..d627870cf69c --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/PortSet.java @@ -0,0 +1,95 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Definition of PortSet. + */ +@Fluent +public final class PortSet implements JsonSerializable { + /* + * Property definition + */ + private List definition; + + /** + * Creates an instance of PortSet class. + */ + public PortSet() { + } + + /** + * Get the definition property: Property definition. + * + * @return the definition value. + */ + public List definition() { + return this.definition; + } + + /** + * Set the definition property: Property definition. + * + * @param definition the definition value to set. + * @return the PortSet object itself. + */ + public PortSet withDefinition(List definition) { + this.definition = definition; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("definition", this.definition, (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of PortSet from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of PortSet if the JsonReader was pointing to an instance of it, or null if it was pointing to + * JSON null. + * @throws IOException If an error occurs while reading the PortSet. + */ + public static PortSet fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + PortSet deserializedPortSet = new PortSet(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("definition".equals(fieldName)) { + List definition = reader.readArray(reader1 -> reader1.getString()); + deserializedPortSet.definition = definition; + } else { + reader.skipChildren(); + } + } + + return deserializedPortSet; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/PrefixListId.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/PrefixListId.java new file mode 100644 index 000000000000..ff2a7c63720a --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/PrefixListId.java @@ -0,0 +1,126 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of PrefixListId. + */ +@Fluent +public final class PrefixListId implements JsonSerializable { + /* + *

A description for the security group rule that references this prefix list ID.

Constraints: Up to 255 + * characters in length. Allowed characters are a-z, A-Z, 0-9, spaces, and ._-:/()#,@[]+=;{}!$*

+ */ + private String description; + + /* + *

The ID of the prefix.

+ */ + private String prefixListId; + + /** + * Creates an instance of PrefixListId class. + */ + public PrefixListId() { + } + + /** + * Get the description property: <p>A description for the security group rule that references this prefix list + * ID.</p> <p>Constraints: Up to 255 characters in length. Allowed characters are a-z, A-Z, 0-9, spaces, + * and ._-:/()#,@[]+=;{}!$*</p>. + * + * @return the description value. + */ + public String description() { + return this.description; + } + + /** + * Set the description property: <p>A description for the security group rule that references this prefix list + * ID.</p> <p>Constraints: Up to 255 characters in length. Allowed characters are a-z, A-Z, 0-9, spaces, + * and ._-:/()#,@[]+=;{}!$*</p>. + * + * @param description the description value to set. + * @return the PrefixListId object itself. + */ + public PrefixListId withDescription(String description) { + this.description = description; + return this; + } + + /** + * Get the prefixListId property: <p>The ID of the prefix.</p>. + * + * @return the prefixListId value. + */ + public String prefixListId() { + return this.prefixListId; + } + + /** + * Set the prefixListId property: <p>The ID of the prefix.</p>. + * + * @param prefixListId the prefixListId value to set. + * @return the PrefixListId object itself. + */ + public PrefixListId withPrefixListId(String prefixListId) { + this.prefixListId = prefixListId; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("description", this.description); + jsonWriter.writeStringField("prefixListId", this.prefixListId); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of PrefixListId from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of PrefixListId if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the PrefixListId. + */ + public static PrefixListId fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + PrefixListId deserializedPrefixListId = new PrefixListId(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("description".equals(fieldName)) { + deserializedPrefixListId.description = reader.getString(); + } else if ("prefixListId".equals(fieldName)) { + deserializedPrefixListId.prefixListId = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedPrefixListId; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/PrivateDnsNameOptionsOnLaunchModelProperties.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/PrivateDnsNameOptionsOnLaunchModelProperties.java new file mode 100644 index 000000000000..693e81f6b67f --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/PrivateDnsNameOptionsOnLaunchModelProperties.java @@ -0,0 +1,155 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of PrivateDnsNameOptionsOnLaunchModelProperties. + */ +@Fluent +public final class PrivateDnsNameOptionsOnLaunchModelProperties + implements JsonSerializable { + /* + * Property enableResourceNameDnsAAAARecord + */ + private Boolean enableResourceNameDnsAaaaRecord; + + /* + * Property enableResourceNameDnsARecord + */ + private Boolean enableResourceNameDnsARecord; + + /* + * Property hostnameType + */ + private String hostnameType; + + /** + * Creates an instance of PrivateDnsNameOptionsOnLaunchModelProperties class. + */ + public PrivateDnsNameOptionsOnLaunchModelProperties() { + } + + /** + * Get the enableResourceNameDnsAaaaRecord property: Property enableResourceNameDnsAAAARecord. + * + * @return the enableResourceNameDnsAaaaRecord value. + */ + public Boolean enableResourceNameDnsAaaaRecord() { + return this.enableResourceNameDnsAaaaRecord; + } + + /** + * Set the enableResourceNameDnsAaaaRecord property: Property enableResourceNameDnsAAAARecord. + * + * @param enableResourceNameDnsAaaaRecord the enableResourceNameDnsAaaaRecord value to set. + * @return the PrivateDnsNameOptionsOnLaunchModelProperties object itself. + */ + public PrivateDnsNameOptionsOnLaunchModelProperties + withEnableResourceNameDnsAaaaRecord(Boolean enableResourceNameDnsAaaaRecord) { + this.enableResourceNameDnsAaaaRecord = enableResourceNameDnsAaaaRecord; + return this; + } + + /** + * Get the enableResourceNameDnsARecord property: Property enableResourceNameDnsARecord. + * + * @return the enableResourceNameDnsARecord value. + */ + public Boolean enableResourceNameDnsARecord() { + return this.enableResourceNameDnsARecord; + } + + /** + * Set the enableResourceNameDnsARecord property: Property enableResourceNameDnsARecord. + * + * @param enableResourceNameDnsARecord the enableResourceNameDnsARecord value to set. + * @return the PrivateDnsNameOptionsOnLaunchModelProperties object itself. + */ + public PrivateDnsNameOptionsOnLaunchModelProperties + withEnableResourceNameDnsARecord(Boolean enableResourceNameDnsARecord) { + this.enableResourceNameDnsARecord = enableResourceNameDnsARecord; + return this; + } + + /** + * Get the hostnameType property: Property hostnameType. + * + * @return the hostnameType value. + */ + public String hostnameType() { + return this.hostnameType; + } + + /** + * Set the hostnameType property: Property hostnameType. + * + * @param hostnameType the hostnameType value to set. + * @return the PrivateDnsNameOptionsOnLaunchModelProperties object itself. + */ + public PrivateDnsNameOptionsOnLaunchModelProperties withHostnameType(String hostnameType) { + this.hostnameType = hostnameType; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeBooleanField("enableResourceNameDnsAAAARecord", this.enableResourceNameDnsAaaaRecord); + jsonWriter.writeBooleanField("enableResourceNameDnsARecord", this.enableResourceNameDnsARecord); + jsonWriter.writeStringField("hostnameType", this.hostnameType); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of PrivateDnsNameOptionsOnLaunchModelProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of PrivateDnsNameOptionsOnLaunchModelProperties if the JsonReader was pointing to an instance + * of it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the PrivateDnsNameOptionsOnLaunchModelProperties. + */ + public static PrivateDnsNameOptionsOnLaunchModelProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + PrivateDnsNameOptionsOnLaunchModelProperties deserializedPrivateDnsNameOptionsOnLaunchModelProperties + = new PrivateDnsNameOptionsOnLaunchModelProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("enableResourceNameDnsAAAARecord".equals(fieldName)) { + deserializedPrivateDnsNameOptionsOnLaunchModelProperties.enableResourceNameDnsAaaaRecord + = reader.getNullable(JsonReader::getBoolean); + } else if ("enableResourceNameDnsARecord".equals(fieldName)) { + deserializedPrivateDnsNameOptionsOnLaunchModelProperties.enableResourceNameDnsARecord + = reader.getNullable(JsonReader::getBoolean); + } else if ("hostnameType".equals(fieldName)) { + deserializedPrivateDnsNameOptionsOnLaunchModelProperties.hostnameType = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedPrivateDnsNameOptionsOnLaunchModelProperties; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/PrivateDnsNameOptionsResponse.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/PrivateDnsNameOptionsResponse.java new file mode 100644 index 000000000000..f271512950f5 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/PrivateDnsNameOptionsResponse.java @@ -0,0 +1,159 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of PrivateDnsNameOptionsResponse. + */ +@Fluent +public final class PrivateDnsNameOptionsResponse implements JsonSerializable { + /* + *

Indicates whether to respond to DNS queries for instance hostnames with DNS AAAA records.

+ */ + private Boolean enableResourceNameDnsAaaaRecord; + + /* + *

Indicates whether to respond to DNS queries for instance hostnames with DNS A records.

+ */ + private Boolean enableResourceNameDnsARecord; + + /* + *

The type of hostname to assign to an instance.

+ */ + private HostnameTypeEnumValue hostnameType; + + /** + * Creates an instance of PrivateDnsNameOptionsResponse class. + */ + public PrivateDnsNameOptionsResponse() { + } + + /** + * Get the enableResourceNameDnsAaaaRecord property: <p>Indicates whether to respond to DNS queries for + * instance hostnames with DNS AAAA records.</p>. + * + * @return the enableResourceNameDnsAaaaRecord value. + */ + public Boolean enableResourceNameDnsAaaaRecord() { + return this.enableResourceNameDnsAaaaRecord; + } + + /** + * Set the enableResourceNameDnsAaaaRecord property: <p>Indicates whether to respond to DNS queries for + * instance hostnames with DNS AAAA records.</p>. + * + * @param enableResourceNameDnsAaaaRecord the enableResourceNameDnsAaaaRecord value to set. + * @return the PrivateDnsNameOptionsResponse object itself. + */ + public PrivateDnsNameOptionsResponse withEnableResourceNameDnsAaaaRecord(Boolean enableResourceNameDnsAaaaRecord) { + this.enableResourceNameDnsAaaaRecord = enableResourceNameDnsAaaaRecord; + return this; + } + + /** + * Get the enableResourceNameDnsARecord property: <p>Indicates whether to respond to DNS queries for instance + * hostnames with DNS A records.</p>. + * + * @return the enableResourceNameDnsARecord value. + */ + public Boolean enableResourceNameDnsARecord() { + return this.enableResourceNameDnsARecord; + } + + /** + * Set the enableResourceNameDnsARecord property: <p>Indicates whether to respond to DNS queries for instance + * hostnames with DNS A records.</p>. + * + * @param enableResourceNameDnsARecord the enableResourceNameDnsARecord value to set. + * @return the PrivateDnsNameOptionsResponse object itself. + */ + public PrivateDnsNameOptionsResponse withEnableResourceNameDnsARecord(Boolean enableResourceNameDnsARecord) { + this.enableResourceNameDnsARecord = enableResourceNameDnsARecord; + return this; + } + + /** + * Get the hostnameType property: <p>The type of hostname to assign to an instance.</p>. + * + * @return the hostnameType value. + */ + public HostnameTypeEnumValue hostnameType() { + return this.hostnameType; + } + + /** + * Set the hostnameType property: <p>The type of hostname to assign to an instance.</p>. + * + * @param hostnameType the hostnameType value to set. + * @return the PrivateDnsNameOptionsResponse object itself. + */ + public PrivateDnsNameOptionsResponse withHostnameType(HostnameTypeEnumValue hostnameType) { + this.hostnameType = hostnameType; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (hostnameType() != null) { + hostnameType().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeBooleanField("enableResourceNameDnsAAAARecord", this.enableResourceNameDnsAaaaRecord); + jsonWriter.writeBooleanField("enableResourceNameDnsARecord", this.enableResourceNameDnsARecord); + jsonWriter.writeJsonField("hostnameType", this.hostnameType); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of PrivateDnsNameOptionsResponse from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of PrivateDnsNameOptionsResponse if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the PrivateDnsNameOptionsResponse. + */ + public static PrivateDnsNameOptionsResponse fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + PrivateDnsNameOptionsResponse deserializedPrivateDnsNameOptionsResponse + = new PrivateDnsNameOptionsResponse(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("enableResourceNameDnsAAAARecord".equals(fieldName)) { + deserializedPrivateDnsNameOptionsResponse.enableResourceNameDnsAaaaRecord + = reader.getNullable(JsonReader::getBoolean); + } else if ("enableResourceNameDnsARecord".equals(fieldName)) { + deserializedPrivateDnsNameOptionsResponse.enableResourceNameDnsARecord + = reader.getNullable(JsonReader::getBoolean); + } else if ("hostnameType".equals(fieldName)) { + deserializedPrivateDnsNameOptionsResponse.hostnameType = HostnameTypeEnumValue.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedPrivateDnsNameOptionsResponse; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/PrivateIpAddressSpecification.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/PrivateIpAddressSpecification.java new file mode 100644 index 000000000000..3b823acb809d --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/PrivateIpAddressSpecification.java @@ -0,0 +1,122 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of PrivateIpAddressSpecification. + */ +@Fluent +public final class PrivateIpAddressSpecification implements JsonSerializable { + /* + * Property primary + */ + private Boolean primary; + + /* + * Property privateIpAddress + */ + private String privateIpAddress; + + /** + * Creates an instance of PrivateIpAddressSpecification class. + */ + public PrivateIpAddressSpecification() { + } + + /** + * Get the primary property: Property primary. + * + * @return the primary value. + */ + public Boolean primary() { + return this.primary; + } + + /** + * Set the primary property: Property primary. + * + * @param primary the primary value to set. + * @return the PrivateIpAddressSpecification object itself. + */ + public PrivateIpAddressSpecification withPrimary(Boolean primary) { + this.primary = primary; + return this; + } + + /** + * Get the privateIpAddress property: Property privateIpAddress. + * + * @return the privateIpAddress value. + */ + public String privateIpAddress() { + return this.privateIpAddress; + } + + /** + * Set the privateIpAddress property: Property privateIpAddress. + * + * @param privateIpAddress the privateIpAddress value to set. + * @return the PrivateIpAddressSpecification object itself. + */ + public PrivateIpAddressSpecification withPrivateIpAddress(String privateIpAddress) { + this.privateIpAddress = privateIpAddress; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeBooleanField("primary", this.primary); + jsonWriter.writeStringField("privateIpAddress", this.privateIpAddress); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of PrivateIpAddressSpecification from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of PrivateIpAddressSpecification if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the PrivateIpAddressSpecification. + */ + public static PrivateIpAddressSpecification fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + PrivateIpAddressSpecification deserializedPrivateIpAddressSpecification + = new PrivateIpAddressSpecification(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("primary".equals(fieldName)) { + deserializedPrivateIpAddressSpecification.primary = reader.getNullable(JsonReader::getBoolean); + } else if ("privateIpAddress".equals(fieldName)) { + deserializedPrivateIpAddressSpecification.privateIpAddress = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedPrivateIpAddressSpecification; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ProcessorFeature.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ProcessorFeature.java new file mode 100644 index 000000000000..9e2726ccf885 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ProcessorFeature.java @@ -0,0 +1,121 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of ProcessorFeature. + */ +@Fluent +public final class ProcessorFeature implements JsonSerializable { + /* + * The name of the processor feature. Valid names are ``coreCount`` and ``threadsPerCore``. + */ + private ProcessorFeatureName name; + + /* + * The value of a processor feature name. + */ + private String value; + + /** + * Creates an instance of ProcessorFeature class. + */ + public ProcessorFeature() { + } + + /** + * Get the name property: The name of the processor feature. Valid names are ``coreCount`` and ``threadsPerCore``. + * + * @return the name value. + */ + public ProcessorFeatureName name() { + return this.name; + } + + /** + * Set the name property: The name of the processor feature. Valid names are ``coreCount`` and ``threadsPerCore``. + * + * @param name the name value to set. + * @return the ProcessorFeature object itself. + */ + public ProcessorFeature withName(ProcessorFeatureName name) { + this.name = name; + return this; + } + + /** + * Get the value property: The value of a processor feature name. + * + * @return the value value. + */ + public String value() { + return this.value; + } + + /** + * Set the value property: The value of a processor feature name. + * + * @param value the value value to set. + * @return the ProcessorFeature object itself. + */ + public ProcessorFeature withValue(String value) { + this.value = value; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("name", this.name == null ? null : this.name.toString()); + jsonWriter.writeStringField("value", this.value); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ProcessorFeature from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ProcessorFeature if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the ProcessorFeature. + */ + public static ProcessorFeature fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ProcessorFeature deserializedProcessorFeature = new ProcessorFeature(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("name".equals(fieldName)) { + deserializedProcessorFeature.name = ProcessorFeatureName.fromString(reader.getString()); + } else if ("value".equals(fieldName)) { + deserializedProcessorFeature.value = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedProcessorFeature; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ProcessorFeatureAutoGenerated.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ProcessorFeatureAutoGenerated.java new file mode 100644 index 000000000000..a2691cbb176a --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ProcessorFeatureAutoGenerated.java @@ -0,0 +1,124 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of ProcessorFeature. + */ +@Fluent +public final class ProcessorFeatureAutoGenerated implements JsonSerializable { + /* + *

The name of the processor feature. Valid names are coreCount and threadsPerCore.

+ */ + private String name; + + /* + *

The value of a processor feature name.

+ */ + private String value; + + /** + * Creates an instance of ProcessorFeatureAutoGenerated class. + */ + public ProcessorFeatureAutoGenerated() { + } + + /** + * Get the name property: <p>The name of the processor feature. Valid names are + * <code>coreCount</code> and <code>threadsPerCore</code>.</p>. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: <p>The name of the processor feature. Valid names are + * <code>coreCount</code> and <code>threadsPerCore</code>.</p>. + * + * @param name the name value to set. + * @return the ProcessorFeatureAutoGenerated object itself. + */ + public ProcessorFeatureAutoGenerated withName(String name) { + this.name = name; + return this; + } + + /** + * Get the value property: <p>The value of a processor feature name.</p>. + * + * @return the value value. + */ + public String value() { + return this.value; + } + + /** + * Set the value property: <p>The value of a processor feature name.</p>. + * + * @param value the value value to set. + * @return the ProcessorFeatureAutoGenerated object itself. + */ + public ProcessorFeatureAutoGenerated withValue(String value) { + this.value = value; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("name", this.name); + jsonWriter.writeStringField("value", this.value); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ProcessorFeatureAutoGenerated from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ProcessorFeatureAutoGenerated if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ProcessorFeatureAutoGenerated. + */ + public static ProcessorFeatureAutoGenerated fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ProcessorFeatureAutoGenerated deserializedProcessorFeatureAutoGenerated + = new ProcessorFeatureAutoGenerated(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("name".equals(fieldName)) { + deserializedProcessorFeatureAutoGenerated.name = reader.getString(); + } else if ("value".equals(fieldName)) { + deserializedProcessorFeatureAutoGenerated.value = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedProcessorFeatureAutoGenerated; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ProcessorFeatureName.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ProcessorFeatureName.java new file mode 100644 index 000000000000..21a127b0d566 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ProcessorFeatureName.java @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * ProcessorFeatureName enum. + */ +public final class ProcessorFeatureName extends ExpandableStringEnum { + /** + * Static value coreCount for ProcessorFeatureName. + */ + public static final ProcessorFeatureName CORE_COUNT = fromString("coreCount"); + + /** + * Static value threadsPerCore for ProcessorFeatureName. + */ + public static final ProcessorFeatureName THREADS_PER_CORE = fromString("threadsPerCore"); + + /** + * Creates a new instance of ProcessorFeatureName value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ProcessorFeatureName() { + } + + /** + * Creates or finds a ProcessorFeatureName from its string representation. + * + * @param name a name to look for. + * @return the corresponding ProcessorFeatureName. + */ + public static ProcessorFeatureName fromString(String name) { + return fromString(name, ProcessorFeatureName.class); + } + + /** + * Gets known ProcessorFeatureName values. + * + * @return known ProcessorFeatureName values. + */ + public static Collection values() { + return values(ProcessorFeatureName.class); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ProductCode.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ProductCode.java new file mode 100644 index 000000000000..3aa5f59d40fa --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ProductCode.java @@ -0,0 +1,124 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of ProductCode. + */ +@Fluent +public final class ProductCode implements JsonSerializable { + /* + *

The product code.

+ */ + private String productCodeId; + + /* + *

The type of product code.

+ */ + private ProductCodeValuesEnumValue productCodeType; + + /** + * Creates an instance of ProductCode class. + */ + public ProductCode() { + } + + /** + * Get the productCodeId property: <p>The product code.</p>. + * + * @return the productCodeId value. + */ + public String productCodeId() { + return this.productCodeId; + } + + /** + * Set the productCodeId property: <p>The product code.</p>. + * + * @param productCodeId the productCodeId value to set. + * @return the ProductCode object itself. + */ + public ProductCode withProductCodeId(String productCodeId) { + this.productCodeId = productCodeId; + return this; + } + + /** + * Get the productCodeType property: <p>The type of product code.</p>. + * + * @return the productCodeType value. + */ + public ProductCodeValuesEnumValue productCodeType() { + return this.productCodeType; + } + + /** + * Set the productCodeType property: <p>The type of product code.</p>. + * + * @param productCodeType the productCodeType value to set. + * @return the ProductCode object itself. + */ + public ProductCode withProductCodeType(ProductCodeValuesEnumValue productCodeType) { + this.productCodeType = productCodeType; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (productCodeType() != null) { + productCodeType().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("productCodeId", this.productCodeId); + jsonWriter.writeJsonField("productCodeType", this.productCodeType); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ProductCode from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ProductCode if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the ProductCode. + */ + public static ProductCode fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ProductCode deserializedProductCode = new ProductCode(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("productCodeId".equals(fieldName)) { + deserializedProductCode.productCodeId = reader.getString(); + } else if ("productCodeType".equals(fieldName)) { + deserializedProductCode.productCodeType = ProductCodeValuesEnumValue.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedProductCode; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ProductCodeValues.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ProductCodeValues.java new file mode 100644 index 000000000000..6430c0a4c052 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ProductCodeValues.java @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * ProductCodeValues enum. + */ +public final class ProductCodeValues extends ExpandableStringEnum { + /** + * Static value devpay for ProductCodeValues. + */ + public static final ProductCodeValues DEVPAY = fromString("devpay"); + + /** + * Static value marketplace for ProductCodeValues. + */ + public static final ProductCodeValues MARKETPLACE = fromString("marketplace"); + + /** + * Creates a new instance of ProductCodeValues value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ProductCodeValues() { + } + + /** + * Creates or finds a ProductCodeValues from its string representation. + * + * @param name a name to look for. + * @return the corresponding ProductCodeValues. + */ + public static ProductCodeValues fromString(String name) { + return fromString(name, ProductCodeValues.class); + } + + /** + * Gets known ProductCodeValues values. + * + * @return known ProductCodeValues values. + */ + public static Collection values() { + return values(ProductCodeValues.class); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ProductCodeValuesEnumValue.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ProductCodeValuesEnumValue.java new file mode 100644 index 000000000000..08ac0c1af898 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ProductCodeValuesEnumValue.java @@ -0,0 +1,93 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of ProductCodeValuesEnumValue. + */ +@Fluent +public final class ProductCodeValuesEnumValue implements JsonSerializable { + /* + * Property value + */ + private ProductCodeValues value; + + /** + * Creates an instance of ProductCodeValuesEnumValue class. + */ + public ProductCodeValuesEnumValue() { + } + + /** + * Get the value property: Property value. + * + * @return the value value. + */ + public ProductCodeValues value() { + return this.value; + } + + /** + * Set the value property: Property value. + * + * @param value the value value to set. + * @return the ProductCodeValuesEnumValue object itself. + */ + public ProductCodeValuesEnumValue withValue(ProductCodeValues value) { + this.value = value; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("value", this.value == null ? null : this.value.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ProductCodeValuesEnumValue from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ProductCodeValuesEnumValue if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ProductCodeValuesEnumValue. + */ + public static ProductCodeValuesEnumValue fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ProductCodeValuesEnumValue deserializedProductCodeValuesEnumValue = new ProductCodeValuesEnumValue(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + deserializedProductCodeValuesEnumValue.value = ProductCodeValues.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedProductCodeValuesEnumValue; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ProjectArtifacts.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ProjectArtifacts.java new file mode 100644 index 000000000000..04e5d414ee91 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ProjectArtifacts.java @@ -0,0 +1,556 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of ProjectArtifacts. + */ +@Fluent +public final class ProjectArtifacts implements JsonSerializable { + /* + *

An identifier for this artifact definition.

+ */ + private String artifactIdentifier; + + /* + * Property bucketOwnerAccess + */ + private BucketOwnerAccessEnumValue bucketOwnerAccess; + + /* + *

Set to true if you do not want your output artifacts encrypted. This option is valid only if your artifacts + * type is Amazon S3. If this is set with another artifacts type, an invalidInputException is thrown.

+ */ + private Boolean encryptionDisabled; + + /* + *

Information about the build output artifact location:

  • If type is set to + * CODEPIPELINE, CodePipeline ignores this value if specified. This is because CodePipeline manages its + * build output locations instead of CodeBuild.

  • If type is set to + * NO_ARTIFACTS, this value is ignored if specified, because no build output is produced.

  • + *
  • If type is set to S3, this is the name of the output bucket.

+ */ + private String location; + + /* + *

Along with path and namespaceType, the pattern that CodeBuild uses to name and store + * the output artifact:

  • If type is set to CODEPIPELINE, CodePipeline + * ignores this value if specified. This is because CodePipeline manages its build output names instead of + * CodeBuild.

  • If type is set to NO_ARTIFACTS, this value is ignored if + * specified, because no build output is produced.

  • If type is set to S3, + * this is the name of the output artifact object. If you set the name to be a forward slash ('/'), the artifact is + * stored in the root of the output bucket.

For example:

  • If path + * is set to MyArtifacts, namespaceType is set to BUILD_ID, and + * name is set to MyArtifact.zip, then the output artifact is stored in + * MyArtifacts/<build-ID>/MyArtifact.zip.

  • If path is empty, + * namespaceType is set to NONE, and name is set to '/', the + * output artifact is stored in the root of the output bucket.

  • If path is set to + * MyArtifacts, namespaceType is set to BUILD_ID, and name is + * set to '/', the output artifact is stored in MyArtifacts/<build-ID>.

  • + *
+ */ + private String name; + + /* + *

Along with path and name, the pattern that CodeBuild uses to determine the name and + * location to store the output artifact:

  • If type is set to CODEPIPELINE, + * CodePipeline ignores this value if specified. This is because CodePipeline manages its build output names instead + * of CodeBuild.

  • If type is set to NO_ARTIFACTS, this value is ignored + * if specified, because no build output is produced.

  • If type is set to + * S3, valid values include:

    • BUILD_ID: Include the build ID in the + * location of the build output artifact.

    • NONE: Do not include the build ID. This is + * the default if namespaceType is not specified.

For example, if + * path is set to MyArtifacts, namespaceType is set to BUILD_ID, + * and name is set to MyArtifact.zip, the output artifact is stored in + * MyArtifacts/<build-ID>/MyArtifact.zip.

+ */ + private ArtifactNamespaceEnumValue namespaceType; + + /* + *

If this flag is set, a name specified in the buildspec file overrides the artifact name. The name specified + * in a buildspec file is calculated at build time and uses the Shell Command Language. For example, you can append + * a date and time to your artifact name so that it is always unique.

+ */ + private Boolean overrideArtifactName; + + /* + *

The type of build output artifact to create:

  • If type is set to + * CODEPIPELINE, CodePipeline ignores this value if specified. This is because CodePipeline manages its + * build output artifacts instead of CodeBuild.

  • If type is set to + * NO_ARTIFACTS, this value is ignored if specified, because no build output is produced.

  • + *
  • If type is set to S3, valid values include:

    • + * NONE: CodeBuild creates in the output bucket a folder that contains the build output. This is the + * default if packaging is not specified.

    • ZIP: CodeBuild creates in the + * output bucket a ZIP file that contains the build output.

+ */ + private ArtifactPackagingEnumValue packaging; + + /* + *

Along with namespaceType and name, the pattern that CodeBuild uses to name and store + * the output artifact:

  • If type is set to CODEPIPELINE, CodePipeline + * ignores this value if specified. This is because CodePipeline manages its build output names instead of + * CodeBuild.

  • If type is set to NO_ARTIFACTS, this value is ignored if + * specified, because no build output is produced.

  • If type is set to S3, + * this is the path to the output artifact. If path is not specified, path is not + * used.

For example, if path is set to MyArtifacts, + * namespaceType is set to NONE, and name is set to + * MyArtifact.zip, the output artifact is stored in the output bucket at + * MyArtifacts/MyArtifact.zip.

+ */ + private String path; + + /* + *

The type of build output artifact. Valid values include:

  • CODEPIPELINE: The + * build project has build output generated through CodePipeline.

    The CODEPIPELINE type + * is not supported for secondaryArtifacts.

  • NO_ARTIFACTS: The + * build project does not produce any build output.

  • S3: The build project stores + * build output in Amazon S3.

+ */ + private ArtifactsTypeEnumValue type; + + /** + * Creates an instance of ProjectArtifacts class. + */ + public ProjectArtifacts() { + } + + /** + * Get the artifactIdentifier property: <p> An identifier for this artifact definition. </p>. + * + * @return the artifactIdentifier value. + */ + public String artifactIdentifier() { + return this.artifactIdentifier; + } + + /** + * Set the artifactIdentifier property: <p> An identifier for this artifact definition. </p>. + * + * @param artifactIdentifier the artifactIdentifier value to set. + * @return the ProjectArtifacts object itself. + */ + public ProjectArtifacts withArtifactIdentifier(String artifactIdentifier) { + this.artifactIdentifier = artifactIdentifier; + return this; + } + + /** + * Get the bucketOwnerAccess property: Property bucketOwnerAccess. + * + * @return the bucketOwnerAccess value. + */ + public BucketOwnerAccessEnumValue bucketOwnerAccess() { + return this.bucketOwnerAccess; + } + + /** + * Set the bucketOwnerAccess property: Property bucketOwnerAccess. + * + * @param bucketOwnerAccess the bucketOwnerAccess value to set. + * @return the ProjectArtifacts object itself. + */ + public ProjectArtifacts withBucketOwnerAccess(BucketOwnerAccessEnumValue bucketOwnerAccess) { + this.bucketOwnerAccess = bucketOwnerAccess; + return this; + } + + /** + * Get the encryptionDisabled property: <p> Set to true if you do not want your output artifacts encrypted. + * This option is valid only if your artifacts type is Amazon S3. If this is set with another artifacts type, an + * invalidInputException is thrown. </p>. + * + * @return the encryptionDisabled value. + */ + public Boolean encryptionDisabled() { + return this.encryptionDisabled; + } + + /** + * Set the encryptionDisabled property: <p> Set to true if you do not want your output artifacts encrypted. + * This option is valid only if your artifacts type is Amazon S3. If this is set with another artifacts type, an + * invalidInputException is thrown. </p>. + * + * @param encryptionDisabled the encryptionDisabled value to set. + * @return the ProjectArtifacts object itself. + */ + public ProjectArtifacts withEncryptionDisabled(Boolean encryptionDisabled) { + this.encryptionDisabled = encryptionDisabled; + return this; + } + + /** + * Get the location property: <p>Information about the build output artifact location:</p> <ul> + * <li> <p>If <code>type</code> is set to <code>CODEPIPELINE</code>, + * CodePipeline ignores this value if specified. This is because CodePipeline manages its build output locations + * instead of CodeBuild.</p> </li> <li> <p>If <code>type</code> is set to + * <code>NO_ARTIFACTS</code>, this value is ignored if specified, because no build output is + * produced.</p> </li> <li> <p>If <code>type</code> is set to + * <code>S3</code>, this is the name of the output bucket.</p> </li> </ul>. + * + * @return the location value. + */ + public String location() { + return this.location; + } + + /** + * Set the location property: <p>Information about the build output artifact location:</p> <ul> + * <li> <p>If <code>type</code> is set to <code>CODEPIPELINE</code>, + * CodePipeline ignores this value if specified. This is because CodePipeline manages its build output locations + * instead of CodeBuild.</p> </li> <li> <p>If <code>type</code> is set to + * <code>NO_ARTIFACTS</code>, this value is ignored if specified, because no build output is + * produced.</p> </li> <li> <p>If <code>type</code> is set to + * <code>S3</code>, this is the name of the output bucket.</p> </li> </ul>. + * + * @param location the location value to set. + * @return the ProjectArtifacts object itself. + */ + public ProjectArtifacts withLocation(String location) { + this.location = location; + return this; + } + + /** + * Get the name property: <p>Along with <code>path</code> and + * <code>namespaceType</code>, the pattern that CodeBuild uses to name and store the output + * artifact:</p> <ul> <li> <p>If <code>type</code> is set to + * <code>CODEPIPELINE</code>, CodePipeline ignores this value if specified. This is because CodePipeline + * manages its build output names instead of CodeBuild.</p> </li> <li> <p>If + * <code>type</code> is set to <code>NO_ARTIFACTS</code>, this value is ignored if + * specified, because no build output is produced.</p> </li> <li> <p>If + * <code>type</code> is set to <code>S3</code>, this is the name of the output artifact + * object. If you set the name to be a forward slash ('/'), the artifact is stored in the root of the output + * bucket.</p> </li> </ul> <p>For example:</p> <ul> <li> <p> If + * <code>path</code> is set to <code>MyArtifacts</code>, + * <code>namespaceType</code> is set to <code>BUILD_ID</code>, and + * <code>name</code> is set to <code>MyArtifact.zip</code>, then the output artifact is + * stored in <code>MyArtifacts/&lt;build-ID&gt;/MyArtifact.zip</code>. </p> </li> + * <li> <p> If <code>path</code> is empty, <code>namespaceType</code> is set to + * <code>NONE</code>, and <code>name</code> is set to '<code>/</code>', the + * output artifact is stored in the root of the output bucket. </p> </li> <li> <p> If + * <code>path</code> is set to <code>MyArtifacts</code>, + * <code>namespaceType</code> is set to <code>BUILD_ID</code>, and + * <code>name</code> is set to '<code>/</code>', the output artifact is stored in + * <code>MyArtifacts/&lt;build-ID&gt;</code>. </p> </li> </ul>. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: <p>Along with <code>path</code> and + * <code>namespaceType</code>, the pattern that CodeBuild uses to name and store the output + * artifact:</p> <ul> <li> <p>If <code>type</code> is set to + * <code>CODEPIPELINE</code>, CodePipeline ignores this value if specified. This is because CodePipeline + * manages its build output names instead of CodeBuild.</p> </li> <li> <p>If + * <code>type</code> is set to <code>NO_ARTIFACTS</code>, this value is ignored if + * specified, because no build output is produced.</p> </li> <li> <p>If + * <code>type</code> is set to <code>S3</code>, this is the name of the output artifact + * object. If you set the name to be a forward slash ('/'), the artifact is stored in the root of the output + * bucket.</p> </li> </ul> <p>For example:</p> <ul> <li> <p> If + * <code>path</code> is set to <code>MyArtifacts</code>, + * <code>namespaceType</code> is set to <code>BUILD_ID</code>, and + * <code>name</code> is set to <code>MyArtifact.zip</code>, then the output artifact is + * stored in <code>MyArtifacts/&lt;build-ID&gt;/MyArtifact.zip</code>. </p> </li> + * <li> <p> If <code>path</code> is empty, <code>namespaceType</code> is set to + * <code>NONE</code>, and <code>name</code> is set to '<code>/</code>', the + * output artifact is stored in the root of the output bucket. </p> </li> <li> <p> If + * <code>path</code> is set to <code>MyArtifacts</code>, + * <code>namespaceType</code> is set to <code>BUILD_ID</code>, and + * <code>name</code> is set to '<code>/</code>', the output artifact is stored in + * <code>MyArtifacts/&lt;build-ID&gt;</code>. </p> </li> </ul>. + * + * @param name the name value to set. + * @return the ProjectArtifacts object itself. + */ + public ProjectArtifacts withName(String name) { + this.name = name; + return this; + } + + /** + * Get the namespaceType property: <p>Along with <code>path</code> and + * <code>name</code>, the pattern that CodeBuild uses to determine the name and location to store the + * output artifact:</p> <ul> <li> <p>If <code>type</code> is set to + * <code>CODEPIPELINE</code>, CodePipeline ignores this value if specified. This is because CodePipeline + * manages its build output names instead of CodeBuild.</p> </li> <li> <p>If + * <code>type</code> is set to <code>NO_ARTIFACTS</code>, this value is ignored if + * specified, because no build output is produced.</p> </li> <li> <p>If + * <code>type</code> is set to <code>S3</code>, valid values include:</p> <ul> + * <li> <p> <code>BUILD_ID</code>: Include the build ID in the location of the build output + * artifact.</p> </li> <li> <p> <code>NONE</code>: Do not include the build ID. + * This is the default if <code>namespaceType</code> is not specified.</p> </li> </ul> + * </li> </ul> <p>For example, if <code>path</code> is set to + * <code>MyArtifacts</code>, <code>namespaceType</code> is set to + * <code>BUILD_ID</code>, and <code>name</code> is set to + * <code>MyArtifact.zip</code>, the output artifact is stored in + * <code>MyArtifacts/&lt;build-ID&gt;/MyArtifact.zip</code>.</p>. + * + * @return the namespaceType value. + */ + public ArtifactNamespaceEnumValue namespaceType() { + return this.namespaceType; + } + + /** + * Set the namespaceType property: <p>Along with <code>path</code> and + * <code>name</code>, the pattern that CodeBuild uses to determine the name and location to store the + * output artifact:</p> <ul> <li> <p>If <code>type</code> is set to + * <code>CODEPIPELINE</code>, CodePipeline ignores this value if specified. This is because CodePipeline + * manages its build output names instead of CodeBuild.</p> </li> <li> <p>If + * <code>type</code> is set to <code>NO_ARTIFACTS</code>, this value is ignored if + * specified, because no build output is produced.</p> </li> <li> <p>If + * <code>type</code> is set to <code>S3</code>, valid values include:</p> <ul> + * <li> <p> <code>BUILD_ID</code>: Include the build ID in the location of the build output + * artifact.</p> </li> <li> <p> <code>NONE</code>: Do not include the build ID. + * This is the default if <code>namespaceType</code> is not specified.</p> </li> </ul> + * </li> </ul> <p>For example, if <code>path</code> is set to + * <code>MyArtifacts</code>, <code>namespaceType</code> is set to + * <code>BUILD_ID</code>, and <code>name</code> is set to + * <code>MyArtifact.zip</code>, the output artifact is stored in + * <code>MyArtifacts/&lt;build-ID&gt;/MyArtifact.zip</code>.</p>. + * + * @param namespaceType the namespaceType value to set. + * @return the ProjectArtifacts object itself. + */ + public ProjectArtifacts withNamespaceType(ArtifactNamespaceEnumValue namespaceType) { + this.namespaceType = namespaceType; + return this; + } + + /** + * Get the overrideArtifactName property: <p> If this flag is set, a name specified in the buildspec file + * overrides the artifact name. The name specified in a buildspec file is calculated at build time and uses the + * Shell Command Language. For example, you can append a date and time to your artifact name so that it is always + * unique. </p>. + * + * @return the overrideArtifactName value. + */ + public Boolean overrideArtifactName() { + return this.overrideArtifactName; + } + + /** + * Set the overrideArtifactName property: <p> If this flag is set, a name specified in the buildspec file + * overrides the artifact name. The name specified in a buildspec file is calculated at build time and uses the + * Shell Command Language. For example, you can append a date and time to your artifact name so that it is always + * unique. </p>. + * + * @param overrideArtifactName the overrideArtifactName value to set. + * @return the ProjectArtifacts object itself. + */ + public ProjectArtifacts withOverrideArtifactName(Boolean overrideArtifactName) { + this.overrideArtifactName = overrideArtifactName; + return this; + } + + /** + * Get the packaging property: <p>The type of build output artifact to create:</p> <ul> <li> + * <p>If <code>type</code> is set to <code>CODEPIPELINE</code>, CodePipeline ignores + * this value if specified. This is because CodePipeline manages its build output artifacts instead of + * CodeBuild.</p> </li> <li> <p>If <code>type</code> is set to + * <code>NO_ARTIFACTS</code>, this value is ignored if specified, because no build output is + * produced.</p> </li> <li> <p>If <code>type</code> is set to + * <code>S3</code>, valid values include:</p> <ul> <li> <p> + * <code>NONE</code>: CodeBuild creates in the output bucket a folder that contains the build output. + * This is the default if <code>packaging</code> is not specified.</p> </li> <li> + * <p> <code>ZIP</code>: CodeBuild creates in the output bucket a ZIP file that contains the build + * output.</p> </li> </ul> </li> </ul>. + * + * @return the packaging value. + */ + public ArtifactPackagingEnumValue packaging() { + return this.packaging; + } + + /** + * Set the packaging property: <p>The type of build output artifact to create:</p> <ul> <li> + * <p>If <code>type</code> is set to <code>CODEPIPELINE</code>, CodePipeline ignores + * this value if specified. This is because CodePipeline manages its build output artifacts instead of + * CodeBuild.</p> </li> <li> <p>If <code>type</code> is set to + * <code>NO_ARTIFACTS</code>, this value is ignored if specified, because no build output is + * produced.</p> </li> <li> <p>If <code>type</code> is set to + * <code>S3</code>, valid values include:</p> <ul> <li> <p> + * <code>NONE</code>: CodeBuild creates in the output bucket a folder that contains the build output. + * This is the default if <code>packaging</code> is not specified.</p> </li> <li> + * <p> <code>ZIP</code>: CodeBuild creates in the output bucket a ZIP file that contains the build + * output.</p> </li> </ul> </li> </ul>. + * + * @param packaging the packaging value to set. + * @return the ProjectArtifacts object itself. + */ + public ProjectArtifacts withPackaging(ArtifactPackagingEnumValue packaging) { + this.packaging = packaging; + return this; + } + + /** + * Get the path property: <p>Along with <code>namespaceType</code> and + * <code>name</code>, the pattern that CodeBuild uses to name and store the output artifact:</p> + * <ul> <li> <p>If <code>type</code> is set to <code>CODEPIPELINE</code>, + * CodePipeline ignores this value if specified. This is because CodePipeline manages its build output names instead + * of CodeBuild.</p> </li> <li> <p>If <code>type</code> is set to + * <code>NO_ARTIFACTS</code>, this value is ignored if specified, because no build output is + * produced.</p> </li> <li> <p>If <code>type</code> is set to + * <code>S3</code>, this is the path to the output artifact. If <code>path</code> is not + * specified, <code>path</code> is not used.</p> </li> </ul> <p>For example, if + * <code>path</code> is set to <code>MyArtifacts</code>, + * <code>namespaceType</code> is set to <code>NONE</code>, and <code>name</code> + * is set to <code>MyArtifact.zip</code>, the output artifact is stored in the output bucket at + * <code>MyArtifacts/MyArtifact.zip</code>.</p>. + * + * @return the path value. + */ + public String path() { + return this.path; + } + + /** + * Set the path property: <p>Along with <code>namespaceType</code> and + * <code>name</code>, the pattern that CodeBuild uses to name and store the output artifact:</p> + * <ul> <li> <p>If <code>type</code> is set to <code>CODEPIPELINE</code>, + * CodePipeline ignores this value if specified. This is because CodePipeline manages its build output names instead + * of CodeBuild.</p> </li> <li> <p>If <code>type</code> is set to + * <code>NO_ARTIFACTS</code>, this value is ignored if specified, because no build output is + * produced.</p> </li> <li> <p>If <code>type</code> is set to + * <code>S3</code>, this is the path to the output artifact. If <code>path</code> is not + * specified, <code>path</code> is not used.</p> </li> </ul> <p>For example, if + * <code>path</code> is set to <code>MyArtifacts</code>, + * <code>namespaceType</code> is set to <code>NONE</code>, and <code>name</code> + * is set to <code>MyArtifact.zip</code>, the output artifact is stored in the output bucket at + * <code>MyArtifacts/MyArtifact.zip</code>.</p>. + * + * @param path the path value to set. + * @return the ProjectArtifacts object itself. + */ + public ProjectArtifacts withPath(String path) { + this.path = path; + return this; + } + + /** + * Get the type property: <p>The type of build output artifact. Valid values include:</p> <ul> + * <li> <p> <code>CODEPIPELINE</code>: The build project has build output generated through + * CodePipeline. </p> <note> <p>The <code>CODEPIPELINE</code> type is not supported + * for <code>secondaryArtifacts</code>.</p> </note> </li> <li> <p> + * <code>NO_ARTIFACTS</code>: The build project does not produce any build output.</p> </li> + * <li> <p> <code>S3</code>: The build project stores build output in Amazon S3.</p> + * </li> </ul>. + * + * @return the type value. + */ + public ArtifactsTypeEnumValue type() { + return this.type; + } + + /** + * Set the type property: <p>The type of build output artifact. Valid values include:</p> <ul> + * <li> <p> <code>CODEPIPELINE</code>: The build project has build output generated through + * CodePipeline. </p> <note> <p>The <code>CODEPIPELINE</code> type is not supported + * for <code>secondaryArtifacts</code>.</p> </note> </li> <li> <p> + * <code>NO_ARTIFACTS</code>: The build project does not produce any build output.</p> </li> + * <li> <p> <code>S3</code>: The build project stores build output in Amazon S3.</p> + * </li> </ul>. + * + * @param type the type value to set. + * @return the ProjectArtifacts object itself. + */ + public ProjectArtifacts withType(ArtifactsTypeEnumValue type) { + this.type = type; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (bucketOwnerAccess() != null) { + bucketOwnerAccess().validate(); + } + if (namespaceType() != null) { + namespaceType().validate(); + } + if (packaging() != null) { + packaging().validate(); + } + if (type() != null) { + type().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("artifactIdentifier", this.artifactIdentifier); + jsonWriter.writeJsonField("bucketOwnerAccess", this.bucketOwnerAccess); + jsonWriter.writeBooleanField("encryptionDisabled", this.encryptionDisabled); + jsonWriter.writeStringField("location", this.location); + jsonWriter.writeStringField("name", this.name); + jsonWriter.writeJsonField("namespaceType", this.namespaceType); + jsonWriter.writeBooleanField("overrideArtifactName", this.overrideArtifactName); + jsonWriter.writeJsonField("packaging", this.packaging); + jsonWriter.writeStringField("path", this.path); + jsonWriter.writeJsonField("type", this.type); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ProjectArtifacts from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ProjectArtifacts if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the ProjectArtifacts. + */ + public static ProjectArtifacts fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ProjectArtifacts deserializedProjectArtifacts = new ProjectArtifacts(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("artifactIdentifier".equals(fieldName)) { + deserializedProjectArtifacts.artifactIdentifier = reader.getString(); + } else if ("bucketOwnerAccess".equals(fieldName)) { + deserializedProjectArtifacts.bucketOwnerAccess = BucketOwnerAccessEnumValue.fromJson(reader); + } else if ("encryptionDisabled".equals(fieldName)) { + deserializedProjectArtifacts.encryptionDisabled = reader.getNullable(JsonReader::getBoolean); + } else if ("location".equals(fieldName)) { + deserializedProjectArtifacts.location = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedProjectArtifacts.name = reader.getString(); + } else if ("namespaceType".equals(fieldName)) { + deserializedProjectArtifacts.namespaceType = ArtifactNamespaceEnumValue.fromJson(reader); + } else if ("overrideArtifactName".equals(fieldName)) { + deserializedProjectArtifacts.overrideArtifactName = reader.getNullable(JsonReader::getBoolean); + } else if ("packaging".equals(fieldName)) { + deserializedProjectArtifacts.packaging = ArtifactPackagingEnumValue.fromJson(reader); + } else if ("path".equals(fieldName)) { + deserializedProjectArtifacts.path = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedProjectArtifacts.type = ArtifactsTypeEnumValue.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedProjectArtifacts; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ProjectBadge.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ProjectBadge.java new file mode 100644 index 000000000000..1424b0eb4853 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ProjectBadge.java @@ -0,0 +1,125 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of ProjectBadge. + */ +@Fluent +public final class ProjectBadge implements JsonSerializable { + /* + *

Set this to true to generate a publicly accessible URL for your project's build badge.

+ */ + private Boolean badgeEnabled; + + /* + *

The publicly-accessible URL through which you can access the build badge for your project.

+ */ + private String badgeRequestUrl; + + /** + * Creates an instance of ProjectBadge class. + */ + public ProjectBadge() { + } + + /** + * Get the badgeEnabled property: <p>Set this to true to generate a publicly accessible URL for your project's + * build badge.</p>. + * + * @return the badgeEnabled value. + */ + public Boolean badgeEnabled() { + return this.badgeEnabled; + } + + /** + * Set the badgeEnabled property: <p>Set this to true to generate a publicly accessible URL for your project's + * build badge.</p>. + * + * @param badgeEnabled the badgeEnabled value to set. + * @return the ProjectBadge object itself. + */ + public ProjectBadge withBadgeEnabled(Boolean badgeEnabled) { + this.badgeEnabled = badgeEnabled; + return this; + } + + /** + * Get the badgeRequestUrl property: <p>The publicly-accessible URL through which you can access the build + * badge for your project. </p>. + * + * @return the badgeRequestUrl value. + */ + public String badgeRequestUrl() { + return this.badgeRequestUrl; + } + + /** + * Set the badgeRequestUrl property: <p>The publicly-accessible URL through which you can access the build + * badge for your project. </p>. + * + * @param badgeRequestUrl the badgeRequestUrl value to set. + * @return the ProjectBadge object itself. + */ + public ProjectBadge withBadgeRequestUrl(String badgeRequestUrl) { + this.badgeRequestUrl = badgeRequestUrl; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeBooleanField("badgeEnabled", this.badgeEnabled); + jsonWriter.writeStringField("badgeRequestUrl", this.badgeRequestUrl); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ProjectBadge from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ProjectBadge if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the ProjectBadge. + */ + public static ProjectBadge fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ProjectBadge deserializedProjectBadge = new ProjectBadge(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("badgeEnabled".equals(fieldName)) { + deserializedProjectBadge.badgeEnabled = reader.getNullable(JsonReader::getBoolean); + } else if ("badgeRequestUrl".equals(fieldName)) { + deserializedProjectBadge.badgeRequestUrl = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedProjectBadge; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ProjectBuildBatchConfig.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ProjectBuildBatchConfig.java new file mode 100644 index 000000000000..750f11308d6a --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ProjectBuildBatchConfig.java @@ -0,0 +1,232 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of ProjectBuildBatchConfig. + */ +@Fluent +public final class ProjectBuildBatchConfig implements JsonSerializable { + /* + *

Specifies how build status reports are sent to the source provider for the batch build. This property is only + * used when the source provider for your project is Bitbucket, GitHub, or GitHub Enterprise, and your project is + * configured to report build statuses to the source provider.

REPORT_AGGREGATED_BATCH
+ *

(Default) Aggregate all of the build statuses into a single status report.

+ *
REPORT_INDIVIDUAL_BUILDS

Send a separate status report for each individual build.

+ *
+ */ + private BatchReportModeTypeEnumValue batchReportMode; + + /* + *

Specifies if the build artifacts for the batch build should be combined into a single artifact location.

+ */ + private Boolean combineArtifacts; + + /* + *

A BatchRestrictions object that specifies the restrictions for the batch build.

+ */ + private BatchRestrictions restrictions; + + /* + *

Specifies the service role ARN for the batch build project.

+ */ + private String serviceRole; + + /* + *

Specifies the maximum amount of time, in minutes, that the batch build must be completed in.

+ */ + private Integer timeoutInMins; + + /** + * Creates an instance of ProjectBuildBatchConfig class. + */ + public ProjectBuildBatchConfig() { + } + + /** + * Get the batchReportMode property: <p>Specifies how build status reports are sent to the source provider for + * the batch build. This property is only used when the source provider for your project is Bitbucket, GitHub, or + * GitHub Enterprise, and your project is configured to report build statuses to the source provider.</p> + * <dl> <dt>REPORT_AGGREGATED_BATCH</dt> <dd> <p>(Default) Aggregate all of the build + * statuses into a single status report.</p> </dd> <dt>REPORT_INDIVIDUAL_BUILDS</dt> + * <dd> <p>Send a separate status report for each individual build.</p> </dd> </dl>. + * + * @return the batchReportMode value. + */ + public BatchReportModeTypeEnumValue batchReportMode() { + return this.batchReportMode; + } + + /** + * Set the batchReportMode property: <p>Specifies how build status reports are sent to the source provider for + * the batch build. This property is only used when the source provider for your project is Bitbucket, GitHub, or + * GitHub Enterprise, and your project is configured to report build statuses to the source provider.</p> + * <dl> <dt>REPORT_AGGREGATED_BATCH</dt> <dd> <p>(Default) Aggregate all of the build + * statuses into a single status report.</p> </dd> <dt>REPORT_INDIVIDUAL_BUILDS</dt> + * <dd> <p>Send a separate status report for each individual build.</p> </dd> </dl>. + * + * @param batchReportMode the batchReportMode value to set. + * @return the ProjectBuildBatchConfig object itself. + */ + public ProjectBuildBatchConfig withBatchReportMode(BatchReportModeTypeEnumValue batchReportMode) { + this.batchReportMode = batchReportMode; + return this; + } + + /** + * Get the combineArtifacts property: <p>Specifies if the build artifacts for the batch build should be + * combined into a single artifact location.</p>. + * + * @return the combineArtifacts value. + */ + public Boolean combineArtifacts() { + return this.combineArtifacts; + } + + /** + * Set the combineArtifacts property: <p>Specifies if the build artifacts for the batch build should be + * combined into a single artifact location.</p>. + * + * @param combineArtifacts the combineArtifacts value to set. + * @return the ProjectBuildBatchConfig object itself. + */ + public ProjectBuildBatchConfig withCombineArtifacts(Boolean combineArtifacts) { + this.combineArtifacts = combineArtifacts; + return this; + } + + /** + * Get the restrictions property: <p>A <code>BatchRestrictions</code> object that specifies the + * restrictions for the batch build.</p>. + * + * @return the restrictions value. + */ + public BatchRestrictions restrictions() { + return this.restrictions; + } + + /** + * Set the restrictions property: <p>A <code>BatchRestrictions</code> object that specifies the + * restrictions for the batch build.</p>. + * + * @param restrictions the restrictions value to set. + * @return the ProjectBuildBatchConfig object itself. + */ + public ProjectBuildBatchConfig withRestrictions(BatchRestrictions restrictions) { + this.restrictions = restrictions; + return this; + } + + /** + * Get the serviceRole property: <p>Specifies the service role ARN for the batch build project.</p>. + * + * @return the serviceRole value. + */ + public String serviceRole() { + return this.serviceRole; + } + + /** + * Set the serviceRole property: <p>Specifies the service role ARN for the batch build project.</p>. + * + * @param serviceRole the serviceRole value to set. + * @return the ProjectBuildBatchConfig object itself. + */ + public ProjectBuildBatchConfig withServiceRole(String serviceRole) { + this.serviceRole = serviceRole; + return this; + } + + /** + * Get the timeoutInMins property: <p>Specifies the maximum amount of time, in minutes, that the batch build + * must be completed in.</p>. + * + * @return the timeoutInMins value. + */ + public Integer timeoutInMins() { + return this.timeoutInMins; + } + + /** + * Set the timeoutInMins property: <p>Specifies the maximum amount of time, in minutes, that the batch build + * must be completed in.</p>. + * + * @param timeoutInMins the timeoutInMins value to set. + * @return the ProjectBuildBatchConfig object itself. + */ + public ProjectBuildBatchConfig withTimeoutInMins(Integer timeoutInMins) { + this.timeoutInMins = timeoutInMins; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (batchReportMode() != null) { + batchReportMode().validate(); + } + if (restrictions() != null) { + restrictions().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("batchReportMode", this.batchReportMode); + jsonWriter.writeBooleanField("combineArtifacts", this.combineArtifacts); + jsonWriter.writeJsonField("restrictions", this.restrictions); + jsonWriter.writeStringField("serviceRole", this.serviceRole); + jsonWriter.writeNumberField("timeoutInMins", this.timeoutInMins); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ProjectBuildBatchConfig from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ProjectBuildBatchConfig if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the ProjectBuildBatchConfig. + */ + public static ProjectBuildBatchConfig fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ProjectBuildBatchConfig deserializedProjectBuildBatchConfig = new ProjectBuildBatchConfig(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("batchReportMode".equals(fieldName)) { + deserializedProjectBuildBatchConfig.batchReportMode = BatchReportModeTypeEnumValue.fromJson(reader); + } else if ("combineArtifacts".equals(fieldName)) { + deserializedProjectBuildBatchConfig.combineArtifacts = reader.getNullable(JsonReader::getBoolean); + } else if ("restrictions".equals(fieldName)) { + deserializedProjectBuildBatchConfig.restrictions = BatchRestrictions.fromJson(reader); + } else if ("serviceRole".equals(fieldName)) { + deserializedProjectBuildBatchConfig.serviceRole = reader.getString(); + } else if ("timeoutInMins".equals(fieldName)) { + deserializedProjectBuildBatchConfig.timeoutInMins = reader.getNullable(JsonReader::getInt); + } else { + reader.skipChildren(); + } + } + + return deserializedProjectBuildBatchConfig; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ProjectCache.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ProjectCache.java new file mode 100644 index 000000000000..03baf349a2c4 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ProjectCache.java @@ -0,0 +1,232 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Definition of ProjectCache. + */ +@Fluent +public final class ProjectCache implements JsonSerializable { + /* + *

Information about the cache location:

  • NO_CACHE or LOCAL: This + * value is ignored.

  • S3: This is the S3 bucket name/prefix.

+ */ + private String location; + + /* + *

An array of strings that specify the local cache modes. You can use one or more local cache modes at the same + * time. This is only used for LOCAL cache types.

Possible values are:

+ *
LOCAL_SOURCE_CACHE

Caches Git metadata for primary and secondary sources. After the cache is + * created, subsequent builds pull only the change between commits. This mode is a good choice for projects with a + * clean working directory and a source that is a large Git repository. If you choose this option and your project + * does not use a Git repository (GitHub, GitHub Enterprise, or Bitbucket), the option is ignored.

+ *
LOCAL_DOCKER_LAYER_CACHE

Caches existing Docker layers. This mode is a good choice for projects + * that build or pull large Docker images. It can prevent the performance issues caused by pulling large Docker + * images down from the network.

  • You can use a Docker layer cache in the Linux environment + * only.

  • The privileged flag must be set so that your project has the required + * Docker permissions.

  • You should consider the security implications before you use a Docker + * layer cache.

LOCAL_CUSTOM_CACHE

Caches directories you specify in + * the buildspec file. This mode is a good choice if your build scenario is not suited to one of the other three + * local cache modes. If you use a custom cache:

  • Only directories can be specified for caching. + * You cannot specify individual files.

  • Symlinks are used to reference cached directories.

    + *
  • Cached directories are linked to your build before it downloads its project sources. Cached items + * are overridden if a source item has the same name. Directories are specified using cache paths in the buildspec + * file.

+ */ + private List modes; + + /* + *

The type of cache used by the build project. Valid values include:

  • NO_CACHE: + * The build project does not use any cache.

  • S3: The build project reads and writes + * from and to S3.

  • LOCAL: The build project stores a cache locally on a build host + * that is only available to that build host.

+ */ + private CacheTypeEnumValue type; + + /** + * Creates an instance of ProjectCache class. + */ + public ProjectCache() { + } + + /** + * Get the location property: <p>Information about the cache location: </p> <ul> <li> + * <p> <code>NO_CACHE</code> or <code>LOCAL</code>: This value is ignored.</p> + * </li> <li> <p> <code>S3</code>: This is the S3 bucket name/prefix.</p> + * </li> </ul>. + * + * @return the location value. + */ + public String location() { + return this.location; + } + + /** + * Set the location property: <p>Information about the cache location: </p> <ul> <li> + * <p> <code>NO_CACHE</code> or <code>LOCAL</code>: This value is ignored.</p> + * </li> <li> <p> <code>S3</code>: This is the S3 bucket name/prefix.</p> + * </li> </ul>. + * + * @param location the location value to set. + * @return the ProjectCache object itself. + */ + public ProjectCache withLocation(String location) { + this.location = location; + return this; + } + + /** + * Get the modes property: <p>An array of strings that specify the local cache modes. You can use one or more + * local cache modes at the same time. This is only used for <code>LOCAL</code> cache types.</p> + * <p>Possible values are:</p> <dl> <dt>LOCAL_SOURCE_CACHE</dt> <dd> + * <p>Caches Git metadata for primary and secondary sources. After the cache is created, subsequent builds + * pull only the change between commits. This mode is a good choice for projects with a clean working directory and + * a source that is a large Git repository. If you choose this option and your project does not use a Git repository + * (GitHub, GitHub Enterprise, or Bitbucket), the option is ignored. </p> </dd> + * <dt>LOCAL_DOCKER_LAYER_CACHE</dt> <dd> <p>Caches existing Docker layers. This mode is a + * good choice for projects that build or pull large Docker images. It can prevent the performance issues caused by + * pulling large Docker images down from the network. </p> <note> <ul> <li> <p>You can + * use a Docker layer cache in the Linux environment only. </p> </li> <li> <p>The + * <code>privileged</code> flag must be set so that your project has the required Docker permissions. + * </p> </li> <li> <p>You should consider the security implications before you use a Docker + * layer cache. </p> </li> </ul> </note> </dd> <dt>LOCAL_CUSTOM_CACHE</dt> + * <dd> <p>Caches directories you specify in the buildspec file. This mode is a good choice if your + * build scenario is not suited to one of the other three local cache modes. If you use a custom cache: </p> + * <ul> <li> <p>Only directories can be specified for caching. You cannot specify individual + * files. </p> </li> <li> <p>Symlinks are used to reference cached directories. </p> + * </li> <li> <p>Cached directories are linked to your build before it downloads its project + * sources. Cached items are overridden if a source item has the same name. Directories are specified using cache + * paths in the buildspec file. </p> </li> </ul> </dd> </dl>. + * + * @return the modes value. + */ + public List modes() { + return this.modes; + } + + /** + * Set the modes property: <p>An array of strings that specify the local cache modes. You can use one or more + * local cache modes at the same time. This is only used for <code>LOCAL</code> cache types.</p> + * <p>Possible values are:</p> <dl> <dt>LOCAL_SOURCE_CACHE</dt> <dd> + * <p>Caches Git metadata for primary and secondary sources. After the cache is created, subsequent builds + * pull only the change between commits. This mode is a good choice for projects with a clean working directory and + * a source that is a large Git repository. If you choose this option and your project does not use a Git repository + * (GitHub, GitHub Enterprise, or Bitbucket), the option is ignored. </p> </dd> + * <dt>LOCAL_DOCKER_LAYER_CACHE</dt> <dd> <p>Caches existing Docker layers. This mode is a + * good choice for projects that build or pull large Docker images. It can prevent the performance issues caused by + * pulling large Docker images down from the network. </p> <note> <ul> <li> <p>You can + * use a Docker layer cache in the Linux environment only. </p> </li> <li> <p>The + * <code>privileged</code> flag must be set so that your project has the required Docker permissions. + * </p> </li> <li> <p>You should consider the security implications before you use a Docker + * layer cache. </p> </li> </ul> </note> </dd> <dt>LOCAL_CUSTOM_CACHE</dt> + * <dd> <p>Caches directories you specify in the buildspec file. This mode is a good choice if your + * build scenario is not suited to one of the other three local cache modes. If you use a custom cache: </p> + * <ul> <li> <p>Only directories can be specified for caching. You cannot specify individual + * files. </p> </li> <li> <p>Symlinks are used to reference cached directories. </p> + * </li> <li> <p>Cached directories are linked to your build before it downloads its project + * sources. Cached items are overridden if a source item has the same name. Directories are specified using cache + * paths in the buildspec file. </p> </li> </ul> </dd> </dl>. + * + * @param modes the modes value to set. + * @return the ProjectCache object itself. + */ + public ProjectCache withModes(List modes) { + this.modes = modes; + return this; + } + + /** + * Get the type property: <p>The type of cache used by the build project. Valid values include:</p> + * <ul> <li> <p> <code>NO_CACHE</code>: The build project does not use any + * cache.</p> </li> <li> <p> <code>S3</code>: The build project reads and writes + * from and to S3.</p> </li> <li> <p> <code>LOCAL</code>: The build project + * stores a cache locally on a build host that is only available to that build host.</p> </li> + * </ul>. + * + * @return the type value. + */ + public CacheTypeEnumValue type() { + return this.type; + } + + /** + * Set the type property: <p>The type of cache used by the build project. Valid values include:</p> + * <ul> <li> <p> <code>NO_CACHE</code>: The build project does not use any + * cache.</p> </li> <li> <p> <code>S3</code>: The build project reads and writes + * from and to S3.</p> </li> <li> <p> <code>LOCAL</code>: The build project + * stores a cache locally on a build host that is only available to that build host.</p> </li> + * </ul>. + * + * @param type the type value to set. + * @return the ProjectCache object itself. + */ + public ProjectCache withType(CacheTypeEnumValue type) { + this.type = type; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (type() != null) { + type().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("location", this.location); + jsonWriter.writeArrayField("modes", this.modes, + (writer, element) -> writer.writeString(element == null ? null : element.toString())); + jsonWriter.writeJsonField("type", this.type); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ProjectCache from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ProjectCache if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the ProjectCache. + */ + public static ProjectCache fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ProjectCache deserializedProjectCache = new ProjectCache(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("location".equals(fieldName)) { + deserializedProjectCache.location = reader.getString(); + } else if ("modes".equals(fieldName)) { + List modes = reader.readArray(reader1 -> CacheMode.fromString(reader1.getString())); + deserializedProjectCache.modes = modes; + } else if ("type".equals(fieldName)) { + deserializedProjectCache.type = CacheTypeEnumValue.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedProjectCache; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ProjectEnvironment.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ProjectEnvironment.java new file mode 100644 index 000000000000..d2e1d17d5e95 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ProjectEnvironment.java @@ -0,0 +1,597 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Definition of ProjectEnvironment. + */ +@Fluent +public final class ProjectEnvironment implements JsonSerializable { + /* + *

The ARN of the Amazon S3 bucket, path prefix, and object key that contains the PEM-encoded certificate for the + * build project. For more information, see certificate in the CodeBuild User Guide.

+ */ + private String certificate; + + /* + *

Information about the compute resources the build project uses. Available values include:

  • + * BUILD_GENERAL1_SMALL: Use up to 3 GB memory and 2 vCPUs for builds.

  • + * BUILD_GENERAL1_MEDIUM: Use up to 7 GB memory and 4 vCPUs for builds.

  • + * BUILD_GENERAL1_LARGE: Use up to 16 GB memory and 8 vCPUs for builds, depending on your environment + * type.

  • BUILD_GENERAL1_XLARGE: Use up to 70 GB memory and 36 vCPUs for builds, + * depending on your environment type.

  • BUILD_GENERAL1_2XLARGE: Use up to 145 GB + * memory, 72 vCPUs, and 824 GB of SSD storage for builds. This compute type supports Docker images up to 100 GB + * uncompressed.

  • BUILD_LAMBDA_1GB: Use up to 1 GB memory for builds. Only available + * for environment type LINUX_LAMBDA_CONTAINER and ARM_LAMBDA_CONTAINER.

  • + *

    BUILD_LAMBDA_2GB: Use up to 2 GB memory for builds. Only available for environment type + * LINUX_LAMBDA_CONTAINER and ARM_LAMBDA_CONTAINER.

  • + * BUILD_LAMBDA_4GB: Use up to 4 GB memory for builds. Only available for environment type + * LINUX_LAMBDA_CONTAINER and ARM_LAMBDA_CONTAINER.

  • + * BUILD_LAMBDA_8GB: Use up to 8 GB memory for builds. Only available for environment type + * LINUX_LAMBDA_CONTAINER and ARM_LAMBDA_CONTAINER.

  • + * BUILD_LAMBDA_10GB: Use up to 10 GB memory for builds. Only available for environment type + * LINUX_LAMBDA_CONTAINER and ARM_LAMBDA_CONTAINER.

If you use + * BUILD_GENERAL1_SMALL:

  • For environment type LINUX_CONTAINER, you can + * use up to 3 GB memory and 2 vCPUs for builds.

  • For environment type + * LINUX_GPU_CONTAINER, you can use up to 16 GB memory, 4 vCPUs, and 1 NVIDIA A10G Tensor Core GPU for + * builds.

  • For environment type ARM_CONTAINER, you can use up to 4 GB memory and 2 + * vCPUs on ARM-based processors for builds.

If you use BUILD_GENERAL1_LARGE:

+ *
  • For environment type LINUX_CONTAINER, you can use up to 15 GB memory and 8 vCPUs for + * builds.

  • For environment type LINUX_GPU_CONTAINER, you can use up to 255 GB + * memory, 32 vCPUs, and 4 NVIDIA Tesla V100 GPUs for builds.

  • For environment type + * ARM_CONTAINER, you can use up to 16 GB memory and 8 vCPUs on ARM-based processors for builds.

    + *

If you're using compute fleets during project creation, computeType will be + * ignored.

For more information, see Build Environment + * Compute Types in the CodeBuild User Guide.

+ */ + private ComputeTypeEnumValue computeType; + + /* + *

A set of environment variables to make available to builds for this build project.

+ */ + private List environmentVariables; + + /* + *

A ProjectFleet object to use for this build project.

+ */ + private ProjectFleet fleet; + + /* + *

The image tag or image digest that identifies the Docker image to use for this build project. Use the + * following formats:

  • For an image tag: + * <registry>/<repository>:<tag>. For example, in the Docker repository that + * CodeBuild uses to manage its Docker images, this would be aws/codebuild/standard:4.0.

  • + *
  • For an image digest: <registry>/<repository>@<digest>. For example, to + * specify an image with the digest 'sha256:cbbf2f9a99b47fc460d422812b6a5adff7dfee951d8fa2e4a98caa0382cfbdbf,' use + * <registry>/<repository>@sha256:cbbf2f9a99b47fc460d422812b6a5adff7dfee951d8fa2e4a98caa0382cfbdbf + * .

For more information, see Docker images provided + * by CodeBuild in the CodeBuild user guide.

+ */ + private String image; + + /* + *

The type of credentials CodeBuild uses to pull images in your build. There are two valid values:

    + *
  • CODEBUILD specifies that CodeBuild uses its own credentials. This requires that you modify + * your ECR repository policy to trust CodeBuild service principal.

  • SERVICE_ROLE + * specifies that CodeBuild uses your build project's service role.

When you use a + * cross-account or private registry image, you must use SERVICE_ROLE credentials. When you use an CodeBuild curated + * image, you must use CODEBUILD credentials.

+ */ + private ImagePullCredentialsTypeEnumValue imagePullCredentialsType; + + /* + *

Enables running the Docker daemon inside a Docker container. Set to true only if the build project is used to + * build Docker images. Otherwise, a build that attempts to interact with the Docker daemon fails. The default + * setting is false.

You can initialize the Docker daemon during the install phase of your build + * by adding one of the following sets of commands to the install phase of your buildspec file:

If the + * operating system's base image is Ubuntu Linux:

- nohup /usr/local/bin/dockerd + * --host=unix:///var/run/docker.sock --host=tcp://0.0.0.0:2375 --storage-driver=overlay&

+ * - timeout 15 sh -c 'until docker info; do echo .; sleep 1; done'

If the operating system's + * base image is Alpine Linux and the previous command does not work, add the -t argument to + * timeout:

- nohup /usr/local/bin/dockerd --host=unix:///var/run/docker.sock + * --host=tcp://0.0.0.0:2375 --storage-driver=overlay&

- timeout -t 15 sh -c 'until docker + * info; do echo .; sleep 1; done'

+ */ + private Boolean privilegedMode; + + /* + *

The credentials for access to a private registry.

+ */ + private RegistryCredential registryCredential; + + /* + *

The type of build environment to use for related builds.

  • The environment type + * ARM_CONTAINER is available only in regions US East (N. Virginia), US East (Ohio), US West (Oregon), + * EU (Ireland), Asia Pacific (Mumbai), Asia Pacific (Tokyo), Asia Pacific (Sydney), and EU (Frankfurt).

  • + *
  • The environment type LINUX_CONTAINER is available only in regions US East (N. Virginia), US + * East (Ohio), US West (Oregon), Canada (Central), EU (Ireland), EU (London), EU (Frankfurt), Asia Pacific (Tokyo), + * Asia Pacific (Seoul), Asia Pacific (Singapore), Asia Pacific (Sydney), China (Beijing), and China (Ningxia).

    + *
  • The environment type LINUX_GPU_CONTAINER is available only in regions US East (N. + * Virginia), US East (Ohio), US West (Oregon), Canada (Central), EU (Ireland), EU (London), EU (Frankfurt), Asia + * Pacific (Tokyo), Asia Pacific (Seoul), Asia Pacific (Singapore), Asia Pacific (Sydney) , China (Beijing), and + * China (Ningxia).

  • The environment types ARM_LAMBDA_CONTAINER and + * LINUX_LAMBDA_CONTAINER are available only in regions US East (N. Virginia), US East (Ohio), US West + * (Oregon), Asia Pacific (Mumbai), Asia Pacific (Singapore), Asia Pacific (Sydney), Asia Pacific (Tokyo), EU + * (Frankfurt), EU (Ireland), and South America (São Paulo).

  • The environment types + * WINDOWS_CONTAINER and WINDOWS_SERVER_2019_CONTAINER are available only in regions US + * East (N. Virginia), US East (Ohio), US West (Oregon), and EU (Ireland).

If you're using + * compute fleets during project creation, type will be ignored.

For more information, + * see Build + * environment compute types in the CodeBuild user guide.

+ */ + private EnvironmentTypeEnumValue type; + + /** + * Creates an instance of ProjectEnvironment class. + */ + public ProjectEnvironment() { + } + + /** + * Get the certificate property: <p>The ARN of the Amazon S3 bucket, path prefix, and object key that contains + * the PEM-encoded certificate for the build project. For more information, see <a + * href='https://docs.aws.amazon.com/codebuild/latest/userguide/create-project-cli.html#cli.environment.certificate'>certificate</a> + * in the <i>CodeBuild User Guide</i>.</p>. + * + * @return the certificate value. + */ + public String certificate() { + return this.certificate; + } + + /** + * Set the certificate property: <p>The ARN of the Amazon S3 bucket, path prefix, and object key that contains + * the PEM-encoded certificate for the build project. For more information, see <a + * href='https://docs.aws.amazon.com/codebuild/latest/userguide/create-project-cli.html#cli.environment.certificate'>certificate</a> + * in the <i>CodeBuild User Guide</i>.</p>. + * + * @param certificate the certificate value to set. + * @return the ProjectEnvironment object itself. + */ + public ProjectEnvironment withCertificate(String certificate) { + this.certificate = certificate; + return this; + } + + /** + * Get the computeType property: <p>Information about the compute resources the build project uses. Available + * values include:</p> <ul> <li> <p> <code>BUILD_GENERAL1_SMALL</code>: Use up + * to 3 GB memory and 2 vCPUs for builds.</p> </li> <li> <p> + * <code>BUILD_GENERAL1_MEDIUM</code>: Use up to 7 GB memory and 4 vCPUs for builds.</p> + * </li> <li> <p> <code>BUILD_GENERAL1_LARGE</code>: Use up to 16 GB memory and 8 + * vCPUs for builds, depending on your environment type.</p> </li> <li> <p> + * <code>BUILD_GENERAL1_XLARGE</code>: Use up to 70 GB memory and 36 vCPUs for builds, depending on your + * environment type.</p> </li> <li> <p> <code>BUILD_GENERAL1_2XLARGE</code>: Use + * up to 145 GB memory, 72 vCPUs, and 824 GB of SSD storage for builds. This compute type supports Docker images up + * to 100 GB uncompressed.</p> </li> <li> <p> <code>BUILD_LAMBDA_1GB</code>: Use + * up to 1 GB memory for builds. Only available for environment type <code>LINUX_LAMBDA_CONTAINER</code> + * and <code>ARM_LAMBDA_CONTAINER</code>.</p> </li> <li> <p> + * <code>BUILD_LAMBDA_2GB</code>: Use up to 2 GB memory for builds. Only available for environment type + * <code>LINUX_LAMBDA_CONTAINER</code> and <code>ARM_LAMBDA_CONTAINER</code>.</p> + * </li> <li> <p> <code>BUILD_LAMBDA_4GB</code>: Use up to 4 GB memory for builds. + * Only available for environment type <code>LINUX_LAMBDA_CONTAINER</code> and + * <code>ARM_LAMBDA_CONTAINER</code>.</p> </li> <li> <p> + * <code>BUILD_LAMBDA_8GB</code>: Use up to 8 GB memory for builds. Only available for environment type + * <code>LINUX_LAMBDA_CONTAINER</code> and <code>ARM_LAMBDA_CONTAINER</code>.</p> + * </li> <li> <p> <code>BUILD_LAMBDA_10GB</code>: Use up to 10 GB memory for builds. + * Only available for environment type <code>LINUX_LAMBDA_CONTAINER</code> and + * <code>ARM_LAMBDA_CONTAINER</code>.</p> </li> </ul> <p> If you use + * <code>BUILD_GENERAL1_SMALL</code>: </p> <ul> <li> <p> For environment type + * <code>LINUX_CONTAINER</code>, you can use up to 3 GB memory and 2 vCPUs for builds. </p> + * </li> <li> <p> For environment type <code>LINUX_GPU_CONTAINER</code>, you can use + * up to 16 GB memory, 4 vCPUs, and 1 NVIDIA A10G Tensor Core GPU for builds.</p> </li> <li> + * <p> For environment type <code>ARM_CONTAINER</code>, you can use up to 4 GB memory and 2 vCPUs + * on ARM-based processors for builds.</p> </li> </ul> <p> If you use + * <code>BUILD_GENERAL1_LARGE</code>: </p> <ul> <li> <p> For environment type + * <code>LINUX_CONTAINER</code>, you can use up to 15 GB memory and 8 vCPUs for builds. </p> + * </li> <li> <p> For environment type <code>LINUX_GPU_CONTAINER</code>, you can use + * up to 255 GB memory, 32 vCPUs, and 4 NVIDIA Tesla V100 GPUs for builds.</p> </li> <li> + * <p> For environment type <code>ARM_CONTAINER</code>, you can use up to 16 GB memory and 8 vCPUs + * on ARM-based processors for builds.</p> </li> </ul> <note> <p>If you're using + * compute fleets during project creation, <code>computeType</code> will be ignored.</p> + * </note> <p>For more information, see <a + * href='https://docs.aws.amazon.com/codebuild/latest/userguide/build-env-ref-compute-types.html'>Build + * Environment Compute Types</a> in the <i>CodeBuild User Guide.</i> </p>. + * + * @return the computeType value. + */ + public ComputeTypeEnumValue computeType() { + return this.computeType; + } + + /** + * Set the computeType property: <p>Information about the compute resources the build project uses. Available + * values include:</p> <ul> <li> <p> <code>BUILD_GENERAL1_SMALL</code>: Use up + * to 3 GB memory and 2 vCPUs for builds.</p> </li> <li> <p> + * <code>BUILD_GENERAL1_MEDIUM</code>: Use up to 7 GB memory and 4 vCPUs for builds.</p> + * </li> <li> <p> <code>BUILD_GENERAL1_LARGE</code>: Use up to 16 GB memory and 8 + * vCPUs for builds, depending on your environment type.</p> </li> <li> <p> + * <code>BUILD_GENERAL1_XLARGE</code>: Use up to 70 GB memory and 36 vCPUs for builds, depending on your + * environment type.</p> </li> <li> <p> <code>BUILD_GENERAL1_2XLARGE</code>: Use + * up to 145 GB memory, 72 vCPUs, and 824 GB of SSD storage for builds. This compute type supports Docker images up + * to 100 GB uncompressed.</p> </li> <li> <p> <code>BUILD_LAMBDA_1GB</code>: Use + * up to 1 GB memory for builds. Only available for environment type <code>LINUX_LAMBDA_CONTAINER</code> + * and <code>ARM_LAMBDA_CONTAINER</code>.</p> </li> <li> <p> + * <code>BUILD_LAMBDA_2GB</code>: Use up to 2 GB memory for builds. Only available for environment type + * <code>LINUX_LAMBDA_CONTAINER</code> and <code>ARM_LAMBDA_CONTAINER</code>.</p> + * </li> <li> <p> <code>BUILD_LAMBDA_4GB</code>: Use up to 4 GB memory for builds. + * Only available for environment type <code>LINUX_LAMBDA_CONTAINER</code> and + * <code>ARM_LAMBDA_CONTAINER</code>.</p> </li> <li> <p> + * <code>BUILD_LAMBDA_8GB</code>: Use up to 8 GB memory for builds. Only available for environment type + * <code>LINUX_LAMBDA_CONTAINER</code> and <code>ARM_LAMBDA_CONTAINER</code>.</p> + * </li> <li> <p> <code>BUILD_LAMBDA_10GB</code>: Use up to 10 GB memory for builds. + * Only available for environment type <code>LINUX_LAMBDA_CONTAINER</code> and + * <code>ARM_LAMBDA_CONTAINER</code>.</p> </li> </ul> <p> If you use + * <code>BUILD_GENERAL1_SMALL</code>: </p> <ul> <li> <p> For environment type + * <code>LINUX_CONTAINER</code>, you can use up to 3 GB memory and 2 vCPUs for builds. </p> + * </li> <li> <p> For environment type <code>LINUX_GPU_CONTAINER</code>, you can use + * up to 16 GB memory, 4 vCPUs, and 1 NVIDIA A10G Tensor Core GPU for builds.</p> </li> <li> + * <p> For environment type <code>ARM_CONTAINER</code>, you can use up to 4 GB memory and 2 vCPUs + * on ARM-based processors for builds.</p> </li> </ul> <p> If you use + * <code>BUILD_GENERAL1_LARGE</code>: </p> <ul> <li> <p> For environment type + * <code>LINUX_CONTAINER</code>, you can use up to 15 GB memory and 8 vCPUs for builds. </p> + * </li> <li> <p> For environment type <code>LINUX_GPU_CONTAINER</code>, you can use + * up to 255 GB memory, 32 vCPUs, and 4 NVIDIA Tesla V100 GPUs for builds.</p> </li> <li> + * <p> For environment type <code>ARM_CONTAINER</code>, you can use up to 16 GB memory and 8 vCPUs + * on ARM-based processors for builds.</p> </li> </ul> <note> <p>If you're using + * compute fleets during project creation, <code>computeType</code> will be ignored.</p> + * </note> <p>For more information, see <a + * href='https://docs.aws.amazon.com/codebuild/latest/userguide/build-env-ref-compute-types.html'>Build + * Environment Compute Types</a> in the <i>CodeBuild User Guide.</i> </p>. + * + * @param computeType the computeType value to set. + * @return the ProjectEnvironment object itself. + */ + public ProjectEnvironment withComputeType(ComputeTypeEnumValue computeType) { + this.computeType = computeType; + return this; + } + + /** + * Get the environmentVariables property: <p>A set of environment variables to make available to builds for + * this build project.</p>. + * + * @return the environmentVariables value. + */ + public List environmentVariables() { + return this.environmentVariables; + } + + /** + * Set the environmentVariables property: <p>A set of environment variables to make available to builds for + * this build project.</p>. + * + * @param environmentVariables the environmentVariables value to set. + * @return the ProjectEnvironment object itself. + */ + public ProjectEnvironment withEnvironmentVariables(List environmentVariables) { + this.environmentVariables = environmentVariables; + return this; + } + + /** + * Get the fleet property: <p>A ProjectFleet object to use for this build project.</p>. + * + * @return the fleet value. + */ + public ProjectFleet fleet() { + return this.fleet; + } + + /** + * Set the fleet property: <p>A ProjectFleet object to use for this build project.</p>. + * + * @param fleet the fleet value to set. + * @return the ProjectEnvironment object itself. + */ + public ProjectEnvironment withFleet(ProjectFleet fleet) { + this.fleet = fleet; + return this; + } + + /** + * Get the image property: <p>The image tag or image digest that identifies the Docker image to use for this + * build project. Use the following formats:</p> <ul> <li> <p>For an image tag: + * <code>&lt;registry&gt;/&lt;repository&gt;:&lt;tag&gt;</code>. For example, in + * the Docker repository that CodeBuild uses to manage its Docker images, this would be + * <code>aws/codebuild/standard:4.0</code>. </p> </li> <li> <p>For an image + * digest: <code>&lt;registry&gt;/&lt;repository&gt;@&lt;digest&gt;</code>. + * For example, to specify an image with the digest + * 'sha256:cbbf2f9a99b47fc460d422812b6a5adff7dfee951d8fa2e4a98caa0382cfbdbf,' use + * <code>&lt;registry&gt;/&lt;repository&gt;@sha256:cbbf2f9a99b47fc460d422812b6a5adff7dfee951d8fa2e4a98caa0382cfbdbf</code>.</p> + * </li> </ul> <p>For more information, see <a + * href='https://docs.aws.amazon.com/codebuild/latest/userguide/build-env-ref-available.html'>Docker images + * provided by CodeBuild</a> in the <i>CodeBuild user guide</i>.</p>. + * + * @return the image value. + */ + public String image() { + return this.image; + } + + /** + * Set the image property: <p>The image tag or image digest that identifies the Docker image to use for this + * build project. Use the following formats:</p> <ul> <li> <p>For an image tag: + * <code>&lt;registry&gt;/&lt;repository&gt;:&lt;tag&gt;</code>. For example, in + * the Docker repository that CodeBuild uses to manage its Docker images, this would be + * <code>aws/codebuild/standard:4.0</code>. </p> </li> <li> <p>For an image + * digest: <code>&lt;registry&gt;/&lt;repository&gt;@&lt;digest&gt;</code>. + * For example, to specify an image with the digest + * 'sha256:cbbf2f9a99b47fc460d422812b6a5adff7dfee951d8fa2e4a98caa0382cfbdbf,' use + * <code>&lt;registry&gt;/&lt;repository&gt;@sha256:cbbf2f9a99b47fc460d422812b6a5adff7dfee951d8fa2e4a98caa0382cfbdbf</code>.</p> + * </li> </ul> <p>For more information, see <a + * href='https://docs.aws.amazon.com/codebuild/latest/userguide/build-env-ref-available.html'>Docker images + * provided by CodeBuild</a> in the <i>CodeBuild user guide</i>.</p>. + * + * @param image the image value to set. + * @return the ProjectEnvironment object itself. + */ + public ProjectEnvironment withImage(String image) { + this.image = image; + return this; + } + + /** + * Get the imagePullCredentialsType property: <p> The type of credentials CodeBuild uses to pull images in + * your build. There are two valid values: </p> <ul> <li> <p> + * <code>CODEBUILD</code> specifies that CodeBuild uses its own credentials. This requires that you + * modify your ECR repository policy to trust CodeBuild service principal. </p> </li> <li> + * <p> <code>SERVICE_ROLE</code> specifies that CodeBuild uses your build project's service role. + * </p> </li> </ul> <p> When you use a cross-account or private registry image, you must use + * SERVICE_ROLE credentials. When you use an CodeBuild curated image, you must use CODEBUILD credentials. + * </p>. + * + * @return the imagePullCredentialsType value. + */ + public ImagePullCredentialsTypeEnumValue imagePullCredentialsType() { + return this.imagePullCredentialsType; + } + + /** + * Set the imagePullCredentialsType property: <p> The type of credentials CodeBuild uses to pull images in + * your build. There are two valid values: </p> <ul> <li> <p> + * <code>CODEBUILD</code> specifies that CodeBuild uses its own credentials. This requires that you + * modify your ECR repository policy to trust CodeBuild service principal. </p> </li> <li> + * <p> <code>SERVICE_ROLE</code> specifies that CodeBuild uses your build project's service role. + * </p> </li> </ul> <p> When you use a cross-account or private registry image, you must use + * SERVICE_ROLE credentials. When you use an CodeBuild curated image, you must use CODEBUILD credentials. + * </p>. + * + * @param imagePullCredentialsType the imagePullCredentialsType value to set. + * @return the ProjectEnvironment object itself. + */ + public ProjectEnvironment withImagePullCredentialsType(ImagePullCredentialsTypeEnumValue imagePullCredentialsType) { + this.imagePullCredentialsType = imagePullCredentialsType; + return this; + } + + /** + * Get the privilegedMode property: <p>Enables running the Docker daemon inside a Docker container. Set to + * true only if the build project is used to build Docker images. Otherwise, a build that attempts to interact with + * the Docker daemon fails. The default setting is <code>false</code>.</p> <p>You can + * initialize the Docker daemon during the install phase of your build by adding one of the following sets of + * commands to the install phase of your buildspec file:</p> <p>If the operating system's base image is + * Ubuntu Linux:</p> <p> <code>- nohup /usr/local/bin/dockerd --host=unix:///var/run/docker.sock + * --host=tcp://0.0.0.0:2375 --storage-driver=overlay&amp;</code> </p> <p> <code>- + * timeout 15 sh -c 'until docker info; do echo .; sleep 1; done'</code> </p> <p>If the operating + * system's base image is Alpine Linux and the previous command does not work, add the <code>-t</code> + * argument to <code>timeout</code>:</p> <p> <code>- nohup /usr/local/bin/dockerd + * --host=unix:///var/run/docker.sock --host=tcp://0.0.0.0:2375 --storage-driver=overlay&amp;</code> + * </p> <p> <code>- timeout -t 15 sh -c 'until docker info; do echo .; sleep 1; done'</code> + * </p>. + * + * @return the privilegedMode value. + */ + public Boolean privilegedMode() { + return this.privilegedMode; + } + + /** + * Set the privilegedMode property: <p>Enables running the Docker daemon inside a Docker container. Set to + * true only if the build project is used to build Docker images. Otherwise, a build that attempts to interact with + * the Docker daemon fails. The default setting is <code>false</code>.</p> <p>You can + * initialize the Docker daemon during the install phase of your build by adding one of the following sets of + * commands to the install phase of your buildspec file:</p> <p>If the operating system's base image is + * Ubuntu Linux:</p> <p> <code>- nohup /usr/local/bin/dockerd --host=unix:///var/run/docker.sock + * --host=tcp://0.0.0.0:2375 --storage-driver=overlay&amp;</code> </p> <p> <code>- + * timeout 15 sh -c 'until docker info; do echo .; sleep 1; done'</code> </p> <p>If the operating + * system's base image is Alpine Linux and the previous command does not work, add the <code>-t</code> + * argument to <code>timeout</code>:</p> <p> <code>- nohup /usr/local/bin/dockerd + * --host=unix:///var/run/docker.sock --host=tcp://0.0.0.0:2375 --storage-driver=overlay&amp;</code> + * </p> <p> <code>- timeout -t 15 sh -c 'until docker info; do echo .; sleep 1; done'</code> + * </p>. + * + * @param privilegedMode the privilegedMode value to set. + * @return the ProjectEnvironment object itself. + */ + public ProjectEnvironment withPrivilegedMode(Boolean privilegedMode) { + this.privilegedMode = privilegedMode; + return this; + } + + /** + * Get the registryCredential property: <p> The credentials for access to a private registry.</p>. + * + * @return the registryCredential value. + */ + public RegistryCredential registryCredential() { + return this.registryCredential; + } + + /** + * Set the registryCredential property: <p> The credentials for access to a private registry.</p>. + * + * @param registryCredential the registryCredential value to set. + * @return the ProjectEnvironment object itself. + */ + public ProjectEnvironment withRegistryCredential(RegistryCredential registryCredential) { + this.registryCredential = registryCredential; + return this; + } + + /** + * Get the type property: <p>The type of build environment to use for related builds.</p> <ul> + * <li> <p>The environment type <code>ARM_CONTAINER</code> is available only in regions US + * East (N. Virginia), US East (Ohio), US West (Oregon), EU (Ireland), Asia Pacific (Mumbai), Asia Pacific (Tokyo), + * Asia Pacific (Sydney), and EU (Frankfurt).</p> </li> <li> <p>The environment type + * <code>LINUX_CONTAINER</code> is available only in regions US East (N. Virginia), US East (Ohio), US + * West (Oregon), Canada (Central), EU (Ireland), EU (London), EU (Frankfurt), Asia Pacific (Tokyo), Asia Pacific + * (Seoul), Asia Pacific (Singapore), Asia Pacific (Sydney), China (Beijing), and China (Ningxia).</p> + * </li> <li> <p>The environment type <code>LINUX_GPU_CONTAINER</code> is available + * only in regions US East (N. Virginia), US East (Ohio), US West (Oregon), Canada (Central), EU (Ireland), EU + * (London), EU (Frankfurt), Asia Pacific (Tokyo), Asia Pacific (Seoul), Asia Pacific (Singapore), Asia Pacific + * (Sydney) , China (Beijing), and China (Ningxia).</p> </li> </ul> <ul> <li> + * <p>The environment types <code>ARM_LAMBDA_CONTAINER</code> and + * <code>LINUX_LAMBDA_CONTAINER</code> are available only in regions US East (N. Virginia), US East + * (Ohio), US West (Oregon), Asia Pacific (Mumbai), Asia Pacific (Singapore), Asia Pacific (Sydney), Asia Pacific + * (Tokyo), EU (Frankfurt), EU (Ireland), and South America (São Paulo).</p> </li> </ul> + * <ul> <li> <p>The environment types <code>WINDOWS_CONTAINER</code> and + * <code>WINDOWS_SERVER_2019_CONTAINER</code> are available only in regions US East (N. Virginia), US + * East (Ohio), US West (Oregon), and EU (Ireland).</p> </li> </ul> <note> <p>If + * you're using compute fleets during project creation, <code>type</code> will be ignored.</p> + * </note> <p>For more information, see <a + * href='https://docs.aws.amazon.com/codebuild/latest/userguide/build-env-ref-compute-types.html'>Build + * environment compute types</a> in the <i>CodeBuild user guide</i>.</p>. + * + * @return the type value. + */ + public EnvironmentTypeEnumValue type() { + return this.type; + } + + /** + * Set the type property: <p>The type of build environment to use for related builds.</p> <ul> + * <li> <p>The environment type <code>ARM_CONTAINER</code> is available only in regions US + * East (N. Virginia), US East (Ohio), US West (Oregon), EU (Ireland), Asia Pacific (Mumbai), Asia Pacific (Tokyo), + * Asia Pacific (Sydney), and EU (Frankfurt).</p> </li> <li> <p>The environment type + * <code>LINUX_CONTAINER</code> is available only in regions US East (N. Virginia), US East (Ohio), US + * West (Oregon), Canada (Central), EU (Ireland), EU (London), EU (Frankfurt), Asia Pacific (Tokyo), Asia Pacific + * (Seoul), Asia Pacific (Singapore), Asia Pacific (Sydney), China (Beijing), and China (Ningxia).</p> + * </li> <li> <p>The environment type <code>LINUX_GPU_CONTAINER</code> is available + * only in regions US East (N. Virginia), US East (Ohio), US West (Oregon), Canada (Central), EU (Ireland), EU + * (London), EU (Frankfurt), Asia Pacific (Tokyo), Asia Pacific (Seoul), Asia Pacific (Singapore), Asia Pacific + * (Sydney) , China (Beijing), and China (Ningxia).</p> </li> </ul> <ul> <li> + * <p>The environment types <code>ARM_LAMBDA_CONTAINER</code> and + * <code>LINUX_LAMBDA_CONTAINER</code> are available only in regions US East (N. Virginia), US East + * (Ohio), US West (Oregon), Asia Pacific (Mumbai), Asia Pacific (Singapore), Asia Pacific (Sydney), Asia Pacific + * (Tokyo), EU (Frankfurt), EU (Ireland), and South America (São Paulo).</p> </li> </ul> + * <ul> <li> <p>The environment types <code>WINDOWS_CONTAINER</code> and + * <code>WINDOWS_SERVER_2019_CONTAINER</code> are available only in regions US East (N. Virginia), US + * East (Ohio), US West (Oregon), and EU (Ireland).</p> </li> </ul> <note> <p>If + * you're using compute fleets during project creation, <code>type</code> will be ignored.</p> + * </note> <p>For more information, see <a + * href='https://docs.aws.amazon.com/codebuild/latest/userguide/build-env-ref-compute-types.html'>Build + * environment compute types</a> in the <i>CodeBuild user guide</i>.</p>. + * + * @param type the type value to set. + * @return the ProjectEnvironment object itself. + */ + public ProjectEnvironment withType(EnvironmentTypeEnumValue type) { + this.type = type; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (computeType() != null) { + computeType().validate(); + } + if (environmentVariables() != null) { + environmentVariables().forEach(e -> e.validate()); + } + if (fleet() != null) { + fleet().validate(); + } + if (imagePullCredentialsType() != null) { + imagePullCredentialsType().validate(); + } + if (registryCredential() != null) { + registryCredential().validate(); + } + if (type() != null) { + type().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("certificate", this.certificate); + jsonWriter.writeJsonField("computeType", this.computeType); + jsonWriter.writeArrayField("environmentVariables", this.environmentVariables, + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeJsonField("fleet", this.fleet); + jsonWriter.writeStringField("image", this.image); + jsonWriter.writeJsonField("imagePullCredentialsType", this.imagePullCredentialsType); + jsonWriter.writeBooleanField("privilegedMode", this.privilegedMode); + jsonWriter.writeJsonField("registryCredential", this.registryCredential); + jsonWriter.writeJsonField("type", this.type); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ProjectEnvironment from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ProjectEnvironment if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the ProjectEnvironment. + */ + public static ProjectEnvironment fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ProjectEnvironment deserializedProjectEnvironment = new ProjectEnvironment(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("certificate".equals(fieldName)) { + deserializedProjectEnvironment.certificate = reader.getString(); + } else if ("computeType".equals(fieldName)) { + deserializedProjectEnvironment.computeType = ComputeTypeEnumValue.fromJson(reader); + } else if ("environmentVariables".equals(fieldName)) { + List environmentVariables + = reader.readArray(reader1 -> EnvironmentVariable.fromJson(reader1)); + deserializedProjectEnvironment.environmentVariables = environmentVariables; + } else if ("fleet".equals(fieldName)) { + deserializedProjectEnvironment.fleet = ProjectFleet.fromJson(reader); + } else if ("image".equals(fieldName)) { + deserializedProjectEnvironment.image = reader.getString(); + } else if ("imagePullCredentialsType".equals(fieldName)) { + deserializedProjectEnvironment.imagePullCredentialsType + = ImagePullCredentialsTypeEnumValue.fromJson(reader); + } else if ("privilegedMode".equals(fieldName)) { + deserializedProjectEnvironment.privilegedMode = reader.getNullable(JsonReader::getBoolean); + } else if ("registryCredential".equals(fieldName)) { + deserializedProjectEnvironment.registryCredential = RegistryCredential.fromJson(reader); + } else if ("type".equals(fieldName)) { + deserializedProjectEnvironment.type = EnvironmentTypeEnumValue.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedProjectEnvironment; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ProjectFileSystemLocation.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ProjectFileSystemLocation.java new file mode 100644 index 000000000000..d216b506202f --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ProjectFileSystemLocation.java @@ -0,0 +1,259 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of ProjectFileSystemLocation. + */ +@Fluent +public final class ProjectFileSystemLocation implements JsonSerializable { + /* + *

The name used to access a file system created by Amazon EFS. CodeBuild creates an environment variable by + * appending the identifier in all capital letters to CODEBUILD_. For example, if you + * specify my_efs for identifier, a new environment variable is create named + * CODEBUILD_MY_EFS.

The identifier is used to mount your file system.

+ */ + private String identifier; + + /* + *

A string that specifies the location of the file system created by Amazon EFS. Its format is + * efs-dns-name:/directory-path. You can find the DNS name of file system when you view it in the + * Amazon EFS console. The directory path is a path to a directory in the file system that CodeBuild mounts. For + * example, if the DNS name of a file system is fs-abcd1234.efs.us-west-2.amazonaws.com, and its mount + * directory is my-efs-mount-directory, then the location is + * fs-abcd1234.efs.us-west-2.amazonaws.com:/my-efs-mount-directory.

The directory path in the + * format efs-dns-name:/directory-path is optional. If you do not specify a directory path, the + * location is only the DNS name and CodeBuild mounts the entire file system.

+ */ + private String location; + + /* + *

The mount options for a file system created by Amazon EFS. The default mount options used by CodeBuild are + * nfsvers=4.1,rsize=1048576,wsize=1048576,hard,timeo=600,retrans=2. For more information, see Recommended NFS Mount + * Options.

+ */ + private String mountOptions; + + /* + *

The location in the container where you mount the file system.

+ */ + private String mountPoint; + + /* + *

The type of the file system. The one supported type is EFS.

+ */ + private FileSystemTypeEnumValue type; + + /** + * Creates an instance of ProjectFileSystemLocation class. + */ + public ProjectFileSystemLocation() { + } + + /** + * Get the identifier property: <p>The name used to access a file system created by Amazon EFS. CodeBuild + * creates an environment variable by appending the <code>identifier</code> in all capital letters to + * <code>CODEBUILD_</code>. For example, if you specify <code>my_efs</code> for + * <code>identifier</code>, a new environment variable is create named + * <code>CODEBUILD_MY_EFS</code>. </p> <p> The <code>identifier</code> is used + * to mount your file system. </p>. + * + * @return the identifier value. + */ + public String identifier() { + return this.identifier; + } + + /** + * Set the identifier property: <p>The name used to access a file system created by Amazon EFS. CodeBuild + * creates an environment variable by appending the <code>identifier</code> in all capital letters to + * <code>CODEBUILD_</code>. For example, if you specify <code>my_efs</code> for + * <code>identifier</code>, a new environment variable is create named + * <code>CODEBUILD_MY_EFS</code>. </p> <p> The <code>identifier</code> is used + * to mount your file system. </p>. + * + * @param identifier the identifier value to set. + * @return the ProjectFileSystemLocation object itself. + */ + public ProjectFileSystemLocation withIdentifier(String identifier) { + this.identifier = identifier; + return this; + } + + /** + * Get the location property: <p>A string that specifies the location of the file system created by Amazon + * EFS. Its format is <code>efs-dns-name:/directory-path</code>. You can find the DNS name of file + * system when you view it in the Amazon EFS console. The directory path is a path to a directory in the file system + * that CodeBuild mounts. For example, if the DNS name of a file system is + * <code>fs-abcd1234.efs.us-west-2.amazonaws.com</code>, and its mount directory is + * <code>my-efs-mount-directory</code>, then the <code>location</code> is + * <code>fs-abcd1234.efs.us-west-2.amazonaws.com:/my-efs-mount-directory</code>. </p> <p>The + * directory path in the format <code>efs-dns-name:/directory-path</code> is optional. If you do not + * specify a directory path, the location is only the DNS name and CodeBuild mounts the entire file system. + * </p>. + * + * @return the location value. + */ + public String location() { + return this.location; + } + + /** + * Set the location property: <p>A string that specifies the location of the file system created by Amazon + * EFS. Its format is <code>efs-dns-name:/directory-path</code>. You can find the DNS name of file + * system when you view it in the Amazon EFS console. The directory path is a path to a directory in the file system + * that CodeBuild mounts. For example, if the DNS name of a file system is + * <code>fs-abcd1234.efs.us-west-2.amazonaws.com</code>, and its mount directory is + * <code>my-efs-mount-directory</code>, then the <code>location</code> is + * <code>fs-abcd1234.efs.us-west-2.amazonaws.com:/my-efs-mount-directory</code>. </p> <p>The + * directory path in the format <code>efs-dns-name:/directory-path</code> is optional. If you do not + * specify a directory path, the location is only the DNS name and CodeBuild mounts the entire file system. + * </p>. + * + * @param location the location value to set. + * @return the ProjectFileSystemLocation object itself. + */ + public ProjectFileSystemLocation withLocation(String location) { + this.location = location; + return this; + } + + /** + * Get the mountOptions property: <p> The mount options for a file system created by Amazon EFS. The default + * mount options used by CodeBuild are + * <code>nfsvers=4.1,rsize=1048576,wsize=1048576,hard,timeo=600,retrans=2</code>. For more information, + * see <a href='https://docs.aws.amazon.com/efs/latest/ug/mounting-fs-nfs-mount-settings.html'>Recommended NFS + * Mount Options</a>. </p>. + * + * @return the mountOptions value. + */ + public String mountOptions() { + return this.mountOptions; + } + + /** + * Set the mountOptions property: <p> The mount options for a file system created by Amazon EFS. The default + * mount options used by CodeBuild are + * <code>nfsvers=4.1,rsize=1048576,wsize=1048576,hard,timeo=600,retrans=2</code>. For more information, + * see <a href='https://docs.aws.amazon.com/efs/latest/ug/mounting-fs-nfs-mount-settings.html'>Recommended NFS + * Mount Options</a>. </p>. + * + * @param mountOptions the mountOptions value to set. + * @return the ProjectFileSystemLocation object itself. + */ + public ProjectFileSystemLocation withMountOptions(String mountOptions) { + this.mountOptions = mountOptions; + return this; + } + + /** + * Get the mountPoint property: <p>The location in the container where you mount the file system. </p>. + * + * @return the mountPoint value. + */ + public String mountPoint() { + return this.mountPoint; + } + + /** + * Set the mountPoint property: <p>The location in the container where you mount the file system. </p>. + * + * @param mountPoint the mountPoint value to set. + * @return the ProjectFileSystemLocation object itself. + */ + public ProjectFileSystemLocation withMountPoint(String mountPoint) { + this.mountPoint = mountPoint; + return this; + } + + /** + * Get the type property: <p> The type of the file system. The one supported type is + * <code>EFS</code>. </p>. + * + * @return the type value. + */ + public FileSystemTypeEnumValue type() { + return this.type; + } + + /** + * Set the type property: <p> The type of the file system. The one supported type is + * <code>EFS</code>. </p>. + * + * @param type the type value to set. + * @return the ProjectFileSystemLocation object itself. + */ + public ProjectFileSystemLocation withType(FileSystemTypeEnumValue type) { + this.type = type; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (type() != null) { + type().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("identifier", this.identifier); + jsonWriter.writeStringField("location", this.location); + jsonWriter.writeStringField("mountOptions", this.mountOptions); + jsonWriter.writeStringField("mountPoint", this.mountPoint); + jsonWriter.writeJsonField("type", this.type); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ProjectFileSystemLocation from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ProjectFileSystemLocation if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ProjectFileSystemLocation. + */ + public static ProjectFileSystemLocation fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ProjectFileSystemLocation deserializedProjectFileSystemLocation = new ProjectFileSystemLocation(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("identifier".equals(fieldName)) { + deserializedProjectFileSystemLocation.identifier = reader.getString(); + } else if ("location".equals(fieldName)) { + deserializedProjectFileSystemLocation.location = reader.getString(); + } else if ("mountOptions".equals(fieldName)) { + deserializedProjectFileSystemLocation.mountOptions = reader.getString(); + } else if ("mountPoint".equals(fieldName)) { + deserializedProjectFileSystemLocation.mountPoint = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedProjectFileSystemLocation.type = FileSystemTypeEnumValue.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedProjectFileSystemLocation; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ProjectFleet.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ProjectFleet.java new file mode 100644 index 000000000000..1b4a4a6f3efe --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ProjectFleet.java @@ -0,0 +1,93 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of ProjectFleet. + */ +@Fluent +public final class ProjectFleet implements JsonSerializable { + /* + *

Specifies the compute fleet ARN for the build project.

+ */ + private String fleetArn; + + /** + * Creates an instance of ProjectFleet class. + */ + public ProjectFleet() { + } + + /** + * Get the fleetArn property: <p>Specifies the compute fleet ARN for the build project.</p>. + * + * @return the fleetArn value. + */ + public String fleetArn() { + return this.fleetArn; + } + + /** + * Set the fleetArn property: <p>Specifies the compute fleet ARN for the build project.</p>. + * + * @param fleetArn the fleetArn value to set. + * @return the ProjectFleet object itself. + */ + public ProjectFleet withFleetArn(String fleetArn) { + this.fleetArn = fleetArn; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("fleetArn", this.fleetArn); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ProjectFleet from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ProjectFleet if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the ProjectFleet. + */ + public static ProjectFleet fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ProjectFleet deserializedProjectFleet = new ProjectFleet(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("fleetArn".equals(fieldName)) { + deserializedProjectFleet.fleetArn = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedProjectFleet; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ProjectSource.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ProjectSource.java new file mode 100644 index 000000000000..5c5264aac77b --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ProjectSource.java @@ -0,0 +1,582 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of ProjectSource. + */ +@Fluent +public final class ProjectSource implements JsonSerializable { + /* + *

Information about the authorization settings for CodeBuild to access the source code to be built.

This + * information is for the CodeBuild console's use only. Your code should not get or set this information + * directly.

+ */ + private SourceAuth auth; + + /* + *

Contains information that defines how the build project reports the build status to the source provider. This + * option is only used when the source provider is GITHUB, GITHUB_ENTERPRISE, or + * BITBUCKET.

+ */ + private BuildStatusConfig buildStatusConfig; + + /* + *

The buildspec file declaration to use for the builds in this build project.

If this value is set, it + * can be either an inline buildspec definition, the path to an alternate buildspec file relative to the value of + * the built-in CODEBUILD_SRC_DIR environment variable, or the path to an S3 bucket. The bucket must be + * in the same Amazon Web Services Region as the build project. Specify the buildspec file using its ARN (for + * example, arn:aws:s3:::my-codebuild-sample2/buildspec.yml). If this value is not provided or is set + * to an empty string, the source code must contain a buildspec file in its root directory. For more information, + * see + * Buildspec File Name and Storage Location.

+ */ + private String buildspec; + + /* + *

Information about the Git clone depth for the build project.

+ */ + private Integer gitCloneDepth; + + /* + *

Information about the Git submodules configuration for the build project.

+ */ + private GitSubmodulesConfig gitSubmodulesConfig; + + /* + *

Enable this flag to ignore SSL warnings while connecting to the project source code.

+ */ + private Boolean insecureSsl; + + /* + *

Information about the location of the source code to be built. Valid values include:

  • For + * source code settings that are specified in the source action of a pipeline in CodePipeline, location + * should not be specified. If it is specified, CodePipeline ignores it. This is because CodePipeline uses the + * settings in a pipeline's source action instead of this value.

  • For source code in an CodeCommit + * repository, the HTTPS clone URL to the repository that contains the source code and the buildspec file (for + * example, https://git-codecommit.<region-ID>.amazonaws.com/v1/repos/<repo-name>).

    + *
  • For source code in an Amazon S3 input bucket, one of the following.

    • The path to + * the ZIP file that contains the source code (for example, + * <bucket-name>/<path>/<object-name>.zip).

    • The path to the folder + * that contains the source code (for example, + * <bucket-name>/<path-to-source-code>/<folder>/).

  • For + * source code in a GitHub repository, the HTTPS clone URL to the repository that contains the source and the + * buildspec file. You must connect your Amazon Web Services account to your GitHub account. Use the CodeBuild + * console to start creating a build project. When you use the console to connect (or reconnect) with GitHub, on the + * GitHub Authorize application page, for Organization access, choose Request access next to + * each repository you want to allow CodeBuild to have access to, and then choose Authorize application. + * (After you have connected to your GitHub account, you do not need to finish creating the build project. You can + * leave the CodeBuild console.) To instruct CodeBuild to use this connection, in the source object, + * set the auth object's type value to OAUTH.

  • For source + * code in an GitLab or self-managed GitLab repository, the HTTPS clone URL to the repository that contains the + * source and the buildspec file. You must connect your Amazon Web Services account to your GitLab account. Use the + * CodeBuild console to start creating a build project. When you use the console to connect (or reconnect) with + * GitLab, on the Connections Authorize application page, choose Authorize. Then on the + * CodeConnections Create GitLab connection page, choose Connect to GitLab. (After you have connected + * to your GitLab account, you do not need to finish creating the build project. You can leave the CodeBuild + * console.) To instruct CodeBuild to override the default connection and use this connection instead, set the + * auth object's type value to CODECONNECTIONS in the source + * object.

  • For source code in a Bitbucket repository, the HTTPS clone URL to the repository that + * contains the source and the buildspec file. You must connect your Amazon Web Services account to your Bitbucket + * account. Use the CodeBuild console to start creating a build project. When you use the console to connect (or + * reconnect) with Bitbucket, on the Bitbucket Confirm access to your account page, choose Grant + * access. (After you have connected to your Bitbucket account, you do not need to finish creating the build + * project. You can leave the CodeBuild console.) To instruct CodeBuild to use this connection, in the + * source object, set the auth object's type value to OAUTH.

    + *

If you specify CODEPIPELINE for the Type property, don't specify this + * property. For all of the other types, you must specify Location.

+ */ + private String location; + + /* + *

Set to true to report the status of a build's start and finish to your source provider. This option is valid + * only when your source provider is GitHub, GitHub Enterprise, GitLab, GitLab Self Managed, or Bitbucket. If this + * is set and you use a different source provider, an invalidInputException is thrown.

To be + * able to report the build status to the source provider, the user associated with the source provider must have + * write access to the repo. If the user does not have write access, the build status cannot be updated. For more + * information, see Source + * provider access in the CodeBuild User Guide.

The status of a build triggered by a webhook is + * always reported to your source provider.

If your project's builds are triggered by a webhook, you must + * push a new commit to the repo for a change to this property to take effect.

+ */ + private Boolean reportBuildStatus; + + /* + *

An identifier for this project source. The identifier can only contain alphanumeric characters and + * underscores, and must be less than 128 characters in length.

+ */ + private String sourceIdentifier; + + /* + *

The type of repository that contains the source code to be built. Valid values include:

  • + * BITBUCKET: The source code is in a Bitbucket repository.

  • CODECOMMIT: + * The source code is in an CodeCommit repository.

  • CODEPIPELINE: The source code + * settings are specified in the source action of a pipeline in CodePipeline.

  • + * GITHUB: The source code is in a GitHub repository.

  • + * GITHUB_ENTERPRISE: The source code is in a GitHub Enterprise Server repository.

  • + * GITLAB: The source code is in a GitLab repository.

  • + * GITLAB_SELF_MANAGED: The source code is in a self-managed GitLab repository.

  • + * NO_SOURCE: The project does not have input source code.

  • S3: The + * source code is in an Amazon S3 bucket.

+ */ + private SourceTypeEnumValue type; + + /** + * Creates an instance of ProjectSource class. + */ + public ProjectSource() { + } + + /** + * Get the auth property: <p>Information about the authorization settings for CodeBuild to access the source + * code to be built.</p> <p>This information is for the CodeBuild console's use only. Your code should + * not get or set this information directly.</p>. + * + * @return the auth value. + */ + public SourceAuth auth() { + return this.auth; + } + + /** + * Set the auth property: <p>Information about the authorization settings for CodeBuild to access the source + * code to be built.</p> <p>This information is for the CodeBuild console's use only. Your code should + * not get or set this information directly.</p>. + * + * @param auth the auth value to set. + * @return the ProjectSource object itself. + */ + public ProjectSource withAuth(SourceAuth auth) { + this.auth = auth; + return this; + } + + /** + * Get the buildStatusConfig property: <p>Contains information that defines how the build project reports the + * build status to the source provider. This option is only used when the source provider is + * <code>GITHUB</code>, <code>GITHUB_ENTERPRISE</code>, or + * <code>BITBUCKET</code>.</p>. + * + * @return the buildStatusConfig value. + */ + public BuildStatusConfig buildStatusConfig() { + return this.buildStatusConfig; + } + + /** + * Set the buildStatusConfig property: <p>Contains information that defines how the build project reports the + * build status to the source provider. This option is only used when the source provider is + * <code>GITHUB</code>, <code>GITHUB_ENTERPRISE</code>, or + * <code>BITBUCKET</code>.</p>. + * + * @param buildStatusConfig the buildStatusConfig value to set. + * @return the ProjectSource object itself. + */ + public ProjectSource withBuildStatusConfig(BuildStatusConfig buildStatusConfig) { + this.buildStatusConfig = buildStatusConfig; + return this; + } + + /** + * Get the buildspec property: <p>The buildspec file declaration to use for the builds in this build + * project.</p> <p> If this value is set, it can be either an inline buildspec definition, the path to + * an alternate buildspec file relative to the value of the built-in <code>CODEBUILD_SRC_DIR</code> + * environment variable, or the path to an S3 bucket. The bucket must be in the same Amazon Web Services Region as + * the build project. Specify the buildspec file using its ARN (for example, + * <code>arn:aws:s3:::my-codebuild-sample2/buildspec.yml</code>). If this value is not provided or is + * set to an empty string, the source code must contain a buildspec file in its root directory. For more + * information, see <a + * href='https://docs.aws.amazon.com/codebuild/latest/userguide/build-spec-ref.html#build-spec-ref-name-storage'>Buildspec + * File Name and Storage Location</a>. </p>. + * + * @return the buildspec value. + */ + public String buildspec() { + return this.buildspec; + } + + /** + * Set the buildspec property: <p>The buildspec file declaration to use for the builds in this build + * project.</p> <p> If this value is set, it can be either an inline buildspec definition, the path to + * an alternate buildspec file relative to the value of the built-in <code>CODEBUILD_SRC_DIR</code> + * environment variable, or the path to an S3 bucket. The bucket must be in the same Amazon Web Services Region as + * the build project. Specify the buildspec file using its ARN (for example, + * <code>arn:aws:s3:::my-codebuild-sample2/buildspec.yml</code>). If this value is not provided or is + * set to an empty string, the source code must contain a buildspec file in its root directory. For more + * information, see <a + * href='https://docs.aws.amazon.com/codebuild/latest/userguide/build-spec-ref.html#build-spec-ref-name-storage'>Buildspec + * File Name and Storage Location</a>. </p>. + * + * @param buildspec the buildspec value to set. + * @return the ProjectSource object itself. + */ + public ProjectSource withBuildspec(String buildspec) { + this.buildspec = buildspec; + return this; + } + + /** + * Get the gitCloneDepth property: <p>Information about the Git clone depth for the build project.</p>. + * + * @return the gitCloneDepth value. + */ + public Integer gitCloneDepth() { + return this.gitCloneDepth; + } + + /** + * Set the gitCloneDepth property: <p>Information about the Git clone depth for the build project.</p>. + * + * @param gitCloneDepth the gitCloneDepth value to set. + * @return the ProjectSource object itself. + */ + public ProjectSource withGitCloneDepth(Integer gitCloneDepth) { + this.gitCloneDepth = gitCloneDepth; + return this; + } + + /** + * Get the gitSubmodulesConfig property: <p> Information about the Git submodules configuration for the build + * project. </p>. + * + * @return the gitSubmodulesConfig value. + */ + public GitSubmodulesConfig gitSubmodulesConfig() { + return this.gitSubmodulesConfig; + } + + /** + * Set the gitSubmodulesConfig property: <p> Information about the Git submodules configuration for the build + * project. </p>. + * + * @param gitSubmodulesConfig the gitSubmodulesConfig value to set. + * @return the ProjectSource object itself. + */ + public ProjectSource withGitSubmodulesConfig(GitSubmodulesConfig gitSubmodulesConfig) { + this.gitSubmodulesConfig = gitSubmodulesConfig; + return this; + } + + /** + * Get the insecureSsl property: <p>Enable this flag to ignore SSL warnings while connecting to the project + * source code.</p>. + * + * @return the insecureSsl value. + */ + public Boolean insecureSsl() { + return this.insecureSsl; + } + + /** + * Set the insecureSsl property: <p>Enable this flag to ignore SSL warnings while connecting to the project + * source code.</p>. + * + * @param insecureSsl the insecureSsl value to set. + * @return the ProjectSource object itself. + */ + public ProjectSource withInsecureSsl(Boolean insecureSsl) { + this.insecureSsl = insecureSsl; + return this; + } + + /** + * Get the location property: <p>Information about the location of the source code to be built. Valid values + * include:</p> <ul> <li> <p>For source code settings that are specified in the source + * action of a pipeline in CodePipeline, <code>location</code> should not be specified. If it is + * specified, CodePipeline ignores it. This is because CodePipeline uses the settings in a pipeline's source action + * instead of this value.</p> </li> <li> <p>For source code in an CodeCommit repository, the + * HTTPS clone URL to the repository that contains the source code and the buildspec file (for example, + * <code>https://git-codecommit.&lt;region-ID&gt;.amazonaws.com/v1/repos/&lt;repo-name&gt;</code>).</p> + * </li> <li> <p>For source code in an Amazon S3 input bucket, one of the following. </p> + * <ul> <li> <p>The path to the ZIP file that contains the source code (for example, + * <code>&lt;bucket-name&gt;/&lt;path&gt;/&lt;object-name&gt;.zip</code>). + * </p> </li> <li> <p>The path to the folder that contains the source code (for example, + * <code>&lt;bucket-name&gt;/&lt;path-to-source-code&gt;/&lt;folder&gt;/</code>). + * </p> </li> </ul> </li> <li> <p>For source code in a GitHub repository, the + * HTTPS clone URL to the repository that contains the source and the buildspec file. You must connect your Amazon + * Web Services account to your GitHub account. Use the CodeBuild console to start creating a build project. When + * you use the console to connect (or reconnect) with GitHub, on the GitHub <b>Authorize application</b> + * page, for <b>Organization access</b>, choose <b>Request access</b> next to each + * repository you want to allow CodeBuild to have access to, and then choose <b>Authorize + * application</b>. (After you have connected to your GitHub account, you do not need to finish creating the + * build project. You can leave the CodeBuild console.) To instruct CodeBuild to use this connection, in the + * <code>source</code> object, set the <code>auth</code> object's + * <code>type</code> value to <code>OAUTH</code>.</p> </li> <li> + * <p>For source code in an GitLab or self-managed GitLab repository, the HTTPS clone URL to the repository + * that contains the source and the buildspec file. You must connect your Amazon Web Services account to your GitLab + * account. Use the CodeBuild console to start creating a build project. When you use the console to connect (or + * reconnect) with GitLab, on the Connections <b>Authorize application</b> page, choose + * <b>Authorize</b>. Then on the CodeConnections <b>Create GitLab connection</b> page, + * choose <b>Connect to GitLab</b>. (After you have connected to your GitLab account, you do not need to + * finish creating the build project. You can leave the CodeBuild console.) To instruct CodeBuild to override the + * default connection and use this connection instead, set the <code>auth</code> object's + * <code>type</code> value to <code>CODECONNECTIONS</code> in the + * <code>source</code> object.</p> </li> <li> <p>For source code in a Bitbucket + * repository, the HTTPS clone URL to the repository that contains the source and the buildspec file. You must + * connect your Amazon Web Services account to your Bitbucket account. Use the CodeBuild console to start creating a + * build project. When you use the console to connect (or reconnect) with Bitbucket, on the Bitbucket + * <b>Confirm access to your account</b> page, choose <b>Grant access</b>. (After you have + * connected to your Bitbucket account, you do not need to finish creating the build project. You can leave the + * CodeBuild console.) To instruct CodeBuild to use this connection, in the <code>source</code> object, + * set the <code>auth</code> object's <code>type</code> value to + * <code>OAUTH</code>.</p> </li> </ul> <p> If you specify + * <code>CODEPIPELINE</code> for the <code>Type</code> property, don't specify this + * property. For all of the other types, you must specify <code>Location</code>. </p>. + * + * @return the location value. + */ + public String location() { + return this.location; + } + + /** + * Set the location property: <p>Information about the location of the source code to be built. Valid values + * include:</p> <ul> <li> <p>For source code settings that are specified in the source + * action of a pipeline in CodePipeline, <code>location</code> should not be specified. If it is + * specified, CodePipeline ignores it. This is because CodePipeline uses the settings in a pipeline's source action + * instead of this value.</p> </li> <li> <p>For source code in an CodeCommit repository, the + * HTTPS clone URL to the repository that contains the source code and the buildspec file (for example, + * <code>https://git-codecommit.&lt;region-ID&gt;.amazonaws.com/v1/repos/&lt;repo-name&gt;</code>).</p> + * </li> <li> <p>For source code in an Amazon S3 input bucket, one of the following. </p> + * <ul> <li> <p>The path to the ZIP file that contains the source code (for example, + * <code>&lt;bucket-name&gt;/&lt;path&gt;/&lt;object-name&gt;.zip</code>). + * </p> </li> <li> <p>The path to the folder that contains the source code (for example, + * <code>&lt;bucket-name&gt;/&lt;path-to-source-code&gt;/&lt;folder&gt;/</code>). + * </p> </li> </ul> </li> <li> <p>For source code in a GitHub repository, the + * HTTPS clone URL to the repository that contains the source and the buildspec file. You must connect your Amazon + * Web Services account to your GitHub account. Use the CodeBuild console to start creating a build project. When + * you use the console to connect (or reconnect) with GitHub, on the GitHub <b>Authorize application</b> + * page, for <b>Organization access</b>, choose <b>Request access</b> next to each + * repository you want to allow CodeBuild to have access to, and then choose <b>Authorize + * application</b>. (After you have connected to your GitHub account, you do not need to finish creating the + * build project. You can leave the CodeBuild console.) To instruct CodeBuild to use this connection, in the + * <code>source</code> object, set the <code>auth</code> object's + * <code>type</code> value to <code>OAUTH</code>.</p> </li> <li> + * <p>For source code in an GitLab or self-managed GitLab repository, the HTTPS clone URL to the repository + * that contains the source and the buildspec file. You must connect your Amazon Web Services account to your GitLab + * account. Use the CodeBuild console to start creating a build project. When you use the console to connect (or + * reconnect) with GitLab, on the Connections <b>Authorize application</b> page, choose + * <b>Authorize</b>. Then on the CodeConnections <b>Create GitLab connection</b> page, + * choose <b>Connect to GitLab</b>. (After you have connected to your GitLab account, you do not need to + * finish creating the build project. You can leave the CodeBuild console.) To instruct CodeBuild to override the + * default connection and use this connection instead, set the <code>auth</code> object's + * <code>type</code> value to <code>CODECONNECTIONS</code> in the + * <code>source</code> object.</p> </li> <li> <p>For source code in a Bitbucket + * repository, the HTTPS clone URL to the repository that contains the source and the buildspec file. You must + * connect your Amazon Web Services account to your Bitbucket account. Use the CodeBuild console to start creating a + * build project. When you use the console to connect (or reconnect) with Bitbucket, on the Bitbucket + * <b>Confirm access to your account</b> page, choose <b>Grant access</b>. (After you have + * connected to your Bitbucket account, you do not need to finish creating the build project. You can leave the + * CodeBuild console.) To instruct CodeBuild to use this connection, in the <code>source</code> object, + * set the <code>auth</code> object's <code>type</code> value to + * <code>OAUTH</code>.</p> </li> </ul> <p> If you specify + * <code>CODEPIPELINE</code> for the <code>Type</code> property, don't specify this + * property. For all of the other types, you must specify <code>Location</code>. </p>. + * + * @param location the location value to set. + * @return the ProjectSource object itself. + */ + public ProjectSource withLocation(String location) { + this.location = location; + return this; + } + + /** + * Get the reportBuildStatus property: <p> Set to true to report the status of a build's start and finish to + * your source provider. This option is valid only when your source provider is GitHub, GitHub Enterprise, GitLab, + * GitLab Self Managed, or Bitbucket. If this is set and you use a different source provider, an + * <code>invalidInputException</code> is thrown. </p> <p>To be able to report the build + * status to the source provider, the user associated with the source provider must have write access to the repo. + * If the user does not have write access, the build status cannot be updated. For more information, see <a + * href='https://docs.aws.amazon.com/codebuild/latest/userguide/access-tokens.html'>Source provider + * access</a> in the <i>CodeBuild User Guide</i>.</p> <p>The status of a build + * triggered by a webhook is always reported to your source provider. </p> <p>If your project's builds + * are triggered by a webhook, you must push a new commit to the repo for a change to this property to take + * effect.</p>. + * + * @return the reportBuildStatus value. + */ + public Boolean reportBuildStatus() { + return this.reportBuildStatus; + } + + /** + * Set the reportBuildStatus property: <p> Set to true to report the status of a build's start and finish to + * your source provider. This option is valid only when your source provider is GitHub, GitHub Enterprise, GitLab, + * GitLab Self Managed, or Bitbucket. If this is set and you use a different source provider, an + * <code>invalidInputException</code> is thrown. </p> <p>To be able to report the build + * status to the source provider, the user associated with the source provider must have write access to the repo. + * If the user does not have write access, the build status cannot be updated. For more information, see <a + * href='https://docs.aws.amazon.com/codebuild/latest/userguide/access-tokens.html'>Source provider + * access</a> in the <i>CodeBuild User Guide</i>.</p> <p>The status of a build + * triggered by a webhook is always reported to your source provider. </p> <p>If your project's builds + * are triggered by a webhook, you must push a new commit to the repo for a change to this property to take + * effect.</p>. + * + * @param reportBuildStatus the reportBuildStatus value to set. + * @return the ProjectSource object itself. + */ + public ProjectSource withReportBuildStatus(Boolean reportBuildStatus) { + this.reportBuildStatus = reportBuildStatus; + return this; + } + + /** + * Get the sourceIdentifier property: <p>An identifier for this project source. The identifier can only + * contain alphanumeric characters and underscores, and must be less than 128 characters in length. </p>. + * + * @return the sourceIdentifier value. + */ + public String sourceIdentifier() { + return this.sourceIdentifier; + } + + /** + * Set the sourceIdentifier property: <p>An identifier for this project source. The identifier can only + * contain alphanumeric characters and underscores, and must be less than 128 characters in length. </p>. + * + * @param sourceIdentifier the sourceIdentifier value to set. + * @return the ProjectSource object itself. + */ + public ProjectSource withSourceIdentifier(String sourceIdentifier) { + this.sourceIdentifier = sourceIdentifier; + return this; + } + + /** + * Get the type property: <p>The type of repository that contains the source code to be built. Valid values + * include:</p> <ul> <li> <p> <code>BITBUCKET</code>: The source code is in a + * Bitbucket repository.</p> </li> <li> <p> <code>CODECOMMIT</code>: The source + * code is in an CodeCommit repository.</p> </li> <li> <p> + * <code>CODEPIPELINE</code>: The source code settings are specified in the source action of a pipeline + * in CodePipeline.</p> </li> <li> <p> <code>GITHUB</code>: The source code is + * in a GitHub repository.</p> </li> <li> <p> <code>GITHUB_ENTERPRISE</code>: + * The source code is in a GitHub Enterprise Server repository.</p> </li> <li> <p> + * <code>GITLAB</code>: The source code is in a GitLab repository.</p> </li> <li> + * <p> <code>GITLAB_SELF_MANAGED</code>: The source code is in a self-managed GitLab + * repository.</p> </li> <li> <p> <code>NO_SOURCE</code>: The project does not + * have input source code.</p> </li> <li> <p> <code>S3</code>: The source code + * is in an Amazon S3 bucket.</p> </li> </ul>. + * + * @return the type value. + */ + public SourceTypeEnumValue type() { + return this.type; + } + + /** + * Set the type property: <p>The type of repository that contains the source code to be built. Valid values + * include:</p> <ul> <li> <p> <code>BITBUCKET</code>: The source code is in a + * Bitbucket repository.</p> </li> <li> <p> <code>CODECOMMIT</code>: The source + * code is in an CodeCommit repository.</p> </li> <li> <p> + * <code>CODEPIPELINE</code>: The source code settings are specified in the source action of a pipeline + * in CodePipeline.</p> </li> <li> <p> <code>GITHUB</code>: The source code is + * in a GitHub repository.</p> </li> <li> <p> <code>GITHUB_ENTERPRISE</code>: + * The source code is in a GitHub Enterprise Server repository.</p> </li> <li> <p> + * <code>GITLAB</code>: The source code is in a GitLab repository.</p> </li> <li> + * <p> <code>GITLAB_SELF_MANAGED</code>: The source code is in a self-managed GitLab + * repository.</p> </li> <li> <p> <code>NO_SOURCE</code>: The project does not + * have input source code.</p> </li> <li> <p> <code>S3</code>: The source code + * is in an Amazon S3 bucket.</p> </li> </ul>. + * + * @param type the type value to set. + * @return the ProjectSource object itself. + */ + public ProjectSource withType(SourceTypeEnumValue type) { + this.type = type; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (auth() != null) { + auth().validate(); + } + if (buildStatusConfig() != null) { + buildStatusConfig().validate(); + } + if (gitSubmodulesConfig() != null) { + gitSubmodulesConfig().validate(); + } + if (type() != null) { + type().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("auth", this.auth); + jsonWriter.writeJsonField("buildStatusConfig", this.buildStatusConfig); + jsonWriter.writeStringField("buildspec", this.buildspec); + jsonWriter.writeNumberField("gitCloneDepth", this.gitCloneDepth); + jsonWriter.writeJsonField("gitSubmodulesConfig", this.gitSubmodulesConfig); + jsonWriter.writeBooleanField("insecureSsl", this.insecureSsl); + jsonWriter.writeStringField("location", this.location); + jsonWriter.writeBooleanField("reportBuildStatus", this.reportBuildStatus); + jsonWriter.writeStringField("sourceIdentifier", this.sourceIdentifier); + jsonWriter.writeJsonField("type", this.type); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ProjectSource from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ProjectSource if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the ProjectSource. + */ + public static ProjectSource fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ProjectSource deserializedProjectSource = new ProjectSource(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("auth".equals(fieldName)) { + deserializedProjectSource.auth = SourceAuth.fromJson(reader); + } else if ("buildStatusConfig".equals(fieldName)) { + deserializedProjectSource.buildStatusConfig = BuildStatusConfig.fromJson(reader); + } else if ("buildspec".equals(fieldName)) { + deserializedProjectSource.buildspec = reader.getString(); + } else if ("gitCloneDepth".equals(fieldName)) { + deserializedProjectSource.gitCloneDepth = reader.getNullable(JsonReader::getInt); + } else if ("gitSubmodulesConfig".equals(fieldName)) { + deserializedProjectSource.gitSubmodulesConfig = GitSubmodulesConfig.fromJson(reader); + } else if ("insecureSsl".equals(fieldName)) { + deserializedProjectSource.insecureSsl = reader.getNullable(JsonReader::getBoolean); + } else if ("location".equals(fieldName)) { + deserializedProjectSource.location = reader.getString(); + } else if ("reportBuildStatus".equals(fieldName)) { + deserializedProjectSource.reportBuildStatus = reader.getNullable(JsonReader::getBoolean); + } else if ("sourceIdentifier".equals(fieldName)) { + deserializedProjectSource.sourceIdentifier = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedProjectSource.type = SourceTypeEnumValue.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedProjectSource; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ProjectSourceVersion.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ProjectSourceVersion.java new file mode 100644 index 000000000000..2cc4cc8ae50b --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ProjectSourceVersion.java @@ -0,0 +1,159 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of ProjectSourceVersion. + */ +@Fluent +public final class ProjectSourceVersion implements JsonSerializable { + /* + *

An identifier for a source in the build project. The identifier can only contain alphanumeric characters and + * underscores, and must be less than 128 characters in length.

+ */ + private String sourceIdentifier; + + /* + *

The source version for the corresponding source identifier. If specified, must be one of:

  • For + * CodeCommit: the commit ID, branch, or Git tag to use.

  • For GitHub or GitLab: the commit ID, pull + * request ID, branch name, or tag name that corresponds to the version of the source code you want to build. If a + * pull request ID is specified, it must use the format pr/pull-request-ID (for example, + * pr/25). If a branch name is specified, the branch's HEAD commit ID is used. If not specified, the + * default branch's HEAD commit ID is used.

  • For Bitbucket: the commit ID, branch name, or tag name + * that corresponds to the version of the source code you want to build. If a branch name is specified, the branch's + * HEAD commit ID is used. If not specified, the default branch's HEAD commit ID is used.

  • For + * Amazon S3: the version ID of the object that represents the build input ZIP file to use.

For + * more information, see Source Version Sample + * with CodeBuild in the CodeBuild User Guide.

+ */ + private String sourceVersion; + + /** + * Creates an instance of ProjectSourceVersion class. + */ + public ProjectSourceVersion() { + } + + /** + * Get the sourceIdentifier property: <p>An identifier for a source in the build project. The identifier can + * only contain alphanumeric characters and underscores, and must be less than 128 characters in length. </p>. + * + * @return the sourceIdentifier value. + */ + public String sourceIdentifier() { + return this.sourceIdentifier; + } + + /** + * Set the sourceIdentifier property: <p>An identifier for a source in the build project. The identifier can + * only contain alphanumeric characters and underscores, and must be less than 128 characters in length. </p>. + * + * @param sourceIdentifier the sourceIdentifier value to set. + * @return the ProjectSourceVersion object itself. + */ + public ProjectSourceVersion withSourceIdentifier(String sourceIdentifier) { + this.sourceIdentifier = sourceIdentifier; + return this; + } + + /** + * Get the sourceVersion property: <p>The source version for the corresponding source identifier. If + * specified, must be one of:</p> <ul> <li> <p>For CodeCommit: the commit ID, branch, or Git + * tag to use.</p> </li> <li> <p>For GitHub or GitLab: the commit ID, pull request ID, + * branch name, or tag name that corresponds to the version of the source code you want to build. If a pull request + * ID is specified, it must use the format <code>pr/pull-request-ID</code> (for example, + * <code>pr/25</code>). If a branch name is specified, the branch's HEAD commit ID is used. If not + * specified, the default branch's HEAD commit ID is used.</p> </li> <li> <p>For Bitbucket: + * the commit ID, branch name, or tag name that corresponds to the version of the source code you want to build. If + * a branch name is specified, the branch's HEAD commit ID is used. If not specified, the default branch's HEAD + * commit ID is used.</p> </li> <li> <p>For Amazon S3: the version ID of the object that + * represents the build input ZIP file to use.</p> </li> </ul> <p> For more information, see + * <a href='https://docs.aws.amazon.com/codebuild/latest/userguide/sample-source-version.html'>Source Version + * Sample with CodeBuild</a> in the <i>CodeBuild User Guide</i>. </p>. + * + * @return the sourceVersion value. + */ + public String sourceVersion() { + return this.sourceVersion; + } + + /** + * Set the sourceVersion property: <p>The source version for the corresponding source identifier. If + * specified, must be one of:</p> <ul> <li> <p>For CodeCommit: the commit ID, branch, or Git + * tag to use.</p> </li> <li> <p>For GitHub or GitLab: the commit ID, pull request ID, + * branch name, or tag name that corresponds to the version of the source code you want to build. If a pull request + * ID is specified, it must use the format <code>pr/pull-request-ID</code> (for example, + * <code>pr/25</code>). If a branch name is specified, the branch's HEAD commit ID is used. If not + * specified, the default branch's HEAD commit ID is used.</p> </li> <li> <p>For Bitbucket: + * the commit ID, branch name, or tag name that corresponds to the version of the source code you want to build. If + * a branch name is specified, the branch's HEAD commit ID is used. If not specified, the default branch's HEAD + * commit ID is used.</p> </li> <li> <p>For Amazon S3: the version ID of the object that + * represents the build input ZIP file to use.</p> </li> </ul> <p> For more information, see + * <a href='https://docs.aws.amazon.com/codebuild/latest/userguide/sample-source-version.html'>Source Version + * Sample with CodeBuild</a> in the <i>CodeBuild User Guide</i>. </p>. + * + * @param sourceVersion the sourceVersion value to set. + * @return the ProjectSourceVersion object itself. + */ + public ProjectSourceVersion withSourceVersion(String sourceVersion) { + this.sourceVersion = sourceVersion; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("sourceIdentifier", this.sourceIdentifier); + jsonWriter.writeStringField("sourceVersion", this.sourceVersion); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ProjectSourceVersion from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ProjectSourceVersion if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the ProjectSourceVersion. + */ + public static ProjectSourceVersion fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ProjectSourceVersion deserializedProjectSourceVersion = new ProjectSourceVersion(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("sourceIdentifier".equals(fieldName)) { + deserializedProjectSourceVersion.sourceIdentifier = reader.getString(); + } else if ("sourceVersion".equals(fieldName)) { + deserializedProjectSourceVersion.sourceVersion = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedProjectSourceVersion; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ProjectVisibilityType.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ProjectVisibilityType.java new file mode 100644 index 000000000000..e58d8bdfb0f3 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ProjectVisibilityType.java @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * ProjectVisibilityType enum. + */ +public final class ProjectVisibilityType extends ExpandableStringEnum { + /** + * Static value PRIVATE for ProjectVisibilityType. + */ + public static final ProjectVisibilityType PRIVATE = fromString("PRIVATE"); + + /** + * Static value PUBLIC_READ for ProjectVisibilityType. + */ + public static final ProjectVisibilityType PUBLIC_READ = fromString("PUBLIC_READ"); + + /** + * Creates a new instance of ProjectVisibilityType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ProjectVisibilityType() { + } + + /** + * Creates or finds a ProjectVisibilityType from its string representation. + * + * @param name a name to look for. + * @return the corresponding ProjectVisibilityType. + */ + public static ProjectVisibilityType fromString(String name) { + return fromString(name, ProjectVisibilityType.class); + } + + /** + * Gets known ProjectVisibilityType values. + * + * @return known ProjectVisibilityType values. + */ + public static Collection values() { + return values(ProjectVisibilityType.class); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ProjectVisibilityTypeEnumValue.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ProjectVisibilityTypeEnumValue.java new file mode 100644 index 000000000000..3e72968d3e74 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ProjectVisibilityTypeEnumValue.java @@ -0,0 +1,95 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of ProjectVisibilityTypeEnumValue. + */ +@Fluent +public final class ProjectVisibilityTypeEnumValue implements JsonSerializable { + /* + * Property value + */ + private ProjectVisibilityType value; + + /** + * Creates an instance of ProjectVisibilityTypeEnumValue class. + */ + public ProjectVisibilityTypeEnumValue() { + } + + /** + * Get the value property: Property value. + * + * @return the value value. + */ + public ProjectVisibilityType value() { + return this.value; + } + + /** + * Set the value property: Property value. + * + * @param value the value value to set. + * @return the ProjectVisibilityTypeEnumValue object itself. + */ + public ProjectVisibilityTypeEnumValue withValue(ProjectVisibilityType value) { + this.value = value; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("value", this.value == null ? null : this.value.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ProjectVisibilityTypeEnumValue from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ProjectVisibilityTypeEnumValue if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ProjectVisibilityTypeEnumValue. + */ + public static ProjectVisibilityTypeEnumValue fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ProjectVisibilityTypeEnumValue deserializedProjectVisibilityTypeEnumValue + = new ProjectVisibilityTypeEnumValue(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + deserializedProjectVisibilityTypeEnumValue.value + = ProjectVisibilityType.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedProjectVisibilityTypeEnumValue; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/Projection.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/Projection.java new file mode 100644 index 000000000000..c6d8c5f2597d --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/Projection.java @@ -0,0 +1,144 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Definition of Projection. + */ +@Fluent +public final class Projection implements JsonSerializable { + /* + * Represents the non-key attribute names which will be projected into the index. For local secondary indexes, the + * total count of ``NonKeyAttributes`` summed across all of the local secondary indexes, must not exceed 100. If you + * project the same attribute into two different indexes, this counts as two distinct attributes when determining + * the total. + */ + private List nonKeyAttributes; + + /* + * The set of attributes that are projected into the index: + ``KEYS_ONLY`` - Only the index and primary keys are + * projected into the index. + ``INCLUDE`` - In addition to the attributes described in ``KEYS_ONLY``, the secondary + * index will include other non-key attributes that you specify. + ``ALL`` - All of the table attributes are + * projected into the index. When using the DynamoDB console, ``ALL`` is selected by default. + */ + private String projectionType; + + /** + * Creates an instance of Projection class. + */ + public Projection() { + } + + /** + * Get the nonKeyAttributes property: Represents the non-key attribute names which will be projected into the index. + * For local secondary indexes, the total count of ``NonKeyAttributes`` summed across all of the local secondary + * indexes, must not exceed 100. If you project the same attribute into two different indexes, this counts as two + * distinct attributes when determining the total. + * + * @return the nonKeyAttributes value. + */ + public List nonKeyAttributes() { + return this.nonKeyAttributes; + } + + /** + * Set the nonKeyAttributes property: Represents the non-key attribute names which will be projected into the index. + * For local secondary indexes, the total count of ``NonKeyAttributes`` summed across all of the local secondary + * indexes, must not exceed 100. If you project the same attribute into two different indexes, this counts as two + * distinct attributes when determining the total. + * + * @param nonKeyAttributes the nonKeyAttributes value to set. + * @return the Projection object itself. + */ + public Projection withNonKeyAttributes(List nonKeyAttributes) { + this.nonKeyAttributes = nonKeyAttributes; + return this; + } + + /** + * Get the projectionType property: The set of attributes that are projected into the index: + ``KEYS_ONLY`` - Only + * the index and primary keys are projected into the index. + ``INCLUDE`` - In addition to the attributes described + * in ``KEYS_ONLY``, the secondary index will include other non-key attributes that you specify. + ``ALL`` - All of + * the table attributes are projected into the index. When using the DynamoDB console, ``ALL`` is selected by + * default. + * + * @return the projectionType value. + */ + public String projectionType() { + return this.projectionType; + } + + /** + * Set the projectionType property: The set of attributes that are projected into the index: + ``KEYS_ONLY`` - Only + * the index and primary keys are projected into the index. + ``INCLUDE`` - In addition to the attributes described + * in ``KEYS_ONLY``, the secondary index will include other non-key attributes that you specify. + ``ALL`` - All of + * the table attributes are projected into the index. When using the DynamoDB console, ``ALL`` is selected by + * default. + * + * @param projectionType the projectionType value to set. + * @return the Projection object itself. + */ + public Projection withProjectionType(String projectionType) { + this.projectionType = projectionType; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("nonKeyAttributes", this.nonKeyAttributes, + (writer, element) -> writer.writeString(element)); + jsonWriter.writeStringField("projectionType", this.projectionType); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of Projection from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of Projection if the JsonReader was pointing to an instance of it, or null if it was pointing + * to JSON null. + * @throws IOException If an error occurs while reading the Projection. + */ + public static Projection fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + Projection deserializedProjection = new Projection(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("nonKeyAttributes".equals(fieldName)) { + List nonKeyAttributes = reader.readArray(reader1 -> reader1.getString()); + deserializedProjection.nonKeyAttributes = nonKeyAttributes; + } else if ("projectionType".equals(fieldName)) { + deserializedProjection.projectionType = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedProjection; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/PropagateTags.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/PropagateTags.java new file mode 100644 index 000000000000..95106aef7127 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/PropagateTags.java @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * PropagateTags enum. + */ +public final class PropagateTags extends ExpandableStringEnum { + /** + * Static value SERVICE for PropagateTags. + */ + public static final PropagateTags SERVICE = fromString("SERVICE"); + + /** + * Static value TASK_DEFINITION for PropagateTags. + */ + public static final PropagateTags TASK_DEFINITION = fromString("TASK_DEFINITION"); + + /** + * Creates a new instance of PropagateTags value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public PropagateTags() { + } + + /** + * Creates or finds a PropagateTags from its string representation. + * + * @param name a name to look for. + * @return the corresponding PropagateTags. + */ + public static PropagateTags fromString(String name) { + return fromString(name, PropagateTags.class); + } + + /** + * Gets known PropagateTags values. + * + * @return known PropagateTags values. + */ + public static Collection values() { + return values(PropagateTags.class); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/PropertyValueType.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/PropertyValueType.java new file mode 100644 index 000000000000..d7ba215d0576 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/PropertyValueType.java @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * PropertyValueType enum. + */ +public final class PropertyValueType extends ExpandableStringEnum { + /** + * Static value PLAIN_TEXT for PropertyValueType. + */ + public static final PropertyValueType PLAIN_TEXT = fromString("PLAIN_TEXT"); + + /** + * Static value STRINGIFIED_JSON for PropertyValueType. + */ + public static final PropertyValueType STRINGIFIED_JSON = fromString("STRINGIFIED_JSON"); + + /** + * Creates a new instance of PropertyValueType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public PropertyValueType() { + } + + /** + * Creates or finds a PropertyValueType from its string representation. + * + * @param name a name to look for. + * @return the corresponding PropertyValueType. + */ + public static PropertyValueType fromString(String name) { + return fromString(name, PropertyValueType.class); + } + + /** + * Gets known PropertyValueType values. + * + * @return known PropertyValueType values. + */ + public static Collection values() { + return values(PropertyValueType.class); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/PropertyValueTypeEnumValue.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/PropertyValueTypeEnumValue.java new file mode 100644 index 000000000000..5d1334c65be7 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/PropertyValueTypeEnumValue.java @@ -0,0 +1,93 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of PropertyValueTypeEnumValue. + */ +@Fluent +public final class PropertyValueTypeEnumValue implements JsonSerializable { + /* + * Property value + */ + private PropertyValueType value; + + /** + * Creates an instance of PropertyValueTypeEnumValue class. + */ + public PropertyValueTypeEnumValue() { + } + + /** + * Get the value property: Property value. + * + * @return the value value. + */ + public PropertyValueType value() { + return this.value; + } + + /** + * Set the value property: Property value. + * + * @param value the value value to set. + * @return the PropertyValueTypeEnumValue object itself. + */ + public PropertyValueTypeEnumValue withValue(PropertyValueType value) { + this.value = value; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("value", this.value == null ? null : this.value.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of PropertyValueTypeEnumValue from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of PropertyValueTypeEnumValue if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IOException If an error occurs while reading the PropertyValueTypeEnumValue. + */ + public static PropertyValueTypeEnumValue fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + PropertyValueTypeEnumValue deserializedPropertyValueTypeEnumValue = new PropertyValueTypeEnumValue(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + deserializedPropertyValueTypeEnumValue.value = PropertyValueType.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedPropertyValueTypeEnumValue; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ProposedMultiRegionAccessPointPolicy.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ProposedMultiRegionAccessPointPolicy.java new file mode 100644 index 000000000000..668e42050391 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ProposedMultiRegionAccessPointPolicy.java @@ -0,0 +1,95 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of ProposedMultiRegionAccessPointPolicy. + */ +@Fluent +public final class ProposedMultiRegionAccessPointPolicy + implements JsonSerializable { + /* + *

The details of the proposed policy.

+ */ + private String policy; + + /** + * Creates an instance of ProposedMultiRegionAccessPointPolicy class. + */ + public ProposedMultiRegionAccessPointPolicy() { + } + + /** + * Get the policy property: <p>The details of the proposed policy.</p>. + * + * @return the policy value. + */ + public String policy() { + return this.policy; + } + + /** + * Set the policy property: <p>The details of the proposed policy.</p>. + * + * @param policy the policy value to set. + * @return the ProposedMultiRegionAccessPointPolicy object itself. + */ + public ProposedMultiRegionAccessPointPolicy withPolicy(String policy) { + this.policy = policy; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("policy", this.policy); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ProposedMultiRegionAccessPointPolicy from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ProposedMultiRegionAccessPointPolicy if the JsonReader was pointing to an instance of it, + * or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ProposedMultiRegionAccessPointPolicy. + */ + public static ProposedMultiRegionAccessPointPolicy fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ProposedMultiRegionAccessPointPolicy deserializedProposedMultiRegionAccessPointPolicy + = new ProposedMultiRegionAccessPointPolicy(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("policy".equals(fieldName)) { + deserializedProposedMultiRegionAccessPointPolicy.policy = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedProposedMultiRegionAccessPointPolicy; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/Provider.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/Provider.java new file mode 100644 index 000000000000..a7444a1bdc41 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/Provider.java @@ -0,0 +1,112 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of Provider. + */ +@Fluent +public final class Provider implements JsonSerializable { + /* + *

Amazon Resource Name (ARN) or alias of the KMS key. The KMS key must be symmetric and created in the same + * Amazon Web Services Region as the cluster. If the KMS key was created in a different account, the IAM principal must + * have access to the KMS key. For more information, see Allowing + * users in other accounts to use a KMS key in the Key Management Service Developer Guide.

+ */ + private String keyArn; + + /** + * Creates an instance of Provider class. + */ + public Provider() { + } + + /** + * Get the keyArn property: <p>Amazon Resource Name (ARN) or alias of the KMS key. The KMS key must be + * symmetric and created in the same Amazon Web Services Region as the cluster. If the KMS key was created in a + * different account, the <a + * href='https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_terms-and-concepts.html'>IAM + * principal</a> must have access to the KMS key. For more information, see <a + * href='https://docs.aws.amazon.com/kms/latest/developerguide/key-policy-modifying-external-accounts.html'>Allowing + * users in other accounts to use a KMS key</a> in the <i>Key Management Service Developer + * Guide</i>.</p>. + * + * @return the keyArn value. + */ + public String keyArn() { + return this.keyArn; + } + + /** + * Set the keyArn property: <p>Amazon Resource Name (ARN) or alias of the KMS key. The KMS key must be + * symmetric and created in the same Amazon Web Services Region as the cluster. If the KMS key was created in a + * different account, the <a + * href='https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_terms-and-concepts.html'>IAM + * principal</a> must have access to the KMS key. For more information, see <a + * href='https://docs.aws.amazon.com/kms/latest/developerguide/key-policy-modifying-external-accounts.html'>Allowing + * users in other accounts to use a KMS key</a> in the <i>Key Management Service Developer + * Guide</i>.</p>. + * + * @param keyArn the keyArn value to set. + * @return the Provider object itself. + */ + public Provider withKeyArn(String keyArn) { + this.keyArn = keyArn; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("keyArn", this.keyArn); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of Provider from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of Provider if the JsonReader was pointing to an instance of it, or null if it was pointing + * to JSON null. + * @throws IOException If an error occurs while reading the Provider. + */ + public static Provider fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + Provider deserializedProvider = new Provider(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("keyArn".equals(fieldName)) { + deserializedProvider.keyArn = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedProvider; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ProvisionedThroughput.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ProvisionedThroughput.java new file mode 100644 index 000000000000..2f8d7bc762e2 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ProvisionedThroughput.java @@ -0,0 +1,139 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of ProvisionedThroughput. + */ +@Fluent +public final class ProvisionedThroughput implements JsonSerializable { + /* + * The maximum number of strongly consistent reads consumed per second before DynamoDB returns a + * ``ThrottlingException``. For more information, see [Specifying Read and Write + * Requirements](https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/ProvisionedThroughput.html) in the + * *Amazon DynamoDB Developer Guide*. If read/write capacity mode is ``PAY_PER_REQUEST`` the value is set to 0. + */ + private Integer readCapacityUnits; + + /* + * The maximum number of writes consumed per second before DynamoDB returns a ``ThrottlingException``. For more + * information, see [Specifying Read and Write + * Requirements](https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/ProvisionedThroughput.html) in the + * *Amazon DynamoDB Developer Guide*. If read/write capacity mode is ``PAY_PER_REQUEST`` the value is set to 0. + */ + private Integer writeCapacityUnits; + + /** + * Creates an instance of ProvisionedThroughput class. + */ + public ProvisionedThroughput() { + } + + /** + * Get the readCapacityUnits property: The maximum number of strongly consistent reads consumed per second before + * DynamoDB returns a ``ThrottlingException``. For more information, see [Specifying Read and Write + * Requirements](https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/ProvisionedThroughput.html) in the + * *Amazon DynamoDB Developer Guide*. If read/write capacity mode is ``PAY_PER_REQUEST`` the value is set to 0. + * + * @return the readCapacityUnits value. + */ + public Integer readCapacityUnits() { + return this.readCapacityUnits; + } + + /** + * Set the readCapacityUnits property: The maximum number of strongly consistent reads consumed per second before + * DynamoDB returns a ``ThrottlingException``. For more information, see [Specifying Read and Write + * Requirements](https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/ProvisionedThroughput.html) in the + * *Amazon DynamoDB Developer Guide*. If read/write capacity mode is ``PAY_PER_REQUEST`` the value is set to 0. + * + * @param readCapacityUnits the readCapacityUnits value to set. + * @return the ProvisionedThroughput object itself. + */ + public ProvisionedThroughput withReadCapacityUnits(Integer readCapacityUnits) { + this.readCapacityUnits = readCapacityUnits; + return this; + } + + /** + * Get the writeCapacityUnits property: The maximum number of writes consumed per second before DynamoDB returns a + * ``ThrottlingException``. For more information, see [Specifying Read and Write + * Requirements](https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/ProvisionedThroughput.html) in the + * *Amazon DynamoDB Developer Guide*. If read/write capacity mode is ``PAY_PER_REQUEST`` the value is set to 0. + * + * @return the writeCapacityUnits value. + */ + public Integer writeCapacityUnits() { + return this.writeCapacityUnits; + } + + /** + * Set the writeCapacityUnits property: The maximum number of writes consumed per second before DynamoDB returns a + * ``ThrottlingException``. For more information, see [Specifying Read and Write + * Requirements](https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/ProvisionedThroughput.html) in the + * *Amazon DynamoDB Developer Guide*. If read/write capacity mode is ``PAY_PER_REQUEST`` the value is set to 0. + * + * @param writeCapacityUnits the writeCapacityUnits value to set. + * @return the ProvisionedThroughput object itself. + */ + public ProvisionedThroughput withWriteCapacityUnits(Integer writeCapacityUnits) { + this.writeCapacityUnits = writeCapacityUnits; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeNumberField("readCapacityUnits", this.readCapacityUnits); + jsonWriter.writeNumberField("writeCapacityUnits", this.writeCapacityUnits); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ProvisionedThroughput from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ProvisionedThroughput if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the ProvisionedThroughput. + */ + public static ProvisionedThroughput fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ProvisionedThroughput deserializedProvisionedThroughput = new ProvisionedThroughput(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("readCapacityUnits".equals(fieldName)) { + deserializedProvisionedThroughput.readCapacityUnits = reader.getNullable(JsonReader::getInt); + } else if ("writeCapacityUnits".equals(fieldName)) { + deserializedProvisionedThroughput.writeCapacityUnits = reader.getNullable(JsonReader::getInt); + } else { + reader.skipChildren(); + } + } + + return deserializedProvisionedThroughput; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ProvisioningState.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ProvisioningState.java new file mode 100644 index 000000000000..a0a6047759e1 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ProvisioningState.java @@ -0,0 +1,76 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * The provisioning state of a resource. + */ +public final class ProvisioningState extends ExpandableStringEnum { + /** + * Static value Succeeded for ProvisioningState. + */ + public static final ProvisioningState SUCCEEDED = fromString("Succeeded"); + + /** + * Static value Failed for ProvisioningState. + */ + public static final ProvisioningState FAILED = fromString("Failed"); + + /** + * Static value Canceled for ProvisioningState. + */ + public static final ProvisioningState CANCELED = fromString("Canceled"); + + /** + * Static value Provisioning for ProvisioningState. + */ + public static final ProvisioningState PROVISIONING = fromString("Provisioning"); + + /** + * Static value Updating for ProvisioningState. + */ + public static final ProvisioningState UPDATING = fromString("Updating"); + + /** + * Static value Deleting for ProvisioningState. + */ + public static final ProvisioningState DELETING = fromString("Deleting"); + + /** + * Static value Accepted for ProvisioningState. + */ + public static final ProvisioningState ACCEPTED = fromString("Accepted"); + + /** + * Creates a new instance of ProvisioningState value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ProvisioningState() { + } + + /** + * Creates or finds a ProvisioningState from its string representation. + * + * @param name a name to look for. + * @return the corresponding ProvisioningState. + */ + public static ProvisioningState fromString(String name) { + return fromString(name, ProvisioningState.class); + } + + /** + * Gets known ProvisioningState values. + * + * @return known ProvisioningState values. + */ + public static Collection values() { + return values(ProvisioningState.class); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ProxyConfiguration.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ProxyConfiguration.java new file mode 100644 index 000000000000..0db9a2d8fa79 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ProxyConfiguration.java @@ -0,0 +1,192 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Definition of ProxyConfiguration. + */ +@Fluent +public final class ProxyConfiguration implements JsonSerializable { + /* + * The name of the container that will serve as the App Mesh proxy. + */ + private String containerName; + + /* + * The set of network configuration parameters to provide the Container Network Interface (CNI) plugin, specified as + * key-value pairs. + ``IgnoredUID`` - (Required) The user ID (UID) of the proxy container as defined by the + * ``user`` parameter in a container definition. This is used to ensure the proxy ignores its own traffic. If + * ``IgnoredGID`` is specified, this field can be empty. + ``IgnoredGID`` - (Required) The group ID (GID) of the + * proxy container as defined by the ``user`` parameter in a container definition. This is used to ensure the proxy + * ignores its own traffic. If ``IgnoredUID`` is specified, this field can be empty. + ``AppPorts`` - (Required) The + * list of ports that the application uses. Network traffic to these ports is forwarded to the ``ProxyIngressPort`` + * and ``ProxyEgressPort``. + ``ProxyIngressPort`` - (Required) Specifies the port that incoming traffic to the + * ``AppPorts`` is directed to. + ``ProxyEgressPort`` - (Required) Specifies the port that outgoing traffic from the + * ``AppPorts`` is directed to. + ``EgressIgnoredPorts`` - (Required) The egress traffic going to the specified + * ports is ignored and not redirected to the ``ProxyEgressPort``. It can be an empty list. + ``EgressIgnoredIPs`` - + * (Required) The egress traffic going to the specified IP addresses is ignored and not redirected to the + * ``ProxyEgressPort``. It can be an empty list. + */ + private List proxyConfigurationProperties; + + /* + * The proxy type. The only supported value is ``APPMESH``. + */ + private String type; + + /** + * Creates an instance of ProxyConfiguration class. + */ + public ProxyConfiguration() { + } + + /** + * Get the containerName property: The name of the container that will serve as the App Mesh proxy. + * + * @return the containerName value. + */ + public String containerName() { + return this.containerName; + } + + /** + * Set the containerName property: The name of the container that will serve as the App Mesh proxy. + * + * @param containerName the containerName value to set. + * @return the ProxyConfiguration object itself. + */ + public ProxyConfiguration withContainerName(String containerName) { + this.containerName = containerName; + return this; + } + + /** + * Get the proxyConfigurationProperties property: The set of network configuration parameters to provide the + * Container Network Interface (CNI) plugin, specified as key-value pairs. + ``IgnoredUID`` - (Required) The user ID + * (UID) of the proxy container as defined by the ``user`` parameter in a container definition. This is used to + * ensure the proxy ignores its own traffic. If ``IgnoredGID`` is specified, this field can be empty. + + * ``IgnoredGID`` - (Required) The group ID (GID) of the proxy container as defined by the ``user`` parameter in a + * container definition. This is used to ensure the proxy ignores its own traffic. If ``IgnoredUID`` is specified, + * this field can be empty. + ``AppPorts`` - (Required) The list of ports that the application uses. Network traffic + * to these ports is forwarded to the ``ProxyIngressPort`` and ``ProxyEgressPort``. + ``ProxyIngressPort`` - + * (Required) Specifies the port that incoming traffic to the ``AppPorts`` is directed to. + ``ProxyEgressPort`` - + * (Required) Specifies the port that outgoing traffic from the ``AppPorts`` is directed to. + + * ``EgressIgnoredPorts`` - (Required) The egress traffic going to the specified ports is ignored and not redirected + * to the ``ProxyEgressPort``. It can be an empty list. + ``EgressIgnoredIPs`` - (Required) The egress traffic going + * to the specified IP addresses is ignored and not redirected to the ``ProxyEgressPort``. It can be an empty list. + * + * @return the proxyConfigurationProperties value. + */ + public List proxyConfigurationProperties() { + return this.proxyConfigurationProperties; + } + + /** + * Set the proxyConfigurationProperties property: The set of network configuration parameters to provide the + * Container Network Interface (CNI) plugin, specified as key-value pairs. + ``IgnoredUID`` - (Required) The user ID + * (UID) of the proxy container as defined by the ``user`` parameter in a container definition. This is used to + * ensure the proxy ignores its own traffic. If ``IgnoredGID`` is specified, this field can be empty. + + * ``IgnoredGID`` - (Required) The group ID (GID) of the proxy container as defined by the ``user`` parameter in a + * container definition. This is used to ensure the proxy ignores its own traffic. If ``IgnoredUID`` is specified, + * this field can be empty. + ``AppPorts`` - (Required) The list of ports that the application uses. Network traffic + * to these ports is forwarded to the ``ProxyIngressPort`` and ``ProxyEgressPort``. + ``ProxyIngressPort`` - + * (Required) Specifies the port that incoming traffic to the ``AppPorts`` is directed to. + ``ProxyEgressPort`` - + * (Required) Specifies the port that outgoing traffic from the ``AppPorts`` is directed to. + + * ``EgressIgnoredPorts`` - (Required) The egress traffic going to the specified ports is ignored and not redirected + * to the ``ProxyEgressPort``. It can be an empty list. + ``EgressIgnoredIPs`` - (Required) The egress traffic going + * to the specified IP addresses is ignored and not redirected to the ``ProxyEgressPort``. It can be an empty list. + * + * @param proxyConfigurationProperties the proxyConfigurationProperties value to set. + * @return the ProxyConfiguration object itself. + */ + public ProxyConfiguration withProxyConfigurationProperties(List proxyConfigurationProperties) { + this.proxyConfigurationProperties = proxyConfigurationProperties; + return this; + } + + /** + * Get the type property: The proxy type. The only supported value is ``APPMESH``. + * + * @return the type value. + */ + public String type() { + return this.type; + } + + /** + * Set the type property: The proxy type. The only supported value is ``APPMESH``. + * + * @param type the type value to set. + * @return the ProxyConfiguration object itself. + */ + public ProxyConfiguration withType(String type) { + this.type = type; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (proxyConfigurationProperties() != null) { + proxyConfigurationProperties().forEach(e -> e.validate()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("containerName", this.containerName); + jsonWriter.writeArrayField("proxyConfigurationProperties", this.proxyConfigurationProperties, + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("type", this.type); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ProxyConfiguration from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ProxyConfiguration if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the ProxyConfiguration. + */ + public static ProxyConfiguration fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ProxyConfiguration deserializedProxyConfiguration = new ProxyConfiguration(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("containerName".equals(fieldName)) { + deserializedProxyConfiguration.containerName = reader.getString(); + } else if ("proxyConfigurationProperties".equals(fieldName)) { + List proxyConfigurationProperties + = reader.readArray(reader1 -> KeyValuePair.fromJson(reader1)); + deserializedProxyConfiguration.proxyConfigurationProperties = proxyConfigurationProperties; + } else if ("type".equals(fieldName)) { + deserializedProxyConfiguration.type = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedProxyConfiguration; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/PublicAccessBlockConfiguration.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/PublicAccessBlockConfiguration.java new file mode 100644 index 000000000000..6078dde91922 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/PublicAccessBlockConfiguration.java @@ -0,0 +1,220 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of PublicAccessBlockConfiguration. + */ +@Fluent +public final class PublicAccessBlockConfiguration implements JsonSerializable { + /* + * Specifies whether Amazon S3 should block public access control lists (ACLs) for buckets in this account. Setting + * this element to TRUE causes the following behavior:- PUT Bucket acl and PUT Object acl calls fail if the + * specified ACL is public. - PUT Object calls fail if the request includes a public ACL.. - PUT Bucket calls fail + * if the request includes a public ACL.Enabling this setting doesn't affect existing policies or ACLs. + */ + private Boolean blockPublicAcls; + + /* + * Specifies whether Amazon S3 should block public bucket policies for buckets in this account. Setting this element + * to TRUE causes Amazon S3 to reject calls to PUT Bucket policy if the specified bucket policy allows public + * access. Enabling this setting doesn't affect existing bucket policies. + */ + private Boolean blockPublicPolicy; + + /* + * Specifies whether Amazon S3 should ignore public ACLs for buckets in this account. Setting this element to TRUE + * causes Amazon S3 to ignore all public ACLs on buckets in this account and any objects that they contain. Enabling + * this setting doesn't affect the persistence of any existing ACLs and doesn't prevent new public ACLs from being + * set. + */ + private Boolean ignorePublicAcls; + + /* + * Specifies whether Amazon S3 should restrict public bucket policies for this bucket. Setting this element to TRUE + * restricts access to this bucket to only AWS services and authorized users within this account if the bucket has a + * public policy.Enabling this setting doesn't affect previously stored bucket policies, except that public and + * cross-account access within any public bucket policy, including non-public delegation to specific accounts, is + * blocked. + */ + private Boolean restrictPublicBuckets; + + /** + * Creates an instance of PublicAccessBlockConfiguration class. + */ + public PublicAccessBlockConfiguration() { + } + + /** + * Get the blockPublicAcls property: Specifies whether Amazon S3 should block public access control lists (ACLs) for + * buckets in this account. Setting this element to TRUE causes the following behavior:- PUT Bucket acl and PUT + * Object acl calls fail if the specified ACL is public. - PUT Object calls fail if the request includes a public + * ACL.. - PUT Bucket calls fail if the request includes a public ACL.Enabling this setting doesn't affect existing + * policies or ACLs. + * + * @return the blockPublicAcls value. + */ + public Boolean blockPublicAcls() { + return this.blockPublicAcls; + } + + /** + * Set the blockPublicAcls property: Specifies whether Amazon S3 should block public access control lists (ACLs) for + * buckets in this account. Setting this element to TRUE causes the following behavior:- PUT Bucket acl and PUT + * Object acl calls fail if the specified ACL is public. - PUT Object calls fail if the request includes a public + * ACL.. - PUT Bucket calls fail if the request includes a public ACL.Enabling this setting doesn't affect existing + * policies or ACLs. + * + * @param blockPublicAcls the blockPublicAcls value to set. + * @return the PublicAccessBlockConfiguration object itself. + */ + public PublicAccessBlockConfiguration withBlockPublicAcls(Boolean blockPublicAcls) { + this.blockPublicAcls = blockPublicAcls; + return this; + } + + /** + * Get the blockPublicPolicy property: Specifies whether Amazon S3 should block public bucket policies for buckets + * in this account. Setting this element to TRUE causes Amazon S3 to reject calls to PUT Bucket policy if the + * specified bucket policy allows public access. Enabling this setting doesn't affect existing bucket policies. + * + * @return the blockPublicPolicy value. + */ + public Boolean blockPublicPolicy() { + return this.blockPublicPolicy; + } + + /** + * Set the blockPublicPolicy property: Specifies whether Amazon S3 should block public bucket policies for buckets + * in this account. Setting this element to TRUE causes Amazon S3 to reject calls to PUT Bucket policy if the + * specified bucket policy allows public access. Enabling this setting doesn't affect existing bucket policies. + * + * @param blockPublicPolicy the blockPublicPolicy value to set. + * @return the PublicAccessBlockConfiguration object itself. + */ + public PublicAccessBlockConfiguration withBlockPublicPolicy(Boolean blockPublicPolicy) { + this.blockPublicPolicy = blockPublicPolicy; + return this; + } + + /** + * Get the ignorePublicAcls property: Specifies whether Amazon S3 should ignore public ACLs for buckets in this + * account. Setting this element to TRUE causes Amazon S3 to ignore all public ACLs on buckets in this account and + * any objects that they contain. Enabling this setting doesn't affect the persistence of any existing ACLs and + * doesn't prevent new public ACLs from being set. + * + * @return the ignorePublicAcls value. + */ + public Boolean ignorePublicAcls() { + return this.ignorePublicAcls; + } + + /** + * Set the ignorePublicAcls property: Specifies whether Amazon S3 should ignore public ACLs for buckets in this + * account. Setting this element to TRUE causes Amazon S3 to ignore all public ACLs on buckets in this account and + * any objects that they contain. Enabling this setting doesn't affect the persistence of any existing ACLs and + * doesn't prevent new public ACLs from being set. + * + * @param ignorePublicAcls the ignorePublicAcls value to set. + * @return the PublicAccessBlockConfiguration object itself. + */ + public PublicAccessBlockConfiguration withIgnorePublicAcls(Boolean ignorePublicAcls) { + this.ignorePublicAcls = ignorePublicAcls; + return this; + } + + /** + * Get the restrictPublicBuckets property: Specifies whether Amazon S3 should restrict public bucket policies for + * this bucket. Setting this element to TRUE restricts access to this bucket to only AWS services and authorized + * users within this account if the bucket has a public policy.Enabling this setting doesn't affect previously + * stored bucket policies, except that public and cross-account access within any public bucket policy, including + * non-public delegation to specific accounts, is blocked. + * + * @return the restrictPublicBuckets value. + */ + public Boolean restrictPublicBuckets() { + return this.restrictPublicBuckets; + } + + /** + * Set the restrictPublicBuckets property: Specifies whether Amazon S3 should restrict public bucket policies for + * this bucket. Setting this element to TRUE restricts access to this bucket to only AWS services and authorized + * users within this account if the bucket has a public policy.Enabling this setting doesn't affect previously + * stored bucket policies, except that public and cross-account access within any public bucket policy, including + * non-public delegation to specific accounts, is blocked. + * + * @param restrictPublicBuckets the restrictPublicBuckets value to set. + * @return the PublicAccessBlockConfiguration object itself. + */ + public PublicAccessBlockConfiguration withRestrictPublicBuckets(Boolean restrictPublicBuckets) { + this.restrictPublicBuckets = restrictPublicBuckets; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeBooleanField("blockPublicAcls", this.blockPublicAcls); + jsonWriter.writeBooleanField("blockPublicPolicy", this.blockPublicPolicy); + jsonWriter.writeBooleanField("ignorePublicAcls", this.ignorePublicAcls); + jsonWriter.writeBooleanField("restrictPublicBuckets", this.restrictPublicBuckets); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of PublicAccessBlockConfiguration from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of PublicAccessBlockConfiguration if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the PublicAccessBlockConfiguration. + */ + public static PublicAccessBlockConfiguration fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + PublicAccessBlockConfiguration deserializedPublicAccessBlockConfiguration + = new PublicAccessBlockConfiguration(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("blockPublicAcls".equals(fieldName)) { + deserializedPublicAccessBlockConfiguration.blockPublicAcls + = reader.getNullable(JsonReader::getBoolean); + } else if ("blockPublicPolicy".equals(fieldName)) { + deserializedPublicAccessBlockConfiguration.blockPublicPolicy + = reader.getNullable(JsonReader::getBoolean); + } else if ("ignorePublicAcls".equals(fieldName)) { + deserializedPublicAccessBlockConfiguration.ignorePublicAcls + = reader.getNullable(JsonReader::getBoolean); + } else if ("restrictPublicBuckets".equals(fieldName)) { + deserializedPublicAccessBlockConfiguration.restrictPublicBuckets + = reader.getNullable(JsonReader::getBoolean); + } else { + reader.skipChildren(); + } + } + + return deserializedPublicAccessBlockConfiguration; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/PublicAccessBlockConfigurationAutoGenerated.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/PublicAccessBlockConfigurationAutoGenerated.java new file mode 100644 index 000000000000..50710d060006 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/PublicAccessBlockConfigurationAutoGenerated.java @@ -0,0 +1,221 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of PublicAccessBlockConfiguration. + */ +@Fluent +public final class PublicAccessBlockConfigurationAutoGenerated + implements JsonSerializable { + /* + * Specifies whether Amazon S3 should block public access control lists (ACLs) for this bucket and objects in this + * bucket. Setting this element to ``TRUE`` causes the following behavior: + PUT Bucket ACL and PUT Object ACL calls + * fail if the specified ACL is public. + PUT Object calls fail if the request includes a public ACL. + PUT Bucket + * calls fail if the request includes a public ACL. Enabling this setting doesn't affect existing policies or ACLs. + */ + private Boolean blockPublicAcls; + + /* + * Specifies whether Amazon S3 should block public bucket policies for this bucket. Setting this element to ``TRUE`` + * causes Amazon S3 to reject calls to PUT Bucket policy if the specified bucket policy allows public access. + * Enabling this setting doesn't affect existing bucket policies. + */ + private Boolean blockPublicPolicy; + + /* + * Specifies whether Amazon S3 should ignore public ACLs for this bucket and objects in this bucket. Setting this + * element to ``TRUE`` causes Amazon S3 to ignore all public ACLs on this bucket and objects in this bucket. + * Enabling this setting doesn't affect the persistence of any existing ACLs and doesn't prevent new public ACLs + * from being set. + */ + private Boolean ignorePublicAcls; + + /* + * Specifies whether Amazon S3 should restrict public bucket policies for this bucket. Setting this element to + * ``TRUE`` restricts access to this bucket to only AWS-service principals and authorized users within this account + * if the bucket has a public policy. Enabling this setting doesn't affect previously stored bucket policies, except + * that public and cross-account access within any public bucket policy, including non-public delegation to specific + * accounts, is blocked. + */ + private Boolean restrictPublicBuckets; + + /** + * Creates an instance of PublicAccessBlockConfigurationAutoGenerated class. + */ + public PublicAccessBlockConfigurationAutoGenerated() { + } + + /** + * Get the blockPublicAcls property: Specifies whether Amazon S3 should block public access control lists (ACLs) for + * this bucket and objects in this bucket. Setting this element to ``TRUE`` causes the following behavior: + PUT + * Bucket ACL and PUT Object ACL calls fail if the specified ACL is public. + PUT Object calls fail if the request + * includes a public ACL. + PUT Bucket calls fail if the request includes a public ACL. Enabling this setting + * doesn't affect existing policies or ACLs. + * + * @return the blockPublicAcls value. + */ + public Boolean blockPublicAcls() { + return this.blockPublicAcls; + } + + /** + * Set the blockPublicAcls property: Specifies whether Amazon S3 should block public access control lists (ACLs) for + * this bucket and objects in this bucket. Setting this element to ``TRUE`` causes the following behavior: + PUT + * Bucket ACL and PUT Object ACL calls fail if the specified ACL is public. + PUT Object calls fail if the request + * includes a public ACL. + PUT Bucket calls fail if the request includes a public ACL. Enabling this setting + * doesn't affect existing policies or ACLs. + * + * @param blockPublicAcls the blockPublicAcls value to set. + * @return the PublicAccessBlockConfigurationAutoGenerated object itself. + */ + public PublicAccessBlockConfigurationAutoGenerated withBlockPublicAcls(Boolean blockPublicAcls) { + this.blockPublicAcls = blockPublicAcls; + return this; + } + + /** + * Get the blockPublicPolicy property: Specifies whether Amazon S3 should block public bucket policies for this + * bucket. Setting this element to ``TRUE`` causes Amazon S3 to reject calls to PUT Bucket policy if the specified + * bucket policy allows public access. Enabling this setting doesn't affect existing bucket policies. + * + * @return the blockPublicPolicy value. + */ + public Boolean blockPublicPolicy() { + return this.blockPublicPolicy; + } + + /** + * Set the blockPublicPolicy property: Specifies whether Amazon S3 should block public bucket policies for this + * bucket. Setting this element to ``TRUE`` causes Amazon S3 to reject calls to PUT Bucket policy if the specified + * bucket policy allows public access. Enabling this setting doesn't affect existing bucket policies. + * + * @param blockPublicPolicy the blockPublicPolicy value to set. + * @return the PublicAccessBlockConfigurationAutoGenerated object itself. + */ + public PublicAccessBlockConfigurationAutoGenerated withBlockPublicPolicy(Boolean blockPublicPolicy) { + this.blockPublicPolicy = blockPublicPolicy; + return this; + } + + /** + * Get the ignorePublicAcls property: Specifies whether Amazon S3 should ignore public ACLs for this bucket and + * objects in this bucket. Setting this element to ``TRUE`` causes Amazon S3 to ignore all public ACLs on this + * bucket and objects in this bucket. Enabling this setting doesn't affect the persistence of any existing ACLs and + * doesn't prevent new public ACLs from being set. + * + * @return the ignorePublicAcls value. + */ + public Boolean ignorePublicAcls() { + return this.ignorePublicAcls; + } + + /** + * Set the ignorePublicAcls property: Specifies whether Amazon S3 should ignore public ACLs for this bucket and + * objects in this bucket. Setting this element to ``TRUE`` causes Amazon S3 to ignore all public ACLs on this + * bucket and objects in this bucket. Enabling this setting doesn't affect the persistence of any existing ACLs and + * doesn't prevent new public ACLs from being set. + * + * @param ignorePublicAcls the ignorePublicAcls value to set. + * @return the PublicAccessBlockConfigurationAutoGenerated object itself. + */ + public PublicAccessBlockConfigurationAutoGenerated withIgnorePublicAcls(Boolean ignorePublicAcls) { + this.ignorePublicAcls = ignorePublicAcls; + return this; + } + + /** + * Get the restrictPublicBuckets property: Specifies whether Amazon S3 should restrict public bucket policies for + * this bucket. Setting this element to ``TRUE`` restricts access to this bucket to only AWS-service principals and + * authorized users within this account if the bucket has a public policy. Enabling this setting doesn't affect + * previously stored bucket policies, except that public and cross-account access within any public bucket policy, + * including non-public delegation to specific accounts, is blocked. + * + * @return the restrictPublicBuckets value. + */ + public Boolean restrictPublicBuckets() { + return this.restrictPublicBuckets; + } + + /** + * Set the restrictPublicBuckets property: Specifies whether Amazon S3 should restrict public bucket policies for + * this bucket. Setting this element to ``TRUE`` restricts access to this bucket to only AWS-service principals and + * authorized users within this account if the bucket has a public policy. Enabling this setting doesn't affect + * previously stored bucket policies, except that public and cross-account access within any public bucket policy, + * including non-public delegation to specific accounts, is blocked. + * + * @param restrictPublicBuckets the restrictPublicBuckets value to set. + * @return the PublicAccessBlockConfigurationAutoGenerated object itself. + */ + public PublicAccessBlockConfigurationAutoGenerated withRestrictPublicBuckets(Boolean restrictPublicBuckets) { + this.restrictPublicBuckets = restrictPublicBuckets; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeBooleanField("blockPublicAcls", this.blockPublicAcls); + jsonWriter.writeBooleanField("blockPublicPolicy", this.blockPublicPolicy); + jsonWriter.writeBooleanField("ignorePublicAcls", this.ignorePublicAcls); + jsonWriter.writeBooleanField("restrictPublicBuckets", this.restrictPublicBuckets); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of PublicAccessBlockConfigurationAutoGenerated from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of PublicAccessBlockConfigurationAutoGenerated if the JsonReader was pointing to an instance + * of it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the PublicAccessBlockConfigurationAutoGenerated. + */ + public static PublicAccessBlockConfigurationAutoGenerated fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + PublicAccessBlockConfigurationAutoGenerated deserializedPublicAccessBlockConfigurationAutoGenerated + = new PublicAccessBlockConfigurationAutoGenerated(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("blockPublicAcls".equals(fieldName)) { + deserializedPublicAccessBlockConfigurationAutoGenerated.blockPublicAcls + = reader.getNullable(JsonReader::getBoolean); + } else if ("blockPublicPolicy".equals(fieldName)) { + deserializedPublicAccessBlockConfigurationAutoGenerated.blockPublicPolicy + = reader.getNullable(JsonReader::getBoolean); + } else if ("ignorePublicAcls".equals(fieldName)) { + deserializedPublicAccessBlockConfigurationAutoGenerated.ignorePublicAcls + = reader.getNullable(JsonReader::getBoolean); + } else if ("restrictPublicBuckets".equals(fieldName)) { + deserializedPublicAccessBlockConfigurationAutoGenerated.restrictPublicBuckets + = reader.getNullable(JsonReader::getBoolean); + } else { + reader.skipChildren(); + } + } + + return deserializedPublicAccessBlockConfigurationAutoGenerated; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/PublishMetricAction.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/PublishMetricAction.java new file mode 100644 index 000000000000..95c5ca6a5f52 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/PublishMetricAction.java @@ -0,0 +1,99 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Definition of PublishMetricAction. + */ +@Fluent +public final class PublishMetricAction implements JsonSerializable { + /* + * Property dimensions + */ + private List dimensions; + + /** + * Creates an instance of PublishMetricAction class. + */ + public PublishMetricAction() { + } + + /** + * Get the dimensions property: Property dimensions. + * + * @return the dimensions value. + */ + public List dimensions() { + return this.dimensions; + } + + /** + * Set the dimensions property: Property dimensions. + * + * @param dimensions the dimensions value to set. + * @return the PublishMetricAction object itself. + */ + public PublishMetricAction withDimensions(List dimensions) { + this.dimensions = dimensions; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (dimensions() != null) { + dimensions().forEach(e -> e.validate()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("dimensions", this.dimensions, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of PublishMetricAction from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of PublishMetricAction if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the PublishMetricAction. + */ + public static PublishMetricAction fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + PublishMetricAction deserializedPublishMetricAction = new PublishMetricAction(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("dimensions".equals(fieldName)) { + List dimensions + = reader.readArray(reader1 -> DimensionAutoGenerated2.fromJson(reader1)); + deserializedPublishMetricAction.dimensions = dimensions; + } else { + reader.skipChildren(); + } + } + + return deserializedPublishMetricAction; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/PublishMetricActionAutoGenerated.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/PublishMetricActionAutoGenerated.java new file mode 100644 index 000000000000..2823fa487f94 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/PublishMetricActionAutoGenerated.java @@ -0,0 +1,100 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Definition of PublishMetricAction. + */ +@Fluent +public final class PublishMetricActionAutoGenerated implements JsonSerializable { + /* + * Property dimensions + */ + private List dimensions; + + /** + * Creates an instance of PublishMetricActionAutoGenerated class. + */ + public PublishMetricActionAutoGenerated() { + } + + /** + * Get the dimensions property: Property dimensions. + * + * @return the dimensions value. + */ + public List dimensions() { + return this.dimensions; + } + + /** + * Set the dimensions property: Property dimensions. + * + * @param dimensions the dimensions value to set. + * @return the PublishMetricActionAutoGenerated object itself. + */ + public PublishMetricActionAutoGenerated withDimensions(List dimensions) { + this.dimensions = dimensions; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (dimensions() != null) { + dimensions().forEach(e -> e.validate()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("dimensions", this.dimensions, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of PublishMetricActionAutoGenerated from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of PublishMetricActionAutoGenerated if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the PublishMetricActionAutoGenerated. + */ + public static PublishMetricActionAutoGenerated fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + PublishMetricActionAutoGenerated deserializedPublishMetricActionAutoGenerated + = new PublishMetricActionAutoGenerated(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("dimensions".equals(fieldName)) { + List dimensions + = reader.readArray(reader1 -> DimensionAutoGenerated3.fromJson(reader1)); + deserializedPublishMetricActionAutoGenerated.dimensions = dimensions; + } else { + reader.skipChildren(); + } + } + + return deserializedPublishMetricActionAutoGenerated; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/QueryLoggingConfig.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/QueryLoggingConfig.java new file mode 100644 index 000000000000..2c7981a54c2b --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/QueryLoggingConfig.java @@ -0,0 +1,95 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of QueryLoggingConfig. + */ +@Fluent +public final class QueryLoggingConfig implements JsonSerializable { + /* + * The Amazon Resource Name (ARN) of the CloudWatch Logs log group that Amazon Route 53 is publishing logs to. + */ + private String cloudWatchLogsLogGroupArn; + + /** + * Creates an instance of QueryLoggingConfig class. + */ + public QueryLoggingConfig() { + } + + /** + * Get the cloudWatchLogsLogGroupArn property: The Amazon Resource Name (ARN) of the CloudWatch Logs log group that + * Amazon Route 53 is publishing logs to. + * + * @return the cloudWatchLogsLogGroupArn value. + */ + public String cloudWatchLogsLogGroupArn() { + return this.cloudWatchLogsLogGroupArn; + } + + /** + * Set the cloudWatchLogsLogGroupArn property: The Amazon Resource Name (ARN) of the CloudWatch Logs log group that + * Amazon Route 53 is publishing logs to. + * + * @param cloudWatchLogsLogGroupArn the cloudWatchLogsLogGroupArn value to set. + * @return the QueryLoggingConfig object itself. + */ + public QueryLoggingConfig withCloudWatchLogsLogGroupArn(String cloudWatchLogsLogGroupArn) { + this.cloudWatchLogsLogGroupArn = cloudWatchLogsLogGroupArn; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("cloudWatchLogsLogGroupArn", this.cloudWatchLogsLogGroupArn); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of QueryLoggingConfig from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of QueryLoggingConfig if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the QueryLoggingConfig. + */ + public static QueryLoggingConfig fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + QueryLoggingConfig deserializedQueryLoggingConfig = new QueryLoggingConfig(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("cloudWatchLogsLogGroupArn".equals(fieldName)) { + deserializedQueryLoggingConfig.cloudWatchLogsLogGroupArn = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedQueryLoggingConfig; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/QueueConfiguration.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/QueueConfiguration.java new file mode 100644 index 000000000000..0ed59ba8a833 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/QueueConfiguration.java @@ -0,0 +1,185 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of QueueConfiguration. + */ +@Fluent +public final class QueueConfiguration implements JsonSerializable { + /* + * The Amazon S3 bucket event about which you want to publish messages to Amazon SQS. For more information, see + * [Supported Event Types](https://docs.aws.amazon.com/AmazonS3/latest/dev/NotificationHowTo.html) in the *Amazon S3 + * User Guide*. + */ + private String event; + + /* + * The filtering rules that determine which objects trigger notifications. For example, you can create a filter so + * that Amazon S3 sends notifications only when image files with a ``.jpg`` extension are added to the bucket. For + * more information, see [Configuring event notifications using object key name + * filtering](https://docs.aws.amazon.com/AmazonS3/latest/user-guide/notification-how-to-filtering.html) in the + * *Amazon S3 User Guide*. Specifies object key name filtering rules. For information about key name filtering, see + * [Configuring event notifications using object key name + * filtering](https://docs.aws.amazon.com/AmazonS3/latest/userguide/notification-how-to-filtering.html) in the + * *Amazon S3 User Guide*. + */ + private NotificationFilter filter; + + /* + * The Amazon Resource Name (ARN) of the Amazon SQS queue to which Amazon S3 publishes a message when it detects + * events of the specified type. FIFO queues are not allowed when enabling an SQS queue as the event notification + * destination. + */ + private String queue; + + /** + * Creates an instance of QueueConfiguration class. + */ + public QueueConfiguration() { + } + + /** + * Get the event property: The Amazon S3 bucket event about which you want to publish messages to Amazon SQS. For + * more information, see [Supported Event + * Types](https://docs.aws.amazon.com/AmazonS3/latest/dev/NotificationHowTo.html) in the *Amazon S3 User Guide*. + * + * @return the event value. + */ + public String event() { + return this.event; + } + + /** + * Set the event property: The Amazon S3 bucket event about which you want to publish messages to Amazon SQS. For + * more information, see [Supported Event + * Types](https://docs.aws.amazon.com/AmazonS3/latest/dev/NotificationHowTo.html) in the *Amazon S3 User Guide*. + * + * @param event the event value to set. + * @return the QueueConfiguration object itself. + */ + public QueueConfiguration withEvent(String event) { + this.event = event; + return this; + } + + /** + * Get the filter property: The filtering rules that determine which objects trigger notifications. For example, you + * can create a filter so that Amazon S3 sends notifications only when image files with a ``.jpg`` extension are + * added to the bucket. For more information, see [Configuring event notifications using object key name + * filtering](https://docs.aws.amazon.com/AmazonS3/latest/user-guide/notification-how-to-filtering.html) in the + * *Amazon S3 User Guide*. Specifies object key name filtering rules. For information about key name filtering, see + * [Configuring event notifications using object key name + * filtering](https://docs.aws.amazon.com/AmazonS3/latest/userguide/notification-how-to-filtering.html) in the + * *Amazon S3 User Guide*. + * + * @return the filter value. + */ + public NotificationFilter filter() { + return this.filter; + } + + /** + * Set the filter property: The filtering rules that determine which objects trigger notifications. For example, you + * can create a filter so that Amazon S3 sends notifications only when image files with a ``.jpg`` extension are + * added to the bucket. For more information, see [Configuring event notifications using object key name + * filtering](https://docs.aws.amazon.com/AmazonS3/latest/user-guide/notification-how-to-filtering.html) in the + * *Amazon S3 User Guide*. Specifies object key name filtering rules. For information about key name filtering, see + * [Configuring event notifications using object key name + * filtering](https://docs.aws.amazon.com/AmazonS3/latest/userguide/notification-how-to-filtering.html) in the + * *Amazon S3 User Guide*. + * + * @param filter the filter value to set. + * @return the QueueConfiguration object itself. + */ + public QueueConfiguration withFilter(NotificationFilter filter) { + this.filter = filter; + return this; + } + + /** + * Get the queue property: The Amazon Resource Name (ARN) of the Amazon SQS queue to which Amazon S3 publishes a + * message when it detects events of the specified type. FIFO queues are not allowed when enabling an SQS queue as + * the event notification destination. + * + * @return the queue value. + */ + public String queue() { + return this.queue; + } + + /** + * Set the queue property: The Amazon Resource Name (ARN) of the Amazon SQS queue to which Amazon S3 publishes a + * message when it detects events of the specified type. FIFO queues are not allowed when enabling an SQS queue as + * the event notification destination. + * + * @param queue the queue value to set. + * @return the QueueConfiguration object itself. + */ + public QueueConfiguration withQueue(String queue) { + this.queue = queue; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (filter() != null) { + filter().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("event", this.event); + jsonWriter.writeJsonField("filter", this.filter); + jsonWriter.writeStringField("queue", this.queue); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of QueueConfiguration from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of QueueConfiguration if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the QueueConfiguration. + */ + public static QueueConfiguration fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + QueueConfiguration deserializedQueueConfiguration = new QueueConfiguration(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("event".equals(fieldName)) { + deserializedQueueConfiguration.event = reader.getString(); + } else if ("filter".equals(fieldName)) { + deserializedQueueConfiguration.filter = NotificationFilter.fromJson(reader); + } else if ("queue".equals(fieldName)) { + deserializedQueueConfiguration.queue = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedQueueConfiguration; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/RRType.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/RRType.java new file mode 100644 index 000000000000..c99edad7efab --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/RRType.java @@ -0,0 +1,106 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * RRType enum. + */ +public final class RRType extends ExpandableStringEnum { + /** + * Static value A for RRType. + */ + public static final RRType A = fromString("A"); + + /** + * Static value AAAA for RRType. + */ + public static final RRType AAAA = fromString("AAAA"); + + /** + * Static value CAA for RRType. + */ + public static final RRType CAA = fromString("CAA"); + + /** + * Static value CNAME for RRType. + */ + public static final RRType CNAME = fromString("CNAME"); + + /** + * Static value DS for RRType. + */ + public static final RRType DS = fromString("DS"); + + /** + * Static value MX for RRType. + */ + public static final RRType MX = fromString("MX"); + + /** + * Static value NAPTR for RRType. + */ + public static final RRType NAPTR = fromString("NAPTR"); + + /** + * Static value NS for RRType. + */ + public static final RRType NS = fromString("NS"); + + /** + * Static value PTR for RRType. + */ + public static final RRType PTR = fromString("PTR"); + + /** + * Static value SOA for RRType. + */ + public static final RRType SOA = fromString("SOA"); + + /** + * Static value SPF for RRType. + */ + public static final RRType SPF = fromString("SPF"); + + /** + * Static value SRV for RRType. + */ + public static final RRType SRV = fromString("SRV"); + + /** + * Static value TXT for RRType. + */ + public static final RRType TXT = fromString("TXT"); + + /** + * Creates a new instance of RRType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public RRType() { + } + + /** + * Creates or finds a RRType from its string representation. + * + * @param name a name to look for. + * @return the corresponding RRType. + */ + public static RRType fromString(String name) { + return fromString(name, RRType.class); + } + + /** + * Gets known RRType values. + * + * @return known RRType values. + */ + public static Collection values() { + return values(RRType.class); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/RRTypeEnumValue.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/RRTypeEnumValue.java new file mode 100644 index 000000000000..ab8cf85d2e64 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/RRTypeEnumValue.java @@ -0,0 +1,93 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of RRTypeEnumValue. + */ +@Fluent +public final class RRTypeEnumValue implements JsonSerializable { + /* + * Property value + */ + private RRType value; + + /** + * Creates an instance of RRTypeEnumValue class. + */ + public RRTypeEnumValue() { + } + + /** + * Get the value property: Property value. + * + * @return the value value. + */ + public RRType value() { + return this.value; + } + + /** + * Set the value property: Property value. + * + * @param value the value value to set. + * @return the RRTypeEnumValue object itself. + */ + public RRTypeEnumValue withValue(RRType value) { + this.value = value; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("value", this.value == null ? null : this.value.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of RRTypeEnumValue from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of RRTypeEnumValue if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the RRTypeEnumValue. + */ + public static RRTypeEnumValue fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + RRTypeEnumValue deserializedRRTypeEnumValue = new RRTypeEnumValue(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + deserializedRRTypeEnumValue.value = RRType.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedRRTypeEnumValue; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/RdsDBCluster.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/RdsDBCluster.java new file mode 100644 index 000000000000..7e2ec1e5653b --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/RdsDBCluster.java @@ -0,0 +1,252 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.awsconnector.fluent.models.RdsDBClusterInner; +import java.util.Map; + +/** + * An immutable client-side representation of RdsDBCluster. + */ +public interface RdsDBCluster { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the location property: The geo-location where the resource lives. + * + * @return the location value. + */ + String location(); + + /** + * Gets the tags property: Resource tags. + * + * @return the tags value. + */ + Map tags(); + + /** + * Gets the properties property: The resource-specific properties for this resource. + * + * @return the properties value. + */ + RdsDBClusterProperties properties(); + + /** + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the region of the resource. + * + * @return the region of the resource. + */ + Region region(); + + /** + * Gets the name of the resource region. + * + * @return the name of the resource region. + */ + String regionName(); + + /** + * Gets the name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + + /** + * Gets the inner com.azure.resourcemanager.awsconnector.fluent.models.RdsDBClusterInner object. + * + * @return the inner object. + */ + RdsDBClusterInner innerModel(); + + /** + * The entirety of the RdsDBCluster definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithLocation, + DefinitionStages.WithResourceGroup, DefinitionStages.WithCreate { + } + + /** + * The RdsDBCluster definition stages. + */ + interface DefinitionStages { + /** + * The first stage of the RdsDBCluster definition. + */ + interface Blank extends WithLocation { + } + + /** + * The stage of the RdsDBCluster definition allowing to specify location. + */ + interface WithLocation { + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithResourceGroup withRegion(Region location); + + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithResourceGroup withRegion(String location); + } + + /** + * The stage of the RdsDBCluster definition allowing to specify parent resource. + */ + interface WithResourceGroup { + /** + * Specifies resourceGroupName. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @return the next definition stage. + */ + WithCreate withExistingResourceGroup(String resourceGroupName); + } + + /** + * The stage of the RdsDBCluster 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.WithProperties { + /** + * Executes the create request. + * + * @return the created resource. + */ + RdsDBCluster create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + RdsDBCluster create(Context context); + } + + /** + * The stage of the RdsDBCluster definition allowing to specify tags. + */ + interface WithTags { + /** + * Specifies the tags property: Resource tags.. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + WithCreate withTags(Map tags); + } + + /** + * The stage of the RdsDBCluster definition allowing to specify properties. + */ + interface WithProperties { + /** + * Specifies the properties property: The resource-specific properties for this resource.. + * + * @param properties The resource-specific properties for this resource. + * @return the next definition stage. + */ + WithCreate withProperties(RdsDBClusterProperties properties); + } + } + + /** + * Begins update for the RdsDBCluster resource. + * + * @return the stage of resource update. + */ + RdsDBCluster.Update update(); + + /** + * The template for RdsDBCluster update. + */ + interface Update extends UpdateStages.WithTags { + /** + * Executes the update request. + * + * @return the updated resource. + */ + RdsDBCluster apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + RdsDBCluster apply(Context context); + } + + /** + * The RdsDBCluster update stages. + */ + interface UpdateStages { + /** + * The stage of the RdsDBCluster update allowing to specify tags. + */ + interface WithTags { + /** + * Specifies the tags property: Resource tags.. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + Update withTags(Map tags); + } + } + + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + RdsDBCluster refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + RdsDBCluster refresh(Context context); +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/RdsDBClusterListResult.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/RdsDBClusterListResult.java new file mode 100644 index 000000000000..7e3803444038 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/RdsDBClusterListResult.java @@ -0,0 +1,134 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.awsconnector.fluent.models.RdsDBClusterInner; +import java.io.IOException; +import java.util.List; + +/** + * The response of a RdsDBCluster list operation. + */ +@Fluent +public final class RdsDBClusterListResult implements JsonSerializable { + /* + * The RdsDBCluster items on this page + */ + private List value; + + /* + * The link to the next page of items + */ + private String nextLink; + + /** + * Creates an instance of RdsDBClusterListResult class. + */ + public RdsDBClusterListResult() { + } + + /** + * Get the value property: The RdsDBCluster items on this page. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The RdsDBCluster items on this page. + * + * @param value the value value to set. + * @return the RdsDBClusterListResult object itself. + */ + public RdsDBClusterListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The link to the next page of items. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: The link to the next page of items. + * + * @param nextLink the nextLink value to set. + * @return the RdsDBClusterListResult object itself. + */ + public RdsDBClusterListResult withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property value in model RdsDBClusterListResult")); + } else { + value().forEach(e -> e.validate()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(RdsDBClusterListResult.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("nextLink", this.nextLink); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of RdsDBClusterListResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of RdsDBClusterListResult if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the RdsDBClusterListResult. + */ + public static RdsDBClusterListResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + RdsDBClusterListResult deserializedRdsDBClusterListResult = new RdsDBClusterListResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value = reader.readArray(reader1 -> RdsDBClusterInner.fromJson(reader1)); + deserializedRdsDBClusterListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedRdsDBClusterListResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedRdsDBClusterListResult; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/RdsDBClusterProperties.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/RdsDBClusterProperties.java new file mode 100644 index 000000000000..bf0ebcb6d970 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/RdsDBClusterProperties.java @@ -0,0 +1,311 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.Map; + +/** + * Definition of RdsDBCluster. + */ +@Fluent +public final class RdsDBClusterProperties implements JsonSerializable { + /* + * AWS Properties + */ + private AwsRdsDBClusterProperties awsProperties; + + /* + * Public Cloud Connectors Resource ID + */ + private String publicCloudConnectorsResourceId; + + /* + * AWS Account ID + */ + private String awsAccountId; + + /* + * Amazon Resource Name (ARN) + */ + private String arn; + + /* + * Public Cloud Resource Name + */ + private String publicCloudResourceName; + + /* + * AWS Source Schema + */ + private String awsSourceSchema; + + /* + * AWS Region + */ + private String awsRegion; + + /* + * AWS Tags + */ + private Map awsTags; + + /* + * The status of the last operation. + */ + private ProvisioningState provisioningState; + + /** + * Creates an instance of RdsDBClusterProperties class. + */ + public RdsDBClusterProperties() { + } + + /** + * Get the awsProperties property: AWS Properties. + * + * @return the awsProperties value. + */ + public AwsRdsDBClusterProperties awsProperties() { + return this.awsProperties; + } + + /** + * Set the awsProperties property: AWS Properties. + * + * @param awsProperties the awsProperties value to set. + * @return the RdsDBClusterProperties object itself. + */ + public RdsDBClusterProperties withAwsProperties(AwsRdsDBClusterProperties awsProperties) { + this.awsProperties = awsProperties; + return this; + } + + /** + * Get the publicCloudConnectorsResourceId property: Public Cloud Connectors Resource ID. + * + * @return the publicCloudConnectorsResourceId value. + */ + public String publicCloudConnectorsResourceId() { + return this.publicCloudConnectorsResourceId; + } + + /** + * Set the publicCloudConnectorsResourceId property: Public Cloud Connectors Resource ID. + * + * @param publicCloudConnectorsResourceId the publicCloudConnectorsResourceId value to set. + * @return the RdsDBClusterProperties object itself. + */ + public RdsDBClusterProperties withPublicCloudConnectorsResourceId(String publicCloudConnectorsResourceId) { + this.publicCloudConnectorsResourceId = publicCloudConnectorsResourceId; + return this; + } + + /** + * Get the awsAccountId property: AWS Account ID. + * + * @return the awsAccountId value. + */ + public String awsAccountId() { + return this.awsAccountId; + } + + /** + * Set the awsAccountId property: AWS Account ID. + * + * @param awsAccountId the awsAccountId value to set. + * @return the RdsDBClusterProperties object itself. + */ + public RdsDBClusterProperties withAwsAccountId(String awsAccountId) { + this.awsAccountId = awsAccountId; + return this; + } + + /** + * Get the arn property: Amazon Resource Name (ARN). + * + * @return the arn value. + */ + public String arn() { + return this.arn; + } + + /** + * Set the arn property: Amazon Resource Name (ARN). + * + * @param arn the arn value to set. + * @return the RdsDBClusterProperties object itself. + */ + public RdsDBClusterProperties withArn(String arn) { + this.arn = arn; + return this; + } + + /** + * Get the publicCloudResourceName property: Public Cloud Resource Name. + * + * @return the publicCloudResourceName value. + */ + public String publicCloudResourceName() { + return this.publicCloudResourceName; + } + + /** + * Set the publicCloudResourceName property: Public Cloud Resource Name. + * + * @param publicCloudResourceName the publicCloudResourceName value to set. + * @return the RdsDBClusterProperties object itself. + */ + public RdsDBClusterProperties withPublicCloudResourceName(String publicCloudResourceName) { + this.publicCloudResourceName = publicCloudResourceName; + return this; + } + + /** + * Get the awsSourceSchema property: AWS Source Schema. + * + * @return the awsSourceSchema value. + */ + public String awsSourceSchema() { + return this.awsSourceSchema; + } + + /** + * Set the awsSourceSchema property: AWS Source Schema. + * + * @param awsSourceSchema the awsSourceSchema value to set. + * @return the RdsDBClusterProperties object itself. + */ + public RdsDBClusterProperties withAwsSourceSchema(String awsSourceSchema) { + this.awsSourceSchema = awsSourceSchema; + return this; + } + + /** + * Get the awsRegion property: AWS Region. + * + * @return the awsRegion value. + */ + public String awsRegion() { + return this.awsRegion; + } + + /** + * Set the awsRegion property: AWS Region. + * + * @param awsRegion the awsRegion value to set. + * @return the RdsDBClusterProperties object itself. + */ + public RdsDBClusterProperties withAwsRegion(String awsRegion) { + this.awsRegion = awsRegion; + return this; + } + + /** + * Get the awsTags property: AWS Tags. + * + * @return the awsTags value. + */ + public Map awsTags() { + return this.awsTags; + } + + /** + * Set the awsTags property: AWS Tags. + * + * @param awsTags the awsTags value to set. + * @return the RdsDBClusterProperties object itself. + */ + public RdsDBClusterProperties withAwsTags(Map awsTags) { + this.awsTags = awsTags; + return this; + } + + /** + * Get the provisioningState property: The status of the last operation. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (awsProperties() != null) { + awsProperties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("awsProperties", this.awsProperties); + jsonWriter.writeStringField("publicCloudConnectorsResourceId", this.publicCloudConnectorsResourceId); + jsonWriter.writeStringField("awsAccountId", this.awsAccountId); + jsonWriter.writeStringField("arn", this.arn); + jsonWriter.writeStringField("publicCloudResourceName", this.publicCloudResourceName); + jsonWriter.writeStringField("awsSourceSchema", this.awsSourceSchema); + jsonWriter.writeStringField("awsRegion", this.awsRegion); + jsonWriter.writeMapField("awsTags", this.awsTags, (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of RdsDBClusterProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of RdsDBClusterProperties if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the RdsDBClusterProperties. + */ + public static RdsDBClusterProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + RdsDBClusterProperties deserializedRdsDBClusterProperties = new RdsDBClusterProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("awsProperties".equals(fieldName)) { + deserializedRdsDBClusterProperties.awsProperties = AwsRdsDBClusterProperties.fromJson(reader); + } else if ("publicCloudConnectorsResourceId".equals(fieldName)) { + deserializedRdsDBClusterProperties.publicCloudConnectorsResourceId = reader.getString(); + } else if ("awsAccountId".equals(fieldName)) { + deserializedRdsDBClusterProperties.awsAccountId = reader.getString(); + } else if ("arn".equals(fieldName)) { + deserializedRdsDBClusterProperties.arn = reader.getString(); + } else if ("publicCloudResourceName".equals(fieldName)) { + deserializedRdsDBClusterProperties.publicCloudResourceName = reader.getString(); + } else if ("awsSourceSchema".equals(fieldName)) { + deserializedRdsDBClusterProperties.awsSourceSchema = reader.getString(); + } else if ("awsRegion".equals(fieldName)) { + deserializedRdsDBClusterProperties.awsRegion = reader.getString(); + } else if ("awsTags".equals(fieldName)) { + Map awsTags = reader.readMap(reader1 -> reader1.getString()); + deserializedRdsDBClusterProperties.awsTags = awsTags; + } else if ("provisioningState".equals(fieldName)) { + deserializedRdsDBClusterProperties.provisioningState + = ProvisioningState.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedRdsDBClusterProperties; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/RdsDBClusterTagsUpdate.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/RdsDBClusterTagsUpdate.java new file mode 100644 index 000000000000..8fe17567eaaf --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/RdsDBClusterTagsUpdate.java @@ -0,0 +1,95 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.Map; + +/** + * The type used for updating tags in RdsDBCluster resources. + */ +@Fluent +public final class RdsDBClusterTagsUpdate implements JsonSerializable { + /* + * Resource tags. + */ + private Map tags; + + /** + * Creates an instance of RdsDBClusterTagsUpdate class. + */ + public RdsDBClusterTagsUpdate() { + } + + /** + * Get the tags property: Resource tags. + * + * @return the tags value. + */ + public Map tags() { + return this.tags; + } + + /** + * Set the tags property: Resource tags. + * + * @param tags the tags value to set. + * @return the RdsDBClusterTagsUpdate object itself. + */ + public RdsDBClusterTagsUpdate withTags(Map tags) { + this.tags = tags; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeMapField("tags", this.tags, (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of RdsDBClusterTagsUpdate from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of RdsDBClusterTagsUpdate if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the RdsDBClusterTagsUpdate. + */ + public static RdsDBClusterTagsUpdate fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + RdsDBClusterTagsUpdate deserializedRdsDBClusterTagsUpdate = new RdsDBClusterTagsUpdate(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedRdsDBClusterTagsUpdate.tags = tags; + } else { + reader.skipChildren(); + } + } + + return deserializedRdsDBClusterTagsUpdate; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/RdsDBInstance.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/RdsDBInstance.java new file mode 100644 index 000000000000..318a6debe391 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/RdsDBInstance.java @@ -0,0 +1,252 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.awsconnector.fluent.models.RdsDBInstanceInner; +import java.util.Map; + +/** + * An immutable client-side representation of RdsDBInstance. + */ +public interface RdsDBInstance { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the location property: The geo-location where the resource lives. + * + * @return the location value. + */ + String location(); + + /** + * Gets the tags property: Resource tags. + * + * @return the tags value. + */ + Map tags(); + + /** + * Gets the properties property: The resource-specific properties for this resource. + * + * @return the properties value. + */ + RdsDBInstanceProperties properties(); + + /** + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the region of the resource. + * + * @return the region of the resource. + */ + Region region(); + + /** + * Gets the name of the resource region. + * + * @return the name of the resource region. + */ + String regionName(); + + /** + * Gets the name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + + /** + * Gets the inner com.azure.resourcemanager.awsconnector.fluent.models.RdsDBInstanceInner object. + * + * @return the inner object. + */ + RdsDBInstanceInner innerModel(); + + /** + * The entirety of the RdsDBInstance definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithLocation, + DefinitionStages.WithResourceGroup, DefinitionStages.WithCreate { + } + + /** + * The RdsDBInstance definition stages. + */ + interface DefinitionStages { + /** + * The first stage of the RdsDBInstance definition. + */ + interface Blank extends WithLocation { + } + + /** + * The stage of the RdsDBInstance definition allowing to specify location. + */ + interface WithLocation { + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithResourceGroup withRegion(Region location); + + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithResourceGroup withRegion(String location); + } + + /** + * The stage of the RdsDBInstance definition allowing to specify parent resource. + */ + interface WithResourceGroup { + /** + * Specifies resourceGroupName. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @return the next definition stage. + */ + WithCreate withExistingResourceGroup(String resourceGroupName); + } + + /** + * The stage of the RdsDBInstance 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.WithProperties { + /** + * Executes the create request. + * + * @return the created resource. + */ + RdsDBInstance create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + RdsDBInstance create(Context context); + } + + /** + * The stage of the RdsDBInstance definition allowing to specify tags. + */ + interface WithTags { + /** + * Specifies the tags property: Resource tags.. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + WithCreate withTags(Map tags); + } + + /** + * The stage of the RdsDBInstance definition allowing to specify properties. + */ + interface WithProperties { + /** + * Specifies the properties property: The resource-specific properties for this resource.. + * + * @param properties The resource-specific properties for this resource. + * @return the next definition stage. + */ + WithCreate withProperties(RdsDBInstanceProperties properties); + } + } + + /** + * Begins update for the RdsDBInstance resource. + * + * @return the stage of resource update. + */ + RdsDBInstance.Update update(); + + /** + * The template for RdsDBInstance update. + */ + interface Update extends UpdateStages.WithTags { + /** + * Executes the update request. + * + * @return the updated resource. + */ + RdsDBInstance apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + RdsDBInstance apply(Context context); + } + + /** + * The RdsDBInstance update stages. + */ + interface UpdateStages { + /** + * The stage of the RdsDBInstance update allowing to specify tags. + */ + interface WithTags { + /** + * Specifies the tags property: Resource tags.. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + Update withTags(Map tags); + } + } + + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + RdsDBInstance refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + RdsDBInstance refresh(Context context); +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/RdsDBInstanceListResult.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/RdsDBInstanceListResult.java new file mode 100644 index 000000000000..771ffd47a4f4 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/RdsDBInstanceListResult.java @@ -0,0 +1,134 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.awsconnector.fluent.models.RdsDBInstanceInner; +import java.io.IOException; +import java.util.List; + +/** + * The response of a RdsDBInstance list operation. + */ +@Fluent +public final class RdsDBInstanceListResult implements JsonSerializable { + /* + * The RdsDBInstance items on this page + */ + private List value; + + /* + * The link to the next page of items + */ + private String nextLink; + + /** + * Creates an instance of RdsDBInstanceListResult class. + */ + public RdsDBInstanceListResult() { + } + + /** + * Get the value property: The RdsDBInstance items on this page. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The RdsDBInstance items on this page. + * + * @param value the value value to set. + * @return the RdsDBInstanceListResult object itself. + */ + public RdsDBInstanceListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The link to the next page of items. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: The link to the next page of items. + * + * @param nextLink the nextLink value to set. + * @return the RdsDBInstanceListResult object itself. + */ + public RdsDBInstanceListResult withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property value in model RdsDBInstanceListResult")); + } else { + value().forEach(e -> e.validate()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(RdsDBInstanceListResult.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("nextLink", this.nextLink); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of RdsDBInstanceListResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of RdsDBInstanceListResult if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the RdsDBInstanceListResult. + */ + public static RdsDBInstanceListResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + RdsDBInstanceListResult deserializedRdsDBInstanceListResult = new RdsDBInstanceListResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value = reader.readArray(reader1 -> RdsDBInstanceInner.fromJson(reader1)); + deserializedRdsDBInstanceListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedRdsDBInstanceListResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedRdsDBInstanceListResult; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/RdsDBInstanceProperties.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/RdsDBInstanceProperties.java new file mode 100644 index 000000000000..5290a7502e4e --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/RdsDBInstanceProperties.java @@ -0,0 +1,311 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.Map; + +/** + * Definition of RdsDBInstance. + */ +@Fluent +public final class RdsDBInstanceProperties implements JsonSerializable { + /* + * AWS Properties + */ + private AwsRdsDBInstanceProperties awsProperties; + + /* + * Public Cloud Connectors Resource ID + */ + private String publicCloudConnectorsResourceId; + + /* + * AWS Account ID + */ + private String awsAccountId; + + /* + * Amazon Resource Name (ARN) + */ + private String arn; + + /* + * Public Cloud Resource Name + */ + private String publicCloudResourceName; + + /* + * AWS Source Schema + */ + private String awsSourceSchema; + + /* + * AWS Region + */ + private String awsRegion; + + /* + * AWS Tags + */ + private Map awsTags; + + /* + * The status of the last operation. + */ + private ProvisioningState provisioningState; + + /** + * Creates an instance of RdsDBInstanceProperties class. + */ + public RdsDBInstanceProperties() { + } + + /** + * Get the awsProperties property: AWS Properties. + * + * @return the awsProperties value. + */ + public AwsRdsDBInstanceProperties awsProperties() { + return this.awsProperties; + } + + /** + * Set the awsProperties property: AWS Properties. + * + * @param awsProperties the awsProperties value to set. + * @return the RdsDBInstanceProperties object itself. + */ + public RdsDBInstanceProperties withAwsProperties(AwsRdsDBInstanceProperties awsProperties) { + this.awsProperties = awsProperties; + return this; + } + + /** + * Get the publicCloudConnectorsResourceId property: Public Cloud Connectors Resource ID. + * + * @return the publicCloudConnectorsResourceId value. + */ + public String publicCloudConnectorsResourceId() { + return this.publicCloudConnectorsResourceId; + } + + /** + * Set the publicCloudConnectorsResourceId property: Public Cloud Connectors Resource ID. + * + * @param publicCloudConnectorsResourceId the publicCloudConnectorsResourceId value to set. + * @return the RdsDBInstanceProperties object itself. + */ + public RdsDBInstanceProperties withPublicCloudConnectorsResourceId(String publicCloudConnectorsResourceId) { + this.publicCloudConnectorsResourceId = publicCloudConnectorsResourceId; + return this; + } + + /** + * Get the awsAccountId property: AWS Account ID. + * + * @return the awsAccountId value. + */ + public String awsAccountId() { + return this.awsAccountId; + } + + /** + * Set the awsAccountId property: AWS Account ID. + * + * @param awsAccountId the awsAccountId value to set. + * @return the RdsDBInstanceProperties object itself. + */ + public RdsDBInstanceProperties withAwsAccountId(String awsAccountId) { + this.awsAccountId = awsAccountId; + return this; + } + + /** + * Get the arn property: Amazon Resource Name (ARN). + * + * @return the arn value. + */ + public String arn() { + return this.arn; + } + + /** + * Set the arn property: Amazon Resource Name (ARN). + * + * @param arn the arn value to set. + * @return the RdsDBInstanceProperties object itself. + */ + public RdsDBInstanceProperties withArn(String arn) { + this.arn = arn; + return this; + } + + /** + * Get the publicCloudResourceName property: Public Cloud Resource Name. + * + * @return the publicCloudResourceName value. + */ + public String publicCloudResourceName() { + return this.publicCloudResourceName; + } + + /** + * Set the publicCloudResourceName property: Public Cloud Resource Name. + * + * @param publicCloudResourceName the publicCloudResourceName value to set. + * @return the RdsDBInstanceProperties object itself. + */ + public RdsDBInstanceProperties withPublicCloudResourceName(String publicCloudResourceName) { + this.publicCloudResourceName = publicCloudResourceName; + return this; + } + + /** + * Get the awsSourceSchema property: AWS Source Schema. + * + * @return the awsSourceSchema value. + */ + public String awsSourceSchema() { + return this.awsSourceSchema; + } + + /** + * Set the awsSourceSchema property: AWS Source Schema. + * + * @param awsSourceSchema the awsSourceSchema value to set. + * @return the RdsDBInstanceProperties object itself. + */ + public RdsDBInstanceProperties withAwsSourceSchema(String awsSourceSchema) { + this.awsSourceSchema = awsSourceSchema; + return this; + } + + /** + * Get the awsRegion property: AWS Region. + * + * @return the awsRegion value. + */ + public String awsRegion() { + return this.awsRegion; + } + + /** + * Set the awsRegion property: AWS Region. + * + * @param awsRegion the awsRegion value to set. + * @return the RdsDBInstanceProperties object itself. + */ + public RdsDBInstanceProperties withAwsRegion(String awsRegion) { + this.awsRegion = awsRegion; + return this; + } + + /** + * Get the awsTags property: AWS Tags. + * + * @return the awsTags value. + */ + public Map awsTags() { + return this.awsTags; + } + + /** + * Set the awsTags property: AWS Tags. + * + * @param awsTags the awsTags value to set. + * @return the RdsDBInstanceProperties object itself. + */ + public RdsDBInstanceProperties withAwsTags(Map awsTags) { + this.awsTags = awsTags; + return this; + } + + /** + * Get the provisioningState property: The status of the last operation. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (awsProperties() != null) { + awsProperties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("awsProperties", this.awsProperties); + jsonWriter.writeStringField("publicCloudConnectorsResourceId", this.publicCloudConnectorsResourceId); + jsonWriter.writeStringField("awsAccountId", this.awsAccountId); + jsonWriter.writeStringField("arn", this.arn); + jsonWriter.writeStringField("publicCloudResourceName", this.publicCloudResourceName); + jsonWriter.writeStringField("awsSourceSchema", this.awsSourceSchema); + jsonWriter.writeStringField("awsRegion", this.awsRegion); + jsonWriter.writeMapField("awsTags", this.awsTags, (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of RdsDBInstanceProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of RdsDBInstanceProperties if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the RdsDBInstanceProperties. + */ + public static RdsDBInstanceProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + RdsDBInstanceProperties deserializedRdsDBInstanceProperties = new RdsDBInstanceProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("awsProperties".equals(fieldName)) { + deserializedRdsDBInstanceProperties.awsProperties = AwsRdsDBInstanceProperties.fromJson(reader); + } else if ("publicCloudConnectorsResourceId".equals(fieldName)) { + deserializedRdsDBInstanceProperties.publicCloudConnectorsResourceId = reader.getString(); + } else if ("awsAccountId".equals(fieldName)) { + deserializedRdsDBInstanceProperties.awsAccountId = reader.getString(); + } else if ("arn".equals(fieldName)) { + deserializedRdsDBInstanceProperties.arn = reader.getString(); + } else if ("publicCloudResourceName".equals(fieldName)) { + deserializedRdsDBInstanceProperties.publicCloudResourceName = reader.getString(); + } else if ("awsSourceSchema".equals(fieldName)) { + deserializedRdsDBInstanceProperties.awsSourceSchema = reader.getString(); + } else if ("awsRegion".equals(fieldName)) { + deserializedRdsDBInstanceProperties.awsRegion = reader.getString(); + } else if ("awsTags".equals(fieldName)) { + Map awsTags = reader.readMap(reader1 -> reader1.getString()); + deserializedRdsDBInstanceProperties.awsTags = awsTags; + } else if ("provisioningState".equals(fieldName)) { + deserializedRdsDBInstanceProperties.provisioningState + = ProvisioningState.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedRdsDBInstanceProperties; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/RdsDBInstanceTagsUpdate.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/RdsDBInstanceTagsUpdate.java new file mode 100644 index 000000000000..b7700c9c5596 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/RdsDBInstanceTagsUpdate.java @@ -0,0 +1,95 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.Map; + +/** + * The type used for updating tags in RdsDBInstance resources. + */ +@Fluent +public final class RdsDBInstanceTagsUpdate implements JsonSerializable { + /* + * Resource tags. + */ + private Map tags; + + /** + * Creates an instance of RdsDBInstanceTagsUpdate class. + */ + public RdsDBInstanceTagsUpdate() { + } + + /** + * Get the tags property: Resource tags. + * + * @return the tags value. + */ + public Map tags() { + return this.tags; + } + + /** + * Set the tags property: Resource tags. + * + * @param tags the tags value to set. + * @return the RdsDBInstanceTagsUpdate object itself. + */ + public RdsDBInstanceTagsUpdate withTags(Map tags) { + this.tags = tags; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeMapField("tags", this.tags, (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of RdsDBInstanceTagsUpdate from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of RdsDBInstanceTagsUpdate if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the RdsDBInstanceTagsUpdate. + */ + public static RdsDBInstanceTagsUpdate fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + RdsDBInstanceTagsUpdate deserializedRdsDBInstanceTagsUpdate = new RdsDBInstanceTagsUpdate(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedRdsDBInstanceTagsUpdate.tags = tags; + } else { + reader.skipChildren(); + } + } + + return deserializedRdsDBInstanceTagsUpdate; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/RdsDBSnapshot.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/RdsDBSnapshot.java new file mode 100644 index 000000000000..34635199a8bb --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/RdsDBSnapshot.java @@ -0,0 +1,252 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.awsconnector.fluent.models.RdsDBSnapshotInner; +import java.util.Map; + +/** + * An immutable client-side representation of RdsDBSnapshot. + */ +public interface RdsDBSnapshot { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the location property: The geo-location where the resource lives. + * + * @return the location value. + */ + String location(); + + /** + * Gets the tags property: Resource tags. + * + * @return the tags value. + */ + Map tags(); + + /** + * Gets the properties property: The resource-specific properties for this resource. + * + * @return the properties value. + */ + RdsDBSnapshotProperties properties(); + + /** + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the region of the resource. + * + * @return the region of the resource. + */ + Region region(); + + /** + * Gets the name of the resource region. + * + * @return the name of the resource region. + */ + String regionName(); + + /** + * Gets the name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + + /** + * Gets the inner com.azure.resourcemanager.awsconnector.fluent.models.RdsDBSnapshotInner object. + * + * @return the inner object. + */ + RdsDBSnapshotInner innerModel(); + + /** + * The entirety of the RdsDBSnapshot definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithLocation, + DefinitionStages.WithResourceGroup, DefinitionStages.WithCreate { + } + + /** + * The RdsDBSnapshot definition stages. + */ + interface DefinitionStages { + /** + * The first stage of the RdsDBSnapshot definition. + */ + interface Blank extends WithLocation { + } + + /** + * The stage of the RdsDBSnapshot definition allowing to specify location. + */ + interface WithLocation { + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithResourceGroup withRegion(Region location); + + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithResourceGroup withRegion(String location); + } + + /** + * The stage of the RdsDBSnapshot definition allowing to specify parent resource. + */ + interface WithResourceGroup { + /** + * Specifies resourceGroupName. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @return the next definition stage. + */ + WithCreate withExistingResourceGroup(String resourceGroupName); + } + + /** + * The stage of the RdsDBSnapshot 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.WithProperties { + /** + * Executes the create request. + * + * @return the created resource. + */ + RdsDBSnapshot create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + RdsDBSnapshot create(Context context); + } + + /** + * The stage of the RdsDBSnapshot definition allowing to specify tags. + */ + interface WithTags { + /** + * Specifies the tags property: Resource tags.. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + WithCreate withTags(Map tags); + } + + /** + * The stage of the RdsDBSnapshot definition allowing to specify properties. + */ + interface WithProperties { + /** + * Specifies the properties property: The resource-specific properties for this resource.. + * + * @param properties The resource-specific properties for this resource. + * @return the next definition stage. + */ + WithCreate withProperties(RdsDBSnapshotProperties properties); + } + } + + /** + * Begins update for the RdsDBSnapshot resource. + * + * @return the stage of resource update. + */ + RdsDBSnapshot.Update update(); + + /** + * The template for RdsDBSnapshot update. + */ + interface Update extends UpdateStages.WithTags { + /** + * Executes the update request. + * + * @return the updated resource. + */ + RdsDBSnapshot apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + RdsDBSnapshot apply(Context context); + } + + /** + * The RdsDBSnapshot update stages. + */ + interface UpdateStages { + /** + * The stage of the RdsDBSnapshot update allowing to specify tags. + */ + interface WithTags { + /** + * Specifies the tags property: Resource tags.. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + Update withTags(Map tags); + } + } + + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + RdsDBSnapshot refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + RdsDBSnapshot refresh(Context context); +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/RdsDBSnapshotAttributesResult.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/RdsDBSnapshotAttributesResult.java new file mode 100644 index 000000000000..ed459b51eea5 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/RdsDBSnapshotAttributesResult.java @@ -0,0 +1,252 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.awsconnector.fluent.models.RdsDBSnapshotAttributesResultInner; +import java.util.Map; + +/** + * An immutable client-side representation of RdsDBSnapshotAttributesResult. + */ +public interface RdsDBSnapshotAttributesResult { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the location property: The geo-location where the resource lives. + * + * @return the location value. + */ + String location(); + + /** + * Gets the tags property: Resource tags. + * + * @return the tags value. + */ + Map tags(); + + /** + * Gets the properties property: The resource-specific properties for this resource. + * + * @return the properties value. + */ + RdsDBSnapshotAttributesResultProperties properties(); + + /** + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the region of the resource. + * + * @return the region of the resource. + */ + Region region(); + + /** + * Gets the name of the resource region. + * + * @return the name of the resource region. + */ + String regionName(); + + /** + * Gets the name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + + /** + * Gets the inner com.azure.resourcemanager.awsconnector.fluent.models.RdsDBSnapshotAttributesResultInner object. + * + * @return the inner object. + */ + RdsDBSnapshotAttributesResultInner innerModel(); + + /** + * The entirety of the RdsDBSnapshotAttributesResult definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithLocation, + DefinitionStages.WithResourceGroup, DefinitionStages.WithCreate { + } + + /** + * The RdsDBSnapshotAttributesResult definition stages. + */ + interface DefinitionStages { + /** + * The first stage of the RdsDBSnapshotAttributesResult definition. + */ + interface Blank extends WithLocation { + } + + /** + * The stage of the RdsDBSnapshotAttributesResult definition allowing to specify location. + */ + interface WithLocation { + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithResourceGroup withRegion(Region location); + + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithResourceGroup withRegion(String location); + } + + /** + * The stage of the RdsDBSnapshotAttributesResult definition allowing to specify parent resource. + */ + interface WithResourceGroup { + /** + * Specifies resourceGroupName. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @return the next definition stage. + */ + WithCreate withExistingResourceGroup(String resourceGroupName); + } + + /** + * The stage of the RdsDBSnapshotAttributesResult 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.WithProperties { + /** + * Executes the create request. + * + * @return the created resource. + */ + RdsDBSnapshotAttributesResult create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + RdsDBSnapshotAttributesResult create(Context context); + } + + /** + * The stage of the RdsDBSnapshotAttributesResult definition allowing to specify tags. + */ + interface WithTags { + /** + * Specifies the tags property: Resource tags.. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + WithCreate withTags(Map tags); + } + + /** + * The stage of the RdsDBSnapshotAttributesResult definition allowing to specify properties. + */ + interface WithProperties { + /** + * Specifies the properties property: The resource-specific properties for this resource.. + * + * @param properties The resource-specific properties for this resource. + * @return the next definition stage. + */ + WithCreate withProperties(RdsDBSnapshotAttributesResultProperties properties); + } + } + + /** + * Begins update for the RdsDBSnapshotAttributesResult resource. + * + * @return the stage of resource update. + */ + RdsDBSnapshotAttributesResult.Update update(); + + /** + * The template for RdsDBSnapshotAttributesResult update. + */ + interface Update extends UpdateStages.WithTags { + /** + * Executes the update request. + * + * @return the updated resource. + */ + RdsDBSnapshotAttributesResult apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + RdsDBSnapshotAttributesResult apply(Context context); + } + + /** + * The RdsDBSnapshotAttributesResult update stages. + */ + interface UpdateStages { + /** + * The stage of the RdsDBSnapshotAttributesResult update allowing to specify tags. + */ + interface WithTags { + /** + * Specifies the tags property: Resource tags.. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + Update withTags(Map tags); + } + } + + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + RdsDBSnapshotAttributesResult refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + RdsDBSnapshotAttributesResult refresh(Context context); +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/RdsDBSnapshotAttributesResultListResult.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/RdsDBSnapshotAttributesResultListResult.java new file mode 100644 index 000000000000..6fbf62a6c59c --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/RdsDBSnapshotAttributesResultListResult.java @@ -0,0 +1,138 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.awsconnector.fluent.models.RdsDBSnapshotAttributesResultInner; +import java.io.IOException; +import java.util.List; + +/** + * The response of a RdsDBSnapshotAttributesResult list operation. + */ +@Fluent +public final class RdsDBSnapshotAttributesResultListResult + implements JsonSerializable { + /* + * The RdsDBSnapshotAttributesResult items on this page + */ + private List value; + + /* + * The link to the next page of items + */ + private String nextLink; + + /** + * Creates an instance of RdsDBSnapshotAttributesResultListResult class. + */ + public RdsDBSnapshotAttributesResultListResult() { + } + + /** + * Get the value property: The RdsDBSnapshotAttributesResult items on this page. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The RdsDBSnapshotAttributesResult items on this page. + * + * @param value the value value to set. + * @return the RdsDBSnapshotAttributesResultListResult object itself. + */ + public RdsDBSnapshotAttributesResultListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The link to the next page of items. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: The link to the next page of items. + * + * @param nextLink the nextLink value to set. + * @return the RdsDBSnapshotAttributesResultListResult object itself. + */ + public RdsDBSnapshotAttributesResultListResult withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property value in model RdsDBSnapshotAttributesResultListResult")); + } else { + value().forEach(e -> e.validate()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(RdsDBSnapshotAttributesResultListResult.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("nextLink", this.nextLink); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of RdsDBSnapshotAttributesResultListResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of RdsDBSnapshotAttributesResultListResult if the JsonReader was pointing to an instance of + * it, or null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the RdsDBSnapshotAttributesResultListResult. + */ + public static RdsDBSnapshotAttributesResultListResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + RdsDBSnapshotAttributesResultListResult deserializedRdsDBSnapshotAttributesResultListResult + = new RdsDBSnapshotAttributesResultListResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> RdsDBSnapshotAttributesResultInner.fromJson(reader1)); + deserializedRdsDBSnapshotAttributesResultListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedRdsDBSnapshotAttributesResultListResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedRdsDBSnapshotAttributesResultListResult; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/RdsDBSnapshotAttributesResultProperties.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/RdsDBSnapshotAttributesResultProperties.java new file mode 100644 index 000000000000..093108d14568 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/RdsDBSnapshotAttributesResultProperties.java @@ -0,0 +1,317 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.Map; + +/** + * Definition of RdsDBSnapshotAttributesResult. + */ +@Fluent +public final class RdsDBSnapshotAttributesResultProperties + implements JsonSerializable { + /* + * AWS Properties + */ + private AwsRdsDBSnapshotAttributesResultProperties awsProperties; + + /* + * Public Cloud Connectors Resource ID + */ + private String publicCloudConnectorsResourceId; + + /* + * AWS Account ID + */ + private String awsAccountId; + + /* + * Amazon Resource Name (ARN) + */ + private String arn; + + /* + * Public Cloud Resource Name + */ + private String publicCloudResourceName; + + /* + * AWS Source Schema + */ + private String awsSourceSchema; + + /* + * AWS Region + */ + private String awsRegion; + + /* + * AWS Tags + */ + private Map awsTags; + + /* + * The status of the last operation. + */ + private ProvisioningState provisioningState; + + /** + * Creates an instance of RdsDBSnapshotAttributesResultProperties class. + */ + public RdsDBSnapshotAttributesResultProperties() { + } + + /** + * Get the awsProperties property: AWS Properties. + * + * @return the awsProperties value. + */ + public AwsRdsDBSnapshotAttributesResultProperties awsProperties() { + return this.awsProperties; + } + + /** + * Set the awsProperties property: AWS Properties. + * + * @param awsProperties the awsProperties value to set. + * @return the RdsDBSnapshotAttributesResultProperties object itself. + */ + public RdsDBSnapshotAttributesResultProperties + withAwsProperties(AwsRdsDBSnapshotAttributesResultProperties awsProperties) { + this.awsProperties = awsProperties; + return this; + } + + /** + * Get the publicCloudConnectorsResourceId property: Public Cloud Connectors Resource ID. + * + * @return the publicCloudConnectorsResourceId value. + */ + public String publicCloudConnectorsResourceId() { + return this.publicCloudConnectorsResourceId; + } + + /** + * Set the publicCloudConnectorsResourceId property: Public Cloud Connectors Resource ID. + * + * @param publicCloudConnectorsResourceId the publicCloudConnectorsResourceId value to set. + * @return the RdsDBSnapshotAttributesResultProperties object itself. + */ + public RdsDBSnapshotAttributesResultProperties + withPublicCloudConnectorsResourceId(String publicCloudConnectorsResourceId) { + this.publicCloudConnectorsResourceId = publicCloudConnectorsResourceId; + return this; + } + + /** + * Get the awsAccountId property: AWS Account ID. + * + * @return the awsAccountId value. + */ + public String awsAccountId() { + return this.awsAccountId; + } + + /** + * Set the awsAccountId property: AWS Account ID. + * + * @param awsAccountId the awsAccountId value to set. + * @return the RdsDBSnapshotAttributesResultProperties object itself. + */ + public RdsDBSnapshotAttributesResultProperties withAwsAccountId(String awsAccountId) { + this.awsAccountId = awsAccountId; + return this; + } + + /** + * Get the arn property: Amazon Resource Name (ARN). + * + * @return the arn value. + */ + public String arn() { + return this.arn; + } + + /** + * Set the arn property: Amazon Resource Name (ARN). + * + * @param arn the arn value to set. + * @return the RdsDBSnapshotAttributesResultProperties object itself. + */ + public RdsDBSnapshotAttributesResultProperties withArn(String arn) { + this.arn = arn; + return this; + } + + /** + * Get the publicCloudResourceName property: Public Cloud Resource Name. + * + * @return the publicCloudResourceName value. + */ + public String publicCloudResourceName() { + return this.publicCloudResourceName; + } + + /** + * Set the publicCloudResourceName property: Public Cloud Resource Name. + * + * @param publicCloudResourceName the publicCloudResourceName value to set. + * @return the RdsDBSnapshotAttributesResultProperties object itself. + */ + public RdsDBSnapshotAttributesResultProperties withPublicCloudResourceName(String publicCloudResourceName) { + this.publicCloudResourceName = publicCloudResourceName; + return this; + } + + /** + * Get the awsSourceSchema property: AWS Source Schema. + * + * @return the awsSourceSchema value. + */ + public String awsSourceSchema() { + return this.awsSourceSchema; + } + + /** + * Set the awsSourceSchema property: AWS Source Schema. + * + * @param awsSourceSchema the awsSourceSchema value to set. + * @return the RdsDBSnapshotAttributesResultProperties object itself. + */ + public RdsDBSnapshotAttributesResultProperties withAwsSourceSchema(String awsSourceSchema) { + this.awsSourceSchema = awsSourceSchema; + return this; + } + + /** + * Get the awsRegion property: AWS Region. + * + * @return the awsRegion value. + */ + public String awsRegion() { + return this.awsRegion; + } + + /** + * Set the awsRegion property: AWS Region. + * + * @param awsRegion the awsRegion value to set. + * @return the RdsDBSnapshotAttributesResultProperties object itself. + */ + public RdsDBSnapshotAttributesResultProperties withAwsRegion(String awsRegion) { + this.awsRegion = awsRegion; + return this; + } + + /** + * Get the awsTags property: AWS Tags. + * + * @return the awsTags value. + */ + public Map awsTags() { + return this.awsTags; + } + + /** + * Set the awsTags property: AWS Tags. + * + * @param awsTags the awsTags value to set. + * @return the RdsDBSnapshotAttributesResultProperties object itself. + */ + public RdsDBSnapshotAttributesResultProperties withAwsTags(Map awsTags) { + this.awsTags = awsTags; + return this; + } + + /** + * Get the provisioningState property: The status of the last operation. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (awsProperties() != null) { + awsProperties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("awsProperties", this.awsProperties); + jsonWriter.writeStringField("publicCloudConnectorsResourceId", this.publicCloudConnectorsResourceId); + jsonWriter.writeStringField("awsAccountId", this.awsAccountId); + jsonWriter.writeStringField("arn", this.arn); + jsonWriter.writeStringField("publicCloudResourceName", this.publicCloudResourceName); + jsonWriter.writeStringField("awsSourceSchema", this.awsSourceSchema); + jsonWriter.writeStringField("awsRegion", this.awsRegion); + jsonWriter.writeMapField("awsTags", this.awsTags, (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of RdsDBSnapshotAttributesResultProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of RdsDBSnapshotAttributesResultProperties if the JsonReader was pointing to an instance of + * it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the RdsDBSnapshotAttributesResultProperties. + */ + public static RdsDBSnapshotAttributesResultProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + RdsDBSnapshotAttributesResultProperties deserializedRdsDBSnapshotAttributesResultProperties + = new RdsDBSnapshotAttributesResultProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("awsProperties".equals(fieldName)) { + deserializedRdsDBSnapshotAttributesResultProperties.awsProperties + = AwsRdsDBSnapshotAttributesResultProperties.fromJson(reader); + } else if ("publicCloudConnectorsResourceId".equals(fieldName)) { + deserializedRdsDBSnapshotAttributesResultProperties.publicCloudConnectorsResourceId + = reader.getString(); + } else if ("awsAccountId".equals(fieldName)) { + deserializedRdsDBSnapshotAttributesResultProperties.awsAccountId = reader.getString(); + } else if ("arn".equals(fieldName)) { + deserializedRdsDBSnapshotAttributesResultProperties.arn = reader.getString(); + } else if ("publicCloudResourceName".equals(fieldName)) { + deserializedRdsDBSnapshotAttributesResultProperties.publicCloudResourceName = reader.getString(); + } else if ("awsSourceSchema".equals(fieldName)) { + deserializedRdsDBSnapshotAttributesResultProperties.awsSourceSchema = reader.getString(); + } else if ("awsRegion".equals(fieldName)) { + deserializedRdsDBSnapshotAttributesResultProperties.awsRegion = reader.getString(); + } else if ("awsTags".equals(fieldName)) { + Map awsTags = reader.readMap(reader1 -> reader1.getString()); + deserializedRdsDBSnapshotAttributesResultProperties.awsTags = awsTags; + } else if ("provisioningState".equals(fieldName)) { + deserializedRdsDBSnapshotAttributesResultProperties.provisioningState + = ProvisioningState.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedRdsDBSnapshotAttributesResultProperties; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/RdsDBSnapshotAttributesResultTagsUpdate.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/RdsDBSnapshotAttributesResultTagsUpdate.java new file mode 100644 index 000000000000..e82eecaca873 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/RdsDBSnapshotAttributesResultTagsUpdate.java @@ -0,0 +1,97 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.Map; + +/** + * The type used for updating tags in RdsDBSnapshotAttributesResult resources. + */ +@Fluent +public final class RdsDBSnapshotAttributesResultTagsUpdate + implements JsonSerializable { + /* + * Resource tags. + */ + private Map tags; + + /** + * Creates an instance of RdsDBSnapshotAttributesResultTagsUpdate class. + */ + public RdsDBSnapshotAttributesResultTagsUpdate() { + } + + /** + * Get the tags property: Resource tags. + * + * @return the tags value. + */ + public Map tags() { + return this.tags; + } + + /** + * Set the tags property: Resource tags. + * + * @param tags the tags value to set. + * @return the RdsDBSnapshotAttributesResultTagsUpdate object itself. + */ + public RdsDBSnapshotAttributesResultTagsUpdate withTags(Map tags) { + this.tags = tags; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeMapField("tags", this.tags, (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of RdsDBSnapshotAttributesResultTagsUpdate from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of RdsDBSnapshotAttributesResultTagsUpdate if the JsonReader was pointing to an instance of + * it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the RdsDBSnapshotAttributesResultTagsUpdate. + */ + public static RdsDBSnapshotAttributesResultTagsUpdate fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + RdsDBSnapshotAttributesResultTagsUpdate deserializedRdsDBSnapshotAttributesResultTagsUpdate + = new RdsDBSnapshotAttributesResultTagsUpdate(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedRdsDBSnapshotAttributesResultTagsUpdate.tags = tags; + } else { + reader.skipChildren(); + } + } + + return deserializedRdsDBSnapshotAttributesResultTagsUpdate; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/RdsDBSnapshotListResult.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/RdsDBSnapshotListResult.java new file mode 100644 index 000000000000..140985a02d95 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/RdsDBSnapshotListResult.java @@ -0,0 +1,134 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.awsconnector.fluent.models.RdsDBSnapshotInner; +import java.io.IOException; +import java.util.List; + +/** + * The response of a RdsDBSnapshot list operation. + */ +@Fluent +public final class RdsDBSnapshotListResult implements JsonSerializable { + /* + * The RdsDBSnapshot items on this page + */ + private List value; + + /* + * The link to the next page of items + */ + private String nextLink; + + /** + * Creates an instance of RdsDBSnapshotListResult class. + */ + public RdsDBSnapshotListResult() { + } + + /** + * Get the value property: The RdsDBSnapshot items on this page. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The RdsDBSnapshot items on this page. + * + * @param value the value value to set. + * @return the RdsDBSnapshotListResult object itself. + */ + public RdsDBSnapshotListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The link to the next page of items. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: The link to the next page of items. + * + * @param nextLink the nextLink value to set. + * @return the RdsDBSnapshotListResult object itself. + */ + public RdsDBSnapshotListResult withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property value in model RdsDBSnapshotListResult")); + } else { + value().forEach(e -> e.validate()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(RdsDBSnapshotListResult.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("nextLink", this.nextLink); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of RdsDBSnapshotListResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of RdsDBSnapshotListResult if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the RdsDBSnapshotListResult. + */ + public static RdsDBSnapshotListResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + RdsDBSnapshotListResult deserializedRdsDBSnapshotListResult = new RdsDBSnapshotListResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value = reader.readArray(reader1 -> RdsDBSnapshotInner.fromJson(reader1)); + deserializedRdsDBSnapshotListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedRdsDBSnapshotListResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedRdsDBSnapshotListResult; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/RdsDBSnapshotProperties.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/RdsDBSnapshotProperties.java new file mode 100644 index 000000000000..ba365b6ea804 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/RdsDBSnapshotProperties.java @@ -0,0 +1,311 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.Map; + +/** + * Definition of RdsDBSnapshot. + */ +@Fluent +public final class RdsDBSnapshotProperties implements JsonSerializable { + /* + * AWS Properties + */ + private AwsRdsDBSnapshotProperties awsProperties; + + /* + * Public Cloud Connectors Resource ID + */ + private String publicCloudConnectorsResourceId; + + /* + * AWS Account ID + */ + private String awsAccountId; + + /* + * Amazon Resource Name (ARN) + */ + private String arn; + + /* + * Public Cloud Resource Name + */ + private String publicCloudResourceName; + + /* + * AWS Source Schema + */ + private String awsSourceSchema; + + /* + * AWS Region + */ + private String awsRegion; + + /* + * AWS Tags + */ + private Map awsTags; + + /* + * The status of the last operation. + */ + private ProvisioningState provisioningState; + + /** + * Creates an instance of RdsDBSnapshotProperties class. + */ + public RdsDBSnapshotProperties() { + } + + /** + * Get the awsProperties property: AWS Properties. + * + * @return the awsProperties value. + */ + public AwsRdsDBSnapshotProperties awsProperties() { + return this.awsProperties; + } + + /** + * Set the awsProperties property: AWS Properties. + * + * @param awsProperties the awsProperties value to set. + * @return the RdsDBSnapshotProperties object itself. + */ + public RdsDBSnapshotProperties withAwsProperties(AwsRdsDBSnapshotProperties awsProperties) { + this.awsProperties = awsProperties; + return this; + } + + /** + * Get the publicCloudConnectorsResourceId property: Public Cloud Connectors Resource ID. + * + * @return the publicCloudConnectorsResourceId value. + */ + public String publicCloudConnectorsResourceId() { + return this.publicCloudConnectorsResourceId; + } + + /** + * Set the publicCloudConnectorsResourceId property: Public Cloud Connectors Resource ID. + * + * @param publicCloudConnectorsResourceId the publicCloudConnectorsResourceId value to set. + * @return the RdsDBSnapshotProperties object itself. + */ + public RdsDBSnapshotProperties withPublicCloudConnectorsResourceId(String publicCloudConnectorsResourceId) { + this.publicCloudConnectorsResourceId = publicCloudConnectorsResourceId; + return this; + } + + /** + * Get the awsAccountId property: AWS Account ID. + * + * @return the awsAccountId value. + */ + public String awsAccountId() { + return this.awsAccountId; + } + + /** + * Set the awsAccountId property: AWS Account ID. + * + * @param awsAccountId the awsAccountId value to set. + * @return the RdsDBSnapshotProperties object itself. + */ + public RdsDBSnapshotProperties withAwsAccountId(String awsAccountId) { + this.awsAccountId = awsAccountId; + return this; + } + + /** + * Get the arn property: Amazon Resource Name (ARN). + * + * @return the arn value. + */ + public String arn() { + return this.arn; + } + + /** + * Set the arn property: Amazon Resource Name (ARN). + * + * @param arn the arn value to set. + * @return the RdsDBSnapshotProperties object itself. + */ + public RdsDBSnapshotProperties withArn(String arn) { + this.arn = arn; + return this; + } + + /** + * Get the publicCloudResourceName property: Public Cloud Resource Name. + * + * @return the publicCloudResourceName value. + */ + public String publicCloudResourceName() { + return this.publicCloudResourceName; + } + + /** + * Set the publicCloudResourceName property: Public Cloud Resource Name. + * + * @param publicCloudResourceName the publicCloudResourceName value to set. + * @return the RdsDBSnapshotProperties object itself. + */ + public RdsDBSnapshotProperties withPublicCloudResourceName(String publicCloudResourceName) { + this.publicCloudResourceName = publicCloudResourceName; + return this; + } + + /** + * Get the awsSourceSchema property: AWS Source Schema. + * + * @return the awsSourceSchema value. + */ + public String awsSourceSchema() { + return this.awsSourceSchema; + } + + /** + * Set the awsSourceSchema property: AWS Source Schema. + * + * @param awsSourceSchema the awsSourceSchema value to set. + * @return the RdsDBSnapshotProperties object itself. + */ + public RdsDBSnapshotProperties withAwsSourceSchema(String awsSourceSchema) { + this.awsSourceSchema = awsSourceSchema; + return this; + } + + /** + * Get the awsRegion property: AWS Region. + * + * @return the awsRegion value. + */ + public String awsRegion() { + return this.awsRegion; + } + + /** + * Set the awsRegion property: AWS Region. + * + * @param awsRegion the awsRegion value to set. + * @return the RdsDBSnapshotProperties object itself. + */ + public RdsDBSnapshotProperties withAwsRegion(String awsRegion) { + this.awsRegion = awsRegion; + return this; + } + + /** + * Get the awsTags property: AWS Tags. + * + * @return the awsTags value. + */ + public Map awsTags() { + return this.awsTags; + } + + /** + * Set the awsTags property: AWS Tags. + * + * @param awsTags the awsTags value to set. + * @return the RdsDBSnapshotProperties object itself. + */ + public RdsDBSnapshotProperties withAwsTags(Map awsTags) { + this.awsTags = awsTags; + return this; + } + + /** + * Get the provisioningState property: The status of the last operation. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (awsProperties() != null) { + awsProperties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("awsProperties", this.awsProperties); + jsonWriter.writeStringField("publicCloudConnectorsResourceId", this.publicCloudConnectorsResourceId); + jsonWriter.writeStringField("awsAccountId", this.awsAccountId); + jsonWriter.writeStringField("arn", this.arn); + jsonWriter.writeStringField("publicCloudResourceName", this.publicCloudResourceName); + jsonWriter.writeStringField("awsSourceSchema", this.awsSourceSchema); + jsonWriter.writeStringField("awsRegion", this.awsRegion); + jsonWriter.writeMapField("awsTags", this.awsTags, (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of RdsDBSnapshotProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of RdsDBSnapshotProperties if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the RdsDBSnapshotProperties. + */ + public static RdsDBSnapshotProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + RdsDBSnapshotProperties deserializedRdsDBSnapshotProperties = new RdsDBSnapshotProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("awsProperties".equals(fieldName)) { + deserializedRdsDBSnapshotProperties.awsProperties = AwsRdsDBSnapshotProperties.fromJson(reader); + } else if ("publicCloudConnectorsResourceId".equals(fieldName)) { + deserializedRdsDBSnapshotProperties.publicCloudConnectorsResourceId = reader.getString(); + } else if ("awsAccountId".equals(fieldName)) { + deserializedRdsDBSnapshotProperties.awsAccountId = reader.getString(); + } else if ("arn".equals(fieldName)) { + deserializedRdsDBSnapshotProperties.arn = reader.getString(); + } else if ("publicCloudResourceName".equals(fieldName)) { + deserializedRdsDBSnapshotProperties.publicCloudResourceName = reader.getString(); + } else if ("awsSourceSchema".equals(fieldName)) { + deserializedRdsDBSnapshotProperties.awsSourceSchema = reader.getString(); + } else if ("awsRegion".equals(fieldName)) { + deserializedRdsDBSnapshotProperties.awsRegion = reader.getString(); + } else if ("awsTags".equals(fieldName)) { + Map awsTags = reader.readMap(reader1 -> reader1.getString()); + deserializedRdsDBSnapshotProperties.awsTags = awsTags; + } else if ("provisioningState".equals(fieldName)) { + deserializedRdsDBSnapshotProperties.provisioningState + = ProvisioningState.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedRdsDBSnapshotProperties; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/RdsDBSnapshotTagsUpdate.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/RdsDBSnapshotTagsUpdate.java new file mode 100644 index 000000000000..1f356248221a --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/RdsDBSnapshotTagsUpdate.java @@ -0,0 +1,95 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.Map; + +/** + * The type used for updating tags in RdsDBSnapshot resources. + */ +@Fluent +public final class RdsDBSnapshotTagsUpdate implements JsonSerializable { + /* + * Resource tags. + */ + private Map tags; + + /** + * Creates an instance of RdsDBSnapshotTagsUpdate class. + */ + public RdsDBSnapshotTagsUpdate() { + } + + /** + * Get the tags property: Resource tags. + * + * @return the tags value. + */ + public Map tags() { + return this.tags; + } + + /** + * Set the tags property: Resource tags. + * + * @param tags the tags value to set. + * @return the RdsDBSnapshotTagsUpdate object itself. + */ + public RdsDBSnapshotTagsUpdate withTags(Map tags) { + this.tags = tags; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeMapField("tags", this.tags, (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of RdsDBSnapshotTagsUpdate from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of RdsDBSnapshotTagsUpdate if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the RdsDBSnapshotTagsUpdate. + */ + public static RdsDBSnapshotTagsUpdate fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + RdsDBSnapshotTagsUpdate deserializedRdsDBSnapshotTagsUpdate = new RdsDBSnapshotTagsUpdate(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedRdsDBSnapshotTagsUpdate.tags = tags; + } else { + reader.skipChildren(); + } + } + + return deserializedRdsDBSnapshotTagsUpdate; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/RdsDbClusters.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/RdsDbClusters.java new file mode 100644 index 000000000000..a6cc1fb14c11 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/RdsDbClusters.java @@ -0,0 +1,157 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** + * Resource collection API of RdsDbClusters. + */ +public interface RdsDbClusters { + /** + * List RdsDBCluster resources by subscription ID. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a RdsDBCluster list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable list(); + + /** + * List RdsDBCluster resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a RdsDBCluster list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable list(Context context); + + /** + * List RdsDBCluster resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a RdsDBCluster list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * List RdsDBCluster resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a RdsDBCluster list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Get a RdsDBCluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of RdsDBCluster. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a RdsDBCluster along with {@link Response}. + */ + Response getByResourceGroupWithResponse(String resourceGroupName, String name, Context context); + + /** + * Get a RdsDBCluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of RdsDBCluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a RdsDBCluster. + */ + RdsDBCluster getByResourceGroup(String resourceGroupName, String name); + + /** + * Delete a RdsDBCluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of RdsDBCluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByResourceGroup(String resourceGroupName, String name); + + /** + * Delete a RdsDBCluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of RdsDBCluster. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String name, Context context); + + /** + * Get a RdsDBCluster. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a RdsDBCluster along with {@link Response}. + */ + RdsDBCluster getById(String id); + + /** + * Get a RdsDBCluster. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a RdsDBCluster along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Delete a RdsDBCluster. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteById(String id); + + /** + * Delete a RdsDBCluster. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new RdsDBCluster resource. + * + * @param name resource name. + * @return the first stage of the new RdsDBCluster definition. + */ + RdsDBCluster.DefinitionStages.Blank define(String name); +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/RdsDbInstances.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/RdsDbInstances.java new file mode 100644 index 000000000000..95e6c9048813 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/RdsDbInstances.java @@ -0,0 +1,157 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** + * Resource collection API of RdsDbInstances. + */ +public interface RdsDbInstances { + /** + * List RdsDBInstance resources by subscription ID. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a RdsDBInstance list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable list(); + + /** + * List RdsDBInstance resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a RdsDBInstance list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable list(Context context); + + /** + * List RdsDBInstance resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a RdsDBInstance list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * List RdsDBInstance resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a RdsDBInstance list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Get a RdsDBInstance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of RdsDBInstance. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a RdsDBInstance along with {@link Response}. + */ + Response getByResourceGroupWithResponse(String resourceGroupName, String name, Context context); + + /** + * Get a RdsDBInstance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of RdsDBInstance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a RdsDBInstance. + */ + RdsDBInstance getByResourceGroup(String resourceGroupName, String name); + + /** + * Delete a RdsDBInstance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of RdsDBInstance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByResourceGroup(String resourceGroupName, String name); + + /** + * Delete a RdsDBInstance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of RdsDBInstance. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String name, Context context); + + /** + * Get a RdsDBInstance. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a RdsDBInstance along with {@link Response}. + */ + RdsDBInstance getById(String id); + + /** + * Get a RdsDBInstance. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a RdsDBInstance along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Delete a RdsDBInstance. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteById(String id); + + /** + * Delete a RdsDBInstance. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new RdsDBInstance resource. + * + * @param name resource name. + * @return the first stage of the new RdsDBInstance definition. + */ + RdsDBInstance.DefinitionStages.Blank define(String name); +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/RdsDbSnapshotAttributesResults.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/RdsDbSnapshotAttributesResults.java new file mode 100644 index 000000000000..c24fddbe5fb7 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/RdsDbSnapshotAttributesResults.java @@ -0,0 +1,162 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** + * Resource collection API of RdsDbSnapshotAttributesResults. + */ +public interface RdsDbSnapshotAttributesResults { + /** + * List RdsDBSnapshotAttributesResult resources by subscription ID. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a RdsDBSnapshotAttributesResult list operation as paginated response with + * {@link PagedIterable}. + */ + PagedIterable list(); + + /** + * List RdsDBSnapshotAttributesResult resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a RdsDBSnapshotAttributesResult list operation as paginated response with + * {@link PagedIterable}. + */ + PagedIterable list(Context context); + + /** + * List RdsDBSnapshotAttributesResult resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a RdsDBSnapshotAttributesResult list operation as paginated response with + * {@link PagedIterable}. + */ + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * List RdsDBSnapshotAttributesResult resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a RdsDBSnapshotAttributesResult list operation as paginated response with + * {@link PagedIterable}. + */ + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Get a RdsDBSnapshotAttributesResult. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of RdsDBSnapshotAttributesResult. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a RdsDBSnapshotAttributesResult along with {@link Response}. + */ + Response getByResourceGroupWithResponse(String resourceGroupName, String name, + Context context); + + /** + * Get a RdsDBSnapshotAttributesResult. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of RdsDBSnapshotAttributesResult. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a RdsDBSnapshotAttributesResult. + */ + RdsDBSnapshotAttributesResult getByResourceGroup(String resourceGroupName, String name); + + /** + * Delete a RdsDBSnapshotAttributesResult. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of RdsDBSnapshotAttributesResult. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByResourceGroup(String resourceGroupName, String name); + + /** + * Delete a RdsDBSnapshotAttributesResult. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of RdsDBSnapshotAttributesResult. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String name, Context context); + + /** + * Get a RdsDBSnapshotAttributesResult. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a RdsDBSnapshotAttributesResult along with {@link Response}. + */ + RdsDBSnapshotAttributesResult getById(String id); + + /** + * Get a RdsDBSnapshotAttributesResult. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a RdsDBSnapshotAttributesResult along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Delete a RdsDBSnapshotAttributesResult. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteById(String id); + + /** + * Delete a RdsDBSnapshotAttributesResult. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new RdsDBSnapshotAttributesResult resource. + * + * @param name resource name. + * @return the first stage of the new RdsDBSnapshotAttributesResult definition. + */ + RdsDBSnapshotAttributesResult.DefinitionStages.Blank define(String name); +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/RdsDbSnapshots.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/RdsDbSnapshots.java new file mode 100644 index 000000000000..aa0ade745822 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/RdsDbSnapshots.java @@ -0,0 +1,157 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** + * Resource collection API of RdsDbSnapshots. + */ +public interface RdsDbSnapshots { + /** + * List RdsDBSnapshot resources by subscription ID. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a RdsDBSnapshot list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable list(); + + /** + * List RdsDBSnapshot resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a RdsDBSnapshot list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable list(Context context); + + /** + * List RdsDBSnapshot resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a RdsDBSnapshot list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * List RdsDBSnapshot resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a RdsDBSnapshot list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Get a RdsDBSnapshot. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of RdsDBSnapshot. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a RdsDBSnapshot along with {@link Response}. + */ + Response getByResourceGroupWithResponse(String resourceGroupName, String name, Context context); + + /** + * Get a RdsDBSnapshot. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of RdsDBSnapshot. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a RdsDBSnapshot. + */ + RdsDBSnapshot getByResourceGroup(String resourceGroupName, String name); + + /** + * Delete a RdsDBSnapshot. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of RdsDBSnapshot. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByResourceGroup(String resourceGroupName, String name); + + /** + * Delete a RdsDBSnapshot. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of RdsDBSnapshot. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String name, Context context); + + /** + * Get a RdsDBSnapshot. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a RdsDBSnapshot along with {@link Response}. + */ + RdsDBSnapshot getById(String id); + + /** + * Get a RdsDBSnapshot. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a RdsDBSnapshot along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Delete a RdsDBSnapshot. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteById(String id); + + /** + * Delete a RdsDBSnapshot. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new RdsDBSnapshot resource. + * + * @param name resource name. + * @return the first stage of the new RdsDBSnapshot definition. + */ + RdsDBSnapshot.DefinitionStages.Blank define(String name); +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/RdsEventSubscription.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/RdsEventSubscription.java new file mode 100644 index 000000000000..1439ba536e68 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/RdsEventSubscription.java @@ -0,0 +1,252 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.awsconnector.fluent.models.RdsEventSubscriptionInner; +import java.util.Map; + +/** + * An immutable client-side representation of RdsEventSubscription. + */ +public interface RdsEventSubscription { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the location property: The geo-location where the resource lives. + * + * @return the location value. + */ + String location(); + + /** + * Gets the tags property: Resource tags. + * + * @return the tags value. + */ + Map tags(); + + /** + * Gets the properties property: The resource-specific properties for this resource. + * + * @return the properties value. + */ + RdsEventSubscriptionProperties properties(); + + /** + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the region of the resource. + * + * @return the region of the resource. + */ + Region region(); + + /** + * Gets the name of the resource region. + * + * @return the name of the resource region. + */ + String regionName(); + + /** + * Gets the name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + + /** + * Gets the inner com.azure.resourcemanager.awsconnector.fluent.models.RdsEventSubscriptionInner object. + * + * @return the inner object. + */ + RdsEventSubscriptionInner innerModel(); + + /** + * The entirety of the RdsEventSubscription definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithLocation, + DefinitionStages.WithResourceGroup, DefinitionStages.WithCreate { + } + + /** + * The RdsEventSubscription definition stages. + */ + interface DefinitionStages { + /** + * The first stage of the RdsEventSubscription definition. + */ + interface Blank extends WithLocation { + } + + /** + * The stage of the RdsEventSubscription definition allowing to specify location. + */ + interface WithLocation { + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithResourceGroup withRegion(Region location); + + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithResourceGroup withRegion(String location); + } + + /** + * The stage of the RdsEventSubscription definition allowing to specify parent resource. + */ + interface WithResourceGroup { + /** + * Specifies resourceGroupName. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @return the next definition stage. + */ + WithCreate withExistingResourceGroup(String resourceGroupName); + } + + /** + * The stage of the RdsEventSubscription 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.WithProperties { + /** + * Executes the create request. + * + * @return the created resource. + */ + RdsEventSubscription create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + RdsEventSubscription create(Context context); + } + + /** + * The stage of the RdsEventSubscription definition allowing to specify tags. + */ + interface WithTags { + /** + * Specifies the tags property: Resource tags.. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + WithCreate withTags(Map tags); + } + + /** + * The stage of the RdsEventSubscription definition allowing to specify properties. + */ + interface WithProperties { + /** + * Specifies the properties property: The resource-specific properties for this resource.. + * + * @param properties The resource-specific properties for this resource. + * @return the next definition stage. + */ + WithCreate withProperties(RdsEventSubscriptionProperties properties); + } + } + + /** + * Begins update for the RdsEventSubscription resource. + * + * @return the stage of resource update. + */ + RdsEventSubscription.Update update(); + + /** + * The template for RdsEventSubscription update. + */ + interface Update extends UpdateStages.WithTags { + /** + * Executes the update request. + * + * @return the updated resource. + */ + RdsEventSubscription apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + RdsEventSubscription apply(Context context); + } + + /** + * The RdsEventSubscription update stages. + */ + interface UpdateStages { + /** + * The stage of the RdsEventSubscription update allowing to specify tags. + */ + interface WithTags { + /** + * Specifies the tags property: Resource tags.. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + Update withTags(Map tags); + } + } + + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + RdsEventSubscription refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + RdsEventSubscription refresh(Context context); +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/RdsEventSubscriptionListResult.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/RdsEventSubscriptionListResult.java new file mode 100644 index 000000000000..737191eb2582 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/RdsEventSubscriptionListResult.java @@ -0,0 +1,137 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.awsconnector.fluent.models.RdsEventSubscriptionInner; +import java.io.IOException; +import java.util.List; + +/** + * The response of a RdsEventSubscription list operation. + */ +@Fluent +public final class RdsEventSubscriptionListResult implements JsonSerializable { + /* + * The RdsEventSubscription items on this page + */ + private List value; + + /* + * The link to the next page of items + */ + private String nextLink; + + /** + * Creates an instance of RdsEventSubscriptionListResult class. + */ + public RdsEventSubscriptionListResult() { + } + + /** + * Get the value property: The RdsEventSubscription items on this page. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The RdsEventSubscription items on this page. + * + * @param value the value value to set. + * @return the RdsEventSubscriptionListResult object itself. + */ + public RdsEventSubscriptionListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The link to the next page of items. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: The link to the next page of items. + * + * @param nextLink the nextLink value to set. + * @return the RdsEventSubscriptionListResult object itself. + */ + public RdsEventSubscriptionListResult withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property value in model RdsEventSubscriptionListResult")); + } else { + value().forEach(e -> e.validate()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(RdsEventSubscriptionListResult.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("nextLink", this.nextLink); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of RdsEventSubscriptionListResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of RdsEventSubscriptionListResult if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the RdsEventSubscriptionListResult. + */ + public static RdsEventSubscriptionListResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + RdsEventSubscriptionListResult deserializedRdsEventSubscriptionListResult + = new RdsEventSubscriptionListResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> RdsEventSubscriptionInner.fromJson(reader1)); + deserializedRdsEventSubscriptionListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedRdsEventSubscriptionListResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedRdsEventSubscriptionListResult; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/RdsEventSubscriptionProperties.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/RdsEventSubscriptionProperties.java new file mode 100644 index 000000000000..d150e6bda31d --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/RdsEventSubscriptionProperties.java @@ -0,0 +1,313 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.Map; + +/** + * Definition of RdsEventSubscription. + */ +@Fluent +public final class RdsEventSubscriptionProperties implements JsonSerializable { + /* + * AWS Properties + */ + private AwsRdsEventSubscriptionProperties awsProperties; + + /* + * Public Cloud Connectors Resource ID + */ + private String publicCloudConnectorsResourceId; + + /* + * AWS Account ID + */ + private String awsAccountId; + + /* + * Amazon Resource Name (ARN) + */ + private String arn; + + /* + * Public Cloud Resource Name + */ + private String publicCloudResourceName; + + /* + * AWS Source Schema + */ + private String awsSourceSchema; + + /* + * AWS Region + */ + private String awsRegion; + + /* + * AWS Tags + */ + private Map awsTags; + + /* + * The status of the last operation. + */ + private ProvisioningState provisioningState; + + /** + * Creates an instance of RdsEventSubscriptionProperties class. + */ + public RdsEventSubscriptionProperties() { + } + + /** + * Get the awsProperties property: AWS Properties. + * + * @return the awsProperties value. + */ + public AwsRdsEventSubscriptionProperties awsProperties() { + return this.awsProperties; + } + + /** + * Set the awsProperties property: AWS Properties. + * + * @param awsProperties the awsProperties value to set. + * @return the RdsEventSubscriptionProperties object itself. + */ + public RdsEventSubscriptionProperties withAwsProperties(AwsRdsEventSubscriptionProperties awsProperties) { + this.awsProperties = awsProperties; + return this; + } + + /** + * Get the publicCloudConnectorsResourceId property: Public Cloud Connectors Resource ID. + * + * @return the publicCloudConnectorsResourceId value. + */ + public String publicCloudConnectorsResourceId() { + return this.publicCloudConnectorsResourceId; + } + + /** + * Set the publicCloudConnectorsResourceId property: Public Cloud Connectors Resource ID. + * + * @param publicCloudConnectorsResourceId the publicCloudConnectorsResourceId value to set. + * @return the RdsEventSubscriptionProperties object itself. + */ + public RdsEventSubscriptionProperties withPublicCloudConnectorsResourceId(String publicCloudConnectorsResourceId) { + this.publicCloudConnectorsResourceId = publicCloudConnectorsResourceId; + return this; + } + + /** + * Get the awsAccountId property: AWS Account ID. + * + * @return the awsAccountId value. + */ + public String awsAccountId() { + return this.awsAccountId; + } + + /** + * Set the awsAccountId property: AWS Account ID. + * + * @param awsAccountId the awsAccountId value to set. + * @return the RdsEventSubscriptionProperties object itself. + */ + public RdsEventSubscriptionProperties withAwsAccountId(String awsAccountId) { + this.awsAccountId = awsAccountId; + return this; + } + + /** + * Get the arn property: Amazon Resource Name (ARN). + * + * @return the arn value. + */ + public String arn() { + return this.arn; + } + + /** + * Set the arn property: Amazon Resource Name (ARN). + * + * @param arn the arn value to set. + * @return the RdsEventSubscriptionProperties object itself. + */ + public RdsEventSubscriptionProperties withArn(String arn) { + this.arn = arn; + return this; + } + + /** + * Get the publicCloudResourceName property: Public Cloud Resource Name. + * + * @return the publicCloudResourceName value. + */ + public String publicCloudResourceName() { + return this.publicCloudResourceName; + } + + /** + * Set the publicCloudResourceName property: Public Cloud Resource Name. + * + * @param publicCloudResourceName the publicCloudResourceName value to set. + * @return the RdsEventSubscriptionProperties object itself. + */ + public RdsEventSubscriptionProperties withPublicCloudResourceName(String publicCloudResourceName) { + this.publicCloudResourceName = publicCloudResourceName; + return this; + } + + /** + * Get the awsSourceSchema property: AWS Source Schema. + * + * @return the awsSourceSchema value. + */ + public String awsSourceSchema() { + return this.awsSourceSchema; + } + + /** + * Set the awsSourceSchema property: AWS Source Schema. + * + * @param awsSourceSchema the awsSourceSchema value to set. + * @return the RdsEventSubscriptionProperties object itself. + */ + public RdsEventSubscriptionProperties withAwsSourceSchema(String awsSourceSchema) { + this.awsSourceSchema = awsSourceSchema; + return this; + } + + /** + * Get the awsRegion property: AWS Region. + * + * @return the awsRegion value. + */ + public String awsRegion() { + return this.awsRegion; + } + + /** + * Set the awsRegion property: AWS Region. + * + * @param awsRegion the awsRegion value to set. + * @return the RdsEventSubscriptionProperties object itself. + */ + public RdsEventSubscriptionProperties withAwsRegion(String awsRegion) { + this.awsRegion = awsRegion; + return this; + } + + /** + * Get the awsTags property: AWS Tags. + * + * @return the awsTags value. + */ + public Map awsTags() { + return this.awsTags; + } + + /** + * Set the awsTags property: AWS Tags. + * + * @param awsTags the awsTags value to set. + * @return the RdsEventSubscriptionProperties object itself. + */ + public RdsEventSubscriptionProperties withAwsTags(Map awsTags) { + this.awsTags = awsTags; + return this; + } + + /** + * Get the provisioningState property: The status of the last operation. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (awsProperties() != null) { + awsProperties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("awsProperties", this.awsProperties); + jsonWriter.writeStringField("publicCloudConnectorsResourceId", this.publicCloudConnectorsResourceId); + jsonWriter.writeStringField("awsAccountId", this.awsAccountId); + jsonWriter.writeStringField("arn", this.arn); + jsonWriter.writeStringField("publicCloudResourceName", this.publicCloudResourceName); + jsonWriter.writeStringField("awsSourceSchema", this.awsSourceSchema); + jsonWriter.writeStringField("awsRegion", this.awsRegion); + jsonWriter.writeMapField("awsTags", this.awsTags, (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of RdsEventSubscriptionProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of RdsEventSubscriptionProperties if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the RdsEventSubscriptionProperties. + */ + public static RdsEventSubscriptionProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + RdsEventSubscriptionProperties deserializedRdsEventSubscriptionProperties + = new RdsEventSubscriptionProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("awsProperties".equals(fieldName)) { + deserializedRdsEventSubscriptionProperties.awsProperties + = AwsRdsEventSubscriptionProperties.fromJson(reader); + } else if ("publicCloudConnectorsResourceId".equals(fieldName)) { + deserializedRdsEventSubscriptionProperties.publicCloudConnectorsResourceId = reader.getString(); + } else if ("awsAccountId".equals(fieldName)) { + deserializedRdsEventSubscriptionProperties.awsAccountId = reader.getString(); + } else if ("arn".equals(fieldName)) { + deserializedRdsEventSubscriptionProperties.arn = reader.getString(); + } else if ("publicCloudResourceName".equals(fieldName)) { + deserializedRdsEventSubscriptionProperties.publicCloudResourceName = reader.getString(); + } else if ("awsSourceSchema".equals(fieldName)) { + deserializedRdsEventSubscriptionProperties.awsSourceSchema = reader.getString(); + } else if ("awsRegion".equals(fieldName)) { + deserializedRdsEventSubscriptionProperties.awsRegion = reader.getString(); + } else if ("awsTags".equals(fieldName)) { + Map awsTags = reader.readMap(reader1 -> reader1.getString()); + deserializedRdsEventSubscriptionProperties.awsTags = awsTags; + } else if ("provisioningState".equals(fieldName)) { + deserializedRdsEventSubscriptionProperties.provisioningState + = ProvisioningState.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedRdsEventSubscriptionProperties; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/RdsEventSubscriptionTagsUpdate.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/RdsEventSubscriptionTagsUpdate.java new file mode 100644 index 000000000000..8672cefbeae7 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/RdsEventSubscriptionTagsUpdate.java @@ -0,0 +1,96 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.Map; + +/** + * The type used for updating tags in RdsEventSubscription resources. + */ +@Fluent +public final class RdsEventSubscriptionTagsUpdate implements JsonSerializable { + /* + * Resource tags. + */ + private Map tags; + + /** + * Creates an instance of RdsEventSubscriptionTagsUpdate class. + */ + public RdsEventSubscriptionTagsUpdate() { + } + + /** + * Get the tags property: Resource tags. + * + * @return the tags value. + */ + public Map tags() { + return this.tags; + } + + /** + * Set the tags property: Resource tags. + * + * @param tags the tags value to set. + * @return the RdsEventSubscriptionTagsUpdate object itself. + */ + public RdsEventSubscriptionTagsUpdate withTags(Map tags) { + this.tags = tags; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeMapField("tags", this.tags, (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of RdsEventSubscriptionTagsUpdate from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of RdsEventSubscriptionTagsUpdate if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the RdsEventSubscriptionTagsUpdate. + */ + public static RdsEventSubscriptionTagsUpdate fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + RdsEventSubscriptionTagsUpdate deserializedRdsEventSubscriptionTagsUpdate + = new RdsEventSubscriptionTagsUpdate(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedRdsEventSubscriptionTagsUpdate.tags = tags; + } else { + reader.skipChildren(); + } + } + + return deserializedRdsEventSubscriptionTagsUpdate; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/RdsEventSubscriptions.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/RdsEventSubscriptions.java new file mode 100644 index 000000000000..4cad6e256f46 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/RdsEventSubscriptions.java @@ -0,0 +1,158 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** + * Resource collection API of RdsEventSubscriptions. + */ +public interface RdsEventSubscriptions { + /** + * List RdsEventSubscription resources by subscription ID. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a RdsEventSubscription list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable list(); + + /** + * List RdsEventSubscription resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a RdsEventSubscription list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable list(Context context); + + /** + * List RdsEventSubscription resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a RdsEventSubscription list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * List RdsEventSubscription resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a RdsEventSubscription list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Get a RdsEventSubscription. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of RdsEventSubscription. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a RdsEventSubscription along with {@link Response}. + */ + Response getByResourceGroupWithResponse(String resourceGroupName, String name, + Context context); + + /** + * Get a RdsEventSubscription. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of RdsEventSubscription. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a RdsEventSubscription. + */ + RdsEventSubscription getByResourceGroup(String resourceGroupName, String name); + + /** + * Delete a RdsEventSubscription. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of RdsEventSubscription. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByResourceGroup(String resourceGroupName, String name); + + /** + * Delete a RdsEventSubscription. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of RdsEventSubscription. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String name, Context context); + + /** + * Get a RdsEventSubscription. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a RdsEventSubscription along with {@link Response}. + */ + RdsEventSubscription getById(String id); + + /** + * Get a RdsEventSubscription. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a RdsEventSubscription along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Delete a RdsEventSubscription. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteById(String id); + + /** + * Delete a RdsEventSubscription. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new RdsEventSubscription resource. + * + * @param name resource name. + * @return the first stage of the new RdsEventSubscription definition. + */ + RdsEventSubscription.DefinitionStages.Blank define(String name); +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/RdsExportTask.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/RdsExportTask.java new file mode 100644 index 000000000000..ee251f3a6bf9 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/RdsExportTask.java @@ -0,0 +1,252 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.awsconnector.fluent.models.RdsExportTaskInner; +import java.util.Map; + +/** + * An immutable client-side representation of RdsExportTask. + */ +public interface RdsExportTask { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the location property: The geo-location where the resource lives. + * + * @return the location value. + */ + String location(); + + /** + * Gets the tags property: Resource tags. + * + * @return the tags value. + */ + Map tags(); + + /** + * Gets the properties property: The resource-specific properties for this resource. + * + * @return the properties value. + */ + RdsExportTaskProperties properties(); + + /** + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the region of the resource. + * + * @return the region of the resource. + */ + Region region(); + + /** + * Gets the name of the resource region. + * + * @return the name of the resource region. + */ + String regionName(); + + /** + * Gets the name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + + /** + * Gets the inner com.azure.resourcemanager.awsconnector.fluent.models.RdsExportTaskInner object. + * + * @return the inner object. + */ + RdsExportTaskInner innerModel(); + + /** + * The entirety of the RdsExportTask definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithLocation, + DefinitionStages.WithResourceGroup, DefinitionStages.WithCreate { + } + + /** + * The RdsExportTask definition stages. + */ + interface DefinitionStages { + /** + * The first stage of the RdsExportTask definition. + */ + interface Blank extends WithLocation { + } + + /** + * The stage of the RdsExportTask definition allowing to specify location. + */ + interface WithLocation { + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithResourceGroup withRegion(Region location); + + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithResourceGroup withRegion(String location); + } + + /** + * The stage of the RdsExportTask definition allowing to specify parent resource. + */ + interface WithResourceGroup { + /** + * Specifies resourceGroupName. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @return the next definition stage. + */ + WithCreate withExistingResourceGroup(String resourceGroupName); + } + + /** + * The stage of the RdsExportTask 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.WithProperties { + /** + * Executes the create request. + * + * @return the created resource. + */ + RdsExportTask create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + RdsExportTask create(Context context); + } + + /** + * The stage of the RdsExportTask definition allowing to specify tags. + */ + interface WithTags { + /** + * Specifies the tags property: Resource tags.. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + WithCreate withTags(Map tags); + } + + /** + * The stage of the RdsExportTask definition allowing to specify properties. + */ + interface WithProperties { + /** + * Specifies the properties property: The resource-specific properties for this resource.. + * + * @param properties The resource-specific properties for this resource. + * @return the next definition stage. + */ + WithCreate withProperties(RdsExportTaskProperties properties); + } + } + + /** + * Begins update for the RdsExportTask resource. + * + * @return the stage of resource update. + */ + RdsExportTask.Update update(); + + /** + * The template for RdsExportTask update. + */ + interface Update extends UpdateStages.WithTags { + /** + * Executes the update request. + * + * @return the updated resource. + */ + RdsExportTask apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + RdsExportTask apply(Context context); + } + + /** + * The RdsExportTask update stages. + */ + interface UpdateStages { + /** + * The stage of the RdsExportTask update allowing to specify tags. + */ + interface WithTags { + /** + * Specifies the tags property: Resource tags.. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + Update withTags(Map tags); + } + } + + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + RdsExportTask refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + RdsExportTask refresh(Context context); +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/RdsExportTaskListResult.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/RdsExportTaskListResult.java new file mode 100644 index 000000000000..b1f77ccc9d25 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/RdsExportTaskListResult.java @@ -0,0 +1,134 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.awsconnector.fluent.models.RdsExportTaskInner; +import java.io.IOException; +import java.util.List; + +/** + * The response of a RdsExportTask list operation. + */ +@Fluent +public final class RdsExportTaskListResult implements JsonSerializable { + /* + * The RdsExportTask items on this page + */ + private List value; + + /* + * The link to the next page of items + */ + private String nextLink; + + /** + * Creates an instance of RdsExportTaskListResult class. + */ + public RdsExportTaskListResult() { + } + + /** + * Get the value property: The RdsExportTask items on this page. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The RdsExportTask items on this page. + * + * @param value the value value to set. + * @return the RdsExportTaskListResult object itself. + */ + public RdsExportTaskListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The link to the next page of items. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: The link to the next page of items. + * + * @param nextLink the nextLink value to set. + * @return the RdsExportTaskListResult object itself. + */ + public RdsExportTaskListResult withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property value in model RdsExportTaskListResult")); + } else { + value().forEach(e -> e.validate()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(RdsExportTaskListResult.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("nextLink", this.nextLink); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of RdsExportTaskListResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of RdsExportTaskListResult if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the RdsExportTaskListResult. + */ + public static RdsExportTaskListResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + RdsExportTaskListResult deserializedRdsExportTaskListResult = new RdsExportTaskListResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value = reader.readArray(reader1 -> RdsExportTaskInner.fromJson(reader1)); + deserializedRdsExportTaskListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedRdsExportTaskListResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedRdsExportTaskListResult; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/RdsExportTaskProperties.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/RdsExportTaskProperties.java new file mode 100644 index 000000000000..cc0d1853ee27 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/RdsExportTaskProperties.java @@ -0,0 +1,311 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.Map; + +/** + * Definition of RdsExportTask. + */ +@Fluent +public final class RdsExportTaskProperties implements JsonSerializable { + /* + * AWS Properties + */ + private AwsRdsExportTaskProperties awsProperties; + + /* + * Public Cloud Connectors Resource ID + */ + private String publicCloudConnectorsResourceId; + + /* + * AWS Account ID + */ + private String awsAccountId; + + /* + * Amazon Resource Name (ARN) + */ + private String arn; + + /* + * Public Cloud Resource Name + */ + private String publicCloudResourceName; + + /* + * AWS Source Schema + */ + private String awsSourceSchema; + + /* + * AWS Region + */ + private String awsRegion; + + /* + * AWS Tags + */ + private Map awsTags; + + /* + * The status of the last operation. + */ + private ProvisioningState provisioningState; + + /** + * Creates an instance of RdsExportTaskProperties class. + */ + public RdsExportTaskProperties() { + } + + /** + * Get the awsProperties property: AWS Properties. + * + * @return the awsProperties value. + */ + public AwsRdsExportTaskProperties awsProperties() { + return this.awsProperties; + } + + /** + * Set the awsProperties property: AWS Properties. + * + * @param awsProperties the awsProperties value to set. + * @return the RdsExportTaskProperties object itself. + */ + public RdsExportTaskProperties withAwsProperties(AwsRdsExportTaskProperties awsProperties) { + this.awsProperties = awsProperties; + return this; + } + + /** + * Get the publicCloudConnectorsResourceId property: Public Cloud Connectors Resource ID. + * + * @return the publicCloudConnectorsResourceId value. + */ + public String publicCloudConnectorsResourceId() { + return this.publicCloudConnectorsResourceId; + } + + /** + * Set the publicCloudConnectorsResourceId property: Public Cloud Connectors Resource ID. + * + * @param publicCloudConnectorsResourceId the publicCloudConnectorsResourceId value to set. + * @return the RdsExportTaskProperties object itself. + */ + public RdsExportTaskProperties withPublicCloudConnectorsResourceId(String publicCloudConnectorsResourceId) { + this.publicCloudConnectorsResourceId = publicCloudConnectorsResourceId; + return this; + } + + /** + * Get the awsAccountId property: AWS Account ID. + * + * @return the awsAccountId value. + */ + public String awsAccountId() { + return this.awsAccountId; + } + + /** + * Set the awsAccountId property: AWS Account ID. + * + * @param awsAccountId the awsAccountId value to set. + * @return the RdsExportTaskProperties object itself. + */ + public RdsExportTaskProperties withAwsAccountId(String awsAccountId) { + this.awsAccountId = awsAccountId; + return this; + } + + /** + * Get the arn property: Amazon Resource Name (ARN). + * + * @return the arn value. + */ + public String arn() { + return this.arn; + } + + /** + * Set the arn property: Amazon Resource Name (ARN). + * + * @param arn the arn value to set. + * @return the RdsExportTaskProperties object itself. + */ + public RdsExportTaskProperties withArn(String arn) { + this.arn = arn; + return this; + } + + /** + * Get the publicCloudResourceName property: Public Cloud Resource Name. + * + * @return the publicCloudResourceName value. + */ + public String publicCloudResourceName() { + return this.publicCloudResourceName; + } + + /** + * Set the publicCloudResourceName property: Public Cloud Resource Name. + * + * @param publicCloudResourceName the publicCloudResourceName value to set. + * @return the RdsExportTaskProperties object itself. + */ + public RdsExportTaskProperties withPublicCloudResourceName(String publicCloudResourceName) { + this.publicCloudResourceName = publicCloudResourceName; + return this; + } + + /** + * Get the awsSourceSchema property: AWS Source Schema. + * + * @return the awsSourceSchema value. + */ + public String awsSourceSchema() { + return this.awsSourceSchema; + } + + /** + * Set the awsSourceSchema property: AWS Source Schema. + * + * @param awsSourceSchema the awsSourceSchema value to set. + * @return the RdsExportTaskProperties object itself. + */ + public RdsExportTaskProperties withAwsSourceSchema(String awsSourceSchema) { + this.awsSourceSchema = awsSourceSchema; + return this; + } + + /** + * Get the awsRegion property: AWS Region. + * + * @return the awsRegion value. + */ + public String awsRegion() { + return this.awsRegion; + } + + /** + * Set the awsRegion property: AWS Region. + * + * @param awsRegion the awsRegion value to set. + * @return the RdsExportTaskProperties object itself. + */ + public RdsExportTaskProperties withAwsRegion(String awsRegion) { + this.awsRegion = awsRegion; + return this; + } + + /** + * Get the awsTags property: AWS Tags. + * + * @return the awsTags value. + */ + public Map awsTags() { + return this.awsTags; + } + + /** + * Set the awsTags property: AWS Tags. + * + * @param awsTags the awsTags value to set. + * @return the RdsExportTaskProperties object itself. + */ + public RdsExportTaskProperties withAwsTags(Map awsTags) { + this.awsTags = awsTags; + return this; + } + + /** + * Get the provisioningState property: The status of the last operation. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (awsProperties() != null) { + awsProperties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("awsProperties", this.awsProperties); + jsonWriter.writeStringField("publicCloudConnectorsResourceId", this.publicCloudConnectorsResourceId); + jsonWriter.writeStringField("awsAccountId", this.awsAccountId); + jsonWriter.writeStringField("arn", this.arn); + jsonWriter.writeStringField("publicCloudResourceName", this.publicCloudResourceName); + jsonWriter.writeStringField("awsSourceSchema", this.awsSourceSchema); + jsonWriter.writeStringField("awsRegion", this.awsRegion); + jsonWriter.writeMapField("awsTags", this.awsTags, (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of RdsExportTaskProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of RdsExportTaskProperties if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the RdsExportTaskProperties. + */ + public static RdsExportTaskProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + RdsExportTaskProperties deserializedRdsExportTaskProperties = new RdsExportTaskProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("awsProperties".equals(fieldName)) { + deserializedRdsExportTaskProperties.awsProperties = AwsRdsExportTaskProperties.fromJson(reader); + } else if ("publicCloudConnectorsResourceId".equals(fieldName)) { + deserializedRdsExportTaskProperties.publicCloudConnectorsResourceId = reader.getString(); + } else if ("awsAccountId".equals(fieldName)) { + deserializedRdsExportTaskProperties.awsAccountId = reader.getString(); + } else if ("arn".equals(fieldName)) { + deserializedRdsExportTaskProperties.arn = reader.getString(); + } else if ("publicCloudResourceName".equals(fieldName)) { + deserializedRdsExportTaskProperties.publicCloudResourceName = reader.getString(); + } else if ("awsSourceSchema".equals(fieldName)) { + deserializedRdsExportTaskProperties.awsSourceSchema = reader.getString(); + } else if ("awsRegion".equals(fieldName)) { + deserializedRdsExportTaskProperties.awsRegion = reader.getString(); + } else if ("awsTags".equals(fieldName)) { + Map awsTags = reader.readMap(reader1 -> reader1.getString()); + deserializedRdsExportTaskProperties.awsTags = awsTags; + } else if ("provisioningState".equals(fieldName)) { + deserializedRdsExportTaskProperties.provisioningState + = ProvisioningState.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedRdsExportTaskProperties; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/RdsExportTaskTagsUpdate.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/RdsExportTaskTagsUpdate.java new file mode 100644 index 000000000000..08863ac3cdd4 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/RdsExportTaskTagsUpdate.java @@ -0,0 +1,95 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.Map; + +/** + * The type used for updating tags in RdsExportTask resources. + */ +@Fluent +public final class RdsExportTaskTagsUpdate implements JsonSerializable { + /* + * Resource tags. + */ + private Map tags; + + /** + * Creates an instance of RdsExportTaskTagsUpdate class. + */ + public RdsExportTaskTagsUpdate() { + } + + /** + * Get the tags property: Resource tags. + * + * @return the tags value. + */ + public Map tags() { + return this.tags; + } + + /** + * Set the tags property: Resource tags. + * + * @param tags the tags value to set. + * @return the RdsExportTaskTagsUpdate object itself. + */ + public RdsExportTaskTagsUpdate withTags(Map tags) { + this.tags = tags; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeMapField("tags", this.tags, (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of RdsExportTaskTagsUpdate from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of RdsExportTaskTagsUpdate if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the RdsExportTaskTagsUpdate. + */ + public static RdsExportTaskTagsUpdate fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + RdsExportTaskTagsUpdate deserializedRdsExportTaskTagsUpdate = new RdsExportTaskTagsUpdate(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedRdsExportTaskTagsUpdate.tags = tags; + } else { + reader.skipChildren(); + } + } + + return deserializedRdsExportTaskTagsUpdate; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/RdsExportTasks.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/RdsExportTasks.java new file mode 100644 index 000000000000..7779cdf34ac3 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/RdsExportTasks.java @@ -0,0 +1,157 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** + * Resource collection API of RdsExportTasks. + */ +public interface RdsExportTasks { + /** + * List RdsExportTask resources by subscription ID. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a RdsExportTask list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable list(); + + /** + * List RdsExportTask resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a RdsExportTask list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable list(Context context); + + /** + * List RdsExportTask resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a RdsExportTask list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * List RdsExportTask resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a RdsExportTask list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Get a RdsExportTask. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of RdsExportTask. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a RdsExportTask along with {@link Response}. + */ + Response getByResourceGroupWithResponse(String resourceGroupName, String name, Context context); + + /** + * Get a RdsExportTask. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of RdsExportTask. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a RdsExportTask. + */ + RdsExportTask getByResourceGroup(String resourceGroupName, String name); + + /** + * Delete a RdsExportTask. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of RdsExportTask. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByResourceGroup(String resourceGroupName, String name); + + /** + * Delete a RdsExportTask. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of RdsExportTask. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String name, Context context); + + /** + * Get a RdsExportTask. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a RdsExportTask along with {@link Response}. + */ + RdsExportTask getById(String id); + + /** + * Get a RdsExportTask. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a RdsExportTask along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Delete a RdsExportTask. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteById(String id); + + /** + * Delete a RdsExportTask. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new RdsExportTask resource. + * + * @param name resource name. + * @return the first stage of the new RdsExportTask definition. + */ + RdsExportTask.DefinitionStages.Blank define(String name); +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ReadEndpoint.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ReadEndpoint.java new file mode 100644 index 000000000000..75491bde44a0 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ReadEndpoint.java @@ -0,0 +1,93 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of ReadEndpoint. + */ +@Fluent +public final class ReadEndpoint implements JsonSerializable { + /* + * The reader endpoint for the DB cluster. + */ + private String address; + + /** + * Creates an instance of ReadEndpoint class. + */ + public ReadEndpoint() { + } + + /** + * Get the address property: The reader endpoint for the DB cluster. + * + * @return the address value. + */ + public String address() { + return this.address; + } + + /** + * Set the address property: The reader endpoint for the DB cluster. + * + * @param address the address value to set. + * @return the ReadEndpoint object itself. + */ + public ReadEndpoint withAddress(String address) { + this.address = address; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("address", this.address); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ReadEndpoint from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ReadEndpoint if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the ReadEndpoint. + */ + public static ReadEndpoint fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ReadEndpoint deserializedReadEndpoint = new ReadEndpoint(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("address".equals(fieldName)) { + deserializedReadEndpoint.address = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedReadEndpoint; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/RecorderStatus.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/RecorderStatus.java new file mode 100644 index 000000000000..38033e6a8a9f --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/RecorderStatus.java @@ -0,0 +1,56 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * RecorderStatus enum. + */ +public final class RecorderStatus extends ExpandableStringEnum { + /** + * Static value Failure for RecorderStatus. + */ + public static final RecorderStatus FAILURE = fromString("Failure"); + + /** + * Static value Pending for RecorderStatus. + */ + public static final RecorderStatus PENDING = fromString("Pending"); + + /** + * Static value Success for RecorderStatus. + */ + public static final RecorderStatus SUCCESS = fromString("Success"); + + /** + * Creates a new instance of RecorderStatus value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public RecorderStatus() { + } + + /** + * Creates or finds a RecorderStatus from its string representation. + * + * @param name a name to look for. + * @return the corresponding RecorderStatus. + */ + public static RecorderStatus fromString(String name) { + return fromString(name, RecorderStatus.class); + } + + /** + * Gets known RecorderStatus values. + * + * @return known RecorderStatus values. + */ + public static Collection values() { + return values(RecorderStatus.class); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/RecorderStatusEnumValue.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/RecorderStatusEnumValue.java new file mode 100644 index 000000000000..e21c62a400b9 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/RecorderStatusEnumValue.java @@ -0,0 +1,93 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of RecorderStatusEnumValue. + */ +@Fluent +public final class RecorderStatusEnumValue implements JsonSerializable { + /* + * Property value + */ + private RecorderStatus value; + + /** + * Creates an instance of RecorderStatusEnumValue class. + */ + public RecorderStatusEnumValue() { + } + + /** + * Get the value property: Property value. + * + * @return the value value. + */ + public RecorderStatus value() { + return this.value; + } + + /** + * Set the value property: Property value. + * + * @param value the value value to set. + * @return the RecorderStatusEnumValue object itself. + */ + public RecorderStatusEnumValue withValue(RecorderStatus value) { + this.value = value; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("value", this.value == null ? null : this.value.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of RecorderStatusEnumValue from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of RecorderStatusEnumValue if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the RecorderStatusEnumValue. + */ + public static RecorderStatusEnumValue fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + RecorderStatusEnumValue deserializedRecorderStatusEnumValue = new RecorderStatusEnumValue(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + deserializedRecorderStatusEnumValue.value = RecorderStatus.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedRecorderStatusEnumValue; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/RecordingFrequency.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/RecordingFrequency.java new file mode 100644 index 000000000000..c47f909c94e5 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/RecordingFrequency.java @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * RecordingFrequency enum. + */ +public final class RecordingFrequency extends ExpandableStringEnum { + /** + * Static value CONTINUOUS for RecordingFrequency. + */ + public static final RecordingFrequency CONTINUOUS = fromString("CONTINUOUS"); + + /** + * Static value DAILY for RecordingFrequency. + */ + public static final RecordingFrequency DAILY = fromString("DAILY"); + + /** + * Creates a new instance of RecordingFrequency value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public RecordingFrequency() { + } + + /** + * Creates or finds a RecordingFrequency from its string representation. + * + * @param name a name to look for. + * @return the corresponding RecordingFrequency. + */ + public static RecordingFrequency fromString(String name) { + return fromString(name, RecordingFrequency.class); + } + + /** + * Gets known RecordingFrequency values. + * + * @return known RecordingFrequency values. + */ + public static Collection values() { + return values(RecordingFrequency.class); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/RecordingFrequencyEnumValue.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/RecordingFrequencyEnumValue.java new file mode 100644 index 000000000000..5565da47b3f4 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/RecordingFrequencyEnumValue.java @@ -0,0 +1,93 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of RecordingFrequencyEnumValue. + */ +@Fluent +public final class RecordingFrequencyEnumValue implements JsonSerializable { + /* + * Property value + */ + private RecordingFrequency value; + + /** + * Creates an instance of RecordingFrequencyEnumValue class. + */ + public RecordingFrequencyEnumValue() { + } + + /** + * Get the value property: Property value. + * + * @return the value value. + */ + public RecordingFrequency value() { + return this.value; + } + + /** + * Set the value property: Property value. + * + * @param value the value value to set. + * @return the RecordingFrequencyEnumValue object itself. + */ + public RecordingFrequencyEnumValue withValue(RecordingFrequency value) { + this.value = value; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("value", this.value == null ? null : this.value.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of RecordingFrequencyEnumValue from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of RecordingFrequencyEnumValue if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the RecordingFrequencyEnumValue. + */ + public static RecordingFrequencyEnumValue fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + RecordingFrequencyEnumValue deserializedRecordingFrequencyEnumValue = new RecordingFrequencyEnumValue(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + deserializedRecordingFrequencyEnumValue.value = RecordingFrequency.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedRecordingFrequencyEnumValue; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/RecordingGroup.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/RecordingGroup.java new file mode 100644 index 000000000000..470d4ee555ec --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/RecordingGroup.java @@ -0,0 +1,613 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Definition of RecordingGroup. + */ +@Fluent +public final class RecordingGroup implements JsonSerializable { + /* + *

Specifies whether Config records configuration changes for all supported resource types, excluding the global + * IAM resource types.

If you set this field to true, when Config adds support for a new + * resource type, Config starts recording resources of that type automatically.

If you set this field to + * true, you cannot enumerate specific resource types to record in the resourceTypes field + * of RecordingGroup, + * or to exclude in the resourceTypes field of + * ExclusionByResourceTypes.

Region availability

Check Resource + * Coverage by Region Availability to see if a resource type is supported in the Amazon Web Services Region + * where you set up Config.

+ */ + private Boolean allSupported; + + /* + *

An object that specifies how Config excludes resource types from being recorded by the configuration + * recorder.

Required fields

To use this option, you must set the useOnly + * field of RecordingStrategy to + * EXCLUSION_BY_RESOURCE_TYPES.

+ */ + private ExclusionByResourceTypes exclusionByResourceTypes; + + /* + *

This option is a bundle which only applies to the global IAM resource types: IAM users, groups, roles, and + * customer managed policies. These global IAM resource types can only be recorded by Config in Regions where Config + * was available before February 2022. You cannot be record the global IAM resouce types in Regions supported by + * Config after February 2022. This list where you cannot record the global IAM resource types includes the + * following Regions:

  • Asia Pacific (Hyderabad)

  • Asia Pacific (Melbourne)

  • + *
  • Canada West (Calgary)

  • Europe (Spain)

  • Europe (Zurich)

  • + *

    Israel (Tel Aviv)

  • Middle East (UAE)

Aurora global + * clusters are recorded in all enabled Regions

The AWS::RDS::GlobalCluster resource type + * will be recorded in all supported Config Regions where the configuration recorder is enabled, even if + * includeGlobalResourceTypes is setfalse. The includeGlobalResourceTypes + * option is a bundle which only applies to IAM users, groups, roles, and customer managed policies.

If you + * do not want to record AWS::RDS::GlobalCluster in all enabled Regions, use one of the following + * recording strategies:

  1. Record all current and future resource types with exclusions + * (EXCLUSION_BY_RESOURCE_TYPES), or

  2. Record specific resource types + * (INCLUSION_BY_RESOURCE_TYPES).

For more information, see + * Selecting Which Resources are Recorded in the Config developer guide.

+ * includeGlobalResourceTypes and the exclusion recording strategy

The + * includeGlobalResourceTypes field has no impact on the EXCLUSION_BY_RESOURCE_TYPES + * recording strategy. This means that the global IAM resource types (IAM users, groups, roles, and customer managed + * policies) will not be automatically added as exclusions for exclusionByResourceTypes when + * includeGlobalResourceTypes is set to false.

The + * includeGlobalResourceTypes field should only be used to modify the AllSupported field, + * as the default for the AllSupported field is to record configuration changes for all supported + * resource types excluding the global IAM resource types. To include the global IAM resource types when + * AllSupported is set to true, make sure to set includeGlobalResourceTypes + * to true.

To exclude the global IAM resource types for the + * EXCLUSION_BY_RESOURCE_TYPES recording strategy, you need to manually add them to the + * resourceTypes field of exclusionByResourceTypes.

+ * Required and optional fields

Before you set this field to true, set the + * allSupported field of RecordingGroup to + * true. Optionally, you can set the useOnly field of RecordingStrategy to + * ALL_SUPPORTED_RESOURCE_TYPES.

Overriding fields

If you set + * this field to false but list global IAM resource types in the resourceTypes field of RecordingGroup, Config + * will still record configuration changes for those specified resource types regardless of if you set the + * includeGlobalResourceTypes field to false.

If you do not want to record configuration changes + * to the global IAM resource types (IAM users, groups, roles, and customer managed policies), make sure to not list + * them in the resourceTypes field in addition to setting the includeGlobalResourceTypes + * field to false.

+ */ + private Boolean includeGlobalResourceTypes; + + /* + *

An object that specifies the recording strategy for the configuration recorder.

  • If you set + * the useOnly field of RecordingStrategy to + * ALL_SUPPORTED_RESOURCE_TYPES, Config records configuration changes for all supported resource types, + * excluding the global IAM resource types. You also must set the allSupported field of RecordingGroup to + * true. When Config adds support for a new resource type, Config automatically starts recording + * resources of that type.

  • If you set the useOnly field of RecordingStrategy to + * INCLUSION_BY_RESOURCE_TYPES, Config records configuration changes for only the resource types you + * specify in the resourceTypes field of RecordingGroup.

    + *
  • If you set the useOnly field of RecordingStrategy to + * EXCLUSION_BY_RESOURCE_TYPES, Config records configuration changes for all supported resource types + * except the resource types that you specify to exclude from being recorded in the resourceTypes field + * of + * ExclusionByResourceTypes.

Required and optional fields

The + * recordingStrategy field is optional when you set the allSupported field of RecordingGroup to + * true.

The recordingStrategy field is optional when you list resource types in + * the resourceTypes field of RecordingGroup.

+ *

The recordingStrategy field is required if you list resource types to exclude from recording in + * the resourceTypes field of + * ExclusionByResourceTypes.

Overriding fields

If you choose + * EXCLUSION_BY_RESOURCE_TYPES for the recording strategy, the exclusionByResourceTypes + * field will override other properties in the request.

For example, even if you set + * includeGlobalResourceTypes to false, global IAM resource types will still be automatically recorded + * in this option unless those resource types are specifically listed as exclusions in the + * resourceTypes field of exclusionByResourceTypes.

Global + * resources types and the resource exclusion recording strategy

By default, if you choose the + * EXCLUSION_BY_RESOURCE_TYPES recording strategy, when Config adds support for a new resource type in + * the Region where you set up the configuration recorder, including global resource types, Config starts recording + * resources of that type automatically.

Unless specifically listed as exclusions, + * AWS::RDS::GlobalCluster will be recorded automatically in all supported Config Regions were the + * configuration recorder is enabled.

IAM users, groups, roles, and customer managed policies will be + * recorded in the Region where you set up the configuration recorder if that is a Region where Config was available + * before February 2022. You cannot be record the global IAM resouce types in Regions supported by Config after + * February 2022. This list where you cannot record the global IAM resource types includes the following + * Regions:

  • Asia Pacific (Hyderabad)

  • Asia Pacific (Melbourne)

  • + *

    Canada West (Calgary)

  • Europe (Spain)

  • Europe (Zurich)

  • + *

    Israel (Tel Aviv)

  • Middle East (UAE)

+ */ + private RecordingStrategy recordingStrategy; + + /* + *

A comma-separated list that specifies which resource types Config records.

For a list of valid + * resourceTypes values, see the Resource Type Value column in Supported Amazon Web Services resource Types in the Config developer guide.

+ * Required and optional fields

Optionally, you can set the useOnly field of RecordingStrategy to + * INCLUSION_BY_RESOURCE_TYPES.

To record all configuration changes, set the + * allSupported field of RecordingGroup to + * true, and either omit this field or don't specify any resource types in this field. If you set the + * allSupported field to false and specify values for resourceTypes, when + * Config adds support for a new type of resource, it will not record resources of that type unless you manually add + * that type to your recording group.

Region availability

Before specifying a + * resource type for Config to track, check Resource + * Coverage by Region Availability to see if the resource type is supported in the Amazon Web Services Region + * where you set up Config. If a resource type is supported by Config in at least one Region, you can enable the + * recording of that resource type in all Regions supported by Config, even if the specified resource type is not + * supported in the Amazon Web Services Region where you set up Config.

+ */ + private List resourceTypes; + + /** + * Creates an instance of RecordingGroup class. + */ + public RecordingGroup() { + } + + /** + * Get the allSupported property: <p>Specifies whether Config records configuration changes for all supported + * resource types, excluding the global IAM resource types.</p> <p>If you set this field to + * <code>true</code>, when Config adds support for a new resource type, Config starts recording + * resources of that type automatically.</p> <p>If you set this field to <code>true</code>, + * you cannot enumerate specific resource types to record in the <code>resourceTypes</code> field of + * <a + * href='https://docs.aws.amazon.com/config/latest/APIReference/API_RecordingGroup.html'>RecordingGroup</a>, + * or to exclude in the <code>resourceTypes</code> field of <a + * href='https://docs.aws.amazon.com/config/latest/APIReference/API_ExclusionByResourceTypes.html'>ExclusionByResourceTypes</a>.</p> + * <note> <p> <b>Region availability</b> </p> <p>Check <a + * href='https://docs.aws.amazon.com/config/latest/developerguide/what-is-resource-config-coverage.html'>Resource + * Coverage by Region Availability</a> to see if a resource type is supported in the Amazon Web Services + * Region where you set up Config.</p> </note>. + * + * @return the allSupported value. + */ + public Boolean allSupported() { + return this.allSupported; + } + + /** + * Set the allSupported property: <p>Specifies whether Config records configuration changes for all supported + * resource types, excluding the global IAM resource types.</p> <p>If you set this field to + * <code>true</code>, when Config adds support for a new resource type, Config starts recording + * resources of that type automatically.</p> <p>If you set this field to <code>true</code>, + * you cannot enumerate specific resource types to record in the <code>resourceTypes</code> field of + * <a + * href='https://docs.aws.amazon.com/config/latest/APIReference/API_RecordingGroup.html'>RecordingGroup</a>, + * or to exclude in the <code>resourceTypes</code> field of <a + * href='https://docs.aws.amazon.com/config/latest/APIReference/API_ExclusionByResourceTypes.html'>ExclusionByResourceTypes</a>.</p> + * <note> <p> <b>Region availability</b> </p> <p>Check <a + * href='https://docs.aws.amazon.com/config/latest/developerguide/what-is-resource-config-coverage.html'>Resource + * Coverage by Region Availability</a> to see if a resource type is supported in the Amazon Web Services + * Region where you set up Config.</p> </note>. + * + * @param allSupported the allSupported value to set. + * @return the RecordingGroup object itself. + */ + public RecordingGroup withAllSupported(Boolean allSupported) { + this.allSupported = allSupported; + return this; + } + + /** + * Get the exclusionByResourceTypes property: <p>An object that specifies how Config excludes resource types + * from being recorded by the configuration recorder.</p> <note> <p> <b>Required + * fields</b> </p> <p>To use this option, you must set the <code>useOnly</code> field + * of <a + * href='https://docs.aws.amazon.com/config/latest/APIReference/API_RecordingStrategy.html'>RecordingStrategy</a> + * to <code>EXCLUSION_BY_RESOURCE_TYPES</code>.</p> </note>. + * + * @return the exclusionByResourceTypes value. + */ + public ExclusionByResourceTypes exclusionByResourceTypes() { + return this.exclusionByResourceTypes; + } + + /** + * Set the exclusionByResourceTypes property: <p>An object that specifies how Config excludes resource types + * from being recorded by the configuration recorder.</p> <note> <p> <b>Required + * fields</b> </p> <p>To use this option, you must set the <code>useOnly</code> field + * of <a + * href='https://docs.aws.amazon.com/config/latest/APIReference/API_RecordingStrategy.html'>RecordingStrategy</a> + * to <code>EXCLUSION_BY_RESOURCE_TYPES</code>.</p> </note>. + * + * @param exclusionByResourceTypes the exclusionByResourceTypes value to set. + * @return the RecordingGroup object itself. + */ + public RecordingGroup withExclusionByResourceTypes(ExclusionByResourceTypes exclusionByResourceTypes) { + this.exclusionByResourceTypes = exclusionByResourceTypes; + return this; + } + + /** + * Get the includeGlobalResourceTypes property: <p>This option is a bundle which only applies to the global + * IAM resource types: IAM users, groups, roles, and customer managed policies. These global IAM resource types can + * only be recorded by Config in Regions where Config was available before February 2022. You cannot be record the + * global IAM resouce types in Regions supported by Config after February 2022. This list where you cannot record + * the global IAM resource types includes the following Regions:</p> <ul> <li> <p>Asia + * Pacific (Hyderabad)</p> </li> <li> <p>Asia Pacific (Melbourne)</p> </li> + * <li> <p>Canada West (Calgary)</p> </li> <li> <p>Europe (Spain)</p> + * </li> <li> <p>Europe (Zurich)</p> </li> <li> <p>Israel (Tel + * Aviv)</p> </li> <li> <p>Middle East (UAE)</p> </li> </ul> + * <important> <p> <b>Aurora global clusters are recorded in all enabled Regions</b> + * </p> <p>The <code>AWS::RDS::GlobalCluster</code> resource type will be recorded in all + * supported Config Regions where the configuration recorder is enabled, even if + * <code>includeGlobalResourceTypes</code> is set<code>false</code>. The + * <code>includeGlobalResourceTypes</code> option is a bundle which only applies to IAM users, groups, + * roles, and customer managed policies. </p> <p>If you do not want to record + * <code>AWS::RDS::GlobalCluster</code> in all enabled Regions, use one of the following recording + * strategies:</p> <ol> <li> <p> <b>Record all current and future resource types with + * exclusions</b> (<code>EXCLUSION_BY_RESOURCE_TYPES</code>), or</p> </li> <li> + * <p> <b>Record specific resource types</b> + * (<code>INCLUSION_BY_RESOURCE_TYPES</code>).</p> </li> </ol> <p>For more + * information, see <a + * href='https://docs.aws.amazon.com/config/latest/developerguide/select-resources.html#select-resources-all'>Selecting + * Which Resources are Recorded</a> in the <i>Config developer guide</i>.</p> + * </important> <important> <p> <b>includeGlobalResourceTypes and the exclusion recording + * strategy</b> </p> <p>The <code>includeGlobalResourceTypes</code> field has no + * impact on the <code>EXCLUSION_BY_RESOURCE_TYPES</code> recording strategy. This means that the global + * IAM resource types (IAM users, groups, roles, and customer managed policies) will not be automatically added as + * exclusions for <code>exclusionByResourceTypes</code> when + * <code>includeGlobalResourceTypes</code> is set to <code>false</code>.</p> + * <p>The <code>includeGlobalResourceTypes</code> field should only be used to modify the + * <code>AllSupported</code> field, as the default for the <code>AllSupported</code> field + * is to record configuration changes for all supported resource types excluding the global IAM resource types. To + * include the global IAM resource types when <code>AllSupported</code> is set to + * <code>true</code>, make sure to set <code>includeGlobalResourceTypes</code> to + * <code>true</code>.</p> <p>To exclude the global IAM resource types for the + * <code>EXCLUSION_BY_RESOURCE_TYPES</code> recording strategy, you need to manually add them to the + * <code>resourceTypes</code> field of <code>exclusionByResourceTypes</code>.</p> + * </important> <note> <p> <b>Required and optional fields</b> </p> + * <p>Before you set this field to <code>true</code>, set the + * <code>allSupported</code> field of <a + * href='https://docs.aws.amazon.com/config/latest/APIReference/API_RecordingGroup.html'>RecordingGroup</a> + * to <code>true</code>. Optionally, you can set the <code>useOnly</code> field of <a + * href='https://docs.aws.amazon.com/config/latest/APIReference/API_RecordingStrategy.html'>RecordingStrategy</a> + * to <code>ALL_SUPPORTED_RESOURCE_TYPES</code>.</p> </note> <note> <p> + * <b>Overriding fields</b> </p> <p>If you set this field to <code>false</code> + * but list global IAM resource types in the <code>resourceTypes</code> field of <a + * href='https://docs.aws.amazon.com/config/latest/APIReference/API_RecordingGroup.html'>RecordingGroup</a>, + * Config will still record configuration changes for those specified resource types <i>regardless</i> + * of if you set the <code>includeGlobalResourceTypes</code> field to false.</p> <p>If you + * do not want to record configuration changes to the global IAM resource types (IAM users, groups, roles, and + * customer managed policies), make sure to not list them in the <code>resourceTypes</code> field in + * addition to setting the <code>includeGlobalResourceTypes</code> field to false.</p> + * </note>. + * + * @return the includeGlobalResourceTypes value. + */ + public Boolean includeGlobalResourceTypes() { + return this.includeGlobalResourceTypes; + } + + /** + * Set the includeGlobalResourceTypes property: <p>This option is a bundle which only applies to the global + * IAM resource types: IAM users, groups, roles, and customer managed policies. These global IAM resource types can + * only be recorded by Config in Regions where Config was available before February 2022. You cannot be record the + * global IAM resouce types in Regions supported by Config after February 2022. This list where you cannot record + * the global IAM resource types includes the following Regions:</p> <ul> <li> <p>Asia + * Pacific (Hyderabad)</p> </li> <li> <p>Asia Pacific (Melbourne)</p> </li> + * <li> <p>Canada West (Calgary)</p> </li> <li> <p>Europe (Spain)</p> + * </li> <li> <p>Europe (Zurich)</p> </li> <li> <p>Israel (Tel + * Aviv)</p> </li> <li> <p>Middle East (UAE)</p> </li> </ul> + * <important> <p> <b>Aurora global clusters are recorded in all enabled Regions</b> + * </p> <p>The <code>AWS::RDS::GlobalCluster</code> resource type will be recorded in all + * supported Config Regions where the configuration recorder is enabled, even if + * <code>includeGlobalResourceTypes</code> is set<code>false</code>. The + * <code>includeGlobalResourceTypes</code> option is a bundle which only applies to IAM users, groups, + * roles, and customer managed policies. </p> <p>If you do not want to record + * <code>AWS::RDS::GlobalCluster</code> in all enabled Regions, use one of the following recording + * strategies:</p> <ol> <li> <p> <b>Record all current and future resource types with + * exclusions</b> (<code>EXCLUSION_BY_RESOURCE_TYPES</code>), or</p> </li> <li> + * <p> <b>Record specific resource types</b> + * (<code>INCLUSION_BY_RESOURCE_TYPES</code>).</p> </li> </ol> <p>For more + * information, see <a + * href='https://docs.aws.amazon.com/config/latest/developerguide/select-resources.html#select-resources-all'>Selecting + * Which Resources are Recorded</a> in the <i>Config developer guide</i>.</p> + * </important> <important> <p> <b>includeGlobalResourceTypes and the exclusion recording + * strategy</b> </p> <p>The <code>includeGlobalResourceTypes</code> field has no + * impact on the <code>EXCLUSION_BY_RESOURCE_TYPES</code> recording strategy. This means that the global + * IAM resource types (IAM users, groups, roles, and customer managed policies) will not be automatically added as + * exclusions for <code>exclusionByResourceTypes</code> when + * <code>includeGlobalResourceTypes</code> is set to <code>false</code>.</p> + * <p>The <code>includeGlobalResourceTypes</code> field should only be used to modify the + * <code>AllSupported</code> field, as the default for the <code>AllSupported</code> field + * is to record configuration changes for all supported resource types excluding the global IAM resource types. To + * include the global IAM resource types when <code>AllSupported</code> is set to + * <code>true</code>, make sure to set <code>includeGlobalResourceTypes</code> to + * <code>true</code>.</p> <p>To exclude the global IAM resource types for the + * <code>EXCLUSION_BY_RESOURCE_TYPES</code> recording strategy, you need to manually add them to the + * <code>resourceTypes</code> field of <code>exclusionByResourceTypes</code>.</p> + * </important> <note> <p> <b>Required and optional fields</b> </p> + * <p>Before you set this field to <code>true</code>, set the + * <code>allSupported</code> field of <a + * href='https://docs.aws.amazon.com/config/latest/APIReference/API_RecordingGroup.html'>RecordingGroup</a> + * to <code>true</code>. Optionally, you can set the <code>useOnly</code> field of <a + * href='https://docs.aws.amazon.com/config/latest/APIReference/API_RecordingStrategy.html'>RecordingStrategy</a> + * to <code>ALL_SUPPORTED_RESOURCE_TYPES</code>.</p> </note> <note> <p> + * <b>Overriding fields</b> </p> <p>If you set this field to <code>false</code> + * but list global IAM resource types in the <code>resourceTypes</code> field of <a + * href='https://docs.aws.amazon.com/config/latest/APIReference/API_RecordingGroup.html'>RecordingGroup</a>, + * Config will still record configuration changes for those specified resource types <i>regardless</i> + * of if you set the <code>includeGlobalResourceTypes</code> field to false.</p> <p>If you + * do not want to record configuration changes to the global IAM resource types (IAM users, groups, roles, and + * customer managed policies), make sure to not list them in the <code>resourceTypes</code> field in + * addition to setting the <code>includeGlobalResourceTypes</code> field to false.</p> + * </note>. + * + * @param includeGlobalResourceTypes the includeGlobalResourceTypes value to set. + * @return the RecordingGroup object itself. + */ + public RecordingGroup withIncludeGlobalResourceTypes(Boolean includeGlobalResourceTypes) { + this.includeGlobalResourceTypes = includeGlobalResourceTypes; + return this; + } + + /** + * Get the recordingStrategy property: <p>An object that specifies the recording strategy for the + * configuration recorder.</p> <ul> <li> <p>If you set the <code>useOnly</code> + * field of <a + * href='https://docs.aws.amazon.com/config/latest/APIReference/API_RecordingStrategy.html'>RecordingStrategy</a> + * to <code>ALL_SUPPORTED_RESOURCE_TYPES</code>, Config records configuration changes for all supported + * resource types, excluding the global IAM resource types. You also must set the + * <code>allSupported</code> field of <a + * href='https://docs.aws.amazon.com/config/latest/APIReference/API_RecordingGroup.html'>RecordingGroup</a> + * to <code>true</code>. When Config adds support for a new resource type, Config automatically starts + * recording resources of that type.</p> </li> <li> <p>If you set the + * <code>useOnly</code> field of <a + * href='https://docs.aws.amazon.com/config/latest/APIReference/API_RecordingStrategy.html'>RecordingStrategy</a> + * to <code>INCLUSION_BY_RESOURCE_TYPES</code>, Config records configuration changes for only the + * resource types you specify in the <code>resourceTypes</code> field of <a + * href='https://docs.aws.amazon.com/config/latest/APIReference/API_RecordingGroup.html'>RecordingGroup</a>.</p> + * </li> <li> <p>If you set the <code>useOnly</code> field of <a + * href='https://docs.aws.amazon.com/config/latest/APIReference/API_RecordingStrategy.html'>RecordingStrategy</a> + * to <code>EXCLUSION_BY_RESOURCE_TYPES</code>, Config records configuration changes for all supported + * resource types except the resource types that you specify to exclude from being recorded in the + * <code>resourceTypes</code> field of <a + * href='https://docs.aws.amazon.com/config/latest/APIReference/API_ExclusionByResourceTypes.html'>ExclusionByResourceTypes</a>.</p> + * </li> </ul> <note> <p> <b>Required and optional fields</b> </p> + * <p>The <code>recordingStrategy</code> field is optional when you set the + * <code>allSupported</code> field of <a + * href='https://docs.aws.amazon.com/config/latest/APIReference/API_RecordingGroup.html'>RecordingGroup</a> + * to <code>true</code>.</p> <p>The <code>recordingStrategy</code> field is + * optional when you list resource types in the <code>resourceTypes</code> field of <a + * href='https://docs.aws.amazon.com/config/latest/APIReference/API_RecordingGroup.html'>RecordingGroup</a>.</p> + * <p>The <code>recordingStrategy</code> field is required if you list resource types to exclude + * from recording in the <code>resourceTypes</code> field of <a + * href='https://docs.aws.amazon.com/config/latest/APIReference/API_ExclusionByResourceTypes.html'>ExclusionByResourceTypes</a>.</p> + * </note> <note> <p> <b>Overriding fields</b> </p> <p>If you choose + * <code>EXCLUSION_BY_RESOURCE_TYPES</code> for the recording strategy, the + * <code>exclusionByResourceTypes</code> field will override other properties in the request.</p> + * <p>For example, even if you set <code>includeGlobalResourceTypes</code> to false, global IAM + * resource types will still be automatically recorded in this option unless those resource types are specifically + * listed as exclusions in the <code>resourceTypes</code> field of + * <code>exclusionByResourceTypes</code>.</p> </note> <note> <p> <b>Global + * resources types and the resource exclusion recording strategy</b> </p> <p>By default, if you + * choose the <code>EXCLUSION_BY_RESOURCE_TYPES</code> recording strategy, when Config adds support for + * a new resource type in the Region where you set up the configuration recorder, including global resource types, + * Config starts recording resources of that type automatically.</p> <p>Unless specifically listed as + * exclusions, <code>AWS::RDS::GlobalCluster</code> will be recorded automatically in all supported + * Config Regions were the configuration recorder is enabled.</p> <p>IAM users, groups, roles, and + * customer managed policies will be recorded in the Region where you set up the configuration recorder if that is a + * Region where Config was available before February 2022. You cannot be record the global IAM resouce types in + * Regions supported by Config after February 2022. This list where you cannot record the global IAM resource types + * includes the following Regions:</p> <ul> <li> <p>Asia Pacific (Hyderabad)</p> + * </li> <li> <p>Asia Pacific (Melbourne)</p> </li> <li> <p>Canada West + * (Calgary)</p> </li> <li> <p>Europe (Spain)</p> </li> <li> + * <p>Europe (Zurich)</p> </li> <li> <p>Israel (Tel Aviv)</p> </li> + * <li> <p>Middle East (UAE)</p> </li> </ul> </note>. + * + * @return the recordingStrategy value. + */ + public RecordingStrategy recordingStrategy() { + return this.recordingStrategy; + } + + /** + * Set the recordingStrategy property: <p>An object that specifies the recording strategy for the + * configuration recorder.</p> <ul> <li> <p>If you set the <code>useOnly</code> + * field of <a + * href='https://docs.aws.amazon.com/config/latest/APIReference/API_RecordingStrategy.html'>RecordingStrategy</a> + * to <code>ALL_SUPPORTED_RESOURCE_TYPES</code>, Config records configuration changes for all supported + * resource types, excluding the global IAM resource types. You also must set the + * <code>allSupported</code> field of <a + * href='https://docs.aws.amazon.com/config/latest/APIReference/API_RecordingGroup.html'>RecordingGroup</a> + * to <code>true</code>. When Config adds support for a new resource type, Config automatically starts + * recording resources of that type.</p> </li> <li> <p>If you set the + * <code>useOnly</code> field of <a + * href='https://docs.aws.amazon.com/config/latest/APIReference/API_RecordingStrategy.html'>RecordingStrategy</a> + * to <code>INCLUSION_BY_RESOURCE_TYPES</code>, Config records configuration changes for only the + * resource types you specify in the <code>resourceTypes</code> field of <a + * href='https://docs.aws.amazon.com/config/latest/APIReference/API_RecordingGroup.html'>RecordingGroup</a>.</p> + * </li> <li> <p>If you set the <code>useOnly</code> field of <a + * href='https://docs.aws.amazon.com/config/latest/APIReference/API_RecordingStrategy.html'>RecordingStrategy</a> + * to <code>EXCLUSION_BY_RESOURCE_TYPES</code>, Config records configuration changes for all supported + * resource types except the resource types that you specify to exclude from being recorded in the + * <code>resourceTypes</code> field of <a + * href='https://docs.aws.amazon.com/config/latest/APIReference/API_ExclusionByResourceTypes.html'>ExclusionByResourceTypes</a>.</p> + * </li> </ul> <note> <p> <b>Required and optional fields</b> </p> + * <p>The <code>recordingStrategy</code> field is optional when you set the + * <code>allSupported</code> field of <a + * href='https://docs.aws.amazon.com/config/latest/APIReference/API_RecordingGroup.html'>RecordingGroup</a> + * to <code>true</code>.</p> <p>The <code>recordingStrategy</code> field is + * optional when you list resource types in the <code>resourceTypes</code> field of <a + * href='https://docs.aws.amazon.com/config/latest/APIReference/API_RecordingGroup.html'>RecordingGroup</a>.</p> + * <p>The <code>recordingStrategy</code> field is required if you list resource types to exclude + * from recording in the <code>resourceTypes</code> field of <a + * href='https://docs.aws.amazon.com/config/latest/APIReference/API_ExclusionByResourceTypes.html'>ExclusionByResourceTypes</a>.</p> + * </note> <note> <p> <b>Overriding fields</b> </p> <p>If you choose + * <code>EXCLUSION_BY_RESOURCE_TYPES</code> for the recording strategy, the + * <code>exclusionByResourceTypes</code> field will override other properties in the request.</p> + * <p>For example, even if you set <code>includeGlobalResourceTypes</code> to false, global IAM + * resource types will still be automatically recorded in this option unless those resource types are specifically + * listed as exclusions in the <code>resourceTypes</code> field of + * <code>exclusionByResourceTypes</code>.</p> </note> <note> <p> <b>Global + * resources types and the resource exclusion recording strategy</b> </p> <p>By default, if you + * choose the <code>EXCLUSION_BY_RESOURCE_TYPES</code> recording strategy, when Config adds support for + * a new resource type in the Region where you set up the configuration recorder, including global resource types, + * Config starts recording resources of that type automatically.</p> <p>Unless specifically listed as + * exclusions, <code>AWS::RDS::GlobalCluster</code> will be recorded automatically in all supported + * Config Regions were the configuration recorder is enabled.</p> <p>IAM users, groups, roles, and + * customer managed policies will be recorded in the Region where you set up the configuration recorder if that is a + * Region where Config was available before February 2022. You cannot be record the global IAM resouce types in + * Regions supported by Config after February 2022. This list where you cannot record the global IAM resource types + * includes the following Regions:</p> <ul> <li> <p>Asia Pacific (Hyderabad)</p> + * </li> <li> <p>Asia Pacific (Melbourne)</p> </li> <li> <p>Canada West + * (Calgary)</p> </li> <li> <p>Europe (Spain)</p> </li> <li> + * <p>Europe (Zurich)</p> </li> <li> <p>Israel (Tel Aviv)</p> </li> + * <li> <p>Middle East (UAE)</p> </li> </ul> </note>. + * + * @param recordingStrategy the recordingStrategy value to set. + * @return the RecordingGroup object itself. + */ + public RecordingGroup withRecordingStrategy(RecordingStrategy recordingStrategy) { + this.recordingStrategy = recordingStrategy; + return this; + } + + /** + * Get the resourceTypes property: <p>A comma-separated list that specifies which resource types Config + * records.</p> <p>For a list of valid <code>resourceTypes</code> values, see the + * <b>Resource Type Value</b> column in <a + * href='https://docs.aws.amazon.com/config/latest/developerguide/resource-config-reference.html#supported-resources'>Supported + * Amazon Web Services resource Types</a> in the <i>Config developer guide</i>.</p> + * <note> <p> <b>Required and optional fields</b> </p> <p>Optionally, you can + * set the <code>useOnly</code> field of <a + * href='https://docs.aws.amazon.com/config/latest/APIReference/API_RecordingStrategy.html'>RecordingStrategy</a> + * to <code>INCLUSION_BY_RESOURCE_TYPES</code>.</p> <p>To record all configuration changes, + * set the <code>allSupported</code> field of <a + * href='https://docs.aws.amazon.com/config/latest/APIReference/API_RecordingGroup.html'>RecordingGroup</a> + * to <code>true</code>, and either omit this field or don't specify any resource types in this field. + * If you set the <code>allSupported</code> field to <code>false</code> and specify values + * for <code>resourceTypes</code>, when Config adds support for a new type of resource, it will not + * record resources of that type unless you manually add that type to your recording group.</p> </note> + * <note> <p> <b>Region availability</b> </p> <p>Before specifying a resource + * type for Config to track, check <a + * href='https://docs.aws.amazon.com/config/latest/developerguide/what-is-resource-config-coverage.html'>Resource + * Coverage by Region Availability</a> to see if the resource type is supported in the Amazon Web Services + * Region where you set up Config. If a resource type is supported by Config in at least one Region, you can enable + * the recording of that resource type in all Regions supported by Config, even if the specified resource type is + * not supported in the Amazon Web Services Region where you set up Config.</p> </note>. + * + * @return the resourceTypes value. + */ + public List resourceTypes() { + return this.resourceTypes; + } + + /** + * Set the resourceTypes property: <p>A comma-separated list that specifies which resource types Config + * records.</p> <p>For a list of valid <code>resourceTypes</code> values, see the + * <b>Resource Type Value</b> column in <a + * href='https://docs.aws.amazon.com/config/latest/developerguide/resource-config-reference.html#supported-resources'>Supported + * Amazon Web Services resource Types</a> in the <i>Config developer guide</i>.</p> + * <note> <p> <b>Required and optional fields</b> </p> <p>Optionally, you can + * set the <code>useOnly</code> field of <a + * href='https://docs.aws.amazon.com/config/latest/APIReference/API_RecordingStrategy.html'>RecordingStrategy</a> + * to <code>INCLUSION_BY_RESOURCE_TYPES</code>.</p> <p>To record all configuration changes, + * set the <code>allSupported</code> field of <a + * href='https://docs.aws.amazon.com/config/latest/APIReference/API_RecordingGroup.html'>RecordingGroup</a> + * to <code>true</code>, and either omit this field or don't specify any resource types in this field. + * If you set the <code>allSupported</code> field to <code>false</code> and specify values + * for <code>resourceTypes</code>, when Config adds support for a new type of resource, it will not + * record resources of that type unless you manually add that type to your recording group.</p> </note> + * <note> <p> <b>Region availability</b> </p> <p>Before specifying a resource + * type for Config to track, check <a + * href='https://docs.aws.amazon.com/config/latest/developerguide/what-is-resource-config-coverage.html'>Resource + * Coverage by Region Availability</a> to see if the resource type is supported in the Amazon Web Services + * Region where you set up Config. If a resource type is supported by Config in at least one Region, you can enable + * the recording of that resource type in all Regions supported by Config, even if the specified resource type is + * not supported in the Amazon Web Services Region where you set up Config.</p> </note>. + * + * @param resourceTypes the resourceTypes value to set. + * @return the RecordingGroup object itself. + */ + public RecordingGroup withResourceTypes(List resourceTypes) { + this.resourceTypes = resourceTypes; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (exclusionByResourceTypes() != null) { + exclusionByResourceTypes().validate(); + } + if (recordingStrategy() != null) { + recordingStrategy().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeBooleanField("allSupported", this.allSupported); + jsonWriter.writeJsonField("exclusionByResourceTypes", this.exclusionByResourceTypes); + jsonWriter.writeBooleanField("includeGlobalResourceTypes", this.includeGlobalResourceTypes); + jsonWriter.writeJsonField("recordingStrategy", this.recordingStrategy); + jsonWriter.writeArrayField("resourceTypes", this.resourceTypes, + (writer, element) -> writer.writeString(element == null ? null : element.toString())); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of RecordingGroup from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of RecordingGroup if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the RecordingGroup. + */ + public static RecordingGroup fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + RecordingGroup deserializedRecordingGroup = new RecordingGroup(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("allSupported".equals(fieldName)) { + deserializedRecordingGroup.allSupported = reader.getNullable(JsonReader::getBoolean); + } else if ("exclusionByResourceTypes".equals(fieldName)) { + deserializedRecordingGroup.exclusionByResourceTypes = ExclusionByResourceTypes.fromJson(reader); + } else if ("includeGlobalResourceTypes".equals(fieldName)) { + deserializedRecordingGroup.includeGlobalResourceTypes = reader.getNullable(JsonReader::getBoolean); + } else if ("recordingStrategy".equals(fieldName)) { + deserializedRecordingGroup.recordingStrategy = RecordingStrategy.fromJson(reader); + } else if ("resourceTypes".equals(fieldName)) { + List resourceTypes + = reader.readArray(reader1 -> ResourceType.fromString(reader1.getString())); + deserializedRecordingGroup.resourceTypes = resourceTypes; + } else { + reader.skipChildren(); + } + } + + return deserializedRecordingGroup; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/RecordingMode.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/RecordingMode.java new file mode 100644 index 000000000000..9a1b7271a5d7 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/RecordingMode.java @@ -0,0 +1,164 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Definition of RecordingMode. + */ +@Fluent +public final class RecordingMode implements JsonSerializable { + /* + *

The default recording frequency that Config uses to record configuration changes.

Daily + * recording is not supported for the following resource types:

  • + * AWS::Config::ResourceCompliance

  • + * AWS::Config::ConformancePackCompliance

  • + * AWS::Config::ConfigurationRecorder

For the allSupported + * (ALL_SUPPORTED_RESOURCE_TYPES) recording strategy, these resource types will be set to Continuous + * recording.

+ */ + private RecordingFrequencyEnumValue recordingFrequency; + + /* + *

An array of recordingModeOverride objects for you to specify your overrides for the recording + * mode. The recordingModeOverride object in the recordingModeOverrides array consists of + * three fields: a description, the new recordingFrequency, and an array of + * resourceTypes to override.

+ */ + private List recordingModeOverrides; + + /** + * Creates an instance of RecordingMode class. + */ + public RecordingMode() { + } + + /** + * Get the recordingFrequency property: <p>The default recording frequency that Config uses to record + * configuration changes.</p> <important> <p>Daily recording is not supported for the following + * resource types:</p> <ul> <li> <p> + * <code>AWS::Config::ResourceCompliance</code> </p> </li> <li> <p> + * <code>AWS::Config::ConformancePackCompliance</code> </p> </li> <li> <p> + * <code>AWS::Config::ConfigurationRecorder</code> </p> </li> </ul> <p>For the + * <b>allSupported</b> (<code>ALL_SUPPORTED_RESOURCE_TYPES</code>) recording strategy, these + * resource types will be set to Continuous recording.</p> </important>. + * + * @return the recordingFrequency value. + */ + public RecordingFrequencyEnumValue recordingFrequency() { + return this.recordingFrequency; + } + + /** + * Set the recordingFrequency property: <p>The default recording frequency that Config uses to record + * configuration changes.</p> <important> <p>Daily recording is not supported for the following + * resource types:</p> <ul> <li> <p> + * <code>AWS::Config::ResourceCompliance</code> </p> </li> <li> <p> + * <code>AWS::Config::ConformancePackCompliance</code> </p> </li> <li> <p> + * <code>AWS::Config::ConfigurationRecorder</code> </p> </li> </ul> <p>For the + * <b>allSupported</b> (<code>ALL_SUPPORTED_RESOURCE_TYPES</code>) recording strategy, these + * resource types will be set to Continuous recording.</p> </important>. + * + * @param recordingFrequency the recordingFrequency value to set. + * @return the RecordingMode object itself. + */ + public RecordingMode withRecordingFrequency(RecordingFrequencyEnumValue recordingFrequency) { + this.recordingFrequency = recordingFrequency; + return this; + } + + /** + * Get the recordingModeOverrides property: <p>An array of <code>recordingModeOverride</code> + * objects for you to specify your overrides for the recording mode. The + * <code>recordingModeOverride</code> object in the <code>recordingModeOverrides</code> + * array consists of three fields: a <code>description</code>, the new + * <code>recordingFrequency</code>, and an array of <code>resourceTypes</code> to + * override.</p>. + * + * @return the recordingModeOverrides value. + */ + public List recordingModeOverrides() { + return this.recordingModeOverrides; + } + + /** + * Set the recordingModeOverrides property: <p>An array of <code>recordingModeOverride</code> + * objects for you to specify your overrides for the recording mode. The + * <code>recordingModeOverride</code> object in the <code>recordingModeOverrides</code> + * array consists of three fields: a <code>description</code>, the new + * <code>recordingFrequency</code>, and an array of <code>resourceTypes</code> to + * override.</p>. + * + * @param recordingModeOverrides the recordingModeOverrides value to set. + * @return the RecordingMode object itself. + */ + public RecordingMode withRecordingModeOverrides(List recordingModeOverrides) { + this.recordingModeOverrides = recordingModeOverrides; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (recordingFrequency() != null) { + recordingFrequency().validate(); + } + if (recordingModeOverrides() != null) { + recordingModeOverrides().forEach(e -> e.validate()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("recordingFrequency", this.recordingFrequency); + jsonWriter.writeArrayField("recordingModeOverrides", this.recordingModeOverrides, + (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of RecordingMode from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of RecordingMode if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the RecordingMode. + */ + public static RecordingMode fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + RecordingMode deserializedRecordingMode = new RecordingMode(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("recordingFrequency".equals(fieldName)) { + deserializedRecordingMode.recordingFrequency = RecordingFrequencyEnumValue.fromJson(reader); + } else if ("recordingModeOverrides".equals(fieldName)) { + List recordingModeOverrides + = reader.readArray(reader1 -> RecordingModeOverride.fromJson(reader1)); + deserializedRecordingMode.recordingModeOverrides = recordingModeOverrides; + } else { + reader.skipChildren(); + } + } + + return deserializedRecordingMode; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/RecordingModeOverride.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/RecordingModeOverride.java new file mode 100644 index 000000000000..e6d6e7c2a827 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/RecordingModeOverride.java @@ -0,0 +1,192 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Definition of RecordingModeOverride. + */ +@Fluent +public final class RecordingModeOverride implements JsonSerializable { + /* + *

A description that you provide for the override.

+ */ + private String description; + + /* + *

The recording frequency that will be applied to all the resource types specified in the override.

    + *
  • Continuous recording allows you to record configuration changes continuously whenever a change + * occurs.

  • Daily recording allows you to receive a configuration item (CI) representing the most + * recent state of your resources over the last 24-hour period, only if it’s different from the previous CI + * recorded.

Firewall Manager depends on continuous recording to monitor your resources. + * If you are using Firewall Manager, it is recommended that you set the recording frequency to Continuous.

+ *
+ */ + private RecordingFrequencyEnumValue recordingFrequency; + + /* + *

A comma-separated list that specifies which resource types Config includes in the override.

+ *

Daily recording is not supported for the following resource types:

  • + * AWS::Config::ResourceCompliance

  • + * AWS::Config::ConformancePackCompliance

  • + * AWS::Config::ConfigurationRecorder

+ */ + private List resourceTypes; + + /** + * Creates an instance of RecordingModeOverride class. + */ + public RecordingModeOverride() { + } + + /** + * Get the description property: <p>A description that you provide for the override.</p>. + * + * @return the description value. + */ + public String description() { + return this.description; + } + + /** + * Set the description property: <p>A description that you provide for the override.</p>. + * + * @param description the description value to set. + * @return the RecordingModeOverride object itself. + */ + public RecordingModeOverride withDescription(String description) { + this.description = description; + return this; + } + + /** + * Get the recordingFrequency property: <p>The recording frequency that will be applied to all the resource + * types specified in the override.</p> <ul> <li> <p>Continuous recording allows you to + * record configuration changes continuously whenever a change occurs.</p> </li> <li> + * <p>Daily recording allows you to receive a configuration item (CI) representing the most recent state of + * your resources over the last 24-hour period, only if it’s different from the previous CI recorded. </p> + * </li> </ul> <note> <p>Firewall Manager depends on continuous recording to monitor your + * resources. If you are using Firewall Manager, it is recommended that you set the recording frequency to + * Continuous.</p> </note>. + * + * @return the recordingFrequency value. + */ + public RecordingFrequencyEnumValue recordingFrequency() { + return this.recordingFrequency; + } + + /** + * Set the recordingFrequency property: <p>The recording frequency that will be applied to all the resource + * types specified in the override.</p> <ul> <li> <p>Continuous recording allows you to + * record configuration changes continuously whenever a change occurs.</p> </li> <li> + * <p>Daily recording allows you to receive a configuration item (CI) representing the most recent state of + * your resources over the last 24-hour period, only if it’s different from the previous CI recorded. </p> + * </li> </ul> <note> <p>Firewall Manager depends on continuous recording to monitor your + * resources. If you are using Firewall Manager, it is recommended that you set the recording frequency to + * Continuous.</p> </note>. + * + * @param recordingFrequency the recordingFrequency value to set. + * @return the RecordingModeOverride object itself. + */ + public RecordingModeOverride withRecordingFrequency(RecordingFrequencyEnumValue recordingFrequency) { + this.recordingFrequency = recordingFrequency; + return this; + } + + /** + * Get the resourceTypes property: <p>A comma-separated list that specifies which resource types Config + * includes in the override.</p> <important> <p>Daily recording is not supported for the following + * resource types:</p> <ul> <li> <p> + * <code>AWS::Config::ResourceCompliance</code> </p> </li> <li> <p> + * <code>AWS::Config::ConformancePackCompliance</code> </p> </li> <li> <p> + * <code>AWS::Config::ConfigurationRecorder</code> </p> </li> </ul> + * </important>. + * + * @return the resourceTypes value. + */ + public List resourceTypes() { + return this.resourceTypes; + } + + /** + * Set the resourceTypes property: <p>A comma-separated list that specifies which resource types Config + * includes in the override.</p> <important> <p>Daily recording is not supported for the following + * resource types:</p> <ul> <li> <p> + * <code>AWS::Config::ResourceCompliance</code> </p> </li> <li> <p> + * <code>AWS::Config::ConformancePackCompliance</code> </p> </li> <li> <p> + * <code>AWS::Config::ConfigurationRecorder</code> </p> </li> </ul> + * </important>. + * + * @param resourceTypes the resourceTypes value to set. + * @return the RecordingModeOverride object itself. + */ + public RecordingModeOverride withResourceTypes(List resourceTypes) { + this.resourceTypes = resourceTypes; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (recordingFrequency() != null) { + recordingFrequency().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("description", this.description); + jsonWriter.writeJsonField("recordingFrequency", this.recordingFrequency); + jsonWriter.writeArrayField("resourceTypes", this.resourceTypes, + (writer, element) -> writer.writeString(element == null ? null : element.toString())); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of RecordingModeOverride from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of RecordingModeOverride if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the RecordingModeOverride. + */ + public static RecordingModeOverride fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + RecordingModeOverride deserializedRecordingModeOverride = new RecordingModeOverride(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("description".equals(fieldName)) { + deserializedRecordingModeOverride.description = reader.getString(); + } else if ("recordingFrequency".equals(fieldName)) { + deserializedRecordingModeOverride.recordingFrequency = RecordingFrequencyEnumValue.fromJson(reader); + } else if ("resourceTypes".equals(fieldName)) { + List resourceTypes + = reader.readArray(reader1 -> ResourceType.fromString(reader1.getString())); + deserializedRecordingModeOverride.resourceTypes = resourceTypes; + } else { + reader.skipChildren(); + } + } + + return deserializedRecordingModeOverride; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/RecordingStrategy.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/RecordingStrategy.java new file mode 100644 index 000000000000..7e7999927972 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/RecordingStrategy.java @@ -0,0 +1,231 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of RecordingStrategy. + */ +@Fluent +public final class RecordingStrategy implements JsonSerializable { + /* + *

The recording strategy for the configuration recorder.

  • If you set this option to + * ALL_SUPPORTED_RESOURCE_TYPES, Config records configuration changes for all supported resource types, + * excluding the global IAM resource types. You also must set the allSupported field of RecordingGroup to + * true. When Config adds support for a new resource type, Config automatically starts recording + * resources of that type. For a list of supported resource types, see Supported Resource Types in the Config developer guide.

  • If you set this option to + * INCLUSION_BY_RESOURCE_TYPES, Config records configuration changes for only the resource types that + * you specify in the resourceTypes field of RecordingGroup.

    + *
  • If you set this option to EXCLUSION_BY_RESOURCE_TYPES, Config records configuration + * changes for all supported resource types, except the resource types that you specify to exclude from being + * recorded in the resourceTypes field of + * ExclusionByResourceTypes.

Required and optional fields

The + * recordingStrategy field is optional when you set the allSupported field of RecordingGroup to + * true.

The recordingStrategy field is optional when you list resource types in + * the resourceTypes field of RecordingGroup.

+ *

The recordingStrategy field is required if you list resource types to exclude from recording in + * the resourceTypes field of + * ExclusionByResourceTypes.

Overriding fields

If you choose + * EXCLUSION_BY_RESOURCE_TYPES for the recording strategy, the exclusionByResourceTypes + * field will override other properties in the request.

For example, even if you set + * includeGlobalResourceTypes to false, global IAM resource types will still be automatically recorded + * in this option unless those resource types are specifically listed as exclusions in the + * resourceTypes field of exclusionByResourceTypes.

Global + * resource types and the exclusion recording strategy

By default, if you choose the + * EXCLUSION_BY_RESOURCE_TYPES recording strategy, when Config adds support for a new resource type in + * the Region where you set up the configuration recorder, including global resource types, Config starts recording + * resources of that type automatically.

Unless specifically listed as exclusions, + * AWS::RDS::GlobalCluster will be recorded automatically in all supported Config Regions were the + * configuration recorder is enabled.

IAM users, groups, roles, and customer managed policies will be + * recorded in the Region where you set up the configuration recorder if that is a Region where Config was available + * before February 2022. You cannot be record the global IAM resouce types in Regions supported by Config after + * February 2022. This list where you cannot record the global IAM resource types includes the following + * Regions:

  • Asia Pacific (Hyderabad)

  • Asia Pacific (Melbourne)

  • + *

    Canada West (Calgary)

  • Europe (Spain)

  • Europe (Zurich)

  • + *

    Israel (Tel Aviv)

  • Middle East (UAE)

+ */ + private RecordingStrategyTypeEnumValue useOnly; + + /** + * Creates an instance of RecordingStrategy class. + */ + public RecordingStrategy() { + } + + /** + * Get the useOnly property: <p>The recording strategy for the configuration recorder.</p> <ul> + * <li> <p>If you set this option to <code>ALL_SUPPORTED_RESOURCE_TYPES</code>, Config + * records configuration changes for all supported resource types, excluding the global IAM resource types. You also + * must set the <code>allSupported</code> field of <a + * href='https://docs.aws.amazon.com/config/latest/APIReference/API_RecordingGroup.html'>RecordingGroup</a> + * to <code>true</code>. When Config adds support for a new resource type, Config automatically starts + * recording resources of that type. For a list of supported resource types, see <a + * href='https://docs.aws.amazon.com/config/latest/developerguide/resource-config-reference.html#supported-resources'>Supported + * Resource Types</a> in the <i>Config developer guide</i>.</p> </li> <li> + * <p>If you set this option to <code>INCLUSION_BY_RESOURCE_TYPES</code>, Config records + * configuration changes for only the resource types that you specify in the <code>resourceTypes</code> + * field of <a + * href='https://docs.aws.amazon.com/config/latest/APIReference/API_RecordingGroup.html'>RecordingGroup</a>.</p> + * </li> <li> <p>If you set this option to <code>EXCLUSION_BY_RESOURCE_TYPES</code>, + * Config records configuration changes for all supported resource types, except the resource types that you specify + * to exclude from being recorded in the <code>resourceTypes</code> field of <a + * href='https://docs.aws.amazon.com/config/latest/APIReference/API_ExclusionByResourceTypes.html'>ExclusionByResourceTypes</a>.</p> + * </li> </ul> <note> <p> <b>Required and optional fields</b> </p> + * <p>The <code>recordingStrategy</code> field is optional when you set the + * <code>allSupported</code> field of <a + * href='https://docs.aws.amazon.com/config/latest/APIReference/API_RecordingGroup.html'>RecordingGroup</a> + * to <code>true</code>.</p> <p>The <code>recordingStrategy</code> field is + * optional when you list resource types in the <code>resourceTypes</code> field of <a + * href='https://docs.aws.amazon.com/config/latest/APIReference/API_RecordingGroup.html'>RecordingGroup</a>.</p> + * <p>The <code>recordingStrategy</code> field is required if you list resource types to exclude + * from recording in the <code>resourceTypes</code> field of <a + * href='https://docs.aws.amazon.com/config/latest/APIReference/API_ExclusionByResourceTypes.html'>ExclusionByResourceTypes</a>.</p> + * </note> <note> <p> <b>Overriding fields</b> </p> <p>If you choose + * <code>EXCLUSION_BY_RESOURCE_TYPES</code> for the recording strategy, the + * <code>exclusionByResourceTypes</code> field will override other properties in the request.</p> + * <p>For example, even if you set <code>includeGlobalResourceTypes</code> to false, global IAM + * resource types will still be automatically recorded in this option unless those resource types are specifically + * listed as exclusions in the <code>resourceTypes</code> field of + * <code>exclusionByResourceTypes</code>.</p> </note> <note> <p> <b>Global + * resource types and the exclusion recording strategy</b> </p> <p>By default, if you choose the + * <code>EXCLUSION_BY_RESOURCE_TYPES</code> recording strategy, when Config adds support for a new + * resource type in the Region where you set up the configuration recorder, including global resource types, Config + * starts recording resources of that type automatically.</p> <p>Unless specifically listed as + * exclusions, <code>AWS::RDS::GlobalCluster</code> will be recorded automatically in all supported + * Config Regions were the configuration recorder is enabled.</p> <p>IAM users, groups, roles, and + * customer managed policies will be recorded in the Region where you set up the configuration recorder if that is a + * Region where Config was available before February 2022. You cannot be record the global IAM resouce types in + * Regions supported by Config after February 2022. This list where you cannot record the global IAM resource types + * includes the following Regions:</p> <ul> <li> <p>Asia Pacific (Hyderabad)</p> + * </li> <li> <p>Asia Pacific (Melbourne)</p> </li> <li> <p>Canada West + * (Calgary)</p> </li> <li> <p>Europe (Spain)</p> </li> <li> + * <p>Europe (Zurich)</p> </li> <li> <p>Israel (Tel Aviv)</p> </li> + * <li> <p>Middle East (UAE)</p> </li> </ul> </note>. + * + * @return the useOnly value. + */ + public RecordingStrategyTypeEnumValue useOnly() { + return this.useOnly; + } + + /** + * Set the useOnly property: <p>The recording strategy for the configuration recorder.</p> <ul> + * <li> <p>If you set this option to <code>ALL_SUPPORTED_RESOURCE_TYPES</code>, Config + * records configuration changes for all supported resource types, excluding the global IAM resource types. You also + * must set the <code>allSupported</code> field of <a + * href='https://docs.aws.amazon.com/config/latest/APIReference/API_RecordingGroup.html'>RecordingGroup</a> + * to <code>true</code>. When Config adds support for a new resource type, Config automatically starts + * recording resources of that type. For a list of supported resource types, see <a + * href='https://docs.aws.amazon.com/config/latest/developerguide/resource-config-reference.html#supported-resources'>Supported + * Resource Types</a> in the <i>Config developer guide</i>.</p> </li> <li> + * <p>If you set this option to <code>INCLUSION_BY_RESOURCE_TYPES</code>, Config records + * configuration changes for only the resource types that you specify in the <code>resourceTypes</code> + * field of <a + * href='https://docs.aws.amazon.com/config/latest/APIReference/API_RecordingGroup.html'>RecordingGroup</a>.</p> + * </li> <li> <p>If you set this option to <code>EXCLUSION_BY_RESOURCE_TYPES</code>, + * Config records configuration changes for all supported resource types, except the resource types that you specify + * to exclude from being recorded in the <code>resourceTypes</code> field of <a + * href='https://docs.aws.amazon.com/config/latest/APIReference/API_ExclusionByResourceTypes.html'>ExclusionByResourceTypes</a>.</p> + * </li> </ul> <note> <p> <b>Required and optional fields</b> </p> + * <p>The <code>recordingStrategy</code> field is optional when you set the + * <code>allSupported</code> field of <a + * href='https://docs.aws.amazon.com/config/latest/APIReference/API_RecordingGroup.html'>RecordingGroup</a> + * to <code>true</code>.</p> <p>The <code>recordingStrategy</code> field is + * optional when you list resource types in the <code>resourceTypes</code> field of <a + * href='https://docs.aws.amazon.com/config/latest/APIReference/API_RecordingGroup.html'>RecordingGroup</a>.</p> + * <p>The <code>recordingStrategy</code> field is required if you list resource types to exclude + * from recording in the <code>resourceTypes</code> field of <a + * href='https://docs.aws.amazon.com/config/latest/APIReference/API_ExclusionByResourceTypes.html'>ExclusionByResourceTypes</a>.</p> + * </note> <note> <p> <b>Overriding fields</b> </p> <p>If you choose + * <code>EXCLUSION_BY_RESOURCE_TYPES</code> for the recording strategy, the + * <code>exclusionByResourceTypes</code> field will override other properties in the request.</p> + * <p>For example, even if you set <code>includeGlobalResourceTypes</code> to false, global IAM + * resource types will still be automatically recorded in this option unless those resource types are specifically + * listed as exclusions in the <code>resourceTypes</code> field of + * <code>exclusionByResourceTypes</code>.</p> </note> <note> <p> <b>Global + * resource types and the exclusion recording strategy</b> </p> <p>By default, if you choose the + * <code>EXCLUSION_BY_RESOURCE_TYPES</code> recording strategy, when Config adds support for a new + * resource type in the Region where you set up the configuration recorder, including global resource types, Config + * starts recording resources of that type automatically.</p> <p>Unless specifically listed as + * exclusions, <code>AWS::RDS::GlobalCluster</code> will be recorded automatically in all supported + * Config Regions were the configuration recorder is enabled.</p> <p>IAM users, groups, roles, and + * customer managed policies will be recorded in the Region where you set up the configuration recorder if that is a + * Region where Config was available before February 2022. You cannot be record the global IAM resouce types in + * Regions supported by Config after February 2022. This list where you cannot record the global IAM resource types + * includes the following Regions:</p> <ul> <li> <p>Asia Pacific (Hyderabad)</p> + * </li> <li> <p>Asia Pacific (Melbourne)</p> </li> <li> <p>Canada West + * (Calgary)</p> </li> <li> <p>Europe (Spain)</p> </li> <li> + * <p>Europe (Zurich)</p> </li> <li> <p>Israel (Tel Aviv)</p> </li> + * <li> <p>Middle East (UAE)</p> </li> </ul> </note>. + * + * @param useOnly the useOnly value to set. + * @return the RecordingStrategy object itself. + */ + public RecordingStrategy withUseOnly(RecordingStrategyTypeEnumValue useOnly) { + this.useOnly = useOnly; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (useOnly() != null) { + useOnly().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("useOnly", this.useOnly); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of RecordingStrategy from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of RecordingStrategy if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the RecordingStrategy. + */ + public static RecordingStrategy fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + RecordingStrategy deserializedRecordingStrategy = new RecordingStrategy(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("useOnly".equals(fieldName)) { + deserializedRecordingStrategy.useOnly = RecordingStrategyTypeEnumValue.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedRecordingStrategy; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/RecordingStrategyType.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/RecordingStrategyType.java new file mode 100644 index 000000000000..ac4cbebccdcc --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/RecordingStrategyType.java @@ -0,0 +1,56 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * RecordingStrategyType enum. + */ +public final class RecordingStrategyType extends ExpandableStringEnum { + /** + * Static value ALL_SUPPORTED_RESOURCE_TYPES for RecordingStrategyType. + */ + public static final RecordingStrategyType ALL_SUPPORTED_RESOURCE_TYPES = fromString("ALL_SUPPORTED_RESOURCE_TYPES"); + + /** + * Static value EXCLUSION_BY_RESOURCE_TYPES for RecordingStrategyType. + */ + public static final RecordingStrategyType EXCLUSION_BY_RESOURCE_TYPES = fromString("EXCLUSION_BY_RESOURCE_TYPES"); + + /** + * Static value INCLUSION_BY_RESOURCE_TYPES for RecordingStrategyType. + */ + public static final RecordingStrategyType INCLUSION_BY_RESOURCE_TYPES = fromString("INCLUSION_BY_RESOURCE_TYPES"); + + /** + * Creates a new instance of RecordingStrategyType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public RecordingStrategyType() { + } + + /** + * Creates or finds a RecordingStrategyType from its string representation. + * + * @param name a name to look for. + * @return the corresponding RecordingStrategyType. + */ + public static RecordingStrategyType fromString(String name) { + return fromString(name, RecordingStrategyType.class); + } + + /** + * Gets known RecordingStrategyType values. + * + * @return known RecordingStrategyType values. + */ + public static Collection values() { + return values(RecordingStrategyType.class); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/RecordingStrategyTypeEnumValue.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/RecordingStrategyTypeEnumValue.java new file mode 100644 index 000000000000..4e604b00e5bf --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/RecordingStrategyTypeEnumValue.java @@ -0,0 +1,95 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of RecordingStrategyTypeEnumValue. + */ +@Fluent +public final class RecordingStrategyTypeEnumValue implements JsonSerializable { + /* + * Property value + */ + private RecordingStrategyType value; + + /** + * Creates an instance of RecordingStrategyTypeEnumValue class. + */ + public RecordingStrategyTypeEnumValue() { + } + + /** + * Get the value property: Property value. + * + * @return the value value. + */ + public RecordingStrategyType value() { + return this.value; + } + + /** + * Set the value property: Property value. + * + * @param value the value value to set. + * @return the RecordingStrategyTypeEnumValue object itself. + */ + public RecordingStrategyTypeEnumValue withValue(RecordingStrategyType value) { + this.value = value; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("value", this.value == null ? null : this.value.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of RecordingStrategyTypeEnumValue from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of RecordingStrategyTypeEnumValue if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the RecordingStrategyTypeEnumValue. + */ + public static RecordingStrategyTypeEnumValue fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + RecordingStrategyTypeEnumValue deserializedRecordingStrategyTypeEnumValue + = new RecordingStrategyTypeEnumValue(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + deserializedRecordingStrategyTypeEnumValue.value + = RecordingStrategyType.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedRecordingStrategyTypeEnumValue; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/RedirectAllRequestsTo.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/RedirectAllRequestsTo.java new file mode 100644 index 000000000000..d4ef6c57b31f --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/RedirectAllRequestsTo.java @@ -0,0 +1,124 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of RedirectAllRequestsTo. + */ +@Fluent +public final class RedirectAllRequestsTo implements JsonSerializable { + /* + * Name of the host where requests are redirected. + */ + private String hostname; + + /* + * Protocol to use when redirecting requests. The default is the protocol that is used in the original request. + */ + private RedirectAllRequestsToProtocol protocol; + + /** + * Creates an instance of RedirectAllRequestsTo class. + */ + public RedirectAllRequestsTo() { + } + + /** + * Get the hostname property: Name of the host where requests are redirected. + * + * @return the hostname value. + */ + public String hostname() { + return this.hostname; + } + + /** + * Set the hostname property: Name of the host where requests are redirected. + * + * @param hostname the hostname value to set. + * @return the RedirectAllRequestsTo object itself. + */ + public RedirectAllRequestsTo withHostname(String hostname) { + this.hostname = hostname; + return this; + } + + /** + * Get the protocol property: Protocol to use when redirecting requests. The default is the protocol that is used in + * the original request. + * + * @return the protocol value. + */ + public RedirectAllRequestsToProtocol protocol() { + return this.protocol; + } + + /** + * Set the protocol property: Protocol to use when redirecting requests. The default is the protocol that is used in + * the original request. + * + * @param protocol the protocol value to set. + * @return the RedirectAllRequestsTo object itself. + */ + public RedirectAllRequestsTo withProtocol(RedirectAllRequestsToProtocol protocol) { + this.protocol = protocol; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("hostName", this.hostname); + jsonWriter.writeStringField("protocol", this.protocol == null ? null : this.protocol.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of RedirectAllRequestsTo from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of RedirectAllRequestsTo if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the RedirectAllRequestsTo. + */ + public static RedirectAllRequestsTo fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + RedirectAllRequestsTo deserializedRedirectAllRequestsTo = new RedirectAllRequestsTo(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("hostName".equals(fieldName)) { + deserializedRedirectAllRequestsTo.hostname = reader.getString(); + } else if ("protocol".equals(fieldName)) { + deserializedRedirectAllRequestsTo.protocol + = RedirectAllRequestsToProtocol.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedRedirectAllRequestsTo; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/RedirectAllRequestsToProtocol.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/RedirectAllRequestsToProtocol.java new file mode 100644 index 000000000000..54a195fb61a2 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/RedirectAllRequestsToProtocol.java @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * RedirectAllRequestsToProtocol enum. + */ +public final class RedirectAllRequestsToProtocol extends ExpandableStringEnum { + /** + * Static value http for RedirectAllRequestsToProtocol. + */ + public static final RedirectAllRequestsToProtocol HTTP = fromString("http"); + + /** + * Static value https for RedirectAllRequestsToProtocol. + */ + public static final RedirectAllRequestsToProtocol HTTPS = fromString("https"); + + /** + * Creates a new instance of RedirectAllRequestsToProtocol value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public RedirectAllRequestsToProtocol() { + } + + /** + * Creates or finds a RedirectAllRequestsToProtocol from its string representation. + * + * @param name a name to look for. + * @return the corresponding RedirectAllRequestsToProtocol. + */ + public static RedirectAllRequestsToProtocol fromString(String name) { + return fromString(name, RedirectAllRequestsToProtocol.class); + } + + /** + * Gets known RedirectAllRequestsToProtocol values. + * + * @return known RedirectAllRequestsToProtocol values. + */ + public static Collection values() { + return values(RedirectAllRequestsToProtocol.class); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/RedirectConfig.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/RedirectConfig.java new file mode 100644 index 000000000000..19be6488d238 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/RedirectConfig.java @@ -0,0 +1,244 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of RedirectConfig. + */ +@Fluent +public final class RedirectConfig implements JsonSerializable { + /* + * The hostname. This component is not percent-encoded. The hostname can contain #{host}. + */ + private String host; + + /* + * The absolute path, starting with the leading '/'. This component is not percent-encoded. The path can contain + * #{host}, #{path}, and #{port}. + */ + private String path; + + /* + * The port. You can specify a value from 1 to 65535 or #{port}. + */ + private String port; + + /* + * The protocol. You can specify HTTP, HTTPS, or #{protocol}. You can redirect HTTP to HTTP, HTTP to HTTPS, and + * HTTPS to HTTPS. You cannot redirect HTTPS to HTTP. + */ + private String protocol; + + /* + * The query parameters, URL-encoded when necessary, but not percent-encoded. Do not include the leading '?', as it + * is automatically added. You can specify any of the reserved keywords. + */ + private String query; + + /* + * The HTTP redirect code. The redirect is either permanent (HTTP 301) or temporary (HTTP 302). + */ + private String statusCode; + + /** + * Creates an instance of RedirectConfig class. + */ + public RedirectConfig() { + } + + /** + * Get the host property: The hostname. This component is not percent-encoded. The hostname can contain #{host}. + * + * @return the host value. + */ + public String host() { + return this.host; + } + + /** + * Set the host property: The hostname. This component is not percent-encoded. The hostname can contain #{host}. + * + * @param host the host value to set. + * @return the RedirectConfig object itself. + */ + public RedirectConfig withHost(String host) { + this.host = host; + return this; + } + + /** + * Get the path property: The absolute path, starting with the leading '/'. This component is not percent-encoded. + * The path can contain #{host}, #{path}, and #{port}. + * + * @return the path value. + */ + public String path() { + return this.path; + } + + /** + * Set the path property: The absolute path, starting with the leading '/'. This component is not percent-encoded. + * The path can contain #{host}, #{path}, and #{port}. + * + * @param path the path value to set. + * @return the RedirectConfig object itself. + */ + public RedirectConfig withPath(String path) { + this.path = path; + return this; + } + + /** + * Get the port property: The port. You can specify a value from 1 to 65535 or #{port}. + * + * @return the port value. + */ + public String port() { + return this.port; + } + + /** + * Set the port property: The port. You can specify a value from 1 to 65535 or #{port}. + * + * @param port the port value to set. + * @return the RedirectConfig object itself. + */ + public RedirectConfig withPort(String port) { + this.port = port; + return this; + } + + /** + * Get the protocol property: The protocol. You can specify HTTP, HTTPS, or #{protocol}. You can redirect HTTP to + * HTTP, HTTP to HTTPS, and HTTPS to HTTPS. You cannot redirect HTTPS to HTTP. + * + * @return the protocol value. + */ + public String protocol() { + return this.protocol; + } + + /** + * Set the protocol property: The protocol. You can specify HTTP, HTTPS, or #{protocol}. You can redirect HTTP to + * HTTP, HTTP to HTTPS, and HTTPS to HTTPS. You cannot redirect HTTPS to HTTP. + * + * @param protocol the protocol value to set. + * @return the RedirectConfig object itself. + */ + public RedirectConfig withProtocol(String protocol) { + this.protocol = protocol; + return this; + } + + /** + * Get the query property: The query parameters, URL-encoded when necessary, but not percent-encoded. Do not include + * the leading '?', as it is automatically added. You can specify any of the reserved keywords. + * + * @return the query value. + */ + public String query() { + return this.query; + } + + /** + * Set the query property: The query parameters, URL-encoded when necessary, but not percent-encoded. Do not include + * the leading '?', as it is automatically added. You can specify any of the reserved keywords. + * + * @param query the query value to set. + * @return the RedirectConfig object itself. + */ + public RedirectConfig withQuery(String query) { + this.query = query; + return this; + } + + /** + * Get the statusCode property: The HTTP redirect code. The redirect is either permanent (HTTP 301) or temporary + * (HTTP 302). + * + * @return the statusCode value. + */ + public String statusCode() { + return this.statusCode; + } + + /** + * Set the statusCode property: The HTTP redirect code. The redirect is either permanent (HTTP 301) or temporary + * (HTTP 302). + * + * @param statusCode the statusCode value to set. + * @return the RedirectConfig object itself. + */ + public RedirectConfig withStatusCode(String statusCode) { + this.statusCode = statusCode; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("host", this.host); + jsonWriter.writeStringField("path", this.path); + jsonWriter.writeStringField("port", this.port); + jsonWriter.writeStringField("protocol", this.protocol); + jsonWriter.writeStringField("query", this.query); + jsonWriter.writeStringField("statusCode", this.statusCode); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of RedirectConfig from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of RedirectConfig if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the RedirectConfig. + */ + public static RedirectConfig fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + RedirectConfig deserializedRedirectConfig = new RedirectConfig(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("host".equals(fieldName)) { + deserializedRedirectConfig.host = reader.getString(); + } else if ("path".equals(fieldName)) { + deserializedRedirectConfig.path = reader.getString(); + } else if ("port".equals(fieldName)) { + deserializedRedirectConfig.port = reader.getString(); + } else if ("protocol".equals(fieldName)) { + deserializedRedirectConfig.protocol = reader.getString(); + } else if ("query".equals(fieldName)) { + deserializedRedirectConfig.query = reader.getString(); + } else if ("statusCode".equals(fieldName)) { + deserializedRedirectConfig.statusCode = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedRedirectConfig; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/RedirectRule.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/RedirectRule.java new file mode 100644 index 000000000000..a52b8c669b29 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/RedirectRule.java @@ -0,0 +1,241 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of RedirectRule. + */ +@Fluent +public final class RedirectRule implements JsonSerializable { + /* + * The host name to use in the redirect request. + */ + private String hostname; + + /* + * The HTTP redirect code to use on the response. Not required if one of the siblings is present. + */ + private String httpRedirectCode; + + /* + * Protocol to use when redirecting requests. The default is the protocol that is used in the original request. + */ + private RedirectRuleProtocol protocol; + + /* + * The object key prefix to use in the redirect request. For example, to redirect requests for all pages with prefix + * ``docs/`` (objects in the ``docs/`` folder) to ``documents/``, you can set a condition block with + * ``KeyPrefixEquals`` set to ``docs/`` and in the Redirect set ``ReplaceKeyPrefixWith`` to ``/documents``. Not + * required if one of the siblings is present. Can be present only if ``ReplaceKeyWith`` is not provided. + * Replacement must be made for object keys containing special characters (such as carriage returns) when using XML + * requests. For more information, see [XML related object key + * constraints](https://docs.aws.amazon.com/AmazonS3/latest/userguide/object-keys.html#object-key-xml-related- + * constraints). + */ + private String replaceKeyPrefixWith; + + /* + * The specific object key to use in the redirect request. For example, redirect request to ``error.html``. Not + * required if one of the siblings is present. Can be present only if ``ReplaceKeyPrefixWith`` is not provided. + * Replacement must be made for object keys containing special characters (such as carriage returns) when using XML + * requests. For more information, see [XML related object key + * constraints](https://docs.aws.amazon.com/AmazonS3/latest/userguide/object-keys.html#object-key-xml-related- + * constraints). + */ + private String replaceKeyWith; + + /** + * Creates an instance of RedirectRule class. + */ + public RedirectRule() { + } + + /** + * Get the hostname property: The host name to use in the redirect request. + * + * @return the hostname value. + */ + public String hostname() { + return this.hostname; + } + + /** + * Set the hostname property: The host name to use in the redirect request. + * + * @param hostname the hostname value to set. + * @return the RedirectRule object itself. + */ + public RedirectRule withHostname(String hostname) { + this.hostname = hostname; + return this; + } + + /** + * Get the httpRedirectCode property: The HTTP redirect code to use on the response. Not required if one of the + * siblings is present. + * + * @return the httpRedirectCode value. + */ + public String httpRedirectCode() { + return this.httpRedirectCode; + } + + /** + * Set the httpRedirectCode property: The HTTP redirect code to use on the response. Not required if one of the + * siblings is present. + * + * @param httpRedirectCode the httpRedirectCode value to set. + * @return the RedirectRule object itself. + */ + public RedirectRule withHttpRedirectCode(String httpRedirectCode) { + this.httpRedirectCode = httpRedirectCode; + return this; + } + + /** + * Get the protocol property: Protocol to use when redirecting requests. The default is the protocol that is used in + * the original request. + * + * @return the protocol value. + */ + public RedirectRuleProtocol protocol() { + return this.protocol; + } + + /** + * Set the protocol property: Protocol to use when redirecting requests. The default is the protocol that is used in + * the original request. + * + * @param protocol the protocol value to set. + * @return the RedirectRule object itself. + */ + public RedirectRule withProtocol(RedirectRuleProtocol protocol) { + this.protocol = protocol; + return this; + } + + /** + * Get the replaceKeyPrefixWith property: The object key prefix to use in the redirect request. For example, to + * redirect requests for all pages with prefix ``docs/`` (objects in the ``docs/`` folder) to ``documents/``, you + * can set a condition block with ``KeyPrefixEquals`` set to ``docs/`` and in the Redirect set + * ``ReplaceKeyPrefixWith`` to ``/documents``. Not required if one of the siblings is present. Can be present only + * if ``ReplaceKeyWith`` is not provided. Replacement must be made for object keys containing special characters + * (such as carriage returns) when using XML requests. For more information, see [XML related object key + * constraints](https://docs.aws.amazon.com/AmazonS3/latest/userguide/object-keys.html#object-key-xml-related-constraints). + * + * @return the replaceKeyPrefixWith value. + */ + public String replaceKeyPrefixWith() { + return this.replaceKeyPrefixWith; + } + + /** + * Set the replaceKeyPrefixWith property: The object key prefix to use in the redirect request. For example, to + * redirect requests for all pages with prefix ``docs/`` (objects in the ``docs/`` folder) to ``documents/``, you + * can set a condition block with ``KeyPrefixEquals`` set to ``docs/`` and in the Redirect set + * ``ReplaceKeyPrefixWith`` to ``/documents``. Not required if one of the siblings is present. Can be present only + * if ``ReplaceKeyWith`` is not provided. Replacement must be made for object keys containing special characters + * (such as carriage returns) when using XML requests. For more information, see [XML related object key + * constraints](https://docs.aws.amazon.com/AmazonS3/latest/userguide/object-keys.html#object-key-xml-related-constraints). + * + * @param replaceKeyPrefixWith the replaceKeyPrefixWith value to set. + * @return the RedirectRule object itself. + */ + public RedirectRule withReplaceKeyPrefixWith(String replaceKeyPrefixWith) { + this.replaceKeyPrefixWith = replaceKeyPrefixWith; + return this; + } + + /** + * Get the replaceKeyWith property: The specific object key to use in the redirect request. For example, redirect + * request to ``error.html``. Not required if one of the siblings is present. Can be present only if + * ``ReplaceKeyPrefixWith`` is not provided. Replacement must be made for object keys containing special characters + * (such as carriage returns) when using XML requests. For more information, see [XML related object key + * constraints](https://docs.aws.amazon.com/AmazonS3/latest/userguide/object-keys.html#object-key-xml-related-constraints). + * + * @return the replaceKeyWith value. + */ + public String replaceKeyWith() { + return this.replaceKeyWith; + } + + /** + * Set the replaceKeyWith property: The specific object key to use in the redirect request. For example, redirect + * request to ``error.html``. Not required if one of the siblings is present. Can be present only if + * ``ReplaceKeyPrefixWith`` is not provided. Replacement must be made for object keys containing special characters + * (such as carriage returns) when using XML requests. For more information, see [XML related object key + * constraints](https://docs.aws.amazon.com/AmazonS3/latest/userguide/object-keys.html#object-key-xml-related-constraints). + * + * @param replaceKeyWith the replaceKeyWith value to set. + * @return the RedirectRule object itself. + */ + public RedirectRule withReplaceKeyWith(String replaceKeyWith) { + this.replaceKeyWith = replaceKeyWith; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("hostName", this.hostname); + jsonWriter.writeStringField("httpRedirectCode", this.httpRedirectCode); + jsonWriter.writeStringField("protocol", this.protocol == null ? null : this.protocol.toString()); + jsonWriter.writeStringField("replaceKeyPrefixWith", this.replaceKeyPrefixWith); + jsonWriter.writeStringField("replaceKeyWith", this.replaceKeyWith); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of RedirectRule from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of RedirectRule if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the RedirectRule. + */ + public static RedirectRule fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + RedirectRule deserializedRedirectRule = new RedirectRule(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("hostName".equals(fieldName)) { + deserializedRedirectRule.hostname = reader.getString(); + } else if ("httpRedirectCode".equals(fieldName)) { + deserializedRedirectRule.httpRedirectCode = reader.getString(); + } else if ("protocol".equals(fieldName)) { + deserializedRedirectRule.protocol = RedirectRuleProtocol.fromString(reader.getString()); + } else if ("replaceKeyPrefixWith".equals(fieldName)) { + deserializedRedirectRule.replaceKeyPrefixWith = reader.getString(); + } else if ("replaceKeyWith".equals(fieldName)) { + deserializedRedirectRule.replaceKeyWith = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedRedirectRule; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/RedirectRuleProtocol.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/RedirectRuleProtocol.java new file mode 100644 index 000000000000..11240f1b5f49 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/RedirectRuleProtocol.java @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * RedirectRuleProtocol enum. + */ +public final class RedirectRuleProtocol extends ExpandableStringEnum { + /** + * Static value http for RedirectRuleProtocol. + */ + public static final RedirectRuleProtocol HTTP = fromString("http"); + + /** + * Static value https for RedirectRuleProtocol. + */ + public static final RedirectRuleProtocol HTTPS = fromString("https"); + + /** + * Creates a new instance of RedirectRuleProtocol value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public RedirectRuleProtocol() { + } + + /** + * Creates or finds a RedirectRuleProtocol from its string representation. + * + * @param name a name to look for. + * @return the corresponding RedirectRuleProtocol. + */ + public static RedirectRuleProtocol fromString(String name) { + return fromString(name, RedirectRuleProtocol.class); + } + + /** + * Gets known RedirectRuleProtocol values. + * + * @return known RedirectRuleProtocol values. + */ + public static Collection values() { + return values(RedirectRuleProtocol.class); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/RedshiftCluster.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/RedshiftCluster.java new file mode 100644 index 000000000000..96a6dd1ce76a --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/RedshiftCluster.java @@ -0,0 +1,252 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.awsconnector.fluent.models.RedshiftClusterInner; +import java.util.Map; + +/** + * An immutable client-side representation of RedshiftCluster. + */ +public interface RedshiftCluster { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the location property: The geo-location where the resource lives. + * + * @return the location value. + */ + String location(); + + /** + * Gets the tags property: Resource tags. + * + * @return the tags value. + */ + Map tags(); + + /** + * Gets the properties property: The resource-specific properties for this resource. + * + * @return the properties value. + */ + RedshiftClusterProperties properties(); + + /** + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the region of the resource. + * + * @return the region of the resource. + */ + Region region(); + + /** + * Gets the name of the resource region. + * + * @return the name of the resource region. + */ + String regionName(); + + /** + * Gets the name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + + /** + * Gets the inner com.azure.resourcemanager.awsconnector.fluent.models.RedshiftClusterInner object. + * + * @return the inner object. + */ + RedshiftClusterInner innerModel(); + + /** + * The entirety of the RedshiftCluster definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithLocation, + DefinitionStages.WithResourceGroup, DefinitionStages.WithCreate { + } + + /** + * The RedshiftCluster definition stages. + */ + interface DefinitionStages { + /** + * The first stage of the RedshiftCluster definition. + */ + interface Blank extends WithLocation { + } + + /** + * The stage of the RedshiftCluster definition allowing to specify location. + */ + interface WithLocation { + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithResourceGroup withRegion(Region location); + + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithResourceGroup withRegion(String location); + } + + /** + * The stage of the RedshiftCluster definition allowing to specify parent resource. + */ + interface WithResourceGroup { + /** + * Specifies resourceGroupName. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @return the next definition stage. + */ + WithCreate withExistingResourceGroup(String resourceGroupName); + } + + /** + * The stage of the RedshiftCluster 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.WithProperties { + /** + * Executes the create request. + * + * @return the created resource. + */ + RedshiftCluster create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + RedshiftCluster create(Context context); + } + + /** + * The stage of the RedshiftCluster definition allowing to specify tags. + */ + interface WithTags { + /** + * Specifies the tags property: Resource tags.. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + WithCreate withTags(Map tags); + } + + /** + * The stage of the RedshiftCluster definition allowing to specify properties. + */ + interface WithProperties { + /** + * Specifies the properties property: The resource-specific properties for this resource.. + * + * @param properties The resource-specific properties for this resource. + * @return the next definition stage. + */ + WithCreate withProperties(RedshiftClusterProperties properties); + } + } + + /** + * Begins update for the RedshiftCluster resource. + * + * @return the stage of resource update. + */ + RedshiftCluster.Update update(); + + /** + * The template for RedshiftCluster update. + */ + interface Update extends UpdateStages.WithTags { + /** + * Executes the update request. + * + * @return the updated resource. + */ + RedshiftCluster apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + RedshiftCluster apply(Context context); + } + + /** + * The RedshiftCluster update stages. + */ + interface UpdateStages { + /** + * The stage of the RedshiftCluster update allowing to specify tags. + */ + interface WithTags { + /** + * Specifies the tags property: Resource tags.. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + Update withTags(Map tags); + } + } + + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + RedshiftCluster refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + RedshiftCluster refresh(Context context); +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/RedshiftClusterListResult.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/RedshiftClusterListResult.java new file mode 100644 index 000000000000..4dd00c1838af --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/RedshiftClusterListResult.java @@ -0,0 +1,136 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.awsconnector.fluent.models.RedshiftClusterInner; +import java.io.IOException; +import java.util.List; + +/** + * The response of a RedshiftCluster list operation. + */ +@Fluent +public final class RedshiftClusterListResult implements JsonSerializable { + /* + * The RedshiftCluster items on this page + */ + private List value; + + /* + * The link to the next page of items + */ + private String nextLink; + + /** + * Creates an instance of RedshiftClusterListResult class. + */ + public RedshiftClusterListResult() { + } + + /** + * Get the value property: The RedshiftCluster items on this page. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The RedshiftCluster items on this page. + * + * @param value the value value to set. + * @return the RedshiftClusterListResult object itself. + */ + public RedshiftClusterListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The link to the next page of items. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: The link to the next page of items. + * + * @param nextLink the nextLink value to set. + * @return the RedshiftClusterListResult object itself. + */ + public RedshiftClusterListResult withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() == null) { + throw LOGGER.atError() + .log( + new IllegalArgumentException("Missing required property value in model RedshiftClusterListResult")); + } else { + value().forEach(e -> e.validate()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(RedshiftClusterListResult.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("nextLink", this.nextLink); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of RedshiftClusterListResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of RedshiftClusterListResult if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the RedshiftClusterListResult. + */ + public static RedshiftClusterListResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + RedshiftClusterListResult deserializedRedshiftClusterListResult = new RedshiftClusterListResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> RedshiftClusterInner.fromJson(reader1)); + deserializedRedshiftClusterListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedRedshiftClusterListResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedRedshiftClusterListResult; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/RedshiftClusterParameterGroup.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/RedshiftClusterParameterGroup.java new file mode 100644 index 000000000000..91b13064f929 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/RedshiftClusterParameterGroup.java @@ -0,0 +1,252 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.awsconnector.fluent.models.RedshiftClusterParameterGroupInner; +import java.util.Map; + +/** + * An immutable client-side representation of RedshiftClusterParameterGroup. + */ +public interface RedshiftClusterParameterGroup { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the location property: The geo-location where the resource lives. + * + * @return the location value. + */ + String location(); + + /** + * Gets the tags property: Resource tags. + * + * @return the tags value. + */ + Map tags(); + + /** + * Gets the properties property: The resource-specific properties for this resource. + * + * @return the properties value. + */ + RedshiftClusterParameterGroupProperties properties(); + + /** + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the region of the resource. + * + * @return the region of the resource. + */ + Region region(); + + /** + * Gets the name of the resource region. + * + * @return the name of the resource region. + */ + String regionName(); + + /** + * Gets the name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + + /** + * Gets the inner com.azure.resourcemanager.awsconnector.fluent.models.RedshiftClusterParameterGroupInner object. + * + * @return the inner object. + */ + RedshiftClusterParameterGroupInner innerModel(); + + /** + * The entirety of the RedshiftClusterParameterGroup definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithLocation, + DefinitionStages.WithResourceGroup, DefinitionStages.WithCreate { + } + + /** + * The RedshiftClusterParameterGroup definition stages. + */ + interface DefinitionStages { + /** + * The first stage of the RedshiftClusterParameterGroup definition. + */ + interface Blank extends WithLocation { + } + + /** + * The stage of the RedshiftClusterParameterGroup definition allowing to specify location. + */ + interface WithLocation { + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithResourceGroup withRegion(Region location); + + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithResourceGroup withRegion(String location); + } + + /** + * The stage of the RedshiftClusterParameterGroup definition allowing to specify parent resource. + */ + interface WithResourceGroup { + /** + * Specifies resourceGroupName. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @return the next definition stage. + */ + WithCreate withExistingResourceGroup(String resourceGroupName); + } + + /** + * The stage of the RedshiftClusterParameterGroup 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.WithProperties { + /** + * Executes the create request. + * + * @return the created resource. + */ + RedshiftClusterParameterGroup create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + RedshiftClusterParameterGroup create(Context context); + } + + /** + * The stage of the RedshiftClusterParameterGroup definition allowing to specify tags. + */ + interface WithTags { + /** + * Specifies the tags property: Resource tags.. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + WithCreate withTags(Map tags); + } + + /** + * The stage of the RedshiftClusterParameterGroup definition allowing to specify properties. + */ + interface WithProperties { + /** + * Specifies the properties property: The resource-specific properties for this resource.. + * + * @param properties The resource-specific properties for this resource. + * @return the next definition stage. + */ + WithCreate withProperties(RedshiftClusterParameterGroupProperties properties); + } + } + + /** + * Begins update for the RedshiftClusterParameterGroup resource. + * + * @return the stage of resource update. + */ + RedshiftClusterParameterGroup.Update update(); + + /** + * The template for RedshiftClusterParameterGroup update. + */ + interface Update extends UpdateStages.WithTags { + /** + * Executes the update request. + * + * @return the updated resource. + */ + RedshiftClusterParameterGroup apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + RedshiftClusterParameterGroup apply(Context context); + } + + /** + * The RedshiftClusterParameterGroup update stages. + */ + interface UpdateStages { + /** + * The stage of the RedshiftClusterParameterGroup update allowing to specify tags. + */ + interface WithTags { + /** + * Specifies the tags property: Resource tags.. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + Update withTags(Map tags); + } + } + + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + RedshiftClusterParameterGroup refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + RedshiftClusterParameterGroup refresh(Context context); +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/RedshiftClusterParameterGroupListResult.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/RedshiftClusterParameterGroupListResult.java new file mode 100644 index 000000000000..091d429c03b3 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/RedshiftClusterParameterGroupListResult.java @@ -0,0 +1,138 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.awsconnector.fluent.models.RedshiftClusterParameterGroupInner; +import java.io.IOException; +import java.util.List; + +/** + * The response of a RedshiftClusterParameterGroup list operation. + */ +@Fluent +public final class RedshiftClusterParameterGroupListResult + implements JsonSerializable { + /* + * The RedshiftClusterParameterGroup items on this page + */ + private List value; + + /* + * The link to the next page of items + */ + private String nextLink; + + /** + * Creates an instance of RedshiftClusterParameterGroupListResult class. + */ + public RedshiftClusterParameterGroupListResult() { + } + + /** + * Get the value property: The RedshiftClusterParameterGroup items on this page. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The RedshiftClusterParameterGroup items on this page. + * + * @param value the value value to set. + * @return the RedshiftClusterParameterGroupListResult object itself. + */ + public RedshiftClusterParameterGroupListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The link to the next page of items. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: The link to the next page of items. + * + * @param nextLink the nextLink value to set. + * @return the RedshiftClusterParameterGroupListResult object itself. + */ + public RedshiftClusterParameterGroupListResult withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property value in model RedshiftClusterParameterGroupListResult")); + } else { + value().forEach(e -> e.validate()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(RedshiftClusterParameterGroupListResult.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("nextLink", this.nextLink); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of RedshiftClusterParameterGroupListResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of RedshiftClusterParameterGroupListResult if the JsonReader was pointing to an instance of + * it, or null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the RedshiftClusterParameterGroupListResult. + */ + public static RedshiftClusterParameterGroupListResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + RedshiftClusterParameterGroupListResult deserializedRedshiftClusterParameterGroupListResult + = new RedshiftClusterParameterGroupListResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> RedshiftClusterParameterGroupInner.fromJson(reader1)); + deserializedRedshiftClusterParameterGroupListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedRedshiftClusterParameterGroupListResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedRedshiftClusterParameterGroupListResult; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/RedshiftClusterParameterGroupProperties.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/RedshiftClusterParameterGroupProperties.java new file mode 100644 index 000000000000..c126ffa2a24a --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/RedshiftClusterParameterGroupProperties.java @@ -0,0 +1,317 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.Map; + +/** + * Definition of RedshiftClusterParameterGroup. + */ +@Fluent +public final class RedshiftClusterParameterGroupProperties + implements JsonSerializable { + /* + * AWS Properties + */ + private AwsRedshiftClusterParameterGroupProperties awsProperties; + + /* + * Public Cloud Connectors Resource ID + */ + private String publicCloudConnectorsResourceId; + + /* + * AWS Account ID + */ + private String awsAccountId; + + /* + * Amazon Resource Name (ARN) + */ + private String arn; + + /* + * Public Cloud Resource Name + */ + private String publicCloudResourceName; + + /* + * AWS Source Schema + */ + private String awsSourceSchema; + + /* + * AWS Region + */ + private String awsRegion; + + /* + * AWS Tags + */ + private Map awsTags; + + /* + * The status of the last operation. + */ + private ProvisioningState provisioningState; + + /** + * Creates an instance of RedshiftClusterParameterGroupProperties class. + */ + public RedshiftClusterParameterGroupProperties() { + } + + /** + * Get the awsProperties property: AWS Properties. + * + * @return the awsProperties value. + */ + public AwsRedshiftClusterParameterGroupProperties awsProperties() { + return this.awsProperties; + } + + /** + * Set the awsProperties property: AWS Properties. + * + * @param awsProperties the awsProperties value to set. + * @return the RedshiftClusterParameterGroupProperties object itself. + */ + public RedshiftClusterParameterGroupProperties + withAwsProperties(AwsRedshiftClusterParameterGroupProperties awsProperties) { + this.awsProperties = awsProperties; + return this; + } + + /** + * Get the publicCloudConnectorsResourceId property: Public Cloud Connectors Resource ID. + * + * @return the publicCloudConnectorsResourceId value. + */ + public String publicCloudConnectorsResourceId() { + return this.publicCloudConnectorsResourceId; + } + + /** + * Set the publicCloudConnectorsResourceId property: Public Cloud Connectors Resource ID. + * + * @param publicCloudConnectorsResourceId the publicCloudConnectorsResourceId value to set. + * @return the RedshiftClusterParameterGroupProperties object itself. + */ + public RedshiftClusterParameterGroupProperties + withPublicCloudConnectorsResourceId(String publicCloudConnectorsResourceId) { + this.publicCloudConnectorsResourceId = publicCloudConnectorsResourceId; + return this; + } + + /** + * Get the awsAccountId property: AWS Account ID. + * + * @return the awsAccountId value. + */ + public String awsAccountId() { + return this.awsAccountId; + } + + /** + * Set the awsAccountId property: AWS Account ID. + * + * @param awsAccountId the awsAccountId value to set. + * @return the RedshiftClusterParameterGroupProperties object itself. + */ + public RedshiftClusterParameterGroupProperties withAwsAccountId(String awsAccountId) { + this.awsAccountId = awsAccountId; + return this; + } + + /** + * Get the arn property: Amazon Resource Name (ARN). + * + * @return the arn value. + */ + public String arn() { + return this.arn; + } + + /** + * Set the arn property: Amazon Resource Name (ARN). + * + * @param arn the arn value to set. + * @return the RedshiftClusterParameterGroupProperties object itself. + */ + public RedshiftClusterParameterGroupProperties withArn(String arn) { + this.arn = arn; + return this; + } + + /** + * Get the publicCloudResourceName property: Public Cloud Resource Name. + * + * @return the publicCloudResourceName value. + */ + public String publicCloudResourceName() { + return this.publicCloudResourceName; + } + + /** + * Set the publicCloudResourceName property: Public Cloud Resource Name. + * + * @param publicCloudResourceName the publicCloudResourceName value to set. + * @return the RedshiftClusterParameterGroupProperties object itself. + */ + public RedshiftClusterParameterGroupProperties withPublicCloudResourceName(String publicCloudResourceName) { + this.publicCloudResourceName = publicCloudResourceName; + return this; + } + + /** + * Get the awsSourceSchema property: AWS Source Schema. + * + * @return the awsSourceSchema value. + */ + public String awsSourceSchema() { + return this.awsSourceSchema; + } + + /** + * Set the awsSourceSchema property: AWS Source Schema. + * + * @param awsSourceSchema the awsSourceSchema value to set. + * @return the RedshiftClusterParameterGroupProperties object itself. + */ + public RedshiftClusterParameterGroupProperties withAwsSourceSchema(String awsSourceSchema) { + this.awsSourceSchema = awsSourceSchema; + return this; + } + + /** + * Get the awsRegion property: AWS Region. + * + * @return the awsRegion value. + */ + public String awsRegion() { + return this.awsRegion; + } + + /** + * Set the awsRegion property: AWS Region. + * + * @param awsRegion the awsRegion value to set. + * @return the RedshiftClusterParameterGroupProperties object itself. + */ + public RedshiftClusterParameterGroupProperties withAwsRegion(String awsRegion) { + this.awsRegion = awsRegion; + return this; + } + + /** + * Get the awsTags property: AWS Tags. + * + * @return the awsTags value. + */ + public Map awsTags() { + return this.awsTags; + } + + /** + * Set the awsTags property: AWS Tags. + * + * @param awsTags the awsTags value to set. + * @return the RedshiftClusterParameterGroupProperties object itself. + */ + public RedshiftClusterParameterGroupProperties withAwsTags(Map awsTags) { + this.awsTags = awsTags; + return this; + } + + /** + * Get the provisioningState property: The status of the last operation. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (awsProperties() != null) { + awsProperties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("awsProperties", this.awsProperties); + jsonWriter.writeStringField("publicCloudConnectorsResourceId", this.publicCloudConnectorsResourceId); + jsonWriter.writeStringField("awsAccountId", this.awsAccountId); + jsonWriter.writeStringField("arn", this.arn); + jsonWriter.writeStringField("publicCloudResourceName", this.publicCloudResourceName); + jsonWriter.writeStringField("awsSourceSchema", this.awsSourceSchema); + jsonWriter.writeStringField("awsRegion", this.awsRegion); + jsonWriter.writeMapField("awsTags", this.awsTags, (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of RedshiftClusterParameterGroupProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of RedshiftClusterParameterGroupProperties if the JsonReader was pointing to an instance of + * it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the RedshiftClusterParameterGroupProperties. + */ + public static RedshiftClusterParameterGroupProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + RedshiftClusterParameterGroupProperties deserializedRedshiftClusterParameterGroupProperties + = new RedshiftClusterParameterGroupProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("awsProperties".equals(fieldName)) { + deserializedRedshiftClusterParameterGroupProperties.awsProperties + = AwsRedshiftClusterParameterGroupProperties.fromJson(reader); + } else if ("publicCloudConnectorsResourceId".equals(fieldName)) { + deserializedRedshiftClusterParameterGroupProperties.publicCloudConnectorsResourceId + = reader.getString(); + } else if ("awsAccountId".equals(fieldName)) { + deserializedRedshiftClusterParameterGroupProperties.awsAccountId = reader.getString(); + } else if ("arn".equals(fieldName)) { + deserializedRedshiftClusterParameterGroupProperties.arn = reader.getString(); + } else if ("publicCloudResourceName".equals(fieldName)) { + deserializedRedshiftClusterParameterGroupProperties.publicCloudResourceName = reader.getString(); + } else if ("awsSourceSchema".equals(fieldName)) { + deserializedRedshiftClusterParameterGroupProperties.awsSourceSchema = reader.getString(); + } else if ("awsRegion".equals(fieldName)) { + deserializedRedshiftClusterParameterGroupProperties.awsRegion = reader.getString(); + } else if ("awsTags".equals(fieldName)) { + Map awsTags = reader.readMap(reader1 -> reader1.getString()); + deserializedRedshiftClusterParameterGroupProperties.awsTags = awsTags; + } else if ("provisioningState".equals(fieldName)) { + deserializedRedshiftClusterParameterGroupProperties.provisioningState + = ProvisioningState.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedRedshiftClusterParameterGroupProperties; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/RedshiftClusterParameterGroupTagsUpdate.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/RedshiftClusterParameterGroupTagsUpdate.java new file mode 100644 index 000000000000..09b76702804c --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/RedshiftClusterParameterGroupTagsUpdate.java @@ -0,0 +1,97 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.Map; + +/** + * The type used for updating tags in RedshiftClusterParameterGroup resources. + */ +@Fluent +public final class RedshiftClusterParameterGroupTagsUpdate + implements JsonSerializable { + /* + * Resource tags. + */ + private Map tags; + + /** + * Creates an instance of RedshiftClusterParameterGroupTagsUpdate class. + */ + public RedshiftClusterParameterGroupTagsUpdate() { + } + + /** + * Get the tags property: Resource tags. + * + * @return the tags value. + */ + public Map tags() { + return this.tags; + } + + /** + * Set the tags property: Resource tags. + * + * @param tags the tags value to set. + * @return the RedshiftClusterParameterGroupTagsUpdate object itself. + */ + public RedshiftClusterParameterGroupTagsUpdate withTags(Map tags) { + this.tags = tags; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeMapField("tags", this.tags, (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of RedshiftClusterParameterGroupTagsUpdate from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of RedshiftClusterParameterGroupTagsUpdate if the JsonReader was pointing to an instance of + * it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the RedshiftClusterParameterGroupTagsUpdate. + */ + public static RedshiftClusterParameterGroupTagsUpdate fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + RedshiftClusterParameterGroupTagsUpdate deserializedRedshiftClusterParameterGroupTagsUpdate + = new RedshiftClusterParameterGroupTagsUpdate(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedRedshiftClusterParameterGroupTagsUpdate.tags = tags; + } else { + reader.skipChildren(); + } + } + + return deserializedRedshiftClusterParameterGroupTagsUpdate; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/RedshiftClusterParameterGroups.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/RedshiftClusterParameterGroups.java new file mode 100644 index 000000000000..2eef5e276a02 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/RedshiftClusterParameterGroups.java @@ -0,0 +1,162 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** + * Resource collection API of RedshiftClusterParameterGroups. + */ +public interface RedshiftClusterParameterGroups { + /** + * List RedshiftClusterParameterGroup resources by subscription ID. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a RedshiftClusterParameterGroup list operation as paginated response with + * {@link PagedIterable}. + */ + PagedIterable list(); + + /** + * List RedshiftClusterParameterGroup resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a RedshiftClusterParameterGroup list operation as paginated response with + * {@link PagedIterable}. + */ + PagedIterable list(Context context); + + /** + * List RedshiftClusterParameterGroup resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a RedshiftClusterParameterGroup list operation as paginated response with + * {@link PagedIterable}. + */ + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * List RedshiftClusterParameterGroup resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a RedshiftClusterParameterGroup list operation as paginated response with + * {@link PagedIterable}. + */ + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Get a RedshiftClusterParameterGroup. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of RedshiftClusterParameterGroup. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a RedshiftClusterParameterGroup along with {@link Response}. + */ + Response getByResourceGroupWithResponse(String resourceGroupName, String name, + Context context); + + /** + * Get a RedshiftClusterParameterGroup. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of RedshiftClusterParameterGroup. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a RedshiftClusterParameterGroup. + */ + RedshiftClusterParameterGroup getByResourceGroup(String resourceGroupName, String name); + + /** + * Delete a RedshiftClusterParameterGroup. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of RedshiftClusterParameterGroup. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByResourceGroup(String resourceGroupName, String name); + + /** + * Delete a RedshiftClusterParameterGroup. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of RedshiftClusterParameterGroup. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String name, Context context); + + /** + * Get a RedshiftClusterParameterGroup. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a RedshiftClusterParameterGroup along with {@link Response}. + */ + RedshiftClusterParameterGroup getById(String id); + + /** + * Get a RedshiftClusterParameterGroup. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a RedshiftClusterParameterGroup along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Delete a RedshiftClusterParameterGroup. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteById(String id); + + /** + * Delete a RedshiftClusterParameterGroup. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new RedshiftClusterParameterGroup resource. + * + * @param name resource name. + * @return the first stage of the new RedshiftClusterParameterGroup definition. + */ + RedshiftClusterParameterGroup.DefinitionStages.Blank define(String name); +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/RedshiftClusterProperties.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/RedshiftClusterProperties.java new file mode 100644 index 000000000000..1441e47b669e --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/RedshiftClusterProperties.java @@ -0,0 +1,311 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.Map; + +/** + * Definition of RedshiftCluster. + */ +@Fluent +public final class RedshiftClusterProperties implements JsonSerializable { + /* + * AWS Properties + */ + private AwsRedshiftClusterProperties awsProperties; + + /* + * Public Cloud Connectors Resource ID + */ + private String publicCloudConnectorsResourceId; + + /* + * AWS Account ID + */ + private String awsAccountId; + + /* + * Amazon Resource Name (ARN) + */ + private String arn; + + /* + * Public Cloud Resource Name + */ + private String publicCloudResourceName; + + /* + * AWS Source Schema + */ + private String awsSourceSchema; + + /* + * AWS Region + */ + private String awsRegion; + + /* + * AWS Tags + */ + private Map awsTags; + + /* + * The status of the last operation. + */ + private ProvisioningState provisioningState; + + /** + * Creates an instance of RedshiftClusterProperties class. + */ + public RedshiftClusterProperties() { + } + + /** + * Get the awsProperties property: AWS Properties. + * + * @return the awsProperties value. + */ + public AwsRedshiftClusterProperties awsProperties() { + return this.awsProperties; + } + + /** + * Set the awsProperties property: AWS Properties. + * + * @param awsProperties the awsProperties value to set. + * @return the RedshiftClusterProperties object itself. + */ + public RedshiftClusterProperties withAwsProperties(AwsRedshiftClusterProperties awsProperties) { + this.awsProperties = awsProperties; + return this; + } + + /** + * Get the publicCloudConnectorsResourceId property: Public Cloud Connectors Resource ID. + * + * @return the publicCloudConnectorsResourceId value. + */ + public String publicCloudConnectorsResourceId() { + return this.publicCloudConnectorsResourceId; + } + + /** + * Set the publicCloudConnectorsResourceId property: Public Cloud Connectors Resource ID. + * + * @param publicCloudConnectorsResourceId the publicCloudConnectorsResourceId value to set. + * @return the RedshiftClusterProperties object itself. + */ + public RedshiftClusterProperties withPublicCloudConnectorsResourceId(String publicCloudConnectorsResourceId) { + this.publicCloudConnectorsResourceId = publicCloudConnectorsResourceId; + return this; + } + + /** + * Get the awsAccountId property: AWS Account ID. + * + * @return the awsAccountId value. + */ + public String awsAccountId() { + return this.awsAccountId; + } + + /** + * Set the awsAccountId property: AWS Account ID. + * + * @param awsAccountId the awsAccountId value to set. + * @return the RedshiftClusterProperties object itself. + */ + public RedshiftClusterProperties withAwsAccountId(String awsAccountId) { + this.awsAccountId = awsAccountId; + return this; + } + + /** + * Get the arn property: Amazon Resource Name (ARN). + * + * @return the arn value. + */ + public String arn() { + return this.arn; + } + + /** + * Set the arn property: Amazon Resource Name (ARN). + * + * @param arn the arn value to set. + * @return the RedshiftClusterProperties object itself. + */ + public RedshiftClusterProperties withArn(String arn) { + this.arn = arn; + return this; + } + + /** + * Get the publicCloudResourceName property: Public Cloud Resource Name. + * + * @return the publicCloudResourceName value. + */ + public String publicCloudResourceName() { + return this.publicCloudResourceName; + } + + /** + * Set the publicCloudResourceName property: Public Cloud Resource Name. + * + * @param publicCloudResourceName the publicCloudResourceName value to set. + * @return the RedshiftClusterProperties object itself. + */ + public RedshiftClusterProperties withPublicCloudResourceName(String publicCloudResourceName) { + this.publicCloudResourceName = publicCloudResourceName; + return this; + } + + /** + * Get the awsSourceSchema property: AWS Source Schema. + * + * @return the awsSourceSchema value. + */ + public String awsSourceSchema() { + return this.awsSourceSchema; + } + + /** + * Set the awsSourceSchema property: AWS Source Schema. + * + * @param awsSourceSchema the awsSourceSchema value to set. + * @return the RedshiftClusterProperties object itself. + */ + public RedshiftClusterProperties withAwsSourceSchema(String awsSourceSchema) { + this.awsSourceSchema = awsSourceSchema; + return this; + } + + /** + * Get the awsRegion property: AWS Region. + * + * @return the awsRegion value. + */ + public String awsRegion() { + return this.awsRegion; + } + + /** + * Set the awsRegion property: AWS Region. + * + * @param awsRegion the awsRegion value to set. + * @return the RedshiftClusterProperties object itself. + */ + public RedshiftClusterProperties withAwsRegion(String awsRegion) { + this.awsRegion = awsRegion; + return this; + } + + /** + * Get the awsTags property: AWS Tags. + * + * @return the awsTags value. + */ + public Map awsTags() { + return this.awsTags; + } + + /** + * Set the awsTags property: AWS Tags. + * + * @param awsTags the awsTags value to set. + * @return the RedshiftClusterProperties object itself. + */ + public RedshiftClusterProperties withAwsTags(Map awsTags) { + this.awsTags = awsTags; + return this; + } + + /** + * Get the provisioningState property: The status of the last operation. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (awsProperties() != null) { + awsProperties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("awsProperties", this.awsProperties); + jsonWriter.writeStringField("publicCloudConnectorsResourceId", this.publicCloudConnectorsResourceId); + jsonWriter.writeStringField("awsAccountId", this.awsAccountId); + jsonWriter.writeStringField("arn", this.arn); + jsonWriter.writeStringField("publicCloudResourceName", this.publicCloudResourceName); + jsonWriter.writeStringField("awsSourceSchema", this.awsSourceSchema); + jsonWriter.writeStringField("awsRegion", this.awsRegion); + jsonWriter.writeMapField("awsTags", this.awsTags, (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of RedshiftClusterProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of RedshiftClusterProperties if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IOException If an error occurs while reading the RedshiftClusterProperties. + */ + public static RedshiftClusterProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + RedshiftClusterProperties deserializedRedshiftClusterProperties = new RedshiftClusterProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("awsProperties".equals(fieldName)) { + deserializedRedshiftClusterProperties.awsProperties = AwsRedshiftClusterProperties.fromJson(reader); + } else if ("publicCloudConnectorsResourceId".equals(fieldName)) { + deserializedRedshiftClusterProperties.publicCloudConnectorsResourceId = reader.getString(); + } else if ("awsAccountId".equals(fieldName)) { + deserializedRedshiftClusterProperties.awsAccountId = reader.getString(); + } else if ("arn".equals(fieldName)) { + deserializedRedshiftClusterProperties.arn = reader.getString(); + } else if ("publicCloudResourceName".equals(fieldName)) { + deserializedRedshiftClusterProperties.publicCloudResourceName = reader.getString(); + } else if ("awsSourceSchema".equals(fieldName)) { + deserializedRedshiftClusterProperties.awsSourceSchema = reader.getString(); + } else if ("awsRegion".equals(fieldName)) { + deserializedRedshiftClusterProperties.awsRegion = reader.getString(); + } else if ("awsTags".equals(fieldName)) { + Map awsTags = reader.readMap(reader1 -> reader1.getString()); + deserializedRedshiftClusterProperties.awsTags = awsTags; + } else if ("provisioningState".equals(fieldName)) { + deserializedRedshiftClusterProperties.provisioningState + = ProvisioningState.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedRedshiftClusterProperties; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/RedshiftClusterTagsUpdate.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/RedshiftClusterTagsUpdate.java new file mode 100644 index 000000000000..393f0916c61f --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/RedshiftClusterTagsUpdate.java @@ -0,0 +1,95 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.Map; + +/** + * The type used for updating tags in RedshiftCluster resources. + */ +@Fluent +public final class RedshiftClusterTagsUpdate implements JsonSerializable { + /* + * Resource tags. + */ + private Map tags; + + /** + * Creates an instance of RedshiftClusterTagsUpdate class. + */ + public RedshiftClusterTagsUpdate() { + } + + /** + * Get the tags property: Resource tags. + * + * @return the tags value. + */ + public Map tags() { + return this.tags; + } + + /** + * Set the tags property: Resource tags. + * + * @param tags the tags value to set. + * @return the RedshiftClusterTagsUpdate object itself. + */ + public RedshiftClusterTagsUpdate withTags(Map tags) { + this.tags = tags; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeMapField("tags", this.tags, (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of RedshiftClusterTagsUpdate from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of RedshiftClusterTagsUpdate if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IOException If an error occurs while reading the RedshiftClusterTagsUpdate. + */ + public static RedshiftClusterTagsUpdate fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + RedshiftClusterTagsUpdate deserializedRedshiftClusterTagsUpdate = new RedshiftClusterTagsUpdate(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedRedshiftClusterTagsUpdate.tags = tags; + } else { + reader.skipChildren(); + } + } + + return deserializedRedshiftClusterTagsUpdate; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/RedshiftClusters.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/RedshiftClusters.java new file mode 100644 index 000000000000..e8f30bac0b0d --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/RedshiftClusters.java @@ -0,0 +1,157 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** + * Resource collection API of RedshiftClusters. + */ +public interface RedshiftClusters { + /** + * List RedshiftCluster resources by subscription ID. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a RedshiftCluster list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable list(); + + /** + * List RedshiftCluster resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a RedshiftCluster list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable list(Context context); + + /** + * List RedshiftCluster resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a RedshiftCluster list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * List RedshiftCluster resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a RedshiftCluster list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Get a RedshiftCluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of RedshiftCluster. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a RedshiftCluster along with {@link Response}. + */ + Response getByResourceGroupWithResponse(String resourceGroupName, String name, Context context); + + /** + * Get a RedshiftCluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of RedshiftCluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a RedshiftCluster. + */ + RedshiftCluster getByResourceGroup(String resourceGroupName, String name); + + /** + * Delete a RedshiftCluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of RedshiftCluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByResourceGroup(String resourceGroupName, String name); + + /** + * Delete a RedshiftCluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of RedshiftCluster. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String name, Context context); + + /** + * Get a RedshiftCluster. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a RedshiftCluster along with {@link Response}. + */ + RedshiftCluster getById(String id); + + /** + * Get a RedshiftCluster. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a RedshiftCluster along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Delete a RedshiftCluster. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteById(String id); + + /** + * Delete a RedshiftCluster. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new RedshiftCluster resource. + * + * @param name resource name. + * @return the first stage of the new RedshiftCluster definition. + */ + RedshiftCluster.DefinitionStages.Blank define(String name); +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ReferenceSets.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ReferenceSets.java new file mode 100644 index 000000000000..4f901e9b2b41 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ReferenceSets.java @@ -0,0 +1,104 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.Map; + +/** + * Definition of ReferenceSets. + */ +@Fluent +public final class ReferenceSets implements JsonSerializable { + /* + * Property ipSetReferences + */ + private Map ipSetReferences; + + /** + * Creates an instance of ReferenceSets class. + */ + public ReferenceSets() { + } + + /** + * Get the ipSetReferences property: Property ipSetReferences. + * + * @return the ipSetReferences value. + */ + public Map ipSetReferences() { + return this.ipSetReferences; + } + + /** + * Set the ipSetReferences property: Property ipSetReferences. + * + * @param ipSetReferences the ipSetReferences value to set. + * @return the ReferenceSets object itself. + */ + public ReferenceSets withIpSetReferences(Map ipSetReferences) { + this.ipSetReferences = ipSetReferences; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (ipSetReferences() != null) { + ipSetReferences().values().forEach(e -> { + if (e != null) { + e.validate(); + } + }); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeMapField("ipSetReferences", this.ipSetReferences, + (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ReferenceSets from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ReferenceSets if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the ReferenceSets. + */ + public static ReferenceSets fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ReferenceSets deserializedReferenceSets = new ReferenceSets(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("ipSetReferences".equals(fieldName)) { + Map ipSetReferences + = reader.readMap(reader1 -> IpSetReference.fromJson(reader1)); + deserializedReferenceSets.ipSetReferences = ipSetReferences; + } else { + reader.skipChildren(); + } + } + + return deserializedReferenceSets; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/RegistryCredential.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/RegistryCredential.java new file mode 100644 index 000000000000..ffe2ec1dbc6e --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/RegistryCredential.java @@ -0,0 +1,134 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of RegistryCredential. + */ +@Fluent +public final class RegistryCredential implements JsonSerializable { + /* + *

The Amazon Resource Name (ARN) or name of credentials created using Secrets Manager.

The + * credential can use the name of the credentials only if they exist in your current Amazon Web + * Services Region.

+ */ + private String credential; + + /* + *

The service that created the credentials to access a private Docker registry. The valid value, + * SECRETS_MANAGER, is for Secrets Manager.

+ */ + private CredentialProviderTypeEnumValue credentialProvider; + + /** + * Creates an instance of RegistryCredential class. + */ + public RegistryCredential() { + } + + /** + * Get the credential property: <p> The Amazon Resource Name (ARN) or name of credentials created using + * Secrets Manager. </p> <note> <p> The <code>credential</code> can use the name of + * the credentials only if they exist in your current Amazon Web Services Region. </p> </note>. + * + * @return the credential value. + */ + public String credential() { + return this.credential; + } + + /** + * Set the credential property: <p> The Amazon Resource Name (ARN) or name of credentials created using + * Secrets Manager. </p> <note> <p> The <code>credential</code> can use the name of + * the credentials only if they exist in your current Amazon Web Services Region. </p> </note>. + * + * @param credential the credential value to set. + * @return the RegistryCredential object itself. + */ + public RegistryCredential withCredential(String credential) { + this.credential = credential; + return this; + } + + /** + * Get the credentialProvider property: <p> The service that created the credentials to access a private + * Docker registry. The valid value, SECRETS_MANAGER, is for Secrets Manager. </p>. + * + * @return the credentialProvider value. + */ + public CredentialProviderTypeEnumValue credentialProvider() { + return this.credentialProvider; + } + + /** + * Set the credentialProvider property: <p> The service that created the credentials to access a private + * Docker registry. The valid value, SECRETS_MANAGER, is for Secrets Manager. </p>. + * + * @param credentialProvider the credentialProvider value to set. + * @return the RegistryCredential object itself. + */ + public RegistryCredential withCredentialProvider(CredentialProviderTypeEnumValue credentialProvider) { + this.credentialProvider = credentialProvider; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (credentialProvider() != null) { + credentialProvider().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("credential", this.credential); + jsonWriter.writeJsonField("credentialProvider", this.credentialProvider); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of RegistryCredential from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of RegistryCredential if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the RegistryCredential. + */ + public static RegistryCredential fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + RegistryCredential deserializedRegistryCredential = new RegistryCredential(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("credential".equals(fieldName)) { + deserializedRegistryCredential.credential = reader.getString(); + } else if ("credentialProvider".equals(fieldName)) { + deserializedRegistryCredential.credentialProvider + = CredentialProviderTypeEnumValue.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedRegistryCredential; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/RemoteAccess.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/RemoteAccess.java new file mode 100644 index 000000000000..22a033226cd2 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/RemoteAccess.java @@ -0,0 +1,124 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Definition of RemoteAccess. + */ +@Fluent +public final class RemoteAccess implements JsonSerializable { + /* + * Property ec2SshKey + */ + private String ec2SshKey; + + /* + * Property sourceSecurityGroups + */ + private List sourceSecurityGroups; + + /** + * Creates an instance of RemoteAccess class. + */ + public RemoteAccess() { + } + + /** + * Get the ec2SshKey property: Property ec2SshKey. + * + * @return the ec2SshKey value. + */ + public String ec2SshKey() { + return this.ec2SshKey; + } + + /** + * Set the ec2SshKey property: Property ec2SshKey. + * + * @param ec2SshKey the ec2SshKey value to set. + * @return the RemoteAccess object itself. + */ + public RemoteAccess withEc2SshKey(String ec2SshKey) { + this.ec2SshKey = ec2SshKey; + return this; + } + + /** + * Get the sourceSecurityGroups property: Property sourceSecurityGroups. + * + * @return the sourceSecurityGroups value. + */ + public List sourceSecurityGroups() { + return this.sourceSecurityGroups; + } + + /** + * Set the sourceSecurityGroups property: Property sourceSecurityGroups. + * + * @param sourceSecurityGroups the sourceSecurityGroups value to set. + * @return the RemoteAccess object itself. + */ + public RemoteAccess withSourceSecurityGroups(List sourceSecurityGroups) { + this.sourceSecurityGroups = sourceSecurityGroups; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("ec2SshKey", this.ec2SshKey); + jsonWriter.writeArrayField("sourceSecurityGroups", this.sourceSecurityGroups, + (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of RemoteAccess from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of RemoteAccess if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the RemoteAccess. + */ + public static RemoteAccess fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + RemoteAccess deserializedRemoteAccess = new RemoteAccess(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("ec2SshKey".equals(fieldName)) { + deserializedRemoteAccess.ec2SshKey = reader.getString(); + } else if ("sourceSecurityGroups".equals(fieldName)) { + List sourceSecurityGroups = reader.readArray(reader1 -> reader1.getString()); + deserializedRemoteAccess.sourceSecurityGroups = sourceSecurityGroups; + } else { + reader.skipChildren(); + } + } + + return deserializedRemoteAccess; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/RenewalEligibility.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/RenewalEligibility.java new file mode 100644 index 000000000000..6bcbadf429ee --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/RenewalEligibility.java @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * RenewalEligibility enum. + */ +public final class RenewalEligibility extends ExpandableStringEnum { + /** + * Static value ELIGIBLE for RenewalEligibility. + */ + public static final RenewalEligibility ELIGIBLE = fromString("ELIGIBLE"); + + /** + * Static value INELIGIBLE for RenewalEligibility. + */ + public static final RenewalEligibility INELIGIBLE = fromString("INELIGIBLE"); + + /** + * Creates a new instance of RenewalEligibility value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public RenewalEligibility() { + } + + /** + * Creates or finds a RenewalEligibility from its string representation. + * + * @param name a name to look for. + * @return the corresponding RenewalEligibility. + */ + public static RenewalEligibility fromString(String name) { + return fromString(name, RenewalEligibility.class); + } + + /** + * Gets known RenewalEligibility values. + * + * @return known RenewalEligibility values. + */ + public static Collection values() { + return values(RenewalEligibility.class); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/RenewalEligibilityEnumValue.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/RenewalEligibilityEnumValue.java new file mode 100644 index 000000000000..478b57893527 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/RenewalEligibilityEnumValue.java @@ -0,0 +1,93 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of RenewalEligibilityEnumValue. + */ +@Fluent +public final class RenewalEligibilityEnumValue implements JsonSerializable { + /* + * Property value + */ + private RenewalEligibility value; + + /** + * Creates an instance of RenewalEligibilityEnumValue class. + */ + public RenewalEligibilityEnumValue() { + } + + /** + * Get the value property: Property value. + * + * @return the value value. + */ + public RenewalEligibility value() { + return this.value; + } + + /** + * Set the value property: Property value. + * + * @param value the value value to set. + * @return the RenewalEligibilityEnumValue object itself. + */ + public RenewalEligibilityEnumValue withValue(RenewalEligibility value) { + this.value = value; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("value", this.value == null ? null : this.value.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of RenewalEligibilityEnumValue from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of RenewalEligibilityEnumValue if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the RenewalEligibilityEnumValue. + */ + public static RenewalEligibilityEnumValue fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + RenewalEligibilityEnumValue deserializedRenewalEligibilityEnumValue = new RenewalEligibilityEnumValue(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + deserializedRenewalEligibilityEnumValue.value = RenewalEligibility.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedRenewalEligibilityEnumValue; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ReplicaModifications.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ReplicaModifications.java new file mode 100644 index 000000000000..8a85d5718255 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ReplicaModifications.java @@ -0,0 +1,95 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of ReplicaModifications. + */ +@Fluent +public final class ReplicaModifications implements JsonSerializable { + /* + * Specifies whether Amazon S3 replicates modifications on replicas. *Allowed values*: ``Enabled`` | ``Disabled`` + */ + private ReplicaModificationsStatus status; + + /** + * Creates an instance of ReplicaModifications class. + */ + public ReplicaModifications() { + } + + /** + * Get the status property: Specifies whether Amazon S3 replicates modifications on replicas. *Allowed values*: + * ``Enabled`` | ``Disabled``. + * + * @return the status value. + */ + public ReplicaModificationsStatus status() { + return this.status; + } + + /** + * Set the status property: Specifies whether Amazon S3 replicates modifications on replicas. *Allowed values*: + * ``Enabled`` | ``Disabled``. + * + * @param status the status value to set. + * @return the ReplicaModifications object itself. + */ + public ReplicaModifications withStatus(ReplicaModificationsStatus status) { + this.status = status; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("status", this.status == null ? null : this.status.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ReplicaModifications from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ReplicaModifications if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the ReplicaModifications. + */ + public static ReplicaModifications fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ReplicaModifications deserializedReplicaModifications = new ReplicaModifications(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("status".equals(fieldName)) { + deserializedReplicaModifications.status = ReplicaModificationsStatus.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedReplicaModifications; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ReplicaModificationsStatus.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ReplicaModificationsStatus.java new file mode 100644 index 000000000000..bc429dc35420 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ReplicaModificationsStatus.java @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * ReplicaModificationsStatus enum. + */ +public final class ReplicaModificationsStatus extends ExpandableStringEnum { + /** + * Static value Disabled for ReplicaModificationsStatus. + */ + public static final ReplicaModificationsStatus DISABLED = fromString("Disabled"); + + /** + * Static value Enabled for ReplicaModificationsStatus. + */ + public static final ReplicaModificationsStatus ENABLED = fromString("Enabled"); + + /** + * Creates a new instance of ReplicaModificationsStatus value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ReplicaModificationsStatus() { + } + + /** + * Creates or finds a ReplicaModificationsStatus from its string representation. + * + * @param name a name to look for. + * @return the corresponding ReplicaModificationsStatus. + */ + public static ReplicaModificationsStatus fromString(String name) { + return fromString(name, ReplicaModificationsStatus.class); + } + + /** + * Gets known ReplicaModificationsStatus values. + * + * @return known ReplicaModificationsStatus values. + */ + public static Collection values() { + return values(ReplicaModificationsStatus.class); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ReplicaRegion.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ReplicaRegion.java new file mode 100644 index 000000000000..341f0e6e7f25 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ReplicaRegion.java @@ -0,0 +1,124 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of ReplicaRegion. + */ +@Fluent +public final class ReplicaRegion implements JsonSerializable { + /* + * The ARN, key ID, or alias of the KMS key to encrypt the secret. If you don't include this field, Secrets Manager + * uses ``aws/secretsmanager``. + */ + private String kmsKeyId; + + /* + * A string that represents a ``Region``, for example 'us-east-1'. + */ + private String region; + + /** + * Creates an instance of ReplicaRegion class. + */ + public ReplicaRegion() { + } + + /** + * Get the kmsKeyId property: The ARN, key ID, or alias of the KMS key to encrypt the secret. If you don't include + * this field, Secrets Manager uses ``aws/secretsmanager``. + * + * @return the kmsKeyId value. + */ + public String kmsKeyId() { + return this.kmsKeyId; + } + + /** + * Set the kmsKeyId property: The ARN, key ID, or alias of the KMS key to encrypt the secret. If you don't include + * this field, Secrets Manager uses ``aws/secretsmanager``. + * + * @param kmsKeyId the kmsKeyId value to set. + * @return the ReplicaRegion object itself. + */ + public ReplicaRegion withKmsKeyId(String kmsKeyId) { + this.kmsKeyId = kmsKeyId; + return this; + } + + /** + * Get the region property: A string that represents a ``Region``, for example 'us-east-1'. + * + * @return the region value. + */ + public String region() { + return this.region; + } + + /** + * Set the region property: A string that represents a ``Region``, for example 'us-east-1'. + * + * @param region the region value to set. + * @return the ReplicaRegion object itself. + */ + public ReplicaRegion withRegion(String region) { + this.region = region; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("kmsKeyId", this.kmsKeyId); + jsonWriter.writeStringField("region", this.region); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ReplicaRegion from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ReplicaRegion if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the ReplicaRegion. + */ + public static ReplicaRegion fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ReplicaRegion deserializedReplicaRegion = new ReplicaRegion(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("kmsKeyId".equals(fieldName)) { + deserializedReplicaRegion.kmsKeyId = reader.getString(); + } else if ("region".equals(fieldName)) { + deserializedReplicaRegion.region = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedReplicaRegion; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ReplicationConfiguration.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ReplicationConfiguration.java new file mode 100644 index 000000000000..3ca14d1d5e14 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ReplicationConfiguration.java @@ -0,0 +1,99 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Definition of ReplicationConfiguration. + */ +@Fluent +public final class ReplicationConfiguration implements JsonSerializable { + /* + * An array of destination objects. Only one destination object is supported. + */ + private List destinations; + + /** + * Creates an instance of ReplicationConfiguration class. + */ + public ReplicationConfiguration() { + } + + /** + * Get the destinations property: An array of destination objects. Only one destination object is supported. + * + * @return the destinations value. + */ + public List destinations() { + return this.destinations; + } + + /** + * Set the destinations property: An array of destination objects. Only one destination object is supported. + * + * @param destinations the destinations value to set. + * @return the ReplicationConfiguration object itself. + */ + public ReplicationConfiguration withDestinations(List destinations) { + this.destinations = destinations; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (destinations() != null) { + destinations().forEach(e -> e.validate()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("destinations", this.destinations, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ReplicationConfiguration from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ReplicationConfiguration if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ReplicationConfiguration. + */ + public static ReplicationConfiguration fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ReplicationConfiguration deserializedReplicationConfiguration = new ReplicationConfiguration(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("destinations".equals(fieldName)) { + List destinations + = reader.readArray(reader1 -> ReplicationDestination.fromJson(reader1)); + deserializedReplicationConfiguration.destinations = destinations; + } else { + reader.skipChildren(); + } + } + + return deserializedReplicationConfiguration; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ReplicationConfigurationAutoGenerated.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ReplicationConfigurationAutoGenerated.java new file mode 100644 index 000000000000..96497f0a43d1 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ReplicationConfigurationAutoGenerated.java @@ -0,0 +1,140 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Definition of ReplicationConfiguration. + */ +@Fluent +public final class ReplicationConfigurationAutoGenerated + implements JsonSerializable { + /* + * The Amazon Resource Name (ARN) of the IAMlong (IAM) role that Amazon S3 assumes when replicating objects. For + * more information, see [How to Set Up + * Replication](https://docs.aws.amazon.com/AmazonS3/latest/dev/replication-how-setup.html) in the *Amazon S3 User + * Guide*. + */ + private String role; + + /* + * A container for one or more replication rules. A replication configuration must have at least one rule and can + * contain a maximum of 1,000 rules. + */ + private List rules; + + /** + * Creates an instance of ReplicationConfigurationAutoGenerated class. + */ + public ReplicationConfigurationAutoGenerated() { + } + + /** + * Get the role property: The Amazon Resource Name (ARN) of the IAMlong (IAM) role that Amazon S3 assumes when + * replicating objects. For more information, see [How to Set Up + * Replication](https://docs.aws.amazon.com/AmazonS3/latest/dev/replication-how-setup.html) in the *Amazon S3 User + * Guide*. + * + * @return the role value. + */ + public String role() { + return this.role; + } + + /** + * Set the role property: The Amazon Resource Name (ARN) of the IAMlong (IAM) role that Amazon S3 assumes when + * replicating objects. For more information, see [How to Set Up + * Replication](https://docs.aws.amazon.com/AmazonS3/latest/dev/replication-how-setup.html) in the *Amazon S3 User + * Guide*. + * + * @param role the role value to set. + * @return the ReplicationConfigurationAutoGenerated object itself. + */ + public ReplicationConfigurationAutoGenerated withRole(String role) { + this.role = role; + return this; + } + + /** + * Get the rules property: A container for one or more replication rules. A replication configuration must have at + * least one rule and can contain a maximum of 1,000 rules. + * + * @return the rules value. + */ + public List rules() { + return this.rules; + } + + /** + * Set the rules property: A container for one or more replication rules. A replication configuration must have at + * least one rule and can contain a maximum of 1,000 rules. + * + * @param rules the rules value to set. + * @return the ReplicationConfigurationAutoGenerated object itself. + */ + public ReplicationConfigurationAutoGenerated withRules(List rules) { + this.rules = rules; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (rules() != null) { + rules().forEach(e -> e.validate()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("role", this.role); + jsonWriter.writeArrayField("rules", this.rules, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ReplicationConfigurationAutoGenerated from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ReplicationConfigurationAutoGenerated if the JsonReader was pointing to an instance of it, + * or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ReplicationConfigurationAutoGenerated. + */ + public static ReplicationConfigurationAutoGenerated fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ReplicationConfigurationAutoGenerated deserializedReplicationConfigurationAutoGenerated + = new ReplicationConfigurationAutoGenerated(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("role".equals(fieldName)) { + deserializedReplicationConfigurationAutoGenerated.role = reader.getString(); + } else if ("rules".equals(fieldName)) { + List rules = reader.readArray(reader1 -> ReplicationRule.fromJson(reader1)); + deserializedReplicationConfigurationAutoGenerated.rules = rules; + } else { + reader.skipChildren(); + } + } + + return deserializedReplicationConfigurationAutoGenerated; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ReplicationDestination.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ReplicationDestination.java new file mode 100644 index 000000000000..b83187fefc59 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ReplicationDestination.java @@ -0,0 +1,194 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of ReplicationDestination. + */ +@Fluent +public final class ReplicationDestination implements JsonSerializable { + /* + * The AWS For One Zone file systems, the replication configuration must specify the Availability Zone in which the + * destination file system is located. Use the format ``us-east-1a`` to specify the Availability Zone. For more + * information about One Zone file systems, see [EFS file system + * types](https://docs.aws.amazon.com/efs/latest/ug/storage-classes.html) in the *Amazon EFS User Guide*. One Zone + * file system type is not available in all Availability Zones in AWS-Regions where Amazon EFS is available. + */ + private String availabilityZoneName; + + /* + * The ID of the destination Amazon EFS file system. + */ + private String fileSystemId; + + /* + * The ID of an kms-key-long used to protect the encrypted file system. + */ + private String kmsKeyId; + + /* + * The AWS-Region in which the destination file system is located. For One Zone file systems, the replication + * configuration must specify the AWS-Region in which the destination file system is located. + */ + private String region; + + /** + * Creates an instance of ReplicationDestination class. + */ + public ReplicationDestination() { + } + + /** + * Get the availabilityZoneName property: The AWS For One Zone file systems, the replication configuration must + * specify the Availability Zone in which the destination file system is located. Use the format ``us-east-1a`` to + * specify the Availability Zone. For more information about One Zone file systems, see [EFS file system + * types](https://docs.aws.amazon.com/efs/latest/ug/storage-classes.html) in the *Amazon EFS User Guide*. One Zone + * file system type is not available in all Availability Zones in AWS-Regions where Amazon EFS is available. + * + * @return the availabilityZoneName value. + */ + public String availabilityZoneName() { + return this.availabilityZoneName; + } + + /** + * Set the availabilityZoneName property: The AWS For One Zone file systems, the replication configuration must + * specify the Availability Zone in which the destination file system is located. Use the format ``us-east-1a`` to + * specify the Availability Zone. For more information about One Zone file systems, see [EFS file system + * types](https://docs.aws.amazon.com/efs/latest/ug/storage-classes.html) in the *Amazon EFS User Guide*. One Zone + * file system type is not available in all Availability Zones in AWS-Regions where Amazon EFS is available. + * + * @param availabilityZoneName the availabilityZoneName value to set. + * @return the ReplicationDestination object itself. + */ + public ReplicationDestination withAvailabilityZoneName(String availabilityZoneName) { + this.availabilityZoneName = availabilityZoneName; + return this; + } + + /** + * Get the fileSystemId property: The ID of the destination Amazon EFS file system. + * + * @return the fileSystemId value. + */ + public String fileSystemId() { + return this.fileSystemId; + } + + /** + * Set the fileSystemId property: The ID of the destination Amazon EFS file system. + * + * @param fileSystemId the fileSystemId value to set. + * @return the ReplicationDestination object itself. + */ + public ReplicationDestination withFileSystemId(String fileSystemId) { + this.fileSystemId = fileSystemId; + return this; + } + + /** + * Get the kmsKeyId property: The ID of an kms-key-long used to protect the encrypted file system. + * + * @return the kmsKeyId value. + */ + public String kmsKeyId() { + return this.kmsKeyId; + } + + /** + * Set the kmsKeyId property: The ID of an kms-key-long used to protect the encrypted file system. + * + * @param kmsKeyId the kmsKeyId value to set. + * @return the ReplicationDestination object itself. + */ + public ReplicationDestination withKmsKeyId(String kmsKeyId) { + this.kmsKeyId = kmsKeyId; + return this; + } + + /** + * Get the region property: The AWS-Region in which the destination file system is located. For One Zone file + * systems, the replication configuration must specify the AWS-Region in which the destination file system is + * located. + * + * @return the region value. + */ + public String region() { + return this.region; + } + + /** + * Set the region property: The AWS-Region in which the destination file system is located. For One Zone file + * systems, the replication configuration must specify the AWS-Region in which the destination file system is + * located. + * + * @param region the region value to set. + * @return the ReplicationDestination object itself. + */ + public ReplicationDestination withRegion(String region) { + this.region = region; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("availabilityZoneName", this.availabilityZoneName); + jsonWriter.writeStringField("fileSystemId", this.fileSystemId); + jsonWriter.writeStringField("kmsKeyId", this.kmsKeyId); + jsonWriter.writeStringField("region", this.region); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ReplicationDestination from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ReplicationDestination if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the ReplicationDestination. + */ + public static ReplicationDestination fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ReplicationDestination deserializedReplicationDestination = new ReplicationDestination(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("availabilityZoneName".equals(fieldName)) { + deserializedReplicationDestination.availabilityZoneName = reader.getString(); + } else if ("fileSystemId".equals(fieldName)) { + deserializedReplicationDestination.fileSystemId = reader.getString(); + } else if ("kmsKeyId".equals(fieldName)) { + deserializedReplicationDestination.kmsKeyId = reader.getString(); + } else if ("region".equals(fieldName)) { + deserializedReplicationDestination.region = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedReplicationDestination; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ReplicationDestinationAutoGenerated.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ReplicationDestinationAutoGenerated.java new file mode 100644 index 000000000000..db1e1f46250d --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ReplicationDestinationAutoGenerated.java @@ -0,0 +1,347 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of ReplicationDestination. + */ +@Fluent +public final class ReplicationDestinationAutoGenerated + implements JsonSerializable { + /* + * Specify this only in a cross-account scenario (where source and destination bucket owners are not the same), and + * you want to change replica ownership to the AWS-account that owns the destination bucket. If this is not + * specified in the replication configuration, the replicas are owned by same AWS-account that owns the source + * object. Specify this only in a cross-account scenario (where source and destination bucket owners are not the + * same), and you want to change replica ownership to the AWS-account that owns the destination bucket. If this is + * not specified in the replication configuration, the replicas are owned by same AWS-account that owns the source + * object. + */ + private AccessControlTranslation accessControlTranslation; + + /* + * Destination bucket owner account ID. In a cross-account scenario, if you direct Amazon S3 to change replica + * ownership to the AWS-account that owns the destination bucket by specifying the ``AccessControlTranslation`` + * property, this is the account ID of the destination bucket owner. For more information, see [Cross-Region + * Replication Additional Configuration: Change Replica + * Owner](https://docs.aws.amazon.com/AmazonS3/latest/dev/crr-change-owner.html) in the *Amazon S3 User Guide*. If + * you specify the ``AccessControlTranslation`` property, the ``Account`` property is required. + */ + private String account; + + /* + * The Amazon Resource Name (ARN) of the bucket where you want Amazon S3 to store the results. + */ + private String bucket; + + /* + * Specifies encryption-related information. Specifies encryption-related information for an Amazon S3 bucket that + * is a destination for replicated objects. + */ + private EncryptionConfigurationAutoGenerated encryptionConfiguration; + + /* + * A container specifying replication metrics-related settings enabling replication metrics and events. A container + * specifying replication metrics-related settings enabling replication metrics and events. + */ + private Metrics metrics; + + /* + * A container specifying S3 Replication Time Control (S3 RTC), including whether S3 RTC is enabled and the time + * when all objects and operations on objects must be replicated. Must be specified together with a ``Metrics`` + * block. A container specifying S3 Replication Time Control (S3 RTC) related information, including whether S3 RTC + * is enabled and the time when all objects and operations on objects must be replicated. Must be specified together + * with a ``Metrics`` block. + */ + private ReplicationTime replicationTime; + + /* + * The storage class to use when replicating objects, such as S3 Standard or reduced redundancy. By default, Amazon + * S3 uses the storage class of the source object to create the object replica. For valid values, see the + * ``StorageClass`` element of the [PUT Bucket + * replication](https://docs.aws.amazon.com/AmazonS3/latest/API/RESTBucketPUTreplication.html) action in the *Amazon + * S3 API Reference*. + */ + private ReplicationDestinationStorageClass storageClass; + + /** + * Creates an instance of ReplicationDestinationAutoGenerated class. + */ + public ReplicationDestinationAutoGenerated() { + } + + /** + * Get the accessControlTranslation property: Specify this only in a cross-account scenario (where source and + * destination bucket owners are not the same), and you want to change replica ownership to the AWS-account that + * owns the destination bucket. If this is not specified in the replication configuration, the replicas are owned by + * same AWS-account that owns the source object. Specify this only in a cross-account scenario (where source and + * destination bucket owners are not the same), and you want to change replica ownership to the AWS-account that + * owns the destination bucket. If this is not specified in the replication configuration, the replicas are owned by + * same AWS-account that owns the source object. + * + * @return the accessControlTranslation value. + */ + public AccessControlTranslation accessControlTranslation() { + return this.accessControlTranslation; + } + + /** + * Set the accessControlTranslation property: Specify this only in a cross-account scenario (where source and + * destination bucket owners are not the same), and you want to change replica ownership to the AWS-account that + * owns the destination bucket. If this is not specified in the replication configuration, the replicas are owned by + * same AWS-account that owns the source object. Specify this only in a cross-account scenario (where source and + * destination bucket owners are not the same), and you want to change replica ownership to the AWS-account that + * owns the destination bucket. If this is not specified in the replication configuration, the replicas are owned by + * same AWS-account that owns the source object. + * + * @param accessControlTranslation the accessControlTranslation value to set. + * @return the ReplicationDestinationAutoGenerated object itself. + */ + public ReplicationDestinationAutoGenerated + withAccessControlTranslation(AccessControlTranslation accessControlTranslation) { + this.accessControlTranslation = accessControlTranslation; + return this; + } + + /** + * Get the account property: Destination bucket owner account ID. In a cross-account scenario, if you direct Amazon + * S3 to change replica ownership to the AWS-account that owns the destination bucket by specifying the + * ``AccessControlTranslation`` property, this is the account ID of the destination bucket owner. For more + * information, see [Cross-Region Replication Additional Configuration: Change Replica + * Owner](https://docs.aws.amazon.com/AmazonS3/latest/dev/crr-change-owner.html) in the *Amazon S3 User Guide*. If + * you specify the ``AccessControlTranslation`` property, the ``Account`` property is required. + * + * @return the account value. + */ + public String account() { + return this.account; + } + + /** + * Set the account property: Destination bucket owner account ID. In a cross-account scenario, if you direct Amazon + * S3 to change replica ownership to the AWS-account that owns the destination bucket by specifying the + * ``AccessControlTranslation`` property, this is the account ID of the destination bucket owner. For more + * information, see [Cross-Region Replication Additional Configuration: Change Replica + * Owner](https://docs.aws.amazon.com/AmazonS3/latest/dev/crr-change-owner.html) in the *Amazon S3 User Guide*. If + * you specify the ``AccessControlTranslation`` property, the ``Account`` property is required. + * + * @param account the account value to set. + * @return the ReplicationDestinationAutoGenerated object itself. + */ + public ReplicationDestinationAutoGenerated withAccount(String account) { + this.account = account; + return this; + } + + /** + * Get the bucket property: The Amazon Resource Name (ARN) of the bucket where you want Amazon S3 to store the + * results. + * + * @return the bucket value. + */ + public String bucket() { + return this.bucket; + } + + /** + * Set the bucket property: The Amazon Resource Name (ARN) of the bucket where you want Amazon S3 to store the + * results. + * + * @param bucket the bucket value to set. + * @return the ReplicationDestinationAutoGenerated object itself. + */ + public ReplicationDestinationAutoGenerated withBucket(String bucket) { + this.bucket = bucket; + return this; + } + + /** + * Get the encryptionConfiguration property: Specifies encryption-related information. Specifies encryption-related + * information for an Amazon S3 bucket that is a destination for replicated objects. + * + * @return the encryptionConfiguration value. + */ + public EncryptionConfigurationAutoGenerated encryptionConfiguration() { + return this.encryptionConfiguration; + } + + /** + * Set the encryptionConfiguration property: Specifies encryption-related information. Specifies encryption-related + * information for an Amazon S3 bucket that is a destination for replicated objects. + * + * @param encryptionConfiguration the encryptionConfiguration value to set. + * @return the ReplicationDestinationAutoGenerated object itself. + */ + public ReplicationDestinationAutoGenerated + withEncryptionConfiguration(EncryptionConfigurationAutoGenerated encryptionConfiguration) { + this.encryptionConfiguration = encryptionConfiguration; + return this; + } + + /** + * Get the metrics property: A container specifying replication metrics-related settings enabling replication + * metrics and events. A container specifying replication metrics-related settings enabling replication metrics and + * events. + * + * @return the metrics value. + */ + public Metrics metrics() { + return this.metrics; + } + + /** + * Set the metrics property: A container specifying replication metrics-related settings enabling replication + * metrics and events. A container specifying replication metrics-related settings enabling replication metrics and + * events. + * + * @param metrics the metrics value to set. + * @return the ReplicationDestinationAutoGenerated object itself. + */ + public ReplicationDestinationAutoGenerated withMetrics(Metrics metrics) { + this.metrics = metrics; + return this; + } + + /** + * Get the replicationTime property: A container specifying S3 Replication Time Control (S3 RTC), including whether + * S3 RTC is enabled and the time when all objects and operations on objects must be replicated. Must be specified + * together with a ``Metrics`` block. A container specifying S3 Replication Time Control (S3 RTC) related + * information, including whether S3 RTC is enabled and the time when all objects and operations on objects must be + * replicated. Must be specified together with a ``Metrics`` block. + * + * @return the replicationTime value. + */ + public ReplicationTime replicationTime() { + return this.replicationTime; + } + + /** + * Set the replicationTime property: A container specifying S3 Replication Time Control (S3 RTC), including whether + * S3 RTC is enabled and the time when all objects and operations on objects must be replicated. Must be specified + * together with a ``Metrics`` block. A container specifying S3 Replication Time Control (S3 RTC) related + * information, including whether S3 RTC is enabled and the time when all objects and operations on objects must be + * replicated. Must be specified together with a ``Metrics`` block. + * + * @param replicationTime the replicationTime value to set. + * @return the ReplicationDestinationAutoGenerated object itself. + */ + public ReplicationDestinationAutoGenerated withReplicationTime(ReplicationTime replicationTime) { + this.replicationTime = replicationTime; + return this; + } + + /** + * Get the storageClass property: The storage class to use when replicating objects, such as S3 Standard or reduced + * redundancy. By default, Amazon S3 uses the storage class of the source object to create the object replica. For + * valid values, see the ``StorageClass`` element of the [PUT Bucket + * replication](https://docs.aws.amazon.com/AmazonS3/latest/API/RESTBucketPUTreplication.html) action in the *Amazon + * S3 API Reference*. + * + * @return the storageClass value. + */ + public ReplicationDestinationStorageClass storageClass() { + return this.storageClass; + } + + /** + * Set the storageClass property: The storage class to use when replicating objects, such as S3 Standard or reduced + * redundancy. By default, Amazon S3 uses the storage class of the source object to create the object replica. For + * valid values, see the ``StorageClass`` element of the [PUT Bucket + * replication](https://docs.aws.amazon.com/AmazonS3/latest/API/RESTBucketPUTreplication.html) action in the *Amazon + * S3 API Reference*. + * + * @param storageClass the storageClass value to set. + * @return the ReplicationDestinationAutoGenerated object itself. + */ + public ReplicationDestinationAutoGenerated withStorageClass(ReplicationDestinationStorageClass storageClass) { + this.storageClass = storageClass; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (accessControlTranslation() != null) { + accessControlTranslation().validate(); + } + if (encryptionConfiguration() != null) { + encryptionConfiguration().validate(); + } + if (metrics() != null) { + metrics().validate(); + } + if (replicationTime() != null) { + replicationTime().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("accessControlTranslation", this.accessControlTranslation); + jsonWriter.writeStringField("account", this.account); + jsonWriter.writeStringField("bucket", this.bucket); + jsonWriter.writeJsonField("encryptionConfiguration", this.encryptionConfiguration); + jsonWriter.writeJsonField("metrics", this.metrics); + jsonWriter.writeJsonField("replicationTime", this.replicationTime); + jsonWriter.writeStringField("storageClass", this.storageClass == null ? null : this.storageClass.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ReplicationDestinationAutoGenerated from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ReplicationDestinationAutoGenerated if the JsonReader was pointing to an instance of it, + * or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ReplicationDestinationAutoGenerated. + */ + public static ReplicationDestinationAutoGenerated fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ReplicationDestinationAutoGenerated deserializedReplicationDestinationAutoGenerated + = new ReplicationDestinationAutoGenerated(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("accessControlTranslation".equals(fieldName)) { + deserializedReplicationDestinationAutoGenerated.accessControlTranslation + = AccessControlTranslation.fromJson(reader); + } else if ("account".equals(fieldName)) { + deserializedReplicationDestinationAutoGenerated.account = reader.getString(); + } else if ("bucket".equals(fieldName)) { + deserializedReplicationDestinationAutoGenerated.bucket = reader.getString(); + } else if ("encryptionConfiguration".equals(fieldName)) { + deserializedReplicationDestinationAutoGenerated.encryptionConfiguration + = EncryptionConfigurationAutoGenerated.fromJson(reader); + } else if ("metrics".equals(fieldName)) { + deserializedReplicationDestinationAutoGenerated.metrics = Metrics.fromJson(reader); + } else if ("replicationTime".equals(fieldName)) { + deserializedReplicationDestinationAutoGenerated.replicationTime = ReplicationTime.fromJson(reader); + } else if ("storageClass".equals(fieldName)) { + deserializedReplicationDestinationAutoGenerated.storageClass + = ReplicationDestinationStorageClass.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedReplicationDestinationAutoGenerated; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ReplicationDestinationStorageClass.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ReplicationDestinationStorageClass.java new file mode 100644 index 000000000000..6f98eccaf8b9 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ReplicationDestinationStorageClass.java @@ -0,0 +1,81 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * ReplicationDestinationStorageClass enum. + */ +public final class ReplicationDestinationStorageClass extends ExpandableStringEnum { + /** + * Static value DEEP_ARCHIVE for ReplicationDestinationStorageClass. + */ + public static final ReplicationDestinationStorageClass DEEP_ARCHIVE = fromString("DEEP_ARCHIVE"); + + /** + * Static value GLACIER for ReplicationDestinationStorageClass. + */ + public static final ReplicationDestinationStorageClass GLACIER = fromString("GLACIER"); + + /** + * Static value GLACIER_IR for ReplicationDestinationStorageClass. + */ + public static final ReplicationDestinationStorageClass GLACIER_IR = fromString("GLACIER_IR"); + + /** + * Static value INTELLIGENT_TIERING for ReplicationDestinationStorageClass. + */ + public static final ReplicationDestinationStorageClass INTELLIGENT_TIERING = fromString("INTELLIGENT_TIERING"); + + /** + * Static value ONEZONE_IA for ReplicationDestinationStorageClass. + */ + public static final ReplicationDestinationStorageClass ONEZONE_IA = fromString("ONEZONE_IA"); + + /** + * Static value REDUCED_REDUNDANCY for ReplicationDestinationStorageClass. + */ + public static final ReplicationDestinationStorageClass REDUCED_REDUNDANCY = fromString("REDUCED_REDUNDANCY"); + + /** + * Static value STANDARD for ReplicationDestinationStorageClass. + */ + public static final ReplicationDestinationStorageClass STANDARD = fromString("STANDARD"); + + /** + * Static value STANDARD_IA for ReplicationDestinationStorageClass. + */ + public static final ReplicationDestinationStorageClass STANDARD_IA = fromString("STANDARD_IA"); + + /** + * Creates a new instance of ReplicationDestinationStorageClass value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ReplicationDestinationStorageClass() { + } + + /** + * Creates or finds a ReplicationDestinationStorageClass from its string representation. + * + * @param name a name to look for. + * @return the corresponding ReplicationDestinationStorageClass. + */ + public static ReplicationDestinationStorageClass fromString(String name) { + return fromString(name, ReplicationDestinationStorageClass.class); + } + + /** + * Gets known ReplicationDestinationStorageClass values. + * + * @return known ReplicationDestinationStorageClass values. + */ + public static Collection values() { + return values(ReplicationDestinationStorageClass.class); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ReplicationPendingModifiedValues.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ReplicationPendingModifiedValues.java new file mode 100644 index 000000000000..11471ba73944 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ReplicationPendingModifiedValues.java @@ -0,0 +1,229 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of ReplicationPendingModifiedValues. + */ +@Fluent +public final class ReplicationPendingModifiedValues implements JsonSerializable { + /* + *

The amount of storage (in gigabytes) that is allocated for the replication instance.

+ */ + private Integer allocatedStorage; + + /* + *

The engine version number of the replication instance.

+ */ + private String engineVersion; + + /* + *

Specifies whether the replication instance is a Multi-AZ deployment. You can't set the + * AvailabilityZone parameter if the Multi-AZ parameter is set to true.

+ */ + private Boolean multiAZ; + + /* + *

The type of IP address protocol used by a replication instance, such as IPv4 only or Dual-stack that supports + * both IPv4 and IPv6 addressing. IPv6 only is not yet supported.

+ */ + private String networkType; + + /* + *

The compute and memory capacity of the replication instance as defined for the specified replication instance + * class.

For more information on the settings and capacities for the available replication instance classes, + * see Selecting the right DMS replication instance for your migration.

+ */ + private String replicationInstanceClass; + + /** + * Creates an instance of ReplicationPendingModifiedValues class. + */ + public ReplicationPendingModifiedValues() { + } + + /** + * Get the allocatedStorage property: <p>The amount of storage (in gigabytes) that is allocated for the + * replication instance.</p>. + * + * @return the allocatedStorage value. + */ + public Integer allocatedStorage() { + return this.allocatedStorage; + } + + /** + * Set the allocatedStorage property: <p>The amount of storage (in gigabytes) that is allocated for the + * replication instance.</p>. + * + * @param allocatedStorage the allocatedStorage value to set. + * @return the ReplicationPendingModifiedValues object itself. + */ + public ReplicationPendingModifiedValues withAllocatedStorage(Integer allocatedStorage) { + this.allocatedStorage = allocatedStorage; + return this; + } + + /** + * Get the engineVersion property: <p>The engine version number of the replication instance.</p>. + * + * @return the engineVersion value. + */ + public String engineVersion() { + return this.engineVersion; + } + + /** + * Set the engineVersion property: <p>The engine version number of the replication instance.</p>. + * + * @param engineVersion the engineVersion value to set. + * @return the ReplicationPendingModifiedValues object itself. + */ + public ReplicationPendingModifiedValues withEngineVersion(String engineVersion) { + this.engineVersion = engineVersion; + return this; + } + + /** + * Get the multiAZ property: <p> Specifies whether the replication instance is a Multi-AZ deployment. You + * can't set the <code>AvailabilityZone</code> parameter if the Multi-AZ parameter is set to + * <code>true</code>. </p>. + * + * @return the multiAZ value. + */ + public Boolean multiAZ() { + return this.multiAZ; + } + + /** + * Set the multiAZ property: <p> Specifies whether the replication instance is a Multi-AZ deployment. You + * can't set the <code>AvailabilityZone</code> parameter if the Multi-AZ parameter is set to + * <code>true</code>. </p>. + * + * @param multiAZ the multiAZ value to set. + * @return the ReplicationPendingModifiedValues object itself. + */ + public ReplicationPendingModifiedValues withMultiAZ(Boolean multiAZ) { + this.multiAZ = multiAZ; + return this; + } + + /** + * Get the networkType property: <p>The type of IP address protocol used by a replication instance, such as + * IPv4 only or Dual-stack that supports both IPv4 and IPv6 addressing. IPv6 only is not yet supported.</p>. + * + * @return the networkType value. + */ + public String networkType() { + return this.networkType; + } + + /** + * Set the networkType property: <p>The type of IP address protocol used by a replication instance, such as + * IPv4 only or Dual-stack that supports both IPv4 and IPv6 addressing. IPv6 only is not yet supported.</p>. + * + * @param networkType the networkType value to set. + * @return the ReplicationPendingModifiedValues object itself. + */ + public ReplicationPendingModifiedValues withNetworkType(String networkType) { + this.networkType = networkType; + return this; + } + + /** + * Get the replicationInstanceClass property: <p>The compute and memory capacity of the replication instance + * as defined for the specified replication instance class.</p> <p>For more information on the settings + * and capacities for the available replication instance classes, see <a + * href='https://docs.aws.amazon.com/dms/latest/userguide/CHAP_ReplicationInstance.html#CHAP_ReplicationInstance.InDepth'> + * Selecting the right DMS replication instance for your migration</a>. </p>. + * + * @return the replicationInstanceClass value. + */ + public String replicationInstanceClass() { + return this.replicationInstanceClass; + } + + /** + * Set the replicationInstanceClass property: <p>The compute and memory capacity of the replication instance + * as defined for the specified replication instance class.</p> <p>For more information on the settings + * and capacities for the available replication instance classes, see <a + * href='https://docs.aws.amazon.com/dms/latest/userguide/CHAP_ReplicationInstance.html#CHAP_ReplicationInstance.InDepth'> + * Selecting the right DMS replication instance for your migration</a>. </p>. + * + * @param replicationInstanceClass the replicationInstanceClass value to set. + * @return the ReplicationPendingModifiedValues object itself. + */ + public ReplicationPendingModifiedValues withReplicationInstanceClass(String replicationInstanceClass) { + this.replicationInstanceClass = replicationInstanceClass; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeNumberField("allocatedStorage", this.allocatedStorage); + jsonWriter.writeStringField("engineVersion", this.engineVersion); + jsonWriter.writeBooleanField("multiAZ", this.multiAZ); + jsonWriter.writeStringField("networkType", this.networkType); + jsonWriter.writeStringField("replicationInstanceClass", this.replicationInstanceClass); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ReplicationPendingModifiedValues from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ReplicationPendingModifiedValues if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ReplicationPendingModifiedValues. + */ + public static ReplicationPendingModifiedValues fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ReplicationPendingModifiedValues deserializedReplicationPendingModifiedValues + = new ReplicationPendingModifiedValues(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("allocatedStorage".equals(fieldName)) { + deserializedReplicationPendingModifiedValues.allocatedStorage + = reader.getNullable(JsonReader::getInt); + } else if ("engineVersion".equals(fieldName)) { + deserializedReplicationPendingModifiedValues.engineVersion = reader.getString(); + } else if ("multiAZ".equals(fieldName)) { + deserializedReplicationPendingModifiedValues.multiAZ = reader.getNullable(JsonReader::getBoolean); + } else if ("networkType".equals(fieldName)) { + deserializedReplicationPendingModifiedValues.networkType = reader.getString(); + } else if ("replicationInstanceClass".equals(fieldName)) { + deserializedReplicationPendingModifiedValues.replicationInstanceClass = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedReplicationPendingModifiedValues; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ReplicationRule.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ReplicationRule.java new file mode 100644 index 000000000000..64c66bf8241e --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ReplicationRule.java @@ -0,0 +1,428 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of ReplicationRule. + */ +@Fluent +public final class ReplicationRule implements JsonSerializable { + /* + * Specifies whether Amazon S3 replicates delete markers. If you specify a ``Filter`` in your replication + * configuration, you must also include a ``DeleteMarkerReplication`` element. If your ``Filter`` includes a ``Tag`` + * element, the ``DeleteMarkerReplication`` ``Status`` must be set to Disabled, because Amazon S3 does not support + * replicating delete markers for tag-based rules. For an example configuration, see [Basic Rule + * Configuration](https://docs.aws.amazon.com/AmazonS3/latest/dev/replication-add-config.html#replication-config-min + * -rule-config). For more information about delete marker replication, see [Basic Rule + * Configuration](https://docs.aws.amazon.com/AmazonS3/latest/dev/delete-marker-replication.html). If you are using + * an earlier version of the replication configuration, Amazon S3 handles replication of delete markers differently. + * For more information, see [Backward + * Compatibility](https://docs.aws.amazon.com/AmazonS3/latest/dev/replication-add-config.html#replication-backward- + * compat-considerations). Specifies whether Amazon S3 replicates delete markers. If you specify a ``Filter`` in + * your replication configuration, you must also include a ``DeleteMarkerReplication`` element. If your ``Filter`` + * includes a ``Tag`` element, the ``DeleteMarkerReplication`` ``Status`` must be set to Disabled, because Amazon S3 + * does not support replicating delete markers for tag-based rules. For an example configuration, see [Basic Rule + * Configuration](https://docs.aws.amazon.com/AmazonS3/latest/dev/replication-add-config.html#replication-config-min + * -rule-config). For more information about delete marker replication, see [Basic Rule + * Configuration](https://docs.aws.amazon.com/AmazonS3/latest/dev/delete-marker-replication.html). If you are using + * an earlier version of the replication configuration, Amazon S3 handles replication of delete markers differently. + * For more information, see [Backward + * Compatibility](https://docs.aws.amazon.com/AmazonS3/latest/dev/replication-add-config.html#replication-backward- + * compat-considerations). + */ + private DeleteMarkerReplication deleteMarkerReplication; + + /* + * A container for information about the replication destination and its configurations including enabling the S3 + * Replication Time Control (S3 RTC). A container for information about the replication destination and its + * configurations including enabling the S3 Replication Time Control (S3 RTC). + */ + private ReplicationDestinationAutoGenerated destination; + + /* + * A filter that identifies the subset of objects to which the replication rule applies. A ``Filter`` must specify + * exactly one ``Prefix``, ``TagFilter``, or an ``And`` child element. The use of the filter field indicates that + * this is a V2 replication configuration. This field isn't supported in a V1 replication configuration. V1 + * replication configuration only supports filtering by key prefix. To filter using a V1 replication configuration, + * add the ``Prefix`` directly as a child element of the ``Rule`` element. A filter that identifies the subset of + * objects to which the replication rule applies. A ``Filter`` must specify exactly one ``Prefix``, ``TagFilter``, + * or an ``And`` child element. + */ + private ReplicationRuleFilter filter; + + /* + * A unique identifier for the rule. The maximum value is 255 characters. If you don't specify a value, AWS + * CloudFormation generates a random ID. When using a V2 replication configuration this property is capitalized as + * 'ID'. + */ + private String id; + + /* + * An object key name prefix that identifies the object or objects to which the rule applies. The maximum prefix + * length is 1,024 characters. To include all objects in a bucket, specify an empty string. To filter using a V1 + * replication configuration, add the ``Prefix`` directly as a child element of the ``Rule`` element. Replacement + * must be made for object keys containing special characters (such as carriage returns) when using XML requests. + * For more information, see [XML related object key + * constraints](https://docs.aws.amazon.com/AmazonS3/latest/userguide/object-keys.html#object-key-xml-related- + * constraints). + */ + private String prefix; + + /* + * The priority indicates which rule has precedence whenever two or more replication rules conflict. Amazon S3 will + * attempt to replicate objects according to all replication rules. However, if there are two or more rules with the + * same destination bucket, then objects will be replicated according to the rule with the highest priority. The + * higher the number, the higher the priority. For more information, see + * [Replication](https://docs.aws.amazon.com/AmazonS3/latest/dev/replication.html) in the *Amazon S3 User Guide*. + */ + private Integer priority; + + /* + * A container that describes additional filters for identifying the source objects that you want to replicate. You + * can choose to enable or disable the replication of these objects. A container that describes additional filters + * for identifying the source objects that you want to replicate. You can choose to enable or disable the + * replication of these objects. + */ + private SourceSelectionCriteria sourceSelectionCriteria; + + /* + * Specifies whether the rule is enabled. + */ + private ReplicationRuleStatus status; + + /** + * Creates an instance of ReplicationRule class. + */ + public ReplicationRule() { + } + + /** + * Get the deleteMarkerReplication property: Specifies whether Amazon S3 replicates delete markers. If you specify a + * ``Filter`` in your replication configuration, you must also include a ``DeleteMarkerReplication`` element. If + * your ``Filter`` includes a ``Tag`` element, the ``DeleteMarkerReplication`` ``Status`` must be set to Disabled, + * because Amazon S3 does not support replicating delete markers for tag-based rules. For an example configuration, + * see [Basic Rule + * Configuration](https://docs.aws.amazon.com/AmazonS3/latest/dev/replication-add-config.html#replication-config-min-rule-config). + * For more information about delete marker replication, see [Basic Rule + * Configuration](https://docs.aws.amazon.com/AmazonS3/latest/dev/delete-marker-replication.html). If you are using + * an earlier version of the replication configuration, Amazon S3 handles replication of delete markers differently. + * For more information, see [Backward + * Compatibility](https://docs.aws.amazon.com/AmazonS3/latest/dev/replication-add-config.html#replication-backward-compat-considerations). + * Specifies whether Amazon S3 replicates delete markers. If you specify a ``Filter`` in your replication + * configuration, you must also include a ``DeleteMarkerReplication`` element. If your ``Filter`` includes a ``Tag`` + * element, the ``DeleteMarkerReplication`` ``Status`` must be set to Disabled, because Amazon S3 does not support + * replicating delete markers for tag-based rules. For an example configuration, see [Basic Rule + * Configuration](https://docs.aws.amazon.com/AmazonS3/latest/dev/replication-add-config.html#replication-config-min-rule-config). + * For more information about delete marker replication, see [Basic Rule + * Configuration](https://docs.aws.amazon.com/AmazonS3/latest/dev/delete-marker-replication.html). If you are using + * an earlier version of the replication configuration, Amazon S3 handles replication of delete markers differently. + * For more information, see [Backward + * Compatibility](https://docs.aws.amazon.com/AmazonS3/latest/dev/replication-add-config.html#replication-backward-compat-considerations). + * + * @return the deleteMarkerReplication value. + */ + public DeleteMarkerReplication deleteMarkerReplication() { + return this.deleteMarkerReplication; + } + + /** + * Set the deleteMarkerReplication property: Specifies whether Amazon S3 replicates delete markers. If you specify a + * ``Filter`` in your replication configuration, you must also include a ``DeleteMarkerReplication`` element. If + * your ``Filter`` includes a ``Tag`` element, the ``DeleteMarkerReplication`` ``Status`` must be set to Disabled, + * because Amazon S3 does not support replicating delete markers for tag-based rules. For an example configuration, + * see [Basic Rule + * Configuration](https://docs.aws.amazon.com/AmazonS3/latest/dev/replication-add-config.html#replication-config-min-rule-config). + * For more information about delete marker replication, see [Basic Rule + * Configuration](https://docs.aws.amazon.com/AmazonS3/latest/dev/delete-marker-replication.html). If you are using + * an earlier version of the replication configuration, Amazon S3 handles replication of delete markers differently. + * For more information, see [Backward + * Compatibility](https://docs.aws.amazon.com/AmazonS3/latest/dev/replication-add-config.html#replication-backward-compat-considerations). + * Specifies whether Amazon S3 replicates delete markers. If you specify a ``Filter`` in your replication + * configuration, you must also include a ``DeleteMarkerReplication`` element. If your ``Filter`` includes a ``Tag`` + * element, the ``DeleteMarkerReplication`` ``Status`` must be set to Disabled, because Amazon S3 does not support + * replicating delete markers for tag-based rules. For an example configuration, see [Basic Rule + * Configuration](https://docs.aws.amazon.com/AmazonS3/latest/dev/replication-add-config.html#replication-config-min-rule-config). + * For more information about delete marker replication, see [Basic Rule + * Configuration](https://docs.aws.amazon.com/AmazonS3/latest/dev/delete-marker-replication.html). If you are using + * an earlier version of the replication configuration, Amazon S3 handles replication of delete markers differently. + * For more information, see [Backward + * Compatibility](https://docs.aws.amazon.com/AmazonS3/latest/dev/replication-add-config.html#replication-backward-compat-considerations). + * + * @param deleteMarkerReplication the deleteMarkerReplication value to set. + * @return the ReplicationRule object itself. + */ + public ReplicationRule withDeleteMarkerReplication(DeleteMarkerReplication deleteMarkerReplication) { + this.deleteMarkerReplication = deleteMarkerReplication; + return this; + } + + /** + * Get the destination property: A container for information about the replication destination and its + * configurations including enabling the S3 Replication Time Control (S3 RTC). A container for information about the + * replication destination and its configurations including enabling the S3 Replication Time Control (S3 RTC). + * + * @return the destination value. + */ + public ReplicationDestinationAutoGenerated destination() { + return this.destination; + } + + /** + * Set the destination property: A container for information about the replication destination and its + * configurations including enabling the S3 Replication Time Control (S3 RTC). A container for information about the + * replication destination and its configurations including enabling the S3 Replication Time Control (S3 RTC). + * + * @param destination the destination value to set. + * @return the ReplicationRule object itself. + */ + public ReplicationRule withDestination(ReplicationDestinationAutoGenerated destination) { + this.destination = destination; + return this; + } + + /** + * Get the filter property: A filter that identifies the subset of objects to which the replication rule applies. A + * ``Filter`` must specify exactly one ``Prefix``, ``TagFilter``, or an ``And`` child element. The use of the filter + * field indicates that this is a V2 replication configuration. This field isn't supported in a V1 replication + * configuration. V1 replication configuration only supports filtering by key prefix. To filter using a V1 + * replication configuration, add the ``Prefix`` directly as a child element of the ``Rule`` element. A filter that + * identifies the subset of objects to which the replication rule applies. A ``Filter`` must specify exactly one + * ``Prefix``, ``TagFilter``, or an ``And`` child element. + * + * @return the filter value. + */ + public ReplicationRuleFilter filter() { + return this.filter; + } + + /** + * Set the filter property: A filter that identifies the subset of objects to which the replication rule applies. A + * ``Filter`` must specify exactly one ``Prefix``, ``TagFilter``, or an ``And`` child element. The use of the filter + * field indicates that this is a V2 replication configuration. This field isn't supported in a V1 replication + * configuration. V1 replication configuration only supports filtering by key prefix. To filter using a V1 + * replication configuration, add the ``Prefix`` directly as a child element of the ``Rule`` element. A filter that + * identifies the subset of objects to which the replication rule applies. A ``Filter`` must specify exactly one + * ``Prefix``, ``TagFilter``, or an ``And`` child element. + * + * @param filter the filter value to set. + * @return the ReplicationRule object itself. + */ + public ReplicationRule withFilter(ReplicationRuleFilter filter) { + this.filter = filter; + return this; + } + + /** + * Get the id property: A unique identifier for the rule. The maximum value is 255 characters. If you don't specify + * a value, AWS CloudFormation generates a random ID. When using a V2 replication configuration this property is + * capitalized as 'ID'. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Set the id property: A unique identifier for the rule. The maximum value is 255 characters. If you don't specify + * a value, AWS CloudFormation generates a random ID. When using a V2 replication configuration this property is + * capitalized as 'ID'. + * + * @param id the id value to set. + * @return the ReplicationRule object itself. + */ + public ReplicationRule withId(String id) { + this.id = id; + return this; + } + + /** + * Get the prefix property: An object key name prefix that identifies the object or objects to which the rule + * applies. The maximum prefix length is 1,024 characters. To include all objects in a bucket, specify an empty + * string. To filter using a V1 replication configuration, add the ``Prefix`` directly as a child element of the + * ``Rule`` element. Replacement must be made for object keys containing special characters (such as carriage + * returns) when using XML requests. For more information, see [XML related object key + * constraints](https://docs.aws.amazon.com/AmazonS3/latest/userguide/object-keys.html#object-key-xml-related-constraints). + * + * @return the prefix value. + */ + public String prefix() { + return this.prefix; + } + + /** + * Set the prefix property: An object key name prefix that identifies the object or objects to which the rule + * applies. The maximum prefix length is 1,024 characters. To include all objects in a bucket, specify an empty + * string. To filter using a V1 replication configuration, add the ``Prefix`` directly as a child element of the + * ``Rule`` element. Replacement must be made for object keys containing special characters (such as carriage + * returns) when using XML requests. For more information, see [XML related object key + * constraints](https://docs.aws.amazon.com/AmazonS3/latest/userguide/object-keys.html#object-key-xml-related-constraints). + * + * @param prefix the prefix value to set. + * @return the ReplicationRule object itself. + */ + public ReplicationRule withPrefix(String prefix) { + this.prefix = prefix; + return this; + } + + /** + * Get the priority property: The priority indicates which rule has precedence whenever two or more replication + * rules conflict. Amazon S3 will attempt to replicate objects according to all replication rules. However, if there + * are two or more rules with the same destination bucket, then objects will be replicated according to the rule + * with the highest priority. The higher the number, the higher the priority. For more information, see + * [Replication](https://docs.aws.amazon.com/AmazonS3/latest/dev/replication.html) in the *Amazon S3 User Guide*. + * + * @return the priority value. + */ + public Integer priority() { + return this.priority; + } + + /** + * Set the priority property: The priority indicates which rule has precedence whenever two or more replication + * rules conflict. Amazon S3 will attempt to replicate objects according to all replication rules. However, if there + * are two or more rules with the same destination bucket, then objects will be replicated according to the rule + * with the highest priority. The higher the number, the higher the priority. For more information, see + * [Replication](https://docs.aws.amazon.com/AmazonS3/latest/dev/replication.html) in the *Amazon S3 User Guide*. + * + * @param priority the priority value to set. + * @return the ReplicationRule object itself. + */ + public ReplicationRule withPriority(Integer priority) { + this.priority = priority; + return this; + } + + /** + * Get the sourceSelectionCriteria property: A container that describes additional filters for identifying the + * source objects that you want to replicate. You can choose to enable or disable the replication of these objects. + * A container that describes additional filters for identifying the source objects that you want to replicate. You + * can choose to enable or disable the replication of these objects. + * + * @return the sourceSelectionCriteria value. + */ + public SourceSelectionCriteria sourceSelectionCriteria() { + return this.sourceSelectionCriteria; + } + + /** + * Set the sourceSelectionCriteria property: A container that describes additional filters for identifying the + * source objects that you want to replicate. You can choose to enable or disable the replication of these objects. + * A container that describes additional filters for identifying the source objects that you want to replicate. You + * can choose to enable or disable the replication of these objects. + * + * @param sourceSelectionCriteria the sourceSelectionCriteria value to set. + * @return the ReplicationRule object itself. + */ + public ReplicationRule withSourceSelectionCriteria(SourceSelectionCriteria sourceSelectionCriteria) { + this.sourceSelectionCriteria = sourceSelectionCriteria; + return this; + } + + /** + * Get the status property: Specifies whether the rule is enabled. + * + * @return the status value. + */ + public ReplicationRuleStatus status() { + return this.status; + } + + /** + * Set the status property: Specifies whether the rule is enabled. + * + * @param status the status value to set. + * @return the ReplicationRule object itself. + */ + public ReplicationRule withStatus(ReplicationRuleStatus status) { + this.status = status; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (deleteMarkerReplication() != null) { + deleteMarkerReplication().validate(); + } + if (destination() != null) { + destination().validate(); + } + if (filter() != null) { + filter().validate(); + } + if (sourceSelectionCriteria() != null) { + sourceSelectionCriteria().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("deleteMarkerReplication", this.deleteMarkerReplication); + jsonWriter.writeJsonField("destination", this.destination); + jsonWriter.writeJsonField("filter", this.filter); + jsonWriter.writeStringField("id", this.id); + jsonWriter.writeStringField("prefix", this.prefix); + jsonWriter.writeNumberField("priority", this.priority); + jsonWriter.writeJsonField("sourceSelectionCriteria", this.sourceSelectionCriteria); + jsonWriter.writeStringField("status", this.status == null ? null : this.status.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ReplicationRule from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ReplicationRule if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the ReplicationRule. + */ + public static ReplicationRule fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ReplicationRule deserializedReplicationRule = new ReplicationRule(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("deleteMarkerReplication".equals(fieldName)) { + deserializedReplicationRule.deleteMarkerReplication = DeleteMarkerReplication.fromJson(reader); + } else if ("destination".equals(fieldName)) { + deserializedReplicationRule.destination = ReplicationDestinationAutoGenerated.fromJson(reader); + } else if ("filter".equals(fieldName)) { + deserializedReplicationRule.filter = ReplicationRuleFilter.fromJson(reader); + } else if ("id".equals(fieldName)) { + deserializedReplicationRule.id = reader.getString(); + } else if ("prefix".equals(fieldName)) { + deserializedReplicationRule.prefix = reader.getString(); + } else if ("priority".equals(fieldName)) { + deserializedReplicationRule.priority = reader.getNullable(JsonReader::getInt); + } else if ("sourceSelectionCriteria".equals(fieldName)) { + deserializedReplicationRule.sourceSelectionCriteria = SourceSelectionCriteria.fromJson(reader); + } else if ("status".equals(fieldName)) { + deserializedReplicationRule.status = ReplicationRuleStatus.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedReplicationRule; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ReplicationRuleAndOperator.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ReplicationRuleAndOperator.java new file mode 100644 index 000000000000..1d1751f66da9 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ReplicationRuleAndOperator.java @@ -0,0 +1,128 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Definition of ReplicationRuleAndOperator. + */ +@Fluent +public final class ReplicationRuleAndOperator implements JsonSerializable { + /* + * An object key name prefix that identifies the subset of objects to which the rule applies. + */ + private String prefix; + + /* + * An array of tags containing key and value pairs. + */ + private List tagFilters; + + /** + * Creates an instance of ReplicationRuleAndOperator class. + */ + public ReplicationRuleAndOperator() { + } + + /** + * Get the prefix property: An object key name prefix that identifies the subset of objects to which the rule + * applies. + * + * @return the prefix value. + */ + public String prefix() { + return this.prefix; + } + + /** + * Set the prefix property: An object key name prefix that identifies the subset of objects to which the rule + * applies. + * + * @param prefix the prefix value to set. + * @return the ReplicationRuleAndOperator object itself. + */ + public ReplicationRuleAndOperator withPrefix(String prefix) { + this.prefix = prefix; + return this; + } + + /** + * Get the tagFilters property: An array of tags containing key and value pairs. + * + * @return the tagFilters value. + */ + public List tagFilters() { + return this.tagFilters; + } + + /** + * Set the tagFilters property: An array of tags containing key and value pairs. + * + * @param tagFilters the tagFilters value to set. + * @return the ReplicationRuleAndOperator object itself. + */ + public ReplicationRuleAndOperator withTagFilters(List tagFilters) { + this.tagFilters = tagFilters; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (tagFilters() != null) { + tagFilters().forEach(e -> e.validate()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("prefix", this.prefix); + jsonWriter.writeArrayField("tagFilters", this.tagFilters, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ReplicationRuleAndOperator from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ReplicationRuleAndOperator if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ReplicationRuleAndOperator. + */ + public static ReplicationRuleAndOperator fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ReplicationRuleAndOperator deserializedReplicationRuleAndOperator = new ReplicationRuleAndOperator(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("prefix".equals(fieldName)) { + deserializedReplicationRuleAndOperator.prefix = reader.getString(); + } else if ("tagFilters".equals(fieldName)) { + List tagFilters = reader.readArray(reader1 -> TagFilter.fromJson(reader1)); + deserializedReplicationRuleAndOperator.tagFilters = tagFilters; + } else { + reader.skipChildren(); + } + } + + return deserializedReplicationRuleAndOperator; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ReplicationRuleFilter.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ReplicationRuleFilter.java new file mode 100644 index 000000000000..745d007e8ee5 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ReplicationRuleFilter.java @@ -0,0 +1,188 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of ReplicationRuleFilter. + */ +@Fluent +public final class ReplicationRuleFilter implements JsonSerializable { + /* + * A container for specifying rule filters. The filters determine the subset of objects to which the rule applies. + * This element is required only if you specify more than one filter. For example: + If you specify both a + * ``Prefix`` and a ``TagFilter``, wrap these filters in an ``And`` tag. + If you specify a filter based on multiple + * tags, wrap the ``TagFilter`` elements in an ``And`` tag. A container for specifying rule filters. The filters + * determine the subset of objects to which the rule applies. This element is required only if you specify more than + * one filter. For example: + If you specify both a ``Prefix`` and a ``TagFilter``, wrap these filters in an ``And`` + * tag. + If you specify a filter based on multiple tags, wrap the ``TagFilter`` elements in an ``And`` tag + */ + private ReplicationRuleAndOperator and; + + /* + * An object key name prefix that identifies the subset of objects to which the rule applies. Replacement must be + * made for object keys containing special characters (such as carriage returns) when using XML requests. For more + * information, see [XML related object key + * constraints](https://docs.aws.amazon.com/AmazonS3/latest/userguide/object-keys.html#object-key-xml-related- + * constraints). + */ + private String prefix; + + /* + * A container for specifying a tag key and value. The rule applies only to objects that have the tag in their tag + * set. Specifies tags to use to identify a subset of objects for an Amazon S3 bucket. + */ + private TagFilter tagFilter; + + /** + * Creates an instance of ReplicationRuleFilter class. + */ + public ReplicationRuleFilter() { + } + + /** + * Get the and property: A container for specifying rule filters. The filters determine the subset of objects to + * which the rule applies. This element is required only if you specify more than one filter. For example: + If you + * specify both a ``Prefix`` and a ``TagFilter``, wrap these filters in an ``And`` tag. + If you specify a filter + * based on multiple tags, wrap the ``TagFilter`` elements in an ``And`` tag. A container for specifying rule + * filters. The filters determine the subset of objects to which the rule applies. This element is required only if + * you specify more than one filter. For example: + If you specify both a ``Prefix`` and a ``TagFilter``, wrap these + * filters in an ``And`` tag. + If you specify a filter based on multiple tags, wrap the ``TagFilter`` elements in + * an ``And`` tag. + * + * @return the and value. + */ + public ReplicationRuleAndOperator and() { + return this.and; + } + + /** + * Set the and property: A container for specifying rule filters. The filters determine the subset of objects to + * which the rule applies. This element is required only if you specify more than one filter. For example: + If you + * specify both a ``Prefix`` and a ``TagFilter``, wrap these filters in an ``And`` tag. + If you specify a filter + * based on multiple tags, wrap the ``TagFilter`` elements in an ``And`` tag. A container for specifying rule + * filters. The filters determine the subset of objects to which the rule applies. This element is required only if + * you specify more than one filter. For example: + If you specify both a ``Prefix`` and a ``TagFilter``, wrap these + * filters in an ``And`` tag. + If you specify a filter based on multiple tags, wrap the ``TagFilter`` elements in + * an ``And`` tag. + * + * @param and the and value to set. + * @return the ReplicationRuleFilter object itself. + */ + public ReplicationRuleFilter withAnd(ReplicationRuleAndOperator and) { + this.and = and; + return this; + } + + /** + * Get the prefix property: An object key name prefix that identifies the subset of objects to which the rule + * applies. Replacement must be made for object keys containing special characters (such as carriage returns) when + * using XML requests. For more information, see [XML related object key + * constraints](https://docs.aws.amazon.com/AmazonS3/latest/userguide/object-keys.html#object-key-xml-related-constraints). + * + * @return the prefix value. + */ + public String prefix() { + return this.prefix; + } + + /** + * Set the prefix property: An object key name prefix that identifies the subset of objects to which the rule + * applies. Replacement must be made for object keys containing special characters (such as carriage returns) when + * using XML requests. For more information, see [XML related object key + * constraints](https://docs.aws.amazon.com/AmazonS3/latest/userguide/object-keys.html#object-key-xml-related-constraints). + * + * @param prefix the prefix value to set. + * @return the ReplicationRuleFilter object itself. + */ + public ReplicationRuleFilter withPrefix(String prefix) { + this.prefix = prefix; + return this; + } + + /** + * Get the tagFilter property: A container for specifying a tag key and value. The rule applies only to objects that + * have the tag in their tag set. Specifies tags to use to identify a subset of objects for an Amazon S3 bucket. + * + * @return the tagFilter value. + */ + public TagFilter tagFilter() { + return this.tagFilter; + } + + /** + * Set the tagFilter property: A container for specifying a tag key and value. The rule applies only to objects that + * have the tag in their tag set. Specifies tags to use to identify a subset of objects for an Amazon S3 bucket. + * + * @param tagFilter the tagFilter value to set. + * @return the ReplicationRuleFilter object itself. + */ + public ReplicationRuleFilter withTagFilter(TagFilter tagFilter) { + this.tagFilter = tagFilter; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (and() != null) { + and().validate(); + } + if (tagFilter() != null) { + tagFilter().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("and", this.and); + jsonWriter.writeStringField("prefix", this.prefix); + jsonWriter.writeJsonField("tagFilter", this.tagFilter); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ReplicationRuleFilter from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ReplicationRuleFilter if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the ReplicationRuleFilter. + */ + public static ReplicationRuleFilter fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ReplicationRuleFilter deserializedReplicationRuleFilter = new ReplicationRuleFilter(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("and".equals(fieldName)) { + deserializedReplicationRuleFilter.and = ReplicationRuleAndOperator.fromJson(reader); + } else if ("prefix".equals(fieldName)) { + deserializedReplicationRuleFilter.prefix = reader.getString(); + } else if ("tagFilter".equals(fieldName)) { + deserializedReplicationRuleFilter.tagFilter = TagFilter.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedReplicationRuleFilter; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ReplicationRuleStatus.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ReplicationRuleStatus.java new file mode 100644 index 000000000000..49a0a9f573d1 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ReplicationRuleStatus.java @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * ReplicationRuleStatus enum. + */ +public final class ReplicationRuleStatus extends ExpandableStringEnum { + /** + * Static value Disabled for ReplicationRuleStatus. + */ + public static final ReplicationRuleStatus DISABLED = fromString("Disabled"); + + /** + * Static value Enabled for ReplicationRuleStatus. + */ + public static final ReplicationRuleStatus ENABLED = fromString("Enabled"); + + /** + * Creates a new instance of ReplicationRuleStatus value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ReplicationRuleStatus() { + } + + /** + * Creates or finds a ReplicationRuleStatus from its string representation. + * + * @param name a name to look for. + * @return the corresponding ReplicationRuleStatus. + */ + public static ReplicationRuleStatus fromString(String name) { + return fromString(name, ReplicationRuleStatus.class); + } + + /** + * Gets known ReplicationRuleStatus values. + * + * @return known ReplicationRuleStatus values. + */ + public static Collection values() { + return values(ReplicationRuleStatus.class); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ReplicationSubnetGroup.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ReplicationSubnetGroup.java new file mode 100644 index 000000000000..eefbe2a0a640 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ReplicationSubnetGroup.java @@ -0,0 +1,249 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Definition of ReplicationSubnetGroup. + */ +@Fluent +public final class ReplicationSubnetGroup implements JsonSerializable { + /* + *

A description for the replication subnet group.

+ */ + private String replicationSubnetGroupDescription; + + /* + *

The identifier of the replication instance subnet group.

+ */ + private String replicationSubnetGroupIdentifier; + + /* + *

The status of the subnet group.

+ */ + private String subnetGroupStatus; + + /* + *

The subnets that are in the subnet group.

+ */ + private List subnets; + + /* + *

The IP addressing protocol supported by the subnet group. This is used by a replication instance with values + * such as IPv4 only or Dual-stack that supports both IPv4 and IPv6 addressing. IPv6 only is not yet supported.

+ */ + private List supportedNetworkTypes; + + /* + *

The ID of the VPC.

+ */ + private String vpcId; + + /** + * Creates an instance of ReplicationSubnetGroup class. + */ + public ReplicationSubnetGroup() { + } + + /** + * Get the replicationSubnetGroupDescription property: <p>A description for the replication subnet + * group.</p>. + * + * @return the replicationSubnetGroupDescription value. + */ + public String replicationSubnetGroupDescription() { + return this.replicationSubnetGroupDescription; + } + + /** + * Set the replicationSubnetGroupDescription property: <p>A description for the replication subnet + * group.</p>. + * + * @param replicationSubnetGroupDescription the replicationSubnetGroupDescription value to set. + * @return the ReplicationSubnetGroup object itself. + */ + public ReplicationSubnetGroup withReplicationSubnetGroupDescription(String replicationSubnetGroupDescription) { + this.replicationSubnetGroupDescription = replicationSubnetGroupDescription; + return this; + } + + /** + * Get the replicationSubnetGroupIdentifier property: <p>The identifier of the replication instance subnet + * group.</p>. + * + * @return the replicationSubnetGroupIdentifier value. + */ + public String replicationSubnetGroupIdentifier() { + return this.replicationSubnetGroupIdentifier; + } + + /** + * Set the replicationSubnetGroupIdentifier property: <p>The identifier of the replication instance subnet + * group.</p>. + * + * @param replicationSubnetGroupIdentifier the replicationSubnetGroupIdentifier value to set. + * @return the ReplicationSubnetGroup object itself. + */ + public ReplicationSubnetGroup withReplicationSubnetGroupIdentifier(String replicationSubnetGroupIdentifier) { + this.replicationSubnetGroupIdentifier = replicationSubnetGroupIdentifier; + return this; + } + + /** + * Get the subnetGroupStatus property: <p>The status of the subnet group.</p>. + * + * @return the subnetGroupStatus value. + */ + public String subnetGroupStatus() { + return this.subnetGroupStatus; + } + + /** + * Set the subnetGroupStatus property: <p>The status of the subnet group.</p>. + * + * @param subnetGroupStatus the subnetGroupStatus value to set. + * @return the ReplicationSubnetGroup object itself. + */ + public ReplicationSubnetGroup withSubnetGroupStatus(String subnetGroupStatus) { + this.subnetGroupStatus = subnetGroupStatus; + return this; + } + + /** + * Get the subnets property: <p>The subnets that are in the subnet group.</p>. + * + * @return the subnets value. + */ + public List subnets() { + return this.subnets; + } + + /** + * Set the subnets property: <p>The subnets that are in the subnet group.</p>. + * + * @param subnets the subnets value to set. + * @return the ReplicationSubnetGroup object itself. + */ + public ReplicationSubnetGroup withSubnets(List subnets) { + this.subnets = subnets; + return this; + } + + /** + * Get the supportedNetworkTypes property: <p>The IP addressing protocol supported by the subnet group. This + * is used by a replication instance with values such as IPv4 only or Dual-stack that supports both IPv4 and IPv6 + * addressing. IPv6 only is not yet supported.</p>. + * + * @return the supportedNetworkTypes value. + */ + public List supportedNetworkTypes() { + return this.supportedNetworkTypes; + } + + /** + * Set the supportedNetworkTypes property: <p>The IP addressing protocol supported by the subnet group. This + * is used by a replication instance with values such as IPv4 only or Dual-stack that supports both IPv4 and IPv6 + * addressing. IPv6 only is not yet supported.</p>. + * + * @param supportedNetworkTypes the supportedNetworkTypes value to set. + * @return the ReplicationSubnetGroup object itself. + */ + public ReplicationSubnetGroup withSupportedNetworkTypes(List supportedNetworkTypes) { + this.supportedNetworkTypes = supportedNetworkTypes; + return this; + } + + /** + * Get the vpcId property: <p>The ID of the VPC.</p>. + * + * @return the vpcId value. + */ + public String vpcId() { + return this.vpcId; + } + + /** + * Set the vpcId property: <p>The ID of the VPC.</p>. + * + * @param vpcId the vpcId value to set. + * @return the ReplicationSubnetGroup object itself. + */ + public ReplicationSubnetGroup withVpcId(String vpcId) { + this.vpcId = vpcId; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (subnets() != null) { + subnets().forEach(e -> e.validate()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("replicationSubnetGroupDescription", this.replicationSubnetGroupDescription); + jsonWriter.writeStringField("replicationSubnetGroupIdentifier", this.replicationSubnetGroupIdentifier); + jsonWriter.writeStringField("subnetGroupStatus", this.subnetGroupStatus); + jsonWriter.writeArrayField("subnets", this.subnets, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("supportedNetworkTypes", this.supportedNetworkTypes, + (writer, element) -> writer.writeString(element)); + jsonWriter.writeStringField("vpcId", this.vpcId); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ReplicationSubnetGroup from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ReplicationSubnetGroup if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the ReplicationSubnetGroup. + */ + public static ReplicationSubnetGroup fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ReplicationSubnetGroup deserializedReplicationSubnetGroup = new ReplicationSubnetGroup(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("replicationSubnetGroupDescription".equals(fieldName)) { + deserializedReplicationSubnetGroup.replicationSubnetGroupDescription = reader.getString(); + } else if ("replicationSubnetGroupIdentifier".equals(fieldName)) { + deserializedReplicationSubnetGroup.replicationSubnetGroupIdentifier = reader.getString(); + } else if ("subnetGroupStatus".equals(fieldName)) { + deserializedReplicationSubnetGroup.subnetGroupStatus = reader.getString(); + } else if ("subnets".equals(fieldName)) { + List subnets = reader.readArray(reader1 -> Subnet.fromJson(reader1)); + deserializedReplicationSubnetGroup.subnets = subnets; + } else if ("supportedNetworkTypes".equals(fieldName)) { + List supportedNetworkTypes = reader.readArray(reader1 -> reader1.getString()); + deserializedReplicationSubnetGroup.supportedNetworkTypes = supportedNetworkTypes; + } else if ("vpcId".equals(fieldName)) { + deserializedReplicationSubnetGroup.vpcId = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedReplicationSubnetGroup; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ReplicationTime.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ReplicationTime.java new file mode 100644 index 000000000000..d9d7f102ae96 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ReplicationTime.java @@ -0,0 +1,130 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of ReplicationTime. + */ +@Fluent +public final class ReplicationTime implements JsonSerializable { + /* + * Specifies whether the replication time is enabled. + */ + private ReplicationTimeStatus status; + + /* + * A container specifying the time by which replication should be complete for all objects and operations on + * objects. A container specifying the time value for S3 Replication Time Control (S3 RTC) and replication metrics + * ``EventThreshold``. + */ + private ReplicationTimeValue time; + + /** + * Creates an instance of ReplicationTime class. + */ + public ReplicationTime() { + } + + /** + * Get the status property: Specifies whether the replication time is enabled. + * + * @return the status value. + */ + public ReplicationTimeStatus status() { + return this.status; + } + + /** + * Set the status property: Specifies whether the replication time is enabled. + * + * @param status the status value to set. + * @return the ReplicationTime object itself. + */ + public ReplicationTime withStatus(ReplicationTimeStatus status) { + this.status = status; + return this; + } + + /** + * Get the time property: A container specifying the time by which replication should be complete for all objects + * and operations on objects. A container specifying the time value for S3 Replication Time Control (S3 RTC) and + * replication metrics ``EventThreshold``. + * + * @return the time value. + */ + public ReplicationTimeValue time() { + return this.time; + } + + /** + * Set the time property: A container specifying the time by which replication should be complete for all objects + * and operations on objects. A container specifying the time value for S3 Replication Time Control (S3 RTC) and + * replication metrics ``EventThreshold``. + * + * @param time the time value to set. + * @return the ReplicationTime object itself. + */ + public ReplicationTime withTime(ReplicationTimeValue time) { + this.time = time; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (time() != null) { + time().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("status", this.status == null ? null : this.status.toString()); + jsonWriter.writeJsonField("time", this.time); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ReplicationTime from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ReplicationTime if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the ReplicationTime. + */ + public static ReplicationTime fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ReplicationTime deserializedReplicationTime = new ReplicationTime(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("status".equals(fieldName)) { + deserializedReplicationTime.status = ReplicationTimeStatus.fromString(reader.getString()); + } else if ("time".equals(fieldName)) { + deserializedReplicationTime.time = ReplicationTimeValue.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedReplicationTime; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ReplicationTimeStatus.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ReplicationTimeStatus.java new file mode 100644 index 000000000000..e946e8b9f3d3 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ReplicationTimeStatus.java @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * ReplicationTimeStatus enum. + */ +public final class ReplicationTimeStatus extends ExpandableStringEnum { + /** + * Static value Disabled for ReplicationTimeStatus. + */ + public static final ReplicationTimeStatus DISABLED = fromString("Disabled"); + + /** + * Static value Enabled for ReplicationTimeStatus. + */ + public static final ReplicationTimeStatus ENABLED = fromString("Enabled"); + + /** + * Creates a new instance of ReplicationTimeStatus value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ReplicationTimeStatus() { + } + + /** + * Creates or finds a ReplicationTimeStatus from its string representation. + * + * @param name a name to look for. + * @return the corresponding ReplicationTimeStatus. + */ + public static ReplicationTimeStatus fromString(String name) { + return fromString(name, ReplicationTimeStatus.class); + } + + /** + * Gets known ReplicationTimeStatus values. + * + * @return known ReplicationTimeStatus values. + */ + public static Collection values() { + return values(ReplicationTimeStatus.class); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ReplicationTimeValue.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ReplicationTimeValue.java new file mode 100644 index 000000000000..f8f5a89896ec --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ReplicationTimeValue.java @@ -0,0 +1,93 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of ReplicationTimeValue. + */ +@Fluent +public final class ReplicationTimeValue implements JsonSerializable { + /* + * Contains an integer specifying time in minutes. Valid value: 15 + */ + private Integer minutes; + + /** + * Creates an instance of ReplicationTimeValue class. + */ + public ReplicationTimeValue() { + } + + /** + * Get the minutes property: Contains an integer specifying time in minutes. Valid value: 15. + * + * @return the minutes value. + */ + public Integer minutes() { + return this.minutes; + } + + /** + * Set the minutes property: Contains an integer specifying time in minutes. Valid value: 15. + * + * @param minutes the minutes value to set. + * @return the ReplicationTimeValue object itself. + */ + public ReplicationTimeValue withMinutes(Integer minutes) { + this.minutes = minutes; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeNumberField("minutes", this.minutes); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ReplicationTimeValue from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ReplicationTimeValue if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the ReplicationTimeValue. + */ + public static ReplicationTimeValue fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ReplicationTimeValue deserializedReplicationTimeValue = new ReplicationTimeValue(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("minutes".equals(fieldName)) { + deserializedReplicationTimeValue.minutes = reader.getNullable(JsonReader::getInt); + } else { + reader.skipChildren(); + } + } + + return deserializedReplicationTimeValue; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/RepoUpgradeOnBoot.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/RepoUpgradeOnBoot.java new file mode 100644 index 000000000000..62e19dc7b34f --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/RepoUpgradeOnBoot.java @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * RepoUpgradeOnBoot enum. + */ +public final class RepoUpgradeOnBoot extends ExpandableStringEnum { + /** + * Static value NONE for RepoUpgradeOnBoot. + */ + public static final RepoUpgradeOnBoot NONE = fromString("NONE"); + + /** + * Static value SECURITY for RepoUpgradeOnBoot. + */ + public static final RepoUpgradeOnBoot SECURITY = fromString("SECURITY"); + + /** + * Creates a new instance of RepoUpgradeOnBoot value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public RepoUpgradeOnBoot() { + } + + /** + * Creates or finds a RepoUpgradeOnBoot from its string representation. + * + * @param name a name to look for. + * @return the corresponding RepoUpgradeOnBoot. + */ + public static RepoUpgradeOnBoot fromString(String name) { + return fromString(name, RepoUpgradeOnBoot.class); + } + + /** + * Gets known RepoUpgradeOnBoot values. + * + * @return known RepoUpgradeOnBoot values. + */ + public static Collection values() { + return values(RepoUpgradeOnBoot.class); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/RepoUpgradeOnBootEnumValue.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/RepoUpgradeOnBootEnumValue.java new file mode 100644 index 000000000000..dbba08b770ee --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/RepoUpgradeOnBootEnumValue.java @@ -0,0 +1,93 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of RepoUpgradeOnBootEnumValue. + */ +@Fluent +public final class RepoUpgradeOnBootEnumValue implements JsonSerializable { + /* + * Property value + */ + private RepoUpgradeOnBoot value; + + /** + * Creates an instance of RepoUpgradeOnBootEnumValue class. + */ + public RepoUpgradeOnBootEnumValue() { + } + + /** + * Get the value property: Property value. + * + * @return the value value. + */ + public RepoUpgradeOnBoot value() { + return this.value; + } + + /** + * Set the value property: Property value. + * + * @param value the value value to set. + * @return the RepoUpgradeOnBootEnumValue object itself. + */ + public RepoUpgradeOnBootEnumValue withValue(RepoUpgradeOnBoot value) { + this.value = value; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("value", this.value == null ? null : this.value.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of RepoUpgradeOnBootEnumValue from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of RepoUpgradeOnBootEnumValue if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IOException If an error occurs while reading the RepoUpgradeOnBootEnumValue. + */ + public static RepoUpgradeOnBootEnumValue fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + RepoUpgradeOnBootEnumValue deserializedRepoUpgradeOnBootEnumValue = new RepoUpgradeOnBootEnumValue(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + deserializedRepoUpgradeOnBootEnumValue.value = RepoUpgradeOnBoot.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedRepoUpgradeOnBootEnumValue; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/RepositoryCredentials.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/RepositoryCredentials.java new file mode 100644 index 000000000000..ceb5e8054f1a --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/RepositoryCredentials.java @@ -0,0 +1,102 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of RepositoryCredentials. + */ +@Fluent +public final class RepositoryCredentials implements JsonSerializable { + /* + * The Amazon Resource Name (ARN) of the secret containing the private repository credentials. When you use the + * Amazon ECS API, CLI, or AWS SDK, if the secret exists in the same Region as the task that you're launching then + * you can use either the full ARN or the name of the secret. When you use the AWS Management Console, you must + * specify the full ARN of the secret. + */ + private String credentialsParameter; + + /** + * Creates an instance of RepositoryCredentials class. + */ + public RepositoryCredentials() { + } + + /** + * Get the credentialsParameter property: The Amazon Resource Name (ARN) of the secret containing the private + * repository credentials. When you use the Amazon ECS API, CLI, or AWS SDK, if the secret exists in the same Region + * as the task that you're launching then you can use either the full ARN or the name of the secret. When you use + * the AWS Management Console, you must specify the full ARN of the secret. + * + * @return the credentialsParameter value. + */ + public String credentialsParameter() { + return this.credentialsParameter; + } + + /** + * Set the credentialsParameter property: The Amazon Resource Name (ARN) of the secret containing the private + * repository credentials. When you use the Amazon ECS API, CLI, or AWS SDK, if the secret exists in the same Region + * as the task that you're launching then you can use either the full ARN or the name of the secret. When you use + * the AWS Management Console, you must specify the full ARN of the secret. + * + * @param credentialsParameter the credentialsParameter value to set. + * @return the RepositoryCredentials object itself. + */ + public RepositoryCredentials withCredentialsParameter(String credentialsParameter) { + this.credentialsParameter = credentialsParameter; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("credentialsParameter", this.credentialsParameter); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of RepositoryCredentials from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of RepositoryCredentials if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the RepositoryCredentials. + */ + public static RepositoryCredentials fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + RepositoryCredentials deserializedRepositoryCredentials = new RepositoryCredentials(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("credentialsParameter".equals(fieldName)) { + deserializedRepositoryCredentials.credentialsParameter = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedRepositoryCredentials; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ResolverLevelMetricsBehavior.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ResolverLevelMetricsBehavior.java new file mode 100644 index 000000000000..48c962b073a7 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ResolverLevelMetricsBehavior.java @@ -0,0 +1,52 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * ResolverLevelMetricsBehavior enum. + */ +public final class ResolverLevelMetricsBehavior extends ExpandableStringEnum { + /** + * Static value FULL_REQUEST_RESOLVER_METRICS for ResolverLevelMetricsBehavior. + */ + public static final ResolverLevelMetricsBehavior FULL_REQUEST_RESOLVER_METRICS + = fromString("FULL_REQUEST_RESOLVER_METRICS"); + + /** + * Static value PER_RESOLVER_METRICS for ResolverLevelMetricsBehavior. + */ + public static final ResolverLevelMetricsBehavior PER_RESOLVER_METRICS = fromString("PER_RESOLVER_METRICS"); + + /** + * Creates a new instance of ResolverLevelMetricsBehavior value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ResolverLevelMetricsBehavior() { + } + + /** + * Creates or finds a ResolverLevelMetricsBehavior from its string representation. + * + * @param name a name to look for. + * @return the corresponding ResolverLevelMetricsBehavior. + */ + public static ResolverLevelMetricsBehavior fromString(String name) { + return fromString(name, ResolverLevelMetricsBehavior.class); + } + + /** + * Gets known ResolverLevelMetricsBehavior values. + * + * @return known ResolverLevelMetricsBehavior values. + */ + public static Collection values() { + return values(ResolverLevelMetricsBehavior.class); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ResolverLevelMetricsBehaviorEnumValue.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ResolverLevelMetricsBehaviorEnumValue.java new file mode 100644 index 000000000000..e9f2f6f6060e --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ResolverLevelMetricsBehaviorEnumValue.java @@ -0,0 +1,96 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of ResolverLevelMetricsBehaviorEnumValue. + */ +@Fluent +public final class ResolverLevelMetricsBehaviorEnumValue + implements JsonSerializable { + /* + * Property value + */ + private ResolverLevelMetricsBehavior value; + + /** + * Creates an instance of ResolverLevelMetricsBehaviorEnumValue class. + */ + public ResolverLevelMetricsBehaviorEnumValue() { + } + + /** + * Get the value property: Property value. + * + * @return the value value. + */ + public ResolverLevelMetricsBehavior value() { + return this.value; + } + + /** + * Set the value property: Property value. + * + * @param value the value value to set. + * @return the ResolverLevelMetricsBehaviorEnumValue object itself. + */ + public ResolverLevelMetricsBehaviorEnumValue withValue(ResolverLevelMetricsBehavior value) { + this.value = value; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("value", this.value == null ? null : this.value.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ResolverLevelMetricsBehaviorEnumValue from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ResolverLevelMetricsBehaviorEnumValue if the JsonReader was pointing to an instance of it, + * or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ResolverLevelMetricsBehaviorEnumValue. + */ + public static ResolverLevelMetricsBehaviorEnumValue fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ResolverLevelMetricsBehaviorEnumValue deserializedResolverLevelMetricsBehaviorEnumValue + = new ResolverLevelMetricsBehaviorEnumValue(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + deserializedResolverLevelMetricsBehaviorEnumValue.value + = ResolverLevelMetricsBehavior.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedResolverLevelMetricsBehaviorEnumValue; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ResourcePolicy.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ResourcePolicy.java new file mode 100644 index 000000000000..668011855940 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ResourcePolicy.java @@ -0,0 +1,111 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of ResourcePolicy. + */ +@Fluent +public final class ResourcePolicy implements JsonSerializable { + /* + * A resource-based policy document that contains permissions to add to the specified DDB table, index, or both. In + * a CFNshort template, you can provide the policy in JSON or YAML format because CFNshort converts YAML to JSON + * before submitting it to DDB. For more information about resource-based policies, see [Using resource-based + * policies + * for](https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/access-control-resource-based.html) and + * [Resource-based policy + * examples](https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/rbac-examples.html). + */ + private Object policyDocument; + + /** + * Creates an instance of ResourcePolicy class. + */ + public ResourcePolicy() { + } + + /** + * Get the policyDocument property: A resource-based policy document that contains permissions to add to the + * specified DDB table, index, or both. In a CFNshort template, you can provide the policy in JSON or YAML format + * because CFNshort converts YAML to JSON before submitting it to DDB. For more information about resource-based + * policies, see [Using resource-based policies + * for](https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/access-control-resource-based.html) and + * [Resource-based policy + * examples](https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/rbac-examples.html). + * + * @return the policyDocument value. + */ + public Object policyDocument() { + return this.policyDocument; + } + + /** + * Set the policyDocument property: A resource-based policy document that contains permissions to add to the + * specified DDB table, index, or both. In a CFNshort template, you can provide the policy in JSON or YAML format + * because CFNshort converts YAML to JSON before submitting it to DDB. For more information about resource-based + * policies, see [Using resource-based policies + * for](https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/access-control-resource-based.html) and + * [Resource-based policy + * examples](https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/rbac-examples.html). + * + * @param policyDocument the policyDocument value to set. + * @return the ResourcePolicy object itself. + */ + public ResourcePolicy withPolicyDocument(Object policyDocument) { + this.policyDocument = policyDocument; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeUntypedField("policyDocument", this.policyDocument); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ResourcePolicy from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ResourcePolicy if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the ResourcePolicy. + */ + public static ResourcePolicy fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ResourcePolicy deserializedResourcePolicy = new ResourcePolicy(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("policyDocument".equals(fieldName)) { + deserializedResourcePolicy.policyDocument = reader.readUntyped(); + } else { + reader.skipChildren(); + } + } + + return deserializedResourcePolicy; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ResourceRecord.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ResourceRecord.java new file mode 100644 index 000000000000..220a4bf6ce99 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ResourceRecord.java @@ -0,0 +1,113 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of ResourceRecord. + */ +@Fluent +public final class ResourceRecord implements JsonSerializable { + /* + *

The current or new DNS record value, not to exceed 4,000 characters. In the case of a DELETE + * action, if the current value does not match the actual value, an error is returned. For descriptions about how to + * format Value for different record types, see Supported DNS Resource + * Record Types in the Amazon Route 53 Developer Guide.

You can specify more than one value for + * all record types except CNAME and SOA.

If you're creating an alias + * resource record set, omit Value.

+ */ + private String value; + + /** + * Creates an instance of ResourceRecord class. + */ + public ResourceRecord() { + } + + /** + * Get the value property: <p>The current or new DNS record value, not to exceed 4,000 characters. In the case + * of a <code>DELETE</code> action, if the current value does not match the actual value, an error is + * returned. For descriptions about how to format <code>Value</code> for different record types, see + * <a href='https://docs.aws.amazon.com/Route53/latest/DeveloperGuide/ResourceRecordTypes.html'>Supported DNS + * Resource Record Types</a> in the <i>Amazon Route 53 Developer Guide</i>.</p> <p>You + * can specify more than one value for all record types except <code>CNAME</code> and + * <code>SOA</code>. </p> <note> <p>If you're creating an alias resource record set, + * omit <code>Value</code>.</p> </note>. + * + * @return the value value. + */ + public String value() { + return this.value; + } + + /** + * Set the value property: <p>The current or new DNS record value, not to exceed 4,000 characters. In the case + * of a <code>DELETE</code> action, if the current value does not match the actual value, an error is + * returned. For descriptions about how to format <code>Value</code> for different record types, see + * <a href='https://docs.aws.amazon.com/Route53/latest/DeveloperGuide/ResourceRecordTypes.html'>Supported DNS + * Resource Record Types</a> in the <i>Amazon Route 53 Developer Guide</i>.</p> <p>You + * can specify more than one value for all record types except <code>CNAME</code> and + * <code>SOA</code>. </p> <note> <p>If you're creating an alias resource record set, + * omit <code>Value</code>.</p> </note>. + * + * @param value the value value to set. + * @return the ResourceRecord object itself. + */ + public ResourceRecord withValue(String value) { + this.value = value; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("value", this.value); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ResourceRecord from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ResourceRecord if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the ResourceRecord. + */ + public static ResourceRecord fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ResourceRecord deserializedResourceRecord = new ResourceRecord(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + deserializedResourceRecord.value = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedResourceRecord; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ResourceRecordSetFailover.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ResourceRecordSetFailover.java new file mode 100644 index 000000000000..9058cc740948 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ResourceRecordSetFailover.java @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * ResourceRecordSetFailover enum. + */ +public final class ResourceRecordSetFailover extends ExpandableStringEnum { + /** + * Static value PRIMARY for ResourceRecordSetFailover. + */ + public static final ResourceRecordSetFailover PRIMARY = fromString("PRIMARY"); + + /** + * Static value SECONDARY for ResourceRecordSetFailover. + */ + public static final ResourceRecordSetFailover SECONDARY = fromString("SECONDARY"); + + /** + * Creates a new instance of ResourceRecordSetFailover value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ResourceRecordSetFailover() { + } + + /** + * Creates or finds a ResourceRecordSetFailover from its string representation. + * + * @param name a name to look for. + * @return the corresponding ResourceRecordSetFailover. + */ + public static ResourceRecordSetFailover fromString(String name) { + return fromString(name, ResourceRecordSetFailover.class); + } + + /** + * Gets known ResourceRecordSetFailover values. + * + * @return known ResourceRecordSetFailover values. + */ + public static Collection values() { + return values(ResourceRecordSetFailover.class); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ResourceRecordSetFailoverEnumValue.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ResourceRecordSetFailoverEnumValue.java new file mode 100644 index 000000000000..8e64c5437862 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ResourceRecordSetFailoverEnumValue.java @@ -0,0 +1,95 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of ResourceRecordSetFailoverEnumValue. + */ +@Fluent +public final class ResourceRecordSetFailoverEnumValue implements JsonSerializable { + /* + * Property value + */ + private ResourceRecordSetFailover value; + + /** + * Creates an instance of ResourceRecordSetFailoverEnumValue class. + */ + public ResourceRecordSetFailoverEnumValue() { + } + + /** + * Get the value property: Property value. + * + * @return the value value. + */ + public ResourceRecordSetFailover value() { + return this.value; + } + + /** + * Set the value property: Property value. + * + * @param value the value value to set. + * @return the ResourceRecordSetFailoverEnumValue object itself. + */ + public ResourceRecordSetFailoverEnumValue withValue(ResourceRecordSetFailover value) { + this.value = value; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("value", this.value == null ? null : this.value.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ResourceRecordSetFailoverEnumValue from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ResourceRecordSetFailoverEnumValue if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ResourceRecordSetFailoverEnumValue. + */ + public static ResourceRecordSetFailoverEnumValue fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ResourceRecordSetFailoverEnumValue deserializedResourceRecordSetFailoverEnumValue + = new ResourceRecordSetFailoverEnumValue(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + deserializedResourceRecordSetFailoverEnumValue.value + = ResourceRecordSetFailover.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedResourceRecordSetFailoverEnumValue; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ResourceRecordSetRegion.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ResourceRecordSetRegion.java new file mode 100644 index 000000000000..5c6ed17e6cad --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ResourceRecordSetRegion.java @@ -0,0 +1,196 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * ResourceRecordSetRegion enum. + */ +public final class ResourceRecordSetRegion extends ExpandableStringEnum { + /** + * Static value af-south-1 for ResourceRecordSetRegion. + */ + public static final ResourceRecordSetRegion AF_SOUTH_1 = fromString("af-south-1"); + + /** + * Static value ap-east-1 for ResourceRecordSetRegion. + */ + public static final ResourceRecordSetRegion AP_EAST_1 = fromString("ap-east-1"); + + /** + * Static value ap-northeast-1 for ResourceRecordSetRegion. + */ + public static final ResourceRecordSetRegion AP_NORTHEAST_1 = fromString("ap-northeast-1"); + + /** + * Static value ap-northeast-2 for ResourceRecordSetRegion. + */ + public static final ResourceRecordSetRegion AP_NORTHEAST_2 = fromString("ap-northeast-2"); + + /** + * Static value ap-northeast-3 for ResourceRecordSetRegion. + */ + public static final ResourceRecordSetRegion AP_NORTHEAST_3 = fromString("ap-northeast-3"); + + /** + * Static value ap-south-1 for ResourceRecordSetRegion. + */ + public static final ResourceRecordSetRegion AP_SOUTH_1 = fromString("ap-south-1"); + + /** + * Static value ap-south-2 for ResourceRecordSetRegion. + */ + public static final ResourceRecordSetRegion AP_SOUTH_2 = fromString("ap-south-2"); + + /** + * Static value ap-southeast-1 for ResourceRecordSetRegion. + */ + public static final ResourceRecordSetRegion AP_SOUTHEAST_1 = fromString("ap-southeast-1"); + + /** + * Static value ap-southeast-2 for ResourceRecordSetRegion. + */ + public static final ResourceRecordSetRegion AP_SOUTHEAST_2 = fromString("ap-southeast-2"); + + /** + * Static value ap-southeast-3 for ResourceRecordSetRegion. + */ + public static final ResourceRecordSetRegion AP_SOUTHEAST_3 = fromString("ap-southeast-3"); + + /** + * Static value ap-southeast-4 for ResourceRecordSetRegion. + */ + public static final ResourceRecordSetRegion AP_SOUTHEAST_4 = fromString("ap-southeast-4"); + + /** + * Static value ca-central-1 for ResourceRecordSetRegion. + */ + public static final ResourceRecordSetRegion CA_CENTRAL_1 = fromString("ca-central-1"); + + /** + * Static value ca-west-1 for ResourceRecordSetRegion. + */ + public static final ResourceRecordSetRegion CA_WEST_1 = fromString("ca-west-1"); + + /** + * Static value cn-north-1 for ResourceRecordSetRegion. + */ + public static final ResourceRecordSetRegion CN_NORTH_1 = fromString("cn-north-1"); + + /** + * Static value cn-northwest-1 for ResourceRecordSetRegion. + */ + public static final ResourceRecordSetRegion CN_NORTHWEST_1 = fromString("cn-northwest-1"); + + /** + * Static value eu-central-1 for ResourceRecordSetRegion. + */ + public static final ResourceRecordSetRegion EU_CENTRAL_1 = fromString("eu-central-1"); + + /** + * Static value eu-central-2 for ResourceRecordSetRegion. + */ + public static final ResourceRecordSetRegion EU_CENTRAL_2 = fromString("eu-central-2"); + + /** + * Static value eu-north-1 for ResourceRecordSetRegion. + */ + public static final ResourceRecordSetRegion EU_NORTH_1 = fromString("eu-north-1"); + + /** + * Static value eu-south-1 for ResourceRecordSetRegion. + */ + public static final ResourceRecordSetRegion EU_SOUTH_1 = fromString("eu-south-1"); + + /** + * Static value eu-south-2 for ResourceRecordSetRegion. + */ + public static final ResourceRecordSetRegion EU_SOUTH_2 = fromString("eu-south-2"); + + /** + * Static value eu-west-1 for ResourceRecordSetRegion. + */ + public static final ResourceRecordSetRegion EU_WEST_1 = fromString("eu-west-1"); + + /** + * Static value eu-west-2 for ResourceRecordSetRegion. + */ + public static final ResourceRecordSetRegion EU_WEST_2 = fromString("eu-west-2"); + + /** + * Static value eu-west-3 for ResourceRecordSetRegion. + */ + public static final ResourceRecordSetRegion EU_WEST_3 = fromString("eu-west-3"); + + /** + * Static value il-central-1 for ResourceRecordSetRegion. + */ + public static final ResourceRecordSetRegion IL_CENTRAL_1 = fromString("il-central-1"); + + /** + * Static value me-central-1 for ResourceRecordSetRegion. + */ + public static final ResourceRecordSetRegion ME_CENTRAL_1 = fromString("me-central-1"); + + /** + * Static value me-south-1 for ResourceRecordSetRegion. + */ + public static final ResourceRecordSetRegion ME_SOUTH_1 = fromString("me-south-1"); + + /** + * Static value sa-east-1 for ResourceRecordSetRegion. + */ + public static final ResourceRecordSetRegion SA_EAST_1 = fromString("sa-east-1"); + + /** + * Static value us-east-1 for ResourceRecordSetRegion. + */ + public static final ResourceRecordSetRegion US_EAST_1 = fromString("us-east-1"); + + /** + * Static value us-east-2 for ResourceRecordSetRegion. + */ + public static final ResourceRecordSetRegion US_EAST_2 = fromString("us-east-2"); + + /** + * Static value us-west-1 for ResourceRecordSetRegion. + */ + public static final ResourceRecordSetRegion US_WEST_1 = fromString("us-west-1"); + + /** + * Static value us-west-2 for ResourceRecordSetRegion. + */ + public static final ResourceRecordSetRegion US_WEST_2 = fromString("us-west-2"); + + /** + * Creates a new instance of ResourceRecordSetRegion value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ResourceRecordSetRegion() { + } + + /** + * Creates or finds a ResourceRecordSetRegion from its string representation. + * + * @param name a name to look for. + * @return the corresponding ResourceRecordSetRegion. + */ + public static ResourceRecordSetRegion fromString(String name) { + return fromString(name, ResourceRecordSetRegion.class); + } + + /** + * Gets known ResourceRecordSetRegion values. + * + * @return known ResourceRecordSetRegion values. + */ + public static Collection values() { + return values(ResourceRecordSetRegion.class); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ResourceRecordSetRegionEnumValue.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ResourceRecordSetRegionEnumValue.java new file mode 100644 index 000000000000..7f53b6eb42ab --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ResourceRecordSetRegionEnumValue.java @@ -0,0 +1,95 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of ResourceRecordSetRegionEnumValue. + */ +@Fluent +public final class ResourceRecordSetRegionEnumValue implements JsonSerializable { + /* + * Property value + */ + private ResourceRecordSetRegion value; + + /** + * Creates an instance of ResourceRecordSetRegionEnumValue class. + */ + public ResourceRecordSetRegionEnumValue() { + } + + /** + * Get the value property: Property value. + * + * @return the value value. + */ + public ResourceRecordSetRegion value() { + return this.value; + } + + /** + * Set the value property: Property value. + * + * @param value the value value to set. + * @return the ResourceRecordSetRegionEnumValue object itself. + */ + public ResourceRecordSetRegionEnumValue withValue(ResourceRecordSetRegion value) { + this.value = value; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("value", this.value == null ? null : this.value.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ResourceRecordSetRegionEnumValue from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ResourceRecordSetRegionEnumValue if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ResourceRecordSetRegionEnumValue. + */ + public static ResourceRecordSetRegionEnumValue fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ResourceRecordSetRegionEnumValue deserializedResourceRecordSetRegionEnumValue + = new ResourceRecordSetRegionEnumValue(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + deserializedResourceRecordSetRegionEnumValue.value + = ResourceRecordSetRegion.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedResourceRecordSetRegionEnumValue; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ResourceRequirement.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ResourceRequirement.java new file mode 100644 index 000000000000..bfeada3df383 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ResourceRequirement.java @@ -0,0 +1,140 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of ResourceRequirement. + */ +@Fluent +public final class ResourceRequirement implements JsonSerializable { + /* + * The type of resource to assign to a container. The supported values are ``GPU`` or ``InferenceAccelerator``. + */ + private String type; + + /* + * The value for the specified resource type. If the ``GPU`` type is used, the value is the number of physical + * ``GPUs`` the Amazon ECS container agent reserves for the container. The number of GPUs that's reserved for all + * containers in a task can't exceed the number of available GPUs on the container instance that the task is + * launched on. If the ``InferenceAccelerator`` type is used, the ``value`` matches the ``deviceName`` for an + * [InferenceAccelerator](https://docs.aws.amazon.com/AmazonECS/latest/APIReference/API_InferenceAccelerator.html) + * specified in a task definition. + */ + private String value; + + /** + * Creates an instance of ResourceRequirement class. + */ + public ResourceRequirement() { + } + + /** + * Get the type property: The type of resource to assign to a container. The supported values are ``GPU`` or + * ``InferenceAccelerator``. + * + * @return the type value. + */ + public String type() { + return this.type; + } + + /** + * Set the type property: The type of resource to assign to a container. The supported values are ``GPU`` or + * ``InferenceAccelerator``. + * + * @param type the type value to set. + * @return the ResourceRequirement object itself. + */ + public ResourceRequirement withType(String type) { + this.type = type; + return this; + } + + /** + * Get the value property: The value for the specified resource type. If the ``GPU`` type is used, the value is the + * number of physical ``GPUs`` the Amazon ECS container agent reserves for the container. The number of GPUs that's + * reserved for all containers in a task can't exceed the number of available GPUs on the container instance that + * the task is launched on. If the ``InferenceAccelerator`` type is used, the ``value`` matches the ``deviceName`` + * for an + * [InferenceAccelerator](https://docs.aws.amazon.com/AmazonECS/latest/APIReference/API_InferenceAccelerator.html) + * specified in a task definition. + * + * @return the value value. + */ + public String value() { + return this.value; + } + + /** + * Set the value property: The value for the specified resource type. If the ``GPU`` type is used, the value is the + * number of physical ``GPUs`` the Amazon ECS container agent reserves for the container. The number of GPUs that's + * reserved for all containers in a task can't exceed the number of available GPUs on the container instance that + * the task is launched on. If the ``InferenceAccelerator`` type is used, the ``value`` matches the ``deviceName`` + * for an + * [InferenceAccelerator](https://docs.aws.amazon.com/AmazonECS/latest/APIReference/API_InferenceAccelerator.html) + * specified in a task definition. + * + * @param value the value value to set. + * @return the ResourceRequirement object itself. + */ + public ResourceRequirement withValue(String value) { + this.value = value; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("type", this.type); + jsonWriter.writeStringField("value", this.value); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ResourceRequirement from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ResourceRequirement if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the ResourceRequirement. + */ + public static ResourceRequirement fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ResourceRequirement deserializedResourceRequirement = new ResourceRequirement(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("type".equals(fieldName)) { + deserializedResourceRequirement.type = reader.getString(); + } else if ("value".equals(fieldName)) { + deserializedResourceRequirement.value = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedResourceRequirement; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ResourceSpec.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ResourceSpec.java new file mode 100644 index 000000000000..6616cdcd8694 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ResourceSpec.java @@ -0,0 +1,149 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of ResourceSpec. + */ +@Fluent +public final class ResourceSpec implements JsonSerializable { + /* + * The instance type that the image version runs on. + */ + private ResourceSpecInstanceType instanceType; + + /* + * The ARN of the SageMaker image that the image version belongs to. + */ + private String sageMakerImageArn; + + /* + * The ARN of the image version created on the instance. + */ + private String sageMakerImageVersionArn; + + /** + * Creates an instance of ResourceSpec class. + */ + public ResourceSpec() { + } + + /** + * Get the instanceType property: The instance type that the image version runs on. + * + * @return the instanceType value. + */ + public ResourceSpecInstanceType instanceType() { + return this.instanceType; + } + + /** + * Set the instanceType property: The instance type that the image version runs on. + * + * @param instanceType the instanceType value to set. + * @return the ResourceSpec object itself. + */ + public ResourceSpec withInstanceType(ResourceSpecInstanceType instanceType) { + this.instanceType = instanceType; + return this; + } + + /** + * Get the sageMakerImageArn property: The ARN of the SageMaker image that the image version belongs to. + * + * @return the sageMakerImageArn value. + */ + public String sageMakerImageArn() { + return this.sageMakerImageArn; + } + + /** + * Set the sageMakerImageArn property: The ARN of the SageMaker image that the image version belongs to. + * + * @param sageMakerImageArn the sageMakerImageArn value to set. + * @return the ResourceSpec object itself. + */ + public ResourceSpec withSageMakerImageArn(String sageMakerImageArn) { + this.sageMakerImageArn = sageMakerImageArn; + return this; + } + + /** + * Get the sageMakerImageVersionArn property: The ARN of the image version created on the instance. + * + * @return the sageMakerImageVersionArn value. + */ + public String sageMakerImageVersionArn() { + return this.sageMakerImageVersionArn; + } + + /** + * Set the sageMakerImageVersionArn property: The ARN of the image version created on the instance. + * + * @param sageMakerImageVersionArn the sageMakerImageVersionArn value to set. + * @return the ResourceSpec object itself. + */ + public ResourceSpec withSageMakerImageVersionArn(String sageMakerImageVersionArn) { + this.sageMakerImageVersionArn = sageMakerImageVersionArn; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("instanceType", this.instanceType == null ? null : this.instanceType.toString()); + jsonWriter.writeStringField("sageMakerImageArn", this.sageMakerImageArn); + jsonWriter.writeStringField("sageMakerImageVersionArn", this.sageMakerImageVersionArn); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ResourceSpec from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ResourceSpec if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the ResourceSpec. + */ + public static ResourceSpec fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ResourceSpec deserializedResourceSpec = new ResourceSpec(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("instanceType".equals(fieldName)) { + deserializedResourceSpec.instanceType = ResourceSpecInstanceType.fromString(reader.getString()); + } else if ("sageMakerImageArn".equals(fieldName)) { + deserializedResourceSpec.sageMakerImageArn = reader.getString(); + } else if ("sageMakerImageVersionArn".equals(fieldName)) { + deserializedResourceSpec.sageMakerImageVersionArn = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedResourceSpec; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ResourceSpecInstanceType.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ResourceSpecInstanceType.java new file mode 100644 index 000000000000..de2795a4163f --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ResourceSpecInstanceType.java @@ -0,0 +1,356 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * ResourceSpecInstanceType enum. + */ +public final class ResourceSpecInstanceType extends ExpandableStringEnum { + /** + * Static value ml.c5.12xlarge for ResourceSpecInstanceType. + */ + public static final ResourceSpecInstanceType ML_C5_12XLARGE = fromString("ml.c5.12xlarge"); + + /** + * Static value ml.c5.18xlarge for ResourceSpecInstanceType. + */ + public static final ResourceSpecInstanceType ML_C5_18XLARGE = fromString("ml.c5.18xlarge"); + + /** + * Static value ml.c5.24xlarge for ResourceSpecInstanceType. + */ + public static final ResourceSpecInstanceType ML_C5_24XLARGE = fromString("ml.c5.24xlarge"); + + /** + * Static value ml.c5.2xlarge for ResourceSpecInstanceType. + */ + public static final ResourceSpecInstanceType ML_C5_2XLARGE = fromString("ml.c5.2xlarge"); + + /** + * Static value ml.c5.4xlarge for ResourceSpecInstanceType. + */ + public static final ResourceSpecInstanceType ML_C5_4XLARGE = fromString("ml.c5.4xlarge"); + + /** + * Static value ml.c5.9xlarge for ResourceSpecInstanceType. + */ + public static final ResourceSpecInstanceType ML_C5_9XLARGE = fromString("ml.c5.9xlarge"); + + /** + * Static value ml.c5.large for ResourceSpecInstanceType. + */ + public static final ResourceSpecInstanceType ML_C5_LARGE = fromString("ml.c5.large"); + + /** + * Static value ml.c5.xlarge for ResourceSpecInstanceType. + */ + public static final ResourceSpecInstanceType ML_C5_XLARGE = fromString("ml.c5.xlarge"); + + /** + * Static value ml.g4dn.12xlarge for ResourceSpecInstanceType. + */ + public static final ResourceSpecInstanceType ML_G4DN_12XLARGE = fromString("ml.g4dn.12xlarge"); + + /** + * Static value ml.g4dn.16xlarge for ResourceSpecInstanceType. + */ + public static final ResourceSpecInstanceType ML_G4DN_16XLARGE = fromString("ml.g4dn.16xlarge"); + + /** + * Static value ml.g4dn.2xlarge for ResourceSpecInstanceType. + */ + public static final ResourceSpecInstanceType ML_G4DN_2XLARGE = fromString("ml.g4dn.2xlarge"); + + /** + * Static value ml.g4dn.4xlarge for ResourceSpecInstanceType. + */ + public static final ResourceSpecInstanceType ML_G4DN_4XLARGE = fromString("ml.g4dn.4xlarge"); + + /** + * Static value ml.g4dn.8xlarge for ResourceSpecInstanceType. + */ + public static final ResourceSpecInstanceType ML_G4DN_8XLARGE = fromString("ml.g4dn.8xlarge"); + + /** + * Static value ml.g4dn.xlarge for ResourceSpecInstanceType. + */ + public static final ResourceSpecInstanceType ML_G4DN_XLARGE = fromString("ml.g4dn.xlarge"); + + /** + * Static value ml.g5.12xlarge for ResourceSpecInstanceType. + */ + public static final ResourceSpecInstanceType ML_G5_12XLARGE = fromString("ml.g5.12xlarge"); + + /** + * Static value ml.g5.16xlarge for ResourceSpecInstanceType. + */ + public static final ResourceSpecInstanceType ML_G5_16XLARGE = fromString("ml.g5.16xlarge"); + + /** + * Static value ml.g5.24xlarge for ResourceSpecInstanceType. + */ + public static final ResourceSpecInstanceType ML_G5_24XLARGE = fromString("ml.g5.24xlarge"); + + /** + * Static value ml.g5.2xlarge for ResourceSpecInstanceType. + */ + public static final ResourceSpecInstanceType ML_G5_2XLARGE = fromString("ml.g5.2xlarge"); + + /** + * Static value ml.g5.48xlarge for ResourceSpecInstanceType. + */ + public static final ResourceSpecInstanceType ML_G5_48XLARGE = fromString("ml.g5.48xlarge"); + + /** + * Static value ml.g5.4xlarge for ResourceSpecInstanceType. + */ + public static final ResourceSpecInstanceType ML_G5_4XLARGE = fromString("ml.g5.4xlarge"); + + /** + * Static value ml.g5.8xlarge for ResourceSpecInstanceType. + */ + public static final ResourceSpecInstanceType ML_G5_8XLARGE = fromString("ml.g5.8xlarge"); + + /** + * Static value ml.g5.xlarge for ResourceSpecInstanceType. + */ + public static final ResourceSpecInstanceType ML_G5_XLARGE = fromString("ml.g5.xlarge"); + + /** + * Static value ml.geospatial.interactive for ResourceSpecInstanceType. + */ + public static final ResourceSpecInstanceType ML_GEOSPATIAL_INTERACTIVE = fromString("ml.geospatial.interactive"); + + /** + * Static value ml.m5.12xlarge for ResourceSpecInstanceType. + */ + public static final ResourceSpecInstanceType ML_M5_12XLARGE = fromString("ml.m5.12xlarge"); + + /** + * Static value ml.m5.16xlarge for ResourceSpecInstanceType. + */ + public static final ResourceSpecInstanceType ML_M5_16XLARGE = fromString("ml.m5.16xlarge"); + + /** + * Static value ml.m5.24xlarge for ResourceSpecInstanceType. + */ + public static final ResourceSpecInstanceType ML_M5_24XLARGE = fromString("ml.m5.24xlarge"); + + /** + * Static value ml.m5.2xlarge for ResourceSpecInstanceType. + */ + public static final ResourceSpecInstanceType ML_M5_2XLARGE = fromString("ml.m5.2xlarge"); + + /** + * Static value ml.m5.4xlarge for ResourceSpecInstanceType. + */ + public static final ResourceSpecInstanceType ML_M5_4XLARGE = fromString("ml.m5.4xlarge"); + + /** + * Static value ml.m5.8xlarge for ResourceSpecInstanceType. + */ + public static final ResourceSpecInstanceType ML_M5_8XLARGE = fromString("ml.m5.8xlarge"); + + /** + * Static value ml.m5.large for ResourceSpecInstanceType. + */ + public static final ResourceSpecInstanceType ML_M5_LARGE = fromString("ml.m5.large"); + + /** + * Static value ml.m5.xlarge for ResourceSpecInstanceType. + */ + public static final ResourceSpecInstanceType ML_M5_XLARGE = fromString("ml.m5.xlarge"); + + /** + * Static value ml.m5d.12xlarge for ResourceSpecInstanceType. + */ + public static final ResourceSpecInstanceType ML_M5D_12XLARGE = fromString("ml.m5d.12xlarge"); + + /** + * Static value ml.m5d.16xlarge for ResourceSpecInstanceType. + */ + public static final ResourceSpecInstanceType ML_M5D_16XLARGE = fromString("ml.m5d.16xlarge"); + + /** + * Static value ml.m5d.24xlarge for ResourceSpecInstanceType. + */ + public static final ResourceSpecInstanceType ML_M5D_24XLARGE = fromString("ml.m5d.24xlarge"); + + /** + * Static value ml.m5d.2xlarge for ResourceSpecInstanceType. + */ + public static final ResourceSpecInstanceType ML_M5D_2XLARGE = fromString("ml.m5d.2xlarge"); + + /** + * Static value ml.m5d.4xlarge for ResourceSpecInstanceType. + */ + public static final ResourceSpecInstanceType ML_M5D_4XLARGE = fromString("ml.m5d.4xlarge"); + + /** + * Static value ml.m5d.8xlarge for ResourceSpecInstanceType. + */ + public static final ResourceSpecInstanceType ML_M5D_8XLARGE = fromString("ml.m5d.8xlarge"); + + /** + * Static value ml.m5d.large for ResourceSpecInstanceType. + */ + public static final ResourceSpecInstanceType ML_M5D_LARGE = fromString("ml.m5d.large"); + + /** + * Static value ml.m5d.xlarge for ResourceSpecInstanceType. + */ + public static final ResourceSpecInstanceType ML_M5D_XLARGE = fromString("ml.m5d.xlarge"); + + /** + * Static value ml.p3.16xlarge for ResourceSpecInstanceType. + */ + public static final ResourceSpecInstanceType ML_P3_16XLARGE = fromString("ml.p3.16xlarge"); + + /** + * Static value ml.p3.2xlarge for ResourceSpecInstanceType. + */ + public static final ResourceSpecInstanceType ML_P3_2XLARGE = fromString("ml.p3.2xlarge"); + + /** + * Static value ml.p3.8xlarge for ResourceSpecInstanceType. + */ + public static final ResourceSpecInstanceType ML_P3_8XLARGE = fromString("ml.p3.8xlarge"); + + /** + * Static value ml.p3dn.24xlarge for ResourceSpecInstanceType. + */ + public static final ResourceSpecInstanceType ML_P3DN_24XLARGE = fromString("ml.p3dn.24xlarge"); + + /** + * Static value ml.p4d.24xlarge for ResourceSpecInstanceType. + */ + public static final ResourceSpecInstanceType ML_P4D_24XLARGE = fromString("ml.p4d.24xlarge"); + + /** + * Static value ml.p4de.24xlarge for ResourceSpecInstanceType. + */ + public static final ResourceSpecInstanceType ML_P4DE_24XLARGE = fromString("ml.p4de.24xlarge"); + + /** + * Static value ml.r5.12xlarge for ResourceSpecInstanceType. + */ + public static final ResourceSpecInstanceType ML_R5_12XLARGE = fromString("ml.r5.12xlarge"); + + /** + * Static value ml.r5.16xlarge for ResourceSpecInstanceType. + */ + public static final ResourceSpecInstanceType ML_R5_16XLARGE = fromString("ml.r5.16xlarge"); + + /** + * Static value ml.r5.24xlarge for ResourceSpecInstanceType. + */ + public static final ResourceSpecInstanceType ML_R5_24XLARGE = fromString("ml.r5.24xlarge"); + + /** + * Static value ml.r5.2xlarge for ResourceSpecInstanceType. + */ + public static final ResourceSpecInstanceType ML_R5_2XLARGE = fromString("ml.r5.2xlarge"); + + /** + * Static value ml.r5.4xlarge for ResourceSpecInstanceType. + */ + public static final ResourceSpecInstanceType ML_R5_4XLARGE = fromString("ml.r5.4xlarge"); + + /** + * Static value ml.r5.8xlarge for ResourceSpecInstanceType. + */ + public static final ResourceSpecInstanceType ML_R5_8XLARGE = fromString("ml.r5.8xlarge"); + + /** + * Static value ml.r5.large for ResourceSpecInstanceType. + */ + public static final ResourceSpecInstanceType ML_R5_LARGE = fromString("ml.r5.large"); + + /** + * Static value ml.r5.xlarge for ResourceSpecInstanceType. + */ + public static final ResourceSpecInstanceType ML_R5_XLARGE = fromString("ml.r5.xlarge"); + + /** + * Static value ml.t3.2xlarge for ResourceSpecInstanceType. + */ + public static final ResourceSpecInstanceType ML_T3_2XLARGE = fromString("ml.t3.2xlarge"); + + /** + * Static value ml.t3.large for ResourceSpecInstanceType. + */ + public static final ResourceSpecInstanceType ML_T3_LARGE = fromString("ml.t3.large"); + + /** + * Static value ml.t3.medium for ResourceSpecInstanceType. + */ + public static final ResourceSpecInstanceType ML_T3_MEDIUM = fromString("ml.t3.medium"); + + /** + * Static value ml.t3.micro for ResourceSpecInstanceType. + */ + public static final ResourceSpecInstanceType ML_T3_MICRO = fromString("ml.t3.micro"); + + /** + * Static value ml.t3.small for ResourceSpecInstanceType. + */ + public static final ResourceSpecInstanceType ML_T3_SMALL = fromString("ml.t3.small"); + + /** + * Static value ml.t3.xlarge for ResourceSpecInstanceType. + */ + public static final ResourceSpecInstanceType ML_T3_XLARGE = fromString("ml.t3.xlarge"); + + /** + * Static value ml.trn1.2xlarge for ResourceSpecInstanceType. + */ + public static final ResourceSpecInstanceType ML_TRN1_2XLARGE = fromString("ml.trn1.2xlarge"); + + /** + * Static value ml.trn1.32xlarge for ResourceSpecInstanceType. + */ + public static final ResourceSpecInstanceType ML_TRN1_32XLARGE = fromString("ml.trn1.32xlarge"); + + /** + * Static value ml.trn1n.32xlarge for ResourceSpecInstanceType. + */ + public static final ResourceSpecInstanceType ML_TRN1N_32XLARGE = fromString("ml.trn1n.32xlarge"); + + /** + * Static value system for ResourceSpecInstanceType. + */ + public static final ResourceSpecInstanceType SYSTEM = fromString("system"); + + /** + * Creates a new instance of ResourceSpecInstanceType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ResourceSpecInstanceType() { + } + + /** + * Creates or finds a ResourceSpecInstanceType from its string representation. + * + * @param name a name to look for. + * @return the corresponding ResourceSpecInstanceType. + */ + public static ResourceSpecInstanceType fromString(String name) { + return fromString(name, ResourceSpecInstanceType.class); + } + + /** + * Gets known ResourceSpecInstanceType values. + * + * @return known ResourceSpecInstanceType values. + */ + public static Collection values() { + return values(ResourceSpecInstanceType.class); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ResourceType.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ResourceType.java new file mode 100644 index 000000000000..fb8c4213a265 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ResourceType.java @@ -0,0 +1,2159 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * ResourceType enum. + */ +public final class ResourceType extends ExpandableStringEnum { + /** + * Static value AWS::ACM::Certificate for ResourceType. + */ + public static final ResourceType AWS_ACM_CERTIFICATE = fromString("AWS::ACM::Certificate"); + + /** + * Static value AWS::ACMPCA::CertificateAuthority for ResourceType. + */ + public static final ResourceType AWS_ACMPCA_CERTIFICATE_AUTHORITY = fromString("AWS::ACMPCA::CertificateAuthority"); + + /** + * Static value AWS::ACMPCA::CertificateAuthorityActivation for ResourceType. + */ + public static final ResourceType AWS_ACMPCA_CERTIFICATE_AUTHORITY_ACTIVATION + = fromString("AWS::ACMPCA::CertificateAuthorityActivation"); + + /** + * Static value AWS::APS::RuleGroupsNamespace for ResourceType. + */ + public static final ResourceType AWS_APS_RULE_GROUPS_NAMESPACE = fromString("AWS::APS::RuleGroupsNamespace"); + + /** + * Static value AWS::AccessAnalyzer::Analyzer for ResourceType. + */ + public static final ResourceType AWS_ACCESS_ANALYZER_ANALYZER = fromString("AWS::AccessAnalyzer::Analyzer"); + + /** + * Static value AWS::AmazonMQ::Broker for ResourceType. + */ + public static final ResourceType AWS_AMAZON_MQ_BROKER = fromString("AWS::AmazonMQ::Broker"); + + /** + * Static value AWS::Amplify::App for ResourceType. + */ + public static final ResourceType AWS_AMPLIFY_APP = fromString("AWS::Amplify::App"); + + /** + * Static value AWS::Amplify::Branch for ResourceType. + */ + public static final ResourceType AWS_AMPLIFY_BRANCH = fromString("AWS::Amplify::Branch"); + + /** + * Static value AWS::ApiGateway::RestApi for ResourceType. + */ + public static final ResourceType AWS_API_GATEWAY_REST_API = fromString("AWS::ApiGateway::RestApi"); + + /** + * Static value AWS::ApiGateway::Stage for ResourceType. + */ + public static final ResourceType AWS_API_GATEWAY_STAGE = fromString("AWS::ApiGateway::Stage"); + + /** + * Static value AWS::ApiGatewayV2::Api for ResourceType. + */ + public static final ResourceType AWS_API_GATEWAY_V2_API = fromString("AWS::ApiGatewayV2::Api"); + + /** + * Static value AWS::ApiGatewayV2::Stage for ResourceType. + */ + public static final ResourceType AWS_API_GATEWAY_V2_STAGE = fromString("AWS::ApiGatewayV2::Stage"); + + /** + * Static value AWS::AppConfig::Application for ResourceType. + */ + public static final ResourceType AWS_APP_CONFIG_APPLICATION = fromString("AWS::AppConfig::Application"); + + /** + * Static value AWS::AppConfig::ConfigurationProfile for ResourceType. + */ + public static final ResourceType AWS_APP_CONFIG_CONFIGURATION_PROFILE + = fromString("AWS::AppConfig::ConfigurationProfile"); + + /** + * Static value AWS::AppConfig::DeploymentStrategy for ResourceType. + */ + public static final ResourceType AWS_APP_CONFIG_DEPLOYMENT_STRATEGY + = fromString("AWS::AppConfig::DeploymentStrategy"); + + /** + * Static value AWS::AppConfig::Environment for ResourceType. + */ + public static final ResourceType AWS_APP_CONFIG_ENVIRONMENT = fromString("AWS::AppConfig::Environment"); + + /** + * Static value AWS::AppConfig::HostedConfigurationVersion for ResourceType. + */ + public static final ResourceType AWS_APP_CONFIG_HOSTED_CONFIGURATION_VERSION + = fromString("AWS::AppConfig::HostedConfigurationVersion"); + + /** + * Static value AWS::AppFlow::Flow for ResourceType. + */ + public static final ResourceType AWS_APP_FLOW_FLOW = fromString("AWS::AppFlow::Flow"); + + /** + * Static value AWS::AppIntegrations::EventIntegration for ResourceType. + */ + public static final ResourceType AWS_APP_INTEGRATIONS_EVENT_INTEGRATION + = fromString("AWS::AppIntegrations::EventIntegration"); + + /** + * Static value AWS::AppMesh::GatewayRoute for ResourceType. + */ + public static final ResourceType AWS_APP_MESH_GATEWAY_ROUTE = fromString("AWS::AppMesh::GatewayRoute"); + + /** + * Static value AWS::AppMesh::Mesh for ResourceType. + */ + public static final ResourceType AWS_APP_MESH_MESH = fromString("AWS::AppMesh::Mesh"); + + /** + * Static value AWS::AppMesh::Route for ResourceType. + */ + public static final ResourceType AWS_APP_MESH_ROUTE = fromString("AWS::AppMesh::Route"); + + /** + * Static value AWS::AppMesh::VirtualGateway for ResourceType. + */ + public static final ResourceType AWS_APP_MESH_VIRTUAL_GATEWAY = fromString("AWS::AppMesh::VirtualGateway"); + + /** + * Static value AWS::AppMesh::VirtualNode for ResourceType. + */ + public static final ResourceType AWS_APP_MESH_VIRTUAL_NODE = fromString("AWS::AppMesh::VirtualNode"); + + /** + * Static value AWS::AppMesh::VirtualRouter for ResourceType. + */ + public static final ResourceType AWS_APP_MESH_VIRTUAL_ROUTER = fromString("AWS::AppMesh::VirtualRouter"); + + /** + * Static value AWS::AppMesh::VirtualService for ResourceType. + */ + public static final ResourceType AWS_APP_MESH_VIRTUAL_SERVICE = fromString("AWS::AppMesh::VirtualService"); + + /** + * Static value AWS::AppRunner::Service for ResourceType. + */ + public static final ResourceType AWS_APP_RUNNER_SERVICE = fromString("AWS::AppRunner::Service"); + + /** + * Static value AWS::AppRunner::VpcConnector for ResourceType. + */ + public static final ResourceType AWS_APP_RUNNER_VPC_CONNECTOR = fromString("AWS::AppRunner::VpcConnector"); + + /** + * Static value AWS::AppStream::Application for ResourceType. + */ + public static final ResourceType AWS_APP_STREAM_APPLICATION = fromString("AWS::AppStream::Application"); + + /** + * Static value AWS::AppStream::DirectoryConfig for ResourceType. + */ + public static final ResourceType AWS_APP_STREAM_DIRECTORY_CONFIG = fromString("AWS::AppStream::DirectoryConfig"); + + /** + * Static value AWS::AppStream::Fleet for ResourceType. + */ + public static final ResourceType AWS_APP_STREAM_FLEET = fromString("AWS::AppStream::Fleet"); + + /** + * Static value AWS::AppStream::Stack for ResourceType. + */ + public static final ResourceType AWS_APP_STREAM_STACK = fromString("AWS::AppStream::Stack"); + + /** + * Static value AWS::AppSync::GraphQLApi for ResourceType. + */ + public static final ResourceType AWS_APP_SYNC_GRAPH_QLAPI = fromString("AWS::AppSync::GraphQLApi"); + + /** + * Static value AWS::Athena::DataCatalog for ResourceType. + */ + public static final ResourceType AWS_ATHENA_DATA_CATALOG = fromString("AWS::Athena::DataCatalog"); + + /** + * Static value AWS::Athena::PreparedStatement for ResourceType. + */ + public static final ResourceType AWS_ATHENA_PREPARED_STATEMENT = fromString("AWS::Athena::PreparedStatement"); + + /** + * Static value AWS::Athena::WorkGroup for ResourceType. + */ + public static final ResourceType AWS_ATHENA_WORK_GROUP = fromString("AWS::Athena::WorkGroup"); + + /** + * Static value AWS::AuditManager::Assessment for ResourceType. + */ + public static final ResourceType AWS_AUDIT_MANAGER_ASSESSMENT = fromString("AWS::AuditManager::Assessment"); + + /** + * Static value AWS::AutoScaling::AutoScalingGroup for ResourceType. + */ + public static final ResourceType AWS_AUTO_SCALING_AUTO_SCALING_GROUP + = fromString("AWS::AutoScaling::AutoScalingGroup"); + + /** + * Static value AWS::AutoScaling::LaunchConfiguration for ResourceType. + */ + public static final ResourceType AWS_AUTO_SCALING_LAUNCH_CONFIGURATION + = fromString("AWS::AutoScaling::LaunchConfiguration"); + + /** + * Static value AWS::AutoScaling::ScalingPolicy for ResourceType. + */ + public static final ResourceType AWS_AUTO_SCALING_SCALING_POLICY = fromString("AWS::AutoScaling::ScalingPolicy"); + + /** + * Static value AWS::AutoScaling::ScheduledAction for ResourceType. + */ + public static final ResourceType AWS_AUTO_SCALING_SCHEDULED_ACTION + = fromString("AWS::AutoScaling::ScheduledAction"); + + /** + * Static value AWS::AutoScaling::WarmPool for ResourceType. + */ + public static final ResourceType AWS_AUTO_SCALING_WARM_POOL = fromString("AWS::AutoScaling::WarmPool"); + + /** + * Static value AWS::Backup::BackupPlan for ResourceType. + */ + public static final ResourceType AWS_BACKUP_BACKUP_PLAN = fromString("AWS::Backup::BackupPlan"); + + /** + * Static value AWS::Backup::BackupSelection for ResourceType. + */ + public static final ResourceType AWS_BACKUP_BACKUP_SELECTION = fromString("AWS::Backup::BackupSelection"); + + /** + * Static value AWS::Backup::BackupVault for ResourceType. + */ + public static final ResourceType AWS_BACKUP_BACKUP_VAULT = fromString("AWS::Backup::BackupVault"); + + /** + * Static value AWS::Backup::RecoveryPoint for ResourceType. + */ + public static final ResourceType AWS_BACKUP_RECOVERY_POINT = fromString("AWS::Backup::RecoveryPoint"); + + /** + * Static value AWS::Backup::ReportPlan for ResourceType. + */ + public static final ResourceType AWS_BACKUP_REPORT_PLAN = fromString("AWS::Backup::ReportPlan"); + + /** + * Static value AWS::Batch::ComputeEnvironment for ResourceType. + */ + public static final ResourceType AWS_BATCH_COMPUTE_ENVIRONMENT = fromString("AWS::Batch::ComputeEnvironment"); + + /** + * Static value AWS::Batch::JobQueue for ResourceType. + */ + public static final ResourceType AWS_BATCH_JOB_QUEUE = fromString("AWS::Batch::JobQueue"); + + /** + * Static value AWS::Batch::SchedulingPolicy for ResourceType. + */ + public static final ResourceType AWS_BATCH_SCHEDULING_POLICY = fromString("AWS::Batch::SchedulingPolicy"); + + /** + * Static value AWS::Budgets::BudgetsAction for ResourceType. + */ + public static final ResourceType AWS_BUDGETS_BUDGETS_ACTION = fromString("AWS::Budgets::BudgetsAction"); + + /** + * Static value AWS::Cassandra::Keyspace for ResourceType. + */ + public static final ResourceType AWS_CASSANDRA_KEYSPACE = fromString("AWS::Cassandra::Keyspace"); + + /** + * Static value AWS::Cloud9::EnvironmentEC2 for ResourceType. + */ + public static final ResourceType AWS_CLOUD9_ENVIRONMENT_EC2 = fromString("AWS::Cloud9::EnvironmentEC2"); + + /** + * Static value AWS::CloudFormation::Stack for ResourceType. + */ + public static final ResourceType AWS_CLOUD_FORMATION_STACK = fromString("AWS::CloudFormation::Stack"); + + /** + * Static value AWS::CloudFront::Distribution for ResourceType. + */ + public static final ResourceType AWS_CLOUD_FRONT_DISTRIBUTION = fromString("AWS::CloudFront::Distribution"); + + /** + * Static value AWS::CloudFront::StreamingDistribution for ResourceType. + */ + public static final ResourceType AWS_CLOUD_FRONT_STREAMING_DISTRIBUTION + = fromString("AWS::CloudFront::StreamingDistribution"); + + /** + * Static value AWS::CloudTrail::Trail for ResourceType. + */ + public static final ResourceType AWS_CLOUD_TRAIL_TRAIL = fromString("AWS::CloudTrail::Trail"); + + /** + * Static value AWS::CloudWatch::Alarm for ResourceType. + */ + public static final ResourceType AWS_CLOUD_WATCH_ALARM = fromString("AWS::CloudWatch::Alarm"); + + /** + * Static value AWS::CloudWatch::MetricStream for ResourceType. + */ + public static final ResourceType AWS_CLOUD_WATCH_METRIC_STREAM = fromString("AWS::CloudWatch::MetricStream"); + + /** + * Static value AWS::CodeArtifact::Repository for ResourceType. + */ + public static final ResourceType AWS_CODE_ARTIFACT_REPOSITORY = fromString("AWS::CodeArtifact::Repository"); + + /** + * Static value AWS::CodeBuild::Project for ResourceType. + */ + public static final ResourceType AWS_CODE_BUILD_PROJECT = fromString("AWS::CodeBuild::Project"); + + /** + * Static value AWS::CodeBuild::ReportGroup for ResourceType. + */ + public static final ResourceType AWS_CODE_BUILD_REPORT_GROUP = fromString("AWS::CodeBuild::ReportGroup"); + + /** + * Static value AWS::CodeDeploy::Application for ResourceType. + */ + public static final ResourceType AWS_CODE_DEPLOY_APPLICATION = fromString("AWS::CodeDeploy::Application"); + + /** + * Static value AWS::CodeDeploy::DeploymentConfig for ResourceType. + */ + public static final ResourceType AWS_CODE_DEPLOY_DEPLOYMENT_CONFIG + = fromString("AWS::CodeDeploy::DeploymentConfig"); + + /** + * Static value AWS::CodeDeploy::DeploymentGroup for ResourceType. + */ + public static final ResourceType AWS_CODE_DEPLOY_DEPLOYMENT_GROUP = fromString("AWS::CodeDeploy::DeploymentGroup"); + + /** + * Static value AWS::CodeGuruProfiler::ProfilingGroup for ResourceType. + */ + public static final ResourceType AWS_CODE_GURU_PROFILER_PROFILING_GROUP + = fromString("AWS::CodeGuruProfiler::ProfilingGroup"); + + /** + * Static value AWS::CodeGuruReviewer::RepositoryAssociation for ResourceType. + */ + public static final ResourceType AWS_CODE_GURU_REVIEWER_REPOSITORY_ASSOCIATION + = fromString("AWS::CodeGuruReviewer::RepositoryAssociation"); + + /** + * Static value AWS::CodePipeline::Pipeline for ResourceType. + */ + public static final ResourceType AWS_CODE_PIPELINE_PIPELINE = fromString("AWS::CodePipeline::Pipeline"); + + /** + * Static value AWS::Cognito::UserPool for ResourceType. + */ + public static final ResourceType AWS_COGNITO_USER_POOL = fromString("AWS::Cognito::UserPool"); + + /** + * Static value AWS::Cognito::UserPoolClient for ResourceType. + */ + public static final ResourceType AWS_COGNITO_USER_POOL_CLIENT = fromString("AWS::Cognito::UserPoolClient"); + + /** + * Static value AWS::Cognito::UserPoolGroup for ResourceType. + */ + public static final ResourceType AWS_COGNITO_USER_POOL_GROUP = fromString("AWS::Cognito::UserPoolGroup"); + + /** + * Static value AWS::Config::ConformancePackCompliance for ResourceType. + */ + public static final ResourceType AWS_CONFIG_CONFORMANCE_PACK_COMPLIANCE + = fromString("AWS::Config::ConformancePackCompliance"); + + /** + * Static value AWS::Config::ResourceCompliance for ResourceType. + */ + public static final ResourceType AWS_CONFIG_RESOURCE_COMPLIANCE = fromString("AWS::Config::ResourceCompliance"); + + /** + * Static value AWS::Connect::Instance for ResourceType. + */ + public static final ResourceType AWS_CONNECT_INSTANCE = fromString("AWS::Connect::Instance"); + + /** + * Static value AWS::Connect::PhoneNumber for ResourceType. + */ + public static final ResourceType AWS_CONNECT_PHONE_NUMBER = fromString("AWS::Connect::PhoneNumber"); + + /** + * Static value AWS::Connect::QuickConnect for ResourceType. + */ + public static final ResourceType AWS_CONNECT_QUICK_CONNECT = fromString("AWS::Connect::QuickConnect"); + + /** + * Static value AWS::CustomerProfiles::Domain for ResourceType. + */ + public static final ResourceType AWS_CUSTOMER_PROFILES_DOMAIN = fromString("AWS::CustomerProfiles::Domain"); + + /** + * Static value AWS::CustomerProfiles::ObjectType for ResourceType. + */ + public static final ResourceType AWS_CUSTOMER_PROFILES_OBJECT_TYPE + = fromString("AWS::CustomerProfiles::ObjectType"); + + /** + * Static value AWS::DMS::Certificate for ResourceType. + */ + public static final ResourceType AWS_DMS_CERTIFICATE = fromString("AWS::DMS::Certificate"); + + /** + * Static value AWS::DMS::Endpoint for ResourceType. + */ + public static final ResourceType AWS_DMS_ENDPOINT = fromString("AWS::DMS::Endpoint"); + + /** + * Static value AWS::DMS::EventSubscription for ResourceType. + */ + public static final ResourceType AWS_DMS_EVENT_SUBSCRIPTION = fromString("AWS::DMS::EventSubscription"); + + /** + * Static value AWS::DMS::ReplicationSubnetGroup for ResourceType. + */ + public static final ResourceType AWS_DMS_REPLICATION_SUBNET_GROUP = fromString("AWS::DMS::ReplicationSubnetGroup"); + + /** + * Static value AWS::DataSync::LocationEFS for ResourceType. + */ + public static final ResourceType AWS_DATA_SYNC_LOCATION_EFS = fromString("AWS::DataSync::LocationEFS"); + + /** + * Static value AWS::DataSync::LocationFSxLustre for ResourceType. + */ + public static final ResourceType AWS_DATA_SYNC_LOCATION_FSX_LUSTRE = fromString("AWS::DataSync::LocationFSxLustre"); + + /** + * Static value AWS::DataSync::LocationFSxWindows for ResourceType. + */ + public static final ResourceType AWS_DATA_SYNC_LOCATION_FSX_WINDOWS + = fromString("AWS::DataSync::LocationFSxWindows"); + + /** + * Static value AWS::DataSync::LocationHDFS for ResourceType. + */ + public static final ResourceType AWS_DATA_SYNC_LOCATION_HDFS = fromString("AWS::DataSync::LocationHDFS"); + + /** + * Static value AWS::DataSync::LocationNFS for ResourceType. + */ + public static final ResourceType AWS_DATA_SYNC_LOCATION_NFS = fromString("AWS::DataSync::LocationNFS"); + + /** + * Static value AWS::DataSync::LocationObjectStorage for ResourceType. + */ + public static final ResourceType AWS_DATA_SYNC_LOCATION_OBJECT_STORAGE + = fromString("AWS::DataSync::LocationObjectStorage"); + + /** + * Static value AWS::DataSync::LocationS3 for ResourceType. + */ + public static final ResourceType AWS_DATA_SYNC_LOCATION_S3 = fromString("AWS::DataSync::LocationS3"); + + /** + * Static value AWS::DataSync::LocationSMB for ResourceType. + */ + public static final ResourceType AWS_DATA_SYNC_LOCATION_SMB = fromString("AWS::DataSync::LocationSMB"); + + /** + * Static value AWS::DataSync::Task for ResourceType. + */ + public static final ResourceType AWS_DATA_SYNC_TASK = fromString("AWS::DataSync::Task"); + + /** + * Static value AWS::Detective::Graph for ResourceType. + */ + public static final ResourceType AWS_DETECTIVE_GRAPH = fromString("AWS::Detective::Graph"); + + /** + * Static value AWS::DeviceFarm::InstanceProfile for ResourceType. + */ + public static final ResourceType AWS_DEVICE_FARM_INSTANCE_PROFILE = fromString("AWS::DeviceFarm::InstanceProfile"); + + /** + * Static value AWS::DeviceFarm::Project for ResourceType. + */ + public static final ResourceType AWS_DEVICE_FARM_PROJECT = fromString("AWS::DeviceFarm::Project"); + + /** + * Static value AWS::DeviceFarm::TestGridProject for ResourceType. + */ + public static final ResourceType AWS_DEVICE_FARM_TEST_GRID_PROJECT = fromString("AWS::DeviceFarm::TestGridProject"); + + /** + * Static value AWS::DynamoDB::Table for ResourceType. + */ + public static final ResourceType AWS_DYNAMO_DB_TABLE = fromString("AWS::DynamoDB::Table"); + + /** + * Static value AWS::EC2::CapacityReservation for ResourceType. + */ + public static final ResourceType AWS_EC2_CAPACITY_RESERVATION = fromString("AWS::EC2::CapacityReservation"); + + /** + * Static value AWS::EC2::CarrierGateway for ResourceType. + */ + public static final ResourceType AWS_EC2_CARRIER_GATEWAY = fromString("AWS::EC2::CarrierGateway"); + + /** + * Static value AWS::EC2::ClientVpnEndpoint for ResourceType. + */ + public static final ResourceType AWS_EC2_CLIENT_VPN_ENDPOINT = fromString("AWS::EC2::ClientVpnEndpoint"); + + /** + * Static value AWS::EC2::CustomerGateway for ResourceType. + */ + public static final ResourceType AWS_EC2_CUSTOMER_GATEWAY = fromString("AWS::EC2::CustomerGateway"); + + /** + * Static value AWS::EC2::DHCPOptions for ResourceType. + */ + public static final ResourceType AWS_EC2_DHCPOPTIONS = fromString("AWS::EC2::DHCPOptions"); + + /** + * Static value AWS::EC2::EC2Fleet for ResourceType. + */ + public static final ResourceType AWS_EC2_EC2FLEET = fromString("AWS::EC2::EC2Fleet"); + + /** + * Static value AWS::EC2::EIP for ResourceType. + */ + public static final ResourceType AWS_EC2_EIP = fromString("AWS::EC2::EIP"); + + /** + * Static value AWS::EC2::EgressOnlyInternetGateway for ResourceType. + */ + public static final ResourceType AWS_EC2_EGRESS_ONLY_INTERNET_GATEWAY + = fromString("AWS::EC2::EgressOnlyInternetGateway"); + + /** + * Static value AWS::EC2::FlowLog for ResourceType. + */ + public static final ResourceType AWS_EC2_FLOW_LOG = fromString("AWS::EC2::FlowLog"); + + /** + * Static value AWS::EC2::Host for ResourceType. + */ + public static final ResourceType AWS_EC2_HOST = fromString("AWS::EC2::Host"); + + /** + * Static value AWS::EC2::IPAM for ResourceType. + */ + public static final ResourceType AWS_EC2_IPAM = fromString("AWS::EC2::IPAM"); + + /** + * Static value AWS::EC2::IPAMPool for ResourceType. + */ + public static final ResourceType AWS_EC2_IPAMPOOL = fromString("AWS::EC2::IPAMPool"); + + /** + * Static value AWS::EC2::IPAMScope for ResourceType. + */ + public static final ResourceType AWS_EC2_IPAMSCOPE = fromString("AWS::EC2::IPAMScope"); + + /** + * Static value AWS::EC2::Instance for ResourceType. + */ + public static final ResourceType AWS_EC2_INSTANCE = fromString("AWS::EC2::Instance"); + + /** + * Static value AWS::EC2::InternetGateway for ResourceType. + */ + public static final ResourceType AWS_EC2_INTERNET_GATEWAY = fromString("AWS::EC2::InternetGateway"); + + /** + * Static value AWS::EC2::LaunchTemplate for ResourceType. + */ + public static final ResourceType AWS_EC2_LAUNCH_TEMPLATE = fromString("AWS::EC2::LaunchTemplate"); + + /** + * Static value AWS::EC2::NatGateway for ResourceType. + */ + public static final ResourceType AWS_EC2_NAT_GATEWAY = fromString("AWS::EC2::NatGateway"); + + /** + * Static value AWS::EC2::NetworkAcl for ResourceType. + */ + public static final ResourceType AWS_EC2_NETWORK_ACL = fromString("AWS::EC2::NetworkAcl"); + + /** + * Static value AWS::EC2::NetworkInsightsAccessScope for ResourceType. + */ + public static final ResourceType AWS_EC2_NETWORK_INSIGHTS_ACCESS_SCOPE + = fromString("AWS::EC2::NetworkInsightsAccessScope"); + + /** + * Static value AWS::EC2::NetworkInsightsAccessScopeAnalysis for ResourceType. + */ + public static final ResourceType AWS_EC2_NETWORK_INSIGHTS_ACCESS_SCOPE_ANALYSIS + = fromString("AWS::EC2::NetworkInsightsAccessScopeAnalysis"); + + /** + * Static value AWS::EC2::NetworkInsightsAnalysis for ResourceType. + */ + public static final ResourceType AWS_EC2_NETWORK_INSIGHTS_ANALYSIS + = fromString("AWS::EC2::NetworkInsightsAnalysis"); + + /** + * Static value AWS::EC2::NetworkInsightsPath for ResourceType. + */ + public static final ResourceType AWS_EC2_NETWORK_INSIGHTS_PATH = fromString("AWS::EC2::NetworkInsightsPath"); + + /** + * Static value AWS::EC2::NetworkInterface for ResourceType. + */ + public static final ResourceType AWS_EC2_NETWORK_INTERFACE = fromString("AWS::EC2::NetworkInterface"); + + /** + * Static value AWS::EC2::PrefixList for ResourceType. + */ + public static final ResourceType AWS_EC2_PREFIX_LIST = fromString("AWS::EC2::PrefixList"); + + /** + * Static value AWS::EC2::RegisteredHAInstance for ResourceType. + */ + public static final ResourceType AWS_EC2_REGISTERED_HAINSTANCE = fromString("AWS::EC2::RegisteredHAInstance"); + + /** + * Static value AWS::EC2::RouteTable for ResourceType. + */ + public static final ResourceType AWS_EC2_ROUTE_TABLE = fromString("AWS::EC2::RouteTable"); + + /** + * Static value AWS::EC2::SecurityGroup for ResourceType. + */ + public static final ResourceType AWS_EC2_SECURITY_GROUP = fromString("AWS::EC2::SecurityGroup"); + + /** + * Static value AWS::EC2::SpotFleet for ResourceType. + */ + public static final ResourceType AWS_EC2_SPOT_FLEET = fromString("AWS::EC2::SpotFleet"); + + /** + * Static value AWS::EC2::Subnet for ResourceType. + */ + public static final ResourceType AWS_EC2_SUBNET = fromString("AWS::EC2::Subnet"); + + /** + * Static value AWS::EC2::SubnetRouteTableAssociation for ResourceType. + */ + public static final ResourceType AWS_EC2_SUBNET_ROUTE_TABLE_ASSOCIATION + = fromString("AWS::EC2::SubnetRouteTableAssociation"); + + /** + * Static value AWS::EC2::TrafficMirrorFilter for ResourceType. + */ + public static final ResourceType AWS_EC2_TRAFFIC_MIRROR_FILTER = fromString("AWS::EC2::TrafficMirrorFilter"); + + /** + * Static value AWS::EC2::TrafficMirrorSession for ResourceType. + */ + public static final ResourceType AWS_EC2_TRAFFIC_MIRROR_SESSION = fromString("AWS::EC2::TrafficMirrorSession"); + + /** + * Static value AWS::EC2::TrafficMirrorTarget for ResourceType. + */ + public static final ResourceType AWS_EC2_TRAFFIC_MIRROR_TARGET = fromString("AWS::EC2::TrafficMirrorTarget"); + + /** + * Static value AWS::EC2::TransitGateway for ResourceType. + */ + public static final ResourceType AWS_EC2_TRANSIT_GATEWAY = fromString("AWS::EC2::TransitGateway"); + + /** + * Static value AWS::EC2::TransitGatewayAttachment for ResourceType. + */ + public static final ResourceType AWS_EC2_TRANSIT_GATEWAY_ATTACHMENT + = fromString("AWS::EC2::TransitGatewayAttachment"); + + /** + * Static value AWS::EC2::TransitGatewayConnect for ResourceType. + */ + public static final ResourceType AWS_EC2_TRANSIT_GATEWAY_CONNECT = fromString("AWS::EC2::TransitGatewayConnect"); + + /** + * Static value AWS::EC2::TransitGatewayMulticastDomain for ResourceType. + */ + public static final ResourceType AWS_EC2_TRANSIT_GATEWAY_MULTICAST_DOMAIN + = fromString("AWS::EC2::TransitGatewayMulticastDomain"); + + /** + * Static value AWS::EC2::TransitGatewayRouteTable for ResourceType. + */ + public static final ResourceType AWS_EC2_TRANSIT_GATEWAY_ROUTE_TABLE + = fromString("AWS::EC2::TransitGatewayRouteTable"); + + /** + * Static value AWS::EC2::VPC for ResourceType. + */ + public static final ResourceType AWS_EC2_VPC = fromString("AWS::EC2::VPC"); + + /** + * Static value AWS::EC2::VPCEndpoint for ResourceType. + */ + public static final ResourceType AWS_EC2_VPCENDPOINT = fromString("AWS::EC2::VPCEndpoint"); + + /** + * Static value AWS::EC2::VPCEndpointService for ResourceType. + */ + public static final ResourceType AWS_EC2_VPCENDPOINT_SERVICE = fromString("AWS::EC2::VPCEndpointService"); + + /** + * Static value AWS::EC2::VPCPeeringConnection for ResourceType. + */ + public static final ResourceType AWS_EC2_VPCPEERING_CONNECTION = fromString("AWS::EC2::VPCPeeringConnection"); + + /** + * Static value AWS::EC2::VPNConnection for ResourceType. + */ + public static final ResourceType AWS_EC2_VPNCONNECTION = fromString("AWS::EC2::VPNConnection"); + + /** + * Static value AWS::EC2::VPNGateway for ResourceType. + */ + public static final ResourceType AWS_EC2_VPNGATEWAY = fromString("AWS::EC2::VPNGateway"); + + /** + * Static value AWS::EC2::Volume for ResourceType. + */ + public static final ResourceType AWS_EC2_VOLUME = fromString("AWS::EC2::Volume"); + + /** + * Static value AWS::ECR::PublicRepository for ResourceType. + */ + public static final ResourceType AWS_ECR_PUBLIC_REPOSITORY = fromString("AWS::ECR::PublicRepository"); + + /** + * Static value AWS::ECR::PullThroughCacheRule for ResourceType. + */ + public static final ResourceType AWS_ECR_PULL_THROUGH_CACHE_RULE = fromString("AWS::ECR::PullThroughCacheRule"); + + /** + * Static value AWS::ECR::RegistryPolicy for ResourceType. + */ + public static final ResourceType AWS_ECR_REGISTRY_POLICY = fromString("AWS::ECR::RegistryPolicy"); + + /** + * Static value AWS::ECR::Repository for ResourceType. + */ + public static final ResourceType AWS_ECR_REPOSITORY = fromString("AWS::ECR::Repository"); + + /** + * Static value AWS::ECS::CapacityProvider for ResourceType. + */ + public static final ResourceType AWS_ECS_CAPACITY_PROVIDER = fromString("AWS::ECS::CapacityProvider"); + + /** + * Static value AWS::ECS::Cluster for ResourceType. + */ + public static final ResourceType AWS_ECS_CLUSTER = fromString("AWS::ECS::Cluster"); + + /** + * Static value AWS::ECS::Service for ResourceType. + */ + public static final ResourceType AWS_ECS_SERVICE = fromString("AWS::ECS::Service"); + + /** + * Static value AWS::ECS::TaskDefinition for ResourceType. + */ + public static final ResourceType AWS_ECS_TASK_DEFINITION = fromString("AWS::ECS::TaskDefinition"); + + /** + * Static value AWS::ECS::TaskSet for ResourceType. + */ + public static final ResourceType AWS_ECS_TASK_SET = fromString("AWS::ECS::TaskSet"); + + /** + * Static value AWS::EFS::AccessPoint for ResourceType. + */ + public static final ResourceType AWS_EFS_ACCESS_POINT = fromString("AWS::EFS::AccessPoint"); + + /** + * Static value AWS::EFS::FileSystem for ResourceType. + */ + public static final ResourceType AWS_EFS_FILE_SYSTEM = fromString("AWS::EFS::FileSystem"); + + /** + * Static value AWS::EKS::Addon for ResourceType. + */ + public static final ResourceType AWS_EKS_ADDON = fromString("AWS::EKS::Addon"); + + /** + * Static value AWS::EKS::Cluster for ResourceType. + */ + public static final ResourceType AWS_EKS_CLUSTER = fromString("AWS::EKS::Cluster"); + + /** + * Static value AWS::EKS::FargateProfile for ResourceType. + */ + public static final ResourceType AWS_EKS_FARGATE_PROFILE = fromString("AWS::EKS::FargateProfile"); + + /** + * Static value AWS::EKS::IdentityProviderConfig for ResourceType. + */ + public static final ResourceType AWS_EKS_IDENTITY_PROVIDER_CONFIG = fromString("AWS::EKS::IdentityProviderConfig"); + + /** + * Static value AWS::EMR::SecurityConfiguration for ResourceType. + */ + public static final ResourceType AWS_EMR_SECURITY_CONFIGURATION = fromString("AWS::EMR::SecurityConfiguration"); + + /** + * Static value AWS::ElasticBeanstalk::Application for ResourceType. + */ + public static final ResourceType AWS_ELASTIC_BEANSTALK_APPLICATION + = fromString("AWS::ElasticBeanstalk::Application"); + + /** + * Static value AWS::ElasticBeanstalk::ApplicationVersion for ResourceType. + */ + public static final ResourceType AWS_ELASTIC_BEANSTALK_APPLICATION_VERSION + = fromString("AWS::ElasticBeanstalk::ApplicationVersion"); + + /** + * Static value AWS::ElasticBeanstalk::Environment for ResourceType. + */ + public static final ResourceType AWS_ELASTIC_BEANSTALK_ENVIRONMENT + = fromString("AWS::ElasticBeanstalk::Environment"); + + /** + * Static value AWS::ElasticLoadBalancing::LoadBalancer for ResourceType. + */ + public static final ResourceType AWS_ELASTIC_LOAD_BALANCING_LOAD_BALANCER + = fromString("AWS::ElasticLoadBalancing::LoadBalancer"); + + /** + * Static value AWS::ElasticLoadBalancingV2::Listener for ResourceType. + */ + public static final ResourceType AWS_ELASTIC_LOAD_BALANCING_V2_LISTENER + = fromString("AWS::ElasticLoadBalancingV2::Listener"); + + /** + * Static value AWS::ElasticLoadBalancingV2::LoadBalancer for ResourceType. + */ + public static final ResourceType AWS_ELASTIC_LOAD_BALANCING_V2_LOAD_BALANCER + = fromString("AWS::ElasticLoadBalancingV2::LoadBalancer"); + + /** + * Static value AWS::Elasticsearch::Domain for ResourceType. + */ + public static final ResourceType AWS_ELASTICSEARCH_DOMAIN = fromString("AWS::Elasticsearch::Domain"); + + /** + * Static value AWS::EventSchemas::Discoverer for ResourceType. + */ + public static final ResourceType AWS_EVENT_SCHEMAS_DISCOVERER = fromString("AWS::EventSchemas::Discoverer"); + + /** + * Static value AWS::EventSchemas::Registry for ResourceType. + */ + public static final ResourceType AWS_EVENT_SCHEMAS_REGISTRY = fromString("AWS::EventSchemas::Registry"); + + /** + * Static value AWS::EventSchemas::RegistryPolicy for ResourceType. + */ + public static final ResourceType AWS_EVENT_SCHEMAS_REGISTRY_POLICY + = fromString("AWS::EventSchemas::RegistryPolicy"); + + /** + * Static value AWS::EventSchemas::Schema for ResourceType. + */ + public static final ResourceType AWS_EVENT_SCHEMAS_SCHEMA = fromString("AWS::EventSchemas::Schema"); + + /** + * Static value AWS::Events::ApiDestination for ResourceType. + */ + public static final ResourceType AWS_EVENTS_API_DESTINATION = fromString("AWS::Events::ApiDestination"); + + /** + * Static value AWS::Events::Archive for ResourceType. + */ + public static final ResourceType AWS_EVENTS_ARCHIVE = fromString("AWS::Events::Archive"); + + /** + * Static value AWS::Events::Connection for ResourceType. + */ + public static final ResourceType AWS_EVENTS_CONNECTION = fromString("AWS::Events::Connection"); + + /** + * Static value AWS::Events::Endpoint for ResourceType. + */ + public static final ResourceType AWS_EVENTS_ENDPOINT = fromString("AWS::Events::Endpoint"); + + /** + * Static value AWS::Events::EventBus for ResourceType. + */ + public static final ResourceType AWS_EVENTS_EVENT_BUS = fromString("AWS::Events::EventBus"); + + /** + * Static value AWS::Events::Rule for ResourceType. + */ + public static final ResourceType AWS_EVENTS_RULE = fromString("AWS::Events::Rule"); + + /** + * Static value AWS::Evidently::Launch for ResourceType. + */ + public static final ResourceType AWS_EVIDENTLY_LAUNCH = fromString("AWS::Evidently::Launch"); + + /** + * Static value AWS::Evidently::Project for ResourceType. + */ + public static final ResourceType AWS_EVIDENTLY_PROJECT = fromString("AWS::Evidently::Project"); + + /** + * Static value AWS::FIS::ExperimentTemplate for ResourceType. + */ + public static final ResourceType AWS_FIS_EXPERIMENT_TEMPLATE = fromString("AWS::FIS::ExperimentTemplate"); + + /** + * Static value AWS::Forecast::Dataset for ResourceType. + */ + public static final ResourceType AWS_FORECAST_DATASET = fromString("AWS::Forecast::Dataset"); + + /** + * Static value AWS::Forecast::DatasetGroup for ResourceType. + */ + public static final ResourceType AWS_FORECAST_DATASET_GROUP = fromString("AWS::Forecast::DatasetGroup"); + + /** + * Static value AWS::FraudDetector::EntityType for ResourceType. + */ + public static final ResourceType AWS_FRAUD_DETECTOR_ENTITY_TYPE = fromString("AWS::FraudDetector::EntityType"); + + /** + * Static value AWS::FraudDetector::Label for ResourceType. + */ + public static final ResourceType AWS_FRAUD_DETECTOR_LABEL = fromString("AWS::FraudDetector::Label"); + + /** + * Static value AWS::FraudDetector::Outcome for ResourceType. + */ + public static final ResourceType AWS_FRAUD_DETECTOR_OUTCOME = fromString("AWS::FraudDetector::Outcome"); + + /** + * Static value AWS::FraudDetector::Variable for ResourceType. + */ + public static final ResourceType AWS_FRAUD_DETECTOR_VARIABLE = fromString("AWS::FraudDetector::Variable"); + + /** + * Static value AWS::GlobalAccelerator::Accelerator for ResourceType. + */ + public static final ResourceType AWS_GLOBAL_ACCELERATOR_ACCELERATOR + = fromString("AWS::GlobalAccelerator::Accelerator"); + + /** + * Static value AWS::GlobalAccelerator::EndpointGroup for ResourceType. + */ + public static final ResourceType AWS_GLOBAL_ACCELERATOR_ENDPOINT_GROUP + = fromString("AWS::GlobalAccelerator::EndpointGroup"); + + /** + * Static value AWS::GlobalAccelerator::Listener for ResourceType. + */ + public static final ResourceType AWS_GLOBAL_ACCELERATOR_LISTENER = fromString("AWS::GlobalAccelerator::Listener"); + + /** + * Static value AWS::Glue::Classifier for ResourceType. + */ + public static final ResourceType AWS_GLUE_CLASSIFIER = fromString("AWS::Glue::Classifier"); + + /** + * Static value AWS::Glue::Job for ResourceType. + */ + public static final ResourceType AWS_GLUE_JOB = fromString("AWS::Glue::Job"); + + /** + * Static value AWS::Glue::MLTransform for ResourceType. + */ + public static final ResourceType AWS_GLUE_MLTRANSFORM = fromString("AWS::Glue::MLTransform"); + + /** + * Static value AWS::Grafana::Workspace for ResourceType. + */ + public static final ResourceType AWS_GRAFANA_WORKSPACE = fromString("AWS::Grafana::Workspace"); + + /** + * Static value AWS::GreengrassV2::ComponentVersion for ResourceType. + */ + public static final ResourceType AWS_GREENGRASS_V2_COMPONENT_VERSION + = fromString("AWS::GreengrassV2::ComponentVersion"); + + /** + * Static value AWS::GroundStation::Config for ResourceType. + */ + public static final ResourceType AWS_GROUND_STATION_CONFIG = fromString("AWS::GroundStation::Config"); + + /** + * Static value AWS::GroundStation::DataflowEndpointGroup for ResourceType. + */ + public static final ResourceType AWS_GROUND_STATION_DATAFLOW_ENDPOINT_GROUP + = fromString("AWS::GroundStation::DataflowEndpointGroup"); + + /** + * Static value AWS::GroundStation::MissionProfile for ResourceType. + */ + public static final ResourceType AWS_GROUND_STATION_MISSION_PROFILE + = fromString("AWS::GroundStation::MissionProfile"); + + /** + * Static value AWS::GuardDuty::Detector for ResourceType. + */ + public static final ResourceType AWS_GUARD_DUTY_DETECTOR = fromString("AWS::GuardDuty::Detector"); + + /** + * Static value AWS::GuardDuty::Filter for ResourceType. + */ + public static final ResourceType AWS_GUARD_DUTY_FILTER = fromString("AWS::GuardDuty::Filter"); + + /** + * Static value AWS::GuardDuty::IPSet for ResourceType. + */ + public static final ResourceType AWS_GUARD_DUTY_IPSET = fromString("AWS::GuardDuty::IPSet"); + + /** + * Static value AWS::GuardDuty::ThreatIntelSet for ResourceType. + */ + public static final ResourceType AWS_GUARD_DUTY_THREAT_INTEL_SET = fromString("AWS::GuardDuty::ThreatIntelSet"); + + /** + * Static value AWS::HealthLake::FHIRDatastore for ResourceType. + */ + public static final ResourceType AWS_HEALTH_LAKE_FHIRDATASTORE = fromString("AWS::HealthLake::FHIRDatastore"); + + /** + * Static value AWS::IAM::Group for ResourceType. + */ + public static final ResourceType AWS_IAM_GROUP = fromString("AWS::IAM::Group"); + + /** + * Static value AWS::IAM::InstanceProfile for ResourceType. + */ + public static final ResourceType AWS_IAM_INSTANCE_PROFILE = fromString("AWS::IAM::InstanceProfile"); + + /** + * Static value AWS::IAM::Policy for ResourceType. + */ + public static final ResourceType AWS_IAM_POLICY = fromString("AWS::IAM::Policy"); + + /** + * Static value AWS::IAM::Role for ResourceType. + */ + public static final ResourceType AWS_IAM_ROLE = fromString("AWS::IAM::Role"); + + /** + * Static value AWS::IAM::SAMLProvider for ResourceType. + */ + public static final ResourceType AWS_IAM_SAMLPROVIDER = fromString("AWS::IAM::SAMLProvider"); + + /** + * Static value AWS::IAM::ServerCertificate for ResourceType. + */ + public static final ResourceType AWS_IAM_SERVER_CERTIFICATE = fromString("AWS::IAM::ServerCertificate"); + + /** + * Static value AWS::IAM::User for ResourceType. + */ + public static final ResourceType AWS_IAM_USER = fromString("AWS::IAM::User"); + + /** + * Static value AWS::IVS::Channel for ResourceType. + */ + public static final ResourceType AWS_IVS_CHANNEL = fromString("AWS::IVS::Channel"); + + /** + * Static value AWS::IVS::PlaybackKeyPair for ResourceType. + */ + public static final ResourceType AWS_IVS_PLAYBACK_KEY_PAIR = fromString("AWS::IVS::PlaybackKeyPair"); + + /** + * Static value AWS::IVS::RecordingConfiguration for ResourceType. + */ + public static final ResourceType AWS_IVS_RECORDING_CONFIGURATION = fromString("AWS::IVS::RecordingConfiguration"); + + /** + * Static value AWS::ImageBuilder::ContainerRecipe for ResourceType. + */ + public static final ResourceType AWS_IMAGE_BUILDER_CONTAINER_RECIPE + = fromString("AWS::ImageBuilder::ContainerRecipe"); + + /** + * Static value AWS::ImageBuilder::DistributionConfiguration for ResourceType. + */ + public static final ResourceType AWS_IMAGE_BUILDER_DISTRIBUTION_CONFIGURATION + = fromString("AWS::ImageBuilder::DistributionConfiguration"); + + /** + * Static value AWS::ImageBuilder::ImagePipeline for ResourceType. + */ + public static final ResourceType AWS_IMAGE_BUILDER_IMAGE_PIPELINE = fromString("AWS::ImageBuilder::ImagePipeline"); + + /** + * Static value AWS::ImageBuilder::ImageRecipe for ResourceType. + */ + public static final ResourceType AWS_IMAGE_BUILDER_IMAGE_RECIPE = fromString("AWS::ImageBuilder::ImageRecipe"); + + /** + * Static value AWS::ImageBuilder::InfrastructureConfiguration for ResourceType. + */ + public static final ResourceType AWS_IMAGE_BUILDER_INFRASTRUCTURE_CONFIGURATION + = fromString("AWS::ImageBuilder::InfrastructureConfiguration"); + + /** + * Static value AWS::InspectorV2::Filter for ResourceType. + */ + public static final ResourceType AWS_INSPECTOR_V2_FILTER = fromString("AWS::InspectorV2::Filter"); + + /** + * Static value AWS::IoT::AccountAuditConfiguration for ResourceType. + */ + public static final ResourceType AWS_IO_T_ACCOUNT_AUDIT_CONFIGURATION + = fromString("AWS::IoT::AccountAuditConfiguration"); + + /** + * Static value AWS::IoT::Authorizer for ResourceType. + */ + public static final ResourceType AWS_IO_T_AUTHORIZER = fromString("AWS::IoT::Authorizer"); + + /** + * Static value AWS::IoT::CACertificate for ResourceType. + */ + public static final ResourceType AWS_IO_T_CACERTIFICATE = fromString("AWS::IoT::CACertificate"); + + /** + * Static value AWS::IoT::CustomMetric for ResourceType. + */ + public static final ResourceType AWS_IO_T_CUSTOM_METRIC = fromString("AWS::IoT::CustomMetric"); + + /** + * Static value AWS::IoT::Dimension for ResourceType. + */ + public static final ResourceType AWS_IO_T_DIMENSION = fromString("AWS::IoT::Dimension"); + + /** + * Static value AWS::IoT::FleetMetric for ResourceType. + */ + public static final ResourceType AWS_IO_T_FLEET_METRIC = fromString("AWS::IoT::FleetMetric"); + + /** + * Static value AWS::IoT::JobTemplate for ResourceType. + */ + public static final ResourceType AWS_IO_T_JOB_TEMPLATE = fromString("AWS::IoT::JobTemplate"); + + /** + * Static value AWS::IoT::MitigationAction for ResourceType. + */ + public static final ResourceType AWS_IO_T_MITIGATION_ACTION = fromString("AWS::IoT::MitigationAction"); + + /** + * Static value AWS::IoT::Policy for ResourceType. + */ + public static final ResourceType AWS_IO_T_POLICY = fromString("AWS::IoT::Policy"); + + /** + * Static value AWS::IoT::ProvisioningTemplate for ResourceType. + */ + public static final ResourceType AWS_IO_T_PROVISIONING_TEMPLATE = fromString("AWS::IoT::ProvisioningTemplate"); + + /** + * Static value AWS::IoT::RoleAlias for ResourceType. + */ + public static final ResourceType AWS_IO_T_ROLE_ALIAS = fromString("AWS::IoT::RoleAlias"); + + /** + * Static value AWS::IoT::ScheduledAudit for ResourceType. + */ + public static final ResourceType AWS_IO_T_SCHEDULED_AUDIT = fromString("AWS::IoT::ScheduledAudit"); + + /** + * Static value AWS::IoT::SecurityProfile for ResourceType. + */ + public static final ResourceType AWS_IO_T_SECURITY_PROFILE = fromString("AWS::IoT::SecurityProfile"); + + /** + * Static value AWS::IoTAnalytics::Channel for ResourceType. + */ + public static final ResourceType AWS_IO_TANALYTICS_CHANNEL = fromString("AWS::IoTAnalytics::Channel"); + + /** + * Static value AWS::IoTAnalytics::Dataset for ResourceType. + */ + public static final ResourceType AWS_IO_TANALYTICS_DATASET = fromString("AWS::IoTAnalytics::Dataset"); + + /** + * Static value AWS::IoTAnalytics::Datastore for ResourceType. + */ + public static final ResourceType AWS_IO_TANALYTICS_DATASTORE = fromString("AWS::IoTAnalytics::Datastore"); + + /** + * Static value AWS::IoTAnalytics::Pipeline for ResourceType. + */ + public static final ResourceType AWS_IO_TANALYTICS_PIPELINE = fromString("AWS::IoTAnalytics::Pipeline"); + + /** + * Static value AWS::IoTEvents::AlarmModel for ResourceType. + */ + public static final ResourceType AWS_IO_TEVENTS_ALARM_MODEL = fromString("AWS::IoTEvents::AlarmModel"); + + /** + * Static value AWS::IoTEvents::DetectorModel for ResourceType. + */ + public static final ResourceType AWS_IO_TEVENTS_DETECTOR_MODEL = fromString("AWS::IoTEvents::DetectorModel"); + + /** + * Static value AWS::IoTEvents::Input for ResourceType. + */ + public static final ResourceType AWS_IO_TEVENTS_INPUT = fromString("AWS::IoTEvents::Input"); + + /** + * Static value AWS::IoTSiteWise::AssetModel for ResourceType. + */ + public static final ResourceType AWS_IO_TSITE_WISE_ASSET_MODEL = fromString("AWS::IoTSiteWise::AssetModel"); + + /** + * Static value AWS::IoTSiteWise::Dashboard for ResourceType. + */ + public static final ResourceType AWS_IO_TSITE_WISE_DASHBOARD = fromString("AWS::IoTSiteWise::Dashboard"); + + /** + * Static value AWS::IoTSiteWise::Gateway for ResourceType. + */ + public static final ResourceType AWS_IO_TSITE_WISE_GATEWAY = fromString("AWS::IoTSiteWise::Gateway"); + + /** + * Static value AWS::IoTSiteWise::Portal for ResourceType. + */ + public static final ResourceType AWS_IO_TSITE_WISE_PORTAL = fromString("AWS::IoTSiteWise::Portal"); + + /** + * Static value AWS::IoTSiteWise::Project for ResourceType. + */ + public static final ResourceType AWS_IO_TSITE_WISE_PROJECT = fromString("AWS::IoTSiteWise::Project"); + + /** + * Static value AWS::IoTTwinMaker::ComponentType for ResourceType. + */ + public static final ResourceType AWS_IO_TTWIN_MAKER_COMPONENT_TYPE = fromString("AWS::IoTTwinMaker::ComponentType"); + + /** + * Static value AWS::IoTTwinMaker::Entity for ResourceType. + */ + public static final ResourceType AWS_IO_TTWIN_MAKER_ENTITY = fromString("AWS::IoTTwinMaker::Entity"); + + /** + * Static value AWS::IoTTwinMaker::Scene for ResourceType. + */ + public static final ResourceType AWS_IO_TTWIN_MAKER_SCENE = fromString("AWS::IoTTwinMaker::Scene"); + + /** + * Static value AWS::IoTTwinMaker::SyncJob for ResourceType. + */ + public static final ResourceType AWS_IO_TTWIN_MAKER_SYNC_JOB = fromString("AWS::IoTTwinMaker::SyncJob"); + + /** + * Static value AWS::IoTTwinMaker::Workspace for ResourceType. + */ + public static final ResourceType AWS_IO_TTWIN_MAKER_WORKSPACE = fromString("AWS::IoTTwinMaker::Workspace"); + + /** + * Static value AWS::IoTWireless::FuotaTask for ResourceType. + */ + public static final ResourceType AWS_IO_TWIRELESS_FUOTA_TASK = fromString("AWS::IoTWireless::FuotaTask"); + + /** + * Static value AWS::IoTWireless::MulticastGroup for ResourceType. + */ + public static final ResourceType AWS_IO_TWIRELESS_MULTICAST_GROUP = fromString("AWS::IoTWireless::MulticastGroup"); + + /** + * Static value AWS::IoTWireless::ServiceProfile for ResourceType. + */ + public static final ResourceType AWS_IO_TWIRELESS_SERVICE_PROFILE = fromString("AWS::IoTWireless::ServiceProfile"); + + /** + * Static value AWS::KMS::Alias for ResourceType. + */ + public static final ResourceType AWS_KMS_ALIAS = fromString("AWS::KMS::Alias"); + + /** + * Static value AWS::KMS::Key for ResourceType. + */ + public static final ResourceType AWS_KMS_KEY = fromString("AWS::KMS::Key"); + + /** + * Static value AWS::KafkaConnect::Connector for ResourceType. + */ + public static final ResourceType AWS_KAFKA_CONNECT_CONNECTOR = fromString("AWS::KafkaConnect::Connector"); + + /** + * Static value AWS::Kendra::Index for ResourceType. + */ + public static final ResourceType AWS_KENDRA_INDEX = fromString("AWS::Kendra::Index"); + + /** + * Static value AWS::Kinesis::Stream for ResourceType. + */ + public static final ResourceType AWS_KINESIS_STREAM = fromString("AWS::Kinesis::Stream"); + + /** + * Static value AWS::Kinesis::StreamConsumer for ResourceType. + */ + public static final ResourceType AWS_KINESIS_STREAM_CONSUMER = fromString("AWS::Kinesis::StreamConsumer"); + + /** + * Static value AWS::KinesisAnalyticsV2::Application for ResourceType. + */ + public static final ResourceType AWS_KINESIS_ANALYTICS_V2_APPLICATION + = fromString("AWS::KinesisAnalyticsV2::Application"); + + /** + * Static value AWS::KinesisFirehose::DeliveryStream for ResourceType. + */ + public static final ResourceType AWS_KINESIS_FIREHOSE_DELIVERY_STREAM + = fromString("AWS::KinesisFirehose::DeliveryStream"); + + /** + * Static value AWS::KinesisVideo::SignalingChannel for ResourceType. + */ + public static final ResourceType AWS_KINESIS_VIDEO_SIGNALING_CHANNEL + = fromString("AWS::KinesisVideo::SignalingChannel"); + + /** + * Static value AWS::KinesisVideo::Stream for ResourceType. + */ + public static final ResourceType AWS_KINESIS_VIDEO_STREAM = fromString("AWS::KinesisVideo::Stream"); + + /** + * Static value AWS::Lambda::CodeSigningConfig for ResourceType. + */ + public static final ResourceType AWS_LAMBDA_CODE_SIGNING_CONFIG = fromString("AWS::Lambda::CodeSigningConfig"); + + /** + * Static value AWS::Lambda::Function for ResourceType. + */ + public static final ResourceType AWS_LAMBDA_FUNCTION = fromString("AWS::Lambda::Function"); + + /** + * Static value AWS::Lex::Bot for ResourceType. + */ + public static final ResourceType AWS_LEX_BOT = fromString("AWS::Lex::Bot"); + + /** + * Static value AWS::Lex::BotAlias for ResourceType. + */ + public static final ResourceType AWS_LEX_BOT_ALIAS = fromString("AWS::Lex::BotAlias"); + + /** + * Static value AWS::Lightsail::Bucket for ResourceType. + */ + public static final ResourceType AWS_LIGHTSAIL_BUCKET = fromString("AWS::Lightsail::Bucket"); + + /** + * Static value AWS::Lightsail::Certificate for ResourceType. + */ + public static final ResourceType AWS_LIGHTSAIL_CERTIFICATE = fromString("AWS::Lightsail::Certificate"); + + /** + * Static value AWS::Lightsail::Disk for ResourceType. + */ + public static final ResourceType AWS_LIGHTSAIL_DISK = fromString("AWS::Lightsail::Disk"); + + /** + * Static value AWS::Lightsail::StaticIp for ResourceType. + */ + public static final ResourceType AWS_LIGHTSAIL_STATIC_IP = fromString("AWS::Lightsail::StaticIp"); + + /** + * Static value AWS::Logs::Destination for ResourceType. + */ + public static final ResourceType AWS_LOGS_DESTINATION = fromString("AWS::Logs::Destination"); + + /** + * Static value AWS::LookoutMetrics::Alert for ResourceType. + */ + public static final ResourceType AWS_LOOKOUT_METRICS_ALERT = fromString("AWS::LookoutMetrics::Alert"); + + /** + * Static value AWS::LookoutVision::Project for ResourceType. + */ + public static final ResourceType AWS_LOOKOUT_VISION_PROJECT = fromString("AWS::LookoutVision::Project"); + + /** + * Static value AWS::M2::Environment for ResourceType. + */ + public static final ResourceType AWS_M2_ENVIRONMENT = fromString("AWS::M2::Environment"); + + /** + * Static value AWS::MSK::BatchScramSecret for ResourceType. + */ + public static final ResourceType AWS_MSK_BATCH_SCRAM_SECRET = fromString("AWS::MSK::BatchScramSecret"); + + /** + * Static value AWS::MSK::Cluster for ResourceType. + */ + public static final ResourceType AWS_MSK_CLUSTER = fromString("AWS::MSK::Cluster"); + + /** + * Static value AWS::MSK::Configuration for ResourceType. + */ + public static final ResourceType AWS_MSK_CONFIGURATION = fromString("AWS::MSK::Configuration"); + + /** + * Static value AWS::MediaConnect::FlowEntitlement for ResourceType. + */ + public static final ResourceType AWS_MEDIA_CONNECT_FLOW_ENTITLEMENT + = fromString("AWS::MediaConnect::FlowEntitlement"); + + /** + * Static value AWS::MediaConnect::FlowSource for ResourceType. + */ + public static final ResourceType AWS_MEDIA_CONNECT_FLOW_SOURCE = fromString("AWS::MediaConnect::FlowSource"); + + /** + * Static value AWS::MediaConnect::FlowVpcInterface for ResourceType. + */ + public static final ResourceType AWS_MEDIA_CONNECT_FLOW_VPC_INTERFACE + = fromString("AWS::MediaConnect::FlowVpcInterface"); + + /** + * Static value AWS::MediaPackage::PackagingConfiguration for ResourceType. + */ + public static final ResourceType AWS_MEDIA_PACKAGE_PACKAGING_CONFIGURATION + = fromString("AWS::MediaPackage::PackagingConfiguration"); + + /** + * Static value AWS::MediaPackage::PackagingGroup for ResourceType. + */ + public static final ResourceType AWS_MEDIA_PACKAGE_PACKAGING_GROUP + = fromString("AWS::MediaPackage::PackagingGroup"); + + /** + * Static value AWS::MediaTailor::PlaybackConfiguration for ResourceType. + */ + public static final ResourceType AWS_MEDIA_TAILOR_PLAYBACK_CONFIGURATION + = fromString("AWS::MediaTailor::PlaybackConfiguration"); + + /** + * Static value AWS::NetworkFirewall::Firewall for ResourceType. + */ + public static final ResourceType AWS_NETWORK_FIREWALL_FIREWALL = fromString("AWS::NetworkFirewall::Firewall"); + + /** + * Static value AWS::NetworkFirewall::FirewallPolicy for ResourceType. + */ + public static final ResourceType AWS_NETWORK_FIREWALL_FIREWALL_POLICY + = fromString("AWS::NetworkFirewall::FirewallPolicy"); + + /** + * Static value AWS::NetworkFirewall::RuleGroup for ResourceType. + */ + public static final ResourceType AWS_NETWORK_FIREWALL_RULE_GROUP = fromString("AWS::NetworkFirewall::RuleGroup"); + + /** + * Static value AWS::NetworkManager::ConnectPeer for ResourceType. + */ + public static final ResourceType AWS_NETWORK_MANAGER_CONNECT_PEER = fromString("AWS::NetworkManager::ConnectPeer"); + + /** + * Static value AWS::NetworkManager::CustomerGatewayAssociation for ResourceType. + */ + public static final ResourceType AWS_NETWORK_MANAGER_CUSTOMER_GATEWAY_ASSOCIATION + = fromString("AWS::NetworkManager::CustomerGatewayAssociation"); + + /** + * Static value AWS::NetworkManager::Device for ResourceType. + */ + public static final ResourceType AWS_NETWORK_MANAGER_DEVICE = fromString("AWS::NetworkManager::Device"); + + /** + * Static value AWS::NetworkManager::GlobalNetwork for ResourceType. + */ + public static final ResourceType AWS_NETWORK_MANAGER_GLOBAL_NETWORK + = fromString("AWS::NetworkManager::GlobalNetwork"); + + /** + * Static value AWS::NetworkManager::Link for ResourceType. + */ + public static final ResourceType AWS_NETWORK_MANAGER_LINK = fromString("AWS::NetworkManager::Link"); + + /** + * Static value AWS::NetworkManager::LinkAssociation for ResourceType. + */ + public static final ResourceType AWS_NETWORK_MANAGER_LINK_ASSOCIATION + = fromString("AWS::NetworkManager::LinkAssociation"); + + /** + * Static value AWS::NetworkManager::Site for ResourceType. + */ + public static final ResourceType AWS_NETWORK_MANAGER_SITE = fromString("AWS::NetworkManager::Site"); + + /** + * Static value AWS::NetworkManager::TransitGatewayRegistration for ResourceType. + */ + public static final ResourceType AWS_NETWORK_MANAGER_TRANSIT_GATEWAY_REGISTRATION + = fromString("AWS::NetworkManager::TransitGatewayRegistration"); + + /** + * Static value AWS::OpenSearch::Domain for ResourceType. + */ + public static final ResourceType AWS_OPEN_SEARCH_DOMAIN = fromString("AWS::OpenSearch::Domain"); + + /** + * Static value AWS::Panorama::Package for ResourceType. + */ + public static final ResourceType AWS_PANORAMA_PACKAGE = fromString("AWS::Panorama::Package"); + + /** + * Static value AWS::Personalize::Dataset for ResourceType. + */ + public static final ResourceType AWS_PERSONALIZE_DATASET = fromString("AWS::Personalize::Dataset"); + + /** + * Static value AWS::Personalize::DatasetGroup for ResourceType. + */ + public static final ResourceType AWS_PERSONALIZE_DATASET_GROUP = fromString("AWS::Personalize::DatasetGroup"); + + /** + * Static value AWS::Personalize::Schema for ResourceType. + */ + public static final ResourceType AWS_PERSONALIZE_SCHEMA = fromString("AWS::Personalize::Schema"); + + /** + * Static value AWS::Personalize::Solution for ResourceType. + */ + public static final ResourceType AWS_PERSONALIZE_SOLUTION = fromString("AWS::Personalize::Solution"); + + /** + * Static value AWS::Pinpoint::App for ResourceType. + */ + public static final ResourceType AWS_PINPOINT_APP = fromString("AWS::Pinpoint::App"); + + /** + * Static value AWS::Pinpoint::ApplicationSettings for ResourceType. + */ + public static final ResourceType AWS_PINPOINT_APPLICATION_SETTINGS + = fromString("AWS::Pinpoint::ApplicationSettings"); + + /** + * Static value AWS::Pinpoint::Campaign for ResourceType. + */ + public static final ResourceType AWS_PINPOINT_CAMPAIGN = fromString("AWS::Pinpoint::Campaign"); + + /** + * Static value AWS::Pinpoint::EmailChannel for ResourceType. + */ + public static final ResourceType AWS_PINPOINT_EMAIL_CHANNEL = fromString("AWS::Pinpoint::EmailChannel"); + + /** + * Static value AWS::Pinpoint::EmailTemplate for ResourceType. + */ + public static final ResourceType AWS_PINPOINT_EMAIL_TEMPLATE = fromString("AWS::Pinpoint::EmailTemplate"); + + /** + * Static value AWS::Pinpoint::EventStream for ResourceType. + */ + public static final ResourceType AWS_PINPOINT_EVENT_STREAM = fromString("AWS::Pinpoint::EventStream"); + + /** + * Static value AWS::Pinpoint::InAppTemplate for ResourceType. + */ + public static final ResourceType AWS_PINPOINT_IN_APP_TEMPLATE = fromString("AWS::Pinpoint::InAppTemplate"); + + /** + * Static value AWS::Pinpoint::Segment for ResourceType. + */ + public static final ResourceType AWS_PINPOINT_SEGMENT = fromString("AWS::Pinpoint::Segment"); + + /** + * Static value AWS::QLDB::Ledger for ResourceType. + */ + public static final ResourceType AWS_QLDB_LEDGER = fromString("AWS::QLDB::Ledger"); + + /** + * Static value AWS::QuickSight::DataSource for ResourceType. + */ + public static final ResourceType AWS_QUICK_SIGHT_DATA_SOURCE = fromString("AWS::QuickSight::DataSource"); + + /** + * Static value AWS::QuickSight::Template for ResourceType. + */ + public static final ResourceType AWS_QUICK_SIGHT_TEMPLATE = fromString("AWS::QuickSight::Template"); + + /** + * Static value AWS::QuickSight::Theme for ResourceType. + */ + public static final ResourceType AWS_QUICK_SIGHT_THEME = fromString("AWS::QuickSight::Theme"); + + /** + * Static value AWS::RDS::DBCluster for ResourceType. + */ + public static final ResourceType AWS_RDS_DBCLUSTER = fromString("AWS::RDS::DBCluster"); + + /** + * Static value AWS::RDS::DBClusterSnapshot for ResourceType. + */ + public static final ResourceType AWS_RDS_DBCLUSTER_SNAPSHOT = fromString("AWS::RDS::DBClusterSnapshot"); + + /** + * Static value AWS::RDS::DBInstance for ResourceType. + */ + public static final ResourceType AWS_RDS_DBINSTANCE = fromString("AWS::RDS::DBInstance"); + + /** + * Static value AWS::RDS::DBSecurityGroup for ResourceType. + */ + public static final ResourceType AWS_RDS_DBSECURITY_GROUP = fromString("AWS::RDS::DBSecurityGroup"); + + /** + * Static value AWS::RDS::DBSnapshot for ResourceType. + */ + public static final ResourceType AWS_RDS_DBSNAPSHOT = fromString("AWS::RDS::DBSnapshot"); + + /** + * Static value AWS::RDS::DBSubnetGroup for ResourceType. + */ + public static final ResourceType AWS_RDS_DBSUBNET_GROUP = fromString("AWS::RDS::DBSubnetGroup"); + + /** + * Static value AWS::RDS::EventSubscription for ResourceType. + */ + public static final ResourceType AWS_RDS_EVENT_SUBSCRIPTION = fromString("AWS::RDS::EventSubscription"); + + /** + * Static value AWS::RDS::GlobalCluster for ResourceType. + */ + public static final ResourceType AWS_RDS_GLOBAL_CLUSTER = fromString("AWS::RDS::GlobalCluster"); + + /** + * Static value AWS::RDS::OptionGroup for ResourceType. + */ + public static final ResourceType AWS_RDS_OPTION_GROUP = fromString("AWS::RDS::OptionGroup"); + + /** + * Static value AWS::RUM::AppMonitor for ResourceType. + */ + public static final ResourceType AWS_RUM_APP_MONITOR = fromString("AWS::RUM::AppMonitor"); + + /** + * Static value AWS::Redshift::Cluster for ResourceType. + */ + public static final ResourceType AWS_REDSHIFT_CLUSTER = fromString("AWS::Redshift::Cluster"); + + /** + * Static value AWS::Redshift::ClusterParameterGroup for ResourceType. + */ + public static final ResourceType AWS_REDSHIFT_CLUSTER_PARAMETER_GROUP + = fromString("AWS::Redshift::ClusterParameterGroup"); + + /** + * Static value AWS::Redshift::ClusterSecurityGroup for ResourceType. + */ + public static final ResourceType AWS_REDSHIFT_CLUSTER_SECURITY_GROUP + = fromString("AWS::Redshift::ClusterSecurityGroup"); + + /** + * Static value AWS::Redshift::ClusterSnapshot for ResourceType. + */ + public static final ResourceType AWS_REDSHIFT_CLUSTER_SNAPSHOT = fromString("AWS::Redshift::ClusterSnapshot"); + + /** + * Static value AWS::Redshift::ClusterSubnetGroup for ResourceType. + */ + public static final ResourceType AWS_REDSHIFT_CLUSTER_SUBNET_GROUP + = fromString("AWS::Redshift::ClusterSubnetGroup"); + + /** + * Static value AWS::Redshift::EndpointAccess for ResourceType. + */ + public static final ResourceType AWS_REDSHIFT_ENDPOINT_ACCESS = fromString("AWS::Redshift::EndpointAccess"); + + /** + * Static value AWS::Redshift::EventSubscription for ResourceType. + */ + public static final ResourceType AWS_REDSHIFT_EVENT_SUBSCRIPTION = fromString("AWS::Redshift::EventSubscription"); + + /** + * Static value AWS::Redshift::ScheduledAction for ResourceType. + */ + public static final ResourceType AWS_REDSHIFT_SCHEDULED_ACTION = fromString("AWS::Redshift::ScheduledAction"); + + /** + * Static value AWS::ResilienceHub::App for ResourceType. + */ + public static final ResourceType AWS_RESILIENCE_HUB_APP = fromString("AWS::ResilienceHub::App"); + + /** + * Static value AWS::ResilienceHub::ResiliencyPolicy for ResourceType. + */ + public static final ResourceType AWS_RESILIENCE_HUB_RESILIENCY_POLICY + = fromString("AWS::ResilienceHub::ResiliencyPolicy"); + + /** + * Static value AWS::ResourceExplorer2::Index for ResourceType. + */ + public static final ResourceType AWS_RESOURCE_EXPLORER2_INDEX = fromString("AWS::ResourceExplorer2::Index"); + + /** + * Static value AWS::RoboMaker::RobotApplication for ResourceType. + */ + public static final ResourceType AWS_ROBO_MAKER_ROBOT_APPLICATION = fromString("AWS::RoboMaker::RobotApplication"); + + /** + * Static value AWS::RoboMaker::RobotApplicationVersion for ResourceType. + */ + public static final ResourceType AWS_ROBO_MAKER_ROBOT_APPLICATION_VERSION + = fromString("AWS::RoboMaker::RobotApplicationVersion"); + + /** + * Static value AWS::RoboMaker::SimulationApplication for ResourceType. + */ + public static final ResourceType AWS_ROBO_MAKER_SIMULATION_APPLICATION + = fromString("AWS::RoboMaker::SimulationApplication"); + + /** + * Static value AWS::Route53::HostedZone for ResourceType. + */ + public static final ResourceType AWS_ROUTE53_HOSTED_ZONE = fromString("AWS::Route53::HostedZone"); + + /** + * Static value AWS::Route53RecoveryControl::Cluster for ResourceType. + */ + public static final ResourceType AWS_ROUTE53RECOVERY_CONTROL_CLUSTER + = fromString("AWS::Route53RecoveryControl::Cluster"); + + /** + * Static value AWS::Route53RecoveryControl::ControlPanel for ResourceType. + */ + public static final ResourceType AWS_ROUTE53RECOVERY_CONTROL_CONTROL_PANEL + = fromString("AWS::Route53RecoveryControl::ControlPanel"); + + /** + * Static value AWS::Route53RecoveryControl::RoutingControl for ResourceType. + */ + public static final ResourceType AWS_ROUTE53RECOVERY_CONTROL_ROUTING_CONTROL + = fromString("AWS::Route53RecoveryControl::RoutingControl"); + + /** + * Static value AWS::Route53RecoveryControl::SafetyRule for ResourceType. + */ + public static final ResourceType AWS_ROUTE53RECOVERY_CONTROL_SAFETY_RULE + = fromString("AWS::Route53RecoveryControl::SafetyRule"); + + /** + * Static value AWS::Route53RecoveryReadiness::Cell for ResourceType. + */ + public static final ResourceType AWS_ROUTE53RECOVERY_READINESS_CELL + = fromString("AWS::Route53RecoveryReadiness::Cell"); + + /** + * Static value AWS::Route53RecoveryReadiness::ReadinessCheck for ResourceType. + */ + public static final ResourceType AWS_ROUTE53RECOVERY_READINESS_READINESS_CHECK + = fromString("AWS::Route53RecoveryReadiness::ReadinessCheck"); + + /** + * Static value AWS::Route53RecoveryReadiness::RecoveryGroup for ResourceType. + */ + public static final ResourceType AWS_ROUTE53RECOVERY_READINESS_RECOVERY_GROUP + = fromString("AWS::Route53RecoveryReadiness::RecoveryGroup"); + + /** + * Static value AWS::Route53RecoveryReadiness::ResourceSet for ResourceType. + */ + public static final ResourceType AWS_ROUTE53RECOVERY_READINESS_RESOURCE_SET + = fromString("AWS::Route53RecoveryReadiness::ResourceSet"); + + /** + * Static value AWS::Route53Resolver::FirewallDomainList for ResourceType. + */ + public static final ResourceType AWS_ROUTE53RESOLVER_FIREWALL_DOMAIN_LIST + = fromString("AWS::Route53Resolver::FirewallDomainList"); + + /** + * Static value AWS::Route53Resolver::FirewallRuleGroup for ResourceType. + */ + public static final ResourceType AWS_ROUTE53RESOLVER_FIREWALL_RULE_GROUP + = fromString("AWS::Route53Resolver::FirewallRuleGroup"); + + /** + * Static value AWS::Route53Resolver::FirewallRuleGroupAssociation for ResourceType. + */ + public static final ResourceType AWS_ROUTE53RESOLVER_FIREWALL_RULE_GROUP_ASSOCIATION + = fromString("AWS::Route53Resolver::FirewallRuleGroupAssociation"); + + /** + * Static value AWS::Route53Resolver::ResolverEndpoint for ResourceType. + */ + public static final ResourceType AWS_ROUTE53RESOLVER_RESOLVER_ENDPOINT + = fromString("AWS::Route53Resolver::ResolverEndpoint"); + + /** + * Static value AWS::Route53Resolver::ResolverQueryLoggingConfig for ResourceType. + */ + public static final ResourceType AWS_ROUTE53RESOLVER_RESOLVER_QUERY_LOGGING_CONFIG + = fromString("AWS::Route53Resolver::ResolverQueryLoggingConfig"); + + /** + * Static value AWS::Route53Resolver::ResolverQueryLoggingConfigAssociation for ResourceType. + */ + public static final ResourceType AWS_ROUTE53RESOLVER_RESOLVER_QUERY_LOGGING_CONFIG_ASSOCIATION + = fromString("AWS::Route53Resolver::ResolverQueryLoggingConfigAssociation"); + + /** + * Static value AWS::Route53Resolver::ResolverRule for ResourceType. + */ + public static final ResourceType AWS_ROUTE53RESOLVER_RESOLVER_RULE + = fromString("AWS::Route53Resolver::ResolverRule"); + + /** + * Static value AWS::Route53Resolver::ResolverRuleAssociation for ResourceType. + */ + public static final ResourceType AWS_ROUTE53RESOLVER_RESOLVER_RULE_ASSOCIATION + = fromString("AWS::Route53Resolver::ResolverRuleAssociation"); + + /** + * Static value AWS::S3::AccessPoint for ResourceType. + */ + public static final ResourceType AWS_S3_ACCESS_POINT = fromString("AWS::S3::AccessPoint"); + + /** + * Static value AWS::S3::AccountPublicAccessBlock for ResourceType. + */ + public static final ResourceType AWS_S3_ACCOUNT_PUBLIC_ACCESS_BLOCK + = fromString("AWS::S3::AccountPublicAccessBlock"); + + /** + * Static value AWS::S3::Bucket for ResourceType. + */ + public static final ResourceType AWS_S3_BUCKET = fromString("AWS::S3::Bucket"); + + /** + * Static value AWS::S3::MultiRegionAccessPoint for ResourceType. + */ + public static final ResourceType AWS_S3_MULTI_REGION_ACCESS_POINT = fromString("AWS::S3::MultiRegionAccessPoint"); + + /** + * Static value AWS::S3::StorageLens for ResourceType. + */ + public static final ResourceType AWS_S3_STORAGE_LENS = fromString("AWS::S3::StorageLens"); + + /** + * Static value AWS::SES::ConfigurationSet for ResourceType. + */ + public static final ResourceType AWS_SES_CONFIGURATION_SET = fromString("AWS::SES::ConfigurationSet"); + + /** + * Static value AWS::SES::ContactList for ResourceType. + */ + public static final ResourceType AWS_SES_CONTACT_LIST = fromString("AWS::SES::ContactList"); + + /** + * Static value AWS::SES::ReceiptFilter for ResourceType. + */ + public static final ResourceType AWS_SES_RECEIPT_FILTER = fromString("AWS::SES::ReceiptFilter"); + + /** + * Static value AWS::SES::ReceiptRuleSet for ResourceType. + */ + public static final ResourceType AWS_SES_RECEIPT_RULE_SET = fromString("AWS::SES::ReceiptRuleSet"); + + /** + * Static value AWS::SES::Template for ResourceType. + */ + public static final ResourceType AWS_SES_TEMPLATE = fromString("AWS::SES::Template"); + + /** + * Static value AWS::SNS::Topic for ResourceType. + */ + public static final ResourceType AWS_SNS_TOPIC = fromString("AWS::SNS::Topic"); + + /** + * Static value AWS::SQS::Queue for ResourceType. + */ + public static final ResourceType AWS_SQS_QUEUE = fromString("AWS::SQS::Queue"); + + /** + * Static value AWS::SSM::AssociationCompliance for ResourceType. + */ + public static final ResourceType AWS_SSM_ASSOCIATION_COMPLIANCE = fromString("AWS::SSM::AssociationCompliance"); + + /** + * Static value AWS::SSM::Document for ResourceType. + */ + public static final ResourceType AWS_SSM_DOCUMENT = fromString("AWS::SSM::Document"); + + /** + * Static value AWS::SSM::FileData for ResourceType. + */ + public static final ResourceType AWS_SSM_FILE_DATA = fromString("AWS::SSM::FileData"); + + /** + * Static value AWS::SSM::ManagedInstanceInventory for ResourceType. + */ + public static final ResourceType AWS_SSM_MANAGED_INSTANCE_INVENTORY + = fromString("AWS::SSM::ManagedInstanceInventory"); + + /** + * Static value AWS::SSM::PatchCompliance for ResourceType. + */ + public static final ResourceType AWS_SSM_PATCH_COMPLIANCE = fromString("AWS::SSM::PatchCompliance"); + + /** + * Static value AWS::SageMaker::AppImageConfig for ResourceType. + */ + public static final ResourceType AWS_SAGE_MAKER_APP_IMAGE_CONFIG = fromString("AWS::SageMaker::AppImageConfig"); + + /** + * Static value AWS::SageMaker::CodeRepository for ResourceType. + */ + public static final ResourceType AWS_SAGE_MAKER_CODE_REPOSITORY = fromString("AWS::SageMaker::CodeRepository"); + + /** + * Static value AWS::SageMaker::Domain for ResourceType. + */ + public static final ResourceType AWS_SAGE_MAKER_DOMAIN = fromString("AWS::SageMaker::Domain"); + + /** + * Static value AWS::SageMaker::FeatureGroup for ResourceType. + */ + public static final ResourceType AWS_SAGE_MAKER_FEATURE_GROUP = fromString("AWS::SageMaker::FeatureGroup"); + + /** + * Static value AWS::SageMaker::Image for ResourceType. + */ + public static final ResourceType AWS_SAGE_MAKER_IMAGE = fromString("AWS::SageMaker::Image"); + + /** + * Static value AWS::SageMaker::Model for ResourceType. + */ + public static final ResourceType AWS_SAGE_MAKER_MODEL = fromString("AWS::SageMaker::Model"); + + /** + * Static value AWS::SageMaker::NotebookInstanceLifecycleConfig for ResourceType. + */ + public static final ResourceType AWS_SAGE_MAKER_NOTEBOOK_INSTANCE_LIFECYCLE_CONFIG + = fromString("AWS::SageMaker::NotebookInstanceLifecycleConfig"); + + /** + * Static value AWS::SageMaker::Workteam for ResourceType. + */ + public static final ResourceType AWS_SAGE_MAKER_WORKTEAM = fromString("AWS::SageMaker::Workteam"); + + /** + * Static value AWS::SecretsManager::Secret for ResourceType. + */ + public static final ResourceType AWS_SECRETS_MANAGER_SECRET = fromString("AWS::SecretsManager::Secret"); + + /** + * Static value AWS::ServiceCatalog::CloudFormationProduct for ResourceType. + */ + public static final ResourceType AWS_SERVICE_CATALOG_CLOUD_FORMATION_PRODUCT + = fromString("AWS::ServiceCatalog::CloudFormationProduct"); + + /** + * Static value AWS::ServiceCatalog::CloudFormationProvisionedProduct for ResourceType. + */ + public static final ResourceType AWS_SERVICE_CATALOG_CLOUD_FORMATION_PROVISIONED_PRODUCT + = fromString("AWS::ServiceCatalog::CloudFormationProvisionedProduct"); + + /** + * Static value AWS::ServiceCatalog::Portfolio for ResourceType. + */ + public static final ResourceType AWS_SERVICE_CATALOG_PORTFOLIO = fromString("AWS::ServiceCatalog::Portfolio"); + + /** + * Static value AWS::ServiceDiscovery::HttpNamespace for ResourceType. + */ + public static final ResourceType AWS_SERVICE_DISCOVERY_HTTP_NAMESPACE + = fromString("AWS::ServiceDiscovery::HttpNamespace"); + + /** + * Static value AWS::ServiceDiscovery::Instance for ResourceType. + */ + public static final ResourceType AWS_SERVICE_DISCOVERY_INSTANCE = fromString("AWS::ServiceDiscovery::Instance"); + + /** + * Static value AWS::ServiceDiscovery::PublicDnsNamespace for ResourceType. + */ + public static final ResourceType AWS_SERVICE_DISCOVERY_PUBLIC_DNS_NAMESPACE + = fromString("AWS::ServiceDiscovery::PublicDnsNamespace"); + + /** + * Static value AWS::ServiceDiscovery::Service for ResourceType. + */ + public static final ResourceType AWS_SERVICE_DISCOVERY_SERVICE = fromString("AWS::ServiceDiscovery::Service"); + + /** + * Static value AWS::Shield::Protection for ResourceType. + */ + public static final ResourceType AWS_SHIELD_PROTECTION = fromString("AWS::Shield::Protection"); + + /** + * Static value AWS::ShieldRegional::Protection for ResourceType. + */ + public static final ResourceType AWS_SHIELD_REGIONAL_PROTECTION = fromString("AWS::ShieldRegional::Protection"); + + /** + * Static value AWS::Signer::SigningProfile for ResourceType. + */ + public static final ResourceType AWS_SIGNER_SIGNING_PROFILE = fromString("AWS::Signer::SigningProfile"); + + /** + * Static value AWS::StepFunctions::Activity for ResourceType. + */ + public static final ResourceType AWS_STEP_FUNCTIONS_ACTIVITY = fromString("AWS::StepFunctions::Activity"); + + /** + * Static value AWS::StepFunctions::StateMachine for ResourceType. + */ + public static final ResourceType AWS_STEP_FUNCTIONS_STATE_MACHINE = fromString("AWS::StepFunctions::StateMachine"); + + /** + * Static value AWS::Transfer::Agreement for ResourceType. + */ + public static final ResourceType AWS_TRANSFER_AGREEMENT = fromString("AWS::Transfer::Agreement"); + + /** + * Static value AWS::Transfer::Certificate for ResourceType. + */ + public static final ResourceType AWS_TRANSFER_CERTIFICATE = fromString("AWS::Transfer::Certificate"); + + /** + * Static value AWS::Transfer::Connector for ResourceType. + */ + public static final ResourceType AWS_TRANSFER_CONNECTOR = fromString("AWS::Transfer::Connector"); + + /** + * Static value AWS::Transfer::Workflow for ResourceType. + */ + public static final ResourceType AWS_TRANSFER_WORKFLOW = fromString("AWS::Transfer::Workflow"); + + /** + * Static value AWS::WAF::RateBasedRule for ResourceType. + */ + public static final ResourceType AWS_WAF_RATE_BASED_RULE = fromString("AWS::WAF::RateBasedRule"); + + /** + * Static value AWS::WAF::Rule for ResourceType. + */ + public static final ResourceType AWS_WAF_RULE = fromString("AWS::WAF::Rule"); + + /** + * Static value AWS::WAF::RuleGroup for ResourceType. + */ + public static final ResourceType AWS_WAF_RULE_GROUP = fromString("AWS::WAF::RuleGroup"); + + /** + * Static value AWS::WAF::WebACL for ResourceType. + */ + public static final ResourceType AWS_WAF_WEB_ACL = fromString("AWS::WAF::WebACL"); + + /** + * Static value AWS::WAFRegional::RateBasedRule for ResourceType. + */ + public static final ResourceType AWS_WAFREGIONAL_RATE_BASED_RULE = fromString("AWS::WAFRegional::RateBasedRule"); + + /** + * Static value AWS::WAFRegional::Rule for ResourceType. + */ + public static final ResourceType AWS_WAFREGIONAL_RULE = fromString("AWS::WAFRegional::Rule"); + + /** + * Static value AWS::WAFRegional::RuleGroup for ResourceType. + */ + public static final ResourceType AWS_WAFREGIONAL_RULE_GROUP = fromString("AWS::WAFRegional::RuleGroup"); + + /** + * Static value AWS::WAFRegional::WebACL for ResourceType. + */ + public static final ResourceType AWS_WAFREGIONAL_WEB_ACL = fromString("AWS::WAFRegional::WebACL"); + + /** + * Static value AWS::WAFv2::IPSet for ResourceType. + */ + public static final ResourceType AWS_WAFV2_IPSET = fromString("AWS::WAFv2::IPSet"); + + /** + * Static value AWS::WAFv2::ManagedRuleSet for ResourceType. + */ + public static final ResourceType AWS_WAFV2_MANAGED_RULE_SET = fromString("AWS::WAFv2::ManagedRuleSet"); + + /** + * Static value AWS::WAFv2::RegexPatternSet for ResourceType. + */ + public static final ResourceType AWS_WAFV2_REGEX_PATTERN_SET = fromString("AWS::WAFv2::RegexPatternSet"); + + /** + * Static value AWS::WAFv2::RuleGroup for ResourceType. + */ + public static final ResourceType AWS_WAFV2_RULE_GROUP = fromString("AWS::WAFv2::RuleGroup"); + + /** + * Static value AWS::WAFv2::WebACL for ResourceType. + */ + public static final ResourceType AWS_WAFV2_WEB_ACL = fromString("AWS::WAFv2::WebACL"); + + /** + * Static value AWS::WorkSpaces::ConnectionAlias for ResourceType. + */ + public static final ResourceType AWS_WORK_SPACES_CONNECTION_ALIAS = fromString("AWS::WorkSpaces::ConnectionAlias"); + + /** + * Static value AWS::WorkSpaces::Workspace for ResourceType. + */ + public static final ResourceType AWS_WORK_SPACES_WORKSPACE = fromString("AWS::WorkSpaces::Workspace"); + + /** + * Static value AWS::XRay::EncryptionConfig for ResourceType. + */ + public static final ResourceType AWS_XRAY_ENCRYPTION_CONFIG = fromString("AWS::XRay::EncryptionConfig"); + + /** + * Creates a new instance of ResourceType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ResourceType() { + } + + /** + * Creates or finds a ResourceType from its string representation. + * + * @param name a name to look for. + * @return the corresponding ResourceType. + */ + public static ResourceType fromString(String name) { + return fromString(name, ResourceType.class); + } + + /** + * Gets known ResourceType values. + * + * @return known ResourceType values. + */ + public static Collection values() { + return values(ResourceType.class); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ResourceTypeEnumValue.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ResourceTypeEnumValue.java new file mode 100644 index 000000000000..9fcab7d66c82 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ResourceTypeEnumValue.java @@ -0,0 +1,93 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of ResourceTypeEnumValue. + */ +@Fluent +public final class ResourceTypeEnumValue implements JsonSerializable { + /* + * Property value + */ + private ResourceType value; + + /** + * Creates an instance of ResourceTypeEnumValue class. + */ + public ResourceTypeEnumValue() { + } + + /** + * Get the value property: Property value. + * + * @return the value value. + */ + public ResourceType value() { + return this.value; + } + + /** + * Set the value property: Property value. + * + * @param value the value value to set. + * @return the ResourceTypeEnumValue object itself. + */ + public ResourceTypeEnumValue withValue(ResourceType value) { + this.value = value; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("value", this.value == null ? null : this.value.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ResourceTypeEnumValue from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ResourceTypeEnumValue if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the ResourceTypeEnumValue. + */ + public static ResourceTypeEnumValue fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ResourceTypeEnumValue deserializedResourceTypeEnumValue = new ResourceTypeEnumValue(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + deserializedResourceTypeEnumValue.value = ResourceType.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedResourceTypeEnumValue; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/Restrictions.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/Restrictions.java new file mode 100644 index 000000000000..fb5b8999aca0 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/Restrictions.java @@ -0,0 +1,120 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of Restrictions. + */ +@Fluent +public final class Restrictions implements JsonSerializable { + /* + * A complex type that controls the countries in which your content is distributed. CF determines the location of + * your users using ``MaxMind`` GeoIP databases. To disable geo restriction, remove the + * [Restrictions](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudfront- + * distribution-distributionconfig.html#cfn-cloudfront-distribution-distributionconfig-restrictions) property from + * your stack template. A complex type that controls the countries in which your content is distributed. CF + * determines the location of your users using ``MaxMind`` GeoIP databases. To disable geo restriction, remove the + * [Restrictions](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudfront- + * distribution-distributionconfig.html#cfn-cloudfront-distribution-distributionconfig-restrictions) property from + * your stack template. + */ + private GeoRestriction geoRestriction; + + /** + * Creates an instance of Restrictions class. + */ + public Restrictions() { + } + + /** + * Get the geoRestriction property: A complex type that controls the countries in which your content is distributed. + * CF determines the location of your users using ``MaxMind`` GeoIP databases. To disable geo restriction, remove + * the + * [Restrictions](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudfront-distribution-distributionconfig.html#cfn-cloudfront-distribution-distributionconfig-restrictions) + * property from your stack template. A complex type that controls the countries in which your content is + * distributed. CF determines the location of your users using ``MaxMind`` GeoIP databases. To disable geo + * restriction, remove the + * [Restrictions](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudfront-distribution-distributionconfig.html#cfn-cloudfront-distribution-distributionconfig-restrictions) + * property from your stack template. + * + * @return the geoRestriction value. + */ + public GeoRestriction geoRestriction() { + return this.geoRestriction; + } + + /** + * Set the geoRestriction property: A complex type that controls the countries in which your content is distributed. + * CF determines the location of your users using ``MaxMind`` GeoIP databases. To disable geo restriction, remove + * the + * [Restrictions](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudfront-distribution-distributionconfig.html#cfn-cloudfront-distribution-distributionconfig-restrictions) + * property from your stack template. A complex type that controls the countries in which your content is + * distributed. CF determines the location of your users using ``MaxMind`` GeoIP databases. To disable geo + * restriction, remove the + * [Restrictions](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudfront-distribution-distributionconfig.html#cfn-cloudfront-distribution-distributionconfig-restrictions) + * property from your stack template. + * + * @param geoRestriction the geoRestriction value to set. + * @return the Restrictions object itself. + */ + public Restrictions withGeoRestriction(GeoRestriction geoRestriction) { + this.geoRestriction = geoRestriction; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (geoRestriction() != null) { + geoRestriction().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("geoRestriction", this.geoRestriction); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of Restrictions from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of Restrictions if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the Restrictions. + */ + public static Restrictions fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + Restrictions deserializedRestrictions = new Restrictions(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("geoRestriction".equals(fieldName)) { + deserializedRestrictions.geoRestriction = GeoRestriction.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedRestrictions; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/Route53DomainsDomainSummaries.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/Route53DomainsDomainSummaries.java new file mode 100644 index 000000000000..e40b3c814c76 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/Route53DomainsDomainSummaries.java @@ -0,0 +1,162 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** + * Resource collection API of Route53DomainsDomainSummaries. + */ +public interface Route53DomainsDomainSummaries { + /** + * List Route53DomainsDomainSummary resources by subscription ID. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Route53DomainsDomainSummary list operation as paginated response with + * {@link PagedIterable}. + */ + PagedIterable list(); + + /** + * List Route53DomainsDomainSummary resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Route53DomainsDomainSummary list operation as paginated response with + * {@link PagedIterable}. + */ + PagedIterable list(Context context); + + /** + * List Route53DomainsDomainSummary resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Route53DomainsDomainSummary list operation as paginated response with + * {@link PagedIterable}. + */ + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * List Route53DomainsDomainSummary resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Route53DomainsDomainSummary list operation as paginated response with + * {@link PagedIterable}. + */ + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Get a Route53DomainsDomainSummary. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Route53DomainsDomainSummary. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Route53DomainsDomainSummary along with {@link Response}. + */ + Response getByResourceGroupWithResponse(String resourceGroupName, String name, + Context context); + + /** + * Get a Route53DomainsDomainSummary. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Route53DomainsDomainSummary. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Route53DomainsDomainSummary. + */ + Route53DomainsDomainSummary getByResourceGroup(String resourceGroupName, String name); + + /** + * Delete a Route53DomainsDomainSummary. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Route53DomainsDomainSummary. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByResourceGroup(String resourceGroupName, String name); + + /** + * Delete a Route53DomainsDomainSummary. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Route53DomainsDomainSummary. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String name, Context context); + + /** + * Get a Route53DomainsDomainSummary. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Route53DomainsDomainSummary along with {@link Response}. + */ + Route53DomainsDomainSummary getById(String id); + + /** + * Get a Route53DomainsDomainSummary. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Route53DomainsDomainSummary along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Delete a Route53DomainsDomainSummary. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteById(String id); + + /** + * Delete a Route53DomainsDomainSummary. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new Route53DomainsDomainSummary resource. + * + * @param name resource name. + * @return the first stage of the new Route53DomainsDomainSummary definition. + */ + Route53DomainsDomainSummary.DefinitionStages.Blank define(String name); +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/Route53DomainsDomainSummary.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/Route53DomainsDomainSummary.java new file mode 100644 index 000000000000..314800ecda7f --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/Route53DomainsDomainSummary.java @@ -0,0 +1,252 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.awsconnector.fluent.models.Route53DomainsDomainSummaryInner; +import java.util.Map; + +/** + * An immutable client-side representation of Route53DomainsDomainSummary. + */ +public interface Route53DomainsDomainSummary { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the location property: The geo-location where the resource lives. + * + * @return the location value. + */ + String location(); + + /** + * Gets the tags property: Resource tags. + * + * @return the tags value. + */ + Map tags(); + + /** + * Gets the properties property: The resource-specific properties for this resource. + * + * @return the properties value. + */ + Route53DomainsDomainSummaryProperties properties(); + + /** + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the region of the resource. + * + * @return the region of the resource. + */ + Region region(); + + /** + * Gets the name of the resource region. + * + * @return the name of the resource region. + */ + String regionName(); + + /** + * Gets the name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + + /** + * Gets the inner com.azure.resourcemanager.awsconnector.fluent.models.Route53DomainsDomainSummaryInner object. + * + * @return the inner object. + */ + Route53DomainsDomainSummaryInner innerModel(); + + /** + * The entirety of the Route53DomainsDomainSummary definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithLocation, + DefinitionStages.WithResourceGroup, DefinitionStages.WithCreate { + } + + /** + * The Route53DomainsDomainSummary definition stages. + */ + interface DefinitionStages { + /** + * The first stage of the Route53DomainsDomainSummary definition. + */ + interface Blank extends WithLocation { + } + + /** + * The stage of the Route53DomainsDomainSummary definition allowing to specify location. + */ + interface WithLocation { + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithResourceGroup withRegion(Region location); + + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithResourceGroup withRegion(String location); + } + + /** + * The stage of the Route53DomainsDomainSummary definition allowing to specify parent resource. + */ + interface WithResourceGroup { + /** + * Specifies resourceGroupName. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @return the next definition stage. + */ + WithCreate withExistingResourceGroup(String resourceGroupName); + } + + /** + * The stage of the Route53DomainsDomainSummary 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.WithProperties { + /** + * Executes the create request. + * + * @return the created resource. + */ + Route53DomainsDomainSummary create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + Route53DomainsDomainSummary create(Context context); + } + + /** + * The stage of the Route53DomainsDomainSummary definition allowing to specify tags. + */ + interface WithTags { + /** + * Specifies the tags property: Resource tags.. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + WithCreate withTags(Map tags); + } + + /** + * The stage of the Route53DomainsDomainSummary definition allowing to specify properties. + */ + interface WithProperties { + /** + * Specifies the properties property: The resource-specific properties for this resource.. + * + * @param properties The resource-specific properties for this resource. + * @return the next definition stage. + */ + WithCreate withProperties(Route53DomainsDomainSummaryProperties properties); + } + } + + /** + * Begins update for the Route53DomainsDomainSummary resource. + * + * @return the stage of resource update. + */ + Route53DomainsDomainSummary.Update update(); + + /** + * The template for Route53DomainsDomainSummary update. + */ + interface Update extends UpdateStages.WithTags { + /** + * Executes the update request. + * + * @return the updated resource. + */ + Route53DomainsDomainSummary apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + Route53DomainsDomainSummary apply(Context context); + } + + /** + * The Route53DomainsDomainSummary update stages. + */ + interface UpdateStages { + /** + * The stage of the Route53DomainsDomainSummary update allowing to specify tags. + */ + interface WithTags { + /** + * Specifies the tags property: Resource tags.. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + Update withTags(Map tags); + } + } + + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + Route53DomainsDomainSummary refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + Route53DomainsDomainSummary refresh(Context context); +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/Route53DomainsDomainSummaryListResult.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/Route53DomainsDomainSummaryListResult.java new file mode 100644 index 000000000000..aa36329f5bf5 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/Route53DomainsDomainSummaryListResult.java @@ -0,0 +1,138 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.awsconnector.fluent.models.Route53DomainsDomainSummaryInner; +import java.io.IOException; +import java.util.List; + +/** + * The response of a Route53DomainsDomainSummary list operation. + */ +@Fluent +public final class Route53DomainsDomainSummaryListResult + implements JsonSerializable { + /* + * The Route53DomainsDomainSummary items on this page + */ + private List value; + + /* + * The link to the next page of items + */ + private String nextLink; + + /** + * Creates an instance of Route53DomainsDomainSummaryListResult class. + */ + public Route53DomainsDomainSummaryListResult() { + } + + /** + * Get the value property: The Route53DomainsDomainSummary items on this page. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The Route53DomainsDomainSummary items on this page. + * + * @param value the value value to set. + * @return the Route53DomainsDomainSummaryListResult object itself. + */ + public Route53DomainsDomainSummaryListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The link to the next page of items. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: The link to the next page of items. + * + * @param nextLink the nextLink value to set. + * @return the Route53DomainsDomainSummaryListResult object itself. + */ + public Route53DomainsDomainSummaryListResult withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property value in model Route53DomainsDomainSummaryListResult")); + } else { + value().forEach(e -> e.validate()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(Route53DomainsDomainSummaryListResult.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("nextLink", this.nextLink); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of Route53DomainsDomainSummaryListResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of Route53DomainsDomainSummaryListResult if the JsonReader was pointing to an instance of it, + * or null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the Route53DomainsDomainSummaryListResult. + */ + public static Route53DomainsDomainSummaryListResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + Route53DomainsDomainSummaryListResult deserializedRoute53DomainsDomainSummaryListResult + = new Route53DomainsDomainSummaryListResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> Route53DomainsDomainSummaryInner.fromJson(reader1)); + deserializedRoute53DomainsDomainSummaryListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedRoute53DomainsDomainSummaryListResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedRoute53DomainsDomainSummaryListResult; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/Route53DomainsDomainSummaryProperties.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/Route53DomainsDomainSummaryProperties.java new file mode 100644 index 000000000000..2e37b17074ec --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/Route53DomainsDomainSummaryProperties.java @@ -0,0 +1,317 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.Map; + +/** + * Definition of Route53DomainsDomainSummary. + */ +@Fluent +public final class Route53DomainsDomainSummaryProperties + implements JsonSerializable { + /* + * AWS Properties + */ + private AwsRoute53DomainsDomainSummaryProperties awsProperties; + + /* + * Public Cloud Connectors Resource ID + */ + private String publicCloudConnectorsResourceId; + + /* + * AWS Account ID + */ + private String awsAccountId; + + /* + * Amazon Resource Name (ARN) + */ + private String arn; + + /* + * Public Cloud Resource Name + */ + private String publicCloudResourceName; + + /* + * AWS Source Schema + */ + private String awsSourceSchema; + + /* + * AWS Region + */ + private String awsRegion; + + /* + * AWS Tags + */ + private Map awsTags; + + /* + * The status of the last operation. + */ + private ProvisioningState provisioningState; + + /** + * Creates an instance of Route53DomainsDomainSummaryProperties class. + */ + public Route53DomainsDomainSummaryProperties() { + } + + /** + * Get the awsProperties property: AWS Properties. + * + * @return the awsProperties value. + */ + public AwsRoute53DomainsDomainSummaryProperties awsProperties() { + return this.awsProperties; + } + + /** + * Set the awsProperties property: AWS Properties. + * + * @param awsProperties the awsProperties value to set. + * @return the Route53DomainsDomainSummaryProperties object itself. + */ + public Route53DomainsDomainSummaryProperties + withAwsProperties(AwsRoute53DomainsDomainSummaryProperties awsProperties) { + this.awsProperties = awsProperties; + return this; + } + + /** + * Get the publicCloudConnectorsResourceId property: Public Cloud Connectors Resource ID. + * + * @return the publicCloudConnectorsResourceId value. + */ + public String publicCloudConnectorsResourceId() { + return this.publicCloudConnectorsResourceId; + } + + /** + * Set the publicCloudConnectorsResourceId property: Public Cloud Connectors Resource ID. + * + * @param publicCloudConnectorsResourceId the publicCloudConnectorsResourceId value to set. + * @return the Route53DomainsDomainSummaryProperties object itself. + */ + public Route53DomainsDomainSummaryProperties + withPublicCloudConnectorsResourceId(String publicCloudConnectorsResourceId) { + this.publicCloudConnectorsResourceId = publicCloudConnectorsResourceId; + return this; + } + + /** + * Get the awsAccountId property: AWS Account ID. + * + * @return the awsAccountId value. + */ + public String awsAccountId() { + return this.awsAccountId; + } + + /** + * Set the awsAccountId property: AWS Account ID. + * + * @param awsAccountId the awsAccountId value to set. + * @return the Route53DomainsDomainSummaryProperties object itself. + */ + public Route53DomainsDomainSummaryProperties withAwsAccountId(String awsAccountId) { + this.awsAccountId = awsAccountId; + return this; + } + + /** + * Get the arn property: Amazon Resource Name (ARN). + * + * @return the arn value. + */ + public String arn() { + return this.arn; + } + + /** + * Set the arn property: Amazon Resource Name (ARN). + * + * @param arn the arn value to set. + * @return the Route53DomainsDomainSummaryProperties object itself. + */ + public Route53DomainsDomainSummaryProperties withArn(String arn) { + this.arn = arn; + return this; + } + + /** + * Get the publicCloudResourceName property: Public Cloud Resource Name. + * + * @return the publicCloudResourceName value. + */ + public String publicCloudResourceName() { + return this.publicCloudResourceName; + } + + /** + * Set the publicCloudResourceName property: Public Cloud Resource Name. + * + * @param publicCloudResourceName the publicCloudResourceName value to set. + * @return the Route53DomainsDomainSummaryProperties object itself. + */ + public Route53DomainsDomainSummaryProperties withPublicCloudResourceName(String publicCloudResourceName) { + this.publicCloudResourceName = publicCloudResourceName; + return this; + } + + /** + * Get the awsSourceSchema property: AWS Source Schema. + * + * @return the awsSourceSchema value. + */ + public String awsSourceSchema() { + return this.awsSourceSchema; + } + + /** + * Set the awsSourceSchema property: AWS Source Schema. + * + * @param awsSourceSchema the awsSourceSchema value to set. + * @return the Route53DomainsDomainSummaryProperties object itself. + */ + public Route53DomainsDomainSummaryProperties withAwsSourceSchema(String awsSourceSchema) { + this.awsSourceSchema = awsSourceSchema; + return this; + } + + /** + * Get the awsRegion property: AWS Region. + * + * @return the awsRegion value. + */ + public String awsRegion() { + return this.awsRegion; + } + + /** + * Set the awsRegion property: AWS Region. + * + * @param awsRegion the awsRegion value to set. + * @return the Route53DomainsDomainSummaryProperties object itself. + */ + public Route53DomainsDomainSummaryProperties withAwsRegion(String awsRegion) { + this.awsRegion = awsRegion; + return this; + } + + /** + * Get the awsTags property: AWS Tags. + * + * @return the awsTags value. + */ + public Map awsTags() { + return this.awsTags; + } + + /** + * Set the awsTags property: AWS Tags. + * + * @param awsTags the awsTags value to set. + * @return the Route53DomainsDomainSummaryProperties object itself. + */ + public Route53DomainsDomainSummaryProperties withAwsTags(Map awsTags) { + this.awsTags = awsTags; + return this; + } + + /** + * Get the provisioningState property: The status of the last operation. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (awsProperties() != null) { + awsProperties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("awsProperties", this.awsProperties); + jsonWriter.writeStringField("publicCloudConnectorsResourceId", this.publicCloudConnectorsResourceId); + jsonWriter.writeStringField("awsAccountId", this.awsAccountId); + jsonWriter.writeStringField("arn", this.arn); + jsonWriter.writeStringField("publicCloudResourceName", this.publicCloudResourceName); + jsonWriter.writeStringField("awsSourceSchema", this.awsSourceSchema); + jsonWriter.writeStringField("awsRegion", this.awsRegion); + jsonWriter.writeMapField("awsTags", this.awsTags, (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of Route53DomainsDomainSummaryProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of Route53DomainsDomainSummaryProperties if the JsonReader was pointing to an instance of it, + * or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the Route53DomainsDomainSummaryProperties. + */ + public static Route53DomainsDomainSummaryProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + Route53DomainsDomainSummaryProperties deserializedRoute53DomainsDomainSummaryProperties + = new Route53DomainsDomainSummaryProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("awsProperties".equals(fieldName)) { + deserializedRoute53DomainsDomainSummaryProperties.awsProperties + = AwsRoute53DomainsDomainSummaryProperties.fromJson(reader); + } else if ("publicCloudConnectorsResourceId".equals(fieldName)) { + deserializedRoute53DomainsDomainSummaryProperties.publicCloudConnectorsResourceId + = reader.getString(); + } else if ("awsAccountId".equals(fieldName)) { + deserializedRoute53DomainsDomainSummaryProperties.awsAccountId = reader.getString(); + } else if ("arn".equals(fieldName)) { + deserializedRoute53DomainsDomainSummaryProperties.arn = reader.getString(); + } else if ("publicCloudResourceName".equals(fieldName)) { + deserializedRoute53DomainsDomainSummaryProperties.publicCloudResourceName = reader.getString(); + } else if ("awsSourceSchema".equals(fieldName)) { + deserializedRoute53DomainsDomainSummaryProperties.awsSourceSchema = reader.getString(); + } else if ("awsRegion".equals(fieldName)) { + deserializedRoute53DomainsDomainSummaryProperties.awsRegion = reader.getString(); + } else if ("awsTags".equals(fieldName)) { + Map awsTags = reader.readMap(reader1 -> reader1.getString()); + deserializedRoute53DomainsDomainSummaryProperties.awsTags = awsTags; + } else if ("provisioningState".equals(fieldName)) { + deserializedRoute53DomainsDomainSummaryProperties.provisioningState + = ProvisioningState.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedRoute53DomainsDomainSummaryProperties; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/Route53DomainsDomainSummaryTagsUpdate.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/Route53DomainsDomainSummaryTagsUpdate.java new file mode 100644 index 000000000000..c3b100cdfec1 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/Route53DomainsDomainSummaryTagsUpdate.java @@ -0,0 +1,97 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.Map; + +/** + * The type used for updating tags in Route53DomainsDomainSummary resources. + */ +@Fluent +public final class Route53DomainsDomainSummaryTagsUpdate + implements JsonSerializable { + /* + * Resource tags. + */ + private Map tags; + + /** + * Creates an instance of Route53DomainsDomainSummaryTagsUpdate class. + */ + public Route53DomainsDomainSummaryTagsUpdate() { + } + + /** + * Get the tags property: Resource tags. + * + * @return the tags value. + */ + public Map tags() { + return this.tags; + } + + /** + * Set the tags property: Resource tags. + * + * @param tags the tags value to set. + * @return the Route53DomainsDomainSummaryTagsUpdate object itself. + */ + public Route53DomainsDomainSummaryTagsUpdate withTags(Map tags) { + this.tags = tags; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeMapField("tags", this.tags, (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of Route53DomainsDomainSummaryTagsUpdate from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of Route53DomainsDomainSummaryTagsUpdate if the JsonReader was pointing to an instance of it, + * or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the Route53DomainsDomainSummaryTagsUpdate. + */ + public static Route53DomainsDomainSummaryTagsUpdate fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + Route53DomainsDomainSummaryTagsUpdate deserializedRoute53DomainsDomainSummaryTagsUpdate + = new Route53DomainsDomainSummaryTagsUpdate(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedRoute53DomainsDomainSummaryTagsUpdate.tags = tags; + } else { + reader.skipChildren(); + } + } + + return deserializedRoute53DomainsDomainSummaryTagsUpdate; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/Route53HostedZone.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/Route53HostedZone.java new file mode 100644 index 000000000000..0d63ef58dc67 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/Route53HostedZone.java @@ -0,0 +1,252 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.awsconnector.fluent.models.Route53HostedZoneInner; +import java.util.Map; + +/** + * An immutable client-side representation of Route53HostedZone. + */ +public interface Route53HostedZone { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the location property: The geo-location where the resource lives. + * + * @return the location value. + */ + String location(); + + /** + * Gets the tags property: Resource tags. + * + * @return the tags value. + */ + Map tags(); + + /** + * Gets the properties property: The resource-specific properties for this resource. + * + * @return the properties value. + */ + Route53HostedZoneProperties properties(); + + /** + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the region of the resource. + * + * @return the region of the resource. + */ + Region region(); + + /** + * Gets the name of the resource region. + * + * @return the name of the resource region. + */ + String regionName(); + + /** + * Gets the name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + + /** + * Gets the inner com.azure.resourcemanager.awsconnector.fluent.models.Route53HostedZoneInner object. + * + * @return the inner object. + */ + Route53HostedZoneInner innerModel(); + + /** + * The entirety of the Route53HostedZone definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithLocation, + DefinitionStages.WithResourceGroup, DefinitionStages.WithCreate { + } + + /** + * The Route53HostedZone definition stages. + */ + interface DefinitionStages { + /** + * The first stage of the Route53HostedZone definition. + */ + interface Blank extends WithLocation { + } + + /** + * The stage of the Route53HostedZone definition allowing to specify location. + */ + interface WithLocation { + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithResourceGroup withRegion(Region location); + + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithResourceGroup withRegion(String location); + } + + /** + * The stage of the Route53HostedZone definition allowing to specify parent resource. + */ + interface WithResourceGroup { + /** + * Specifies resourceGroupName. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @return the next definition stage. + */ + WithCreate withExistingResourceGroup(String resourceGroupName); + } + + /** + * The stage of the Route53HostedZone 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.WithProperties { + /** + * Executes the create request. + * + * @return the created resource. + */ + Route53HostedZone create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + Route53HostedZone create(Context context); + } + + /** + * The stage of the Route53HostedZone definition allowing to specify tags. + */ + interface WithTags { + /** + * Specifies the tags property: Resource tags.. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + WithCreate withTags(Map tags); + } + + /** + * The stage of the Route53HostedZone definition allowing to specify properties. + */ + interface WithProperties { + /** + * Specifies the properties property: The resource-specific properties for this resource.. + * + * @param properties The resource-specific properties for this resource. + * @return the next definition stage. + */ + WithCreate withProperties(Route53HostedZoneProperties properties); + } + } + + /** + * Begins update for the Route53HostedZone resource. + * + * @return the stage of resource update. + */ + Route53HostedZone.Update update(); + + /** + * The template for Route53HostedZone update. + */ + interface Update extends UpdateStages.WithTags { + /** + * Executes the update request. + * + * @return the updated resource. + */ + Route53HostedZone apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + Route53HostedZone apply(Context context); + } + + /** + * The Route53HostedZone update stages. + */ + interface UpdateStages { + /** + * The stage of the Route53HostedZone update allowing to specify tags. + */ + interface WithTags { + /** + * Specifies the tags property: Resource tags.. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + Update withTags(Map tags); + } + } + + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + Route53HostedZone refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + Route53HostedZone refresh(Context context); +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/Route53HostedZoneListResult.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/Route53HostedZoneListResult.java new file mode 100644 index 000000000000..9ffd6ab1be41 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/Route53HostedZoneListResult.java @@ -0,0 +1,136 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.awsconnector.fluent.models.Route53HostedZoneInner; +import java.io.IOException; +import java.util.List; + +/** + * The response of a Route53HostedZone list operation. + */ +@Fluent +public final class Route53HostedZoneListResult implements JsonSerializable { + /* + * The Route53HostedZone items on this page + */ + private List value; + + /* + * The link to the next page of items + */ + private String nextLink; + + /** + * Creates an instance of Route53HostedZoneListResult class. + */ + public Route53HostedZoneListResult() { + } + + /** + * Get the value property: The Route53HostedZone items on this page. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The Route53HostedZone items on this page. + * + * @param value the value value to set. + * @return the Route53HostedZoneListResult object itself. + */ + public Route53HostedZoneListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The link to the next page of items. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: The link to the next page of items. + * + * @param nextLink the nextLink value to set. + * @return the Route53HostedZoneListResult object itself. + */ + public Route53HostedZoneListResult withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property value in model Route53HostedZoneListResult")); + } else { + value().forEach(e -> e.validate()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(Route53HostedZoneListResult.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("nextLink", this.nextLink); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of Route53HostedZoneListResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of Route53HostedZoneListResult if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the Route53HostedZoneListResult. + */ + public static Route53HostedZoneListResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + Route53HostedZoneListResult deserializedRoute53HostedZoneListResult = new Route53HostedZoneListResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> Route53HostedZoneInner.fromJson(reader1)); + deserializedRoute53HostedZoneListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedRoute53HostedZoneListResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedRoute53HostedZoneListResult; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/Route53HostedZoneProperties.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/Route53HostedZoneProperties.java new file mode 100644 index 000000000000..14d25060d007 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/Route53HostedZoneProperties.java @@ -0,0 +1,312 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.Map; + +/** + * Definition of Route53HostedZone. + */ +@Fluent +public final class Route53HostedZoneProperties implements JsonSerializable { + /* + * AWS Properties + */ + private AwsRoute53HostedZoneProperties awsProperties; + + /* + * Public Cloud Connectors Resource ID + */ + private String publicCloudConnectorsResourceId; + + /* + * AWS Account ID + */ + private String awsAccountId; + + /* + * Amazon Resource Name (ARN) + */ + private String arn; + + /* + * Public Cloud Resource Name + */ + private String publicCloudResourceName; + + /* + * AWS Source Schema + */ + private String awsSourceSchema; + + /* + * AWS Region + */ + private String awsRegion; + + /* + * AWS Tags + */ + private Map awsTags; + + /* + * The status of the last operation. + */ + private ProvisioningState provisioningState; + + /** + * Creates an instance of Route53HostedZoneProperties class. + */ + public Route53HostedZoneProperties() { + } + + /** + * Get the awsProperties property: AWS Properties. + * + * @return the awsProperties value. + */ + public AwsRoute53HostedZoneProperties awsProperties() { + return this.awsProperties; + } + + /** + * Set the awsProperties property: AWS Properties. + * + * @param awsProperties the awsProperties value to set. + * @return the Route53HostedZoneProperties object itself. + */ + public Route53HostedZoneProperties withAwsProperties(AwsRoute53HostedZoneProperties awsProperties) { + this.awsProperties = awsProperties; + return this; + } + + /** + * Get the publicCloudConnectorsResourceId property: Public Cloud Connectors Resource ID. + * + * @return the publicCloudConnectorsResourceId value. + */ + public String publicCloudConnectorsResourceId() { + return this.publicCloudConnectorsResourceId; + } + + /** + * Set the publicCloudConnectorsResourceId property: Public Cloud Connectors Resource ID. + * + * @param publicCloudConnectorsResourceId the publicCloudConnectorsResourceId value to set. + * @return the Route53HostedZoneProperties object itself. + */ + public Route53HostedZoneProperties withPublicCloudConnectorsResourceId(String publicCloudConnectorsResourceId) { + this.publicCloudConnectorsResourceId = publicCloudConnectorsResourceId; + return this; + } + + /** + * Get the awsAccountId property: AWS Account ID. + * + * @return the awsAccountId value. + */ + public String awsAccountId() { + return this.awsAccountId; + } + + /** + * Set the awsAccountId property: AWS Account ID. + * + * @param awsAccountId the awsAccountId value to set. + * @return the Route53HostedZoneProperties object itself. + */ + public Route53HostedZoneProperties withAwsAccountId(String awsAccountId) { + this.awsAccountId = awsAccountId; + return this; + } + + /** + * Get the arn property: Amazon Resource Name (ARN). + * + * @return the arn value. + */ + public String arn() { + return this.arn; + } + + /** + * Set the arn property: Amazon Resource Name (ARN). + * + * @param arn the arn value to set. + * @return the Route53HostedZoneProperties object itself. + */ + public Route53HostedZoneProperties withArn(String arn) { + this.arn = arn; + return this; + } + + /** + * Get the publicCloudResourceName property: Public Cloud Resource Name. + * + * @return the publicCloudResourceName value. + */ + public String publicCloudResourceName() { + return this.publicCloudResourceName; + } + + /** + * Set the publicCloudResourceName property: Public Cloud Resource Name. + * + * @param publicCloudResourceName the publicCloudResourceName value to set. + * @return the Route53HostedZoneProperties object itself. + */ + public Route53HostedZoneProperties withPublicCloudResourceName(String publicCloudResourceName) { + this.publicCloudResourceName = publicCloudResourceName; + return this; + } + + /** + * Get the awsSourceSchema property: AWS Source Schema. + * + * @return the awsSourceSchema value. + */ + public String awsSourceSchema() { + return this.awsSourceSchema; + } + + /** + * Set the awsSourceSchema property: AWS Source Schema. + * + * @param awsSourceSchema the awsSourceSchema value to set. + * @return the Route53HostedZoneProperties object itself. + */ + public Route53HostedZoneProperties withAwsSourceSchema(String awsSourceSchema) { + this.awsSourceSchema = awsSourceSchema; + return this; + } + + /** + * Get the awsRegion property: AWS Region. + * + * @return the awsRegion value. + */ + public String awsRegion() { + return this.awsRegion; + } + + /** + * Set the awsRegion property: AWS Region. + * + * @param awsRegion the awsRegion value to set. + * @return the Route53HostedZoneProperties object itself. + */ + public Route53HostedZoneProperties withAwsRegion(String awsRegion) { + this.awsRegion = awsRegion; + return this; + } + + /** + * Get the awsTags property: AWS Tags. + * + * @return the awsTags value. + */ + public Map awsTags() { + return this.awsTags; + } + + /** + * Set the awsTags property: AWS Tags. + * + * @param awsTags the awsTags value to set. + * @return the Route53HostedZoneProperties object itself. + */ + public Route53HostedZoneProperties withAwsTags(Map awsTags) { + this.awsTags = awsTags; + return this; + } + + /** + * Get the provisioningState property: The status of the last operation. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (awsProperties() != null) { + awsProperties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("awsProperties", this.awsProperties); + jsonWriter.writeStringField("publicCloudConnectorsResourceId", this.publicCloudConnectorsResourceId); + jsonWriter.writeStringField("awsAccountId", this.awsAccountId); + jsonWriter.writeStringField("arn", this.arn); + jsonWriter.writeStringField("publicCloudResourceName", this.publicCloudResourceName); + jsonWriter.writeStringField("awsSourceSchema", this.awsSourceSchema); + jsonWriter.writeStringField("awsRegion", this.awsRegion); + jsonWriter.writeMapField("awsTags", this.awsTags, (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of Route53HostedZoneProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of Route53HostedZoneProperties if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the Route53HostedZoneProperties. + */ + public static Route53HostedZoneProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + Route53HostedZoneProperties deserializedRoute53HostedZoneProperties = new Route53HostedZoneProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("awsProperties".equals(fieldName)) { + deserializedRoute53HostedZoneProperties.awsProperties + = AwsRoute53HostedZoneProperties.fromJson(reader); + } else if ("publicCloudConnectorsResourceId".equals(fieldName)) { + deserializedRoute53HostedZoneProperties.publicCloudConnectorsResourceId = reader.getString(); + } else if ("awsAccountId".equals(fieldName)) { + deserializedRoute53HostedZoneProperties.awsAccountId = reader.getString(); + } else if ("arn".equals(fieldName)) { + deserializedRoute53HostedZoneProperties.arn = reader.getString(); + } else if ("publicCloudResourceName".equals(fieldName)) { + deserializedRoute53HostedZoneProperties.publicCloudResourceName = reader.getString(); + } else if ("awsSourceSchema".equals(fieldName)) { + deserializedRoute53HostedZoneProperties.awsSourceSchema = reader.getString(); + } else if ("awsRegion".equals(fieldName)) { + deserializedRoute53HostedZoneProperties.awsRegion = reader.getString(); + } else if ("awsTags".equals(fieldName)) { + Map awsTags = reader.readMap(reader1 -> reader1.getString()); + deserializedRoute53HostedZoneProperties.awsTags = awsTags; + } else if ("provisioningState".equals(fieldName)) { + deserializedRoute53HostedZoneProperties.provisioningState + = ProvisioningState.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedRoute53HostedZoneProperties; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/Route53HostedZoneTagsUpdate.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/Route53HostedZoneTagsUpdate.java new file mode 100644 index 000000000000..1ce61963ccf2 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/Route53HostedZoneTagsUpdate.java @@ -0,0 +1,95 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.Map; + +/** + * The type used for updating tags in Route53HostedZone resources. + */ +@Fluent +public final class Route53HostedZoneTagsUpdate implements JsonSerializable { + /* + * Resource tags. + */ + private Map tags; + + /** + * Creates an instance of Route53HostedZoneTagsUpdate class. + */ + public Route53HostedZoneTagsUpdate() { + } + + /** + * Get the tags property: Resource tags. + * + * @return the tags value. + */ + public Map tags() { + return this.tags; + } + + /** + * Set the tags property: Resource tags. + * + * @param tags the tags value to set. + * @return the Route53HostedZoneTagsUpdate object itself. + */ + public Route53HostedZoneTagsUpdate withTags(Map tags) { + this.tags = tags; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeMapField("tags", this.tags, (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of Route53HostedZoneTagsUpdate from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of Route53HostedZoneTagsUpdate if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the Route53HostedZoneTagsUpdate. + */ + public static Route53HostedZoneTagsUpdate fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + Route53HostedZoneTagsUpdate deserializedRoute53HostedZoneTagsUpdate = new Route53HostedZoneTagsUpdate(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedRoute53HostedZoneTagsUpdate.tags = tags; + } else { + reader.skipChildren(); + } + } + + return deserializedRoute53HostedZoneTagsUpdate; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/Route53HostedZones.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/Route53HostedZones.java new file mode 100644 index 000000000000..117709a23b20 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/Route53HostedZones.java @@ -0,0 +1,157 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** + * Resource collection API of Route53HostedZones. + */ +public interface Route53HostedZones { + /** + * List Route53HostedZone resources by subscription ID. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Route53HostedZone list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable list(); + + /** + * List Route53HostedZone resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Route53HostedZone list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable list(Context context); + + /** + * List Route53HostedZone resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Route53HostedZone list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * List Route53HostedZone resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Route53HostedZone list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Get a Route53HostedZone. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Route53HostedZone. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Route53HostedZone along with {@link Response}. + */ + Response getByResourceGroupWithResponse(String resourceGroupName, String name, Context context); + + /** + * Get a Route53HostedZone. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Route53HostedZone. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Route53HostedZone. + */ + Route53HostedZone getByResourceGroup(String resourceGroupName, String name); + + /** + * Delete a Route53HostedZone. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Route53HostedZone. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByResourceGroup(String resourceGroupName, String name); + + /** + * Delete a Route53HostedZone. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Route53HostedZone. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String name, Context context); + + /** + * Get a Route53HostedZone. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Route53HostedZone along with {@link Response}. + */ + Route53HostedZone getById(String id); + + /** + * Get a Route53HostedZone. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Route53HostedZone along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Delete a Route53HostedZone. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteById(String id); + + /** + * Delete a Route53HostedZone. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new Route53HostedZone resource. + * + * @param name resource name. + * @return the first stage of the new Route53HostedZone definition. + */ + Route53HostedZone.DefinitionStages.Blank define(String name); +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/Route53ResourceRecordSet.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/Route53ResourceRecordSet.java new file mode 100644 index 000000000000..836401cc1a53 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/Route53ResourceRecordSet.java @@ -0,0 +1,252 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.awsconnector.fluent.models.Route53ResourceRecordSetInner; +import java.util.Map; + +/** + * An immutable client-side representation of Route53ResourceRecordSet. + */ +public interface Route53ResourceRecordSet { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the location property: The geo-location where the resource lives. + * + * @return the location value. + */ + String location(); + + /** + * Gets the tags property: Resource tags. + * + * @return the tags value. + */ + Map tags(); + + /** + * Gets the properties property: The resource-specific properties for this resource. + * + * @return the properties value. + */ + Route53ResourceRecordSetProperties properties(); + + /** + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the region of the resource. + * + * @return the region of the resource. + */ + Region region(); + + /** + * Gets the name of the resource region. + * + * @return the name of the resource region. + */ + String regionName(); + + /** + * Gets the name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + + /** + * Gets the inner com.azure.resourcemanager.awsconnector.fluent.models.Route53ResourceRecordSetInner object. + * + * @return the inner object. + */ + Route53ResourceRecordSetInner innerModel(); + + /** + * The entirety of the Route53ResourceRecordSet definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithLocation, + DefinitionStages.WithResourceGroup, DefinitionStages.WithCreate { + } + + /** + * The Route53ResourceRecordSet definition stages. + */ + interface DefinitionStages { + /** + * The first stage of the Route53ResourceRecordSet definition. + */ + interface Blank extends WithLocation { + } + + /** + * The stage of the Route53ResourceRecordSet definition allowing to specify location. + */ + interface WithLocation { + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithResourceGroup withRegion(Region location); + + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithResourceGroup withRegion(String location); + } + + /** + * The stage of the Route53ResourceRecordSet definition allowing to specify parent resource. + */ + interface WithResourceGroup { + /** + * Specifies resourceGroupName. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @return the next definition stage. + */ + WithCreate withExistingResourceGroup(String resourceGroupName); + } + + /** + * The stage of the Route53ResourceRecordSet 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.WithProperties { + /** + * Executes the create request. + * + * @return the created resource. + */ + Route53ResourceRecordSet create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + Route53ResourceRecordSet create(Context context); + } + + /** + * The stage of the Route53ResourceRecordSet definition allowing to specify tags. + */ + interface WithTags { + /** + * Specifies the tags property: Resource tags.. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + WithCreate withTags(Map tags); + } + + /** + * The stage of the Route53ResourceRecordSet definition allowing to specify properties. + */ + interface WithProperties { + /** + * Specifies the properties property: The resource-specific properties for this resource.. + * + * @param properties The resource-specific properties for this resource. + * @return the next definition stage. + */ + WithCreate withProperties(Route53ResourceRecordSetProperties properties); + } + } + + /** + * Begins update for the Route53ResourceRecordSet resource. + * + * @return the stage of resource update. + */ + Route53ResourceRecordSet.Update update(); + + /** + * The template for Route53ResourceRecordSet update. + */ + interface Update extends UpdateStages.WithTags { + /** + * Executes the update request. + * + * @return the updated resource. + */ + Route53ResourceRecordSet apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + Route53ResourceRecordSet apply(Context context); + } + + /** + * The Route53ResourceRecordSet update stages. + */ + interface UpdateStages { + /** + * The stage of the Route53ResourceRecordSet update allowing to specify tags. + */ + interface WithTags { + /** + * Specifies the tags property: Resource tags.. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + Update withTags(Map tags); + } + } + + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + Route53ResourceRecordSet refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + Route53ResourceRecordSet refresh(Context context); +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/Route53ResourceRecordSetListResult.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/Route53ResourceRecordSetListResult.java new file mode 100644 index 000000000000..ff97941539df --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/Route53ResourceRecordSetListResult.java @@ -0,0 +1,137 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.awsconnector.fluent.models.Route53ResourceRecordSetInner; +import java.io.IOException; +import java.util.List; + +/** + * The response of a Route53ResourceRecordSet list operation. + */ +@Fluent +public final class Route53ResourceRecordSetListResult implements JsonSerializable { + /* + * The Route53ResourceRecordSet items on this page + */ + private List value; + + /* + * The link to the next page of items + */ + private String nextLink; + + /** + * Creates an instance of Route53ResourceRecordSetListResult class. + */ + public Route53ResourceRecordSetListResult() { + } + + /** + * Get the value property: The Route53ResourceRecordSet items on this page. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The Route53ResourceRecordSet items on this page. + * + * @param value the value value to set. + * @return the Route53ResourceRecordSetListResult object itself. + */ + public Route53ResourceRecordSetListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The link to the next page of items. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: The link to the next page of items. + * + * @param nextLink the nextLink value to set. + * @return the Route53ResourceRecordSetListResult object itself. + */ + public Route53ResourceRecordSetListResult withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property value in model Route53ResourceRecordSetListResult")); + } else { + value().forEach(e -> e.validate()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(Route53ResourceRecordSetListResult.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("nextLink", this.nextLink); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of Route53ResourceRecordSetListResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of Route53ResourceRecordSetListResult if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the Route53ResourceRecordSetListResult. + */ + public static Route53ResourceRecordSetListResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + Route53ResourceRecordSetListResult deserializedRoute53ResourceRecordSetListResult + = new Route53ResourceRecordSetListResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> Route53ResourceRecordSetInner.fromJson(reader1)); + deserializedRoute53ResourceRecordSetListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedRoute53ResourceRecordSetListResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedRoute53ResourceRecordSetListResult; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/Route53ResourceRecordSetProperties.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/Route53ResourceRecordSetProperties.java new file mode 100644 index 000000000000..8363ccbfcf73 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/Route53ResourceRecordSetProperties.java @@ -0,0 +1,314 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.Map; + +/** + * Definition of Route53ResourceRecordSet. + */ +@Fluent +public final class Route53ResourceRecordSetProperties implements JsonSerializable { + /* + * AWS Properties + */ + private AwsRoute53ResourceRecordSetProperties awsProperties; + + /* + * Public Cloud Connectors Resource ID + */ + private String publicCloudConnectorsResourceId; + + /* + * AWS Account ID + */ + private String awsAccountId; + + /* + * Amazon Resource Name (ARN) + */ + private String arn; + + /* + * Public Cloud Resource Name + */ + private String publicCloudResourceName; + + /* + * AWS Source Schema + */ + private String awsSourceSchema; + + /* + * AWS Region + */ + private String awsRegion; + + /* + * AWS Tags + */ + private Map awsTags; + + /* + * The status of the last operation. + */ + private ProvisioningState provisioningState; + + /** + * Creates an instance of Route53ResourceRecordSetProperties class. + */ + public Route53ResourceRecordSetProperties() { + } + + /** + * Get the awsProperties property: AWS Properties. + * + * @return the awsProperties value. + */ + public AwsRoute53ResourceRecordSetProperties awsProperties() { + return this.awsProperties; + } + + /** + * Set the awsProperties property: AWS Properties. + * + * @param awsProperties the awsProperties value to set. + * @return the Route53ResourceRecordSetProperties object itself. + */ + public Route53ResourceRecordSetProperties withAwsProperties(AwsRoute53ResourceRecordSetProperties awsProperties) { + this.awsProperties = awsProperties; + return this; + } + + /** + * Get the publicCloudConnectorsResourceId property: Public Cloud Connectors Resource ID. + * + * @return the publicCloudConnectorsResourceId value. + */ + public String publicCloudConnectorsResourceId() { + return this.publicCloudConnectorsResourceId; + } + + /** + * Set the publicCloudConnectorsResourceId property: Public Cloud Connectors Resource ID. + * + * @param publicCloudConnectorsResourceId the publicCloudConnectorsResourceId value to set. + * @return the Route53ResourceRecordSetProperties object itself. + */ + public Route53ResourceRecordSetProperties + withPublicCloudConnectorsResourceId(String publicCloudConnectorsResourceId) { + this.publicCloudConnectorsResourceId = publicCloudConnectorsResourceId; + return this; + } + + /** + * Get the awsAccountId property: AWS Account ID. + * + * @return the awsAccountId value. + */ + public String awsAccountId() { + return this.awsAccountId; + } + + /** + * Set the awsAccountId property: AWS Account ID. + * + * @param awsAccountId the awsAccountId value to set. + * @return the Route53ResourceRecordSetProperties object itself. + */ + public Route53ResourceRecordSetProperties withAwsAccountId(String awsAccountId) { + this.awsAccountId = awsAccountId; + return this; + } + + /** + * Get the arn property: Amazon Resource Name (ARN). + * + * @return the arn value. + */ + public String arn() { + return this.arn; + } + + /** + * Set the arn property: Amazon Resource Name (ARN). + * + * @param arn the arn value to set. + * @return the Route53ResourceRecordSetProperties object itself. + */ + public Route53ResourceRecordSetProperties withArn(String arn) { + this.arn = arn; + return this; + } + + /** + * Get the publicCloudResourceName property: Public Cloud Resource Name. + * + * @return the publicCloudResourceName value. + */ + public String publicCloudResourceName() { + return this.publicCloudResourceName; + } + + /** + * Set the publicCloudResourceName property: Public Cloud Resource Name. + * + * @param publicCloudResourceName the publicCloudResourceName value to set. + * @return the Route53ResourceRecordSetProperties object itself. + */ + public Route53ResourceRecordSetProperties withPublicCloudResourceName(String publicCloudResourceName) { + this.publicCloudResourceName = publicCloudResourceName; + return this; + } + + /** + * Get the awsSourceSchema property: AWS Source Schema. + * + * @return the awsSourceSchema value. + */ + public String awsSourceSchema() { + return this.awsSourceSchema; + } + + /** + * Set the awsSourceSchema property: AWS Source Schema. + * + * @param awsSourceSchema the awsSourceSchema value to set. + * @return the Route53ResourceRecordSetProperties object itself. + */ + public Route53ResourceRecordSetProperties withAwsSourceSchema(String awsSourceSchema) { + this.awsSourceSchema = awsSourceSchema; + return this; + } + + /** + * Get the awsRegion property: AWS Region. + * + * @return the awsRegion value. + */ + public String awsRegion() { + return this.awsRegion; + } + + /** + * Set the awsRegion property: AWS Region. + * + * @param awsRegion the awsRegion value to set. + * @return the Route53ResourceRecordSetProperties object itself. + */ + public Route53ResourceRecordSetProperties withAwsRegion(String awsRegion) { + this.awsRegion = awsRegion; + return this; + } + + /** + * Get the awsTags property: AWS Tags. + * + * @return the awsTags value. + */ + public Map awsTags() { + return this.awsTags; + } + + /** + * Set the awsTags property: AWS Tags. + * + * @param awsTags the awsTags value to set. + * @return the Route53ResourceRecordSetProperties object itself. + */ + public Route53ResourceRecordSetProperties withAwsTags(Map awsTags) { + this.awsTags = awsTags; + return this; + } + + /** + * Get the provisioningState property: The status of the last operation. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (awsProperties() != null) { + awsProperties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("awsProperties", this.awsProperties); + jsonWriter.writeStringField("publicCloudConnectorsResourceId", this.publicCloudConnectorsResourceId); + jsonWriter.writeStringField("awsAccountId", this.awsAccountId); + jsonWriter.writeStringField("arn", this.arn); + jsonWriter.writeStringField("publicCloudResourceName", this.publicCloudResourceName); + jsonWriter.writeStringField("awsSourceSchema", this.awsSourceSchema); + jsonWriter.writeStringField("awsRegion", this.awsRegion); + jsonWriter.writeMapField("awsTags", this.awsTags, (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of Route53ResourceRecordSetProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of Route53ResourceRecordSetProperties if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the Route53ResourceRecordSetProperties. + */ + public static Route53ResourceRecordSetProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + Route53ResourceRecordSetProperties deserializedRoute53ResourceRecordSetProperties + = new Route53ResourceRecordSetProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("awsProperties".equals(fieldName)) { + deserializedRoute53ResourceRecordSetProperties.awsProperties + = AwsRoute53ResourceRecordSetProperties.fromJson(reader); + } else if ("publicCloudConnectorsResourceId".equals(fieldName)) { + deserializedRoute53ResourceRecordSetProperties.publicCloudConnectorsResourceId = reader.getString(); + } else if ("awsAccountId".equals(fieldName)) { + deserializedRoute53ResourceRecordSetProperties.awsAccountId = reader.getString(); + } else if ("arn".equals(fieldName)) { + deserializedRoute53ResourceRecordSetProperties.arn = reader.getString(); + } else if ("publicCloudResourceName".equals(fieldName)) { + deserializedRoute53ResourceRecordSetProperties.publicCloudResourceName = reader.getString(); + } else if ("awsSourceSchema".equals(fieldName)) { + deserializedRoute53ResourceRecordSetProperties.awsSourceSchema = reader.getString(); + } else if ("awsRegion".equals(fieldName)) { + deserializedRoute53ResourceRecordSetProperties.awsRegion = reader.getString(); + } else if ("awsTags".equals(fieldName)) { + Map awsTags = reader.readMap(reader1 -> reader1.getString()); + deserializedRoute53ResourceRecordSetProperties.awsTags = awsTags; + } else if ("provisioningState".equals(fieldName)) { + deserializedRoute53ResourceRecordSetProperties.provisioningState + = ProvisioningState.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedRoute53ResourceRecordSetProperties; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/Route53ResourceRecordSetTagsUpdate.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/Route53ResourceRecordSetTagsUpdate.java new file mode 100644 index 000000000000..1274d3a14701 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/Route53ResourceRecordSetTagsUpdate.java @@ -0,0 +1,96 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.Map; + +/** + * The type used for updating tags in Route53ResourceRecordSet resources. + */ +@Fluent +public final class Route53ResourceRecordSetTagsUpdate implements JsonSerializable { + /* + * Resource tags. + */ + private Map tags; + + /** + * Creates an instance of Route53ResourceRecordSetTagsUpdate class. + */ + public Route53ResourceRecordSetTagsUpdate() { + } + + /** + * Get the tags property: Resource tags. + * + * @return the tags value. + */ + public Map tags() { + return this.tags; + } + + /** + * Set the tags property: Resource tags. + * + * @param tags the tags value to set. + * @return the Route53ResourceRecordSetTagsUpdate object itself. + */ + public Route53ResourceRecordSetTagsUpdate withTags(Map tags) { + this.tags = tags; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeMapField("tags", this.tags, (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of Route53ResourceRecordSetTagsUpdate from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of Route53ResourceRecordSetTagsUpdate if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the Route53ResourceRecordSetTagsUpdate. + */ + public static Route53ResourceRecordSetTagsUpdate fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + Route53ResourceRecordSetTagsUpdate deserializedRoute53ResourceRecordSetTagsUpdate + = new Route53ResourceRecordSetTagsUpdate(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedRoute53ResourceRecordSetTagsUpdate.tags = tags; + } else { + reader.skipChildren(); + } + } + + return deserializedRoute53ResourceRecordSetTagsUpdate; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/Route53ResourceRecordSets.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/Route53ResourceRecordSets.java new file mode 100644 index 000000000000..f95161ecac8b --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/Route53ResourceRecordSets.java @@ -0,0 +1,162 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** + * Resource collection API of Route53ResourceRecordSets. + */ +public interface Route53ResourceRecordSets { + /** + * List Route53ResourceRecordSet resources by subscription ID. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Route53ResourceRecordSet list operation as paginated response with + * {@link PagedIterable}. + */ + PagedIterable list(); + + /** + * List Route53ResourceRecordSet resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Route53ResourceRecordSet list operation as paginated response with + * {@link PagedIterable}. + */ + PagedIterable list(Context context); + + /** + * List Route53ResourceRecordSet resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Route53ResourceRecordSet list operation as paginated response with + * {@link PagedIterable}. + */ + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * List Route53ResourceRecordSet resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Route53ResourceRecordSet list operation as paginated response with + * {@link PagedIterable}. + */ + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Get a Route53ResourceRecordSet. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Route53ResourceRecordSet. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Route53ResourceRecordSet along with {@link Response}. + */ + Response getByResourceGroupWithResponse(String resourceGroupName, String name, + Context context); + + /** + * Get a Route53ResourceRecordSet. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Route53ResourceRecordSet. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Route53ResourceRecordSet. + */ + Route53ResourceRecordSet getByResourceGroup(String resourceGroupName, String name); + + /** + * Delete a Route53ResourceRecordSet. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Route53ResourceRecordSet. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByResourceGroup(String resourceGroupName, String name); + + /** + * Delete a Route53ResourceRecordSet. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Route53ResourceRecordSet. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String name, Context context); + + /** + * Get a Route53ResourceRecordSet. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Route53ResourceRecordSet along with {@link Response}. + */ + Route53ResourceRecordSet getById(String id); + + /** + * Get a Route53ResourceRecordSet. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Route53ResourceRecordSet along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Delete a Route53ResourceRecordSet. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteById(String id); + + /** + * Delete a Route53ResourceRecordSet. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new Route53ResourceRecordSet resource. + * + * @param name resource name. + * @return the first stage of the new Route53ResourceRecordSet definition. + */ + Route53ResourceRecordSet.DefinitionStages.Blank define(String name); +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/RoutingRule.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/RoutingRule.java new file mode 100644 index 000000000000..23610cc8bb44 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/RoutingRule.java @@ -0,0 +1,150 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of RoutingRule. + */ +@Fluent +public final class RoutingRule implements JsonSerializable { + /* + * Container for redirect information. You can redirect requests to another host, to another page, or with another + * protocol. In the event of an error, you can specify a different error code to return. Specifies how requests are + * redirected. In the event of an error, you can specify a different error code to return. + */ + private RedirectRule redirectRule; + + /* + * A container for describing a condition that must be met for the specified redirect to apply. For example, 1. If + * request is for pages in the ``/docs`` folder, redirect to the ``/documents`` folder. 2. If request results in + * HTTP error 4xx, redirect request to another host where you might process the error. A container for describing a + * condition that must be met for the specified redirect to apply. For example, 1. If request is for pages in the + * ``/docs`` folder, redirect to the ``/documents`` folder. 2. If request results in HTTP error 4xx, redirect + * request to another host where you might process the error. + */ + private RoutingRuleCondition routingRuleCondition; + + /** + * Creates an instance of RoutingRule class. + */ + public RoutingRule() { + } + + /** + * Get the redirectRule property: Container for redirect information. You can redirect requests to another host, to + * another page, or with another protocol. In the event of an error, you can specify a different error code to + * return. Specifies how requests are redirected. In the event of an error, you can specify a different error code + * to return. + * + * @return the redirectRule value. + */ + public RedirectRule redirectRule() { + return this.redirectRule; + } + + /** + * Set the redirectRule property: Container for redirect information. You can redirect requests to another host, to + * another page, or with another protocol. In the event of an error, you can specify a different error code to + * return. Specifies how requests are redirected. In the event of an error, you can specify a different error code + * to return. + * + * @param redirectRule the redirectRule value to set. + * @return the RoutingRule object itself. + */ + public RoutingRule withRedirectRule(RedirectRule redirectRule) { + this.redirectRule = redirectRule; + return this; + } + + /** + * Get the routingRuleCondition property: A container for describing a condition that must be met for the specified + * redirect to apply. For example, 1. If request is for pages in the ``/docs`` folder, redirect to the + * ``/documents`` folder. 2. If request results in HTTP error 4xx, redirect request to another host where you might + * process the error. A container for describing a condition that must be met for the specified redirect to apply. + * For example, 1. If request is for pages in the ``/docs`` folder, redirect to the ``/documents`` folder. 2. If + * request results in HTTP error 4xx, redirect request to another host where you might process the error. + * + * @return the routingRuleCondition value. + */ + public RoutingRuleCondition routingRuleCondition() { + return this.routingRuleCondition; + } + + /** + * Set the routingRuleCondition property: A container for describing a condition that must be met for the specified + * redirect to apply. For example, 1. If request is for pages in the ``/docs`` folder, redirect to the + * ``/documents`` folder. 2. If request results in HTTP error 4xx, redirect request to another host where you might + * process the error. A container for describing a condition that must be met for the specified redirect to apply. + * For example, 1. If request is for pages in the ``/docs`` folder, redirect to the ``/documents`` folder. 2. If + * request results in HTTP error 4xx, redirect request to another host where you might process the error. + * + * @param routingRuleCondition the routingRuleCondition value to set. + * @return the RoutingRule object itself. + */ + public RoutingRule withRoutingRuleCondition(RoutingRuleCondition routingRuleCondition) { + this.routingRuleCondition = routingRuleCondition; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (redirectRule() != null) { + redirectRule().validate(); + } + if (routingRuleCondition() != null) { + routingRuleCondition().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("redirectRule", this.redirectRule); + jsonWriter.writeJsonField("routingRuleCondition", this.routingRuleCondition); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of RoutingRule from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of RoutingRule if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the RoutingRule. + */ + public static RoutingRule fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + RoutingRule deserializedRoutingRule = new RoutingRule(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("redirectRule".equals(fieldName)) { + deserializedRoutingRule.redirectRule = RedirectRule.fromJson(reader); + } else if ("routingRuleCondition".equals(fieldName)) { + deserializedRoutingRule.routingRuleCondition = RoutingRuleCondition.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedRoutingRule; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/RoutingRuleCondition.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/RoutingRuleCondition.java new file mode 100644 index 000000000000..6f5af4ee95ea --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/RoutingRuleCondition.java @@ -0,0 +1,142 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of RoutingRuleCondition. + */ +@Fluent +public final class RoutingRuleCondition implements JsonSerializable { + /* + * The HTTP error code when the redirect is applied. In the event of an error, if the error code equals this value, + * then the specified redirect is applied. Required when parent element ``Condition`` is specified and sibling + * ``KeyPrefixEquals`` is not specified. If both are specified, then both must be true for the redirect to be + * applied. + */ + private String httpErrorCodeReturnedEquals; + + /* + * The object key name prefix when the redirect is applied. For example, to redirect requests for + * ``ExamplePage.html``, the key prefix will be ``ExamplePage.html``. To redirect request for all pages with the + * prefix ``docs/``, the key prefix will be ``/docs``, which identifies all objects in the docs/ folder. Required + * when the parent element ``Condition`` is specified and sibling ``HttpErrorCodeReturnedEquals`` is not specified. + * If both conditions are specified, both must be true for the redirect to be applied. + */ + private String keyPrefixEquals; + + /** + * Creates an instance of RoutingRuleCondition class. + */ + public RoutingRuleCondition() { + } + + /** + * Get the httpErrorCodeReturnedEquals property: The HTTP error code when the redirect is applied. In the event of + * an error, if the error code equals this value, then the specified redirect is applied. Required when parent + * element ``Condition`` is specified and sibling ``KeyPrefixEquals`` is not specified. If both are specified, then + * both must be true for the redirect to be applied. + * + * @return the httpErrorCodeReturnedEquals value. + */ + public String httpErrorCodeReturnedEquals() { + return this.httpErrorCodeReturnedEquals; + } + + /** + * Set the httpErrorCodeReturnedEquals property: The HTTP error code when the redirect is applied. In the event of + * an error, if the error code equals this value, then the specified redirect is applied. Required when parent + * element ``Condition`` is specified and sibling ``KeyPrefixEquals`` is not specified. If both are specified, then + * both must be true for the redirect to be applied. + * + * @param httpErrorCodeReturnedEquals the httpErrorCodeReturnedEquals value to set. + * @return the RoutingRuleCondition object itself. + */ + public RoutingRuleCondition withHttpErrorCodeReturnedEquals(String httpErrorCodeReturnedEquals) { + this.httpErrorCodeReturnedEquals = httpErrorCodeReturnedEquals; + return this; + } + + /** + * Get the keyPrefixEquals property: The object key name prefix when the redirect is applied. For example, to + * redirect requests for ``ExamplePage.html``, the key prefix will be ``ExamplePage.html``. To redirect request for + * all pages with the prefix ``docs/``, the key prefix will be ``/docs``, which identifies all objects in the docs/ + * folder. Required when the parent element ``Condition`` is specified and sibling ``HttpErrorCodeReturnedEquals`` + * is not specified. If both conditions are specified, both must be true for the redirect to be applied. + * + * @return the keyPrefixEquals value. + */ + public String keyPrefixEquals() { + return this.keyPrefixEquals; + } + + /** + * Set the keyPrefixEquals property: The object key name prefix when the redirect is applied. For example, to + * redirect requests for ``ExamplePage.html``, the key prefix will be ``ExamplePage.html``. To redirect request for + * all pages with the prefix ``docs/``, the key prefix will be ``/docs``, which identifies all objects in the docs/ + * folder. Required when the parent element ``Condition`` is specified and sibling ``HttpErrorCodeReturnedEquals`` + * is not specified. If both conditions are specified, both must be true for the redirect to be applied. + * + * @param keyPrefixEquals the keyPrefixEquals value to set. + * @return the RoutingRuleCondition object itself. + */ + public RoutingRuleCondition withKeyPrefixEquals(String keyPrefixEquals) { + this.keyPrefixEquals = keyPrefixEquals; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("httpErrorCodeReturnedEquals", this.httpErrorCodeReturnedEquals); + jsonWriter.writeStringField("keyPrefixEquals", this.keyPrefixEquals); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of RoutingRuleCondition from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of RoutingRuleCondition if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the RoutingRuleCondition. + */ + public static RoutingRuleCondition fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + RoutingRuleCondition deserializedRoutingRuleCondition = new RoutingRuleCondition(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("httpErrorCodeReturnedEquals".equals(fieldName)) { + deserializedRoutingRuleCondition.httpErrorCodeReturnedEquals = reader.getString(); + } else if ("keyPrefixEquals".equals(fieldName)) { + deserializedRoutingRuleCondition.keyPrefixEquals = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedRoutingRuleCondition; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/Rule.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/Rule.java new file mode 100644 index 000000000000..dff0ddaefbe5 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/Rule.java @@ -0,0 +1,706 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Definition of Rule. + */ +@Fluent +public final class Rule implements JsonSerializable { + /* + * Specifies a lifecycle rule that stops incomplete multipart uploads to an Amazon S3 bucket. Specifies the days + * since the initiation of an incomplete multipart upload that Amazon S3 will wait before permanently removing all + * parts of the upload. For more information, see [Stopping Incomplete Multipart Uploads Using a Bucket Lifecycle + * Policy](https://docs.aws.amazon.com/AmazonS3/latest/dev/mpuoverview.html#mpu-abort-incomplete-mpu-lifecycle- + * config) in the *Amazon S3 User Guide*. + */ + private AbortIncompleteMultipartUpload abortIncompleteMultipartUpload; + + /* + * Indicates when objects are deleted from Amazon S3 and Amazon S3 Glacier. The date value must be in ISO 8601 + * format. The time is always midnight UTC. If you specify an expiration and transition time, you must use the same + * time unit for both properties (either in days or by date). The expiration time must also be later than the + * transition time. The date value in ISO 8601 format. The timezone is always UTC. (YYYY-MM-DDThh:mm:ssZ) + */ + private String expirationDate; + + /* + * Indicates the number of days after creation when objects are deleted from Amazon S3 and Amazon S3 Glacier. If you + * specify an expiration and transition time, you must use the same time unit for both properties (either in days or + * by date). The expiration time must also be later than the transition time. + */ + private Integer expirationInDays; + + /* + * Indicates whether Amazon S3 will remove a delete marker without any noncurrent versions. If set to true, the + * delete marker will be removed if there are no noncurrent versions. This cannot be specified with + * ``ExpirationInDays``, ``ExpirationDate``, or ``TagFilters``. + */ + private Boolean expiredObjectDeleteMarker; + + /* + * Unique identifier for the rule. The value can't be longer than 255 characters. + */ + private String id; + + /* + * Specifies when noncurrent object versions expire. Upon expiration, S3 permanently deletes the noncurrent object + * versions. You set this lifecycle configuration action on a bucket that has versioning enabled (or suspended) to + * request that S3 delete noncurrent object versions at a specific period in the object's lifetime. Specifies when + * noncurrent object versions expire. Upon expiration, S3 permanently deletes the noncurrent object versions. You + * set this lifecycle configuration action on a bucket that has versioning enabled (or suspended) to request that S3 + * delete noncurrent object versions at a specific period in the object's lifetime. For more information about + * setting a lifecycle rule configuration, see [AWS::S3::Bucket + * Rule](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-lifecycleconfig- + * rule.html). + */ + private NoncurrentVersionExpiration noncurrentVersionExpiration; + + /* + * (Deprecated.) For buckets with versioning enabled (or suspended), specifies the time, in days, between when a new + * version of the object is uploaded to the bucket and when old versions of the object expire. When object versions + * expire, Amazon S3 permanently deletes them. If you specify a transition and expiration time, the expiration time + * must be later than the transition time. + */ + private Integer noncurrentVersionExpirationInDays; + + /* + * (Deprecated.) For buckets with versioning enabled (or suspended), specifies when non-current objects transition + * to a specified storage class. If you specify a transition and expiration time, the expiration time must be later + * than the transition time. If you specify this property, don't specify the ``NoncurrentVersionTransitions`` + * property. Container for the transition rule that describes when noncurrent objects transition to the + * ``STANDARD_IA``, ``ONEZONE_IA``, ``INTELLIGENT_TIERING``, ``GLACIER_IR``, ``GLACIER``, or ``DEEP_ARCHIVE`` + * storage class. If your bucket is versioning-enabled (or versioning is suspended), you can set this action to + * request that Amazon S3 transition noncurrent object versions to the ``STANDARD_IA``, ``ONEZONE_IA``, + * ``INTELLIGENT_TIERING``, ``GLACIER_IR``, ``GLACIER``, or ``DEEP_ARCHIVE`` storage class at a specific period in + * the object's lifetime. If you specify this property, don't specify the ``NoncurrentVersionTransitions`` property. + */ + private NoncurrentVersionTransition noncurrentVersionTransition; + + /* + * For buckets with versioning enabled (or suspended), one or more transition rules that specify when non-current + * objects transition to a specified storage class. If you specify a transition and expiration time, the expiration + * time must be later than the transition time. If you specify this property, don't specify the + * ``NoncurrentVersionTransition`` property. + */ + private List noncurrentVersionTransitions; + + /* + * Specifies the minimum object size in bytes for this rule to apply to. Objects must be larger than this value in + * bytes. For more information about size based rules, see [Lifecycle configuration using size-based + * rules](https://docs.aws.amazon.com/AmazonS3/latest/userguide/lifecycle-configuration-examples.html#lc-size-rules) + * in the *Amazon S3 User Guide*. + */ + private String objectSizeGreaterThan; + + /* + * Specifies the maximum object size in bytes for this rule to apply to. Objects must be smaller than this value in + * bytes. For more information about sized based rules, see [Lifecycle configuration using size-based + * rules](https://docs.aws.amazon.com/AmazonS3/latest/userguide/lifecycle-configuration-examples.html#lc-size-rules) + * in the *Amazon S3 User Guide*. + */ + private String objectSizeLessThan; + + /* + * Object key prefix that identifies one or more objects to which this rule applies. Replacement must be made for + * object keys containing special characters (such as carriage returns) when using XML requests. For more + * information, see [XML related object key + * constraints](https://docs.aws.amazon.com/AmazonS3/latest/userguide/object-keys.html#object-key-xml-related- + * constraints). + */ + private String prefix; + + /* + * If ``Enabled``, the rule is currently being applied. If ``Disabled``, the rule is not currently being applied. + */ + private RuleStatus status; + + /* + * Tags to use to identify a subset of objects to which the lifecycle rule applies. + */ + private List tagFilters; + + /* + * (Deprecated.) Specifies when an object transitions to a specified storage class. If you specify an expiration and + * transition time, you must use the same time unit for both properties (either in days or by date). The expiration + * time must also be later than the transition time. If you specify this property, don't specify the ``Transitions`` + * property. Specifies when an object transitions to a specified storage class. For more information about Amazon S3 + * lifecycle configuration rules, see [Transitioning Objects Using Amazon S3 + * Lifecycle](https://docs.aws.amazon.com/AmazonS3/latest/dev/lifecycle-transition-general-considerations.html) in + * the *Amazon S3 User Guide*. + */ + private Transition transition; + + /* + * One or more transition rules that specify when an object transitions to a specified storage class. If you specify + * an expiration and transition time, you must use the same time unit for both properties (either in days or by + * date). The expiration time must also be later than the transition time. If you specify this property, don't + * specify the ``Transition`` property. + */ + private List transitions; + + /** + * Creates an instance of Rule class. + */ + public Rule() { + } + + /** + * Get the abortIncompleteMultipartUpload property: Specifies a lifecycle rule that stops incomplete multipart + * uploads to an Amazon S3 bucket. Specifies the days since the initiation of an incomplete multipart upload that + * Amazon S3 will wait before permanently removing all parts of the upload. For more information, see [Stopping + * Incomplete Multipart Uploads Using a Bucket Lifecycle + * Policy](https://docs.aws.amazon.com/AmazonS3/latest/dev/mpuoverview.html#mpu-abort-incomplete-mpu-lifecycle-config) + * in the *Amazon S3 User Guide*. + * + * @return the abortIncompleteMultipartUpload value. + */ + public AbortIncompleteMultipartUpload abortIncompleteMultipartUpload() { + return this.abortIncompleteMultipartUpload; + } + + /** + * Set the abortIncompleteMultipartUpload property: Specifies a lifecycle rule that stops incomplete multipart + * uploads to an Amazon S3 bucket. Specifies the days since the initiation of an incomplete multipart upload that + * Amazon S3 will wait before permanently removing all parts of the upload. For more information, see [Stopping + * Incomplete Multipart Uploads Using a Bucket Lifecycle + * Policy](https://docs.aws.amazon.com/AmazonS3/latest/dev/mpuoverview.html#mpu-abort-incomplete-mpu-lifecycle-config) + * in the *Amazon S3 User Guide*. + * + * @param abortIncompleteMultipartUpload the abortIncompleteMultipartUpload value to set. + * @return the Rule object itself. + */ + public Rule withAbortIncompleteMultipartUpload(AbortIncompleteMultipartUpload abortIncompleteMultipartUpload) { + this.abortIncompleteMultipartUpload = abortIncompleteMultipartUpload; + return this; + } + + /** + * Get the expirationDate property: Indicates when objects are deleted from Amazon S3 and Amazon S3 Glacier. The + * date value must be in ISO 8601 format. The time is always midnight UTC. If you specify an expiration and + * transition time, you must use the same time unit for both properties (either in days or by date). The expiration + * time must also be later than the transition time. The date value in ISO 8601 format. The timezone is always UTC. + * (YYYY-MM-DDThh:mm:ssZ). + * + * @return the expirationDate value. + */ + public String expirationDate() { + return this.expirationDate; + } + + /** + * Set the expirationDate property: Indicates when objects are deleted from Amazon S3 and Amazon S3 Glacier. The + * date value must be in ISO 8601 format. The time is always midnight UTC. If you specify an expiration and + * transition time, you must use the same time unit for both properties (either in days or by date). The expiration + * time must also be later than the transition time. The date value in ISO 8601 format. The timezone is always UTC. + * (YYYY-MM-DDThh:mm:ssZ). + * + * @param expirationDate the expirationDate value to set. + * @return the Rule object itself. + */ + public Rule withExpirationDate(String expirationDate) { + this.expirationDate = expirationDate; + return this; + } + + /** + * Get the expirationInDays property: Indicates the number of days after creation when objects are deleted from + * Amazon S3 and Amazon S3 Glacier. If you specify an expiration and transition time, you must use the same time + * unit for both properties (either in days or by date). The expiration time must also be later than the transition + * time. + * + * @return the expirationInDays value. + */ + public Integer expirationInDays() { + return this.expirationInDays; + } + + /** + * Set the expirationInDays property: Indicates the number of days after creation when objects are deleted from + * Amazon S3 and Amazon S3 Glacier. If you specify an expiration and transition time, you must use the same time + * unit for both properties (either in days or by date). The expiration time must also be later than the transition + * time. + * + * @param expirationInDays the expirationInDays value to set. + * @return the Rule object itself. + */ + public Rule withExpirationInDays(Integer expirationInDays) { + this.expirationInDays = expirationInDays; + return this; + } + + /** + * Get the expiredObjectDeleteMarker property: Indicates whether Amazon S3 will remove a delete marker without any + * noncurrent versions. If set to true, the delete marker will be removed if there are no noncurrent versions. This + * cannot be specified with ``ExpirationInDays``, ``ExpirationDate``, or ``TagFilters``. + * + * @return the expiredObjectDeleteMarker value. + */ + public Boolean expiredObjectDeleteMarker() { + return this.expiredObjectDeleteMarker; + } + + /** + * Set the expiredObjectDeleteMarker property: Indicates whether Amazon S3 will remove a delete marker without any + * noncurrent versions. If set to true, the delete marker will be removed if there are no noncurrent versions. This + * cannot be specified with ``ExpirationInDays``, ``ExpirationDate``, or ``TagFilters``. + * + * @param expiredObjectDeleteMarker the expiredObjectDeleteMarker value to set. + * @return the Rule object itself. + */ + public Rule withExpiredObjectDeleteMarker(Boolean expiredObjectDeleteMarker) { + this.expiredObjectDeleteMarker = expiredObjectDeleteMarker; + return this; + } + + /** + * Get the id property: Unique identifier for the rule. The value can't be longer than 255 characters. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Set the id property: Unique identifier for the rule. The value can't be longer than 255 characters. + * + * @param id the id value to set. + * @return the Rule object itself. + */ + public Rule withId(String id) { + this.id = id; + return this; + } + + /** + * Get the noncurrentVersionExpiration property: Specifies when noncurrent object versions expire. Upon expiration, + * S3 permanently deletes the noncurrent object versions. You set this lifecycle configuration action on a bucket + * that has versioning enabled (or suspended) to request that S3 delete noncurrent object versions at a specific + * period in the object's lifetime. Specifies when noncurrent object versions expire. Upon expiration, S3 + * permanently deletes the noncurrent object versions. You set this lifecycle configuration action on a bucket that + * has versioning enabled (or suspended) to request that S3 delete noncurrent object versions at a specific period + * in the object's lifetime. For more information about setting a lifecycle rule configuration, see [AWS::S3::Bucket + * Rule](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-lifecycleconfig-rule.html). + * + * @return the noncurrentVersionExpiration value. + */ + public NoncurrentVersionExpiration noncurrentVersionExpiration() { + return this.noncurrentVersionExpiration; + } + + /** + * Set the noncurrentVersionExpiration property: Specifies when noncurrent object versions expire. Upon expiration, + * S3 permanently deletes the noncurrent object versions. You set this lifecycle configuration action on a bucket + * that has versioning enabled (or suspended) to request that S3 delete noncurrent object versions at a specific + * period in the object's lifetime. Specifies when noncurrent object versions expire. Upon expiration, S3 + * permanently deletes the noncurrent object versions. You set this lifecycle configuration action on a bucket that + * has versioning enabled (or suspended) to request that S3 delete noncurrent object versions at a specific period + * in the object's lifetime. For more information about setting a lifecycle rule configuration, see [AWS::S3::Bucket + * Rule](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-lifecycleconfig-rule.html). + * + * @param noncurrentVersionExpiration the noncurrentVersionExpiration value to set. + * @return the Rule object itself. + */ + public Rule withNoncurrentVersionExpiration(NoncurrentVersionExpiration noncurrentVersionExpiration) { + this.noncurrentVersionExpiration = noncurrentVersionExpiration; + return this; + } + + /** + * Get the noncurrentVersionExpirationInDays property: (Deprecated.) For buckets with versioning enabled (or + * suspended), specifies the time, in days, between when a new version of the object is uploaded to the bucket and + * when old versions of the object expire. When object versions expire, Amazon S3 permanently deletes them. If you + * specify a transition and expiration time, the expiration time must be later than the transition time. + * + * @return the noncurrentVersionExpirationInDays value. + */ + public Integer noncurrentVersionExpirationInDays() { + return this.noncurrentVersionExpirationInDays; + } + + /** + * Set the noncurrentVersionExpirationInDays property: (Deprecated.) For buckets with versioning enabled (or + * suspended), specifies the time, in days, between when a new version of the object is uploaded to the bucket and + * when old versions of the object expire. When object versions expire, Amazon S3 permanently deletes them. If you + * specify a transition and expiration time, the expiration time must be later than the transition time. + * + * @param noncurrentVersionExpirationInDays the noncurrentVersionExpirationInDays value to set. + * @return the Rule object itself. + */ + public Rule withNoncurrentVersionExpirationInDays(Integer noncurrentVersionExpirationInDays) { + this.noncurrentVersionExpirationInDays = noncurrentVersionExpirationInDays; + return this; + } + + /** + * Get the noncurrentVersionTransition property: (Deprecated.) For buckets with versioning enabled (or suspended), + * specifies when non-current objects transition to a specified storage class. If you specify a transition and + * expiration time, the expiration time must be later than the transition time. If you specify this property, don't + * specify the ``NoncurrentVersionTransitions`` property. Container for the transition rule that describes when + * noncurrent objects transition to the ``STANDARD_IA``, ``ONEZONE_IA``, ``INTELLIGENT_TIERING``, ``GLACIER_IR``, + * ``GLACIER``, or ``DEEP_ARCHIVE`` storage class. If your bucket is versioning-enabled (or versioning is + * suspended), you can set this action to request that Amazon S3 transition noncurrent object versions to the + * ``STANDARD_IA``, ``ONEZONE_IA``, ``INTELLIGENT_TIERING``, ``GLACIER_IR``, ``GLACIER``, or ``DEEP_ARCHIVE`` + * storage class at a specific period in the object's lifetime. If you specify this property, don't specify the + * ``NoncurrentVersionTransitions`` property. + * + * @return the noncurrentVersionTransition value. + */ + public NoncurrentVersionTransition noncurrentVersionTransition() { + return this.noncurrentVersionTransition; + } + + /** + * Set the noncurrentVersionTransition property: (Deprecated.) For buckets with versioning enabled (or suspended), + * specifies when non-current objects transition to a specified storage class. If you specify a transition and + * expiration time, the expiration time must be later than the transition time. If you specify this property, don't + * specify the ``NoncurrentVersionTransitions`` property. Container for the transition rule that describes when + * noncurrent objects transition to the ``STANDARD_IA``, ``ONEZONE_IA``, ``INTELLIGENT_TIERING``, ``GLACIER_IR``, + * ``GLACIER``, or ``DEEP_ARCHIVE`` storage class. If your bucket is versioning-enabled (or versioning is + * suspended), you can set this action to request that Amazon S3 transition noncurrent object versions to the + * ``STANDARD_IA``, ``ONEZONE_IA``, ``INTELLIGENT_TIERING``, ``GLACIER_IR``, ``GLACIER``, or ``DEEP_ARCHIVE`` + * storage class at a specific period in the object's lifetime. If you specify this property, don't specify the + * ``NoncurrentVersionTransitions`` property. + * + * @param noncurrentVersionTransition the noncurrentVersionTransition value to set. + * @return the Rule object itself. + */ + public Rule withNoncurrentVersionTransition(NoncurrentVersionTransition noncurrentVersionTransition) { + this.noncurrentVersionTransition = noncurrentVersionTransition; + return this; + } + + /** + * Get the noncurrentVersionTransitions property: For buckets with versioning enabled (or suspended), one or more + * transition rules that specify when non-current objects transition to a specified storage class. If you specify a + * transition and expiration time, the expiration time must be later than the transition time. If you specify this + * property, don't specify the ``NoncurrentVersionTransition`` property. + * + * @return the noncurrentVersionTransitions value. + */ + public List noncurrentVersionTransitions() { + return this.noncurrentVersionTransitions; + } + + /** + * Set the noncurrentVersionTransitions property: For buckets with versioning enabled (or suspended), one or more + * transition rules that specify when non-current objects transition to a specified storage class. If you specify a + * transition and expiration time, the expiration time must be later than the transition time. If you specify this + * property, don't specify the ``NoncurrentVersionTransition`` property. + * + * @param noncurrentVersionTransitions the noncurrentVersionTransitions value to set. + * @return the Rule object itself. + */ + public Rule withNoncurrentVersionTransitions(List noncurrentVersionTransitions) { + this.noncurrentVersionTransitions = noncurrentVersionTransitions; + return this; + } + + /** + * Get the objectSizeGreaterThan property: Specifies the minimum object size in bytes for this rule to apply to. + * Objects must be larger than this value in bytes. For more information about size based rules, see [Lifecycle + * configuration using size-based + * rules](https://docs.aws.amazon.com/AmazonS3/latest/userguide/lifecycle-configuration-examples.html#lc-size-rules) + * in the *Amazon S3 User Guide*. + * + * @return the objectSizeGreaterThan value. + */ + public String objectSizeGreaterThan() { + return this.objectSizeGreaterThan; + } + + /** + * Set the objectSizeGreaterThan property: Specifies the minimum object size in bytes for this rule to apply to. + * Objects must be larger than this value in bytes. For more information about size based rules, see [Lifecycle + * configuration using size-based + * rules](https://docs.aws.amazon.com/AmazonS3/latest/userguide/lifecycle-configuration-examples.html#lc-size-rules) + * in the *Amazon S3 User Guide*. + * + * @param objectSizeGreaterThan the objectSizeGreaterThan value to set. + * @return the Rule object itself. + */ + public Rule withObjectSizeGreaterThan(String objectSizeGreaterThan) { + this.objectSizeGreaterThan = objectSizeGreaterThan; + return this; + } + + /** + * Get the objectSizeLessThan property: Specifies the maximum object size in bytes for this rule to apply to. + * Objects must be smaller than this value in bytes. For more information about sized based rules, see [Lifecycle + * configuration using size-based + * rules](https://docs.aws.amazon.com/AmazonS3/latest/userguide/lifecycle-configuration-examples.html#lc-size-rules) + * in the *Amazon S3 User Guide*. + * + * @return the objectSizeLessThan value. + */ + public String objectSizeLessThan() { + return this.objectSizeLessThan; + } + + /** + * Set the objectSizeLessThan property: Specifies the maximum object size in bytes for this rule to apply to. + * Objects must be smaller than this value in bytes. For more information about sized based rules, see [Lifecycle + * configuration using size-based + * rules](https://docs.aws.amazon.com/AmazonS3/latest/userguide/lifecycle-configuration-examples.html#lc-size-rules) + * in the *Amazon S3 User Guide*. + * + * @param objectSizeLessThan the objectSizeLessThan value to set. + * @return the Rule object itself. + */ + public Rule withObjectSizeLessThan(String objectSizeLessThan) { + this.objectSizeLessThan = objectSizeLessThan; + return this; + } + + /** + * Get the prefix property: Object key prefix that identifies one or more objects to which this rule applies. + * Replacement must be made for object keys containing special characters (such as carriage returns) when using XML + * requests. For more information, see [XML related object key + * constraints](https://docs.aws.amazon.com/AmazonS3/latest/userguide/object-keys.html#object-key-xml-related-constraints). + * + * @return the prefix value. + */ + public String prefix() { + return this.prefix; + } + + /** + * Set the prefix property: Object key prefix that identifies one or more objects to which this rule applies. + * Replacement must be made for object keys containing special characters (such as carriage returns) when using XML + * requests. For more information, see [XML related object key + * constraints](https://docs.aws.amazon.com/AmazonS3/latest/userguide/object-keys.html#object-key-xml-related-constraints). + * + * @param prefix the prefix value to set. + * @return the Rule object itself. + */ + public Rule withPrefix(String prefix) { + this.prefix = prefix; + return this; + } + + /** + * Get the status property: If ``Enabled``, the rule is currently being applied. If ``Disabled``, the rule is not + * currently being applied. + * + * @return the status value. + */ + public RuleStatus status() { + return this.status; + } + + /** + * Set the status property: If ``Enabled``, the rule is currently being applied. If ``Disabled``, the rule is not + * currently being applied. + * + * @param status the status value to set. + * @return the Rule object itself. + */ + public Rule withStatus(RuleStatus status) { + this.status = status; + return this; + } + + /** + * Get the tagFilters property: Tags to use to identify a subset of objects to which the lifecycle rule applies. + * + * @return the tagFilters value. + */ + public List tagFilters() { + return this.tagFilters; + } + + /** + * Set the tagFilters property: Tags to use to identify a subset of objects to which the lifecycle rule applies. + * + * @param tagFilters the tagFilters value to set. + * @return the Rule object itself. + */ + public Rule withTagFilters(List tagFilters) { + this.tagFilters = tagFilters; + return this; + } + + /** + * Get the transition property: (Deprecated.) Specifies when an object transitions to a specified storage class. If + * you specify an expiration and transition time, you must use the same time unit for both properties (either in + * days or by date). The expiration time must also be later than the transition time. If you specify this property, + * don't specify the ``Transitions`` property. Specifies when an object transitions to a specified storage class. + * For more information about Amazon S3 lifecycle configuration rules, see [Transitioning Objects Using Amazon S3 + * Lifecycle](https://docs.aws.amazon.com/AmazonS3/latest/dev/lifecycle-transition-general-considerations.html) in + * the *Amazon S3 User Guide*. + * + * @return the transition value. + */ + public Transition transition() { + return this.transition; + } + + /** + * Set the transition property: (Deprecated.) Specifies when an object transitions to a specified storage class. If + * you specify an expiration and transition time, you must use the same time unit for both properties (either in + * days or by date). The expiration time must also be later than the transition time. If you specify this property, + * don't specify the ``Transitions`` property. Specifies when an object transitions to a specified storage class. + * For more information about Amazon S3 lifecycle configuration rules, see [Transitioning Objects Using Amazon S3 + * Lifecycle](https://docs.aws.amazon.com/AmazonS3/latest/dev/lifecycle-transition-general-considerations.html) in + * the *Amazon S3 User Guide*. + * + * @param transition the transition value to set. + * @return the Rule object itself. + */ + public Rule withTransition(Transition transition) { + this.transition = transition; + return this; + } + + /** + * Get the transitions property: One or more transition rules that specify when an object transitions to a specified + * storage class. If you specify an expiration and transition time, you must use the same time unit for both + * properties (either in days or by date). The expiration time must also be later than the transition time. If you + * specify this property, don't specify the ``Transition`` property. + * + * @return the transitions value. + */ + public List transitions() { + return this.transitions; + } + + /** + * Set the transitions property: One or more transition rules that specify when an object transitions to a specified + * storage class. If you specify an expiration and transition time, you must use the same time unit for both + * properties (either in days or by date). The expiration time must also be later than the transition time. If you + * specify this property, don't specify the ``Transition`` property. + * + * @param transitions the transitions value to set. + * @return the Rule object itself. + */ + public Rule withTransitions(List transitions) { + this.transitions = transitions; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (abortIncompleteMultipartUpload() != null) { + abortIncompleteMultipartUpload().validate(); + } + if (noncurrentVersionExpiration() != null) { + noncurrentVersionExpiration().validate(); + } + if (noncurrentVersionTransition() != null) { + noncurrentVersionTransition().validate(); + } + if (noncurrentVersionTransitions() != null) { + noncurrentVersionTransitions().forEach(e -> e.validate()); + } + if (tagFilters() != null) { + tagFilters().forEach(e -> e.validate()); + } + if (transition() != null) { + transition().validate(); + } + if (transitions() != null) { + transitions().forEach(e -> e.validate()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("abortIncompleteMultipartUpload", this.abortIncompleteMultipartUpload); + jsonWriter.writeStringField("expirationDate", this.expirationDate); + jsonWriter.writeNumberField("expirationInDays", this.expirationInDays); + jsonWriter.writeBooleanField("expiredObjectDeleteMarker", this.expiredObjectDeleteMarker); + jsonWriter.writeStringField("id", this.id); + jsonWriter.writeJsonField("noncurrentVersionExpiration", this.noncurrentVersionExpiration); + jsonWriter.writeNumberField("noncurrentVersionExpirationInDays", this.noncurrentVersionExpirationInDays); + jsonWriter.writeJsonField("noncurrentVersionTransition", this.noncurrentVersionTransition); + jsonWriter.writeArrayField("noncurrentVersionTransitions", this.noncurrentVersionTransitions, + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("objectSizeGreaterThan", this.objectSizeGreaterThan); + jsonWriter.writeStringField("objectSizeLessThan", this.objectSizeLessThan); + jsonWriter.writeStringField("prefix", this.prefix); + jsonWriter.writeStringField("status", this.status == null ? null : this.status.toString()); + jsonWriter.writeArrayField("tagFilters", this.tagFilters, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeJsonField("transition", this.transition); + jsonWriter.writeArrayField("transitions", this.transitions, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of Rule from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of Rule if the JsonReader was pointing to an instance of it, or null if it was pointing to + * JSON null. + * @throws IOException If an error occurs while reading the Rule. + */ + public static Rule fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + Rule deserializedRule = new Rule(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("abortIncompleteMultipartUpload".equals(fieldName)) { + deserializedRule.abortIncompleteMultipartUpload = AbortIncompleteMultipartUpload.fromJson(reader); + } else if ("expirationDate".equals(fieldName)) { + deserializedRule.expirationDate = reader.getString(); + } else if ("expirationInDays".equals(fieldName)) { + deserializedRule.expirationInDays = reader.getNullable(JsonReader::getInt); + } else if ("expiredObjectDeleteMarker".equals(fieldName)) { + deserializedRule.expiredObjectDeleteMarker = reader.getNullable(JsonReader::getBoolean); + } else if ("id".equals(fieldName)) { + deserializedRule.id = reader.getString(); + } else if ("noncurrentVersionExpiration".equals(fieldName)) { + deserializedRule.noncurrentVersionExpiration = NoncurrentVersionExpiration.fromJson(reader); + } else if ("noncurrentVersionExpirationInDays".equals(fieldName)) { + deserializedRule.noncurrentVersionExpirationInDays = reader.getNullable(JsonReader::getInt); + } else if ("noncurrentVersionTransition".equals(fieldName)) { + deserializedRule.noncurrentVersionTransition = NoncurrentVersionTransition.fromJson(reader); + } else if ("noncurrentVersionTransitions".equals(fieldName)) { + List noncurrentVersionTransitions + = reader.readArray(reader1 -> NoncurrentVersionTransition.fromJson(reader1)); + deserializedRule.noncurrentVersionTransitions = noncurrentVersionTransitions; + } else if ("objectSizeGreaterThan".equals(fieldName)) { + deserializedRule.objectSizeGreaterThan = reader.getString(); + } else if ("objectSizeLessThan".equals(fieldName)) { + deserializedRule.objectSizeLessThan = reader.getString(); + } else if ("prefix".equals(fieldName)) { + deserializedRule.prefix = reader.getString(); + } else if ("status".equals(fieldName)) { + deserializedRule.status = RuleStatus.fromString(reader.getString()); + } else if ("tagFilters".equals(fieldName)) { + List tagFilters = reader.readArray(reader1 -> TagFilter.fromJson(reader1)); + deserializedRule.tagFilters = tagFilters; + } else if ("transition".equals(fieldName)) { + deserializedRule.transition = Transition.fromJson(reader); + } else if ("transitions".equals(fieldName)) { + List transitions = reader.readArray(reader1 -> Transition.fromJson(reader1)); + deserializedRule.transitions = transitions; + } else { + reader.skipChildren(); + } + } + + return deserializedRule; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/RuleDefinition.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/RuleDefinition.java new file mode 100644 index 000000000000..478ce834d0a8 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/RuleDefinition.java @@ -0,0 +1,126 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Definition of RuleDefinition. + */ +@Fluent +public final class RuleDefinition implements JsonSerializable { + /* + * Property actions + */ + private List actions; + + /* + * Property matchAttributes + */ + private MatchAttributes matchAttributes; + + /** + * Creates an instance of RuleDefinition class. + */ + public RuleDefinition() { + } + + /** + * Get the actions property: Property actions. + * + * @return the actions value. + */ + public List actions() { + return this.actions; + } + + /** + * Set the actions property: Property actions. + * + * @param actions the actions value to set. + * @return the RuleDefinition object itself. + */ + public RuleDefinition withActions(List actions) { + this.actions = actions; + return this; + } + + /** + * Get the matchAttributes property: Property matchAttributes. + * + * @return the matchAttributes value. + */ + public MatchAttributes matchAttributes() { + return this.matchAttributes; + } + + /** + * Set the matchAttributes property: Property matchAttributes. + * + * @param matchAttributes the matchAttributes value to set. + * @return the RuleDefinition object itself. + */ + public RuleDefinition withMatchAttributes(MatchAttributes matchAttributes) { + this.matchAttributes = matchAttributes; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (matchAttributes() != null) { + matchAttributes().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("actions", this.actions, (writer, element) -> writer.writeString(element)); + jsonWriter.writeJsonField("matchAttributes", this.matchAttributes); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of RuleDefinition from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of RuleDefinition if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the RuleDefinition. + */ + public static RuleDefinition fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + RuleDefinition deserializedRuleDefinition = new RuleDefinition(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("actions".equals(fieldName)) { + List actions = reader.readArray(reader1 -> reader1.getString()); + deserializedRuleDefinition.actions = actions; + } else if ("matchAttributes".equals(fieldName)) { + deserializedRuleDefinition.matchAttributes = MatchAttributes.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedRuleDefinition; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/RuleGroup.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/RuleGroup.java new file mode 100644 index 000000000000..c3fb6959a3d0 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/RuleGroup.java @@ -0,0 +1,189 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of RuleGroup. + */ +@Fluent +public final class RuleGroup implements JsonSerializable { + /* + * Property referenceSets + */ + private ReferenceSets referenceSets; + + /* + * Property ruleVariables + */ + private RuleVariables ruleVariables; + + /* + * Property rulesSource + */ + private RulesSource rulesSource; + + /* + * Property statefulRuleOptions + */ + private StatefulRuleOptions statefulRuleOptions; + + /** + * Creates an instance of RuleGroup class. + */ + public RuleGroup() { + } + + /** + * Get the referenceSets property: Property referenceSets. + * + * @return the referenceSets value. + */ + public ReferenceSets referenceSets() { + return this.referenceSets; + } + + /** + * Set the referenceSets property: Property referenceSets. + * + * @param referenceSets the referenceSets value to set. + * @return the RuleGroup object itself. + */ + public RuleGroup withReferenceSets(ReferenceSets referenceSets) { + this.referenceSets = referenceSets; + return this; + } + + /** + * Get the ruleVariables property: Property ruleVariables. + * + * @return the ruleVariables value. + */ + public RuleVariables ruleVariables() { + return this.ruleVariables; + } + + /** + * Set the ruleVariables property: Property ruleVariables. + * + * @param ruleVariables the ruleVariables value to set. + * @return the RuleGroup object itself. + */ + public RuleGroup withRuleVariables(RuleVariables ruleVariables) { + this.ruleVariables = ruleVariables; + return this; + } + + /** + * Get the rulesSource property: Property rulesSource. + * + * @return the rulesSource value. + */ + public RulesSource rulesSource() { + return this.rulesSource; + } + + /** + * Set the rulesSource property: Property rulesSource. + * + * @param rulesSource the rulesSource value to set. + * @return the RuleGroup object itself. + */ + public RuleGroup withRulesSource(RulesSource rulesSource) { + this.rulesSource = rulesSource; + return this; + } + + /** + * Get the statefulRuleOptions property: Property statefulRuleOptions. + * + * @return the statefulRuleOptions value. + */ + public StatefulRuleOptions statefulRuleOptions() { + return this.statefulRuleOptions; + } + + /** + * Set the statefulRuleOptions property: Property statefulRuleOptions. + * + * @param statefulRuleOptions the statefulRuleOptions value to set. + * @return the RuleGroup object itself. + */ + public RuleGroup withStatefulRuleOptions(StatefulRuleOptions statefulRuleOptions) { + this.statefulRuleOptions = statefulRuleOptions; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (referenceSets() != null) { + referenceSets().validate(); + } + if (ruleVariables() != null) { + ruleVariables().validate(); + } + if (rulesSource() != null) { + rulesSource().validate(); + } + if (statefulRuleOptions() != null) { + statefulRuleOptions().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("referenceSets", this.referenceSets); + jsonWriter.writeJsonField("ruleVariables", this.ruleVariables); + jsonWriter.writeJsonField("rulesSource", this.rulesSource); + jsonWriter.writeJsonField("statefulRuleOptions", this.statefulRuleOptions); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of RuleGroup from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of RuleGroup if the JsonReader was pointing to an instance of it, or null if it was pointing + * to JSON null. + * @throws IOException If an error occurs while reading the RuleGroup. + */ + public static RuleGroup fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + RuleGroup deserializedRuleGroup = new RuleGroup(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("referenceSets".equals(fieldName)) { + deserializedRuleGroup.referenceSets = ReferenceSets.fromJson(reader); + } else if ("ruleVariables".equals(fieldName)) { + deserializedRuleGroup.ruleVariables = RuleVariables.fromJson(reader); + } else if ("rulesSource".equals(fieldName)) { + deserializedRuleGroup.rulesSource = RulesSource.fromJson(reader); + } else if ("statefulRuleOptions".equals(fieldName)) { + deserializedRuleGroup.statefulRuleOptions = StatefulRuleOptions.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedRuleGroup; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/RuleOption.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/RuleOption.java new file mode 100644 index 000000000000..452cc455ece3 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/RuleOption.java @@ -0,0 +1,123 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Definition of RuleOption. + */ +@Fluent +public final class RuleOption implements JsonSerializable { + /* + * Property keyword + */ + private String keyword; + + /* + * Property settings + */ + private List settings; + + /** + * Creates an instance of RuleOption class. + */ + public RuleOption() { + } + + /** + * Get the keyword property: Property keyword. + * + * @return the keyword value. + */ + public String keyword() { + return this.keyword; + } + + /** + * Set the keyword property: Property keyword. + * + * @param keyword the keyword value to set. + * @return the RuleOption object itself. + */ + public RuleOption withKeyword(String keyword) { + this.keyword = keyword; + return this; + } + + /** + * Get the settings property: Property settings. + * + * @return the settings value. + */ + public List settings() { + return this.settings; + } + + /** + * Set the settings property: Property settings. + * + * @param settings the settings value to set. + * @return the RuleOption object itself. + */ + public RuleOption withSettings(List settings) { + this.settings = settings; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("keyword", this.keyword); + jsonWriter.writeArrayField("settings", this.settings, (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of RuleOption from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of RuleOption if the JsonReader was pointing to an instance of it, or null if it was pointing + * to JSON null. + * @throws IOException If an error occurs while reading the RuleOption. + */ + public static RuleOption fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + RuleOption deserializedRuleOption = new RuleOption(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("keyword".equals(fieldName)) { + deserializedRuleOption.keyword = reader.getString(); + } else if ("settings".equals(fieldName)) { + List settings = reader.readArray(reader1 -> reader1.getString()); + deserializedRuleOption.settings = settings; + } else { + reader.skipChildren(); + } + } + + return deserializedRuleOption; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/RuleStatus.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/RuleStatus.java new file mode 100644 index 000000000000..2710e4092cc9 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/RuleStatus.java @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * RuleStatus enum. + */ +public final class RuleStatus extends ExpandableStringEnum { + /** + * Static value Disabled for RuleStatus. + */ + public static final RuleStatus DISABLED = fromString("Disabled"); + + /** + * Static value Enabled for RuleStatus. + */ + public static final RuleStatus ENABLED = fromString("Enabled"); + + /** + * Creates a new instance of RuleStatus value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public RuleStatus() { + } + + /** + * Creates or finds a RuleStatus from its string representation. + * + * @param name a name to look for. + * @return the corresponding RuleStatus. + */ + public static RuleStatus fromString(String name) { + return fromString(name, RuleStatus.class); + } + + /** + * Gets known RuleStatus values. + * + * @return known RuleStatus values. + */ + public static Collection values() { + return values(RuleStatus.class); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/RuleVariables.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/RuleVariables.java new file mode 100644 index 000000000000..d62d299b0e58 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/RuleVariables.java @@ -0,0 +1,138 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.Map; + +/** + * Definition of RuleVariables. + */ +@Fluent +public final class RuleVariables implements JsonSerializable { + /* + * Property ipSets + */ + private Map ipSets; + + /* + * Property portSets + */ + private Map portSets; + + /** + * Creates an instance of RuleVariables class. + */ + public RuleVariables() { + } + + /** + * Get the ipSets property: Property ipSets. + * + * @return the ipSets value. + */ + public Map ipSets() { + return this.ipSets; + } + + /** + * Set the ipSets property: Property ipSets. + * + * @param ipSets the ipSets value to set. + * @return the RuleVariables object itself. + */ + public RuleVariables withIpSets(Map ipSets) { + this.ipSets = ipSets; + return this; + } + + /** + * Get the portSets property: Property portSets. + * + * @return the portSets value. + */ + public Map portSets() { + return this.portSets; + } + + /** + * Set the portSets property: Property portSets. + * + * @param portSets the portSets value to set. + * @return the RuleVariables object itself. + */ + public RuleVariables withPortSets(Map portSets) { + this.portSets = portSets; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (ipSets() != null) { + ipSets().values().forEach(e -> { + if (e != null) { + e.validate(); + } + }); + } + if (portSets() != null) { + portSets().values().forEach(e -> { + if (e != null) { + e.validate(); + } + }); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeMapField("ipSets", this.ipSets, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeMapField("portSets", this.portSets, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of RuleVariables from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of RuleVariables if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the RuleVariables. + */ + public static RuleVariables fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + RuleVariables deserializedRuleVariables = new RuleVariables(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("ipSets".equals(fieldName)) { + Map ipSets = reader.readMap(reader1 -> IpSet.fromJson(reader1)); + deserializedRuleVariables.ipSets = ipSets; + } else if ("portSets".equals(fieldName)) { + Map portSets = reader.readMap(reader1 -> PortSet.fromJson(reader1)); + deserializedRuleVariables.portSets = portSets; + } else { + reader.skipChildren(); + } + } + + return deserializedRuleVariables; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/RuleVariablesModel.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/RuleVariablesModel.java new file mode 100644 index 000000000000..4a37d220903b --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/RuleVariablesModel.java @@ -0,0 +1,102 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.Map; + +/** + * Definition of RuleVariables. + */ +@Fluent +public final class RuleVariablesModel implements JsonSerializable { + /* + * Property ruleVariables + */ + private Map ruleVariables; + + /** + * Creates an instance of RuleVariablesModel class. + */ + public RuleVariablesModel() { + } + + /** + * Get the ruleVariables property: Property ruleVariables. + * + * @return the ruleVariables value. + */ + public Map ruleVariables() { + return this.ruleVariables; + } + + /** + * Set the ruleVariables property: Property ruleVariables. + * + * @param ruleVariables the ruleVariables value to set. + * @return the RuleVariablesModel object itself. + */ + public RuleVariablesModel withRuleVariables(Map ruleVariables) { + this.ruleVariables = ruleVariables; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (ruleVariables() != null) { + ruleVariables().values().forEach(e -> { + if (e != null) { + e.validate(); + } + }); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeMapField("ruleVariables", this.ruleVariables, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of RuleVariablesModel from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of RuleVariablesModel if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the RuleVariablesModel. + */ + public static RuleVariablesModel fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + RuleVariablesModel deserializedRuleVariablesModel = new RuleVariablesModel(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("ruleVariables".equals(fieldName)) { + Map ruleVariables = reader.readMap(reader1 -> IpSet.fromJson(reader1)); + deserializedRuleVariablesModel.ruleVariables = ruleVariables; + } else { + reader.skipChildren(); + } + } + + return deserializedRuleVariablesModel; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/RulesSource.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/RulesSource.java new file mode 100644 index 000000000000..285af38909e0 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/RulesSource.java @@ -0,0 +1,190 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Definition of RulesSource. + */ +@Fluent +public final class RulesSource implements JsonSerializable { + /* + * Property rulesSourceList + */ + private RulesSourceList rulesSourceList; + + /* + * Property rulesString + */ + private String rulesString; + + /* + * Property statefulRules + */ + private List statefulRules; + + /* + * Property statelessRulesAndCustomActions + */ + private StatelessRulesAndCustomActions statelessRulesAndCustomActions; + + /** + * Creates an instance of RulesSource class. + */ + public RulesSource() { + } + + /** + * Get the rulesSourceList property: Property rulesSourceList. + * + * @return the rulesSourceList value. + */ + public RulesSourceList rulesSourceList() { + return this.rulesSourceList; + } + + /** + * Set the rulesSourceList property: Property rulesSourceList. + * + * @param rulesSourceList the rulesSourceList value to set. + * @return the RulesSource object itself. + */ + public RulesSource withRulesSourceList(RulesSourceList rulesSourceList) { + this.rulesSourceList = rulesSourceList; + return this; + } + + /** + * Get the rulesString property: Property rulesString. + * + * @return the rulesString value. + */ + public String rulesString() { + return this.rulesString; + } + + /** + * Set the rulesString property: Property rulesString. + * + * @param rulesString the rulesString value to set. + * @return the RulesSource object itself. + */ + public RulesSource withRulesString(String rulesString) { + this.rulesString = rulesString; + return this; + } + + /** + * Get the statefulRules property: Property statefulRules. + * + * @return the statefulRules value. + */ + public List statefulRules() { + return this.statefulRules; + } + + /** + * Set the statefulRules property: Property statefulRules. + * + * @param statefulRules the statefulRules value to set. + * @return the RulesSource object itself. + */ + public RulesSource withStatefulRules(List statefulRules) { + this.statefulRules = statefulRules; + return this; + } + + /** + * Get the statelessRulesAndCustomActions property: Property statelessRulesAndCustomActions. + * + * @return the statelessRulesAndCustomActions value. + */ + public StatelessRulesAndCustomActions statelessRulesAndCustomActions() { + return this.statelessRulesAndCustomActions; + } + + /** + * Set the statelessRulesAndCustomActions property: Property statelessRulesAndCustomActions. + * + * @param statelessRulesAndCustomActions the statelessRulesAndCustomActions value to set. + * @return the RulesSource object itself. + */ + public RulesSource + withStatelessRulesAndCustomActions(StatelessRulesAndCustomActions statelessRulesAndCustomActions) { + this.statelessRulesAndCustomActions = statelessRulesAndCustomActions; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (rulesSourceList() != null) { + rulesSourceList().validate(); + } + if (statefulRules() != null) { + statefulRules().forEach(e -> e.validate()); + } + if (statelessRulesAndCustomActions() != null) { + statelessRulesAndCustomActions().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("rulesSourceList", this.rulesSourceList); + jsonWriter.writeStringField("rulesString", this.rulesString); + jsonWriter.writeArrayField("statefulRules", this.statefulRules, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeJsonField("statelessRulesAndCustomActions", this.statelessRulesAndCustomActions); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of RulesSource from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of RulesSource if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the RulesSource. + */ + public static RulesSource fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + RulesSource deserializedRulesSource = new RulesSource(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("rulesSourceList".equals(fieldName)) { + deserializedRulesSource.rulesSourceList = RulesSourceList.fromJson(reader); + } else if ("rulesString".equals(fieldName)) { + deserializedRulesSource.rulesString = reader.getString(); + } else if ("statefulRules".equals(fieldName)) { + List statefulRules = reader.readArray(reader1 -> StatefulRule.fromJson(reader1)); + deserializedRulesSource.statefulRules = statefulRules; + } else if ("statelessRulesAndCustomActions".equals(fieldName)) { + deserializedRulesSource.statelessRulesAndCustomActions + = StatelessRulesAndCustomActions.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedRulesSource; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/RulesSourceList.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/RulesSourceList.java new file mode 100644 index 000000000000..a0cf22b727fc --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/RulesSourceList.java @@ -0,0 +1,154 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Definition of RulesSourceList. + */ +@Fluent +public final class RulesSourceList implements JsonSerializable { + /* + * Property generatedRulesType + */ + private RulesSourceListGeneratedRulesType generatedRulesType; + + /* + * Property targetTypes + */ + private List targetTypes; + + /* + * Property targets + */ + private List targets; + + /** + * Creates an instance of RulesSourceList class. + */ + public RulesSourceList() { + } + + /** + * Get the generatedRulesType property: Property generatedRulesType. + * + * @return the generatedRulesType value. + */ + public RulesSourceListGeneratedRulesType generatedRulesType() { + return this.generatedRulesType; + } + + /** + * Set the generatedRulesType property: Property generatedRulesType. + * + * @param generatedRulesType the generatedRulesType value to set. + * @return the RulesSourceList object itself. + */ + public RulesSourceList withGeneratedRulesType(RulesSourceListGeneratedRulesType generatedRulesType) { + this.generatedRulesType = generatedRulesType; + return this; + } + + /** + * Get the targetTypes property: Property targetTypes. + * + * @return the targetTypes value. + */ + public List targetTypes() { + return this.targetTypes; + } + + /** + * Set the targetTypes property: Property targetTypes. + * + * @param targetTypes the targetTypes value to set. + * @return the RulesSourceList object itself. + */ + public RulesSourceList withTargetTypes(List targetTypes) { + this.targetTypes = targetTypes; + return this; + } + + /** + * Get the targets property: Property targets. + * + * @return the targets value. + */ + public List targets() { + return this.targets; + } + + /** + * Set the targets property: Property targets. + * + * @param targets the targets value to set. + * @return the RulesSourceList object itself. + */ + public RulesSourceList withTargets(List targets) { + this.targets = targets; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("generatedRulesType", + this.generatedRulesType == null ? null : this.generatedRulesType.toString()); + jsonWriter.writeArrayField("targetTypes", this.targetTypes, (writer, element) -> writer.writeString(element)); + jsonWriter.writeArrayField("targets", this.targets, (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of RulesSourceList from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of RulesSourceList if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the RulesSourceList. + */ + public static RulesSourceList fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + RulesSourceList deserializedRulesSourceList = new RulesSourceList(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("generatedRulesType".equals(fieldName)) { + deserializedRulesSourceList.generatedRulesType + = RulesSourceListGeneratedRulesType.fromString(reader.getString()); + } else if ("targetTypes".equals(fieldName)) { + List targetTypes = reader.readArray(reader1 -> reader1.getString()); + deserializedRulesSourceList.targetTypes = targetTypes; + } else if ("targets".equals(fieldName)) { + List targets = reader.readArray(reader1 -> reader1.getString()); + deserializedRulesSourceList.targets = targets; + } else { + reader.skipChildren(); + } + } + + return deserializedRulesSourceList; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/RulesSourceListGeneratedRulesType.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/RulesSourceListGeneratedRulesType.java new file mode 100644 index 000000000000..8ce52c316fd3 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/RulesSourceListGeneratedRulesType.java @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * RulesSourceListGeneratedRulesType enum. + */ +public final class RulesSourceListGeneratedRulesType extends ExpandableStringEnum { + /** + * Static value ALLOWLIST for RulesSourceListGeneratedRulesType. + */ + public static final RulesSourceListGeneratedRulesType ALLOWLIST = fromString("ALLOWLIST"); + + /** + * Static value DENYLIST for RulesSourceListGeneratedRulesType. + */ + public static final RulesSourceListGeneratedRulesType DENYLIST = fromString("DENYLIST"); + + /** + * Creates a new instance of RulesSourceListGeneratedRulesType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public RulesSourceListGeneratedRulesType() { + } + + /** + * Creates or finds a RulesSourceListGeneratedRulesType from its string representation. + * + * @param name a name to look for. + * @return the corresponding RulesSourceListGeneratedRulesType. + */ + public static RulesSourceListGeneratedRulesType fromString(String name) { + return fromString(name, RulesSourceListGeneratedRulesType.class); + } + + /** + * Gets known RulesSourceListGeneratedRulesType values. + * + * @return known RulesSourceListGeneratedRulesType values. + */ + public static Collection values() { + return values(RulesSourceListGeneratedRulesType.class); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/RuntimeManagementConfig.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/RuntimeManagementConfig.java new file mode 100644 index 000000000000..85bb56e39856 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/RuntimeManagementConfig.java @@ -0,0 +1,162 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of RuntimeManagementConfig. + */ +@Fluent +public final class RuntimeManagementConfig implements JsonSerializable { + /* + * The ARN of the runtime version you want the function to use. This is only required if you're using the *Manual* + * runtime update mode. + */ + private String runtimeVersionArn; + + /* + * Specify the runtime update mode. + *Auto (default)* - Automatically update to the most recent and secure runtime + * version using a [Two-phase runtime version + * rollout](https://docs.aws.amazon.com/lambda/latest/dg/runtimes-update.html#runtime-management-two-phase). This is + * the best choice for most customers to ensure they always benefit from runtime updates. + *FunctionUpdate* - LAM + * updates the runtime of you function to the most recent and secure runtime version when you update your function. + * This approach synchronizes runtime updates with function deployments, giving you control over when runtime + * updates are applied and allowing you to detect and mitigate rare runtime update incompatibilities early. When + * using this setting, you need to regularly update your functions to keep their runtime up-to-date. + *Manual* - + * You specify a runtime version in your function configuration. The function will use this runtime version + * indefinitely. In the rare case where a new runtime version is incompatible with an existing function, this allows + * you to roll back your function to an earlier runtime version. For more information, see [Roll back a runtime + * version](https://docs.aws.amazon.com/lambda/latest/dg/runtimes-update.html#runtime-management-rollback). *Valid + * Values*: ``Auto`` | ``FunctionUpdate`` | ``Manual`` + */ + private RuntimeManagementConfigUpdateRuntimeOn updateRuntimeOn; + + /** + * Creates an instance of RuntimeManagementConfig class. + */ + public RuntimeManagementConfig() { + } + + /** + * Get the runtimeVersionArn property: The ARN of the runtime version you want the function to use. This is only + * required if you're using the *Manual* runtime update mode. + * + * @return the runtimeVersionArn value. + */ + public String runtimeVersionArn() { + return this.runtimeVersionArn; + } + + /** + * Set the runtimeVersionArn property: The ARN of the runtime version you want the function to use. This is only + * required if you're using the *Manual* runtime update mode. + * + * @param runtimeVersionArn the runtimeVersionArn value to set. + * @return the RuntimeManagementConfig object itself. + */ + public RuntimeManagementConfig withRuntimeVersionArn(String runtimeVersionArn) { + this.runtimeVersionArn = runtimeVersionArn; + return this; + } + + /** + * Get the updateRuntimeOn property: Specify the runtime update mode. + *Auto (default)* - Automatically update to + * the most recent and secure runtime version using a [Two-phase runtime version + * rollout](https://docs.aws.amazon.com/lambda/latest/dg/runtimes-update.html#runtime-management-two-phase). This is + * the best choice for most customers to ensure they always benefit from runtime updates. + *FunctionUpdate* - LAM + * updates the runtime of you function to the most recent and secure runtime version when you update your function. + * This approach synchronizes runtime updates with function deployments, giving you control over when runtime + * updates are applied and allowing you to detect and mitigate rare runtime update incompatibilities early. When + * using this setting, you need to regularly update your functions to keep their runtime up-to-date. + *Manual* - + * You specify a runtime version in your function configuration. The function will use this runtime version + * indefinitely. In the rare case where a new runtime version is incompatible with an existing function, this allows + * you to roll back your function to an earlier runtime version. For more information, see [Roll back a runtime + * version](https://docs.aws.amazon.com/lambda/latest/dg/runtimes-update.html#runtime-management-rollback). *Valid + * Values*: ``Auto`` | ``FunctionUpdate`` | ``Manual``. + * + * @return the updateRuntimeOn value. + */ + public RuntimeManagementConfigUpdateRuntimeOn updateRuntimeOn() { + return this.updateRuntimeOn; + } + + /** + * Set the updateRuntimeOn property: Specify the runtime update mode. + *Auto (default)* - Automatically update to + * the most recent and secure runtime version using a [Two-phase runtime version + * rollout](https://docs.aws.amazon.com/lambda/latest/dg/runtimes-update.html#runtime-management-two-phase). This is + * the best choice for most customers to ensure they always benefit from runtime updates. + *FunctionUpdate* - LAM + * updates the runtime of you function to the most recent and secure runtime version when you update your function. + * This approach synchronizes runtime updates with function deployments, giving you control over when runtime + * updates are applied and allowing you to detect and mitigate rare runtime update incompatibilities early. When + * using this setting, you need to regularly update your functions to keep their runtime up-to-date. + *Manual* - + * You specify a runtime version in your function configuration. The function will use this runtime version + * indefinitely. In the rare case where a new runtime version is incompatible with an existing function, this allows + * you to roll back your function to an earlier runtime version. For more information, see [Roll back a runtime + * version](https://docs.aws.amazon.com/lambda/latest/dg/runtimes-update.html#runtime-management-rollback). *Valid + * Values*: ``Auto`` | ``FunctionUpdate`` | ``Manual``. + * + * @param updateRuntimeOn the updateRuntimeOn value to set. + * @return the RuntimeManagementConfig object itself. + */ + public RuntimeManagementConfig withUpdateRuntimeOn(RuntimeManagementConfigUpdateRuntimeOn updateRuntimeOn) { + this.updateRuntimeOn = updateRuntimeOn; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("runtimeVersionArn", this.runtimeVersionArn); + jsonWriter.writeStringField("updateRuntimeOn", + this.updateRuntimeOn == null ? null : this.updateRuntimeOn.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of RuntimeManagementConfig from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of RuntimeManagementConfig if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the RuntimeManagementConfig. + */ + public static RuntimeManagementConfig fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + RuntimeManagementConfig deserializedRuntimeManagementConfig = new RuntimeManagementConfig(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("runtimeVersionArn".equals(fieldName)) { + deserializedRuntimeManagementConfig.runtimeVersionArn = reader.getString(); + } else if ("updateRuntimeOn".equals(fieldName)) { + deserializedRuntimeManagementConfig.updateRuntimeOn + = RuntimeManagementConfigUpdateRuntimeOn.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedRuntimeManagementConfig; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/RuntimeManagementConfigUpdateRuntimeOn.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/RuntimeManagementConfigUpdateRuntimeOn.java new file mode 100644 index 000000000000..528100d78b9e --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/RuntimeManagementConfigUpdateRuntimeOn.java @@ -0,0 +1,57 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * RuntimeManagementConfigUpdateRuntimeOn enum. + */ +public final class RuntimeManagementConfigUpdateRuntimeOn + extends ExpandableStringEnum { + /** + * Static value Auto for RuntimeManagementConfigUpdateRuntimeOn. + */ + public static final RuntimeManagementConfigUpdateRuntimeOn AUTO = fromString("Auto"); + + /** + * Static value FunctionUpdate for RuntimeManagementConfigUpdateRuntimeOn. + */ + public static final RuntimeManagementConfigUpdateRuntimeOn FUNCTION_UPDATE = fromString("FunctionUpdate"); + + /** + * Static value Manual for RuntimeManagementConfigUpdateRuntimeOn. + */ + public static final RuntimeManagementConfigUpdateRuntimeOn MANUAL = fromString("Manual"); + + /** + * Creates a new instance of RuntimeManagementConfigUpdateRuntimeOn value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public RuntimeManagementConfigUpdateRuntimeOn() { + } + + /** + * Creates or finds a RuntimeManagementConfigUpdateRuntimeOn from its string representation. + * + * @param name a name to look for. + * @return the corresponding RuntimeManagementConfigUpdateRuntimeOn. + */ + public static RuntimeManagementConfigUpdateRuntimeOn fromString(String name) { + return fromString(name, RuntimeManagementConfigUpdateRuntimeOn.class); + } + + /** + * Gets known RuntimeManagementConfigUpdateRuntimeOn values. + * + * @return known RuntimeManagementConfigUpdateRuntimeOn values. + */ + public static Collection values() { + return values(RuntimeManagementConfigUpdateRuntimeOn.class); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/RuntimePlatform.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/RuntimePlatform.java new file mode 100644 index 000000000000..d3b747b717a9 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/RuntimePlatform.java @@ -0,0 +1,126 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of RuntimePlatform. + */ +@Fluent +public final class RuntimePlatform implements JsonSerializable { + /* + * The CPU architecture. You can run your Linux tasks on an ARM-based platform by setting the value to ``ARM64``. + * This option is available for tasks that run on Linux Amazon EC2 instance or Linux containers on Fargate. + */ + private String cpuArchitecture; + + /* + * The operating system. + */ + private String operatingSystemFamily; + + /** + * Creates an instance of RuntimePlatform class. + */ + public RuntimePlatform() { + } + + /** + * Get the cpuArchitecture property: The CPU architecture. You can run your Linux tasks on an ARM-based platform by + * setting the value to ``ARM64``. This option is available for tasks that run on Linux Amazon EC2 instance or Linux + * containers on Fargate. + * + * @return the cpuArchitecture value. + */ + public String cpuArchitecture() { + return this.cpuArchitecture; + } + + /** + * Set the cpuArchitecture property: The CPU architecture. You can run your Linux tasks on an ARM-based platform by + * setting the value to ``ARM64``. This option is available for tasks that run on Linux Amazon EC2 instance or Linux + * containers on Fargate. + * + * @param cpuArchitecture the cpuArchitecture value to set. + * @return the RuntimePlatform object itself. + */ + public RuntimePlatform withCpuArchitecture(String cpuArchitecture) { + this.cpuArchitecture = cpuArchitecture; + return this; + } + + /** + * Get the operatingSystemFamily property: The operating system. + * + * @return the operatingSystemFamily value. + */ + public String operatingSystemFamily() { + return this.operatingSystemFamily; + } + + /** + * Set the operatingSystemFamily property: The operating system. + * + * @param operatingSystemFamily the operatingSystemFamily value to set. + * @return the RuntimePlatform object itself. + */ + public RuntimePlatform withOperatingSystemFamily(String operatingSystemFamily) { + this.operatingSystemFamily = operatingSystemFamily; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("cpuArchitecture", this.cpuArchitecture); + jsonWriter.writeStringField("operatingSystemFamily", this.operatingSystemFamily); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of RuntimePlatform from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of RuntimePlatform if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the RuntimePlatform. + */ + public static RuntimePlatform fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + RuntimePlatform deserializedRuntimePlatform = new RuntimePlatform(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("cpuArchitecture".equals(fieldName)) { + deserializedRuntimePlatform.cpuArchitecture = reader.getString(); + } else if ("operatingSystemFamily".equals(fieldName)) { + deserializedRuntimePlatform.operatingSystemFamily = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedRuntimePlatform; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/S3AccessPoint.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/S3AccessPoint.java new file mode 100644 index 000000000000..d81b9ec6f116 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/S3AccessPoint.java @@ -0,0 +1,252 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.awsconnector.fluent.models.S3AccessPointInner; +import java.util.Map; + +/** + * An immutable client-side representation of S3AccessPoint. + */ +public interface S3AccessPoint { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the location property: The geo-location where the resource lives. + * + * @return the location value. + */ + String location(); + + /** + * Gets the tags property: Resource tags. + * + * @return the tags value. + */ + Map tags(); + + /** + * Gets the properties property: The resource-specific properties for this resource. + * + * @return the properties value. + */ + S3AccessPointProperties properties(); + + /** + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the region of the resource. + * + * @return the region of the resource. + */ + Region region(); + + /** + * Gets the name of the resource region. + * + * @return the name of the resource region. + */ + String regionName(); + + /** + * Gets the name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + + /** + * Gets the inner com.azure.resourcemanager.awsconnector.fluent.models.S3AccessPointInner object. + * + * @return the inner object. + */ + S3AccessPointInner innerModel(); + + /** + * The entirety of the S3AccessPoint definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithLocation, + DefinitionStages.WithResourceGroup, DefinitionStages.WithCreate { + } + + /** + * The S3AccessPoint definition stages. + */ + interface DefinitionStages { + /** + * The first stage of the S3AccessPoint definition. + */ + interface Blank extends WithLocation { + } + + /** + * The stage of the S3AccessPoint definition allowing to specify location. + */ + interface WithLocation { + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithResourceGroup withRegion(Region location); + + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithResourceGroup withRegion(String location); + } + + /** + * The stage of the S3AccessPoint definition allowing to specify parent resource. + */ + interface WithResourceGroup { + /** + * Specifies resourceGroupName. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @return the next definition stage. + */ + WithCreate withExistingResourceGroup(String resourceGroupName); + } + + /** + * The stage of the S3AccessPoint 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.WithProperties { + /** + * Executes the create request. + * + * @return the created resource. + */ + S3AccessPoint create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + S3AccessPoint create(Context context); + } + + /** + * The stage of the S3AccessPoint definition allowing to specify tags. + */ + interface WithTags { + /** + * Specifies the tags property: Resource tags.. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + WithCreate withTags(Map tags); + } + + /** + * The stage of the S3AccessPoint definition allowing to specify properties. + */ + interface WithProperties { + /** + * Specifies the properties property: The resource-specific properties for this resource.. + * + * @param properties The resource-specific properties for this resource. + * @return the next definition stage. + */ + WithCreate withProperties(S3AccessPointProperties properties); + } + } + + /** + * Begins update for the S3AccessPoint resource. + * + * @return the stage of resource update. + */ + S3AccessPoint.Update update(); + + /** + * The template for S3AccessPoint update. + */ + interface Update extends UpdateStages.WithTags { + /** + * Executes the update request. + * + * @return the updated resource. + */ + S3AccessPoint apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + S3AccessPoint apply(Context context); + } + + /** + * The S3AccessPoint update stages. + */ + interface UpdateStages { + /** + * The stage of the S3AccessPoint update allowing to specify tags. + */ + interface WithTags { + /** + * Specifies the tags property: Resource tags.. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + Update withTags(Map tags); + } + } + + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + S3AccessPoint refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + S3AccessPoint refresh(Context context); +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/S3AccessPointListResult.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/S3AccessPointListResult.java new file mode 100644 index 000000000000..55b10723abcf --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/S3AccessPointListResult.java @@ -0,0 +1,134 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.awsconnector.fluent.models.S3AccessPointInner; +import java.io.IOException; +import java.util.List; + +/** + * The response of a S3AccessPoint list operation. + */ +@Fluent +public final class S3AccessPointListResult implements JsonSerializable { + /* + * The S3AccessPoint items on this page + */ + private List value; + + /* + * The link to the next page of items + */ + private String nextLink; + + /** + * Creates an instance of S3AccessPointListResult class. + */ + public S3AccessPointListResult() { + } + + /** + * Get the value property: The S3AccessPoint items on this page. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The S3AccessPoint items on this page. + * + * @param value the value value to set. + * @return the S3AccessPointListResult object itself. + */ + public S3AccessPointListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The link to the next page of items. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: The link to the next page of items. + * + * @param nextLink the nextLink value to set. + * @return the S3AccessPointListResult object itself. + */ + public S3AccessPointListResult withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property value in model S3AccessPointListResult")); + } else { + value().forEach(e -> e.validate()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(S3AccessPointListResult.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("nextLink", this.nextLink); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of S3AccessPointListResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of S3AccessPointListResult if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the S3AccessPointListResult. + */ + public static S3AccessPointListResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + S3AccessPointListResult deserializedS3AccessPointListResult = new S3AccessPointListResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value = reader.readArray(reader1 -> S3AccessPointInner.fromJson(reader1)); + deserializedS3AccessPointListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedS3AccessPointListResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedS3AccessPointListResult; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/S3AccessPointProperties.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/S3AccessPointProperties.java new file mode 100644 index 000000000000..103e297cc2fd --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/S3AccessPointProperties.java @@ -0,0 +1,311 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.Map; + +/** + * Definition of S3AccessPoint. + */ +@Fluent +public final class S3AccessPointProperties implements JsonSerializable { + /* + * AWS Properties + */ + private AwsS3AccessPointProperties awsProperties; + + /* + * Public Cloud Connectors Resource ID + */ + private String publicCloudConnectorsResourceId; + + /* + * AWS Account ID + */ + private String awsAccountId; + + /* + * Amazon Resource Name (ARN) + */ + private String arn; + + /* + * Public Cloud Resource Name + */ + private String publicCloudResourceName; + + /* + * AWS Source Schema + */ + private String awsSourceSchema; + + /* + * AWS Region + */ + private String awsRegion; + + /* + * AWS Tags + */ + private Map awsTags; + + /* + * The status of the last operation. + */ + private ProvisioningState provisioningState; + + /** + * Creates an instance of S3AccessPointProperties class. + */ + public S3AccessPointProperties() { + } + + /** + * Get the awsProperties property: AWS Properties. + * + * @return the awsProperties value. + */ + public AwsS3AccessPointProperties awsProperties() { + return this.awsProperties; + } + + /** + * Set the awsProperties property: AWS Properties. + * + * @param awsProperties the awsProperties value to set. + * @return the S3AccessPointProperties object itself. + */ + public S3AccessPointProperties withAwsProperties(AwsS3AccessPointProperties awsProperties) { + this.awsProperties = awsProperties; + return this; + } + + /** + * Get the publicCloudConnectorsResourceId property: Public Cloud Connectors Resource ID. + * + * @return the publicCloudConnectorsResourceId value. + */ + public String publicCloudConnectorsResourceId() { + return this.publicCloudConnectorsResourceId; + } + + /** + * Set the publicCloudConnectorsResourceId property: Public Cloud Connectors Resource ID. + * + * @param publicCloudConnectorsResourceId the publicCloudConnectorsResourceId value to set. + * @return the S3AccessPointProperties object itself. + */ + public S3AccessPointProperties withPublicCloudConnectorsResourceId(String publicCloudConnectorsResourceId) { + this.publicCloudConnectorsResourceId = publicCloudConnectorsResourceId; + return this; + } + + /** + * Get the awsAccountId property: AWS Account ID. + * + * @return the awsAccountId value. + */ + public String awsAccountId() { + return this.awsAccountId; + } + + /** + * Set the awsAccountId property: AWS Account ID. + * + * @param awsAccountId the awsAccountId value to set. + * @return the S3AccessPointProperties object itself. + */ + public S3AccessPointProperties withAwsAccountId(String awsAccountId) { + this.awsAccountId = awsAccountId; + return this; + } + + /** + * Get the arn property: Amazon Resource Name (ARN). + * + * @return the arn value. + */ + public String arn() { + return this.arn; + } + + /** + * Set the arn property: Amazon Resource Name (ARN). + * + * @param arn the arn value to set. + * @return the S3AccessPointProperties object itself. + */ + public S3AccessPointProperties withArn(String arn) { + this.arn = arn; + return this; + } + + /** + * Get the publicCloudResourceName property: Public Cloud Resource Name. + * + * @return the publicCloudResourceName value. + */ + public String publicCloudResourceName() { + return this.publicCloudResourceName; + } + + /** + * Set the publicCloudResourceName property: Public Cloud Resource Name. + * + * @param publicCloudResourceName the publicCloudResourceName value to set. + * @return the S3AccessPointProperties object itself. + */ + public S3AccessPointProperties withPublicCloudResourceName(String publicCloudResourceName) { + this.publicCloudResourceName = publicCloudResourceName; + return this; + } + + /** + * Get the awsSourceSchema property: AWS Source Schema. + * + * @return the awsSourceSchema value. + */ + public String awsSourceSchema() { + return this.awsSourceSchema; + } + + /** + * Set the awsSourceSchema property: AWS Source Schema. + * + * @param awsSourceSchema the awsSourceSchema value to set. + * @return the S3AccessPointProperties object itself. + */ + public S3AccessPointProperties withAwsSourceSchema(String awsSourceSchema) { + this.awsSourceSchema = awsSourceSchema; + return this; + } + + /** + * Get the awsRegion property: AWS Region. + * + * @return the awsRegion value. + */ + public String awsRegion() { + return this.awsRegion; + } + + /** + * Set the awsRegion property: AWS Region. + * + * @param awsRegion the awsRegion value to set. + * @return the S3AccessPointProperties object itself. + */ + public S3AccessPointProperties withAwsRegion(String awsRegion) { + this.awsRegion = awsRegion; + return this; + } + + /** + * Get the awsTags property: AWS Tags. + * + * @return the awsTags value. + */ + public Map awsTags() { + return this.awsTags; + } + + /** + * Set the awsTags property: AWS Tags. + * + * @param awsTags the awsTags value to set. + * @return the S3AccessPointProperties object itself. + */ + public S3AccessPointProperties withAwsTags(Map awsTags) { + this.awsTags = awsTags; + return this; + } + + /** + * Get the provisioningState property: The status of the last operation. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (awsProperties() != null) { + awsProperties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("awsProperties", this.awsProperties); + jsonWriter.writeStringField("publicCloudConnectorsResourceId", this.publicCloudConnectorsResourceId); + jsonWriter.writeStringField("awsAccountId", this.awsAccountId); + jsonWriter.writeStringField("arn", this.arn); + jsonWriter.writeStringField("publicCloudResourceName", this.publicCloudResourceName); + jsonWriter.writeStringField("awsSourceSchema", this.awsSourceSchema); + jsonWriter.writeStringField("awsRegion", this.awsRegion); + jsonWriter.writeMapField("awsTags", this.awsTags, (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of S3AccessPointProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of S3AccessPointProperties if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the S3AccessPointProperties. + */ + public static S3AccessPointProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + S3AccessPointProperties deserializedS3AccessPointProperties = new S3AccessPointProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("awsProperties".equals(fieldName)) { + deserializedS3AccessPointProperties.awsProperties = AwsS3AccessPointProperties.fromJson(reader); + } else if ("publicCloudConnectorsResourceId".equals(fieldName)) { + deserializedS3AccessPointProperties.publicCloudConnectorsResourceId = reader.getString(); + } else if ("awsAccountId".equals(fieldName)) { + deserializedS3AccessPointProperties.awsAccountId = reader.getString(); + } else if ("arn".equals(fieldName)) { + deserializedS3AccessPointProperties.arn = reader.getString(); + } else if ("publicCloudResourceName".equals(fieldName)) { + deserializedS3AccessPointProperties.publicCloudResourceName = reader.getString(); + } else if ("awsSourceSchema".equals(fieldName)) { + deserializedS3AccessPointProperties.awsSourceSchema = reader.getString(); + } else if ("awsRegion".equals(fieldName)) { + deserializedS3AccessPointProperties.awsRegion = reader.getString(); + } else if ("awsTags".equals(fieldName)) { + Map awsTags = reader.readMap(reader1 -> reader1.getString()); + deserializedS3AccessPointProperties.awsTags = awsTags; + } else if ("provisioningState".equals(fieldName)) { + deserializedS3AccessPointProperties.provisioningState + = ProvisioningState.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedS3AccessPointProperties; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/S3AccessPointTagsUpdate.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/S3AccessPointTagsUpdate.java new file mode 100644 index 000000000000..6d376853e2f0 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/S3AccessPointTagsUpdate.java @@ -0,0 +1,95 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.Map; + +/** + * The type used for updating tags in S3AccessPoint resources. + */ +@Fluent +public final class S3AccessPointTagsUpdate implements JsonSerializable { + /* + * Resource tags. + */ + private Map tags; + + /** + * Creates an instance of S3AccessPointTagsUpdate class. + */ + public S3AccessPointTagsUpdate() { + } + + /** + * Get the tags property: Resource tags. + * + * @return the tags value. + */ + public Map tags() { + return this.tags; + } + + /** + * Set the tags property: Resource tags. + * + * @param tags the tags value to set. + * @return the S3AccessPointTagsUpdate object itself. + */ + public S3AccessPointTagsUpdate withTags(Map tags) { + this.tags = tags; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeMapField("tags", this.tags, (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of S3AccessPointTagsUpdate from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of S3AccessPointTagsUpdate if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the S3AccessPointTagsUpdate. + */ + public static S3AccessPointTagsUpdate fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + S3AccessPointTagsUpdate deserializedS3AccessPointTagsUpdate = new S3AccessPointTagsUpdate(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedS3AccessPointTagsUpdate.tags = tags; + } else { + reader.skipChildren(); + } + } + + return deserializedS3AccessPointTagsUpdate; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/S3AccessPoints.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/S3AccessPoints.java new file mode 100644 index 000000000000..df841620d197 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/S3AccessPoints.java @@ -0,0 +1,157 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** + * Resource collection API of S3AccessPoints. + */ +public interface S3AccessPoints { + /** + * List S3AccessPoint resources by subscription ID. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a S3AccessPoint list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable list(); + + /** + * List S3AccessPoint resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a S3AccessPoint list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable list(Context context); + + /** + * List S3AccessPoint resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a S3AccessPoint list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * List S3AccessPoint resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a S3AccessPoint list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Get a S3AccessPoint. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of S3AccessPoint. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a S3AccessPoint along with {@link Response}. + */ + Response getByResourceGroupWithResponse(String resourceGroupName, String name, Context context); + + /** + * Get a S3AccessPoint. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of S3AccessPoint. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a S3AccessPoint. + */ + S3AccessPoint getByResourceGroup(String resourceGroupName, String name); + + /** + * Delete a S3AccessPoint. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of S3AccessPoint. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByResourceGroup(String resourceGroupName, String name); + + /** + * Delete a S3AccessPoint. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of S3AccessPoint. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String name, Context context); + + /** + * Get a S3AccessPoint. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a S3AccessPoint along with {@link Response}. + */ + S3AccessPoint getById(String id); + + /** + * Get a S3AccessPoint. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a S3AccessPoint along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Delete a S3AccessPoint. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteById(String id); + + /** + * Delete a S3AccessPoint. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new S3AccessPoint resource. + * + * @param name resource name. + * @return the first stage of the new S3AccessPoint definition. + */ + S3AccessPoint.DefinitionStages.Blank define(String name); +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/S3Bucket.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/S3Bucket.java new file mode 100644 index 000000000000..8dc1b639f5d0 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/S3Bucket.java @@ -0,0 +1,252 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.awsconnector.fluent.models.S3BucketInner; +import java.util.Map; + +/** + * An immutable client-side representation of S3Bucket. + */ +public interface S3Bucket { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the location property: The geo-location where the resource lives. + * + * @return the location value. + */ + String location(); + + /** + * Gets the tags property: Resource tags. + * + * @return the tags value. + */ + Map tags(); + + /** + * Gets the properties property: The resource-specific properties for this resource. + * + * @return the properties value. + */ + S3BucketProperties properties(); + + /** + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the region of the resource. + * + * @return the region of the resource. + */ + Region region(); + + /** + * Gets the name of the resource region. + * + * @return the name of the resource region. + */ + String regionName(); + + /** + * Gets the name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + + /** + * Gets the inner com.azure.resourcemanager.awsconnector.fluent.models.S3BucketInner object. + * + * @return the inner object. + */ + S3BucketInner innerModel(); + + /** + * The entirety of the S3Bucket definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithLocation, + DefinitionStages.WithResourceGroup, DefinitionStages.WithCreate { + } + + /** + * The S3Bucket definition stages. + */ + interface DefinitionStages { + /** + * The first stage of the S3Bucket definition. + */ + interface Blank extends WithLocation { + } + + /** + * The stage of the S3Bucket definition allowing to specify location. + */ + interface WithLocation { + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithResourceGroup withRegion(Region location); + + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithResourceGroup withRegion(String location); + } + + /** + * The stage of the S3Bucket definition allowing to specify parent resource. + */ + interface WithResourceGroup { + /** + * Specifies resourceGroupName. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @return the next definition stage. + */ + WithCreate withExistingResourceGroup(String resourceGroupName); + } + + /** + * The stage of the S3Bucket 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.WithProperties { + /** + * Executes the create request. + * + * @return the created resource. + */ + S3Bucket create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + S3Bucket create(Context context); + } + + /** + * The stage of the S3Bucket definition allowing to specify tags. + */ + interface WithTags { + /** + * Specifies the tags property: Resource tags.. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + WithCreate withTags(Map tags); + } + + /** + * The stage of the S3Bucket definition allowing to specify properties. + */ + interface WithProperties { + /** + * Specifies the properties property: The resource-specific properties for this resource.. + * + * @param properties The resource-specific properties for this resource. + * @return the next definition stage. + */ + WithCreate withProperties(S3BucketProperties properties); + } + } + + /** + * Begins update for the S3Bucket resource. + * + * @return the stage of resource update. + */ + S3Bucket.Update update(); + + /** + * The template for S3Bucket update. + */ + interface Update extends UpdateStages.WithTags { + /** + * Executes the update request. + * + * @return the updated resource. + */ + S3Bucket apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + S3Bucket apply(Context context); + } + + /** + * The S3Bucket update stages. + */ + interface UpdateStages { + /** + * The stage of the S3Bucket update allowing to specify tags. + */ + interface WithTags { + /** + * Specifies the tags property: Resource tags.. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + Update withTags(Map tags); + } + } + + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + S3Bucket refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + S3Bucket refresh(Context context); +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/S3BucketCriteriaForJob.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/S3BucketCriteriaForJob.java new file mode 100644 index 000000000000..20409f303a9b --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/S3BucketCriteriaForJob.java @@ -0,0 +1,131 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of S3BucketCriteriaForJob. + */ +@Fluent +public final class S3BucketCriteriaForJob implements JsonSerializable { + /* + *

The property- and tag-based conditions that determine which buckets to exclude from the job.

+ */ + private CriteriaBlockForJob excludes; + + /* + *

The property- and tag-based conditions that determine which buckets to include in the job.

+ */ + private CriteriaBlockForJob includes; + + /** + * Creates an instance of S3BucketCriteriaForJob class. + */ + public S3BucketCriteriaForJob() { + } + + /** + * Get the excludes property: <p>The property- and tag-based conditions that determine which buckets to + * exclude from the job.</p>. + * + * @return the excludes value. + */ + public CriteriaBlockForJob excludes() { + return this.excludes; + } + + /** + * Set the excludes property: <p>The property- and tag-based conditions that determine which buckets to + * exclude from the job.</p>. + * + * @param excludes the excludes value to set. + * @return the S3BucketCriteriaForJob object itself. + */ + public S3BucketCriteriaForJob withExcludes(CriteriaBlockForJob excludes) { + this.excludes = excludes; + return this; + } + + /** + * Get the includes property: <p>The property- and tag-based conditions that determine which buckets to + * include in the job.</p>. + * + * @return the includes value. + */ + public CriteriaBlockForJob includes() { + return this.includes; + } + + /** + * Set the includes property: <p>The property- and tag-based conditions that determine which buckets to + * include in the job.</p>. + * + * @param includes the includes value to set. + * @return the S3BucketCriteriaForJob object itself. + */ + public S3BucketCriteriaForJob withIncludes(CriteriaBlockForJob includes) { + this.includes = includes; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (excludes() != null) { + excludes().validate(); + } + if (includes() != null) { + includes().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("excludes", this.excludes); + jsonWriter.writeJsonField("includes", this.includes); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of S3BucketCriteriaForJob from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of S3BucketCriteriaForJob if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the S3BucketCriteriaForJob. + */ + public static S3BucketCriteriaForJob fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + S3BucketCriteriaForJob deserializedS3BucketCriteriaForJob = new S3BucketCriteriaForJob(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("excludes".equals(fieldName)) { + deserializedS3BucketCriteriaForJob.excludes = CriteriaBlockForJob.fromJson(reader); + } else if ("includes".equals(fieldName)) { + deserializedS3BucketCriteriaForJob.includes = CriteriaBlockForJob.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedS3BucketCriteriaForJob; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/S3BucketDefinitionForJob.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/S3BucketDefinitionForJob.java new file mode 100644 index 000000000000..704e2102b3d4 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/S3BucketDefinitionForJob.java @@ -0,0 +1,125 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Definition of S3BucketDefinitionForJob. + */ +@Fluent +public final class S3BucketDefinitionForJob implements JsonSerializable { + /* + *

The unique identifier for the Amazon Web Services account that owns the buckets.

+ */ + private String accountId; + + /* + *

An array that lists the names of the buckets.

+ */ + private List buckets; + + /** + * Creates an instance of S3BucketDefinitionForJob class. + */ + public S3BucketDefinitionForJob() { + } + + /** + * Get the accountId property: <p>The unique identifier for the Amazon Web Services account that owns the + * buckets.</p>. + * + * @return the accountId value. + */ + public String accountId() { + return this.accountId; + } + + /** + * Set the accountId property: <p>The unique identifier for the Amazon Web Services account that owns the + * buckets.</p>. + * + * @param accountId the accountId value to set. + * @return the S3BucketDefinitionForJob object itself. + */ + public S3BucketDefinitionForJob withAccountId(String accountId) { + this.accountId = accountId; + return this; + } + + /** + * Get the buckets property: <p>An array that lists the names of the buckets.</p>. + * + * @return the buckets value. + */ + public List buckets() { + return this.buckets; + } + + /** + * Set the buckets property: <p>An array that lists the names of the buckets.</p>. + * + * @param buckets the buckets value to set. + * @return the S3BucketDefinitionForJob object itself. + */ + public S3BucketDefinitionForJob withBuckets(List buckets) { + this.buckets = buckets; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("accountId", this.accountId); + jsonWriter.writeArrayField("buckets", this.buckets, (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of S3BucketDefinitionForJob from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of S3BucketDefinitionForJob if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IOException If an error occurs while reading the S3BucketDefinitionForJob. + */ + public static S3BucketDefinitionForJob fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + S3BucketDefinitionForJob deserializedS3BucketDefinitionForJob = new S3BucketDefinitionForJob(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("accountId".equals(fieldName)) { + deserializedS3BucketDefinitionForJob.accountId = reader.getString(); + } else if ("buckets".equals(fieldName)) { + List buckets = reader.readArray(reader1 -> reader1.getString()); + deserializedS3BucketDefinitionForJob.buckets = buckets; + } else { + reader.skipChildren(); + } + } + + return deserializedS3BucketDefinitionForJob; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/S3BucketListResult.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/S3BucketListResult.java new file mode 100644 index 000000000000..a85ebef6cbf5 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/S3BucketListResult.java @@ -0,0 +1,134 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.awsconnector.fluent.models.S3BucketInner; +import java.io.IOException; +import java.util.List; + +/** + * The response of a S3Bucket list operation. + */ +@Fluent +public final class S3BucketListResult implements JsonSerializable { + /* + * The S3Bucket items on this page + */ + private List value; + + /* + * The link to the next page of items + */ + private String nextLink; + + /** + * Creates an instance of S3BucketListResult class. + */ + public S3BucketListResult() { + } + + /** + * Get the value property: The S3Bucket items on this page. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The S3Bucket items on this page. + * + * @param value the value value to set. + * @return the S3BucketListResult object itself. + */ + public S3BucketListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The link to the next page of items. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: The link to the next page of items. + * + * @param nextLink the nextLink value to set. + * @return the S3BucketListResult object itself. + */ + public S3BucketListResult withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property value in model S3BucketListResult")); + } else { + value().forEach(e -> e.validate()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(S3BucketListResult.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("nextLink", this.nextLink); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of S3BucketListResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of S3BucketListResult if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the S3BucketListResult. + */ + public static S3BucketListResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + S3BucketListResult deserializedS3BucketListResult = new S3BucketListResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value = reader.readArray(reader1 -> S3BucketInner.fromJson(reader1)); + deserializedS3BucketListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedS3BucketListResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedS3BucketListResult; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/S3BucketPolicies.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/S3BucketPolicies.java new file mode 100644 index 000000000000..8948555d59c6 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/S3BucketPolicies.java @@ -0,0 +1,157 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** + * Resource collection API of S3BucketPolicies. + */ +public interface S3BucketPolicies { + /** + * List S3BucketPolicy resources by subscription ID. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a S3BucketPolicy list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable list(); + + /** + * List S3BucketPolicy resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a S3BucketPolicy list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable list(Context context); + + /** + * List S3BucketPolicy resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a S3BucketPolicy list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * List S3BucketPolicy resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a S3BucketPolicy list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Get a S3BucketPolicy. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of S3BucketPolicy. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a S3BucketPolicy along with {@link Response}. + */ + Response getByResourceGroupWithResponse(String resourceGroupName, String name, Context context); + + /** + * Get a S3BucketPolicy. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of S3BucketPolicy. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a S3BucketPolicy. + */ + S3BucketPolicy getByResourceGroup(String resourceGroupName, String name); + + /** + * Delete a S3BucketPolicy. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of S3BucketPolicy. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByResourceGroup(String resourceGroupName, String name); + + /** + * Delete a S3BucketPolicy. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of S3BucketPolicy. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String name, Context context); + + /** + * Get a S3BucketPolicy. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a S3BucketPolicy along with {@link Response}. + */ + S3BucketPolicy getById(String id); + + /** + * Get a S3BucketPolicy. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a S3BucketPolicy along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Delete a S3BucketPolicy. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteById(String id); + + /** + * Delete a S3BucketPolicy. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new S3BucketPolicy resource. + * + * @param name resource name. + * @return the first stage of the new S3BucketPolicy definition. + */ + S3BucketPolicy.DefinitionStages.Blank define(String name); +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/S3BucketPolicy.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/S3BucketPolicy.java new file mode 100644 index 000000000000..9b7a2eec1d99 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/S3BucketPolicy.java @@ -0,0 +1,252 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.awsconnector.fluent.models.S3BucketPolicyInner; +import java.util.Map; + +/** + * An immutable client-side representation of S3BucketPolicy. + */ +public interface S3BucketPolicy { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the location property: The geo-location where the resource lives. + * + * @return the location value. + */ + String location(); + + /** + * Gets the tags property: Resource tags. + * + * @return the tags value. + */ + Map tags(); + + /** + * Gets the properties property: The resource-specific properties for this resource. + * + * @return the properties value. + */ + S3BucketPolicyProperties properties(); + + /** + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the region of the resource. + * + * @return the region of the resource. + */ + Region region(); + + /** + * Gets the name of the resource region. + * + * @return the name of the resource region. + */ + String regionName(); + + /** + * Gets the name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + + /** + * Gets the inner com.azure.resourcemanager.awsconnector.fluent.models.S3BucketPolicyInner object. + * + * @return the inner object. + */ + S3BucketPolicyInner innerModel(); + + /** + * The entirety of the S3BucketPolicy definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithLocation, + DefinitionStages.WithResourceGroup, DefinitionStages.WithCreate { + } + + /** + * The S3BucketPolicy definition stages. + */ + interface DefinitionStages { + /** + * The first stage of the S3BucketPolicy definition. + */ + interface Blank extends WithLocation { + } + + /** + * The stage of the S3BucketPolicy definition allowing to specify location. + */ + interface WithLocation { + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithResourceGroup withRegion(Region location); + + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithResourceGroup withRegion(String location); + } + + /** + * The stage of the S3BucketPolicy definition allowing to specify parent resource. + */ + interface WithResourceGroup { + /** + * Specifies resourceGroupName. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @return the next definition stage. + */ + WithCreate withExistingResourceGroup(String resourceGroupName); + } + + /** + * The stage of the S3BucketPolicy 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.WithProperties { + /** + * Executes the create request. + * + * @return the created resource. + */ + S3BucketPolicy create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + S3BucketPolicy create(Context context); + } + + /** + * The stage of the S3BucketPolicy definition allowing to specify tags. + */ + interface WithTags { + /** + * Specifies the tags property: Resource tags.. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + WithCreate withTags(Map tags); + } + + /** + * The stage of the S3BucketPolicy definition allowing to specify properties. + */ + interface WithProperties { + /** + * Specifies the properties property: The resource-specific properties for this resource.. + * + * @param properties The resource-specific properties for this resource. + * @return the next definition stage. + */ + WithCreate withProperties(S3BucketPolicyProperties properties); + } + } + + /** + * Begins update for the S3BucketPolicy resource. + * + * @return the stage of resource update. + */ + S3BucketPolicy.Update update(); + + /** + * The template for S3BucketPolicy update. + */ + interface Update extends UpdateStages.WithTags { + /** + * Executes the update request. + * + * @return the updated resource. + */ + S3BucketPolicy apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + S3BucketPolicy apply(Context context); + } + + /** + * The S3BucketPolicy update stages. + */ + interface UpdateStages { + /** + * The stage of the S3BucketPolicy update allowing to specify tags. + */ + interface WithTags { + /** + * Specifies the tags property: Resource tags.. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + Update withTags(Map tags); + } + } + + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + S3BucketPolicy refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + S3BucketPolicy refresh(Context context); +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/S3BucketPolicyListResult.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/S3BucketPolicyListResult.java new file mode 100644 index 000000000000..621532e53ec3 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/S3BucketPolicyListResult.java @@ -0,0 +1,135 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.awsconnector.fluent.models.S3BucketPolicyInner; +import java.io.IOException; +import java.util.List; + +/** + * The response of a S3BucketPolicy list operation. + */ +@Fluent +public final class S3BucketPolicyListResult implements JsonSerializable { + /* + * The S3BucketPolicy items on this page + */ + private List value; + + /* + * The link to the next page of items + */ + private String nextLink; + + /** + * Creates an instance of S3BucketPolicyListResult class. + */ + public S3BucketPolicyListResult() { + } + + /** + * Get the value property: The S3BucketPolicy items on this page. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The S3BucketPolicy items on this page. + * + * @param value the value value to set. + * @return the S3BucketPolicyListResult object itself. + */ + public S3BucketPolicyListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The link to the next page of items. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: The link to the next page of items. + * + * @param nextLink the nextLink value to set. + * @return the S3BucketPolicyListResult object itself. + */ + public S3BucketPolicyListResult withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property value in model S3BucketPolicyListResult")); + } else { + value().forEach(e -> e.validate()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(S3BucketPolicyListResult.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("nextLink", this.nextLink); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of S3BucketPolicyListResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of S3BucketPolicyListResult if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the S3BucketPolicyListResult. + */ + public static S3BucketPolicyListResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + S3BucketPolicyListResult deserializedS3BucketPolicyListResult = new S3BucketPolicyListResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> S3BucketPolicyInner.fromJson(reader1)); + deserializedS3BucketPolicyListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedS3BucketPolicyListResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedS3BucketPolicyListResult; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/S3BucketPolicyProperties.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/S3BucketPolicyProperties.java new file mode 100644 index 000000000000..a2a514a235d2 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/S3BucketPolicyProperties.java @@ -0,0 +1,311 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.Map; + +/** + * Definition of S3BucketPolicy. + */ +@Fluent +public final class S3BucketPolicyProperties implements JsonSerializable { + /* + * AWS Properties + */ + private AwsS3BucketPolicyProperties awsProperties; + + /* + * Public Cloud Connectors Resource ID + */ + private String publicCloudConnectorsResourceId; + + /* + * AWS Account ID + */ + private String awsAccountId; + + /* + * Amazon Resource Name (ARN) + */ + private String arn; + + /* + * Public Cloud Resource Name + */ + private String publicCloudResourceName; + + /* + * AWS Source Schema + */ + private String awsSourceSchema; + + /* + * AWS Region + */ + private String awsRegion; + + /* + * AWS Tags + */ + private Map awsTags; + + /* + * The status of the last operation. + */ + private ProvisioningState provisioningState; + + /** + * Creates an instance of S3BucketPolicyProperties class. + */ + public S3BucketPolicyProperties() { + } + + /** + * Get the awsProperties property: AWS Properties. + * + * @return the awsProperties value. + */ + public AwsS3BucketPolicyProperties awsProperties() { + return this.awsProperties; + } + + /** + * Set the awsProperties property: AWS Properties. + * + * @param awsProperties the awsProperties value to set. + * @return the S3BucketPolicyProperties object itself. + */ + public S3BucketPolicyProperties withAwsProperties(AwsS3BucketPolicyProperties awsProperties) { + this.awsProperties = awsProperties; + return this; + } + + /** + * Get the publicCloudConnectorsResourceId property: Public Cloud Connectors Resource ID. + * + * @return the publicCloudConnectorsResourceId value. + */ + public String publicCloudConnectorsResourceId() { + return this.publicCloudConnectorsResourceId; + } + + /** + * Set the publicCloudConnectorsResourceId property: Public Cloud Connectors Resource ID. + * + * @param publicCloudConnectorsResourceId the publicCloudConnectorsResourceId value to set. + * @return the S3BucketPolicyProperties object itself. + */ + public S3BucketPolicyProperties withPublicCloudConnectorsResourceId(String publicCloudConnectorsResourceId) { + this.publicCloudConnectorsResourceId = publicCloudConnectorsResourceId; + return this; + } + + /** + * Get the awsAccountId property: AWS Account ID. + * + * @return the awsAccountId value. + */ + public String awsAccountId() { + return this.awsAccountId; + } + + /** + * Set the awsAccountId property: AWS Account ID. + * + * @param awsAccountId the awsAccountId value to set. + * @return the S3BucketPolicyProperties object itself. + */ + public S3BucketPolicyProperties withAwsAccountId(String awsAccountId) { + this.awsAccountId = awsAccountId; + return this; + } + + /** + * Get the arn property: Amazon Resource Name (ARN). + * + * @return the arn value. + */ + public String arn() { + return this.arn; + } + + /** + * Set the arn property: Amazon Resource Name (ARN). + * + * @param arn the arn value to set. + * @return the S3BucketPolicyProperties object itself. + */ + public S3BucketPolicyProperties withArn(String arn) { + this.arn = arn; + return this; + } + + /** + * Get the publicCloudResourceName property: Public Cloud Resource Name. + * + * @return the publicCloudResourceName value. + */ + public String publicCloudResourceName() { + return this.publicCloudResourceName; + } + + /** + * Set the publicCloudResourceName property: Public Cloud Resource Name. + * + * @param publicCloudResourceName the publicCloudResourceName value to set. + * @return the S3BucketPolicyProperties object itself. + */ + public S3BucketPolicyProperties withPublicCloudResourceName(String publicCloudResourceName) { + this.publicCloudResourceName = publicCloudResourceName; + return this; + } + + /** + * Get the awsSourceSchema property: AWS Source Schema. + * + * @return the awsSourceSchema value. + */ + public String awsSourceSchema() { + return this.awsSourceSchema; + } + + /** + * Set the awsSourceSchema property: AWS Source Schema. + * + * @param awsSourceSchema the awsSourceSchema value to set. + * @return the S3BucketPolicyProperties object itself. + */ + public S3BucketPolicyProperties withAwsSourceSchema(String awsSourceSchema) { + this.awsSourceSchema = awsSourceSchema; + return this; + } + + /** + * Get the awsRegion property: AWS Region. + * + * @return the awsRegion value. + */ + public String awsRegion() { + return this.awsRegion; + } + + /** + * Set the awsRegion property: AWS Region. + * + * @param awsRegion the awsRegion value to set. + * @return the S3BucketPolicyProperties object itself. + */ + public S3BucketPolicyProperties withAwsRegion(String awsRegion) { + this.awsRegion = awsRegion; + return this; + } + + /** + * Get the awsTags property: AWS Tags. + * + * @return the awsTags value. + */ + public Map awsTags() { + return this.awsTags; + } + + /** + * Set the awsTags property: AWS Tags. + * + * @param awsTags the awsTags value to set. + * @return the S3BucketPolicyProperties object itself. + */ + public S3BucketPolicyProperties withAwsTags(Map awsTags) { + this.awsTags = awsTags; + return this; + } + + /** + * Get the provisioningState property: The status of the last operation. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (awsProperties() != null) { + awsProperties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("awsProperties", this.awsProperties); + jsonWriter.writeStringField("publicCloudConnectorsResourceId", this.publicCloudConnectorsResourceId); + jsonWriter.writeStringField("awsAccountId", this.awsAccountId); + jsonWriter.writeStringField("arn", this.arn); + jsonWriter.writeStringField("publicCloudResourceName", this.publicCloudResourceName); + jsonWriter.writeStringField("awsSourceSchema", this.awsSourceSchema); + jsonWriter.writeStringField("awsRegion", this.awsRegion); + jsonWriter.writeMapField("awsTags", this.awsTags, (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of S3BucketPolicyProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of S3BucketPolicyProperties if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IOException If an error occurs while reading the S3BucketPolicyProperties. + */ + public static S3BucketPolicyProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + S3BucketPolicyProperties deserializedS3BucketPolicyProperties = new S3BucketPolicyProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("awsProperties".equals(fieldName)) { + deserializedS3BucketPolicyProperties.awsProperties = AwsS3BucketPolicyProperties.fromJson(reader); + } else if ("publicCloudConnectorsResourceId".equals(fieldName)) { + deserializedS3BucketPolicyProperties.publicCloudConnectorsResourceId = reader.getString(); + } else if ("awsAccountId".equals(fieldName)) { + deserializedS3BucketPolicyProperties.awsAccountId = reader.getString(); + } else if ("arn".equals(fieldName)) { + deserializedS3BucketPolicyProperties.arn = reader.getString(); + } else if ("publicCloudResourceName".equals(fieldName)) { + deserializedS3BucketPolicyProperties.publicCloudResourceName = reader.getString(); + } else if ("awsSourceSchema".equals(fieldName)) { + deserializedS3BucketPolicyProperties.awsSourceSchema = reader.getString(); + } else if ("awsRegion".equals(fieldName)) { + deserializedS3BucketPolicyProperties.awsRegion = reader.getString(); + } else if ("awsTags".equals(fieldName)) { + Map awsTags = reader.readMap(reader1 -> reader1.getString()); + deserializedS3BucketPolicyProperties.awsTags = awsTags; + } else if ("provisioningState".equals(fieldName)) { + deserializedS3BucketPolicyProperties.provisioningState + = ProvisioningState.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedS3BucketPolicyProperties; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/S3BucketPolicyTagsUpdate.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/S3BucketPolicyTagsUpdate.java new file mode 100644 index 000000000000..0fc7939033c5 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/S3BucketPolicyTagsUpdate.java @@ -0,0 +1,95 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.Map; + +/** + * The type used for updating tags in S3BucketPolicy resources. + */ +@Fluent +public final class S3BucketPolicyTagsUpdate implements JsonSerializable { + /* + * Resource tags. + */ + private Map tags; + + /** + * Creates an instance of S3BucketPolicyTagsUpdate class. + */ + public S3BucketPolicyTagsUpdate() { + } + + /** + * Get the tags property: Resource tags. + * + * @return the tags value. + */ + public Map tags() { + return this.tags; + } + + /** + * Set the tags property: Resource tags. + * + * @param tags the tags value to set. + * @return the S3BucketPolicyTagsUpdate object itself. + */ + public S3BucketPolicyTagsUpdate withTags(Map tags) { + this.tags = tags; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeMapField("tags", this.tags, (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of S3BucketPolicyTagsUpdate from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of S3BucketPolicyTagsUpdate if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IOException If an error occurs while reading the S3BucketPolicyTagsUpdate. + */ + public static S3BucketPolicyTagsUpdate fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + S3BucketPolicyTagsUpdate deserializedS3BucketPolicyTagsUpdate = new S3BucketPolicyTagsUpdate(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedS3BucketPolicyTagsUpdate.tags = tags; + } else { + reader.skipChildren(); + } + } + + return deserializedS3BucketPolicyTagsUpdate; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/S3BucketProperties.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/S3BucketProperties.java new file mode 100644 index 000000000000..9872b68db208 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/S3BucketProperties.java @@ -0,0 +1,310 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.Map; + +/** + * Definition of S3Bucket. + */ +@Fluent +public final class S3BucketProperties implements JsonSerializable { + /* + * AWS Properties + */ + private AwsS3BucketProperties awsProperties; + + /* + * Public Cloud Connectors Resource ID + */ + private String publicCloudConnectorsResourceId; + + /* + * AWS Account ID + */ + private String awsAccountId; + + /* + * Amazon Resource Name (ARN) + */ + private String arn; + + /* + * Public Cloud Resource Name + */ + private String publicCloudResourceName; + + /* + * AWS Source Schema + */ + private String awsSourceSchema; + + /* + * AWS Region + */ + private String awsRegion; + + /* + * AWS Tags + */ + private Map awsTags; + + /* + * The status of the last operation. + */ + private ProvisioningState provisioningState; + + /** + * Creates an instance of S3BucketProperties class. + */ + public S3BucketProperties() { + } + + /** + * Get the awsProperties property: AWS Properties. + * + * @return the awsProperties value. + */ + public AwsS3BucketProperties awsProperties() { + return this.awsProperties; + } + + /** + * Set the awsProperties property: AWS Properties. + * + * @param awsProperties the awsProperties value to set. + * @return the S3BucketProperties object itself. + */ + public S3BucketProperties withAwsProperties(AwsS3BucketProperties awsProperties) { + this.awsProperties = awsProperties; + return this; + } + + /** + * Get the publicCloudConnectorsResourceId property: Public Cloud Connectors Resource ID. + * + * @return the publicCloudConnectorsResourceId value. + */ + public String publicCloudConnectorsResourceId() { + return this.publicCloudConnectorsResourceId; + } + + /** + * Set the publicCloudConnectorsResourceId property: Public Cloud Connectors Resource ID. + * + * @param publicCloudConnectorsResourceId the publicCloudConnectorsResourceId value to set. + * @return the S3BucketProperties object itself. + */ + public S3BucketProperties withPublicCloudConnectorsResourceId(String publicCloudConnectorsResourceId) { + this.publicCloudConnectorsResourceId = publicCloudConnectorsResourceId; + return this; + } + + /** + * Get the awsAccountId property: AWS Account ID. + * + * @return the awsAccountId value. + */ + public String awsAccountId() { + return this.awsAccountId; + } + + /** + * Set the awsAccountId property: AWS Account ID. + * + * @param awsAccountId the awsAccountId value to set. + * @return the S3BucketProperties object itself. + */ + public S3BucketProperties withAwsAccountId(String awsAccountId) { + this.awsAccountId = awsAccountId; + return this; + } + + /** + * Get the arn property: Amazon Resource Name (ARN). + * + * @return the arn value. + */ + public String arn() { + return this.arn; + } + + /** + * Set the arn property: Amazon Resource Name (ARN). + * + * @param arn the arn value to set. + * @return the S3BucketProperties object itself. + */ + public S3BucketProperties withArn(String arn) { + this.arn = arn; + return this; + } + + /** + * Get the publicCloudResourceName property: Public Cloud Resource Name. + * + * @return the publicCloudResourceName value. + */ + public String publicCloudResourceName() { + return this.publicCloudResourceName; + } + + /** + * Set the publicCloudResourceName property: Public Cloud Resource Name. + * + * @param publicCloudResourceName the publicCloudResourceName value to set. + * @return the S3BucketProperties object itself. + */ + public S3BucketProperties withPublicCloudResourceName(String publicCloudResourceName) { + this.publicCloudResourceName = publicCloudResourceName; + return this; + } + + /** + * Get the awsSourceSchema property: AWS Source Schema. + * + * @return the awsSourceSchema value. + */ + public String awsSourceSchema() { + return this.awsSourceSchema; + } + + /** + * Set the awsSourceSchema property: AWS Source Schema. + * + * @param awsSourceSchema the awsSourceSchema value to set. + * @return the S3BucketProperties object itself. + */ + public S3BucketProperties withAwsSourceSchema(String awsSourceSchema) { + this.awsSourceSchema = awsSourceSchema; + return this; + } + + /** + * Get the awsRegion property: AWS Region. + * + * @return the awsRegion value. + */ + public String awsRegion() { + return this.awsRegion; + } + + /** + * Set the awsRegion property: AWS Region. + * + * @param awsRegion the awsRegion value to set. + * @return the S3BucketProperties object itself. + */ + public S3BucketProperties withAwsRegion(String awsRegion) { + this.awsRegion = awsRegion; + return this; + } + + /** + * Get the awsTags property: AWS Tags. + * + * @return the awsTags value. + */ + public Map awsTags() { + return this.awsTags; + } + + /** + * Set the awsTags property: AWS Tags. + * + * @param awsTags the awsTags value to set. + * @return the S3BucketProperties object itself. + */ + public S3BucketProperties withAwsTags(Map awsTags) { + this.awsTags = awsTags; + return this; + } + + /** + * Get the provisioningState property: The status of the last operation. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (awsProperties() != null) { + awsProperties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("awsProperties", this.awsProperties); + jsonWriter.writeStringField("publicCloudConnectorsResourceId", this.publicCloudConnectorsResourceId); + jsonWriter.writeStringField("awsAccountId", this.awsAccountId); + jsonWriter.writeStringField("arn", this.arn); + jsonWriter.writeStringField("publicCloudResourceName", this.publicCloudResourceName); + jsonWriter.writeStringField("awsSourceSchema", this.awsSourceSchema); + jsonWriter.writeStringField("awsRegion", this.awsRegion); + jsonWriter.writeMapField("awsTags", this.awsTags, (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of S3BucketProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of S3BucketProperties if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the S3BucketProperties. + */ + public static S3BucketProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + S3BucketProperties deserializedS3BucketProperties = new S3BucketProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("awsProperties".equals(fieldName)) { + deserializedS3BucketProperties.awsProperties = AwsS3BucketProperties.fromJson(reader); + } else if ("publicCloudConnectorsResourceId".equals(fieldName)) { + deserializedS3BucketProperties.publicCloudConnectorsResourceId = reader.getString(); + } else if ("awsAccountId".equals(fieldName)) { + deserializedS3BucketProperties.awsAccountId = reader.getString(); + } else if ("arn".equals(fieldName)) { + deserializedS3BucketProperties.arn = reader.getString(); + } else if ("publicCloudResourceName".equals(fieldName)) { + deserializedS3BucketProperties.publicCloudResourceName = reader.getString(); + } else if ("awsSourceSchema".equals(fieldName)) { + deserializedS3BucketProperties.awsSourceSchema = reader.getString(); + } else if ("awsRegion".equals(fieldName)) { + deserializedS3BucketProperties.awsRegion = reader.getString(); + } else if ("awsTags".equals(fieldName)) { + Map awsTags = reader.readMap(reader1 -> reader1.getString()); + deserializedS3BucketProperties.awsTags = awsTags; + } else if ("provisioningState".equals(fieldName)) { + deserializedS3BucketProperties.provisioningState = ProvisioningState.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedS3BucketProperties; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/S3BucketSource.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/S3BucketSource.java new file mode 100644 index 000000000000..e227abc57bf4 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/S3BucketSource.java @@ -0,0 +1,152 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of S3BucketSource. + */ +@Fluent +public final class S3BucketSource implements JsonSerializable { + /* + * The S3 bucket that is being imported from. + */ + private String s3Bucket; + + /* + * The account number of the S3 bucket that is being imported from. If the bucket is owned by the requester this is + * optional. + */ + private String s3BucketOwner; + + /* + * The key prefix shared by all S3 Objects that are being imported. + */ + private String s3KeyPrefix; + + /** + * Creates an instance of S3BucketSource class. + */ + public S3BucketSource() { + } + + /** + * Get the s3Bucket property: The S3 bucket that is being imported from. + * + * @return the s3Bucket value. + */ + public String s3Bucket() { + return this.s3Bucket; + } + + /** + * Set the s3Bucket property: The S3 bucket that is being imported from. + * + * @param s3Bucket the s3Bucket value to set. + * @return the S3BucketSource object itself. + */ + public S3BucketSource withS3Bucket(String s3Bucket) { + this.s3Bucket = s3Bucket; + return this; + } + + /** + * Get the s3BucketOwner property: The account number of the S3 bucket that is being imported from. If the bucket is + * owned by the requester this is optional. + * + * @return the s3BucketOwner value. + */ + public String s3BucketOwner() { + return this.s3BucketOwner; + } + + /** + * Set the s3BucketOwner property: The account number of the S3 bucket that is being imported from. If the bucket is + * owned by the requester this is optional. + * + * @param s3BucketOwner the s3BucketOwner value to set. + * @return the S3BucketSource object itself. + */ + public S3BucketSource withS3BucketOwner(String s3BucketOwner) { + this.s3BucketOwner = s3BucketOwner; + return this; + } + + /** + * Get the s3KeyPrefix property: The key prefix shared by all S3 Objects that are being imported. + * + * @return the s3KeyPrefix value. + */ + public String s3KeyPrefix() { + return this.s3KeyPrefix; + } + + /** + * Set the s3KeyPrefix property: The key prefix shared by all S3 Objects that are being imported. + * + * @param s3KeyPrefix the s3KeyPrefix value to set. + * @return the S3BucketSource object itself. + */ + public S3BucketSource withS3KeyPrefix(String s3KeyPrefix) { + this.s3KeyPrefix = s3KeyPrefix; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("s3Bucket", this.s3Bucket); + jsonWriter.writeStringField("s3BucketOwner", this.s3BucketOwner); + jsonWriter.writeStringField("s3KeyPrefix", this.s3KeyPrefix); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of S3BucketSource from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of S3BucketSource if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the S3BucketSource. + */ + public static S3BucketSource fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + S3BucketSource deserializedS3BucketSource = new S3BucketSource(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("s3Bucket".equals(fieldName)) { + deserializedS3BucketSource.s3Bucket = reader.getString(); + } else if ("s3BucketOwner".equals(fieldName)) { + deserializedS3BucketSource.s3BucketOwner = reader.getString(); + } else if ("s3KeyPrefix".equals(fieldName)) { + deserializedS3BucketSource.s3KeyPrefix = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedS3BucketSource; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/S3BucketTagsUpdate.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/S3BucketTagsUpdate.java new file mode 100644 index 000000000000..c9eb206fcc78 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/S3BucketTagsUpdate.java @@ -0,0 +1,95 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.Map; + +/** + * The type used for updating tags in S3Bucket resources. + */ +@Fluent +public final class S3BucketTagsUpdate implements JsonSerializable { + /* + * Resource tags. + */ + private Map tags; + + /** + * Creates an instance of S3BucketTagsUpdate class. + */ + public S3BucketTagsUpdate() { + } + + /** + * Get the tags property: Resource tags. + * + * @return the tags value. + */ + public Map tags() { + return this.tags; + } + + /** + * Set the tags property: Resource tags. + * + * @param tags the tags value to set. + * @return the S3BucketTagsUpdate object itself. + */ + public S3BucketTagsUpdate withTags(Map tags) { + this.tags = tags; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeMapField("tags", this.tags, (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of S3BucketTagsUpdate from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of S3BucketTagsUpdate if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the S3BucketTagsUpdate. + */ + public static S3BucketTagsUpdate fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + S3BucketTagsUpdate deserializedS3BucketTagsUpdate = new S3BucketTagsUpdate(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedS3BucketTagsUpdate.tags = tags; + } else { + reader.skipChildren(); + } + } + + return deserializedS3BucketTagsUpdate; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/S3Buckets.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/S3Buckets.java new file mode 100644 index 000000000000..2ad25cf6c92a --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/S3Buckets.java @@ -0,0 +1,157 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** + * Resource collection API of S3Buckets. + */ +public interface S3Buckets { + /** + * List S3Bucket resources by subscription ID. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a S3Bucket list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable list(); + + /** + * List S3Bucket resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a S3Bucket list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable list(Context context); + + /** + * List S3Bucket resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a S3Bucket list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * List S3Bucket resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a S3Bucket list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Get a S3Bucket. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of S3Bucket. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a S3Bucket along with {@link Response}. + */ + Response getByResourceGroupWithResponse(String resourceGroupName, String name, Context context); + + /** + * Get a S3Bucket. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of S3Bucket. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a S3Bucket. + */ + S3Bucket getByResourceGroup(String resourceGroupName, String name); + + /** + * Delete a S3Bucket. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of S3Bucket. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByResourceGroup(String resourceGroupName, String name); + + /** + * Delete a S3Bucket. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of S3Bucket. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String name, Context context); + + /** + * Get a S3Bucket. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a S3Bucket along with {@link Response}. + */ + S3Bucket getById(String id); + + /** + * Get a S3Bucket. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a S3Bucket along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Delete a S3Bucket. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteById(String id); + + /** + * Delete a S3Bucket. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new S3Bucket resource. + * + * @param name resource name. + * @return the first stage of the new S3Bucket definition. + */ + S3Bucket.DefinitionStages.Blank define(String name); +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/S3ControlMultiRegionAccessPointPolicyDocument.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/S3ControlMultiRegionAccessPointPolicyDocument.java new file mode 100644 index 000000000000..6d416d6db699 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/S3ControlMultiRegionAccessPointPolicyDocument.java @@ -0,0 +1,255 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.awsconnector.fluent.models.S3ControlMultiRegionAccessPointPolicyDocumentInner; +import java.util.Map; + +/** + * An immutable client-side representation of S3ControlMultiRegionAccessPointPolicyDocument. + */ +public interface S3ControlMultiRegionAccessPointPolicyDocument { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the location property: The geo-location where the resource lives. + * + * @return the location value. + */ + String location(); + + /** + * Gets the tags property: Resource tags. + * + * @return the tags value. + */ + Map tags(); + + /** + * Gets the properties property: The resource-specific properties for this resource. + * + * @return the properties value. + */ + S3ControlMultiRegionAccessPointPolicyDocumentProperties properties(); + + /** + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the region of the resource. + * + * @return the region of the resource. + */ + Region region(); + + /** + * Gets the name of the resource region. + * + * @return the name of the resource region. + */ + String regionName(); + + /** + * Gets the name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + + /** + * Gets the inner + * com.azure.resourcemanager.awsconnector.fluent.models.S3ControlMultiRegionAccessPointPolicyDocumentInner object. + * + * @return the inner object. + */ + S3ControlMultiRegionAccessPointPolicyDocumentInner innerModel(); + + /** + * The entirety of the S3ControlMultiRegionAccessPointPolicyDocument definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithLocation, + DefinitionStages.WithResourceGroup, DefinitionStages.WithCreate { + } + + /** + * The S3ControlMultiRegionAccessPointPolicyDocument definition stages. + */ + interface DefinitionStages { + /** + * The first stage of the S3ControlMultiRegionAccessPointPolicyDocument definition. + */ + interface Blank extends WithLocation { + } + + /** + * The stage of the S3ControlMultiRegionAccessPointPolicyDocument definition allowing to specify location. + */ + interface WithLocation { + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithResourceGroup withRegion(Region location); + + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithResourceGroup withRegion(String location); + } + + /** + * The stage of the S3ControlMultiRegionAccessPointPolicyDocument definition allowing to specify parent + * resource. + */ + interface WithResourceGroup { + /** + * Specifies resourceGroupName. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @return the next definition stage. + */ + WithCreate withExistingResourceGroup(String resourceGroupName); + } + + /** + * The stage of the S3ControlMultiRegionAccessPointPolicyDocument 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.WithProperties { + /** + * Executes the create request. + * + * @return the created resource. + */ + S3ControlMultiRegionAccessPointPolicyDocument create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + S3ControlMultiRegionAccessPointPolicyDocument create(Context context); + } + + /** + * The stage of the S3ControlMultiRegionAccessPointPolicyDocument definition allowing to specify tags. + */ + interface WithTags { + /** + * Specifies the tags property: Resource tags.. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + WithCreate withTags(Map tags); + } + + /** + * The stage of the S3ControlMultiRegionAccessPointPolicyDocument definition allowing to specify properties. + */ + interface WithProperties { + /** + * Specifies the properties property: The resource-specific properties for this resource.. + * + * @param properties The resource-specific properties for this resource. + * @return the next definition stage. + */ + WithCreate withProperties(S3ControlMultiRegionAccessPointPolicyDocumentProperties properties); + } + } + + /** + * Begins update for the S3ControlMultiRegionAccessPointPolicyDocument resource. + * + * @return the stage of resource update. + */ + S3ControlMultiRegionAccessPointPolicyDocument.Update update(); + + /** + * The template for S3ControlMultiRegionAccessPointPolicyDocument update. + */ + interface Update extends UpdateStages.WithTags { + /** + * Executes the update request. + * + * @return the updated resource. + */ + S3ControlMultiRegionAccessPointPolicyDocument apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + S3ControlMultiRegionAccessPointPolicyDocument apply(Context context); + } + + /** + * The S3ControlMultiRegionAccessPointPolicyDocument update stages. + */ + interface UpdateStages { + /** + * The stage of the S3ControlMultiRegionAccessPointPolicyDocument update allowing to specify tags. + */ + interface WithTags { + /** + * Specifies the tags property: Resource tags.. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + Update withTags(Map tags); + } + } + + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + S3ControlMultiRegionAccessPointPolicyDocument refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + S3ControlMultiRegionAccessPointPolicyDocument refresh(Context context); +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/S3ControlMultiRegionAccessPointPolicyDocumentListResult.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/S3ControlMultiRegionAccessPointPolicyDocumentListResult.java new file mode 100644 index 000000000000..ec2b6942ac0b --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/S3ControlMultiRegionAccessPointPolicyDocumentListResult.java @@ -0,0 +1,141 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.awsconnector.fluent.models.S3ControlMultiRegionAccessPointPolicyDocumentInner; +import java.io.IOException; +import java.util.List; + +/** + * The response of a S3ControlMultiRegionAccessPointPolicyDocument list operation. + */ +@Fluent +public final class S3ControlMultiRegionAccessPointPolicyDocumentListResult + implements JsonSerializable { + /* + * The S3ControlMultiRegionAccessPointPolicyDocument items on this page + */ + private List value; + + /* + * The link to the next page of items + */ + private String nextLink; + + /** + * Creates an instance of S3ControlMultiRegionAccessPointPolicyDocumentListResult class. + */ + public S3ControlMultiRegionAccessPointPolicyDocumentListResult() { + } + + /** + * Get the value property: The S3ControlMultiRegionAccessPointPolicyDocument items on this page. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The S3ControlMultiRegionAccessPointPolicyDocument items on this page. + * + * @param value the value value to set. + * @return the S3ControlMultiRegionAccessPointPolicyDocumentListResult object itself. + */ + public S3ControlMultiRegionAccessPointPolicyDocumentListResult + withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The link to the next page of items. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: The link to the next page of items. + * + * @param nextLink the nextLink value to set. + * @return the S3ControlMultiRegionAccessPointPolicyDocumentListResult object itself. + */ + public S3ControlMultiRegionAccessPointPolicyDocumentListResult withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property value in model S3ControlMultiRegionAccessPointPolicyDocumentListResult")); + } else { + value().forEach(e -> e.validate()); + } + } + + private static final ClientLogger LOGGER + = new ClientLogger(S3ControlMultiRegionAccessPointPolicyDocumentListResult.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("nextLink", this.nextLink); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of S3ControlMultiRegionAccessPointPolicyDocumentListResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of S3ControlMultiRegionAccessPointPolicyDocumentListResult if the JsonReader was pointing to + * an instance of it, or null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the S3ControlMultiRegionAccessPointPolicyDocumentListResult. + */ + public static S3ControlMultiRegionAccessPointPolicyDocumentListResult fromJson(JsonReader jsonReader) + throws IOException { + return jsonReader.readObject(reader -> { + S3ControlMultiRegionAccessPointPolicyDocumentListResult deserializedS3ControlMultiRegionAccessPointPolicyDocumentListResult + = new S3ControlMultiRegionAccessPointPolicyDocumentListResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value = reader + .readArray(reader1 -> S3ControlMultiRegionAccessPointPolicyDocumentInner.fromJson(reader1)); + deserializedS3ControlMultiRegionAccessPointPolicyDocumentListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedS3ControlMultiRegionAccessPointPolicyDocumentListResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedS3ControlMultiRegionAccessPointPolicyDocumentListResult; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/S3ControlMultiRegionAccessPointPolicyDocumentProperties.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/S3ControlMultiRegionAccessPointPolicyDocumentProperties.java new file mode 100644 index 000000000000..d78406d700fa --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/S3ControlMultiRegionAccessPointPolicyDocumentProperties.java @@ -0,0 +1,322 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.Map; + +/** + * Definition of S3ControlMultiRegionAccessPointPolicyDocument. + */ +@Fluent +public final class S3ControlMultiRegionAccessPointPolicyDocumentProperties + implements JsonSerializable { + /* + * AWS Properties + */ + private AwsS3ControlMultiRegionAccessPointPolicyDocumentProperties awsProperties; + + /* + * Public Cloud Connectors Resource ID + */ + private String publicCloudConnectorsResourceId; + + /* + * AWS Account ID + */ + private String awsAccountId; + + /* + * Amazon Resource Name (ARN) + */ + private String arn; + + /* + * Public Cloud Resource Name + */ + private String publicCloudResourceName; + + /* + * AWS Source Schema + */ + private String awsSourceSchema; + + /* + * AWS Region + */ + private String awsRegion; + + /* + * AWS Tags + */ + private Map awsTags; + + /* + * The status of the last operation. + */ + private ProvisioningState provisioningState; + + /** + * Creates an instance of S3ControlMultiRegionAccessPointPolicyDocumentProperties class. + */ + public S3ControlMultiRegionAccessPointPolicyDocumentProperties() { + } + + /** + * Get the awsProperties property: AWS Properties. + * + * @return the awsProperties value. + */ + public AwsS3ControlMultiRegionAccessPointPolicyDocumentProperties awsProperties() { + return this.awsProperties; + } + + /** + * Set the awsProperties property: AWS Properties. + * + * @param awsProperties the awsProperties value to set. + * @return the S3ControlMultiRegionAccessPointPolicyDocumentProperties object itself. + */ + public S3ControlMultiRegionAccessPointPolicyDocumentProperties + withAwsProperties(AwsS3ControlMultiRegionAccessPointPolicyDocumentProperties awsProperties) { + this.awsProperties = awsProperties; + return this; + } + + /** + * Get the publicCloudConnectorsResourceId property: Public Cloud Connectors Resource ID. + * + * @return the publicCloudConnectorsResourceId value. + */ + public String publicCloudConnectorsResourceId() { + return this.publicCloudConnectorsResourceId; + } + + /** + * Set the publicCloudConnectorsResourceId property: Public Cloud Connectors Resource ID. + * + * @param publicCloudConnectorsResourceId the publicCloudConnectorsResourceId value to set. + * @return the S3ControlMultiRegionAccessPointPolicyDocumentProperties object itself. + */ + public S3ControlMultiRegionAccessPointPolicyDocumentProperties + withPublicCloudConnectorsResourceId(String publicCloudConnectorsResourceId) { + this.publicCloudConnectorsResourceId = publicCloudConnectorsResourceId; + return this; + } + + /** + * Get the awsAccountId property: AWS Account ID. + * + * @return the awsAccountId value. + */ + public String awsAccountId() { + return this.awsAccountId; + } + + /** + * Set the awsAccountId property: AWS Account ID. + * + * @param awsAccountId the awsAccountId value to set. + * @return the S3ControlMultiRegionAccessPointPolicyDocumentProperties object itself. + */ + public S3ControlMultiRegionAccessPointPolicyDocumentProperties withAwsAccountId(String awsAccountId) { + this.awsAccountId = awsAccountId; + return this; + } + + /** + * Get the arn property: Amazon Resource Name (ARN). + * + * @return the arn value. + */ + public String arn() { + return this.arn; + } + + /** + * Set the arn property: Amazon Resource Name (ARN). + * + * @param arn the arn value to set. + * @return the S3ControlMultiRegionAccessPointPolicyDocumentProperties object itself. + */ + public S3ControlMultiRegionAccessPointPolicyDocumentProperties withArn(String arn) { + this.arn = arn; + return this; + } + + /** + * Get the publicCloudResourceName property: Public Cloud Resource Name. + * + * @return the publicCloudResourceName value. + */ + public String publicCloudResourceName() { + return this.publicCloudResourceName; + } + + /** + * Set the publicCloudResourceName property: Public Cloud Resource Name. + * + * @param publicCloudResourceName the publicCloudResourceName value to set. + * @return the S3ControlMultiRegionAccessPointPolicyDocumentProperties object itself. + */ + public S3ControlMultiRegionAccessPointPolicyDocumentProperties + withPublicCloudResourceName(String publicCloudResourceName) { + this.publicCloudResourceName = publicCloudResourceName; + return this; + } + + /** + * Get the awsSourceSchema property: AWS Source Schema. + * + * @return the awsSourceSchema value. + */ + public String awsSourceSchema() { + return this.awsSourceSchema; + } + + /** + * Set the awsSourceSchema property: AWS Source Schema. + * + * @param awsSourceSchema the awsSourceSchema value to set. + * @return the S3ControlMultiRegionAccessPointPolicyDocumentProperties object itself. + */ + public S3ControlMultiRegionAccessPointPolicyDocumentProperties withAwsSourceSchema(String awsSourceSchema) { + this.awsSourceSchema = awsSourceSchema; + return this; + } + + /** + * Get the awsRegion property: AWS Region. + * + * @return the awsRegion value. + */ + public String awsRegion() { + return this.awsRegion; + } + + /** + * Set the awsRegion property: AWS Region. + * + * @param awsRegion the awsRegion value to set. + * @return the S3ControlMultiRegionAccessPointPolicyDocumentProperties object itself. + */ + public S3ControlMultiRegionAccessPointPolicyDocumentProperties withAwsRegion(String awsRegion) { + this.awsRegion = awsRegion; + return this; + } + + /** + * Get the awsTags property: AWS Tags. + * + * @return the awsTags value. + */ + public Map awsTags() { + return this.awsTags; + } + + /** + * Set the awsTags property: AWS Tags. + * + * @param awsTags the awsTags value to set. + * @return the S3ControlMultiRegionAccessPointPolicyDocumentProperties object itself. + */ + public S3ControlMultiRegionAccessPointPolicyDocumentProperties withAwsTags(Map awsTags) { + this.awsTags = awsTags; + return this; + } + + /** + * Get the provisioningState property: The status of the last operation. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (awsProperties() != null) { + awsProperties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("awsProperties", this.awsProperties); + jsonWriter.writeStringField("publicCloudConnectorsResourceId", this.publicCloudConnectorsResourceId); + jsonWriter.writeStringField("awsAccountId", this.awsAccountId); + jsonWriter.writeStringField("arn", this.arn); + jsonWriter.writeStringField("publicCloudResourceName", this.publicCloudResourceName); + jsonWriter.writeStringField("awsSourceSchema", this.awsSourceSchema); + jsonWriter.writeStringField("awsRegion", this.awsRegion); + jsonWriter.writeMapField("awsTags", this.awsTags, (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of S3ControlMultiRegionAccessPointPolicyDocumentProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of S3ControlMultiRegionAccessPointPolicyDocumentProperties if the JsonReader was pointing to + * an instance of it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the S3ControlMultiRegionAccessPointPolicyDocumentProperties. + */ + public static S3ControlMultiRegionAccessPointPolicyDocumentProperties fromJson(JsonReader jsonReader) + throws IOException { + return jsonReader.readObject(reader -> { + S3ControlMultiRegionAccessPointPolicyDocumentProperties deserializedS3ControlMultiRegionAccessPointPolicyDocumentProperties + = new S3ControlMultiRegionAccessPointPolicyDocumentProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("awsProperties".equals(fieldName)) { + deserializedS3ControlMultiRegionAccessPointPolicyDocumentProperties.awsProperties + = AwsS3ControlMultiRegionAccessPointPolicyDocumentProperties.fromJson(reader); + } else if ("publicCloudConnectorsResourceId".equals(fieldName)) { + deserializedS3ControlMultiRegionAccessPointPolicyDocumentProperties.publicCloudConnectorsResourceId + = reader.getString(); + } else if ("awsAccountId".equals(fieldName)) { + deserializedS3ControlMultiRegionAccessPointPolicyDocumentProperties.awsAccountId + = reader.getString(); + } else if ("arn".equals(fieldName)) { + deserializedS3ControlMultiRegionAccessPointPolicyDocumentProperties.arn = reader.getString(); + } else if ("publicCloudResourceName".equals(fieldName)) { + deserializedS3ControlMultiRegionAccessPointPolicyDocumentProperties.publicCloudResourceName + = reader.getString(); + } else if ("awsSourceSchema".equals(fieldName)) { + deserializedS3ControlMultiRegionAccessPointPolicyDocumentProperties.awsSourceSchema + = reader.getString(); + } else if ("awsRegion".equals(fieldName)) { + deserializedS3ControlMultiRegionAccessPointPolicyDocumentProperties.awsRegion = reader.getString(); + } else if ("awsTags".equals(fieldName)) { + Map awsTags = reader.readMap(reader1 -> reader1.getString()); + deserializedS3ControlMultiRegionAccessPointPolicyDocumentProperties.awsTags = awsTags; + } else if ("provisioningState".equals(fieldName)) { + deserializedS3ControlMultiRegionAccessPointPolicyDocumentProperties.provisioningState + = ProvisioningState.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedS3ControlMultiRegionAccessPointPolicyDocumentProperties; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/S3ControlMultiRegionAccessPointPolicyDocumentTagsUpdate.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/S3ControlMultiRegionAccessPointPolicyDocumentTagsUpdate.java new file mode 100644 index 000000000000..699a36507947 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/S3ControlMultiRegionAccessPointPolicyDocumentTagsUpdate.java @@ -0,0 +1,98 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.Map; + +/** + * The type used for updating tags in S3ControlMultiRegionAccessPointPolicyDocument resources. + */ +@Fluent +public final class S3ControlMultiRegionAccessPointPolicyDocumentTagsUpdate + implements JsonSerializable { + /* + * Resource tags. + */ + private Map tags; + + /** + * Creates an instance of S3ControlMultiRegionAccessPointPolicyDocumentTagsUpdate class. + */ + public S3ControlMultiRegionAccessPointPolicyDocumentTagsUpdate() { + } + + /** + * Get the tags property: Resource tags. + * + * @return the tags value. + */ + public Map tags() { + return this.tags; + } + + /** + * Set the tags property: Resource tags. + * + * @param tags the tags value to set. + * @return the S3ControlMultiRegionAccessPointPolicyDocumentTagsUpdate object itself. + */ + public S3ControlMultiRegionAccessPointPolicyDocumentTagsUpdate withTags(Map tags) { + this.tags = tags; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeMapField("tags", this.tags, (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of S3ControlMultiRegionAccessPointPolicyDocumentTagsUpdate from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of S3ControlMultiRegionAccessPointPolicyDocumentTagsUpdate if the JsonReader was pointing to + * an instance of it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the S3ControlMultiRegionAccessPointPolicyDocumentTagsUpdate. + */ + public static S3ControlMultiRegionAccessPointPolicyDocumentTagsUpdate fromJson(JsonReader jsonReader) + throws IOException { + return jsonReader.readObject(reader -> { + S3ControlMultiRegionAccessPointPolicyDocumentTagsUpdate deserializedS3ControlMultiRegionAccessPointPolicyDocumentTagsUpdate + = new S3ControlMultiRegionAccessPointPolicyDocumentTagsUpdate(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedS3ControlMultiRegionAccessPointPolicyDocumentTagsUpdate.tags = tags; + } else { + reader.skipChildren(); + } + } + + return deserializedS3ControlMultiRegionAccessPointPolicyDocumentTagsUpdate; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/S3ControlMultiRegionAccessPointPolicyDocuments.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/S3ControlMultiRegionAccessPointPolicyDocuments.java new file mode 100644 index 000000000000..043aef691bd8 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/S3ControlMultiRegionAccessPointPolicyDocuments.java @@ -0,0 +1,163 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** + * Resource collection API of S3ControlMultiRegionAccessPointPolicyDocuments. + */ +public interface S3ControlMultiRegionAccessPointPolicyDocuments { + /** + * List S3ControlMultiRegionAccessPointPolicyDocument resources by subscription ID. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a S3ControlMultiRegionAccessPointPolicyDocument list operation as paginated response with + * {@link PagedIterable}. + */ + PagedIterable list(); + + /** + * List S3ControlMultiRegionAccessPointPolicyDocument resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a S3ControlMultiRegionAccessPointPolicyDocument list operation as paginated response with + * {@link PagedIterable}. + */ + PagedIterable list(Context context); + + /** + * List S3ControlMultiRegionAccessPointPolicyDocument resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a S3ControlMultiRegionAccessPointPolicyDocument list operation as paginated response with + * {@link PagedIterable}. + */ + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * List S3ControlMultiRegionAccessPointPolicyDocument resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a S3ControlMultiRegionAccessPointPolicyDocument list operation as paginated response with + * {@link PagedIterable}. + */ + PagedIterable listByResourceGroup(String resourceGroupName, + Context context); + + /** + * Get a S3ControlMultiRegionAccessPointPolicyDocument. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of S3ControlMultiRegionAccessPointPolicyDocument. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a S3ControlMultiRegionAccessPointPolicyDocument along with {@link Response}. + */ + Response getByResourceGroupWithResponse(String resourceGroupName, + String name, Context context); + + /** + * Get a S3ControlMultiRegionAccessPointPolicyDocument. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of S3ControlMultiRegionAccessPointPolicyDocument. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a S3ControlMultiRegionAccessPointPolicyDocument. + */ + S3ControlMultiRegionAccessPointPolicyDocument getByResourceGroup(String resourceGroupName, String name); + + /** + * Delete a S3ControlMultiRegionAccessPointPolicyDocument. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of S3ControlMultiRegionAccessPointPolicyDocument. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByResourceGroup(String resourceGroupName, String name); + + /** + * Delete a S3ControlMultiRegionAccessPointPolicyDocument. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of S3ControlMultiRegionAccessPointPolicyDocument. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String name, Context context); + + /** + * Get a S3ControlMultiRegionAccessPointPolicyDocument. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a S3ControlMultiRegionAccessPointPolicyDocument along with {@link Response}. + */ + S3ControlMultiRegionAccessPointPolicyDocument getById(String id); + + /** + * Get a S3ControlMultiRegionAccessPointPolicyDocument. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a S3ControlMultiRegionAccessPointPolicyDocument along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Delete a S3ControlMultiRegionAccessPointPolicyDocument. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteById(String id); + + /** + * Delete a S3ControlMultiRegionAccessPointPolicyDocument. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new S3ControlMultiRegionAccessPointPolicyDocument resource. + * + * @param name resource name. + * @return the first stage of the new S3ControlMultiRegionAccessPointPolicyDocument definition. + */ + S3ControlMultiRegionAccessPointPolicyDocument.DefinitionStages.Blank define(String name); +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/S3KeyFilter.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/S3KeyFilter.java new file mode 100644 index 000000000000..48ddfcc9c6dc --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/S3KeyFilter.java @@ -0,0 +1,100 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Definition of S3KeyFilter. + */ +@Fluent +public final class S3KeyFilter implements JsonSerializable { + /* + * A list of containers for the key-value pair that defines the criteria for the filter rule. + */ + private List rules; + + /** + * Creates an instance of S3KeyFilter class. + */ + public S3KeyFilter() { + } + + /** + * Get the rules property: A list of containers for the key-value pair that defines the criteria for the filter + * rule. + * + * @return the rules value. + */ + public List rules() { + return this.rules; + } + + /** + * Set the rules property: A list of containers for the key-value pair that defines the criteria for the filter + * rule. + * + * @param rules the rules value to set. + * @return the S3KeyFilter object itself. + */ + public S3KeyFilter withRules(List rules) { + this.rules = rules; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (rules() != null) { + rules().forEach(e -> e.validate()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("rules", this.rules, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of S3KeyFilter from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of S3KeyFilter if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the S3KeyFilter. + */ + public static S3KeyFilter fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + S3KeyFilter deserializedS3KeyFilter = new S3KeyFilter(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("rules".equals(fieldName)) { + List rules = reader.readArray(reader1 -> FilterRule.fromJson(reader1)); + deserializedS3KeyFilter.rules = rules; + } else { + reader.skipChildren(); + } + } + + return deserializedS3KeyFilter; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/S3Location.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/S3Location.java new file mode 100644 index 000000000000..efa20d137996 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/S3Location.java @@ -0,0 +1,180 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of S3Location. + */ +@Fluent +public final class S3Location implements JsonSerializable { + /* + * The name of the S3 bucket where the OpenAPI file is stored. + */ + private String bucket; + + /* + * The Amazon S3 ETag (a file checksum) of the OpenAPI file. If you don't specify a value, API Gateway skips ETag + * validation of your OpenAPI file. + */ + private String etag; + + /* + * The file name of the OpenAPI file (Amazon S3 object name). + */ + private String key; + + /* + * For versioning-enabled buckets, a specific version of the OpenAPI file. + */ + private String version; + + /** + * Creates an instance of S3Location class. + */ + public S3Location() { + } + + /** + * Get the bucket property: The name of the S3 bucket where the OpenAPI file is stored. + * + * @return the bucket value. + */ + public String bucket() { + return this.bucket; + } + + /** + * Set the bucket property: The name of the S3 bucket where the OpenAPI file is stored. + * + * @param bucket the bucket value to set. + * @return the S3Location object itself. + */ + public S3Location withBucket(String bucket) { + this.bucket = bucket; + return this; + } + + /** + * Get the etag property: The Amazon S3 ETag (a file checksum) of the OpenAPI file. If you don't specify a value, + * API Gateway skips ETag validation of your OpenAPI file. + * + * @return the etag value. + */ + public String etag() { + return this.etag; + } + + /** + * Set the etag property: The Amazon S3 ETag (a file checksum) of the OpenAPI file. If you don't specify a value, + * API Gateway skips ETag validation of your OpenAPI file. + * + * @param etag the etag value to set. + * @return the S3Location object itself. + */ + public S3Location withEtag(String etag) { + this.etag = etag; + return this; + } + + /** + * Get the key property: The file name of the OpenAPI file (Amazon S3 object name). + * + * @return the key value. + */ + public String key() { + return this.key; + } + + /** + * Set the key property: The file name of the OpenAPI file (Amazon S3 object name). + * + * @param key the key value to set. + * @return the S3Location object itself. + */ + public S3Location withKey(String key) { + this.key = key; + return this; + } + + /** + * Get the version property: For versioning-enabled buckets, a specific version of the OpenAPI file. + * + * @return the version value. + */ + public String version() { + return this.version; + } + + /** + * Set the version property: For versioning-enabled buckets, a specific version of the OpenAPI file. + * + * @param version the version value to set. + * @return the S3Location object itself. + */ + public S3Location withVersion(String version) { + this.version = version; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("bucket", this.bucket); + jsonWriter.writeStringField("eTag", this.etag); + jsonWriter.writeStringField("key", this.key); + jsonWriter.writeStringField("version", this.version); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of S3Location from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of S3Location if the JsonReader was pointing to an instance of it, or null if it was pointing + * to JSON null. + * @throws IOException If an error occurs while reading the S3Location. + */ + public static S3Location fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + S3Location deserializedS3Location = new S3Location(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("bucket".equals(fieldName)) { + deserializedS3Location.bucket = reader.getString(); + } else if ("eTag".equals(fieldName)) { + deserializedS3Location.etag = reader.getString(); + } else if ("key".equals(fieldName)) { + deserializedS3Location.key = reader.getString(); + } else if ("version".equals(fieldName)) { + deserializedS3Location.version = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedS3Location; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/S3LogsConfig.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/S3LogsConfig.java new file mode 100644 index 000000000000..318d74d937b7 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/S3LogsConfig.java @@ -0,0 +1,202 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of S3LogsConfig. + */ +@Fluent +public final class S3LogsConfig implements JsonSerializable { + /* + * Property bucketOwnerAccess + */ + private BucketOwnerAccessEnumValue bucketOwnerAccess; + + /* + *

Set to true if you do not want your S3 build log output encrypted. By default S3 build logs are encrypted. + *

+ */ + private Boolean encryptionDisabled; + + /* + *

The ARN of an S3 bucket and the path prefix for S3 logs. If your Amazon S3 bucket name is + * my-bucket, and your path prefix is build-log, then acceptable formats are + * my-bucket/build-log or arn:aws:s3:::my-bucket/build-log.

+ */ + private String location; + + /* + *

The current status of the S3 build logs. Valid values are:

  • ENABLED: S3 build + * logs are enabled for this build project.

  • DISABLED: S3 build logs are not enabled + * for this build project.

+ */ + private LogsConfigStatusTypeEnumValue status; + + /** + * Creates an instance of S3LogsConfig class. + */ + public S3LogsConfig() { + } + + /** + * Get the bucketOwnerAccess property: Property bucketOwnerAccess. + * + * @return the bucketOwnerAccess value. + */ + public BucketOwnerAccessEnumValue bucketOwnerAccess() { + return this.bucketOwnerAccess; + } + + /** + * Set the bucketOwnerAccess property: Property bucketOwnerAccess. + * + * @param bucketOwnerAccess the bucketOwnerAccess value to set. + * @return the S3LogsConfig object itself. + */ + public S3LogsConfig withBucketOwnerAccess(BucketOwnerAccessEnumValue bucketOwnerAccess) { + this.bucketOwnerAccess = bucketOwnerAccess; + return this; + } + + /** + * Get the encryptionDisabled property: <p> Set to true if you do not want your S3 build log output encrypted. + * By default S3 build logs are encrypted. </p>. + * + * @return the encryptionDisabled value. + */ + public Boolean encryptionDisabled() { + return this.encryptionDisabled; + } + + /** + * Set the encryptionDisabled property: <p> Set to true if you do not want your S3 build log output encrypted. + * By default S3 build logs are encrypted. </p>. + * + * @param encryptionDisabled the encryptionDisabled value to set. + * @return the S3LogsConfig object itself. + */ + public S3LogsConfig withEncryptionDisabled(Boolean encryptionDisabled) { + this.encryptionDisabled = encryptionDisabled; + return this; + } + + /** + * Get the location property: <p> The ARN of an S3 bucket and the path prefix for S3 logs. If your Amazon S3 + * bucket name is <code>my-bucket</code>, and your path prefix is <code>build-log</code>, + * then acceptable formats are <code>my-bucket/build-log</code> or + * <code>arn:aws:s3:::my-bucket/build-log</code>. </p>. + * + * @return the location value. + */ + public String location() { + return this.location; + } + + /** + * Set the location property: <p> The ARN of an S3 bucket and the path prefix for S3 logs. If your Amazon S3 + * bucket name is <code>my-bucket</code>, and your path prefix is <code>build-log</code>, + * then acceptable formats are <code>my-bucket/build-log</code> or + * <code>arn:aws:s3:::my-bucket/build-log</code>. </p>. + * + * @param location the location value to set. + * @return the S3LogsConfig object itself. + */ + public S3LogsConfig withLocation(String location) { + this.location = location; + return this; + } + + /** + * Get the status property: <p>The current status of the S3 build logs. Valid values are:</p> <ul> + * <li> <p> <code>ENABLED</code>: S3 build logs are enabled for this build + * project.</p> </li> <li> <p> <code>DISABLED</code>: S3 build logs are not + * enabled for this build project.</p> </li> </ul>. + * + * @return the status value. + */ + public LogsConfigStatusTypeEnumValue status() { + return this.status; + } + + /** + * Set the status property: <p>The current status of the S3 build logs. Valid values are:</p> <ul> + * <li> <p> <code>ENABLED</code>: S3 build logs are enabled for this build + * project.</p> </li> <li> <p> <code>DISABLED</code>: S3 build logs are not + * enabled for this build project.</p> </li> </ul>. + * + * @param status the status value to set. + * @return the S3LogsConfig object itself. + */ + public S3LogsConfig withStatus(LogsConfigStatusTypeEnumValue status) { + this.status = status; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (bucketOwnerAccess() != null) { + bucketOwnerAccess().validate(); + } + if (status() != null) { + status().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("bucketOwnerAccess", this.bucketOwnerAccess); + jsonWriter.writeBooleanField("encryptionDisabled", this.encryptionDisabled); + jsonWriter.writeStringField("location", this.location); + jsonWriter.writeJsonField("status", this.status); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of S3LogsConfig from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of S3LogsConfig if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the S3LogsConfig. + */ + public static S3LogsConfig fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + S3LogsConfig deserializedS3LogsConfig = new S3LogsConfig(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("bucketOwnerAccess".equals(fieldName)) { + deserializedS3LogsConfig.bucketOwnerAccess = BucketOwnerAccessEnumValue.fromJson(reader); + } else if ("encryptionDisabled".equals(fieldName)) { + deserializedS3LogsConfig.encryptionDisabled = reader.getNullable(JsonReader::getBoolean); + } else if ("location".equals(fieldName)) { + deserializedS3LogsConfig.location = reader.getString(); + } else if ("status".equals(fieldName)) { + deserializedS3LogsConfig.status = LogsConfigStatusTypeEnumValue.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedS3LogsConfig; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/S3OriginConfig.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/S3OriginConfig.java new file mode 100644 index 000000000000..df0365c3ae9e --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/S3OriginConfig.java @@ -0,0 +1,125 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of S3OriginConfig. + */ +@Fluent +public final class S3OriginConfig implements JsonSerializable { + /* + * The CloudFront origin access identity to associate with the origin. Use an origin access identity to configure + * the origin so that viewers can *only* access objects in an Amazon S3 bucket through CloudFront. The format of the + * value is: origin-access-identity/cloudfront/*ID-of-origin-access-identity* where ``ID-of-origin-access-identity`` + * is the value that CloudFront returned in the ``ID`` element when you created the origin access identity. If you + * want viewers to be able to access objects using either the CloudFront URL or the Amazon S3 URL, specify an empty + * ``OriginAccessIdentity`` element. To delete the origin access identity from an existing distribution, update the + * distribution configuration and include an empty ``OriginAccessIdentity`` element. To replace the origin access + * identity, update the distribution configuration and specify the new origin access identity. For more information + * about the origin access identity, see [Serving Private Content through + * CloudFront](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/PrivateContent.html) in the + * *Amazon CloudFront Developer Guide*. + */ + private String originAccessIdentity; + + /** + * Creates an instance of S3OriginConfig class. + */ + public S3OriginConfig() { + } + + /** + * Get the originAccessIdentity property: The CloudFront origin access identity to associate with the origin. Use an + * origin access identity to configure the origin so that viewers can *only* access objects in an Amazon S3 bucket + * through CloudFront. The format of the value is: origin-access-identity/cloudfront/*ID-of-origin-access-identity* + * where ``ID-of-origin-access-identity`` is the value that CloudFront returned in the ``ID`` element when you + * created the origin access identity. If you want viewers to be able to access objects using either the CloudFront + * URL or the Amazon S3 URL, specify an empty ``OriginAccessIdentity`` element. To delete the origin access identity + * from an existing distribution, update the distribution configuration and include an empty + * ``OriginAccessIdentity`` element. To replace the origin access identity, update the distribution configuration + * and specify the new origin access identity. For more information about the origin access identity, see [Serving + * Private Content through + * CloudFront](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/PrivateContent.html) in the + * *Amazon CloudFront Developer Guide*. + * + * @return the originAccessIdentity value. + */ + public String originAccessIdentity() { + return this.originAccessIdentity; + } + + /** + * Set the originAccessIdentity property: The CloudFront origin access identity to associate with the origin. Use an + * origin access identity to configure the origin so that viewers can *only* access objects in an Amazon S3 bucket + * through CloudFront. The format of the value is: origin-access-identity/cloudfront/*ID-of-origin-access-identity* + * where ``ID-of-origin-access-identity`` is the value that CloudFront returned in the ``ID`` element when you + * created the origin access identity. If you want viewers to be able to access objects using either the CloudFront + * URL or the Amazon S3 URL, specify an empty ``OriginAccessIdentity`` element. To delete the origin access identity + * from an existing distribution, update the distribution configuration and include an empty + * ``OriginAccessIdentity`` element. To replace the origin access identity, update the distribution configuration + * and specify the new origin access identity. For more information about the origin access identity, see [Serving + * Private Content through + * CloudFront](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/PrivateContent.html) in the + * *Amazon CloudFront Developer Guide*. + * + * @param originAccessIdentity the originAccessIdentity value to set. + * @return the S3OriginConfig object itself. + */ + public S3OriginConfig withOriginAccessIdentity(String originAccessIdentity) { + this.originAccessIdentity = originAccessIdentity; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("originAccessIdentity", this.originAccessIdentity); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of S3OriginConfig from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of S3OriginConfig if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the S3OriginConfig. + */ + public static S3OriginConfig fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + S3OriginConfig deserializedS3OriginConfig = new S3OriginConfig(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("originAccessIdentity".equals(fieldName)) { + deserializedS3OriginConfig.originAccessIdentity = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedS3OriginConfig; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/S3WordsList.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/S3WordsList.java new file mode 100644 index 000000000000..6eef182d0a66 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/S3WordsList.java @@ -0,0 +1,121 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of S3WordsList. + */ +@Fluent +public final class S3WordsList implements JsonSerializable { + /* + * Property bucketName + */ + private String bucketName; + + /* + * Property objectKey + */ + private String objectKey; + + /** + * Creates an instance of S3WordsList class. + */ + public S3WordsList() { + } + + /** + * Get the bucketName property: Property bucketName. + * + * @return the bucketName value. + */ + public String bucketName() { + return this.bucketName; + } + + /** + * Set the bucketName property: Property bucketName. + * + * @param bucketName the bucketName value to set. + * @return the S3WordsList object itself. + */ + public S3WordsList withBucketName(String bucketName) { + this.bucketName = bucketName; + return this; + } + + /** + * Get the objectKey property: Property objectKey. + * + * @return the objectKey value. + */ + public String objectKey() { + return this.objectKey; + } + + /** + * Set the objectKey property: Property objectKey. + * + * @param objectKey the objectKey value to set. + * @return the S3WordsList object itself. + */ + public S3WordsList withObjectKey(String objectKey) { + this.objectKey = objectKey; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("bucketName", this.bucketName); + jsonWriter.writeStringField("objectKey", this.objectKey); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of S3WordsList from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of S3WordsList if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the S3WordsList. + */ + public static S3WordsList fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + S3WordsList deserializedS3WordsList = new S3WordsList(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("bucketName".equals(fieldName)) { + deserializedS3WordsList.bucketName = reader.getString(); + } else if ("objectKey".equals(fieldName)) { + deserializedS3WordsList.objectKey = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedS3WordsList; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/SageMakerApp.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/SageMakerApp.java new file mode 100644 index 000000000000..f5d0cce83da0 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/SageMakerApp.java @@ -0,0 +1,252 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.awsconnector.fluent.models.SageMakerAppInner; +import java.util.Map; + +/** + * An immutable client-side representation of SageMakerApp. + */ +public interface SageMakerApp { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the location property: The geo-location where the resource lives. + * + * @return the location value. + */ + String location(); + + /** + * Gets the tags property: Resource tags. + * + * @return the tags value. + */ + Map tags(); + + /** + * Gets the properties property: The resource-specific properties for this resource. + * + * @return the properties value. + */ + SageMakerAppProperties properties(); + + /** + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the region of the resource. + * + * @return the region of the resource. + */ + Region region(); + + /** + * Gets the name of the resource region. + * + * @return the name of the resource region. + */ + String regionName(); + + /** + * Gets the name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + + /** + * Gets the inner com.azure.resourcemanager.awsconnector.fluent.models.SageMakerAppInner object. + * + * @return the inner object. + */ + SageMakerAppInner innerModel(); + + /** + * The entirety of the SageMakerApp definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithLocation, + DefinitionStages.WithResourceGroup, DefinitionStages.WithCreate { + } + + /** + * The SageMakerApp definition stages. + */ + interface DefinitionStages { + /** + * The first stage of the SageMakerApp definition. + */ + interface Blank extends WithLocation { + } + + /** + * The stage of the SageMakerApp definition allowing to specify location. + */ + interface WithLocation { + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithResourceGroup withRegion(Region location); + + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithResourceGroup withRegion(String location); + } + + /** + * The stage of the SageMakerApp definition allowing to specify parent resource. + */ + interface WithResourceGroup { + /** + * Specifies resourceGroupName. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @return the next definition stage. + */ + WithCreate withExistingResourceGroup(String resourceGroupName); + } + + /** + * The stage of the SageMakerApp 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.WithProperties { + /** + * Executes the create request. + * + * @return the created resource. + */ + SageMakerApp create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + SageMakerApp create(Context context); + } + + /** + * The stage of the SageMakerApp definition allowing to specify tags. + */ + interface WithTags { + /** + * Specifies the tags property: Resource tags.. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + WithCreate withTags(Map tags); + } + + /** + * The stage of the SageMakerApp definition allowing to specify properties. + */ + interface WithProperties { + /** + * Specifies the properties property: The resource-specific properties for this resource.. + * + * @param properties The resource-specific properties for this resource. + * @return the next definition stage. + */ + WithCreate withProperties(SageMakerAppProperties properties); + } + } + + /** + * Begins update for the SageMakerApp resource. + * + * @return the stage of resource update. + */ + SageMakerApp.Update update(); + + /** + * The template for SageMakerApp update. + */ + interface Update extends UpdateStages.WithTags { + /** + * Executes the update request. + * + * @return the updated resource. + */ + SageMakerApp apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + SageMakerApp apply(Context context); + } + + /** + * The SageMakerApp update stages. + */ + interface UpdateStages { + /** + * The stage of the SageMakerApp update allowing to specify tags. + */ + interface WithTags { + /** + * Specifies the tags property: Resource tags.. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + Update withTags(Map tags); + } + } + + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + SageMakerApp refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + SageMakerApp refresh(Context context); +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/SageMakerAppListResult.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/SageMakerAppListResult.java new file mode 100644 index 000000000000..704b46c74265 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/SageMakerAppListResult.java @@ -0,0 +1,134 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.awsconnector.fluent.models.SageMakerAppInner; +import java.io.IOException; +import java.util.List; + +/** + * The response of a SageMakerApp list operation. + */ +@Fluent +public final class SageMakerAppListResult implements JsonSerializable { + /* + * The SageMakerApp items on this page + */ + private List value; + + /* + * The link to the next page of items + */ + private String nextLink; + + /** + * Creates an instance of SageMakerAppListResult class. + */ + public SageMakerAppListResult() { + } + + /** + * Get the value property: The SageMakerApp items on this page. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The SageMakerApp items on this page. + * + * @param value the value value to set. + * @return the SageMakerAppListResult object itself. + */ + public SageMakerAppListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The link to the next page of items. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: The link to the next page of items. + * + * @param nextLink the nextLink value to set. + * @return the SageMakerAppListResult object itself. + */ + public SageMakerAppListResult withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property value in model SageMakerAppListResult")); + } else { + value().forEach(e -> e.validate()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(SageMakerAppListResult.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("nextLink", this.nextLink); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of SageMakerAppListResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of SageMakerAppListResult if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the SageMakerAppListResult. + */ + public static SageMakerAppListResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + SageMakerAppListResult deserializedSageMakerAppListResult = new SageMakerAppListResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value = reader.readArray(reader1 -> SageMakerAppInner.fromJson(reader1)); + deserializedSageMakerAppListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedSageMakerAppListResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedSageMakerAppListResult; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/SageMakerAppProperties.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/SageMakerAppProperties.java new file mode 100644 index 000000000000..0a20615faf1a --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/SageMakerAppProperties.java @@ -0,0 +1,311 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.Map; + +/** + * Definition of SageMakerApp. + */ +@Fluent +public final class SageMakerAppProperties implements JsonSerializable { + /* + * AWS Properties + */ + private AwsSageMakerAppProperties awsProperties; + + /* + * Public Cloud Connectors Resource ID + */ + private String publicCloudConnectorsResourceId; + + /* + * AWS Account ID + */ + private String awsAccountId; + + /* + * Amazon Resource Name (ARN) + */ + private String arn; + + /* + * Public Cloud Resource Name + */ + private String publicCloudResourceName; + + /* + * AWS Source Schema + */ + private String awsSourceSchema; + + /* + * AWS Region + */ + private String awsRegion; + + /* + * AWS Tags + */ + private Map awsTags; + + /* + * The status of the last operation. + */ + private ProvisioningState provisioningState; + + /** + * Creates an instance of SageMakerAppProperties class. + */ + public SageMakerAppProperties() { + } + + /** + * Get the awsProperties property: AWS Properties. + * + * @return the awsProperties value. + */ + public AwsSageMakerAppProperties awsProperties() { + return this.awsProperties; + } + + /** + * Set the awsProperties property: AWS Properties. + * + * @param awsProperties the awsProperties value to set. + * @return the SageMakerAppProperties object itself. + */ + public SageMakerAppProperties withAwsProperties(AwsSageMakerAppProperties awsProperties) { + this.awsProperties = awsProperties; + return this; + } + + /** + * Get the publicCloudConnectorsResourceId property: Public Cloud Connectors Resource ID. + * + * @return the publicCloudConnectorsResourceId value. + */ + public String publicCloudConnectorsResourceId() { + return this.publicCloudConnectorsResourceId; + } + + /** + * Set the publicCloudConnectorsResourceId property: Public Cloud Connectors Resource ID. + * + * @param publicCloudConnectorsResourceId the publicCloudConnectorsResourceId value to set. + * @return the SageMakerAppProperties object itself. + */ + public SageMakerAppProperties withPublicCloudConnectorsResourceId(String publicCloudConnectorsResourceId) { + this.publicCloudConnectorsResourceId = publicCloudConnectorsResourceId; + return this; + } + + /** + * Get the awsAccountId property: AWS Account ID. + * + * @return the awsAccountId value. + */ + public String awsAccountId() { + return this.awsAccountId; + } + + /** + * Set the awsAccountId property: AWS Account ID. + * + * @param awsAccountId the awsAccountId value to set. + * @return the SageMakerAppProperties object itself. + */ + public SageMakerAppProperties withAwsAccountId(String awsAccountId) { + this.awsAccountId = awsAccountId; + return this; + } + + /** + * Get the arn property: Amazon Resource Name (ARN). + * + * @return the arn value. + */ + public String arn() { + return this.arn; + } + + /** + * Set the arn property: Amazon Resource Name (ARN). + * + * @param arn the arn value to set. + * @return the SageMakerAppProperties object itself. + */ + public SageMakerAppProperties withArn(String arn) { + this.arn = arn; + return this; + } + + /** + * Get the publicCloudResourceName property: Public Cloud Resource Name. + * + * @return the publicCloudResourceName value. + */ + public String publicCloudResourceName() { + return this.publicCloudResourceName; + } + + /** + * Set the publicCloudResourceName property: Public Cloud Resource Name. + * + * @param publicCloudResourceName the publicCloudResourceName value to set. + * @return the SageMakerAppProperties object itself. + */ + public SageMakerAppProperties withPublicCloudResourceName(String publicCloudResourceName) { + this.publicCloudResourceName = publicCloudResourceName; + return this; + } + + /** + * Get the awsSourceSchema property: AWS Source Schema. + * + * @return the awsSourceSchema value. + */ + public String awsSourceSchema() { + return this.awsSourceSchema; + } + + /** + * Set the awsSourceSchema property: AWS Source Schema. + * + * @param awsSourceSchema the awsSourceSchema value to set. + * @return the SageMakerAppProperties object itself. + */ + public SageMakerAppProperties withAwsSourceSchema(String awsSourceSchema) { + this.awsSourceSchema = awsSourceSchema; + return this; + } + + /** + * Get the awsRegion property: AWS Region. + * + * @return the awsRegion value. + */ + public String awsRegion() { + return this.awsRegion; + } + + /** + * Set the awsRegion property: AWS Region. + * + * @param awsRegion the awsRegion value to set. + * @return the SageMakerAppProperties object itself. + */ + public SageMakerAppProperties withAwsRegion(String awsRegion) { + this.awsRegion = awsRegion; + return this; + } + + /** + * Get the awsTags property: AWS Tags. + * + * @return the awsTags value. + */ + public Map awsTags() { + return this.awsTags; + } + + /** + * Set the awsTags property: AWS Tags. + * + * @param awsTags the awsTags value to set. + * @return the SageMakerAppProperties object itself. + */ + public SageMakerAppProperties withAwsTags(Map awsTags) { + this.awsTags = awsTags; + return this; + } + + /** + * Get the provisioningState property: The status of the last operation. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (awsProperties() != null) { + awsProperties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("awsProperties", this.awsProperties); + jsonWriter.writeStringField("publicCloudConnectorsResourceId", this.publicCloudConnectorsResourceId); + jsonWriter.writeStringField("awsAccountId", this.awsAccountId); + jsonWriter.writeStringField("arn", this.arn); + jsonWriter.writeStringField("publicCloudResourceName", this.publicCloudResourceName); + jsonWriter.writeStringField("awsSourceSchema", this.awsSourceSchema); + jsonWriter.writeStringField("awsRegion", this.awsRegion); + jsonWriter.writeMapField("awsTags", this.awsTags, (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of SageMakerAppProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of SageMakerAppProperties if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the SageMakerAppProperties. + */ + public static SageMakerAppProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + SageMakerAppProperties deserializedSageMakerAppProperties = new SageMakerAppProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("awsProperties".equals(fieldName)) { + deserializedSageMakerAppProperties.awsProperties = AwsSageMakerAppProperties.fromJson(reader); + } else if ("publicCloudConnectorsResourceId".equals(fieldName)) { + deserializedSageMakerAppProperties.publicCloudConnectorsResourceId = reader.getString(); + } else if ("awsAccountId".equals(fieldName)) { + deserializedSageMakerAppProperties.awsAccountId = reader.getString(); + } else if ("arn".equals(fieldName)) { + deserializedSageMakerAppProperties.arn = reader.getString(); + } else if ("publicCloudResourceName".equals(fieldName)) { + deserializedSageMakerAppProperties.publicCloudResourceName = reader.getString(); + } else if ("awsSourceSchema".equals(fieldName)) { + deserializedSageMakerAppProperties.awsSourceSchema = reader.getString(); + } else if ("awsRegion".equals(fieldName)) { + deserializedSageMakerAppProperties.awsRegion = reader.getString(); + } else if ("awsTags".equals(fieldName)) { + Map awsTags = reader.readMap(reader1 -> reader1.getString()); + deserializedSageMakerAppProperties.awsTags = awsTags; + } else if ("provisioningState".equals(fieldName)) { + deserializedSageMakerAppProperties.provisioningState + = ProvisioningState.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedSageMakerAppProperties; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/SageMakerAppTagsUpdate.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/SageMakerAppTagsUpdate.java new file mode 100644 index 000000000000..0fcb6346406f --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/SageMakerAppTagsUpdate.java @@ -0,0 +1,95 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.Map; + +/** + * The type used for updating tags in SageMakerApp resources. + */ +@Fluent +public final class SageMakerAppTagsUpdate implements JsonSerializable { + /* + * Resource tags. + */ + private Map tags; + + /** + * Creates an instance of SageMakerAppTagsUpdate class. + */ + public SageMakerAppTagsUpdate() { + } + + /** + * Get the tags property: Resource tags. + * + * @return the tags value. + */ + public Map tags() { + return this.tags; + } + + /** + * Set the tags property: Resource tags. + * + * @param tags the tags value to set. + * @return the SageMakerAppTagsUpdate object itself. + */ + public SageMakerAppTagsUpdate withTags(Map tags) { + this.tags = tags; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeMapField("tags", this.tags, (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of SageMakerAppTagsUpdate from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of SageMakerAppTagsUpdate if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the SageMakerAppTagsUpdate. + */ + public static SageMakerAppTagsUpdate fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + SageMakerAppTagsUpdate deserializedSageMakerAppTagsUpdate = new SageMakerAppTagsUpdate(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedSageMakerAppTagsUpdate.tags = tags; + } else { + reader.skipChildren(); + } + } + + return deserializedSageMakerAppTagsUpdate; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/SageMakerApps.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/SageMakerApps.java new file mode 100644 index 000000000000..6f52b692bc14 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/SageMakerApps.java @@ -0,0 +1,157 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** + * Resource collection API of SageMakerApps. + */ +public interface SageMakerApps { + /** + * List SageMakerApp resources by subscription ID. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a SageMakerApp list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable list(); + + /** + * List SageMakerApp resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a SageMakerApp list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable list(Context context); + + /** + * List SageMakerApp resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a SageMakerApp list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * List SageMakerApp resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a SageMakerApp list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Get a SageMakerApp. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of SageMakerApp. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a SageMakerApp along with {@link Response}. + */ + Response getByResourceGroupWithResponse(String resourceGroupName, String name, Context context); + + /** + * Get a SageMakerApp. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of SageMakerApp. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a SageMakerApp. + */ + SageMakerApp getByResourceGroup(String resourceGroupName, String name); + + /** + * Delete a SageMakerApp. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of SageMakerApp. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByResourceGroup(String resourceGroupName, String name); + + /** + * Delete a SageMakerApp. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of SageMakerApp. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String name, Context context); + + /** + * Get a SageMakerApp. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a SageMakerApp along with {@link Response}. + */ + SageMakerApp getById(String id); + + /** + * Get a SageMakerApp. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a SageMakerApp along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Delete a SageMakerApp. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteById(String id); + + /** + * Delete a SageMakerApp. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new SageMakerApp resource. + * + * @param name resource name. + * @return the first stage of the new SageMakerApp definition. + */ + SageMakerApp.DefinitionStages.Blank define(String name); +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/SageMakerNotebookInstanceSummaries.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/SageMakerNotebookInstanceSummaries.java new file mode 100644 index 000000000000..ac8d1db774ab --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/SageMakerNotebookInstanceSummaries.java @@ -0,0 +1,162 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** + * Resource collection API of SageMakerNotebookInstanceSummaries. + */ +public interface SageMakerNotebookInstanceSummaries { + /** + * List SageMakerNotebookInstanceSummary resources by subscription ID. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a SageMakerNotebookInstanceSummary list operation as paginated response with + * {@link PagedIterable}. + */ + PagedIterable list(); + + /** + * List SageMakerNotebookInstanceSummary resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a SageMakerNotebookInstanceSummary list operation as paginated response with + * {@link PagedIterable}. + */ + PagedIterable list(Context context); + + /** + * List SageMakerNotebookInstanceSummary resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a SageMakerNotebookInstanceSummary list operation as paginated response with + * {@link PagedIterable}. + */ + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * List SageMakerNotebookInstanceSummary resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a SageMakerNotebookInstanceSummary list operation as paginated response with + * {@link PagedIterable}. + */ + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Get a SageMakerNotebookInstanceSummary. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of SageMakerNotebookInstanceSummary. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a SageMakerNotebookInstanceSummary along with {@link Response}. + */ + Response getByResourceGroupWithResponse(String resourceGroupName, String name, + Context context); + + /** + * Get a SageMakerNotebookInstanceSummary. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of SageMakerNotebookInstanceSummary. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a SageMakerNotebookInstanceSummary. + */ + SageMakerNotebookInstanceSummary getByResourceGroup(String resourceGroupName, String name); + + /** + * Delete a SageMakerNotebookInstanceSummary. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of SageMakerNotebookInstanceSummary. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByResourceGroup(String resourceGroupName, String name); + + /** + * Delete a SageMakerNotebookInstanceSummary. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of SageMakerNotebookInstanceSummary. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String name, Context context); + + /** + * Get a SageMakerNotebookInstanceSummary. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a SageMakerNotebookInstanceSummary along with {@link Response}. + */ + SageMakerNotebookInstanceSummary getById(String id); + + /** + * Get a SageMakerNotebookInstanceSummary. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a SageMakerNotebookInstanceSummary along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Delete a SageMakerNotebookInstanceSummary. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteById(String id); + + /** + * Delete a SageMakerNotebookInstanceSummary. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new SageMakerNotebookInstanceSummary resource. + * + * @param name resource name. + * @return the first stage of the new SageMakerNotebookInstanceSummary definition. + */ + SageMakerNotebookInstanceSummary.DefinitionStages.Blank define(String name); +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/SageMakerNotebookInstanceSummary.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/SageMakerNotebookInstanceSummary.java new file mode 100644 index 000000000000..2fbbb1e23a40 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/SageMakerNotebookInstanceSummary.java @@ -0,0 +1,252 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.awsconnector.fluent.models.SageMakerNotebookInstanceSummaryInner; +import java.util.Map; + +/** + * An immutable client-side representation of SageMakerNotebookInstanceSummary. + */ +public interface SageMakerNotebookInstanceSummary { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the location property: The geo-location where the resource lives. + * + * @return the location value. + */ + String location(); + + /** + * Gets the tags property: Resource tags. + * + * @return the tags value. + */ + Map tags(); + + /** + * Gets the properties property: The resource-specific properties for this resource. + * + * @return the properties value. + */ + SageMakerNotebookInstanceSummaryProperties properties(); + + /** + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the region of the resource. + * + * @return the region of the resource. + */ + Region region(); + + /** + * Gets the name of the resource region. + * + * @return the name of the resource region. + */ + String regionName(); + + /** + * Gets the name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + + /** + * Gets the inner com.azure.resourcemanager.awsconnector.fluent.models.SageMakerNotebookInstanceSummaryInner object. + * + * @return the inner object. + */ + SageMakerNotebookInstanceSummaryInner innerModel(); + + /** + * The entirety of the SageMakerNotebookInstanceSummary definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithLocation, + DefinitionStages.WithResourceGroup, DefinitionStages.WithCreate { + } + + /** + * The SageMakerNotebookInstanceSummary definition stages. + */ + interface DefinitionStages { + /** + * The first stage of the SageMakerNotebookInstanceSummary definition. + */ + interface Blank extends WithLocation { + } + + /** + * The stage of the SageMakerNotebookInstanceSummary definition allowing to specify location. + */ + interface WithLocation { + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithResourceGroup withRegion(Region location); + + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithResourceGroup withRegion(String location); + } + + /** + * The stage of the SageMakerNotebookInstanceSummary definition allowing to specify parent resource. + */ + interface WithResourceGroup { + /** + * Specifies resourceGroupName. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @return the next definition stage. + */ + WithCreate withExistingResourceGroup(String resourceGroupName); + } + + /** + * The stage of the SageMakerNotebookInstanceSummary 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.WithProperties { + /** + * Executes the create request. + * + * @return the created resource. + */ + SageMakerNotebookInstanceSummary create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + SageMakerNotebookInstanceSummary create(Context context); + } + + /** + * The stage of the SageMakerNotebookInstanceSummary definition allowing to specify tags. + */ + interface WithTags { + /** + * Specifies the tags property: Resource tags.. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + WithCreate withTags(Map tags); + } + + /** + * The stage of the SageMakerNotebookInstanceSummary definition allowing to specify properties. + */ + interface WithProperties { + /** + * Specifies the properties property: The resource-specific properties for this resource.. + * + * @param properties The resource-specific properties for this resource. + * @return the next definition stage. + */ + WithCreate withProperties(SageMakerNotebookInstanceSummaryProperties properties); + } + } + + /** + * Begins update for the SageMakerNotebookInstanceSummary resource. + * + * @return the stage of resource update. + */ + SageMakerNotebookInstanceSummary.Update update(); + + /** + * The template for SageMakerNotebookInstanceSummary update. + */ + interface Update extends UpdateStages.WithTags { + /** + * Executes the update request. + * + * @return the updated resource. + */ + SageMakerNotebookInstanceSummary apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + SageMakerNotebookInstanceSummary apply(Context context); + } + + /** + * The SageMakerNotebookInstanceSummary update stages. + */ + interface UpdateStages { + /** + * The stage of the SageMakerNotebookInstanceSummary update allowing to specify tags. + */ + interface WithTags { + /** + * Specifies the tags property: Resource tags.. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + Update withTags(Map tags); + } + } + + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + SageMakerNotebookInstanceSummary refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + SageMakerNotebookInstanceSummary refresh(Context context); +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/SageMakerNotebookInstanceSummaryListResult.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/SageMakerNotebookInstanceSummaryListResult.java new file mode 100644 index 000000000000..2d39888876a9 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/SageMakerNotebookInstanceSummaryListResult.java @@ -0,0 +1,138 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.awsconnector.fluent.models.SageMakerNotebookInstanceSummaryInner; +import java.io.IOException; +import java.util.List; + +/** + * The response of a SageMakerNotebookInstanceSummary list operation. + */ +@Fluent +public final class SageMakerNotebookInstanceSummaryListResult + implements JsonSerializable { + /* + * The SageMakerNotebookInstanceSummary items on this page + */ + private List value; + + /* + * The link to the next page of items + */ + private String nextLink; + + /** + * Creates an instance of SageMakerNotebookInstanceSummaryListResult class. + */ + public SageMakerNotebookInstanceSummaryListResult() { + } + + /** + * Get the value property: The SageMakerNotebookInstanceSummary items on this page. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The SageMakerNotebookInstanceSummary items on this page. + * + * @param value the value value to set. + * @return the SageMakerNotebookInstanceSummaryListResult object itself. + */ + public SageMakerNotebookInstanceSummaryListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The link to the next page of items. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: The link to the next page of items. + * + * @param nextLink the nextLink value to set. + * @return the SageMakerNotebookInstanceSummaryListResult object itself. + */ + public SageMakerNotebookInstanceSummaryListResult withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property value in model SageMakerNotebookInstanceSummaryListResult")); + } else { + value().forEach(e -> e.validate()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(SageMakerNotebookInstanceSummaryListResult.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("nextLink", this.nextLink); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of SageMakerNotebookInstanceSummaryListResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of SageMakerNotebookInstanceSummaryListResult if the JsonReader was pointing to an instance + * of it, or null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the SageMakerNotebookInstanceSummaryListResult. + */ + public static SageMakerNotebookInstanceSummaryListResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + SageMakerNotebookInstanceSummaryListResult deserializedSageMakerNotebookInstanceSummaryListResult + = new SageMakerNotebookInstanceSummaryListResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> SageMakerNotebookInstanceSummaryInner.fromJson(reader1)); + deserializedSageMakerNotebookInstanceSummaryListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedSageMakerNotebookInstanceSummaryListResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedSageMakerNotebookInstanceSummaryListResult; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/SageMakerNotebookInstanceSummaryProperties.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/SageMakerNotebookInstanceSummaryProperties.java new file mode 100644 index 000000000000..795595792846 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/SageMakerNotebookInstanceSummaryProperties.java @@ -0,0 +1,317 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.Map; + +/** + * Definition of SageMakerNotebookInstanceSummary. + */ +@Fluent +public final class SageMakerNotebookInstanceSummaryProperties + implements JsonSerializable { + /* + * AWS Properties + */ + private AwsSageMakerNotebookInstanceSummaryProperties awsProperties; + + /* + * Public Cloud Connectors Resource ID + */ + private String publicCloudConnectorsResourceId; + + /* + * AWS Account ID + */ + private String awsAccountId; + + /* + * Amazon Resource Name (ARN) + */ + private String arn; + + /* + * Public Cloud Resource Name + */ + private String publicCloudResourceName; + + /* + * AWS Source Schema + */ + private String awsSourceSchema; + + /* + * AWS Region + */ + private String awsRegion; + + /* + * AWS Tags + */ + private Map awsTags; + + /* + * The status of the last operation. + */ + private ProvisioningState provisioningState; + + /** + * Creates an instance of SageMakerNotebookInstanceSummaryProperties class. + */ + public SageMakerNotebookInstanceSummaryProperties() { + } + + /** + * Get the awsProperties property: AWS Properties. + * + * @return the awsProperties value. + */ + public AwsSageMakerNotebookInstanceSummaryProperties awsProperties() { + return this.awsProperties; + } + + /** + * Set the awsProperties property: AWS Properties. + * + * @param awsProperties the awsProperties value to set. + * @return the SageMakerNotebookInstanceSummaryProperties object itself. + */ + public SageMakerNotebookInstanceSummaryProperties + withAwsProperties(AwsSageMakerNotebookInstanceSummaryProperties awsProperties) { + this.awsProperties = awsProperties; + return this; + } + + /** + * Get the publicCloudConnectorsResourceId property: Public Cloud Connectors Resource ID. + * + * @return the publicCloudConnectorsResourceId value. + */ + public String publicCloudConnectorsResourceId() { + return this.publicCloudConnectorsResourceId; + } + + /** + * Set the publicCloudConnectorsResourceId property: Public Cloud Connectors Resource ID. + * + * @param publicCloudConnectorsResourceId the publicCloudConnectorsResourceId value to set. + * @return the SageMakerNotebookInstanceSummaryProperties object itself. + */ + public SageMakerNotebookInstanceSummaryProperties + withPublicCloudConnectorsResourceId(String publicCloudConnectorsResourceId) { + this.publicCloudConnectorsResourceId = publicCloudConnectorsResourceId; + return this; + } + + /** + * Get the awsAccountId property: AWS Account ID. + * + * @return the awsAccountId value. + */ + public String awsAccountId() { + return this.awsAccountId; + } + + /** + * Set the awsAccountId property: AWS Account ID. + * + * @param awsAccountId the awsAccountId value to set. + * @return the SageMakerNotebookInstanceSummaryProperties object itself. + */ + public SageMakerNotebookInstanceSummaryProperties withAwsAccountId(String awsAccountId) { + this.awsAccountId = awsAccountId; + return this; + } + + /** + * Get the arn property: Amazon Resource Name (ARN). + * + * @return the arn value. + */ + public String arn() { + return this.arn; + } + + /** + * Set the arn property: Amazon Resource Name (ARN). + * + * @param arn the arn value to set. + * @return the SageMakerNotebookInstanceSummaryProperties object itself. + */ + public SageMakerNotebookInstanceSummaryProperties withArn(String arn) { + this.arn = arn; + return this; + } + + /** + * Get the publicCloudResourceName property: Public Cloud Resource Name. + * + * @return the publicCloudResourceName value. + */ + public String publicCloudResourceName() { + return this.publicCloudResourceName; + } + + /** + * Set the publicCloudResourceName property: Public Cloud Resource Name. + * + * @param publicCloudResourceName the publicCloudResourceName value to set. + * @return the SageMakerNotebookInstanceSummaryProperties object itself. + */ + public SageMakerNotebookInstanceSummaryProperties withPublicCloudResourceName(String publicCloudResourceName) { + this.publicCloudResourceName = publicCloudResourceName; + return this; + } + + /** + * Get the awsSourceSchema property: AWS Source Schema. + * + * @return the awsSourceSchema value. + */ + public String awsSourceSchema() { + return this.awsSourceSchema; + } + + /** + * Set the awsSourceSchema property: AWS Source Schema. + * + * @param awsSourceSchema the awsSourceSchema value to set. + * @return the SageMakerNotebookInstanceSummaryProperties object itself. + */ + public SageMakerNotebookInstanceSummaryProperties withAwsSourceSchema(String awsSourceSchema) { + this.awsSourceSchema = awsSourceSchema; + return this; + } + + /** + * Get the awsRegion property: AWS Region. + * + * @return the awsRegion value. + */ + public String awsRegion() { + return this.awsRegion; + } + + /** + * Set the awsRegion property: AWS Region. + * + * @param awsRegion the awsRegion value to set. + * @return the SageMakerNotebookInstanceSummaryProperties object itself. + */ + public SageMakerNotebookInstanceSummaryProperties withAwsRegion(String awsRegion) { + this.awsRegion = awsRegion; + return this; + } + + /** + * Get the awsTags property: AWS Tags. + * + * @return the awsTags value. + */ + public Map awsTags() { + return this.awsTags; + } + + /** + * Set the awsTags property: AWS Tags. + * + * @param awsTags the awsTags value to set. + * @return the SageMakerNotebookInstanceSummaryProperties object itself. + */ + public SageMakerNotebookInstanceSummaryProperties withAwsTags(Map awsTags) { + this.awsTags = awsTags; + return this; + } + + /** + * Get the provisioningState property: The status of the last operation. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (awsProperties() != null) { + awsProperties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("awsProperties", this.awsProperties); + jsonWriter.writeStringField("publicCloudConnectorsResourceId", this.publicCloudConnectorsResourceId); + jsonWriter.writeStringField("awsAccountId", this.awsAccountId); + jsonWriter.writeStringField("arn", this.arn); + jsonWriter.writeStringField("publicCloudResourceName", this.publicCloudResourceName); + jsonWriter.writeStringField("awsSourceSchema", this.awsSourceSchema); + jsonWriter.writeStringField("awsRegion", this.awsRegion); + jsonWriter.writeMapField("awsTags", this.awsTags, (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of SageMakerNotebookInstanceSummaryProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of SageMakerNotebookInstanceSummaryProperties if the JsonReader was pointing to an instance + * of it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the SageMakerNotebookInstanceSummaryProperties. + */ + public static SageMakerNotebookInstanceSummaryProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + SageMakerNotebookInstanceSummaryProperties deserializedSageMakerNotebookInstanceSummaryProperties + = new SageMakerNotebookInstanceSummaryProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("awsProperties".equals(fieldName)) { + deserializedSageMakerNotebookInstanceSummaryProperties.awsProperties + = AwsSageMakerNotebookInstanceSummaryProperties.fromJson(reader); + } else if ("publicCloudConnectorsResourceId".equals(fieldName)) { + deserializedSageMakerNotebookInstanceSummaryProperties.publicCloudConnectorsResourceId + = reader.getString(); + } else if ("awsAccountId".equals(fieldName)) { + deserializedSageMakerNotebookInstanceSummaryProperties.awsAccountId = reader.getString(); + } else if ("arn".equals(fieldName)) { + deserializedSageMakerNotebookInstanceSummaryProperties.arn = reader.getString(); + } else if ("publicCloudResourceName".equals(fieldName)) { + deserializedSageMakerNotebookInstanceSummaryProperties.publicCloudResourceName = reader.getString(); + } else if ("awsSourceSchema".equals(fieldName)) { + deserializedSageMakerNotebookInstanceSummaryProperties.awsSourceSchema = reader.getString(); + } else if ("awsRegion".equals(fieldName)) { + deserializedSageMakerNotebookInstanceSummaryProperties.awsRegion = reader.getString(); + } else if ("awsTags".equals(fieldName)) { + Map awsTags = reader.readMap(reader1 -> reader1.getString()); + deserializedSageMakerNotebookInstanceSummaryProperties.awsTags = awsTags; + } else if ("provisioningState".equals(fieldName)) { + deserializedSageMakerNotebookInstanceSummaryProperties.provisioningState + = ProvisioningState.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedSageMakerNotebookInstanceSummaryProperties; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/SageMakerNotebookInstanceSummaryTagsUpdate.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/SageMakerNotebookInstanceSummaryTagsUpdate.java new file mode 100644 index 000000000000..1fd3cd938426 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/SageMakerNotebookInstanceSummaryTagsUpdate.java @@ -0,0 +1,97 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.Map; + +/** + * The type used for updating tags in SageMakerNotebookInstanceSummary resources. + */ +@Fluent +public final class SageMakerNotebookInstanceSummaryTagsUpdate + implements JsonSerializable { + /* + * Resource tags. + */ + private Map tags; + + /** + * Creates an instance of SageMakerNotebookInstanceSummaryTagsUpdate class. + */ + public SageMakerNotebookInstanceSummaryTagsUpdate() { + } + + /** + * Get the tags property: Resource tags. + * + * @return the tags value. + */ + public Map tags() { + return this.tags; + } + + /** + * Set the tags property: Resource tags. + * + * @param tags the tags value to set. + * @return the SageMakerNotebookInstanceSummaryTagsUpdate object itself. + */ + public SageMakerNotebookInstanceSummaryTagsUpdate withTags(Map tags) { + this.tags = tags; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeMapField("tags", this.tags, (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of SageMakerNotebookInstanceSummaryTagsUpdate from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of SageMakerNotebookInstanceSummaryTagsUpdate if the JsonReader was pointing to an instance + * of it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the SageMakerNotebookInstanceSummaryTagsUpdate. + */ + public static SageMakerNotebookInstanceSummaryTagsUpdate fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + SageMakerNotebookInstanceSummaryTagsUpdate deserializedSageMakerNotebookInstanceSummaryTagsUpdate + = new SageMakerNotebookInstanceSummaryTagsUpdate(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedSageMakerNotebookInstanceSummaryTagsUpdate.tags = tags; + } else { + reader.skipChildren(); + } + } + + return deserializedSageMakerNotebookInstanceSummaryTagsUpdate; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/SamlIdp.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/SamlIdp.java new file mode 100644 index 000000000000..897562c53e6b --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/SamlIdp.java @@ -0,0 +1,123 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of SAMLIdp. + */ +@Fluent +public final class SamlIdp implements JsonSerializable { + /* + *

The unique entity ID of the application in the SAML identity provider.

+ */ + private String entityId; + + /* + *

The metadata of the SAML application, in XML format.

+ */ + private String metadataContent; + + /** + * Creates an instance of SamlIdp class. + */ + public SamlIdp() { + } + + /** + * Get the entityId property: <p>The unique entity ID of the application in the SAML identity + * provider.</p>. + * + * @return the entityId value. + */ + public String entityId() { + return this.entityId; + } + + /** + * Set the entityId property: <p>The unique entity ID of the application in the SAML identity + * provider.</p>. + * + * @param entityId the entityId value to set. + * @return the SamlIdp object itself. + */ + public SamlIdp withEntityId(String entityId) { + this.entityId = entityId; + return this; + } + + /** + * Get the metadataContent property: <p>The metadata of the SAML application, in XML format.</p>. + * + * @return the metadataContent value. + */ + public String metadataContent() { + return this.metadataContent; + } + + /** + * Set the metadataContent property: <p>The metadata of the SAML application, in XML format.</p>. + * + * @param metadataContent the metadataContent value to set. + * @return the SamlIdp object itself. + */ + public SamlIdp withMetadataContent(String metadataContent) { + this.metadataContent = metadataContent; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("entityId", this.entityId); + jsonWriter.writeStringField("metadataContent", this.metadataContent); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of SamlIdp from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of SamlIdp if the JsonReader was pointing to an instance of it, or null if it was pointing to + * JSON null. + * @throws IOException If an error occurs while reading the SamlIdp. + */ + public static SamlIdp fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + SamlIdp deserializedSamlIdp = new SamlIdp(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("entityId".equals(fieldName)) { + deserializedSamlIdp.entityId = reader.getString(); + } else if ("metadataContent".equals(fieldName)) { + deserializedSamlIdp.metadataContent = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedSamlIdp; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/SamlOptionsOutput.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/SamlOptionsOutput.java new file mode 100644 index 000000000000..5cb1e160a99f --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/SamlOptionsOutput.java @@ -0,0 +1,210 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of SAMLOptionsOutput. + */ +@Fluent +public final class SamlOptionsOutput implements JsonSerializable { + /* + *

True if SAML is enabled.

+ */ + private Boolean enabled; + + /* + *

Describes the SAML identity provider's information.

+ */ + private SamlIdp idp; + + /* + *

The key used for matching the SAML roles attribute.

+ */ + private String rolesKey; + + /* + *

The duration, in minutes, after which a user session becomes inactive.

+ */ + private Integer sessionTimeoutMinutes; + + /* + *

The key used for matching the SAML subject attribute.

+ */ + private String subjectKey; + + /** + * Creates an instance of SamlOptionsOutput class. + */ + public SamlOptionsOutput() { + } + + /** + * Get the enabled property: <p>True if SAML is enabled.</p>. + * + * @return the enabled value. + */ + public Boolean enabled() { + return this.enabled; + } + + /** + * Set the enabled property: <p>True if SAML is enabled.</p>. + * + * @param enabled the enabled value to set. + * @return the SamlOptionsOutput object itself. + */ + public SamlOptionsOutput withEnabled(Boolean enabled) { + this.enabled = enabled; + return this; + } + + /** + * Get the idp property: <p>Describes the SAML identity provider's information.</p>. + * + * @return the idp value. + */ + public SamlIdp idp() { + return this.idp; + } + + /** + * Set the idp property: <p>Describes the SAML identity provider's information.</p>. + * + * @param idp the idp value to set. + * @return the SamlOptionsOutput object itself. + */ + public SamlOptionsOutput withIdp(SamlIdp idp) { + this.idp = idp; + return this; + } + + /** + * Get the rolesKey property: <p>The key used for matching the SAML roles attribute.</p>. + * + * @return the rolesKey value. + */ + public String rolesKey() { + return this.rolesKey; + } + + /** + * Set the rolesKey property: <p>The key used for matching the SAML roles attribute.</p>. + * + * @param rolesKey the rolesKey value to set. + * @return the SamlOptionsOutput object itself. + */ + public SamlOptionsOutput withRolesKey(String rolesKey) { + this.rolesKey = rolesKey; + return this; + } + + /** + * Get the sessionTimeoutMinutes property: <p>The duration, in minutes, after which a user session becomes + * inactive.</p>. + * + * @return the sessionTimeoutMinutes value. + */ + public Integer sessionTimeoutMinutes() { + return this.sessionTimeoutMinutes; + } + + /** + * Set the sessionTimeoutMinutes property: <p>The duration, in minutes, after which a user session becomes + * inactive.</p>. + * + * @param sessionTimeoutMinutes the sessionTimeoutMinutes value to set. + * @return the SamlOptionsOutput object itself. + */ + public SamlOptionsOutput withSessionTimeoutMinutes(Integer sessionTimeoutMinutes) { + this.sessionTimeoutMinutes = sessionTimeoutMinutes; + return this; + } + + /** + * Get the subjectKey property: <p>The key used for matching the SAML subject attribute.</p>. + * + * @return the subjectKey value. + */ + public String subjectKey() { + return this.subjectKey; + } + + /** + * Set the subjectKey property: <p>The key used for matching the SAML subject attribute.</p>. + * + * @param subjectKey the subjectKey value to set. + * @return the SamlOptionsOutput object itself. + */ + public SamlOptionsOutput withSubjectKey(String subjectKey) { + this.subjectKey = subjectKey; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (idp() != null) { + idp().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeBooleanField("enabled", this.enabled); + jsonWriter.writeJsonField("idp", this.idp); + jsonWriter.writeStringField("rolesKey", this.rolesKey); + jsonWriter.writeNumberField("sessionTimeoutMinutes", this.sessionTimeoutMinutes); + jsonWriter.writeStringField("subjectKey", this.subjectKey); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of SamlOptionsOutput from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of SamlOptionsOutput if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the SamlOptionsOutput. + */ + public static SamlOptionsOutput fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + SamlOptionsOutput deserializedSamlOptionsOutput = new SamlOptionsOutput(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("enabled".equals(fieldName)) { + deserializedSamlOptionsOutput.enabled = reader.getNullable(JsonReader::getBoolean); + } else if ("idp".equals(fieldName)) { + deserializedSamlOptionsOutput.idp = SamlIdp.fromJson(reader); + } else if ("rolesKey".equals(fieldName)) { + deserializedSamlOptionsOutput.rolesKey = reader.getString(); + } else if ("sessionTimeoutMinutes".equals(fieldName)) { + deserializedSamlOptionsOutput.sessionTimeoutMinutes = reader.getNullable(JsonReader::getInt); + } else if ("subjectKey".equals(fieldName)) { + deserializedSamlOptionsOutput.subjectKey = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedSamlOptionsOutput; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ScaleDownBehavior.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ScaleDownBehavior.java new file mode 100644 index 000000000000..859fe712adab --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ScaleDownBehavior.java @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * ScaleDownBehavior enum. + */ +public final class ScaleDownBehavior extends ExpandableStringEnum { + /** + * Static value TERMINATE_AT_INSTANCE_HOUR for ScaleDownBehavior. + */ + public static final ScaleDownBehavior TERMINATE_AT_INSTANCE_HOUR = fromString("TERMINATE_AT_INSTANCE_HOUR"); + + /** + * Static value TERMINATE_AT_TASK_COMPLETION for ScaleDownBehavior. + */ + public static final ScaleDownBehavior TERMINATE_AT_TASK_COMPLETION = fromString("TERMINATE_AT_TASK_COMPLETION"); + + /** + * Creates a new instance of ScaleDownBehavior value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ScaleDownBehavior() { + } + + /** + * Creates or finds a ScaleDownBehavior from its string representation. + * + * @param name a name to look for. + * @return the corresponding ScaleDownBehavior. + */ + public static ScaleDownBehavior fromString(String name) { + return fromString(name, ScaleDownBehavior.class); + } + + /** + * Gets known ScaleDownBehavior values. + * + * @return known ScaleDownBehavior values. + */ + public static Collection values() { + return values(ScaleDownBehavior.class); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ScaleDownBehaviorEnumValue.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ScaleDownBehaviorEnumValue.java new file mode 100644 index 000000000000..4d51bd4279f0 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ScaleDownBehaviorEnumValue.java @@ -0,0 +1,93 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of ScaleDownBehaviorEnumValue. + */ +@Fluent +public final class ScaleDownBehaviorEnumValue implements JsonSerializable { + /* + * Property value + */ + private ScaleDownBehavior value; + + /** + * Creates an instance of ScaleDownBehaviorEnumValue class. + */ + public ScaleDownBehaviorEnumValue() { + } + + /** + * Get the value property: Property value. + * + * @return the value value. + */ + public ScaleDownBehavior value() { + return this.value; + } + + /** + * Set the value property: Property value. + * + * @param value the value value to set. + * @return the ScaleDownBehaviorEnumValue object itself. + */ + public ScaleDownBehaviorEnumValue withValue(ScaleDownBehavior value) { + this.value = value; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("value", this.value == null ? null : this.value.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ScaleDownBehaviorEnumValue from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ScaleDownBehaviorEnumValue if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ScaleDownBehaviorEnumValue. + */ + public static ScaleDownBehaviorEnumValue fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ScaleDownBehaviorEnumValue deserializedScaleDownBehaviorEnumValue = new ScaleDownBehaviorEnumValue(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + deserializedScaleDownBehaviorEnumValue.value = ScaleDownBehavior.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedScaleDownBehaviorEnumValue; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ScalingConfig.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ScalingConfig.java new file mode 100644 index 000000000000..f90e638e63f9 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ScalingConfig.java @@ -0,0 +1,149 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of ScalingConfig. + */ +@Fluent +public final class ScalingConfig implements JsonSerializable { + /* + * Property desiredSize + */ + private Integer desiredSize; + + /* + * Property maxSize + */ + private Integer maxSize; + + /* + * Property minSize + */ + private Integer minSize; + + /** + * Creates an instance of ScalingConfig class. + */ + public ScalingConfig() { + } + + /** + * Get the desiredSize property: Property desiredSize. + * + * @return the desiredSize value. + */ + public Integer desiredSize() { + return this.desiredSize; + } + + /** + * Set the desiredSize property: Property desiredSize. + * + * @param desiredSize the desiredSize value to set. + * @return the ScalingConfig object itself. + */ + public ScalingConfig withDesiredSize(Integer desiredSize) { + this.desiredSize = desiredSize; + return this; + } + + /** + * Get the maxSize property: Property maxSize. + * + * @return the maxSize value. + */ + public Integer maxSize() { + return this.maxSize; + } + + /** + * Set the maxSize property: Property maxSize. + * + * @param maxSize the maxSize value to set. + * @return the ScalingConfig object itself. + */ + public ScalingConfig withMaxSize(Integer maxSize) { + this.maxSize = maxSize; + return this; + } + + /** + * Get the minSize property: Property minSize. + * + * @return the minSize value. + */ + public Integer minSize() { + return this.minSize; + } + + /** + * Set the minSize property: Property minSize. + * + * @param minSize the minSize value to set. + * @return the ScalingConfig object itself. + */ + public ScalingConfig withMinSize(Integer minSize) { + this.minSize = minSize; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeNumberField("desiredSize", this.desiredSize); + jsonWriter.writeNumberField("maxSize", this.maxSize); + jsonWriter.writeNumberField("minSize", this.minSize); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ScalingConfig from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ScalingConfig if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the ScalingConfig. + */ + public static ScalingConfig fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ScalingConfig deserializedScalingConfig = new ScalingConfig(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("desiredSize".equals(fieldName)) { + deserializedScalingConfig.desiredSize = reader.getNullable(JsonReader::getInt); + } else if ("maxSize".equals(fieldName)) { + deserializedScalingConfig.maxSize = reader.getNullable(JsonReader::getInt); + } else if ("minSize".equals(fieldName)) { + deserializedScalingConfig.minSize = reader.getNullable(JsonReader::getInt); + } else { + reader.skipChildren(); + } + } + + return deserializedScalingConfig; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ScalingConfiguration.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ScalingConfiguration.java new file mode 100644 index 000000000000..613db67fd9b5 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ScalingConfiguration.java @@ -0,0 +1,266 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of ScalingConfiguration. + */ +@Fluent +public final class ScalingConfiguration implements JsonSerializable { + /* + * A value that indicates whether to allow or disallow automatic pause for an Aurora DB cluster in serverless DB + * engine mode. A DB cluster can be paused only when it's idle (it has no connections). + */ + private Boolean autoPause; + + /* + * The maximum capacity for an Aurora DB cluster in serverless DB engine mode.For Aurora MySQL, valid capacity + * values are 1, 2, 4, 8, 16, 32, 64, 128, and 256.For Aurora PostgreSQL, valid capacity values are 2, 4, 8, 16, 32, + * 64, 192, and 384.The maximum capacity must be greater than or equal to the minimum capacity. + */ + private Integer maxCapacity; + + /* + * The minimum capacity for an Aurora DB cluster in serverless DB engine mode.For Aurora MySQL, valid capacity + * values are 1, 2, 4, 8, 16, 32, 64, 128, and 256.For Aurora PostgreSQL, valid capacity values are 2, 4, 8, 16, 32, + * 64, 192, and 384.The minimum capacity must be less than or equal to the maximum capacity. + */ + private Integer minCapacity; + + /* + * The amount of time, in seconds, that Aurora Serverless v1 tries to find a scaling point to perform seamless + * scaling before enforcing the timeout action.The default is 300. + */ + private Integer secondsBeforeTimeout; + + /* + * The time, in seconds, before an Aurora DB cluster in serverless mode is paused. + */ + private Integer secondsUntilAutoPause; + + /* + * The action to take when the timeout is reached, either ForceApplyCapacityChange or + * RollbackCapacityChange.ForceApplyCapacityChange sets the capacity to the specified value as soon as + * possible.RollbackCapacityChange, the default, ignores the capacity change if a scaling point isn't found in the + * timeout period.For more information, see Autoscaling for Aurora Serverless v1 in the Amazon Aurora User Guide. + */ + private String timeoutAction; + + /** + * Creates an instance of ScalingConfiguration class. + */ + public ScalingConfiguration() { + } + + /** + * Get the autoPause property: A value that indicates whether to allow or disallow automatic pause for an Aurora DB + * cluster in serverless DB engine mode. A DB cluster can be paused only when it's idle (it has no connections). + * + * @return the autoPause value. + */ + public Boolean autoPause() { + return this.autoPause; + } + + /** + * Set the autoPause property: A value that indicates whether to allow or disallow automatic pause for an Aurora DB + * cluster in serverless DB engine mode. A DB cluster can be paused only when it's idle (it has no connections). + * + * @param autoPause the autoPause value to set. + * @return the ScalingConfiguration object itself. + */ + public ScalingConfiguration withAutoPause(Boolean autoPause) { + this.autoPause = autoPause; + return this; + } + + /** + * Get the maxCapacity property: The maximum capacity for an Aurora DB cluster in serverless DB engine mode.For + * Aurora MySQL, valid capacity values are 1, 2, 4, 8, 16, 32, 64, 128, and 256.For Aurora PostgreSQL, valid + * capacity values are 2, 4, 8, 16, 32, 64, 192, and 384.The maximum capacity must be greater than or equal to the + * minimum capacity. + * + * @return the maxCapacity value. + */ + public Integer maxCapacity() { + return this.maxCapacity; + } + + /** + * Set the maxCapacity property: The maximum capacity for an Aurora DB cluster in serverless DB engine mode.For + * Aurora MySQL, valid capacity values are 1, 2, 4, 8, 16, 32, 64, 128, and 256.For Aurora PostgreSQL, valid + * capacity values are 2, 4, 8, 16, 32, 64, 192, and 384.The maximum capacity must be greater than or equal to the + * minimum capacity. + * + * @param maxCapacity the maxCapacity value to set. + * @return the ScalingConfiguration object itself. + */ + public ScalingConfiguration withMaxCapacity(Integer maxCapacity) { + this.maxCapacity = maxCapacity; + return this; + } + + /** + * Get the minCapacity property: The minimum capacity for an Aurora DB cluster in serverless DB engine mode.For + * Aurora MySQL, valid capacity values are 1, 2, 4, 8, 16, 32, 64, 128, and 256.For Aurora PostgreSQL, valid + * capacity values are 2, 4, 8, 16, 32, 64, 192, and 384.The minimum capacity must be less than or equal to the + * maximum capacity. + * + * @return the minCapacity value. + */ + public Integer minCapacity() { + return this.minCapacity; + } + + /** + * Set the minCapacity property: The minimum capacity for an Aurora DB cluster in serverless DB engine mode.For + * Aurora MySQL, valid capacity values are 1, 2, 4, 8, 16, 32, 64, 128, and 256.For Aurora PostgreSQL, valid + * capacity values are 2, 4, 8, 16, 32, 64, 192, and 384.The minimum capacity must be less than or equal to the + * maximum capacity. + * + * @param minCapacity the minCapacity value to set. + * @return the ScalingConfiguration object itself. + */ + public ScalingConfiguration withMinCapacity(Integer minCapacity) { + this.minCapacity = minCapacity; + return this; + } + + /** + * Get the secondsBeforeTimeout property: The amount of time, in seconds, that Aurora Serverless v1 tries to find a + * scaling point to perform seamless scaling before enforcing the timeout action.The default is 300. + * + * @return the secondsBeforeTimeout value. + */ + public Integer secondsBeforeTimeout() { + return this.secondsBeforeTimeout; + } + + /** + * Set the secondsBeforeTimeout property: The amount of time, in seconds, that Aurora Serverless v1 tries to find a + * scaling point to perform seamless scaling before enforcing the timeout action.The default is 300. + * + * @param secondsBeforeTimeout the secondsBeforeTimeout value to set. + * @return the ScalingConfiguration object itself. + */ + public ScalingConfiguration withSecondsBeforeTimeout(Integer secondsBeforeTimeout) { + this.secondsBeforeTimeout = secondsBeforeTimeout; + return this; + } + + /** + * Get the secondsUntilAutoPause property: The time, in seconds, before an Aurora DB cluster in serverless mode is + * paused. + * + * @return the secondsUntilAutoPause value. + */ + public Integer secondsUntilAutoPause() { + return this.secondsUntilAutoPause; + } + + /** + * Set the secondsUntilAutoPause property: The time, in seconds, before an Aurora DB cluster in serverless mode is + * paused. + * + * @param secondsUntilAutoPause the secondsUntilAutoPause value to set. + * @return the ScalingConfiguration object itself. + */ + public ScalingConfiguration withSecondsUntilAutoPause(Integer secondsUntilAutoPause) { + this.secondsUntilAutoPause = secondsUntilAutoPause; + return this; + } + + /** + * Get the timeoutAction property: The action to take when the timeout is reached, either ForceApplyCapacityChange + * or RollbackCapacityChange.ForceApplyCapacityChange sets the capacity to the specified value as soon as + * possible.RollbackCapacityChange, the default, ignores the capacity change if a scaling point isn't found in the + * timeout period.For more information, see Autoscaling for Aurora Serverless v1 in the Amazon Aurora User Guide. + * + * @return the timeoutAction value. + */ + public String timeoutAction() { + return this.timeoutAction; + } + + /** + * Set the timeoutAction property: The action to take when the timeout is reached, either ForceApplyCapacityChange + * or RollbackCapacityChange.ForceApplyCapacityChange sets the capacity to the specified value as soon as + * possible.RollbackCapacityChange, the default, ignores the capacity change if a scaling point isn't found in the + * timeout period.For more information, see Autoscaling for Aurora Serverless v1 in the Amazon Aurora User Guide. + * + * @param timeoutAction the timeoutAction value to set. + * @return the ScalingConfiguration object itself. + */ + public ScalingConfiguration withTimeoutAction(String timeoutAction) { + this.timeoutAction = timeoutAction; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeBooleanField("autoPause", this.autoPause); + jsonWriter.writeNumberField("maxCapacity", this.maxCapacity); + jsonWriter.writeNumberField("minCapacity", this.minCapacity); + jsonWriter.writeNumberField("secondsBeforeTimeout", this.secondsBeforeTimeout); + jsonWriter.writeNumberField("secondsUntilAutoPause", this.secondsUntilAutoPause); + jsonWriter.writeStringField("timeoutAction", this.timeoutAction); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ScalingConfiguration from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ScalingConfiguration if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the ScalingConfiguration. + */ + public static ScalingConfiguration fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ScalingConfiguration deserializedScalingConfiguration = new ScalingConfiguration(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("autoPause".equals(fieldName)) { + deserializedScalingConfiguration.autoPause = reader.getNullable(JsonReader::getBoolean); + } else if ("maxCapacity".equals(fieldName)) { + deserializedScalingConfiguration.maxCapacity = reader.getNullable(JsonReader::getInt); + } else if ("minCapacity".equals(fieldName)) { + deserializedScalingConfiguration.minCapacity = reader.getNullable(JsonReader::getInt); + } else if ("secondsBeforeTimeout".equals(fieldName)) { + deserializedScalingConfiguration.secondsBeforeTimeout = reader.getNullable(JsonReader::getInt); + } else if ("secondsUntilAutoPause".equals(fieldName)) { + deserializedScalingConfiguration.secondsUntilAutoPause = reader.getNullable(JsonReader::getInt); + } else if ("timeoutAction".equals(fieldName)) { + deserializedScalingConfiguration.timeoutAction = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedScalingConfiguration; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ScanStatus.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ScanStatus.java new file mode 100644 index 000000000000..6c251961bedc --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ScanStatus.java @@ -0,0 +1,81 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * ScanStatus enum. + */ +public final class ScanStatus extends ExpandableStringEnum { + /** + * Static value ACTIVE for ScanStatus. + */ + public static final ScanStatus ACTIVE = fromString("ACTIVE"); + + /** + * Static value COMPLETE for ScanStatus. + */ + public static final ScanStatus COMPLETE = fromString("COMPLETE"); + + /** + * Static value FAILED for ScanStatus. + */ + public static final ScanStatus FAILED = fromString("FAILED"); + + /** + * Static value FINDINGS_UNAVAILABLE for ScanStatus. + */ + public static final ScanStatus FINDINGS_UNAVAILABLE = fromString("FINDINGS_UNAVAILABLE"); + + /** + * Static value IN_PROGRESS for ScanStatus. + */ + public static final ScanStatus IN_PROGRESS = fromString("IN_PROGRESS"); + + /** + * Static value PENDING for ScanStatus. + */ + public static final ScanStatus PENDING = fromString("PENDING"); + + /** + * Static value SCAN_ELIGIBILITY_EXPIRED for ScanStatus. + */ + public static final ScanStatus SCAN_ELIGIBILITY_EXPIRED = fromString("SCAN_ELIGIBILITY_EXPIRED"); + + /** + * Static value UNSUPPORTED_IMAGE for ScanStatus. + */ + public static final ScanStatus UNSUPPORTED_IMAGE = fromString("UNSUPPORTED_IMAGE"); + + /** + * Creates a new instance of ScanStatus value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ScanStatus() { + } + + /** + * Creates or finds a ScanStatus from its string representation. + * + * @param name a name to look for. + * @return the corresponding ScanStatus. + */ + public static ScanStatus fromString(String name) { + return fromString(name, ScanStatus.class); + } + + /** + * Gets known ScanStatus values. + * + * @return known ScanStatus values. + */ + public static Collection values() { + return values(ScanStatus.class); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ScanStatusEnumValue.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ScanStatusEnumValue.java new file mode 100644 index 000000000000..36fbba93397d --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ScanStatusEnumValue.java @@ -0,0 +1,93 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of ScanStatusEnumValue. + */ +@Fluent +public final class ScanStatusEnumValue implements JsonSerializable { + /* + * Property value + */ + private ScanStatus value; + + /** + * Creates an instance of ScanStatusEnumValue class. + */ + public ScanStatusEnumValue() { + } + + /** + * Get the value property: Property value. + * + * @return the value value. + */ + public ScanStatus value() { + return this.value; + } + + /** + * Set the value property: Property value. + * + * @param value the value value to set. + * @return the ScanStatusEnumValue object itself. + */ + public ScanStatusEnumValue withValue(ScanStatus value) { + this.value = value; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("value", this.value == null ? null : this.value.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ScanStatusEnumValue from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ScanStatusEnumValue if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the ScanStatusEnumValue. + */ + public static ScanStatusEnumValue fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ScanStatusEnumValue deserializedScanStatusEnumValue = new ScanStatusEnumValue(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + deserializedScanStatusEnumValue.value = ScanStatus.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedScanStatusEnumValue; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/SchedulingStrategy.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/SchedulingStrategy.java new file mode 100644 index 000000000000..421695667272 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/SchedulingStrategy.java @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * SchedulingStrategy enum. + */ +public final class SchedulingStrategy extends ExpandableStringEnum { + /** + * Static value DAEMON for SchedulingStrategy. + */ + public static final SchedulingStrategy DAEMON = fromString("DAEMON"); + + /** + * Static value REPLICA for SchedulingStrategy. + */ + public static final SchedulingStrategy REPLICA = fromString("REPLICA"); + + /** + * Creates a new instance of SchedulingStrategy value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public SchedulingStrategy() { + } + + /** + * Creates or finds a SchedulingStrategy from its string representation. + * + * @param name a name to look for. + * @return the corresponding SchedulingStrategy. + */ + public static SchedulingStrategy fromString(String name) { + return fromString(name, SchedulingStrategy.class); + } + + /** + * Gets known SchedulingStrategy values. + * + * @return known SchedulingStrategy values. + */ + public static Collection values() { + return values(SchedulingStrategy.class); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/Secret.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/Secret.java new file mode 100644 index 000000000000..59aab718e4cc --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/Secret.java @@ -0,0 +1,148 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of Secret. + */ +@Fluent +public final class Secret implements JsonSerializable { + /* + * The name of the secret. + */ + private String name; + + /* + * The secret to expose to the container. The supported values are either the full ARN of the ASMlong secret or the + * full ARN of the parameter in the SSM Parameter Store. For information about the require IAMlong permissions, see + * [Required IAM permissions for Amazon ECS + * secrets](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/specifying-sensitive-data-secrets.html# + * secrets-iam) (for Secrets Manager) or [Required IAM permissions for Amazon ECS + * secrets](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/specifying-sensitive-data-parameters.html) + * (for Systems Manager Parameter store) in the *Amazon Elastic Container Service Developer Guide*. If the SSM + * Parameter Store parameter exists in the same Region as the task you're launching, then you can use either the + * full ARN or name of the parameter. If the parameter exists in a different Region, then the full ARN must be + * specified. + */ + private String valueFrom; + + /** + * Creates an instance of Secret class. + */ + public Secret() { + } + + /** + * Get the name property: The name of the secret. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: The name of the secret. + * + * @param name the name value to set. + * @return the Secret object itself. + */ + public Secret withName(String name) { + this.name = name; + return this; + } + + /** + * Get the valueFrom property: The secret to expose to the container. The supported values are either the full ARN + * of the ASMlong secret or the full ARN of the parameter in the SSM Parameter Store. For information about the + * require IAMlong permissions, see [Required IAM permissions for Amazon ECS + * secrets](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/specifying-sensitive-data-secrets.html#secrets-iam) + * (for Secrets Manager) or [Required IAM permissions for Amazon ECS + * secrets](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/specifying-sensitive-data-parameters.html) + * (for Systems Manager Parameter store) in the *Amazon Elastic Container Service Developer Guide*. If the SSM + * Parameter Store parameter exists in the same Region as the task you're launching, then you can use either the + * full ARN or name of the parameter. If the parameter exists in a different Region, then the full ARN must be + * specified. + * + * @return the valueFrom value. + */ + public String valueFrom() { + return this.valueFrom; + } + + /** + * Set the valueFrom property: The secret to expose to the container. The supported values are either the full ARN + * of the ASMlong secret or the full ARN of the parameter in the SSM Parameter Store. For information about the + * require IAMlong permissions, see [Required IAM permissions for Amazon ECS + * secrets](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/specifying-sensitive-data-secrets.html#secrets-iam) + * (for Secrets Manager) or [Required IAM permissions for Amazon ECS + * secrets](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/specifying-sensitive-data-parameters.html) + * (for Systems Manager Parameter store) in the *Amazon Elastic Container Service Developer Guide*. If the SSM + * Parameter Store parameter exists in the same Region as the task you're launching, then you can use either the + * full ARN or name of the parameter. If the parameter exists in a different Region, then the full ARN must be + * specified. + * + * @param valueFrom the valueFrom value to set. + * @return the Secret object itself. + */ + public Secret withValueFrom(String valueFrom) { + this.valueFrom = valueFrom; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("name", this.name); + jsonWriter.writeStringField("valueFrom", this.valueFrom); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of Secret from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of Secret if the JsonReader was pointing to an instance of it, or null if it was pointing to + * JSON null. + * @throws IOException If an error occurs while reading the Secret. + */ + public static Secret fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + Secret deserializedSecret = new Secret(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("name".equals(fieldName)) { + deserializedSecret.name = reader.getString(); + } else if ("valueFrom".equals(fieldName)) { + deserializedSecret.valueFrom = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedSecret; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/SecretsManagerResourcePolicies.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/SecretsManagerResourcePolicies.java new file mode 100644 index 000000000000..0bc2e2da39fc --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/SecretsManagerResourcePolicies.java @@ -0,0 +1,162 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** + * Resource collection API of SecretsManagerResourcePolicies. + */ +public interface SecretsManagerResourcePolicies { + /** + * List SecretsManagerResourcePolicy resources by subscription ID. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a SecretsManagerResourcePolicy list operation as paginated response with + * {@link PagedIterable}. + */ + PagedIterable list(); + + /** + * List SecretsManagerResourcePolicy resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a SecretsManagerResourcePolicy list operation as paginated response with + * {@link PagedIterable}. + */ + PagedIterable list(Context context); + + /** + * List SecretsManagerResourcePolicy resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a SecretsManagerResourcePolicy list operation as paginated response with + * {@link PagedIterable}. + */ + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * List SecretsManagerResourcePolicy resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a SecretsManagerResourcePolicy list operation as paginated response with + * {@link PagedIterable}. + */ + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Get a SecretsManagerResourcePolicy. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of SecretsManagerResourcePolicy. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a SecretsManagerResourcePolicy along with {@link Response}. + */ + Response getByResourceGroupWithResponse(String resourceGroupName, String name, + Context context); + + /** + * Get a SecretsManagerResourcePolicy. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of SecretsManagerResourcePolicy. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a SecretsManagerResourcePolicy. + */ + SecretsManagerResourcePolicy getByResourceGroup(String resourceGroupName, String name); + + /** + * Delete a SecretsManagerResourcePolicy. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of SecretsManagerResourcePolicy. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByResourceGroup(String resourceGroupName, String name); + + /** + * Delete a SecretsManagerResourcePolicy. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of SecretsManagerResourcePolicy. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String name, Context context); + + /** + * Get a SecretsManagerResourcePolicy. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a SecretsManagerResourcePolicy along with {@link Response}. + */ + SecretsManagerResourcePolicy getById(String id); + + /** + * Get a SecretsManagerResourcePolicy. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a SecretsManagerResourcePolicy along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Delete a SecretsManagerResourcePolicy. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteById(String id); + + /** + * Delete a SecretsManagerResourcePolicy. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new SecretsManagerResourcePolicy resource. + * + * @param name resource name. + * @return the first stage of the new SecretsManagerResourcePolicy definition. + */ + SecretsManagerResourcePolicy.DefinitionStages.Blank define(String name); +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/SecretsManagerResourcePolicy.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/SecretsManagerResourcePolicy.java new file mode 100644 index 000000000000..f094ba42adfd --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/SecretsManagerResourcePolicy.java @@ -0,0 +1,252 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.awsconnector.fluent.models.SecretsManagerResourcePolicyInner; +import java.util.Map; + +/** + * An immutable client-side representation of SecretsManagerResourcePolicy. + */ +public interface SecretsManagerResourcePolicy { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the location property: The geo-location where the resource lives. + * + * @return the location value. + */ + String location(); + + /** + * Gets the tags property: Resource tags. + * + * @return the tags value. + */ + Map tags(); + + /** + * Gets the properties property: The resource-specific properties for this resource. + * + * @return the properties value. + */ + SecretsManagerResourcePolicyProperties properties(); + + /** + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the region of the resource. + * + * @return the region of the resource. + */ + Region region(); + + /** + * Gets the name of the resource region. + * + * @return the name of the resource region. + */ + String regionName(); + + /** + * Gets the name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + + /** + * Gets the inner com.azure.resourcemanager.awsconnector.fluent.models.SecretsManagerResourcePolicyInner object. + * + * @return the inner object. + */ + SecretsManagerResourcePolicyInner innerModel(); + + /** + * The entirety of the SecretsManagerResourcePolicy definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithLocation, + DefinitionStages.WithResourceGroup, DefinitionStages.WithCreate { + } + + /** + * The SecretsManagerResourcePolicy definition stages. + */ + interface DefinitionStages { + /** + * The first stage of the SecretsManagerResourcePolicy definition. + */ + interface Blank extends WithLocation { + } + + /** + * The stage of the SecretsManagerResourcePolicy definition allowing to specify location. + */ + interface WithLocation { + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithResourceGroup withRegion(Region location); + + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithResourceGroup withRegion(String location); + } + + /** + * The stage of the SecretsManagerResourcePolicy definition allowing to specify parent resource. + */ + interface WithResourceGroup { + /** + * Specifies resourceGroupName. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @return the next definition stage. + */ + WithCreate withExistingResourceGroup(String resourceGroupName); + } + + /** + * The stage of the SecretsManagerResourcePolicy 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.WithProperties { + /** + * Executes the create request. + * + * @return the created resource. + */ + SecretsManagerResourcePolicy create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + SecretsManagerResourcePolicy create(Context context); + } + + /** + * The stage of the SecretsManagerResourcePolicy definition allowing to specify tags. + */ + interface WithTags { + /** + * Specifies the tags property: Resource tags.. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + WithCreate withTags(Map tags); + } + + /** + * The stage of the SecretsManagerResourcePolicy definition allowing to specify properties. + */ + interface WithProperties { + /** + * Specifies the properties property: The resource-specific properties for this resource.. + * + * @param properties The resource-specific properties for this resource. + * @return the next definition stage. + */ + WithCreate withProperties(SecretsManagerResourcePolicyProperties properties); + } + } + + /** + * Begins update for the SecretsManagerResourcePolicy resource. + * + * @return the stage of resource update. + */ + SecretsManagerResourcePolicy.Update update(); + + /** + * The template for SecretsManagerResourcePolicy update. + */ + interface Update extends UpdateStages.WithTags { + /** + * Executes the update request. + * + * @return the updated resource. + */ + SecretsManagerResourcePolicy apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + SecretsManagerResourcePolicy apply(Context context); + } + + /** + * The SecretsManagerResourcePolicy update stages. + */ + interface UpdateStages { + /** + * The stage of the SecretsManagerResourcePolicy update allowing to specify tags. + */ + interface WithTags { + /** + * Specifies the tags property: Resource tags.. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + Update withTags(Map tags); + } + } + + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + SecretsManagerResourcePolicy refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + SecretsManagerResourcePolicy refresh(Context context); +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/SecretsManagerResourcePolicyListResult.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/SecretsManagerResourcePolicyListResult.java new file mode 100644 index 000000000000..2679fa978318 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/SecretsManagerResourcePolicyListResult.java @@ -0,0 +1,138 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.awsconnector.fluent.models.SecretsManagerResourcePolicyInner; +import java.io.IOException; +import java.util.List; + +/** + * The response of a SecretsManagerResourcePolicy list operation. + */ +@Fluent +public final class SecretsManagerResourcePolicyListResult + implements JsonSerializable { + /* + * The SecretsManagerResourcePolicy items on this page + */ + private List value; + + /* + * The link to the next page of items + */ + private String nextLink; + + /** + * Creates an instance of SecretsManagerResourcePolicyListResult class. + */ + public SecretsManagerResourcePolicyListResult() { + } + + /** + * Get the value property: The SecretsManagerResourcePolicy items on this page. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The SecretsManagerResourcePolicy items on this page. + * + * @param value the value value to set. + * @return the SecretsManagerResourcePolicyListResult object itself. + */ + public SecretsManagerResourcePolicyListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The link to the next page of items. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: The link to the next page of items. + * + * @param nextLink the nextLink value to set. + * @return the SecretsManagerResourcePolicyListResult object itself. + */ + public SecretsManagerResourcePolicyListResult withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property value in model SecretsManagerResourcePolicyListResult")); + } else { + value().forEach(e -> e.validate()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(SecretsManagerResourcePolicyListResult.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("nextLink", this.nextLink); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of SecretsManagerResourcePolicyListResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of SecretsManagerResourcePolicyListResult if the JsonReader was pointing to an instance of + * it, or null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the SecretsManagerResourcePolicyListResult. + */ + public static SecretsManagerResourcePolicyListResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + SecretsManagerResourcePolicyListResult deserializedSecretsManagerResourcePolicyListResult + = new SecretsManagerResourcePolicyListResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> SecretsManagerResourcePolicyInner.fromJson(reader1)); + deserializedSecretsManagerResourcePolicyListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedSecretsManagerResourcePolicyListResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedSecretsManagerResourcePolicyListResult; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/SecretsManagerResourcePolicyProperties.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/SecretsManagerResourcePolicyProperties.java new file mode 100644 index 000000000000..616f177886ef --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/SecretsManagerResourcePolicyProperties.java @@ -0,0 +1,317 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.Map; + +/** + * Definition of SecretsManagerResourcePolicy. + */ +@Fluent +public final class SecretsManagerResourcePolicyProperties + implements JsonSerializable { + /* + * AWS Properties + */ + private AwsSecretsManagerResourcePolicyProperties awsProperties; + + /* + * Public Cloud Connectors Resource ID + */ + private String publicCloudConnectorsResourceId; + + /* + * AWS Account ID + */ + private String awsAccountId; + + /* + * Amazon Resource Name (ARN) + */ + private String arn; + + /* + * Public Cloud Resource Name + */ + private String publicCloudResourceName; + + /* + * AWS Source Schema + */ + private String awsSourceSchema; + + /* + * AWS Region + */ + private String awsRegion; + + /* + * AWS Tags + */ + private Map awsTags; + + /* + * The status of the last operation. + */ + private ProvisioningState provisioningState; + + /** + * Creates an instance of SecretsManagerResourcePolicyProperties class. + */ + public SecretsManagerResourcePolicyProperties() { + } + + /** + * Get the awsProperties property: AWS Properties. + * + * @return the awsProperties value. + */ + public AwsSecretsManagerResourcePolicyProperties awsProperties() { + return this.awsProperties; + } + + /** + * Set the awsProperties property: AWS Properties. + * + * @param awsProperties the awsProperties value to set. + * @return the SecretsManagerResourcePolicyProperties object itself. + */ + public SecretsManagerResourcePolicyProperties + withAwsProperties(AwsSecretsManagerResourcePolicyProperties awsProperties) { + this.awsProperties = awsProperties; + return this; + } + + /** + * Get the publicCloudConnectorsResourceId property: Public Cloud Connectors Resource ID. + * + * @return the publicCloudConnectorsResourceId value. + */ + public String publicCloudConnectorsResourceId() { + return this.publicCloudConnectorsResourceId; + } + + /** + * Set the publicCloudConnectorsResourceId property: Public Cloud Connectors Resource ID. + * + * @param publicCloudConnectorsResourceId the publicCloudConnectorsResourceId value to set. + * @return the SecretsManagerResourcePolicyProperties object itself. + */ + public SecretsManagerResourcePolicyProperties + withPublicCloudConnectorsResourceId(String publicCloudConnectorsResourceId) { + this.publicCloudConnectorsResourceId = publicCloudConnectorsResourceId; + return this; + } + + /** + * Get the awsAccountId property: AWS Account ID. + * + * @return the awsAccountId value. + */ + public String awsAccountId() { + return this.awsAccountId; + } + + /** + * Set the awsAccountId property: AWS Account ID. + * + * @param awsAccountId the awsAccountId value to set. + * @return the SecretsManagerResourcePolicyProperties object itself. + */ + public SecretsManagerResourcePolicyProperties withAwsAccountId(String awsAccountId) { + this.awsAccountId = awsAccountId; + return this; + } + + /** + * Get the arn property: Amazon Resource Name (ARN). + * + * @return the arn value. + */ + public String arn() { + return this.arn; + } + + /** + * Set the arn property: Amazon Resource Name (ARN). + * + * @param arn the arn value to set. + * @return the SecretsManagerResourcePolicyProperties object itself. + */ + public SecretsManagerResourcePolicyProperties withArn(String arn) { + this.arn = arn; + return this; + } + + /** + * Get the publicCloudResourceName property: Public Cloud Resource Name. + * + * @return the publicCloudResourceName value. + */ + public String publicCloudResourceName() { + return this.publicCloudResourceName; + } + + /** + * Set the publicCloudResourceName property: Public Cloud Resource Name. + * + * @param publicCloudResourceName the publicCloudResourceName value to set. + * @return the SecretsManagerResourcePolicyProperties object itself. + */ + public SecretsManagerResourcePolicyProperties withPublicCloudResourceName(String publicCloudResourceName) { + this.publicCloudResourceName = publicCloudResourceName; + return this; + } + + /** + * Get the awsSourceSchema property: AWS Source Schema. + * + * @return the awsSourceSchema value. + */ + public String awsSourceSchema() { + return this.awsSourceSchema; + } + + /** + * Set the awsSourceSchema property: AWS Source Schema. + * + * @param awsSourceSchema the awsSourceSchema value to set. + * @return the SecretsManagerResourcePolicyProperties object itself. + */ + public SecretsManagerResourcePolicyProperties withAwsSourceSchema(String awsSourceSchema) { + this.awsSourceSchema = awsSourceSchema; + return this; + } + + /** + * Get the awsRegion property: AWS Region. + * + * @return the awsRegion value. + */ + public String awsRegion() { + return this.awsRegion; + } + + /** + * Set the awsRegion property: AWS Region. + * + * @param awsRegion the awsRegion value to set. + * @return the SecretsManagerResourcePolicyProperties object itself. + */ + public SecretsManagerResourcePolicyProperties withAwsRegion(String awsRegion) { + this.awsRegion = awsRegion; + return this; + } + + /** + * Get the awsTags property: AWS Tags. + * + * @return the awsTags value. + */ + public Map awsTags() { + return this.awsTags; + } + + /** + * Set the awsTags property: AWS Tags. + * + * @param awsTags the awsTags value to set. + * @return the SecretsManagerResourcePolicyProperties object itself. + */ + public SecretsManagerResourcePolicyProperties withAwsTags(Map awsTags) { + this.awsTags = awsTags; + return this; + } + + /** + * Get the provisioningState property: The status of the last operation. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (awsProperties() != null) { + awsProperties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("awsProperties", this.awsProperties); + jsonWriter.writeStringField("publicCloudConnectorsResourceId", this.publicCloudConnectorsResourceId); + jsonWriter.writeStringField("awsAccountId", this.awsAccountId); + jsonWriter.writeStringField("arn", this.arn); + jsonWriter.writeStringField("publicCloudResourceName", this.publicCloudResourceName); + jsonWriter.writeStringField("awsSourceSchema", this.awsSourceSchema); + jsonWriter.writeStringField("awsRegion", this.awsRegion); + jsonWriter.writeMapField("awsTags", this.awsTags, (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of SecretsManagerResourcePolicyProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of SecretsManagerResourcePolicyProperties if the JsonReader was pointing to an instance of + * it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the SecretsManagerResourcePolicyProperties. + */ + public static SecretsManagerResourcePolicyProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + SecretsManagerResourcePolicyProperties deserializedSecretsManagerResourcePolicyProperties + = new SecretsManagerResourcePolicyProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("awsProperties".equals(fieldName)) { + deserializedSecretsManagerResourcePolicyProperties.awsProperties + = AwsSecretsManagerResourcePolicyProperties.fromJson(reader); + } else if ("publicCloudConnectorsResourceId".equals(fieldName)) { + deserializedSecretsManagerResourcePolicyProperties.publicCloudConnectorsResourceId + = reader.getString(); + } else if ("awsAccountId".equals(fieldName)) { + deserializedSecretsManagerResourcePolicyProperties.awsAccountId = reader.getString(); + } else if ("arn".equals(fieldName)) { + deserializedSecretsManagerResourcePolicyProperties.arn = reader.getString(); + } else if ("publicCloudResourceName".equals(fieldName)) { + deserializedSecretsManagerResourcePolicyProperties.publicCloudResourceName = reader.getString(); + } else if ("awsSourceSchema".equals(fieldName)) { + deserializedSecretsManagerResourcePolicyProperties.awsSourceSchema = reader.getString(); + } else if ("awsRegion".equals(fieldName)) { + deserializedSecretsManagerResourcePolicyProperties.awsRegion = reader.getString(); + } else if ("awsTags".equals(fieldName)) { + Map awsTags = reader.readMap(reader1 -> reader1.getString()); + deserializedSecretsManagerResourcePolicyProperties.awsTags = awsTags; + } else if ("provisioningState".equals(fieldName)) { + deserializedSecretsManagerResourcePolicyProperties.provisioningState + = ProvisioningState.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedSecretsManagerResourcePolicyProperties; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/SecretsManagerResourcePolicyTagsUpdate.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/SecretsManagerResourcePolicyTagsUpdate.java new file mode 100644 index 000000000000..e0efa530e78d --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/SecretsManagerResourcePolicyTagsUpdate.java @@ -0,0 +1,97 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.Map; + +/** + * The type used for updating tags in SecretsManagerResourcePolicy resources. + */ +@Fluent +public final class SecretsManagerResourcePolicyTagsUpdate + implements JsonSerializable { + /* + * Resource tags. + */ + private Map tags; + + /** + * Creates an instance of SecretsManagerResourcePolicyTagsUpdate class. + */ + public SecretsManagerResourcePolicyTagsUpdate() { + } + + /** + * Get the tags property: Resource tags. + * + * @return the tags value. + */ + public Map tags() { + return this.tags; + } + + /** + * Set the tags property: Resource tags. + * + * @param tags the tags value to set. + * @return the SecretsManagerResourcePolicyTagsUpdate object itself. + */ + public SecretsManagerResourcePolicyTagsUpdate withTags(Map tags) { + this.tags = tags; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeMapField("tags", this.tags, (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of SecretsManagerResourcePolicyTagsUpdate from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of SecretsManagerResourcePolicyTagsUpdate if the JsonReader was pointing to an instance of + * it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the SecretsManagerResourcePolicyTagsUpdate. + */ + public static SecretsManagerResourcePolicyTagsUpdate fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + SecretsManagerResourcePolicyTagsUpdate deserializedSecretsManagerResourcePolicyTagsUpdate + = new SecretsManagerResourcePolicyTagsUpdate(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedSecretsManagerResourcePolicyTagsUpdate.tags = tags; + } else { + reader.skipChildren(); + } + } + + return deserializedSecretsManagerResourcePolicyTagsUpdate; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/SecretsManagerSecret.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/SecretsManagerSecret.java new file mode 100644 index 000000000000..0c0223347516 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/SecretsManagerSecret.java @@ -0,0 +1,252 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.awsconnector.fluent.models.SecretsManagerSecretInner; +import java.util.Map; + +/** + * An immutable client-side representation of SecretsManagerSecret. + */ +public interface SecretsManagerSecret { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the location property: The geo-location where the resource lives. + * + * @return the location value. + */ + String location(); + + /** + * Gets the tags property: Resource tags. + * + * @return the tags value. + */ + Map tags(); + + /** + * Gets the properties property: The resource-specific properties for this resource. + * + * @return the properties value. + */ + SecretsManagerSecretProperties properties(); + + /** + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the region of the resource. + * + * @return the region of the resource. + */ + Region region(); + + /** + * Gets the name of the resource region. + * + * @return the name of the resource region. + */ + String regionName(); + + /** + * Gets the name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + + /** + * Gets the inner com.azure.resourcemanager.awsconnector.fluent.models.SecretsManagerSecretInner object. + * + * @return the inner object. + */ + SecretsManagerSecretInner innerModel(); + + /** + * The entirety of the SecretsManagerSecret definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithLocation, + DefinitionStages.WithResourceGroup, DefinitionStages.WithCreate { + } + + /** + * The SecretsManagerSecret definition stages. + */ + interface DefinitionStages { + /** + * The first stage of the SecretsManagerSecret definition. + */ + interface Blank extends WithLocation { + } + + /** + * The stage of the SecretsManagerSecret definition allowing to specify location. + */ + interface WithLocation { + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithResourceGroup withRegion(Region location); + + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithResourceGroup withRegion(String location); + } + + /** + * The stage of the SecretsManagerSecret definition allowing to specify parent resource. + */ + interface WithResourceGroup { + /** + * Specifies resourceGroupName. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @return the next definition stage. + */ + WithCreate withExistingResourceGroup(String resourceGroupName); + } + + /** + * The stage of the SecretsManagerSecret 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.WithProperties { + /** + * Executes the create request. + * + * @return the created resource. + */ + SecretsManagerSecret create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + SecretsManagerSecret create(Context context); + } + + /** + * The stage of the SecretsManagerSecret definition allowing to specify tags. + */ + interface WithTags { + /** + * Specifies the tags property: Resource tags.. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + WithCreate withTags(Map tags); + } + + /** + * The stage of the SecretsManagerSecret definition allowing to specify properties. + */ + interface WithProperties { + /** + * Specifies the properties property: The resource-specific properties for this resource.. + * + * @param properties The resource-specific properties for this resource. + * @return the next definition stage. + */ + WithCreate withProperties(SecretsManagerSecretProperties properties); + } + } + + /** + * Begins update for the SecretsManagerSecret resource. + * + * @return the stage of resource update. + */ + SecretsManagerSecret.Update update(); + + /** + * The template for SecretsManagerSecret update. + */ + interface Update extends UpdateStages.WithTags { + /** + * Executes the update request. + * + * @return the updated resource. + */ + SecretsManagerSecret apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + SecretsManagerSecret apply(Context context); + } + + /** + * The SecretsManagerSecret update stages. + */ + interface UpdateStages { + /** + * The stage of the SecretsManagerSecret update allowing to specify tags. + */ + interface WithTags { + /** + * Specifies the tags property: Resource tags.. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + Update withTags(Map tags); + } + } + + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + SecretsManagerSecret refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + SecretsManagerSecret refresh(Context context); +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/SecretsManagerSecretListResult.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/SecretsManagerSecretListResult.java new file mode 100644 index 000000000000..36631f1099cf --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/SecretsManagerSecretListResult.java @@ -0,0 +1,137 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.awsconnector.fluent.models.SecretsManagerSecretInner; +import java.io.IOException; +import java.util.List; + +/** + * The response of a SecretsManagerSecret list operation. + */ +@Fluent +public final class SecretsManagerSecretListResult implements JsonSerializable { + /* + * The SecretsManagerSecret items on this page + */ + private List value; + + /* + * The link to the next page of items + */ + private String nextLink; + + /** + * Creates an instance of SecretsManagerSecretListResult class. + */ + public SecretsManagerSecretListResult() { + } + + /** + * Get the value property: The SecretsManagerSecret items on this page. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The SecretsManagerSecret items on this page. + * + * @param value the value value to set. + * @return the SecretsManagerSecretListResult object itself. + */ + public SecretsManagerSecretListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The link to the next page of items. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: The link to the next page of items. + * + * @param nextLink the nextLink value to set. + * @return the SecretsManagerSecretListResult object itself. + */ + public SecretsManagerSecretListResult withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property value in model SecretsManagerSecretListResult")); + } else { + value().forEach(e -> e.validate()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(SecretsManagerSecretListResult.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("nextLink", this.nextLink); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of SecretsManagerSecretListResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of SecretsManagerSecretListResult if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the SecretsManagerSecretListResult. + */ + public static SecretsManagerSecretListResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + SecretsManagerSecretListResult deserializedSecretsManagerSecretListResult + = new SecretsManagerSecretListResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> SecretsManagerSecretInner.fromJson(reader1)); + deserializedSecretsManagerSecretListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedSecretsManagerSecretListResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedSecretsManagerSecretListResult; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/SecretsManagerSecretProperties.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/SecretsManagerSecretProperties.java new file mode 100644 index 000000000000..7440df527a48 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/SecretsManagerSecretProperties.java @@ -0,0 +1,313 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.Map; + +/** + * Definition of SecretsManagerSecret. + */ +@Fluent +public final class SecretsManagerSecretProperties implements JsonSerializable { + /* + * AWS Properties + */ + private AwsSecretsManagerSecretProperties awsProperties; + + /* + * Public Cloud Connectors Resource ID + */ + private String publicCloudConnectorsResourceId; + + /* + * AWS Account ID + */ + private String awsAccountId; + + /* + * Amazon Resource Name (ARN) + */ + private String arn; + + /* + * Public Cloud Resource Name + */ + private String publicCloudResourceName; + + /* + * AWS Source Schema + */ + private String awsSourceSchema; + + /* + * AWS Region + */ + private String awsRegion; + + /* + * AWS Tags + */ + private Map awsTags; + + /* + * The status of the last operation. + */ + private ProvisioningState provisioningState; + + /** + * Creates an instance of SecretsManagerSecretProperties class. + */ + public SecretsManagerSecretProperties() { + } + + /** + * Get the awsProperties property: AWS Properties. + * + * @return the awsProperties value. + */ + public AwsSecretsManagerSecretProperties awsProperties() { + return this.awsProperties; + } + + /** + * Set the awsProperties property: AWS Properties. + * + * @param awsProperties the awsProperties value to set. + * @return the SecretsManagerSecretProperties object itself. + */ + public SecretsManagerSecretProperties withAwsProperties(AwsSecretsManagerSecretProperties awsProperties) { + this.awsProperties = awsProperties; + return this; + } + + /** + * Get the publicCloudConnectorsResourceId property: Public Cloud Connectors Resource ID. + * + * @return the publicCloudConnectorsResourceId value. + */ + public String publicCloudConnectorsResourceId() { + return this.publicCloudConnectorsResourceId; + } + + /** + * Set the publicCloudConnectorsResourceId property: Public Cloud Connectors Resource ID. + * + * @param publicCloudConnectorsResourceId the publicCloudConnectorsResourceId value to set. + * @return the SecretsManagerSecretProperties object itself. + */ + public SecretsManagerSecretProperties withPublicCloudConnectorsResourceId(String publicCloudConnectorsResourceId) { + this.publicCloudConnectorsResourceId = publicCloudConnectorsResourceId; + return this; + } + + /** + * Get the awsAccountId property: AWS Account ID. + * + * @return the awsAccountId value. + */ + public String awsAccountId() { + return this.awsAccountId; + } + + /** + * Set the awsAccountId property: AWS Account ID. + * + * @param awsAccountId the awsAccountId value to set. + * @return the SecretsManagerSecretProperties object itself. + */ + public SecretsManagerSecretProperties withAwsAccountId(String awsAccountId) { + this.awsAccountId = awsAccountId; + return this; + } + + /** + * Get the arn property: Amazon Resource Name (ARN). + * + * @return the arn value. + */ + public String arn() { + return this.arn; + } + + /** + * Set the arn property: Amazon Resource Name (ARN). + * + * @param arn the arn value to set. + * @return the SecretsManagerSecretProperties object itself. + */ + public SecretsManagerSecretProperties withArn(String arn) { + this.arn = arn; + return this; + } + + /** + * Get the publicCloudResourceName property: Public Cloud Resource Name. + * + * @return the publicCloudResourceName value. + */ + public String publicCloudResourceName() { + return this.publicCloudResourceName; + } + + /** + * Set the publicCloudResourceName property: Public Cloud Resource Name. + * + * @param publicCloudResourceName the publicCloudResourceName value to set. + * @return the SecretsManagerSecretProperties object itself. + */ + public SecretsManagerSecretProperties withPublicCloudResourceName(String publicCloudResourceName) { + this.publicCloudResourceName = publicCloudResourceName; + return this; + } + + /** + * Get the awsSourceSchema property: AWS Source Schema. + * + * @return the awsSourceSchema value. + */ + public String awsSourceSchema() { + return this.awsSourceSchema; + } + + /** + * Set the awsSourceSchema property: AWS Source Schema. + * + * @param awsSourceSchema the awsSourceSchema value to set. + * @return the SecretsManagerSecretProperties object itself. + */ + public SecretsManagerSecretProperties withAwsSourceSchema(String awsSourceSchema) { + this.awsSourceSchema = awsSourceSchema; + return this; + } + + /** + * Get the awsRegion property: AWS Region. + * + * @return the awsRegion value. + */ + public String awsRegion() { + return this.awsRegion; + } + + /** + * Set the awsRegion property: AWS Region. + * + * @param awsRegion the awsRegion value to set. + * @return the SecretsManagerSecretProperties object itself. + */ + public SecretsManagerSecretProperties withAwsRegion(String awsRegion) { + this.awsRegion = awsRegion; + return this; + } + + /** + * Get the awsTags property: AWS Tags. + * + * @return the awsTags value. + */ + public Map awsTags() { + return this.awsTags; + } + + /** + * Set the awsTags property: AWS Tags. + * + * @param awsTags the awsTags value to set. + * @return the SecretsManagerSecretProperties object itself. + */ + public SecretsManagerSecretProperties withAwsTags(Map awsTags) { + this.awsTags = awsTags; + return this; + } + + /** + * Get the provisioningState property: The status of the last operation. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (awsProperties() != null) { + awsProperties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("awsProperties", this.awsProperties); + jsonWriter.writeStringField("publicCloudConnectorsResourceId", this.publicCloudConnectorsResourceId); + jsonWriter.writeStringField("awsAccountId", this.awsAccountId); + jsonWriter.writeStringField("arn", this.arn); + jsonWriter.writeStringField("publicCloudResourceName", this.publicCloudResourceName); + jsonWriter.writeStringField("awsSourceSchema", this.awsSourceSchema); + jsonWriter.writeStringField("awsRegion", this.awsRegion); + jsonWriter.writeMapField("awsTags", this.awsTags, (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of SecretsManagerSecretProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of SecretsManagerSecretProperties if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the SecretsManagerSecretProperties. + */ + public static SecretsManagerSecretProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + SecretsManagerSecretProperties deserializedSecretsManagerSecretProperties + = new SecretsManagerSecretProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("awsProperties".equals(fieldName)) { + deserializedSecretsManagerSecretProperties.awsProperties + = AwsSecretsManagerSecretProperties.fromJson(reader); + } else if ("publicCloudConnectorsResourceId".equals(fieldName)) { + deserializedSecretsManagerSecretProperties.publicCloudConnectorsResourceId = reader.getString(); + } else if ("awsAccountId".equals(fieldName)) { + deserializedSecretsManagerSecretProperties.awsAccountId = reader.getString(); + } else if ("arn".equals(fieldName)) { + deserializedSecretsManagerSecretProperties.arn = reader.getString(); + } else if ("publicCloudResourceName".equals(fieldName)) { + deserializedSecretsManagerSecretProperties.publicCloudResourceName = reader.getString(); + } else if ("awsSourceSchema".equals(fieldName)) { + deserializedSecretsManagerSecretProperties.awsSourceSchema = reader.getString(); + } else if ("awsRegion".equals(fieldName)) { + deserializedSecretsManagerSecretProperties.awsRegion = reader.getString(); + } else if ("awsTags".equals(fieldName)) { + Map awsTags = reader.readMap(reader1 -> reader1.getString()); + deserializedSecretsManagerSecretProperties.awsTags = awsTags; + } else if ("provisioningState".equals(fieldName)) { + deserializedSecretsManagerSecretProperties.provisioningState + = ProvisioningState.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedSecretsManagerSecretProperties; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/SecretsManagerSecretTagsUpdate.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/SecretsManagerSecretTagsUpdate.java new file mode 100644 index 000000000000..734835f2d1a8 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/SecretsManagerSecretTagsUpdate.java @@ -0,0 +1,96 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.Map; + +/** + * The type used for updating tags in SecretsManagerSecret resources. + */ +@Fluent +public final class SecretsManagerSecretTagsUpdate implements JsonSerializable { + /* + * Resource tags. + */ + private Map tags; + + /** + * Creates an instance of SecretsManagerSecretTagsUpdate class. + */ + public SecretsManagerSecretTagsUpdate() { + } + + /** + * Get the tags property: Resource tags. + * + * @return the tags value. + */ + public Map tags() { + return this.tags; + } + + /** + * Set the tags property: Resource tags. + * + * @param tags the tags value to set. + * @return the SecretsManagerSecretTagsUpdate object itself. + */ + public SecretsManagerSecretTagsUpdate withTags(Map tags) { + this.tags = tags; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeMapField("tags", this.tags, (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of SecretsManagerSecretTagsUpdate from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of SecretsManagerSecretTagsUpdate if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the SecretsManagerSecretTagsUpdate. + */ + public static SecretsManagerSecretTagsUpdate fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + SecretsManagerSecretTagsUpdate deserializedSecretsManagerSecretTagsUpdate + = new SecretsManagerSecretTagsUpdate(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedSecretsManagerSecretTagsUpdate.tags = tags; + } else { + reader.skipChildren(); + } + } + + return deserializedSecretsManagerSecretTagsUpdate; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/SecretsManagerSecrets.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/SecretsManagerSecrets.java new file mode 100644 index 000000000000..ca3d19d499b8 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/SecretsManagerSecrets.java @@ -0,0 +1,158 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** + * Resource collection API of SecretsManagerSecrets. + */ +public interface SecretsManagerSecrets { + /** + * List SecretsManagerSecret resources by subscription ID. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a SecretsManagerSecret list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable list(); + + /** + * List SecretsManagerSecret resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a SecretsManagerSecret list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable list(Context context); + + /** + * List SecretsManagerSecret resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a SecretsManagerSecret list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * List SecretsManagerSecret resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a SecretsManagerSecret list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Get a SecretsManagerSecret. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of SecretsManagerSecret. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a SecretsManagerSecret along with {@link Response}. + */ + Response getByResourceGroupWithResponse(String resourceGroupName, String name, + Context context); + + /** + * Get a SecretsManagerSecret. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of SecretsManagerSecret. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a SecretsManagerSecret. + */ + SecretsManagerSecret getByResourceGroup(String resourceGroupName, String name); + + /** + * Delete a SecretsManagerSecret. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of SecretsManagerSecret. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByResourceGroup(String resourceGroupName, String name); + + /** + * Delete a SecretsManagerSecret. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of SecretsManagerSecret. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String name, Context context); + + /** + * Get a SecretsManagerSecret. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a SecretsManagerSecret along with {@link Response}. + */ + SecretsManagerSecret getById(String id); + + /** + * Get a SecretsManagerSecret. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a SecretsManagerSecret along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Delete a SecretsManagerSecret. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteById(String id); + + /** + * Delete a SecretsManagerSecret. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new SecretsManagerSecret resource. + * + * @param name resource name. + * @return the first stage of the new SecretsManagerSecret definition. + */ + SecretsManagerSecret.DefinitionStages.Blank define(String name); +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/SecurityGroupMembership.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/SecurityGroupMembership.java new file mode 100644 index 000000000000..35523360d1d4 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/SecurityGroupMembership.java @@ -0,0 +1,121 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of SecurityGroupMembership. + */ +@Fluent +public final class SecurityGroupMembership implements JsonSerializable { + /* + *

The unique ID for this security group.

+ */ + private String securityGroupIdentifier; + + /* + *

The status of this security group.

+ */ + private String status; + + /** + * Creates an instance of SecurityGroupMembership class. + */ + public SecurityGroupMembership() { + } + + /** + * Get the securityGroupIdentifier property: <p>The unique ID for this security group.</p>. + * + * @return the securityGroupIdentifier value. + */ + public String securityGroupIdentifier() { + return this.securityGroupIdentifier; + } + + /** + * Set the securityGroupIdentifier property: <p>The unique ID for this security group.</p>. + * + * @param securityGroupIdentifier the securityGroupIdentifier value to set. + * @return the SecurityGroupMembership object itself. + */ + public SecurityGroupMembership withSecurityGroupIdentifier(String securityGroupIdentifier) { + this.securityGroupIdentifier = securityGroupIdentifier; + return this; + } + + /** + * Get the status property: <p>The status of this security group.</p>. + * + * @return the status value. + */ + public String status() { + return this.status; + } + + /** + * Set the status property: <p>The status of this security group.</p>. + * + * @param status the status value to set. + * @return the SecurityGroupMembership object itself. + */ + public SecurityGroupMembership withStatus(String status) { + this.status = status; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("securityGroupIdentifier", this.securityGroupIdentifier); + jsonWriter.writeStringField("status", this.status); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of SecurityGroupMembership from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of SecurityGroupMembership if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the SecurityGroupMembership. + */ + public static SecurityGroupMembership fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + SecurityGroupMembership deserializedSecurityGroupMembership = new SecurityGroupMembership(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("securityGroupIdentifier".equals(fieldName)) { + deserializedSecurityGroupMembership.securityGroupIdentifier = reader.getString(); + } else if ("status".equals(fieldName)) { + deserializedSecurityGroupMembership.status = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedSecurityGroupMembership; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ServerSideEncryptionByDefault.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ServerSideEncryptionByDefault.java new file mode 100644 index 000000000000..4dc1ec5fc0bf --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ServerSideEncryptionByDefault.java @@ -0,0 +1,155 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of ServerSideEncryptionByDefault. + */ +@Fluent +public final class ServerSideEncryptionByDefault implements JsonSerializable { + /* + * AWS Key Management Service (KMS) customer AWS KMS key ID to use for the default encryption. This parameter is + * allowed if and only if ``SSEAlgorithm`` is set to ``aws:kms`` or ``aws:kms:dsse``. You can specify the key ID, + * key alias, or the Amazon Resource Name (ARN) of the KMS key. + Key ID: ``1234abcd-12ab-34cd-56ef-1234567890ab`` + + * Key ARN: ``arn:aws:kms:us-east-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab`` + Key Alias: + * ``alias/alias-name`` If you use a key ID, you can run into a LogDestination undeliverable error when creating a + * VPC flow log. If you are using encryption with cross-account or AWS service operations you must use a fully + * qualified KMS key ARN. For more information, see [Using encryption for cross-account + * operations](https://docs.aws.amazon.com/AmazonS3/latest/dev/bucket-encryption.html#bucket-encryption-update- + * bucket-policy). Amazon S3 only supports symmetric encryption KMS keys. For more information, see [Asymmetric keys + * in KMS](https://docs.aws.amazon.com//kms/latest/developerguide/symmetric-asymmetric.html) in the *Key Management + * Service Developer Guide*. + */ + private String kmsMasterKeyId; + + /* + * Server-side encryption algorithm to use for the default encryption. + */ + private ServerSideEncryptionByDefaultSseAlgorithm sseAlgorithm; + + /** + * Creates an instance of ServerSideEncryptionByDefault class. + */ + public ServerSideEncryptionByDefault() { + } + + /** + * Get the kmsMasterKeyId property: AWS Key Management Service (KMS) customer AWS KMS key ID to use for the default + * encryption. This parameter is allowed if and only if ``SSEAlgorithm`` is set to ``aws:kms`` or ``aws:kms:dsse``. + * You can specify the key ID, key alias, or the Amazon Resource Name (ARN) of the KMS key. + Key ID: + * ``1234abcd-12ab-34cd-56ef-1234567890ab`` + Key ARN: + * ``arn:aws:kms:us-east-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab`` + Key Alias: ``alias/alias-name`` + * If you use a key ID, you can run into a LogDestination undeliverable error when creating a VPC flow log. If you + * are using encryption with cross-account or AWS service operations you must use a fully qualified KMS key ARN. For + * more information, see [Using encryption for cross-account + * operations](https://docs.aws.amazon.com/AmazonS3/latest/dev/bucket-encryption.html#bucket-encryption-update-bucket-policy). + * Amazon S3 only supports symmetric encryption KMS keys. For more information, see [Asymmetric keys in + * KMS](https://docs.aws.amazon.com//kms/latest/developerguide/symmetric-asymmetric.html) in the *Key Management + * Service Developer Guide*. + * + * @return the kmsMasterKeyId value. + */ + public String kmsMasterKeyId() { + return this.kmsMasterKeyId; + } + + /** + * Set the kmsMasterKeyId property: AWS Key Management Service (KMS) customer AWS KMS key ID to use for the default + * encryption. This parameter is allowed if and only if ``SSEAlgorithm`` is set to ``aws:kms`` or ``aws:kms:dsse``. + * You can specify the key ID, key alias, or the Amazon Resource Name (ARN) of the KMS key. + Key ID: + * ``1234abcd-12ab-34cd-56ef-1234567890ab`` + Key ARN: + * ``arn:aws:kms:us-east-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab`` + Key Alias: ``alias/alias-name`` + * If you use a key ID, you can run into a LogDestination undeliverable error when creating a VPC flow log. If you + * are using encryption with cross-account or AWS service operations you must use a fully qualified KMS key ARN. For + * more information, see [Using encryption for cross-account + * operations](https://docs.aws.amazon.com/AmazonS3/latest/dev/bucket-encryption.html#bucket-encryption-update-bucket-policy). + * Amazon S3 only supports symmetric encryption KMS keys. For more information, see [Asymmetric keys in + * KMS](https://docs.aws.amazon.com//kms/latest/developerguide/symmetric-asymmetric.html) in the *Key Management + * Service Developer Guide*. + * + * @param kmsMasterKeyId the kmsMasterKeyId value to set. + * @return the ServerSideEncryptionByDefault object itself. + */ + public ServerSideEncryptionByDefault withKmsMasterKeyId(String kmsMasterKeyId) { + this.kmsMasterKeyId = kmsMasterKeyId; + return this; + } + + /** + * Get the sseAlgorithm property: Server-side encryption algorithm to use for the default encryption. + * + * @return the sseAlgorithm value. + */ + public ServerSideEncryptionByDefaultSseAlgorithm sseAlgorithm() { + return this.sseAlgorithm; + } + + /** + * Set the sseAlgorithm property: Server-side encryption algorithm to use for the default encryption. + * + * @param sseAlgorithm the sseAlgorithm value to set. + * @return the ServerSideEncryptionByDefault object itself. + */ + public ServerSideEncryptionByDefault withSseAlgorithm(ServerSideEncryptionByDefaultSseAlgorithm sseAlgorithm) { + this.sseAlgorithm = sseAlgorithm; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("kmsMasterKeyID", this.kmsMasterKeyId); + jsonWriter.writeStringField("sseAlgorithm", this.sseAlgorithm == null ? null : this.sseAlgorithm.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ServerSideEncryptionByDefault from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ServerSideEncryptionByDefault if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ServerSideEncryptionByDefault. + */ + public static ServerSideEncryptionByDefault fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ServerSideEncryptionByDefault deserializedServerSideEncryptionByDefault + = new ServerSideEncryptionByDefault(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("kmsMasterKeyID".equals(fieldName)) { + deserializedServerSideEncryptionByDefault.kmsMasterKeyId = reader.getString(); + } else if ("sseAlgorithm".equals(fieldName)) { + deserializedServerSideEncryptionByDefault.sseAlgorithm + = ServerSideEncryptionByDefaultSseAlgorithm.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedServerSideEncryptionByDefault; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ServerSideEncryptionByDefaultSseAlgorithm.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ServerSideEncryptionByDefaultSseAlgorithm.java new file mode 100644 index 000000000000..c87f432f63fd --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ServerSideEncryptionByDefaultSseAlgorithm.java @@ -0,0 +1,57 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * ServerSideEncryptionByDefaultSSEAlgorithm enum. + */ +public final class ServerSideEncryptionByDefaultSseAlgorithm + extends ExpandableStringEnum { + /** + * Static value AES256 for ServerSideEncryptionByDefaultSseAlgorithm. + */ + public static final ServerSideEncryptionByDefaultSseAlgorithm AES256 = fromString("AES256"); + + /** + * Static value aws:kms for ServerSideEncryptionByDefaultSseAlgorithm. + */ + public static final ServerSideEncryptionByDefaultSseAlgorithm AWS_KMS = fromString("aws:kms"); + + /** + * Static value aws:kms:dsse for ServerSideEncryptionByDefaultSseAlgorithm. + */ + public static final ServerSideEncryptionByDefaultSseAlgorithm AWS_KMS_DSSE = fromString("aws:kms:dsse"); + + /** + * Creates a new instance of ServerSideEncryptionByDefaultSseAlgorithm value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ServerSideEncryptionByDefaultSseAlgorithm() { + } + + /** + * Creates or finds a ServerSideEncryptionByDefaultSseAlgorithm from its string representation. + * + * @param name a name to look for. + * @return the corresponding ServerSideEncryptionByDefaultSseAlgorithm. + */ + public static ServerSideEncryptionByDefaultSseAlgorithm fromString(String name) { + return fromString(name, ServerSideEncryptionByDefaultSseAlgorithm.class); + } + + /** + * Gets known ServerSideEncryptionByDefaultSseAlgorithm values. + * + * @return known ServerSideEncryptionByDefaultSseAlgorithm values. + */ + public static Collection values() { + return values(ServerSideEncryptionByDefaultSseAlgorithm.class); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ServerSideEncryptionRule.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ServerSideEncryptionRule.java new file mode 100644 index 000000000000..f159f88b3650 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ServerSideEncryptionRule.java @@ -0,0 +1,162 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of ServerSideEncryptionRule. + */ +@Fluent +public final class ServerSideEncryptionRule implements JsonSerializable { + /* + * Specifies whether Amazon S3 should use an S3 Bucket Key with server-side encryption using KMS (SSE-KMS) for new + * objects in the bucket. Existing objects are not affected. Setting the ``BucketKeyEnabled`` element to ``true`` + * causes Amazon S3 to use an S3 Bucket Key. By default, S3 Bucket Key is not enabled. For more information, see + * [Amazon S3 Bucket Keys](https://docs.aws.amazon.com/AmazonS3/latest/dev/bucket-key.html) in the *Amazon S3 User + * Guide*. + */ + private Boolean bucketKeyEnabled; + + /* + * Specifies the default server-side encryption to apply to new objects in the bucket. If a PUT Object request + * doesn't specify any server-side encryption, this default encryption will be applied. Describes the default + * server-side encryption to apply to new objects in the bucket. If a PUT Object request doesn't specify any + * server-side encryption, this default encryption will be applied. If you don't specify a customer managed key at + * configuration, Amazon S3 automatically creates an AWS KMS key in your AWS account the first time that you add an + * object encrypted with SSE-KMS to a bucket. By default, Amazon S3 uses this KMS key for SSE-KMS. For more + * information, see [PUT Bucket + * encryption](https://docs.aws.amazon.com/AmazonS3/latest/API/RESTBucketPUTencryption.html) in the *Amazon S3 API + * Reference*. + */ + private ServerSideEncryptionByDefault serverSideEncryptionByDefault; + + /** + * Creates an instance of ServerSideEncryptionRule class. + */ + public ServerSideEncryptionRule() { + } + + /** + * Get the bucketKeyEnabled property: Specifies whether Amazon S3 should use an S3 Bucket Key with server-side + * encryption using KMS (SSE-KMS) for new objects in the bucket. Existing objects are not affected. Setting the + * ``BucketKeyEnabled`` element to ``true`` causes Amazon S3 to use an S3 Bucket Key. By default, S3 Bucket Key is + * not enabled. For more information, see [Amazon S3 Bucket + * Keys](https://docs.aws.amazon.com/AmazonS3/latest/dev/bucket-key.html) in the *Amazon S3 User Guide*. + * + * @return the bucketKeyEnabled value. + */ + public Boolean bucketKeyEnabled() { + return this.bucketKeyEnabled; + } + + /** + * Set the bucketKeyEnabled property: Specifies whether Amazon S3 should use an S3 Bucket Key with server-side + * encryption using KMS (SSE-KMS) for new objects in the bucket. Existing objects are not affected. Setting the + * ``BucketKeyEnabled`` element to ``true`` causes Amazon S3 to use an S3 Bucket Key. By default, S3 Bucket Key is + * not enabled. For more information, see [Amazon S3 Bucket + * Keys](https://docs.aws.amazon.com/AmazonS3/latest/dev/bucket-key.html) in the *Amazon S3 User Guide*. + * + * @param bucketKeyEnabled the bucketKeyEnabled value to set. + * @return the ServerSideEncryptionRule object itself. + */ + public ServerSideEncryptionRule withBucketKeyEnabled(Boolean bucketKeyEnabled) { + this.bucketKeyEnabled = bucketKeyEnabled; + return this; + } + + /** + * Get the serverSideEncryptionByDefault property: Specifies the default server-side encryption to apply to new + * objects in the bucket. If a PUT Object request doesn't specify any server-side encryption, this default + * encryption will be applied. Describes the default server-side encryption to apply to new objects in the bucket. + * If a PUT Object request doesn't specify any server-side encryption, this default encryption will be applied. If + * you don't specify a customer managed key at configuration, Amazon S3 automatically creates an AWS KMS key in your + * AWS account the first time that you add an object encrypted with SSE-KMS to a bucket. By default, Amazon S3 uses + * this KMS key for SSE-KMS. For more information, see [PUT Bucket + * encryption](https://docs.aws.amazon.com/AmazonS3/latest/API/RESTBucketPUTencryption.html) in the *Amazon S3 API + * Reference*. + * + * @return the serverSideEncryptionByDefault value. + */ + public ServerSideEncryptionByDefault serverSideEncryptionByDefault() { + return this.serverSideEncryptionByDefault; + } + + /** + * Set the serverSideEncryptionByDefault property: Specifies the default server-side encryption to apply to new + * objects in the bucket. If a PUT Object request doesn't specify any server-side encryption, this default + * encryption will be applied. Describes the default server-side encryption to apply to new objects in the bucket. + * If a PUT Object request doesn't specify any server-side encryption, this default encryption will be applied. If + * you don't specify a customer managed key at configuration, Amazon S3 automatically creates an AWS KMS key in your + * AWS account the first time that you add an object encrypted with SSE-KMS to a bucket. By default, Amazon S3 uses + * this KMS key for SSE-KMS. For more information, see [PUT Bucket + * encryption](https://docs.aws.amazon.com/AmazonS3/latest/API/RESTBucketPUTencryption.html) in the *Amazon S3 API + * Reference*. + * + * @param serverSideEncryptionByDefault the serverSideEncryptionByDefault value to set. + * @return the ServerSideEncryptionRule object itself. + */ + public ServerSideEncryptionRule + withServerSideEncryptionByDefault(ServerSideEncryptionByDefault serverSideEncryptionByDefault) { + this.serverSideEncryptionByDefault = serverSideEncryptionByDefault; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (serverSideEncryptionByDefault() != null) { + serverSideEncryptionByDefault().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeBooleanField("bucketKeyEnabled", this.bucketKeyEnabled); + jsonWriter.writeJsonField("serverSideEncryptionByDefault", this.serverSideEncryptionByDefault); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ServerSideEncryptionRule from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ServerSideEncryptionRule if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ServerSideEncryptionRule. + */ + public static ServerSideEncryptionRule fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ServerSideEncryptionRule deserializedServerSideEncryptionRule = new ServerSideEncryptionRule(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("bucketKeyEnabled".equals(fieldName)) { + deserializedServerSideEncryptionRule.bucketKeyEnabled = reader.getNullable(JsonReader::getBoolean); + } else if ("serverSideEncryptionByDefault".equals(fieldName)) { + deserializedServerSideEncryptionRule.serverSideEncryptionByDefault + = ServerSideEncryptionByDefault.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedServerSideEncryptionRule; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ServerType.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ServerType.java new file mode 100644 index 000000000000..6d40df1130a0 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ServerType.java @@ -0,0 +1,66 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * ServerType enum. + */ +public final class ServerType extends ExpandableStringEnum { + /** + * Static value BITBUCKET for ServerType. + */ + public static final ServerType BITBUCKET = fromString("BITBUCKET"); + + /** + * Static value GITHUB for ServerType. + */ + public static final ServerType GITHUB = fromString("GITHUB"); + + /** + * Static value GITHUB_ENTERPRISE for ServerType. + */ + public static final ServerType GITHUB_ENTERPRISE = fromString("GITHUB_ENTERPRISE"); + + /** + * Static value GITLAB for ServerType. + */ + public static final ServerType GITLAB = fromString("GITLAB"); + + /** + * Static value GITLAB_SELF_MANAGED for ServerType. + */ + public static final ServerType GITLAB_SELF_MANAGED = fromString("GITLAB_SELF_MANAGED"); + + /** + * Creates a new instance of ServerType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ServerType() { + } + + /** + * Creates or finds a ServerType from its string representation. + * + * @param name a name to look for. + * @return the corresponding ServerType. + */ + public static ServerType fromString(String name) { + return fromString(name, ServerType.class); + } + + /** + * Gets known ServerType values. + * + * @return known ServerType values. + */ + public static Collection values() { + return values(ServerType.class); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ServerTypeEnumValue.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ServerTypeEnumValue.java new file mode 100644 index 000000000000..986d25e631d1 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ServerTypeEnumValue.java @@ -0,0 +1,93 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of ServerTypeEnumValue. + */ +@Fluent +public final class ServerTypeEnumValue implements JsonSerializable { + /* + * Property value + */ + private ServerType value; + + /** + * Creates an instance of ServerTypeEnumValue class. + */ + public ServerTypeEnumValue() { + } + + /** + * Get the value property: Property value. + * + * @return the value value. + */ + public ServerType value() { + return this.value; + } + + /** + * Set the value property: Property value. + * + * @param value the value value to set. + * @return the ServerTypeEnumValue object itself. + */ + public ServerTypeEnumValue withValue(ServerType value) { + this.value = value; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("value", this.value == null ? null : this.value.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ServerTypeEnumValue from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ServerTypeEnumValue if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the ServerTypeEnumValue. + */ + public static ServerTypeEnumValue fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ServerTypeEnumValue deserializedServerTypeEnumValue = new ServerTypeEnumValue(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + deserializedServerTypeEnumValue.value = ServerType.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedServerTypeEnumValue; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ServerlessV2ScalingConfiguration.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ServerlessV2ScalingConfiguration.java new file mode 100644 index 000000000000..bb111f25f41c --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ServerlessV2ScalingConfiguration.java @@ -0,0 +1,134 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of ServerlessV2ScalingConfiguration. + */ +@Fluent +public final class ServerlessV2ScalingConfiguration implements JsonSerializable { + /* + * The maximum number of Aurora capacity units (ACUs) for a DB instance in an Aurora Serverless v2 cluster. You can + * specify ACU values in half-step increments, such as 40, 40.5, 41, and so on. The largest value that you can use + * is 128. + */ + private Float maxCapacity; + + /* + * The minimum number of Aurora capacity units (ACUs) for a DB instance in an Aurora Serverless v2 cluster. You can + * specify ACU values in half-step increments, such as 8, 8.5, 9, and so on. The smallest value that you can use is + * 0.5. + */ + private Float minCapacity; + + /** + * Creates an instance of ServerlessV2ScalingConfiguration class. + */ + public ServerlessV2ScalingConfiguration() { + } + + /** + * Get the maxCapacity property: The maximum number of Aurora capacity units (ACUs) for a DB instance in an Aurora + * Serverless v2 cluster. You can specify ACU values in half-step increments, such as 40, 40.5, 41, and so on. The + * largest value that you can use is 128. + * + * @return the maxCapacity value. + */ + public Float maxCapacity() { + return this.maxCapacity; + } + + /** + * Set the maxCapacity property: The maximum number of Aurora capacity units (ACUs) for a DB instance in an Aurora + * Serverless v2 cluster. You can specify ACU values in half-step increments, such as 40, 40.5, 41, and so on. The + * largest value that you can use is 128. + * + * @param maxCapacity the maxCapacity value to set. + * @return the ServerlessV2ScalingConfiguration object itself. + */ + public ServerlessV2ScalingConfiguration withMaxCapacity(Float maxCapacity) { + this.maxCapacity = maxCapacity; + return this; + } + + /** + * Get the minCapacity property: The minimum number of Aurora capacity units (ACUs) for a DB instance in an Aurora + * Serverless v2 cluster. You can specify ACU values in half-step increments, such as 8, 8.5, 9, and so on. The + * smallest value that you can use is 0.5. + * + * @return the minCapacity value. + */ + public Float minCapacity() { + return this.minCapacity; + } + + /** + * Set the minCapacity property: The minimum number of Aurora capacity units (ACUs) for a DB instance in an Aurora + * Serverless v2 cluster. You can specify ACU values in half-step increments, such as 8, 8.5, 9, and so on. The + * smallest value that you can use is 0.5. + * + * @param minCapacity the minCapacity value to set. + * @return the ServerlessV2ScalingConfiguration object itself. + */ + public ServerlessV2ScalingConfiguration withMinCapacity(Float minCapacity) { + this.minCapacity = minCapacity; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeNumberField("maxCapacity", this.maxCapacity); + jsonWriter.writeNumberField("minCapacity", this.minCapacity); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ServerlessV2ScalingConfiguration from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ServerlessV2ScalingConfiguration if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ServerlessV2ScalingConfiguration. + */ + public static ServerlessV2ScalingConfiguration fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ServerlessV2ScalingConfiguration deserializedServerlessV2ScalingConfiguration + = new ServerlessV2ScalingConfiguration(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("maxCapacity".equals(fieldName)) { + deserializedServerlessV2ScalingConfiguration.maxCapacity = reader.getNullable(JsonReader::getFloat); + } else if ("minCapacity".equals(fieldName)) { + deserializedServerlessV2ScalingConfiguration.minCapacity = reader.getNullable(JsonReader::getFloat); + } else { + reader.skipChildren(); + } + } + + return deserializedServerlessV2ScalingConfiguration; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ServiceConnectClientAlias.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ServiceConnectClientAlias.java new file mode 100644 index 000000000000..b1e1ad809f46 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ServiceConnectClientAlias.java @@ -0,0 +1,162 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of ServiceConnectClientAlias. + */ +@Fluent +public final class ServiceConnectClientAlias implements JsonSerializable { + /* + * The ``dnsName`` is the name that you use in the applications of client tasks to connect to this service. The name + * must be a valid DNS name but doesn't need to be fully-qualified. The name can include up to 127 characters. The + * name can include lowercase letters, numbers, underscores (_), hyphens (-), and periods (.). The name can't start + * with a hyphen. If this parameter isn't specified, the default value of ``discoveryName.namespace`` is used. If + * the ``discoveryName`` isn't specified, the port mapping name from the task definition is used in + * ``portName.namespace``. To avoid changing your applications in client Amazon ECS services, set this to the same + * name that the client application uses by default. For example, a few common names are ``database``, ``db``, or + * the lowercase name of a database, such as ``mysql`` or ``redis``. For more information, see [Service + * Connect](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/service-connect.html) in the *Amazon Elastic + * Container Service Developer Guide*. + */ + private String dnsName; + + /* + * The listening port number for the Service Connect proxy. This port is available inside of all of the tasks within + * the same namespace. To avoid changing your applications in client Amazon ECS services, set this to the same port + * that the client application uses by default. For more information, see [Service + * Connect](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/service-connect.html) in the *Amazon Elastic + * Container Service Developer Guide*. + */ + private Integer port; + + /** + * Creates an instance of ServiceConnectClientAlias class. + */ + public ServiceConnectClientAlias() { + } + + /** + * Get the dnsName property: The ``dnsName`` is the name that you use in the applications of client tasks to connect + * to this service. The name must be a valid DNS name but doesn't need to be fully-qualified. The name can include + * up to 127 characters. The name can include lowercase letters, numbers, underscores (_), hyphens (-), and periods + * (.). The name can't start with a hyphen. If this parameter isn't specified, the default value of + * ``discoveryName.namespace`` is used. If the ``discoveryName`` isn't specified, the port mapping name from the + * task definition is used in ``portName.namespace``. To avoid changing your applications in client Amazon ECS + * services, set this to the same name that the client application uses by default. For example, a few common names + * are ``database``, ``db``, or the lowercase name of a database, such as ``mysql`` or ``redis``. For more + * information, see [Service + * Connect](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/service-connect.html) in the *Amazon Elastic + * Container Service Developer Guide*. + * + * @return the dnsName value. + */ + public String dnsName() { + return this.dnsName; + } + + /** + * Set the dnsName property: The ``dnsName`` is the name that you use in the applications of client tasks to connect + * to this service. The name must be a valid DNS name but doesn't need to be fully-qualified. The name can include + * up to 127 characters. The name can include lowercase letters, numbers, underscores (_), hyphens (-), and periods + * (.). The name can't start with a hyphen. If this parameter isn't specified, the default value of + * ``discoveryName.namespace`` is used. If the ``discoveryName`` isn't specified, the port mapping name from the + * task definition is used in ``portName.namespace``. To avoid changing your applications in client Amazon ECS + * services, set this to the same name that the client application uses by default. For example, a few common names + * are ``database``, ``db``, or the lowercase name of a database, such as ``mysql`` or ``redis``. For more + * information, see [Service + * Connect](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/service-connect.html) in the *Amazon Elastic + * Container Service Developer Guide*. + * + * @param dnsName the dnsName value to set. + * @return the ServiceConnectClientAlias object itself. + */ + public ServiceConnectClientAlias withDnsName(String dnsName) { + this.dnsName = dnsName; + return this; + } + + /** + * Get the port property: The listening port number for the Service Connect proxy. This port is available inside of + * all of the tasks within the same namespace. To avoid changing your applications in client Amazon ECS services, + * set this to the same port that the client application uses by default. For more information, see [Service + * Connect](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/service-connect.html) in the *Amazon Elastic + * Container Service Developer Guide*. + * + * @return the port value. + */ + public Integer port() { + return this.port; + } + + /** + * Set the port property: The listening port number for the Service Connect proxy. This port is available inside of + * all of the tasks within the same namespace. To avoid changing your applications in client Amazon ECS services, + * set this to the same port that the client application uses by default. For more information, see [Service + * Connect](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/service-connect.html) in the *Amazon Elastic + * Container Service Developer Guide*. + * + * @param port the port value to set. + * @return the ServiceConnectClientAlias object itself. + */ + public ServiceConnectClientAlias withPort(Integer port) { + this.port = port; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("dnsName", this.dnsName); + jsonWriter.writeNumberField("port", this.port); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ServiceConnectClientAlias from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ServiceConnectClientAlias if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ServiceConnectClientAlias. + */ + public static ServiceConnectClientAlias fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ServiceConnectClientAlias deserializedServiceConnectClientAlias = new ServiceConnectClientAlias(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("dnsName".equals(fieldName)) { + deserializedServiceConnectClientAlias.dnsName = reader.getString(); + } else if ("port".equals(fieldName)) { + deserializedServiceConnectClientAlias.port = reader.getNullable(JsonReader::getInt); + } else { + reader.skipChildren(); + } + } + + return deserializedServiceConnectClientAlias; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ServiceConnectConfiguration.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ServiceConnectConfiguration.java new file mode 100644 index 000000000000..c7b43e6a1700 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ServiceConnectConfiguration.java @@ -0,0 +1,346 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Definition of ServiceConnectConfiguration. + */ +@Fluent +public final class ServiceConnectConfiguration implements JsonSerializable { + /* + * Specifies whether to use Service Connect with this service. + */ + private Boolean enabled; + + /* + * The log configuration for the container. This parameter maps to ``LogConfig`` in the [Create a + * container](https://docs.aws.amazon.com/https://docs.docker.com/engine/api/v1.35/#operation/ContainerCreate) + * section of the [Docker Remote API](https://docs.aws.amazon.com/https://docs.docker.com/engine/api/v1.35/) and the + * ``--log-driver`` option to [docker + * run](https://docs.aws.amazon.com/https://docs.docker.com/engine/reference/commandline/run/). By default, + * containers use the same logging driver that the Docker daemon uses. However, the container might use a different + * logging driver than the Docker daemon by specifying a log driver configuration in the container definition. For + * more information about the options for different supported log drivers, see [Configure logging + * drivers](https://docs.aws.amazon.com/https://docs.docker.com/engine/admin/logging/overview/) in the Docker + * documentation. Understand the following when specifying a log configuration for your containers. + Amazon ECS + * currently supports a subset of the logging drivers available to the Docker daemon. Additional log drivers may be + * available in future releases of the Amazon ECS container agent. For tasks on FARGATElong, the supported log + * drivers are ``awslogs``, ``splunk``, and ``awsfirelens``. For tasks hosted on Amazon EC2 instances, the supported + * log drivers are ``awslogs``, ``fluentd``, ``gelf``, ``json-file``, ``journald``, ``logentries``,``syslog``, + * ``splunk``, and ``awsfirelens``. + This parameter requires version 1.18 of the Docker Remote API or greater on + * your container instance. + For tasks that are hosted on Amazon EC2 instances, the Amazon ECS container agent must + * register the available logging drivers with the ``ECS_AVAILABLE_LOGGING_DRIVERS`` environment variable before + * containers placed on that instance can use these log configuration options. For more information, see [Amazon ECS + * container agent configuration](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/ecs-agent-config.html) + * in the *Amazon Elastic Container Service Developer Guide*. + For tasks that are on FARGATElong, because you don't + * have access to the underlying infrastructure your tasks are hosted on, any additional software needed must be + * installed outside of the task. For example, the Fluentd output aggregators or a remote host running Logstash to + * send Gelf logs to. The log configuration for the container. This parameter maps to ``LogConfig`` in the [Create a + * container](https://docs.aws.amazon.com/https://docs.docker.com/engine/api/v1.35/#operation/ContainerCreate) + * section of the [Docker Remote API](https://docs.aws.amazon.com/https://docs.docker.com/engine/api/v1.35/) and the + * ``--log-driver`` option to [docker + * run](https://docs.aws.amazon.com/https://docs.docker.com/engine/reference/commandline/run/). By default, + * containers use the same logging driver that the Docker daemon uses. However, the container might use a different + * logging driver than the Docker daemon by specifying a log driver configuration in the container definition. For + * more information about the options for different supported log drivers, see [Configure logging + * drivers](https://docs.aws.amazon.com/https://docs.docker.com/engine/admin/logging/overview/) in the Docker + * documentation. Understand the following when specifying a log configuration for your containers. + Amazon ECS + * currently supports a subset of the logging drivers available to the Docker daemon. Additional log drivers may be + * available in future releases of the Amazon ECS container agent. For tasks on FARGATElong, the supported log + * drivers are ``awslogs``, ``splunk``, and ``awsfirelens``. For tasks hosted on Amazon EC2 instances, the supported + * log drivers are ``awslogs``, ``fluentd``, ``gelf``, ``json-file``, ``journald``, ``logentries``,``syslog``, + * ``splunk``, and ``awsfirelens``. + This parameter requires version 1.18 of the Docker Remote API or greater on + * your container instance. + For tasks that are hosted on Amazon EC2 instances, the Amazon ECS container agent must + * register the available logging drivers with the ``ECS_AVAILABLE_LOGGING_DRIVERS`` environment variable before + * containers placed on that instance can use these log configuration options. For more information, see [Amazon ECS + * container agent configuration](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/ecs-agent-config.html) + * in the *Amazon Elastic Container Service Developer Guide*. + For tasks that are on FARGATElong, because you don't + * have access to the underlying infrastructure your tasks are hosted on, any additional software needed must be + * installed outside of the task. For example, the Fluentd output aggregators or a remote host running Logstash to + * send Gelf logs to. + */ + private LogConfiguration logConfiguration; + + /* + * The namespace name or full Amazon Resource Name (ARN) of the CMAPlong namespace for use with Service Connect. The + * namespace must be in the same AWS Region as the Amazon ECS service and cluster. The type of namespace doesn't + * affect Service Connect. For more information about CMAPlong, see [Working with + * Services](https://docs.aws.amazon.com/cloud-map/latest/dg/working-with-services.html) in the *Developer Guide*. + */ + private String namespace; + + /* + * The list of Service Connect service objects. These are names and aliases (also known as endpoints) that are used + * by other Amazon ECS services to connect to this service. This field is not required for a 'client' Amazon ECS + * service that's a member of a namespace only to connect to other services within the namespace. An example of this + * would be a frontend application that accepts incoming requests from either a load balancer that's attached to the + * service or by other means. An object selects a port from the task definition, assigns a name for the CMAPlong + * service, and a list of aliases (endpoints) and ports for client applications to refer to this service. + */ + private List services; + + /** + * Creates an instance of ServiceConnectConfiguration class. + */ + public ServiceConnectConfiguration() { + } + + /** + * Get the enabled property: Specifies whether to use Service Connect with this service. + * + * @return the enabled value. + */ + public Boolean enabled() { + return this.enabled; + } + + /** + * Set the enabled property: Specifies whether to use Service Connect with this service. + * + * @param enabled the enabled value to set. + * @return the ServiceConnectConfiguration object itself. + */ + public ServiceConnectConfiguration withEnabled(Boolean enabled) { + this.enabled = enabled; + return this; + } + + /** + * Get the logConfiguration property: The log configuration for the container. This parameter maps to ``LogConfig`` + * in the [Create a + * container](https://docs.aws.amazon.com/https://docs.docker.com/engine/api/v1.35/#operation/ContainerCreate) + * section of the [Docker Remote API](https://docs.aws.amazon.com/https://docs.docker.com/engine/api/v1.35/) and the + * ``--log-driver`` option to [docker + * run](https://docs.aws.amazon.com/https://docs.docker.com/engine/reference/commandline/run/). By default, + * containers use the same logging driver that the Docker daemon uses. However, the container might use a different + * logging driver than the Docker daemon by specifying a log driver configuration in the container definition. For + * more information about the options for different supported log drivers, see [Configure logging + * drivers](https://docs.aws.amazon.com/https://docs.docker.com/engine/admin/logging/overview/) in the Docker + * documentation. Understand the following when specifying a log configuration for your containers. + Amazon ECS + * currently supports a subset of the logging drivers available to the Docker daemon. Additional log drivers may be + * available in future releases of the Amazon ECS container agent. For tasks on FARGATElong, the supported log + * drivers are ``awslogs``, ``splunk``, and ``awsfirelens``. For tasks hosted on Amazon EC2 instances, the supported + * log drivers are ``awslogs``, ``fluentd``, ``gelf``, ``json-file``, ``journald``, ``logentries``,``syslog``, + * ``splunk``, and ``awsfirelens``. + This parameter requires version 1.18 of the Docker Remote API or greater on + * your container instance. + For tasks that are hosted on Amazon EC2 instances, the Amazon ECS container agent must + * register the available logging drivers with the ``ECS_AVAILABLE_LOGGING_DRIVERS`` environment variable before + * containers placed on that instance can use these log configuration options. For more information, see [Amazon ECS + * container agent configuration](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/ecs-agent-config.html) + * in the *Amazon Elastic Container Service Developer Guide*. + For tasks that are on FARGATElong, because you don't + * have access to the underlying infrastructure your tasks are hosted on, any additional software needed must be + * installed outside of the task. For example, the Fluentd output aggregators or a remote host running Logstash to + * send Gelf logs to. The log configuration for the container. This parameter maps to ``LogConfig`` in the [Create a + * container](https://docs.aws.amazon.com/https://docs.docker.com/engine/api/v1.35/#operation/ContainerCreate) + * section of the [Docker Remote API](https://docs.aws.amazon.com/https://docs.docker.com/engine/api/v1.35/) and the + * ``--log-driver`` option to [docker + * run](https://docs.aws.amazon.com/https://docs.docker.com/engine/reference/commandline/run/). By default, + * containers use the same logging driver that the Docker daemon uses. However, the container might use a different + * logging driver than the Docker daemon by specifying a log driver configuration in the container definition. For + * more information about the options for different supported log drivers, see [Configure logging + * drivers](https://docs.aws.amazon.com/https://docs.docker.com/engine/admin/logging/overview/) in the Docker + * documentation. Understand the following when specifying a log configuration for your containers. + Amazon ECS + * currently supports a subset of the logging drivers available to the Docker daemon. Additional log drivers may be + * available in future releases of the Amazon ECS container agent. For tasks on FARGATElong, the supported log + * drivers are ``awslogs``, ``splunk``, and ``awsfirelens``. For tasks hosted on Amazon EC2 instances, the supported + * log drivers are ``awslogs``, ``fluentd``, ``gelf``, ``json-file``, ``journald``, ``logentries``,``syslog``, + * ``splunk``, and ``awsfirelens``. + This parameter requires version 1.18 of the Docker Remote API or greater on + * your container instance. + For tasks that are hosted on Amazon EC2 instances, the Amazon ECS container agent must + * register the available logging drivers with the ``ECS_AVAILABLE_LOGGING_DRIVERS`` environment variable before + * containers placed on that instance can use these log configuration options. For more information, see [Amazon ECS + * container agent configuration](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/ecs-agent-config.html) + * in the *Amazon Elastic Container Service Developer Guide*. + For tasks that are on FARGATElong, because you don't + * have access to the underlying infrastructure your tasks are hosted on, any additional software needed must be + * installed outside of the task. For example, the Fluentd output aggregators or a remote host running Logstash to + * send Gelf logs to. + * + * @return the logConfiguration value. + */ + public LogConfiguration logConfiguration() { + return this.logConfiguration; + } + + /** + * Set the logConfiguration property: The log configuration for the container. This parameter maps to ``LogConfig`` + * in the [Create a + * container](https://docs.aws.amazon.com/https://docs.docker.com/engine/api/v1.35/#operation/ContainerCreate) + * section of the [Docker Remote API](https://docs.aws.amazon.com/https://docs.docker.com/engine/api/v1.35/) and the + * ``--log-driver`` option to [docker + * run](https://docs.aws.amazon.com/https://docs.docker.com/engine/reference/commandline/run/). By default, + * containers use the same logging driver that the Docker daemon uses. However, the container might use a different + * logging driver than the Docker daemon by specifying a log driver configuration in the container definition. For + * more information about the options for different supported log drivers, see [Configure logging + * drivers](https://docs.aws.amazon.com/https://docs.docker.com/engine/admin/logging/overview/) in the Docker + * documentation. Understand the following when specifying a log configuration for your containers. + Amazon ECS + * currently supports a subset of the logging drivers available to the Docker daemon. Additional log drivers may be + * available in future releases of the Amazon ECS container agent. For tasks on FARGATElong, the supported log + * drivers are ``awslogs``, ``splunk``, and ``awsfirelens``. For tasks hosted on Amazon EC2 instances, the supported + * log drivers are ``awslogs``, ``fluentd``, ``gelf``, ``json-file``, ``journald``, ``logentries``,``syslog``, + * ``splunk``, and ``awsfirelens``. + This parameter requires version 1.18 of the Docker Remote API or greater on + * your container instance. + For tasks that are hosted on Amazon EC2 instances, the Amazon ECS container agent must + * register the available logging drivers with the ``ECS_AVAILABLE_LOGGING_DRIVERS`` environment variable before + * containers placed on that instance can use these log configuration options. For more information, see [Amazon ECS + * container agent configuration](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/ecs-agent-config.html) + * in the *Amazon Elastic Container Service Developer Guide*. + For tasks that are on FARGATElong, because you don't + * have access to the underlying infrastructure your tasks are hosted on, any additional software needed must be + * installed outside of the task. For example, the Fluentd output aggregators or a remote host running Logstash to + * send Gelf logs to. The log configuration for the container. This parameter maps to ``LogConfig`` in the [Create a + * container](https://docs.aws.amazon.com/https://docs.docker.com/engine/api/v1.35/#operation/ContainerCreate) + * section of the [Docker Remote API](https://docs.aws.amazon.com/https://docs.docker.com/engine/api/v1.35/) and the + * ``--log-driver`` option to [docker + * run](https://docs.aws.amazon.com/https://docs.docker.com/engine/reference/commandline/run/). By default, + * containers use the same logging driver that the Docker daemon uses. However, the container might use a different + * logging driver than the Docker daemon by specifying a log driver configuration in the container definition. For + * more information about the options for different supported log drivers, see [Configure logging + * drivers](https://docs.aws.amazon.com/https://docs.docker.com/engine/admin/logging/overview/) in the Docker + * documentation. Understand the following when specifying a log configuration for your containers. + Amazon ECS + * currently supports a subset of the logging drivers available to the Docker daemon. Additional log drivers may be + * available in future releases of the Amazon ECS container agent. For tasks on FARGATElong, the supported log + * drivers are ``awslogs``, ``splunk``, and ``awsfirelens``. For tasks hosted on Amazon EC2 instances, the supported + * log drivers are ``awslogs``, ``fluentd``, ``gelf``, ``json-file``, ``journald``, ``logentries``,``syslog``, + * ``splunk``, and ``awsfirelens``. + This parameter requires version 1.18 of the Docker Remote API or greater on + * your container instance. + For tasks that are hosted on Amazon EC2 instances, the Amazon ECS container agent must + * register the available logging drivers with the ``ECS_AVAILABLE_LOGGING_DRIVERS`` environment variable before + * containers placed on that instance can use these log configuration options. For more information, see [Amazon ECS + * container agent configuration](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/ecs-agent-config.html) + * in the *Amazon Elastic Container Service Developer Guide*. + For tasks that are on FARGATElong, because you don't + * have access to the underlying infrastructure your tasks are hosted on, any additional software needed must be + * installed outside of the task. For example, the Fluentd output aggregators or a remote host running Logstash to + * send Gelf logs to. + * + * @param logConfiguration the logConfiguration value to set. + * @return the ServiceConnectConfiguration object itself. + */ + public ServiceConnectConfiguration withLogConfiguration(LogConfiguration logConfiguration) { + this.logConfiguration = logConfiguration; + return this; + } + + /** + * Get the namespace property: The namespace name or full Amazon Resource Name (ARN) of the CMAPlong namespace for + * use with Service Connect. The namespace must be in the same AWS Region as the Amazon ECS service and cluster. The + * type of namespace doesn't affect Service Connect. For more information about CMAPlong, see [Working with + * Services](https://docs.aws.amazon.com/cloud-map/latest/dg/working-with-services.html) in the *Developer Guide*. + * + * @return the namespace value. + */ + public String namespace() { + return this.namespace; + } + + /** + * Set the namespace property: The namespace name or full Amazon Resource Name (ARN) of the CMAPlong namespace for + * use with Service Connect. The namespace must be in the same AWS Region as the Amazon ECS service and cluster. The + * type of namespace doesn't affect Service Connect. For more information about CMAPlong, see [Working with + * Services](https://docs.aws.amazon.com/cloud-map/latest/dg/working-with-services.html) in the *Developer Guide*. + * + * @param namespace the namespace value to set. + * @return the ServiceConnectConfiguration object itself. + */ + public ServiceConnectConfiguration withNamespace(String namespace) { + this.namespace = namespace; + return this; + } + + /** + * Get the services property: The list of Service Connect service objects. These are names and aliases (also known + * as endpoints) that are used by other Amazon ECS services to connect to this service. This field is not required + * for a 'client' Amazon ECS service that's a member of a namespace only to connect to other services within the + * namespace. An example of this would be a frontend application that accepts incoming requests from either a load + * balancer that's attached to the service or by other means. An object selects a port from the task definition, + * assigns a name for the CMAPlong service, and a list of aliases (endpoints) and ports for client applications to + * refer to this service. + * + * @return the services value. + */ + public List services() { + return this.services; + } + + /** + * Set the services property: The list of Service Connect service objects. These are names and aliases (also known + * as endpoints) that are used by other Amazon ECS services to connect to this service. This field is not required + * for a 'client' Amazon ECS service that's a member of a namespace only to connect to other services within the + * namespace. An example of this would be a frontend application that accepts incoming requests from either a load + * balancer that's attached to the service or by other means. An object selects a port from the task definition, + * assigns a name for the CMAPlong service, and a list of aliases (endpoints) and ports for client applications to + * refer to this service. + * + * @param services the services value to set. + * @return the ServiceConnectConfiguration object itself. + */ + public ServiceConnectConfiguration withServices(List services) { + this.services = services; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (logConfiguration() != null) { + logConfiguration().validate(); + } + if (services() != null) { + services().forEach(e -> e.validate()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeBooleanField("enabled", this.enabled); + jsonWriter.writeJsonField("logConfiguration", this.logConfiguration); + jsonWriter.writeStringField("namespace", this.namespace); + jsonWriter.writeArrayField("services", this.services, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ServiceConnectConfiguration from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ServiceConnectConfiguration if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ServiceConnectConfiguration. + */ + public static ServiceConnectConfiguration fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ServiceConnectConfiguration deserializedServiceConnectConfiguration = new ServiceConnectConfiguration(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("enabled".equals(fieldName)) { + deserializedServiceConnectConfiguration.enabled = reader.getNullable(JsonReader::getBoolean); + } else if ("logConfiguration".equals(fieldName)) { + deserializedServiceConnectConfiguration.logConfiguration = LogConfiguration.fromJson(reader); + } else if ("namespace".equals(fieldName)) { + deserializedServiceConnectConfiguration.namespace = reader.getString(); + } else if ("services".equals(fieldName)) { + List services + = reader.readArray(reader1 -> ServiceConnectService.fromJson(reader1)); + deserializedServiceConnectConfiguration.services = services; + } else { + reader.skipChildren(); + } + } + + return deserializedServiceConnectConfiguration; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ServiceConnectDefaults.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ServiceConnectDefaults.java new file mode 100644 index 000000000000..d3f14fcb43c8 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ServiceConnectDefaults.java @@ -0,0 +1,123 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of ServiceConnectDefaults. + */ +@Fluent +public final class ServiceConnectDefaults implements JsonSerializable { + /* + * The namespace name or full Amazon Resource Name (ARN) of the CMAPlong namespace that's used when you create a + * service and don't specify a Service Connect configuration. The namespace name can include up to 1024 characters. + * The name is case-sensitive. The name can't include hyphens (-), tilde (~), greater than (>), less than (<), or + * slash (/). If you enter an existing namespace name or ARN, then that namespace will be used. Any namespace type + * is supported. The namespace must be in this account and this AWS Region. If you enter a new name, a CMAPlong + * namespace will be created. Amazon ECS creates a CMAP namespace with the 'API calls' method of instance discovery + * only. This instance discovery method is the 'HTTP' namespace type in the CLIlong. Other types of instance + * discovery aren't used by Service Connect. If you update the cluster with an empty string ``''`` for the namespace + * name, the cluster configuration for Service Connect is removed. Note that the namespace will remain in CMAP and + * must be deleted separately. For more information about CMAPlong, see [Working with + * Services](https://docs.aws.amazon.com/cloud-map/latest/dg/working-with-services.html) in the *Developer Guide*. + */ + private String namespace; + + /** + * Creates an instance of ServiceConnectDefaults class. + */ + public ServiceConnectDefaults() { + } + + /** + * Get the namespace property: The namespace name or full Amazon Resource Name (ARN) of the CMAPlong namespace + * that's used when you create a service and don't specify a Service Connect configuration. The namespace name can + * include up to 1024 characters. The name is case-sensitive. The name can't include hyphens (-), tilde (~), greater + * than (>), less than (<), or slash (/). If you enter an existing namespace name or ARN, then that namespace + * will be used. Any namespace type is supported. The namespace must be in this account and this AWS Region. If you + * enter a new name, a CMAPlong namespace will be created. Amazon ECS creates a CMAP namespace with the 'API calls' + * method of instance discovery only. This instance discovery method is the 'HTTP' namespace type in the CLIlong. + * Other types of instance discovery aren't used by Service Connect. If you update the cluster with an empty string + * ``''`` for the namespace name, the cluster configuration for Service Connect is removed. Note that the namespace + * will remain in CMAP and must be deleted separately. For more information about CMAPlong, see [Working with + * Services](https://docs.aws.amazon.com/cloud-map/latest/dg/working-with-services.html) in the *Developer Guide*. + * + * @return the namespace value. + */ + public String namespace() { + return this.namespace; + } + + /** + * Set the namespace property: The namespace name or full Amazon Resource Name (ARN) of the CMAPlong namespace + * that's used when you create a service and don't specify a Service Connect configuration. The namespace name can + * include up to 1024 characters. The name is case-sensitive. The name can't include hyphens (-), tilde (~), greater + * than (>), less than (<), or slash (/). If you enter an existing namespace name or ARN, then that namespace + * will be used. Any namespace type is supported. The namespace must be in this account and this AWS Region. If you + * enter a new name, a CMAPlong namespace will be created. Amazon ECS creates a CMAP namespace with the 'API calls' + * method of instance discovery only. This instance discovery method is the 'HTTP' namespace type in the CLIlong. + * Other types of instance discovery aren't used by Service Connect. If you update the cluster with an empty string + * ``''`` for the namespace name, the cluster configuration for Service Connect is removed. Note that the namespace + * will remain in CMAP and must be deleted separately. For more information about CMAPlong, see [Working with + * Services](https://docs.aws.amazon.com/cloud-map/latest/dg/working-with-services.html) in the *Developer Guide*. + * + * @param namespace the namespace value to set. + * @return the ServiceConnectDefaults object itself. + */ + public ServiceConnectDefaults withNamespace(String namespace) { + this.namespace = namespace; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("namespace", this.namespace); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ServiceConnectDefaults from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ServiceConnectDefaults if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the ServiceConnectDefaults. + */ + public static ServiceConnectDefaults fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ServiceConnectDefaults deserializedServiceConnectDefaults = new ServiceConnectDefaults(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("namespace".equals(fieldName)) { + deserializedServiceConnectDefaults.namespace = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedServiceConnectDefaults; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ServiceConnectService.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ServiceConnectService.java new file mode 100644 index 000000000000..4b9def830fbf --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ServiceConnectService.java @@ -0,0 +1,299 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Definition of ServiceConnectService. + */ +@Fluent +public final class ServiceConnectService implements JsonSerializable { + /* + * The list of client aliases for this Service Connect service. You use these to assign names that can be used by + * client applications. The maximum number of client aliases that you can have in this list is 1. Each alias + * ('endpoint') is a fully-qualified name and port number that other Amazon ECS tasks ('clients') can use to connect + * to this service. Each name and port mapping must be unique within the namespace. For each + * ``ServiceConnectService``, you must provide at least one ``clientAlias`` with one ``port``. + */ + private List clientAliases; + + /* + * The ``discoveryName`` is the name of the new CMAP service that Amazon ECS creates for this Amazon ECS service. + * This must be unique within the CMAP namespace. The name can contain up to 64 characters. The name can include + * lowercase letters, numbers, underscores (_), and hyphens (-). The name can't start with a hyphen. If the + * ``discoveryName`` isn't specified, the port mapping name from the task definition is used in + * ``portName.namespace``. + */ + private String discoveryName; + + /* + * The port number for the Service Connect proxy to listen on. Use the value of this field to bypass the proxy for + * traffic on the port number specified in the named ``portMapping`` in the task definition of this application, and + * then use it in your VPC security groups to allow traffic into the proxy for this Amazon ECS service. In + * ``awsvpc`` mode and Fargate, the default value is the container port number. The container port number is in the + * ``portMapping`` in the task definition. In bridge mode, the default value is the ephemeral port of the Service + * Connect proxy. + */ + private Integer ingressPortOverride; + + /* + * The ``portName`` must match the name of one of the ``portMappings`` from all the containers in the task + * definition of this Amazon ECS service. + */ + private String portName; + + /* + * A reference to an object that represents the configured timeouts for Service Connect. An object that represents + * the timeout configurations for Service Connect. If ``idleTimeout`` is set to a time that is less than + * ``perRequestTimeout``, the connection will close when the ``idleTimeout`` is reached and not the + * ``perRequestTimeout``. + */ + private TimeoutConfiguration timeout; + + /* + * A reference to an object that represents a Transport Layer Security (TLS) configuration. An object that + * represents the configuration for Service Connect TLS. + */ + private ServiceConnectTlsConfiguration tls; + + /** + * Creates an instance of ServiceConnectService class. + */ + public ServiceConnectService() { + } + + /** + * Get the clientAliases property: The list of client aliases for this Service Connect service. You use these to + * assign names that can be used by client applications. The maximum number of client aliases that you can have in + * this list is 1. Each alias ('endpoint') is a fully-qualified name and port number that other Amazon ECS tasks + * ('clients') can use to connect to this service. Each name and port mapping must be unique within the namespace. + * For each ``ServiceConnectService``, you must provide at least one ``clientAlias`` with one ``port``. + * + * @return the clientAliases value. + */ + public List clientAliases() { + return this.clientAliases; + } + + /** + * Set the clientAliases property: The list of client aliases for this Service Connect service. You use these to + * assign names that can be used by client applications. The maximum number of client aliases that you can have in + * this list is 1. Each alias ('endpoint') is a fully-qualified name and port number that other Amazon ECS tasks + * ('clients') can use to connect to this service. Each name and port mapping must be unique within the namespace. + * For each ``ServiceConnectService``, you must provide at least one ``clientAlias`` with one ``port``. + * + * @param clientAliases the clientAliases value to set. + * @return the ServiceConnectService object itself. + */ + public ServiceConnectService withClientAliases(List clientAliases) { + this.clientAliases = clientAliases; + return this; + } + + /** + * Get the discoveryName property: The ``discoveryName`` is the name of the new CMAP service that Amazon ECS creates + * for this Amazon ECS service. This must be unique within the CMAP namespace. The name can contain up to 64 + * characters. The name can include lowercase letters, numbers, underscores (_), and hyphens (-). The name can't + * start with a hyphen. If the ``discoveryName`` isn't specified, the port mapping name from the task definition is + * used in ``portName.namespace``. + * + * @return the discoveryName value. + */ + public String discoveryName() { + return this.discoveryName; + } + + /** + * Set the discoveryName property: The ``discoveryName`` is the name of the new CMAP service that Amazon ECS creates + * for this Amazon ECS service. This must be unique within the CMAP namespace. The name can contain up to 64 + * characters. The name can include lowercase letters, numbers, underscores (_), and hyphens (-). The name can't + * start with a hyphen. If the ``discoveryName`` isn't specified, the port mapping name from the task definition is + * used in ``portName.namespace``. + * + * @param discoveryName the discoveryName value to set. + * @return the ServiceConnectService object itself. + */ + public ServiceConnectService withDiscoveryName(String discoveryName) { + this.discoveryName = discoveryName; + return this; + } + + /** + * Get the ingressPortOverride property: The port number for the Service Connect proxy to listen on. Use the value + * of this field to bypass the proxy for traffic on the port number specified in the named ``portMapping`` in the + * task definition of this application, and then use it in your VPC security groups to allow traffic into the proxy + * for this Amazon ECS service. In ``awsvpc`` mode and Fargate, the default value is the container port number. The + * container port number is in the ``portMapping`` in the task definition. In bridge mode, the default value is the + * ephemeral port of the Service Connect proxy. + * + * @return the ingressPortOverride value. + */ + public Integer ingressPortOverride() { + return this.ingressPortOverride; + } + + /** + * Set the ingressPortOverride property: The port number for the Service Connect proxy to listen on. Use the value + * of this field to bypass the proxy for traffic on the port number specified in the named ``portMapping`` in the + * task definition of this application, and then use it in your VPC security groups to allow traffic into the proxy + * for this Amazon ECS service. In ``awsvpc`` mode and Fargate, the default value is the container port number. The + * container port number is in the ``portMapping`` in the task definition. In bridge mode, the default value is the + * ephemeral port of the Service Connect proxy. + * + * @param ingressPortOverride the ingressPortOverride value to set. + * @return the ServiceConnectService object itself. + */ + public ServiceConnectService withIngressPortOverride(Integer ingressPortOverride) { + this.ingressPortOverride = ingressPortOverride; + return this; + } + + /** + * Get the portName property: The ``portName`` must match the name of one of the ``portMappings`` from all the + * containers in the task definition of this Amazon ECS service. + * + * @return the portName value. + */ + public String portName() { + return this.portName; + } + + /** + * Set the portName property: The ``portName`` must match the name of one of the ``portMappings`` from all the + * containers in the task definition of this Amazon ECS service. + * + * @param portName the portName value to set. + * @return the ServiceConnectService object itself. + */ + public ServiceConnectService withPortName(String portName) { + this.portName = portName; + return this; + } + + /** + * Get the timeout property: A reference to an object that represents the configured timeouts for Service Connect. + * An object that represents the timeout configurations for Service Connect. If ``idleTimeout`` is set to a time + * that is less than ``perRequestTimeout``, the connection will close when the ``idleTimeout`` is reached and not + * the ``perRequestTimeout``. + * + * @return the timeout value. + */ + public TimeoutConfiguration timeout() { + return this.timeout; + } + + /** + * Set the timeout property: A reference to an object that represents the configured timeouts for Service Connect. + * An object that represents the timeout configurations for Service Connect. If ``idleTimeout`` is set to a time + * that is less than ``perRequestTimeout``, the connection will close when the ``idleTimeout`` is reached and not + * the ``perRequestTimeout``. + * + * @param timeout the timeout value to set. + * @return the ServiceConnectService object itself. + */ + public ServiceConnectService withTimeout(TimeoutConfiguration timeout) { + this.timeout = timeout; + return this; + } + + /** + * Get the tls property: A reference to an object that represents a Transport Layer Security (TLS) configuration. An + * object that represents the configuration for Service Connect TLS. + * + * @return the tls value. + */ + public ServiceConnectTlsConfiguration tls() { + return this.tls; + } + + /** + * Set the tls property: A reference to an object that represents a Transport Layer Security (TLS) configuration. An + * object that represents the configuration for Service Connect TLS. + * + * @param tls the tls value to set. + * @return the ServiceConnectService object itself. + */ + public ServiceConnectService withTls(ServiceConnectTlsConfiguration tls) { + this.tls = tls; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (clientAliases() != null) { + clientAliases().forEach(e -> e.validate()); + } + if (timeout() != null) { + timeout().validate(); + } + if (tls() != null) { + tls().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("clientAliases", this.clientAliases, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("discoveryName", this.discoveryName); + jsonWriter.writeNumberField("ingressPortOverride", this.ingressPortOverride); + jsonWriter.writeStringField("portName", this.portName); + jsonWriter.writeJsonField("timeout", this.timeout); + jsonWriter.writeJsonField("tls", this.tls); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ServiceConnectService from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ServiceConnectService if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the ServiceConnectService. + */ + public static ServiceConnectService fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ServiceConnectService deserializedServiceConnectService = new ServiceConnectService(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("clientAliases".equals(fieldName)) { + List clientAliases + = reader.readArray(reader1 -> ServiceConnectClientAlias.fromJson(reader1)); + deserializedServiceConnectService.clientAliases = clientAliases; + } else if ("discoveryName".equals(fieldName)) { + deserializedServiceConnectService.discoveryName = reader.getString(); + } else if ("ingressPortOverride".equals(fieldName)) { + deserializedServiceConnectService.ingressPortOverride = reader.getNullable(JsonReader::getInt); + } else if ("portName".equals(fieldName)) { + deserializedServiceConnectService.portName = reader.getString(); + } else if ("timeout".equals(fieldName)) { + deserializedServiceConnectService.timeout = TimeoutConfiguration.fromJson(reader); + } else if ("tls".equals(fieldName)) { + deserializedServiceConnectService.tls = ServiceConnectTlsConfiguration.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedServiceConnectService; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ServiceConnectTlsCertificateAuthority.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ServiceConnectTlsCertificateAuthority.java new file mode 100644 index 000000000000..0016573e3a00 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ServiceConnectTlsCertificateAuthority.java @@ -0,0 +1,95 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of ServiceConnectTlsCertificateAuthority. + */ +@Fluent +public final class ServiceConnectTlsCertificateAuthority + implements JsonSerializable { + /* + * The ARN of the AWS Private Certificate Authority certificate. + */ + private String awsPcaAuthorityArn; + + /** + * Creates an instance of ServiceConnectTlsCertificateAuthority class. + */ + public ServiceConnectTlsCertificateAuthority() { + } + + /** + * Get the awsPcaAuthorityArn property: The ARN of the AWS Private Certificate Authority certificate. + * + * @return the awsPcaAuthorityArn value. + */ + public String awsPcaAuthorityArn() { + return this.awsPcaAuthorityArn; + } + + /** + * Set the awsPcaAuthorityArn property: The ARN of the AWS Private Certificate Authority certificate. + * + * @param awsPcaAuthorityArn the awsPcaAuthorityArn value to set. + * @return the ServiceConnectTlsCertificateAuthority object itself. + */ + public ServiceConnectTlsCertificateAuthority withAwsPcaAuthorityArn(String awsPcaAuthorityArn) { + this.awsPcaAuthorityArn = awsPcaAuthorityArn; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("awsPcaAuthorityArn", this.awsPcaAuthorityArn); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ServiceConnectTlsCertificateAuthority from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ServiceConnectTlsCertificateAuthority if the JsonReader was pointing to an instance of it, + * or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ServiceConnectTlsCertificateAuthority. + */ + public static ServiceConnectTlsCertificateAuthority fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ServiceConnectTlsCertificateAuthority deserializedServiceConnectTlsCertificateAuthority + = new ServiceConnectTlsCertificateAuthority(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("awsPcaAuthorityArn".equals(fieldName)) { + deserializedServiceConnectTlsCertificateAuthority.awsPcaAuthorityArn = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedServiceConnectTlsCertificateAuthority; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ServiceConnectTlsConfiguration.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ServiceConnectTlsConfiguration.java new file mode 100644 index 000000000000..3e2ae6af9e10 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ServiceConnectTlsConfiguration.java @@ -0,0 +1,159 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of ServiceConnectTlsConfiguration. + */ +@Fluent +public final class ServiceConnectTlsConfiguration implements JsonSerializable { + /* + * The signer certificate authority. An object that represents the AWS Private Certificate Authority certificate. + */ + private ServiceConnectTlsCertificateAuthority issuerCertificateAuthority; + + /* + * The AWS Key Management Service key. + */ + private String kmsKey; + + /* + * The Amazon Resource Name (ARN) of the IAM role that's associated with the Service Connect TLS. + */ + private String roleArn; + + /** + * Creates an instance of ServiceConnectTlsConfiguration class. + */ + public ServiceConnectTlsConfiguration() { + } + + /** + * Get the issuerCertificateAuthority property: The signer certificate authority. An object that represents the AWS + * Private Certificate Authority certificate. + * + * @return the issuerCertificateAuthority value. + */ + public ServiceConnectTlsCertificateAuthority issuerCertificateAuthority() { + return this.issuerCertificateAuthority; + } + + /** + * Set the issuerCertificateAuthority property: The signer certificate authority. An object that represents the AWS + * Private Certificate Authority certificate. + * + * @param issuerCertificateAuthority the issuerCertificateAuthority value to set. + * @return the ServiceConnectTlsConfiguration object itself. + */ + public ServiceConnectTlsConfiguration + withIssuerCertificateAuthority(ServiceConnectTlsCertificateAuthority issuerCertificateAuthority) { + this.issuerCertificateAuthority = issuerCertificateAuthority; + return this; + } + + /** + * Get the kmsKey property: The AWS Key Management Service key. + * + * @return the kmsKey value. + */ + public String kmsKey() { + return this.kmsKey; + } + + /** + * Set the kmsKey property: The AWS Key Management Service key. + * + * @param kmsKey the kmsKey value to set. + * @return the ServiceConnectTlsConfiguration object itself. + */ + public ServiceConnectTlsConfiguration withKmsKey(String kmsKey) { + this.kmsKey = kmsKey; + return this; + } + + /** + * Get the roleArn property: The Amazon Resource Name (ARN) of the IAM role that's associated with the Service + * Connect TLS. + * + * @return the roleArn value. + */ + public String roleArn() { + return this.roleArn; + } + + /** + * Set the roleArn property: The Amazon Resource Name (ARN) of the IAM role that's associated with the Service + * Connect TLS. + * + * @param roleArn the roleArn value to set. + * @return the ServiceConnectTlsConfiguration object itself. + */ + public ServiceConnectTlsConfiguration withRoleArn(String roleArn) { + this.roleArn = roleArn; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (issuerCertificateAuthority() != null) { + issuerCertificateAuthority().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("issuerCertificateAuthority", this.issuerCertificateAuthority); + jsonWriter.writeStringField("kmsKey", this.kmsKey); + jsonWriter.writeStringField("roleArn", this.roleArn); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ServiceConnectTlsConfiguration from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ServiceConnectTlsConfiguration if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ServiceConnectTlsConfiguration. + */ + public static ServiceConnectTlsConfiguration fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ServiceConnectTlsConfiguration deserializedServiceConnectTlsConfiguration + = new ServiceConnectTlsConfiguration(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("issuerCertificateAuthority".equals(fieldName)) { + deserializedServiceConnectTlsConfiguration.issuerCertificateAuthority + = ServiceConnectTlsCertificateAuthority.fromJson(reader); + } else if ("kmsKey".equals(fieldName)) { + deserializedServiceConnectTlsConfiguration.kmsKey = reader.getString(); + } else if ("roleArn".equals(fieldName)) { + deserializedServiceConnectTlsConfiguration.roleArn = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedServiceConnectTlsConfiguration; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ServiceManagedEbsVolumeConfiguration.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ServiceManagedEbsVolumeConfiguration.java new file mode 100644 index 000000000000..bfed95d40697 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ServiceManagedEbsVolumeConfiguration.java @@ -0,0 +1,490 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Definition of ServiceManagedEBSVolumeConfiguration. + */ +@Fluent +public final class ServiceManagedEbsVolumeConfiguration + implements JsonSerializable { + /* + * Indicates whether the volume should be encrypted. If no value is specified, encryption is turned on by default. + * This parameter maps 1:1 with the ``Encrypted`` parameter of the [CreateVolume + * API](https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_CreateVolume.html) in the *Amazon EC2 API + * Reference*. + */ + private Boolean encrypted; + + /* + * The Linux filesystem type for the volume. For volumes created from a snapshot, you must specify the same + * filesystem type that the volume was using when the snapshot was created. If there is a filesystem type mismatch, + * the task will fail to start. The available filesystem types are + * ``ext3``, ``ext4``, and ``xfs``. If no value is specified, the ``xfs`` filesystem type is used by default. + */ + private String filesystemType; + + /* + * The number of I/O operations per second (IOPS). For ``gp3``, ``io1``, and ``io2`` volumes, this represents the + * number of IOPS that are provisioned for the volume. For ``gp2`` volumes, this represents the baseline performance + * of the volume and the rate at which the volume accumulates I/O credits for bursting. The following are the + * supported values for each volume type. + ``gp3``: 3,000 - 16,000 IOPS + ``io1``: 100 - 64,000 IOPS + ``io2``: 100 + * - 256,000 IOPS This parameter is required for ``io1`` and ``io2`` volume types. The default for ``gp3`` volumes + * is ``3,000 IOPS``. This parameter is not supported for ``st1``, ``sc1``, or ``standard`` volume types. This + * parameter maps 1:1 with the ``Iops`` parameter of the [CreateVolume + * API](https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_CreateVolume.html) in the *Amazon EC2 API + * Reference*. + */ + private Integer iops; + + /* + * The Amazon Resource Name (ARN) identifier of the AWS Key Management Service key to use for Amazon EBS encryption. + * When encryption is turned on and no AWS Key Management Service key is specified, the default AWS managed key for + * Amazon EBS volumes is used. This parameter maps 1:1 with the ``KmsKeyId`` parameter of the [CreateVolume + * API](https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_CreateVolume.html) in the *Amazon EC2 API + * Reference*. AWS authenticates the AWS Key Management Service key asynchronously. Therefore, if you specify an ID, + * alias, or ARN that is invalid, the action can appear to complete, but eventually fails. + */ + private String kmsKeyId; + + /* + * The ARN of the IAM role to associate with this volume. This is the Amazon ECS infrastructure IAM role that is + * used to manage your AWS infrastructure. We recommend using the Amazon ECS-managed + * ``AmazonECSInfrastructureRolePolicyForVolumes`` IAM policy with this role. For more information, see [Amazon ECS + * infrastructure IAM + * role](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/infrastructure_IAM_role.html) in the *Amazon + * ECS Developer Guide*. + */ + private String roleArn; + + /* + * The size of the volume in GiB. You must specify either a volume size or a snapshot ID. If you specify a snapshot + * ID, the snapshot size is used for the volume size by default. You can optionally specify a volume size greater + * than or equal to the snapshot size. This parameter maps 1:1 with the ``Size`` parameter of the [CreateVolume + * API](https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_CreateVolume.html) in the *Amazon EC2 API + * Reference*. The following are the supported volume size values for each volume type. + ``gp2`` and ``gp3``: + * 1-16,384 + ``io1`` and ``io2``: 4-16,384 + ``st1`` and ``sc1``: 125-16,384 + ``standard``: 1-1,024 + */ + private Integer sizeInGiB; + + /* + * The snapshot that Amazon ECS uses to create the volume. You must specify either a snapshot ID or a volume size. + * This parameter maps 1:1 with the ``SnapshotId`` parameter of the [CreateVolume + * API](https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_CreateVolume.html) in the *Amazon EC2 API + * Reference*. + */ + private String snapshotId; + + /* + * The tags to apply to the volume. Amazon ECS applies service-managed tags by default. This parameter maps 1:1 with + * the ``TagSpecifications.N`` parameter of the [CreateVolume + * API](https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_CreateVolume.html) in the *Amazon EC2 API + * Reference*. + */ + private List tagSpecifications; + + /* + * The throughput to provision for a volume, in MiB/s, with a maximum of 1,000 MiB/s. This parameter maps 1:1 with + * the ``Throughput`` parameter of the [CreateVolume + * API](https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_CreateVolume.html) in the *Amazon EC2 API + * Reference*. This parameter is only supported for the ``gp3`` volume type. + */ + private Integer throughput; + + /* + * The volume type. This parameter maps 1:1 with the ``VolumeType`` parameter of the [CreateVolume + * API](https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_CreateVolume.html) in the *Amazon EC2 API + * Reference*. For more information, see [Amazon EBS volume + * types](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ebs-volume-types.html) in the *Amazon EC2 User Guide*. + * The following are the supported volume types. + General Purpose SSD: ``gp2``|``gp3`` + Provisioned IOPS SSD: + * ``io1``|``io2`` + Throughput Optimized HDD: ``st1`` + Cold HDD: ``sc1`` + Magnetic: ``standard`` The magnetic + * volume type is not supported on Fargate. + */ + private String volumeType; + + /** + * Creates an instance of ServiceManagedEbsVolumeConfiguration class. + */ + public ServiceManagedEbsVolumeConfiguration() { + } + + /** + * Get the encrypted property: Indicates whether the volume should be encrypted. If no value is specified, + * encryption is turned on by default. This parameter maps 1:1 with the ``Encrypted`` parameter of the [CreateVolume + * API](https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_CreateVolume.html) in the *Amazon EC2 API + * Reference*. + * + * @return the encrypted value. + */ + public Boolean encrypted() { + return this.encrypted; + } + + /** + * Set the encrypted property: Indicates whether the volume should be encrypted. If no value is specified, + * encryption is turned on by default. This parameter maps 1:1 with the ``Encrypted`` parameter of the [CreateVolume + * API](https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_CreateVolume.html) in the *Amazon EC2 API + * Reference*. + * + * @param encrypted the encrypted value to set. + * @return the ServiceManagedEbsVolumeConfiguration object itself. + */ + public ServiceManagedEbsVolumeConfiguration withEncrypted(Boolean encrypted) { + this.encrypted = encrypted; + return this; + } + + /** + * Get the filesystemType property: The Linux filesystem type for the volume. For volumes created from a snapshot, + * you must specify the same filesystem type that the volume was using when the snapshot was created. If there is a + * filesystem type mismatch, the task will fail to start. The available filesystem types are + * ``ext3``, ``ext4``, and ``xfs``. If no value is specified, the ``xfs`` filesystem type is used by default. + * + * @return the filesystemType value. + */ + public String filesystemType() { + return this.filesystemType; + } + + /** + * Set the filesystemType property: The Linux filesystem type for the volume. For volumes created from a snapshot, + * you must specify the same filesystem type that the volume was using when the snapshot was created. If there is a + * filesystem type mismatch, the task will fail to start. The available filesystem types are + * ``ext3``, ``ext4``, and ``xfs``. If no value is specified, the ``xfs`` filesystem type is used by default. + * + * @param filesystemType the filesystemType value to set. + * @return the ServiceManagedEbsVolumeConfiguration object itself. + */ + public ServiceManagedEbsVolumeConfiguration withFilesystemType(String filesystemType) { + this.filesystemType = filesystemType; + return this; + } + + /** + * Get the iops property: The number of I/O operations per second (IOPS). For ``gp3``, ``io1``, and ``io2`` volumes, + * this represents the number of IOPS that are provisioned for the volume. For ``gp2`` volumes, this represents the + * baseline performance of the volume and the rate at which the volume accumulates I/O credits for bursting. The + * following are the supported values for each volume type. + ``gp3``: 3,000 - 16,000 IOPS + ``io1``: 100 - 64,000 + * IOPS + ``io2``: 100 - 256,000 IOPS This parameter is required for ``io1`` and ``io2`` volume types. The default + * for ``gp3`` volumes is ``3,000 IOPS``. This parameter is not supported for ``st1``, ``sc1``, or ``standard`` + * volume types. This parameter maps 1:1 with the ``Iops`` parameter of the [CreateVolume + * API](https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_CreateVolume.html) in the *Amazon EC2 API + * Reference*. + * + * @return the iops value. + */ + public Integer iops() { + return this.iops; + } + + /** + * Set the iops property: The number of I/O operations per second (IOPS). For ``gp3``, ``io1``, and ``io2`` volumes, + * this represents the number of IOPS that are provisioned for the volume. For ``gp2`` volumes, this represents the + * baseline performance of the volume and the rate at which the volume accumulates I/O credits for bursting. The + * following are the supported values for each volume type. + ``gp3``: 3,000 - 16,000 IOPS + ``io1``: 100 - 64,000 + * IOPS + ``io2``: 100 - 256,000 IOPS This parameter is required for ``io1`` and ``io2`` volume types. The default + * for ``gp3`` volumes is ``3,000 IOPS``. This parameter is not supported for ``st1``, ``sc1``, or ``standard`` + * volume types. This parameter maps 1:1 with the ``Iops`` parameter of the [CreateVolume + * API](https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_CreateVolume.html) in the *Amazon EC2 API + * Reference*. + * + * @param iops the iops value to set. + * @return the ServiceManagedEbsVolumeConfiguration object itself. + */ + public ServiceManagedEbsVolumeConfiguration withIops(Integer iops) { + this.iops = iops; + return this; + } + + /** + * Get the kmsKeyId property: The Amazon Resource Name (ARN) identifier of the AWS Key Management Service key to use + * for Amazon EBS encryption. When encryption is turned on and no AWS Key Management Service key is specified, the + * default AWS managed key for Amazon EBS volumes is used. This parameter maps 1:1 with the ``KmsKeyId`` parameter + * of the [CreateVolume API](https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_CreateVolume.html) in the + * *Amazon EC2 API Reference*. AWS authenticates the AWS Key Management Service key asynchronously. Therefore, if + * you specify an ID, alias, or ARN that is invalid, the action can appear to complete, but eventually fails. + * + * @return the kmsKeyId value. + */ + public String kmsKeyId() { + return this.kmsKeyId; + } + + /** + * Set the kmsKeyId property: The Amazon Resource Name (ARN) identifier of the AWS Key Management Service key to use + * for Amazon EBS encryption. When encryption is turned on and no AWS Key Management Service key is specified, the + * default AWS managed key for Amazon EBS volumes is used. This parameter maps 1:1 with the ``KmsKeyId`` parameter + * of the [CreateVolume API](https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_CreateVolume.html) in the + * *Amazon EC2 API Reference*. AWS authenticates the AWS Key Management Service key asynchronously. Therefore, if + * you specify an ID, alias, or ARN that is invalid, the action can appear to complete, but eventually fails. + * + * @param kmsKeyId the kmsKeyId value to set. + * @return the ServiceManagedEbsVolumeConfiguration object itself. + */ + public ServiceManagedEbsVolumeConfiguration withKmsKeyId(String kmsKeyId) { + this.kmsKeyId = kmsKeyId; + return this; + } + + /** + * Get the roleArn property: The ARN of the IAM role to associate with this volume. This is the Amazon ECS + * infrastructure IAM role that is used to manage your AWS infrastructure. We recommend using the Amazon ECS-managed + * ``AmazonECSInfrastructureRolePolicyForVolumes`` IAM policy with this role. For more information, see [Amazon ECS + * infrastructure IAM + * role](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/infrastructure_IAM_role.html) in the *Amazon + * ECS Developer Guide*. + * + * @return the roleArn value. + */ + public String roleArn() { + return this.roleArn; + } + + /** + * Set the roleArn property: The ARN of the IAM role to associate with this volume. This is the Amazon ECS + * infrastructure IAM role that is used to manage your AWS infrastructure. We recommend using the Amazon ECS-managed + * ``AmazonECSInfrastructureRolePolicyForVolumes`` IAM policy with this role. For more information, see [Amazon ECS + * infrastructure IAM + * role](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/infrastructure_IAM_role.html) in the *Amazon + * ECS Developer Guide*. + * + * @param roleArn the roleArn value to set. + * @return the ServiceManagedEbsVolumeConfiguration object itself. + */ + public ServiceManagedEbsVolumeConfiguration withRoleArn(String roleArn) { + this.roleArn = roleArn; + return this; + } + + /** + * Get the sizeInGiB property: The size of the volume in GiB. You must specify either a volume size or a snapshot + * ID. If you specify a snapshot ID, the snapshot size is used for the volume size by default. You can optionally + * specify a volume size greater than or equal to the snapshot size. This parameter maps 1:1 with the ``Size`` + * parameter of the [CreateVolume API](https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_CreateVolume.html) + * in the *Amazon EC2 API Reference*. The following are the supported volume size values for each volume type. + + * ``gp2`` and ``gp3``: 1-16,384 + ``io1`` and ``io2``: 4-16,384 + ``st1`` and ``sc1``: 125-16,384 + ``standard``: + * 1-1,024. + * + * @return the sizeInGiB value. + */ + public Integer sizeInGiB() { + return this.sizeInGiB; + } + + /** + * Set the sizeInGiB property: The size of the volume in GiB. You must specify either a volume size or a snapshot + * ID. If you specify a snapshot ID, the snapshot size is used for the volume size by default. You can optionally + * specify a volume size greater than or equal to the snapshot size. This parameter maps 1:1 with the ``Size`` + * parameter of the [CreateVolume API](https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_CreateVolume.html) + * in the *Amazon EC2 API Reference*. The following are the supported volume size values for each volume type. + + * ``gp2`` and ``gp3``: 1-16,384 + ``io1`` and ``io2``: 4-16,384 + ``st1`` and ``sc1``: 125-16,384 + ``standard``: + * 1-1,024. + * + * @param sizeInGiB the sizeInGiB value to set. + * @return the ServiceManagedEbsVolumeConfiguration object itself. + */ + public ServiceManagedEbsVolumeConfiguration withSizeInGiB(Integer sizeInGiB) { + this.sizeInGiB = sizeInGiB; + return this; + } + + /** + * Get the snapshotId property: The snapshot that Amazon ECS uses to create the volume. You must specify either a + * snapshot ID or a volume size. This parameter maps 1:1 with the ``SnapshotId`` parameter of the [CreateVolume + * API](https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_CreateVolume.html) in the *Amazon EC2 API + * Reference*. + * + * @return the snapshotId value. + */ + public String snapshotId() { + return this.snapshotId; + } + + /** + * Set the snapshotId property: The snapshot that Amazon ECS uses to create the volume. You must specify either a + * snapshot ID or a volume size. This parameter maps 1:1 with the ``SnapshotId`` parameter of the [CreateVolume + * API](https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_CreateVolume.html) in the *Amazon EC2 API + * Reference*. + * + * @param snapshotId the snapshotId value to set. + * @return the ServiceManagedEbsVolumeConfiguration object itself. + */ + public ServiceManagedEbsVolumeConfiguration withSnapshotId(String snapshotId) { + this.snapshotId = snapshotId; + return this; + } + + /** + * Get the tagSpecifications property: The tags to apply to the volume. Amazon ECS applies service-managed tags by + * default. This parameter maps 1:1 with the ``TagSpecifications.N`` parameter of the [CreateVolume + * API](https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_CreateVolume.html) in the *Amazon EC2 API + * Reference*. + * + * @return the tagSpecifications value. + */ + public List tagSpecifications() { + return this.tagSpecifications; + } + + /** + * Set the tagSpecifications property: The tags to apply to the volume. Amazon ECS applies service-managed tags by + * default. This parameter maps 1:1 with the ``TagSpecifications.N`` parameter of the [CreateVolume + * API](https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_CreateVolume.html) in the *Amazon EC2 API + * Reference*. + * + * @param tagSpecifications the tagSpecifications value to set. + * @return the ServiceManagedEbsVolumeConfiguration object itself. + */ + public ServiceManagedEbsVolumeConfiguration withTagSpecifications(List tagSpecifications) { + this.tagSpecifications = tagSpecifications; + return this; + } + + /** + * Get the throughput property: The throughput to provision for a volume, in MiB/s, with a maximum of 1,000 MiB/s. + * This parameter maps 1:1 with the ``Throughput`` parameter of the [CreateVolume + * API](https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_CreateVolume.html) in the *Amazon EC2 API + * Reference*. This parameter is only supported for the ``gp3`` volume type. + * + * @return the throughput value. + */ + public Integer throughput() { + return this.throughput; + } + + /** + * Set the throughput property: The throughput to provision for a volume, in MiB/s, with a maximum of 1,000 MiB/s. + * This parameter maps 1:1 with the ``Throughput`` parameter of the [CreateVolume + * API](https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_CreateVolume.html) in the *Amazon EC2 API + * Reference*. This parameter is only supported for the ``gp3`` volume type. + * + * @param throughput the throughput value to set. + * @return the ServiceManagedEbsVolumeConfiguration object itself. + */ + public ServiceManagedEbsVolumeConfiguration withThroughput(Integer throughput) { + this.throughput = throughput; + return this; + } + + /** + * Get the volumeType property: The volume type. This parameter maps 1:1 with the ``VolumeType`` parameter of the + * [CreateVolume API](https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_CreateVolume.html) in the *Amazon + * EC2 API Reference*. For more information, see [Amazon EBS volume + * types](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ebs-volume-types.html) in the *Amazon EC2 User Guide*. + * The following are the supported volume types. + General Purpose SSD: ``gp2``|``gp3`` + Provisioned IOPS SSD: + * ``io1``|``io2`` + Throughput Optimized HDD: ``st1`` + Cold HDD: ``sc1`` + Magnetic: ``standard`` The magnetic + * volume type is not supported on Fargate. + * + * @return the volumeType value. + */ + public String volumeType() { + return this.volumeType; + } + + /** + * Set the volumeType property: The volume type. This parameter maps 1:1 with the ``VolumeType`` parameter of the + * [CreateVolume API](https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_CreateVolume.html) in the *Amazon + * EC2 API Reference*. For more information, see [Amazon EBS volume + * types](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ebs-volume-types.html) in the *Amazon EC2 User Guide*. + * The following are the supported volume types. + General Purpose SSD: ``gp2``|``gp3`` + Provisioned IOPS SSD: + * ``io1``|``io2`` + Throughput Optimized HDD: ``st1`` + Cold HDD: ``sc1`` + Magnetic: ``standard`` The magnetic + * volume type is not supported on Fargate. + * + * @param volumeType the volumeType value to set. + * @return the ServiceManagedEbsVolumeConfiguration object itself. + */ + public ServiceManagedEbsVolumeConfiguration withVolumeType(String volumeType) { + this.volumeType = volumeType; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (tagSpecifications() != null) { + tagSpecifications().forEach(e -> e.validate()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeBooleanField("encrypted", this.encrypted); + jsonWriter.writeStringField("filesystemType", this.filesystemType); + jsonWriter.writeNumberField("iops", this.iops); + jsonWriter.writeStringField("kmsKeyId", this.kmsKeyId); + jsonWriter.writeStringField("roleArn", this.roleArn); + jsonWriter.writeNumberField("sizeInGiB", this.sizeInGiB); + jsonWriter.writeStringField("snapshotId", this.snapshotId); + jsonWriter.writeArrayField("tagSpecifications", this.tagSpecifications, + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeNumberField("throughput", this.throughput); + jsonWriter.writeStringField("volumeType", this.volumeType); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ServiceManagedEbsVolumeConfiguration from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ServiceManagedEbsVolumeConfiguration if the JsonReader was pointing to an instance of it, + * or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ServiceManagedEbsVolumeConfiguration. + */ + public static ServiceManagedEbsVolumeConfiguration fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ServiceManagedEbsVolumeConfiguration deserializedServiceManagedEbsVolumeConfiguration + = new ServiceManagedEbsVolumeConfiguration(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("encrypted".equals(fieldName)) { + deserializedServiceManagedEbsVolumeConfiguration.encrypted + = reader.getNullable(JsonReader::getBoolean); + } else if ("filesystemType".equals(fieldName)) { + deserializedServiceManagedEbsVolumeConfiguration.filesystemType = reader.getString(); + } else if ("iops".equals(fieldName)) { + deserializedServiceManagedEbsVolumeConfiguration.iops = reader.getNullable(JsonReader::getInt); + } else if ("kmsKeyId".equals(fieldName)) { + deserializedServiceManagedEbsVolumeConfiguration.kmsKeyId = reader.getString(); + } else if ("roleArn".equals(fieldName)) { + deserializedServiceManagedEbsVolumeConfiguration.roleArn = reader.getString(); + } else if ("sizeInGiB".equals(fieldName)) { + deserializedServiceManagedEbsVolumeConfiguration.sizeInGiB = reader.getNullable(JsonReader::getInt); + } else if ("snapshotId".equals(fieldName)) { + deserializedServiceManagedEbsVolumeConfiguration.snapshotId = reader.getString(); + } else if ("tagSpecifications".equals(fieldName)) { + List tagSpecifications + = reader.readArray(reader1 -> EbsTagSpecification.fromJson(reader1)); + deserializedServiceManagedEbsVolumeConfiguration.tagSpecifications = tagSpecifications; + } else if ("throughput".equals(fieldName)) { + deserializedServiceManagedEbsVolumeConfiguration.throughput + = reader.getNullable(JsonReader::getInt); + } else if ("volumeType".equals(fieldName)) { + deserializedServiceManagedEbsVolumeConfiguration.volumeType = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedServiceManagedEbsVolumeConfiguration; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ServiceRegistry.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ServiceRegistry.java new file mode 100644 index 000000000000..c47ab6f350f6 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ServiceRegistry.java @@ -0,0 +1,214 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of ServiceRegistry. + */ +@Fluent +public final class ServiceRegistry implements JsonSerializable { + /* + * The container name value to be used for your service discovery service. It's already specified in the task + * definition. If the task definition that your service task specifies uses the ``bridge`` or ``host`` network mode, + * you must specify a ``containerName`` and ``containerPort`` combination from the task definition. If the task + * definition that your service task specifies uses the ``awsvpc`` network mode and a type SRV DNS record is used, + * you must specify either a ``containerName`` and ``containerPort`` combination or a ``port`` value. However, you + * can't specify both. + */ + private String containerName; + + /* + * The port value to be used for your service discovery service. It's already specified in the task definition. If + * the task definition your service task specifies uses the ``bridge`` or ``host`` network mode, you must specify a + * ``containerName`` and ``containerPort`` combination from the task definition. If the task definition your service + * task specifies uses the ``awsvpc`` network mode and a type SRV DNS record is used, you must specify either a + * ``containerName`` and ``containerPort`` combination or a ``port`` value. However, you can't specify both. + */ + private Integer containerPort; + + /* + * The port value used if your service discovery service specified an SRV record. This field might be used if both + * the ``awsvpc`` network mode and SRV records are used. + */ + private Integer port; + + /* + * The Amazon Resource Name (ARN) of the service registry. The currently supported service registry is CMAP. For + * more information, see [CreateService](https://docs.aws.amazon.com/cloud-map/latest/api/API_CreateService.html). + */ + private String registryArn; + + /** + * Creates an instance of ServiceRegistry class. + */ + public ServiceRegistry() { + } + + /** + * Get the containerName property: The container name value to be used for your service discovery service. It's + * already specified in the task definition. If the task definition that your service task specifies uses the + * ``bridge`` or ``host`` network mode, you must specify a ``containerName`` and ``containerPort`` combination from + * the task definition. If the task definition that your service task specifies uses the ``awsvpc`` network mode and + * a type SRV DNS record is used, you must specify either a ``containerName`` and ``containerPort`` combination or a + * ``port`` value. However, you can't specify both. + * + * @return the containerName value. + */ + public String containerName() { + return this.containerName; + } + + /** + * Set the containerName property: The container name value to be used for your service discovery service. It's + * already specified in the task definition. If the task definition that your service task specifies uses the + * ``bridge`` or ``host`` network mode, you must specify a ``containerName`` and ``containerPort`` combination from + * the task definition. If the task definition that your service task specifies uses the ``awsvpc`` network mode and + * a type SRV DNS record is used, you must specify either a ``containerName`` and ``containerPort`` combination or a + * ``port`` value. However, you can't specify both. + * + * @param containerName the containerName value to set. + * @return the ServiceRegistry object itself. + */ + public ServiceRegistry withContainerName(String containerName) { + this.containerName = containerName; + return this; + } + + /** + * Get the containerPort property: The port value to be used for your service discovery service. It's already + * specified in the task definition. If the task definition your service task specifies uses the ``bridge`` or + * ``host`` network mode, you must specify a ``containerName`` and ``containerPort`` combination from the task + * definition. If the task definition your service task specifies uses the ``awsvpc`` network mode and a type SRV + * DNS record is used, you must specify either a ``containerName`` and ``containerPort`` combination or a ``port`` + * value. However, you can't specify both. + * + * @return the containerPort value. + */ + public Integer containerPort() { + return this.containerPort; + } + + /** + * Set the containerPort property: The port value to be used for your service discovery service. It's already + * specified in the task definition. If the task definition your service task specifies uses the ``bridge`` or + * ``host`` network mode, you must specify a ``containerName`` and ``containerPort`` combination from the task + * definition. If the task definition your service task specifies uses the ``awsvpc`` network mode and a type SRV + * DNS record is used, you must specify either a ``containerName`` and ``containerPort`` combination or a ``port`` + * value. However, you can't specify both. + * + * @param containerPort the containerPort value to set. + * @return the ServiceRegistry object itself. + */ + public ServiceRegistry withContainerPort(Integer containerPort) { + this.containerPort = containerPort; + return this; + } + + /** + * Get the port property: The port value used if your service discovery service specified an SRV record. This field + * might be used if both the ``awsvpc`` network mode and SRV records are used. + * + * @return the port value. + */ + public Integer port() { + return this.port; + } + + /** + * Set the port property: The port value used if your service discovery service specified an SRV record. This field + * might be used if both the ``awsvpc`` network mode and SRV records are used. + * + * @param port the port value to set. + * @return the ServiceRegistry object itself. + */ + public ServiceRegistry withPort(Integer port) { + this.port = port; + return this; + } + + /** + * Get the registryArn property: The Amazon Resource Name (ARN) of the service registry. The currently supported + * service registry is CMAP. For more information, see + * [CreateService](https://docs.aws.amazon.com/cloud-map/latest/api/API_CreateService.html). + * + * @return the registryArn value. + */ + public String registryArn() { + return this.registryArn; + } + + /** + * Set the registryArn property: The Amazon Resource Name (ARN) of the service registry. The currently supported + * service registry is CMAP. For more information, see + * [CreateService](https://docs.aws.amazon.com/cloud-map/latest/api/API_CreateService.html). + * + * @param registryArn the registryArn value to set. + * @return the ServiceRegistry object itself. + */ + public ServiceRegistry withRegistryArn(String registryArn) { + this.registryArn = registryArn; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("containerName", this.containerName); + jsonWriter.writeNumberField("containerPort", this.containerPort); + jsonWriter.writeNumberField("port", this.port); + jsonWriter.writeStringField("registryArn", this.registryArn); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ServiceRegistry from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ServiceRegistry if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the ServiceRegistry. + */ + public static ServiceRegistry fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ServiceRegistry deserializedServiceRegistry = new ServiceRegistry(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("containerName".equals(fieldName)) { + deserializedServiceRegistry.containerName = reader.getString(); + } else if ("containerPort".equals(fieldName)) { + deserializedServiceRegistry.containerPort = reader.getNullable(JsonReader::getInt); + } else if ("port".equals(fieldName)) { + deserializedServiceRegistry.port = reader.getNullable(JsonReader::getInt); + } else if ("registryArn".equals(fieldName)) { + deserializedServiceRegistry.registryArn = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedServiceRegistry; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ServiceSoftwareOptions.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ServiceSoftwareOptions.java new file mode 100644 index 000000000000..66a417f63182 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ServiceSoftwareOptions.java @@ -0,0 +1,311 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.time.OffsetDateTime; +import java.time.format.DateTimeFormatter; + +/** + * Definition of ServiceSoftwareOptions. + */ +@Fluent +public final class ServiceSoftwareOptions implements JsonSerializable { + /* + *

The timestamp, in Epoch time, until which you can manually request a service software update. After this date, + * we automatically update your service software.

+ */ + private OffsetDateTime automatedUpdateDate; + + /* + *

True if you're able to cancel your service software version update. False if you can't cancel your service + * software update.

+ */ + private Boolean cancellable; + + /* + *

The current service software version present on the domain.

+ */ + private String currentVersion; + + /* + *

A description of the service software update status.

+ */ + private String description; + + /* + *

The new service software version, if one is available.

+ */ + private String newVersion; + + /* + *

True if a service software is never automatically updated. False if a service software is automatically + * updated after the automated update date.

+ */ + private Boolean optionalDeployment; + + /* + *

True if you're able to update your service software version. False if you can't update your service software + * version.

+ */ + private Boolean updateAvailable; + + /* + *

The status of your service software update.

+ */ + private DeploymentStatusEnumValue updateStatus; + + /** + * Creates an instance of ServiceSoftwareOptions class. + */ + public ServiceSoftwareOptions() { + } + + /** + * Get the automatedUpdateDate property: <p>The timestamp, in Epoch time, until which you can manually request + * a service software update. After this date, we automatically update your service software.</p>. + * + * @return the automatedUpdateDate value. + */ + public OffsetDateTime automatedUpdateDate() { + return this.automatedUpdateDate; + } + + /** + * Set the automatedUpdateDate property: <p>The timestamp, in Epoch time, until which you can manually request + * a service software update. After this date, we automatically update your service software.</p>. + * + * @param automatedUpdateDate the automatedUpdateDate value to set. + * @return the ServiceSoftwareOptions object itself. + */ + public ServiceSoftwareOptions withAutomatedUpdateDate(OffsetDateTime automatedUpdateDate) { + this.automatedUpdateDate = automatedUpdateDate; + return this; + } + + /** + * Get the cancellable property: <p> True if you're able to cancel your service software version update. False + * if you can't cancel your service software update.</p>. + * + * @return the cancellable value. + */ + public Boolean cancellable() { + return this.cancellable; + } + + /** + * Set the cancellable property: <p> True if you're able to cancel your service software version update. False + * if you can't cancel your service software update.</p>. + * + * @param cancellable the cancellable value to set. + * @return the ServiceSoftwareOptions object itself. + */ + public ServiceSoftwareOptions withCancellable(Boolean cancellable) { + this.cancellable = cancellable; + return this; + } + + /** + * Get the currentVersion property: <p>The current service software version present on the domain.</p>. + * + * @return the currentVersion value. + */ + public String currentVersion() { + return this.currentVersion; + } + + /** + * Set the currentVersion property: <p>The current service software version present on the domain.</p>. + * + * @param currentVersion the currentVersion value to set. + * @return the ServiceSoftwareOptions object itself. + */ + public ServiceSoftwareOptions withCurrentVersion(String currentVersion) { + this.currentVersion = currentVersion; + return this; + } + + /** + * Get the description property: <p>A description of the service software update status.</p>. + * + * @return the description value. + */ + public String description() { + return this.description; + } + + /** + * Set the description property: <p>A description of the service software update status.</p>. + * + * @param description the description value to set. + * @return the ServiceSoftwareOptions object itself. + */ + public ServiceSoftwareOptions withDescription(String description) { + this.description = description; + return this; + } + + /** + * Get the newVersion property: <p>The new service software version, if one is available.</p>. + * + * @return the newVersion value. + */ + public String newVersion() { + return this.newVersion; + } + + /** + * Set the newVersion property: <p>The new service software version, if one is available.</p>. + * + * @param newVersion the newVersion value to set. + * @return the ServiceSoftwareOptions object itself. + */ + public ServiceSoftwareOptions withNewVersion(String newVersion) { + this.newVersion = newVersion; + return this; + } + + /** + * Get the optionalDeployment property: <p>True if a service software is never automatically updated. False if + * a service software is automatically updated after the automated update date.</p>. + * + * @return the optionalDeployment value. + */ + public Boolean optionalDeployment() { + return this.optionalDeployment; + } + + /** + * Set the optionalDeployment property: <p>True if a service software is never automatically updated. False if + * a service software is automatically updated after the automated update date.</p>. + * + * @param optionalDeployment the optionalDeployment value to set. + * @return the ServiceSoftwareOptions object itself. + */ + public ServiceSoftwareOptions withOptionalDeployment(Boolean optionalDeployment) { + this.optionalDeployment = optionalDeployment; + return this; + } + + /** + * Get the updateAvailable property: <p>True if you're able to update your service software version. False if + * you can't update your service software version.</p>. + * + * @return the updateAvailable value. + */ + public Boolean updateAvailable() { + return this.updateAvailable; + } + + /** + * Set the updateAvailable property: <p>True if you're able to update your service software version. False if + * you can't update your service software version.</p>. + * + * @param updateAvailable the updateAvailable value to set. + * @return the ServiceSoftwareOptions object itself. + */ + public ServiceSoftwareOptions withUpdateAvailable(Boolean updateAvailable) { + this.updateAvailable = updateAvailable; + return this; + } + + /** + * Get the updateStatus property: <p>The status of your service software update.</p>. + * + * @return the updateStatus value. + */ + public DeploymentStatusEnumValue updateStatus() { + return this.updateStatus; + } + + /** + * Set the updateStatus property: <p>The status of your service software update.</p>. + * + * @param updateStatus the updateStatus value to set. + * @return the ServiceSoftwareOptions object itself. + */ + public ServiceSoftwareOptions withUpdateStatus(DeploymentStatusEnumValue updateStatus) { + this.updateStatus = updateStatus; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (updateStatus() != null) { + updateStatus().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("automatedUpdateDate", + this.automatedUpdateDate == null + ? null + : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.automatedUpdateDate)); + jsonWriter.writeBooleanField("cancellable", this.cancellable); + jsonWriter.writeStringField("currentVersion", this.currentVersion); + jsonWriter.writeStringField("description", this.description); + jsonWriter.writeStringField("newVersion", this.newVersion); + jsonWriter.writeBooleanField("optionalDeployment", this.optionalDeployment); + jsonWriter.writeBooleanField("updateAvailable", this.updateAvailable); + jsonWriter.writeJsonField("updateStatus", this.updateStatus); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ServiceSoftwareOptions from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ServiceSoftwareOptions if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the ServiceSoftwareOptions. + */ + public static ServiceSoftwareOptions fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ServiceSoftwareOptions deserializedServiceSoftwareOptions = new ServiceSoftwareOptions(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("automatedUpdateDate".equals(fieldName)) { + deserializedServiceSoftwareOptions.automatedUpdateDate = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("cancellable".equals(fieldName)) { + deserializedServiceSoftwareOptions.cancellable = reader.getNullable(JsonReader::getBoolean); + } else if ("currentVersion".equals(fieldName)) { + deserializedServiceSoftwareOptions.currentVersion = reader.getString(); + } else if ("description".equals(fieldName)) { + deserializedServiceSoftwareOptions.description = reader.getString(); + } else if ("newVersion".equals(fieldName)) { + deserializedServiceSoftwareOptions.newVersion = reader.getString(); + } else if ("optionalDeployment".equals(fieldName)) { + deserializedServiceSoftwareOptions.optionalDeployment = reader.getNullable(JsonReader::getBoolean); + } else if ("updateAvailable".equals(fieldName)) { + deserializedServiceSoftwareOptions.updateAvailable = reader.getNullable(JsonReader::getBoolean); + } else if ("updateStatus".equals(fieldName)) { + deserializedServiceSoftwareOptions.updateStatus = DeploymentStatusEnumValue.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedServiceSoftwareOptions; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ServiceVolumeConfiguration.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ServiceVolumeConfiguration.java new file mode 100644 index 000000000000..6ec35780ec0d --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ServiceVolumeConfiguration.java @@ -0,0 +1,142 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of ServiceVolumeConfiguration. + */ +@Fluent +public final class ServiceVolumeConfiguration implements JsonSerializable { + /* + * The configuration for the Amazon EBS volume that Amazon ECS creates and manages on your behalf. These settings + * are used to create each Amazon EBS volume, with one volume created for each task in the service. The Amazon EBS + * volumes are visible in your account in the Amazon EC2 console once they are created. The configuration for the + * Amazon EBS volume that Amazon ECS creates and manages on your behalf. These settings are used to create each + * Amazon EBS volume, with one volume created for each task in the service. Many of these parameters map 1:1 with + * the Amazon EBS ``CreateVolume`` API request parameters. + */ + private ServiceManagedEbsVolumeConfiguration managedEbsVolume; + + /* + * The name of the volume. This value must match the volume name from the ``Volume`` object in the task definition. + */ + private String name; + + /** + * Creates an instance of ServiceVolumeConfiguration class. + */ + public ServiceVolumeConfiguration() { + } + + /** + * Get the managedEbsVolume property: The configuration for the Amazon EBS volume that Amazon ECS creates and + * manages on your behalf. These settings are used to create each Amazon EBS volume, with one volume created for + * each task in the service. The Amazon EBS volumes are visible in your account in the Amazon EC2 console once they + * are created. The configuration for the Amazon EBS volume that Amazon ECS creates and manages on your behalf. + * These settings are used to create each Amazon EBS volume, with one volume created for each task in the service. + * Many of these parameters map 1:1 with the Amazon EBS ``CreateVolume`` API request parameters. + * + * @return the managedEbsVolume value. + */ + public ServiceManagedEbsVolumeConfiguration managedEbsVolume() { + return this.managedEbsVolume; + } + + /** + * Set the managedEbsVolume property: The configuration for the Amazon EBS volume that Amazon ECS creates and + * manages on your behalf. These settings are used to create each Amazon EBS volume, with one volume created for + * each task in the service. The Amazon EBS volumes are visible in your account in the Amazon EC2 console once they + * are created. The configuration for the Amazon EBS volume that Amazon ECS creates and manages on your behalf. + * These settings are used to create each Amazon EBS volume, with one volume created for each task in the service. + * Many of these parameters map 1:1 with the Amazon EBS ``CreateVolume`` API request parameters. + * + * @param managedEbsVolume the managedEbsVolume value to set. + * @return the ServiceVolumeConfiguration object itself. + */ + public ServiceVolumeConfiguration withManagedEbsVolume(ServiceManagedEbsVolumeConfiguration managedEbsVolume) { + this.managedEbsVolume = managedEbsVolume; + return this; + } + + /** + * Get the name property: The name of the volume. This value must match the volume name from the ``Volume`` object + * in the task definition. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: The name of the volume. This value must match the volume name from the ``Volume`` object + * in the task definition. + * + * @param name the name value to set. + * @return the ServiceVolumeConfiguration object itself. + */ + public ServiceVolumeConfiguration withName(String name) { + this.name = name; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (managedEbsVolume() != null) { + managedEbsVolume().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("managedEBSVolume", this.managedEbsVolume); + jsonWriter.writeStringField("name", this.name); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ServiceVolumeConfiguration from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ServiceVolumeConfiguration if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ServiceVolumeConfiguration. + */ + public static ServiceVolumeConfiguration fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ServiceVolumeConfiguration deserializedServiceVolumeConfiguration = new ServiceVolumeConfiguration(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("managedEBSVolume".equals(fieldName)) { + deserializedServiceVolumeConfiguration.managedEbsVolume + = ServiceManagedEbsVolumeConfiguration.fromJson(reader); + } else if ("name".equals(fieldName)) { + deserializedServiceVolumeConfiguration.name = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedServiceVolumeConfiguration; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/SeveritySummary.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/SeveritySummary.java new file mode 100644 index 000000000000..5c5695b55c10 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/SeveritySummary.java @@ -0,0 +1,259 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of SeveritySummary. + */ +@Fluent +public final class SeveritySummary implements JsonSerializable { + /* + *

The total number of resources or compliance items that have a severity level of Critical. + * Critical severity is determined by the organization that published the compliance items.

+ */ + private Integer criticalCount; + + /* + *

The total number of resources or compliance items that have a severity level of high. High severity is + * determined by the organization that published the compliance items.

+ */ + private Integer highCount; + + /* + *

The total number of resources or compliance items that have a severity level of informational. Informational + * severity is determined by the organization that published the compliance items.

+ */ + private Integer informationalCount; + + /* + *

The total number of resources or compliance items that have a severity level of low. Low severity is + * determined by the organization that published the compliance items.

+ */ + private Integer lowCount; + + /* + *

The total number of resources or compliance items that have a severity level of medium. Medium severity is + * determined by the organization that published the compliance items.

+ */ + private Integer mediumCount; + + /* + *

The total number of resources or compliance items that have a severity level of unspecified. Unspecified + * severity is determined by the organization that published the compliance items.

+ */ + private Integer unspecifiedCount; + + /** + * Creates an instance of SeveritySummary class. + */ + public SeveritySummary() { + } + + /** + * Get the criticalCount property: <p>The total number of resources or compliance items that have a severity + * level of <code>Critical</code>. Critical severity is determined by the organization that published + * the compliance items.</p>. + * + * @return the criticalCount value. + */ + public Integer criticalCount() { + return this.criticalCount; + } + + /** + * Set the criticalCount property: <p>The total number of resources or compliance items that have a severity + * level of <code>Critical</code>. Critical severity is determined by the organization that published + * the compliance items.</p>. + * + * @param criticalCount the criticalCount value to set. + * @return the SeveritySummary object itself. + */ + public SeveritySummary withCriticalCount(Integer criticalCount) { + this.criticalCount = criticalCount; + return this; + } + + /** + * Get the highCount property: <p>The total number of resources or compliance items that have a severity level + * of high. High severity is determined by the organization that published the compliance items.</p>. + * + * @return the highCount value. + */ + public Integer highCount() { + return this.highCount; + } + + /** + * Set the highCount property: <p>The total number of resources or compliance items that have a severity level + * of high. High severity is determined by the organization that published the compliance items.</p>. + * + * @param highCount the highCount value to set. + * @return the SeveritySummary object itself. + */ + public SeveritySummary withHighCount(Integer highCount) { + this.highCount = highCount; + return this; + } + + /** + * Get the informationalCount property: <p>The total number of resources or compliance items that have a + * severity level of informational. Informational severity is determined by the organization that published the + * compliance items.</p>. + * + * @return the informationalCount value. + */ + public Integer informationalCount() { + return this.informationalCount; + } + + /** + * Set the informationalCount property: <p>The total number of resources or compliance items that have a + * severity level of informational. Informational severity is determined by the organization that published the + * compliance items.</p>. + * + * @param informationalCount the informationalCount value to set. + * @return the SeveritySummary object itself. + */ + public SeveritySummary withInformationalCount(Integer informationalCount) { + this.informationalCount = informationalCount; + return this; + } + + /** + * Get the lowCount property: <p>The total number of resources or compliance items that have a severity level + * of low. Low severity is determined by the organization that published the compliance items.</p>. + * + * @return the lowCount value. + */ + public Integer lowCount() { + return this.lowCount; + } + + /** + * Set the lowCount property: <p>The total number of resources or compliance items that have a severity level + * of low. Low severity is determined by the organization that published the compliance items.</p>. + * + * @param lowCount the lowCount value to set. + * @return the SeveritySummary object itself. + */ + public SeveritySummary withLowCount(Integer lowCount) { + this.lowCount = lowCount; + return this; + } + + /** + * Get the mediumCount property: <p>The total number of resources or compliance items that have a severity + * level of medium. Medium severity is determined by the organization that published the compliance + * items.</p>. + * + * @return the mediumCount value. + */ + public Integer mediumCount() { + return this.mediumCount; + } + + /** + * Set the mediumCount property: <p>The total number of resources or compliance items that have a severity + * level of medium. Medium severity is determined by the organization that published the compliance + * items.</p>. + * + * @param mediumCount the mediumCount value to set. + * @return the SeveritySummary object itself. + */ + public SeveritySummary withMediumCount(Integer mediumCount) { + this.mediumCount = mediumCount; + return this; + } + + /** + * Get the unspecifiedCount property: <p>The total number of resources or compliance items that have a + * severity level of unspecified. Unspecified severity is determined by the organization that published the + * compliance items.</p>. + * + * @return the unspecifiedCount value. + */ + public Integer unspecifiedCount() { + return this.unspecifiedCount; + } + + /** + * Set the unspecifiedCount property: <p>The total number of resources or compliance items that have a + * severity level of unspecified. Unspecified severity is determined by the organization that published the + * compliance items.</p>. + * + * @param unspecifiedCount the unspecifiedCount value to set. + * @return the SeveritySummary object itself. + */ + public SeveritySummary withUnspecifiedCount(Integer unspecifiedCount) { + this.unspecifiedCount = unspecifiedCount; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeNumberField("criticalCount", this.criticalCount); + jsonWriter.writeNumberField("highCount", this.highCount); + jsonWriter.writeNumberField("informationalCount", this.informationalCount); + jsonWriter.writeNumberField("lowCount", this.lowCount); + jsonWriter.writeNumberField("mediumCount", this.mediumCount); + jsonWriter.writeNumberField("unspecifiedCount", this.unspecifiedCount); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of SeveritySummary from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of SeveritySummary if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the SeveritySummary. + */ + public static SeveritySummary fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + SeveritySummary deserializedSeveritySummary = new SeveritySummary(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("criticalCount".equals(fieldName)) { + deserializedSeveritySummary.criticalCount = reader.getNullable(JsonReader::getInt); + } else if ("highCount".equals(fieldName)) { + deserializedSeveritySummary.highCount = reader.getNullable(JsonReader::getInt); + } else if ("informationalCount".equals(fieldName)) { + deserializedSeveritySummary.informationalCount = reader.getNullable(JsonReader::getInt); + } else if ("lowCount".equals(fieldName)) { + deserializedSeveritySummary.lowCount = reader.getNullable(JsonReader::getInt); + } else if ("mediumCount".equals(fieldName)) { + deserializedSeveritySummary.mediumCount = reader.getNullable(JsonReader::getInt); + } else if ("unspecifiedCount".equals(fieldName)) { + deserializedSeveritySummary.unspecifiedCount = reader.getNullable(JsonReader::getInt); + } else { + reader.skipChildren(); + } + } + + return deserializedSeveritySummary; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/SimpleCriterionForJob.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/SimpleCriterionForJob.java new file mode 100644 index 000000000000..f38488c97853 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/SimpleCriterionForJob.java @@ -0,0 +1,193 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Definition of SimpleCriterionForJob. + */ +@Fluent +public final class SimpleCriterionForJob implements JsonSerializable { + /* + *

The operator to use in the condition. Valid values are EQ (equals) and NE (not equals).

+ */ + private JobComparatorEnumValue comparator; + + /* + *

The property to use in the condition.

+ */ + private SimpleCriterionKeyForJobEnumValue key; + + /* + *

An array that lists one or more values to use in the condition. If you specify multiple values, Amazon Macie + * uses OR logic to join the values. Valid values for each supported property (key) are:

  • ACCOUNT_ID - + * A string that represents the unique identifier for the Amazon Web Services account that owns the bucket.

  • + *
  • S3_BUCKET_EFFECTIVE_PERMISSION - A string that represents an enumerated value that Macie defines for the + * BucketPublicAccess.effectivePermission property of a bucket.

  • + *
  • S3_BUCKET_NAME - A string that represents the name of a bucket.

  • S3_BUCKET_SHARED_ACCESS - + * A string that represents an enumerated value that Macie defines for the BucketMetadata.sharedAccess property of a bucket.

Values are + * case sensitive. Also, Macie doesn't support use of partial values or wildcard characters in these values.

+ */ + private List values; + + /** + * Creates an instance of SimpleCriterionForJob class. + */ + public SimpleCriterionForJob() { + } + + /** + * Get the comparator property: <p>The operator to use in the condition. Valid values are EQ (equals) and NE + * (not equals).</p>. + * + * @return the comparator value. + */ + public JobComparatorEnumValue comparator() { + return this.comparator; + } + + /** + * Set the comparator property: <p>The operator to use in the condition. Valid values are EQ (equals) and NE + * (not equals).</p>. + * + * @param comparator the comparator value to set. + * @return the SimpleCriterionForJob object itself. + */ + public SimpleCriterionForJob withComparator(JobComparatorEnumValue comparator) { + this.comparator = comparator; + return this; + } + + /** + * Get the key property: <p>The property to use in the condition.</p>. + * + * @return the key value. + */ + public SimpleCriterionKeyForJobEnumValue key() { + return this.key; + } + + /** + * Set the key property: <p>The property to use in the condition.</p>. + * + * @param key the key value to set. + * @return the SimpleCriterionForJob object itself. + */ + public SimpleCriterionForJob withKey(SimpleCriterionKeyForJobEnumValue key) { + this.key = key; + return this; + } + + /** + * Get the values property: <p>An array that lists one or more values to use in the condition. If you specify + * multiple values, Amazon Macie uses OR logic to join the values. Valid values for each supported property (key) + * are:</p> <ul><li><p>ACCOUNT_ID - A string that represents the unique identifier for the + * Amazon Web Services account that owns the bucket.</p></li> + * <li><p>S3_BUCKET_EFFECTIVE_PERMISSION - A string that represents an enumerated value that Macie + * defines for the <a + * href='https://docs.aws.amazon.com/macie/latest/APIReference/datasources-s3.html#datasources-s3-prop-bucketpublicaccess-effectivepermission'>BucketPublicAccess.effectivePermission</a> + * property of a bucket.</p></li> <li><p>S3_BUCKET_NAME - A string that represents the name + * of a bucket.</p></li> <li><p>S3_BUCKET_SHARED_ACCESS - A string that represents an + * enumerated value that Macie defines for the <a + * href='https://docs.aws.amazon.com/macie/latest/APIReference/datasources-s3.html#datasources-s3-prop-bucketmetadata-sharedaccess'>BucketMetadata.sharedAccess</a> + * property of a bucket.</p></li></ul> <p>Values are case sensitive. Also, Macie doesn't + * support use of partial values or wildcard characters in these values.</p>. + * + * @return the values value. + */ + public List values() { + return this.values; + } + + /** + * Set the values property: <p>An array that lists one or more values to use in the condition. If you specify + * multiple values, Amazon Macie uses OR logic to join the values. Valid values for each supported property (key) + * are:</p> <ul><li><p>ACCOUNT_ID - A string that represents the unique identifier for the + * Amazon Web Services account that owns the bucket.</p></li> + * <li><p>S3_BUCKET_EFFECTIVE_PERMISSION - A string that represents an enumerated value that Macie + * defines for the <a + * href='https://docs.aws.amazon.com/macie/latest/APIReference/datasources-s3.html#datasources-s3-prop-bucketpublicaccess-effectivepermission'>BucketPublicAccess.effectivePermission</a> + * property of a bucket.</p></li> <li><p>S3_BUCKET_NAME - A string that represents the name + * of a bucket.</p></li> <li><p>S3_BUCKET_SHARED_ACCESS - A string that represents an + * enumerated value that Macie defines for the <a + * href='https://docs.aws.amazon.com/macie/latest/APIReference/datasources-s3.html#datasources-s3-prop-bucketmetadata-sharedaccess'>BucketMetadata.sharedAccess</a> + * property of a bucket.</p></li></ul> <p>Values are case sensitive. Also, Macie doesn't + * support use of partial values or wildcard characters in these values.</p>. + * + * @param values the values value to set. + * @return the SimpleCriterionForJob object itself. + */ + public SimpleCriterionForJob withValues(List values) { + this.values = values; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (comparator() != null) { + comparator().validate(); + } + if (key() != null) { + key().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("comparator", this.comparator); + jsonWriter.writeJsonField("key", this.key); + jsonWriter.writeArrayField("values", this.values, (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of SimpleCriterionForJob from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of SimpleCriterionForJob if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the SimpleCriterionForJob. + */ + public static SimpleCriterionForJob fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + SimpleCriterionForJob deserializedSimpleCriterionForJob = new SimpleCriterionForJob(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("comparator".equals(fieldName)) { + deserializedSimpleCriterionForJob.comparator = JobComparatorEnumValue.fromJson(reader); + } else if ("key".equals(fieldName)) { + deserializedSimpleCriterionForJob.key = SimpleCriterionKeyForJobEnumValue.fromJson(reader); + } else if ("values".equals(fieldName)) { + List values = reader.readArray(reader1 -> reader1.getString()); + deserializedSimpleCriterionForJob.values = values; + } else { + reader.skipChildren(); + } + } + + return deserializedSimpleCriterionForJob; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/SimpleCriterionKeyForJob.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/SimpleCriterionKeyForJob.java new file mode 100644 index 000000000000..b9c1c1ea23d7 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/SimpleCriterionKeyForJob.java @@ -0,0 +1,62 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * SimpleCriterionKeyForJob enum. + */ +public final class SimpleCriterionKeyForJob extends ExpandableStringEnum { + /** + * Static value ACCOUNT_ID for SimpleCriterionKeyForJob. + */ + public static final SimpleCriterionKeyForJob ACCOUNT_ID = fromString("ACCOUNT_ID"); + + /** + * Static value S3_BUCKET_EFFECTIVE_PERMISSION for SimpleCriterionKeyForJob. + */ + public static final SimpleCriterionKeyForJob S3_BUCKET_EFFECTIVE_PERMISSION + = fromString("S3_BUCKET_EFFECTIVE_PERMISSION"); + + /** + * Static value S3_BUCKET_NAME for SimpleCriterionKeyForJob. + */ + public static final SimpleCriterionKeyForJob S3_BUCKET_NAME = fromString("S3_BUCKET_NAME"); + + /** + * Static value S3_BUCKET_SHARED_ACCESS for SimpleCriterionKeyForJob. + */ + public static final SimpleCriterionKeyForJob S3_BUCKET_SHARED_ACCESS = fromString("S3_BUCKET_SHARED_ACCESS"); + + /** + * Creates a new instance of SimpleCriterionKeyForJob value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public SimpleCriterionKeyForJob() { + } + + /** + * Creates or finds a SimpleCriterionKeyForJob from its string representation. + * + * @param name a name to look for. + * @return the corresponding SimpleCriterionKeyForJob. + */ + public static SimpleCriterionKeyForJob fromString(String name) { + return fromString(name, SimpleCriterionKeyForJob.class); + } + + /** + * Gets known SimpleCriterionKeyForJob values. + * + * @return known SimpleCriterionKeyForJob values. + */ + public static Collection values() { + return values(SimpleCriterionKeyForJob.class); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/SimpleCriterionKeyForJobEnumValue.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/SimpleCriterionKeyForJobEnumValue.java new file mode 100644 index 000000000000..b7183270842f --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/SimpleCriterionKeyForJobEnumValue.java @@ -0,0 +1,95 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of SimpleCriterionKeyForJobEnumValue. + */ +@Fluent +public final class SimpleCriterionKeyForJobEnumValue implements JsonSerializable { + /* + * Property value + */ + private SimpleCriterionKeyForJob value; + + /** + * Creates an instance of SimpleCriterionKeyForJobEnumValue class. + */ + public SimpleCriterionKeyForJobEnumValue() { + } + + /** + * Get the value property: Property value. + * + * @return the value value. + */ + public SimpleCriterionKeyForJob value() { + return this.value; + } + + /** + * Set the value property: Property value. + * + * @param value the value value to set. + * @return the SimpleCriterionKeyForJobEnumValue object itself. + */ + public SimpleCriterionKeyForJobEnumValue withValue(SimpleCriterionKeyForJob value) { + this.value = value; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("value", this.value == null ? null : this.value.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of SimpleCriterionKeyForJobEnumValue from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of SimpleCriterionKeyForJobEnumValue if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the SimpleCriterionKeyForJobEnumValue. + */ + public static SimpleCriterionKeyForJobEnumValue fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + SimpleCriterionKeyForJobEnumValue deserializedSimpleCriterionKeyForJobEnumValue + = new SimpleCriterionKeyForJobEnumValue(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + deserializedSimpleCriterionKeyForJobEnumValue.value + = SimpleCriterionKeyForJob.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedSimpleCriterionKeyForJobEnumValue; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/SingleHeaderModelProperties.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/SingleHeaderModelProperties.java new file mode 100644 index 000000000000..3226fc5be8e6 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/SingleHeaderModelProperties.java @@ -0,0 +1,93 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of SingleHeaderModelProperties. + */ +@Fluent +public final class SingleHeaderModelProperties implements JsonSerializable { + /* + * The name of the query header to inspect. + */ + private String name; + + /** + * Creates an instance of SingleHeaderModelProperties class. + */ + public SingleHeaderModelProperties() { + } + + /** + * Get the name property: The name of the query header to inspect. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: The name of the query header to inspect. + * + * @param name the name value to set. + * @return the SingleHeaderModelProperties object itself. + */ + public SingleHeaderModelProperties withName(String name) { + this.name = name; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("name", this.name); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of SingleHeaderModelProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of SingleHeaderModelProperties if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the SingleHeaderModelProperties. + */ + public static SingleHeaderModelProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + SingleHeaderModelProperties deserializedSingleHeaderModelProperties = new SingleHeaderModelProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("name".equals(fieldName)) { + deserializedSingleHeaderModelProperties.name = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedSingleHeaderModelProperties; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/SnapStart.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/SnapStart.java new file mode 100644 index 000000000000..fb12f62dab56 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/SnapStart.java @@ -0,0 +1,96 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of SnapStart. + */ +@Fluent +public final class SnapStart implements JsonSerializable { + /* + * Set ``ApplyOn`` to ``PublishedVersions`` to create a snapshot of the initialized execution environment when you + * publish a function version. + */ + private SnapStartApplyOn applyOn; + + /** + * Creates an instance of SnapStart class. + */ + public SnapStart() { + } + + /** + * Get the applyOn property: Set ``ApplyOn`` to ``PublishedVersions`` to create a snapshot of the initialized + * execution environment when you publish a function version. + * + * @return the applyOn value. + */ + public SnapStartApplyOn applyOn() { + return this.applyOn; + } + + /** + * Set the applyOn property: Set ``ApplyOn`` to ``PublishedVersions`` to create a snapshot of the initialized + * execution environment when you publish a function version. + * + * @param applyOn the applyOn value to set. + * @return the SnapStart object itself. + */ + public SnapStart withApplyOn(SnapStartApplyOn applyOn) { + this.applyOn = applyOn; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("applyOn", this.applyOn == null ? null : this.applyOn.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of SnapStart from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of SnapStart if the JsonReader was pointing to an instance of it, or null if it was pointing + * to JSON null. + * @throws IOException If an error occurs while reading the SnapStart. + */ + public static SnapStart fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + SnapStart deserializedSnapStart = new SnapStart(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("applyOn".equals(fieldName)) { + deserializedSnapStart.applyOn = SnapStartApplyOn.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedSnapStart; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/SnapStartApplyOn.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/SnapStartApplyOn.java new file mode 100644 index 000000000000..df3185eb37f8 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/SnapStartApplyOn.java @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * SnapStartApplyOn enum. + */ +public final class SnapStartApplyOn extends ExpandableStringEnum { + /** + * Static value None for SnapStartApplyOn. + */ + public static final SnapStartApplyOn NONE = fromString("None"); + + /** + * Static value PublishedVersions for SnapStartApplyOn. + */ + public static final SnapStartApplyOn PUBLISHED_VERSIONS = fromString("PublishedVersions"); + + /** + * Creates a new instance of SnapStartApplyOn value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public SnapStartApplyOn() { + } + + /** + * Creates or finds a SnapStartApplyOn from its string representation. + * + * @param name a name to look for. + * @return the corresponding SnapStartApplyOn. + */ + public static SnapStartApplyOn fromString(String name) { + return fromString(name, SnapStartApplyOn.class); + } + + /** + * Gets known SnapStartApplyOn values. + * + * @return known SnapStartApplyOn values. + */ + public static Collection values() { + return values(SnapStartApplyOn.class); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/SnapStartResponse.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/SnapStartResponse.java new file mode 100644 index 000000000000..06c391275db1 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/SnapStartResponse.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.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of SnapStartResponse. + */ +@Fluent +public final class SnapStartResponse implements JsonSerializable { + /* + * When set to ``PublishedVersions``, Lambda creates a snapshot of the execution environment when you publish a + * function version. + */ + private SnapStartResponseApplyOn applyOn; + + /* + * When you provide a [qualified Amazon Resource Name + * (ARN)](https://docs.aws.amazon.com/lambda/latest/dg/configuration-versions.html#versioning-versions-using), this + * response element indicates whether SnapStart is activated for the specified function version. + */ + private SnapStartResponseOptimizationStatus optimizationStatus; + + /** + * Creates an instance of SnapStartResponse class. + */ + public SnapStartResponse() { + } + + /** + * Get the applyOn property: When set to ``PublishedVersions``, Lambda creates a snapshot of the execution + * environment when you publish a function version. + * + * @return the applyOn value. + */ + public SnapStartResponseApplyOn applyOn() { + return this.applyOn; + } + + /** + * Set the applyOn property: When set to ``PublishedVersions``, Lambda creates a snapshot of the execution + * environment when you publish a function version. + * + * @param applyOn the applyOn value to set. + * @return the SnapStartResponse object itself. + */ + public SnapStartResponse withApplyOn(SnapStartResponseApplyOn applyOn) { + this.applyOn = applyOn; + return this; + } + + /** + * Get the optimizationStatus property: When you provide a [qualified Amazon Resource Name + * (ARN)](https://docs.aws.amazon.com/lambda/latest/dg/configuration-versions.html#versioning-versions-using), this + * response element indicates whether SnapStart is activated for the specified function version. + * + * @return the optimizationStatus value. + */ + public SnapStartResponseOptimizationStatus optimizationStatus() { + return this.optimizationStatus; + } + + /** + * Set the optimizationStatus property: When you provide a [qualified Amazon Resource Name + * (ARN)](https://docs.aws.amazon.com/lambda/latest/dg/configuration-versions.html#versioning-versions-using), this + * response element indicates whether SnapStart is activated for the specified function version. + * + * @param optimizationStatus the optimizationStatus value to set. + * @return the SnapStartResponse object itself. + */ + public SnapStartResponse withOptimizationStatus(SnapStartResponseOptimizationStatus optimizationStatus) { + this.optimizationStatus = optimizationStatus; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("applyOn", this.applyOn == null ? null : this.applyOn.toString()); + jsonWriter.writeStringField("optimizationStatus", + this.optimizationStatus == null ? null : this.optimizationStatus.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of SnapStartResponse from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of SnapStartResponse if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the SnapStartResponse. + */ + public static SnapStartResponse fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + SnapStartResponse deserializedSnapStartResponse = new SnapStartResponse(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("applyOn".equals(fieldName)) { + deserializedSnapStartResponse.applyOn = SnapStartResponseApplyOn.fromString(reader.getString()); + } else if ("optimizationStatus".equals(fieldName)) { + deserializedSnapStartResponse.optimizationStatus + = SnapStartResponseOptimizationStatus.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedSnapStartResponse; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/SnapStartResponseApplyOn.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/SnapStartResponseApplyOn.java new file mode 100644 index 000000000000..88c34d58fb60 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/SnapStartResponseApplyOn.java @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * SnapStartResponseApplyOn enum. + */ +public final class SnapStartResponseApplyOn extends ExpandableStringEnum { + /** + * Static value None for SnapStartResponseApplyOn. + */ + public static final SnapStartResponseApplyOn NONE = fromString("None"); + + /** + * Static value PublishedVersions for SnapStartResponseApplyOn. + */ + public static final SnapStartResponseApplyOn PUBLISHED_VERSIONS = fromString("PublishedVersions"); + + /** + * Creates a new instance of SnapStartResponseApplyOn value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public SnapStartResponseApplyOn() { + } + + /** + * Creates or finds a SnapStartResponseApplyOn from its string representation. + * + * @param name a name to look for. + * @return the corresponding SnapStartResponseApplyOn. + */ + public static SnapStartResponseApplyOn fromString(String name) { + return fromString(name, SnapStartResponseApplyOn.class); + } + + /** + * Gets known SnapStartResponseApplyOn values. + * + * @return known SnapStartResponseApplyOn values. + */ + public static Collection values() { + return values(SnapStartResponseApplyOn.class); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/SnapStartResponseOptimizationStatus.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/SnapStartResponseOptimizationStatus.java new file mode 100644 index 000000000000..ae516e58ede7 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/SnapStartResponseOptimizationStatus.java @@ -0,0 +1,52 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * SnapStartResponseOptimizationStatus enum. + */ +public final class SnapStartResponseOptimizationStatus + extends ExpandableStringEnum { + /** + * Static value Off for SnapStartResponseOptimizationStatus. + */ + public static final SnapStartResponseOptimizationStatus OFF = fromString("Off"); + + /** + * Static value On for SnapStartResponseOptimizationStatus. + */ + public static final SnapStartResponseOptimizationStatus ON = fromString("On"); + + /** + * Creates a new instance of SnapStartResponseOptimizationStatus value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public SnapStartResponseOptimizationStatus() { + } + + /** + * Creates or finds a SnapStartResponseOptimizationStatus from its string representation. + * + * @param name a name to look for. + * @return the corresponding SnapStartResponseOptimizationStatus. + */ + public static SnapStartResponseOptimizationStatus fromString(String name) { + return fromString(name, SnapStartResponseOptimizationStatus.class); + } + + /** + * Gets known SnapStartResponseOptimizationStatus values. + * + * @return known SnapStartResponseOptimizationStatus values. + */ + public static Collection values() { + return values(SnapStartResponseOptimizationStatus.class); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/SnapshotOptions.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/SnapshotOptions.java new file mode 100644 index 000000000000..6f91af7937b8 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/SnapshotOptions.java @@ -0,0 +1,96 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of SnapshotOptions. + */ +@Fluent +public final class SnapshotOptions implements JsonSerializable { + /* + *

The time, in UTC format, when OpenSearch Service takes a daily automated snapshot of the specified domain. + * Default is 0 hours.

+ */ + private Integer automatedSnapshotStartHour; + + /** + * Creates an instance of SnapshotOptions class. + */ + public SnapshotOptions() { + } + + /** + * Get the automatedSnapshotStartHour property: <p>The time, in UTC format, when OpenSearch Service takes a + * daily automated snapshot of the specified domain. Default is <code>0</code> hours.</p>. + * + * @return the automatedSnapshotStartHour value. + */ + public Integer automatedSnapshotStartHour() { + return this.automatedSnapshotStartHour; + } + + /** + * Set the automatedSnapshotStartHour property: <p>The time, in UTC format, when OpenSearch Service takes a + * daily automated snapshot of the specified domain. Default is <code>0</code> hours.</p>. + * + * @param automatedSnapshotStartHour the automatedSnapshotStartHour value to set. + * @return the SnapshotOptions object itself. + */ + public SnapshotOptions withAutomatedSnapshotStartHour(Integer automatedSnapshotStartHour) { + this.automatedSnapshotStartHour = automatedSnapshotStartHour; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeNumberField("automatedSnapshotStartHour", this.automatedSnapshotStartHour); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of SnapshotOptions from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of SnapshotOptions if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the SnapshotOptions. + */ + public static SnapshotOptions fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + SnapshotOptions deserializedSnapshotOptions = new SnapshotOptions(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("automatedSnapshotStartHour".equals(fieldName)) { + deserializedSnapshotOptions.automatedSnapshotStartHour = reader.getNullable(JsonReader::getInt); + } else { + reader.skipChildren(); + } + } + + return deserializedSnapshotOptions; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/SnapshotState.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/SnapshotState.java new file mode 100644 index 000000000000..df8e34a4503d --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/SnapshotState.java @@ -0,0 +1,66 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * SnapshotState enum. + */ +public final class SnapshotState extends ExpandableStringEnum { + /** + * Static value completed for SnapshotState. + */ + public static final SnapshotState COMPLETED = fromString("completed"); + + /** + * Static value error for SnapshotState. + */ + public static final SnapshotState ERROR = fromString("error"); + + /** + * Static value pending for SnapshotState. + */ + public static final SnapshotState PENDING = fromString("pending"); + + /** + * Static value recoverable for SnapshotState. + */ + public static final SnapshotState RECOVERABLE = fromString("recoverable"); + + /** + * Static value recovering for SnapshotState. + */ + public static final SnapshotState RECOVERING = fromString("recovering"); + + /** + * Creates a new instance of SnapshotState value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public SnapshotState() { + } + + /** + * Creates or finds a SnapshotState from its string representation. + * + * @param name a name to look for. + * @return the corresponding SnapshotState. + */ + public static SnapshotState fromString(String name) { + return fromString(name, SnapshotState.class); + } + + /** + * Gets known SnapshotState values. + * + * @return known SnapshotState values. + */ + public static Collection values() { + return values(SnapshotState.class); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/SnapshotStateEnumValue.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/SnapshotStateEnumValue.java new file mode 100644 index 000000000000..9037e18dbded --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/SnapshotStateEnumValue.java @@ -0,0 +1,93 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of SnapshotStateEnumValue. + */ +@Fluent +public final class SnapshotStateEnumValue implements JsonSerializable { + /* + * Property value + */ + private SnapshotState value; + + /** + * Creates an instance of SnapshotStateEnumValue class. + */ + public SnapshotStateEnumValue() { + } + + /** + * Get the value property: Property value. + * + * @return the value value. + */ + public SnapshotState value() { + return this.value; + } + + /** + * Set the value property: Property value. + * + * @param value the value value to set. + * @return the SnapshotStateEnumValue object itself. + */ + public SnapshotStateEnumValue withValue(SnapshotState value) { + this.value = value; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("value", this.value == null ? null : this.value.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of SnapshotStateEnumValue from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of SnapshotStateEnumValue if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the SnapshotStateEnumValue. + */ + public static SnapshotStateEnumValue fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + SnapshotStateEnumValue deserializedSnapshotStateEnumValue = new SnapshotStateEnumValue(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + deserializedSnapshotStateEnumValue.value = SnapshotState.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedSnapshotStateEnumValue; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/SnsSubscription.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/SnsSubscription.java new file mode 100644 index 000000000000..a3d3849f4be3 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/SnsSubscription.java @@ -0,0 +1,252 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.awsconnector.fluent.models.SnsSubscriptionInner; +import java.util.Map; + +/** + * An immutable client-side representation of SnsSubscription. + */ +public interface SnsSubscription { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the location property: The geo-location where the resource lives. + * + * @return the location value. + */ + String location(); + + /** + * Gets the tags property: Resource tags. + * + * @return the tags value. + */ + Map tags(); + + /** + * Gets the properties property: The resource-specific properties for this resource. + * + * @return the properties value. + */ + SnsSubscriptionProperties properties(); + + /** + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the region of the resource. + * + * @return the region of the resource. + */ + Region region(); + + /** + * Gets the name of the resource region. + * + * @return the name of the resource region. + */ + String regionName(); + + /** + * Gets the name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + + /** + * Gets the inner com.azure.resourcemanager.awsconnector.fluent.models.SnsSubscriptionInner object. + * + * @return the inner object. + */ + SnsSubscriptionInner innerModel(); + + /** + * The entirety of the SnsSubscription definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithLocation, + DefinitionStages.WithResourceGroup, DefinitionStages.WithCreate { + } + + /** + * The SnsSubscription definition stages. + */ + interface DefinitionStages { + /** + * The first stage of the SnsSubscription definition. + */ + interface Blank extends WithLocation { + } + + /** + * The stage of the SnsSubscription definition allowing to specify location. + */ + interface WithLocation { + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithResourceGroup withRegion(Region location); + + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithResourceGroup withRegion(String location); + } + + /** + * The stage of the SnsSubscription definition allowing to specify parent resource. + */ + interface WithResourceGroup { + /** + * Specifies resourceGroupName. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @return the next definition stage. + */ + WithCreate withExistingResourceGroup(String resourceGroupName); + } + + /** + * The stage of the SnsSubscription 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.WithProperties { + /** + * Executes the create request. + * + * @return the created resource. + */ + SnsSubscription create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + SnsSubscription create(Context context); + } + + /** + * The stage of the SnsSubscription definition allowing to specify tags. + */ + interface WithTags { + /** + * Specifies the tags property: Resource tags.. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + WithCreate withTags(Map tags); + } + + /** + * The stage of the SnsSubscription definition allowing to specify properties. + */ + interface WithProperties { + /** + * Specifies the properties property: The resource-specific properties for this resource.. + * + * @param properties The resource-specific properties for this resource. + * @return the next definition stage. + */ + WithCreate withProperties(SnsSubscriptionProperties properties); + } + } + + /** + * Begins update for the SnsSubscription resource. + * + * @return the stage of resource update. + */ + SnsSubscription.Update update(); + + /** + * The template for SnsSubscription update. + */ + interface Update extends UpdateStages.WithTags { + /** + * Executes the update request. + * + * @return the updated resource. + */ + SnsSubscription apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + SnsSubscription apply(Context context); + } + + /** + * The SnsSubscription update stages. + */ + interface UpdateStages { + /** + * The stage of the SnsSubscription update allowing to specify tags. + */ + interface WithTags { + /** + * Specifies the tags property: Resource tags.. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + Update withTags(Map tags); + } + } + + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + SnsSubscription refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + SnsSubscription refresh(Context context); +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/SnsSubscriptionListResult.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/SnsSubscriptionListResult.java new file mode 100644 index 000000000000..92fa0936ae09 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/SnsSubscriptionListResult.java @@ -0,0 +1,136 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.awsconnector.fluent.models.SnsSubscriptionInner; +import java.io.IOException; +import java.util.List; + +/** + * The response of a SnsSubscription list operation. + */ +@Fluent +public final class SnsSubscriptionListResult implements JsonSerializable { + /* + * The SnsSubscription items on this page + */ + private List value; + + /* + * The link to the next page of items + */ + private String nextLink; + + /** + * Creates an instance of SnsSubscriptionListResult class. + */ + public SnsSubscriptionListResult() { + } + + /** + * Get the value property: The SnsSubscription items on this page. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The SnsSubscription items on this page. + * + * @param value the value value to set. + * @return the SnsSubscriptionListResult object itself. + */ + public SnsSubscriptionListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The link to the next page of items. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: The link to the next page of items. + * + * @param nextLink the nextLink value to set. + * @return the SnsSubscriptionListResult object itself. + */ + public SnsSubscriptionListResult withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() == null) { + throw LOGGER.atError() + .log( + new IllegalArgumentException("Missing required property value in model SnsSubscriptionListResult")); + } else { + value().forEach(e -> e.validate()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(SnsSubscriptionListResult.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("nextLink", this.nextLink); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of SnsSubscriptionListResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of SnsSubscriptionListResult if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the SnsSubscriptionListResult. + */ + public static SnsSubscriptionListResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + SnsSubscriptionListResult deserializedSnsSubscriptionListResult = new SnsSubscriptionListResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> SnsSubscriptionInner.fromJson(reader1)); + deserializedSnsSubscriptionListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedSnsSubscriptionListResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedSnsSubscriptionListResult; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/SnsSubscriptionProperties.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/SnsSubscriptionProperties.java new file mode 100644 index 000000000000..cd4d0d311282 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/SnsSubscriptionProperties.java @@ -0,0 +1,311 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.Map; + +/** + * Definition of SnsSubscription. + */ +@Fluent +public final class SnsSubscriptionProperties implements JsonSerializable { + /* + * AWS Properties + */ + private AwsSnsSubscriptionProperties awsProperties; + + /* + * Public Cloud Connectors Resource ID + */ + private String publicCloudConnectorsResourceId; + + /* + * AWS Account ID + */ + private String awsAccountId; + + /* + * Amazon Resource Name (ARN) + */ + private String arn; + + /* + * Public Cloud Resource Name + */ + private String publicCloudResourceName; + + /* + * AWS Source Schema + */ + private String awsSourceSchema; + + /* + * AWS Region + */ + private String awsRegion; + + /* + * AWS Tags + */ + private Map awsTags; + + /* + * The status of the last operation. + */ + private ProvisioningState provisioningState; + + /** + * Creates an instance of SnsSubscriptionProperties class. + */ + public SnsSubscriptionProperties() { + } + + /** + * Get the awsProperties property: AWS Properties. + * + * @return the awsProperties value. + */ + public AwsSnsSubscriptionProperties awsProperties() { + return this.awsProperties; + } + + /** + * Set the awsProperties property: AWS Properties. + * + * @param awsProperties the awsProperties value to set. + * @return the SnsSubscriptionProperties object itself. + */ + public SnsSubscriptionProperties withAwsProperties(AwsSnsSubscriptionProperties awsProperties) { + this.awsProperties = awsProperties; + return this; + } + + /** + * Get the publicCloudConnectorsResourceId property: Public Cloud Connectors Resource ID. + * + * @return the publicCloudConnectorsResourceId value. + */ + public String publicCloudConnectorsResourceId() { + return this.publicCloudConnectorsResourceId; + } + + /** + * Set the publicCloudConnectorsResourceId property: Public Cloud Connectors Resource ID. + * + * @param publicCloudConnectorsResourceId the publicCloudConnectorsResourceId value to set. + * @return the SnsSubscriptionProperties object itself. + */ + public SnsSubscriptionProperties withPublicCloudConnectorsResourceId(String publicCloudConnectorsResourceId) { + this.publicCloudConnectorsResourceId = publicCloudConnectorsResourceId; + return this; + } + + /** + * Get the awsAccountId property: AWS Account ID. + * + * @return the awsAccountId value. + */ + public String awsAccountId() { + return this.awsAccountId; + } + + /** + * Set the awsAccountId property: AWS Account ID. + * + * @param awsAccountId the awsAccountId value to set. + * @return the SnsSubscriptionProperties object itself. + */ + public SnsSubscriptionProperties withAwsAccountId(String awsAccountId) { + this.awsAccountId = awsAccountId; + return this; + } + + /** + * Get the arn property: Amazon Resource Name (ARN). + * + * @return the arn value. + */ + public String arn() { + return this.arn; + } + + /** + * Set the arn property: Amazon Resource Name (ARN). + * + * @param arn the arn value to set. + * @return the SnsSubscriptionProperties object itself. + */ + public SnsSubscriptionProperties withArn(String arn) { + this.arn = arn; + return this; + } + + /** + * Get the publicCloudResourceName property: Public Cloud Resource Name. + * + * @return the publicCloudResourceName value. + */ + public String publicCloudResourceName() { + return this.publicCloudResourceName; + } + + /** + * Set the publicCloudResourceName property: Public Cloud Resource Name. + * + * @param publicCloudResourceName the publicCloudResourceName value to set. + * @return the SnsSubscriptionProperties object itself. + */ + public SnsSubscriptionProperties withPublicCloudResourceName(String publicCloudResourceName) { + this.publicCloudResourceName = publicCloudResourceName; + return this; + } + + /** + * Get the awsSourceSchema property: AWS Source Schema. + * + * @return the awsSourceSchema value. + */ + public String awsSourceSchema() { + return this.awsSourceSchema; + } + + /** + * Set the awsSourceSchema property: AWS Source Schema. + * + * @param awsSourceSchema the awsSourceSchema value to set. + * @return the SnsSubscriptionProperties object itself. + */ + public SnsSubscriptionProperties withAwsSourceSchema(String awsSourceSchema) { + this.awsSourceSchema = awsSourceSchema; + return this; + } + + /** + * Get the awsRegion property: AWS Region. + * + * @return the awsRegion value. + */ + public String awsRegion() { + return this.awsRegion; + } + + /** + * Set the awsRegion property: AWS Region. + * + * @param awsRegion the awsRegion value to set. + * @return the SnsSubscriptionProperties object itself. + */ + public SnsSubscriptionProperties withAwsRegion(String awsRegion) { + this.awsRegion = awsRegion; + return this; + } + + /** + * Get the awsTags property: AWS Tags. + * + * @return the awsTags value. + */ + public Map awsTags() { + return this.awsTags; + } + + /** + * Set the awsTags property: AWS Tags. + * + * @param awsTags the awsTags value to set. + * @return the SnsSubscriptionProperties object itself. + */ + public SnsSubscriptionProperties withAwsTags(Map awsTags) { + this.awsTags = awsTags; + return this; + } + + /** + * Get the provisioningState property: The status of the last operation. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (awsProperties() != null) { + awsProperties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("awsProperties", this.awsProperties); + jsonWriter.writeStringField("publicCloudConnectorsResourceId", this.publicCloudConnectorsResourceId); + jsonWriter.writeStringField("awsAccountId", this.awsAccountId); + jsonWriter.writeStringField("arn", this.arn); + jsonWriter.writeStringField("publicCloudResourceName", this.publicCloudResourceName); + jsonWriter.writeStringField("awsSourceSchema", this.awsSourceSchema); + jsonWriter.writeStringField("awsRegion", this.awsRegion); + jsonWriter.writeMapField("awsTags", this.awsTags, (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of SnsSubscriptionProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of SnsSubscriptionProperties if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IOException If an error occurs while reading the SnsSubscriptionProperties. + */ + public static SnsSubscriptionProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + SnsSubscriptionProperties deserializedSnsSubscriptionProperties = new SnsSubscriptionProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("awsProperties".equals(fieldName)) { + deserializedSnsSubscriptionProperties.awsProperties = AwsSnsSubscriptionProperties.fromJson(reader); + } else if ("publicCloudConnectorsResourceId".equals(fieldName)) { + deserializedSnsSubscriptionProperties.publicCloudConnectorsResourceId = reader.getString(); + } else if ("awsAccountId".equals(fieldName)) { + deserializedSnsSubscriptionProperties.awsAccountId = reader.getString(); + } else if ("arn".equals(fieldName)) { + deserializedSnsSubscriptionProperties.arn = reader.getString(); + } else if ("publicCloudResourceName".equals(fieldName)) { + deserializedSnsSubscriptionProperties.publicCloudResourceName = reader.getString(); + } else if ("awsSourceSchema".equals(fieldName)) { + deserializedSnsSubscriptionProperties.awsSourceSchema = reader.getString(); + } else if ("awsRegion".equals(fieldName)) { + deserializedSnsSubscriptionProperties.awsRegion = reader.getString(); + } else if ("awsTags".equals(fieldName)) { + Map awsTags = reader.readMap(reader1 -> reader1.getString()); + deserializedSnsSubscriptionProperties.awsTags = awsTags; + } else if ("provisioningState".equals(fieldName)) { + deserializedSnsSubscriptionProperties.provisioningState + = ProvisioningState.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedSnsSubscriptionProperties; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/SnsSubscriptionTagsUpdate.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/SnsSubscriptionTagsUpdate.java new file mode 100644 index 000000000000..6df28e18e214 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/SnsSubscriptionTagsUpdate.java @@ -0,0 +1,95 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.Map; + +/** + * The type used for updating tags in SnsSubscription resources. + */ +@Fluent +public final class SnsSubscriptionTagsUpdate implements JsonSerializable { + /* + * Resource tags. + */ + private Map tags; + + /** + * Creates an instance of SnsSubscriptionTagsUpdate class. + */ + public SnsSubscriptionTagsUpdate() { + } + + /** + * Get the tags property: Resource tags. + * + * @return the tags value. + */ + public Map tags() { + return this.tags; + } + + /** + * Set the tags property: Resource tags. + * + * @param tags the tags value to set. + * @return the SnsSubscriptionTagsUpdate object itself. + */ + public SnsSubscriptionTagsUpdate withTags(Map tags) { + this.tags = tags; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeMapField("tags", this.tags, (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of SnsSubscriptionTagsUpdate from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of SnsSubscriptionTagsUpdate if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IOException If an error occurs while reading the SnsSubscriptionTagsUpdate. + */ + public static SnsSubscriptionTagsUpdate fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + SnsSubscriptionTagsUpdate deserializedSnsSubscriptionTagsUpdate = new SnsSubscriptionTagsUpdate(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedSnsSubscriptionTagsUpdate.tags = tags; + } else { + reader.skipChildren(); + } + } + + return deserializedSnsSubscriptionTagsUpdate; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/SnsSubscriptions.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/SnsSubscriptions.java new file mode 100644 index 000000000000..bae77907a6cc --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/SnsSubscriptions.java @@ -0,0 +1,157 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** + * Resource collection API of SnsSubscriptions. + */ +public interface SnsSubscriptions { + /** + * List SnsSubscription resources by subscription ID. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a SnsSubscription list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable list(); + + /** + * List SnsSubscription resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a SnsSubscription list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable list(Context context); + + /** + * List SnsSubscription resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a SnsSubscription list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * List SnsSubscription resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a SnsSubscription list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Get a SnsSubscription. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of SnsSubscription. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a SnsSubscription along with {@link Response}. + */ + Response getByResourceGroupWithResponse(String resourceGroupName, String name, Context context); + + /** + * Get a SnsSubscription. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of SnsSubscription. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a SnsSubscription. + */ + SnsSubscription getByResourceGroup(String resourceGroupName, String name); + + /** + * Delete a SnsSubscription. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of SnsSubscription. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByResourceGroup(String resourceGroupName, String name); + + /** + * Delete a SnsSubscription. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of SnsSubscription. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String name, Context context); + + /** + * Get a SnsSubscription. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a SnsSubscription along with {@link Response}. + */ + SnsSubscription getById(String id); + + /** + * Get a SnsSubscription. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a SnsSubscription along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Delete a SnsSubscription. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteById(String id); + + /** + * Delete a SnsSubscription. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new SnsSubscription resource. + * + * @param name resource name. + * @return the first stage of the new SnsSubscription definition. + */ + SnsSubscription.DefinitionStages.Blank define(String name); +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/SnsTopic.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/SnsTopic.java new file mode 100644 index 000000000000..ed4726741d31 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/SnsTopic.java @@ -0,0 +1,252 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.awsconnector.fluent.models.SnsTopicInner; +import java.util.Map; + +/** + * An immutable client-side representation of SnsTopic. + */ +public interface SnsTopic { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the location property: The geo-location where the resource lives. + * + * @return the location value. + */ + String location(); + + /** + * Gets the tags property: Resource tags. + * + * @return the tags value. + */ + Map tags(); + + /** + * Gets the properties property: The resource-specific properties for this resource. + * + * @return the properties value. + */ + SnsTopicProperties properties(); + + /** + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the region of the resource. + * + * @return the region of the resource. + */ + Region region(); + + /** + * Gets the name of the resource region. + * + * @return the name of the resource region. + */ + String regionName(); + + /** + * Gets the name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + + /** + * Gets the inner com.azure.resourcemanager.awsconnector.fluent.models.SnsTopicInner object. + * + * @return the inner object. + */ + SnsTopicInner innerModel(); + + /** + * The entirety of the SnsTopic definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithLocation, + DefinitionStages.WithResourceGroup, DefinitionStages.WithCreate { + } + + /** + * The SnsTopic definition stages. + */ + interface DefinitionStages { + /** + * The first stage of the SnsTopic definition. + */ + interface Blank extends WithLocation { + } + + /** + * The stage of the SnsTopic definition allowing to specify location. + */ + interface WithLocation { + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithResourceGroup withRegion(Region location); + + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithResourceGroup withRegion(String location); + } + + /** + * The stage of the SnsTopic definition allowing to specify parent resource. + */ + interface WithResourceGroup { + /** + * Specifies resourceGroupName. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @return the next definition stage. + */ + WithCreate withExistingResourceGroup(String resourceGroupName); + } + + /** + * The stage of the SnsTopic 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.WithProperties { + /** + * Executes the create request. + * + * @return the created resource. + */ + SnsTopic create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + SnsTopic create(Context context); + } + + /** + * The stage of the SnsTopic definition allowing to specify tags. + */ + interface WithTags { + /** + * Specifies the tags property: Resource tags.. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + WithCreate withTags(Map tags); + } + + /** + * The stage of the SnsTopic definition allowing to specify properties. + */ + interface WithProperties { + /** + * Specifies the properties property: The resource-specific properties for this resource.. + * + * @param properties The resource-specific properties for this resource. + * @return the next definition stage. + */ + WithCreate withProperties(SnsTopicProperties properties); + } + } + + /** + * Begins update for the SnsTopic resource. + * + * @return the stage of resource update. + */ + SnsTopic.Update update(); + + /** + * The template for SnsTopic update. + */ + interface Update extends UpdateStages.WithTags { + /** + * Executes the update request. + * + * @return the updated resource. + */ + SnsTopic apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + SnsTopic apply(Context context); + } + + /** + * The SnsTopic update stages. + */ + interface UpdateStages { + /** + * The stage of the SnsTopic update allowing to specify tags. + */ + interface WithTags { + /** + * Specifies the tags property: Resource tags.. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + Update withTags(Map tags); + } + } + + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + SnsTopic refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + SnsTopic refresh(Context context); +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/SnsTopicListResult.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/SnsTopicListResult.java new file mode 100644 index 000000000000..c7b6adb88aea --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/SnsTopicListResult.java @@ -0,0 +1,134 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.awsconnector.fluent.models.SnsTopicInner; +import java.io.IOException; +import java.util.List; + +/** + * The response of a SnsTopic list operation. + */ +@Fluent +public final class SnsTopicListResult implements JsonSerializable { + /* + * The SnsTopic items on this page + */ + private List value; + + /* + * The link to the next page of items + */ + private String nextLink; + + /** + * Creates an instance of SnsTopicListResult class. + */ + public SnsTopicListResult() { + } + + /** + * Get the value property: The SnsTopic items on this page. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The SnsTopic items on this page. + * + * @param value the value value to set. + * @return the SnsTopicListResult object itself. + */ + public SnsTopicListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The link to the next page of items. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: The link to the next page of items. + * + * @param nextLink the nextLink value to set. + * @return the SnsTopicListResult object itself. + */ + public SnsTopicListResult withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property value in model SnsTopicListResult")); + } else { + value().forEach(e -> e.validate()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(SnsTopicListResult.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("nextLink", this.nextLink); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of SnsTopicListResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of SnsTopicListResult if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the SnsTopicListResult. + */ + public static SnsTopicListResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + SnsTopicListResult deserializedSnsTopicListResult = new SnsTopicListResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value = reader.readArray(reader1 -> SnsTopicInner.fromJson(reader1)); + deserializedSnsTopicListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedSnsTopicListResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedSnsTopicListResult; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/SnsTopicProperties.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/SnsTopicProperties.java new file mode 100644 index 000000000000..ef117e452059 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/SnsTopicProperties.java @@ -0,0 +1,310 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.Map; + +/** + * Definition of SnsTopic. + */ +@Fluent +public final class SnsTopicProperties implements JsonSerializable { + /* + * AWS Properties + */ + private AwsSnsTopicProperties awsProperties; + + /* + * Public Cloud Connectors Resource ID + */ + private String publicCloudConnectorsResourceId; + + /* + * AWS Account ID + */ + private String awsAccountId; + + /* + * Amazon Resource Name (ARN) + */ + private String arn; + + /* + * Public Cloud Resource Name + */ + private String publicCloudResourceName; + + /* + * AWS Source Schema + */ + private String awsSourceSchema; + + /* + * AWS Region + */ + private String awsRegion; + + /* + * AWS Tags + */ + private Map awsTags; + + /* + * The status of the last operation. + */ + private ProvisioningState provisioningState; + + /** + * Creates an instance of SnsTopicProperties class. + */ + public SnsTopicProperties() { + } + + /** + * Get the awsProperties property: AWS Properties. + * + * @return the awsProperties value. + */ + public AwsSnsTopicProperties awsProperties() { + return this.awsProperties; + } + + /** + * Set the awsProperties property: AWS Properties. + * + * @param awsProperties the awsProperties value to set. + * @return the SnsTopicProperties object itself. + */ + public SnsTopicProperties withAwsProperties(AwsSnsTopicProperties awsProperties) { + this.awsProperties = awsProperties; + return this; + } + + /** + * Get the publicCloudConnectorsResourceId property: Public Cloud Connectors Resource ID. + * + * @return the publicCloudConnectorsResourceId value. + */ + public String publicCloudConnectorsResourceId() { + return this.publicCloudConnectorsResourceId; + } + + /** + * Set the publicCloudConnectorsResourceId property: Public Cloud Connectors Resource ID. + * + * @param publicCloudConnectorsResourceId the publicCloudConnectorsResourceId value to set. + * @return the SnsTopicProperties object itself. + */ + public SnsTopicProperties withPublicCloudConnectorsResourceId(String publicCloudConnectorsResourceId) { + this.publicCloudConnectorsResourceId = publicCloudConnectorsResourceId; + return this; + } + + /** + * Get the awsAccountId property: AWS Account ID. + * + * @return the awsAccountId value. + */ + public String awsAccountId() { + return this.awsAccountId; + } + + /** + * Set the awsAccountId property: AWS Account ID. + * + * @param awsAccountId the awsAccountId value to set. + * @return the SnsTopicProperties object itself. + */ + public SnsTopicProperties withAwsAccountId(String awsAccountId) { + this.awsAccountId = awsAccountId; + return this; + } + + /** + * Get the arn property: Amazon Resource Name (ARN). + * + * @return the arn value. + */ + public String arn() { + return this.arn; + } + + /** + * Set the arn property: Amazon Resource Name (ARN). + * + * @param arn the arn value to set. + * @return the SnsTopicProperties object itself. + */ + public SnsTopicProperties withArn(String arn) { + this.arn = arn; + return this; + } + + /** + * Get the publicCloudResourceName property: Public Cloud Resource Name. + * + * @return the publicCloudResourceName value. + */ + public String publicCloudResourceName() { + return this.publicCloudResourceName; + } + + /** + * Set the publicCloudResourceName property: Public Cloud Resource Name. + * + * @param publicCloudResourceName the publicCloudResourceName value to set. + * @return the SnsTopicProperties object itself. + */ + public SnsTopicProperties withPublicCloudResourceName(String publicCloudResourceName) { + this.publicCloudResourceName = publicCloudResourceName; + return this; + } + + /** + * Get the awsSourceSchema property: AWS Source Schema. + * + * @return the awsSourceSchema value. + */ + public String awsSourceSchema() { + return this.awsSourceSchema; + } + + /** + * Set the awsSourceSchema property: AWS Source Schema. + * + * @param awsSourceSchema the awsSourceSchema value to set. + * @return the SnsTopicProperties object itself. + */ + public SnsTopicProperties withAwsSourceSchema(String awsSourceSchema) { + this.awsSourceSchema = awsSourceSchema; + return this; + } + + /** + * Get the awsRegion property: AWS Region. + * + * @return the awsRegion value. + */ + public String awsRegion() { + return this.awsRegion; + } + + /** + * Set the awsRegion property: AWS Region. + * + * @param awsRegion the awsRegion value to set. + * @return the SnsTopicProperties object itself. + */ + public SnsTopicProperties withAwsRegion(String awsRegion) { + this.awsRegion = awsRegion; + return this; + } + + /** + * Get the awsTags property: AWS Tags. + * + * @return the awsTags value. + */ + public Map awsTags() { + return this.awsTags; + } + + /** + * Set the awsTags property: AWS Tags. + * + * @param awsTags the awsTags value to set. + * @return the SnsTopicProperties object itself. + */ + public SnsTopicProperties withAwsTags(Map awsTags) { + this.awsTags = awsTags; + return this; + } + + /** + * Get the provisioningState property: The status of the last operation. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (awsProperties() != null) { + awsProperties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("awsProperties", this.awsProperties); + jsonWriter.writeStringField("publicCloudConnectorsResourceId", this.publicCloudConnectorsResourceId); + jsonWriter.writeStringField("awsAccountId", this.awsAccountId); + jsonWriter.writeStringField("arn", this.arn); + jsonWriter.writeStringField("publicCloudResourceName", this.publicCloudResourceName); + jsonWriter.writeStringField("awsSourceSchema", this.awsSourceSchema); + jsonWriter.writeStringField("awsRegion", this.awsRegion); + jsonWriter.writeMapField("awsTags", this.awsTags, (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of SnsTopicProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of SnsTopicProperties if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the SnsTopicProperties. + */ + public static SnsTopicProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + SnsTopicProperties deserializedSnsTopicProperties = new SnsTopicProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("awsProperties".equals(fieldName)) { + deserializedSnsTopicProperties.awsProperties = AwsSnsTopicProperties.fromJson(reader); + } else if ("publicCloudConnectorsResourceId".equals(fieldName)) { + deserializedSnsTopicProperties.publicCloudConnectorsResourceId = reader.getString(); + } else if ("awsAccountId".equals(fieldName)) { + deserializedSnsTopicProperties.awsAccountId = reader.getString(); + } else if ("arn".equals(fieldName)) { + deserializedSnsTopicProperties.arn = reader.getString(); + } else if ("publicCloudResourceName".equals(fieldName)) { + deserializedSnsTopicProperties.publicCloudResourceName = reader.getString(); + } else if ("awsSourceSchema".equals(fieldName)) { + deserializedSnsTopicProperties.awsSourceSchema = reader.getString(); + } else if ("awsRegion".equals(fieldName)) { + deserializedSnsTopicProperties.awsRegion = reader.getString(); + } else if ("awsTags".equals(fieldName)) { + Map awsTags = reader.readMap(reader1 -> reader1.getString()); + deserializedSnsTopicProperties.awsTags = awsTags; + } else if ("provisioningState".equals(fieldName)) { + deserializedSnsTopicProperties.provisioningState = ProvisioningState.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedSnsTopicProperties; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/SnsTopicTagsUpdate.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/SnsTopicTagsUpdate.java new file mode 100644 index 000000000000..622186ccda16 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/SnsTopicTagsUpdate.java @@ -0,0 +1,95 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.Map; + +/** + * The type used for updating tags in SnsTopic resources. + */ +@Fluent +public final class SnsTopicTagsUpdate implements JsonSerializable { + /* + * Resource tags. + */ + private Map tags; + + /** + * Creates an instance of SnsTopicTagsUpdate class. + */ + public SnsTopicTagsUpdate() { + } + + /** + * Get the tags property: Resource tags. + * + * @return the tags value. + */ + public Map tags() { + return this.tags; + } + + /** + * Set the tags property: Resource tags. + * + * @param tags the tags value to set. + * @return the SnsTopicTagsUpdate object itself. + */ + public SnsTopicTagsUpdate withTags(Map tags) { + this.tags = tags; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeMapField("tags", this.tags, (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of SnsTopicTagsUpdate from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of SnsTopicTagsUpdate if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the SnsTopicTagsUpdate. + */ + public static SnsTopicTagsUpdate fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + SnsTopicTagsUpdate deserializedSnsTopicTagsUpdate = new SnsTopicTagsUpdate(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedSnsTopicTagsUpdate.tags = tags; + } else { + reader.skipChildren(); + } + } + + return deserializedSnsTopicTagsUpdate; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/SnsTopics.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/SnsTopics.java new file mode 100644 index 000000000000..327fa8beb675 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/SnsTopics.java @@ -0,0 +1,157 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** + * Resource collection API of SnsTopics. + */ +public interface SnsTopics { + /** + * List SnsTopic resources by subscription ID. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a SnsTopic list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable list(); + + /** + * List SnsTopic resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a SnsTopic list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable list(Context context); + + /** + * List SnsTopic resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a SnsTopic list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * List SnsTopic resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a SnsTopic list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Get a SnsTopic. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of SnsTopic. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a SnsTopic along with {@link Response}. + */ + Response getByResourceGroupWithResponse(String resourceGroupName, String name, Context context); + + /** + * Get a SnsTopic. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of SnsTopic. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a SnsTopic. + */ + SnsTopic getByResourceGroup(String resourceGroupName, String name); + + /** + * Delete a SnsTopic. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of SnsTopic. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByResourceGroup(String resourceGroupName, String name); + + /** + * Delete a SnsTopic. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of SnsTopic. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String name, Context context); + + /** + * Get a SnsTopic. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a SnsTopic along with {@link Response}. + */ + SnsTopic getById(String id); + + /** + * Get a SnsTopic. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a SnsTopic along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Delete a SnsTopic. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteById(String id); + + /** + * Delete a SnsTopic. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new SnsTopic resource. + * + * @param name resource name. + * @return the first stage of the new SnsTopic definition. + */ + SnsTopic.DefinitionStages.Blank define(String name); +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/SoftwareUpdateOptions.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/SoftwareUpdateOptions.java new file mode 100644 index 000000000000..956d2f4fafa9 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/SoftwareUpdateOptions.java @@ -0,0 +1,96 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of SoftwareUpdateOptions. + */ +@Fluent +public final class SoftwareUpdateOptions implements JsonSerializable { + /* + *

Whether automatic service software updates are enabled for the domain.

+ */ + private Boolean autoSoftwareUpdateEnabled; + + /** + * Creates an instance of SoftwareUpdateOptions class. + */ + public SoftwareUpdateOptions() { + } + + /** + * Get the autoSoftwareUpdateEnabled property: <p>Whether automatic service software updates are enabled for + * the domain.</p>. + * + * @return the autoSoftwareUpdateEnabled value. + */ + public Boolean autoSoftwareUpdateEnabled() { + return this.autoSoftwareUpdateEnabled; + } + + /** + * Set the autoSoftwareUpdateEnabled property: <p>Whether automatic service software updates are enabled for + * the domain.</p>. + * + * @param autoSoftwareUpdateEnabled the autoSoftwareUpdateEnabled value to set. + * @return the SoftwareUpdateOptions object itself. + */ + public SoftwareUpdateOptions withAutoSoftwareUpdateEnabled(Boolean autoSoftwareUpdateEnabled) { + this.autoSoftwareUpdateEnabled = autoSoftwareUpdateEnabled; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeBooleanField("autoSoftwareUpdateEnabled", this.autoSoftwareUpdateEnabled); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of SoftwareUpdateOptions from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of SoftwareUpdateOptions if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the SoftwareUpdateOptions. + */ + public static SoftwareUpdateOptions fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + SoftwareUpdateOptions deserializedSoftwareUpdateOptions = new SoftwareUpdateOptions(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("autoSoftwareUpdateEnabled".equals(fieldName)) { + deserializedSoftwareUpdateOptions.autoSoftwareUpdateEnabled + = reader.getNullable(JsonReader::getBoolean); + } else { + reader.skipChildren(); + } + } + + return deserializedSoftwareUpdateOptions; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/SourceAuth.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/SourceAuth.java new file mode 100644 index 000000000000..9156d80e70be --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/SourceAuth.java @@ -0,0 +1,128 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of SourceAuth. + */ +@Fluent +public final class SourceAuth implements JsonSerializable { + /* + *

The resource value that applies to the specified authorization type.

+ */ + private String resource; + + /* + *

The authorization type to use. Valid options are OAUTH or CODECONNECTIONS.

+ */ + private SourceAuthTypeEnumValue type; + + /** + * Creates an instance of SourceAuth class. + */ + public SourceAuth() { + } + + /** + * Get the resource property: <p>The resource value that applies to the specified authorization + * type.</p>. + * + * @return the resource value. + */ + public String resource() { + return this.resource; + } + + /** + * Set the resource property: <p>The resource value that applies to the specified authorization + * type.</p>. + * + * @param resource the resource value to set. + * @return the SourceAuth object itself. + */ + public SourceAuth withResource(String resource) { + this.resource = resource; + return this; + } + + /** + * Get the type property: <p>The authorization type to use. Valid options are OAUTH or + * CODECONNECTIONS.</p>. + * + * @return the type value. + */ + public SourceAuthTypeEnumValue type() { + return this.type; + } + + /** + * Set the type property: <p>The authorization type to use. Valid options are OAUTH or + * CODECONNECTIONS.</p>. + * + * @param type the type value to set. + * @return the SourceAuth object itself. + */ + public SourceAuth withType(SourceAuthTypeEnumValue type) { + this.type = type; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (type() != null) { + type().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("resource", this.resource); + jsonWriter.writeJsonField("type", this.type); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of SourceAuth from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of SourceAuth if the JsonReader was pointing to an instance of it, or null if it was pointing + * to JSON null. + * @throws IOException If an error occurs while reading the SourceAuth. + */ + public static SourceAuth fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + SourceAuth deserializedSourceAuth = new SourceAuth(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("resource".equals(fieldName)) { + deserializedSourceAuth.resource = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedSourceAuth.type = SourceAuthTypeEnumValue.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedSourceAuth; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/SourceAuthType.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/SourceAuthType.java new file mode 100644 index 000000000000..112e2568a123 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/SourceAuthType.java @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * SourceAuthType enum. + */ +public final class SourceAuthType extends ExpandableStringEnum { + /** + * Static value CODECONNECTIONS for SourceAuthType. + */ + public static final SourceAuthType CODECONNECTIONS = fromString("CODECONNECTIONS"); + + /** + * Static value OAUTH for SourceAuthType. + */ + public static final SourceAuthType OAUTH = fromString("OAUTH"); + + /** + * Creates a new instance of SourceAuthType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public SourceAuthType() { + } + + /** + * Creates or finds a SourceAuthType from its string representation. + * + * @param name a name to look for. + * @return the corresponding SourceAuthType. + */ + public static SourceAuthType fromString(String name) { + return fromString(name, SourceAuthType.class); + } + + /** + * Gets known SourceAuthType values. + * + * @return known SourceAuthType values. + */ + public static Collection values() { + return values(SourceAuthType.class); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/SourceAuthTypeEnumValue.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/SourceAuthTypeEnumValue.java new file mode 100644 index 000000000000..2272ab17c842 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/SourceAuthTypeEnumValue.java @@ -0,0 +1,93 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of SourceAuthTypeEnumValue. + */ +@Fluent +public final class SourceAuthTypeEnumValue implements JsonSerializable { + /* + * Property value + */ + private SourceAuthType value; + + /** + * Creates an instance of SourceAuthTypeEnumValue class. + */ + public SourceAuthTypeEnumValue() { + } + + /** + * Get the value property: Property value. + * + * @return the value value. + */ + public SourceAuthType value() { + return this.value; + } + + /** + * Set the value property: Property value. + * + * @param value the value value to set. + * @return the SourceAuthTypeEnumValue object itself. + */ + public SourceAuthTypeEnumValue withValue(SourceAuthType value) { + this.value = value; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("value", this.value == null ? null : this.value.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of SourceAuthTypeEnumValue from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of SourceAuthTypeEnumValue if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the SourceAuthTypeEnumValue. + */ + public static SourceAuthTypeEnumValue fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + SourceAuthTypeEnumValue deserializedSourceAuthTypeEnumValue = new SourceAuthTypeEnumValue(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + deserializedSourceAuthTypeEnumValue.value = SourceAuthType.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedSourceAuthTypeEnumValue; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/SourceConfiguration.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/SourceConfiguration.java new file mode 100644 index 000000000000..93a97cdc1c70 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/SourceConfiguration.java @@ -0,0 +1,121 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of SourceConfiguration. + */ +@Fluent +public final class SourceConfiguration implements JsonSerializable { + /* + * The name of the application associated with the configuration. + */ + private String applicationName; + + /* + * The name of the configuration template. + */ + private String templateName; + + /** + * Creates an instance of SourceConfiguration class. + */ + public SourceConfiguration() { + } + + /** + * Get the applicationName property: The name of the application associated with the configuration. + * + * @return the applicationName value. + */ + public String applicationName() { + return this.applicationName; + } + + /** + * Set the applicationName property: The name of the application associated with the configuration. + * + * @param applicationName the applicationName value to set. + * @return the SourceConfiguration object itself. + */ + public SourceConfiguration withApplicationName(String applicationName) { + this.applicationName = applicationName; + return this; + } + + /** + * Get the templateName property: The name of the configuration template. + * + * @return the templateName value. + */ + public String templateName() { + return this.templateName; + } + + /** + * Set the templateName property: The name of the configuration template. + * + * @param templateName the templateName value to set. + * @return the SourceConfiguration object itself. + */ + public SourceConfiguration withTemplateName(String templateName) { + this.templateName = templateName; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("applicationName", this.applicationName); + jsonWriter.writeStringField("templateName", this.templateName); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of SourceConfiguration from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of SourceConfiguration if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the SourceConfiguration. + */ + public static SourceConfiguration fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + SourceConfiguration deserializedSourceConfiguration = new SourceConfiguration(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("applicationName".equals(fieldName)) { + deserializedSourceConfiguration.applicationName = reader.getString(); + } else if ("templateName".equals(fieldName)) { + deserializedSourceConfiguration.templateName = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedSourceConfiguration; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/SourceSelectionCriteria.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/SourceSelectionCriteria.java new file mode 100644 index 000000000000..ad17d38e190f --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/SourceSelectionCriteria.java @@ -0,0 +1,136 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of SourceSelectionCriteria. + */ +@Fluent +public final class SourceSelectionCriteria implements JsonSerializable { + /* + * A filter that you can specify for selection for modifications on replicas. A filter that you can specify for + * selection for modifications on replicas. + */ + private ReplicaModifications replicaModifications; + + /* + * A container for filter information for the selection of Amazon S3 objects encrypted with AWS KMS. A container for + * filter information for the selection of S3 objects encrypted with AWS KMS. + */ + private SseKmsEncryptedObjects sseKmsEncryptedObjects; + + /** + * Creates an instance of SourceSelectionCriteria class. + */ + public SourceSelectionCriteria() { + } + + /** + * Get the replicaModifications property: A filter that you can specify for selection for modifications on replicas. + * A filter that you can specify for selection for modifications on replicas. + * + * @return the replicaModifications value. + */ + public ReplicaModifications replicaModifications() { + return this.replicaModifications; + } + + /** + * Set the replicaModifications property: A filter that you can specify for selection for modifications on replicas. + * A filter that you can specify for selection for modifications on replicas. + * + * @param replicaModifications the replicaModifications value to set. + * @return the SourceSelectionCriteria object itself. + */ + public SourceSelectionCriteria withReplicaModifications(ReplicaModifications replicaModifications) { + this.replicaModifications = replicaModifications; + return this; + } + + /** + * Get the sseKmsEncryptedObjects property: A container for filter information for the selection of Amazon S3 + * objects encrypted with AWS KMS. A container for filter information for the selection of S3 objects encrypted with + * AWS KMS. + * + * @return the sseKmsEncryptedObjects value. + */ + public SseKmsEncryptedObjects sseKmsEncryptedObjects() { + return this.sseKmsEncryptedObjects; + } + + /** + * Set the sseKmsEncryptedObjects property: A container for filter information for the selection of Amazon S3 + * objects encrypted with AWS KMS. A container for filter information for the selection of S3 objects encrypted with + * AWS KMS. + * + * @param sseKmsEncryptedObjects the sseKmsEncryptedObjects value to set. + * @return the SourceSelectionCriteria object itself. + */ + public SourceSelectionCriteria withSseKmsEncryptedObjects(SseKmsEncryptedObjects sseKmsEncryptedObjects) { + this.sseKmsEncryptedObjects = sseKmsEncryptedObjects; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (replicaModifications() != null) { + replicaModifications().validate(); + } + if (sseKmsEncryptedObjects() != null) { + sseKmsEncryptedObjects().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("replicaModifications", this.replicaModifications); + jsonWriter.writeJsonField("sseKmsEncryptedObjects", this.sseKmsEncryptedObjects); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of SourceSelectionCriteria from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of SourceSelectionCriteria if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the SourceSelectionCriteria. + */ + public static SourceSelectionCriteria fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + SourceSelectionCriteria deserializedSourceSelectionCriteria = new SourceSelectionCriteria(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("replicaModifications".equals(fieldName)) { + deserializedSourceSelectionCriteria.replicaModifications = ReplicaModifications.fromJson(reader); + } else if ("sseKmsEncryptedObjects".equals(fieldName)) { + deserializedSourceSelectionCriteria.sseKmsEncryptedObjects + = SseKmsEncryptedObjects.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedSourceSelectionCriteria; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/SourceType.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/SourceType.java new file mode 100644 index 000000000000..d702922779ce --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/SourceType.java @@ -0,0 +1,86 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * SourceType enum. + */ +public final class SourceType extends ExpandableStringEnum { + /** + * Static value BITBUCKET for SourceType. + */ + public static final SourceType BITBUCKET = fromString("BITBUCKET"); + + /** + * Static value CODECOMMIT for SourceType. + */ + public static final SourceType CODECOMMIT = fromString("CODECOMMIT"); + + /** + * Static value CODEPIPELINE for SourceType. + */ + public static final SourceType CODEPIPELINE = fromString("CODEPIPELINE"); + + /** + * Static value GITHUB for SourceType. + */ + public static final SourceType GITHUB = fromString("GITHUB"); + + /** + * Static value GITHUB_ENTERPRISE for SourceType. + */ + public static final SourceType GITHUB_ENTERPRISE = fromString("GITHUB_ENTERPRISE"); + + /** + * Static value GITLAB for SourceType. + */ + public static final SourceType GITLAB = fromString("GITLAB"); + + /** + * Static value GITLAB_SELF_MANAGED for SourceType. + */ + public static final SourceType GITLAB_SELF_MANAGED = fromString("GITLAB_SELF_MANAGED"); + + /** + * Static value NO_SOURCE for SourceType. + */ + public static final SourceType NO_SOURCE = fromString("NO_SOURCE"); + + /** + * Static value S3 for SourceType. + */ + public static final SourceType S3 = fromString("S3"); + + /** + * Creates a new instance of SourceType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public SourceType() { + } + + /** + * Creates or finds a SourceType from its string representation. + * + * @param name a name to look for. + * @return the corresponding SourceType. + */ + public static SourceType fromString(String name) { + return fromString(name, SourceType.class); + } + + /** + * Gets known SourceType values. + * + * @return known SourceType values. + */ + public static Collection values() { + return values(SourceType.class); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/SourceTypeEnumValue.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/SourceTypeEnumValue.java new file mode 100644 index 000000000000..35c821281a3f --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/SourceTypeEnumValue.java @@ -0,0 +1,93 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of SourceTypeEnumValue. + */ +@Fluent +public final class SourceTypeEnumValue implements JsonSerializable { + /* + * Property value + */ + private SourceType value; + + /** + * Creates an instance of SourceTypeEnumValue class. + */ + public SourceTypeEnumValue() { + } + + /** + * Get the value property: Property value. + * + * @return the value value. + */ + public SourceType value() { + return this.value; + } + + /** + * Set the value property: Property value. + * + * @param value the value value to set. + * @return the SourceTypeEnumValue object itself. + */ + public SourceTypeEnumValue withValue(SourceType value) { + this.value = value; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("value", this.value == null ? null : this.value.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of SourceTypeEnumValue from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of SourceTypeEnumValue if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the SourceTypeEnumValue. + */ + public static SourceTypeEnumValue fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + SourceTypeEnumValue deserializedSourceTypeEnumValue = new SourceTypeEnumValue(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + deserializedSourceTypeEnumValue.value = SourceType.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedSourceTypeEnumValue; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/SqsQueue.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/SqsQueue.java new file mode 100644 index 000000000000..8c9e7d928c60 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/SqsQueue.java @@ -0,0 +1,252 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.awsconnector.fluent.models.SqsQueueInner; +import java.util.Map; + +/** + * An immutable client-side representation of SqsQueue. + */ +public interface SqsQueue { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the location property: The geo-location where the resource lives. + * + * @return the location value. + */ + String location(); + + /** + * Gets the tags property: Resource tags. + * + * @return the tags value. + */ + Map tags(); + + /** + * Gets the properties property: The resource-specific properties for this resource. + * + * @return the properties value. + */ + SqsQueueProperties properties(); + + /** + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the region of the resource. + * + * @return the region of the resource. + */ + Region region(); + + /** + * Gets the name of the resource region. + * + * @return the name of the resource region. + */ + String regionName(); + + /** + * Gets the name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + + /** + * Gets the inner com.azure.resourcemanager.awsconnector.fluent.models.SqsQueueInner object. + * + * @return the inner object. + */ + SqsQueueInner innerModel(); + + /** + * The entirety of the SqsQueue definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithLocation, + DefinitionStages.WithResourceGroup, DefinitionStages.WithCreate { + } + + /** + * The SqsQueue definition stages. + */ + interface DefinitionStages { + /** + * The first stage of the SqsQueue definition. + */ + interface Blank extends WithLocation { + } + + /** + * The stage of the SqsQueue definition allowing to specify location. + */ + interface WithLocation { + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithResourceGroup withRegion(Region location); + + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithResourceGroup withRegion(String location); + } + + /** + * The stage of the SqsQueue definition allowing to specify parent resource. + */ + interface WithResourceGroup { + /** + * Specifies resourceGroupName. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @return the next definition stage. + */ + WithCreate withExistingResourceGroup(String resourceGroupName); + } + + /** + * The stage of the SqsQueue 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.WithProperties { + /** + * Executes the create request. + * + * @return the created resource. + */ + SqsQueue create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + SqsQueue create(Context context); + } + + /** + * The stage of the SqsQueue definition allowing to specify tags. + */ + interface WithTags { + /** + * Specifies the tags property: Resource tags.. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + WithCreate withTags(Map tags); + } + + /** + * The stage of the SqsQueue definition allowing to specify properties. + */ + interface WithProperties { + /** + * Specifies the properties property: The resource-specific properties for this resource.. + * + * @param properties The resource-specific properties for this resource. + * @return the next definition stage. + */ + WithCreate withProperties(SqsQueueProperties properties); + } + } + + /** + * Begins update for the SqsQueue resource. + * + * @return the stage of resource update. + */ + SqsQueue.Update update(); + + /** + * The template for SqsQueue update. + */ + interface Update extends UpdateStages.WithTags { + /** + * Executes the update request. + * + * @return the updated resource. + */ + SqsQueue apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + SqsQueue apply(Context context); + } + + /** + * The SqsQueue update stages. + */ + interface UpdateStages { + /** + * The stage of the SqsQueue update allowing to specify tags. + */ + interface WithTags { + /** + * Specifies the tags property: Resource tags.. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + Update withTags(Map tags); + } + } + + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + SqsQueue refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + SqsQueue refresh(Context context); +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/SqsQueueListResult.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/SqsQueueListResult.java new file mode 100644 index 000000000000..3aac15644cff --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/SqsQueueListResult.java @@ -0,0 +1,134 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.awsconnector.fluent.models.SqsQueueInner; +import java.io.IOException; +import java.util.List; + +/** + * The response of a SqsQueue list operation. + */ +@Fluent +public final class SqsQueueListResult implements JsonSerializable { + /* + * The SqsQueue items on this page + */ + private List value; + + /* + * The link to the next page of items + */ + private String nextLink; + + /** + * Creates an instance of SqsQueueListResult class. + */ + public SqsQueueListResult() { + } + + /** + * Get the value property: The SqsQueue items on this page. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The SqsQueue items on this page. + * + * @param value the value value to set. + * @return the SqsQueueListResult object itself. + */ + public SqsQueueListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The link to the next page of items. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: The link to the next page of items. + * + * @param nextLink the nextLink value to set. + * @return the SqsQueueListResult object itself. + */ + public SqsQueueListResult withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property value in model SqsQueueListResult")); + } else { + value().forEach(e -> e.validate()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(SqsQueueListResult.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("nextLink", this.nextLink); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of SqsQueueListResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of SqsQueueListResult if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the SqsQueueListResult. + */ + public static SqsQueueListResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + SqsQueueListResult deserializedSqsQueueListResult = new SqsQueueListResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value = reader.readArray(reader1 -> SqsQueueInner.fromJson(reader1)); + deserializedSqsQueueListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedSqsQueueListResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedSqsQueueListResult; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/SqsQueueProperties.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/SqsQueueProperties.java new file mode 100644 index 000000000000..7374514af13f --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/SqsQueueProperties.java @@ -0,0 +1,310 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.Map; + +/** + * Definition of SqsQueue. + */ +@Fluent +public final class SqsQueueProperties implements JsonSerializable { + /* + * AWS Properties + */ + private AwsSqsQueueProperties awsProperties; + + /* + * Public Cloud Connectors Resource ID + */ + private String publicCloudConnectorsResourceId; + + /* + * AWS Account ID + */ + private String awsAccountId; + + /* + * Amazon Resource Name (ARN) + */ + private String arn; + + /* + * Public Cloud Resource Name + */ + private String publicCloudResourceName; + + /* + * AWS Source Schema + */ + private String awsSourceSchema; + + /* + * AWS Region + */ + private String awsRegion; + + /* + * AWS Tags + */ + private Map awsTags; + + /* + * The status of the last operation. + */ + private ProvisioningState provisioningState; + + /** + * Creates an instance of SqsQueueProperties class. + */ + public SqsQueueProperties() { + } + + /** + * Get the awsProperties property: AWS Properties. + * + * @return the awsProperties value. + */ + public AwsSqsQueueProperties awsProperties() { + return this.awsProperties; + } + + /** + * Set the awsProperties property: AWS Properties. + * + * @param awsProperties the awsProperties value to set. + * @return the SqsQueueProperties object itself. + */ + public SqsQueueProperties withAwsProperties(AwsSqsQueueProperties awsProperties) { + this.awsProperties = awsProperties; + return this; + } + + /** + * Get the publicCloudConnectorsResourceId property: Public Cloud Connectors Resource ID. + * + * @return the publicCloudConnectorsResourceId value. + */ + public String publicCloudConnectorsResourceId() { + return this.publicCloudConnectorsResourceId; + } + + /** + * Set the publicCloudConnectorsResourceId property: Public Cloud Connectors Resource ID. + * + * @param publicCloudConnectorsResourceId the publicCloudConnectorsResourceId value to set. + * @return the SqsQueueProperties object itself. + */ + public SqsQueueProperties withPublicCloudConnectorsResourceId(String publicCloudConnectorsResourceId) { + this.publicCloudConnectorsResourceId = publicCloudConnectorsResourceId; + return this; + } + + /** + * Get the awsAccountId property: AWS Account ID. + * + * @return the awsAccountId value. + */ + public String awsAccountId() { + return this.awsAccountId; + } + + /** + * Set the awsAccountId property: AWS Account ID. + * + * @param awsAccountId the awsAccountId value to set. + * @return the SqsQueueProperties object itself. + */ + public SqsQueueProperties withAwsAccountId(String awsAccountId) { + this.awsAccountId = awsAccountId; + return this; + } + + /** + * Get the arn property: Amazon Resource Name (ARN). + * + * @return the arn value. + */ + public String arn() { + return this.arn; + } + + /** + * Set the arn property: Amazon Resource Name (ARN). + * + * @param arn the arn value to set. + * @return the SqsQueueProperties object itself. + */ + public SqsQueueProperties withArn(String arn) { + this.arn = arn; + return this; + } + + /** + * Get the publicCloudResourceName property: Public Cloud Resource Name. + * + * @return the publicCloudResourceName value. + */ + public String publicCloudResourceName() { + return this.publicCloudResourceName; + } + + /** + * Set the publicCloudResourceName property: Public Cloud Resource Name. + * + * @param publicCloudResourceName the publicCloudResourceName value to set. + * @return the SqsQueueProperties object itself. + */ + public SqsQueueProperties withPublicCloudResourceName(String publicCloudResourceName) { + this.publicCloudResourceName = publicCloudResourceName; + return this; + } + + /** + * Get the awsSourceSchema property: AWS Source Schema. + * + * @return the awsSourceSchema value. + */ + public String awsSourceSchema() { + return this.awsSourceSchema; + } + + /** + * Set the awsSourceSchema property: AWS Source Schema. + * + * @param awsSourceSchema the awsSourceSchema value to set. + * @return the SqsQueueProperties object itself. + */ + public SqsQueueProperties withAwsSourceSchema(String awsSourceSchema) { + this.awsSourceSchema = awsSourceSchema; + return this; + } + + /** + * Get the awsRegion property: AWS Region. + * + * @return the awsRegion value. + */ + public String awsRegion() { + return this.awsRegion; + } + + /** + * Set the awsRegion property: AWS Region. + * + * @param awsRegion the awsRegion value to set. + * @return the SqsQueueProperties object itself. + */ + public SqsQueueProperties withAwsRegion(String awsRegion) { + this.awsRegion = awsRegion; + return this; + } + + /** + * Get the awsTags property: AWS Tags. + * + * @return the awsTags value. + */ + public Map awsTags() { + return this.awsTags; + } + + /** + * Set the awsTags property: AWS Tags. + * + * @param awsTags the awsTags value to set. + * @return the SqsQueueProperties object itself. + */ + public SqsQueueProperties withAwsTags(Map awsTags) { + this.awsTags = awsTags; + return this; + } + + /** + * Get the provisioningState property: The status of the last operation. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (awsProperties() != null) { + awsProperties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("awsProperties", this.awsProperties); + jsonWriter.writeStringField("publicCloudConnectorsResourceId", this.publicCloudConnectorsResourceId); + jsonWriter.writeStringField("awsAccountId", this.awsAccountId); + jsonWriter.writeStringField("arn", this.arn); + jsonWriter.writeStringField("publicCloudResourceName", this.publicCloudResourceName); + jsonWriter.writeStringField("awsSourceSchema", this.awsSourceSchema); + jsonWriter.writeStringField("awsRegion", this.awsRegion); + jsonWriter.writeMapField("awsTags", this.awsTags, (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of SqsQueueProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of SqsQueueProperties if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the SqsQueueProperties. + */ + public static SqsQueueProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + SqsQueueProperties deserializedSqsQueueProperties = new SqsQueueProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("awsProperties".equals(fieldName)) { + deserializedSqsQueueProperties.awsProperties = AwsSqsQueueProperties.fromJson(reader); + } else if ("publicCloudConnectorsResourceId".equals(fieldName)) { + deserializedSqsQueueProperties.publicCloudConnectorsResourceId = reader.getString(); + } else if ("awsAccountId".equals(fieldName)) { + deserializedSqsQueueProperties.awsAccountId = reader.getString(); + } else if ("arn".equals(fieldName)) { + deserializedSqsQueueProperties.arn = reader.getString(); + } else if ("publicCloudResourceName".equals(fieldName)) { + deserializedSqsQueueProperties.publicCloudResourceName = reader.getString(); + } else if ("awsSourceSchema".equals(fieldName)) { + deserializedSqsQueueProperties.awsSourceSchema = reader.getString(); + } else if ("awsRegion".equals(fieldName)) { + deserializedSqsQueueProperties.awsRegion = reader.getString(); + } else if ("awsTags".equals(fieldName)) { + Map awsTags = reader.readMap(reader1 -> reader1.getString()); + deserializedSqsQueueProperties.awsTags = awsTags; + } else if ("provisioningState".equals(fieldName)) { + deserializedSqsQueueProperties.provisioningState = ProvisioningState.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedSqsQueueProperties; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/SqsQueueTagsUpdate.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/SqsQueueTagsUpdate.java new file mode 100644 index 000000000000..93fcc2a98264 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/SqsQueueTagsUpdate.java @@ -0,0 +1,95 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.Map; + +/** + * The type used for updating tags in SqsQueue resources. + */ +@Fluent +public final class SqsQueueTagsUpdate implements JsonSerializable { + /* + * Resource tags. + */ + private Map tags; + + /** + * Creates an instance of SqsQueueTagsUpdate class. + */ + public SqsQueueTagsUpdate() { + } + + /** + * Get the tags property: Resource tags. + * + * @return the tags value. + */ + public Map tags() { + return this.tags; + } + + /** + * Set the tags property: Resource tags. + * + * @param tags the tags value to set. + * @return the SqsQueueTagsUpdate object itself. + */ + public SqsQueueTagsUpdate withTags(Map tags) { + this.tags = tags; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeMapField("tags", this.tags, (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of SqsQueueTagsUpdate from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of SqsQueueTagsUpdate if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the SqsQueueTagsUpdate. + */ + public static SqsQueueTagsUpdate fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + SqsQueueTagsUpdate deserializedSqsQueueTagsUpdate = new SqsQueueTagsUpdate(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedSqsQueueTagsUpdate.tags = tags; + } else { + reader.skipChildren(); + } + } + + return deserializedSqsQueueTagsUpdate; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/SqsQueues.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/SqsQueues.java new file mode 100644 index 000000000000..58f793b4a051 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/SqsQueues.java @@ -0,0 +1,157 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** + * Resource collection API of SqsQueues. + */ +public interface SqsQueues { + /** + * List SqsQueue resources by subscription ID. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a SqsQueue list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable list(); + + /** + * List SqsQueue resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a SqsQueue list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable list(Context context); + + /** + * List SqsQueue resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a SqsQueue list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * List SqsQueue resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a SqsQueue list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Get a SqsQueue. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of SqsQueue. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a SqsQueue along with {@link Response}. + */ + Response getByResourceGroupWithResponse(String resourceGroupName, String name, Context context); + + /** + * Get a SqsQueue. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of SqsQueue. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a SqsQueue. + */ + SqsQueue getByResourceGroup(String resourceGroupName, String name); + + /** + * Delete a SqsQueue. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of SqsQueue. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByResourceGroup(String resourceGroupName, String name); + + /** + * Delete a SqsQueue. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of SqsQueue. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String name, Context context); + + /** + * Get a SqsQueue. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a SqsQueue along with {@link Response}. + */ + SqsQueue getById(String id); + + /** + * Get a SqsQueue. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a SqsQueue along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Delete a SqsQueue. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteById(String id); + + /** + * Delete a SqsQueue. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new SqsQueue resource. + * + * @param name resource name. + * @return the first stage of the new SqsQueue definition. + */ + SqsQueue.DefinitionStages.Blank define(String name); +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/SseDescription.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/SseDescription.java new file mode 100644 index 000000000000..835d94a8440a --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/SseDescription.java @@ -0,0 +1,109 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of SSEDescription. + */ +@Fluent +public final class SseDescription implements JsonSerializable { + /* + *

The current state of server-side encryption:

  • ENABLING - Server-side encryption + * is being enabled.

  • ENABLED - Server-side encryption is enabled.

  • + * DISABLING - Server-side encryption is being disabled.

  • DISABLED - + * Server-side encryption is disabled.

+ */ + private SseStatusEnumValue status; + + /** + * Creates an instance of SseDescription class. + */ + public SseDescription() { + } + + /** + * Get the status property: <p>The current state of server-side encryption:</p> <ul> <li> + * <p> <code>ENABLING</code> - Server-side encryption is being enabled.</p> </li> + * <li> <p> <code>ENABLED</code> - Server-side encryption is enabled.</p> </li> + * <li> <p> <code>DISABLING</code> - Server-side encryption is being disabled.</p> + * </li> <li> <p> <code>DISABLED</code> - Server-side encryption is + * disabled.</p> </li> </ul>. + * + * @return the status value. + */ + public SseStatusEnumValue status() { + return this.status; + } + + /** + * Set the status property: <p>The current state of server-side encryption:</p> <ul> <li> + * <p> <code>ENABLING</code> - Server-side encryption is being enabled.</p> </li> + * <li> <p> <code>ENABLED</code> - Server-side encryption is enabled.</p> </li> + * <li> <p> <code>DISABLING</code> - Server-side encryption is being disabled.</p> + * </li> <li> <p> <code>DISABLED</code> - Server-side encryption is + * disabled.</p> </li> </ul>. + * + * @param status the status value to set. + * @return the SseDescription object itself. + */ + public SseDescription withStatus(SseStatusEnumValue status) { + this.status = status; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (status() != null) { + status().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("status", this.status); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of SseDescription from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of SseDescription if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the SseDescription. + */ + public static SseDescription fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + SseDescription deserializedSseDescription = new SseDescription(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("status".equals(fieldName)) { + deserializedSseDescription.status = SseStatusEnumValue.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedSseDescription; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/SseKmsEncryptedObjects.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/SseKmsEncryptedObjects.java new file mode 100644 index 000000000000..d01428af39f2 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/SseKmsEncryptedObjects.java @@ -0,0 +1,97 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of SseKmsEncryptedObjects. + */ +@Fluent +public final class SseKmsEncryptedObjects implements JsonSerializable { + /* + * Specifies whether Amazon S3 replicates objects created with server-side encryption using an AWS KMS key stored in + * AWS Key Management Service. + */ + private SseKmsEncryptedObjectsStatus status; + + /** + * Creates an instance of SseKmsEncryptedObjects class. + */ + public SseKmsEncryptedObjects() { + } + + /** + * Get the status property: Specifies whether Amazon S3 replicates objects created with server-side encryption using + * an AWS KMS key stored in AWS Key Management Service. + * + * @return the status value. + */ + public SseKmsEncryptedObjectsStatus status() { + return this.status; + } + + /** + * Set the status property: Specifies whether Amazon S3 replicates objects created with server-side encryption using + * an AWS KMS key stored in AWS Key Management Service. + * + * @param status the status value to set. + * @return the SseKmsEncryptedObjects object itself. + */ + public SseKmsEncryptedObjects withStatus(SseKmsEncryptedObjectsStatus status) { + this.status = status; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("status", this.status == null ? null : this.status.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of SseKmsEncryptedObjects from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of SseKmsEncryptedObjects if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the SseKmsEncryptedObjects. + */ + public static SseKmsEncryptedObjects fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + SseKmsEncryptedObjects deserializedSseKmsEncryptedObjects = new SseKmsEncryptedObjects(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("status".equals(fieldName)) { + deserializedSseKmsEncryptedObjects.status + = SseKmsEncryptedObjectsStatus.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedSseKmsEncryptedObjects; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/SseKmsEncryptedObjectsStatus.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/SseKmsEncryptedObjectsStatus.java new file mode 100644 index 000000000000..826499849c6a --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/SseKmsEncryptedObjectsStatus.java @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * SseKmsEncryptedObjectsStatus enum. + */ +public final class SseKmsEncryptedObjectsStatus extends ExpandableStringEnum { + /** + * Static value Disabled for SseKmsEncryptedObjectsStatus. + */ + public static final SseKmsEncryptedObjectsStatus DISABLED = fromString("Disabled"); + + /** + * Static value Enabled for SseKmsEncryptedObjectsStatus. + */ + public static final SseKmsEncryptedObjectsStatus ENABLED = fromString("Enabled"); + + /** + * Creates a new instance of SseKmsEncryptedObjectsStatus value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public SseKmsEncryptedObjectsStatus() { + } + + /** + * Creates or finds a SseKmsEncryptedObjectsStatus from its string representation. + * + * @param name a name to look for. + * @return the corresponding SseKmsEncryptedObjectsStatus. + */ + public static SseKmsEncryptedObjectsStatus fromString(String name) { + return fromString(name, SseKmsEncryptedObjectsStatus.class); + } + + /** + * Gets known SseKmsEncryptedObjectsStatus values. + * + * @return known SseKmsEncryptedObjectsStatus values. + */ + public static Collection values() { + return values(SseKmsEncryptedObjectsStatus.class); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/SseSpecification.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/SseSpecification.java new file mode 100644 index 000000000000..9766808baa9d --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/SseSpecification.java @@ -0,0 +1,164 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of SSESpecification. + */ +@Fluent +public final class SseSpecification implements JsonSerializable { + /* + * The KMS key that should be used for the KMS encryption. To specify a key, use its key ID, Amazon Resource Name + * (ARN), alias name, or alias ARN. Note that you should only provide this parameter if the key is different from + * the default DynamoDB key ``alias/aws/dynamodb``. + */ + private String kmsMasterKeyId; + + /* + * Indicates whether server-side encryption is done using an AWS managed key or an AWS owned key. If enabled (true), + * server-side encryption type is set to ``KMS`` and an AWS managed key is used (KMS charges apply). If disabled + * (false) or not specified, server-side encryption is set to AWS owned key. + */ + private Boolean sseEnabled; + + /* + * Server-side encryption type. The only supported value is: + ``KMS`` - Server-side encryption that uses KMSlong. + * The key is stored in your account and is managed by KMS (KMS charges apply). + */ + private String sseType; + + /** + * Creates an instance of SseSpecification class. + */ + public SseSpecification() { + } + + /** + * Get the kmsMasterKeyId property: The KMS key that should be used for the KMS encryption. To specify a key, use + * its key ID, Amazon Resource Name (ARN), alias name, or alias ARN. Note that you should only provide this + * parameter if the key is different from the default DynamoDB key ``alias/aws/dynamodb``. + * + * @return the kmsMasterKeyId value. + */ + public String kmsMasterKeyId() { + return this.kmsMasterKeyId; + } + + /** + * Set the kmsMasterKeyId property: The KMS key that should be used for the KMS encryption. To specify a key, use + * its key ID, Amazon Resource Name (ARN), alias name, or alias ARN. Note that you should only provide this + * parameter if the key is different from the default DynamoDB key ``alias/aws/dynamodb``. + * + * @param kmsMasterKeyId the kmsMasterKeyId value to set. + * @return the SseSpecification object itself. + */ + public SseSpecification withKmsMasterKeyId(String kmsMasterKeyId) { + this.kmsMasterKeyId = kmsMasterKeyId; + return this; + } + + /** + * Get the sseEnabled property: Indicates whether server-side encryption is done using an AWS managed key or an AWS + * owned key. If enabled (true), server-side encryption type is set to ``KMS`` and an AWS managed key is used (KMS + * charges apply). If disabled (false) or not specified, server-side encryption is set to AWS owned key. + * + * @return the sseEnabled value. + */ + public Boolean sseEnabled() { + return this.sseEnabled; + } + + /** + * Set the sseEnabled property: Indicates whether server-side encryption is done using an AWS managed key or an AWS + * owned key. If enabled (true), server-side encryption type is set to ``KMS`` and an AWS managed key is used (KMS + * charges apply). If disabled (false) or not specified, server-side encryption is set to AWS owned key. + * + * @param sseEnabled the sseEnabled value to set. + * @return the SseSpecification object itself. + */ + public SseSpecification withSseEnabled(Boolean sseEnabled) { + this.sseEnabled = sseEnabled; + return this; + } + + /** + * Get the sseType property: Server-side encryption type. The only supported value is: + ``KMS`` - Server-side + * encryption that uses KMSlong. The key is stored in your account and is managed by KMS (KMS charges apply). + * + * @return the sseType value. + */ + public String sseType() { + return this.sseType; + } + + /** + * Set the sseType property: Server-side encryption type. The only supported value is: + ``KMS`` - Server-side + * encryption that uses KMSlong. The key is stored in your account and is managed by KMS (KMS charges apply). + * + * @param sseType the sseType value to set. + * @return the SseSpecification object itself. + */ + public SseSpecification withSseType(String sseType) { + this.sseType = sseType; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("kmsMasterKeyId", this.kmsMasterKeyId); + jsonWriter.writeBooleanField("sseEnabled", this.sseEnabled); + jsonWriter.writeStringField("sseType", this.sseType); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of SseSpecification from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of SseSpecification if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the SseSpecification. + */ + public static SseSpecification fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + SseSpecification deserializedSseSpecification = new SseSpecification(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("kmsMasterKeyId".equals(fieldName)) { + deserializedSseSpecification.kmsMasterKeyId = reader.getString(); + } else if ("sseEnabled".equals(fieldName)) { + deserializedSseSpecification.sseEnabled = reader.getNullable(JsonReader::getBoolean); + } else if ("sseType".equals(fieldName)) { + deserializedSseSpecification.sseType = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedSseSpecification; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/SseStatus.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/SseStatus.java new file mode 100644 index 000000000000..2cabaff27a3c --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/SseStatus.java @@ -0,0 +1,61 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * SSEStatus enum. + */ +public final class SseStatus extends ExpandableStringEnum { + /** + * Static value DISABLED for SseStatus. + */ + public static final SseStatus DISABLED = fromString("DISABLED"); + + /** + * Static value DISABLING for SseStatus. + */ + public static final SseStatus DISABLING = fromString("DISABLING"); + + /** + * Static value ENABLED for SseStatus. + */ + public static final SseStatus ENABLED = fromString("ENABLED"); + + /** + * Static value ENABLING for SseStatus. + */ + public static final SseStatus ENABLING = fromString("ENABLING"); + + /** + * Creates a new instance of SseStatus value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public SseStatus() { + } + + /** + * Creates or finds a SseStatus from its string representation. + * + * @param name a name to look for. + * @return the corresponding SseStatus. + */ + public static SseStatus fromString(String name) { + return fromString(name, SseStatus.class); + } + + /** + * Gets known SseStatus values. + * + * @return known SseStatus values. + */ + public static Collection values() { + return values(SseStatus.class); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/SseStatusEnumValue.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/SseStatusEnumValue.java new file mode 100644 index 000000000000..3bd5b29f4858 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/SseStatusEnumValue.java @@ -0,0 +1,93 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of SSEStatusEnumValue. + */ +@Fluent +public final class SseStatusEnumValue implements JsonSerializable { + /* + * Property value + */ + private SseStatus value; + + /** + * Creates an instance of SseStatusEnumValue class. + */ + public SseStatusEnumValue() { + } + + /** + * Get the value property: Property value. + * + * @return the value value. + */ + public SseStatus value() { + return this.value; + } + + /** + * Set the value property: Property value. + * + * @param value the value value to set. + * @return the SseStatusEnumValue object itself. + */ + public SseStatusEnumValue withValue(SseStatus value) { + this.value = value; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("value", this.value == null ? null : this.value.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of SseStatusEnumValue from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of SseStatusEnumValue if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the SseStatusEnumValue. + */ + public static SseStatusEnumValue fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + SseStatusEnumValue deserializedSseStatusEnumValue = new SseStatusEnumValue(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + deserializedSseStatusEnumValue.value = SseStatus.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedSseStatusEnumValue; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/SseType.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/SseType.java new file mode 100644 index 000000000000..1157f700234b --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/SseType.java @@ -0,0 +1,56 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * SSEType enum. + */ +public final class SseType extends ExpandableStringEnum { + /** + * Static value none for SseType. + */ + public static final SseType NONE = fromString("none"); + + /** + * Static value sse-ebs for SseType. + */ + public static final SseType SSE_EBS = fromString("sse-ebs"); + + /** + * Static value sse-kms for SseType. + */ + public static final SseType SSE_KMS = fromString("sse-kms"); + + /** + * Creates a new instance of SseType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public SseType() { + } + + /** + * Creates or finds a SseType from its string representation. + * + * @param name a name to look for. + * @return the corresponding SseType. + */ + public static SseType fromString(String name) { + return fromString(name, SseType.class); + } + + /** + * Gets known SseType values. + * + * @return known SseType values. + */ + public static Collection values() { + return values(SseType.class); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/SseTypeEnumValue.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/SseTypeEnumValue.java new file mode 100644 index 000000000000..516dd6e20c6d --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/SseTypeEnumValue.java @@ -0,0 +1,93 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of SSETypeEnumValue. + */ +@Fluent +public final class SseTypeEnumValue implements JsonSerializable { + /* + * Property value + */ + private SseType value; + + /** + * Creates an instance of SseTypeEnumValue class. + */ + public SseTypeEnumValue() { + } + + /** + * Get the value property: Property value. + * + * @return the value value. + */ + public SseType value() { + return this.value; + } + + /** + * Set the value property: Property value. + * + * @param value the value value to set. + * @return the SseTypeEnumValue object itself. + */ + public SseTypeEnumValue withValue(SseType value) { + this.value = value; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("value", this.value == null ? null : this.value.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of SseTypeEnumValue from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of SseTypeEnumValue if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the SseTypeEnumValue. + */ + public static SseTypeEnumValue fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + SseTypeEnumValue deserializedSseTypeEnumValue = new SseTypeEnumValue(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + deserializedSseTypeEnumValue.value = SseType.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedSseTypeEnumValue; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/SsmInstanceInformation.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/SsmInstanceInformation.java new file mode 100644 index 000000000000..f12c468577b0 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/SsmInstanceInformation.java @@ -0,0 +1,252 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.awsconnector.fluent.models.SsmInstanceInformationInner; +import java.util.Map; + +/** + * An immutable client-side representation of SsmInstanceInformation. + */ +public interface SsmInstanceInformation { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the location property: The geo-location where the resource lives. + * + * @return the location value. + */ + String location(); + + /** + * Gets the tags property: Resource tags. + * + * @return the tags value. + */ + Map tags(); + + /** + * Gets the properties property: The resource-specific properties for this resource. + * + * @return the properties value. + */ + SsmInstanceInformationProperties properties(); + + /** + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the region of the resource. + * + * @return the region of the resource. + */ + Region region(); + + /** + * Gets the name of the resource region. + * + * @return the name of the resource region. + */ + String regionName(); + + /** + * Gets the name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + + /** + * Gets the inner com.azure.resourcemanager.awsconnector.fluent.models.SsmInstanceInformationInner object. + * + * @return the inner object. + */ + SsmInstanceInformationInner innerModel(); + + /** + * The entirety of the SsmInstanceInformation definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithLocation, + DefinitionStages.WithResourceGroup, DefinitionStages.WithCreate { + } + + /** + * The SsmInstanceInformation definition stages. + */ + interface DefinitionStages { + /** + * The first stage of the SsmInstanceInformation definition. + */ + interface Blank extends WithLocation { + } + + /** + * The stage of the SsmInstanceInformation definition allowing to specify location. + */ + interface WithLocation { + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithResourceGroup withRegion(Region location); + + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithResourceGroup withRegion(String location); + } + + /** + * The stage of the SsmInstanceInformation definition allowing to specify parent resource. + */ + interface WithResourceGroup { + /** + * Specifies resourceGroupName. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @return the next definition stage. + */ + WithCreate withExistingResourceGroup(String resourceGroupName); + } + + /** + * The stage of the SsmInstanceInformation 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.WithProperties { + /** + * Executes the create request. + * + * @return the created resource. + */ + SsmInstanceInformation create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + SsmInstanceInformation create(Context context); + } + + /** + * The stage of the SsmInstanceInformation definition allowing to specify tags. + */ + interface WithTags { + /** + * Specifies the tags property: Resource tags.. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + WithCreate withTags(Map tags); + } + + /** + * The stage of the SsmInstanceInformation definition allowing to specify properties. + */ + interface WithProperties { + /** + * Specifies the properties property: The resource-specific properties for this resource.. + * + * @param properties The resource-specific properties for this resource. + * @return the next definition stage. + */ + WithCreate withProperties(SsmInstanceInformationProperties properties); + } + } + + /** + * Begins update for the SsmInstanceInformation resource. + * + * @return the stage of resource update. + */ + SsmInstanceInformation.Update update(); + + /** + * The template for SsmInstanceInformation update. + */ + interface Update extends UpdateStages.WithTags { + /** + * Executes the update request. + * + * @return the updated resource. + */ + SsmInstanceInformation apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + SsmInstanceInformation apply(Context context); + } + + /** + * The SsmInstanceInformation update stages. + */ + interface UpdateStages { + /** + * The stage of the SsmInstanceInformation update allowing to specify tags. + */ + interface WithTags { + /** + * Specifies the tags property: Resource tags.. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + Update withTags(Map tags); + } + } + + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + SsmInstanceInformation refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + SsmInstanceInformation refresh(Context context); +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/SsmInstanceInformationListResult.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/SsmInstanceInformationListResult.java new file mode 100644 index 000000000000..97d99a10eb64 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/SsmInstanceInformationListResult.java @@ -0,0 +1,137 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.awsconnector.fluent.models.SsmInstanceInformationInner; +import java.io.IOException; +import java.util.List; + +/** + * The response of a SsmInstanceInformation list operation. + */ +@Fluent +public final class SsmInstanceInformationListResult implements JsonSerializable { + /* + * The SsmInstanceInformation items on this page + */ + private List value; + + /* + * The link to the next page of items + */ + private String nextLink; + + /** + * Creates an instance of SsmInstanceInformationListResult class. + */ + public SsmInstanceInformationListResult() { + } + + /** + * Get the value property: The SsmInstanceInformation items on this page. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The SsmInstanceInformation items on this page. + * + * @param value the value value to set. + * @return the SsmInstanceInformationListResult object itself. + */ + public SsmInstanceInformationListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The link to the next page of items. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: The link to the next page of items. + * + * @param nextLink the nextLink value to set. + * @return the SsmInstanceInformationListResult object itself. + */ + public SsmInstanceInformationListResult withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property value in model SsmInstanceInformationListResult")); + } else { + value().forEach(e -> e.validate()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(SsmInstanceInformationListResult.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("nextLink", this.nextLink); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of SsmInstanceInformationListResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of SsmInstanceInformationListResult if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the SsmInstanceInformationListResult. + */ + public static SsmInstanceInformationListResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + SsmInstanceInformationListResult deserializedSsmInstanceInformationListResult + = new SsmInstanceInformationListResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> SsmInstanceInformationInner.fromJson(reader1)); + deserializedSsmInstanceInformationListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedSsmInstanceInformationListResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedSsmInstanceInformationListResult; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/SsmInstanceInformationProperties.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/SsmInstanceInformationProperties.java new file mode 100644 index 000000000000..2cc741f0efc8 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/SsmInstanceInformationProperties.java @@ -0,0 +1,314 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.Map; + +/** + * Definition of SsmInstanceInformation. + */ +@Fluent +public final class SsmInstanceInformationProperties implements JsonSerializable { + /* + * AWS Properties + */ + private AwsSsmInstanceInformationProperties awsProperties; + + /* + * Public Cloud Connectors Resource ID + */ + private String publicCloudConnectorsResourceId; + + /* + * AWS Account ID + */ + private String awsAccountId; + + /* + * Amazon Resource Name (ARN) + */ + private String arn; + + /* + * Public Cloud Resource Name + */ + private String publicCloudResourceName; + + /* + * AWS Source Schema + */ + private String awsSourceSchema; + + /* + * AWS Region + */ + private String awsRegion; + + /* + * AWS Tags + */ + private Map awsTags; + + /* + * The status of the last operation. + */ + private ProvisioningState provisioningState; + + /** + * Creates an instance of SsmInstanceInformationProperties class. + */ + public SsmInstanceInformationProperties() { + } + + /** + * Get the awsProperties property: AWS Properties. + * + * @return the awsProperties value. + */ + public AwsSsmInstanceInformationProperties awsProperties() { + return this.awsProperties; + } + + /** + * Set the awsProperties property: AWS Properties. + * + * @param awsProperties the awsProperties value to set. + * @return the SsmInstanceInformationProperties object itself. + */ + public SsmInstanceInformationProperties withAwsProperties(AwsSsmInstanceInformationProperties awsProperties) { + this.awsProperties = awsProperties; + return this; + } + + /** + * Get the publicCloudConnectorsResourceId property: Public Cloud Connectors Resource ID. + * + * @return the publicCloudConnectorsResourceId value. + */ + public String publicCloudConnectorsResourceId() { + return this.publicCloudConnectorsResourceId; + } + + /** + * Set the publicCloudConnectorsResourceId property: Public Cloud Connectors Resource ID. + * + * @param publicCloudConnectorsResourceId the publicCloudConnectorsResourceId value to set. + * @return the SsmInstanceInformationProperties object itself. + */ + public SsmInstanceInformationProperties + withPublicCloudConnectorsResourceId(String publicCloudConnectorsResourceId) { + this.publicCloudConnectorsResourceId = publicCloudConnectorsResourceId; + return this; + } + + /** + * Get the awsAccountId property: AWS Account ID. + * + * @return the awsAccountId value. + */ + public String awsAccountId() { + return this.awsAccountId; + } + + /** + * Set the awsAccountId property: AWS Account ID. + * + * @param awsAccountId the awsAccountId value to set. + * @return the SsmInstanceInformationProperties object itself. + */ + public SsmInstanceInformationProperties withAwsAccountId(String awsAccountId) { + this.awsAccountId = awsAccountId; + return this; + } + + /** + * Get the arn property: Amazon Resource Name (ARN). + * + * @return the arn value. + */ + public String arn() { + return this.arn; + } + + /** + * Set the arn property: Amazon Resource Name (ARN). + * + * @param arn the arn value to set. + * @return the SsmInstanceInformationProperties object itself. + */ + public SsmInstanceInformationProperties withArn(String arn) { + this.arn = arn; + return this; + } + + /** + * Get the publicCloudResourceName property: Public Cloud Resource Name. + * + * @return the publicCloudResourceName value. + */ + public String publicCloudResourceName() { + return this.publicCloudResourceName; + } + + /** + * Set the publicCloudResourceName property: Public Cloud Resource Name. + * + * @param publicCloudResourceName the publicCloudResourceName value to set. + * @return the SsmInstanceInformationProperties object itself. + */ + public SsmInstanceInformationProperties withPublicCloudResourceName(String publicCloudResourceName) { + this.publicCloudResourceName = publicCloudResourceName; + return this; + } + + /** + * Get the awsSourceSchema property: AWS Source Schema. + * + * @return the awsSourceSchema value. + */ + public String awsSourceSchema() { + return this.awsSourceSchema; + } + + /** + * Set the awsSourceSchema property: AWS Source Schema. + * + * @param awsSourceSchema the awsSourceSchema value to set. + * @return the SsmInstanceInformationProperties object itself. + */ + public SsmInstanceInformationProperties withAwsSourceSchema(String awsSourceSchema) { + this.awsSourceSchema = awsSourceSchema; + return this; + } + + /** + * Get the awsRegion property: AWS Region. + * + * @return the awsRegion value. + */ + public String awsRegion() { + return this.awsRegion; + } + + /** + * Set the awsRegion property: AWS Region. + * + * @param awsRegion the awsRegion value to set. + * @return the SsmInstanceInformationProperties object itself. + */ + public SsmInstanceInformationProperties withAwsRegion(String awsRegion) { + this.awsRegion = awsRegion; + return this; + } + + /** + * Get the awsTags property: AWS Tags. + * + * @return the awsTags value. + */ + public Map awsTags() { + return this.awsTags; + } + + /** + * Set the awsTags property: AWS Tags. + * + * @param awsTags the awsTags value to set. + * @return the SsmInstanceInformationProperties object itself. + */ + public SsmInstanceInformationProperties withAwsTags(Map awsTags) { + this.awsTags = awsTags; + return this; + } + + /** + * Get the provisioningState property: The status of the last operation. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (awsProperties() != null) { + awsProperties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("awsProperties", this.awsProperties); + jsonWriter.writeStringField("publicCloudConnectorsResourceId", this.publicCloudConnectorsResourceId); + jsonWriter.writeStringField("awsAccountId", this.awsAccountId); + jsonWriter.writeStringField("arn", this.arn); + jsonWriter.writeStringField("publicCloudResourceName", this.publicCloudResourceName); + jsonWriter.writeStringField("awsSourceSchema", this.awsSourceSchema); + jsonWriter.writeStringField("awsRegion", this.awsRegion); + jsonWriter.writeMapField("awsTags", this.awsTags, (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of SsmInstanceInformationProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of SsmInstanceInformationProperties if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the SsmInstanceInformationProperties. + */ + public static SsmInstanceInformationProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + SsmInstanceInformationProperties deserializedSsmInstanceInformationProperties + = new SsmInstanceInformationProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("awsProperties".equals(fieldName)) { + deserializedSsmInstanceInformationProperties.awsProperties + = AwsSsmInstanceInformationProperties.fromJson(reader); + } else if ("publicCloudConnectorsResourceId".equals(fieldName)) { + deserializedSsmInstanceInformationProperties.publicCloudConnectorsResourceId = reader.getString(); + } else if ("awsAccountId".equals(fieldName)) { + deserializedSsmInstanceInformationProperties.awsAccountId = reader.getString(); + } else if ("arn".equals(fieldName)) { + deserializedSsmInstanceInformationProperties.arn = reader.getString(); + } else if ("publicCloudResourceName".equals(fieldName)) { + deserializedSsmInstanceInformationProperties.publicCloudResourceName = reader.getString(); + } else if ("awsSourceSchema".equals(fieldName)) { + deserializedSsmInstanceInformationProperties.awsSourceSchema = reader.getString(); + } else if ("awsRegion".equals(fieldName)) { + deserializedSsmInstanceInformationProperties.awsRegion = reader.getString(); + } else if ("awsTags".equals(fieldName)) { + Map awsTags = reader.readMap(reader1 -> reader1.getString()); + deserializedSsmInstanceInformationProperties.awsTags = awsTags; + } else if ("provisioningState".equals(fieldName)) { + deserializedSsmInstanceInformationProperties.provisioningState + = ProvisioningState.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedSsmInstanceInformationProperties; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/SsmInstanceInformationTagsUpdate.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/SsmInstanceInformationTagsUpdate.java new file mode 100644 index 000000000000..f0077edde947 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/SsmInstanceInformationTagsUpdate.java @@ -0,0 +1,96 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.Map; + +/** + * The type used for updating tags in SsmInstanceInformation resources. + */ +@Fluent +public final class SsmInstanceInformationTagsUpdate implements JsonSerializable { + /* + * Resource tags. + */ + private Map tags; + + /** + * Creates an instance of SsmInstanceInformationTagsUpdate class. + */ + public SsmInstanceInformationTagsUpdate() { + } + + /** + * Get the tags property: Resource tags. + * + * @return the tags value. + */ + public Map tags() { + return this.tags; + } + + /** + * Set the tags property: Resource tags. + * + * @param tags the tags value to set. + * @return the SsmInstanceInformationTagsUpdate object itself. + */ + public SsmInstanceInformationTagsUpdate withTags(Map tags) { + this.tags = tags; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeMapField("tags", this.tags, (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of SsmInstanceInformationTagsUpdate from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of SsmInstanceInformationTagsUpdate if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the SsmInstanceInformationTagsUpdate. + */ + public static SsmInstanceInformationTagsUpdate fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + SsmInstanceInformationTagsUpdate deserializedSsmInstanceInformationTagsUpdate + = new SsmInstanceInformationTagsUpdate(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedSsmInstanceInformationTagsUpdate.tags = tags; + } else { + reader.skipChildren(); + } + } + + return deserializedSsmInstanceInformationTagsUpdate; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/SsmInstanceInformations.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/SsmInstanceInformations.java new file mode 100644 index 000000000000..fc0fb9a792ef --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/SsmInstanceInformations.java @@ -0,0 +1,158 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** + * Resource collection API of SsmInstanceInformations. + */ +public interface SsmInstanceInformations { + /** + * List SsmInstanceInformation resources by subscription ID. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a SsmInstanceInformation list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable list(); + + /** + * List SsmInstanceInformation resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a SsmInstanceInformation list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable list(Context context); + + /** + * List SsmInstanceInformation resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a SsmInstanceInformation list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * List SsmInstanceInformation resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a SsmInstanceInformation list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Get a SsmInstanceInformation. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of SsmInstanceInformation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a SsmInstanceInformation along with {@link Response}. + */ + Response getByResourceGroupWithResponse(String resourceGroupName, String name, + Context context); + + /** + * Get a SsmInstanceInformation. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of SsmInstanceInformation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a SsmInstanceInformation. + */ + SsmInstanceInformation getByResourceGroup(String resourceGroupName, String name); + + /** + * Delete a SsmInstanceInformation. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of SsmInstanceInformation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByResourceGroup(String resourceGroupName, String name); + + /** + * Delete a SsmInstanceInformation. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of SsmInstanceInformation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String name, Context context); + + /** + * Get a SsmInstanceInformation. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a SsmInstanceInformation along with {@link Response}. + */ + SsmInstanceInformation getById(String id); + + /** + * Get a SsmInstanceInformation. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a SsmInstanceInformation along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Delete a SsmInstanceInformation. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteById(String id); + + /** + * Delete a SsmInstanceInformation. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new SsmInstanceInformation resource. + * + * @param name resource name. + * @return the first stage of the new SsmInstanceInformation definition. + */ + SsmInstanceInformation.DefinitionStages.Blank define(String name); +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/SsmParameter.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/SsmParameter.java new file mode 100644 index 000000000000..6f59c5af35c6 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/SsmParameter.java @@ -0,0 +1,252 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.awsconnector.fluent.models.SsmParameterInner; +import java.util.Map; + +/** + * An immutable client-side representation of SsmParameter. + */ +public interface SsmParameter { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the location property: The geo-location where the resource lives. + * + * @return the location value. + */ + String location(); + + /** + * Gets the tags property: Resource tags. + * + * @return the tags value. + */ + Map tags(); + + /** + * Gets the properties property: The resource-specific properties for this resource. + * + * @return the properties value. + */ + SsmParameterProperties properties(); + + /** + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the region of the resource. + * + * @return the region of the resource. + */ + Region region(); + + /** + * Gets the name of the resource region. + * + * @return the name of the resource region. + */ + String regionName(); + + /** + * Gets the name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + + /** + * Gets the inner com.azure.resourcemanager.awsconnector.fluent.models.SsmParameterInner object. + * + * @return the inner object. + */ + SsmParameterInner innerModel(); + + /** + * The entirety of the SsmParameter definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithLocation, + DefinitionStages.WithResourceGroup, DefinitionStages.WithCreate { + } + + /** + * The SsmParameter definition stages. + */ + interface DefinitionStages { + /** + * The first stage of the SsmParameter definition. + */ + interface Blank extends WithLocation { + } + + /** + * The stage of the SsmParameter definition allowing to specify location. + */ + interface WithLocation { + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithResourceGroup withRegion(Region location); + + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithResourceGroup withRegion(String location); + } + + /** + * The stage of the SsmParameter definition allowing to specify parent resource. + */ + interface WithResourceGroup { + /** + * Specifies resourceGroupName. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @return the next definition stage. + */ + WithCreate withExistingResourceGroup(String resourceGroupName); + } + + /** + * The stage of the SsmParameter 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.WithProperties { + /** + * Executes the create request. + * + * @return the created resource. + */ + SsmParameter create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + SsmParameter create(Context context); + } + + /** + * The stage of the SsmParameter definition allowing to specify tags. + */ + interface WithTags { + /** + * Specifies the tags property: Resource tags.. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + WithCreate withTags(Map tags); + } + + /** + * The stage of the SsmParameter definition allowing to specify properties. + */ + interface WithProperties { + /** + * Specifies the properties property: The resource-specific properties for this resource.. + * + * @param properties The resource-specific properties for this resource. + * @return the next definition stage. + */ + WithCreate withProperties(SsmParameterProperties properties); + } + } + + /** + * Begins update for the SsmParameter resource. + * + * @return the stage of resource update. + */ + SsmParameter.Update update(); + + /** + * The template for SsmParameter update. + */ + interface Update extends UpdateStages.WithTags { + /** + * Executes the update request. + * + * @return the updated resource. + */ + SsmParameter apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + SsmParameter apply(Context context); + } + + /** + * The SsmParameter update stages. + */ + interface UpdateStages { + /** + * The stage of the SsmParameter update allowing to specify tags. + */ + interface WithTags { + /** + * Specifies the tags property: Resource tags.. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + Update withTags(Map tags); + } + } + + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + SsmParameter refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + SsmParameter refresh(Context context); +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/SsmParameterListResult.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/SsmParameterListResult.java new file mode 100644 index 000000000000..bfb3bce99493 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/SsmParameterListResult.java @@ -0,0 +1,134 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.awsconnector.fluent.models.SsmParameterInner; +import java.io.IOException; +import java.util.List; + +/** + * The response of a SsmParameter list operation. + */ +@Fluent +public final class SsmParameterListResult implements JsonSerializable { + /* + * The SsmParameter items on this page + */ + private List value; + + /* + * The link to the next page of items + */ + private String nextLink; + + /** + * Creates an instance of SsmParameterListResult class. + */ + public SsmParameterListResult() { + } + + /** + * Get the value property: The SsmParameter items on this page. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The SsmParameter items on this page. + * + * @param value the value value to set. + * @return the SsmParameterListResult object itself. + */ + public SsmParameterListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The link to the next page of items. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: The link to the next page of items. + * + * @param nextLink the nextLink value to set. + * @return the SsmParameterListResult object itself. + */ + public SsmParameterListResult withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property value in model SsmParameterListResult")); + } else { + value().forEach(e -> e.validate()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(SsmParameterListResult.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("nextLink", this.nextLink); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of SsmParameterListResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of SsmParameterListResult if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the SsmParameterListResult. + */ + public static SsmParameterListResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + SsmParameterListResult deserializedSsmParameterListResult = new SsmParameterListResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value = reader.readArray(reader1 -> SsmParameterInner.fromJson(reader1)); + deserializedSsmParameterListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedSsmParameterListResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedSsmParameterListResult; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/SsmParameterProperties.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/SsmParameterProperties.java new file mode 100644 index 000000000000..39936de8cebb --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/SsmParameterProperties.java @@ -0,0 +1,311 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.Map; + +/** + * Definition of SsmParameter. + */ +@Fluent +public final class SsmParameterProperties implements JsonSerializable { + /* + * AWS Properties + */ + private AwsSsmParameterProperties awsProperties; + + /* + * Public Cloud Connectors Resource ID + */ + private String publicCloudConnectorsResourceId; + + /* + * AWS Account ID + */ + private String awsAccountId; + + /* + * Amazon Resource Name (ARN) + */ + private String arn; + + /* + * Public Cloud Resource Name + */ + private String publicCloudResourceName; + + /* + * AWS Source Schema + */ + private String awsSourceSchema; + + /* + * AWS Region + */ + private String awsRegion; + + /* + * AWS Tags + */ + private Map awsTags; + + /* + * The status of the last operation. + */ + private ProvisioningState provisioningState; + + /** + * Creates an instance of SsmParameterProperties class. + */ + public SsmParameterProperties() { + } + + /** + * Get the awsProperties property: AWS Properties. + * + * @return the awsProperties value. + */ + public AwsSsmParameterProperties awsProperties() { + return this.awsProperties; + } + + /** + * Set the awsProperties property: AWS Properties. + * + * @param awsProperties the awsProperties value to set. + * @return the SsmParameterProperties object itself. + */ + public SsmParameterProperties withAwsProperties(AwsSsmParameterProperties awsProperties) { + this.awsProperties = awsProperties; + return this; + } + + /** + * Get the publicCloudConnectorsResourceId property: Public Cloud Connectors Resource ID. + * + * @return the publicCloudConnectorsResourceId value. + */ + public String publicCloudConnectorsResourceId() { + return this.publicCloudConnectorsResourceId; + } + + /** + * Set the publicCloudConnectorsResourceId property: Public Cloud Connectors Resource ID. + * + * @param publicCloudConnectorsResourceId the publicCloudConnectorsResourceId value to set. + * @return the SsmParameterProperties object itself. + */ + public SsmParameterProperties withPublicCloudConnectorsResourceId(String publicCloudConnectorsResourceId) { + this.publicCloudConnectorsResourceId = publicCloudConnectorsResourceId; + return this; + } + + /** + * Get the awsAccountId property: AWS Account ID. + * + * @return the awsAccountId value. + */ + public String awsAccountId() { + return this.awsAccountId; + } + + /** + * Set the awsAccountId property: AWS Account ID. + * + * @param awsAccountId the awsAccountId value to set. + * @return the SsmParameterProperties object itself. + */ + public SsmParameterProperties withAwsAccountId(String awsAccountId) { + this.awsAccountId = awsAccountId; + return this; + } + + /** + * Get the arn property: Amazon Resource Name (ARN). + * + * @return the arn value. + */ + public String arn() { + return this.arn; + } + + /** + * Set the arn property: Amazon Resource Name (ARN). + * + * @param arn the arn value to set. + * @return the SsmParameterProperties object itself. + */ + public SsmParameterProperties withArn(String arn) { + this.arn = arn; + return this; + } + + /** + * Get the publicCloudResourceName property: Public Cloud Resource Name. + * + * @return the publicCloudResourceName value. + */ + public String publicCloudResourceName() { + return this.publicCloudResourceName; + } + + /** + * Set the publicCloudResourceName property: Public Cloud Resource Name. + * + * @param publicCloudResourceName the publicCloudResourceName value to set. + * @return the SsmParameterProperties object itself. + */ + public SsmParameterProperties withPublicCloudResourceName(String publicCloudResourceName) { + this.publicCloudResourceName = publicCloudResourceName; + return this; + } + + /** + * Get the awsSourceSchema property: AWS Source Schema. + * + * @return the awsSourceSchema value. + */ + public String awsSourceSchema() { + return this.awsSourceSchema; + } + + /** + * Set the awsSourceSchema property: AWS Source Schema. + * + * @param awsSourceSchema the awsSourceSchema value to set. + * @return the SsmParameterProperties object itself. + */ + public SsmParameterProperties withAwsSourceSchema(String awsSourceSchema) { + this.awsSourceSchema = awsSourceSchema; + return this; + } + + /** + * Get the awsRegion property: AWS Region. + * + * @return the awsRegion value. + */ + public String awsRegion() { + return this.awsRegion; + } + + /** + * Set the awsRegion property: AWS Region. + * + * @param awsRegion the awsRegion value to set. + * @return the SsmParameterProperties object itself. + */ + public SsmParameterProperties withAwsRegion(String awsRegion) { + this.awsRegion = awsRegion; + return this; + } + + /** + * Get the awsTags property: AWS Tags. + * + * @return the awsTags value. + */ + public Map awsTags() { + return this.awsTags; + } + + /** + * Set the awsTags property: AWS Tags. + * + * @param awsTags the awsTags value to set. + * @return the SsmParameterProperties object itself. + */ + public SsmParameterProperties withAwsTags(Map awsTags) { + this.awsTags = awsTags; + return this; + } + + /** + * Get the provisioningState property: The status of the last operation. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (awsProperties() != null) { + awsProperties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("awsProperties", this.awsProperties); + jsonWriter.writeStringField("publicCloudConnectorsResourceId", this.publicCloudConnectorsResourceId); + jsonWriter.writeStringField("awsAccountId", this.awsAccountId); + jsonWriter.writeStringField("arn", this.arn); + jsonWriter.writeStringField("publicCloudResourceName", this.publicCloudResourceName); + jsonWriter.writeStringField("awsSourceSchema", this.awsSourceSchema); + jsonWriter.writeStringField("awsRegion", this.awsRegion); + jsonWriter.writeMapField("awsTags", this.awsTags, (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of SsmParameterProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of SsmParameterProperties if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the SsmParameterProperties. + */ + public static SsmParameterProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + SsmParameterProperties deserializedSsmParameterProperties = new SsmParameterProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("awsProperties".equals(fieldName)) { + deserializedSsmParameterProperties.awsProperties = AwsSsmParameterProperties.fromJson(reader); + } else if ("publicCloudConnectorsResourceId".equals(fieldName)) { + deserializedSsmParameterProperties.publicCloudConnectorsResourceId = reader.getString(); + } else if ("awsAccountId".equals(fieldName)) { + deserializedSsmParameterProperties.awsAccountId = reader.getString(); + } else if ("arn".equals(fieldName)) { + deserializedSsmParameterProperties.arn = reader.getString(); + } else if ("publicCloudResourceName".equals(fieldName)) { + deserializedSsmParameterProperties.publicCloudResourceName = reader.getString(); + } else if ("awsSourceSchema".equals(fieldName)) { + deserializedSsmParameterProperties.awsSourceSchema = reader.getString(); + } else if ("awsRegion".equals(fieldName)) { + deserializedSsmParameterProperties.awsRegion = reader.getString(); + } else if ("awsTags".equals(fieldName)) { + Map awsTags = reader.readMap(reader1 -> reader1.getString()); + deserializedSsmParameterProperties.awsTags = awsTags; + } else if ("provisioningState".equals(fieldName)) { + deserializedSsmParameterProperties.provisioningState + = ProvisioningState.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedSsmParameterProperties; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/SsmParameterTagsUpdate.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/SsmParameterTagsUpdate.java new file mode 100644 index 000000000000..48f0961bc290 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/SsmParameterTagsUpdate.java @@ -0,0 +1,95 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.Map; + +/** + * The type used for updating tags in SsmParameter resources. + */ +@Fluent +public final class SsmParameterTagsUpdate implements JsonSerializable { + /* + * Resource tags. + */ + private Map tags; + + /** + * Creates an instance of SsmParameterTagsUpdate class. + */ + public SsmParameterTagsUpdate() { + } + + /** + * Get the tags property: Resource tags. + * + * @return the tags value. + */ + public Map tags() { + return this.tags; + } + + /** + * Set the tags property: Resource tags. + * + * @param tags the tags value to set. + * @return the SsmParameterTagsUpdate object itself. + */ + public SsmParameterTagsUpdate withTags(Map tags) { + this.tags = tags; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeMapField("tags", this.tags, (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of SsmParameterTagsUpdate from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of SsmParameterTagsUpdate if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the SsmParameterTagsUpdate. + */ + public static SsmParameterTagsUpdate fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + SsmParameterTagsUpdate deserializedSsmParameterTagsUpdate = new SsmParameterTagsUpdate(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedSsmParameterTagsUpdate.tags = tags; + } else { + reader.skipChildren(); + } + } + + return deserializedSsmParameterTagsUpdate; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/SsmParameters.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/SsmParameters.java new file mode 100644 index 000000000000..2d369ff401d8 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/SsmParameters.java @@ -0,0 +1,157 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** + * Resource collection API of SsmParameters. + */ +public interface SsmParameters { + /** + * List SsmParameter resources by subscription ID. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a SsmParameter list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable list(); + + /** + * List SsmParameter resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a SsmParameter list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable list(Context context); + + /** + * List SsmParameter resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a SsmParameter list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * List SsmParameter resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a SsmParameter list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Get a SsmParameter. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of SsmParameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a SsmParameter along with {@link Response}. + */ + Response getByResourceGroupWithResponse(String resourceGroupName, String name, Context context); + + /** + * Get a SsmParameter. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of SsmParameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a SsmParameter. + */ + SsmParameter getByResourceGroup(String resourceGroupName, String name); + + /** + * Delete a SsmParameter. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of SsmParameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByResourceGroup(String resourceGroupName, String name); + + /** + * Delete a SsmParameter. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of SsmParameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String name, Context context); + + /** + * Get a SsmParameter. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a SsmParameter along with {@link Response}. + */ + SsmParameter getById(String id); + + /** + * Get a SsmParameter. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a SsmParameter along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Delete a SsmParameter. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteById(String id); + + /** + * Delete a SsmParameter. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new SsmParameter resource. + * + * @param name resource name. + * @return the first stage of the new SsmParameter definition. + */ + SsmParameter.DefinitionStages.Blank define(String name); +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/SsmResourceComplianceSummaryItem.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/SsmResourceComplianceSummaryItem.java new file mode 100644 index 000000000000..12737bfdb966 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/SsmResourceComplianceSummaryItem.java @@ -0,0 +1,252 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.awsconnector.fluent.models.SsmResourceComplianceSummaryItemInner; +import java.util.Map; + +/** + * An immutable client-side representation of SsmResourceComplianceSummaryItem. + */ +public interface SsmResourceComplianceSummaryItem { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the location property: The geo-location where the resource lives. + * + * @return the location value. + */ + String location(); + + /** + * Gets the tags property: Resource tags. + * + * @return the tags value. + */ + Map tags(); + + /** + * Gets the properties property: The resource-specific properties for this resource. + * + * @return the properties value. + */ + SsmResourceComplianceSummaryItemProperties properties(); + + /** + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the region of the resource. + * + * @return the region of the resource. + */ + Region region(); + + /** + * Gets the name of the resource region. + * + * @return the name of the resource region. + */ + String regionName(); + + /** + * Gets the name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + + /** + * Gets the inner com.azure.resourcemanager.awsconnector.fluent.models.SsmResourceComplianceSummaryItemInner object. + * + * @return the inner object. + */ + SsmResourceComplianceSummaryItemInner innerModel(); + + /** + * The entirety of the SsmResourceComplianceSummaryItem definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithLocation, + DefinitionStages.WithResourceGroup, DefinitionStages.WithCreate { + } + + /** + * The SsmResourceComplianceSummaryItem definition stages. + */ + interface DefinitionStages { + /** + * The first stage of the SsmResourceComplianceSummaryItem definition. + */ + interface Blank extends WithLocation { + } + + /** + * The stage of the SsmResourceComplianceSummaryItem definition allowing to specify location. + */ + interface WithLocation { + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithResourceGroup withRegion(Region location); + + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithResourceGroup withRegion(String location); + } + + /** + * The stage of the SsmResourceComplianceSummaryItem definition allowing to specify parent resource. + */ + interface WithResourceGroup { + /** + * Specifies resourceGroupName. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @return the next definition stage. + */ + WithCreate withExistingResourceGroup(String resourceGroupName); + } + + /** + * The stage of the SsmResourceComplianceSummaryItem 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.WithProperties { + /** + * Executes the create request. + * + * @return the created resource. + */ + SsmResourceComplianceSummaryItem create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + SsmResourceComplianceSummaryItem create(Context context); + } + + /** + * The stage of the SsmResourceComplianceSummaryItem definition allowing to specify tags. + */ + interface WithTags { + /** + * Specifies the tags property: Resource tags.. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + WithCreate withTags(Map tags); + } + + /** + * The stage of the SsmResourceComplianceSummaryItem definition allowing to specify properties. + */ + interface WithProperties { + /** + * Specifies the properties property: The resource-specific properties for this resource.. + * + * @param properties The resource-specific properties for this resource. + * @return the next definition stage. + */ + WithCreate withProperties(SsmResourceComplianceSummaryItemProperties properties); + } + } + + /** + * Begins update for the SsmResourceComplianceSummaryItem resource. + * + * @return the stage of resource update. + */ + SsmResourceComplianceSummaryItem.Update update(); + + /** + * The template for SsmResourceComplianceSummaryItem update. + */ + interface Update extends UpdateStages.WithTags { + /** + * Executes the update request. + * + * @return the updated resource. + */ + SsmResourceComplianceSummaryItem apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + SsmResourceComplianceSummaryItem apply(Context context); + } + + /** + * The SsmResourceComplianceSummaryItem update stages. + */ + interface UpdateStages { + /** + * The stage of the SsmResourceComplianceSummaryItem update allowing to specify tags. + */ + interface WithTags { + /** + * Specifies the tags property: Resource tags.. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + Update withTags(Map tags); + } + } + + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + SsmResourceComplianceSummaryItem refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + SsmResourceComplianceSummaryItem refresh(Context context); +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/SsmResourceComplianceSummaryItemListResult.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/SsmResourceComplianceSummaryItemListResult.java new file mode 100644 index 000000000000..fec3e8cfba22 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/SsmResourceComplianceSummaryItemListResult.java @@ -0,0 +1,138 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.awsconnector.fluent.models.SsmResourceComplianceSummaryItemInner; +import java.io.IOException; +import java.util.List; + +/** + * The response of a SsmResourceComplianceSummaryItem list operation. + */ +@Fluent +public final class SsmResourceComplianceSummaryItemListResult + implements JsonSerializable { + /* + * The SsmResourceComplianceSummaryItem items on this page + */ + private List value; + + /* + * The link to the next page of items + */ + private String nextLink; + + /** + * Creates an instance of SsmResourceComplianceSummaryItemListResult class. + */ + public SsmResourceComplianceSummaryItemListResult() { + } + + /** + * Get the value property: The SsmResourceComplianceSummaryItem items on this page. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The SsmResourceComplianceSummaryItem items on this page. + * + * @param value the value value to set. + * @return the SsmResourceComplianceSummaryItemListResult object itself. + */ + public SsmResourceComplianceSummaryItemListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The link to the next page of items. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: The link to the next page of items. + * + * @param nextLink the nextLink value to set. + * @return the SsmResourceComplianceSummaryItemListResult object itself. + */ + public SsmResourceComplianceSummaryItemListResult withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property value in model SsmResourceComplianceSummaryItemListResult")); + } else { + value().forEach(e -> e.validate()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(SsmResourceComplianceSummaryItemListResult.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("nextLink", this.nextLink); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of SsmResourceComplianceSummaryItemListResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of SsmResourceComplianceSummaryItemListResult if the JsonReader was pointing to an instance + * of it, or null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the SsmResourceComplianceSummaryItemListResult. + */ + public static SsmResourceComplianceSummaryItemListResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + SsmResourceComplianceSummaryItemListResult deserializedSsmResourceComplianceSummaryItemListResult + = new SsmResourceComplianceSummaryItemListResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> SsmResourceComplianceSummaryItemInner.fromJson(reader1)); + deserializedSsmResourceComplianceSummaryItemListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedSsmResourceComplianceSummaryItemListResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedSsmResourceComplianceSummaryItemListResult; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/SsmResourceComplianceSummaryItemProperties.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/SsmResourceComplianceSummaryItemProperties.java new file mode 100644 index 000000000000..0e108f274fdd --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/SsmResourceComplianceSummaryItemProperties.java @@ -0,0 +1,317 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.Map; + +/** + * Definition of SsmResourceComplianceSummaryItem. + */ +@Fluent +public final class SsmResourceComplianceSummaryItemProperties + implements JsonSerializable { + /* + * AWS Properties + */ + private AwsSsmResourceComplianceSummaryItemProperties awsProperties; + + /* + * Public Cloud Connectors Resource ID + */ + private String publicCloudConnectorsResourceId; + + /* + * AWS Account ID + */ + private String awsAccountId; + + /* + * Amazon Resource Name (ARN) + */ + private String arn; + + /* + * Public Cloud Resource Name + */ + private String publicCloudResourceName; + + /* + * AWS Source Schema + */ + private String awsSourceSchema; + + /* + * AWS Region + */ + private String awsRegion; + + /* + * AWS Tags + */ + private Map awsTags; + + /* + * The status of the last operation. + */ + private ProvisioningState provisioningState; + + /** + * Creates an instance of SsmResourceComplianceSummaryItemProperties class. + */ + public SsmResourceComplianceSummaryItemProperties() { + } + + /** + * Get the awsProperties property: AWS Properties. + * + * @return the awsProperties value. + */ + public AwsSsmResourceComplianceSummaryItemProperties awsProperties() { + return this.awsProperties; + } + + /** + * Set the awsProperties property: AWS Properties. + * + * @param awsProperties the awsProperties value to set. + * @return the SsmResourceComplianceSummaryItemProperties object itself. + */ + public SsmResourceComplianceSummaryItemProperties + withAwsProperties(AwsSsmResourceComplianceSummaryItemProperties awsProperties) { + this.awsProperties = awsProperties; + return this; + } + + /** + * Get the publicCloudConnectorsResourceId property: Public Cloud Connectors Resource ID. + * + * @return the publicCloudConnectorsResourceId value. + */ + public String publicCloudConnectorsResourceId() { + return this.publicCloudConnectorsResourceId; + } + + /** + * Set the publicCloudConnectorsResourceId property: Public Cloud Connectors Resource ID. + * + * @param publicCloudConnectorsResourceId the publicCloudConnectorsResourceId value to set. + * @return the SsmResourceComplianceSummaryItemProperties object itself. + */ + public SsmResourceComplianceSummaryItemProperties + withPublicCloudConnectorsResourceId(String publicCloudConnectorsResourceId) { + this.publicCloudConnectorsResourceId = publicCloudConnectorsResourceId; + return this; + } + + /** + * Get the awsAccountId property: AWS Account ID. + * + * @return the awsAccountId value. + */ + public String awsAccountId() { + return this.awsAccountId; + } + + /** + * Set the awsAccountId property: AWS Account ID. + * + * @param awsAccountId the awsAccountId value to set. + * @return the SsmResourceComplianceSummaryItemProperties object itself. + */ + public SsmResourceComplianceSummaryItemProperties withAwsAccountId(String awsAccountId) { + this.awsAccountId = awsAccountId; + return this; + } + + /** + * Get the arn property: Amazon Resource Name (ARN). + * + * @return the arn value. + */ + public String arn() { + return this.arn; + } + + /** + * Set the arn property: Amazon Resource Name (ARN). + * + * @param arn the arn value to set. + * @return the SsmResourceComplianceSummaryItemProperties object itself. + */ + public SsmResourceComplianceSummaryItemProperties withArn(String arn) { + this.arn = arn; + return this; + } + + /** + * Get the publicCloudResourceName property: Public Cloud Resource Name. + * + * @return the publicCloudResourceName value. + */ + public String publicCloudResourceName() { + return this.publicCloudResourceName; + } + + /** + * Set the publicCloudResourceName property: Public Cloud Resource Name. + * + * @param publicCloudResourceName the publicCloudResourceName value to set. + * @return the SsmResourceComplianceSummaryItemProperties object itself. + */ + public SsmResourceComplianceSummaryItemProperties withPublicCloudResourceName(String publicCloudResourceName) { + this.publicCloudResourceName = publicCloudResourceName; + return this; + } + + /** + * Get the awsSourceSchema property: AWS Source Schema. + * + * @return the awsSourceSchema value. + */ + public String awsSourceSchema() { + return this.awsSourceSchema; + } + + /** + * Set the awsSourceSchema property: AWS Source Schema. + * + * @param awsSourceSchema the awsSourceSchema value to set. + * @return the SsmResourceComplianceSummaryItemProperties object itself. + */ + public SsmResourceComplianceSummaryItemProperties withAwsSourceSchema(String awsSourceSchema) { + this.awsSourceSchema = awsSourceSchema; + return this; + } + + /** + * Get the awsRegion property: AWS Region. + * + * @return the awsRegion value. + */ + public String awsRegion() { + return this.awsRegion; + } + + /** + * Set the awsRegion property: AWS Region. + * + * @param awsRegion the awsRegion value to set. + * @return the SsmResourceComplianceSummaryItemProperties object itself. + */ + public SsmResourceComplianceSummaryItemProperties withAwsRegion(String awsRegion) { + this.awsRegion = awsRegion; + return this; + } + + /** + * Get the awsTags property: AWS Tags. + * + * @return the awsTags value. + */ + public Map awsTags() { + return this.awsTags; + } + + /** + * Set the awsTags property: AWS Tags. + * + * @param awsTags the awsTags value to set. + * @return the SsmResourceComplianceSummaryItemProperties object itself. + */ + public SsmResourceComplianceSummaryItemProperties withAwsTags(Map awsTags) { + this.awsTags = awsTags; + return this; + } + + /** + * Get the provisioningState property: The status of the last operation. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (awsProperties() != null) { + awsProperties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("awsProperties", this.awsProperties); + jsonWriter.writeStringField("publicCloudConnectorsResourceId", this.publicCloudConnectorsResourceId); + jsonWriter.writeStringField("awsAccountId", this.awsAccountId); + jsonWriter.writeStringField("arn", this.arn); + jsonWriter.writeStringField("publicCloudResourceName", this.publicCloudResourceName); + jsonWriter.writeStringField("awsSourceSchema", this.awsSourceSchema); + jsonWriter.writeStringField("awsRegion", this.awsRegion); + jsonWriter.writeMapField("awsTags", this.awsTags, (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of SsmResourceComplianceSummaryItemProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of SsmResourceComplianceSummaryItemProperties if the JsonReader was pointing to an instance + * of it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the SsmResourceComplianceSummaryItemProperties. + */ + public static SsmResourceComplianceSummaryItemProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + SsmResourceComplianceSummaryItemProperties deserializedSsmResourceComplianceSummaryItemProperties + = new SsmResourceComplianceSummaryItemProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("awsProperties".equals(fieldName)) { + deserializedSsmResourceComplianceSummaryItemProperties.awsProperties + = AwsSsmResourceComplianceSummaryItemProperties.fromJson(reader); + } else if ("publicCloudConnectorsResourceId".equals(fieldName)) { + deserializedSsmResourceComplianceSummaryItemProperties.publicCloudConnectorsResourceId + = reader.getString(); + } else if ("awsAccountId".equals(fieldName)) { + deserializedSsmResourceComplianceSummaryItemProperties.awsAccountId = reader.getString(); + } else if ("arn".equals(fieldName)) { + deserializedSsmResourceComplianceSummaryItemProperties.arn = reader.getString(); + } else if ("publicCloudResourceName".equals(fieldName)) { + deserializedSsmResourceComplianceSummaryItemProperties.publicCloudResourceName = reader.getString(); + } else if ("awsSourceSchema".equals(fieldName)) { + deserializedSsmResourceComplianceSummaryItemProperties.awsSourceSchema = reader.getString(); + } else if ("awsRegion".equals(fieldName)) { + deserializedSsmResourceComplianceSummaryItemProperties.awsRegion = reader.getString(); + } else if ("awsTags".equals(fieldName)) { + Map awsTags = reader.readMap(reader1 -> reader1.getString()); + deserializedSsmResourceComplianceSummaryItemProperties.awsTags = awsTags; + } else if ("provisioningState".equals(fieldName)) { + deserializedSsmResourceComplianceSummaryItemProperties.provisioningState + = ProvisioningState.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedSsmResourceComplianceSummaryItemProperties; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/SsmResourceComplianceSummaryItemTagsUpdate.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/SsmResourceComplianceSummaryItemTagsUpdate.java new file mode 100644 index 000000000000..1dceb4247587 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/SsmResourceComplianceSummaryItemTagsUpdate.java @@ -0,0 +1,97 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.Map; + +/** + * The type used for updating tags in SsmResourceComplianceSummaryItem resources. + */ +@Fluent +public final class SsmResourceComplianceSummaryItemTagsUpdate + implements JsonSerializable { + /* + * Resource tags. + */ + private Map tags; + + /** + * Creates an instance of SsmResourceComplianceSummaryItemTagsUpdate class. + */ + public SsmResourceComplianceSummaryItemTagsUpdate() { + } + + /** + * Get the tags property: Resource tags. + * + * @return the tags value. + */ + public Map tags() { + return this.tags; + } + + /** + * Set the tags property: Resource tags. + * + * @param tags the tags value to set. + * @return the SsmResourceComplianceSummaryItemTagsUpdate object itself. + */ + public SsmResourceComplianceSummaryItemTagsUpdate withTags(Map tags) { + this.tags = tags; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeMapField("tags", this.tags, (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of SsmResourceComplianceSummaryItemTagsUpdate from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of SsmResourceComplianceSummaryItemTagsUpdate if the JsonReader was pointing to an instance + * of it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the SsmResourceComplianceSummaryItemTagsUpdate. + */ + public static SsmResourceComplianceSummaryItemTagsUpdate fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + SsmResourceComplianceSummaryItemTagsUpdate deserializedSsmResourceComplianceSummaryItemTagsUpdate + = new SsmResourceComplianceSummaryItemTagsUpdate(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedSsmResourceComplianceSummaryItemTagsUpdate.tags = tags; + } else { + reader.skipChildren(); + } + } + + return deserializedSsmResourceComplianceSummaryItemTagsUpdate; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/SsmResourceComplianceSummaryItems.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/SsmResourceComplianceSummaryItems.java new file mode 100644 index 000000000000..8bccf2242ee3 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/SsmResourceComplianceSummaryItems.java @@ -0,0 +1,162 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** + * Resource collection API of SsmResourceComplianceSummaryItems. + */ +public interface SsmResourceComplianceSummaryItems { + /** + * List SsmResourceComplianceSummaryItem resources by subscription ID. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a SsmResourceComplianceSummaryItem list operation as paginated response with + * {@link PagedIterable}. + */ + PagedIterable list(); + + /** + * List SsmResourceComplianceSummaryItem resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a SsmResourceComplianceSummaryItem list operation as paginated response with + * {@link PagedIterable}. + */ + PagedIterable list(Context context); + + /** + * List SsmResourceComplianceSummaryItem resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a SsmResourceComplianceSummaryItem list operation as paginated response with + * {@link PagedIterable}. + */ + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * List SsmResourceComplianceSummaryItem resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a SsmResourceComplianceSummaryItem list operation as paginated response with + * {@link PagedIterable}. + */ + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Get a SsmResourceComplianceSummaryItem. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of SsmResourceComplianceSummaryItem. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a SsmResourceComplianceSummaryItem along with {@link Response}. + */ + Response getByResourceGroupWithResponse(String resourceGroupName, String name, + Context context); + + /** + * Get a SsmResourceComplianceSummaryItem. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of SsmResourceComplianceSummaryItem. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a SsmResourceComplianceSummaryItem. + */ + SsmResourceComplianceSummaryItem getByResourceGroup(String resourceGroupName, String name); + + /** + * Delete a SsmResourceComplianceSummaryItem. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of SsmResourceComplianceSummaryItem. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByResourceGroup(String resourceGroupName, String name); + + /** + * Delete a SsmResourceComplianceSummaryItem. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of SsmResourceComplianceSummaryItem. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String name, Context context); + + /** + * Get a SsmResourceComplianceSummaryItem. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a SsmResourceComplianceSummaryItem along with {@link Response}. + */ + SsmResourceComplianceSummaryItem getById(String id); + + /** + * Get a SsmResourceComplianceSummaryItem. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a SsmResourceComplianceSummaryItem along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Delete a SsmResourceComplianceSummaryItem. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteById(String id); + + /** + * Delete a SsmResourceComplianceSummaryItem. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new SsmResourceComplianceSummaryItem resource. + * + * @param name resource name. + * @return the first stage of the new SsmResourceComplianceSummaryItem definition. + */ + SsmResourceComplianceSummaryItem.DefinitionStages.Blank define(String name); +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/StackInstances.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/StackInstances.java new file mode 100644 index 000000000000..1dd54ceaf01c --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/StackInstances.java @@ -0,0 +1,165 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Definition of StackInstances. + */ +@Fluent +public final class StackInstances implements JsonSerializable { + /* + * The AWS OrganizationalUnitIds or Accounts for which to create stack instances in the specified Regions. + */ + private DeploymentTargets deploymentTargets; + + /* + * A list of stack set parameters whose values you want to override in the selected stack instances. + */ + private List parameterOverrides; + + /* + * The names of one or more Regions where you want to create stack instances using the specified AWS account(s). + */ + private List regions; + + /** + * Creates an instance of StackInstances class. + */ + public StackInstances() { + } + + /** + * Get the deploymentTargets property: The AWS OrganizationalUnitIds or Accounts for which to create stack instances + * in the specified Regions. + * + * @return the deploymentTargets value. + */ + public DeploymentTargets deploymentTargets() { + return this.deploymentTargets; + } + + /** + * Set the deploymentTargets property: The AWS OrganizationalUnitIds or Accounts for which to create stack instances + * in the specified Regions. + * + * @param deploymentTargets the deploymentTargets value to set. + * @return the StackInstances object itself. + */ + public StackInstances withDeploymentTargets(DeploymentTargets deploymentTargets) { + this.deploymentTargets = deploymentTargets; + return this; + } + + /** + * Get the parameterOverrides property: A list of stack set parameters whose values you want to override in the + * selected stack instances. + * + * @return the parameterOverrides value. + */ + public List parameterOverrides() { + return this.parameterOverrides; + } + + /** + * Set the parameterOverrides property: A list of stack set parameters whose values you want to override in the + * selected stack instances. + * + * @param parameterOverrides the parameterOverrides value to set. + * @return the StackInstances object itself. + */ + public StackInstances withParameterOverrides(List parameterOverrides) { + this.parameterOverrides = parameterOverrides; + return this; + } + + /** + * Get the regions property: The names of one or more Regions where you want to create stack instances using the + * specified AWS account(s). + * + * @return the regions value. + */ + public List regions() { + return this.regions; + } + + /** + * Set the regions property: The names of one or more Regions where you want to create stack instances using the + * specified AWS account(s). + * + * @param regions the regions value to set. + * @return the StackInstances object itself. + */ + public StackInstances withRegions(List regions) { + this.regions = regions; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (deploymentTargets() != null) { + deploymentTargets().validate(); + } + if (parameterOverrides() != null) { + parameterOverrides().forEach(e -> e.validate()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("deploymentTargets", this.deploymentTargets); + jsonWriter.writeArrayField("parameterOverrides", this.parameterOverrides, + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("regions", this.regions, (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of StackInstances from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of StackInstances if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the StackInstances. + */ + public static StackInstances fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + StackInstances deserializedStackInstances = new StackInstances(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("deploymentTargets".equals(fieldName)) { + deserializedStackInstances.deploymentTargets = DeploymentTargets.fromJson(reader); + } else if ("parameterOverrides".equals(fieldName)) { + List parameterOverrides = reader.readArray(reader1 -> Parameter.fromJson(reader1)); + deserializedStackInstances.parameterOverrides = parameterOverrides; + } else if ("regions".equals(fieldName)) { + List regions = reader.readArray(reader1 -> reader1.getString()); + deserializedStackInstances.regions = regions; + } else { + reader.skipChildren(); + } + } + + return deserializedStackInstances; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/StackStatus.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/StackStatus.java new file mode 100644 index 000000000000..9ea704ffe042 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/StackStatus.java @@ -0,0 +1,158 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * StackStatus enum. + */ +public final class StackStatus extends ExpandableStringEnum { + /** + * Static value CREATE_COMPLETE for StackStatus. + */ + public static final StackStatus CREATE_COMPLETE = fromString("CREATE_COMPLETE"); + + /** + * Static value CREATE_FAILED for StackStatus. + */ + public static final StackStatus CREATE_FAILED = fromString("CREATE_FAILED"); + + /** + * Static value CREATE_IN_PROGRESS for StackStatus. + */ + public static final StackStatus CREATE_IN_PROGRESS = fromString("CREATE_IN_PROGRESS"); + + /** + * Static value DELETE_COMPLETE for StackStatus. + */ + public static final StackStatus DELETE_COMPLETE = fromString("DELETE_COMPLETE"); + + /** + * Static value DELETE_FAILED for StackStatus. + */ + public static final StackStatus DELETE_FAILED = fromString("DELETE_FAILED"); + + /** + * Static value DELETE_IN_PROGRESS for StackStatus. + */ + public static final StackStatus DELETE_IN_PROGRESS = fromString("DELETE_IN_PROGRESS"); + + /** + * Static value IMPORT_COMPLETE for StackStatus. + */ + public static final StackStatus IMPORT_COMPLETE = fromString("IMPORT_COMPLETE"); + + /** + * Static value IMPORT_IN_PROGRESS for StackStatus. + */ + public static final StackStatus IMPORT_IN_PROGRESS = fromString("IMPORT_IN_PROGRESS"); + + /** + * Static value IMPORT_ROLLBACK_COMPLETE for StackStatus. + */ + public static final StackStatus IMPORT_ROLLBACK_COMPLETE = fromString("IMPORT_ROLLBACK_COMPLETE"); + + /** + * Static value IMPORT_ROLLBACK_FAILED for StackStatus. + */ + public static final StackStatus IMPORT_ROLLBACK_FAILED = fromString("IMPORT_ROLLBACK_FAILED"); + + /** + * Static value IMPORT_ROLLBACK_IN_PROGRESS for StackStatus. + */ + public static final StackStatus IMPORT_ROLLBACK_IN_PROGRESS = fromString("IMPORT_ROLLBACK_IN_PROGRESS"); + + /** + * Static value REVIEW_IN_PROGRESS for StackStatus. + */ + public static final StackStatus REVIEW_IN_PROGRESS = fromString("REVIEW_IN_PROGRESS"); + + /** + * Static value ROLLBACK_COMPLETE for StackStatus. + */ + public static final StackStatus ROLLBACK_COMPLETE = fromString("ROLLBACK_COMPLETE"); + + /** + * Static value ROLLBACK_FAILED for StackStatus. + */ + public static final StackStatus ROLLBACK_FAILED = fromString("ROLLBACK_FAILED"); + + /** + * Static value ROLLBACK_IN_PROGRESS for StackStatus. + */ + public static final StackStatus ROLLBACK_IN_PROGRESS = fromString("ROLLBACK_IN_PROGRESS"); + + /** + * Static value UPDATE_COMPLETE for StackStatus. + */ + public static final StackStatus UPDATE_COMPLETE = fromString("UPDATE_COMPLETE"); + + /** + * Static value UPDATE_COMPLETE_CLEANUP_IN_PROGRESS for StackStatus. + */ + public static final StackStatus UPDATE_COMPLETE_CLEANUP_IN_PROGRESS + = fromString("UPDATE_COMPLETE_CLEANUP_IN_PROGRESS"); + + /** + * Static value UPDATE_FAILED for StackStatus. + */ + public static final StackStatus UPDATE_FAILED = fromString("UPDATE_FAILED"); + + /** + * Static value UPDATE_IN_PROGRESS for StackStatus. + */ + public static final StackStatus UPDATE_IN_PROGRESS = fromString("UPDATE_IN_PROGRESS"); + + /** + * Static value UPDATE_ROLLBACK_COMPLETE for StackStatus. + */ + public static final StackStatus UPDATE_ROLLBACK_COMPLETE = fromString("UPDATE_ROLLBACK_COMPLETE"); + + /** + * Static value UPDATE_ROLLBACK_COMPLETE_CLEANUP_IN_PROGRESS for StackStatus. + */ + public static final StackStatus UPDATE_ROLLBACK_COMPLETE_CLEANUP_IN_PROGRESS + = fromString("UPDATE_ROLLBACK_COMPLETE_CLEANUP_IN_PROGRESS"); + + /** + * Static value UPDATE_ROLLBACK_FAILED for StackStatus. + */ + public static final StackStatus UPDATE_ROLLBACK_FAILED = fromString("UPDATE_ROLLBACK_FAILED"); + + /** + * Static value UPDATE_ROLLBACK_IN_PROGRESS for StackStatus. + */ + public static final StackStatus UPDATE_ROLLBACK_IN_PROGRESS = fromString("UPDATE_ROLLBACK_IN_PROGRESS"); + + /** + * Creates a new instance of StackStatus value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public StackStatus() { + } + + /** + * Creates or finds a StackStatus from its string representation. + * + * @param name a name to look for. + * @return the corresponding StackStatus. + */ + public static StackStatus fromString(String name) { + return fromString(name, StackStatus.class); + } + + /** + * Gets known StackStatus values. + * + * @return known StackStatus values. + */ + public static Collection values() { + return values(StackStatus.class); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/State.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/State.java new file mode 100644 index 000000000000..788f50751946 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/State.java @@ -0,0 +1,121 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of State. + */ +@Fluent +public final class State implements JsonSerializable { + /* + * Status code of the Instance. + */ + private Integer code; + + /* + * Status code of the Instance. + */ + private String name; + + /** + * Creates an instance of State class. + */ + public State() { + } + + /** + * Get the code property: Status code of the Instance. + * + * @return the code value. + */ + public Integer code() { + return this.code; + } + + /** + * Set the code property: Status code of the Instance. + * + * @param code the code value to set. + * @return the State object itself. + */ + public State withCode(Integer code) { + this.code = code; + return this; + } + + /** + * Get the name property: Status code of the Instance. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: Status code of the Instance. + * + * @param name the name value to set. + * @return the State object itself. + */ + public State withName(String name) { + this.name = name; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeNumberField("code", this.code); + jsonWriter.writeStringField("name", this.name); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of State from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of State if the JsonReader was pointing to an instance of it, or null if it was pointing to + * JSON null. + * @throws IOException If an error occurs while reading the State. + */ + public static State fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + State deserializedState = new State(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("code".equals(fieldName)) { + deserializedState.code = reader.getNullable(JsonReader::getInt); + } else if ("name".equals(fieldName)) { + deserializedState.name = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedState; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/StateReason.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/StateReason.java new file mode 100644 index 000000000000..691739a6915e --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/StateReason.java @@ -0,0 +1,182 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of StateReason. + */ +@Fluent +public final class StateReason implements JsonSerializable { + /* + *

The reason code for the state change.

+ */ + private String code; + + /* + *

The message for the state change.

  • Server.InsufficientInstanceCapacity: There + * was insufficient capacity available to satisfy the launch request.

  • + * Server.InternalError: An internal error caused the instance to terminate during launch.

  • + *
  • Server.ScheduledStop: The instance was stopped due to a scheduled retirement.

  • + *
  • Server.SpotInstanceShutdown: The instance was stopped because the number of Spot requests + * with a maximum price equal to or higher than the Spot price exceeded available capacity or because of an increase + * in the Spot price.

  • Server.SpotInstanceTermination: The instance was terminated + * because the number of Spot requests with a maximum price equal to or higher than the Spot price exceeded + * available capacity or because of an increase in the Spot price.

  • + * Client.InstanceInitiatedShutdown: The instance was shut down from the operating system of the + * instance.

  • Client.InstanceTerminated: The instance was terminated or rebooted + * during AMI creation.

  • Client.InternalError: A client error caused the instance to + * terminate during launch.

  • Client.InvalidSnapshot.NotFound: The specified snapshot + * was not found.

  • Client.UserInitiatedHibernate: Hibernation was initiated on the + * instance.

  • Client.UserInitiatedShutdown: The instance was shut down using the + * Amazon EC2 API.

  • Client.VolumeLimitExceeded: The limit on the number of EBS + * volumes or total storage was exceeded. Decrease usage or request an increase in your account limits.

  • + *
+ */ + private String message; + + /** + * Creates an instance of StateReason class. + */ + public StateReason() { + } + + /** + * Get the code property: <p>The reason code for the state change.</p>. + * + * @return the code value. + */ + public String code() { + return this.code; + } + + /** + * Set the code property: <p>The reason code for the state change.</p>. + * + * @param code the code value to set. + * @return the StateReason object itself. + */ + public StateReason withCode(String code) { + this.code = code; + return this; + } + + /** + * Get the message property: <p>The message for the state change.</p> <ul> <li> <p> + * <code>Server.InsufficientInstanceCapacity</code>: There was insufficient capacity available to + * satisfy the launch request.</p> </li> <li> <p> + * <code>Server.InternalError</code>: An internal error caused the instance to terminate during + * launch.</p> </li> <li> <p> <code>Server.ScheduledStop</code>: The instance + * was stopped due to a scheduled retirement.</p> </li> <li> <p> + * <code>Server.SpotInstanceShutdown</code>: The instance was stopped because the number of Spot + * requests with a maximum price equal to or higher than the Spot price exceeded available capacity or because of an + * increase in the Spot price.</p> </li> <li> <p> + * <code>Server.SpotInstanceTermination</code>: The instance was terminated because the number of Spot + * requests with a maximum price equal to or higher than the Spot price exceeded available capacity or because of an + * increase in the Spot price.</p> </li> <li> <p> + * <code>Client.InstanceInitiatedShutdown</code>: The instance was shut down from the operating system + * of the instance.</p> </li> <li> <p> <code>Client.InstanceTerminated</code>: + * The instance was terminated or rebooted during AMI creation.</p> </li> <li> <p> + * <code>Client.InternalError</code>: A client error caused the instance to terminate during + * launch.</p> </li> <li> <p> <code>Client.InvalidSnapshot.NotFound</code>: The + * specified snapshot was not found.</p> </li> <li> <p> + * <code>Client.UserInitiatedHibernate</code>: Hibernation was initiated on the instance.</p> + * </li> <li> <p> <code>Client.UserInitiatedShutdown</code>: The instance was shut + * down using the Amazon EC2 API.</p> </li> <li> <p> + * <code>Client.VolumeLimitExceeded</code>: The limit on the number of EBS volumes or total storage was + * exceeded. Decrease usage or request an increase in your account limits.</p> </li> </ul>. + * + * @return the message value. + */ + public String message() { + return this.message; + } + + /** + * Set the message property: <p>The message for the state change.</p> <ul> <li> <p> + * <code>Server.InsufficientInstanceCapacity</code>: There was insufficient capacity available to + * satisfy the launch request.</p> </li> <li> <p> + * <code>Server.InternalError</code>: An internal error caused the instance to terminate during + * launch.</p> </li> <li> <p> <code>Server.ScheduledStop</code>: The instance + * was stopped due to a scheduled retirement.</p> </li> <li> <p> + * <code>Server.SpotInstanceShutdown</code>: The instance was stopped because the number of Spot + * requests with a maximum price equal to or higher than the Spot price exceeded available capacity or because of an + * increase in the Spot price.</p> </li> <li> <p> + * <code>Server.SpotInstanceTermination</code>: The instance was terminated because the number of Spot + * requests with a maximum price equal to or higher than the Spot price exceeded available capacity or because of an + * increase in the Spot price.</p> </li> <li> <p> + * <code>Client.InstanceInitiatedShutdown</code>: The instance was shut down from the operating system + * of the instance.</p> </li> <li> <p> <code>Client.InstanceTerminated</code>: + * The instance was terminated or rebooted during AMI creation.</p> </li> <li> <p> + * <code>Client.InternalError</code>: A client error caused the instance to terminate during + * launch.</p> </li> <li> <p> <code>Client.InvalidSnapshot.NotFound</code>: The + * specified snapshot was not found.</p> </li> <li> <p> + * <code>Client.UserInitiatedHibernate</code>: Hibernation was initiated on the instance.</p> + * </li> <li> <p> <code>Client.UserInitiatedShutdown</code>: The instance was shut + * down using the Amazon EC2 API.</p> </li> <li> <p> + * <code>Client.VolumeLimitExceeded</code>: The limit on the number of EBS volumes or total storage was + * exceeded. Decrease usage or request an increase in your account limits.</p> </li> </ul>. + * + * @param message the message value to set. + * @return the StateReason object itself. + */ + public StateReason withMessage(String message) { + this.message = message; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("code", this.code); + jsonWriter.writeStringField("message", this.message); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of StateReason from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of StateReason if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the StateReason. + */ + public static StateReason fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + StateReason deserializedStateReason = new StateReason(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("code".equals(fieldName)) { + deserializedStateReason.code = reader.getString(); + } else if ("message".equals(fieldName)) { + deserializedStateReason.message = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedStateReason; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/StatefulEngineOptions.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/StatefulEngineOptions.java new file mode 100644 index 000000000000..9ad65c6a169c --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/StatefulEngineOptions.java @@ -0,0 +1,125 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of StatefulEngineOptions. + */ +@Fluent +public final class StatefulEngineOptions implements JsonSerializable { + /* + * Property ruleOrder + */ + private StatefulEngineOptionsRuleOrder ruleOrder; + + /* + * Property streamExceptionPolicy + */ + private StatefulEngineOptionsStreamExceptionPolicy streamExceptionPolicy; + + /** + * Creates an instance of StatefulEngineOptions class. + */ + public StatefulEngineOptions() { + } + + /** + * Get the ruleOrder property: Property ruleOrder. + * + * @return the ruleOrder value. + */ + public StatefulEngineOptionsRuleOrder ruleOrder() { + return this.ruleOrder; + } + + /** + * Set the ruleOrder property: Property ruleOrder. + * + * @param ruleOrder the ruleOrder value to set. + * @return the StatefulEngineOptions object itself. + */ + public StatefulEngineOptions withRuleOrder(StatefulEngineOptionsRuleOrder ruleOrder) { + this.ruleOrder = ruleOrder; + return this; + } + + /** + * Get the streamExceptionPolicy property: Property streamExceptionPolicy. + * + * @return the streamExceptionPolicy value. + */ + public StatefulEngineOptionsStreamExceptionPolicy streamExceptionPolicy() { + return this.streamExceptionPolicy; + } + + /** + * Set the streamExceptionPolicy property: Property streamExceptionPolicy. + * + * @param streamExceptionPolicy the streamExceptionPolicy value to set. + * @return the StatefulEngineOptions object itself. + */ + public StatefulEngineOptions + withStreamExceptionPolicy(StatefulEngineOptionsStreamExceptionPolicy streamExceptionPolicy) { + this.streamExceptionPolicy = streamExceptionPolicy; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("ruleOrder", this.ruleOrder == null ? null : this.ruleOrder.toString()); + jsonWriter.writeStringField("streamExceptionPolicy", + this.streamExceptionPolicy == null ? null : this.streamExceptionPolicy.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of StatefulEngineOptions from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of StatefulEngineOptions if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the StatefulEngineOptions. + */ + public static StatefulEngineOptions fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + StatefulEngineOptions deserializedStatefulEngineOptions = new StatefulEngineOptions(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("ruleOrder".equals(fieldName)) { + deserializedStatefulEngineOptions.ruleOrder + = StatefulEngineOptionsRuleOrder.fromString(reader.getString()); + } else if ("streamExceptionPolicy".equals(fieldName)) { + deserializedStatefulEngineOptions.streamExceptionPolicy + = StatefulEngineOptionsStreamExceptionPolicy.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedStatefulEngineOptions; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/StatefulEngineOptionsRuleOrder.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/StatefulEngineOptionsRuleOrder.java new file mode 100644 index 000000000000..d27d449059b0 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/StatefulEngineOptionsRuleOrder.java @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * StatefulEngineOptionsRuleOrder enum. + */ +public final class StatefulEngineOptionsRuleOrder extends ExpandableStringEnum { + /** + * Static value DEFAULT_ACTION_ORDER for StatefulEngineOptionsRuleOrder. + */ + public static final StatefulEngineOptionsRuleOrder DEFAULT_ACTION_ORDER = fromString("DEFAULT_ACTION_ORDER"); + + /** + * Static value STRICT_ORDER for StatefulEngineOptionsRuleOrder. + */ + public static final StatefulEngineOptionsRuleOrder STRICT_ORDER = fromString("STRICT_ORDER"); + + /** + * Creates a new instance of StatefulEngineOptionsRuleOrder value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public StatefulEngineOptionsRuleOrder() { + } + + /** + * Creates or finds a StatefulEngineOptionsRuleOrder from its string representation. + * + * @param name a name to look for. + * @return the corresponding StatefulEngineOptionsRuleOrder. + */ + public static StatefulEngineOptionsRuleOrder fromString(String name) { + return fromString(name, StatefulEngineOptionsRuleOrder.class); + } + + /** + * Gets known StatefulEngineOptionsRuleOrder values. + * + * @return known StatefulEngineOptionsRuleOrder values. + */ + public static Collection values() { + return values(StatefulEngineOptionsRuleOrder.class); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/StatefulEngineOptionsStreamExceptionPolicy.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/StatefulEngineOptionsStreamExceptionPolicy.java new file mode 100644 index 000000000000..f49ef1f22ad1 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/StatefulEngineOptionsStreamExceptionPolicy.java @@ -0,0 +1,57 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * StatefulEngineOptionsStreamExceptionPolicy enum. + */ +public final class StatefulEngineOptionsStreamExceptionPolicy + extends ExpandableStringEnum { + /** + * Static value CONTINUE for StatefulEngineOptionsStreamExceptionPolicy. + */ + public static final StatefulEngineOptionsStreamExceptionPolicy CONTINUE = fromString("CONTINUE"); + + /** + * Static value DROP for StatefulEngineOptionsStreamExceptionPolicy. + */ + public static final StatefulEngineOptionsStreamExceptionPolicy DROP = fromString("DROP"); + + /** + * Static value REJECT for StatefulEngineOptionsStreamExceptionPolicy. + */ + public static final StatefulEngineOptionsStreamExceptionPolicy REJECT = fromString("REJECT"); + + /** + * Creates a new instance of StatefulEngineOptionsStreamExceptionPolicy value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public StatefulEngineOptionsStreamExceptionPolicy() { + } + + /** + * Creates or finds a StatefulEngineOptionsStreamExceptionPolicy from its string representation. + * + * @param name a name to look for. + * @return the corresponding StatefulEngineOptionsStreamExceptionPolicy. + */ + public static StatefulEngineOptionsStreamExceptionPolicy fromString(String name) { + return fromString(name, StatefulEngineOptionsStreamExceptionPolicy.class); + } + + /** + * Gets known StatefulEngineOptionsStreamExceptionPolicy values. + * + * @return known StatefulEngineOptionsStreamExceptionPolicy values. + */ + public static Collection values() { + return values(StatefulEngineOptionsStreamExceptionPolicy.class); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/StatefulRule.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/StatefulRule.java new file mode 100644 index 000000000000..0daa62700da4 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/StatefulRule.java @@ -0,0 +1,157 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Definition of StatefulRule. + */ +@Fluent +public final class StatefulRule implements JsonSerializable { + /* + * Property action + */ + private StatefulRuleAction action; + + /* + * Property header + */ + private Header headerProperty; + + /* + * Property ruleOptions + */ + private List ruleOptions; + + /** + * Creates an instance of StatefulRule class. + */ + public StatefulRule() { + } + + /** + * Get the action property: Property action. + * + * @return the action value. + */ + public StatefulRuleAction action() { + return this.action; + } + + /** + * Set the action property: Property action. + * + * @param action the action value to set. + * @return the StatefulRule object itself. + */ + public StatefulRule withAction(StatefulRuleAction action) { + this.action = action; + return this; + } + + /** + * Get the headerProperty property: Property header. + * + * @return the headerProperty value. + */ + public Header headerProperty() { + return this.headerProperty; + } + + /** + * Set the headerProperty property: Property header. + * + * @param headerProperty the headerProperty value to set. + * @return the StatefulRule object itself. + */ + public StatefulRule withHeaderProperty(Header headerProperty) { + this.headerProperty = headerProperty; + return this; + } + + /** + * Get the ruleOptions property: Property ruleOptions. + * + * @return the ruleOptions value. + */ + public List ruleOptions() { + return this.ruleOptions; + } + + /** + * Set the ruleOptions property: Property ruleOptions. + * + * @param ruleOptions the ruleOptions value to set. + * @return the StatefulRule object itself. + */ + public StatefulRule withRuleOptions(List ruleOptions) { + this.ruleOptions = ruleOptions; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (headerProperty() != null) { + headerProperty().validate(); + } + if (ruleOptions() != null) { + ruleOptions().forEach(e -> e.validate()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("action", this.action == null ? null : this.action.toString()); + jsonWriter.writeJsonField("header", this.headerProperty); + jsonWriter.writeArrayField("ruleOptions", this.ruleOptions, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of StatefulRule from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of StatefulRule if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the StatefulRule. + */ + public static StatefulRule fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + StatefulRule deserializedStatefulRule = new StatefulRule(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("action".equals(fieldName)) { + deserializedStatefulRule.action = StatefulRuleAction.fromString(reader.getString()); + } else if ("header".equals(fieldName)) { + deserializedStatefulRule.headerProperty = Header.fromJson(reader); + } else if ("ruleOptions".equals(fieldName)) { + List ruleOptions = reader.readArray(reader1 -> RuleOption.fromJson(reader1)); + deserializedStatefulRule.ruleOptions = ruleOptions; + } else { + reader.skipChildren(); + } + } + + return deserializedStatefulRule; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/StatefulRuleAction.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/StatefulRuleAction.java new file mode 100644 index 000000000000..40f91d8331e2 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/StatefulRuleAction.java @@ -0,0 +1,61 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * StatefulRuleAction enum. + */ +public final class StatefulRuleAction extends ExpandableStringEnum { + /** + * Static value ALERT for StatefulRuleAction. + */ + public static final StatefulRuleAction ALERT = fromString("ALERT"); + + /** + * Static value DROP for StatefulRuleAction. + */ + public static final StatefulRuleAction DROP = fromString("DROP"); + + /** + * Static value PASS for StatefulRuleAction. + */ + public static final StatefulRuleAction PASS = fromString("PASS"); + + /** + * Static value REJECT for StatefulRuleAction. + */ + public static final StatefulRuleAction REJECT = fromString("REJECT"); + + /** + * Creates a new instance of StatefulRuleAction value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public StatefulRuleAction() { + } + + /** + * Creates or finds a StatefulRuleAction from its string representation. + * + * @param name a name to look for. + * @return the corresponding StatefulRuleAction. + */ + public static StatefulRuleAction fromString(String name) { + return fromString(name, StatefulRuleAction.class); + } + + /** + * Gets known StatefulRuleAction values. + * + * @return known StatefulRuleAction values. + */ + public static Collection values() { + return values(StatefulRuleAction.class); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/StatefulRuleGroupOverride.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/StatefulRuleGroupOverride.java new file mode 100644 index 000000000000..0ed4c2954ec9 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/StatefulRuleGroupOverride.java @@ -0,0 +1,94 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of StatefulRuleGroupOverride. + */ +@Fluent +public final class StatefulRuleGroupOverride implements JsonSerializable { + /* + * Property action + */ + private StatefulRuleGroupOverrideAction action; + + /** + * Creates an instance of StatefulRuleGroupOverride class. + */ + public StatefulRuleGroupOverride() { + } + + /** + * Get the action property: Property action. + * + * @return the action value. + */ + public StatefulRuleGroupOverrideAction action() { + return this.action; + } + + /** + * Set the action property: Property action. + * + * @param action the action value to set. + * @return the StatefulRuleGroupOverride object itself. + */ + public StatefulRuleGroupOverride withAction(StatefulRuleGroupOverrideAction action) { + this.action = action; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("action", this.action == null ? null : this.action.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of StatefulRuleGroupOverride from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of StatefulRuleGroupOverride if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IOException If an error occurs while reading the StatefulRuleGroupOverride. + */ + public static StatefulRuleGroupOverride fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + StatefulRuleGroupOverride deserializedStatefulRuleGroupOverride = new StatefulRuleGroupOverride(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("action".equals(fieldName)) { + deserializedStatefulRuleGroupOverride.action + = StatefulRuleGroupOverrideAction.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedStatefulRuleGroupOverride; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/StatefulRuleGroupOverrideAction.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/StatefulRuleGroupOverrideAction.java new file mode 100644 index 000000000000..c3aa21f21eac --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/StatefulRuleGroupOverrideAction.java @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * StatefulRuleGroupOverrideAction enum. + */ +public final class StatefulRuleGroupOverrideAction extends ExpandableStringEnum { + /** + * Static value DROP_TO_ALERT for StatefulRuleGroupOverrideAction. + */ + public static final StatefulRuleGroupOverrideAction DROP_TO_ALERT = fromString("DROP_TO_ALERT"); + + /** + * Creates a new instance of StatefulRuleGroupOverrideAction value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public StatefulRuleGroupOverrideAction() { + } + + /** + * Creates or finds a StatefulRuleGroupOverrideAction from its string representation. + * + * @param name a name to look for. + * @return the corresponding StatefulRuleGroupOverrideAction. + */ + public static StatefulRuleGroupOverrideAction fromString(String name) { + return fromString(name, StatefulRuleGroupOverrideAction.class); + } + + /** + * Gets known StatefulRuleGroupOverrideAction values. + * + * @return known StatefulRuleGroupOverrideAction values. + */ + public static Collection values() { + return values(StatefulRuleGroupOverrideAction.class); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/StatefulRuleGroupReference.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/StatefulRuleGroupReference.java new file mode 100644 index 000000000000..bc9dfe9dd0ff --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/StatefulRuleGroupReference.java @@ -0,0 +1,152 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of StatefulRuleGroupReference. + */ +@Fluent +public final class StatefulRuleGroupReference implements JsonSerializable { + /* + * Property override + */ + private StatefulRuleGroupOverride override; + + /* + * Property priority + */ + private Integer priority; + + /* + * A resource ARN. + */ + private String resourceArn; + + /** + * Creates an instance of StatefulRuleGroupReference class. + */ + public StatefulRuleGroupReference() { + } + + /** + * Get the override property: Property override. + * + * @return the override value. + */ + public StatefulRuleGroupOverride override() { + return this.override; + } + + /** + * Set the override property: Property override. + * + * @param override the override value to set. + * @return the StatefulRuleGroupReference object itself. + */ + public StatefulRuleGroupReference withOverride(StatefulRuleGroupOverride override) { + this.override = override; + return this; + } + + /** + * Get the priority property: Property priority. + * + * @return the priority value. + */ + public Integer priority() { + return this.priority; + } + + /** + * Set the priority property: Property priority. + * + * @param priority the priority value to set. + * @return the StatefulRuleGroupReference object itself. + */ + public StatefulRuleGroupReference withPriority(Integer priority) { + this.priority = priority; + return this; + } + + /** + * Get the resourceArn property: A resource ARN. + * + * @return the resourceArn value. + */ + public String resourceArn() { + return this.resourceArn; + } + + /** + * Set the resourceArn property: A resource ARN. + * + * @param resourceArn the resourceArn value to set. + * @return the StatefulRuleGroupReference object itself. + */ + public StatefulRuleGroupReference withResourceArn(String resourceArn) { + this.resourceArn = resourceArn; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (override() != null) { + override().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("override", this.override); + jsonWriter.writeNumberField("priority", this.priority); + jsonWriter.writeStringField("resourceArn", this.resourceArn); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of StatefulRuleGroupReference from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of StatefulRuleGroupReference if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IOException If an error occurs while reading the StatefulRuleGroupReference. + */ + public static StatefulRuleGroupReference fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + StatefulRuleGroupReference deserializedStatefulRuleGroupReference = new StatefulRuleGroupReference(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("override".equals(fieldName)) { + deserializedStatefulRuleGroupReference.override = StatefulRuleGroupOverride.fromJson(reader); + } else if ("priority".equals(fieldName)) { + deserializedStatefulRuleGroupReference.priority = reader.getNullable(JsonReader::getInt); + } else if ("resourceArn".equals(fieldName)) { + deserializedStatefulRuleGroupReference.resourceArn = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedStatefulRuleGroupReference; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/StatefulRuleOptions.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/StatefulRuleOptions.java new file mode 100644 index 000000000000..5b1ef9d6fcd3 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/StatefulRuleOptions.java @@ -0,0 +1,94 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of StatefulRuleOptions. + */ +@Fluent +public final class StatefulRuleOptions implements JsonSerializable { + /* + * Property ruleOrder + */ + private StatefulRuleOptionsRuleOrder ruleOrder; + + /** + * Creates an instance of StatefulRuleOptions class. + */ + public StatefulRuleOptions() { + } + + /** + * Get the ruleOrder property: Property ruleOrder. + * + * @return the ruleOrder value. + */ + public StatefulRuleOptionsRuleOrder ruleOrder() { + return this.ruleOrder; + } + + /** + * Set the ruleOrder property: Property ruleOrder. + * + * @param ruleOrder the ruleOrder value to set. + * @return the StatefulRuleOptions object itself. + */ + public StatefulRuleOptions withRuleOrder(StatefulRuleOptionsRuleOrder ruleOrder) { + this.ruleOrder = ruleOrder; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("ruleOrder", this.ruleOrder == null ? null : this.ruleOrder.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of StatefulRuleOptions from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of StatefulRuleOptions if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the StatefulRuleOptions. + */ + public static StatefulRuleOptions fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + StatefulRuleOptions deserializedStatefulRuleOptions = new StatefulRuleOptions(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("ruleOrder".equals(fieldName)) { + deserializedStatefulRuleOptions.ruleOrder + = StatefulRuleOptionsRuleOrder.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedStatefulRuleOptions; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/StatefulRuleOptionsRuleOrder.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/StatefulRuleOptionsRuleOrder.java new file mode 100644 index 000000000000..d443c1f6c7b4 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/StatefulRuleOptionsRuleOrder.java @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * StatefulRuleOptionsRuleOrder enum. + */ +public final class StatefulRuleOptionsRuleOrder extends ExpandableStringEnum { + /** + * Static value DEFAULT_ACTION_ORDER for StatefulRuleOptionsRuleOrder. + */ + public static final StatefulRuleOptionsRuleOrder DEFAULT_ACTION_ORDER = fromString("DEFAULT_ACTION_ORDER"); + + /** + * Static value STRICT_ORDER for StatefulRuleOptionsRuleOrder. + */ + public static final StatefulRuleOptionsRuleOrder STRICT_ORDER = fromString("STRICT_ORDER"); + + /** + * Creates a new instance of StatefulRuleOptionsRuleOrder value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public StatefulRuleOptionsRuleOrder() { + } + + /** + * Creates or finds a StatefulRuleOptionsRuleOrder from its string representation. + * + * @param name a name to look for. + * @return the corresponding StatefulRuleOptionsRuleOrder. + */ + public static StatefulRuleOptionsRuleOrder fromString(String name) { + return fromString(name, StatefulRuleOptionsRuleOrder.class); + } + + /** + * Gets known StatefulRuleOptionsRuleOrder values. + * + * @return known StatefulRuleOptionsRuleOrder values. + */ + public static Collection values() { + return values(StatefulRuleOptionsRuleOrder.class); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/StatelessRule.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/StatelessRule.java new file mode 100644 index 000000000000..56a806400f89 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/StatelessRule.java @@ -0,0 +1,124 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of StatelessRule. + */ +@Fluent +public final class StatelessRule implements JsonSerializable { + /* + * Property priority + */ + private Integer priority; + + /* + * Property ruleDefinition + */ + private RuleDefinition ruleDefinition; + + /** + * Creates an instance of StatelessRule class. + */ + public StatelessRule() { + } + + /** + * Get the priority property: Property priority. + * + * @return the priority value. + */ + public Integer priority() { + return this.priority; + } + + /** + * Set the priority property: Property priority. + * + * @param priority the priority value to set. + * @return the StatelessRule object itself. + */ + public StatelessRule withPriority(Integer priority) { + this.priority = priority; + return this; + } + + /** + * Get the ruleDefinition property: Property ruleDefinition. + * + * @return the ruleDefinition value. + */ + public RuleDefinition ruleDefinition() { + return this.ruleDefinition; + } + + /** + * Set the ruleDefinition property: Property ruleDefinition. + * + * @param ruleDefinition the ruleDefinition value to set. + * @return the StatelessRule object itself. + */ + public StatelessRule withRuleDefinition(RuleDefinition ruleDefinition) { + this.ruleDefinition = ruleDefinition; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (ruleDefinition() != null) { + ruleDefinition().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeNumberField("priority", this.priority); + jsonWriter.writeJsonField("ruleDefinition", this.ruleDefinition); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of StatelessRule from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of StatelessRule if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the StatelessRule. + */ + public static StatelessRule fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + StatelessRule deserializedStatelessRule = new StatelessRule(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("priority".equals(fieldName)) { + deserializedStatelessRule.priority = reader.getNullable(JsonReader::getInt); + } else if ("ruleDefinition".equals(fieldName)) { + deserializedStatelessRule.ruleDefinition = RuleDefinition.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedStatelessRule; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/StatelessRuleGroupReference.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/StatelessRuleGroupReference.java new file mode 100644 index 000000000000..c30a4edd35cb --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/StatelessRuleGroupReference.java @@ -0,0 +1,121 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of StatelessRuleGroupReference. + */ +@Fluent +public final class StatelessRuleGroupReference implements JsonSerializable { + /* + * Property priority + */ + private Integer priority; + + /* + * A resource ARN. + */ + private String resourceArn; + + /** + * Creates an instance of StatelessRuleGroupReference class. + */ + public StatelessRuleGroupReference() { + } + + /** + * Get the priority property: Property priority. + * + * @return the priority value. + */ + public Integer priority() { + return this.priority; + } + + /** + * Set the priority property: Property priority. + * + * @param priority the priority value to set. + * @return the StatelessRuleGroupReference object itself. + */ + public StatelessRuleGroupReference withPriority(Integer priority) { + this.priority = priority; + return this; + } + + /** + * Get the resourceArn property: A resource ARN. + * + * @return the resourceArn value. + */ + public String resourceArn() { + return this.resourceArn; + } + + /** + * Set the resourceArn property: A resource ARN. + * + * @param resourceArn the resourceArn value to set. + * @return the StatelessRuleGroupReference object itself. + */ + public StatelessRuleGroupReference withResourceArn(String resourceArn) { + this.resourceArn = resourceArn; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeNumberField("priority", this.priority); + jsonWriter.writeStringField("resourceArn", this.resourceArn); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of StatelessRuleGroupReference from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of StatelessRuleGroupReference if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the StatelessRuleGroupReference. + */ + public static StatelessRuleGroupReference fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + StatelessRuleGroupReference deserializedStatelessRuleGroupReference = new StatelessRuleGroupReference(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("priority".equals(fieldName)) { + deserializedStatelessRuleGroupReference.priority = reader.getNullable(JsonReader::getInt); + } else if ("resourceArn".equals(fieldName)) { + deserializedStatelessRuleGroupReference.resourceArn = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedStatelessRuleGroupReference; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/StatelessRulesAndCustomActions.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/StatelessRulesAndCustomActions.java new file mode 100644 index 000000000000..cf20d2b3fd45 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/StatelessRulesAndCustomActions.java @@ -0,0 +1,133 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Definition of StatelessRulesAndCustomActions. + */ +@Fluent +public final class StatelessRulesAndCustomActions implements JsonSerializable { + /* + * Property customActions + */ + private List customActions; + + /* + * Property statelessRules + */ + private List statelessRules; + + /** + * Creates an instance of StatelessRulesAndCustomActions class. + */ + public StatelessRulesAndCustomActions() { + } + + /** + * Get the customActions property: Property customActions. + * + * @return the customActions value. + */ + public List customActions() { + return this.customActions; + } + + /** + * Set the customActions property: Property customActions. + * + * @param customActions the customActions value to set. + * @return the StatelessRulesAndCustomActions object itself. + */ + public StatelessRulesAndCustomActions withCustomActions(List customActions) { + this.customActions = customActions; + return this; + } + + /** + * Get the statelessRules property: Property statelessRules. + * + * @return the statelessRules value. + */ + public List statelessRules() { + return this.statelessRules; + } + + /** + * Set the statelessRules property: Property statelessRules. + * + * @param statelessRules the statelessRules value to set. + * @return the StatelessRulesAndCustomActions object itself. + */ + public StatelessRulesAndCustomActions withStatelessRules(List statelessRules) { + this.statelessRules = statelessRules; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (customActions() != null) { + customActions().forEach(e -> e.validate()); + } + if (statelessRules() != null) { + statelessRules().forEach(e -> e.validate()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("customActions", this.customActions, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("statelessRules", this.statelessRules, + (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of StatelessRulesAndCustomActions from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of StatelessRulesAndCustomActions if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the StatelessRulesAndCustomActions. + */ + public static StatelessRulesAndCustomActions fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + StatelessRulesAndCustomActions deserializedStatelessRulesAndCustomActions + = new StatelessRulesAndCustomActions(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("customActions".equals(fieldName)) { + List customActions + = reader.readArray(reader1 -> CustomActionAutoGenerated.fromJson(reader1)); + deserializedStatelessRulesAndCustomActions.customActions = customActions; + } else if ("statelessRules".equals(fieldName)) { + List statelessRules = reader.readArray(reader1 -> StatelessRule.fromJson(reader1)); + deserializedStatelessRulesAndCustomActions.statelessRules = statelessRules; + } else { + reader.skipChildren(); + } + } + + return deserializedStatelessRulesAndCustomActions; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/Status.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/Status.java new file mode 100644 index 000000000000..f08fc85c7d71 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/Status.java @@ -0,0 +1,81 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Status enum. + */ +public final class Status extends ExpandableStringEnum { + /** + * Static value OK for Status. + */ + public static final Status OK = fromString("OK"); + + /** + * Static value S3_OBJECT_ACCESS_DENIED for Status. + */ + public static final Status S3_OBJECT_ACCESS_DENIED = fromString("S3_OBJECT_ACCESS_DENIED"); + + /** + * Static value S3_OBJECT_EMPTY for Status. + */ + public static final Status S3_OBJECT_EMPTY = fromString("S3_OBJECT_EMPTY"); + + /** + * Static value S3_OBJECT_NOT_FOUND for Status. + */ + public static final Status S3_OBJECT_NOT_FOUND = fromString("S3_OBJECT_NOT_FOUND"); + + /** + * Static value S3_OBJECT_OVERSIZE for Status. + */ + public static final Status S3_OBJECT_OVERSIZE = fromString("S3_OBJECT_OVERSIZE"); + + /** + * Static value S3_THROTTLED for Status. + */ + public static final Status S3_THROTTLED = fromString("S3_THROTTLED"); + + /** + * Static value S3_USER_ACCESS_DENIED for Status. + */ + public static final Status S3_USER_ACCESS_DENIED = fromString("S3_USER_ACCESS_DENIED"); + + /** + * Static value UNKNOWN_ERROR for Status. + */ + public static final Status UNKNOWN_ERROR = fromString("UNKNOWN_ERROR"); + + /** + * Creates a new instance of Status value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public Status() { + } + + /** + * Creates or finds a Status from its string representation. + * + * @param name a name to look for. + * @return the corresponding Status. + */ + public static Status fromString(String name) { + return fromString(name, Status.class); + } + + /** + * Gets known Status values. + * + * @return known Status values. + */ + public static Collection values() { + return values(Status.class); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/StatusCodes.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/StatusCodes.java new file mode 100644 index 000000000000..c6903ab5e343 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/StatusCodes.java @@ -0,0 +1,123 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Definition of StatusCodes. + */ +@Fluent +public final class StatusCodes implements JsonSerializable { + /* + * The items (status codes) for an origin group. + */ + private List items; + + /* + * The number of status codes. + */ + private Integer quantity; + + /** + * Creates an instance of StatusCodes class. + */ + public StatusCodes() { + } + + /** + * Get the items property: The items (status codes) for an origin group. + * + * @return the items value. + */ + public List items() { + return this.items; + } + + /** + * Set the items property: The items (status codes) for an origin group. + * + * @param items the items value to set. + * @return the StatusCodes object itself. + */ + public StatusCodes withItems(List items) { + this.items = items; + return this; + } + + /** + * Get the quantity property: The number of status codes. + * + * @return the quantity value. + */ + public Integer quantity() { + return this.quantity; + } + + /** + * Set the quantity property: The number of status codes. + * + * @param quantity the quantity value to set. + * @return the StatusCodes object itself. + */ + public StatusCodes withQuantity(Integer quantity) { + this.quantity = quantity; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("items", this.items, (writer, element) -> writer.writeInt(element)); + jsonWriter.writeNumberField("quantity", this.quantity); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of StatusCodes from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of StatusCodes if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the StatusCodes. + */ + public static StatusCodes fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + StatusCodes deserializedStatusCodes = new StatusCodes(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("items".equals(fieldName)) { + List items = reader.readArray(reader1 -> reader1.getInt()); + deserializedStatusCodes.items = items; + } else if ("quantity".equals(fieldName)) { + deserializedStatusCodes.quantity = reader.getNullable(JsonReader::getInt); + } else { + reader.skipChildren(); + } + } + + return deserializedStatusCodes; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/StatusName.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/StatusName.java new file mode 100644 index 000000000000..48e891adccb8 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/StatusName.java @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * StatusName enum. + */ +public final class StatusName extends ExpandableStringEnum { + /** + * Static value reachability for StatusName. + */ + public static final StatusName REACHABILITY = fromString("reachability"); + + /** + * Creates a new instance of StatusName value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public StatusName() { + } + + /** + * Creates or finds a StatusName from its string representation. + * + * @param name a name to look for. + * @return the corresponding StatusName. + */ + public static StatusName fromString(String name) { + return fromString(name, StatusName.class); + } + + /** + * Gets known StatusName values. + * + * @return known StatusName values. + */ + public static Collection values() { + return values(StatusName.class); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/StatusNameEnumValue.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/StatusNameEnumValue.java new file mode 100644 index 000000000000..d680495b0388 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/StatusNameEnumValue.java @@ -0,0 +1,93 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of StatusNameEnumValue. + */ +@Fluent +public final class StatusNameEnumValue implements JsonSerializable { + /* + * Property value + */ + private StatusName value; + + /** + * Creates an instance of StatusNameEnumValue class. + */ + public StatusNameEnumValue() { + } + + /** + * Get the value property: Property value. + * + * @return the value value. + */ + public StatusName value() { + return this.value; + } + + /** + * Set the value property: Property value. + * + * @param value the value value to set. + * @return the StatusNameEnumValue object itself. + */ + public StatusNameEnumValue withValue(StatusName value) { + this.value = value; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("value", this.value == null ? null : this.value.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of StatusNameEnumValue from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of StatusNameEnumValue if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the StatusNameEnumValue. + */ + public static StatusNameEnumValue fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + StatusNameEnumValue deserializedStatusNameEnumValue = new StatusNameEnumValue(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + deserializedStatusNameEnumValue.value = StatusName.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedStatusNameEnumValue; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/StatusType.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/StatusType.java new file mode 100644 index 000000000000..ce0496fc3099 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/StatusType.java @@ -0,0 +1,61 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * StatusType enum. + */ +public final class StatusType extends ExpandableStringEnum { + /** + * Static value failed for StatusType. + */ + public static final StatusType FAILED = fromString("failed"); + + /** + * Static value initializing for StatusType. + */ + public static final StatusType INITIALIZING = fromString("initializing"); + + /** + * Static value insufficient-data for StatusType. + */ + public static final StatusType INSUFFICIENT_DATA = fromString("insufficient-data"); + + /** + * Static value passed for StatusType. + */ + public static final StatusType PASSED = fromString("passed"); + + /** + * Creates a new instance of StatusType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public StatusType() { + } + + /** + * Creates or finds a StatusType from its string representation. + * + * @param name a name to look for. + * @return the corresponding StatusType. + */ + public static StatusType fromString(String name) { + return fromString(name, StatusType.class); + } + + /** + * Gets known StatusType values. + * + * @return known StatusType values. + */ + public static Collection values() { + return values(StatusType.class); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/StatusTypeEnumValue.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/StatusTypeEnumValue.java new file mode 100644 index 000000000000..f33466c3451c --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/StatusTypeEnumValue.java @@ -0,0 +1,93 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of StatusTypeEnumValue. + */ +@Fluent +public final class StatusTypeEnumValue implements JsonSerializable { + /* + * Property value + */ + private StatusType value; + + /** + * Creates an instance of StatusTypeEnumValue class. + */ + public StatusTypeEnumValue() { + } + + /** + * Get the value property: Property value. + * + * @return the value value. + */ + public StatusType value() { + return this.value; + } + + /** + * Set the value property: Property value. + * + * @param value the value value to set. + * @return the StatusTypeEnumValue object itself. + */ + public StatusTypeEnumValue withValue(StatusType value) { + this.value = value; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("value", this.value == null ? null : this.value.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of StatusTypeEnumValue from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of StatusTypeEnumValue if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the StatusTypeEnumValue. + */ + public static StatusTypeEnumValue fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + StatusTypeEnumValue deserializedStatusTypeEnumValue = new StatusTypeEnumValue(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + deserializedStatusTypeEnumValue.value = StatusType.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedStatusTypeEnumValue; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/StatusTypeEnumValueAutoGenerated.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/StatusTypeEnumValueAutoGenerated.java new file mode 100644 index 000000000000..894f7a9b5d78 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/StatusTypeEnumValueAutoGenerated.java @@ -0,0 +1,94 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of statusTypeEnumValue. + */ +@Fluent +public final class StatusTypeEnumValueAutoGenerated implements JsonSerializable { + /* + * Property value + */ + private StatusType value; + + /** + * Creates an instance of StatusTypeEnumValueAutoGenerated class. + */ + public StatusTypeEnumValueAutoGenerated() { + } + + /** + * Get the value property: Property value. + * + * @return the value value. + */ + public StatusType value() { + return this.value; + } + + /** + * Set the value property: Property value. + * + * @param value the value value to set. + * @return the StatusTypeEnumValueAutoGenerated object itself. + */ + public StatusTypeEnumValueAutoGenerated withValue(StatusType value) { + this.value = value; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("value", this.value == null ? null : this.value.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of StatusTypeEnumValueAutoGenerated from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of StatusTypeEnumValueAutoGenerated if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the StatusTypeEnumValueAutoGenerated. + */ + public static StatusTypeEnumValueAutoGenerated fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + StatusTypeEnumValueAutoGenerated deserializedStatusTypeEnumValueAutoGenerated + = new StatusTypeEnumValueAutoGenerated(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + deserializedStatusTypeEnumValueAutoGenerated.value = StatusType.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedStatusTypeEnumValueAutoGenerated; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/StopEc2InstanceOptions.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/StopEc2InstanceOptions.java new file mode 100644 index 000000000000..95cc4d0afef5 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/StopEc2InstanceOptions.java @@ -0,0 +1,130 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Defines the stop action properties. + */ +@Fluent +public final class StopEc2InstanceOptions implements JsonSerializable { + /* + * Forces the instance to stop. The instance does not have an opportunity to flush file system caches or file system + * metadata. If you use this option, you must perform file system check and repair procedures. This option is not + * recommended for Windows instances. Defaults to false. + */ + private Boolean force; + + /* + * Hibernates the instance if the instance was enabled for hibernation at launch. If the instance cannot hibernate + * successfully, a normal shutdown occurs. Defaults to false. + */ + private Boolean hibernate; + + /** + * Creates an instance of StopEc2InstanceOptions class. + */ + public StopEc2InstanceOptions() { + } + + /** + * Get the force property: Forces the instance to stop. The instance does not have an opportunity to flush file + * system caches or file system metadata. If you use this option, you must perform file system check and repair + * procedures. This option is not recommended for Windows instances. Defaults to false. + * + * @return the force value. + */ + public Boolean force() { + return this.force; + } + + /** + * Set the force property: Forces the instance to stop. The instance does not have an opportunity to flush file + * system caches or file system metadata. If you use this option, you must perform file system check and repair + * procedures. This option is not recommended for Windows instances. Defaults to false. + * + * @param force the force value to set. + * @return the StopEc2InstanceOptions object itself. + */ + public StopEc2InstanceOptions withForce(Boolean force) { + this.force = force; + return this; + } + + /** + * Get the hibernate property: Hibernates the instance if the instance was enabled for hibernation at launch. If the + * instance cannot hibernate successfully, a normal shutdown occurs. Defaults to false. + * + * @return the hibernate value. + */ + public Boolean hibernate() { + return this.hibernate; + } + + /** + * Set the hibernate property: Hibernates the instance if the instance was enabled for hibernation at launch. If the + * instance cannot hibernate successfully, a normal shutdown occurs. Defaults to false. + * + * @param hibernate the hibernate value to set. + * @return the StopEc2InstanceOptions object itself. + */ + public StopEc2InstanceOptions withHibernate(Boolean hibernate) { + this.hibernate = hibernate; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeBooleanField("force", this.force); + jsonWriter.writeBooleanField("hibernate", this.hibernate); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of StopEc2InstanceOptions from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of StopEc2InstanceOptions if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the StopEc2InstanceOptions. + */ + public static StopEc2InstanceOptions fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + StopEc2InstanceOptions deserializedStopEc2InstanceOptions = new StopEc2InstanceOptions(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("force".equals(fieldName)) { + deserializedStopEc2InstanceOptions.force = reader.getNullable(JsonReader::getBoolean); + } else if ("hibernate".equals(fieldName)) { + deserializedStopEc2InstanceOptions.hibernate = reader.getNullable(JsonReader::getBoolean); + } else { + reader.skipChildren(); + } + } + + return deserializedStopEc2InstanceOptions; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/StorageClassAnalysis.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/StorageClassAnalysis.java new file mode 100644 index 000000000000..32de19e89175 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/StorageClassAnalysis.java @@ -0,0 +1,101 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of StorageClassAnalysis. + */ +@Fluent +public final class StorageClassAnalysis implements JsonSerializable { + /* + * Specifies how data related to the storage class analysis for an Amazon S3 bucket should be exported. Specifies + * how data related to the storage class analysis for an Amazon S3 bucket should be exported. + */ + private DataExport dataExport; + + /** + * Creates an instance of StorageClassAnalysis class. + */ + public StorageClassAnalysis() { + } + + /** + * Get the dataExport property: Specifies how data related to the storage class analysis for an Amazon S3 bucket + * should be exported. Specifies how data related to the storage class analysis for an Amazon S3 bucket should be + * exported. + * + * @return the dataExport value. + */ + public DataExport dataExport() { + return this.dataExport; + } + + /** + * Set the dataExport property: Specifies how data related to the storage class analysis for an Amazon S3 bucket + * should be exported. Specifies how data related to the storage class analysis for an Amazon S3 bucket should be + * exported. + * + * @param dataExport the dataExport value to set. + * @return the StorageClassAnalysis object itself. + */ + public StorageClassAnalysis withDataExport(DataExport dataExport) { + this.dataExport = dataExport; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (dataExport() != null) { + dataExport().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("dataExport", this.dataExport); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of StorageClassAnalysis from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of StorageClassAnalysis if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the StorageClassAnalysis. + */ + public static StorageClassAnalysis fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + StorageClassAnalysis deserializedStorageClassAnalysis = new StorageClassAnalysis(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("dataExport".equals(fieldName)) { + deserializedStorageClassAnalysis.dataExport = DataExport.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedStorageClassAnalysis; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/StorageTier.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/StorageTier.java new file mode 100644 index 000000000000..68a89465e4d8 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/StorageTier.java @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * StorageTier enum. + */ +public final class StorageTier extends ExpandableStringEnum { + /** + * Static value archive for StorageTier. + */ + public static final StorageTier ARCHIVE = fromString("archive"); + + /** + * Static value standard for StorageTier. + */ + public static final StorageTier STANDARD = fromString("standard"); + + /** + * Creates a new instance of StorageTier value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public StorageTier() { + } + + /** + * Creates or finds a StorageTier from its string representation. + * + * @param name a name to look for. + * @return the corresponding StorageTier. + */ + public static StorageTier fromString(String name) { + return fromString(name, StorageTier.class); + } + + /** + * Gets known StorageTier values. + * + * @return known StorageTier values. + */ + public static Collection values() { + return values(StorageTier.class); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/StorageTierEnumValue.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/StorageTierEnumValue.java new file mode 100644 index 000000000000..2a61d3c56fbe --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/StorageTierEnumValue.java @@ -0,0 +1,93 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of StorageTierEnumValue. + */ +@Fluent +public final class StorageTierEnumValue implements JsonSerializable { + /* + * Property value + */ + private StorageTier value; + + /** + * Creates an instance of StorageTierEnumValue class. + */ + public StorageTierEnumValue() { + } + + /** + * Get the value property: Property value. + * + * @return the value value. + */ + public StorageTier value() { + return this.value; + } + + /** + * Set the value property: Property value. + * + * @param value the value value to set. + * @return the StorageTierEnumValue object itself. + */ + public StorageTierEnumValue withValue(StorageTier value) { + this.value = value; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("value", this.value == null ? null : this.value.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of StorageTierEnumValue from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of StorageTierEnumValue if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the StorageTierEnumValue. + */ + public static StorageTierEnumValue fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + StorageTierEnumValue deserializedStorageTierEnumValue = new StorageTierEnumValue(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + deserializedStorageTierEnumValue.value = StorageTier.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedStorageTierEnumValue; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/StreamSpecification.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/StreamSpecification.java new file mode 100644 index 000000000000..5a9dc7adccb3 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/StreamSpecification.java @@ -0,0 +1,231 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of StreamSpecification. + */ +@Fluent +public final class StreamSpecification implements JsonSerializable { + /* + * Creates or updates a resource-based policy document that contains the permissions for DDB resources, such as a + * table's streams. Resource-based policies let you define access permissions by specifying who has access to each + * resource, and the actions they are allowed to perform on each resource. In a CFNshort template, you can provide + * the policy in JSON or YAML format because CFNshort converts YAML to JSON before submitting it to DDB. For more + * information about resource-based policies, see [Using resource-based policies + * for](https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/access-control-resource-based.html) and + * [Resource-based policy + * examples](https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/rbac-examples.html). Creates or + * updates a resource-based policy document that contains the permissions for DDB resources, such as a table, its + * indexes, and stream. Resource-based policies let you define access permissions by specifying who has access to + * each resource, and the actions they are allowed to perform on each resource. In a CFNshort template, you can + * provide the policy in JSON or YAML format because CFNshort converts YAML to JSON before submitting it to DDB. For + * more information about resource-based policies, see [Using resource-based policies + * for](https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/access-control-resource-based.html) and + * [Resource-based policy + * examples](https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/rbac-examples.html). While defining + * resource-based policies in your CFNshort templates, the following considerations apply: + The maximum size + * supported for a resource-based policy document in JSON format is 20 KB. DDB counts whitespaces when calculating + * the size of a policy against this limit. + Resource-based policies don't support [drift + * detection](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-stack-drift.html#). If you + * update a policy outside of the CFNshort stack template, you'll need to update the CFNshort stack with the + * changes. + Resource-based policies don't support out-of-band changes. If you add, update, or delete a policy + * outside of the CFNshort template, the change won't be overwritten if there are no changes to the policy within + * the template. For example, say that your template contains a resource-based policy, which you later update + * outside of the template. If you don't make any changes to the policy in the template, the updated policy in DDB + * won’t be synced with the policy in the template. Conversely, say that your template doesn’t contain a + * resource-based policy, but you add a policy outside of the template. This policy won’t be removed from DDB as + * long as you don’t add it to the template. When you add a policy to the template and update the stack, the + * existing policy in DDB will be updated to match the one defined in the template. For a full list of all + * considerations, see [Resource-based policy + * considerations](https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/rbac-considerations.html). + */ + private ResourcePolicy resourcePolicy; + + /* + * When an item in the table is modified, ``StreamViewType`` determines what information is written to the stream + * for this table. Valid values for ``StreamViewType`` are: + ``KEYS_ONLY`` - Only the key attributes of the + * modified item are written to the stream. + ``NEW_IMAGE`` - The entire item, as it appears after it was modified, + * is written to the stream. + ``OLD_IMAGE`` - The entire item, as it appeared before it was modified, is written to + * the stream. + ``NEW_AND_OLD_IMAGES`` - Both the new and the old item images of the item are written to the + * stream. + */ + private String streamViewType; + + /** + * Creates an instance of StreamSpecification class. + */ + public StreamSpecification() { + } + + /** + * Get the resourcePolicy property: Creates or updates a resource-based policy document that contains the + * permissions for DDB resources, such as a table's streams. Resource-based policies let you define access + * permissions by specifying who has access to each resource, and the actions they are allowed to perform on each + * resource. In a CFNshort template, you can provide the policy in JSON or YAML format because CFNshort converts + * YAML to JSON before submitting it to DDB. For more information about resource-based policies, see [Using + * resource-based policies + * for](https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/access-control-resource-based.html) and + * [Resource-based policy + * examples](https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/rbac-examples.html). Creates or + * updates a resource-based policy document that contains the permissions for DDB resources, such as a table, its + * indexes, and stream. Resource-based policies let you define access permissions by specifying who has access to + * each resource, and the actions they are allowed to perform on each resource. In a CFNshort template, you can + * provide the policy in JSON or YAML format because CFNshort converts YAML to JSON before submitting it to DDB. For + * more information about resource-based policies, see [Using resource-based policies + * for](https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/access-control-resource-based.html) and + * [Resource-based policy + * examples](https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/rbac-examples.html). While defining + * resource-based policies in your CFNshort templates, the following considerations apply: + The maximum size + * supported for a resource-based policy document in JSON format is 20 KB. DDB counts whitespaces when calculating + * the size of a policy against this limit. + Resource-based policies don't support [drift + * detection](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-stack-drift.html#). If you + * update a policy outside of the CFNshort stack template, you'll need to update the CFNshort stack with the + * changes. + Resource-based policies don't support out-of-band changes. If you add, update, or delete a policy + * outside of the CFNshort template, the change won't be overwritten if there are no changes to the policy within + * the template. For example, say that your template contains a resource-based policy, which you later update + * outside of the template. If you don't make any changes to the policy in the template, the updated policy in DDB + * won’t be synced with the policy in the template. Conversely, say that your template doesn’t contain a + * resource-based policy, but you add a policy outside of the template. This policy won’t be removed from DDB as + * long as you don’t add it to the template. When you add a policy to the template and update the stack, the + * existing policy in DDB will be updated to match the one defined in the template. For a full list of all + * considerations, see [Resource-based policy + * considerations](https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/rbac-considerations.html). + * + * @return the resourcePolicy value. + */ + public ResourcePolicy resourcePolicy() { + return this.resourcePolicy; + } + + /** + * Set the resourcePolicy property: Creates or updates a resource-based policy document that contains the + * permissions for DDB resources, such as a table's streams. Resource-based policies let you define access + * permissions by specifying who has access to each resource, and the actions they are allowed to perform on each + * resource. In a CFNshort template, you can provide the policy in JSON or YAML format because CFNshort converts + * YAML to JSON before submitting it to DDB. For more information about resource-based policies, see [Using + * resource-based policies + * for](https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/access-control-resource-based.html) and + * [Resource-based policy + * examples](https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/rbac-examples.html). Creates or + * updates a resource-based policy document that contains the permissions for DDB resources, such as a table, its + * indexes, and stream. Resource-based policies let you define access permissions by specifying who has access to + * each resource, and the actions they are allowed to perform on each resource. In a CFNshort template, you can + * provide the policy in JSON or YAML format because CFNshort converts YAML to JSON before submitting it to DDB. For + * more information about resource-based policies, see [Using resource-based policies + * for](https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/access-control-resource-based.html) and + * [Resource-based policy + * examples](https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/rbac-examples.html). While defining + * resource-based policies in your CFNshort templates, the following considerations apply: + The maximum size + * supported for a resource-based policy document in JSON format is 20 KB. DDB counts whitespaces when calculating + * the size of a policy against this limit. + Resource-based policies don't support [drift + * detection](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-stack-drift.html#). If you + * update a policy outside of the CFNshort stack template, you'll need to update the CFNshort stack with the + * changes. + Resource-based policies don't support out-of-band changes. If you add, update, or delete a policy + * outside of the CFNshort template, the change won't be overwritten if there are no changes to the policy within + * the template. For example, say that your template contains a resource-based policy, which you later update + * outside of the template. If you don't make any changes to the policy in the template, the updated policy in DDB + * won’t be synced with the policy in the template. Conversely, say that your template doesn’t contain a + * resource-based policy, but you add a policy outside of the template. This policy won’t be removed from DDB as + * long as you don’t add it to the template. When you add a policy to the template and update the stack, the + * existing policy in DDB will be updated to match the one defined in the template. For a full list of all + * considerations, see [Resource-based policy + * considerations](https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/rbac-considerations.html). + * + * @param resourcePolicy the resourcePolicy value to set. + * @return the StreamSpecification object itself. + */ + public StreamSpecification withResourcePolicy(ResourcePolicy resourcePolicy) { + this.resourcePolicy = resourcePolicy; + return this; + } + + /** + * Get the streamViewType property: When an item in the table is modified, ``StreamViewType`` determines what + * information is written to the stream for this table. Valid values for ``StreamViewType`` are: + ``KEYS_ONLY`` - + * Only the key attributes of the modified item are written to the stream. + ``NEW_IMAGE`` - The entire item, as it + * appears after it was modified, is written to the stream. + ``OLD_IMAGE`` - The entire item, as it appeared before + * it was modified, is written to the stream. + ``NEW_AND_OLD_IMAGES`` - Both the new and the old item images of the + * item are written to the stream. + * + * @return the streamViewType value. + */ + public String streamViewType() { + return this.streamViewType; + } + + /** + * Set the streamViewType property: When an item in the table is modified, ``StreamViewType`` determines what + * information is written to the stream for this table. Valid values for ``StreamViewType`` are: + ``KEYS_ONLY`` - + * Only the key attributes of the modified item are written to the stream. + ``NEW_IMAGE`` - The entire item, as it + * appears after it was modified, is written to the stream. + ``OLD_IMAGE`` - The entire item, as it appeared before + * it was modified, is written to the stream. + ``NEW_AND_OLD_IMAGES`` - Both the new and the old item images of the + * item are written to the stream. + * + * @param streamViewType the streamViewType value to set. + * @return the StreamSpecification object itself. + */ + public StreamSpecification withStreamViewType(String streamViewType) { + this.streamViewType = streamViewType; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (resourcePolicy() != null) { + resourcePolicy().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("resourcePolicy", this.resourcePolicy); + jsonWriter.writeStringField("streamViewType", this.streamViewType); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of StreamSpecification from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of StreamSpecification if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the StreamSpecification. + */ + public static StreamSpecification fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + StreamSpecification deserializedStreamSpecification = new StreamSpecification(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("resourcePolicy".equals(fieldName)) { + deserializedStreamSpecification.resourcePolicy = ResourcePolicy.fromJson(reader); + } else if ("streamViewType".equals(fieldName)) { + deserializedStreamSpecification.streamViewType = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedStreamSpecification; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/Subnet.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/Subnet.java new file mode 100644 index 000000000000..8c0002e8915f --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/Subnet.java @@ -0,0 +1,152 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of Subnet. + */ +@Fluent +public final class Subnet implements JsonSerializable { + /* + *

The Availability Zone of the subnet.

+ */ + private AvailabilityZone subnetAvailabilityZone; + + /* + *

The subnet identifier.

+ */ + private String subnetIdentifier; + + /* + *

The status of the subnet.

+ */ + private String subnetStatus; + + /** + * Creates an instance of Subnet class. + */ + public Subnet() { + } + + /** + * Get the subnetAvailabilityZone property: <p>The Availability Zone of the subnet.</p>. + * + * @return the subnetAvailabilityZone value. + */ + public AvailabilityZone subnetAvailabilityZone() { + return this.subnetAvailabilityZone; + } + + /** + * Set the subnetAvailabilityZone property: <p>The Availability Zone of the subnet.</p>. + * + * @param subnetAvailabilityZone the subnetAvailabilityZone value to set. + * @return the Subnet object itself. + */ + public Subnet withSubnetAvailabilityZone(AvailabilityZone subnetAvailabilityZone) { + this.subnetAvailabilityZone = subnetAvailabilityZone; + return this; + } + + /** + * Get the subnetIdentifier property: <p>The subnet identifier.</p>. + * + * @return the subnetIdentifier value. + */ + public String subnetIdentifier() { + return this.subnetIdentifier; + } + + /** + * Set the subnetIdentifier property: <p>The subnet identifier.</p>. + * + * @param subnetIdentifier the subnetIdentifier value to set. + * @return the Subnet object itself. + */ + public Subnet withSubnetIdentifier(String subnetIdentifier) { + this.subnetIdentifier = subnetIdentifier; + return this; + } + + /** + * Get the subnetStatus property: <p>The status of the subnet.</p>. + * + * @return the subnetStatus value. + */ + public String subnetStatus() { + return this.subnetStatus; + } + + /** + * Set the subnetStatus property: <p>The status of the subnet.</p>. + * + * @param subnetStatus the subnetStatus value to set. + * @return the Subnet object itself. + */ + public Subnet withSubnetStatus(String subnetStatus) { + this.subnetStatus = subnetStatus; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (subnetAvailabilityZone() != null) { + subnetAvailabilityZone().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("subnetAvailabilityZone", this.subnetAvailabilityZone); + jsonWriter.writeStringField("subnetIdentifier", this.subnetIdentifier); + jsonWriter.writeStringField("subnetStatus", this.subnetStatus); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of Subnet from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of Subnet if the JsonReader was pointing to an instance of it, or null if it was pointing to + * JSON null. + * @throws IOException If an error occurs while reading the Subnet. + */ + public static Subnet fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + Subnet deserializedSubnet = new Subnet(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("subnetAvailabilityZone".equals(fieldName)) { + deserializedSubnet.subnetAvailabilityZone = AvailabilityZone.fromJson(reader); + } else if ("subnetIdentifier".equals(fieldName)) { + deserializedSubnet.subnetIdentifier = reader.getString(); + } else if ("subnetStatus".equals(fieldName)) { + deserializedSubnet.subnetStatus = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedSubnet; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/SubnetMapping.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/SubnetMapping.java new file mode 100644 index 000000000000..bba418b09577 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/SubnetMapping.java @@ -0,0 +1,181 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of SubnetMapping. + */ +@Fluent +public final class SubnetMapping implements JsonSerializable { + /* + * [Network Load Balancers] The allocation ID of the Elastic IP address for an internet-facing load balancer. + */ + private String allocationId; + + /* + * [Network Load Balancers] The IPv6 address. + */ + private String iPv6Address; + + /* + * [Network Load Balancers] The private IPv4 address for an internal load balancer. + */ + private String privateIPv4Address; + + /* + * The ID of the subnet. + */ + private String subnetId; + + /** + * Creates an instance of SubnetMapping class. + */ + public SubnetMapping() { + } + + /** + * Get the allocationId property: [Network Load Balancers] The allocation ID of the Elastic IP address for an + * internet-facing load balancer. + * + * @return the allocationId value. + */ + public String allocationId() { + return this.allocationId; + } + + /** + * Set the allocationId property: [Network Load Balancers] The allocation ID of the Elastic IP address for an + * internet-facing load balancer. + * + * @param allocationId the allocationId value to set. + * @return the SubnetMapping object itself. + */ + public SubnetMapping withAllocationId(String allocationId) { + this.allocationId = allocationId; + return this; + } + + /** + * Get the iPv6Address property: [Network Load Balancers] The IPv6 address. + * + * @return the iPv6Address value. + */ + public String iPv6Address() { + return this.iPv6Address; + } + + /** + * Set the iPv6Address property: [Network Load Balancers] The IPv6 address. + * + * @param iPv6Address the iPv6Address value to set. + * @return the SubnetMapping object itself. + */ + public SubnetMapping withIPv6Address(String iPv6Address) { + this.iPv6Address = iPv6Address; + return this; + } + + /** + * Get the privateIPv4Address property: [Network Load Balancers] The private IPv4 address for an internal load + * balancer. + * + * @return the privateIPv4Address value. + */ + public String privateIPv4Address() { + return this.privateIPv4Address; + } + + /** + * Set the privateIPv4Address property: [Network Load Balancers] The private IPv4 address for an internal load + * balancer. + * + * @param privateIPv4Address the privateIPv4Address value to set. + * @return the SubnetMapping object itself. + */ + public SubnetMapping withPrivateIPv4Address(String privateIPv4Address) { + this.privateIPv4Address = privateIPv4Address; + return this; + } + + /** + * Get the subnetId property: The ID of the subnet. + * + * @return the subnetId value. + */ + public String subnetId() { + return this.subnetId; + } + + /** + * Set the subnetId property: The ID of the subnet. + * + * @param subnetId the subnetId value to set. + * @return the SubnetMapping object itself. + */ + public SubnetMapping withSubnetId(String subnetId) { + this.subnetId = subnetId; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("allocationId", this.allocationId); + jsonWriter.writeStringField("iPv6Address", this.iPv6Address); + jsonWriter.writeStringField("privateIPv4Address", this.privateIPv4Address); + jsonWriter.writeStringField("subnetId", this.subnetId); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of SubnetMapping from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of SubnetMapping if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the SubnetMapping. + */ + public static SubnetMapping fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + SubnetMapping deserializedSubnetMapping = new SubnetMapping(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("allocationId".equals(fieldName)) { + deserializedSubnetMapping.allocationId = reader.getString(); + } else if ("iPv6Address".equals(fieldName)) { + deserializedSubnetMapping.iPv6Address = reader.getString(); + } else if ("privateIPv4Address".equals(fieldName)) { + deserializedSubnetMapping.privateIPv4Address = reader.getString(); + } else if ("subnetId".equals(fieldName)) { + deserializedSubnetMapping.subnetId = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedSubnetMapping; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/SubnetMappingAutoGenerated.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/SubnetMappingAutoGenerated.java new file mode 100644 index 000000000000..7843893732d6 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/SubnetMappingAutoGenerated.java @@ -0,0 +1,121 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of SubnetMapping. + */ +@Fluent +public final class SubnetMappingAutoGenerated implements JsonSerializable { + /* + * A IPAddressType + */ + private String ipAddressType; + + /* + * A SubnetId. + */ + private String subnetId; + + /** + * Creates an instance of SubnetMappingAutoGenerated class. + */ + public SubnetMappingAutoGenerated() { + } + + /** + * Get the ipAddressType property: A IPAddressType. + * + * @return the ipAddressType value. + */ + public String ipAddressType() { + return this.ipAddressType; + } + + /** + * Set the ipAddressType property: A IPAddressType. + * + * @param ipAddressType the ipAddressType value to set. + * @return the SubnetMappingAutoGenerated object itself. + */ + public SubnetMappingAutoGenerated withIpAddressType(String ipAddressType) { + this.ipAddressType = ipAddressType; + return this; + } + + /** + * Get the subnetId property: A SubnetId. + * + * @return the subnetId value. + */ + public String subnetId() { + return this.subnetId; + } + + /** + * Set the subnetId property: A SubnetId. + * + * @param subnetId the subnetId value to set. + * @return the SubnetMappingAutoGenerated object itself. + */ + public SubnetMappingAutoGenerated withSubnetId(String subnetId) { + this.subnetId = subnetId; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("ipAddressType", this.ipAddressType); + jsonWriter.writeStringField("subnetId", this.subnetId); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of SubnetMappingAutoGenerated from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of SubnetMappingAutoGenerated if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IOException If an error occurs while reading the SubnetMappingAutoGenerated. + */ + public static SubnetMappingAutoGenerated fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + SubnetMappingAutoGenerated deserializedSubnetMappingAutoGenerated = new SubnetMappingAutoGenerated(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("ipAddressType".equals(fieldName)) { + deserializedSubnetMappingAutoGenerated.ipAddressType = reader.getString(); + } else if ("subnetId".equals(fieldName)) { + deserializedSubnetMappingAutoGenerated.subnetId = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedSubnetMappingAutoGenerated; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/Subscription.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/Subscription.java new file mode 100644 index 000000000000..a2546308e605 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/Subscription.java @@ -0,0 +1,129 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of Subscription. + */ +@Fluent +public final class Subscription implements JsonSerializable { + /* + * The endpoint that receives notifications from the SNS topic. The endpoint value depends on the protocol that you + * specify. For more information, see the ``Endpoint`` parameter of the ``Subscribe`` action in the *API Reference*. + */ + private String endpoint; + + /* + * The subscription's protocol. For more information, see the ``Protocol`` parameter of the ``Subscribe`` action in + * the *API Reference*. + */ + private String protocol; + + /** + * Creates an instance of Subscription class. + */ + public Subscription() { + } + + /** + * Get the endpoint property: The endpoint that receives notifications from the SNS topic. The endpoint value + * depends on the protocol that you specify. For more information, see the ``Endpoint`` parameter of the + * ``Subscribe`` action in the *API Reference*. + * + * @return the endpoint value. + */ + public String endpoint() { + return this.endpoint; + } + + /** + * Set the endpoint property: The endpoint that receives notifications from the SNS topic. The endpoint value + * depends on the protocol that you specify. For more information, see the ``Endpoint`` parameter of the + * ``Subscribe`` action in the *API Reference*. + * + * @param endpoint the endpoint value to set. + * @return the Subscription object itself. + */ + public Subscription withEndpoint(String endpoint) { + this.endpoint = endpoint; + return this; + } + + /** + * Get the protocol property: The subscription's protocol. For more information, see the ``Protocol`` parameter of + * the ``Subscribe`` action in the *API Reference*. + * + * @return the protocol value. + */ + public String protocol() { + return this.protocol; + } + + /** + * Set the protocol property: The subscription's protocol. For more information, see the ``Protocol`` parameter of + * the ``Subscribe`` action in the *API Reference*. + * + * @param protocol the protocol value to set. + * @return the Subscription object itself. + */ + public Subscription withProtocol(String protocol) { + this.protocol = protocol; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("endpoint", this.endpoint); + jsonWriter.writeStringField("protocol", this.protocol); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of Subscription from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of Subscription if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the Subscription. + */ + public static Subscription fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + Subscription deserializedSubscription = new Subscription(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("endpoint".equals(fieldName)) { + deserializedSubscription.endpoint = reader.getString(); + } else if ("protocol".equals(fieldName)) { + deserializedSubscription.protocol = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedSubscription; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/SummaryStatus.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/SummaryStatus.java new file mode 100644 index 000000000000..a8a477512ef3 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/SummaryStatus.java @@ -0,0 +1,66 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * SummaryStatus enum. + */ +public final class SummaryStatus extends ExpandableStringEnum { + /** + * Static value impaired for SummaryStatus. + */ + public static final SummaryStatus IMPAIRED = fromString("impaired"); + + /** + * Static value initializing for SummaryStatus. + */ + public static final SummaryStatus INITIALIZING = fromString("initializing"); + + /** + * Static value insufficient-data for SummaryStatus. + */ + public static final SummaryStatus INSUFFICIENT_DATA = fromString("insufficient-data"); + + /** + * Static value not-applicable for SummaryStatus. + */ + public static final SummaryStatus NOT_APPLICABLE = fromString("not-applicable"); + + /** + * Static value ok for SummaryStatus. + */ + public static final SummaryStatus OK = fromString("ok"); + + /** + * Creates a new instance of SummaryStatus value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public SummaryStatus() { + } + + /** + * Creates or finds a SummaryStatus from its string representation. + * + * @param name a name to look for. + * @return the corresponding SummaryStatus. + */ + public static SummaryStatus fromString(String name) { + return fromString(name, SummaryStatus.class); + } + + /** + * Gets known SummaryStatus values. + * + * @return known SummaryStatus values. + */ + public static Collection values() { + return values(SummaryStatus.class); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/SummaryStatusEnumValue.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/SummaryStatusEnumValue.java new file mode 100644 index 000000000000..3ca8d331ebe3 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/SummaryStatusEnumValue.java @@ -0,0 +1,93 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of SummaryStatusEnumValue. + */ +@Fluent +public final class SummaryStatusEnumValue implements JsonSerializable { + /* + * Property value + */ + private SummaryStatus value; + + /** + * Creates an instance of SummaryStatusEnumValue class. + */ + public SummaryStatusEnumValue() { + } + + /** + * Get the value property: Property value. + * + * @return the value value. + */ + public SummaryStatus value() { + return this.value; + } + + /** + * Set the value property: Property value. + * + * @param value the value value to set. + * @return the SummaryStatusEnumValue object itself. + */ + public SummaryStatusEnumValue withValue(SummaryStatus value) { + this.value = value; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("value", this.value == null ? null : this.value.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of SummaryStatusEnumValue from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of SummaryStatusEnumValue if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the SummaryStatusEnumValue. + */ + public static SummaryStatusEnumValue fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + SummaryStatusEnumValue deserializedSummaryStatusEnumValue = new SummaryStatusEnumValue(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + deserializedSummaryStatusEnumValue.value = SummaryStatus.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedSummaryStatusEnumValue; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/SystemControl.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/SystemControl.java new file mode 100644 index 000000000000..8d5408de75aa --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/SystemControl.java @@ -0,0 +1,130 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of SystemControl. + */ +@Fluent +public final class SystemControl implements JsonSerializable { + /* + * The namespaced kernel parameter to set a ``value`` for. + */ + private String namespace; + + /* + * The namespaced kernel parameter to set a ``value`` for. Valid IPC namespace values: ``'kernel.msgmax' | + * 'kernel.msgmnb' | 'kernel.msgmni' | 'kernel.sem' | 'kernel.shmall' | 'kernel.shmmax' | 'kernel.shmmni' | + * 'kernel.shm_rmid_forced'``, and ``Sysctls`` that start with ``'fs.mqueue.*'`` Valid network namespace values: + * ``Sysctls`` that start with ``'net.*'`` All of these values are supported by Fargate. + */ + private String value; + + /** + * Creates an instance of SystemControl class. + */ + public SystemControl() { + } + + /** + * Get the namespace property: The namespaced kernel parameter to set a ``value`` for. + * + * @return the namespace value. + */ + public String namespace() { + return this.namespace; + } + + /** + * Set the namespace property: The namespaced kernel parameter to set a ``value`` for. + * + * @param namespace the namespace value to set. + * @return the SystemControl object itself. + */ + public SystemControl withNamespace(String namespace) { + this.namespace = namespace; + return this; + } + + /** + * Get the value property: The namespaced kernel parameter to set a ``value`` for. Valid IPC namespace values: + * ``'kernel.msgmax' | 'kernel.msgmnb' | 'kernel.msgmni' | 'kernel.sem' | 'kernel.shmall' | 'kernel.shmmax' | + * 'kernel.shmmni' | 'kernel.shm_rmid_forced'``, and ``Sysctls`` that start with ``'fs.mqueue.*'`` Valid network + * namespace values: ``Sysctls`` that start with ``'net.*'`` All of these values are supported by Fargate. + * + * @return the value value. + */ + public String value() { + return this.value; + } + + /** + * Set the value property: The namespaced kernel parameter to set a ``value`` for. Valid IPC namespace values: + * ``'kernel.msgmax' | 'kernel.msgmnb' | 'kernel.msgmni' | 'kernel.sem' | 'kernel.shmall' | 'kernel.shmmax' | + * 'kernel.shmmni' | 'kernel.shm_rmid_forced'``, and ``Sysctls`` that start with ``'fs.mqueue.*'`` Valid network + * namespace values: ``Sysctls`` that start with ``'net.*'`` All of these values are supported by Fargate. + * + * @param value the value value to set. + * @return the SystemControl object itself. + */ + public SystemControl withValue(String value) { + this.value = value; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("namespace", this.namespace); + jsonWriter.writeStringField("value", this.value); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of SystemControl from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of SystemControl if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the SystemControl. + */ + public static SystemControl fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + SystemControl deserializedSystemControl = new SystemControl(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("namespace".equals(fieldName)) { + deserializedSystemControl.namespace = reader.getString(); + } else if ("value".equals(fieldName)) { + deserializedSystemControl.value = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedSystemControl; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/Tag.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/Tag.java new file mode 100644 index 000000000000..20cc3d3993a5 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/Tag.java @@ -0,0 +1,133 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of Tag. + */ +@Fluent +public final class Tag implements JsonSerializable { + /* + * The key name of the tag. You can specify a value that is 1 to 127 Unicode characters in length and cannot be + * prefixed with aws:. You can use any of the following characters: the set of Unicode letters, digits, whitespace, + * _, ., /, =, +, and -. + */ + private String key; + + /* + * The value for the tag. You can specify a value that is 1 to 255 Unicode characters in length and cannot be + * prefixed with aws:. You can use any of the following characters: the set of Unicode letters, digits, whitespace, + * _, ., /, =, +, and -. + */ + private String value; + + /** + * Creates an instance of Tag class. + */ + public Tag() { + } + + /** + * Get the key property: The key name of the tag. You can specify a value that is 1 to 127 Unicode characters in + * length and cannot be prefixed with aws:. You can use any of the following characters: the set of Unicode letters, + * digits, whitespace, _, ., /, =, +, and -. + * + * @return the key value. + */ + public String key() { + return this.key; + } + + /** + * Set the key property: The key name of the tag. You can specify a value that is 1 to 127 Unicode characters in + * length and cannot be prefixed with aws:. You can use any of the following characters: the set of Unicode letters, + * digits, whitespace, _, ., /, =, +, and -. + * + * @param key the key value to set. + * @return the Tag object itself. + */ + public Tag withKey(String key) { + this.key = key; + return this; + } + + /** + * Get the value property: The value for the tag. You can specify a value that is 1 to 255 Unicode characters in + * length and cannot be prefixed with aws:. You can use any of the following characters: the set of Unicode letters, + * digits, whitespace, _, ., /, =, +, and -. + * + * @return the value value. + */ + public String value() { + return this.value; + } + + /** + * Set the value property: The value for the tag. You can specify a value that is 1 to 255 Unicode characters in + * length and cannot be prefixed with aws:. You can use any of the following characters: the set of Unicode letters, + * digits, whitespace, _, ., /, =, +, and -. + * + * @param value the value value to set. + * @return the Tag object itself. + */ + public Tag withValue(String value) { + this.value = value; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("key", this.key); + jsonWriter.writeStringField("value", this.value); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of Tag from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of Tag if the JsonReader was pointing to an instance of it, or null if it was pointing to + * JSON null. + * @throws IOException If an error occurs while reading the Tag. + */ + public static Tag fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + Tag deserializedTag = new Tag(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("key".equals(fieldName)) { + deserializedTag.key = reader.getString(); + } else if ("value".equals(fieldName)) { + deserializedTag.value = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedTag; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/TagAutoGenerated.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/TagAutoGenerated.java new file mode 100644 index 000000000000..7d47241c57c1 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/TagAutoGenerated.java @@ -0,0 +1,121 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of Tag. + */ +@Fluent +public final class TagAutoGenerated implements JsonSerializable { + /* + * Property key + */ + private String key; + + /* + * Property value + */ + private String value; + + /** + * Creates an instance of TagAutoGenerated class. + */ + public TagAutoGenerated() { + } + + /** + * Get the key property: Property key. + * + * @return the key value. + */ + public String key() { + return this.key; + } + + /** + * Set the key property: Property key. + * + * @param key the key value to set. + * @return the TagAutoGenerated object itself. + */ + public TagAutoGenerated withKey(String key) { + this.key = key; + return this; + } + + /** + * Get the value property: Property value. + * + * @return the value value. + */ + public String value() { + return this.value; + } + + /** + * Set the value property: Property value. + * + * @param value the value value to set. + * @return the TagAutoGenerated object itself. + */ + public TagAutoGenerated withValue(String value) { + this.value = value; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("key", this.key); + jsonWriter.writeStringField("value", this.value); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of TagAutoGenerated from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of TagAutoGenerated if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the TagAutoGenerated. + */ + public static TagAutoGenerated fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + TagAutoGenerated deserializedTagAutoGenerated = new TagAutoGenerated(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("key".equals(fieldName)) { + deserializedTagAutoGenerated.key = reader.getString(); + } else if ("value".equals(fieldName)) { + deserializedTagAutoGenerated.value = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedTagAutoGenerated; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/TagAutoGenerated10.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/TagAutoGenerated10.java new file mode 100644 index 000000000000..6e89bff3cc62 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/TagAutoGenerated10.java @@ -0,0 +1,121 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of Tag. + */ +@Fluent +public final class TagAutoGenerated10 implements JsonSerializable { + /* + * Property key + */ + private String key; + + /* + * Property value + */ + private String value; + + /** + * Creates an instance of TagAutoGenerated10 class. + */ + public TagAutoGenerated10() { + } + + /** + * Get the key property: Property key. + * + * @return the key value. + */ + public String key() { + return this.key; + } + + /** + * Set the key property: Property key. + * + * @param key the key value to set. + * @return the TagAutoGenerated10 object itself. + */ + public TagAutoGenerated10 withKey(String key) { + this.key = key; + return this; + } + + /** + * Get the value property: Property value. + * + * @return the value value. + */ + public String value() { + return this.value; + } + + /** + * Set the value property: Property value. + * + * @param value the value value to set. + * @return the TagAutoGenerated10 object itself. + */ + public TagAutoGenerated10 withValue(String value) { + this.value = value; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("key", this.key); + jsonWriter.writeStringField("value", this.value); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of TagAutoGenerated10 from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of TagAutoGenerated10 if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the TagAutoGenerated10. + */ + public static TagAutoGenerated10 fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + TagAutoGenerated10 deserializedTagAutoGenerated10 = new TagAutoGenerated10(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("key".equals(fieldName)) { + deserializedTagAutoGenerated10.key = reader.getString(); + } else if ("value".equals(fieldName)) { + deserializedTagAutoGenerated10.value = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedTagAutoGenerated10; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/TagAutoGenerated11.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/TagAutoGenerated11.java new file mode 100644 index 000000000000..dd26e8c956d5 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/TagAutoGenerated11.java @@ -0,0 +1,127 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of Tag. + */ +@Fluent +public final class TagAutoGenerated11 implements JsonSerializable { + /* + *

The key of the tag.

Constraints: Tag keys are case-sensitive and accept a maximum of 127 Unicode + * characters. May not begin with aws:.

+ */ + private String key; + + /* + *

The value of the tag.

Constraints: Tag values are case-sensitive and accept a maximum of 256 Unicode + * characters.

+ */ + private String value; + + /** + * Creates an instance of TagAutoGenerated11 class. + */ + public TagAutoGenerated11() { + } + + /** + * Get the key property: <p>The key of the tag.</p> <p>Constraints: Tag keys are case-sensitive + * and accept a maximum of 127 Unicode characters. May not begin with <code>aws:</code>.</p>. + * + * @return the key value. + */ + public String key() { + return this.key; + } + + /** + * Set the key property: <p>The key of the tag.</p> <p>Constraints: Tag keys are case-sensitive + * and accept a maximum of 127 Unicode characters. May not begin with <code>aws:</code>.</p>. + * + * @param key the key value to set. + * @return the TagAutoGenerated11 object itself. + */ + public TagAutoGenerated11 withKey(String key) { + this.key = key; + return this; + } + + /** + * Get the value property: <p>The value of the tag.</p> <p>Constraints: Tag values are + * case-sensitive and accept a maximum of 256 Unicode characters.</p>. + * + * @return the value value. + */ + public String value() { + return this.value; + } + + /** + * Set the value property: <p>The value of the tag.</p> <p>Constraints: Tag values are + * case-sensitive and accept a maximum of 256 Unicode characters.</p>. + * + * @param value the value value to set. + * @return the TagAutoGenerated11 object itself. + */ + public TagAutoGenerated11 withValue(String value) { + this.value = value; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("key", this.key); + jsonWriter.writeStringField("value", this.value); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of TagAutoGenerated11 from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of TagAutoGenerated11 if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the TagAutoGenerated11. + */ + public static TagAutoGenerated11 fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + TagAutoGenerated11 deserializedTagAutoGenerated11 = new TagAutoGenerated11(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("key".equals(fieldName)) { + deserializedTagAutoGenerated11.key = reader.getString(); + } else if ("value".equals(fieldName)) { + deserializedTagAutoGenerated11.value = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedTagAutoGenerated11; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/TagAutoGenerated12.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/TagAutoGenerated12.java new file mode 100644 index 000000000000..ffad85a5f3c9 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/TagAutoGenerated12.java @@ -0,0 +1,127 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of Tag. + */ +@Fluent +public final class TagAutoGenerated12 implements JsonSerializable { + /* + *

The key of the tag.

Constraints: Tag keys are case-sensitive and accept a maximum of 127 Unicode + * characters. May not begin with aws:.

+ */ + private String key; + + /* + *

The value of the tag.

Constraints: Tag values are case-sensitive and accept a maximum of 256 Unicode + * characters.

+ */ + private String value; + + /** + * Creates an instance of TagAutoGenerated12 class. + */ + public TagAutoGenerated12() { + } + + /** + * Get the key property: <p>The key of the tag.</p> <p>Constraints: Tag keys are case-sensitive + * and accept a maximum of 127 Unicode characters. May not begin with <code>aws:</code>.</p>. + * + * @return the key value. + */ + public String key() { + return this.key; + } + + /** + * Set the key property: <p>The key of the tag.</p> <p>Constraints: Tag keys are case-sensitive + * and accept a maximum of 127 Unicode characters. May not begin with <code>aws:</code>.</p>. + * + * @param key the key value to set. + * @return the TagAutoGenerated12 object itself. + */ + public TagAutoGenerated12 withKey(String key) { + this.key = key; + return this; + } + + /** + * Get the value property: <p>The value of the tag.</p> <p>Constraints: Tag values are + * case-sensitive and accept a maximum of 256 Unicode characters.</p>. + * + * @return the value value. + */ + public String value() { + return this.value; + } + + /** + * Set the value property: <p>The value of the tag.</p> <p>Constraints: Tag values are + * case-sensitive and accept a maximum of 256 Unicode characters.</p>. + * + * @param value the value value to set. + * @return the TagAutoGenerated12 object itself. + */ + public TagAutoGenerated12 withValue(String value) { + this.value = value; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("key", this.key); + jsonWriter.writeStringField("value", this.value); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of TagAutoGenerated12 from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of TagAutoGenerated12 if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the TagAutoGenerated12. + */ + public static TagAutoGenerated12 fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + TagAutoGenerated12 deserializedTagAutoGenerated12 = new TagAutoGenerated12(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("key".equals(fieldName)) { + deserializedTagAutoGenerated12.key = reader.getString(); + } else if ("value".equals(fieldName)) { + deserializedTagAutoGenerated12.value = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedTagAutoGenerated12; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/TagAutoGenerated13.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/TagAutoGenerated13.java new file mode 100644 index 000000000000..b27f2f6fa66c --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/TagAutoGenerated13.java @@ -0,0 +1,127 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of Tag. + */ +@Fluent +public final class TagAutoGenerated13 implements JsonSerializable { + /* + *

The key of the tag.

Constraints: Tag keys are case-sensitive and accept a maximum of 127 Unicode + * characters. May not begin with aws:.

+ */ + private String key; + + /* + *

The value of the tag.

Constraints: Tag values are case-sensitive and accept a maximum of 256 Unicode + * characters.

+ */ + private String value; + + /** + * Creates an instance of TagAutoGenerated13 class. + */ + public TagAutoGenerated13() { + } + + /** + * Get the key property: <p>The key of the tag.</p> <p>Constraints: Tag keys are case-sensitive + * and accept a maximum of 127 Unicode characters. May not begin with <code>aws:</code>.</p>. + * + * @return the key value. + */ + public String key() { + return this.key; + } + + /** + * Set the key property: <p>The key of the tag.</p> <p>Constraints: Tag keys are case-sensitive + * and accept a maximum of 127 Unicode characters. May not begin with <code>aws:</code>.</p>. + * + * @param key the key value to set. + * @return the TagAutoGenerated13 object itself. + */ + public TagAutoGenerated13 withKey(String key) { + this.key = key; + return this; + } + + /** + * Get the value property: <p>The value of the tag.</p> <p>Constraints: Tag values are + * case-sensitive and accept a maximum of 256 Unicode characters.</p>. + * + * @return the value value. + */ + public String value() { + return this.value; + } + + /** + * Set the value property: <p>The value of the tag.</p> <p>Constraints: Tag values are + * case-sensitive and accept a maximum of 256 Unicode characters.</p>. + * + * @param value the value value to set. + * @return the TagAutoGenerated13 object itself. + */ + public TagAutoGenerated13 withValue(String value) { + this.value = value; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("key", this.key); + jsonWriter.writeStringField("value", this.value); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of TagAutoGenerated13 from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of TagAutoGenerated13 if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the TagAutoGenerated13. + */ + public static TagAutoGenerated13 fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + TagAutoGenerated13 deserializedTagAutoGenerated13 = new TagAutoGenerated13(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("key".equals(fieldName)) { + deserializedTagAutoGenerated13.key = reader.getString(); + } else if ("value".equals(fieldName)) { + deserializedTagAutoGenerated13.value = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedTagAutoGenerated13; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/TagAutoGenerated14.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/TagAutoGenerated14.java new file mode 100644 index 000000000000..39898935f02e --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/TagAutoGenerated14.java @@ -0,0 +1,121 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of Tag. + */ +@Fluent +public final class TagAutoGenerated14 implements JsonSerializable { + /* + * The tag key. + */ + private String key; + + /* + * The tag value. + */ + private String value; + + /** + * Creates an instance of TagAutoGenerated14 class. + */ + public TagAutoGenerated14() { + } + + /** + * Get the key property: The tag key. + * + * @return the key value. + */ + public String key() { + return this.key; + } + + /** + * Set the key property: The tag key. + * + * @param key the key value to set. + * @return the TagAutoGenerated14 object itself. + */ + public TagAutoGenerated14 withKey(String key) { + this.key = key; + return this; + } + + /** + * Get the value property: The tag value. + * + * @return the value value. + */ + public String value() { + return this.value; + } + + /** + * Set the value property: The tag value. + * + * @param value the value value to set. + * @return the TagAutoGenerated14 object itself. + */ + public TagAutoGenerated14 withValue(String value) { + this.value = value; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("key", this.key); + jsonWriter.writeStringField("value", this.value); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of TagAutoGenerated14 from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of TagAutoGenerated14 if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the TagAutoGenerated14. + */ + public static TagAutoGenerated14 fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + TagAutoGenerated14 deserializedTagAutoGenerated14 = new TagAutoGenerated14(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("key".equals(fieldName)) { + deserializedTagAutoGenerated14.key = reader.getString(); + } else if ("value".equals(fieldName)) { + deserializedTagAutoGenerated14.value = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedTagAutoGenerated14; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/TagAutoGenerated15.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/TagAutoGenerated15.java new file mode 100644 index 000000000000..9c3277959bc4 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/TagAutoGenerated15.java @@ -0,0 +1,121 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of Tag. + */ +@Fluent +public final class TagAutoGenerated15 implements JsonSerializable { + /* + * The tag key. + */ + private String key; + + /* + * The tag value. + */ + private String value; + + /** + * Creates an instance of TagAutoGenerated15 class. + */ + public TagAutoGenerated15() { + } + + /** + * Get the key property: The tag key. + * + * @return the key value. + */ + public String key() { + return this.key; + } + + /** + * Set the key property: The tag key. + * + * @param key the key value to set. + * @return the TagAutoGenerated15 object itself. + */ + public TagAutoGenerated15 withKey(String key) { + this.key = key; + return this; + } + + /** + * Get the value property: The tag value. + * + * @return the value value. + */ + public String value() { + return this.value; + } + + /** + * Set the value property: The tag value. + * + * @param value the value value to set. + * @return the TagAutoGenerated15 object itself. + */ + public TagAutoGenerated15 withValue(String value) { + this.value = value; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("key", this.key); + jsonWriter.writeStringField("value", this.value); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of TagAutoGenerated15 from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of TagAutoGenerated15 if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the TagAutoGenerated15. + */ + public static TagAutoGenerated15 fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + TagAutoGenerated15 deserializedTagAutoGenerated15 = new TagAutoGenerated15(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("key".equals(fieldName)) { + deserializedTagAutoGenerated15.key = reader.getString(); + } else if ("value".equals(fieldName)) { + deserializedTagAutoGenerated15.value = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedTagAutoGenerated15; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/TagAutoGenerated16.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/TagAutoGenerated16.java new file mode 100644 index 000000000000..0519d745674a --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/TagAutoGenerated16.java @@ -0,0 +1,121 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of Tag. + */ +@Fluent +public final class TagAutoGenerated16 implements JsonSerializable { + /* + * Property key + */ + private String key; + + /* + * Property value + */ + private String value; + + /** + * Creates an instance of TagAutoGenerated16 class. + */ + public TagAutoGenerated16() { + } + + /** + * Get the key property: Property key. + * + * @return the key value. + */ + public String key() { + return this.key; + } + + /** + * Set the key property: Property key. + * + * @param key the key value to set. + * @return the TagAutoGenerated16 object itself. + */ + public TagAutoGenerated16 withKey(String key) { + this.key = key; + return this; + } + + /** + * Get the value property: Property value. + * + * @return the value value. + */ + public String value() { + return this.value; + } + + /** + * Set the value property: Property value. + * + * @param value the value value to set. + * @return the TagAutoGenerated16 object itself. + */ + public TagAutoGenerated16 withValue(String value) { + this.value = value; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("key", this.key); + jsonWriter.writeStringField("value", this.value); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of TagAutoGenerated16 from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of TagAutoGenerated16 if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the TagAutoGenerated16. + */ + public static TagAutoGenerated16 fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + TagAutoGenerated16 deserializedTagAutoGenerated16 = new TagAutoGenerated16(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("key".equals(fieldName)) { + deserializedTagAutoGenerated16.key = reader.getString(); + } else if ("value".equals(fieldName)) { + deserializedTagAutoGenerated16.value = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedTagAutoGenerated16; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/TagAutoGenerated17.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/TagAutoGenerated17.java new file mode 100644 index 000000000000..4b92d7a7ae07 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/TagAutoGenerated17.java @@ -0,0 +1,121 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of Tag. + */ +@Fluent +public final class TagAutoGenerated17 implements JsonSerializable { + /* + * The tag key. + */ + private String key; + + /* + * The tag value. + */ + private String value; + + /** + * Creates an instance of TagAutoGenerated17 class. + */ + public TagAutoGenerated17() { + } + + /** + * Get the key property: The tag key. + * + * @return the key value. + */ + public String key() { + return this.key; + } + + /** + * Set the key property: The tag key. + * + * @param key the key value to set. + * @return the TagAutoGenerated17 object itself. + */ + public TagAutoGenerated17 withKey(String key) { + this.key = key; + return this; + } + + /** + * Get the value property: The tag value. + * + * @return the value value. + */ + public String value() { + return this.value; + } + + /** + * Set the value property: The tag value. + * + * @param value the value value to set. + * @return the TagAutoGenerated17 object itself. + */ + public TagAutoGenerated17 withValue(String value) { + this.value = value; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("key", this.key); + jsonWriter.writeStringField("value", this.value); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of TagAutoGenerated17 from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of TagAutoGenerated17 if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the TagAutoGenerated17. + */ + public static TagAutoGenerated17 fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + TagAutoGenerated17 deserializedTagAutoGenerated17 = new TagAutoGenerated17(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("key".equals(fieldName)) { + deserializedTagAutoGenerated17.key = reader.getString(); + } else if ("value".equals(fieldName)) { + deserializedTagAutoGenerated17.value = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedTagAutoGenerated17; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/TagAutoGenerated18.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/TagAutoGenerated18.java new file mode 100644 index 000000000000..6f9ad884bbdc --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/TagAutoGenerated18.java @@ -0,0 +1,127 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of Tag. + */ +@Fluent +public final class TagAutoGenerated18 implements JsonSerializable { + /* + *

The key of the tag.

Constraints: Tag keys are case-sensitive and accept a maximum of 127 Unicode + * characters. May not begin with aws:.

+ */ + private String key; + + /* + *

The value of the tag.

Constraints: Tag values are case-sensitive and accept a maximum of 256 Unicode + * characters.

+ */ + private String value; + + /** + * Creates an instance of TagAutoGenerated18 class. + */ + public TagAutoGenerated18() { + } + + /** + * Get the key property: <p>The key of the tag.</p> <p>Constraints: Tag keys are case-sensitive + * and accept a maximum of 127 Unicode characters. May not begin with <code>aws:</code>.</p>. + * + * @return the key value. + */ + public String key() { + return this.key; + } + + /** + * Set the key property: <p>The key of the tag.</p> <p>Constraints: Tag keys are case-sensitive + * and accept a maximum of 127 Unicode characters. May not begin with <code>aws:</code>.</p>. + * + * @param key the key value to set. + * @return the TagAutoGenerated18 object itself. + */ + public TagAutoGenerated18 withKey(String key) { + this.key = key; + return this; + } + + /** + * Get the value property: <p>The value of the tag.</p> <p>Constraints: Tag values are + * case-sensitive and accept a maximum of 256 Unicode characters.</p>. + * + * @return the value value. + */ + public String value() { + return this.value; + } + + /** + * Set the value property: <p>The value of the tag.</p> <p>Constraints: Tag values are + * case-sensitive and accept a maximum of 256 Unicode characters.</p>. + * + * @param value the value value to set. + * @return the TagAutoGenerated18 object itself. + */ + public TagAutoGenerated18 withValue(String value) { + this.value = value; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("key", this.key); + jsonWriter.writeStringField("value", this.value); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of TagAutoGenerated18 from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of TagAutoGenerated18 if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the TagAutoGenerated18. + */ + public static TagAutoGenerated18 fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + TagAutoGenerated18 deserializedTagAutoGenerated18 = new TagAutoGenerated18(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("key".equals(fieldName)) { + deserializedTagAutoGenerated18.key = reader.getString(); + } else if ("value".equals(fieldName)) { + deserializedTagAutoGenerated18.value = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedTagAutoGenerated18; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/TagAutoGenerated19.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/TagAutoGenerated19.java new file mode 100644 index 000000000000..825e7e023303 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/TagAutoGenerated19.java @@ -0,0 +1,127 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of Tag. + */ +@Fluent +public final class TagAutoGenerated19 implements JsonSerializable { + /* + *

The key of the tag.

Constraints: Tag keys are case-sensitive and accept a maximum of 127 Unicode + * characters. May not begin with aws:.

+ */ + private String key; + + /* + *

The value of the tag.

Constraints: Tag values are case-sensitive and accept a maximum of 256 Unicode + * characters.

+ */ + private String value; + + /** + * Creates an instance of TagAutoGenerated19 class. + */ + public TagAutoGenerated19() { + } + + /** + * Get the key property: <p>The key of the tag.</p> <p>Constraints: Tag keys are case-sensitive + * and accept a maximum of 127 Unicode characters. May not begin with <code>aws:</code>.</p>. + * + * @return the key value. + */ + public String key() { + return this.key; + } + + /** + * Set the key property: <p>The key of the tag.</p> <p>Constraints: Tag keys are case-sensitive + * and accept a maximum of 127 Unicode characters. May not begin with <code>aws:</code>.</p>. + * + * @param key the key value to set. + * @return the TagAutoGenerated19 object itself. + */ + public TagAutoGenerated19 withKey(String key) { + this.key = key; + return this; + } + + /** + * Get the value property: <p>The value of the tag.</p> <p>Constraints: Tag values are + * case-sensitive and accept a maximum of 256 Unicode characters.</p>. + * + * @return the value value. + */ + public String value() { + return this.value; + } + + /** + * Set the value property: <p>The value of the tag.</p> <p>Constraints: Tag values are + * case-sensitive and accept a maximum of 256 Unicode characters.</p>. + * + * @param value the value value to set. + * @return the TagAutoGenerated19 object itself. + */ + public TagAutoGenerated19 withValue(String value) { + this.value = value; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("key", this.key); + jsonWriter.writeStringField("value", this.value); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of TagAutoGenerated19 from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of TagAutoGenerated19 if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the TagAutoGenerated19. + */ + public static TagAutoGenerated19 fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + TagAutoGenerated19 deserializedTagAutoGenerated19 = new TagAutoGenerated19(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("key".equals(fieldName)) { + deserializedTagAutoGenerated19.key = reader.getString(); + } else if ("value".equals(fieldName)) { + deserializedTagAutoGenerated19.value = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedTagAutoGenerated19; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/TagAutoGenerated2.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/TagAutoGenerated2.java new file mode 100644 index 000000000000..8f98bb5ce1a7 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/TagAutoGenerated2.java @@ -0,0 +1,127 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of Tag. + */ +@Fluent +public final class TagAutoGenerated2 implements JsonSerializable { + /* + * The key name of the tag. You can specify a value that is 1 to 128 Unicode characters in length and cannot be + * prefixed with aws:. + */ + private String key; + + /* + * The value for the tag. You can specify a value that is 0 to 256 Unicode characters in length and cannot be + * prefixed with aws:. + */ + private String value; + + /** + * Creates an instance of TagAutoGenerated2 class. + */ + public TagAutoGenerated2() { + } + + /** + * Get the key property: The key name of the tag. You can specify a value that is 1 to 128 Unicode characters in + * length and cannot be prefixed with aws:. + * + * @return the key value. + */ + public String key() { + return this.key; + } + + /** + * Set the key property: The key name of the tag. You can specify a value that is 1 to 128 Unicode characters in + * length and cannot be prefixed with aws:. + * + * @param key the key value to set. + * @return the TagAutoGenerated2 object itself. + */ + public TagAutoGenerated2 withKey(String key) { + this.key = key; + return this; + } + + /** + * Get the value property: The value for the tag. You can specify a value that is 0 to 256 Unicode characters in + * length and cannot be prefixed with aws:. + * + * @return the value value. + */ + public String value() { + return this.value; + } + + /** + * Set the value property: The value for the tag. You can specify a value that is 0 to 256 Unicode characters in + * length and cannot be prefixed with aws:. + * + * @param value the value value to set. + * @return the TagAutoGenerated2 object itself. + */ + public TagAutoGenerated2 withValue(String value) { + this.value = value; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("key", this.key); + jsonWriter.writeStringField("value", this.value); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of TagAutoGenerated2 from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of TagAutoGenerated2 if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the TagAutoGenerated2. + */ + public static TagAutoGenerated2 fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + TagAutoGenerated2 deserializedTagAutoGenerated2 = new TagAutoGenerated2(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("key".equals(fieldName)) { + deserializedTagAutoGenerated2.key = reader.getString(); + } else if ("value".equals(fieldName)) { + deserializedTagAutoGenerated2.value = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedTagAutoGenerated2; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/TagAutoGenerated20.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/TagAutoGenerated20.java new file mode 100644 index 000000000000..ad96ba40b48f --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/TagAutoGenerated20.java @@ -0,0 +1,121 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of Tag. + */ +@Fluent +public final class TagAutoGenerated20 implements JsonSerializable { + /* + * The tag key. + */ + private String key; + + /* + * The tag value. + */ + private String value; + + /** + * Creates an instance of TagAutoGenerated20 class. + */ + public TagAutoGenerated20() { + } + + /** + * Get the key property: The tag key. + * + * @return the key value. + */ + public String key() { + return this.key; + } + + /** + * Set the key property: The tag key. + * + * @param key the key value to set. + * @return the TagAutoGenerated20 object itself. + */ + public TagAutoGenerated20 withKey(String key) { + this.key = key; + return this; + } + + /** + * Get the value property: The tag value. + * + * @return the value value. + */ + public String value() { + return this.value; + } + + /** + * Set the value property: The tag value. + * + * @param value the value value to set. + * @return the TagAutoGenerated20 object itself. + */ + public TagAutoGenerated20 withValue(String value) { + this.value = value; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("key", this.key); + jsonWriter.writeStringField("value", this.value); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of TagAutoGenerated20 from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of TagAutoGenerated20 if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the TagAutoGenerated20. + */ + public static TagAutoGenerated20 fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + TagAutoGenerated20 deserializedTagAutoGenerated20 = new TagAutoGenerated20(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("key".equals(fieldName)) { + deserializedTagAutoGenerated20.key = reader.getString(); + } else if ("value".equals(fieldName)) { + deserializedTagAutoGenerated20.value = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedTagAutoGenerated20; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/TagAutoGenerated21.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/TagAutoGenerated21.java new file mode 100644 index 000000000000..70db538477d2 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/TagAutoGenerated21.java @@ -0,0 +1,121 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of Tag. + */ +@Fluent +public final class TagAutoGenerated21 implements JsonSerializable { + /* + * The tag key. + */ + private String key; + + /* + * The tag value. + */ + private String value; + + /** + * Creates an instance of TagAutoGenerated21 class. + */ + public TagAutoGenerated21() { + } + + /** + * Get the key property: The tag key. + * + * @return the key value. + */ + public String key() { + return this.key; + } + + /** + * Set the key property: The tag key. + * + * @param key the key value to set. + * @return the TagAutoGenerated21 object itself. + */ + public TagAutoGenerated21 withKey(String key) { + this.key = key; + return this; + } + + /** + * Get the value property: The tag value. + * + * @return the value value. + */ + public String value() { + return this.value; + } + + /** + * Set the value property: The tag value. + * + * @param value the value value to set. + * @return the TagAutoGenerated21 object itself. + */ + public TagAutoGenerated21 withValue(String value) { + this.value = value; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("key", this.key); + jsonWriter.writeStringField("value", this.value); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of TagAutoGenerated21 from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of TagAutoGenerated21 if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the TagAutoGenerated21. + */ + public static TagAutoGenerated21 fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + TagAutoGenerated21 deserializedTagAutoGenerated21 = new TagAutoGenerated21(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("key".equals(fieldName)) { + deserializedTagAutoGenerated21.key = reader.getString(); + } else if ("value".equals(fieldName)) { + deserializedTagAutoGenerated21.value = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedTagAutoGenerated21; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/TagAutoGenerated22.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/TagAutoGenerated22.java new file mode 100644 index 000000000000..0a01d4b329ec --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/TagAutoGenerated22.java @@ -0,0 +1,121 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of Tag. + */ +@Fluent +public final class TagAutoGenerated22 implements JsonSerializable { + /* + * The tag key. + */ + private String key; + + /* + * The tag value. + */ + private String value; + + /** + * Creates an instance of TagAutoGenerated22 class. + */ + public TagAutoGenerated22() { + } + + /** + * Get the key property: The tag key. + * + * @return the key value. + */ + public String key() { + return this.key; + } + + /** + * Set the key property: The tag key. + * + * @param key the key value to set. + * @return the TagAutoGenerated22 object itself. + */ + public TagAutoGenerated22 withKey(String key) { + this.key = key; + return this; + } + + /** + * Get the value property: The tag value. + * + * @return the value value. + */ + public String value() { + return this.value; + } + + /** + * Set the value property: The tag value. + * + * @param value the value value to set. + * @return the TagAutoGenerated22 object itself. + */ + public TagAutoGenerated22 withValue(String value) { + this.value = value; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("key", this.key); + jsonWriter.writeStringField("value", this.value); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of TagAutoGenerated22 from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of TagAutoGenerated22 if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the TagAutoGenerated22. + */ + public static TagAutoGenerated22 fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + TagAutoGenerated22 deserializedTagAutoGenerated22 = new TagAutoGenerated22(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("key".equals(fieldName)) { + deserializedTagAutoGenerated22.key = reader.getString(); + } else if ("value".equals(fieldName)) { + deserializedTagAutoGenerated22.value = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedTagAutoGenerated22; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/TagAutoGenerated23.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/TagAutoGenerated23.java new file mode 100644 index 000000000000..1a0c13ec4c77 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/TagAutoGenerated23.java @@ -0,0 +1,133 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of Tag. + */ +@Fluent +public final class TagAutoGenerated23 implements JsonSerializable { + /* + * The key name of the tag. You can specify a value that is 1 to 128 Unicode characters in length and cannot be + * prefixed with aws:. You can use any of the following characters: the set of Unicode letters, digits, whitespace, + * _, ., /, =, +, and -. + */ + private String key; + + /* + * The value for the tag. You can specify a value that is 0 to 256 Unicode characters in length and cannot be + * prefixed with aws:. You can use any of the following characters: the set of Unicode letters, digits, whitespace, + * _, ., /, =, +, and -. + */ + private String value; + + /** + * Creates an instance of TagAutoGenerated23 class. + */ + public TagAutoGenerated23() { + } + + /** + * Get the key property: The key name of the tag. You can specify a value that is 1 to 128 Unicode characters in + * length and cannot be prefixed with aws:. You can use any of the following characters: the set of Unicode letters, + * digits, whitespace, _, ., /, =, +, and -. + * + * @return the key value. + */ + public String key() { + return this.key; + } + + /** + * Set the key property: The key name of the tag. You can specify a value that is 1 to 128 Unicode characters in + * length and cannot be prefixed with aws:. You can use any of the following characters: the set of Unicode letters, + * digits, whitespace, _, ., /, =, +, and -. + * + * @param key the key value to set. + * @return the TagAutoGenerated23 object itself. + */ + public TagAutoGenerated23 withKey(String key) { + this.key = key; + return this; + } + + /** + * Get the value property: The value for the tag. You can specify a value that is 0 to 256 Unicode characters in + * length and cannot be prefixed with aws:. You can use any of the following characters: the set of Unicode letters, + * digits, whitespace, _, ., /, =, +, and -. + * + * @return the value value. + */ + public String value() { + return this.value; + } + + /** + * Set the value property: The value for the tag. You can specify a value that is 0 to 256 Unicode characters in + * length and cannot be prefixed with aws:. You can use any of the following characters: the set of Unicode letters, + * digits, whitespace, _, ., /, =, +, and -. + * + * @param value the value value to set. + * @return the TagAutoGenerated23 object itself. + */ + public TagAutoGenerated23 withValue(String value) { + this.value = value; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("key", this.key); + jsonWriter.writeStringField("value", this.value); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of TagAutoGenerated23 from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of TagAutoGenerated23 if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the TagAutoGenerated23. + */ + public static TagAutoGenerated23 fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + TagAutoGenerated23 deserializedTagAutoGenerated23 = new TagAutoGenerated23(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("key".equals(fieldName)) { + deserializedTagAutoGenerated23.key = reader.getString(); + } else if ("value".equals(fieldName)) { + deserializedTagAutoGenerated23.value = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedTagAutoGenerated23; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/TagAutoGenerated24.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/TagAutoGenerated24.java new file mode 100644 index 000000000000..95e3575df40f --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/TagAutoGenerated24.java @@ -0,0 +1,124 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of Tag. + */ +@Fluent +public final class TagAutoGenerated24 implements JsonSerializable { + /* + * One part of a key-value pair that make up a tag. A ``key`` is a general label that acts like a category for more + * specific tag values. + */ + private String key; + + /* + * A ``value`` acts as a descriptor within a tag category (key). + */ + private String value; + + /** + * Creates an instance of TagAutoGenerated24 class. + */ + public TagAutoGenerated24() { + } + + /** + * Get the key property: One part of a key-value pair that make up a tag. A ``key`` is a general label that acts + * like a category for more specific tag values. + * + * @return the key value. + */ + public String key() { + return this.key; + } + + /** + * Set the key property: One part of a key-value pair that make up a tag. A ``key`` is a general label that acts + * like a category for more specific tag values. + * + * @param key the key value to set. + * @return the TagAutoGenerated24 object itself. + */ + public TagAutoGenerated24 withKey(String key) { + this.key = key; + return this; + } + + /** + * Get the value property: A ``value`` acts as a descriptor within a tag category (key). + * + * @return the value value. + */ + public String value() { + return this.value; + } + + /** + * Set the value property: A ``value`` acts as a descriptor within a tag category (key). + * + * @param value the value value to set. + * @return the TagAutoGenerated24 object itself. + */ + public TagAutoGenerated24 withValue(String value) { + this.value = value; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("key", this.key); + jsonWriter.writeStringField("value", this.value); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of TagAutoGenerated24 from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of TagAutoGenerated24 if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the TagAutoGenerated24. + */ + public static TagAutoGenerated24 fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + TagAutoGenerated24 deserializedTagAutoGenerated24 = new TagAutoGenerated24(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("key".equals(fieldName)) { + deserializedTagAutoGenerated24.key = reader.getString(); + } else if ("value".equals(fieldName)) { + deserializedTagAutoGenerated24.value = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedTagAutoGenerated24; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/TagAutoGenerated25.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/TagAutoGenerated25.java new file mode 100644 index 000000000000..28c431ea12e4 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/TagAutoGenerated25.java @@ -0,0 +1,127 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of Tag. + */ +@Fluent +public final class TagAutoGenerated25 implements JsonSerializable { + /* + * One part of a key-value pair that make up a tag. A ``key`` is a general label that acts like a category for more + * specific tag values. + */ + private String key; + + /* + * The optional part of a key-value pair that make up a tag. A ``value`` acts as a descriptor within a tag category + * (key). + */ + private String value; + + /** + * Creates an instance of TagAutoGenerated25 class. + */ + public TagAutoGenerated25() { + } + + /** + * Get the key property: One part of a key-value pair that make up a tag. A ``key`` is a general label that acts + * like a category for more specific tag values. + * + * @return the key value. + */ + public String key() { + return this.key; + } + + /** + * Set the key property: One part of a key-value pair that make up a tag. A ``key`` is a general label that acts + * like a category for more specific tag values. + * + * @param key the key value to set. + * @return the TagAutoGenerated25 object itself. + */ + public TagAutoGenerated25 withKey(String key) { + this.key = key; + return this; + } + + /** + * Get the value property: The optional part of a key-value pair that make up a tag. A ``value`` acts as a + * descriptor within a tag category (key). + * + * @return the value value. + */ + public String value() { + return this.value; + } + + /** + * Set the value property: The optional part of a key-value pair that make up a tag. A ``value`` acts as a + * descriptor within a tag category (key). + * + * @param value the value value to set. + * @return the TagAutoGenerated25 object itself. + */ + public TagAutoGenerated25 withValue(String value) { + this.value = value; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("key", this.key); + jsonWriter.writeStringField("value", this.value); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of TagAutoGenerated25 from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of TagAutoGenerated25 if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the TagAutoGenerated25. + */ + public static TagAutoGenerated25 fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + TagAutoGenerated25 deserializedTagAutoGenerated25 = new TagAutoGenerated25(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("key".equals(fieldName)) { + deserializedTagAutoGenerated25.key = reader.getString(); + } else if ("value".equals(fieldName)) { + deserializedTagAutoGenerated25.value = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedTagAutoGenerated25; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/TagAutoGenerated26.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/TagAutoGenerated26.java new file mode 100644 index 000000000000..7555806546cc --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/TagAutoGenerated26.java @@ -0,0 +1,127 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of Tag. + */ +@Fluent +public final class TagAutoGenerated26 implements JsonSerializable { + /* + * One part of a key-value pair that make up a tag. A ``key`` is a general label that acts like a category for more + * specific tag values. + */ + private String key; + + /* + * The optional part of a key-value pair that make up a tag. A ``value`` acts as a descriptor within a tag category + * (key). + */ + private String value; + + /** + * Creates an instance of TagAutoGenerated26 class. + */ + public TagAutoGenerated26() { + } + + /** + * Get the key property: One part of a key-value pair that make up a tag. A ``key`` is a general label that acts + * like a category for more specific tag values. + * + * @return the key value. + */ + public String key() { + return this.key; + } + + /** + * Set the key property: One part of a key-value pair that make up a tag. A ``key`` is a general label that acts + * like a category for more specific tag values. + * + * @param key the key value to set. + * @return the TagAutoGenerated26 object itself. + */ + public TagAutoGenerated26 withKey(String key) { + this.key = key; + return this; + } + + /** + * Get the value property: The optional part of a key-value pair that make up a tag. A ``value`` acts as a + * descriptor within a tag category (key). + * + * @return the value value. + */ + public String value() { + return this.value; + } + + /** + * Set the value property: The optional part of a key-value pair that make up a tag. A ``value`` acts as a + * descriptor within a tag category (key). + * + * @param value the value value to set. + * @return the TagAutoGenerated26 object itself. + */ + public TagAutoGenerated26 withValue(String value) { + this.value = value; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("key", this.key); + jsonWriter.writeStringField("value", this.value); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of TagAutoGenerated26 from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of TagAutoGenerated26 if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the TagAutoGenerated26. + */ + public static TagAutoGenerated26 fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + TagAutoGenerated26 deserializedTagAutoGenerated26 = new TagAutoGenerated26(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("key".equals(fieldName)) { + deserializedTagAutoGenerated26.key = reader.getString(); + } else if ("value".equals(fieldName)) { + deserializedTagAutoGenerated26.value = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedTagAutoGenerated26; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/TagAutoGenerated27.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/TagAutoGenerated27.java new file mode 100644 index 000000000000..1dea4fa4a091 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/TagAutoGenerated27.java @@ -0,0 +1,127 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of Tag. + */ +@Fluent +public final class TagAutoGenerated27 implements JsonSerializable { + /* + * One part of a key-value pair that make up a tag. A ``key`` is a general label that acts like a category for more + * specific tag values. + */ + private String key; + + /* + * The optional part of a key-value pair that make up a tag. A ``value`` acts as a descriptor within a tag category + * (key). + */ + private String value; + + /** + * Creates an instance of TagAutoGenerated27 class. + */ + public TagAutoGenerated27() { + } + + /** + * Get the key property: One part of a key-value pair that make up a tag. A ``key`` is a general label that acts + * like a category for more specific tag values. + * + * @return the key value. + */ + public String key() { + return this.key; + } + + /** + * Set the key property: One part of a key-value pair that make up a tag. A ``key`` is a general label that acts + * like a category for more specific tag values. + * + * @param key the key value to set. + * @return the TagAutoGenerated27 object itself. + */ + public TagAutoGenerated27 withKey(String key) { + this.key = key; + return this; + } + + /** + * Get the value property: The optional part of a key-value pair that make up a tag. A ``value`` acts as a + * descriptor within a tag category (key). + * + * @return the value value. + */ + public String value() { + return this.value; + } + + /** + * Set the value property: The optional part of a key-value pair that make up a tag. A ``value`` acts as a + * descriptor within a tag category (key). + * + * @param value the value value to set. + * @return the TagAutoGenerated27 object itself. + */ + public TagAutoGenerated27 withValue(String value) { + this.value = value; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("key", this.key); + jsonWriter.writeStringField("value", this.value); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of TagAutoGenerated27 from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of TagAutoGenerated27 if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the TagAutoGenerated27. + */ + public static TagAutoGenerated27 fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + TagAutoGenerated27 deserializedTagAutoGenerated27 = new TagAutoGenerated27(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("key".equals(fieldName)) { + deserializedTagAutoGenerated27.key = reader.getString(); + } else if ("value".equals(fieldName)) { + deserializedTagAutoGenerated27.value = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedTagAutoGenerated27; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/TagAutoGenerated28.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/TagAutoGenerated28.java new file mode 100644 index 000000000000..c445a77d0411 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/TagAutoGenerated28.java @@ -0,0 +1,121 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of Tag. + */ +@Fluent +public final class TagAutoGenerated28 implements JsonSerializable { + /* + * The key name of the tag. + */ + private String key; + + /* + * The value for the tag. + */ + private String value; + + /** + * Creates an instance of TagAutoGenerated28 class. + */ + public TagAutoGenerated28() { + } + + /** + * Get the key property: The key name of the tag. + * + * @return the key value. + */ + public String key() { + return this.key; + } + + /** + * Set the key property: The key name of the tag. + * + * @param key the key value to set. + * @return the TagAutoGenerated28 object itself. + */ + public TagAutoGenerated28 withKey(String key) { + this.key = key; + return this; + } + + /** + * Get the value property: The value for the tag. + * + * @return the value value. + */ + public String value() { + return this.value; + } + + /** + * Set the value property: The value for the tag. + * + * @param value the value value to set. + * @return the TagAutoGenerated28 object itself. + */ + public TagAutoGenerated28 withValue(String value) { + this.value = value; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("key", this.key); + jsonWriter.writeStringField("value", this.value); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of TagAutoGenerated28 from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of TagAutoGenerated28 if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the TagAutoGenerated28. + */ + public static TagAutoGenerated28 fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + TagAutoGenerated28 deserializedTagAutoGenerated28 = new TagAutoGenerated28(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("key".equals(fieldName)) { + deserializedTagAutoGenerated28.key = reader.getString(); + } else if ("value".equals(fieldName)) { + deserializedTagAutoGenerated28.value = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedTagAutoGenerated28; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/TagAutoGenerated29.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/TagAutoGenerated29.java new file mode 100644 index 000000000000..65bd141e2ca7 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/TagAutoGenerated29.java @@ -0,0 +1,121 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of Tag. + */ +@Fluent +public final class TagAutoGenerated29 implements JsonSerializable { + /* + * The key of the tag. + */ + private String key; + + /* + * The value of the tag. + */ + private String value; + + /** + * Creates an instance of TagAutoGenerated29 class. + */ + public TagAutoGenerated29() { + } + + /** + * Get the key property: The key of the tag. + * + * @return the key value. + */ + public String key() { + return this.key; + } + + /** + * Set the key property: The key of the tag. + * + * @param key the key value to set. + * @return the TagAutoGenerated29 object itself. + */ + public TagAutoGenerated29 withKey(String key) { + this.key = key; + return this; + } + + /** + * Get the value property: The value of the tag. + * + * @return the value value. + */ + public String value() { + return this.value; + } + + /** + * Set the value property: The value of the tag. + * + * @param value the value value to set. + * @return the TagAutoGenerated29 object itself. + */ + public TagAutoGenerated29 withValue(String value) { + this.value = value; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("key", this.key); + jsonWriter.writeStringField("value", this.value); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of TagAutoGenerated29 from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of TagAutoGenerated29 if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the TagAutoGenerated29. + */ + public static TagAutoGenerated29 fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + TagAutoGenerated29 deserializedTagAutoGenerated29 = new TagAutoGenerated29(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("key".equals(fieldName)) { + deserializedTagAutoGenerated29.key = reader.getString(); + } else if ("value".equals(fieldName)) { + deserializedTagAutoGenerated29.value = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedTagAutoGenerated29; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/TagAutoGenerated3.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/TagAutoGenerated3.java new file mode 100644 index 000000000000..ed119416737d --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/TagAutoGenerated3.java @@ -0,0 +1,121 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of Tag. + */ +@Fluent +public final class TagAutoGenerated3 implements JsonSerializable { + /* + * Property key + */ + private String key; + + /* + * Property value + */ + private String value; + + /** + * Creates an instance of TagAutoGenerated3 class. + */ + public TagAutoGenerated3() { + } + + /** + * Get the key property: Property key. + * + * @return the key value. + */ + public String key() { + return this.key; + } + + /** + * Set the key property: Property key. + * + * @param key the key value to set. + * @return the TagAutoGenerated3 object itself. + */ + public TagAutoGenerated3 withKey(String key) { + this.key = key; + return this; + } + + /** + * Get the value property: Property value. + * + * @return the value value. + */ + public String value() { + return this.value; + } + + /** + * Set the value property: Property value. + * + * @param value the value value to set. + * @return the TagAutoGenerated3 object itself. + */ + public TagAutoGenerated3 withValue(String value) { + this.value = value; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("key", this.key); + jsonWriter.writeStringField("value", this.value); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of TagAutoGenerated3 from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of TagAutoGenerated3 if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the TagAutoGenerated3. + */ + public static TagAutoGenerated3 fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + TagAutoGenerated3 deserializedTagAutoGenerated3 = new TagAutoGenerated3(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("key".equals(fieldName)) { + deserializedTagAutoGenerated3.key = reader.getString(); + } else if ("value".equals(fieldName)) { + deserializedTagAutoGenerated3.value = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedTagAutoGenerated3; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/TagAutoGenerated30.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/TagAutoGenerated30.java new file mode 100644 index 000000000000..397e5da71b21 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/TagAutoGenerated30.java @@ -0,0 +1,121 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of Tag. + */ +@Fluent +public final class TagAutoGenerated30 implements JsonSerializable { + /* + * The value for the tag. + */ + private String key; + + /* + * The key name of the tag. + */ + private String value; + + /** + * Creates an instance of TagAutoGenerated30 class. + */ + public TagAutoGenerated30() { + } + + /** + * Get the key property: The value for the tag. + * + * @return the key value. + */ + public String key() { + return this.key; + } + + /** + * Set the key property: The value for the tag. + * + * @param key the key value to set. + * @return the TagAutoGenerated30 object itself. + */ + public TagAutoGenerated30 withKey(String key) { + this.key = key; + return this; + } + + /** + * Get the value property: The key name of the tag. + * + * @return the value value. + */ + public String value() { + return this.value; + } + + /** + * Set the value property: The key name of the tag. + * + * @param value the value value to set. + * @return the TagAutoGenerated30 object itself. + */ + public TagAutoGenerated30 withValue(String value) { + this.value = value; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("key", this.key); + jsonWriter.writeStringField("value", this.value); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of TagAutoGenerated30 from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of TagAutoGenerated30 if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the TagAutoGenerated30. + */ + public static TagAutoGenerated30 fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + TagAutoGenerated30 deserializedTagAutoGenerated30 = new TagAutoGenerated30(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("key".equals(fieldName)) { + deserializedTagAutoGenerated30.key = reader.getString(); + } else if ("value".equals(fieldName)) { + deserializedTagAutoGenerated30.value = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedTagAutoGenerated30; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/TagAutoGenerated31.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/TagAutoGenerated31.java new file mode 100644 index 000000000000..29fb38973c7e --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/TagAutoGenerated31.java @@ -0,0 +1,131 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of Tag. + */ +@Fluent +public final class TagAutoGenerated31 implements JsonSerializable { + /* + *

A user-defined key, which is the minimum required information for a valid tag. For more information, see Tag.

+ */ + private String key; + + /* + *

A user-defined value, which is optional in a tag. For more information, see Tag Clusters.

+ */ + private String value; + + /** + * Creates an instance of TagAutoGenerated31 class. + */ + public TagAutoGenerated31() { + } + + /** + * Get the key property: <p>A user-defined key, which is the minimum required information for a valid tag. For + * more information, see <a + * href='https://docs.aws.amazon.com/emr/latest/ManagementGuide/emr-plan-tags.html'>Tag</a>. </p>. + * + * @return the key value. + */ + public String key() { + return this.key; + } + + /** + * Set the key property: <p>A user-defined key, which is the minimum required information for a valid tag. For + * more information, see <a + * href='https://docs.aws.amazon.com/emr/latest/ManagementGuide/emr-plan-tags.html'>Tag</a>. </p>. + * + * @param key the key value to set. + * @return the TagAutoGenerated31 object itself. + */ + public TagAutoGenerated31 withKey(String key) { + this.key = key; + return this; + } + + /** + * Get the value property: <p>A user-defined value, which is optional in a tag. For more information, see + * <a href='https://docs.aws.amazon.com/emr/latest/ManagementGuide/emr-plan-tags.html'>Tag Clusters</a>. + * </p>. + * + * @return the value value. + */ + public String value() { + return this.value; + } + + /** + * Set the value property: <p>A user-defined value, which is optional in a tag. For more information, see + * <a href='https://docs.aws.amazon.com/emr/latest/ManagementGuide/emr-plan-tags.html'>Tag Clusters</a>. + * </p>. + * + * @param value the value value to set. + * @return the TagAutoGenerated31 object itself. + */ + public TagAutoGenerated31 withValue(String value) { + this.value = value; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("key", this.key); + jsonWriter.writeStringField("value", this.value); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of TagAutoGenerated31 from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of TagAutoGenerated31 if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the TagAutoGenerated31. + */ + public static TagAutoGenerated31 fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + TagAutoGenerated31 deserializedTagAutoGenerated31 = new TagAutoGenerated31(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("key".equals(fieldName)) { + deserializedTagAutoGenerated31.key = reader.getString(); + } else if ("value".equals(fieldName)) { + deserializedTagAutoGenerated31.value = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedTagAutoGenerated31; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/TagAutoGenerated32.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/TagAutoGenerated32.java new file mode 100644 index 000000000000..ba63292ad864 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/TagAutoGenerated32.java @@ -0,0 +1,139 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of Tag. + */ +@Fluent +public final class TagAutoGenerated32 implements JsonSerializable { + /* + * The key name that can be used to look up or retrieve the associated value. For example, ``Department`` or ``Cost + * Center`` are common choices. + */ + private String key; + + /* + * The value associated with this tag. For example, tags with a key name of ``Department`` could have values such as + * ``Human Resources``, ``Accounting``, and ``Support``. Tags with a key name of ``Cost Center`` might have values + * that consist of the number associated with the different cost centers in your company. Typically, many resources + * have tags with the same key name but with different values. AWS always interprets the tag ``Value`` as a single + * string. If you need to store an array, you can store comma-separated values in the string. However, you must + * interpret the value in your code. + */ + private String value; + + /** + * Creates an instance of TagAutoGenerated32 class. + */ + public TagAutoGenerated32() { + } + + /** + * Get the key property: The key name that can be used to look up or retrieve the associated value. For example, + * ``Department`` or ``Cost Center`` are common choices. + * + * @return the key value. + */ + public String key() { + return this.key; + } + + /** + * Set the key property: The key name that can be used to look up or retrieve the associated value. For example, + * ``Department`` or ``Cost Center`` are common choices. + * + * @param key the key value to set. + * @return the TagAutoGenerated32 object itself. + */ + public TagAutoGenerated32 withKey(String key) { + this.key = key; + return this; + } + + /** + * Get the value property: The value associated with this tag. For example, tags with a key name of ``Department`` + * could have values such as ``Human Resources``, ``Accounting``, and ``Support``. Tags with a key name of ``Cost + * Center`` might have values that consist of the number associated with the different cost centers in your company. + * Typically, many resources have tags with the same key name but with different values. AWS always interprets the + * tag ``Value`` as a single string. If you need to store an array, you can store comma-separated values in the + * string. However, you must interpret the value in your code. + * + * @return the value value. + */ + public String value() { + return this.value; + } + + /** + * Set the value property: The value associated with this tag. For example, tags with a key name of ``Department`` + * could have values such as ``Human Resources``, ``Accounting``, and ``Support``. Tags with a key name of ``Cost + * Center`` might have values that consist of the number associated with the different cost centers in your company. + * Typically, many resources have tags with the same key name but with different values. AWS always interprets the + * tag ``Value`` as a single string. If you need to store an array, you can store comma-separated values in the + * string. However, you must interpret the value in your code. + * + * @param value the value value to set. + * @return the TagAutoGenerated32 object itself. + */ + public TagAutoGenerated32 withValue(String value) { + this.value = value; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("key", this.key); + jsonWriter.writeStringField("value", this.value); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of TagAutoGenerated32 from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of TagAutoGenerated32 if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the TagAutoGenerated32. + */ + public static TagAutoGenerated32 fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + TagAutoGenerated32 deserializedTagAutoGenerated32 = new TagAutoGenerated32(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("key".equals(fieldName)) { + deserializedTagAutoGenerated32.key = reader.getString(); + } else if ("value".equals(fieldName)) { + deserializedTagAutoGenerated32.value = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedTagAutoGenerated32; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/TagAutoGenerated33.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/TagAutoGenerated33.java new file mode 100644 index 000000000000..8353adec9256 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/TagAutoGenerated33.java @@ -0,0 +1,133 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of Tag. + */ +@Fluent +public final class TagAutoGenerated33 implements JsonSerializable { + /* + * The key name of the tag. You can specify a value that is 1 to 128 Unicode characters in length and cannot be + * prefixed with aws:. You can use any of the following characters: the set of Unicode letters, digits, whitespace, + * _, ., /, =, +, and -. + */ + private String key; + + /* + * The value for the tag. You can specify a value that is 0 to 256 Unicode characters in length and cannot be + * prefixed with aws:. You can use any of the following characters: the set of Unicode letters, digits, whitespace, + * _, ., /, =, +, and -. + */ + private String value; + + /** + * Creates an instance of TagAutoGenerated33 class. + */ + public TagAutoGenerated33() { + } + + /** + * Get the key property: The key name of the tag. You can specify a value that is 1 to 128 Unicode characters in + * length and cannot be prefixed with aws:. You can use any of the following characters: the set of Unicode letters, + * digits, whitespace, _, ., /, =, +, and -. + * + * @return the key value. + */ + public String key() { + return this.key; + } + + /** + * Set the key property: The key name of the tag. You can specify a value that is 1 to 128 Unicode characters in + * length and cannot be prefixed with aws:. You can use any of the following characters: the set of Unicode letters, + * digits, whitespace, _, ., /, =, +, and -. + * + * @param key the key value to set. + * @return the TagAutoGenerated33 object itself. + */ + public TagAutoGenerated33 withKey(String key) { + this.key = key; + return this; + } + + /** + * Get the value property: The value for the tag. You can specify a value that is 0 to 256 Unicode characters in + * length and cannot be prefixed with aws:. You can use any of the following characters: the set of Unicode letters, + * digits, whitespace, _, ., /, =, +, and -. + * + * @return the value value. + */ + public String value() { + return this.value; + } + + /** + * Set the value property: The value for the tag. You can specify a value that is 0 to 256 Unicode characters in + * length and cannot be prefixed with aws:. You can use any of the following characters: the set of Unicode letters, + * digits, whitespace, _, ., /, =, +, and -. + * + * @param value the value value to set. + * @return the TagAutoGenerated33 object itself. + */ + public TagAutoGenerated33 withValue(String value) { + this.value = value; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("key", this.key); + jsonWriter.writeStringField("value", this.value); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of TagAutoGenerated33 from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of TagAutoGenerated33 if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the TagAutoGenerated33. + */ + public static TagAutoGenerated33 fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + TagAutoGenerated33 deserializedTagAutoGenerated33 = new TagAutoGenerated33(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("key".equals(fieldName)) { + deserializedTagAutoGenerated33.key = reader.getString(); + } else if ("value".equals(fieldName)) { + deserializedTagAutoGenerated33.value = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedTagAutoGenerated33; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/TagAutoGenerated34.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/TagAutoGenerated34.java new file mode 100644 index 000000000000..a0c5731e56be --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/TagAutoGenerated34.java @@ -0,0 +1,133 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of Tag. + */ +@Fluent +public final class TagAutoGenerated34 implements JsonSerializable { + /* + * The key name of the tag. You can specify a value that is 1 to 128 Unicode characters in length and cannot be + * prefixed with aws:. You can use any of the following characters: the set of Unicode letters, digits, whitespace, + * _, ., /, =, +, and -. + */ + private String key; + + /* + * The value for the tag. You can specify a value that is 0 to 256 Unicode characters in length and cannot be + * prefixed with aws:. You can use any of the following characters: the set of Unicode letters, digits, whitespace, + * _, ., /, =, +, and -. + */ + private String value; + + /** + * Creates an instance of TagAutoGenerated34 class. + */ + public TagAutoGenerated34() { + } + + /** + * Get the key property: The key name of the tag. You can specify a value that is 1 to 128 Unicode characters in + * length and cannot be prefixed with aws:. You can use any of the following characters: the set of Unicode letters, + * digits, whitespace, _, ., /, =, +, and -. + * + * @return the key value. + */ + public String key() { + return this.key; + } + + /** + * Set the key property: The key name of the tag. You can specify a value that is 1 to 128 Unicode characters in + * length and cannot be prefixed with aws:. You can use any of the following characters: the set of Unicode letters, + * digits, whitespace, _, ., /, =, +, and -. + * + * @param key the key value to set. + * @return the TagAutoGenerated34 object itself. + */ + public TagAutoGenerated34 withKey(String key) { + this.key = key; + return this; + } + + /** + * Get the value property: The value for the tag. You can specify a value that is 0 to 256 Unicode characters in + * length and cannot be prefixed with aws:. You can use any of the following characters: the set of Unicode letters, + * digits, whitespace, _, ., /, =, +, and -. + * + * @return the value value. + */ + public String value() { + return this.value; + } + + /** + * Set the value property: The value for the tag. You can specify a value that is 0 to 256 Unicode characters in + * length and cannot be prefixed with aws:. You can use any of the following characters: the set of Unicode letters, + * digits, whitespace, _, ., /, =, +, and -. + * + * @param value the value value to set. + * @return the TagAutoGenerated34 object itself. + */ + public TagAutoGenerated34 withValue(String value) { + this.value = value; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("key", this.key); + jsonWriter.writeStringField("value", this.value); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of TagAutoGenerated34 from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of TagAutoGenerated34 if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the TagAutoGenerated34. + */ + public static TagAutoGenerated34 fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + TagAutoGenerated34 deserializedTagAutoGenerated34 = new TagAutoGenerated34(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("key".equals(fieldName)) { + deserializedTagAutoGenerated34.key = reader.getString(); + } else if ("value".equals(fieldName)) { + deserializedTagAutoGenerated34.value = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedTagAutoGenerated34; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/TagAutoGenerated35.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/TagAutoGenerated35.java new file mode 100644 index 000000000000..cff70abc2a14 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/TagAutoGenerated35.java @@ -0,0 +1,121 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of Tag. + */ +@Fluent +public final class TagAutoGenerated35 implements JsonSerializable { + /* + * Property key + */ + private String key; + + /* + * Property value + */ + private String value; + + /** + * Creates an instance of TagAutoGenerated35 class. + */ + public TagAutoGenerated35() { + } + + /** + * Get the key property: Property key. + * + * @return the key value. + */ + public String key() { + return this.key; + } + + /** + * Set the key property: Property key. + * + * @param key the key value to set. + * @return the TagAutoGenerated35 object itself. + */ + public TagAutoGenerated35 withKey(String key) { + this.key = key; + return this; + } + + /** + * Get the value property: Property value. + * + * @return the value value. + */ + public String value() { + return this.value; + } + + /** + * Set the value property: Property value. + * + * @param value the value value to set. + * @return the TagAutoGenerated35 object itself. + */ + public TagAutoGenerated35 withValue(String value) { + this.value = value; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("key", this.key); + jsonWriter.writeStringField("value", this.value); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of TagAutoGenerated35 from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of TagAutoGenerated35 if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the TagAutoGenerated35. + */ + public static TagAutoGenerated35 fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + TagAutoGenerated35 deserializedTagAutoGenerated35 = new TagAutoGenerated35(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("key".equals(fieldName)) { + deserializedTagAutoGenerated35.key = reader.getString(); + } else if ("value".equals(fieldName)) { + deserializedTagAutoGenerated35.value = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedTagAutoGenerated35; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/TagAutoGenerated36.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/TagAutoGenerated36.java new file mode 100644 index 000000000000..cbe01439ee54 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/TagAutoGenerated36.java @@ -0,0 +1,121 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of Tag. + */ +@Fluent +public final class TagAutoGenerated36 implements JsonSerializable { + /* + * Property key + */ + private String key; + + /* + * Property value + */ + private String value; + + /** + * Creates an instance of TagAutoGenerated36 class. + */ + public TagAutoGenerated36() { + } + + /** + * Get the key property: Property key. + * + * @return the key value. + */ + public String key() { + return this.key; + } + + /** + * Set the key property: Property key. + * + * @param key the key value to set. + * @return the TagAutoGenerated36 object itself. + */ + public TagAutoGenerated36 withKey(String key) { + this.key = key; + return this; + } + + /** + * Get the value property: Property value. + * + * @return the value value. + */ + public String value() { + return this.value; + } + + /** + * Set the value property: Property value. + * + * @param value the value value to set. + * @return the TagAutoGenerated36 object itself. + */ + public TagAutoGenerated36 withValue(String value) { + this.value = value; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("key", this.key); + jsonWriter.writeStringField("value", this.value); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of TagAutoGenerated36 from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of TagAutoGenerated36 if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the TagAutoGenerated36. + */ + public static TagAutoGenerated36 fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + TagAutoGenerated36 deserializedTagAutoGenerated36 = new TagAutoGenerated36(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("key".equals(fieldName)) { + deserializedTagAutoGenerated36.key = reader.getString(); + } else if ("value".equals(fieldName)) { + deserializedTagAutoGenerated36.value = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedTagAutoGenerated36; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/TagAutoGenerated37.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/TagAutoGenerated37.java new file mode 100644 index 000000000000..bcc71c3469b4 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/TagAutoGenerated37.java @@ -0,0 +1,133 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of Tag. + */ +@Fluent +public final class TagAutoGenerated37 implements JsonSerializable { + /* + * The key name of the tag. You can specify a value that is 1 to 128 Unicode characters in length and cannot be + * prefixed with aws:. You can use any of the following characters: the set of Unicode letters, digits, whitespace, + * _, ., /, =, +, and -. + */ + private String key; + + /* + * The value for the tag. You can specify a value that is 0 to 256 Unicode characters in length and cannot be + * prefixed with aws:. You can use any of the following characters: the set of Unicode letters, digits, whitespace, + * _, ., /, =, +, and -. + */ + private String value; + + /** + * Creates an instance of TagAutoGenerated37 class. + */ + public TagAutoGenerated37() { + } + + /** + * Get the key property: The key name of the tag. You can specify a value that is 1 to 128 Unicode characters in + * length and cannot be prefixed with aws:. You can use any of the following characters: the set of Unicode letters, + * digits, whitespace, _, ., /, =, +, and -. + * + * @return the key value. + */ + public String key() { + return this.key; + } + + /** + * Set the key property: The key name of the tag. You can specify a value that is 1 to 128 Unicode characters in + * length and cannot be prefixed with aws:. You can use any of the following characters: the set of Unicode letters, + * digits, whitespace, _, ., /, =, +, and -. + * + * @param key the key value to set. + * @return the TagAutoGenerated37 object itself. + */ + public TagAutoGenerated37 withKey(String key) { + this.key = key; + return this; + } + + /** + * Get the value property: The value for the tag. You can specify a value that is 0 to 256 Unicode characters in + * length and cannot be prefixed with aws:. You can use any of the following characters: the set of Unicode letters, + * digits, whitespace, _, ., /, =, +, and -. + * + * @return the value value. + */ + public String value() { + return this.value; + } + + /** + * Set the value property: The value for the tag. You can specify a value that is 0 to 256 Unicode characters in + * length and cannot be prefixed with aws:. You can use any of the following characters: the set of Unicode letters, + * digits, whitespace, _, ., /, =, +, and -. + * + * @param value the value value to set. + * @return the TagAutoGenerated37 object itself. + */ + public TagAutoGenerated37 withValue(String value) { + this.value = value; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("key", this.key); + jsonWriter.writeStringField("value", this.value); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of TagAutoGenerated37 from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of TagAutoGenerated37 if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the TagAutoGenerated37. + */ + public static TagAutoGenerated37 fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + TagAutoGenerated37 deserializedTagAutoGenerated37 = new TagAutoGenerated37(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("key".equals(fieldName)) { + deserializedTagAutoGenerated37.key = reader.getString(); + } else if ("value".equals(fieldName)) { + deserializedTagAutoGenerated37.value = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedTagAutoGenerated37; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/TagAutoGenerated38.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/TagAutoGenerated38.java new file mode 100644 index 000000000000..61ab1d519fea --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/TagAutoGenerated38.java @@ -0,0 +1,133 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of Tag. + */ +@Fluent +public final class TagAutoGenerated38 implements JsonSerializable { + /* + * The key name of the tag. You can specify a value that is 1 to 128 Unicode characters in length and cannot be + * prefixed with aws:. You can use any of the following characters: the set of Unicode letters, digits, whitespace, + * _, ., /, =, +, and -. + */ + private String key; + + /* + * The value for the tag. You can specify a value that is 0 to 256 Unicode characters in length and cannot be + * prefixed with aws:. You can use any of the following characters: the set of Unicode letters, digits, whitespace, + * _, ., /, =, +, and -. + */ + private String value; + + /** + * Creates an instance of TagAutoGenerated38 class. + */ + public TagAutoGenerated38() { + } + + /** + * Get the key property: The key name of the tag. You can specify a value that is 1 to 128 Unicode characters in + * length and cannot be prefixed with aws:. You can use any of the following characters: the set of Unicode letters, + * digits, whitespace, _, ., /, =, +, and -. + * + * @return the key value. + */ + public String key() { + return this.key; + } + + /** + * Set the key property: The key name of the tag. You can specify a value that is 1 to 128 Unicode characters in + * length and cannot be prefixed with aws:. You can use any of the following characters: the set of Unicode letters, + * digits, whitespace, _, ., /, =, +, and -. + * + * @param key the key value to set. + * @return the TagAutoGenerated38 object itself. + */ + public TagAutoGenerated38 withKey(String key) { + this.key = key; + return this; + } + + /** + * Get the value property: The value for the tag. You can specify a value that is 0 to 256 Unicode characters in + * length and cannot be prefixed with aws:. You can use any of the following characters: the set of Unicode letters, + * digits, whitespace, _, ., /, =, +, and -. + * + * @return the value value. + */ + public String value() { + return this.value; + } + + /** + * Set the value property: The value for the tag. You can specify a value that is 0 to 256 Unicode characters in + * length and cannot be prefixed with aws:. You can use any of the following characters: the set of Unicode letters, + * digits, whitespace, _, ., /, =, +, and -. + * + * @param value the value value to set. + * @return the TagAutoGenerated38 object itself. + */ + public TagAutoGenerated38 withValue(String value) { + this.value = value; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("key", this.key); + jsonWriter.writeStringField("value", this.value); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of TagAutoGenerated38 from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of TagAutoGenerated38 if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the TagAutoGenerated38. + */ + public static TagAutoGenerated38 fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + TagAutoGenerated38 deserializedTagAutoGenerated38 = new TagAutoGenerated38(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("key".equals(fieldName)) { + deserializedTagAutoGenerated38.key = reader.getString(); + } else if ("value".equals(fieldName)) { + deserializedTagAutoGenerated38.value = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedTagAutoGenerated38; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/TagAutoGenerated39.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/TagAutoGenerated39.java new file mode 100644 index 000000000000..9eb22d908aea --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/TagAutoGenerated39.java @@ -0,0 +1,121 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of Tag. + */ +@Fluent +public final class TagAutoGenerated39 implements JsonSerializable { + /* + * Property key + */ + private String key; + + /* + * Property value + */ + private String value; + + /** + * Creates an instance of TagAutoGenerated39 class. + */ + public TagAutoGenerated39() { + } + + /** + * Get the key property: Property key. + * + * @return the key value. + */ + public String key() { + return this.key; + } + + /** + * Set the key property: Property key. + * + * @param key the key value to set. + * @return the TagAutoGenerated39 object itself. + */ + public TagAutoGenerated39 withKey(String key) { + this.key = key; + return this; + } + + /** + * Get the value property: Property value. + * + * @return the value value. + */ + public String value() { + return this.value; + } + + /** + * Set the value property: Property value. + * + * @param value the value value to set. + * @return the TagAutoGenerated39 object itself. + */ + public TagAutoGenerated39 withValue(String value) { + this.value = value; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("key", this.key); + jsonWriter.writeStringField("value", this.value); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of TagAutoGenerated39 from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of TagAutoGenerated39 if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the TagAutoGenerated39. + */ + public static TagAutoGenerated39 fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + TagAutoGenerated39 deserializedTagAutoGenerated39 = new TagAutoGenerated39(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("key".equals(fieldName)) { + deserializedTagAutoGenerated39.key = reader.getString(); + } else if ("value".equals(fieldName)) { + deserializedTagAutoGenerated39.value = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedTagAutoGenerated39; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/TagAutoGenerated4.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/TagAutoGenerated4.java new file mode 100644 index 000000000000..4626fe394d6e --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/TagAutoGenerated4.java @@ -0,0 +1,125 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of Tag. + */ +@Fluent +public final class TagAutoGenerated4 implements JsonSerializable { + /* + * A string used to identify this tag. You can specify a maximum of 127 characters for a tag key. + */ + private String key; + + /* + * A string containing the value for this tag. You can specify a maximum of 256 characters for a tag value. + */ + private String value; + + /** + * Creates an instance of TagAutoGenerated4 class. + */ + public TagAutoGenerated4() { + } + + /** + * Get the key property: A string used to identify this tag. You can specify a maximum of 127 characters for a tag + * key. + * + * @return the key value. + */ + public String key() { + return this.key; + } + + /** + * Set the key property: A string used to identify this tag. You can specify a maximum of 127 characters for a tag + * key. + * + * @param key the key value to set. + * @return the TagAutoGenerated4 object itself. + */ + public TagAutoGenerated4 withKey(String key) { + this.key = key; + return this; + } + + /** + * Get the value property: A string containing the value for this tag. You can specify a maximum of 256 characters + * for a tag value. + * + * @return the value value. + */ + public String value() { + return this.value; + } + + /** + * Set the value property: A string containing the value for this tag. You can specify a maximum of 256 characters + * for a tag value. + * + * @param value the value value to set. + * @return the TagAutoGenerated4 object itself. + */ + public TagAutoGenerated4 withValue(String value) { + this.value = value; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("key", this.key); + jsonWriter.writeStringField("value", this.value); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of TagAutoGenerated4 from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of TagAutoGenerated4 if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the TagAutoGenerated4. + */ + public static TagAutoGenerated4 fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + TagAutoGenerated4 deserializedTagAutoGenerated4 = new TagAutoGenerated4(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("key".equals(fieldName)) { + deserializedTagAutoGenerated4.key = reader.getString(); + } else if ("value".equals(fieldName)) { + deserializedTagAutoGenerated4.value = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedTagAutoGenerated4; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/TagAutoGenerated40.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/TagAutoGenerated40.java new file mode 100644 index 000000000000..76b66bfcea69 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/TagAutoGenerated40.java @@ -0,0 +1,121 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of Tag. + */ +@Fluent +public final class TagAutoGenerated40 implements JsonSerializable { + /* + * The tag's key. + */ + private String key; + + /* + * The tag's value. + */ + private String value; + + /** + * Creates an instance of TagAutoGenerated40 class. + */ + public TagAutoGenerated40() { + } + + /** + * Get the key property: The tag's key. + * + * @return the key value. + */ + public String key() { + return this.key; + } + + /** + * Set the key property: The tag's key. + * + * @param key the key value to set. + * @return the TagAutoGenerated40 object itself. + */ + public TagAutoGenerated40 withKey(String key) { + this.key = key; + return this; + } + + /** + * Get the value property: The tag's value. + * + * @return the value value. + */ + public String value() { + return this.value; + } + + /** + * Set the value property: The tag's value. + * + * @param value the value value to set. + * @return the TagAutoGenerated40 object itself. + */ + public TagAutoGenerated40 withValue(String value) { + this.value = value; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("key", this.key); + jsonWriter.writeStringField("value", this.value); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of TagAutoGenerated40 from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of TagAutoGenerated40 if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the TagAutoGenerated40. + */ + public static TagAutoGenerated40 fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + TagAutoGenerated40 deserializedTagAutoGenerated40 = new TagAutoGenerated40(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("key".equals(fieldName)) { + deserializedTagAutoGenerated40.key = reader.getString(); + } else if ("value".equals(fieldName)) { + deserializedTagAutoGenerated40.value = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedTagAutoGenerated40; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/TagAutoGenerated41.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/TagAutoGenerated41.java new file mode 100644 index 000000000000..84612680c46d --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/TagAutoGenerated41.java @@ -0,0 +1,121 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of Tag. + */ +@Fluent +public final class TagAutoGenerated41 implements JsonSerializable { + /* + * Property key + */ + private String key; + + /* + * Property value + */ + private String value; + + /** + * Creates an instance of TagAutoGenerated41 class. + */ + public TagAutoGenerated41() { + } + + /** + * Get the key property: Property key. + * + * @return the key value. + */ + public String key() { + return this.key; + } + + /** + * Set the key property: Property key. + * + * @param key the key value to set. + * @return the TagAutoGenerated41 object itself. + */ + public TagAutoGenerated41 withKey(String key) { + this.key = key; + return this; + } + + /** + * Get the value property: Property value. + * + * @return the value value. + */ + public String value() { + return this.value; + } + + /** + * Set the value property: Property value. + * + * @param value the value value to set. + * @return the TagAutoGenerated41 object itself. + */ + public TagAutoGenerated41 withValue(String value) { + this.value = value; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("key", this.key); + jsonWriter.writeStringField("value", this.value); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of TagAutoGenerated41 from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of TagAutoGenerated41 if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the TagAutoGenerated41. + */ + public static TagAutoGenerated41 fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + TagAutoGenerated41 deserializedTagAutoGenerated41 = new TagAutoGenerated41(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("key".equals(fieldName)) { + deserializedTagAutoGenerated41.key = reader.getString(); + } else if ("value".equals(fieldName)) { + deserializedTagAutoGenerated41.value = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedTagAutoGenerated41; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/TagAutoGenerated42.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/TagAutoGenerated42.java new file mode 100644 index 000000000000..d6119e67cbd1 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/TagAutoGenerated42.java @@ -0,0 +1,121 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of Tag. + */ +@Fluent +public final class TagAutoGenerated42 implements JsonSerializable { + /* + * Property key + */ + private String key; + + /* + * Property value + */ + private String value; + + /** + * Creates an instance of TagAutoGenerated42 class. + */ + public TagAutoGenerated42() { + } + + /** + * Get the key property: Property key. + * + * @return the key value. + */ + public String key() { + return this.key; + } + + /** + * Set the key property: Property key. + * + * @param key the key value to set. + * @return the TagAutoGenerated42 object itself. + */ + public TagAutoGenerated42 withKey(String key) { + this.key = key; + return this; + } + + /** + * Get the value property: Property value. + * + * @return the value value. + */ + public String value() { + return this.value; + } + + /** + * Set the value property: Property value. + * + * @param value the value value to set. + * @return the TagAutoGenerated42 object itself. + */ + public TagAutoGenerated42 withValue(String value) { + this.value = value; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("key", this.key); + jsonWriter.writeStringField("value", this.value); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of TagAutoGenerated42 from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of TagAutoGenerated42 if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the TagAutoGenerated42. + */ + public static TagAutoGenerated42 fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + TagAutoGenerated42 deserializedTagAutoGenerated42 = new TagAutoGenerated42(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("key".equals(fieldName)) { + deserializedTagAutoGenerated42.key = reader.getString(); + } else if ("value".equals(fieldName)) { + deserializedTagAutoGenerated42.value = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedTagAutoGenerated42; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/TagAutoGenerated43.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/TagAutoGenerated43.java new file mode 100644 index 000000000000..549b2ba91394 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/TagAutoGenerated43.java @@ -0,0 +1,121 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of Tag. + */ +@Fluent +public final class TagAutoGenerated43 implements JsonSerializable { + /* + * Property key + */ + private String key; + + /* + * Property value + */ + private String value; + + /** + * Creates an instance of TagAutoGenerated43 class. + */ + public TagAutoGenerated43() { + } + + /** + * Get the key property: Property key. + * + * @return the key value. + */ + public String key() { + return this.key; + } + + /** + * Set the key property: Property key. + * + * @param key the key value to set. + * @return the TagAutoGenerated43 object itself. + */ + public TagAutoGenerated43 withKey(String key) { + this.key = key; + return this; + } + + /** + * Get the value property: Property value. + * + * @return the value value. + */ + public String value() { + return this.value; + } + + /** + * Set the value property: Property value. + * + * @param value the value value to set. + * @return the TagAutoGenerated43 object itself. + */ + public TagAutoGenerated43 withValue(String value) { + this.value = value; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("key", this.key); + jsonWriter.writeStringField("value", this.value); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of TagAutoGenerated43 from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of TagAutoGenerated43 if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the TagAutoGenerated43. + */ + public static TagAutoGenerated43 fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + TagAutoGenerated43 deserializedTagAutoGenerated43 = new TagAutoGenerated43(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("key".equals(fieldName)) { + deserializedTagAutoGenerated43.key = reader.getString(); + } else if ("value".equals(fieldName)) { + deserializedTagAutoGenerated43.value = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedTagAutoGenerated43; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/TagAutoGenerated44.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/TagAutoGenerated44.java new file mode 100644 index 000000000000..3b58b201c1ff --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/TagAutoGenerated44.java @@ -0,0 +1,124 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of Tag. + */ +@Fluent +public final class TagAutoGenerated44 implements JsonSerializable { + /* + * The key identifier, or name, of the tag. + */ + private String key; + + /* + * The string value that's associated with the key of the tag. You can set the value of a tag to an empty string, + * but you can't set the value of a tag to null. + */ + private String value; + + /** + * Creates an instance of TagAutoGenerated44 class. + */ + public TagAutoGenerated44() { + } + + /** + * Get the key property: The key identifier, or name, of the tag. + * + * @return the key value. + */ + public String key() { + return this.key; + } + + /** + * Set the key property: The key identifier, or name, of the tag. + * + * @param key the key value to set. + * @return the TagAutoGenerated44 object itself. + */ + public TagAutoGenerated44 withKey(String key) { + this.key = key; + return this; + } + + /** + * Get the value property: The string value that's associated with the key of the tag. You can set the value of a + * tag to an empty string, but you can't set the value of a tag to null. + * + * @return the value value. + */ + public String value() { + return this.value; + } + + /** + * Set the value property: The string value that's associated with the key of the tag. You can set the value of a + * tag to an empty string, but you can't set the value of a tag to null. + * + * @param value the value value to set. + * @return the TagAutoGenerated44 object itself. + */ + public TagAutoGenerated44 withValue(String value) { + this.value = value; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("key", this.key); + jsonWriter.writeStringField("value", this.value); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of TagAutoGenerated44 from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of TagAutoGenerated44 if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the TagAutoGenerated44. + */ + public static TagAutoGenerated44 fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + TagAutoGenerated44 deserializedTagAutoGenerated44 = new TagAutoGenerated44(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("key".equals(fieldName)) { + deserializedTagAutoGenerated44.key = reader.getString(); + } else if ("value".equals(fieldName)) { + deserializedTagAutoGenerated44.value = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedTagAutoGenerated44; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/TagAutoGenerated45.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/TagAutoGenerated45.java new file mode 100644 index 000000000000..fb174f58d6ae --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/TagAutoGenerated45.java @@ -0,0 +1,133 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of Tag. + */ +@Fluent +public final class TagAutoGenerated45 implements JsonSerializable { + /* + * The key name of the tag. You can specify a value that is 1 to 128 Unicode characters in length and cannot be + * prefixed with aws:. You can use any of the following characters: the set of Unicode letters, digits, whitespace, + * _, ., /, =, +, and -. + */ + private String key; + + /* + * The value for the tag. You can specify a value that is 0 to 256 Unicode characters in length and cannot be + * prefixed with aws:. You can use any of the following characters: the set of Unicode letters, digits, whitespace, + * _, ., /, =, +, and -. + */ + private String value; + + /** + * Creates an instance of TagAutoGenerated45 class. + */ + public TagAutoGenerated45() { + } + + /** + * Get the key property: The key name of the tag. You can specify a value that is 1 to 128 Unicode characters in + * length and cannot be prefixed with aws:. You can use any of the following characters: the set of Unicode letters, + * digits, whitespace, _, ., /, =, +, and -. + * + * @return the key value. + */ + public String key() { + return this.key; + } + + /** + * Set the key property: The key name of the tag. You can specify a value that is 1 to 128 Unicode characters in + * length and cannot be prefixed with aws:. You can use any of the following characters: the set of Unicode letters, + * digits, whitespace, _, ., /, =, +, and -. + * + * @param key the key value to set. + * @return the TagAutoGenerated45 object itself. + */ + public TagAutoGenerated45 withKey(String key) { + this.key = key; + return this; + } + + /** + * Get the value property: The value for the tag. You can specify a value that is 0 to 256 Unicode characters in + * length and cannot be prefixed with aws:. You can use any of the following characters: the set of Unicode letters, + * digits, whitespace, _, ., /, =, +, and -. + * + * @return the value value. + */ + public String value() { + return this.value; + } + + /** + * Set the value property: The value for the tag. You can specify a value that is 0 to 256 Unicode characters in + * length and cannot be prefixed with aws:. You can use any of the following characters: the set of Unicode letters, + * digits, whitespace, _, ., /, =, +, and -. + * + * @param value the value value to set. + * @return the TagAutoGenerated45 object itself. + */ + public TagAutoGenerated45 withValue(String value) { + this.value = value; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("key", this.key); + jsonWriter.writeStringField("value", this.value); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of TagAutoGenerated45 from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of TagAutoGenerated45 if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the TagAutoGenerated45. + */ + public static TagAutoGenerated45 fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + TagAutoGenerated45 deserializedTagAutoGenerated45 = new TagAutoGenerated45(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("key".equals(fieldName)) { + deserializedTagAutoGenerated45.key = reader.getString(); + } else if ("value".equals(fieldName)) { + deserializedTagAutoGenerated45.value = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedTagAutoGenerated45; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/TagAutoGenerated46.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/TagAutoGenerated46.java new file mode 100644 index 000000000000..30af51b2e1d6 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/TagAutoGenerated46.java @@ -0,0 +1,137 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of Tag. + */ +@Fluent +public final class TagAutoGenerated46 implements JsonSerializable { + /* + * A key is the required name of the tag. The string value can be from 1 to 128 Unicode characters in length and + * can't be prefixed with ``aws:`` or ``rds:``. The string can only contain only the set of Unicode letters, digits, + * white-space, '_', '.', ':', '/', '=', '+', '-', '@' (Java regex: '^([\\p{L}\\p{Z}\\p{N}_.:/=+\\-@]*)$'). + */ + private String key; + + /* + * A value is the optional value of the tag. The string value can be from 1 to 256 Unicode characters in length and + * can't be prefixed with ``aws:`` or ``rds:``. The string can only contain only the set of Unicode letters, digits, + * white-space, '_', '.', ':', '/', '=', '+', '-', '@' (Java regex: '^([\\p{L}\\p{Z}\\p{N}_.:/=+\\-@]*)$'). + */ + private String value; + + /** + * Creates an instance of TagAutoGenerated46 class. + */ + public TagAutoGenerated46() { + } + + /** + * Get the key property: A key is the required name of the tag. The string value can be from 1 to 128 Unicode + * characters in length and can't be prefixed with ``aws:`` or ``rds:``. The string can only contain only the set of + * Unicode letters, digits, white-space, '_', '.', ':', '/', '=', '+', '-', '@' (Java regex: + * '^([\\p{L}\\p{Z}\\p{N}_.:/=+\\-@]*)$'). + * + * @return the key value. + */ + public String key() { + return this.key; + } + + /** + * Set the key property: A key is the required name of the tag. The string value can be from 1 to 128 Unicode + * characters in length and can't be prefixed with ``aws:`` or ``rds:``. The string can only contain only the set of + * Unicode letters, digits, white-space, '_', '.', ':', '/', '=', '+', '-', '@' (Java regex: + * '^([\\p{L}\\p{Z}\\p{N}_.:/=+\\-@]*)$'). + * + * @param key the key value to set. + * @return the TagAutoGenerated46 object itself. + */ + public TagAutoGenerated46 withKey(String key) { + this.key = key; + return this; + } + + /** + * Get the value property: A value is the optional value of the tag. The string value can be from 1 to 256 Unicode + * characters in length and can't be prefixed with ``aws:`` or ``rds:``. The string can only contain only the set of + * Unicode letters, digits, white-space, '_', '.', ':', '/', '=', '+', '-', '@' (Java regex: + * '^([\\p{L}\\p{Z}\\p{N}_.:/=+\\-@]*)$'). + * + * @return the value value. + */ + public String value() { + return this.value; + } + + /** + * Set the value property: A value is the optional value of the tag. The string value can be from 1 to 256 Unicode + * characters in length and can't be prefixed with ``aws:`` or ``rds:``. The string can only contain only the set of + * Unicode letters, digits, white-space, '_', '.', ':', '/', '=', '+', '-', '@' (Java regex: + * '^([\\p{L}\\p{Z}\\p{N}_.:/=+\\-@]*)$'). + * + * @param value the value value to set. + * @return the TagAutoGenerated46 object itself. + */ + public TagAutoGenerated46 withValue(String value) { + this.value = value; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("key", this.key); + jsonWriter.writeStringField("value", this.value); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of TagAutoGenerated46 from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of TagAutoGenerated46 if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the TagAutoGenerated46. + */ + public static TagAutoGenerated46 fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + TagAutoGenerated46 deserializedTagAutoGenerated46 = new TagAutoGenerated46(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("key".equals(fieldName)) { + deserializedTagAutoGenerated46.key = reader.getString(); + } else if ("value".equals(fieldName)) { + deserializedTagAutoGenerated46.value = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedTagAutoGenerated46; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/TagAutoGenerated47.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/TagAutoGenerated47.java new file mode 100644 index 000000000000..5e39947a76fd --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/TagAutoGenerated47.java @@ -0,0 +1,139 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of Tag. + */ +@Fluent +public final class TagAutoGenerated47 implements JsonSerializable { + /* + *

A key is the required name of the tag. The string value can be from 1 to 128 Unicode characters in length and + * can't be prefixed with aws: or rds:. The string can only contain only the set of + * Unicode letters, digits, white-space, '_', '.', ':', '/', '=', '+', '-', '@' (Java regex: + * '^([\p{L}\p{Z}\p{N}_.:/=+\-@]*)$').

+ */ + private String key; + + /* + *

A value is the optional value of the tag. The string value can be from 1 to 256 Unicode characters in length + * and can't be prefixed with aws: or rds:. The string can only contain only the set of + * Unicode letters, digits, white-space, '_', '.', ':', '/', '=', '+', '-', '@' (Java regex: + * '^([\p{L}\p{Z}\p{N}_.:/=+\-@]*)$').

+ */ + private String value; + + /** + * Creates an instance of TagAutoGenerated47 class. + */ + public TagAutoGenerated47() { + } + + /** + * Get the key property: <p>A key is the required name of the tag. The string value can be from 1 to 128 + * Unicode characters in length and can't be prefixed with <code>aws:</code> or + * <code>rds:</code>. The string can only contain only the set of Unicode letters, digits, white-space, + * '_', '.', ':', '/', '=', '+', '-', '@' (Java regex: '^([\p{L}\p{Z}\p{N}_.:/=+\-@]*)$').</p>. + * + * @return the key value. + */ + public String key() { + return this.key; + } + + /** + * Set the key property: <p>A key is the required name of the tag. The string value can be from 1 to 128 + * Unicode characters in length and can't be prefixed with <code>aws:</code> or + * <code>rds:</code>. The string can only contain only the set of Unicode letters, digits, white-space, + * '_', '.', ':', '/', '=', '+', '-', '@' (Java regex: '^([\p{L}\p{Z}\p{N}_.:/=+\-@]*)$').</p>. + * + * @param key the key value to set. + * @return the TagAutoGenerated47 object itself. + */ + public TagAutoGenerated47 withKey(String key) { + this.key = key; + return this; + } + + /** + * Get the value property: <p>A value is the optional value of the tag. The string value can be from 1 to 256 + * Unicode characters in length and can't be prefixed with <code>aws:</code> or + * <code>rds:</code>. The string can only contain only the set of Unicode letters, digits, white-space, + * '_', '.', ':', '/', '=', '+', '-', '@' (Java regex: '^([\p{L}\p{Z}\p{N}_.:/=+\-@]*)$').</p>. + * + * @return the value value. + */ + public String value() { + return this.value; + } + + /** + * Set the value property: <p>A value is the optional value of the tag. The string value can be from 1 to 256 + * Unicode characters in length and can't be prefixed with <code>aws:</code> or + * <code>rds:</code>. The string can only contain only the set of Unicode letters, digits, white-space, + * '_', '.', ':', '/', '=', '+', '-', '@' (Java regex: '^([\p{L}\p{Z}\p{N}_.:/=+\-@]*)$').</p>. + * + * @param value the value value to set. + * @return the TagAutoGenerated47 object itself. + */ + public TagAutoGenerated47 withValue(String value) { + this.value = value; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("key", this.key); + jsonWriter.writeStringField("value", this.value); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of TagAutoGenerated47 from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of TagAutoGenerated47 if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the TagAutoGenerated47. + */ + public static TagAutoGenerated47 fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + TagAutoGenerated47 deserializedTagAutoGenerated47 = new TagAutoGenerated47(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("key".equals(fieldName)) { + deserializedTagAutoGenerated47.key = reader.getString(); + } else if ("value".equals(fieldName)) { + deserializedTagAutoGenerated47.value = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedTagAutoGenerated47; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/TagAutoGenerated48.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/TagAutoGenerated48.java new file mode 100644 index 000000000000..8a1c43994d82 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/TagAutoGenerated48.java @@ -0,0 +1,133 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of Tag. + */ +@Fluent +public final class TagAutoGenerated48 implements JsonSerializable { + /* + * The key name of the tag. You can specify a value that is 1 to 128 Unicode characters in length and cannot be + * prefixed with aws:. You can use any of the following characters: the set of Unicode letters, digits, whitespace, + * _, ., /, =, +, and -. + */ + private String key; + + /* + * The value for the tag. You can specify a value that is 0 to 256 Unicode characters in length and cannot be + * prefixed with aws:. You can use any of the following characters: the set of Unicode letters, digits, whitespace, + * _, ., /, =, +, and -. + */ + private String value; + + /** + * Creates an instance of TagAutoGenerated48 class. + */ + public TagAutoGenerated48() { + } + + /** + * Get the key property: The key name of the tag. You can specify a value that is 1 to 128 Unicode characters in + * length and cannot be prefixed with aws:. You can use any of the following characters: the set of Unicode letters, + * digits, whitespace, _, ., /, =, +, and -. + * + * @return the key value. + */ + public String key() { + return this.key; + } + + /** + * Set the key property: The key name of the tag. You can specify a value that is 1 to 128 Unicode characters in + * length and cannot be prefixed with aws:. You can use any of the following characters: the set of Unicode letters, + * digits, whitespace, _, ., /, =, +, and -. + * + * @param key the key value to set. + * @return the TagAutoGenerated48 object itself. + */ + public TagAutoGenerated48 withKey(String key) { + this.key = key; + return this; + } + + /** + * Get the value property: The value for the tag. You can specify a value that is 0 to 256 Unicode characters in + * length and cannot be prefixed with aws:. You can use any of the following characters: the set of Unicode letters, + * digits, whitespace, _, ., /, =, +, and -. + * + * @return the value value. + */ + public String value() { + return this.value; + } + + /** + * Set the value property: The value for the tag. You can specify a value that is 0 to 256 Unicode characters in + * length and cannot be prefixed with aws:. You can use any of the following characters: the set of Unicode letters, + * digits, whitespace, _, ., /, =, +, and -. + * + * @param value the value value to set. + * @return the TagAutoGenerated48 object itself. + */ + public TagAutoGenerated48 withValue(String value) { + this.value = value; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("key", this.key); + jsonWriter.writeStringField("value", this.value); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of TagAutoGenerated48 from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of TagAutoGenerated48 if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the TagAutoGenerated48. + */ + public static TagAutoGenerated48 fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + TagAutoGenerated48 deserializedTagAutoGenerated48 = new TagAutoGenerated48(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("key".equals(fieldName)) { + deserializedTagAutoGenerated48.key = reader.getString(); + } else if ("value".equals(fieldName)) { + deserializedTagAutoGenerated48.value = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedTagAutoGenerated48; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/TagAutoGenerated49.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/TagAutoGenerated49.java new file mode 100644 index 000000000000..2b8ab6fed774 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/TagAutoGenerated49.java @@ -0,0 +1,133 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of Tag. + */ +@Fluent +public final class TagAutoGenerated49 implements JsonSerializable { + /* + * The key name of the tag. You can specify a value that is 1 to 128 Unicode characters in length and cannot be + * prefixed with aws:. You can use any of the following characters: the set of Unicode letters, digits, whitespace, + * _, ., /, =, +, and -. + */ + private String key; + + /* + * The value for the tag. You can specify a value that is 0 to 256 Unicode characters in length and cannot be + * prefixed with aws:. You can use any of the following characters: the set of Unicode letters, digits, whitespace, + * _, ., /, =, +, and -. + */ + private String value; + + /** + * Creates an instance of TagAutoGenerated49 class. + */ + public TagAutoGenerated49() { + } + + /** + * Get the key property: The key name of the tag. You can specify a value that is 1 to 128 Unicode characters in + * length and cannot be prefixed with aws:. You can use any of the following characters: the set of Unicode letters, + * digits, whitespace, _, ., /, =, +, and -. + * + * @return the key value. + */ + public String key() { + return this.key; + } + + /** + * Set the key property: The key name of the tag. You can specify a value that is 1 to 128 Unicode characters in + * length and cannot be prefixed with aws:. You can use any of the following characters: the set of Unicode letters, + * digits, whitespace, _, ., /, =, +, and -. + * + * @param key the key value to set. + * @return the TagAutoGenerated49 object itself. + */ + public TagAutoGenerated49 withKey(String key) { + this.key = key; + return this; + } + + /** + * Get the value property: The value for the tag. You can specify a value that is 0 to 256 Unicode characters in + * length and cannot be prefixed with aws:. You can use any of the following characters: the set of Unicode letters, + * digits, whitespace, _, ., /, =, +, and -. + * + * @return the value value. + */ + public String value() { + return this.value; + } + + /** + * Set the value property: The value for the tag. You can specify a value that is 0 to 256 Unicode characters in + * length and cannot be prefixed with aws:. You can use any of the following characters: the set of Unicode letters, + * digits, whitespace, _, ., /, =, +, and -. + * + * @param value the value value to set. + * @return the TagAutoGenerated49 object itself. + */ + public TagAutoGenerated49 withValue(String value) { + this.value = value; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("key", this.key); + jsonWriter.writeStringField("value", this.value); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of TagAutoGenerated49 from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of TagAutoGenerated49 if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the TagAutoGenerated49. + */ + public static TagAutoGenerated49 fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + TagAutoGenerated49 deserializedTagAutoGenerated49 = new TagAutoGenerated49(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("key".equals(fieldName)) { + deserializedTagAutoGenerated49.key = reader.getString(); + } else if ("value".equals(fieldName)) { + deserializedTagAutoGenerated49.value = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedTagAutoGenerated49; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/TagAutoGenerated5.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/TagAutoGenerated5.java new file mode 100644 index 000000000000..f7d74b2c74df --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/TagAutoGenerated5.java @@ -0,0 +1,131 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of Tag. + */ +@Fluent +public final class TagAutoGenerated5 implements JsonSerializable { + /* + * A string that contains ``Tag`` key. The string length should be between 1 and 128 characters. Valid characters + * include ``a-z``, ``A-Z``, ``0-9``, space, and the special characters ``_ - . : / = + @``. + */ + private String key; + + /* + * A string that contains an optional ``Tag`` value. The string length should be between 0 and 256 characters. Valid + * characters include ``a-z``, ``A-Z``, ``0-9``, space, and the special characters ``_ - . : / = + @``. + */ + private String value; + + /** + * Creates an instance of TagAutoGenerated5 class. + */ + public TagAutoGenerated5() { + } + + /** + * Get the key property: A string that contains ``Tag`` key. The string length should be between 1 and 128 + * characters. Valid characters include ``a-z``, ``A-Z``, ``0-9``, space, and the special characters ``_ - . : / = + + * @``. + * + * @return the key value. + */ + public String key() { + return this.key; + } + + /** + * Set the key property: A string that contains ``Tag`` key. The string length should be between 1 and 128 + * characters. Valid characters include ``a-z``, ``A-Z``, ``0-9``, space, and the special characters ``_ - . : / = + + * @``. + * + * @param key the key value to set. + * @return the TagAutoGenerated5 object itself. + */ + public TagAutoGenerated5 withKey(String key) { + this.key = key; + return this; + } + + /** + * Get the value property: A string that contains an optional ``Tag`` value. The string length should be between 0 + * and 256 characters. Valid characters include ``a-z``, ``A-Z``, ``0-9``, space, and the special characters ``_ - . + * : / = + @``. + * + * @return the value value. + */ + public String value() { + return this.value; + } + + /** + * Set the value property: A string that contains an optional ``Tag`` value. The string length should be between 0 + * and 256 characters. Valid characters include ``a-z``, ``A-Z``, ``0-9``, space, and the special characters ``_ - . + * : / = + @``. + * + * @param value the value value to set. + * @return the TagAutoGenerated5 object itself. + */ + public TagAutoGenerated5 withValue(String value) { + this.value = value; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("key", this.key); + jsonWriter.writeStringField("value", this.value); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of TagAutoGenerated5 from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of TagAutoGenerated5 if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the TagAutoGenerated5. + */ + public static TagAutoGenerated5 fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + TagAutoGenerated5 deserializedTagAutoGenerated5 = new TagAutoGenerated5(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("key".equals(fieldName)) { + deserializedTagAutoGenerated5.key = reader.getString(); + } else if ("value".equals(fieldName)) { + deserializedTagAutoGenerated5.value = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedTagAutoGenerated5; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/TagAutoGenerated50.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/TagAutoGenerated50.java new file mode 100644 index 000000000000..d74cb4c91cc0 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/TagAutoGenerated50.java @@ -0,0 +1,121 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of Tag. + */ +@Fluent +public final class TagAutoGenerated50 implements JsonSerializable { + /* + * Name of the object key. + */ + private String key; + + /* + * Value of the tag. + */ + private String value; + + /** + * Creates an instance of TagAutoGenerated50 class. + */ + public TagAutoGenerated50() { + } + + /** + * Get the key property: Name of the object key. + * + * @return the key value. + */ + public String key() { + return this.key; + } + + /** + * Set the key property: Name of the object key. + * + * @param key the key value to set. + * @return the TagAutoGenerated50 object itself. + */ + public TagAutoGenerated50 withKey(String key) { + this.key = key; + return this; + } + + /** + * Get the value property: Value of the tag. + * + * @return the value value. + */ + public String value() { + return this.value; + } + + /** + * Set the value property: Value of the tag. + * + * @param value the value value to set. + * @return the TagAutoGenerated50 object itself. + */ + public TagAutoGenerated50 withValue(String value) { + this.value = value; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("key", this.key); + jsonWriter.writeStringField("value", this.value); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of TagAutoGenerated50 from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of TagAutoGenerated50 if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the TagAutoGenerated50. + */ + public static TagAutoGenerated50 fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + TagAutoGenerated50 deserializedTagAutoGenerated50 = new TagAutoGenerated50(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("key".equals(fieldName)) { + deserializedTagAutoGenerated50.key = reader.getString(); + } else if ("value".equals(fieldName)) { + deserializedTagAutoGenerated50.value = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedTagAutoGenerated50; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/TagAutoGenerated51.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/TagAutoGenerated51.java new file mode 100644 index 000000000000..de38da3ff922 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/TagAutoGenerated51.java @@ -0,0 +1,121 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of Tag. + */ +@Fluent +public final class TagAutoGenerated51 implements JsonSerializable { + /* + * Property key + */ + private String key; + + /* + * Property value + */ + private String value; + + /** + * Creates an instance of TagAutoGenerated51 class. + */ + public TagAutoGenerated51() { + } + + /** + * Get the key property: Property key. + * + * @return the key value. + */ + public String key() { + return this.key; + } + + /** + * Set the key property: Property key. + * + * @param key the key value to set. + * @return the TagAutoGenerated51 object itself. + */ + public TagAutoGenerated51 withKey(String key) { + this.key = key; + return this; + } + + /** + * Get the value property: Property value. + * + * @return the value value. + */ + public String value() { + return this.value; + } + + /** + * Set the value property: Property value. + * + * @param value the value value to set. + * @return the TagAutoGenerated51 object itself. + */ + public TagAutoGenerated51 withValue(String value) { + this.value = value; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("key", this.key); + jsonWriter.writeStringField("value", this.value); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of TagAutoGenerated51 from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of TagAutoGenerated51 if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the TagAutoGenerated51. + */ + public static TagAutoGenerated51 fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + TagAutoGenerated51 deserializedTagAutoGenerated51 = new TagAutoGenerated51(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("key".equals(fieldName)) { + deserializedTagAutoGenerated51.key = reader.getString(); + } else if ("value".equals(fieldName)) { + deserializedTagAutoGenerated51.value = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedTagAutoGenerated51; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/TagAutoGenerated52.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/TagAutoGenerated52.java new file mode 100644 index 000000000000..3db24c659d2c --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/TagAutoGenerated52.java @@ -0,0 +1,121 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of Tag. + */ +@Fluent +public final class TagAutoGenerated52 implements JsonSerializable { + /* + * The key identifier, or name, of the tag. + */ + private String key; + + /* + * The string value associated with the key of the tag. + */ + private String value; + + /** + * Creates an instance of TagAutoGenerated52 class. + */ + public TagAutoGenerated52() { + } + + /** + * Get the key property: The key identifier, or name, of the tag. + * + * @return the key value. + */ + public String key() { + return this.key; + } + + /** + * Set the key property: The key identifier, or name, of the tag. + * + * @param key the key value to set. + * @return the TagAutoGenerated52 object itself. + */ + public TagAutoGenerated52 withKey(String key) { + this.key = key; + return this; + } + + /** + * Get the value property: The string value associated with the key of the tag. + * + * @return the value value. + */ + public String value() { + return this.value; + } + + /** + * Set the value property: The string value associated with the key of the tag. + * + * @param value the value value to set. + * @return the TagAutoGenerated52 object itself. + */ + public TagAutoGenerated52 withValue(String value) { + this.value = value; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("key", this.key); + jsonWriter.writeStringField("value", this.value); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of TagAutoGenerated52 from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of TagAutoGenerated52 if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the TagAutoGenerated52. + */ + public static TagAutoGenerated52 fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + TagAutoGenerated52 deserializedTagAutoGenerated52 = new TagAutoGenerated52(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("key".equals(fieldName)) { + deserializedTagAutoGenerated52.key = reader.getString(); + } else if ("value".equals(fieldName)) { + deserializedTagAutoGenerated52.value = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedTagAutoGenerated52; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/TagAutoGenerated53.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/TagAutoGenerated53.java new file mode 100644 index 000000000000..d59bd347e120 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/TagAutoGenerated53.java @@ -0,0 +1,121 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of Tag. + */ +@Fluent +public final class TagAutoGenerated53 implements JsonSerializable { + /* + * The required key portion of the tag. + */ + private String key; + + /* + * The optional value portion of the tag. + */ + private String value; + + /** + * Creates an instance of TagAutoGenerated53 class. + */ + public TagAutoGenerated53() { + } + + /** + * Get the key property: The required key portion of the tag. + * + * @return the key value. + */ + public String key() { + return this.key; + } + + /** + * Set the key property: The required key portion of the tag. + * + * @param key the key value to set. + * @return the TagAutoGenerated53 object itself. + */ + public TagAutoGenerated53 withKey(String key) { + this.key = key; + return this; + } + + /** + * Get the value property: The optional value portion of the tag. + * + * @return the value value. + */ + public String value() { + return this.value; + } + + /** + * Set the value property: The optional value portion of the tag. + * + * @param value the value value to set. + * @return the TagAutoGenerated53 object itself. + */ + public TagAutoGenerated53 withValue(String value) { + this.value = value; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("key", this.key); + jsonWriter.writeStringField("value", this.value); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of TagAutoGenerated53 from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of TagAutoGenerated53 if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the TagAutoGenerated53. + */ + public static TagAutoGenerated53 fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + TagAutoGenerated53 deserializedTagAutoGenerated53 = new TagAutoGenerated53(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("key".equals(fieldName)) { + deserializedTagAutoGenerated53.key = reader.getString(); + } else if ("value".equals(fieldName)) { + deserializedTagAutoGenerated53.value = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedTagAutoGenerated53; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/TagAutoGenerated54.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/TagAutoGenerated54.java new file mode 100644 index 000000000000..0f5c4cb4c96f --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/TagAutoGenerated54.java @@ -0,0 +1,133 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of Tag. + */ +@Fluent +public final class TagAutoGenerated54 implements JsonSerializable { + /* + * The key name of the tag. You can specify a value that is 1 to 128 Unicode characters in length and cannot be + * prefixed with aws:. You can use any of the following characters: the set of Unicode letters, digits, whitespace, + * _, ., /, =, +, and -. + */ + private String key; + + /* + * The value for the tag. You can specify a value that is 0 to 256 Unicode characters in length and cannot be + * prefixed with aws:. You can use any of the following characters: the set of Unicode letters, digits, whitespace, + * _, ., /, =, +, and -. + */ + private String value; + + /** + * Creates an instance of TagAutoGenerated54 class. + */ + public TagAutoGenerated54() { + } + + /** + * Get the key property: The key name of the tag. You can specify a value that is 1 to 128 Unicode characters in + * length and cannot be prefixed with aws:. You can use any of the following characters: the set of Unicode letters, + * digits, whitespace, _, ., /, =, +, and -. + * + * @return the key value. + */ + public String key() { + return this.key; + } + + /** + * Set the key property: The key name of the tag. You can specify a value that is 1 to 128 Unicode characters in + * length and cannot be prefixed with aws:. You can use any of the following characters: the set of Unicode letters, + * digits, whitespace, _, ., /, =, +, and -. + * + * @param key the key value to set. + * @return the TagAutoGenerated54 object itself. + */ + public TagAutoGenerated54 withKey(String key) { + this.key = key; + return this; + } + + /** + * Get the value property: The value for the tag. You can specify a value that is 0 to 256 Unicode characters in + * length and cannot be prefixed with aws:. You can use any of the following characters: the set of Unicode letters, + * digits, whitespace, _, ., /, =, +, and -. + * + * @return the value value. + */ + public String value() { + return this.value; + } + + /** + * Set the value property: The value for the tag. You can specify a value that is 0 to 256 Unicode characters in + * length and cannot be prefixed with aws:. You can use any of the following characters: the set of Unicode letters, + * digits, whitespace, _, ., /, =, +, and -. + * + * @param value the value value to set. + * @return the TagAutoGenerated54 object itself. + */ + public TagAutoGenerated54 withValue(String value) { + this.value = value; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("key", this.key); + jsonWriter.writeStringField("value", this.value); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of TagAutoGenerated54 from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of TagAutoGenerated54 if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the TagAutoGenerated54. + */ + public static TagAutoGenerated54 fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + TagAutoGenerated54 deserializedTagAutoGenerated54 = new TagAutoGenerated54(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("key".equals(fieldName)) { + deserializedTagAutoGenerated54.key = reader.getString(); + } else if ("value".equals(fieldName)) { + deserializedTagAutoGenerated54.value = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedTagAutoGenerated54; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/TagAutoGenerated6.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/TagAutoGenerated6.java new file mode 100644 index 000000000000..c7d9738ed6b7 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/TagAutoGenerated6.java @@ -0,0 +1,124 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of Tag. + */ +@Fluent +public final class TagAutoGenerated6 implements JsonSerializable { + /* + * A unique identifier for the tag. The combination of tag keys and values can help you organize and categorize your + * resources. + */ + private String key; + + /* + * The value for the specified tag key. + */ + private String value; + + /** + * Creates an instance of TagAutoGenerated6 class. + */ + public TagAutoGenerated6() { + } + + /** + * Get the key property: A unique identifier for the tag. The combination of tag keys and values can help you + * organize and categorize your resources. + * + * @return the key value. + */ + public String key() { + return this.key; + } + + /** + * Set the key property: A unique identifier for the tag. The combination of tag keys and values can help you + * organize and categorize your resources. + * + * @param key the key value to set. + * @return the TagAutoGenerated6 object itself. + */ + public TagAutoGenerated6 withKey(String key) { + this.key = key; + return this; + } + + /** + * Get the value property: The value for the specified tag key. + * + * @return the value value. + */ + public String value() { + return this.value; + } + + /** + * Set the value property: The value for the specified tag key. + * + * @param value the value value to set. + * @return the TagAutoGenerated6 object itself. + */ + public TagAutoGenerated6 withValue(String value) { + this.value = value; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("key", this.key); + jsonWriter.writeStringField("value", this.value); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of TagAutoGenerated6 from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of TagAutoGenerated6 if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the TagAutoGenerated6. + */ + public static TagAutoGenerated6 fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + TagAutoGenerated6 deserializedTagAutoGenerated6 = new TagAutoGenerated6(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("key".equals(fieldName)) { + deserializedTagAutoGenerated6.key = reader.getString(); + } else if ("value".equals(fieldName)) { + deserializedTagAutoGenerated6.value = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedTagAutoGenerated6; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/TagAutoGenerated7.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/TagAutoGenerated7.java new file mode 100644 index 000000000000..868a34132b40 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/TagAutoGenerated7.java @@ -0,0 +1,121 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of Tag. + */ +@Fluent +public final class TagAutoGenerated7 implements JsonSerializable { + /* + *

The tag's key.

+ */ + private String key; + + /* + *

The tag's value.

+ */ + private String value; + + /** + * Creates an instance of TagAutoGenerated7 class. + */ + public TagAutoGenerated7() { + } + + /** + * Get the key property: <p>The tag's key.</p>. + * + * @return the key value. + */ + public String key() { + return this.key; + } + + /** + * Set the key property: <p>The tag's key.</p>. + * + * @param key the key value to set. + * @return the TagAutoGenerated7 object itself. + */ + public TagAutoGenerated7 withKey(String key) { + this.key = key; + return this; + } + + /** + * Get the value property: <p>The tag's value.</p>. + * + * @return the value value. + */ + public String value() { + return this.value; + } + + /** + * Set the value property: <p>The tag's value.</p>. + * + * @param value the value value to set. + * @return the TagAutoGenerated7 object itself. + */ + public TagAutoGenerated7 withValue(String value) { + this.value = value; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("key", this.key); + jsonWriter.writeStringField("value", this.value); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of TagAutoGenerated7 from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of TagAutoGenerated7 if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the TagAutoGenerated7. + */ + public static TagAutoGenerated7 fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + TagAutoGenerated7 deserializedTagAutoGenerated7 = new TagAutoGenerated7(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("key".equals(fieldName)) { + deserializedTagAutoGenerated7.key = reader.getString(); + } else if ("value".equals(fieldName)) { + deserializedTagAutoGenerated7.value = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedTagAutoGenerated7; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/TagAutoGenerated8.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/TagAutoGenerated8.java new file mode 100644 index 000000000000..5830c7f367dd --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/TagAutoGenerated8.java @@ -0,0 +1,126 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of Tag. + */ +@Fluent +public final class TagAutoGenerated8 implements JsonSerializable { + /* + * The key of the tag. Tag keys are case sensitive. Each DynamoDB table can only have up to one tag with the same + * key. If you try to add an existing tag (same key), the existing tag value will be updated to the new value. + */ + private String key; + + /* + * The value of the tag. Tag values are case-sensitive and can be null. + */ + private String value; + + /** + * Creates an instance of TagAutoGenerated8 class. + */ + public TagAutoGenerated8() { + } + + /** + * Get the key property: The key of the tag. Tag keys are case sensitive. Each DynamoDB table can only have up to + * one tag with the same key. If you try to add an existing tag (same key), the existing tag value will be updated + * to the new value. + * + * @return the key value. + */ + public String key() { + return this.key; + } + + /** + * Set the key property: The key of the tag. Tag keys are case sensitive. Each DynamoDB table can only have up to + * one tag with the same key. If you try to add an existing tag (same key), the existing tag value will be updated + * to the new value. + * + * @param key the key value to set. + * @return the TagAutoGenerated8 object itself. + */ + public TagAutoGenerated8 withKey(String key) { + this.key = key; + return this; + } + + /** + * Get the value property: The value of the tag. Tag values are case-sensitive and can be null. + * + * @return the value value. + */ + public String value() { + return this.value; + } + + /** + * Set the value property: The value of the tag. Tag values are case-sensitive and can be null. + * + * @param value the value value to set. + * @return the TagAutoGenerated8 object itself. + */ + public TagAutoGenerated8 withValue(String value) { + this.value = value; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("key", this.key); + jsonWriter.writeStringField("value", this.value); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of TagAutoGenerated8 from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of TagAutoGenerated8 if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the TagAutoGenerated8. + */ + public static TagAutoGenerated8 fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + TagAutoGenerated8 deserializedTagAutoGenerated8 = new TagAutoGenerated8(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("key".equals(fieldName)) { + deserializedTagAutoGenerated8.key = reader.getString(); + } else if ("value".equals(fieldName)) { + deserializedTagAutoGenerated8.value = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedTagAutoGenerated8; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/TagAutoGenerated9.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/TagAutoGenerated9.java new file mode 100644 index 000000000000..19ef137b520d --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/TagAutoGenerated9.java @@ -0,0 +1,127 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of Tag. + */ +@Fluent +public final class TagAutoGenerated9 implements JsonSerializable { + /* + *

The key of the tag.

Constraints: Tag keys are case-sensitive and accept a maximum of 127 Unicode + * characters. May not begin with aws:.

+ */ + private String key; + + /* + *

The value of the tag.

Constraints: Tag values are case-sensitive and accept a maximum of 256 Unicode + * characters.

+ */ + private String value; + + /** + * Creates an instance of TagAutoGenerated9 class. + */ + public TagAutoGenerated9() { + } + + /** + * Get the key property: <p>The key of the tag.</p> <p>Constraints: Tag keys are case-sensitive + * and accept a maximum of 127 Unicode characters. May not begin with <code>aws:</code>.</p>. + * + * @return the key value. + */ + public String key() { + return this.key; + } + + /** + * Set the key property: <p>The key of the tag.</p> <p>Constraints: Tag keys are case-sensitive + * and accept a maximum of 127 Unicode characters. May not begin with <code>aws:</code>.</p>. + * + * @param key the key value to set. + * @return the TagAutoGenerated9 object itself. + */ + public TagAutoGenerated9 withKey(String key) { + this.key = key; + return this; + } + + /** + * Get the value property: <p>The value of the tag.</p> <p>Constraints: Tag values are + * case-sensitive and accept a maximum of 256 Unicode characters.</p>. + * + * @return the value value. + */ + public String value() { + return this.value; + } + + /** + * Set the value property: <p>The value of the tag.</p> <p>Constraints: Tag values are + * case-sensitive and accept a maximum of 256 Unicode characters.</p>. + * + * @param value the value value to set. + * @return the TagAutoGenerated9 object itself. + */ + public TagAutoGenerated9 withValue(String value) { + this.value = value; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("key", this.key); + jsonWriter.writeStringField("value", this.value); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of TagAutoGenerated9 from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of TagAutoGenerated9 if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the TagAutoGenerated9. + */ + public static TagAutoGenerated9 fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + TagAutoGenerated9 deserializedTagAutoGenerated9 = new TagAutoGenerated9(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("key".equals(fieldName)) { + deserializedTagAutoGenerated9.key = reader.getString(); + } else if ("value".equals(fieldName)) { + deserializedTagAutoGenerated9.value = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedTagAutoGenerated9; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/TagCriterionForJob.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/TagCriterionForJob.java new file mode 100644 index 000000000000..7fa652d5bdb9 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/TagCriterionForJob.java @@ -0,0 +1,134 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Definition of TagCriterionForJob. + */ +@Fluent +public final class TagCriterionForJob implements JsonSerializable { + /* + *

The operator to use in the condition. Valid values are EQ (equals) and NE (not equals).

+ */ + private JobComparatorEnumValue comparator; + + /* + *

The tag keys, tag values, or tag key and value pairs to use in the condition.

+ */ + private List tagValues; + + /** + * Creates an instance of TagCriterionForJob class. + */ + public TagCriterionForJob() { + } + + /** + * Get the comparator property: <p>The operator to use in the condition. Valid values are EQ (equals) and NE + * (not equals).</p>. + * + * @return the comparator value. + */ + public JobComparatorEnumValue comparator() { + return this.comparator; + } + + /** + * Set the comparator property: <p>The operator to use in the condition. Valid values are EQ (equals) and NE + * (not equals).</p>. + * + * @param comparator the comparator value to set. + * @return the TagCriterionForJob object itself. + */ + public TagCriterionForJob withComparator(JobComparatorEnumValue comparator) { + this.comparator = comparator; + return this; + } + + /** + * Get the tagValues property: <p>The tag keys, tag values, or tag key and value pairs to use in the + * condition.</p>. + * + * @return the tagValues value. + */ + public List tagValues() { + return this.tagValues; + } + + /** + * Set the tagValues property: <p>The tag keys, tag values, or tag key and value pairs to use in the + * condition.</p>. + * + * @param tagValues the tagValues value to set. + * @return the TagCriterionForJob object itself. + */ + public TagCriterionForJob withTagValues(List tagValues) { + this.tagValues = tagValues; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (comparator() != null) { + comparator().validate(); + } + if (tagValues() != null) { + tagValues().forEach(e -> e.validate()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("comparator", this.comparator); + jsonWriter.writeArrayField("tagValues", this.tagValues, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of TagCriterionForJob from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of TagCriterionForJob if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the TagCriterionForJob. + */ + public static TagCriterionForJob fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + TagCriterionForJob deserializedTagCriterionForJob = new TagCriterionForJob(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("comparator".equals(fieldName)) { + deserializedTagCriterionForJob.comparator = JobComparatorEnumValue.fromJson(reader); + } else if ("tagValues".equals(fieldName)) { + List tagValues + = reader.readArray(reader1 -> TagCriterionPairForJob.fromJson(reader1)); + deserializedTagCriterionForJob.tagValues = tagValues; + } else { + reader.skipChildren(); + } + } + + return deserializedTagCriterionForJob; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/TagCriterionPairForJob.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/TagCriterionPairForJob.java new file mode 100644 index 000000000000..2d75788ff3b5 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/TagCriterionPairForJob.java @@ -0,0 +1,121 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of TagCriterionPairForJob. + */ +@Fluent +public final class TagCriterionPairForJob implements JsonSerializable { + /* + *

The value for the tag key to use in the condition.

+ */ + private String key; + + /* + *

The tag value to use in the condition.

+ */ + private String value; + + /** + * Creates an instance of TagCriterionPairForJob class. + */ + public TagCriterionPairForJob() { + } + + /** + * Get the key property: <p>The value for the tag key to use in the condition.</p>. + * + * @return the key value. + */ + public String key() { + return this.key; + } + + /** + * Set the key property: <p>The value for the tag key to use in the condition.</p>. + * + * @param key the key value to set. + * @return the TagCriterionPairForJob object itself. + */ + public TagCriterionPairForJob withKey(String key) { + this.key = key; + return this; + } + + /** + * Get the value property: <p>The tag value to use in the condition.</p>. + * + * @return the value value. + */ + public String value() { + return this.value; + } + + /** + * Set the value property: <p>The tag value to use in the condition.</p>. + * + * @param value the value value to set. + * @return the TagCriterionPairForJob object itself. + */ + public TagCriterionPairForJob withValue(String value) { + this.value = value; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("key", this.key); + jsonWriter.writeStringField("value", this.value); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of TagCriterionPairForJob from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of TagCriterionPairForJob if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the TagCriterionPairForJob. + */ + public static TagCriterionPairForJob fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + TagCriterionPairForJob deserializedTagCriterionPairForJob = new TagCriterionPairForJob(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("key".equals(fieldName)) { + deserializedTagCriterionPairForJob.key = reader.getString(); + } else if ("value".equals(fieldName)) { + deserializedTagCriterionPairForJob.value = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedTagCriterionPairForJob; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/TagFilter.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/TagFilter.java new file mode 100644 index 000000000000..529db62603d7 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/TagFilter.java @@ -0,0 +1,121 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of TagFilter. + */ +@Fluent +public final class TagFilter implements JsonSerializable { + /* + * The tag key. + */ + private String key; + + /* + * The tag value. + */ + private String value; + + /** + * Creates an instance of TagFilter class. + */ + public TagFilter() { + } + + /** + * Get the key property: The tag key. + * + * @return the key value. + */ + public String key() { + return this.key; + } + + /** + * Set the key property: The tag key. + * + * @param key the key value to set. + * @return the TagFilter object itself. + */ + public TagFilter withKey(String key) { + this.key = key; + return this; + } + + /** + * Get the value property: The tag value. + * + * @return the value value. + */ + public String value() { + return this.value; + } + + /** + * Set the value property: The tag value. + * + * @param value the value value to set. + * @return the TagFilter object itself. + */ + public TagFilter withValue(String value) { + this.value = value; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("key", this.key); + jsonWriter.writeStringField("value", this.value); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of TagFilter from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of TagFilter if the JsonReader was pointing to an instance of it, or null if it was pointing + * to JSON null. + * @throws IOException If an error occurs while reading the TagFilter. + */ + public static TagFilter fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + TagFilter deserializedTagFilter = new TagFilter(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("key".equals(fieldName)) { + deserializedTagFilter.key = reader.getString(); + } else if ("value".equals(fieldName)) { + deserializedTagFilter.value = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedTagFilter; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/TagItem.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/TagItem.java new file mode 100644 index 000000000000..c68e615d9df4 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/TagItem.java @@ -0,0 +1,121 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of TagItem. + */ +@Fluent +public final class TagItem implements JsonSerializable { + /* + * Property key + */ + private String key; + + /* + * Property value + */ + private String value; + + /** + * Creates an instance of TagItem class. + */ + public TagItem() { + } + + /** + * Get the key property: Property key. + * + * @return the key value. + */ + public String key() { + return this.key; + } + + /** + * Set the key property: Property key. + * + * @param key the key value to set. + * @return the TagItem object itself. + */ + public TagItem withKey(String key) { + this.key = key; + return this; + } + + /** + * Get the value property: Property value. + * + * @return the value value. + */ + public String value() { + return this.value; + } + + /** + * Set the value property: Property value. + * + * @param value the value value to set. + * @return the TagItem object itself. + */ + public TagItem withValue(String value) { + this.value = value; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("key", this.key); + jsonWriter.writeStringField("value", this.value); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of TagItem from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of TagItem if the JsonReader was pointing to an instance of it, or null if it was pointing to + * JSON null. + * @throws IOException If an error occurs while reading the TagItem. + */ + public static TagItem fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + TagItem deserializedTagItem = new TagItem(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("key".equals(fieldName)) { + deserializedTagItem.key = reader.getString(); + } else if ("value".equals(fieldName)) { + deserializedTagItem.value = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedTagItem; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/TagProperty.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/TagProperty.java new file mode 100644 index 000000000000..01baf66c65ed --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/TagProperty.java @@ -0,0 +1,155 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of TagProperty. + */ +@Fluent +public final class TagProperty implements JsonSerializable { + /* + * The tag key. + */ + private String key; + + /* + * Set to ``true`` if you want CloudFormation to copy the tag to EC2 instances that are launched as part of the Auto + * Scaling group. Set to ``false`` if you want the tag attached only to the Auto Scaling group and not copied to any + * instances launched as part of the Auto Scaling group. + */ + private Boolean propagateAtLaunch; + + /* + * The tag value. + */ + private String value; + + /** + * Creates an instance of TagProperty class. + */ + public TagProperty() { + } + + /** + * Get the key property: The tag key. + * + * @return the key value. + */ + public String key() { + return this.key; + } + + /** + * Set the key property: The tag key. + * + * @param key the key value to set. + * @return the TagProperty object itself. + */ + public TagProperty withKey(String key) { + this.key = key; + return this; + } + + /** + * Get the propagateAtLaunch property: Set to ``true`` if you want CloudFormation to copy the tag to EC2 instances + * that are launched as part of the Auto Scaling group. Set to ``false`` if you want the tag attached only to the + * Auto Scaling group and not copied to any instances launched as part of the Auto Scaling group. + * + * @return the propagateAtLaunch value. + */ + public Boolean propagateAtLaunch() { + return this.propagateAtLaunch; + } + + /** + * Set the propagateAtLaunch property: Set to ``true`` if you want CloudFormation to copy the tag to EC2 instances + * that are launched as part of the Auto Scaling group. Set to ``false`` if you want the tag attached only to the + * Auto Scaling group and not copied to any instances launched as part of the Auto Scaling group. + * + * @param propagateAtLaunch the propagateAtLaunch value to set. + * @return the TagProperty object itself. + */ + public TagProperty withPropagateAtLaunch(Boolean propagateAtLaunch) { + this.propagateAtLaunch = propagateAtLaunch; + return this; + } + + /** + * Get the value property: The tag value. + * + * @return the value value. + */ + public String value() { + return this.value; + } + + /** + * Set the value property: The tag value. + * + * @param value the value value to set. + * @return the TagProperty object itself. + */ + public TagProperty withValue(String value) { + this.value = value; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("key", this.key); + jsonWriter.writeBooleanField("propagateAtLaunch", this.propagateAtLaunch); + jsonWriter.writeStringField("value", this.value); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of TagProperty from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of TagProperty if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the TagProperty. + */ + public static TagProperty fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + TagProperty deserializedTagProperty = new TagProperty(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("key".equals(fieldName)) { + deserializedTagProperty.key = reader.getString(); + } else if ("propagateAtLaunch".equals(fieldName)) { + deserializedTagProperty.propagateAtLaunch = reader.getNullable(JsonReader::getBoolean); + } else if ("value".equals(fieldName)) { + deserializedTagProperty.value = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedTagProperty; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/Taint.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/Taint.java new file mode 100644 index 000000000000..2bca14ba6dd7 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/Taint.java @@ -0,0 +1,149 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of Taint. + */ +@Fluent +public final class Taint implements JsonSerializable { + /* + * Property effect + */ + private String effect; + + /* + * Property key + */ + private String key; + + /* + * Property value + */ + private String value; + + /** + * Creates an instance of Taint class. + */ + public Taint() { + } + + /** + * Get the effect property: Property effect. + * + * @return the effect value. + */ + public String effect() { + return this.effect; + } + + /** + * Set the effect property: Property effect. + * + * @param effect the effect value to set. + * @return the Taint object itself. + */ + public Taint withEffect(String effect) { + this.effect = effect; + return this; + } + + /** + * Get the key property: Property key. + * + * @return the key value. + */ + public String key() { + return this.key; + } + + /** + * Set the key property: Property key. + * + * @param key the key value to set. + * @return the Taint object itself. + */ + public Taint withKey(String key) { + this.key = key; + return this; + } + + /** + * Get the value property: Property value. + * + * @return the value value. + */ + public String value() { + return this.value; + } + + /** + * Set the value property: Property value. + * + * @param value the value value to set. + * @return the Taint object itself. + */ + public Taint withValue(String value) { + this.value = value; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("effect", this.effect); + jsonWriter.writeStringField("key", this.key); + jsonWriter.writeStringField("value", this.value); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of Taint from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of Taint if the JsonReader was pointing to an instance of it, or null if it was pointing to + * JSON null. + * @throws IOException If an error occurs while reading the Taint. + */ + public static Taint fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + Taint deserializedTaint = new Taint(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("effect".equals(fieldName)) { + deserializedTaint.effect = reader.getString(); + } else if ("key".equals(fieldName)) { + deserializedTaint.key = reader.getString(); + } else if ("value".equals(fieldName)) { + deserializedTaint.value = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedTaint; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/TargetDescription.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/TargetDescription.java new file mode 100644 index 000000000000..33a45eb98fe5 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/TargetDescription.java @@ -0,0 +1,166 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of TargetDescription. + */ +@Fluent +public final class TargetDescription implements JsonSerializable { + /* + * An Availability Zone or all. This determines whether the target receives traffic from the load balancer nodes in + * the specified Availability Zone or from all enabled Availability Zones for the load balancer. + */ + private String availabilityZone; + + /* + * The ID of the target. If the target type of the target group is instance, specify an instance ID. If the target + * type is ip, specify an IP address. If the target type is lambda, specify the ARN of the Lambda function. If the + * target type is alb, specify the ARN of the Application Load Balancer target. + */ + private String id; + + /* + * The port on which the target is listening. If the target group protocol is GENEVE, the supported port is 6081. If + * the target type is alb, the targeted Application Load Balancer must have at least one listener whose port matches + * the target group port. Not used if the target is a Lambda function. + */ + private Integer port; + + /** + * Creates an instance of TargetDescription class. + */ + public TargetDescription() { + } + + /** + * Get the availabilityZone property: An Availability Zone or all. This determines whether the target receives + * traffic from the load balancer nodes in the specified Availability Zone or from all enabled Availability Zones + * for the load balancer. + * + * @return the availabilityZone value. + */ + public String availabilityZone() { + return this.availabilityZone; + } + + /** + * Set the availabilityZone property: An Availability Zone or all. This determines whether the target receives + * traffic from the load balancer nodes in the specified Availability Zone or from all enabled Availability Zones + * for the load balancer. + * + * @param availabilityZone the availabilityZone value to set. + * @return the TargetDescription object itself. + */ + public TargetDescription withAvailabilityZone(String availabilityZone) { + this.availabilityZone = availabilityZone; + return this; + } + + /** + * Get the id property: The ID of the target. If the target type of the target group is instance, specify an + * instance ID. If the target type is ip, specify an IP address. If the target type is lambda, specify the ARN of + * the Lambda function. If the target type is alb, specify the ARN of the Application Load Balancer target. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Set the id property: The ID of the target. If the target type of the target group is instance, specify an + * instance ID. If the target type is ip, specify an IP address. If the target type is lambda, specify the ARN of + * the Lambda function. If the target type is alb, specify the ARN of the Application Load Balancer target. + * + * @param id the id value to set. + * @return the TargetDescription object itself. + */ + public TargetDescription withId(String id) { + this.id = id; + return this; + } + + /** + * Get the port property: The port on which the target is listening. If the target group protocol is GENEVE, the + * supported port is 6081. If the target type is alb, the targeted Application Load Balancer must have at least one + * listener whose port matches the target group port. Not used if the target is a Lambda function. + * + * @return the port value. + */ + public Integer port() { + return this.port; + } + + /** + * Set the port property: The port on which the target is listening. If the target group protocol is GENEVE, the + * supported port is 6081. If the target type is alb, the targeted Application Load Balancer must have at least one + * listener whose port matches the target group port. Not used if the target is a Lambda function. + * + * @param port the port value to set. + * @return the TargetDescription object itself. + */ + public TargetDescription withPort(Integer port) { + this.port = port; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("availabilityZone", this.availabilityZone); + jsonWriter.writeStringField("id", this.id); + jsonWriter.writeNumberField("port", this.port); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of TargetDescription from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of TargetDescription if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the TargetDescription. + */ + public static TargetDescription fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + TargetDescription deserializedTargetDescription = new TargetDescription(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("availabilityZone".equals(fieldName)) { + deserializedTargetDescription.availabilityZone = reader.getString(); + } else if ("id".equals(fieldName)) { + deserializedTargetDescription.id = reader.getString(); + } else if ("port".equals(fieldName)) { + deserializedTargetDescription.port = reader.getNullable(JsonReader::getInt); + } else { + reader.skipChildren(); + } + } + + return deserializedTargetDescription; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/TargetDescriptionAutoGenerated.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/TargetDescriptionAutoGenerated.java new file mode 100644 index 000000000000..5c934c26e1d9 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/TargetDescriptionAutoGenerated.java @@ -0,0 +1,206 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of TargetDescription. + */ +@Fluent +public final class TargetDescriptionAutoGenerated implements JsonSerializable { + /* + *

An Availability Zone or all. This determines whether the target receives traffic from the load + * balancer nodes in the specified Availability Zone or from all enabled Availability Zones for the load + * balancer.

For Application Load Balancer target groups, the specified Availability Zone value is only + * applicable when cross-zone load balancing is off. Otherwise the parameter is ignored and treated as + * all.

This parameter is not supported if the target type of the target group is + * instance or alb.

If the target type is ip and the IP address is in + * a subnet of the VPC for the target group, the Availability Zone is automatically detected and this parameter is + * optional. If the IP address is outside the VPC, this parameter is required.

For Application Load Balancer + * target groups with cross-zone load balancing off, if the target type is ip and the IP address is + * outside of the VPC for the target group, this should be an Availability Zone inside the VPC for the target + * group.

If the target type is lambda, this parameter is optional and the only supported value + * is all.

+ */ + private String availabilityZone; + + /* + *

The ID of the target. If the target type of the target group is instance, specify an instance ID. + * If the target type is ip, specify an IP address. If the target type is lambda, specify + * the ARN of the Lambda function. If the target type is alb, specify the ARN of the Application Load + * Balancer target.

+ */ + private String id; + + /* + *

The port on which the target is listening. If the target group protocol is GENEVE, the supported port is 6081. + * If the target type is alb, the targeted Application Load Balancer must have at least one listener + * whose port matches the target group port. This parameter is not used if the target is a Lambda function.

+ */ + private Integer port; + + /** + * Creates an instance of TargetDescriptionAutoGenerated class. + */ + public TargetDescriptionAutoGenerated() { + } + + /** + * Get the availabilityZone property: <p>An Availability Zone or <code>all</code>. This determines + * whether the target receives traffic from the load balancer nodes in the specified Availability Zone or from all + * enabled Availability Zones for the load balancer.</p> <p>For Application Load Balancer target groups, + * the specified Availability Zone value is only applicable when cross-zone load balancing is off. Otherwise the + * parameter is ignored and treated as <code>all</code>.</p> <p>This parameter is not + * supported if the target type of the target group is <code>instance</code> or + * <code>alb</code>.</p> <p>If the target type is <code>ip</code> and the IP + * address is in a subnet of the VPC for the target group, the Availability Zone is automatically detected and this + * parameter is optional. If the IP address is outside the VPC, this parameter is required.</p> <p>For + * Application Load Balancer target groups with cross-zone load balancing off, if the target type is + * <code>ip</code> and the IP address is outside of the VPC for the target group, this should be an + * Availability Zone inside the VPC for the target group.</p> <p>If the target type is + * <code>lambda</code>, this parameter is optional and the only supported value is + * <code>all</code>.</p>. + * + * @return the availabilityZone value. + */ + public String availabilityZone() { + return this.availabilityZone; + } + + /** + * Set the availabilityZone property: <p>An Availability Zone or <code>all</code>. This determines + * whether the target receives traffic from the load balancer nodes in the specified Availability Zone or from all + * enabled Availability Zones for the load balancer.</p> <p>For Application Load Balancer target groups, + * the specified Availability Zone value is only applicable when cross-zone load balancing is off. Otherwise the + * parameter is ignored and treated as <code>all</code>.</p> <p>This parameter is not + * supported if the target type of the target group is <code>instance</code> or + * <code>alb</code>.</p> <p>If the target type is <code>ip</code> and the IP + * address is in a subnet of the VPC for the target group, the Availability Zone is automatically detected and this + * parameter is optional. If the IP address is outside the VPC, this parameter is required.</p> <p>For + * Application Load Balancer target groups with cross-zone load balancing off, if the target type is + * <code>ip</code> and the IP address is outside of the VPC for the target group, this should be an + * Availability Zone inside the VPC for the target group.</p> <p>If the target type is + * <code>lambda</code>, this parameter is optional and the only supported value is + * <code>all</code>.</p>. + * + * @param availabilityZone the availabilityZone value to set. + * @return the TargetDescriptionAutoGenerated object itself. + */ + public TargetDescriptionAutoGenerated withAvailabilityZone(String availabilityZone) { + this.availabilityZone = availabilityZone; + return this; + } + + /** + * Get the id property: <p>The ID of the target. If the target type of the target group is + * <code>instance</code>, specify an instance ID. If the target type is <code>ip</code>, + * specify an IP address. If the target type is <code>lambda</code>, specify the ARN of the Lambda + * function. If the target type is <code>alb</code>, specify the ARN of the Application Load Balancer + * target. </p>. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Set the id property: <p>The ID of the target. If the target type of the target group is + * <code>instance</code>, specify an instance ID. If the target type is <code>ip</code>, + * specify an IP address. If the target type is <code>lambda</code>, specify the ARN of the Lambda + * function. If the target type is <code>alb</code>, specify the ARN of the Application Load Balancer + * target. </p>. + * + * @param id the id value to set. + * @return the TargetDescriptionAutoGenerated object itself. + */ + public TargetDescriptionAutoGenerated withId(String id) { + this.id = id; + return this; + } + + /** + * Get the port property: <p>The port on which the target is listening. If the target group protocol is + * GENEVE, the supported port is 6081. If the target type is <code>alb</code>, the targeted Application + * Load Balancer must have at least one listener whose port matches the target group port. This parameter is not + * used if the target is a Lambda function.</p>. + * + * @return the port value. + */ + public Integer port() { + return this.port; + } + + /** + * Set the port property: <p>The port on which the target is listening. If the target group protocol is + * GENEVE, the supported port is 6081. If the target type is <code>alb</code>, the targeted Application + * Load Balancer must have at least one listener whose port matches the target group port. This parameter is not + * used if the target is a Lambda function.</p>. + * + * @param port the port value to set. + * @return the TargetDescriptionAutoGenerated object itself. + */ + public TargetDescriptionAutoGenerated withPort(Integer port) { + this.port = port; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("availabilityZone", this.availabilityZone); + jsonWriter.writeStringField("id", this.id); + jsonWriter.writeNumberField("port", this.port); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of TargetDescriptionAutoGenerated from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of TargetDescriptionAutoGenerated if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the TargetDescriptionAutoGenerated. + */ + public static TargetDescriptionAutoGenerated fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + TargetDescriptionAutoGenerated deserializedTargetDescriptionAutoGenerated + = new TargetDescriptionAutoGenerated(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("availabilityZone".equals(fieldName)) { + deserializedTargetDescriptionAutoGenerated.availabilityZone = reader.getString(); + } else if ("id".equals(fieldName)) { + deserializedTargetDescriptionAutoGenerated.id = reader.getString(); + } else if ("port".equals(fieldName)) { + deserializedTargetDescriptionAutoGenerated.port = reader.getNullable(JsonReader::getInt); + } else { + reader.skipChildren(); + } + } + + return deserializedTargetDescriptionAutoGenerated; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/TargetGroupAttribute.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/TargetGroupAttribute.java new file mode 100644 index 000000000000..11708822aedb --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/TargetGroupAttribute.java @@ -0,0 +1,121 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of TargetGroupAttribute. + */ +@Fluent +public final class TargetGroupAttribute implements JsonSerializable { + /* + * The value of the attribute. + */ + private String key; + + /* + * The name of the attribute. + */ + private String value; + + /** + * Creates an instance of TargetGroupAttribute class. + */ + public TargetGroupAttribute() { + } + + /** + * Get the key property: The value of the attribute. + * + * @return the key value. + */ + public String key() { + return this.key; + } + + /** + * Set the key property: The value of the attribute. + * + * @param key the key value to set. + * @return the TargetGroupAttribute object itself. + */ + public TargetGroupAttribute withKey(String key) { + this.key = key; + return this; + } + + /** + * Get the value property: The name of the attribute. + * + * @return the value value. + */ + public String value() { + return this.value; + } + + /** + * Set the value property: The name of the attribute. + * + * @param value the value value to set. + * @return the TargetGroupAttribute object itself. + */ + public TargetGroupAttribute withValue(String value) { + this.value = value; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("key", this.key); + jsonWriter.writeStringField("value", this.value); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of TargetGroupAttribute from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of TargetGroupAttribute if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the TargetGroupAttribute. + */ + public static TargetGroupAttribute fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + TargetGroupAttribute deserializedTargetGroupAttribute = new TargetGroupAttribute(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("key".equals(fieldName)) { + deserializedTargetGroupAttribute.key = reader.getString(); + } else if ("value".equals(fieldName)) { + deserializedTargetGroupAttribute.value = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedTargetGroupAttribute; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/TargetGroupStickinessConfig.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/TargetGroupStickinessConfig.java new file mode 100644 index 000000000000..caa7e6fa2000 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/TargetGroupStickinessConfig.java @@ -0,0 +1,124 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of TargetGroupStickinessConfig. + */ +@Fluent +public final class TargetGroupStickinessConfig implements JsonSerializable { + /* + * The time period, in seconds, during which requests from a client should be routed to the same target group. The + * range is 1-604800 seconds (7 days). + */ + private Integer durationSeconds; + + /* + * Indicates whether target group stickiness is enabled. + */ + private Boolean enabled; + + /** + * Creates an instance of TargetGroupStickinessConfig class. + */ + public TargetGroupStickinessConfig() { + } + + /** + * Get the durationSeconds property: The time period, in seconds, during which requests from a client should be + * routed to the same target group. The range is 1-604800 seconds (7 days). + * + * @return the durationSeconds value. + */ + public Integer durationSeconds() { + return this.durationSeconds; + } + + /** + * Set the durationSeconds property: The time period, in seconds, during which requests from a client should be + * routed to the same target group. The range is 1-604800 seconds (7 days). + * + * @param durationSeconds the durationSeconds value to set. + * @return the TargetGroupStickinessConfig object itself. + */ + public TargetGroupStickinessConfig withDurationSeconds(Integer durationSeconds) { + this.durationSeconds = durationSeconds; + return this; + } + + /** + * Get the enabled property: Indicates whether target group stickiness is enabled. + * + * @return the enabled value. + */ + public Boolean enabled() { + return this.enabled; + } + + /** + * Set the enabled property: Indicates whether target group stickiness is enabled. + * + * @param enabled the enabled value to set. + * @return the TargetGroupStickinessConfig object itself. + */ + public TargetGroupStickinessConfig withEnabled(Boolean enabled) { + this.enabled = enabled; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeNumberField("durationSeconds", this.durationSeconds); + jsonWriter.writeBooleanField("enabled", this.enabled); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of TargetGroupStickinessConfig from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of TargetGroupStickinessConfig if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the TargetGroupStickinessConfig. + */ + public static TargetGroupStickinessConfig fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + TargetGroupStickinessConfig deserializedTargetGroupStickinessConfig = new TargetGroupStickinessConfig(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("durationSeconds".equals(fieldName)) { + deserializedTargetGroupStickinessConfig.durationSeconds = reader.getNullable(JsonReader::getInt); + } else if ("enabled".equals(fieldName)) { + deserializedTargetGroupStickinessConfig.enabled = reader.getNullable(JsonReader::getBoolean); + } else { + reader.skipChildren(); + } + } + + return deserializedTargetGroupStickinessConfig; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/TargetGroupTuple.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/TargetGroupTuple.java new file mode 100644 index 000000000000..383936e05b51 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/TargetGroupTuple.java @@ -0,0 +1,121 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of TargetGroupTuple. + */ +@Fluent +public final class TargetGroupTuple implements JsonSerializable { + /* + * The Amazon Resource Name (ARN) of the target group. + */ + private String targetGroupArn; + + /* + * The weight. The range is 0 to 999. + */ + private Integer weight; + + /** + * Creates an instance of TargetGroupTuple class. + */ + public TargetGroupTuple() { + } + + /** + * Get the targetGroupArn property: The Amazon Resource Name (ARN) of the target group. + * + * @return the targetGroupArn value. + */ + public String targetGroupArn() { + return this.targetGroupArn; + } + + /** + * Set the targetGroupArn property: The Amazon Resource Name (ARN) of the target group. + * + * @param targetGroupArn the targetGroupArn value to set. + * @return the TargetGroupTuple object itself. + */ + public TargetGroupTuple withTargetGroupArn(String targetGroupArn) { + this.targetGroupArn = targetGroupArn; + return this; + } + + /** + * Get the weight property: The weight. The range is 0 to 999. + * + * @return the weight value. + */ + public Integer weight() { + return this.weight; + } + + /** + * Set the weight property: The weight. The range is 0 to 999. + * + * @param weight the weight value to set. + * @return the TargetGroupTuple object itself. + */ + public TargetGroupTuple withWeight(Integer weight) { + this.weight = weight; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("targetGroupArn", this.targetGroupArn); + jsonWriter.writeNumberField("weight", this.weight); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of TargetGroupTuple from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of TargetGroupTuple if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the TargetGroupTuple. + */ + public static TargetGroupTuple fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + TargetGroupTuple deserializedTargetGroupTuple = new TargetGroupTuple(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("targetGroupArn".equals(fieldName)) { + deserializedTargetGroupTuple.targetGroupArn = reader.getString(); + } else if ("weight".equals(fieldName)) { + deserializedTargetGroupTuple.weight = reader.getNullable(JsonReader::getInt); + } else { + reader.skipChildren(); + } + } + + return deserializedTargetGroupTuple; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/TargetHealth.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/TargetHealth.java new file mode 100644 index 000000000000..c0de747d1ba8 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/TargetHealth.java @@ -0,0 +1,244 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of TargetHealth. + */ +@Fluent +public final class TargetHealth implements JsonSerializable { + /* + *

A description of the target health that provides additional details. If the state is healthy, a + * description is not provided.

+ */ + private String description; + + /* + *

The reason code.

If the target state is healthy, a reason code is not provided.

If + * the target state is initial, the reason code can be one of the following values:

  • + * Elb.RegistrationInProgress - The target is in the process of being registered with the load + * balancer.

  • Elb.InitialHealthChecking - The load balancer is still sending the + * target the minimum number of health checks required to determine its health status.

If the + * target state is unhealthy, the reason code can be one of the following values:

  • + * Target.ResponseCodeMismatch - The health checks did not return an expected HTTP code. Applies only + * to Application Load Balancers and Gateway Load Balancers.

  • Target.Timeout - The + * health check requests timed out. Applies only to Application Load Balancers and Gateway Load Balancers.

  • + *
  • Target.FailedHealthChecks - The load balancer received an error while establishing a + * connection to the target or the target response was malformed.

  • Elb.InternalError + * - The health checks failed due to an internal error. Applies only to Application Load Balancers.

+ *

If the target state is unused, the reason code can be one of the following values:

  • + *

    Target.NotRegistered - The target is not registered with the target group.

  • + * Target.NotInUse - The target group is not used by any load balancer or the target is in an + * Availability Zone that is not enabled for its load balancer.

  • Target.InvalidState + * - The target is in the stopped or terminated state.

  • Target.IpUnusable - The + * target IP address is reserved for use by a load balancer.

If the target state is + * draining, the reason code can be the following value:

  • + * Target.DeregistrationInProgress - The target is in the process of being deregistered and the + * deregistration delay period has not expired.

If the target state is unavailable, + * the reason code can be the following value:

  • Target.HealthCheckDisabled - Health + * checks are disabled for the target group. Applies only to Application Load Balancers.

  • + * Elb.InternalError - Target health is unavailable due to an internal error. Applies only to Network + * Load Balancers.

+ */ + private TargetHealthReasonEnumValue reason; + + /* + *

The state of the target.

+ */ + private TargetHealthStateEnumValue state; + + /** + * Creates an instance of TargetHealth class. + */ + public TargetHealth() { + } + + /** + * Get the description property: <p>A description of the target health that provides additional details. If + * the state is <code>healthy</code>, a description is not provided.</p>. + * + * @return the description value. + */ + public String description() { + return this.description; + } + + /** + * Set the description property: <p>A description of the target health that provides additional details. If + * the state is <code>healthy</code>, a description is not provided.</p>. + * + * @param description the description value to set. + * @return the TargetHealth object itself. + */ + public TargetHealth withDescription(String description) { + this.description = description; + return this; + } + + /** + * Get the reason property: <p>The reason code.</p> <p>If the target state is + * <code>healthy</code>, a reason code is not provided.</p> <p>If the target state is + * <code>initial</code>, the reason code can be one of the following values:</p> <ul> + * <li> <p> <code>Elb.RegistrationInProgress</code> - The target is in the process of being + * registered with the load balancer.</p> </li> <li> <p> + * <code>Elb.InitialHealthChecking</code> - The load balancer is still sending the target the minimum + * number of health checks required to determine its health status.</p> </li> </ul> <p>If + * the target state is <code>unhealthy</code>, the reason code can be one of the following + * values:</p> <ul> <li> <p> <code>Target.ResponseCodeMismatch</code> - The + * health checks did not return an expected HTTP code. Applies only to Application Load Balancers and Gateway Load + * Balancers.</p> </li> <li> <p> <code>Target.Timeout</code> - The health check + * requests timed out. Applies only to Application Load Balancers and Gateway Load Balancers.</p> </li> + * <li> <p> <code>Target.FailedHealthChecks</code> - The load balancer received an error + * while establishing a connection to the target or the target response was malformed.</p> </li> + * <li> <p> <code>Elb.InternalError</code> - The health checks failed due to an internal + * error. Applies only to Application Load Balancers.</p> </li> </ul> <p>If the target state + * is <code>unused</code>, the reason code can be one of the following values:</p> <ul> + * <li> <p> <code>Target.NotRegistered</code> - The target is not registered with the target + * group.</p> </li> <li> <p> <code>Target.NotInUse</code> - The target group is + * not used by any load balancer or the target is in an Availability Zone that is not enabled for its load + * balancer.</p> </li> <li> <p> <code>Target.InvalidState</code> - The target is + * in the stopped or terminated state.</p> </li> <li> <p> + * <code>Target.IpUnusable</code> - The target IP address is reserved for use by a load + * balancer.</p> </li> </ul> <p>If the target state is <code>draining</code>, + * the reason code can be the following value:</p> <ul> <li> <p> + * <code>Target.DeregistrationInProgress</code> - The target is in the process of being deregistered and + * the deregistration delay period has not expired.</p> </li> </ul> <p>If the target state + * is <code>unavailable</code>, the reason code can be the following value:</p> <ul> + * <li> <p> <code>Target.HealthCheckDisabled</code> - Health checks are disabled for the + * target group. Applies only to Application Load Balancers.</p> </li> <li> <p> + * <code>Elb.InternalError</code> - Target health is unavailable due to an internal error. Applies only + * to Network Load Balancers.</p> </li> </ul>. + * + * @return the reason value. + */ + public TargetHealthReasonEnumValue reason() { + return this.reason; + } + + /** + * Set the reason property: <p>The reason code.</p> <p>If the target state is + * <code>healthy</code>, a reason code is not provided.</p> <p>If the target state is + * <code>initial</code>, the reason code can be one of the following values:</p> <ul> + * <li> <p> <code>Elb.RegistrationInProgress</code> - The target is in the process of being + * registered with the load balancer.</p> </li> <li> <p> + * <code>Elb.InitialHealthChecking</code> - The load balancer is still sending the target the minimum + * number of health checks required to determine its health status.</p> </li> </ul> <p>If + * the target state is <code>unhealthy</code>, the reason code can be one of the following + * values:</p> <ul> <li> <p> <code>Target.ResponseCodeMismatch</code> - The + * health checks did not return an expected HTTP code. Applies only to Application Load Balancers and Gateway Load + * Balancers.</p> </li> <li> <p> <code>Target.Timeout</code> - The health check + * requests timed out. Applies only to Application Load Balancers and Gateway Load Balancers.</p> </li> + * <li> <p> <code>Target.FailedHealthChecks</code> - The load balancer received an error + * while establishing a connection to the target or the target response was malformed.</p> </li> + * <li> <p> <code>Elb.InternalError</code> - The health checks failed due to an internal + * error. Applies only to Application Load Balancers.</p> </li> </ul> <p>If the target state + * is <code>unused</code>, the reason code can be one of the following values:</p> <ul> + * <li> <p> <code>Target.NotRegistered</code> - The target is not registered with the target + * group.</p> </li> <li> <p> <code>Target.NotInUse</code> - The target group is + * not used by any load balancer or the target is in an Availability Zone that is not enabled for its load + * balancer.</p> </li> <li> <p> <code>Target.InvalidState</code> - The target is + * in the stopped or terminated state.</p> </li> <li> <p> + * <code>Target.IpUnusable</code> - The target IP address is reserved for use by a load + * balancer.</p> </li> </ul> <p>If the target state is <code>draining</code>, + * the reason code can be the following value:</p> <ul> <li> <p> + * <code>Target.DeregistrationInProgress</code> - The target is in the process of being deregistered and + * the deregistration delay period has not expired.</p> </li> </ul> <p>If the target state + * is <code>unavailable</code>, the reason code can be the following value:</p> <ul> + * <li> <p> <code>Target.HealthCheckDisabled</code> - Health checks are disabled for the + * target group. Applies only to Application Load Balancers.</p> </li> <li> <p> + * <code>Elb.InternalError</code> - Target health is unavailable due to an internal error. Applies only + * to Network Load Balancers.</p> </li> </ul>. + * + * @param reason the reason value to set. + * @return the TargetHealth object itself. + */ + public TargetHealth withReason(TargetHealthReasonEnumValue reason) { + this.reason = reason; + return this; + } + + /** + * Get the state property: <p>The state of the target.</p>. + * + * @return the state value. + */ + public TargetHealthStateEnumValue state() { + return this.state; + } + + /** + * Set the state property: <p>The state of the target.</p>. + * + * @param state the state value to set. + * @return the TargetHealth object itself. + */ + public TargetHealth withState(TargetHealthStateEnumValue state) { + this.state = state; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (reason() != null) { + reason().validate(); + } + if (state() != null) { + state().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("description", this.description); + jsonWriter.writeJsonField("reason", this.reason); + jsonWriter.writeJsonField("state", this.state); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of TargetHealth from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of TargetHealth if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the TargetHealth. + */ + public static TargetHealth fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + TargetHealth deserializedTargetHealth = new TargetHealth(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("description".equals(fieldName)) { + deserializedTargetHealth.description = reader.getString(); + } else if ("reason".equals(fieldName)) { + deserializedTargetHealth.reason = TargetHealthReasonEnumValue.fromJson(reader); + } else if ("state".equals(fieldName)) { + deserializedTargetHealth.state = TargetHealthStateEnumValue.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedTargetHealth; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/TargetHealthReasonEnum.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/TargetHealthReasonEnum.java new file mode 100644 index 000000000000..c58374d3cd0f --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/TargetHealthReasonEnum.java @@ -0,0 +1,103 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * TargetHealthReasonEnum enum. + */ +public final class TargetHealthReasonEnum extends ExpandableStringEnum { + /** + * Static value Elb.InitialHealthChecking for TargetHealthReasonEnum. + */ + public static final TargetHealthReasonEnum ELB_INITIAL_HEALTH_CHECKING = fromString("Elb.InitialHealthChecking"); + + /** + * Static value Elb.InternalError for TargetHealthReasonEnum. + */ + public static final TargetHealthReasonEnum ELB_INTERNAL_ERROR = fromString("Elb.InternalError"); + + /** + * Static value Elb.RegistrationInProgress for TargetHealthReasonEnum. + */ + public static final TargetHealthReasonEnum ELB_REGISTRATION_IN_PROGRESS = fromString("Elb.RegistrationInProgress"); + + /** + * Static value Target.DeregistrationInProgress for TargetHealthReasonEnum. + */ + public static final TargetHealthReasonEnum TARGET_DEREGISTRATION_IN_PROGRESS + = fromString("Target.DeregistrationInProgress"); + + /** + * Static value Target.FailedHealthChecks for TargetHealthReasonEnum. + */ + public static final TargetHealthReasonEnum TARGET_FAILED_HEALTH_CHECKS = fromString("Target.FailedHealthChecks"); + + /** + * Static value Target.HealthCheckDisabled for TargetHealthReasonEnum. + */ + public static final TargetHealthReasonEnum TARGET_HEALTH_CHECK_DISABLED = fromString("Target.HealthCheckDisabled"); + + /** + * Static value Target.InvalidState for TargetHealthReasonEnum. + */ + public static final TargetHealthReasonEnum TARGET_INVALID_STATE = fromString("Target.InvalidState"); + + /** + * Static value Target.IpUnusable for TargetHealthReasonEnum. + */ + public static final TargetHealthReasonEnum TARGET_IP_UNUSABLE = fromString("Target.IpUnusable"); + + /** + * Static value Target.NotInUse for TargetHealthReasonEnum. + */ + public static final TargetHealthReasonEnum TARGET_NOT_IN_USE = fromString("Target.NotInUse"); + + /** + * Static value Target.NotRegistered for TargetHealthReasonEnum. + */ + public static final TargetHealthReasonEnum TARGET_NOT_REGISTERED = fromString("Target.NotRegistered"); + + /** + * Static value Target.ResponseCodeMismatch for TargetHealthReasonEnum. + */ + public static final TargetHealthReasonEnum TARGET_RESPONSE_CODE_MISMATCH + = fromString("Target.ResponseCodeMismatch"); + + /** + * Static value Target.Timeout for TargetHealthReasonEnum. + */ + public static final TargetHealthReasonEnum TARGET_TIMEOUT = fromString("Target.Timeout"); + + /** + * Creates a new instance of TargetHealthReasonEnum value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public TargetHealthReasonEnum() { + } + + /** + * Creates or finds a TargetHealthReasonEnum from its string representation. + * + * @param name a name to look for. + * @return the corresponding TargetHealthReasonEnum. + */ + public static TargetHealthReasonEnum fromString(String name) { + return fromString(name, TargetHealthReasonEnum.class); + } + + /** + * Gets known TargetHealthReasonEnum values. + * + * @return known TargetHealthReasonEnum values. + */ + public static Collection values() { + return values(TargetHealthReasonEnum.class); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/TargetHealthReasonEnumValue.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/TargetHealthReasonEnumValue.java new file mode 100644 index 000000000000..a203a8a5dc01 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/TargetHealthReasonEnumValue.java @@ -0,0 +1,94 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of TargetHealthReasonEnumEnumValue. + */ +@Fluent +public final class TargetHealthReasonEnumValue implements JsonSerializable { + /* + * Property value + */ + private TargetHealthReasonEnum value; + + /** + * Creates an instance of TargetHealthReasonEnumValue class. + */ + public TargetHealthReasonEnumValue() { + } + + /** + * Get the value property: Property value. + * + * @return the value value. + */ + public TargetHealthReasonEnum value() { + return this.value; + } + + /** + * Set the value property: Property value. + * + * @param value the value value to set. + * @return the TargetHealthReasonEnumValue object itself. + */ + public TargetHealthReasonEnumValue withValue(TargetHealthReasonEnum value) { + this.value = value; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("value", this.value == null ? null : this.value.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of TargetHealthReasonEnumValue from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of TargetHealthReasonEnumValue if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the TargetHealthReasonEnumValue. + */ + public static TargetHealthReasonEnumValue fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + TargetHealthReasonEnumValue deserializedTargetHealthReasonEnumValue = new TargetHealthReasonEnumValue(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + deserializedTargetHealthReasonEnumValue.value + = TargetHealthReasonEnum.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedTargetHealthReasonEnumValue; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/TargetHealthStateEnum.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/TargetHealthStateEnum.java new file mode 100644 index 000000000000..394d505e3f22 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/TargetHealthStateEnum.java @@ -0,0 +1,76 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * TargetHealthStateEnum enum. + */ +public final class TargetHealthStateEnum extends ExpandableStringEnum { + /** + * Static value draining for TargetHealthStateEnum. + */ + public static final TargetHealthStateEnum DRAINING = fromString("draining"); + + /** + * Static value healthy for TargetHealthStateEnum. + */ + public static final TargetHealthStateEnum HEALTHY = fromString("healthy"); + + /** + * Static value initial for TargetHealthStateEnum. + */ + public static final TargetHealthStateEnum INITIAL = fromString("initial"); + + /** + * Static value unavailable for TargetHealthStateEnum. + */ + public static final TargetHealthStateEnum UNAVAILABLE = fromString("unavailable"); + + /** + * Static value unhealthy for TargetHealthStateEnum. + */ + public static final TargetHealthStateEnum UNHEALTHY = fromString("unhealthy"); + + /** + * Static value unhealthy.draining for TargetHealthStateEnum. + */ + public static final TargetHealthStateEnum UNHEALTHY_DRAINING = fromString("unhealthy.draining"); + + /** + * Static value unused for TargetHealthStateEnum. + */ + public static final TargetHealthStateEnum UNUSED = fromString("unused"); + + /** + * Creates a new instance of TargetHealthStateEnum value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public TargetHealthStateEnum() { + } + + /** + * Creates or finds a TargetHealthStateEnum from its string representation. + * + * @param name a name to look for. + * @return the corresponding TargetHealthStateEnum. + */ + public static TargetHealthStateEnum fromString(String name) { + return fromString(name, TargetHealthStateEnum.class); + } + + /** + * Gets known TargetHealthStateEnum values. + * + * @return known TargetHealthStateEnum values. + */ + public static Collection values() { + return values(TargetHealthStateEnum.class); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/TargetHealthStateEnumValue.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/TargetHealthStateEnumValue.java new file mode 100644 index 000000000000..29ccfb4e4016 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/TargetHealthStateEnumValue.java @@ -0,0 +1,93 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of TargetHealthStateEnumEnumValue. + */ +@Fluent +public final class TargetHealthStateEnumValue implements JsonSerializable { + /* + * Property value + */ + private TargetHealthStateEnum value; + + /** + * Creates an instance of TargetHealthStateEnumValue class. + */ + public TargetHealthStateEnumValue() { + } + + /** + * Get the value property: Property value. + * + * @return the value value. + */ + public TargetHealthStateEnum value() { + return this.value; + } + + /** + * Set the value property: Property value. + * + * @param value the value value to set. + * @return the TargetHealthStateEnumValue object itself. + */ + public TargetHealthStateEnumValue withValue(TargetHealthStateEnum value) { + this.value = value; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("value", this.value == null ? null : this.value.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of TargetHealthStateEnumValue from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of TargetHealthStateEnumValue if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IOException If an error occurs while reading the TargetHealthStateEnumValue. + */ + public static TargetHealthStateEnumValue fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + TargetHealthStateEnumValue deserializedTargetHealthStateEnumValue = new TargetHealthStateEnumValue(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + deserializedTargetHealthStateEnumValue.value = TargetHealthStateEnum.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedTargetHealthStateEnumValue; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/TargetObjectKeyFormat.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/TargetObjectKeyFormat.java new file mode 100644 index 000000000000..023f04134998 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/TargetObjectKeyFormat.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.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of TargetObjectKeyFormat. + */ +@Fluent +public final class TargetObjectKeyFormat implements JsonSerializable { + /* + * This format defaults the prefix to the given log file prefix for delivering server access log file. + */ + private Object simplePrefix; + + /* + * Amazon S3 keys for log objects are partitioned in the following format: + * ``[DestinationPrefix][SourceAccountId]/[SourceRegion]/[SourceBucket]/[YYYY]/[MM]/[DD]/[YYYY]-[MM]-[DD]-[hh]-[mm]- + * [ss]-[UniqueString]`` PartitionedPrefix defaults to EventTime delivery when server access logs are delivered. + */ + private PartitionedPrefix partitionedPrefix; + + /** + * Creates an instance of TargetObjectKeyFormat class. + */ + public TargetObjectKeyFormat() { + } + + /** + * Get the simplePrefix property: This format defaults the prefix to the given log file prefix for delivering server + * access log file. + * + * @return the simplePrefix value. + */ + public Object simplePrefix() { + return this.simplePrefix; + } + + /** + * Set the simplePrefix property: This format defaults the prefix to the given log file prefix for delivering server + * access log file. + * + * @param simplePrefix the simplePrefix value to set. + * @return the TargetObjectKeyFormat object itself. + */ + public TargetObjectKeyFormat withSimplePrefix(Object simplePrefix) { + this.simplePrefix = simplePrefix; + return this; + } + + /** + * Get the partitionedPrefix property: Amazon S3 keys for log objects are partitioned in the following format: + * ``[DestinationPrefix][SourceAccountId]/[SourceRegion]/[SourceBucket]/[YYYY]/[MM]/[DD]/[YYYY]-[MM]-[DD]-[hh]-[mm]-[ss]-[UniqueString]`` + * PartitionedPrefix defaults to EventTime delivery when server access logs are delivered. + * + * @return the partitionedPrefix value. + */ + public PartitionedPrefix partitionedPrefix() { + return this.partitionedPrefix; + } + + /** + * Set the partitionedPrefix property: Amazon S3 keys for log objects are partitioned in the following format: + * ``[DestinationPrefix][SourceAccountId]/[SourceRegion]/[SourceBucket]/[YYYY]/[MM]/[DD]/[YYYY]-[MM]-[DD]-[hh]-[mm]-[ss]-[UniqueString]`` + * PartitionedPrefix defaults to EventTime delivery when server access logs are delivered. + * + * @param partitionedPrefix the partitionedPrefix value to set. + * @return the TargetObjectKeyFormat object itself. + */ + public TargetObjectKeyFormat withPartitionedPrefix(PartitionedPrefix partitionedPrefix) { + this.partitionedPrefix = partitionedPrefix; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (partitionedPrefix() != null) { + partitionedPrefix().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeUntypedField("simplePrefix", this.simplePrefix); + jsonWriter.writeJsonField("partitionedPrefix", this.partitionedPrefix); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of TargetObjectKeyFormat from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of TargetObjectKeyFormat if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the TargetObjectKeyFormat. + */ + public static TargetObjectKeyFormat fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + TargetObjectKeyFormat deserializedTargetObjectKeyFormat = new TargetObjectKeyFormat(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("simplePrefix".equals(fieldName)) { + deserializedTargetObjectKeyFormat.simplePrefix = reader.readUntyped(); + } else if ("partitionedPrefix".equals(fieldName)) { + deserializedTargetObjectKeyFormat.partitionedPrefix = PartitionedPrefix.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedTargetObjectKeyFormat; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/TaskDefinitionPlacementConstraint.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/TaskDefinitionPlacementConstraint.java new file mode 100644 index 000000000000..8b697daf41e0 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/TaskDefinitionPlacementConstraint.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.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of TaskDefinitionPlacementConstraint. + */ +@Fluent +public final class TaskDefinitionPlacementConstraint implements JsonSerializable { + /* + * A cluster query language expression to apply to the constraint. For more information, see [Cluster query + * language](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/cluster-query-language.html) in the *Amazon + * Elastic Container Service Developer Guide*. + */ + private String expression; + + /* + * The type of constraint. The ``MemberOf`` constraint restricts selection to be from a group of valid candidates. + */ + private String type; + + /** + * Creates an instance of TaskDefinitionPlacementConstraint class. + */ + public TaskDefinitionPlacementConstraint() { + } + + /** + * Get the expression property: A cluster query language expression to apply to the constraint. For more + * information, see [Cluster query + * language](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/cluster-query-language.html) in the *Amazon + * Elastic Container Service Developer Guide*. + * + * @return the expression value. + */ + public String expression() { + return this.expression; + } + + /** + * Set the expression property: A cluster query language expression to apply to the constraint. For more + * information, see [Cluster query + * language](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/cluster-query-language.html) in the *Amazon + * Elastic Container Service Developer Guide*. + * + * @param expression the expression value to set. + * @return the TaskDefinitionPlacementConstraint object itself. + */ + public TaskDefinitionPlacementConstraint withExpression(String expression) { + this.expression = expression; + return this; + } + + /** + * Get the type property: The type of constraint. The ``MemberOf`` constraint restricts selection to be from a group + * of valid candidates. + * + * @return the type value. + */ + public String type() { + return this.type; + } + + /** + * Set the type property: The type of constraint. The ``MemberOf`` constraint restricts selection to be from a group + * of valid candidates. + * + * @param type the type value to set. + * @return the TaskDefinitionPlacementConstraint object itself. + */ + public TaskDefinitionPlacementConstraint withType(String type) { + this.type = type; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("expression", this.expression); + jsonWriter.writeStringField("type", this.type); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of TaskDefinitionPlacementConstraint from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of TaskDefinitionPlacementConstraint if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the TaskDefinitionPlacementConstraint. + */ + public static TaskDefinitionPlacementConstraint fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + TaskDefinitionPlacementConstraint deserializedTaskDefinitionPlacementConstraint + = new TaskDefinitionPlacementConstraint(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("expression".equals(fieldName)) { + deserializedTaskDefinitionPlacementConstraint.expression = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedTaskDefinitionPlacementConstraint.type = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedTaskDefinitionPlacementConstraint; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/TcpFlagField.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/TcpFlagField.java new file mode 100644 index 000000000000..96159101f1d4 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/TcpFlagField.java @@ -0,0 +1,124 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Definition of TCPFlagField. + */ +@Fluent +public final class TcpFlagField implements JsonSerializable { + /* + * Property flags + */ + private List flags; + + /* + * Property masks + */ + private List masks; + + /** + * Creates an instance of TcpFlagField class. + */ + public TcpFlagField() { + } + + /** + * Get the flags property: Property flags. + * + * @return the flags value. + */ + public List flags() { + return this.flags; + } + + /** + * Set the flags property: Property flags. + * + * @param flags the flags value to set. + * @return the TcpFlagField object itself. + */ + public TcpFlagField withFlags(List flags) { + this.flags = flags; + return this; + } + + /** + * Get the masks property: Property masks. + * + * @return the masks value. + */ + public List masks() { + return this.masks; + } + + /** + * Set the masks property: Property masks. + * + * @param masks the masks value to set. + * @return the TcpFlagField object itself. + */ + public TcpFlagField withMasks(List masks) { + this.masks = masks; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("flags", this.flags, (writer, element) -> writer.writeString(element)); + jsonWriter.writeArrayField("masks", this.masks, (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of TcpFlagField from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of TcpFlagField if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the TcpFlagField. + */ + public static TcpFlagField fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + TcpFlagField deserializedTcpFlagField = new TcpFlagField(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("flags".equals(fieldName)) { + List flags = reader.readArray(reader1 -> reader1.getString()); + deserializedTcpFlagField.flags = flags; + } else if ("masks".equals(fieldName)) { + List masks = reader.readArray(reader1 -> reader1.getString()); + deserializedTcpFlagField.masks = masks; + } else { + reader.skipChildren(); + } + } + + return deserializedTcpFlagField; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/Tenancy.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/Tenancy.java new file mode 100644 index 000000000000..8279b8ca4b78 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/Tenancy.java @@ -0,0 +1,56 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Tenancy enum. + */ +public final class Tenancy extends ExpandableStringEnum { + /** + * Static value dedicated for Tenancy. + */ + public static final Tenancy DEDICATED = fromString("dedicated"); + + /** + * Static value default for Tenancy. + */ + public static final Tenancy DEFAULT = fromString("default"); + + /** + * Static value host for Tenancy. + */ + public static final Tenancy HOST = fromString("host"); + + /** + * Creates a new instance of Tenancy value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public Tenancy() { + } + + /** + * Creates or finds a Tenancy from its string representation. + * + * @param name a name to look for. + * @return the corresponding Tenancy. + */ + public static Tenancy fromString(String name) { + return fromString(name, Tenancy.class); + } + + /** + * Gets known Tenancy values. + * + * @return known Tenancy values. + */ + public static Collection values() { + return values(Tenancy.class); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/TenancyEnumValue.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/TenancyEnumValue.java new file mode 100644 index 000000000000..7586f5c524e9 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/TenancyEnumValue.java @@ -0,0 +1,93 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of TenancyEnumValue. + */ +@Fluent +public final class TenancyEnumValue implements JsonSerializable { + /* + * Property value + */ + private Tenancy value; + + /** + * Creates an instance of TenancyEnumValue class. + */ + public TenancyEnumValue() { + } + + /** + * Get the value property: Property value. + * + * @return the value value. + */ + public Tenancy value() { + return this.value; + } + + /** + * Set the value property: Property value. + * + * @param value the value value to set. + * @return the TenancyEnumValue object itself. + */ + public TenancyEnumValue withValue(Tenancy value) { + this.value = value; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("value", this.value == null ? null : this.value.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of TenancyEnumValue from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of TenancyEnumValue if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the TenancyEnumValue. + */ + public static TenancyEnumValue fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + TenancyEnumValue deserializedTenancyEnumValue = new TenancyEnumValue(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + deserializedTenancyEnumValue.value = Tenancy.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedTenancyEnumValue; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/Tier.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/Tier.java new file mode 100644 index 000000000000..c0627b99fad1 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/Tier.java @@ -0,0 +1,56 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Tier enum. + */ +public final class Tier extends ExpandableStringEnum { + /** + * Static value Advanced for Tier. + */ + public static final Tier ADVANCED = fromString("Advanced"); + + /** + * Static value Intelligent-Tiering for Tier. + */ + public static final Tier INTELLIGENT_TIERING = fromString("Intelligent-Tiering"); + + /** + * Static value Standard for Tier. + */ + public static final Tier STANDARD = fromString("Standard"); + + /** + * Creates a new instance of Tier value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public Tier() { + } + + /** + * Creates or finds a Tier from its string representation. + * + * @param name a name to look for. + * @return the corresponding Tier. + */ + public static Tier fromString(String name) { + return fromString(name, Tier.class); + } + + /** + * Gets known Tier values. + * + * @return known Tier values. + */ + public static Collection values() { + return values(Tier.class); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/TierAutoGenerated.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/TierAutoGenerated.java new file mode 100644 index 000000000000..cbfb6aa4987a --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/TierAutoGenerated.java @@ -0,0 +1,152 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of Tier. + */ +@Fluent +public final class TierAutoGenerated implements JsonSerializable { + /* + * The name of this environment tier. + */ + private String name; + + /* + * The type of this environment tier. + */ + private String type; + + /* + * The version of this environment tier. When you don't set a value to it, Elastic Beanstalk uses the latest + * compatible worker tier version. + */ + private String version; + + /** + * Creates an instance of TierAutoGenerated class. + */ + public TierAutoGenerated() { + } + + /** + * Get the name property: The name of this environment tier. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: The name of this environment tier. + * + * @param name the name value to set. + * @return the TierAutoGenerated object itself. + */ + public TierAutoGenerated withName(String name) { + this.name = name; + return this; + } + + /** + * Get the type property: The type of this environment tier. + * + * @return the type value. + */ + public String type() { + return this.type; + } + + /** + * Set the type property: The type of this environment tier. + * + * @param type the type value to set. + * @return the TierAutoGenerated object itself. + */ + public TierAutoGenerated withType(String type) { + this.type = type; + return this; + } + + /** + * Get the version property: The version of this environment tier. When you don't set a value to it, Elastic + * Beanstalk uses the latest compatible worker tier version. + * + * @return the version value. + */ + public String version() { + return this.version; + } + + /** + * Set the version property: The version of this environment tier. When you don't set a value to it, Elastic + * Beanstalk uses the latest compatible worker tier version. + * + * @param version the version value to set. + * @return the TierAutoGenerated object itself. + */ + public TierAutoGenerated withVersion(String version) { + this.version = version; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("name", this.name); + jsonWriter.writeStringField("type", this.type); + jsonWriter.writeStringField("version", this.version); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of TierAutoGenerated from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of TierAutoGenerated if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the TierAutoGenerated. + */ + public static TierAutoGenerated fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + TierAutoGenerated deserializedTierAutoGenerated = new TierAutoGenerated(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("name".equals(fieldName)) { + deserializedTierAutoGenerated.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedTierAutoGenerated.type = reader.getString(); + } else if ("version".equals(fieldName)) { + deserializedTierAutoGenerated.version = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedTierAutoGenerated; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/Tiering.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/Tiering.java new file mode 100644 index 000000000000..29aa55b6d18a --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/Tiering.java @@ -0,0 +1,138 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of Tiering. + */ +@Fluent +public final class Tiering implements JsonSerializable { + /* + * S3 Intelligent-Tiering access tier. See [Storage class for automatically optimizing frequently and infrequently + * accessed + * objects](https://docs.aws.amazon.com/AmazonS3/latest/dev/storage-class-intro.html#sc-dynamic-data-access) for a + * list of access tiers in the S3 Intelligent-Tiering storage class. + */ + private TieringAccessTier accessTier; + + /* + * The number of consecutive days of no access after which an object will be eligible to be transitioned to the + * corresponding tier. The minimum number of days specified for Archive Access tier must be at least 90 days and + * Deep Archive Access tier must be at least 180 days. The maximum can be up to 2 years (730 days). + */ + private Integer days; + + /** + * Creates an instance of Tiering class. + */ + public Tiering() { + } + + /** + * Get the accessTier property: S3 Intelligent-Tiering access tier. See [Storage class for automatically optimizing + * frequently and infrequently accessed + * objects](https://docs.aws.amazon.com/AmazonS3/latest/dev/storage-class-intro.html#sc-dynamic-data-access) for a + * list of access tiers in the S3 Intelligent-Tiering storage class. + * + * @return the accessTier value. + */ + public TieringAccessTier accessTier() { + return this.accessTier; + } + + /** + * Set the accessTier property: S3 Intelligent-Tiering access tier. See [Storage class for automatically optimizing + * frequently and infrequently accessed + * objects](https://docs.aws.amazon.com/AmazonS3/latest/dev/storage-class-intro.html#sc-dynamic-data-access) for a + * list of access tiers in the S3 Intelligent-Tiering storage class. + * + * @param accessTier the accessTier value to set. + * @return the Tiering object itself. + */ + public Tiering withAccessTier(TieringAccessTier accessTier) { + this.accessTier = accessTier; + return this; + } + + /** + * Get the days property: The number of consecutive days of no access after which an object will be eligible to be + * transitioned to the corresponding tier. The minimum number of days specified for Archive Access tier must be at + * least 90 days and Deep Archive Access tier must be at least 180 days. The maximum can be up to 2 years (730 + * days). + * + * @return the days value. + */ + public Integer days() { + return this.days; + } + + /** + * Set the days property: The number of consecutive days of no access after which an object will be eligible to be + * transitioned to the corresponding tier. The minimum number of days specified for Archive Access tier must be at + * least 90 days and Deep Archive Access tier must be at least 180 days. The maximum can be up to 2 years (730 + * days). + * + * @param days the days value to set. + * @return the Tiering object itself. + */ + public Tiering withDays(Integer days) { + this.days = days; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("accessTier", this.accessTier == null ? null : this.accessTier.toString()); + jsonWriter.writeNumberField("days", this.days); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of Tiering from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of Tiering if the JsonReader was pointing to an instance of it, or null if it was pointing to + * JSON null. + * @throws IOException If an error occurs while reading the Tiering. + */ + public static Tiering fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + Tiering deserializedTiering = new Tiering(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("accessTier".equals(fieldName)) { + deserializedTiering.accessTier = TieringAccessTier.fromString(reader.getString()); + } else if ("days".equals(fieldName)) { + deserializedTiering.days = reader.getNullable(JsonReader::getInt); + } else { + reader.skipChildren(); + } + } + + return deserializedTiering; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/TieringAccessTier.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/TieringAccessTier.java new file mode 100644 index 000000000000..c32bde6fa27f --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/TieringAccessTier.java @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * TieringAccessTier enum. + */ +public final class TieringAccessTier extends ExpandableStringEnum { + /** + * Static value ARCHIVE_ACCESS for TieringAccessTier. + */ + public static final TieringAccessTier ARCHIVE_ACCESS = fromString("ARCHIVE_ACCESS"); + + /** + * Static value DEEP_ARCHIVE_ACCESS for TieringAccessTier. + */ + public static final TieringAccessTier DEEP_ARCHIVE_ACCESS = fromString("DEEP_ARCHIVE_ACCESS"); + + /** + * Creates a new instance of TieringAccessTier value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public TieringAccessTier() { + } + + /** + * Creates or finds a TieringAccessTier from its string representation. + * + * @param name a name to look for. + * @return the corresponding TieringAccessTier. + */ + public static TieringAccessTier fromString(String name) { + return fromString(name, TieringAccessTier.class); + } + + /** + * Gets known TieringAccessTier values. + * + * @return known TieringAccessTier values. + */ + public static Collection values() { + return values(TieringAccessTier.class); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/TimeToLiveSpecification.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/TimeToLiveSpecification.java new file mode 100644 index 000000000000..62048601b776 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/TimeToLiveSpecification.java @@ -0,0 +1,127 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of TimeToLiveSpecification. + */ +@Fluent +public final class TimeToLiveSpecification implements JsonSerializable { + /* + * The name of the TTL attribute used to store the expiration time for items in the table. + The ``AttributeName`` + * property is required when enabling the TTL, or when TTL is already enabled. + To update this property, you must + * first disable TTL and then enable TTL with the new attribute name. + */ + private String attributeName; + + /* + * Indicates whether TTL is to be enabled (true) or disabled (false) on the table. + */ + private Boolean enabled; + + /** + * Creates an instance of TimeToLiveSpecification class. + */ + public TimeToLiveSpecification() { + } + + /** + * Get the attributeName property: The name of the TTL attribute used to store the expiration time for items in the + * table. + The ``AttributeName`` property is required when enabling the TTL, or when TTL is already enabled. + To + * update this property, you must first disable TTL and then enable TTL with the new attribute name. + * + * @return the attributeName value. + */ + public String attributeName() { + return this.attributeName; + } + + /** + * Set the attributeName property: The name of the TTL attribute used to store the expiration time for items in the + * table. + The ``AttributeName`` property is required when enabling the TTL, or when TTL is already enabled. + To + * update this property, you must first disable TTL and then enable TTL with the new attribute name. + * + * @param attributeName the attributeName value to set. + * @return the TimeToLiveSpecification object itself. + */ + public TimeToLiveSpecification withAttributeName(String attributeName) { + this.attributeName = attributeName; + return this; + } + + /** + * Get the enabled property: Indicates whether TTL is to be enabled (true) or disabled (false) on the table. + * + * @return the enabled value. + */ + public Boolean enabled() { + return this.enabled; + } + + /** + * Set the enabled property: Indicates whether TTL is to be enabled (true) or disabled (false) on the table. + * + * @param enabled the enabled value to set. + * @return the TimeToLiveSpecification object itself. + */ + public TimeToLiveSpecification withEnabled(Boolean enabled) { + this.enabled = enabled; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("attributeName", this.attributeName); + jsonWriter.writeBooleanField("enabled", this.enabled); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of TimeToLiveSpecification from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of TimeToLiveSpecification if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the TimeToLiveSpecification. + */ + public static TimeToLiveSpecification fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + TimeToLiveSpecification deserializedTimeToLiveSpecification = new TimeToLiveSpecification(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("attributeName".equals(fieldName)) { + deserializedTimeToLiveSpecification.attributeName = reader.getString(); + } else if ("enabled".equals(fieldName)) { + deserializedTimeToLiveSpecification.enabled = reader.getNullable(JsonReader::getBoolean); + } else { + reader.skipChildren(); + } + } + + return deserializedTimeToLiveSpecification; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/TimeoutConfiguration.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/TimeoutConfiguration.java new file mode 100644 index 000000000000..f84f247c5546 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/TimeoutConfiguration.java @@ -0,0 +1,135 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of TimeoutConfiguration. + */ +@Fluent +public final class TimeoutConfiguration implements JsonSerializable { + /* + * The amount of time in seconds a connection will stay active while idle. A value of ``0`` can be set to disable + * ``idleTimeout``. The ``idleTimeout`` default for ``HTTP``/``HTTP2``/``GRPC`` is 5 minutes. The ``idleTimeout`` + * default for ``TCP`` is 1 hour. + */ + private Integer idleTimeoutSeconds; + + /* + * The amount of time waiting for the upstream to respond with a complete response per request. A value of ``0`` can + * be set to disable ``perRequestTimeout``. ``perRequestTimeout`` can only be set if Service Connect ``appProtocol`` + * isn't ``TCP``. Only ``idleTimeout`` is allowed for ``TCP`` ``appProtocol``. + */ + private Integer perRequestTimeoutSeconds; + + /** + * Creates an instance of TimeoutConfiguration class. + */ + public TimeoutConfiguration() { + } + + /** + * Get the idleTimeoutSeconds property: The amount of time in seconds a connection will stay active while idle. A + * value of ``0`` can be set to disable ``idleTimeout``. The ``idleTimeout`` default for ``HTTP``/``HTTP2``/``GRPC`` + * is 5 minutes. The ``idleTimeout`` default for ``TCP`` is 1 hour. + * + * @return the idleTimeoutSeconds value. + */ + public Integer idleTimeoutSeconds() { + return this.idleTimeoutSeconds; + } + + /** + * Set the idleTimeoutSeconds property: The amount of time in seconds a connection will stay active while idle. A + * value of ``0`` can be set to disable ``idleTimeout``. The ``idleTimeout`` default for ``HTTP``/``HTTP2``/``GRPC`` + * is 5 minutes. The ``idleTimeout`` default for ``TCP`` is 1 hour. + * + * @param idleTimeoutSeconds the idleTimeoutSeconds value to set. + * @return the TimeoutConfiguration object itself. + */ + public TimeoutConfiguration withIdleTimeoutSeconds(Integer idleTimeoutSeconds) { + this.idleTimeoutSeconds = idleTimeoutSeconds; + return this; + } + + /** + * Get the perRequestTimeoutSeconds property: The amount of time waiting for the upstream to respond with a complete + * response per request. A value of ``0`` can be set to disable ``perRequestTimeout``. ``perRequestTimeout`` can + * only be set if Service Connect ``appProtocol`` isn't ``TCP``. Only ``idleTimeout`` is allowed for ``TCP`` + * ``appProtocol``. + * + * @return the perRequestTimeoutSeconds value. + */ + public Integer perRequestTimeoutSeconds() { + return this.perRequestTimeoutSeconds; + } + + /** + * Set the perRequestTimeoutSeconds property: The amount of time waiting for the upstream to respond with a complete + * response per request. A value of ``0`` can be set to disable ``perRequestTimeout``. ``perRequestTimeout`` can + * only be set if Service Connect ``appProtocol`` isn't ``TCP``. Only ``idleTimeout`` is allowed for ``TCP`` + * ``appProtocol``. + * + * @param perRequestTimeoutSeconds the perRequestTimeoutSeconds value to set. + * @return the TimeoutConfiguration object itself. + */ + public TimeoutConfiguration withPerRequestTimeoutSeconds(Integer perRequestTimeoutSeconds) { + this.perRequestTimeoutSeconds = perRequestTimeoutSeconds; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeNumberField("idleTimeoutSeconds", this.idleTimeoutSeconds); + jsonWriter.writeNumberField("perRequestTimeoutSeconds", this.perRequestTimeoutSeconds); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of TimeoutConfiguration from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of TimeoutConfiguration if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the TimeoutConfiguration. + */ + public static TimeoutConfiguration fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + TimeoutConfiguration deserializedTimeoutConfiguration = new TimeoutConfiguration(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("idleTimeoutSeconds".equals(fieldName)) { + deserializedTimeoutConfiguration.idleTimeoutSeconds = reader.getNullable(JsonReader::getInt); + } else if ("perRequestTimeoutSeconds".equals(fieldName)) { + deserializedTimeoutConfiguration.perRequestTimeoutSeconds = reader.getNullable(JsonReader::getInt); + } else { + reader.skipChildren(); + } + } + + return deserializedTimeoutConfiguration; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/TlsSecurityPolicy.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/TlsSecurityPolicy.java new file mode 100644 index 000000000000..f0c70e0ab54f --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/TlsSecurityPolicy.java @@ -0,0 +1,56 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * TLSSecurityPolicy enum. + */ +public final class TlsSecurityPolicy extends ExpandableStringEnum { + /** + * Static value Policy-Min-TLS-1-0-2019-07 for TlsSecurityPolicy. + */ + public static final TlsSecurityPolicy POLICY_MIN_TLS_1_0_2019_07 = fromString("Policy-Min-TLS-1-0-2019-07"); + + /** + * Static value Policy-Min-TLS-1-2-2019-07 for TlsSecurityPolicy. + */ + public static final TlsSecurityPolicy POLICY_MIN_TLS_1_2_2019_07 = fromString("Policy-Min-TLS-1-2-2019-07"); + + /** + * Static value Policy-Min-TLS-1-2-PFS-2023-10 for TlsSecurityPolicy. + */ + public static final TlsSecurityPolicy POLICY_MIN_TLS_1_2_PFS_2023_10 = fromString("Policy-Min-TLS-1-2-PFS-2023-10"); + + /** + * Creates a new instance of TlsSecurityPolicy value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public TlsSecurityPolicy() { + } + + /** + * Creates or finds a TlsSecurityPolicy from its string representation. + * + * @param name a name to look for. + * @return the corresponding TlsSecurityPolicy. + */ + public static TlsSecurityPolicy fromString(String name) { + return fromString(name, TlsSecurityPolicy.class); + } + + /** + * Gets known TlsSecurityPolicy values. + * + * @return known TlsSecurityPolicy values. + */ + public static Collection values() { + return values(TlsSecurityPolicy.class); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/TlsSecurityPolicyEnumValue.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/TlsSecurityPolicyEnumValue.java new file mode 100644 index 000000000000..f5fd87751465 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/TlsSecurityPolicyEnumValue.java @@ -0,0 +1,93 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of TLSSecurityPolicyEnumValue. + */ +@Fluent +public final class TlsSecurityPolicyEnumValue implements JsonSerializable { + /* + * Property value + */ + private TlsSecurityPolicy value; + + /** + * Creates an instance of TlsSecurityPolicyEnumValue class. + */ + public TlsSecurityPolicyEnumValue() { + } + + /** + * Get the value property: Property value. + * + * @return the value value. + */ + public TlsSecurityPolicy value() { + return this.value; + } + + /** + * Set the value property: Property value. + * + * @param value the value value to set. + * @return the TlsSecurityPolicyEnumValue object itself. + */ + public TlsSecurityPolicyEnumValue withValue(TlsSecurityPolicy value) { + this.value = value; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("value", this.value == null ? null : this.value.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of TlsSecurityPolicyEnumValue from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of TlsSecurityPolicyEnumValue if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IOException If an error occurs while reading the TlsSecurityPolicyEnumValue. + */ + public static TlsSecurityPolicyEnumValue fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + TlsSecurityPolicyEnumValue deserializedTlsSecurityPolicyEnumValue = new TlsSecurityPolicyEnumValue(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + deserializedTlsSecurityPolicyEnumValue.value = TlsSecurityPolicy.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedTlsSecurityPolicyEnumValue; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/Tmpfs.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/Tmpfs.java new file mode 100644 index 000000000000..42b265ef3d8f --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/Tmpfs.java @@ -0,0 +1,151 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Definition of Tmpfs. + */ +@Fluent +public final class Tmpfs implements JsonSerializable { + /* + * The absolute file path where the tmpfs volume is to be mounted. + */ + private String containerPath; + + /* + * The list of tmpfs volume mount options. + */ + private List mountOptions; + + /* + * The maximum size (in MiB) of the tmpfs volume. + */ + private Integer size; + + /** + * Creates an instance of Tmpfs class. + */ + public Tmpfs() { + } + + /** + * Get the containerPath property: The absolute file path where the tmpfs volume is to be mounted. + * + * @return the containerPath value. + */ + public String containerPath() { + return this.containerPath; + } + + /** + * Set the containerPath property: The absolute file path where the tmpfs volume is to be mounted. + * + * @param containerPath the containerPath value to set. + * @return the Tmpfs object itself. + */ + public Tmpfs withContainerPath(String containerPath) { + this.containerPath = containerPath; + return this; + } + + /** + * Get the mountOptions property: The list of tmpfs volume mount options. + * + * @return the mountOptions value. + */ + public List mountOptions() { + return this.mountOptions; + } + + /** + * Set the mountOptions property: The list of tmpfs volume mount options. + * + * @param mountOptions the mountOptions value to set. + * @return the Tmpfs object itself. + */ + public Tmpfs withMountOptions(List mountOptions) { + this.mountOptions = mountOptions; + return this; + } + + /** + * Get the size property: The maximum size (in MiB) of the tmpfs volume. + * + * @return the size value. + */ + public Integer size() { + return this.size; + } + + /** + * Set the size property: The maximum size (in MiB) of the tmpfs volume. + * + * @param size the size value to set. + * @return the Tmpfs object itself. + */ + public Tmpfs withSize(Integer size) { + this.size = size; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("containerPath", this.containerPath); + jsonWriter.writeArrayField("mountOptions", this.mountOptions, (writer, element) -> writer.writeString(element)); + jsonWriter.writeNumberField("size", this.size); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of Tmpfs from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of Tmpfs if the JsonReader was pointing to an instance of it, or null if it was pointing to + * JSON null. + * @throws IOException If an error occurs while reading the Tmpfs. + */ + public static Tmpfs fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + Tmpfs deserializedTmpfs = new Tmpfs(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("containerPath".equals(fieldName)) { + deserializedTmpfs.containerPath = reader.getString(); + } else if ("mountOptions".equals(fieldName)) { + List mountOptions = reader.readArray(reader1 -> reader1.getString()); + deserializedTmpfs.mountOptions = mountOptions; + } else if ("size".equals(fieldName)) { + deserializedTmpfs.size = reader.getNullable(JsonReader::getInt); + } else { + reader.skipChildren(); + } + } + + return deserializedTmpfs; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/TopicConfiguration.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/TopicConfiguration.java new file mode 100644 index 000000000000..099a16475151 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/TopicConfiguration.java @@ -0,0 +1,175 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of TopicConfiguration. + */ +@Fluent +public final class TopicConfiguration implements JsonSerializable { + /* + * The Amazon S3 bucket event about which to send notifications. For more information, see [Supported Event + * Types](https://docs.aws.amazon.com/AmazonS3/latest/dev/NotificationHowTo.html) in the *Amazon S3 User Guide*. + */ + private String event; + + /* + * The filtering rules that determine for which objects to send notifications. For example, you can create a filter + * so that Amazon S3 sends notifications only when image files with a ``.jpg`` extension are added to the bucket. + * Specifies object key name filtering rules. For information about key name filtering, see [Configuring event + * notifications using object key name + * filtering](https://docs.aws.amazon.com/AmazonS3/latest/userguide/notification-how-to-filtering.html) in the + * *Amazon S3 User Guide*. + */ + private NotificationFilter filter; + + /* + * The Amazon Resource Name (ARN) of the Amazon SNS topic to which Amazon S3 publishes a message when it detects + * events of the specified type. + */ + private String topic; + + /** + * Creates an instance of TopicConfiguration class. + */ + public TopicConfiguration() { + } + + /** + * Get the event property: The Amazon S3 bucket event about which to send notifications. For more information, see + * [Supported Event Types](https://docs.aws.amazon.com/AmazonS3/latest/dev/NotificationHowTo.html) in the *Amazon S3 + * User Guide*. + * + * @return the event value. + */ + public String event() { + return this.event; + } + + /** + * Set the event property: The Amazon S3 bucket event about which to send notifications. For more information, see + * [Supported Event Types](https://docs.aws.amazon.com/AmazonS3/latest/dev/NotificationHowTo.html) in the *Amazon S3 + * User Guide*. + * + * @param event the event value to set. + * @return the TopicConfiguration object itself. + */ + public TopicConfiguration withEvent(String event) { + this.event = event; + return this; + } + + /** + * Get the filter property: The filtering rules that determine for which objects to send notifications. For example, + * you can create a filter so that Amazon S3 sends notifications only when image files with a ``.jpg`` extension are + * added to the bucket. Specifies object key name filtering rules. For information about key name filtering, see + * [Configuring event notifications using object key name + * filtering](https://docs.aws.amazon.com/AmazonS3/latest/userguide/notification-how-to-filtering.html) in the + * *Amazon S3 User Guide*. + * + * @return the filter value. + */ + public NotificationFilter filter() { + return this.filter; + } + + /** + * Set the filter property: The filtering rules that determine for which objects to send notifications. For example, + * you can create a filter so that Amazon S3 sends notifications only when image files with a ``.jpg`` extension are + * added to the bucket. Specifies object key name filtering rules. For information about key name filtering, see + * [Configuring event notifications using object key name + * filtering](https://docs.aws.amazon.com/AmazonS3/latest/userguide/notification-how-to-filtering.html) in the + * *Amazon S3 User Guide*. + * + * @param filter the filter value to set. + * @return the TopicConfiguration object itself. + */ + public TopicConfiguration withFilter(NotificationFilter filter) { + this.filter = filter; + return this; + } + + /** + * Get the topic property: The Amazon Resource Name (ARN) of the Amazon SNS topic to which Amazon S3 publishes a + * message when it detects events of the specified type. + * + * @return the topic value. + */ + public String topic() { + return this.topic; + } + + /** + * Set the topic property: The Amazon Resource Name (ARN) of the Amazon SNS topic to which Amazon S3 publishes a + * message when it detects events of the specified type. + * + * @param topic the topic value to set. + * @return the TopicConfiguration object itself. + */ + public TopicConfiguration withTopic(String topic) { + this.topic = topic; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (filter() != null) { + filter().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("event", this.event); + jsonWriter.writeJsonField("filter", this.filter); + jsonWriter.writeStringField("topic", this.topic); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of TopicConfiguration from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of TopicConfiguration if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the TopicConfiguration. + */ + public static TopicConfiguration fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + TopicConfiguration deserializedTopicConfiguration = new TopicConfiguration(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("event".equals(fieldName)) { + deserializedTopicConfiguration.event = reader.getString(); + } else if ("filter".equals(fieldName)) { + deserializedTopicConfiguration.filter = NotificationFilter.fromJson(reader); + } else if ("topic".equals(fieldName)) { + deserializedTopicConfiguration.topic = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedTopicConfiguration; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/TotalLocalStorageGBRequest.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/TotalLocalStorageGBRequest.java new file mode 100644 index 000000000000..21b386dad77a --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/TotalLocalStorageGBRequest.java @@ -0,0 +1,121 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of TotalLocalStorageGBRequest. + */ +@Fluent +public final class TotalLocalStorageGBRequest implements JsonSerializable { + /* + * The storage maximum in GB. + */ + private Integer max; + + /* + * The storage minimum in GB. + */ + private Integer min; + + /** + * Creates an instance of TotalLocalStorageGBRequest class. + */ + public TotalLocalStorageGBRequest() { + } + + /** + * Get the max property: The storage maximum in GB. + * + * @return the max value. + */ + public Integer max() { + return this.max; + } + + /** + * Set the max property: The storage maximum in GB. + * + * @param max the max value to set. + * @return the TotalLocalStorageGBRequest object itself. + */ + public TotalLocalStorageGBRequest withMax(Integer max) { + this.max = max; + return this; + } + + /** + * Get the min property: The storage minimum in GB. + * + * @return the min value. + */ + public Integer min() { + return this.min; + } + + /** + * Set the min property: The storage minimum in GB. + * + * @param min the min value to set. + * @return the TotalLocalStorageGBRequest object itself. + */ + public TotalLocalStorageGBRequest withMin(Integer min) { + this.min = min; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeNumberField("max", this.max); + jsonWriter.writeNumberField("min", this.min); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of TotalLocalStorageGBRequest from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of TotalLocalStorageGBRequest if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IOException If an error occurs while reading the TotalLocalStorageGBRequest. + */ + public static TotalLocalStorageGBRequest fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + TotalLocalStorageGBRequest deserializedTotalLocalStorageGBRequest = new TotalLocalStorageGBRequest(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("max".equals(fieldName)) { + deserializedTotalLocalStorageGBRequest.max = reader.getNullable(JsonReader::getInt); + } else if ("min".equals(fieldName)) { + deserializedTotalLocalStorageGBRequest.min = reader.getNullable(JsonReader::getInt); + } else { + reader.skipChildren(); + } + } + + return deserializedTotalLocalStorageGBRequest; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/TpmSupportValues.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/TpmSupportValues.java new file mode 100644 index 000000000000..55a4b904c4e2 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/TpmSupportValues.java @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * TpmSupportValues enum. + */ +public final class TpmSupportValues extends ExpandableStringEnum { + /** + * Static value v2.0 for TpmSupportValues. + */ + public static final TpmSupportValues V2_0 = fromString("v2.0"); + + /** + * Creates a new instance of TpmSupportValues value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public TpmSupportValues() { + } + + /** + * Creates or finds a TpmSupportValues from its string representation. + * + * @param name a name to look for. + * @return the corresponding TpmSupportValues. + */ + public static TpmSupportValues fromString(String name) { + return fromString(name, TpmSupportValues.class); + } + + /** + * Gets known TpmSupportValues values. + * + * @return known TpmSupportValues values. + */ + public static Collection values() { + return values(TpmSupportValues.class); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/TpmSupportValuesEnumValue.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/TpmSupportValuesEnumValue.java new file mode 100644 index 000000000000..c451ece538d0 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/TpmSupportValuesEnumValue.java @@ -0,0 +1,93 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of TpmSupportValuesEnumValue. + */ +@Fluent +public final class TpmSupportValuesEnumValue implements JsonSerializable { + /* + * Property value + */ + private TpmSupportValues value; + + /** + * Creates an instance of TpmSupportValuesEnumValue class. + */ + public TpmSupportValuesEnumValue() { + } + + /** + * Get the value property: Property value. + * + * @return the value value. + */ + public TpmSupportValues value() { + return this.value; + } + + /** + * Set the value property: Property value. + * + * @param value the value value to set. + * @return the TpmSupportValuesEnumValue object itself. + */ + public TpmSupportValuesEnumValue withValue(TpmSupportValues value) { + this.value = value; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("value", this.value == null ? null : this.value.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of TpmSupportValuesEnumValue from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of TpmSupportValuesEnumValue if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IOException If an error occurs while reading the TpmSupportValuesEnumValue. + */ + public static TpmSupportValuesEnumValue fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + TpmSupportValuesEnumValue deserializedTpmSupportValuesEnumValue = new TpmSupportValuesEnumValue(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + deserializedTpmSupportValuesEnumValue.value = TpmSupportValues.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedTpmSupportValuesEnumValue; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/TracingConfig.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/TracingConfig.java new file mode 100644 index 000000000000..a66cb45d2d1e --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/TracingConfig.java @@ -0,0 +1,93 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of TracingConfig. + */ +@Fluent +public final class TracingConfig implements JsonSerializable { + /* + * The tracing mode. + */ + private TracingConfigMode mode; + + /** + * Creates an instance of TracingConfig class. + */ + public TracingConfig() { + } + + /** + * Get the mode property: The tracing mode. + * + * @return the mode value. + */ + public TracingConfigMode mode() { + return this.mode; + } + + /** + * Set the mode property: The tracing mode. + * + * @param mode the mode value to set. + * @return the TracingConfig object itself. + */ + public TracingConfig withMode(TracingConfigMode mode) { + this.mode = mode; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("mode", this.mode == null ? null : this.mode.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of TracingConfig from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of TracingConfig if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the TracingConfig. + */ + public static TracingConfig fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + TracingConfig deserializedTracingConfig = new TracingConfig(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("mode".equals(fieldName)) { + deserializedTracingConfig.mode = TracingConfigMode.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedTracingConfig; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/TracingConfigMode.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/TracingConfigMode.java new file mode 100644 index 000000000000..77ccb3918702 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/TracingConfigMode.java @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * TracingConfigMode enum. + */ +public final class TracingConfigMode extends ExpandableStringEnum { + /** + * Static value Active for TracingConfigMode. + */ + public static final TracingConfigMode ACTIVE = fromString("Active"); + + /** + * Static value PassThrough for TracingConfigMode. + */ + public static final TracingConfigMode PASS_THROUGH = fromString("PassThrough"); + + /** + * Creates a new instance of TracingConfigMode value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public TracingConfigMode() { + } + + /** + * Creates or finds a TracingConfigMode from its string representation. + * + * @param name a name to look for. + * @return the corresponding TracingConfigMode. + */ + public static TracingConfigMode fromString(String name) { + return fromString(name, TracingConfigMode.class); + } + + /** + * Gets known TracingConfigMode values. + * + * @return known TracingConfigMode values. + */ + public static Collection values() { + return values(TracingConfigMode.class); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/TrafficType.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/TrafficType.java new file mode 100644 index 000000000000..d98abcdf74e6 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/TrafficType.java @@ -0,0 +1,56 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * TrafficType enum. + */ +public final class TrafficType extends ExpandableStringEnum { + /** + * Static value ACCEPT for TrafficType. + */ + public static final TrafficType ACCEPT = fromString("ACCEPT"); + + /** + * Static value ALL for TrafficType. + */ + public static final TrafficType ALL = fromString("ALL"); + + /** + * Static value REJECT for TrafficType. + */ + public static final TrafficType REJECT = fromString("REJECT"); + + /** + * Creates a new instance of TrafficType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public TrafficType() { + } + + /** + * Creates or finds a TrafficType from its string representation. + * + * @param name a name to look for. + * @return the corresponding TrafficType. + */ + public static TrafficType fromString(String name) { + return fromString(name, TrafficType.class); + } + + /** + * Gets known TrafficType values. + * + * @return known TrafficType values. + */ + public static Collection values() { + return values(TrafficType.class); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/Transition.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/Transition.java new file mode 100644 index 000000000000..daf54a66915a --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/Transition.java @@ -0,0 +1,158 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of Transition. + */ +@Fluent +public final class Transition implements JsonSerializable { + /* + * The storage class to which you want the object to transition. + */ + private TransitionStorageClass storageClass; + + /* + * Indicates when objects are transitioned to the specified storage class. The date value must be in ISO 8601 + * format. The time is always midnight UTC. The date value in ISO 8601 format. The timezone is always UTC. + * (YYYY-MM-DDThh:mm:ssZ) + */ + private String transitionDate; + + /* + * Indicates the number of days after creation when objects are transitioned to the specified storage class. The + * value must be a positive integer. + */ + private Integer transitionInDays; + + /** + * Creates an instance of Transition class. + */ + public Transition() { + } + + /** + * Get the storageClass property: The storage class to which you want the object to transition. + * + * @return the storageClass value. + */ + public TransitionStorageClass storageClass() { + return this.storageClass; + } + + /** + * Set the storageClass property: The storage class to which you want the object to transition. + * + * @param storageClass the storageClass value to set. + * @return the Transition object itself. + */ + public Transition withStorageClass(TransitionStorageClass storageClass) { + this.storageClass = storageClass; + return this; + } + + /** + * Get the transitionDate property: Indicates when objects are transitioned to the specified storage class. The date + * value must be in ISO 8601 format. The time is always midnight UTC. The date value in ISO 8601 format. The + * timezone is always UTC. (YYYY-MM-DDThh:mm:ssZ). + * + * @return the transitionDate value. + */ + public String transitionDate() { + return this.transitionDate; + } + + /** + * Set the transitionDate property: Indicates when objects are transitioned to the specified storage class. The date + * value must be in ISO 8601 format. The time is always midnight UTC. The date value in ISO 8601 format. The + * timezone is always UTC. (YYYY-MM-DDThh:mm:ssZ). + * + * @param transitionDate the transitionDate value to set. + * @return the Transition object itself. + */ + public Transition withTransitionDate(String transitionDate) { + this.transitionDate = transitionDate; + return this; + } + + /** + * Get the transitionInDays property: Indicates the number of days after creation when objects are transitioned to + * the specified storage class. The value must be a positive integer. + * + * @return the transitionInDays value. + */ + public Integer transitionInDays() { + return this.transitionInDays; + } + + /** + * Set the transitionInDays property: Indicates the number of days after creation when objects are transitioned to + * the specified storage class. The value must be a positive integer. + * + * @param transitionInDays the transitionInDays value to set. + * @return the Transition object itself. + */ + public Transition withTransitionInDays(Integer transitionInDays) { + this.transitionInDays = transitionInDays; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("storageClass", this.storageClass == null ? null : this.storageClass.toString()); + jsonWriter.writeStringField("transitionDate", this.transitionDate); + jsonWriter.writeNumberField("transitionInDays", this.transitionInDays); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of Transition from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of Transition if the JsonReader was pointing to an instance of it, or null if it was pointing + * to JSON null. + * @throws IOException If an error occurs while reading the Transition. + */ + public static Transition fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + Transition deserializedTransition = new Transition(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("storageClass".equals(fieldName)) { + deserializedTransition.storageClass = TransitionStorageClass.fromString(reader.getString()); + } else if ("transitionDate".equals(fieldName)) { + deserializedTransition.transitionDate = reader.getString(); + } else if ("transitionInDays".equals(fieldName)) { + deserializedTransition.transitionInDays = reader.getNullable(JsonReader::getInt); + } else { + reader.skipChildren(); + } + } + + return deserializedTransition; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/TransitionStorageClass.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/TransitionStorageClass.java new file mode 100644 index 000000000000..60713d56f076 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/TransitionStorageClass.java @@ -0,0 +1,71 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * TransitionStorageClass enum. + */ +public final class TransitionStorageClass extends ExpandableStringEnum { + /** + * Static value DEEP_ARCHIVE for TransitionStorageClass. + */ + public static final TransitionStorageClass DEEP_ARCHIVE = fromString("DEEP_ARCHIVE"); + + /** + * Static value GLACIER for TransitionStorageClass. + */ + public static final TransitionStorageClass GLACIER = fromString("GLACIER"); + + /** + * Static value GLACIER_IR for TransitionStorageClass. + */ + public static final TransitionStorageClass GLACIER_IR = fromString("GLACIER_IR"); + + /** + * Static value INTELLIGENT_TIERING for TransitionStorageClass. + */ + public static final TransitionStorageClass INTELLIGENT_TIERING = fromString("INTELLIGENT_TIERING"); + + /** + * Static value ONEZONE_IA for TransitionStorageClass. + */ + public static final TransitionStorageClass ONEZONE_IA = fromString("ONEZONE_IA"); + + /** + * Static value STANDARD_IA for TransitionStorageClass. + */ + public static final TransitionStorageClass STANDARD_IA = fromString("STANDARD_IA"); + + /** + * Creates a new instance of TransitionStorageClass value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public TransitionStorageClass() { + } + + /** + * Creates or finds a TransitionStorageClass from its string representation. + * + * @param name a name to look for. + * @return the corresponding TransitionStorageClass. + */ + public static TransitionStorageClass fromString(String name) { + return fromString(name, TransitionStorageClass.class); + } + + /** + * Gets known TransitionStorageClass values. + * + * @return known TransitionStorageClass values. + */ + public static Collection values() { + return values(TransitionStorageClass.class); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/Type.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/Type.java new file mode 100644 index 000000000000..b6465f51ff92 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/Type.java @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Type enum. + */ +public final class Type extends ExpandableStringEnum { + /** + * Static value STATEFUL for Type. + */ + public static final Type STATEFUL = fromString("STATEFUL"); + + /** + * Static value STATELESS for Type. + */ + public static final Type STATELESS = fromString("STATELESS"); + + /** + * Creates a new instance of Type value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public Type() { + } + + /** + * Creates or finds a Type from its string representation. + * + * @param name a name to look for. + * @return the corresponding Type. + */ + public static Type fromString(String name) { + return fromString(name, Type.class); + } + + /** + * Gets known Type values. + * + * @return known Type values. + */ + public static Collection values() { + return values(Type.class); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/Ulimit.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/Ulimit.java new file mode 100644 index 000000000000..ede1b4051ff4 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/Ulimit.java @@ -0,0 +1,149 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of Ulimit. + */ +@Fluent +public final class Ulimit implements JsonSerializable { + /* + * The hard limit for the ``ulimit`` type. + */ + private Integer hardLimit; + + /* + * The ``type`` of the ``ulimit``. + */ + private String name; + + /* + * The soft limit for the ``ulimit`` type. + */ + private Integer softLimit; + + /** + * Creates an instance of Ulimit class. + */ + public Ulimit() { + } + + /** + * Get the hardLimit property: The hard limit for the ``ulimit`` type. + * + * @return the hardLimit value. + */ + public Integer hardLimit() { + return this.hardLimit; + } + + /** + * Set the hardLimit property: The hard limit for the ``ulimit`` type. + * + * @param hardLimit the hardLimit value to set. + * @return the Ulimit object itself. + */ + public Ulimit withHardLimit(Integer hardLimit) { + this.hardLimit = hardLimit; + return this; + } + + /** + * Get the name property: The ``type`` of the ``ulimit``. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: The ``type`` of the ``ulimit``. + * + * @param name the name value to set. + * @return the Ulimit object itself. + */ + public Ulimit withName(String name) { + this.name = name; + return this; + } + + /** + * Get the softLimit property: The soft limit for the ``ulimit`` type. + * + * @return the softLimit value. + */ + public Integer softLimit() { + return this.softLimit; + } + + /** + * Set the softLimit property: The soft limit for the ``ulimit`` type. + * + * @param softLimit the softLimit value to set. + * @return the Ulimit object itself. + */ + public Ulimit withSoftLimit(Integer softLimit) { + this.softLimit = softLimit; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeNumberField("hardLimit", this.hardLimit); + jsonWriter.writeStringField("name", this.name); + jsonWriter.writeNumberField("softLimit", this.softLimit); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of Ulimit from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of Ulimit if the JsonReader was pointing to an instance of it, or null if it was pointing to + * JSON null. + * @throws IOException If an error occurs while reading the Ulimit. + */ + public static Ulimit fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + Ulimit deserializedUlimit = new Ulimit(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("hardLimit".equals(fieldName)) { + deserializedUlimit.hardLimit = reader.getNullable(JsonReader::getInt); + } else if ("name".equals(fieldName)) { + deserializedUlimit.name = reader.getString(); + } else if ("softLimit".equals(fieldName)) { + deserializedUlimit.softLimit = reader.getNullable(JsonReader::getInt); + } else { + reader.skipChildren(); + } + } + + return deserializedUlimit; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/UnusedAccessConfiguration.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/UnusedAccessConfiguration.java new file mode 100644 index 000000000000..7ed98ce0b2f5 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/UnusedAccessConfiguration.java @@ -0,0 +1,102 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of UnusedAccessConfiguration. + */ +@Fluent +public final class UnusedAccessConfiguration implements JsonSerializable { + /* + * The specified access age in days for which to generate findings for unused access. For example, if you specify 90 + * days, the analyzer will generate findings for IAM entities within the accounts of the selected organization for + * any access that hasn't been used in 90 or more days since the analyzer's last scan. You can choose a value + * between 1 and 180 days. + */ + private Integer unusedAccessAge; + + /** + * Creates an instance of UnusedAccessConfiguration class. + */ + public UnusedAccessConfiguration() { + } + + /** + * Get the unusedAccessAge property: The specified access age in days for which to generate findings for unused + * access. For example, if you specify 90 days, the analyzer will generate findings for IAM entities within the + * accounts of the selected organization for any access that hasn't been used in 90 or more days since the + * analyzer's last scan. You can choose a value between 1 and 180 days. + * + * @return the unusedAccessAge value. + */ + public Integer unusedAccessAge() { + return this.unusedAccessAge; + } + + /** + * Set the unusedAccessAge property: The specified access age in days for which to generate findings for unused + * access. For example, if you specify 90 days, the analyzer will generate findings for IAM entities within the + * accounts of the selected organization for any access that hasn't been used in 90 or more days since the + * analyzer's last scan. You can choose a value between 1 and 180 days. + * + * @param unusedAccessAge the unusedAccessAge value to set. + * @return the UnusedAccessConfiguration object itself. + */ + public UnusedAccessConfiguration withUnusedAccessAge(Integer unusedAccessAge) { + this.unusedAccessAge = unusedAccessAge; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeNumberField("unusedAccessAge", this.unusedAccessAge); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of UnusedAccessConfiguration from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of UnusedAccessConfiguration if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IOException If an error occurs while reading the UnusedAccessConfiguration. + */ + public static UnusedAccessConfiguration fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + UnusedAccessConfiguration deserializedUnusedAccessConfiguration = new UnusedAccessConfiguration(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("unusedAccessAge".equals(fieldName)) { + deserializedUnusedAccessConfiguration.unusedAccessAge = reader.getNullable(JsonReader::getInt); + } else { + reader.skipChildren(); + } + } + + return deserializedUnusedAccessConfiguration; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/UpdateConfig.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/UpdateConfig.java new file mode 100644 index 000000000000..64888ee96277 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/UpdateConfig.java @@ -0,0 +1,131 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of UpdateConfig. + */ +@Fluent +public final class UpdateConfig implements JsonSerializable { + /* + * The maximum number of nodes unavailable at once during a version update. Nodes will be updated in parallel. This + * value or maxUnavailablePercentage is required to have a value.The maximum number is 100. + */ + private Integer maxUnavailable; + + /* + * The maximum percentage of nodes unavailable during a version update. This percentage of nodes will be updated in + * parallel, up to 100 nodes at once. This value or maxUnavailable is required to have a value. + */ + private Integer maxUnavailablePercentage; + + /** + * Creates an instance of UpdateConfig class. + */ + public UpdateConfig() { + } + + /** + * Get the maxUnavailable property: The maximum number of nodes unavailable at once during a version update. Nodes + * will be updated in parallel. This value or maxUnavailablePercentage is required to have a value.The maximum + * number is 100. + * + * @return the maxUnavailable value. + */ + public Integer maxUnavailable() { + return this.maxUnavailable; + } + + /** + * Set the maxUnavailable property: The maximum number of nodes unavailable at once during a version update. Nodes + * will be updated in parallel. This value or maxUnavailablePercentage is required to have a value.The maximum + * number is 100. + * + * @param maxUnavailable the maxUnavailable value to set. + * @return the UpdateConfig object itself. + */ + public UpdateConfig withMaxUnavailable(Integer maxUnavailable) { + this.maxUnavailable = maxUnavailable; + return this; + } + + /** + * Get the maxUnavailablePercentage property: The maximum percentage of nodes unavailable during a version update. + * This percentage of nodes will be updated in parallel, up to 100 nodes at once. This value or maxUnavailable is + * required to have a value. + * + * @return the maxUnavailablePercentage value. + */ + public Integer maxUnavailablePercentage() { + return this.maxUnavailablePercentage; + } + + /** + * Set the maxUnavailablePercentage property: The maximum percentage of nodes unavailable during a version update. + * This percentage of nodes will be updated in parallel, up to 100 nodes at once. This value or maxUnavailable is + * required to have a value. + * + * @param maxUnavailablePercentage the maxUnavailablePercentage value to set. + * @return the UpdateConfig object itself. + */ + public UpdateConfig withMaxUnavailablePercentage(Integer maxUnavailablePercentage) { + this.maxUnavailablePercentage = maxUnavailablePercentage; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeNumberField("maxUnavailable", this.maxUnavailable); + jsonWriter.writeNumberField("maxUnavailablePercentage", this.maxUnavailablePercentage); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of UpdateConfig from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of UpdateConfig if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the UpdateConfig. + */ + public static UpdateConfig fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + UpdateConfig deserializedUpdateConfig = new UpdateConfig(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("maxUnavailable".equals(fieldName)) { + deserializedUpdateConfig.maxUnavailable = reader.getNullable(JsonReader::getInt); + } else if ("maxUnavailablePercentage".equals(fieldName)) { + deserializedUpdateConfig.maxUnavailablePercentage = reader.getNullable(JsonReader::getInt); + } else { + reader.skipChildren(); + } + } + + return deserializedUpdateConfig; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/UserIdGroupPair.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/UserIdGroupPair.java new file mode 100644 index 000000000000..b71049df1219 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/UserIdGroupPair.java @@ -0,0 +1,278 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of UserIdGroupPair. + */ +@Fluent +public final class UserIdGroupPair implements JsonSerializable { + /* + *

A description for the security group rule that references this user ID group pair.

Constraints: Up to + * 255 characters in length. Allowed characters are a-z, A-Z, 0-9, spaces, and ._-:/()#,@[]+=;{}!$*

+ */ + private String description; + + /* + *

The ID of the security group.

+ */ + private String groupId; + + /* + *

[Default VPC] The name of the security group. For a security group in a nondefault VPC, use the security group + * ID.

For a referenced security group in another VPC, this value is not returned if the referenced security + * group is deleted.

+ */ + private String groupName; + + /* + *

The status of a VPC peering connection, if applicable.

+ */ + private String peeringStatus; + + /* + *

The ID of an Amazon Web Services account.

For a referenced security group in another VPC, the account + * ID of the referenced security group is returned in the response. If the referenced security group is deleted, + * this value is not returned.

+ */ + private String userId; + + /* + *

The ID of the VPC for the referenced security group, if applicable.

+ */ + private String vpcId; + + /* + *

The ID of the VPC peering connection, if applicable.

+ */ + private String vpcPeeringConnectionId; + + /** + * Creates an instance of UserIdGroupPair class. + */ + public UserIdGroupPair() { + } + + /** + * Get the description property: <p>A description for the security group rule that references this user ID + * group pair.</p> <p>Constraints: Up to 255 characters in length. Allowed characters are a-z, A-Z, 0-9, + * spaces, and ._-:/()#,@[]+=;{}!$*</p>. + * + * @return the description value. + */ + public String description() { + return this.description; + } + + /** + * Set the description property: <p>A description for the security group rule that references this user ID + * group pair.</p> <p>Constraints: Up to 255 characters in length. Allowed characters are a-z, A-Z, 0-9, + * spaces, and ._-:/()#,@[]+=;{}!$*</p>. + * + * @param description the description value to set. + * @return the UserIdGroupPair object itself. + */ + public UserIdGroupPair withDescription(String description) { + this.description = description; + return this; + } + + /** + * Get the groupId property: <p>The ID of the security group.</p>. + * + * @return the groupId value. + */ + public String groupId() { + return this.groupId; + } + + /** + * Set the groupId property: <p>The ID of the security group.</p>. + * + * @param groupId the groupId value to set. + * @return the UserIdGroupPair object itself. + */ + public UserIdGroupPair withGroupId(String groupId) { + this.groupId = groupId; + return this; + } + + /** + * Get the groupName property: <p>[Default VPC] The name of the security group. For a security group in a + * nondefault VPC, use the security group ID. </p> <p>For a referenced security group in another VPC, + * this value is not returned if the referenced security group is deleted.</p>. + * + * @return the groupName value. + */ + public String groupName() { + return this.groupName; + } + + /** + * Set the groupName property: <p>[Default VPC] The name of the security group. For a security group in a + * nondefault VPC, use the security group ID. </p> <p>For a referenced security group in another VPC, + * this value is not returned if the referenced security group is deleted.</p>. + * + * @param groupName the groupName value to set. + * @return the UserIdGroupPair object itself. + */ + public UserIdGroupPair withGroupName(String groupName) { + this.groupName = groupName; + return this; + } + + /** + * Get the peeringStatus property: <p>The status of a VPC peering connection, if applicable.</p>. + * + * @return the peeringStatus value. + */ + public String peeringStatus() { + return this.peeringStatus; + } + + /** + * Set the peeringStatus property: <p>The status of a VPC peering connection, if applicable.</p>. + * + * @param peeringStatus the peeringStatus value to set. + * @return the UserIdGroupPair object itself. + */ + public UserIdGroupPair withPeeringStatus(String peeringStatus) { + this.peeringStatus = peeringStatus; + return this; + } + + /** + * Get the userId property: <p>The ID of an Amazon Web Services account.</p> <p>For a referenced + * security group in another VPC, the account ID of the referenced security group is returned in the response. If + * the referenced security group is deleted, this value is not returned.</p>. + * + * @return the userId value. + */ + public String userId() { + return this.userId; + } + + /** + * Set the userId property: <p>The ID of an Amazon Web Services account.</p> <p>For a referenced + * security group in another VPC, the account ID of the referenced security group is returned in the response. If + * the referenced security group is deleted, this value is not returned.</p>. + * + * @param userId the userId value to set. + * @return the UserIdGroupPair object itself. + */ + public UserIdGroupPair withUserId(String userId) { + this.userId = userId; + return this; + } + + /** + * Get the vpcId property: <p>The ID of the VPC for the referenced security group, if applicable.</p>. + * + * @return the vpcId value. + */ + public String vpcId() { + return this.vpcId; + } + + /** + * Set the vpcId property: <p>The ID of the VPC for the referenced security group, if applicable.</p>. + * + * @param vpcId the vpcId value to set. + * @return the UserIdGroupPair object itself. + */ + public UserIdGroupPair withVpcId(String vpcId) { + this.vpcId = vpcId; + return this; + } + + /** + * Get the vpcPeeringConnectionId property: <p>The ID of the VPC peering connection, if applicable.</p>. + * + * @return the vpcPeeringConnectionId value. + */ + public String vpcPeeringConnectionId() { + return this.vpcPeeringConnectionId; + } + + /** + * Set the vpcPeeringConnectionId property: <p>The ID of the VPC peering connection, if applicable.</p>. + * + * @param vpcPeeringConnectionId the vpcPeeringConnectionId value to set. + * @return the UserIdGroupPair object itself. + */ + public UserIdGroupPair withVpcPeeringConnectionId(String vpcPeeringConnectionId) { + this.vpcPeeringConnectionId = vpcPeeringConnectionId; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("description", this.description); + jsonWriter.writeStringField("groupId", this.groupId); + jsonWriter.writeStringField("groupName", this.groupName); + jsonWriter.writeStringField("peeringStatus", this.peeringStatus); + jsonWriter.writeStringField("userId", this.userId); + jsonWriter.writeStringField("vpcId", this.vpcId); + jsonWriter.writeStringField("vpcPeeringConnectionId", this.vpcPeeringConnectionId); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of UserIdGroupPair from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of UserIdGroupPair if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the UserIdGroupPair. + */ + public static UserIdGroupPair fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + UserIdGroupPair deserializedUserIdGroupPair = new UserIdGroupPair(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("description".equals(fieldName)) { + deserializedUserIdGroupPair.description = reader.getString(); + } else if ("groupId".equals(fieldName)) { + deserializedUserIdGroupPair.groupId = reader.getString(); + } else if ("groupName".equals(fieldName)) { + deserializedUserIdGroupPair.groupName = reader.getString(); + } else if ("peeringStatus".equals(fieldName)) { + deserializedUserIdGroupPair.peeringStatus = reader.getString(); + } else if ("userId".equals(fieldName)) { + deserializedUserIdGroupPair.userId = reader.getString(); + } else if ("vpcId".equals(fieldName)) { + deserializedUserIdGroupPair.vpcId = reader.getString(); + } else if ("vpcPeeringConnectionId".equals(fieldName)) { + deserializedUserIdGroupPair.vpcPeeringConnectionId = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedUserIdGroupPair; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/UserPausedDetails.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/UserPausedDetails.java new file mode 100644 index 000000000000..ae66306afd75 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/UserPausedDetails.java @@ -0,0 +1,166 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.time.OffsetDateTime; +import java.time.format.DateTimeFormatter; + +/** + * Definition of UserPausedDetails. + */ +@Fluent +public final class UserPausedDetails implements JsonSerializable { + /* + *

The date and time, in UTC and extended ISO 8601 format, when the job or job run will expire and be cancelled + * if you don't resume it first.

+ */ + private OffsetDateTime jobExpiresAt; + + /* + *

The Amazon Resource Name (ARN) of the Health event that Amazon Macie sent to notify you of the job or job + * run's pending expiration and cancellation. This value is null if a job has been paused for less than 23 days.

+ */ + private String jobImminentExpirationHealthEventArn; + + /* + *

The date and time, in UTC and extended ISO 8601 format, when you paused the job.

+ */ + private OffsetDateTime jobPausedAt; + + /** + * Creates an instance of UserPausedDetails class. + */ + public UserPausedDetails() { + } + + /** + * Get the jobExpiresAt property: <p>The date and time, in UTC and extended ISO 8601 format, when the job or + * job run will expire and be cancelled if you don't resume it first.</p>. + * + * @return the jobExpiresAt value. + */ + public OffsetDateTime jobExpiresAt() { + return this.jobExpiresAt; + } + + /** + * Set the jobExpiresAt property: <p>The date and time, in UTC and extended ISO 8601 format, when the job or + * job run will expire and be cancelled if you don't resume it first.</p>. + * + * @param jobExpiresAt the jobExpiresAt value to set. + * @return the UserPausedDetails object itself. + */ + public UserPausedDetails withJobExpiresAt(OffsetDateTime jobExpiresAt) { + this.jobExpiresAt = jobExpiresAt; + return this; + } + + /** + * Get the jobImminentExpirationHealthEventArn property: <p>The Amazon Resource Name (ARN) of the Health event + * that Amazon Macie sent to notify you of the job or job run's pending expiration and cancellation. This value is + * null if a job has been paused for less than 23 days.</p>. + * + * @return the jobImminentExpirationHealthEventArn value. + */ + public String jobImminentExpirationHealthEventArn() { + return this.jobImminentExpirationHealthEventArn; + } + + /** + * Set the jobImminentExpirationHealthEventArn property: <p>The Amazon Resource Name (ARN) of the Health event + * that Amazon Macie sent to notify you of the job or job run's pending expiration and cancellation. This value is + * null if a job has been paused for less than 23 days.</p>. + * + * @param jobImminentExpirationHealthEventArn the jobImminentExpirationHealthEventArn value to set. + * @return the UserPausedDetails object itself. + */ + public UserPausedDetails withJobImminentExpirationHealthEventArn(String jobImminentExpirationHealthEventArn) { + this.jobImminentExpirationHealthEventArn = jobImminentExpirationHealthEventArn; + return this; + } + + /** + * Get the jobPausedAt property: <p>The date and time, in UTC and extended ISO 8601 format, when you paused + * the job.</p>. + * + * @return the jobPausedAt value. + */ + public OffsetDateTime jobPausedAt() { + return this.jobPausedAt; + } + + /** + * Set the jobPausedAt property: <p>The date and time, in UTC and extended ISO 8601 format, when you paused + * the job.</p>. + * + * @param jobPausedAt the jobPausedAt value to set. + * @return the UserPausedDetails object itself. + */ + public UserPausedDetails withJobPausedAt(OffsetDateTime jobPausedAt) { + this.jobPausedAt = jobPausedAt; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("jobExpiresAt", + this.jobExpiresAt == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.jobExpiresAt)); + jsonWriter.writeStringField("jobImminentExpirationHealthEventArn", this.jobImminentExpirationHealthEventArn); + jsonWriter.writeStringField("jobPausedAt", + this.jobPausedAt == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.jobPausedAt)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of UserPausedDetails from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of UserPausedDetails if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the UserPausedDetails. + */ + public static UserPausedDetails fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + UserPausedDetails deserializedUserPausedDetails = new UserPausedDetails(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("jobExpiresAt".equals(fieldName)) { + deserializedUserPausedDetails.jobExpiresAt = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("jobImminentExpirationHealthEventArn".equals(fieldName)) { + deserializedUserPausedDetails.jobImminentExpirationHealthEventArn = reader.getString(); + } else if ("jobPausedAt".equals(fieldName)) { + deserializedUserPausedDetails.jobPausedAt = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else { + reader.skipChildren(); + } + } + + return deserializedUserPausedDetails; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/UserPoolConfig.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/UserPoolConfig.java new file mode 100644 index 000000000000..92f0bb0050fc --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/UserPoolConfig.java @@ -0,0 +1,188 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of UserPoolConfig. + */ +@Fluent +public final class UserPoolConfig implements JsonSerializable { + /* + *

A regular expression for validating the incoming Amazon Cognito user pool app client ID. If this value isn't + * set, no filtering is applied.

+ */ + private String appIdClientRegex; + + /* + *

The Amazon Web Services Region in which the user pool was created.

+ */ + private String awsRegion; + + /* + *

The action that you want your GraphQL API to take when a request that uses Amazon Cognito user pool + * authentication doesn't match the Amazon Cognito user pool configuration.

+ */ + private DefaultActionEnumValue defaultAction; + + /* + *

The user pool ID.

+ */ + private String userPoolId; + + /** + * Creates an instance of UserPoolConfig class. + */ + public UserPoolConfig() { + } + + /** + * Get the appIdClientRegex property: <p>A regular expression for validating the incoming Amazon Cognito user + * pool app client ID. If this value isn't set, no filtering is applied.</p>. + * + * @return the appIdClientRegex value. + */ + public String appIdClientRegex() { + return this.appIdClientRegex; + } + + /** + * Set the appIdClientRegex property: <p>A regular expression for validating the incoming Amazon Cognito user + * pool app client ID. If this value isn't set, no filtering is applied.</p>. + * + * @param appIdClientRegex the appIdClientRegex value to set. + * @return the UserPoolConfig object itself. + */ + public UserPoolConfig withAppIdClientRegex(String appIdClientRegex) { + this.appIdClientRegex = appIdClientRegex; + return this; + } + + /** + * Get the awsRegion property: <p>The Amazon Web Services Region in which the user pool was + * created.</p>. + * + * @return the awsRegion value. + */ + public String awsRegion() { + return this.awsRegion; + } + + /** + * Set the awsRegion property: <p>The Amazon Web Services Region in which the user pool was + * created.</p>. + * + * @param awsRegion the awsRegion value to set. + * @return the UserPoolConfig object itself. + */ + public UserPoolConfig withAwsRegion(String awsRegion) { + this.awsRegion = awsRegion; + return this; + } + + /** + * Get the defaultAction property: <p>The action that you want your GraphQL API to take when a request that + * uses Amazon Cognito user pool authentication doesn't match the Amazon Cognito user pool configuration.</p>. + * + * @return the defaultAction value. + */ + public DefaultActionEnumValue defaultAction() { + return this.defaultAction; + } + + /** + * Set the defaultAction property: <p>The action that you want your GraphQL API to take when a request that + * uses Amazon Cognito user pool authentication doesn't match the Amazon Cognito user pool configuration.</p>. + * + * @param defaultAction the defaultAction value to set. + * @return the UserPoolConfig object itself. + */ + public UserPoolConfig withDefaultAction(DefaultActionEnumValue defaultAction) { + this.defaultAction = defaultAction; + return this; + } + + /** + * Get the userPoolId property: <p>The user pool ID.</p>. + * + * @return the userPoolId value. + */ + public String userPoolId() { + return this.userPoolId; + } + + /** + * Set the userPoolId property: <p>The user pool ID.</p>. + * + * @param userPoolId the userPoolId value to set. + * @return the UserPoolConfig object itself. + */ + public UserPoolConfig withUserPoolId(String userPoolId) { + this.userPoolId = userPoolId; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (defaultAction() != null) { + defaultAction().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("appIdClientRegex", this.appIdClientRegex); + jsonWriter.writeStringField("awsRegion", this.awsRegion); + jsonWriter.writeJsonField("defaultAction", this.defaultAction); + jsonWriter.writeStringField("userPoolId", this.userPoolId); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of UserPoolConfig from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of UserPoolConfig if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the UserPoolConfig. + */ + public static UserPoolConfig fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + UserPoolConfig deserializedUserPoolConfig = new UserPoolConfig(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("appIdClientRegex".equals(fieldName)) { + deserializedUserPoolConfig.appIdClientRegex = reader.getString(); + } else if ("awsRegion".equals(fieldName)) { + deserializedUserPoolConfig.awsRegion = reader.getString(); + } else if ("defaultAction".equals(fieldName)) { + deserializedUserPoolConfig.defaultAction = DefaultActionEnumValue.fromJson(reader); + } else if ("userPoolId".equals(fieldName)) { + deserializedUserPoolConfig.userPoolId = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedUserPoolConfig; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/VCpuCountRequest.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/VCpuCountRequest.java new file mode 100644 index 000000000000..1167a6fa55e4 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/VCpuCountRequest.java @@ -0,0 +1,121 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of VCpuCountRequest. + */ +@Fluent +public final class VCpuCountRequest implements JsonSerializable { + /* + * The maximum number of vCPUs. + */ + private Integer max; + + /* + * The minimum number of vCPUs. + */ + private Integer min; + + /** + * Creates an instance of VCpuCountRequest class. + */ + public VCpuCountRequest() { + } + + /** + * Get the max property: The maximum number of vCPUs. + * + * @return the max value. + */ + public Integer max() { + return this.max; + } + + /** + * Set the max property: The maximum number of vCPUs. + * + * @param max the max value to set. + * @return the VCpuCountRequest object itself. + */ + public VCpuCountRequest withMax(Integer max) { + this.max = max; + return this; + } + + /** + * Get the min property: The minimum number of vCPUs. + * + * @return the min value. + */ + public Integer min() { + return this.min; + } + + /** + * Set the min property: The minimum number of vCPUs. + * + * @param min the min value to set. + * @return the VCpuCountRequest object itself. + */ + public VCpuCountRequest withMin(Integer min) { + this.min = min; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeNumberField("max", this.max); + jsonWriter.writeNumberField("min", this.min); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of VCpuCountRequest from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of VCpuCountRequest if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the VCpuCountRequest. + */ + public static VCpuCountRequest fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + VCpuCountRequest deserializedVCpuCountRequest = new VCpuCountRequest(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("max".equals(fieldName)) { + deserializedVCpuCountRequest.max = reader.getNullable(JsonReader::getInt); + } else if ("min".equals(fieldName)) { + deserializedVCpuCountRequest.min = reader.getNullable(JsonReader::getInt); + } else { + reader.skipChildren(); + } + } + + return deserializedVCpuCountRequest; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/VersioningConfiguration.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/VersioningConfiguration.java new file mode 100644 index 000000000000..daeadf7084d1 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/VersioningConfiguration.java @@ -0,0 +1,94 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of VersioningConfiguration. + */ +@Fluent +public final class VersioningConfiguration implements JsonSerializable { + /* + * The versioning state of the bucket. + */ + private VersioningConfigurationStatus status; + + /** + * Creates an instance of VersioningConfiguration class. + */ + public VersioningConfiguration() { + } + + /** + * Get the status property: The versioning state of the bucket. + * + * @return the status value. + */ + public VersioningConfigurationStatus status() { + return this.status; + } + + /** + * Set the status property: The versioning state of the bucket. + * + * @param status the status value to set. + * @return the VersioningConfiguration object itself. + */ + public VersioningConfiguration withStatus(VersioningConfigurationStatus status) { + this.status = status; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("status", this.status == null ? null : this.status.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of VersioningConfiguration from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of VersioningConfiguration if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the VersioningConfiguration. + */ + public static VersioningConfiguration fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + VersioningConfiguration deserializedVersioningConfiguration = new VersioningConfiguration(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("status".equals(fieldName)) { + deserializedVersioningConfiguration.status + = VersioningConfigurationStatus.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedVersioningConfiguration; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/VersioningConfigurationStatus.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/VersioningConfigurationStatus.java new file mode 100644 index 000000000000..612e2cea9c5e --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/VersioningConfigurationStatus.java @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * The versioning state of the bucket. + */ +public final class VersioningConfigurationStatus extends ExpandableStringEnum { + /** + * Static value Enabled for VersioningConfigurationStatus. + */ + public static final VersioningConfigurationStatus ENABLED = fromString("Enabled"); + + /** + * Static value Suspended for VersioningConfigurationStatus. + */ + public static final VersioningConfigurationStatus SUSPENDED = fromString("Suspended"); + + /** + * Creates a new instance of VersioningConfigurationStatus value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public VersioningConfigurationStatus() { + } + + /** + * Creates or finds a VersioningConfigurationStatus from its string representation. + * + * @param name a name to look for. + * @return the corresponding VersioningConfigurationStatus. + */ + public static VersioningConfigurationStatus fromString(String name) { + return fromString(name, VersioningConfigurationStatus.class); + } + + /** + * Gets known VersioningConfigurationStatus values. + * + * @return known VersioningConfigurationStatus values. + */ + public static Collection values() { + return values(VersioningConfigurationStatus.class); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ViewerCertificate.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ViewerCertificate.java new file mode 100644 index 000000000000..0b59c23c033d --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ViewerCertificate.java @@ -0,0 +1,318 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of ViewerCertificate. + */ +@Fluent +public final class ViewerCertificate implements JsonSerializable { + /* + * In CloudFormation, this field name is ``AcmCertificateArn``. Note the different capitalization. If the + * distribution uses ``Aliases`` (alternate domain names or CNAMEs) and the SSL/TLS certificate is stored in + * [(ACM)](https://docs.aws.amazon.com/acm/latest/userguide/acm-overview.html), provide the Amazon Resource Name + * (ARN) of the ACM certificate. CloudFront only supports ACM certificates in the US East (N. Virginia) Region + * (``us-east-1``). If you specify an ACM certificate ARN, you must also specify values for + * ``MinimumProtocolVersion`` and ``SSLSupportMethod``. (In CloudFormation, the field name is ``SslSupportMethod``. + * Note the different capitalization.) + */ + private String acmCertificateArn; + + /* + * If the distribution uses the CloudFront domain name such as ``d111111abcdef8.cloudfront.net``, set this field to + * ``true``. If the distribution uses ``Aliases`` (alternate domain names or CNAMEs), omit this field and specify + * values for the following fields: + ``AcmCertificateArn`` or ``IamCertificateId`` (specify a value for one, not + * both) + ``MinimumProtocolVersion`` + ``SslSupportMethod`` + */ + private Boolean cloudFrontDefaultCertificate; + + /* + * In CloudFormation, this field name is ``IamCertificateId``. Note the different capitalization. If the + * distribution uses ``Aliases`` (alternate domain names or CNAMEs) and the SSL/TLS certificate is stored in + * [(IAM)](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_server-certs.html), provide the ID of the + * IAM certificate. If you specify an IAM certificate ID, you must also specify values for + * ``MinimumProtocolVersion`` and ``SSLSupportMethod``. (In CloudFormation, the field name is ``SslSupportMethod``. + * Note the different capitalization.) + */ + private String iamCertificateId; + + /* + * If the distribution uses ``Aliases`` (alternate domain names or CNAMEs), specify the security policy that you + * want CloudFront to use for HTTPS connections with viewers. The security policy determines two settings: + The + * minimum SSL/TLS protocol that CloudFront can use to communicate with viewers. + The ciphers that CloudFront can + * use to encrypt the content that it returns to viewers. For more information, see [Security + * Policy](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/distribution-web-values-specify.html# + * DownloadDistValues-security-policy) and [Supported Protocols and Ciphers Between Viewers and + * CloudFront](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/secure-connections-supported- + * viewer-protocols-ciphers.html#secure-connections-supported-ciphers) in the *Amazon CloudFront Developer Guide*. + * On the CloudFront console, this setting is called *Security Policy*. When you're using SNI only (you set + * ``SSLSupportMethod`` to ``sni-only``), you must specify ``TLSv1`` or higher. (In CloudFormation, the field name + * is ``SslSupportMethod``. Note the different capitalization.) If the distribution uses the CloudFront domain name + * such as ``d111111abcdef8.cloudfront.net`` (you set ``CloudFrontDefaultCertificate`` to ``true``), CloudFront + * automatically sets the security policy to ``TLSv1`` regardless of the value that you set here. + */ + private String minimumProtocolVersion; + + /* + * In CloudFormation, this field name is ``SslSupportMethod``. Note the different capitalization. If the + * distribution uses ``Aliases`` (alternate domain names or CNAMEs), specify which viewers the distribution accepts + * HTTPS connections from. + ``sni-only`` – The distribution accepts HTTPS connections from only viewers that + * support [server name indication + * (SNI)](https://docs.aws.amazon.com/https://en.wikipedia.org/wiki/Server_Name_Indication). This is recommended. + * Most browsers and clients support SNI. + ``vip`` – The distribution accepts HTTPS connections from all viewers + * including those that don't support SNI. This is not recommended, and results in additional monthly charges from + * CloudFront. + ``static-ip`` - Do not specify this value unless your distribution has been enabled for this + * feature by the CloudFront team. If you have a use case that requires static IP addresses for a distribution, + * contact CloudFront through the [Center](https://docs.aws.amazon.com/support/home). If the distribution uses the + * CloudFront domain name such as ``d111111abcdef8.cloudfront.net``, don't set a value for this field. + */ + private String sslSupportMethod; + + /** + * Creates an instance of ViewerCertificate class. + */ + public ViewerCertificate() { + } + + /** + * Get the acmCertificateArn property: In CloudFormation, this field name is ``AcmCertificateArn``. Note the + * different capitalization. If the distribution uses ``Aliases`` (alternate domain names or CNAMEs) and the SSL/TLS + * certificate is stored in [(ACM)](https://docs.aws.amazon.com/acm/latest/userguide/acm-overview.html), provide the + * Amazon Resource Name (ARN) of the ACM certificate. CloudFront only supports ACM certificates in the US East (N. + * Virginia) Region (``us-east-1``). If you specify an ACM certificate ARN, you must also specify values for + * ``MinimumProtocolVersion`` and ``SSLSupportMethod``. (In CloudFormation, the field name is ``SslSupportMethod``. + * Note the different capitalization.). + * + * @return the acmCertificateArn value. + */ + public String acmCertificateArn() { + return this.acmCertificateArn; + } + + /** + * Set the acmCertificateArn property: In CloudFormation, this field name is ``AcmCertificateArn``. Note the + * different capitalization. If the distribution uses ``Aliases`` (alternate domain names or CNAMEs) and the SSL/TLS + * certificate is stored in [(ACM)](https://docs.aws.amazon.com/acm/latest/userguide/acm-overview.html), provide the + * Amazon Resource Name (ARN) of the ACM certificate. CloudFront only supports ACM certificates in the US East (N. + * Virginia) Region (``us-east-1``). If you specify an ACM certificate ARN, you must also specify values for + * ``MinimumProtocolVersion`` and ``SSLSupportMethod``. (In CloudFormation, the field name is ``SslSupportMethod``. + * Note the different capitalization.). + * + * @param acmCertificateArn the acmCertificateArn value to set. + * @return the ViewerCertificate object itself. + */ + public ViewerCertificate withAcmCertificateArn(String acmCertificateArn) { + this.acmCertificateArn = acmCertificateArn; + return this; + } + + /** + * Get the cloudFrontDefaultCertificate property: If the distribution uses the CloudFront domain name such as + * ``d111111abcdef8.cloudfront.net``, set this field to ``true``. If the distribution uses ``Aliases`` (alternate + * domain names or CNAMEs), omit this field and specify values for the following fields: + ``AcmCertificateArn`` or + * ``IamCertificateId`` (specify a value for one, not both) + ``MinimumProtocolVersion`` + ``SslSupportMethod``. + * + * @return the cloudFrontDefaultCertificate value. + */ + public Boolean cloudFrontDefaultCertificate() { + return this.cloudFrontDefaultCertificate; + } + + /** + * Set the cloudFrontDefaultCertificate property: If the distribution uses the CloudFront domain name such as + * ``d111111abcdef8.cloudfront.net``, set this field to ``true``. If the distribution uses ``Aliases`` (alternate + * domain names or CNAMEs), omit this field and specify values for the following fields: + ``AcmCertificateArn`` or + * ``IamCertificateId`` (specify a value for one, not both) + ``MinimumProtocolVersion`` + ``SslSupportMethod``. + * + * @param cloudFrontDefaultCertificate the cloudFrontDefaultCertificate value to set. + * @return the ViewerCertificate object itself. + */ + public ViewerCertificate withCloudFrontDefaultCertificate(Boolean cloudFrontDefaultCertificate) { + this.cloudFrontDefaultCertificate = cloudFrontDefaultCertificate; + return this; + } + + /** + * Get the iamCertificateId property: In CloudFormation, this field name is ``IamCertificateId``. Note the different + * capitalization. If the distribution uses ``Aliases`` (alternate domain names or CNAMEs) and the SSL/TLS + * certificate is stored in + * [(IAM)](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_server-certs.html), provide the ID of the + * IAM certificate. If you specify an IAM certificate ID, you must also specify values for + * ``MinimumProtocolVersion`` and ``SSLSupportMethod``. (In CloudFormation, the field name is ``SslSupportMethod``. + * Note the different capitalization.). + * + * @return the iamCertificateId value. + */ + public String iamCertificateId() { + return this.iamCertificateId; + } + + /** + * Set the iamCertificateId property: In CloudFormation, this field name is ``IamCertificateId``. Note the different + * capitalization. If the distribution uses ``Aliases`` (alternate domain names or CNAMEs) and the SSL/TLS + * certificate is stored in + * [(IAM)](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_server-certs.html), provide the ID of the + * IAM certificate. If you specify an IAM certificate ID, you must also specify values for + * ``MinimumProtocolVersion`` and ``SSLSupportMethod``. (In CloudFormation, the field name is ``SslSupportMethod``. + * Note the different capitalization.). + * + * @param iamCertificateId the iamCertificateId value to set. + * @return the ViewerCertificate object itself. + */ + public ViewerCertificate withIamCertificateId(String iamCertificateId) { + this.iamCertificateId = iamCertificateId; + return this; + } + + /** + * Get the minimumProtocolVersion property: If the distribution uses ``Aliases`` (alternate domain names or CNAMEs), + * specify the security policy that you want CloudFront to use for HTTPS connections with viewers. The security + * policy determines two settings: + The minimum SSL/TLS protocol that CloudFront can use to communicate with + * viewers. + The ciphers that CloudFront can use to encrypt the content that it returns to viewers. For more + * information, see [Security + * Policy](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/distribution-web-values-specify.html#DownloadDistValues-security-policy) + * and [Supported Protocols and Ciphers Between Viewers and + * CloudFront](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/secure-connections-supported-viewer-protocols-ciphers.html#secure-connections-supported-ciphers) + * in the *Amazon CloudFront Developer Guide*. On the CloudFront console, this setting is called *Security Policy*. + * When you're using SNI only (you set ``SSLSupportMethod`` to ``sni-only``), you must specify ``TLSv1`` or higher. + * (In CloudFormation, the field name is ``SslSupportMethod``. Note the different capitalization.) If the + * distribution uses the CloudFront domain name such as ``d111111abcdef8.cloudfront.net`` (you set + * ``CloudFrontDefaultCertificate`` to ``true``), CloudFront automatically sets the security policy to ``TLSv1`` + * regardless of the value that you set here. + * + * @return the minimumProtocolVersion value. + */ + public String minimumProtocolVersion() { + return this.minimumProtocolVersion; + } + + /** + * Set the minimumProtocolVersion property: If the distribution uses ``Aliases`` (alternate domain names or CNAMEs), + * specify the security policy that you want CloudFront to use for HTTPS connections with viewers. The security + * policy determines two settings: + The minimum SSL/TLS protocol that CloudFront can use to communicate with + * viewers. + The ciphers that CloudFront can use to encrypt the content that it returns to viewers. For more + * information, see [Security + * Policy](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/distribution-web-values-specify.html#DownloadDistValues-security-policy) + * and [Supported Protocols and Ciphers Between Viewers and + * CloudFront](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/secure-connections-supported-viewer-protocols-ciphers.html#secure-connections-supported-ciphers) + * in the *Amazon CloudFront Developer Guide*. On the CloudFront console, this setting is called *Security Policy*. + * When you're using SNI only (you set ``SSLSupportMethod`` to ``sni-only``), you must specify ``TLSv1`` or higher. + * (In CloudFormation, the field name is ``SslSupportMethod``. Note the different capitalization.) If the + * distribution uses the CloudFront domain name such as ``d111111abcdef8.cloudfront.net`` (you set + * ``CloudFrontDefaultCertificate`` to ``true``), CloudFront automatically sets the security policy to ``TLSv1`` + * regardless of the value that you set here. + * + * @param minimumProtocolVersion the minimumProtocolVersion value to set. + * @return the ViewerCertificate object itself. + */ + public ViewerCertificate withMinimumProtocolVersion(String minimumProtocolVersion) { + this.minimumProtocolVersion = minimumProtocolVersion; + return this; + } + + /** + * Get the sslSupportMethod property: In CloudFormation, this field name is ``SslSupportMethod``. Note the different + * capitalization. If the distribution uses ``Aliases`` (alternate domain names or CNAMEs), specify which viewers + * the distribution accepts HTTPS connections from. + ``sni-only`` – The distribution accepts HTTPS connections from + * only viewers that support [server name indication + * (SNI)](https://docs.aws.amazon.com/https://en.wikipedia.org/wiki/Server_Name_Indication). This is recommended. + * Most browsers and clients support SNI. + ``vip`` – The distribution accepts HTTPS connections from all viewers + * including those that don't support SNI. This is not recommended, and results in additional monthly charges from + * CloudFront. + ``static-ip`` - Do not specify this value unless your distribution has been enabled for this + * feature by the CloudFront team. If you have a use case that requires static IP addresses for a distribution, + * contact CloudFront through the [Center](https://docs.aws.amazon.com/support/home). If the distribution uses the + * CloudFront domain name such as ``d111111abcdef8.cloudfront.net``, don't set a value for this field. + * + * @return the sslSupportMethod value. + */ + public String sslSupportMethod() { + return this.sslSupportMethod; + } + + /** + * Set the sslSupportMethod property: In CloudFormation, this field name is ``SslSupportMethod``. Note the different + * capitalization. If the distribution uses ``Aliases`` (alternate domain names or CNAMEs), specify which viewers + * the distribution accepts HTTPS connections from. + ``sni-only`` – The distribution accepts HTTPS connections from + * only viewers that support [server name indication + * (SNI)](https://docs.aws.amazon.com/https://en.wikipedia.org/wiki/Server_Name_Indication). This is recommended. + * Most browsers and clients support SNI. + ``vip`` – The distribution accepts HTTPS connections from all viewers + * including those that don't support SNI. This is not recommended, and results in additional monthly charges from + * CloudFront. + ``static-ip`` - Do not specify this value unless your distribution has been enabled for this + * feature by the CloudFront team. If you have a use case that requires static IP addresses for a distribution, + * contact CloudFront through the [Center](https://docs.aws.amazon.com/support/home). If the distribution uses the + * CloudFront domain name such as ``d111111abcdef8.cloudfront.net``, don't set a value for this field. + * + * @param sslSupportMethod the sslSupportMethod value to set. + * @return the ViewerCertificate object itself. + */ + public ViewerCertificate withSslSupportMethod(String sslSupportMethod) { + this.sslSupportMethod = sslSupportMethod; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("acmCertificateArn", this.acmCertificateArn); + jsonWriter.writeBooleanField("cloudFrontDefaultCertificate", this.cloudFrontDefaultCertificate); + jsonWriter.writeStringField("iamCertificateId", this.iamCertificateId); + jsonWriter.writeStringField("minimumProtocolVersion", this.minimumProtocolVersion); + jsonWriter.writeStringField("sslSupportMethod", this.sslSupportMethod); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ViewerCertificate from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ViewerCertificate if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the ViewerCertificate. + */ + public static ViewerCertificate fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ViewerCertificate deserializedViewerCertificate = new ViewerCertificate(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("acmCertificateArn".equals(fieldName)) { + deserializedViewerCertificate.acmCertificateArn = reader.getString(); + } else if ("cloudFrontDefaultCertificate".equals(fieldName)) { + deserializedViewerCertificate.cloudFrontDefaultCertificate + = reader.getNullable(JsonReader::getBoolean); + } else if ("iamCertificateId".equals(fieldName)) { + deserializedViewerCertificate.iamCertificateId = reader.getString(); + } else if ("minimumProtocolVersion".equals(fieldName)) { + deserializedViewerCertificate.minimumProtocolVersion = reader.getString(); + } else if ("sslSupportMethod".equals(fieldName)) { + deserializedViewerCertificate.sslSupportMethod = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedViewerCertificate; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/VirtualizationType.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/VirtualizationType.java new file mode 100644 index 000000000000..4a0745426666 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/VirtualizationType.java @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * VirtualizationType enum. + */ +public final class VirtualizationType extends ExpandableStringEnum { + /** + * Static value hvm for VirtualizationType. + */ + public static final VirtualizationType HVM = fromString("hvm"); + + /** + * Static value paravirtual for VirtualizationType. + */ + public static final VirtualizationType PARAVIRTUAL = fromString("paravirtual"); + + /** + * Creates a new instance of VirtualizationType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public VirtualizationType() { + } + + /** + * Creates or finds a VirtualizationType from its string representation. + * + * @param name a name to look for. + * @return the corresponding VirtualizationType. + */ + public static VirtualizationType fromString(String name) { + return fromString(name, VirtualizationType.class); + } + + /** + * Gets known VirtualizationType values. + * + * @return known VirtualizationType values. + */ + public static Collection values() { + return values(VirtualizationType.class); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/VirtualizationTypeEnumValue.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/VirtualizationTypeEnumValue.java new file mode 100644 index 000000000000..e7914719e7dd --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/VirtualizationTypeEnumValue.java @@ -0,0 +1,93 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of VirtualizationTypeEnumValue. + */ +@Fluent +public final class VirtualizationTypeEnumValue implements JsonSerializable { + /* + * Property value + */ + private VirtualizationType value; + + /** + * Creates an instance of VirtualizationTypeEnumValue class. + */ + public VirtualizationTypeEnumValue() { + } + + /** + * Get the value property: Property value. + * + * @return the value value. + */ + public VirtualizationType value() { + return this.value; + } + + /** + * Set the value property: Property value. + * + * @param value the value value to set. + * @return the VirtualizationTypeEnumValue object itself. + */ + public VirtualizationTypeEnumValue withValue(VirtualizationType value) { + this.value = value; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("value", this.value == null ? null : this.value.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of VirtualizationTypeEnumValue from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of VirtualizationTypeEnumValue if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the VirtualizationTypeEnumValue. + */ + public static VirtualizationTypeEnumValue fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + VirtualizationTypeEnumValue deserializedVirtualizationTypeEnumValue = new VirtualizationTypeEnumValue(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + deserializedVirtualizationTypeEnumValue.value = VirtualizationType.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedVirtualizationTypeEnumValue; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/Volume.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/Volume.java new file mode 100644 index 000000000000..14aa1305c95c --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/Volume.java @@ -0,0 +1,337 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of Volume. + */ +@Fluent +public final class Volume implements JsonSerializable { + /* + * Indicates whether the volume should be configured at launch time. This is used to create Amazon EBS volumes for + * standalone tasks or tasks created as part of a service. Each task definition revision may only have one volume + * configured at launch in the volume configuration. To configure a volume at launch time, use this task definition + * revision and specify a ``volumeConfigurations`` object when calling the ``CreateService``, ``UpdateService``, + * ``RunTask`` or ``StartTask`` APIs. + */ + private Boolean configuredAtLaunch; + + /* + * This parameter is specified when you use Docker volumes. Windows containers only support the use of the ``local`` + * driver. To use bind mounts, specify the ``host`` parameter instead. Docker volumes aren't supported by tasks run + * on FARGATElong. The ``DockerVolumeConfiguration`` property specifies a Docker volume configuration and is used + * when you use Docker volumes. Docker volumes are only supported when you are using the EC2 launch type. Windows + * containers only support the use of the ``local`` driver. To use bind mounts, specify a ``host`` instead. + */ + private DockerVolumeConfiguration dockerVolumeConfiguration; + + /* + * This parameter is specified when you use an Amazon Elastic File System file system for task storage. This + * parameter is specified when you're using an Amazon Elastic File System file system for task storage. For more + * information, see [Amazon EFS + * volumes](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/efs-volumes.html) in the *Amazon Elastic + * Container Service Developer Guide*. + */ + private EfsVolumeConfiguration efsVolumeConfiguration; + + /* + * This parameter is specified when you use Amazon FSx for Windows File Server file system for task storage. This + * parameter is specified when you're using [Amazon FSx for Windows File + * Server](https://docs.aws.amazon.com/fsx/latest/WindowsGuide/what-is.html) file system for task storage. For more + * information and the input format, see [Amazon FSx for Windows File Server + * volumes](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/wfsx-volumes.html) in the *Amazon Elastic + * Container Service Developer Guide*. + */ + private FSxWindowsFileServerVolumeConfiguration fSxWindowsFileServerVolumeConfiguration; + + /* + * This parameter is specified when you use bind mount host volumes. The contents of the ``host`` parameter + * determine whether your bind mount host volume persists on the host container instance and where it's stored. If + * the ``host`` parameter is empty, then the Docker daemon assigns a host path for your data volume. However, the + * data isn't guaranteed to persist after the containers that are associated with it stop running. Windows + * containers can mount whole directories on the same drive as ``$env:ProgramData``. Windows containers can't mount + * directories on a different drive, and mount point can't be across drives. For example, you can mount + * ``C:\my\path:C:\my\path`` and ``D:\:D:\``, but not ``D:\my\path:C:\my\path`` or ``D:\:C:\my\path``. The + * ``HostVolumeProperties`` property specifies details on a container instance bind mount host volume. + */ + private HostVolumeProperties host; + + /* + * The name of the volume. Up to 255 letters (uppercase and lowercase), numbers, underscores, and hyphens are + * allowed. When using a volume configured at launch, the ``name`` is required and must also be specified as the + * volume name in the ``ServiceVolumeConfiguration`` or ``TaskVolumeConfiguration`` parameter when creating your + * service or standalone task. For all other types of volumes, this name is referenced in the ``sourceVolume`` + * parameter of the ``mountPoints`` object in the container definition. When a volume is using the + * ``efsVolumeConfiguration``, the name is required. + */ + private String name; + + /** + * Creates an instance of Volume class. + */ + public Volume() { + } + + /** + * Get the configuredAtLaunch property: Indicates whether the volume should be configured at launch time. This is + * used to create Amazon EBS volumes for standalone tasks or tasks created as part of a service. Each task + * definition revision may only have one volume configured at launch in the volume configuration. To configure a + * volume at launch time, use this task definition revision and specify a ``volumeConfigurations`` object when + * calling the ``CreateService``, ``UpdateService``, ``RunTask`` or ``StartTask`` APIs. + * + * @return the configuredAtLaunch value. + */ + public Boolean configuredAtLaunch() { + return this.configuredAtLaunch; + } + + /** + * Set the configuredAtLaunch property: Indicates whether the volume should be configured at launch time. This is + * used to create Amazon EBS volumes for standalone tasks or tasks created as part of a service. Each task + * definition revision may only have one volume configured at launch in the volume configuration. To configure a + * volume at launch time, use this task definition revision and specify a ``volumeConfigurations`` object when + * calling the ``CreateService``, ``UpdateService``, ``RunTask`` or ``StartTask`` APIs. + * + * @param configuredAtLaunch the configuredAtLaunch value to set. + * @return the Volume object itself. + */ + public Volume withConfiguredAtLaunch(Boolean configuredAtLaunch) { + this.configuredAtLaunch = configuredAtLaunch; + return this; + } + + /** + * Get the dockerVolumeConfiguration property: This parameter is specified when you use Docker volumes. Windows + * containers only support the use of the ``local`` driver. To use bind mounts, specify the ``host`` parameter + * instead. Docker volumes aren't supported by tasks run on FARGATElong. The ``DockerVolumeConfiguration`` property + * specifies a Docker volume configuration and is used when you use Docker volumes. Docker volumes are only + * supported when you are using the EC2 launch type. Windows containers only support the use of the ``local`` + * driver. To use bind mounts, specify a ``host`` instead. + * + * @return the dockerVolumeConfiguration value. + */ + public DockerVolumeConfiguration dockerVolumeConfiguration() { + return this.dockerVolumeConfiguration; + } + + /** + * Set the dockerVolumeConfiguration property: This parameter is specified when you use Docker volumes. Windows + * containers only support the use of the ``local`` driver. To use bind mounts, specify the ``host`` parameter + * instead. Docker volumes aren't supported by tasks run on FARGATElong. The ``DockerVolumeConfiguration`` property + * specifies a Docker volume configuration and is used when you use Docker volumes. Docker volumes are only + * supported when you are using the EC2 launch type. Windows containers only support the use of the ``local`` + * driver. To use bind mounts, specify a ``host`` instead. + * + * @param dockerVolumeConfiguration the dockerVolumeConfiguration value to set. + * @return the Volume object itself. + */ + public Volume withDockerVolumeConfiguration(DockerVolumeConfiguration dockerVolumeConfiguration) { + this.dockerVolumeConfiguration = dockerVolumeConfiguration; + return this; + } + + /** + * Get the efsVolumeConfiguration property: This parameter is specified when you use an Amazon Elastic File System + * file system for task storage. This parameter is specified when you're using an Amazon Elastic File System file + * system for task storage. For more information, see [Amazon EFS + * volumes](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/efs-volumes.html) in the *Amazon Elastic + * Container Service Developer Guide*. + * + * @return the efsVolumeConfiguration value. + */ + public EfsVolumeConfiguration efsVolumeConfiguration() { + return this.efsVolumeConfiguration; + } + + /** + * Set the efsVolumeConfiguration property: This parameter is specified when you use an Amazon Elastic File System + * file system for task storage. This parameter is specified when you're using an Amazon Elastic File System file + * system for task storage. For more information, see [Amazon EFS + * volumes](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/efs-volumes.html) in the *Amazon Elastic + * Container Service Developer Guide*. + * + * @param efsVolumeConfiguration the efsVolumeConfiguration value to set. + * @return the Volume object itself. + */ + public Volume withEfsVolumeConfiguration(EfsVolumeConfiguration efsVolumeConfiguration) { + this.efsVolumeConfiguration = efsVolumeConfiguration; + return this; + } + + /** + * Get the fSxWindowsFileServerVolumeConfiguration property: This parameter is specified when you use Amazon FSx for + * Windows File Server file system for task storage. This parameter is specified when you're using [Amazon FSx for + * Windows File Server](https://docs.aws.amazon.com/fsx/latest/WindowsGuide/what-is.html) file system for task + * storage. For more information and the input format, see [Amazon FSx for Windows File Server + * volumes](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/wfsx-volumes.html) in the *Amazon Elastic + * Container Service Developer Guide*. + * + * @return the fSxWindowsFileServerVolumeConfiguration value. + */ + public FSxWindowsFileServerVolumeConfiguration fSxWindowsFileServerVolumeConfiguration() { + return this.fSxWindowsFileServerVolumeConfiguration; + } + + /** + * Set the fSxWindowsFileServerVolumeConfiguration property: This parameter is specified when you use Amazon FSx for + * Windows File Server file system for task storage. This parameter is specified when you're using [Amazon FSx for + * Windows File Server](https://docs.aws.amazon.com/fsx/latest/WindowsGuide/what-is.html) file system for task + * storage. For more information and the input format, see [Amazon FSx for Windows File Server + * volumes](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/wfsx-volumes.html) in the *Amazon Elastic + * Container Service Developer Guide*. + * + * @param fSxWindowsFileServerVolumeConfiguration the fSxWindowsFileServerVolumeConfiguration value to set. + * @return the Volume object itself. + */ + public Volume withFSxWindowsFileServerVolumeConfiguration( + FSxWindowsFileServerVolumeConfiguration fSxWindowsFileServerVolumeConfiguration) { + this.fSxWindowsFileServerVolumeConfiguration = fSxWindowsFileServerVolumeConfiguration; + return this; + } + + /** + * Get the host property: This parameter is specified when you use bind mount host volumes. The contents of the + * ``host`` parameter determine whether your bind mount host volume persists on the host container instance and + * where it's stored. If the ``host`` parameter is empty, then the Docker daemon assigns a host path for your data + * volume. However, the data isn't guaranteed to persist after the containers that are associated with it stop + * running. Windows containers can mount whole directories on the same drive as ``$env:ProgramData``. Windows + * containers can't mount directories on a different drive, and mount point can't be across drives. For example, you + * can mount ``C:\my\path:C:\my\path`` and ``D:\:D:\``, but not ``D:\my\path:C:\my\path`` or ``D:\:C:\my\path``. The + * ``HostVolumeProperties`` property specifies details on a container instance bind mount host volume. + * + * @return the host value. + */ + public HostVolumeProperties host() { + return this.host; + } + + /** + * Set the host property: This parameter is specified when you use bind mount host volumes. The contents of the + * ``host`` parameter determine whether your bind mount host volume persists on the host container instance and + * where it's stored. If the ``host`` parameter is empty, then the Docker daemon assigns a host path for your data + * volume. However, the data isn't guaranteed to persist after the containers that are associated with it stop + * running. Windows containers can mount whole directories on the same drive as ``$env:ProgramData``. Windows + * containers can't mount directories on a different drive, and mount point can't be across drives. For example, you + * can mount ``C:\my\path:C:\my\path`` and ``D:\:D:\``, but not ``D:\my\path:C:\my\path`` or ``D:\:C:\my\path``. The + * ``HostVolumeProperties`` property specifies details on a container instance bind mount host volume. + * + * @param host the host value to set. + * @return the Volume object itself. + */ + public Volume withHost(HostVolumeProperties host) { + this.host = host; + return this; + } + + /** + * Get the name property: The name of the volume. Up to 255 letters (uppercase and lowercase), numbers, underscores, + * and hyphens are allowed. When using a volume configured at launch, the ``name`` is required and must also be + * specified as the volume name in the ``ServiceVolumeConfiguration`` or ``TaskVolumeConfiguration`` parameter when + * creating your service or standalone task. For all other types of volumes, this name is referenced in the + * ``sourceVolume`` parameter of the ``mountPoints`` object in the container definition. When a volume is using the + * ``efsVolumeConfiguration``, the name is required. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: The name of the volume. Up to 255 letters (uppercase and lowercase), numbers, underscores, + * and hyphens are allowed. When using a volume configured at launch, the ``name`` is required and must also be + * specified as the volume name in the ``ServiceVolumeConfiguration`` or ``TaskVolumeConfiguration`` parameter when + * creating your service or standalone task. For all other types of volumes, this name is referenced in the + * ``sourceVolume`` parameter of the ``mountPoints`` object in the container definition. When a volume is using the + * ``efsVolumeConfiguration``, the name is required. + * + * @param name the name value to set. + * @return the Volume object itself. + */ + public Volume withName(String name) { + this.name = name; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (dockerVolumeConfiguration() != null) { + dockerVolumeConfiguration().validate(); + } + if (efsVolumeConfiguration() != null) { + efsVolumeConfiguration().validate(); + } + if (fSxWindowsFileServerVolumeConfiguration() != null) { + fSxWindowsFileServerVolumeConfiguration().validate(); + } + if (host() != null) { + host().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeBooleanField("configuredAtLaunch", this.configuredAtLaunch); + jsonWriter.writeJsonField("dockerVolumeConfiguration", this.dockerVolumeConfiguration); + jsonWriter.writeJsonField("efsVolumeConfiguration", this.efsVolumeConfiguration); + jsonWriter.writeJsonField("fSxWindowsFileServerVolumeConfiguration", + this.fSxWindowsFileServerVolumeConfiguration); + jsonWriter.writeJsonField("host", this.host); + jsonWriter.writeStringField("name", this.name); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of Volume from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of Volume if the JsonReader was pointing to an instance of it, or null if it was pointing to + * JSON null. + * @throws IOException If an error occurs while reading the Volume. + */ + public static Volume fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + Volume deserializedVolume = new Volume(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("configuredAtLaunch".equals(fieldName)) { + deserializedVolume.configuredAtLaunch = reader.getNullable(JsonReader::getBoolean); + } else if ("dockerVolumeConfiguration".equals(fieldName)) { + deserializedVolume.dockerVolumeConfiguration = DockerVolumeConfiguration.fromJson(reader); + } else if ("efsVolumeConfiguration".equals(fieldName)) { + deserializedVolume.efsVolumeConfiguration = EfsVolumeConfiguration.fromJson(reader); + } else if ("fSxWindowsFileServerVolumeConfiguration".equals(fieldName)) { + deserializedVolume.fSxWindowsFileServerVolumeConfiguration + = FSxWindowsFileServerVolumeConfiguration.fromJson(reader); + } else if ("host".equals(fieldName)) { + deserializedVolume.host = HostVolumeProperties.fromJson(reader); + } else if ("name".equals(fieldName)) { + deserializedVolume.name = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedVolume; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/VolumeFrom.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/VolumeFrom.java new file mode 100644 index 000000000000..5e02a34f19c8 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/VolumeFrom.java @@ -0,0 +1,126 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of VolumeFrom. + */ +@Fluent +public final class VolumeFrom implements JsonSerializable { + /* + * If this value is ``true``, the container has read-only access to the volume. If this value is ``false``, then the + * container can write to the volume. The default value is ``false``. + */ + private Boolean readOnly; + + /* + * The name of another container within the same task definition to mount volumes from. + */ + private String sourceContainer; + + /** + * Creates an instance of VolumeFrom class. + */ + public VolumeFrom() { + } + + /** + * Get the readOnly property: If this value is ``true``, the container has read-only access to the volume. If this + * value is ``false``, then the container can write to the volume. The default value is ``false``. + * + * @return the readOnly value. + */ + public Boolean readOnly() { + return this.readOnly; + } + + /** + * Set the readOnly property: If this value is ``true``, the container has read-only access to the volume. If this + * value is ``false``, then the container can write to the volume. The default value is ``false``. + * + * @param readOnly the readOnly value to set. + * @return the VolumeFrom object itself. + */ + public VolumeFrom withReadOnly(Boolean readOnly) { + this.readOnly = readOnly; + return this; + } + + /** + * Get the sourceContainer property: The name of another container within the same task definition to mount volumes + * from. + * + * @return the sourceContainer value. + */ + public String sourceContainer() { + return this.sourceContainer; + } + + /** + * Set the sourceContainer property: The name of another container within the same task definition to mount volumes + * from. + * + * @param sourceContainer the sourceContainer value to set. + * @return the VolumeFrom object itself. + */ + public VolumeFrom withSourceContainer(String sourceContainer) { + this.sourceContainer = sourceContainer; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeBooleanField("readOnly", this.readOnly); + jsonWriter.writeStringField("sourceContainer", this.sourceContainer); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of VolumeFrom from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of VolumeFrom if the JsonReader was pointing to an instance of it, or null if it was pointing + * to JSON null. + * @throws IOException If an error occurs while reading the VolumeFrom. + */ + public static VolumeFrom fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + VolumeFrom deserializedVolumeFrom = new VolumeFrom(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("readOnly".equals(fieldName)) { + deserializedVolumeFrom.readOnly = reader.getNullable(JsonReader::getBoolean); + } else if ("sourceContainer".equals(fieldName)) { + deserializedVolumeFrom.sourceContainer = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedVolumeFrom; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/VolumeType.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/VolumeType.java new file mode 100644 index 000000000000..433814f35cdc --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/VolumeType.java @@ -0,0 +1,76 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * VolumeType enum. + */ +public final class VolumeType extends ExpandableStringEnum { + /** + * Static value gp2 for VolumeType. + */ + public static final VolumeType GP2 = fromString("gp2"); + + /** + * Static value gp3 for VolumeType. + */ + public static final VolumeType GP3 = fromString("gp3"); + + /** + * Static value io1 for VolumeType. + */ + public static final VolumeType IO1 = fromString("io1"); + + /** + * Static value io2 for VolumeType. + */ + public static final VolumeType IO2 = fromString("io2"); + + /** + * Static value sc1 for VolumeType. + */ + public static final VolumeType SC1 = fromString("sc1"); + + /** + * Static value st1 for VolumeType. + */ + public static final VolumeType ST1 = fromString("st1"); + + /** + * Static value standard for VolumeType. + */ + public static final VolumeType STANDARD = fromString("standard"); + + /** + * Creates a new instance of VolumeType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public VolumeType() { + } + + /** + * Creates or finds a VolumeType from its string representation. + * + * @param name a name to look for. + * @return the corresponding VolumeType. + */ + public static VolumeType fromString(String name) { + return fromString(name, VolumeType.class); + } + + /** + * Gets known VolumeType values. + * + * @return known VolumeType values. + */ + public static Collection values() { + return values(VolumeType.class); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/VolumeTypeEnumValue.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/VolumeTypeEnumValue.java new file mode 100644 index 000000000000..5150ae29c97c --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/VolumeTypeEnumValue.java @@ -0,0 +1,93 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of VolumeTypeEnumValue. + */ +@Fluent +public final class VolumeTypeEnumValue implements JsonSerializable { + /* + * Property value + */ + private VolumeType value; + + /** + * Creates an instance of VolumeTypeEnumValue class. + */ + public VolumeTypeEnumValue() { + } + + /** + * Get the value property: Property value. + * + * @return the value value. + */ + public VolumeType value() { + return this.value; + } + + /** + * Set the value property: Property value. + * + * @param value the value value to set. + * @return the VolumeTypeEnumValue object itself. + */ + public VolumeTypeEnumValue withValue(VolumeType value) { + this.value = value; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("value", this.value == null ? null : this.value.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of VolumeTypeEnumValue from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of VolumeTypeEnumValue if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the VolumeTypeEnumValue. + */ + public static VolumeTypeEnumValue fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + VolumeTypeEnumValue deserializedVolumeTypeEnumValue = new VolumeTypeEnumValue(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + deserializedVolumeTypeEnumValue.value = VolumeType.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedVolumeTypeEnumValue; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/Vpc.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/Vpc.java new file mode 100644 index 000000000000..168c4a67508d --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/Vpc.java @@ -0,0 +1,127 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of VPC. + */ +@Fluent +public final class Vpc implements JsonSerializable { + /* + * *Private hosted zones only:* The ID of an Amazon VPC. For public hosted zones, omit ``VPCs``, ``VPCId``, and + * ``VPCRegion``. + */ + private String vpcId; + + /* + * *Private hosted zones only:* The region that an Amazon VPC was created in. For public hosted zones, omit + * ``VPCs``, ``VPCId``, and ``VPCRegion``. + */ + private String vpcRegion; + + /** + * Creates an instance of Vpc class. + */ + public Vpc() { + } + + /** + * Get the vpcId property: *Private hosted zones only:* The ID of an Amazon VPC. For public hosted zones, omit + * ``VPCs``, ``VPCId``, and ``VPCRegion``. + * + * @return the vpcId value. + */ + public String vpcId() { + return this.vpcId; + } + + /** + * Set the vpcId property: *Private hosted zones only:* The ID of an Amazon VPC. For public hosted zones, omit + * ``VPCs``, ``VPCId``, and ``VPCRegion``. + * + * @param vpcId the vpcId value to set. + * @return the Vpc object itself. + */ + public Vpc withVpcId(String vpcId) { + this.vpcId = vpcId; + return this; + } + + /** + * Get the vpcRegion property: *Private hosted zones only:* The region that an Amazon VPC was created in. For public + * hosted zones, omit ``VPCs``, ``VPCId``, and ``VPCRegion``. + * + * @return the vpcRegion value. + */ + public String vpcRegion() { + return this.vpcRegion; + } + + /** + * Set the vpcRegion property: *Private hosted zones only:* The region that an Amazon VPC was created in. For public + * hosted zones, omit ``VPCs``, ``VPCId``, and ``VPCRegion``. + * + * @param vpcRegion the vpcRegion value to set. + * @return the Vpc object itself. + */ + public Vpc withVpcRegion(String vpcRegion) { + this.vpcRegion = vpcRegion; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("vpcId", this.vpcId); + jsonWriter.writeStringField("vpcRegion", this.vpcRegion); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of Vpc from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of Vpc if the JsonReader was pointing to an instance of it, or null if it was pointing to + * JSON null. + * @throws IOException If an error occurs while reading the Vpc. + */ + public static Vpc fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + Vpc deserializedVpc = new Vpc(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("vpcId".equals(fieldName)) { + deserializedVpc.vpcId = reader.getString(); + } else if ("vpcRegion".equals(fieldName)) { + deserializedVpc.vpcRegion = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedVpc; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/VpcConfig.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/VpcConfig.java new file mode 100644 index 000000000000..041ac53ad130 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/VpcConfig.java @@ -0,0 +1,155 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Definition of VpcConfig. + */ +@Fluent +public final class VpcConfig implements JsonSerializable { + /* + *

A list of one or more security groups IDs in your Amazon VPC.

+ */ + private List securityGroupIds; + + /* + *

A list of one or more subnet IDs in your Amazon VPC.

+ */ + private List subnets; + + /* + *

The ID of the Amazon VPC.

+ */ + private String vpcId; + + /** + * Creates an instance of VpcConfig class. + */ + public VpcConfig() { + } + + /** + * Get the securityGroupIds property: <p>A list of one or more security groups IDs in your Amazon + * VPC.</p>. + * + * @return the securityGroupIds value. + */ + public List securityGroupIds() { + return this.securityGroupIds; + } + + /** + * Set the securityGroupIds property: <p>A list of one or more security groups IDs in your Amazon + * VPC.</p>. + * + * @param securityGroupIds the securityGroupIds value to set. + * @return the VpcConfig object itself. + */ + public VpcConfig withSecurityGroupIds(List securityGroupIds) { + this.securityGroupIds = securityGroupIds; + return this; + } + + /** + * Get the subnets property: <p>A list of one or more subnet IDs in your Amazon VPC.</p>. + * + * @return the subnets value. + */ + public List subnets() { + return this.subnets; + } + + /** + * Set the subnets property: <p>A list of one or more subnet IDs in your Amazon VPC.</p>. + * + * @param subnets the subnets value to set. + * @return the VpcConfig object itself. + */ + public VpcConfig withSubnets(List subnets) { + this.subnets = subnets; + return this; + } + + /** + * Get the vpcId property: <p>The ID of the Amazon VPC.</p>. + * + * @return the vpcId value. + */ + public String vpcId() { + return this.vpcId; + } + + /** + * Set the vpcId property: <p>The ID of the Amazon VPC.</p>. + * + * @param vpcId the vpcId value to set. + * @return the VpcConfig object itself. + */ + public VpcConfig withVpcId(String vpcId) { + this.vpcId = vpcId; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("securityGroupIds", this.securityGroupIds, + (writer, element) -> writer.writeString(element)); + jsonWriter.writeArrayField("subnets", this.subnets, (writer, element) -> writer.writeString(element)); + jsonWriter.writeStringField("vpcId", this.vpcId); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of VpcConfig from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of VpcConfig if the JsonReader was pointing to an instance of it, or null if it was pointing + * to JSON null. + * @throws IOException If an error occurs while reading the VpcConfig. + */ + public static VpcConfig fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + VpcConfig deserializedVpcConfig = new VpcConfig(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("securityGroupIds".equals(fieldName)) { + List securityGroupIds = reader.readArray(reader1 -> reader1.getString()); + deserializedVpcConfig.securityGroupIds = securityGroupIds; + } else if ("subnets".equals(fieldName)) { + List subnets = reader.readArray(reader1 -> reader1.getString()); + deserializedVpcConfig.subnets = subnets; + } else if ("vpcId".equals(fieldName)) { + deserializedVpcConfig.vpcId = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedVpcConfig; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/VpcConfigAutoGenerated.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/VpcConfigAutoGenerated.java new file mode 100644 index 000000000000..be1eecccc517 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/VpcConfigAutoGenerated.java @@ -0,0 +1,156 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Definition of VpcConfig. + */ +@Fluent +public final class VpcConfigAutoGenerated implements JsonSerializable { + /* + * Allows outbound IPv6 traffic on VPC functions that are connected to dual-stack subnets. + */ + private Boolean ipv6AllowedForDualStack; + + /* + * A list of VPC security group IDs. + */ + private List securityGroupIds; + + /* + * A list of VPC subnet IDs. + */ + private List subnetIds; + + /** + * Creates an instance of VpcConfigAutoGenerated class. + */ + public VpcConfigAutoGenerated() { + } + + /** + * Get the ipv6AllowedForDualStack property: Allows outbound IPv6 traffic on VPC functions that are connected to + * dual-stack subnets. + * + * @return the ipv6AllowedForDualStack value. + */ + public Boolean ipv6AllowedForDualStack() { + return this.ipv6AllowedForDualStack; + } + + /** + * Set the ipv6AllowedForDualStack property: Allows outbound IPv6 traffic on VPC functions that are connected to + * dual-stack subnets. + * + * @param ipv6AllowedForDualStack the ipv6AllowedForDualStack value to set. + * @return the VpcConfigAutoGenerated object itself. + */ + public VpcConfigAutoGenerated withIpv6AllowedForDualStack(Boolean ipv6AllowedForDualStack) { + this.ipv6AllowedForDualStack = ipv6AllowedForDualStack; + return this; + } + + /** + * Get the securityGroupIds property: A list of VPC security group IDs. + * + * @return the securityGroupIds value. + */ + public List securityGroupIds() { + return this.securityGroupIds; + } + + /** + * Set the securityGroupIds property: A list of VPC security group IDs. + * + * @param securityGroupIds the securityGroupIds value to set. + * @return the VpcConfigAutoGenerated object itself. + */ + public VpcConfigAutoGenerated withSecurityGroupIds(List securityGroupIds) { + this.securityGroupIds = securityGroupIds; + return this; + } + + /** + * Get the subnetIds property: A list of VPC subnet IDs. + * + * @return the subnetIds value. + */ + public List subnetIds() { + return this.subnetIds; + } + + /** + * Set the subnetIds property: A list of VPC subnet IDs. + * + * @param subnetIds the subnetIds value to set. + * @return the VpcConfigAutoGenerated object itself. + */ + public VpcConfigAutoGenerated withSubnetIds(List subnetIds) { + this.subnetIds = subnetIds; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeBooleanField("ipv6AllowedForDualStack", this.ipv6AllowedForDualStack); + jsonWriter.writeArrayField("securityGroupIds", this.securityGroupIds, + (writer, element) -> writer.writeString(element)); + jsonWriter.writeArrayField("subnetIds", this.subnetIds, (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of VpcConfigAutoGenerated from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of VpcConfigAutoGenerated if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the VpcConfigAutoGenerated. + */ + public static VpcConfigAutoGenerated fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + VpcConfigAutoGenerated deserializedVpcConfigAutoGenerated = new VpcConfigAutoGenerated(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("ipv6AllowedForDualStack".equals(fieldName)) { + deserializedVpcConfigAutoGenerated.ipv6AllowedForDualStack + = reader.getNullable(JsonReader::getBoolean); + } else if ("securityGroupIds".equals(fieldName)) { + List securityGroupIds = reader.readArray(reader1 -> reader1.getString()); + deserializedVpcConfigAutoGenerated.securityGroupIds = securityGroupIds; + } else if ("subnetIds".equals(fieldName)) { + List subnetIds = reader.readArray(reader1 -> reader1.getString()); + deserializedVpcConfigAutoGenerated.subnetIds = subnetIds; + } else { + reader.skipChildren(); + } + } + + return deserializedVpcConfigAutoGenerated; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/VpcConfigResponse.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/VpcConfigResponse.java new file mode 100644 index 000000000000..f6dbc93cb08e --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/VpcConfigResponse.java @@ -0,0 +1,297 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Definition of VpcConfigResponse. + */ +@Fluent +public final class VpcConfigResponse implements JsonSerializable { + /* + *

The cluster security group that was created by Amazon EKS for the cluster. Managed node groups use this + * security group for control-plane-to-data-plane communication.

+ */ + private String clusterSecurityGroupId; + + /* + *

This parameter indicates whether the Amazon EKS private API server endpoint is enabled. If the Amazon EKS + * private API server endpoint is enabled, Kubernetes API requests that originate from within your cluster's VPC use + * the private VPC endpoint instead of traversing the internet. If this value is disabled and you have nodes or + * Fargate pods in the cluster, then ensure that publicAccessCidrs includes the necessary CIDR blocks + * for communication with the nodes or Fargate pods. For more information, see Amazon EKS cluster endpoint access + * control in the Amazon EKS User Guide .

+ */ + private Boolean endpointPrivateAccess; + + /* + *

Whether the public API server endpoint is enabled.

+ */ + private Boolean endpointPublicAccess; + + /* + *

The CIDR blocks that are allowed access to your cluster's public Kubernetes API server endpoint.

+ */ + private List publicAccessCidrs; + + /* + *

The security groups associated with the cross-account elastic network interfaces that are used to allow + * communication between your nodes and the Kubernetes control plane.

+ */ + private List securityGroupIds; + + /* + *

The subnets associated with your cluster.

+ */ + private List subnetIds; + + /* + *

The VPC associated with your cluster.

+ */ + private String vpcId; + + /** + * Creates an instance of VpcConfigResponse class. + */ + public VpcConfigResponse() { + } + + /** + * Get the clusterSecurityGroupId property: <p>The cluster security group that was created by Amazon EKS for + * the cluster. Managed node groups use this security group for control-plane-to-data-plane + * communication.</p>. + * + * @return the clusterSecurityGroupId value. + */ + public String clusterSecurityGroupId() { + return this.clusterSecurityGroupId; + } + + /** + * Set the clusterSecurityGroupId property: <p>The cluster security group that was created by Amazon EKS for + * the cluster. Managed node groups use this security group for control-plane-to-data-plane + * communication.</p>. + * + * @param clusterSecurityGroupId the clusterSecurityGroupId value to set. + * @return the VpcConfigResponse object itself. + */ + public VpcConfigResponse withClusterSecurityGroupId(String clusterSecurityGroupId) { + this.clusterSecurityGroupId = clusterSecurityGroupId; + return this; + } + + /** + * Get the endpointPrivateAccess property: <p>This parameter indicates whether the Amazon EKS private API + * server endpoint is enabled. If the Amazon EKS private API server endpoint is enabled, Kubernetes API requests + * that originate from within your cluster's VPC use the private VPC endpoint instead of traversing the internet. If + * this value is disabled and you have nodes or Fargate pods in the cluster, then ensure that + * <code>publicAccessCidrs</code> includes the necessary CIDR blocks for communication with the nodes or + * Fargate pods. For more information, see <a + * href='https://docs.aws.amazon.com/eks/latest/userguide/cluster-endpoint.html'>Amazon EKS cluster endpoint + * access control</a> in the <i> <i>Amazon EKS User Guide</i> </i>.</p>. + * + * @return the endpointPrivateAccess value. + */ + public Boolean endpointPrivateAccess() { + return this.endpointPrivateAccess; + } + + /** + * Set the endpointPrivateAccess property: <p>This parameter indicates whether the Amazon EKS private API + * server endpoint is enabled. If the Amazon EKS private API server endpoint is enabled, Kubernetes API requests + * that originate from within your cluster's VPC use the private VPC endpoint instead of traversing the internet. If + * this value is disabled and you have nodes or Fargate pods in the cluster, then ensure that + * <code>publicAccessCidrs</code> includes the necessary CIDR blocks for communication with the nodes or + * Fargate pods. For more information, see <a + * href='https://docs.aws.amazon.com/eks/latest/userguide/cluster-endpoint.html'>Amazon EKS cluster endpoint + * access control</a> in the <i> <i>Amazon EKS User Guide</i> </i>.</p>. + * + * @param endpointPrivateAccess the endpointPrivateAccess value to set. + * @return the VpcConfigResponse object itself. + */ + public VpcConfigResponse withEndpointPrivateAccess(Boolean endpointPrivateAccess) { + this.endpointPrivateAccess = endpointPrivateAccess; + return this; + } + + /** + * Get the endpointPublicAccess property: <p>Whether the public API server endpoint is enabled.</p>. + * + * @return the endpointPublicAccess value. + */ + public Boolean endpointPublicAccess() { + return this.endpointPublicAccess; + } + + /** + * Set the endpointPublicAccess property: <p>Whether the public API server endpoint is enabled.</p>. + * + * @param endpointPublicAccess the endpointPublicAccess value to set. + * @return the VpcConfigResponse object itself. + */ + public VpcConfigResponse withEndpointPublicAccess(Boolean endpointPublicAccess) { + this.endpointPublicAccess = endpointPublicAccess; + return this; + } + + /** + * Get the publicAccessCidrs property: <p>The CIDR blocks that are allowed access to your cluster's public + * Kubernetes API server endpoint.</p>. + * + * @return the publicAccessCidrs value. + */ + public List publicAccessCidrs() { + return this.publicAccessCidrs; + } + + /** + * Set the publicAccessCidrs property: <p>The CIDR blocks that are allowed access to your cluster's public + * Kubernetes API server endpoint.</p>. + * + * @param publicAccessCidrs the publicAccessCidrs value to set. + * @return the VpcConfigResponse object itself. + */ + public VpcConfigResponse withPublicAccessCidrs(List publicAccessCidrs) { + this.publicAccessCidrs = publicAccessCidrs; + return this; + } + + /** + * Get the securityGroupIds property: <p>The security groups associated with the cross-account elastic network + * interfaces that are used to allow communication between your nodes and the Kubernetes control plane.</p>. + * + * @return the securityGroupIds value. + */ + public List securityGroupIds() { + return this.securityGroupIds; + } + + /** + * Set the securityGroupIds property: <p>The security groups associated with the cross-account elastic network + * interfaces that are used to allow communication between your nodes and the Kubernetes control plane.</p>. + * + * @param securityGroupIds the securityGroupIds value to set. + * @return the VpcConfigResponse object itself. + */ + public VpcConfigResponse withSecurityGroupIds(List securityGroupIds) { + this.securityGroupIds = securityGroupIds; + return this; + } + + /** + * Get the subnetIds property: <p>The subnets associated with your cluster.</p>. + * + * @return the subnetIds value. + */ + public List subnetIds() { + return this.subnetIds; + } + + /** + * Set the subnetIds property: <p>The subnets associated with your cluster.</p>. + * + * @param subnetIds the subnetIds value to set. + * @return the VpcConfigResponse object itself. + */ + public VpcConfigResponse withSubnetIds(List subnetIds) { + this.subnetIds = subnetIds; + return this; + } + + /** + * Get the vpcId property: <p>The VPC associated with your cluster.</p>. + * + * @return the vpcId value. + */ + public String vpcId() { + return this.vpcId; + } + + /** + * Set the vpcId property: <p>The VPC associated with your cluster.</p>. + * + * @param vpcId the vpcId value to set. + * @return the VpcConfigResponse object itself. + */ + public VpcConfigResponse withVpcId(String vpcId) { + this.vpcId = vpcId; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("clusterSecurityGroupId", this.clusterSecurityGroupId); + jsonWriter.writeBooleanField("endpointPrivateAccess", this.endpointPrivateAccess); + jsonWriter.writeBooleanField("endpointPublicAccess", this.endpointPublicAccess); + jsonWriter.writeArrayField("publicAccessCidrs", this.publicAccessCidrs, + (writer, element) -> writer.writeString(element)); + jsonWriter.writeArrayField("securityGroupIds", this.securityGroupIds, + (writer, element) -> writer.writeString(element)); + jsonWriter.writeArrayField("subnetIds", this.subnetIds, (writer, element) -> writer.writeString(element)); + jsonWriter.writeStringField("vpcId", this.vpcId); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of VpcConfigResponse from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of VpcConfigResponse if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the VpcConfigResponse. + */ + public static VpcConfigResponse fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + VpcConfigResponse deserializedVpcConfigResponse = new VpcConfigResponse(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("clusterSecurityGroupId".equals(fieldName)) { + deserializedVpcConfigResponse.clusterSecurityGroupId = reader.getString(); + } else if ("endpointPrivateAccess".equals(fieldName)) { + deserializedVpcConfigResponse.endpointPrivateAccess = reader.getNullable(JsonReader::getBoolean); + } else if ("endpointPublicAccess".equals(fieldName)) { + deserializedVpcConfigResponse.endpointPublicAccess = reader.getNullable(JsonReader::getBoolean); + } else if ("publicAccessCidrs".equals(fieldName)) { + List publicAccessCidrs = reader.readArray(reader1 -> reader1.getString()); + deserializedVpcConfigResponse.publicAccessCidrs = publicAccessCidrs; + } else if ("securityGroupIds".equals(fieldName)) { + List securityGroupIds = reader.readArray(reader1 -> reader1.getString()); + deserializedVpcConfigResponse.securityGroupIds = securityGroupIds; + } else if ("subnetIds".equals(fieldName)) { + List subnetIds = reader.readArray(reader1 -> reader1.getString()); + deserializedVpcConfigResponse.subnetIds = subnetIds; + } else if ("vpcId".equals(fieldName)) { + deserializedVpcConfigResponse.vpcId = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedVpcConfigResponse; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/VpcConfiguration.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/VpcConfiguration.java new file mode 100644 index 000000000000..db69658808eb --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/VpcConfiguration.java @@ -0,0 +1,95 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of VpcConfiguration. + */ +@Fluent +public final class VpcConfiguration implements JsonSerializable { + /* + * If this field is specified, this access point will only allow connections from the specified VPC ID. + */ + private String vpcId; + + /** + * Creates an instance of VpcConfiguration class. + */ + public VpcConfiguration() { + } + + /** + * Get the vpcId property: If this field is specified, this access point will only allow connections from the + * specified VPC ID. + * + * @return the vpcId value. + */ + public String vpcId() { + return this.vpcId; + } + + /** + * Set the vpcId property: If this field is specified, this access point will only allow connections from the + * specified VPC ID. + * + * @param vpcId the vpcId value to set. + * @return the VpcConfiguration object itself. + */ + public VpcConfiguration withVpcId(String vpcId) { + this.vpcId = vpcId; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("vpcId", this.vpcId); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of VpcConfiguration from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of VpcConfiguration if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the VpcConfiguration. + */ + public static VpcConfiguration fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + VpcConfiguration deserializedVpcConfiguration = new VpcConfiguration(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("vpcId".equals(fieldName)) { + deserializedVpcConfiguration.vpcId = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedVpcConfiguration; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/VpcDerivedInfo.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/VpcDerivedInfo.java new file mode 100644 index 000000000000..1437057ee12e --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/VpcDerivedInfo.java @@ -0,0 +1,191 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Definition of VPCDerivedInfo. + */ +@Fluent +public final class VpcDerivedInfo implements JsonSerializable { + /* + *

The list of Availability Zones associated with the VPC subnets.

+ */ + private List availabilityZones; + + /* + *

The list of security group IDs associated with the VPC endpoints for the domain.

+ */ + private List securityGroupIds; + + /* + *

A list of subnet IDs associated with the VPC endpoints for the domain.

+ */ + private List subnetIds; + + /* + *

The ID for your VPC. Amazon VPC generates this value when you create a VPC.

+ */ + private String vpcId; + + /** + * Creates an instance of VpcDerivedInfo class. + */ + public VpcDerivedInfo() { + } + + /** + * Get the availabilityZones property: <p>The list of Availability Zones associated with the VPC + * subnets.</p>. + * + * @return the availabilityZones value. + */ + public List availabilityZones() { + return this.availabilityZones; + } + + /** + * Set the availabilityZones property: <p>The list of Availability Zones associated with the VPC + * subnets.</p>. + * + * @param availabilityZones the availabilityZones value to set. + * @return the VpcDerivedInfo object itself. + */ + public VpcDerivedInfo withAvailabilityZones(List availabilityZones) { + this.availabilityZones = availabilityZones; + return this; + } + + /** + * Get the securityGroupIds property: <p>The list of security group IDs associated with the VPC endpoints for + * the domain.</p>. + * + * @return the securityGroupIds value. + */ + public List securityGroupIds() { + return this.securityGroupIds; + } + + /** + * Set the securityGroupIds property: <p>The list of security group IDs associated with the VPC endpoints for + * the domain.</p>. + * + * @param securityGroupIds the securityGroupIds value to set. + * @return the VpcDerivedInfo object itself. + */ + public VpcDerivedInfo withSecurityGroupIds(List securityGroupIds) { + this.securityGroupIds = securityGroupIds; + return this; + } + + /** + * Get the subnetIds property: <p>A list of subnet IDs associated with the VPC endpoints for the + * domain.</p>. + * + * @return the subnetIds value. + */ + public List subnetIds() { + return this.subnetIds; + } + + /** + * Set the subnetIds property: <p>A list of subnet IDs associated with the VPC endpoints for the + * domain.</p>. + * + * @param subnetIds the subnetIds value to set. + * @return the VpcDerivedInfo object itself. + */ + public VpcDerivedInfo withSubnetIds(List subnetIds) { + this.subnetIds = subnetIds; + return this; + } + + /** + * Get the vpcId property: <p>The ID for your VPC. Amazon VPC generates this value when you create a + * VPC.</p>. + * + * @return the vpcId value. + */ + public String vpcId() { + return this.vpcId; + } + + /** + * Set the vpcId property: <p>The ID for your VPC. Amazon VPC generates this value when you create a + * VPC.</p>. + * + * @param vpcId the vpcId value to set. + * @return the VpcDerivedInfo object itself. + */ + public VpcDerivedInfo withVpcId(String vpcId) { + this.vpcId = vpcId; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("availabilityZones", this.availabilityZones, + (writer, element) -> writer.writeString(element)); + jsonWriter.writeArrayField("securityGroupIds", this.securityGroupIds, + (writer, element) -> writer.writeString(element)); + jsonWriter.writeArrayField("subnetIds", this.subnetIds, (writer, element) -> writer.writeString(element)); + jsonWriter.writeStringField("vpcId", this.vpcId); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of VpcDerivedInfo from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of VpcDerivedInfo if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the VpcDerivedInfo. + */ + public static VpcDerivedInfo fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + VpcDerivedInfo deserializedVpcDerivedInfo = new VpcDerivedInfo(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("availabilityZones".equals(fieldName)) { + List availabilityZones = reader.readArray(reader1 -> reader1.getString()); + deserializedVpcDerivedInfo.availabilityZones = availabilityZones; + } else if ("securityGroupIds".equals(fieldName)) { + List securityGroupIds = reader.readArray(reader1 -> reader1.getString()); + deserializedVpcDerivedInfo.securityGroupIds = securityGroupIds; + } else if ("subnetIds".equals(fieldName)) { + List subnetIds = reader.readArray(reader1 -> reader1.getString()); + deserializedVpcDerivedInfo.subnetIds = subnetIds; + } else if ("vpcId".equals(fieldName)) { + deserializedVpcDerivedInfo.vpcId = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedVpcDerivedInfo; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/VpcEndpointType.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/VpcEndpointType.java new file mode 100644 index 000000000000..6f42718947ed --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/VpcEndpointType.java @@ -0,0 +1,56 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * VpcEndpointType enum. + */ +public final class VpcEndpointType extends ExpandableStringEnum { + /** + * Static value Gateway for VpcEndpointType. + */ + public static final VpcEndpointType GATEWAY = fromString("Gateway"); + + /** + * Static value GatewayLoadBalancer for VpcEndpointType. + */ + public static final VpcEndpointType GATEWAY_LOAD_BALANCER = fromString("GatewayLoadBalancer"); + + /** + * Static value Interface for VpcEndpointType. + */ + public static final VpcEndpointType INTERFACE = fromString("Interface"); + + /** + * Creates a new instance of VpcEndpointType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public VpcEndpointType() { + } + + /** + * Creates or finds a VpcEndpointType from its string representation. + * + * @param name a name to look for. + * @return the corresponding VpcEndpointType. + */ + public static VpcEndpointType fromString(String name) { + return fromString(name, VpcEndpointType.class); + } + + /** + * Gets known VpcEndpointType values. + * + * @return known VpcEndpointType values. + */ + public static Collection values() { + return values(VpcEndpointType.class); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/VpcSecurityGroupMembership.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/VpcSecurityGroupMembership.java new file mode 100644 index 000000000000..61d484524eac --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/VpcSecurityGroupMembership.java @@ -0,0 +1,121 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of VpcSecurityGroupMembership. + */ +@Fluent +public final class VpcSecurityGroupMembership implements JsonSerializable { + /* + *

The status of the VPC security group.

+ */ + private String status; + + /* + *

The VPC security group ID.

+ */ + private String vpcSecurityGroupId; + + /** + * Creates an instance of VpcSecurityGroupMembership class. + */ + public VpcSecurityGroupMembership() { + } + + /** + * Get the status property: <p>The status of the VPC security group.</p>. + * + * @return the status value. + */ + public String status() { + return this.status; + } + + /** + * Set the status property: <p>The status of the VPC security group.</p>. + * + * @param status the status value to set. + * @return the VpcSecurityGroupMembership object itself. + */ + public VpcSecurityGroupMembership withStatus(String status) { + this.status = status; + return this; + } + + /** + * Get the vpcSecurityGroupId property: <p>The VPC security group ID.</p>. + * + * @return the vpcSecurityGroupId value. + */ + public String vpcSecurityGroupId() { + return this.vpcSecurityGroupId; + } + + /** + * Set the vpcSecurityGroupId property: <p>The VPC security group ID.</p>. + * + * @param vpcSecurityGroupId the vpcSecurityGroupId value to set. + * @return the VpcSecurityGroupMembership object itself. + */ + public VpcSecurityGroupMembership withVpcSecurityGroupId(String vpcSecurityGroupId) { + this.vpcSecurityGroupId = vpcSecurityGroupId; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("status", this.status); + jsonWriter.writeStringField("vpcSecurityGroupId", this.vpcSecurityGroupId); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of VpcSecurityGroupMembership from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of VpcSecurityGroupMembership if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IOException If an error occurs while reading the VpcSecurityGroupMembership. + */ + public static VpcSecurityGroupMembership fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + VpcSecurityGroupMembership deserializedVpcSecurityGroupMembership = new VpcSecurityGroupMembership(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("status".equals(fieldName)) { + deserializedVpcSecurityGroupMembership.status = reader.getString(); + } else if ("vpcSecurityGroupId".equals(fieldName)) { + deserializedVpcSecurityGroupMembership.vpcSecurityGroupId = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedVpcSecurityGroupMembership; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/WafWebAclSummaries.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/WafWebAclSummaries.java new file mode 100644 index 000000000000..874a67aaf676 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/WafWebAclSummaries.java @@ -0,0 +1,157 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** + * Resource collection API of WafWebAclSummaries. + */ +public interface WafWebAclSummaries { + /** + * List WafWebACLSummary resources by subscription ID. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a WafWebACLSummary list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable list(); + + /** + * List WafWebACLSummary resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a WafWebACLSummary list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable list(Context context); + + /** + * List WafWebACLSummary resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a WafWebACLSummary list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * List WafWebACLSummary resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a WafWebACLSummary list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Get a WafWebACLSummary. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of WafWebACLSummary. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a WafWebACLSummary along with {@link Response}. + */ + Response getByResourceGroupWithResponse(String resourceGroupName, String name, Context context); + + /** + * Get a WafWebACLSummary. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of WafWebACLSummary. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a WafWebACLSummary. + */ + WafWebAclSummary getByResourceGroup(String resourceGroupName, String name); + + /** + * Delete a WafWebACLSummary. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of WafWebACLSummary. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByResourceGroup(String resourceGroupName, String name); + + /** + * Delete a WafWebACLSummary. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of WafWebACLSummary. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String name, Context context); + + /** + * Get a WafWebACLSummary. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a WafWebACLSummary along with {@link Response}. + */ + WafWebAclSummary getById(String id); + + /** + * Get a WafWebACLSummary. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a WafWebACLSummary along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Delete a WafWebACLSummary. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteById(String id); + + /** + * Delete a WafWebACLSummary. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new WafWebAclSummary resource. + * + * @param name resource name. + * @return the first stage of the new WafWebAclSummary definition. + */ + WafWebAclSummary.DefinitionStages.Blank define(String name); +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/WafWebAclSummary.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/WafWebAclSummary.java new file mode 100644 index 000000000000..b1385a89fe1a --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/WafWebAclSummary.java @@ -0,0 +1,252 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.awsconnector.fluent.models.WafWebAclSummaryInner; +import java.util.Map; + +/** + * An immutable client-side representation of WafWebAclSummary. + */ +public interface WafWebAclSummary { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the location property: The geo-location where the resource lives. + * + * @return the location value. + */ + String location(); + + /** + * Gets the tags property: Resource tags. + * + * @return the tags value. + */ + Map tags(); + + /** + * Gets the properties property: The resource-specific properties for this resource. + * + * @return the properties value. + */ + WafWebAclSummaryProperties properties(); + + /** + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the region of the resource. + * + * @return the region of the resource. + */ + Region region(); + + /** + * Gets the name of the resource region. + * + * @return the name of the resource region. + */ + String regionName(); + + /** + * Gets the name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + + /** + * Gets the inner com.azure.resourcemanager.awsconnector.fluent.models.WafWebAclSummaryInner object. + * + * @return the inner object. + */ + WafWebAclSummaryInner innerModel(); + + /** + * The entirety of the WafWebAclSummary definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithLocation, + DefinitionStages.WithResourceGroup, DefinitionStages.WithCreate { + } + + /** + * The WafWebAclSummary definition stages. + */ + interface DefinitionStages { + /** + * The first stage of the WafWebAclSummary definition. + */ + interface Blank extends WithLocation { + } + + /** + * The stage of the WafWebAclSummary definition allowing to specify location. + */ + interface WithLocation { + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithResourceGroup withRegion(Region location); + + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithResourceGroup withRegion(String location); + } + + /** + * The stage of the WafWebAclSummary definition allowing to specify parent resource. + */ + interface WithResourceGroup { + /** + * Specifies resourceGroupName. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @return the next definition stage. + */ + WithCreate withExistingResourceGroup(String resourceGroupName); + } + + /** + * The stage of the WafWebAclSummary 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.WithProperties { + /** + * Executes the create request. + * + * @return the created resource. + */ + WafWebAclSummary create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + WafWebAclSummary create(Context context); + } + + /** + * The stage of the WafWebAclSummary definition allowing to specify tags. + */ + interface WithTags { + /** + * Specifies the tags property: Resource tags.. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + WithCreate withTags(Map tags); + } + + /** + * The stage of the WafWebAclSummary definition allowing to specify properties. + */ + interface WithProperties { + /** + * Specifies the properties property: The resource-specific properties for this resource.. + * + * @param properties The resource-specific properties for this resource. + * @return the next definition stage. + */ + WithCreate withProperties(WafWebAclSummaryProperties properties); + } + } + + /** + * Begins update for the WafWebAclSummary resource. + * + * @return the stage of resource update. + */ + WafWebAclSummary.Update update(); + + /** + * The template for WafWebAclSummary update. + */ + interface Update extends UpdateStages.WithTags { + /** + * Executes the update request. + * + * @return the updated resource. + */ + WafWebAclSummary apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + WafWebAclSummary apply(Context context); + } + + /** + * The WafWebAclSummary update stages. + */ + interface UpdateStages { + /** + * The stage of the WafWebAclSummary update allowing to specify tags. + */ + interface WithTags { + /** + * Specifies the tags property: Resource tags.. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + Update withTags(Map tags); + } + } + + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + WafWebAclSummary refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + WafWebAclSummary refresh(Context context); +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/WafWebAclSummaryListResult.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/WafWebAclSummaryListResult.java new file mode 100644 index 000000000000..8522ebbe4d7b --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/WafWebAclSummaryListResult.java @@ -0,0 +1,136 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.awsconnector.fluent.models.WafWebAclSummaryInner; +import java.io.IOException; +import java.util.List; + +/** + * The response of a WafWebACLSummary list operation. + */ +@Fluent +public final class WafWebAclSummaryListResult implements JsonSerializable { + /* + * The WafWebACLSummary items on this page + */ + private List value; + + /* + * The link to the next page of items + */ + private String nextLink; + + /** + * Creates an instance of WafWebAclSummaryListResult class. + */ + public WafWebAclSummaryListResult() { + } + + /** + * Get the value property: The WafWebACLSummary items on this page. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The WafWebACLSummary items on this page. + * + * @param value the value value to set. + * @return the WafWebAclSummaryListResult object itself. + */ + public WafWebAclSummaryListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The link to the next page of items. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: The link to the next page of items. + * + * @param nextLink the nextLink value to set. + * @return the WafWebAclSummaryListResult object itself. + */ + public WafWebAclSummaryListResult withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property value in model WafWebAclSummaryListResult")); + } else { + value().forEach(e -> e.validate()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(WafWebAclSummaryListResult.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("nextLink", this.nextLink); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of WafWebAclSummaryListResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of WafWebAclSummaryListResult if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the WafWebAclSummaryListResult. + */ + public static WafWebAclSummaryListResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + WafWebAclSummaryListResult deserializedWafWebAclSummaryListResult = new WafWebAclSummaryListResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> WafWebAclSummaryInner.fromJson(reader1)); + deserializedWafWebAclSummaryListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedWafWebAclSummaryListResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedWafWebAclSummaryListResult; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/WafWebAclSummaryProperties.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/WafWebAclSummaryProperties.java new file mode 100644 index 000000000000..973e213bc20a --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/WafWebAclSummaryProperties.java @@ -0,0 +1,312 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.Map; + +/** + * Definition of WafWebACLSummary. + */ +@Fluent +public final class WafWebAclSummaryProperties implements JsonSerializable { + /* + * AWS Properties + */ + private AwsWafWebAclSummaryProperties awsProperties; + + /* + * Public Cloud Connectors Resource ID + */ + private String publicCloudConnectorsResourceId; + + /* + * AWS Account ID + */ + private String awsAccountId; + + /* + * Amazon Resource Name (ARN) + */ + private String arn; + + /* + * Public Cloud Resource Name + */ + private String publicCloudResourceName; + + /* + * AWS Source Schema + */ + private String awsSourceSchema; + + /* + * AWS Region + */ + private String awsRegion; + + /* + * AWS Tags + */ + private Map awsTags; + + /* + * The status of the last operation. + */ + private ProvisioningState provisioningState; + + /** + * Creates an instance of WafWebAclSummaryProperties class. + */ + public WafWebAclSummaryProperties() { + } + + /** + * Get the awsProperties property: AWS Properties. + * + * @return the awsProperties value. + */ + public AwsWafWebAclSummaryProperties awsProperties() { + return this.awsProperties; + } + + /** + * Set the awsProperties property: AWS Properties. + * + * @param awsProperties the awsProperties value to set. + * @return the WafWebAclSummaryProperties object itself. + */ + public WafWebAclSummaryProperties withAwsProperties(AwsWafWebAclSummaryProperties awsProperties) { + this.awsProperties = awsProperties; + return this; + } + + /** + * Get the publicCloudConnectorsResourceId property: Public Cloud Connectors Resource ID. + * + * @return the publicCloudConnectorsResourceId value. + */ + public String publicCloudConnectorsResourceId() { + return this.publicCloudConnectorsResourceId; + } + + /** + * Set the publicCloudConnectorsResourceId property: Public Cloud Connectors Resource ID. + * + * @param publicCloudConnectorsResourceId the publicCloudConnectorsResourceId value to set. + * @return the WafWebAclSummaryProperties object itself. + */ + public WafWebAclSummaryProperties withPublicCloudConnectorsResourceId(String publicCloudConnectorsResourceId) { + this.publicCloudConnectorsResourceId = publicCloudConnectorsResourceId; + return this; + } + + /** + * Get the awsAccountId property: AWS Account ID. + * + * @return the awsAccountId value. + */ + public String awsAccountId() { + return this.awsAccountId; + } + + /** + * Set the awsAccountId property: AWS Account ID. + * + * @param awsAccountId the awsAccountId value to set. + * @return the WafWebAclSummaryProperties object itself. + */ + public WafWebAclSummaryProperties withAwsAccountId(String awsAccountId) { + this.awsAccountId = awsAccountId; + return this; + } + + /** + * Get the arn property: Amazon Resource Name (ARN). + * + * @return the arn value. + */ + public String arn() { + return this.arn; + } + + /** + * Set the arn property: Amazon Resource Name (ARN). + * + * @param arn the arn value to set. + * @return the WafWebAclSummaryProperties object itself. + */ + public WafWebAclSummaryProperties withArn(String arn) { + this.arn = arn; + return this; + } + + /** + * Get the publicCloudResourceName property: Public Cloud Resource Name. + * + * @return the publicCloudResourceName value. + */ + public String publicCloudResourceName() { + return this.publicCloudResourceName; + } + + /** + * Set the publicCloudResourceName property: Public Cloud Resource Name. + * + * @param publicCloudResourceName the publicCloudResourceName value to set. + * @return the WafWebAclSummaryProperties object itself. + */ + public WafWebAclSummaryProperties withPublicCloudResourceName(String publicCloudResourceName) { + this.publicCloudResourceName = publicCloudResourceName; + return this; + } + + /** + * Get the awsSourceSchema property: AWS Source Schema. + * + * @return the awsSourceSchema value. + */ + public String awsSourceSchema() { + return this.awsSourceSchema; + } + + /** + * Set the awsSourceSchema property: AWS Source Schema. + * + * @param awsSourceSchema the awsSourceSchema value to set. + * @return the WafWebAclSummaryProperties object itself. + */ + public WafWebAclSummaryProperties withAwsSourceSchema(String awsSourceSchema) { + this.awsSourceSchema = awsSourceSchema; + return this; + } + + /** + * Get the awsRegion property: AWS Region. + * + * @return the awsRegion value. + */ + public String awsRegion() { + return this.awsRegion; + } + + /** + * Set the awsRegion property: AWS Region. + * + * @param awsRegion the awsRegion value to set. + * @return the WafWebAclSummaryProperties object itself. + */ + public WafWebAclSummaryProperties withAwsRegion(String awsRegion) { + this.awsRegion = awsRegion; + return this; + } + + /** + * Get the awsTags property: AWS Tags. + * + * @return the awsTags value. + */ + public Map awsTags() { + return this.awsTags; + } + + /** + * Set the awsTags property: AWS Tags. + * + * @param awsTags the awsTags value to set. + * @return the WafWebAclSummaryProperties object itself. + */ + public WafWebAclSummaryProperties withAwsTags(Map awsTags) { + this.awsTags = awsTags; + return this; + } + + /** + * Get the provisioningState property: The status of the last operation. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (awsProperties() != null) { + awsProperties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("awsProperties", this.awsProperties); + jsonWriter.writeStringField("publicCloudConnectorsResourceId", this.publicCloudConnectorsResourceId); + jsonWriter.writeStringField("awsAccountId", this.awsAccountId); + jsonWriter.writeStringField("arn", this.arn); + jsonWriter.writeStringField("publicCloudResourceName", this.publicCloudResourceName); + jsonWriter.writeStringField("awsSourceSchema", this.awsSourceSchema); + jsonWriter.writeStringField("awsRegion", this.awsRegion); + jsonWriter.writeMapField("awsTags", this.awsTags, (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of WafWebAclSummaryProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of WafWebAclSummaryProperties if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IOException If an error occurs while reading the WafWebAclSummaryProperties. + */ + public static WafWebAclSummaryProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + WafWebAclSummaryProperties deserializedWafWebAclSummaryProperties = new WafWebAclSummaryProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("awsProperties".equals(fieldName)) { + deserializedWafWebAclSummaryProperties.awsProperties + = AwsWafWebAclSummaryProperties.fromJson(reader); + } else if ("publicCloudConnectorsResourceId".equals(fieldName)) { + deserializedWafWebAclSummaryProperties.publicCloudConnectorsResourceId = reader.getString(); + } else if ("awsAccountId".equals(fieldName)) { + deserializedWafWebAclSummaryProperties.awsAccountId = reader.getString(); + } else if ("arn".equals(fieldName)) { + deserializedWafWebAclSummaryProperties.arn = reader.getString(); + } else if ("publicCloudResourceName".equals(fieldName)) { + deserializedWafWebAclSummaryProperties.publicCloudResourceName = reader.getString(); + } else if ("awsSourceSchema".equals(fieldName)) { + deserializedWafWebAclSummaryProperties.awsSourceSchema = reader.getString(); + } else if ("awsRegion".equals(fieldName)) { + deserializedWafWebAclSummaryProperties.awsRegion = reader.getString(); + } else if ("awsTags".equals(fieldName)) { + Map awsTags = reader.readMap(reader1 -> reader1.getString()); + deserializedWafWebAclSummaryProperties.awsTags = awsTags; + } else if ("provisioningState".equals(fieldName)) { + deserializedWafWebAclSummaryProperties.provisioningState + = ProvisioningState.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedWafWebAclSummaryProperties; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/WafWebAclSummaryTagsUpdate.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/WafWebAclSummaryTagsUpdate.java new file mode 100644 index 000000000000..037f962b94a8 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/WafWebAclSummaryTagsUpdate.java @@ -0,0 +1,95 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.Map; + +/** + * The type used for updating tags in WafWebACLSummary resources. + */ +@Fluent +public final class WafWebAclSummaryTagsUpdate implements JsonSerializable { + /* + * Resource tags. + */ + private Map tags; + + /** + * Creates an instance of WafWebAclSummaryTagsUpdate class. + */ + public WafWebAclSummaryTagsUpdate() { + } + + /** + * Get the tags property: Resource tags. + * + * @return the tags value. + */ + public Map tags() { + return this.tags; + } + + /** + * Set the tags property: Resource tags. + * + * @param tags the tags value to set. + * @return the WafWebAclSummaryTagsUpdate object itself. + */ + public WafWebAclSummaryTagsUpdate withTags(Map tags) { + this.tags = tags; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeMapField("tags", this.tags, (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of WafWebAclSummaryTagsUpdate from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of WafWebAclSummaryTagsUpdate if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IOException If an error occurs while reading the WafWebAclSummaryTagsUpdate. + */ + public static WafWebAclSummaryTagsUpdate fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + WafWebAclSummaryTagsUpdate deserializedWafWebAclSummaryTagsUpdate = new WafWebAclSummaryTagsUpdate(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedWafWebAclSummaryTagsUpdate.tags = tags; + } else { + reader.skipChildren(); + } + } + + return deserializedWafWebAclSummaryTagsUpdate; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/Wafv2LoggingConfiguration.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/Wafv2LoggingConfiguration.java new file mode 100644 index 000000000000..98bafc66ba38 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/Wafv2LoggingConfiguration.java @@ -0,0 +1,252 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.awsconnector.fluent.models.Wafv2LoggingConfigurationInner; +import java.util.Map; + +/** + * An immutable client-side representation of Wafv2LoggingConfiguration. + */ +public interface Wafv2LoggingConfiguration { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the location property: The geo-location where the resource lives. + * + * @return the location value. + */ + String location(); + + /** + * Gets the tags property: Resource tags. + * + * @return the tags value. + */ + Map tags(); + + /** + * Gets the properties property: The resource-specific properties for this resource. + * + * @return the properties value. + */ + Wafv2LoggingConfigurationProperties properties(); + + /** + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the region of the resource. + * + * @return the region of the resource. + */ + Region region(); + + /** + * Gets the name of the resource region. + * + * @return the name of the resource region. + */ + String regionName(); + + /** + * Gets the name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + + /** + * Gets the inner com.azure.resourcemanager.awsconnector.fluent.models.Wafv2LoggingConfigurationInner object. + * + * @return the inner object. + */ + Wafv2LoggingConfigurationInner innerModel(); + + /** + * The entirety of the Wafv2LoggingConfiguration definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithLocation, + DefinitionStages.WithResourceGroup, DefinitionStages.WithCreate { + } + + /** + * The Wafv2LoggingConfiguration definition stages. + */ + interface DefinitionStages { + /** + * The first stage of the Wafv2LoggingConfiguration definition. + */ + interface Blank extends WithLocation { + } + + /** + * The stage of the Wafv2LoggingConfiguration definition allowing to specify location. + */ + interface WithLocation { + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithResourceGroup withRegion(Region location); + + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithResourceGroup withRegion(String location); + } + + /** + * The stage of the Wafv2LoggingConfiguration definition allowing to specify parent resource. + */ + interface WithResourceGroup { + /** + * Specifies resourceGroupName. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @return the next definition stage. + */ + WithCreate withExistingResourceGroup(String resourceGroupName); + } + + /** + * The stage of the Wafv2LoggingConfiguration 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.WithProperties { + /** + * Executes the create request. + * + * @return the created resource. + */ + Wafv2LoggingConfiguration create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + Wafv2LoggingConfiguration create(Context context); + } + + /** + * The stage of the Wafv2LoggingConfiguration definition allowing to specify tags. + */ + interface WithTags { + /** + * Specifies the tags property: Resource tags.. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + WithCreate withTags(Map tags); + } + + /** + * The stage of the Wafv2LoggingConfiguration definition allowing to specify properties. + */ + interface WithProperties { + /** + * Specifies the properties property: The resource-specific properties for this resource.. + * + * @param properties The resource-specific properties for this resource. + * @return the next definition stage. + */ + WithCreate withProperties(Wafv2LoggingConfigurationProperties properties); + } + } + + /** + * Begins update for the Wafv2LoggingConfiguration resource. + * + * @return the stage of resource update. + */ + Wafv2LoggingConfiguration.Update update(); + + /** + * The template for Wafv2LoggingConfiguration update. + */ + interface Update extends UpdateStages.WithTags { + /** + * Executes the update request. + * + * @return the updated resource. + */ + Wafv2LoggingConfiguration apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + Wafv2LoggingConfiguration apply(Context context); + } + + /** + * The Wafv2LoggingConfiguration update stages. + */ + interface UpdateStages { + /** + * The stage of the Wafv2LoggingConfiguration update allowing to specify tags. + */ + interface WithTags { + /** + * Specifies the tags property: Resource tags.. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + Update withTags(Map tags); + } + } + + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + Wafv2LoggingConfiguration refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + Wafv2LoggingConfiguration refresh(Context context); +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/Wafv2LoggingConfigurationListResult.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/Wafv2LoggingConfigurationListResult.java new file mode 100644 index 000000000000..184e43a6acd0 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/Wafv2LoggingConfigurationListResult.java @@ -0,0 +1,138 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.awsconnector.fluent.models.Wafv2LoggingConfigurationInner; +import java.io.IOException; +import java.util.List; + +/** + * The response of a Wafv2LoggingConfiguration list operation. + */ +@Fluent +public final class Wafv2LoggingConfigurationListResult + implements JsonSerializable { + /* + * The Wafv2LoggingConfiguration items on this page + */ + private List value; + + /* + * The link to the next page of items + */ + private String nextLink; + + /** + * Creates an instance of Wafv2LoggingConfigurationListResult class. + */ + public Wafv2LoggingConfigurationListResult() { + } + + /** + * Get the value property: The Wafv2LoggingConfiguration items on this page. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The Wafv2LoggingConfiguration items on this page. + * + * @param value the value value to set. + * @return the Wafv2LoggingConfigurationListResult object itself. + */ + public Wafv2LoggingConfigurationListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The link to the next page of items. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: The link to the next page of items. + * + * @param nextLink the nextLink value to set. + * @return the Wafv2LoggingConfigurationListResult object itself. + */ + public Wafv2LoggingConfigurationListResult withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property value in model Wafv2LoggingConfigurationListResult")); + } else { + value().forEach(e -> e.validate()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(Wafv2LoggingConfigurationListResult.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("nextLink", this.nextLink); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of Wafv2LoggingConfigurationListResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of Wafv2LoggingConfigurationListResult if the JsonReader was pointing to an instance of it, + * or null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the Wafv2LoggingConfigurationListResult. + */ + public static Wafv2LoggingConfigurationListResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + Wafv2LoggingConfigurationListResult deserializedWafv2LoggingConfigurationListResult + = new Wafv2LoggingConfigurationListResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> Wafv2LoggingConfigurationInner.fromJson(reader1)); + deserializedWafv2LoggingConfigurationListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedWafv2LoggingConfigurationListResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedWafv2LoggingConfigurationListResult; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/Wafv2LoggingConfigurationProperties.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/Wafv2LoggingConfigurationProperties.java new file mode 100644 index 000000000000..0fda57f3ccb0 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/Wafv2LoggingConfigurationProperties.java @@ -0,0 +1,316 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.Map; + +/** + * Definition of Wafv2LoggingConfiguration. + */ +@Fluent +public final class Wafv2LoggingConfigurationProperties + implements JsonSerializable { + /* + * AWS Properties + */ + private AwsWafv2LoggingConfigurationProperties awsProperties; + + /* + * Public Cloud Connectors Resource ID + */ + private String publicCloudConnectorsResourceId; + + /* + * AWS Account ID + */ + private String awsAccountId; + + /* + * Amazon Resource Name (ARN) + */ + private String arn; + + /* + * Public Cloud Resource Name + */ + private String publicCloudResourceName; + + /* + * AWS Source Schema + */ + private String awsSourceSchema; + + /* + * AWS Region + */ + private String awsRegion; + + /* + * AWS Tags + */ + private Map awsTags; + + /* + * The status of the last operation. + */ + private ProvisioningState provisioningState; + + /** + * Creates an instance of Wafv2LoggingConfigurationProperties class. + */ + public Wafv2LoggingConfigurationProperties() { + } + + /** + * Get the awsProperties property: AWS Properties. + * + * @return the awsProperties value. + */ + public AwsWafv2LoggingConfigurationProperties awsProperties() { + return this.awsProperties; + } + + /** + * Set the awsProperties property: AWS Properties. + * + * @param awsProperties the awsProperties value to set. + * @return the Wafv2LoggingConfigurationProperties object itself. + */ + public Wafv2LoggingConfigurationProperties withAwsProperties(AwsWafv2LoggingConfigurationProperties awsProperties) { + this.awsProperties = awsProperties; + return this; + } + + /** + * Get the publicCloudConnectorsResourceId property: Public Cloud Connectors Resource ID. + * + * @return the publicCloudConnectorsResourceId value. + */ + public String publicCloudConnectorsResourceId() { + return this.publicCloudConnectorsResourceId; + } + + /** + * Set the publicCloudConnectorsResourceId property: Public Cloud Connectors Resource ID. + * + * @param publicCloudConnectorsResourceId the publicCloudConnectorsResourceId value to set. + * @return the Wafv2LoggingConfigurationProperties object itself. + */ + public Wafv2LoggingConfigurationProperties + withPublicCloudConnectorsResourceId(String publicCloudConnectorsResourceId) { + this.publicCloudConnectorsResourceId = publicCloudConnectorsResourceId; + return this; + } + + /** + * Get the awsAccountId property: AWS Account ID. + * + * @return the awsAccountId value. + */ + public String awsAccountId() { + return this.awsAccountId; + } + + /** + * Set the awsAccountId property: AWS Account ID. + * + * @param awsAccountId the awsAccountId value to set. + * @return the Wafv2LoggingConfigurationProperties object itself. + */ + public Wafv2LoggingConfigurationProperties withAwsAccountId(String awsAccountId) { + this.awsAccountId = awsAccountId; + return this; + } + + /** + * Get the arn property: Amazon Resource Name (ARN). + * + * @return the arn value. + */ + public String arn() { + return this.arn; + } + + /** + * Set the arn property: Amazon Resource Name (ARN). + * + * @param arn the arn value to set. + * @return the Wafv2LoggingConfigurationProperties object itself. + */ + public Wafv2LoggingConfigurationProperties withArn(String arn) { + this.arn = arn; + return this; + } + + /** + * Get the publicCloudResourceName property: Public Cloud Resource Name. + * + * @return the publicCloudResourceName value. + */ + public String publicCloudResourceName() { + return this.publicCloudResourceName; + } + + /** + * Set the publicCloudResourceName property: Public Cloud Resource Name. + * + * @param publicCloudResourceName the publicCloudResourceName value to set. + * @return the Wafv2LoggingConfigurationProperties object itself. + */ + public Wafv2LoggingConfigurationProperties withPublicCloudResourceName(String publicCloudResourceName) { + this.publicCloudResourceName = publicCloudResourceName; + return this; + } + + /** + * Get the awsSourceSchema property: AWS Source Schema. + * + * @return the awsSourceSchema value. + */ + public String awsSourceSchema() { + return this.awsSourceSchema; + } + + /** + * Set the awsSourceSchema property: AWS Source Schema. + * + * @param awsSourceSchema the awsSourceSchema value to set. + * @return the Wafv2LoggingConfigurationProperties object itself. + */ + public Wafv2LoggingConfigurationProperties withAwsSourceSchema(String awsSourceSchema) { + this.awsSourceSchema = awsSourceSchema; + return this; + } + + /** + * Get the awsRegion property: AWS Region. + * + * @return the awsRegion value. + */ + public String awsRegion() { + return this.awsRegion; + } + + /** + * Set the awsRegion property: AWS Region. + * + * @param awsRegion the awsRegion value to set. + * @return the Wafv2LoggingConfigurationProperties object itself. + */ + public Wafv2LoggingConfigurationProperties withAwsRegion(String awsRegion) { + this.awsRegion = awsRegion; + return this; + } + + /** + * Get the awsTags property: AWS Tags. + * + * @return the awsTags value. + */ + public Map awsTags() { + return this.awsTags; + } + + /** + * Set the awsTags property: AWS Tags. + * + * @param awsTags the awsTags value to set. + * @return the Wafv2LoggingConfigurationProperties object itself. + */ + public Wafv2LoggingConfigurationProperties withAwsTags(Map awsTags) { + this.awsTags = awsTags; + return this; + } + + /** + * Get the provisioningState property: The status of the last operation. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (awsProperties() != null) { + awsProperties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("awsProperties", this.awsProperties); + jsonWriter.writeStringField("publicCloudConnectorsResourceId", this.publicCloudConnectorsResourceId); + jsonWriter.writeStringField("awsAccountId", this.awsAccountId); + jsonWriter.writeStringField("arn", this.arn); + jsonWriter.writeStringField("publicCloudResourceName", this.publicCloudResourceName); + jsonWriter.writeStringField("awsSourceSchema", this.awsSourceSchema); + jsonWriter.writeStringField("awsRegion", this.awsRegion); + jsonWriter.writeMapField("awsTags", this.awsTags, (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of Wafv2LoggingConfigurationProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of Wafv2LoggingConfigurationProperties if the JsonReader was pointing to an instance of it, + * or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the Wafv2LoggingConfigurationProperties. + */ + public static Wafv2LoggingConfigurationProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + Wafv2LoggingConfigurationProperties deserializedWafv2LoggingConfigurationProperties + = new Wafv2LoggingConfigurationProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("awsProperties".equals(fieldName)) { + deserializedWafv2LoggingConfigurationProperties.awsProperties + = AwsWafv2LoggingConfigurationProperties.fromJson(reader); + } else if ("publicCloudConnectorsResourceId".equals(fieldName)) { + deserializedWafv2LoggingConfigurationProperties.publicCloudConnectorsResourceId + = reader.getString(); + } else if ("awsAccountId".equals(fieldName)) { + deserializedWafv2LoggingConfigurationProperties.awsAccountId = reader.getString(); + } else if ("arn".equals(fieldName)) { + deserializedWafv2LoggingConfigurationProperties.arn = reader.getString(); + } else if ("publicCloudResourceName".equals(fieldName)) { + deserializedWafv2LoggingConfigurationProperties.publicCloudResourceName = reader.getString(); + } else if ("awsSourceSchema".equals(fieldName)) { + deserializedWafv2LoggingConfigurationProperties.awsSourceSchema = reader.getString(); + } else if ("awsRegion".equals(fieldName)) { + deserializedWafv2LoggingConfigurationProperties.awsRegion = reader.getString(); + } else if ("awsTags".equals(fieldName)) { + Map awsTags = reader.readMap(reader1 -> reader1.getString()); + deserializedWafv2LoggingConfigurationProperties.awsTags = awsTags; + } else if ("provisioningState".equals(fieldName)) { + deserializedWafv2LoggingConfigurationProperties.provisioningState + = ProvisioningState.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedWafv2LoggingConfigurationProperties; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/Wafv2LoggingConfigurationTagsUpdate.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/Wafv2LoggingConfigurationTagsUpdate.java new file mode 100644 index 000000000000..04ac3e15af5a --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/Wafv2LoggingConfigurationTagsUpdate.java @@ -0,0 +1,97 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.Map; + +/** + * The type used for updating tags in Wafv2LoggingConfiguration resources. + */ +@Fluent +public final class Wafv2LoggingConfigurationTagsUpdate + implements JsonSerializable { + /* + * Resource tags. + */ + private Map tags; + + /** + * Creates an instance of Wafv2LoggingConfigurationTagsUpdate class. + */ + public Wafv2LoggingConfigurationTagsUpdate() { + } + + /** + * Get the tags property: Resource tags. + * + * @return the tags value. + */ + public Map tags() { + return this.tags; + } + + /** + * Set the tags property: Resource tags. + * + * @param tags the tags value to set. + * @return the Wafv2LoggingConfigurationTagsUpdate object itself. + */ + public Wafv2LoggingConfigurationTagsUpdate withTags(Map tags) { + this.tags = tags; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeMapField("tags", this.tags, (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of Wafv2LoggingConfigurationTagsUpdate from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of Wafv2LoggingConfigurationTagsUpdate if the JsonReader was pointing to an instance of it, + * or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the Wafv2LoggingConfigurationTagsUpdate. + */ + public static Wafv2LoggingConfigurationTagsUpdate fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + Wafv2LoggingConfigurationTagsUpdate deserializedWafv2LoggingConfigurationTagsUpdate + = new Wafv2LoggingConfigurationTagsUpdate(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedWafv2LoggingConfigurationTagsUpdate.tags = tags; + } else { + reader.skipChildren(); + } + } + + return deserializedWafv2LoggingConfigurationTagsUpdate; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/Wafv2LoggingConfigurations.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/Wafv2LoggingConfigurations.java new file mode 100644 index 000000000000..983f368931cf --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/Wafv2LoggingConfigurations.java @@ -0,0 +1,162 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** + * Resource collection API of Wafv2LoggingConfigurations. + */ +public interface Wafv2LoggingConfigurations { + /** + * List Wafv2LoggingConfiguration resources by subscription ID. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Wafv2LoggingConfiguration list operation as paginated response with + * {@link PagedIterable}. + */ + PagedIterable list(); + + /** + * List Wafv2LoggingConfiguration resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Wafv2LoggingConfiguration list operation as paginated response with + * {@link PagedIterable}. + */ + PagedIterable list(Context context); + + /** + * List Wafv2LoggingConfiguration resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Wafv2LoggingConfiguration list operation as paginated response with + * {@link PagedIterable}. + */ + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * List Wafv2LoggingConfiguration resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Wafv2LoggingConfiguration list operation as paginated response with + * {@link PagedIterable}. + */ + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Get a Wafv2LoggingConfiguration. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Wafv2LoggingConfiguration. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Wafv2LoggingConfiguration along with {@link Response}. + */ + Response getByResourceGroupWithResponse(String resourceGroupName, String name, + Context context); + + /** + * Get a Wafv2LoggingConfiguration. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Wafv2LoggingConfiguration. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Wafv2LoggingConfiguration. + */ + Wafv2LoggingConfiguration getByResourceGroup(String resourceGroupName, String name); + + /** + * Delete a Wafv2LoggingConfiguration. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Wafv2LoggingConfiguration. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByResourceGroup(String resourceGroupName, String name); + + /** + * Delete a Wafv2LoggingConfiguration. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of Wafv2LoggingConfiguration. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String name, Context context); + + /** + * Get a Wafv2LoggingConfiguration. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Wafv2LoggingConfiguration along with {@link Response}. + */ + Wafv2LoggingConfiguration getById(String id); + + /** + * Get a Wafv2LoggingConfiguration. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Wafv2LoggingConfiguration along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Delete a Wafv2LoggingConfiguration. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteById(String id); + + /** + * Delete a Wafv2LoggingConfiguration. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new Wafv2LoggingConfiguration resource. + * + * @param name resource name. + * @return the first stage of the new Wafv2LoggingConfiguration definition. + */ + Wafv2LoggingConfiguration.DefinitionStages.Blank define(String name); +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/Webhook.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/Webhook.java new file mode 100644 index 000000000000..6ef2d0e63155 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/Webhook.java @@ -0,0 +1,303 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.time.OffsetDateTime; +import java.time.format.DateTimeFormatter; +import java.util.List; + +/** + * Definition of Webhook. + */ +@Fluent +public final class Webhook implements JsonSerializable { + /* + *

A regular expression used to determine which repository branches are built when a webhook is triggered. If the + * name of a branch matches the regular expression, then it is built. If branchFilter is empty, then + * all branches are built.

It is recommended that you use filterGroups instead of + * branchFilter.

+ */ + private String branchFilter; + + /* + *

Specifies the type of build this webhook will trigger.

+ */ + private WebhookBuildTypeEnumValue buildType; + + /* + *

An array of arrays of WebhookFilter objects used to determine which webhooks are triggered. At + * least one WebhookFilter in the array must specify EVENT as its type.

+ *

For a build to be triggered, at least one filter group in the filterGroups array must pass. For a + * filter group to pass, each of its filters must pass.

+ */ + private List filterGroups; + + /* + *

A timestamp that indicates the last time a repository's secret token was modified.

+ */ + private OffsetDateTime lastModifiedSecret; + + /* + *

The CodeBuild endpoint where webhook events are sent.

+ */ + private String payloadUrl; + + /* + *

The secret token of the associated repository.

A Bitbucket webhook does not support + * secret.

+ */ + private String secret; + + /* + *

The URL to the webhook.

+ */ + private String url; + + /** + * Creates an instance of Webhook class. + */ + public Webhook() { + } + + /** + * Get the branchFilter property: <p>A regular expression used to determine which repository branches are + * built when a webhook is triggered. If the name of a branch matches the regular expression, then it is built. If + * <code>branchFilter</code> is empty, then all branches are built.</p> <note> <p>It + * is recommended that you use <code>filterGroups</code> instead of + * <code>branchFilter</code>. </p> </note>. + * + * @return the branchFilter value. + */ + public String branchFilter() { + return this.branchFilter; + } + + /** + * Set the branchFilter property: <p>A regular expression used to determine which repository branches are + * built when a webhook is triggered. If the name of a branch matches the regular expression, then it is built. If + * <code>branchFilter</code> is empty, then all branches are built.</p> <note> <p>It + * is recommended that you use <code>filterGroups</code> instead of + * <code>branchFilter</code>. </p> </note>. + * + * @param branchFilter the branchFilter value to set. + * @return the Webhook object itself. + */ + public Webhook withBranchFilter(String branchFilter) { + this.branchFilter = branchFilter; + return this; + } + + /** + * Get the buildType property: <p>Specifies the type of build this webhook will trigger.</p>. + * + * @return the buildType value. + */ + public WebhookBuildTypeEnumValue buildType() { + return this.buildType; + } + + /** + * Set the buildType property: <p>Specifies the type of build this webhook will trigger.</p>. + * + * @param buildType the buildType value to set. + * @return the Webhook object itself. + */ + public Webhook withBuildType(WebhookBuildTypeEnumValue buildType) { + this.buildType = buildType; + return this; + } + + /** + * Get the filterGroups property: <p>An array of arrays of <code>WebhookFilter</code> objects used + * to determine which webhooks are triggered. At least one <code>WebhookFilter</code> in the array must + * specify <code>EVENT</code> as its <code>type</code>. </p> <p>For a build to + * be triggered, at least one filter group in the <code>filterGroups</code> array must pass. For a + * filter group to pass, each of its filters must pass. </p>. + * + * @return the filterGroups value. + */ + public List filterGroups() { + return this.filterGroups; + } + + /** + * Set the filterGroups property: <p>An array of arrays of <code>WebhookFilter</code> objects used + * to determine which webhooks are triggered. At least one <code>WebhookFilter</code> in the array must + * specify <code>EVENT</code> as its <code>type</code>. </p> <p>For a build to + * be triggered, at least one filter group in the <code>filterGroups</code> array must pass. For a + * filter group to pass, each of its filters must pass. </p>. + * + * @param filterGroups the filterGroups value to set. + * @return the Webhook object itself. + */ + public Webhook withFilterGroups(List filterGroups) { + this.filterGroups = filterGroups; + return this; + } + + /** + * Get the lastModifiedSecret property: <p>A timestamp that indicates the last time a repository's secret + * token was modified. </p>. + * + * @return the lastModifiedSecret value. + */ + public OffsetDateTime lastModifiedSecret() { + return this.lastModifiedSecret; + } + + /** + * Set the lastModifiedSecret property: <p>A timestamp that indicates the last time a repository's secret + * token was modified. </p>. + * + * @param lastModifiedSecret the lastModifiedSecret value to set. + * @return the Webhook object itself. + */ + public Webhook withLastModifiedSecret(OffsetDateTime lastModifiedSecret) { + this.lastModifiedSecret = lastModifiedSecret; + return this; + } + + /** + * Get the payloadUrl property: <p>The CodeBuild endpoint where webhook events are sent.</p>. + * + * @return the payloadUrl value. + */ + public String payloadUrl() { + return this.payloadUrl; + } + + /** + * Set the payloadUrl property: <p>The CodeBuild endpoint where webhook events are sent.</p>. + * + * @param payloadUrl the payloadUrl value to set. + * @return the Webhook object itself. + */ + public Webhook withPayloadUrl(String payloadUrl) { + this.payloadUrl = payloadUrl; + return this; + } + + /** + * Get the secret property: <p>The secret token of the associated repository. </p> <note> + * <p>A Bitbucket webhook does not support <code>secret</code>. </p> </note>. + * + * @return the secret value. + */ + public String secret() { + return this.secret; + } + + /** + * Set the secret property: <p>The secret token of the associated repository. </p> <note> + * <p>A Bitbucket webhook does not support <code>secret</code>. </p> </note>. + * + * @param secret the secret value to set. + * @return the Webhook object itself. + */ + public Webhook withSecret(String secret) { + this.secret = secret; + return this; + } + + /** + * Get the url property: <p>The URL to the webhook.</p>. + * + * @return the url value. + */ + public String url() { + return this.url; + } + + /** + * Set the url property: <p>The URL to the webhook.</p>. + * + * @param url the url value to set. + * @return the Webhook object itself. + */ + public Webhook withUrl(String url) { + this.url = url; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (buildType() != null) { + buildType().validate(); + } + if (filterGroups() != null) { + filterGroups().forEach(e -> e.validate()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("branchFilter", this.branchFilter); + jsonWriter.writeJsonField("buildType", this.buildType); + jsonWriter.writeArrayField("filterGroups", this.filterGroups, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("lastModifiedSecret", + this.lastModifiedSecret == null + ? null + : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.lastModifiedSecret)); + jsonWriter.writeStringField("payloadUrl", this.payloadUrl); + jsonWriter.writeStringField("secret", this.secret); + jsonWriter.writeStringField("url", this.url); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of Webhook from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of Webhook if the JsonReader was pointing to an instance of it, or null if it was pointing to + * JSON null. + * @throws IOException If an error occurs while reading the Webhook. + */ + public static Webhook fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + Webhook deserializedWebhook = new Webhook(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("branchFilter".equals(fieldName)) { + deserializedWebhook.branchFilter = reader.getString(); + } else if ("buildType".equals(fieldName)) { + deserializedWebhook.buildType = WebhookBuildTypeEnumValue.fromJson(reader); + } else if ("filterGroups".equals(fieldName)) { + List filterGroups = reader.readArray(reader1 -> FilterGroup.fromJson(reader1)); + deserializedWebhook.filterGroups = filterGroups; + } else if ("lastModifiedSecret".equals(fieldName)) { + deserializedWebhook.lastModifiedSecret = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("payloadUrl".equals(fieldName)) { + deserializedWebhook.payloadUrl = reader.getString(); + } else if ("secret".equals(fieldName)) { + deserializedWebhook.secret = reader.getString(); + } else if ("url".equals(fieldName)) { + deserializedWebhook.url = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedWebhook; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/WebhookBuildType.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/WebhookBuildType.java new file mode 100644 index 000000000000..ba1f785f09c1 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/WebhookBuildType.java @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * WebhookBuildType enum. + */ +public final class WebhookBuildType extends ExpandableStringEnum { + /** + * Static value BUILD for WebhookBuildType. + */ + public static final WebhookBuildType BUILD = fromString("BUILD"); + + /** + * Static value BUILD_BATCH for WebhookBuildType. + */ + public static final WebhookBuildType BUILD_BATCH = fromString("BUILD_BATCH"); + + /** + * Creates a new instance of WebhookBuildType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public WebhookBuildType() { + } + + /** + * Creates or finds a WebhookBuildType from its string representation. + * + * @param name a name to look for. + * @return the corresponding WebhookBuildType. + */ + public static WebhookBuildType fromString(String name) { + return fromString(name, WebhookBuildType.class); + } + + /** + * Gets known WebhookBuildType values. + * + * @return known WebhookBuildType values. + */ + public static Collection values() { + return values(WebhookBuildType.class); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/WebhookBuildTypeEnumValue.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/WebhookBuildTypeEnumValue.java new file mode 100644 index 000000000000..6bfd82e359cf --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/WebhookBuildTypeEnumValue.java @@ -0,0 +1,93 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of WebhookBuildTypeEnumValue. + */ +@Fluent +public final class WebhookBuildTypeEnumValue implements JsonSerializable { + /* + * Property value + */ + private WebhookBuildType value; + + /** + * Creates an instance of WebhookBuildTypeEnumValue class. + */ + public WebhookBuildTypeEnumValue() { + } + + /** + * Get the value property: Property value. + * + * @return the value value. + */ + public WebhookBuildType value() { + return this.value; + } + + /** + * Set the value property: Property value. + * + * @param value the value value to set. + * @return the WebhookBuildTypeEnumValue object itself. + */ + public WebhookBuildTypeEnumValue withValue(WebhookBuildType value) { + this.value = value; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("value", this.value == null ? null : this.value.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of WebhookBuildTypeEnumValue from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of WebhookBuildTypeEnumValue if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IOException If an error occurs while reading the WebhookBuildTypeEnumValue. + */ + public static WebhookBuildTypeEnumValue fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + WebhookBuildTypeEnumValue deserializedWebhookBuildTypeEnumValue = new WebhookBuildTypeEnumValue(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + deserializedWebhookBuildTypeEnumValue.value = WebhookBuildType.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedWebhookBuildTypeEnumValue; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/WebhookFilter.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/WebhookFilter.java new file mode 100644 index 000000000000..7c7355bd65aa --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/WebhookFilter.java @@ -0,0 +1,307 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of WebhookFilter. + */ +@Fluent +public final class WebhookFilter implements JsonSerializable { + /* + *

Used to indicate that the pattern determines which webhook events do not trigger a build. If + * true, then a webhook event that does not match the pattern triggers a build. If false, then a + * webhook event that matches the pattern triggers a build.

+ */ + private Boolean excludeMatchedPattern; + + /* + *

For a WebHookFilter that uses EVENT type, a comma-separated string that specifies + * one or more events. For example, the webhook filter PUSH, PULL_REQUEST_CREATED, PULL_REQUEST_UPDATED + * allows all push, pull request created, and pull request updated events to trigger a build.

For a + * WebHookFilter that uses any of the other filter types, a regular expression pattern. For example, a + * WebHookFilter that uses HEAD_REF for its type and the pattern + * ^refs/heads/ triggers a build when the head reference is a branch with a reference name + * refs/heads/branch-name.

+ */ + private String pattern; + + /* + *

The type of webhook filter. There are nine webhook filter types: EVENT, + * ACTOR_ACCOUNT_ID, HEAD_REF, BASE_REF, FILE_PATH, + * COMMIT_MESSAGE, TAG_NAME, RELEASE_NAME, and WORKFLOW_NAME. + *

  • EVENT

    • A webhook event triggers a build when the provided + * pattern matches one of nine event types: PUSH, PULL_REQUEST_CREATED, + * PULL_REQUEST_UPDATED, PULL_REQUEST_CLOSED, PULL_REQUEST_REOPENED, + * PULL_REQUEST_MERGED, RELEASED, PRERELEASED, and + * WORKFLOW_JOB_QUEUED. The EVENT patterns are specified as a comma-separated string. For + * example, PUSH, PULL_REQUEST_CREATED, PULL_REQUEST_UPDATED filters all push, pull request created, + * and pull request updated events.

      The PULL_REQUEST_REOPENED works with GitHub and + * GitHub Enterprise only. The RELEASED, PRERELEASED, and WORKFLOW_JOB_QUEUED + * work with GitHub only.

  • ACTOR_ACCOUNT_ID

    • A webhook event + * triggers a build when a GitHub, GitHub Enterprise, or Bitbucket account ID matches the regular expression + * pattern.

  • HEAD_REF

    • A webhook event triggers a build + * when the head reference matches the regular expression pattern. For example, + * refs/heads/branch-name and refs/tags/tag-name.

      Works with GitHub and + * GitHub Enterprise push, GitHub and GitHub Enterprise pull request, Bitbucket push, and Bitbucket pull request + * events.

  • BASE_REF

    • A webhook event triggers a build when + * the base reference matches the regular expression pattern. For example, + * refs/heads/branch-name.

      Works with pull request events only.

    • + *
  • FILE_PATH

    • A webhook triggers a build when the path of a changed file + * matches the regular expression pattern.

      Works with GitHub and Bitbucket events push + * and pull requests events. Also works with GitHub Enterprise push events, but does not work with GitHub Enterprise + * pull request events.

  • COMMIT_MESSAGE

    • A webhook triggers a + * build when the head commit message matches the regular expression pattern.

      Works with + * GitHub and Bitbucket events push and pull requests events. Also works with GitHub Enterprise push events, but + * does not work with GitHub Enterprise pull request events.

  • TAG_NAME

    + *
    • A webhook triggers a build when the tag name of the release matches the regular expression + * pattern.

      Works with RELEASED and PRERELEASED events only. + *

  • RELEASE_NAME

    • A webhook triggers a build when the release + * name matches the regular expression pattern.

      Works with RELEASED and + * PRERELEASED events only.

  • WORKFLOW_NAME

    • A + * webhook triggers a build when the workflow name matches the regular expression pattern.

      + *

      Works with WORKFLOW_JOB_QUEUED events only.

+ */ + private WebhookFilterTypeEnumValue type; + + /** + * Creates an instance of WebhookFilter class. + */ + public WebhookFilter() { + } + + /** + * Get the excludeMatchedPattern property: <p> Used to indicate that the <code>pattern</code> + * determines which webhook events do not trigger a build. If true, then a webhook event that does not match the + * <code>pattern</code> triggers a build. If false, then a webhook event that matches the + * <code>pattern</code> triggers a build. </p>. + * + * @return the excludeMatchedPattern value. + */ + public Boolean excludeMatchedPattern() { + return this.excludeMatchedPattern; + } + + /** + * Set the excludeMatchedPattern property: <p> Used to indicate that the <code>pattern</code> + * determines which webhook events do not trigger a build. If true, then a webhook event that does not match the + * <code>pattern</code> triggers a build. If false, then a webhook event that matches the + * <code>pattern</code> triggers a build. </p>. + * + * @param excludeMatchedPattern the excludeMatchedPattern value to set. + * @return the WebhookFilter object itself. + */ + public WebhookFilter withExcludeMatchedPattern(Boolean excludeMatchedPattern) { + this.excludeMatchedPattern = excludeMatchedPattern; + return this; + } + + /** + * Get the pattern property: <p> For a <code>WebHookFilter</code> that uses + * <code>EVENT</code> type, a comma-separated string that specifies one or more events. For example, the + * webhook filter <code>PUSH, PULL_REQUEST_CREATED, PULL_REQUEST_UPDATED</code> allows all push, pull + * request created, and pull request updated events to trigger a build. </p> <p> For a + * <code>WebHookFilter</code> that uses any of the other filter types, a regular expression pattern. For + * example, a <code>WebHookFilter</code> that uses <code>HEAD_REF</code> for its + * <code>type</code> and the pattern <code>^refs/heads/</code> triggers a build when the + * head reference is a branch with a reference name <code>refs/heads/branch-name</code>. </p>. + * + * @return the pattern value. + */ + public String pattern() { + return this.pattern; + } + + /** + * Set the pattern property: <p> For a <code>WebHookFilter</code> that uses + * <code>EVENT</code> type, a comma-separated string that specifies one or more events. For example, the + * webhook filter <code>PUSH, PULL_REQUEST_CREATED, PULL_REQUEST_UPDATED</code> allows all push, pull + * request created, and pull request updated events to trigger a build. </p> <p> For a + * <code>WebHookFilter</code> that uses any of the other filter types, a regular expression pattern. For + * example, a <code>WebHookFilter</code> that uses <code>HEAD_REF</code> for its + * <code>type</code> and the pattern <code>^refs/heads/</code> triggers a build when the + * head reference is a branch with a reference name <code>refs/heads/branch-name</code>. </p>. + * + * @param pattern the pattern value to set. + * @return the WebhookFilter object itself. + */ + public WebhookFilter withPattern(String pattern) { + this.pattern = pattern; + return this; + } + + /** + * Get the type property: <p> The type of webhook filter. There are nine webhook filter types: + * <code>EVENT</code>, <code>ACTOR_ACCOUNT_ID</code>, <code>HEAD_REF</code>, + * <code>BASE_REF</code>, <code>FILE_PATH</code>, <code>COMMIT_MESSAGE</code>, + * <code>TAG_NAME</code>, <code>RELEASE_NAME</code>, and + * <code>WORKFLOW_NAME</code>. </p> <ul> <li> <p> EVENT </p> <ul> + * <li> <p> A webhook event triggers a build when the provided <code>pattern</code> matches + * one of nine event types: <code>PUSH</code>, <code>PULL_REQUEST_CREATED</code>, + * <code>PULL_REQUEST_UPDATED</code>, <code>PULL_REQUEST_CLOSED</code>, + * <code>PULL_REQUEST_REOPENED</code>, <code>PULL_REQUEST_MERGED</code>, + * <code>RELEASED</code>, <code>PRERELEASED</code>, and + * <code>WORKFLOW_JOB_QUEUED</code>. The <code>EVENT</code> patterns are specified as a + * comma-separated string. For example, <code>PUSH, PULL_REQUEST_CREATED, PULL_REQUEST_UPDATED</code> + * filters all push, pull request created, and pull request updated events. </p> <note> <p> The + * <code>PULL_REQUEST_REOPENED</code> works with GitHub and GitHub Enterprise only. The + * <code>RELEASED</code>, <code>PRERELEASED</code>, and + * <code>WORKFLOW_JOB_QUEUED</code> work with GitHub only.</p> </note> </li> + * </ul> </li> <li> <p>ACTOR_ACCOUNT_ID</p> <ul> <li> <p> A webhook + * event triggers a build when a GitHub, GitHub Enterprise, or Bitbucket account ID matches the regular expression + * <code>pattern</code>. </p> </li> </ul> </li> <li> + * <p>HEAD_REF</p> <ul> <li> <p> A webhook event triggers a build when the head + * reference matches the regular expression <code>pattern</code>. For example, + * <code>refs/heads/branch-name</code> and <code>refs/tags/tag-name</code>. </p> + * <note> <p> Works with GitHub and GitHub Enterprise push, GitHub and GitHub Enterprise pull request, + * Bitbucket push, and Bitbucket pull request events.</p> </note> </li> </ul> </li> + * <li> <p>BASE_REF</p> <ul> <li> <p> A webhook event triggers a build when the + * base reference matches the regular expression <code>pattern</code>. For example, + * <code>refs/heads/branch-name</code>. </p> <note> <p> Works with pull request events + * only. </p> </note> </li> </ul> </li> <li> <p>FILE_PATH</p> + * <ul> <li> <p> A webhook triggers a build when the path of a changed file matches the regular + * expression <code>pattern</code>. </p> <note> <p> Works with GitHub and Bitbucket + * events push and pull requests events. Also works with GitHub Enterprise push events, but does not work with + * GitHub Enterprise pull request events. </p> </note> </li> </ul> </li> <li> + * <p>COMMIT_MESSAGE</p> <ul> <li> <p>A webhook triggers a build when the head commit + * message matches the regular expression <code>pattern</code>.</p> <note> <p> Works + * with GitHub and Bitbucket events push and pull requests events. Also works with GitHub Enterprise push events, + * but does not work with GitHub Enterprise pull request events. </p> </note> </li> </ul> + * </li> <li> <p>TAG_NAME</p> <ul> <li> <p>A webhook triggers a build when + * the tag name of the release matches the regular expression <code>pattern</code>.</p> + * <note> <p> Works with <code>RELEASED</code> and <code>PRERELEASED</code> + * events only. </p> </note> </li> </ul> </li> <li> + * <p>RELEASE_NAME</p> <ul> <li> <p>A webhook triggers a build when the release name + * matches the regular expression <code>pattern</code>.</p> <note> <p> Works with + * <code>RELEASED</code> and <code>PRERELEASED</code> events only. </p> </note> + * </li> </ul> </li> <li> <p>WORKFLOW_NAME</p> <ul> <li> <p>A + * webhook triggers a build when the workflow name matches the regular expression + * <code>pattern</code>.</p> <note> <p> Works with + * <code>WORKFLOW_JOB_QUEUED</code> events only. </p> </note> </li> </ul> + * </li> </ul>. + * + * @return the type value. + */ + public WebhookFilterTypeEnumValue type() { + return this.type; + } + + /** + * Set the type property: <p> The type of webhook filter. There are nine webhook filter types: + * <code>EVENT</code>, <code>ACTOR_ACCOUNT_ID</code>, <code>HEAD_REF</code>, + * <code>BASE_REF</code>, <code>FILE_PATH</code>, <code>COMMIT_MESSAGE</code>, + * <code>TAG_NAME</code>, <code>RELEASE_NAME</code>, and + * <code>WORKFLOW_NAME</code>. </p> <ul> <li> <p> EVENT </p> <ul> + * <li> <p> A webhook event triggers a build when the provided <code>pattern</code> matches + * one of nine event types: <code>PUSH</code>, <code>PULL_REQUEST_CREATED</code>, + * <code>PULL_REQUEST_UPDATED</code>, <code>PULL_REQUEST_CLOSED</code>, + * <code>PULL_REQUEST_REOPENED</code>, <code>PULL_REQUEST_MERGED</code>, + * <code>RELEASED</code>, <code>PRERELEASED</code>, and + * <code>WORKFLOW_JOB_QUEUED</code>. The <code>EVENT</code> patterns are specified as a + * comma-separated string. For example, <code>PUSH, PULL_REQUEST_CREATED, PULL_REQUEST_UPDATED</code> + * filters all push, pull request created, and pull request updated events. </p> <note> <p> The + * <code>PULL_REQUEST_REOPENED</code> works with GitHub and GitHub Enterprise only. The + * <code>RELEASED</code>, <code>PRERELEASED</code>, and + * <code>WORKFLOW_JOB_QUEUED</code> work with GitHub only.</p> </note> </li> + * </ul> </li> <li> <p>ACTOR_ACCOUNT_ID</p> <ul> <li> <p> A webhook + * event triggers a build when a GitHub, GitHub Enterprise, or Bitbucket account ID matches the regular expression + * <code>pattern</code>. </p> </li> </ul> </li> <li> + * <p>HEAD_REF</p> <ul> <li> <p> A webhook event triggers a build when the head + * reference matches the regular expression <code>pattern</code>. For example, + * <code>refs/heads/branch-name</code> and <code>refs/tags/tag-name</code>. </p> + * <note> <p> Works with GitHub and GitHub Enterprise push, GitHub and GitHub Enterprise pull request, + * Bitbucket push, and Bitbucket pull request events.</p> </note> </li> </ul> </li> + * <li> <p>BASE_REF</p> <ul> <li> <p> A webhook event triggers a build when the + * base reference matches the regular expression <code>pattern</code>. For example, + * <code>refs/heads/branch-name</code>. </p> <note> <p> Works with pull request events + * only. </p> </note> </li> </ul> </li> <li> <p>FILE_PATH</p> + * <ul> <li> <p> A webhook triggers a build when the path of a changed file matches the regular + * expression <code>pattern</code>. </p> <note> <p> Works with GitHub and Bitbucket + * events push and pull requests events. Also works with GitHub Enterprise push events, but does not work with + * GitHub Enterprise pull request events. </p> </note> </li> </ul> </li> <li> + * <p>COMMIT_MESSAGE</p> <ul> <li> <p>A webhook triggers a build when the head commit + * message matches the regular expression <code>pattern</code>.</p> <note> <p> Works + * with GitHub and Bitbucket events push and pull requests events. Also works with GitHub Enterprise push events, + * but does not work with GitHub Enterprise pull request events. </p> </note> </li> </ul> + * </li> <li> <p>TAG_NAME</p> <ul> <li> <p>A webhook triggers a build when + * the tag name of the release matches the regular expression <code>pattern</code>.</p> + * <note> <p> Works with <code>RELEASED</code> and <code>PRERELEASED</code> + * events only. </p> </note> </li> </ul> </li> <li> + * <p>RELEASE_NAME</p> <ul> <li> <p>A webhook triggers a build when the release name + * matches the regular expression <code>pattern</code>.</p> <note> <p> Works with + * <code>RELEASED</code> and <code>PRERELEASED</code> events only. </p> </note> + * </li> </ul> </li> <li> <p>WORKFLOW_NAME</p> <ul> <li> <p>A + * webhook triggers a build when the workflow name matches the regular expression + * <code>pattern</code>.</p> <note> <p> Works with + * <code>WORKFLOW_JOB_QUEUED</code> events only. </p> </note> </li> </ul> + * </li> </ul>. + * + * @param type the type value to set. + * @return the WebhookFilter object itself. + */ + public WebhookFilter withType(WebhookFilterTypeEnumValue type) { + this.type = type; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (type() != null) { + type().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeBooleanField("excludeMatchedPattern", this.excludeMatchedPattern); + jsonWriter.writeStringField("pattern", this.pattern); + jsonWriter.writeJsonField("type", this.type); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of WebhookFilter from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of WebhookFilter if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the WebhookFilter. + */ + public static WebhookFilter fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + WebhookFilter deserializedWebhookFilter = new WebhookFilter(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("excludeMatchedPattern".equals(fieldName)) { + deserializedWebhookFilter.excludeMatchedPattern = reader.getNullable(JsonReader::getBoolean); + } else if ("pattern".equals(fieldName)) { + deserializedWebhookFilter.pattern = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedWebhookFilter.type = WebhookFilterTypeEnumValue.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedWebhookFilter; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/WebhookFilterType.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/WebhookFilterType.java new file mode 100644 index 000000000000..2e1820a4e6e4 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/WebhookFilterType.java @@ -0,0 +1,86 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * WebhookFilterType enum. + */ +public final class WebhookFilterType extends ExpandableStringEnum { + /** + * Static value ACTOR_ACCOUNT_ID for WebhookFilterType. + */ + public static final WebhookFilterType ACTOR_ACCOUNT_ID = fromString("ACTOR_ACCOUNT_ID"); + + /** + * Static value BASE_REF for WebhookFilterType. + */ + public static final WebhookFilterType BASE_REF = fromString("BASE_REF"); + + /** + * Static value COMMIT_MESSAGE for WebhookFilterType. + */ + public static final WebhookFilterType COMMIT_MESSAGE = fromString("COMMIT_MESSAGE"); + + /** + * Static value EVENT for WebhookFilterType. + */ + public static final WebhookFilterType EVENT = fromString("EVENT"); + + /** + * Static value FILE_PATH for WebhookFilterType. + */ + public static final WebhookFilterType FILE_PATH = fromString("FILE_PATH"); + + /** + * Static value HEAD_REF for WebhookFilterType. + */ + public static final WebhookFilterType HEAD_REF = fromString("HEAD_REF"); + + /** + * Static value RELEASE_NAME for WebhookFilterType. + */ + public static final WebhookFilterType RELEASE_NAME = fromString("RELEASE_NAME"); + + /** + * Static value TAG_NAME for WebhookFilterType. + */ + public static final WebhookFilterType TAG_NAME = fromString("TAG_NAME"); + + /** + * Static value WORKFLOW_NAME for WebhookFilterType. + */ + public static final WebhookFilterType WORKFLOW_NAME = fromString("WORKFLOW_NAME"); + + /** + * Creates a new instance of WebhookFilterType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public WebhookFilterType() { + } + + /** + * Creates or finds a WebhookFilterType from its string representation. + * + * @param name a name to look for. + * @return the corresponding WebhookFilterType. + */ + public static WebhookFilterType fromString(String name) { + return fromString(name, WebhookFilterType.class); + } + + /** + * Gets known WebhookFilterType values. + * + * @return known WebhookFilterType values. + */ + public static Collection values() { + return values(WebhookFilterType.class); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/WebhookFilterTypeEnumValue.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/WebhookFilterTypeEnumValue.java new file mode 100644 index 000000000000..40682d19edb8 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/WebhookFilterTypeEnumValue.java @@ -0,0 +1,93 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of WebhookFilterTypeEnumValue. + */ +@Fluent +public final class WebhookFilterTypeEnumValue implements JsonSerializable { + /* + * Property value + */ + private WebhookFilterType value; + + /** + * Creates an instance of WebhookFilterTypeEnumValue class. + */ + public WebhookFilterTypeEnumValue() { + } + + /** + * Get the value property: Property value. + * + * @return the value value. + */ + public WebhookFilterType value() { + return this.value; + } + + /** + * Set the value property: Property value. + * + * @param value the value value to set. + * @return the WebhookFilterTypeEnumValue object itself. + */ + public WebhookFilterTypeEnumValue withValue(WebhookFilterType value) { + this.value = value; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("value", this.value == null ? null : this.value.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of WebhookFilterTypeEnumValue from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of WebhookFilterTypeEnumValue if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IOException If an error occurs while reading the WebhookFilterTypeEnumValue. + */ + public static WebhookFilterTypeEnumValue fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + WebhookFilterTypeEnumValue deserializedWebhookFilterTypeEnumValue = new WebhookFilterTypeEnumValue(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + deserializedWebhookFilterTypeEnumValue.value = WebhookFilterType.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedWebhookFilterTypeEnumValue; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/WebsiteConfiguration.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/WebsiteConfiguration.java new file mode 100644 index 000000000000..45fab2c750cb --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/WebsiteConfiguration.java @@ -0,0 +1,191 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Definition of WebsiteConfiguration. + */ +@Fluent +public final class WebsiteConfiguration implements JsonSerializable { + /* + * The name of the error document for the website. + */ + private String errorDocument; + + /* + * The name of the index document for the website. + */ + private String indexDocument; + + /* + * The redirect behavior for every request to this bucket's website endpoint. If you specify this property, you + * can't specify any other property. Specifies the redirect behavior of all requests to a website endpoint of an + * Amazon S3 bucket. + */ + private RedirectAllRequestsTo redirectAllRequestsTo; + + /* + * Rules that define when a redirect is applied and the redirect behavior. + */ + private List routingRules; + + /** + * Creates an instance of WebsiteConfiguration class. + */ + public WebsiteConfiguration() { + } + + /** + * Get the errorDocument property: The name of the error document for the website. + * + * @return the errorDocument value. + */ + public String errorDocument() { + return this.errorDocument; + } + + /** + * Set the errorDocument property: The name of the error document for the website. + * + * @param errorDocument the errorDocument value to set. + * @return the WebsiteConfiguration object itself. + */ + public WebsiteConfiguration withErrorDocument(String errorDocument) { + this.errorDocument = errorDocument; + return this; + } + + /** + * Get the indexDocument property: The name of the index document for the website. + * + * @return the indexDocument value. + */ + public String indexDocument() { + return this.indexDocument; + } + + /** + * Set the indexDocument property: The name of the index document for the website. + * + * @param indexDocument the indexDocument value to set. + * @return the WebsiteConfiguration object itself. + */ + public WebsiteConfiguration withIndexDocument(String indexDocument) { + this.indexDocument = indexDocument; + return this; + } + + /** + * Get the redirectAllRequestsTo property: The redirect behavior for every request to this bucket's website + * endpoint. If you specify this property, you can't specify any other property. Specifies the redirect behavior of + * all requests to a website endpoint of an Amazon S3 bucket. + * + * @return the redirectAllRequestsTo value. + */ + public RedirectAllRequestsTo redirectAllRequestsTo() { + return this.redirectAllRequestsTo; + } + + /** + * Set the redirectAllRequestsTo property: The redirect behavior for every request to this bucket's website + * endpoint. If you specify this property, you can't specify any other property. Specifies the redirect behavior of + * all requests to a website endpoint of an Amazon S3 bucket. + * + * @param redirectAllRequestsTo the redirectAllRequestsTo value to set. + * @return the WebsiteConfiguration object itself. + */ + public WebsiteConfiguration withRedirectAllRequestsTo(RedirectAllRequestsTo redirectAllRequestsTo) { + this.redirectAllRequestsTo = redirectAllRequestsTo; + return this; + } + + /** + * Get the routingRules property: Rules that define when a redirect is applied and the redirect behavior. + * + * @return the routingRules value. + */ + public List routingRules() { + return this.routingRules; + } + + /** + * Set the routingRules property: Rules that define when a redirect is applied and the redirect behavior. + * + * @param routingRules the routingRules value to set. + * @return the WebsiteConfiguration object itself. + */ + public WebsiteConfiguration withRoutingRules(List routingRules) { + this.routingRules = routingRules; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (redirectAllRequestsTo() != null) { + redirectAllRequestsTo().validate(); + } + if (routingRules() != null) { + routingRules().forEach(e -> e.validate()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("errorDocument", this.errorDocument); + jsonWriter.writeStringField("indexDocument", this.indexDocument); + jsonWriter.writeJsonField("redirectAllRequestsTo", this.redirectAllRequestsTo); + jsonWriter.writeArrayField("routingRules", this.routingRules, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of WebsiteConfiguration from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of WebsiteConfiguration if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the WebsiteConfiguration. + */ + public static WebsiteConfiguration fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + WebsiteConfiguration deserializedWebsiteConfiguration = new WebsiteConfiguration(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("errorDocument".equals(fieldName)) { + deserializedWebsiteConfiguration.errorDocument = reader.getString(); + } else if ("indexDocument".equals(fieldName)) { + deserializedWebsiteConfiguration.indexDocument = reader.getString(); + } else if ("redirectAllRequestsTo".equals(fieldName)) { + deserializedWebsiteConfiguration.redirectAllRequestsTo = RedirectAllRequestsTo.fromJson(reader); + } else if ("routingRules".equals(fieldName)) { + List routingRules = reader.readArray(reader1 -> RoutingRule.fromJson(reader1)); + deserializedWebsiteConfiguration.routingRules = routingRules; + } else { + reader.skipChildren(); + } + } + + return deserializedWebsiteConfiguration; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/WindowStartTime.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/WindowStartTime.java new file mode 100644 index 000000000000..407ea41a3aa2 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/WindowStartTime.java @@ -0,0 +1,124 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of WindowStartTime. + */ +@Fluent +public final class WindowStartTime implements JsonSerializable { + /* + *

The start hour of the window in Coordinated Universal Time (UTC), using 24-hour time. For example, + * 17 refers to 5:00 P.M. UTC.

+ */ + private Long hours; + + /* + *

The start minute of the window, in UTC.

+ */ + private Long minutes; + + /** + * Creates an instance of WindowStartTime class. + */ + public WindowStartTime() { + } + + /** + * Get the hours property: <p>The start hour of the window in Coordinated Universal Time (UTC), using 24-hour + * time. For example, <code>17</code> refers to 5:00 P.M. UTC.</p>. + * + * @return the hours value. + */ + public Long hours() { + return this.hours; + } + + /** + * Set the hours property: <p>The start hour of the window in Coordinated Universal Time (UTC), using 24-hour + * time. For example, <code>17</code> refers to 5:00 P.M. UTC.</p>. + * + * @param hours the hours value to set. + * @return the WindowStartTime object itself. + */ + public WindowStartTime withHours(Long hours) { + this.hours = hours; + return this; + } + + /** + * Get the minutes property: <p>The start minute of the window, in UTC.</p>. + * + * @return the minutes value. + */ + public Long minutes() { + return this.minutes; + } + + /** + * Set the minutes property: <p>The start minute of the window, in UTC.</p>. + * + * @param minutes the minutes value to set. + * @return the WindowStartTime object itself. + */ + public WindowStartTime withMinutes(Long minutes) { + this.minutes = minutes; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeNumberField("hours", this.hours); + jsonWriter.writeNumberField("minutes", this.minutes); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of WindowStartTime from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of WindowStartTime if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the WindowStartTime. + */ + public static WindowStartTime fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + WindowStartTime deserializedWindowStartTime = new WindowStartTime(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("hours".equals(fieldName)) { + deserializedWindowStartTime.hours = reader.getNullable(JsonReader::getLong); + } else if ("minutes".equals(fieldName)) { + deserializedWindowStartTime.minutes = reader.getNullable(JsonReader::getLong); + } else { + reader.skipChildren(); + } + } + + return deserializedWindowStartTime; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ZoneAwarenessConfig.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ZoneAwarenessConfig.java new file mode 100644 index 000000000000..39e332454dc2 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/ZoneAwarenessConfig.java @@ -0,0 +1,101 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of ZoneAwarenessConfig. + */ +@Fluent +public final class ZoneAwarenessConfig implements JsonSerializable { + /* + *

If you enabled multiple Availability Zones, this value is the number of zones that you want the domain to use. + * Valid values are 2 and 3. If your domain is provisioned within a VPC, this value be + * equal to number of subnets.

+ */ + private Integer availabilityZoneCount; + + /** + * Creates an instance of ZoneAwarenessConfig class. + */ + public ZoneAwarenessConfig() { + } + + /** + * Get the availabilityZoneCount property: <p>If you enabled multiple Availability Zones, this value is the + * number of zones that you want the domain to use. Valid values are <code>2</code> and + * <code>3</code>. If your domain is provisioned within a VPC, this value be equal to number of + * subnets.</p>. + * + * @return the availabilityZoneCount value. + */ + public Integer availabilityZoneCount() { + return this.availabilityZoneCount; + } + + /** + * Set the availabilityZoneCount property: <p>If you enabled multiple Availability Zones, this value is the + * number of zones that you want the domain to use. Valid values are <code>2</code> and + * <code>3</code>. If your domain is provisioned within a VPC, this value be equal to number of + * subnets.</p>. + * + * @param availabilityZoneCount the availabilityZoneCount value to set. + * @return the ZoneAwarenessConfig object itself. + */ + public ZoneAwarenessConfig withAvailabilityZoneCount(Integer availabilityZoneCount) { + this.availabilityZoneCount = availabilityZoneCount; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeNumberField("availabilityZoneCount", this.availabilityZoneCount); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ZoneAwarenessConfig from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ZoneAwarenessConfig if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the ZoneAwarenessConfig. + */ + public static ZoneAwarenessConfig fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ZoneAwarenessConfig deserializedZoneAwarenessConfig = new ZoneAwarenessConfig(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("availabilityZoneCount".equals(fieldName)) { + deserializedZoneAwarenessConfig.availabilityZoneCount = reader.getNullable(JsonReader::getInt); + } else { + reader.skipChildren(); + } + } + + return deserializedZoneAwarenessConfig; + }); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/package-info.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/package-info.java new file mode 100644 index 000000000000..1b1f302ecd4f --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/models/package-info.java @@ -0,0 +1,9 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +/** + * Package containing the data models for MicrosoftAwsConnector. + * Microsoft.AwsConnector Resource Provider management API. + */ +package com.azure.resourcemanager.awsconnector.models; diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/package-info.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/package-info.java new file mode 100644 index 000000000000..a5d82b77a218 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/com/azure/resourcemanager/awsconnector/package-info.java @@ -0,0 +1,9 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +/** + * Package containing the classes for MicrosoftAwsConnector. + * Microsoft.AwsConnector Resource Provider management API. + */ +package com.azure.resourcemanager.awsconnector; diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/module-info.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/module-info.java new file mode 100644 index 000000000000..1f6c39e1c826 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/java/module-info.java @@ -0,0 +1,15 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +module com.azure.resourcemanager.awsconnector { + requires transitive com.azure.core.management; + + exports com.azure.resourcemanager.awsconnector; + exports com.azure.resourcemanager.awsconnector.fluent; + exports com.azure.resourcemanager.awsconnector.fluent.models; + exports com.azure.resourcemanager.awsconnector.models; + + opens com.azure.resourcemanager.awsconnector.fluent.models to com.azure.core; + opens com.azure.resourcemanager.awsconnector.models to com.azure.core; +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-awsconnector/proxy-config.json b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-awsconnector/proxy-config.json new file mode 100644 index 000000000000..0f4eb712e22a --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-awsconnector/proxy-config.json @@ -0,0 +1 @@ +[["com.azure.resourcemanager.awsconnector.implementation.AccessAnalyzerAnalyzersClientImpl$AccessAnalyzerAnalyzersService"],["com.azure.resourcemanager.awsconnector.implementation.AcmCertificateSummariesClientImpl$AcmCertificateSummariesService"],["com.azure.resourcemanager.awsconnector.implementation.ApiGatewayRestApisClientImpl$ApiGatewayRestApisService"],["com.azure.resourcemanager.awsconnector.implementation.ApiGatewayStagesClientImpl$ApiGatewayStagesService"],["com.azure.resourcemanager.awsconnector.implementation.AppSyncGraphqlApisClientImpl$AppSyncGraphqlApisService"],["com.azure.resourcemanager.awsconnector.implementation.AutoScalingAutoScalingGroupsClientImpl$AutoScalingAutoScalingGroupsService"],["com.azure.resourcemanager.awsconnector.implementation.CloudFormationStackSetsClientImpl$CloudFormationStackSetsService"],["com.azure.resourcemanager.awsconnector.implementation.CloudFormationStacksClientImpl$CloudFormationStacksService"],["com.azure.resourcemanager.awsconnector.implementation.CloudFrontDistributionsClientImpl$CloudFrontDistributionsService"],["com.azure.resourcemanager.awsconnector.implementation.CloudTrailTrailsClientImpl$CloudTrailTrailsService"],["com.azure.resourcemanager.awsconnector.implementation.CloudWatchAlarmsClientImpl$CloudWatchAlarmsService"],["com.azure.resourcemanager.awsconnector.implementation.CodeBuildProjectsClientImpl$CodeBuildProjectsService"],["com.azure.resourcemanager.awsconnector.implementation.CodeBuildSourceCredentialsInfosClientImpl$CodeBuildSourceCredentialsInfosService"],["com.azure.resourcemanager.awsconnector.implementation.ConfigServiceConfigurationRecorderStatusesClientImpl$ConfigServiceConfigurationRecorderStatusesService"],["com.azure.resourcemanager.awsconnector.implementation.ConfigServiceConfigurationRecordersClientImpl$ConfigServiceConfigurationRecordersService"],["com.azure.resourcemanager.awsconnector.implementation.ConfigServiceDeliveryChannelsClientImpl$ConfigServiceDeliveryChannelsService"],["com.azure.resourcemanager.awsconnector.implementation.DatabaseMigrationServiceReplicationInstancesClientImpl$DatabaseMigrationServiceReplicationInstancesService"],["com.azure.resourcemanager.awsconnector.implementation.DaxClustersClientImpl$DaxClustersService"],["com.azure.resourcemanager.awsconnector.implementation.DynamoDbContinuousBackupsDescriptionsClientImpl$DynamoDbContinuousBackupsDescriptionsService"],["com.azure.resourcemanager.awsconnector.implementation.DynamoDbTablesClientImpl$DynamoDbTablesService"],["com.azure.resourcemanager.awsconnector.implementation.Ec2AccountAttributesClientImpl$Ec2AccountAttributesService"],["com.azure.resourcemanager.awsconnector.implementation.Ec2AddressesClientImpl$Ec2AddressesService"],["com.azure.resourcemanager.awsconnector.implementation.Ec2FlowLogsClientImpl$Ec2FlowLogsService"],["com.azure.resourcemanager.awsconnector.implementation.Ec2ImagesClientImpl$Ec2ImagesService"],["com.azure.resourcemanager.awsconnector.implementation.Ec2InstanceStatusesClientImpl$Ec2InstanceStatusesService"],["com.azure.resourcemanager.awsconnector.implementation.Ec2InstancesClientImpl$Ec2InstancesService"],["com.azure.resourcemanager.awsconnector.implementation.Ec2IpamsClientImpl$Ec2IpamsService"],["com.azure.resourcemanager.awsconnector.implementation.Ec2KeyPairsClientImpl$Ec2KeyPairsService"],["com.azure.resourcemanager.awsconnector.implementation.Ec2NetworkAclsClientImpl$Ec2NetworkAclsService"],["com.azure.resourcemanager.awsconnector.implementation.Ec2NetworkInterfacesClientImpl$Ec2NetworkInterfacesService"],["com.azure.resourcemanager.awsconnector.implementation.Ec2RouteTablesClientImpl$Ec2RouteTablesService"],["com.azure.resourcemanager.awsconnector.implementation.Ec2SecurityGroupsClientImpl$Ec2SecurityGroupsService"],["com.azure.resourcemanager.awsconnector.implementation.Ec2SnapshotsClientImpl$Ec2SnapshotsService"],["com.azure.resourcemanager.awsconnector.implementation.Ec2SubnetsClientImpl$Ec2SubnetsService"],["com.azure.resourcemanager.awsconnector.implementation.Ec2VolumesClientImpl$Ec2VolumesService"],["com.azure.resourcemanager.awsconnector.implementation.Ec2VpcEndpointsClientImpl$Ec2VpcEndpointsService"],["com.azure.resourcemanager.awsconnector.implementation.Ec2VpcPeeringConnectionsClientImpl$Ec2VpcPeeringConnectionsService"],["com.azure.resourcemanager.awsconnector.implementation.Ec2VpcsClientImpl$Ec2VpcsService"],["com.azure.resourcemanager.awsconnector.implementation.EcrImageDetailsClientImpl$EcrImageDetailsService"],["com.azure.resourcemanager.awsconnector.implementation.EcrRepositoriesClientImpl$EcrRepositoriesService"],["com.azure.resourcemanager.awsconnector.implementation.EcsClustersClientImpl$EcsClustersService"],["com.azure.resourcemanager.awsconnector.implementation.EcsServicesClientImpl$EcsServicesService"],["com.azure.resourcemanager.awsconnector.implementation.EcsTaskDefinitionsClientImpl$EcsTaskDefinitionsService"],["com.azure.resourcemanager.awsconnector.implementation.EfsFileSystemsClientImpl$EfsFileSystemsService"],["com.azure.resourcemanager.awsconnector.implementation.EfsMountTargetsClientImpl$EfsMountTargetsService"],["com.azure.resourcemanager.awsconnector.implementation.EksClustersClientImpl$EksClustersService"],["com.azure.resourcemanager.awsconnector.implementation.EksNodegroupsClientImpl$EksNodegroupsService"],["com.azure.resourcemanager.awsconnector.implementation.ElasticBeanstalkApplicationsClientImpl$ElasticBeanstalkApplicationsService"],["com.azure.resourcemanager.awsconnector.implementation.ElasticBeanstalkConfigurationTemplatesClientImpl$ElasticBeanstalkConfigurationTemplatesService"],["com.azure.resourcemanager.awsconnector.implementation.ElasticBeanstalkEnvironmentsClientImpl$ElasticBeanstalkEnvironmentsService"],["com.azure.resourcemanager.awsconnector.implementation.ElasticLoadBalancingV2ListenersClientImpl$ElasticLoadBalancingV2ListenersService"],["com.azure.resourcemanager.awsconnector.implementation.ElasticLoadBalancingV2LoadBalancersClientImpl$ElasticLoadBalancingV2LoadBalancersService"],["com.azure.resourcemanager.awsconnector.implementation.ElasticLoadBalancingV2TargetGroupsClientImpl$ElasticLoadBalancingV2TargetGroupsService"],["com.azure.resourcemanager.awsconnector.implementation.ElasticLoadBalancingv2TargetHealthDescriptionsClientImpl$ElasticLoadBalancingv2TargetHealthDescriptionsService"],["com.azure.resourcemanager.awsconnector.implementation.EmrClusterSummariesClientImpl$EmrClusterSummariesService"],["com.azure.resourcemanager.awsconnector.implementation.EmrClustersClientImpl$EmrClustersService"],["com.azure.resourcemanager.awsconnector.implementation.GuardDutyDetectorsClientImpl$GuardDutyDetectorsService"],["com.azure.resourcemanager.awsconnector.implementation.IamAccessKeyLastUsedsClientImpl$IamAccessKeyLastUsedsService"],["com.azure.resourcemanager.awsconnector.implementation.IamAccessKeyMetadataInfoesClientImpl$IamAccessKeyMetadataInfoesService"],["com.azure.resourcemanager.awsconnector.implementation.IamGroupsClientImpl$IamGroupsService"],["com.azure.resourcemanager.awsconnector.implementation.IamInstanceProfilesClientImpl$IamInstanceProfilesService"],["com.azure.resourcemanager.awsconnector.implementation.IamMfaDevicesClientImpl$IamMfaDevicesService"],["com.azure.resourcemanager.awsconnector.implementation.IamPasswordPoliciesClientImpl$IamPasswordPoliciesService"],["com.azure.resourcemanager.awsconnector.implementation.IamPolicyVersionsClientImpl$IamPolicyVersionsService"],["com.azure.resourcemanager.awsconnector.implementation.IamRolesClientImpl$IamRolesService"],["com.azure.resourcemanager.awsconnector.implementation.IamServerCertificatesClientImpl$IamServerCertificatesService"],["com.azure.resourcemanager.awsconnector.implementation.IamVirtualMfaDevicesClientImpl$IamVirtualMfaDevicesService"],["com.azure.resourcemanager.awsconnector.implementation.KmsAliasesClientImpl$KmsAliasesService"],["com.azure.resourcemanager.awsconnector.implementation.KmsKeysClientImpl$KmsKeysService"],["com.azure.resourcemanager.awsconnector.implementation.LambdaFunctionCodeLocationsClientImpl$LambdaFunctionCodeLocationsService"],["com.azure.resourcemanager.awsconnector.implementation.LambdaFunctionsClientImpl$LambdaFunctionsService"],["com.azure.resourcemanager.awsconnector.implementation.LightsailBucketsClientImpl$LightsailBucketsService"],["com.azure.resourcemanager.awsconnector.implementation.LightsailInstancesClientImpl$LightsailInstancesService"],["com.azure.resourcemanager.awsconnector.implementation.LogsLogGroupsClientImpl$LogsLogGroupsService"],["com.azure.resourcemanager.awsconnector.implementation.LogsLogStreamsClientImpl$LogsLogStreamsService"],["com.azure.resourcemanager.awsconnector.implementation.LogsMetricFiltersClientImpl$LogsMetricFiltersService"],["com.azure.resourcemanager.awsconnector.implementation.LogsSubscriptionFiltersClientImpl$LogsSubscriptionFiltersService"],["com.azure.resourcemanager.awsconnector.implementation.Macie2JobSummariesClientImpl$Macie2JobSummariesService"],["com.azure.resourcemanager.awsconnector.implementation.MacieAllowListsClientImpl$MacieAllowListsService"],["com.azure.resourcemanager.awsconnector.implementation.NetworkFirewallFirewallPoliciesClientImpl$NetworkFirewallFirewallPoliciesService"],["com.azure.resourcemanager.awsconnector.implementation.NetworkFirewallFirewallsClientImpl$NetworkFirewallFirewallsService"],["com.azure.resourcemanager.awsconnector.implementation.NetworkFirewallRuleGroupsClientImpl$NetworkFirewallRuleGroupsService"],["com.azure.resourcemanager.awsconnector.implementation.OpenSearchDomainStatusesClientImpl$OpenSearchDomainStatusesService"],["com.azure.resourcemanager.awsconnector.implementation.OperationsClientImpl$OperationsService"],["com.azure.resourcemanager.awsconnector.implementation.OrganizationsAccountsClientImpl$OrganizationsAccountsService"],["com.azure.resourcemanager.awsconnector.implementation.OrganizationsOrganizationsClientImpl$OrganizationsOrganizationsService"],["com.azure.resourcemanager.awsconnector.implementation.RdsDbClustersClientImpl$RdsDbClustersService"],["com.azure.resourcemanager.awsconnector.implementation.RdsDbInstancesClientImpl$RdsDbInstancesService"],["com.azure.resourcemanager.awsconnector.implementation.RdsDbSnapshotAttributesResultsClientImpl$RdsDbSnapshotAttributesResultsService"],["com.azure.resourcemanager.awsconnector.implementation.RdsDbSnapshotsClientImpl$RdsDbSnapshotsService"],["com.azure.resourcemanager.awsconnector.implementation.RdsEventSubscriptionsClientImpl$RdsEventSubscriptionsService"],["com.azure.resourcemanager.awsconnector.implementation.RdsExportTasksClientImpl$RdsExportTasksService"],["com.azure.resourcemanager.awsconnector.implementation.RedshiftClusterParameterGroupsClientImpl$RedshiftClusterParameterGroupsService"],["com.azure.resourcemanager.awsconnector.implementation.RedshiftClustersClientImpl$RedshiftClustersService"],["com.azure.resourcemanager.awsconnector.implementation.Route53DomainsDomainSummariesClientImpl$Route53DomainsDomainSummariesService"],["com.azure.resourcemanager.awsconnector.implementation.Route53HostedZonesClientImpl$Route53HostedZonesService"],["com.azure.resourcemanager.awsconnector.implementation.Route53ResourceRecordSetsClientImpl$Route53ResourceRecordSetsService"],["com.azure.resourcemanager.awsconnector.implementation.S3AccessPointsClientImpl$S3AccessPointsService"],["com.azure.resourcemanager.awsconnector.implementation.S3BucketPoliciesClientImpl$S3BucketPoliciesService"],["com.azure.resourcemanager.awsconnector.implementation.S3BucketsClientImpl$S3BucketsService"],["com.azure.resourcemanager.awsconnector.implementation.S3ControlMultiRegionAccessPointPolicyDocumentsClientImpl$S3ControlMultiRegionAccessPointPolicyDocumentsService"],["com.azure.resourcemanager.awsconnector.implementation.SageMakerAppsClientImpl$SageMakerAppsService"],["com.azure.resourcemanager.awsconnector.implementation.SageMakerNotebookInstanceSummariesClientImpl$SageMakerNotebookInstanceSummariesService"],["com.azure.resourcemanager.awsconnector.implementation.SecretsManagerResourcePoliciesClientImpl$SecretsManagerResourcePoliciesService"],["com.azure.resourcemanager.awsconnector.implementation.SecretsManagerSecretsClientImpl$SecretsManagerSecretsService"],["com.azure.resourcemanager.awsconnector.implementation.SnsSubscriptionsClientImpl$SnsSubscriptionsService"],["com.azure.resourcemanager.awsconnector.implementation.SnsTopicsClientImpl$SnsTopicsService"],["com.azure.resourcemanager.awsconnector.implementation.SqsQueuesClientImpl$SqsQueuesService"],["com.azure.resourcemanager.awsconnector.implementation.SsmInstanceInformationsClientImpl$SsmInstanceInformationsService"],["com.azure.resourcemanager.awsconnector.implementation.SsmParametersClientImpl$SsmParametersService"],["com.azure.resourcemanager.awsconnector.implementation.SsmResourceComplianceSummaryItemsClientImpl$SsmResourceComplianceSummaryItemsService"],["com.azure.resourcemanager.awsconnector.implementation.WafWebAclSummariesClientImpl$WafWebAclSummariesService"],["com.azure.resourcemanager.awsconnector.implementation.Wafv2LoggingConfigurationsClientImpl$Wafv2LoggingConfigurationsService"]] \ No newline at end of file diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-awsconnector/reflect-config.json b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-awsconnector/reflect-config.json new file mode 100644 index 000000000000..0637a088a01e --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-awsconnector/reflect-config.json @@ -0,0 +1 @@ +[] \ No newline at end of file diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/AccessAnalyzerAnalyzersCreateOrReplaceSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/AccessAnalyzerAnalyzersCreateOrReplaceSamples.java new file mode 100644 index 000000000000..6da45c05f4e3 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/AccessAnalyzerAnalyzersCreateOrReplaceSamples.java @@ -0,0 +1,77 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +import com.azure.resourcemanager.awsconnector.models.AccessAnalyzerProperties; +import com.azure.resourcemanager.awsconnector.models.ArchiveRule; +import com.azure.resourcemanager.awsconnector.models.AwsAccessAnalyzerProperties; +import com.azure.resourcemanager.awsconnector.models.Filter; +import com.azure.resourcemanager.awsconnector.models.Tag; +import com.azure.resourcemanager.awsconnector.models.UnusedAccessConfiguration; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for AccessAnalyzerAnalyzers CreateOrReplace. + */ +public final class AccessAnalyzerAnalyzersCreateOrReplaceSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * AccessAnalyzerAnalyzers_CreateOrReplace.json + */ + /** + * Sample code: AccessAnalyzerAnalyzers_CreateOrReplace. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + accessAnalyzerAnalyzersCreateOrReplace(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.accessAnalyzerAnalyzers() + .define("Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])") + .withRegion("jpcbvhsspnqhnreartkjyr") + .withExistingResourceGroup("rgaccessAnalyzerAnalyzer") + .withTags(mapOf("key5531", "fakeTokenPlaceholder")) + .withProperties( + new AccessAnalyzerProperties() + .withAwsProperties( + new AwsAccessAnalyzerProperties() + .withAnalyzerConfiguration(new UnusedAccessConfiguration().withUnusedAccessAge(29)) + .withAnalyzerName("owom") + .withArchiveRules( + Arrays.asList(new ArchiveRule() + .withFilter(Arrays.asList(new Filter().withContains(Arrays.asList("hpzoliradchznu")) + .withEq(Arrays.asList("vlrqwrfkkwxvyxmqpbmwkxig")) + .withExists(true) + .withNeq(Arrays.asList("ro")) + .withProperty("pzndukmteempygtvmsrcrjulphe"))) + .withRuleName("hvfnklcbuefkibrtayx"))) + .withArn("bmt") + .withTags(Arrays + .asList(new Tag().withKey("fakeTokenPlaceholder").withValue("mtcjrbabaynnrmqttjf"))) + .withType("vswmvhmkyxepqkvvksbglssmrgg")) + .withPublicCloudConnectorsResourceId("qfefhuzrkvg") + .withAwsAccountId("pvsawejgihtmvcjqnob") + .withArn("dgzbebaorvepu") + .withPublicCloudResourceName("euuddejz") + .withAwsSourceSchema("ur") + .withAwsRegion("edosnsqdwcvgl") + .withAwsTags(mapOf("key746", "fakeTokenPlaceholder"))) + .create(); + } + + // Use "Map.of" if available + @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/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/AccessAnalyzerAnalyzersDeleteSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/AccessAnalyzerAnalyzersDeleteSamples.java new file mode 100644 index 000000000000..cf5cedc931fe --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/AccessAnalyzerAnalyzersDeleteSamples.java @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +/** + * Samples for AccessAnalyzerAnalyzers Delete. + */ +public final class AccessAnalyzerAnalyzersDeleteSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * AccessAnalyzerAnalyzers_Delete.json + */ + /** + * Sample code: AccessAnalyzerAnalyzers_Delete. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + accessAnalyzerAnalyzersDelete(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.accessAnalyzerAnalyzers() + .delete("rgaccessAnalyzerAnalyzer", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/AccessAnalyzerAnalyzersGetByResourceGroupSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/AccessAnalyzerAnalyzersGetByResourceGroupSamples.java new file mode 100644 index 000000000000..362eee11face --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/AccessAnalyzerAnalyzersGetByResourceGroupSamples.java @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +/** + * Samples for AccessAnalyzerAnalyzers GetByResourceGroup. + */ +public final class AccessAnalyzerAnalyzersGetByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * AccessAnalyzerAnalyzers_Get.json + */ + /** + * Sample code: AccessAnalyzerAnalyzers_Get. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void accessAnalyzerAnalyzersGet(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.accessAnalyzerAnalyzers() + .getByResourceGroupWithResponse("rgaccessAnalyzerAnalyzer", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/AccessAnalyzerAnalyzersListByResourceGroupSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/AccessAnalyzerAnalyzersListByResourceGroupSamples.java new file mode 100644 index 000000000000..c17eabe0c5bb --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/AccessAnalyzerAnalyzersListByResourceGroupSamples.java @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +/** + * Samples for AccessAnalyzerAnalyzers ListByResourceGroup. + */ +public final class AccessAnalyzerAnalyzersListByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * AccessAnalyzerAnalyzers_ListByResourceGroup.json + */ + /** + * Sample code: AccessAnalyzerAnalyzers_ListByResourceGroup. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + accessAnalyzerAnalyzersListByResourceGroup(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.accessAnalyzerAnalyzers() + .listByResourceGroup("rgaccessAnalyzerAnalyzer", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/AccessAnalyzerAnalyzersListSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/AccessAnalyzerAnalyzersListSamples.java new file mode 100644 index 000000000000..ae17cb31056b --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/AccessAnalyzerAnalyzersListSamples.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +/** + * Samples for AccessAnalyzerAnalyzers List. + */ +public final class AccessAnalyzerAnalyzersListSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * AccessAnalyzerAnalyzers_ListBySubscription.json + */ + /** + * Sample code: AccessAnalyzerAnalyzers_ListBySubscription. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + accessAnalyzerAnalyzersListBySubscription(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.accessAnalyzerAnalyzers().list(com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/AccessAnalyzerAnalyzersUpdateSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/AccessAnalyzerAnalyzersUpdateSamples.java new file mode 100644 index 000000000000..75dceeb1ba98 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/AccessAnalyzerAnalyzersUpdateSamples.java @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +import com.azure.resourcemanager.awsconnector.models.AccessAnalyzer; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for AccessAnalyzerAnalyzers Update. + */ +public final class AccessAnalyzerAnalyzersUpdateSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * AccessAnalyzerAnalyzers_Update.json + */ + /** + * Sample code: AccessAnalyzerAnalyzers_Update. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + accessAnalyzerAnalyzersUpdate(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + AccessAnalyzer resource = manager.accessAnalyzerAnalyzers() + .getByResourceGroupWithResponse("rgaccessAnalyzerAnalyzer", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE) + .getValue(); + resource.update().withTags(mapOf("key1003", "fakeTokenPlaceholder")).apply(); + } + + // Use "Map.of" if available + @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/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/AcmCertificateSummariesCreateOrReplaceSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/AcmCertificateSummariesCreateOrReplaceSamples.java new file mode 100644 index 000000000000..1ef347b40fae --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/AcmCertificateSummariesCreateOrReplaceSamples.java @@ -0,0 +1,88 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +import com.azure.resourcemanager.awsconnector.models.AcmCertificateSummaryProperties; +import com.azure.resourcemanager.awsconnector.models.AwsAcmCertificateSummaryProperties; +import com.azure.resourcemanager.awsconnector.models.CertificateStatus; +import com.azure.resourcemanager.awsconnector.models.CertificateStatusEnumValue; +import com.azure.resourcemanager.awsconnector.models.CertificateType; +import com.azure.resourcemanager.awsconnector.models.CertificateTypeEnumValue; +import com.azure.resourcemanager.awsconnector.models.ExtendedKeyUsageName; +import com.azure.resourcemanager.awsconnector.models.KeyAlgorithm; +import com.azure.resourcemanager.awsconnector.models.KeyAlgorithmEnumValue; +import com.azure.resourcemanager.awsconnector.models.KeyUsageName; +import com.azure.resourcemanager.awsconnector.models.RenewalEligibility; +import com.azure.resourcemanager.awsconnector.models.RenewalEligibilityEnumValue; +import java.time.OffsetDateTime; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for AcmCertificateSummaries CreateOrReplace. + */ +public final class AcmCertificateSummariesCreateOrReplaceSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * AcmCertificateSummaries_CreateOrReplace.json + */ + /** + * Sample code: AcmCertificateSummaries_CreateOrReplace. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + acmCertificateSummariesCreateOrReplace(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.acmCertificateSummaries() + .define("Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])") + .withRegion("eqfgreyihqzkrcyaxvy") + .withExistingResourceGroup("rgacmCertificateSummary") + .withTags(mapOf("key9243", "fakeTokenPlaceholder")) + .withProperties( + new AcmCertificateSummaryProperties() + .withAwsProperties( + new AwsAcmCertificateSummaryProperties().withCertificateArn("vhqvrajxbcvstwiktrdilktqiwnsij") + .withCreatedAt(OffsetDateTime.parse("2024-10-08T03:50:37.721Z")) + .withDomainName("fiqx") + .withExported(true) + .withExtendedKeyUsages(Arrays.asList(ExtendedKeyUsageName.ANY)) + .withHasAdditionalSubjectAlternativeNames(true) + .withImportedAt(OffsetDateTime.parse("2024-10-08T03:50:37.721Z")) + .withInUse(true) + .withIssuedAt(OffsetDateTime.parse("2024-10-08T03:50:37.721Z")) + .withKeyAlgorithm(new KeyAlgorithmEnumValue().withValue(KeyAlgorithm.EC_PRIME256V1)) + .withKeyUsages(Arrays.asList(KeyUsageName.ANY)) + .withNotAfter(OffsetDateTime.parse("2024-10-08T03:50:37.721Z")) + .withNotBefore(OffsetDateTime.parse("2024-10-08T03:50:37.721Z")) + .withRenewalEligibility( + new RenewalEligibilityEnumValue().withValue(RenewalEligibility.ELIGIBLE)) + .withRevokedAt(OffsetDateTime.parse("2024-10-08T03:50:37.722Z")) + .withStatus(new CertificateStatusEnumValue().withValue(CertificateStatus.EXPIRED)) + .withSubjectAlternativeNameSummaries(Arrays.asList("oqoukflpt")) + .withType(new CertificateTypeEnumValue().withValue(CertificateType.AMAZON_ISSUED))) + .withPublicCloudConnectorsResourceId("xljncqoovqhqla") + .withAwsAccountId("mmihqxcdhmlvxmnbgspuxddg") + .withArn("smalkenxqfohwtuwomvsiijg") + .withPublicCloudResourceName("qdwfldkrmzyifdlfjpxducgue") + .withAwsSourceSchema("llzijlhflcpnbwpp") + .withAwsRegion("vkxrwhsmzwvxzraytkujjlrzxdpbz") + .withAwsTags(mapOf("key6233", "fakeTokenPlaceholder"))) + .create(); + } + + // Use "Map.of" if available + @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/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/AcmCertificateSummariesDeleteSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/AcmCertificateSummariesDeleteSamples.java new file mode 100644 index 000000000000..e4ebbfc8c1c8 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/AcmCertificateSummariesDeleteSamples.java @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +/** + * Samples for AcmCertificateSummaries Delete. + */ +public final class AcmCertificateSummariesDeleteSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * AcmCertificateSummaries_Delete.json + */ + /** + * Sample code: AcmCertificateSummaries_Delete. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + acmCertificateSummariesDelete(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.acmCertificateSummaries() + .delete("rgacmCertificateSummary", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/AcmCertificateSummariesGetByResourceGroupSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/AcmCertificateSummariesGetByResourceGroupSamples.java new file mode 100644 index 000000000000..9840897c4a54 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/AcmCertificateSummariesGetByResourceGroupSamples.java @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +/** + * Samples for AcmCertificateSummaries GetByResourceGroup. + */ +public final class AcmCertificateSummariesGetByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * AcmCertificateSummaries_Get.json + */ + /** + * Sample code: AcmCertificateSummaries_Get. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void acmCertificateSummariesGet(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.acmCertificateSummaries() + .getByResourceGroupWithResponse("rgacmCertificateSummary", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/AcmCertificateSummariesListByResourceGroupSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/AcmCertificateSummariesListByResourceGroupSamples.java new file mode 100644 index 000000000000..85ab51dd25a5 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/AcmCertificateSummariesListByResourceGroupSamples.java @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +/** + * Samples for AcmCertificateSummaries ListByResourceGroup. + */ +public final class AcmCertificateSummariesListByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * AcmCertificateSummaries_ListByResourceGroup.json + */ + /** + * Sample code: AcmCertificateSummaries_ListByResourceGroup. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + acmCertificateSummariesListByResourceGroup(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.acmCertificateSummaries() + .listByResourceGroup("rgacmCertificateSummary", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/AcmCertificateSummariesListSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/AcmCertificateSummariesListSamples.java new file mode 100644 index 000000000000..c738dbdc0ca5 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/AcmCertificateSummariesListSamples.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +/** + * Samples for AcmCertificateSummaries List. + */ +public final class AcmCertificateSummariesListSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * AcmCertificateSummaries_ListBySubscription.json + */ + /** + * Sample code: AcmCertificateSummaries_ListBySubscription. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + acmCertificateSummariesListBySubscription(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.acmCertificateSummaries().list(com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/AcmCertificateSummariesUpdateSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/AcmCertificateSummariesUpdateSamples.java new file mode 100644 index 000000000000..e1f223cf521f --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/AcmCertificateSummariesUpdateSamples.java @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +import com.azure.resourcemanager.awsconnector.models.AcmCertificateSummary; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for AcmCertificateSummaries Update. + */ +public final class AcmCertificateSummariesUpdateSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * AcmCertificateSummaries_Update.json + */ + /** + * Sample code: AcmCertificateSummaries_Update. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + acmCertificateSummariesUpdate(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + AcmCertificateSummary resource = manager.acmCertificateSummaries() + .getByResourceGroupWithResponse("rgacmCertificateSummary", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE) + .getValue(); + resource.update().withTags(mapOf("key3895", "fakeTokenPlaceholder")).apply(); + } + + // Use "Map.of" if available + @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/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/ApiGatewayRestApisCreateOrReplaceSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/ApiGatewayRestApisCreateOrReplaceSamples.java new file mode 100644 index 000000000000..9b34a537e0c4 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/ApiGatewayRestApisCreateOrReplaceSamples.java @@ -0,0 +1,83 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +import com.azure.resourcemanager.awsconnector.models.ApiGatewayRestApiProperties; +import com.azure.resourcemanager.awsconnector.models.AwsApiGatewayRestApiProperties; +import com.azure.resourcemanager.awsconnector.models.EndpointConfiguration; +import com.azure.resourcemanager.awsconnector.models.S3Location; +import com.azure.resourcemanager.awsconnector.models.TagAutoGenerated; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for ApiGatewayRestApis CreateOrReplace. + */ +public final class ApiGatewayRestApisCreateOrReplaceSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * ApiGatewayRestApis_CreateOrReplace.json + */ + /** + * Sample code: ApiGatewayRestApis_CreateOrReplace. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + apiGatewayRestApisCreateOrReplace(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.apiGatewayRestApis() + .define("Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])") + .withRegion("lvqczthlir") + .withExistingResourceGroup("rgapiGatewayRestApi") + .withTags(mapOf("key4163", "fakeTokenPlaceholder")) + .withProperties( + new ApiGatewayRestApiProperties() + .withAwsProperties(new AwsApiGatewayRestApiProperties().withApiKeySourceType("fakeTokenPlaceholder") + .withBinaryMediaTypes(Arrays.asList("ahebgkheozatj")) + .withBody(mapOf()) + .withBodyS3Location(new S3Location().withBucket("oyosqpl") + .withEtag("uuzlkbqlua") + .withKey("fakeTokenPlaceholder") + .withVersion("lxbmxdrsftqwazmgxlokuvf")) + .withCloneFrom("boxfqilij") + .withDescription("ngqhnoniiohuwofr") + .withDisableExecuteApiEndpoint(true) + .withEndpointConfiguration( + new EndpointConfiguration().withTypes(Arrays.asList("dfhdcsvbasfadeuneaz")) + .withVpcEndpointIds(Arrays.asList("evzbafcpdpklwppge"))) + .withFailOnWarnings(true) + .withMinimumCompressionSize(11) + .withMode("odjmjlcgkmskasrasoegyxnuqr") + .withName("ioyxag") + .withParameters(mapOf("key9886", "fakeTokenPlaceholder")) + .withPolicy("jefpbspvgtinulqfyjxuxcunzkpgvw") + .withRestApiId("hlyfcdcgknhbjezdxgbg") + .withRootResourceId("jfmgp") + .withTags(Arrays + .asList(new TagAutoGenerated().withKey("fakeTokenPlaceholder").withValue("uozcrgrc")))) + .withPublicCloudConnectorsResourceId("diszsfnljduoshvzzgcyypsjnxs") + .withAwsAccountId("qjcvyhdegwhvzsiuqjwnvdqs") + .withArn("mjkvrfpgenxbfozh") + .withPublicCloudResourceName("tvtpphxonsvnvtmccbpcsvvvslbxxc") + .withAwsSourceSchema("oagqktjiz") + .withAwsRegion("bzj") + .withAwsTags(mapOf("key5478", "fakeTokenPlaceholder"))) + .create(); + } + + // Use "Map.of" if available + @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/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/ApiGatewayRestApisDeleteSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/ApiGatewayRestApisDeleteSamples.java new file mode 100644 index 000000000000..1d4443d15c7e --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/ApiGatewayRestApisDeleteSamples.java @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +/** + * Samples for ApiGatewayRestApis Delete. + */ +public final class ApiGatewayRestApisDeleteSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * ApiGatewayRestApis_Delete.json + */ + /** + * Sample code: ApiGatewayRestApis_Delete. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void apiGatewayRestApisDelete(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.apiGatewayRestApis() + .delete("rgapiGatewayRestApi", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/ApiGatewayRestApisGetByResourceGroupSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/ApiGatewayRestApisGetByResourceGroupSamples.java new file mode 100644 index 000000000000..ad72ff941773 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/ApiGatewayRestApisGetByResourceGroupSamples.java @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +/** + * Samples for ApiGatewayRestApis GetByResourceGroup. + */ +public final class ApiGatewayRestApisGetByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * ApiGatewayRestApis_Get.json + */ + /** + * Sample code: ApiGatewayRestApis_Get. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void apiGatewayRestApisGet(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.apiGatewayRestApis() + .getByResourceGroupWithResponse("rgapiGatewayRestApi", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/ApiGatewayRestApisListByResourceGroupSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/ApiGatewayRestApisListByResourceGroupSamples.java new file mode 100644 index 000000000000..67a802a82e39 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/ApiGatewayRestApisListByResourceGroupSamples.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +/** + * Samples for ApiGatewayRestApis ListByResourceGroup. + */ +public final class ApiGatewayRestApisListByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * ApiGatewayRestApis_ListByResourceGroup.json + */ + /** + * Sample code: ApiGatewayRestApis_ListByResourceGroup. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + apiGatewayRestApisListByResourceGroup(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.apiGatewayRestApis().listByResourceGroup("rgapiGatewayRestApi", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/ApiGatewayRestApisListSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/ApiGatewayRestApisListSamples.java new file mode 100644 index 000000000000..54502da8c556 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/ApiGatewayRestApisListSamples.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +/** + * Samples for ApiGatewayRestApis List. + */ +public final class ApiGatewayRestApisListSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * ApiGatewayRestApis_ListBySubscription.json + */ + /** + * Sample code: ApiGatewayRestApis_ListBySubscription. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + apiGatewayRestApisListBySubscription(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.apiGatewayRestApis().list(com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/ApiGatewayRestApisUpdateSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/ApiGatewayRestApisUpdateSamples.java new file mode 100644 index 000000000000..716267992f7e --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/ApiGatewayRestApisUpdateSamples.java @@ -0,0 +1,45 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +import com.azure.resourcemanager.awsconnector.models.ApiGatewayRestApi; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for ApiGatewayRestApis Update. + */ +public final class ApiGatewayRestApisUpdateSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * ApiGatewayRestApis_Update.json + */ + /** + * Sample code: ApiGatewayRestApis_Update. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void apiGatewayRestApisUpdate(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + ApiGatewayRestApi resource = manager.apiGatewayRestApis() + .getByResourceGroupWithResponse("rgapiGatewayRestApi", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE) + .getValue(); + resource.update().withTags(mapOf("key2677", "fakeTokenPlaceholder")).apply(); + } + + // Use "Map.of" if available + @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/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/ApiGatewayStagesCreateOrReplaceSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/ApiGatewayStagesCreateOrReplaceSamples.java new file mode 100644 index 000000000000..5b5bf6fb821b --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/ApiGatewayStagesCreateOrReplaceSamples.java @@ -0,0 +1,88 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +import com.azure.resourcemanager.awsconnector.models.AccessLogSetting; +import com.azure.resourcemanager.awsconnector.models.ApiGatewayStageProperties; +import com.azure.resourcemanager.awsconnector.models.AwsApiGatewayStageProperties; +import com.azure.resourcemanager.awsconnector.models.CanarySetting; +import com.azure.resourcemanager.awsconnector.models.MethodSetting; +import com.azure.resourcemanager.awsconnector.models.TagAutoGenerated2; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for ApiGatewayStages CreateOrReplace. + */ +public final class ApiGatewayStagesCreateOrReplaceSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * ApiGatewayStages_CreateOrReplace.json + */ + /** + * Sample code: ApiGatewayStages_CreateOrReplace. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + apiGatewayStagesCreateOrReplace(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.apiGatewayStages() + .define("Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])") + .withRegion("ixsfvcwygoceaaydsgkvubn") + .withExistingResourceGroup("rgapiGatewayStage") + .withTags(mapOf("key72", "fakeTokenPlaceholder")) + .withProperties(new ApiGatewayStageProperties() + .withAwsProperties(new AwsApiGatewayStageProperties() + .withAccessLogSetting( + new AccessLogSetting().withDestinationArn("bjnehkhrjvy").withFormat("jyhhqidjew")) + .withCacheClusterEnabled(true) + .withCacheClusterSize("tqpsxptkwagykhry") + .withCanarySetting(new CanarySetting().withDeploymentId("jgfflpjviovk") + .withPercentTraffic(30) + .withStageVariableOverrides(mapOf("key989", "fakeTokenPlaceholder")) + .withUseStageCache(true)) + .withClientCertificateId("lcqbeactfdarpess") + .withDeploymentId("muwatddsfb") + .withDescription("dmxblpsncciutbbmfihkloqaxuab") + .withDocumentationVersion("fltvrg") + .withMethodSettings(Arrays.asList(new MethodSetting().withCacheDataEncrypted(true) + .withCacheTtlInSeconds(15) + .withCachingEnabled(true) + .withDataTraceEnabled(true) + .withHttpMethod("wojjxwrlnmnertmfkstofcoekjxd") + .withLoggingLevel("cezcwkojlmp") + .withMetricsEnabled(true) + .withResourcePath("fsaykfuxsfvultpnnpjjbak") + .withThrottlingBurstLimit(3) + .withThrottlingRateLimit(28))) + .withRestApiId("cycztypxndrdmstjwi") + .withStageName("iukgreicaikhlooycykkql") + .withTags(Arrays.asList(new TagAutoGenerated2().withKey("fakeTokenPlaceholder").withValue("x"))) + .withTracingEnabled(true) + .withVariables(mapOf("key3007", "fakeTokenPlaceholder"))) + .withPublicCloudConnectorsResourceId("mvvltlx") + .withAwsAccountId("umvnhbnjqbgppgipyiuxvyt") + .withArn("aitrzss") + .withPublicCloudResourceName("hxgdpqw") + .withAwsSourceSchema("ttwdzidmknfow") + .withAwsRegion("qkjxqupbneeuooyrfnblmwlrpmjsiu") + .withAwsTags(mapOf("key1607", "fakeTokenPlaceholder"))) + .create(); + } + + // Use "Map.of" if available + @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/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/ApiGatewayStagesDeleteSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/ApiGatewayStagesDeleteSamples.java new file mode 100644 index 000000000000..00d49159fff4 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/ApiGatewayStagesDeleteSamples.java @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +/** + * Samples for ApiGatewayStages Delete. + */ +public final class ApiGatewayStagesDeleteSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * ApiGatewayStages_Delete.json + */ + /** + * Sample code: ApiGatewayStages_Delete. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void apiGatewayStagesDelete(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.apiGatewayStages() + .delete("rgapiGatewayStage", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/ApiGatewayStagesGetByResourceGroupSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/ApiGatewayStagesGetByResourceGroupSamples.java new file mode 100644 index 000000000000..e0e8732daa3e --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/ApiGatewayStagesGetByResourceGroupSamples.java @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +/** + * Samples for ApiGatewayStages GetByResourceGroup. + */ +public final class ApiGatewayStagesGetByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * ApiGatewayStages_Get.json + */ + /** + * Sample code: ApiGatewayStages_Get. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void apiGatewayStagesGet(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.apiGatewayStages() + .getByResourceGroupWithResponse("rgapiGatewayStage", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/ApiGatewayStagesListByResourceGroupSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/ApiGatewayStagesListByResourceGroupSamples.java new file mode 100644 index 000000000000..d42822a80683 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/ApiGatewayStagesListByResourceGroupSamples.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +/** + * Samples for ApiGatewayStages ListByResourceGroup. + */ +public final class ApiGatewayStagesListByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * ApiGatewayStages_ListByResourceGroup.json + */ + /** + * Sample code: ApiGatewayStages_ListByResourceGroup. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + apiGatewayStagesListByResourceGroup(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.apiGatewayStages().listByResourceGroup("rgapiGatewayStage", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/ApiGatewayStagesListSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/ApiGatewayStagesListSamples.java new file mode 100644 index 000000000000..68a4c5555b77 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/ApiGatewayStagesListSamples.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +/** + * Samples for ApiGatewayStages List. + */ +public final class ApiGatewayStagesListSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * ApiGatewayStages_ListBySubscription.json + */ + /** + * Sample code: ApiGatewayStages_ListBySubscription. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + apiGatewayStagesListBySubscription(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.apiGatewayStages().list(com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/ApiGatewayStagesUpdateSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/ApiGatewayStagesUpdateSamples.java new file mode 100644 index 000000000000..1682656db95a --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/ApiGatewayStagesUpdateSamples.java @@ -0,0 +1,45 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +import com.azure.resourcemanager.awsconnector.models.ApiGatewayStage; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for ApiGatewayStages Update. + */ +public final class ApiGatewayStagesUpdateSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * ApiGatewayStages_Update.json + */ + /** + * Sample code: ApiGatewayStages_Update. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void apiGatewayStagesUpdate(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + ApiGatewayStage resource = manager.apiGatewayStages() + .getByResourceGroupWithResponse("rgapiGatewayStage", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE) + .getValue(); + resource.update().withTags(mapOf("key149", "fakeTokenPlaceholder")).apply(); + } + + // Use "Map.of" if available + @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/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/AppSyncGraphqlApisCreateOrReplaceSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/AppSyncGraphqlApisCreateOrReplaceSamples.java new file mode 100644 index 000000000000..25bef13b33ff --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/AppSyncGraphqlApisCreateOrReplaceSamples.java @@ -0,0 +1,137 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +import com.azure.resourcemanager.awsconnector.models.AdditionalAuthenticationProvider; +import com.azure.resourcemanager.awsconnector.models.AppSyncGraphqlApiProperties; +import com.azure.resourcemanager.awsconnector.models.AuthenticationType; +import com.azure.resourcemanager.awsconnector.models.AuthenticationTypeEnumValue; +import com.azure.resourcemanager.awsconnector.models.AwsAppSyncGraphqlApiProperties; +import com.azure.resourcemanager.awsconnector.models.CognitoUserPoolConfig; +import com.azure.resourcemanager.awsconnector.models.DataSourceLevelMetricsBehavior; +import com.azure.resourcemanager.awsconnector.models.DataSourceLevelMetricsBehaviorEnumValue; +import com.azure.resourcemanager.awsconnector.models.DefaultAction; +import com.azure.resourcemanager.awsconnector.models.DefaultActionEnumValue; +import com.azure.resourcemanager.awsconnector.models.EnhancedMetricsConfig; +import com.azure.resourcemanager.awsconnector.models.FieldLogLevel; +import com.azure.resourcemanager.awsconnector.models.FieldLogLevelEnumValue; +import com.azure.resourcemanager.awsconnector.models.GraphQLApiIntrospectionConfig; +import com.azure.resourcemanager.awsconnector.models.GraphQLApiIntrospectionConfigEnumValue; +import com.azure.resourcemanager.awsconnector.models.GraphQLApiType; +import com.azure.resourcemanager.awsconnector.models.GraphQLApiTypeEnumValue; +import com.azure.resourcemanager.awsconnector.models.GraphQLApiVisibility; +import com.azure.resourcemanager.awsconnector.models.GraphQLApiVisibilityEnumValue; +import com.azure.resourcemanager.awsconnector.models.LambdaAuthorizerConfig; +import com.azure.resourcemanager.awsconnector.models.LogConfig; +import com.azure.resourcemanager.awsconnector.models.OpenIdConnectConfig; +import com.azure.resourcemanager.awsconnector.models.OperationLevelMetricsConfig; +import com.azure.resourcemanager.awsconnector.models.OperationLevelMetricsConfigEnumValue; +import com.azure.resourcemanager.awsconnector.models.ResolverLevelMetricsBehavior; +import com.azure.resourcemanager.awsconnector.models.ResolverLevelMetricsBehaviorEnumValue; +import com.azure.resourcemanager.awsconnector.models.UserPoolConfig; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for AppSyncGraphqlApis CreateOrReplace. + */ +public final class AppSyncGraphqlApisCreateOrReplaceSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * AppSyncGraphqlApis_CreateOrReplace.json + */ + /** + * Sample code: AppSyncGraphqlApis_CreateOrReplace. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + appSyncGraphqlApisCreateOrReplace(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.appSyncGraphqlApis() + .define("Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])") + .withRegion("fgdkdvbltlygm") + .withExistingResourceGroup("rgappSyncGraphqlApi") + .withTags(mapOf("key1836", "fakeTokenPlaceholder")) + .withProperties( + new AppSyncGraphqlApiProperties() + .withAwsProperties(new AwsAppSyncGraphqlApiProperties() + .withAdditionalAuthenticationProviders(Arrays.asList(new AdditionalAuthenticationProvider() + .withAuthenticationType(new AuthenticationTypeEnumValue() + .withValue(AuthenticationType.AMAZON_COGNITO_USER_POOLS)) + .withLambdaAuthorizerConfig( + new LambdaAuthorizerConfig().withAuthorizerResultTtlInSeconds(30) + .withAuthorizerUri("hupypfpuanzvftlniinspu") + .withIdentityValidationExpression("hspldtc")) + .withOpenIdConnectConfig(new OpenIdConnectConfig().withAuthTtl(22L) + .withClientId("luiqpcaoupuxlkhifmjmssaujivibq") + .withIatTtl(12L) + .withIssuer("gxglhkdfnvrrtsalksedpcukpk")) + .withUserPoolConfig(new CognitoUserPoolConfig().withAppIdClientRegex("qpfpcfsunn") + .withAwsRegion("nmpxe") + .withUserPoolId("jelygyotigqdtvomkxwllisaodzpme")))) + .withApiId("czvdzpkqmu") + .withApiType(new GraphQLApiTypeEnumValue().withValue(GraphQLApiType.GRAPHQL)) + .withArn("oasogwqjupaovgjaimqwyvcevu") + .withAuthenticationType( + new AuthenticationTypeEnumValue().withValue(AuthenticationType.AMAZON_COGNITO_USER_POOLS)) + .withDns(mapOf("key7870", "fakeTokenPlaceholder")) + .withEnhancedMetricsConfig(new EnhancedMetricsConfig() + .withDataSourceLevelMetricsBehavior(new DataSourceLevelMetricsBehaviorEnumValue() + .withValue(DataSourceLevelMetricsBehavior.FULL_REQUEST_DATA_SOURCE_METRICS)) + .withOperationLevelMetricsConfig(new OperationLevelMetricsConfigEnumValue() + .withValue(OperationLevelMetricsConfig.DISABLED)) + .withResolverLevelMetricsBehavior(new ResolverLevelMetricsBehaviorEnumValue() + .withValue(ResolverLevelMetricsBehavior.FULL_REQUEST_RESOLVER_METRICS))) + .withIntrospectionConfig(new GraphQLApiIntrospectionConfigEnumValue() + .withValue(GraphQLApiIntrospectionConfig.DISABLED)) + .withLambdaAuthorizerConfig(new LambdaAuthorizerConfig().withAuthorizerResultTtlInSeconds(30) + .withAuthorizerUri("hupypfpuanzvftlniinspu") + .withIdentityValidationExpression("hspldtc")) + .withLogConfig(new LogConfig().withCloudWatchLogsRoleArn("gsfpxvghd") + .withExcludeVerboseContent(true) + .withFieldLogLevel(new FieldLogLevelEnumValue().withValue(FieldLogLevel.ALL))) + .withMergedApiExecutionRoleArn("ehtdxecdhgxhmtqhpneaqzgdtivz") + .withName("ahvfu") + .withOpenIdConnectConfig(new OpenIdConnectConfig().withAuthTtl(22L) + .withClientId("luiqpcaoupuxlkhifmjmssaujivibq") + .withIatTtl(12L) + .withIssuer("gxglhkdfnvrrtsalksedpcukpk")) + .withOwner("pdudimkqozuoczxvlgmj") + .withOwnerContact("qkvw") + .withQueryDepthLimit(14) + .withResolverCountLimit(15) + .withTags(mapOf("key7170", "fakeTokenPlaceholder")) + .withUris(mapOf("key6507", "fakeTokenPlaceholder")) + .withUserPoolConfig(new UserPoolConfig().withAppIdClientRegex("kjfgmmyyzmsywex") + .withAwsRegion("knaq") + .withDefaultAction(new DefaultActionEnumValue().withValue(DefaultAction.ALLOW)) + .withUserPoolId("tbbntrreowxutvnasgmcdupsaxoooz")) + .withVisibility(new GraphQLApiVisibilityEnumValue().withValue(GraphQLApiVisibility.GLOBAL)) + .withWafWebAclArn("fpy") + .withXrayEnabled(true)) + .withPublicCloudConnectorsResourceId("ljxfphaevwpkqtymdowsbhw") + .withAwsAccountId("cbznxz") + .withArn("yozrofizgppbrqqingfk") + .withPublicCloudResourceName("xqnxjggrhseymoklvqpreiucveuev") + .withAwsSourceSchema("hldvwyk") + .withAwsRegion("ponyxnfudopabngrux") + .withAwsTags(mapOf("key8377", "fakeTokenPlaceholder"))) + .create(); + } + + // Use "Map.of" if available + @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/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/AppSyncGraphqlApisDeleteSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/AppSyncGraphqlApisDeleteSamples.java new file mode 100644 index 000000000000..339a70ee5097 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/AppSyncGraphqlApisDeleteSamples.java @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +/** + * Samples for AppSyncGraphqlApis Delete. + */ +public final class AppSyncGraphqlApisDeleteSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * AppSyncGraphqlApis_Delete.json + */ + /** + * Sample code: AppSyncGraphqlApis_Delete. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void appSyncGraphqlApisDelete(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.appSyncGraphqlApis() + .delete("rgappSyncGraphqlApi", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/AppSyncGraphqlApisGetByResourceGroupSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/AppSyncGraphqlApisGetByResourceGroupSamples.java new file mode 100644 index 000000000000..f6c24da12823 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/AppSyncGraphqlApisGetByResourceGroupSamples.java @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +/** + * Samples for AppSyncGraphqlApis GetByResourceGroup. + */ +public final class AppSyncGraphqlApisGetByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * AppSyncGraphqlApis_Get.json + */ + /** + * Sample code: AppSyncGraphqlApis_Get. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void appSyncGraphqlApisGet(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.appSyncGraphqlApis() + .getByResourceGroupWithResponse("rgappSyncGraphqlApi", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/AppSyncGraphqlApisListByResourceGroupSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/AppSyncGraphqlApisListByResourceGroupSamples.java new file mode 100644 index 000000000000..e11ba8bae1b5 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/AppSyncGraphqlApisListByResourceGroupSamples.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +/** + * Samples for AppSyncGraphqlApis ListByResourceGroup. + */ +public final class AppSyncGraphqlApisListByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * AppSyncGraphqlApis_ListByResourceGroup.json + */ + /** + * Sample code: AppSyncGraphqlApis_ListByResourceGroup. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + appSyncGraphqlApisListByResourceGroup(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.appSyncGraphqlApis().listByResourceGroup("rgappSyncGraphqlApi", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/AppSyncGraphqlApisListSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/AppSyncGraphqlApisListSamples.java new file mode 100644 index 000000000000..2f6e2d86243e --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/AppSyncGraphqlApisListSamples.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +/** + * Samples for AppSyncGraphqlApis List. + */ +public final class AppSyncGraphqlApisListSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * AppSyncGraphqlApis_ListBySubscription.json + */ + /** + * Sample code: AppSyncGraphqlApis_ListBySubscription. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + appSyncGraphqlApisListBySubscription(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.appSyncGraphqlApis().list(com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/AppSyncGraphqlApisUpdateSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/AppSyncGraphqlApisUpdateSamples.java new file mode 100644 index 000000000000..c7667bbf56f8 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/AppSyncGraphqlApisUpdateSamples.java @@ -0,0 +1,45 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +import com.azure.resourcemanager.awsconnector.models.AppSyncGraphqlApi; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for AppSyncGraphqlApis Update. + */ +public final class AppSyncGraphqlApisUpdateSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * AppSyncGraphqlApis_Update.json + */ + /** + * Sample code: AppSyncGraphqlApis_Update. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void appSyncGraphqlApisUpdate(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + AppSyncGraphqlApi resource = manager.appSyncGraphqlApis() + .getByResourceGroupWithResponse("rgappSyncGraphqlApi", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE) + .getValue(); + resource.update().withTags(mapOf("key3768", "fakeTokenPlaceholder")).apply(); + } + + // Use "Map.of" if available + @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/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/AutoScalingAutoScalingGroupsCreateOrReplaceSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/AutoScalingAutoScalingGroupsCreateOrReplaceSamples.java new file mode 100644 index 000000000000..f10e6683d0cf --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/AutoScalingAutoScalingGroupsCreateOrReplaceSamples.java @@ -0,0 +1,179 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +import com.azure.resourcemanager.awsconnector.models.AcceleratorCountRequest; +import com.azure.resourcemanager.awsconnector.models.AcceleratorTotalMemoryMiBRequest; +import com.azure.resourcemanager.awsconnector.models.AutoScalingGroupProperties; +import com.azure.resourcemanager.awsconnector.models.AwsAutoScalingGroupProperties; +import com.azure.resourcemanager.awsconnector.models.BaselineEbsBandwidthMbpsRequest; +import com.azure.resourcemanager.awsconnector.models.InstanceMaintenancePolicy; +import com.azure.resourcemanager.awsconnector.models.InstanceRequirements; +import com.azure.resourcemanager.awsconnector.models.InstancesDistribution; +import com.azure.resourcemanager.awsconnector.models.LaunchTemplate; +import com.azure.resourcemanager.awsconnector.models.LaunchTemplateOverrides; +import com.azure.resourcemanager.awsconnector.models.LaunchTemplateSpecification; +import com.azure.resourcemanager.awsconnector.models.LifecycleHookSpecification; +import com.azure.resourcemanager.awsconnector.models.MemoryGiBPerVCpuRequest; +import com.azure.resourcemanager.awsconnector.models.MemoryMiBRequest; +import com.azure.resourcemanager.awsconnector.models.MetricsCollection; +import com.azure.resourcemanager.awsconnector.models.MixedInstancesPolicy; +import com.azure.resourcemanager.awsconnector.models.NetworkBandwidthGbpsRequest; +import com.azure.resourcemanager.awsconnector.models.NetworkInterfaceCountRequest; +import com.azure.resourcemanager.awsconnector.models.NotificationConfiguration; +import com.azure.resourcemanager.awsconnector.models.TagProperty; +import com.azure.resourcemanager.awsconnector.models.TotalLocalStorageGBRequest; +import com.azure.resourcemanager.awsconnector.models.VCpuCountRequest; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for AutoScalingAutoScalingGroups CreateOrReplace. + */ +public final class AutoScalingAutoScalingGroupsCreateOrReplaceSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * AutoScalingAutoScalingGroups_CreateOrReplace.json + */ + /** + * Sample code: AutoScalingAutoScalingGroups_CreateOrReplace. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void autoScalingAutoScalingGroupsCreateOrReplace( + com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.autoScalingAutoScalingGroups() + .define("Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])") + .withRegion("vfitxfllzgknmbaqgpsv") + .withExistingResourceGroup("rgautoScalingAutoScalingGroup") + .withTags(mapOf("key2337", "fakeTokenPlaceholder")) + .withProperties(new AutoScalingGroupProperties() + .withAwsProperties( + new AwsAutoScalingGroupProperties().withAutoScalingGroupName("zvp") + .withAvailabilityZones(Arrays.asList("bvcnltgekeqrzklsnfieubhugr")) + .withCapacityRebalance(true) + .withContext("dnmovg") + .withCooldown("r") + .withDefaultInstanceWarmup(24) + .withDesiredCapacity("xtu") + .withDesiredCapacityType("wncmimbdveox") + .withHealthCheckGracePeriod(9) + .withHealthCheckType("ustkoarefpvnhxrtqua") + .withInstanceId("noghdbfliygsadtjosovasxq") + .withInstanceMaintenancePolicy( + new InstanceMaintenancePolicy().withMaxHealthyPercentage(23).withMinHealthyPercentage(6)) + .withLaunchConfigurationName("rgadwyrtzaxbfkbsbjaygujtc") + .withLaunchTemplate( + new LaunchTemplateSpecification().withLaunchTemplateId("zpcgiqsftmwjzwqifodopjuvfoxed") + .withLaunchTemplateName("jq") + .withVersion("kdlpart")) + .withLifecycleHookSpecificationList( + Arrays.asList(new LifecycleHookSpecification().withDefaultResult("qbeojpqbpnhst") + .withHeartbeatTimeout(14) + .withLifecycleHookName("xeqfmdmthyzrdxjbmdkyy") + .withLifecycleTransition("xsufodhykhlutvc") + .withNotificationMetadata("bknbkafxdozjlnprrlkrqstgwchxl") + .withNotificationTargetArn("dkeqhlwuifyfamkufdryfiybxnle") + .withRoleArn("bhenujqtabiiryjgl"))) + .withLoadBalancerNames(Arrays.asList("qsgaefmtltksmmwswpdfmnlwvovi")) + .withMaxInstanceLifetime(25) + .withMaxSize("vqxfpkdyusfijwc") + .withMetricsCollection(Arrays.asList(new MetricsCollection().withGranularity("ygxetadl") + .withMetrics(Arrays.asList("hwukwnkctznjelut")))) + .withMinSize("rfdwflldttnzph") + .withMixedInstancesPolicy( + new MixedInstancesPolicy() + .withInstancesDistribution( + new InstancesDistribution().withOnDemandAllocationStrategy("s") + .withOnDemandBaseCapacity(11) + .withOnDemandPercentageAboveBaseCapacity(13) + .withSpotAllocationStrategy("mdqoylvmdfgnktujkkgcargpzgejts") + .withSpotInstancePools(21) + .withSpotMaxPrice("civdjpljorkrvqganofneu")) + .withLaunchTemplate( + new LaunchTemplate() + .withLaunchTemplateSpecification(new LaunchTemplateSpecification() + .withLaunchTemplateId("zpcgiqsftmwjzwqifodopjuvfoxed") + .withLaunchTemplateName("jq") + .withVersion("kdlpart")) + .withOverrides(Arrays.asList(new LaunchTemplateOverrides() + .withInstanceRequirements(new InstanceRequirements() + .withAcceleratorCount( + new AcceleratorCountRequest().withMax(22).withMin(12)) + .withAcceleratorManufacturers( + Arrays.asList("yrnnynorjjxvzppzrgpahymhm")) + .withAcceleratorNames(Arrays.asList("iqmentbrnypcxv")) + .withAcceleratorTotalMemoryMiB( + new AcceleratorTotalMemoryMiBRequest().withMax(7).withMin(29)) + .withAcceleratorTypes(Arrays.asList("kmvwibkxxklqitqxqqlpvfifvo")) + .withAllowedInstanceTypes(Arrays.asList("tzrxlaofwygbqglbwdxnqjy")) + .withBareMetal("kugjpzsjreywlvvzkebv") + .withBaselineEbsBandwidthMbps( + new BaselineEbsBandwidthMbpsRequest().withMax(2).withMin(19)) + .withBurstablePerformance("jpwudasuoonf") + .withCpuManufacturers(Arrays.asList("scbxthzijnmur")) + .withExcludedInstanceTypes(Arrays.asList("edadlo")) + .withInstanceGenerations(Arrays.asList("f")) + .withLocalStorage("wglfmvquwice") + .withLocalStorageTypes(Arrays.asList("talnjrldmventgtzlwpaxfcenp")) + .withMaxSpotPriceAsPercentageOfOptimalOnDemandPrice(15) + .withMemoryGiBPerVCpu( + new MemoryGiBPerVCpuRequest().withMax(23).withMin(29)) + .withMemoryMiB(new MemoryMiBRequest().withMax(27).withMin(27)) + .withNetworkBandwidthGbps( + new NetworkBandwidthGbpsRequest().withMax(18).withMin(29)) + .withNetworkInterfaceCount( + new NetworkInterfaceCountRequest().withMax(14).withMin(26)) + .withOnDemandMaxPricePercentageOverLowestPrice(8) + .withRequireHibernateSupport(true) + .withSpotMaxPricePercentageOverLowestPrice(9) + .withTotalLocalStorageGB( + new TotalLocalStorageGBRequest().withMax(19).withMin(7)) + .withVCpuCount(new VCpuCountRequest().withMax(9).withMin(26))) + .withInstanceType("phudgcnbis") + .withLaunchTemplateSpecification(new LaunchTemplateSpecification() + .withLaunchTemplateId("zpcgiqsftmwjzwqifodopjuvfoxed") + .withLaunchTemplateName("jq") + .withVersion("kdlpart")) + .withWeightedCapacity("iqa"))))) + .withNewInstancesProtectedFromScaleIn(true) + .withNotificationConfiguration( + new NotificationConfiguration().withNotificationTypes(Arrays.asList("jzepnjbwtsw")) + .withTopicArn("hndjrwrlqssgciezop")) + .withNotificationConfigurations(Arrays + .asList(new NotificationConfiguration().withNotificationTypes(Arrays.asList("jzepnjbwtsw")) + .withTopicArn("hndjrwrlqssgciezop"))) + .withPlacementGroup("pmanetwktlujhykhxtcekv") + .withServiceLinkedRoleArn("ffqtfkdv") + .withTags(Arrays.asList(new TagProperty().withKey("fakeTokenPlaceholder") + .withPropagateAtLaunch(true) + .withValue("xoncdkvjanxdfklvixodkyg"))) + .withTargetGroupARNs(Arrays.asList("ttxjwgboopxrdiqxyqjdujw")) + .withTerminationPolicies(Arrays.asList("jvwpdujegrgjbdrxbvcjgs")) + .withVpcZoneIdentifier(Arrays.asList("fmqvstmohqtmjslrnsiuodevi"))) + .withPublicCloudConnectorsResourceId("q") + .withAwsAccountId("eogdcteuaaazi") + .withArn("gsso") + .withPublicCloudResourceName("blomfowfltqwzdghycehvvdnr") + .withAwsSourceSchema("koleijkwf") + .withAwsRegion("cfqguizvjpckdsvetalwo") + .withAwsTags(mapOf("key6990", "fakeTokenPlaceholder"))) + .create(); + } + + // Use "Map.of" if available + @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/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/AutoScalingAutoScalingGroupsDeleteSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/AutoScalingAutoScalingGroupsDeleteSamples.java new file mode 100644 index 000000000000..cfc5abb10482 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/AutoScalingAutoScalingGroupsDeleteSamples.java @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +/** + * Samples for AutoScalingAutoScalingGroups Delete. + */ +public final class AutoScalingAutoScalingGroupsDeleteSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * AutoScalingAutoScalingGroups_Delete.json + */ + /** + * Sample code: AutoScalingAutoScalingGroups_Delete. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + autoScalingAutoScalingGroupsDelete(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.autoScalingAutoScalingGroups() + .delete("rgautoScalingAutoScalingGroup", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/AutoScalingAutoScalingGroupsGetByResourceGroupSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/AutoScalingAutoScalingGroupsGetByResourceGroupSamples.java new file mode 100644 index 000000000000..9056369a8665 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/AutoScalingAutoScalingGroupsGetByResourceGroupSamples.java @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +/** + * Samples for AutoScalingAutoScalingGroups GetByResourceGroup. + */ +public final class AutoScalingAutoScalingGroupsGetByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * AutoScalingAutoScalingGroups_Get.json + */ + /** + * Sample code: AutoScalingAutoScalingGroups_Get. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + autoScalingAutoScalingGroupsGet(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.autoScalingAutoScalingGroups() + .getByResourceGroupWithResponse("rgautoScalingAutoScalingGroup", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/AutoScalingAutoScalingGroupsListByResourceGroupSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/AutoScalingAutoScalingGroupsListByResourceGroupSamples.java new file mode 100644 index 000000000000..43d9a81f9dc2 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/AutoScalingAutoScalingGroupsListByResourceGroupSamples.java @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +/** + * Samples for AutoScalingAutoScalingGroups ListByResourceGroup. + */ +public final class AutoScalingAutoScalingGroupsListByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * AutoScalingAutoScalingGroups_ListByResourceGroup.json + */ + /** + * Sample code: AutoScalingAutoScalingGroups_ListByResourceGroup. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void autoScalingAutoScalingGroupsListByResourceGroup( + com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.autoScalingAutoScalingGroups() + .listByResourceGroup("rgautoScalingAutoScalingGroup", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/AutoScalingAutoScalingGroupsListSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/AutoScalingAutoScalingGroupsListSamples.java new file mode 100644 index 000000000000..dfc1568f1f47 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/AutoScalingAutoScalingGroupsListSamples.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +/** + * Samples for AutoScalingAutoScalingGroups List. + */ +public final class AutoScalingAutoScalingGroupsListSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * AutoScalingAutoScalingGroups_ListBySubscription.json + */ + /** + * Sample code: AutoScalingAutoScalingGroups_ListBySubscription. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void autoScalingAutoScalingGroupsListBySubscription( + com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.autoScalingAutoScalingGroups().list(com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/AutoScalingAutoScalingGroupsUpdateSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/AutoScalingAutoScalingGroupsUpdateSamples.java new file mode 100644 index 000000000000..88b667684f34 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/AutoScalingAutoScalingGroupsUpdateSamples.java @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +import com.azure.resourcemanager.awsconnector.models.AutoScalingGroup; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for AutoScalingAutoScalingGroups Update. + */ +public final class AutoScalingAutoScalingGroupsUpdateSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * AutoScalingAutoScalingGroups_Update.json + */ + /** + * Sample code: AutoScalingAutoScalingGroups_Update. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + autoScalingAutoScalingGroupsUpdate(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + AutoScalingGroup resource = manager.autoScalingAutoScalingGroups() + .getByResourceGroupWithResponse("rgautoScalingAutoScalingGroup", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE) + .getValue(); + resource.update().withTags(mapOf("key9673", "fakeTokenPlaceholder")).apply(); + } + + // Use "Map.of" if available + @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/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/CloudFormationStackSetsCreateOrReplaceSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/CloudFormationStackSetsCreateOrReplaceSamples.java new file mode 100644 index 000000000000..8686e884f2b2 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/CloudFormationStackSetsCreateOrReplaceSamples.java @@ -0,0 +1,102 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +import com.azure.resourcemanager.awsconnector.models.ActiveModel; +import com.azure.resourcemanager.awsconnector.models.AutoDeployment; +import com.azure.resourcemanager.awsconnector.models.AwsCloudFormationStackSetProperties; +import com.azure.resourcemanager.awsconnector.models.CallAs; +import com.azure.resourcemanager.awsconnector.models.CloudFormationStackSetProperties; +import com.azure.resourcemanager.awsconnector.models.DeploymentTargets; +import com.azure.resourcemanager.awsconnector.models.DeploymentTargetsAccountFilterType; +import com.azure.resourcemanager.awsconnector.models.OperationPreferences; +import com.azure.resourcemanager.awsconnector.models.OperationPreferencesRegionConcurrencyType; +import com.azure.resourcemanager.awsconnector.models.Parameter; +import com.azure.resourcemanager.awsconnector.models.PermissionModel; +import com.azure.resourcemanager.awsconnector.models.StackInstances; +import com.azure.resourcemanager.awsconnector.models.TagAutoGenerated4; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for CloudFormationStackSets CreateOrReplace. + */ +public final class CloudFormationStackSetsCreateOrReplaceSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * CloudFormationStackSets_CreateOrReplace.json + */ + /** + * Sample code: CloudFormationStackSets_CreateOrReplace. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + cloudFormationStackSetsCreateOrReplace(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.cloudFormationStackSets() + .define("Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])") + .withRegion("oubo") + .withExistingResourceGroup("rgcloudFormationStackSet") + .withTags(mapOf("key307", "fakeTokenPlaceholder")) + .withProperties( + new CloudFormationStackSetProperties() + .withAwsProperties(new AwsCloudFormationStackSetProperties().withAdministrationRoleArn("ybtuoky") + .withAutoDeployment( + new AutoDeployment().withEnabled(true).withRetainStacksOnAccountRemoval(true)) + .withCallAs(CallAs.DELEGATED_ADMIN) + .withCapabilities(Arrays.asList("begwecrhvitloplqjhhydjwhve")) + .withDescription("czkasvectlrpghrjojr") + .withExecutionRoleName("fclmt") + .withManagedExecution(new ActiveModel().withActive(true)) + .withOperationPreferences(new OperationPreferences().withFailureToleranceCount(30) + .withFailureTolerancePercentage(16) + .withMaxConcurrentCount(11) + .withMaxConcurrentPercentage(15) + .withRegionConcurrencyType(OperationPreferencesRegionConcurrencyType.PARALLEL) + .withRegionOrder(Arrays.asList("gwaceriunclgehhoue"))) + .withParameters(Arrays + .asList(new Parameter().withParameterKey("fakeTokenPlaceholder") + .withParameterValue("lldiqsjfqukysjecb"))) + .withPermissionModel(PermissionModel.SELF_MANAGED) + .withStackInstancesGroup(Arrays.asList(new StackInstances() + .withDeploymentTargets(new DeploymentTargets() + .withAccountFilterType(DeploymentTargetsAccountFilterType.DIFFERENCE) + .withAccounts(Arrays.asList("xc")) + .withAccountsUrl("nvixaunvovhintyelj") + .withOrganizationalUnitIds(Arrays.asList("gnnzuj"))) + .withParameterOverrides( + Arrays.asList(new Parameter().withParameterKey("fakeTokenPlaceholder") + .withParameterValue("lldiqsjfqukysjecb"))) + .withRegions(Arrays.asList("eyondljwt")))) + .withStackSetId("ypfkcclgbgzikkjqfeiq") + .withStackSetName("bkfqkuqedspfb") + .withTags( + Arrays.asList(new TagAutoGenerated4().withKey("fakeTokenPlaceholder").withValue("ntm"))) + .withTemplateBody("no") + .withTemplateUrl("icoki")) + .withPublicCloudConnectorsResourceId("eqapackzslaofkx") + .withAwsAccountId("jtdycoxjyvqvrxyy") + .withArn("sldueqvlzdilykrozxapbb") + .withPublicCloudResourceName("dyaxkuzcwhqspayuipml") + .withAwsSourceSchema("wpvatxlrosokkyqsq") + .withAwsRegion("drpqdznyarlwjnjslcrmvm") + .withAwsTags(mapOf("key7598", "fakeTokenPlaceholder"))) + .create(); + } + + // Use "Map.of" if available + @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/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/CloudFormationStackSetsDeleteSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/CloudFormationStackSetsDeleteSamples.java new file mode 100644 index 000000000000..56701d951d10 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/CloudFormationStackSetsDeleteSamples.java @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +/** + * Samples for CloudFormationStackSets Delete. + */ +public final class CloudFormationStackSetsDeleteSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * CloudFormationStackSets_Delete.json + */ + /** + * Sample code: CloudFormationStackSets_Delete. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + cloudFormationStackSetsDelete(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.cloudFormationStackSets() + .delete("rgcloudFormationStackSet", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/CloudFormationStackSetsGetByResourceGroupSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/CloudFormationStackSetsGetByResourceGroupSamples.java new file mode 100644 index 000000000000..4d4d97426cb3 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/CloudFormationStackSetsGetByResourceGroupSamples.java @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +/** + * Samples for CloudFormationStackSets GetByResourceGroup. + */ +public final class CloudFormationStackSetsGetByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * CloudFormationStackSets_Get.json + */ + /** + * Sample code: CloudFormationStackSets_Get. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void cloudFormationStackSetsGet(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.cloudFormationStackSets() + .getByResourceGroupWithResponse("rgcloudFormationStackSet", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/CloudFormationStackSetsListByResourceGroupSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/CloudFormationStackSetsListByResourceGroupSamples.java new file mode 100644 index 000000000000..c8380acbfcdd --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/CloudFormationStackSetsListByResourceGroupSamples.java @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +/** + * Samples for CloudFormationStackSets ListByResourceGroup. + */ +public final class CloudFormationStackSetsListByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * CloudFormationStackSets_ListByResourceGroup.json + */ + /** + * Sample code: CloudFormationStackSets_ListByResourceGroup. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + cloudFormationStackSetsListByResourceGroup(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.cloudFormationStackSets() + .listByResourceGroup("rgcloudFormationStackSet", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/CloudFormationStackSetsListSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/CloudFormationStackSetsListSamples.java new file mode 100644 index 000000000000..44425ccffe89 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/CloudFormationStackSetsListSamples.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +/** + * Samples for CloudFormationStackSets List. + */ +public final class CloudFormationStackSetsListSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * CloudFormationStackSets_ListBySubscription.json + */ + /** + * Sample code: CloudFormationStackSets_ListBySubscription. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + cloudFormationStackSetsListBySubscription(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.cloudFormationStackSets().list(com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/CloudFormationStackSetsUpdateSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/CloudFormationStackSetsUpdateSamples.java new file mode 100644 index 000000000000..d40cbdbdec04 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/CloudFormationStackSetsUpdateSamples.java @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +import com.azure.resourcemanager.awsconnector.models.CloudFormationStackSet; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for CloudFormationStackSets Update. + */ +public final class CloudFormationStackSetsUpdateSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * CloudFormationStackSets_Update.json + */ + /** + * Sample code: CloudFormationStackSets_Update. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + cloudFormationStackSetsUpdate(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + CloudFormationStackSet resource = manager.cloudFormationStackSets() + .getByResourceGroupWithResponse("rgcloudFormationStackSet", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE) + .getValue(); + resource.update().withTags(mapOf("key6480", "fakeTokenPlaceholder")).apply(); + } + + // Use "Map.of" if available + @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/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/CloudFormationStacksCreateOrReplaceSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/CloudFormationStacksCreateOrReplaceSamples.java new file mode 100644 index 000000000000..c52496b16e1d --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/CloudFormationStacksCreateOrReplaceSamples.java @@ -0,0 +1,86 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +import com.azure.resourcemanager.awsconnector.models.AwsCloudFormationStackProperties; +import com.azure.resourcemanager.awsconnector.models.Capabilities; +import com.azure.resourcemanager.awsconnector.models.CloudFormationStackProperties; +import com.azure.resourcemanager.awsconnector.models.Output; +import com.azure.resourcemanager.awsconnector.models.StackStatus; +import com.azure.resourcemanager.awsconnector.models.TagAutoGenerated3; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for CloudFormationStacks CreateOrReplace. + */ +public final class CloudFormationStacksCreateOrReplaceSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * CloudFormationStacks_CreateOrReplace.json + */ + /** + * Sample code: CloudFormationStacks_CreateOrReplace. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + cloudFormationStacksCreateOrReplace(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.cloudFormationStacks() + .define("Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])") + .withRegion("igidmxpchpipflxgxqkge") + .withExistingResourceGroup("rgcloudFormationStack") + .withTags(mapOf("key8740", "fakeTokenPlaceholder")) + .withProperties(new CloudFormationStackProperties() + .withAwsProperties(new AwsCloudFormationStackProperties() + .withCapabilities(Arrays.asList(Capabilities.CAPABILITY_AUTO_EXPAND)) + .withChangeSetId("diebgdscxgdrjl") + .withCreationTime("rbzmujrpza") + .withDescription("qgthunuomcbskx") + .withDisableRollback(true) + .withEnableTerminationProtection(true) + .withLastUpdateTime("ziwluvridlkgt") + .withNotificationARNs(Arrays.asList("hiumjcobumu")) + .withOutputs(Arrays.asList(new Output().withDescription("yr") + .withExportName("inzgbtgxtlkmbsthsiqyaownydl") + .withOutputKey("fakeTokenPlaceholder") + .withOutputValue("xrkebm"))) + .withParameters(mapOf("key3924", "fakeTokenPlaceholder")) + .withParentId("spfnpubjgnn") + .withRoleArn("chneost") + .withRootId("dm") + .withStackId("pfdvktglgjlp") + .withStackName("kcpmjgjmtil") + .withStackPolicyUrl("azff") + .withStackStatus(StackStatus.CREATE_COMPLETE) + .withStackStatusReason("oashauqgm") + .withTags(Arrays + .asList(new TagAutoGenerated3().withKey("fakeTokenPlaceholder").withValue("xapmapwprakmhlboq"))) + .withTemplateUrl("prpgfhggbaglqposmnlkc") + .withTimeoutInMinutes(21)) + .withPublicCloudConnectorsResourceId("ccuizanjtbypcrcdmoelfyjkx") + .withAwsAccountId("yuzdhawgkrzzmppqjebmyzrqzsxbgh") + .withArn("wnbcxhzurwtzqcoirs") + .withPublicCloudResourceName("vjnhdxpreaebeaxeqmrhfuro") + .withAwsSourceSchema("ascbhyeewelekovixg") + .withAwsRegion("ovumxnjlsoffpzxyegazwgujni") + .withAwsTags(mapOf("key6002", "fakeTokenPlaceholder"))) + .create(); + } + + // Use "Map.of" if available + @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/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/CloudFormationStacksDeleteSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/CloudFormationStacksDeleteSamples.java new file mode 100644 index 000000000000..990d57256e0b --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/CloudFormationStacksDeleteSamples.java @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +/** + * Samples for CloudFormationStacks Delete. + */ +public final class CloudFormationStacksDeleteSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * CloudFormationStacks_Delete.json + */ + /** + * Sample code: CloudFormationStacks_Delete. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void cloudFormationStacksDelete(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.cloudFormationStacks() + .delete("rgcloudFormationStack", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/CloudFormationStacksGetByResourceGroupSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/CloudFormationStacksGetByResourceGroupSamples.java new file mode 100644 index 000000000000..d07f7f5448d3 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/CloudFormationStacksGetByResourceGroupSamples.java @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +/** + * Samples for CloudFormationStacks GetByResourceGroup. + */ +public final class CloudFormationStacksGetByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * CloudFormationStacks_Get.json + */ + /** + * Sample code: CloudFormationStacks_Get. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void cloudFormationStacksGet(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.cloudFormationStacks() + .getByResourceGroupWithResponse("rgcloudFormationStack", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/CloudFormationStacksListByResourceGroupSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/CloudFormationStacksListByResourceGroupSamples.java new file mode 100644 index 000000000000..ecdb68e27590 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/CloudFormationStacksListByResourceGroupSamples.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +/** + * Samples for CloudFormationStacks ListByResourceGroup. + */ +public final class CloudFormationStacksListByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * CloudFormationStacks_ListByResourceGroup.json + */ + /** + * Sample code: CloudFormationStacks_ListByResourceGroup. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + cloudFormationStacksListByResourceGroup(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.cloudFormationStacks().listByResourceGroup("rgcloudFormationStack", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/CloudFormationStacksListSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/CloudFormationStacksListSamples.java new file mode 100644 index 000000000000..8c5c17ac8f21 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/CloudFormationStacksListSamples.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +/** + * Samples for CloudFormationStacks List. + */ +public final class CloudFormationStacksListSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * CloudFormationStacks_ListBySubscription.json + */ + /** + * Sample code: CloudFormationStacks_ListBySubscription. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + cloudFormationStacksListBySubscription(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.cloudFormationStacks().list(com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/CloudFormationStacksUpdateSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/CloudFormationStacksUpdateSamples.java new file mode 100644 index 000000000000..23c21df9bf7c --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/CloudFormationStacksUpdateSamples.java @@ -0,0 +1,45 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +import com.azure.resourcemanager.awsconnector.models.CloudFormationStack; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for CloudFormationStacks Update. + */ +public final class CloudFormationStacksUpdateSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * CloudFormationStacks_Update.json + */ + /** + * Sample code: CloudFormationStacks_Update. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void cloudFormationStacksUpdate(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + CloudFormationStack resource = manager.cloudFormationStacks() + .getByResourceGroupWithResponse("rgcloudFormationStack", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE) + .getValue(); + resource.update().withTags(mapOf("key4726", "fakeTokenPlaceholder")).apply(); + } + + // Use "Map.of" if available + @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/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/CloudFrontDistributionsCreateOrReplaceSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/CloudFrontDistributionsCreateOrReplaceSamples.java new file mode 100644 index 000000000000..eaeaba6c5387 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/CloudFrontDistributionsCreateOrReplaceSamples.java @@ -0,0 +1,208 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +import com.azure.resourcemanager.awsconnector.models.AwsCloudFrontDistributionProperties; +import com.azure.resourcemanager.awsconnector.models.CacheBehavior; +import com.azure.resourcemanager.awsconnector.models.CloudFrontDistributionProperties; +import com.azure.resourcemanager.awsconnector.models.Cookies; +import com.azure.resourcemanager.awsconnector.models.CustomErrorResponse; +import com.azure.resourcemanager.awsconnector.models.CustomOriginConfig; +import com.azure.resourcemanager.awsconnector.models.DefaultCacheBehavior; +import com.azure.resourcemanager.awsconnector.models.DistributionConfig; +import com.azure.resourcemanager.awsconnector.models.ForwardedValues; +import com.azure.resourcemanager.awsconnector.models.FunctionAssociation; +import com.azure.resourcemanager.awsconnector.models.GeoRestriction; +import com.azure.resourcemanager.awsconnector.models.LambdaFunctionAssociation; +import com.azure.resourcemanager.awsconnector.models.LegacyCustomOrigin; +import com.azure.resourcemanager.awsconnector.models.LegacyS3Origin; +import com.azure.resourcemanager.awsconnector.models.Logging; +import com.azure.resourcemanager.awsconnector.models.OriginAutoGenerated; +import com.azure.resourcemanager.awsconnector.models.OriginCustomHeader; +import com.azure.resourcemanager.awsconnector.models.OriginGroup; +import com.azure.resourcemanager.awsconnector.models.OriginGroupFailoverCriteria; +import com.azure.resourcemanager.awsconnector.models.OriginGroupMember; +import com.azure.resourcemanager.awsconnector.models.OriginGroupMembers; +import com.azure.resourcemanager.awsconnector.models.OriginGroups; +import com.azure.resourcemanager.awsconnector.models.OriginShield; +import com.azure.resourcemanager.awsconnector.models.Restrictions; +import com.azure.resourcemanager.awsconnector.models.S3OriginConfig; +import com.azure.resourcemanager.awsconnector.models.StatusCodes; +import com.azure.resourcemanager.awsconnector.models.TagAutoGenerated5; +import com.azure.resourcemanager.awsconnector.models.ViewerCertificate; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for CloudFrontDistributions CreateOrReplace. + */ +public final class CloudFrontDistributionsCreateOrReplaceSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * CloudFrontDistributions_CreateOrReplace.json + */ + /** + * Sample code: CloudFrontDistributions_CreateOrReplace. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + cloudFrontDistributionsCreateOrReplace(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.cloudFrontDistributions() + .define("Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])") + .withRegion("nprgvufyhs") + .withExistingResourceGroup("rgcloudFrontDistribution") + .withTags(mapOf("key6544", "fakeTokenPlaceholder")) + .withProperties(new CloudFrontDistributionProperties() + .withAwsProperties(new AwsCloudFrontDistributionProperties() + .withDistributionConfig( + new DistributionConfig().withAliases(Arrays.asList("gibhsrynakjqasnexklzyr")) + .withCnamEs(Arrays.asList("qczbolddtyqh")) + .withCacheBehaviors(Arrays.asList(new CacheBehavior() + .withAllowedMethods(Arrays.asList("mgilninyxzl")) + .withCachePolicyId("jgthzlgddcq") + .withCachedMethods(Arrays.asList("mocyvkoubxnhxggwiguxclll")) + .withCompress(true) + .withDefaultTtl(12) + .withFieldLevelEncryptionId("egdaxlmmafenvmeeiyendhzfgb") + .withForwardedValues(new ForwardedValues() + .withCookies(new Cookies().withForward("vgdw") + .withWhitelistedNames(Arrays.asList("dyyppccyzusjttwxsvtauzikzpcic"))) + .withHeaders(Arrays.asList("wthyef")) + .withQueryString(true) + .withQueryStringCacheKeys(Arrays.asList("ovsbbyypovwzfd"))) + .withFunctionAssociations( + Arrays.asList(new FunctionAssociation().withEventType("rabilo") + .withFunctionArn("xqjivwlwegwmcpxpbdxlxwfkkoy"))) + .withLambdaFunctionAssociations( + Arrays.asList(new LambdaFunctionAssociation().withEventType("adgevfqgfrqxotodrywqn") + .withIncludeBody(true) + .withLambdaFunctionArn("ofaqozmfhyrnzijzqjc"))) + .withMaxTtl(22) + .withMinTtl(14) + .withOriginRequestPolicyId("mmggy") + .withPathPattern("dblpru") + .withRealtimeLogConfigArn("hlpmy") + .withResponseHeadersPolicyId("mexazovhbvttjpndsx") + .withSmoothStreaming(true) + .withTargetOriginId("muilt") + .withTrustedKeyGroups(Arrays.asList("rtoknopsknpyux")) + .withTrustedSigners(Arrays.asList("dqxymkhclbsojvcwgczgtw")) + .withViewerProtocolPolicy("tadcgla"))) + .withComment("eqgjcikzog") + .withContinuousDeploymentPolicyId("jpzap") + .withCustomErrorResponses(Arrays.asList(new CustomErrorResponse().withErrorCachingMinTtl(16) + .withErrorCode(14) + .withResponseCode(26) + .withResponsePagePath("fgjymf"))) + .withCustomOrigin(new LegacyCustomOrigin().withDnsName("dijgqalflftbtatmydfk") + .withHttpPort(3) + .withHttpsPort(26) + .withOriginProtocolPolicy("unrjgcwzebjixqsjmmzdwm") + .withOriginSslProtocols(Arrays.asList("clriolammhrzrrhmyovvmbxowayz"))) + .withDefaultCacheBehavior(new DefaultCacheBehavior() + .withAllowedMethods(Arrays.asList("gtvgkaxaocaozvybswnfgud")) + .withCachePolicyId("txppezvfdbpaewlehepeycrdj") + .withCachedMethods(Arrays.asList("bpptfnqcsypifnydxpkjxaek")) + .withCompress(true) + .withDefaultTtl(16) + .withFieldLevelEncryptionId("adpzriyfhcj") + .withForwardedValues(new ForwardedValues() + .withCookies(new Cookies().withForward("vgdw") + .withWhitelistedNames(Arrays.asList("dyyppccyzusjttwxsvtauzikzpcic"))) + .withHeaders(Arrays.asList("wthyef")) + .withQueryString(true) + .withQueryStringCacheKeys(Arrays.asList("ovsbbyypovwzfd"))) + .withFunctionAssociations( + Arrays.asList(new FunctionAssociation().withEventType("rabilo") + .withFunctionArn("xqjivwlwegwmcpxpbdxlxwfkkoy"))) + .withLambdaFunctionAssociations( + Arrays.asList(new LambdaFunctionAssociation().withEventType("adgevfqgfrqxotodrywqn") + .withIncludeBody(true) + .withLambdaFunctionArn("ofaqozmfhyrnzijzqjc"))) + .withMaxTtl(11) + .withMinTtl(22) + .withOriginRequestPolicyId("vfi") + .withRealtimeLogConfigArn("gdfhajmumlspefunqlznktqzn") + .withResponseHeadersPolicyId("xnvjmk") + .withSmoothStreaming(true) + .withTargetOriginId("satcfgygtio") + .withTrustedKeyGroups(Arrays.asList("glzecp")) + .withTrustedSigners(Arrays.asList("yeheiezaavurjdn")) + .withViewerProtocolPolicy("vmvahgz")) + .withDefaultRootObject("qqacdjhmnrgxzg") + .withEnabled(true) + .withHttpVersion("jujxztvywwzj") + .withIpV6Enabled(true) + .withLogging(new Logging().withBucket("staluexfxdlonreqbr") + .withIncludeCookies(true) + .withPrefix("mzugdqzcjqfkxbyxwaho")) + .withOriginGroups( + new OriginGroups() + .withItems(Arrays.asList(new OriginGroup() + .withFailoverCriteria(new OriginGroupFailoverCriteria().withStatusCodes( + new StatusCodes().withItems(Arrays.asList(24)).withQuantity(13))) + .withId("cppcwh") + .withMembers(new OriginGroupMembers() + .withItems(Arrays.asList(new OriginGroupMember().withOriginId("ju"))) + .withQuantity(19)))) + .withQuantity(15)) + .withOrigins(Arrays.asList(new OriginAutoGenerated().withConnectionAttempts(17) + .withConnectionTimeout(13) + .withCustomOriginConfig(new CustomOriginConfig().withHttpPort(6) + .withHttpsPort(10) + .withOriginKeepaliveTimeout(29) + .withOriginProtocolPolicy("utekqcjzgxdogmvyfxxzehzpcbhgu") + .withOriginReadTimeout(11) + .withOriginSslProtocols(Arrays.asList("lplnjynxpyxbrbyq"))) + .withDomainName("tdvwmcxajsiushniomugxjkroqih") + .withId("jsvocvlfluxmig") + .withOriginAccessControlId("uwoxzymxpzbiohjphusuywrbri") + .withOriginCustomHeaders( + Arrays.asList(new OriginCustomHeader().withHeaderName("kdbkguzvgqpjinhenlsw") + .withHeaderValue("glzvvmflrrab"))) + .withOriginPath("qhkjzdzxipwguohspfmkqtmp") + .withOriginShield(new OriginShield().withEnabled(true).withOriginShieldRegion("ubhpk")) + .withS3OriginConfig(new S3OriginConfig().withOriginAccessIdentity("sexllpdop")))) + .withPriceClass("wltams") + .withRestrictions(new Restrictions().withGeoRestriction( + new GeoRestriction().withLocations(Arrays.asList("qfbhxln")).withRestrictionType("ry"))) + .withS3Origin(new LegacyS3Origin().withDnsName("bgxohpxhcml") + .withOriginAccessIdentity("itatexxuwwvgnusaleemttplfhx")) + .withStaging(true) + .withViewerCertificate(new ViewerCertificate().withAcmCertificateArn("oooavlkhe") + .withCloudFrontDefaultCertificate(true) + .withIamCertificateId("orcqmznytymzmiqg") + .withMinimumProtocolVersion("fjodeffknxcdqfz") + .withSslSupportMethod("ceibl")) + .withWebAclId("oycfjrylckkuampmezlerj")) + .withDomainName("cwbirqnkovujza") + .withId("ud") + .withTags(Arrays.asList( + new TagAutoGenerated5().withKey("fakeTokenPlaceholder").withValue("eelgljsxedmzhdwwp")))) + .withPublicCloudConnectorsResourceId("quzwvcijedi") + .withAwsAccountId("npsedngekfchphqo") + .withArn("mlluf") + .withPublicCloudResourceName("uquecem") + .withAwsSourceSchema("nuhdditribzbvzfnixuibhjwyo") + .withAwsRegion("gumvgalmzjsgtlvv") + .withAwsTags(mapOf("key3003", "fakeTokenPlaceholder"))) + .create(); + } + + // Use "Map.of" if available + @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/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/CloudFrontDistributionsDeleteSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/CloudFrontDistributionsDeleteSamples.java new file mode 100644 index 000000000000..9d219130cfa0 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/CloudFrontDistributionsDeleteSamples.java @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +/** + * Samples for CloudFrontDistributions Delete. + */ +public final class CloudFrontDistributionsDeleteSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * CloudFrontDistributions_Delete.json + */ + /** + * Sample code: CloudFrontDistributions_Delete. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + cloudFrontDistributionsDelete(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.cloudFrontDistributions() + .delete("rgcloudFrontDistribution", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/CloudFrontDistributionsGetByResourceGroupSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/CloudFrontDistributionsGetByResourceGroupSamples.java new file mode 100644 index 000000000000..839ba87e6a78 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/CloudFrontDistributionsGetByResourceGroupSamples.java @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +/** + * Samples for CloudFrontDistributions GetByResourceGroup. + */ +public final class CloudFrontDistributionsGetByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * CloudFrontDistributions_Get.json + */ + /** + * Sample code: CloudFrontDistributions_Get. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void cloudFrontDistributionsGet(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.cloudFrontDistributions() + .getByResourceGroupWithResponse("rgcloudFrontDistribution", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/CloudFrontDistributionsListByResourceGroupSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/CloudFrontDistributionsListByResourceGroupSamples.java new file mode 100644 index 000000000000..0898adef571a --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/CloudFrontDistributionsListByResourceGroupSamples.java @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +/** + * Samples for CloudFrontDistributions ListByResourceGroup. + */ +public final class CloudFrontDistributionsListByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * CloudFrontDistributions_ListByResourceGroup.json + */ + /** + * Sample code: CloudFrontDistributions_ListByResourceGroup. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + cloudFrontDistributionsListByResourceGroup(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.cloudFrontDistributions() + .listByResourceGroup("rgcloudFrontDistribution", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/CloudFrontDistributionsListSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/CloudFrontDistributionsListSamples.java new file mode 100644 index 000000000000..aeda82763ce0 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/CloudFrontDistributionsListSamples.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +/** + * Samples for CloudFrontDistributions List. + */ +public final class CloudFrontDistributionsListSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * CloudFrontDistributions_ListBySubscription.json + */ + /** + * Sample code: CloudFrontDistributions_ListBySubscription. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + cloudFrontDistributionsListBySubscription(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.cloudFrontDistributions().list(com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/CloudFrontDistributionsUpdateSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/CloudFrontDistributionsUpdateSamples.java new file mode 100644 index 000000000000..982b268a412a --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/CloudFrontDistributionsUpdateSamples.java @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +import com.azure.resourcemanager.awsconnector.models.CloudFrontDistribution; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for CloudFrontDistributions Update. + */ +public final class CloudFrontDistributionsUpdateSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * CloudFrontDistributions_Update.json + */ + /** + * Sample code: CloudFrontDistributions_Update. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + cloudFrontDistributionsUpdate(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + CloudFrontDistribution resource = manager.cloudFrontDistributions() + .getByResourceGroupWithResponse("rgcloudFrontDistribution", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE) + .getValue(); + resource.update().withTags(mapOf("key3727", "fakeTokenPlaceholder")).apply(); + } + + // Use "Map.of" if available + @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/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/CloudTrailTrailsCreateOrReplaceSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/CloudTrailTrailsCreateOrReplaceSamples.java new file mode 100644 index 000000000000..e30aad3a7f2c --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/CloudTrailTrailsCreateOrReplaceSamples.java @@ -0,0 +1,98 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +import com.azure.resourcemanager.awsconnector.models.AdvancedEventSelector; +import com.azure.resourcemanager.awsconnector.models.AdvancedFieldSelector; +import com.azure.resourcemanager.awsconnector.models.AwsCloudTrailProperties; +import com.azure.resourcemanager.awsconnector.models.CloudTrailProperties; +import com.azure.resourcemanager.awsconnector.models.DataResource; +import com.azure.resourcemanager.awsconnector.models.EventSelector; +import com.azure.resourcemanager.awsconnector.models.EventSelectorReadWriteType; +import com.azure.resourcemanager.awsconnector.models.InsightSelector; +import com.azure.resourcemanager.awsconnector.models.Tag; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for CloudTrailTrails CreateOrReplace. + */ +public final class CloudTrailTrailsCreateOrReplaceSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * CloudTrailTrails_CreateOrReplace.json + */ + /** + * Sample code: CloudTrailTrails_CreateOrReplace. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + cloudTrailTrailsCreateOrReplace(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.cloudTrailTrails() + .define("Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])") + .withRegion("lectoohspiqh") + .withExistingResourceGroup("rgcloudTrailTrail") + .withTags(mapOf("key8112", "fakeTokenPlaceholder")) + .withProperties( + new CloudTrailProperties() + .withAwsProperties(new AwsCloudTrailProperties() + .withAdvancedEventSelectors(Arrays.asList(new AdvancedEventSelector() + .withFieldSelectors( + Arrays.asList(new AdvancedFieldSelector().withEndsWith(Arrays.asList("xvhm")) + .withEquals(Arrays.asList("wxznrgvwsjlxdvssmmse")) + .withField("mq") + .withNotEndsWith(Arrays.asList("x")) + .withNotEquals(Arrays.asList("vglmmoivfeqg")) + .withNotStartsWith(Arrays.asList("pojptcfcw")) + .withStartsWith(Arrays.asList("fvldfltesnmpieljtehsvxudvxdujk")))) + .withName("ee"))) + .withArn("gbcn") + .withCloudWatchLogsLogGroupArn("nznfnuyxarmdmdtgjiougqgq") + .withCloudWatchLogsRoleArn("umhmpx") + .withEnableLogFileValidation(true) + .withEventSelectors(Arrays.asList(new EventSelector() + .withDataResources(Arrays.asList(new DataResource().withType("txxrjncwohiohorurqdxzabre") + .withValues(Arrays.asList("xhlnkujkbtpptbwchhh")))) + .withExcludeManagementEventSources(Arrays.asList("r")) + .withIncludeManagementEvents(true) + .withReadWriteType(EventSelectorReadWriteType.ALL))) + .withIncludeGlobalServiceEvents(true) + .withInsightSelectors( + Arrays.asList(new InsightSelector().withInsightType("brwlpasadlbwolsysta"))) + .withIsLogging(true) + .withIsMultiRegionTrail(true) + .withIsOrganizationTrail(true) + .withKmsKeyId("fakeTokenPlaceholder") + .withS3BucketName("iknyfgvujttyxsralujehxb") + .withS3KeyPrefix("fakeTokenPlaceholder") + .withSnsTopicArn("owdxqmsrqylekull") + .withSnsTopicName("goknthoxfekdccclolilvnyacvcop") + .withTags(Arrays.asList(new Tag().withKey("fakeTokenPlaceholder").withValue("vnsgm"))) + .withTrailName("oawneexezdnuouxdykllsflq")) + .withPublicCloudConnectorsResourceId("i") + .withAwsAccountId("mynelopf") + .withArn("jlwqroammottlyguyzu") + .withPublicCloudResourceName("aidwpmbkjspiucpvmzgg") + .withAwsSourceSchema("tvnaxpvricaiyoucpeauofeibwrk") + .withAwsRegion("dfvobbnupacpqsgexblxjlw") + .withAwsTags(mapOf("key5810", "fakeTokenPlaceholder"))) + .create(); + } + + // Use "Map.of" if available + @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/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/CloudTrailTrailsDeleteSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/CloudTrailTrailsDeleteSamples.java new file mode 100644 index 000000000000..27c5f5d921a2 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/CloudTrailTrailsDeleteSamples.java @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +/** + * Samples for CloudTrailTrails Delete. + */ +public final class CloudTrailTrailsDeleteSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * CloudTrailTrails_Delete.json + */ + /** + * Sample code: CloudTrailTrails_Delete. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void cloudTrailTrailsDelete(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.cloudTrailTrails() + .delete("rgcloudTrailTrail", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/CloudTrailTrailsGetByResourceGroupSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/CloudTrailTrailsGetByResourceGroupSamples.java new file mode 100644 index 000000000000..4836cdef016a --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/CloudTrailTrailsGetByResourceGroupSamples.java @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +/** + * Samples for CloudTrailTrails GetByResourceGroup. + */ +public final class CloudTrailTrailsGetByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * CloudTrailTrails_Get.json + */ + /** + * Sample code: CloudTrailTrails_Get. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void cloudTrailTrailsGet(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.cloudTrailTrails() + .getByResourceGroupWithResponse("rgcloudTrailTrail", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/CloudTrailTrailsListByResourceGroupSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/CloudTrailTrailsListByResourceGroupSamples.java new file mode 100644 index 000000000000..f1be38950758 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/CloudTrailTrailsListByResourceGroupSamples.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +/** + * Samples for CloudTrailTrails ListByResourceGroup. + */ +public final class CloudTrailTrailsListByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * CloudTrailTrails_ListByResourceGroup.json + */ + /** + * Sample code: CloudTrailTrails_ListByResourceGroup. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + cloudTrailTrailsListByResourceGroup(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.cloudTrailTrails().listByResourceGroup("rgcloudTrailTrail", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/CloudTrailTrailsListSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/CloudTrailTrailsListSamples.java new file mode 100644 index 000000000000..74a85f2c3d36 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/CloudTrailTrailsListSamples.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +/** + * Samples for CloudTrailTrails List. + */ +public final class CloudTrailTrailsListSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * CloudTrailTrails_ListBySubscription.json + */ + /** + * Sample code: CloudTrailTrails_ListBySubscription. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + cloudTrailTrailsListBySubscription(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.cloudTrailTrails().list(com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/CloudTrailTrailsUpdateSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/CloudTrailTrailsUpdateSamples.java new file mode 100644 index 000000000000..485129f0742e --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/CloudTrailTrailsUpdateSamples.java @@ -0,0 +1,45 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +import com.azure.resourcemanager.awsconnector.models.CloudTrail; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for CloudTrailTrails Update. + */ +public final class CloudTrailTrailsUpdateSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * CloudTrailTrails_Update.json + */ + /** + * Sample code: CloudTrailTrails_Update. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void cloudTrailTrailsUpdate(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + CloudTrail resource = manager.cloudTrailTrails() + .getByResourceGroupWithResponse("rgcloudTrailTrail", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE) + .getValue(); + resource.update().withTags(mapOf("key1706", "fakeTokenPlaceholder")).apply(); + } + + // Use "Map.of" if available + @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/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/CloudWatchAlarmsCreateOrReplaceSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/CloudWatchAlarmsCreateOrReplaceSamples.java new file mode 100644 index 000000000000..c9c4a1ccef6b --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/CloudWatchAlarmsCreateOrReplaceSamples.java @@ -0,0 +1,105 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +import com.azure.resourcemanager.awsconnector.models.AwsCloudWatchAlarmProperties; +import com.azure.resourcemanager.awsconnector.models.CloudWatchAlarmProperties; +import com.azure.resourcemanager.awsconnector.models.Dimension; +import com.azure.resourcemanager.awsconnector.models.Metric; +import com.azure.resourcemanager.awsconnector.models.MetricDataQuery; +import com.azure.resourcemanager.awsconnector.models.MetricStat; +import com.azure.resourcemanager.awsconnector.models.TagAutoGenerated6; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for CloudWatchAlarms CreateOrReplace. + */ +public final class CloudWatchAlarmsCreateOrReplaceSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * CloudWatchAlarms_CreateOrReplace.json + */ + /** + * Sample code: CloudWatchAlarms_CreateOrReplace. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + cloudWatchAlarmsCreateOrReplace(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.cloudWatchAlarms() + .define("Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])") + .withRegion("nbymldrgacokglzmyglynjohhnj") + .withExistingResourceGroup("rgcloudWatchAlarm") + .withTags(mapOf("key7594", "fakeTokenPlaceholder")) + .withProperties( + new CloudWatchAlarmProperties() + .withAwsProperties( + new AwsCloudWatchAlarmProperties().withActionsEnabled(true) + .withAlarmActions(Arrays.asList("ydnvbaggrnyxwzika")) + .withAlarmDescription("idvyiwmbllvlfvjcibommfbp") + .withAlarmName("ooriavzb") + .withArn("twsifnftkdrfzflvvsuka") + .withComparisonOperator("qo") + .withDatapointsToAlarm(30) + .withDimensions( + Arrays.asList(new Dimension().withName("bfnmnqiewf").withValue("lnphxdrevivdil"))) + .withEvaluateLowSampleCountPercentile("oihpnjstsw") + .withEvaluationPeriods(15) + .withExtendedStatistic("czkqsxjyzryvvkzoshk") + .withInsufficientDataActions(Arrays.asList("dfkb")) + .withMetricName("bkdkskukix") + .withMetrics( + Arrays + .asList( + new MetricDataQuery().withAccountId("rbtogpxgrissdcvqupcuhqqesz") + .withExpression("hhxrpieqtbvafrujybxxa") + .withId("zcevmcxhujphx") + .withLabel("jmeaobrgk") + .withMetricStat(new MetricStat() + .withMetric(new Metric() + .withDimensions(Arrays.asList(new Dimension().withName("bfnmnqiewf") + .withValue("lnphxdrevivdil"))) + .withMetricName("mabmwxjydr") + .withNamespace("wwoppcactqawdnkpxvjlo")) + .withPeriod(22) + .withStat("znmppqcobugvvlzccemylhxzsfsg") + .withUnit("vu")) + .withPeriod(27) + .withReturnData(true))) + .withNamespace("ptrnxovqoagxfepnjkpewbbusjkkzr") + .withOkActions(Arrays.asList("afskbnaohvdlb")) + .withPeriod(5) + .withStatistic("yrrnvsfpyvhnzlmw") + .withTags(Arrays + .asList(new TagAutoGenerated6().withKey("fakeTokenPlaceholder").withValue("zswuuw"))) + .withThreshold(17.0F) + .withThresholdMetricId("sqtfzityufokpxbthucjitcljvo") + .withTreatMissingData("iqrbyvljxufjwybtkjc") + .withUnit("vbjipwqqaobwlyebv")) + .withPublicCloudConnectorsResourceId("upovlpslvvatbmxiuwhvj") + .withAwsAccountId("qcoqhrkbfdowqmkzarqbtwcprj") + .withArn("uhqszqzfmdpnmiwu") + .withPublicCloudResourceName("sjxcsoycs") + .withAwsSourceSchema("drehzmurfidpdlcf") + .withAwsRegion("afpgkhpukllavze") + .withAwsTags(mapOf("key6400", "fakeTokenPlaceholder"))) + .create(); + } + + // Use "Map.of" if available + @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/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/CloudWatchAlarmsDeleteSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/CloudWatchAlarmsDeleteSamples.java new file mode 100644 index 000000000000..478e2e6607c1 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/CloudWatchAlarmsDeleteSamples.java @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +/** + * Samples for CloudWatchAlarms Delete. + */ +public final class CloudWatchAlarmsDeleteSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * CloudWatchAlarms_Delete.json + */ + /** + * Sample code: CloudWatchAlarms_Delete. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void cloudWatchAlarmsDelete(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.cloudWatchAlarms() + .delete("rgcloudWatchAlarm", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/CloudWatchAlarmsGetByResourceGroupSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/CloudWatchAlarmsGetByResourceGroupSamples.java new file mode 100644 index 000000000000..d5117517cedd --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/CloudWatchAlarmsGetByResourceGroupSamples.java @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +/** + * Samples for CloudWatchAlarms GetByResourceGroup. + */ +public final class CloudWatchAlarmsGetByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * CloudWatchAlarms_Get.json + */ + /** + * Sample code: CloudWatchAlarms_Get. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void cloudWatchAlarmsGet(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.cloudWatchAlarms() + .getByResourceGroupWithResponse("rgcloudWatchAlarm", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/CloudWatchAlarmsListByResourceGroupSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/CloudWatchAlarmsListByResourceGroupSamples.java new file mode 100644 index 000000000000..968f2df7b3ed --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/CloudWatchAlarmsListByResourceGroupSamples.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +/** + * Samples for CloudWatchAlarms ListByResourceGroup. + */ +public final class CloudWatchAlarmsListByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * CloudWatchAlarms_ListByResourceGroup.json + */ + /** + * Sample code: CloudWatchAlarms_ListByResourceGroup. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + cloudWatchAlarmsListByResourceGroup(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.cloudWatchAlarms().listByResourceGroup("rgcloudWatchAlarm", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/CloudWatchAlarmsListSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/CloudWatchAlarmsListSamples.java new file mode 100644 index 000000000000..aa99a145ceaf --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/CloudWatchAlarmsListSamples.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +/** + * Samples for CloudWatchAlarms List. + */ +public final class CloudWatchAlarmsListSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * CloudWatchAlarms_ListBySubscription.json + */ + /** + * Sample code: CloudWatchAlarms_ListBySubscription. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + cloudWatchAlarmsListBySubscription(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.cloudWatchAlarms().list(com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/CloudWatchAlarmsUpdateSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/CloudWatchAlarmsUpdateSamples.java new file mode 100644 index 000000000000..3c86929c3709 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/CloudWatchAlarmsUpdateSamples.java @@ -0,0 +1,45 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +import com.azure.resourcemanager.awsconnector.models.CloudWatchAlarm; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for CloudWatchAlarms Update. + */ +public final class CloudWatchAlarmsUpdateSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * CloudWatchAlarms_Update.json + */ + /** + * Sample code: CloudWatchAlarms_Update. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void cloudWatchAlarmsUpdate(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + CloudWatchAlarm resource = manager.cloudWatchAlarms() + .getByResourceGroupWithResponse("rgcloudWatchAlarm", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE) + .getValue(); + resource.update().withTags(mapOf("key5472", "fakeTokenPlaceholder")).apply(); + } + + // Use "Map.of" if available + @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/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/CodeBuildProjectsCreateOrReplaceSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/CodeBuildProjectsCreateOrReplaceSamples.java new file mode 100644 index 000000000000..9704edef0e68 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/CodeBuildProjectsCreateOrReplaceSamples.java @@ -0,0 +1,255 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +import com.azure.resourcemanager.awsconnector.models.ArtifactNamespace; +import com.azure.resourcemanager.awsconnector.models.ArtifactNamespaceEnumValue; +import com.azure.resourcemanager.awsconnector.models.ArtifactPackaging; +import com.azure.resourcemanager.awsconnector.models.ArtifactPackagingEnumValue; +import com.azure.resourcemanager.awsconnector.models.ArtifactsType; +import com.azure.resourcemanager.awsconnector.models.ArtifactsTypeEnumValue; +import com.azure.resourcemanager.awsconnector.models.AwsCodeBuildProjectProperties; +import com.azure.resourcemanager.awsconnector.models.BatchReportModeType; +import com.azure.resourcemanager.awsconnector.models.BatchReportModeTypeEnumValue; +import com.azure.resourcemanager.awsconnector.models.BatchRestrictions; +import com.azure.resourcemanager.awsconnector.models.BucketOwnerAccess; +import com.azure.resourcemanager.awsconnector.models.BucketOwnerAccessEnumValue; +import com.azure.resourcemanager.awsconnector.models.BuildStatusConfig; +import com.azure.resourcemanager.awsconnector.models.CacheMode; +import com.azure.resourcemanager.awsconnector.models.CacheType; +import com.azure.resourcemanager.awsconnector.models.CacheTypeEnumValue; +import com.azure.resourcemanager.awsconnector.models.CloudWatchLogsConfig; +import com.azure.resourcemanager.awsconnector.models.CodeBuildProjectProperties; +import com.azure.resourcemanager.awsconnector.models.ComputeType; +import com.azure.resourcemanager.awsconnector.models.ComputeTypeEnumValue; +import com.azure.resourcemanager.awsconnector.models.CredentialProviderType; +import com.azure.resourcemanager.awsconnector.models.CredentialProviderTypeEnumValue; +import com.azure.resourcemanager.awsconnector.models.EnvironmentType; +import com.azure.resourcemanager.awsconnector.models.EnvironmentTypeEnumValue; +import com.azure.resourcemanager.awsconnector.models.EnvironmentVariable; +import com.azure.resourcemanager.awsconnector.models.EnvironmentVariableType; +import com.azure.resourcemanager.awsconnector.models.EnvironmentVariableTypeEnumValue; +import com.azure.resourcemanager.awsconnector.models.FileSystemType; +import com.azure.resourcemanager.awsconnector.models.FileSystemTypeEnumValue; +import com.azure.resourcemanager.awsconnector.models.FilterGroup; +import com.azure.resourcemanager.awsconnector.models.GitSubmodulesConfig; +import com.azure.resourcemanager.awsconnector.models.ImagePullCredentialsType; +import com.azure.resourcemanager.awsconnector.models.ImagePullCredentialsTypeEnumValue; +import com.azure.resourcemanager.awsconnector.models.LogsConfig; +import com.azure.resourcemanager.awsconnector.models.LogsConfigStatusType; +import com.azure.resourcemanager.awsconnector.models.LogsConfigStatusTypeEnumValue; +import com.azure.resourcemanager.awsconnector.models.ProjectArtifacts; +import com.azure.resourcemanager.awsconnector.models.ProjectBadge; +import com.azure.resourcemanager.awsconnector.models.ProjectBuildBatchConfig; +import com.azure.resourcemanager.awsconnector.models.ProjectCache; +import com.azure.resourcemanager.awsconnector.models.ProjectEnvironment; +import com.azure.resourcemanager.awsconnector.models.ProjectFileSystemLocation; +import com.azure.resourcemanager.awsconnector.models.ProjectFleet; +import com.azure.resourcemanager.awsconnector.models.ProjectSource; +import com.azure.resourcemanager.awsconnector.models.ProjectSourceVersion; +import com.azure.resourcemanager.awsconnector.models.ProjectVisibilityType; +import com.azure.resourcemanager.awsconnector.models.ProjectVisibilityTypeEnumValue; +import com.azure.resourcemanager.awsconnector.models.RegistryCredential; +import com.azure.resourcemanager.awsconnector.models.S3LogsConfig; +import com.azure.resourcemanager.awsconnector.models.SourceAuth; +import com.azure.resourcemanager.awsconnector.models.SourceAuthType; +import com.azure.resourcemanager.awsconnector.models.SourceAuthTypeEnumValue; +import com.azure.resourcemanager.awsconnector.models.SourceType; +import com.azure.resourcemanager.awsconnector.models.SourceTypeEnumValue; +import com.azure.resourcemanager.awsconnector.models.TagAutoGenerated7; +import com.azure.resourcemanager.awsconnector.models.VpcConfig; +import com.azure.resourcemanager.awsconnector.models.Webhook; +import com.azure.resourcemanager.awsconnector.models.WebhookBuildType; +import com.azure.resourcemanager.awsconnector.models.WebhookBuildTypeEnumValue; +import com.azure.resourcemanager.awsconnector.models.WebhookFilter; +import com.azure.resourcemanager.awsconnector.models.WebhookFilterType; +import com.azure.resourcemanager.awsconnector.models.WebhookFilterTypeEnumValue; +import java.time.OffsetDateTime; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for CodeBuildProjects CreateOrReplace. + */ +public final class CodeBuildProjectsCreateOrReplaceSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * CodeBuildProjects_CreateOrReplace.json + */ + /** + * Sample code: CodeBuildProjects_CreateOrReplace. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + codeBuildProjectsCreateOrReplace(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.codeBuildProjects() + .define("Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])") + .withRegion("fpjpnhlms") + .withExistingResourceGroup("rgcodeBuildProject") + .withTags(mapOf("key4761", "fakeTokenPlaceholder")) + .withProperties(new CodeBuildProjectProperties() + .withAwsProperties(new AwsCodeBuildProjectProperties().withArn("wwhfeljvmnwnqcgxusgnvoq") + .withArtifacts(new ProjectArtifacts() + .withArtifactIdentifier("hcfdqzwleorpe") + .withBucketOwnerAccess(new BucketOwnerAccessEnumValue().withValue(BucketOwnerAccess.FULL)) + .withEncryptionDisabled(true) + .withLocation("zvhsfl") + .withName("dsqyinskfvabyktgjbszny") + .withNamespaceType(new ArtifactNamespaceEnumValue().withValue(ArtifactNamespace.BUILD_ID)) + .withOverrideArtifactName(true) + .withPackaging(new ArtifactPackagingEnumValue().withValue(ArtifactPackaging.NONE)) + .withPath("zbsfhzkoet") + .withType(new ArtifactsTypeEnumValue().withValue(ArtifactsType.CODEPIPELINE))) + .withBadge(new ProjectBadge().withBadgeEnabled(true).withBadgeRequestUrl("ulpdsdbgtwm")) + .withBuildBatchConfig(new ProjectBuildBatchConfig() + .withBatchReportMode( + new BatchReportModeTypeEnumValue().withValue(BatchReportModeType.REPORT_AGGREGATED_BATCH)) + .withCombineArtifacts(true) + .withRestrictions( + new BatchRestrictions().withComputeTypesAllowed(Arrays.asList("ievoltoldfrhkpv")) + .withMaximumBuildsAllowed(15)) + .withServiceRole("lceqjutffrykpuzjxvijbzpames") + .withTimeoutInMins(3)) + .withCache(new ProjectCache().withLocation("wgmqyjzlxsazecszvdkfr") + .withModes(Arrays.asList(CacheMode.LOCAL_CUSTOM_CACHE)) + .withType(new CacheTypeEnumValue().withValue(CacheType.LOCAL))) + .withConcurrentBuildLimit(19) + .withCreated(OffsetDateTime.parse("2024-10-08T03:48:48.570Z")) + .withDescription("adnfxoh") + .withEncryptionKey("fakeTokenPlaceholder") + .withEnvironment( + new ProjectEnvironment().withCertificate("olzbdlydjqzkzlflzxcdjjjv") + .withComputeType(new ComputeTypeEnumValue().withValue(ComputeType.BUILD_GENERAL1_2XLARGE)) + .withEnvironmentVariables( + Arrays.asList(new EnvironmentVariable().withName("bmzlnmjzuxrxeemxfutykrlvemt") + .withType(new EnvironmentVariableTypeEnumValue() + .withValue(EnvironmentVariableType.PARAMETER_STORE)) + .withValue("eakfsmirkkwnizotyqqgmgjthn"))) + .withFleet(new ProjectFleet().withFleetArn("brslcsjgupcpeistg")) + .withImage("kkmioknmuhxurahmnjg") + .withImagePullCredentialsType( + new ImagePullCredentialsTypeEnumValue().withValue(ImagePullCredentialsType.CODEBUILD)) + .withPrivilegedMode(true) + .withRegistryCredential(new RegistryCredential().withCredential("fakeTokenPlaceholder") + .withCredentialProvider(new CredentialProviderTypeEnumValue() + .withValue(CredentialProviderType.SECRETS_MANAGER))) + .withType(new EnvironmentTypeEnumValue().withValue(EnvironmentType.ARM_CONTAINER))) + .withFileSystemLocations(Arrays.asList(new ProjectFileSystemLocation().withIdentifier("tdquc") + .withLocation("yeaotrzuhjtdtbfrlpvmlmaoqyioin") + .withMountOptions("tocdlorjekugjotphpxuyebjj") + .withMountPoint("fctmorvlmplsmeqvmavw") + .withType(new FileSystemTypeEnumValue().withValue(FileSystemType.EFS)))) + .withLastModified(OffsetDateTime.parse("2024-10-08T03:48:48.571Z")) + .withLogsConfig( + new LogsConfig() + .withCloudWatchLogs(new CloudWatchLogsConfig().withGroupName("t") + .withStatus( + new LogsConfigStatusTypeEnumValue().withValue(LogsConfigStatusType.DISABLED)) + .withStreamName("rrqzbaaicbiblat")) + .withS3Logs(new S3LogsConfig() + .withBucketOwnerAccess( + new BucketOwnerAccessEnumValue().withValue(BucketOwnerAccess.FULL)) + .withEncryptionDisabled(true) + .withLocation("zuepwokmlymlvsvzjawzxe") + .withStatus( + new LogsConfigStatusTypeEnumValue().withValue(LogsConfigStatusType.DISABLED)))) + .withName("budzhvktdvhxxy") + .withProjectVisibility(new ProjectVisibilityTypeEnumValue().withValue( + ProjectVisibilityType.PRIVATE)) + .withPublicProjectAlias("vstmzamjxtasdipcehcuwvfef") + .withQueuedTimeoutInMinutes(30) + .withResourceAccessRole("st") + .withSecondaryArtifacts(Arrays.asList(new ProjectArtifacts().withArtifactIdentifier("hcfdqzwleorpe") + .withBucketOwnerAccess(new BucketOwnerAccessEnumValue().withValue(BucketOwnerAccess.FULL)) + .withEncryptionDisabled(true) + .withLocation("zvhsfl") + .withName("dsqyinskfvabyktgjbszny") + .withNamespaceType(new ArtifactNamespaceEnumValue().withValue(ArtifactNamespace.BUILD_ID)) + .withOverrideArtifactName(true) + .withPackaging(new ArtifactPackagingEnumValue().withValue(ArtifactPackaging.NONE)) + .withPath("zbsfhzkoet") + .withType(new ArtifactsTypeEnumValue().withValue(ArtifactsType.CODEPIPELINE)))) + .withSecondarySourceVersions(Arrays.asList( + new ProjectSourceVersion() + .withSourceIdentifier("kiyezlaophakaslamcsxpkzggoj") + .withSourceVersion("zy"))) + .withSecondarySources( + Arrays + .asList( + new ProjectSource() + .withAuth( + new SourceAuth().withResource("oyfwquyzyjklbxlyjyddpmhmjgsgk") + .withType(new SourceAuthTypeEnumValue() + .withValue(SourceAuthType.CODECONNECTIONS))) + .withBuildStatusConfig( + new BuildStatusConfig().withContext("zoghbponrxfhugrjzdheibkada") + .withTargetUrl("ooonrchy")) + .withBuildspec("xxcoigvstisdhlfkfiblrgqhbtoqd") + .withGitCloneDepth(9) + .withGitSubmodulesConfig(new GitSubmodulesConfig().withFetchSubmodules(true)) + .withInsecureSsl(true) + .withLocation("owijjqkiwwegfcrynqcypho") + .withReportBuildStatus(true) + .withSourceIdentifier("lnhelescdeif") + .withType(new SourceTypeEnumValue().withValue(SourceType.BITBUCKET)))) + .withServiceRole("pydzdifzkz") + .withSource(new ProjectSource() + .withAuth(new SourceAuth().withResource("oyfwquyzyjklbxlyjyddpmhmjgsgk") + .withType(new SourceAuthTypeEnumValue().withValue(SourceAuthType.CODECONNECTIONS))) + .withBuildStatusConfig( + new BuildStatusConfig().withContext("zoghbponrxfhugrjzdheibkada").withTargetUrl("ooonrchy")) + .withBuildspec("xxcoigvstisdhlfkfiblrgqhbtoqd") + .withGitCloneDepth(9) + .withGitSubmodulesConfig(new GitSubmodulesConfig().withFetchSubmodules(true)) + .withInsecureSsl(true) + .withLocation("owijjqkiwwegfcrynqcypho") + .withReportBuildStatus(true) + .withSourceIdentifier("lnhelescdeif") + .withType(new SourceTypeEnumValue().withValue(SourceType.BITBUCKET))) + .withSourceVersion("idpngofzedxghp") + .withTags(Arrays + .asList(new TagAutoGenerated7().withKey("fakeTokenPlaceholder").withValue("iqwximmqwgsjlwdgv"))) + .withTimeoutInMinutes(7) + .withVpcConfig(new VpcConfig() + .withSecurityGroupIds(Arrays.asList("gcsqntkatjbigzj")) + .withSubnets(Arrays.asList("vxxzlquh")) + .withVpcId("dhjvrtrqgdb")) + .withWebhook( + new Webhook().withBranchFilter("fpfnqs") + .withBuildType(new WebhookBuildTypeEnumValue().withValue(WebhookBuildType.BUILD)) + .withFilterGroups(Arrays.asList( + new FilterGroup().withWebhookFilter(new WebhookFilter().withExcludeMatchedPattern(true) + .withPattern("ozqghxeblvksllu") + .withType(new WebhookFilterTypeEnumValue() + .withValue(WebhookFilterType.ACTOR_ACCOUNT_ID))))) + .withLastModifiedSecret(OffsetDateTime.parse("2024-10-08T03:48:48.574Z")) + .withPayloadUrl("wzalmmzopccsfbgwhxjneakxazu") + .withSecret("fakeTokenPlaceholder") + .withUrl("lwkywiwhmmdrirvajnxo"))) + .withPublicCloudConnectorsResourceId("azzcclgcodhtl") + .withAwsAccountId("caiac") + .withArn("ae") + .withPublicCloudResourceName("tzylnhhjwtzngucgrkvklav") + .withAwsSourceSchema("ujnztglujzqehsvvd") + .withAwsRegion("rakioiwqsjhpjqekyjft") + .withAwsTags(mapOf("key9822", "fakeTokenPlaceholder"))) + .create(); + } + + // Use "Map.of" if available + @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/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/CodeBuildProjectsDeleteSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/CodeBuildProjectsDeleteSamples.java new file mode 100644 index 000000000000..e340c85cad68 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/CodeBuildProjectsDeleteSamples.java @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +/** + * Samples for CodeBuildProjects Delete. + */ +public final class CodeBuildProjectsDeleteSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * CodeBuildProjects_Delete.json + */ + /** + * Sample code: CodeBuildProjects_Delete. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void codeBuildProjectsDelete(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.codeBuildProjects() + .delete("rgcodeBuildProject", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/CodeBuildProjectsGetByResourceGroupSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/CodeBuildProjectsGetByResourceGroupSamples.java new file mode 100644 index 000000000000..da335edda355 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/CodeBuildProjectsGetByResourceGroupSamples.java @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +/** + * Samples for CodeBuildProjects GetByResourceGroup. + */ +public final class CodeBuildProjectsGetByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * CodeBuildProjects_Get.json + */ + /** + * Sample code: CodeBuildProjects_Get. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void codeBuildProjectsGet(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.codeBuildProjects() + .getByResourceGroupWithResponse("rgcodeBuildProject", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/CodeBuildProjectsListByResourceGroupSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/CodeBuildProjectsListByResourceGroupSamples.java new file mode 100644 index 000000000000..8213438741fd --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/CodeBuildProjectsListByResourceGroupSamples.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +/** + * Samples for CodeBuildProjects ListByResourceGroup. + */ +public final class CodeBuildProjectsListByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * CodeBuildProjects_ListByResourceGroup.json + */ + /** + * Sample code: CodeBuildProjects_ListByResourceGroup. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + codeBuildProjectsListByResourceGroup(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.codeBuildProjects().listByResourceGroup("rgcodeBuildProject", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/CodeBuildProjectsListSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/CodeBuildProjectsListSamples.java new file mode 100644 index 000000000000..632fb3114964 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/CodeBuildProjectsListSamples.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +/** + * Samples for CodeBuildProjects List. + */ +public final class CodeBuildProjectsListSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * CodeBuildProjects_ListBySubscription.json + */ + /** + * Sample code: CodeBuildProjects_ListBySubscription. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + codeBuildProjectsListBySubscription(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.codeBuildProjects().list(com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/CodeBuildProjectsUpdateSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/CodeBuildProjectsUpdateSamples.java new file mode 100644 index 000000000000..26291a6f4d37 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/CodeBuildProjectsUpdateSamples.java @@ -0,0 +1,45 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +import com.azure.resourcemanager.awsconnector.models.CodeBuildProject; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for CodeBuildProjects Update. + */ +public final class CodeBuildProjectsUpdateSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * CodeBuildProjects_Update.json + */ + /** + * Sample code: CodeBuildProjects_Update. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void codeBuildProjectsUpdate(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + CodeBuildProject resource = manager.codeBuildProjects() + .getByResourceGroupWithResponse("rgcodeBuildProject", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE) + .getValue(); + resource.update().withTags(mapOf("key2639", "fakeTokenPlaceholder")).apply(); + } + + // Use "Map.of" if available + @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/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/CodeBuildSourceCredentialsInfosCreateOrReplaceSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/CodeBuildSourceCredentialsInfosCreateOrReplaceSamples.java new file mode 100644 index 000000000000..3960eba47818 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/CodeBuildSourceCredentialsInfosCreateOrReplaceSamples.java @@ -0,0 +1,63 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +import com.azure.resourcemanager.awsconnector.models.AuthType; +import com.azure.resourcemanager.awsconnector.models.AuthTypeEnumValue; +import com.azure.resourcemanager.awsconnector.models.AwsCodeBuildSourceCredentialsInfoProperties; +import com.azure.resourcemanager.awsconnector.models.CodeBuildSourceCredentialsInfoProperties; +import com.azure.resourcemanager.awsconnector.models.ServerType; +import com.azure.resourcemanager.awsconnector.models.ServerTypeEnumValue; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for CodeBuildSourceCredentialsInfos CreateOrReplace. + */ +public final class CodeBuildSourceCredentialsInfosCreateOrReplaceSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * CodeBuildSourceCredentialsInfos_CreateOrReplace.json + */ + /** + * Sample code: CodeBuildSourceCredentialsInfos_CreateOrReplace. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void codeBuildSourceCredentialsInfosCreateOrReplace( + com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.codeBuildSourceCredentialsInfos() + .define("Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])") + .withRegion("ckmgfv") + .withExistingResourceGroup("rgcodeBuildSourceCredentialsInfo") + .withTags(mapOf("key9473", "fakeTokenPlaceholder")) + .withProperties(new CodeBuildSourceCredentialsInfoProperties() + .withAwsProperties(new AwsCodeBuildSourceCredentialsInfoProperties().withArn("ewe") + .withAuthType(new AuthTypeEnumValue().withValue(AuthType.BASIC_AUTH)) + .withResource("cnzfvgfcneqgffgfclggx") + .withServerType(new ServerTypeEnumValue().withValue(ServerType.BITBUCKET))) + .withPublicCloudConnectorsResourceId("cidijgvkoos") + .withAwsAccountId("bgwhzakphzjipkxqwy") + .withArn("wdxdkxuukdnrlpqgkmmvfagzrwom") + .withPublicCloudResourceName("uazcojlwlavznbfsrjzbtthat") + .withAwsSourceSchema("rhibtnvrfkidnqhyynub") + .withAwsRegion("vywlxfetnso") + .withAwsTags(mapOf("key3224", "fakeTokenPlaceholder"))) + .create(); + } + + // Use "Map.of" if available + @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/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/CodeBuildSourceCredentialsInfosDeleteSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/CodeBuildSourceCredentialsInfosDeleteSamples.java new file mode 100644 index 000000000000..1ad49998a4bf --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/CodeBuildSourceCredentialsInfosDeleteSamples.java @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +/** + * Samples for CodeBuildSourceCredentialsInfos Delete. + */ +public final class CodeBuildSourceCredentialsInfosDeleteSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * CodeBuildSourceCredentialsInfos_Delete.json + */ + /** + * Sample code: CodeBuildSourceCredentialsInfos_Delete. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + codeBuildSourceCredentialsInfosDelete(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.codeBuildSourceCredentialsInfos() + .delete("rgcodeBuildSourceCredentialsInfo", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/CodeBuildSourceCredentialsInfosGetByResourceGroupSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/CodeBuildSourceCredentialsInfosGetByResourceGroupSamples.java new file mode 100644 index 000000000000..37381ba3cef9 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/CodeBuildSourceCredentialsInfosGetByResourceGroupSamples.java @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +/** + * Samples for CodeBuildSourceCredentialsInfos GetByResourceGroup. + */ +public final class CodeBuildSourceCredentialsInfosGetByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * CodeBuildSourceCredentialsInfos_Get.json + */ + /** + * Sample code: CodeBuildSourceCredentialsInfos_Get. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + codeBuildSourceCredentialsInfosGet(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.codeBuildSourceCredentialsInfos() + .getByResourceGroupWithResponse("rgcodeBuildSourceCredentialsInfo", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/CodeBuildSourceCredentialsInfosListByResourceGroupSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/CodeBuildSourceCredentialsInfosListByResourceGroupSamples.java new file mode 100644 index 000000000000..2abc293f5877 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/CodeBuildSourceCredentialsInfosListByResourceGroupSamples.java @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +/** + * Samples for CodeBuildSourceCredentialsInfos ListByResourceGroup. + */ +public final class CodeBuildSourceCredentialsInfosListByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * CodeBuildSourceCredentialsInfos_ListByResourceGroup.json + */ + /** + * Sample code: CodeBuildSourceCredentialsInfos_ListByResourceGroup. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void codeBuildSourceCredentialsInfosListByResourceGroup( + com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.codeBuildSourceCredentialsInfos() + .listByResourceGroup("rgcodeBuildSourceCredentialsInfo", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/CodeBuildSourceCredentialsInfosListSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/CodeBuildSourceCredentialsInfosListSamples.java new file mode 100644 index 000000000000..23668fe3ecd0 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/CodeBuildSourceCredentialsInfosListSamples.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +/** + * Samples for CodeBuildSourceCredentialsInfos List. + */ +public final class CodeBuildSourceCredentialsInfosListSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * CodeBuildSourceCredentialsInfos_ListBySubscription.json + */ + /** + * Sample code: CodeBuildSourceCredentialsInfos_ListBySubscription. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void codeBuildSourceCredentialsInfosListBySubscription( + com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.codeBuildSourceCredentialsInfos().list(com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/CodeBuildSourceCredentialsInfosUpdateSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/CodeBuildSourceCredentialsInfosUpdateSamples.java new file mode 100644 index 000000000000..a070d8ab7602 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/CodeBuildSourceCredentialsInfosUpdateSamples.java @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +import com.azure.resourcemanager.awsconnector.models.CodeBuildSourceCredentialsInfo; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for CodeBuildSourceCredentialsInfos Update. + */ +public final class CodeBuildSourceCredentialsInfosUpdateSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * CodeBuildSourceCredentialsInfos_Update.json + */ + /** + * Sample code: CodeBuildSourceCredentialsInfos_Update. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + codeBuildSourceCredentialsInfosUpdate(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + CodeBuildSourceCredentialsInfo resource = manager.codeBuildSourceCredentialsInfos() + .getByResourceGroupWithResponse("rgcodeBuildSourceCredentialsInfo", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE) + .getValue(); + resource.update().withTags(mapOf("key7809", "fakeTokenPlaceholder")).apply(); + } + + // Use "Map.of" if available + @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/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/ConfigServiceConfigurationRecorderStatusesCreateOrReplaceSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/ConfigServiceConfigurationRecorderStatusesCreateOrReplaceSamples.java new file mode 100644 index 000000000000..5c66f91ec70f --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/ConfigServiceConfigurationRecorderStatusesCreateOrReplaceSamples.java @@ -0,0 +1,67 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +import com.azure.resourcemanager.awsconnector.models.AwsConfigServiceConfigurationRecorderStatusProperties; +import com.azure.resourcemanager.awsconnector.models.ConfigServiceConfigurationRecorderStatusProperties; +import com.azure.resourcemanager.awsconnector.models.RecorderStatus; +import com.azure.resourcemanager.awsconnector.models.RecorderStatusEnumValue; +import java.time.OffsetDateTime; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for ConfigServiceConfigurationRecorderStatuses CreateOrReplace. + */ +public final class ConfigServiceConfigurationRecorderStatusesCreateOrReplaceSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * ConfigServiceConfigurationRecorderStatuses_CreateOrReplace.json + */ + /** + * Sample code: ConfigServiceConfigurationRecorderStatuses_CreateOrReplace. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void configServiceConfigurationRecorderStatusesCreateOrReplace( + com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.configServiceConfigurationRecorderStatuses() + .define("Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])") + .withRegion("aanagogcqgqikndwcsiwpf") + .withExistingResourceGroup("rgconfigServiceConfigurationRecorderStatus") + .withTags(mapOf("key333", "fakeTokenPlaceholder")) + .withProperties(new ConfigServiceConfigurationRecorderStatusProperties() + .withAwsProperties(new AwsConfigServiceConfigurationRecorderStatusProperties() + .withLastErrorCode("fakeTokenPlaceholder") + .withLastErrorMessage("qcopqdjuuwuwdvdjmupwgrnxux") + .withLastStartTime(OffsetDateTime.parse("2024-10-08T03:54:51.026Z")) + .withLastStatus(new RecorderStatusEnumValue().withValue(RecorderStatus.FAILURE)) + .withLastStatusChangeTime(OffsetDateTime.parse("2024-10-08T03:54:51.038Z")) + .withLastStopTime(OffsetDateTime.parse("2024-10-08T03:54:51.038Z")) + .withName("mvnralcjhhrhhczxctukeumhnhhsvs") + .withRecording(true)) + .withPublicCloudConnectorsResourceId("fzembqicafznmnrvzudikggimnls") + .withAwsAccountId("dnnbcuuhaxys") + .withArn("iwxslgken") + .withPublicCloudResourceName("stvqbbbupeyrxdfrdlslkxbi") + .withAwsSourceSchema("qprhkzdetwvsaznwugwruaned") + .withAwsRegion("pffplccggyknjkyebtjepdzwbim") + .withAwsTags(mapOf("key2618", "fakeTokenPlaceholder"))) + .create(); + } + + // Use "Map.of" if available + @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/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/ConfigServiceConfigurationRecorderStatusesDeleteSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/ConfigServiceConfigurationRecorderStatusesDeleteSamples.java new file mode 100644 index 000000000000..23e20409b1cf --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/ConfigServiceConfigurationRecorderStatusesDeleteSamples.java @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +/** + * Samples for ConfigServiceConfigurationRecorderStatuses Delete. + */ +public final class ConfigServiceConfigurationRecorderStatusesDeleteSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * ConfigServiceConfigurationRecorderStatuses_Delete.json + */ + /** + * Sample code: ConfigServiceConfigurationRecorderStatuses_Delete. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void configServiceConfigurationRecorderStatusesDelete( + com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.configServiceConfigurationRecorderStatuses() + .delete("rgconfigServiceConfigurationRecorderStatus", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/ConfigServiceConfigurationRecorderStatusesGetByResourceGroupSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/ConfigServiceConfigurationRecorderStatusesGetByResourceGroupSamples.java new file mode 100644 index 000000000000..9cc5ae16118d --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/ConfigServiceConfigurationRecorderStatusesGetByResourceGroupSamples.java @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +/** + * Samples for ConfigServiceConfigurationRecorderStatuses GetByResourceGroup. + */ +public final class ConfigServiceConfigurationRecorderStatusesGetByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * ConfigServiceConfigurationRecorderStatuses_Get.json + */ + /** + * Sample code: ConfigServiceConfigurationRecorderStatuses_Get. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void configServiceConfigurationRecorderStatusesGet( + com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.configServiceConfigurationRecorderStatuses() + .getByResourceGroupWithResponse("rgconfigServiceConfigurationRecorderStatus", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/ConfigServiceConfigurationRecorderStatusesListByResourceGroupSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/ConfigServiceConfigurationRecorderStatusesListByResourceGroupSamples.java new file mode 100644 index 000000000000..6af570ec596c --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/ConfigServiceConfigurationRecorderStatusesListByResourceGroupSamples.java @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +/** + * Samples for ConfigServiceConfigurationRecorderStatuses ListByResourceGroup. + */ +public final class ConfigServiceConfigurationRecorderStatusesListByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * ConfigServiceConfigurationRecorderStatuses_ListByResourceGroup.json + */ + /** + * Sample code: ConfigServiceConfigurationRecorderStatuses_ListByResourceGroup. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void configServiceConfigurationRecorderStatusesListByResourceGroup( + com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.configServiceConfigurationRecorderStatuses() + .listByResourceGroup("rgconfigServiceConfigurationRecorderStatus", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/ConfigServiceConfigurationRecorderStatusesListSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/ConfigServiceConfigurationRecorderStatusesListSamples.java new file mode 100644 index 000000000000..e167a50bec2a --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/ConfigServiceConfigurationRecorderStatusesListSamples.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +/** + * Samples for ConfigServiceConfigurationRecorderStatuses List. + */ +public final class ConfigServiceConfigurationRecorderStatusesListSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * ConfigServiceConfigurationRecorderStatuses_ListBySubscription.json + */ + /** + * Sample code: ConfigServiceConfigurationRecorderStatuses_ListBySubscription. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void configServiceConfigurationRecorderStatusesListBySubscription( + com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.configServiceConfigurationRecorderStatuses().list(com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/ConfigServiceConfigurationRecorderStatusesUpdateSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/ConfigServiceConfigurationRecorderStatusesUpdateSamples.java new file mode 100644 index 000000000000..3df0b085360e --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/ConfigServiceConfigurationRecorderStatusesUpdateSamples.java @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +import com.azure.resourcemanager.awsconnector.models.ConfigServiceConfigurationRecorderStatus; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for ConfigServiceConfigurationRecorderStatuses Update. + */ +public final class ConfigServiceConfigurationRecorderStatusesUpdateSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * ConfigServiceConfigurationRecorderStatuses_Update.json + */ + /** + * Sample code: ConfigServiceConfigurationRecorderStatuses_Update. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void configServiceConfigurationRecorderStatusesUpdate( + com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + ConfigServiceConfigurationRecorderStatus resource = manager.configServiceConfigurationRecorderStatuses() + .getByResourceGroupWithResponse("rgconfigServiceConfigurationRecorderStatus", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE) + .getValue(); + resource.update().withTags(mapOf("key4598", "fakeTokenPlaceholder")).apply(); + } + + // Use "Map.of" if available + @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/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/ConfigServiceConfigurationRecordersCreateOrReplaceSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/ConfigServiceConfigurationRecordersCreateOrReplaceSamples.java new file mode 100644 index 000000000000..79e98a111e42 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/ConfigServiceConfigurationRecordersCreateOrReplaceSamples.java @@ -0,0 +1,83 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +import com.azure.resourcemanager.awsconnector.models.AwsConfigServiceConfigurationRecorderProperties; +import com.azure.resourcemanager.awsconnector.models.ConfigServiceConfigurationRecorderProperties; +import com.azure.resourcemanager.awsconnector.models.ExclusionByResourceTypes; +import com.azure.resourcemanager.awsconnector.models.RecordingFrequency; +import com.azure.resourcemanager.awsconnector.models.RecordingFrequencyEnumValue; +import com.azure.resourcemanager.awsconnector.models.RecordingGroup; +import com.azure.resourcemanager.awsconnector.models.RecordingMode; +import com.azure.resourcemanager.awsconnector.models.RecordingModeOverride; +import com.azure.resourcemanager.awsconnector.models.RecordingStrategy; +import com.azure.resourcemanager.awsconnector.models.RecordingStrategyType; +import com.azure.resourcemanager.awsconnector.models.RecordingStrategyTypeEnumValue; +import com.azure.resourcemanager.awsconnector.models.ResourceType; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for ConfigServiceConfigurationRecorders CreateOrReplace. + */ +public final class ConfigServiceConfigurationRecordersCreateOrReplaceSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * ConfigServiceConfigurationRecorders_CreateOrReplace.json + */ + /** + * Sample code: ConfigServiceConfigurationRecorders_CreateOrReplace. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void configServiceConfigurationRecordersCreateOrReplace( + com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.configServiceConfigurationRecorders() + .define("Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])") + .withRegion("uhzzvapzjrmbzxfxdqyczgmcq") + .withExistingResourceGroup("rgconfigServiceConfigurationRecorder") + .withTags(mapOf("key1719", "fakeTokenPlaceholder")) + .withProperties(new ConfigServiceConfigurationRecorderProperties() + .withAwsProperties(new AwsConfigServiceConfigurationRecorderProperties().withName("umkcdjmciwgorjwxtm") + .withRecordingGroup(new RecordingGroup().withAllSupported(true) + .withExclusionByResourceTypes(new ExclusionByResourceTypes() + .withResourceTypes(Arrays.asList(ResourceType.AWS_ACM_CERTIFICATE))) + .withIncludeGlobalResourceTypes(true) + .withRecordingStrategy(new RecordingStrategy().withUseOnly(new RecordingStrategyTypeEnumValue() + .withValue(RecordingStrategyType.ALL_SUPPORTED_RESOURCE_TYPES))) + .withResourceTypes(Arrays.asList(ResourceType.AWS_ACM_CERTIFICATE))) + .withRecordingMode(new RecordingMode() + .withRecordingFrequency( + new RecordingFrequencyEnumValue().withValue(RecordingFrequency.CONTINUOUS)) + .withRecordingModeOverrides( + Arrays.asList(new RecordingModeOverride().withDescription("fxclcxlsumaur") + .withRecordingFrequency( + new RecordingFrequencyEnumValue().withValue(RecordingFrequency.CONTINUOUS)) + .withResourceTypes(Arrays.asList(ResourceType.AWS_ACM_CERTIFICATE))))) + .withRoleArn("alfppyafyrtgacngfxckcioci")) + .withPublicCloudConnectorsResourceId("ofuen") + .withAwsAccountId("pxxfgnveimxacjnvjtionuq") + .withArn("jdsihdzklcqjurvrxp") + .withPublicCloudResourceName("sieljn") + .withAwsSourceSchema("eolodykekuepfruwphifvo") + .withAwsRegion("xvzbwkxfmww") + .withAwsTags(mapOf("key7810", "fakeTokenPlaceholder"))) + .create(); + } + + // Use "Map.of" if available + @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/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/ConfigServiceConfigurationRecordersDeleteSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/ConfigServiceConfigurationRecordersDeleteSamples.java new file mode 100644 index 000000000000..6074fb58832e --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/ConfigServiceConfigurationRecordersDeleteSamples.java @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +/** + * Samples for ConfigServiceConfigurationRecorders Delete. + */ +public final class ConfigServiceConfigurationRecordersDeleteSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * ConfigServiceConfigurationRecorders_Delete.json + */ + /** + * Sample code: ConfigServiceConfigurationRecorders_Delete. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + configServiceConfigurationRecordersDelete(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.configServiceConfigurationRecorders() + .delete("rgconfigServiceConfigurationRecorder", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/ConfigServiceConfigurationRecordersGetByResourceGroupSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/ConfigServiceConfigurationRecordersGetByResourceGroupSamples.java new file mode 100644 index 000000000000..38319f0691c7 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/ConfigServiceConfigurationRecordersGetByResourceGroupSamples.java @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +/** + * Samples for ConfigServiceConfigurationRecorders GetByResourceGroup. + */ +public final class ConfigServiceConfigurationRecordersGetByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * ConfigServiceConfigurationRecorders_Get.json + */ + /** + * Sample code: ConfigServiceConfigurationRecorders_Get. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + configServiceConfigurationRecordersGet(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.configServiceConfigurationRecorders() + .getByResourceGroupWithResponse("rgconfigServiceConfigurationRecorder", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/ConfigServiceConfigurationRecordersListByResourceGroupSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/ConfigServiceConfigurationRecordersListByResourceGroupSamples.java new file mode 100644 index 000000000000..0c849f3a2014 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/ConfigServiceConfigurationRecordersListByResourceGroupSamples.java @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +/** + * Samples for ConfigServiceConfigurationRecorders ListByResourceGroup. + */ +public final class ConfigServiceConfigurationRecordersListByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * ConfigServiceConfigurationRecorders_ListByResourceGroup.json + */ + /** + * Sample code: ConfigServiceConfigurationRecorders_ListByResourceGroup. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void configServiceConfigurationRecordersListByResourceGroup( + com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.configServiceConfigurationRecorders() + .listByResourceGroup("rgconfigServiceConfigurationRecorder", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/ConfigServiceConfigurationRecordersListSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/ConfigServiceConfigurationRecordersListSamples.java new file mode 100644 index 000000000000..5da8a511a338 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/ConfigServiceConfigurationRecordersListSamples.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +/** + * Samples for ConfigServiceConfigurationRecorders List. + */ +public final class ConfigServiceConfigurationRecordersListSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * ConfigServiceConfigurationRecorders_ListBySubscription.json + */ + /** + * Sample code: ConfigServiceConfigurationRecorders_ListBySubscription. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void configServiceConfigurationRecordersListBySubscription( + com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.configServiceConfigurationRecorders().list(com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/ConfigServiceConfigurationRecordersUpdateSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/ConfigServiceConfigurationRecordersUpdateSamples.java new file mode 100644 index 000000000000..04a63905a0f4 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/ConfigServiceConfigurationRecordersUpdateSamples.java @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +import com.azure.resourcemanager.awsconnector.models.ConfigServiceConfigurationRecorder; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for ConfigServiceConfigurationRecorders Update. + */ +public final class ConfigServiceConfigurationRecordersUpdateSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * ConfigServiceConfigurationRecorders_Update.json + */ + /** + * Sample code: ConfigServiceConfigurationRecorders_Update. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + configServiceConfigurationRecordersUpdate(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + ConfigServiceConfigurationRecorder resource = manager.configServiceConfigurationRecorders() + .getByResourceGroupWithResponse("rgconfigServiceConfigurationRecorder", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE) + .getValue(); + resource.update().withTags(mapOf("key455", "fakeTokenPlaceholder")).apply(); + } + + // Use "Map.of" if available + @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/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/ConfigServiceDeliveryChannelsCreateOrReplaceSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/ConfigServiceDeliveryChannelsCreateOrReplaceSamples.java new file mode 100644 index 000000000000..3982aaa0bcdd --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/ConfigServiceDeliveryChannelsCreateOrReplaceSamples.java @@ -0,0 +1,66 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +import com.azure.resourcemanager.awsconnector.models.AwsConfigServiceDeliveryChannelProperties; +import com.azure.resourcemanager.awsconnector.models.ConfigServiceDeliveryChannelProperties; +import com.azure.resourcemanager.awsconnector.models.ConfigSnapshotDeliveryProperties; +import com.azure.resourcemanager.awsconnector.models.MaximumExecutionFrequency; +import com.azure.resourcemanager.awsconnector.models.MaximumExecutionFrequencyEnumValue; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for ConfigServiceDeliveryChannels CreateOrReplace. + */ +public final class ConfigServiceDeliveryChannelsCreateOrReplaceSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * ConfigServiceDeliveryChannels_CreateOrReplace.json + */ + /** + * Sample code: ConfigServiceDeliveryChannels_CreateOrReplace. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void configServiceDeliveryChannelsCreateOrReplace( + com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.configServiceDeliveryChannels() + .define("Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])") + .withRegion("djcnfaicagptxk") + .withExistingResourceGroup("rgconfigServiceDeliveryChannel") + .withTags(mapOf("key6889", "fakeTokenPlaceholder")) + .withProperties(new ConfigServiceDeliveryChannelProperties() + .withAwsProperties(new AwsConfigServiceDeliveryChannelProperties() + .withConfigSnapshotDeliveryProperties(new ConfigSnapshotDeliveryProperties().withDeliveryFrequency( + new MaximumExecutionFrequencyEnumValue().withValue(MaximumExecutionFrequency.ONE_HOUR))) + .withName("pfdwjyiaypjjedltuphpz") + .withS3BucketName("kcgtpxhibekwygxkybv") + .withS3KeyPrefix("fakeTokenPlaceholder") + .withS3KmsKeyArn("fakeTokenPlaceholder") + .withSnsTopicArn("qsxejnowkzljayrlhzyyppaya")) + .withPublicCloudConnectorsResourceId("kzdkfyjjgkoolslydcmbms") + .withAwsAccountId("xiyydxsyykydvymn") + .withArn("eevsmaokvzzbqwpfm") + .withPublicCloudResourceName("idxxguxjmvrzjnruzz") + .withAwsSourceSchema("ged") + .withAwsRegion("kngfw") + .withAwsTags(mapOf("key5086", "fakeTokenPlaceholder"))) + .create(); + } + + // Use "Map.of" if available + @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/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/ConfigServiceDeliveryChannelsDeleteSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/ConfigServiceDeliveryChannelsDeleteSamples.java new file mode 100644 index 000000000000..bcb6906a8bb5 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/ConfigServiceDeliveryChannelsDeleteSamples.java @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +/** + * Samples for ConfigServiceDeliveryChannels Delete. + */ +public final class ConfigServiceDeliveryChannelsDeleteSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * ConfigServiceDeliveryChannels_Delete.json + */ + /** + * Sample code: ConfigServiceDeliveryChannels_Delete. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + configServiceDeliveryChannelsDelete(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.configServiceDeliveryChannels() + .delete("rgconfigServiceDeliveryChannel", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/ConfigServiceDeliveryChannelsGetByResourceGroupSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/ConfigServiceDeliveryChannelsGetByResourceGroupSamples.java new file mode 100644 index 000000000000..0088fc5c6d53 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/ConfigServiceDeliveryChannelsGetByResourceGroupSamples.java @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +/** + * Samples for ConfigServiceDeliveryChannels GetByResourceGroup. + */ +public final class ConfigServiceDeliveryChannelsGetByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * ConfigServiceDeliveryChannels_Get.json + */ + /** + * Sample code: ConfigServiceDeliveryChannels_Get. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + configServiceDeliveryChannelsGet(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.configServiceDeliveryChannels() + .getByResourceGroupWithResponse("rgconfigServiceDeliveryChannel", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/ConfigServiceDeliveryChannelsListByResourceGroupSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/ConfigServiceDeliveryChannelsListByResourceGroupSamples.java new file mode 100644 index 000000000000..08ed7fa75ede --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/ConfigServiceDeliveryChannelsListByResourceGroupSamples.java @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +/** + * Samples for ConfigServiceDeliveryChannels ListByResourceGroup. + */ +public final class ConfigServiceDeliveryChannelsListByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * ConfigServiceDeliveryChannels_ListByResourceGroup.json + */ + /** + * Sample code: ConfigServiceDeliveryChannels_ListByResourceGroup. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void configServiceDeliveryChannelsListByResourceGroup( + com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.configServiceDeliveryChannels() + .listByResourceGroup("rgconfigServiceDeliveryChannel", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/ConfigServiceDeliveryChannelsListSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/ConfigServiceDeliveryChannelsListSamples.java new file mode 100644 index 000000000000..55a5ac0f1059 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/ConfigServiceDeliveryChannelsListSamples.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +/** + * Samples for ConfigServiceDeliveryChannels List. + */ +public final class ConfigServiceDeliveryChannelsListSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * ConfigServiceDeliveryChannels_ListBySubscription.json + */ + /** + * Sample code: ConfigServiceDeliveryChannels_ListBySubscription. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void configServiceDeliveryChannelsListBySubscription( + com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.configServiceDeliveryChannels().list(com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/ConfigServiceDeliveryChannelsUpdateSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/ConfigServiceDeliveryChannelsUpdateSamples.java new file mode 100644 index 000000000000..c62e186d0aa1 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/ConfigServiceDeliveryChannelsUpdateSamples.java @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +import com.azure.resourcemanager.awsconnector.models.ConfigServiceDeliveryChannel; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for ConfigServiceDeliveryChannels Update. + */ +public final class ConfigServiceDeliveryChannelsUpdateSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * ConfigServiceDeliveryChannels_Update.json + */ + /** + * Sample code: ConfigServiceDeliveryChannels_Update. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + configServiceDeliveryChannelsUpdate(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + ConfigServiceDeliveryChannel resource = manager.configServiceDeliveryChannels() + .getByResourceGroupWithResponse("rgconfigServiceDeliveryChannel", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE) + .getValue(); + resource.update().withTags(mapOf("key7397", "fakeTokenPlaceholder")).apply(); + } + + // Use "Map.of" if available + @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/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/DatabaseMigrationServiceReplicationInstancesCreateOrReplaceSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/DatabaseMigrationServiceReplicationInstancesCreateOrReplaceSamples.java new file mode 100644 index 000000000000..5134633482fd --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/DatabaseMigrationServiceReplicationInstancesCreateOrReplaceSamples.java @@ -0,0 +1,103 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +import com.azure.resourcemanager.awsconnector.models.AvailabilityZone; +import com.azure.resourcemanager.awsconnector.models.AwsDatabaseMigrationServiceReplicationInstanceProperties; +import com.azure.resourcemanager.awsconnector.models.DatabaseMigrationServiceReplicationInstanceProperties; +import com.azure.resourcemanager.awsconnector.models.ReplicationPendingModifiedValues; +import com.azure.resourcemanager.awsconnector.models.ReplicationSubnetGroup; +import com.azure.resourcemanager.awsconnector.models.Subnet; +import com.azure.resourcemanager.awsconnector.models.VpcSecurityGroupMembership; +import java.time.OffsetDateTime; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for DatabaseMigrationServiceReplicationInstances CreateOrReplace. + */ +public final class DatabaseMigrationServiceReplicationInstancesCreateOrReplaceSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * DatabaseMigrationServiceReplicationInstances_CreateOrReplace.json + */ + /** + * Sample code: DatabaseMigrationServiceReplicationInstances_CreateOrReplace. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void databaseMigrationServiceReplicationInstancesCreateOrReplace( + com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.databaseMigrationServiceReplicationInstances() + .define("Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])") + .withRegion("pkvlgucpnkkigflvahztr") + .withExistingResourceGroup("rgdatabaseMigrationServiceReplicationInstance") + .withTags(mapOf("key2694", "fakeTokenPlaceholder")) + .withProperties( + new DatabaseMigrationServiceReplicationInstanceProperties() + .withAwsProperties( + new AwsDatabaseMigrationServiceReplicationInstanceProperties().withAllocatedStorage(15) + .withAutoMinorVersionUpgrade(true) + .withAvailabilityZone("ufwkddqfhigljgpouncfjtwjhcm") + .withDnsNameServers("gjlforgdkkjubyetzafznct") + .withEngineVersion("ugfhxgag") + .withFreeUntil(OffsetDateTime.parse("2024-10-08T03:53:04.775Z")) + .withInstanceCreateTime(OffsetDateTime.parse("2024-10-08T03:53:04.776Z")) + .withKmsKeyId("fakeTokenPlaceholder") + .withMultiAZ(true) + .withNetworkType("ognalkhwgr") + .withPendingModifiedValues(new ReplicationPendingModifiedValues().withAllocatedStorage(24) + .withEngineVersion("ljjlnnkamqo") + .withMultiAZ(true) + .withNetworkType("xgynwurnwuqfirccmedvhphptwx") + .withReplicationInstanceClass("nah")) + .withPreferredMaintenanceWindow("cjhj") + .withPubliclyAccessible(true) + .withReplicationInstanceArn("kkuagugx") + .withReplicationInstanceClass("nrejgjvmp") + .withReplicationInstanceIdentifier("kmkhuvkgshmfnqrkh") + .withReplicationInstanceIpv6Addresses(Arrays.asList("chankbhtkfgmmql")) + .withReplicationInstancePrivateIpAddress("kzpeupvtv") + .withReplicationInstancePrivateIpAddresses(Arrays.asList("wpvurjepdvyqsut")) + .withReplicationInstancePublicIpAddress("cgolgdimqmrtbs") + .withReplicationInstancePublicIpAddresses(Arrays.asList("laguuyhnutmqr")) + .withReplicationInstanceStatus("prkwehbwglimljckrujss") + .withReplicationSubnetGroup(new ReplicationSubnetGroup() + .withReplicationSubnetGroupDescription("octprj") + .withReplicationSubnetGroupIdentifier("lp") + .withSubnetGroupStatus("u") + .withSubnets(Arrays.asList(new Subnet() + .withSubnetAvailabilityZone(new AvailabilityZone().withName("zkqyndrxrxjgvbcwycfd")) + .withSubnetIdentifier("bbjyuchlt") + .withSubnetStatus("pzsp"))) + .withSupportedNetworkTypes(Arrays.asList("flrojgbtzlv")) + .withVpcId("zsg")) + .withSecondaryAvailabilityZone("gfricycigffhmqcwzxxzwevrwf") + .withVpcSecurityGroups(Arrays.asList(new VpcSecurityGroupMembership().withStatus("tioerjd") + .withVpcSecurityGroupId("szupfofnwyrfpcpwi")))) + .withPublicCloudConnectorsResourceId("oafkmlxerdytgq") + .withAwsAccountId("zkpbtrjskcsejrxvaulidr") + .withArn("hgieneplknqcgzbvoj") + .withPublicCloudResourceName("ajrdejnsykvcfzomaktse") + .withAwsSourceSchema("aj") + .withAwsRegion("xflnvjqertqoawntyvmyorzemmx") + .withAwsTags(mapOf("key1826", "fakeTokenPlaceholder"))) + .create(); + } + + // Use "Map.of" if available + @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/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/DatabaseMigrationServiceReplicationInstancesDeleteSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/DatabaseMigrationServiceReplicationInstancesDeleteSamples.java new file mode 100644 index 000000000000..79d296f48ebb --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/DatabaseMigrationServiceReplicationInstancesDeleteSamples.java @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +/** + * Samples for DatabaseMigrationServiceReplicationInstances Delete. + */ +public final class DatabaseMigrationServiceReplicationInstancesDeleteSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * DatabaseMigrationServiceReplicationInstances_Delete.json + */ + /** + * Sample code: DatabaseMigrationServiceReplicationInstances_Delete. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void databaseMigrationServiceReplicationInstancesDelete( + com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.databaseMigrationServiceReplicationInstances() + .delete("rgdatabaseMigrationServiceReplicationInstance", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/DatabaseMigrationServiceReplicationInstancesGetByResourceGroupSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/DatabaseMigrationServiceReplicationInstancesGetByResourceGroupSamples.java new file mode 100644 index 000000000000..82f9e01bbb22 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/DatabaseMigrationServiceReplicationInstancesGetByResourceGroupSamples.java @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +/** + * Samples for DatabaseMigrationServiceReplicationInstances GetByResourceGroup. + */ +public final class DatabaseMigrationServiceReplicationInstancesGetByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * DatabaseMigrationServiceReplicationInstances_Get.json + */ + /** + * Sample code: DatabaseMigrationServiceReplicationInstances_Get. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void databaseMigrationServiceReplicationInstancesGet( + com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.databaseMigrationServiceReplicationInstances() + .getByResourceGroupWithResponse("rgdatabaseMigrationServiceReplicationInstance", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/DatabaseMigrationServiceReplicationInstancesListByResourceGroupSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/DatabaseMigrationServiceReplicationInstancesListByResourceGroupSamples.java new file mode 100644 index 000000000000..e0fbb35d4744 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/DatabaseMigrationServiceReplicationInstancesListByResourceGroupSamples.java @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +/** + * Samples for DatabaseMigrationServiceReplicationInstances ListByResourceGroup. + */ +public final class DatabaseMigrationServiceReplicationInstancesListByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * DatabaseMigrationServiceReplicationInstances_ListByResourceGroup.json + */ + /** + * Sample code: DatabaseMigrationServiceReplicationInstances_ListByResourceGroup. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void databaseMigrationServiceReplicationInstancesListByResourceGroup( + com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.databaseMigrationServiceReplicationInstances() + .listByResourceGroup("rgdatabaseMigrationServiceReplicationInstance", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/DatabaseMigrationServiceReplicationInstancesListSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/DatabaseMigrationServiceReplicationInstancesListSamples.java new file mode 100644 index 000000000000..f07308aee21d --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/DatabaseMigrationServiceReplicationInstancesListSamples.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +/** + * Samples for DatabaseMigrationServiceReplicationInstances List. + */ +public final class DatabaseMigrationServiceReplicationInstancesListSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * DatabaseMigrationServiceReplicationInstances_ListBySubscription.json + */ + /** + * Sample code: DatabaseMigrationServiceReplicationInstances_ListBySubscription. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void databaseMigrationServiceReplicationInstancesListBySubscription( + com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.databaseMigrationServiceReplicationInstances().list(com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/DatabaseMigrationServiceReplicationInstancesUpdateSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/DatabaseMigrationServiceReplicationInstancesUpdateSamples.java new file mode 100644 index 000000000000..2b7e2e775b4d --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/DatabaseMigrationServiceReplicationInstancesUpdateSamples.java @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +import com.azure.resourcemanager.awsconnector.models.DatabaseMigrationServiceReplicationInstance; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for DatabaseMigrationServiceReplicationInstances Update. + */ +public final class DatabaseMigrationServiceReplicationInstancesUpdateSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * DatabaseMigrationServiceReplicationInstances_Update.json + */ + /** + * Sample code: DatabaseMigrationServiceReplicationInstances_Update. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void databaseMigrationServiceReplicationInstancesUpdate( + com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + DatabaseMigrationServiceReplicationInstance resource = manager.databaseMigrationServiceReplicationInstances() + .getByResourceGroupWithResponse("rgdatabaseMigrationServiceReplicationInstance", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE) + .getValue(); + resource.update().withTags(mapOf("key4401", "fakeTokenPlaceholder")).apply(); + } + + // Use "Map.of" if available + @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/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/DaxClustersCreateOrReplaceSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/DaxClustersCreateOrReplaceSamples.java new file mode 100644 index 000000000000..0f53254bb98c --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/DaxClustersCreateOrReplaceSamples.java @@ -0,0 +1,101 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +import com.azure.resourcemanager.awsconnector.models.AwsDaxClusterProperties; +import com.azure.resourcemanager.awsconnector.models.ClusterEndpointEncryptionType; +import com.azure.resourcemanager.awsconnector.models.ClusterEndpointEncryptionTypeEnumValue; +import com.azure.resourcemanager.awsconnector.models.DaxClusterProperties; +import com.azure.resourcemanager.awsconnector.models.Endpoint; +import com.azure.resourcemanager.awsconnector.models.Node; +import com.azure.resourcemanager.awsconnector.models.NotificationConfigurationAutoGenerated; +import com.azure.resourcemanager.awsconnector.models.ParameterGroupStatus; +import com.azure.resourcemanager.awsconnector.models.SecurityGroupMembership; +import com.azure.resourcemanager.awsconnector.models.SseDescription; +import com.azure.resourcemanager.awsconnector.models.SseStatus; +import com.azure.resourcemanager.awsconnector.models.SseStatusEnumValue; +import java.time.OffsetDateTime; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for DaxClusters CreateOrReplace. + */ +public final class DaxClustersCreateOrReplaceSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * DaxClusters_CreateOrReplace.json + */ + /** + * Sample code: DaxClusters_CreateOrReplace. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void daxClustersCreateOrReplace(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.daxClusters() + .define("Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])") + .withRegion("vmw") + .withExistingResourceGroup("rgdaxCluster") + .withTags(mapOf("key1674", "fakeTokenPlaceholder")) + .withProperties(new DaxClusterProperties() + .withAwsProperties(new AwsDaxClusterProperties().withActiveNodes(18) + .withClusterArn("drxcjkivmlrtslbwoykkohay") + .withClusterDiscoveryEndpoint(new Endpoint().withAddress("piabfnkoscysceufovcpffxl") + .withPort(13) + .withUrl("bcwzfeebgdzlvoafvyddknwzaih")) + .withClusterEndpointEncryptionType( + new ClusterEndpointEncryptionTypeEnumValue().withValue(ClusterEndpointEncryptionType.NONE)) + .withClusterName("zobzejccpfjaqcvzutazmzjbl") + .withDescription("q") + .withIamRoleArn("epmvlmhygrgjvx") + .withNodeIdsToRemove(Arrays.asList("uzzbmymlnrssuuqf")) + .withNodeType("vwyypkakaevefciygrniikfpyul") + .withNodes(Arrays.asList(new Node().withAvailabilityZone("j") + .withEndpoint(new Endpoint().withAddress("piabfnkoscysceufovcpffxl") + .withPort(13) + .withUrl("bcwzfeebgdzlvoafvyddknwzaih")) + .withNodeCreateTime(OffsetDateTime.parse("2024-10-08T03:51:45.186Z")) + .withNodeId("stfvsn") + .withNodeStatus("cvxigvbkflormrnhzzjp") + .withParameterGroupStatus("ywehlocxyzqprjzljpwluyd"))) + .withNotificationConfiguration( + new NotificationConfigurationAutoGenerated().withTopicArn("phhrllxlsvtkodsyamltvoypqoj") + .withTopicStatus("dfjjkb")) + .withParameterGroup(new ParameterGroupStatus().withNodeIdsToReboot(Arrays.asList("idyqnyv")) + .withParameterApplyStatus("jrxbdxqellqqtknz") + .withParameterGroupName("ezciyomlrtvgjq")) + .withPreferredMaintenanceWindow("gnqllhurfpmhsujlnznvuhtnacwfe") + .withSseDescription( + new SseDescription().withStatus(new SseStatusEnumValue().withValue(SseStatus.DISABLED))) + .withSecurityGroups( + Arrays.asList(new SecurityGroupMembership().withSecurityGroupIdentifier("ehbvorabecsniiea") + .withStatus("ymc"))) + .withStatus("mpwpseuoxrzbpamqwtibhochip") + .withSubnetGroup("tzsrvhfugpjrwm") + .withTotalNodes(26)) + .withPublicCloudConnectorsResourceId("jzzs") + .withAwsAccountId("xgeehpujhnyfhspdaqcugx") + .withArn("eqibkrig") + .withPublicCloudResourceName("rdpgjpjzbwahajy") + .withAwsSourceSchema("ukv") + .withAwsRegion("kyjdudcmqspnbb") + .withAwsTags(mapOf("key1821", "fakeTokenPlaceholder"))) + .create(); + } + + // Use "Map.of" if available + @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/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/DaxClustersDeleteSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/DaxClustersDeleteSamples.java new file mode 100644 index 000000000000..78a1dc4a2bb2 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/DaxClustersDeleteSamples.java @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +/** + * Samples for DaxClusters Delete. + */ +public final class DaxClustersDeleteSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/DaxClusters_Delete. + * json + */ + /** + * Sample code: DaxClusters_Delete. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void daxClustersDelete(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.daxClusters() + .delete("rgdaxCluster", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/DaxClustersGetByResourceGroupSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/DaxClustersGetByResourceGroupSamples.java new file mode 100644 index 000000000000..4ff8e06611d6 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/DaxClustersGetByResourceGroupSamples.java @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +/** + * Samples for DaxClusters GetByResourceGroup. + */ +public final class DaxClustersGetByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/DaxClusters_Get. + * json + */ + /** + * Sample code: DaxClusters_Get. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void daxClustersGet(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.daxClusters() + .getByResourceGroupWithResponse("rgdaxCluster", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/DaxClustersListByResourceGroupSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/DaxClustersListByResourceGroupSamples.java new file mode 100644 index 000000000000..f3a0a2f6f73d --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/DaxClustersListByResourceGroupSamples.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +/** + * Samples for DaxClusters ListByResourceGroup. + */ +public final class DaxClustersListByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * DaxClusters_ListByResourceGroup.json + */ + /** + * Sample code: DaxClusters_ListByResourceGroup. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + daxClustersListByResourceGroup(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.daxClusters().listByResourceGroup("rgdaxCluster", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/DaxClustersListSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/DaxClustersListSamples.java new file mode 100644 index 000000000000..64651d68db4d --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/DaxClustersListSamples.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +/** + * Samples for DaxClusters List. + */ +public final class DaxClustersListSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * DaxClusters_ListBySubscription.json + */ + /** + * Sample code: DaxClusters_ListBySubscription. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + daxClustersListBySubscription(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.daxClusters().list(com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/DaxClustersUpdateSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/DaxClustersUpdateSamples.java new file mode 100644 index 000000000000..810f350d6ecd --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/DaxClustersUpdateSamples.java @@ -0,0 +1,45 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +import com.azure.resourcemanager.awsconnector.models.DaxCluster; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for DaxClusters Update. + */ +public final class DaxClustersUpdateSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/DaxClusters_Update. + * json + */ + /** + * Sample code: DaxClusters_Update. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void daxClustersUpdate(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + DaxCluster resource = manager.daxClusters() + .getByResourceGroupWithResponse("rgdaxCluster", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE) + .getValue(); + resource.update().withTags(mapOf("key3464", "fakeTokenPlaceholder")).apply(); + } + + // Use "Map.of" if available + @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/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/DynamoDbContinuousBackupsDescriptionsCreateOrReplaceSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/DynamoDbContinuousBackupsDescriptionsCreateOrReplaceSamples.java new file mode 100644 index 000000000000..2b35106491f4 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/DynamoDbContinuousBackupsDescriptionsCreateOrReplaceSamples.java @@ -0,0 +1,70 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +import com.azure.resourcemanager.awsconnector.models.AwsDynamoDBContinuousBackupsDescriptionProperties; +import com.azure.resourcemanager.awsconnector.models.ContinuousBackupsStatus; +import com.azure.resourcemanager.awsconnector.models.ContinuousBackupsStatusEnumValue; +import com.azure.resourcemanager.awsconnector.models.DynamoDBContinuousBackupsDescriptionProperties; +import com.azure.resourcemanager.awsconnector.models.PointInTimeRecoveryDescription; +import com.azure.resourcemanager.awsconnector.models.PointInTimeRecoveryStatus; +import com.azure.resourcemanager.awsconnector.models.PointInTimeRecoveryStatusEnumValue; +import java.time.OffsetDateTime; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for DynamoDbContinuousBackupsDescriptions CreateOrReplace. + */ +public final class DynamoDbContinuousBackupsDescriptionsCreateOrReplaceSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * DynamoDbContinuousBackupsDescriptions_CreateOrReplace.json + */ + /** + * Sample code: DynamoDbContinuousBackupsDescriptions_CreateOrReplace. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void dynamoDbContinuousBackupsDescriptionsCreateOrReplace( + com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.dynamoDbContinuousBackupsDescriptions() + .define("Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])") + .withRegion("zlepfxe") + .withExistingResourceGroup("rgdynamoDBContinuousBackupsDescription") + .withTags(mapOf("key6182", "fakeTokenPlaceholder")) + .withProperties( + new DynamoDBContinuousBackupsDescriptionProperties() + .withAwsProperties(new AwsDynamoDBContinuousBackupsDescriptionProperties() + .withContinuousBackupsStatus( + new ContinuousBackupsStatusEnumValue().withValue(ContinuousBackupsStatus.DISABLED)) + .withPointInTimeRecoveryDescription(new PointInTimeRecoveryDescription() + .withEarliestRestorableDateTime(OffsetDateTime.parse("2024-10-08T03:52:00.281Z")) + .withLatestRestorableDateTime(OffsetDateTime.parse("2024-10-08T03:52:00.281Z")) + .withPointInTimeRecoveryStatus(new PointInTimeRecoveryStatusEnumValue() + .withValue(PointInTimeRecoveryStatus.DISABLED)))) + .withPublicCloudConnectorsResourceId("cmxfprcuzlfsuapudqgzmyrz") + .withAwsAccountId("mf") + .withArn("ftscqdgahea") + .withPublicCloudResourceName("y") + .withAwsSourceSchema("qdkzzibfkzzsphoguehj") + .withAwsRegion("vvdgggbbnkqfqlawtbkkxhtn") + .withAwsTags(mapOf("key4982", "fakeTokenPlaceholder"))) + .create(); + } + + // Use "Map.of" if available + @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/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/DynamoDbContinuousBackupsDescriptionsDeleteSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/DynamoDbContinuousBackupsDescriptionsDeleteSamples.java new file mode 100644 index 000000000000..f3fd7923d8a1 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/DynamoDbContinuousBackupsDescriptionsDeleteSamples.java @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +/** + * Samples for DynamoDbContinuousBackupsDescriptions Delete. + */ +public final class DynamoDbContinuousBackupsDescriptionsDeleteSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * DynamoDbContinuousBackupsDescriptions_Delete.json + */ + /** + * Sample code: DynamoDbContinuousBackupsDescriptions_Delete. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void dynamoDbContinuousBackupsDescriptionsDelete( + com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.dynamoDbContinuousBackupsDescriptions() + .delete("rgdynamoDBContinuousBackupsDescription", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/DynamoDbContinuousBackupsDescriptionsGetByResourceGroupSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/DynamoDbContinuousBackupsDescriptionsGetByResourceGroupSamples.java new file mode 100644 index 000000000000..5e10dfb61b2c --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/DynamoDbContinuousBackupsDescriptionsGetByResourceGroupSamples.java @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +/** + * Samples for DynamoDbContinuousBackupsDescriptions GetByResourceGroup. + */ +public final class DynamoDbContinuousBackupsDescriptionsGetByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * DynamoDbContinuousBackupsDescriptions_Get.json + */ + /** + * Sample code: DynamoDbContinuousBackupsDescriptions_Get. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + dynamoDbContinuousBackupsDescriptionsGet(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.dynamoDbContinuousBackupsDescriptions() + .getByResourceGroupWithResponse("rgdynamoDBContinuousBackupsDescription", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/DynamoDbContinuousBackupsDescriptionsListByResourceGroupSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/DynamoDbContinuousBackupsDescriptionsListByResourceGroupSamples.java new file mode 100644 index 000000000000..bd03b7179ba6 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/DynamoDbContinuousBackupsDescriptionsListByResourceGroupSamples.java @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +/** + * Samples for DynamoDbContinuousBackupsDescriptions ListByResourceGroup. + */ +public final class DynamoDbContinuousBackupsDescriptionsListByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * DynamoDbContinuousBackupsDescriptions_ListByResourceGroup.json + */ + /** + * Sample code: DynamoDbContinuousBackupsDescriptions_ListByResourceGroup. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void dynamoDbContinuousBackupsDescriptionsListByResourceGroup( + com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.dynamoDbContinuousBackupsDescriptions() + .listByResourceGroup("rgdynamoDBContinuousBackupsDescription", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/DynamoDbContinuousBackupsDescriptionsListSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/DynamoDbContinuousBackupsDescriptionsListSamples.java new file mode 100644 index 000000000000..071bce575518 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/DynamoDbContinuousBackupsDescriptionsListSamples.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +/** + * Samples for DynamoDbContinuousBackupsDescriptions List. + */ +public final class DynamoDbContinuousBackupsDescriptionsListSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * DynamoDbContinuousBackupsDescriptions_ListBySubscription.json + */ + /** + * Sample code: DynamoDbContinuousBackupsDescriptions_ListBySubscription. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void dynamoDbContinuousBackupsDescriptionsListBySubscription( + com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.dynamoDbContinuousBackupsDescriptions().list(com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/DynamoDbContinuousBackupsDescriptionsUpdateSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/DynamoDbContinuousBackupsDescriptionsUpdateSamples.java new file mode 100644 index 000000000000..50e952d8073e --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/DynamoDbContinuousBackupsDescriptionsUpdateSamples.java @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +import com.azure.resourcemanager.awsconnector.models.DynamoDBContinuousBackupsDescription; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for DynamoDbContinuousBackupsDescriptions Update. + */ +public final class DynamoDbContinuousBackupsDescriptionsUpdateSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * DynamoDbContinuousBackupsDescriptions_Update.json + */ + /** + * Sample code: DynamoDbContinuousBackupsDescriptions_Update. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void dynamoDbContinuousBackupsDescriptionsUpdate( + com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + DynamoDBContinuousBackupsDescription resource = manager.dynamoDbContinuousBackupsDescriptions() + .getByResourceGroupWithResponse("rgdynamoDBContinuousBackupsDescription", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE) + .getValue(); + resource.update().withTags(mapOf("key5810", "fakeTokenPlaceholder")).apply(); + } + + // Use "Map.of" if available + @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/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/DynamoDbTablesCreateOrReplaceSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/DynamoDbTablesCreateOrReplaceSamples.java new file mode 100644 index 000000000000..df7d54b8ee71 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/DynamoDbTablesCreateOrReplaceSamples.java @@ -0,0 +1,126 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +import com.azure.resourcemanager.awsconnector.models.AttributeDefinition; +import com.azure.resourcemanager.awsconnector.models.AwsDynamoDBTableProperties; +import com.azure.resourcemanager.awsconnector.models.ContributorInsightsSpecification; +import com.azure.resourcemanager.awsconnector.models.Csv; +import com.azure.resourcemanager.awsconnector.models.DynamoDBTableProperties; +import com.azure.resourcemanager.awsconnector.models.GlobalSecondaryIndex; +import com.azure.resourcemanager.awsconnector.models.ImportSourceSpecification; +import com.azure.resourcemanager.awsconnector.models.InputFormatOptions; +import com.azure.resourcemanager.awsconnector.models.KeySchema; +import com.azure.resourcemanager.awsconnector.models.KinesisStreamSpecification; +import com.azure.resourcemanager.awsconnector.models.KinesisStreamSpecificationApproximateCreationDateTimePrecision; +import com.azure.resourcemanager.awsconnector.models.LocalSecondaryIndex; +import com.azure.resourcemanager.awsconnector.models.PointInTimeRecoverySpecification; +import com.azure.resourcemanager.awsconnector.models.Projection; +import com.azure.resourcemanager.awsconnector.models.ProvisionedThroughput; +import com.azure.resourcemanager.awsconnector.models.ResourcePolicy; +import com.azure.resourcemanager.awsconnector.models.S3BucketSource; +import com.azure.resourcemanager.awsconnector.models.SseSpecification; +import com.azure.resourcemanager.awsconnector.models.StreamSpecification; +import com.azure.resourcemanager.awsconnector.models.TagAutoGenerated8; +import com.azure.resourcemanager.awsconnector.models.TimeToLiveSpecification; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for DynamoDbTables CreateOrReplace. + */ +public final class DynamoDbTablesCreateOrReplaceSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * DynamoDbTables_CreateOrReplace.json + */ + /** + * Sample code: DynamoDbTables_CreateOrReplace. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + dynamoDbTablesCreateOrReplace(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.dynamoDbTables() + .define("Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])") + .withRegion("fmkjilswdjyisfuwxuj") + .withExistingResourceGroup("rgdynamoDBTable") + .withTags(mapOf("key2178", "fakeTokenPlaceholder")) + .withProperties(new DynamoDBTableProperties().withAwsProperties(new AwsDynamoDBTableProperties() + .withArn("qbvqgymuxfzuwybdspdhcuvfouwnet") + .withAttributeDefinitions(Arrays.asList(new AttributeDefinition().withAttributeName("caryhpofnkqtoc") + .withAttributeType("bcmjgzaljcemcrswr"))) + .withBillingMode("pwxrsjcybdcidejuhvrckvxyxad") + .withContributorInsightsSpecification(new ContributorInsightsSpecification().withEnabled(true)) + .withDeletionProtectionEnabled(true) + .withGlobalSecondaryIndexes(Arrays.asList(new GlobalSecondaryIndex() + .withContributorInsightsSpecification(new ContributorInsightsSpecification().withEnabled(true)) + .withIndexName("uqlzacnvsvayrvirrwwttb") + .withKeySchema(Arrays.asList( + new KeySchema().withAttributeName("wisgqkyoouaxivtrtay").withKeyType("fakeTokenPlaceholder"))) + .withProjection(new Projection().withNonKeyAttributes(Arrays.asList("loqmvohtjsscueegam")) + .withProjectionType("atbzepkydpgudoaqi")) + .withProvisionedThroughput( + new ProvisionedThroughput().withReadCapacityUnits(10).withWriteCapacityUnits(28)))) + .withImportSourceSpecification( + new ImportSourceSpecification().withInputCompressionType("bjswmnwxleqmcth") + .withInputFormat("grnhhysgejvbnecrqoynjomz") + .withInputFormatOptions( + new InputFormatOptions().withCsv(new Csv().withDelimiter("qzowvvpwwhptthlgvrtnpyjszetrt") + .withHeaderList(Arrays.asList("gminuylhgebpjx")))) + .withS3BucketSource(new S3BucketSource().withS3Bucket("exulhkspgmo") + .withS3BucketOwner("pyawhaxbwqhgarz") + .withS3KeyPrefix("fakeTokenPlaceholder"))) + .withKeySchema(Arrays.asList( + new KeySchema().withAttributeName("wisgqkyoouaxivtrtay").withKeyType("fakeTokenPlaceholder"))) + .withKinesisStreamSpecification(new KinesisStreamSpecification() + .withApproximateCreationDateTimePrecision( + KinesisStreamSpecificationApproximateCreationDateTimePrecision.MICROSECOND) + .withStreamArn("qldltl")) + .withLocalSecondaryIndexes(Arrays.asList(new LocalSecondaryIndex().withIndexName("gintyosxvkjqpe") + .withKeySchema(Arrays.asList( + new KeySchema().withAttributeName("wisgqkyoouaxivtrtay").withKeyType("fakeTokenPlaceholder"))) + .withProjection(new Projection().withNonKeyAttributes(Arrays.asList("loqmvohtjsscueegam")) + .withProjectionType("atbzepkydpgudoaqi")))) + .withPointInTimeRecoverySpecification( + new PointInTimeRecoverySpecification().withPointInTimeRecoveryEnabled(true)) + .withProvisionedThroughput( + new ProvisionedThroughput().withReadCapacityUnits(10).withWriteCapacityUnits(28)) + .withResourcePolicy(new ResourcePolicy()) + .withSseSpecification(new SseSpecification().withKmsMasterKeyId("fakeTokenPlaceholder") + .withSseEnabled(true) + .withSseType("osjalywculjbrystezvjojxe")) + .withStreamArn("xvkrzs") + .withStreamSpecification( + new StreamSpecification().withResourcePolicy(new ResourcePolicy()).withStreamViewType("wemod")) + .withTableClass("tmbfrfbppwhjpm") + .withTableName("mqvlcdboopn") + .withTags(Arrays.asList(new TagAutoGenerated8().withKey("fakeTokenPlaceholder").withValue("dkgweupnz"))) + .withTimeToLiveSpecification( + new TimeToLiveSpecification().withAttributeName("sxbfejubturdtyusqywguqni").withEnabled(true))) + .withPublicCloudConnectorsResourceId("nugnoqcknmrrminwvfvloqsporjd") + .withAwsAccountId("dejqcxb") + .withArn("gimtbcfiznraniycjyalnwrfstm") + .withPublicCloudResourceName("lkbwyvnzooydbnembmykhmw") + .withAwsSourceSchema("sqkkuxwamzevkp") + .withAwsRegion("rdzrhtbydhmaxzuwe") + .withAwsTags(mapOf("key3791", "fakeTokenPlaceholder"))) + .create(); + } + + // Use "Map.of" if available + @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/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/DynamoDbTablesDeleteSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/DynamoDbTablesDeleteSamples.java new file mode 100644 index 000000000000..412ff92ebc07 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/DynamoDbTablesDeleteSamples.java @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +/** + * Samples for DynamoDbTables Delete. + */ +public final class DynamoDbTablesDeleteSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * DynamoDbTables_Delete.json + */ + /** + * Sample code: DynamoDbTables_Delete. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void dynamoDbTablesDelete(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.dynamoDbTables() + .delete("rgdynamoDBTable", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/DynamoDbTablesGetByResourceGroupSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/DynamoDbTablesGetByResourceGroupSamples.java new file mode 100644 index 000000000000..e6adc36b8472 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/DynamoDbTablesGetByResourceGroupSamples.java @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +/** + * Samples for DynamoDbTables GetByResourceGroup. + */ +public final class DynamoDbTablesGetByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/DynamoDbTables_Get. + * json + */ + /** + * Sample code: DynamoDbTables_Get. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void dynamoDbTablesGet(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.dynamoDbTables() + .getByResourceGroupWithResponse("rgdynamoDBTable", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/DynamoDbTablesListByResourceGroupSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/DynamoDbTablesListByResourceGroupSamples.java new file mode 100644 index 000000000000..8203e606495c --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/DynamoDbTablesListByResourceGroupSamples.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +/** + * Samples for DynamoDbTables ListByResourceGroup. + */ +public final class DynamoDbTablesListByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * DynamoDbTables_ListByResourceGroup.json + */ + /** + * Sample code: DynamoDbTables_ListByResourceGroup. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + dynamoDbTablesListByResourceGroup(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.dynamoDbTables().listByResourceGroup("rgdynamoDBTable", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/DynamoDbTablesListSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/DynamoDbTablesListSamples.java new file mode 100644 index 000000000000..230b7be190ce --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/DynamoDbTablesListSamples.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +/** + * Samples for DynamoDbTables List. + */ +public final class DynamoDbTablesListSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * DynamoDbTables_ListBySubscription.json + */ + /** + * Sample code: DynamoDbTables_ListBySubscription. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + dynamoDbTablesListBySubscription(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.dynamoDbTables().list(com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/DynamoDbTablesUpdateSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/DynamoDbTablesUpdateSamples.java new file mode 100644 index 000000000000..7166f9c0cfa9 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/DynamoDbTablesUpdateSamples.java @@ -0,0 +1,45 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +import com.azure.resourcemanager.awsconnector.models.DynamoDBTable; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for DynamoDbTables Update. + */ +public final class DynamoDbTablesUpdateSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * DynamoDbTables_Update.json + */ + /** + * Sample code: DynamoDbTables_Update. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void dynamoDbTablesUpdate(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + DynamoDBTable resource = manager.dynamoDbTables() + .getByResourceGroupWithResponse("rgdynamoDBTable", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE) + .getValue(); + resource.update().withTags(mapOf("key6429", "fakeTokenPlaceholder")).apply(); + } + + // Use "Map.of" if available + @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/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/Ec2AccountAttributesCreateOrReplaceSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/Ec2AccountAttributesCreateOrReplaceSamples.java new file mode 100644 index 000000000000..48ab28234fee --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/Ec2AccountAttributesCreateOrReplaceSamples.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.awsconnector.generated; + +import com.azure.resourcemanager.awsconnector.models.AccountAttributeValue; +import com.azure.resourcemanager.awsconnector.models.AwsEc2AccountAttributeProperties; +import com.azure.resourcemanager.awsconnector.models.Ec2AccountAttributeProperties; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for Ec2AccountAttributes CreateOrReplace. + */ +public final class Ec2AccountAttributesCreateOrReplaceSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * Ec2AccountAttributes_CreateOrReplace.json + */ + /** + * Sample code: Ec2AccountAttributes_CreateOrReplace. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + ec2AccountAttributesCreateOrReplace(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.ec2AccountAttributes() + .define("Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])") + .withRegion("mxywielgbokfdxxwuudnbwzjcf") + .withExistingResourceGroup("rgec2AccountAttribute") + .withTags(mapOf("key6022", "fakeTokenPlaceholder")) + .withProperties(new Ec2AccountAttributeProperties() + .withAwsProperties(new AwsEc2AccountAttributeProperties().withAttributeName("vsrccnoksnxyyisrlfzkuj") + .withAttributeValues( + Arrays.asList(new AccountAttributeValue().withAttributeValue("lvlyhjnivtpgkbt")))) + .withPublicCloudConnectorsResourceId("rmmqxjdxoe") + .withAwsAccountId("jzeepmbcwiwakwsvqakkaz") + .withArn("ttwi") + .withPublicCloudResourceName("lhdzqjxtfagnhbdjev") + .withAwsSourceSchema("njukzwmmwgmvurer") + .withAwsRegion("ojtquhkurhjtoocjpjyibb") + .withAwsTags(mapOf("key2779", "fakeTokenPlaceholder"))) + .create(); + } + + // Use "Map.of" if available + @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/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/Ec2AccountAttributesDeleteSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/Ec2AccountAttributesDeleteSamples.java new file mode 100644 index 000000000000..1786cbad5477 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/Ec2AccountAttributesDeleteSamples.java @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +/** + * Samples for Ec2AccountAttributes Delete. + */ +public final class Ec2AccountAttributesDeleteSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * Ec2AccountAttributes_Delete.json + */ + /** + * Sample code: Ec2AccountAttributes_Delete. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void ec2AccountAttributesDelete(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.ec2AccountAttributes() + .delete("rgec2AccountAttribute", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/Ec2AccountAttributesGetByResourceGroupSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/Ec2AccountAttributesGetByResourceGroupSamples.java new file mode 100644 index 000000000000..5ee7360c4f38 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/Ec2AccountAttributesGetByResourceGroupSamples.java @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +/** + * Samples for Ec2AccountAttributes GetByResourceGroup. + */ +public final class Ec2AccountAttributesGetByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * Ec2AccountAttributes_Get.json + */ + /** + * Sample code: Ec2AccountAttributes_Get. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void ec2AccountAttributesGet(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.ec2AccountAttributes() + .getByResourceGroupWithResponse("rgec2AccountAttribute", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/Ec2AccountAttributesListByResourceGroupSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/Ec2AccountAttributesListByResourceGroupSamples.java new file mode 100644 index 000000000000..9532e761a6bd --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/Ec2AccountAttributesListByResourceGroupSamples.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +/** + * Samples for Ec2AccountAttributes ListByResourceGroup. + */ +public final class Ec2AccountAttributesListByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * Ec2AccountAttributes_ListByResourceGroup.json + */ + /** + * Sample code: Ec2AccountAttributes_ListByResourceGroup. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + ec2AccountAttributesListByResourceGroup(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.ec2AccountAttributes().listByResourceGroup("rgec2AccountAttribute", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/Ec2AccountAttributesListSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/Ec2AccountAttributesListSamples.java new file mode 100644 index 000000000000..1e7c4d2c9581 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/Ec2AccountAttributesListSamples.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +/** + * Samples for Ec2AccountAttributes List. + */ +public final class Ec2AccountAttributesListSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * Ec2AccountAttributes_ListBySubscription.json + */ + /** + * Sample code: Ec2AccountAttributes_ListBySubscription. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + ec2AccountAttributesListBySubscription(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.ec2AccountAttributes().list(com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/Ec2AccountAttributesUpdateSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/Ec2AccountAttributesUpdateSamples.java new file mode 100644 index 000000000000..b56d2de14dd5 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/Ec2AccountAttributesUpdateSamples.java @@ -0,0 +1,45 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +import com.azure.resourcemanager.awsconnector.models.Ec2AccountAttribute; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for Ec2AccountAttributes Update. + */ +public final class Ec2AccountAttributesUpdateSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * Ec2AccountAttributes_Update.json + */ + /** + * Sample code: Ec2AccountAttributes_Update. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void ec2AccountAttributesUpdate(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + Ec2AccountAttribute resource = manager.ec2AccountAttributes() + .getByResourceGroupWithResponse("rgec2AccountAttribute", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE) + .getValue(); + resource.update().withTags(mapOf("key675", "fakeTokenPlaceholder")).apply(); + } + + // Use "Map.of" if available + @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/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/Ec2AddressesCreateOrReplaceSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/Ec2AddressesCreateOrReplaceSamples.java new file mode 100644 index 000000000000..c6c44d7e0fae --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/Ec2AddressesCreateOrReplaceSamples.java @@ -0,0 +1,73 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +import com.azure.resourcemanager.awsconnector.models.AwsEc2AddressProperties; +import com.azure.resourcemanager.awsconnector.models.DomainType; +import com.azure.resourcemanager.awsconnector.models.DomainTypeEnumValue; +import com.azure.resourcemanager.awsconnector.models.Ec2AddressProperties; +import com.azure.resourcemanager.awsconnector.models.TagAutoGenerated9; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for Ec2Addresses CreateOrReplace. + */ +public final class Ec2AddressesCreateOrReplaceSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * Ec2Addresses_CreateOrReplace.json + */ + /** + * Sample code: Ec2Addresses_CreateOrReplace. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void ec2AddressesCreateOrReplace(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.ec2Addresses() + .define("Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])") + .withRegion("uwbmdjhaqaqz") + .withExistingResourceGroup("rgec2Address") + .withTags(mapOf("key991", "fakeTokenPlaceholder")) + .withProperties(new Ec2AddressProperties() + .withAwsProperties(new AwsEc2AddressProperties().withAllocationId("lakfpwuipmqvwqzpiojxgxjrh") + .withAssociationId("wwgugzolrxtpvpaxafaqi") + .withCarrierIp("tpwlxdfmqhkr") + .withCustomerOwnedIp("qpvlzqkbksm") + .withCustomerOwnedIpv4Pool("sbzgaydiiwsnarhj") + .withDomain(new DomainTypeEnumValue().withValue(DomainType.STANDARD)) + .withInstanceId("lcw") + .withNetworkBorderGroup("cvmuzymwrwriouiziwwhybkwv") + .withNetworkInterfaceId("pundetxxybkvjkwhenmdlxzoji") + .withNetworkInterfaceOwnerId("mxcypkkbqs") + .withPrivateIpAddress("syfgrbvaucqkmkakjhez") + .withPublicIp("uzkzeonfghtefuulqaev") + .withPublicIpv4Pool("dlv") + .withTags(Arrays.asList(new TagAutoGenerated9().withKey("fakeTokenPlaceholder") + .withValue("tcahesrhkpnaonjnhbfsmiyhypjmw")))) + .withPublicCloudConnectorsResourceId("eytnpsrqhczygcelqjky") + .withAwsAccountId("nfzczrgklte") + .withArn("kgqnwrdoqeqjraczlznfiu") + .withPublicCloudResourceName("xongligvmdxe") + .withAwsSourceSchema("uachsjdkxtczamkh") + .withAwsRegion("qocfydee") + .withAwsTags(mapOf("key6276", "fakeTokenPlaceholder"))) + .create(); + } + + // Use "Map.of" if available + @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/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/Ec2AddressesDeleteSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/Ec2AddressesDeleteSamples.java new file mode 100644 index 000000000000..472a682f80e5 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/Ec2AddressesDeleteSamples.java @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +/** + * Samples for Ec2Addresses Delete. + */ +public final class Ec2AddressesDeleteSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/Ec2Addresses_Delete + * .json + */ + /** + * Sample code: Ec2Addresses_Delete. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void ec2AddressesDelete(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.ec2Addresses() + .delete("rgec2Address", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/Ec2AddressesGetByResourceGroupSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/Ec2AddressesGetByResourceGroupSamples.java new file mode 100644 index 000000000000..2911975f6b46 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/Ec2AddressesGetByResourceGroupSamples.java @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +/** + * Samples for Ec2Addresses GetByResourceGroup. + */ +public final class Ec2AddressesGetByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/Ec2Addresses_Get. + * json + */ + /** + * Sample code: Ec2Addresses_Get. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void ec2AddressesGet(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.ec2Addresses() + .getByResourceGroupWithResponse("rgec2Address", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/Ec2AddressesListByResourceGroupSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/Ec2AddressesListByResourceGroupSamples.java new file mode 100644 index 000000000000..43284c63cd45 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/Ec2AddressesListByResourceGroupSamples.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +/** + * Samples for Ec2Addresses ListByResourceGroup. + */ +public final class Ec2AddressesListByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * Ec2Addresses_ListByResourceGroup.json + */ + /** + * Sample code: Ec2Addresses_ListByResourceGroup. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + ec2AddressesListByResourceGroup(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.ec2Addresses().listByResourceGroup("rgec2Address", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/Ec2AddressesListSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/Ec2AddressesListSamples.java new file mode 100644 index 000000000000..dec1348713fb --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/Ec2AddressesListSamples.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +/** + * Samples for Ec2Addresses List. + */ +public final class Ec2AddressesListSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * Ec2Addresses_ListBySubscription.json + */ + /** + * Sample code: Ec2Addresses_ListBySubscription. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + ec2AddressesListBySubscription(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.ec2Addresses().list(com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/Ec2AddressesUpdateSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/Ec2AddressesUpdateSamples.java new file mode 100644 index 000000000000..fd8b16656ec8 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/Ec2AddressesUpdateSamples.java @@ -0,0 +1,45 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +import com.azure.resourcemanager.awsconnector.models.Ec2Address; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for Ec2Addresses Update. + */ +public final class Ec2AddressesUpdateSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/Ec2Addresses_Update + * .json + */ + /** + * Sample code: Ec2Addresses_Update. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void ec2AddressesUpdate(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + Ec2Address resource = manager.ec2Addresses() + .getByResourceGroupWithResponse("rgec2Address", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE) + .getValue(); + resource.update().withTags(mapOf("key976", "fakeTokenPlaceholder")).apply(); + } + + // Use "Map.of" if available + @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/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/Ec2FlowLogsCreateOrReplaceSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/Ec2FlowLogsCreateOrReplaceSamples.java new file mode 100644 index 000000000000..bbe48ea660e4 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/Ec2FlowLogsCreateOrReplaceSamples.java @@ -0,0 +1,77 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +import com.azure.resourcemanager.awsconnector.models.AwsEc2FlowLogProperties; +import com.azure.resourcemanager.awsconnector.models.DestinationOptionsModelProperties; +import com.azure.resourcemanager.awsconnector.models.Ec2FlowLogProperties; +import com.azure.resourcemanager.awsconnector.models.FileFormat; +import com.azure.resourcemanager.awsconnector.models.LogDestinationType; +import com.azure.resourcemanager.awsconnector.models.ResourceType; +import com.azure.resourcemanager.awsconnector.models.TagAutoGenerated10; +import com.azure.resourcemanager.awsconnector.models.TrafficType; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for Ec2FlowLogs CreateOrReplace. + */ +public final class Ec2FlowLogsCreateOrReplaceSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * Ec2FlowLogs_CreateOrReplace.json + */ + /** + * Sample code: Ec2FlowLogs_CreateOrReplace. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void ec2FlowLogsCreateOrReplace(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.ec2FlowLogs() + .define("Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])") + .withRegion("iheortzyczwfplyjuuqwhdtpscn") + .withExistingResourceGroup("rgec2FlowLog") + .withTags(mapOf("key8783", "fakeTokenPlaceholder")) + .withProperties(new Ec2FlowLogProperties() + .withAwsProperties(new AwsEc2FlowLogProperties().withDeliverCrossAccountRole("upu") + .withDeliverLogsPermissionArn("sfhmarwniuptmkaegsplmsozsmc") + .withDestinationOptions(new DestinationOptionsModelProperties().withFileFormat(FileFormat.PARQUET) + .withHiveCompatiblePartitions(true) + .withPerHourPartition(true)) + .withId("idflwxdxpu") + .withLogDestination("ztqhcrirplxmgncvubutyzqefvd") + .withLogDestinationType(LogDestinationType.CLOUD_WATCH_LOGS) + .withLogFormat("miqwrkvqyq") + .withLogGroupName("gptervjekilsbzqokcmrbumaie") + .withMaxAggregationInterval(15) + .withResourceId("mokmavuqvq") + .withResourceType(ResourceType.fromString("NetworkInterface")) + .withTags(Arrays.asList(new TagAutoGenerated10().withKey("fakeTokenPlaceholder") + .withValue("qdqsngozfinennzbilnzeemjzilpb"))) + .withTrafficType(TrafficType.ACCEPT)) + .withPublicCloudConnectorsResourceId("djh") + .withAwsAccountId("shsomlkgpjnxnonvrv") + .withArn("ilajcrcqxitnhyhorqitssmvsfwen") + .withPublicCloudResourceName("ymv") + .withAwsSourceSchema("pnjgqxqhnwhcs") + .withAwsRegion("stazvnpsmrpkoxyyzngdkkuif") + .withAwsTags(mapOf("key3000", "fakeTokenPlaceholder"))) + .create(); + } + + // Use "Map.of" if available + @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/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/Ec2FlowLogsDeleteSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/Ec2FlowLogsDeleteSamples.java new file mode 100644 index 000000000000..c6cf72b0516f --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/Ec2FlowLogsDeleteSamples.java @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +/** + * Samples for Ec2FlowLogs Delete. + */ +public final class Ec2FlowLogsDeleteSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/Ec2FlowLogs_Delete. + * json + */ + /** + * Sample code: Ec2FlowLogs_Delete. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void ec2FlowLogsDelete(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.ec2FlowLogs() + .delete("rgec2FlowLog", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/Ec2FlowLogsGetByResourceGroupSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/Ec2FlowLogsGetByResourceGroupSamples.java new file mode 100644 index 000000000000..0181a71bd897 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/Ec2FlowLogsGetByResourceGroupSamples.java @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +/** + * Samples for Ec2FlowLogs GetByResourceGroup. + */ +public final class Ec2FlowLogsGetByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/Ec2FlowLogs_Get. + * json + */ + /** + * Sample code: Ec2FlowLogs_Get. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void ec2FlowLogsGet(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.ec2FlowLogs() + .getByResourceGroupWithResponse("rgec2FlowLog", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/Ec2FlowLogsListByResourceGroupSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/Ec2FlowLogsListByResourceGroupSamples.java new file mode 100644 index 000000000000..3ed4e8f394bd --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/Ec2FlowLogsListByResourceGroupSamples.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +/** + * Samples for Ec2FlowLogs ListByResourceGroup. + */ +public final class Ec2FlowLogsListByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * Ec2FlowLogs_ListByResourceGroup.json + */ + /** + * Sample code: Ec2FlowLogs_ListByResourceGroup. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + ec2FlowLogsListByResourceGroup(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.ec2FlowLogs().listByResourceGroup("rgec2FlowLog", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/Ec2FlowLogsListSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/Ec2FlowLogsListSamples.java new file mode 100644 index 000000000000..0e80354d020a --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/Ec2FlowLogsListSamples.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +/** + * Samples for Ec2FlowLogs List. + */ +public final class Ec2FlowLogsListSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * Ec2FlowLogs_ListBySubscription.json + */ + /** + * Sample code: Ec2FlowLogs_ListBySubscription. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + ec2FlowLogsListBySubscription(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.ec2FlowLogs().list(com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/Ec2FlowLogsUpdateSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/Ec2FlowLogsUpdateSamples.java new file mode 100644 index 000000000000..caea783d85df --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/Ec2FlowLogsUpdateSamples.java @@ -0,0 +1,45 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +import com.azure.resourcemanager.awsconnector.models.Ec2FlowLog; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for Ec2FlowLogs Update. + */ +public final class Ec2FlowLogsUpdateSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/Ec2FlowLogs_Update. + * json + */ + /** + * Sample code: Ec2FlowLogs_Update. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void ec2FlowLogsUpdate(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + Ec2FlowLog resource = manager.ec2FlowLogs() + .getByResourceGroupWithResponse("rgec2FlowLog", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE) + .getValue(); + resource.update().withTags(mapOf("key6176", "fakeTokenPlaceholder")).apply(); + } + + // Use "Map.of" if available + @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/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/Ec2ImagesCreateOrReplaceSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/Ec2ImagesCreateOrReplaceSamples.java new file mode 100644 index 000000000000..6fdab055758f --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/Ec2ImagesCreateOrReplaceSamples.java @@ -0,0 +1,131 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +import com.azure.resourcemanager.awsconnector.models.ArchitectureValues; +import com.azure.resourcemanager.awsconnector.models.ArchitectureValuesEnumValue; +import com.azure.resourcemanager.awsconnector.models.AwsEc2ImageProperties; +import com.azure.resourcemanager.awsconnector.models.BlockDeviceMapping; +import com.azure.resourcemanager.awsconnector.models.BootModeValues; +import com.azure.resourcemanager.awsconnector.models.BootModeValuesEnumValue; +import com.azure.resourcemanager.awsconnector.models.DeviceType; +import com.azure.resourcemanager.awsconnector.models.DeviceTypeEnumValue; +import com.azure.resourcemanager.awsconnector.models.EbsBlockDevice; +import com.azure.resourcemanager.awsconnector.models.Ec2ImageProperties; +import com.azure.resourcemanager.awsconnector.models.HypervisorType; +import com.azure.resourcemanager.awsconnector.models.HypervisorTypeEnumValue; +import com.azure.resourcemanager.awsconnector.models.ImageState; +import com.azure.resourcemanager.awsconnector.models.ImageStateEnumValue; +import com.azure.resourcemanager.awsconnector.models.ImageTypeValues; +import com.azure.resourcemanager.awsconnector.models.ImageTypeValuesEnumValue; +import com.azure.resourcemanager.awsconnector.models.ImdsSupportValues; +import com.azure.resourcemanager.awsconnector.models.ImdsSupportValuesEnumValue; +import com.azure.resourcemanager.awsconnector.models.PlatformValues; +import com.azure.resourcemanager.awsconnector.models.PlatformValuesEnumValue; +import com.azure.resourcemanager.awsconnector.models.ProductCode; +import com.azure.resourcemanager.awsconnector.models.ProductCodeValues; +import com.azure.resourcemanager.awsconnector.models.ProductCodeValuesEnumValue; +import com.azure.resourcemanager.awsconnector.models.StateReason; +import com.azure.resourcemanager.awsconnector.models.TagAutoGenerated11; +import com.azure.resourcemanager.awsconnector.models.TpmSupportValues; +import com.azure.resourcemanager.awsconnector.models.TpmSupportValuesEnumValue; +import com.azure.resourcemanager.awsconnector.models.VirtualizationType; +import com.azure.resourcemanager.awsconnector.models.VirtualizationTypeEnumValue; +import com.azure.resourcemanager.awsconnector.models.VolumeType; +import com.azure.resourcemanager.awsconnector.models.VolumeTypeEnumValue; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for Ec2Images CreateOrReplace. + */ +public final class Ec2ImagesCreateOrReplaceSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * Ec2Images_CreateOrReplace.json + */ + /** + * Sample code: Ec2Images_CreateOrReplace. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void ec2ImagesCreateOrReplace(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.ec2Images() + .define("Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])") + .withRegion("rskzngterhbdzpdgzthkwkfsim") + .withExistingResourceGroup("rgec2Image") + .withTags(mapOf("key733", "fakeTokenPlaceholder")) + .withProperties(new Ec2ImageProperties() + .withAwsProperties(new AwsEc2ImageProperties() + .withArchitecture(new ArchitectureValuesEnumValue().withValue(ArchitectureValues.ARM64)) + .withBlockDeviceMappings(Arrays.asList(new BlockDeviceMapping().withDeviceName("foqeiqkjrwirhz") + .withEbs(new EbsBlockDevice().withDeleteOnTermination(true) + .withEncrypted(true) + .withIops(6) + .withKmsKeyId("fakeTokenPlaceholder") + .withOutpostArn("yzyqckzzbmbeimvwrvckybpdil") + .withSnapshotId("yjsctqicabclgsmtr") + .withThroughput(29) + .withVolumeSize(15) + .withVolumeType(new VolumeTypeEnumValue().withValue(VolumeType.GP2))) + .withNoDevice("rs") + .withVirtualName("lgrpmrjfdvrwmfghttgcdgqsfum"))) + .withBootMode(new BootModeValuesEnumValue().withValue(BootModeValues.LEGACY_BIOS)) + .withCreationDate("iri") + .withDeprecationTime("rjbfczermuljog") + .withDeregistrationProtection("qgzillhrsaoasehpuum") + .withDescription("xcucajel") + .withEnaSupport(true) + .withHypervisor(new HypervisorTypeEnumValue().withValue(HypervisorType.OVM)) + .withImageId("abwaglkivomqynfncjesal") + .withImageLocation("pgjapgkiakctxcpfpmvk") + .withImageOwnerAlias("sqvaqlxrlzhlzbczv") + .withImageType(new ImageTypeValuesEnumValue().withValue(ImageTypeValues.KERNEL)) + .withImdsSupport(new ImdsSupportValuesEnumValue().withValue(ImdsSupportValues.V2_0)) + .withKernelId("mfsmykrvrtbosarfpfuwahchz") + .withLastLaunchedTime("syfznkavvtio") + .withName("secemuogxgahtxnpthro") + .withOwnerId("nhuhifhzxvkdxxvaiaibzihkyvbrwh") + .withPlatform(new PlatformValuesEnumValue().withValue(PlatformValues.WINDOWS)) + .withPlatformDetails("lisborjwdvhfnwsziqhfnxiqdmdynp") + .withProductCodes(Arrays.asList(new ProductCode().withProductCodeId("fakeTokenPlaceholder") + .withProductCodeType(new ProductCodeValuesEnumValue().withValue(ProductCodeValues.DEVPAY)))) + .withPublicProperty(true) + .withRamdiskId("xrcwfszijxclkazpcletlaoca") + .withRootDeviceName("jjgzjpjxtlhvqyvdrnqelzasdmn") + .withRootDeviceType(new DeviceTypeEnumValue().withValue(DeviceType.EBS)) + .withSourceInstanceId("g") + .withSriovNetSupport("sbnokjesjjkngdixqtiijn") + .withState(new ImageStateEnumValue().withValue(ImageState.AVAILABLE)) + .withStateReason(new StateReason().withCode("fakeTokenPlaceholder").withMessage("qgjrouiqrxyqi")) + .withTags(Arrays.asList(new TagAutoGenerated11().withKey("fakeTokenPlaceholder") + .withValue("ehismpwetbakkwkjtngdrofhipjlko"))) + .withTpmSupport(new TpmSupportValuesEnumValue().withValue(TpmSupportValues.V2_0)) + .withUsageOperation("gdlrmqiw") + .withVirtualizationType(new VirtualizationTypeEnumValue().withValue(VirtualizationType.HVM))) + .withPublicCloudConnectorsResourceId("dth") + .withAwsAccountId("yvwtilsspffh") + .withArn("qaahwnaabcqlufiiwhkwhv") + .withPublicCloudResourceName("iwvkviywiipsmvxpemnivpyqwnp") + .withAwsSourceSchema("zpslskfplbejouiomrfkp") + .withAwsRegion("chnagdbgxpnwsklnknirzcmbyhif") + .withAwsTags(mapOf("key3097", "fakeTokenPlaceholder"))) + .create(); + } + + // Use "Map.of" if available + @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/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/Ec2ImagesDeleteSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/Ec2ImagesDeleteSamples.java new file mode 100644 index 000000000000..1d1d57b9deee --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/Ec2ImagesDeleteSamples.java @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +/** + * Samples for Ec2Images Delete. + */ +public final class Ec2ImagesDeleteSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/Ec2Images_Delete. + * json + */ + /** + * Sample code: Ec2Images_Delete. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void ec2ImagesDelete(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.ec2Images() + .delete("rgec2Image", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/Ec2ImagesGetByResourceGroupSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/Ec2ImagesGetByResourceGroupSamples.java new file mode 100644 index 000000000000..ac7e87f5fbd6 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/Ec2ImagesGetByResourceGroupSamples.java @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +/** + * Samples for Ec2Images GetByResourceGroup. + */ +public final class Ec2ImagesGetByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/Ec2Images_Get.json + */ + /** + * Sample code: Ec2Images_Get. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void ec2ImagesGet(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.ec2Images() + .getByResourceGroupWithResponse("rgec2Image", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/Ec2ImagesListByResourceGroupSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/Ec2ImagesListByResourceGroupSamples.java new file mode 100644 index 000000000000..2cbc79f1666e --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/Ec2ImagesListByResourceGroupSamples.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +/** + * Samples for Ec2Images ListByResourceGroup. + */ +public final class Ec2ImagesListByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * Ec2Images_ListByResourceGroup.json + */ + /** + * Sample code: Ec2Images_ListByResourceGroup. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + ec2ImagesListByResourceGroup(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.ec2Images().listByResourceGroup("rgec2Image", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/Ec2ImagesListSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/Ec2ImagesListSamples.java new file mode 100644 index 000000000000..7be0ece06eab --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/Ec2ImagesListSamples.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.awsconnector.generated; + +/** + * Samples for Ec2Images List. + */ +public final class Ec2ImagesListSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * Ec2Images_ListBySubscription.json + */ + /** + * Sample code: Ec2Images_ListBySubscription. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void ec2ImagesListBySubscription(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.ec2Images().list(com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/Ec2ImagesUpdateSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/Ec2ImagesUpdateSamples.java new file mode 100644 index 000000000000..ecd6b6af08ff --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/Ec2ImagesUpdateSamples.java @@ -0,0 +1,45 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +import com.azure.resourcemanager.awsconnector.models.Ec2Image; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for Ec2Images Update. + */ +public final class Ec2ImagesUpdateSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/Ec2Images_Update. + * json + */ + /** + * Sample code: Ec2Images_Update. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void ec2ImagesUpdate(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + Ec2Image resource = manager.ec2Images() + .getByResourceGroupWithResponse("rgec2Image", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE) + .getValue(); + resource.update().withTags(mapOf("key1684", "fakeTokenPlaceholder")).apply(); + } + + // Use "Map.of" if available + @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/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/Ec2InstanceStatusesCreateOrReplaceSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/Ec2InstanceStatusesCreateOrReplaceSamples.java new file mode 100644 index 000000000000..05b6710ef943 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/Ec2InstanceStatusesCreateOrReplaceSamples.java @@ -0,0 +1,96 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +import com.azure.resourcemanager.awsconnector.models.AwsEc2InstanceStatusProperties; +import com.azure.resourcemanager.awsconnector.models.Ec2InstanceStatusProperties; +import com.azure.resourcemanager.awsconnector.models.EventCode; +import com.azure.resourcemanager.awsconnector.models.EventCodeEnumValue; +import com.azure.resourcemanager.awsconnector.models.InstanceState; +import com.azure.resourcemanager.awsconnector.models.InstanceStateName; +import com.azure.resourcemanager.awsconnector.models.InstanceStateNameEnumValue; +import com.azure.resourcemanager.awsconnector.models.InstanceStatusDetails; +import com.azure.resourcemanager.awsconnector.models.InstanceStatusEvent; +import com.azure.resourcemanager.awsconnector.models.InstanceStatusSummary; +import com.azure.resourcemanager.awsconnector.models.StatusName; +import com.azure.resourcemanager.awsconnector.models.StatusNameEnumValue; +import com.azure.resourcemanager.awsconnector.models.StatusType; +import com.azure.resourcemanager.awsconnector.models.StatusTypeEnumValue; +import com.azure.resourcemanager.awsconnector.models.SummaryStatus; +import com.azure.resourcemanager.awsconnector.models.SummaryStatusEnumValue; +import java.time.OffsetDateTime; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for Ec2InstanceStatuses CreateOrReplace. + */ +public final class Ec2InstanceStatusesCreateOrReplaceSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * Ec2InstanceStatuses_CreateOrReplace.json + */ + /** + * Sample code: Ec2InstanceStatuses_CreateOrReplace. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + ec2InstanceStatusesCreateOrReplace(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.ec2InstanceStatuses() + .define("Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])") + .withRegion("pgcnqdiaetxhtdrimhlcwthap") + .withExistingResourceGroup("rgec2InstanceStatus") + .withTags(mapOf("key1363", "fakeTokenPlaceholder")) + .withProperties(new Ec2InstanceStatusProperties() + .withAwsProperties(new AwsEc2InstanceStatusProperties().withAvailabilityZone("ytnhdkisucgzas") + .withEvents(Arrays.asList(new InstanceStatusEvent() + .withCode(new EventCodeEnumValue().withValue(EventCode.INSTANCE_REBOOT)) + .withDescription("hgvqagwss") + .withInstanceEventId("rnbshnkjo") + .withNotAfter(OffsetDateTime.parse("2024-10-08T03:53:26.681Z")) + .withNotBefore(OffsetDateTime.parse("2024-10-08T03:53:26.681Z")) + .withNotBeforeDeadline(OffsetDateTime.parse("2024-10-08T03:53:26.681Z")))) + .withInstanceId("aoffpxifvwnouuzzpkqc") + .withInstanceState(new InstanceState() + .withCode(9) + .withName(new InstanceStateNameEnumValue().withValue(InstanceStateName.PENDING))) + .withInstanceStatus(new InstanceStatusSummary() + .withDetails(Arrays.asList(new InstanceStatusDetails() + .withImpairedSince(OffsetDateTime.parse("2024-10-08T03:53:26.682Z")) + .withName(new StatusNameEnumValue().withValue(StatusName.REACHABILITY)) + .withStatus(new StatusTypeEnumValue().withValue(StatusType.FAILED)))) + .withStatus(new SummaryStatusEnumValue().withValue(SummaryStatus.IMPAIRED))) + .withOutpostArn("pprqpuqeokryiz") + .withSystemStatus(new InstanceStatusSummary() + .withDetails(Arrays.asList(new InstanceStatusDetails() + .withImpairedSince(OffsetDateTime.parse("2024-10-08T03:53:26.682Z")) + .withName(new StatusNameEnumValue().withValue(StatusName.REACHABILITY)) + .withStatus(new StatusTypeEnumValue().withValue(StatusType.FAILED)))) + .withStatus(new SummaryStatusEnumValue().withValue(SummaryStatus.IMPAIRED)))) + .withPublicCloudConnectorsResourceId("ouhnawwxmqjpfsmz") + .withAwsAccountId("pjfvkzfpdqdiweudknutyey") + .withArn("nnkvtshcitbzvtrcwybizpxfznrsyg") + .withPublicCloudResourceName("mqygrsmavjlivhliidvrmopovsba") + .withAwsSourceSchema("zvcrlmc") + .withAwsRegion("uxchexljsahdlvcecpckwevokhvd") + .withAwsTags(mapOf("key8745", "fakeTokenPlaceholder"))) + .create(); + } + + // Use "Map.of" if available + @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/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/Ec2InstanceStatusesDeleteSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/Ec2InstanceStatusesDeleteSamples.java new file mode 100644 index 000000000000..7042f8c92fd1 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/Ec2InstanceStatusesDeleteSamples.java @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +/** + * Samples for Ec2InstanceStatuses Delete. + */ +public final class Ec2InstanceStatusesDeleteSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * Ec2InstanceStatuses_Delete.json + */ + /** + * Sample code: Ec2InstanceStatuses_Delete. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void ec2InstanceStatusesDelete(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.ec2InstanceStatuses() + .delete("rgec2InstanceStatus", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/Ec2InstanceStatusesGetByResourceGroupSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/Ec2InstanceStatusesGetByResourceGroupSamples.java new file mode 100644 index 000000000000..86fd884b74f5 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/Ec2InstanceStatusesGetByResourceGroupSamples.java @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +/** + * Samples for Ec2InstanceStatuses GetByResourceGroup. + */ +public final class Ec2InstanceStatusesGetByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * Ec2InstanceStatuses_Get.json + */ + /** + * Sample code: Ec2InstanceStatuses_Get. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void ec2InstanceStatusesGet(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.ec2InstanceStatuses() + .getByResourceGroupWithResponse("rgec2InstanceStatus", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/Ec2InstanceStatusesListByResourceGroupSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/Ec2InstanceStatusesListByResourceGroupSamples.java new file mode 100644 index 000000000000..efb206939101 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/Ec2InstanceStatusesListByResourceGroupSamples.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +/** + * Samples for Ec2InstanceStatuses ListByResourceGroup. + */ +public final class Ec2InstanceStatusesListByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * Ec2InstanceStatuses_ListByResourceGroup.json + */ + /** + * Sample code: Ec2InstanceStatuses_ListByResourceGroup. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + ec2InstanceStatusesListByResourceGroup(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.ec2InstanceStatuses().listByResourceGroup("rgec2InstanceStatus", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/Ec2InstanceStatusesListSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/Ec2InstanceStatusesListSamples.java new file mode 100644 index 000000000000..fd0525fdce36 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/Ec2InstanceStatusesListSamples.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +/** + * Samples for Ec2InstanceStatuses List. + */ +public final class Ec2InstanceStatusesListSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * Ec2InstanceStatuses_ListBySubscription.json + */ + /** + * Sample code: Ec2InstanceStatuses_ListBySubscription. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + ec2InstanceStatusesListBySubscription(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.ec2InstanceStatuses().list(com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/Ec2InstanceStatusesUpdateSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/Ec2InstanceStatusesUpdateSamples.java new file mode 100644 index 000000000000..e949c69eb34c --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/Ec2InstanceStatusesUpdateSamples.java @@ -0,0 +1,45 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +import com.azure.resourcemanager.awsconnector.models.Ec2InstanceStatus; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for Ec2InstanceStatuses Update. + */ +public final class Ec2InstanceStatusesUpdateSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * Ec2InstanceStatuses_Update.json + */ + /** + * Sample code: Ec2InstanceStatuses_Update. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void ec2InstanceStatusesUpdate(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + Ec2InstanceStatus resource = manager.ec2InstanceStatuses() + .getByResourceGroupWithResponse("rgec2InstanceStatus", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE) + .getValue(); + resource.update().withTags(mapOf("key3283", "fakeTokenPlaceholder")).apply(); + } + + // Use "Map.of" if available + @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/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/Ec2InstancesCreateOrReplaceSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/Ec2InstancesCreateOrReplaceSamples.java new file mode 100644 index 000000000000..5563cc847d30 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/Ec2InstancesCreateOrReplaceSamples.java @@ -0,0 +1,313 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +import com.azure.resourcemanager.awsconnector.fluent.models.Ec2InstanceInner; +import com.azure.resourcemanager.awsconnector.models.AmdSevSnpSpecification; +import com.azure.resourcemanager.awsconnector.models.AmdSevSnpSpecificationEnumValue; +import com.azure.resourcemanager.awsconnector.models.ArchitectureValues; +import com.azure.resourcemanager.awsconnector.models.ArchitectureValuesEnumValue; +import com.azure.resourcemanager.awsconnector.models.AttachmentStatus; +import com.azure.resourcemanager.awsconnector.models.AttachmentStatusEnumValue; +import com.azure.resourcemanager.awsconnector.models.AwsEc2InstanceProperties; +import com.azure.resourcemanager.awsconnector.models.BootModeValues; +import com.azure.resourcemanager.awsconnector.models.BootModeValuesEnumValue; +import com.azure.resourcemanager.awsconnector.models.CapacityReservationPreference; +import com.azure.resourcemanager.awsconnector.models.CapacityReservationPreferenceEnumValue; +import com.azure.resourcemanager.awsconnector.models.CapacityReservationSpecificationResponse; +import com.azure.resourcemanager.awsconnector.models.CapacityReservationTargetResponse; +import com.azure.resourcemanager.awsconnector.models.ConnectionTrackingSpecificationResponse; +import com.azure.resourcemanager.awsconnector.models.CpuOptions; +import com.azure.resourcemanager.awsconnector.models.DeviceType; +import com.azure.resourcemanager.awsconnector.models.DeviceTypeEnumValue; +import com.azure.resourcemanager.awsconnector.models.EbsInstanceBlockDevice; +import com.azure.resourcemanager.awsconnector.models.Ec2InstanceProperties; +import com.azure.resourcemanager.awsconnector.models.ElasticGpuAssociation; +import com.azure.resourcemanager.awsconnector.models.ElasticInferenceAcceleratorAssociation; +import com.azure.resourcemanager.awsconnector.models.EnclaveOptions; +import com.azure.resourcemanager.awsconnector.models.GroupIdentifier; +import com.azure.resourcemanager.awsconnector.models.HibernationOptions; +import com.azure.resourcemanager.awsconnector.models.HostnameType; +import com.azure.resourcemanager.awsconnector.models.HostnameTypeEnumValue; +import com.azure.resourcemanager.awsconnector.models.HttpTokensState; +import com.azure.resourcemanager.awsconnector.models.HttpTokensStateEnumValue; +import com.azure.resourcemanager.awsconnector.models.HypervisorType; +import com.azure.resourcemanager.awsconnector.models.HypervisorTypeEnumValue; +import com.azure.resourcemanager.awsconnector.models.IamInstanceProfile; +import com.azure.resourcemanager.awsconnector.models.InstanceAttachmentEnaSrdSpecification; +import com.azure.resourcemanager.awsconnector.models.InstanceAttachmentEnaSrdUdpSpecification; +import com.azure.resourcemanager.awsconnector.models.InstanceAutoRecoveryState; +import com.azure.resourcemanager.awsconnector.models.InstanceAutoRecoveryStateEnumValue; +import com.azure.resourcemanager.awsconnector.models.InstanceBlockDeviceMapping; +import com.azure.resourcemanager.awsconnector.models.InstanceBootModeValues; +import com.azure.resourcemanager.awsconnector.models.InstanceBootModeValuesEnumValue; +import com.azure.resourcemanager.awsconnector.models.InstanceIpv4Prefix; +import com.azure.resourcemanager.awsconnector.models.InstanceIpv6Address; +import com.azure.resourcemanager.awsconnector.models.InstanceIpv6Prefix; +import com.azure.resourcemanager.awsconnector.models.InstanceLifecycleType; +import com.azure.resourcemanager.awsconnector.models.InstanceLifecycleTypeEnumValue; +import com.azure.resourcemanager.awsconnector.models.InstanceMaintenanceOptions; +import com.azure.resourcemanager.awsconnector.models.InstanceMetadataEndpointState; +import com.azure.resourcemanager.awsconnector.models.InstanceMetadataEndpointStateEnumValue; +import com.azure.resourcemanager.awsconnector.models.InstanceMetadataOptionsResponse; +import com.azure.resourcemanager.awsconnector.models.InstanceMetadataOptionsState; +import com.azure.resourcemanager.awsconnector.models.InstanceMetadataOptionsStateEnumValue; +import com.azure.resourcemanager.awsconnector.models.InstanceMetadataProtocolState; +import com.azure.resourcemanager.awsconnector.models.InstanceMetadataProtocolStateEnumValue; +import com.azure.resourcemanager.awsconnector.models.InstanceMetadataTagsState; +import com.azure.resourcemanager.awsconnector.models.InstanceMetadataTagsStateEnumValue; +import com.azure.resourcemanager.awsconnector.models.InstanceNetworkInterface; +import com.azure.resourcemanager.awsconnector.models.InstanceNetworkInterfaceAssociation; +import com.azure.resourcemanager.awsconnector.models.InstanceNetworkInterfaceAttachment; +import com.azure.resourcemanager.awsconnector.models.InstancePrivateIpAddress; +import com.azure.resourcemanager.awsconnector.models.InstanceState; +import com.azure.resourcemanager.awsconnector.models.InstanceStateName; +import com.azure.resourcemanager.awsconnector.models.InstanceStateNameEnumValue; +import com.azure.resourcemanager.awsconnector.models.InstanceType; +import com.azure.resourcemanager.awsconnector.models.InstanceTypeEnumValue; +import com.azure.resourcemanager.awsconnector.models.LicenseConfiguration; +import com.azure.resourcemanager.awsconnector.models.Monitoring; +import com.azure.resourcemanager.awsconnector.models.MonitoringState; +import com.azure.resourcemanager.awsconnector.models.MonitoringStateEnumValue; +import com.azure.resourcemanager.awsconnector.models.NetworkInterfaceStatus; +import com.azure.resourcemanager.awsconnector.models.NetworkInterfaceStatusEnumValue; +import com.azure.resourcemanager.awsconnector.models.Placement; +import com.azure.resourcemanager.awsconnector.models.PlatformValues; +import com.azure.resourcemanager.awsconnector.models.PlatformValuesEnumValue; +import com.azure.resourcemanager.awsconnector.models.PrivateDnsNameOptionsResponse; +import com.azure.resourcemanager.awsconnector.models.ProductCode; +import com.azure.resourcemanager.awsconnector.models.ProductCodeValues; +import com.azure.resourcemanager.awsconnector.models.ProductCodeValuesEnumValue; +import com.azure.resourcemanager.awsconnector.models.StateReason; +import com.azure.resourcemanager.awsconnector.models.TagAutoGenerated12; +import com.azure.resourcemanager.awsconnector.models.Tenancy; +import com.azure.resourcemanager.awsconnector.models.TenancyEnumValue; +import com.azure.resourcemanager.awsconnector.models.VirtualizationType; +import com.azure.resourcemanager.awsconnector.models.VirtualizationTypeEnumValue; +import java.time.OffsetDateTime; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for Ec2Instances CreateOrReplace. + */ +public final class Ec2InstancesCreateOrReplaceSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * Ec2Instances_CreateOrReplace.json + */ + /** + * Sample code: Ec2Instances_CreateOrReplace. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void ec2InstancesCreateOrReplace(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.ec2Instances() + .createOrReplace("c", + new Ec2InstanceInner() + .withProperties( + new Ec2InstanceProperties() + .withAwsProperties(new AwsEc2InstanceProperties().withAmiLaunchIndex(27) + .withArchitecture(new ArchitectureValuesEnumValue().withValue(ArchitectureValues.ARM64)) + .withBlockDeviceMappings( + Arrays.asList(new InstanceBlockDeviceMapping().withDeviceName("tfaglaaaklzilxzmk") + .withEbs(new EbsInstanceBlockDevice() + .withAssociatedResource("pgkczdagxihtrkzzaiuzennp") + .withAttachTime(OffsetDateTime.parse("2024-10-08T03:49:10.616Z")) + .withDeleteOnTermination(true) + .withStatus( + new AttachmentStatusEnumValue().withValue(AttachmentStatus.ATTACHED)) + .withVolumeId("ilihhdgfhpylwqnaglcmj") + .withVolumeOwnerId("ruylzxnmlundujqdqkqocknldkttka")))) + .withBootMode(new BootModeValuesEnumValue().withValue(BootModeValues.LEGACY_BIOS)) + .withCapacityReservationId("rgxeywdieyjfmp") + .withCapacityReservationSpecification(new CapacityReservationSpecificationResponse() + .withCapacityReservationPreference(new CapacityReservationPreferenceEnumValue() + .withValue(CapacityReservationPreference.NONE)) + .withCapacityReservationTarget(new CapacityReservationTargetResponse() + .withCapacityReservationId("dvdusvbgjrkkuqrelloyysinnzpjb") + .withCapacityReservationResourceGroupArn("itnyqqrlujfkasgzbrvljlbh"))) + .withClientToken("fakeTokenPlaceholder") + .withCpuOptions(new CpuOptions() + .withAmdSevSnp(new AmdSevSnpSpecificationEnumValue() + .withValue(AmdSevSnpSpecification.DISABLED)) + .withCoreCount(27) + .withThreadsPerCore(11)) + .withCurrentInstanceBootMode( + new InstanceBootModeValuesEnumValue().withValue(InstanceBootModeValues.LEGACY_BIOS)) + .withEbsOptimized(true) + .withElasticGpuAssociations(Arrays.asList( + new ElasticGpuAssociation().withElasticGpuAssociationId("jmxqiqiyocefwrivbcumzx") + .withElasticGpuAssociationState("mkteimwlzs") + .withElasticGpuAssociationTime("sosasrnqg") + .withElasticGpuId("dnpmhib"))) + .withElasticInferenceAcceleratorAssociations( + Arrays.asList(new ElasticInferenceAcceleratorAssociation() + .withElasticInferenceAcceleratorArn("pnbrdzuzjxuwrtpdc") + .withElasticInferenceAcceleratorAssociationId("uoout") + .withElasticInferenceAcceleratorAssociationState("bwbmjkusisjrxxdonwtxkbgbaxk") + .withElasticInferenceAcceleratorAssociationTime( + OffsetDateTime.parse("2024-10-08T03:49:10.617Z")))) + .withEnaSupport(true) + .withEnclaveOptions(new EnclaveOptions().withEnabled(true)) + .withHibernationOptions(new HibernationOptions().withConfigured(true)) + .withHypervisor(new HypervisorTypeEnumValue().withValue(HypervisorType.OVM)) + .withIamInstanceProfile( + new IamInstanceProfile().withArn("jvju").withId("kdzthqdiqjcknesajpbplmkynzokr")) + .withImageId("oemhjwhbzkbcwocprtn") + .withInstanceId("czyyyovcqwce") + .withInstanceLifecycle(new InstanceLifecycleTypeEnumValue() + .withValue(InstanceLifecycleType.CAPACITY_BLOCK)) + .withInstanceType(new InstanceTypeEnumValue().withValue(InstanceType.A1_2XLARGE)) + .withIpv6Address("kuzwkpvttqtjxowkisga") + .withKernelId("qqehgoolsvuh") + .withKeyName("fakeTokenPlaceholder") + .withLaunchTime(OffsetDateTime.parse("2024-10-08T03:49:10.618Z")) + .withLicenses( + Arrays.asList(new LicenseConfiguration().withLicenseConfigurationArn("q"))) + .withMaintenanceOptions(new InstanceMaintenanceOptions() + .withAutoRecovery(new InstanceAutoRecoveryStateEnumValue() + .withValue(InstanceAutoRecoveryState.DEFAULT))) + .withMetadataOptions(new InstanceMetadataOptionsResponse() + .withHttpEndpoint(new InstanceMetadataEndpointStateEnumValue() + .withValue(InstanceMetadataEndpointState.DISABLED)) + .withHttpProtocolIpv6(new InstanceMetadataProtocolStateEnumValue() + .withValue(InstanceMetadataProtocolState.DISABLED)) + .withHttpPutResponseHopLimit(3) + .withHttpTokens(new HttpTokensStateEnumValue().withValue(HttpTokensState.OPTIONAL)) + .withInstanceMetadataTags(new InstanceMetadataTagsStateEnumValue() + .withValue(InstanceMetadataTagsState.DISABLED)) + .withState(new InstanceMetadataOptionsStateEnumValue() + .withValue(InstanceMetadataOptionsState.APPLIED))) + .withMonitoring(new Monitoring() + .withState(new MonitoringStateEnumValue().withValue(MonitoringState.DISABLED))) + .withNetworkInterfaces( + Arrays.asList(new InstanceNetworkInterface() + .withAssociation(new InstanceNetworkInterfaceAssociation() + .withCarrierIp("gyqfkluecfuwebntnygczb") + .withCustomerOwnedIp("sw") + .withIpOwnerId("fbrkixipyqjnao") + .withPublicDnsName("oivnzjavxqmctzvhgmsavgwesabny") + .withPublicIp("tojjymqqjmschjp")) + .withAttachment( + new InstanceNetworkInterfaceAttachment() + .withAttachTime(OffsetDateTime.parse("2024-10-08T03:49:10.618Z")) + .withAttachmentId("lsqnlzd") + .withDeleteOnTermination(true) + .withDeviceIndex(11) + .withEnaSrdSpecification( + new InstanceAttachmentEnaSrdSpecification().withEnaSrdEnabled(true) + .withEnaSrdUdpSpecification( + new InstanceAttachmentEnaSrdUdpSpecification() + .withEnaSrdUdpEnabled(true))) + .withNetworkCardIndex(9) + .withStatus(new AttachmentStatusEnumValue() + .withValue(AttachmentStatus.ATTACHED))) + .withConnectionTrackingConfiguration( + new ConnectionTrackingSpecificationResponse().withTcpEstablishedTimeout(23) + .withUdpStreamTimeout(24) + .withUdpTimeout(30)) + .withDescription("wcdguczvqhelvbuhnx") + .withGroups(Arrays + .asList(new GroupIdentifier().withGroupId("nwupmxpxrzdroizfewqupyddewi") + .withGroupName("gvsaaqihzfcwdmeocclatfqm"))) + .withInterfaceType("mphomintds") + .withIpv4Prefixes( + Arrays.asList(new InstanceIpv4Prefix().withIpv4Prefix("ortyghjrffqjz"))) + .withIpv6Addresses(Arrays.asList( + new InstanceIpv6Address().withIpv6Address("z").withIsPrimaryIpv6(true))) + .withIpv6Prefixes(Arrays + .asList(new InstanceIpv6Prefix().withIpv6Prefix("cstrptdpvmberviuvuqfd"))) + .withMacAddress("k") + .withNetworkInterfaceId("qythf") + .withOwnerId("fvjysbetbyrzccspcenkpvi") + .withPrivateDnsName("yvorusnuuigavdcqqdxecrkmjmhrf") + .withPrivateIpAddress("m") + .withPrivateIpAddresses(Arrays.asList(new InstancePrivateIpAddress() + .withAssociation(new InstanceNetworkInterfaceAssociation() + .withCarrierIp("gyqfkluecfuwebntnygczb") + .withCustomerOwnedIp("sw") + .withIpOwnerId("fbrkixipyqjnao") + .withPublicDnsName("oivnzjavxqmctzvhgmsavgwesabny") + .withPublicIp("tojjymqqjmschjp")) + .withPrimary(true) + .withPrivateDnsName("bdezhkhwoerivtfwgqelrsyiphf") + .withPrivateIpAddress("xcqnyrs"))) + .withSourceDestCheck(true) + .withStatus(new NetworkInterfaceStatusEnumValue() + .withValue(NetworkInterfaceStatus.ASSOCIATED)) + .withSubnetId("euocsemlw") + .withVpcId("grahbrhjelkewder"))) + .withOutpostArn("godjddxeidxe") + .withPlacement(new Placement().withAffinity("xzseileq") + .withAvailabilityZone("vsfvyosolmnchbavxfvtizqptgmeg") + .withGroupId("davwvkjoij") + .withGroupName("txqgn") + .withHostId("mvbshbhxclztfwffsu") + .withHostResourceGroupArn("zl") + .withPartitionNumber(24) + .withSpreadDomain("t") + .withTenancy(new TenancyEnumValue().withValue(Tenancy.DEDICATED))) + .withPlatform(new PlatformValuesEnumValue().withValue(PlatformValues.WINDOWS)) + .withPlatformDetails("rcwqyqgcruqjcvzcto") + .withPrivateDnsName("ieuhntvllhoojakokyt") + .withPrivateDnsNameOptions( + new PrivateDnsNameOptionsResponse().withEnableResourceNameDnsAaaaRecord(true) + .withEnableResourceNameDnsARecord(true) + .withHostnameType(new HostnameTypeEnumValue().withValue(HostnameType.IP_NAME))) + .withPrivateIpAddress("uosximzwwopktgyzlathmorgqah") + .withProductCodes( + Arrays.asList(new ProductCode().withProductCodeId("fakeTokenPlaceholder") + .withProductCodeType( + new ProductCodeValuesEnumValue().withValue(ProductCodeValues.DEVPAY)))) + .withPublicDnsName("qkucqmeldgiumuzribitahwft") + .withPublicIpAddress("ialohsszgtpuycimtqi") + .withRamdiskId("ggkfkl") + .withRootDeviceName("dbfwarbazrbzcjnh") + .withRootDeviceType(new DeviceTypeEnumValue().withValue(DeviceType.EBS)) + .withSecurityGroups( + Arrays.asList(new GroupIdentifier().withGroupId("nwupmxpxrzdroizfewqupyddewi") + .withGroupName("gvsaaqihzfcwdmeocclatfqm"))) + .withSourceDestCheck(true) + .withSpotInstanceRequestId("qiylxsuuinwyq") + .withSriovNetSupport("kiffwvajczdtzwcfeefqespn") + .withState(new InstanceState().withCode(18) + .withName(new InstanceStateNameEnumValue().withValue(InstanceStateName.PENDING))) + .withStateReason( + new StateReason().withCode("fakeTokenPlaceholder").withMessage("dvgendvpuuzx")) + .withStateTransitionReason("arenmfmnvv") + .withSubnetId("mgnibedayjllwaidbjh") + .withTags(Arrays.asList(new TagAutoGenerated12().withKey("fakeTokenPlaceholder") + .withValue("zztbwjxzwgmnjqhegktznmdrqferd"))) + .withTpmSupport("fvxtckturm") + .withUsageOperation("xrctwrcgpcrhlfjzhdvhiovdlcqafq") + .withUsageOperationUpdateTime(OffsetDateTime.parse("2024-10-08T03:49:10.619Z")) + .withVirtualizationType( + new VirtualizationTypeEnumValue().withValue(VirtualizationType.HVM)) + .withVpcId("g")) + .withPublicCloudConnectorsResourceId("shnvqmmslrarjuzdpyhlnfxxp") + .withAwsAccountId("hhrjjrfopsrebnklxmr") + .withArn("noxwkahrsrcnrpz") + .withPublicCloudResourceName("sffqiavopmcwltotrpubudq") + .withAwsSourceSchema("tncjfmwlkponefezhigbyno") + .withAwsRegion("tcaqttnhykcej") + .withAwsTags(mapOf("key2934", "fakeTokenPlaceholder"))), + com.azure.core.util.Context.NONE); + } + + // Use "Map.of" if available + @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/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/Ec2InstancesDeleteSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/Ec2InstancesDeleteSamples.java new file mode 100644 index 000000000000..719c462a6cb8 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/Ec2InstancesDeleteSamples.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.awsconnector.generated; + +/** + * Samples for Ec2Instances Delete. + */ +public final class Ec2InstancesDeleteSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/Ec2Instances_Delete + * .json + */ + /** + * Sample code: Ec2Instances_Delete. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void ec2InstancesDelete(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.ec2Instances().delete("c", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/Ec2InstancesGetSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/Ec2InstancesGetSamples.java new file mode 100644 index 000000000000..7af8539aabba --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/Ec2InstancesGetSamples.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.awsconnector.generated; + +/** + * Samples for Ec2Instances Get. + */ +public final class Ec2InstancesGetSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/Ec2Instances_Get. + * json + */ + /** + * Sample code: Ec2Instances_Get. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void ec2InstancesGet(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.ec2Instances().getWithResponse("c", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/Ec2InstancesListSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/Ec2InstancesListSamples.java new file mode 100644 index 000000000000..5345c0a71595 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/Ec2InstancesListSamples.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.awsconnector.generated; + +/** + * Samples for Ec2Instances List. + */ +public final class Ec2InstancesListSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/Ec2Instances_List. + * json + */ + /** + * Sample code: Ec2Instances_List. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void ec2InstancesList(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.ec2Instances().list("c", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/Ec2InstancesStartSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/Ec2InstancesStartSamples.java new file mode 100644 index 000000000000..969c053d1e00 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/Ec2InstancesStartSamples.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.awsconnector.generated; + +/** + * Samples for Ec2Instances Start. + */ +public final class Ec2InstancesStartSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/Ec2Instances_Start. + * json + */ + /** + * Sample code: Ec2Instances_Start. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void ec2InstancesStart(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.ec2Instances().start("c", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/Ec2InstancesStopSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/Ec2InstancesStopSamples.java new file mode 100644 index 000000000000..402d9a8d67cd --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/Ec2InstancesStopSamples.java @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +import com.azure.resourcemanager.awsconnector.models.StopEc2InstanceOptions; + +/** + * Samples for Ec2Instances Stop. + */ +public final class Ec2InstancesStopSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/Ec2Instances_Stop. + * json + */ + /** + * Sample code: Ec2Instances_Stop. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void ec2InstancesStop(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.ec2Instances() + .stop("c", new StopEc2InstanceOptions().withForce(true).withHibernate(true), + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/Ec2IpamsCreateOrReplaceSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/Ec2IpamsCreateOrReplaceSamples.java new file mode 100644 index 000000000000..6caf9de56478 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/Ec2IpamsCreateOrReplaceSamples.java @@ -0,0 +1,79 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +import com.azure.resourcemanager.awsconnector.models.AwsEc2IpamProperties; +import com.azure.resourcemanager.awsconnector.models.Ec2IpamProperties; +import com.azure.resourcemanager.awsconnector.models.IpamOperatingRegion; +import com.azure.resourcemanager.awsconnector.models.IpamState; +import com.azure.resourcemanager.awsconnector.models.IpamStateEnumValue; +import com.azure.resourcemanager.awsconnector.models.IpamTier; +import com.azure.resourcemanager.awsconnector.models.IpamTierEnumValue; +import com.azure.resourcemanager.awsconnector.models.TagAutoGenerated13; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for Ec2Ipams CreateOrReplace. + */ +public final class Ec2IpamsCreateOrReplaceSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * Ec2Ipams_CreateOrReplace.json + */ + /** + * Sample code: Ec2Ipams_CreateOrReplace. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void ec2IpamsCreateOrReplace(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.ec2Ipams() + .define("Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])") + .withRegion("lhjepajysvu") + .withExistingResourceGroup("rgec2Ipam") + .withTags(mapOf("key6845", "fakeTokenPlaceholder")) + .withProperties(new Ec2IpamProperties() + .withAwsProperties( + new AwsEc2IpamProperties().withDefaultResourceDiscoveryAssociationId("upvbhujajpxidvdneaxudp") + .withDefaultResourceDiscoveryId("vmatfdwggwysxz") + .withDescription("suxncf") + .withIpamArn("ounjgxqwlmalbxgwqepaivhpqm") + .withIpamId("baiefjd") + .withIpamRegion("dfdcpbefpcajoep") + .withOperatingRegions(Arrays.asList(new IpamOperatingRegion().withRegionName("racqmjs"))) + .withOwnerId("sbcvakmustluzumdv") + .withPrivateDefaultScopeId("sgytzjkrmsnzccmbos") + .withPublicDefaultScopeId("uqxvzoqzwfiaerfqkufw") + .withResourceDiscoveryAssociationCount(28) + .withScopeCount(8) + .withState(new IpamStateEnumValue().withValue(IpamState.CREATE_COMPLETE)) + .withStateMessage("wehaarwg") + .withTags(Arrays.asList( + new TagAutoGenerated13().withKey("fakeTokenPlaceholder").withValue("jnzubqdwmuxxyakaosx"))) + .withTier(new IpamTierEnumValue().withValue(IpamTier.ADVANCED))) + .withPublicCloudConnectorsResourceId("irfihvsxrgyhmubmuieufe") + .withAwsAccountId("fyceaucatzscmtkaw") + .withArn("gcjcnzkmoauyi") + .withPublicCloudResourceName("y") + .withAwsSourceSchema("ivdglskrjwzg") + .withAwsRegion("rvtevmqvjnnignaaojkgqgzrsi") + .withAwsTags(mapOf("key4146", "fakeTokenPlaceholder"))) + .create(); + } + + // Use "Map.of" if available + @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/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/Ec2IpamsDeleteSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/Ec2IpamsDeleteSamples.java new file mode 100644 index 000000000000..a8ce4f6cf010 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/Ec2IpamsDeleteSamples.java @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +/** + * Samples for Ec2Ipams Delete. + */ +public final class Ec2IpamsDeleteSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/Ec2Ipams_Delete. + * json + */ + /** + * Sample code: Ec2Ipams_Delete. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void ec2IpamsDelete(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.ec2Ipams() + .delete("rgec2Ipam", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/Ec2IpamsGetByResourceGroupSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/Ec2IpamsGetByResourceGroupSamples.java new file mode 100644 index 000000000000..0c6a7d61fc64 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/Ec2IpamsGetByResourceGroupSamples.java @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +/** + * Samples for Ec2Ipams GetByResourceGroup. + */ +public final class Ec2IpamsGetByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/Ec2Ipams_Get.json + */ + /** + * Sample code: Ec2Ipams_Get. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void ec2IpamsGet(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.ec2Ipams() + .getByResourceGroupWithResponse("rgec2Ipam", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/Ec2IpamsListByResourceGroupSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/Ec2IpamsListByResourceGroupSamples.java new file mode 100644 index 000000000000..49573dac60c0 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/Ec2IpamsListByResourceGroupSamples.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.awsconnector.generated; + +/** + * Samples for Ec2Ipams ListByResourceGroup. + */ +public final class Ec2IpamsListByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * Ec2Ipams_ListByResourceGroup.json + */ + /** + * Sample code: Ec2Ipams_ListByResourceGroup. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void ec2IpamsListByResourceGroup(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.ec2Ipams().listByResourceGroup("rgec2Ipam", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/Ec2IpamsListSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/Ec2IpamsListSamples.java new file mode 100644 index 000000000000..0ac9de4c4bea --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/Ec2IpamsListSamples.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.awsconnector.generated; + +/** + * Samples for Ec2Ipams List. + */ +public final class Ec2IpamsListSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * Ec2Ipams_ListBySubscription.json + */ + /** + * Sample code: Ec2Ipams_ListBySubscription. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void ec2IpamsListBySubscription(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.ec2Ipams().list(com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/Ec2IpamsUpdateSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/Ec2IpamsUpdateSamples.java new file mode 100644 index 000000000000..3f368c706fae --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/Ec2IpamsUpdateSamples.java @@ -0,0 +1,45 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +import com.azure.resourcemanager.awsconnector.models.Ec2Ipam; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for Ec2Ipams Update. + */ +public final class Ec2IpamsUpdateSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/Ec2Ipams_Update. + * json + */ + /** + * Sample code: Ec2Ipams_Update. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void ec2IpamsUpdate(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + Ec2Ipam resource = manager.ec2Ipams() + .getByResourceGroupWithResponse("rgec2Ipam", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE) + .getValue(); + resource.update().withTags(mapOf("key1619", "fakeTokenPlaceholder")).apply(); + } + + // Use "Map.of" if available + @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/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/Ec2KeyPairsCreateOrReplaceSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/Ec2KeyPairsCreateOrReplaceSamples.java new file mode 100644 index 000000000000..964a139a080c --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/Ec2KeyPairsCreateOrReplaceSamples.java @@ -0,0 +1,67 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +import com.azure.resourcemanager.awsconnector.models.AwsEc2KeyPairProperties; +import com.azure.resourcemanager.awsconnector.models.Ec2KeyPairProperties; +import com.azure.resourcemanager.awsconnector.models.KeyFormat; +import com.azure.resourcemanager.awsconnector.models.KeyType; +import com.azure.resourcemanager.awsconnector.models.TagAutoGenerated14; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for Ec2KeyPairs CreateOrReplace. + */ +public final class Ec2KeyPairsCreateOrReplaceSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * Ec2KeyPairs_CreateOrReplace.json + */ + /** + * Sample code: Ec2KeyPairs_CreateOrReplace. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void ec2KeyPairsCreateOrReplace(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.ec2KeyPairs() + .define("Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])") + .withRegion("okgykmqgdqfktczzwnisgblxjor") + .withExistingResourceGroup("rgec2KeyPair") + .withTags(mapOf("key7076", "fakeTokenPlaceholder")) + .withProperties( + new Ec2KeyPairProperties() + .withAwsProperties(new AwsEc2KeyPairProperties().withKeyFingerprint("fakeTokenPlaceholder") + .withKeyFormat(KeyFormat.PEM) + .withKeyName("fakeTokenPlaceholder") + .withKeyPairId("fakeTokenPlaceholder") + .withKeyType(KeyType.ED25519) + .withPublicKeyMaterial("fakeTokenPlaceholder") + .withTags(Arrays.asList(new TagAutoGenerated14().withKey("fakeTokenPlaceholder") + .withValue("fcqkvmxnvgkszsjglbmc")))) + .withPublicCloudConnectorsResourceId("dtqfffijdvwrjascztihbhcjfo") + .withAwsAccountId("iamyich") + .withArn("hbplblilwwscgwiaifygy") + .withPublicCloudResourceName("nyywppatxodspls") + .withAwsSourceSchema("qbl") + .withAwsRegion("zkxhveyqnzcmihgmancphtwumisld") + .withAwsTags(mapOf("key6629", "fakeTokenPlaceholder"))) + .create(); + } + + // Use "Map.of" if available + @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/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/Ec2KeyPairsDeleteSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/Ec2KeyPairsDeleteSamples.java new file mode 100644 index 000000000000..c71e4c4fa55a --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/Ec2KeyPairsDeleteSamples.java @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +/** + * Samples for Ec2KeyPairs Delete. + */ +public final class Ec2KeyPairsDeleteSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/Ec2KeyPairs_Delete. + * json + */ + /** + * Sample code: Ec2KeyPairs_Delete. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void ec2KeyPairsDelete(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.ec2KeyPairs() + .delete("rgec2KeyPair", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/Ec2KeyPairsGetByResourceGroupSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/Ec2KeyPairsGetByResourceGroupSamples.java new file mode 100644 index 000000000000..9a15ffd1d207 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/Ec2KeyPairsGetByResourceGroupSamples.java @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +/** + * Samples for Ec2KeyPairs GetByResourceGroup. + */ +public final class Ec2KeyPairsGetByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/Ec2KeyPairs_Get. + * json + */ + /** + * Sample code: Ec2KeyPairs_Get. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void ec2KeyPairsGet(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.ec2KeyPairs() + .getByResourceGroupWithResponse("rgec2KeyPair", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/Ec2KeyPairsListByResourceGroupSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/Ec2KeyPairsListByResourceGroupSamples.java new file mode 100644 index 000000000000..8838b3074c95 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/Ec2KeyPairsListByResourceGroupSamples.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +/** + * Samples for Ec2KeyPairs ListByResourceGroup. + */ +public final class Ec2KeyPairsListByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * Ec2KeyPairs_ListByResourceGroup.json + */ + /** + * Sample code: Ec2KeyPairs_ListByResourceGroup. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + ec2KeyPairsListByResourceGroup(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.ec2KeyPairs().listByResourceGroup("rgec2KeyPair", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/Ec2KeyPairsListSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/Ec2KeyPairsListSamples.java new file mode 100644 index 000000000000..c1284e9e8cd9 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/Ec2KeyPairsListSamples.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +/** + * Samples for Ec2KeyPairs List. + */ +public final class Ec2KeyPairsListSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * Ec2KeyPairs_ListBySubscription.json + */ + /** + * Sample code: Ec2KeyPairs_ListBySubscription. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + ec2KeyPairsListBySubscription(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.ec2KeyPairs().list(com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/Ec2KeyPairsUpdateSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/Ec2KeyPairsUpdateSamples.java new file mode 100644 index 000000000000..26ede0545f40 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/Ec2KeyPairsUpdateSamples.java @@ -0,0 +1,45 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +import com.azure.resourcemanager.awsconnector.models.Ec2KeyPair; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for Ec2KeyPairs Update. + */ +public final class Ec2KeyPairsUpdateSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/Ec2KeyPairs_Update. + * json + */ + /** + * Sample code: Ec2KeyPairs_Update. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void ec2KeyPairsUpdate(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + Ec2KeyPair resource = manager.ec2KeyPairs() + .getByResourceGroupWithResponse("rgec2KeyPair", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE) + .getValue(); + resource.update().withTags(mapOf("key7068", "fakeTokenPlaceholder")).apply(); + } + + // Use "Map.of" if available + @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/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/Ec2NetworkAclsCreateOrReplaceSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/Ec2NetworkAclsCreateOrReplaceSamples.java new file mode 100644 index 000000000000..8dd7b901ef6c --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/Ec2NetworkAclsCreateOrReplaceSamples.java @@ -0,0 +1,62 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +import com.azure.resourcemanager.awsconnector.models.AwsEc2NetworkAclProperties; +import com.azure.resourcemanager.awsconnector.models.Ec2NetworkAclProperties; +import com.azure.resourcemanager.awsconnector.models.TagAutoGenerated15; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for Ec2NetworkAcls CreateOrReplace. + */ +public final class Ec2NetworkAclsCreateOrReplaceSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * Ec2NetworkAcls_CreateOrReplace.json + */ + /** + * Sample code: Ec2NetworkAcls_CreateOrReplace. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + ec2NetworkAclsCreateOrReplace(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.ec2NetworkAcls() + .define("Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])") + .withRegion("fshtit") + .withExistingResourceGroup("rgec2NetworkAcl") + .withTags(mapOf("key7602", "fakeTokenPlaceholder")) + .withProperties( + new Ec2NetworkAclProperties() + .withAwsProperties(new AwsEc2NetworkAclProperties().withId("qgxcaonshnjzgtrwpbtgtnec") + .withTags(Arrays.asList( + new TagAutoGenerated15().withKey("fakeTokenPlaceholder").withValue("szjckvzlsvasj"))) + .withVpcId("wifperjiuulltgxcljqwnaeyscd")) + .withPublicCloudConnectorsResourceId("thejbzeletryigazixejsz") + .withAwsAccountId("nwnjrjumgvvtfndyaxyiwbugmdk") + .withArn("mwwchyidvtcm") + .withPublicCloudResourceName("dniirwtrtuvjlcdcjq") + .withAwsSourceSchema("hqiutsyaxzitfwtekhw") + .withAwsRegion("zmntebskjciytwfcjyj") + .withAwsTags(mapOf("key8049", "fakeTokenPlaceholder"))) + .create(); + } + + // Use "Map.of" if available + @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/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/Ec2NetworkAclsDeleteSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/Ec2NetworkAclsDeleteSamples.java new file mode 100644 index 000000000000..13404bd245af --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/Ec2NetworkAclsDeleteSamples.java @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +/** + * Samples for Ec2NetworkAcls Delete. + */ +public final class Ec2NetworkAclsDeleteSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * Ec2NetworkAcls_Delete.json + */ + /** + * Sample code: Ec2NetworkAcls_Delete. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void ec2NetworkAclsDelete(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.ec2NetworkAcls() + .delete("rgec2NetworkAcl", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/Ec2NetworkAclsGetByResourceGroupSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/Ec2NetworkAclsGetByResourceGroupSamples.java new file mode 100644 index 000000000000..d7d03a800eb8 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/Ec2NetworkAclsGetByResourceGroupSamples.java @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +/** + * Samples for Ec2NetworkAcls GetByResourceGroup. + */ +public final class Ec2NetworkAclsGetByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/Ec2NetworkAcls_Get. + * json + */ + /** + * Sample code: Ec2NetworkAcls_Get. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void ec2NetworkAclsGet(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.ec2NetworkAcls() + .getByResourceGroupWithResponse("rgec2NetworkAcl", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/Ec2NetworkAclsListByResourceGroupSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/Ec2NetworkAclsListByResourceGroupSamples.java new file mode 100644 index 000000000000..a3f0822fa673 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/Ec2NetworkAclsListByResourceGroupSamples.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +/** + * Samples for Ec2NetworkAcls ListByResourceGroup. + */ +public final class Ec2NetworkAclsListByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * Ec2NetworkAcls_ListByResourceGroup.json + */ + /** + * Sample code: Ec2NetworkAcls_ListByResourceGroup. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + ec2NetworkAclsListByResourceGroup(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.ec2NetworkAcls().listByResourceGroup("rgec2NetworkAcl", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/Ec2NetworkAclsListSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/Ec2NetworkAclsListSamples.java new file mode 100644 index 000000000000..663b907a71bd --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/Ec2NetworkAclsListSamples.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +/** + * Samples for Ec2NetworkAcls List. + */ +public final class Ec2NetworkAclsListSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * Ec2NetworkAcls_ListBySubscription.json + */ + /** + * Sample code: Ec2NetworkAcls_ListBySubscription. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + ec2NetworkAclsListBySubscription(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.ec2NetworkAcls().list(com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/Ec2NetworkAclsUpdateSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/Ec2NetworkAclsUpdateSamples.java new file mode 100644 index 000000000000..585396ae1f03 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/Ec2NetworkAclsUpdateSamples.java @@ -0,0 +1,45 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +import com.azure.resourcemanager.awsconnector.models.Ec2NetworkAcl; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for Ec2NetworkAcls Update. + */ +public final class Ec2NetworkAclsUpdateSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * Ec2NetworkAcls_Update.json + */ + /** + * Sample code: Ec2NetworkAcls_Update. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void ec2NetworkAclsUpdate(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + Ec2NetworkAcl resource = manager.ec2NetworkAcls() + .getByResourceGroupWithResponse("rgec2NetworkAcl", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE) + .getValue(); + resource.update().withTags(mapOf("key5032", "fakeTokenPlaceholder")).apply(); + } + + // Use "Map.of" if available + @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/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/Ec2NetworkInterfacesCreateOrReplaceSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/Ec2NetworkInterfacesCreateOrReplaceSamples.java new file mode 100644 index 000000000000..2f68a37cadf8 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/Ec2NetworkInterfacesCreateOrReplaceSamples.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.awsconnector.generated; + +import com.azure.resourcemanager.awsconnector.models.AwsEc2NetworkInterfaceProperties; +import com.azure.resourcemanager.awsconnector.models.ConnectionTrackingSpecification; +import com.azure.resourcemanager.awsconnector.models.Ec2NetworkInterfaceProperties; +import com.azure.resourcemanager.awsconnector.models.InstanceIpv6AddressAutoGenerated; +import com.azure.resourcemanager.awsconnector.models.Ipv4PrefixSpecification; +import com.azure.resourcemanager.awsconnector.models.Ipv6PrefixSpecification; +import com.azure.resourcemanager.awsconnector.models.PrivateIpAddressSpecification; +import com.azure.resourcemanager.awsconnector.models.TagAutoGenerated16; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for Ec2NetworkInterfaces CreateOrReplace. + */ +public final class Ec2NetworkInterfacesCreateOrReplaceSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * Ec2NetworkInterfaces_CreateOrReplace.json + */ + /** + * Sample code: Ec2NetworkInterfaces_CreateOrReplace. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + ec2NetworkInterfacesCreateOrReplace(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.ec2NetworkInterfaces() + .define("Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])") + .withRegion("lagtstrmaffl") + .withExistingResourceGroup("rgec2NetworkInterface") + .withTags(mapOf("key2520", "fakeTokenPlaceholder")) + .withProperties(new Ec2NetworkInterfaceProperties() + .withAwsProperties(new AwsEc2NetworkInterfaceProperties() + .withConnectionTrackingSpecification( + new ConnectionTrackingSpecification().withTcpEstablishedTimeout(17) + .withUdpStreamTimeout(8) + .withUdpTimeout(23)) + .withDescription("rjfmatpnlpzafpjsvdifepkeompzpz") + .withEnablePrimaryIpv6(true) + .withGroupSet(Arrays.asList("dqnxzfzzixpqqapipgobuepnptfi")) + .withId("djkpriel") + .withInterfaceType("osohhzoujznxwq") + .withIpv4PrefixCount(18) + .withIpv4Prefixes(Arrays.asList(new Ipv4PrefixSpecification().withIpv4Prefix("gptczjajfvxavzpalq"))) + .withIpv6AddressCount(21) + .withIpv6Addresses( + Arrays.asList(new InstanceIpv6AddressAutoGenerated().withIpv6Address("yltzjtkgfhbhokimzn"))) + .withIpv6PrefixCount(1) + .withIpv6Prefixes( + Arrays.asList(new Ipv6PrefixSpecification().withIpv6Prefix("srpldhvaafcozyarpechevrnxlf"))) + .withPrimaryIpv6Address("uoblo") + .withPrimaryPrivateIpAddress("qyowqxftdeptwmjwfa") + .withPrivateIpAddress("qicwhumw") + .withPrivateIpAddresses(Arrays.asList(new PrivateIpAddressSpecification().withPrimary(true) + .withPrivateIpAddress("mmkedmvsclcwfvlvx"))) + .withSecondaryPrivateIpAddressCount(9) + .withSecondaryPrivateIpAddresses(Arrays.asList("mkvwjalereuiy")) + .withSourceDestCheck(true) + .withSubnetId("wfyytldstgkdpoffxak") + .withTags(Arrays + .asList(new TagAutoGenerated16().withKey("fakeTokenPlaceholder").withValue("zlzzwcqgyuoe"))) + .withVpcId("ykqkegxxhqsw")) + .withPublicCloudConnectorsResourceId("ottcocnvajfifabmlw") + .withAwsAccountId("gjylibjqfzkkx") + .withArn("nmgqcimbhzksweqtns") + .withPublicCloudResourceName("pjjwxtuejzskysxlytlrcqegfkuydf") + .withAwsSourceSchema("smaakwcpvp") + .withAwsRegion("dpghaxzupmkfwbvir") + .withAwsTags(mapOf("key190", "fakeTokenPlaceholder"))) + .create(); + } + + // Use "Map.of" if available + @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/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/Ec2NetworkInterfacesDeleteSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/Ec2NetworkInterfacesDeleteSamples.java new file mode 100644 index 000000000000..3620a36c8777 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/Ec2NetworkInterfacesDeleteSamples.java @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +/** + * Samples for Ec2NetworkInterfaces Delete. + */ +public final class Ec2NetworkInterfacesDeleteSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * Ec2NetworkInterfaces_Delete.json + */ + /** + * Sample code: Ec2NetworkInterfaces_Delete. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void ec2NetworkInterfacesDelete(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.ec2NetworkInterfaces() + .delete("rgec2NetworkInterface", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/Ec2NetworkInterfacesGetByResourceGroupSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/Ec2NetworkInterfacesGetByResourceGroupSamples.java new file mode 100644 index 000000000000..24931e4548ea --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/Ec2NetworkInterfacesGetByResourceGroupSamples.java @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +/** + * Samples for Ec2NetworkInterfaces GetByResourceGroup. + */ +public final class Ec2NetworkInterfacesGetByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * Ec2NetworkInterfaces_Get.json + */ + /** + * Sample code: Ec2NetworkInterfaces_Get. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void ec2NetworkInterfacesGet(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.ec2NetworkInterfaces() + .getByResourceGroupWithResponse("rgec2NetworkInterface", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/Ec2NetworkInterfacesListByResourceGroupSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/Ec2NetworkInterfacesListByResourceGroupSamples.java new file mode 100644 index 000000000000..b5a7228e1ab7 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/Ec2NetworkInterfacesListByResourceGroupSamples.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +/** + * Samples for Ec2NetworkInterfaces ListByResourceGroup. + */ +public final class Ec2NetworkInterfacesListByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * Ec2NetworkInterfaces_ListByResourceGroup.json + */ + /** + * Sample code: Ec2NetworkInterfaces_ListByResourceGroup. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + ec2NetworkInterfacesListByResourceGroup(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.ec2NetworkInterfaces().listByResourceGroup("rgec2NetworkInterface", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/Ec2NetworkInterfacesListSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/Ec2NetworkInterfacesListSamples.java new file mode 100644 index 000000000000..770f662666ed --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/Ec2NetworkInterfacesListSamples.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +/** + * Samples for Ec2NetworkInterfaces List. + */ +public final class Ec2NetworkInterfacesListSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * Ec2NetworkInterfaces_ListBySubscription.json + */ + /** + * Sample code: Ec2NetworkInterfaces_ListBySubscription. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + ec2NetworkInterfacesListBySubscription(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.ec2NetworkInterfaces().list(com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/Ec2NetworkInterfacesUpdateSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/Ec2NetworkInterfacesUpdateSamples.java new file mode 100644 index 000000000000..5e112746ef3e --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/Ec2NetworkInterfacesUpdateSamples.java @@ -0,0 +1,45 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +import com.azure.resourcemanager.awsconnector.models.Ec2NetworkInterface; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for Ec2NetworkInterfaces Update. + */ +public final class Ec2NetworkInterfacesUpdateSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * Ec2NetworkInterfaces_Update.json + */ + /** + * Sample code: Ec2NetworkInterfaces_Update. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void ec2NetworkInterfacesUpdate(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + Ec2NetworkInterface resource = manager.ec2NetworkInterfaces() + .getByResourceGroupWithResponse("rgec2NetworkInterface", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE) + .getValue(); + resource.update().withTags(mapOf("key6326", "fakeTokenPlaceholder")).apply(); + } + + // Use "Map.of" if available + @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/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/Ec2RouteTablesCreateOrReplaceSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/Ec2RouteTablesCreateOrReplaceSamples.java new file mode 100644 index 000000000000..1cd181bb0065 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/Ec2RouteTablesCreateOrReplaceSamples.java @@ -0,0 +1,61 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +import com.azure.resourcemanager.awsconnector.models.AwsEc2RouteTableProperties; +import com.azure.resourcemanager.awsconnector.models.Ec2RouteTableProperties; +import com.azure.resourcemanager.awsconnector.models.TagAutoGenerated17; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for Ec2RouteTables CreateOrReplace. + */ +public final class Ec2RouteTablesCreateOrReplaceSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * Ec2RouteTables_CreateOrReplace.json + */ + /** + * Sample code: Ec2RouteTables_CreateOrReplace. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + ec2RouteTablesCreateOrReplace(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.ec2RouteTables() + .define("Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])") + .withRegion("hovrzjhgmyvotekfhnhfmvlcak") + .withExistingResourceGroup("rgec2RouteTable") + .withTags(mapOf("key8794", "fakeTokenPlaceholder")) + .withProperties(new Ec2RouteTableProperties() + .withAwsProperties(new AwsEc2RouteTableProperties().withRouteTableId("wjkircnwaktkmbnrmuglladvcdghmn") + .withTags(Arrays.asList(new TagAutoGenerated17().withKey("fakeTokenPlaceholder") + .withValue("ywbmagghbowtrgxkmnquatuohxj"))) + .withVpcId("ndnaspemjnmztnyriemuybzp")) + .withPublicCloudConnectorsResourceId("kaqsj") + .withAwsAccountId("xlalfcqnhp") + .withArn("eyazamslrmbbffijotyuugdepfsn") + .withPublicCloudResourceName("ierypwmwselkslavwkgcmz") + .withAwsSourceSchema("usgtqolcmcjynbdhavnneb") + .withAwsRegion("tmqwjtpadpygxhke") + .withAwsTags(mapOf("key7743", "fakeTokenPlaceholder"))) + .create(); + } + + // Use "Map.of" if available + @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/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/Ec2RouteTablesDeleteSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/Ec2RouteTablesDeleteSamples.java new file mode 100644 index 000000000000..bc9f91c58c07 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/Ec2RouteTablesDeleteSamples.java @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +/** + * Samples for Ec2RouteTables Delete. + */ +public final class Ec2RouteTablesDeleteSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * Ec2RouteTables_Delete.json + */ + /** + * Sample code: Ec2RouteTables_Delete. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void ec2RouteTablesDelete(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.ec2RouteTables() + .delete("rgec2RouteTable", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/Ec2RouteTablesGetByResourceGroupSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/Ec2RouteTablesGetByResourceGroupSamples.java new file mode 100644 index 000000000000..aa88d0ad2623 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/Ec2RouteTablesGetByResourceGroupSamples.java @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +/** + * Samples for Ec2RouteTables GetByResourceGroup. + */ +public final class Ec2RouteTablesGetByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/Ec2RouteTables_Get. + * json + */ + /** + * Sample code: Ec2RouteTables_Get. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void ec2RouteTablesGet(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.ec2RouteTables() + .getByResourceGroupWithResponse("rgec2RouteTable", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/Ec2RouteTablesListByResourceGroupSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/Ec2RouteTablesListByResourceGroupSamples.java new file mode 100644 index 000000000000..7a09742b246e --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/Ec2RouteTablesListByResourceGroupSamples.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +/** + * Samples for Ec2RouteTables ListByResourceGroup. + */ +public final class Ec2RouteTablesListByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * Ec2RouteTables_ListByResourceGroup.json + */ + /** + * Sample code: Ec2RouteTables_ListByResourceGroup. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + ec2RouteTablesListByResourceGroup(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.ec2RouteTables().listByResourceGroup("rgec2RouteTable", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/Ec2RouteTablesListSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/Ec2RouteTablesListSamples.java new file mode 100644 index 000000000000..523e72e02418 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/Ec2RouteTablesListSamples.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +/** + * Samples for Ec2RouteTables List. + */ +public final class Ec2RouteTablesListSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * Ec2RouteTables_ListBySubscription.json + */ + /** + * Sample code: Ec2RouteTables_ListBySubscription. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + ec2RouteTablesListBySubscription(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.ec2RouteTables().list(com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/Ec2RouteTablesUpdateSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/Ec2RouteTablesUpdateSamples.java new file mode 100644 index 000000000000..8094b94037c4 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/Ec2RouteTablesUpdateSamples.java @@ -0,0 +1,45 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +import com.azure.resourcemanager.awsconnector.models.Ec2RouteTable; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for Ec2RouteTables Update. + */ +public final class Ec2RouteTablesUpdateSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * Ec2RouteTables_Update.json + */ + /** + * Sample code: Ec2RouteTables_Update. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void ec2RouteTablesUpdate(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + Ec2RouteTable resource = manager.ec2RouteTables() + .getByResourceGroupWithResponse("rgec2RouteTable", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE) + .getValue(); + resource.update().withTags(mapOf("key9656", "fakeTokenPlaceholder")).apply(); + } + + // Use "Map.of" if available + @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/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/Ec2SecurityGroupsCreateOrReplaceSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/Ec2SecurityGroupsCreateOrReplaceSamples.java new file mode 100644 index 000000000000..c87c4fae120f --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/Ec2SecurityGroupsCreateOrReplaceSamples.java @@ -0,0 +1,102 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +import com.azure.resourcemanager.awsconnector.models.AwsEc2SecurityGroupProperties; +import com.azure.resourcemanager.awsconnector.models.Ec2SecurityGroupProperties; +import com.azure.resourcemanager.awsconnector.models.IpPermission; +import com.azure.resourcemanager.awsconnector.models.IpRange; +import com.azure.resourcemanager.awsconnector.models.Ipv6Range; +import com.azure.resourcemanager.awsconnector.models.PrefixListId; +import com.azure.resourcemanager.awsconnector.models.TagAutoGenerated18; +import com.azure.resourcemanager.awsconnector.models.UserIdGroupPair; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for Ec2SecurityGroups CreateOrReplace. + */ +public final class Ec2SecurityGroupsCreateOrReplaceSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * Ec2SecurityGroups_CreateOrReplace.json + */ + /** + * Sample code: Ec2SecurityGroups_CreateOrReplace. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + ec2SecurityGroupsCreateOrReplace(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.ec2SecurityGroups() + .define("Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])") + .withRegion("vzuwiygrafixnatwfk") + .withExistingResourceGroup("rgec2SecurityGroup") + .withTags(mapOf("key9265", "fakeTokenPlaceholder")) + .withProperties(new Ec2SecurityGroupProperties() + .withAwsProperties(new AwsEc2SecurityGroupProperties().withDescription("hrrgskumwbylhgekdhngxjvwdnwt") + .withGroupId("ljankmjnfyn") + .withGroupName("btdfjlqbavbhlssltk") + .withIpPermissions(Arrays.asList(new IpPermission().withFromPort(20) + .withIpProtocol("kgjdillfenc") + .withIpRanges(Arrays.asList(new IpRange().withCidrIp("bvmbvmljqvxtixhffwasjzntbuc") + .withDescription("shzjegnqjhifwjai"))) + .withIpv6Ranges(Arrays.asList( + new Ipv6Range().withCidrIpv6("uxlvmqqyfplqdqzolxmmnclvmtd").withDescription("iqaupyjrvko"))) + .withPrefixListIds(Arrays.asList(new PrefixListId().withDescription("chukmrsgeaica") + .withPrefixListId("abvyhxeqhgiuwfmdproas"))) + .withToPort(22) + .withUserIdGroupPairs( + Arrays.asList(new UserIdGroupPair().withDescription("ltskpjkztpi") + .withGroupId("laktgsfwgfj") + .withGroupName("rrnebynwgsv") + .withPeeringStatus("t") + .withUserId("chhl") + .withVpcId("jxcofqkxxcehakoymxojgpra") + .withVpcPeeringConnectionId("vdqrycsnfuwkgftprwierfwv"))))) + .withIpPermissionsEgress(Arrays.asList(new IpPermission().withFromPort(20) + .withIpProtocol("kgjdillfenc") + .withIpRanges(Arrays.asList(new IpRange().withCidrIp("bvmbvmljqvxtixhffwasjzntbuc") + .withDescription("shzjegnqjhifwjai"))) + .withIpv6Ranges(Arrays.asList( + new Ipv6Range().withCidrIpv6("uxlvmqqyfplqdqzolxmmnclvmtd").withDescription("iqaupyjrvko"))) + .withPrefixListIds(Arrays.asList(new PrefixListId().withDescription("chukmrsgeaica") + .withPrefixListId("abvyhxeqhgiuwfmdproas"))) + .withToPort(22) + .withUserIdGroupPairs(Arrays.asList(new UserIdGroupPair().withDescription("ltskpjkztpi") + .withGroupId("laktgsfwgfj") + .withGroupName("rrnebynwgsv") + .withPeeringStatus("t") + .withUserId("chhl") + .withVpcId("jxcofqkxxcehakoymxojgpra") + .withVpcPeeringConnectionId("vdqrycsnfuwkgftprwierfwv"))))) + .withOwnerId("zjetpuydwcwvcujxzfp") + .withTags( + Arrays.asList(new TagAutoGenerated18().withKey("fakeTokenPlaceholder").withValue("jflpondfk"))) + .withVpcId("prgpmjbyqcuinimbjrzfmpmme")) + .withPublicCloudConnectorsResourceId("fuzo") + .withAwsAccountId("opjbipitrztwvqiwhvypn") + .withArn("wmn") + .withPublicCloudResourceName("laxwpziyjookzz") + .withAwsSourceSchema("qdcuf") + .withAwsRegion("hqrasnkghl") + .withAwsTags(mapOf("key5646", "fakeTokenPlaceholder"))) + .create(); + } + + // Use "Map.of" if available + @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/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/Ec2SecurityGroupsDeleteSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/Ec2SecurityGroupsDeleteSamples.java new file mode 100644 index 000000000000..69a8307292d9 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/Ec2SecurityGroupsDeleteSamples.java @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +/** + * Samples for Ec2SecurityGroups Delete. + */ +public final class Ec2SecurityGroupsDeleteSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * Ec2SecurityGroups_Delete.json + */ + /** + * Sample code: Ec2SecurityGroups_Delete. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void ec2SecurityGroupsDelete(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.ec2SecurityGroups() + .delete("rgec2SecurityGroup", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/Ec2SecurityGroupsGetByResourceGroupSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/Ec2SecurityGroupsGetByResourceGroupSamples.java new file mode 100644 index 000000000000..1d1545b42c43 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/Ec2SecurityGroupsGetByResourceGroupSamples.java @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +/** + * Samples for Ec2SecurityGroups GetByResourceGroup. + */ +public final class Ec2SecurityGroupsGetByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * Ec2SecurityGroups_Get.json + */ + /** + * Sample code: Ec2SecurityGroups_Get. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void ec2SecurityGroupsGet(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.ec2SecurityGroups() + .getByResourceGroupWithResponse("rgec2SecurityGroup", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/Ec2SecurityGroupsListByResourceGroupSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/Ec2SecurityGroupsListByResourceGroupSamples.java new file mode 100644 index 000000000000..eaba5f45964c --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/Ec2SecurityGroupsListByResourceGroupSamples.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +/** + * Samples for Ec2SecurityGroups ListByResourceGroup. + */ +public final class Ec2SecurityGroupsListByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * Ec2SecurityGroups_ListByResourceGroup.json + */ + /** + * Sample code: Ec2SecurityGroups_ListByResourceGroup. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + ec2SecurityGroupsListByResourceGroup(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.ec2SecurityGroups().listByResourceGroup("rgec2SecurityGroup", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/Ec2SecurityGroupsListSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/Ec2SecurityGroupsListSamples.java new file mode 100644 index 000000000000..00e360600909 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/Ec2SecurityGroupsListSamples.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +/** + * Samples for Ec2SecurityGroups List. + */ +public final class Ec2SecurityGroupsListSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * Ec2SecurityGroups_ListBySubscription.json + */ + /** + * Sample code: Ec2SecurityGroups_ListBySubscription. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + ec2SecurityGroupsListBySubscription(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.ec2SecurityGroups().list(com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/Ec2SecurityGroupsUpdateSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/Ec2SecurityGroupsUpdateSamples.java new file mode 100644 index 000000000000..4cdddac83460 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/Ec2SecurityGroupsUpdateSamples.java @@ -0,0 +1,45 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +import com.azure.resourcemanager.awsconnector.models.Ec2SecurityGroup; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for Ec2SecurityGroups Update. + */ +public final class Ec2SecurityGroupsUpdateSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * Ec2SecurityGroups_Update.json + */ + /** + * Sample code: Ec2SecurityGroups_Update. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void ec2SecurityGroupsUpdate(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + Ec2SecurityGroup resource = manager.ec2SecurityGroups() + .getByResourceGroupWithResponse("rgec2SecurityGroup", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE) + .getValue(); + resource.update().withTags(mapOf("key3161", "fakeTokenPlaceholder")).apply(); + } + + // Use "Map.of" if available + @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/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/Ec2SnapshotsCreateOrReplaceSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/Ec2SnapshotsCreateOrReplaceSamples.java new file mode 100644 index 000000000000..66a43a8ce2f1 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/Ec2SnapshotsCreateOrReplaceSamples.java @@ -0,0 +1,83 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +import com.azure.resourcemanager.awsconnector.models.AwsEc2SnapshotProperties; +import com.azure.resourcemanager.awsconnector.models.Ec2SnapshotProperties; +import com.azure.resourcemanager.awsconnector.models.SnapshotState; +import com.azure.resourcemanager.awsconnector.models.SnapshotStateEnumValue; +import com.azure.resourcemanager.awsconnector.models.SseType; +import com.azure.resourcemanager.awsconnector.models.SseTypeEnumValue; +import com.azure.resourcemanager.awsconnector.models.StorageTier; +import com.azure.resourcemanager.awsconnector.models.StorageTierEnumValue; +import com.azure.resourcemanager.awsconnector.models.TagAutoGenerated19; +import java.time.OffsetDateTime; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for Ec2Snapshots CreateOrReplace. + */ +public final class Ec2SnapshotsCreateOrReplaceSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * Ec2Snapshots_CreateOrReplace.json + */ + /** + * Sample code: Ec2Snapshots_CreateOrReplace. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void ec2SnapshotsCreateOrReplace(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.ec2Snapshots() + .define("Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])") + .withRegion("kqbtvnmdasfajwylafmkah") + .withExistingResourceGroup("rgec2Snapshot") + .withTags(mapOf("key9392", "fakeTokenPlaceholder")) + .withProperties( + new Ec2SnapshotProperties() + .withAwsProperties(new AwsEc2SnapshotProperties().withDataEncryptionKeyId("fakeTokenPlaceholder") + .withDescription("tsduasxksmdr") + .withEncrypted(true) + .withKmsKeyId("fakeTokenPlaceholder") + .withOutpostArn("vpqkamzadulbg") + .withOwnerAlias("bmfwdqpzxg") + .withOwnerId("xudlgprkedlmxatpupwvaknlkxfs") + .withProgress("ecdblvtjkixoklgjh") + .withRestoreExpiryTime(OffsetDateTime.parse("2024-10-08T03:53:51.251Z")) + .withSnapshotId("lpcr") + .withSseType(new SseTypeEnumValue().withValue(SseType.NONE)) + .withStartTime(OffsetDateTime.parse("2024-10-08T03:53:51.251Z")) + .withState(new SnapshotStateEnumValue().withValue(SnapshotState.COMPLETED)) + .withStateMessage("nogwovxkgpjylsijzipkpqzxpvjh") + .withStorageTier(new StorageTierEnumValue().withValue(StorageTier.ARCHIVE)) + .withTags( + Arrays.asList(new TagAutoGenerated19().withKey("fakeTokenPlaceholder").withValue("vjhh"))) + .withVolumeId("rzepawgzsvqncqbpjxnijhwofbgc") + .withVolumeSize(3)) + .withPublicCloudConnectorsResourceId("bfcselosmakgrkibu") + .withAwsAccountId("iizqmtavivxapbfqrqqrauezng") + .withArn("z") + .withPublicCloudResourceName("eyltdaumfqmdgmnlwpgjhjlavikc") + .withAwsSourceSchema("gmzpssyyjoqqnqjxwcluwnyrswywcv") + .withAwsRegion("yylufbdgujuqmqwhscnglwsa") + .withAwsTags(mapOf("key9124", "fakeTokenPlaceholder"))) + .create(); + } + + // Use "Map.of" if available + @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/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/Ec2SnapshotsDeleteSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/Ec2SnapshotsDeleteSamples.java new file mode 100644 index 000000000000..f912e3cb0272 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/Ec2SnapshotsDeleteSamples.java @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +/** + * Samples for Ec2Snapshots Delete. + */ +public final class Ec2SnapshotsDeleteSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/Ec2Snapshots_Delete + * .json + */ + /** + * Sample code: Ec2Snapshots_Delete. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void ec2SnapshotsDelete(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.ec2Snapshots() + .delete("rgec2Snapshot", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/Ec2SnapshotsGetByResourceGroupSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/Ec2SnapshotsGetByResourceGroupSamples.java new file mode 100644 index 000000000000..ed6a7faa50de --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/Ec2SnapshotsGetByResourceGroupSamples.java @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +/** + * Samples for Ec2Snapshots GetByResourceGroup. + */ +public final class Ec2SnapshotsGetByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/Ec2Snapshots_Get. + * json + */ + /** + * Sample code: Ec2Snapshots_Get. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void ec2SnapshotsGet(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.ec2Snapshots() + .getByResourceGroupWithResponse("rgec2Snapshot", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/Ec2SnapshotsListByResourceGroupSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/Ec2SnapshotsListByResourceGroupSamples.java new file mode 100644 index 000000000000..4bf05d4d3cc0 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/Ec2SnapshotsListByResourceGroupSamples.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +/** + * Samples for Ec2Snapshots ListByResourceGroup. + */ +public final class Ec2SnapshotsListByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * Ec2Snapshots_ListByResourceGroup.json + */ + /** + * Sample code: Ec2Snapshots_ListByResourceGroup. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + ec2SnapshotsListByResourceGroup(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.ec2Snapshots().listByResourceGroup("rgec2Snapshot", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/Ec2SnapshotsListSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/Ec2SnapshotsListSamples.java new file mode 100644 index 000000000000..df44f47b8cc4 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/Ec2SnapshotsListSamples.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +/** + * Samples for Ec2Snapshots List. + */ +public final class Ec2SnapshotsListSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * Ec2Snapshots_ListBySubscription.json + */ + /** + * Sample code: Ec2Snapshots_ListBySubscription. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + ec2SnapshotsListBySubscription(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.ec2Snapshots().list(com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/Ec2SnapshotsUpdateSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/Ec2SnapshotsUpdateSamples.java new file mode 100644 index 000000000000..00263ddfefa6 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/Ec2SnapshotsUpdateSamples.java @@ -0,0 +1,45 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +import com.azure.resourcemanager.awsconnector.models.Ec2Snapshot; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for Ec2Snapshots Update. + */ +public final class Ec2SnapshotsUpdateSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/Ec2Snapshots_Update + * .json + */ + /** + * Sample code: Ec2Snapshots_Update. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void ec2SnapshotsUpdate(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + Ec2Snapshot resource = manager.ec2Snapshots() + .getByResourceGroupWithResponse("rgec2Snapshot", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE) + .getValue(); + resource.update().withTags(mapOf("key9290", "fakeTokenPlaceholder")).apply(); + } + + // Use "Map.of" if available + @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/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/Ec2SubnetsCreateOrReplaceSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/Ec2SubnetsCreateOrReplaceSamples.java new file mode 100644 index 000000000000..bf5edadece6b --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/Ec2SubnetsCreateOrReplaceSamples.java @@ -0,0 +1,83 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +import com.azure.resourcemanager.awsconnector.models.AwsEc2SubnetProperties; +import com.azure.resourcemanager.awsconnector.models.Ec2SubnetProperties; +import com.azure.resourcemanager.awsconnector.models.PrivateDnsNameOptionsOnLaunchModelProperties; +import com.azure.resourcemanager.awsconnector.models.TagAutoGenerated20; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for Ec2Subnets CreateOrReplace. + */ +public final class Ec2SubnetsCreateOrReplaceSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * Ec2Subnets_CreateOrReplace.json + */ + /** + * Sample code: Ec2Subnets_CreateOrReplace. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void ec2SubnetsCreateOrReplace(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.ec2Subnets() + .define("Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])") + .withRegion("zlyeymkfsbtninhfrnvrhxprr") + .withExistingResourceGroup("rgec2Subnet") + .withTags(mapOf("key8525", "fakeTokenPlaceholder")) + .withProperties( + new Ec2SubnetProperties() + .withAwsProperties( + new AwsEc2SubnetProperties().withAssignIpv6AddressOnCreation(true) + .withAvailabilityZone("forrknmiozum") + .withAvailabilityZoneId("gbjfdurjqxgejgwo") + .withCidrBlock("sisksglodnipqskrsfsvkpcrrcy") + .withEnableDns64(true) + .withEnableLniAtDeviceIndex(1) + .withIpv4IpamPoolId("jdpbqiv") + .withIpv4NetmaskLength(18) + .withIpv6CidrBlock("ayzvyvftxekjogtumuln") + .withIpv6CidrBlocks(Arrays.asList("amuwewdpaadfixhakcdaqrjzlskguz")) + .withIpv6IpamPoolId("lenenhwtwwet") + .withIpv6Native(true) + .withIpv6NetmaskLength(16) + .withMapPublicIpOnLaunch(true) + .withNetworkAclAssociationId("saevhbbbzksuojanmdoizrhyxo") + .withOutpostArn("qzuvnwxqc") + .withPrivateDnsNameOptionsOnLaunch(new PrivateDnsNameOptionsOnLaunchModelProperties() + .withEnableResourceNameDnsAaaaRecord(true) + .withEnableResourceNameDnsARecord(true) + .withHostnameType("cbuc")) + .withSubnetId("vxxbkvimjzmcfoxur") + .withTags(Arrays.asList(new TagAutoGenerated20().withKey("fakeTokenPlaceholder") + .withValue("bfgzdnenxrviyueqzftrrvu"))) + .withVpcId("aqqzsoyvmaxfyqddvthvxlhdti")) + .withPublicCloudConnectorsResourceId("svkjfvphtfxopebxrcdvwyj") + .withAwsAccountId("mmlzefobqbimxcbqwrkitlgfu") + .withArn("swrduvxfquidiycxlrijjixfbwb") + .withPublicCloudResourceName("p") + .withAwsSourceSchema("wyjdcprcwjbw") + .withAwsRegion("huifdbndfvqyztfwfclpqlxupzib") + .withAwsTags(mapOf("key3667", "fakeTokenPlaceholder"))) + .create(); + } + + // Use "Map.of" if available + @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/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/Ec2SubnetsDeleteSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/Ec2SubnetsDeleteSamples.java new file mode 100644 index 000000000000..fbcd34c90e78 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/Ec2SubnetsDeleteSamples.java @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +/** + * Samples for Ec2Subnets Delete. + */ +public final class Ec2SubnetsDeleteSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/Ec2Subnets_Delete. + * json + */ + /** + * Sample code: Ec2Subnets_Delete. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void ec2SubnetsDelete(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.ec2Subnets() + .delete("rgec2Subnet", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/Ec2SubnetsGetByResourceGroupSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/Ec2SubnetsGetByResourceGroupSamples.java new file mode 100644 index 000000000000..393c32ce0751 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/Ec2SubnetsGetByResourceGroupSamples.java @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +/** + * Samples for Ec2Subnets GetByResourceGroup. + */ +public final class Ec2SubnetsGetByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/Ec2Subnets_Get.json + */ + /** + * Sample code: Ec2Subnets_Get. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void ec2SubnetsGet(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.ec2Subnets() + .getByResourceGroupWithResponse("rgec2Subnet", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/Ec2SubnetsListByResourceGroupSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/Ec2SubnetsListByResourceGroupSamples.java new file mode 100644 index 000000000000..45fdb192585c --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/Ec2SubnetsListByResourceGroupSamples.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +/** + * Samples for Ec2Subnets ListByResourceGroup. + */ +public final class Ec2SubnetsListByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * Ec2Subnets_ListByResourceGroup.json + */ + /** + * Sample code: Ec2Subnets_ListByResourceGroup. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + ec2SubnetsListByResourceGroup(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.ec2Subnets().listByResourceGroup("rgec2Subnet", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/Ec2SubnetsListSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/Ec2SubnetsListSamples.java new file mode 100644 index 000000000000..e192185e30a5 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/Ec2SubnetsListSamples.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +/** + * Samples for Ec2Subnets List. + */ +public final class Ec2SubnetsListSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * Ec2Subnets_ListBySubscription.json + */ + /** + * Sample code: Ec2Subnets_ListBySubscription. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + ec2SubnetsListBySubscription(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.ec2Subnets().list(com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/Ec2SubnetsUpdateSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/Ec2SubnetsUpdateSamples.java new file mode 100644 index 000000000000..d73a5b1904e0 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/Ec2SubnetsUpdateSamples.java @@ -0,0 +1,45 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +import com.azure.resourcemanager.awsconnector.models.Ec2Subnet; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for Ec2Subnets Update. + */ +public final class Ec2SubnetsUpdateSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/Ec2Subnets_Update. + * json + */ + /** + * Sample code: Ec2Subnets_Update. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void ec2SubnetsUpdate(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + Ec2Subnet resource = manager.ec2Subnets() + .getByResourceGroupWithResponse("rgec2Subnet", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE) + .getValue(); + resource.update().withTags(mapOf("key1062", "fakeTokenPlaceholder")).apply(); + } + + // Use "Map.of" if available + @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/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/Ec2VolumesCreateOrReplaceSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/Ec2VolumesCreateOrReplaceSamples.java new file mode 100644 index 000000000000..9799b4c0aeae --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/Ec2VolumesCreateOrReplaceSamples.java @@ -0,0 +1,71 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +import com.azure.resourcemanager.awsconnector.models.AwsEc2VolumeProperties; +import com.azure.resourcemanager.awsconnector.models.Ec2VolumeProperties; +import com.azure.resourcemanager.awsconnector.models.TagAutoGenerated21; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for Ec2Volumes CreateOrReplace. + */ +public final class Ec2VolumesCreateOrReplaceSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * Ec2Volumes_CreateOrReplace.json + */ + /** + * Sample code: Ec2Volumes_CreateOrReplace. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void ec2VolumesCreateOrReplace(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.ec2Volumes() + .define("Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])") + .withRegion("tvdnvkrfzxnahsvnguhrcancxusw") + .withExistingResourceGroup("rgec2Volume") + .withTags(mapOf("key271", "fakeTokenPlaceholder")) + .withProperties( + new Ec2VolumeProperties() + .withAwsProperties(new AwsEc2VolumeProperties().withAutoEnableIO(true) + .withAvailabilityZone("wtzdrwiuscqtvxwi") + .withEncrypted(true) + .withIops(3) + .withKmsKeyId("fakeTokenPlaceholder") + .withMultiAttachEnabled(true) + .withOutpostArn("umrirqwmsnmeeknbjkph") + .withSize(2) + .withSnapshotId("upwukogzrkqcaea") + .withTags(Arrays.asList( + new TagAutoGenerated21().withKey("fakeTokenPlaceholder").withValue("hnfhwndsnhbpnwfv"))) + .withThroughput(20) + .withVolumeId("rdcojpg") + .withVolumeType("otkmglqvqws")) + .withPublicCloudConnectorsResourceId("fw") + .withAwsAccountId("zoosbunhmv") + .withArn("evx") + .withPublicCloudResourceName("xowgb") + .withAwsSourceSchema("wlglq") + .withAwsRegion("cw") + .withAwsTags(mapOf("key2425", "fakeTokenPlaceholder"))) + .create(); + } + + // Use "Map.of" if available + @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/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/Ec2VolumesDeleteSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/Ec2VolumesDeleteSamples.java new file mode 100644 index 000000000000..9cfebaf16c1c --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/Ec2VolumesDeleteSamples.java @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +/** + * Samples for Ec2Volumes Delete. + */ +public final class Ec2VolumesDeleteSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/Ec2Volumes_Delete. + * json + */ + /** + * Sample code: Ec2Volumes_Delete. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void ec2VolumesDelete(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.ec2Volumes() + .delete("rgec2Volume", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/Ec2VolumesGetByResourceGroupSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/Ec2VolumesGetByResourceGroupSamples.java new file mode 100644 index 000000000000..6cd830a2fd40 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/Ec2VolumesGetByResourceGroupSamples.java @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +/** + * Samples for Ec2Volumes GetByResourceGroup. + */ +public final class Ec2VolumesGetByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/Ec2Volumes_Get.json + */ + /** + * Sample code: Ec2Volumes_Get. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void ec2VolumesGet(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.ec2Volumes() + .getByResourceGroupWithResponse("rgec2Volume", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/Ec2VolumesListByResourceGroupSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/Ec2VolumesListByResourceGroupSamples.java new file mode 100644 index 000000000000..c38e69eaffe7 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/Ec2VolumesListByResourceGroupSamples.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +/** + * Samples for Ec2Volumes ListByResourceGroup. + */ +public final class Ec2VolumesListByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * Ec2Volumes_ListByResourceGroup.json + */ + /** + * Sample code: Ec2Volumes_ListByResourceGroup. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + ec2VolumesListByResourceGroup(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.ec2Volumes().listByResourceGroup("rgec2Volume", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/Ec2VolumesListSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/Ec2VolumesListSamples.java new file mode 100644 index 000000000000..6c0159f89b76 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/Ec2VolumesListSamples.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +/** + * Samples for Ec2Volumes List. + */ +public final class Ec2VolumesListSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * Ec2Volumes_ListBySubscription.json + */ + /** + * Sample code: Ec2Volumes_ListBySubscription. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + ec2VolumesListBySubscription(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.ec2Volumes().list(com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/Ec2VolumesUpdateSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/Ec2VolumesUpdateSamples.java new file mode 100644 index 000000000000..503b9e4269b6 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/Ec2VolumesUpdateSamples.java @@ -0,0 +1,45 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +import com.azure.resourcemanager.awsconnector.models.Ec2Volume; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for Ec2Volumes Update. + */ +public final class Ec2VolumesUpdateSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/Ec2Volumes_Update. + * json + */ + /** + * Sample code: Ec2Volumes_Update. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void ec2VolumesUpdate(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + Ec2Volume resource = manager.ec2Volumes() + .getByResourceGroupWithResponse("rgec2Volume", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE) + .getValue(); + resource.update().withTags(mapOf("key2751", "fakeTokenPlaceholder")).apply(); + } + + // Use "Map.of" if available + @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/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/Ec2VpcEndpointsCreateOrReplaceSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/Ec2VpcEndpointsCreateOrReplaceSamples.java new file mode 100644 index 000000000000..539f096f4e1b --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/Ec2VpcEndpointsCreateOrReplaceSamples.java @@ -0,0 +1,69 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +import com.azure.resourcemanager.awsconnector.models.AwsEc2VpcEndpointProperties; +import com.azure.resourcemanager.awsconnector.models.Ec2VpcEndpointProperties; +import com.azure.resourcemanager.awsconnector.models.VpcEndpointType; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for Ec2VpcEndpoints CreateOrReplace. + */ +public final class Ec2VpcEndpointsCreateOrReplaceSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * Ec2VpcEndpoints_CreateOrReplace.json + */ + /** + * Sample code: Ec2VpcEndpoints_CreateOrReplace. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + ec2VpcEndpointsCreateOrReplace(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.ec2VpcEndpoints() + .define("Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])") + .withRegion("kkohg") + .withExistingResourceGroup("rgec2VPCEndpoint") + .withTags(mapOf("key8512", "fakeTokenPlaceholder")) + .withProperties(new Ec2VpcEndpointProperties() + .withAwsProperties(new AwsEc2VpcEndpointProperties().withCreationTimestamp("wmawquyzuhbnkrveo") + .withDnsEntries(Arrays.asList("kenhegadrd")) + .withId("xfylmv") + .withNetworkInterfaceIds(Arrays.asList("uvzbeqj")) + .withPolicyDocument(mapOf()) + .withPrivateDnsEnabled(true) + .withRouteTableIds(Arrays.asList("ybkagmpjwuixbpltpabcrwewbjgj")) + .withSecurityGroupIds(Arrays.asList("swfhjyallivwkmzqdyqsgitfilel")) + .withServiceName("bltgximadajrfctijpznsmxgy") + .withSubnetIds(Arrays.asList("oyfzvlrnugigsjyadmdpjblsgpcxkr")) + .withVpcEndpointType(VpcEndpointType.GATEWAY) + .withVpcId("ebbnplgbjkbqfifbmbrii")) + .withPublicCloudConnectorsResourceId("lyxajxyfvrugpvxchbigrlulomftou") + .withAwsAccountId("wtjkq") + .withArn("cxdwblbwakjiwxs") + .withPublicCloudResourceName("zwgwsjbodssxgzq") + .withAwsSourceSchema("mpgbtkugoucwqsqzzchrl") + .withAwsRegion("hmnjtlhnkmnlwcuykbighvnvnjc") + .withAwsTags(mapOf("key7370", "fakeTokenPlaceholder"))) + .create(); + } + + // Use "Map.of" if available + @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/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/Ec2VpcEndpointsDeleteSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/Ec2VpcEndpointsDeleteSamples.java new file mode 100644 index 000000000000..7b60c7758c46 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/Ec2VpcEndpointsDeleteSamples.java @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +/** + * Samples for Ec2VpcEndpoints Delete. + */ +public final class Ec2VpcEndpointsDeleteSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * Ec2VpcEndpoints_Delete.json + */ + /** + * Sample code: Ec2VpcEndpoints_Delete. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void ec2VpcEndpointsDelete(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.ec2VpcEndpoints() + .delete("rgec2VPCEndpoint", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/Ec2VpcEndpointsGetByResourceGroupSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/Ec2VpcEndpointsGetByResourceGroupSamples.java new file mode 100644 index 000000000000..e68404b36eae --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/Ec2VpcEndpointsGetByResourceGroupSamples.java @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +/** + * Samples for Ec2VpcEndpoints GetByResourceGroup. + */ +public final class Ec2VpcEndpointsGetByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/Ec2VpcEndpoints_Get + * .json + */ + /** + * Sample code: Ec2VpcEndpoints_Get. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void ec2VpcEndpointsGet(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.ec2VpcEndpoints() + .getByResourceGroupWithResponse("rgec2VPCEndpoint", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/Ec2VpcEndpointsListByResourceGroupSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/Ec2VpcEndpointsListByResourceGroupSamples.java new file mode 100644 index 000000000000..5fcb48552653 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/Ec2VpcEndpointsListByResourceGroupSamples.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +/** + * Samples for Ec2VpcEndpoints ListByResourceGroup. + */ +public final class Ec2VpcEndpointsListByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * Ec2VpcEndpoints_ListByResourceGroup.json + */ + /** + * Sample code: Ec2VpcEndpoints_ListByResourceGroup. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + ec2VpcEndpointsListByResourceGroup(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.ec2VpcEndpoints().listByResourceGroup("rgec2VPCEndpoint", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/Ec2VpcEndpointsListSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/Ec2VpcEndpointsListSamples.java new file mode 100644 index 000000000000..214a37bc724b --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/Ec2VpcEndpointsListSamples.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +/** + * Samples for Ec2VpcEndpoints List. + */ +public final class Ec2VpcEndpointsListSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * Ec2VpcEndpoints_ListBySubscription.json + */ + /** + * Sample code: Ec2VpcEndpoints_ListBySubscription. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + ec2VpcEndpointsListBySubscription(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.ec2VpcEndpoints().list(com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/Ec2VpcEndpointsUpdateSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/Ec2VpcEndpointsUpdateSamples.java new file mode 100644 index 000000000000..234f0fba0a75 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/Ec2VpcEndpointsUpdateSamples.java @@ -0,0 +1,45 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +import com.azure.resourcemanager.awsconnector.models.Ec2VpcEndpoint; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for Ec2VpcEndpoints Update. + */ +public final class Ec2VpcEndpointsUpdateSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * Ec2VpcEndpoints_Update.json + */ + /** + * Sample code: Ec2VpcEndpoints_Update. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void ec2VpcEndpointsUpdate(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + Ec2VpcEndpoint resource = manager.ec2VpcEndpoints() + .getByResourceGroupWithResponse("rgec2VPCEndpoint", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE) + .getValue(); + resource.update().withTags(mapOf("key7567", "fakeTokenPlaceholder")).apply(); + } + + // Use "Map.of" if available + @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/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/Ec2VpcPeeringConnectionsCreateOrReplaceSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/Ec2VpcPeeringConnectionsCreateOrReplaceSamples.java new file mode 100644 index 000000000000..7a87569ec2ec --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/Ec2VpcPeeringConnectionsCreateOrReplaceSamples.java @@ -0,0 +1,65 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +import com.azure.resourcemanager.awsconnector.models.AwsEc2VpcPeeringConnectionProperties; +import com.azure.resourcemanager.awsconnector.models.Ec2VpcPeeringConnectionProperties; +import com.azure.resourcemanager.awsconnector.models.TagAutoGenerated23; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for Ec2VpcPeeringConnections CreateOrReplace. + */ +public final class Ec2VpcPeeringConnectionsCreateOrReplaceSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * Ec2VpcPeeringConnections_CreateOrReplace.json + */ + /** + * Sample code: Ec2VpcPeeringConnections_CreateOrReplace. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + ec2VpcPeeringConnectionsCreateOrReplace(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.ec2VpcPeeringConnections() + .define("Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])") + .withRegion("lqfmwbb") + .withExistingResourceGroup("rgec2VPCPeeringConnection") + .withTags(mapOf("key6160", "fakeTokenPlaceholder")) + .withProperties(new Ec2VpcPeeringConnectionProperties() + .withAwsProperties(new AwsEc2VpcPeeringConnectionProperties().withId("emsfznbbfejdwouyracpg") + .withPeerOwnerId("ddjymdvquwsrdt") + .withPeerRegion("qcbhjmbddzbcs") + .withPeerRoleArn("kaophgngiqxorpifcluz") + .withPeerVpcId("ccurncyuawhicumwcxxnmuq") + .withTags(Arrays + .asList(new TagAutoGenerated23().withKey("fakeTokenPlaceholder").withValue("xgzluroiobmj"))) + .withVpcId("lkitywfkos")) + .withPublicCloudConnectorsResourceId("jlenaffdnxswiytzyfvbfjfghuf") + .withAwsAccountId("digeyffuemunjngxz") + .withArn("dxhchlgpyvhsexomfqaj") + .withPublicCloudResourceName("ackzpztj") + .withAwsSourceSchema("pfevychrftkuamvlorm") + .withAwsRegion("qgrfrceaszbzvo") + .withAwsTags(mapOf("key8493", "fakeTokenPlaceholder"))) + .create(); + } + + // Use "Map.of" if available + @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/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/Ec2VpcPeeringConnectionsDeleteSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/Ec2VpcPeeringConnectionsDeleteSamples.java new file mode 100644 index 000000000000..c76a219204ee --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/Ec2VpcPeeringConnectionsDeleteSamples.java @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +/** + * Samples for Ec2VpcPeeringConnections Delete. + */ +public final class Ec2VpcPeeringConnectionsDeleteSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * Ec2VpcPeeringConnections_Delete.json + */ + /** + * Sample code: Ec2VpcPeeringConnections_Delete. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + ec2VpcPeeringConnectionsDelete(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.ec2VpcPeeringConnections() + .delete("rgec2VPCPeeringConnection", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/Ec2VpcPeeringConnectionsGetByResourceGroupSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/Ec2VpcPeeringConnectionsGetByResourceGroupSamples.java new file mode 100644 index 000000000000..9fec6c4674ac --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/Ec2VpcPeeringConnectionsGetByResourceGroupSamples.java @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +/** + * Samples for Ec2VpcPeeringConnections GetByResourceGroup. + */ +public final class Ec2VpcPeeringConnectionsGetByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * Ec2VpcPeeringConnections_Get.json + */ + /** + * Sample code: Ec2VpcPeeringConnections_Get. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void ec2VpcPeeringConnectionsGet(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.ec2VpcPeeringConnections() + .getByResourceGroupWithResponse("rgec2VPCPeeringConnection", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/Ec2VpcPeeringConnectionsListByResourceGroupSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/Ec2VpcPeeringConnectionsListByResourceGroupSamples.java new file mode 100644 index 000000000000..07c5530f3f54 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/Ec2VpcPeeringConnectionsListByResourceGroupSamples.java @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +/** + * Samples for Ec2VpcPeeringConnections ListByResourceGroup. + */ +public final class Ec2VpcPeeringConnectionsListByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * Ec2VpcPeeringConnections_ListByResourceGroup.json + */ + /** + * Sample code: Ec2VpcPeeringConnections_ListByResourceGroup. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void ec2VpcPeeringConnectionsListByResourceGroup( + com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.ec2VpcPeeringConnections() + .listByResourceGroup("rgec2VPCPeeringConnection", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/Ec2VpcPeeringConnectionsListSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/Ec2VpcPeeringConnectionsListSamples.java new file mode 100644 index 000000000000..399d2c9c83a5 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/Ec2VpcPeeringConnectionsListSamples.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +/** + * Samples for Ec2VpcPeeringConnections List. + */ +public final class Ec2VpcPeeringConnectionsListSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * Ec2VpcPeeringConnections_ListBySubscription.json + */ + /** + * Sample code: Ec2VpcPeeringConnections_ListBySubscription. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + ec2VpcPeeringConnectionsListBySubscription(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.ec2VpcPeeringConnections().list(com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/Ec2VpcPeeringConnectionsUpdateSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/Ec2VpcPeeringConnectionsUpdateSamples.java new file mode 100644 index 000000000000..ce7eab60130f --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/Ec2VpcPeeringConnectionsUpdateSamples.java @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +import com.azure.resourcemanager.awsconnector.models.Ec2VpcPeeringConnection; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for Ec2VpcPeeringConnections Update. + */ +public final class Ec2VpcPeeringConnectionsUpdateSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * Ec2VpcPeeringConnections_Update.json + */ + /** + * Sample code: Ec2VpcPeeringConnections_Update. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + ec2VpcPeeringConnectionsUpdate(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + Ec2VpcPeeringConnection resource = manager.ec2VpcPeeringConnections() + .getByResourceGroupWithResponse("rgec2VPCPeeringConnection", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE) + .getValue(); + resource.update().withTags(mapOf("key4874", "fakeTokenPlaceholder")).apply(); + } + + // Use "Map.of" if available + @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/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/Ec2VpcsCreateOrReplaceSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/Ec2VpcsCreateOrReplaceSamples.java new file mode 100644 index 000000000000..eaa7730375cb --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/Ec2VpcsCreateOrReplaceSamples.java @@ -0,0 +1,69 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +import com.azure.resourcemanager.awsconnector.models.AwsEc2VpcProperties; +import com.azure.resourcemanager.awsconnector.models.Ec2VpcProperties; +import com.azure.resourcemanager.awsconnector.models.TagAutoGenerated22; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for Ec2Vpcs CreateOrReplace. + */ +public final class Ec2VpcsCreateOrReplaceSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * Ec2Vpcs_CreateOrReplace.json + */ + /** + * Sample code: Ec2Vpcs_CreateOrReplace. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void ec2VpcsCreateOrReplace(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.ec2Vpcs() + .define("Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])") + .withRegion("bcrtgodiyozdsiqbhdvsaaog") + .withExistingResourceGroup("rgec2Vpc") + .withTags(mapOf("key2430", "fakeTokenPlaceholder")) + .withProperties(new Ec2VpcProperties() + .withAwsProperties(new AwsEc2VpcProperties().withCidrBlock("amstuguadqkmlmofdszmxhgssf") + .withCidrBlockAssociations(Arrays.asList("ykwdexxzxjxowuuawym")) + .withDefaultNetworkAcl("lhtepidfpfsyxksnvekueeyvw") + .withDefaultSecurityGroup("qtqgizvsvzdqxmbwwpmtcnqlfuh") + .withEnableDnsHostnames(true) + .withEnableDnsSupport(true) + .withInstanceTenancy("haqdsdkgbjmnwdgamqs") + .withIpv4IpamPoolId("ldzbfvpzpwudqtdyb") + .withIpv4NetmaskLength(21) + .withIpv6CidrBlocks(Arrays.asList("q")) + .withTags(Arrays.asList( + new TagAutoGenerated22().withKey("fakeTokenPlaceholder").withValue("tqvkxdrwsaxvxwckrpqk"))) + .withVpcId("wqqqqmtbgzmdfmkiaoyjdkavuzzzzw")) + .withPublicCloudConnectorsResourceId("hpzdeuzmjfwatmynigq") + .withAwsAccountId("vskthos") + .withArn("isskkecektndkosbruasgvkakzf") + .withPublicCloudResourceName("qjwdilmlbbam") + .withAwsSourceSchema("vnjplxwhapuaydjjdqiaqfvbfjam") + .withAwsRegion("paraxj") + .withAwsTags(mapOf("key96", "fakeTokenPlaceholder"))) + .create(); + } + + // Use "Map.of" if available + @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/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/Ec2VpcsDeleteSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/Ec2VpcsDeleteSamples.java new file mode 100644 index 000000000000..820a42a415de --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/Ec2VpcsDeleteSamples.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +/** + * Samples for Ec2Vpcs Delete. + */ +public final class Ec2VpcsDeleteSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/Ec2Vpcs_Delete.json + */ + /** + * Sample code: Ec2Vpcs_Delete. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void ec2VpcsDelete(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.ec2Vpcs() + .delete("rgec2Vpc", "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/Ec2VpcsGetByResourceGroupSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/Ec2VpcsGetByResourceGroupSamples.java new file mode 100644 index 000000000000..3cf44f204b55 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/Ec2VpcsGetByResourceGroupSamples.java @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +/** + * Samples for Ec2Vpcs GetByResourceGroup. + */ +public final class Ec2VpcsGetByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/Ec2Vpcs_Get.json + */ + /** + * Sample code: Ec2Vpcs_Get. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void ec2VpcsGet(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.ec2Vpcs() + .getByResourceGroupWithResponse("rgec2Vpc", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/Ec2VpcsListByResourceGroupSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/Ec2VpcsListByResourceGroupSamples.java new file mode 100644 index 000000000000..6b2100113da0 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/Ec2VpcsListByResourceGroupSamples.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.awsconnector.generated; + +/** + * Samples for Ec2Vpcs ListByResourceGroup. + */ +public final class Ec2VpcsListByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * Ec2Vpcs_ListByResourceGroup.json + */ + /** + * Sample code: Ec2Vpcs_ListByResourceGroup. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void ec2VpcsListByResourceGroup(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.ec2Vpcs().listByResourceGroup("rgec2Vpc", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/Ec2VpcsListSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/Ec2VpcsListSamples.java new file mode 100644 index 000000000000..8e93cfef5a24 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/Ec2VpcsListSamples.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.awsconnector.generated; + +/** + * Samples for Ec2Vpcs List. + */ +public final class Ec2VpcsListSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * Ec2Vpcs_ListBySubscription.json + */ + /** + * Sample code: Ec2Vpcs_ListBySubscription. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void ec2VpcsListBySubscription(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.ec2Vpcs().list(com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/Ec2VpcsUpdateSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/Ec2VpcsUpdateSamples.java new file mode 100644 index 000000000000..cf14f1259d54 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/Ec2VpcsUpdateSamples.java @@ -0,0 +1,44 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +import com.azure.resourcemanager.awsconnector.models.Ec2Vpc; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for Ec2Vpcs Update. + */ +public final class Ec2VpcsUpdateSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/Ec2Vpcs_Update.json + */ + /** + * Sample code: Ec2Vpcs_Update. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void ec2VpcsUpdate(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + Ec2Vpc resource = manager.ec2Vpcs() + .getByResourceGroupWithResponse("rgec2Vpc", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE) + .getValue(); + resource.update().withTags(mapOf("key5864", "fakeTokenPlaceholder")).apply(); + } + + // Use "Map.of" if available + @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/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/EcrImageDetailsCreateOrReplaceSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/EcrImageDetailsCreateOrReplaceSamples.java new file mode 100644 index 000000000000..1f7c20b2bed9 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/EcrImageDetailsCreateOrReplaceSamples.java @@ -0,0 +1,76 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +import com.azure.resourcemanager.awsconnector.models.AwsEcrImageDetailProperties; +import com.azure.resourcemanager.awsconnector.models.EcrImageDetailProperties; +import com.azure.resourcemanager.awsconnector.models.ImageScanFindingsSummary; +import com.azure.resourcemanager.awsconnector.models.ImageScanStatus; +import com.azure.resourcemanager.awsconnector.models.ScanStatus; +import com.azure.resourcemanager.awsconnector.models.ScanStatusEnumValue; +import java.time.OffsetDateTime; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for EcrImageDetails CreateOrReplace. + */ +public final class EcrImageDetailsCreateOrReplaceSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * EcrImageDetails_CreateOrReplace.json + */ + /** + * Sample code: EcrImageDetails_CreateOrReplace. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + ecrImageDetailsCreateOrReplace(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.ecrImageDetails() + .define("Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])") + .withRegion("mpxszpyclsniahaoqerqewrzxyzcdt") + .withExistingResourceGroup("rgecrImageDetail") + .withTags(mapOf("key9132", "fakeTokenPlaceholder")) + .withProperties(new EcrImageDetailProperties() + .withAwsProperties(new AwsEcrImageDetailProperties().withArtifactMediaType("ciuahpzw") + .withImageDigest("mfgr") + .withImageManifestMediaType("arzsyssziqvvryqc") + .withImagePushedAt(OffsetDateTime.parse("2024-10-08T03:51:24.487Z")) + .withImageScanFindingsSummary( + new ImageScanFindingsSummary().withFindingSeverityCounts(mapOf("key9764", 10)) + .withImageScanCompletedAt(OffsetDateTime.parse("2024-10-08T03:51:24.488Z")) + .withVulnerabilitySourceUpdatedAt(OffsetDateTime.parse("2024-10-08T03:51:24.488Z"))) + .withImageScanStatus(new ImageScanStatus().withDescription("kvsqwhxzrnciqybnl") + .withStatus(new ScanStatusEnumValue().withValue(ScanStatus.ACTIVE))) + .withImageSizeInBytes(18L) + .withImageTags(Arrays.asList("bwikpoljnmaoewepiunoltcxlyxd")) + .withLastRecordedPullTime(OffsetDateTime.parse("2024-10-08T03:51:24.488Z")) + .withRegistryId("xpxtbbeejeosvtcvq") + .withRepositoryName("abftxvvazyfekkcpo")) + .withPublicCloudConnectorsResourceId("glrdicxdaktwlkvgvxurgww") + .withAwsAccountId("yqyxjsfibyscdhyofmyu") + .withArn("dhvgwgtedzuiqdvgc") + .withPublicCloudResourceName("gijthpfhduauuus") + .withAwsSourceSchema("ibsdsdpuiqcwsdxqfn") + .withAwsRegion("atlamkemuqwaezwdsuavhaqo") + .withAwsTags(mapOf("key4659", "fakeTokenPlaceholder"))) + .create(); + } + + // Use "Map.of" if available + @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/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/EcrImageDetailsDeleteSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/EcrImageDetailsDeleteSamples.java new file mode 100644 index 000000000000..abbc1f3dc78c --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/EcrImageDetailsDeleteSamples.java @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +/** + * Samples for EcrImageDetails Delete. + */ +public final class EcrImageDetailsDeleteSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * EcrImageDetails_Delete.json + */ + /** + * Sample code: EcrImageDetails_Delete. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void ecrImageDetailsDelete(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.ecrImageDetails() + .delete("rgecrImageDetail", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/EcrImageDetailsGetByResourceGroupSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/EcrImageDetailsGetByResourceGroupSamples.java new file mode 100644 index 000000000000..df1a52dedaf9 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/EcrImageDetailsGetByResourceGroupSamples.java @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +/** + * Samples for EcrImageDetails GetByResourceGroup. + */ +public final class EcrImageDetailsGetByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/EcrImageDetails_Get + * .json + */ + /** + * Sample code: EcrImageDetails_Get. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void ecrImageDetailsGet(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.ecrImageDetails() + .getByResourceGroupWithResponse("rgecrImageDetail", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/EcrImageDetailsListByResourceGroupSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/EcrImageDetailsListByResourceGroupSamples.java new file mode 100644 index 000000000000..24c4649795c0 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/EcrImageDetailsListByResourceGroupSamples.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +/** + * Samples for EcrImageDetails ListByResourceGroup. + */ +public final class EcrImageDetailsListByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * EcrImageDetails_ListByResourceGroup.json + */ + /** + * Sample code: EcrImageDetails_ListByResourceGroup. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + ecrImageDetailsListByResourceGroup(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.ecrImageDetails().listByResourceGroup("rgecrImageDetail", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/EcrImageDetailsListSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/EcrImageDetailsListSamples.java new file mode 100644 index 000000000000..4ccb8e394908 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/EcrImageDetailsListSamples.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +/** + * Samples for EcrImageDetails List. + */ +public final class EcrImageDetailsListSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * EcrImageDetails_ListBySubscription.json + */ + /** + * Sample code: EcrImageDetails_ListBySubscription. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + ecrImageDetailsListBySubscription(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.ecrImageDetails().list(com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/EcrImageDetailsUpdateSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/EcrImageDetailsUpdateSamples.java new file mode 100644 index 000000000000..4e595f3b8c0f --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/EcrImageDetailsUpdateSamples.java @@ -0,0 +1,45 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +import com.azure.resourcemanager.awsconnector.models.EcrImageDetail; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for EcrImageDetails Update. + */ +public final class EcrImageDetailsUpdateSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * EcrImageDetails_Update.json + */ + /** + * Sample code: EcrImageDetails_Update. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void ecrImageDetailsUpdate(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + EcrImageDetail resource = manager.ecrImageDetails() + .getByResourceGroupWithResponse("rgecrImageDetail", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE) + .getValue(); + resource.update().withTags(mapOf("key5066", "fakeTokenPlaceholder")).apply(); + } + + // Use "Map.of" if available + @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/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/EcrRepositoriesCreateOrReplaceSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/EcrRepositoriesCreateOrReplaceSamples.java new file mode 100644 index 000000000000..df195d5fa62c --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/EcrRepositoriesCreateOrReplaceSamples.java @@ -0,0 +1,78 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +import com.azure.resourcemanager.awsconnector.models.AwsEcrRepositoryProperties; +import com.azure.resourcemanager.awsconnector.models.EcrRepositoryProperties; +import com.azure.resourcemanager.awsconnector.models.EncryptionConfiguration; +import com.azure.resourcemanager.awsconnector.models.EncryptionConfigurationEncryptionType; +import com.azure.resourcemanager.awsconnector.models.ImageScanningConfiguration; +import com.azure.resourcemanager.awsconnector.models.ImageTagMutability; +import com.azure.resourcemanager.awsconnector.models.LifecyclePolicy; +import com.azure.resourcemanager.awsconnector.models.TagAutoGenerated24; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for EcrRepositories CreateOrReplace. + */ +public final class EcrRepositoriesCreateOrReplaceSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * EcrRepositories_CreateOrReplace.json + */ + /** + * Sample code: EcrRepositories_CreateOrReplace. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + ecrRepositoriesCreateOrReplace(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.ecrRepositories() + .define("Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])") + .withRegion("uxqfbijfanljas") + .withExistingResourceGroup("rgecrRepository") + .withTags(mapOf("key2390", "fakeTokenPlaceholder")) + .withProperties( + new EcrRepositoryProperties() + .withAwsProperties( + new AwsEcrRepositoryProperties().withArn("su") + .withEmptyOnDelete(true) + .withEncryptionConfiguration(new EncryptionConfiguration() + .withEncryptionType(EncryptionConfigurationEncryptionType.AES256) + .withKmsKey("fakeTokenPlaceholder")) + .withImageScanningConfiguration(new ImageScanningConfiguration().withScanOnPush(true)) + .withImageTagMutability(ImageTagMutability.IMMUTABLE) + .withLifecyclePolicy(new LifecyclePolicy().withLifecyclePolicyText("xvazgvi") + .withRegistryId("oluqsenexubjydpyaw")) + .withRepositoryName("iuhxuyfxygvumphlcwhnsscudjez") + .withRepositoryPolicyText(mapOf()) + .withRepositoryUri("vmljyfyskxbyjczax") + .withTags(Arrays + .asList(new TagAutoGenerated24().withKey("fakeTokenPlaceholder").withValue("qu")))) + .withPublicCloudConnectorsResourceId("ohtcynikymmfceroreix") + .withAwsAccountId("iuomdzpobqirucabbxz") + .withArn("djb") + .withPublicCloudResourceName("bymfiroqkcgssnop") + .withAwsSourceSchema("olwqyujnmxxhxwyp") + .withAwsRegion("wliyvzjqcxbpwtgjae") + .withAwsTags(mapOf("key7950", "fakeTokenPlaceholder"))) + .create(); + } + + // Use "Map.of" if available + @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/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/EcrRepositoriesDeleteSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/EcrRepositoriesDeleteSamples.java new file mode 100644 index 000000000000..7a5f2b03c7ab --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/EcrRepositoriesDeleteSamples.java @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +/** + * Samples for EcrRepositories Delete. + */ +public final class EcrRepositoriesDeleteSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * EcrRepositories_Delete.json + */ + /** + * Sample code: EcrRepositories_Delete. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void ecrRepositoriesDelete(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.ecrRepositories() + .delete("rgecrRepository", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/EcrRepositoriesGetByResourceGroupSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/EcrRepositoriesGetByResourceGroupSamples.java new file mode 100644 index 000000000000..b6f98fd8a76f --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/EcrRepositoriesGetByResourceGroupSamples.java @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +/** + * Samples for EcrRepositories GetByResourceGroup. + */ +public final class EcrRepositoriesGetByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/EcrRepositories_Get + * .json + */ + /** + * Sample code: EcrRepositories_Get. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void ecrRepositoriesGet(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.ecrRepositories() + .getByResourceGroupWithResponse("rgecrRepository", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/EcrRepositoriesListByResourceGroupSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/EcrRepositoriesListByResourceGroupSamples.java new file mode 100644 index 000000000000..c73f50d19c88 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/EcrRepositoriesListByResourceGroupSamples.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +/** + * Samples for EcrRepositories ListByResourceGroup. + */ +public final class EcrRepositoriesListByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * EcrRepositories_ListByResourceGroup.json + */ + /** + * Sample code: EcrRepositories_ListByResourceGroup. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + ecrRepositoriesListByResourceGroup(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.ecrRepositories().listByResourceGroup("rgecrRepository", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/EcrRepositoriesListSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/EcrRepositoriesListSamples.java new file mode 100644 index 000000000000..438c1d52ed15 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/EcrRepositoriesListSamples.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +/** + * Samples for EcrRepositories List. + */ +public final class EcrRepositoriesListSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * EcrRepositories_ListBySubscription.json + */ + /** + * Sample code: EcrRepositories_ListBySubscription. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + ecrRepositoriesListBySubscription(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.ecrRepositories().list(com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/EcrRepositoriesUpdateSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/EcrRepositoriesUpdateSamples.java new file mode 100644 index 000000000000..6b9fb96ce26e --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/EcrRepositoriesUpdateSamples.java @@ -0,0 +1,45 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +import com.azure.resourcemanager.awsconnector.models.EcrRepository; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for EcrRepositories Update. + */ +public final class EcrRepositoriesUpdateSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * EcrRepositories_Update.json + */ + /** + * Sample code: EcrRepositories_Update. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void ecrRepositoriesUpdate(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + EcrRepository resource = manager.ecrRepositories() + .getByResourceGroupWithResponse("rgecrRepository", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE) + .getValue(); + resource.update().withTags(mapOf("key2760", "fakeTokenPlaceholder")).apply(); + } + + // Use "Map.of" if available + @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/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/EcsClustersCreateOrReplaceSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/EcsClustersCreateOrReplaceSamples.java new file mode 100644 index 000000000000..1daa6e52960c --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/EcsClustersCreateOrReplaceSamples.java @@ -0,0 +1,81 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +import com.azure.resourcemanager.awsconnector.models.AwsEcsClusterProperties; +import com.azure.resourcemanager.awsconnector.models.CapacityProviderStrategyItem; +import com.azure.resourcemanager.awsconnector.models.ClusterConfiguration; +import com.azure.resourcemanager.awsconnector.models.ClusterSettings; +import com.azure.resourcemanager.awsconnector.models.EcsClusterProperties; +import com.azure.resourcemanager.awsconnector.models.ExecuteCommandConfiguration; +import com.azure.resourcemanager.awsconnector.models.ExecuteCommandLogConfiguration; +import com.azure.resourcemanager.awsconnector.models.ServiceConnectDefaults; +import com.azure.resourcemanager.awsconnector.models.TagAutoGenerated25; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for EcsClusters CreateOrReplace. + */ +public final class EcsClustersCreateOrReplaceSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * EcsClusters_CreateOrReplace.json + */ + /** + * Sample code: EcsClusters_CreateOrReplace. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void ecsClustersCreateOrReplace(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.ecsClusters() + .define("Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])") + .withRegion("jvggofkffzhlultqukgoqtb") + .withExistingResourceGroup("rgecsCluster") + .withTags(mapOf("key1755", "fakeTokenPlaceholder")) + .withProperties(new EcsClusterProperties().withAwsProperties(new AwsEcsClusterProperties() + .withArn("mgzeckagdmmepybkhhylkhxzv") + .withCapacityProviders(Arrays.asList("rqrmclul")) + .withClusterName("eavbe") + .withClusterSettings( + Arrays.asList(new ClusterSettings().withName("elsikbbzpkzaghwtqd").withValue("gbnpceuced"))) + .withConfiguration(new ClusterConfiguration().withExecuteCommandConfiguration( + new ExecuteCommandConfiguration().withKmsKeyId("fakeTokenPlaceholder") + .withLogConfiguration(new ExecuteCommandLogConfiguration().withCloudWatchEncryptionEnabled(true) + .withCloudWatchLogGroupName("eiskop") + .withS3BucketName("sfcsij") + .withS3EncryptionEnabled(true) + .withS3KeyPrefix("fakeTokenPlaceholder")) + .withLogging("rspegmyokypfqdocdrothsgivaqf"))) + .withDefaultCapacityProviderStrategy(Arrays.asList(new CapacityProviderStrategyItem().withBase(16) + .withCapacityProvider("kttxptzsaauhguaygucxzzvrbriev") + .withWeight(1))) + .withServiceConnectDefaults(new ServiceConnectDefaults().withNamespace("mwpjrqkazpcetkgyfplp")) + .withTags(Arrays + .asList(new TagAutoGenerated25().withKey("fakeTokenPlaceholder").withValue("dsvfiamfdrnwqretfcu")))) + .withPublicCloudConnectorsResourceId("jbtlcmxmtlcgoxfktpqbi") + .withAwsAccountId("emdtbelvualaeqexsrbhvczjsy") + .withArn("mpaxeywurctxasgtrtckgeoeqmeec") + .withPublicCloudResourceName("nquaerebgaopkptxxbreyhr") + .withAwsSourceSchema("dnbeeswitidsf") + .withAwsRegion("qwurftmiaqdjvlbsxtmdosiauw") + .withAwsTags(mapOf("key3315", "fakeTokenPlaceholder"))) + .create(); + } + + // Use "Map.of" if available + @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/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/EcsClustersDeleteSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/EcsClustersDeleteSamples.java new file mode 100644 index 000000000000..e94099c3d3bc --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/EcsClustersDeleteSamples.java @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +/** + * Samples for EcsClusters Delete. + */ +public final class EcsClustersDeleteSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/EcsClusters_Delete. + * json + */ + /** + * Sample code: EcsClusters_Delete. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void ecsClustersDelete(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.ecsClusters() + .delete("rgecsCluster", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/EcsClustersGetByResourceGroupSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/EcsClustersGetByResourceGroupSamples.java new file mode 100644 index 000000000000..e8e5c25d8f35 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/EcsClustersGetByResourceGroupSamples.java @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +/** + * Samples for EcsClusters GetByResourceGroup. + */ +public final class EcsClustersGetByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/EcsClusters_Get. + * json + */ + /** + * Sample code: EcsClusters_Get. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void ecsClustersGet(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.ecsClusters() + .getByResourceGroupWithResponse("rgecsCluster", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/EcsClustersListByResourceGroupSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/EcsClustersListByResourceGroupSamples.java new file mode 100644 index 000000000000..a90df988c185 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/EcsClustersListByResourceGroupSamples.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +/** + * Samples for EcsClusters ListByResourceGroup. + */ +public final class EcsClustersListByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * EcsClusters_ListByResourceGroup.json + */ + /** + * Sample code: EcsClusters_ListByResourceGroup. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + ecsClustersListByResourceGroup(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.ecsClusters().listByResourceGroup("rgecsCluster", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/EcsClustersListSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/EcsClustersListSamples.java new file mode 100644 index 000000000000..d0cdce5c3e79 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/EcsClustersListSamples.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +/** + * Samples for EcsClusters List. + */ +public final class EcsClustersListSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * EcsClusters_ListBySubscription.json + */ + /** + * Sample code: EcsClusters_ListBySubscription. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + ecsClustersListBySubscription(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.ecsClusters().list(com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/EcsClustersUpdateSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/EcsClustersUpdateSamples.java new file mode 100644 index 000000000000..82a618f64cfd --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/EcsClustersUpdateSamples.java @@ -0,0 +1,45 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +import com.azure.resourcemanager.awsconnector.models.EcsCluster; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for EcsClusters Update. + */ +public final class EcsClustersUpdateSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/EcsClusters_Update. + * json + */ + /** + * Sample code: EcsClusters_Update. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void ecsClustersUpdate(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + EcsCluster resource = manager.ecsClusters() + .getByResourceGroupWithResponse("rgecsCluster", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE) + .getValue(); + resource.update().withTags(mapOf("key657", "fakeTokenPlaceholder")).apply(); + } + + // Use "Map.of" if available + @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/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/EcsServicesCreateOrReplaceSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/EcsServicesCreateOrReplaceSamples.java new file mode 100644 index 000000000000..e4570a573503 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/EcsServicesCreateOrReplaceSamples.java @@ -0,0 +1,170 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +import com.azure.resourcemanager.awsconnector.models.AwsEcsServiceProperties; +import com.azure.resourcemanager.awsconnector.models.AwsVpcConfiguration; +import com.azure.resourcemanager.awsconnector.models.AwsVpcConfigurationAssignPublicIp; +import com.azure.resourcemanager.awsconnector.models.CapacityProviderStrategyItem; +import com.azure.resourcemanager.awsconnector.models.DeploymentAlarms; +import com.azure.resourcemanager.awsconnector.models.DeploymentCircuitBreaker; +import com.azure.resourcemanager.awsconnector.models.DeploymentConfiguration; +import com.azure.resourcemanager.awsconnector.models.DeploymentController; +import com.azure.resourcemanager.awsconnector.models.DeploymentControllerType; +import com.azure.resourcemanager.awsconnector.models.EbsTagSpecification; +import com.azure.resourcemanager.awsconnector.models.EbsTagSpecificationPropagateTags; +import com.azure.resourcemanager.awsconnector.models.EcsServiceProperties; +import com.azure.resourcemanager.awsconnector.models.LaunchType; +import com.azure.resourcemanager.awsconnector.models.LoadBalancer; +import com.azure.resourcemanager.awsconnector.models.LogConfiguration; +import com.azure.resourcemanager.awsconnector.models.NetworkConfiguration; +import com.azure.resourcemanager.awsconnector.models.PlacementConstraint; +import com.azure.resourcemanager.awsconnector.models.PlacementConstraintType; +import com.azure.resourcemanager.awsconnector.models.PlacementStrategy; +import com.azure.resourcemanager.awsconnector.models.PlacementStrategyType; +import com.azure.resourcemanager.awsconnector.models.PropagateTags; +import com.azure.resourcemanager.awsconnector.models.SchedulingStrategy; +import com.azure.resourcemanager.awsconnector.models.Secret; +import com.azure.resourcemanager.awsconnector.models.ServiceConnectClientAlias; +import com.azure.resourcemanager.awsconnector.models.ServiceConnectConfiguration; +import com.azure.resourcemanager.awsconnector.models.ServiceConnectService; +import com.azure.resourcemanager.awsconnector.models.ServiceConnectTlsCertificateAuthority; +import com.azure.resourcemanager.awsconnector.models.ServiceConnectTlsConfiguration; +import com.azure.resourcemanager.awsconnector.models.ServiceManagedEbsVolumeConfiguration; +import com.azure.resourcemanager.awsconnector.models.ServiceRegistry; +import com.azure.resourcemanager.awsconnector.models.ServiceVolumeConfiguration; +import com.azure.resourcemanager.awsconnector.models.TagAutoGenerated26; +import com.azure.resourcemanager.awsconnector.models.TimeoutConfiguration; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for EcsServices CreateOrReplace. + */ +public final class EcsServicesCreateOrReplaceSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * EcsServices_CreateOrReplace.json + */ + /** + * Sample code: EcsServices_CreateOrReplace. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void ecsServicesCreateOrReplace(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.ecsServices() + .define("Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])") + .withRegion("xqpjwxermnqxbnitxykbnjhw") + .withExistingResourceGroup("rgecsService") + .withTags(mapOf("key8484", "fakeTokenPlaceholder")) + .withProperties(new EcsServiceProperties() + .withAwsProperties(new AwsEcsServiceProperties() + .withCapacityProviderStrategy(Arrays + .asList(new CapacityProviderStrategyItem().withBase(4) + .withCapacityProvider("wlfpynlwozihqvkgynmdqqmojbs") + .withWeight(28))) + .withCluster("rdbkmvsugiuvbwkuzagsnrx") + .withDeploymentConfiguration(new DeploymentConfiguration() + .withAlarms(new DeploymentAlarms().withAlarmNames(Arrays.asList("cibbvixciizruhpdxhpkifpwsaq")) + .withEnable(true) + .withRollback(true)) + .withDeploymentCircuitBreaker( + new DeploymentCircuitBreaker().withEnable(true).withRollback(true)) + .withMaximumPercent(14) + .withMinimumHealthyPercent(21)) + .withDeploymentController(new DeploymentController().withType(DeploymentControllerType.CODE_DEPLOY)) + .withDesiredCount(21) + .withEnableEcsManagedTags(true) + .withEnableExecuteCommand(true) + .withHealthCheckGracePeriodSeconds(1) + .withLaunchType(LaunchType.EC2) + .withLoadBalancers(Arrays.asList(new LoadBalancer().withContainerName("vjvntpnuzyftbm") + .withContainerPort(17) + .withLoadBalancerName("eryjxwmbfkms") + .withTargetGroupArn("woxbyyccpmqyiy"))) + .withName("vo") + .withNetworkConfiguration(new NetworkConfiguration().withAwsvpcConfiguration( + new AwsVpcConfiguration().withAssignPublicIp(AwsVpcConfigurationAssignPublicIp.DISABLED) + .withSecurityGroups(Arrays.asList("uoauevqyxylmvje")) + .withSubnets(Arrays.asList("gkqxeakxvyw")))) + .withPlacementConstraints(Arrays + .asList(new PlacementConstraint().withExpression("hxzfzxbfmqqiwgbpgn") + .withType(PlacementConstraintType.DISTINCT_INSTANCE))) + .withPlacementStrategies(Arrays.asList(new PlacementStrategy().withField("tyrqdzgjrkwfhzwebvqld") + .withType(PlacementStrategyType.BINPACK))) + .withPlatformVersion("sfsqyvslsustugopfnnzssjli") + .withPropagateTags(PropagateTags.SERVICE) + .withRole("te") + .withSchedulingStrategy(SchedulingStrategy.DAEMON) + .withServiceArn("zuuoanjk") + .withServiceConnectConfiguration(new ServiceConnectConfiguration().withEnabled(true) + .withLogConfiguration(new LogConfiguration() + .withLogDriver("xwshxwanyuqrfzboxwfv") + .withSecretOptions( + Arrays.asList(new Secret().withName("uxsxwquwbafmsmbyyivhsjrjmfpmim") + .withValueFrom("jnygsbiroyjlgrhs")))) + .withNamespace("tlewpbulbuguuuvq") + .withServices(Arrays.asList(new ServiceConnectService() + .withClientAliases(Arrays.asList( + new ServiceConnectClientAlias().withDnsName("hnnavbjclqhbdebomjoqzo").withPort(16))) + .withDiscoveryName("zuhijazofg") + .withIngressPortOverride(26) + .withPortName("q") + .withTimeout( + new TimeoutConfiguration().withIdleTimeoutSeconds(11).withPerRequestTimeoutSeconds(22)) + .withTls(new ServiceConnectTlsConfiguration() + .withIssuerCertificateAuthority( + new ServiceConnectTlsCertificateAuthority().withAwsPcaAuthorityArn("fqrmk")) + .withKmsKey("fakeTokenPlaceholder") + .withRoleArn("stdhwuiylmutipeonkolqjnbqelds"))))) + .withServiceName("lyblywxxfszkgaaornuxliolfbft") + .withServiceRegistries(Arrays.asList(new ServiceRegistry().withContainerName("ppbxlxmpdbri") + .withContainerPort(7) + .withPort(6) + .withRegistryArn("qmfm"))) + .withTags(Arrays.asList(new TagAutoGenerated26().withKey("fakeTokenPlaceholder").withValue("qukd"))) + .withTaskDefinition("fozrumijzejhpjxeqkmthsswwuden") + .withVolumeConfigurations( + Arrays + .asList(new ServiceVolumeConfiguration() + .withManagedEbsVolume(new ServiceManagedEbsVolumeConfiguration().withEncrypted(true) + .withFilesystemType("ugwxqcjnrqonyao") + .withIops(10) + .withKmsKeyId("fakeTokenPlaceholder") + .withRoleArn("gdudzczxymgopjjzqubzphgdi") + .withSizeInGiB(15) + .withSnapshotId("yff") + .withTagSpecifications(Arrays.asList(new EbsTagSpecification() + .withPropagateTags(EbsTagSpecificationPropagateTags.SERVICE) + .withResourceType("tocxgkuiblcccawaenqv") + .withTags(Arrays.asList(new TagAutoGenerated26().withKey("fakeTokenPlaceholder") + .withValue("qukd"))))) + .withThroughput(3) + .withVolumeType("uwvjfmuzpksfpnfsukbunbuqcwxslx")) + .withName("zkqnipaoexthwwot")))) + .withPublicCloudConnectorsResourceId("ghyukpeo") + .withAwsAccountId("egkrtzylfud") + .withArn("advapj") + .withPublicCloudResourceName("jumpzlzalckrkaqg") + .withAwsSourceSchema("woodigpcfntomkursi") + .withAwsRegion("pwmulwhqhosmbthwzammshywxzaxhi") + .withAwsTags(mapOf("key3094", "fakeTokenPlaceholder"))) + .create(); + } + + // Use "Map.of" if available + @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/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/EcsServicesDeleteSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/EcsServicesDeleteSamples.java new file mode 100644 index 000000000000..dd612900de4b --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/EcsServicesDeleteSamples.java @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +/** + * Samples for EcsServices Delete. + */ +public final class EcsServicesDeleteSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/EcsServices_Delete. + * json + */ + /** + * Sample code: EcsServices_Delete. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void ecsServicesDelete(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.ecsServices() + .delete("rgecsService", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/EcsServicesGetByResourceGroupSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/EcsServicesGetByResourceGroupSamples.java new file mode 100644 index 000000000000..23f827fce303 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/EcsServicesGetByResourceGroupSamples.java @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +/** + * Samples for EcsServices GetByResourceGroup. + */ +public final class EcsServicesGetByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/EcsServices_Get. + * json + */ + /** + * Sample code: EcsServices_Get. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void ecsServicesGet(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.ecsServices() + .getByResourceGroupWithResponse("rgecsService", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/EcsServicesListByResourceGroupSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/EcsServicesListByResourceGroupSamples.java new file mode 100644 index 000000000000..1a7658cbec33 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/EcsServicesListByResourceGroupSamples.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +/** + * Samples for EcsServices ListByResourceGroup. + */ +public final class EcsServicesListByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * EcsServices_ListByResourceGroup.json + */ + /** + * Sample code: EcsServices_ListByResourceGroup. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + ecsServicesListByResourceGroup(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.ecsServices().listByResourceGroup("rgecsService", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/EcsServicesListSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/EcsServicesListSamples.java new file mode 100644 index 000000000000..e63fedb1e170 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/EcsServicesListSamples.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +/** + * Samples for EcsServices List. + */ +public final class EcsServicesListSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * EcsServices_ListBySubscription.json + */ + /** + * Sample code: EcsServices_ListBySubscription. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + ecsServicesListBySubscription(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.ecsServices().list(com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/EcsServicesUpdateSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/EcsServicesUpdateSamples.java new file mode 100644 index 000000000000..b852bc550807 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/EcsServicesUpdateSamples.java @@ -0,0 +1,45 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +import com.azure.resourcemanager.awsconnector.models.EcsService; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for EcsServices Update. + */ +public final class EcsServicesUpdateSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/EcsServices_Update. + * json + */ + /** + * Sample code: EcsServices_Update. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void ecsServicesUpdate(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + EcsService resource = manager.ecsServices() + .getByResourceGroupWithResponse("rgecsService", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE) + .getValue(); + resource.update().withTags(mapOf("key8601", "fakeTokenPlaceholder")).apply(); + } + + // Use "Map.of" if available + @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/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/EcsTaskDefinitionsCreateOrReplaceSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/EcsTaskDefinitionsCreateOrReplaceSamples.java new file mode 100644 index 000000000000..d3a70b1c648e --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/EcsTaskDefinitionsCreateOrReplaceSamples.java @@ -0,0 +1,212 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +import com.azure.resourcemanager.awsconnector.models.AuthorizationConfig; +import com.azure.resourcemanager.awsconnector.models.AuthorizationConfigIam; +import com.azure.resourcemanager.awsconnector.models.AwsEcsTaskDefinitionProperties; +import com.azure.resourcemanager.awsconnector.models.ContainerDefinition; +import com.azure.resourcemanager.awsconnector.models.ContainerDependency; +import com.azure.resourcemanager.awsconnector.models.Device; +import com.azure.resourcemanager.awsconnector.models.DockerVolumeConfiguration; +import com.azure.resourcemanager.awsconnector.models.EcsTaskDefinitionProperties; +import com.azure.resourcemanager.awsconnector.models.EfsVolumeConfiguration; +import com.azure.resourcemanager.awsconnector.models.EfsVolumeConfigurationTransitEncryption; +import com.azure.resourcemanager.awsconnector.models.EnvironmentFile; +import com.azure.resourcemanager.awsconnector.models.EphemeralStorage; +import com.azure.resourcemanager.awsconnector.models.FSxAuthorizationConfig; +import com.azure.resourcemanager.awsconnector.models.FSxWindowsFileServerVolumeConfiguration; +import com.azure.resourcemanager.awsconnector.models.FirelensConfiguration; +import com.azure.resourcemanager.awsconnector.models.HealthCheck; +import com.azure.resourcemanager.awsconnector.models.HostEntry; +import com.azure.resourcemanager.awsconnector.models.HostVolumeProperties; +import com.azure.resourcemanager.awsconnector.models.InferenceAccelerator; +import com.azure.resourcemanager.awsconnector.models.KernelCapabilities; +import com.azure.resourcemanager.awsconnector.models.KeyValuePair; +import com.azure.resourcemanager.awsconnector.models.LinuxParameters; +import com.azure.resourcemanager.awsconnector.models.LogConfiguration; +import com.azure.resourcemanager.awsconnector.models.MountPoint; +import com.azure.resourcemanager.awsconnector.models.PortMapping; +import com.azure.resourcemanager.awsconnector.models.PortMappingAppProtocol; +import com.azure.resourcemanager.awsconnector.models.ProxyConfiguration; +import com.azure.resourcemanager.awsconnector.models.RepositoryCredentials; +import com.azure.resourcemanager.awsconnector.models.ResourceRequirement; +import com.azure.resourcemanager.awsconnector.models.RuntimePlatform; +import com.azure.resourcemanager.awsconnector.models.Secret; +import com.azure.resourcemanager.awsconnector.models.SystemControl; +import com.azure.resourcemanager.awsconnector.models.TagAutoGenerated27; +import com.azure.resourcemanager.awsconnector.models.TaskDefinitionPlacementConstraint; +import com.azure.resourcemanager.awsconnector.models.Tmpfs; +import com.azure.resourcemanager.awsconnector.models.Ulimit; +import com.azure.resourcemanager.awsconnector.models.Volume; +import com.azure.resourcemanager.awsconnector.models.VolumeFrom; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for EcsTaskDefinitions CreateOrReplace. + */ +public final class EcsTaskDefinitionsCreateOrReplaceSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * EcsTaskDefinitions_CreateOrReplace.json + */ + /** + * Sample code: EcsTaskDefinitions_CreateOrReplace. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + ecsTaskDefinitionsCreateOrReplace(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.ecsTaskDefinitions() + .define("Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])") + .withRegion("hideafehihasfzxdxuqiqubhhzg") + .withExistingResourceGroup("rgecsTaskDefinition") + .withTags(mapOf("key6626", "fakeTokenPlaceholder")) + .withProperties(new EcsTaskDefinitionProperties() + .withAwsProperties(new AwsEcsTaskDefinitionProperties() + .withContainerDefinitions(Arrays.asList(new ContainerDefinition() + .withCommand(Arrays.asList("jowixdtkttvhtvcluhzsqkcszit")) + .withCpu(17) + .withCredentialSpecs(Arrays.asList("ooravv")) + .withDependsOn( + Arrays.asList(new ContainerDependency().withCondition("xpmiwcexgnrimsrqyrdlvyyquiccp") + .withContainerName("wzcyhuwwutzttwwaopqed"))) + .withDisableNetworking(true) + .withDnsSearchDomains(Arrays.asList("ggzzwoziotxloooklwdsveul")) + .withDnsServers(Arrays.asList("ngggprelehukiysguto")) + .withDockerSecurityOptions(Arrays.asList("famtfjusztdnyrdzupruqpxufhxp")) + .withEntryPoint(Arrays.asList("oaiompurpnjswlqkmvgraiaj")) + .withEnvironment(Arrays.asList(new KeyValuePair().withName("edrmixvb").withValue("vdms"))) + .withEnvironmentFiles( + Arrays.asList(new EnvironmentFile().withType("psgsoavpms").withValue("ydkrwlbkbzqdm"))) + .withEssential(true) + .withExtraHosts(Arrays.asList( + new HostEntry().withHostname("unpwutrc").withIpAddress("mcsjkhhqbwqesxwcpnnasbzamixath"))) + .withFirelensConfiguration(new FirelensConfiguration().withType("uuwlwegjjeoorvbgtyzoaeeucp")) + .withHealthCheck(new HealthCheck().withCommand(Arrays.asList("ppgfrdhjiytbzqtwkumhmnpsk")) + .withInterval(1) + .withRetries(11) + .withStartPeriod(21) + .withTimeout(22)) + .withHostname("qjkxoayeojuesqmrhe") + .withImage("lmgx") + .withInteractive(true) + .withLinks(Arrays.asList("awgsbfcuoynoomjr")) + .withLinuxParameters(new LinuxParameters() + .withCapabilities(new KernelCapabilities().withAdd(Arrays.asList("xnobooaglhooafh")) + .withDrop(Arrays.asList("uscfx"))) + .withDevices(Arrays.asList(new Device().withContainerPath("fveecgcpepimcqufoswgvjibavi") + .withHostPath("hvwxdqfcbt") + .withPermissions(Arrays.asList("yqev")))) + .withInitProcessEnabled(true) + .withMaxSwap(24) + .withSharedMemorySize(1) + .withSwappiness(27) + .withTmpfs(Arrays.asList(new Tmpfs().withContainerPath("kxvhyrbeu") + .withMountOptions(Arrays.asList("lylxsszvvczykn")) + .withSize(24)))) + .withLogConfiguration(new LogConfiguration().withLogDriver("zgkgcxxggqdvrfngjbdapez") + .withSecretOptions( + Arrays.asList(new Secret().withName("knumytlyulndziptjvgvcpd").withValueFrom("z")))) + .withMemory(27) + .withMemoryReservation(9) + .withMountPoints(Arrays.asList(new MountPoint().withContainerPath("zjtchyyfjv") + .withReadOnly(true) + .withSourceVolume("mrimyrhpxx"))) + .withName("tfseewfqlgwjqbkjikv") + .withPortMappings(Arrays.asList(new PortMapping().withAppProtocol(PortMappingAppProtocol.GRPC) + .withContainerPort(17) + .withContainerPortRange("hwshvyttesxemvlis") + .withHostPort(13) + .withName("nbxxumpmur") + .withProtocol("llczx"))) + .withPrivileged(true) + .withPseudoTerminal(true) + .withReadonlyRootFilesystem(true) + .withRepositoryCredentials( + new RepositoryCredentials().withCredentialsParameter("fakeTokenPlaceholder")) + .withResourceRequirements(Arrays.asList( + new ResourceRequirement().withType("yhtgxyeazgtpygnamvgtrt").withValue("msamplxjlrq"))) + .withSecrets(Arrays.asList(new Secret().withName("knumytlyulndziptjvgvcpd").withValueFrom("z"))) + .withStartTimeout(10) + .withStopTimeout(24) + .withSystemControls(Arrays.asList( + new SystemControl().withNamespace("hcwgpftfycwhenxygrbczcyqxh").withValue("zzjkfgz"))) + .withUlimits(Arrays.asList( + new Ulimit().withHardLimit(16).withName("zswtamsvbvaxlueyfkklzaz").withSoftLimit(2))) + .withUser("hosruyaojhjbh") + .withVolumesFrom( + Arrays.asList(new VolumeFrom().withReadOnly(true).withSourceContainer("ktlxxpz"))) + .withWorkingDirectory("jpdgsckyvfez"))) + .withCpu("hijyr") + .withEphemeralStorage(new EphemeralStorage().withSizeInGiB(17)) + .withExecutionRoleArn("qqqfakequmccjxadppbeamxuwsitta") + .withFamily("atzptqetfqeczglfyn") + .withInferenceAccelerators( + Arrays.asList(new InferenceAccelerator().withDeviceName("mh").withDeviceType("zfkvyer"))) + .withIpcMode("bynxyc") + .withMemory("vwthlhlwlmwyoxowrumsld") + .withNetworkMode("vrvk") + .withPidMode("pthtbdouatcrybmke") + .withPlacementConstraints( + Arrays.asList(new TaskDefinitionPlacementConstraint().withExpression("skxfvhirrtaegdaujr") + .withType("qnklizvyidxybjmtkgdzdls"))) + .withProxyConfiguration(new ProxyConfiguration().withContainerName("tykmharv") + .withProxyConfigurationProperties( + Arrays.asList(new KeyValuePair().withName("edrmixvb").withValue("vdms"))) + .withType("htnvhyjaffhosgiq")) + .withRequiresCompatibilities(Arrays.asList("lmugnbkpcgvmibqmoyeicudqghukxl")) + .withRuntimePlatform(new RuntimePlatform() + .withCpuArchitecture("zcetkrsfadbflliirh") + .withOperatingSystemFamily("topzpehesx")) + .withTags( + Arrays.asList(new TagAutoGenerated27().withKey("fakeTokenPlaceholder").withValue("glazi"))) + .withTaskDefinitionArn("fpexhci") + .withTaskRoleArn("vvebkfiglrktpmn") + .withVolumes(Arrays.asList(new Volume().withConfiguredAtLaunch(true) + .withDockerVolumeConfiguration(new DockerVolumeConfiguration() + .withAutoprovision(true) + .withDriver("fdypjooligpeypyjkojhhnstigr") + .withScope("wourdwnfkwgitfhzywc")) + .withEfsVolumeConfiguration(new EfsVolumeConfiguration() + .withAuthorizationConfig(new AuthorizationConfig().withAccessPointId("ipf") + .withIam(AuthorizationConfigIam.DISABLED)) + .withFilesystemId("kyluffayszoviyute") + .withRootDirectory("vqogypwzwvlqikbwdhvy") + .withTransitEncryption(EfsVolumeConfigurationTransitEncryption.DISABLED) + .withTransitEncryptionPort(27)) + .withFSxWindowsFileServerVolumeConfiguration(new FSxWindowsFileServerVolumeConfiguration() + .withAuthorizationConfig( + new FSxAuthorizationConfig().withCredentialsParameter("fakeTokenPlaceholder") + .withDomain("igiaaxjfjdstgiwmurfycdsss")) + .withFileSystemId("gxcjekzhsm") + .withRootDirectory("bkbhxkwlfnslgnapevzhyvmfcdaup")) + .withHost(new HostVolumeProperties().withSourcePath("kgadnbxtebvbppaiqqkcmwcipqs")) + .withName("qslxsptvrywosrsnrdvo")))) + .withPublicCloudConnectorsResourceId("zrnabgyobuzozcbzvgu") + .withAwsAccountId("efgvyahxivjf") + .withArn("mkr") + .withPublicCloudResourceName("mmhr") + .withAwsSourceSchema("mvndrea") + .withAwsRegion("vdwjcoqcepgcfqjeedexacghbqhz") + .withAwsTags(mapOf("key1568", "fakeTokenPlaceholder"))) + .create(); + } + + // Use "Map.of" if available + @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/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/EcsTaskDefinitionsDeleteSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/EcsTaskDefinitionsDeleteSamples.java new file mode 100644 index 000000000000..c45845e72c9e --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/EcsTaskDefinitionsDeleteSamples.java @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +/** + * Samples for EcsTaskDefinitions Delete. + */ +public final class EcsTaskDefinitionsDeleteSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * EcsTaskDefinitions_Delete.json + */ + /** + * Sample code: EcsTaskDefinitions_Delete. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void ecsTaskDefinitionsDelete(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.ecsTaskDefinitions() + .delete("rgecsTaskDefinition", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/EcsTaskDefinitionsGetByResourceGroupSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/EcsTaskDefinitionsGetByResourceGroupSamples.java new file mode 100644 index 000000000000..e8530136ad7b --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/EcsTaskDefinitionsGetByResourceGroupSamples.java @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +/** + * Samples for EcsTaskDefinitions GetByResourceGroup. + */ +public final class EcsTaskDefinitionsGetByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * EcsTaskDefinitions_Get.json + */ + /** + * Sample code: EcsTaskDefinitions_Get. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void ecsTaskDefinitionsGet(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.ecsTaskDefinitions() + .getByResourceGroupWithResponse("rgecsTaskDefinition", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/EcsTaskDefinitionsListByResourceGroupSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/EcsTaskDefinitionsListByResourceGroupSamples.java new file mode 100644 index 000000000000..8c4d047a8a2a --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/EcsTaskDefinitionsListByResourceGroupSamples.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +/** + * Samples for EcsTaskDefinitions ListByResourceGroup. + */ +public final class EcsTaskDefinitionsListByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * EcsTaskDefinitions_ListByResourceGroup.json + */ + /** + * Sample code: EcsTaskDefinitions_ListByResourceGroup. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + ecsTaskDefinitionsListByResourceGroup(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.ecsTaskDefinitions().listByResourceGroup("rgecsTaskDefinition", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/EcsTaskDefinitionsListSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/EcsTaskDefinitionsListSamples.java new file mode 100644 index 000000000000..950b5088072b --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/EcsTaskDefinitionsListSamples.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +/** + * Samples for EcsTaskDefinitions List. + */ +public final class EcsTaskDefinitionsListSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * EcsTaskDefinitions_ListBySubscription.json + */ + /** + * Sample code: EcsTaskDefinitions_ListBySubscription. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + ecsTaskDefinitionsListBySubscription(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.ecsTaskDefinitions().list(com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/EcsTaskDefinitionsUpdateSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/EcsTaskDefinitionsUpdateSamples.java new file mode 100644 index 000000000000..2869895b6c24 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/EcsTaskDefinitionsUpdateSamples.java @@ -0,0 +1,45 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +import com.azure.resourcemanager.awsconnector.models.EcsTaskDefinition; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for EcsTaskDefinitions Update. + */ +public final class EcsTaskDefinitionsUpdateSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * EcsTaskDefinitions_Update.json + */ + /** + * Sample code: EcsTaskDefinitions_Update. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void ecsTaskDefinitionsUpdate(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + EcsTaskDefinition resource = manager.ecsTaskDefinitions() + .getByResourceGroupWithResponse("rgecsTaskDefinition", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE) + .getValue(); + resource.update().withTags(mapOf("key2531", "fakeTokenPlaceholder")).apply(); + } + + // Use "Map.of" if available + @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/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/EfsFileSystemsCreateOrReplaceSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/EfsFileSystemsCreateOrReplaceSamples.java new file mode 100644 index 000000000000..3628a300810c --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/EfsFileSystemsCreateOrReplaceSamples.java @@ -0,0 +1,87 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +import com.azure.resourcemanager.awsconnector.models.AwsEfsFileSystemProperties; +import com.azure.resourcemanager.awsconnector.models.BackupPolicy; +import com.azure.resourcemanager.awsconnector.models.BackupPolicyStatus; +import com.azure.resourcemanager.awsconnector.models.EfsFileSystemProperties; +import com.azure.resourcemanager.awsconnector.models.ElasticFileSystemTag; +import com.azure.resourcemanager.awsconnector.models.FileSystemProtection; +import com.azure.resourcemanager.awsconnector.models.FileSystemProtectionReplicationOverwriteProtection; +import com.azure.resourcemanager.awsconnector.models.LifecyclePolicyAutoGenerated; +import com.azure.resourcemanager.awsconnector.models.ReplicationConfiguration; +import com.azure.resourcemanager.awsconnector.models.ReplicationDestination; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for EfsFileSystems CreateOrReplace. + */ +public final class EfsFileSystemsCreateOrReplaceSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * EfsFileSystems_CreateOrReplace.json + */ + /** + * Sample code: EfsFileSystems_CreateOrReplace. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + efsFileSystemsCreateOrReplace(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.efsFileSystems() + .define("Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])") + .withRegion("phxoujlvsqavkckotussgpnjgexvq") + .withExistingResourceGroup("rgefsFileSystem") + .withTags(mapOf("key8058", "fakeTokenPlaceholder")) + .withProperties(new EfsFileSystemProperties() + .withAwsProperties(new AwsEfsFileSystemProperties().withArn("hptcgar") + .withAvailabilityZoneName("wnn") + .withBackupPolicy(new BackupPolicy().withStatus(BackupPolicyStatus.DISABLED)) + .withBypassPolicyLockoutSafetyCheck(true) + .withEncrypted(true) + .withFileSystemId("kublwmniiobukjozju") + .withFileSystemProtection(new FileSystemProtection().withReplicationOverwriteProtection( + FileSystemProtectionReplicationOverwriteProtection.DISABLED)) + .withFileSystemTags( + Arrays.asList(new ElasticFileSystemTag().withKey("fakeTokenPlaceholder").withValue("gcz"))) + .withKmsKeyId("fakeTokenPlaceholder") + .withLifecyclePolicies(Arrays.asList( + new LifecyclePolicyAutoGenerated().withTransitionToArchive("xsnpjovpiazmhefijlflijjycbugv") + .withTransitionToIA("lslpvdwwgc") + .withTransitionToPrimaryStorageClass("migoeoowupavauvyrljegu"))) + .withPerformanceMode("gtcuhloqhqjvztxoqvnzhwejwqg") + .withProvisionedThroughputInMibps(6) + .withReplicationConfiguration(new ReplicationConfiguration().withDestinations( + Arrays.asList(new ReplicationDestination().withAvailabilityZoneName("ymqufkisnklobowewikkugs") + .withFileSystemId("utzycscycyiunvfnsjwz") + .withKmsKeyId("fakeTokenPlaceholder") + .withRegion("bakyknetpfqoqpltuuxkauokslotb")))) + .withThroughputMode("qiroscdbdjqkhezgxhfjiqd")) + .withPublicCloudConnectorsResourceId("mhovamuukkqswmro") + .withAwsAccountId("jkixa") + .withArn("pewusdrkpcuvxtmjhvzmakefatinq") + .withPublicCloudResourceName("nhvnekfp") + .withAwsSourceSchema("txcarqgbqzzvg") + .withAwsRegion("quxdhbvdpdedfzbfp") + .withAwsTags(mapOf("key3062", "fakeTokenPlaceholder"))) + .create(); + } + + // Use "Map.of" if available + @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/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/EfsFileSystemsDeleteSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/EfsFileSystemsDeleteSamples.java new file mode 100644 index 000000000000..36a16fc4ce0c --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/EfsFileSystemsDeleteSamples.java @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +/** + * Samples for EfsFileSystems Delete. + */ +public final class EfsFileSystemsDeleteSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * EfsFileSystems_Delete.json + */ + /** + * Sample code: EfsFileSystems_Delete. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void efsFileSystemsDelete(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.efsFileSystems() + .delete("rgefsFileSystem", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/EfsFileSystemsGetByResourceGroupSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/EfsFileSystemsGetByResourceGroupSamples.java new file mode 100644 index 000000000000..bb127236d579 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/EfsFileSystemsGetByResourceGroupSamples.java @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +/** + * Samples for EfsFileSystems GetByResourceGroup. + */ +public final class EfsFileSystemsGetByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/EfsFileSystems_Get. + * json + */ + /** + * Sample code: EfsFileSystems_Get. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void efsFileSystemsGet(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.efsFileSystems() + .getByResourceGroupWithResponse("rgefsFileSystem", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/EfsFileSystemsListByResourceGroupSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/EfsFileSystemsListByResourceGroupSamples.java new file mode 100644 index 000000000000..7bae72832341 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/EfsFileSystemsListByResourceGroupSamples.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +/** + * Samples for EfsFileSystems ListByResourceGroup. + */ +public final class EfsFileSystemsListByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * EfsFileSystems_ListByResourceGroup.json + */ + /** + * Sample code: EfsFileSystems_ListByResourceGroup. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + efsFileSystemsListByResourceGroup(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.efsFileSystems().listByResourceGroup("rgefsFileSystem", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/EfsFileSystemsListSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/EfsFileSystemsListSamples.java new file mode 100644 index 000000000000..1a1cdc7a49e6 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/EfsFileSystemsListSamples.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +/** + * Samples for EfsFileSystems List. + */ +public final class EfsFileSystemsListSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * EfsFileSystems_ListBySubscription.json + */ + /** + * Sample code: EfsFileSystems_ListBySubscription. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + efsFileSystemsListBySubscription(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.efsFileSystems().list(com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/EfsFileSystemsUpdateSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/EfsFileSystemsUpdateSamples.java new file mode 100644 index 000000000000..daeabdbde4f9 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/EfsFileSystemsUpdateSamples.java @@ -0,0 +1,45 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +import com.azure.resourcemanager.awsconnector.models.EfsFileSystem; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for EfsFileSystems Update. + */ +public final class EfsFileSystemsUpdateSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * EfsFileSystems_Update.json + */ + /** + * Sample code: EfsFileSystems_Update. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void efsFileSystemsUpdate(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + EfsFileSystem resource = manager.efsFileSystems() + .getByResourceGroupWithResponse("rgefsFileSystem", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE) + .getValue(); + resource.update().withTags(mapOf("key5392", "fakeTokenPlaceholder")).apply(); + } + + // Use "Map.of" if available + @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/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/EfsMountTargetsCreateOrReplaceSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/EfsMountTargetsCreateOrReplaceSamples.java new file mode 100644 index 000000000000..049547fffbe8 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/EfsMountTargetsCreateOrReplaceSamples.java @@ -0,0 +1,61 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +import com.azure.resourcemanager.awsconnector.models.AwsEfsMountTargetProperties; +import com.azure.resourcemanager.awsconnector.models.EfsMountTargetProperties; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for EfsMountTargets CreateOrReplace. + */ +public final class EfsMountTargetsCreateOrReplaceSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * EfsMountTargets_CreateOrReplace.json + */ + /** + * Sample code: EfsMountTargets_CreateOrReplace. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + efsMountTargetsCreateOrReplace(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.efsMountTargets() + .define("Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])") + .withRegion("xaybj") + .withExistingResourceGroup("rgefsMountTarget") + .withTags(mapOf("key3687", "fakeTokenPlaceholder")) + .withProperties(new EfsMountTargetProperties() + .withAwsProperties(new AwsEfsMountTargetProperties().withFileSystemId("yyzhtbwsscfcaxuvdvmswchhxapky") + .withId("micgyhibjdexozpicbfsmpclu") + .withIpAddress("unspxdyqhrhlkstzmdrd") + .withSecurityGroups(Arrays.asList("zxkzjhcwszqzfeogafiaub")) + .withSubnetId("xbeontn")) + .withPublicCloudConnectorsResourceId("rwszhgqustirkxkbk") + .withAwsAccountId("iwvssztfldgfir") + .withArn("dtpqhenvexdxqcqscosxk") + .withPublicCloudResourceName("bezmotdonashggkeobrc") + .withAwsSourceSchema("gpkfqbbpywdedvyabzy") + .withAwsRegion("lyvbqubwsgdvarrauygfhw") + .withAwsTags(mapOf("key5226", "fakeTokenPlaceholder"))) + .create(); + } + + // Use "Map.of" if available + @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/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/EfsMountTargetsDeleteSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/EfsMountTargetsDeleteSamples.java new file mode 100644 index 000000000000..c949eb4410af --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/EfsMountTargetsDeleteSamples.java @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +/** + * Samples for EfsMountTargets Delete. + */ +public final class EfsMountTargetsDeleteSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * EfsMountTargets_Delete.json + */ + /** + * Sample code: EfsMountTargets_Delete. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void efsMountTargetsDelete(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.efsMountTargets() + .delete("rgefsMountTarget", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/EfsMountTargetsGetByResourceGroupSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/EfsMountTargetsGetByResourceGroupSamples.java new file mode 100644 index 000000000000..7a487e28a488 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/EfsMountTargetsGetByResourceGroupSamples.java @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +/** + * Samples for EfsMountTargets GetByResourceGroup. + */ +public final class EfsMountTargetsGetByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/EfsMountTargets_Get + * .json + */ + /** + * Sample code: EfsMountTargets_Get. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void efsMountTargetsGet(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.efsMountTargets() + .getByResourceGroupWithResponse("rgefsMountTarget", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/EfsMountTargetsListByResourceGroupSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/EfsMountTargetsListByResourceGroupSamples.java new file mode 100644 index 000000000000..cb611fc8b775 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/EfsMountTargetsListByResourceGroupSamples.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +/** + * Samples for EfsMountTargets ListByResourceGroup. + */ +public final class EfsMountTargetsListByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * EfsMountTargets_ListByResourceGroup.json + */ + /** + * Sample code: EfsMountTargets_ListByResourceGroup. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + efsMountTargetsListByResourceGroup(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.efsMountTargets().listByResourceGroup("rgefsMountTarget", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/EfsMountTargetsListSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/EfsMountTargetsListSamples.java new file mode 100644 index 000000000000..e6801ceeeb99 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/EfsMountTargetsListSamples.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +/** + * Samples for EfsMountTargets List. + */ +public final class EfsMountTargetsListSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * EfsMountTargets_ListBySubscription.json + */ + /** + * Sample code: EfsMountTargets_ListBySubscription. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + efsMountTargetsListBySubscription(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.efsMountTargets().list(com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/EfsMountTargetsUpdateSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/EfsMountTargetsUpdateSamples.java new file mode 100644 index 000000000000..de99613260e8 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/EfsMountTargetsUpdateSamples.java @@ -0,0 +1,45 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +import com.azure.resourcemanager.awsconnector.models.EfsMountTarget; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for EfsMountTargets Update. + */ +public final class EfsMountTargetsUpdateSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * EfsMountTargets_Update.json + */ + /** + * Sample code: EfsMountTargets_Update. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void efsMountTargetsUpdate(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + EfsMountTarget resource = manager.efsMountTargets() + .getByResourceGroupWithResponse("rgefsMountTarget", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE) + .getValue(); + resource.update().withTags(mapOf("key7998", "fakeTokenPlaceholder")).apply(); + } + + // Use "Map.of" if available + @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/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/EksClustersCreateOrReplaceSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/EksClustersCreateOrReplaceSamples.java new file mode 100644 index 000000000000..aaa0f8360596 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/EksClustersCreateOrReplaceSamples.java @@ -0,0 +1,131 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +import com.azure.resourcemanager.awsconnector.fluent.models.EksClusterInner; +import com.azure.resourcemanager.awsconnector.models.AccessConfigResponse; +import com.azure.resourcemanager.awsconnector.models.AuthenticationMode; +import com.azure.resourcemanager.awsconnector.models.AuthenticationModeEnumValue; +import com.azure.resourcemanager.awsconnector.models.AwsEksClusterProperties; +import com.azure.resourcemanager.awsconnector.models.Certificate; +import com.azure.resourcemanager.awsconnector.models.ClusterHealth; +import com.azure.resourcemanager.awsconnector.models.ClusterIssue; +import com.azure.resourcemanager.awsconnector.models.ClusterIssueCode; +import com.azure.resourcemanager.awsconnector.models.ClusterIssueCodeEnumValue; +import com.azure.resourcemanager.awsconnector.models.ClusterStatus; +import com.azure.resourcemanager.awsconnector.models.ClusterStatusEnumValue; +import com.azure.resourcemanager.awsconnector.models.ConnectorConfigResponse; +import com.azure.resourcemanager.awsconnector.models.ControlPlanePlacementResponse; +import com.azure.resourcemanager.awsconnector.models.EksClusterProperties; +import com.azure.resourcemanager.awsconnector.models.EncryptionConfig; +import com.azure.resourcemanager.awsconnector.models.Identity; +import com.azure.resourcemanager.awsconnector.models.IpFamily; +import com.azure.resourcemanager.awsconnector.models.IpFamilyEnumValue; +import com.azure.resourcemanager.awsconnector.models.KubernetesNetworkConfigResponse; +import com.azure.resourcemanager.awsconnector.models.LogSetup; +import com.azure.resourcemanager.awsconnector.models.LogType; +import com.azure.resourcemanager.awsconnector.models.LoggingAutoGenerated; +import com.azure.resourcemanager.awsconnector.models.Oidc; +import com.azure.resourcemanager.awsconnector.models.OutpostConfigResponse; +import com.azure.resourcemanager.awsconnector.models.Provider; +import com.azure.resourcemanager.awsconnector.models.VpcConfigResponse; +import java.time.OffsetDateTime; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for EksClusters CreateOrReplace. + */ +public final class EksClustersCreateOrReplaceSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * EksClusters_CreateOrReplace.json + */ + /** + * Sample code: EksClusters_CreateOrReplace. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void eksClustersCreateOrReplace(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.eksClusters() + .createOrReplace("vutdhhavszx", + new EksClusterInner() + .withProperties( + new EksClusterProperties() + .withAwsProperties(new AwsEksClusterProperties() + .withAccessConfig(new AccessConfigResponse() + .withAuthenticationMode( + new AuthenticationModeEnumValue().withValue(AuthenticationMode.API)) + .withBootstrapClusterCreatorAdminPermissions(true)) + .withArn("hcepxlffwylmwulxcktedclqczlia") + .withCertificateAuthority(new Certificate().withData("tlchvarrjfhilsdtsgqshctlli")) + .withClientRequestToken("fakeTokenPlaceholder") + .withConnectorConfig( + new ConnectorConfigResponse().withActivationCode("fakeTokenPlaceholder") + .withActivationExpiry(OffsetDateTime.parse("2024-10-08T03:50:52.459Z")) + .withActivationId("vmvmutvfuygzczgtsutkls") + .withProvider("ngrakrrq") + .withRoleArn("jcu")) + .withCreatedAt(OffsetDateTime.parse("2024-10-08T03:50:52.460Z")) + .withEncryptionConfig(Arrays.asList(new EncryptionConfig() + .withProvider(new Provider().withKeyArn("fakeTokenPlaceholder")) + .withResources(Arrays.asList("luiywwdjzfsrozikidayeump")))) + .withEndpoint("bvdvtunxiggcpmncdeflirifck") + .withHealth(new ClusterHealth().withIssues(Arrays.asList(new ClusterIssue() + .withCode(new ClusterIssueCodeEnumValue().withValue(ClusterIssueCode.ACCESS_DENIED)) + .withMessage("mwtvogjihbqys") + .withResourceIds(Arrays.asList("gnfkewljeibgooftzbraahnxysx"))))) + .withId("zmnyjrmqynglvrhpkkqkpazfyv") + .withIdentity( + new Identity().withOidc(new Oidc().withIssuer("otiqmbvjucermteuonkxgdftf"))) + .withKubernetesNetworkConfig(new KubernetesNetworkConfigResponse() + .withIpFamily(new IpFamilyEnumValue().withValue(IpFamily.IPV4)) + .withServiceIpv4Cidr("llpoqidqkuhvzzwbkiynhrucvgglk") + .withServiceIpv6Cidr("nfdslge")) + .withLogging(new LoggingAutoGenerated().withClusterLogging(Arrays + .asList(new LogSetup().withEnabled(true).withTypes(Arrays.asList(LogType.API))))) + .withName("fjvxhqvmvbshnltkuozc") + .withOutpostConfig( + new OutpostConfigResponse().withControlPlaneInstanceType("dbqfhwaxdzegqxqopkhaevcs") + .withControlPlanePlacement( + new ControlPlanePlacementResponse().withGroupName("qrpyvhb")) + .withOutpostArns(Arrays.asList("lkvzvf"))) + .withPlatformVersion("ezmalzlqyiuhsxxdribckieg") + .withResourcesVpcConfig( + new VpcConfigResponse().withClusterSecurityGroupId("bkhbpbwyholvjxqzgxngfqvfim") + .withEndpointPrivateAccess(true) + .withEndpointPublicAccess(true) + .withPublicAccessCidrs(Arrays.asList("wjznm")) + .withSecurityGroupIds(Arrays.asList("ljodkq")) + .withSubnetIds(Arrays.asList("pmazpgqowrfoi")) + .withVpcId("eoosrmen")) + .withRoleArn("uvceqehkmdtkxgakuckm") + .withStatus(new ClusterStatusEnumValue().withValue(ClusterStatus.ACTIVE)) + .withTags(mapOf("key783", "fakeTokenPlaceholder")) + .withVersion("ngoffoetqqgv")) + .withPublicCloudConnectorsResourceId("uadwidkemgzwde") + .withAwsAccountId("sebsvgbgzb") + .withArn("xhoylvamhuqnvruh") + .withPublicCloudResourceName("kqeiozkswbnhscn") + .withAwsSourceSchema("gkfmtslfbglu") + .withAwsRegion("urhi") + .withAwsTags(mapOf("key7789", "fakeTokenPlaceholder"))), + com.azure.core.util.Context.NONE); + } + + // Use "Map.of" if available + @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/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/EksClustersDeleteSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/EksClustersDeleteSamples.java new file mode 100644 index 000000000000..75344d33f807 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/EksClustersDeleteSamples.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.awsconnector.generated; + +/** + * Samples for EksClusters Delete. + */ +public final class EksClustersDeleteSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/EksClusters_Delete. + * json + */ + /** + * Sample code: EksClusters_Delete. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void eksClustersDelete(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.eksClusters().delete("vutdhhavszx", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/EksClustersGetSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/EksClustersGetSamples.java new file mode 100644 index 000000000000..062bf362b615 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/EksClustersGetSamples.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.awsconnector.generated; + +/** + * Samples for EksClusters Get. + */ +public final class EksClustersGetSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/EksClusters_Get. + * json + */ + /** + * Sample code: EksClusters_Get. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void eksClustersGet(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.eksClusters().getWithResponse("vutdhhavszx", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/EksClustersListSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/EksClustersListSamples.java new file mode 100644 index 000000000000..944d2d51ee3a --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/EksClustersListSamples.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.awsconnector.generated; + +/** + * Samples for EksClusters List. + */ +public final class EksClustersListSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/EksClusters_List. + * json + */ + /** + * Sample code: EksClusters_List. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void eksClustersList(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.eksClusters().list("vutdhhavszx", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/EksNodegroupsCreateOrReplaceSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/EksNodegroupsCreateOrReplaceSamples.java new file mode 100644 index 000000000000..98957ae34e1e --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/EksNodegroupsCreateOrReplaceSamples.java @@ -0,0 +1,86 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +import com.azure.resourcemanager.awsconnector.models.AwsEksNodegroupProperties; +import com.azure.resourcemanager.awsconnector.models.EksNodegroupProperties; +import com.azure.resourcemanager.awsconnector.models.LaunchTemplateSpecificationAutoGenerated; +import com.azure.resourcemanager.awsconnector.models.RemoteAccess; +import com.azure.resourcemanager.awsconnector.models.ScalingConfig; +import com.azure.resourcemanager.awsconnector.models.Taint; +import com.azure.resourcemanager.awsconnector.models.UpdateConfig; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for EksNodegroups CreateOrReplace. + */ +public final class EksNodegroupsCreateOrReplaceSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * EksNodegroups_CreateOrReplace.json + */ + /** + * Sample code: EksNodegroups_CreateOrReplace. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + eksNodegroupsCreateOrReplace(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.eksNodegroups() + .define("Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])") + .withRegion("qfzxiflpnxiua") + .withExistingResourceGroup("rgeksNodegroup") + .withTags(mapOf("key3889", "fakeTokenPlaceholder")) + .withProperties(new EksNodegroupProperties() + .withAwsProperties(new AwsEksNodegroupProperties().withAmiType("cupzyobvolczhkenpdfcfcqb") + .withArn("shesuqduavivrddwgrqtaukjv") + .withCapacityType("pkzjnsykbn") + .withClusterName("qcbbidlhrczzbp") + .withDiskSize(14) + .withForceUpdateEnabled(true) + .withId("y") + .withInstanceTypes(Arrays.asList("gfy")) + .withLabels(mapOf("key8269", "fakeTokenPlaceholder")) + .withLaunchTemplate(new LaunchTemplateSpecificationAutoGenerated().withId("si") + .withName("gdqcgfql") + .withVersion("lonea")) + .withNodeRole("rzscoljnrtiueunqg") + .withNodegroupName("wipo") + .withReleaseVersion("wbgbpvjsrkscfxkcbuatuirn") + .withRemoteAccess(new RemoteAccess().withEc2SshKey("fakeTokenPlaceholder") + .withSourceSecurityGroups(Arrays.asList("jv"))) + .withScalingConfig(new ScalingConfig().withDesiredSize(2).withMaxSize(22).withMinSize(18)) + .withSubnets(Arrays.asList("jtzrxn")) + .withTags(mapOf("key1070", "fakeTokenPlaceholder")) + .withTaints(Arrays.asList(new Taint().withEffect("cqyaskimdnuadazzlnzdgwjbg") + .withKey("fakeTokenPlaceholder") + .withValue("hfdagmnrdomthxavrf"))) + .withUpdateConfig(new UpdateConfig().withMaxUnavailable(24).withMaxUnavailablePercentage(18)) + .withVersion("pzblimbasgkqgyknilzxktqx")) + .withPublicCloudConnectorsResourceId("val") + .withAwsAccountId("vfdqtwvbpgxbhqwrbowcnz") + .withArn("ckgekeh") + .withPublicCloudResourceName("aybzphomshbbtslocleyyvgcfu") + .withAwsSourceSchema("cizsekmbzwzgaklajexx") + .withAwsRegion("glvfswwditueizhrpfvhiwm") + .withAwsTags(mapOf("key7151", "fakeTokenPlaceholder"))) + .create(); + } + + // Use "Map.of" if available + @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/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/EksNodegroupsDeleteSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/EksNodegroupsDeleteSamples.java new file mode 100644 index 000000000000..183bd0781802 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/EksNodegroupsDeleteSamples.java @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +/** + * Samples for EksNodegroups Delete. + */ +public final class EksNodegroupsDeleteSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * EksNodegroups_Delete.json + */ + /** + * Sample code: EksNodegroups_Delete. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void eksNodegroupsDelete(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.eksNodegroups() + .delete("rgeksNodegroup", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/EksNodegroupsGetByResourceGroupSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/EksNodegroupsGetByResourceGroupSamples.java new file mode 100644 index 000000000000..76007b1f9665 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/EksNodegroupsGetByResourceGroupSamples.java @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +/** + * Samples for EksNodegroups GetByResourceGroup. + */ +public final class EksNodegroupsGetByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/EksNodegroups_Get. + * json + */ + /** + * Sample code: EksNodegroups_Get. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void eksNodegroupsGet(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.eksNodegroups() + .getByResourceGroupWithResponse("rgeksNodegroup", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/EksNodegroupsListByResourceGroupSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/EksNodegroupsListByResourceGroupSamples.java new file mode 100644 index 000000000000..2b0f9bb14383 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/EksNodegroupsListByResourceGroupSamples.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +/** + * Samples for EksNodegroups ListByResourceGroup. + */ +public final class EksNodegroupsListByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * EksNodegroups_ListByResourceGroup.json + */ + /** + * Sample code: EksNodegroups_ListByResourceGroup. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + eksNodegroupsListByResourceGroup(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.eksNodegroups().listByResourceGroup("rgeksNodegroup", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/EksNodegroupsListSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/EksNodegroupsListSamples.java new file mode 100644 index 000000000000..a4dea5dfad0d --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/EksNodegroupsListSamples.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +/** + * Samples for EksNodegroups List. + */ +public final class EksNodegroupsListSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * EksNodegroups_ListBySubscription.json + */ + /** + * Sample code: EksNodegroups_ListBySubscription. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + eksNodegroupsListBySubscription(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.eksNodegroups().list(com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/EksNodegroupsUpdateSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/EksNodegroupsUpdateSamples.java new file mode 100644 index 000000000000..381daa1d0019 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/EksNodegroupsUpdateSamples.java @@ -0,0 +1,45 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +import com.azure.resourcemanager.awsconnector.models.EksNodegroup; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for EksNodegroups Update. + */ +public final class EksNodegroupsUpdateSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * EksNodegroups_Update.json + */ + /** + * Sample code: EksNodegroups_Update. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void eksNodegroupsUpdate(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + EksNodegroup resource = manager.eksNodegroups() + .getByResourceGroupWithResponse("rgeksNodegroup", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE) + .getValue(); + resource.update().withTags(mapOf("key2267", "fakeTokenPlaceholder")).apply(); + } + + // Use "Map.of" if available + @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/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/ElasticBeanstalkApplicationsCreateOrReplaceSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/ElasticBeanstalkApplicationsCreateOrReplaceSamples.java new file mode 100644 index 000000000000..a0a6b3d750b8 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/ElasticBeanstalkApplicationsCreateOrReplaceSamples.java @@ -0,0 +1,68 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +import com.azure.resourcemanager.awsconnector.models.ApplicationResourceLifecycleConfig; +import com.azure.resourcemanager.awsconnector.models.ApplicationVersionLifecycleConfig; +import com.azure.resourcemanager.awsconnector.models.AwsElasticBeanstalkApplicationProperties; +import com.azure.resourcemanager.awsconnector.models.ElasticBeanstalkApplicationProperties; +import com.azure.resourcemanager.awsconnector.models.MaxAgeRule; +import com.azure.resourcemanager.awsconnector.models.MaxCountRule; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for ElasticBeanstalkApplications CreateOrReplace. + */ +public final class ElasticBeanstalkApplicationsCreateOrReplaceSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * ElasticBeanstalkApplications_CreateOrReplace.json + */ + /** + * Sample code: ElasticBeanstalkApplications_CreateOrReplace. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void elasticBeanstalkApplicationsCreateOrReplace( + com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.elasticBeanstalkApplications() + .define("Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])") + .withRegion("iiedtydxzeyayiwanytnqwn") + .withExistingResourceGroup("rgelasticBeanstalkApplication") + .withTags(mapOf("key8088", "fakeTokenPlaceholder")) + .withProperties(new ElasticBeanstalkApplicationProperties() + .withAwsProperties(new AwsElasticBeanstalkApplicationProperties() + .withApplicationName("lrxgvxoicfhhixebp") + .withDescription("a") + .withResourceLifecycleConfig(new ApplicationResourceLifecycleConfig().withServiceRole("buibidzp") + .withVersionLifecycleConfig(new ApplicationVersionLifecycleConfig() + .withMaxAgeRule( + new MaxAgeRule().withDeleteSourceFromS3(true).withEnabled(true).withMaxAgeInDays(5)) + .withMaxCountRule( + new MaxCountRule().withDeleteSourceFromS3(true).withEnabled(true).withMaxCount(14))))) + .withPublicCloudConnectorsResourceId("echppxwpbpqnasbem") + .withAwsAccountId("xrjnzzimbdnoqnbzpppxas") + .withArn("yautrhxbrmk") + .withPublicCloudResourceName("nkyqyjvezjhltbpdnnxr") + .withAwsSourceSchema("or") + .withAwsRegion("wxoiinzpqpanl") + .withAwsTags(mapOf("key4469", "fakeTokenPlaceholder"))) + .create(); + } + + // Use "Map.of" if available + @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/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/ElasticBeanstalkApplicationsDeleteSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/ElasticBeanstalkApplicationsDeleteSamples.java new file mode 100644 index 000000000000..c0fac418634c --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/ElasticBeanstalkApplicationsDeleteSamples.java @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +/** + * Samples for ElasticBeanstalkApplications Delete. + */ +public final class ElasticBeanstalkApplicationsDeleteSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * ElasticBeanstalkApplications_Delete.json + */ + /** + * Sample code: ElasticBeanstalkApplications_Delete. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + elasticBeanstalkApplicationsDelete(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.elasticBeanstalkApplications() + .delete("rgelasticBeanstalkApplication", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/ElasticBeanstalkApplicationsGetByResourceGroupSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/ElasticBeanstalkApplicationsGetByResourceGroupSamples.java new file mode 100644 index 000000000000..034a374717e3 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/ElasticBeanstalkApplicationsGetByResourceGroupSamples.java @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +/** + * Samples for ElasticBeanstalkApplications GetByResourceGroup. + */ +public final class ElasticBeanstalkApplicationsGetByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * ElasticBeanstalkApplications_Get.json + */ + /** + * Sample code: ElasticBeanstalkApplications_Get. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + elasticBeanstalkApplicationsGet(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.elasticBeanstalkApplications() + .getByResourceGroupWithResponse("rgelasticBeanstalkApplication", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/ElasticBeanstalkApplicationsListByResourceGroupSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/ElasticBeanstalkApplicationsListByResourceGroupSamples.java new file mode 100644 index 000000000000..120d14b525c0 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/ElasticBeanstalkApplicationsListByResourceGroupSamples.java @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +/** + * Samples for ElasticBeanstalkApplications ListByResourceGroup. + */ +public final class ElasticBeanstalkApplicationsListByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * ElasticBeanstalkApplications_ListByResourceGroup.json + */ + /** + * Sample code: ElasticBeanstalkApplications_ListByResourceGroup. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void elasticBeanstalkApplicationsListByResourceGroup( + com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.elasticBeanstalkApplications() + .listByResourceGroup("rgelasticBeanstalkApplication", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/ElasticBeanstalkApplicationsListSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/ElasticBeanstalkApplicationsListSamples.java new file mode 100644 index 000000000000..2b98b89579ad --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/ElasticBeanstalkApplicationsListSamples.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +/** + * Samples for ElasticBeanstalkApplications List. + */ +public final class ElasticBeanstalkApplicationsListSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * ElasticBeanstalkApplications_ListBySubscription.json + */ + /** + * Sample code: ElasticBeanstalkApplications_ListBySubscription. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void elasticBeanstalkApplicationsListBySubscription( + com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.elasticBeanstalkApplications().list(com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/ElasticBeanstalkApplicationsUpdateSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/ElasticBeanstalkApplicationsUpdateSamples.java new file mode 100644 index 000000000000..b53de0c32e4c --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/ElasticBeanstalkApplicationsUpdateSamples.java @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +import com.azure.resourcemanager.awsconnector.models.ElasticBeanstalkApplication; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for ElasticBeanstalkApplications Update. + */ +public final class ElasticBeanstalkApplicationsUpdateSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * ElasticBeanstalkApplications_Update.json + */ + /** + * Sample code: ElasticBeanstalkApplications_Update. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + elasticBeanstalkApplicationsUpdate(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + ElasticBeanstalkApplication resource = manager.elasticBeanstalkApplications() + .getByResourceGroupWithResponse("rgelasticBeanstalkApplication", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE) + .getValue(); + resource.update().withTags(mapOf("key483", "fakeTokenPlaceholder")).apply(); + } + + // Use "Map.of" if available + @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/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/ElasticBeanstalkConfigurationTemplatesCreateOrReplaceSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/ElasticBeanstalkConfigurationTemplatesCreateOrReplaceSamples.java new file mode 100644 index 000000000000..19c299563030 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/ElasticBeanstalkConfigurationTemplatesCreateOrReplaceSamples.java @@ -0,0 +1,72 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +import com.azure.resourcemanager.awsconnector.models.AwsElasticBeanstalkConfigurationTemplateProperties; +import com.azure.resourcemanager.awsconnector.models.ConfigurationOptionSetting; +import com.azure.resourcemanager.awsconnector.models.ElasticBeanstalkConfigurationTemplateProperties; +import com.azure.resourcemanager.awsconnector.models.SourceConfiguration; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for ElasticBeanstalkConfigurationTemplates CreateOrReplace. + */ +public final class ElasticBeanstalkConfigurationTemplatesCreateOrReplaceSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * ElasticBeanstalkConfigurationTemplates_CreateOrReplace.json + */ + /** + * Sample code: ElasticBeanstalkConfigurationTemplates_CreateOrReplace. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void elasticBeanstalkConfigurationTemplatesCreateOrReplace( + com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.elasticBeanstalkConfigurationTemplates() + .define("Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])") + .withRegion("zzrrrcfibirqbvvfobbhmdfw") + .withExistingResourceGroup("rgelasticBeanstalkConfigurationTemplate") + .withTags(mapOf("key9826", "fakeTokenPlaceholder")) + .withProperties(new ElasticBeanstalkConfigurationTemplateProperties() + .withAwsProperties( + new AwsElasticBeanstalkConfigurationTemplateProperties().withApplicationName("cectxkagk") + .withDescription("f") + .withEnvironmentId("irk") + .withOptionSettings( + Arrays.asList(new ConfigurationOptionSetting().withNamespace("wqnwnaqljiuphwrslzv") + .withOptionName("jutnzi") + .withResourceName("cxxafxqqeda") + .withValue("auojwoarknbok"))) + .withPlatformArn("shxv") + .withSolutionStackName("ytiftttvorpjlkspzoqxnv") + .withSourceConfiguration(new SourceConfiguration().withApplicationName("gxvqqvuzcufyvzeguns") + .withTemplateName("eajnqnevlyqrtelgeur")) + .withTemplateName("fjixtzihey")) + .withPublicCloudConnectorsResourceId("ezxdkcckcqzvdvfjkioqer") + .withAwsAccountId("eedsjtwxrqaahfnsjwvrxnzerudq") + .withArn("jnsnkdqnxzjvxlitgjtzledfqpwd") + .withPublicCloudResourceName("lgdolpeaabdfynczxxux") + .withAwsSourceSchema("ehzbquzqlgoysykmpkmfu") + .withAwsRegion("timidysdqvjb") + .withAwsTags(mapOf("key1871", "fakeTokenPlaceholder"))) + .create(); + } + + // Use "Map.of" if available + @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/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/ElasticBeanstalkConfigurationTemplatesDeleteSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/ElasticBeanstalkConfigurationTemplatesDeleteSamples.java new file mode 100644 index 000000000000..2408602ea4ff --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/ElasticBeanstalkConfigurationTemplatesDeleteSamples.java @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +/** + * Samples for ElasticBeanstalkConfigurationTemplates Delete. + */ +public final class ElasticBeanstalkConfigurationTemplatesDeleteSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * ElasticBeanstalkConfigurationTemplates_Delete.json + */ + /** + * Sample code: ElasticBeanstalkConfigurationTemplates_Delete. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void elasticBeanstalkConfigurationTemplatesDelete( + com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.elasticBeanstalkConfigurationTemplates() + .delete("rgelasticBeanstalkConfigurationTemplate", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/ElasticBeanstalkConfigurationTemplatesGetByResourceGroupSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/ElasticBeanstalkConfigurationTemplatesGetByResourceGroupSamples.java new file mode 100644 index 000000000000..0434d3b3e098 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/ElasticBeanstalkConfigurationTemplatesGetByResourceGroupSamples.java @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +/** + * Samples for ElasticBeanstalkConfigurationTemplates GetByResourceGroup. + */ +public final class ElasticBeanstalkConfigurationTemplatesGetByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * ElasticBeanstalkConfigurationTemplates_Get.json + */ + /** + * Sample code: ElasticBeanstalkConfigurationTemplates_Get. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + elasticBeanstalkConfigurationTemplatesGet(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.elasticBeanstalkConfigurationTemplates() + .getByResourceGroupWithResponse("rgelasticBeanstalkConfigurationTemplate", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/ElasticBeanstalkConfigurationTemplatesListByResourceGroupSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/ElasticBeanstalkConfigurationTemplatesListByResourceGroupSamples.java new file mode 100644 index 000000000000..4de632880957 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/ElasticBeanstalkConfigurationTemplatesListByResourceGroupSamples.java @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +/** + * Samples for ElasticBeanstalkConfigurationTemplates ListByResourceGroup. + */ +public final class ElasticBeanstalkConfigurationTemplatesListByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * ElasticBeanstalkConfigurationTemplates_ListByResourceGroup.json + */ + /** + * Sample code: ElasticBeanstalkConfigurationTemplates_ListByResourceGroup. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void elasticBeanstalkConfigurationTemplatesListByResourceGroup( + com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.elasticBeanstalkConfigurationTemplates() + .listByResourceGroup("rgelasticBeanstalkConfigurationTemplate", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/ElasticBeanstalkConfigurationTemplatesListSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/ElasticBeanstalkConfigurationTemplatesListSamples.java new file mode 100644 index 000000000000..ba2cc1e25b7b --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/ElasticBeanstalkConfigurationTemplatesListSamples.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +/** + * Samples for ElasticBeanstalkConfigurationTemplates List. + */ +public final class ElasticBeanstalkConfigurationTemplatesListSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * ElasticBeanstalkConfigurationTemplates_ListBySubscription.json + */ + /** + * Sample code: ElasticBeanstalkConfigurationTemplates_ListBySubscription. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void elasticBeanstalkConfigurationTemplatesListBySubscription( + com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.elasticBeanstalkConfigurationTemplates().list(com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/ElasticBeanstalkConfigurationTemplatesUpdateSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/ElasticBeanstalkConfigurationTemplatesUpdateSamples.java new file mode 100644 index 000000000000..1f4b1d4432ef --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/ElasticBeanstalkConfigurationTemplatesUpdateSamples.java @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +import com.azure.resourcemanager.awsconnector.models.ElasticBeanstalkConfigurationTemplate; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for ElasticBeanstalkConfigurationTemplates Update. + */ +public final class ElasticBeanstalkConfigurationTemplatesUpdateSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * ElasticBeanstalkConfigurationTemplates_Update.json + */ + /** + * Sample code: ElasticBeanstalkConfigurationTemplates_Update. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void elasticBeanstalkConfigurationTemplatesUpdate( + com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + ElasticBeanstalkConfigurationTemplate resource = manager.elasticBeanstalkConfigurationTemplates() + .getByResourceGroupWithResponse("rgelasticBeanstalkConfigurationTemplate", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE) + .getValue(); + resource.update().withTags(mapOf("key5550", "fakeTokenPlaceholder")).apply(); + } + + // Use "Map.of" if available + @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/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/ElasticBeanstalkEnvironmentsCreateOrReplaceSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/ElasticBeanstalkEnvironmentsCreateOrReplaceSamples.java new file mode 100644 index 000000000000..5cb78c95585e --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/ElasticBeanstalkEnvironmentsCreateOrReplaceSamples.java @@ -0,0 +1,79 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +import com.azure.resourcemanager.awsconnector.models.AwsElasticBeanstalkEnvironmentProperties; +import com.azure.resourcemanager.awsconnector.models.ElasticBeanstalkEnvironmentProperties; +import com.azure.resourcemanager.awsconnector.models.OptionSetting; +import com.azure.resourcemanager.awsconnector.models.TagAutoGenerated28; +import com.azure.resourcemanager.awsconnector.models.TierAutoGenerated; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for ElasticBeanstalkEnvironments CreateOrReplace. + */ +public final class ElasticBeanstalkEnvironmentsCreateOrReplaceSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * ElasticBeanstalkEnvironments_CreateOrReplace.json + */ + /** + * Sample code: ElasticBeanstalkEnvironments_CreateOrReplace. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void elasticBeanstalkEnvironmentsCreateOrReplace( + com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.elasticBeanstalkEnvironments() + .define("Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])") + .withRegion("rcicwrhnehybtulvvctkoqfjwtknlq") + .withExistingResourceGroup("rgelasticBeanstalkEnvironment") + .withTags(mapOf("key2096", "fakeTokenPlaceholder")) + .withProperties(new ElasticBeanstalkEnvironmentProperties() + .withAwsProperties( + new AwsElasticBeanstalkEnvironmentProperties().withApplicationName("zymlvasjtynhgbrykr") + .withCnamePrefix("evct") + .withDescription("uofhhpwsesygrtmyfvurdgtuncytpq") + .withEndpointUrl("thvydn") + .withEnvironmentName("kpogmhzunuicnzwhvcwybzmj") + .withOperationsRole("awulopnqdubztsjuoqwcebjgf") + .withOptionSettings(Arrays.asList(new OptionSetting().withNamespace("fvkbdiiopsoi") + .withOptionName("nmgnqhutdmmirjbbbhdrgba") + .withResourceName("qobeconagmalvwfyfrnx") + .withValue("ucdijfyhnuwhsuqo"))) + .withPlatformArn("ectglmsyrgcycywivrpuxvm") + .withSolutionStackName("gctjcbflipsc") + .withTags(Arrays.asList(new TagAutoGenerated28().withKey("fakeTokenPlaceholder") + .withValue("hhfcrfaprtppmnzutomhlsnyoxalm"))) + .withTemplateName("fnmdsebgrdkpatpiic") + .withTier(new TierAutoGenerated().withName("gxxmgofbfkkvxbrrxxuhnpqortbs") + .withType("qxjdncodnwucwrbgx") + .withVersion("viernervectbejorfdi")) + .withVersionLabel("xkovoldnwteogliidadchizalspob")) + .withPublicCloudConnectorsResourceId("ms") + .withAwsAccountId("ckcntjjdjmmpwsiaecavfwo") + .withArn("zmjeppob") + .withPublicCloudResourceName("dmmydqwtpsruhsd") + .withAwsSourceSchema("jkxtmyhfrvbuoheuscaxhmlm") + .withAwsRegion("mvc") + .withAwsTags(mapOf("key2939", "fakeTokenPlaceholder"))) + .create(); + } + + // Use "Map.of" if available + @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/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/ElasticBeanstalkEnvironmentsDeleteSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/ElasticBeanstalkEnvironmentsDeleteSamples.java new file mode 100644 index 000000000000..5b4e880f2f6b --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/ElasticBeanstalkEnvironmentsDeleteSamples.java @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +/** + * Samples for ElasticBeanstalkEnvironments Delete. + */ +public final class ElasticBeanstalkEnvironmentsDeleteSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * ElasticBeanstalkEnvironments_Delete.json + */ + /** + * Sample code: ElasticBeanstalkEnvironments_Delete. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + elasticBeanstalkEnvironmentsDelete(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.elasticBeanstalkEnvironments() + .delete("rgelasticBeanstalkEnvironment", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/ElasticBeanstalkEnvironmentsGetByResourceGroupSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/ElasticBeanstalkEnvironmentsGetByResourceGroupSamples.java new file mode 100644 index 000000000000..939733d63e98 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/ElasticBeanstalkEnvironmentsGetByResourceGroupSamples.java @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +/** + * Samples for ElasticBeanstalkEnvironments GetByResourceGroup. + */ +public final class ElasticBeanstalkEnvironmentsGetByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * ElasticBeanstalkEnvironments_Get.json + */ + /** + * Sample code: ElasticBeanstalkEnvironments_Get. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + elasticBeanstalkEnvironmentsGet(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.elasticBeanstalkEnvironments() + .getByResourceGroupWithResponse("rgelasticBeanstalkEnvironment", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/ElasticBeanstalkEnvironmentsListByResourceGroupSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/ElasticBeanstalkEnvironmentsListByResourceGroupSamples.java new file mode 100644 index 000000000000..86b40b0e12b6 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/ElasticBeanstalkEnvironmentsListByResourceGroupSamples.java @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +/** + * Samples for ElasticBeanstalkEnvironments ListByResourceGroup. + */ +public final class ElasticBeanstalkEnvironmentsListByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * ElasticBeanstalkEnvironments_ListByResourceGroup.json + */ + /** + * Sample code: ElasticBeanstalkEnvironments_ListByResourceGroup. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void elasticBeanstalkEnvironmentsListByResourceGroup( + com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.elasticBeanstalkEnvironments() + .listByResourceGroup("rgelasticBeanstalkEnvironment", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/ElasticBeanstalkEnvironmentsListSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/ElasticBeanstalkEnvironmentsListSamples.java new file mode 100644 index 000000000000..7e56a66f4b21 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/ElasticBeanstalkEnvironmentsListSamples.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +/** + * Samples for ElasticBeanstalkEnvironments List. + */ +public final class ElasticBeanstalkEnvironmentsListSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * ElasticBeanstalkEnvironments_ListBySubscription.json + */ + /** + * Sample code: ElasticBeanstalkEnvironments_ListBySubscription. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void elasticBeanstalkEnvironmentsListBySubscription( + com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.elasticBeanstalkEnvironments().list(com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/ElasticBeanstalkEnvironmentsUpdateSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/ElasticBeanstalkEnvironmentsUpdateSamples.java new file mode 100644 index 000000000000..a6067925abf5 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/ElasticBeanstalkEnvironmentsUpdateSamples.java @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +import com.azure.resourcemanager.awsconnector.models.ElasticBeanstalkEnvironment; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for ElasticBeanstalkEnvironments Update. + */ +public final class ElasticBeanstalkEnvironmentsUpdateSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * ElasticBeanstalkEnvironments_Update.json + */ + /** + * Sample code: ElasticBeanstalkEnvironments_Update. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + elasticBeanstalkEnvironmentsUpdate(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + ElasticBeanstalkEnvironment resource = manager.elasticBeanstalkEnvironments() + .getByResourceGroupWithResponse("rgelasticBeanstalkEnvironment", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE) + .getValue(); + resource.update().withTags(mapOf("key4897", "fakeTokenPlaceholder")).apply(); + } + + // Use "Map.of" if available + @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/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/ElasticLoadBalancingV2ListenersCreateOrReplaceSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/ElasticLoadBalancingV2ListenersCreateOrReplaceSamples.java new file mode 100644 index 000000000000..b51d5eadb831 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/ElasticLoadBalancingV2ListenersCreateOrReplaceSamples.java @@ -0,0 +1,126 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +import com.azure.resourcemanager.awsconnector.models.ActionAutoGenerated; +import com.azure.resourcemanager.awsconnector.models.AuthenticateCognitoConfig; +import com.azure.resourcemanager.awsconnector.models.AuthenticateOidcConfig; +import com.azure.resourcemanager.awsconnector.models.AwsElasticLoadBalancingV2ListenerProperties; +import com.azure.resourcemanager.awsconnector.models.CertificateAutoGenerated; +import com.azure.resourcemanager.awsconnector.models.ElasticLoadBalancingV2ListenerProperties; +import com.azure.resourcemanager.awsconnector.models.FixedResponseConfig; +import com.azure.resourcemanager.awsconnector.models.ForwardConfig; +import com.azure.resourcemanager.awsconnector.models.MutualAuthentication; +import com.azure.resourcemanager.awsconnector.models.RedirectConfig; +import com.azure.resourcemanager.awsconnector.models.TargetGroupStickinessConfig; +import com.azure.resourcemanager.awsconnector.models.TargetGroupTuple; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for ElasticLoadBalancingV2Listeners CreateOrReplace. + */ +public final class ElasticLoadBalancingV2ListenersCreateOrReplaceSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * ElasticLoadBalancingV2Listeners_CreateOrReplace.json + */ + /** + * Sample code: ElasticLoadBalancingV2Listeners_CreateOrReplace. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void elasticLoadBalancingV2ListenersCreateOrReplace( + com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.elasticLoadBalancingV2Listeners() + .define("Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])") + .withRegion("ynyltffflqszrlkr") + .withExistingResourceGroup("rgelasticLoadBalancingV2Listener") + .withTags(mapOf("key1120", "fakeTokenPlaceholder")) + .withProperties( + new ElasticLoadBalancingV2ListenerProperties() + .withAwsProperties( + new AwsElasticLoadBalancingV2ListenerProperties() + .withAlpnPolicy(Arrays.asList("tznuapvprovrolljpcrptvkhjpl")) + .withCertificates(Arrays + .asList(new CertificateAutoGenerated().withCertificateArn("mfdqcjinbzrxinpbkmpjj"))) + .withDefaultActions( + Arrays + .asList(new ActionAutoGenerated() + .withAuthenticateCognitoConfig(new AuthenticateCognitoConfig() + .withAuthenticationRequestExtraParams( + mapOf("key2864", "fakeTokenPlaceholder")) + .withOnUnauthenticatedRequest("ewqmcevolmfvchwcrm") + .withScope("wtpexcocbnkypesnfwkvyxetj") + .withSessionCookieName("whrieoypkjqsclmgqsiuohq") + .withSessionTimeout("ujvfjimalwitusxfyglnihdh") + .withUserPoolArn("ilqdawi") + .withUserPoolClientId("dmzhlfrfqmoa") + .withUserPoolDomain("jkxwfnqp")) + .withAuthenticateOidcConfig(new AuthenticateOidcConfig() + .withAuthenticationRequestExtraParams( + mapOf("key4917", "fakeTokenPlaceholder")) + .withAuthorizationEndpoint("fakeTokenPlaceholder") + .withClientId("u") + .withClientSecret("fakeTokenPlaceholder") + .withIssuer("jkfpddkgzwiakaobaydiwrztixoef") + .withOnUnauthenticatedRequest("yppxrruimvmjjajglsmxnwlif") + .withScope("loh") + .withSessionCookieName("tmhjastblgrrlqnxqeiccoez") + .withSessionTimeout("rkwdmahwrhgsxev") + .withTokenEndpoint("fakeTokenPlaceholder") + .withUseExistingClientSecret(true) + .withUserInfoEndpoint("kbv")) + .withFixedResponseConfig(new FixedResponseConfig() + .withContentType("xxmkkjulvromwbljdvzinagjmmvizg") + .withMessageBody("u") + .withStatusCode("fakeTokenPlaceholder")) + .withForwardConfig(new ForwardConfig().withTargetGroupStickinessConfig( + new TargetGroupStickinessConfig().withDurationSeconds(25).withEnabled(true)) + .withTargetGroups(Arrays.asList(new TargetGroupTuple() + .withTargetGroupArn("tqmikgktkjddfsirlrzderquhjmlsj") + .withWeight(30)))) + .withOrder(1) + .withRedirectConfig( + new RedirectConfig().withHost("zbwhrrxamywhpcrcwnlftloenhgubz") + .withPath("uifuyulnhelvgkkgzohuzn") + .withPort("objmskuxfeanqv") + .withProtocol("zmhfuhzhytveuveux") + .withQuery("kdbtsctjnajoummjgyigqnnuhnmjk") + .withStatusCode("fakeTokenPlaceholder")) + .withTargetGroupArn("sqtnjzhlqyavpkkxqky") + .withType("yqmcnd"))) + .withListenerArn("nbgkbxgvqooycwaj") + .withLoadBalancerArn("yktlh") + .withMutualAuthentication(new MutualAuthentication().withIgnoreClientCertificateExpiry(true) + .withMode("byoxnzjdbatjjyheiqtxy") + .withTrustStoreArn("mxmhj")) + .withPort(26) + .withProtocol("vac") + .withSslPolicy("oqzcjbvjkvuleoixcyfexaam")) + .withPublicCloudConnectorsResourceId("c") + .withAwsAccountId("ikmnykytjq") + .withArn("cxn") + .withPublicCloudResourceName("ukdphfdtbdvfyuswafgdhapeioe") + .withAwsSourceSchema("fj") + .withAwsRegion("uwrcdgkifqubmtwrzvuvfmeaaght") + .withAwsTags(mapOf("key9655", "fakeTokenPlaceholder"))) + .create(); + } + + // Use "Map.of" if available + @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/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/ElasticLoadBalancingV2ListenersDeleteSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/ElasticLoadBalancingV2ListenersDeleteSamples.java new file mode 100644 index 000000000000..cbe21ac7b3ba --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/ElasticLoadBalancingV2ListenersDeleteSamples.java @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +/** + * Samples for ElasticLoadBalancingV2Listeners Delete. + */ +public final class ElasticLoadBalancingV2ListenersDeleteSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * ElasticLoadBalancingV2Listeners_Delete.json + */ + /** + * Sample code: ElasticLoadBalancingV2Listeners_Delete. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + elasticLoadBalancingV2ListenersDelete(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.elasticLoadBalancingV2Listeners() + .delete("rgelasticLoadBalancingV2Listener", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/ElasticLoadBalancingV2ListenersGetByResourceGroupSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/ElasticLoadBalancingV2ListenersGetByResourceGroupSamples.java new file mode 100644 index 000000000000..5de4486f0c26 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/ElasticLoadBalancingV2ListenersGetByResourceGroupSamples.java @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +/** + * Samples for ElasticLoadBalancingV2Listeners GetByResourceGroup. + */ +public final class ElasticLoadBalancingV2ListenersGetByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * ElasticLoadBalancingV2Listeners_Get.json + */ + /** + * Sample code: ElasticLoadBalancingV2Listeners_Get. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + elasticLoadBalancingV2ListenersGet(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.elasticLoadBalancingV2Listeners() + .getByResourceGroupWithResponse("rgelasticLoadBalancingV2Listener", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/ElasticLoadBalancingV2ListenersListByResourceGroupSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/ElasticLoadBalancingV2ListenersListByResourceGroupSamples.java new file mode 100644 index 000000000000..9890ae28e0bb --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/ElasticLoadBalancingV2ListenersListByResourceGroupSamples.java @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +/** + * Samples for ElasticLoadBalancingV2Listeners ListByResourceGroup. + */ +public final class ElasticLoadBalancingV2ListenersListByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * ElasticLoadBalancingV2Listeners_ListByResourceGroup.json + */ + /** + * Sample code: ElasticLoadBalancingV2Listeners_ListByResourceGroup. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void elasticLoadBalancingV2ListenersListByResourceGroup( + com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.elasticLoadBalancingV2Listeners() + .listByResourceGroup("rgelasticLoadBalancingV2Listener", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/ElasticLoadBalancingV2ListenersListSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/ElasticLoadBalancingV2ListenersListSamples.java new file mode 100644 index 000000000000..88e24db320f9 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/ElasticLoadBalancingV2ListenersListSamples.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +/** + * Samples for ElasticLoadBalancingV2Listeners List. + */ +public final class ElasticLoadBalancingV2ListenersListSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * ElasticLoadBalancingV2Listeners_ListBySubscription.json + */ + /** + * Sample code: ElasticLoadBalancingV2Listeners_ListBySubscription. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void elasticLoadBalancingV2ListenersListBySubscription( + com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.elasticLoadBalancingV2Listeners().list(com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/ElasticLoadBalancingV2ListenersUpdateSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/ElasticLoadBalancingV2ListenersUpdateSamples.java new file mode 100644 index 000000000000..61143a855e25 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/ElasticLoadBalancingV2ListenersUpdateSamples.java @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +import com.azure.resourcemanager.awsconnector.models.ElasticLoadBalancingV2Listener; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for ElasticLoadBalancingV2Listeners Update. + */ +public final class ElasticLoadBalancingV2ListenersUpdateSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * ElasticLoadBalancingV2Listeners_Update.json + */ + /** + * Sample code: ElasticLoadBalancingV2Listeners_Update. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + elasticLoadBalancingV2ListenersUpdate(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + ElasticLoadBalancingV2Listener resource = manager.elasticLoadBalancingV2Listeners() + .getByResourceGroupWithResponse("rgelasticLoadBalancingV2Listener", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE) + .getValue(); + resource.update().withTags(mapOf("key1036", "fakeTokenPlaceholder")).apply(); + } + + // Use "Map.of" if available + @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/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/ElasticLoadBalancingV2LoadBalancersCreateOrReplaceSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/ElasticLoadBalancingV2LoadBalancersCreateOrReplaceSamples.java new file mode 100644 index 000000000000..0297733b5f2f --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/ElasticLoadBalancingV2LoadBalancersCreateOrReplaceSamples.java @@ -0,0 +1,80 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +import com.azure.resourcemanager.awsconnector.models.AwsElasticLoadBalancingV2LoadBalancerProperties; +import com.azure.resourcemanager.awsconnector.models.ElasticLoadBalancingV2LoadBalancerProperties; +import com.azure.resourcemanager.awsconnector.models.LoadBalancerAttribute; +import com.azure.resourcemanager.awsconnector.models.SubnetMapping; +import com.azure.resourcemanager.awsconnector.models.TagAutoGenerated29; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for ElasticLoadBalancingV2LoadBalancers CreateOrReplace. + */ +public final class ElasticLoadBalancingV2LoadBalancersCreateOrReplaceSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * ElasticLoadBalancingV2LoadBalancers_CreateOrReplace.json + */ + /** + * Sample code: ElasticLoadBalancingV2LoadBalancers_CreateOrReplace. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void elasticLoadBalancingV2LoadBalancersCreateOrReplace( + com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.elasticLoadBalancingV2LoadBalancers() + .define("Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])") + .withRegion("zrpnzixidbktdxtkovhvkklslaw") + .withExistingResourceGroup("rgelasticLoadBalancingV2LoadBalancer") + .withTags(mapOf("key4383", "fakeTokenPlaceholder")) + .withProperties(new ElasticLoadBalancingV2LoadBalancerProperties() + .withAwsProperties(new AwsElasticLoadBalancingV2LoadBalancerProperties() + .withCanonicalHostedZoneId("cpniwdbqzfxrbtnzkthjyohnbtq") + .withDnsName("mafoyhxa") + .withEnforceSecurityGroupInboundRulesOnPrivateLinkTraffic("gsefdpgmvnyizvpidgxdedsusstsmi") + .withIpAddressType("ghelcjykqvyqrwtwydiwleni") + .withLoadBalancerArn("tswueurcdm") + .withLoadBalancerAttributes(Arrays.asList( + new LoadBalancerAttribute().withKey("fakeTokenPlaceholder").withValue("cbsgvwtlyhuclvjpye"))) + .withLoadBalancerFullName("kmxzisdeike") + .withLoadBalancerName("bdspilcwdpibhmnlbygrgaebhvbz") + .withName("erwqxzfowfkksnodfytvnnyefbdsc") + .withScheme("nqjwo") + .withSecurityGroups(Arrays.asList("tavqrnlv")) + .withSubnetMappings(Arrays.asList(new SubnetMapping().withAllocationId("dkrqwrzo") + .withIPv6Address("mglejntagkkkioov") + .withPrivateIPv4Address("furnpiatzewmpnhapicnfy") + .withSubnetId("igo"))) + .withSubnets(Arrays.asList("xqblkoljy")) + .withTags(Arrays.asList( + new TagAutoGenerated29().withKey("fakeTokenPlaceholder").withValue("vxqjrslimcsyqfkfmjiqjcht"))) + .withType("ywggrkrojayvb")) + .withPublicCloudConnectorsResourceId("udwcmojnxevoeyr") + .withAwsAccountId("eopxqyapnygxz") + .withArn("kojgsx") + .withPublicCloudResourceName("oicaxqhgvlybdl") + .withAwsSourceSchema("lnmi") + .withAwsRegion("dplxwlbvhvz") + .withAwsTags(mapOf("key1771", "fakeTokenPlaceholder"))) + .create(); + } + + // Use "Map.of" if available + @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/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/ElasticLoadBalancingV2LoadBalancersDeleteSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/ElasticLoadBalancingV2LoadBalancersDeleteSamples.java new file mode 100644 index 000000000000..8a2e29c89d75 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/ElasticLoadBalancingV2LoadBalancersDeleteSamples.java @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +/** + * Samples for ElasticLoadBalancingV2LoadBalancers Delete. + */ +public final class ElasticLoadBalancingV2LoadBalancersDeleteSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * ElasticLoadBalancingV2LoadBalancers_Delete.json + */ + /** + * Sample code: ElasticLoadBalancingV2LoadBalancers_Delete. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + elasticLoadBalancingV2LoadBalancersDelete(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.elasticLoadBalancingV2LoadBalancers() + .delete("rgelasticLoadBalancingV2LoadBalancer", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/ElasticLoadBalancingV2LoadBalancersGetByResourceGroupSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/ElasticLoadBalancingV2LoadBalancersGetByResourceGroupSamples.java new file mode 100644 index 000000000000..bbcafa8a8fa4 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/ElasticLoadBalancingV2LoadBalancersGetByResourceGroupSamples.java @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +/** + * Samples for ElasticLoadBalancingV2LoadBalancers GetByResourceGroup. + */ +public final class ElasticLoadBalancingV2LoadBalancersGetByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * ElasticLoadBalancingV2LoadBalancers_Get.json + */ + /** + * Sample code: ElasticLoadBalancingV2LoadBalancers_Get. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + elasticLoadBalancingV2LoadBalancersGet(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.elasticLoadBalancingV2LoadBalancers() + .getByResourceGroupWithResponse("rgelasticLoadBalancingV2LoadBalancer", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/ElasticLoadBalancingV2LoadBalancersListByResourceGroupSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/ElasticLoadBalancingV2LoadBalancersListByResourceGroupSamples.java new file mode 100644 index 000000000000..af5af43aea07 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/ElasticLoadBalancingV2LoadBalancersListByResourceGroupSamples.java @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +/** + * Samples for ElasticLoadBalancingV2LoadBalancers ListByResourceGroup. + */ +public final class ElasticLoadBalancingV2LoadBalancersListByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * ElasticLoadBalancingV2LoadBalancers_ListByResourceGroup.json + */ + /** + * Sample code: ElasticLoadBalancingV2LoadBalancers_ListByResourceGroup. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void elasticLoadBalancingV2LoadBalancersListByResourceGroup( + com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.elasticLoadBalancingV2LoadBalancers() + .listByResourceGroup("rgelasticLoadBalancingV2LoadBalancer", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/ElasticLoadBalancingV2LoadBalancersListSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/ElasticLoadBalancingV2LoadBalancersListSamples.java new file mode 100644 index 000000000000..b271e4230db8 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/ElasticLoadBalancingV2LoadBalancersListSamples.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +/** + * Samples for ElasticLoadBalancingV2LoadBalancers List. + */ +public final class ElasticLoadBalancingV2LoadBalancersListSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * ElasticLoadBalancingV2LoadBalancers_ListBySubscription.json + */ + /** + * Sample code: ElasticLoadBalancingV2LoadBalancers_ListBySubscription. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void elasticLoadBalancingV2LoadBalancersListBySubscription( + com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.elasticLoadBalancingV2LoadBalancers().list(com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/ElasticLoadBalancingV2LoadBalancersUpdateSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/ElasticLoadBalancingV2LoadBalancersUpdateSamples.java new file mode 100644 index 000000000000..5fd9e5266563 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/ElasticLoadBalancingV2LoadBalancersUpdateSamples.java @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +import com.azure.resourcemanager.awsconnector.models.ElasticLoadBalancingV2LoadBalancer; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for ElasticLoadBalancingV2LoadBalancers Update. + */ +public final class ElasticLoadBalancingV2LoadBalancersUpdateSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * ElasticLoadBalancingV2LoadBalancers_Update.json + */ + /** + * Sample code: ElasticLoadBalancingV2LoadBalancers_Update. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + elasticLoadBalancingV2LoadBalancersUpdate(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + ElasticLoadBalancingV2LoadBalancer resource = manager.elasticLoadBalancingV2LoadBalancers() + .getByResourceGroupWithResponse("rgelasticLoadBalancingV2LoadBalancer", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE) + .getValue(); + resource.update().withTags(mapOf("key3447", "fakeTokenPlaceholder")).apply(); + } + + // Use "Map.of" if available + @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/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/ElasticLoadBalancingV2TargetGroupsCreateOrReplaceSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/ElasticLoadBalancingV2TargetGroupsCreateOrReplaceSamples.java new file mode 100644 index 000000000000..d125c0ea5ca3 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/ElasticLoadBalancingV2TargetGroupsCreateOrReplaceSamples.java @@ -0,0 +1,87 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +import com.azure.resourcemanager.awsconnector.models.AwsElasticLoadBalancingV2TargetGroupProperties; +import com.azure.resourcemanager.awsconnector.models.ElasticLoadBalancingV2TargetGroupProperties; +import com.azure.resourcemanager.awsconnector.models.Matcher; +import com.azure.resourcemanager.awsconnector.models.TagAutoGenerated30; +import com.azure.resourcemanager.awsconnector.models.TargetDescription; +import com.azure.resourcemanager.awsconnector.models.TargetGroupAttribute; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for ElasticLoadBalancingV2TargetGroups CreateOrReplace. + */ +public final class ElasticLoadBalancingV2TargetGroupsCreateOrReplaceSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * ElasticLoadBalancingV2TargetGroups_CreateOrReplace.json + */ + /** + * Sample code: ElasticLoadBalancingV2TargetGroups_CreateOrReplace. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void elasticLoadBalancingV2TargetGroupsCreateOrReplace( + com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.elasticLoadBalancingV2TargetGroups() + .define("Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])") + .withRegion("uyngtpdaililbq") + .withExistingResourceGroup("rgelasticLoadBalancingV2TargetGroup") + .withTags(mapOf("key6050", "fakeTokenPlaceholder")) + .withProperties(new ElasticLoadBalancingV2TargetGroupProperties() + .withAwsProperties(new AwsElasticLoadBalancingV2TargetGroupProperties().withHealthCheckEnabled(true) + .withHealthCheckIntervalSeconds(16) + .withHealthCheckPath("exmwepsqjmnvppxuwwvineim") + .withHealthCheckPort("cjuqka") + .withHealthCheckProtocol("vkarvxh") + .withHealthCheckTimeoutSeconds(13) + .withHealthyThresholdCount(21) + .withIpAddressType("da") + .withLoadBalancerArns(Arrays.asList("tzafgmrxzoifkxbmzsivajwdwedjw")) + .withMatcher( + new Matcher().withGrpcCode("fakeTokenPlaceholder").withHttpCode("fakeTokenPlaceholder")) + .withName("ruyunzpgs") + .withPort(9) + .withProtocol("cltdmqhlrmrhgdamynxpmnbshrth") + .withProtocolVersion("rpqn") + .withTags(Arrays.asList(new TagAutoGenerated30().withKey("fakeTokenPlaceholder") + .withValue("ivjhgawgxhfvwiyaeruurbpkyx"))) + .withTargetGroupArn("nlyfkpaomu") + .withTargetGroupAttributes( + Arrays.asList(new TargetGroupAttribute().withKey("fakeTokenPlaceholder").withValue("fiffi"))) + .withTargetGroupFullName("xhghbskmnfhkswoncku") + .withTargetGroupName("b") + .withTargetType("eekpandbuoghdxtg") + .withTargets(Arrays.asList( + new TargetDescription().withAvailabilityZone("degmktltnufhywqic").withId("dpaky").withPort(13))) + .withUnhealthyThresholdCount(14) + .withVpcId("leubklsppgcmljbowvzpwvwya")) + .withPublicCloudConnectorsResourceId("agzteeghhpawmqbjrdkgduq") + .withAwsAccountId("vjdgbgqisnvysonxlwjoczc") + .withArn("avccwbbipudnfjximva") + .withPublicCloudResourceName("muortngxuegbngvcemmzovetqah") + .withAwsSourceSchema("cljfeojrexeruhvjklisrmf") + .withAwsRegion("qlfglghejmmlo") + .withAwsTags(mapOf("key5023", "fakeTokenPlaceholder"))) + .create(); + } + + // Use "Map.of" if available + @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/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/ElasticLoadBalancingV2TargetGroupsDeleteSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/ElasticLoadBalancingV2TargetGroupsDeleteSamples.java new file mode 100644 index 000000000000..90bd6d982043 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/ElasticLoadBalancingV2TargetGroupsDeleteSamples.java @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +/** + * Samples for ElasticLoadBalancingV2TargetGroups Delete. + */ +public final class ElasticLoadBalancingV2TargetGroupsDeleteSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * ElasticLoadBalancingV2TargetGroups_Delete.json + */ + /** + * Sample code: ElasticLoadBalancingV2TargetGroups_Delete. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + elasticLoadBalancingV2TargetGroupsDelete(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.elasticLoadBalancingV2TargetGroups() + .delete("rgelasticLoadBalancingV2TargetGroup", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/ElasticLoadBalancingV2TargetGroupsGetByResourceGroupSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/ElasticLoadBalancingV2TargetGroupsGetByResourceGroupSamples.java new file mode 100644 index 000000000000..58f28a765a62 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/ElasticLoadBalancingV2TargetGroupsGetByResourceGroupSamples.java @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +/** + * Samples for ElasticLoadBalancingV2TargetGroups GetByResourceGroup. + */ +public final class ElasticLoadBalancingV2TargetGroupsGetByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * ElasticLoadBalancingV2TargetGroups_Get.json + */ + /** + * Sample code: ElasticLoadBalancingV2TargetGroups_Get. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + elasticLoadBalancingV2TargetGroupsGet(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.elasticLoadBalancingV2TargetGroups() + .getByResourceGroupWithResponse("rgelasticLoadBalancingV2TargetGroup", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/ElasticLoadBalancingV2TargetGroupsListByResourceGroupSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/ElasticLoadBalancingV2TargetGroupsListByResourceGroupSamples.java new file mode 100644 index 000000000000..1d594d78120b --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/ElasticLoadBalancingV2TargetGroupsListByResourceGroupSamples.java @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +/** + * Samples for ElasticLoadBalancingV2TargetGroups ListByResourceGroup. + */ +public final class ElasticLoadBalancingV2TargetGroupsListByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * ElasticLoadBalancingV2TargetGroups_ListByResourceGroup.json + */ + /** + * Sample code: ElasticLoadBalancingV2TargetGroups_ListByResourceGroup. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void elasticLoadBalancingV2TargetGroupsListByResourceGroup( + com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.elasticLoadBalancingV2TargetGroups() + .listByResourceGroup("rgelasticLoadBalancingV2TargetGroup", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/ElasticLoadBalancingV2TargetGroupsListSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/ElasticLoadBalancingV2TargetGroupsListSamples.java new file mode 100644 index 000000000000..9124dbe18568 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/ElasticLoadBalancingV2TargetGroupsListSamples.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +/** + * Samples for ElasticLoadBalancingV2TargetGroups List. + */ +public final class ElasticLoadBalancingV2TargetGroupsListSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * ElasticLoadBalancingV2TargetGroups_ListBySubscription.json + */ + /** + * Sample code: ElasticLoadBalancingV2TargetGroups_ListBySubscription. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void elasticLoadBalancingV2TargetGroupsListBySubscription( + com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.elasticLoadBalancingV2TargetGroups().list(com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/ElasticLoadBalancingV2TargetGroupsUpdateSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/ElasticLoadBalancingV2TargetGroupsUpdateSamples.java new file mode 100644 index 000000000000..97bfe50a184e --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/ElasticLoadBalancingV2TargetGroupsUpdateSamples.java @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +import com.azure.resourcemanager.awsconnector.models.ElasticLoadBalancingV2TargetGroup; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for ElasticLoadBalancingV2TargetGroups Update. + */ +public final class ElasticLoadBalancingV2TargetGroupsUpdateSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * ElasticLoadBalancingV2TargetGroups_Update.json + */ + /** + * Sample code: ElasticLoadBalancingV2TargetGroups_Update. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + elasticLoadBalancingV2TargetGroupsUpdate(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + ElasticLoadBalancingV2TargetGroup resource = manager.elasticLoadBalancingV2TargetGroups() + .getByResourceGroupWithResponse("rgelasticLoadBalancingV2TargetGroup", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE) + .getValue(); + resource.update().withTags(mapOf("key2200", "fakeTokenPlaceholder")).apply(); + } + + // Use "Map.of" if available + @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/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/ElasticLoadBalancingv2TargetHealthDescriptionsCreateOrReplaceSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/ElasticLoadBalancingv2TargetHealthDescriptionsCreateOrReplaceSamples.java new file mode 100644 index 000000000000..6c3582824290 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/ElasticLoadBalancingv2TargetHealthDescriptionsCreateOrReplaceSamples.java @@ -0,0 +1,80 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +import com.azure.resourcemanager.awsconnector.models.AnomalyDetection; +import com.azure.resourcemanager.awsconnector.models.AnomalyResultEnum; +import com.azure.resourcemanager.awsconnector.models.AnomalyResultEnumValue; +import com.azure.resourcemanager.awsconnector.models.AwsElasticLoadBalancingv2TargetHealthDescriptionProperties; +import com.azure.resourcemanager.awsconnector.models.ElasticLoadBalancingv2TargetHealthDescriptionProperties; +import com.azure.resourcemanager.awsconnector.models.MitigationInEffectEnum; +import com.azure.resourcemanager.awsconnector.models.MitigationInEffectEnumValue; +import com.azure.resourcemanager.awsconnector.models.TargetDescriptionAutoGenerated; +import com.azure.resourcemanager.awsconnector.models.TargetHealth; +import com.azure.resourcemanager.awsconnector.models.TargetHealthReasonEnum; +import com.azure.resourcemanager.awsconnector.models.TargetHealthReasonEnumValue; +import com.azure.resourcemanager.awsconnector.models.TargetHealthStateEnum; +import com.azure.resourcemanager.awsconnector.models.TargetHealthStateEnumValue; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for ElasticLoadBalancingv2TargetHealthDescriptions CreateOrReplace. + */ +public final class ElasticLoadBalancingv2TargetHealthDescriptionsCreateOrReplaceSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * ElasticLoadBalancingv2TargetHealthDescriptions_CreateOrReplace.json + */ + /** + * Sample code: ElasticLoadBalancingv2TargetHealthDescriptions_CreateOrReplace. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void elasticLoadBalancingv2TargetHealthDescriptionsCreateOrReplace( + com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.elasticLoadBalancingv2TargetHealthDescriptions() + .define("Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])") + .withRegion("fjdx") + .withExistingResourceGroup("rgelasticLoadBalancingV2TargetHealthDescription") + .withTags(mapOf("key7243", "fakeTokenPlaceholder")) + .withProperties( + new ElasticLoadBalancingv2TargetHealthDescriptionProperties() + .withAwsProperties(new AwsElasticLoadBalancingv2TargetHealthDescriptionProperties() + .withAnomalyDetection(new AnomalyDetection() + .withMitigationInEffect( + new MitigationInEffectEnumValue().withValue(MitigationInEffectEnum.NO)) + .withResult(new AnomalyResultEnumValue().withValue(AnomalyResultEnum.ANOMALOUS))) + .withHealthCheckPort("wncbdhbdrxjzdwg") + .withTarget(new TargetDescriptionAutoGenerated().withAvailabilityZone("lopqxsnyhbsjjqaj") + .withId("wrhggxodbbktxivhn") + .withPort(29)) + .withTargetHealth(new TargetHealth().withDescription("v") + .withReason(new TargetHealthReasonEnumValue() + .withValue(TargetHealthReasonEnum.ELB_INITIAL_HEALTH_CHECKING)) + .withState(new TargetHealthStateEnumValue().withValue(TargetHealthStateEnum.DRAINING)))) + .withPublicCloudConnectorsResourceId("zwes") + .withAwsAccountId("nqhdoshumaulzimktuhfyzbokepnin") + .withArn("hwxzsqacyslkcfypjntjeecsgic") + .withPublicCloudResourceName("dwtgooliytsuedlhhauisu") + .withAwsSourceSchema("kqowwthevk") + .withAwsRegion("jhbryqdcp") + .withAwsTags(mapOf("key1547", "fakeTokenPlaceholder"))) + .create(); + } + + // Use "Map.of" if available + @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/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/ElasticLoadBalancingv2TargetHealthDescriptionsDeleteSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/ElasticLoadBalancingv2TargetHealthDescriptionsDeleteSamples.java new file mode 100644 index 000000000000..da138573b89e --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/ElasticLoadBalancingv2TargetHealthDescriptionsDeleteSamples.java @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +/** + * Samples for ElasticLoadBalancingv2TargetHealthDescriptions Delete. + */ +public final class ElasticLoadBalancingv2TargetHealthDescriptionsDeleteSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * ElasticLoadBalancingv2TargetHealthDescriptions_Delete.json + */ + /** + * Sample code: ElasticLoadBalancingv2TargetHealthDescriptions_Delete. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void elasticLoadBalancingv2TargetHealthDescriptionsDelete( + com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.elasticLoadBalancingv2TargetHealthDescriptions() + .delete("rgelasticLoadBalancingV2TargetHealthDescription", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/ElasticLoadBalancingv2TargetHealthDescriptionsGetByResourceGroupSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/ElasticLoadBalancingv2TargetHealthDescriptionsGetByResourceGroupSamples.java new file mode 100644 index 000000000000..0123a407fa96 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/ElasticLoadBalancingv2TargetHealthDescriptionsGetByResourceGroupSamples.java @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +/** + * Samples for ElasticLoadBalancingv2TargetHealthDescriptions GetByResourceGroup. + */ +public final class ElasticLoadBalancingv2TargetHealthDescriptionsGetByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * ElasticLoadBalancingv2TargetHealthDescriptions_Get.json + */ + /** + * Sample code: ElasticLoadBalancingv2TargetHealthDescriptions_Get. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void elasticLoadBalancingv2TargetHealthDescriptionsGet( + com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.elasticLoadBalancingv2TargetHealthDescriptions() + .getByResourceGroupWithResponse("rgelasticLoadBalancingV2TargetHealthDescription", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/ElasticLoadBalancingv2TargetHealthDescriptionsListByResourceGroupSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/ElasticLoadBalancingv2TargetHealthDescriptionsListByResourceGroupSamples.java new file mode 100644 index 000000000000..cacc4256add6 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/ElasticLoadBalancingv2TargetHealthDescriptionsListByResourceGroupSamples.java @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +/** + * Samples for ElasticLoadBalancingv2TargetHealthDescriptions ListByResourceGroup. + */ +public final class ElasticLoadBalancingv2TargetHealthDescriptionsListByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * ElasticLoadBalancingv2TargetHealthDescriptions_ListByResourceGroup.json + */ + /** + * Sample code: ElasticLoadBalancingv2TargetHealthDescriptions_ListByResourceGroup. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void elasticLoadBalancingv2TargetHealthDescriptionsListByResourceGroup( + com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.elasticLoadBalancingv2TargetHealthDescriptions() + .listByResourceGroup("rgelasticLoadBalancingV2TargetHealthDescription", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/ElasticLoadBalancingv2TargetHealthDescriptionsListSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/ElasticLoadBalancingv2TargetHealthDescriptionsListSamples.java new file mode 100644 index 000000000000..62084039e340 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/ElasticLoadBalancingv2TargetHealthDescriptionsListSamples.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +/** + * Samples for ElasticLoadBalancingv2TargetHealthDescriptions List. + */ +public final class ElasticLoadBalancingv2TargetHealthDescriptionsListSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * ElasticLoadBalancingv2TargetHealthDescriptions_ListBySubscription.json + */ + /** + * Sample code: ElasticLoadBalancingv2TargetHealthDescriptions_ListBySubscription. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void elasticLoadBalancingv2TargetHealthDescriptionsListBySubscription( + com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.elasticLoadBalancingv2TargetHealthDescriptions().list(com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/ElasticLoadBalancingv2TargetHealthDescriptionsUpdateSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/ElasticLoadBalancingv2TargetHealthDescriptionsUpdateSamples.java new file mode 100644 index 000000000000..8d168e05452b --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/ElasticLoadBalancingv2TargetHealthDescriptionsUpdateSamples.java @@ -0,0 +1,47 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +import com.azure.resourcemanager.awsconnector.models.ElasticLoadBalancingv2TargetHealthDescription; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for ElasticLoadBalancingv2TargetHealthDescriptions Update. + */ +public final class ElasticLoadBalancingv2TargetHealthDescriptionsUpdateSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * ElasticLoadBalancingv2TargetHealthDescriptions_Update.json + */ + /** + * Sample code: ElasticLoadBalancingv2TargetHealthDescriptions_Update. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void elasticLoadBalancingv2TargetHealthDescriptionsUpdate( + com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + ElasticLoadBalancingv2TargetHealthDescription resource + = manager.elasticLoadBalancingv2TargetHealthDescriptions() + .getByResourceGroupWithResponse("rgelasticLoadBalancingV2TargetHealthDescription", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE) + .getValue(); + resource.update().withTags(mapOf("key5261", "fakeTokenPlaceholder")).apply(); + } + + // Use "Map.of" if available + @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/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/EmrClusterSummariesCreateOrReplaceSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/EmrClusterSummariesCreateOrReplaceSamples.java new file mode 100644 index 000000000000..e0feb968d377 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/EmrClusterSummariesCreateOrReplaceSamples.java @@ -0,0 +1,89 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +import com.azure.core.management.serializer.SerializerFactory; +import com.azure.core.util.serializer.SerializerEncoding; +import com.azure.resourcemanager.awsconnector.models.AwsEmrClusterSummaryProperties; +import com.azure.resourcemanager.awsconnector.models.ClusterState; +import com.azure.resourcemanager.awsconnector.models.ClusterStateChangeReason; +import com.azure.resourcemanager.awsconnector.models.ClusterStateChangeReasonCode; +import com.azure.resourcemanager.awsconnector.models.ClusterStateChangeReasonCodeEnumValue; +import com.azure.resourcemanager.awsconnector.models.ClusterStateEnumValue; +import com.azure.resourcemanager.awsconnector.models.ClusterStatusAutoGenerated; +import com.azure.resourcemanager.awsconnector.models.ClusterTimeline; +import com.azure.resourcemanager.awsconnector.models.EmrClusterSummaryProperties; +import com.azure.resourcemanager.awsconnector.models.ErrorDetailAutoGenerated; +import java.io.IOException; +import java.time.OffsetDateTime; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for EmrClusterSummaries CreateOrReplace. + */ +public final class EmrClusterSummariesCreateOrReplaceSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * EmrClusterSummaries_CreateOrReplace.json + */ + /** + * Sample code: EmrClusterSummaries_CreateOrReplace. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void emrClusterSummariesCreateOrReplace( + com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) throws IOException { + manager.emrClusterSummaries() + .define("Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])") + .withRegion("ph") + .withExistingResourceGroup("rgemrClusterSummary") + .withTags(mapOf("key7639", "fakeTokenPlaceholder")) + .withProperties(new EmrClusterSummaryProperties() + .withAwsProperties(new AwsEmrClusterSummaryProperties().withClusterArn("hcwmiaqea") + .withId("hfxlzvrbygylot") + .withName("nefubxfisrkqoalhovdvlsu") + .withNormalizedInstanceHours(27) + .withOutpostArn("sbsolrzktgrkmhwjfdmayp") + .withStatus(new ClusterStatusAutoGenerated() + .withErrorDetails(Arrays.asList(new ErrorDetailAutoGenerated() + .withErrorCode("fakeTokenPlaceholder") + .withErrorData(Arrays.asList(SerializerFactory.createDefaultManagementSerializerAdapter() + .deserialize("{}", Object.class, SerializerEncoding.JSON))) + .withErrorMessage("wqhugncreg"))) + .withState(new ClusterStateEnumValue().withValue(ClusterState.BOOTSTRAPPING)) + .withStateChangeReason( + new ClusterStateChangeReason() + .withCode(new ClusterStateChangeReasonCodeEnumValue() + .withValue(ClusterStateChangeReasonCode.ALL_STEPS_COMPLETED)) + .withMessage("lapcxpryl")) + .withTimeline( + new ClusterTimeline().withCreationDateTime(OffsetDateTime.parse("2024-10-08T03:48:22.614Z")) + .withEndDateTime(OffsetDateTime.parse("2024-10-08T03:48:22.614Z")) + .withReadyDateTime(OffsetDateTime.parse("2024-10-08T03:48:22.614Z"))))) + .withPublicCloudConnectorsResourceId("xkwvywwdhplifzryewofkfixmin") + .withAwsAccountId("bgsinuonrubuushkssenel") + .withArn("ivrscnhxemak") + .withPublicCloudResourceName("dirislun") + .withAwsSourceSchema("ertwddsdgnkc") + .withAwsRegion("zvqejnwqwbwclnslkhgteqamuvfdi") + .withAwsTags(mapOf("key1466", "fakeTokenPlaceholder"))) + .create(); + } + + // Use "Map.of" if available + @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/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/EmrClusterSummariesDeleteSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/EmrClusterSummariesDeleteSamples.java new file mode 100644 index 000000000000..bd2c5891bb52 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/EmrClusterSummariesDeleteSamples.java @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +/** + * Samples for EmrClusterSummaries Delete. + */ +public final class EmrClusterSummariesDeleteSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * EmrClusterSummaries_Delete.json + */ + /** + * Sample code: EmrClusterSummaries_Delete. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void emrClusterSummariesDelete(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.emrClusterSummaries() + .delete("rgemrClusterSummary", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/EmrClusterSummariesGetByResourceGroupSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/EmrClusterSummariesGetByResourceGroupSamples.java new file mode 100644 index 000000000000..3c078b9e7750 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/EmrClusterSummariesGetByResourceGroupSamples.java @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +/** + * Samples for EmrClusterSummaries GetByResourceGroup. + */ +public final class EmrClusterSummariesGetByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * EmrClusterSummaries_Get.json + */ + /** + * Sample code: EmrClusterSummaries_Get. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void emrClusterSummariesGet(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.emrClusterSummaries() + .getByResourceGroupWithResponse("rgemrClusterSummary", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/EmrClusterSummariesListByResourceGroupSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/EmrClusterSummariesListByResourceGroupSamples.java new file mode 100644 index 000000000000..fce2af549155 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/EmrClusterSummariesListByResourceGroupSamples.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +/** + * Samples for EmrClusterSummaries ListByResourceGroup. + */ +public final class EmrClusterSummariesListByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * EmrClusterSummaries_ListByResourceGroup.json + */ + /** + * Sample code: EmrClusterSummaries_ListByResourceGroup. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + emrClusterSummariesListByResourceGroup(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.emrClusterSummaries().listByResourceGroup("rgemrClusterSummary", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/EmrClusterSummariesListSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/EmrClusterSummariesListSamples.java new file mode 100644 index 000000000000..6ef69546398b --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/EmrClusterSummariesListSamples.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +/** + * Samples for EmrClusterSummaries List. + */ +public final class EmrClusterSummariesListSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * EmrClusterSummaries_ListBySubscription.json + */ + /** + * Sample code: EmrClusterSummaries_ListBySubscription. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + emrClusterSummariesListBySubscription(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.emrClusterSummaries().list(com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/EmrClusterSummariesUpdateSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/EmrClusterSummariesUpdateSamples.java new file mode 100644 index 000000000000..5a13cc2bbc62 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/EmrClusterSummariesUpdateSamples.java @@ -0,0 +1,45 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +import com.azure.resourcemanager.awsconnector.models.EmrClusterSummary; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for EmrClusterSummaries Update. + */ +public final class EmrClusterSummariesUpdateSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * EmrClusterSummaries_Update.json + */ + /** + * Sample code: EmrClusterSummaries_Update. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void emrClusterSummariesUpdate(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + EmrClusterSummary resource = manager.emrClusterSummaries() + .getByResourceGroupWithResponse("rgemrClusterSummary", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE) + .getValue(); + resource.update().withTags(mapOf("key1151", "fakeTokenPlaceholder")).apply(); + } + + // Use "Map.of" if available + @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/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/EmrClustersCreateOrReplaceSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/EmrClustersCreateOrReplaceSamples.java new file mode 100644 index 000000000000..f0da83126fdc --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/EmrClustersCreateOrReplaceSamples.java @@ -0,0 +1,160 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +import com.azure.core.management.serializer.SerializerFactory; +import com.azure.core.util.serializer.SerializerEncoding; +import com.azure.resourcemanager.awsconnector.models.Application; +import com.azure.resourcemanager.awsconnector.models.AwsEmrClusterProperties; +import com.azure.resourcemanager.awsconnector.models.ClusterState; +import com.azure.resourcemanager.awsconnector.models.ClusterStateChangeReason; +import com.azure.resourcemanager.awsconnector.models.ClusterStateChangeReasonCode; +import com.azure.resourcemanager.awsconnector.models.ClusterStateChangeReasonCodeEnumValue; +import com.azure.resourcemanager.awsconnector.models.ClusterStateEnumValue; +import com.azure.resourcemanager.awsconnector.models.ClusterStatusAutoGenerated; +import com.azure.resourcemanager.awsconnector.models.ClusterTimeline; +import com.azure.resourcemanager.awsconnector.models.Configuration; +import com.azure.resourcemanager.awsconnector.models.Ec2InstanceAttributes; +import com.azure.resourcemanager.awsconnector.models.EmrClusterProperties; +import com.azure.resourcemanager.awsconnector.models.ErrorDetailAutoGenerated; +import com.azure.resourcemanager.awsconnector.models.InstanceCollectionType; +import com.azure.resourcemanager.awsconnector.models.InstanceCollectionTypeEnumValue; +import com.azure.resourcemanager.awsconnector.models.InstanceRoleType; +import com.azure.resourcemanager.awsconnector.models.InstanceRoleTypeEnumValue; +import com.azure.resourcemanager.awsconnector.models.KerberosAttributes; +import com.azure.resourcemanager.awsconnector.models.PlacementGroupConfig; +import com.azure.resourcemanager.awsconnector.models.PlacementGroupStrategy; +import com.azure.resourcemanager.awsconnector.models.PlacementGroupStrategyEnumValue; +import com.azure.resourcemanager.awsconnector.models.RepoUpgradeOnBoot; +import com.azure.resourcemanager.awsconnector.models.RepoUpgradeOnBootEnumValue; +import com.azure.resourcemanager.awsconnector.models.ScaleDownBehavior; +import com.azure.resourcemanager.awsconnector.models.ScaleDownBehaviorEnumValue; +import com.azure.resourcemanager.awsconnector.models.TagAutoGenerated31; +import java.io.IOException; +import java.time.OffsetDateTime; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for EmrClusters CreateOrReplace. + */ +public final class EmrClustersCreateOrReplaceSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * EmrClusters_CreateOrReplace.json + */ + /** + * Sample code: EmrClusters_CreateOrReplace. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void emrClustersCreateOrReplace(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) + throws IOException { + manager.emrClusters() + .define("Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])") + .withRegion("gxjyaumpubnajcudsqwk") + .withExistingResourceGroup("rgemrCluster") + .withTags(mapOf("key4944", "fakeTokenPlaceholder")) + .withProperties(new EmrClusterProperties() + .withAwsProperties(new AwsEmrClusterProperties() + .withApplications( + Arrays.asList(new Application().withAdditionalInfo(mapOf("key299", "fakeTokenPlaceholder")) + .withArgs(Arrays.asList("sumnqhhlrszgzznshwr")) + .withName("kapcvpwdf") + .withVersion("yccwkryikpyu"))) + .withAutoScalingRole("yuplht") + .withAutoTerminate(true) + .withClusterArn("bwnxmqzwlykxvewsdujzovqs") + .withConfigurations(Arrays.asList(new Configuration().withClassification("ahweyaesthmgtdiv") + .withConfigurations(Arrays.asList()) + .withProperties(mapOf("key6744", "fakeTokenPlaceholder")))) + .withCustomAmiId("iwlvorsznjsaunx") + .withEbsRootVolumeIops(28) + .withEbsRootVolumeSize(25) + .withEbsRootVolumeThroughput(17) + .withEc2InstanceAttributes(new Ec2InstanceAttributes() + .withAdditionalMasterSecurityGroups(Arrays.asList("pzihpojfcoxrdcrosktssgf")) + .withAdditionalSlaveSecurityGroups(Arrays.asList("rdaccocuctxwwzt")) + .withEc2AvailabilityZone("bwaaomtre") + .withEc2KeyName("fakeTokenPlaceholder") + .withEc2SubnetId("ykhysdwgksrwehd") + .withEmrManagedMasterSecurityGroup("rjwslxsygj") + .withEmrManagedSlaveSecurityGroup("hvmxzsjgkhxnimtofmzlpkf") + .withIamInstanceProfile("wxgp") + .withRequestedEc2AvailabilityZones(Arrays.asList("wjzsvq")) + .withRequestedEc2SubnetIds(Arrays.asList("nliztbuhuhkve")) + .withServiceAccessSecurityGroup("supzzejzwqetvnebvhefvwofww")) + .withId("usolewchtbnpfarqidjcaetetbbnww") + .withInstanceCollectionType( + new InstanceCollectionTypeEnumValue().withValue(InstanceCollectionType.INSTANCE_FLEET)) + .withKerberosAttributes(new KerberosAttributes().withAdDomainJoinPassword("fakeTokenPlaceholder") + .withAdDomainJoinUser("ezsezwfzesdunmtiegxbsomqqk") + .withCrossRealmTrustPrincipalPassword("fakeTokenPlaceholder") + .withKdcAdminPassword("fakeTokenPlaceholder") + .withRealm("rraygrjruzeqrozds")) + .withLogEncryptionKmsKeyId("fakeTokenPlaceholder") + .withLogUri("xrdeudkf") + .withMasterPublicDnsName("ztuajioptfwewm") + .withName("bhkvffeitkj") + .withNormalizedInstanceHours(16) + .withOsReleaseLabel("huxdgdaqkknvleyvhgydjbidn") + .withOutpostArn("wnoxdzcyqfbreqnkorlwtfvmzpcu") + .withPlacementGroups(Arrays.asList(new PlacementGroupConfig() + .withInstanceRole(new InstanceRoleTypeEnumValue().withValue(InstanceRoleType.CORE)) + .withPlacementStrategy( + new PlacementGroupStrategyEnumValue().withValue(PlacementGroupStrategy.CLUSTER)))) + .withReleaseLabel("lpmpniehmkeuwyyh") + .withRepoUpgradeOnBoot(new RepoUpgradeOnBootEnumValue().withValue(RepoUpgradeOnBoot.NONE)) + .withRequestedAmiVersion("kwlohrrhuxcgnok") + .withRunningAmiVersion("wd") + .withScaleDownBehavior( + new ScaleDownBehaviorEnumValue().withValue(ScaleDownBehavior.TERMINATE_AT_INSTANCE_HOUR)) + .withSecurityConfiguration("njgb") + .withServiceRole("msbrnoepcyrbaazxsmwbhmqrzubm") + .withStatus(new ClusterStatusAutoGenerated() + .withErrorDetails(Arrays.asList(new ErrorDetailAutoGenerated() + .withErrorCode("fakeTokenPlaceholder") + .withErrorData(Arrays.asList(SerializerFactory.createDefaultManagementSerializerAdapter() + .deserialize("{}", Object.class, SerializerEncoding.JSON))) + .withErrorMessage("hhoucsczmnnflofzyxt"))) + .withState(new ClusterStateEnumValue().withValue(ClusterState.BOOTSTRAPPING)) + .withStateChangeReason(new ClusterStateChangeReason() + .withCode(new ClusterStateChangeReasonCodeEnumValue() + .withValue(ClusterStateChangeReasonCode.ALL_STEPS_COMPLETED)) + .withMessage("sxjkazmayqtbqnbaslxpxun")) + .withTimeline( + new ClusterTimeline().withCreationDateTime(OffsetDateTime.parse("2024-10-08T03:51:42.281Z")) + .withEndDateTime(OffsetDateTime.parse("2024-10-08T03:51:42.281Z")) + .withReadyDateTime(OffsetDateTime.parse("2024-10-08T03:51:42.281Z")))) + .withStepConcurrencyLevel(8) + .withTags(Arrays.asList( + new TagAutoGenerated31().withKey("fakeTokenPlaceholder").withValue("gibogfcbfiielvixdxeb"))) + .withTerminationProtected(true) + .withUnhealthyNodeReplacement(true) + .withVisibleToAllUsers(true)) + .withPublicCloudConnectorsResourceId("gjirecopxmcdpdljkxexxoawwd") + .withAwsAccountId("tsnkbdcacnozmtgvxjflzydxeu") + .withArn("hvhwzh") + .withPublicCloudResourceName("aulznvgpxpjdvghbszbwxycew") + .withAwsSourceSchema("sexomixwzozkllipdmi") + .withAwsRegion("rbbkoztkjhvdu") + .withAwsTags(mapOf("key6409", "fakeTokenPlaceholder"))) + .create(); + } + + // Use "Map.of" if available + @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/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/EmrClustersDeleteSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/EmrClustersDeleteSamples.java new file mode 100644 index 000000000000..dc93ab2ebe25 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/EmrClustersDeleteSamples.java @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +/** + * Samples for EmrClusters Delete. + */ +public final class EmrClustersDeleteSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/EmrClusters_Delete. + * json + */ + /** + * Sample code: EmrClusters_Delete. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void emrClustersDelete(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.emrClusters() + .delete("rgemrCluster", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/EmrClustersGetByResourceGroupSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/EmrClustersGetByResourceGroupSamples.java new file mode 100644 index 000000000000..40fd2ad790d4 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/EmrClustersGetByResourceGroupSamples.java @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +/** + * Samples for EmrClusters GetByResourceGroup. + */ +public final class EmrClustersGetByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/EmrClusters_Get. + * json + */ + /** + * Sample code: EmrClusters_Get. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void emrClustersGet(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.emrClusters() + .getByResourceGroupWithResponse("rgemrCluster", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/EmrClustersListByResourceGroupSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/EmrClustersListByResourceGroupSamples.java new file mode 100644 index 000000000000..99c2ee0968d0 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/EmrClustersListByResourceGroupSamples.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +/** + * Samples for EmrClusters ListByResourceGroup. + */ +public final class EmrClustersListByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * EmrClusters_ListByResourceGroup.json + */ + /** + * Sample code: EmrClusters_ListByResourceGroup. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + emrClustersListByResourceGroup(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.emrClusters().listByResourceGroup("rgemrCluster", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/EmrClustersListSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/EmrClustersListSamples.java new file mode 100644 index 000000000000..65eb0ba4762d --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/EmrClustersListSamples.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +/** + * Samples for EmrClusters List. + */ +public final class EmrClustersListSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * EmrClusters_ListBySubscription.json + */ + /** + * Sample code: EmrClusters_ListBySubscription. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + emrClustersListBySubscription(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.emrClusters().list(com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/EmrClustersUpdateSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/EmrClustersUpdateSamples.java new file mode 100644 index 000000000000..ffced68f389b --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/EmrClustersUpdateSamples.java @@ -0,0 +1,45 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +import com.azure.resourcemanager.awsconnector.models.EmrCluster; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for EmrClusters Update. + */ +public final class EmrClustersUpdateSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/EmrClusters_Update. + * json + */ + /** + * Sample code: EmrClusters_Update. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void emrClustersUpdate(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + EmrCluster resource = manager.emrClusters() + .getByResourceGroupWithResponse("rgemrCluster", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE) + .getValue(); + resource.update().withTags(mapOf("key1560", "fakeTokenPlaceholder")).apply(); + } + + // Use "Map.of" if available + @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/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/GuardDutyDetectorsCreateOrReplaceSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/GuardDutyDetectorsCreateOrReplaceSamples.java new file mode 100644 index 000000000000..f8a0bed6a478 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/GuardDutyDetectorsCreateOrReplaceSamples.java @@ -0,0 +1,83 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +import com.azure.resourcemanager.awsconnector.models.AwsGuardDutyDetectorProperties; +import com.azure.resourcemanager.awsconnector.models.CfnDataSourceConfigurations; +import com.azure.resourcemanager.awsconnector.models.CfnFeatureAdditionalConfiguration; +import com.azure.resourcemanager.awsconnector.models.CfnFeatureConfiguration; +import com.azure.resourcemanager.awsconnector.models.CfnFeatureConfigurationStatus; +import com.azure.resourcemanager.awsconnector.models.CfnKubernetesAuditLogsConfiguration; +import com.azure.resourcemanager.awsconnector.models.CfnKubernetesConfiguration; +import com.azure.resourcemanager.awsconnector.models.CfnMalwareProtectionConfiguration; +import com.azure.resourcemanager.awsconnector.models.CfnScanEc2InstanceWithFindingsConfiguration; +import com.azure.resourcemanager.awsconnector.models.Cfns3LogsConfiguration; +import com.azure.resourcemanager.awsconnector.models.GuardDutyDetectorProperties; +import com.azure.resourcemanager.awsconnector.models.TagItem; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for GuardDutyDetectors CreateOrReplace. + */ +public final class GuardDutyDetectorsCreateOrReplaceSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * GuardDutyDetectors_CreateOrReplace.json + */ + /** + * Sample code: GuardDutyDetectors_CreateOrReplace. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + guardDutyDetectorsCreateOrReplace(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.guardDutyDetectors() + .define("Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])") + .withRegion("sxpvpkjhhmcssseznufvqer") + .withExistingResourceGroup("rgguardDutyDetector") + .withTags(mapOf("key3628", "fakeTokenPlaceholder")) + .withProperties(new GuardDutyDetectorProperties() + .withAwsProperties(new AwsGuardDutyDetectorProperties() + .withDataSources(new CfnDataSourceConfigurations() + .withKubernetes(new CfnKubernetesConfiguration() + .withAuditLogs(new CfnKubernetesAuditLogsConfiguration().withEnable(true))) + .withMalwareProtection(new CfnMalwareProtectionConfiguration().withScanEc2InstanceWithFindings( + new CfnScanEc2InstanceWithFindingsConfiguration().withEbsVolumes(true))) + .withS3Logs(new Cfns3LogsConfiguration().withEnable(true))) + .withEnable(true) + .withFeatures(Arrays.asList(new CfnFeatureConfiguration() + .withAdditionalConfiguration( + Arrays.asList(new CfnFeatureAdditionalConfiguration().withName("lkkifsmqcaujhderxjzcmezjh") + .withStatus("wbjikrlaxrtwpwiexknat"))) + .withName("aoocmexbklfmzmglxopv") + .withStatus(CfnFeatureConfigurationStatus.DISABLED))) + .withFindingPublishingFrequency("ed") + .withId("vakfpotktucclwwqxkczvzrw") + .withTags(Arrays.asList(new TagItem().withKey("fakeTokenPlaceholder").withValue("edlendjmyszkw")))) + .withPublicCloudConnectorsResourceId("infmmygcbbjb") + .withAwsAccountId("lgyellrapjphgbfhni") + .withArn("bdql") + .withPublicCloudResourceName("hkdypyaxoeszbx") + .withAwsSourceSchema("coaitkvmjezenllwmaouhnwfmjjbxa") + .withAwsRegion("wtiiifsewygmgbdcebhl") + .withAwsTags(mapOf("key6130", "fakeTokenPlaceholder"))) + .create(); + } + + // Use "Map.of" if available + @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/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/GuardDutyDetectorsDeleteSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/GuardDutyDetectorsDeleteSamples.java new file mode 100644 index 000000000000..b4af00720740 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/GuardDutyDetectorsDeleteSamples.java @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +/** + * Samples for GuardDutyDetectors Delete. + */ +public final class GuardDutyDetectorsDeleteSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * GuardDutyDetectors_Delete.json + */ + /** + * Sample code: GuardDutyDetectors_Delete. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void guardDutyDetectorsDelete(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.guardDutyDetectors() + .delete("rgguardDutyDetector", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/GuardDutyDetectorsGetByResourceGroupSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/GuardDutyDetectorsGetByResourceGroupSamples.java new file mode 100644 index 000000000000..49c8c46edcc6 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/GuardDutyDetectorsGetByResourceGroupSamples.java @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +/** + * Samples for GuardDutyDetectors GetByResourceGroup. + */ +public final class GuardDutyDetectorsGetByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * GuardDutyDetectors_Get.json + */ + /** + * Sample code: GuardDutyDetectors_Get. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void guardDutyDetectorsGet(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.guardDutyDetectors() + .getByResourceGroupWithResponse("rgguardDutyDetector", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/GuardDutyDetectorsListByResourceGroupSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/GuardDutyDetectorsListByResourceGroupSamples.java new file mode 100644 index 000000000000..bf1f62de0954 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/GuardDutyDetectorsListByResourceGroupSamples.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +/** + * Samples for GuardDutyDetectors ListByResourceGroup. + */ +public final class GuardDutyDetectorsListByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * GuardDutyDetectors_ListByResourceGroup.json + */ + /** + * Sample code: GuardDutyDetectors_ListByResourceGroup. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + guardDutyDetectorsListByResourceGroup(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.guardDutyDetectors().listByResourceGroup("rgguardDutyDetector", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/GuardDutyDetectorsListSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/GuardDutyDetectorsListSamples.java new file mode 100644 index 000000000000..7f30f2ce1322 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/GuardDutyDetectorsListSamples.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +/** + * Samples for GuardDutyDetectors List. + */ +public final class GuardDutyDetectorsListSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * GuardDutyDetectors_ListBySubscription.json + */ + /** + * Sample code: GuardDutyDetectors_ListBySubscription. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + guardDutyDetectorsListBySubscription(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.guardDutyDetectors().list(com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/GuardDutyDetectorsUpdateSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/GuardDutyDetectorsUpdateSamples.java new file mode 100644 index 000000000000..7898e10f38a2 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/GuardDutyDetectorsUpdateSamples.java @@ -0,0 +1,45 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +import com.azure.resourcemanager.awsconnector.models.GuardDutyDetector; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for GuardDutyDetectors Update. + */ +public final class GuardDutyDetectorsUpdateSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * GuardDutyDetectors_Update.json + */ + /** + * Sample code: GuardDutyDetectors_Update. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void guardDutyDetectorsUpdate(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + GuardDutyDetector resource = manager.guardDutyDetectors() + .getByResourceGroupWithResponse("rgguardDutyDetector", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE) + .getValue(); + resource.update().withTags(mapOf("key2754", "fakeTokenPlaceholder")).apply(); + } + + // Use "Map.of" if available + @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/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/IamAccessKeyLastUsedsCreateOrReplaceSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/IamAccessKeyLastUsedsCreateOrReplaceSamples.java new file mode 100644 index 000000000000..fd1f1ab2de55 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/IamAccessKeyLastUsedsCreateOrReplaceSamples.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.awsconnector.generated; + +import com.azure.resourcemanager.awsconnector.models.AwsIamAccessKeyLastUsedProperties; +import com.azure.resourcemanager.awsconnector.models.IamAccessKeyLastUsedProperties; +import java.time.OffsetDateTime; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for IamAccessKeyLastUseds CreateOrReplace. + */ +public final class IamAccessKeyLastUsedsCreateOrReplaceSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * IamAccessKeyLastUseds_CreateOrReplace.json + */ + /** + * Sample code: IamAccessKeyLastUseds_CreateOrReplace. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + iamAccessKeyLastUsedsCreateOrReplace(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.iamAccessKeyLastUseds() + .define("Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])") + .withRegion("rdt") + .withExistingResourceGroup("rgiamAccessKeyLastUsed") + .withTags(mapOf("key2981", "fakeTokenPlaceholder")) + .withProperties(new IamAccessKeyLastUsedProperties() + .withAwsProperties(new AwsIamAccessKeyLastUsedProperties() + .withLastUsedDate(OffsetDateTime.parse("2024-10-08T03:48:57.755Z")) + .withRegion("av") + .withServiceName("vhyurov")) + .withPublicCloudConnectorsResourceId("rwbbz") + .withAwsAccountId("lturmpd") + .withArn("xfaoulngosrepqegvmfzqcmenfiwv") + .withPublicCloudResourceName("cttx") + .withAwsSourceSchema("enepzx") + .withAwsRegion("epaxtviqtrqqnghkgfkqhuqee") + .withAwsTags(mapOf("key9162", "fakeTokenPlaceholder"))) + .create(); + } + + // Use "Map.of" if available + @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/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/IamAccessKeyLastUsedsDeleteSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/IamAccessKeyLastUsedsDeleteSamples.java new file mode 100644 index 000000000000..b1dad9d90bb1 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/IamAccessKeyLastUsedsDeleteSamples.java @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +/** + * Samples for IamAccessKeyLastUseds Delete. + */ +public final class IamAccessKeyLastUsedsDeleteSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * IamAccessKeyLastUseds_Delete.json + */ + /** + * Sample code: IamAccessKeyLastUseds_Delete. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void iamAccessKeyLastUsedsDelete(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.iamAccessKeyLastUseds() + .delete("rgiamAccessKeyLastUsed", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/IamAccessKeyLastUsedsGetByResourceGroupSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/IamAccessKeyLastUsedsGetByResourceGroupSamples.java new file mode 100644 index 000000000000..5721e61b820b --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/IamAccessKeyLastUsedsGetByResourceGroupSamples.java @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +/** + * Samples for IamAccessKeyLastUseds GetByResourceGroup. + */ +public final class IamAccessKeyLastUsedsGetByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * IamAccessKeyLastUseds_Get.json + */ + /** + * Sample code: IamAccessKeyLastUseds_Get. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void iamAccessKeyLastUsedsGet(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.iamAccessKeyLastUseds() + .getByResourceGroupWithResponse("rgiamAccessKeyLastUsed", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/IamAccessKeyLastUsedsListByResourceGroupSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/IamAccessKeyLastUsedsListByResourceGroupSamples.java new file mode 100644 index 000000000000..85ff84d347fb --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/IamAccessKeyLastUsedsListByResourceGroupSamples.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +/** + * Samples for IamAccessKeyLastUseds ListByResourceGroup. + */ +public final class IamAccessKeyLastUsedsListByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * IamAccessKeyLastUseds_ListByResourceGroup.json + */ + /** + * Sample code: IamAccessKeyLastUseds_ListByResourceGroup. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + iamAccessKeyLastUsedsListByResourceGroup(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.iamAccessKeyLastUseds().listByResourceGroup("rgiamAccessKeyLastUsed", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/IamAccessKeyLastUsedsListSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/IamAccessKeyLastUsedsListSamples.java new file mode 100644 index 000000000000..e9e4dd205571 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/IamAccessKeyLastUsedsListSamples.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +/** + * Samples for IamAccessKeyLastUseds List. + */ +public final class IamAccessKeyLastUsedsListSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * IamAccessKeyLastUseds_ListBySubscription.json + */ + /** + * Sample code: IamAccessKeyLastUseds_ListBySubscription. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + iamAccessKeyLastUsedsListBySubscription(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.iamAccessKeyLastUseds().list(com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/IamAccessKeyLastUsedsUpdateSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/IamAccessKeyLastUsedsUpdateSamples.java new file mode 100644 index 000000000000..32ea699d92bd --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/IamAccessKeyLastUsedsUpdateSamples.java @@ -0,0 +1,45 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +import com.azure.resourcemanager.awsconnector.models.IamAccessKeyLastUsed; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for IamAccessKeyLastUseds Update. + */ +public final class IamAccessKeyLastUsedsUpdateSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * IamAccessKeyLastUseds_Update.json + */ + /** + * Sample code: IamAccessKeyLastUseds_Update. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void iamAccessKeyLastUsedsUpdate(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + IamAccessKeyLastUsed resource = manager.iamAccessKeyLastUseds() + .getByResourceGroupWithResponse("rgiamAccessKeyLastUsed", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE) + .getValue(); + resource.update().withTags(mapOf("key2474", "fakeTokenPlaceholder")).apply(); + } + + // Use "Map.of" if available + @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/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/IamAccessKeyMetadataInfoCreateOrReplaceSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/IamAccessKeyMetadataInfoCreateOrReplaceSamples.java new file mode 100644 index 000000000000..767f54953d2d --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/IamAccessKeyMetadataInfoCreateOrReplaceSamples.java @@ -0,0 +1,62 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +import com.azure.resourcemanager.awsconnector.models.AwsIamAccessKeyMetadataProperties; +import com.azure.resourcemanager.awsconnector.models.IamAccessKeyMetadataProperties; +import com.azure.resourcemanager.awsconnector.models.StatusType; +import com.azure.resourcemanager.awsconnector.models.StatusTypeEnumValueAutoGenerated; +import java.time.OffsetDateTime; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for IamAccessKeyMetadataInfo CreateOrReplace. + */ +public final class IamAccessKeyMetadataInfoCreateOrReplaceSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * IamAccessKeyMetadataInfo_CreateOrReplace.json + */ + /** + * Sample code: IamAccessKeyMetadataInfo_CreateOrReplace. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + iamAccessKeyMetadataInfoCreateOrReplace(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.iamAccessKeyMetadataInfoes() + .define("Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])") + .withRegion("dqubptgcoomyzlodtswea") + .withExistingResourceGroup("rgiamAccessKeyMetadata") + .withTags(mapOf("key4454", "fakeTokenPlaceholder")) + .withProperties(new IamAccessKeyMetadataProperties() + .withAwsProperties(new AwsIamAccessKeyMetadataProperties().withAccessKeyId("fakeTokenPlaceholder") + .withCreateDate(OffsetDateTime.parse("2024-10-08T03:50:53.022Z")) + .withStatus(new StatusTypeEnumValueAutoGenerated().withValue(StatusType.fromString("Active"))) + .withUsername("obogutgiddo")) + .withPublicCloudConnectorsResourceId("iwcumigpcnebbhmwmaerblylcgdtt") + .withAwsAccountId("i") + .withArn("gcbewovmmukvp") + .withPublicCloudResourceName("ctvpxuzxqwzhmtivtftc") + .withAwsSourceSchema("bcflc") + .withAwsRegion("e") + .withAwsTags(mapOf("key5899", "fakeTokenPlaceholder"))) + .create(); + } + + // Use "Map.of" if available + @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/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/IamAccessKeyMetadataInfoDeleteSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/IamAccessKeyMetadataInfoDeleteSamples.java new file mode 100644 index 000000000000..db452c8954cd --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/IamAccessKeyMetadataInfoDeleteSamples.java @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +/** + * Samples for IamAccessKeyMetadataInfo Delete. + */ +public final class IamAccessKeyMetadataInfoDeleteSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * IamAccessKeyMetadataInfo_Delete.json + */ + /** + * Sample code: IamAccessKeyMetadataInfo_Delete. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + iamAccessKeyMetadataInfoDelete(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.iamAccessKeyMetadataInfoes() + .delete("rgiamAccessKeyMetadata", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/IamAccessKeyMetadataInfoGetByResourceGroupSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/IamAccessKeyMetadataInfoGetByResourceGroupSamples.java new file mode 100644 index 000000000000..6d6bb6fd6302 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/IamAccessKeyMetadataInfoGetByResourceGroupSamples.java @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +/** + * Samples for IamAccessKeyMetadataInfo GetByResourceGroup. + */ +public final class IamAccessKeyMetadataInfoGetByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * IamAccessKeyMetadataInfo_Get.json + */ + /** + * Sample code: IamAccessKeyMetadataInfo_Get. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void iamAccessKeyMetadataInfoGet(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.iamAccessKeyMetadataInfoes() + .getByResourceGroupWithResponse("rgiamAccessKeyMetadata", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/IamAccessKeyMetadataInfoListByResourceGroupSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/IamAccessKeyMetadataInfoListByResourceGroupSamples.java new file mode 100644 index 000000000000..5199b3e58d93 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/IamAccessKeyMetadataInfoListByResourceGroupSamples.java @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +/** + * Samples for IamAccessKeyMetadataInfo ListByResourceGroup. + */ +public final class IamAccessKeyMetadataInfoListByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * IamAccessKeyMetadataInfo_ListByResourceGroup.json + */ + /** + * Sample code: IamAccessKeyMetadataInfo_ListByResourceGroup. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void iamAccessKeyMetadataInfoListByResourceGroup( + com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.iamAccessKeyMetadataInfoes() + .listByResourceGroup("rgiamAccessKeyMetadata", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/IamAccessKeyMetadataInfoListSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/IamAccessKeyMetadataInfoListSamples.java new file mode 100644 index 000000000000..69ece03807c2 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/IamAccessKeyMetadataInfoListSamples.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +/** + * Samples for IamAccessKeyMetadataInfo List. + */ +public final class IamAccessKeyMetadataInfoListSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * IamAccessKeyMetadataInfo_ListBySubscription.json + */ + /** + * Sample code: IamAccessKeyMetadataInfo_ListBySubscription. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + iamAccessKeyMetadataInfoListBySubscription(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.iamAccessKeyMetadataInfoes().list(com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/IamAccessKeyMetadataInfoUpdateSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/IamAccessKeyMetadataInfoUpdateSamples.java new file mode 100644 index 000000000000..35641586ca1f --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/IamAccessKeyMetadataInfoUpdateSamples.java @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +import com.azure.resourcemanager.awsconnector.models.IamAccessKeyMetadata; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for IamAccessKeyMetadataInfo Update. + */ +public final class IamAccessKeyMetadataInfoUpdateSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * IamAccessKeyMetadataInfo_Update.json + */ + /** + * Sample code: IamAccessKeyMetadataInfo_Update. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + iamAccessKeyMetadataInfoUpdate(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + IamAccessKeyMetadata resource = manager.iamAccessKeyMetadataInfoes() + .getByResourceGroupWithResponse("rgiamAccessKeyMetadata", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE) + .getValue(); + resource.update().withTags(mapOf("key2001", "fakeTokenPlaceholder")).apply(); + } + + // Use "Map.of" if available + @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/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/IamGroupsCreateOrReplaceSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/IamGroupsCreateOrReplaceSamples.java new file mode 100644 index 000000000000..8d1f33df1306 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/IamGroupsCreateOrReplaceSamples.java @@ -0,0 +1,63 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +import com.azure.resourcemanager.awsconnector.models.AwsIamGroupProperties; +import com.azure.resourcemanager.awsconnector.models.IamGroupProperties; +import com.azure.resourcemanager.awsconnector.models.Policy; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for IamGroups CreateOrReplace. + */ +public final class IamGroupsCreateOrReplaceSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * IamGroups_CreateOrReplace.json + */ + /** + * Sample code: IamGroups_CreateOrReplace. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void iamGroupsCreateOrReplace(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.iamGroups() + .define("Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])") + .withRegion("badqu") + .withExistingResourceGroup("rgiamGroup") + .withTags(mapOf("key3844", "fakeTokenPlaceholder")) + .withProperties( + new IamGroupProperties() + .withAwsProperties(new AwsIamGroupProperties().withArn("qaymkzqiwzdilzpmfapwpudc") + .withGroupName("zcmfl") + .withManagedPolicyArns(Arrays.asList("uqek")) + .withPath("liuneeastp") + .withPolicies(Arrays.asList( + new Policy().withPolicyDocument(mapOf()).withPolicyName("cokejufrpuszoopjjywwxopal")))) + .withPublicCloudConnectorsResourceId("fjfneaczmcscofgdjnxw") + .withAwsAccountId("obfwwcnhlgytlanolsfrdn") + .withArn("yvnnjydmrptjbytuyca") + .withPublicCloudResourceName("hj") + .withAwsSourceSchema("kprcuajdxtfckwviyxpajstzdjeb") + .withAwsRegion("uqzi") + .withAwsTags(mapOf("key9078", "fakeTokenPlaceholder"))) + .create(); + } + + // Use "Map.of" if available + @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/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/IamGroupsDeleteSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/IamGroupsDeleteSamples.java new file mode 100644 index 000000000000..4cbf79c61eff --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/IamGroupsDeleteSamples.java @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +/** + * Samples for IamGroups Delete. + */ +public final class IamGroupsDeleteSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/IamGroups_Delete. + * json + */ + /** + * Sample code: IamGroups_Delete. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void iamGroupsDelete(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.iamGroups() + .delete("rgiamGroup", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/IamGroupsGetByResourceGroupSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/IamGroupsGetByResourceGroupSamples.java new file mode 100644 index 000000000000..d75a79dad304 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/IamGroupsGetByResourceGroupSamples.java @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +/** + * Samples for IamGroups GetByResourceGroup. + */ +public final class IamGroupsGetByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/IamGroups_Get.json + */ + /** + * Sample code: IamGroups_Get. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void iamGroupsGet(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.iamGroups() + .getByResourceGroupWithResponse("rgiamGroup", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/IamGroupsListByResourceGroupSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/IamGroupsListByResourceGroupSamples.java new file mode 100644 index 000000000000..32976d222547 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/IamGroupsListByResourceGroupSamples.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +/** + * Samples for IamGroups ListByResourceGroup. + */ +public final class IamGroupsListByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * IamGroups_ListByResourceGroup.json + */ + /** + * Sample code: IamGroups_ListByResourceGroup. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + iamGroupsListByResourceGroup(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.iamGroups().listByResourceGroup("rgiamGroup", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/IamGroupsListSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/IamGroupsListSamples.java new file mode 100644 index 000000000000..05703728cb9f --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/IamGroupsListSamples.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.awsconnector.generated; + +/** + * Samples for IamGroups List. + */ +public final class IamGroupsListSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * IamGroups_ListBySubscription.json + */ + /** + * Sample code: IamGroups_ListBySubscription. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void iamGroupsListBySubscription(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.iamGroups().list(com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/IamGroupsUpdateSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/IamGroupsUpdateSamples.java new file mode 100644 index 000000000000..f4882500b7db --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/IamGroupsUpdateSamples.java @@ -0,0 +1,45 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +import com.azure.resourcemanager.awsconnector.models.IamGroup; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for IamGroups Update. + */ +public final class IamGroupsUpdateSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/IamGroups_Update. + * json + */ + /** + * Sample code: IamGroups_Update. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void iamGroupsUpdate(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + IamGroup resource = manager.iamGroups() + .getByResourceGroupWithResponse("rgiamGroup", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE) + .getValue(); + resource.update().withTags(mapOf("key6243", "fakeTokenPlaceholder")).apply(); + } + + // Use "Map.of" if available + @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/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/IamInstanceProfilesCreateOrUpdateSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/IamInstanceProfilesCreateOrUpdateSamples.java new file mode 100644 index 000000000000..5b2d8540f988 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/IamInstanceProfilesCreateOrUpdateSamples.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.awsconnector.generated; + +import com.azure.resourcemanager.awsconnector.models.AwsIamInstanceProfileProperties; +import com.azure.resourcemanager.awsconnector.models.IamInstanceProfileProperties; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for IamInstanceProfiles CreateOrUpdate. + */ +public final class IamInstanceProfilesCreateOrUpdateSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * IamInstanceProfiles_CreateOrUpdate.json + */ + /** + * Sample code: IamInstanceProfiles_CreateOrUpdate. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + iamInstanceProfilesCreateOrUpdate(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.iamInstanceProfiles() + .define("Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])") + .withRegion("unn") + .withExistingResourceGroup("rgiamInstanceProfile") + .withTags(mapOf("key6049", "fakeTokenPlaceholder")) + .withProperties(new IamInstanceProfileProperties() + .withAwsProperties(new AwsIamInstanceProfileProperties().withArn("xfilqplkerenzrkykjnnoj") + .withInstanceProfileName("ccstflwsxmpatrvscwxoukagqblzt") + .withPath("edfwubhvvye") + .withRoles(Arrays.asList("nrvsijvbwdodraufvsxmbcbnm"))) + .withPublicCloudConnectorsResourceId("opbcrtwimfuirxph") + .withAwsAccountId("zhhymhiivdmwoidycnqdtzarowwjm") + .withArn("djpzkfxattxqgrwdgl") + .withPublicCloudResourceName("qbxqhspttfymekhofojyqu") + .withAwsSourceSchema("vitibwpeaozvgjcibxrqodn") + .withAwsRegion("dwnkitebqhhqjrkjjlhtjryvhsuz") + .withAwsTags(mapOf("key3394", "fakeTokenPlaceholder"))) + .create(); + } + + // Use "Map.of" if available + @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/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/IamInstanceProfilesDeleteSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/IamInstanceProfilesDeleteSamples.java new file mode 100644 index 000000000000..6cf3563e9e2b --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/IamInstanceProfilesDeleteSamples.java @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +/** + * Samples for IamInstanceProfiles Delete. + */ +public final class IamInstanceProfilesDeleteSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * IamInstanceProfiles_Delete.json + */ + /** + * Sample code: IamInstanceProfiles_Delete. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void iamInstanceProfilesDelete(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.iamInstanceProfiles() + .delete("rgiamInstanceProfile", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/IamInstanceProfilesGetByResourceGroupSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/IamInstanceProfilesGetByResourceGroupSamples.java new file mode 100644 index 000000000000..c8a0456b402d --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/IamInstanceProfilesGetByResourceGroupSamples.java @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +/** + * Samples for IamInstanceProfiles GetByResourceGroup. + */ +public final class IamInstanceProfilesGetByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * IamInstanceProfiles_Get.json + */ + /** + * Sample code: IamInstanceProfiles_Get. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void iamInstanceProfilesGet(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.iamInstanceProfiles() + .getByResourceGroupWithResponse("rgiamInstanceProfile", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/IamInstanceProfilesListByResourceGroupSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/IamInstanceProfilesListByResourceGroupSamples.java new file mode 100644 index 000000000000..59b09975c0b5 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/IamInstanceProfilesListByResourceGroupSamples.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +/** + * Samples for IamInstanceProfiles ListByResourceGroup. + */ +public final class IamInstanceProfilesListByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * IamInstanceProfiles_ListByResourceGroup.json + */ + /** + * Sample code: IamInstanceProfiles_ListByResourceGroup. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + iamInstanceProfilesListByResourceGroup(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.iamInstanceProfiles().listByResourceGroup("rgiamInstanceProfile", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/IamInstanceProfilesListSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/IamInstanceProfilesListSamples.java new file mode 100644 index 000000000000..ed092f98dfb3 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/IamInstanceProfilesListSamples.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +/** + * Samples for IamInstanceProfiles List. + */ +public final class IamInstanceProfilesListSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * IamInstanceProfiles_ListBySubscription.json + */ + /** + * Sample code: IamInstanceProfiles_ListBySubscription. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + iamInstanceProfilesListBySubscription(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.iamInstanceProfiles().list(com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/IamInstanceProfilesUpdateSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/IamInstanceProfilesUpdateSamples.java new file mode 100644 index 000000000000..7b3878dce7ca --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/IamInstanceProfilesUpdateSamples.java @@ -0,0 +1,45 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +import com.azure.resourcemanager.awsconnector.models.IamInstanceProfileAutoGenerated; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for IamInstanceProfiles Update. + */ +public final class IamInstanceProfilesUpdateSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * IamInstanceProfiles_Update.json + */ + /** + * Sample code: IamInstanceProfiles_Update. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void iamInstanceProfilesUpdate(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + IamInstanceProfileAutoGenerated resource = manager.iamInstanceProfiles() + .getByResourceGroupWithResponse("rgiamInstanceProfile", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE) + .getValue(); + resource.update().withTags(mapOf("key5002", "fakeTokenPlaceholder")).apply(); + } + + // Use "Map.of" if available + @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/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/IamMfaDevicesCreateOrReplaceSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/IamMfaDevicesCreateOrReplaceSamples.java new file mode 100644 index 000000000000..899e82e4afab --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/IamMfaDevicesCreateOrReplaceSamples.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.awsconnector.generated; + +import com.azure.resourcemanager.awsconnector.models.AwsIamMfaDeviceProperties; +import com.azure.resourcemanager.awsconnector.models.IamMfaDeviceProperties; +import java.time.OffsetDateTime; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for IamMfaDevices CreateOrReplace. + */ +public final class IamMfaDevicesCreateOrReplaceSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * IamMfaDevices_CreateOrReplace.json + */ + /** + * Sample code: IamMfaDevices_CreateOrReplace. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + iamMfaDevicesCreateOrReplace(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.iamMfaDevices() + .define("Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])") + .withRegion("ytpxpjmmspx") + .withExistingResourceGroup("rgiamMFADevice") + .withTags(mapOf("key9234", "fakeTokenPlaceholder")) + .withProperties(new IamMfaDeviceProperties() + .withAwsProperties( + new AwsIamMfaDeviceProperties().withEnableDate(OffsetDateTime.parse("2024-10-08T03:50:03.364Z")) + .withSerialNumber("ifphqcwiounuuootrnmxmm") + .withUsername("jyjbnteckbccmmhbxjdk")) + .withPublicCloudConnectorsResourceId("jmcknwcktcj") + .withAwsAccountId("tdapkqeuuvrrasue") + .withArn("hbymjvsaxodse") + .withPublicCloudResourceName("vexrvwqtzdijlzwecmljscwepj") + .withAwsSourceSchema("ibnflrkwkaswdrsmaqtegtnky") + .withAwsRegion("uwyckzldxxj") + .withAwsTags(mapOf("key581", "fakeTokenPlaceholder"))) + .create(); + } + + // Use "Map.of" if available + @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/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/IamMfaDevicesDeleteSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/IamMfaDevicesDeleteSamples.java new file mode 100644 index 000000000000..fe93bc057659 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/IamMfaDevicesDeleteSamples.java @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +/** + * Samples for IamMfaDevices Delete. + */ +public final class IamMfaDevicesDeleteSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * IamMfaDevices_Delete.json + */ + /** + * Sample code: IamMfaDevices_Delete. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void iamMfaDevicesDelete(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.iamMfaDevices() + .delete("rgiamMFADevice", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/IamMfaDevicesGetByResourceGroupSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/IamMfaDevicesGetByResourceGroupSamples.java new file mode 100644 index 000000000000..695e2341be0c --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/IamMfaDevicesGetByResourceGroupSamples.java @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +/** + * Samples for IamMfaDevices GetByResourceGroup. + */ +public final class IamMfaDevicesGetByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/IamMfaDevices_Get. + * json + */ + /** + * Sample code: IamMfaDevices_Get. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void iamMfaDevicesGet(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.iamMfaDevices() + .getByResourceGroupWithResponse("rgiamMFADevice", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/IamMfaDevicesListByResourceGroupSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/IamMfaDevicesListByResourceGroupSamples.java new file mode 100644 index 000000000000..4fb5aaaec492 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/IamMfaDevicesListByResourceGroupSamples.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +/** + * Samples for IamMfaDevices ListByResourceGroup. + */ +public final class IamMfaDevicesListByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * IamMfaDevices_ListByResourceGroup.json + */ + /** + * Sample code: IamMfaDevices_ListByResourceGroup. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + iamMfaDevicesListByResourceGroup(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.iamMfaDevices().listByResourceGroup("rgiamMFADevice", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/IamMfaDevicesListSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/IamMfaDevicesListSamples.java new file mode 100644 index 000000000000..c10393e8565a --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/IamMfaDevicesListSamples.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +/** + * Samples for IamMfaDevices List. + */ +public final class IamMfaDevicesListSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * IamMfaDevices_ListBySubscription.json + */ + /** + * Sample code: IamMfaDevices_ListBySubscription. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + iamMfaDevicesListBySubscription(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.iamMfaDevices().list(com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/IamMfaDevicesUpdateSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/IamMfaDevicesUpdateSamples.java new file mode 100644 index 000000000000..3d42d27070a3 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/IamMfaDevicesUpdateSamples.java @@ -0,0 +1,45 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +import com.azure.resourcemanager.awsconnector.models.IamMfaDevice; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for IamMfaDevices Update. + */ +public final class IamMfaDevicesUpdateSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * IamMfaDevices_Update.json + */ + /** + * Sample code: IamMfaDevices_Update. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void iamMfaDevicesUpdate(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + IamMfaDevice resource = manager.iamMfaDevices() + .getByResourceGroupWithResponse("rgiamMFADevice", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE) + .getValue(); + resource.update().withTags(mapOf("key2615", "fakeTokenPlaceholder")).apply(); + } + + // Use "Map.of" if available + @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/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/IamPasswordPoliciesCreateOrReplaceSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/IamPasswordPoliciesCreateOrReplaceSamples.java new file mode 100644 index 000000000000..3d8b712a3c60 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/IamPasswordPoliciesCreateOrReplaceSamples.java @@ -0,0 +1,65 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +import com.azure.resourcemanager.awsconnector.models.AwsIamPasswordPolicyProperties; +import com.azure.resourcemanager.awsconnector.models.IamPasswordPolicyProperties; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for IamPasswordPolicies CreateOrReplace. + */ +public final class IamPasswordPoliciesCreateOrReplaceSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * IamPasswordPolicies_CreateOrReplace.json + */ + /** + * Sample code: IamPasswordPolicies_CreateOrReplace. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + iamPasswordPoliciesCreateOrReplace(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.iamPasswordPolicies() + .define("Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])") + .withRegion("zirvnbwoooczkma") + .withExistingResourceGroup("rgiamPasswordPolicy") + .withTags(mapOf("key5111", "fakeTokenPlaceholder")) + .withProperties(new IamPasswordPolicyProperties() + .withAwsProperties(new AwsIamPasswordPolicyProperties().withAllowUsersToChangePassword(true) + .withExpirePasswords(true) + .withHardExpiry(true) + .withMaxPasswordAge(1) + .withMinimumPasswordLength(17) + .withPasswordReusePrevention(30) + .withRequireLowercaseCharacters(true) + .withRequireNumbers(true) + .withRequireSymbols(true) + .withRequireUppercaseCharacters(true)) + .withPublicCloudConnectorsResourceId("zsyi") + .withAwsAccountId("iiripspbzbqibqazbnef") + .withArn("irgrdslydjpuoyb") + .withPublicCloudResourceName("zuwprynvflpuik") + .withAwsSourceSchema("gud") + .withAwsRegion("mqpdjjdzdwew") + .withAwsTags(mapOf("key6748", "fakeTokenPlaceholder"))) + .create(); + } + + // Use "Map.of" if available + @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/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/IamPasswordPoliciesDeleteSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/IamPasswordPoliciesDeleteSamples.java new file mode 100644 index 000000000000..6f848e74966f --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/IamPasswordPoliciesDeleteSamples.java @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +/** + * Samples for IamPasswordPolicies Delete. + */ +public final class IamPasswordPoliciesDeleteSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * IamPasswordPolicies_Delete.json + */ + /** + * Sample code: IamPasswordPolicies_Delete. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void iamPasswordPoliciesDelete(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.iamPasswordPolicies() + .delete("rgiamPasswordPolicy", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/IamPasswordPoliciesGetByResourceGroupSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/IamPasswordPoliciesGetByResourceGroupSamples.java new file mode 100644 index 000000000000..b36a16765633 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/IamPasswordPoliciesGetByResourceGroupSamples.java @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +/** + * Samples for IamPasswordPolicies GetByResourceGroup. + */ +public final class IamPasswordPoliciesGetByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * IamPasswordPolicies_Get.json + */ + /** + * Sample code: IamPasswordPolicies_Get. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void iamPasswordPoliciesGet(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.iamPasswordPolicies() + .getByResourceGroupWithResponse("rgiamPasswordPolicy", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/IamPasswordPoliciesListByResourceGroupSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/IamPasswordPoliciesListByResourceGroupSamples.java new file mode 100644 index 000000000000..b0ac07fc1885 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/IamPasswordPoliciesListByResourceGroupSamples.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +/** + * Samples for IamPasswordPolicies ListByResourceGroup. + */ +public final class IamPasswordPoliciesListByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * IamPasswordPolicies_ListByResourceGroup.json + */ + /** + * Sample code: IamPasswordPolicies_ListByResourceGroup. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + iamPasswordPoliciesListByResourceGroup(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.iamPasswordPolicies().listByResourceGroup("rgiamPasswordPolicy", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/IamPasswordPoliciesListSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/IamPasswordPoliciesListSamples.java new file mode 100644 index 000000000000..5a3ed0262c16 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/IamPasswordPoliciesListSamples.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +/** + * Samples for IamPasswordPolicies List. + */ +public final class IamPasswordPoliciesListSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * IamPasswordPolicies_ListBySubscription.json + */ + /** + * Sample code: IamPasswordPolicies_ListBySubscription. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + iamPasswordPoliciesListBySubscription(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.iamPasswordPolicies().list(com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/IamPasswordPoliciesUpdateSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/IamPasswordPoliciesUpdateSamples.java new file mode 100644 index 000000000000..23d4b757ad98 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/IamPasswordPoliciesUpdateSamples.java @@ -0,0 +1,45 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +import com.azure.resourcemanager.awsconnector.models.IamPasswordPolicy; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for IamPasswordPolicies Update. + */ +public final class IamPasswordPoliciesUpdateSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * IamPasswordPolicies_Update.json + */ + /** + * Sample code: IamPasswordPolicies_Update. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void iamPasswordPoliciesUpdate(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + IamPasswordPolicy resource = manager.iamPasswordPolicies() + .getByResourceGroupWithResponse("rgiamPasswordPolicy", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE) + .getValue(); + resource.update().withTags(mapOf("key6732", "fakeTokenPlaceholder")).apply(); + } + + // Use "Map.of" if available + @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/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/IamPolicyVersionsCreateOrReplaceSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/IamPolicyVersionsCreateOrReplaceSamples.java new file mode 100644 index 000000000000..3d0c2a161dcf --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/IamPolicyVersionsCreateOrReplaceSamples.java @@ -0,0 +1,61 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +import com.azure.resourcemanager.awsconnector.models.AwsIamPolicyVersionProperties; +import com.azure.resourcemanager.awsconnector.models.IamPolicyVersionProperties; +import java.time.OffsetDateTime; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for IamPolicyVersions CreateOrReplace. + */ +public final class IamPolicyVersionsCreateOrReplaceSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * IamPolicyVersions_CreateOrReplace.json + */ + /** + * Sample code: IamPolicyVersions_CreateOrReplace. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + iamPolicyVersionsCreateOrReplace(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.iamPolicyVersions() + .define("Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])") + .withRegion("wtyx") + .withExistingResourceGroup("rgiamPolicyVersion") + .withTags(mapOf("key6034", "fakeTokenPlaceholder")) + .withProperties(new IamPolicyVersionProperties() + .withAwsProperties( + new AwsIamPolicyVersionProperties().withCreateDate(OffsetDateTime.parse("2024-10-08T03:54:21.310Z")) + .withDocument("bpzfzhilykgroobhu") + .withIsDefaultVersion(true) + .withVersionId("mjxbhpksrctdbegeyhrsyveoyre")) + .withPublicCloudConnectorsResourceId("hqotja") + .withAwsAccountId("xiv") + .withArn("mszogqxtswvseqggugfxstkwivx") + .withPublicCloudResourceName("mphznssuferlzunnbjbl") + .withAwsSourceSchema("ljldtynekavvptoqhcvqdklc") + .withAwsRegion("bhdamksbkmvjl") + .withAwsTags(mapOf("key2871", "fakeTokenPlaceholder"))) + .create(); + } + + // Use "Map.of" if available + @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/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/IamPolicyVersionsDeleteSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/IamPolicyVersionsDeleteSamples.java new file mode 100644 index 000000000000..3aeda0808a53 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/IamPolicyVersionsDeleteSamples.java @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +/** + * Samples for IamPolicyVersions Delete. + */ +public final class IamPolicyVersionsDeleteSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * IamPolicyVersions_Delete.json + */ + /** + * Sample code: IamPolicyVersions_Delete. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void iamPolicyVersionsDelete(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.iamPolicyVersions() + .delete("rgiamPolicyVersion", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/IamPolicyVersionsGetByResourceGroupSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/IamPolicyVersionsGetByResourceGroupSamples.java new file mode 100644 index 000000000000..8c1eced92abd --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/IamPolicyVersionsGetByResourceGroupSamples.java @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +/** + * Samples for IamPolicyVersions GetByResourceGroup. + */ +public final class IamPolicyVersionsGetByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * IamPolicyVersions_Get.json + */ + /** + * Sample code: IamPolicyVersions_Get. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void iamPolicyVersionsGet(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.iamPolicyVersions() + .getByResourceGroupWithResponse("rgiamPolicyVersion", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/IamPolicyVersionsListByResourceGroupSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/IamPolicyVersionsListByResourceGroupSamples.java new file mode 100644 index 000000000000..5c9f579845b5 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/IamPolicyVersionsListByResourceGroupSamples.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +/** + * Samples for IamPolicyVersions ListByResourceGroup. + */ +public final class IamPolicyVersionsListByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * IamPolicyVersions_ListByResourceGroup.json + */ + /** + * Sample code: IamPolicyVersions_ListByResourceGroup. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + iamPolicyVersionsListByResourceGroup(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.iamPolicyVersions().listByResourceGroup("rgiamPolicyVersion", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/IamPolicyVersionsListSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/IamPolicyVersionsListSamples.java new file mode 100644 index 000000000000..6b0c12587706 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/IamPolicyVersionsListSamples.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +/** + * Samples for IamPolicyVersions List. + */ +public final class IamPolicyVersionsListSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * IamPolicyVersions_ListBySubscription.json + */ + /** + * Sample code: IamPolicyVersions_ListBySubscription. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + iamPolicyVersionsListBySubscription(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.iamPolicyVersions().list(com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/IamPolicyVersionsUpdateSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/IamPolicyVersionsUpdateSamples.java new file mode 100644 index 000000000000..4783079ecbd4 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/IamPolicyVersionsUpdateSamples.java @@ -0,0 +1,45 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +import com.azure.resourcemanager.awsconnector.models.IamPolicyVersion; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for IamPolicyVersions Update. + */ +public final class IamPolicyVersionsUpdateSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * IamPolicyVersions_Update.json + */ + /** + * Sample code: IamPolicyVersions_Update. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void iamPolicyVersionsUpdate(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + IamPolicyVersion resource = manager.iamPolicyVersions() + .getByResourceGroupWithResponse("rgiamPolicyVersion", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE) + .getValue(); + resource.update().withTags(mapOf("key2276", "fakeTokenPlaceholder")).apply(); + } + + // Use "Map.of" if available + @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/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/IamRolesCreateOrReplaceSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/IamRolesCreateOrReplaceSamples.java new file mode 100644 index 000000000000..468f42a68190 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/IamRolesCreateOrReplaceSamples.java @@ -0,0 +1,70 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +import com.azure.resourcemanager.awsconnector.models.AwsIamRoleProperties; +import com.azure.resourcemanager.awsconnector.models.IamRoleProperties; +import com.azure.resourcemanager.awsconnector.models.PolicyAutoGenerated; +import com.azure.resourcemanager.awsconnector.models.TagAutoGenerated32; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for IamRoles CreateOrReplace. + */ +public final class IamRolesCreateOrReplaceSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * IamRoles_CreateOrReplace.json + */ + /** + * Sample code: IamRoles_CreateOrReplace. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void iamRolesCreateOrReplace(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.iamRoles() + .define("Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])") + .withRegion("vkzeblhpdgxwu") + .withExistingResourceGroup("rgiamRole") + .withTags(mapOf("key3308", "fakeTokenPlaceholder")) + .withProperties(new IamRoleProperties() + .withAwsProperties(new AwsIamRoleProperties().withArn("iqe") + .withAssumeRolePolicyDocument(mapOf()) + .withDescription("spayefp") + .withManagedPolicyArns(Arrays.asList("twfombcdqlzq")) + .withMaxSessionDuration(16) + .withPath("qxfdn") + .withPermissionsBoundary("wofktscexalvotvxaxsq") + .withPolicies(Arrays.asList(new PolicyAutoGenerated().withPolicyDocument(mapOf()) + .withPolicyName("bpqsmdhzxaruuvctyddrcedbf"))) + .withRoleId("l") + .withRoleName("vpczljoyhnvybvtyagxaxaraogzdyx") + .withTags(Arrays.asList( + new TagAutoGenerated32().withKey("fakeTokenPlaceholder").withValue("jcpberdkjmspmjbzyewyhyd")))) + .withPublicCloudConnectorsResourceId("cchmzoxsgytenwavdwoarear") + .withAwsAccountId("qlndbvxbvf") + .withArn("cllfeatxzjqiqr") + .withPublicCloudResourceName("qn") + .withAwsSourceSchema("onnjxuscupomucwhpltcnogwhxllm") + .withAwsRegion("yqtvmgzsvcgtehapncinnqvsql") + .withAwsTags(mapOf("key9018", "fakeTokenPlaceholder"))) + .create(); + } + + // Use "Map.of" if available + @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/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/IamRolesDeleteSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/IamRolesDeleteSamples.java new file mode 100644 index 000000000000..9ae31dde111c --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/IamRolesDeleteSamples.java @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +/** + * Samples for IamRoles Delete. + */ +public final class IamRolesDeleteSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/IamRoles_Delete. + * json + */ + /** + * Sample code: IamRoles_Delete. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void iamRolesDelete(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.iamRoles() + .delete("rgiamRole", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/IamRolesGetByResourceGroupSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/IamRolesGetByResourceGroupSamples.java new file mode 100644 index 000000000000..9c3f8e58029a --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/IamRolesGetByResourceGroupSamples.java @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +/** + * Samples for IamRoles GetByResourceGroup. + */ +public final class IamRolesGetByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/IamRoles_Get.json + */ + /** + * Sample code: IamRoles_Get. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void iamRolesGet(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.iamRoles() + .getByResourceGroupWithResponse("rgiamRole", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/IamRolesListByResourceGroupSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/IamRolesListByResourceGroupSamples.java new file mode 100644 index 000000000000..7f892fbbb13a --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/IamRolesListByResourceGroupSamples.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.awsconnector.generated; + +/** + * Samples for IamRoles ListByResourceGroup. + */ +public final class IamRolesListByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * IamRoles_ListByResourceGroup.json + */ + /** + * Sample code: IamRoles_ListByResourceGroup. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void iamRolesListByResourceGroup(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.iamRoles().listByResourceGroup("rgiamRole", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/IamRolesListSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/IamRolesListSamples.java new file mode 100644 index 000000000000..0739bc44b018 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/IamRolesListSamples.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.awsconnector.generated; + +/** + * Samples for IamRoles List. + */ +public final class IamRolesListSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * IamRoles_ListBySubscription.json + */ + /** + * Sample code: IamRoles_ListBySubscription. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void iamRolesListBySubscription(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.iamRoles().list(com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/IamRolesUpdateSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/IamRolesUpdateSamples.java new file mode 100644 index 000000000000..69bfbdcd3dc2 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/IamRolesUpdateSamples.java @@ -0,0 +1,45 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +import com.azure.resourcemanager.awsconnector.models.IamRole; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for IamRoles Update. + */ +public final class IamRolesUpdateSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/IamRoles_Update. + * json + */ + /** + * Sample code: IamRoles_Update. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void iamRolesUpdate(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + IamRole resource = manager.iamRoles() + .getByResourceGroupWithResponse("rgiamRole", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE) + .getValue(); + resource.update().withTags(mapOf("key3141", "fakeTokenPlaceholder")).apply(); + } + + // Use "Map.of" if available + @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/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/IamServerCertificatesCreateOrReplaceSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/IamServerCertificatesCreateOrReplaceSamples.java new file mode 100644 index 000000000000..59b6e3bc1cbd --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/IamServerCertificatesCreateOrReplaceSamples.java @@ -0,0 +1,65 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +import com.azure.resourcemanager.awsconnector.models.AwsIamServerCertificateProperties; +import com.azure.resourcemanager.awsconnector.models.IamServerCertificateProperties; +import com.azure.resourcemanager.awsconnector.models.TagAutoGenerated33; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for IamServerCertificates CreateOrReplace. + */ +public final class IamServerCertificatesCreateOrReplaceSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * IamServerCertificates_CreateOrReplace.json + */ + /** + * Sample code: IamServerCertificates_CreateOrReplace. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + iamServerCertificatesCreateOrReplace(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.iamServerCertificates() + .define("Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])") + .withRegion("ddjdvyseqfbfufjoxr") + .withExistingResourceGroup("rgiamServerCertificate") + .withTags(mapOf("key6646", "fakeTokenPlaceholder")) + .withProperties(new IamServerCertificateProperties() + .withAwsProperties(new AwsIamServerCertificateProperties().withArn("ahekoegi") + .withCertificateBody("fagqepujrwsvkhdrvofvmkderig") + .withCertificateChain("ozzjlnmjijy") + .withPath("qvvxpzaoshpkkvncguxmv") + .withPrivateKey("fakeTokenPlaceholder") + .withServerCertificateName("yblyjjfteysombtxapaqjkrqo") + .withTags(Arrays.asList( + new TagAutoGenerated33().withKey("fakeTokenPlaceholder").withValue("jstuopgodfwmzigjbb")))) + .withPublicCloudConnectorsResourceId("iqnmafujozzlwfnhamvbhfjcuob") + .withAwsAccountId("egfew") + .withArn("fkbemnwycxjjjxwievb") + .withPublicCloudResourceName("g") + .withAwsSourceSchema("hlvxmkdmh") + .withAwsRegion("gflixuzdblwuy") + .withAwsTags(mapOf("key1989", "fakeTokenPlaceholder"))) + .create(); + } + + // Use "Map.of" if available + @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/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/IamServerCertificatesDeleteSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/IamServerCertificatesDeleteSamples.java new file mode 100644 index 000000000000..d8f3693b98e1 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/IamServerCertificatesDeleteSamples.java @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +/** + * Samples for IamServerCertificates Delete. + */ +public final class IamServerCertificatesDeleteSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * IamServerCertificates_Delete.json + */ + /** + * Sample code: IamServerCertificates_Delete. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void iamServerCertificatesDelete(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.iamServerCertificates() + .delete("rgiamServerCertificate", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/IamServerCertificatesGetByResourceGroupSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/IamServerCertificatesGetByResourceGroupSamples.java new file mode 100644 index 000000000000..f49f94d21324 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/IamServerCertificatesGetByResourceGroupSamples.java @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +/** + * Samples for IamServerCertificates GetByResourceGroup. + */ +public final class IamServerCertificatesGetByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * IamServerCertificates_Get.json + */ + /** + * Sample code: IamServerCertificates_Get. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void iamServerCertificatesGet(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.iamServerCertificates() + .getByResourceGroupWithResponse("rgiamServerCertificate", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/IamServerCertificatesListByResourceGroupSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/IamServerCertificatesListByResourceGroupSamples.java new file mode 100644 index 000000000000..05f697179bc4 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/IamServerCertificatesListByResourceGroupSamples.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +/** + * Samples for IamServerCertificates ListByResourceGroup. + */ +public final class IamServerCertificatesListByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * IamServerCertificates_ListByResourceGroup.json + */ + /** + * Sample code: IamServerCertificates_ListByResourceGroup. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + iamServerCertificatesListByResourceGroup(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.iamServerCertificates().listByResourceGroup("rgiamServerCertificate", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/IamServerCertificatesListSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/IamServerCertificatesListSamples.java new file mode 100644 index 000000000000..b6c47ee51e29 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/IamServerCertificatesListSamples.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +/** + * Samples for IamServerCertificates List. + */ +public final class IamServerCertificatesListSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * IamServerCertificates_ListBySubscription.json + */ + /** + * Sample code: IamServerCertificates_ListBySubscription. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + iamServerCertificatesListBySubscription(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.iamServerCertificates().list(com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/IamServerCertificatesUpdateSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/IamServerCertificatesUpdateSamples.java new file mode 100644 index 000000000000..eca53b70c613 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/IamServerCertificatesUpdateSamples.java @@ -0,0 +1,45 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +import com.azure.resourcemanager.awsconnector.models.IamServerCertificate; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for IamServerCertificates Update. + */ +public final class IamServerCertificatesUpdateSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * IamServerCertificates_Update.json + */ + /** + * Sample code: IamServerCertificates_Update. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void iamServerCertificatesUpdate(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + IamServerCertificate resource = manager.iamServerCertificates() + .getByResourceGroupWithResponse("rgiamServerCertificate", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE) + .getValue(); + resource.update().withTags(mapOf("key4287", "fakeTokenPlaceholder")).apply(); + } + + // Use "Map.of" if available + @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/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/IamVirtualMfaDevicesCreateOrReplaceSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/IamVirtualMfaDevicesCreateOrReplaceSamples.java new file mode 100644 index 000000000000..a474e0808989 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/IamVirtualMfaDevicesCreateOrReplaceSamples.java @@ -0,0 +1,63 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +import com.azure.resourcemanager.awsconnector.models.AwsIamVirtualMfaDeviceProperties; +import com.azure.resourcemanager.awsconnector.models.IamVirtualMfaDeviceProperties; +import com.azure.resourcemanager.awsconnector.models.TagAutoGenerated34; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for IamVirtualMfaDevices CreateOrReplace. + */ +public final class IamVirtualMfaDevicesCreateOrReplaceSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * IamVirtualMfaDevices_CreateOrReplace.json + */ + /** + * Sample code: IamVirtualMfaDevices_CreateOrReplace. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + iamVirtualMfaDevicesCreateOrReplace(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.iamVirtualMfaDevices() + .define("Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])") + .withRegion("ixkqwzfnsthfshdlvsvh") + .withExistingResourceGroup("rgiamVirtualMFADevice") + .withTags(mapOf("key2474", "fakeTokenPlaceholder")) + .withProperties(new IamVirtualMfaDeviceProperties() + .withAwsProperties(new AwsIamVirtualMfaDeviceProperties().withPath("iuiajbhehzagt") + .withSerialNumber("zbsulwrnmmhdwuelwbybavq") + .withTags(Arrays.asList( + new TagAutoGenerated34().withKey("fakeTokenPlaceholder").withValue("kpmtbersaovhycdipca"))) + .withUsers(Arrays.asList("pzktvxysprnhhivbnuuutllcomxp")) + .withVirtualMfaDeviceName("m")) + .withPublicCloudConnectorsResourceId("chegzvubkwsrhocspiedvdrzuhkjo") + .withAwsAccountId("deoktff") + .withArn("soptozsivfaghgr") + .withPublicCloudResourceName("uktgscbqvuprtkj") + .withAwsSourceSchema("iotqvkkgxaoeewgxegimnri") + .withAwsRegion("h") + .withAwsTags(mapOf("key1965", "fakeTokenPlaceholder"))) + .create(); + } + + // Use "Map.of" if available + @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/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/IamVirtualMfaDevicesDeleteSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/IamVirtualMfaDevicesDeleteSamples.java new file mode 100644 index 000000000000..712bb960cdb1 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/IamVirtualMfaDevicesDeleteSamples.java @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +/** + * Samples for IamVirtualMfaDevices Delete. + */ +public final class IamVirtualMfaDevicesDeleteSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * IamVirtualMfaDevices_Delete.json + */ + /** + * Sample code: IamVirtualMfaDevices_Delete. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void iamVirtualMfaDevicesDelete(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.iamVirtualMfaDevices() + .delete("rgiamVirtualMFADevice", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/IamVirtualMfaDevicesGetByResourceGroupSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/IamVirtualMfaDevicesGetByResourceGroupSamples.java new file mode 100644 index 000000000000..0795f123bad4 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/IamVirtualMfaDevicesGetByResourceGroupSamples.java @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +/** + * Samples for IamVirtualMfaDevices GetByResourceGroup. + */ +public final class IamVirtualMfaDevicesGetByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * IamVirtualMfaDevices_Get.json + */ + /** + * Sample code: IamVirtualMfaDevices_Get. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void iamVirtualMfaDevicesGet(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.iamVirtualMfaDevices() + .getByResourceGroupWithResponse("rgiamVirtualMFADevice", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/IamVirtualMfaDevicesListByResourceGroupSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/IamVirtualMfaDevicesListByResourceGroupSamples.java new file mode 100644 index 000000000000..96f5def53be5 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/IamVirtualMfaDevicesListByResourceGroupSamples.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +/** + * Samples for IamVirtualMfaDevices ListByResourceGroup. + */ +public final class IamVirtualMfaDevicesListByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * IamVirtualMfaDevices_ListByResourceGroup.json + */ + /** + * Sample code: IamVirtualMfaDevices_ListByResourceGroup. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + iamVirtualMfaDevicesListByResourceGroup(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.iamVirtualMfaDevices().listByResourceGroup("rgiamVirtualMFADevice", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/IamVirtualMfaDevicesListSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/IamVirtualMfaDevicesListSamples.java new file mode 100644 index 000000000000..38e8ffa99461 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/IamVirtualMfaDevicesListSamples.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +/** + * Samples for IamVirtualMfaDevices List. + */ +public final class IamVirtualMfaDevicesListSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * IamVirtualMfaDevices_ListBySubscription.json + */ + /** + * Sample code: IamVirtualMfaDevices_ListBySubscription. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + iamVirtualMfaDevicesListBySubscription(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.iamVirtualMfaDevices().list(com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/IamVirtualMfaDevicesUpdateSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/IamVirtualMfaDevicesUpdateSamples.java new file mode 100644 index 000000000000..9f0b39bd780a --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/IamVirtualMfaDevicesUpdateSamples.java @@ -0,0 +1,45 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +import com.azure.resourcemanager.awsconnector.models.IamVirtualMfaDevice; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for IamVirtualMfaDevices Update. + */ +public final class IamVirtualMfaDevicesUpdateSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * IamVirtualMfaDevices_Update.json + */ + /** + * Sample code: IamVirtualMfaDevices_Update. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void iamVirtualMfaDevicesUpdate(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + IamVirtualMfaDevice resource = manager.iamVirtualMfaDevices() + .getByResourceGroupWithResponse("rgiamVirtualMFADevice", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE) + .getValue(); + resource.update().withTags(mapOf("key1836", "fakeTokenPlaceholder")).apply(); + } + + // Use "Map.of" if available + @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/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/KmsAliasesCreateOrReplaceSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/KmsAliasesCreateOrReplaceSamples.java new file mode 100644 index 000000000000..22f95c730f84 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/KmsAliasesCreateOrReplaceSamples.java @@ -0,0 +1,56 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +import com.azure.resourcemanager.awsconnector.models.AwsKmsAliasProperties; +import com.azure.resourcemanager.awsconnector.models.KmsAliasProperties; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for KmsAliases CreateOrReplace. + */ +public final class KmsAliasesCreateOrReplaceSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * KmsAliases_CreateOrReplace.json + */ + /** + * Sample code: KmsAliases_CreateOrReplace. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void kmsAliasesCreateOrReplace(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.kmsAliases() + .define("Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])") + .withRegion("zsrefx") + .withExistingResourceGroup("rgkmsAlias") + .withTags(mapOf("key1437", "fakeTokenPlaceholder")) + .withProperties(new KmsAliasProperties() + .withAwsProperties(new AwsKmsAliasProperties().withAliasName("qpqfyfsgzbqqqwohdqogpksketglb") + .withTargetKeyId("fakeTokenPlaceholder")) + .withPublicCloudConnectorsResourceId("n") + .withAwsAccountId("mi") + .withArn("seecdsob") + .withPublicCloudResourceName("qrdvkbofzddttwvcfunr") + .withAwsSourceSchema("iwkqjxnfjutfnhhocco") + .withAwsRegion("zofqccwhxvtaeqhhtqwmruhcjkro") + .withAwsTags(mapOf("key6582", "fakeTokenPlaceholder"))) + .create(); + } + + // Use "Map.of" if available + @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/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/KmsAliasesDeleteSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/KmsAliasesDeleteSamples.java new file mode 100644 index 000000000000..d6d54524ddd9 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/KmsAliasesDeleteSamples.java @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +/** + * Samples for KmsAliases Delete. + */ +public final class KmsAliasesDeleteSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/KmsAliases_Delete. + * json + */ + /** + * Sample code: KmsAliases_Delete. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void kmsAliasesDelete(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.kmsAliases() + .delete("rgkmsAlias", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/KmsAliasesGetByResourceGroupSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/KmsAliasesGetByResourceGroupSamples.java new file mode 100644 index 000000000000..0740cdcbd96e --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/KmsAliasesGetByResourceGroupSamples.java @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +/** + * Samples for KmsAliases GetByResourceGroup. + */ +public final class KmsAliasesGetByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/KmsAliases_Get.json + */ + /** + * Sample code: KmsAliases_Get. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void kmsAliasesGet(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.kmsAliases() + .getByResourceGroupWithResponse("rgkmsAlias", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/KmsAliasesListByResourceGroupSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/KmsAliasesListByResourceGroupSamples.java new file mode 100644 index 000000000000..185e571366ab --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/KmsAliasesListByResourceGroupSamples.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +/** + * Samples for KmsAliases ListByResourceGroup. + */ +public final class KmsAliasesListByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * KmsAliases_ListByResourceGroup.json + */ + /** + * Sample code: KmsAliases_ListByResourceGroup. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + kmsAliasesListByResourceGroup(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.kmsAliases().listByResourceGroup("rgkmsAlias", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/KmsAliasesListSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/KmsAliasesListSamples.java new file mode 100644 index 000000000000..a257588489dd --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/KmsAliasesListSamples.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +/** + * Samples for KmsAliases List. + */ +public final class KmsAliasesListSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * KmsAliases_ListBySubscription.json + */ + /** + * Sample code: KmsAliases_ListBySubscription. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + kmsAliasesListBySubscription(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.kmsAliases().list(com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/KmsAliasesUpdateSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/KmsAliasesUpdateSamples.java new file mode 100644 index 000000000000..86e46df6ded5 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/KmsAliasesUpdateSamples.java @@ -0,0 +1,45 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +import com.azure.resourcemanager.awsconnector.models.KmsAlias; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for KmsAliases Update. + */ +public final class KmsAliasesUpdateSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/KmsAliases_Update. + * json + */ + /** + * Sample code: KmsAliases_Update. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void kmsAliasesUpdate(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + KmsAlias resource = manager.kmsAliases() + .getByResourceGroupWithResponse("rgkmsAlias", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE) + .getValue(); + resource.update().withTags(mapOf("key4840", "fakeTokenPlaceholder")).apply(); + } + + // Use "Map.of" if available + @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/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/KmsKeysCreateOrReplaceSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/KmsKeysCreateOrReplaceSamples.java new file mode 100644 index 000000000000..1a41fcee3590 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/KmsKeysCreateOrReplaceSamples.java @@ -0,0 +1,74 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +import com.azure.resourcemanager.awsconnector.models.AwsKmsKeyProperties; +import com.azure.resourcemanager.awsconnector.models.KeySpec; +import com.azure.resourcemanager.awsconnector.models.KeyUsage; +import com.azure.resourcemanager.awsconnector.models.KmsKeyProperties; +import com.azure.resourcemanager.awsconnector.models.Origin; +import com.azure.resourcemanager.awsconnector.models.TagAutoGenerated35; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for KmsKeys CreateOrReplace. + */ +public final class KmsKeysCreateOrReplaceSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * KmsKeys_CreateOrReplace.json + */ + /** + * Sample code: KmsKeys_CreateOrReplace. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void kmsKeysCreateOrReplace(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.kmsKeys() + .define("Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])") + .withRegion("qozbasr") + .withExistingResourceGroup("rgkmsKey") + .withTags(mapOf("key3909", "fakeTokenPlaceholder")) + .withProperties(new KmsKeyProperties() + .withAwsProperties(new AwsKmsKeyProperties().withArn("qglsfyxssylnrh") + .withBypassPolicyLockoutSafetyCheck(true) + .withDescription("mjtmquqbhnvjw") + .withEnableKeyRotation(true) + .withEnabled(true) + .withKeyId("fakeTokenPlaceholder") + .withKeyPolicy(mapOf()) + .withKeySpec(KeySpec.ECC_NIST_P256) + .withKeyUsage(KeyUsage.ENCRYPT_DECRYPT) + .withMultiRegion(true) + .withOrigin(Origin.AWS_KMS) + .withPendingWindowInDays(7) + .withRotationPeriodInDays(4) + .withTags(Arrays.asList( + new TagAutoGenerated35().withKey("fakeTokenPlaceholder").withValue("lcaeaqxughlzgzhbbi")))) + .withPublicCloudConnectorsResourceId("tsbeayhnreovxnkbtbrvnuielziq") + .withAwsAccountId("rvkcvpmljvwdryvsugsuc") + .withArn("qszqxzva") + .withPublicCloudResourceName("edkcxntzxplnpl") + .withAwsSourceSchema("cvatoa") + .withAwsRegion("hvyzzutginnqrhgkyyripyqhqkofm") + .withAwsTags(mapOf("key8656", "fakeTokenPlaceholder"))) + .create(); + } + + // Use "Map.of" if available + @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/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/KmsKeysDeleteSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/KmsKeysDeleteSamples.java new file mode 100644 index 000000000000..d32f47c9cedf --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/KmsKeysDeleteSamples.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +/** + * Samples for KmsKeys Delete. + */ +public final class KmsKeysDeleteSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/KmsKeys_Delete.json + */ + /** + * Sample code: KmsKeys_Delete. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void kmsKeysDelete(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.kmsKeys() + .delete("rgkmsKey", "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/KmsKeysGetByResourceGroupSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/KmsKeysGetByResourceGroupSamples.java new file mode 100644 index 000000000000..d12e43baf337 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/KmsKeysGetByResourceGroupSamples.java @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +/** + * Samples for KmsKeys GetByResourceGroup. + */ +public final class KmsKeysGetByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/KmsKeys_Get.json + */ + /** + * Sample code: KmsKeys_Get. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void kmsKeysGet(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.kmsKeys() + .getByResourceGroupWithResponse("rgkmsKey", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/KmsKeysListByResourceGroupSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/KmsKeysListByResourceGroupSamples.java new file mode 100644 index 000000000000..fbeb2bd2c5cd --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/KmsKeysListByResourceGroupSamples.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.awsconnector.generated; + +/** + * Samples for KmsKeys ListByResourceGroup. + */ +public final class KmsKeysListByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * KmsKeys_ListByResourceGroup.json + */ + /** + * Sample code: KmsKeys_ListByResourceGroup. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void kmsKeysListByResourceGroup(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.kmsKeys().listByResourceGroup("rgkmsKey", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/KmsKeysListSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/KmsKeysListSamples.java new file mode 100644 index 000000000000..b37459eefdba --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/KmsKeysListSamples.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.awsconnector.generated; + +/** + * Samples for KmsKeys List. + */ +public final class KmsKeysListSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * KmsKeys_ListBySubscription.json + */ + /** + * Sample code: KmsKeys_ListBySubscription. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void kmsKeysListBySubscription(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.kmsKeys().list(com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/KmsKeysUpdateSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/KmsKeysUpdateSamples.java new file mode 100644 index 000000000000..8b364c1dc8e6 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/KmsKeysUpdateSamples.java @@ -0,0 +1,44 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +import com.azure.resourcemanager.awsconnector.models.KmsKey; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for KmsKeys Update. + */ +public final class KmsKeysUpdateSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/KmsKeys_Update.json + */ + /** + * Sample code: KmsKeys_Update. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void kmsKeysUpdate(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + KmsKey resource = manager.kmsKeys() + .getByResourceGroupWithResponse("rgkmsKey", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE) + .getValue(); + resource.update().withTags(mapOf("key2630", "fakeTokenPlaceholder")).apply(); + } + + // Use "Map.of" if available + @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/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/LambdaFunctionCodeLocationsCreateOrReplaceSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/LambdaFunctionCodeLocationsCreateOrReplaceSamples.java new file mode 100644 index 000000000000..0b1b1abb13ea --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/LambdaFunctionCodeLocationsCreateOrReplaceSamples.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.awsconnector.generated; + +import com.azure.resourcemanager.awsconnector.models.AwsLambdaFunctionCodeLocationProperties; +import com.azure.resourcemanager.awsconnector.models.LambdaFunctionCodeLocationProperties; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for LambdaFunctionCodeLocations CreateOrReplace. + */ +public final class LambdaFunctionCodeLocationsCreateOrReplaceSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * LambdaFunctionCodeLocations_CreateOrReplace.json + */ + /** + * Sample code: LambdaFunctionCodeLocations_CreateOrReplace. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + lambdaFunctionCodeLocationsCreateOrReplace(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.lambdaFunctionCodeLocations() + .define("Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])") + .withRegion("qkuouoekvqfxgj") + .withExistingResourceGroup("rglambdaFunctionCodeLocation") + .withTags(mapOf("key5879", "fakeTokenPlaceholder")) + .withProperties(new LambdaFunctionCodeLocationProperties() + .withAwsProperties( + new AwsLambdaFunctionCodeLocationProperties().withImageUri("vgxgdgxjcgxywrlgksntztsti") + .withLocation("wntythncasjf") + .withRepositoryType("rokpwfiqhiulnmmyjxfwchgk") + .withResolvedImageUri("forzmeqdjmd")) + .withPublicCloudConnectorsResourceId("hqutrljrwdofyqxdprvsolekoxh") + .withAwsAccountId("kddvcdwz") + .withArn("cavnxpszexpsxi") + .withPublicCloudResourceName("zqervnldc") + .withAwsSourceSchema("dqmxkbgxzzurnbdbrodipprola") + .withAwsRegion("gpffqddhhsxbkcblgd") + .withAwsTags(mapOf("key6065", "fakeTokenPlaceholder"))) + .create(); + } + + // Use "Map.of" if available + @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/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/LambdaFunctionCodeLocationsDeleteSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/LambdaFunctionCodeLocationsDeleteSamples.java new file mode 100644 index 000000000000..0884cbb3b54b --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/LambdaFunctionCodeLocationsDeleteSamples.java @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +/** + * Samples for LambdaFunctionCodeLocations Delete. + */ +public final class LambdaFunctionCodeLocationsDeleteSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * LambdaFunctionCodeLocations_Delete.json + */ + /** + * Sample code: LambdaFunctionCodeLocations_Delete. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + lambdaFunctionCodeLocationsDelete(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.lambdaFunctionCodeLocations() + .delete("rglambdaFunctionCodeLocation", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/LambdaFunctionCodeLocationsGetByResourceGroupSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/LambdaFunctionCodeLocationsGetByResourceGroupSamples.java new file mode 100644 index 000000000000..f89a2bf2b61e --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/LambdaFunctionCodeLocationsGetByResourceGroupSamples.java @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +/** + * Samples for LambdaFunctionCodeLocations GetByResourceGroup. + */ +public final class LambdaFunctionCodeLocationsGetByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * LambdaFunctionCodeLocations_Get.json + */ + /** + * Sample code: LambdaFunctionCodeLocations_Get. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + lambdaFunctionCodeLocationsGet(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.lambdaFunctionCodeLocations() + .getByResourceGroupWithResponse("rglambdaFunctionCodeLocation", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/LambdaFunctionCodeLocationsListByResourceGroupSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/LambdaFunctionCodeLocationsListByResourceGroupSamples.java new file mode 100644 index 000000000000..d418e25e0787 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/LambdaFunctionCodeLocationsListByResourceGroupSamples.java @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +/** + * Samples for LambdaFunctionCodeLocations ListByResourceGroup. + */ +public final class LambdaFunctionCodeLocationsListByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * LambdaFunctionCodeLocations_ListByResourceGroup.json + */ + /** + * Sample code: LambdaFunctionCodeLocations_ListByResourceGroup. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void lambdaFunctionCodeLocationsListByResourceGroup( + com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.lambdaFunctionCodeLocations() + .listByResourceGroup("rglambdaFunctionCodeLocation", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/LambdaFunctionCodeLocationsListSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/LambdaFunctionCodeLocationsListSamples.java new file mode 100644 index 000000000000..b7486d52f6bf --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/LambdaFunctionCodeLocationsListSamples.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +/** + * Samples for LambdaFunctionCodeLocations List. + */ +public final class LambdaFunctionCodeLocationsListSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * LambdaFunctionCodeLocations_ListBySubscription.json + */ + /** + * Sample code: LambdaFunctionCodeLocations_ListBySubscription. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void lambdaFunctionCodeLocationsListBySubscription( + com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.lambdaFunctionCodeLocations().list(com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/LambdaFunctionCodeLocationsUpdateSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/LambdaFunctionCodeLocationsUpdateSamples.java new file mode 100644 index 000000000000..9850f2a9a0f7 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/LambdaFunctionCodeLocationsUpdateSamples.java @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +import com.azure.resourcemanager.awsconnector.models.LambdaFunctionCodeLocation; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for LambdaFunctionCodeLocations Update. + */ +public final class LambdaFunctionCodeLocationsUpdateSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * LambdaFunctionCodeLocations_Update.json + */ + /** + * Sample code: LambdaFunctionCodeLocations_Update. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + lambdaFunctionCodeLocationsUpdate(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + LambdaFunctionCodeLocation resource = manager.lambdaFunctionCodeLocations() + .getByResourceGroupWithResponse("rglambdaFunctionCodeLocation", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE) + .getValue(); + resource.update().withTags(mapOf("key2617", "fakeTokenPlaceholder")).apply(); + } + + // Use "Map.of" if available + @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/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/LambdaFunctionsCreateOrReplaceSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/LambdaFunctionsCreateOrReplaceSamples.java new file mode 100644 index 000000000000..5a2d808561d3 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/LambdaFunctionsCreateOrReplaceSamples.java @@ -0,0 +1,124 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +import com.azure.resourcemanager.awsconnector.models.Architectures; +import com.azure.resourcemanager.awsconnector.models.AwsLambdaFunctionProperties; +import com.azure.resourcemanager.awsconnector.models.Code; +import com.azure.resourcemanager.awsconnector.models.DeadLetterConfig; +import com.azure.resourcemanager.awsconnector.models.Environment; +import com.azure.resourcemanager.awsconnector.models.EphemeralStorageAutoGenerated; +import com.azure.resourcemanager.awsconnector.models.FileSystemConfig; +import com.azure.resourcemanager.awsconnector.models.ImageConfig; +import com.azure.resourcemanager.awsconnector.models.LambdaFunctionProperties; +import com.azure.resourcemanager.awsconnector.models.LoggingConfig; +import com.azure.resourcemanager.awsconnector.models.LoggingConfigApplicationLogLevel; +import com.azure.resourcemanager.awsconnector.models.LoggingConfigLogFormat; +import com.azure.resourcemanager.awsconnector.models.LoggingConfigSystemLogLevel; +import com.azure.resourcemanager.awsconnector.models.PackageType; +import com.azure.resourcemanager.awsconnector.models.RuntimeManagementConfig; +import com.azure.resourcemanager.awsconnector.models.RuntimeManagementConfigUpdateRuntimeOn; +import com.azure.resourcemanager.awsconnector.models.SnapStart; +import com.azure.resourcemanager.awsconnector.models.SnapStartApplyOn; +import com.azure.resourcemanager.awsconnector.models.SnapStartResponse; +import com.azure.resourcemanager.awsconnector.models.SnapStartResponseApplyOn; +import com.azure.resourcemanager.awsconnector.models.SnapStartResponseOptimizationStatus; +import com.azure.resourcemanager.awsconnector.models.TagAutoGenerated36; +import com.azure.resourcemanager.awsconnector.models.TracingConfig; +import com.azure.resourcemanager.awsconnector.models.TracingConfigMode; +import com.azure.resourcemanager.awsconnector.models.VpcConfigAutoGenerated; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for LambdaFunctions CreateOrReplace. + */ +public final class LambdaFunctionsCreateOrReplaceSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * LambdaFunctions_CreateOrReplace.json + */ + /** + * Sample code: LambdaFunctions_CreateOrReplace. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + lambdaFunctionsCreateOrReplace(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.lambdaFunctions() + .define("Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])") + .withRegion("pipiphijlvjolohsfpmym") + .withExistingResourceGroup("rglambdaFunction") + .withTags(mapOf("key9520", "fakeTokenPlaceholder")) + .withProperties(new LambdaFunctionProperties() + .withAwsProperties(new AwsLambdaFunctionProperties() + .withArchitectures(Arrays.asList(Architectures.ARM64)) + .withArn("stgpeog") + .withCode(new Code().withImageUri("mumnivivaclgokdozsqygicoz") + .withS3Bucket("iqxcjanbelhti") + .withS3Key("fakeTokenPlaceholder") + .withS3ObjectVersion("ixwkaazvqllwohxjwjtivxy") + .withZipFile("cashtgbjnebsmmyijmbuerim")) + .withCodeSigningConfigArn("fakeTokenPlaceholder") + .withDeadLetterConfig(new DeadLetterConfig().withTargetArn("yfmmazkodblnhgalpsnx")) + .withDescription("yvdoxaozwjzszqnt") + .withEnvironment(new Environment().withVariables(mapOf("key999", "fakeTokenPlaceholder"))) + .withEphemeralStorage(new EphemeralStorageAutoGenerated().withSize(21)) + .withFileSystemConfigs( + Arrays.asList(new FileSystemConfig().withArn("lgaajhamrjhiw").withLocalMountPath("ctjvtoy"))) + .withFunctionName("fkv") + .withHandler("penuepcuxqvyjozfpxcxkujpeiib") + .withImageConfig(new ImageConfig().withCommand(Arrays.asList("ypqwmituqujgxriqqe")) + .withEntryPoint(Arrays.asList("vfnpuvvmmxttsaolsfocwhrhvaycbd")) + .withWorkingDirectory("gnpkvohajxgtqcweloswwofgev")) + .withKmsKeyArn("fakeTokenPlaceholder") + .withLayers(Arrays.asList("bwczxgdagr")) + .withLoggingConfig( + new LoggingConfig().withApplicationLogLevel(LoggingConfigApplicationLogLevel.DEBUG) + .withLogFormat(LoggingConfigLogFormat.JSON) + .withLogGroup("zrsmuig") + .withSystemLogLevel(LoggingConfigSystemLogLevel.DEBUG)) + .withMemorySize(21) + .withPackageType(PackageType.IMAGE) + .withReservedConcurrentExecutions(28) + .withRole("tuoem") + .withRuntime("srxhlxqifkewuflrxzjauzdqqkoatl") + .withRuntimeManagementConfig( + new RuntimeManagementConfig().withRuntimeVersionArn("lqpuhdoaicnpryovplogsolsacxbk") + .withUpdateRuntimeOn(RuntimeManagementConfigUpdateRuntimeOn.AUTO)) + .withSnapStart(new SnapStart().withApplyOn(SnapStartApplyOn.NONE)) + .withSnapStartResponse(new SnapStartResponse().withApplyOn(SnapStartResponseApplyOn.NONE) + .withOptimizationStatus(SnapStartResponseOptimizationStatus.OFF)) + .withTags(Arrays + .asList(new TagAutoGenerated36().withKey("fakeTokenPlaceholder").withValue("qctpnmjttccpi"))) + .withTimeout(28) + .withTracingConfig(new TracingConfig().withMode(TracingConfigMode.ACTIVE)) + .withVpcConfig(new VpcConfigAutoGenerated().withIpv6AllowedForDualStack(true) + .withSecurityGroupIds(Arrays.asList("ovxbygrfhfhno")) + .withSubnetIds(Arrays.asList("inqatpkusunkgccviubzkijhrgslec")))) + .withPublicCloudConnectorsResourceId("izvoucedmqtsihfjz") + .withAwsAccountId("jhircduhthqiztp") + .withArn("wksjbkhocigdctupfiheutlmloir") + .withPublicCloudResourceName("odptbducplnqaqoeleidffnyqfcipg") + .withAwsSourceSchema("joyfyjrulh") + .withAwsRegion("nat") + .withAwsTags(mapOf("key4553", "fakeTokenPlaceholder"))) + .create(); + } + + // Use "Map.of" if available + @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/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/LambdaFunctionsDeleteSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/LambdaFunctionsDeleteSamples.java new file mode 100644 index 000000000000..5ae172d2ef36 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/LambdaFunctionsDeleteSamples.java @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +/** + * Samples for LambdaFunctions Delete. + */ +public final class LambdaFunctionsDeleteSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * LambdaFunctions_Delete.json + */ + /** + * Sample code: LambdaFunctions_Delete. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void lambdaFunctionsDelete(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.lambdaFunctions() + .delete("rglambdaFunction", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/LambdaFunctionsGetByResourceGroupSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/LambdaFunctionsGetByResourceGroupSamples.java new file mode 100644 index 000000000000..295727754089 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/LambdaFunctionsGetByResourceGroupSamples.java @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +/** + * Samples for LambdaFunctions GetByResourceGroup. + */ +public final class LambdaFunctionsGetByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/LambdaFunctions_Get + * .json + */ + /** + * Sample code: LambdaFunctions_Get. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void lambdaFunctionsGet(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.lambdaFunctions() + .getByResourceGroupWithResponse("rglambdaFunction", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/LambdaFunctionsListByResourceGroupSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/LambdaFunctionsListByResourceGroupSamples.java new file mode 100644 index 000000000000..85f7c28a2e6a --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/LambdaFunctionsListByResourceGroupSamples.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +/** + * Samples for LambdaFunctions ListByResourceGroup. + */ +public final class LambdaFunctionsListByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * LambdaFunctions_ListByResourceGroup.json + */ + /** + * Sample code: LambdaFunctions_ListByResourceGroup. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + lambdaFunctionsListByResourceGroup(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.lambdaFunctions().listByResourceGroup("rglambdaFunction", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/LambdaFunctionsListSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/LambdaFunctionsListSamples.java new file mode 100644 index 000000000000..9e1b86c9eae4 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/LambdaFunctionsListSamples.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +/** + * Samples for LambdaFunctions List. + */ +public final class LambdaFunctionsListSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * LambdaFunctions_ListBySubscription.json + */ + /** + * Sample code: LambdaFunctions_ListBySubscription. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + lambdaFunctionsListBySubscription(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.lambdaFunctions().list(com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/LambdaFunctionsUpdateSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/LambdaFunctionsUpdateSamples.java new file mode 100644 index 000000000000..41c859dfb5b0 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/LambdaFunctionsUpdateSamples.java @@ -0,0 +1,45 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +import com.azure.resourcemanager.awsconnector.models.LambdaFunction; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for LambdaFunctions Update. + */ +public final class LambdaFunctionsUpdateSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * LambdaFunctions_Update.json + */ + /** + * Sample code: LambdaFunctions_Update. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void lambdaFunctionsUpdate(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + LambdaFunction resource = manager.lambdaFunctions() + .getByResourceGroupWithResponse("rglambdaFunction", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE) + .getValue(); + resource.update().withTags(mapOf("key6434", "fakeTokenPlaceholder")).apply(); + } + + // Use "Map.of" if available + @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/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/LightsailBucketsCreateOrReplaceSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/LightsailBucketsCreateOrReplaceSamples.java new file mode 100644 index 000000000000..27a370d2cdc7 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/LightsailBucketsCreateOrReplaceSamples.java @@ -0,0 +1,71 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +import com.azure.resourcemanager.awsconnector.models.AccessRules; +import com.azure.resourcemanager.awsconnector.models.AwsLightsailBucketProperties; +import com.azure.resourcemanager.awsconnector.models.LightsailBucketProperties; +import com.azure.resourcemanager.awsconnector.models.TagAutoGenerated37; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for LightsailBuckets CreateOrReplace. + */ +public final class LightsailBucketsCreateOrReplaceSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * LightsailBuckets_CreateOrReplace.json + */ + /** + * Sample code: LightsailBuckets_CreateOrReplace. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + lightsailBucketsCreateOrReplace(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.lightsailBuckets() + .define("Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])") + .withRegion("ctcjoqkhbmgwtqztn") + .withExistingResourceGroup("rglightsailBucket") + .withTags(mapOf("key4407", "fakeTokenPlaceholder")) + .withProperties( + new LightsailBucketProperties() + .withAwsProperties(new AwsLightsailBucketProperties().withAbleToUpdateBundle(true) + .withAccessRules(new AccessRules().withAllowPublicOverrides(true) + .withGetObject("rzsbxpoywnkypgcjndwgjxurwaggf")) + .withBucketArn("khrxjzjloawhlsscrupp") + .withBucketName("rbqqhyugkapyxigvfygdmmsig") + .withBundleId("s") + .withObjectVersioning(true) + .withReadOnlyAccessAccounts(Arrays.asList("yptmppbxsgfmbvcoourx")) + .withResourcesReceivingAccess(Arrays.asList("abmltbmvfqgzha")) + .withTags(Arrays.asList(new TagAutoGenerated37().withKey("fakeTokenPlaceholder") + .withValue("onksgozpshqfschbsuyhhui"))) + .withUrl("dzofeppuoqkmehqcpzpezbmbvrvqbn")) + .withPublicCloudConnectorsResourceId("vcenimpnlashmiz") + .withAwsAccountId("wqlujalgyyyfgmedzj") + .withArn("uoyqkdsfok") + .withPublicCloudResourceName("aqpayfdjm") + .withAwsSourceSchema("kcjmzaxkkbztlm") + .withAwsRegion("kozgryjoinum") + .withAwsTags(mapOf("key7074", "fakeTokenPlaceholder"))) + .create(); + } + + // Use "Map.of" if available + @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/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/LightsailBucketsDeleteSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/LightsailBucketsDeleteSamples.java new file mode 100644 index 000000000000..8f9a38c45625 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/LightsailBucketsDeleteSamples.java @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +/** + * Samples for LightsailBuckets Delete. + */ +public final class LightsailBucketsDeleteSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * LightsailBuckets_Delete.json + */ + /** + * Sample code: LightsailBuckets_Delete. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void lightsailBucketsDelete(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.lightsailBuckets() + .delete("rglightsailBucket", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/LightsailBucketsGetByResourceGroupSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/LightsailBucketsGetByResourceGroupSamples.java new file mode 100644 index 000000000000..d8439859917f --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/LightsailBucketsGetByResourceGroupSamples.java @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +/** + * Samples for LightsailBuckets GetByResourceGroup. + */ +public final class LightsailBucketsGetByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * LightsailBuckets_Get.json + */ + /** + * Sample code: LightsailBuckets_Get. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void lightsailBucketsGet(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.lightsailBuckets() + .getByResourceGroupWithResponse("rglightsailBucket", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/LightsailBucketsListByResourceGroupSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/LightsailBucketsListByResourceGroupSamples.java new file mode 100644 index 000000000000..ee0b15e1c0f6 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/LightsailBucketsListByResourceGroupSamples.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +/** + * Samples for LightsailBuckets ListByResourceGroup. + */ +public final class LightsailBucketsListByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * LightsailBuckets_ListByResourceGroup.json + */ + /** + * Sample code: LightsailBuckets_ListByResourceGroup. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + lightsailBucketsListByResourceGroup(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.lightsailBuckets().listByResourceGroup("rglightsailBucket", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/LightsailBucketsListSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/LightsailBucketsListSamples.java new file mode 100644 index 000000000000..0d1d028eb3bb --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/LightsailBucketsListSamples.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +/** + * Samples for LightsailBuckets List. + */ +public final class LightsailBucketsListSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * LightsailBuckets_ListBySubscription.json + */ + /** + * Sample code: LightsailBuckets_ListBySubscription. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + lightsailBucketsListBySubscription(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.lightsailBuckets().list(com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/LightsailBucketsUpdateSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/LightsailBucketsUpdateSamples.java new file mode 100644 index 000000000000..27e8a949f4aa --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/LightsailBucketsUpdateSamples.java @@ -0,0 +1,45 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +import com.azure.resourcemanager.awsconnector.models.LightsailBucket; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for LightsailBuckets Update. + */ +public final class LightsailBucketsUpdateSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * LightsailBuckets_Update.json + */ + /** + * Sample code: LightsailBuckets_Update. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void lightsailBucketsUpdate(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + LightsailBucket resource = manager.lightsailBuckets() + .getByResourceGroupWithResponse("rglightsailBucket", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE) + .getValue(); + resource.update().withTags(mapOf("key1875", "fakeTokenPlaceholder")).apply(); + } + + // Use "Map.of" if available + @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/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/LightsailInstancesCreateOrReplaceSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/LightsailInstancesCreateOrReplaceSamples.java new file mode 100644 index 000000000000..d863c111f4b3 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/LightsailInstancesCreateOrReplaceSamples.java @@ -0,0 +1,111 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +import com.azure.resourcemanager.awsconnector.models.AddOn; +import com.azure.resourcemanager.awsconnector.models.AddOnStatus; +import com.azure.resourcemanager.awsconnector.models.AutoSnapshotAddOn; +import com.azure.resourcemanager.awsconnector.models.AwsLightsailInstanceProperties; +import com.azure.resourcemanager.awsconnector.models.Disk; +import com.azure.resourcemanager.awsconnector.models.Hardware; +import com.azure.resourcemanager.awsconnector.models.LightsailInstanceProperties; +import com.azure.resourcemanager.awsconnector.models.Location; +import com.azure.resourcemanager.awsconnector.models.MonthlyTransfer; +import com.azure.resourcemanager.awsconnector.models.Networking; +import com.azure.resourcemanager.awsconnector.models.Port; +import com.azure.resourcemanager.awsconnector.models.State; +import com.azure.resourcemanager.awsconnector.models.TagAutoGenerated38; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for LightsailInstances CreateOrReplace. + */ +public final class LightsailInstancesCreateOrReplaceSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * LightsailInstances_CreateOrReplace.json + */ + /** + * Sample code: LightsailInstances_CreateOrReplace. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + lightsailInstancesCreateOrReplace(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.lightsailInstances() + .define("Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])") + .withRegion("cry") + .withExistingResourceGroup("rglightsailInstance") + .withTags(mapOf("key2601", "fakeTokenPlaceholder")) + .withProperties(new LightsailInstanceProperties() + .withAwsProperties(new AwsLightsailInstanceProperties() + .withAddOns(Arrays.asList(new AddOn().withAddOnType("dk") + .withAutoSnapshotAddOnRequest( + new AutoSnapshotAddOn().withSnapshotTimeOfDay("mnthrtsoittlqrvxnwvrbaxaazh")) + .withStatus(AddOnStatus.DISABLED))) + .withAvailabilityZone("an") + .withBlueprintId("fcezpmlwqhchkvmrdnywpr") + .withBundleId("yckqxqitrffsidmdxkrmaulfgmrj") + .withHardware(new Hardware().withCpuCount(30) + .withDisks(Arrays.asList(new Disk().withAttachedTo("qoievao") + .withAttachmentState("ujinucmjcnzuosaqycrkndh") + .withDiskName("tmfpjhluaytgmpxxqtccohpge") + .withIops(11) + .withIsSystemDisk(true) + .withPath("urbubhyieizmbnyddjkyaadmod") + .withSizeInGb("vpd"))) + .withRamSizeInGb(4)) + .withInstanceArn("mnodcgqlejrhlctqngwxyoqewk") + .withInstanceName("xfxnlievrppfrt") + .withIsStaticIp(true) + .withKeyPairName("fakeTokenPlaceholder") + .withLocation(new Location().withAvailabilityZone("t").withRegionName("zgmew")) + .withNetworking( + new Networking().withMonthlyTransfer(new MonthlyTransfer().withGbPerMonthAllocated("dvbefi")) + .withPorts(Arrays.asList(new Port().withAccessDirection("bybrpghkgcvx") + .withAccessFrom("kslf") + .withAccessType("dcqaucgpbxngw") + .withCidrListAliases(Arrays.asList("btgxaahlpibcqefsgcghfd")) + .withCidrs(Arrays.asList("lhmvhnh")) + .withCommonName("t") + .withFromPort(23) + .withIpv6Cidrs(Arrays.asList("qladlrdxfiad")) + .withProtocol("bzikwazzeydyrukrjhsaogkkxua") + .withToPort(13)))) + .withPrivateIpAddress("ieeqsrklgnc") + .withPublicIpAddress("vonneqx") + .withResourceType("obxjqk") + .withSshKeyName("fakeTokenPlaceholder") + .withState(new State().withCode(29).withName("xdtssqcrsvaqphv")) + .withSupportCode("fakeTokenPlaceholder") + .withTags(Arrays + .asList(new TagAutoGenerated38().withKey("fakeTokenPlaceholder").withValue("vbybagbqynriyix"))) + .withUserData("f") + .withUsername("rhivoaleeqwog")) + .withPublicCloudConnectorsResourceId("vsgxzwhzepjvcjjoqj") + .withAwsAccountId("bclcfxetkkugpyilojpvoypui") + .withArn("dcvwurrexherolt") + .withPublicCloudResourceName("ibkgqwotzyy") + .withAwsSourceSchema("zzcfeeoutptp") + .withAwsRegion("zjxqlmimpqxec") + .withAwsTags(mapOf("key8646", "fakeTokenPlaceholder"))) + .create(); + } + + // Use "Map.of" if available + @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/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/LightsailInstancesDeleteSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/LightsailInstancesDeleteSamples.java new file mode 100644 index 000000000000..07860866535c --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/LightsailInstancesDeleteSamples.java @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +/** + * Samples for LightsailInstances Delete. + */ +public final class LightsailInstancesDeleteSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * LightsailInstances_Delete.json + */ + /** + * Sample code: LightsailInstances_Delete. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void lightsailInstancesDelete(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.lightsailInstances() + .delete("rglightsailInstance", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/LightsailInstancesGetByResourceGroupSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/LightsailInstancesGetByResourceGroupSamples.java new file mode 100644 index 000000000000..913ce6eb49d4 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/LightsailInstancesGetByResourceGroupSamples.java @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +/** + * Samples for LightsailInstances GetByResourceGroup. + */ +public final class LightsailInstancesGetByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * LightsailInstances_Get.json + */ + /** + * Sample code: LightsailInstances_Get. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void lightsailInstancesGet(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.lightsailInstances() + .getByResourceGroupWithResponse("rglightsailInstance", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/LightsailInstancesListByResourceGroupSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/LightsailInstancesListByResourceGroupSamples.java new file mode 100644 index 000000000000..4e5e7bcbed6c --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/LightsailInstancesListByResourceGroupSamples.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +/** + * Samples for LightsailInstances ListByResourceGroup. + */ +public final class LightsailInstancesListByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * LightsailInstances_ListByResourceGroup.json + */ + /** + * Sample code: LightsailInstances_ListByResourceGroup. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + lightsailInstancesListByResourceGroup(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.lightsailInstances().listByResourceGroup("rglightsailInstance", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/LightsailInstancesListSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/LightsailInstancesListSamples.java new file mode 100644 index 000000000000..d859af57f3f8 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/LightsailInstancesListSamples.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +/** + * Samples for LightsailInstances List. + */ +public final class LightsailInstancesListSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * LightsailInstances_ListBySubscription.json + */ + /** + * Sample code: LightsailInstances_ListBySubscription. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + lightsailInstancesListBySubscription(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.lightsailInstances().list(com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/LightsailInstancesUpdateSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/LightsailInstancesUpdateSamples.java new file mode 100644 index 000000000000..66ce62fccbe4 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/LightsailInstancesUpdateSamples.java @@ -0,0 +1,45 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +import com.azure.resourcemanager.awsconnector.models.LightsailInstance; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for LightsailInstances Update. + */ +public final class LightsailInstancesUpdateSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * LightsailInstances_Update.json + */ + /** + * Sample code: LightsailInstances_Update. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void lightsailInstancesUpdate(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + LightsailInstance resource = manager.lightsailInstances() + .getByResourceGroupWithResponse("rglightsailInstance", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE) + .getValue(); + resource.update().withTags(mapOf("key7201", "fakeTokenPlaceholder")).apply(); + } + + // Use "Map.of" if available + @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/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/LogsLogGroupsCreateOrReplaceSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/LogsLogGroupsCreateOrReplaceSamples.java new file mode 100644 index 000000000000..ceb409c2cced --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/LogsLogGroupsCreateOrReplaceSamples.java @@ -0,0 +1,64 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +import com.azure.resourcemanager.awsconnector.models.AwsLogsLogGroupProperties; +import com.azure.resourcemanager.awsconnector.models.LogGroupClass; +import com.azure.resourcemanager.awsconnector.models.LogsLogGroupProperties; +import com.azure.resourcemanager.awsconnector.models.TagAutoGenerated39; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for LogsLogGroups CreateOrReplace. + */ +public final class LogsLogGroupsCreateOrReplaceSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * LogsLogGroups_CreateOrReplace.json + */ + /** + * Sample code: LogsLogGroups_CreateOrReplace. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + logsLogGroupsCreateOrReplace(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.logsLogGroups() + .define("Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])") + .withRegion("phnyiqu") + .withExistingResourceGroup("rglogsLogGroup") + .withTags(mapOf("key9158", "fakeTokenPlaceholder")) + .withProperties(new LogsLogGroupProperties() + .withAwsProperties(new AwsLogsLogGroupProperties().withArn("nyrge") + .withKmsKeyId("fakeTokenPlaceholder") + .withLogGroupClass(LogGroupClass.INFREQUENT_ACCESS) + .withLogGroupName("ekbugjqparpxebzmfaykh") + .withRetentionInDays(17) + .withTags(Arrays.asList(new TagAutoGenerated39().withKey("fakeTokenPlaceholder").withValue("x")))) + .withPublicCloudConnectorsResourceId("ascstrkrmxqtxw") + .withAwsAccountId("jgnahcwppywqceisitgmjsw") + .withArn("seajw") + .withPublicCloudResourceName("ldqwutaylcywem") + .withAwsSourceSchema("ryhknij") + .withAwsRegion("vejderqihcaeihktrpgsuizcp") + .withAwsTags(mapOf("key2050", "fakeTokenPlaceholder"))) + .create(); + } + + // Use "Map.of" if available + @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/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/LogsLogGroupsDeleteSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/LogsLogGroupsDeleteSamples.java new file mode 100644 index 000000000000..dc60a3d73d7c --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/LogsLogGroupsDeleteSamples.java @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +/** + * Samples for LogsLogGroups Delete. + */ +public final class LogsLogGroupsDeleteSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * LogsLogGroups_Delete.json + */ + /** + * Sample code: LogsLogGroups_Delete. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void logsLogGroupsDelete(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.logsLogGroups() + .delete("rglogsLogGroup", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/LogsLogGroupsGetByResourceGroupSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/LogsLogGroupsGetByResourceGroupSamples.java new file mode 100644 index 000000000000..9bbbc7daafb6 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/LogsLogGroupsGetByResourceGroupSamples.java @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +/** + * Samples for LogsLogGroups GetByResourceGroup. + */ +public final class LogsLogGroupsGetByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/LogsLogGroups_Get. + * json + */ + /** + * Sample code: LogsLogGroups_Get. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void logsLogGroupsGet(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.logsLogGroups() + .getByResourceGroupWithResponse("rglogsLogGroup", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/LogsLogGroupsListByResourceGroupSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/LogsLogGroupsListByResourceGroupSamples.java new file mode 100644 index 000000000000..e9a303c7d1cf --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/LogsLogGroupsListByResourceGroupSamples.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +/** + * Samples for LogsLogGroups ListByResourceGroup. + */ +public final class LogsLogGroupsListByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * LogsLogGroups_ListByResourceGroup.json + */ + /** + * Sample code: LogsLogGroups_ListByResourceGroup. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + logsLogGroupsListByResourceGroup(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.logsLogGroups().listByResourceGroup("rglogsLogGroup", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/LogsLogGroupsListSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/LogsLogGroupsListSamples.java new file mode 100644 index 000000000000..e0fdab82125f --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/LogsLogGroupsListSamples.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +/** + * Samples for LogsLogGroups List. + */ +public final class LogsLogGroupsListSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * LogsLogGroups_ListBySubscription.json + */ + /** + * Sample code: LogsLogGroups_ListBySubscription. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + logsLogGroupsListBySubscription(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.logsLogGroups().list(com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/LogsLogGroupsUpdateSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/LogsLogGroupsUpdateSamples.java new file mode 100644 index 000000000000..4b6c0635819d --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/LogsLogGroupsUpdateSamples.java @@ -0,0 +1,45 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +import com.azure.resourcemanager.awsconnector.models.LogsLogGroup; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for LogsLogGroups Update. + */ +public final class LogsLogGroupsUpdateSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * LogsLogGroups_Update.json + */ + /** + * Sample code: LogsLogGroups_Update. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void logsLogGroupsUpdate(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + LogsLogGroup resource = manager.logsLogGroups() + .getByResourceGroupWithResponse("rglogsLogGroup", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE) + .getValue(); + resource.update().withTags(mapOf("key1200", "fakeTokenPlaceholder")).apply(); + } + + // Use "Map.of" if available + @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/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/LogsLogStreamsCreateOrReplaceSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/LogsLogStreamsCreateOrReplaceSamples.java new file mode 100644 index 000000000000..efbd71377008 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/LogsLogStreamsCreateOrReplaceSamples.java @@ -0,0 +1,57 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +import com.azure.resourcemanager.awsconnector.models.AwsLogsLogStreamProperties; +import com.azure.resourcemanager.awsconnector.models.LogsLogStreamProperties; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for LogsLogStreams CreateOrReplace. + */ +public final class LogsLogStreamsCreateOrReplaceSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * LogsLogStreams_CreateOrReplace.json + */ + /** + * Sample code: LogsLogStreams_CreateOrReplace. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + logsLogStreamsCreateOrReplace(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.logsLogStreams() + .define("Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])") + .withRegion("kptftndcymfuhgrknmxtkeqwlpjun") + .withExistingResourceGroup("rglogsLogStream") + .withTags(mapOf("key6354", "fakeTokenPlaceholder")) + .withProperties(new LogsLogStreamProperties() + .withAwsProperties(new AwsLogsLogStreamProperties().withLogGroupName("bfwnrdojlqlwrmih") + .withLogStreamName("pbtlxfgftiixnduazjvqezmnpwbr")) + .withPublicCloudConnectorsResourceId("lihllkk") + .withAwsAccountId("wdatjpiqtspvmqdqquuhipephuthnh") + .withArn("lzfqztmbbgeu") + .withPublicCloudResourceName("wftlmsgyanjghqoyfkzoqgqxrcdkq") + .withAwsSourceSchema("ffgsbwzxveleoxawcyogkiigworq") + .withAwsRegion("dzyiblunsedfhiq") + .withAwsTags(mapOf("key9843", "fakeTokenPlaceholder"))) + .create(); + } + + // Use "Map.of" if available + @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/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/LogsLogStreamsDeleteSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/LogsLogStreamsDeleteSamples.java new file mode 100644 index 000000000000..2fa1a34069b6 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/LogsLogStreamsDeleteSamples.java @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +/** + * Samples for LogsLogStreams Delete. + */ +public final class LogsLogStreamsDeleteSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * LogsLogStreams_Delete.json + */ + /** + * Sample code: LogsLogStreams_Delete. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void logsLogStreamsDelete(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.logsLogStreams() + .delete("rglogsLogStream", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/LogsLogStreamsGetByResourceGroupSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/LogsLogStreamsGetByResourceGroupSamples.java new file mode 100644 index 000000000000..6702a94aa622 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/LogsLogStreamsGetByResourceGroupSamples.java @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +/** + * Samples for LogsLogStreams GetByResourceGroup. + */ +public final class LogsLogStreamsGetByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/LogsLogStreams_Get. + * json + */ + /** + * Sample code: LogsLogStreams_Get. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void logsLogStreamsGet(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.logsLogStreams() + .getByResourceGroupWithResponse("rglogsLogStream", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/LogsLogStreamsListByResourceGroupSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/LogsLogStreamsListByResourceGroupSamples.java new file mode 100644 index 000000000000..22c72419b2d6 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/LogsLogStreamsListByResourceGroupSamples.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +/** + * Samples for LogsLogStreams ListByResourceGroup. + */ +public final class LogsLogStreamsListByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * LogsLogStreams_ListByResourceGroup.json + */ + /** + * Sample code: LogsLogStreams_ListByResourceGroup. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + logsLogStreamsListByResourceGroup(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.logsLogStreams().listByResourceGroup("rglogsLogStream", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/LogsLogStreamsListSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/LogsLogStreamsListSamples.java new file mode 100644 index 000000000000..9cdc9900ae1e --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/LogsLogStreamsListSamples.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +/** + * Samples for LogsLogStreams List. + */ +public final class LogsLogStreamsListSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * LogsLogStreams_ListBySubscription.json + */ + /** + * Sample code: LogsLogStreams_ListBySubscription. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + logsLogStreamsListBySubscription(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.logsLogStreams().list(com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/LogsLogStreamsUpdateSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/LogsLogStreamsUpdateSamples.java new file mode 100644 index 000000000000..d06bf2235dbe --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/LogsLogStreamsUpdateSamples.java @@ -0,0 +1,45 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +import com.azure.resourcemanager.awsconnector.models.LogsLogStream; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for LogsLogStreams Update. + */ +public final class LogsLogStreamsUpdateSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * LogsLogStreams_Update.json + */ + /** + * Sample code: LogsLogStreams_Update. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void logsLogStreamsUpdate(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + LogsLogStream resource = manager.logsLogStreams() + .getByResourceGroupWithResponse("rglogsLogStream", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE) + .getValue(); + resource.update().withTags(mapOf("key5713", "fakeTokenPlaceholder")).apply(); + } + + // Use "Map.of" if available + @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/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/LogsMetricFiltersCreateOrReplaceSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/LogsMetricFiltersCreateOrReplaceSamples.java new file mode 100644 index 000000000000..add3a8848587 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/LogsMetricFiltersCreateOrReplaceSamples.java @@ -0,0 +1,69 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +import com.azure.resourcemanager.awsconnector.models.AwsLogsMetricFilterProperties; +import com.azure.resourcemanager.awsconnector.models.DimensionAutoGenerated; +import com.azure.resourcemanager.awsconnector.models.LogsMetricFilterProperties; +import com.azure.resourcemanager.awsconnector.models.MetricTransformation; +import com.azure.resourcemanager.awsconnector.models.MetricTransformationUnit; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for LogsMetricFilters CreateOrReplace. + */ +public final class LogsMetricFiltersCreateOrReplaceSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * LogsMetricFilters_CreateOrReplace.json + */ + /** + * Sample code: LogsMetricFilters_CreateOrReplace. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + logsMetricFiltersCreateOrReplace(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.logsMetricFilters() + .define("Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])") + .withRegion("hvjoetfjcwqioibnqqj") + .withExistingResourceGroup("rglogsMetricFilter") + .withTags(mapOf("key5537", "fakeTokenPlaceholder")) + .withProperties(new LogsMetricFilterProperties() + .withAwsProperties(new AwsLogsMetricFilterProperties().withFilterName("xexgsguaaqmkiteqgc") + .withFilterPattern("xkejasx") + .withLogGroupName("cugxyp") + .withMetricTransformations(Arrays.asList(new MetricTransformation().withDefaultValue(7) + .withDimensions(Arrays.asList(new DimensionAutoGenerated().withKey("fakeTokenPlaceholder") + .withValue("rosnaljwmrdesiticsc"))) + .withMetricName("oybfr") + .withMetricNamespace("iabzdcxljvduduha") + .withMetricValue("rpkrrqxywciyvedsvrlbujqjenrlpr") + .withUnit(MetricTransformationUnit.BITS)))) + .withPublicCloudConnectorsResourceId("dabxbsdvufxltivnlbpft") + .withAwsAccountId("z") + .withArn("cjjfhzeoyddkfmdmwsl") + .withPublicCloudResourceName("ljjatut") + .withAwsSourceSchema("tekgcey") + .withAwsRegion("qjqubwwtlycfy") + .withAwsTags(mapOf("key5547", "fakeTokenPlaceholder"))) + .create(); + } + + // Use "Map.of" if available + @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/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/LogsMetricFiltersDeleteSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/LogsMetricFiltersDeleteSamples.java new file mode 100644 index 000000000000..a2a42b56aa09 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/LogsMetricFiltersDeleteSamples.java @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +/** + * Samples for LogsMetricFilters Delete. + */ +public final class LogsMetricFiltersDeleteSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * LogsMetricFilters_Delete.json + */ + /** + * Sample code: LogsMetricFilters_Delete. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void logsMetricFiltersDelete(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.logsMetricFilters() + .delete("rglogsMetricFilter", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/LogsMetricFiltersGetByResourceGroupSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/LogsMetricFiltersGetByResourceGroupSamples.java new file mode 100644 index 000000000000..cbcf2584b537 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/LogsMetricFiltersGetByResourceGroupSamples.java @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +/** + * Samples for LogsMetricFilters GetByResourceGroup. + */ +public final class LogsMetricFiltersGetByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * LogsMetricFilters_Get.json + */ + /** + * Sample code: LogsMetricFilters_Get. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void logsMetricFiltersGet(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.logsMetricFilters() + .getByResourceGroupWithResponse("rglogsMetricFilter", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/LogsMetricFiltersListByResourceGroupSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/LogsMetricFiltersListByResourceGroupSamples.java new file mode 100644 index 000000000000..da7fd3b58c20 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/LogsMetricFiltersListByResourceGroupSamples.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +/** + * Samples for LogsMetricFilters ListByResourceGroup. + */ +public final class LogsMetricFiltersListByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * LogsMetricFilters_ListByResourceGroup.json + */ + /** + * Sample code: LogsMetricFilters_ListByResourceGroup. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + logsMetricFiltersListByResourceGroup(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.logsMetricFilters().listByResourceGroup("rglogsMetricFilter", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/LogsMetricFiltersListSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/LogsMetricFiltersListSamples.java new file mode 100644 index 000000000000..21f973e6991c --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/LogsMetricFiltersListSamples.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +/** + * Samples for LogsMetricFilters List. + */ +public final class LogsMetricFiltersListSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * LogsMetricFilters_ListBySubscription.json + */ + /** + * Sample code: LogsMetricFilters_ListBySubscription. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + logsMetricFiltersListBySubscription(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.logsMetricFilters().list(com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/LogsMetricFiltersUpdateSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/LogsMetricFiltersUpdateSamples.java new file mode 100644 index 000000000000..2f3f9e32fef6 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/LogsMetricFiltersUpdateSamples.java @@ -0,0 +1,45 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +import com.azure.resourcemanager.awsconnector.models.LogsMetricFilter; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for LogsMetricFilters Update. + */ +public final class LogsMetricFiltersUpdateSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * LogsMetricFilters_Update.json + */ + /** + * Sample code: LogsMetricFilters_Update. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void logsMetricFiltersUpdate(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + LogsMetricFilter resource = manager.logsMetricFilters() + .getByResourceGroupWithResponse("rglogsMetricFilter", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE) + .getValue(); + resource.update().withTags(mapOf("key75", "fakeTokenPlaceholder")).apply(); + } + + // Use "Map.of" if available + @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/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/LogsSubscriptionFiltersCreateOrReplaceSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/LogsSubscriptionFiltersCreateOrReplaceSamples.java new file mode 100644 index 000000000000..b307b3e6e6e6 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/LogsSubscriptionFiltersCreateOrReplaceSamples.java @@ -0,0 +1,62 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +import com.azure.resourcemanager.awsconnector.models.AwsLogsSubscriptionFilterProperties; +import com.azure.resourcemanager.awsconnector.models.Distribution; +import com.azure.resourcemanager.awsconnector.models.LogsSubscriptionFilterProperties; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for LogsSubscriptionFilters CreateOrReplace. + */ +public final class LogsSubscriptionFiltersCreateOrReplaceSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * LogsSubscriptionFilters_CreateOrReplace.json + */ + /** + * Sample code: LogsSubscriptionFilters_CreateOrReplace. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + logsSubscriptionFiltersCreateOrReplace(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.logsSubscriptionFilters() + .define("Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])") + .withRegion("chliijcrgqpxjf") + .withExistingResourceGroup("rglogsSubscriptionFilter") + .withTags(mapOf("key9410", "fakeTokenPlaceholder")) + .withProperties(new LogsSubscriptionFilterProperties() + .withAwsProperties(new AwsLogsSubscriptionFilterProperties().withDestinationArn("k") + .withDistribution(Distribution.BY_LOG_STREAM) + .withFilterName("tboamjix") + .withFilterPattern("ui") + .withLogGroupName("ku") + .withRoleArn("qgjbnrzdeigsxsfrkkfiaf")) + .withPublicCloudConnectorsResourceId("ywjmogqrbdroewncecotnxyijemqjz") + .withAwsAccountId("fckvzypgfibfyknjwyrvmez") + .withArn("sbvdldikixyoalpxj") + .withPublicCloudResourceName("gilkw") + .withAwsSourceSchema("anvmszmmknfesvacxje") + .withAwsRegion("oogmbpnzqlvdmcntbzbsi") + .withAwsTags(mapOf("key7628", "fakeTokenPlaceholder"))) + .create(); + } + + // Use "Map.of" if available + @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/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/LogsSubscriptionFiltersDeleteSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/LogsSubscriptionFiltersDeleteSamples.java new file mode 100644 index 000000000000..7b3b88f04f58 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/LogsSubscriptionFiltersDeleteSamples.java @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +/** + * Samples for LogsSubscriptionFilters Delete. + */ +public final class LogsSubscriptionFiltersDeleteSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * LogsSubscriptionFilters_Delete.json + */ + /** + * Sample code: LogsSubscriptionFilters_Delete. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + logsSubscriptionFiltersDelete(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.logsSubscriptionFilters() + .delete("rglogsSubscriptionFilter", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/LogsSubscriptionFiltersGetByResourceGroupSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/LogsSubscriptionFiltersGetByResourceGroupSamples.java new file mode 100644 index 000000000000..bac131d40a3c --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/LogsSubscriptionFiltersGetByResourceGroupSamples.java @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +/** + * Samples for LogsSubscriptionFilters GetByResourceGroup. + */ +public final class LogsSubscriptionFiltersGetByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * LogsSubscriptionFilters_Get.json + */ + /** + * Sample code: LogsSubscriptionFilters_Get. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void logsSubscriptionFiltersGet(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.logsSubscriptionFilters() + .getByResourceGroupWithResponse("rglogsSubscriptionFilter", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/LogsSubscriptionFiltersListByResourceGroupSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/LogsSubscriptionFiltersListByResourceGroupSamples.java new file mode 100644 index 000000000000..1f28fc3a6319 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/LogsSubscriptionFiltersListByResourceGroupSamples.java @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +/** + * Samples for LogsSubscriptionFilters ListByResourceGroup. + */ +public final class LogsSubscriptionFiltersListByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * LogsSubscriptionFilters_ListByResourceGroup.json + */ + /** + * Sample code: LogsSubscriptionFilters_ListByResourceGroup. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + logsSubscriptionFiltersListByResourceGroup(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.logsSubscriptionFilters() + .listByResourceGroup("rglogsSubscriptionFilter", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/LogsSubscriptionFiltersListSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/LogsSubscriptionFiltersListSamples.java new file mode 100644 index 000000000000..d8be63830226 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/LogsSubscriptionFiltersListSamples.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +/** + * Samples for LogsSubscriptionFilters List. + */ +public final class LogsSubscriptionFiltersListSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * LogsSubscriptionFilters_ListBySubscription.json + */ + /** + * Sample code: LogsSubscriptionFilters_ListBySubscription. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + logsSubscriptionFiltersListBySubscription(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.logsSubscriptionFilters().list(com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/LogsSubscriptionFiltersUpdateSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/LogsSubscriptionFiltersUpdateSamples.java new file mode 100644 index 000000000000..7961fee49ab3 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/LogsSubscriptionFiltersUpdateSamples.java @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +import com.azure.resourcemanager.awsconnector.models.LogsSubscriptionFilter; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for LogsSubscriptionFilters Update. + */ +public final class LogsSubscriptionFiltersUpdateSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * LogsSubscriptionFilters_Update.json + */ + /** + * Sample code: LogsSubscriptionFilters_Update. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + logsSubscriptionFiltersUpdate(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + LogsSubscriptionFilter resource = manager.logsSubscriptionFilters() + .getByResourceGroupWithResponse("rglogsSubscriptionFilter", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE) + .getValue(); + resource.update().withTags(mapOf("key6314", "fakeTokenPlaceholder")).apply(); + } + + // Use "Map.of" if available + @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/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/Macie2JobSummariesCreateOrReplaceSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/Macie2JobSummariesCreateOrReplaceSamples.java new file mode 100644 index 000000000000..db047a8368a5 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/Macie2JobSummariesCreateOrReplaceSamples.java @@ -0,0 +1,127 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +import com.azure.resourcemanager.awsconnector.models.AwsMacie2JobSummaryProperties; +import com.azure.resourcemanager.awsconnector.models.CriteriaBlockForJob; +import com.azure.resourcemanager.awsconnector.models.CriteriaForJob; +import com.azure.resourcemanager.awsconnector.models.JobComparator; +import com.azure.resourcemanager.awsconnector.models.JobComparatorEnumValue; +import com.azure.resourcemanager.awsconnector.models.JobStatus; +import com.azure.resourcemanager.awsconnector.models.JobStatusEnumValue; +import com.azure.resourcemanager.awsconnector.models.JobType; +import com.azure.resourcemanager.awsconnector.models.JobTypeEnumValue; +import com.azure.resourcemanager.awsconnector.models.LastRunErrorStatus; +import com.azure.resourcemanager.awsconnector.models.LastRunErrorStatusCode; +import com.azure.resourcemanager.awsconnector.models.LastRunErrorStatusCodeEnumValue; +import com.azure.resourcemanager.awsconnector.models.Macie2JobSummaryProperties; +import com.azure.resourcemanager.awsconnector.models.S3BucketCriteriaForJob; +import com.azure.resourcemanager.awsconnector.models.S3BucketDefinitionForJob; +import com.azure.resourcemanager.awsconnector.models.SimpleCriterionForJob; +import com.azure.resourcemanager.awsconnector.models.SimpleCriterionKeyForJob; +import com.azure.resourcemanager.awsconnector.models.SimpleCriterionKeyForJobEnumValue; +import com.azure.resourcemanager.awsconnector.models.TagCriterionForJob; +import com.azure.resourcemanager.awsconnector.models.TagCriterionPairForJob; +import com.azure.resourcemanager.awsconnector.models.UserPausedDetails; +import java.time.OffsetDateTime; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for Macie2JobSummaries CreateOrReplace. + */ +public final class Macie2JobSummariesCreateOrReplaceSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * Macie2JobSummaries_CreateOrReplace.json + */ + /** + * Sample code: Macie2JobSummaries_CreateOrReplace. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + macie2JobSummariesCreateOrReplace(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.macie2JobSummaries() + .define("Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])") + .withRegion("sxbjamusvyf") + .withExistingResourceGroup("rgmacie2JobSummary") + .withTags(mapOf("key7937", "fakeTokenPlaceholder")) + .withProperties( + new Macie2JobSummaryProperties() + .withAwsProperties( + new AwsMacie2JobSummaryProperties() + .withBucketCriteria( + new S3BucketCriteriaForJob() + .withExcludes( + new CriteriaBlockForJob() + .withAnd( + Arrays.asList(new CriteriaForJob() + .withSimpleCriterion(new SimpleCriterionForJob() + .withComparator(new JobComparatorEnumValue() + .withValue(JobComparator.CONTAINS)) + .withKey(new SimpleCriterionKeyForJobEnumValue() + .withValue(SimpleCriterionKeyForJob.ACCOUNT_ID)) + .withValues(Arrays.asList("jtymirlxjxhaohkasaozlwag"))) + .withTagCriterion(new TagCriterionForJob() + .withComparator(new JobComparatorEnumValue() + .withValue(JobComparator.CONTAINS)) + .withTagValues(Arrays.asList( + new TagCriterionPairForJob().withKey("fakeTokenPlaceholder") + .withValue("yfiitptbkmgpsdnnhvfc"))))))) + .withIncludes( + new CriteriaBlockForJob() + .withAnd( + Arrays.asList(new CriteriaForJob() + .withSimpleCriterion(new SimpleCriterionForJob() + .withComparator(new JobComparatorEnumValue() + .withValue(JobComparator.CONTAINS)) + .withKey(new SimpleCriterionKeyForJobEnumValue() + .withValue(SimpleCriterionKeyForJob.ACCOUNT_ID)) + .withValues(Arrays.asList("jtymirlxjxhaohkasaozlwag"))) + .withTagCriterion(new TagCriterionForJob() + .withComparator(new JobComparatorEnumValue() + .withValue(JobComparator.CONTAINS)) + .withTagValues(Arrays.asList( + new TagCriterionPairForJob().withKey("fakeTokenPlaceholder") + .withValue("yfiitptbkmgpsdnnhvfc")))))))) + .withBucketDefinitions( + Arrays.asList(new S3BucketDefinitionForJob().withAccountId("eprxunabacgebqtyyff") + .withBuckets(Arrays.asList("nxnhxjevimwkagh")))) + .withCreatedAt(OffsetDateTime.parse("2024-10-08T03:51:31.106Z")) + .withJobId("jtjrvg") + .withJobStatus(new JobStatusEnumValue().withValue(JobStatus.CANCELLED)) + .withJobType(new JobTypeEnumValue().withValue(JobType.ONE_TIME)) + .withLastRunErrorStatus(new LastRunErrorStatus().withCode( + new LastRunErrorStatusCodeEnumValue().withValue(LastRunErrorStatusCode.ERROR))) + .withName("hjsakzgyfymsxrppmgaqz") + .withUserPausedDetails(new UserPausedDetails() + .withJobExpiresAt(OffsetDateTime.parse("2024-10-08T03:51:31.107Z")) + .withJobImminentExpirationHealthEventArn("tildeulhgl") + .withJobPausedAt(OffsetDateTime.parse("2024-10-08T03:51:31.107Z")))) + .withPublicCloudConnectorsResourceId("pwacjrxitwye") + .withAwsAccountId("foqcspfycfsvpqbfbcjutxvsaswla") + .withArn("gdmxefbzkonlgcinjivhec") + .withPublicCloudResourceName("xxlvdlekmm") + .withAwsSourceSchema("ucjahtqlqosuutn") + .withAwsRegion("lvgptsi") + .withAwsTags(mapOf("key5346", "fakeTokenPlaceholder"))) + .create(); + } + + // Use "Map.of" if available + @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/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/Macie2JobSummariesDeleteSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/Macie2JobSummariesDeleteSamples.java new file mode 100644 index 000000000000..3a4f2b38527b --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/Macie2JobSummariesDeleteSamples.java @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +/** + * Samples for Macie2JobSummaries Delete. + */ +public final class Macie2JobSummariesDeleteSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * Macie2JobSummaries_Delete.json + */ + /** + * Sample code: Macie2JobSummaries_Delete. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void macie2JobSummariesDelete(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.macie2JobSummaries() + .delete("rgmacie2JobSummary", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/Macie2JobSummariesGetByResourceGroupSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/Macie2JobSummariesGetByResourceGroupSamples.java new file mode 100644 index 000000000000..a5ceaff38f7a --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/Macie2JobSummariesGetByResourceGroupSamples.java @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +/** + * Samples for Macie2JobSummaries GetByResourceGroup. + */ +public final class Macie2JobSummariesGetByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * Macie2JobSummaries_Get.json + */ + /** + * Sample code: Macie2JobSummaries_Get. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void macie2JobSummariesGet(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.macie2JobSummaries() + .getByResourceGroupWithResponse("rgmacie2JobSummary", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/Macie2JobSummariesListByResourceGroupSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/Macie2JobSummariesListByResourceGroupSamples.java new file mode 100644 index 000000000000..f6d2ad43fe3f --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/Macie2JobSummariesListByResourceGroupSamples.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +/** + * Samples for Macie2JobSummaries ListByResourceGroup. + */ +public final class Macie2JobSummariesListByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * Macie2JobSummaries_ListByResourceGroup.json + */ + /** + * Sample code: Macie2JobSummaries_ListByResourceGroup. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + macie2JobSummariesListByResourceGroup(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.macie2JobSummaries().listByResourceGroup("rgmacie2JobSummary", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/Macie2JobSummariesListSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/Macie2JobSummariesListSamples.java new file mode 100644 index 000000000000..22f90fa52bfa --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/Macie2JobSummariesListSamples.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +/** + * Samples for Macie2JobSummaries List. + */ +public final class Macie2JobSummariesListSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * Macie2JobSummaries_ListBySubscription.json + */ + /** + * Sample code: Macie2JobSummaries_ListBySubscription. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + macie2JobSummariesListBySubscription(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.macie2JobSummaries().list(com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/Macie2JobSummariesUpdateSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/Macie2JobSummariesUpdateSamples.java new file mode 100644 index 000000000000..a12cc506dca8 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/Macie2JobSummariesUpdateSamples.java @@ -0,0 +1,45 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +import com.azure.resourcemanager.awsconnector.models.Macie2JobSummary; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for Macie2JobSummaries Update. + */ +public final class Macie2JobSummariesUpdateSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * Macie2JobSummaries_Update.json + */ + /** + * Sample code: Macie2JobSummaries_Update. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void macie2JobSummariesUpdate(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + Macie2JobSummary resource = manager.macie2JobSummaries() + .getByResourceGroupWithResponse("rgmacie2JobSummary", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE) + .getValue(); + resource.update().withTags(mapOf("key4316", "fakeTokenPlaceholder")).apply(); + } + + // Use "Map.of" if available + @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/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/MacieAllowListsCreateOrReplaceSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/MacieAllowListsCreateOrReplaceSamples.java new file mode 100644 index 000000000000..fd649556bbc0 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/MacieAllowListsCreateOrReplaceSamples.java @@ -0,0 +1,71 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +import com.azure.resourcemanager.awsconnector.models.AwsMacieAllowListProperties; +import com.azure.resourcemanager.awsconnector.models.Criteria; +import com.azure.resourcemanager.awsconnector.models.MacieAllowListProperties; +import com.azure.resourcemanager.awsconnector.models.S3WordsList; +import com.azure.resourcemanager.awsconnector.models.Status; +import com.azure.resourcemanager.awsconnector.models.TagAutoGenerated40; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for MacieAllowLists CreateOrReplace. + */ +public final class MacieAllowListsCreateOrReplaceSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * MacieAllowLists_CreateOrReplace.json + */ + /** + * Sample code: MacieAllowLists_CreateOrReplace. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + macieAllowListsCreateOrReplace(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.macieAllowLists() + .define("Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])") + .withRegion("ljfzlbopfuubipqzi") + .withExistingResourceGroup("rgmacieAllowList") + .withTags(mapOf("key2466", "fakeTokenPlaceholder")) + .withProperties( + new MacieAllowListProperties() + .withAwsProperties(new AwsMacieAllowListProperties().withArn("xdvleyfipecptdivylwygmlsaua") + .withCriteria(new Criteria().withRegex("lixefi") + .withS3WordsList(new S3WordsList().withBucketName("nfztmnzebbxtnmqmrmyqnuho") + .withObjectKey("fakeTokenPlaceholder"))) + .withDescription("wvwzsjgqyvyjbb") + .withId("ssesuxsvbo") + .withName("nkimocnjypmzr") + .withStatus(Status.OK) + .withTags(Arrays + .asList(new TagAutoGenerated40().withKey("fakeTokenPlaceholder").withValue("hipfzph")))) + .withPublicCloudConnectorsResourceId("rqoahjiblmrymixvgegzwfqdq") + .withAwsAccountId("jf") + .withArn("iuotvbrnfqcexaumxdelcobenu") + .withPublicCloudResourceName("ggubisvuvunhxrj") + .withAwsSourceSchema("vviqkggctwa") + .withAwsRegion("x") + .withAwsTags(mapOf("key6335", "fakeTokenPlaceholder"))) + .create(); + } + + // Use "Map.of" if available + @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/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/MacieAllowListsDeleteSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/MacieAllowListsDeleteSamples.java new file mode 100644 index 000000000000..5c6b6bac2d4d --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/MacieAllowListsDeleteSamples.java @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +/** + * Samples for MacieAllowLists Delete. + */ +public final class MacieAllowListsDeleteSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * MacieAllowLists_Delete.json + */ + /** + * Sample code: MacieAllowLists_Delete. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void macieAllowListsDelete(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.macieAllowLists() + .delete("rgmacieAllowList", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/MacieAllowListsGetByResourceGroupSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/MacieAllowListsGetByResourceGroupSamples.java new file mode 100644 index 000000000000..7b980e959471 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/MacieAllowListsGetByResourceGroupSamples.java @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +/** + * Samples for MacieAllowLists GetByResourceGroup. + */ +public final class MacieAllowListsGetByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/MacieAllowLists_Get + * .json + */ + /** + * Sample code: MacieAllowLists_Get. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void macieAllowListsGet(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.macieAllowLists() + .getByResourceGroupWithResponse("rgmacieAllowList", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/MacieAllowListsListByResourceGroupSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/MacieAllowListsListByResourceGroupSamples.java new file mode 100644 index 000000000000..24430c764eea --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/MacieAllowListsListByResourceGroupSamples.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +/** + * Samples for MacieAllowLists ListByResourceGroup. + */ +public final class MacieAllowListsListByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * MacieAllowLists_ListByResourceGroup.json + */ + /** + * Sample code: MacieAllowLists_ListByResourceGroup. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + macieAllowListsListByResourceGroup(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.macieAllowLists().listByResourceGroup("rgmacieAllowList", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/MacieAllowListsListSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/MacieAllowListsListSamples.java new file mode 100644 index 000000000000..fe4a8d47cbcf --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/MacieAllowListsListSamples.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +/** + * Samples for MacieAllowLists List. + */ +public final class MacieAllowListsListSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * MacieAllowLists_ListBySubscription.json + */ + /** + * Sample code: MacieAllowLists_ListBySubscription. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + macieAllowListsListBySubscription(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.macieAllowLists().list(com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/MacieAllowListsUpdateSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/MacieAllowListsUpdateSamples.java new file mode 100644 index 000000000000..3256a19432ad --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/MacieAllowListsUpdateSamples.java @@ -0,0 +1,45 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +import com.azure.resourcemanager.awsconnector.models.MacieAllowList; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for MacieAllowLists Update. + */ +public final class MacieAllowListsUpdateSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * MacieAllowLists_Update.json + */ + /** + * Sample code: MacieAllowLists_Update. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void macieAllowListsUpdate(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + MacieAllowList resource = manager.macieAllowLists() + .getByResourceGroupWithResponse("rgmacieAllowList", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE) + .getValue(); + resource.update().withTags(mapOf("key3904", "fakeTokenPlaceholder")).apply(); + } + + // Use "Map.of" if available + @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/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/NetworkFirewallFirewallPoliciesCreateOrReplaceSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/NetworkFirewallFirewallPoliciesCreateOrReplaceSamples.java new file mode 100644 index 000000000000..f6a24a0a982d --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/NetworkFirewallFirewallPoliciesCreateOrReplaceSamples.java @@ -0,0 +1,100 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +import com.azure.resourcemanager.awsconnector.models.ActionDefinition; +import com.azure.resourcemanager.awsconnector.models.AwsNetworkFirewallPolicyProperties; +import com.azure.resourcemanager.awsconnector.models.CustomAction; +import com.azure.resourcemanager.awsconnector.models.DimensionAutoGenerated2; +import com.azure.resourcemanager.awsconnector.models.FirewallPolicy; +import com.azure.resourcemanager.awsconnector.models.IpSet; +import com.azure.resourcemanager.awsconnector.models.NetworkFirewallPolicyProperties; +import com.azure.resourcemanager.awsconnector.models.PublishMetricAction; +import com.azure.resourcemanager.awsconnector.models.RuleVariablesModel; +import com.azure.resourcemanager.awsconnector.models.StatefulEngineOptions; +import com.azure.resourcemanager.awsconnector.models.StatefulEngineOptionsRuleOrder; +import com.azure.resourcemanager.awsconnector.models.StatefulEngineOptionsStreamExceptionPolicy; +import com.azure.resourcemanager.awsconnector.models.StatefulRuleGroupOverride; +import com.azure.resourcemanager.awsconnector.models.StatefulRuleGroupOverrideAction; +import com.azure.resourcemanager.awsconnector.models.StatefulRuleGroupReference; +import com.azure.resourcemanager.awsconnector.models.StatelessRuleGroupReference; +import com.azure.resourcemanager.awsconnector.models.TagAutoGenerated42; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for NetworkFirewallFirewallPolicies CreateOrReplace. + */ +public final class NetworkFirewallFirewallPoliciesCreateOrReplaceSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * NetworkFirewallFirewallPolicies_CreateOrReplace.json + */ + /** + * Sample code: NetworkFirewallFirewallPolicies_CreateOrReplace. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void networkFirewallFirewallPoliciesCreateOrReplace( + com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.networkFirewallFirewallPolicies() + .define("Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])") + .withRegion("jmirflesx") + .withExistingResourceGroup("rgnetworkFirewallFirewallPolicy") + .withTags(mapOf("key2040", "fakeTokenPlaceholder")) + .withProperties(new NetworkFirewallPolicyProperties() + .withAwsProperties(new AwsNetworkFirewallPolicyProperties().withDescription("lgkmdcxkddlt") + .withFirewallPolicy(new FirewallPolicy() + .withPolicyVariables(new RuleVariablesModel() + .withRuleVariables(mapOf("key6441", new IpSet().withDefinition(Arrays.asList("nwcsmd"))))) + .withStatefulDefaultActions(Arrays.asList("rhluwzzqiehteaka")) + .withStatefulEngineOptions(new StatefulEngineOptions() + .withRuleOrder(StatefulEngineOptionsRuleOrder.DEFAULT_ACTION_ORDER) + .withStreamExceptionPolicy(StatefulEngineOptionsStreamExceptionPolicy.CONTINUE)) + .withStatefulRuleGroupReferences(Arrays.asList(new StatefulRuleGroupReference() + .withOverride(new StatefulRuleGroupOverride() + .withAction(StatefulRuleGroupOverrideAction.DROP_TO_ALERT)) + .withPriority(24) + .withResourceArn("mjmcihwfckvrmkqo"))) + .withStatelessCustomActions(Arrays.asList(new CustomAction() + .withActionDefinition(new ActionDefinition() + .withPublishMetricAction(new PublishMetricAction().withDimensions(Arrays + .asList(new DimensionAutoGenerated2().withValue("kpelhvywxyvfwbkxeepdvujwrlywy"))))) + .withActionName("vzrqjgluyejlinwxxhuljye"))) + .withStatelessDefaultActions(Arrays.asList("bhojbxqneam")) + .withStatelessFragmentDefaultActions(Arrays.asList("lnpufwfpveptbxocevsbt")) + .withStatelessRuleGroupReferences( + Arrays.asList(new StatelessRuleGroupReference().withPriority(11) + .withResourceArn("kjggnkcabwynhgqkoryqzbkwz"))) + .withTlsInspectionConfigurationArn("qrdcssdykfcsxjdimv")) + .withFirewallPolicyArn("xpoahy") + .withFirewallPolicyId("ofrzbmefsngq") + .withFirewallPolicyName("xasgbvm") + .withTags(Arrays + .asList(new TagAutoGenerated42().withKey("fakeTokenPlaceholder").withValue("lrpynqejzy")))) + .withPublicCloudConnectorsResourceId("jgglyugkzlbqyphcmiuchfpzd") + .withAwsAccountId("fvglwybfwcjydvshvpaqacdtncc") + .withArn("rwqxtqealkkjplaoauziyt") + .withPublicCloudResourceName("txlbnhchqhqamo") + .withAwsSourceSchema("tupxubxwdvvlcxhmjn") + .withAwsRegion("ujnhepy") + .withAwsTags(mapOf("key2264", "fakeTokenPlaceholder"))) + .create(); + } + + // Use "Map.of" if available + @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/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/NetworkFirewallFirewallPoliciesDeleteSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/NetworkFirewallFirewallPoliciesDeleteSamples.java new file mode 100644 index 000000000000..98c393ec50cb --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/NetworkFirewallFirewallPoliciesDeleteSamples.java @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +/** + * Samples for NetworkFirewallFirewallPolicies Delete. + */ +public final class NetworkFirewallFirewallPoliciesDeleteSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * NetworkFirewallFirewallPolicies_Delete.json + */ + /** + * Sample code: NetworkFirewallFirewallPolicies_Delete. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + networkFirewallFirewallPoliciesDelete(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.networkFirewallFirewallPolicies() + .delete("rgnetworkFirewallFirewallPolicy", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/NetworkFirewallFirewallPoliciesGetByResourceGroupSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/NetworkFirewallFirewallPoliciesGetByResourceGroupSamples.java new file mode 100644 index 000000000000..7ce6bcfe507e --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/NetworkFirewallFirewallPoliciesGetByResourceGroupSamples.java @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +/** + * Samples for NetworkFirewallFirewallPolicies GetByResourceGroup. + */ +public final class NetworkFirewallFirewallPoliciesGetByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * NetworkFirewallFirewallPolicies_Get.json + */ + /** + * Sample code: NetworkFirewallFirewallPolicies_Get. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + networkFirewallFirewallPoliciesGet(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.networkFirewallFirewallPolicies() + .getByResourceGroupWithResponse("rgnetworkFirewallFirewallPolicy", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/NetworkFirewallFirewallPoliciesListByResourceGroupSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/NetworkFirewallFirewallPoliciesListByResourceGroupSamples.java new file mode 100644 index 000000000000..be2b605b5dce --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/NetworkFirewallFirewallPoliciesListByResourceGroupSamples.java @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +/** + * Samples for NetworkFirewallFirewallPolicies ListByResourceGroup. + */ +public final class NetworkFirewallFirewallPoliciesListByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * NetworkFirewallFirewallPolicies_ListByResourceGroup.json + */ + /** + * Sample code: NetworkFirewallFirewallPolicies_ListByResourceGroup. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void networkFirewallFirewallPoliciesListByResourceGroup( + com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.networkFirewallFirewallPolicies() + .listByResourceGroup("rgnetworkFirewallFirewallPolicy", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/NetworkFirewallFirewallPoliciesListSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/NetworkFirewallFirewallPoliciesListSamples.java new file mode 100644 index 000000000000..77d5d288557a --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/NetworkFirewallFirewallPoliciesListSamples.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +/** + * Samples for NetworkFirewallFirewallPolicies List. + */ +public final class NetworkFirewallFirewallPoliciesListSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * NetworkFirewallFirewallPolicies_ListBySubscription.json + */ + /** + * Sample code: NetworkFirewallFirewallPolicies_ListBySubscription. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void networkFirewallFirewallPoliciesListBySubscription( + com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.networkFirewallFirewallPolicies().list(com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/NetworkFirewallFirewallPoliciesUpdateSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/NetworkFirewallFirewallPoliciesUpdateSamples.java new file mode 100644 index 000000000000..5caac1824eb8 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/NetworkFirewallFirewallPoliciesUpdateSamples.java @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +import com.azure.resourcemanager.awsconnector.models.NetworkFirewallPolicy; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for NetworkFirewallFirewallPolicies Update. + */ +public final class NetworkFirewallFirewallPoliciesUpdateSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * NetworkFirewallFirewallPolicies_Update.json + */ + /** + * Sample code: NetworkFirewallFirewallPolicies_Update. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + networkFirewallFirewallPoliciesUpdate(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + NetworkFirewallPolicy resource = manager.networkFirewallFirewallPolicies() + .getByResourceGroupWithResponse("rgnetworkFirewallFirewallPolicy", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE) + .getValue(); + resource.update().withTags(mapOf("key1616", "fakeTokenPlaceholder")).apply(); + } + + // Use "Map.of" if available + @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/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/NetworkFirewallFirewallsCreateOrReplaceSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/NetworkFirewallFirewallsCreateOrReplaceSamples.java new file mode 100644 index 000000000000..7a662e64f98d --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/NetworkFirewallFirewallsCreateOrReplaceSamples.java @@ -0,0 +1,72 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +import com.azure.resourcemanager.awsconnector.models.AwsNetworkFirewallProperties; +import com.azure.resourcemanager.awsconnector.models.NetworkFirewallProperties; +import com.azure.resourcemanager.awsconnector.models.SubnetMappingAutoGenerated; +import com.azure.resourcemanager.awsconnector.models.TagAutoGenerated41; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for NetworkFirewallFirewalls CreateOrReplace. + */ +public final class NetworkFirewallFirewallsCreateOrReplaceSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * NetworkFirewallFirewalls_CreateOrReplace.json + */ + /** + * Sample code: NetworkFirewallFirewalls_CreateOrReplace. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + networkFirewallFirewallsCreateOrReplace(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.networkFirewallFirewalls() + .define("Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])") + .withRegion("shwlgihd") + .withExistingResourceGroup("rgnetworkFirewallFirewall") + .withTags(mapOf("key1029", "fakeTokenPlaceholder")) + .withProperties(new NetworkFirewallProperties().withAwsProperties(new AwsNetworkFirewallProperties() + .withDeleteProtection(true) + .withDescription("yjsjz") + .withEndpointIds(Arrays.asList("ivgfubgdwmucvasgqbxyoxs")) + .withFirewallArn("eukqjtyapnpaslgpyrjsuuuvrja") + .withFirewallId("ecwdwcfmctxuqrpliya") + .withFirewallName("rbcjdcahhnsogdcoklk") + .withFirewallPolicyArn("evdxwcayrnvbn") + .withFirewallPolicyChangeProtection(true) + .withSubnetChangeProtection(true) + .withSubnetMappings(Arrays.asList( + new SubnetMappingAutoGenerated().withIpAddressType("gkcalzfxwkomabldynmunz").withSubnetId("kmo"))) + .withTags(Arrays.asList( + new TagAutoGenerated41().withKey("fakeTokenPlaceholder").withValue("fnavszvtxyetugcmqvandzxjawuq"))) + .withVpcId("cxrvqz")) + .withPublicCloudConnectorsResourceId("qjo") + .withAwsAccountId("tcfbgbhrgcpvphfftvjmhjqg") + .withArn("zc") + .withPublicCloudResourceName("hloidqb") + .withAwsSourceSchema("syydqlqovymaflzph") + .withAwsRegion("ctyppkrhygaywzprynu") + .withAwsTags(mapOf("key9022", "fakeTokenPlaceholder"))) + .create(); + } + + // Use "Map.of" if available + @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/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/NetworkFirewallFirewallsDeleteSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/NetworkFirewallFirewallsDeleteSamples.java new file mode 100644 index 000000000000..1203fd9430bb --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/NetworkFirewallFirewallsDeleteSamples.java @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +/** + * Samples for NetworkFirewallFirewalls Delete. + */ +public final class NetworkFirewallFirewallsDeleteSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * NetworkFirewallFirewalls_Delete.json + */ + /** + * Sample code: NetworkFirewallFirewalls_Delete. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + networkFirewallFirewallsDelete(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.networkFirewallFirewalls() + .delete("rgnetworkFirewallFirewall", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/NetworkFirewallFirewallsGetByResourceGroupSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/NetworkFirewallFirewallsGetByResourceGroupSamples.java new file mode 100644 index 000000000000..1badabdb6908 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/NetworkFirewallFirewallsGetByResourceGroupSamples.java @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +/** + * Samples for NetworkFirewallFirewalls GetByResourceGroup. + */ +public final class NetworkFirewallFirewallsGetByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * NetworkFirewallFirewalls_Get.json + */ + /** + * Sample code: NetworkFirewallFirewalls_Get. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void networkFirewallFirewallsGet(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.networkFirewallFirewalls() + .getByResourceGroupWithResponse("rgnetworkFirewallFirewall", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/NetworkFirewallFirewallsListByResourceGroupSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/NetworkFirewallFirewallsListByResourceGroupSamples.java new file mode 100644 index 000000000000..5cc1446449c5 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/NetworkFirewallFirewallsListByResourceGroupSamples.java @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +/** + * Samples for NetworkFirewallFirewalls ListByResourceGroup. + */ +public final class NetworkFirewallFirewallsListByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * NetworkFirewallFirewalls_ListByResourceGroup.json + */ + /** + * Sample code: NetworkFirewallFirewalls_ListByResourceGroup. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void networkFirewallFirewallsListByResourceGroup( + com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.networkFirewallFirewalls() + .listByResourceGroup("rgnetworkFirewallFirewall", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/NetworkFirewallFirewallsListSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/NetworkFirewallFirewallsListSamples.java new file mode 100644 index 000000000000..4f47ab552b3b --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/NetworkFirewallFirewallsListSamples.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +/** + * Samples for NetworkFirewallFirewalls List. + */ +public final class NetworkFirewallFirewallsListSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * NetworkFirewallFirewalls_ListBySubscription.json + */ + /** + * Sample code: NetworkFirewallFirewalls_ListBySubscription. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + networkFirewallFirewallsListBySubscription(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.networkFirewallFirewalls().list(com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/NetworkFirewallFirewallsUpdateSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/NetworkFirewallFirewallsUpdateSamples.java new file mode 100644 index 000000000000..2afbd94e11a2 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/NetworkFirewallFirewallsUpdateSamples.java @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +import com.azure.resourcemanager.awsconnector.models.NetworkFirewall; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for NetworkFirewallFirewalls Update. + */ +public final class NetworkFirewallFirewallsUpdateSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * NetworkFirewallFirewalls_Update.json + */ + /** + * Sample code: NetworkFirewallFirewalls_Update. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + networkFirewallFirewallsUpdate(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + NetworkFirewall resource = manager.networkFirewallFirewalls() + .getByResourceGroupWithResponse("rgnetworkFirewallFirewall", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE) + .getValue(); + resource.update().withTags(mapOf("key3088", "fakeTokenPlaceholder")).apply(); + } + + // Use "Map.of" if available + @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/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/NetworkFirewallRuleGroupsCreateOrReplaceSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/NetworkFirewallRuleGroupsCreateOrReplaceSamples.java new file mode 100644 index 000000000000..8252c29681a9 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/NetworkFirewallRuleGroupsCreateOrReplaceSamples.java @@ -0,0 +1,142 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +import com.azure.resourcemanager.awsconnector.models.ActionDefinitionAutoGenerated; +import com.azure.resourcemanager.awsconnector.models.Address; +import com.azure.resourcemanager.awsconnector.models.AwsNetworkFirewallRuleGroupProperties; +import com.azure.resourcemanager.awsconnector.models.CustomActionAutoGenerated; +import com.azure.resourcemanager.awsconnector.models.DimensionAutoGenerated3; +import com.azure.resourcemanager.awsconnector.models.Header; +import com.azure.resourcemanager.awsconnector.models.HeaderDirection; +import com.azure.resourcemanager.awsconnector.models.HeaderProtocol; +import com.azure.resourcemanager.awsconnector.models.IpSet; +import com.azure.resourcemanager.awsconnector.models.IpSetReference; +import com.azure.resourcemanager.awsconnector.models.MatchAttributes; +import com.azure.resourcemanager.awsconnector.models.NetworkFirewallRuleGroupProperties; +import com.azure.resourcemanager.awsconnector.models.PortRange; +import com.azure.resourcemanager.awsconnector.models.PortSet; +import com.azure.resourcemanager.awsconnector.models.PublishMetricActionAutoGenerated; +import com.azure.resourcemanager.awsconnector.models.ReferenceSets; +import com.azure.resourcemanager.awsconnector.models.RuleDefinition; +import com.azure.resourcemanager.awsconnector.models.RuleGroup; +import com.azure.resourcemanager.awsconnector.models.RuleOption; +import com.azure.resourcemanager.awsconnector.models.RuleVariables; +import com.azure.resourcemanager.awsconnector.models.RulesSource; +import com.azure.resourcemanager.awsconnector.models.RulesSourceList; +import com.azure.resourcemanager.awsconnector.models.RulesSourceListGeneratedRulesType; +import com.azure.resourcemanager.awsconnector.models.StatefulRule; +import com.azure.resourcemanager.awsconnector.models.StatefulRuleAction; +import com.azure.resourcemanager.awsconnector.models.StatefulRuleOptions; +import com.azure.resourcemanager.awsconnector.models.StatefulRuleOptionsRuleOrder; +import com.azure.resourcemanager.awsconnector.models.StatelessRule; +import com.azure.resourcemanager.awsconnector.models.StatelessRulesAndCustomActions; +import com.azure.resourcemanager.awsconnector.models.TagAutoGenerated43; +import com.azure.resourcemanager.awsconnector.models.TcpFlagField; +import com.azure.resourcemanager.awsconnector.models.Type; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for NetworkFirewallRuleGroups CreateOrReplace. + */ +public final class NetworkFirewallRuleGroupsCreateOrReplaceSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * NetworkFirewallRuleGroups_CreateOrReplace.json + */ + /** + * Sample code: NetworkFirewallRuleGroups_CreateOrReplace. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + networkFirewallRuleGroupsCreateOrReplace(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.networkFirewallRuleGroups() + .define("Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])") + .withRegion("npjhzlsmeqnuoj") + .withExistingResourceGroup("rgnetworkFirewallRuleGroup") + .withTags(mapOf("key4955", "fakeTokenPlaceholder")) + .withProperties(new NetworkFirewallRuleGroupProperties() + .withAwsProperties(new AwsNetworkFirewallRuleGroupProperties().withCapacity(13) + .withDescription("zlkovsdkoamizsf") + .withRuleGroup(new RuleGroup() + .withReferenceSets(new ReferenceSets().withIpSetReferences( + mapOf("key2227", new IpSetReference().withReferenceArn("oytryvxnweahmshhucxpblpuc")))) + .withRuleVariables(new RuleVariables() + .withIpSets(mapOf("key2970", new IpSet().withDefinition(Arrays.asList("aizprahgi")))) + .withPortSets( + mapOf("key1199", new PortSet().withDefinition(Arrays.asList("wwayyzoztulbvq"))))) + .withRulesSource(new RulesSource() + .withRulesSourceList(new RulesSourceList() + .withGeneratedRulesType(RulesSourceListGeneratedRulesType.ALLOWLIST) + .withTargetTypes(Arrays.asList("efuuy")) + .withTargets(Arrays.asList("pnecsfopd"))) + .withRulesString("xujqqtutwcprdqudsnalep") + .withStatefulRules(Arrays.asList(new StatefulRule().withAction(StatefulRuleAction.ALERT) + .withHeaderProperty(new Header().withDestination("monehvupaofeakgppr") + .withDestinationPort("qlhyfsewpdlrpkxbdwfojdz") + .withDirection(HeaderDirection.ANY) + .withProtocol(HeaderProtocol.DCERPC) + .withSource("bmxmxcbelcmrkaigfwwbtbakerp") + .withSourcePort("ieimsyntk")) + .withRuleOptions(Arrays.asList(new RuleOption().withKeyword("fakeTokenPlaceholder") + .withSettings(Arrays.asList("xflxrtoyhczflnevdftw")))))) + .withStatelessRulesAndCustomActions( + new StatelessRulesAndCustomActions() + .withCustomActions(Arrays.asList(new CustomActionAutoGenerated() + .withActionDefinition(new ActionDefinitionAutoGenerated() + .withPublishMetricAction(new PublishMetricActionAutoGenerated() + .withDimensions(Arrays.asList(new DimensionAutoGenerated3() + .withValue("wninrpqzvmeovspprohpjge"))))) + .withActionName("kcfqhtt"))) + .withStatelessRules(Arrays.asList(new StatelessRule().withPriority(11) + .withRuleDefinition(new RuleDefinition() + .withActions(Arrays.asList("ofwytyaxwaoxjuhfror")) + .withMatchAttributes(new MatchAttributes() + .withDestinationPorts( + Arrays.asList(new PortRange().withFromPort(15).withToPort(3))) + .withDestinations(Arrays + .asList(new Address().withAddressDefinition("upxiaznlcwpjgrahrg"))) + .withProtocols(Arrays.asList(27)) + .withSourcePorts( + Arrays.asList(new PortRange().withFromPort(15).withToPort(3))) + .withSources(Arrays + .asList(new Address().withAddressDefinition("upxiaznlcwpjgrahrg"))) + .withTcpFlags( + Arrays.asList(new TcpFlagField().withFlags(Arrays.asList("hc")) + .withMasks(Arrays.asList("yycdx")))))))))) + .withStatefulRuleOptions( + new StatefulRuleOptions().withRuleOrder(StatefulRuleOptionsRuleOrder.DEFAULT_ACTION_ORDER))) + .withRuleGroupArn("ncyehiokafjeadkrhonngdvqgtmdm") + .withRuleGroupId("qfdxbisrqddn") + .withRuleGroupName("dypivpjvrdiecto") + .withTags(Arrays.asList( + new TagAutoGenerated43().withKey("fakeTokenPlaceholder").withValue("pbppqwfrbdysivibwbk"))) + .withType(Type.STATEFUL)) + .withPublicCloudConnectorsResourceId("zholufsqpqkxgirpxvvr") + .withAwsAccountId("lbmcidte") + .withArn("uzwseilcphanlymsepokkjnzich") + .withPublicCloudResourceName("gpndbetnqj") + .withAwsSourceSchema("ymsi") + .withAwsRegion("vnwwozbuhjsi") + .withAwsTags(mapOf("key4273", "fakeTokenPlaceholder"))) + .create(); + } + + // Use "Map.of" if available + @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/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/NetworkFirewallRuleGroupsDeleteSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/NetworkFirewallRuleGroupsDeleteSamples.java new file mode 100644 index 000000000000..ea216938e075 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/NetworkFirewallRuleGroupsDeleteSamples.java @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +/** + * Samples for NetworkFirewallRuleGroups Delete. + */ +public final class NetworkFirewallRuleGroupsDeleteSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * NetworkFirewallRuleGroups_Delete.json + */ + /** + * Sample code: NetworkFirewallRuleGroups_Delete. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + networkFirewallRuleGroupsDelete(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.networkFirewallRuleGroups() + .delete("rgnetworkFirewallRuleGroup", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/NetworkFirewallRuleGroupsGetByResourceGroupSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/NetworkFirewallRuleGroupsGetByResourceGroupSamples.java new file mode 100644 index 000000000000..e763f917bdbb --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/NetworkFirewallRuleGroupsGetByResourceGroupSamples.java @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +/** + * Samples for NetworkFirewallRuleGroups GetByResourceGroup. + */ +public final class NetworkFirewallRuleGroupsGetByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * NetworkFirewallRuleGroups_Get.json + */ + /** + * Sample code: NetworkFirewallRuleGroups_Get. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + networkFirewallRuleGroupsGet(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.networkFirewallRuleGroups() + .getByResourceGroupWithResponse("rgnetworkFirewallRuleGroup", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/NetworkFirewallRuleGroupsListByResourceGroupSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/NetworkFirewallRuleGroupsListByResourceGroupSamples.java new file mode 100644 index 000000000000..28f4f712d1ce --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/NetworkFirewallRuleGroupsListByResourceGroupSamples.java @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +/** + * Samples for NetworkFirewallRuleGroups ListByResourceGroup. + */ +public final class NetworkFirewallRuleGroupsListByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * NetworkFirewallRuleGroups_ListByResourceGroup.json + */ + /** + * Sample code: NetworkFirewallRuleGroups_ListByResourceGroup. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void networkFirewallRuleGroupsListByResourceGroup( + com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.networkFirewallRuleGroups() + .listByResourceGroup("rgnetworkFirewallRuleGroup", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/NetworkFirewallRuleGroupsListSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/NetworkFirewallRuleGroupsListSamples.java new file mode 100644 index 000000000000..b3a2ccf8be5c --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/NetworkFirewallRuleGroupsListSamples.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +/** + * Samples for NetworkFirewallRuleGroups List. + */ +public final class NetworkFirewallRuleGroupsListSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * NetworkFirewallRuleGroups_ListBySubscription.json + */ + /** + * Sample code: NetworkFirewallRuleGroups_ListBySubscription. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void networkFirewallRuleGroupsListBySubscription( + com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.networkFirewallRuleGroups().list(com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/NetworkFirewallRuleGroupsUpdateSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/NetworkFirewallRuleGroupsUpdateSamples.java new file mode 100644 index 000000000000..b0898611c54e --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/NetworkFirewallRuleGroupsUpdateSamples.java @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +import com.azure.resourcemanager.awsconnector.models.NetworkFirewallRuleGroup; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for NetworkFirewallRuleGroups Update. + */ +public final class NetworkFirewallRuleGroupsUpdateSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * NetworkFirewallRuleGroups_Update.json + */ + /** + * Sample code: NetworkFirewallRuleGroups_Update. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + networkFirewallRuleGroupsUpdate(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + NetworkFirewallRuleGroup resource = manager.networkFirewallRuleGroups() + .getByResourceGroupWithResponse("rgnetworkFirewallRuleGroup", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE) + .getValue(); + resource.update().withTags(mapOf("key6654", "fakeTokenPlaceholder")).apply(); + } + + // Use "Map.of" if available + @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/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/OpenSearchDomainStatusesCreateOrReplaceSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/OpenSearchDomainStatusesCreateOrReplaceSamples.java new file mode 100644 index 000000000000..b35e597efb15 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/OpenSearchDomainStatusesCreateOrReplaceSamples.java @@ -0,0 +1,198 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +import com.azure.resourcemanager.awsconnector.models.AdvancedSecurityOptions; +import com.azure.resourcemanager.awsconnector.models.AutoTuneOptionsOutput; +import com.azure.resourcemanager.awsconnector.models.AutoTuneState; +import com.azure.resourcemanager.awsconnector.models.AutoTuneStateEnumValue; +import com.azure.resourcemanager.awsconnector.models.AwsOpenSearchDomainStatusProperties; +import com.azure.resourcemanager.awsconnector.models.ChangeProgressDetails; +import com.azure.resourcemanager.awsconnector.models.ClusterConfig; +import com.azure.resourcemanager.awsconnector.models.CognitoOptions; +import com.azure.resourcemanager.awsconnector.models.ColdStorageOptions; +import com.azure.resourcemanager.awsconnector.models.ConfigChangeStatus; +import com.azure.resourcemanager.awsconnector.models.ConfigChangeStatusEnumValue; +import com.azure.resourcemanager.awsconnector.models.DeploymentStatus; +import com.azure.resourcemanager.awsconnector.models.DeploymentStatusEnumValue; +import com.azure.resourcemanager.awsconnector.models.DomainEndpointOptions; +import com.azure.resourcemanager.awsconnector.models.DomainProcessingStatusType; +import com.azure.resourcemanager.awsconnector.models.DomainProcessingStatusTypeEnumValue; +import com.azure.resourcemanager.awsconnector.models.EbsOptions; +import com.azure.resourcemanager.awsconnector.models.EncryptionAtRestOptions; +import com.azure.resourcemanager.awsconnector.models.InitiatedBy; +import com.azure.resourcemanager.awsconnector.models.InitiatedByEnumValue; +import com.azure.resourcemanager.awsconnector.models.IpAddressType; +import com.azure.resourcemanager.awsconnector.models.IpAddressTypeEnumValue; +import com.azure.resourcemanager.awsconnector.models.LogPublishingOption; +import com.azure.resourcemanager.awsconnector.models.ModifyingProperties; +import com.azure.resourcemanager.awsconnector.models.NodeToNodeEncryptionOptions; +import com.azure.resourcemanager.awsconnector.models.OffPeakWindow; +import com.azure.resourcemanager.awsconnector.models.OffPeakWindowOptions; +import com.azure.resourcemanager.awsconnector.models.OpenSearchDomainStatusProperties; +import com.azure.resourcemanager.awsconnector.models.OpenSearchPartitionInstanceType; +import com.azure.resourcemanager.awsconnector.models.OpenSearchPartitionInstanceTypeEnumValue; +import com.azure.resourcemanager.awsconnector.models.OpenSearchWarmPartitionInstanceType; +import com.azure.resourcemanager.awsconnector.models.OpenSearchWarmPartitionInstanceTypeEnumValue; +import com.azure.resourcemanager.awsconnector.models.PropertyValueType; +import com.azure.resourcemanager.awsconnector.models.PropertyValueTypeEnumValue; +import com.azure.resourcemanager.awsconnector.models.SamlIdp; +import com.azure.resourcemanager.awsconnector.models.SamlOptionsOutput; +import com.azure.resourcemanager.awsconnector.models.ServiceSoftwareOptions; +import com.azure.resourcemanager.awsconnector.models.SnapshotOptions; +import com.azure.resourcemanager.awsconnector.models.SoftwareUpdateOptions; +import com.azure.resourcemanager.awsconnector.models.TlsSecurityPolicy; +import com.azure.resourcemanager.awsconnector.models.TlsSecurityPolicyEnumValue; +import com.azure.resourcemanager.awsconnector.models.VolumeType; +import com.azure.resourcemanager.awsconnector.models.VolumeTypeEnumValue; +import com.azure.resourcemanager.awsconnector.models.VpcDerivedInfo; +import com.azure.resourcemanager.awsconnector.models.WindowStartTime; +import com.azure.resourcemanager.awsconnector.models.ZoneAwarenessConfig; +import java.time.OffsetDateTime; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for OpenSearchDomainStatuses CreateOrReplace. + */ +public final class OpenSearchDomainStatusesCreateOrReplaceSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * OpenSearchDomainStatuses_CreateOrReplace.json + */ + /** + * Sample code: OpenSearchDomainStatuses_CreateOrReplace. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + openSearchDomainStatusesCreateOrReplace(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.openSearchDomainStatuses() + .define("Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])") + .withRegion("cjnfjucekzuxbrhfzskptnxmy") + .withExistingResourceGroup("rgopenSearchDomainStatus") + .withTags(mapOf("key9493", "fakeTokenPlaceholder")) + .withProperties(new OpenSearchDomainStatusProperties() + .withAwsProperties(new AwsOpenSearchDomainStatusProperties().withArn("svblrdkqxeghxc") + .withAccessPolicies("zmizapetmvhfuhnuevg") + .withAdvancedOptions(mapOf("key5855", "fakeTokenPlaceholder")) + .withAdvancedSecurityOptions(new AdvancedSecurityOptions() + .withAnonymousAuthDisableDate(OffsetDateTime.parse("2024-10-08T03:49:18.317Z")) + .withAnonymousAuthEnabled(true) + .withEnabled(true) + .withInternalUserDatabaseEnabled(true) + .withSamlOptions(new SamlOptionsOutput().withEnabled(true) + .withIdp( + new SamlIdp().withEntityId("ujb").withMetadataContent("ncvlnvyvuwdkmspvvynhbjwzzerkl")) + .withRolesKey("fakeTokenPlaceholder") + .withSessionTimeoutMinutes(22) + .withSubjectKey("fakeTokenPlaceholder"))) + .withAutoTuneOptions(new AutoTuneOptionsOutput().withErrorMessage("gdouqrr") + .withState(new AutoTuneStateEnumValue().withValue(AutoTuneState.DISABLED)) + .withUseOffPeakWindow(true)) + .withChangeProgressDetails(new ChangeProgressDetails().withChangeId("acuqzpomrpdxccssgsjtftt") + .withConfigChangeStatus( + new ConfigChangeStatusEnumValue().withValue(ConfigChangeStatus.APPLYING_CHANGES)) + .withInitiatedBy(new InitiatedByEnumValue().withValue(InitiatedBy.CUSTOMER)) + .withLastUpdatedTime(OffsetDateTime.parse("2024-10-08T03:49:18.319Z")) + .withMessage("netweglaakukislhan") + .withStartTime(OffsetDateTime.parse("2024-10-08T03:49:18.319Z"))) + .withClusterConfig( + new ClusterConfig().withColdStorageOptions(new ColdStorageOptions().withEnabled(true)) + .withDedicatedMasterCount(15) + .withDedicatedMasterEnabled(true) + .withDedicatedMasterType(new OpenSearchPartitionInstanceTypeEnumValue() + .withValue(OpenSearchPartitionInstanceType.C4_2XLARGE_SEARCH)) + .withInstanceCount(6) + .withInstanceType(new OpenSearchPartitionInstanceTypeEnumValue() + .withValue(OpenSearchPartitionInstanceType.C4_2XLARGE_SEARCH)) + .withMultiAZWithStandbyEnabled(true) + .withWarmCount(29) + .withWarmEnabled(true) + .withWarmType(new OpenSearchWarmPartitionInstanceTypeEnumValue() + .withValue(OpenSearchWarmPartitionInstanceType.ULTRAWARM1_LARGE_SEARCH)) + .withZoneAwarenessConfig(new ZoneAwarenessConfig().withAvailabilityZoneCount(20)) + .withZoneAwarenessEnabled(true)) + .withCognitoOptions(new CognitoOptions().withEnabled(true) + .withIdentityPoolId("dcpqrbpnpihpqvibpysnhi") + .withRoleArn("wdpsbg") + .withUserPoolId("oeiqtnpxt")) + .withCreated(true) + .withDeleted(true) + .withDomainEndpointOptions( + new DomainEndpointOptions().withCustomEndpoint("pkalvbtpzxwdwtzlhet") + .withCustomEndpointCertificateArn("bmcnynq") + .withCustomEndpointEnabled(true) + .withEnforceHttps(true) + .withTlsSecurityPolicy(new TlsSecurityPolicyEnumValue() + .withValue(TlsSecurityPolicy.POLICY_MIN_TLS_1_0_2019_07))) + .withDomainId("vdvjabmtsxndtepulmirzlkxjc") + .withDomainName("zmweyexy") + .withDomainProcessingStatus( + new DomainProcessingStatusTypeEnumValue().withValue(DomainProcessingStatusType.ACTIVE)) + .withEbsOptions(new EbsOptions().withEbsEnabled(true) + .withIops(1) + .withThroughput(6) + .withVolumeSize(16) + .withVolumeType(new VolumeTypeEnumValue().withValue(VolumeType.GP2))) + .withEncryptionAtRestOptions( + new EncryptionAtRestOptions().withEnabled(true).withKmsKeyId("fakeTokenPlaceholder")) + .withEndpoint("y") + .withEndpointV2("lnmdhcvptzovtjrggoqef") + .withEndpoints(mapOf("key7016", "fakeTokenPlaceholder")) + .withEngineVersion("nafwkgnvpagjlvctspjtgg") + .withIpAddressType(new IpAddressTypeEnumValue().withValue(IpAddressType.DUALSTACK)) + .withLogPublishingOptions(mapOf("key1257", + new LogPublishingOption().withCloudWatchLogsLogGroupArn("yflaoiiuhbxlodpwh").withEnabled(true))) + .withModifyingProperties( + Arrays.asList(new ModifyingProperties().withActiveValue("igvntcixfgeammklivfvtjjxfka") + .withName("wbfqxsudlhdpidezy") + .withPendingValue("n") + .withValueType(new PropertyValueTypeEnumValue().withValue(PropertyValueType.PLAIN_TEXT)))) + .withNodeToNodeEncryptionOptions(new NodeToNodeEncryptionOptions().withEnabled(true)) + .withOffPeakWindowOptions(new OffPeakWindowOptions().withEnabled(true) + .withOffPeakWindow(new OffPeakWindow() + .withWindowStartTime(new WindowStartTime().withHours(19L).withMinutes(7L)))) + .withProcessing(true) + .withServiceSoftwareOptions(new ServiceSoftwareOptions() + .withAutomatedUpdateDate(OffsetDateTime.parse("2024-10-08T03:49:18.320Z")) + .withCancellable(true) + .withCurrentVersion("ugdoxim") + .withDescription("moodysfsdplowtykjopgnlgeodxt") + .withNewVersion("awqdkyicwktzdn") + .withOptionalDeployment(true) + .withUpdateAvailable(true) + .withUpdateStatus(new DeploymentStatusEnumValue().withValue(DeploymentStatus.COMPLETED))) + .withSnapshotOptions(new SnapshotOptions().withAutomatedSnapshotStartHour(9)) + .withSoftwareUpdateOptions(new SoftwareUpdateOptions().withAutoSoftwareUpdateEnabled(true)) + .withUpgradeProcessing(true) + .withVpcOptions(new VpcDerivedInfo().withAvailabilityZones(Arrays.asList("laxoeorkeojjhcnoji")) + .withSecurityGroupIds(Arrays.asList("ap")) + .withSubnetIds(Arrays.asList("oric")) + .withVpcId("jffbtwxjojtqphtd"))) + .withPublicCloudConnectorsResourceId("g") + .withAwsAccountId("l") + .withArn("xxoyruemlfezddeqgvpfvbvqrmmhzk") + .withPublicCloudResourceName("sntfjznnaylmvehihglcoyqpcyacz") + .withAwsSourceSchema("qrkamtxqjfb") + .withAwsRegion("mpszpnxbznm") + .withAwsTags(mapOf("key5895", "fakeTokenPlaceholder"))) + .create(); + } + + // Use "Map.of" if available + @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/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/OpenSearchDomainStatusesDeleteSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/OpenSearchDomainStatusesDeleteSamples.java new file mode 100644 index 000000000000..63ab68a50bcd --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/OpenSearchDomainStatusesDeleteSamples.java @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +/** + * Samples for OpenSearchDomainStatuses Delete. + */ +public final class OpenSearchDomainStatusesDeleteSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * OpenSearchDomainStatuses_Delete.json + */ + /** + * Sample code: OpenSearchDomainStatuses_Delete. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + openSearchDomainStatusesDelete(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.openSearchDomainStatuses() + .delete("rgopenSearchDomainStatus", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/OpenSearchDomainStatusesGetByResourceGroupSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/OpenSearchDomainStatusesGetByResourceGroupSamples.java new file mode 100644 index 000000000000..61c6661c99d9 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/OpenSearchDomainStatusesGetByResourceGroupSamples.java @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +/** + * Samples for OpenSearchDomainStatuses GetByResourceGroup. + */ +public final class OpenSearchDomainStatusesGetByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * OpenSearchDomainStatuses_Get.json + */ + /** + * Sample code: OpenSearchDomainStatuses_Get. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void openSearchDomainStatusesGet(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.openSearchDomainStatuses() + .getByResourceGroupWithResponse("rgopenSearchDomainStatus", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/OpenSearchDomainStatusesListByResourceGroupSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/OpenSearchDomainStatusesListByResourceGroupSamples.java new file mode 100644 index 000000000000..801c7bc58922 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/OpenSearchDomainStatusesListByResourceGroupSamples.java @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +/** + * Samples for OpenSearchDomainStatuses ListByResourceGroup. + */ +public final class OpenSearchDomainStatusesListByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * OpenSearchDomainStatuses_ListByResourceGroup.json + */ + /** + * Sample code: OpenSearchDomainStatuses_ListByResourceGroup. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void openSearchDomainStatusesListByResourceGroup( + com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.openSearchDomainStatuses() + .listByResourceGroup("rgopenSearchDomainStatus", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/OpenSearchDomainStatusesListSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/OpenSearchDomainStatusesListSamples.java new file mode 100644 index 000000000000..665fff8ce536 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/OpenSearchDomainStatusesListSamples.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +/** + * Samples for OpenSearchDomainStatuses List. + */ +public final class OpenSearchDomainStatusesListSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * OpenSearchDomainStatuses_ListBySubscription.json + */ + /** + * Sample code: OpenSearchDomainStatuses_ListBySubscription. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + openSearchDomainStatusesListBySubscription(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.openSearchDomainStatuses().list(com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/OpenSearchDomainStatusesUpdateSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/OpenSearchDomainStatusesUpdateSamples.java new file mode 100644 index 000000000000..1dd76dd5415e --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/OpenSearchDomainStatusesUpdateSamples.java @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +import com.azure.resourcemanager.awsconnector.models.OpenSearchDomainStatus; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for OpenSearchDomainStatuses Update. + */ +public final class OpenSearchDomainStatusesUpdateSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * OpenSearchDomainStatuses_Update.json + */ + /** + * Sample code: OpenSearchDomainStatuses_Update. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + openSearchDomainStatusesUpdate(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + OpenSearchDomainStatus resource = manager.openSearchDomainStatuses() + .getByResourceGroupWithResponse("rgopenSearchDomainStatus", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE) + .getValue(); + resource.update().withTags(mapOf("key7395", "fakeTokenPlaceholder")).apply(); + } + + // Use "Map.of" if available + @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/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/OperationsListSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/OperationsListSamples.java new file mode 100644 index 000000000000..a6f5ab6db06a --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/OperationsListSamples.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.awsconnector.generated; + +/** + * Samples for Operations List. + */ +public final class OperationsListSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/Operations_List. + * json + */ + /** + * Sample code: Operations_List. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void operationsList(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.operations().list(com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/OrganizationsAccountsCreateOrReplaceSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/OrganizationsAccountsCreateOrReplaceSamples.java new file mode 100644 index 000000000000..950b67ff8d5e --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/OrganizationsAccountsCreateOrReplaceSamples.java @@ -0,0 +1,71 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +import com.azure.resourcemanager.awsconnector.models.AwsOrganizationsAccountProperties; +import com.azure.resourcemanager.awsconnector.models.JoinedMethod; +import com.azure.resourcemanager.awsconnector.models.OrganizationsAccountProperties; +import com.azure.resourcemanager.awsconnector.models.Status; +import com.azure.resourcemanager.awsconnector.models.TagAutoGenerated44; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for OrganizationsAccounts CreateOrReplace. + */ +public final class OrganizationsAccountsCreateOrReplaceSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * OrganizationsAccounts_CreateOrReplace.json + */ + /** + * Sample code: OrganizationsAccounts_CreateOrReplace. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + organizationsAccountsCreateOrReplace(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.organizationsAccounts() + .define("Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])") + .withRegion("wyzamnearzlajcvzhj") + .withExistingResourceGroup("rgorganizationsAccount") + .withTags(mapOf("key9774", "fakeTokenPlaceholder")) + .withProperties(new OrganizationsAccountProperties() + .withAwsProperties( + new AwsOrganizationsAccountProperties().withAccountId("kkdjvhtsvtqybdxezywfojndmjpou") + .withAccountName("vegcsgzymnbxry") + .withArn("ffkjxnnwpewiiudycadgtyrztehy") + .withEmail("bwriakvcvyhklvulzwvlddeevj") + .withJoinedMethod(JoinedMethod.CREATED) + .withJoinedTimestamp("xdxxffzfzxgewxyavjim") + .withParentIds(Arrays.asList("xxzonolej")) + .withRoleName("izpxv") + .withStatus(Status.fromString("ACTIVE")) + .withTags(Arrays.asList( + new TagAutoGenerated44().withKey("fakeTokenPlaceholder").withValue("esqhxwyrftlxbuab")))) + .withPublicCloudConnectorsResourceId("zbgkie") + .withAwsAccountId("ggnntqdpbcdtbjxaiabsgxxmtunblo") + .withArn("zdirlutwidghhfrufpjhexxbsrfxwl") + .withPublicCloudResourceName("tmmwrgytiyucnzokuiq") + .withAwsSourceSchema("emcozgsikaryx") + .withAwsRegion("yvslwciyhnwwnxxrv") + .withAwsTags(mapOf("key907", "fakeTokenPlaceholder"))) + .create(); + } + + // Use "Map.of" if available + @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/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/OrganizationsAccountsDeleteSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/OrganizationsAccountsDeleteSamples.java new file mode 100644 index 000000000000..11e487ad8339 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/OrganizationsAccountsDeleteSamples.java @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +/** + * Samples for OrganizationsAccounts Delete. + */ +public final class OrganizationsAccountsDeleteSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * OrganizationsAccounts_Delete.json + */ + /** + * Sample code: OrganizationsAccounts_Delete. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void organizationsAccountsDelete(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.organizationsAccounts() + .delete("rgorganizationsAccount", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/OrganizationsAccountsGetByResourceGroupSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/OrganizationsAccountsGetByResourceGroupSamples.java new file mode 100644 index 000000000000..e9f7649d2500 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/OrganizationsAccountsGetByResourceGroupSamples.java @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +/** + * Samples for OrganizationsAccounts GetByResourceGroup. + */ +public final class OrganizationsAccountsGetByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * OrganizationsAccounts_Get.json + */ + /** + * Sample code: OrganizationsAccounts_Get. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void organizationsAccountsGet(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.organizationsAccounts() + .getByResourceGroupWithResponse("rgorganizationsAccount", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/OrganizationsAccountsListByResourceGroupSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/OrganizationsAccountsListByResourceGroupSamples.java new file mode 100644 index 000000000000..d72d504bbfe3 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/OrganizationsAccountsListByResourceGroupSamples.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +/** + * Samples for OrganizationsAccounts ListByResourceGroup. + */ +public final class OrganizationsAccountsListByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * OrganizationsAccounts_ListByResourceGroup.json + */ + /** + * Sample code: OrganizationsAccounts_ListByResourceGroup. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + organizationsAccountsListByResourceGroup(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.organizationsAccounts().listByResourceGroup("rgorganizationsAccount", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/OrganizationsAccountsListSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/OrganizationsAccountsListSamples.java new file mode 100644 index 000000000000..ee25581037e0 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/OrganizationsAccountsListSamples.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +/** + * Samples for OrganizationsAccounts List. + */ +public final class OrganizationsAccountsListSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * OrganizationsAccounts_ListBySubscription.json + */ + /** + * Sample code: OrganizationsAccounts_ListBySubscription. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + organizationsAccountsListBySubscription(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.organizationsAccounts().list(com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/OrganizationsAccountsUpdateSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/OrganizationsAccountsUpdateSamples.java new file mode 100644 index 000000000000..3ddc928c3ee7 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/OrganizationsAccountsUpdateSamples.java @@ -0,0 +1,45 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +import com.azure.resourcemanager.awsconnector.models.OrganizationsAccount; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for OrganizationsAccounts Update. + */ +public final class OrganizationsAccountsUpdateSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * OrganizationsAccounts_Update.json + */ + /** + * Sample code: OrganizationsAccounts_Update. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void organizationsAccountsUpdate(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + OrganizationsAccount resource = manager.organizationsAccounts() + .getByResourceGroupWithResponse("rgorganizationsAccount", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE) + .getValue(); + resource.update().withTags(mapOf("key8859", "fakeTokenPlaceholder")).apply(); + } + + // Use "Map.of" if available + @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/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/OrganizationsOrganizationsCreateOrReplaceSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/OrganizationsOrganizationsCreateOrReplaceSamples.java new file mode 100644 index 000000000000..fc9e358a89e3 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/OrganizationsOrganizationsCreateOrReplaceSamples.java @@ -0,0 +1,63 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +import com.azure.resourcemanager.awsconnector.models.AwsOrganizationsOrganizationProperties; +import com.azure.resourcemanager.awsconnector.models.FeatureSet; +import com.azure.resourcemanager.awsconnector.models.OrganizationsOrganizationProperties; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for OrganizationsOrganizations CreateOrReplace. + */ +public final class OrganizationsOrganizationsCreateOrReplaceSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * OrganizationsOrganizations_CreateOrReplace.json + */ + /** + * Sample code: OrganizationsOrganizations_CreateOrReplace. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + organizationsOrganizationsCreateOrReplace(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.organizationsOrganizations() + .define("Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])") + .withRegion("fnzfxrkfm") + .withExistingResourceGroup("rgorganizationsOrganization") + .withTags(mapOf("key6745", "fakeTokenPlaceholder")) + .withProperties(new OrganizationsOrganizationProperties() + .withAwsProperties(new AwsOrganizationsOrganizationProperties().withArn("fzkwsgtciqziilbltckzwq") + .withFeatureSet(FeatureSet.ALL) + .withId("tqnrsqnzkqywpecutoxisdogfsu") + .withManagementAccountArn("aobzot") + .withManagementAccountEmail("vvcketnvinjxxhqabioa") + .withManagementAccountId("bvkksaokvmucejmtqhlwqoiuluet") + .withRootId("jtmupzgyvqhoiag")) + .withPublicCloudConnectorsResourceId("xdnn") + .withAwsAccountId("jusgdaxywgsswam") + .withArn("zitrzzdipihyovymdibklklp") + .withPublicCloudResourceName("vvwkbodgowhbhletjswxg") + .withAwsSourceSchema("pdqllbj") + .withAwsRegion("gogfumxcpzmqfcpynwlbjhjax") + .withAwsTags(mapOf("key8866", "fakeTokenPlaceholder"))) + .create(); + } + + // Use "Map.of" if available + @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/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/OrganizationsOrganizationsDeleteSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/OrganizationsOrganizationsDeleteSamples.java new file mode 100644 index 000000000000..4d0f722a0a95 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/OrganizationsOrganizationsDeleteSamples.java @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +/** + * Samples for OrganizationsOrganizations Delete. + */ +public final class OrganizationsOrganizationsDeleteSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * OrganizationsOrganizations_Delete.json + */ + /** + * Sample code: OrganizationsOrganizations_Delete. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + organizationsOrganizationsDelete(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.organizationsOrganizations() + .delete("rgorganizationsOrganization", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/OrganizationsOrganizationsGetByResourceGroupSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/OrganizationsOrganizationsGetByResourceGroupSamples.java new file mode 100644 index 000000000000..cdf9ead1af0c --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/OrganizationsOrganizationsGetByResourceGroupSamples.java @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +/** + * Samples for OrganizationsOrganizations GetByResourceGroup. + */ +public final class OrganizationsOrganizationsGetByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * OrganizationsOrganizations_Get.json + */ + /** + * Sample code: OrganizationsOrganizations_Get. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + organizationsOrganizationsGet(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.organizationsOrganizations() + .getByResourceGroupWithResponse("rgorganizationsOrganization", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/OrganizationsOrganizationsListByResourceGroupSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/OrganizationsOrganizationsListByResourceGroupSamples.java new file mode 100644 index 000000000000..c4edc4bf01e7 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/OrganizationsOrganizationsListByResourceGroupSamples.java @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +/** + * Samples for OrganizationsOrganizations ListByResourceGroup. + */ +public final class OrganizationsOrganizationsListByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * OrganizationsOrganizations_ListByResourceGroup.json + */ + /** + * Sample code: OrganizationsOrganizations_ListByResourceGroup. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void organizationsOrganizationsListByResourceGroup( + com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.organizationsOrganizations() + .listByResourceGroup("rgorganizationsOrganization", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/OrganizationsOrganizationsListSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/OrganizationsOrganizationsListSamples.java new file mode 100644 index 000000000000..7af17b9326fb --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/OrganizationsOrganizationsListSamples.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +/** + * Samples for OrganizationsOrganizations List. + */ +public final class OrganizationsOrganizationsListSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * OrganizationsOrganizations_ListBySubscription.json + */ + /** + * Sample code: OrganizationsOrganizations_ListBySubscription. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void organizationsOrganizationsListBySubscription( + com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.organizationsOrganizations().list(com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/OrganizationsOrganizationsUpdateSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/OrganizationsOrganizationsUpdateSamples.java new file mode 100644 index 000000000000..d171e424357b --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/OrganizationsOrganizationsUpdateSamples.java @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +import com.azure.resourcemanager.awsconnector.models.OrganizationsOrganization; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for OrganizationsOrganizations Update. + */ +public final class OrganizationsOrganizationsUpdateSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * OrganizationsOrganizations_Update.json + */ + /** + * Sample code: OrganizationsOrganizations_Update. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + organizationsOrganizationsUpdate(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + OrganizationsOrganization resource = manager.organizationsOrganizations() + .getByResourceGroupWithResponse("rgorganizationsOrganization", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE) + .getValue(); + resource.update().withTags(mapOf("key5330", "fakeTokenPlaceholder")).apply(); + } + + // Use "Map.of" if available + @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/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/RdsDbClustersCreateOrReplaceSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/RdsDbClustersCreateOrReplaceSamples.java new file mode 100644 index 000000000000..7c82cb37b619 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/RdsDbClustersCreateOrReplaceSamples.java @@ -0,0 +1,131 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +import com.azure.resourcemanager.awsconnector.models.AwsRdsDBClusterProperties; +import com.azure.resourcemanager.awsconnector.models.DBClusterRole; +import com.azure.resourcemanager.awsconnector.models.EndpointAutoGenerated; +import com.azure.resourcemanager.awsconnector.models.MasterUserSecret; +import com.azure.resourcemanager.awsconnector.models.RdsDBClusterProperties; +import com.azure.resourcemanager.awsconnector.models.ReadEndpoint; +import com.azure.resourcemanager.awsconnector.models.ScalingConfiguration; +import com.azure.resourcemanager.awsconnector.models.ServerlessV2ScalingConfiguration; +import com.azure.resourcemanager.awsconnector.models.TagAutoGenerated45; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for RdsDbClusters CreateOrReplace. + */ +public final class RdsDbClustersCreateOrReplaceSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * RdsDbClusters_CreateOrReplace.json + */ + /** + * Sample code: RdsDbClusters_CreateOrReplace. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + rdsDbClustersCreateOrReplace(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.rdsDbClusters() + .define("Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])") + .withRegion("di") + .withExistingResourceGroup("rgrdsDBCluster") + .withTags(mapOf("key1769", "fakeTokenPlaceholder")) + .withProperties(new RdsDBClusterProperties() + .withAwsProperties(new AwsRdsDBClusterProperties().withAllocatedStorage(12) + .withAssociatedRoles(Arrays + .asList(new DBClusterRole().withFeatureName("yupxlegnstbpoght").withRoleArn("pcilcosyud"))) + .withAutoMinorVersionUpgrade(true) + .withAvailabilityZones(Arrays.asList("xbabqekpowoz")) + .withBacktrackWindow(18) + .withBackupRetentionPeriod(11) + .withCopyTagsToSnapshot(true) + .withDbClusterArn("zdohcaiqsymzj") + .withDbClusterIdentifier("euvcyppvvutbntragfptjnmzhg") + .withDbClusterInstanceClass("suufjmxymxlrberbqtknmsvzrsajw") + .withDbClusterParameterGroupName("sokiordelmtviobobxrdsw") + .withDbClusterResourceId("vnwlcfxokdrjitagoefxrsf") + .withDbInstanceParameterGroupName("cwhdxixjtyfziflvod") + .withDbSubnetGroupName("ajeipefwih") + .withDbSystemId("exockxknyjqihmhxjuin") + .withDatabaseName("ttn") + .withDeletionProtection(true) + .withDomain("qzpcprovksxsiuithxqu") + .withDomainIamRoleName("psubmwhsowirjcnv") + .withEnableCloudwatchLogsExports(Arrays.asList("lytydxlnpduhnvmifkneiu")) + .withEnableGlobalWriteForwarding(true) + .withEnableHttpEndpoint(true) + .withEnableIamDatabaseAuthentication(true) + .withEndpoint(new EndpointAutoGenerated().withAddress("pwliordavkhwfklfzwxic").withPort("nagvki")) + .withEngine("cehuc") + .withEngineMode("iokki") + .withEngineVersion("ziindzjpzdrbcmtougdffweh") + .withGlobalClusterIdentifier("jqoiwozrdbnumywlieglbpzzx") + .withIops(26) + .withKmsKeyId("fakeTokenPlaceholder") + .withManageMasterUserPassword(true) + .withMasterUserPassword("fakeTokenPlaceholder") + .withMasterUserSecret(new MasterUserSecret().withKmsKeyId("fakeTokenPlaceholder") + .withSecretArn("fakeTokenPlaceholder")) + .withMasterUsername("lusozmpnihhahsioubedg") + .withMonitoringInterval(17) + .withMonitoringRoleArn("pqckluqmxqazvvi") + .withNetworkType("mnsuyqfkeqg") + .withPerformanceInsightsEnabled(true) + .withPerformanceInsightsKmsKeyId("fakeTokenPlaceholder") + .withPerformanceInsightsRetentionPeriod(2) + .withPort(23) + .withPreferredBackupWindow("shjtwjtugyols") + .withPreferredMaintenanceWindow("fuuieyvfhfcanzgutwcdbtbenk") + .withPubliclyAccessible(true) + .withReadEndpoint(new ReadEndpoint().withAddress("ca")) + .withReplicationSourceIdentifier("sdohltrpdqsszpptdh") + .withRestoreToTime("srbuhavl") + .withRestoreType("tnsdjgvzcnnsjxw") + .withScalingConfiguration(new ScalingConfiguration().withAutoPause(true) + .withMaxCapacity(3) + .withMinCapacity(5) + .withSecondsBeforeTimeout(28) + .withSecondsUntilAutoPause(25) + .withTimeoutAction("cqgyqshpkcyblfsqmujyxpfiyv")) + .withServerlessV2ScalingConfiguration( + new ServerlessV2ScalingConfiguration().withMaxCapacity(23.0F).withMinCapacity(16.0F)) + .withSnapshotIdentifier("vqowgxcqbclzjexvyigvdzlpcdluvv") + .withSourceDBClusterIdentifier("jtvnbddzyqf") + .withSourceRegion("vrzpezvwoszraxdi") + .withStorageEncrypted(true) + .withStorageThroughput(6) + .withStorageType("iiwkeunemifyewevpcvcrbs") + .withTags(Arrays.asList( + new TagAutoGenerated45().withKey("fakeTokenPlaceholder").withValue("szbfittyghldzvnflsglc"))) + .withUseLatestRestorableTime(true) + .withVpcSecurityGroupIds(Arrays.asList("jdkxpjhsibvgvorizsuzta"))) + .withPublicCloudConnectorsResourceId("pexhjqkygfiozfsvo") + .withAwsAccountId("rpxoebfhnpwagqqgk") + .withArn("lllohvlgyg") + .withPublicCloudResourceName("quyqfarecht") + .withAwsSourceSchema("wrucexqlrnssoxvtczytcslheth") + .withAwsRegion("fulsvqpnagyrsirhnuxdsppl") + .withAwsTags(mapOf("key4409", "fakeTokenPlaceholder"))) + .create(); + } + + // Use "Map.of" if available + @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/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/RdsDbClustersDeleteSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/RdsDbClustersDeleteSamples.java new file mode 100644 index 000000000000..e1d20fe05605 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/RdsDbClustersDeleteSamples.java @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +/** + * Samples for RdsDbClusters Delete. + */ +public final class RdsDbClustersDeleteSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * RdsDbClusters_Delete.json + */ + /** + * Sample code: RdsDbClusters_Delete. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void rdsDbClustersDelete(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.rdsDbClusters() + .delete("rgrdsDBCluster", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/RdsDbClustersGetByResourceGroupSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/RdsDbClustersGetByResourceGroupSamples.java new file mode 100644 index 000000000000..bdba11ba40bc --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/RdsDbClustersGetByResourceGroupSamples.java @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +/** + * Samples for RdsDbClusters GetByResourceGroup. + */ +public final class RdsDbClustersGetByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/RdsDbClusters_Get. + * json + */ + /** + * Sample code: RdsDbClusters_Get. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void rdsDbClustersGet(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.rdsDbClusters() + .getByResourceGroupWithResponse("rgrdsDBCluster", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/RdsDbClustersListByResourceGroupSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/RdsDbClustersListByResourceGroupSamples.java new file mode 100644 index 000000000000..a4585b15a4c9 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/RdsDbClustersListByResourceGroupSamples.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +/** + * Samples for RdsDbClusters ListByResourceGroup. + */ +public final class RdsDbClustersListByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * RdsDbClusters_ListByResourceGroup.json + */ + /** + * Sample code: RdsDbClusters_ListByResourceGroup. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + rdsDbClustersListByResourceGroup(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.rdsDbClusters().listByResourceGroup("rgrdsDBCluster", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/RdsDbClustersListSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/RdsDbClustersListSamples.java new file mode 100644 index 000000000000..94e796b44d43 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/RdsDbClustersListSamples.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +/** + * Samples for RdsDbClusters List. + */ +public final class RdsDbClustersListSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * RdsDbClusters_ListBySubscription.json + */ + /** + * Sample code: RdsDbClusters_ListBySubscription. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + rdsDbClustersListBySubscription(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.rdsDbClusters().list(com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/RdsDbClustersUpdateSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/RdsDbClustersUpdateSamples.java new file mode 100644 index 000000000000..2986265ab3c1 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/RdsDbClustersUpdateSamples.java @@ -0,0 +1,45 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +import com.azure.resourcemanager.awsconnector.models.RdsDBCluster; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for RdsDbClusters Update. + */ +public final class RdsDbClustersUpdateSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * RdsDbClusters_Update.json + */ + /** + * Sample code: RdsDbClusters_Update. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void rdsDbClustersUpdate(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + RdsDBCluster resource = manager.rdsDbClusters() + .getByResourceGroupWithResponse("rgrdsDBCluster", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE) + .getValue(); + resource.update().withTags(mapOf("key7248", "fakeTokenPlaceholder")).apply(); + } + + // Use "Map.of" if available + @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/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/RdsDbInstancesCreateOrReplaceSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/RdsDbInstancesCreateOrReplaceSamples.java new file mode 100644 index 000000000000..43a264d5ad46 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/RdsDbInstancesCreateOrReplaceSamples.java @@ -0,0 +1,152 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +import com.azure.resourcemanager.awsconnector.models.AwsRdsDBInstanceProperties; +import com.azure.resourcemanager.awsconnector.models.CertificateDetails; +import com.azure.resourcemanager.awsconnector.models.DBInstanceRole; +import com.azure.resourcemanager.awsconnector.models.EndpointAutoGenerated2; +import com.azure.resourcemanager.awsconnector.models.MasterUserSecret; +import com.azure.resourcemanager.awsconnector.models.ProcessorFeature; +import com.azure.resourcemanager.awsconnector.models.ProcessorFeatureName; +import com.azure.resourcemanager.awsconnector.models.RdsDBInstanceProperties; +import com.azure.resourcemanager.awsconnector.models.TagAutoGenerated46; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for RdsDbInstances CreateOrReplace. + */ +public final class RdsDbInstancesCreateOrReplaceSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * RdsDbInstances_CreateOrReplace.json + */ + /** + * Sample code: RdsDbInstances_CreateOrReplace. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + rdsDbInstancesCreateOrReplace(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.rdsDbInstances() + .define("Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])") + .withRegion("pktn") + .withExistingResourceGroup("rgrdsDBInstance") + .withTags(mapOf("key7306", "fakeTokenPlaceholder")) + .withProperties( + new RdsDBInstanceProperties() + .withAwsProperties(new AwsRdsDBInstanceProperties().withAllocatedStorage("ryhixfujuvwifznymxbze") + .withAllowMajorVersionUpgrade(true) + .withAssociatedRoles(Arrays.asList(new DBInstanceRole().withFeatureName("jyivqbpnmvg") + .withRoleArn("jblmzpmkcvnkvsxkswtmfqlwttf"))) + .withAutoMinorVersionUpgrade(true) + .withAutomaticBackupReplicationKmsKeyId("fakeTokenPlaceholder") + .withAutomaticBackupReplicationRegion("h") + .withAvailabilityZone("ccdhbiqvvdxbszpuhcvsvpuqfrkosf") + .withBackupRetentionPeriod(6) + .withCaCertificateIdentifier("dp") + .withCertificateDetails(new CertificateDetails().withCaIdentifier("jathtqegixcwxcwmnrlrsycxvyp") + .withValidTill("nclrurexsnhed")) + .withCertificateRotationRestart(true) + .withCharacterSetName("bapraruogdpspvewmd") + .withCopyTagsToSnapshot(true) + .withCustomIamInstanceProfile("ronoghiguflpqdlwef") + .withDbClusterIdentifier("mi") + .withDbClusterSnapshotIdentifier("biqdaekgjeyopntgrx") + .withDbInstanceArn("xxk") + .withDbInstanceClass("xvgbsmhvq") + .withDbInstanceIdentifier("svbefulaqhcsf") + .withDbName("yryxlwvdmghqcfdlhdyykzejtyep") + .withDbParameterGroupName("keuvtxklarpjmikkuwqqfanv") + .withDbSecurityGroups(Arrays.asList("mgcichzarguqhevlwubzgbvs")) + .withDbSnapshotIdentifier("coykeofgbcwpjeihmmajttm") + .withDbSubnetGroupName("yxd") + .withDbSystemId("rlbhsqhwmezvevqsme") + .withDbiResourceId("nlqlrrljz") + .withDedicatedLogVolume(true) + .withDeleteAutomatedBackups(true) + .withDeletionProtection(true) + .withDomain("mkboglzqbejwwfplkhpiwsvndwphik") + .withDomainAuthSecretArn("fakeTokenPlaceholder") + .withDomainDnsIps(Arrays.asList("celohfbruu")) + .withDomainFqdn("txgpdsxlpqbasbbmpzzkdztlfphm") + .withDomainIamRoleName("ljnyfnuzyqodzawuu") + .withDomainOu("yhtbsdxktvxrtweyoo") + .withEnableCloudwatchLogsExports(Arrays.asList("anqxngk")) + .withEnableIamDatabaseAuthentication(true) + .withEnablePerformanceInsights(true) + .withEndpoint(new EndpointAutoGenerated2().withAddress("rmsxn") + .withHostedZoneId("mvsioevf") + .withPort("gfpslsfdtnmrahrfppdwaf")) + .withEngine("jztlgxuyyhlwrjkgree") + .withEngineVersion("fwmhfzboltipjkflr") + .withIops(6) + .withKmsKeyId("fakeTokenPlaceholder") + .withLicenseModel("qcmsltdkpdsznfotmqdvnntnfor") + .withManageMasterUserPassword(true) + .withMasterUserPassword("fakeTokenPlaceholder") + .withMasterUserSecret(new MasterUserSecret().withKmsKeyId("fakeTokenPlaceholder") + .withSecretArn("fakeTokenPlaceholder")) + .withMasterUsername("lfitzeghwpzjhcbje") + .withMaxAllocatedStorage(9) + .withMonitoringInterval(17) + .withMonitoringRoleArn("a") + .withMultiAZ(true) + .withNcharCharacterSetName("cc") + .withNetworkType("bccgoqncxrhuwvgwvwta") + .withOptionGroupName("mftqhqogtwleqvlpjpbabps") + .withPerformanceInsightsKmsKeyId("fakeTokenPlaceholder") + .withPerformanceInsightsRetentionPeriod(27) + .withPort("g") + .withPreferredBackupWindow("wesxjihubbcfgwqebebkzmmfoipd") + .withPreferredMaintenanceWindow("gtmzlucaagottcm") + .withProcessorFeatures( + Arrays.asList(new ProcessorFeature().withName(ProcessorFeatureName.CORE_COUNT) + .withValue("qhhoewgkcuvttcihy"))) + .withPromotionTier(12) + .withPubliclyAccessible(true) + .withReplicaMode("poucyygmqhpztshwupms") + .withRestoreTime("nokteyfkzzvhgjtpmiwxajseiavtbk") + .withSourceDBClusterIdentifier("gkdeeipcvhmgoabz") + .withSourceDBInstanceAutomatedBackupsArn("lisujvucnvopgkehpacmkjshk") + .withSourceDBInstanceIdentifier("ypufdzwdqxkygzmrp") + .withSourceDbiResourceId("btzodcuervx") + .withSourceRegion("ez") + .withStorageEncrypted(true) + .withStorageThroughput(16) + .withStorageType("ywcy") + .withTags(Arrays + .asList(new TagAutoGenerated46().withKey("fakeTokenPlaceholder").withValue("rdhflka"))) + .withTdeCredentialArn("fakeTokenPlaceholder") + .withTdeCredentialPassword("fakeTokenPlaceholder") + .withTimezone("euyueykvptytmbnfj") + .withUseDefaultProcessorFeatures(true) + .withUseLatestRestorableTime(true) + .withVpcSecurityGroups(Arrays.asList("nxllphmorxutzaym"))) + .withPublicCloudConnectorsResourceId("etsvehjovtdbgzuwnmgw") + .withAwsAccountId("xjspz") + .withArn("ikxozbmzhxy") + .withPublicCloudResourceName("bvkzujojjsvihxyajddbqxygffaqm") + .withAwsSourceSchema("cjfztsurj") + .withAwsRegion("dmudtaomgrfchc") + .withAwsTags(mapOf("key3142", "fakeTokenPlaceholder"))) + .create(); + } + + // Use "Map.of" if available + @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/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/RdsDbInstancesDeleteSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/RdsDbInstancesDeleteSamples.java new file mode 100644 index 000000000000..977f4c8a0540 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/RdsDbInstancesDeleteSamples.java @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +/** + * Samples for RdsDbInstances Delete. + */ +public final class RdsDbInstancesDeleteSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * RdsDbInstances_Delete.json + */ + /** + * Sample code: RdsDbInstances_Delete. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void rdsDbInstancesDelete(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.rdsDbInstances() + .delete("rgrdsDBInstance", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/RdsDbInstancesGetByResourceGroupSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/RdsDbInstancesGetByResourceGroupSamples.java new file mode 100644 index 000000000000..5fd2d6a750d6 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/RdsDbInstancesGetByResourceGroupSamples.java @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +/** + * Samples for RdsDbInstances GetByResourceGroup. + */ +public final class RdsDbInstancesGetByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/RdsDbInstances_Get. + * json + */ + /** + * Sample code: RdsDbInstances_Get. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void rdsDbInstancesGet(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.rdsDbInstances() + .getByResourceGroupWithResponse("rgrdsDBInstance", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/RdsDbInstancesListByResourceGroupSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/RdsDbInstancesListByResourceGroupSamples.java new file mode 100644 index 000000000000..ad1474eb042d --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/RdsDbInstancesListByResourceGroupSamples.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +/** + * Samples for RdsDbInstances ListByResourceGroup. + */ +public final class RdsDbInstancesListByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * RdsDbInstances_ListByResourceGroup.json + */ + /** + * Sample code: RdsDbInstances_ListByResourceGroup. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + rdsDbInstancesListByResourceGroup(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.rdsDbInstances().listByResourceGroup("rgrdsDBInstance", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/RdsDbInstancesListSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/RdsDbInstancesListSamples.java new file mode 100644 index 000000000000..a250d370346b --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/RdsDbInstancesListSamples.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +/** + * Samples for RdsDbInstances List. + */ +public final class RdsDbInstancesListSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * RdsDbInstances_ListBySubscription.json + */ + /** + * Sample code: RdsDbInstances_ListBySubscription. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + rdsDbInstancesListBySubscription(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.rdsDbInstances().list(com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/RdsDbInstancesUpdateSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/RdsDbInstancesUpdateSamples.java new file mode 100644 index 000000000000..cb34e5dd3644 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/RdsDbInstancesUpdateSamples.java @@ -0,0 +1,45 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +import com.azure.resourcemanager.awsconnector.models.RdsDBInstance; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for RdsDbInstances Update. + */ +public final class RdsDbInstancesUpdateSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * RdsDbInstances_Update.json + */ + /** + * Sample code: RdsDbInstances_Update. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void rdsDbInstancesUpdate(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + RdsDBInstance resource = manager.rdsDbInstances() + .getByResourceGroupWithResponse("rgrdsDBInstance", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE) + .getValue(); + resource.update().withTags(mapOf("key9889", "fakeTokenPlaceholder")).apply(); + } + + // Use "Map.of" if available + @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/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/RdsDbSnapshotAttributesResultsCreateOrReplaceSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/RdsDbSnapshotAttributesResultsCreateOrReplaceSamples.java new file mode 100644 index 000000000000..3bd5417d073b --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/RdsDbSnapshotAttributesResultsCreateOrReplaceSamples.java @@ -0,0 +1,61 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +import com.azure.resourcemanager.awsconnector.models.AwsRdsDBSnapshotAttributesResultProperties; +import com.azure.resourcemanager.awsconnector.models.DBSnapshotAttribute; +import com.azure.resourcemanager.awsconnector.models.RdsDBSnapshotAttributesResultProperties; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for RdsDbSnapshotAttributesResults CreateOrReplace. + */ +public final class RdsDbSnapshotAttributesResultsCreateOrReplaceSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * RdsDbSnapshotAttributesResults_CreateOrReplace.json + */ + /** + * Sample code: RdsDbSnapshotAttributesResults_CreateOrReplace. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void rdsDbSnapshotAttributesResultsCreateOrReplace( + com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.rdsDbSnapshotAttributesResults() + .define("Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])") + .withRegion("luzcqukssqazokzghltlzp") + .withExistingResourceGroup("rgrdsDBSnapshotAttributesResult") + .withTags(mapOf("key3873", "fakeTokenPlaceholder")) + .withProperties(new RdsDBSnapshotAttributesResultProperties() + .withAwsProperties(new AwsRdsDBSnapshotAttributesResultProperties() + .withDbSnapshotAttributes(Arrays.asList(new DBSnapshotAttribute().withAttributeName("yszcujemf") + .withAttributeValues(Arrays.asList("cffn")))) + .withDbSnapshotIdentifier("hgeztauvapideyaajrbafqyup")) + .withPublicCloudConnectorsResourceId("bmzbcvocakxlkqxmewfdruhn") + .withAwsAccountId("za") + .withArn("wctkioaluqun") + .withPublicCloudResourceName("kuhhovfpzvgapi") + .withAwsSourceSchema("w") + .withAwsRegion("ndsijffpilnosnrldocuqrlxitjpv") + .withAwsTags(mapOf("key3566", "fakeTokenPlaceholder"))) + .create(); + } + + // Use "Map.of" if available + @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/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/RdsDbSnapshotAttributesResultsDeleteSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/RdsDbSnapshotAttributesResultsDeleteSamples.java new file mode 100644 index 000000000000..6181bbcf58a5 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/RdsDbSnapshotAttributesResultsDeleteSamples.java @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +/** + * Samples for RdsDbSnapshotAttributesResults Delete. + */ +public final class RdsDbSnapshotAttributesResultsDeleteSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * RdsDbSnapshotAttributesResults_Delete.json + */ + /** + * Sample code: RdsDbSnapshotAttributesResults_Delete. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + rdsDbSnapshotAttributesResultsDelete(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.rdsDbSnapshotAttributesResults() + .delete("rgrdsDBSnapshotAttributesResult", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/RdsDbSnapshotAttributesResultsGetByResourceGroupSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/RdsDbSnapshotAttributesResultsGetByResourceGroupSamples.java new file mode 100644 index 000000000000..7189550ae37f --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/RdsDbSnapshotAttributesResultsGetByResourceGroupSamples.java @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +/** + * Samples for RdsDbSnapshotAttributesResults GetByResourceGroup. + */ +public final class RdsDbSnapshotAttributesResultsGetByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * RdsDbSnapshotAttributesResults_Get.json + */ + /** + * Sample code: RdsDbSnapshotAttributesResults_Get. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + rdsDbSnapshotAttributesResultsGet(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.rdsDbSnapshotAttributesResults() + .getByResourceGroupWithResponse("rgrdsDBSnapshotAttributesResult", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/RdsDbSnapshotAttributesResultsListByResourceGroupSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/RdsDbSnapshotAttributesResultsListByResourceGroupSamples.java new file mode 100644 index 000000000000..a38e52cb6836 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/RdsDbSnapshotAttributesResultsListByResourceGroupSamples.java @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +/** + * Samples for RdsDbSnapshotAttributesResults ListByResourceGroup. + */ +public final class RdsDbSnapshotAttributesResultsListByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * RdsDbSnapshotAttributesResults_ListByResourceGroup.json + */ + /** + * Sample code: RdsDbSnapshotAttributesResults_ListByResourceGroup. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void rdsDbSnapshotAttributesResultsListByResourceGroup( + com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.rdsDbSnapshotAttributesResults() + .listByResourceGroup("rgrdsDBSnapshotAttributesResult", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/RdsDbSnapshotAttributesResultsListSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/RdsDbSnapshotAttributesResultsListSamples.java new file mode 100644 index 000000000000..2da9cf45c1a2 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/RdsDbSnapshotAttributesResultsListSamples.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +/** + * Samples for RdsDbSnapshotAttributesResults List. + */ +public final class RdsDbSnapshotAttributesResultsListSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * RdsDbSnapshotAttributesResults_ListBySubscription.json + */ + /** + * Sample code: RdsDbSnapshotAttributesResults_ListBySubscription. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void rdsDbSnapshotAttributesResultsListBySubscription( + com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.rdsDbSnapshotAttributesResults().list(com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/RdsDbSnapshotAttributesResultsUpdateSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/RdsDbSnapshotAttributesResultsUpdateSamples.java new file mode 100644 index 000000000000..bdfee00a390c --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/RdsDbSnapshotAttributesResultsUpdateSamples.java @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +import com.azure.resourcemanager.awsconnector.models.RdsDBSnapshotAttributesResult; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for RdsDbSnapshotAttributesResults Update. + */ +public final class RdsDbSnapshotAttributesResultsUpdateSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * RdsDbSnapshotAttributesResults_Update.json + */ + /** + * Sample code: RdsDbSnapshotAttributesResults_Update. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + rdsDbSnapshotAttributesResultsUpdate(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + RdsDBSnapshotAttributesResult resource = manager.rdsDbSnapshotAttributesResults() + .getByResourceGroupWithResponse("rgrdsDBSnapshotAttributesResult", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE) + .getValue(); + resource.update().withTags(mapOf("key7927", "fakeTokenPlaceholder")).apply(); + } + + // Use "Map.of" if available + @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/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/RdsDbSnapshotsCreateOrReplaceSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/RdsDbSnapshotsCreateOrReplaceSamples.java new file mode 100644 index 000000000000..67e6b59d868e --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/RdsDbSnapshotsCreateOrReplaceSamples.java @@ -0,0 +1,97 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +import com.azure.resourcemanager.awsconnector.models.AwsRdsDBSnapshotProperties; +import com.azure.resourcemanager.awsconnector.models.ProcessorFeatureAutoGenerated; +import com.azure.resourcemanager.awsconnector.models.RdsDBSnapshotProperties; +import com.azure.resourcemanager.awsconnector.models.TagAutoGenerated47; +import java.time.OffsetDateTime; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for RdsDbSnapshots CreateOrReplace. + */ +public final class RdsDbSnapshotsCreateOrReplaceSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * RdsDbSnapshots_CreateOrReplace.json + */ + /** + * Sample code: RdsDbSnapshots_CreateOrReplace. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + rdsDbSnapshotsCreateOrReplace(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.rdsDbSnapshots() + .define("Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])") + .withRegion("ojgfpymabvdpgvknjfvaecf") + .withExistingResourceGroup("rgrdsDBSnapshot") + .withTags(mapOf("key752", "fakeTokenPlaceholder")) + .withProperties(new RdsDBSnapshotProperties() + .withAwsProperties(new AwsRdsDBSnapshotProperties().withAllocatedStorage(10) + .withAvailabilityZone("kayjlaciv") + .withDbInstanceIdentifier("sgszwrakxshyzice") + .withDbSnapshotArn("xdjclnyyjohzhbe") + .withDbSnapshotIdentifier("yeju") + .withDbSystemId("fzavlejrrugjcdxaetdvvhg") + .withDbiResourceId("jwxsvn") + .withDedicatedLogVolume(true) + .withEncrypted(true) + .withEngine("xkjeovmjwpoycteiloodhzsyly") + .withEngineVersion("ycrrezzqweeassrgalnqmcuhnk") + .withIamDatabaseAuthenticationEnabled(true) + .withInstanceCreateTime(OffsetDateTime.parse("2024-10-08T03:49:38.588Z")) + .withIops(7) + .withKmsKeyId("fakeTokenPlaceholder") + .withLicenseModel("wbcqlk") + .withMasterUsername("ahyhxkpctusl") + .withMultiTenant(true) + .withOptionGroupName("zxrglvxvd") + .withOriginalSnapshotCreateTime(OffsetDateTime.parse("2024-10-08T03:49:38.589Z")) + .withPercentProgress(19) + .withPort(11) + .withProcessorFeatures(Arrays.asList(new ProcessorFeatureAutoGenerated().withName("sidrqdpoqaeon") + .withValue("elyxiifmhltlaxelehotutvcfcmqii"))) + .withSnapshotCreateTime(OffsetDateTime.parse("2024-10-08T03:49:38.589Z")) + .withSnapshotDatabaseTime(OffsetDateTime.parse("2024-10-08T03:49:38.589Z")) + .withSnapshotTarget("uvkzzwcpvrfjw") + .withSnapshotType("iiydwpezfwmejabymfqpelcifgzng") + .withSourceDBSnapshotIdentifier("awxakkqcvryuhqdbunoz") + .withSourceRegion("vrldyuopcfabthhgxvpnybgtfdi") + .withStatus("mwktzwjlfzywwkgrjhl") + .withStorageThroughput(1) + .withStorageType("i") + .withTagList( + Arrays.asList(new TagAutoGenerated47().withKey("fakeTokenPlaceholder").withValue("gbyocywzau"))) + .withTdeCredentialArn("fakeTokenPlaceholder") + .withTimezone("coraguclwgryiiynjhpes") + .withVpcId("fpweamshtdzkrbhcqenn")) + .withPublicCloudConnectorsResourceId("ptkmloddhzkiphtdnmdhlx") + .withAwsAccountId("gimhekqewbnatvrjiewxszwd") + .withArn("nqbzizmcdbvsukdqhrdcg") + .withPublicCloudResourceName("uoecdcxuxiu") + .withAwsSourceSchema("sfaw") + .withAwsRegion("qk") + .withAwsTags(mapOf("key7020", "fakeTokenPlaceholder"))) + .create(); + } + + // Use "Map.of" if available + @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/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/RdsDbSnapshotsDeleteSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/RdsDbSnapshotsDeleteSamples.java new file mode 100644 index 000000000000..be833de91e89 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/RdsDbSnapshotsDeleteSamples.java @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +/** + * Samples for RdsDbSnapshots Delete. + */ +public final class RdsDbSnapshotsDeleteSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * RdsDbSnapshots_Delete.json + */ + /** + * Sample code: RdsDbSnapshots_Delete. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void rdsDbSnapshotsDelete(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.rdsDbSnapshots() + .delete("rgrdsDBSnapshot", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/RdsDbSnapshotsGetByResourceGroupSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/RdsDbSnapshotsGetByResourceGroupSamples.java new file mode 100644 index 000000000000..05486f5930f0 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/RdsDbSnapshotsGetByResourceGroupSamples.java @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +/** + * Samples for RdsDbSnapshots GetByResourceGroup. + */ +public final class RdsDbSnapshotsGetByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/RdsDbSnapshots_Get. + * json + */ + /** + * Sample code: RdsDbSnapshots_Get. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void rdsDbSnapshotsGet(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.rdsDbSnapshots() + .getByResourceGroupWithResponse("rgrdsDBSnapshot", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/RdsDbSnapshotsListByResourceGroupSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/RdsDbSnapshotsListByResourceGroupSamples.java new file mode 100644 index 000000000000..ae6e3a28f4c8 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/RdsDbSnapshotsListByResourceGroupSamples.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +/** + * Samples for RdsDbSnapshots ListByResourceGroup. + */ +public final class RdsDbSnapshotsListByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * RdsDbSnapshots_ListByResourceGroup.json + */ + /** + * Sample code: RdsDbSnapshots_ListByResourceGroup. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + rdsDbSnapshotsListByResourceGroup(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.rdsDbSnapshots().listByResourceGroup("rgrdsDBSnapshot", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/RdsDbSnapshotsListSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/RdsDbSnapshotsListSamples.java new file mode 100644 index 000000000000..943b972604d4 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/RdsDbSnapshotsListSamples.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +/** + * Samples for RdsDbSnapshots List. + */ +public final class RdsDbSnapshotsListSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * RdsDbSnapshots_ListBySubscription.json + */ + /** + * Sample code: RdsDbSnapshots_ListBySubscription. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + rdsDbSnapshotsListBySubscription(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.rdsDbSnapshots().list(com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/RdsDbSnapshotsUpdateSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/RdsDbSnapshotsUpdateSamples.java new file mode 100644 index 000000000000..8b0ee2fb95be --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/RdsDbSnapshotsUpdateSamples.java @@ -0,0 +1,45 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +import com.azure.resourcemanager.awsconnector.models.RdsDBSnapshot; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for RdsDbSnapshots Update. + */ +public final class RdsDbSnapshotsUpdateSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * RdsDbSnapshots_Update.json + */ + /** + * Sample code: RdsDbSnapshots_Update. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void rdsDbSnapshotsUpdate(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + RdsDBSnapshot resource = manager.rdsDbSnapshots() + .getByResourceGroupWithResponse("rgrdsDBSnapshot", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE) + .getValue(); + resource.update().withTags(mapOf("key4303", "fakeTokenPlaceholder")).apply(); + } + + // Use "Map.of" if available + @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/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/RdsEventSubscriptionsCreateOrReplaceSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/RdsEventSubscriptionsCreateOrReplaceSamples.java new file mode 100644 index 000000000000..12a0a9c077cf --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/RdsEventSubscriptionsCreateOrReplaceSamples.java @@ -0,0 +1,66 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +import com.azure.resourcemanager.awsconnector.models.AwsRdsEventSubscriptionProperties; +import com.azure.resourcemanager.awsconnector.models.RdsEventSubscriptionProperties; +import com.azure.resourcemanager.awsconnector.models.TagAutoGenerated48; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for RdsEventSubscriptions CreateOrReplace. + */ +public final class RdsEventSubscriptionsCreateOrReplaceSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * RdsEventSubscriptions_CreateOrReplace.json + */ + /** + * Sample code: RdsEventSubscriptions_CreateOrReplace. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + rdsEventSubscriptionsCreateOrReplace(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.rdsEventSubscriptions() + .define("Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])") + .withRegion("zw") + .withExistingResourceGroup("rgrdsEventSubscription") + .withTags(mapOf("key9661", "fakeTokenPlaceholder")) + .withProperties( + new RdsEventSubscriptionProperties() + .withAwsProperties(new AwsRdsEventSubscriptionProperties().withEnabled(true) + .withEventCategories(Arrays.asList("lvuizykyfm")) + .withSnsTopicArn("bztzoygofaokcwvheylcjtyhzumi") + .withSourceIds(Arrays.asList("yhyohxasdyzulieniumz")) + .withSourceType("tvb") + .withSubscriptionName("we") + .withTags(Arrays.asList( + new TagAutoGenerated48().withKey("fakeTokenPlaceholder").withValue("mfwztutpnzzxe")))) + .withPublicCloudConnectorsResourceId("iyeipvkxsknmro") + .withAwsAccountId("zfsrgkfzsvgfonnvm") + .withArn("thfrxqrzoqkdimx") + .withPublicCloudResourceName("shpjwd") + .withAwsSourceSchema("ymnxhmzxhihjztmgswvngnhiuzw") + .withAwsRegion("sxpprlqqhjuob") + .withAwsTags(mapOf("key3613", "fakeTokenPlaceholder"))) + .create(); + } + + // Use "Map.of" if available + @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/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/RdsEventSubscriptionsDeleteSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/RdsEventSubscriptionsDeleteSamples.java new file mode 100644 index 000000000000..eb18883c7a59 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/RdsEventSubscriptionsDeleteSamples.java @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +/** + * Samples for RdsEventSubscriptions Delete. + */ +public final class RdsEventSubscriptionsDeleteSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * RdsEventSubscriptions_Delete.json + */ + /** + * Sample code: RdsEventSubscriptions_Delete. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void rdsEventSubscriptionsDelete(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.rdsEventSubscriptions() + .delete("rgrdsEventSubscription", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/RdsEventSubscriptionsGetByResourceGroupSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/RdsEventSubscriptionsGetByResourceGroupSamples.java new file mode 100644 index 000000000000..8396595364d7 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/RdsEventSubscriptionsGetByResourceGroupSamples.java @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +/** + * Samples for RdsEventSubscriptions GetByResourceGroup. + */ +public final class RdsEventSubscriptionsGetByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * RdsEventSubscriptions_Get.json + */ + /** + * Sample code: RdsEventSubscriptions_Get. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void rdsEventSubscriptionsGet(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.rdsEventSubscriptions() + .getByResourceGroupWithResponse("rgrdsEventSubscription", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/RdsEventSubscriptionsListByResourceGroupSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/RdsEventSubscriptionsListByResourceGroupSamples.java new file mode 100644 index 000000000000..87e4be2296a7 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/RdsEventSubscriptionsListByResourceGroupSamples.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +/** + * Samples for RdsEventSubscriptions ListByResourceGroup. + */ +public final class RdsEventSubscriptionsListByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * RdsEventSubscriptions_ListByResourceGroup.json + */ + /** + * Sample code: RdsEventSubscriptions_ListByResourceGroup. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + rdsEventSubscriptionsListByResourceGroup(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.rdsEventSubscriptions().listByResourceGroup("rgrdsEventSubscription", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/RdsEventSubscriptionsListSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/RdsEventSubscriptionsListSamples.java new file mode 100644 index 000000000000..deb37f2e38c0 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/RdsEventSubscriptionsListSamples.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +/** + * Samples for RdsEventSubscriptions List. + */ +public final class RdsEventSubscriptionsListSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * RdsEventSubscriptions_ListBySubscription.json + */ + /** + * Sample code: RdsEventSubscriptions_ListBySubscription. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + rdsEventSubscriptionsListBySubscription(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.rdsEventSubscriptions().list(com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/RdsEventSubscriptionsUpdateSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/RdsEventSubscriptionsUpdateSamples.java new file mode 100644 index 000000000000..0eda754d98ef --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/RdsEventSubscriptionsUpdateSamples.java @@ -0,0 +1,45 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +import com.azure.resourcemanager.awsconnector.models.RdsEventSubscription; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for RdsEventSubscriptions Update. + */ +public final class RdsEventSubscriptionsUpdateSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * RdsEventSubscriptions_Update.json + */ + /** + * Sample code: RdsEventSubscriptions_Update. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void rdsEventSubscriptionsUpdate(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + RdsEventSubscription resource = manager.rdsEventSubscriptions() + .getByResourceGroupWithResponse("rgrdsEventSubscription", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE) + .getValue(); + resource.update().withTags(mapOf("key3694", "fakeTokenPlaceholder")).apply(); + } + + // Use "Map.of" if available + @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/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/RdsExportTasksCreateOrReplaceSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/RdsExportTasksCreateOrReplaceSamples.java new file mode 100644 index 000000000000..c268a86b7308 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/RdsExportTasksCreateOrReplaceSamples.java @@ -0,0 +1,76 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +import com.azure.resourcemanager.awsconnector.models.AwsRdsExportTaskProperties; +import com.azure.resourcemanager.awsconnector.models.ExportSourceType; +import com.azure.resourcemanager.awsconnector.models.ExportSourceTypeEnumValue; +import com.azure.resourcemanager.awsconnector.models.RdsExportTaskProperties; +import java.time.OffsetDateTime; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for RdsExportTasks CreateOrReplace. + */ +public final class RdsExportTasksCreateOrReplaceSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * RdsExportTasks_CreateOrReplace.json + */ + /** + * Sample code: RdsExportTasks_CreateOrReplace. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + rdsExportTasksCreateOrReplace(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.rdsExportTasks() + .define("Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])") + .withRegion("ijwmlpipjiyjjldyoytyluf") + .withExistingResourceGroup("rgrdsExportTask") + .withTags(mapOf("key6517", "fakeTokenPlaceholder")) + .withProperties(new RdsExportTaskProperties() + .withAwsProperties( + new AwsRdsExportTaskProperties().withExportOnly(Arrays.asList("tgbwsfhgnayugsqipjaogglzrm")) + .withExportTaskIdentifier("miwmgyeweeibkjbwagqc") + .withFailureCause("mnjjuzhtylheweav") + .withIamRoleArn("fexryvrii") + .withKmsKeyId("fakeTokenPlaceholder") + .withPercentProgress(5) + .withS3Bucket("zwwzvtjvoadrnmvvidwl") + .withS3Prefix("vgo") + .withSnapshotTime(OffsetDateTime.parse("2024-10-08T03:51:37.230Z")) + .withSourceArn("mojassuswxqincuqhoonftpslnqh") + .withSourceType(new ExportSourceTypeEnumValue().withValue(ExportSourceType.CLUSTER)) + .withStatus("cjaqynzkqtyptrbwud") + .withTaskEndTime(OffsetDateTime.parse("2024-10-08T03:51:37.231Z")) + .withTaskStartTime(OffsetDateTime.parse("2024-10-08T03:51:37.231Z")) + .withTotalExtractedDataInGB(7) + .withWarningMessage("hugvgitctxgsxkvywhlldbqe")) + .withPublicCloudConnectorsResourceId("xugphqsqnlgtlne") + .withAwsAccountId("oaxdvv") + .withArn("baufqssokdhluztwcuatl") + .withPublicCloudResourceName("exprhkzxutckvlwxawcqfy") + .withAwsSourceSchema("eopblwzcihujlmoctzvwfoirhqkbx") + .withAwsRegion("bnpl") + .withAwsTags(mapOf("key353", "fakeTokenPlaceholder"))) + .create(); + } + + // Use "Map.of" if available + @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/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/RdsExportTasksDeleteSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/RdsExportTasksDeleteSamples.java new file mode 100644 index 000000000000..150abbb25613 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/RdsExportTasksDeleteSamples.java @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +/** + * Samples for RdsExportTasks Delete. + */ +public final class RdsExportTasksDeleteSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * RdsExportTasks_Delete.json + */ + /** + * Sample code: RdsExportTasks_Delete. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void rdsExportTasksDelete(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.rdsExportTasks() + .delete("rgrdsExportTask", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/RdsExportTasksGetByResourceGroupSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/RdsExportTasksGetByResourceGroupSamples.java new file mode 100644 index 000000000000..cef0a9972334 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/RdsExportTasksGetByResourceGroupSamples.java @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +/** + * Samples for RdsExportTasks GetByResourceGroup. + */ +public final class RdsExportTasksGetByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/RdsExportTasks_Get. + * json + */ + /** + * Sample code: RdsExportTasks_Get. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void rdsExportTasksGet(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.rdsExportTasks() + .getByResourceGroupWithResponse("rgrdsExportTask", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/RdsExportTasksListByResourceGroupSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/RdsExportTasksListByResourceGroupSamples.java new file mode 100644 index 000000000000..88451eda724d --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/RdsExportTasksListByResourceGroupSamples.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +/** + * Samples for RdsExportTasks ListByResourceGroup. + */ +public final class RdsExportTasksListByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * RdsExportTasks_ListByResourceGroup.json + */ + /** + * Sample code: RdsExportTasks_ListByResourceGroup. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + rdsExportTasksListByResourceGroup(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.rdsExportTasks().listByResourceGroup("rgrdsExportTask", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/RdsExportTasksListSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/RdsExportTasksListSamples.java new file mode 100644 index 000000000000..029dad37c580 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/RdsExportTasksListSamples.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +/** + * Samples for RdsExportTasks List. + */ +public final class RdsExportTasksListSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * RdsExportTasks_ListBySubscription.json + */ + /** + * Sample code: RdsExportTasks_ListBySubscription. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + rdsExportTasksListBySubscription(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.rdsExportTasks().list(com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/RdsExportTasksUpdateSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/RdsExportTasksUpdateSamples.java new file mode 100644 index 000000000000..b3077a5489ee --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/RdsExportTasksUpdateSamples.java @@ -0,0 +1,45 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +import com.azure.resourcemanager.awsconnector.models.RdsExportTask; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for RdsExportTasks Update. + */ +public final class RdsExportTasksUpdateSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * RdsExportTasks_Update.json + */ + /** + * Sample code: RdsExportTasks_Update. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void rdsExportTasksUpdate(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + RdsExportTask resource = manager.rdsExportTasks() + .getByResourceGroupWithResponse("rgrdsExportTask", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE) + .getValue(); + resource.update().withTags(mapOf("key8327", "fakeTokenPlaceholder")).apply(); + } + + // Use "Map.of" if available + @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/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/RedshiftClusterParameterGroupsCreateOrReplaceSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/RedshiftClusterParameterGroupsCreateOrReplaceSamples.java new file mode 100644 index 000000000000..9e35fc86af16 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/RedshiftClusterParameterGroupsCreateOrReplaceSamples.java @@ -0,0 +1,65 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +import com.azure.resourcemanager.awsconnector.models.AwsRedshiftClusterParameterGroupProperties; +import com.azure.resourcemanager.awsconnector.models.ParameterAutoGenerated; +import com.azure.resourcemanager.awsconnector.models.RedshiftClusterParameterGroupProperties; +import com.azure.resourcemanager.awsconnector.models.TagAutoGenerated49; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for RedshiftClusterParameterGroups CreateOrReplace. + */ +public final class RedshiftClusterParameterGroupsCreateOrReplaceSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * RedshiftClusterParameterGroups_CreateOrReplace.json + */ + /** + * Sample code: RedshiftClusterParameterGroups_CreateOrReplace. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void redshiftClusterParameterGroupsCreateOrReplace( + com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.redshiftClusterParameterGroups() + .define("Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])") + .withRegion("gskgxjliwptm") + .withExistingResourceGroup("rgredshiftClusterParameterGroup") + .withTags(mapOf("key4322", "fakeTokenPlaceholder")) + .withProperties(new RedshiftClusterParameterGroupProperties() + .withAwsProperties(new AwsRedshiftClusterParameterGroupProperties().withDescription("gvl") + .withParameterGroupFamily("bbhnqerzrhqtinntphvuim") + .withParameterGroupName("tiqxhqigpmuckmnpgijvnpwzb") + .withParameters(Arrays.asList(new ParameterAutoGenerated().withParameterName("jxeucnajvjzv") + .withParameterValue("ubxmwmoxeslbruenu"))) + .withTags( + Arrays.asList(new TagAutoGenerated49().withKey("fakeTokenPlaceholder").withValue("qpznlj")))) + .withPublicCloudConnectorsResourceId("nrs") + .withAwsAccountId("fdljzalgig") + .withArn("whliokkrefhwytv") + .withPublicCloudResourceName("xnrwtxesebdfzrqiamebczhoyjbqeq") + .withAwsSourceSchema("nkdbqnqvsdnvogwatfxlubppr") + .withAwsRegion("wrhyhrmwhdmlnjjbrl") + .withAwsTags(mapOf("key6090", "fakeTokenPlaceholder"))) + .create(); + } + + // Use "Map.of" if available + @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/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/RedshiftClusterParameterGroupsDeleteSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/RedshiftClusterParameterGroupsDeleteSamples.java new file mode 100644 index 000000000000..efa7fb9e9e28 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/RedshiftClusterParameterGroupsDeleteSamples.java @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +/** + * Samples for RedshiftClusterParameterGroups Delete. + */ +public final class RedshiftClusterParameterGroupsDeleteSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * RedshiftClusterParameterGroups_Delete.json + */ + /** + * Sample code: RedshiftClusterParameterGroups_Delete. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + redshiftClusterParameterGroupsDelete(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.redshiftClusterParameterGroups() + .delete("rgredshiftClusterParameterGroup", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/RedshiftClusterParameterGroupsGetByResourceGroupSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/RedshiftClusterParameterGroupsGetByResourceGroupSamples.java new file mode 100644 index 000000000000..ff9079ac1acc --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/RedshiftClusterParameterGroupsGetByResourceGroupSamples.java @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +/** + * Samples for RedshiftClusterParameterGroups GetByResourceGroup. + */ +public final class RedshiftClusterParameterGroupsGetByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * RedshiftClusterParameterGroups_Get.json + */ + /** + * Sample code: RedshiftClusterParameterGroups_Get. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + redshiftClusterParameterGroupsGet(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.redshiftClusterParameterGroups() + .getByResourceGroupWithResponse("rgredshiftClusterParameterGroup", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/RedshiftClusterParameterGroupsListByResourceGroupSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/RedshiftClusterParameterGroupsListByResourceGroupSamples.java new file mode 100644 index 000000000000..858840f0ffd7 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/RedshiftClusterParameterGroupsListByResourceGroupSamples.java @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +/** + * Samples for RedshiftClusterParameterGroups ListByResourceGroup. + */ +public final class RedshiftClusterParameterGroupsListByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * RedshiftClusterParameterGroups_ListByResourceGroup.json + */ + /** + * Sample code: RedshiftClusterParameterGroups_ListByResourceGroup. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void redshiftClusterParameterGroupsListByResourceGroup( + com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.redshiftClusterParameterGroups() + .listByResourceGroup("rgredshiftClusterParameterGroup", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/RedshiftClusterParameterGroupsListSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/RedshiftClusterParameterGroupsListSamples.java new file mode 100644 index 000000000000..ebbd8a8d47dc --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/RedshiftClusterParameterGroupsListSamples.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +/** + * Samples for RedshiftClusterParameterGroups List. + */ +public final class RedshiftClusterParameterGroupsListSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * RedshiftClusterParameterGroups_ListBySubscription.json + */ + /** + * Sample code: RedshiftClusterParameterGroups_ListBySubscription. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void redshiftClusterParameterGroupsListBySubscription( + com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.redshiftClusterParameterGroups().list(com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/RedshiftClusterParameterGroupsUpdateSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/RedshiftClusterParameterGroupsUpdateSamples.java new file mode 100644 index 000000000000..3305ced4571e --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/RedshiftClusterParameterGroupsUpdateSamples.java @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +import com.azure.resourcemanager.awsconnector.models.RedshiftClusterParameterGroup; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for RedshiftClusterParameterGroups Update. + */ +public final class RedshiftClusterParameterGroupsUpdateSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * RedshiftClusterParameterGroups_Update.json + */ + /** + * Sample code: RedshiftClusterParameterGroups_Update. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + redshiftClusterParameterGroupsUpdate(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + RedshiftClusterParameterGroup resource = manager.redshiftClusterParameterGroups() + .getByResourceGroupWithResponse("rgredshiftClusterParameterGroup", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE) + .getValue(); + resource.update().withTags(mapOf("key900", "fakeTokenPlaceholder")).apply(); + } + + // Use "Map.of" if available + @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/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/RedshiftClustersCreateOrReplaceSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/RedshiftClustersCreateOrReplaceSamples.java new file mode 100644 index 000000000000..f3bf90842a18 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/RedshiftClustersCreateOrReplaceSamples.java @@ -0,0 +1,117 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +import com.azure.resourcemanager.awsconnector.models.AwsRedshiftClusterProperties; +import com.azure.resourcemanager.awsconnector.models.EndpointAutoGenerated3; +import com.azure.resourcemanager.awsconnector.models.LoggingProperties; +import com.azure.resourcemanager.awsconnector.models.RedshiftClusterProperties; +import com.azure.resourcemanager.awsconnector.models.Tag; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for RedshiftClusters CreateOrReplace. + */ +public final class RedshiftClustersCreateOrReplaceSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * RedshiftClusters_CreateOrReplace.json + */ + /** + * Sample code: RedshiftClusters_CreateOrReplace. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + redshiftClustersCreateOrReplace(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.redshiftClusters() + .define("Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])") + .withRegion("jvkejlkfwoynldopbqhnt") + .withExistingResourceGroup("rgredshiftCluster") + .withTags(mapOf("key5296", "fakeTokenPlaceholder")) + .withProperties( + new RedshiftClusterProperties() + .withAwsProperties(new AwsRedshiftClusterProperties().withAllowVersionUpgrade(true) + .withAquaConfigurationStatus("tegpcduavwdyuubx") + .withAutomatedSnapshotRetentionPeriod(25) + .withAvailabilityZone("pltpsjmmvhfmsecqjjweuxgloitbor") + .withAvailabilityZoneRelocation(true) + .withAvailabilityZoneRelocationStatus("kcuxuluzsnuoag") + .withClassic(true) + .withClusterIdentifier("cxlflpabmavbfbcvsew") + .withClusterNamespaceArn("vqeqeacmkdhmzgwd") + .withClusterParameterGroupName("whpcckoms") + .withClusterSecurityGroups(Arrays.asList("q")) + .withClusterSubnetGroupName("abxmcpkzazgxtuoliedvam") + .withClusterType("nvbzlybkkhuyklhhywuofwczf") + .withClusterVersion("slmurdmhpiuakdwrqdthvlrpovqb") + .withDbName("jsbtuqgydkydraogl") + .withDeferMaintenance(true) + .withDeferMaintenanceDuration(14) + .withDeferMaintenanceEndTime("oluxv") + .withDeferMaintenanceIdentifier("icu") + .withDeferMaintenanceStartTime("muevcssxlqrrmwxvazpsrq") + .withDestinationRegion("cnklawqwbweklmlrhr") + .withElasticIp("ljpfzxzciavjuxk") + .withEncrypted(true) + .withEndpoint( + new EndpointAutoGenerated3().withAddress("imgtktlniedocmgatpyzycge").withPort("gm")) + .withEnhancedVpcRouting(true) + .withHsmClientCertificateIdentifier("uguhqzduujaf") + .withHsmConfigurationIdentifier("cznipmuxibdjvmteim") + .withIamRoles(Arrays.asList("qmy")) + .withKmsKeyId("fakeTokenPlaceholder") + .withLoggingProperties(new LoggingProperties().withBucketName("mozpscmusdfzk") + .withS3KeyPrefix("fakeTokenPlaceholder")) + .withMaintenanceTrackName("etjeimmqcipuyxiobrnsnd") + .withManageMasterPassword(true) + .withManualSnapshotRetentionPeriod(15) + .withMasterPasswordSecretArn("fakeTokenPlaceholder") + .withMasterPasswordSecretKmsKeyId("fakeTokenPlaceholder") + .withMasterUserPassword("fakeTokenPlaceholder") + .withMasterUsername("wleeglygnhojusagxryuk") + .withMultiAZ(true) + .withNodeType("cudgc") + .withNumberOfNodes(23) + .withOwnerAccount("drvv") + .withPort(8) + .withPreferredMaintenanceWindow("xpuhqwidzbn") + .withPubliclyAccessible(true) + .withResourceAction("nyhkwgrtf") + .withRevisionTarget("dreawjciiytkiuywtwttqyhojh") + .withRotateEncryptionKey(true) + .withSnapshotClusterIdentifier("gu") + .withSnapshotCopyGrantName("mwuomnttvwhduluhwnfkiwkaeztbmd") + .withSnapshotCopyManual(true) + .withSnapshotCopyRetentionPeriod(2) + .withSnapshotIdentifier("viproibmlhehvlszhxkqbbgl") + .withTags( + Arrays.asList(new Tag().withKey("fakeTokenPlaceholder").withValue("zawcpsgqfgrsjexrbo"))) + .withVpcSecurityGroupIds(Arrays.asList("grbkothiifmuwwrme"))) + .withPublicCloudConnectorsResourceId("r") + .withAwsAccountId("lnlhkk") + .withArn("egooffvtlbzyvp") + .withPublicCloudResourceName("ck") + .withAwsSourceSchema("zdadxraykcjparteiye") + .withAwsRegion("lablaxpspbxzhnbsrqz") + .withAwsTags(mapOf("key9665", "fakeTokenPlaceholder"))) + .create(); + } + + // Use "Map.of" if available + @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/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/RedshiftClustersDeleteSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/RedshiftClustersDeleteSamples.java new file mode 100644 index 000000000000..59e8eb1b65b7 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/RedshiftClustersDeleteSamples.java @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +/** + * Samples for RedshiftClusters Delete. + */ +public final class RedshiftClustersDeleteSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * RedshiftClusters_Delete.json + */ + /** + * Sample code: RedshiftClusters_Delete. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void redshiftClustersDelete(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.redshiftClusters() + .delete("rgredshiftCluster", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/RedshiftClustersGetByResourceGroupSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/RedshiftClustersGetByResourceGroupSamples.java new file mode 100644 index 000000000000..e3caac185ccc --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/RedshiftClustersGetByResourceGroupSamples.java @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +/** + * Samples for RedshiftClusters GetByResourceGroup. + */ +public final class RedshiftClustersGetByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * RedshiftClusters_Get.json + */ + /** + * Sample code: RedshiftClusters_Get. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void redshiftClustersGet(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.redshiftClusters() + .getByResourceGroupWithResponse("rgredshiftCluster", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/RedshiftClustersListByResourceGroupSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/RedshiftClustersListByResourceGroupSamples.java new file mode 100644 index 000000000000..475a84b068ec --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/RedshiftClustersListByResourceGroupSamples.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +/** + * Samples for RedshiftClusters ListByResourceGroup. + */ +public final class RedshiftClustersListByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * RedshiftClusters_ListByResourceGroup.json + */ + /** + * Sample code: RedshiftClusters_ListByResourceGroup. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + redshiftClustersListByResourceGroup(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.redshiftClusters().listByResourceGroup("rgredshiftCluster", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/RedshiftClustersListSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/RedshiftClustersListSamples.java new file mode 100644 index 000000000000..fced74d079cb --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/RedshiftClustersListSamples.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +/** + * Samples for RedshiftClusters List. + */ +public final class RedshiftClustersListSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * RedshiftClusters_ListBySubscription.json + */ + /** + * Sample code: RedshiftClusters_ListBySubscription. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + redshiftClustersListBySubscription(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.redshiftClusters().list(com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/RedshiftClustersUpdateSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/RedshiftClustersUpdateSamples.java new file mode 100644 index 000000000000..f9d51fa7f918 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/RedshiftClustersUpdateSamples.java @@ -0,0 +1,45 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +import com.azure.resourcemanager.awsconnector.models.RedshiftCluster; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for RedshiftClusters Update. + */ +public final class RedshiftClustersUpdateSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * RedshiftClusters_Update.json + */ + /** + * Sample code: RedshiftClusters_Update. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void redshiftClustersUpdate(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + RedshiftCluster resource = manager.redshiftClusters() + .getByResourceGroupWithResponse("rgredshiftCluster", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE) + .getValue(); + resource.update().withTags(mapOf("key9218", "fakeTokenPlaceholder")).apply(); + } + + // Use "Map.of" if available + @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/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/Route53DomainsDomainSummariesCreateOrReplaceSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/Route53DomainsDomainSummariesCreateOrReplaceSamples.java new file mode 100644 index 000000000000..ce01b576d210 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/Route53DomainsDomainSummariesCreateOrReplaceSamples.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.awsconnector.generated; + +import com.azure.resourcemanager.awsconnector.models.AwsRoute53DomainsDomainSummaryProperties; +import com.azure.resourcemanager.awsconnector.models.Route53DomainsDomainSummaryProperties; +import java.time.OffsetDateTime; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for Route53DomainsDomainSummaries CreateOrReplace. + */ +public final class Route53DomainsDomainSummariesCreateOrReplaceSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * Route53DomainsDomainSummaries_CreateOrReplace.json + */ + /** + * Sample code: Route53DomainsDomainSummaries_CreateOrReplace. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void route53DomainsDomainSummariesCreateOrReplace( + com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.route53DomainsDomainSummaries() + .define("Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])") + .withRegion("yuzdde") + .withExistingResourceGroup("rgroute53DomainsDomainSummary") + .withTags(mapOf("key9394", "fakeTokenPlaceholder")) + .withProperties(new Route53DomainsDomainSummaryProperties() + .withAwsProperties(new AwsRoute53DomainsDomainSummaryProperties().withAutoRenew(true) + .withDomainName("zvofrrcpsq") + .withExpiry(OffsetDateTime.parse("2024-10-08T03:54:06.143Z")) + .withTransferLock(true)) + .withPublicCloudConnectorsResourceId("xghzjqidhyawkmjgmcylp") + .withAwsAccountId("vcuytljgzjlxqbqafyjyotrm") + .withArn("wrwdlajgtnvqtehqwjewdams") + .withPublicCloudResourceName("l") + .withAwsSourceSchema("tmisqqzyhunvwrvagqsndin") + .withAwsRegion("kfqnxegwwlydcxbrps") + .withAwsTags(mapOf("key3432", "fakeTokenPlaceholder"))) + .create(); + } + + // Use "Map.of" if available + @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/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/Route53DomainsDomainSummariesDeleteSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/Route53DomainsDomainSummariesDeleteSamples.java new file mode 100644 index 000000000000..0245f4e8f1b8 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/Route53DomainsDomainSummariesDeleteSamples.java @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +/** + * Samples for Route53DomainsDomainSummaries Delete. + */ +public final class Route53DomainsDomainSummariesDeleteSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * Route53DomainsDomainSummaries_Delete.json + */ + /** + * Sample code: Route53DomainsDomainSummaries_Delete. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + route53DomainsDomainSummariesDelete(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.route53DomainsDomainSummaries() + .delete("rgroute53DomainsDomainSummary", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/Route53DomainsDomainSummariesGetByResourceGroupSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/Route53DomainsDomainSummariesGetByResourceGroupSamples.java new file mode 100644 index 000000000000..b995b3a92a75 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/Route53DomainsDomainSummariesGetByResourceGroupSamples.java @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +/** + * Samples for Route53DomainsDomainSummaries GetByResourceGroup. + */ +public final class Route53DomainsDomainSummariesGetByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * Route53DomainsDomainSummaries_Get.json + */ + /** + * Sample code: Route53DomainsDomainSummaries_Get. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + route53DomainsDomainSummariesGet(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.route53DomainsDomainSummaries() + .getByResourceGroupWithResponse("rgroute53DomainsDomainSummary", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/Route53DomainsDomainSummariesListByResourceGroupSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/Route53DomainsDomainSummariesListByResourceGroupSamples.java new file mode 100644 index 000000000000..bdf34998be52 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/Route53DomainsDomainSummariesListByResourceGroupSamples.java @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +/** + * Samples for Route53DomainsDomainSummaries ListByResourceGroup. + */ +public final class Route53DomainsDomainSummariesListByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * Route53DomainsDomainSummaries_ListByResourceGroup.json + */ + /** + * Sample code: Route53DomainsDomainSummaries_ListByResourceGroup. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void route53DomainsDomainSummariesListByResourceGroup( + com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.route53DomainsDomainSummaries() + .listByResourceGroup("rgroute53DomainsDomainSummary", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/Route53DomainsDomainSummariesListSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/Route53DomainsDomainSummariesListSamples.java new file mode 100644 index 000000000000..e277008bfe9b --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/Route53DomainsDomainSummariesListSamples.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +/** + * Samples for Route53DomainsDomainSummaries List. + */ +public final class Route53DomainsDomainSummariesListSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * Route53DomainsDomainSummaries_ListBySubscription.json + */ + /** + * Sample code: Route53DomainsDomainSummaries_ListBySubscription. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void route53DomainsDomainSummariesListBySubscription( + com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.route53DomainsDomainSummaries().list(com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/Route53DomainsDomainSummariesUpdateSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/Route53DomainsDomainSummariesUpdateSamples.java new file mode 100644 index 000000000000..2a2927a6fde6 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/Route53DomainsDomainSummariesUpdateSamples.java @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +import com.azure.resourcemanager.awsconnector.models.Route53DomainsDomainSummary; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for Route53DomainsDomainSummaries Update. + */ +public final class Route53DomainsDomainSummariesUpdateSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * Route53DomainsDomainSummaries_Update.json + */ + /** + * Sample code: Route53DomainsDomainSummaries_Update. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + route53DomainsDomainSummariesUpdate(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + Route53DomainsDomainSummary resource = manager.route53DomainsDomainSummaries() + .getByResourceGroupWithResponse("rgroute53DomainsDomainSummary", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE) + .getValue(); + resource.update().withTags(mapOf("key8975", "fakeTokenPlaceholder")).apply(); + } + + // Use "Map.of" if available + @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/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/Route53HostedZonesCreateOrReplaceSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/Route53HostedZonesCreateOrReplaceSamples.java new file mode 100644 index 000000000000..2dfb3a7676b0 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/Route53HostedZonesCreateOrReplaceSamples.java @@ -0,0 +1,71 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +import com.azure.resourcemanager.awsconnector.models.AwsRoute53HostedZoneProperties; +import com.azure.resourcemanager.awsconnector.models.HostedZoneConfig; +import com.azure.resourcemanager.awsconnector.models.HostedZoneTag; +import com.azure.resourcemanager.awsconnector.models.QueryLoggingConfig; +import com.azure.resourcemanager.awsconnector.models.Route53HostedZoneProperties; +import com.azure.resourcemanager.awsconnector.models.Vpc; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for Route53HostedZones CreateOrReplace. + */ +public final class Route53HostedZonesCreateOrReplaceSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * Route53HostedZones_CreateOrReplace.json + */ + /** + * Sample code: Route53HostedZones_CreateOrReplace. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + route53HostedZonesCreateOrReplace(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.route53HostedZones() + .define("Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])") + .withRegion("fohhkmxasqynkojwigmrzyhydfpdrd") + .withExistingResourceGroup("rgroute53HostedZone") + .withTags(mapOf("key8226", "fakeTokenPlaceholder")) + .withProperties( + new Route53HostedZoneProperties() + .withAwsProperties(new AwsRoute53HostedZoneProperties() + .withHostedZoneConfig(new HostedZoneConfig().withComment("vanhfd")) + .withHostedZoneTags(Arrays.asList( + new HostedZoneTag().withKey("fakeTokenPlaceholder").withValue("ptsrmgayfujrfvjwyxoi"))) + .withId("dwezucqqxsyhynebuyflyc") + .withName("koqhelfps") + .withNameServers(Arrays.asList("qizlbjltglpbdpxcsriu")) + .withQueryLoggingConfig( + new QueryLoggingConfig().withCloudWatchLogsLogGroupArn("magynetpgpdveymgnonjicfoxzxfp")) + .withVpCs(Arrays.asList(new Vpc().withVpcId("nxfxsb").withVpcRegion("y")))) + .withPublicCloudConnectorsResourceId("qugbrritrvssrcwtib") + .withAwsAccountId("rcvmulzibfebvzgooms") + .withArn("vohjyzjtvd") + .withPublicCloudResourceName("edufxpyvryjxbnwulifcrwuezu") + .withAwsSourceSchema("a") + .withAwsRegion("nthjzqxrrqsducmjudhrcdiqioy") + .withAwsTags(mapOf("key625", "fakeTokenPlaceholder"))) + .create(); + } + + // Use "Map.of" if available + @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/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/Route53HostedZonesDeleteSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/Route53HostedZonesDeleteSamples.java new file mode 100644 index 000000000000..eb548fb69df9 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/Route53HostedZonesDeleteSamples.java @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +/** + * Samples for Route53HostedZones Delete. + */ +public final class Route53HostedZonesDeleteSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * Route53HostedZones_Delete.json + */ + /** + * Sample code: Route53HostedZones_Delete. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void route53HostedZonesDelete(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.route53HostedZones() + .delete("rgroute53HostedZone", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/Route53HostedZonesGetByResourceGroupSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/Route53HostedZonesGetByResourceGroupSamples.java new file mode 100644 index 000000000000..cc8df59b430c --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/Route53HostedZonesGetByResourceGroupSamples.java @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +/** + * Samples for Route53HostedZones GetByResourceGroup. + */ +public final class Route53HostedZonesGetByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * Route53HostedZones_Get.json + */ + /** + * Sample code: Route53HostedZones_Get. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void route53HostedZonesGet(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.route53HostedZones() + .getByResourceGroupWithResponse("rgroute53HostedZone", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/Route53HostedZonesListByResourceGroupSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/Route53HostedZonesListByResourceGroupSamples.java new file mode 100644 index 000000000000..6a87f7f33361 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/Route53HostedZonesListByResourceGroupSamples.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +/** + * Samples for Route53HostedZones ListByResourceGroup. + */ +public final class Route53HostedZonesListByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * Route53HostedZones_ListByResourceGroup.json + */ + /** + * Sample code: Route53HostedZones_ListByResourceGroup. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + route53HostedZonesListByResourceGroup(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.route53HostedZones().listByResourceGroup("rgroute53HostedZone", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/Route53HostedZonesListSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/Route53HostedZonesListSamples.java new file mode 100644 index 000000000000..a225d804f10e --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/Route53HostedZonesListSamples.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +/** + * Samples for Route53HostedZones List. + */ +public final class Route53HostedZonesListSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * Route53HostedZones_ListBySubscription.json + */ + /** + * Sample code: Route53HostedZones_ListBySubscription. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + route53HostedZonesListBySubscription(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.route53HostedZones().list(com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/Route53HostedZonesUpdateSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/Route53HostedZonesUpdateSamples.java new file mode 100644 index 000000000000..b19361e993ec --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/Route53HostedZonesUpdateSamples.java @@ -0,0 +1,45 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +import com.azure.resourcemanager.awsconnector.models.Route53HostedZone; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for Route53HostedZones Update. + */ +public final class Route53HostedZonesUpdateSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * Route53HostedZones_Update.json + */ + /** + * Sample code: Route53HostedZones_Update. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void route53HostedZonesUpdate(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + Route53HostedZone resource = manager.route53HostedZones() + .getByResourceGroupWithResponse("rgroute53HostedZone", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE) + .getValue(); + resource.update().withTags(mapOf("key8195", "fakeTokenPlaceholder")).apply(); + } + + // Use "Map.of" if available + @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/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/Route53ResourceRecordSetsCreateOrReplaceSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/Route53ResourceRecordSetsCreateOrReplaceSamples.java new file mode 100644 index 000000000000..16dcbe3cca08 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/Route53ResourceRecordSetsCreateOrReplaceSamples.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.awsconnector.generated; + +import com.azure.resourcemanager.awsconnector.models.AliasTarget; +import com.azure.resourcemanager.awsconnector.models.AwsRoute53ResourceRecordSetProperties; +import com.azure.resourcemanager.awsconnector.models.CidrRoutingConfig; +import com.azure.resourcemanager.awsconnector.models.Coordinates; +import com.azure.resourcemanager.awsconnector.models.GeoLocation; +import com.azure.resourcemanager.awsconnector.models.GeoProximityLocation; +import com.azure.resourcemanager.awsconnector.models.RRType; +import com.azure.resourcemanager.awsconnector.models.RRTypeEnumValue; +import com.azure.resourcemanager.awsconnector.models.ResourceRecord; +import com.azure.resourcemanager.awsconnector.models.ResourceRecordSetFailover; +import com.azure.resourcemanager.awsconnector.models.ResourceRecordSetFailoverEnumValue; +import com.azure.resourcemanager.awsconnector.models.ResourceRecordSetRegion; +import com.azure.resourcemanager.awsconnector.models.ResourceRecordSetRegionEnumValue; +import com.azure.resourcemanager.awsconnector.models.Route53ResourceRecordSetProperties; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for Route53ResourceRecordSets CreateOrReplace. + */ +public final class Route53ResourceRecordSetsCreateOrReplaceSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * Route53ResourceRecordSets_CreateOrReplace.json + */ + /** + * Sample code: Route53ResourceRecordSets_CreateOrReplace. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + route53ResourceRecordSetsCreateOrReplace(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.route53ResourceRecordSets() + .define("Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])") + .withRegion("fjdvlwthtamvmempnqmew") + .withExistingResourceGroup("rgroute53ResourceRecordSet") + .withTags(mapOf("key3468", "fakeTokenPlaceholder")) + .withProperties(new Route53ResourceRecordSetProperties() + .withAwsProperties(new AwsRoute53ResourceRecordSetProperties() + .withAliasTarget(new AliasTarget().withDnsName("waeiyiiaifbfgjkifiehgpvdssxp") + .withEvaluateTargetHealth(true) + .withHostedZoneId("hyjpvho")) + .withCidrRoutingConfig( + new CidrRoutingConfig().withCollectionId("yzvizqbgbmivdawr").withLocationName("ajghwvabvx")) + .withFailover(new ResourceRecordSetFailoverEnumValue().withValue(ResourceRecordSetFailover.PRIMARY)) + .withGeoLocation(new GeoLocation().withContinentCode("fakeTokenPlaceholder") + .withCountryCode("fakeTokenPlaceholder") + .withSubdivisionCode("fakeTokenPlaceholder")) + .withGeoProximityLocation(new GeoProximityLocation().withAwsRegion("ughqvzy") + .withBias(15) + .withCoordinates(new Coordinates().withLatitude("eijexao").withLongitude("krewjxmtnbo")) + .withLocalZoneGroup("ksejwbcwmouldiasoybmm")) + .withHealthCheckId("tz") + .withMultiValueAnswer(true) + .withName("tmjfllnntbaiyvbzzfivmhgyj") + .withRegion(new ResourceRecordSetRegionEnumValue().withValue(ResourceRecordSetRegion.AF_SOUTH_1)) + .withResourceRecords(Arrays.asList(new ResourceRecord().withValue("joiqyrlrpntv"))) + .withSetIdentifier("rmgriiqkzi") + .withTtl(18L) + .withTrafficPolicyInstanceId("nttbthvurnpsjgshknlxpamzymcgno") + .withType(new RRTypeEnumValue().withValue(RRType.A)) + .withWeight(16L)) + .withPublicCloudConnectorsResourceId("xglniymkrzvonhdikhhxue") + .withAwsAccountId("ktpknwetzcdkadwzokqsphnw") + .withArn("bvuvtjvkmzr") + .withPublicCloudResourceName("xctgrwojlyvrzlx") + .withAwsSourceSchema("w") + .withAwsRegion("bccacstjducrajieglqbivvq") + .withAwsTags(mapOf("key1343", "fakeTokenPlaceholder"))) + .create(); + } + + // Use "Map.of" if available + @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/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/Route53ResourceRecordSetsDeleteSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/Route53ResourceRecordSetsDeleteSamples.java new file mode 100644 index 000000000000..a34466a98b48 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/Route53ResourceRecordSetsDeleteSamples.java @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +/** + * Samples for Route53ResourceRecordSets Delete. + */ +public final class Route53ResourceRecordSetsDeleteSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * Route53ResourceRecordSets_Delete.json + */ + /** + * Sample code: Route53ResourceRecordSets_Delete. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + route53ResourceRecordSetsDelete(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.route53ResourceRecordSets() + .delete("rgroute53ResourceRecordSet", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/Route53ResourceRecordSetsGetByResourceGroupSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/Route53ResourceRecordSetsGetByResourceGroupSamples.java new file mode 100644 index 000000000000..6f1f8811f301 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/Route53ResourceRecordSetsGetByResourceGroupSamples.java @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +/** + * Samples for Route53ResourceRecordSets GetByResourceGroup. + */ +public final class Route53ResourceRecordSetsGetByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * Route53ResourceRecordSets_Get.json + */ + /** + * Sample code: Route53ResourceRecordSets_Get. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + route53ResourceRecordSetsGet(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.route53ResourceRecordSets() + .getByResourceGroupWithResponse("rgroute53ResourceRecordSet", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/Route53ResourceRecordSetsListByResourceGroupSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/Route53ResourceRecordSetsListByResourceGroupSamples.java new file mode 100644 index 000000000000..f990520f703d --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/Route53ResourceRecordSetsListByResourceGroupSamples.java @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +/** + * Samples for Route53ResourceRecordSets ListByResourceGroup. + */ +public final class Route53ResourceRecordSetsListByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * Route53ResourceRecordSets_ListByResourceGroup.json + */ + /** + * Sample code: Route53ResourceRecordSets_ListByResourceGroup. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void route53ResourceRecordSetsListByResourceGroup( + com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.route53ResourceRecordSets() + .listByResourceGroup("rgroute53ResourceRecordSet", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/Route53ResourceRecordSetsListSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/Route53ResourceRecordSetsListSamples.java new file mode 100644 index 000000000000..c7ca55a70bd5 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/Route53ResourceRecordSetsListSamples.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +/** + * Samples for Route53ResourceRecordSets List. + */ +public final class Route53ResourceRecordSetsListSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * Route53ResourceRecordSets_ListBySubscription.json + */ + /** + * Sample code: Route53ResourceRecordSets_ListBySubscription. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void route53ResourceRecordSetsListBySubscription( + com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.route53ResourceRecordSets().list(com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/Route53ResourceRecordSetsUpdateSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/Route53ResourceRecordSetsUpdateSamples.java new file mode 100644 index 000000000000..d8bd7b27a21b --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/Route53ResourceRecordSetsUpdateSamples.java @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +import com.azure.resourcemanager.awsconnector.models.Route53ResourceRecordSet; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for Route53ResourceRecordSets Update. + */ +public final class Route53ResourceRecordSetsUpdateSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * Route53ResourceRecordSets_Update.json + */ + /** + * Sample code: Route53ResourceRecordSets_Update. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + route53ResourceRecordSetsUpdate(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + Route53ResourceRecordSet resource = manager.route53ResourceRecordSets() + .getByResourceGroupWithResponse("rgroute53ResourceRecordSet", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE) + .getValue(); + resource.update().withTags(mapOf("key3023", "fakeTokenPlaceholder")).apply(); + } + + // Use "Map.of" if available + @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/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/S3AccessPointsCreateOrReplaceSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/S3AccessPointsCreateOrReplaceSamples.java new file mode 100644 index 000000000000..46ee1b4d52d0 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/S3AccessPointsCreateOrReplaceSamples.java @@ -0,0 +1,69 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +import com.azure.resourcemanager.awsconnector.models.AwsS3AccessPointProperties; +import com.azure.resourcemanager.awsconnector.models.NetworkOrigin; +import com.azure.resourcemanager.awsconnector.models.PublicAccessBlockConfiguration; +import com.azure.resourcemanager.awsconnector.models.S3AccessPointProperties; +import com.azure.resourcemanager.awsconnector.models.VpcConfiguration; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for S3AccessPoints CreateOrReplace. + */ +public final class S3AccessPointsCreateOrReplaceSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * S3AccessPoints_CreateOrReplace.json + */ + /** + * Sample code: S3AccessPoints_CreateOrReplace. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + s3AccessPointsCreateOrReplace(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.s3AccessPoints() + .define("Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])") + .withRegion("azmnzomeh") + .withExistingResourceGroup("rgs3AccessPoint") + .withTags(mapOf("key2363", "fakeTokenPlaceholder")) + .withProperties(new S3AccessPointProperties() + .withAwsProperties(new AwsS3AccessPointProperties().withAlias("sv") + .withArn("sizkkllnnrgdfkaov") + .withBucket("hsqprhqjtcqrizzbhao") + .withBucketAccountId("bmjnxdssnshenybwnws") + .withName("ve") + .withNetworkOrigin(NetworkOrigin.INTERNET) + .withPublicAccessBlockConfiguration(new PublicAccessBlockConfiguration().withBlockPublicAcls(true) + .withBlockPublicPolicy(true) + .withIgnorePublicAcls(true) + .withRestrictPublicBuckets(true)) + .withVpcConfiguration(new VpcConfiguration().withVpcId("hhzyvprnlxearagzmfsg"))) + .withPublicCloudConnectorsResourceId("ixhnqrsogifbzagpdzakwjxqlt") + .withAwsAccountId("rqzqzkncomjg") + .withArn("dputejthukqrofpuygrkatazvamcge") + .withPublicCloudResourceName("swojnpzcxwqfvhrikxhgu") + .withAwsSourceSchema("utriogwvkzanqypvldgboyemujg") + .withAwsRegion("elrkktihogsptpwwazywnyyzs") + .withAwsTags(mapOf("key2658", "fakeTokenPlaceholder"))) + .create(); + } + + // Use "Map.of" if available + @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/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/S3AccessPointsDeleteSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/S3AccessPointsDeleteSamples.java new file mode 100644 index 000000000000..12b67977b3c1 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/S3AccessPointsDeleteSamples.java @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +/** + * Samples for S3AccessPoints Delete. + */ +public final class S3AccessPointsDeleteSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * S3AccessPoints_Delete.json + */ + /** + * Sample code: S3AccessPoints_Delete. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void s3AccessPointsDelete(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.s3AccessPoints() + .delete("rgs3AccessPoint", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/S3AccessPointsGetByResourceGroupSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/S3AccessPointsGetByResourceGroupSamples.java new file mode 100644 index 000000000000..6d926b5f16e6 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/S3AccessPointsGetByResourceGroupSamples.java @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +/** + * Samples for S3AccessPoints GetByResourceGroup. + */ +public final class S3AccessPointsGetByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/S3AccessPoints_Get. + * json + */ + /** + * Sample code: S3AccessPoints_Get. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void s3AccessPointsGet(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.s3AccessPoints() + .getByResourceGroupWithResponse("rgs3AccessPoint", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/S3AccessPointsListByResourceGroupSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/S3AccessPointsListByResourceGroupSamples.java new file mode 100644 index 000000000000..dc709d95d246 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/S3AccessPointsListByResourceGroupSamples.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +/** + * Samples for S3AccessPoints ListByResourceGroup. + */ +public final class S3AccessPointsListByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * S3AccessPoints_ListByResourceGroup.json + */ + /** + * Sample code: S3AccessPoints_ListByResourceGroup. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + s3AccessPointsListByResourceGroup(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.s3AccessPoints().listByResourceGroup("rgs3AccessPoint", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/S3AccessPointsListSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/S3AccessPointsListSamples.java new file mode 100644 index 000000000000..d974aea76ff4 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/S3AccessPointsListSamples.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +/** + * Samples for S3AccessPoints List. + */ +public final class S3AccessPointsListSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * S3AccessPoints_ListBySubscription.json + */ + /** + * Sample code: S3AccessPoints_ListBySubscription. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + s3AccessPointsListBySubscription(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.s3AccessPoints().list(com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/S3AccessPointsUpdateSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/S3AccessPointsUpdateSamples.java new file mode 100644 index 000000000000..6c0e28eb353e --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/S3AccessPointsUpdateSamples.java @@ -0,0 +1,45 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +import com.azure.resourcemanager.awsconnector.models.S3AccessPoint; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for S3AccessPoints Update. + */ +public final class S3AccessPointsUpdateSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * S3AccessPoints_Update.json + */ + /** + * Sample code: S3AccessPoints_Update. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void s3AccessPointsUpdate(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + S3AccessPoint resource = manager.s3AccessPoints() + .getByResourceGroupWithResponse("rgs3AccessPoint", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE) + .getValue(); + resource.update().withTags(mapOf("key1063", "fakeTokenPlaceholder")).apply(); + } + + // Use "Map.of" if available + @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/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/S3BucketPoliciesCreateOrReplaceSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/S3BucketPoliciesCreateOrReplaceSamples.java new file mode 100644 index 000000000000..04757b457092 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/S3BucketPoliciesCreateOrReplaceSamples.java @@ -0,0 +1,56 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +import com.azure.resourcemanager.awsconnector.models.AwsS3BucketPolicyProperties; +import com.azure.resourcemanager.awsconnector.models.S3BucketPolicyProperties; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for S3BucketPolicies CreateOrReplace. + */ +public final class S3BucketPoliciesCreateOrReplaceSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * S3BucketPolicies_CreateOrReplace.json + */ + /** + * Sample code: S3BucketPolicies_CreateOrReplace. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + s3BucketPoliciesCreateOrReplace(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.s3BucketPolicies() + .define("Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])") + .withRegion("hsbqwwdspecsoigxusdbqgilaa") + .withExistingResourceGroup("rgs3BucketPolicy") + .withTags(mapOf("key9799", "fakeTokenPlaceholder")) + .withProperties(new S3BucketPolicyProperties() + .withAwsProperties(new AwsS3BucketPolicyProperties().withPolicy("fifgvjoxnidoedtzm")) + .withPublicCloudConnectorsResourceId("n") + .withAwsAccountId("czyyfhht") + .withArn("ebpwjamccadznftkixikeutdjacadm") + .withPublicCloudResourceName("suksqtvhtayjy") + .withAwsSourceSchema("wdyfvmrsshlyadt") + .withAwsRegion("mlepmxnkxjgtrqhtbaaoxuaj") + .withAwsTags(mapOf("key5637", "fakeTokenPlaceholder"))) + .create(); + } + + // Use "Map.of" if available + @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/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/S3BucketPoliciesDeleteSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/S3BucketPoliciesDeleteSamples.java new file mode 100644 index 000000000000..74cef90e4f35 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/S3BucketPoliciesDeleteSamples.java @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +/** + * Samples for S3BucketPolicies Delete. + */ +public final class S3BucketPoliciesDeleteSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * S3BucketPolicies_Delete.json + */ + /** + * Sample code: S3BucketPolicies_Delete. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void s3BucketPoliciesDelete(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.s3BucketPolicies() + .delete("rgs3BucketPolicy", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/S3BucketPoliciesGetByResourceGroupSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/S3BucketPoliciesGetByResourceGroupSamples.java new file mode 100644 index 000000000000..c943f2192659 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/S3BucketPoliciesGetByResourceGroupSamples.java @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +/** + * Samples for S3BucketPolicies GetByResourceGroup. + */ +public final class S3BucketPoliciesGetByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * S3BucketPolicies_Get.json + */ + /** + * Sample code: S3BucketPolicies_Get. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void s3BucketPoliciesGet(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.s3BucketPolicies() + .getByResourceGroupWithResponse("rgs3BucketPolicy", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/S3BucketPoliciesListByResourceGroupSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/S3BucketPoliciesListByResourceGroupSamples.java new file mode 100644 index 000000000000..922c4a0d4f95 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/S3BucketPoliciesListByResourceGroupSamples.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +/** + * Samples for S3BucketPolicies ListByResourceGroup. + */ +public final class S3BucketPoliciesListByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * S3BucketPolicies_ListByResourceGroup.json + */ + /** + * Sample code: S3BucketPolicies_ListByResourceGroup. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + s3BucketPoliciesListByResourceGroup(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.s3BucketPolicies().listByResourceGroup("rgs3BucketPolicy", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/S3BucketPoliciesListSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/S3BucketPoliciesListSamples.java new file mode 100644 index 000000000000..4dcaf19ebd5e --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/S3BucketPoliciesListSamples.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +/** + * Samples for S3BucketPolicies List. + */ +public final class S3BucketPoliciesListSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * S3BucketPolicies_ListBySubscription.json + */ + /** + * Sample code: S3BucketPolicies_ListBySubscription. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + s3BucketPoliciesListBySubscription(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.s3BucketPolicies().list(com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/S3BucketPoliciesUpdateSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/S3BucketPoliciesUpdateSamples.java new file mode 100644 index 000000000000..630320cad9fd --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/S3BucketPoliciesUpdateSamples.java @@ -0,0 +1,45 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +import com.azure.resourcemanager.awsconnector.models.S3BucketPolicy; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for S3BucketPolicies Update. + */ +public final class S3BucketPoliciesUpdateSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * S3BucketPolicies_Update.json + */ + /** + * Sample code: S3BucketPolicies_Update. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void s3BucketPoliciesUpdate(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + S3BucketPolicy resource = manager.s3BucketPolicies() + .getByResourceGroupWithResponse("rgs3BucketPolicy", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE) + .getValue(); + resource.update().withTags(mapOf("key3408", "fakeTokenPlaceholder")).apply(); + } + + // Use "Map.of" if available + @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/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/S3BucketsCreateOrReplaceSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/S3BucketsCreateOrReplaceSamples.java new file mode 100644 index 000000000000..bc944a377f69 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/S3BucketsCreateOrReplaceSamples.java @@ -0,0 +1,327 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +import com.azure.resourcemanager.awsconnector.models.AbortIncompleteMultipartUpload; +import com.azure.resourcemanager.awsconnector.models.AccelerateConfiguration; +import com.azure.resourcemanager.awsconnector.models.AccelerateConfigurationAccelerationStatus; +import com.azure.resourcemanager.awsconnector.models.AccessControl; +import com.azure.resourcemanager.awsconnector.models.AccessControlTranslation; +import com.azure.resourcemanager.awsconnector.models.AnalyticsConfiguration; +import com.azure.resourcemanager.awsconnector.models.AwsS3BucketProperties; +import com.azure.resourcemanager.awsconnector.models.BucketEncryption; +import com.azure.resourcemanager.awsconnector.models.CorsConfiguration; +import com.azure.resourcemanager.awsconnector.models.CorsRule; +import com.azure.resourcemanager.awsconnector.models.CorsRuleAllowedMethods; +import com.azure.resourcemanager.awsconnector.models.DataExport; +import com.azure.resourcemanager.awsconnector.models.DefaultRetention; +import com.azure.resourcemanager.awsconnector.models.DefaultRetentionMode; +import com.azure.resourcemanager.awsconnector.models.DeleteMarkerReplication; +import com.azure.resourcemanager.awsconnector.models.DeleteMarkerReplicationStatus; +import com.azure.resourcemanager.awsconnector.models.Destination; +import com.azure.resourcemanager.awsconnector.models.DestinationFormat; +import com.azure.resourcemanager.awsconnector.models.EncryptionConfigurationAutoGenerated; +import com.azure.resourcemanager.awsconnector.models.EventBridgeConfiguration; +import com.azure.resourcemanager.awsconnector.models.FilterRule; +import com.azure.resourcemanager.awsconnector.models.IntelligentTieringConfiguration; +import com.azure.resourcemanager.awsconnector.models.IntelligentTieringConfigurationStatus; +import com.azure.resourcemanager.awsconnector.models.InventoryConfiguration; +import com.azure.resourcemanager.awsconnector.models.InventoryConfigurationIncludedObjectVersions; +import com.azure.resourcemanager.awsconnector.models.InventoryConfigurationOptionalFields; +import com.azure.resourcemanager.awsconnector.models.InventoryConfigurationScheduleFrequency; +import com.azure.resourcemanager.awsconnector.models.LambdaConfiguration; +import com.azure.resourcemanager.awsconnector.models.LifecycleConfiguration; +import com.azure.resourcemanager.awsconnector.models.LoggingConfiguration; +import com.azure.resourcemanager.awsconnector.models.Metrics; +import com.azure.resourcemanager.awsconnector.models.MetricsConfiguration; +import com.azure.resourcemanager.awsconnector.models.MetricsStatus; +import com.azure.resourcemanager.awsconnector.models.NoncurrentVersionExpiration; +import com.azure.resourcemanager.awsconnector.models.NoncurrentVersionTransition; +import com.azure.resourcemanager.awsconnector.models.NoncurrentVersionTransitionStorageClass; +import com.azure.resourcemanager.awsconnector.models.NotificationConfigurationAutoGenerated2; +import com.azure.resourcemanager.awsconnector.models.NotificationFilter; +import com.azure.resourcemanager.awsconnector.models.ObjectLockConfiguration; +import com.azure.resourcemanager.awsconnector.models.ObjectLockRule; +import com.azure.resourcemanager.awsconnector.models.OwnershipControls; +import com.azure.resourcemanager.awsconnector.models.OwnershipControlsRule; +import com.azure.resourcemanager.awsconnector.models.OwnershipControlsRuleObjectOwnership; +import com.azure.resourcemanager.awsconnector.models.PartitionedPrefix; +import com.azure.resourcemanager.awsconnector.models.PartitionedPrefixPartitionDateSource; +import com.azure.resourcemanager.awsconnector.models.PublicAccessBlockConfigurationAutoGenerated; +import com.azure.resourcemanager.awsconnector.models.QueueConfiguration; +import com.azure.resourcemanager.awsconnector.models.RedirectAllRequestsTo; +import com.azure.resourcemanager.awsconnector.models.RedirectAllRequestsToProtocol; +import com.azure.resourcemanager.awsconnector.models.RedirectRule; +import com.azure.resourcemanager.awsconnector.models.RedirectRuleProtocol; +import com.azure.resourcemanager.awsconnector.models.ReplicaModifications; +import com.azure.resourcemanager.awsconnector.models.ReplicaModificationsStatus; +import com.azure.resourcemanager.awsconnector.models.ReplicationConfigurationAutoGenerated; +import com.azure.resourcemanager.awsconnector.models.ReplicationDestinationAutoGenerated; +import com.azure.resourcemanager.awsconnector.models.ReplicationDestinationStorageClass; +import com.azure.resourcemanager.awsconnector.models.ReplicationRule; +import com.azure.resourcemanager.awsconnector.models.ReplicationRuleAndOperator; +import com.azure.resourcemanager.awsconnector.models.ReplicationRuleFilter; +import com.azure.resourcemanager.awsconnector.models.ReplicationRuleStatus; +import com.azure.resourcemanager.awsconnector.models.ReplicationTime; +import com.azure.resourcemanager.awsconnector.models.ReplicationTimeStatus; +import com.azure.resourcemanager.awsconnector.models.ReplicationTimeValue; +import com.azure.resourcemanager.awsconnector.models.RoutingRule; +import com.azure.resourcemanager.awsconnector.models.RoutingRuleCondition; +import com.azure.resourcemanager.awsconnector.models.Rule; +import com.azure.resourcemanager.awsconnector.models.RuleStatus; +import com.azure.resourcemanager.awsconnector.models.S3BucketProperties; +import com.azure.resourcemanager.awsconnector.models.S3KeyFilter; +import com.azure.resourcemanager.awsconnector.models.ServerSideEncryptionByDefault; +import com.azure.resourcemanager.awsconnector.models.ServerSideEncryptionByDefaultSseAlgorithm; +import com.azure.resourcemanager.awsconnector.models.ServerSideEncryptionRule; +import com.azure.resourcemanager.awsconnector.models.SourceSelectionCriteria; +import com.azure.resourcemanager.awsconnector.models.SseKmsEncryptedObjects; +import com.azure.resourcemanager.awsconnector.models.SseKmsEncryptedObjectsStatus; +import com.azure.resourcemanager.awsconnector.models.StorageClassAnalysis; +import com.azure.resourcemanager.awsconnector.models.TagAutoGenerated50; +import com.azure.resourcemanager.awsconnector.models.TagFilter; +import com.azure.resourcemanager.awsconnector.models.TargetObjectKeyFormat; +import com.azure.resourcemanager.awsconnector.models.Tiering; +import com.azure.resourcemanager.awsconnector.models.TieringAccessTier; +import com.azure.resourcemanager.awsconnector.models.TopicConfiguration; +import com.azure.resourcemanager.awsconnector.models.Transition; +import com.azure.resourcemanager.awsconnector.models.TransitionStorageClass; +import com.azure.resourcemanager.awsconnector.models.VersioningConfiguration; +import com.azure.resourcemanager.awsconnector.models.VersioningConfigurationStatus; +import com.azure.resourcemanager.awsconnector.models.WebsiteConfiguration; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for S3Buckets CreateOrReplace. + */ +public final class S3BucketsCreateOrReplaceSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * S3Buckets_CreateOrReplace.json + */ + /** + * Sample code: S3Buckets_CreateOrReplace. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void s3BucketsCreateOrReplace(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.s3Buckets() + .define("Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])") + .withRegion("pesmjbocvf") + .withExistingResourceGroup("rgs3Bucket") + .withTags(mapOf("key8605", "fakeTokenPlaceholder")) + .withProperties( + new S3BucketProperties() + .withAwsProperties( + new AwsS3BucketProperties() + .withAccelerateConfiguration(new AccelerateConfiguration() + .withAccelerationStatus(AccelerateConfigurationAccelerationStatus.ENABLED)) + .withAccessControl(AccessControl.AUTHENTICATED_READ) + .withAnalyticsConfigurations(Arrays.asList(new AnalyticsConfiguration().withId("ioxkjkuclx") + .withPrefix("errquicjtmxuidndown") + .withStorageClassAnalysis(new StorageClassAnalysis().withDataExport(new DataExport() + .withDestination(new Destination().withBucketAccountId("sfgcxqtuacvejulm") + .withBucketArn("iuwuakbkkh") + .withFormat(DestinationFormat.CSV) + .withPrefix("bnbqkueiiffpl")) + .withOutputSchemaVersion("ojzzqnkekust"))) + .withTagFilters( + Arrays.asList(new TagFilter().withKey("fakeTokenPlaceholder").withValue("fsby"))))) + .withArn("wdn") + .withBucketEncryption( + new BucketEncryption().withServerSideEncryptionConfiguration( + Arrays.asList(new ServerSideEncryptionRule().withBucketKeyEnabled(true) + .withServerSideEncryptionByDefault(new ServerSideEncryptionByDefault() + .withKmsMasterKeyId("fakeTokenPlaceholder") + .withSseAlgorithm(ServerSideEncryptionByDefaultSseAlgorithm.AES256))))) + .withBucketName("qapantghvzujpa") + .withCorsConfiguration(new CorsConfiguration().withCorsRules( + Arrays.asList(new CorsRule().withAllowedHeaders(Arrays.asList("zzooekoypz")) + .withAllowedMethods(Arrays.asList(CorsRuleAllowedMethods.DELETE)) + .withAllowedOrigins(Arrays.asList("tqldxbbws")) + .withExposedHeaders(Arrays.asList("wjlikohhmisfgumcfzrnvg")) + .withId("zvasxfnbnbpftihvtosdnlmskv") + .withMaxAge(9)))) + .withDomainName("vbhotuxputambztq") + .withDualStackDomainName("sryuphsbzszrwamvrcsihe") + .withIntelligentTieringConfigurations( + Arrays.asList(new IntelligentTieringConfiguration().withId("dbqsgaw") + .withPrefix("lhizynvczgfiqwaiyuqpvnd") + .withStatus(IntelligentTieringConfigurationStatus.DISABLED) + .withTagFilters(Arrays + .asList(new TagFilter().withKey("fakeTokenPlaceholder").withValue("fsby"))) + .withTierings(Arrays.asList( + new Tiering().withAccessTier(TieringAccessTier.ARCHIVE_ACCESS).withDays(6))))) + .withInventoryConfigurations(Arrays.asList(new InventoryConfiguration() + .withDestination(new Destination().withBucketAccountId("sfgcxqtuacvejulm") + .withBucketArn("iuwuakbkkh") + .withFormat(DestinationFormat.CSV) + .withPrefix("bnbqkueiiffpl")) + .withEnabled(true) + .withId("yqyorzlpsfzzycfeqmdgtsstdze") + .withIncludedObjectVersions(InventoryConfigurationIncludedObjectVersions.ALL) + .withOptionalFields( + Arrays.asList(InventoryConfigurationOptionalFields.BUCKET_KEY_STATUS)) + .withPrefix("tuzwyujzrv") + .withScheduleFrequency(InventoryConfigurationScheduleFrequency.DAILY))) + .withLifecycleConfiguration(new LifecycleConfiguration().withRules(Arrays.asList(new Rule() + .withAbortIncompleteMultipartUpload( + new AbortIncompleteMultipartUpload().withDaysAfterInitiation(20)) + .withExpirationDate("ruijzosqnherfgwbgzbiwau") + .withExpirationInDays(8) + .withExpiredObjectDeleteMarker(true) + .withId("aofbidgki") + .withNoncurrentVersionExpiration( + new NoncurrentVersionExpiration().withNewerNoncurrentVersions(4) + .withNoncurrentDays(17)) + .withNoncurrentVersionExpirationInDays(4) + .withNoncurrentVersionTransition( + new NoncurrentVersionTransition().withNewerNoncurrentVersions(6) + .withStorageClass(NoncurrentVersionTransitionStorageClass.DEEP_ARCHIVE) + .withTransitionInDays(8)) + .withNoncurrentVersionTransitions( + Arrays.asList(new NoncurrentVersionTransition().withNewerNoncurrentVersions(6) + .withStorageClass(NoncurrentVersionTransitionStorageClass.DEEP_ARCHIVE) + .withTransitionInDays(8))) + .withObjectSizeGreaterThan("hfifjfbqvmtatza") + .withObjectSizeLessThan("ew") + .withPrefix("kbsmshvpardhxehfjgszomvekk") + .withStatus(RuleStatus.DISABLED) + .withTagFilters( + Arrays.asList(new TagFilter().withKey("fakeTokenPlaceholder").withValue("fsby"))) + .withTransition(new Transition().withStorageClass(TransitionStorageClass.DEEP_ARCHIVE) + .withTransitionDate("cqdrkqznucygxbnccuvxqbtnm") + .withTransitionInDays(14)) + .withTransitions( + Arrays.asList(new Transition().withStorageClass(TransitionStorageClass.DEEP_ARCHIVE) + .withTransitionDate("cqdrkqznucygxbnccuvxqbtnm") + .withTransitionInDays(14)))))) + .withLoggingConfiguration(new LoggingConfiguration().withDestinationBucketName("aujj") + .withLogFilePrefix("vdmmbfnvymowpvmhbsagekbokzvp") + .withTargetObjectKeyFormat( + new TargetObjectKeyFormat().withPartitionedPrefix(new PartitionedPrefix() + .withPartitionDateSource(PartitionedPrefixPartitionDateSource.DELIVERY_TIME)))) + .withMetricsConfigurations( + Arrays.asList(new MetricsConfiguration() + .withAccessPointArn("tkhjqpjfplj") + .withId("ggheleujxadbvbjogd") + .withPrefix("zg") + .withTagFilters(Arrays + .asList(new TagFilter().withKey("fakeTokenPlaceholder").withValue("fsby"))))) + .withNotificationConfiguration(new NotificationConfigurationAutoGenerated2() + .withEventBridgeConfiguration( + new EventBridgeConfiguration().withEventBridgeEnabled(true)) + .withLambdaConfigurations( + Arrays.asList(new LambdaConfiguration().withEvent("zpvewswtoarduycggotzdneptucwix") + .withFilter(new NotificationFilter().withS3Key(new S3KeyFilter().withRules( + Arrays.asList(new FilterRule().withName("ohgjzuamjncbifvbkldogxjuxvhvz") + .withValue("dauvnhzxpkpqutnrl"))))) + .withFunction("zmyzygfaojliiryslfyuyme"))) + .withQueueConfigurations( + Arrays.asList(new QueueConfiguration().withEvent("qgcdpcvmkvjivvpvmmaeqrictlznb") + .withFilter(new NotificationFilter().withS3Key(new S3KeyFilter().withRules( + Arrays.asList(new FilterRule().withName("ohgjzuamjncbifvbkldogxjuxvhvz") + .withValue("dauvnhzxpkpqutnrl"))))) + .withQueue("qwlbvlgmwiaegulyybqggopf"))) + .withTopicConfigurations(Arrays.asList(new TopicConfiguration().withEvent("kxl") + .withFilter(new NotificationFilter().withS3Key(new S3KeyFilter().withRules( + Arrays.asList(new FilterRule().withName("ohgjzuamjncbifvbkldogxjuxvhvz") + .withValue("dauvnhzxpkpqutnrl"))))) + .withTopic("cj")))) + .withObjectLockConfiguration(new ObjectLockConfiguration().withObjectLockEnabled("aiocf") + .withRule(new ObjectLockRule().withDefaultRetention(new DefaultRetention().withDays(22) + .withMode(DefaultRetentionMode.COMPLIANCE) + .withYears(11)))) + .withObjectLockEnabled(true) + .withOwnershipControls(new OwnershipControls().withRules(Arrays + .asList(new OwnershipControlsRule() + .withObjectOwnership(OwnershipControlsRuleObjectOwnership.BUCKET_OWNER_ENFORCED)))) + .withPublicAccessBlockConfiguration( + new PublicAccessBlockConfigurationAutoGenerated().withBlockPublicAcls(true) + .withBlockPublicPolicy(true) + .withIgnorePublicAcls(true) + .withRestrictPublicBuckets(true)) + .withRegionalDomainName("xdbzcoemgixrqq") + .withReplicationConfiguration(new ReplicationConfigurationAutoGenerated() + .withRole("rqafufwtmuflkqet") + .withRules(Arrays.asList(new ReplicationRule() + .withDeleteMarkerReplication(new DeleteMarkerReplication() + .withStatus(DeleteMarkerReplicationStatus.DISABLED)) + .withDestination(new ReplicationDestinationAutoGenerated() + .withAccessControlTranslation( + new AccessControlTranslation().withOwner("smyptov")) + .withAccount("hwqiekzz") + .withBucket("prjlsmdhkwrputvpdavgn") + .withEncryptionConfiguration(new EncryptionConfigurationAutoGenerated() + .withReplicaKmsKeyId("fakeTokenPlaceholder")) + .withMetrics( + new Metrics().withEventThreshold(new ReplicationTimeValue().withMinutes(18)) + .withStatus(MetricsStatus.DISABLED)) + .withReplicationTime( + new ReplicationTime().withStatus(ReplicationTimeStatus.DISABLED) + .withTime(new ReplicationTimeValue().withMinutes(18))) + .withStorageClass(ReplicationDestinationStorageClass.DEEP_ARCHIVE)) + .withFilter(new ReplicationRuleFilter() + .withAnd( + new ReplicationRuleAndOperator().withPrefix("rlralilpznxqfpcseysvvxmfaor") + .withTagFilters(Arrays.asList( + new TagFilter().withKey("fakeTokenPlaceholder").withValue("fsby")))) + .withPrefix("etzfeufdxmcvjzpvxbjmzikok") + .withTagFilter( + new TagFilter().withKey("fakeTokenPlaceholder").withValue("fsby"))) + .withId("fjcfzahlddm") + .withPrefix("agykvphwwnfevfucrxugxejv") + .withPriority(20) + .withSourceSelectionCriteria(new SourceSelectionCriteria() + .withReplicaModifications( + new ReplicaModifications().withStatus(ReplicaModificationsStatus.DISABLED)) + .withSseKmsEncryptedObjects(new SseKmsEncryptedObjects() + .withStatus(SseKmsEncryptedObjectsStatus.DISABLED))) + .withStatus(ReplicationRuleStatus.DISABLED)))) + .withTags(Arrays.asList(new TagAutoGenerated50().withKey("fakeTokenPlaceholder") + .withValue("otwjdamxqdydqwujwyfh"))) + .withVersioningConfiguration( + new VersioningConfiguration().withStatus(VersioningConfigurationStatus.ENABLED)) + .withWebsiteConfiguration(new WebsiteConfiguration() + .withErrorDocument("zxifnrlbyapkasrrhamdkdsqk") + .withIndexDocument("umbhsxlihqldbh") + .withRedirectAllRequestsTo(new RedirectAllRequestsTo() + .withHostname("sxmd") + .withProtocol(RedirectAllRequestsToProtocol.HTTP)) + .withRoutingRules(Arrays.asList(new RoutingRule() + .withRedirectRule(new RedirectRule().withHostname("odmugwc") + .withHttpRedirectCode("fakeTokenPlaceholder") + .withProtocol(RedirectRuleProtocol.HTTP) + .withReplaceKeyPrefixWith("fakeTokenPlaceholder") + .withReplaceKeyWith("fakeTokenPlaceholder")) + .withRoutingRuleCondition(new RoutingRuleCondition() + .withHttpErrorCodeReturnedEquals("fakeTokenPlaceholder") + .withKeyPrefixEquals("fakeTokenPlaceholder"))))) + .withWebsiteUrl("vtlwozcgstjkkmgfywinjoreomvw")) + .withPublicCloudConnectorsResourceId("i") + .withAwsAccountId("rfckvyuni") + .withArn("qoufjwcexyvk") + .withPublicCloudResourceName("fmugqeeykklaccblyqplo") + .withAwsSourceSchema("kywnqkadqm") + .withAwsRegion("kckriyydtrwdlelcuztzfeptvcbwj") + .withAwsTags(mapOf("key1337", "fakeTokenPlaceholder"))) + .create(); + } + + // Use "Map.of" if available + @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/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/S3BucketsDeleteSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/S3BucketsDeleteSamples.java new file mode 100644 index 000000000000..fe61322847b2 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/S3BucketsDeleteSamples.java @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +/** + * Samples for S3Buckets Delete. + */ +public final class S3BucketsDeleteSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/S3Buckets_Delete. + * json + */ + /** + * Sample code: S3Buckets_Delete. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void s3BucketsDelete(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.s3Buckets() + .delete("rgs3Bucket", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/S3BucketsGetByResourceGroupSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/S3BucketsGetByResourceGroupSamples.java new file mode 100644 index 000000000000..f1fc1464d674 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/S3BucketsGetByResourceGroupSamples.java @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +/** + * Samples for S3Buckets GetByResourceGroup. + */ +public final class S3BucketsGetByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/S3Buckets_Get.json + */ + /** + * Sample code: S3Buckets_Get. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void s3BucketsGet(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.s3Buckets() + .getByResourceGroupWithResponse("rgs3Bucket", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/S3BucketsListByResourceGroupSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/S3BucketsListByResourceGroupSamples.java new file mode 100644 index 000000000000..fe0e5f5a531d --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/S3BucketsListByResourceGroupSamples.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +/** + * Samples for S3Buckets ListByResourceGroup. + */ +public final class S3BucketsListByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * S3Buckets_ListByResourceGroup.json + */ + /** + * Sample code: S3Buckets_ListByResourceGroup. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + s3BucketsListByResourceGroup(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.s3Buckets().listByResourceGroup("rgs3Bucket", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/S3BucketsListSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/S3BucketsListSamples.java new file mode 100644 index 000000000000..2b70a91083df --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/S3BucketsListSamples.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.awsconnector.generated; + +/** + * Samples for S3Buckets List. + */ +public final class S3BucketsListSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * S3Buckets_ListBySubscription.json + */ + /** + * Sample code: S3Buckets_ListBySubscription. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void s3BucketsListBySubscription(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.s3Buckets().list(com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/S3BucketsUpdateSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/S3BucketsUpdateSamples.java new file mode 100644 index 000000000000..e1c900c6ece6 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/S3BucketsUpdateSamples.java @@ -0,0 +1,45 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +import com.azure.resourcemanager.awsconnector.models.S3Bucket; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for S3Buckets Update. + */ +public final class S3BucketsUpdateSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/S3Buckets_Update. + * json + */ + /** + * Sample code: S3Buckets_Update. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void s3BucketsUpdate(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + S3Bucket resource = manager.s3Buckets() + .getByResourceGroupWithResponse("rgs3Bucket", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE) + .getValue(); + resource.update().withTags(mapOf("key6199", "fakeTokenPlaceholder")).apply(); + } + + // Use "Map.of" if available + @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/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/S3ControlMultiRegionAccessPointPolicyDocumentsCreateOrReplaceSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/S3ControlMultiRegionAccessPointPolicyDocumentsCreateOrReplaceSamples.java new file mode 100644 index 000000000000..53463efdcfbd --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/S3ControlMultiRegionAccessPointPolicyDocumentsCreateOrReplaceSamples.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.awsconnector.generated; + +import com.azure.resourcemanager.awsconnector.models.AwsS3ControlMultiRegionAccessPointPolicyDocumentProperties; +import com.azure.resourcemanager.awsconnector.models.EstablishedMultiRegionAccessPointPolicy; +import com.azure.resourcemanager.awsconnector.models.ProposedMultiRegionAccessPointPolicy; +import com.azure.resourcemanager.awsconnector.models.S3ControlMultiRegionAccessPointPolicyDocumentProperties; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for S3ControlMultiRegionAccessPointPolicyDocuments CreateOrReplace. + */ +public final class S3ControlMultiRegionAccessPointPolicyDocumentsCreateOrReplaceSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * S3ControlMultiRegionAccessPointPolicyDocuments_CreateOrReplace.json + */ + /** + * Sample code: S3ControlMultiRegionAccessPointPolicyDocuments_CreateOrReplace. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void s3ControlMultiRegionAccessPointPolicyDocumentsCreateOrReplace( + com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.s3ControlMultiRegionAccessPointPolicyDocuments() + .define("Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])") + .withRegion("mfqwu") + .withExistingResourceGroup("rgs3ControlMultiRegionAccessPointPolicyDocument") + .withTags(mapOf("key9846", "fakeTokenPlaceholder")) + .withProperties(new S3ControlMultiRegionAccessPointPolicyDocumentProperties() + .withAwsProperties(new AwsS3ControlMultiRegionAccessPointPolicyDocumentProperties() + .withEstablished(new EstablishedMultiRegionAccessPointPolicy().withPolicy("amcyzzkmwbyuxnbqop")) + .withProposed(new ProposedMultiRegionAccessPointPolicy().withPolicy("lbmaqmlw"))) + .withPublicCloudConnectorsResourceId("yyfwlodyfhgbzyfgsl") + .withAwsAccountId("wotmizsy") + .withArn("ugqgpzuzhxnknuancpvpckccl") + .withPublicCloudResourceName("ks") + .withAwsSourceSchema("qntzhuq") + .withAwsRegion("pshllexnortomzvgcjnsxeoo") + .withAwsTags(mapOf("key788", "fakeTokenPlaceholder"))) + .create(); + } + + // Use "Map.of" if available + @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/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/S3ControlMultiRegionAccessPointPolicyDocumentsDeleteSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/S3ControlMultiRegionAccessPointPolicyDocumentsDeleteSamples.java new file mode 100644 index 000000000000..f7c891b42291 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/S3ControlMultiRegionAccessPointPolicyDocumentsDeleteSamples.java @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +/** + * Samples for S3ControlMultiRegionAccessPointPolicyDocuments Delete. + */ +public final class S3ControlMultiRegionAccessPointPolicyDocumentsDeleteSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * S3ControlMultiRegionAccessPointPolicyDocuments_Delete.json + */ + /** + * Sample code: S3ControlMultiRegionAccessPointPolicyDocuments_Delete. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void s3ControlMultiRegionAccessPointPolicyDocumentsDelete( + com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.s3ControlMultiRegionAccessPointPolicyDocuments() + .delete("rgs3ControlMultiRegionAccessPointPolicyDocument", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/S3ControlMultiRegionAccessPointPolicyDocumentsGetByResourceGroupSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/S3ControlMultiRegionAccessPointPolicyDocumentsGetByResourceGroupSamples.java new file mode 100644 index 000000000000..5427a952bd2c --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/S3ControlMultiRegionAccessPointPolicyDocumentsGetByResourceGroupSamples.java @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +/** + * Samples for S3ControlMultiRegionAccessPointPolicyDocuments GetByResourceGroup. + */ +public final class S3ControlMultiRegionAccessPointPolicyDocumentsGetByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * S3ControlMultiRegionAccessPointPolicyDocuments_Get.json + */ + /** + * Sample code: S3ControlMultiRegionAccessPointPolicyDocuments_Get. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void s3ControlMultiRegionAccessPointPolicyDocumentsGet( + com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.s3ControlMultiRegionAccessPointPolicyDocuments() + .getByResourceGroupWithResponse("rgs3ControlMultiRegionAccessPointPolicyDocument", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/S3ControlMultiRegionAccessPointPolicyDocumentsListByResourceGroupSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/S3ControlMultiRegionAccessPointPolicyDocumentsListByResourceGroupSamples.java new file mode 100644 index 000000000000..7787f3f7a55a --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/S3ControlMultiRegionAccessPointPolicyDocumentsListByResourceGroupSamples.java @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +/** + * Samples for S3ControlMultiRegionAccessPointPolicyDocuments ListByResourceGroup. + */ +public final class S3ControlMultiRegionAccessPointPolicyDocumentsListByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * S3ControlMultiRegionAccessPointPolicyDocuments_ListByResourceGroup.json + */ + /** + * Sample code: S3ControlMultiRegionAccessPointPolicyDocuments_ListByResourceGroup. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void s3ControlMultiRegionAccessPointPolicyDocumentsListByResourceGroup( + com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.s3ControlMultiRegionAccessPointPolicyDocuments() + .listByResourceGroup("rgs3ControlMultiRegionAccessPointPolicyDocument", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/S3ControlMultiRegionAccessPointPolicyDocumentsListSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/S3ControlMultiRegionAccessPointPolicyDocumentsListSamples.java new file mode 100644 index 000000000000..613931cccf82 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/S3ControlMultiRegionAccessPointPolicyDocumentsListSamples.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +/** + * Samples for S3ControlMultiRegionAccessPointPolicyDocuments List. + */ +public final class S3ControlMultiRegionAccessPointPolicyDocumentsListSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * S3ControlMultiRegionAccessPointPolicyDocuments_ListBySubscription.json + */ + /** + * Sample code: S3ControlMultiRegionAccessPointPolicyDocuments_ListBySubscription. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void s3ControlMultiRegionAccessPointPolicyDocumentsListBySubscription( + com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.s3ControlMultiRegionAccessPointPolicyDocuments().list(com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/S3ControlMultiRegionAccessPointPolicyDocumentsUpdateSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/S3ControlMultiRegionAccessPointPolicyDocumentsUpdateSamples.java new file mode 100644 index 000000000000..4d7b4ff36b8e --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/S3ControlMultiRegionAccessPointPolicyDocumentsUpdateSamples.java @@ -0,0 +1,47 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +import com.azure.resourcemanager.awsconnector.models.S3ControlMultiRegionAccessPointPolicyDocument; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for S3ControlMultiRegionAccessPointPolicyDocuments Update. + */ +public final class S3ControlMultiRegionAccessPointPolicyDocumentsUpdateSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * S3ControlMultiRegionAccessPointPolicyDocuments_Update.json + */ + /** + * Sample code: S3ControlMultiRegionAccessPointPolicyDocuments_Update. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void s3ControlMultiRegionAccessPointPolicyDocumentsUpdate( + com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + S3ControlMultiRegionAccessPointPolicyDocument resource + = manager.s3ControlMultiRegionAccessPointPolicyDocuments() + .getByResourceGroupWithResponse("rgs3ControlMultiRegionAccessPointPolicyDocument", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE) + .getValue(); + resource.update().withTags(mapOf("key9280", "fakeTokenPlaceholder")).apply(); + } + + // Use "Map.of" if available + @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/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/SageMakerAppsCreateOrReplaceSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/SageMakerAppsCreateOrReplaceSamples.java new file mode 100644 index 000000000000..a58ce26557db --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/SageMakerAppsCreateOrReplaceSamples.java @@ -0,0 +1,70 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +import com.azure.resourcemanager.awsconnector.models.AppType; +import com.azure.resourcemanager.awsconnector.models.AwsSageMakerAppProperties; +import com.azure.resourcemanager.awsconnector.models.ResourceSpec; +import com.azure.resourcemanager.awsconnector.models.ResourceSpecInstanceType; +import com.azure.resourcemanager.awsconnector.models.SageMakerAppProperties; +import com.azure.resourcemanager.awsconnector.models.TagAutoGenerated51; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for SageMakerApps CreateOrReplace. + */ +public final class SageMakerAppsCreateOrReplaceSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * SageMakerApps_CreateOrReplace.json + */ + /** + * Sample code: SageMakerApps_CreateOrReplace. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + sageMakerAppsCreateOrReplace(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.sageMakerApps() + .define("Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])") + .withRegion("wnlhgbkbelgwiwhnismoau") + .withExistingResourceGroup("rgsageMakerApp") + .withTags(mapOf("key3532", "fakeTokenPlaceholder")) + .withProperties(new SageMakerAppProperties() + .withAwsProperties(new AwsSageMakerAppProperties().withAppArn("gher") + .withAppName("evzkcyynebo") + .withAppType(AppType.CANVAS) + .withDomainId("dkqxukvimzaw") + .withResourceSpec(new ResourceSpec().withInstanceType(ResourceSpecInstanceType.ML_C5_12XLARGE) + .withSageMakerImageArn("pgukixbhpruaz") + .withSageMakerImageVersionArn("juqpu")) + .withTags( + Arrays.asList(new TagAutoGenerated51().withKey("fakeTokenPlaceholder").withValue("oiirwwaoqv"))) + .withUserProfileName("hqjtakkgaetxvrmswgdzfbnna")) + .withPublicCloudConnectorsResourceId("vaphifjjavrvy") + .withAwsAccountId("lgqcehdauhqdqezactw") + .withArn("jlzaozimvtjn") + .withPublicCloudResourceName("ptlnykuziapscweekj") + .withAwsSourceSchema("xshoewjusdxuy") + .withAwsRegion("tnogtlqasqlenkt") + .withAwsTags(mapOf("key2126", "fakeTokenPlaceholder"))) + .create(); + } + + // Use "Map.of" if available + @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/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/SageMakerAppsDeleteSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/SageMakerAppsDeleteSamples.java new file mode 100644 index 000000000000..112ac409cf8f --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/SageMakerAppsDeleteSamples.java @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +/** + * Samples for SageMakerApps Delete. + */ +public final class SageMakerAppsDeleteSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * SageMakerApps_Delete.json + */ + /** + * Sample code: SageMakerApps_Delete. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void sageMakerAppsDelete(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.sageMakerApps() + .delete("rgsageMakerApp", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/SageMakerAppsGetByResourceGroupSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/SageMakerAppsGetByResourceGroupSamples.java new file mode 100644 index 000000000000..73ae6b7a26fc --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/SageMakerAppsGetByResourceGroupSamples.java @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +/** + * Samples for SageMakerApps GetByResourceGroup. + */ +public final class SageMakerAppsGetByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/SageMakerApps_Get. + * json + */ + /** + * Sample code: SageMakerApps_Get. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void sageMakerAppsGet(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.sageMakerApps() + .getByResourceGroupWithResponse("rgsageMakerApp", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/SageMakerAppsListByResourceGroupSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/SageMakerAppsListByResourceGroupSamples.java new file mode 100644 index 000000000000..c3e68dcdab7f --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/SageMakerAppsListByResourceGroupSamples.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +/** + * Samples for SageMakerApps ListByResourceGroup. + */ +public final class SageMakerAppsListByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * SageMakerApps_ListByResourceGroup.json + */ + /** + * Sample code: SageMakerApps_ListByResourceGroup. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + sageMakerAppsListByResourceGroup(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.sageMakerApps().listByResourceGroup("rgsageMakerApp", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/SageMakerAppsListSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/SageMakerAppsListSamples.java new file mode 100644 index 000000000000..c1b7ecd55445 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/SageMakerAppsListSamples.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +/** + * Samples for SageMakerApps List. + */ +public final class SageMakerAppsListSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * SageMakerApps_ListBySubscription.json + */ + /** + * Sample code: SageMakerApps_ListBySubscription. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + sageMakerAppsListBySubscription(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.sageMakerApps().list(com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/SageMakerAppsUpdateSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/SageMakerAppsUpdateSamples.java new file mode 100644 index 000000000000..58e366aaa087 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/SageMakerAppsUpdateSamples.java @@ -0,0 +1,45 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +import com.azure.resourcemanager.awsconnector.models.SageMakerApp; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for SageMakerApps Update. + */ +public final class SageMakerAppsUpdateSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * SageMakerApps_Update.json + */ + /** + * Sample code: SageMakerApps_Update. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void sageMakerAppsUpdate(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + SageMakerApp resource = manager.sageMakerApps() + .getByResourceGroupWithResponse("rgsageMakerApp", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE) + .getValue(); + resource.update().withTags(mapOf("key854", "fakeTokenPlaceholder")).apply(); + } + + // Use "Map.of" if available + @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/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/SageMakerNotebookInstanceSummariesCreateOrReplaceSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/SageMakerNotebookInstanceSummariesCreateOrReplaceSamples.java new file mode 100644 index 000000000000..7056dc749237 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/SageMakerNotebookInstanceSummariesCreateOrReplaceSamples.java @@ -0,0 +1,75 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +import com.azure.resourcemanager.awsconnector.models.AwsSageMakerNotebookInstanceSummaryProperties; +import com.azure.resourcemanager.awsconnector.models.InstanceType; +import com.azure.resourcemanager.awsconnector.models.InstanceTypeEnumValue; +import com.azure.resourcemanager.awsconnector.models.NotebookInstanceStatus; +import com.azure.resourcemanager.awsconnector.models.NotebookInstanceStatusEnumValue; +import com.azure.resourcemanager.awsconnector.models.SageMakerNotebookInstanceSummaryProperties; +import java.time.OffsetDateTime; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for SageMakerNotebookInstanceSummaries CreateOrReplace. + */ +public final class SageMakerNotebookInstanceSummariesCreateOrReplaceSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * SageMakerNotebookInstanceSummaries_CreateOrReplace.json + */ + /** + * Sample code: SageMakerNotebookInstanceSummaries_CreateOrReplace. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void sageMakerNotebookInstanceSummariesCreateOrReplace( + com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.sageMakerNotebookInstanceSummaries() + .define("Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])") + .withRegion("khdjmafoabcvhksslfjtzlyh") + .withExistingResourceGroup("rgsageMakerNotebookInstanceSummary") + .withTags(mapOf("key9470", "fakeTokenPlaceholder")) + .withProperties( + new SageMakerNotebookInstanceSummaryProperties() + .withAwsProperties(new AwsSageMakerNotebookInstanceSummaryProperties() + .withAdditionalCodeRepositories(Arrays.asList("pkjwtq")) + .withCreationTime(OffsetDateTime.parse("2024-10-08T03:50:00.672Z")) + .withDefaultCodeRepository("fakeTokenPlaceholder") + .withInstanceType( + new InstanceTypeEnumValue().withValue(InstanceType.fromString("ml.c4.2xlarge"))) + .withLastModifiedTime(OffsetDateTime.parse("2024-10-08T03:50:00.673Z")) + .withNotebookInstanceArn("wxrcvukcvvtd") + .withNotebookInstanceLifecycleConfigName("t") + .withNotebookInstanceName("nwemhcydnbtwmti") + .withNotebookInstanceStatus( + new NotebookInstanceStatusEnumValue().withValue(NotebookInstanceStatus.DELETING)) + .withUrl("ricclxhpsojfujeolzbg")) + .withPublicCloudConnectorsResourceId("khlyjmgts") + .withAwsAccountId("ymlnxodvrwztwew") + .withArn("ncvgnrtwmjxungpgrodvsy") + .withPublicCloudResourceName("ocd") + .withAwsSourceSchema("gqddonfcsn") + .withAwsRegion("oqykvfkrsmwkvszj") + .withAwsTags(mapOf("key4152", "fakeTokenPlaceholder"))) + .create(); + } + + // Use "Map.of" if available + @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/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/SageMakerNotebookInstanceSummariesDeleteSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/SageMakerNotebookInstanceSummariesDeleteSamples.java new file mode 100644 index 000000000000..3d811cbfd78d --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/SageMakerNotebookInstanceSummariesDeleteSamples.java @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +/** + * Samples for SageMakerNotebookInstanceSummaries Delete. + */ +public final class SageMakerNotebookInstanceSummariesDeleteSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * SageMakerNotebookInstanceSummaries_Delete.json + */ + /** + * Sample code: SageMakerNotebookInstanceSummaries_Delete. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + sageMakerNotebookInstanceSummariesDelete(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.sageMakerNotebookInstanceSummaries() + .delete("rgsageMakerNotebookInstanceSummary", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/SageMakerNotebookInstanceSummariesGetByResourceGroupSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/SageMakerNotebookInstanceSummariesGetByResourceGroupSamples.java new file mode 100644 index 000000000000..4351822b6c9f --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/SageMakerNotebookInstanceSummariesGetByResourceGroupSamples.java @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +/** + * Samples for SageMakerNotebookInstanceSummaries GetByResourceGroup. + */ +public final class SageMakerNotebookInstanceSummariesGetByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * SageMakerNotebookInstanceSummaries_Get.json + */ + /** + * Sample code: SageMakerNotebookInstanceSummaries_Get. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + sageMakerNotebookInstanceSummariesGet(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.sageMakerNotebookInstanceSummaries() + .getByResourceGroupWithResponse("rgsageMakerNotebookInstanceSummary", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/SageMakerNotebookInstanceSummariesListByResourceGroupSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/SageMakerNotebookInstanceSummariesListByResourceGroupSamples.java new file mode 100644 index 000000000000..852356a59712 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/SageMakerNotebookInstanceSummariesListByResourceGroupSamples.java @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +/** + * Samples for SageMakerNotebookInstanceSummaries ListByResourceGroup. + */ +public final class SageMakerNotebookInstanceSummariesListByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * SageMakerNotebookInstanceSummaries_ListByResourceGroup.json + */ + /** + * Sample code: SageMakerNotebookInstanceSummaries_ListByResourceGroup. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void sageMakerNotebookInstanceSummariesListByResourceGroup( + com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.sageMakerNotebookInstanceSummaries() + .listByResourceGroup("rgsageMakerNotebookInstanceSummary", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/SageMakerNotebookInstanceSummariesListSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/SageMakerNotebookInstanceSummariesListSamples.java new file mode 100644 index 000000000000..98c64d1351b6 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/SageMakerNotebookInstanceSummariesListSamples.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +/** + * Samples for SageMakerNotebookInstanceSummaries List. + */ +public final class SageMakerNotebookInstanceSummariesListSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * SageMakerNotebookInstanceSummaries_ListBySubscription.json + */ + /** + * Sample code: SageMakerNotebookInstanceSummaries_ListBySubscription. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void sageMakerNotebookInstanceSummariesListBySubscription( + com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.sageMakerNotebookInstanceSummaries().list(com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/SageMakerNotebookInstanceSummariesUpdateSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/SageMakerNotebookInstanceSummariesUpdateSamples.java new file mode 100644 index 000000000000..20d6cf1c2971 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/SageMakerNotebookInstanceSummariesUpdateSamples.java @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +import com.azure.resourcemanager.awsconnector.models.SageMakerNotebookInstanceSummary; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for SageMakerNotebookInstanceSummaries Update. + */ +public final class SageMakerNotebookInstanceSummariesUpdateSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * SageMakerNotebookInstanceSummaries_Update.json + */ + /** + * Sample code: SageMakerNotebookInstanceSummaries_Update. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + sageMakerNotebookInstanceSummariesUpdate(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + SageMakerNotebookInstanceSummary resource = manager.sageMakerNotebookInstanceSummaries() + .getByResourceGroupWithResponse("rgsageMakerNotebookInstanceSummary", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE) + .getValue(); + resource.update().withTags(mapOf("key9780", "fakeTokenPlaceholder")).apply(); + } + + // Use "Map.of" if available + @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/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/SecretsManagerResourcePoliciesCreateOrReplaceSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/SecretsManagerResourcePoliciesCreateOrReplaceSamples.java new file mode 100644 index 000000000000..893a46b81c02 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/SecretsManagerResourcePoliciesCreateOrReplaceSamples.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.awsconnector.generated; + +import com.azure.resourcemanager.awsconnector.models.AwsSecretsManagerResourcePolicyProperties; +import com.azure.resourcemanager.awsconnector.models.SecretsManagerResourcePolicyProperties; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for SecretsManagerResourcePolicies CreateOrReplace. + */ +public final class SecretsManagerResourcePoliciesCreateOrReplaceSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * SecretsManagerResourcePolicies_CreateOrReplace.json + */ + /** + * Sample code: SecretsManagerResourcePolicies_CreateOrReplace. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void secretsManagerResourcePoliciesCreateOrReplace( + com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.secretsManagerResourcePolicies() + .define("Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])") + .withRegion("znrmqmz") + .withExistingResourceGroup("rgsecretsManagerResourcePolicy") + .withTags(mapOf("key6501", "fakeTokenPlaceholder")) + .withProperties(new SecretsManagerResourcePolicyProperties() + .withAwsProperties(new AwsSecretsManagerResourcePolicyProperties().withBlockPublicPolicy(true) + .withId("hrvehsjtj") + .withSecretId("fakeTokenPlaceholder")) + .withPublicCloudConnectorsResourceId("isvozhenarlkfvvrujywfu") + .withAwsAccountId("bswnezmdsuirkrgzmxxjsjo") + .withArn("cvtearqpmshhlnuxxvmsejrzpqsekj") + .withPublicCloudResourceName("vtrpmkekofucehtns") + .withAwsSourceSchema("gkmussnnnguicaskcuprrkexb") + .withAwsRegion("kpcxxfwomoxngnrmkpregcz") + .withAwsTags(mapOf("key958", "fakeTokenPlaceholder"))) + .create(); + } + + // Use "Map.of" if available + @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/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/SecretsManagerResourcePoliciesDeleteSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/SecretsManagerResourcePoliciesDeleteSamples.java new file mode 100644 index 000000000000..a4cd176c4d1f --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/SecretsManagerResourcePoliciesDeleteSamples.java @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +/** + * Samples for SecretsManagerResourcePolicies Delete. + */ +public final class SecretsManagerResourcePoliciesDeleteSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * SecretsManagerResourcePolicies_Delete.json + */ + /** + * Sample code: SecretsManagerResourcePolicies_Delete. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + secretsManagerResourcePoliciesDelete(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.secretsManagerResourcePolicies() + .delete("rgsecretsManagerResourcePolicy", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/SecretsManagerResourcePoliciesGetByResourceGroupSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/SecretsManagerResourcePoliciesGetByResourceGroupSamples.java new file mode 100644 index 000000000000..4376507dfa84 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/SecretsManagerResourcePoliciesGetByResourceGroupSamples.java @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +/** + * Samples for SecretsManagerResourcePolicies GetByResourceGroup. + */ +public final class SecretsManagerResourcePoliciesGetByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * SecretsManagerResourcePolicies_Get.json + */ + /** + * Sample code: SecretsManagerResourcePolicies_Get. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + secretsManagerResourcePoliciesGet(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.secretsManagerResourcePolicies() + .getByResourceGroupWithResponse("rgsecretsManagerResourcePolicy", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/SecretsManagerResourcePoliciesListByResourceGroupSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/SecretsManagerResourcePoliciesListByResourceGroupSamples.java new file mode 100644 index 000000000000..11b9e9fbd0f3 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/SecretsManagerResourcePoliciesListByResourceGroupSamples.java @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +/** + * Samples for SecretsManagerResourcePolicies ListByResourceGroup. + */ +public final class SecretsManagerResourcePoliciesListByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * SecretsManagerResourcePolicies_ListByResourceGroup.json + */ + /** + * Sample code: SecretsManagerResourcePolicies_ListByResourceGroup. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void secretsManagerResourcePoliciesListByResourceGroup( + com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.secretsManagerResourcePolicies() + .listByResourceGroup("rgsecretsManagerResourcePolicy", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/SecretsManagerResourcePoliciesListSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/SecretsManagerResourcePoliciesListSamples.java new file mode 100644 index 000000000000..e999f7bc5239 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/SecretsManagerResourcePoliciesListSamples.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +/** + * Samples for SecretsManagerResourcePolicies List. + */ +public final class SecretsManagerResourcePoliciesListSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * SecretsManagerResourcePolicies_ListBySubscription.json + */ + /** + * Sample code: SecretsManagerResourcePolicies_ListBySubscription. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void secretsManagerResourcePoliciesListBySubscription( + com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.secretsManagerResourcePolicies().list(com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/SecretsManagerResourcePoliciesUpdateSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/SecretsManagerResourcePoliciesUpdateSamples.java new file mode 100644 index 000000000000..df09310ae40d --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/SecretsManagerResourcePoliciesUpdateSamples.java @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +import com.azure.resourcemanager.awsconnector.models.SecretsManagerResourcePolicy; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for SecretsManagerResourcePolicies Update. + */ +public final class SecretsManagerResourcePoliciesUpdateSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * SecretsManagerResourcePolicies_Update.json + */ + /** + * Sample code: SecretsManagerResourcePolicies_Update. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + secretsManagerResourcePoliciesUpdate(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + SecretsManagerResourcePolicy resource = manager.secretsManagerResourcePolicies() + .getByResourceGroupWithResponse("rgsecretsManagerResourcePolicy", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE) + .getValue(); + resource.update().withTags(mapOf("key8052", "fakeTokenPlaceholder")).apply(); + } + + // Use "Map.of" if available + @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/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/SecretsManagerSecretsCreateOrReplaceSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/SecretsManagerSecretsCreateOrReplaceSamples.java new file mode 100644 index 000000000000..557420bb954a --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/SecretsManagerSecretsCreateOrReplaceSamples.java @@ -0,0 +1,80 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +import com.azure.resourcemanager.awsconnector.models.AwsSecretsManagerSecretProperties; +import com.azure.resourcemanager.awsconnector.models.GenerateSecretString; +import com.azure.resourcemanager.awsconnector.models.ReplicaRegion; +import com.azure.resourcemanager.awsconnector.models.SecretsManagerSecretProperties; +import com.azure.resourcemanager.awsconnector.models.TagAutoGenerated52; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for SecretsManagerSecrets CreateOrReplace. + */ +public final class SecretsManagerSecretsCreateOrReplaceSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * SecretsManagerSecrets_CreateOrReplace.json + */ + /** + * Sample code: SecretsManagerSecrets_CreateOrReplace. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + secretsManagerSecretsCreateOrReplace(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.secretsManagerSecrets() + .define("Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])") + .withRegion("balqdxuifwdmtcinyxjit") + .withExistingResourceGroup("rgsecretsManagerSecret") + .withTags(mapOf("key1461", "fakeTokenPlaceholder")) + .withProperties( + new SecretsManagerSecretProperties() + .withAwsProperties( + new AwsSecretsManagerSecretProperties().withDescription("esljjbmcrcqe") + .withGenerateSecretString(new GenerateSecretString().withExcludeCharacters("hsixzpgawn") + .withExcludeLowercase(true) + .withExcludeNumbers(true) + .withExcludePunctuation(true) + .withExcludeUppercase(true) + .withGenerateStringKey("fakeTokenPlaceholder") + .withIncludeSpace(true) + .withPasswordLength(17) + .withRequireEachIncludedType(true) + .withSecretStringTemplate("fakeTokenPlaceholder")) + .withId("vpnzmovjfbrltixnsgeml") + .withKmsKeyId("fakeTokenPlaceholder") + .withName("jqmtr") + .withReplicaRegions( + Arrays.asList(new ReplicaRegion().withKmsKeyId("fakeTokenPlaceholder").withRegion("m"))) + .withSecretString("fakeTokenPlaceholder") + .withTags(Arrays + .asList(new TagAutoGenerated52().withKey("fakeTokenPlaceholder").withValue("wrci")))) + .withPublicCloudConnectorsResourceId("osnofxgmgmrsc") + .withAwsAccountId("wtxdsgybisrqopffdhreyacjrysd") + .withArn("qxrdtehsmibehk") + .withPublicCloudResourceName("wj") + .withAwsSourceSchema("whhfrjfzgejfasbcycqe") + .withAwsRegion("mw") + .withAwsTags(mapOf("key4141", "fakeTokenPlaceholder"))) + .create(); + } + + // Use "Map.of" if available + @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/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/SecretsManagerSecretsDeleteSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/SecretsManagerSecretsDeleteSamples.java new file mode 100644 index 000000000000..10f1dc6cea31 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/SecretsManagerSecretsDeleteSamples.java @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +/** + * Samples for SecretsManagerSecrets Delete. + */ +public final class SecretsManagerSecretsDeleteSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * SecretsManagerSecrets_Delete.json + */ + /** + * Sample code: SecretsManagerSecrets_Delete. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void secretsManagerSecretsDelete(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.secretsManagerSecrets() + .delete("rgsecretsManagerSecret", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/SecretsManagerSecretsGetByResourceGroupSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/SecretsManagerSecretsGetByResourceGroupSamples.java new file mode 100644 index 000000000000..0cdcf97f0a22 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/SecretsManagerSecretsGetByResourceGroupSamples.java @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +/** + * Samples for SecretsManagerSecrets GetByResourceGroup. + */ +public final class SecretsManagerSecretsGetByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * SecretsManagerSecrets_Get.json + */ + /** + * Sample code: SecretsManagerSecrets_Get. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void secretsManagerSecretsGet(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.secretsManagerSecrets() + .getByResourceGroupWithResponse("rgsecretsManagerSecret", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/SecretsManagerSecretsListByResourceGroupSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/SecretsManagerSecretsListByResourceGroupSamples.java new file mode 100644 index 000000000000..a5c073741313 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/SecretsManagerSecretsListByResourceGroupSamples.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +/** + * Samples for SecretsManagerSecrets ListByResourceGroup. + */ +public final class SecretsManagerSecretsListByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * SecretsManagerSecrets_ListByResourceGroup.json + */ + /** + * Sample code: SecretsManagerSecrets_ListByResourceGroup. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + secretsManagerSecretsListByResourceGroup(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.secretsManagerSecrets().listByResourceGroup("rgsecretsManagerSecret", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/SecretsManagerSecretsListSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/SecretsManagerSecretsListSamples.java new file mode 100644 index 000000000000..166c2f5132cd --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/SecretsManagerSecretsListSamples.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +/** + * Samples for SecretsManagerSecrets List. + */ +public final class SecretsManagerSecretsListSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * SecretsManagerSecrets_ListBySubscription.json + */ + /** + * Sample code: SecretsManagerSecrets_ListBySubscription. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + secretsManagerSecretsListBySubscription(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.secretsManagerSecrets().list(com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/SecretsManagerSecretsUpdateSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/SecretsManagerSecretsUpdateSamples.java new file mode 100644 index 000000000000..d686a5787d93 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/SecretsManagerSecretsUpdateSamples.java @@ -0,0 +1,45 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +import com.azure.resourcemanager.awsconnector.models.SecretsManagerSecret; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for SecretsManagerSecrets Update. + */ +public final class SecretsManagerSecretsUpdateSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * SecretsManagerSecrets_Update.json + */ + /** + * Sample code: SecretsManagerSecrets_Update. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void secretsManagerSecretsUpdate(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + SecretsManagerSecret resource = manager.secretsManagerSecrets() + .getByResourceGroupWithResponse("rgsecretsManagerSecret", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE) + .getValue(); + resource.update().withTags(mapOf("key5629", "fakeTokenPlaceholder")).apply(); + } + + // Use "Map.of" if available + @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/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/SnsSubscriptionsCreateOrReplaceSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/SnsSubscriptionsCreateOrReplaceSamples.java new file mode 100644 index 000000000000..cca09ac7af71 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/SnsSubscriptionsCreateOrReplaceSamples.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.awsconnector.generated; + +import com.azure.resourcemanager.awsconnector.models.AwsSnsSubscriptionProperties; +import com.azure.resourcemanager.awsconnector.models.SnsSubscriptionProperties; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for SnsSubscriptions CreateOrReplace. + */ +public final class SnsSubscriptionsCreateOrReplaceSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * SnsSubscriptions_CreateOrReplace.json + */ + /** + * Sample code: SnsSubscriptions_CreateOrReplace. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + snsSubscriptionsCreateOrReplace(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.snsSubscriptions() + .define("Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])") + .withRegion("rteaofwy") + .withExistingResourceGroup("rgsnsSubscription") + .withTags(mapOf("key2041", "fakeTokenPlaceholder")) + .withProperties(new SnsSubscriptionProperties() + .withAwsProperties(new AwsSnsSubscriptionProperties().withEndpoint("ydbnfs") + .withOwner("vhrbkplsbvszhibsvziz") + .withProtocol("lcsebez") + .withSubscriptionArn("bis") + .withTopicArn("pdwndjemgtmwwnyvtjmveblsyq")) + .withPublicCloudConnectorsResourceId("zokwlgincdzvjml") + .withAwsAccountId("jehvmisbfwgnpihgfrkslaee") + .withArn("gnkqmddvoxalgskfwispx") + .withPublicCloudResourceName("si") + .withAwsSourceSchema("ikrkjsw") + .withAwsRegion("bkkaopxcwtfmxemxuilfhllcsixga") + .withAwsTags(mapOf("key588", "fakeTokenPlaceholder"))) + .create(); + } + + // Use "Map.of" if available + @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/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/SnsSubscriptionsDeleteSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/SnsSubscriptionsDeleteSamples.java new file mode 100644 index 000000000000..dbfd5cb922be --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/SnsSubscriptionsDeleteSamples.java @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +/** + * Samples for SnsSubscriptions Delete. + */ +public final class SnsSubscriptionsDeleteSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * SnsSubscriptions_Delete.json + */ + /** + * Sample code: SnsSubscriptions_Delete. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void snsSubscriptionsDelete(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.snsSubscriptions() + .delete("rgsnsSubscription", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/SnsSubscriptionsGetByResourceGroupSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/SnsSubscriptionsGetByResourceGroupSamples.java new file mode 100644 index 000000000000..63ff9ddae600 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/SnsSubscriptionsGetByResourceGroupSamples.java @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +/** + * Samples for SnsSubscriptions GetByResourceGroup. + */ +public final class SnsSubscriptionsGetByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * SnsSubscriptions_Get.json + */ + /** + * Sample code: SnsSubscriptions_Get. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void snsSubscriptionsGet(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.snsSubscriptions() + .getByResourceGroupWithResponse("rgsnsSubscription", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/SnsSubscriptionsListByResourceGroupSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/SnsSubscriptionsListByResourceGroupSamples.java new file mode 100644 index 000000000000..253eaa102dba --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/SnsSubscriptionsListByResourceGroupSamples.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +/** + * Samples for SnsSubscriptions ListByResourceGroup. + */ +public final class SnsSubscriptionsListByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * SnsSubscriptions_ListByResourceGroup.json + */ + /** + * Sample code: SnsSubscriptions_ListByResourceGroup. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + snsSubscriptionsListByResourceGroup(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.snsSubscriptions().listByResourceGroup("rgsnsSubscription", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/SnsSubscriptionsListSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/SnsSubscriptionsListSamples.java new file mode 100644 index 000000000000..8848f9207050 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/SnsSubscriptionsListSamples.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +/** + * Samples for SnsSubscriptions List. + */ +public final class SnsSubscriptionsListSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * SnsSubscriptions_ListBySubscription.json + */ + /** + * Sample code: SnsSubscriptions_ListBySubscription. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + snsSubscriptionsListBySubscription(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.snsSubscriptions().list(com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/SnsSubscriptionsUpdateSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/SnsSubscriptionsUpdateSamples.java new file mode 100644 index 000000000000..670ab483a2a3 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/SnsSubscriptionsUpdateSamples.java @@ -0,0 +1,45 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +import com.azure.resourcemanager.awsconnector.models.SnsSubscription; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for SnsSubscriptions Update. + */ +public final class SnsSubscriptionsUpdateSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * SnsSubscriptions_Update.json + */ + /** + * Sample code: SnsSubscriptions_Update. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void snsSubscriptionsUpdate(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + SnsSubscription resource = manager.snsSubscriptions() + .getByResourceGroupWithResponse("rgsnsSubscription", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE) + .getValue(); + resource.update().withTags(mapOf("key2758", "fakeTokenPlaceholder")).apply(); + } + + // Use "Map.of" if available + @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/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/SnsTopicsCreateOrReplaceSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/SnsTopicsCreateOrReplaceSamples.java new file mode 100644 index 000000000000..9b91219ca0a1 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/SnsTopicsCreateOrReplaceSamples.java @@ -0,0 +1,76 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +import com.azure.resourcemanager.awsconnector.models.AwsSnsTopicProperties; +import com.azure.resourcemanager.awsconnector.models.LoggingConfigAutoGenerated; +import com.azure.resourcemanager.awsconnector.models.LoggingConfigProtocol; +import com.azure.resourcemanager.awsconnector.models.SnsTopicProperties; +import com.azure.resourcemanager.awsconnector.models.Subscription; +import com.azure.resourcemanager.awsconnector.models.TagAutoGenerated53; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for SnsTopics CreateOrReplace. + */ +public final class SnsTopicsCreateOrReplaceSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * SnsTopics_CreateOrReplace.json + */ + /** + * Sample code: SnsTopics_CreateOrReplace. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void snsTopicsCreateOrReplace(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.snsTopics() + .define("Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])") + .withRegion("vzzjtyjhqbty") + .withExistingResourceGroup("rgsnsTopic") + .withTags(mapOf("key5456", "fakeTokenPlaceholder")) + .withProperties(new SnsTopicProperties() + .withAwsProperties(new AwsSnsTopicProperties().withContentBasedDeduplication(true) + .withDeliveryStatusLogging(Arrays + .asList(new LoggingConfigAutoGenerated().withFailureFeedbackRoleArn("ygtlmetldtzqhoasmdit") + .withProtocol(LoggingConfigProtocol.APPLICATION) + .withSuccessFeedbackRoleArn("ersgnxrmfnrqhmyilsomcxxlza") + .withSuccessFeedbackSampleRate("iudedzrjawqzroytyyonpydzjzzmlj"))) + .withDisplayName("sanmplpvkvcorlhraijepxftlyeqwj") + .withFifoTopic(true) + .withKmsMasterKeyId("fakeTokenPlaceholder") + .withSignatureVersion("lpfgizlw") + .withSubscription(Arrays.asList( + new Subscription().withEndpoint("yuvwciasnlpnswnynse").withProtocol("zohpkxrrouufioztdmkw"))) + .withTags(Arrays.asList(new TagAutoGenerated53().withKey("fakeTokenPlaceholder") + .withValue("bxdamnevuybindqttmfvzotzqboj"))) + .withTopicArn("owersxkcdlhhnawxkmqlcjlzqlxtmj") + .withTopicName("lijmdexuvnfby") + .withTracingConfig("yrpvxmefnaexobhqvtdrj")) + .withPublicCloudConnectorsResourceId("didnyoylzwmnsjudmfwojgtjqsuypn") + .withAwsAccountId("wndmunvvkmoyxlrbsnowo") + .withArn("jjhuxiyhej") + .withPublicCloudResourceName("vwncs") + .withAwsSourceSchema("sxholwzdshjzccfoioytctdmjrmlpo") + .withAwsRegion("qbpwpfnzmmkh") + .withAwsTags(mapOf("key2577", "fakeTokenPlaceholder"))) + .create(); + } + + // Use "Map.of" if available + @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/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/SnsTopicsDeleteSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/SnsTopicsDeleteSamples.java new file mode 100644 index 000000000000..25dce7c9464e --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/SnsTopicsDeleteSamples.java @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +/** + * Samples for SnsTopics Delete. + */ +public final class SnsTopicsDeleteSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/SnsTopics_Delete. + * json + */ + /** + * Sample code: SnsTopics_Delete. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void snsTopicsDelete(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.snsTopics() + .delete("rgsnsTopic", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/SnsTopicsGetByResourceGroupSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/SnsTopicsGetByResourceGroupSamples.java new file mode 100644 index 000000000000..88104a4e8480 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/SnsTopicsGetByResourceGroupSamples.java @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +/** + * Samples for SnsTopics GetByResourceGroup. + */ +public final class SnsTopicsGetByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/SnsTopics_Get.json + */ + /** + * Sample code: SnsTopics_Get. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void snsTopicsGet(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.snsTopics() + .getByResourceGroupWithResponse("rgsnsTopic", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/SnsTopicsListByResourceGroupSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/SnsTopicsListByResourceGroupSamples.java new file mode 100644 index 000000000000..9d38c063888b --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/SnsTopicsListByResourceGroupSamples.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +/** + * Samples for SnsTopics ListByResourceGroup. + */ +public final class SnsTopicsListByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * SnsTopics_ListByResourceGroup.json + */ + /** + * Sample code: SnsTopics_ListByResourceGroup. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + snsTopicsListByResourceGroup(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.snsTopics().listByResourceGroup("rgsnsTopic", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/SnsTopicsListSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/SnsTopicsListSamples.java new file mode 100644 index 000000000000..9103fbee53f1 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/SnsTopicsListSamples.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.awsconnector.generated; + +/** + * Samples for SnsTopics List. + */ +public final class SnsTopicsListSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * SnsTopics_ListBySubscription.json + */ + /** + * Sample code: SnsTopics_ListBySubscription. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void snsTopicsListBySubscription(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.snsTopics().list(com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/SnsTopicsUpdateSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/SnsTopicsUpdateSamples.java new file mode 100644 index 000000000000..7051ada69420 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/SnsTopicsUpdateSamples.java @@ -0,0 +1,45 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +import com.azure.resourcemanager.awsconnector.models.SnsTopic; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for SnsTopics Update. + */ +public final class SnsTopicsUpdateSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/SnsTopics_Update. + * json + */ + /** + * Sample code: SnsTopics_Update. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void snsTopicsUpdate(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + SnsTopic resource = manager.snsTopics() + .getByResourceGroupWithResponse("rgsnsTopic", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE) + .getValue(); + resource.update().withTags(mapOf("key169", "fakeTokenPlaceholder")).apply(); + } + + // Use "Map.of" if available + @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/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/SqsQueuesCreateOrReplaceSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/SqsQueuesCreateOrReplaceSamples.java new file mode 100644 index 000000000000..a738b7d25040 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/SqsQueuesCreateOrReplaceSamples.java @@ -0,0 +1,76 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +import com.azure.resourcemanager.awsconnector.models.AwsSqsQueueProperties; +import com.azure.resourcemanager.awsconnector.models.SqsQueueProperties; +import com.azure.resourcemanager.awsconnector.models.TagAutoGenerated54; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for SqsQueues CreateOrReplace. + */ +public final class SqsQueuesCreateOrReplaceSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * SqsQueues_CreateOrReplace.json + */ + /** + * Sample code: SqsQueues_CreateOrReplace. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void sqsQueuesCreateOrReplace(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.sqsQueues() + .define("Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])") + .withRegion("fqdcgrb") + .withExistingResourceGroup("rgsqsQueue") + .withTags(mapOf("key7215", "fakeTokenPlaceholder")) + .withProperties( + new SqsQueueProperties() + .withAwsProperties(new AwsSqsQueueProperties().withArn("inbbhuaqgvjzwgepxaejncp") + .withContentBasedDeduplication(true) + .withDeduplicationScope("chijpjniyonhtrbqaojc") + .withDelaySeconds(22) + .withFifoQueue(true) + .withFifoThroughputLimit("vzanxuahrdoqizyblwtvse") + .withKmsDataKeyReusePeriodSeconds(1) + .withKmsMasterKeyId("fakeTokenPlaceholder") + .withMaximumMessageSize(19) + .withMessageRetentionPeriod(29) + .withQueueName("wfzhdsdzszyxfgptplvduwr") + .withQueueUrl("drfgltnvn") + .withReceiveMessageWaitTimeSeconds(4) + .withRedriveAllowPolicy(mapOf()) + .withRedrivePolicy(mapOf()) + .withSqsManagedSseEnabled(true) + .withTags(Arrays + .asList(new TagAutoGenerated54().withKey("fakeTokenPlaceholder").withValue("nxjcfolrd"))) + .withVisibilityTimeout(2)) + .withPublicCloudConnectorsResourceId("uvqyizhqjdsnemqktjsgfmjhyw") + .withAwsAccountId("bzpgnzvrnsakbglgcvaalyaiocj") + .withArn("jalxzvcntv") + .withPublicCloudResourceName("izckbeceljsvepm") + .withAwsSourceSchema("jnthvapvjtoexig") + .withAwsRegion("ffdlbwzdurjlolipnjsycrmeqsg") + .withAwsTags(mapOf("key9800", "fakeTokenPlaceholder"))) + .create(); + } + + // Use "Map.of" if available + @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/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/SqsQueuesDeleteSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/SqsQueuesDeleteSamples.java new file mode 100644 index 000000000000..aaadc5b73a3e --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/SqsQueuesDeleteSamples.java @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +/** + * Samples for SqsQueues Delete. + */ +public final class SqsQueuesDeleteSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/SqsQueues_Delete. + * json + */ + /** + * Sample code: SqsQueues_Delete. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void sqsQueuesDelete(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.sqsQueues() + .delete("rgsqsQueue", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/SqsQueuesGetByResourceGroupSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/SqsQueuesGetByResourceGroupSamples.java new file mode 100644 index 000000000000..0853193c2a26 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/SqsQueuesGetByResourceGroupSamples.java @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +/** + * Samples for SqsQueues GetByResourceGroup. + */ +public final class SqsQueuesGetByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/SqsQueues_Get.json + */ + /** + * Sample code: SqsQueues_Get. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void sqsQueuesGet(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.sqsQueues() + .getByResourceGroupWithResponse("rgsqsQueue", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/SqsQueuesListByResourceGroupSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/SqsQueuesListByResourceGroupSamples.java new file mode 100644 index 000000000000..0619eb2c1a64 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/SqsQueuesListByResourceGroupSamples.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +/** + * Samples for SqsQueues ListByResourceGroup. + */ +public final class SqsQueuesListByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * SqsQueues_ListByResourceGroup.json + */ + /** + * Sample code: SqsQueues_ListByResourceGroup. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + sqsQueuesListByResourceGroup(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.sqsQueues().listByResourceGroup("rgsqsQueue", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/SqsQueuesListSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/SqsQueuesListSamples.java new file mode 100644 index 000000000000..ba004722ba7c --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/SqsQueuesListSamples.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.awsconnector.generated; + +/** + * Samples for SqsQueues List. + */ +public final class SqsQueuesListSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * SqsQueues_ListBySubscription.json + */ + /** + * Sample code: SqsQueues_ListBySubscription. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void sqsQueuesListBySubscription(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.sqsQueues().list(com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/SqsQueuesUpdateSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/SqsQueuesUpdateSamples.java new file mode 100644 index 000000000000..ab71d15a6c59 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/SqsQueuesUpdateSamples.java @@ -0,0 +1,45 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +import com.azure.resourcemanager.awsconnector.models.SqsQueue; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for SqsQueues Update. + */ +public final class SqsQueuesUpdateSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/SqsQueues_Update. + * json + */ + /** + * Sample code: SqsQueues_Update. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void sqsQueuesUpdate(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + SqsQueue resource = manager.sqsQueues() + .getByResourceGroupWithResponse("rgsqsQueue", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE) + .getValue(); + resource.update().withTags(mapOf("key7679", "fakeTokenPlaceholder")).apply(); + } + + // Use "Map.of" if available + @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/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/SsmInstanceInformationsCreateOrReplaceSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/SsmInstanceInformationsCreateOrReplaceSamples.java new file mode 100644 index 000000000000..77188b3d6822 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/SsmInstanceInformationsCreateOrReplaceSamples.java @@ -0,0 +1,93 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +import com.azure.resourcemanager.awsconnector.models.AwsSsmInstanceInformationProperties; +import com.azure.resourcemanager.awsconnector.models.InstanceAggregatedAssociationOverview; +import com.azure.resourcemanager.awsconnector.models.PingStatus; +import com.azure.resourcemanager.awsconnector.models.PingStatusEnumValue; +import com.azure.resourcemanager.awsconnector.models.PlatformType; +import com.azure.resourcemanager.awsconnector.models.PlatformTypeEnumValue; +import com.azure.resourcemanager.awsconnector.models.ResourceType; +import com.azure.resourcemanager.awsconnector.models.ResourceTypeEnumValue; +import com.azure.resourcemanager.awsconnector.models.SourceType; +import com.azure.resourcemanager.awsconnector.models.SourceTypeEnumValue; +import com.azure.resourcemanager.awsconnector.models.SsmInstanceInformationProperties; +import java.time.OffsetDateTime; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for SsmInstanceInformations CreateOrReplace. + */ +public final class SsmInstanceInformationsCreateOrReplaceSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * SsmInstanceInformations_CreateOrReplace.json + */ + /** + * Sample code: SsmInstanceInformations_CreateOrReplace. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + ssmInstanceInformationsCreateOrReplace(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.ssmInstanceInformations() + .define("Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])") + .withRegion("ermywoyxbvekjsddbgxzdiqctiy") + .withExistingResourceGroup("rgssmInstanceInformation") + .withTags(mapOf("key678", "fakeTokenPlaceholder")) + .withProperties( + new SsmInstanceInformationProperties() + .withAwsProperties( + new AwsSsmInstanceInformationProperties().withActivationId("wqzon") + .withAgentVersion("bnfjsoeipnlc") + .withAssociationOverview(new InstanceAggregatedAssociationOverview() + .withDetailedStatus("cbudhnfwcqmapsmzmdvjbnobfp") + .withInstanceAssociationStatusAggregatedCount(mapOf("key8401", 17))) + .withAssociationStatus("elhplvmlvhpwuyovunmrlynmhejdw") + .withComputerName("wweceaymirkelywqbxapvxzr") + .withIpAddress("httjvosg") + .withIamRole("izwdzmlugehvtmnssak") + .withInstanceId("iubqpfcejhxieuegbecgpkzanri") + .withIsLatestVersion(true) + .withLastAssociationExecutionDate(OffsetDateTime.parse("2024-10-08T03:53:10.068Z")) + .withLastPingDateTime(OffsetDateTime.parse("2024-10-08T03:53:10.068Z")) + .withLastSuccessfulAssociationExecutionDate( + OffsetDateTime.parse("2024-10-08T03:53:10.068Z")) + .withName("iubm") + .withPingStatus(new PingStatusEnumValue().withValue(PingStatus.CONNECTION_LOST)) + .withPlatformName("cbiheizlbfmmcdrsntrldk") + .withPlatformType(new PlatformTypeEnumValue().withValue(PlatformType.LINUX)) + .withPlatformVersion("eiopeklxdbhzvyxg") + .withRegistrationDate(OffsetDateTime.parse("2024-10-08T03:53:10.069Z")) + .withResourceType( + new ResourceTypeEnumValue().withValue(ResourceType.fromString("EC2Instance"))) + .withSourceId("mfupyczzkgmebrayfgrmxcdouve") + .withSourceType( + new SourceTypeEnumValue().withValue(SourceType.fromString("AWS::EC2::Instance")))) + .withPublicCloudConnectorsResourceId("hsdju") + .withAwsAccountId("pjfy") + .withArn("oxfqehraraycsdhslhhkjdu") + .withPublicCloudResourceName("nmnanlhecnocoemxsevyl") + .withAwsSourceSchema("wetpdek") + .withAwsRegion("mzethaciakqyywjomklr") + .withAwsTags(mapOf("key8309", "fakeTokenPlaceholder"))) + .create(); + } + + // Use "Map.of" if available + @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/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/SsmInstanceInformationsDeleteSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/SsmInstanceInformationsDeleteSamples.java new file mode 100644 index 000000000000..30d0b72679f7 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/SsmInstanceInformationsDeleteSamples.java @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +/** + * Samples for SsmInstanceInformations Delete. + */ +public final class SsmInstanceInformationsDeleteSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * SsmInstanceInformations_Delete.json + */ + /** + * Sample code: SsmInstanceInformations_Delete. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + ssmInstanceInformationsDelete(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.ssmInstanceInformations() + .delete("rgssmInstanceInformation", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/SsmInstanceInformationsGetByResourceGroupSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/SsmInstanceInformationsGetByResourceGroupSamples.java new file mode 100644 index 000000000000..f155e29a80cd --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/SsmInstanceInformationsGetByResourceGroupSamples.java @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +/** + * Samples for SsmInstanceInformations GetByResourceGroup. + */ +public final class SsmInstanceInformationsGetByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * SsmInstanceInformations_Get.json + */ + /** + * Sample code: SsmInstanceInformations_Get. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void ssmInstanceInformationsGet(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.ssmInstanceInformations() + .getByResourceGroupWithResponse("rgssmInstanceInformation", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/SsmInstanceInformationsListByResourceGroupSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/SsmInstanceInformationsListByResourceGroupSamples.java new file mode 100644 index 000000000000..126330c1715a --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/SsmInstanceInformationsListByResourceGroupSamples.java @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +/** + * Samples for SsmInstanceInformations ListByResourceGroup. + */ +public final class SsmInstanceInformationsListByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * SsmInstanceInformations_ListByResourceGroup.json + */ + /** + * Sample code: SsmInstanceInformations_ListByResourceGroup. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + ssmInstanceInformationsListByResourceGroup(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.ssmInstanceInformations() + .listByResourceGroup("rgssmInstanceInformation", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/SsmInstanceInformationsListSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/SsmInstanceInformationsListSamples.java new file mode 100644 index 000000000000..850f548b6f02 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/SsmInstanceInformationsListSamples.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +/** + * Samples for SsmInstanceInformations List. + */ +public final class SsmInstanceInformationsListSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * SsmInstanceInformations_ListBySubscription.json + */ + /** + * Sample code: SsmInstanceInformations_ListBySubscription. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + ssmInstanceInformationsListBySubscription(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.ssmInstanceInformations().list(com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/SsmInstanceInformationsUpdateSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/SsmInstanceInformationsUpdateSamples.java new file mode 100644 index 000000000000..65aaf0ce11a1 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/SsmInstanceInformationsUpdateSamples.java @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +import com.azure.resourcemanager.awsconnector.models.SsmInstanceInformation; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for SsmInstanceInformations Update. + */ +public final class SsmInstanceInformationsUpdateSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * SsmInstanceInformations_Update.json + */ + /** + * Sample code: SsmInstanceInformations_Update. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + ssmInstanceInformationsUpdate(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + SsmInstanceInformation resource = manager.ssmInstanceInformations() + .getByResourceGroupWithResponse("rgssmInstanceInformation", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE) + .getValue(); + resource.update().withTags(mapOf("key2080", "fakeTokenPlaceholder")).apply(); + } + + // Use "Map.of" if available + @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/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/SsmParametersCreateOrReplaceSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/SsmParametersCreateOrReplaceSamples.java new file mode 100644 index 000000000000..cf5b33ab0c1c --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/SsmParametersCreateOrReplaceSamples.java @@ -0,0 +1,66 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +import com.azure.resourcemanager.awsconnector.models.AwsSsmParameterProperties; +import com.azure.resourcemanager.awsconnector.models.DataType; +import com.azure.resourcemanager.awsconnector.models.SsmParameterProperties; +import com.azure.resourcemanager.awsconnector.models.Tier; +import com.azure.resourcemanager.awsconnector.models.Type; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for SsmParameters CreateOrReplace. + */ +public final class SsmParametersCreateOrReplaceSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * SsmParameters_CreateOrReplace.json + */ + /** + * Sample code: SsmParameters_CreateOrReplace. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + ssmParametersCreateOrReplace(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.ssmParameters() + .define("Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])") + .withRegion("ymzdygzdzd") + .withExistingResourceGroup("rgssmParameter") + .withTags(mapOf("key8492", "fakeTokenPlaceholder")) + .withProperties(new SsmParameterProperties() + .withAwsProperties(new AwsSsmParameterProperties().withAllowedPattern("fzyaodp") + .withDataType(DataType.AWS_EC2_IMAGE) + .withDescription("aygihzeaxvodxejsnmnkp") + .withName("wvvx") + .withPolicies("ahuep") + .withTier(Tier.ADVANCED) + .withType(Type.fromString("String")) + .withValue("wecofehml")) + .withPublicCloudConnectorsResourceId("mhesebimtvrlvvbkiswfalddqhilrp") + .withAwsAccountId("kxxdlwjrdytmfznuxkd") + .withArn("rzxpagnscd") + .withPublicCloudResourceName("sdtc") + .withAwsSourceSchema("yuexfxhmpunhdtxzdrkz") + .withAwsRegion("ujrrnxtayjeezffngymhkfhtrgjvpz") + .withAwsTags(mapOf("key8903", "fakeTokenPlaceholder"))) + .create(); + } + + // Use "Map.of" if available + @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/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/SsmParametersDeleteSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/SsmParametersDeleteSamples.java new file mode 100644 index 000000000000..84401160bc01 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/SsmParametersDeleteSamples.java @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +/** + * Samples for SsmParameters Delete. + */ +public final class SsmParametersDeleteSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * SsmParameters_Delete.json + */ + /** + * Sample code: SsmParameters_Delete. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void ssmParametersDelete(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.ssmParameters() + .delete("rgssmParameter", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/SsmParametersGetByResourceGroupSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/SsmParametersGetByResourceGroupSamples.java new file mode 100644 index 000000000000..93d068cef6de --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/SsmParametersGetByResourceGroupSamples.java @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +/** + * Samples for SsmParameters GetByResourceGroup. + */ +public final class SsmParametersGetByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/SsmParameters_Get. + * json + */ + /** + * Sample code: SsmParameters_Get. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void ssmParametersGet(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.ssmParameters() + .getByResourceGroupWithResponse("rgssmParameter", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/SsmParametersListByResourceGroupSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/SsmParametersListByResourceGroupSamples.java new file mode 100644 index 000000000000..b1850f4971b6 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/SsmParametersListByResourceGroupSamples.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +/** + * Samples for SsmParameters ListByResourceGroup. + */ +public final class SsmParametersListByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * SsmParameters_ListByResourceGroup.json + */ + /** + * Sample code: SsmParameters_ListByResourceGroup. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + ssmParametersListByResourceGroup(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.ssmParameters().listByResourceGroup("rgssmParameter", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/SsmParametersListSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/SsmParametersListSamples.java new file mode 100644 index 000000000000..b9236f24d61b --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/SsmParametersListSamples.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +/** + * Samples for SsmParameters List. + */ +public final class SsmParametersListSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * SsmParameters_ListBySubscription.json + */ + /** + * Sample code: SsmParameters_ListBySubscription. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + ssmParametersListBySubscription(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.ssmParameters().list(com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/SsmParametersUpdateSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/SsmParametersUpdateSamples.java new file mode 100644 index 000000000000..730f17adf159 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/SsmParametersUpdateSamples.java @@ -0,0 +1,45 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +import com.azure.resourcemanager.awsconnector.models.SsmParameter; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for SsmParameters Update. + */ +public final class SsmParametersUpdateSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * SsmParameters_Update.json + */ + /** + * Sample code: SsmParameters_Update. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void ssmParametersUpdate(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + SsmParameter resource = manager.ssmParameters() + .getByResourceGroupWithResponse("rgssmParameter", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE) + .getValue(); + resource.update().withTags(mapOf("key4464", "fakeTokenPlaceholder")).apply(); + } + + // Use "Map.of" if available + @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/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/SsmResourceComplianceSummaryItemsCreateOrReplaceSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/SsmResourceComplianceSummaryItemsCreateOrReplaceSamples.java new file mode 100644 index 000000000000..a329df705174 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/SsmResourceComplianceSummaryItemsCreateOrReplaceSamples.java @@ -0,0 +1,86 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +import com.azure.resourcemanager.awsconnector.models.AwsSsmResourceComplianceSummaryItemProperties; +import com.azure.resourcemanager.awsconnector.models.ComplianceExecutionSummary; +import com.azure.resourcemanager.awsconnector.models.ComplianceSeverity; +import com.azure.resourcemanager.awsconnector.models.ComplianceSeverityEnumValue; +import com.azure.resourcemanager.awsconnector.models.ComplianceStatus; +import com.azure.resourcemanager.awsconnector.models.ComplianceStatusEnumValue; +import com.azure.resourcemanager.awsconnector.models.CompliantSummary; +import com.azure.resourcemanager.awsconnector.models.NonCompliantSummary; +import com.azure.resourcemanager.awsconnector.models.SeveritySummary; +import com.azure.resourcemanager.awsconnector.models.SsmResourceComplianceSummaryItemProperties; +import java.time.OffsetDateTime; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for SsmResourceComplianceSummaryItems CreateOrReplace. + */ +public final class SsmResourceComplianceSummaryItemsCreateOrReplaceSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * SsmResourceComplianceSummaryItems_CreateOrReplace.json + */ + /** + * Sample code: SsmResourceComplianceSummaryItems_CreateOrReplace. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void ssmResourceComplianceSummaryItemsCreateOrReplace( + com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.ssmResourceComplianceSummaryItems() + .define("Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])") + .withRegion("kr") + .withExistingResourceGroup("rgssmResourceComplianceSummaryItem") + .withTags(mapOf("key3147", "fakeTokenPlaceholder")) + .withProperties(new SsmResourceComplianceSummaryItemProperties() + .withAwsProperties(new AwsSsmResourceComplianceSummaryItemProperties().withComplianceType("fblmjhswva") + .withCompliantSummary(new CompliantSummary().withCompliantCount(2) + .withSeveritySummary(new SeveritySummary().withCriticalCount(7) + .withHighCount(18) + .withInformationalCount(17) + .withLowCount(19) + .withMediumCount(20) + .withUnspecifiedCount(11))) + .withExecutionSummary(new ComplianceExecutionSummary().withExecutionId("ngwakxvtdysew") + .withExecutionTime(OffsetDateTime.parse("2024-10-08T03:48:53.913Z")) + .withExecutionType("wjneewwqlrtdntdsot")) + .withNonCompliantSummary(new NonCompliantSummary().withNonCompliantCount(18) + .withSeveritySummary(new SeveritySummary().withCriticalCount(7) + .withHighCount(18) + .withInformationalCount(17) + .withLowCount(19) + .withMediumCount(20) + .withUnspecifiedCount(11))) + .withOverallSeverity(new ComplianceSeverityEnumValue().withValue(ComplianceSeverity.CRITICAL)) + .withResourceId("muhsukivzcqvnlxiyrudvdymmii") + .withResourceType("rphjdvzvwasngsqoozoivduj") + .withStatus(new ComplianceStatusEnumValue().withValue(ComplianceStatus.COMPLIANT))) + .withPublicCloudConnectorsResourceId("lghqnauuu") + .withAwsAccountId("taqkptjbkqarwksdmfumdyi") + .withArn("s") + .withPublicCloudResourceName("qvohsbyuajd") + .withAwsSourceSchema("ppxlpfsm") + .withAwsRegion("hkemdhobdaxfwcvdjohvqtwpmjezu") + .withAwsTags(mapOf("key3567", "fakeTokenPlaceholder"))) + .create(); + } + + // Use "Map.of" if available + @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/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/SsmResourceComplianceSummaryItemsDeleteSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/SsmResourceComplianceSummaryItemsDeleteSamples.java new file mode 100644 index 000000000000..9c8c917420a5 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/SsmResourceComplianceSummaryItemsDeleteSamples.java @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +/** + * Samples for SsmResourceComplianceSummaryItems Delete. + */ +public final class SsmResourceComplianceSummaryItemsDeleteSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * SsmResourceComplianceSummaryItems_Delete.json + */ + /** + * Sample code: SsmResourceComplianceSummaryItems_Delete. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + ssmResourceComplianceSummaryItemsDelete(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.ssmResourceComplianceSummaryItems() + .delete("rgssmResourceComplianceSummaryItem", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/SsmResourceComplianceSummaryItemsGetByResourceGroupSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/SsmResourceComplianceSummaryItemsGetByResourceGroupSamples.java new file mode 100644 index 000000000000..fb7a0fa0a7a9 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/SsmResourceComplianceSummaryItemsGetByResourceGroupSamples.java @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +/** + * Samples for SsmResourceComplianceSummaryItems GetByResourceGroup. + */ +public final class SsmResourceComplianceSummaryItemsGetByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * SsmResourceComplianceSummaryItems_Get.json + */ + /** + * Sample code: SsmResourceComplianceSummaryItems_Get. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + ssmResourceComplianceSummaryItemsGet(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.ssmResourceComplianceSummaryItems() + .getByResourceGroupWithResponse("rgssmResourceComplianceSummaryItem", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/SsmResourceComplianceSummaryItemsListByResourceGroupSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/SsmResourceComplianceSummaryItemsListByResourceGroupSamples.java new file mode 100644 index 000000000000..05c7f4a100e8 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/SsmResourceComplianceSummaryItemsListByResourceGroupSamples.java @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +/** + * Samples for SsmResourceComplianceSummaryItems ListByResourceGroup. + */ +public final class SsmResourceComplianceSummaryItemsListByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * SsmResourceComplianceSummaryItems_ListByResourceGroup.json + */ + /** + * Sample code: SsmResourceComplianceSummaryItems_ListByResourceGroup. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void ssmResourceComplianceSummaryItemsListByResourceGroup( + com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.ssmResourceComplianceSummaryItems() + .listByResourceGroup("rgssmResourceComplianceSummaryItem", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/SsmResourceComplianceSummaryItemsListSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/SsmResourceComplianceSummaryItemsListSamples.java new file mode 100644 index 000000000000..ffe43458a239 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/SsmResourceComplianceSummaryItemsListSamples.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +/** + * Samples for SsmResourceComplianceSummaryItems List. + */ +public final class SsmResourceComplianceSummaryItemsListSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * SsmResourceComplianceSummaryItems_ListBySubscription.json + */ + /** + * Sample code: SsmResourceComplianceSummaryItems_ListBySubscription. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void ssmResourceComplianceSummaryItemsListBySubscription( + com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.ssmResourceComplianceSummaryItems().list(com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/SsmResourceComplianceSummaryItemsUpdateSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/SsmResourceComplianceSummaryItemsUpdateSamples.java new file mode 100644 index 000000000000..8323ad49a8d2 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/SsmResourceComplianceSummaryItemsUpdateSamples.java @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +import com.azure.resourcemanager.awsconnector.models.SsmResourceComplianceSummaryItem; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for SsmResourceComplianceSummaryItems Update. + */ +public final class SsmResourceComplianceSummaryItemsUpdateSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * SsmResourceComplianceSummaryItems_Update.json + */ + /** + * Sample code: SsmResourceComplianceSummaryItems_Update. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + ssmResourceComplianceSummaryItemsUpdate(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + SsmResourceComplianceSummaryItem resource = manager.ssmResourceComplianceSummaryItems() + .getByResourceGroupWithResponse("rgssmResourceComplianceSummaryItem", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE) + .getValue(); + resource.update().withTags(mapOf("key7866", "fakeTokenPlaceholder")).apply(); + } + + // Use "Map.of" if available + @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/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/WafWebAclSummariesCreateOrReplaceSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/WafWebAclSummariesCreateOrReplaceSamples.java new file mode 100644 index 000000000000..c0454e9fd87a --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/WafWebAclSummariesCreateOrReplaceSamples.java @@ -0,0 +1,57 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +import com.azure.resourcemanager.awsconnector.models.AwsWafWebAclSummaryProperties; +import com.azure.resourcemanager.awsconnector.models.WafWebAclSummaryProperties; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for WafWebAclSummaries CreateOrReplace. + */ +public final class WafWebAclSummariesCreateOrReplaceSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * WafWebAclSummaries_CreateOrReplace.json + */ + /** + * Sample code: WafWebAclSummaries_CreateOrReplace. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + wafWebAclSummariesCreateOrReplace(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.wafWebAclSummaries() + .define("Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])") + .withRegion("bpposymcoxqcolyqmtfpvoh") + .withExistingResourceGroup("rgwafWebACLSummary") + .withTags(mapOf("key2706", "fakeTokenPlaceholder")) + .withProperties(new WafWebAclSummaryProperties() + .withAwsProperties( + new AwsWafWebAclSummaryProperties().withName("rrwaevjnkowkxlccaw").withWebAclId("hh")) + .withPublicCloudConnectorsResourceId("kzgpy") + .withAwsAccountId("ovompqprisse") + .withArn("gorpeccxrhf") + .withPublicCloudResourceName("lejvxofzybufrazktgotrowforlsrp") + .withAwsSourceSchema("afgujkvjwspbbruhwbeji") + .withAwsRegion("nnnmvzddsej") + .withAwsTags(mapOf("key8890", "fakeTokenPlaceholder"))) + .create(); + } + + // Use "Map.of" if available + @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/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/WafWebAclSummariesDeleteSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/WafWebAclSummariesDeleteSamples.java new file mode 100644 index 000000000000..c7555d6f0e65 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/WafWebAclSummariesDeleteSamples.java @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +/** + * Samples for WafWebAclSummaries Delete. + */ +public final class WafWebAclSummariesDeleteSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * WafWebAclSummaries_Delete.json + */ + /** + * Sample code: WafWebAclSummaries_Delete. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void wafWebAclSummariesDelete(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.wafWebAclSummaries() + .delete("rgwafWebACLSummary", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/WafWebAclSummariesGetByResourceGroupSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/WafWebAclSummariesGetByResourceGroupSamples.java new file mode 100644 index 000000000000..8211b2ae7615 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/WafWebAclSummariesGetByResourceGroupSamples.java @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +/** + * Samples for WafWebAclSummaries GetByResourceGroup. + */ +public final class WafWebAclSummariesGetByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * WafWebAclSummaries_Get.json + */ + /** + * Sample code: WafWebAclSummaries_Get. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void wafWebAclSummariesGet(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.wafWebAclSummaries() + .getByResourceGroupWithResponse("rgwafWebACLSummary", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/WafWebAclSummariesListByResourceGroupSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/WafWebAclSummariesListByResourceGroupSamples.java new file mode 100644 index 000000000000..b310c56e8062 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/WafWebAclSummariesListByResourceGroupSamples.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +/** + * Samples for WafWebAclSummaries ListByResourceGroup. + */ +public final class WafWebAclSummariesListByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * WafWebAclSummaries_ListByResourceGroup.json + */ + /** + * Sample code: WafWebAclSummaries_ListByResourceGroup. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + wafWebAclSummariesListByResourceGroup(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.wafWebAclSummaries().listByResourceGroup("rgwafWebACLSummary", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/WafWebAclSummariesListSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/WafWebAclSummariesListSamples.java new file mode 100644 index 000000000000..c0e6c248935f --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/WafWebAclSummariesListSamples.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +/** + * Samples for WafWebAclSummaries List. + */ +public final class WafWebAclSummariesListSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * WafWebAclSummaries_ListBySubscription.json + */ + /** + * Sample code: WafWebAclSummaries_ListBySubscription. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + wafWebAclSummariesListBySubscription(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.wafWebAclSummaries().list(com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/WafWebAclSummariesUpdateSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/WafWebAclSummariesUpdateSamples.java new file mode 100644 index 000000000000..80ef5a63f5b0 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/WafWebAclSummariesUpdateSamples.java @@ -0,0 +1,45 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +import com.azure.resourcemanager.awsconnector.models.WafWebAclSummary; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for WafWebAclSummaries Update. + */ +public final class WafWebAclSummariesUpdateSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * WafWebAclSummaries_Update.json + */ + /** + * Sample code: WafWebAclSummaries_Update. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void wafWebAclSummariesUpdate(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + WafWebAclSummary resource = manager.wafWebAclSummaries() + .getByResourceGroupWithResponse("rgwafWebACLSummary", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE) + .getValue(); + resource.update().withTags(mapOf("key7911", "fakeTokenPlaceholder")).apply(); + } + + // Use "Map.of" if available + @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/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/Wafv2LoggingConfigurationsCreateOrReplaceSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/Wafv2LoggingConfigurationsCreateOrReplaceSamples.java new file mode 100644 index 000000000000..b33658f28e16 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/Wafv2LoggingConfigurationsCreateOrReplaceSamples.java @@ -0,0 +1,81 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +import com.azure.resourcemanager.awsconnector.models.Action; +import com.azure.resourcemanager.awsconnector.models.ActionConditionModelProperties; +import com.azure.resourcemanager.awsconnector.models.AwsWafv2LoggingConfigurationProperties; +import com.azure.resourcemanager.awsconnector.models.Condition; +import com.azure.resourcemanager.awsconnector.models.DefaultBehavior; +import com.azure.resourcemanager.awsconnector.models.FieldToMatch; +import com.azure.resourcemanager.awsconnector.models.FilterAutoGenerated; +import com.azure.resourcemanager.awsconnector.models.FilterBehavior; +import com.azure.resourcemanager.awsconnector.models.FilterRequirement; +import com.azure.resourcemanager.awsconnector.models.LabelNameConditionModelProperties; +import com.azure.resourcemanager.awsconnector.models.LoggingFilterModelProperties; +import com.azure.resourcemanager.awsconnector.models.SingleHeaderModelProperties; +import com.azure.resourcemanager.awsconnector.models.Wafv2LoggingConfigurationProperties; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for Wafv2LoggingConfigurations CreateOrReplace. + */ +public final class Wafv2LoggingConfigurationsCreateOrReplaceSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * Wafv2LoggingConfigurations_CreateOrReplace.json + */ + /** + * Sample code: Wafv2LoggingConfigurations_CreateOrReplace. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + wafv2LoggingConfigurationsCreateOrReplace(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.wafv2LoggingConfigurations() + .define("Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])") + .withRegion("miqjaa") + .withExistingResourceGroup("rgwafv2LoggingConfiguration") + .withTags(mapOf("key643", "fakeTokenPlaceholder")) + .withProperties( + new Wafv2LoggingConfigurationProperties() + .withAwsProperties(new AwsWafv2LoggingConfigurationProperties() + .withLogDestinationConfigs(Arrays.asList("lyxpldjogdqpffwthdto")) + .withLoggingFilter(new LoggingFilterModelProperties().withDefaultBehavior(DefaultBehavior.DROP) + .withFilters(Arrays.asList(new FilterAutoGenerated().withBehavior(FilterBehavior.DROP) + .withConditions(Arrays.asList(new Condition() + .withActionCondition(new ActionConditionModelProperties().withAction(Action.ALLOW)) + .withLabelNameCondition(new LabelNameConditionModelProperties() + .withLabelName("oypkvstyighnjavknhfon")))) + .withRequirement(FilterRequirement.MEETS_ALL)))) + .withManagedByFirewallManager(true) + .withRedactedFields(Arrays.asList( + new FieldToMatch().withSingleHeader(new SingleHeaderModelProperties().withName("bfqodp")))) + .withResourceArn("bnozeamipjgc")) + .withPublicCloudConnectorsResourceId("towziecfnbhswtodyqkkqrtatogbl") + .withAwsAccountId("opcrasgtswrifmkonwy") + .withArn("vvamx") + .withPublicCloudResourceName("eniprewwy") + .withAwsSourceSchema("ywgazosjmcwothayguih") + .withAwsRegion("kkwxoqqqiadksrmfpvopq") + .withAwsTags(mapOf("key5392", "fakeTokenPlaceholder"))) + .create(); + } + + // Use "Map.of" if available + @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/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/Wafv2LoggingConfigurationsDeleteSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/Wafv2LoggingConfigurationsDeleteSamples.java new file mode 100644 index 000000000000..73a50d31a1fa --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/Wafv2LoggingConfigurationsDeleteSamples.java @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +/** + * Samples for Wafv2LoggingConfigurations Delete. + */ +public final class Wafv2LoggingConfigurationsDeleteSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * Wafv2LoggingConfigurations_Delete.json + */ + /** + * Sample code: Wafv2LoggingConfigurations_Delete. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + wafv2LoggingConfigurationsDelete(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.wafv2LoggingConfigurations() + .delete("rgwafv2LoggingConfiguration", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/Wafv2LoggingConfigurationsGetByResourceGroupSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/Wafv2LoggingConfigurationsGetByResourceGroupSamples.java new file mode 100644 index 000000000000..ee39dbe607b0 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/Wafv2LoggingConfigurationsGetByResourceGroupSamples.java @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +/** + * Samples for Wafv2LoggingConfigurations GetByResourceGroup. + */ +public final class Wafv2LoggingConfigurationsGetByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * Wafv2LoggingConfigurations_Get.json + */ + /** + * Sample code: Wafv2LoggingConfigurations_Get. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + wafv2LoggingConfigurationsGet(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.wafv2LoggingConfigurations() + .getByResourceGroupWithResponse("rgwafv2LoggingConfiguration", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/Wafv2LoggingConfigurationsListByResourceGroupSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/Wafv2LoggingConfigurationsListByResourceGroupSamples.java new file mode 100644 index 000000000000..11ce87d99c38 --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/Wafv2LoggingConfigurationsListByResourceGroupSamples.java @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +/** + * Samples for Wafv2LoggingConfigurations ListByResourceGroup. + */ +public final class Wafv2LoggingConfigurationsListByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * Wafv2LoggingConfigurations_ListByResourceGroup.json + */ + /** + * Sample code: Wafv2LoggingConfigurations_ListByResourceGroup. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void wafv2LoggingConfigurationsListByResourceGroup( + com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.wafv2LoggingConfigurations() + .listByResourceGroup("rgwafv2LoggingConfiguration", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/Wafv2LoggingConfigurationsListSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/Wafv2LoggingConfigurationsListSamples.java new file mode 100644 index 000000000000..0cc54cda08aa --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/Wafv2LoggingConfigurationsListSamples.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +/** + * Samples for Wafv2LoggingConfigurations List. + */ +public final class Wafv2LoggingConfigurationsListSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * Wafv2LoggingConfigurations_ListBySubscription.json + */ + /** + * Sample code: Wafv2LoggingConfigurations_ListBySubscription. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void wafv2LoggingConfigurationsListBySubscription( + com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + manager.wafv2LoggingConfigurations().list(com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/Wafv2LoggingConfigurationsUpdateSamples.java b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/Wafv2LoggingConfigurationsUpdateSamples.java new file mode 100644 index 000000000000..013b5d390dae --- /dev/null +++ b/sdk/awsconnector/azure-resourcemanager-awsconnector/src/samples/java/com/azure/resourcemanager/awsconnector/generated/Wafv2LoggingConfigurationsUpdateSamples.java @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.awsconnector.generated; + +import com.azure.resourcemanager.awsconnector.models.Wafv2LoggingConfiguration; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for Wafv2LoggingConfigurations Update. + */ +public final class Wafv2LoggingConfigurationsUpdateSamples { + /* + * x-ms-original-file: + * specification/awsconnector/resource-manager/Microsoft.AwsConnector/stable/2024-12-01/examples/ + * Wafv2LoggingConfigurations_Update.json + */ + /** + * Sample code: Wafv2LoggingConfigurations_Update. + * + * @param manager Entry point to AwsconnectorManager. + */ + public static void + wafv2LoggingConfigurationsUpdate(com.azure.resourcemanager.awsconnector.AwsconnectorManager manager) { + Wafv2LoggingConfiguration resource = manager.wafv2LoggingConfigurations() + .getByResourceGroupWithResponse("rgwafv2LoggingConfiguration", + "Replace this value with a string matching RegExp ^(z=.{0,259}[^zs.]$)(z!.*[zzzzzzzz])", + com.azure.core.util.Context.NONE) + .getValue(); + resource.update().withTags(mapOf("key6151", "fakeTokenPlaceholder")).apply(); + } + + // Use "Map.of" if available + @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/awsconnector/ci.yml b/sdk/awsconnector/ci.yml new file mode 100644 index 000000000000..cdcebbedb38d --- /dev/null +++ b/sdk/awsconnector/ci.yml @@ -0,0 +1,46 @@ +# NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. + +trigger: + branches: + include: + - main + - hotfix/* + - release/* + paths: + include: + - sdk/awsconnector/ci.yml + - sdk/awsconnector/azure-resourcemanager-awsconnector/ + exclude: + - sdk/awsconnector/pom.xml + - sdk/awsconnector/azure-resourcemanager-awsconnector/pom.xml + +pr: + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/awsconnector/ci.yml + - sdk/awsconnector/azure-resourcemanager-awsconnector/ + exclude: + - sdk/awsconnector/pom.xml + - sdk/awsconnector/azure-resourcemanager-awsconnector/pom.xml + +parameters: + - name: release_azureresourcemanagerawsconnector + displayName: azure-resourcemanager-awsconnector + type: boolean + default: false + +extends: + template: ../../eng/pipelines/templates/stages/archetype-sdk-client.yml + parameters: + ServiceDirectory: awsconnector + Artifacts: + - name: azure-resourcemanager-awsconnector + groupId: com.azure.resourcemanager + safeName: azureresourcemanagerawsconnector + releaseInBatch: ${{ parameters.release_azureresourcemanagerawsconnector }} diff --git a/sdk/awsconnector/pom.xml b/sdk/awsconnector/pom.xml new file mode 100644 index 000000000000..c8ef959133a9 --- /dev/null +++ b/sdk/awsconnector/pom.xml @@ -0,0 +1,15 @@ + + + 4.0.0 + com.azure + azure-awsconnector-service + pom + 1.0.0 + + + azure-resourcemanager-awsconnector + +